From: support Date: Thu, 12 Jan 2023 16:07:59 +0000 (+0000) Subject: Built motion from commit ac06311e.|2.6.28 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=b4b589ce17d710436457f9c14e03fafcfd9d5d2b;p=motion2.git Built motion from commit ac06311e.|2.6.28 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 7b4aac7..c452c35 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-12T15:37:56.892Z", + "time": "2023-01-12T15:59:12.322Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 0f3cae6..c450808 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-12T15:37:56.892Z", + "time": "2023-01-12T15:59:12.322Z", "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 ed9b08d..97fc0e8 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 _0xe37a=['getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','sequelize','exports','VIRTUAL'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe37a,0x1bd));var _0xae37=function(_0x48b541,_0x5b7b2c){_0x48b541=_0x48b541-0x0;var _0x48aae3=_0xe37a[_0x48b541];return _0x48aae3;};'use strict';var Sequelize=require(_0xae37('0x0'));module[_0xae37('0x1')]={'name':{'type':Sequelize[_0xae37('0x2')],'get':function(_0x2bb14b){return this[_0xae37('0x3')](_0xae37('0x4'));}},'action':{'type':Sequelize[_0xae37('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xae37('0x6'),'integration',_0xae37('0x7'),_0xae37('0x8'),_0xae37('0x9'),_0xae37('0xa'),_0xae37('0xb'),_0xae37('0xc')]],'msg':_0xae37('0xd')}},'comment':_0xae37('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xae37('0xe')},'data2':{'type':Sequelize[_0xae37('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xae37('0x5')](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[_0xae37('0x5')](0x1000),'comments':_0xae37('0xf')},'data5':{'type':Sequelize[_0xae37('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x2aa0=['sequelize','exports','getDataValue','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x512ce0,_0xf5e83f){var _0x7118b0=function(_0x26010){while(--_0x26010){_0x512ce0['push'](_0x512ce0['shift']());}};_0x7118b0(++_0xf5e83f);}(_0x2aa0,0x6c));var _0x02aa=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2aa0[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x02aa('0x0'));module[_0x02aa('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x13e896){return this[_0x02aa('0x2')]('action');}},'action':{'type':Sequelize[_0x02aa('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x02aa('0x4'),_0x02aa('0x5'),_0x02aa('0x6'),_0x02aa('0x7'),_0x02aa('0x8'),_0x02aa('0x9'),_0x02aa('0xa')]],'msg':_0x02aa('0xb')}},'comment':_0x02aa('0xb')},'data1':{'type':Sequelize[_0x02aa('0x3')](0x1000),'comment':_0x02aa('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x02aa('0xd')},'data3':{'type':Sequelize[_0x02aa('0x3')](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[_0x02aa('0x3')](0x1000),'comments':_0x02aa('0xe')},'data5':{'type':Sequelize[_0x02aa('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x02aa('0xf')},'data7':{'type':Sequelize[_0x02aa('0x10')],'comments':_0x02aa('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 12161ae..786fb18 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 _0x0d36=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','end','error','name','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x58205b,_0x33ef52){var _0x4fda4c=function(_0x10f4e8){while(--_0x10f4e8){_0x58205b['push'](_0x58205b['shift']());}};_0x4fda4c(++_0x33ef52);}(_0x0d36,0x1e8));var _0x60d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d36[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x60d3('0x0'));var rimraf=require(_0x60d3('0x1'));var zipdir=require(_0x60d3('0x2'));var jsonpatch=require(_0x60d3('0x3'));var rp=require('request-promise');var moment=require(_0x60d3('0x4'));var BPromise=require(_0x60d3('0x5'));var Mustache=require('mustache');var util=require(_0x60d3('0x6'));var path=require('path');var sox=require(_0x60d3('0x7'));var csv=require(_0x60d3('0x8'));var ejs=require(_0x60d3('0x9'));var fs=require('fs');var fs_extra=require(_0x60d3('0xa'));var _=require('lodash');var squel=require(_0x60d3('0xb'));var crypto=require(_0x60d3('0xc'));var jsforce=require(_0x60d3('0xd'));var deskjs=require(_0x60d3('0xe'));var toCsv=require(_0x60d3('0x8'));var querystring=require(_0x60d3('0xf'));var Papa=require(_0x60d3('0x10'));var Redis=require(_0x60d3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x60d3('0x12'));var as=require(_0x60d3('0x13'));var hardwareService=require(_0x60d3('0x14'));var logger=require(_0x60d3('0x15'))('api');var utils=require(_0x60d3('0x16'));var config=require(_0x60d3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x60d3('0x18'))['db'];function respondWithStatusCode(_0x284d83,_0xfc75c7){_0xfc75c7=_0xfc75c7||0xcc;return function(_0x340b57){if(_0x340b57){return _0x284d83[_0x60d3('0x19')](_0xfc75c7);}return _0x284d83[_0x60d3('0x1a')](_0xfc75c7)['end']();};}function respondWithResult(_0x1f84e7,_0x524255){_0x524255=_0x524255||0xc8;return function(_0x9cdd1d){if(_0x9cdd1d){return _0x1f84e7[_0x60d3('0x1a')](_0x524255)[_0x60d3('0x1b')](_0x9cdd1d);}};}function respondWithFilteredResult(_0xf36044,_0x299796){return function(_0x3782aa){if(_0x3782aa){var _0x107ab3=typeof _0x299796[_0x60d3('0x1c')]==='undefined'&&typeof _0x299796[_0x60d3('0x1d')]===_0x60d3('0x1e');var _0x150409=_0x3782aa['count'];var _0x4c7b8b=_0x107ab3?0x0:_0x299796[_0x60d3('0x1c')];var _0x3a9141=_0x107ab3?_0x3782aa[_0x60d3('0x1f')]:_0x299796[_0x60d3('0x1c')]+_0x299796[_0x60d3('0x1d')];var _0x3c16a5;if(_0x3a9141>=_0x150409){_0x3a9141=_0x150409;_0x3c16a5=0xc8;}else{_0x3c16a5=0xce;}_0xf36044[_0x60d3('0x1a')](_0x3c16a5);return _0xf36044[_0x60d3('0x20')](_0x60d3('0x21'),_0x4c7b8b+'-'+_0x3a9141+'/'+_0x150409)['json'](_0x3782aa);}return null;};}function patchUpdates(_0x4c8422){return function(_0x44ede5){try{jsonpatch[_0x60d3('0x22')](_0x44ede5,_0x4c8422,!![]);}catch(_0x57b808){return BPromise['reject'](_0x57b808);}return _0x44ede5['save']();};}function saveUpdates(_0x10c61d,_0x47e500){return function(_0xc9c0a5){if(_0xc9c0a5){return _0xc9c0a5[_0x60d3('0x23')](_0x10c61d)['then'](function(_0x560014){return _0x560014;});}return null;};}function removeEntity(_0x25349c,_0x59b471){return function(_0x131d04){if(_0x131d04){return _0x131d04[_0x60d3('0x24')]()[_0x60d3('0x25')](function(){_0x25349c[_0x60d3('0x1a')](0xcc)[_0x60d3('0x26')]();});}};}function handleEntityNotFound(_0x5a552f,_0xcbeaf7){return function(_0x325036){if(!_0x325036){_0x5a552f[_0x60d3('0x19')](0x194);}return _0x325036;};}function handleError(_0x53bef5,_0x249169){_0x249169=_0x249169||0x1f4;return function(_0x3179a9){logger[_0x60d3('0x27')](_0x3179a9['stack']);if(_0x3179a9['name']){delete _0x3179a9[_0x60d3('0x28')];}_0x53bef5[_0x60d3('0x1a')](_0x249169)['send'](_0x3179a9);};}exports[_0x60d3('0x23')]=function(_0x2ef93f,_0x51a066){if(_0x2ef93f[_0x60d3('0x29')]['id']){delete _0x2ef93f['body']['id'];}return db[_0x60d3('0x2a')][_0x60d3('0x2b')]({'where':{'id':_0x2ef93f[_0x60d3('0x2c')]['id']}})[_0x60d3('0x25')](handleEntityNotFound(_0x51a066,null))[_0x60d3('0x25')](saveUpdates(_0x2ef93f[_0x60d3('0x29')],null))[_0x60d3('0x25')](respondWithResult(_0x51a066,null))[_0x60d3('0x2d')](handleError(_0x51a066,null));};exports[_0x60d3('0x24')]=function(_0x286fab,_0x52f611){return db[_0x60d3('0x2a')][_0x60d3('0x2b')]({'where':{'id':_0x286fab[_0x60d3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x52f611,null))[_0x60d3('0x25')](removeEntity(_0x52f611,null))[_0x60d3('0x2d')](handleError(_0x52f611,null));}; \ No newline at end of file +var _0xda6d=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','body','Action','catch','find','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xa87db6,_0x7fb711){var _0x48ae12=function(_0x5aae8d){while(--_0x5aae8d){_0xa87db6['push'](_0xa87db6['shift']());}};_0x48ae12(++_0x7fb711);}(_0xda6d,0xea));var _0xdda6=function(_0x32a9c4,_0x2d26b5){_0x32a9c4=_0x32a9c4-0x0;var _0x1e5d01=_0xda6d[_0x32a9c4];return _0x1e5d01;};'use strict';var emlformat=require(_0xdda6('0x0'));var rimraf=require(_0xdda6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdda6('0x2'));var rp=require(_0xdda6('0x3'));var moment=require('moment');var BPromise=require(_0xdda6('0x4'));var Mustache=require(_0xdda6('0x5'));var util=require('util');var path=require(_0xdda6('0x6'));var sox=require('sox');var csv=require(_0xdda6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdda6('0x8'));var squel=require('squel');var crypto=require(_0xdda6('0x9'));var jsforce=require(_0xdda6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdda6('0x7'));var querystring=require(_0xdda6('0xb'));var Papa=require(_0xdda6('0xc'));var Redis=require(_0xdda6('0xd'));var authService=require(_0xdda6('0xe'));var qs=require(_0xdda6('0xf'));var as=require(_0xdda6('0x10'));var hardwareService=require(_0xdda6('0x11'));var logger=require(_0xdda6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdda6('0x13'));var licenseUtil=require(_0xdda6('0x14'));var db=require(_0xdda6('0x15'))['db'];function respondWithStatusCode(_0x33de47,_0x17ef47){_0x17ef47=_0x17ef47||0xcc;return function(_0x26aba7){if(_0x26aba7){return _0x33de47[_0xdda6('0x16')](_0x17ef47);}return _0x33de47[_0xdda6('0x17')](_0x17ef47)[_0xdda6('0x18')]();};}function respondWithResult(_0x4d2f94,_0x50a45e){_0x50a45e=_0x50a45e||0xc8;return function(_0x5d11ed){if(_0x5d11ed){return _0x4d2f94[_0xdda6('0x17')](_0x50a45e)[_0xdda6('0x19')](_0x5d11ed);}};}function respondWithFilteredResult(_0x228a24,_0x20d3a7){return function(_0x4e654e){if(_0x4e654e){var _0x139f4d=typeof _0x20d3a7[_0xdda6('0x1a')]==='undefined'&&typeof _0x20d3a7[_0xdda6('0x1b')]==='undefined';var _0x4f1b99=_0x4e654e[_0xdda6('0x1c')];var _0x1fcd3a=_0x139f4d?0x0:_0x20d3a7['offset'];var _0xd955=_0x139f4d?_0x4e654e[_0xdda6('0x1c')]:_0x20d3a7[_0xdda6('0x1a')]+_0x20d3a7[_0xdda6('0x1b')];var _0x385c82;if(_0xd955>=_0x4f1b99){_0xd955=_0x4f1b99;_0x385c82=0xc8;}else{_0x385c82=0xce;}_0x228a24[_0xdda6('0x17')](_0x385c82);return _0x228a24['set'](_0xdda6('0x1d'),_0x1fcd3a+'-'+_0xd955+'/'+_0x4f1b99)[_0xdda6('0x19')](_0x4e654e);}return null;};}function patchUpdates(_0x1f5239){return function(_0x208b0f){try{jsonpatch[_0xdda6('0x1e')](_0x208b0f,_0x1f5239,!![]);}catch(_0x5d9c84){return BPromise[_0xdda6('0x1f')](_0x5d9c84);}return _0x208b0f[_0xdda6('0x20')]();};}function saveUpdates(_0x3275a5,_0x5957b3){return function(_0x2bfaf4){if(_0x2bfaf4){return _0x2bfaf4[_0xdda6('0x21')](_0x3275a5)[_0xdda6('0x22')](function(_0x147713){return _0x147713;});}return null;};}function removeEntity(_0x98139,_0x3cd2ed){return function(_0x1a108c){if(_0x1a108c){return _0x1a108c[_0xdda6('0x23')]()[_0xdda6('0x22')](function(){_0x98139[_0xdda6('0x17')](0xcc)[_0xdda6('0x18')]();});}};}function handleEntityNotFound(_0x4ba5d1,_0x486a57){return function(_0x1e40fc){if(!_0x1e40fc){_0x4ba5d1['sendStatus'](0x194);}return _0x1e40fc;};}function handleError(_0x490334,_0x500e55){_0x500e55=_0x500e55||0x1f4;return function(_0x41ff31){logger['error'](_0x41ff31['stack']);if(_0x41ff31[_0xdda6('0x24')]){delete _0x41ff31[_0xdda6('0x24')];}_0x490334[_0xdda6('0x17')](_0x500e55)['send'](_0x41ff31);};}exports[_0xdda6('0x21')]=function(_0x143a0a,_0x4e54d2){if(_0x143a0a[_0xdda6('0x25')]['id']){delete _0x143a0a[_0xdda6('0x25')]['id'];}return db[_0xdda6('0x26')]['find']({'where':{'id':_0x143a0a['params']['id']}})[_0xdda6('0x22')](handleEntityNotFound(_0x4e54d2,null))['then'](saveUpdates(_0x143a0a[_0xdda6('0x25')],null))['then'](respondWithResult(_0x4e54d2,null))[_0xdda6('0x27')](handleError(_0x4e54d2,null));};exports[_0xdda6('0x23')]=function(_0x17db3e,_0x1cc766){return db[_0xdda6('0x26')][_0xdda6('0x28')]({'where':{'id':_0x17db3e[_0xdda6('0x29')]['id']}})[_0xdda6('0x22')](handleEntityNotFound(_0x1cc766,null))[_0xdda6('0x22')](removeEntity(_0x1cc766,null))[_0xdda6('0x27')](handleError(_0x1cc766,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 31b5592..5e99ef2 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 _0x401f=['moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0x18a726,_0x408f55){var _0x9f85cb=function(_0x446d3c){while(--_0x446d3c){_0x18a726['push'](_0x18a726['shift']());}};_0x9f85cb(++_0x408f55);}(_0x401f,0x1b6));var _0xf401=function(_0x38f3db,_0x36d5ff){_0x38f3db=_0x38f3db-0x0;var _0x587bb5=_0x401f[_0x38f3db];return _0x587bb5;};'use strict';var _=require(_0xf401('0x0'));var util=require(_0xf401('0x1'));var logger=require(_0xf401('0x2'))(_0xf401('0x3'));var moment=require(_0xf401('0x4'));var BPromise=require(_0xf401('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf401('0x6'));var config=require(_0xf401('0x7'));var attributes=require(_0xf401('0x8'));module[_0xf401('0x9')]=function(_0x2189f6,_0x1748e6){return _0x2189f6[_0xf401('0xa')](_0xf401('0xb'),attributes,{'tableName':_0xf401('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e2=['../../config/logger','request-promise','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','util'];(function(_0x5dbf67,_0x3d51f2){var _0x18b74d=function(_0x5052dc){while(--_0x5052dc){_0x5dbf67['push'](_0x5dbf67['shift']());}};_0x18b74d(++_0x3d51f2);}(_0xa9e2,0x1e5));var _0x2a9e=function(_0x5b747f,_0x6cdd35){_0x5b747f=_0x5b747f-0x0;var _0x1c42f4=_0xa9e2[_0x5b747f];return _0x1c42f4;};'use strict';var _=require('lodash');var util=require(_0x2a9e('0x0'));var logger=require(_0x2a9e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a9e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a9e('0x3'));var config=require(_0x2a9e('0x4'));var attributes=require(_0x2a9e('0x5'));module[_0x2a9e('0x6')]=function(_0x1129e8,_0x260776){return _0x1129e8['define'](_0x2a9e('0x7'),attributes,{'tableName':_0x2a9e('0x8'),'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 bca1ca2..3d32867 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x27858c,_0x1db761){var _0x326479=function(_0x3464ce){while(--_0x3464ce){_0x27858c['push'](_0x27858c['shift']());}};_0x326479(++_0x1db761);}(_0xe14b,0x93));var _0xbe14=function(_0x3b340f,_0x404d94){_0x3b340f=_0x3b340f-0x0;var _0x245337=_0xe14b[_0x3b340f];return _0x245337;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _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(_0x1b197e,_0x5e7c1b){var _0x21960b=function(_0x4de1d1){while(--_0x4de1d1){_0x1b197e['push'](_0x1b197e['shift']());}};_0x21960b(++_0x5e7c1b);}(_0xabce,0x103));var _0xeabc=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xabce[_0x5c351c];return _0x26f3b3;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 268ddc8..8eb2d13 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 _0x667d=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1efaea,_0x43e445){var _0x2e5b71=function(_0x5cf7eb){while(--_0x5cf7eb){_0x1efaea['push'](_0x1efaea['shift']());}};_0x2e5b71(++_0x43e445);}(_0x667d,0x86));var _0xd667=function(_0x364f17,_0x31e0e7){_0x364f17=_0x364f17-0x0;var _0x22e2cc=_0x667d[_0x364f17];return _0x22e2cc;};'use strict';var multer=require(_0xd667('0x0'));var util=require(_0xd667('0x1'));var path=require(_0xd667('0x2'));var timeout=require(_0xd667('0x3'));var express=require(_0xd667('0x4'));var router=express[_0xd667('0x5')]();var fs_extra=require(_0xd667('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd667('0x7'));var config=require(_0xd667('0x8'));var controller=require('./action.controller');router['put']('/:id',auth[_0xd667('0x9')](),controller[_0xd667('0xa')]);router[_0xd667('0xb')]('/:id',auth[_0xd667('0x9')](),controller[_0xd667('0xc')]);module[_0xd667('0xd')]=router; \ No newline at end of file +var _0x8877=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','/:id','destroy','exports'];(function(_0x57c16e,_0x5d275e){var _0x3b3a65=function(_0x2792cd){while(--_0x2792cd){_0x57c16e['push'](_0x57c16e['shift']());}};_0x3b3a65(++_0x5d275e);}(_0x8877,0x1b0));var _0x7887=function(_0x175bc6,_0xd90ea1){_0x175bc6=_0x175bc6-0x0;var _0x47cfc8=_0x8877[_0x175bc6];return _0x47cfc8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7887('0x0'));var router=express[_0x7887('0x1')]();var fs_extra=require(_0x7887('0x2'));var auth=require(_0x7887('0x3'));var interaction=require(_0x7887('0x4'));var config=require(_0x7887('0x5'));var controller=require(_0x7887('0x6'));router[_0x7887('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7887('0x8')]);router['delete'](_0x7887('0x9'),auth['isAuthenticated'](),controller[_0x7887('0xa')]);module[_0x7887('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 ece7732..ea2903c 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 _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x37c570,_0x3a2261){var _0xe4f999=function(_0xf77522){while(--_0xf77522){_0x37c570['push'](_0x37c570['shift']());}};_0xe4f999(++_0x3a2261);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x5fc3[_0x2dc96f];return _0xd012da;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}}; \ No newline at end of file +var _0x7c09=['exports','STRING','TEXT'];(function(_0x26bc42,_0xe6bb38){var _0xeef8e7=function(_0x3b545a){while(--_0x3b545a){_0x26bc42['push'](_0x26bc42['shift']());}};_0xeef8e7(++_0xe6bb38);}(_0x7c09,0x102));var _0x97c0=function(_0x5af84e,_0x1e4149){_0x5af84e=_0x5af84e-0x0;var _0x3a4389=_0x7c09[_0x5af84e];return _0x3a4389;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index fa1ed2d..b66e74b 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 _0x3a63=['sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','condition','value','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','Limited\x20Query:','toString','QueryTypes','SELECT','MAX(%s)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','groupBy','%s-%s.%s','randomstring','generate','output','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','join','../../components/export/','../../files/reports','savename','sequelize','runReport','right_join','debug','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','get','CustomReports'];(function(_0x450fa0,_0x5b14fc){var _0x26f1fe=function(_0x522c2a){while(--_0x522c2a){_0x450fa0['push'](_0x450fa0['shift']());}};_0x26f1fe(++_0x5b14fc);}(_0x3a63,0x11e));var _0x33a6=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x3a63[_0x34bc6c];return _0x168820;};'use strict';var emlformat=require(_0x33a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33a6('0x1'));var rp=require(_0x33a6('0x2'));var moment=require(_0x33a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x33a6('0x4'));var util=require('util');var path=require(_0x33a6('0x5'));var sox=require(_0x33a6('0x6'));var csv=require(_0x33a6('0x7'));var ejs=require(_0x33a6('0x8'));var fs=require('fs');var fs_extra=require(_0x33a6('0x9'));var _=require('lodash');var squel=require(_0x33a6('0xa'));var crypto=require(_0x33a6('0xb'));var jsforce=require(_0x33a6('0xc'));var deskjs=require(_0x33a6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x33a6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x33a6('0xf'));var as=require(_0x33a6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33a6('0x11'))(_0x33a6('0x12'));var utils=require(_0x33a6('0x13'));var config=require(_0x33a6('0x14'));var licenseUtil=require(_0x33a6('0x15'));var db=require(_0x33a6('0x16'))['db'];var dbH=require(_0x33a6('0x16'))[_0x33a6('0x17')];function respondWithStatusCode(_0x59366f,_0x224437){_0x224437=_0x224437||0xcc;return function(_0x5e67e0){if(_0x5e67e0){return _0x59366f['sendStatus'](_0x224437);}return _0x59366f[_0x33a6('0x18')](_0x224437)[_0x33a6('0x19')]();};}function respondWithResult(_0x2cf145,_0x1dcd8f){_0x1dcd8f=_0x1dcd8f||0xc8;return function(_0x26d7ce){if(_0x26d7ce){return _0x2cf145[_0x33a6('0x18')](_0x1dcd8f)['json'](_0x26d7ce);}};}function respondWithFilteredResult(_0x3503c6,_0x4a66d3){return function(_0x30f0b3){if(_0x30f0b3){var _0x464a78=typeof _0x4a66d3[_0x33a6('0x1a')]===_0x33a6('0x1b')&&typeof _0x4a66d3[_0x33a6('0x1c')]===_0x33a6('0x1b');var _0x49bb93=_0x30f0b3['count'];var _0x14e647=_0x464a78?0x0:_0x4a66d3[_0x33a6('0x1a')];var _0x2cfc70=_0x464a78?_0x30f0b3[_0x33a6('0x1d')]:_0x4a66d3[_0x33a6('0x1a')]+_0x4a66d3[_0x33a6('0x1c')];var _0x5541fc;if(_0x2cfc70>=_0x49bb93){_0x2cfc70=_0x49bb93;_0x5541fc=0xc8;}else{_0x5541fc=0xce;}_0x3503c6[_0x33a6('0x18')](_0x5541fc);return _0x3503c6['set'](_0x33a6('0x1e'),_0x14e647+'-'+_0x2cfc70+'/'+_0x49bb93)[_0x33a6('0x1f')](_0x30f0b3);}return null;};}function patchUpdates(_0xd5f8ee){return function(_0x3cdd2f){try{jsonpatch[_0x33a6('0x20')](_0x3cdd2f,_0xd5f8ee,!![]);}catch(_0x16432c){return BPromise[_0x33a6('0x21')](_0x16432c);}return _0x3cdd2f['save']();};}function saveUpdates(_0x190ba8,_0x4ec0d1){return function(_0x147a6b){if(_0x147a6b){return _0x147a6b[_0x33a6('0x22')](_0x190ba8)[_0x33a6('0x23')](function(_0x1673b2){return _0x1673b2;});}return null;};}function removeEntity(_0x3e41ed,_0x4f4b91){return function(_0x1b234e){if(_0x1b234e){return _0x1b234e['destroy']()[_0x33a6('0x23')](function(){var _0x105311=_0x1b234e[_0x33a6('0x24')]({'plain':!![]});var _0x1dfd65=_0x33a6('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1dfd65,'resourceId':_0x105311['id']}})[_0x33a6('0x23')](function(){return _0x1b234e;});})['then'](function(){_0x3e41ed[_0x33a6('0x18')](0xcc)[_0x33a6('0x19')]();});}};}function handleEntityNotFound(_0x4789d1,_0x5005b5){return function(_0x50bfaf){if(!_0x50bfaf){_0x4789d1[_0x33a6('0x26')](0x194);}return _0x50bfaf;};}function handleError(_0x313ea0,_0x5c2794){_0x5c2794=_0x5c2794||0x1f4;return function(_0x488226){logger[_0x33a6('0x27')](_0x488226['stack']);if(_0x488226[_0x33a6('0x28')]){delete _0x488226[_0x33a6('0x28')];}_0x313ea0[_0x33a6('0x18')](_0x5c2794)[_0x33a6('0x29')](_0x488226);};}exports[_0x33a6('0x2a')]=function(_0x1793b2,_0x38fb55){var _0x3862ae={},_0x5696db={},_0x29b89c={'count':0x0,'rows':[]};var _0x2beb2a=_[_0x33a6('0x2b')](db[_0x33a6('0x2c')][_0x33a6('0x2d')],function(_0x39218c){return{'name':_0x39218c[_0x33a6('0x2e')],'type':_0x39218c[_0x33a6('0x2f')][_0x33a6('0x30')]};});_0x5696db['model']=_[_0x33a6('0x2b')](_0x2beb2a,_0x33a6('0x28'));_0x5696db[_0x33a6('0x31')]=_[_0x33a6('0x32')](_0x1793b2[_0x33a6('0x31')]);_0x5696db[_0x33a6('0x33')]=_['intersection'](_0x5696db[_0x33a6('0x34')],_0x5696db[_0x33a6('0x31')]);_0x3862ae['attributes']=_['intersection'](_0x5696db['model'],qs[_0x33a6('0x35')](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x35')]));_0x3862ae['attributes']=_0x3862ae[_0x33a6('0x36')][_0x33a6('0x37')]?_0x3862ae['attributes']:_0x5696db[_0x33a6('0x34')];if(!_0x1793b2[_0x33a6('0x31')][_0x33a6('0x38')]('nolimit')){_0x3862ae[_0x33a6('0x1c')]=qs[_0x33a6('0x1c')](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x1c')]);_0x3862ae[_0x33a6('0x1a')]=qs[_0x33a6('0x1a')](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x1a')]);}_0x3862ae[_0x33a6('0x39')]=qs['sort'](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x3a')]);_0x3862ae[_0x33a6('0x3b')]=qs[_0x33a6('0x33')](_[_0x33a6('0x3c')](_0x1793b2[_0x33a6('0x31')],_0x5696db['filters']),_0x2beb2a);if(_0x1793b2['query'][_0x33a6('0x3d')]){_0x3862ae[_0x33a6('0x3b')]=_[_0x33a6('0x3e')](_0x3862ae['where'],{'$or':_[_0x33a6('0x2b')](_0x2beb2a,function(_0x31e74e){if(_0x31e74e[_0x33a6('0x2f')]!==_0x33a6('0x3f')){var _0x4727f1={};_0x4727f1[_0x31e74e[_0x33a6('0x28')]]={'$like':'%'+_0x1793b2['query'][_0x33a6('0x3d')]+'%'};return _0x4727f1;}})});}_0x3862ae=_['merge']({},_0x3862ae,_0x1793b2[_0x33a6('0x40')]);var _0x225fca={'where':_0x3862ae[_0x33a6('0x3b')]};return db[_0x33a6('0x2c')][_0x33a6('0x1d')](_0x225fca)[_0x33a6('0x23')](function(_0x3fa482){_0x29b89c[_0x33a6('0x1d')]=_0x3fa482;if(_0x1793b2['query'][_0x33a6('0x41')]){_0x3862ae[_0x33a6('0x42')]=[{'all':!![]}];}return db[_0x33a6('0x2c')][_0x33a6('0x43')](_0x3862ae);})['then'](function(_0x544890){_0x29b89c[_0x33a6('0x44')]=_0x544890;return _0x29b89c;})[_0x33a6('0x23')](respondWithFilteredResult(_0x38fb55,_0x3862ae))[_0x33a6('0x45')](handleError(_0x38fb55,null));};exports[_0x33a6('0x46')]=function(_0x53b73f,_0x35b20b){var _0x1e4fe8={'raw':![],'where':{'id':_0x53b73f[_0x33a6('0x47')]['id']}},_0x66d3={};_0x66d3[_0x33a6('0x34')]=_[_0x33a6('0x32')](db[_0x33a6('0x2c')][_0x33a6('0x2d')]);_0x66d3['query']=_[_0x33a6('0x32')](_0x53b73f[_0x33a6('0x31')]);_0x66d3['filters']=_[_0x33a6('0x48')](_0x66d3[_0x33a6('0x34')],_0x66d3['query']);_0x1e4fe8['attributes']=_[_0x33a6('0x48')](_0x66d3[_0x33a6('0x34')],qs[_0x33a6('0x35')](_0x53b73f[_0x33a6('0x31')]['fields']));_0x1e4fe8['attributes']=_0x1e4fe8[_0x33a6('0x36')]['length']?_0x1e4fe8[_0x33a6('0x36')]:_0x66d3[_0x33a6('0x34')];if(_0x53b73f[_0x33a6('0x31')][_0x33a6('0x41')]){_0x1e4fe8[_0x33a6('0x42')]=[{'all':!![]}];}_0x1e4fe8=_[_0x33a6('0x3e')]({},_0x1e4fe8,_0x53b73f[_0x33a6('0x40')]);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x1e4fe8)[_0x33a6('0x23')](handleEntityNotFound(_0x35b20b,null))[_0x33a6('0x23')](respondWithResult(_0x35b20b,null))[_0x33a6('0x45')](handleError(_0x35b20b,null));};exports[_0x33a6('0x4a')]=function(_0x50d2cb,_0x32183f){return db[_0x33a6('0x2c')][_0x33a6('0x4a')](_0x50d2cb[_0x33a6('0x4b')],{})[_0x33a6('0x23')](function(_0x1c8bf3){var _0x28c05b=_0x50d2cb[_0x33a6('0x4c')][_0x33a6('0x24')]({'plain':!![]});if(!_0x28c05b)throw new Error(_0x33a6('0x4d'));if(_0x28c05b[_0x33a6('0x4e')]==='user'){var _0x408b8d=_0x1c8bf3[_0x33a6('0x24')]({'plain':!![]});var _0x5792a3=_0x33a6('0x4f');return db[_0x33a6('0x50')][_0x33a6('0x49')]({'where':{'name':_0x5792a3,'userProfileId':_0x28c05b['userProfileId']},'raw':!![]})[_0x33a6('0x23')](function(_0x42049e){if(_0x42049e&&_0x42049e['autoAssociation']===0x0){return db[_0x33a6('0x51')][_0x33a6('0x4a')]({'name':_0x408b8d['name'],'resourceId':_0x408b8d['id'],'type':'CustomReports','sectionId':_0x42049e['id']},{})[_0x33a6('0x23')](function(){return _0x1c8bf3;});}else{return _0x1c8bf3;}})['catch'](function(_0x544270){logger[_0x33a6('0x27')](_0x33a6('0x52'),_0x544270);throw _0x544270;});}return _0x1c8bf3;})[_0x33a6('0x23')](respondWithResult(_0x32183f,0xc9))['catch'](handleError(_0x32183f,null));};exports['update']=function(_0x46deda,_0x49339c){if(_0x46deda[_0x33a6('0x4b')]['id']){delete _0x46deda[_0x33a6('0x4b')]['id'];}return db[_0x33a6('0x2c')]['find']({'where':{'id':_0x46deda[_0x33a6('0x47')]['id']}})['then'](handleEntityNotFound(_0x49339c,null))[_0x33a6('0x23')](saveUpdates(_0x46deda[_0x33a6('0x4b')],null))[_0x33a6('0x23')](respondWithResult(_0x49339c,null))[_0x33a6('0x45')](handleError(_0x49339c,null));};exports[_0x33a6('0x53')]=function(_0x5d412c,_0x247103){return db['AnalyticCustomReport'][_0x33a6('0x49')]({'where':{'id':_0x5d412c[_0x33a6('0x47')]['id']}})[_0x33a6('0x23')](handleEntityNotFound(_0x247103,null))[_0x33a6('0x23')](removeEntity(_0x247103,null))[_0x33a6('0x45')](handleError(_0x247103,null));};exports[_0x33a6('0x54')]=function(_0x3f6ee6,_0x5d6c39){var _0x3f9388=0xa;var _0x5e73d1=['join',_0x33a6('0x55'),'right_join',_0x33a6('0x56')];var _0x766134={'SUM':_0x33a6('0x57'),'COUNT':_0x33a6('0x58'),'COUNT DISTINCT':_0x33a6('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x33a6('0x5a'),'GROUP_CONCAT':_0x33a6('0x5b'),'GROUP_CONCAT ASC':_0x33a6('0x5c'),'GROUP_CONCAT DESC':_0x33a6('0x5d')};var _0x2ac3ba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x33a6('0x5e'),'ROUND':_0x33a6('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x213a4d=function(_0x33649e){return!_[_0x33a6('0x60')]([_0x33a6('0x61'),_0x33a6('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x33649e);};var _0x4b5c80=function(_0x565e6c){if(!_0x565e6c||!_0x565e6c[_0x33a6('0x63')][_0x33a6('0x37')]){return'';}for(var _0x96a81e='(',_0x2699bf=0x0;_0x2699bf<_0x565e6c[_0x33a6('0x63')][_0x33a6('0x37')];_0x2699bf+=0x1){_0x2699bf>0x0&&(_0x96a81e+='\x20'+_0x565e6c[_0x33a6('0x64')]+'\x20');_0x96a81e+=_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x65')]?_0x4b5c80(_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x65')]):_0x565e6c[_0x33a6('0x63')][_0x2699bf]['field']+'\x20'+_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x66')]+(_0x213a4d(_0x565e6c[_0x33a6('0x63')][_0x2699bf]['condition'])?'\x20'+_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x67')]:'');}return _0x96a81e+')';};var _0x1e44cb={'where':{'id':_0x3f6ee6[_0x33a6('0x47')]['id']}},_0x55ab84,_0x479ff4,_0x4a4489,_0x18789e,_0x4d497f;_0x1e44cb=_[_0x33a6('0x3e')]({},_0x1e44cb,_0x3f6ee6['options']);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x1e44cb)['then'](function(_0x3872d4){if(_0x3872d4){_0x55ab84=_0x3872d4;return _0x3872d4['getFields']();}return null;})[_0x33a6('0x23')](function(_0x234176){if(_0x234176){if(!_0x234176[_0x33a6('0x37')]){throw new db['Sequelize'][(_0x33a6('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x479ff4=_0x234176;return db['AnalyticMetric'][_0x33a6('0x43')]({'raw':!![]});}return null;})[_0x33a6('0x23')](function(_0x4ae312){if(_0x4ae312){_0x4a4489=_[_0x33a6('0x69')](_0x4ae312,'id');var _0x53db50;var _0x3c7f36=squel[_0x33a6('0x6a')]();_0x3c7f36[_0x33a6('0x6b')](_0x55ab84[_0x33a6('0x6c')]);for(var _0x221cf6=0x0;_0x221cf6<_0x479ff4[_0x33a6('0x37')];_0x221cf6+=0x1){_0x53db50=_0x479ff4[_0x221cf6][_0x33a6('0x6d')]?_0x4a4489[_0x479ff4[_0x221cf6][_0x33a6('0x6d')]][_0x33a6('0x6e')]:_0x479ff4[_0x221cf6][_0x33a6('0x6f')];_0x53db50=_0x479ff4[_0x221cf6][_0x33a6('0x70')]?_[_0x33a6('0x71')](_0x766134[_0x479ff4[_0x221cf6][_0x33a6('0x70')]],'%s',_0x53db50):_0x53db50;_0x53db50=_0x479ff4[_0x221cf6][_0x33a6('0x72')]?_[_0x33a6('0x71')](_0x2ac3ba[_0x479ff4[_0x221cf6][_0x33a6('0x72')]],'%s',_0x53db50):_0x53db50;if(_0x479ff4[_0x221cf6]['groupBy']){_0x3c7f36[_0x33a6('0x65')](_0x53db50);}_0x479ff4[_0x221cf6][_0x33a6('0x73')]&&_0x3c7f36[_0x33a6('0x39')](_0x53db50,_0x479ff4[_0x221cf6][_0x33a6('0x73')]===_0x33a6('0x74')?![]:!![]);_0x3c7f36['field'](_0x53db50,_0x479ff4[_0x221cf6][_0x33a6('0x75')]||_0x53db50);}if(_0x55ab84[_0x33a6('0x76')]){_0x55ab84[_0x33a6('0x76')]=JSON['parse'](_0x55ab84[_0x33a6('0x76')]);for(var _0x27ef0d=0x0;_0x27ef0d<_0x55ab84['joins'][_0x33a6('0x37')];_0x27ef0d+=0x1){if(_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['type']&&_[_0x33a6('0x60')](_0x5e73d1,_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['type'])&&_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['parentKey']&&_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x77')]&&_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x78')]){_0x3c7f36[_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x2f')]](_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['foreignTable'],null,util[_0x33a6('0x72')](_0x33a6('0x79'),_0x55ab84[_0x33a6('0x6c')],_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x7a')],_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x77')],_0x55ab84['joins'][_0x27ef0d]['foreignKey']));}}}if(_0x55ab84[_0x33a6('0x7b')]){_0x55ab84['conditions']=JSON[_0x33a6('0x7c')](_0x55ab84[_0x33a6('0x7b')]);_0x3c7f36[_0x33a6('0x3b')](_0x4b5c80(_0x55ab84['conditions']['group']));}_0x4d497f=_0x3c7f36[_0x33a6('0x7d')]();_0x3c7f36[_0x33a6('0x1c')](_0x3f9388);_0x3c7f36['offset'](0x0);logger['debug'](_0x33a6('0x7e'),_0x3c7f36[_0x33a6('0x7f')]());return dbH['sequelize'][_0x33a6('0x31')](_0x3c7f36[_0x33a6('0x7f')](),{'type':dbH['sequelize'][_0x33a6('0x80')][_0x33a6('0x81')]});}})[_0x33a6('0x23')](respondWithResult(_0x5d6c39,null))[_0x33a6('0x45')](handleError(_0x5d6c39,null));};function runReport(_0x1a381b,_0x2ee519,_0x11a5e6){var _0x1c2a38=_0x2ee519[_0x33a6('0x28')];var _0x18d0cb=0xa;var _0x32deb0=['join',_0x33a6('0x55'),'right_join',_0x33a6('0x56')];var _0x26d524={'SUM':_0x33a6('0x57'),'COUNT':_0x33a6('0x58'),'COUNT DISTINCT':_0x33a6('0x59'),'MAX':_0x33a6('0x82'),'MIN':'MIN(%s)','AVG':_0x33a6('0x5a'),'GROUP_CONCAT':_0x33a6('0x5b'),'GROUP_CONCAT ASC':_0x33a6('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5c49da={'SEC_TO_TIME':_0x33a6('0x83'),'DATE':_0x33a6('0x84'),'HOUR':_0x33a6('0x5e'),'ROUND':_0x33a6('0x5f'),'UNIX_TIMESTAMP':_0x33a6('0x85')};var _0x279802=function(_0x19cb91){return!_[_0x33a6('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x33a6('0x86'),_0x33a6('0x87')],_0x19cb91);};var _0x5565fc=function(_0x221b64){if(!_0x221b64||!_0x221b64[_0x33a6('0x63')]['length']){return'';}for(var _0x4b01f0='(',_0x574f7e=0x0;_0x574f7e<_0x221b64['rules']['length'];_0x574f7e+=0x1){_0x574f7e>0x0&&(_0x4b01f0+='\x20'+_0x221b64['operator']+'\x20');_0x4b01f0+=_0x221b64['rules'][_0x574f7e]['group']?_0x5565fc(_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x65')]):_0x221b64[_0x33a6('0x63')][_0x574f7e]['field']+'\x20'+_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x66')]+(_0x279802(_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x66')])?'\x20'+_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x67')]:'');}return _0x4b01f0+')';};var _0x5bbbfa={'where':{'id':_0x1a381b['id']}},_0x1a5ace,_0x342694,_0x5b7f77,_0x50878b,_0x3f3582;_0x5bbbfa=_[_0x33a6('0x3e')]({},_0x5bbbfa,_0x11a5e6);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x5bbbfa)[_0x33a6('0x23')](function(_0x47c4c5){if(_0x47c4c5){_0x1a5ace=_0x47c4c5;return _0x47c4c5[_0x33a6('0x88')]();}return null;})[_0x33a6('0x23')](function(_0x2aa3c0){if(_0x2aa3c0){if(!_0x2aa3c0[_0x33a6('0x37')]){throw new db[(_0x33a6('0x89'))][(_0x33a6('0x68'))](_0x33a6('0x8a'),0x193);}_0x342694=_0x2aa3c0;return db[_0x33a6('0x8b')][_0x33a6('0x43')]({'raw':!![]});}return null;})[_0x33a6('0x23')](function(_0x219c39){if(_0x219c39){_0x5b7f77=_[_0x33a6('0x69')](_0x219c39,'id');var _0x381f1f;var _0x284ba5=squel[_0x33a6('0x6a')]();_0x284ba5[_0x33a6('0x6b')](_0x1a5ace[_0x33a6('0x6c')]);for(var _0x5217bf=0x0;_0x5217bf<_0x342694['length'];_0x5217bf+=0x1){_0x381f1f=_0x342694[_0x5217bf][_0x33a6('0x6d')]?_0x5b7f77[_0x342694[_0x5217bf]['MetricId']][_0x33a6('0x6e')]:_0x342694[_0x5217bf][_0x33a6('0x6f')];_0x381f1f=_0x342694[_0x5217bf]['function']?_[_0x33a6('0x71')](_0x26d524[_0x342694[_0x5217bf][_0x33a6('0x70')]],'%s',_0x381f1f):_0x381f1f;_0x381f1f=_0x342694[_0x5217bf]['format']?_['replace'](_0x5c49da[_0x342694[_0x5217bf][_0x33a6('0x72')]],'%s',_0x381f1f):_0x381f1f;if(_0x342694[_0x5217bf][_0x33a6('0x8c')]){_0x284ba5[_0x33a6('0x65')](_0x381f1f);}_0x342694[_0x5217bf][_0x33a6('0x73')]&&_0x284ba5['order'](_0x381f1f,_0x342694[_0x5217bf][_0x33a6('0x73')]===_0x33a6('0x74')?![]:!![]);_0x284ba5['field'](_0x381f1f,_0x342694[_0x5217bf][_0x33a6('0x75')]||_0x381f1f);}if(_0x1a5ace[_0x33a6('0x76')]){_0x1a5ace[_0x33a6('0x76')]=JSON[_0x33a6('0x7c')](_0x1a5ace[_0x33a6('0x76')]);for(var _0x575a2f=0x0;_0x575a2f<_0x1a5ace['joins']['length'];_0x575a2f+=0x1){if(_0x1a5ace['joins'][_0x575a2f]['type']&&_[_0x33a6('0x60')](_0x32deb0,_0x1a5ace[_0x33a6('0x76')][_0x575a2f]['type'])&&_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x7a')]&&_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x77')]&&_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x78')]){_0x284ba5[_0x1a5ace[_0x33a6('0x76')][_0x575a2f]['type']](_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x77')],null,util[_0x33a6('0x72')](_0x33a6('0x79'),_0x1a5ace['table'],_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x7a')],_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x77')],_0x1a5ace[_0x33a6('0x76')][_0x575a2f]['foreignKey']));}}}if(_0x1a5ace['conditions']){_0x1a5ace[_0x33a6('0x7b')]=JSON[_0x33a6('0x7c')](_0x1a5ace['conditions']);_0x284ba5[_0x33a6('0x3b')](_0x5565fc(_0x1a5ace[_0x33a6('0x7b')][_0x33a6('0x65')]));}_0x3f3582=_0x284ba5[_0x33a6('0x7d')]();_0x284ba5[_0x33a6('0x1c')](_0x18d0cb);_0x284ba5[_0x33a6('0x1a')](0x0);return;}})['then'](function(){if(_0x2ee519['output']==='web'){return null;}var _0x321a13=_[_0x33a6('0x3e')](_0x2ee519,{'name':_0x2ee519['fullPath']||_0x2ee519['name']||_0x1a5ace[_0x33a6('0x28')],'basename':_0x1c2a38,'savename':util[_0x33a6('0x72')](_0x33a6('0x8d'),_0x2ee519['name']||_0x1a5ace[_0x33a6('0x28')],require(_0x33a6('0x8e'))[_0x33a6('0x8f')](0x4),_0x2ee519[_0x33a6('0x90')]||_0x33a6('0x91')),'reportId':_0x1a5ace['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x33a6('0x4a')](_0x321a13,{'raw':!![]});})[_0x33a6('0x23')](function(_0x455f37){if(_0x1a5ace[_0x33a6('0x6c')]==='cdr'){_0x3f3582['where'](_0x1a5ace[_0x33a6('0x6c')]+_0x33a6('0x92'),_0x2ee519[_0x33a6('0x93')],_0x2ee519['endDate']);}else{_0x3f3582['where'](_0x1a5ace[_0x33a6('0x6c')]+_0x33a6('0x94'),_0x2ee519['startDate'],_0x2ee519[_0x33a6('0x95')]);}if(_0x455f37){logger[_0x33a6('0x96')](_0x33a6('0x97'),_0x3f3582[_0x33a6('0x7f')]());require(_0x33a6('0x98'))[_0x33a6('0x99')](path[_0x33a6('0x9a')](__dirname,_0x33a6('0x9b'),_0x455f37[_0x33a6('0x90')]),[_0x455f37['id'],_0x3f3582['toString'](),path['join'](__dirname,_0x33a6('0x9c'),_0x455f37[_0x33a6('0x9d')]),_0x1c2a38]);return _0x455f37;}else{var _0x5482e0=squel[_0x33a6('0x6a')]();_0x5482e0['from']('('+_0x3f3582[_0x33a6('0x7f')]()+')','countTable');_0x5482e0[_0x33a6('0x6f')]('COUNT(*)',_0x33a6('0x1d'));_0x3f3582[_0x33a6('0x1c')](_0x2ee519[_0x33a6('0x1c')]||_0x18d0cb);_0x3f3582[_0x33a6('0x1a')](_0x2ee519[_0x33a6('0x1a')]||0x0);return dbH['sequelize'][_0x33a6('0x31')](_0x5482e0['toString'](),{'type':dbH[_0x33a6('0x9e')][_0x33a6('0x80')]['SELECT']})[_0x33a6('0x23')](function(_0x3e51be){if(!_0x3e51be['length']){_0x50878b=0x0;}else{_0x50878b=_0x3e51be[0x0]['count']||0x0;}return dbH['sequelize'][_0x33a6('0x31')](_0x3f3582[_0x33a6('0x7f')](),{'type':dbH[_0x33a6('0x9e')][_0x33a6('0x80')]['SELECT']});})[_0x33a6('0x23')](function(_0x2527f2){return{'rows':_0x2527f2||[],'count':_0x50878b};});}});}exports['run']=function(_0x5ab24c,_0x52ce28){return runReport(_0x5ab24c[_0x33a6('0x47')],_0x5ab24c[_0x33a6('0x31')],_0x5ab24c['options'])[_0x33a6('0x23')](respondWithResult(_0x52ce28,null))[_0x33a6('0x45')](handleError(_0x52ce28,null));};exports[_0x33a6('0x9f')]=runReport;exports[_0x33a6('0x31')]=function(_0x4e7196,_0x3ce7e3){var _0x11756d=0xa;var _0x4fd9c2=[_0x33a6('0x9a'),_0x33a6('0x55'),_0x33a6('0xa0'),_0x33a6('0x56')];var _0x2b72ca={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x33a6('0x5a'),'GROUP_CONCAT':_0x33a6('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33a6('0x5d')};var _0x445984={'SEC_TO_TIME':_0x33a6('0x83'),'DATE':_0x33a6('0x84'),'HOUR':'HOUR(%s)','ROUND':_0x33a6('0x5f'),'UNIX_TIMESTAMP':_0x33a6('0x85')};var _0x4e9ac5=function(_0x2d3877){return!_[_0x33a6('0x60')]([_0x33a6('0x61'),'IS\x20NOT\x20NULL',_0x33a6('0x86'),_0x33a6('0x87')],_0x2d3877);};var _0x51e3d7=function(_0x21bb0e){if(!_0x21bb0e||!_0x21bb0e[_0x33a6('0x63')][_0x33a6('0x37')]){return'';}for(var _0x184ccb='(',_0x359632=0x0;_0x359632<_0x21bb0e[_0x33a6('0x63')]['length'];_0x359632+=0x1){_0x359632>0x0&&(_0x184ccb+='\x20'+_0x21bb0e[_0x33a6('0x64')]+'\x20');_0x184ccb+=_0x21bb0e['rules'][_0x359632][_0x33a6('0x65')]?_0x51e3d7(_0x21bb0e[_0x33a6('0x63')][_0x359632]['group']):_0x21bb0e[_0x33a6('0x63')][_0x359632][_0x33a6('0x6f')]+'\x20'+_0x21bb0e[_0x33a6('0x63')][_0x359632]['condition']+(_0x4e9ac5(_0x21bb0e[_0x33a6('0x63')][_0x359632][_0x33a6('0x66')])?'\x20'+_0x21bb0e['rules'][_0x359632][_0x33a6('0x67')]:'');}return _0x184ccb+')';};var _0x60dc1d={'where':{'id':_0x4e7196['params']['id']}},_0x44a76b,_0xd6312e,_0x3cc5ac,_0x57276b,_0x47315c;_0x60dc1d=_['merge']({},_0x60dc1d,_0x4e7196['options']);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x60dc1d)[_0x33a6('0x23')](function(_0x22e13c){if(_0x22e13c){_0x44a76b=_0x22e13c;return _0x22e13c[_0x33a6('0x88')]();}return null;})['then'](function(_0x19672c){if(_0x19672c){if(!_0x19672c[_0x33a6('0x37')]){throw new db['Sequelize'][(_0x33a6('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd6312e=_0x19672c;return db[_0x33a6('0x8b')][_0x33a6('0x43')]({'raw':!![]});}return null;})[_0x33a6('0x23')](function(_0x290e3b){if(_0x290e3b){_0x3cc5ac=_['keyBy'](_0x290e3b,'id');var _0x5f4825;var _0x27604c=squel[_0x33a6('0x6a')]();_0x27604c[_0x33a6('0x6b')](_0x44a76b[_0x33a6('0x6c')]);for(var _0x36c6de=0x0;_0x36c6de<_0xd6312e[_0x33a6('0x37')];_0x36c6de+=0x1){_0x5f4825=_0xd6312e[_0x36c6de][_0x33a6('0x6d')]?_0x3cc5ac[_0xd6312e[_0x36c6de]['MetricId']][_0x33a6('0x6e')]:_0xd6312e[_0x36c6de][_0x33a6('0x6f')];_0x5f4825=_0xd6312e[_0x36c6de][_0x33a6('0x70')]?_[_0x33a6('0x71')](_0x2b72ca[_0xd6312e[_0x36c6de][_0x33a6('0x70')]],'%s',_0x5f4825):_0x5f4825;_0x5f4825=_0xd6312e[_0x36c6de]['format']?_[_0x33a6('0x71')](_0x445984[_0xd6312e[_0x36c6de]['format']],'%s',_0x5f4825):_0x5f4825;if(_0xd6312e[_0x36c6de]['groupBy']){_0x27604c[_0x33a6('0x65')](_0x5f4825);}_0xd6312e[_0x36c6de][_0x33a6('0x73')]&&_0x27604c[_0x33a6('0x39')](_0x5f4825,_0xd6312e[_0x36c6de][_0x33a6('0x73')]===_0x33a6('0x74')?![]:!![]);_0x27604c['field'](_0x5f4825,_0xd6312e[_0x36c6de][_0x33a6('0x75')]||_0x5f4825);}if(_0x44a76b['joins']){_0x44a76b[_0x33a6('0x76')]=JSON[_0x33a6('0x7c')](_0x44a76b['joins']);for(var _0x328ff9=0x0;_0x328ff9<_0x44a76b[_0x33a6('0x76')][_0x33a6('0x37')];_0x328ff9+=0x1){if(_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x2f')]&&_[_0x33a6('0x60')](_0x4fd9c2,_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x2f')])&&_0x44a76b[_0x33a6('0x76')][_0x328ff9]['parentKey']&&_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x77')]&&_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x78')]){_0x27604c[_0x44a76b['joins'][_0x328ff9][_0x33a6('0x2f')]](_0x44a76b[_0x33a6('0x76')][_0x328ff9]['foreignTable'],null,util[_0x33a6('0x72')](_0x33a6('0x79'),_0x44a76b[_0x33a6('0x6c')],_0x44a76b[_0x33a6('0x76')][_0x328ff9]['parentKey'],_0x44a76b['joins'][_0x328ff9]['foreignTable'],_0x44a76b[_0x33a6('0x76')][_0x328ff9]['foreignKey']));}}}if(_0x44a76b['conditions']){_0x44a76b[_0x33a6('0x7b')]=JSON['parse'](_0x44a76b[_0x33a6('0x7b')]);_0x27604c[_0x33a6('0x3b')](_0x51e3d7(_0x44a76b['conditions'][_0x33a6('0x65')]));}_0x47315c=_0x27604c[_0x33a6('0x7d')]();_0x27604c['limit'](_0x11756d);_0x27604c[_0x33a6('0x1a')](0x0);logger[_0x33a6('0xa1')](_0x33a6('0x7e'),_0x27604c['toString']());return dbH[_0x33a6('0x9e')][_0x33a6('0x31')](_0x27604c[_0x33a6('0x7f')](),{'type':dbH[_0x33a6('0x9e')]['QueryTypes']['SELECT']});}})[_0x33a6('0x23')](function(){return{'sql':_0x47315c['toString']()};})[_0x33a6('0x23')](respondWithResult(_0x3ce7e3,null))[_0x33a6('0x45')](handleError(_0x3ce7e3,null));}; \ No newline at end of file +var _0xd89e=['QueryTypes','join','right_join','SUM(%s)','COUNT(%s)','IS\x20NOT\x20NULL','operator','Sequelize','from','DESC','web','fullPath','output','csv','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','toString','../../files/reports','savename','countTable','SELECT','run','runReport','Limited\x20Query:','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','VIRTUAL','filter','merge','include','AnalyticCustomReport','findAll','rows','show','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','sequelize'];(function(_0x1f2b1f,_0x55f153){var _0x1779e3=function(_0x5967be){while(--_0x5967be){_0x1f2b1f['push'](_0x1f2b1f['shift']());}};_0x1779e3(++_0x55f153);}(_0xd89e,0x16b));var _0xed89=function(_0x5bdd6d,_0x10b58e){_0x5bdd6d=_0x5bdd6d-0x0;var _0x293bcc=_0xd89e[_0x5bdd6d];return _0x293bcc;};'use strict';var emlformat=require(_0xed89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xed89('0x1'));var rp=require(_0xed89('0x2'));var moment=require(_0xed89('0x3'));var BPromise=require(_0xed89('0x4'));var Mustache=require(_0xed89('0x5'));var util=require(_0xed89('0x6'));var path=require(_0xed89('0x7'));var sox=require(_0xed89('0x8'));var csv=require(_0xed89('0x9'));var ejs=require(_0xed89('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed89('0xb'));var squel=require(_0xed89('0xc'));var crypto=require(_0xed89('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed89('0xe'));var Papa=require(_0xed89('0xf'));var Redis=require(_0xed89('0x10'));var authService=require(_0xed89('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed89('0x12'));var hardwareService=require(_0xed89('0x13'));var logger=require(_0xed89('0x14'))(_0xed89('0x15'));var utils=require(_0xed89('0x16'));var config=require(_0xed89('0x17'));var licenseUtil=require(_0xed89('0x18'));var db=require(_0xed89('0x19'))['db'];var dbH=require(_0xed89('0x19'))[_0xed89('0x1a')];function respondWithStatusCode(_0x13d369,_0x46b197){_0x46b197=_0x46b197||0xcc;return function(_0xb10a14){if(_0xb10a14){return _0x13d369[_0xed89('0x1b')](_0x46b197);}return _0x13d369[_0xed89('0x1c')](_0x46b197)['end']();};}function respondWithResult(_0x182dbd,_0x229d6a){_0x229d6a=_0x229d6a||0xc8;return function(_0x5401cb){if(_0x5401cb){return _0x182dbd['status'](_0x229d6a)['json'](_0x5401cb);}};}function respondWithFilteredResult(_0x2545ca,_0x329e6a){return function(_0x35d724){if(_0x35d724){var _0x288531=typeof _0x329e6a['offset']===_0xed89('0x1d')&&typeof _0x329e6a[_0xed89('0x1e')]===_0xed89('0x1d');var _0xb5b127=_0x35d724['count'];var _0x6d9ce2=_0x288531?0x0:_0x329e6a['offset'];var _0x1d89a2=_0x288531?_0x35d724[_0xed89('0x1f')]:_0x329e6a['offset']+_0x329e6a[_0xed89('0x1e')];var _0x5ec113;if(_0x1d89a2>=_0xb5b127){_0x1d89a2=_0xb5b127;_0x5ec113=0xc8;}else{_0x5ec113=0xce;}_0x2545ca[_0xed89('0x1c')](_0x5ec113);return _0x2545ca['set'](_0xed89('0x20'),_0x6d9ce2+'-'+_0x1d89a2+'/'+_0xb5b127)[_0xed89('0x21')](_0x35d724);}return null;};}function patchUpdates(_0x2baf03){return function(_0x51960a){try{jsonpatch['apply'](_0x51960a,_0x2baf03,!![]);}catch(_0x234b2b){return BPromise[_0xed89('0x22')](_0x234b2b);}return _0x51960a[_0xed89('0x23')]();};}function saveUpdates(_0x436235,_0x4ddf30){return function(_0x3de755){if(_0x3de755){return _0x3de755[_0xed89('0x24')](_0x436235)[_0xed89('0x25')](function(_0x8b8c78){return _0x8b8c78;});}return null;};}function removeEntity(_0x490d54,_0x1db0b6){return function(_0x5a810a){if(_0x5a810a){return _0x5a810a[_0xed89('0x26')]()['then'](function(){var _0x228d8f=_0x5a810a[_0xed89('0x27')]({'plain':!![]});var _0x8209c8=_0xed89('0x28');return db[_0xed89('0x29')][_0xed89('0x26')]({'where':{'type':_0x8209c8,'resourceId':_0x228d8f['id']}})[_0xed89('0x25')](function(){return _0x5a810a;});})[_0xed89('0x25')](function(){_0x490d54[_0xed89('0x1c')](0xcc)[_0xed89('0x2a')]();});}};}function handleEntityNotFound(_0xab9e8c,_0x2fea04){return function(_0x3dfff9){if(!_0x3dfff9){_0xab9e8c['sendStatus'](0x194);}return _0x3dfff9;};}function handleError(_0x31f087,_0x1c17f5){_0x1c17f5=_0x1c17f5||0x1f4;return function(_0x282854){logger[_0xed89('0x2b')](_0x282854[_0xed89('0x2c')]);if(_0x282854[_0xed89('0x2d')]){delete _0x282854[_0xed89('0x2d')];}_0x31f087[_0xed89('0x1c')](_0x1c17f5)[_0xed89('0x2e')](_0x282854);};}exports[_0xed89('0x2f')]=function(_0x4b1612,_0x4943d7){var _0x27ba66={},_0x3fded5={},_0x4e8145={'count':0x0,'rows':[]};var _0x5c3afc=_[_0xed89('0x30')](db['AnalyticCustomReport'][_0xed89('0x31')],function(_0x2ad17e){return{'name':_0x2ad17e[_0xed89('0x32')],'type':_0x2ad17e[_0xed89('0x33')]['key']};});_0x3fded5[_0xed89('0x34')]=_[_0xed89('0x30')](_0x5c3afc,_0xed89('0x2d'));_0x3fded5[_0xed89('0x35')]=_[_0xed89('0x36')](_0x4b1612[_0xed89('0x35')]);_0x3fded5[_0xed89('0x37')]=_[_0xed89('0x38')](_0x3fded5['model'],_0x3fded5[_0xed89('0x35')]);_0x27ba66['attributes']=_[_0xed89('0x38')](_0x3fded5[_0xed89('0x34')],qs[_0xed89('0x39')](_0x4b1612[_0xed89('0x35')]['fields']));_0x27ba66[_0xed89('0x3a')]=_0x27ba66[_0xed89('0x3a')]['length']?_0x27ba66[_0xed89('0x3a')]:_0x3fded5[_0xed89('0x34')];if(!_0x4b1612[_0xed89('0x35')][_0xed89('0x3b')](_0xed89('0x3c'))){_0x27ba66[_0xed89('0x1e')]=qs[_0xed89('0x1e')](_0x4b1612[_0xed89('0x35')][_0xed89('0x1e')]);_0x27ba66[_0xed89('0x3d')]=qs['offset'](_0x4b1612['query'][_0xed89('0x3d')]);}_0x27ba66[_0xed89('0x3e')]=qs['sort'](_0x4b1612[_0xed89('0x35')][_0xed89('0x3f')]);_0x27ba66[_0xed89('0x40')]=qs[_0xed89('0x37')](_[_0xed89('0x41')](_0x4b1612[_0xed89('0x35')],_0x3fded5['filters']),_0x5c3afc);if(_0x4b1612[_0xed89('0x35')]['filter']){_0x27ba66[_0xed89('0x40')]=_['merge'](_0x27ba66[_0xed89('0x40')],{'$or':_[_0xed89('0x30')](_0x5c3afc,function(_0x483a8f){if(_0x483a8f[_0xed89('0x33')]!==_0xed89('0x42')){var _0x1c43f4={};_0x1c43f4[_0x483a8f[_0xed89('0x2d')]]={'$like':'%'+_0x4b1612[_0xed89('0x35')][_0xed89('0x43')]+'%'};return _0x1c43f4;}})});}_0x27ba66=_[_0xed89('0x44')]({},_0x27ba66,_0x4b1612['options']);var _0x1a2174={'where':_0x27ba66[_0xed89('0x40')]};return db['AnalyticCustomReport'][_0xed89('0x1f')](_0x1a2174)[_0xed89('0x25')](function(_0x4456ab){_0x4e8145['count']=_0x4456ab;if(_0x4b1612[_0xed89('0x35')]['includeAll']){_0x27ba66[_0xed89('0x45')]=[{'all':!![]}];}return db[_0xed89('0x46')][_0xed89('0x47')](_0x27ba66);})[_0xed89('0x25')](function(_0xbd449c){_0x4e8145[_0xed89('0x48')]=_0xbd449c;return _0x4e8145;})[_0xed89('0x25')](respondWithFilteredResult(_0x4943d7,_0x27ba66))['catch'](handleError(_0x4943d7,null));};exports[_0xed89('0x49')]=function(_0x270f56,_0x205ed9){var _0x3113e8={'raw':![],'where':{'id':_0x270f56['params']['id']}},_0x464bef={};_0x464bef['model']=_[_0xed89('0x36')](db['AnalyticCustomReport']['rawAttributes']);_0x464bef[_0xed89('0x35')]=_[_0xed89('0x36')](_0x270f56[_0xed89('0x35')]);_0x464bef['filters']=_['intersection'](_0x464bef[_0xed89('0x34')],_0x464bef[_0xed89('0x35')]);_0x3113e8['attributes']=_[_0xed89('0x38')](_0x464bef[_0xed89('0x34')],qs[_0xed89('0x39')](_0x270f56['query'][_0xed89('0x39')]));_0x3113e8[_0xed89('0x3a')]=_0x3113e8[_0xed89('0x3a')][_0xed89('0x4a')]?_0x3113e8[_0xed89('0x3a')]:_0x464bef[_0xed89('0x34')];if(_0x270f56[_0xed89('0x35')][_0xed89('0x4b')]){_0x3113e8[_0xed89('0x45')]=[{'all':!![]}];}_0x3113e8=_['merge']({},_0x3113e8,_0x270f56['options']);return db['AnalyticCustomReport'][_0xed89('0x4c')](_0x3113e8)['then'](handleEntityNotFound(_0x205ed9,null))['then'](respondWithResult(_0x205ed9,null))[_0xed89('0x4d')](handleError(_0x205ed9,null));};exports[_0xed89('0x4e')]=function(_0x5e8c49,_0x2b510f){return db[_0xed89('0x46')][_0xed89('0x4e')](_0x5e8c49[_0xed89('0x4f')],{})['then'](function(_0x448689){var _0xb62c0=_0x5e8c49['user'][_0xed89('0x27')]({'plain':!![]});if(!_0xb62c0)throw new Error(_0xed89('0x50'));if(_0xb62c0['role']===_0xed89('0x51')){var _0xbca6fc=_0x448689[_0xed89('0x27')]({'plain':!![]});var _0x5a1562='Reports';return db[_0xed89('0x52')][_0xed89('0x4c')]({'where':{'name':_0x5a1562,'userProfileId':_0xb62c0[_0xed89('0x53')]},'raw':!![]})['then'](function(_0x3029c1){if(_0x3029c1&&_0x3029c1['autoAssociation']===0x0){return db[_0xed89('0x29')][_0xed89('0x4e')]({'name':_0xbca6fc[_0xed89('0x2d')],'resourceId':_0xbca6fc['id'],'type':'CustomReports','sectionId':_0x3029c1['id']},{})[_0xed89('0x25')](function(){return _0x448689;});}else{return _0x448689;}})['catch'](function(_0x4f638d){logger[_0xed89('0x2b')](_0xed89('0x54'),_0x4f638d);throw _0x4f638d;});}return _0x448689;})[_0xed89('0x25')](respondWithResult(_0x2b510f,0xc9))[_0xed89('0x4d')](handleError(_0x2b510f,null));};exports[_0xed89('0x24')]=function(_0x49a952,_0xc87397){if(_0x49a952[_0xed89('0x4f')]['id']){delete _0x49a952[_0xed89('0x4f')]['id'];}return db[_0xed89('0x46')][_0xed89('0x4c')]({'where':{'id':_0x49a952[_0xed89('0x55')]['id']}})['then'](handleEntityNotFound(_0xc87397,null))['then'](saveUpdates(_0x49a952[_0xed89('0x4f')],null))[_0xed89('0x25')](respondWithResult(_0xc87397,null))['catch'](handleError(_0xc87397,null));};exports['destroy']=function(_0x50e204,_0x224dae){return db[_0xed89('0x46')][_0xed89('0x4c')]({'where':{'id':_0x50e204[_0xed89('0x55')]['id']}})[_0xed89('0x25')](handleEntityNotFound(_0x224dae,null))[_0xed89('0x25')](removeEntity(_0x224dae,null))[_0xed89('0x4d')](handleError(_0x224dae,null));};exports[_0xed89('0x56')]=function(_0x200d3a,_0x5d90b8){var _0x291804=0xa;var _0x2dd728=['join',_0xed89('0x57'),'right_join',_0xed89('0x58')];var _0x2b15cc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xed89('0x59'),'MAX':_0xed89('0x5a'),'MIN':_0xed89('0x5b'),'AVG':_0xed89('0x5c'),'GROUP_CONCAT':_0xed89('0x5d'),'GROUP_CONCAT ASC':_0xed89('0x5e'),'GROUP_CONCAT DESC':_0xed89('0x5f')};var _0x309a91={'SEC_TO_TIME':_0xed89('0x60'),'DATE':_0xed89('0x61'),'HOUR':_0xed89('0x62'),'ROUND':_0xed89('0x63'),'UNIX_TIMESTAMP':_0xed89('0x64')};var _0x132727=function(_0x3f0e5f){return!_[_0xed89('0x65')]([_0xed89('0x66'),'IS\x20NOT\x20NULL',_0xed89('0x67'),_0xed89('0x68')],_0x3f0e5f);};var _0x41de04=function(_0x56c5ec){if(!_0x56c5ec||!_0x56c5ec[_0xed89('0x69')][_0xed89('0x4a')]){return'';}for(var _0x2cd0a3='(',_0x25ce08=0x0;_0x25ce08<_0x56c5ec[_0xed89('0x69')][_0xed89('0x4a')];_0x25ce08+=0x1){_0x25ce08>0x0&&(_0x2cd0a3+='\x20'+_0x56c5ec['operator']+'\x20');_0x2cd0a3+=_0x56c5ec['rules'][_0x25ce08][_0xed89('0x6a')]?_0x41de04(_0x56c5ec[_0xed89('0x69')][_0x25ce08]['group']):_0x56c5ec['rules'][_0x25ce08][_0xed89('0x6b')]+'\x20'+_0x56c5ec[_0xed89('0x69')][_0x25ce08][_0xed89('0x6c')]+(_0x132727(_0x56c5ec['rules'][_0x25ce08]['condition'])?'\x20'+_0x56c5ec[_0xed89('0x69')][_0x25ce08][_0xed89('0x6d')]:'');}return _0x2cd0a3+')';};var _0x38e463={'where':{'id':_0x200d3a['params']['id']}},_0x2833f3,_0x50016e,_0x4589e8,_0x38b431,_0x1d1f8f;_0x38e463=_[_0xed89('0x44')]({},_0x38e463,_0x200d3a[_0xed89('0x6e')]);return db[_0xed89('0x46')][_0xed89('0x4c')](_0x38e463)['then'](function(_0x37d68c){if(_0x37d68c){_0x2833f3=_0x37d68c;return _0x37d68c[_0xed89('0x6f')]();}return null;})['then'](function(_0x2e9a03){if(_0x2e9a03){if(!_0x2e9a03[_0xed89('0x4a')]){throw new db['Sequelize'][(_0xed89('0x70'))](_0xed89('0x71'),0x193);}_0x50016e=_0x2e9a03;return db[_0xed89('0x72')][_0xed89('0x47')]({'raw':!![]});}return null;})[_0xed89('0x25')](function(_0x54b4e3){if(_0x54b4e3){_0x4589e8=_[_0xed89('0x73')](_0x54b4e3,'id');var _0x5ed3ae;var _0x776e23=squel[_0xed89('0x74')]();_0x776e23['from'](_0x2833f3[_0xed89('0x75')]);for(var _0x195df=0x0;_0x195df<_0x50016e['length'];_0x195df+=0x1){_0x5ed3ae=_0x50016e[_0x195df][_0xed89('0x76')]?_0x4589e8[_0x50016e[_0x195df][_0xed89('0x76')]][_0xed89('0x77')]:_0x50016e[_0x195df][_0xed89('0x6b')];_0x5ed3ae=_0x50016e[_0x195df][_0xed89('0x78')]?_[_0xed89('0x79')](_0x2b15cc[_0x50016e[_0x195df][_0xed89('0x78')]],'%s',_0x5ed3ae):_0x5ed3ae;_0x5ed3ae=_0x50016e[_0x195df][_0xed89('0x7a')]?_[_0xed89('0x79')](_0x309a91[_0x50016e[_0x195df][_0xed89('0x7a')]],'%s',_0x5ed3ae):_0x5ed3ae;if(_0x50016e[_0x195df]['groupBy']){_0x776e23[_0xed89('0x6a')](_0x5ed3ae);}_0x50016e[_0x195df][_0xed89('0x7b')]&&_0x776e23[_0xed89('0x3e')](_0x5ed3ae,_0x50016e[_0x195df][_0xed89('0x7b')]==='DESC'?![]:!![]);_0x776e23[_0xed89('0x6b')](_0x5ed3ae,_0x50016e[_0x195df][_0xed89('0x7c')]||_0x5ed3ae);}if(_0x2833f3[_0xed89('0x7d')]){_0x2833f3[_0xed89('0x7d')]=JSON['parse'](_0x2833f3['joins']);for(var _0x4ef6bd=0x0;_0x4ef6bd<_0x2833f3[_0xed89('0x7d')][_0xed89('0x4a')];_0x4ef6bd+=0x1){if(_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x33')]&&_[_0xed89('0x65')](_0x2dd728,_0x2833f3['joins'][_0x4ef6bd][_0xed89('0x33')])&&_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7e')]&&_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7f')]&&_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x80')]){_0x776e23[_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x33')]](_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7f')],null,util[_0xed89('0x7a')](_0xed89('0x81'),_0x2833f3['table'],_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7e')],_0x2833f3['joins'][_0x4ef6bd][_0xed89('0x7f')],_0x2833f3[_0xed89('0x7d')][_0x4ef6bd]['foreignKey']));}}}if(_0x2833f3['conditions']){_0x2833f3[_0xed89('0x82')]=JSON[_0xed89('0x83')](_0x2833f3[_0xed89('0x82')]);_0x776e23[_0xed89('0x40')](_0x41de04(_0x2833f3['conditions'][_0xed89('0x6a')]));}_0x1d1f8f=_0x776e23[_0xed89('0x84')]();_0x776e23[_0xed89('0x1e')](_0x291804);_0x776e23['offset'](0x0);logger[_0xed89('0x85')]('Limited\x20Query:',_0x776e23['toString']());return dbH[_0xed89('0x86')][_0xed89('0x35')](_0x776e23['toString'](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')]['SELECT']});}})[_0xed89('0x25')](respondWithResult(_0x5d90b8,null))[_0xed89('0x4d')](handleError(_0x5d90b8,null));};function runReport(_0x475bd3,_0x45cc83,_0x28b048){var _0x1662c1=_0x45cc83[_0xed89('0x2d')];var _0x32361a=0xa;var _0x3d387d=[_0xed89('0x88'),_0xed89('0x57'),_0xed89('0x89'),_0xed89('0x58')];var _0xfdc145={'SUM':_0xed89('0x8a'),'COUNT':_0xed89('0x8b'),'COUNT DISTINCT':_0xed89('0x59'),'MAX':_0xed89('0x5a'),'MIN':'MIN(%s)','AVG':_0xed89('0x5c'),'GROUP_CONCAT':_0xed89('0x5d'),'GROUP_CONCAT ASC':_0xed89('0x5e'),'GROUP_CONCAT DESC':_0xed89('0x5f')};var _0x37a694={'SEC_TO_TIME':_0xed89('0x60'),'DATE':_0xed89('0x61'),'HOUR':_0xed89('0x62'),'ROUND':_0xed89('0x63'),'UNIX_TIMESTAMP':_0xed89('0x64')};var _0x1b067e=function(_0x3b3dea){return!_[_0xed89('0x65')]([_0xed89('0x66'),_0xed89('0x8c'),'IS\x20EMPTY',_0xed89('0x68')],_0x3b3dea);};var _0x142c72=function(_0x2001a5){if(!_0x2001a5||!_0x2001a5['rules'][_0xed89('0x4a')]){return'';}for(var _0xb4d706='(',_0x29b250=0x0;_0x29b250<_0x2001a5[_0xed89('0x69')]['length'];_0x29b250+=0x1){_0x29b250>0x0&&(_0xb4d706+='\x20'+_0x2001a5[_0xed89('0x8d')]+'\x20');_0xb4d706+=_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6a')]?_0x142c72(_0x2001a5[_0xed89('0x69')][_0x29b250]['group']):_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6b')]+'\x20'+_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6c')]+(_0x1b067e(_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6c')])?'\x20'+_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6d')]:'');}return _0xb4d706+')';};var _0x57a6bd={'where':{'id':_0x475bd3['id']}},_0x2bc5ff,_0x14b16d,_0x1d3357,_0x2ab35d,_0x57c417;_0x57a6bd=_['merge']({},_0x57a6bd,_0x28b048);return db[_0xed89('0x46')]['find'](_0x57a6bd)[_0xed89('0x25')](function(_0x5b6b60){if(_0x5b6b60){_0x2bc5ff=_0x5b6b60;return _0x5b6b60['getFields']();}return null;})[_0xed89('0x25')](function(_0x5c7ab4){if(_0x5c7ab4){if(!_0x5c7ab4[_0xed89('0x4a')]){throw new db[(_0xed89('0x8e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x14b16d=_0x5c7ab4;return db[_0xed89('0x72')][_0xed89('0x47')]({'raw':!![]});}return null;})[_0xed89('0x25')](function(_0x16a956){if(_0x16a956){_0x1d3357=_[_0xed89('0x73')](_0x16a956,'id');var _0x148c49;var _0x5b6b0a=squel['select']();_0x5b6b0a[_0xed89('0x8f')](_0x2bc5ff[_0xed89('0x75')]);for(var _0x8ae587=0x0;_0x8ae587<_0x14b16d['length'];_0x8ae587+=0x1){_0x148c49=_0x14b16d[_0x8ae587][_0xed89('0x76')]?_0x1d3357[_0x14b16d[_0x8ae587][_0xed89('0x76')]][_0xed89('0x77')]:_0x14b16d[_0x8ae587][_0xed89('0x6b')];_0x148c49=_0x14b16d[_0x8ae587]['function']?_[_0xed89('0x79')](_0xfdc145[_0x14b16d[_0x8ae587][_0xed89('0x78')]],'%s',_0x148c49):_0x148c49;_0x148c49=_0x14b16d[_0x8ae587][_0xed89('0x7a')]?_[_0xed89('0x79')](_0x37a694[_0x14b16d[_0x8ae587][_0xed89('0x7a')]],'%s',_0x148c49):_0x148c49;if(_0x14b16d[_0x8ae587]['groupBy']){_0x5b6b0a[_0xed89('0x6a')](_0x148c49);}_0x14b16d[_0x8ae587][_0xed89('0x7b')]&&_0x5b6b0a[_0xed89('0x3e')](_0x148c49,_0x14b16d[_0x8ae587][_0xed89('0x7b')]===_0xed89('0x90')?![]:!![]);_0x5b6b0a[_0xed89('0x6b')](_0x148c49,_0x14b16d[_0x8ae587]['alias']||_0x148c49);}if(_0x2bc5ff[_0xed89('0x7d')]){_0x2bc5ff[_0xed89('0x7d')]=JSON['parse'](_0x2bc5ff['joins']);for(var _0x4ba22b=0x0;_0x4ba22b<_0x2bc5ff[_0xed89('0x7d')][_0xed89('0x4a')];_0x4ba22b+=0x1){if(_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x33')]&&_[_0xed89('0x65')](_0x3d387d,_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x33')])&&_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b]['parentKey']&&_0x2bc5ff['joins'][_0x4ba22b]['foreignTable']&&_0x2bc5ff['joins'][_0x4ba22b][_0xed89('0x80')]){_0x5b6b0a[_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x33')]](_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x7f')],null,util['format'](_0xed89('0x81'),_0x2bc5ff[_0xed89('0x75')],_0x2bc5ff['joins'][_0x4ba22b][_0xed89('0x7e')],_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b]['foreignTable'],_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x80')]));}}}if(_0x2bc5ff[_0xed89('0x82')]){_0x2bc5ff[_0xed89('0x82')]=JSON[_0xed89('0x83')](_0x2bc5ff['conditions']);_0x5b6b0a[_0xed89('0x40')](_0x142c72(_0x2bc5ff[_0xed89('0x82')][_0xed89('0x6a')]));}_0x57c417=_0x5b6b0a[_0xed89('0x84')]();_0x5b6b0a[_0xed89('0x1e')](_0x32361a);_0x5b6b0a[_0xed89('0x3d')](0x0);return;}})[_0xed89('0x25')](function(){if(_0x45cc83['output']===_0xed89('0x91')){return null;}var _0x5f3a35=_[_0xed89('0x44')](_0x45cc83,{'name':_0x45cc83[_0xed89('0x92')]||_0x45cc83[_0xed89('0x2d')]||_0x2bc5ff['name'],'basename':_0x1662c1,'savename':util[_0xed89('0x7a')]('%s-%s.%s',_0x45cc83['name']||_0x2bc5ff[_0xed89('0x2d')],require('randomstring')['generate'](0x4),_0x45cc83[_0xed89('0x93')]||_0xed89('0x94')),'reportId':_0x2bc5ff['id'],'reportType':'custom'});return db[_0xed89('0x95')]['create'](_0x5f3a35,{'raw':!![]});})[_0xed89('0x25')](function(_0x4e3da8){if(_0x2bc5ff[_0xed89('0x75')]===_0xed89('0x96')){_0x57c417[_0xed89('0x40')](_0x2bc5ff[_0xed89('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x45cc83['startDate'],_0x45cc83[_0xed89('0x97')]);}else{_0x57c417[_0xed89('0x40')](_0x2bc5ff[_0xed89('0x75')]+_0xed89('0x98'),_0x45cc83[_0xed89('0x99')],_0x45cc83['endDate']);}if(_0x4e3da8){logger[_0xed89('0x9a')]('Run\x20Query:',_0x57c417['toString']());require(_0xed89('0x9b'))[_0xed89('0x9c')](path[_0xed89('0x88')](__dirname,_0xed89('0x9d'),_0x4e3da8['output']),[_0x4e3da8['id'],_0x57c417[_0xed89('0x9e')](),path[_0xed89('0x88')](__dirname,_0xed89('0x9f'),_0x4e3da8[_0xed89('0xa0')]),_0x1662c1]);return _0x4e3da8;}else{var _0x1c1a62=squel['select']();_0x1c1a62['from']('('+_0x57c417[_0xed89('0x9e')]()+')',_0xed89('0xa1'));_0x1c1a62[_0xed89('0x6b')]('COUNT(*)','count');_0x57c417['limit'](_0x45cc83[_0xed89('0x1e')]||_0x32361a);_0x57c417[_0xed89('0x3d')](_0x45cc83[_0xed89('0x3d')]||0x0);return dbH[_0xed89('0x86')]['query'](_0x1c1a62[_0xed89('0x9e')](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')]['SELECT']})['then'](function(_0x3be272){if(!_0x3be272[_0xed89('0x4a')]){_0x2ab35d=0x0;}else{_0x2ab35d=_0x3be272[0x0][_0xed89('0x1f')]||0x0;}return dbH[_0xed89('0x86')][_0xed89('0x35')](_0x57c417[_0xed89('0x9e')](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')][_0xed89('0xa2')]});})[_0xed89('0x25')](function(_0x52c1fe){return{'rows':_0x52c1fe||[],'count':_0x2ab35d};});}});}exports[_0xed89('0xa3')]=function(_0x49c746,_0x2217a5){return runReport(_0x49c746[_0xed89('0x55')],_0x49c746['query'],_0x49c746[_0xed89('0x6e')])[_0xed89('0x25')](respondWithResult(_0x2217a5,null))['catch'](handleError(_0x2217a5,null));};exports[_0xed89('0xa4')]=runReport;exports[_0xed89('0x35')]=function(_0x6a53d8,_0x2a1661){var _0x352967=0xa;var _0x453663=[_0xed89('0x88'),_0xed89('0x57'),_0xed89('0x89'),_0xed89('0x58')];var _0x1cdf80={'SUM':'SUM(%s)','COUNT':_0xed89('0x8b'),'COUNT DISTINCT':_0xed89('0x59'),'MAX':_0xed89('0x5a'),'MIN':_0xed89('0x5b'),'AVG':_0xed89('0x5c'),'GROUP_CONCAT':_0xed89('0x5d'),'GROUP_CONCAT ASC':_0xed89('0x5e'),'GROUP_CONCAT DESC':_0xed89('0x5f')};var _0x165052={'SEC_TO_TIME':_0xed89('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xed89('0x63'),'UNIX_TIMESTAMP':_0xed89('0x64')};var _0xbc2c24=function(_0x127f12){return!_[_0xed89('0x65')]([_0xed89('0x66'),_0xed89('0x8c'),_0xed89('0x67'),_0xed89('0x68')],_0x127f12);};var _0x10e57b=function(_0x4bcec6){if(!_0x4bcec6||!_0x4bcec6[_0xed89('0x69')][_0xed89('0x4a')]){return'';}for(var _0x2aad1e='(',_0x262bbf=0x0;_0x262bbf<_0x4bcec6[_0xed89('0x69')][_0xed89('0x4a')];_0x262bbf+=0x1){_0x262bbf>0x0&&(_0x2aad1e+='\x20'+_0x4bcec6[_0xed89('0x8d')]+'\x20');_0x2aad1e+=_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6a')]?_0x10e57b(_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6a')]):_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6b')]+'\x20'+_0x4bcec6['rules'][_0x262bbf][_0xed89('0x6c')]+(_0xbc2c24(_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6c')])?'\x20'+_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6d')]:'');}return _0x2aad1e+')';};var _0x5d23ae={'where':{'id':_0x6a53d8[_0xed89('0x55')]['id']}},_0x247d1d,_0x603808,_0x4ee152,_0x1dd5c0,_0x387454;_0x5d23ae=_[_0xed89('0x44')]({},_0x5d23ae,_0x6a53d8[_0xed89('0x6e')]);return db['AnalyticCustomReport'][_0xed89('0x4c')](_0x5d23ae)['then'](function(_0xe82d60){if(_0xe82d60){_0x247d1d=_0xe82d60;return _0xe82d60['getFields']();}return null;})[_0xed89('0x25')](function(_0x29aa7f){if(_0x29aa7f){if(!_0x29aa7f[_0xed89('0x4a')]){throw new db[(_0xed89('0x8e'))][(_0xed89('0x70'))](_0xed89('0x71'),0x193);}_0x603808=_0x29aa7f;return db[_0xed89('0x72')][_0xed89('0x47')]({'raw':!![]});}return null;})[_0xed89('0x25')](function(_0x25423e){if(_0x25423e){_0x4ee152=_['keyBy'](_0x25423e,'id');var _0x14b907;var _0x9b5b3b=squel[_0xed89('0x74')]();_0x9b5b3b[_0xed89('0x8f')](_0x247d1d[_0xed89('0x75')]);for(var _0x3accc0=0x0;_0x3accc0<_0x603808[_0xed89('0x4a')];_0x3accc0+=0x1){_0x14b907=_0x603808[_0x3accc0][_0xed89('0x76')]?_0x4ee152[_0x603808[_0x3accc0][_0xed89('0x76')]][_0xed89('0x77')]:_0x603808[_0x3accc0]['field'];_0x14b907=_0x603808[_0x3accc0][_0xed89('0x78')]?_[_0xed89('0x79')](_0x1cdf80[_0x603808[_0x3accc0][_0xed89('0x78')]],'%s',_0x14b907):_0x14b907;_0x14b907=_0x603808[_0x3accc0][_0xed89('0x7a')]?_['replace'](_0x165052[_0x603808[_0x3accc0][_0xed89('0x7a')]],'%s',_0x14b907):_0x14b907;if(_0x603808[_0x3accc0]['groupBy']){_0x9b5b3b[_0xed89('0x6a')](_0x14b907);}_0x603808[_0x3accc0][_0xed89('0x7b')]&&_0x9b5b3b[_0xed89('0x3e')](_0x14b907,_0x603808[_0x3accc0]['orderBy']===_0xed89('0x90')?![]:!![]);_0x9b5b3b['field'](_0x14b907,_0x603808[_0x3accc0]['alias']||_0x14b907);}if(_0x247d1d[_0xed89('0x7d')]){_0x247d1d[_0xed89('0x7d')]=JSON[_0xed89('0x83')](_0x247d1d[_0xed89('0x7d')]);for(var _0xd48bd1=0x0;_0xd48bd1<_0x247d1d[_0xed89('0x7d')][_0xed89('0x4a')];_0xd48bd1+=0x1){if(_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x33')]&&_['includes'](_0x453663,_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x33')])&&_0x247d1d[_0xed89('0x7d')][_0xd48bd1]['parentKey']&&_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x7f')]&&_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x80')]){_0x9b5b3b[_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x33')]](_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x7f')],null,util[_0xed89('0x7a')](_0xed89('0x81'),_0x247d1d['table'],_0x247d1d['joins'][_0xd48bd1][_0xed89('0x7e')],_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x7f')],_0x247d1d[_0xed89('0x7d')][_0xd48bd1]['foreignKey']));}}}if(_0x247d1d[_0xed89('0x82')]){_0x247d1d[_0xed89('0x82')]=JSON[_0xed89('0x83')](_0x247d1d['conditions']);_0x9b5b3b[_0xed89('0x40')](_0x10e57b(_0x247d1d[_0xed89('0x82')]['group']));}_0x387454=_0x9b5b3b[_0xed89('0x84')]();_0x9b5b3b['limit'](_0x352967);_0x9b5b3b[_0xed89('0x3d')](0x0);logger['debug'](_0xed89('0xa5'),_0x9b5b3b[_0xed89('0x9e')]());return dbH[_0xed89('0x86')][_0xed89('0x35')](_0x9b5b3b[_0xed89('0x9e')](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')]['SELECT']});}})[_0xed89('0x25')](function(){return{'sql':_0x387454['toString']()};})[_0xed89('0x25')](respondWithResult(_0x2a1661,null))[_0xed89('0x4d')](handleError(_0x2a1661,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 000d245..829b017 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 _0x415b=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_custom_reports','util','../../config/logger'];(function(_0x37f089,_0x17720d){var _0x46f202=function(_0x50aece){while(--_0x50aece){_0x37f089['push'](_0x37f089['shift']());}};_0x46f202(++_0x17720d);}(_0x415b,0x198));var _0xb415=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x415b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xb415('0x0'));var logger=require(_0xb415('0x1'))(_0xb415('0x2'));var moment=require('moment');var BPromise=require(_0xb415('0x3'));var rp=require(_0xb415('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb415('0x5'));var config=require(_0xb415('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xb415('0x7')]=function(_0x4b6e8a,_0x464c88){return _0x4b6e8a[_0xb415('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xb415('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74fa=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74fa,0x6e));var _0xa74f=function(_0x3eef73,_0x4d3bfe){_0x3eef73=_0x3eef73-0x0;var _0x1ecb66=_0x74fa[_0x3eef73];return _0x1ecb66;};'use strict';var _=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var logger=require(_0xa74f('0x2'))(_0xa74f('0x3'));var moment=require(_0xa74f('0x4'));var BPromise=require(_0xa74f('0x5'));var rp=require(_0xa74f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa74f('0x7'));var config=require(_0xa74f('0x8'));var attributes=require(_0xa74f('0x9'));module[_0xa74f('0xa')]=function(_0xba83d,_0x4b1057){return _0xba83d[_0xa74f('0xb')](_0xa74f('0xc'),attributes,{'tableName':_0xa74f('0xd'),'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 995be21..780af3b 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 _0xcd67=['randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird'];(function(_0x3afd0a,_0xa8a228){var _0x26651f=function(_0x301020){while(--_0x301020){_0x3afd0a['push'](_0x3afd0a['shift']());}};_0x26651f(++_0xa8a228);}(_0xcd67,0xa9));var _0x7cd6=function(_0x27e4aa,_0x1e8ce5){_0x27e4aa=_0x27e4aa-0x0;var _0x299c7a=_0xcd67[_0x27e4aa];return _0x299c7a;};'use strict';var _=require(_0x7cd6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7cd6('0x1'));var rs=require(_0x7cd6('0x2'));var fs=require('fs');var Redis=require(_0x7cd6('0x3'));var db=require(_0x7cd6('0x4'))['db'];var utils=require(_0x7cd6('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7cd6('0x6')][_0x7cd6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bbbfc,_0x115ee3,_0x36c96e){return new BPromise(function(_0x4da491,_0x4ad5ec){return client[_0x7cd6('0x8')](_0x5bbbfc,_0x36c96e)[_0x7cd6('0x9')](function(_0x902e01){logger[_0x7cd6('0xa')](_0x7cd6('0xb'),_0x115ee3,_0x7cd6('0xc'));logger[_0x7cd6('0xd')](_0x7cd6('0xe'),_0x115ee3,_0x7cd6('0xc'),JSON['stringify'](_0x902e01));if(_0x902e01[_0x7cd6('0xf')]){if(_0x902e01[_0x7cd6('0xf')]['code']===0x1f4){logger[_0x7cd6('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x115ee3,_0x902e01[_0x7cd6('0xf')][_0x7cd6('0x10')]);return _0x4ad5ec(_0x902e01[_0x7cd6('0xf')][_0x7cd6('0x10')]);}logger[_0x7cd6('0xf')](_0x7cd6('0xb'),_0x115ee3,_0x902e01['error']['message']);return _0x4da491(_0x902e01[_0x7cd6('0xf')]['message']);}else{logger[_0x7cd6('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x115ee3,'request\x20sent');_0x4da491(_0x902e01[_0x7cd6('0x11')][_0x7cd6('0x10')]);}})[_0x7cd6('0x12')](function(_0x5bb98f){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x115ee3,_0x5bb98f);_0x4ad5ec(_0x5bb98f);});});} \ No newline at end of file +var _0x6fcf=['../../config/logger','../../config/environment','jayson/promise','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4edde7,_0x146074){var _0x12d013=function(_0x5d3561){while(--_0x5d3561){_0x4edde7['push'](_0x4edde7['shift']());}};_0x12d013(++_0x146074);}(_0x6fcf,0x11a));var _0xf6fc=function(_0x1f2104,_0x3d1a56){_0x1f2104=_0x1f2104-0x0;var _0x590031=_0x6fcf[_0x1f2104];return _0x590031;};'use strict';var _=require(_0xf6fc('0x0'));var util=require(_0xf6fc('0x1'));var moment=require(_0xf6fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6fc('0x3'));var fs=require('fs');var Redis=require(_0xf6fc('0x4'));var db=require(_0xf6fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6fc('0x6'))('rpc');var config=require(_0xf6fc('0x7'));var jayson=require(_0xf6fc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5813db,_0x5ace55,_0x548e60){return new BPromise(function(_0x1a569c,_0x47e6eb){return client['request'](_0x5813db,_0x548e60)['then'](function(_0xe6a5a){logger[_0xf6fc('0x9')](_0xf6fc('0xa'),_0x5ace55,_0xf6fc('0xb'));logger[_0xf6fc('0xc')](_0xf6fc('0xd'),_0x5ace55,_0xf6fc('0xb'),JSON['stringify'](_0xe6a5a));if(_0xe6a5a[_0xf6fc('0xe')]){if(_0xe6a5a[_0xf6fc('0xe')]['code']===0x1f4){logger[_0xf6fc('0xe')](_0xf6fc('0xa'),_0x5ace55,_0xe6a5a[_0xf6fc('0xe')]['message']);return _0x47e6eb(_0xe6a5a[_0xf6fc('0xe')][_0xf6fc('0xf')]);}logger['error'](_0xf6fc('0xa'),_0x5ace55,_0xe6a5a[_0xf6fc('0xe')][_0xf6fc('0xf')]);return _0x1a569c(_0xe6a5a[_0xf6fc('0xe')][_0xf6fc('0xf')]);}else{logger['info'](_0xf6fc('0xa'),_0x5ace55,_0xf6fc('0xb'));_0x1a569c(_0xe6a5a[_0xf6fc('0x10')][_0xf6fc('0xf')]);}})[_0xf6fc('0x11')](function(_0x736d92){logger[_0xf6fc('0xe')](_0xf6fc('0xa'),_0x5ace55,_0x736d92);_0x47e6eb(_0x736d92);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b3d3f63..dc9d9d8 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 _0x52bc=['/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','post','create','put','delete','exports','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x52bc,0xf9));var _0xc52b=function(_0x24f31c,_0x54144e){_0x24f31c=_0x24f31c-0x0;var _0x22cfc4=_0x52bc[_0x24f31c];return _0x22cfc4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc52b('0x0'));var express=require('express');var router=express[_0xc52b('0x1')]();var fs_extra=require(_0xc52b('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc52b('0x3'));var config=require('../../config/environment');var controller=require(_0xc52b('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc52b('0x5')](_0xc52b('0x6'),auth[_0xc52b('0x7')](),controller[_0xc52b('0x8')]);router[_0xc52b('0x5')](_0xc52b('0x9'),auth[_0xc52b('0x7')](),controller[_0xc52b('0xa')]);router['get'](_0xc52b('0xb'),auth[_0xc52b('0x7')](),controller['run']);router[_0xc52b('0x5')]('/:id/query',auth[_0xc52b('0x7')](),controller['query']);router[_0xc52b('0xc')]('/',auth[_0xc52b('0x7')](),controller[_0xc52b('0xd')]);router[_0xc52b('0xe')]('/:id',auth[_0xc52b('0x7')](),controller['update']);router[_0xc52b('0xf')](_0xc52b('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0xc52b('0x10')]=router; \ No newline at end of file +var _0x68f0=['/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show'];(function(_0x431baf,_0x22f29d){var _0x20f54e=function(_0x147a49){while(--_0x147a49){_0x431baf['push'](_0x431baf['shift']());}};_0x20f54e(++_0x22f29d);}(_0x68f0,0xb3));var _0x068f=function(_0x36bf1b,_0x1b8bc9){_0x36bf1b=_0x36bf1b-0x0;var _0x49c980=_0x68f0[_0x36bf1b];return _0x49c980;};'use strict';var multer=require(_0x068f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x068f('0x1'));var express=require(_0x068f('0x2'));var router=express['Router']();var fs_extra=require(_0x068f('0x3'));var auth=require(_0x068f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x068f('0x5')]('/',auth['isAuthenticated'](),controller[_0x068f('0x6')]);router[_0x068f('0x5')](_0x068f('0x7'),auth[_0x068f('0x8')](),controller[_0x068f('0x9')]);router[_0x068f('0x5')](_0x068f('0xa'),auth['isAuthenticated'](),controller[_0x068f('0xb')]);router['get'](_0x068f('0xc'),auth[_0x068f('0x8')](),controller[_0x068f('0xd')]);router[_0x068f('0x5')](_0x068f('0xe'),auth[_0x068f('0x8')](),controller[_0x068f('0xf')]);router['post']('/',auth[_0x068f('0x8')](),controller[_0x068f('0x10')]);router[_0x068f('0x11')](_0x068f('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x068f('0x12')](_0x068f('0x7'),auth['isAuthenticated'](),controller[_0x068f('0x13')]);module[_0x068f('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index d4d4e1f..d9203ab 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 _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x2291cb,_0x3d2b79){var _0x53b5d2=function(_0x300c99){while(--_0x300c99){_0x2291cb['push'](_0x2291cb['shift']());}};_0x53b5d2(++_0x3d2b79);}(_0x2bd8,0x130));var _0x82bd=function(_0x4c1a9b,_0x31b98e){_0x4c1a9b=_0x4c1a9b-0x0;var _0x504fba=_0x2bd8[_0x4c1a9b];return _0x504fba;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','TEXT'];(function(_0x1e60bc,_0x45c6c7){var _0x482300=function(_0xf489e9){while(--_0xf489e9){_0x1e60bc['push'](_0x1e60bc['shift']());}};_0x482300(++_0x45c6c7);}(_0x425d,0x1e0));var _0xd425=function(_0x4caf0d,_0x580ea2){_0x4caf0d=_0x4caf0d-0x0;var _0x473297=_0x425d[_0x4caf0d];return _0x473297;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 66cb44b..b68b297 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x44694b,_0x523100){var _0xc6a8a2=function(_0xefdca4){while(--_0xefdca4){_0x44694b['push'](_0x44694b['shift']());}};_0xc6a8a2(++_0x523100);}(_0xda19,0xd5));var _0x9da1=function(_0x5856ec,_0x536dbc){_0x5856ec=_0x5856ec-0x0;var _0x52641f=_0xda19[_0x5856ec];return _0x52641f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file +var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xabce[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c939e62..5ab5d0a 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 _0xb11f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','analytics_default_reports'];(function(_0x3f8572,_0xe61af4){var _0x94e63e=function(_0x45db5e){while(--_0x45db5e){_0x3f8572['push'](_0x3f8572['shift']());}};_0x94e63e(++_0xe61af4);}(_0xb11f,0x1b0));var _0xfb11=function(_0x3f1618,_0x58b2da){_0x3f1618=_0x3f1618-0x0;var _0x1a6baa=_0xb11f[_0x3f1618];return _0x1a6baa;};'use strict';var _=require(_0xfb11('0x0'));var util=require(_0xfb11('0x1'));var logger=require(_0xfb11('0x2'))(_0xfb11('0x3'));var moment=require(_0xfb11('0x4'));var BPromise=require(_0xfb11('0x5'));var rp=require(_0xfb11('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb11('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x22ed5c,_0x59a4f6){return _0x22ed5c['define']('AnalyticDefaultReport',attributes,{'tableName':_0xfb11('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63c4=['api','moment','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','util','../../config/logger'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x63c4,0x1d4));var _0x463c=function(_0x3a9771,_0x13158c){_0x3a9771=_0x3a9771-0x0;var _0xc5c48c=_0x63c4[_0x3a9771];return _0xc5c48c;};'use strict';var _=require('lodash');var util=require(_0x463c('0x0'));var logger=require(_0x463c('0x1'))(_0x463c('0x2'));var moment=require(_0x463c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x463c('0x4'));var rimraf=require(_0x463c('0x5'));var config=require(_0x463c('0x6'));var attributes=require(_0x463c('0x7'));module[_0x463c('0x8')]=function(_0x2b63ef,_0x87c0c0){return _0x2b63ef[_0x463c('0x9')]('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 9bbaf32..a85e71c 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 _0x59d6=['rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc438ce,_0x5eea69){var _0x5d6ef4=function(_0x29be45){while(--_0x29be45){_0xc438ce['push'](_0xc438ce['shift']());}};_0x5d6ef4(++_0x5eea69);}(_0x59d6,0x150));var _0x659d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x59d6[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x659d('0x0'));var util=require(_0x659d('0x1'));var moment=require(_0x659d('0x2'));var BPromise=require(_0x659d('0x3'));var rs=require(_0x659d('0x4'));var fs=require('fs');var Redis=require(_0x659d('0x5'));var db=require(_0x659d('0x6'))['db'];var utils=require(_0x659d('0x7'));var logger=require(_0x659d('0x8'))(_0x659d('0x9'));var config=require(_0x659d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x659d('0xb')][_0x659d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x432dd6,_0x315381,_0x3b929a){return new BPromise(function(_0x428437,_0x394d0a){return client[_0x659d('0xd')](_0x432dd6,_0x3b929a)[_0x659d('0xe')](function(_0x892b50){logger[_0x659d('0xf')](_0x659d('0x10'),_0x315381,'request\x20sent');logger['debug'](_0x659d('0x11'),_0x315381,_0x659d('0x12'),JSON[_0x659d('0x13')](_0x892b50));if(_0x892b50[_0x659d('0x14')]){if(_0x892b50[_0x659d('0x14')][_0x659d('0x15')]===0x1f4){logger[_0x659d('0x14')](_0x659d('0x10'),_0x315381,_0x892b50[_0x659d('0x14')][_0x659d('0x16')]);return _0x394d0a(_0x892b50[_0x659d('0x14')][_0x659d('0x16')]);}logger[_0x659d('0x14')](_0x659d('0x10'),_0x315381,_0x892b50['error'][_0x659d('0x16')]);return _0x428437(_0x892b50[_0x659d('0x14')]['message']);}else{logger[_0x659d('0xf')](_0x659d('0x10'),_0x315381,_0x659d('0x12'));_0x428437(_0x892b50['result'][_0x659d('0x16')]);}})['catch'](function(_0xfa942){logger[_0x659d('0x14')](_0x659d('0x10'),_0x315381,_0xfa942);_0x394d0a(_0xfa942);});});} \ No newline at end of file +var _0x255d=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x2c46a3,_0x451b1e){var _0x1873ad=function(_0x223790){while(--_0x223790){_0x2c46a3['push'](_0x2c46a3['shift']());}};_0x1873ad(++_0x451b1e);}(_0x255d,0x1b2));var _0xd255=function(_0x43d3f7,_0x4d09e3){_0x43d3f7=_0x43d3f7-0x0;var _0x30b013=_0x255d[_0x43d3f7];return _0x30b013;};'use strict';var _=require(_0xd255('0x0'));var util=require(_0xd255('0x1'));var moment=require(_0xd255('0x2'));var BPromise=require(_0xd255('0x3'));var rs=require(_0xd255('0x4'));var fs=require('fs');var Redis=require(_0xd255('0x5'));var db=require(_0xd255('0x6'))['db'];var utils=require(_0xd255('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd255('0x8'));var jayson=require(_0xd255('0x9'));var client=jayson[_0xd255('0xa')][_0xd255('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170fca,_0x597425,_0x445dca){return new BPromise(function(_0x2b066a,_0x1b51c5){return client[_0xd255('0xc')](_0x170fca,_0x445dca)[_0xd255('0xd')](function(_0x368c26){logger[_0xd255('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x597425,'request\x20sent');logger['debug'](_0xd255('0xf'),_0x597425,'request\x20sent',JSON[_0xd255('0x10')](_0x368c26));if(_0x368c26[_0xd255('0x11')]){if(_0x368c26[_0xd255('0x11')][_0xd255('0x12')]===0x1f4){logger[_0xd255('0x11')](_0xd255('0x13'),_0x597425,_0x368c26['error'][_0xd255('0x14')]);return _0x1b51c5(_0x368c26[_0xd255('0x11')]['message']);}logger[_0xd255('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x597425,_0x368c26[_0xd255('0x11')][_0xd255('0x14')]);return _0x2b066a(_0x368c26[_0xd255('0x11')][_0xd255('0x14')]);}else{logger[_0xd255('0xe')](_0xd255('0x13'),_0x597425,_0xd255('0x15'));_0x2b066a(_0x368c26[_0xd255('0x16')]['message']);}})[_0xd255('0x17')](function(_0x35b69d){logger[_0xd255('0x11')](_0xd255('0x13'),_0x597425,_0x35b69d);_0x1b51c5(_0x35b69d);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index eb86713..278a2e1 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 _0xea0e=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xea0e,0x153));var _0xeea0=function(_0x3c1c0b,_0x30f0c5){_0x3c1c0b=_0x3c1c0b-0x0;var _0x40bf23=_0xea0e[_0x3c1c0b];return _0x40bf23;};'use strict';var multer=require(_0xeea0('0x0'));var util=require(_0xeea0('0x1'));var path=require(_0xeea0('0x2'));var timeout=require(_0xeea0('0x3'));var express=require(_0xeea0('0x4'));var router=express['Router']();var fs_extra=require(_0xeea0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeea0('0x6'));var config=require(_0xeea0('0x7'));var controller=require(_0xeea0('0x8'));router[_0xeea0('0x9')]('/',auth[_0xeea0('0xa')](),controller['index']);router[_0xeea0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xeea0('0xb')]);router[_0xeea0('0x9')](_0xeea0('0xc'),auth[_0xeea0('0xa')](),controller[_0xeea0('0xd')]);router[_0xeea0('0x9')](_0xeea0('0xe'),auth[_0xeea0('0xa')](),controller[_0xeea0('0xf')]);router[_0xeea0('0x9')](_0xeea0('0x10'),auth[_0xeea0('0xa')](),controller['query']);router[_0xeea0('0x11')]('/',auth[_0xeea0('0xa')](),controller[_0xeea0('0x12')]);router[_0xeea0('0x13')](_0xeea0('0x14'),auth[_0xeea0('0xa')](),controller[_0xeea0('0x15')]);router[_0xeea0('0x16')](_0xeea0('0x14'),auth[_0xeea0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4aaa=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','create','put','update','delete','util','path','connect-timeout'];(function(_0x23ee4e,_0x3ace53){var _0x4df269=function(_0x1701c9){while(--_0x1701c9){_0x23ee4e['push'](_0x23ee4e['shift']());}};_0x4df269(++_0x3ace53);}(_0x4aaa,0x7b));var _0xa4aa=function(_0x4d367f,_0x369a96){_0x4d367f=_0x4d367f-0x0;var _0x33e085=_0x4aaa[_0x4d367f];return _0x33e085;};'use strict';var multer=require('multer');var util=require(_0xa4aa('0x0'));var path=require(_0xa4aa('0x1'));var timeout=require(_0xa4aa('0x2'));var express=require(_0xa4aa('0x3'));var router=express[_0xa4aa('0x4')]();var fs_extra=require(_0xa4aa('0x5'));var auth=require(_0xa4aa('0x6'));var interaction=require(_0xa4aa('0x7'));var config=require(_0xa4aa('0x8'));var controller=require(_0xa4aa('0x9'));router[_0xa4aa('0xa')]('/',auth[_0xa4aa('0xb')](),controller[_0xa4aa('0xc')]);router[_0xa4aa('0xa')](_0xa4aa('0xd'),auth[_0xa4aa('0xb')](),controller['show']);router[_0xa4aa('0xa')]('/:id/preview',auth[_0xa4aa('0xb')](),controller[_0xa4aa('0xe')]);router['get'](_0xa4aa('0xf'),auth[_0xa4aa('0xb')](),controller[_0xa4aa('0x10')]);router['get']('/:id/query',auth[_0xa4aa('0xb')](),controller['query']);router['post']('/',auth[_0xa4aa('0xb')](),controller[_0xa4aa('0x11')]);router[_0xa4aa('0x12')](_0xa4aa('0xd'),auth['isAuthenticated'](),controller[_0xa4aa('0x13')]);router[_0xa4aa('0x14')](_0xa4aa('0xd'),auth[_0xa4aa('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 517108f..7e5fbe1 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 _0x8380=['Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x240026,_0x113996){var _0x2a4011=function(_0x1b72f8){while(--_0x1b72f8){_0x240026['push'](_0x240026['shift']());}};_0x2a4011(++_0x113996);}(_0x8380,0xd7));var _0x0838=function(_0x3ee7c5,_0x52b517){_0x3ee7c5=_0x3ee7c5-0x0;var _0x41a97d=_0x8380[_0x3ee7c5];return _0x41a97d;};'use strict';var Sequelize=require(_0x0838('0x0'));var moment=require(_0x0838('0x1'));module[_0x0838('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0838('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0838('0x4')](_0x0838('0x5'),_0x0838('0x6'),_0x0838('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0838('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x0838('0x8')]},'status':{'type':Sequelize[_0x0838('0x3')],'defaultValue':_0x0838('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0x0838('0xa')),'allowNull':![],'defaultValue':_0x0838('0xb')},'reportId':{'type':Sequelize[_0x0838('0xc')](0xb)[_0x0838('0xd')]},'reportType':{'type':Sequelize[_0x0838('0x3')]}}; \ No newline at end of file +var _0x46a9=['csv','pdf','DATE','Loading','manual','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x46a9,0x19d));var _0x946a=function(_0x568d1a,_0x4cfc6a){_0x568d1a=_0x568d1a-0x0;var _0x505881=_0x46a9[_0x568d1a];return _0x505881;};'use strict';var Sequelize=require(_0x946a('0x0'));var moment=require(_0x946a('0x1'));module[_0x946a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x946a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x946a('0x4')](_0x946a('0x5'),_0x946a('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x946a('0x5')},'savename':{'type':Sequelize[_0x946a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x946a('0x7')]},'endDate':{'type':Sequelize[_0x946a('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x946a('0x8')},'type':{'type':Sequelize['ENUM'](_0x946a('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x946a('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x946a('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index afc7727..44d6cd4 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 _0x8b5f=['query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','include','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','exists','format','%s.%s','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','model'];(function(_0x3b0598,_0x15100f){var _0x5e2198=function(_0x19aeb7){while(--_0x19aeb7){_0x3b0598['push'](_0x3b0598['shift']());}};_0x5e2198(++_0x15100f);}(_0x8b5f,0x1e7));var _0xf8b5=function(_0x47e8fc,_0x5db630){_0x47e8fc=_0x47e8fc-0x0;var _0x427452=_0x8b5f[_0x47e8fc];return _0x427452;};'use strict';var emlformat=require(_0xf8b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf8b5('0x2'));var BPromise=require(_0xf8b5('0x3'));var Mustache=require('mustache');var util=require(_0xf8b5('0x4'));var path=require(_0xf8b5('0x5'));var sox=require(_0xf8b5('0x6'));var csv=require(_0xf8b5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8b5('0x8'));var squel=require('squel');var crypto=require(_0xf8b5('0x9'));var jsforce=require(_0xf8b5('0xa'));var deskjs=require(_0xf8b5('0xb'));var toCsv=require(_0xf8b5('0x7'));var querystring=require('querystring');var Papa=require(_0xf8b5('0xc'));var Redis=require('ioredis');var authService=require(_0xf8b5('0xd'));var qs=require(_0xf8b5('0xe'));var as=require(_0xf8b5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf8b5('0x10'));var utils=require(_0xf8b5('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xf8b5('0x12'));var db=require(_0xf8b5('0x13'))['db'];function respondWithStatusCode(_0x32b0ce,_0x24bf33){_0x24bf33=_0x24bf33||0xcc;return function(_0x3fac66){if(_0x3fac66){return _0x32b0ce[_0xf8b5('0x14')](_0x24bf33);}return _0x32b0ce[_0xf8b5('0x15')](_0x24bf33)[_0xf8b5('0x16')]();};}function respondWithResult(_0x2d2f4c,_0x1efe51){_0x1efe51=_0x1efe51||0xc8;return function(_0x44a0c3){if(_0x44a0c3){return _0x2d2f4c[_0xf8b5('0x15')](_0x1efe51)[_0xf8b5('0x17')](_0x44a0c3);}};}function respondWithFilteredResult(_0x3a908e,_0x64f2ac){return function(_0x20c76d){if(_0x20c76d){var _0x2f002e=typeof _0x64f2ac[_0xf8b5('0x18')]==='undefined'&&typeof _0x64f2ac[_0xf8b5('0x19')]===_0xf8b5('0x1a');var _0x303dc8=_0x20c76d[_0xf8b5('0x1b')];var _0x3547da=_0x2f002e?0x0:_0x64f2ac[_0xf8b5('0x18')];var _0x34d838=_0x2f002e?_0x20c76d[_0xf8b5('0x1b')]:_0x64f2ac[_0xf8b5('0x18')]+_0x64f2ac[_0xf8b5('0x19')];var _0x18d33a;if(_0x34d838>=_0x303dc8){_0x34d838=_0x303dc8;_0x18d33a=0xc8;}else{_0x18d33a=0xce;}_0x3a908e[_0xf8b5('0x15')](_0x18d33a);return _0x3a908e[_0xf8b5('0x1c')](_0xf8b5('0x1d'),_0x3547da+'-'+_0x34d838+'/'+_0x303dc8)['json'](_0x20c76d);}return null;};}function patchUpdates(_0x19e560){return function(_0x2b6249){try{jsonpatch[_0xf8b5('0x1e')](_0x2b6249,_0x19e560,!![]);}catch(_0x3198fa){return BPromise[_0xf8b5('0x1f')](_0x3198fa);}return _0x2b6249['save']();};}function saveUpdates(_0x335978,_0x1f56be){return function(_0x44fd60){if(_0x44fd60){return _0x44fd60['update'](_0x335978)[_0xf8b5('0x20')](function(_0x4e53e3){return _0x4e53e3;});}return null;};}function removeEntity(_0x20e1dc,_0x598066){return function(_0x40599a){if(_0x40599a){return _0x40599a[_0xf8b5('0x21')]()[_0xf8b5('0x20')](function(){var _0x5d6b43=_0x40599a[_0xf8b5('0x22')]({'plain':!![]});var _0x12a3fa=_0xf8b5('0x23');return db[_0xf8b5('0x24')][_0xf8b5('0x21')]({'where':{'type':_0x12a3fa,'resourceId':_0x5d6b43['id']}})['then'](function(){return _0x40599a;});})[_0xf8b5('0x20')](function(){_0x20e1dc['status'](0xcc)[_0xf8b5('0x16')]();});}};}function handleEntityNotFound(_0x2e3ebe,_0x4db8e9){return function(_0x416d90){if(!_0x416d90){_0x2e3ebe[_0xf8b5('0x14')](0x194);}return _0x416d90;};}function handleError(_0x1b85f9,_0x225cd3){_0x225cd3=_0x225cd3||0x1f4;return function(_0xa19c8){logger[_0xf8b5('0x25')](_0xa19c8[_0xf8b5('0x26')]);if(_0xa19c8[_0xf8b5('0x27')]){delete _0xa19c8[_0xf8b5('0x27')];}_0x1b85f9[_0xf8b5('0x15')](_0x225cd3)[_0xf8b5('0x28')](_0xa19c8);};}exports['index']=function(_0x4447e2,_0x9e7573){var _0x584005={},_0x5478c2={},_0x4c2868={'count':0x0,'rows':[]};var _0x51f06f=_[_0xf8b5('0x29')](db[_0xf8b5('0x2a')][_0xf8b5('0x2b')],function(_0x2516ea){return{'name':_0x2516ea['fieldName'],'type':_0x2516ea[_0xf8b5('0x2c')][_0xf8b5('0x2d')]};});_0x5478c2[_0xf8b5('0x2e')]=_[_0xf8b5('0x29')](_0x51f06f,_0xf8b5('0x27'));_0x5478c2[_0xf8b5('0x2f')]=_[_0xf8b5('0x30')](_0x4447e2[_0xf8b5('0x2f')]);_0x5478c2[_0xf8b5('0x31')]=_['intersection'](_0x5478c2[_0xf8b5('0x2e')],_0x5478c2[_0xf8b5('0x2f')]);_0x584005['attributes']=_[_0xf8b5('0x32')](_0x5478c2[_0xf8b5('0x2e')],qs[_0xf8b5('0x33')](_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x33')]));_0x584005[_0xf8b5('0x34')]=_0x584005['attributes'][_0xf8b5('0x35')]?_0x584005['attributes']:_0x5478c2[_0xf8b5('0x2e')];if(!_0x4447e2[_0xf8b5('0x2f')]['hasOwnProperty'](_0xf8b5('0x36'))){_0x584005[_0xf8b5('0x19')]=qs['limit'](_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x19')]);_0x584005[_0xf8b5('0x18')]=qs[_0xf8b5('0x18')](_0x4447e2['query'][_0xf8b5('0x18')]);}_0x584005[_0xf8b5('0x37')]=qs[_0xf8b5('0x38')](_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x38')]);_0x584005[_0xf8b5('0x39')]=qs[_0xf8b5('0x31')](_[_0xf8b5('0x3a')](_0x4447e2[_0xf8b5('0x2f')],_0x5478c2['filters']),_0x51f06f);if(_0x4447e2['query'][_0xf8b5('0x3b')]){_0x584005['where']=_[_0xf8b5('0x3c')](_0x584005[_0xf8b5('0x39')],{'$or':_['map'](_0x51f06f,function(_0x1b46af){if(_0x1b46af[_0xf8b5('0x2c')]!==_0xf8b5('0x3d')){var _0x39f4fc={};_0x39f4fc[_0x1b46af[_0xf8b5('0x27')]]={'$like':'%'+_0x4447e2[_0xf8b5('0x2f')]['filter']+'%'};return _0x39f4fc;}})});}_0x584005=_[_0xf8b5('0x3c')]({},_0x584005,_0x4447e2[_0xf8b5('0x3e')]);var _0x132aff={'where':_0x584005[_0xf8b5('0x39')]};return db['AnalyticExtractedReport']['count'](_0x132aff)[_0xf8b5('0x20')](function(_0x53942e){_0x4c2868[_0xf8b5('0x1b')]=_0x53942e;if(_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x3f')]){_0x584005['include']=[{'all':!![]}];}return db[_0xf8b5('0x2a')]['findAll'](_0x584005);})['then'](function(_0x29f733){_0x4c2868[_0xf8b5('0x40')]=_0x29f733;return _0x4c2868;})[_0xf8b5('0x20')](respondWithFilteredResult(_0x9e7573,_0x584005))['catch'](handleError(_0x9e7573,null));};exports['show']=function(_0x37e3db,_0x12b82e){var _0x18f6e4={'raw':!![],'where':{'id':_0x37e3db[_0xf8b5('0x41')]['id']}},_0x50c108={};_0x50c108[_0xf8b5('0x2e')]=_[_0xf8b5('0x30')](db['AnalyticExtractedReport']['rawAttributes']);_0x50c108[_0xf8b5('0x2f')]=_[_0xf8b5('0x30')](_0x37e3db[_0xf8b5('0x2f')]);_0x50c108[_0xf8b5('0x31')]=_[_0xf8b5('0x32')](_0x50c108[_0xf8b5('0x2e')],_0x50c108[_0xf8b5('0x2f')]);_0x18f6e4[_0xf8b5('0x34')]=_['intersection'](_0x50c108[_0xf8b5('0x2e')],qs[_0xf8b5('0x33')](_0x37e3db[_0xf8b5('0x2f')][_0xf8b5('0x33')]));_0x18f6e4[_0xf8b5('0x34')]=_0x18f6e4[_0xf8b5('0x34')]['length']?_0x18f6e4[_0xf8b5('0x34')]:_0x50c108[_0xf8b5('0x2e')];if(_0x37e3db[_0xf8b5('0x2f')][_0xf8b5('0x3f')]){_0x18f6e4[_0xf8b5('0x42')]=[{'all':!![]}];}_0x18f6e4=_[_0xf8b5('0x3c')]({},_0x18f6e4,_0x37e3db[_0xf8b5('0x3e')]);return db['AnalyticExtractedReport'][_0xf8b5('0x43')](_0x18f6e4)[_0xf8b5('0x20')](handleEntityNotFound(_0x12b82e,null))['then'](respondWithResult(_0x12b82e,null))[_0xf8b5('0x44')](handleError(_0x12b82e,null));};exports[_0xf8b5('0x45')]=function(_0x4bd456,_0x29cd53){return db[_0xf8b5('0x2a')][_0xf8b5('0x45')](_0x4bd456['body'],{})[_0xf8b5('0x20')](function(_0x61529f){var _0x3bb370=_0x4bd456[_0xf8b5('0x46')][_0xf8b5('0x22')]({'plain':!![]});if(!_0x3bb370)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bb370[_0xf8b5('0x47')]==='user'){var _0x33f4ff=_0x61529f[_0xf8b5('0x22')]({'plain':!![]});var _0xcc1b7a=_0xf8b5('0x23');return db[_0xf8b5('0x48')][_0xf8b5('0x43')]({'where':{'name':_0xcc1b7a,'userProfileId':_0x3bb370[_0xf8b5('0x49')]},'raw':!![]})[_0xf8b5('0x20')](function(_0x4d9cda){if(_0x4d9cda&&_0x4d9cda[_0xf8b5('0x4a')]===0x0){return db[_0xf8b5('0x24')]['create']({'name':_0x33f4ff[_0xf8b5('0x27')],'resourceId':_0x33f4ff['id'],'type':_0x4d9cda[_0xf8b5('0x27')],'sectionId':_0x4d9cda['id']},{})[_0xf8b5('0x20')](function(){return _0x61529f;});}else{return _0x61529f;}})[_0xf8b5('0x44')](function(_0x36fc0d){logger[_0xf8b5('0x25')](_0xf8b5('0x4b'),_0x36fc0d);throw _0x36fc0d;});}return _0x61529f;})[_0xf8b5('0x20')](respondWithResult(_0x29cd53,0xc9))[_0xf8b5('0x44')](handleError(_0x29cd53,null));};exports[_0xf8b5('0x4c')]=function(_0x194d70,_0x154afa){if(_0x194d70['body']['id']){delete _0x194d70[_0xf8b5('0x4d')]['id'];}return db[_0xf8b5('0x2a')]['find']({'where':{'id':_0x194d70[_0xf8b5('0x41')]['id']}})['then'](handleEntityNotFound(_0x154afa,null))[_0xf8b5('0x20')](saveUpdates(_0x194d70[_0xf8b5('0x4d')],null))[_0xf8b5('0x20')](respondWithResult(_0x154afa,null))[_0xf8b5('0x44')](handleError(_0x154afa,null));};exports[_0xf8b5('0x21')]=function(_0xf126f4,_0x13ecf9){return db[_0xf8b5('0x2a')][_0xf8b5('0x43')]({'where':{'id':_0xf126f4[_0xf8b5('0x41')]['id']}})[_0xf8b5('0x20')](handleEntityNotFound(_0x13ecf9,null))[_0xf8b5('0x20')](removeEntity(_0x13ecf9,null))[_0xf8b5('0x44')](handleError(_0x13ecf9,null));};exports[_0xf8b5('0x4e')]=function(_0x580ec6,_0x3bba0b,_0xd1ee5b){return db[_0xf8b5('0x2a')]['find']({'where':{'id':_0x580ec6['params']['id']},'attributes':[_0xf8b5('0x27'),_0xf8b5('0x4f'),_0xf8b5('0x50'),_0xf8b5('0x51')],'raw':!![]})[_0xf8b5('0x20')](handleEntityNotFound(_0x3bba0b,null))[_0xf8b5('0x20')](function(_0x471b66){if(_0x471b66){if(!fs[_0xf8b5('0x52')](path['join'](config[_0xf8b5('0x53')],_0xf8b5('0x54'),_0x471b66['savename']))){throw new db[(_0xf8b5('0x55'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x580ec6['query'][_0xf8b5('0x56')]){return _0x3bba0b[_0xf8b5('0x14')](0xc8);}return _0x3bba0b[_0xf8b5('0x4e')](path['join'](config['root'],_0xf8b5('0x54'),_0x471b66[_0xf8b5('0x50')]),util[_0xf8b5('0x57')](_0xf8b5('0x58'),_0x471b66['basename']||_0x471b66[_0xf8b5('0x27')],_0x471b66[_0xf8b5('0x51')]['toLowerCase']()));}})[_0xf8b5('0x44')](handleError(_0x3bba0b,null));}; \ No newline at end of file +var _0x6d96=['then','get','ExtractedReports','UserProfileResource','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','params','basename','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','save','update','destroy'];(function(_0x29e079,_0x3e1be0){var _0x4fdaca=function(_0x546360){while(--_0x546360){_0x29e079['push'](_0x29e079['shift']());}};_0x4fdaca(++_0x3e1be0);}(_0x6d96,0xeb));var _0x66d9=function(_0x4c38b2,_0x226268){_0x4c38b2=_0x4c38b2-0x0;var _0x598ad5=_0x6d96[_0x4c38b2];return _0x598ad5;};'use strict';var emlformat=require(_0x66d9('0x0'));var rimraf=require(_0x66d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66d9('0x2'));var rp=require(_0x66d9('0x3'));var moment=require('moment');var BPromise=require(_0x66d9('0x4'));var Mustache=require(_0x66d9('0x5'));var util=require('util');var path=require(_0x66d9('0x6'));var sox=require('sox');var csv=require(_0x66d9('0x7'));var ejs=require(_0x66d9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66d9('0x9'));var squel=require(_0x66d9('0xa'));var crypto=require(_0x66d9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x66d9('0x7'));var querystring=require(_0x66d9('0xc'));var Papa=require(_0x66d9('0xd'));var Redis=require(_0x66d9('0xe'));var authService=require(_0x66d9('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66d9('0x10'));var logger=require(_0x66d9('0x11'))(_0x66d9('0x12'));var utils=require(_0x66d9('0x13'));var config=require(_0x66d9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x66d9('0x15'))['db'];function respondWithStatusCode(_0x291fdc,_0x38dc84){_0x38dc84=_0x38dc84||0xcc;return function(_0x5ac72b){if(_0x5ac72b){return _0x291fdc[_0x66d9('0x16')](_0x38dc84);}return _0x291fdc['status'](_0x38dc84)[_0x66d9('0x17')]();};}function respondWithResult(_0x44c24a,_0x278109){_0x278109=_0x278109||0xc8;return function(_0x54b6bd){if(_0x54b6bd){return _0x44c24a[_0x66d9('0x18')](_0x278109)[_0x66d9('0x19')](_0x54b6bd);}};}function respondWithFilteredResult(_0x4d12d7,_0x28c8cd){return function(_0x137da4){if(_0x137da4){var _0x5ceb0a=typeof _0x28c8cd['offset']==='undefined'&&typeof _0x28c8cd[_0x66d9('0x1a')]==='undefined';var _0x160d17=_0x137da4[_0x66d9('0x1b')];var _0x1c7922=_0x5ceb0a?0x0:_0x28c8cd['offset'];var _0x401768=_0x5ceb0a?_0x137da4[_0x66d9('0x1b')]:_0x28c8cd[_0x66d9('0x1c')]+_0x28c8cd[_0x66d9('0x1a')];var _0x218696;if(_0x401768>=_0x160d17){_0x401768=_0x160d17;_0x218696=0xc8;}else{_0x218696=0xce;}_0x4d12d7[_0x66d9('0x18')](_0x218696);return _0x4d12d7[_0x66d9('0x1d')](_0x66d9('0x1e'),_0x1c7922+'-'+_0x401768+'/'+_0x160d17)[_0x66d9('0x19')](_0x137da4);}return null;};}function patchUpdates(_0x17c995){return function(_0x2651e6){try{jsonpatch[_0x66d9('0x1f')](_0x2651e6,_0x17c995,!![]);}catch(_0x239599){return BPromise['reject'](_0x239599);}return _0x2651e6[_0x66d9('0x20')]();};}function saveUpdates(_0x314cf8,_0x4f4157){return function(_0x519a03){if(_0x519a03){return _0x519a03[_0x66d9('0x21')](_0x314cf8)['then'](function(_0x304bf0){return _0x304bf0;});}return null;};}function removeEntity(_0x182625,_0x737f2d){return function(_0x34a706){if(_0x34a706){return _0x34a706[_0x66d9('0x22')]()[_0x66d9('0x23')](function(){var _0x33263e=_0x34a706[_0x66d9('0x24')]({'plain':!![]});var _0x55c096=_0x66d9('0x25');return db[_0x66d9('0x26')][_0x66d9('0x22')]({'where':{'type':_0x55c096,'resourceId':_0x33263e['id']}})[_0x66d9('0x23')](function(){return _0x34a706;});})[_0x66d9('0x23')](function(){_0x182625['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42f6a1,_0x23a11f){return function(_0x470e68){if(!_0x470e68){_0x42f6a1[_0x66d9('0x16')](0x194);}return _0x470e68;};}function handleError(_0x26e01c,_0x26c5ac){_0x26c5ac=_0x26c5ac||0x1f4;return function(_0x5077c4){logger['error'](_0x5077c4[_0x66d9('0x27')]);if(_0x5077c4[_0x66d9('0x28')]){delete _0x5077c4[_0x66d9('0x28')];}_0x26e01c['status'](_0x26c5ac)[_0x66d9('0x29')](_0x5077c4);};}exports['index']=function(_0x31ce1a,_0x5611cf){var _0x715709={},_0x1a4787={},_0x277c81={'count':0x0,'rows':[]};var _0x2e7710=_[_0x66d9('0x2a')](db['AnalyticExtractedReport'][_0x66d9('0x2b')],function(_0x4d6f41){return{'name':_0x4d6f41['fieldName'],'type':_0x4d6f41[_0x66d9('0x2c')][_0x66d9('0x2d')]};});_0x1a4787[_0x66d9('0x2e')]=_['map'](_0x2e7710,_0x66d9('0x28'));_0x1a4787[_0x66d9('0x2f')]=_['keys'](_0x31ce1a[_0x66d9('0x2f')]);_0x1a4787[_0x66d9('0x30')]=_[_0x66d9('0x31')](_0x1a4787[_0x66d9('0x2e')],_0x1a4787[_0x66d9('0x2f')]);_0x715709[_0x66d9('0x32')]=_[_0x66d9('0x31')](_0x1a4787[_0x66d9('0x2e')],qs[_0x66d9('0x33')](_0x31ce1a[_0x66d9('0x2f')]['fields']));_0x715709[_0x66d9('0x32')]=_0x715709['attributes'][_0x66d9('0x34')]?_0x715709[_0x66d9('0x32')]:_0x1a4787[_0x66d9('0x2e')];if(!_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x35')](_0x66d9('0x36'))){_0x715709[_0x66d9('0x1a')]=qs[_0x66d9('0x1a')](_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x1a')]);_0x715709['offset']=qs[_0x66d9('0x1c')](_0x31ce1a[_0x66d9('0x2f')]['offset']);}_0x715709['order']=qs[_0x66d9('0x37')](_0x31ce1a['query']['sort']);_0x715709[_0x66d9('0x38')]=qs[_0x66d9('0x30')](_[_0x66d9('0x39')](_0x31ce1a[_0x66d9('0x2f')],_0x1a4787['filters']),_0x2e7710);if(_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x3a')]){_0x715709[_0x66d9('0x38')]=_[_0x66d9('0x3b')](_0x715709[_0x66d9('0x38')],{'$or':_[_0x66d9('0x2a')](_0x2e7710,function(_0x58d481){if(_0x58d481['type']!==_0x66d9('0x3c')){var _0x216f20={};_0x216f20[_0x58d481[_0x66d9('0x28')]]={'$like':'%'+_0x31ce1a['query'][_0x66d9('0x3a')]+'%'};return _0x216f20;}})});}_0x715709=_[_0x66d9('0x3b')]({},_0x715709,_0x31ce1a[_0x66d9('0x3d')]);var _0x16ce14={'where':_0x715709[_0x66d9('0x38')]};return db[_0x66d9('0x3e')][_0x66d9('0x1b')](_0x16ce14)[_0x66d9('0x23')](function(_0x53ffc7){_0x277c81[_0x66d9('0x1b')]=_0x53ffc7;if(_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x3f')]){_0x715709[_0x66d9('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x715709);})[_0x66d9('0x23')](function(_0xf4e2e6){_0x277c81['rows']=_0xf4e2e6;return _0x277c81;})[_0x66d9('0x23')](respondWithFilteredResult(_0x5611cf,_0x715709))[_0x66d9('0x41')](handleError(_0x5611cf,null));};exports[_0x66d9('0x42')]=function(_0x546e44,_0x1da7b6){var _0x5b6dbd={'raw':!![],'where':{'id':_0x546e44['params']['id']}},_0x49fe80={};_0x49fe80[_0x66d9('0x2e')]=_[_0x66d9('0x43')](db[_0x66d9('0x3e')][_0x66d9('0x2b')]);_0x49fe80['query']=_['keys'](_0x546e44[_0x66d9('0x2f')]);_0x49fe80[_0x66d9('0x30')]=_[_0x66d9('0x31')](_0x49fe80[_0x66d9('0x2e')],_0x49fe80[_0x66d9('0x2f')]);_0x5b6dbd['attributes']=_[_0x66d9('0x31')](_0x49fe80[_0x66d9('0x2e')],qs['fields'](_0x546e44[_0x66d9('0x2f')]['fields']));_0x5b6dbd[_0x66d9('0x32')]=_0x5b6dbd[_0x66d9('0x32')][_0x66d9('0x34')]?_0x5b6dbd['attributes']:_0x49fe80[_0x66d9('0x2e')];if(_0x546e44[_0x66d9('0x2f')][_0x66d9('0x3f')]){_0x5b6dbd['include']=[{'all':!![]}];}_0x5b6dbd=_['merge']({},_0x5b6dbd,_0x546e44['options']);return db['AnalyticExtractedReport'][_0x66d9('0x44')](_0x5b6dbd)[_0x66d9('0x23')](handleEntityNotFound(_0x1da7b6,null))['then'](respondWithResult(_0x1da7b6,null))[_0x66d9('0x41')](handleError(_0x1da7b6,null));};exports[_0x66d9('0x45')]=function(_0x12a3f9,_0x3b93f7){return db['AnalyticExtractedReport']['create'](_0x12a3f9[_0x66d9('0x46')],{})[_0x66d9('0x23')](function(_0x26f8c6){var _0x4be03e=_0x12a3f9[_0x66d9('0x47')][_0x66d9('0x24')]({'plain':!![]});if(!_0x4be03e)throw new Error(_0x66d9('0x48'));if(_0x4be03e[_0x66d9('0x49')]===_0x66d9('0x47')){var _0x25ae47=_0x26f8c6[_0x66d9('0x24')]({'plain':!![]});var _0x4fa068='ExtractedReports';return db['UserProfileSection'][_0x66d9('0x44')]({'where':{'name':_0x4fa068,'userProfileId':_0x4be03e[_0x66d9('0x4a')]},'raw':!![]})[_0x66d9('0x23')](function(_0x153c04){if(_0x153c04&&_0x153c04['autoAssociation']===0x0){return db[_0x66d9('0x26')][_0x66d9('0x45')]({'name':_0x25ae47[_0x66d9('0x28')],'resourceId':_0x25ae47['id'],'type':_0x153c04[_0x66d9('0x28')],'sectionId':_0x153c04['id']},{})[_0x66d9('0x23')](function(){return _0x26f8c6;});}else{return _0x26f8c6;}})['catch'](function(_0x3d5c9f){logger[_0x66d9('0x4b')](_0x66d9('0x4c'),_0x3d5c9f);throw _0x3d5c9f;});}return _0x26f8c6;})[_0x66d9('0x23')](respondWithResult(_0x3b93f7,0xc9))[_0x66d9('0x41')](handleError(_0x3b93f7,null));};exports[_0x66d9('0x21')]=function(_0x9bf4e3,_0x16cc5d){if(_0x9bf4e3[_0x66d9('0x46')]['id']){delete _0x9bf4e3[_0x66d9('0x46')]['id'];}return db['AnalyticExtractedReport'][_0x66d9('0x44')]({'where':{'id':_0x9bf4e3['params']['id']}})[_0x66d9('0x23')](handleEntityNotFound(_0x16cc5d,null))[_0x66d9('0x23')](saveUpdates(_0x9bf4e3[_0x66d9('0x46')],null))[_0x66d9('0x23')](respondWithResult(_0x16cc5d,null))[_0x66d9('0x41')](handleError(_0x16cc5d,null));};exports[_0x66d9('0x22')]=function(_0x427e64,_0x3477dd){return db[_0x66d9('0x3e')][_0x66d9('0x44')]({'where':{'id':_0x427e64['params']['id']}})[_0x66d9('0x23')](handleEntityNotFound(_0x3477dd,null))['then'](removeEntity(_0x3477dd,null))['catch'](handleError(_0x3477dd,null));};exports[_0x66d9('0x4d')]=function(_0x1b0481,_0x33a16c,_0x520ad2){return db[_0x66d9('0x3e')][_0x66d9('0x44')]({'where':{'id':_0x1b0481[_0x66d9('0x4e')]['id']},'attributes':[_0x66d9('0x28'),_0x66d9('0x4f'),_0x66d9('0x50'),_0x66d9('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x33a16c,null))[_0x66d9('0x23')](function(_0x1bb8f3){if(_0x1bb8f3){if(!fs['existsSync'](path[_0x66d9('0x52')](config[_0x66d9('0x53')],_0x66d9('0x54'),_0x1bb8f3[_0x66d9('0x50')]))){throw new db[(_0x66d9('0x55'))]['ValidationError'](_0x66d9('0x56'));}if(_0x1b0481[_0x66d9('0x2f')][_0x66d9('0x57')]){return _0x33a16c[_0x66d9('0x16')](0xc8);}return _0x33a16c[_0x66d9('0x4d')](path[_0x66d9('0x52')](config['root'],_0x66d9('0x54'),_0x1bb8f3['savename']),util[_0x66d9('0x58')]('%s.%s',_0x1bb8f3['basename']||_0x1bb8f3[_0x66d9('0x28')],_0x1bb8f3[_0x66d9('0x51')][_0x66d9('0x59')]()));}})[_0x66d9('0x41')](handleError(_0x33a16c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 193efc1..e2cd354 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 _0xe38d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x40ae42,_0xce6d5a){var _0x35132b=function(_0x24b634){while(--_0x24b634){_0x40ae42['push'](_0x40ae42['shift']());}};_0x35132b(++_0xce6d5a);}(_0xe38d,0xe9));var _0xde38=function(_0xb0a064,_0x2535a8){_0xb0a064=_0xb0a064-0x0;var _0x26e680=_0xe38d[_0xb0a064];return _0x26e680;};'use strict';var _=require(_0xde38('0x0'));var util=require(_0xde38('0x1'));var logger=require(_0xde38('0x2'))(_0xde38('0x3'));var moment=require(_0xde38('0x4'));var BPromise=require(_0xde38('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde38('0x6'));var rimraf=require(_0xde38('0x7'));var config=require(_0xde38('0x8'));var attributes=require(_0xde38('0x9'));module[_0xde38('0xa')]=function(_0x3f22f6,_0x1cf7f9){return _0x3f22f6['define'](_0xde38('0xb'),attributes,{'tableName':_0xde38('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e8=['analytics_extracted_reports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x99e8,0x12d));var _0x899e=function(_0x1133b7,_0x4ef9fe){_0x1133b7=_0x1133b7-0x0;var _0x113492=_0x99e8[_0x1133b7];return _0x113492;};'use strict';var _=require(_0x899e('0x0'));var util=require(_0x899e('0x1'));var logger=require('../../config/logger')(_0x899e('0x2'));var moment=require(_0x899e('0x3'));var BPromise=require('bluebird');var rp=require(_0x899e('0x4'));var fs=require('fs');var path=require(_0x899e('0x5'));var rimraf=require(_0x899e('0x6'));var config=require(_0x899e('0x7'));var attributes=require(_0x899e('0x8'));module['exports']=function(_0x4b0b6a,_0x30f585){return _0x4b0b6a[_0x899e('0x9')](_0x899e('0xa'),attributes,{'tableName':_0x899e('0xb'),'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 b229292..655bac0 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 _0xa4ad=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1bacfe,_0x8de443){var _0x23f634=function(_0x17b63b){while(--_0x17b63b){_0x1bacfe['push'](_0x1bacfe['shift']());}};_0x23f634(++_0x8de443);}(_0xa4ad,0x80));var _0xda4a=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xa4ad[_0x365e54];return _0x13317a;};'use strict';var _=require(_0xda4a('0x0'));var util=require('util');var moment=require(_0xda4a('0x1'));var BPromise=require(_0xda4a('0x2'));var rs=require(_0xda4a('0x3'));var fs=require('fs');var Redis=require(_0xda4a('0x4'));var db=require(_0xda4a('0x5'))['db'];var utils=require(_0xda4a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xda4a('0x7'));var jayson=require(_0xda4a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33597c,_0x12d5b1,_0x1786c3){return new BPromise(function(_0x392abf,_0x236f49){return client[_0xda4a('0x9')](_0x33597c,_0x1786c3)[_0xda4a('0xa')](function(_0x1bec50){logger[_0xda4a('0xb')](_0xda4a('0xc'),_0x12d5b1,'request\x20sent');logger['debug'](_0xda4a('0xd'),_0x12d5b1,_0xda4a('0xe'),JSON['stringify'](_0x1bec50));if(_0x1bec50[_0xda4a('0xf')]){if(_0x1bec50[_0xda4a('0xf')][_0xda4a('0x10')]===0x1f4){logger[_0xda4a('0xf')](_0xda4a('0xc'),_0x12d5b1,_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);return _0x236f49(_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);}logger[_0xda4a('0xf')](_0xda4a('0xc'),_0x12d5b1,_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);return _0x392abf(_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);}else{logger[_0xda4a('0xb')](_0xda4a('0xc'),_0x12d5b1,_0xda4a('0xe'));_0x392abf(_0x1bec50[_0xda4a('0x12')][_0xda4a('0x11')]);}})['catch'](function(_0x3e9929){logger[_0xda4a('0xf')](_0xda4a('0xc'),_0x12d5b1,_0x3e9929);_0x236f49(_0x3e9929);});});} \ No newline at end of file +var _0xae77=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xae77,0x15d));var _0x7ae7=function(_0x57f8fe,_0x212583){_0x57f8fe=_0x57f8fe-0x0;var _0x109371=_0xae77[_0x57f8fe];return _0x109371;};'use strict';var _=require('lodash');var util=require(_0x7ae7('0x0'));var moment=require(_0x7ae7('0x1'));var BPromise=require(_0x7ae7('0x2'));var rs=require(_0x7ae7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ae7('0x4'))['db'];var utils=require(_0x7ae7('0x5'));var logger=require(_0x7ae7('0x6'))(_0x7ae7('0x7'));var config=require(_0x7ae7('0x8'));var jayson=require(_0x7ae7('0x9'));var client=jayson[_0x7ae7('0xa')][_0x7ae7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40c637,_0x5e199e,_0x32703d){return new BPromise(function(_0x567fe,_0x3ba56a){return client['request'](_0x40c637,_0x32703d)[_0x7ae7('0xc')](function(_0x2b5282){logger['info'](_0x7ae7('0xd'),_0x5e199e,_0x7ae7('0xe'));logger[_0x7ae7('0xf')](_0x7ae7('0x10'),_0x5e199e,_0x7ae7('0xe'),JSON['stringify'](_0x2b5282));if(_0x2b5282[_0x7ae7('0x11')]){if(_0x2b5282[_0x7ae7('0x11')][_0x7ae7('0x12')]===0x1f4){logger[_0x7ae7('0x11')](_0x7ae7('0xd'),_0x5e199e,_0x2b5282['error'][_0x7ae7('0x13')]);return _0x3ba56a(_0x2b5282[_0x7ae7('0x11')]['message']);}logger[_0x7ae7('0x11')](_0x7ae7('0xd'),_0x5e199e,_0x2b5282[_0x7ae7('0x11')]['message']);return _0x567fe(_0x2b5282['error'][_0x7ae7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5e199e,_0x7ae7('0xe'));_0x567fe(_0x2b5282[_0x7ae7('0x14')][_0x7ae7('0x13')]);}})[_0x7ae7('0x15')](function(_0x35f887){logger[_0x7ae7('0x11')](_0x7ae7('0xd'),_0x5e199e,_0x35f887);_0x3ba56a(_0x35f887);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1c21014..e944d73 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 _0x8fab=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','download','create','update','delete','destroy','multer','connect-timeout','express'];(function(_0x4a35b3,_0x5bc5a1){var _0x4a8136=function(_0x215b0d){while(--_0x215b0d){_0x4a35b3['push'](_0x4a35b3['shift']());}};_0x4a8136(++_0x5bc5a1);}(_0x8fab,0x75));var _0xb8fa=function(_0x46bef8,_0x280566){_0x46bef8=_0x46bef8-0x0;var _0x2379ed=_0x8fab[_0x46bef8];return _0x2379ed;};'use strict';var multer=require(_0xb8fa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb8fa('0x1'));var express=require(_0xb8fa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb8fa('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb8fa('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0x6')]);router[_0xb8fa('0x7')](_0xb8fa('0x8'),auth[_0xb8fa('0x5')](),controller[_0xb8fa('0x9')]);router['get']('/:id/download',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xa')]);router['post']('/',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xb')]);router['put']('/:id',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xc')]);router[_0xb8fa('0xd')]('/:id',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe14e=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/download','download','post','create','put','/:id','update','delete','destroy'];(function(_0x507597,_0x412525){var _0x110a0f=function(_0x57935a){while(--_0x57935a){_0x507597['push'](_0x507597['shift']());}};_0x110a0f(++_0x412525);}(_0xe14e,0x141));var _0xee14=function(_0x3f2022,_0x18767d){_0x3f2022=_0x3f2022-0x0;var _0x3c3fff=_0xe14e[_0x3f2022];return _0x3c3fff;};'use strict';var multer=require(_0xee14('0x0'));var util=require(_0xee14('0x1'));var path=require(_0xee14('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee14('0x3')]();var fs_extra=require(_0xee14('0x4'));var auth=require(_0xee14('0x5'));var interaction=require(_0xee14('0x6'));var config=require(_0xee14('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xee14('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee14('0x8')]('/:id',auth[_0xee14('0x9')](),controller['show']);router['get'](_0xee14('0xa'),auth[_0xee14('0x9')](),controller[_0xee14('0xb')]);router[_0xee14('0xc')]('/',auth[_0xee14('0x9')](),controller[_0xee14('0xd')]);router[_0xee14('0xe')](_0xee14('0xf'),auth['isAuthenticated'](),controller[_0xee14('0x10')]);router[_0xee14('0x11')](_0xee14('0xf'),auth['isAuthenticated'](),controller[_0xee14('0x12')]);module[_0xee14('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index cae3072..441f47f 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 _0x16d0=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0xa9a1d8,_0x54279c){var _0x1d7184=function(_0x1acac4){while(--_0x1acac4){_0xa9a1d8['push'](_0xa9a1d8['shift']());}};_0x1d7184(++_0x54279c);}(_0x16d0,0x145));var _0x016d=function(_0x592f78,_0x2638b0){_0x592f78=_0x592f78-0x0;var _0x2fe1ee=_0x16d0[_0x592f78];return _0x2fe1ee;};'use strict';var Sequelize=require(_0x016d('0x0'));module['exports']={'field':{'type':Sequelize[_0x016d('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x016d('0x2')]},'format':{'type':Sequelize[_0x016d('0x2')]},'groupBy':{'type':Sequelize[_0x016d('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x016d('0x2')]},'custom':{'type':Sequelize[_0x016d('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x76e6=['STRING','BOOLEAN','exports','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x76e6,0x1c2));var _0x676e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x76e6[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x676e('0x0')]={'field':{'type':Sequelize[_0x676e('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x676e('0x2')]},'groupBy':{'type':Sequelize[_0x676e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x676e('0x2')]},'custom':{'type':Sequelize[_0x676e('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0448bd0..ed9cec4 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 _0x03d8=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','catch','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x1c7b8b,_0x2ce52c){var _0x273b99=function(_0x587511){while(--_0x587511){_0x1c7b8b['push'](_0x1c7b8b['shift']());}};_0x273b99(++_0x2ce52c);}(_0x03d8,0x72));var _0x803d=function(_0x24532f,_0x56d15b){_0x24532f=_0x24532f-0x0;var _0x4413dd=_0x03d8[_0x24532f];return _0x4413dd;};'use strict';var emlformat=require(_0x803d('0x0'));var rimraf=require(_0x803d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x803d('0x2'));var rp=require(_0x803d('0x3'));var moment=require(_0x803d('0x4'));var BPromise=require(_0x803d('0x5'));var Mustache=require(_0x803d('0x6'));var util=require(_0x803d('0x7'));var path=require('path');var sox=require(_0x803d('0x8'));var csv=require(_0x803d('0x9'));var ejs=require(_0x803d('0xa'));var fs=require('fs');var fs_extra=require(_0x803d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x803d('0xc'));var jsforce=require(_0x803d('0xd'));var deskjs=require(_0x803d('0xe'));var toCsv=require(_0x803d('0x9'));var querystring=require(_0x803d('0xf'));var Papa=require(_0x803d('0x10'));var Redis=require(_0x803d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x803d('0x12'));var as=require(_0x803d('0x13'));var hardwareService=require(_0x803d('0x14'));var logger=require(_0x803d('0x15'))('api');var utils=require(_0x803d('0x16'));var config=require(_0x803d('0x17'));var licenseUtil=require(_0x803d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56a87b,_0x4ef729){_0x4ef729=_0x4ef729||0xcc;return function(_0x23859e){if(_0x23859e){return _0x56a87b[_0x803d('0x19')](_0x4ef729);}return _0x56a87b[_0x803d('0x1a')](_0x4ef729)[_0x803d('0x1b')]();};}function respondWithResult(_0x1b355d,_0x2ea0b6){_0x2ea0b6=_0x2ea0b6||0xc8;return function(_0x30ad2b){if(_0x30ad2b){return _0x1b355d[_0x803d('0x1a')](_0x2ea0b6)[_0x803d('0x1c')](_0x30ad2b);}};}function respondWithFilteredResult(_0x4dff90,_0x35e52c){return function(_0x281475){if(_0x281475){var _0xbe322e=typeof _0x35e52c['offset']===_0x803d('0x1d')&&typeof _0x35e52c['limit']===_0x803d('0x1d');var _0x1d3e6a=_0x281475[_0x803d('0x1e')];var _0x42ab78=_0xbe322e?0x0:_0x35e52c[_0x803d('0x1f')];var _0x452a65=_0xbe322e?_0x281475[_0x803d('0x1e')]:_0x35e52c[_0x803d('0x1f')]+_0x35e52c[_0x803d('0x20')];var _0x228c22;if(_0x452a65>=_0x1d3e6a){_0x452a65=_0x1d3e6a;_0x228c22=0xc8;}else{_0x228c22=0xce;}_0x4dff90[_0x803d('0x1a')](_0x228c22);return _0x4dff90[_0x803d('0x21')](_0x803d('0x22'),_0x42ab78+'-'+_0x452a65+'/'+_0x1d3e6a)[_0x803d('0x1c')](_0x281475);}return null;};}function patchUpdates(_0x174a0e){return function(_0x23fff1){try{jsonpatch[_0x803d('0x23')](_0x23fff1,_0x174a0e,!![]);}catch(_0x2b1993){return BPromise[_0x803d('0x24')](_0x2b1993);}return _0x23fff1[_0x803d('0x25')]();};}function saveUpdates(_0xf4b811,_0x494baa){return function(_0x2e0b22){if(_0x2e0b22){return _0x2e0b22[_0x803d('0x26')](_0xf4b811)[_0x803d('0x27')](function(_0x3cb1b0){return _0x3cb1b0;});}return null;};}function removeEntity(_0xfb4fdf,_0x2def65){return function(_0x43c322){if(_0x43c322){return _0x43c322['destroy']()[_0x803d('0x27')](function(){_0xfb4fdf[_0x803d('0x1a')](0xcc)[_0x803d('0x1b')]();});}};}function handleEntityNotFound(_0x471e7f,_0x1c6f21){return function(_0x368df2){if(!_0x368df2){_0x471e7f['sendStatus'](0x194);}return _0x368df2;};}function handleError(_0x25d06b,_0x4fe2fa){_0x4fe2fa=_0x4fe2fa||0x1f4;return function(_0x32dfba){logger[_0x803d('0x28')](_0x32dfba['stack']);if(_0x32dfba[_0x803d('0x29')]){delete _0x32dfba['name'];}_0x25d06b[_0x803d('0x1a')](_0x4fe2fa)[_0x803d('0x2a')](_0x32dfba);};}exports[_0x803d('0x2b')]=function(_0xca205b,_0x264fa2){var _0xcbadde={},_0x341bbe={},_0x375043={'count':0x0,'rows':[]};var _0x18775b=_[_0x803d('0x2c')](db[_0x803d('0x2d')][_0x803d('0x2e')],function(_0x176a4b){return{'name':_0x176a4b['fieldName'],'type':_0x176a4b[_0x803d('0x2f')][_0x803d('0x30')]};});_0x341bbe[_0x803d('0x31')]=_[_0x803d('0x2c')](_0x18775b,'name');_0x341bbe[_0x803d('0x32')]=_['keys'](_0xca205b[_0x803d('0x32')]);_0x341bbe[_0x803d('0x33')]=_[_0x803d('0x34')](_0x341bbe[_0x803d('0x31')],_0x341bbe[_0x803d('0x32')]);_0xcbadde[_0x803d('0x35')]=_['intersection'](_0x341bbe[_0x803d('0x31')],qs[_0x803d('0x36')](_0xca205b['query'][_0x803d('0x36')]));_0xcbadde[_0x803d('0x35')]=_0xcbadde[_0x803d('0x35')][_0x803d('0x37')]?_0xcbadde['attributes']:_0x341bbe['model'];if(!_0xca205b[_0x803d('0x32')][_0x803d('0x38')](_0x803d('0x39'))){_0xcbadde[_0x803d('0x20')]=qs[_0x803d('0x20')](_0xca205b[_0x803d('0x32')][_0x803d('0x20')]);_0xcbadde[_0x803d('0x1f')]=qs[_0x803d('0x1f')](_0xca205b[_0x803d('0x32')][_0x803d('0x1f')]);}_0xcbadde[_0x803d('0x3a')]=qs[_0x803d('0x3b')](_0xca205b['query'][_0x803d('0x3b')]);_0xcbadde['where']=qs[_0x803d('0x33')](_[_0x803d('0x3c')](_0xca205b[_0x803d('0x32')],_0x341bbe[_0x803d('0x33')]),_0x18775b);if(_0xca205b[_0x803d('0x32')][_0x803d('0x3d')]){_0xcbadde[_0x803d('0x3e')]=_[_0x803d('0x3f')](_0xcbadde[_0x803d('0x3e')],{'$or':_['map'](_0x18775b,function(_0x3477b6){if(_0x3477b6['type']!==_0x803d('0x40')){var _0x2fcf19={};_0x2fcf19[_0x3477b6[_0x803d('0x29')]]={'$like':'%'+_0xca205b['query']['filter']+'%'};return _0x2fcf19;}})});}_0xcbadde=_['merge']({},_0xcbadde,_0xca205b['options']);var _0x45c79b={'where':_0xcbadde[_0x803d('0x3e')]};return db[_0x803d('0x2d')]['count'](_0x45c79b)[_0x803d('0x27')](function(_0x235730){_0x375043[_0x803d('0x1e')]=_0x235730;if(_0xca205b[_0x803d('0x32')][_0x803d('0x41')]){_0xcbadde[_0x803d('0x42')]=[{'all':!![]}];}return db[_0x803d('0x2d')]['findAll'](_0xcbadde);})[_0x803d('0x27')](function(_0x33f655){_0x375043[_0x803d('0x43')]=_0x33f655;return _0x375043;})[_0x803d('0x27')](respondWithFilteredResult(_0x264fa2,_0xcbadde))['catch'](handleError(_0x264fa2,null));};exports[_0x803d('0x44')]=function(_0x14175d,_0x5b0a55){var _0x29564e={'raw':![],'where':{'id':_0x14175d[_0x803d('0x45')]['id']}},_0xc2f4f4={};_0xc2f4f4[_0x803d('0x31')]=_[_0x803d('0x46')](db[_0x803d('0x2d')][_0x803d('0x2e')]);_0xc2f4f4[_0x803d('0x32')]=_[_0x803d('0x46')](_0x14175d['query']);_0xc2f4f4['filters']=_[_0x803d('0x34')](_0xc2f4f4['model'],_0xc2f4f4[_0x803d('0x32')]);_0x29564e[_0x803d('0x35')]=_[_0x803d('0x34')](_0xc2f4f4[_0x803d('0x31')],qs[_0x803d('0x36')](_0x14175d[_0x803d('0x32')][_0x803d('0x36')]));_0x29564e[_0x803d('0x35')]=_0x29564e[_0x803d('0x35')]['length']?_0x29564e[_0x803d('0x35')]:_0xc2f4f4[_0x803d('0x31')];if(_0x14175d[_0x803d('0x32')]['includeAll']){_0x29564e[_0x803d('0x42')]=[{'all':!![]}];}_0x29564e=_['merge']({},_0x29564e,_0x14175d[_0x803d('0x47')]);return db[_0x803d('0x2d')][_0x803d('0x48')](_0x29564e)[_0x803d('0x27')](handleEntityNotFound(_0x5b0a55,null))['then'](respondWithResult(_0x5b0a55,null))[_0x803d('0x49')](handleError(_0x5b0a55,null));};exports[_0x803d('0x4a')]=function(_0x2e295c,_0x28ba0a){return db[_0x803d('0x2d')]['create'](_0x2e295c[_0x803d('0x4b')],{})[_0x803d('0x27')](respondWithResult(_0x28ba0a,0xc9))[_0x803d('0x49')](handleError(_0x28ba0a,null));};exports[_0x803d('0x4c')]=function(_0x13fb82,_0xb976e7){return db[_0x803d('0x2d')]['bulkCreate'](_0x13fb82[_0x803d('0x4b')],{'raw':![],'individualHooks':!![]})[_0x803d('0x27')](respondWithResult(_0xb976e7,0xc9))[_0x803d('0x49')](handleError(_0xb976e7,null));};exports['update']=function(_0x5b92f9,_0x55d609){if(_0x5b92f9[_0x803d('0x4b')]['id']){delete _0x5b92f9['body']['id'];}return db[_0x803d('0x2d')][_0x803d('0x48')]({'where':{'id':_0x5b92f9['params']['id']}})[_0x803d('0x27')](handleEntityNotFound(_0x55d609,null))[_0x803d('0x27')](saveUpdates(_0x5b92f9[_0x803d('0x4b')],null))[_0x803d('0x27')](respondWithResult(_0x55d609,null))[_0x803d('0x49')](handleError(_0x55d609,null));};exports[_0x803d('0x4d')]=function(_0x4fa295,_0x45d38a){return db['AnalyticFieldReport'][_0x803d('0x48')]({'where':{'id':_0x4fa295[_0x803d('0x45')]['id']}})[_0x803d('0x27')](handleEntityNotFound(_0x45d38a,null))[_0x803d('0x27')](removeEntity(_0x45d38a,null))[_0x803d('0x49')](handleError(_0x45d38a,null));};exports[_0x803d('0x4e')]=function(_0x403b86,_0x1ea016){return db[_0x803d('0x2d')][_0x803d('0x4d')]({'where':{'id':_0x403b86[_0x803d('0x32')][_0x803d('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x803d('0x27')](respondWithResult(_0x1ea016,0xcc))['catch'](handleError(_0x1ea016,null));};exports[_0x803d('0x50')]=function(_0x296f25,_0x5c0e73,_0x420ed8){return db[_0x803d('0x51')][_0x803d('0x52')]({'where':{'id':_0x296f25['params']['id']}})[_0x803d('0x27')](handleEntityNotFound(_0x5c0e73,null))[_0x803d('0x27')](function(_0x29f547){if(_0x29f547){return db[_0x803d('0x53')]['transaction'](function(_0x458876){return db[_0x803d('0x2d')][_0x803d('0x4d')]({'where':{'CustomReportId':_0x296f25['params']['id']},'transaction':_0x458876})[_0x803d('0x27')](function(_0x54ce58){var _0x161ea0=_[_0x803d('0x2c')](_0x296f25['body'],function(_0x3701f8){delete _0x3701f8['id'];_0x3701f8[_0x803d('0x54')]=_0x296f25[_0x803d('0x45')]['id'];return _0x3701f8;});return db[_0x803d('0x2d')]['bulkCreate'](_0x161ea0,{'transaction':_0x458876});});})[_0x803d('0x27')](function(){return db[_0x803d('0x2d')]['findAll']({'where':{'CustomReportId':_0x296f25[_0x803d('0x45')]['id']}});});}})['then'](respondWithResult(_0x5c0e73,null))[_0x803d('0x49')](handleError(_0x5c0e73,null));}; \ No newline at end of file +var _0xcee5=['update','then','end','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','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/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x3e0e55,_0x1b446c){var _0x669d7e=function(_0x3ef41b){while(--_0x3ef41b){_0x3e0e55['push'](_0x3e0e55['shift']());}};_0x669d7e(++_0x1b446c);}(_0xcee5,0xcf));var _0x5cee=function(_0x2f9f53,_0x5b7f6d){_0x2f9f53=_0x2f9f53-0x0;var _0x503da8=_0xcee5[_0x2f9f53];return _0x503da8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cee('0x0'));var zipdir=require(_0x5cee('0x1'));var jsonpatch=require(_0x5cee('0x2'));var rp=require(_0x5cee('0x3'));var moment=require('moment');var BPromise=require(_0x5cee('0x4'));var Mustache=require('mustache');var util=require(_0x5cee('0x5'));var path=require('path');var sox=require(_0x5cee('0x6'));var csv=require(_0x5cee('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cee('0x8'));var squel=require(_0x5cee('0x9'));var crypto=require(_0x5cee('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5cee('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5cee('0xc'));var Papa=require(_0x5cee('0xd'));var Redis=require(_0x5cee('0xe'));var authService=require(_0x5cee('0xf'));var qs=require(_0x5cee('0x10'));var as=require(_0x5cee('0x11'));var hardwareService=require(_0x5cee('0x12'));var logger=require(_0x5cee('0x13'))(_0x5cee('0x14'));var utils=require('../../config/utils');var config=require(_0x5cee('0x15'));var licenseUtil=require(_0x5cee('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22e0f9,_0x21aec2){_0x21aec2=_0x21aec2||0xcc;return function(_0x75bf17){if(_0x75bf17){return _0x22e0f9[_0x5cee('0x17')](_0x21aec2);}return _0x22e0f9[_0x5cee('0x18')](_0x21aec2)['end']();};}function respondWithResult(_0x37375e,_0x53d6e2){_0x53d6e2=_0x53d6e2||0xc8;return function(_0x933452){if(_0x933452){return _0x37375e[_0x5cee('0x18')](_0x53d6e2)[_0x5cee('0x19')](_0x933452);}};}function respondWithFilteredResult(_0x3b86f4,_0x326f49){return function(_0x306d74){if(_0x306d74){var _0x41242a=typeof _0x326f49[_0x5cee('0x1a')]===_0x5cee('0x1b')&&typeof _0x326f49[_0x5cee('0x1c')]===_0x5cee('0x1b');var _0x23cfe6=_0x306d74[_0x5cee('0x1d')];var _0x799568=_0x41242a?0x0:_0x326f49[_0x5cee('0x1a')];var _0x1c4f0c=_0x41242a?_0x306d74['count']:_0x326f49[_0x5cee('0x1a')]+_0x326f49[_0x5cee('0x1c')];var _0x1900ed;if(_0x1c4f0c>=_0x23cfe6){_0x1c4f0c=_0x23cfe6;_0x1900ed=0xc8;}else{_0x1900ed=0xce;}_0x3b86f4[_0x5cee('0x18')](_0x1900ed);return _0x3b86f4[_0x5cee('0x1e')](_0x5cee('0x1f'),_0x799568+'-'+_0x1c4f0c+'/'+_0x23cfe6)['json'](_0x306d74);}return null;};}function patchUpdates(_0x438de7){return function(_0x8047b8){try{jsonpatch['apply'](_0x8047b8,_0x438de7,!![]);}catch(_0xfac1df){return BPromise['reject'](_0xfac1df);}return _0x8047b8[_0x5cee('0x20')]();};}function saveUpdates(_0xa52b5f,_0x38ffca){return function(_0x4abb69){if(_0x4abb69){return _0x4abb69[_0x5cee('0x21')](_0xa52b5f)[_0x5cee('0x22')](function(_0x2b88f8){return _0x2b88f8;});}return null;};}function removeEntity(_0x2a3beb,_0x231e37){return function(_0x14df3e){if(_0x14df3e){return _0x14df3e['destroy']()[_0x5cee('0x22')](function(){_0x2a3beb[_0x5cee('0x18')](0xcc)[_0x5cee('0x23')]();});}};}function handleEntityNotFound(_0x2f8933,_0x263cb6){return function(_0x21f4c8){if(!_0x21f4c8){_0x2f8933[_0x5cee('0x17')](0x194);}return _0x21f4c8;};}function handleError(_0x417dac,_0x47e60e){_0x47e60e=_0x47e60e||0x1f4;return function(_0x1dedab){logger[_0x5cee('0x24')](_0x1dedab['stack']);if(_0x1dedab[_0x5cee('0x25')]){delete _0x1dedab[_0x5cee('0x25')];}_0x417dac[_0x5cee('0x18')](_0x47e60e)[_0x5cee('0x26')](_0x1dedab);};}exports[_0x5cee('0x27')]=function(_0x5edd57,_0x1eec2d){var _0x58a66f={},_0x49c32a={},_0xec6008={'count':0x0,'rows':[]};var _0x1ca015=_[_0x5cee('0x28')](db[_0x5cee('0x29')][_0x5cee('0x2a')],function(_0x3101e6){return{'name':_0x3101e6[_0x5cee('0x2b')],'type':_0x3101e6['type'][_0x5cee('0x2c')]};});_0x49c32a[_0x5cee('0x2d')]=_['map'](_0x1ca015,_0x5cee('0x25'));_0x49c32a[_0x5cee('0x2e')]=_[_0x5cee('0x2f')](_0x5edd57['query']);_0x49c32a['filters']=_[_0x5cee('0x30')](_0x49c32a['model'],_0x49c32a['query']);_0x58a66f[_0x5cee('0x31')]=_[_0x5cee('0x30')](_0x49c32a[_0x5cee('0x2d')],qs[_0x5cee('0x32')](_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x32')]));_0x58a66f['attributes']=_0x58a66f[_0x5cee('0x31')]['length']?_0x58a66f[_0x5cee('0x31')]:_0x49c32a[_0x5cee('0x2d')];if(!_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x33')](_0x5cee('0x34'))){_0x58a66f[_0x5cee('0x1c')]=qs[_0x5cee('0x1c')](_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x1c')]);_0x58a66f['offset']=qs['offset'](_0x5edd57['query'][_0x5cee('0x1a')]);}_0x58a66f[_0x5cee('0x35')]=qs['sort'](_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x36')]);_0x58a66f[_0x5cee('0x37')]=qs[_0x5cee('0x38')](_[_0x5cee('0x39')](_0x5edd57[_0x5cee('0x2e')],_0x49c32a[_0x5cee('0x38')]),_0x1ca015);if(_0x5edd57[_0x5cee('0x2e')]['filter']){_0x58a66f[_0x5cee('0x37')]=_[_0x5cee('0x3a')](_0x58a66f[_0x5cee('0x37')],{'$or':_[_0x5cee('0x28')](_0x1ca015,function(_0x16bc5f){if(_0x16bc5f[_0x5cee('0x3b')]!==_0x5cee('0x3c')){var _0x4ff3c9={};_0x4ff3c9[_0x16bc5f[_0x5cee('0x25')]]={'$like':'%'+_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x3d')]+'%'};return _0x4ff3c9;}})});}_0x58a66f=_[_0x5cee('0x3a')]({},_0x58a66f,_0x5edd57['options']);var _0x322f1f={'where':_0x58a66f[_0x5cee('0x37')]};return db[_0x5cee('0x29')][_0x5cee('0x1d')](_0x322f1f)[_0x5cee('0x22')](function(_0x15d1d3){_0xec6008[_0x5cee('0x1d')]=_0x15d1d3;if(_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x3e')]){_0x58a66f[_0x5cee('0x3f')]=[{'all':!![]}];}return db[_0x5cee('0x29')][_0x5cee('0x40')](_0x58a66f);})[_0x5cee('0x22')](function(_0x536618){_0xec6008['rows']=_0x536618;return _0xec6008;})[_0x5cee('0x22')](respondWithFilteredResult(_0x1eec2d,_0x58a66f))[_0x5cee('0x41')](handleError(_0x1eec2d,null));};exports[_0x5cee('0x42')]=function(_0x3fbd10,_0x8b1586){var _0x14701c={'raw':![],'where':{'id':_0x3fbd10[_0x5cee('0x43')]['id']}},_0xeff086={};_0xeff086[_0x5cee('0x2d')]=_[_0x5cee('0x2f')](db[_0x5cee('0x29')][_0x5cee('0x2a')]);_0xeff086[_0x5cee('0x2e')]=_[_0x5cee('0x2f')](_0x3fbd10['query']);_0xeff086[_0x5cee('0x38')]=_[_0x5cee('0x30')](_0xeff086[_0x5cee('0x2d')],_0xeff086[_0x5cee('0x2e')]);_0x14701c[_0x5cee('0x31')]=_['intersection'](_0xeff086[_0x5cee('0x2d')],qs[_0x5cee('0x32')](_0x3fbd10[_0x5cee('0x2e')][_0x5cee('0x32')]));_0x14701c[_0x5cee('0x31')]=_0x14701c['attributes']['length']?_0x14701c[_0x5cee('0x31')]:_0xeff086[_0x5cee('0x2d')];if(_0x3fbd10[_0x5cee('0x2e')][_0x5cee('0x3e')]){_0x14701c[_0x5cee('0x3f')]=[{'all':!![]}];}_0x14701c=_[_0x5cee('0x3a')]({},_0x14701c,_0x3fbd10[_0x5cee('0x44')]);return db[_0x5cee('0x29')][_0x5cee('0x45')](_0x14701c)[_0x5cee('0x22')](handleEntityNotFound(_0x8b1586,null))[_0x5cee('0x22')](respondWithResult(_0x8b1586,null))['catch'](handleError(_0x8b1586,null));};exports['create']=function(_0x115461,_0x3d55ed){return db[_0x5cee('0x29')]['create'](_0x115461[_0x5cee('0x46')],{})[_0x5cee('0x22')](respondWithResult(_0x3d55ed,0xc9))[_0x5cee('0x41')](handleError(_0x3d55ed,null));};exports[_0x5cee('0x47')]=function(_0xd564b2,_0x52158f){return db[_0x5cee('0x29')]['bulkCreate'](_0xd564b2[_0x5cee('0x46')],{'raw':![],'individualHooks':!![]})[_0x5cee('0x22')](respondWithResult(_0x52158f,0xc9))['catch'](handleError(_0x52158f,null));};exports[_0x5cee('0x21')]=function(_0x3fd9cb,_0x18408b){if(_0x3fd9cb['body']['id']){delete _0x3fd9cb['body']['id'];}return db[_0x5cee('0x29')][_0x5cee('0x45')]({'where':{'id':_0x3fd9cb[_0x5cee('0x43')]['id']}})[_0x5cee('0x22')](handleEntityNotFound(_0x18408b,null))[_0x5cee('0x22')](saveUpdates(_0x3fd9cb['body'],null))[_0x5cee('0x22')](respondWithResult(_0x18408b,null))[_0x5cee('0x41')](handleError(_0x18408b,null));};exports[_0x5cee('0x48')]=function(_0x104fdc,_0x436ff9){return db[_0x5cee('0x29')][_0x5cee('0x45')]({'where':{'id':_0x104fdc[_0x5cee('0x43')]['id']}})[_0x5cee('0x22')](handleEntityNotFound(_0x436ff9,null))[_0x5cee('0x22')](removeEntity(_0x436ff9,null))[_0x5cee('0x41')](handleError(_0x436ff9,null));};exports[_0x5cee('0x49')]=function(_0x1560ab,_0x82dbbe){return db[_0x5cee('0x29')]['destroy']({'where':{'id':_0x1560ab[_0x5cee('0x2e')][_0x5cee('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x5cee('0x22')](respondWithResult(_0x82dbbe,0xcc))[_0x5cee('0x41')](handleError(_0x82dbbe,null));};exports[_0x5cee('0x4b')]=function(_0x56a798,_0x500bda,_0x48b484){return db[_0x5cee('0x4c')][_0x5cee('0x4d')]({'where':{'id':_0x56a798[_0x5cee('0x43')]['id']}})[_0x5cee('0x22')](handleEntityNotFound(_0x500bda,null))['then'](function(_0x415f35){if(_0x415f35){return db['sequelize'][_0x5cee('0x4e')](function(_0x4529fc){return db[_0x5cee('0x29')][_0x5cee('0x48')]({'where':{'CustomReportId':_0x56a798[_0x5cee('0x43')]['id']},'transaction':_0x4529fc})[_0x5cee('0x22')](function(_0x2386a5){var _0x4c0c86=_[_0x5cee('0x28')](_0x56a798[_0x5cee('0x46')],function(_0xdd11de){delete _0xdd11de['id'];_0xdd11de[_0x5cee('0x4f')]=_0x56a798['params']['id'];return _0xdd11de;});return db[_0x5cee('0x29')]['bulkCreate'](_0x4c0c86,{'transaction':_0x4529fc});});})[_0x5cee('0x22')](function(){return db[_0x5cee('0x29')][_0x5cee('0x40')]({'where':{'CustomReportId':_0x56a798[_0x5cee('0x43')]['id']}});});}})[_0x5cee('0x22')](respondWithResult(_0x500bda,null))[_0x5cee('0x41')](handleError(_0x500bda,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9c781df..ed57519 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 _0x10e1=['lodash','../../config/logger','api','moment','bluebird','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport'];(function(_0x117926,_0x268445){var _0xc34604=function(_0x67f9c5){while(--_0x67f9c5){_0x117926['push'](_0x117926['shift']());}};_0xc34604(++_0x268445);}(_0x10e1,0x99));var _0x110e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x10e1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x110e('0x0'));var util=require('util');var logger=require(_0x110e('0x1'))(_0x110e('0x2'));var moment=require(_0x110e('0x3'));var BPromise=require(_0x110e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x110e('0x5'));var config=require('../../config/environment');var attributes=require(_0x110e('0x6'));module[_0x110e('0x7')]=function(_0xff28cd,_0x3460b3){return _0xff28cd['define'](_0x110e('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7212=['util','../../config/logger','moment','path','rimraf','exports','define','lodash'];(function(_0x4058c7,_0x3c6726){var _0x4cfb88=function(_0xb50c3c){while(--_0xb50c3c){_0x4058c7['push'](_0x4058c7['shift']());}};_0x4cfb88(++_0x3c6726);}(_0x7212,0x87));var _0x2721=function(_0x4a2416,_0x2dbf30){_0x4a2416=_0x4a2416-0x0;var _0x3d4820=_0x7212[_0x4a2416];return _0x3d4820;};'use strict';var _=require(_0x2721('0x0'));var util=require(_0x2721('0x1'));var logger=require(_0x2721('0x2'))('api');var moment=require(_0x2721('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2721('0x4'));var rimraf=require(_0x2721('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x2721('0x6')]=function(_0x58155e,_0x38a96c){return _0x58155e[_0x2721('0x7')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index df927a5..e67e6e7 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 _0x5b45=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','lodash','util'];(function(_0x40eac1,_0x29f24e){var _0x55321f=function(_0x29208b){while(--_0x29208b){_0x40eac1['push'](_0x40eac1['shift']());}};_0x55321f(++_0x29f24e);}(_0x5b45,0x132));var _0x55b4=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x5b45[_0x3b711c];return _0x2685f0;};'use strict';var _=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var moment=require(_0x55b4('0x2'));var BPromise=require('bluebird');var rs=require(_0x55b4('0x3'));var fs=require('fs');var Redis=require(_0x55b4('0x4'));var db=require(_0x55b4('0x5'))['db'];var utils=require(_0x55b4('0x6'));var logger=require(_0x55b4('0x7'))(_0x55b4('0x8'));var config=require(_0x55b4('0x9'));var jayson=require(_0x55b4('0xa'));var client=jayson[_0x55b4('0xb')][_0x55b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x320369,_0x1a2b8e,_0x3c85a9){return new BPromise(function(_0x5abb05,_0x5c114a){return client['request'](_0x320369,_0x3c85a9)[_0x55b4('0xd')](function(_0x4b1102){logger[_0x55b4('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a2b8e,_0x55b4('0xf'));logger['debug'](_0x55b4('0x10'),_0x1a2b8e,'request\x20sent',JSON[_0x55b4('0x11')](_0x4b1102));if(_0x4b1102[_0x55b4('0x12')]){if(_0x4b1102[_0x55b4('0x12')][_0x55b4('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a2b8e,_0x4b1102['error'][_0x55b4('0x14')]);return _0x5c114a(_0x4b1102[_0x55b4('0x12')][_0x55b4('0x14')]);}logger[_0x55b4('0x12')](_0x55b4('0x15'),_0x1a2b8e,_0x4b1102[_0x55b4('0x12')][_0x55b4('0x14')]);return _0x5abb05(_0x4b1102[_0x55b4('0x12')][_0x55b4('0x14')]);}else{logger[_0x55b4('0xe')](_0x55b4('0x15'),_0x1a2b8e,_0x55b4('0xf'));_0x5abb05(_0x4b1102['result'][_0x55b4('0x14')]);}})['catch'](function(_0x6d04d7){logger[_0x55b4('0x12')](_0x55b4('0x15'),_0x1a2b8e,_0x6d04d7);_0x5c114a(_0x6d04d7);});});} \ No newline at end of file +var _0xff6d=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result'];(function(_0x3e2480,_0x2eed70){var _0x652c0=function(_0xaae5d2){while(--_0xaae5d2){_0x3e2480['push'](_0x3e2480['shift']());}};_0x652c0(++_0x2eed70);}(_0xff6d,0xd3));var _0xdff6=function(_0xb74d09,_0x488e48){_0xb74d09=_0xb74d09-0x0;var _0x1d0344=_0xff6d[_0xb74d09];return _0x1d0344;};'use strict';var _=require(_0xdff6('0x0'));var util=require('util');var moment=require(_0xdff6('0x1'));var BPromise=require(_0xdff6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdff6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdff6('0x4'));var logger=require(_0xdff6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdff6('0x6'));var client=jayson[_0xdff6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31a719,_0x429d71,_0x573346){return new BPromise(function(_0x3444c9,_0x4ed46c){return client[_0xdff6('0x8')](_0x31a719,_0x573346)[_0xdff6('0x9')](function(_0x4fd4a3){logger[_0xdff6('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x429d71,'request\x20sent');logger[_0xdff6('0xb')](_0xdff6('0xc'),_0x429d71,_0xdff6('0xd'),JSON[_0xdff6('0xe')](_0x4fd4a3));if(_0x4fd4a3[_0xdff6('0xf')]){if(_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x10')]===0x1f4){logger['error'](_0xdff6('0x11'),_0x429d71,_0x4fd4a3['error'][_0xdff6('0x12')]);return _0x4ed46c(_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x12')]);}logger[_0xdff6('0xf')](_0xdff6('0x11'),_0x429d71,_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x12')]);return _0x3444c9(_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x12')]);}else{logger[_0xdff6('0xa')](_0xdff6('0x11'),_0x429d71,_0xdff6('0xd'));_0x3444c9(_0x4fd4a3[_0xdff6('0x13')]['message']);}})[_0xdff6('0x14')](function(_0x37ef01){logger[_0xdff6('0xf')](_0xdff6('0x11'),_0x429d71,_0x37ef01);_0x4ed46c(_0x37ef01);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 2660f66..33b10e6 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(_0x196f02,_0x5265c0){var _0x153425=function(_0x8851a8){while(--_0x8851a8){_0x196f02['push'](_0x196f02['shift']());}};_0x153425(++_0x5265c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x4b6925,_0x23c3e0){var _0x32fa12=function(_0x675a7b){while(--_0x675a7b){_0x4b6925['push'](_0x4b6925['shift']());}};_0x32fa12(++_0x23c3e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 519dada..c55ccb2 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 _0x7e05=['sequelize','exports','name','TEXT','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7e05,0x69));var _0x57e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7e05[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x57e0('0x0'));module[_0x57e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x57e0('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x57e0('0x3')]},'description':{'type':Sequelize[_0x57e0('0x4')]}}; \ No newline at end of file +var _0x720c=['sequelize','STRING','name','TEXT'];(function(_0x5c4b34,_0x366e7d){var _0x1b4655=function(_0x48a2c1){while(--_0x48a2c1){_0x5c4b34['push'](_0x5c4b34['shift']());}};_0x1b4655(++_0x366e7d);}(_0x720c,0x154));var _0xc720=function(_0x4e7413,_0x5dffb1){_0x4e7413=_0x4e7413-0x0;var _0x11b6de=_0x720c[_0x4e7413];return _0x11b6de;};'use strict';var Sequelize=require(_0xc720('0x0'));module['exports']={'name':{'type':Sequelize[_0xc720('0x1')],'allowNull':![],'unique':_0xc720('0x2')},'table':{'type':Sequelize[_0xc720('0x1')]},'metric':{'type':Sequelize[_0xc720('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 2fb83f3..7b0428f 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x451ebe,_0x44c9fb){var _0x34de78=function(_0x25bbf2){while(--_0x25bbf2){_0x451ebe['push'](_0x451ebe['shift']());}};_0x34de78(++_0x44c9fb);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x5fc3[_0x1e1965];return _0x1a2e96;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x23cdc6,_0x4c79d2){var _0x4c8de0=function(_0x3f787f){while(--_0x3f787f){_0x23cdc6['push'](_0x23cdc6['shift']());}};_0x4c8de0(++_0x4c79d2);}(_0x9a19,0x114));var _0x99a1=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x9a19[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 547e3ef..4b91fa2 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 _0x5d95=['util','api','moment','bluebird','request-promise','path','../../config/environment','lodash'];(function(_0x5d37e0,_0x4b785e){var _0x50a47a=function(_0x462fab){while(--_0x462fab){_0x5d37e0['push'](_0x5d37e0['shift']());}};_0x50a47a(++_0x4b785e);}(_0x5d95,0x77));var _0x55d9=function(_0x3d0603,_0x2272c5){_0x3d0603=_0x3d0603-0x0;var _0x3338c0=_0x5d95[_0x3d0603];return _0x3338c0;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var logger=require('../../config/logger')(_0x55d9('0x2'));var moment=require(_0x55d9('0x3'));var BPromise=require(_0x55d9('0x4'));var rp=require(_0x55d9('0x5'));var fs=require('fs');var path=require(_0x55d9('0x6'));var rimraf=require('rimraf');var config=require(_0x55d9('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x25957e,_0x4244b4){return _0x25957e['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x872a=['exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x872a,0x100));var _0xa872=function(_0x1ffa5b,_0x498e6b){_0x1ffa5b=_0x1ffa5b-0x0;var _0x599db1=_0x872a[_0x1ffa5b];return _0x599db1;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa872('0x4'));var rimraf=require(_0xa872('0x5'));var config=require(_0xa872('0x6'));var attributes=require(_0xa872('0x7'));module[_0xa872('0x8')]=function(_0x1c8d2f,_0x3e3cd4){return _0x1c8d2f['define'](_0xa872('0x9'),attributes,{'tableName':_0xa872('0xa'),'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 512ce8d..3598af9 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 _0x5271=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch'];(function(_0x37e225,_0x1d19eb){var _0x478cf8=function(_0x5c83c6){while(--_0x5c83c6){_0x37e225['push'](_0x37e225['shift']());}};_0x478cf8(++_0x1d19eb);}(_0x5271,0x159));var _0x1527=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x5271[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x1527('0x0'));var util=require(_0x1527('0x1'));var moment=require(_0x1527('0x2'));var BPromise=require(_0x1527('0x3'));var rs=require(_0x1527('0x4'));var fs=require('fs');var Redis=require(_0x1527('0x5'));var db=require(_0x1527('0x6'))['db'];var utils=require(_0x1527('0x7'));var logger=require(_0x1527('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1527('0x9'));var client=jayson[_0x1527('0xa')][_0x1527('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267606,_0x2d826b,_0x81b314){return new BPromise(function(_0xc76fa7,_0x401dbf){return client[_0x1527('0xc')](_0x267606,_0x81b314)[_0x1527('0xd')](function(_0x1fe86c){logger[_0x1527('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x2d826b,_0x1527('0xf'));logger[_0x1527('0x10')](_0x1527('0x11'),_0x2d826b,_0x1527('0xf'),JSON['stringify'](_0x1fe86c));if(_0x1fe86c['error']){if(_0x1fe86c['error']['code']===0x1f4){logger[_0x1527('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x2d826b,_0x1fe86c[_0x1527('0x12')]['message']);return _0x401dbf(_0x1fe86c[_0x1527('0x12')][_0x1527('0x13')]);}logger[_0x1527('0x12')](_0x1527('0x14'),_0x2d826b,_0x1fe86c['error'][_0x1527('0x13')]);return _0xc76fa7(_0x1fe86c[_0x1527('0x12')][_0x1527('0x13')]);}else{logger[_0x1527('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x2d826b,'request\x20sent');_0xc76fa7(_0x1fe86c[_0x1527('0x15')][_0x1527('0x13')]);}})[_0x1527('0x16')](function(_0x4a9baa){logger[_0x1527('0x12')](_0x1527('0x14'),_0x2d826b,_0x4a9baa);_0x401dbf(_0x4a9baa);});});} \ No newline at end of file +var _0x0c5e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1085db,_0x41e087){var _0x392a60=function(_0xc7f75d){while(--_0xc7f75d){_0x1085db['push'](_0x1085db['shift']());}};_0x392a60(++_0x41e087);}(_0x0c5e,0x1d0));var _0xe0c5=function(_0x543429,_0x140390){_0x543429=_0x543429-0x0;var _0x112a46=_0x0c5e[_0x543429];return _0x112a46;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe0c5('0x0'));var rs=require(_0xe0c5('0x1'));var fs=require('fs');var Redis=require(_0xe0c5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0c5('0x3'));var logger=require(_0xe0c5('0x4'))(_0xe0c5('0x5'));var config=require(_0xe0c5('0x6'));var jayson=require(_0xe0c5('0x7'));var client=jayson[_0xe0c5('0x8')][_0xe0c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fcd01,_0x8bd3c6,_0xd16573){return new BPromise(function(_0x4116cd,_0x3132cd){return client['request'](_0x1fcd01,_0xd16573)['then'](function(_0x2270cb){logger['info'](_0xe0c5('0xa'),_0x8bd3c6,'request\x20sent');logger['debug'](_0xe0c5('0xb'),_0x8bd3c6,'request\x20sent',JSON['stringify'](_0x2270cb));if(_0x2270cb[_0xe0c5('0xc')]){if(_0x2270cb[_0xe0c5('0xc')][_0xe0c5('0xd')]===0x1f4){logger['error'](_0xe0c5('0xa'),_0x8bd3c6,_0x2270cb[_0xe0c5('0xc')][_0xe0c5('0xe')]);return _0x3132cd(_0x2270cb[_0xe0c5('0xc')]['message']);}logger[_0xe0c5('0xc')](_0xe0c5('0xa'),_0x8bd3c6,_0x2270cb[_0xe0c5('0xc')]['message']);return _0x4116cd(_0x2270cb[_0xe0c5('0xc')][_0xe0c5('0xe')]);}else{logger['info'](_0xe0c5('0xa'),_0x8bd3c6,_0xe0c5('0xf'));_0x4116cd(_0x2270cb[_0xe0c5('0x10')]['message']);}})[_0xe0c5('0x11')](function(_0x1d69de){logger[_0xe0c5('0xc')](_0xe0c5('0xa'),_0x8bd3c6,_0x1d69de);_0x3132cd(_0x1d69de);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 40d8ee2..2d6f6bd 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 _0x12e9=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','path','express','Router'];(function(_0x48350f,_0x1a941a){var _0x2df5d4=function(_0xb7ccb1){while(--_0xb7ccb1){_0x48350f['push'](_0x48350f['shift']());}};_0x2df5d4(++_0x1a941a);}(_0x12e9,0x66));var _0x912e=function(_0x5eda74,_0x367e9d){_0x5eda74=_0x5eda74-0x0;var _0xe26e89=_0x12e9[_0x5eda74];return _0xe26e89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x912e('0x0'));var timeout=require('connect-timeout');var express=require(_0x912e('0x1'));var router=express[_0x912e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x912e('0x3'));var interaction=require(_0x912e('0x4'));var config=require('../../config/environment');var controller=require(_0x912e('0x5'));router[_0x912e('0x6')]('/',auth[_0x912e('0x7')](),controller[_0x912e('0x8')]);router['get'](_0x912e('0x9'),auth[_0x912e('0x7')](),controller[_0x912e('0xa')]);router[_0x912e('0xb')]('/',auth[_0x912e('0x7')](),controller['create']);router['put']('/:id',auth[_0x912e('0x7')](),controller[_0x912e('0xc')]);router[_0x912e('0xd')](_0x912e('0x9'),auth[_0x912e('0x7')](),controller['destroy']);module[_0x912e('0xe')]=router; \ No newline at end of file +var _0x6c32=['post','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x181a1a,_0x5584e7){var _0x363a0e=function(_0x38e51f){while(--_0x38e51f){_0x181a1a['push'](_0x181a1a['shift']());}};_0x363a0e(++_0x5584e7);}(_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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a4cb07e..c2b5933 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 _0xd64b=['TEXT','sequelize'];(function(_0x3b6d0a,_0x28a113){var _0x2979cd=function(_0x44c34c){while(--_0x44c34c){_0x3b6d0a['push'](_0x3b6d0a['shift']());}};_0x2979cd(++_0x28a113);}(_0xd64b,0xc1));var _0xbd64=function(_0x342515,_0x6db444){_0x342515=_0x342515-0x0;var _0x5bdef4=_0xd64b[_0x342515];return _0x5bdef4;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'tree':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe0dc=['sequelize','exports','TEXT'];(function(_0x15f54f,_0x114b4b){var _0xbb990c=function(_0x1ef0b0){while(--_0x1ef0b0){_0x15f54f['push'](_0x15f54f['shift']());}};_0xbb990c(++_0x114b4b);}(_0xe0dc,0x1e9));var _0xce0d=function(_0x414cbe,_0x16a463){_0x414cbe=_0x414cbe-0x0;var _0x2793fe=_0xe0dc[_0x414cbe];return _0x2793fe;};'use strict';var Sequelize=require(_0xce0d('0x0'));module[_0xce0d('0x1')]={'tree':{'type':Sequelize[_0xce0d('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 37aebe4..c63807b 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 _0xc009=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xc009,0x88));var _0x9c00=function(_0x4e3189,_0x2a3f2b){_0x4e3189=_0x4e3189-0x0;var _0x256aac=_0xc009[_0x4e3189];return _0x256aac;};'use strict';var emlformat=require(_0x9c00('0x0'));var rimraf=require(_0x9c00('0x1'));var zipdir=require(_0x9c00('0x2'));var jsonpatch=require(_0x9c00('0x3'));var rp=require(_0x9c00('0x4'));var moment=require(_0x9c00('0x5'));var BPromise=require(_0x9c00('0x6'));var Mustache=require('mustache');var util=require(_0x9c00('0x7'));var path=require(_0x9c00('0x8'));var sox=require('sox');var csv=require(_0x9c00('0x9'));var ejs=require(_0x9c00('0xa'));var fs=require('fs');var fs_extra=require(_0x9c00('0xb'));var _=require(_0x9c00('0xc'));var squel=require(_0x9c00('0xd'));var crypto=require(_0x9c00('0xe'));var jsforce=require(_0x9c00('0xf'));var deskjs=require(_0x9c00('0x10'));var toCsv=require(_0x9c00('0x9'));var querystring=require(_0x9c00('0x11'));var Papa=require(_0x9c00('0x12'));var Redis=require(_0x9c00('0x13'));var authService=require(_0x9c00('0x14'));var qs=require(_0x9c00('0x15'));var as=require(_0x9c00('0x16'));var hardwareService=require(_0x9c00('0x17'));var logger=require(_0x9c00('0x18'))('api');var utils=require(_0x9c00('0x19'));var config=require(_0x9c00('0x1a'));var licenseUtil=require(_0x9c00('0x1b'));var db=require(_0x9c00('0x1c'))['db'];function respondWithStatusCode(_0x931e2b,_0x3dd695){_0x3dd695=_0x3dd695||0xcc;return function(_0x3b67dc){if(_0x3b67dc){return _0x931e2b['sendStatus'](_0x3dd695);}return _0x931e2b[_0x9c00('0x1d')](_0x3dd695)['end']();};}function respondWithResult(_0xdf30b4,_0x3e5e68){_0x3e5e68=_0x3e5e68||0xc8;return function(_0x25d54a){if(_0x25d54a){return _0xdf30b4[_0x9c00('0x1d')](_0x3e5e68)[_0x9c00('0x1e')](_0x25d54a);}};}function respondWithFilteredResult(_0x4228a2,_0x3407d8){return function(_0x263d2b){if(_0x263d2b){var _0x5327d1=typeof _0x3407d8[_0x9c00('0x1f')]===_0x9c00('0x20')&&typeof _0x3407d8['limit']===_0x9c00('0x20');var _0x3afd74=_0x263d2b[_0x9c00('0x21')];var _0x196067=_0x5327d1?0x0:_0x3407d8[_0x9c00('0x1f')];var _0x4c87a4=_0x5327d1?_0x263d2b[_0x9c00('0x21')]:_0x3407d8[_0x9c00('0x1f')]+_0x3407d8[_0x9c00('0x22')];var _0x26359c;if(_0x4c87a4>=_0x3afd74){_0x4c87a4=_0x3afd74;_0x26359c=0xc8;}else{_0x26359c=0xce;}_0x4228a2['status'](_0x26359c);return _0x4228a2[_0x9c00('0x23')](_0x9c00('0x24'),_0x196067+'-'+_0x4c87a4+'/'+_0x3afd74)[_0x9c00('0x1e')](_0x263d2b);}return null;};}function patchUpdates(_0x304bcb){return function(_0x3f36e8){try{jsonpatch[_0x9c00('0x25')](_0x3f36e8,_0x304bcb,!![]);}catch(_0x5db74c){return BPromise[_0x9c00('0x26')](_0x5db74c);}return _0x3f36e8[_0x9c00('0x27')]();};}function saveUpdates(_0x554c11,_0x2ac59d){return function(_0x543e42){if(_0x543e42){return _0x543e42['update'](_0x554c11)['then'](function(_0x2be5bf){return _0x2be5bf;});}return null;};}function removeEntity(_0x1fdb35,_0xa5c763){return function(_0x495fdb){if(_0x495fdb){return _0x495fdb['destroy']()[_0x9c00('0x28')](function(){_0x1fdb35[_0x9c00('0x1d')](0xcc)[_0x9c00('0x29')]();});}};}function handleEntityNotFound(_0x5924d8,_0x469d35){return function(_0x2d3a53){if(!_0x2d3a53){_0x5924d8[_0x9c00('0x2a')](0x194);}return _0x2d3a53;};}function handleError(_0x1d9694,_0x4436a3){_0x4436a3=_0x4436a3||0x1f4;return function(_0x4ffda5){logger[_0x9c00('0x2b')](_0x4ffda5['stack']);if(_0x4ffda5[_0x9c00('0x2c')]){delete _0x4ffda5[_0x9c00('0x2c')];}_0x1d9694[_0x9c00('0x1d')](_0x4436a3)[_0x9c00('0x2d')](_0x4ffda5);};}exports['index']=function(_0x103ad2,_0x1da4f4){var _0x5f0a49={},_0x4142f6={},_0x70550c={'count':0x0,'rows':[]};var _0x4799bb=_[_0x9c00('0x2e')](db[_0x9c00('0x2f')][_0x9c00('0x30')],function(_0x2fab47){return{'name':_0x2fab47[_0x9c00('0x31')],'type':_0x2fab47['type'][_0x9c00('0x32')]};});_0x4142f6[_0x9c00('0x33')]=_[_0x9c00('0x2e')](_0x4799bb,_0x9c00('0x2c'));_0x4142f6[_0x9c00('0x34')]=_[_0x9c00('0x35')](_0x103ad2[_0x9c00('0x34')]);_0x4142f6['filters']=_[_0x9c00('0x36')](_0x4142f6['model'],_0x4142f6[_0x9c00('0x34')]);_0x5f0a49[_0x9c00('0x37')]=_[_0x9c00('0x36')](_0x4142f6[_0x9c00('0x33')],qs[_0x9c00('0x38')](_0x103ad2[_0x9c00('0x34')][_0x9c00('0x38')]));_0x5f0a49[_0x9c00('0x37')]=_0x5f0a49[_0x9c00('0x37')]['length']?_0x5f0a49[_0x9c00('0x37')]:_0x4142f6[_0x9c00('0x33')];if(!_0x103ad2[_0x9c00('0x34')][_0x9c00('0x39')](_0x9c00('0x3a'))){_0x5f0a49[_0x9c00('0x22')]=qs[_0x9c00('0x22')](_0x103ad2[_0x9c00('0x34')]['limit']);_0x5f0a49[_0x9c00('0x1f')]=qs[_0x9c00('0x1f')](_0x103ad2[_0x9c00('0x34')][_0x9c00('0x1f')]);}_0x5f0a49['order']=qs[_0x9c00('0x3b')](_0x103ad2[_0x9c00('0x34')][_0x9c00('0x3b')]);_0x5f0a49[_0x9c00('0x3c')]=qs['filters'](_[_0x9c00('0x3d')](_0x103ad2[_0x9c00('0x34')],_0x4142f6[_0x9c00('0x3e')]),_0x4799bb);if(_0x103ad2[_0x9c00('0x34')][_0x9c00('0x3f')]){_0x5f0a49[_0x9c00('0x3c')]=_[_0x9c00('0x40')](_0x5f0a49[_0x9c00('0x3c')],{'$or':_['map'](_0x4799bb,function(_0x4d72e1){if(_0x4d72e1[_0x9c00('0x41')]!=='VIRTUAL'){var _0x339b03={};_0x339b03[_0x4d72e1[_0x9c00('0x2c')]]={'$like':'%'+_0x103ad2['query'][_0x9c00('0x3f')]+'%'};return _0x339b03;}})});}_0x5f0a49=_[_0x9c00('0x40')]({},_0x5f0a49,_0x103ad2[_0x9c00('0x42')]);var _0x5a528f={'where':_0x5f0a49['where']};return db[_0x9c00('0x2f')]['count'](_0x5a528f)[_0x9c00('0x28')](function(_0x3ac418){_0x70550c['count']=_0x3ac418;if(_0x103ad2[_0x9c00('0x34')][_0x9c00('0x43')]){_0x5f0a49[_0x9c00('0x44')]=[{'all':!![]}];}return db[_0x9c00('0x2f')][_0x9c00('0x45')](_0x5f0a49);})[_0x9c00('0x28')](function(_0x1bd820){_0x70550c[_0x9c00('0x46')]=_0x1bd820;return _0x70550c;})[_0x9c00('0x28')](respondWithFilteredResult(_0x1da4f4,_0x5f0a49))[_0x9c00('0x47')](handleError(_0x1da4f4,null));};exports['show']=function(_0x40c553,_0x4aeea6){var _0x363024={'raw':!![],'where':{'id':_0x40c553['params']['id']}},_0x3f511e={};_0x3f511e[_0x9c00('0x33')]=_[_0x9c00('0x35')](db[_0x9c00('0x2f')]['rawAttributes']);_0x3f511e[_0x9c00('0x34')]=_[_0x9c00('0x35')](_0x40c553[_0x9c00('0x34')]);_0x3f511e[_0x9c00('0x3e')]=_[_0x9c00('0x36')](_0x3f511e[_0x9c00('0x33')],_0x3f511e[_0x9c00('0x34')]);_0x363024[_0x9c00('0x37')]=_[_0x9c00('0x36')](_0x3f511e[_0x9c00('0x33')],qs[_0x9c00('0x38')](_0x40c553['query'][_0x9c00('0x38')]));_0x363024[_0x9c00('0x37')]=_0x363024['attributes'][_0x9c00('0x48')]?_0x363024[_0x9c00('0x37')]:_0x3f511e['model'];if(_0x40c553[_0x9c00('0x34')]['includeAll']){_0x363024['include']=[{'all':!![]}];}_0x363024=_[_0x9c00('0x40')]({},_0x363024,_0x40c553[_0x9c00('0x42')]);return db['AnalyticTreeReport'][_0x9c00('0x49')](_0x363024)[_0x9c00('0x28')](handleEntityNotFound(_0x4aeea6,null))[_0x9c00('0x28')](respondWithResult(_0x4aeea6,null))[_0x9c00('0x47')](handleError(_0x4aeea6,null));};exports['create']=function(_0x28e8c5,_0x346a10){return db['AnalyticTreeReport'][_0x9c00('0x4a')](_0x28e8c5[_0x9c00('0x4b')],{})['then'](respondWithResult(_0x346a10,0xc9))[_0x9c00('0x47')](handleError(_0x346a10,null));};exports[_0x9c00('0x4c')]=function(_0x2b0054,_0x5fce45){if(_0x2b0054[_0x9c00('0x4b')]['id']){delete _0x2b0054[_0x9c00('0x4b')]['id'];}return db[_0x9c00('0x2f')][_0x9c00('0x49')]({'where':{'id':_0x2b0054[_0x9c00('0x4d')]['id']}})[_0x9c00('0x28')](handleEntityNotFound(_0x5fce45,null))['then'](saveUpdates(_0x2b0054[_0x9c00('0x4b')],null))[_0x9c00('0x28')](respondWithResult(_0x5fce45,null))[_0x9c00('0x47')](handleError(_0x5fce45,null));};exports[_0x9c00('0x4e')]=function(_0x52bd5c,_0x3194bf){return db[_0x9c00('0x2f')][_0x9c00('0x49')]({'where':{'id':_0x52bd5c[_0x9c00('0x4d')]['id']}})[_0x9c00('0x28')](handleEntityNotFound(_0x3194bf,null))[_0x9c00('0x28')](removeEntity(_0x3194bf,null))[_0x9c00('0x47')](handleError(_0x3194bf,null));}; \ No newline at end of file +var _0x66d8=['../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','show','params','intersection','length','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x478739,_0x3bf556){var _0xe4260e=function(_0xef5c3f){while(--_0xef5c3f){_0x478739['push'](_0x478739['shift']());}};_0xe4260e(++_0x3bf556);}(_0x66d8,0x10b));var _0x866d=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x66d8[_0x2aaa60];return _0x2e3fa5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x866d('0x0'));var zipdir=require(_0x866d('0x1'));var jsonpatch=require(_0x866d('0x2'));var rp=require(_0x866d('0x3'));var moment=require(_0x866d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x866d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x866d('0x6'));var csv=require(_0x866d('0x7'));var ejs=require(_0x866d('0x8'));var fs=require('fs');var fs_extra=require(_0x866d('0x9'));var _=require(_0x866d('0xa'));var squel=require(_0x866d('0xb'));var crypto=require('crypto');var jsforce=require(_0x866d('0xc'));var deskjs=require(_0x866d('0xd'));var toCsv=require(_0x866d('0x7'));var querystring=require(_0x866d('0xe'));var Papa=require('papaparse');var Redis=require(_0x866d('0xf'));var authService=require(_0x866d('0x10'));var qs=require(_0x866d('0x11'));var as=require(_0x866d('0x12'));var hardwareService=require(_0x866d('0x13'));var logger=require(_0x866d('0x14'))('api');var utils=require(_0x866d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x866d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ae82,_0xd59f39){_0xd59f39=_0xd59f39||0xcc;return function(_0x4151c4){if(_0x4151c4){return _0x49ae82['sendStatus'](_0xd59f39);}return _0x49ae82[_0x866d('0x17')](_0xd59f39)[_0x866d('0x18')]();};}function respondWithResult(_0x5101f5,_0x3e5e96){_0x3e5e96=_0x3e5e96||0xc8;return function(_0x229001){if(_0x229001){return _0x5101f5[_0x866d('0x17')](_0x3e5e96)[_0x866d('0x19')](_0x229001);}};}function respondWithFilteredResult(_0x8674d0,_0x586c42){return function(_0x596d22){if(_0x596d22){var _0x35f4d7=typeof _0x586c42[_0x866d('0x1a')]==='undefined'&&typeof _0x586c42['limit']===_0x866d('0x1b');var _0x22595e=_0x596d22['count'];var _0x4080b8=_0x35f4d7?0x0:_0x586c42['offset'];var _0x2cdc97=_0x35f4d7?_0x596d22[_0x866d('0x1c')]:_0x586c42[_0x866d('0x1a')]+_0x586c42['limit'];var _0x51bd11;if(_0x2cdc97>=_0x22595e){_0x2cdc97=_0x22595e;_0x51bd11=0xc8;}else{_0x51bd11=0xce;}_0x8674d0[_0x866d('0x17')](_0x51bd11);return _0x8674d0[_0x866d('0x1d')](_0x866d('0x1e'),_0x4080b8+'-'+_0x2cdc97+'/'+_0x22595e)[_0x866d('0x19')](_0x596d22);}return null;};}function patchUpdates(_0x3a06ab){return function(_0x20edf2){try{jsonpatch['apply'](_0x20edf2,_0x3a06ab,!![]);}catch(_0x4f3909){return BPromise['reject'](_0x4f3909);}return _0x20edf2[_0x866d('0x1f')]();};}function saveUpdates(_0x3ded6a,_0x42a204){return function(_0x5b8f91){if(_0x5b8f91){return _0x5b8f91[_0x866d('0x20')](_0x3ded6a)['then'](function(_0xf25097){return _0xf25097;});}return null;};}function removeEntity(_0x1d7928,_0x54e4f5){return function(_0x28c44a){if(_0x28c44a){return _0x28c44a[_0x866d('0x21')]()[_0x866d('0x22')](function(){_0x1d7928[_0x866d('0x17')](0xcc)[_0x866d('0x18')]();});}};}function handleEntityNotFound(_0x14e40a,_0x38a7d7){return function(_0x33e69c){if(!_0x33e69c){_0x14e40a[_0x866d('0x23')](0x194);}return _0x33e69c;};}function handleError(_0x1d59dd,_0x1da91a){_0x1da91a=_0x1da91a||0x1f4;return function(_0x4a4b7e){logger[_0x866d('0x24')](_0x4a4b7e[_0x866d('0x25')]);if(_0x4a4b7e[_0x866d('0x26')]){delete _0x4a4b7e[_0x866d('0x26')];}_0x1d59dd['status'](_0x1da91a)[_0x866d('0x27')](_0x4a4b7e);};}exports['index']=function(_0x528fc4,_0x32186b){var _0x19d9de={},_0x20ec55={},_0x2ccfda={'count':0x0,'rows':[]};var _0x305d32=_[_0x866d('0x28')](db['AnalyticTreeReport'][_0x866d('0x29')],function(_0x2a1f31){return{'name':_0x2a1f31[_0x866d('0x2a')],'type':_0x2a1f31[_0x866d('0x2b')][_0x866d('0x2c')]};});_0x20ec55[_0x866d('0x2d')]=_[_0x866d('0x28')](_0x305d32,_0x866d('0x26'));_0x20ec55[_0x866d('0x2e')]=_[_0x866d('0x2f')](_0x528fc4[_0x866d('0x2e')]);_0x20ec55['filters']=_['intersection'](_0x20ec55['model'],_0x20ec55[_0x866d('0x2e')]);_0x19d9de[_0x866d('0x30')]=_['intersection'](_0x20ec55[_0x866d('0x2d')],qs['fields'](_0x528fc4[_0x866d('0x2e')][_0x866d('0x31')]));_0x19d9de[_0x866d('0x30')]=_0x19d9de['attributes']['length']?_0x19d9de[_0x866d('0x30')]:_0x20ec55['model'];if(!_0x528fc4[_0x866d('0x2e')]['hasOwnProperty'](_0x866d('0x32'))){_0x19d9de['limit']=qs[_0x866d('0x33')](_0x528fc4[_0x866d('0x2e')][_0x866d('0x33')]);_0x19d9de[_0x866d('0x1a')]=qs[_0x866d('0x1a')](_0x528fc4[_0x866d('0x2e')][_0x866d('0x1a')]);}_0x19d9de['order']=qs[_0x866d('0x34')](_0x528fc4[_0x866d('0x2e')]['sort']);_0x19d9de[_0x866d('0x35')]=qs[_0x866d('0x36')](_[_0x866d('0x37')](_0x528fc4[_0x866d('0x2e')],_0x20ec55[_0x866d('0x36')]),_0x305d32);if(_0x528fc4['query'][_0x866d('0x38')]){_0x19d9de['where']=_['merge'](_0x19d9de[_0x866d('0x35')],{'$or':_[_0x866d('0x28')](_0x305d32,function(_0x3d9e15){if(_0x3d9e15[_0x866d('0x2b')]!==_0x866d('0x39')){var _0x1cc6dd={};_0x1cc6dd[_0x3d9e15[_0x866d('0x26')]]={'$like':'%'+_0x528fc4[_0x866d('0x2e')][_0x866d('0x38')]+'%'};return _0x1cc6dd;}})});}_0x19d9de=_[_0x866d('0x3a')]({},_0x19d9de,_0x528fc4[_0x866d('0x3b')]);var _0x2f2fca={'where':_0x19d9de[_0x866d('0x35')]};return db[_0x866d('0x3c')][_0x866d('0x1c')](_0x2f2fca)['then'](function(_0xde3033){_0x2ccfda['count']=_0xde3033;if(_0x528fc4['query'][_0x866d('0x3d')]){_0x19d9de[_0x866d('0x3e')]=[{'all':!![]}];}return db[_0x866d('0x3c')][_0x866d('0x3f')](_0x19d9de);})[_0x866d('0x22')](function(_0x590fdb){_0x2ccfda['rows']=_0x590fdb;return _0x2ccfda;})[_0x866d('0x22')](respondWithFilteredResult(_0x32186b,_0x19d9de))['catch'](handleError(_0x32186b,null));};exports[_0x866d('0x40')]=function(_0x104bb4,_0x15ba93){var _0x43db7b={'raw':!![],'where':{'id':_0x104bb4[_0x866d('0x41')]['id']}},_0x10ed79={};_0x10ed79[_0x866d('0x2d')]=_[_0x866d('0x2f')](db['AnalyticTreeReport']['rawAttributes']);_0x10ed79[_0x866d('0x2e')]=_[_0x866d('0x2f')](_0x104bb4[_0x866d('0x2e')]);_0x10ed79[_0x866d('0x36')]=_[_0x866d('0x42')](_0x10ed79['model'],_0x10ed79[_0x866d('0x2e')]);_0x43db7b[_0x866d('0x30')]=_[_0x866d('0x42')](_0x10ed79[_0x866d('0x2d')],qs['fields'](_0x104bb4[_0x866d('0x2e')][_0x866d('0x31')]));_0x43db7b[_0x866d('0x30')]=_0x43db7b['attributes'][_0x866d('0x43')]?_0x43db7b[_0x866d('0x30')]:_0x10ed79[_0x866d('0x2d')];if(_0x104bb4['query'][_0x866d('0x3d')]){_0x43db7b[_0x866d('0x3e')]=[{'all':!![]}];}_0x43db7b=_['merge']({},_0x43db7b,_0x104bb4['options']);return db[_0x866d('0x3c')][_0x866d('0x44')](_0x43db7b)[_0x866d('0x22')](handleEntityNotFound(_0x15ba93,null))[_0x866d('0x22')](respondWithResult(_0x15ba93,null))[_0x866d('0x45')](handleError(_0x15ba93,null));};exports[_0x866d('0x46')]=function(_0x5e5be4,_0x1eedf7){return db['AnalyticTreeReport']['create'](_0x5e5be4[_0x866d('0x47')],{})['then'](respondWithResult(_0x1eedf7,0xc9))[_0x866d('0x45')](handleError(_0x1eedf7,null));};exports[_0x866d('0x20')]=function(_0x6bcc3f,_0x390e01){if(_0x6bcc3f[_0x866d('0x47')]['id']){delete _0x6bcc3f[_0x866d('0x47')]['id'];}return db[_0x866d('0x3c')]['find']({'where':{'id':_0x6bcc3f[_0x866d('0x41')]['id']}})[_0x866d('0x22')](handleEntityNotFound(_0x390e01,null))[_0x866d('0x22')](saveUpdates(_0x6bcc3f['body'],null))[_0x866d('0x22')](respondWithResult(_0x390e01,null))[_0x866d('0x45')](handleError(_0x390e01,null));};exports['destroy']=function(_0x472890,_0x191ae0){return db[_0x866d('0x3c')][_0x866d('0x44')]({'where':{'id':_0x472890['params']['id']}})[_0x866d('0x22')](handleEntityNotFound(_0x191ae0,null))['then'](removeEntity(_0x191ae0,null))['catch'](handleError(_0x191ae0,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 6308148..eb1480c 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 _0x6a17=['AnalyticTreeReport','analytics_report_trees','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x29775f,_0x4e63a1){var _0x2d8e70=function(_0x1b36a4){while(--_0x1b36a4){_0x29775f['push'](_0x29775f['shift']());}};_0x2d8e70(++_0x4e63a1);}(_0x6a17,0x86));var _0x76a1=function(_0x343144,_0x20c43d){_0x343144=_0x343144-0x0;var _0x51bd95=_0x6a17[_0x343144];return _0x51bd95;};'use strict';var _=require('lodash');var util=require(_0x76a1('0x0'));var logger=require('../../config/logger')(_0x76a1('0x1'));var moment=require(_0x76a1('0x2'));var BPromise=require(_0x76a1('0x3'));var rp=require(_0x76a1('0x4'));var fs=require('fs');var path=require(_0x76a1('0x5'));var rimraf=require(_0x76a1('0x6'));var config=require(_0x76a1('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x2c760f,_0x1c48ae){return _0x2c760f[_0x76a1('0x8')](_0x76a1('0x9'),attributes,{'tableName':_0x76a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ef5=['define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x33b00c,_0x147745){var _0x5697dc=function(_0x45abc0){while(--_0x45abc0){_0x33b00c['push'](_0x33b00c['shift']());}};_0x5697dc(++_0x147745);}(_0x6ef5,0x91));var _0x56ef=function(_0x518af1,_0x1c142f){_0x518af1=_0x518af1-0x0;var _0x22d145=_0x6ef5[_0x518af1];return _0x22d145;};'use strict';var _=require(_0x56ef('0x0'));var util=require('util');var logger=require(_0x56ef('0x1'))(_0x56ef('0x2'));var moment=require(_0x56ef('0x3'));var BPromise=require(_0x56ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56ef('0x5'));var rimraf=require(_0x56ef('0x6'));var config=require(_0x56ef('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x56ef('0x8')]=function(_0x49ab0d,_0x54adab){return _0x49ab0d[_0x56ef('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x56ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index b8ac54a..161a37a 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3cc9e5,_0x29552f){var _0x5fd2ca=function(_0x4f092c){while(--_0x4f092c){_0x3cc9e5['push'](_0x3cc9e5['shift']());}};_0x5fd2ca(++_0x29552f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _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(_0x3462eb,_0x7747e7){var _0x4bbe7f=function(_0x74f0ca){while(--_0x74f0ca){_0x3462eb['push'](_0x3462eb['shift']());}};_0x4bbe7f(++_0x7747e7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1876f1,_0x5a44e1){_0x1876f1=_0x1876f1-0x0;var _0x499e13=_0x5f2f[_0x1876f1];return _0x499e13;};'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 8e238c8..779b2f4 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 _0x7218=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','get','post','create','put','/:id','update','destroy','multer'];(function(_0x28886f,_0x26cbed){var _0x2723f3=function(_0x15ee56){while(--_0x15ee56){_0x28886f['push'](_0x28886f['shift']());}};_0x2723f3(++_0x26cbed);}(_0x7218,0x1b9));var _0x8721=function(_0x12786a,_0x1c3b7f){_0x12786a=_0x12786a-0x0;var _0x2f7507=_0x7218[_0x12786a];return _0x2f7507;};'use strict';var multer=require(_0x8721('0x0'));var util=require(_0x8721('0x1'));var path=require(_0x8721('0x2'));var timeout=require(_0x8721('0x3'));var express=require(_0x8721('0x4'));var router=express[_0x8721('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8721('0x6'));var interaction=require(_0x8721('0x7'));var config=require('../../config/environment');var controller=require(_0x8721('0x8'));router['get']('/',auth[_0x8721('0x9')](),controller['index']);router[_0x8721('0xa')]('/:id',auth[_0x8721('0x9')](),controller['show']);router[_0x8721('0xb')]('/',auth['isAuthenticated'](),controller[_0x8721('0xc')]);router[_0x8721('0xd')](_0x8721('0xe'),auth[_0x8721('0x9')](),controller[_0x8721('0xf')]);router['delete'](_0x8721('0xe'),auth[_0x8721('0x9')](),controller[_0x8721('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8303=['./analyticTreeReport.controller','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d0b2e,_0x1a6a14){var _0x58e36c=function(_0x13187c){while(--_0x13187c){_0x1d0b2e['push'](_0x1d0b2e['shift']());}};_0x58e36c(++_0x1a6a14);}(_0x8303,0xb3));var _0x3830=function(_0x4f9ff3,_0x108236){_0x4f9ff3=_0x4f9ff3-0x0;var _0x1a6c55=_0x8303[_0x4f9ff3];return _0x1a6c55;};'use strict';var multer=require(_0x3830('0x0'));var util=require(_0x3830('0x1'));var path=require(_0x3830('0x2'));var timeout=require(_0x3830('0x3'));var express=require(_0x3830('0x4'));var router=express[_0x3830('0x5')]();var fs_extra=require(_0x3830('0x6'));var auth=require(_0x3830('0x7'));var interaction=require(_0x3830('0x8'));var config=require(_0x3830('0x9'));var controller=require(_0x3830('0xa'));router[_0x3830('0xb')]('/',auth[_0x3830('0xc')](),controller[_0x3830('0xd')]);router[_0x3830('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3830('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3830('0xf')](_0x3830('0x10'),auth[_0x3830('0xc')](),controller[_0x3830('0x11')]);router[_0x3830('0x12')](_0x3830('0x10'),auth[_0x3830('0xc')](),controller[_0x3830('0x13')]);module[_0x3830('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 56f7551..5da17e2 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 _0x340c=['STRING','sequelize','exports'];(function(_0x1a0cb3,_0x1080cd){var _0x54ac06=function(_0x1dfddc){while(--_0x1dfddc){_0x1a0cb3['push'](_0x1a0cb3['shift']());}};_0x54ac06(++_0x1080cd);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'name':{'type':Sequelize[_0xc340('0x2')]},'basename':{'type':Sequelize[_0xc340('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x833b=['STRING','exports'];(function(_0x2a3925,_0x4dceff){var _0x47f797=function(_0x2e2185){while(--_0x2e2185){_0x2a3925['push'](_0x2a3925['shift']());}};_0x47f797(++_0x4dceff);}(_0x833b,0x131));var _0xb833=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x833b[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require('sequelize');module[_0xb833('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xb833('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index db011ae..0b2c28e 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 _0x813a=['keys','find','get','omit','createdAt','updatedAt','body','create','params','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x23e47c,_0x3fd598){var _0x534fac=function(_0x349590){while(--_0x349590){_0x23e47c['push'](_0x23e47c['shift']());}};_0x534fac(++_0x3fd598);}(_0x813a,0x71));var _0xa813=function(_0x540b6b,_0x3c2ccb){_0x540b6b=_0x540b6b-0x0;var _0x5bfa80=_0x813a[_0x540b6b];return _0x5bfa80;};'use strict';var emlformat=require(_0xa813('0x0'));var rimraf=require(_0xa813('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa813('0x2'));var rp=require(_0xa813('0x3'));var moment=require(_0xa813('0x4'));var BPromise=require(_0xa813('0x5'));var Mustache=require('mustache');var util=require(_0xa813('0x6'));var path=require(_0xa813('0x7'));var sox=require(_0xa813('0x8'));var csv=require(_0xa813('0x9'));var ejs=require(_0xa813('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa813('0xb'));var squel=require(_0xa813('0xc'));var crypto=require(_0xa813('0xd'));var jsforce=require(_0xa813('0xe'));var deskjs=require(_0xa813('0xf'));var toCsv=require(_0xa813('0x9'));var querystring=require(_0xa813('0x10'));var Papa=require(_0xa813('0x11'));var Redis=require(_0xa813('0x12'));var authService=require(_0xa813('0x13'));var qs=require(_0xa813('0x14'));var as=require(_0xa813('0x15'));var hardwareService=require(_0xa813('0x16'));var logger=require(_0xa813('0x17'))('api');var utils=require(_0xa813('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa813('0x19'))['db'];function respondWithStatusCode(_0x480315,_0x2828e5){_0x2828e5=_0x2828e5||0xcc;return function(_0xfadb3c){if(_0xfadb3c){return _0x480315[_0xa813('0x1a')](_0x2828e5);}return _0x480315[_0xa813('0x1b')](_0x2828e5)[_0xa813('0x1c')]();};}function respondWithResult(_0x3591d6,_0x363668){_0x363668=_0x363668||0xc8;return function(_0x52b87d){if(_0x52b87d){return _0x3591d6[_0xa813('0x1b')](_0x363668)['json'](_0x52b87d);}};}function respondWithFilteredResult(_0x95e817,_0x45f994){return function(_0x5aa17d){if(_0x5aa17d){var _0x35cd3c=typeof _0x45f994[_0xa813('0x1d')]===_0xa813('0x1e')&&typeof _0x45f994[_0xa813('0x1f')]===_0xa813('0x1e');var _0x5e0d7b=_0x5aa17d[_0xa813('0x20')];var _0x4a4b5e=_0x35cd3c?0x0:_0x45f994['offset'];var _0x318148=_0x35cd3c?_0x5aa17d['count']:_0x45f994[_0xa813('0x1d')]+_0x45f994[_0xa813('0x1f')];var _0x49bef4;if(_0x318148>=_0x5e0d7b){_0x318148=_0x5e0d7b;_0x49bef4=0xc8;}else{_0x49bef4=0xce;}_0x95e817[_0xa813('0x1b')](_0x49bef4);return _0x95e817['set'](_0xa813('0x21'),_0x4a4b5e+'-'+_0x318148+'/'+_0x5e0d7b)[_0xa813('0x22')](_0x5aa17d);}return null;};}function patchUpdates(_0x1bb50a){return function(_0x5b4467){try{jsonpatch[_0xa813('0x23')](_0x5b4467,_0x1bb50a,!![]);}catch(_0x50325b){return BPromise[_0xa813('0x24')](_0x50325b);}return _0x5b4467[_0xa813('0x25')]();};}function saveUpdates(_0x263e71,_0xdf9e80){return function(_0x475371){if(_0x475371){return _0x475371[_0xa813('0x26')](_0x263e71)[_0xa813('0x27')](function(_0x535915){return _0x535915;});}return null;};}function removeEntity(_0x39b3a1,_0x37fd21){return function(_0x3317a2){if(_0x3317a2){return _0x3317a2[_0xa813('0x28')]()['then'](function(){_0x39b3a1['status'](0xcc)[_0xa813('0x1c')]();});}};}function handleEntityNotFound(_0x580fca,_0x16775c){return function(_0xefc5e5){if(!_0xefc5e5){_0x580fca[_0xa813('0x1a')](0x194);}return _0xefc5e5;};}function handleError(_0x5e38c5,_0x3e37a6){_0x3e37a6=_0x3e37a6||0x1f4;return function(_0x52e814){logger[_0xa813('0x29')](_0x52e814[_0xa813('0x2a')]);if(_0x52e814[_0xa813('0x2b')]){delete _0x52e814[_0xa813('0x2b')];}_0x5e38c5['status'](_0x3e37a6)['send'](_0x52e814);};}exports[_0xa813('0x2c')]=function(_0xa205f8,_0x11b3d0){var _0x3c45f1={},_0x1ae88b={},_0x703468={'count':0x0,'rows':[]};var _0x2f017a=_[_0xa813('0x2d')](db[_0xa813('0x2e')][_0xa813('0x2f')],function(_0x292f45){return{'name':_0x292f45[_0xa813('0x30')],'type':_0x292f45[_0xa813('0x31')][_0xa813('0x32')]};});_0x1ae88b[_0xa813('0x33')]=_[_0xa813('0x2d')](_0x2f017a,_0xa813('0x2b'));_0x1ae88b[_0xa813('0x34')]=_['keys'](_0xa205f8[_0xa813('0x34')]);_0x1ae88b[_0xa813('0x35')]=_['intersection'](_0x1ae88b['model'],_0x1ae88b[_0xa813('0x34')]);_0x3c45f1['attributes']=_[_0xa813('0x36')](_0x1ae88b[_0xa813('0x33')],qs[_0xa813('0x37')](_0xa205f8[_0xa813('0x34')]['fields']));_0x3c45f1[_0xa813('0x38')]=_0x3c45f1['attributes'][_0xa813('0x39')]?_0x3c45f1[_0xa813('0x38')]:_0x1ae88b[_0xa813('0x33')];if(!_0xa205f8['query'][_0xa813('0x3a')](_0xa813('0x3b'))){_0x3c45f1[_0xa813('0x1f')]=qs['limit'](_0xa205f8[_0xa813('0x34')]['limit']);_0x3c45f1[_0xa813('0x1d')]=qs[_0xa813('0x1d')](_0xa205f8[_0xa813('0x34')][_0xa813('0x1d')]);}_0x3c45f1[_0xa813('0x3c')]=qs[_0xa813('0x3d')](_0xa205f8[_0xa813('0x34')][_0xa813('0x3d')]);_0x3c45f1[_0xa813('0x3e')]=qs[_0xa813('0x35')](_['pick'](_0xa205f8['query'],_0x1ae88b['filters']),_0x2f017a);if(_0xa205f8[_0xa813('0x34')][_0xa813('0x3f')]){_0x3c45f1[_0xa813('0x3e')]=_[_0xa813('0x40')](_0x3c45f1[_0xa813('0x3e')],{'$or':_[_0xa813('0x2d')](_0x2f017a,function(_0x32dda5){if(_0x32dda5[_0xa813('0x31')]!==_0xa813('0x41')){var _0x43d90b={};_0x43d90b[_0x32dda5[_0xa813('0x2b')]]={'$like':'%'+_0xa205f8[_0xa813('0x34')][_0xa813('0x3f')]+'%'};return _0x43d90b;}})});}_0x3c45f1=_[_0xa813('0x40')]({},_0x3c45f1,_0xa205f8[_0xa813('0x42')]);var _0x1b1a12={'where':_0x3c45f1[_0xa813('0x3e')]};return db[_0xa813('0x2e')][_0xa813('0x20')](_0x1b1a12)[_0xa813('0x27')](function(_0x22a7de){_0x703468[_0xa813('0x20')]=_0x22a7de;if(_0xa205f8[_0xa813('0x34')][_0xa813('0x43')]){_0x3c45f1[_0xa813('0x44')]=[{'all':!![]}];}return db['Attachment'][_0xa813('0x45')](_0x3c45f1);})[_0xa813('0x27')](function(_0x1d3a4f){_0x703468[_0xa813('0x46')]=_0x1d3a4f;return _0x703468;})[_0xa813('0x27')](respondWithFilteredResult(_0x11b3d0,_0x3c45f1))[_0xa813('0x47')](handleError(_0x11b3d0,null));};exports[_0xa813('0x48')]=function(_0xc348ea,_0x43140e){var _0x3e475d={'raw':!![],'where':{'id':_0xc348ea['params']['id']}},_0x587376={};_0x587376[_0xa813('0x33')]=_['keys'](db[_0xa813('0x2e')][_0xa813('0x2f')]);_0x587376[_0xa813('0x34')]=_[_0xa813('0x49')](_0xc348ea[_0xa813('0x34')]);_0x587376['filters']=_['intersection'](_0x587376['model'],_0x587376[_0xa813('0x34')]);_0x3e475d['attributes']=_[_0xa813('0x36')](_0x587376['model'],qs['fields'](_0xc348ea[_0xa813('0x34')][_0xa813('0x37')]));_0x3e475d['attributes']=_0x3e475d['attributes']['length']?_0x3e475d[_0xa813('0x38')]:_0x587376[_0xa813('0x33')];if(_0xc348ea[_0xa813('0x34')][_0xa813('0x43')]){_0x3e475d[_0xa813('0x44')]=[{'all':!![]}];}_0x3e475d=_[_0xa813('0x40')]({},_0x3e475d,_0xc348ea[_0xa813('0x42')]);return db[_0xa813('0x2e')][_0xa813('0x4a')](_0x3e475d)[_0xa813('0x27')](handleEntityNotFound(_0x43140e,null))[_0xa813('0x27')](respondWithResult(_0x43140e,null))['catch'](handleError(_0x43140e,null));};exports['clone']=function(_0x1d9a4c,_0x123438){var _0x22377a={'where':{'id':_0x1d9a4c['params']['id']}},_0x3f149c={};_0x3f149c[_0xa813('0x33')]=_[_0xa813('0x49')](db[_0xa813('0x2e')][_0xa813('0x2f')]);_0x22377a[_0xa813('0x38')]=_['intersection'](_0x3f149c[_0xa813('0x33')],qs[_0xa813('0x37')](_0x1d9a4c[_0xa813('0x34')]['fields']));_0x22377a[_0xa813('0x38')]=_0x22377a[_0xa813('0x38')][_0xa813('0x39')]?_0x22377a[_0xa813('0x38')]:_0x3f149c[_0xa813('0x33')];if(_0x1d9a4c[_0xa813('0x34')][_0xa813('0x43')]){_0x22377a['include']=[{'all':!![]}];}_0x22377a=_[_0xa813('0x40')]({},_0x22377a,_0x1d9a4c['options']);return db[_0xa813('0x2e')]['find'](_0x22377a)[_0xa813('0x27')](handleEntityNotFound(_0x123438,null))['then'](function(_0xc44fa8){if(_0xc44fa8){var _0x2e55e5=_0xc44fa8[_0xa813('0x4b')]({'plain':!![]});_0x2e55e5=qs[_0xa813('0x4c')](_0x2e55e5,['id',_0xa813('0x4d'),_0xa813('0x4e')]);_0x1d9a4c[_0xa813('0x4f')]=_[_0xa813('0x4c')](_0x1d9a4c[_0xa813('0x4f')],['id',_0xa813('0x4d'),'updatedAt']);return db[_0xa813('0x2e')][_0xa813('0x50')](_[_0xa813('0x40')](_0x2e55e5,_0x1d9a4c[_0xa813('0x4f')]),{'include':_0x1d9a4c['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x123438,0xc9))[_0xa813('0x47')](handleError(_0x123438,null));};exports[_0xa813('0x26')]=function(_0x132145,_0x505f84){if(_0x132145[_0xa813('0x4f')]['id']){delete _0x132145[_0xa813('0x4f')]['id'];}return db[_0xa813('0x2e')][_0xa813('0x4a')]({'where':{'id':_0x132145[_0xa813('0x51')]['id']}})['then'](handleEntityNotFound(_0x505f84,null))['then'](saveUpdates(_0x132145['body'],null))[_0xa813('0x27')](respondWithResult(_0x505f84,null))[_0xa813('0x47')](handleError(_0x505f84,null));};exports[_0xa813('0x28')]=function(_0x177aaf,_0xa1dc4c){return db[_0xa813('0x2e')][_0xa813('0x4a')]({'where':{'id':_0x177aaf[_0xa813('0x51')]['id']}})['then'](handleEntityNotFound(_0xa1dc4c,null))[_0xa813('0x27')](removeEntity(_0xa1dc4c,null))[_0xa813('0x47')](handleError(_0xa1dc4c,null));};exports['create']=function(_0x2c3e5b,_0x18a963,_0x1e9942){_0x2c3e5b[_0xa813('0x4f')]['name']=_0x2c3e5b[_0xa813('0x52')][_0xa813('0x53')];_0x2c3e5b[_0xa813('0x4f')][_0xa813('0x54')]=_0x2c3e5b['file'][_0xa813('0x55')];_0x2c3e5b[_0xa813('0x4f')][_0xa813('0x31')]=_0x2c3e5b[_0xa813('0x52')][_0xa813('0x56')];return db[_0xa813('0x2e')]['create'](_0x2c3e5b[_0xa813('0x4f')])['then'](respondWithResult(_0x18a963,0xc9))[_0xa813('0x47')](handleError(_0x18a963,null));};exports[_0xa813('0x57')]=function(_0x5828dc,_0x1da8e2,_0x3b139c){return db[_0xa813('0x2e')][_0xa813('0x58')]({'where':{'id':_0x5828dc[_0xa813('0x51')]['id']},'raw':!![]})[_0xa813('0x27')](handleEntityNotFound(_0x1da8e2,null))[_0xa813('0x27')](function(_0x57bc86){if(_0x57bc86){var _0x1e02b5=_0x57bc86[_0xa813('0x59')]!==null;var _0x35e53d=path[_0xa813('0x5a')](config[_0xa813('0x5b')],'server/files/attachments/');if(_0x1e02b5){_0x35e53d=path[_0xa813('0x5a')](_0x35e53d,_0xa813('0x5c'));}var _0x281d44=path['join'](_0x35e53d,_0x57bc86['basename']);return _0x1da8e2[_0xa813('0x57')](_0x281d44);}})[_0xa813('0x47')](handleError(_0x1da8e2,null));}; \ No newline at end of file +var _0x37bd=['fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','index','Attachment','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','params','find','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','mimetype','download','findOne','root','server/files/attachments/','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x8583e,_0x1f965c){var _0x1ba58a=function(_0x3a1d5e){while(--_0x3a1d5e){_0x8583e['push'](_0x8583e['shift']());}};_0x1ba58a(++_0x1f965c);}(_0x37bd,0x15a));var _0xd37b=function(_0x42764a,_0x546e27){_0x42764a=_0x42764a-0x0;var _0x3fdee0=_0x37bd[_0x42764a];return _0x3fdee0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd37b('0x0'));var zipdir=require(_0xd37b('0x1'));var jsonpatch=require(_0xd37b('0x2'));var rp=require(_0xd37b('0x3'));var moment=require(_0xd37b('0x4'));var BPromise=require(_0xd37b('0x5'));var Mustache=require(_0xd37b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd37b('0x7'));var csv=require(_0xd37b('0x8'));var ejs=require(_0xd37b('0x9'));var fs=require('fs');var fs_extra=require(_0xd37b('0xa'));var _=require(_0xd37b('0xb'));var squel=require(_0xd37b('0xc'));var crypto=require(_0xd37b('0xd'));var jsforce=require(_0xd37b('0xe'));var deskjs=require(_0xd37b('0xf'));var toCsv=require(_0xd37b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd37b('0x10'));var authService=require(_0xd37b('0x11'));var qs=require(_0xd37b('0x12'));var as=require(_0xd37b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd37b('0x14'))(_0xd37b('0x15'));var utils=require(_0xd37b('0x16'));var config=require(_0xd37b('0x17'));var licenseUtil=require(_0xd37b('0x18'));var db=require(_0xd37b('0x19'))['db'];function respondWithStatusCode(_0x21b839,_0x5e95de){_0x5e95de=_0x5e95de||0xcc;return function(_0x23e83d){if(_0x23e83d){return _0x21b839[_0xd37b('0x1a')](_0x5e95de);}return _0x21b839[_0xd37b('0x1b')](_0x5e95de)[_0xd37b('0x1c')]();};}function respondWithResult(_0x192ecf,_0x3f7315){_0x3f7315=_0x3f7315||0xc8;return function(_0x210f25){if(_0x210f25){return _0x192ecf[_0xd37b('0x1b')](_0x3f7315)[_0xd37b('0x1d')](_0x210f25);}};}function respondWithFilteredResult(_0x2b1ae0,_0x3e0917){return function(_0x572152){if(_0x572152){var _0x14c455=typeof _0x3e0917[_0xd37b('0x1e')]===_0xd37b('0x1f')&&typeof _0x3e0917[_0xd37b('0x20')]===_0xd37b('0x1f');var _0x5e44a8=_0x572152[_0xd37b('0x21')];var _0x34aec1=_0x14c455?0x0:_0x3e0917[_0xd37b('0x1e')];var _0x267d3d=_0x14c455?_0x572152[_0xd37b('0x21')]:_0x3e0917[_0xd37b('0x1e')]+_0x3e0917['limit'];var _0x580e22;if(_0x267d3d>=_0x5e44a8){_0x267d3d=_0x5e44a8;_0x580e22=0xc8;}else{_0x580e22=0xce;}_0x2b1ae0['status'](_0x580e22);return _0x2b1ae0[_0xd37b('0x22')](_0xd37b('0x23'),_0x34aec1+'-'+_0x267d3d+'/'+_0x5e44a8)[_0xd37b('0x1d')](_0x572152);}return null;};}function patchUpdates(_0x2e3469){return function(_0x3ecb12){try{jsonpatch[_0xd37b('0x24')](_0x3ecb12,_0x2e3469,!![]);}catch(_0x24d1de){return BPromise['reject'](_0x24d1de);}return _0x3ecb12['save']();};}function saveUpdates(_0x44b779,_0x39f606){return function(_0x18b681){if(_0x18b681){return _0x18b681[_0xd37b('0x25')](_0x44b779)['then'](function(_0x2d74d1){return _0x2d74d1;});}return null;};}function removeEntity(_0x29fe1e,_0x450a90){return function(_0x2d2894){if(_0x2d2894){return _0x2d2894['destroy']()[_0xd37b('0x26')](function(){_0x29fe1e[_0xd37b('0x1b')](0xcc)[_0xd37b('0x1c')]();});}};}function handleEntityNotFound(_0x41b779,_0x2c6d9b){return function(_0x10ab6a){if(!_0x10ab6a){_0x41b779[_0xd37b('0x1a')](0x194);}return _0x10ab6a;};}function handleError(_0x267545,_0x12d8b1){_0x12d8b1=_0x12d8b1||0x1f4;return function(_0x318256){logger[_0xd37b('0x27')](_0x318256[_0xd37b('0x28')]);if(_0x318256[_0xd37b('0x29')]){delete _0x318256[_0xd37b('0x29')];}_0x267545[_0xd37b('0x1b')](_0x12d8b1)['send'](_0x318256);};}exports[_0xd37b('0x2a')]=function(_0x30ae8d,_0x57a608){var _0xe1ebb1={},_0x280b4e={},_0x5390cf={'count':0x0,'rows':[]};var _0x2a36e9=_['map'](db[_0xd37b('0x2b')][_0xd37b('0x2c')],function(_0x1eef0a){return{'name':_0x1eef0a[_0xd37b('0x2d')],'type':_0x1eef0a['type'][_0xd37b('0x2e')]};});_0x280b4e['model']=_['map'](_0x2a36e9,_0xd37b('0x29'));_0x280b4e['query']=_['keys'](_0x30ae8d[_0xd37b('0x2f')]);_0x280b4e[_0xd37b('0x30')]=_[_0xd37b('0x31')](_0x280b4e[_0xd37b('0x32')],_0x280b4e['query']);_0xe1ebb1[_0xd37b('0x33')]=_[_0xd37b('0x31')](_0x280b4e[_0xd37b('0x32')],qs[_0xd37b('0x34')](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x34')]));_0xe1ebb1[_0xd37b('0x33')]=_0xe1ebb1['attributes'][_0xd37b('0x35')]?_0xe1ebb1[_0xd37b('0x33')]:_0x280b4e['model'];if(!_0x30ae8d[_0xd37b('0x2f')]['hasOwnProperty'](_0xd37b('0x36'))){_0xe1ebb1[_0xd37b('0x20')]=qs[_0xd37b('0x20')](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x20')]);_0xe1ebb1[_0xd37b('0x1e')]=qs['offset'](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x1e')]);}_0xe1ebb1[_0xd37b('0x37')]=qs[_0xd37b('0x38')](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x38')]);_0xe1ebb1[_0xd37b('0x39')]=qs[_0xd37b('0x30')](_[_0xd37b('0x3a')](_0x30ae8d[_0xd37b('0x2f')],_0x280b4e['filters']),_0x2a36e9);if(_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x3b')]){_0xe1ebb1['where']=_['merge'](_0xe1ebb1[_0xd37b('0x39')],{'$or':_[_0xd37b('0x3c')](_0x2a36e9,function(_0x2e4e7d){if(_0x2e4e7d[_0xd37b('0x3d')]!==_0xd37b('0x3e')){var _0x890145={};_0x890145[_0x2e4e7d[_0xd37b('0x29')]]={'$like':'%'+_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x3b')]+'%'};return _0x890145;}})});}_0xe1ebb1=_[_0xd37b('0x3f')]({},_0xe1ebb1,_0x30ae8d[_0xd37b('0x40')]);var _0x4baea7={'where':_0xe1ebb1[_0xd37b('0x39')]};return db['Attachment']['count'](_0x4baea7)[_0xd37b('0x26')](function(_0x140cf7){_0x5390cf[_0xd37b('0x21')]=_0x140cf7;if(_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x41')]){_0xe1ebb1[_0xd37b('0x42')]=[{'all':!![]}];}return db[_0xd37b('0x2b')][_0xd37b('0x43')](_0xe1ebb1);})[_0xd37b('0x26')](function(_0x3ae61d){_0x5390cf['rows']=_0x3ae61d;return _0x5390cf;})['then'](respondWithFilteredResult(_0x57a608,_0xe1ebb1))[_0xd37b('0x44')](handleError(_0x57a608,null));};exports[_0xd37b('0x45')]=function(_0x5eff0a,_0xe03fc0){var _0x17497b={'raw':!![],'where':{'id':_0x5eff0a['params']['id']}},_0x53258c={};_0x53258c[_0xd37b('0x32')]=_[_0xd37b('0x46')](db[_0xd37b('0x2b')][_0xd37b('0x2c')]);_0x53258c[_0xd37b('0x2f')]=_[_0xd37b('0x46')](_0x5eff0a[_0xd37b('0x2f')]);_0x53258c['filters']=_['intersection'](_0x53258c['model'],_0x53258c[_0xd37b('0x2f')]);_0x17497b[_0xd37b('0x33')]=_[_0xd37b('0x31')](_0x53258c['model'],qs[_0xd37b('0x34')](_0x5eff0a[_0xd37b('0x2f')][_0xd37b('0x34')]));_0x17497b[_0xd37b('0x33')]=_0x17497b[_0xd37b('0x33')][_0xd37b('0x35')]?_0x17497b[_0xd37b('0x33')]:_0x53258c['model'];if(_0x5eff0a[_0xd37b('0x2f')]['includeAll']){_0x17497b['include']=[{'all':!![]}];}_0x17497b=_[_0xd37b('0x3f')]({},_0x17497b,_0x5eff0a['options']);return db['Attachment']['find'](_0x17497b)['then'](handleEntityNotFound(_0xe03fc0,null))[_0xd37b('0x26')](respondWithResult(_0xe03fc0,null))[_0xd37b('0x44')](handleError(_0xe03fc0,null));};exports['clone']=function(_0x371529,_0xdb298f){var _0x53f4fd={'where':{'id':_0x371529[_0xd37b('0x47')]['id']}},_0x2ee369={};_0x2ee369[_0xd37b('0x32')]=_['keys'](db[_0xd37b('0x2b')][_0xd37b('0x2c')]);_0x53f4fd[_0xd37b('0x33')]=_['intersection'](_0x2ee369[_0xd37b('0x32')],qs[_0xd37b('0x34')](_0x371529[_0xd37b('0x2f')][_0xd37b('0x34')]));_0x53f4fd[_0xd37b('0x33')]=_0x53f4fd['attributes'][_0xd37b('0x35')]?_0x53f4fd['attributes']:_0x2ee369[_0xd37b('0x32')];if(_0x371529[_0xd37b('0x2f')][_0xd37b('0x41')]){_0x53f4fd[_0xd37b('0x42')]=[{'all':!![]}];}_0x53f4fd=_[_0xd37b('0x3f')]({},_0x53f4fd,_0x371529['options']);return db[_0xd37b('0x2b')][_0xd37b('0x48')](_0x53f4fd)[_0xd37b('0x26')](handleEntityNotFound(_0xdb298f,null))[_0xd37b('0x26')](function(_0x56a855){if(_0x56a855){var _0x442267=_0x56a855[_0xd37b('0x49')]({'plain':!![]});_0x442267=qs[_0xd37b('0x4a')](_0x442267,['id',_0xd37b('0x4b'),_0xd37b('0x4c')]);_0x371529[_0xd37b('0x4d')]=_[_0xd37b('0x4a')](_0x371529['body'],['id',_0xd37b('0x4b'),'updatedAt']);return db[_0xd37b('0x2b')][_0xd37b('0x4e')](_[_0xd37b('0x3f')](_0x442267,_0x371529[_0xd37b('0x4d')]),{'include':_0x371529['query'][_0xd37b('0x41')]?[{'all':!![]}]:undefined});}})[_0xd37b('0x26')](respondWithResult(_0xdb298f,0xc9))[_0xd37b('0x44')](handleError(_0xdb298f,null));};exports[_0xd37b('0x25')]=function(_0x452754,_0x39a042){if(_0x452754[_0xd37b('0x4d')]['id']){delete _0x452754[_0xd37b('0x4d')]['id'];}return db[_0xd37b('0x2b')][_0xd37b('0x48')]({'where':{'id':_0x452754[_0xd37b('0x47')]['id']}})[_0xd37b('0x26')](handleEntityNotFound(_0x39a042,null))[_0xd37b('0x26')](saveUpdates(_0x452754[_0xd37b('0x4d')],null))[_0xd37b('0x26')](respondWithResult(_0x39a042,null))[_0xd37b('0x44')](handleError(_0x39a042,null));};exports[_0xd37b('0x4f')]=function(_0x4b390c,_0x49e50a){return db['Attachment'][_0xd37b('0x48')]({'where':{'id':_0x4b390c['params']['id']}})['then'](handleEntityNotFound(_0x49e50a,null))[_0xd37b('0x26')](removeEntity(_0x49e50a,null))[_0xd37b('0x44')](handleError(_0x49e50a,null));};exports['create']=function(_0x3ade60,_0x41534d,_0x15c8ef){_0x3ade60[_0xd37b('0x4d')][_0xd37b('0x29')]=_0x3ade60[_0xd37b('0x50')][_0xd37b('0x51')];_0x3ade60[_0xd37b('0x4d')][_0xd37b('0x52')]=_0x3ade60[_0xd37b('0x50')]['filename'];_0x3ade60['body'][_0xd37b('0x3d')]=_0x3ade60[_0xd37b('0x50')][_0xd37b('0x53')];return db['Attachment']['create'](_0x3ade60[_0xd37b('0x4d')])[_0xd37b('0x26')](respondWithResult(_0x41534d,0xc9))[_0xd37b('0x44')](handleError(_0x41534d,null));};exports[_0xd37b('0x54')]=function(_0x40b6bb,_0xe0348f,_0x54d2db){return db[_0xd37b('0x2b')][_0xd37b('0x55')]({'where':{'id':_0x40b6bb[_0xd37b('0x47')]['id']},'raw':!![]})[_0xd37b('0x26')](handleEntityNotFound(_0xe0348f,null))['then'](function(_0x3998ce){if(_0x3998ce){var _0x577dd6=_0x3998ce['ChatOfflineMessageId']!==null;var _0x242d90=path['join'](config[_0xd37b('0x56')],_0xd37b('0x57'));if(_0x577dd6){_0x242d90=path[_0xd37b('0x58')](_0x242d90,'offline-chat/');}var _0x4f3a4f=path[_0xd37b('0x58')](_0x242d90,_0x3998ce[_0xd37b('0x52')]);return _0xe0348f[_0xd37b('0x54')](_0x4f3a4f);}})['catch'](handleError(_0xe0348f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 5812d44..4c93e00 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 _0x944f=['./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2ff157,_0x2c252a){var _0xe775cf=function(_0x2aebfb){while(--_0x2aebfb){_0x2ff157['push'](_0x2ff157['shift']());}};_0xe775cf(++_0x2c252a);}(_0x944f,0x184));var _0xf944=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x944f[_0x5c7525];return _0x2e2ec8;};'use strict';var _=require(_0xf944('0x0'));var util=require(_0xf944('0x1'));var logger=require(_0xf944('0x2'))(_0xf944('0x3'));var moment=require(_0xf944('0x4'));var BPromise=require(_0xf944('0x5'));var rp=require(_0xf944('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf944('0x7'));var config=require('../../config/environment');var attributes=require(_0xf944('0x8'));module['exports']=function(_0x3925ce,_0x7a14ec){return _0x3925ce[_0xf944('0x9')](_0xf944('0xa'),attributes,{'tableName':_0xf944('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf765=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x14ae2f,_0x2dd861){var _0x2c2542=function(_0x238369){while(--_0x238369){_0x14ae2f['push'](_0x14ae2f['shift']());}};_0x2c2542(++_0x2dd861);}(_0xf765,0x1ee));var _0x5f76=function(_0x2beada,_0x4c816b){_0x2beada=_0x2beada-0x0;var _0x51a1aa=_0xf765[_0x2beada];return _0x51a1aa;};'use strict';var _=require(_0x5f76('0x0'));var util=require(_0x5f76('0x1'));var logger=require(_0x5f76('0x2'))(_0x5f76('0x3'));var moment=require(_0x5f76('0x4'));var BPromise=require(_0x5f76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f76('0x6'));var rimraf=require(_0x5f76('0x7'));var config=require(_0x5f76('0x8'));var attributes=require(_0x5f76('0x9'));module[_0x5f76('0xa')]=function(_0x5cccdb,_0x4a6475){return _0x5cccdb[_0x5f76('0xb')](_0x5f76('0xc'),attributes,{'tableName':_0x5f76('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 21f137f..c94f929 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 _0x195e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateAttachment','create','body','options','raw','then','lodash'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0x195e,0xfb));var _0xe195=function(_0x90be7,_0x213364){_0x90be7=_0x90be7-0x0;var _0x510d22=_0x195e[_0x90be7];return _0x510d22;};'use strict';var _=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rs=require(_0xe195('0x4'));var fs=require('fs');var Redis=require(_0xe195('0x5'));var db=require(_0xe195('0x6'))['db'];var utils=require(_0xe195('0x7'));var logger=require(_0xe195('0x8'))(_0xe195('0x9'));var config=require(_0xe195('0xa'));var jayson=require(_0xe195('0xb'));var client=jayson[_0xe195('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1acc,_0x663106,_0x2ead59){return new BPromise(function(_0x28c1a9,_0x3164c3){return client['request'](_0x2a1acc,_0x2ead59)['then'](function(_0x5f333b){logger[_0xe195('0xd')](_0xe195('0xe'),_0x663106,_0xe195('0xf'));logger[_0xe195('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x663106,_0xe195('0xf'),JSON[_0xe195('0x11')](_0x5f333b));if(_0x5f333b[_0xe195('0x12')]){if(_0x5f333b['error'][_0xe195('0x13')]===0x1f4){logger[_0xe195('0x12')]('Attachment,\x20%s,\x20%s',_0x663106,_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);return _0x3164c3(_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);}logger['error'](_0xe195('0xe'),_0x663106,_0x5f333b[_0xe195('0x12')]['message']);return _0x28c1a9(_0x5f333b['error'][_0xe195('0x14')]);}else{logger['info'](_0xe195('0xe'),_0x663106,'request\x20sent');_0x28c1a9(_0x5f333b['result'][_0xe195('0x14')]);}})[_0xe195('0x15')](function(_0x277362){logger[_0xe195('0x12')](_0xe195('0xe'),_0x663106,_0x277362);_0x3164c3(_0x277362);});});}exports[_0xe195('0x16')]=function(_0x4784b1){var _0x41265d=this;return new Promise(function(_0x9c8ba5,_0x25818c){return db['Attachment'][_0xe195('0x17')](_0x4784b1[_0xe195('0x18')],{'raw':_0x4784b1[_0xe195('0x19')]?_0x4784b1[_0xe195('0x19')][_0xe195('0x1a')]===undefined?!![]:![]:!![]})[_0xe195('0x1b')](function(_0x496722){logger[_0xe195('0xd')](_0xe195('0x16'),_0x4784b1);logger[_0xe195('0x10')](_0xe195('0x16'),_0x4784b1,JSON['stringify'](_0x496722));_0x9c8ba5(_0x496722);})['catch'](function(_0x4e5f13){logger[_0xe195('0x12')](_0xe195('0x16'),_0x4e5f13[_0xe195('0x14')],_0x4784b1);_0x25818c(_0x41265d[_0xe195('0x12')](0x1f4,_0x4e5f13[_0xe195('0x14')]));});});}; \ No newline at end of file +var _0x0eaa=['rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x7e5ad7,_0x2da255){var _0x1e4e12=function(_0x563ed4){while(--_0x563ed4){_0x7e5ad7['push'](_0x7e5ad7['shift']());}};_0x1e4e12(++_0x2da255);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x3288a2,_0x4ac4be){_0x3288a2=_0x3288a2-0x0;var _0x319f4a=_0x0eaa[_0x3288a2];return _0x319f4a;};'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')]('Attachment,\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')](_0x405f7f[_0xa0ea('0x18')],{'raw':_0x405f7f[_0xa0ea('0x19')]?_0x405f7f[_0xa0ea('0x19')][_0xa0ea('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x916f1){logger[_0xa0ea('0xb')](_0xa0ea('0x15'),_0x405f7f);logger['debug'](_0xa0ea('0x15'),_0x405f7f,JSON[_0xa0ea('0xf')](_0x916f1));_0x4ca082(_0x916f1);})[_0xa0ea('0x14')](function(_0x12cda2){logger[_0xa0ea('0x10')](_0xa0ea('0x15'),_0x12cda2['message'],_0x405f7f);_0xe116e2(_0x581f59[_0xa0ea('0x10')](0x1f4,_0x12cda2['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2d981aa..2cf099f 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 _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(_0x1b2cfa,_0x543a6d){var _0xf3151c=function(_0x55e1a7){while(--_0x55e1a7){_0x1b2cfa['push'](_0x1b2cfa['shift']());}};_0xf3151c(++_0x543a6d);}(_0x757a,0xde));var _0xa757=function(_0x363807,_0x112ada){_0x363807=_0x363807-0x0;var _0x1b32ea=_0x757a[_0x363807];return _0x1b32ea;};'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 +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1f5f6e,_0x1ef787){_0x1f5f6e=_0x1f5f6e-0x0;var _0x31210d=_0xdb28[_0x1f5f6e];return _0x31210d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 3188496..fd78fc4 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 _0xecc6=['login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','ad-login','User','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','blocked','blockedAt','online','user','agent','then','disabled','getLicense','catch','status','send','message'];(function(_0xd89ad8,_0x347fda){var _0x1be90f=function(_0xa8f0ef){while(--_0xa8f0ef){_0xd89ad8['push'](_0xd89ad8['shift']());}};_0x1be90f(++_0x347fda);}(_0xecc6,0x148));var _0x6ecc=function(_0x519d9d,_0x5cc5d0){_0x519d9d=_0x519d9d-0x0;var _0x2c0d4c=_0xecc6[_0x519d9d];return _0x2c0d4c;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x6ecc('0x0'))[_0x6ecc('0x1')];var moment=require(_0x6ecc('0x2'));var ActiveDirectory=require(_0x6ecc('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x6ecc('0x4'))['db'];var authService=require(_0x6ecc('0x5'));var utils=require(_0x6ecc('0x6'));var config=require(_0x6ecc('0x7'));var logger=require(_0x6ecc('0x8'))(_0x6ecc('0x9'));function isActiveDirectoryConfigured(_0x56a5b5){var _0x450edb=![];if(typeof _0x56a5b5['activedirectory']!==_0x6ecc('0xa')){_0x450edb=_0x56a5b5[_0x6ecc('0xb')]['baseDN']&&_0x56a5b5[_0x6ecc('0xb')][_0x6ecc('0xc')]&&_0x56a5b5[_0x6ecc('0xb')]['domain'];}return _0x450edb;}function adAuthenticate(_0x378c34,_0x59f2db,_0xcedc8f){return new BPromise(function(_0x18c8b1,_0x3082ec){try{var _0x2cb8b3=new ActiveDirectory(_0x378c34);_0x2cb8b3[_0x6ecc('0xd')](_0x59f2db,_0xcedc8f,function(_0x16a124,_0x142ea9){if(_0x16a124){logger[_0x6ecc('0xe')](_0x6ecc('0xf'),_0x59f2db,util[_0x6ecc('0x10')](_0x16a124,{'showHidden':![],'depth':null}));_0x3082ec('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x142ea9){logger[_0x6ecc('0xe')](_0x6ecc('0x11'),_0x59f2db);_0x3082ec(_0x6ecc('0x12'));}else{_0x18c8b1(_0x142ea9);}});}catch(_0xf8d071){_0x3082ec(_0xf8d071);}});}function ActiveDirectoryAuthenticate(_0x4af7d9,_0x16e519,_0x4e106c,_0x332753){var _0x5cd5ab,_0x50590a;if(!isActiveDirectoryConfigured(config)){logger[_0x6ecc('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x16e519);return _0x332753(null,![],{'message':_0x6ecc('0x12')});}return db[_0x6ecc('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x6ecc('0x14'),_0x6ecc('0x15')],'raw':!![]})['then'](function(_0x1cbdba){_0x5cd5ab=_0x1cbdba;if(!_0x5cd5ab['adSsoEnabled']){logger[_0x6ecc('0xe')](_0x6ecc('0x16'),_0x16e519);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4af7d9[_0x6ecc('0x17')]({'attributes':['id',_0x6ecc('0x18'),_0x6ecc('0x19'),_0x6ecc('0x1a'),_0x6ecc('0x1b'),'disabled',_0x6ecc('0x1c'),_0x6ecc('0x1d'),_0x6ecc('0x1e')],'where':{'name':_0x16e519,'role':{'$or':['admin',_0x6ecc('0x1f'),_0x6ecc('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x5d86c1){if(!_0x5d86c1||_0x5d86c1&&_0x5d86c1[_0x6ecc('0x18')]!==_0x16e519){throw new Error(_0x6ecc('0x12'));}_0x50590a=_0x5d86c1;var _0x4fa737=_0x50590a[_0x6ecc('0x18')]+'@'+config[_0x6ecc('0xb')]['domain'];return adAuthenticate(config[_0x6ecc('0xb')],_0x4fa737,_0x4e106c);})[_0x6ecc('0x21')](function(_0x49c31a){if(_0x50590a[_0x6ecc('0x22')]){throw new Error(_0x6ecc('0x12'));}if(_0x5cd5ab['blockDuration']>0x0){if(_0x50590a['blocked']){if(moment(_0x50590a[_0x6ecc('0x1d')])['add'](_0x5cd5ab[_0x6ecc('0x15')],'minutes')>moment()){throw new Error(_0x6ecc('0x12'));}return utils['clearBlockUser'](_0x50590a,0x0,![],null)['then'](function(){return utils[_0x6ecc('0x23')](_0x50590a);})[_0x6ecc('0x21')](function(){return _0x332753(null,_0x50590a);});}else{return utils[_0x6ecc('0x23')](_0x50590a)[_0x6ecc('0x21')](function(){return _0x332753(null,_0x50590a);});}}else{return utils[_0x6ecc('0x23')](_0x50590a)[_0x6ecc('0x21')](function(){return _0x332753(null,_0x50590a);});}})[_0x6ecc('0x24')](function(_0x1042f9){return _0x332753(null,![],_0x1042f9);});}function handleError(_0x199a66,_0x151c2c,_0x1ec429){return _0x199a66[_0x6ecc('0x25')](_0x151c2c||0x1f4)[_0x6ecc('0x26')]({'message':_0x1ec429?_0x1ec429[_0x6ecc('0x27')]||_0x1ec429:''});}exports[_0x6ecc('0x28')]=function(_0x234689,_0x2d4be4,_0x4104e5){passport[_0x6ecc('0xd')]('ad-login',function(_0x4a86dc,_0x5da8e0,_0x299609){var _0x3a4fa7=_0x4a86dc||_0x299609;if(_0x3a4fa7){return handleError(_0x2d4be4,0x191,_0x3a4fa7);}if(!_0x5da8e0){return handleError(_0x2d4be4,0x194,{'message':_0x6ecc('0x29')});}else{var _0x4b0d15={'payload':{'id':_0x5da8e0['id'],'role':_0x5da8e0[_0x6ecc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x6ecc('0x2a')](_0x4b0d15)[_0x6ecc('0x21')](function(_0x47fd22){_0x2d4be4[_0x6ecc('0x2b')]({'id':_0x5da8e0['id'],'token':_0x47fd22,'statusCall':'','isAlreadyLogged':_0x5da8e0[_0x6ecc('0x1e')]});});}})(_0x234689,_0x2d4be4,_0x4104e5);};passport['use'](_0x6ecc('0x2c'),new LocalStrategy({'usernameField':_0x6ecc('0x18'),'passwordField':'password'},function(_0x309afe,_0x304d1b,_0x3ce0cf){return ActiveDirectoryAuthenticate(db[_0x6ecc('0x2d')],_0x309afe,_0x304d1b,_0x3ce0cf);})); \ No newline at end of file +var _0x3bcf=['activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','online','admin','agent','domain','blockedAt','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment'];(function(_0x1d6824,_0x68b57a){var _0x159815=function(_0x1f7d15){while(--_0x1f7d15){_0x1d6824['push'](_0x1d6824['shift']());}};_0x159815(++_0x68b57a);}(_0x3bcf,0xdd));var _0xf3bc=function(_0x3c19f4,_0x17a81f){_0x3c19f4=_0x3c19f4-0x0;var _0x1d3f26=_0x3bcf[_0x3c19f4];return _0x1d3f26;};'use strict';var passport=require(_0xf3bc('0x0'));var LocalStrategy=require(_0xf3bc('0x1'))[_0xf3bc('0x2')];var moment=require(_0xf3bc('0x3'));var ActiveDirectory=require(_0xf3bc('0x4'));var BPromise=require(_0xf3bc('0x5'));var util=require('util');var db=require(_0xf3bc('0x6'))['db'];var authService=require(_0xf3bc('0x7'));var utils=require(_0xf3bc('0x8'));var config=require(_0xf3bc('0x9'));var logger=require('../../config/logger')(_0xf3bc('0xa'));function isActiveDirectoryConfigured(_0x3456d0){var _0x37bae7=![];if(typeof _0x3456d0[_0xf3bc('0xb')]!==_0xf3bc('0xc')){_0x37bae7=_0x3456d0[_0xf3bc('0xb')]['baseDN']&&_0x3456d0[_0xf3bc('0xb')][_0xf3bc('0xd')]&&_0x3456d0[_0xf3bc('0xb')]['domain'];}return _0x37bae7;}function adAuthenticate(_0x2849f6,_0x180001,_0x33235d){return new BPromise(function(_0x4d74ec,_0x41b436){try{var _0x2a9c12=new ActiveDirectory(_0x2849f6);_0x2a9c12[_0xf3bc('0xe')](_0x180001,_0x33235d,function(_0x2c063f,_0x2916d5){if(_0x2c063f){logger[_0xf3bc('0xf')](_0xf3bc('0x10'),_0x180001,util['inspect'](_0x2c063f,{'showHidden':![],'depth':null}));_0x41b436(_0xf3bc('0x11'));}else if(!_0x2916d5){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x180001);_0x41b436(_0xf3bc('0x11'));}else{_0x4d74ec(_0x2916d5);}});}catch(_0x198604){_0x41b436(_0x198604);}});}function ActiveDirectoryAuthenticate(_0x4cb138,_0x424063,_0x33b2ac,_0x378eed){var _0x4cb6a0,_0x2cc991;if(!isActiveDirectoryConfigured(config)){logger[_0xf3bc('0xf')](_0xf3bc('0x12'),_0x424063);return _0x378eed(null,![],{'message':_0xf3bc('0x11')});}return db[_0xf3bc('0x13')][_0xf3bc('0x14')]({'where':{'id':0x1},'attributes':[_0xf3bc('0x15'),_0xf3bc('0x16')],'raw':!![]})[_0xf3bc('0x17')](function(_0x54e1f0){_0x4cb6a0=_0x54e1f0;if(!_0x4cb6a0[_0xf3bc('0x15')]){logger[_0xf3bc('0xf')](_0xf3bc('0x18'),_0x424063);throw new Error(_0xf3bc('0x11'));}return _0x4cb138[_0xf3bc('0x14')]({'attributes':['id',_0xf3bc('0x19'),'password',_0xf3bc('0x1a'),_0xf3bc('0x1b'),_0xf3bc('0x1c'),_0xf3bc('0x1d'),'blockedAt',_0xf3bc('0x1e')],'where':{'name':_0x424063,'role':{'$or':[_0xf3bc('0x1f'),'user',_0xf3bc('0x20')]},'adSsoEnabled':!![]}});})[_0xf3bc('0x17')](function(_0x30e210){if(!_0x30e210||_0x30e210&&_0x30e210['name']!==_0x424063){throw new Error(_0xf3bc('0x11'));}_0x2cc991=_0x30e210;var _0x1ab9c5=_0x2cc991['name']+'@'+config['activedirectory'][_0xf3bc('0x21')];return adAuthenticate(config[_0xf3bc('0xb')],_0x1ab9c5,_0x33b2ac);})[_0xf3bc('0x17')](function(_0x42ad8e){if(_0x2cc991['disabled']){throw new Error(_0xf3bc('0x11'));}if(_0x4cb6a0[_0xf3bc('0x16')]>0x0){if(_0x2cc991[_0xf3bc('0x1d')]){if(moment(_0x2cc991[_0xf3bc('0x22')])['add'](_0x4cb6a0[_0xf3bc('0x16')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x2cc991,0x0,![],null)[_0xf3bc('0x17')](function(){return utils['getLicense'](_0x2cc991);})[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}else{return utils[_0xf3bc('0x23')](_0x2cc991)[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}}else{return utils['getLicense'](_0x2cc991)[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}})[_0xf3bc('0x24')](function(_0x15559f){return _0x378eed(null,![],_0x15559f);});}function handleError(_0x2f3916,_0x4cf46d,_0x333f87){return _0x2f3916['status'](_0x4cf46d||0x1f4)[_0xf3bc('0x25')]({'message':_0x333f87?_0x333f87[_0xf3bc('0x26')]||_0x333f87:''});}exports['login']=function(_0x4f6476,_0x1e0007,_0x5ca363){passport['authenticate']('ad-login',function(_0x5220e3,_0x558f82,_0x3f3d5a){var _0x2e31a4=_0x5220e3||_0x3f3d5a;if(_0x2e31a4){return handleError(_0x1e0007,0x191,_0x2e31a4);}if(!_0x558f82){return handleError(_0x1e0007,0x194,{'message':_0xf3bc('0x27')});}else{var _0x288f18={'payload':{'id':_0x558f82['id'],'role':_0x558f82[_0xf3bc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xf3bc('0x28')](_0x288f18)[_0xf3bc('0x17')](function(_0x6c1033){_0x1e0007[_0xf3bc('0x29')]({'id':_0x558f82['id'],'token':_0x6c1033,'statusCall':'','isAlreadyLogged':_0x558f82['online']});});}})(_0x4f6476,_0x1e0007,_0x5ca363);};passport[_0xf3bc('0x2a')](_0xf3bc('0x2b'),new LocalStrategy({'usernameField':_0xf3bc('0x19'),'passwordField':'password'},function(_0x1a7738,_0x572a9b,_0x1811a4){return ActiveDirectoryAuthenticate(db[_0xf3bc('0x2c')],_0x1a7738,_0x572a9b,_0x1811a4);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 059f803..f0435a9 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 _0x7f92=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7f92,0x1f1));var _0x27f9=function(_0x1bd406,_0x3760bf){_0x1bd406=_0x1bd406-0x0;var _0x4a1ce4=_0x7f92[_0x1bd406];return _0x4a1ce4;};'use strict';var express=require(_0x27f9('0x0'));var router=express[_0x27f9('0x1')]();var controller=require(_0x27f9('0x2'));router['post']('/',controller[_0x27f9('0x3')]);module[_0x27f9('0x4')]=router; \ No newline at end of file +var _0x09ce=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x487788,_0x428e9f){var _0x2829ef=function(_0x4ff9dd){while(--_0x4ff9dd){_0x487788['push'](_0x487788['shift']());}};_0x2829ef(++_0x428e9f);}(_0x09ce,0x6c));var _0xe09c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x09ce[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0xe09c('0x0'));var router=express[_0xe09c('0x1')]();var controller=require(_0xe09c('0x2'));router[_0xe09c('0x3')]('/',controller[_0xe09c('0x4')]);module[_0xe09c('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 9bfe32d..5e7d55b 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(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7a54,0x106));var _0x47a5=function(_0x120cc3,_0xf43e10){_0x120cc3=_0x120cc3-0x0;var _0x456157=_0x7a54[_0x120cc3];return _0x456157;};'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 _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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0xd01a9a,_0x61feea){_0xd01a9a=_0xd01a9a-0x0;var _0x58f15b=_0x7a54[_0xd01a9a];return _0x58f15b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6c994b8..6ce2956 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 _0x3936=['../user/user.controller.js','get','login','/callback','callback','exports','express','Router','./authGoogle.controller'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x3936,0x1ec));var _0x6393=function(_0x548e64,_0x29e562){_0x548e64=_0x548e64-0x0;var _0x47d34e=_0x3936[_0x548e64];return _0x47d34e;};'use strict';var express=require(_0x6393('0x0'));var passport=require('passport');var router=express[_0x6393('0x1')]();var controller=require(_0x6393('0x2'));var userController=require(_0x6393('0x3'));var authService=require('../../components/auth/service');router[_0x6393('0x4')]('/',controller[_0x6393('0x5')]);router[_0x6393('0x4')](_0x6393('0x6'),controller[_0x6393('0x7')],authService['isMiddleware'],userController[_0x6393('0x5')],authService['setTokenCookie']);module[_0x6393('0x8')]=router; \ No newline at end of file +var _0xcf98=['exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login','setTokenCookie'];(function(_0x5c8e2c,_0x17ccfc){var _0x4301c3=function(_0x2a3a3a){while(--_0x2a3a3a){_0x5c8e2c['push'](_0x5c8e2c['shift']());}};_0x4301c3(++_0x17ccfc);}(_0xcf98,0xf3));var _0x8cf9=function(_0x5699e8,_0x4489f0){_0x5699e8=_0x5699e8-0x0;var _0x5722aa=_0xcf98[_0x5699e8];return _0x5722aa;};'use strict';var express=require(_0x8cf9('0x0'));var passport=require('passport');var router=express[_0x8cf9('0x1')]();var controller=require(_0x8cf9('0x2'));var userController=require(_0x8cf9('0x3'));var authService=require(_0x8cf9('0x4'));router['get']('/',controller['login']);router[_0x8cf9('0x5')]('/callback',controller[_0x8cf9('0x6')],authService[_0x8cf9('0x7')],userController[_0x8cf9('0x8')],authService[_0x8cf9('0x9')]);module[_0x8cf9('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 383db8d..74e577c 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 _0xc1de=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','Password\x20reset!','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','getSmtpOptions','merge','format','email','SendMail','message','stringify','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x443533,_0x523dff){var _0x5b664b=function(_0x407d06){while(--_0x407d06){_0x443533['push'](_0x443533['shift']());}};_0x5b664b(++_0x523dff);}(_0xc1de,0x148));var _0xec1d=function(_0x469bae,_0x492367){_0x469bae=_0x469bae-0x0;var _0x2285bd=_0xc1de[_0x469bae];return _0x2285bd;};'use strict';var util=require(_0xec1d('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xec1d('0x1')];var jayson=require(_0xec1d('0x2'));var _=require(_0xec1d('0x3'));var rs=require(_0xec1d('0x4'));var moment=require(_0xec1d('0x5'));var db=require(_0xec1d('0x6'))['db'];var authService=require(_0xec1d('0x7'));var utils=require(_0xec1d('0x8'));var client=jayson[_0xec1d('0x9')][_0xec1d('0xa')]({'port':0x232b});function localAuthenticate(_0x1cd228,_0x4a73b2,_0x17f996,_0x449ed3){var _0x3e01bc,_0x1a0894;return db[_0xec1d('0xb')][_0xec1d('0xc')]({'where':{'id':0x1},'attributes':[_0xec1d('0xd'),'blockDuration'],'raw':!![]})[_0xec1d('0xe')](function(_0x4b10e1){_0x3e01bc=_0x4b10e1;return _0x1cd228[_0xec1d('0xc')]({'attributes':['id',_0xec1d('0xf'),_0xec1d('0x10'),_0xec1d('0x11'),_0xec1d('0x12'),'disabled',_0xec1d('0x13'),_0xec1d('0x14'),_0xec1d('0x15')],'where':{'name':_0x4a73b2,'role':{'$or':[_0xec1d('0x16'),_0xec1d('0x17'),_0xec1d('0x18')]}}});})[_0xec1d('0xe')](function(_0x4cf0b6){if(!_0x4cf0b6||_0x4cf0b6&&_0x4cf0b6[_0xec1d('0xf')]!==_0x4a73b2){throw new Error(_0xec1d('0x19'));}else{_0x1a0894=_0x4cf0b6;return _0x1a0894;}})[_0xec1d('0xe')](function(){_0x1a0894[_0xec1d('0x1a')](_0x17f996,function(_0x577dcc,_0x5c7a51){var _0x244ce0=_0x1a0894[_0xec1d('0x15')]+0x1;if(_0x577dcc){return _0x449ed3(_0x577dcc);}else if(!_0x5c7a51){if(_0x1a0894['disabled']){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}else if(_0x3e01bc[_0xec1d('0xd')]>0x0){if(_0x1a0894[_0xec1d('0x13')]){if(_0x3e01bc[_0xec1d('0x1b')]>0x0){if(moment(_0x1a0894[_0xec1d('0x14')])[_0xec1d('0x1c')](_0x3e01bc[_0xec1d('0x1b')],_0xec1d('0x1d'))>moment()){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}else{return utils['clearBlockUser'](_0x1a0894,_0x244ce0,![],null)[_0xec1d('0xe')](function(){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}}else{if(_0x244ce0>=_0x3e01bc[_0xec1d('0xd')]){return utils[_0xec1d('0x1e')](_0x1a0894,0x0,!![],moment())[_0xec1d('0xe')](function(){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});});}else{return utils[_0xec1d('0x1e')](_0x1a0894,_0x244ce0,![],null)[_0xec1d('0xe')](function(){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});});}}}else{return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}}else{if(_0x1a0894[_0xec1d('0x1f')]){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3e01bc[_0xec1d('0xd')]>0x0){if(_0x1a0894[_0xec1d('0x13')]){if(_0x3e01bc[_0xec1d('0x1b')]>0x0){if(moment(_0x1a0894['blockedAt'])[_0xec1d('0x1c')](_0x3e01bc[_0xec1d('0x1b')],_0xec1d('0x1d'))>moment()){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xec1d('0x1e')](_0x1a0894,0x0,![],null)[_0xec1d('0xe')](function(){return utils[_0xec1d('0x20')](_0x1a0894);})[_0xec1d('0xe')](function(){return _0x449ed3(null,_0x1a0894);});}}else{return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x1a0894,0x0,![],null)[_0xec1d('0xe')](function(){return utils['getLicense'](_0x1a0894);})['then'](function(){return _0x449ed3(null,_0x1a0894);})[_0xec1d('0x21')](function(_0x35dcaa){return _0x449ed3(null,![],_0x35dcaa);});}}else{if(_0x1a0894[_0xec1d('0x13')]){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xec1d('0x20')](_0x1a0894)[_0xec1d('0xe')](function(){return _0x449ed3(null,_0x1a0894);});}}}});})[_0xec1d('0x21')](function(_0x4fba7c){return _0x449ed3(null,![],_0x4fba7c);});}function sendServiceMail(_0x47ac1f){return db[_0xec1d('0x22')][_0xec1d('0x23')]({'where':{'service':!![]},'attributes':['id',_0xec1d('0xf'),'email'],'include':[{'model':db[_0xec1d('0x24')],'as':'Smtp','include':[{'model':db[_0xec1d('0x25')],'as':_0xec1d('0x25')}]}]})[_0xec1d('0xe')](function(_0x4840a6){if(!_0x4840a6){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x372997=_0x4840a6[_0xec1d('0x26')]();var _0x3afbf7={'account':_0x372997,'message':_[_0xec1d('0x27')]({'from':util[_0xec1d('0x28')]('\x22%s\x22\x20<%s>',_0x4840a6['name'],_0x4840a6[_0xec1d('0x29')]||_0x4840a6['Smtp']['user'])},_0x47ac1f)};return client['request'](_0xec1d('0x2a'),_0x3afbf7);})[_0xec1d('0xe')](function(_0x3f90f3){if(_0x3f90f3['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3f90f3['error'][_0xec1d('0x2b')]||JSON[_0xec1d('0x2c')](_0x3f90f3['error'])));}return!![];});}function handleError(_0x5cb9b4,_0x389a68,_0x156c63){return _0x5cb9b4['status'](_0x389a68||0x1f4)[_0xec1d('0x2d')]({'message':_0x156c63?_0x156c63[_0xec1d('0x2b')]||_0x156c63:''});}exports['login']=function(_0x4f7b78,_0x3ad5f8,_0x300f9a){passport[_0xec1d('0x1a')](_0xec1d('0x2e'),function(_0x47e994,_0x13792b,_0x4a2786){var _0x4420d3=_0x47e994||_0x4a2786;if(_0x4420d3){return handleError(_0x3ad5f8,0x191,_0x4420d3);}if(!_0x13792b){return handleError(_0x3ad5f8,0x194,{'message':_0xec1d('0x2f')});}else{var _0x4f96a6={'payload':{'id':_0x13792b['id'],'role':_0x13792b['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4f96a6)[_0xec1d('0xe')](function(_0x60242c){_0x3ad5f8[_0xec1d('0x30')]({'id':_0x13792b['id'],'token':_0x60242c,'statusCall':'','isAlreadyLogged':_0x13792b[_0xec1d('0x31')]});});}})(_0x4f7b78,_0x3ad5f8,_0x300f9a);};exports[_0xec1d('0x32')]=function(_0x5029a5,_0x56914b){if(!_0x5029a5[_0xec1d('0x33')]['email']){return handleError(_0x56914b,0x1f4,{'message':_0xec1d('0x34')});}var _0x21a127=rs[_0xec1d('0x35')]();_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')]=_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')][_0xec1d('0x36')]()['toLowerCase']();var _0x340774;return db['Setting'][_0xec1d('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xec1d('0x1b')],'raw':!![]})['then'](function(_0x56fc95){_0x340774=_0x56fc95;return db[_0xec1d('0x37')][_0xec1d('0x23')]({'where':{'email':_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')]}});})[_0xec1d('0xe')](function(_0x56da49){if(!_0x56da49){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56da49[_0xec1d('0x1f')]){throw new Error(_0xec1d('0x38'));}if(_0x56da49['blocked']){if(moment(_0x56da49[_0xec1d('0x14')])[_0xec1d('0x1c')](_0x340774[_0xec1d('0x1b')],_0xec1d('0x1d'))>moment()){throw new Error(_0xec1d('0x39'));}else{_0x56da49['blocked']=![];_0x56da49[_0xec1d('0x14')]=null;}}_0x56da49[_0xec1d('0x3a')]=_0x21a127;_0x56da49[_0xec1d('0x3b')]=Date[_0xec1d('0x3c')]()+0x36ee80;return _0x56da49[_0xec1d('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xec1d('0x3e')+_0xec1d('0x3f')+_0xec1d('0x40')+_0x5029a5['headers']['host']+_0xec1d('0x41')+_0x21a127+'\x0a\x0a'+_0xec1d('0x42')});})[_0xec1d('0xe')](function(){_0x56914b[_0xec1d('0x43')](0xc8)['send']({'message':_0xec1d('0x44')});})[_0xec1d('0x21')](function(_0x1ddc15){return handleError(_0x56914b,0x1f4,_0x1ddc15);});};exports['reset']=function(_0x8afe91,_0x2e8221){return db[_0xec1d('0x37')]['find']({'where':{'resetPasswordToken':_0x8afe91[_0xec1d('0x45')][_0xec1d('0x46')],'resetPasswordExpires':{'$gt':Date[_0xec1d('0x3c')]()}}})['then'](function(_0x37aa4e){if(!_0x37aa4e){throw new Error(_0xec1d('0x47'));}return db[_0xec1d('0xb')][_0xec1d('0xc')]({'attributes':['id',_0xec1d('0x48'),_0xec1d('0x49'),_0xec1d('0x4a')]})[_0xec1d('0xe')](function(_0x5c7b47){if(_0x5c7b47[_0xec1d('0x48')])authService['validatePasswordPattern'](_0x8afe91[_0xec1d('0x33')][_0xec1d('0x10')]);if(!_0x5c7b47[_0xec1d('0x49')]||!_0x37aa4e['previousPasswords'])return _0x37aa4e;authService['validatePasswordHistory'](_0x8afe91[_0xec1d('0x33')][_0xec1d('0x10')],_0x37aa4e[_0xec1d('0x4b')],_0x5c7b47['passwordHistoryLimit']);return _0x37aa4e;})[_0xec1d('0xe')](function(){_0x37aa4e[_0xec1d('0x10')]=_0x8afe91[_0xec1d('0x33')][_0xec1d('0x10')];_0x37aa4e[_0xec1d('0x3a')]=null;_0x37aa4e['resetPasswordExpires']=null;return _0x37aa4e[_0xec1d('0x3d')]();});})['then'](function(){_0x2e8221[_0xec1d('0x43')](0xc8)[_0xec1d('0x2d')]({'message':_0xec1d('0x4c')});})[_0xec1d('0x21')](function(_0x3a1db0){return handleError(_0x2e8221,0x1f4,_0x3a1db0);});};passport['use'](_0xec1d('0x2e'),new LocalStrategy({'usernameField':_0xec1d('0xf'),'passwordField':'password'},function(_0x3bc3cb,_0x118ee0,_0x1f30f7){return localAuthenticate(db['User'],_0x3bc3cb,_0x118ee0,_0x1f30f7);})); \ No newline at end of file +var _0x5fdb=['MailAccount','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','error','status','send','local-login','role','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','then','findOne','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','minutes','clearBlockUser','getLicense','catch'];(function(_0x52b8aa,_0x2cce69){var _0x5b9832=function(_0x50f585){while(--_0x50f585){_0x52b8aa['push'](_0x52b8aa['shift']());}};_0x5b9832(++_0x2cce69);}(_0x5fdb,0x1b0));var _0xb5fd=function(_0x199721,_0x7ccb0c){_0x199721=_0x199721-0x0;var _0x3fc405=_0x5fdb[_0x199721];return _0x3fc405;};'use strict';var util=require(_0xb5fd('0x0'));var passport=require('passport');var LocalStrategy=require(_0xb5fd('0x1'))[_0xb5fd('0x2')];var jayson=require('jayson/promise');var _=require(_0xb5fd('0x3'));var rs=require(_0xb5fd('0x4'));var moment=require(_0xb5fd('0x5'));var db=require(_0xb5fd('0x6'))['db'];var authService=require(_0xb5fd('0x7'));var utils=require(_0xb5fd('0x8'));var client=jayson['client'][_0xb5fd('0x9')]({'port':0x232b});function localAuthenticate(_0x5b41c2,_0x3ac7f6,_0x13130a,_0x467f67){var _0x4107e1,_0x57bc04;return db[_0xb5fd('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb5fd('0xb')](function(_0x529cfd){_0x4107e1=_0x529cfd;return _0x5b41c2[_0xb5fd('0xc')]({'attributes':['id',_0xb5fd('0xd'),_0xb5fd('0xe'),_0xb5fd('0xf'),'role',_0xb5fd('0x10'),_0xb5fd('0x11'),_0xb5fd('0x12'),_0xb5fd('0x13')],'where':{'name':_0x3ac7f6,'role':{'$or':[_0xb5fd('0x14'),_0xb5fd('0x15'),'agent']}}});})[_0xb5fd('0xb')](function(_0x37b89a){if(!_0x37b89a||_0x37b89a&&_0x37b89a['name']!==_0x3ac7f6){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x57bc04=_0x37b89a;return _0x57bc04;}})[_0xb5fd('0xb')](function(){_0x57bc04[_0xb5fd('0x16')](_0x13130a,function(_0x3b2b00,_0x5e8e25){var _0x34d24f=_0x57bc04[_0xb5fd('0x13')]+0x1;if(_0x3b2b00){return _0x467f67(_0x3b2b00);}else if(!_0x5e8e25){if(_0x57bc04[_0xb5fd('0x10')]){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else if(_0x4107e1[_0xb5fd('0x18')]>0x0){if(_0x57bc04['blocked']){if(_0x4107e1[_0xb5fd('0x19')]>0x0){if(moment(_0x57bc04['blockedAt'])['add'](_0x4107e1[_0xb5fd('0x19')],_0xb5fd('0x1a'))>moment()){return _0x467f67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb5fd('0x1b')](_0x57bc04,_0x34d24f,![],null)[_0xb5fd('0xb')](function(){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});});}}else{return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}}else{if(_0x34d24f>=_0x4107e1['allowedLoginAttempts']){return utils[_0xb5fd('0x1b')](_0x57bc04,0x0,!![],moment())[_0xb5fd('0xb')](function(){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});});}else{return utils[_0xb5fd('0x1b')](_0x57bc04,_0x34d24f,![],null)[_0xb5fd('0xb')](function(){return _0x467f67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x467f67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57bc04[_0xb5fd('0x10')]){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else if(_0x4107e1[_0xb5fd('0x18')]>0x0){if(_0x57bc04[_0xb5fd('0x11')]){if(_0x4107e1[_0xb5fd('0x19')]>0x0){if(moment(_0x57bc04[_0xb5fd('0x12')])['add'](_0x4107e1[_0xb5fd('0x19')],_0xb5fd('0x1a'))>moment()){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else{return utils['clearBlockUser'](_0x57bc04,0x0,![],null)[_0xb5fd('0xb')](function(){return utils[_0xb5fd('0x1c')](_0x57bc04);})[_0xb5fd('0xb')](function(){return _0x467f67(null,_0x57bc04);});}}else{return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}}else{return utils['clearBlockUser'](_0x57bc04,0x0,![],null)[_0xb5fd('0xb')](function(){return utils['getLicense'](_0x57bc04);})['then'](function(){return _0x467f67(null,_0x57bc04);})['catch'](function(_0x597aac){return _0x467f67(null,![],_0x597aac);});}}else{if(_0x57bc04['blocked']){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else{return utils[_0xb5fd('0x1c')](_0x57bc04)[_0xb5fd('0xb')](function(){return _0x467f67(null,_0x57bc04);});}}}});})[_0xb5fd('0x1d')](function(_0x5774fb){return _0x467f67(null,![],_0x5774fb);});}function sendServiceMail(_0x7d13aa){return db[_0xb5fd('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xb5fd('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xb5fd('0x1f'),'include':[{'model':db[_0xb5fd('0x20')],'as':_0xb5fd('0x20')}]}]})[_0xb5fd('0xb')](function(_0x23233a){if(!_0x23233a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x43d271=_0x23233a[_0xb5fd('0x21')]();var _0x7075dd={'account':_0x43d271,'message':_[_0xb5fd('0x22')]({'from':util[_0xb5fd('0x23')](_0xb5fd('0x24'),_0x23233a[_0xb5fd('0xd')],_0x23233a[_0xb5fd('0x25')]||_0x23233a[_0xb5fd('0x1f')]['user'])},_0x7d13aa)};return client[_0xb5fd('0x26')]('SendMail',_0x7075dd);})[_0xb5fd('0xb')](function(_0x56865a){if(_0x56865a['error']){throw new Error(util[_0xb5fd('0x23')](_0xb5fd('0x27'),_0x56865a['error']['message']||JSON[_0xb5fd('0x28')](_0x56865a[_0xb5fd('0x29')])));}return!![];});}function handleError(_0x2f2af5,_0x2f888c,_0x99889d){return _0x2f2af5[_0xb5fd('0x2a')](_0x2f888c||0x1f4)[_0xb5fd('0x2b')]({'message':_0x99889d?_0x99889d['message']||_0x99889d:''});}exports['login']=function(_0x513e16,_0x190cf8,_0x16c1de){passport[_0xb5fd('0x16')](_0xb5fd('0x2c'),function(_0x3f075c,_0x464a2a,_0x1acd9c){var _0x81a5a6=_0x3f075c||_0x1acd9c;if(_0x81a5a6){return handleError(_0x190cf8,0x191,_0x81a5a6);}if(!_0x464a2a){return handleError(_0x190cf8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1667c7={'payload':{'id':_0x464a2a['id'],'role':_0x464a2a[_0xb5fd('0x2d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1667c7)['then'](function(_0xcaa002){_0x190cf8[_0xb5fd('0x2e')]({'id':_0x464a2a['id'],'token':_0xcaa002,'statusCall':'','isAlreadyLogged':_0x464a2a[_0xb5fd('0x2f')]});});}})(_0x513e16,_0x190cf8,_0x16c1de);};exports['forgot']=function(_0x5c6ad9,_0x2b9b18){if(!_0x5c6ad9[_0xb5fd('0x30')][_0xb5fd('0x25')]){return handleError(_0x2b9b18,0x1f4,{'message':_0xb5fd('0x31')});}var _0x153b90=rs['generate']();_0x5c6ad9[_0xb5fd('0x30')]['email']=_0x5c6ad9['body'][_0xb5fd('0x25')][_0xb5fd('0x32')]()[_0xb5fd('0x33')]();var _0x43aff0;return db[_0xb5fd('0xa')][_0xb5fd('0xc')]({'where':{'id':0x1},'attributes':[_0xb5fd('0x18'),_0xb5fd('0x19')],'raw':!![]})[_0xb5fd('0xb')](function(_0x1a2648){_0x43aff0=_0x1a2648;return db[_0xb5fd('0x34')][_0xb5fd('0x35')]({'where':{'email':_0x5c6ad9[_0xb5fd('0x30')][_0xb5fd('0x25')]}});})[_0xb5fd('0xb')](function(_0x9a9dc2){if(!_0x9a9dc2){throw new Error(_0xb5fd('0x36'));}if(_0x9a9dc2[_0xb5fd('0x10')]){throw new Error(_0xb5fd('0x37'));}if(_0x9a9dc2[_0xb5fd('0x11')]){if(moment(_0x9a9dc2[_0xb5fd('0x12')])['add'](_0x43aff0[_0xb5fd('0x19')],_0xb5fd('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x9a9dc2[_0xb5fd('0x11')]=![];_0x9a9dc2['blockedAt']=null;}}_0x9a9dc2['resetPasswordToken']=_0x153b90;_0x9a9dc2[_0xb5fd('0x38')]=Date['now']()+0x36ee80;return _0x9a9dc2[_0xb5fd('0x39')]();})[_0xb5fd('0xb')](function(){return sendServiceMail({'to':_0x5c6ad9[_0xb5fd('0x30')][_0xb5fd('0x25')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xb5fd('0x3a')+_0xb5fd('0x3b')+_0xb5fd('0x3c')+_0x5c6ad9['headers']['host']+_0xb5fd('0x3d')+_0x153b90+'\x0a\x0a'+_0xb5fd('0x3e')});})[_0xb5fd('0xb')](function(){_0x2b9b18[_0xb5fd('0x2a')](0xc8)[_0xb5fd('0x2b')]({'message':_0xb5fd('0x3f')});})[_0xb5fd('0x1d')](function(_0x4a7372){return handleError(_0x2b9b18,0x1f4,_0x4a7372);});};exports[_0xb5fd('0x40')]=function(_0x531098,_0x4bc382){return db['User'][_0xb5fd('0x35')]({'where':{'resetPasswordToken':_0x531098[_0xb5fd('0x41')][_0xb5fd('0x42')],'resetPasswordExpires':{'$gt':Date[_0xb5fd('0x43')]()}}})['then'](function(_0xcaf415){if(!_0xcaf415){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0xb5fd('0x44'),'enforcePasswordHistory',_0xb5fd('0x45')]})[_0xb5fd('0xb')](function(_0x54c125){if(_0x54c125[_0xb5fd('0x44')])authService[_0xb5fd('0x46')](_0x531098['body']['password']);if(!_0x54c125[_0xb5fd('0x47')]||!_0xcaf415['previousPasswords'])return _0xcaf415;authService[_0xb5fd('0x48')](_0x531098[_0xb5fd('0x30')]['password'],_0xcaf415[_0xb5fd('0x49')],_0x54c125[_0xb5fd('0x45')]);return _0xcaf415;})[_0xb5fd('0xb')](function(){_0xcaf415[_0xb5fd('0xe')]=_0x531098[_0xb5fd('0x30')][_0xb5fd('0xe')];_0xcaf415[_0xb5fd('0x4a')]=null;_0xcaf415[_0xb5fd('0x38')]=null;return _0xcaf415[_0xb5fd('0x39')]();});})[_0xb5fd('0xb')](function(){_0x4bc382[_0xb5fd('0x2a')](0xc8)[_0xb5fd('0x2b')]({'message':_0xb5fd('0x4b')});})['catch'](function(_0x4a40c1){return handleError(_0x4bc382,0x1f4,_0x4a40c1);});};passport[_0xb5fd('0x4c')](_0xb5fd('0x2c'),new LocalStrategy({'usernameField':_0xb5fd('0xd'),'passwordField':_0xb5fd('0xe')},function(_0x2c2784,_0xe66106,_0x26b08e){return localAuthenticate(db['User'],_0x2c2784,_0xe66106,_0x26b08e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 9202e06..c1ee476 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 _0xb786=['post','login','/forgot','forgot','exports','express','./authLocal.controller'];(function(_0x118c30,_0x7eb1eb){var _0x569999=function(_0x550ba2){while(--_0x550ba2){_0x118c30['push'](_0x118c30['shift']());}};_0x569999(++_0x7eb1eb);}(_0xb786,0x19b));var _0x6b78=function(_0x4eabbb,_0x8ac99a){_0x4eabbb=_0x4eabbb-0x0;var _0x1d9d1e=_0xb786[_0x4eabbb];return _0x1d9d1e;};'use strict';var express=require(_0x6b78('0x0'));var router=express['Router']();var controller=require(_0x6b78('0x1'));router[_0x6b78('0x2')]('/',controller[_0x6b78('0x3')]);router[_0x6b78('0x2')](_0x6b78('0x4'),controller[_0x6b78('0x5')]);router[_0x6b78('0x2')]('/reset/:token',controller['reset']);module[_0x6b78('0x6')]=router; \ No newline at end of file +var _0x3790=['reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x46b764,_0x57765b){var _0x286081=function(_0x194b77){while(--_0x194b77){_0x46b764['push'](_0x46b764['shift']());}};_0x286081(++_0x57765b);}(_0x3790,0x1ba));var _0x0379=function(_0x30c550,_0x20a759){_0x30c550=_0x30c550-0x0;var _0x49d16f=_0x3790[_0x30c550];return _0x49d16f;};'use strict';var express=require(_0x0379('0x0'));var router=express[_0x0379('0x1')]();var controller=require(_0x0379('0x2'));router[_0x0379('0x3')]('/',controller[_0x0379('0x4')]);router[_0x0379('0x3')](_0x0379('0x5'),controller[_0x0379('0x6')]);router[_0x0379('0x3')](_0x0379('0x7'),controller[_0x0379('0x8')]);module[_0x0379('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 9013afd..59ee4fd 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 _0xf64b=['STRING','INTEGER','exports'];(function(_0xdd2b37,_0x283385){var _0x54deb3=function(_0x57c859){while(--_0x57c859){_0xdd2b37['push'](_0xdd2b37['shift']());}};_0x54deb3(++_0x283385);}(_0xf64b,0x1d6));var _0xbf64=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xf64b[_0x46f1a6];return _0x38429a;};'use strict';var Sequelize=require('sequelize');module[_0xbf64('0x0')]={'name':{'type':Sequelize[_0xbf64('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbf64('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbf64('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc6f0=['STRING','INTEGER'];(function(_0x123df5,_0x5a535b){var _0x115fc5=function(_0x44e410){while(--_0x44e410){_0x123df5['push'](_0x123df5['shift']());}};_0x115fc5(++_0x5a535b);}(_0xc6f0,0xea));var _0x0c6f=function(_0xb1790f,_0x5f51a4){_0xb1790f=_0xb1790f-0x0;var _0x50c602=_0xc6f0[_0xb1790f];return _0x50c602;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c6f('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c6f('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0c6f('0x1')],'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 2102cf8..c38eee1 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 _0xe0b4=['undefined','count','offset','set','Content-Range','json','save','update','then','end','error','stack','name','send','index','map','Automation','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','addConditions','ids','omit','getConditions','findOne','Condition','order','pick','filter','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x9b2cd3,_0x344955){var _0x56995b=function(_0x46cc75){while(--_0x46cc75){_0x9b2cd3['push'](_0x9b2cd3['shift']());}};_0x56995b(++_0x344955);}(_0xe0b4,0x92));var _0x4e0b=function(_0x2791e3,_0x53720c){_0x2791e3=_0x2791e3-0x0;var _0x50a6f2=_0xe0b4[_0x2791e3];return _0x50a6f2;};'use strict';var emlformat=require(_0x4e0b('0x0'));var rimraf=require(_0x4e0b('0x1'));var zipdir=require(_0x4e0b('0x2'));var jsonpatch=require(_0x4e0b('0x3'));var rp=require(_0x4e0b('0x4'));var moment=require(_0x4e0b('0x5'));var BPromise=require(_0x4e0b('0x6'));var Mustache=require('mustache');var util=require(_0x4e0b('0x7'));var path=require(_0x4e0b('0x8'));var sox=require(_0x4e0b('0x9'));var csv=require('to-csv');var ejs=require(_0x4e0b('0xa'));var fs=require('fs');var fs_extra=require(_0x4e0b('0xb'));var _=require(_0x4e0b('0xc'));var squel=require(_0x4e0b('0xd'));var crypto=require(_0x4e0b('0xe'));var jsforce=require(_0x4e0b('0xf'));var deskjs=require(_0x4e0b('0x10'));var toCsv=require(_0x4e0b('0x11'));var querystring=require(_0x4e0b('0x12'));var Papa=require(_0x4e0b('0x13'));var Redis=require(_0x4e0b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4e0b('0x15'));var as=require(_0x4e0b('0x16'));var hardwareService=require(_0x4e0b('0x17'));var logger=require('../../config/logger')(_0x4e0b('0x18'));var utils=require(_0x4e0b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4e0b('0x1a'));var db=require(_0x4e0b('0x1b'))['db'];function respondWithStatusCode(_0x2c5a9f,_0x57fb39){_0x57fb39=_0x57fb39||0xcc;return function(_0x1bcfa0){if(_0x1bcfa0){return _0x2c5a9f[_0x4e0b('0x1c')](_0x57fb39);}return _0x2c5a9f[_0x4e0b('0x1d')](_0x57fb39)['end']();};}function respondWithResult(_0x4d9456,_0x42604f){_0x42604f=_0x42604f||0xc8;return function(_0x324ca2){if(_0x324ca2){return _0x4d9456['status'](_0x42604f)['json'](_0x324ca2);}};}function respondWithFilteredResult(_0x1217e4,_0x5350f2){return function(_0x1862c4){if(_0x1862c4){var _0x3a5589=typeof _0x5350f2['offset']==='undefined'&&typeof _0x5350f2['limit']===_0x4e0b('0x1e');var _0x13c88b=_0x1862c4[_0x4e0b('0x1f')];var _0x3efc08=_0x3a5589?0x0:_0x5350f2['offset'];var _0x1e18c1=_0x3a5589?_0x1862c4['count']:_0x5350f2[_0x4e0b('0x20')]+_0x5350f2['limit'];var _0x21429d;if(_0x1e18c1>=_0x13c88b){_0x1e18c1=_0x13c88b;_0x21429d=0xc8;}else{_0x21429d=0xce;}_0x1217e4[_0x4e0b('0x1d')](_0x21429d);return _0x1217e4[_0x4e0b('0x21')](_0x4e0b('0x22'),_0x3efc08+'-'+_0x1e18c1+'/'+_0x13c88b)[_0x4e0b('0x23')](_0x1862c4);}return null;};}function patchUpdates(_0x5ec2da){return function(_0x1b601c){try{jsonpatch['apply'](_0x1b601c,_0x5ec2da,!![]);}catch(_0x2cf947){return BPromise['reject'](_0x2cf947);}return _0x1b601c[_0x4e0b('0x24')]();};}function saveUpdates(_0x295d95,_0x1f8885){return function(_0x11a974){if(_0x11a974){return _0x11a974[_0x4e0b('0x25')](_0x295d95)[_0x4e0b('0x26')](function(_0x2fc9f1){return _0x2fc9f1;});}return null;};}function removeEntity(_0x3b83a0,_0x3f70a7){return function(_0x481e49){if(_0x481e49){return _0x481e49['destroy']()[_0x4e0b('0x26')](function(){_0x3b83a0[_0x4e0b('0x1d')](0xcc)[_0x4e0b('0x27')]();});}};}function handleEntityNotFound(_0x5d9f29,_0x4d39a5){return function(_0x1f008e){if(!_0x1f008e){_0x5d9f29['sendStatus'](0x194);}return _0x1f008e;};}function handleError(_0x213ecd,_0x4631c4){_0x4631c4=_0x4631c4||0x1f4;return function(_0x324fa7){logger[_0x4e0b('0x28')](_0x324fa7[_0x4e0b('0x29')]);if(_0x324fa7[_0x4e0b('0x2a')]){delete _0x324fa7[_0x4e0b('0x2a')];}_0x213ecd['status'](_0x4631c4)[_0x4e0b('0x2b')](_0x324fa7);};}exports[_0x4e0b('0x2c')]=function(_0x47f163,_0x728e49){var _0x329c00={},_0x2f6cc0={},_0x5cda22={'count':0x0,'rows':[]};var _0x17b8d8=_[_0x4e0b('0x2d')](db[_0x4e0b('0x2e')][_0x4e0b('0x2f')],function(_0x8df4e7){return{'name':_0x8df4e7['fieldName'],'type':_0x8df4e7[_0x4e0b('0x30')]['key']};});_0x2f6cc0[_0x4e0b('0x31')]=_[_0x4e0b('0x2d')](_0x17b8d8,_0x4e0b('0x2a'));_0x2f6cc0[_0x4e0b('0x32')]=_['keys'](_0x47f163[_0x4e0b('0x32')]);_0x2f6cc0['filters']=_['intersection'](_0x2f6cc0[_0x4e0b('0x31')],_0x2f6cc0[_0x4e0b('0x32')]);_0x329c00[_0x4e0b('0x33')]=_[_0x4e0b('0x34')](_0x2f6cc0[_0x4e0b('0x31')],qs[_0x4e0b('0x35')](_0x47f163['query'][_0x4e0b('0x35')]));_0x329c00['attributes']=_0x329c00[_0x4e0b('0x33')][_0x4e0b('0x36')]?_0x329c00['attributes']:_0x2f6cc0[_0x4e0b('0x31')];if(!_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x37')](_0x4e0b('0x38'))){_0x329c00['limit']=qs[_0x4e0b('0x39')](_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x39')]);_0x329c00[_0x4e0b('0x20')]=qs['offset'](_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x20')]);}_0x329c00['order']=qs['sort'](_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x3a')]);_0x329c00[_0x4e0b('0x3b')]=qs['filters'](_['pick'](_0x47f163[_0x4e0b('0x32')],_0x2f6cc0[_0x4e0b('0x3c')]),_0x17b8d8);if(_0x47f163['query']['filter']){_0x329c00[_0x4e0b('0x3b')]=_[_0x4e0b('0x3d')](_0x329c00[_0x4e0b('0x3b')],{'$or':_[_0x4e0b('0x2d')](_0x17b8d8,function(_0xfdbb57){if(_0xfdbb57[_0x4e0b('0x30')]!==_0x4e0b('0x3e')){var _0x51b96d={};_0x51b96d[_0xfdbb57['name']]={'$like':'%'+_0x47f163[_0x4e0b('0x32')]['filter']+'%'};return _0x51b96d;}})});}_0x329c00=_[_0x4e0b('0x3d')]({},_0x329c00,_0x47f163[_0x4e0b('0x3f')]);var _0x304ede={'where':_0x329c00[_0x4e0b('0x3b')]};return db[_0x4e0b('0x2e')][_0x4e0b('0x1f')](_0x304ede)[_0x4e0b('0x26')](function(_0xcc0ce8){_0x5cda22[_0x4e0b('0x1f')]=_0xcc0ce8;if(_0x47f163['query'][_0x4e0b('0x40')]){_0x329c00[_0x4e0b('0x41')]=[{'all':!![]}];}return db[_0x4e0b('0x2e')][_0x4e0b('0x42')](_0x329c00);})[_0x4e0b('0x26')](function(_0xe9d877){_0x5cda22[_0x4e0b('0x43')]=_0xe9d877;return _0x5cda22;})[_0x4e0b('0x26')](respondWithFilteredResult(_0x728e49,_0x329c00))[_0x4e0b('0x44')](handleError(_0x728e49,null));};exports[_0x4e0b('0x45')]=function(_0x4198cb,_0x2e4cf2){var _0x3ac11b={'raw':![],'where':{'id':_0x4198cb[_0x4e0b('0x46')]['id']}},_0x49e1f6={};_0x49e1f6[_0x4e0b('0x31')]=_[_0x4e0b('0x47')](db[_0x4e0b('0x2e')][_0x4e0b('0x2f')]);_0x49e1f6[_0x4e0b('0x32')]=_['keys'](_0x4198cb['query']);_0x49e1f6[_0x4e0b('0x3c')]=_[_0x4e0b('0x34')](_0x49e1f6[_0x4e0b('0x31')],_0x49e1f6[_0x4e0b('0x32')]);_0x3ac11b['attributes']=_[_0x4e0b('0x34')](_0x49e1f6[_0x4e0b('0x31')],qs[_0x4e0b('0x35')](_0x4198cb['query'][_0x4e0b('0x35')]));_0x3ac11b['attributes']=_0x3ac11b['attributes'][_0x4e0b('0x36')]?_0x3ac11b[_0x4e0b('0x33')]:_0x49e1f6[_0x4e0b('0x31')];if(_0x4198cb[_0x4e0b('0x32')][_0x4e0b('0x40')]){_0x3ac11b[_0x4e0b('0x41')]=[{'all':!![]}];}_0x3ac11b=_[_0x4e0b('0x3d')]({},_0x3ac11b,_0x4198cb[_0x4e0b('0x3f')]);return db['Automation'][_0x4e0b('0x48')](_0x3ac11b)[_0x4e0b('0x26')](handleEntityNotFound(_0x2e4cf2,null))[_0x4e0b('0x26')](respondWithResult(_0x2e4cf2,null))[_0x4e0b('0x44')](handleError(_0x2e4cf2,null));};exports[_0x4e0b('0x49')]=function(_0x55d239,_0x373e1d){return db['Automation'][_0x4e0b('0x49')](_0x55d239[_0x4e0b('0x4a')],{})['then'](respondWithResult(_0x373e1d,0xc9))['catch'](handleError(_0x373e1d,null));};exports[_0x4e0b('0x25')]=function(_0x4a5887,_0x2fcda2){if(_0x4a5887['body']['id']){delete _0x4a5887[_0x4e0b('0x4a')]['id'];}return db[_0x4e0b('0x2e')][_0x4e0b('0x48')]({'where':{'id':_0x4a5887[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x2fcda2,null))[_0x4e0b('0x26')](saveUpdates(_0x4a5887[_0x4e0b('0x4a')],null))[_0x4e0b('0x26')](respondWithResult(_0x2fcda2,null))['catch'](handleError(_0x2fcda2,null));};exports[_0x4e0b('0x4b')]=function(_0x491c6e,_0x552b82){return db[_0x4e0b('0x2e')][_0x4e0b('0x48')]({'where':{'id':_0x491c6e[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x552b82,null))['then'](removeEntity(_0x552b82,null))['catch'](handleError(_0x552b82,null));};exports[_0x4e0b('0x4c')]=function(_0x2a348f,_0x231796,_0x1720df){return db['Condition']['find']({'where':{'id':_0x2a348f[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x231796,null))[_0x4e0b('0x26')](function(_0x35de18){if(_0x35de18){return _0x35de18['addConditions'](_0x2a348f[_0x4e0b('0x4a')][_0x4e0b('0x4d')],_[_0x4e0b('0x4e')](_0x2a348f['body'],[_0x4e0b('0x4d'),'id'])||{});}})[_0x4e0b('0x26')](respondWithResult(_0x231796,null))[_0x4e0b('0x44')](handleError(_0x231796,null));};exports[_0x4e0b('0x4f')]=function(_0x153852,_0x5a165a,_0x555f78){var _0x9bfaac={};var _0x507984={};var _0x472bd7;var _0x318576;return db['Automation'][_0x4e0b('0x50')]({'where':{'id':_0x153852[_0x4e0b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a165a,null))[_0x4e0b('0x26')](function(_0x4a9caa){if(_0x4a9caa){_0x472bd7=_0x4a9caa;_0x507984[_0x4e0b('0x31')]=_[_0x4e0b('0x47')](db[_0x4e0b('0x51')][_0x4e0b('0x2f')]);_0x507984[_0x4e0b('0x32')]=_['keys'](_0x153852[_0x4e0b('0x32')]);_0x507984[_0x4e0b('0x3c')]=_[_0x4e0b('0x34')](_0x507984['model'],_0x507984['query']);_0x9bfaac[_0x4e0b('0x33')]=_[_0x4e0b('0x34')](_0x507984[_0x4e0b('0x31')],qs['fields'](_0x153852[_0x4e0b('0x32')]['fields']));_0x9bfaac['attributes']=_0x9bfaac[_0x4e0b('0x33')][_0x4e0b('0x36')]?_0x9bfaac[_0x4e0b('0x33')]:_0x507984[_0x4e0b('0x31')];_0x9bfaac[_0x4e0b('0x52')]=qs[_0x4e0b('0x3a')](_0x153852['query'][_0x4e0b('0x3a')]);_0x9bfaac[_0x4e0b('0x3b')]=qs[_0x4e0b('0x3c')](_[_0x4e0b('0x53')](_0x153852['query'],_0x507984[_0x4e0b('0x3c')]));if(_0x153852[_0x4e0b('0x32')][_0x4e0b('0x54')]){_0x9bfaac[_0x4e0b('0x3b')]=_[_0x4e0b('0x3d')](_0x9bfaac[_0x4e0b('0x3b')],{'$or':_[_0x4e0b('0x2d')](_0x9bfaac['attributes'],function(_0x46142c){var _0xabfa52={};_0xabfa52[_0x46142c]={'$like':'%'+_0x153852[_0x4e0b('0x32')][_0x4e0b('0x54')]+'%'};return _0xabfa52;})});}_0x9bfaac=_[_0x4e0b('0x3d')]({},_0x9bfaac,_0x153852[_0x4e0b('0x3f')]);return _0x472bd7[_0x4e0b('0x4f')](_0x9bfaac);}})[_0x4e0b('0x26')](function(_0x25cae5){if(_0x25cae5){_0x318576=_0x25cae5[_0x4e0b('0x36')];if(!_0x153852['query'][_0x4e0b('0x37')]('nolimit')){_0x9bfaac[_0x4e0b('0x39')]=qs[_0x4e0b('0x39')](_0x153852['query'][_0x4e0b('0x39')]);_0x9bfaac[_0x4e0b('0x20')]=qs['offset'](_0x153852[_0x4e0b('0x32')]['offset']);}return _0x472bd7[_0x4e0b('0x4f')](_0x9bfaac);}})[_0x4e0b('0x26')](function(_0x1aa662){if(_0x1aa662){return _0x1aa662?{'count':_0x318576,'rows':_0x1aa662}:null;}})['then'](respondWithResult(_0x5a165a,null))[_0x4e0b('0x44')](handleError(_0x5a165a,null));};exports[_0x4e0b('0x55')]=function(_0x29b09b,_0x4aa2f9,_0x2fef51){return db[_0x4e0b('0x56')][_0x4e0b('0x48')]({'where':{'id':_0x29b09b[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x4aa2f9,null))['then'](function(_0xc2c99a){if(_0xc2c99a){return _0xc2c99a[_0x4e0b('0x55')](_0x29b09b[_0x4e0b('0x4a')][_0x4e0b('0x4d')],_[_0x4e0b('0x4e')](_0x29b09b[_0x4e0b('0x4a')],[_0x4e0b('0x4d'),'id'])||{});}})[_0x4e0b('0x26')](respondWithResult(_0x4aa2f9,null))['catch'](handleError(_0x4aa2f9,null));};exports[_0x4e0b('0x57')]=function(_0x257c13,_0x38ab14,_0xd16dda){var _0xd154a4={};var _0x40fb01={};var _0x1a13ae;var _0x5e91d1;return db[_0x4e0b('0x2e')]['findOne']({'where':{'id':_0x257c13['params']['id']}})['then'](handleEntityNotFound(_0x38ab14,null))['then'](function(_0x18bf27){if(_0x18bf27){_0x1a13ae=_0x18bf27;_0x40fb01['model']=_[_0x4e0b('0x47')](db[_0x4e0b('0x56')][_0x4e0b('0x2f')]);_0x40fb01[_0x4e0b('0x32')]=_['keys'](_0x257c13[_0x4e0b('0x32')]);_0x40fb01[_0x4e0b('0x3c')]=_[_0x4e0b('0x34')](_0x40fb01[_0x4e0b('0x31')],_0x40fb01['query']);_0xd154a4['attributes']=_[_0x4e0b('0x34')](_0x40fb01['model'],qs['fields'](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x35')]));_0xd154a4[_0x4e0b('0x33')]=_0xd154a4[_0x4e0b('0x33')][_0x4e0b('0x36')]?_0xd154a4['attributes']:_0x40fb01[_0x4e0b('0x31')];_0xd154a4['order']=qs[_0x4e0b('0x3a')](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x3a')]);_0xd154a4[_0x4e0b('0x3b')]=qs['filters'](_[_0x4e0b('0x53')](_0x257c13['query'],_0x40fb01[_0x4e0b('0x3c')]));if(_0x257c13['query']['filter']){_0xd154a4[_0x4e0b('0x3b')]=_[_0x4e0b('0x3d')](_0xd154a4[_0x4e0b('0x3b')],{'$or':_[_0x4e0b('0x2d')](_0xd154a4[_0x4e0b('0x33')],function(_0x25eebe){var _0x4c9ee4={};_0x4c9ee4[_0x25eebe]={'$like':'%'+_0x257c13[_0x4e0b('0x32')]['filter']+'%'};return _0x4c9ee4;})});}_0xd154a4=_['merge']({},_0xd154a4,_0x257c13[_0x4e0b('0x3f')]);return _0x1a13ae['getActions'](_0xd154a4);}})[_0x4e0b('0x26')](function(_0x4e7555){if(_0x4e7555){_0x5e91d1=_0x4e7555['length'];if(!_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x37')]('nolimit')){_0xd154a4[_0x4e0b('0x39')]=qs['limit'](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x39')]);_0xd154a4[_0x4e0b('0x20')]=qs['offset'](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x20')]);}return _0x1a13ae[_0x4e0b('0x57')](_0xd154a4);}})[_0x4e0b('0x26')](function(_0x49e424){if(_0x49e424){return _0x49e424?{'count':_0x5e91d1,'rows':_0x49e424}:null;}})['then'](respondWithResult(_0x38ab14,null))['catch'](handleError(_0x38ab14,null));}; \ No newline at end of file +var _0xec2c=['zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','show','options','find','catch','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','order','pick','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf'];(function(_0x3a0e72,_0x5520fd){var _0x2caf78=function(_0x16fa6a){while(--_0x16fa6a){_0x3a0e72['push'](_0x3a0e72['shift']());}};_0x2caf78(++_0x5520fd);}(_0xec2c,0x1a7));var _0xcec2=function(_0x2f31d0,_0x4fce9a){_0x2f31d0=_0x2f31d0-0x0;var _0x1d0256=_0xec2c[_0x2f31d0];return _0x1d0256;};'use strict';var emlformat=require(_0xcec2('0x0'));var rimraf=require(_0xcec2('0x1'));var zipdir=require(_0xcec2('0x2'));var jsonpatch=require(_0xcec2('0x3'));var rp=require('request-promise');var moment=require(_0xcec2('0x4'));var BPromise=require(_0xcec2('0x5'));var Mustache=require(_0xcec2('0x6'));var util=require('util');var path=require(_0xcec2('0x7'));var sox=require(_0xcec2('0x8'));var csv=require(_0xcec2('0x9'));var ejs=require(_0xcec2('0xa'));var fs=require('fs');var fs_extra=require(_0xcec2('0xb'));var _=require(_0xcec2('0xc'));var squel=require(_0xcec2('0xd'));var crypto=require(_0xcec2('0xe'));var jsforce=require(_0xcec2('0xf'));var deskjs=require(_0xcec2('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcec2('0x11'));var Papa=require(_0xcec2('0x12'));var Redis=require(_0xcec2('0x13'));var authService=require(_0xcec2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcec2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcec2('0x16'));var config=require(_0xcec2('0x17'));var licenseUtil=require(_0xcec2('0x18'));var db=require(_0xcec2('0x19'))['db'];function respondWithStatusCode(_0x33da0e,_0x47add5){_0x47add5=_0x47add5||0xcc;return function(_0x134fa6){if(_0x134fa6){return _0x33da0e[_0xcec2('0x1a')](_0x47add5);}return _0x33da0e[_0xcec2('0x1b')](_0x47add5)[_0xcec2('0x1c')]();};}function respondWithResult(_0x453822,_0x12b66f){_0x12b66f=_0x12b66f||0xc8;return function(_0x383e90){if(_0x383e90){return _0x453822[_0xcec2('0x1b')](_0x12b66f)['json'](_0x383e90);}};}function respondWithFilteredResult(_0x25f578,_0x290ad4){return function(_0x282169){if(_0x282169){var _0x4875ca=typeof _0x290ad4[_0xcec2('0x1d')]==='undefined'&&typeof _0x290ad4[_0xcec2('0x1e')]==='undefined';var _0x43daf0=_0x282169['count'];var _0x10c34e=_0x4875ca?0x0:_0x290ad4[_0xcec2('0x1d')];var _0x6218cd=_0x4875ca?_0x282169[_0xcec2('0x1f')]:_0x290ad4[_0xcec2('0x1d')]+_0x290ad4[_0xcec2('0x1e')];var _0x2367bd;if(_0x6218cd>=_0x43daf0){_0x6218cd=_0x43daf0;_0x2367bd=0xc8;}else{_0x2367bd=0xce;}_0x25f578[_0xcec2('0x1b')](_0x2367bd);return _0x25f578[_0xcec2('0x20')](_0xcec2('0x21'),_0x10c34e+'-'+_0x6218cd+'/'+_0x43daf0)[_0xcec2('0x22')](_0x282169);}return null;};}function patchUpdates(_0x9421f){return function(_0x4bb080){try{jsonpatch[_0xcec2('0x23')](_0x4bb080,_0x9421f,!![]);}catch(_0x2252c4){return BPromise[_0xcec2('0x24')](_0x2252c4);}return _0x4bb080['save']();};}function saveUpdates(_0x57acfc,_0x434d43){return function(_0x2050c9){if(_0x2050c9){return _0x2050c9[_0xcec2('0x25')](_0x57acfc)[_0xcec2('0x26')](function(_0xcf14dc){return _0xcf14dc;});}return null;};}function removeEntity(_0x49cc7d,_0x23c221){return function(_0x33136c){if(_0x33136c){return _0x33136c[_0xcec2('0x27')]()[_0xcec2('0x26')](function(){_0x49cc7d[_0xcec2('0x1b')](0xcc)[_0xcec2('0x1c')]();});}};}function handleEntityNotFound(_0x15e79f,_0x2f0fc7){return function(_0xe933dd){if(!_0xe933dd){_0x15e79f[_0xcec2('0x1a')](0x194);}return _0xe933dd;};}function handleError(_0x404b04,_0x2c7a5d){_0x2c7a5d=_0x2c7a5d||0x1f4;return function(_0x37845c){logger['error'](_0x37845c[_0xcec2('0x28')]);if(_0x37845c['name']){delete _0x37845c[_0xcec2('0x29')];}_0x404b04[_0xcec2('0x1b')](_0x2c7a5d)[_0xcec2('0x2a')](_0x37845c);};}exports[_0xcec2('0x2b')]=function(_0x4bf80f,_0x276b83){var _0x167f1c={},_0x454bcd={},_0x244f59={'count':0x0,'rows':[]};var _0x2b1f50=_[_0xcec2('0x2c')](db[_0xcec2('0x2d')][_0xcec2('0x2e')],function(_0x38ff7b){return{'name':_0x38ff7b[_0xcec2('0x2f')],'type':_0x38ff7b[_0xcec2('0x30')]['key']};});_0x454bcd[_0xcec2('0x31')]=_[_0xcec2('0x2c')](_0x2b1f50,_0xcec2('0x29'));_0x454bcd['query']=_[_0xcec2('0x32')](_0x4bf80f[_0xcec2('0x33')]);_0x454bcd[_0xcec2('0x34')]=_[_0xcec2('0x35')](_0x454bcd[_0xcec2('0x31')],_0x454bcd['query']);_0x167f1c['attributes']=_[_0xcec2('0x35')](_0x454bcd[_0xcec2('0x31')],qs[_0xcec2('0x36')](_0x4bf80f[_0xcec2('0x33')][_0xcec2('0x36')]));_0x167f1c['attributes']=_0x167f1c[_0xcec2('0x37')][_0xcec2('0x38')]?_0x167f1c[_0xcec2('0x37')]:_0x454bcd[_0xcec2('0x31')];if(!_0x4bf80f[_0xcec2('0x33')]['hasOwnProperty'](_0xcec2('0x39'))){_0x167f1c['limit']=qs['limit'](_0x4bf80f[_0xcec2('0x33')]['limit']);_0x167f1c[_0xcec2('0x1d')]=qs[_0xcec2('0x1d')](_0x4bf80f[_0xcec2('0x33')][_0xcec2('0x1d')]);}_0x167f1c['order']=qs[_0xcec2('0x3a')](_0x4bf80f['query'][_0xcec2('0x3a')]);_0x167f1c['where']=qs[_0xcec2('0x34')](_['pick'](_0x4bf80f['query'],_0x454bcd[_0xcec2('0x34')]),_0x2b1f50);if(_0x4bf80f['query']['filter']){_0x167f1c[_0xcec2('0x3b')]=_[_0xcec2('0x3c')](_0x167f1c[_0xcec2('0x3b')],{'$or':_[_0xcec2('0x2c')](_0x2b1f50,function(_0xa112d2){if(_0xa112d2['type']!==_0xcec2('0x3d')){var _0x3608d3={};_0x3608d3[_0xa112d2['name']]={'$like':'%'+_0x4bf80f['query'][_0xcec2('0x3e')]+'%'};return _0x3608d3;}})});}_0x167f1c=_['merge']({},_0x167f1c,_0x4bf80f['options']);var _0x281c03={'where':_0x167f1c['where']};return db[_0xcec2('0x2d')][_0xcec2('0x1f')](_0x281c03)[_0xcec2('0x26')](function(_0x7f2480){_0x244f59[_0xcec2('0x1f')]=_0x7f2480;if(_0x4bf80f[_0xcec2('0x33')][_0xcec2('0x3f')]){_0x167f1c[_0xcec2('0x40')]=[{'all':!![]}];}return db[_0xcec2('0x2d')]['findAll'](_0x167f1c);})[_0xcec2('0x26')](function(_0x379729){_0x244f59[_0xcec2('0x41')]=_0x379729;return _0x244f59;})[_0xcec2('0x26')](respondWithFilteredResult(_0x276b83,_0x167f1c))['catch'](handleError(_0x276b83,null));};exports[_0xcec2('0x42')]=function(_0x2fe87c,_0x291b2f){var _0x1adb7a={'raw':![],'where':{'id':_0x2fe87c['params']['id']}},_0x552c22={};_0x552c22[_0xcec2('0x31')]=_[_0xcec2('0x32')](db['Automation'][_0xcec2('0x2e')]);_0x552c22[_0xcec2('0x33')]=_[_0xcec2('0x32')](_0x2fe87c['query']);_0x552c22[_0xcec2('0x34')]=_[_0xcec2('0x35')](_0x552c22[_0xcec2('0x31')],_0x552c22['query']);_0x1adb7a[_0xcec2('0x37')]=_[_0xcec2('0x35')](_0x552c22[_0xcec2('0x31')],qs[_0xcec2('0x36')](_0x2fe87c[_0xcec2('0x33')]['fields']));_0x1adb7a[_0xcec2('0x37')]=_0x1adb7a['attributes'][_0xcec2('0x38')]?_0x1adb7a['attributes']:_0x552c22[_0xcec2('0x31')];if(_0x2fe87c[_0xcec2('0x33')][_0xcec2('0x3f')]){_0x1adb7a[_0xcec2('0x40')]=[{'all':!![]}];}_0x1adb7a=_[_0xcec2('0x3c')]({},_0x1adb7a,_0x2fe87c[_0xcec2('0x43')]);return db['Automation'][_0xcec2('0x44')](_0x1adb7a)['then'](handleEntityNotFound(_0x291b2f,null))[_0xcec2('0x26')](respondWithResult(_0x291b2f,null))[_0xcec2('0x45')](handleError(_0x291b2f,null));};exports[_0xcec2('0x46')]=function(_0x1d6f57,_0x5770f6){return db['Automation'][_0xcec2('0x46')](_0x1d6f57[_0xcec2('0x47')],{})[_0xcec2('0x26')](respondWithResult(_0x5770f6,0xc9))[_0xcec2('0x45')](handleError(_0x5770f6,null));};exports[_0xcec2('0x25')]=function(_0x59ca0a,_0x4c97d6){if(_0x59ca0a[_0xcec2('0x47')]['id']){delete _0x59ca0a[_0xcec2('0x47')]['id'];}return db['Automation']['find']({'where':{'id':_0x59ca0a[_0xcec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c97d6,null))['then'](saveUpdates(_0x59ca0a['body'],null))['then'](respondWithResult(_0x4c97d6,null))['catch'](handleError(_0x4c97d6,null));};exports[_0xcec2('0x27')]=function(_0x344ff4,_0x325c7f){return db[_0xcec2('0x2d')][_0xcec2('0x44')]({'where':{'id':_0x344ff4[_0xcec2('0x48')]['id']}})[_0xcec2('0x26')](handleEntityNotFound(_0x325c7f,null))[_0xcec2('0x26')](removeEntity(_0x325c7f,null))['catch'](handleError(_0x325c7f,null));};exports['addConditions']=function(_0x3686a0,_0x247ac7,_0x20fba8){return db[_0xcec2('0x49')][_0xcec2('0x44')]({'where':{'id':_0x3686a0[_0xcec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x247ac7,null))[_0xcec2('0x26')](function(_0x2d4a92){if(_0x2d4a92){return _0x2d4a92[_0xcec2('0x4a')](_0x3686a0[_0xcec2('0x47')][_0xcec2('0x4b')],_[_0xcec2('0x4c')](_0x3686a0[_0xcec2('0x47')],[_0xcec2('0x4b'),'id'])||{});}})[_0xcec2('0x26')](respondWithResult(_0x247ac7,null))[_0xcec2('0x45')](handleError(_0x247ac7,null));};exports[_0xcec2('0x4d')]=function(_0xd1507d,_0x9dd1e8,_0x3b8a27){var _0x4d6f64={};var _0x849c6f={};var _0x3aa694;var _0x5bc9a3;return db[_0xcec2('0x2d')][_0xcec2('0x4e')]({'where':{'id':_0xd1507d['params']['id']}})[_0xcec2('0x26')](handleEntityNotFound(_0x9dd1e8,null))[_0xcec2('0x26')](function(_0x11e555){if(_0x11e555){_0x3aa694=_0x11e555;_0x849c6f[_0xcec2('0x31')]=_[_0xcec2('0x32')](db[_0xcec2('0x49')][_0xcec2('0x2e')]);_0x849c6f[_0xcec2('0x33')]=_[_0xcec2('0x32')](_0xd1507d[_0xcec2('0x33')]);_0x849c6f[_0xcec2('0x34')]=_[_0xcec2('0x35')](_0x849c6f[_0xcec2('0x31')],_0x849c6f[_0xcec2('0x33')]);_0x4d6f64[_0xcec2('0x37')]=_['intersection'](_0x849c6f[_0xcec2('0x31')],qs[_0xcec2('0x36')](_0xd1507d[_0xcec2('0x33')][_0xcec2('0x36')]));_0x4d6f64['attributes']=_0x4d6f64[_0xcec2('0x37')][_0xcec2('0x38')]?_0x4d6f64[_0xcec2('0x37')]:_0x849c6f['model'];_0x4d6f64[_0xcec2('0x4f')]=qs[_0xcec2('0x3a')](_0xd1507d[_0xcec2('0x33')][_0xcec2('0x3a')]);_0x4d6f64[_0xcec2('0x3b')]=qs['filters'](_[_0xcec2('0x50')](_0xd1507d[_0xcec2('0x33')],_0x849c6f[_0xcec2('0x34')]));if(_0xd1507d[_0xcec2('0x33')]['filter']){_0x4d6f64['where']=_['merge'](_0x4d6f64[_0xcec2('0x3b')],{'$or':_['map'](_0x4d6f64[_0xcec2('0x37')],function(_0x2282a7){var _0x4bd7d7={};_0x4bd7d7[_0x2282a7]={'$like':'%'+_0xd1507d[_0xcec2('0x33')]['filter']+'%'};return _0x4bd7d7;})});}_0x4d6f64=_['merge']({},_0x4d6f64,_0xd1507d[_0xcec2('0x43')]);return _0x3aa694[_0xcec2('0x4d')](_0x4d6f64);}})[_0xcec2('0x26')](function(_0x2a43c2){if(_0x2a43c2){_0x5bc9a3=_0x2a43c2[_0xcec2('0x38')];if(!_0xd1507d[_0xcec2('0x33')][_0xcec2('0x51')](_0xcec2('0x39'))){_0x4d6f64[_0xcec2('0x1e')]=qs['limit'](_0xd1507d[_0xcec2('0x33')][_0xcec2('0x1e')]);_0x4d6f64[_0xcec2('0x1d')]=qs[_0xcec2('0x1d')](_0xd1507d['query'][_0xcec2('0x1d')]);}return _0x3aa694[_0xcec2('0x4d')](_0x4d6f64);}})[_0xcec2('0x26')](function(_0x731efa){if(_0x731efa){return _0x731efa?{'count':_0x5bc9a3,'rows':_0x731efa}:null;}})['then'](respondWithResult(_0x9dd1e8,null))[_0xcec2('0x45')](handleError(_0x9dd1e8,null));};exports[_0xcec2('0x52')]=function(_0x1a2505,_0x41a239,_0x1561a8){return db[_0xcec2('0x53')][_0xcec2('0x44')]({'where':{'id':_0x1a2505[_0xcec2('0x48')]['id']}})[_0xcec2('0x26')](handleEntityNotFound(_0x41a239,null))[_0xcec2('0x26')](function(_0x234763){if(_0x234763){return _0x234763[_0xcec2('0x52')](_0x1a2505[_0xcec2('0x47')][_0xcec2('0x4b')],_[_0xcec2('0x4c')](_0x1a2505[_0xcec2('0x47')],[_0xcec2('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x41a239,null))[_0xcec2('0x45')](handleError(_0x41a239,null));};exports[_0xcec2('0x54')]=function(_0x15265e,_0x4351f5,_0x5b3eda){var _0x1b9508={};var _0x28ff52={};var _0xa209b2;var _0xdb4283;return db[_0xcec2('0x2d')][_0xcec2('0x4e')]({'where':{'id':_0x15265e[_0xcec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4351f5,null))['then'](function(_0x420203){if(_0x420203){_0xa209b2=_0x420203;_0x28ff52[_0xcec2('0x31')]=_['keys'](db[_0xcec2('0x53')]['rawAttributes']);_0x28ff52['query']=_[_0xcec2('0x32')](_0x15265e[_0xcec2('0x33')]);_0x28ff52['filters']=_[_0xcec2('0x35')](_0x28ff52[_0xcec2('0x31')],_0x28ff52[_0xcec2('0x33')]);_0x1b9508['attributes']=_['intersection'](_0x28ff52['model'],qs[_0xcec2('0x36')](_0x15265e[_0xcec2('0x33')]['fields']));_0x1b9508[_0xcec2('0x37')]=_0x1b9508[_0xcec2('0x37')]['length']?_0x1b9508[_0xcec2('0x37')]:_0x28ff52['model'];_0x1b9508['order']=qs[_0xcec2('0x3a')](_0x15265e[_0xcec2('0x33')][_0xcec2('0x3a')]);_0x1b9508['where']=qs['filters'](_[_0xcec2('0x50')](_0x15265e[_0xcec2('0x33')],_0x28ff52[_0xcec2('0x34')]));if(_0x15265e[_0xcec2('0x33')]['filter']){_0x1b9508['where']=_[_0xcec2('0x3c')](_0x1b9508[_0xcec2('0x3b')],{'$or':_['map'](_0x1b9508[_0xcec2('0x37')],function(_0x22f49e){var _0x39be58={};_0x39be58[_0x22f49e]={'$like':'%'+_0x15265e[_0xcec2('0x33')][_0xcec2('0x3e')]+'%'};return _0x39be58;})});}_0x1b9508=_[_0xcec2('0x3c')]({},_0x1b9508,_0x15265e[_0xcec2('0x43')]);return _0xa209b2[_0xcec2('0x54')](_0x1b9508);}})[_0xcec2('0x26')](function(_0x3bcab3){if(_0x3bcab3){_0xdb4283=_0x3bcab3['length'];if(!_0x15265e[_0xcec2('0x33')]['hasOwnProperty'](_0xcec2('0x39'))){_0x1b9508['limit']=qs[_0xcec2('0x1e')](_0x15265e['query'][_0xcec2('0x1e')]);_0x1b9508['offset']=qs[_0xcec2('0x1d')](_0x15265e[_0xcec2('0x33')][_0xcec2('0x1d')]);}return _0xa209b2[_0xcec2('0x54')](_0x1b9508);}})[_0xcec2('0x26')](function(_0x3045ca){if(_0x3045ca){return _0x3045ca?{'count':_0xdb4283,'rows':_0x3045ca}:null;}})[_0xcec2('0x26')](respondWithResult(_0x4351f5,null))[_0xcec2('0x45')](handleError(_0x4351f5,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index ceb36c9..b90b22f 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 _0x000e=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','../../config/logger','api'];(function(_0x16c6d6,_0x237525){var _0x1cf47c=function(_0x7444a6){while(--_0x7444a6){_0x16c6d6['push'](_0x16c6d6['shift']());}};_0x1cf47c(++_0x237525);}(_0x000e,0xee));var _0xe000=function(_0x2d3872,_0x30ccb9){_0x2d3872=_0x2d3872-0x0;var _0x274a11=_0x000e[_0x2d3872];return _0x274a11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe000('0x0'))(_0xe000('0x1'));var moment=require('moment');var BPromise=require(_0xe000('0x2'));var rp=require(_0xe000('0x3'));var fs=require('fs');var path=require(_0xe000('0x4'));var rimraf=require(_0xe000('0x5'));var config=require(_0xe000('0x6'));var attributes=require(_0xe000('0x7'));module['exports']=function(_0x59f993,_0xb4e960){return _0x59f993[_0xe000('0x8')](_0xe000('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7417=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x25ded3,_0x21f38f){var _0x20efad=function(_0x5c9ed0){while(--_0x5c9ed0){_0x25ded3['push'](_0x25ded3['shift']());}};_0x20efad(++_0x21f38f);}(_0x7417,0xb5));var _0x7741=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7417[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7741('0x0'));var util=require('util');var logger=require(_0x7741('0x1'))(_0x7741('0x2'));var moment=require(_0x7741('0x3'));var BPromise=require(_0x7741('0x4'));var rp=require(_0x7741('0x5'));var fs=require('fs');var path=require(_0x7741('0x6'));var rimraf=require(_0x7741('0x7'));var config=require(_0x7741('0x8'));var attributes=require(_0x7741('0x9'));module['exports']=function(_0x6905f7,_0x5be39e){return _0x6905f7[_0x7741('0xa')](_0x7741('0xb'),attributes,{'tableName':_0x7741('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 6cccdd7..5f2f375 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 _0xfbbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x113d60,_0x333f34){var _0xc7d380=function(_0x50ae36){while(--_0x50ae36){_0x113d60['push'](_0x113d60['shift']());}};_0xc7d380(++_0x333f34);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x597eb6,_0x4fbdea){_0x597eb6=_0x597eb6-0x0;var _0x58c0fb=_0xfbbb[_0x597eb6];return _0x58c0fb;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var moment=require(_0xbfbb('0x2'));var BPromise=require(_0xbfbb('0x3'));var rs=require(_0xbfbb('0x4'));var fs=require('fs');var Redis=require(_0xbfbb('0x5'));var db=require(_0xbfbb('0x6'))['db'];var utils=require(_0xbfbb('0x7'));var logger=require(_0xbfbb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfbb('0x9'));var client=jayson['client'][_0xbfbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c6cc,_0x16a41c,_0x5a69b3){return new BPromise(function(_0x1f2c31,_0x3260a7){return client[_0xbfbb('0xb')](_0x16c6cc,_0x5a69b3)[_0xbfbb('0xc')](function(_0x1baefa){logger[_0xbfbb('0xd')]('Automation,\x20%s,\x20%s',_0x16a41c,_0xbfbb('0xe'));logger[_0xbfbb('0xf')](_0xbfbb('0x10'),_0x16a41c,_0xbfbb('0xe'),JSON['stringify'](_0x1baefa));if(_0x1baefa[_0xbfbb('0x11')]){if(_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x12')]===0x1f4){logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x3260a7(_0x1baefa[_0xbfbb('0x11')]['message']);}logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x1f2c31(_0x1baefa[_0xbfbb('0x11')]['message']);}else{logger[_0xbfbb('0xd')](_0xbfbb('0x13'),_0x16a41c,_0xbfbb('0xe'));_0x1f2c31(_0x1baefa[_0xbfbb('0x15')][_0xbfbb('0x14')]);}})[_0xbfbb('0x16')](function(_0x2f49e5){logger['error']('Automation,\x20%s,\x20%s',_0x16a41c,_0x2f49e5);_0x3260a7(_0x2f49e5);});});} \ No newline at end of file +var _0xe797=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe797,0x12a));var _0x7e79=function(_0x2c96a5,_0x2fbbb0){_0x2c96a5=_0x2c96a5-0x0;var _0x410169=_0xe797[_0x2c96a5];return _0x410169;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var moment=require(_0x7e79('0x2'));var BPromise=require(_0x7e79('0x3'));var rs=require(_0x7e79('0x4'));var fs=require('fs');var Redis=require(_0x7e79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e79('0x6'));var logger=require(_0x7e79('0x7'))('rpc');var config=require(_0x7e79('0x8'));var jayson=require(_0x7e79('0x9'));var client=jayson[_0x7e79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdfa1,_0x9dd35a,_0x358bd6){return new BPromise(function(_0x484e66,_0x54aab5){return client[_0x7e79('0xb')](_0x4fdfa1,_0x358bd6)[_0x7e79('0xc')](function(_0x134e89){logger['info'](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));logger[_0x7e79('0xf')](_0x7e79('0x10'),_0x9dd35a,_0x7e79('0xe'),JSON[_0x7e79('0x11')](_0x134e89));if(_0x134e89[_0x7e79('0x12')]){if(_0x134e89[_0x7e79('0x12')][_0x7e79('0x13')]===0x1f4){logger['error'](_0x7e79('0xd'),_0x9dd35a,_0x134e89['error'][_0x7e79('0x14')]);return _0x54aab5(_0x134e89['error'][_0x7e79('0x14')]);}logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x134e89[_0x7e79('0x12')]['message']);return _0x484e66(_0x134e89[_0x7e79('0x12')][_0x7e79('0x14')]);}else{logger[_0x7e79('0x15')](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));_0x484e66(_0x134e89[_0x7e79('0x16')][_0x7e79('0x14')]);}})['catch'](function(_0x2ec0c7){logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x2ec0c7);_0x54aab5(_0x2ec0c7);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a9cbf71..06a9c6c 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 _0x0c2b=['/:id/actions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id','isAuthenticated','show','/:id/conditions'];(function(_0xdaa456,_0x3dbbe5){var _0x288a4a=function(_0x4e4d5d){while(--_0x4e4d5d){_0xdaa456['push'](_0xdaa456['shift']());}};_0x288a4a(++_0x3dbbe5);}(_0x0c2b,0x134));var _0xb0c2=function(_0x22b7b5,_0x71b79){_0x22b7b5=_0x22b7b5-0x0;var _0x219a6d=_0x0c2b[_0x22b7b5];return _0x219a6d;};'use strict';var multer=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0c2('0x2'));var router=express['Router']();var fs_extra=require(_0xb0c2('0x3'));var auth=require(_0xb0c2('0x4'));var interaction=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var controller=require(_0xb0c2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb0c2('0x8')]);router[_0xb0c2('0x9')](_0xb0c2('0xa'),auth[_0xb0c2('0xb')](),controller[_0xb0c2('0xc')]);router[_0xb0c2('0x9')](_0xb0c2('0xd'),auth[_0xb0c2('0xb')](),controller['getConditions']);router[_0xb0c2('0x9')](_0xb0c2('0xe'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0xb0c2('0xb')](),controller['create']);router[_0xb0c2('0xf')](_0xb0c2('0xd'),auth['isAuthenticated'](),controller[_0xb0c2('0x10')]);router[_0xb0c2('0xf')](_0xb0c2('0xe'),auth[_0xb0c2('0xb')](),controller[_0xb0c2('0x11')]);router[_0xb0c2('0x12')](_0xb0c2('0xa'),auth[_0xb0c2('0xb')](),controller[_0xb0c2('0x13')]);router[_0xb0c2('0x14')](_0xb0c2('0xa'),auth['isAuthenticated'](),controller[_0xb0c2('0x15')]);module[_0xb0c2('0x16')]=router; \ No newline at end of file +var _0xc678=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/conditions','getActions','post','create','/:id','update','destroy','exports','path'];(function(_0x2d39e1,_0xcdb7d0){var _0x4bcfc6=function(_0x46a1bf){while(--_0x46a1bf){_0x2d39e1['push'](_0x2d39e1['shift']());}};_0x4bcfc6(++_0xcdb7d0);}(_0xc678,0x1b4));var _0x8c67=function(_0x4be6d5,_0x299b85){_0x4be6d5=_0x4be6d5-0x0;var _0x56485d=_0xc678[_0x4be6d5];return _0x56485d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8c67('0x0'));var timeout=require(_0x8c67('0x1'));var express=require(_0x8c67('0x2'));var router=express['Router']();var fs_extra=require(_0x8c67('0x3'));var auth=require(_0x8c67('0x4'));var interaction=require(_0x8c67('0x5'));var config=require(_0x8c67('0x6'));var controller=require('./automation.controller');router[_0x8c67('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c67('0x8')]);router[_0x8c67('0x7')]('/:id',auth[_0x8c67('0x9')](),controller[_0x8c67('0xa')]);router[_0x8c67('0x7')](_0x8c67('0xb'),auth[_0x8c67('0x9')](),controller['getConditions']);router[_0x8c67('0x7')]('/:id/actions',auth[_0x8c67('0x9')](),controller[_0x8c67('0xc')]);router[_0x8c67('0xd')]('/',auth['isAuthenticated'](),controller[_0x8c67('0xe')]);router[_0x8c67('0xd')](_0x8c67('0xb'),auth[_0x8c67('0x9')](),controller['addConditions']);router[_0x8c67('0xd')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put'](_0x8c67('0xf'),auth['isAuthenticated'](),controller[_0x8c67('0x10')]);router['delete'](_0x8c67('0xf'),auth[_0x8c67('0x9')](),controller[_0x8c67('0x11')]);module[_0x8c67('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 38d320e..49c8ea7 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 _0xcd3b=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcd3b,0x8b));var _0xbcd3=function(_0x16ded5,_0x56d67c){_0x16ded5=_0x16ded5-0x0;var _0x371b52=_0xcd3b[_0x16ded5];return _0x371b52;};'use strict';var Sequelize=require(_0xbcd3('0x0'));module[_0xbcd3('0x1')]={'name':{'type':Sequelize[_0xbcd3('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbcd3('0x3')](_0xbcd3('0x4')),'allowNull':![],'defaultValue':_0xbcd3('0x4')},'description':{'type':Sequelize[_0xbcd3('0x2')]},'active':{'type':Sequelize[_0xbcd3('0x5')],'defaultValue':0x0,'comment':_0xbcd3('0x6')},'limitCalls':{'type':Sequelize[_0xbcd3('0x7')](0x4)[_0xbcd3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbcd3('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbcd3('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xbcd3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'comment':_0xbcd3('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbcd3('0x10')},'dialTimezone':{'type':Sequelize[_0xbcd3('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xbcd3('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xbcd3('0x3')](_0xbcd3('0x12'),'never',_0xbcd3('0x13')),'defaultValue':_0xbcd3('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbcd3('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbcd3('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbcd3('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbcd3('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbcd3('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbcd3('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbcd3('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbcd3('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbcd3('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbcd3('0x3')](_0xbcd3('0x1d'),'ASC'),'defaultValue':_0xbcd3('0x1d')},'dialPrefix':{'type':Sequelize[_0xbcd3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbcd3('0x1e')},'dialCutDigit':{'type':Sequelize[_0xbcd3('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbcd3('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x27')}}; \ No newline at end of file +var _0x8997=['#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\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)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x22f9a3,_0x57a0ae){var _0x4a602d=function(_0x61a010){while(--_0x61a010){_0x22f9a3['push'](_0x22f9a3['shift']());}};_0x4a602d(++_0x57a0ae);}(_0x8997,0x18e));var _0x7899=function(_0x28fec5,_0xad468b){_0x28fec5=_0x28fec5-0x0;var _0xfa47dc=_0x8997[_0x28fec5];return _0xfa47dc;};'use strict';var Sequelize=require(_0x7899('0x0'));module[_0x7899('0x1')]={'name':{'type':Sequelize[_0x7899('0x2')],'unique':_0x7899('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7899('0x4')](_0x7899('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7899('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7899('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x7899('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7899('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7899('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7899('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7899('0x7')],'defaultValue':0x3,'comment':_0x7899('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7899('0xf')},'dialTimezone':{'type':Sequelize[_0x7899('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7899('0x2')],'defaultValue':_0x7899('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x7899('0x4')](_0x7899('0x11'),_0x7899('0x12'),_0x7899('0x13')),'defaultValue':_0x7899('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7899('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7899('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7899('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7899('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7899('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7899('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7899('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7899('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7899('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7899('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7899('0x4')](_0x7899('0x1c'),_0x7899('0x1d')),'defaultValue':_0x7899('0x1c')},'dialPrefix':{'type':Sequelize[_0x7899('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7899('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7899('0x1e')},'dialCutDigit':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7899('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 41af827..73cc0e8 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 _0x1177=['fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','NOW()','insert','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','end','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','role','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','cm_hopper'];(function(_0x55334a,_0x140452){var _0x2945bd=function(_0x2e3617){while(--_0x2e3617){_0x55334a['push'](_0x55334a['shift']());}};_0x2945bd(++_0x140452);}(_0x1177,0x143));var _0x7117=function(_0x26fc6a,_0x1e7f49){_0x26fc6a=_0x26fc6a-0x0;var _0x5bf15c=_0x1177[_0x26fc6a];return _0x5bf15c;};'use strict';var emlformat=require(_0x7117('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7117('0x1'));var jsonpatch=require(_0x7117('0x2'));var rp=require(_0x7117('0x3'));var moment=require('moment');var BPromise=require(_0x7117('0x4'));var Mustache=require(_0x7117('0x5'));var util=require(_0x7117('0x6'));var path=require(_0x7117('0x7'));var sox=require(_0x7117('0x8'));var csv=require(_0x7117('0x9'));var ejs=require(_0x7117('0xa'));var fs=require('fs');var fs_extra=require(_0x7117('0xb'));var _=require(_0x7117('0xc'));var squel=require('squel');var crypto=require(_0x7117('0xd'));var jsforce=require(_0x7117('0xe'));var deskjs=require(_0x7117('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7117('0x10'));var Papa=require(_0x7117('0x11'));var Redis=require(_0x7117('0x12'));var authService=require(_0x7117('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7117('0x14'));var hardwareService=require(_0x7117('0x15'));var logger=require('../../config/logger')(_0x7117('0x16'));var utils=require(_0x7117('0x17'));var config=require(_0x7117('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x165b1a,_0x288cc9){_0x288cc9=_0x288cc9||0xcc;return function(_0x532d3f){if(_0x532d3f){return _0x165b1a[_0x7117('0x19')](_0x288cc9);}return _0x165b1a['status'](_0x288cc9)['end']();};}function respondWithResult(_0x4bf645,_0x244406){_0x244406=_0x244406||0xc8;return function(_0x30342e){if(_0x30342e){return _0x4bf645[_0x7117('0x1a')](_0x244406)[_0x7117('0x1b')](_0x30342e);}};}function respondWithFilteredResult(_0x530040,_0x145e70){return function(_0x5f1be9){if(_0x5f1be9){var _0xe683af=typeof _0x145e70[_0x7117('0x1c')]===_0x7117('0x1d')&&typeof _0x145e70[_0x7117('0x1e')]==='undefined';var _0x227066=_0x5f1be9[_0x7117('0x1f')];var _0x4f32a9=_0xe683af?0x0:_0x145e70['offset'];var _0x3e3163=_0xe683af?_0x5f1be9[_0x7117('0x1f')]:_0x145e70['offset']+_0x145e70[_0x7117('0x1e')];var _0x308e39;if(_0x3e3163>=_0x227066){_0x3e3163=_0x227066;_0x308e39=0xc8;}else{_0x308e39=0xce;}_0x530040[_0x7117('0x1a')](_0x308e39);return _0x530040[_0x7117('0x20')](_0x7117('0x21'),_0x4f32a9+'-'+_0x3e3163+'/'+_0x227066)[_0x7117('0x1b')](_0x5f1be9);}return null;};}function patchUpdates(_0x56b843){return function(_0x10f278){try{jsonpatch['apply'](_0x10f278,_0x56b843,!![]);}catch(_0x458a49){return BPromise[_0x7117('0x22')](_0x458a49);}return _0x10f278[_0x7117('0x23')]();};}function saveUpdates(_0x3098aa,_0x4e9561){return function(_0x45f1e3){if(_0x45f1e3){return _0x45f1e3[_0x7117('0x24')](_0x3098aa)[_0x7117('0x25')](function(_0x296062){return _0x296062;});}return null;};}function removeEntity(_0x52b830,_0x13ed85){return function(_0x15503d){if(_0x15503d){return _0x15503d[_0x7117('0x26')]()[_0x7117('0x25')](function(){var _0x553add=_0x15503d[_0x7117('0x27')]({'plain':!![]});var _0x5e4033=_0x7117('0x28');return db['UserProfileResource'][_0x7117('0x26')]({'where':{'type':_0x5e4033,'resourceId':_0x553add['id']}})[_0x7117('0x25')](function(){return _0x15503d;});})[_0x7117('0x25')](function(){_0x52b830[_0x7117('0x1a')](0xcc)[_0x7117('0x29')]();});}};}function handleEntityNotFound(_0x581570,_0xb28511){return function(_0xdd1b4f){if(!_0xdd1b4f){_0x581570[_0x7117('0x19')](0x194);}return _0xdd1b4f;};}function handleError(_0xc5fb6f,_0x23f3e7){_0x23f3e7=_0x23f3e7||0x1f4;return function(_0x1eb600){logger[_0x7117('0x2a')](_0x1eb600[_0x7117('0x2b')]);if(_0x1eb600[_0x7117('0x2c')]){delete _0x1eb600['name'];}_0xc5fb6f['status'](_0x23f3e7)[_0x7117('0x2d')](_0x1eb600);};}exports[_0x7117('0x2e')]=function(_0x302f6d,_0xa04523){var _0x425a25={},_0x1c1ed1={},_0x412b1d={'count':0x0,'rows':[]};var _0x54c566=_[_0x7117('0x2f')](db[_0x7117('0x30')][_0x7117('0x31')],function(_0x33d762){return{'name':_0x33d762[_0x7117('0x32')],'type':_0x33d762[_0x7117('0x33')][_0x7117('0x34')]};});_0x1c1ed1[_0x7117('0x35')]=_[_0x7117('0x2f')](_0x54c566,_0x7117('0x2c'));_0x1c1ed1[_0x7117('0x36')]=_['keys'](_0x302f6d['query']);_0x1c1ed1[_0x7117('0x37')]=_[_0x7117('0x38')](_0x1c1ed1[_0x7117('0x35')],_0x1c1ed1[_0x7117('0x36')]);_0x425a25[_0x7117('0x39')]=_[_0x7117('0x38')](_0x1c1ed1[_0x7117('0x35')],qs['fields'](_0x302f6d['query'][_0x7117('0x3a')]));_0x425a25[_0x7117('0x39')]=_0x425a25[_0x7117('0x39')][_0x7117('0x3b')]?_0x425a25[_0x7117('0x39')]:_0x1c1ed1[_0x7117('0x35')];if(!_0x302f6d[_0x7117('0x36')]['hasOwnProperty'](_0x7117('0x3c'))){_0x425a25[_0x7117('0x1e')]=qs['limit'](_0x302f6d[_0x7117('0x36')][_0x7117('0x1e')]);_0x425a25['offset']=qs[_0x7117('0x1c')](_0x302f6d[_0x7117('0x36')]['offset']);}_0x425a25[_0x7117('0x3d')]=qs[_0x7117('0x3e')](_0x302f6d['query'][_0x7117('0x3e')]);_0x425a25[_0x7117('0x3f')]=qs['filters'](_[_0x7117('0x40')](_0x302f6d[_0x7117('0x36')],_0x1c1ed1[_0x7117('0x37')]),_0x54c566);if(_0x302f6d[_0x7117('0x36')][_0x7117('0x41')]){_0x425a25[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x425a25[_0x7117('0x3f')],{'$or':_[_0x7117('0x2f')](_0x54c566,function(_0x37777a){if(_0x37777a[_0x7117('0x33')]!=='VIRTUAL'){var _0x21742a={};_0x21742a[_0x37777a[_0x7117('0x2c')]]={'$like':'%'+_0x302f6d[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x21742a;}})});}_0x425a25=_[_0x7117('0x42')]({},_0x425a25,_0x302f6d[_0x7117('0x43')]);var _0xca9ae={'where':_0x425a25[_0x7117('0x3f')]};return db[_0x7117('0x30')]['count'](_0xca9ae)[_0x7117('0x25')](function(_0x4bc8a4){_0x412b1d[_0x7117('0x1f')]=_0x4bc8a4;if(_0x302f6d[_0x7117('0x36')][_0x7117('0x44')]){_0x425a25[_0x7117('0x45')]=[{'all':!![]}];}return db[_0x7117('0x30')][_0x7117('0x46')](_0x425a25);})[_0x7117('0x25')](function(_0x4f3ff0){_0x412b1d[_0x7117('0x47')]=_0x4f3ff0;return _0x412b1d;})[_0x7117('0x25')](respondWithFilteredResult(_0xa04523,_0x425a25))['catch'](handleError(_0xa04523,null));};exports[_0x7117('0x48')]=function(_0xa69ee2,_0x50dfa7){var _0x4f0de8={'raw':![],'where':{'id':_0xa69ee2[_0x7117('0x49')]['id']}},_0x112b47={};_0x112b47[_0x7117('0x35')]=_[_0x7117('0x4a')](db[_0x7117('0x30')][_0x7117('0x31')]);_0x112b47['query']=_[_0x7117('0x4a')](_0xa69ee2[_0x7117('0x36')]);_0x112b47[_0x7117('0x37')]=_['intersection'](_0x112b47[_0x7117('0x35')],_0x112b47[_0x7117('0x36')]);_0x4f0de8[_0x7117('0x39')]=_['intersection'](_0x112b47[_0x7117('0x35')],qs[_0x7117('0x3a')](_0xa69ee2[_0x7117('0x36')]['fields']));_0x4f0de8['attributes']=_0x4f0de8[_0x7117('0x39')][_0x7117('0x3b')]?_0x4f0de8[_0x7117('0x39')]:_0x112b47[_0x7117('0x35')];if(_0xa69ee2[_0x7117('0x36')]['includeAll']){_0x4f0de8['include']=[{'all':!![]}];}_0x4f0de8=_[_0x7117('0x42')]({},_0x4f0de8,_0xa69ee2[_0x7117('0x43')]);return db['Campaign'][_0x7117('0x4b')](_0x4f0de8)['then'](handleEntityNotFound(_0x50dfa7,null))['then'](respondWithResult(_0x50dfa7,null))[_0x7117('0x4c')](handleError(_0x50dfa7,null));};exports['create']=function(_0x33543e,_0x336ac7){return db[_0x7117('0x30')]['create'](_0x33543e[_0x7117('0x4d')],{})[_0x7117('0x25')](function(_0x1d39d3){var _0xcbd125=_0x33543e[_0x7117('0x4e')][_0x7117('0x27')]({'plain':!![]});if(!_0xcbd125)throw new Error(_0x7117('0x4f'));if(_0xcbd125['role']===_0x7117('0x4e')){var _0x161b33=_0x1d39d3[_0x7117('0x27')]({'plain':!![]});var _0x64d8ea=_0x7117('0x28');return db[_0x7117('0x50')][_0x7117('0x4b')]({'where':{'name':_0x64d8ea,'userProfileId':_0xcbd125['userProfileId']},'raw':!![]})[_0x7117('0x25')](function(_0x5e47d0){if(_0x5e47d0&&_0x5e47d0[_0x7117('0x51')]===0x0){return db[_0x7117('0x52')][_0x7117('0x53')]({'name':_0x161b33[_0x7117('0x2c')],'resourceId':_0x161b33['id'],'type':_0x5e47d0[_0x7117('0x2c')],'sectionId':_0x5e47d0['id']},{})['then'](function(){return _0x1d39d3;});}else{return _0x1d39d3;}})['catch'](function(_0x542a73){logger['error'](_0x7117('0x54'),_0x542a73);throw _0x542a73;});}return _0x1d39d3;})['then'](respondWithResult(_0x336ac7,0xc9))['catch'](handleError(_0x336ac7,null));};exports['clone']=function(_0xf35b32,_0x5cd0cd){var _0x2b8cc9={'where':{'id':_0xf35b32[_0x7117('0x49')]['id']}},_0x2f9b08={};_0x2f9b08[_0x7117('0x35')]=_[_0x7117('0x4a')](db[_0x7117('0x30')][_0x7117('0x31')]);_0x2b8cc9[_0x7117('0x39')]=_['intersection'](_0x2f9b08[_0x7117('0x35')],qs['fields'](_0xf35b32['query'][_0x7117('0x3a')]));_0x2b8cc9['attributes']=_0x2b8cc9['attributes'][_0x7117('0x3b')]?_0x2b8cc9[_0x7117('0x39')]:_0x2f9b08[_0x7117('0x35')];if(_0xf35b32['query'][_0x7117('0x44')]){_0x2b8cc9[_0x7117('0x45')]=[{'all':!![]}];}_0x2b8cc9=_[_0x7117('0x42')]({},_0x2b8cc9,_0xf35b32['options']);return db['Campaign'][_0x7117('0x4b')](_0x2b8cc9)[_0x7117('0x25')](handleEntityNotFound(_0x5cd0cd,null))[_0x7117('0x25')](function(_0x1ed9e0){if(_0x1ed9e0){var _0x4e8362=_0x1ed9e0[_0x7117('0x27')]({'plain':!![]});_0x4e8362=qs['omit'](_0x4e8362,['id',_0x7117('0x55'),_0x7117('0x56')]);_0xf35b32[_0x7117('0x4d')]=_[_0x7117('0x57')](_0xf35b32[_0x7117('0x4d')],['id',_0x7117('0x55'),'updatedAt']);return db[_0x7117('0x30')][_0x7117('0x53')](_[_0x7117('0x42')](_0x4e8362,_0xf35b32[_0x7117('0x4d')]),{'include':_0xf35b32['query']['includeAll']?[{'all':!![]}]:undefined})[_0x7117('0x25')](function(_0x46f44b){var _0x55af0d=_0xf35b32[_0x7117('0x4e')][_0x7117('0x27')]({'plain':!![]});if(!_0x55af0d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55af0d[_0x7117('0x58')]===_0x7117('0x4e')){var _0x68a46b=_0x46f44b['get']({'plain':!![]});var _0x41e5df=_0x7117('0x28');return db[_0x7117('0x50')][_0x7117('0x4b')]({'where':{'name':_0x41e5df,'userProfileId':_0x55af0d[_0x7117('0x59')]},'raw':!![]})['then'](function(_0xeb4fad){if(_0xeb4fad&&_0xeb4fad[_0x7117('0x51')]===0x0){return db[_0x7117('0x52')][_0x7117('0x53')]({'name':_0x68a46b[_0x7117('0x2c')],'resourceId':_0x68a46b['id'],'type':_0xeb4fad[_0x7117('0x2c')],'sectionId':_0xeb4fad['id']},{})[_0x7117('0x25')](function(){return _0x46f44b;});}else{return _0x46f44b;}})['catch'](function(_0x1c9c04){logger['error'](_0x7117('0x54'),_0x1c9c04);throw _0x1c9c04;});}return _0x46f44b;});}})[_0x7117('0x25')](respondWithResult(_0x5cd0cd,0xc9))[_0x7117('0x4c')](handleError(_0x5cd0cd,null));};exports[_0x7117('0x24')]=function(_0x1ec9ba,_0xbc1fe5){if(_0x1ec9ba[_0x7117('0x4d')]['id']){delete _0x1ec9ba[_0x7117('0x4d')]['id'];}return db[_0x7117('0x30')][_0x7117('0x4b')]({'where':{'id':_0x1ec9ba[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0xbc1fe5,null))[_0x7117('0x25')](saveUpdates(_0x1ec9ba['body'],null))[_0x7117('0x25')](respondWithResult(_0xbc1fe5,null))[_0x7117('0x4c')](handleError(_0xbc1fe5,null));};exports['destroy']=function(_0x5a4cf0,_0x54f5ff){return db[_0x7117('0x30')]['find']({'where':{'id':_0x5a4cf0[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x54f5ff,null))['then'](removeEntity(_0x54f5ff,null))[_0x7117('0x4c')](handleError(_0x54f5ff,null));};exports[_0x7117('0x5a')]=function(_0x414dc1,_0x1780b8,_0x34758e){var _0x2582a4={'raw':!![],'where':{}};var _0xd3fb4e={};var _0x2d88c8={'count':0x0,'rows':[]};return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x414dc1[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x1780b8,null))['then'](function(_0x38f25d){if(_0x38f25d){_0xd3fb4e['model']=_[_0x7117('0x4a')](db[_0x7117('0x5c')][_0x7117('0x31')]);_0xd3fb4e[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x414dc1[_0x7117('0x36')]);_0xd3fb4e[_0x7117('0x37')]=_[_0x7117('0x38')](_0xd3fb4e[_0x7117('0x35')],_0xd3fb4e[_0x7117('0x36')]);_0x2582a4[_0x7117('0x39')]=_['intersection'](_0xd3fb4e['model'],qs['fields'](_0x414dc1['query'][_0x7117('0x3a')]));_0x2582a4[_0x7117('0x39')]=_0x2582a4[_0x7117('0x39')][_0x7117('0x3b')]?_0x2582a4[_0x7117('0x39')]:_0xd3fb4e[_0x7117('0x35')];if(!_0x414dc1[_0x7117('0x36')][_0x7117('0x5d')](_0x7117('0x3c'))){_0x2582a4[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x414dc1[_0x7117('0x36')]['limit']);_0x2582a4[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0x414dc1['query'][_0x7117('0x1c')]);}_0x2582a4[_0x7117('0x3d')]=qs['sort'](_0x414dc1[_0x7117('0x36')]['sort']);_0x2582a4[_0x7117('0x3f')]=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0x414dc1[_0x7117('0x36')],_0xd3fb4e[_0x7117('0x37')]));_0x2582a4[_0x7117('0x3f')][_0x7117('0x5e')]=_0x38f25d['id'];if(_0x414dc1[_0x7117('0x36')]['filter']){_0x2582a4[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x2582a4[_0x7117('0x3f')],{'$or':_[_0x7117('0x2f')](_0x2582a4[_0x7117('0x39')],function(_0x59dcd1){var _0x7286d2={};_0x7286d2[_0x59dcd1]={'$like':'%'+_0x414dc1[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x7286d2;})});}_0x2582a4=_['merge']({},_0x2582a4,_0x414dc1[_0x7117('0x43')]);return db['CmHopper'][_0x7117('0x1f')]({'where':_0x2582a4[_0x7117('0x3f')]})[_0x7117('0x25')](function(_0x383254){_0x2d88c8['count']=_0x383254;if(_0x414dc1[_0x7117('0x36')][_0x7117('0x44')]){_0x2582a4['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2582a4);})['then'](function(_0x111fb8){_0x2d88c8['rows']=_0x111fb8;return _0x2d88c8;});}})[_0x7117('0x25')](respondWithFilteredResult(_0x1780b8,_0x2582a4))[_0x7117('0x4c')](handleError(_0x1780b8,null));};exports[_0x7117('0x5f')]=function(_0x34bf03,_0x5ec748,_0x2d1ce7){var _0x3d092e={'raw':!![],'where':{}};var _0x12833d={};var _0x48a084={'count':0x0,'rows':[]};return db['Campaign'][_0x7117('0x5b')]({'where':{'id':_0x34bf03[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x5ec748,null))[_0x7117('0x25')](function(_0x5be58c){if(_0x5be58c){_0x12833d[_0x7117('0x35')]=_['keys'](db[_0x7117('0x60')][_0x7117('0x31')]);_0x12833d[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x34bf03[_0x7117('0x36')]);_0x12833d[_0x7117('0x37')]=_['intersection'](_0x12833d[_0x7117('0x35')],_0x12833d[_0x7117('0x36')]);_0x3d092e[_0x7117('0x39')]=_[_0x7117('0x38')](_0x12833d[_0x7117('0x35')],qs[_0x7117('0x3a')](_0x34bf03[_0x7117('0x36')]['fields']));_0x3d092e[_0x7117('0x39')]=_0x3d092e[_0x7117('0x39')]['length']?_0x3d092e['attributes']:_0x12833d[_0x7117('0x35')];if(!_0x34bf03[_0x7117('0x36')][_0x7117('0x5d')]('nolimit')){_0x3d092e[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x34bf03[_0x7117('0x36')][_0x7117('0x1e')]);_0x3d092e['offset']=qs[_0x7117('0x1c')](_0x34bf03[_0x7117('0x36')][_0x7117('0x1c')]);}_0x3d092e['order']=qs[_0x7117('0x3e')](_0x34bf03['query'][_0x7117('0x3e')]);_0x3d092e[_0x7117('0x3f')]=qs[_0x7117('0x37')](_['pick'](_0x34bf03['query'],_0x12833d[_0x7117('0x37')]));_0x3d092e[_0x7117('0x3f')][_0x7117('0x5e')]=_0x5be58c['id'];if(_0x34bf03[_0x7117('0x36')][_0x7117('0x41')]){_0x3d092e[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x3d092e['where'],{'$or':_[_0x7117('0x2f')](_0x3d092e['attributes'],function(_0x529c2f){var _0x171629={};_0x171629[_0x529c2f]={'$like':'%'+_0x34bf03[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x171629;})});}_0x3d092e=_['merge']({},_0x3d092e,_0x34bf03[_0x7117('0x43')]);return db[_0x7117('0x60')][_0x7117('0x1f')]({'where':_0x3d092e['where']})[_0x7117('0x25')](function(_0x2ee189){_0x48a084[_0x7117('0x1f')]=_0x2ee189;if(_0x34bf03[_0x7117('0x36')][_0x7117('0x44')]){_0x3d092e[_0x7117('0x45')]=[{'all':!![]}];}return db[_0x7117('0x60')][_0x7117('0x46')](_0x3d092e);})['then'](function(_0x863a84){_0x48a084[_0x7117('0x47')]=_0x863a84;return _0x48a084;});}})['then'](respondWithFilteredResult(_0x5ec748,_0x3d092e))[_0x7117('0x4c')](handleError(_0x5ec748,null));};exports['getHopperFinals']=function(_0x5a7fa7,_0x295ad5,_0x18e6e2){var _0x34b04a={'raw':!![],'where':{}};var _0x4d504a={};var _0x419327={'count':0x0,'rows':[]};return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x5a7fa7['params']['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x295ad5,null))[_0x7117('0x25')](function(_0x192856){if(_0x192856){_0x4d504a[_0x7117('0x35')]=_[_0x7117('0x4a')](db[_0x7117('0x61')][_0x7117('0x31')]);_0x4d504a[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x5a7fa7[_0x7117('0x36')]);_0x4d504a[_0x7117('0x37')]=_[_0x7117('0x38')](_0x4d504a[_0x7117('0x35')],_0x4d504a[_0x7117('0x36')]);_0x34b04a[_0x7117('0x39')]=_['intersection'](_0x4d504a['model'],qs[_0x7117('0x3a')](_0x5a7fa7[_0x7117('0x36')]['fields']));_0x34b04a[_0x7117('0x39')]=_0x34b04a['attributes'][_0x7117('0x3b')]?_0x34b04a[_0x7117('0x39')]:_0x4d504a[_0x7117('0x35')];if(!_0x5a7fa7[_0x7117('0x36')][_0x7117('0x5d')]('nolimit')){_0x34b04a[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x5a7fa7['query'][_0x7117('0x1e')]);_0x34b04a[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0x5a7fa7[_0x7117('0x36')][_0x7117('0x1c')]);}_0x34b04a[_0x7117('0x3d')]=qs['sort'](_0x5a7fa7[_0x7117('0x36')]['sort']);_0x34b04a[_0x7117('0x3f')]=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0x5a7fa7[_0x7117('0x36')],_0x4d504a[_0x7117('0x37')]));_0x34b04a['where']['CampaignId']=_0x192856['id'];if(_0x5a7fa7[_0x7117('0x36')]['filter']){_0x34b04a[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x34b04a['where'],{'$or':_[_0x7117('0x2f')](_0x34b04a[_0x7117('0x39')],function(_0x4d957c){var _0x23470d={};_0x23470d[_0x4d957c]={'$like':'%'+_0x5a7fa7[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x23470d;})});}_0x34b04a=_[_0x7117('0x42')]({},_0x34b04a,_0x5a7fa7[_0x7117('0x43')]);return db[_0x7117('0x61')][_0x7117('0x1f')]({'where':_0x34b04a[_0x7117('0x3f')]})['then'](function(_0x5ded33){_0x419327[_0x7117('0x1f')]=_0x5ded33;if(_0x5a7fa7['query'][_0x7117('0x44')]){_0x34b04a[_0x7117('0x45')]=[{'all':!![]}];}return db[_0x7117('0x61')][_0x7117('0x46')](_0x34b04a);})['then'](function(_0x2faa93){_0x419327[_0x7117('0x47')]=_0x2faa93;return _0x419327;});}})[_0x7117('0x25')](respondWithFilteredResult(_0x295ad5,_0x34b04a))[_0x7117('0x4c')](handleError(_0x295ad5,null));};exports[_0x7117('0x62')]=function(_0x328412,_0x2c1ca5,_0x1f3821){var _0x3fdb3b={'raw':!![],'where':{}};var _0x590c9f={};var _0x56bc40={'count':0x0,'rows':[]};return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x328412[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x2c1ca5,null))['then'](function(_0x1f78b4){if(_0x1f78b4){_0x590c9f['model']=_['keys'](db[_0x7117('0x63')]['rawAttributes']);_0x590c9f[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x328412['query']);_0x590c9f['filters']=_[_0x7117('0x38')](_0x590c9f[_0x7117('0x35')],_0x590c9f[_0x7117('0x36')]);_0x3fdb3b['attributes']=_[_0x7117('0x38')](_0x590c9f[_0x7117('0x35')],qs[_0x7117('0x3a')](_0x328412['query'][_0x7117('0x3a')]));_0x3fdb3b[_0x7117('0x39')]=_0x3fdb3b[_0x7117('0x39')][_0x7117('0x3b')]?_0x3fdb3b[_0x7117('0x39')]:_0x590c9f[_0x7117('0x35')];if(!_0x328412[_0x7117('0x36')][_0x7117('0x5d')]('nolimit')){_0x3fdb3b[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x328412[_0x7117('0x36')][_0x7117('0x1e')]);_0x3fdb3b['offset']=qs['offset'](_0x328412[_0x7117('0x36')][_0x7117('0x1c')]);}_0x3fdb3b[_0x7117('0x3d')]=qs[_0x7117('0x3e')](_0x328412[_0x7117('0x36')][_0x7117('0x3e')]);_0x3fdb3b[_0x7117('0x3f')]=qs[_0x7117('0x37')](_['pick'](_0x328412['query'],_0x590c9f[_0x7117('0x37')]));_0x3fdb3b[_0x7117('0x3f')][_0x7117('0x5e')]=_0x1f78b4['id'];if(_0x328412['query'][_0x7117('0x41')]){_0x3fdb3b[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x3fdb3b['where'],{'$or':_[_0x7117('0x2f')](_0x3fdb3b[_0x7117('0x39')],function(_0x327061){var _0x209a97={};_0x209a97[_0x327061]={'$like':'%'+_0x328412[_0x7117('0x36')]['filter']+'%'};return _0x209a97;})});}_0x3fdb3b=_['merge']({},_0x3fdb3b,_0x328412[_0x7117('0x43')]);return db['CmHopperBlack'][_0x7117('0x1f')]({'where':_0x3fdb3b[_0x7117('0x3f')]})['then'](function(_0xd0e8da){_0x56bc40[_0x7117('0x1f')]=_0xd0e8da;if(_0x328412[_0x7117('0x36')][_0x7117('0x44')]){_0x3fdb3b['include']=[{'all':!![]}];}return db[_0x7117('0x63')][_0x7117('0x46')](_0x3fdb3b);})[_0x7117('0x25')](function(_0x38bcdb){_0x56bc40['rows']=_0x38bcdb;return _0x56bc40;});}})['then'](respondWithFilteredResult(_0x2c1ca5,_0x3fdb3b))[_0x7117('0x4c')](handleError(_0x2c1ca5,null));};exports['getLists']=function(_0xdf403e,_0x3d9739,_0x435291){var _0x396574={};var _0x3fa435={};var _0x46d47f;var _0x5e869e;return db['Campaign'][_0x7117('0x5b')]({'where':{'id':_0xdf403e['params']['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x3d9739,null))['then'](function(_0x499c05){if(_0x499c05){_0x46d47f=_0x499c05;_0x3fa435['model']=_[_0x7117('0x4a')](db[_0x7117('0x64')][_0x7117('0x31')]);_0x3fa435[_0x7117('0x36')]=_['keys'](_0xdf403e[_0x7117('0x36')]);_0x3fa435[_0x7117('0x37')]=_[_0x7117('0x38')](_0x3fa435[_0x7117('0x35')],_0x3fa435[_0x7117('0x36')]);_0x396574['attributes']=_[_0x7117('0x38')](_0x3fa435[_0x7117('0x35')],qs[_0x7117('0x3a')](_0xdf403e[_0x7117('0x36')][_0x7117('0x3a')]));_0x396574['attributes']=_0x396574['attributes'][_0x7117('0x3b')]?_0x396574[_0x7117('0x39')]:_0x3fa435[_0x7117('0x35')];_0x396574[_0x7117('0x3d')]=qs['sort'](_0xdf403e['query']['sort']);_0x396574['where']=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0xdf403e['query'],_0x3fa435[_0x7117('0x37')]));if(_0xdf403e[_0x7117('0x36')][_0x7117('0x41')]){_0x396574[_0x7117('0x3f')]=_['merge'](_0x396574[_0x7117('0x3f')],{'$or':_[_0x7117('0x2f')](_0x396574[_0x7117('0x39')],function(_0x4256e2){var _0x133de3={};_0x133de3[_0x4256e2]={'$like':'%'+_0xdf403e['query']['filter']+'%'};return _0x133de3;})});}_0x396574=_['merge']({},_0x396574,_0xdf403e[_0x7117('0x43')]);return _0x46d47f['getLists'](_0x396574);}})[_0x7117('0x25')](function(_0x43568f){if(_0x43568f){_0x5e869e=_0x43568f[_0x7117('0x3b')];if(!_0xdf403e['query']['hasOwnProperty']('nolimit')){_0x396574[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0xdf403e['query'][_0x7117('0x1e')]);_0x396574[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0xdf403e[_0x7117('0x36')][_0x7117('0x1c')]);}return _0x46d47f['getLists'](_0x396574);}})[_0x7117('0x25')](function(_0x14221a){if(_0x14221a){return _0x14221a?{'count':_0x5e869e,'rows':_0x14221a}:null;}})['then'](respondWithResult(_0x3d9739,null))[_0x7117('0x4c')](handleError(_0x3d9739,null));};exports[_0x7117('0x65')]=function(_0x4b7f02,_0x23a2fc,_0x1e20e0){var _0x2250df,_0x1637b5;var _0x437abe=[];var _0x2a6ec9=moment()[_0x7117('0x66')](_0x7117('0x67'));return db[_0x7117('0x30')]['find']({'where':{'id':_0x4b7f02[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x23a2fc,null))['then'](function(_0x3d823f){if(_0x3d823f){_0x1637b5=_0x3d823f;return _0x3d823f[_0x7117('0x65')](_0x4b7f02[_0x7117('0x4d')][_0x7117('0x68')],_[_0x7117('0x57')](_0x4b7f02[_0x7117('0x4d')],['ids','id'])||{});}return null;})['spread'](function(_0x498516){var _0x386c59;var _0x3a2d47;_0x2250df=_0x498516||[];var _0x156fa3=[];if(_0x498516){for(var _0x585761=0x0;_0x585761<_0x498516[_0x7117('0x3b')];_0x585761+=0x1){var _0x565d20=_0x498516[_0x585761][_0x7117('0x27')]({'plain':!![]});_0x1637b5['dialCheckDuplicateType']=_0x4b7f02['body']['dialCheckDuplicateType']?_0x4b7f02['body'][_0x7117('0x69')]:_0x1637b5[_0x7117('0x69')];switch(_0x1637b5[_0x7117('0x69')]){case _0x7117('0x6a'):_0x386c59=squel['insert']()[_0x7117('0x6b')](_0x7117('0x6c'))[_0x7117('0x6d')]([_0x7117('0x6e'),_0x7117('0x6f'),_0x7117('0x70'),_0x7117('0x71'),_0x7117('0x5e'),'createdAt','updatedAt'],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x6e'),_0x7117('0x6e'))[_0x7117('0x73')]('NOW()',_0x7117('0x6f'))[_0x7117('0x73')]('id',_0x7117('0x70'))[_0x7117('0x73')](_0x565d20[_0x7117('0x74')][_0x7117('0x75')](),_0x7117('0x71'))[_0x7117('0x73')](_0x4b7f02[_0x7117('0x49')]['id'][_0x7117('0x75')](),_0x7117('0x5e'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x55'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x56'))[_0x7117('0x76')](_0x7117('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x7117('0x3f')](_0x7117('0x78'),_0x565d20['CmListId'][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x79'))[_0x7117('0x3f')](_0x7117('0x7a'),squel[_0x7117('0x72')]()[_0x7117('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x7117('0x7b'))[_0x7117('0x3f')](_0x7117('0x7c'),_0x4b7f02['params']['id'][_0x7117('0x75')]()))[_0x7117('0x3f')](_0x7117('0x7a'),squel[_0x7117('0x72')]()[_0x7117('0x73')]('COALESCE(phone,\x27\x27)')[_0x7117('0x76')](_0x7117('0x6c'))[_0x7117('0x3f')](_0x7117('0x7c'),_0x4b7f02[_0x7117('0x49')]['id']['toString']())))['toString']();break;case _0x7117('0x7d'):_0x386c59=squel['insert']()[_0x7117('0x6b')]('cm_hopper')['fromQuery']([_0x7117('0x6e'),_0x7117('0x6f'),_0x7117('0x70'),_0x7117('0x71'),_0x7117('0x5e'),'createdAt','updatedAt'],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x6e'),_0x7117('0x6e'))[_0x7117('0x73')]('NOW()',_0x7117('0x6f'))[_0x7117('0x73')]('id','ContactId')[_0x7117('0x73')](_0x565d20[_0x7117('0x74')][_0x7117('0x75')](),_0x7117('0x71'))[_0x7117('0x73')](_0x4b7f02[_0x7117('0x49')]['id'][_0x7117('0x75')](),_0x7117('0x5e'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x55'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27','updatedAt')[_0x7117('0x76')](_0x7117('0x77'))[_0x7117('0x3f')](_0x7117('0x7e'))[_0x7117('0x3f')](_0x7117('0x78'),_0x565d20[_0x7117('0x74')][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x79'))[_0x7117('0x3f')](_0x7117('0x7a'),squel[_0x7117('0x72')]()[_0x7117('0x73')]('COALESCE(phone,\x27\x27)')['from'](_0x7117('0x6c'))[_0x7117('0x3f')]('CampaignId\x20=\x20?',_0x4b7f02['params']['id'][_0x7117('0x75')]())))[_0x7117('0x75')]();break;default:_0x386c59=squel['insert']()['into'](_0x7117('0x6c'))[_0x7117('0x6d')]([_0x7117('0x6e'),'scheduledAt',_0x7117('0x70'),'ListId','CampaignId',_0x7117('0x55'),_0x7117('0x56')],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x6e'),_0x7117('0x6e'))['field'](_0x7117('0x7f'),_0x7117('0x6f'))[_0x7117('0x73')]('id',_0x7117('0x70'))[_0x7117('0x73')](_0x565d20[_0x7117('0x74')][_0x7117('0x75')](),_0x7117('0x71'))[_0x7117('0x73')](_0x4b7f02['params']['id']['toString'](),_0x7117('0x5e'))['field']('\x27'+_0x2a6ec9+'\x27','createdAt')[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x56'))[_0x7117('0x76')](_0x7117('0x77'))[_0x7117('0x3f')](_0x7117('0x7e'))['where'](_0x7117('0x78'),_0x565d20[_0x7117('0x74')][_0x7117('0x75')]())['where'](_0x7117('0x79')))[_0x7117('0x75')]();}_0x3a2d47=squel[_0x7117('0x80')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x7117('0x81'),_0x7117('0x6f'),_0x7117('0x6e'),_0x7117('0x82'),'createdAt',_0x7117('0x56')],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x83'),'id')[_0x7117('0x73')](_0x7117('0x7f'),'scheduledAt')[_0x7117('0x73')](_0x7117('0x84'),'phone')['field'](_0x7117('0x85'),_0x7117('0x82'))['field']('\x27'+_0x2a6ec9+'\x27','createdAt')[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x56'))[_0x7117('0x76')]('cm_contact_has_items','ci')[_0x7117('0x86')](_0x7117('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x7117('0x3f')](_0x7117('0x87'),_0x565d20[_0x7117('0x74')][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x88'),_0x4b7f02['params']['id'][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x89'),_0x2a6ec9))[_0x7117('0x75')]();_0x156fa3[_0x7117('0x8a')](db[_0x7117('0x8b')][_0x7117('0x36')](_0x386c59));_0x437abe[_0x7117('0x8a')](db['sequelize'][_0x7117('0x36')](_0x3a2d47));}return BPromise[_0x7117('0x8c')](_0x156fa3);}})['then'](function(){return BPromise[_0x7117('0x8c')](_0x437abe);})[_0x7117('0x25')](function(){return _0x2250df;})[_0x7117('0x25')](respondWithResult(_0x23a2fc,null))[_0x7117('0x4c')](handleError(_0x23a2fc,null));};exports[_0x7117('0x8d')]=function(_0x38928e,_0x5e449d,_0x5aec8f){return db[_0x7117('0x30')][_0x7117('0x4b')]({'where':{'id':_0x38928e[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x5e449d,null))['then'](function(_0x2e0eb7){if(_0x2e0eb7){return _0x2e0eb7[_0x7117('0x8d')](_0x38928e[_0x7117('0x36')][_0x7117('0x68')]);}})[_0x7117('0x25')](function(_0xb95f8d){if(_0xb95f8d){return db[_0x7117('0x5c')][_0x7117('0x26')]({'where':{'ListId':_0x38928e[_0x7117('0x36')][_0x7117('0x68')],'CampaignId':_0x38928e[_0x7117('0x49')]['id']}})[_0x7117('0x25')](function(){return _0xb95f8d;});}})[_0x7117('0x25')](respondWithStatusCode(_0x5e449d,null))[_0x7117('0x4c')](handleError(_0x5e449d,null));};exports[_0x7117('0x8e')]=function(_0x469f70,_0x972e2b,_0x5c306c){var _0x49f531={};var _0x320be5={};var _0x5478a5;var _0x2cc047;return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x469f70[_0x7117('0x49')]['id']}})['then'](handleEntityNotFound(_0x972e2b,null))[_0x7117('0x25')](function(_0x512f11){if(_0x512f11){_0x5478a5=_0x512f11;_0x320be5[_0x7117('0x35')]=_[_0x7117('0x4a')](db['CmList']['rawAttributes']);_0x320be5[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x469f70[_0x7117('0x36')]);_0x320be5[_0x7117('0x37')]=_[_0x7117('0x38')](_0x320be5['model'],_0x320be5[_0x7117('0x36')]);_0x49f531[_0x7117('0x39')]=_[_0x7117('0x38')](_0x320be5[_0x7117('0x35')],qs[_0x7117('0x3a')](_0x469f70[_0x7117('0x36')]['fields']));_0x49f531[_0x7117('0x39')]=_0x49f531[_0x7117('0x39')]['length']?_0x49f531['attributes']:_0x320be5[_0x7117('0x35')];_0x49f531['order']=qs[_0x7117('0x3e')](_0x469f70['query'][_0x7117('0x3e')]);_0x49f531['where']=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0x469f70[_0x7117('0x36')],_0x320be5[_0x7117('0x37')]));if(_0x469f70[_0x7117('0x36')][_0x7117('0x41')]){_0x49f531[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x49f531['where'],{'$or':_['map'](_0x49f531[_0x7117('0x39')],function(_0xe755b3){var _0x1a2786={};_0x1a2786[_0xe755b3]={'$like':'%'+_0x469f70[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x1a2786;})});}_0x49f531=_[_0x7117('0x42')]({},_0x49f531,_0x469f70['options']);return _0x5478a5[_0x7117('0x8e')](_0x49f531);}})[_0x7117('0x25')](function(_0x3f136d){if(_0x3f136d){_0x2cc047=_0x3f136d['length'];if(!_0x469f70[_0x7117('0x36')]['hasOwnProperty'](_0x7117('0x3c'))){_0x49f531[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x469f70[_0x7117('0x36')][_0x7117('0x1e')]);_0x49f531[_0x7117('0x1c')]=qs['offset'](_0x469f70[_0x7117('0x36')]['offset']);}return _0x5478a5['getBlackLists'](_0x49f531);}})['then'](function(_0x49efe6){if(_0x49efe6){return _0x49efe6?{'count':_0x2cc047,'rows':_0x49efe6}:null;}})[_0x7117('0x25')](respondWithResult(_0x972e2b,null))[_0x7117('0x4c')](handleError(_0x972e2b,null));};exports[_0x7117('0x8f')]=function(_0x240d7f,_0x54a799,_0x2297f1){var _0x555f49,_0x270ba1;var _0x4ebbe8=[];var _0x1c4a08=moment()[_0x7117('0x66')](_0x7117('0x67'));return db[_0x7117('0x30')]['find']({'where':{'id':_0x240d7f[_0x7117('0x49')]['id']}})['then'](handleEntityNotFound(_0x54a799,null))['then'](function(_0x49692e){if(_0x49692e){_0x270ba1=_0x49692e;return _0x49692e[_0x7117('0x8f')](_0x240d7f[_0x7117('0x4d')][_0x7117('0x68')],_[_0x7117('0x57')](_0x240d7f[_0x7117('0x4d')],[_0x7117('0x68'),'id'])||{});}return null;})['spread'](function(_0x4129a5){var _0x543c43;var _0xc587a0;_0x555f49=_0x4129a5||[];var _0x4504b2=[];if(_0x4129a5){for(var _0x36b8f8=0x0;_0x36b8f8<_0x4129a5[_0x7117('0x3b')];_0x36b8f8+=0x1){var _0x997b00=_0x4129a5[_0x36b8f8][_0x7117('0x27')]({'plain':!![]});_0x543c43=squel['insert']()[_0x7117('0x6b')]('cm_hopper_black')['fromQuery']([_0x7117('0x6e'),'ContactId',_0x7117('0x71'),_0x7117('0x5e'),'createdAt',_0x7117('0x56')],squel[_0x7117('0x72')]()[_0x7117('0x73')]('phone','phone')['field']('id',_0x7117('0x70'))[_0x7117('0x73')](_0x997b00['CmListId'][_0x7117('0x75')](),'ListId')['field'](_0x240d7f[_0x7117('0x49')]['id'][_0x7117('0x75')](),_0x7117('0x5e'))[_0x7117('0x73')](_0x7117('0x7f'),_0x7117('0x55'))[_0x7117('0x73')](_0x7117('0x7f'),'updatedAt')['from'](_0x7117('0x77'))['where'](_0x7117('0x7e'))[_0x7117('0x3f')](_0x7117('0x78'),_0x997b00['CmListId']['toString']())[_0x7117('0x3f')](_0x7117('0x79')))['toString']();_0x4504b2[_0x7117('0x8a')](db[_0x7117('0x8b')][_0x7117('0x36')](_0x543c43));}return BPromise[_0x7117('0x8c')](_0x4504b2);}})[_0x7117('0x25')](function(){return _0x555f49;})['then'](respondWithResult(_0x54a799,null))['catch'](handleError(_0x54a799,null));};exports['removeBlackLists']=function(_0x93ac5b,_0x18d998,_0x4c8118){return db[_0x7117('0x30')]['find']({'where':{'id':_0x93ac5b[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x18d998,null))['then'](function(_0x23662a){if(_0x23662a){return _0x23662a['removeBlackLists'](_0x93ac5b['query'][_0x7117('0x68')]);}})[_0x7117('0x25')](function(_0x59dccc){if(_0x59dccc){return db[_0x7117('0x63')][_0x7117('0x26')]({'where':{'ListId':_0x93ac5b[_0x7117('0x36')][_0x7117('0x68')],'CampaignId':_0x93ac5b[_0x7117('0x49')]['id']}})[_0x7117('0x25')](function(){return _0x59dccc;});}})['then'](respondWithStatusCode(_0x18d998,null))[_0x7117('0x4c')](handleError(_0x18d998,null));}; \ No newline at end of file +var _0x13f6=['ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','error','send','index','map','Campaign','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','get','UserProfileSection','userProfileId','UserProfileResource','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','pick','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x13f6,0x124));var _0x613f=function(_0x4c17fb,_0x1d38be){_0x4c17fb=_0x4c17fb-0x0;var _0x4ac2af=_0x13f6[_0x4c17fb];return _0x4ac2af;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){var _0x3013a1=_0x33e0c6['get']({'plain':!![]});var _0x30fb15=_0x613f('0x25');return db['UserProfileResource'][_0x613f('0x24')]({'where':{'type':_0x30fb15,'resourceId':_0x3013a1['id']}})[_0x613f('0x23')](function(){return _0x33e0c6;});})[_0x613f('0x23')](function(){_0x51f376['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4a8b,_0x379920){return function(_0x594c28){if(!_0x594c28){_0x5a4a8b[_0x613f('0x16')](0x194);}return _0x594c28;};}function handleError(_0x1767db,_0x4ca372){_0x4ca372=_0x4ca372||0x1f4;return function(_0x121241){logger[_0x613f('0x26')](_0x121241['stack']);if(_0x121241['name']){delete _0x121241['name'];}_0x1767db[_0x613f('0x17')](_0x4ca372)[_0x613f('0x27')](_0x121241);};}exports[_0x613f('0x28')]=function(_0x47f4af,_0x23eda8){var _0x439478={},_0xd335a6={},_0x19bb8f={'count':0x0,'rows':[]};var _0x4f8500=_[_0x613f('0x29')](db[_0x613f('0x2a')][_0x613f('0x2b')],function(_0x728f45){return{'name':_0x728f45[_0x613f('0x2c')],'type':_0x728f45[_0x613f('0x2d')]['key']};});_0xd335a6[_0x613f('0x2e')]=_[_0x613f('0x29')](_0x4f8500,_0x613f('0x2f'));_0xd335a6['query']=_[_0x613f('0x30')](_0x47f4af['query']);_0xd335a6[_0x613f('0x31')]=_[_0x613f('0x32')](_0xd335a6[_0x613f('0x2e')],_0xd335a6[_0x613f('0x33')]);_0x439478[_0x613f('0x34')]=_[_0x613f('0x32')](_0xd335a6['model'],qs[_0x613f('0x35')](_0x47f4af[_0x613f('0x33')][_0x613f('0x35')]));_0x439478[_0x613f('0x34')]=_0x439478[_0x613f('0x34')]['length']?_0x439478['attributes']:_0xd335a6['model'];if(!_0x47f4af[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x439478[_0x613f('0x1a')]=qs['limit'](_0x47f4af[_0x613f('0x33')][_0x613f('0x1a')]);_0x439478['offset']=qs[_0x613f('0x1d')](_0x47f4af['query'][_0x613f('0x1d')]);}_0x439478['order']=qs[_0x613f('0x38')](_0x47f4af['query'][_0x613f('0x38')]);_0x439478[_0x613f('0x39')]=qs[_0x613f('0x31')](_['pick'](_0x47f4af[_0x613f('0x33')],_0xd335a6[_0x613f('0x31')]),_0x4f8500);if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]){_0x439478[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x439478[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x4f8500,function(_0x1f71f3){if(_0x1f71f3[_0x613f('0x2d')]!=='VIRTUAL'){var _0x28b1bc={};_0x28b1bc[_0x1f71f3[_0x613f('0x2f')]]={'$like':'%'+_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x28b1bc;}})});}_0x439478=_[_0x613f('0x3b')]({},_0x439478,_0x47f4af[_0x613f('0x3c')]);var _0xa76fff={'where':_0x439478['where']};return db[_0x613f('0x2a')][_0x613f('0x1c')](_0xa76fff)[_0x613f('0x23')](function(_0x3d2d7b){_0x19bb8f[_0x613f('0x1c')]=_0x3d2d7b;if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3d')]){_0x439478['include']=[{'all':!![]}];}return db[_0x613f('0x2a')][_0x613f('0x3e')](_0x439478);})[_0x613f('0x23')](function(_0x2f584e){_0x19bb8f[_0x613f('0x3f')]=_0x2f584e;return _0x19bb8f;})[_0x613f('0x23')](respondWithFilteredResult(_0x23eda8,_0x439478))[_0x613f('0x40')](handleError(_0x23eda8,null));};exports[_0x613f('0x41')]=function(_0x403feb,_0x2d2574){var _0x12647a={'raw':![],'where':{'id':_0x403feb[_0x613f('0x42')]['id']}},_0x258a71={};_0x258a71['model']=_[_0x613f('0x30')](db[_0x613f('0x2a')][_0x613f('0x2b')]);_0x258a71[_0x613f('0x33')]=_['keys'](_0x403feb[_0x613f('0x33')]);_0x258a71[_0x613f('0x31')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],_0x258a71[_0x613f('0x33')]);_0x12647a[_0x613f('0x34')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x403feb[_0x613f('0x33')]['fields']));_0x12647a['attributes']=_0x12647a[_0x613f('0x34')][_0x613f('0x43')]?_0x12647a['attributes']:_0x258a71[_0x613f('0x2e')];if(_0x403feb[_0x613f('0x33')][_0x613f('0x3d')]){_0x12647a[_0x613f('0x44')]=[{'all':!![]}];}_0x12647a=_[_0x613f('0x3b')]({},_0x12647a,_0x403feb[_0x613f('0x3c')]);return db[_0x613f('0x2a')][_0x613f('0x45')](_0x12647a)[_0x613f('0x23')](handleEntityNotFound(_0x2d2574,null))[_0x613f('0x23')](respondWithResult(_0x2d2574,null))[_0x613f('0x40')](handleError(_0x2d2574,null));};exports[_0x613f('0x46')]=function(_0x174e22,_0x17f8e5){return db[_0x613f('0x2a')][_0x613f('0x46')](_0x174e22[_0x613f('0x47')],{})[_0x613f('0x23')](function(_0x5a4079){var _0x47c84b=_0x174e22[_0x613f('0x48')][_0x613f('0x49')]({'plain':!![]});if(!_0x47c84b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c84b['role']===_0x613f('0x48')){var _0x51729a=_0x5a4079['get']({'plain':!![]});var _0x6e006b=_0x613f('0x25');return db[_0x613f('0x4a')]['find']({'where':{'name':_0x6e006b,'userProfileId':_0x47c84b[_0x613f('0x4b')]},'raw':!![]})[_0x613f('0x23')](function(_0x4f59b6){if(_0x4f59b6&&_0x4f59b6['autoAssociation']===0x0){return db[_0x613f('0x4c')][_0x613f('0x46')]({'name':_0x51729a[_0x613f('0x2f')],'resourceId':_0x51729a['id'],'type':_0x4f59b6[_0x613f('0x2f')],'sectionId':_0x4f59b6['id']},{})[_0x613f('0x23')](function(){return _0x5a4079;});}else{return _0x5a4079;}})[_0x613f('0x40')](function(_0x24d162){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24d162);throw _0x24d162;});}return _0x5a4079;})[_0x613f('0x23')](respondWithResult(_0x17f8e5,0xc9))['catch'](handleError(_0x17f8e5,null));};exports['clone']=function(_0x387913,_0x52c2a6){var _0x13e3a4={'where':{'id':_0x387913[_0x613f('0x42')]['id']}},_0x59d6bb={};_0x59d6bb[_0x613f('0x2e')]=_[_0x613f('0x30')](db[_0x613f('0x2a')][_0x613f('0x2b')]);_0x13e3a4[_0x613f('0x34')]=_[_0x613f('0x32')](_0x59d6bb['model'],qs[_0x613f('0x35')](_0x387913['query'][_0x613f('0x35')]));_0x13e3a4[_0x613f('0x34')]=_0x13e3a4[_0x613f('0x34')][_0x613f('0x43')]?_0x13e3a4[_0x613f('0x34')]:_0x59d6bb[_0x613f('0x2e')];if(_0x387913[_0x613f('0x33')][_0x613f('0x3d')]){_0x13e3a4[_0x613f('0x44')]=[{'all':!![]}];}_0x13e3a4=_[_0x613f('0x3b')]({},_0x13e3a4,_0x387913[_0x613f('0x3c')]);return db[_0x613f('0x2a')][_0x613f('0x45')](_0x13e3a4)['then'](handleEntityNotFound(_0x52c2a6,null))['then'](function(_0x687e56){if(_0x687e56){var _0x4b6eb3=_0x687e56[_0x613f('0x49')]({'plain':!![]});_0x4b6eb3=qs[_0x613f('0x4d')](_0x4b6eb3,['id',_0x613f('0x4e'),_0x613f('0x4f')]);_0x387913[_0x613f('0x47')]=_[_0x613f('0x4d')](_0x387913[_0x613f('0x47')],['id',_0x613f('0x4e'),_0x613f('0x4f')]);return db[_0x613f('0x2a')][_0x613f('0x46')](_['merge'](_0x4b6eb3,_0x387913[_0x613f('0x47')]),{'include':_0x387913[_0x613f('0x33')][_0x613f('0x3d')]?[{'all':!![]}]:undefined})[_0x613f('0x23')](function(_0x5a3ea1){var _0xacca40=_0x387913[_0x613f('0x48')]['get']({'plain':!![]});if(!_0xacca40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xacca40[_0x613f('0x50')]==='user'){var _0x50ad7d=_0x5a3ea1['get']({'plain':!![]});var _0x1a1ef2='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x1a1ef2,'userProfileId':_0xacca40[_0x613f('0x4b')]},'raw':!![]})[_0x613f('0x23')](function(_0x5bf4ce){if(_0x5bf4ce&&_0x5bf4ce[_0x613f('0x51')]===0x0){return db[_0x613f('0x4c')][_0x613f('0x46')]({'name':_0x50ad7d[_0x613f('0x2f')],'resourceId':_0x50ad7d['id'],'type':_0x5bf4ce['name'],'sectionId':_0x5bf4ce['id']},{})[_0x613f('0x23')](function(){return _0x5a3ea1;});}else{return _0x5a3ea1;}})[_0x613f('0x40')](function(_0x5d0ab7){logger[_0x613f('0x26')](_0x613f('0x52'),_0x5d0ab7);throw _0x5d0ab7;});}return _0x5a3ea1;});}})[_0x613f('0x23')](respondWithResult(_0x52c2a6,0xc9))[_0x613f('0x40')](handleError(_0x52c2a6,null));};exports[_0x613f('0x22')]=function(_0xdf8993,_0xbead7c){if(_0xdf8993[_0x613f('0x47')]['id']){delete _0xdf8993[_0x613f('0x47')]['id'];}return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0xdf8993[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0xbead7c,null))[_0x613f('0x23')](saveUpdates(_0xdf8993[_0x613f('0x47')],null))[_0x613f('0x23')](respondWithResult(_0xbead7c,null))[_0x613f('0x40')](handleError(_0xbead7c,null));};exports[_0x613f('0x24')]=function(_0x2d9b65,_0x4e2002){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x2d9b65[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x4e2002,null))[_0x613f('0x23')](removeEntity(_0x4e2002,null))[_0x613f('0x40')](handleError(_0x4e2002,null));};exports['getHoppers']=function(_0x4efc80,_0x42282a,_0x25a550){var _0x7706c7={'raw':!![],'where':{}};var _0xddcd6={};var _0x4f28c7={'count':0x0,'rows':[]};return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x4efc80[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x42282a,null))['then'](function(_0x282a9f){if(_0x282a9f){_0xddcd6[_0x613f('0x2e')]=_[_0x613f('0x30')](db[_0x613f('0x54')][_0x613f('0x2b')]);_0xddcd6[_0x613f('0x33')]=_[_0x613f('0x30')](_0x4efc80[_0x613f('0x33')]);_0xddcd6['filters']=_[_0x613f('0x32')](_0xddcd6[_0x613f('0x2e')],_0xddcd6[_0x613f('0x33')]);_0x7706c7[_0x613f('0x34')]=_[_0x613f('0x32')](_0xddcd6[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x4efc80[_0x613f('0x33')][_0x613f('0x35')]));_0x7706c7[_0x613f('0x34')]=_0x7706c7['attributes'][_0x613f('0x43')]?_0x7706c7[_0x613f('0x34')]:_0xddcd6[_0x613f('0x2e')];if(!_0x4efc80[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x7706c7[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x4efc80[_0x613f('0x33')][_0x613f('0x1a')]);_0x7706c7[_0x613f('0x1d')]=qs['offset'](_0x4efc80[_0x613f('0x33')][_0x613f('0x1d')]);}_0x7706c7[_0x613f('0x55')]=qs[_0x613f('0x38')](_0x4efc80[_0x613f('0x33')][_0x613f('0x38')]);_0x7706c7[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x4efc80[_0x613f('0x33')],_0xddcd6[_0x613f('0x31')]));_0x7706c7[_0x613f('0x39')]['CampaignId']=_0x282a9f['id'];if(_0x4efc80[_0x613f('0x33')][_0x613f('0x3a')]){_0x7706c7['where']=_[_0x613f('0x3b')](_0x7706c7['where'],{'$or':_[_0x613f('0x29')](_0x7706c7['attributes'],function(_0x49cb13){var _0x2587ad={};_0x2587ad[_0x49cb13]={'$like':'%'+_0x4efc80[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x2587ad;})});}_0x7706c7=_[_0x613f('0x3b')]({},_0x7706c7,_0x4efc80[_0x613f('0x3c')]);return db[_0x613f('0x54')][_0x613f('0x1c')]({'where':_0x7706c7['where']})[_0x613f('0x23')](function(_0x45cf0a){_0x4f28c7[_0x613f('0x1c')]=_0x45cf0a;if(_0x4efc80[_0x613f('0x33')][_0x613f('0x3d')]){_0x7706c7['include']=[{'all':!![]}];}return db[_0x613f('0x54')][_0x613f('0x3e')](_0x7706c7);})['then'](function(_0x188be6){_0x4f28c7[_0x613f('0x3f')]=_0x188be6;return _0x4f28c7;});}})[_0x613f('0x23')](respondWithFilteredResult(_0x42282a,_0x7706c7))['catch'](handleError(_0x42282a,null));};exports['getHopperHistories']=function(_0x5605c9,_0x39ae92,_0x34a375){var _0x574ec4={'raw':!![],'where':{}};var _0x23e150={};var _0x13ae55={'count':0x0,'rows':[]};return db[_0x613f('0x2a')]['findOne']({'where':{'id':_0x5605c9[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0x39ae92,null))[_0x613f('0x23')](function(_0x537763){if(_0x537763){_0x23e150['model']=_[_0x613f('0x30')](db[_0x613f('0x57')][_0x613f('0x2b')]);_0x23e150[_0x613f('0x33')]=_[_0x613f('0x30')](_0x5605c9[_0x613f('0x33')]);_0x23e150[_0x613f('0x31')]=_[_0x613f('0x32')](_0x23e150[_0x613f('0x2e')],_0x23e150[_0x613f('0x33')]);_0x574ec4[_0x613f('0x34')]=_['intersection'](_0x23e150[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x5605c9[_0x613f('0x33')][_0x613f('0x35')]));_0x574ec4[_0x613f('0x34')]=_0x574ec4[_0x613f('0x34')][_0x613f('0x43')]?_0x574ec4['attributes']:_0x23e150[_0x613f('0x2e')];if(!_0x5605c9[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x574ec4['limit']=qs[_0x613f('0x1a')](_0x5605c9[_0x613f('0x33')][_0x613f('0x1a')]);_0x574ec4[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0x5605c9[_0x613f('0x33')]['offset']);}_0x574ec4[_0x613f('0x55')]=qs[_0x613f('0x38')](_0x5605c9['query'][_0x613f('0x38')]);_0x574ec4[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x5605c9[_0x613f('0x33')],_0x23e150['filters']));_0x574ec4[_0x613f('0x39')][_0x613f('0x58')]=_0x537763['id'];if(_0x5605c9[_0x613f('0x33')][_0x613f('0x3a')]){_0x574ec4[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x574ec4['where'],{'$or':_['map'](_0x574ec4[_0x613f('0x34')],function(_0x491818){var _0x2e7533={};_0x2e7533[_0x491818]={'$like':'%'+_0x5605c9['query'][_0x613f('0x3a')]+'%'};return _0x2e7533;})});}_0x574ec4=_[_0x613f('0x3b')]({},_0x574ec4,_0x5605c9[_0x613f('0x3c')]);return db[_0x613f('0x57')]['count']({'where':_0x574ec4[_0x613f('0x39')]})[_0x613f('0x23')](function(_0x4e69a2){_0x13ae55['count']=_0x4e69a2;if(_0x5605c9['query'][_0x613f('0x3d')]){_0x574ec4['include']=[{'all':!![]}];}return db[_0x613f('0x57')][_0x613f('0x3e')](_0x574ec4);})[_0x613f('0x23')](function(_0x424c12){_0x13ae55['rows']=_0x424c12;return _0x13ae55;});}})[_0x613f('0x23')](respondWithFilteredResult(_0x39ae92,_0x574ec4))[_0x613f('0x40')](handleError(_0x39ae92,null));};exports[_0x613f('0x59')]=function(_0x31762e,_0x22557a,_0x27646c){var _0x293a53={'raw':!![],'where':{}};var _0x5159ab={};var _0x286977={'count':0x0,'rows':[]};return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x31762e['params']['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x22557a,null))[_0x613f('0x23')](function(_0x7fada0){if(_0x7fada0){_0x5159ab['model']=_[_0x613f('0x30')](db[_0x613f('0x5a')][_0x613f('0x2b')]);_0x5159ab[_0x613f('0x33')]=_[_0x613f('0x30')](_0x31762e[_0x613f('0x33')]);_0x5159ab[_0x613f('0x31')]=_[_0x613f('0x32')](_0x5159ab['model'],_0x5159ab['query']);_0x293a53[_0x613f('0x34')]=_[_0x613f('0x32')](_0x5159ab[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x31762e[_0x613f('0x33')]['fields']));_0x293a53[_0x613f('0x34')]=_0x293a53['attributes'][_0x613f('0x43')]?_0x293a53[_0x613f('0x34')]:_0x5159ab[_0x613f('0x2e')];if(!_0x31762e[_0x613f('0x33')]['hasOwnProperty'](_0x613f('0x37'))){_0x293a53[_0x613f('0x1a')]=qs['limit'](_0x31762e[_0x613f('0x33')]['limit']);_0x293a53[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0x31762e[_0x613f('0x33')][_0x613f('0x1d')]);}_0x293a53[_0x613f('0x55')]=qs['sort'](_0x31762e[_0x613f('0x33')][_0x613f('0x38')]);_0x293a53['where']=qs[_0x613f('0x31')](_['pick'](_0x31762e[_0x613f('0x33')],_0x5159ab[_0x613f('0x31')]));_0x293a53[_0x613f('0x39')][_0x613f('0x58')]=_0x7fada0['id'];if(_0x31762e[_0x613f('0x33')][_0x613f('0x3a')]){_0x293a53[_0x613f('0x39')]=_['merge'](_0x293a53[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x293a53[_0x613f('0x34')],function(_0x78c992){var _0x2aa59b={};_0x2aa59b[_0x78c992]={'$like':'%'+_0x31762e[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x2aa59b;})});}_0x293a53=_[_0x613f('0x3b')]({},_0x293a53,_0x31762e[_0x613f('0x3c')]);return db[_0x613f('0x5a')]['count']({'where':_0x293a53[_0x613f('0x39')]})[_0x613f('0x23')](function(_0x550975){_0x286977[_0x613f('0x1c')]=_0x550975;if(_0x31762e[_0x613f('0x33')]['includeAll']){_0x293a53[_0x613f('0x44')]=[{'all':!![]}];}return db[_0x613f('0x5a')][_0x613f('0x3e')](_0x293a53);})[_0x613f('0x23')](function(_0x26883c){_0x286977[_0x613f('0x3f')]=_0x26883c;return _0x286977;});}})[_0x613f('0x23')](respondWithFilteredResult(_0x22557a,_0x293a53))[_0x613f('0x40')](handleError(_0x22557a,null));};exports[_0x613f('0x5b')]=function(_0x1f21be,_0x23799d,_0x149325){var _0x2c7de2={'raw':!![],'where':{}};var _0x2112be={};var _0x6110c0={'count':0x0,'rows':[]};return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x1f21be[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x23799d,null))[_0x613f('0x23')](function(_0x571704){if(_0x571704){_0x2112be[_0x613f('0x2e')]=_['keys'](db[_0x613f('0x5c')][_0x613f('0x2b')]);_0x2112be['query']=_[_0x613f('0x30')](_0x1f21be[_0x613f('0x33')]);_0x2112be[_0x613f('0x31')]=_[_0x613f('0x32')](_0x2112be[_0x613f('0x2e')],_0x2112be[_0x613f('0x33')]);_0x2c7de2['attributes']=_[_0x613f('0x32')](_0x2112be[_0x613f('0x2e')],qs['fields'](_0x1f21be[_0x613f('0x33')][_0x613f('0x35')]));_0x2c7de2[_0x613f('0x34')]=_0x2c7de2[_0x613f('0x34')][_0x613f('0x43')]?_0x2c7de2[_0x613f('0x34')]:_0x2112be['model'];if(!_0x1f21be[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x2c7de2[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x1f21be[_0x613f('0x33')][_0x613f('0x1a')]);_0x2c7de2[_0x613f('0x1d')]=qs['offset'](_0x1f21be[_0x613f('0x33')]['offset']);}_0x2c7de2['order']=qs[_0x613f('0x38')](_0x1f21be[_0x613f('0x33')]['sort']);_0x2c7de2[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x1f21be[_0x613f('0x33')],_0x2112be[_0x613f('0x31')]));_0x2c7de2[_0x613f('0x39')][_0x613f('0x58')]=_0x571704['id'];if(_0x1f21be[_0x613f('0x33')][_0x613f('0x3a')]){_0x2c7de2['where']=_[_0x613f('0x3b')](_0x2c7de2['where'],{'$or':_[_0x613f('0x29')](_0x2c7de2[_0x613f('0x34')],function(_0x581319){var _0xd7c7e0={};_0xd7c7e0[_0x581319]={'$like':'%'+_0x1f21be['query'][_0x613f('0x3a')]+'%'};return _0xd7c7e0;})});}_0x2c7de2=_[_0x613f('0x3b')]({},_0x2c7de2,_0x1f21be[_0x613f('0x3c')]);return db['CmHopperBlack'][_0x613f('0x1c')]({'where':_0x2c7de2[_0x613f('0x39')]})[_0x613f('0x23')](function(_0x22cadd){_0x6110c0[_0x613f('0x1c')]=_0x22cadd;if(_0x1f21be[_0x613f('0x33')][_0x613f('0x3d')]){_0x2c7de2[_0x613f('0x44')]=[{'all':!![]}];}return db[_0x613f('0x5c')]['findAll'](_0x2c7de2);})[_0x613f('0x23')](function(_0x32c451){_0x6110c0[_0x613f('0x3f')]=_0x32c451;return _0x6110c0;});}})['then'](respondWithFilteredResult(_0x23799d,_0x2c7de2))[_0x613f('0x40')](handleError(_0x23799d,null));};exports[_0x613f('0x5d')]=function(_0xcc5140,_0x406937,_0x47014c){var _0x3a2df6={};var _0x36dc8f={};var _0x335135;var _0x58a5a5;return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0xcc5140[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x406937,null))[_0x613f('0x23')](function(_0x339e10){if(_0x339e10){_0x335135=_0x339e10;_0x36dc8f[_0x613f('0x2e')]=_[_0x613f('0x30')](db['CmList']['rawAttributes']);_0x36dc8f[_0x613f('0x33')]=_[_0x613f('0x30')](_0xcc5140[_0x613f('0x33')]);_0x36dc8f['filters']=_[_0x613f('0x32')](_0x36dc8f[_0x613f('0x2e')],_0x36dc8f[_0x613f('0x33')]);_0x3a2df6['attributes']=_[_0x613f('0x32')](_0x36dc8f['model'],qs['fields'](_0xcc5140[_0x613f('0x33')][_0x613f('0x35')]));_0x3a2df6['attributes']=_0x3a2df6[_0x613f('0x34')][_0x613f('0x43')]?_0x3a2df6['attributes']:_0x36dc8f[_0x613f('0x2e')];_0x3a2df6[_0x613f('0x55')]=qs[_0x613f('0x38')](_0xcc5140[_0x613f('0x33')][_0x613f('0x38')]);_0x3a2df6['where']=qs['filters'](_[_0x613f('0x56')](_0xcc5140['query'],_0x36dc8f[_0x613f('0x31')]));if(_0xcc5140['query'][_0x613f('0x3a')]){_0x3a2df6['where']=_[_0x613f('0x3b')](_0x3a2df6['where'],{'$or':_['map'](_0x3a2df6[_0x613f('0x34')],function(_0x453f04){var _0x47c19c={};_0x47c19c[_0x453f04]={'$like':'%'+_0xcc5140[_0x613f('0x33')]['filter']+'%'};return _0x47c19c;})});}_0x3a2df6=_['merge']({},_0x3a2df6,_0xcc5140['options']);return _0x335135[_0x613f('0x5d')](_0x3a2df6);}})[_0x613f('0x23')](function(_0x3c3527){if(_0x3c3527){_0x58a5a5=_0x3c3527['length'];if(!_0xcc5140[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x3a2df6['limit']=qs[_0x613f('0x1a')](_0xcc5140[_0x613f('0x33')][_0x613f('0x1a')]);_0x3a2df6[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0xcc5140[_0x613f('0x33')][_0x613f('0x1d')]);}return _0x335135['getLists'](_0x3a2df6);}})[_0x613f('0x23')](function(_0xfa404f){if(_0xfa404f){return _0xfa404f?{'count':_0x58a5a5,'rows':_0xfa404f}:null;}})[_0x613f('0x23')](respondWithResult(_0x406937,null))['catch'](handleError(_0x406937,null));};exports[_0x613f('0x5e')]=function(_0x380e1a,_0xcc214f,_0x52de26){var _0x1021f0,_0x15564e;var _0x3b5efa=[];var _0x5e5997=moment()[_0x613f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x380e1a[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0xcc214f,null))[_0x613f('0x23')](function(_0xeb81e){if(_0xeb81e){_0x15564e=_0xeb81e;return _0xeb81e[_0x613f('0x5e')](_0x380e1a['body']['ids'],_['omit'](_0x380e1a[_0x613f('0x47')],[_0x613f('0x60'),'id'])||{});}return null;})[_0x613f('0x61')](function(_0x8611b){var _0x4d35e5;var _0x4b8e0b;_0x1021f0=_0x8611b||[];var _0x39e193=[];if(_0x8611b){for(var _0x3bbab0=0x0;_0x3bbab0<_0x8611b[_0x613f('0x43')];_0x3bbab0+=0x1){var _0x2b66fb=_0x8611b[_0x3bbab0][_0x613f('0x49')]({'plain':!![]});_0x15564e['dialCheckDuplicateType']=_0x380e1a['body'][_0x613f('0x62')]?_0x380e1a[_0x613f('0x47')][_0x613f('0x62')]:_0x15564e[_0x613f('0x62')];switch(_0x15564e[_0x613f('0x62')]){case'always':_0x4d35e5=squel[_0x613f('0x63')]()[_0x613f('0x64')](_0x613f('0x65'))[_0x613f('0x66')]([_0x613f('0x67'),_0x613f('0x68'),_0x613f('0x69'),_0x613f('0x6a'),_0x613f('0x58'),_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()[_0x613f('0x6c')]('phone',_0x613f('0x67'))[_0x613f('0x6c')](_0x613f('0x6d'),_0x613f('0x68'))['field']('id',_0x613f('0x69'))[_0x613f('0x6c')](_0x2b66fb['CmListId'][_0x613f('0x6e')](),'ListId')[_0x613f('0x6c')](_0x380e1a[_0x613f('0x42')]['id']['toString'](),'CampaignId')[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27','createdAt')['field']('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')]('cm_contacts')[_0x613f('0x39')]('deletedAt\x20IS\x20NULL')[_0x613f('0x39')]('ListId\x20=\x20?',_0x2b66fb[_0x613f('0x70')][_0x613f('0x6e')]())[_0x613f('0x39')](_0x613f('0x71'))['where'](_0x613f('0x72'),squel[_0x613f('0x6b')]()[_0x613f('0x6c')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x613f('0x39')]('CampaignId\x20=\x20?',_0x380e1a[_0x613f('0x42')]['id']['toString']()))[_0x613f('0x39')](_0x613f('0x72'),squel[_0x613f('0x6b')]()[_0x613f('0x6c')](_0x613f('0x73'))[_0x613f('0x6f')]('cm_hopper')[_0x613f('0x39')](_0x613f('0x74'),_0x380e1a[_0x613f('0x42')]['id']['toString']())))[_0x613f('0x6e')]();break;case'onlyIfOpen':_0x4d35e5=squel[_0x613f('0x63')]()[_0x613f('0x64')](_0x613f('0x65'))['fromQuery']([_0x613f('0x67'),'scheduledAt',_0x613f('0x69'),'ListId',_0x613f('0x58'),_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()['field'](_0x613f('0x67'),'phone')[_0x613f('0x6c')](_0x613f('0x6d'),_0x613f('0x68'))['field']('id',_0x613f('0x69'))[_0x613f('0x6c')](_0x2b66fb[_0x613f('0x70')][_0x613f('0x6e')](),_0x613f('0x6a'))[_0x613f('0x6c')](_0x380e1a[_0x613f('0x42')]['id'][_0x613f('0x6e')](),_0x613f('0x58'))[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27','createdAt')['field']('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x613f('0x39')]('ListId\x20=\x20?',_0x2b66fb['CmListId'][_0x613f('0x6e')]())[_0x613f('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x613f('0x39')](_0x613f('0x72'),squel[_0x613f('0x6b')]()['field'](_0x613f('0x73'))[_0x613f('0x6f')](_0x613f('0x65'))['where']('CampaignId\x20=\x20?',_0x380e1a[_0x613f('0x42')]['id'][_0x613f('0x6e')]())))[_0x613f('0x6e')]();break;default:_0x4d35e5=squel[_0x613f('0x63')]()[_0x613f('0x64')]('cm_hopper')[_0x613f('0x66')]([_0x613f('0x67'),_0x613f('0x68'),_0x613f('0x69'),_0x613f('0x6a'),_0x613f('0x58'),_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()[_0x613f('0x6c')](_0x613f('0x67'),_0x613f('0x67'))[_0x613f('0x6c')](_0x613f('0x6d'),'scheduledAt')['field']('id',_0x613f('0x69'))[_0x613f('0x6c')](_0x2b66fb[_0x613f('0x70')][_0x613f('0x6e')](),_0x613f('0x6a'))['field'](_0x380e1a['params']['id'][_0x613f('0x6e')](),_0x613f('0x58'))[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27',_0x613f('0x4e'))['field']('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')](_0x613f('0x75'))['where'](_0x613f('0x76'))[_0x613f('0x39')](_0x613f('0x77'),_0x2b66fb['CmListId'][_0x613f('0x6e')]())[_0x613f('0x39')](_0x613f('0x71')))[_0x613f('0x6e')]();}_0x4b8e0b=squel['insert']()[_0x613f('0x64')](_0x613f('0x78'))[_0x613f('0x66')](['cmHopperId',_0x613f('0x68'),_0x613f('0x67'),'OrderBy',_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()['field'](_0x613f('0x79'),'id')['field'](_0x613f('0x6d'),_0x613f('0x68'))['field'](_0x613f('0x7a'),_0x613f('0x67'))[_0x613f('0x6c')]('ci.OrderBY',_0x613f('0x7b'))[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27','createdAt')[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')](_0x613f('0x7c'),'ci')['join']('cm_hopper','h',_0x613f('0x7d'))[_0x613f('0x39')](_0x613f('0x7e'),_0x2b66fb['CmListId'][_0x613f('0x6e')]())['where']('h.CampaignId=?',_0x380e1a['params']['id']['toString']())[_0x613f('0x39')](_0x613f('0x7f'),_0x5e5997))[_0x613f('0x6e')]();_0x39e193[_0x613f('0x80')](db[_0x613f('0x81')][_0x613f('0x33')](_0x4d35e5));_0x3b5efa[_0x613f('0x80')](db['sequelize']['query'](_0x4b8e0b));}return BPromise['all'](_0x39e193);}})['then'](function(){return BPromise[_0x613f('0x82')](_0x3b5efa);})['then'](function(){return _0x1021f0;})[_0x613f('0x23')](respondWithResult(_0xcc214f,null))[_0x613f('0x40')](handleError(_0xcc214f,null));};exports[_0x613f('0x83')]=function(_0x189a4a,_0x86a29,_0x520640){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x189a4a[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0x86a29,null))[_0x613f('0x23')](function(_0x1be64a){if(_0x1be64a){return _0x1be64a[_0x613f('0x83')](_0x189a4a[_0x613f('0x33')][_0x613f('0x60')]);}})[_0x613f('0x23')](function(_0x276db6){if(_0x276db6){return db[_0x613f('0x54')][_0x613f('0x24')]({'where':{'ListId':_0x189a4a['query']['ids'],'CampaignId':_0x189a4a[_0x613f('0x42')]['id']}})[_0x613f('0x23')](function(){return _0x276db6;});}})[_0x613f('0x23')](respondWithStatusCode(_0x86a29,null))[_0x613f('0x40')](handleError(_0x86a29,null));};exports['getBlackLists']=function(_0x85548f,_0x19fcc8,_0x234a6f){var _0x5b0b54={};var _0x38ebf5={};var _0x70f2a8;var _0x53e764;return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x85548f[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x19fcc8,null))[_0x613f('0x23')](function(_0x5e1d67){if(_0x5e1d67){_0x70f2a8=_0x5e1d67;_0x38ebf5['model']=_['keys'](db['CmList'][_0x613f('0x2b')]);_0x38ebf5[_0x613f('0x33')]=_[_0x613f('0x30')](_0x85548f[_0x613f('0x33')]);_0x38ebf5[_0x613f('0x31')]=_[_0x613f('0x32')](_0x38ebf5[_0x613f('0x2e')],_0x38ebf5[_0x613f('0x33')]);_0x5b0b54[_0x613f('0x34')]=_['intersection'](_0x38ebf5[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x85548f[_0x613f('0x33')][_0x613f('0x35')]));_0x5b0b54[_0x613f('0x34')]=_0x5b0b54[_0x613f('0x34')]['length']?_0x5b0b54[_0x613f('0x34')]:_0x38ebf5['model'];_0x5b0b54[_0x613f('0x55')]=qs['sort'](_0x85548f[_0x613f('0x33')][_0x613f('0x38')]);_0x5b0b54[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x85548f[_0x613f('0x33')],_0x38ebf5['filters']));if(_0x85548f['query'][_0x613f('0x3a')]){_0x5b0b54[_0x613f('0x39')]=_['merge'](_0x5b0b54[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x5b0b54[_0x613f('0x34')],function(_0x5672e2){var _0x35c71e={};_0x35c71e[_0x5672e2]={'$like':'%'+_0x85548f['query'][_0x613f('0x3a')]+'%'};return _0x35c71e;})});}_0x5b0b54=_[_0x613f('0x3b')]({},_0x5b0b54,_0x85548f[_0x613f('0x3c')]);return _0x70f2a8[_0x613f('0x84')](_0x5b0b54);}})['then'](function(_0x91e255){if(_0x91e255){_0x53e764=_0x91e255[_0x613f('0x43')];if(!_0x85548f[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x5b0b54[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x85548f[_0x613f('0x33')][_0x613f('0x1a')]);_0x5b0b54['offset']=qs[_0x613f('0x1d')](_0x85548f[_0x613f('0x33')]['offset']);}return _0x70f2a8[_0x613f('0x84')](_0x5b0b54);}})[_0x613f('0x23')](function(_0x1c3e22){if(_0x1c3e22){return _0x1c3e22?{'count':_0x53e764,'rows':_0x1c3e22}:null;}})[_0x613f('0x23')](respondWithResult(_0x19fcc8,null))[_0x613f('0x40')](handleError(_0x19fcc8,null));};exports[_0x613f('0x85')]=function(_0x265c10,_0x4fb9ae,_0x4db928){var _0x133533,_0x4acd62;var _0x323fb1=[];var _0x2f18e7=moment()[_0x613f('0x5f')](_0x613f('0x86'));return db['Campaign'][_0x613f('0x45')]({'where':{'id':_0x265c10[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x4fb9ae,null))[_0x613f('0x23')](function(_0x1fac19){if(_0x1fac19){_0x4acd62=_0x1fac19;return _0x1fac19[_0x613f('0x85')](_0x265c10[_0x613f('0x47')][_0x613f('0x60')],_[_0x613f('0x4d')](_0x265c10[_0x613f('0x47')],[_0x613f('0x60'),'id'])||{});}return null;})[_0x613f('0x61')](function(_0x8ec949){var _0x4269de;var _0x4835f3;_0x133533=_0x8ec949||[];var _0x22fed1=[];if(_0x8ec949){for(var _0x19ec12=0x0;_0x19ec12<_0x8ec949['length'];_0x19ec12+=0x1){var _0x583652=_0x8ec949[_0x19ec12]['get']({'plain':!![]});_0x4269de=squel[_0x613f('0x63')]()[_0x613f('0x64')](_0x613f('0x87'))[_0x613f('0x66')]([_0x613f('0x67'),_0x613f('0x69'),_0x613f('0x6a'),_0x613f('0x58'),'createdAt',_0x613f('0x4f')],squel['select']()[_0x613f('0x6c')]('phone',_0x613f('0x67'))['field']('id',_0x613f('0x69'))['field'](_0x583652['CmListId'][_0x613f('0x6e')](),'ListId')['field'](_0x265c10[_0x613f('0x42')]['id'][_0x613f('0x6e')](),_0x613f('0x58'))[_0x613f('0x6c')](_0x613f('0x6d'),_0x613f('0x4e'))[_0x613f('0x6c')](_0x613f('0x6d'),'updatedAt')[_0x613f('0x6f')](_0x613f('0x75'))[_0x613f('0x39')](_0x613f('0x76'))[_0x613f('0x39')](_0x613f('0x77'),_0x583652[_0x613f('0x70')][_0x613f('0x6e')]())[_0x613f('0x39')](_0x613f('0x71')))[_0x613f('0x6e')]();_0x22fed1[_0x613f('0x80')](db[_0x613f('0x81')]['query'](_0x4269de));}return BPromise[_0x613f('0x82')](_0x22fed1);}})[_0x613f('0x23')](function(){return _0x133533;})[_0x613f('0x23')](respondWithResult(_0x4fb9ae,null))[_0x613f('0x40')](handleError(_0x4fb9ae,null));};exports[_0x613f('0x88')]=function(_0xcbf137,_0x10db85,_0x57781c){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0xcbf137[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0x10db85,null))[_0x613f('0x23')](function(_0x10066e){if(_0x10066e){return _0x10066e['removeBlackLists'](_0xcbf137[_0x613f('0x33')]['ids']);}})[_0x613f('0x23')](function(_0x30f3a3){if(_0x30f3a3){return db['CmHopperBlack'][_0x613f('0x24')]({'where':{'ListId':_0xcbf137[_0x613f('0x33')][_0x613f('0x60')],'CampaignId':_0xcbf137['params']['id']}})[_0x613f('0x23')](function(){return _0x30f3a3;});}})[_0x613f('0x23')](respondWithStatusCode(_0x10db85,null))[_0x613f('0x40')](handleError(_0x10db85,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b9244fa..46eca9c 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(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x4b3d10,_0x3da823){var _0x3f62cc=function(_0x366e9a){while(--_0x366e9a){_0x4b3d10['push'](_0x4b3d10['shift']());}};_0x3f62cc(++_0x3da823);}(_0x7a54,0x106));var _0x47a5=function(_0x170460,_0x5dc758){_0x170460=_0x170460-0x0;var _0x967890=_0x7a54[_0x170460];return _0x967890;};'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 f5198e7..5effdb4 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 _0x495e=['Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','raw','options','where','attributes','limit','include','map','model','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x51aae8,_0x5a9019){var _0x5c6831=function(_0x4bd810){while(--_0x4bd810){_0x51aae8['push'](_0x51aae8['shift']());}};_0x5c6831(++_0x5a9019);}(_0x495e,0xfb));var _0xe495=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x495e[_0x8ae98b];return _0xc30bd4;};'use strict';var _=require(_0xe495('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe495('0x1'));var rs=require(_0xe495('0x2'));var fs=require('fs');var Redis=require(_0xe495('0x3'));var db=require(_0xe495('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe495('0x5'))(_0xe495('0x6'));var config=require(_0xe495('0x7'));var jayson=require(_0xe495('0x8'));var client=jayson[_0xe495('0x9')][_0xe495('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x101a7e,_0x5745e3,_0x599ab4){return new BPromise(function(_0x5c17d0,_0x16f146){return client['request'](_0x101a7e,_0x599ab4)[_0xe495('0xb')](function(_0x3a9a00){logger[_0xe495('0xc')](_0xe495('0xd'),_0x5745e3,_0xe495('0xe'));logger['debug'](_0xe495('0xf'),_0x5745e3,_0xe495('0xe'),JSON[_0xe495('0x10')](_0x3a9a00));if(_0x3a9a00['error']){if(_0x3a9a00[_0xe495('0x11')][_0xe495('0x12')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5745e3,_0x3a9a00[_0xe495('0x11')][_0xe495('0x13')]);return _0x16f146(_0x3a9a00['error'][_0xe495('0x13')]);}logger[_0xe495('0x11')](_0xe495('0xd'),_0x5745e3,_0x3a9a00[_0xe495('0x11')][_0xe495('0x13')]);return _0x5c17d0(_0x3a9a00['error'][_0xe495('0x13')]);}else{logger[_0xe495('0xc')](_0xe495('0xd'),_0x5745e3,_0xe495('0xe'));_0x5c17d0(_0x3a9a00[_0xe495('0x14')]['message']);}})['catch'](function(_0x4de730){logger[_0xe495('0x11')](_0xe495('0xd'),_0x5745e3,_0x4de730);_0x16f146(_0x4de730);});});}exports[_0xe495('0x15')]=function(_0x577fb7){var _0x1e602c=this;return new Promise(function(_0x302ca0,_0x3ba8cc){return db[_0xe495('0x16')][_0xe495('0x17')]({'raw':_0x577fb7['options']?_0x577fb7['options'][_0xe495('0x18')]===undefined?!![]:![]:!![],'where':_0x577fb7[_0xe495('0x19')]?_0x577fb7[_0xe495('0x19')][_0xe495('0x1a')]||null:null,'attributes':_0x577fb7['options']?_0x577fb7[_0xe495('0x19')][_0xe495('0x1b')]||null:null,'limit':_0x577fb7[_0xe495('0x19')]?_0x577fb7['options'][_0xe495('0x1c')]||null:null,'include':_0x577fb7[_0xe495('0x19')]?_0x577fb7[_0xe495('0x19')][_0xe495('0x1d')]?_[_0xe495('0x1e')](_0x577fb7['options'][_0xe495('0x1d')],function(_0x4d836b){return{'model':db[_0x4d836b[_0xe495('0x1f')]],'as':_0x4d836b['as'],'attributes':_0x4d836b[_0xe495('0x1b')],'include':_0x4d836b[_0xe495('0x1d')]?_['map'](_0x4d836b[_0xe495('0x1d')],function(_0x2a6fd6){return{'model':db[_0x2a6fd6[_0xe495('0x1f')]],'as':_0x2a6fd6['as'],'attributes':_0x2a6fd6[_0xe495('0x1b')],'include':_0x2a6fd6[_0xe495('0x1d')]?_[_0xe495('0x1e')](_0x2a6fd6[_0xe495('0x1d')],function(_0x48b2eb){return{'model':db[_0x48b2eb['model']],'as':_0x48b2eb['as'],'attributes':_0x48b2eb[_0xe495('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1651d4){logger[_0xe495('0xc')]('GetCampaign',_0x577fb7);logger['debug'](_0xe495('0x15'),_0x577fb7,JSON[_0xe495('0x10')](_0x1651d4));_0x302ca0(_0x1651d4);})[_0xe495('0x20')](function(_0x8623c1){logger[_0xe495('0x11')](_0xe495('0x15'),_0x8623c1[_0xe495('0x13')],_0x577fb7);_0x3ba8cc(_0x1e602c[_0xe495('0x11')](0x1f4,_0x8623c1['message']));});});}; \ No newline at end of file +var _0x7b6b=['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','catch','GetCampaign','Campaign','options','limit','include','map','model','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x367448,_0x3e9deb){var _0x28b046=function(_0x2c9ff8){while(--_0x2c9ff8){_0x367448['push'](_0x367448['shift']());}};_0x28b046(++_0x3e9deb);}(_0x7b6b,0xac));var _0xb7b6=function(_0x2cb530,_0x435826){_0x2cb530=_0x2cb530-0x0;var _0x4930f1=_0x7b6b[_0x2cb530];return _0x4930f1;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var moment=require(_0xb7b6('0x1'));var BPromise=require(_0xb7b6('0x2'));var rs=require(_0xb7b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7b6('0x5'))(_0xb7b6('0x6'));var config=require(_0xb7b6('0x7'));var jayson=require(_0xb7b6('0x8'));var client=jayson[_0xb7b6('0x9')][_0xb7b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e81f,_0x318dfb,_0x36cd51){return new BPromise(function(_0x31809b,_0xb5b26f){return client[_0xb7b6('0xb')](_0x19e81f,_0x36cd51)[_0xb7b6('0xc')](function(_0x313aa8){logger[_0xb7b6('0xd')](_0xb7b6('0xe'),_0x318dfb,_0xb7b6('0xf'));logger[_0xb7b6('0x10')](_0xb7b6('0x11'),_0x318dfb,_0xb7b6('0xf'),JSON['stringify'](_0x313aa8));if(_0x313aa8[_0xb7b6('0x12')]){if(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x13')]===0x1f4){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);return _0xb5b26f(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);}logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')]['message']);return _0x31809b(_0x313aa8['error'][_0xb7b6('0x14')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x318dfb,_0xb7b6('0xf'));_0x31809b(_0x313aa8['result'][_0xb7b6('0x14')]);}})[_0xb7b6('0x15')](function(_0xa99f35){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0xa99f35);_0xb5b26f(_0xa99f35);});});}exports[_0xb7b6('0x16')]=function(_0x3dc0f8){var _0x7bb633=this;return new Promise(function(_0x5667d9,_0x314049){return db[_0xb7b6('0x17')]['findAll']({'raw':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')]['where']||null:null,'attributes':_0x3dc0f8['options']?_0x3dc0f8[_0xb7b6('0x18')]['attributes']||null:null,'limit':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')][_0xb7b6('0x19')]||null:null,'include':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')][_0xb7b6('0x1a')]?_[_0xb7b6('0x1b')](_0x3dc0f8[_0xb7b6('0x18')][_0xb7b6('0x1a')],function(_0x2173c5){return{'model':db[_0x2173c5[_0xb7b6('0x1c')]],'as':_0x2173c5['as'],'attributes':_0x2173c5[_0xb7b6('0x1d')],'include':_0x2173c5[_0xb7b6('0x1a')]?_['map'](_0x2173c5[_0xb7b6('0x1a')],function(_0x551e06){return{'model':db[_0x551e06[_0xb7b6('0x1c')]],'as':_0x551e06['as'],'attributes':_0x551e06['attributes'],'include':_0x551e06['include']?_['map'](_0x551e06[_0xb7b6('0x1a')],function(_0x48ace6){return{'model':db[_0x48ace6['model']],'as':_0x48ace6['as'],'attributes':_0x48ace6[_0xb7b6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb7b6('0xc')](function(_0x4276bd){logger[_0xb7b6('0xd')](_0xb7b6('0x16'),_0x3dc0f8);logger[_0xb7b6('0x10')](_0xb7b6('0x16'),_0x3dc0f8,JSON['stringify'](_0x4276bd));_0x5667d9(_0x4276bd);})['catch'](function(_0x3017f5){logger[_0xb7b6('0x12')](_0xb7b6('0x16'),_0x3017f5[_0xb7b6('0x14')],_0x3dc0f8);_0x314049(_0x7bb633[_0xb7b6('0x12')](0x1f4,_0x3017f5['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ac05016..8861636 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 _0x03fe=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x5b6a86,_0x59489c){var _0x425888=function(_0x38fdfd){while(--_0x38fdfd){_0x5b6a86['push'](_0x5b6a86['shift']());}};_0x425888(++_0x59489c);}(_0x03fe,0x73));var _0xe03f=function(_0x273e4c,_0x24c349){_0x273e4c=_0x273e4c-0x0;var _0x11adb4=_0x03fe[_0x273e4c];return _0x11adb4;};'use strict';var multer=require(_0xe03f('0x0'));var util=require(_0xe03f('0x1'));var path=require(_0xe03f('0x2'));var timeout=require(_0xe03f('0x3'));var express=require('express');var router=express[_0xe03f('0x4')]();var fs_extra=require(_0xe03f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe03f('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xe03f('0x7')]('/',auth[_0xe03f('0x8')](),controller[_0xe03f('0x9')]);router[_0xe03f('0x7')](_0xe03f('0xa'),auth['isAuthenticated'](),controller[_0xe03f('0xb')]);router[_0xe03f('0x7')]('/:id/hoppers',auth[_0xe03f('0x8')](),controller[_0xe03f('0xc')]);router[_0xe03f('0x7')](_0xe03f('0xd'),auth[_0xe03f('0x8')](),controller[_0xe03f('0xe')]);router[_0xe03f('0x7')](_0xe03f('0xf'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x10')]);router['get'](_0xe03f('0x11'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x12')]);router[_0xe03f('0x7')](_0xe03f('0x13'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x14')]);router[_0xe03f('0x7')](_0xe03f('0x15'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x16')]);router['post']('/',auth[_0xe03f('0x8')](),controller['create']);router[_0xe03f('0x17')]('/:id/clone',auth['isAuthenticated'](),controller[_0xe03f('0x18')]);router['post'](_0xe03f('0x13'),auth['isAuthenticated'](),controller[_0xe03f('0x19')]);router[_0xe03f('0x17')](_0xe03f('0x15'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x1a')]);router[_0xe03f('0x1b')](_0xe03f('0xa'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x1c')]);router['delete'](_0xe03f('0xa'),auth['isAuthenticated'](),controller[_0xe03f('0x1d')]);router[_0xe03f('0x1e')](_0xe03f('0x13'),auth[_0xe03f('0x8')](),controller['removeLists']);router[_0xe03f('0x1e')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xe03f('0x1f')]);module[_0xe03f('0x20')]=router; \ No newline at end of file +var _0xa5c5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','clone','addLists','post','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express'];(function(_0x1260a6,_0x1ee131){var _0x197933=function(_0x1ddf0f){while(--_0x1ddf0f){_0x1260a6['push'](_0x1260a6['shift']());}};_0x197933(++_0x1ee131);}(_0xa5c5,0x64));var _0x5a5c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa5c5[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x5a5c('0x0'));var util=require(_0x5a5c('0x1'));var path=require(_0x5a5c('0x2'));var timeout=require(_0x5a5c('0x3'));var express=require(_0x5a5c('0x4'));var router=express[_0x5a5c('0x5')]();var fs_extra=require(_0x5a5c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5a5c('0x7'));var config=require(_0x5a5c('0x8'));var controller=require(_0x5a5c('0x9'));router[_0x5a5c('0xa')]('/',auth[_0x5a5c('0xb')](),controller[_0x5a5c('0xc')]);router[_0x5a5c('0xa')](_0x5a5c('0xd'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0xe')]);router['get'](_0x5a5c('0xf'),auth[_0x5a5c('0xb')](),controller['getHoppers']);router[_0x5a5c('0xa')](_0x5a5c('0x10'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x11')]);router[_0x5a5c('0xa')](_0x5a5c('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x5a5c('0xa')](_0x5a5c('0x13'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x14')]);router[_0x5a5c('0xa')](_0x5a5c('0x15'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x5a5c('0x16'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x17')]);router['post']('/',auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x18')]);router['post']('/:id/clone',auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x19')]);router['post'](_0x5a5c('0x15'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x1a')]);router[_0x5a5c('0x1b')](_0x5a5c('0x16'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x1c')]);router[_0x5a5c('0x1d')](_0x5a5c('0xd'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x1e')]);router[_0x5a5c('0x1f')](_0x5a5c('0xd'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x20')]);router[_0x5a5c('0x1f')](_0x5a5c('0x15'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x21')]);router['delete'](_0x5a5c('0x16'),auth[_0x5a5c('0xb')](),controller['removeBlackLists']);module[_0x5a5c('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f1ffff2..343939c 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 _0xb8d2=['medium','key','sequelize','STRING','TEXT'];(function(_0x343abb,_0x4d8e75){var _0x2e53f9=function(_0x4d1c9b){while(--_0x4d1c9b){_0x343abb['push'](_0x343abb['shift']());}};_0x2e53f9(++_0x4d8e75);}(_0xb8d2,0x188));var _0x2b8d=function(_0x166294,_0x175bc9){_0x166294=_0x166294-0x0;var _0x304968=_0xb8d2[_0x166294];return _0x304968;};'use strict';var Sequelize=require(_0x2b8d('0x0'));module['exports']={'key':{'type':Sequelize[_0x2b8d('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x2b8d('0x2')],'length':_0x2b8d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2b8d('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x2b8d('0x4'));}}}; \ No newline at end of file +var _0x9e30=['TEXT','medium','VIRTUAL','getDataValue','key','exports','STRING'];(function(_0xfebf65,_0x2101b7){var _0x14e254=function(_0x568cf3){while(--_0x568cf3){_0xfebf65['push'](_0xfebf65['shift']());}};_0x14e254(++_0x2101b7);}(_0x9e30,0x1b7));var _0x09e3=function(_0x4668a6,_0x4e8a1f){_0x4668a6=_0x4668a6-0x0;var _0x23215d=_0x9e30[_0x4668a6];return _0x23215d;};'use strict';var Sequelize=require('sequelize');module[_0x09e3('0x0')]={'key':{'type':Sequelize[_0x09e3('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x09e3('0x2')],'length':_0x09e3('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x09e3('0x4')],'get':function(){return this[_0x09e3('0x5')](_0x09e3('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index c831b78..dfca12a 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 _0x9119=['filter','merge','options','CannedAnswer','includeAll','findAll','catch','show','params','rawAttributes','include','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','CannedAnswers','UserProfileResource','end','error','name','send','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x221648,_0x2d46a5){var _0x3afc1f=function(_0x50ee4e){while(--_0x50ee4e){_0x221648['push'](_0x221648['shift']());}};_0x3afc1f(++_0x2d46a5);}(_0x9119,0x185));var _0x9911=function(_0x177b4b,_0x33f146){_0x177b4b=_0x177b4b-0x0;var _0x8ad94d=_0x9119[_0x177b4b];return _0x8ad94d;};'use strict';var emlformat=require(_0x9911('0x0'));var rimraf=require(_0x9911('0x1'));var zipdir=require(_0x9911('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9911('0x3'));var moment=require(_0x9911('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9911('0x5'));var util=require('util');var path=require(_0x9911('0x6'));var sox=require(_0x9911('0x7'));var csv=require(_0x9911('0x8'));var ejs=require(_0x9911('0x9'));var fs=require('fs');var fs_extra=require(_0x9911('0xa'));var _=require(_0x9911('0xb'));var squel=require(_0x9911('0xc'));var crypto=require(_0x9911('0xd'));var jsforce=require(_0x9911('0xe'));var deskjs=require(_0x9911('0xf'));var toCsv=require(_0x9911('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9911('0x10'));var authService=require(_0x9911('0x11'));var qs=require(_0x9911('0x12'));var as=require(_0x9911('0x13'));var hardwareService=require(_0x9911('0x14'));var logger=require(_0x9911('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9911('0x16'));var db=require(_0x9911('0x17'))['db'];function respondWithStatusCode(_0x2aaab2,_0x4ac66c){_0x4ac66c=_0x4ac66c||0xcc;return function(_0x419dac){if(_0x419dac){return _0x2aaab2[_0x9911('0x18')](_0x4ac66c);}return _0x2aaab2[_0x9911('0x19')](_0x4ac66c)['end']();};}function respondWithResult(_0x110ec6,_0xc28913){_0xc28913=_0xc28913||0xc8;return function(_0x38ebad){if(_0x38ebad){return _0x110ec6[_0x9911('0x19')](_0xc28913)[_0x9911('0x1a')](_0x38ebad);}};}function respondWithFilteredResult(_0x5dd660,_0x4c2a8d){return function(_0x56129e){if(_0x56129e){var _0x3f3ea5=typeof _0x4c2a8d[_0x9911('0x1b')]==='undefined'&&typeof _0x4c2a8d[_0x9911('0x1c')]==='undefined';var _0x293b66=_0x56129e[_0x9911('0x1d')];var _0x32af7c=_0x3f3ea5?0x0:_0x4c2a8d['offset'];var _0x16b395=_0x3f3ea5?_0x56129e[_0x9911('0x1d')]:_0x4c2a8d[_0x9911('0x1b')]+_0x4c2a8d['limit'];var _0x38a370;if(_0x16b395>=_0x293b66){_0x16b395=_0x293b66;_0x38a370=0xc8;}else{_0x38a370=0xce;}_0x5dd660[_0x9911('0x19')](_0x38a370);return _0x5dd660[_0x9911('0x1e')](_0x9911('0x1f'),_0x32af7c+'-'+_0x16b395+'/'+_0x293b66)[_0x9911('0x1a')](_0x56129e);}return null;};}function patchUpdates(_0x1d4dab){return function(_0x55a505){try{jsonpatch[_0x9911('0x20')](_0x55a505,_0x1d4dab,!![]);}catch(_0x26b38e){return BPromise[_0x9911('0x21')](_0x26b38e);}return _0x55a505[_0x9911('0x22')]();};}function saveUpdates(_0x4cff7c,_0x2221bc){return function(_0x31fe3c){if(_0x31fe3c){return _0x31fe3c['update'](_0x4cff7c)[_0x9911('0x23')](function(_0x333eb1){return _0x333eb1;});}return null;};}function removeEntity(_0x4a7888,_0x190b94){return function(_0x40117d){if(_0x40117d){return _0x40117d[_0x9911('0x24')]()['then'](function(){var _0x4915ef=_0x40117d['get']({'plain':!![]});var _0x5b8657=_0x9911('0x25');return db[_0x9911('0x26')]['destroy']({'where':{'type':_0x5b8657,'resourceId':_0x4915ef['id']}})[_0x9911('0x23')](function(){return _0x40117d;});})[_0x9911('0x23')](function(){_0x4a7888['status'](0xcc)[_0x9911('0x27')]();});}};}function handleEntityNotFound(_0xc8a03e,_0x1adcc0){return function(_0x5ec66c){if(!_0x5ec66c){_0xc8a03e[_0x9911('0x18')](0x194);}return _0x5ec66c;};}function handleError(_0x4a8bfc,_0x32bb80){_0x32bb80=_0x32bb80||0x1f4;return function(_0x4489f1){logger[_0x9911('0x28')](_0x4489f1['stack']);if(_0x4489f1[_0x9911('0x29')]){delete _0x4489f1[_0x9911('0x29')];}_0x4a8bfc[_0x9911('0x19')](_0x32bb80)[_0x9911('0x2a')](_0x4489f1);};}exports[_0x9911('0x2b')]=function(_0x37104f,_0x437567){var _0x4bc5da={},_0x412f09={},_0x24eeba={'count':0x0,'rows':[]};var _0x4eddbb=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x771f62){return{'name':_0x771f62[_0x9911('0x2c')],'type':_0x771f62[_0x9911('0x2d')][_0x9911('0x2e')]};});_0x412f09['model']=_['map'](_0x4eddbb,_0x9911('0x29'));_0x412f09[_0x9911('0x2f')]=_[_0x9911('0x30')](_0x37104f['query']);_0x412f09[_0x9911('0x31')]=_[_0x9911('0x32')](_0x412f09[_0x9911('0x33')],_0x412f09[_0x9911('0x2f')]);_0x4bc5da['attributes']=_[_0x9911('0x32')](_0x412f09[_0x9911('0x33')],qs[_0x9911('0x34')](_0x37104f[_0x9911('0x2f')][_0x9911('0x34')]));_0x4bc5da['attributes']=_0x4bc5da[_0x9911('0x35')][_0x9911('0x36')]?_0x4bc5da[_0x9911('0x35')]:_0x412f09[_0x9911('0x33')];if(!_0x37104f[_0x9911('0x2f')][_0x9911('0x37')](_0x9911('0x38'))){_0x4bc5da['limit']=qs[_0x9911('0x1c')](_0x37104f[_0x9911('0x2f')][_0x9911('0x1c')]);_0x4bc5da['offset']=qs[_0x9911('0x1b')](_0x37104f[_0x9911('0x2f')][_0x9911('0x1b')]);}_0x4bc5da[_0x9911('0x39')]=qs['sort'](_0x37104f[_0x9911('0x2f')][_0x9911('0x3a')]);_0x4bc5da[_0x9911('0x3b')]=qs[_0x9911('0x31')](_[_0x9911('0x3c')](_0x37104f[_0x9911('0x2f')],_0x412f09[_0x9911('0x31')]),_0x4eddbb);if(_0x37104f[_0x9911('0x2f')][_0x9911('0x3d')]){_0x4bc5da[_0x9911('0x3b')]=_[_0x9911('0x3e')](_0x4bc5da[_0x9911('0x3b')],{'$or':[{'key':{'$like':'%'+_0x37104f[_0x9911('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x37104f['query'][_0x9911('0x3d')]+'%'}}]});}_0x4bc5da=_[_0x9911('0x3e')]({},_0x4bc5da,_0x37104f[_0x9911('0x3f')]);var _0x8d75f8={'where':_0x4bc5da[_0x9911('0x3b')]};return db[_0x9911('0x40')]['count'](_0x8d75f8)['then'](function(_0x367e02){_0x24eeba[_0x9911('0x1d')]=_0x367e02;if(_0x37104f[_0x9911('0x2f')][_0x9911('0x41')]){_0x4bc5da['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x9911('0x42')](_0x4bc5da);})[_0x9911('0x23')](function(_0x7521e8){_0x24eeba['rows']=_0x7521e8;return _0x24eeba;})['then'](respondWithFilteredResult(_0x437567,_0x4bc5da))[_0x9911('0x43')](handleError(_0x437567,null));};exports[_0x9911('0x44')]=function(_0xc6694e,_0x852582){var _0x212df1={'raw':!![],'where':{'id':_0xc6694e[_0x9911('0x45')]['id']}},_0x52ea2c={};_0x52ea2c[_0x9911('0x33')]=_[_0x9911('0x30')](db['CannedAnswer'][_0x9911('0x46')]);_0x52ea2c[_0x9911('0x2f')]=_[_0x9911('0x30')](_0xc6694e[_0x9911('0x2f')]);_0x52ea2c[_0x9911('0x31')]=_[_0x9911('0x32')](_0x52ea2c['model'],_0x52ea2c[_0x9911('0x2f')]);_0x212df1[_0x9911('0x35')]=_[_0x9911('0x32')](_0x52ea2c[_0x9911('0x33')],qs[_0x9911('0x34')](_0xc6694e[_0x9911('0x2f')][_0x9911('0x34')]));_0x212df1[_0x9911('0x35')]=_0x212df1[_0x9911('0x35')][_0x9911('0x36')]?_0x212df1[_0x9911('0x35')]:_0x52ea2c[_0x9911('0x33')];if(_0xc6694e[_0x9911('0x2f')][_0x9911('0x41')]){_0x212df1[_0x9911('0x47')]=[{'all':!![]}];}_0x212df1=_['merge']({},_0x212df1,_0xc6694e[_0x9911('0x3f')]);return db[_0x9911('0x40')][_0x9911('0x48')](_0x212df1)[_0x9911('0x23')](handleEntityNotFound(_0x852582,null))['then'](respondWithResult(_0x852582,null))['catch'](handleError(_0x852582,null));};exports[_0x9911('0x49')]=function(_0x2a00c5,_0x3db21d){if(_0x2a00c5[_0x9911('0x4a')]['id']){delete _0x2a00c5[_0x9911('0x4a')]['id'];}return db[_0x9911('0x40')][_0x9911('0x48')]({'where':{'id':_0x2a00c5[_0x9911('0x45')]['id']}})[_0x9911('0x23')](handleEntityNotFound(_0x3db21d,null))[_0x9911('0x23')](saveUpdates(_0x2a00c5[_0x9911('0x4a')],null))[_0x9911('0x23')](respondWithResult(_0x3db21d,null))[_0x9911('0x43')](handleError(_0x3db21d,null));};exports[_0x9911('0x24')]=function(_0x23b60e,_0x2eb18a){return db['CannedAnswer'][_0x9911('0x48')]({'where':{'id':_0x23b60e[_0x9911('0x45')]['id']}})[_0x9911('0x23')](handleEntityNotFound(_0x2eb18a,null))[_0x9911('0x23')](removeEntity(_0x2eb18a,null))[_0x9911('0x43')](handleError(_0x2eb18a,null));};exports[_0x9911('0x4b')]=function(_0x579cba,_0x552fd4){var _0x5cae87={'key':_0x579cba[_0x9911('0x4a')][_0x9911('0x2e')]};if(_0x579cba[_0x9911('0x4a')]['MailAccountId']){_0x5cae87[_0x9911('0x4c')]=_0x579cba[_0x9911('0x4a')][_0x9911('0x4c')];}else if(_0x579cba[_0x9911('0x4a')][_0x9911('0x4d')]){_0x5cae87['SmsAccountId']=_0x579cba[_0x9911('0x4a')][_0x9911('0x4d')];}else if(_0x579cba[_0x9911('0x4a')][_0x9911('0x4e')]){_0x5cae87[_0x9911('0x4e')]=_0x579cba['body'][_0x9911('0x4e')];}else if(_0x579cba[_0x9911('0x4a')]['ChatWebsiteId']){_0x5cae87[_0x9911('0x4f')]=_0x579cba[_0x9911('0x4a')][_0x9911('0x4f')];}return db[_0x9911('0x40')][_0x9911('0x48')]({'where':_0x5cae87})[_0x9911('0x23')](function(_0x418326){if(_0x418326){throw new db[(_0x9911('0x50'))][(_0x9911('0x51'))](_0x9911('0x52'));}return db[_0x9911('0x40')][_0x9911('0x4b')](_0x579cba['body']);})['then'](function(_0x4ef15f){var _0x10dbf6=_0x579cba['user']['get']({'plain':!![]});if(!_0x10dbf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10dbf6[_0x9911('0x53')]===_0x9911('0x54')){var _0x4d2fa0=_0x4ef15f[_0x9911('0x55')]({'plain':!![]});return db[_0x9911('0x56')]['find']({'where':{'name':_0x9911('0x25'),'userProfileId':_0x10dbf6[_0x9911('0x57')]},'raw':!![]})[_0x9911('0x23')](function(_0x54f545){if(_0x54f545&&_0x54f545[_0x9911('0x58')]===0x0){return db[_0x9911('0x26')][_0x9911('0x4b')]({'name':_0x4d2fa0['name'],'resourceId':_0x4d2fa0['id'],'type':_0x54f545[_0x9911('0x29')],'sectionId':_0x54f545['id']},{})[_0x9911('0x23')](function(){return _0x4ef15f;});}else{return _0x4ef15f;}})[_0x9911('0x43')](function(_0x5e3ba2){logger[_0x9911('0x28')](_0x9911('0x59'),_0x5e3ba2);throw _0x5e3ba2;});}return _0x4ef15f;})[_0x9911('0x23')](respondWithResult(_0x552fd4,0xc9))[_0x9911('0x43')](handleError(_0x552fd4,null));}; \ No newline at end of file +var _0x4994=['The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','options','CannedAnswer','findAll','rows','catch','show','params','includeAll','merge','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError'];(function(_0x41b7bd,_0x2ece4c){var _0x4abfc0=function(_0x26368d){while(--_0x26368d){_0x41b7bd['push'](_0x41b7bd['shift']());}};_0x4abfc0(++_0x2ece4c);}(_0x4994,0x117));var _0x4499=function(_0x384392,_0x46ded5){_0x384392=_0x384392-0x0;var _0x148f47=_0x4994[_0x384392];return _0x148f47;};'use strict';var emlformat=require(_0x4499('0x0'));var rimraf=require(_0x4499('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4499('0x2'));var rp=require(_0x4499('0x3'));var moment=require(_0x4499('0x4'));var BPromise=require(_0x4499('0x5'));var Mustache=require(_0x4499('0x6'));var util=require(_0x4499('0x7'));var path=require(_0x4499('0x8'));var sox=require('sox');var csv=require(_0x4499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4499('0xa'));var crypto=require(_0x4499('0xb'));var jsforce=require(_0x4499('0xc'));var deskjs=require(_0x4499('0xd'));var toCsv=require(_0x4499('0x9'));var querystring=require(_0x4499('0xe'));var Papa=require(_0x4499('0xf'));var Redis=require('ioredis');var authService=require(_0x4499('0x10'));var qs=require(_0x4499('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4499('0x12'));var logger=require(_0x4499('0x13'))('api');var utils=require(_0x4499('0x14'));var config=require(_0x4499('0x15'));var licenseUtil=require(_0x4499('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db1b2,_0x5b04ed){_0x5b04ed=_0x5b04ed||0xcc;return function(_0x53a3c8){if(_0x53a3c8){return _0x4db1b2[_0x4499('0x17')](_0x5b04ed);}return _0x4db1b2['status'](_0x5b04ed)[_0x4499('0x18')]();};}function respondWithResult(_0x5eef37,_0xeb3e99){_0xeb3e99=_0xeb3e99||0xc8;return function(_0x9298ef){if(_0x9298ef){return _0x5eef37[_0x4499('0x19')](_0xeb3e99)[_0x4499('0x1a')](_0x9298ef);}};}function respondWithFilteredResult(_0x5dc9bb,_0x1b5780){return function(_0x2cb249){if(_0x2cb249){var _0x1e0776=typeof _0x1b5780['offset']===_0x4499('0x1b')&&typeof _0x1b5780[_0x4499('0x1c')]===_0x4499('0x1b');var _0x11893c=_0x2cb249['count'];var _0x313d62=_0x1e0776?0x0:_0x1b5780['offset'];var _0x2fb115=_0x1e0776?_0x2cb249[_0x4499('0x1d')]:_0x1b5780[_0x4499('0x1e')]+_0x1b5780['limit'];var _0x1a1fd6;if(_0x2fb115>=_0x11893c){_0x2fb115=_0x11893c;_0x1a1fd6=0xc8;}else{_0x1a1fd6=0xce;}_0x5dc9bb['status'](_0x1a1fd6);return _0x5dc9bb[_0x4499('0x1f')](_0x4499('0x20'),_0x313d62+'-'+_0x2fb115+'/'+_0x11893c)[_0x4499('0x1a')](_0x2cb249);}return null;};}function patchUpdates(_0x51f1f8){return function(_0x2e23b7){try{jsonpatch[_0x4499('0x21')](_0x2e23b7,_0x51f1f8,!![]);}catch(_0x5a13e6){return BPromise[_0x4499('0x22')](_0x5a13e6);}return _0x2e23b7['save']();};}function saveUpdates(_0x2a3bde,_0x207abf){return function(_0x4b9979){if(_0x4b9979){return _0x4b9979['update'](_0x2a3bde)[_0x4499('0x23')](function(_0x265b3f){return _0x265b3f;});}return null;};}function removeEntity(_0x480664,_0x344f96){return function(_0x376862){if(_0x376862){return _0x376862[_0x4499('0x24')]()[_0x4499('0x23')](function(){var _0x527fcf=_0x376862[_0x4499('0x25')]({'plain':!![]});var _0xd161d2=_0x4499('0x26');return db['UserProfileResource'][_0x4499('0x24')]({'where':{'type':_0xd161d2,'resourceId':_0x527fcf['id']}})[_0x4499('0x23')](function(){return _0x376862;});})[_0x4499('0x23')](function(){_0x480664[_0x4499('0x19')](0xcc)[_0x4499('0x18')]();});}};}function handleEntityNotFound(_0x49137a,_0x3ac8d9){return function(_0x4e5aeb){if(!_0x4e5aeb){_0x49137a['sendStatus'](0x194);}return _0x4e5aeb;};}function handleError(_0x93dc8,_0x2759db){_0x2759db=_0x2759db||0x1f4;return function(_0xeaa6b7){logger[_0x4499('0x27')](_0xeaa6b7[_0x4499('0x28')]);if(_0xeaa6b7['name']){delete _0xeaa6b7[_0x4499('0x29')];}_0x93dc8[_0x4499('0x19')](_0x2759db)[_0x4499('0x2a')](_0xeaa6b7);};}exports[_0x4499('0x2b')]=function(_0x3fb9a3,_0x1bda41){var _0x27ce9c={},_0x155d94={},_0x5f2d13={'count':0x0,'rows':[]};var _0x1a1cf5=_[_0x4499('0x2c')](db['CannedAnswer'][_0x4499('0x2d')],function(_0x47bbfe){return{'name':_0x47bbfe[_0x4499('0x2e')],'type':_0x47bbfe[_0x4499('0x2f')][_0x4499('0x30')]};});_0x155d94[_0x4499('0x31')]=_[_0x4499('0x2c')](_0x1a1cf5,_0x4499('0x29'));_0x155d94[_0x4499('0x32')]=_[_0x4499('0x33')](_0x3fb9a3['query']);_0x155d94[_0x4499('0x34')]=_[_0x4499('0x35')](_0x155d94[_0x4499('0x31')],_0x155d94[_0x4499('0x32')]);_0x27ce9c['attributes']=_[_0x4499('0x35')](_0x155d94[_0x4499('0x31')],qs[_0x4499('0x36')](_0x3fb9a3[_0x4499('0x32')][_0x4499('0x36')]));_0x27ce9c[_0x4499('0x37')]=_0x27ce9c[_0x4499('0x37')][_0x4499('0x38')]?_0x27ce9c[_0x4499('0x37')]:_0x155d94[_0x4499('0x31')];if(!_0x3fb9a3[_0x4499('0x32')][_0x4499('0x39')](_0x4499('0x3a'))){_0x27ce9c[_0x4499('0x1c')]=qs[_0x4499('0x1c')](_0x3fb9a3['query'][_0x4499('0x1c')]);_0x27ce9c[_0x4499('0x1e')]=qs[_0x4499('0x1e')](_0x3fb9a3[_0x4499('0x32')][_0x4499('0x1e')]);}_0x27ce9c[_0x4499('0x3b')]=qs[_0x4499('0x3c')](_0x3fb9a3[_0x4499('0x32')][_0x4499('0x3c')]);_0x27ce9c[_0x4499('0x3d')]=qs[_0x4499('0x34')](_['pick'](_0x3fb9a3[_0x4499('0x32')],_0x155d94[_0x4499('0x34')]),_0x1a1cf5);if(_0x3fb9a3[_0x4499('0x32')]['filter']){_0x27ce9c[_0x4499('0x3d')]=_['merge'](_0x27ce9c[_0x4499('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3fb9a3[_0x4499('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x3fb9a3[_0x4499('0x32')][_0x4499('0x3e')]+'%'}}]});}_0x27ce9c=_['merge']({},_0x27ce9c,_0x3fb9a3[_0x4499('0x3f')]);var _0x273ce6={'where':_0x27ce9c[_0x4499('0x3d')]};return db[_0x4499('0x40')][_0x4499('0x1d')](_0x273ce6)[_0x4499('0x23')](function(_0x33034f){_0x5f2d13[_0x4499('0x1d')]=_0x33034f;if(_0x3fb9a3[_0x4499('0x32')]['includeAll']){_0x27ce9c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4499('0x41')](_0x27ce9c);})[_0x4499('0x23')](function(_0x3fd6fb){_0x5f2d13[_0x4499('0x42')]=_0x3fd6fb;return _0x5f2d13;})[_0x4499('0x23')](respondWithFilteredResult(_0x1bda41,_0x27ce9c))[_0x4499('0x43')](handleError(_0x1bda41,null));};exports[_0x4499('0x44')]=function(_0x4ae052,_0x18c26f){var _0x4faf3b={'raw':!![],'where':{'id':_0x4ae052[_0x4499('0x45')]['id']}},_0x5928d3={};_0x5928d3[_0x4499('0x31')]=_[_0x4499('0x33')](db[_0x4499('0x40')][_0x4499('0x2d')]);_0x5928d3[_0x4499('0x32')]=_[_0x4499('0x33')](_0x4ae052[_0x4499('0x32')]);_0x5928d3['filters']=_['intersection'](_0x5928d3[_0x4499('0x31')],_0x5928d3[_0x4499('0x32')]);_0x4faf3b[_0x4499('0x37')]=_[_0x4499('0x35')](_0x5928d3[_0x4499('0x31')],qs['fields'](_0x4ae052['query']['fields']));_0x4faf3b[_0x4499('0x37')]=_0x4faf3b[_0x4499('0x37')][_0x4499('0x38')]?_0x4faf3b[_0x4499('0x37')]:_0x5928d3[_0x4499('0x31')];if(_0x4ae052[_0x4499('0x32')][_0x4499('0x46')]){_0x4faf3b['include']=[{'all':!![]}];}_0x4faf3b=_[_0x4499('0x47')]({},_0x4faf3b,_0x4ae052[_0x4499('0x3f')]);return db[_0x4499('0x40')][_0x4499('0x48')](_0x4faf3b)[_0x4499('0x23')](handleEntityNotFound(_0x18c26f,null))[_0x4499('0x23')](respondWithResult(_0x18c26f,null))[_0x4499('0x43')](handleError(_0x18c26f,null));};exports[_0x4499('0x49')]=function(_0x3eb3ab,_0x5b4cdd){if(_0x3eb3ab['body']['id']){delete _0x3eb3ab['body']['id'];}return db[_0x4499('0x40')][_0x4499('0x48')]({'where':{'id':_0x3eb3ab['params']['id']}})[_0x4499('0x23')](handleEntityNotFound(_0x5b4cdd,null))[_0x4499('0x23')](saveUpdates(_0x3eb3ab[_0x4499('0x4a')],null))[_0x4499('0x23')](respondWithResult(_0x5b4cdd,null))['catch'](handleError(_0x5b4cdd,null));};exports[_0x4499('0x24')]=function(_0x4a23b1,_0x200c1b){return db[_0x4499('0x40')][_0x4499('0x48')]({'where':{'id':_0x4a23b1[_0x4499('0x45')]['id']}})[_0x4499('0x23')](handleEntityNotFound(_0x200c1b,null))[_0x4499('0x23')](removeEntity(_0x200c1b,null))[_0x4499('0x43')](handleError(_0x200c1b,null));};exports[_0x4499('0x4b')]=function(_0x38444c,_0x462ea9){var _0x28af17={'key':_0x38444c[_0x4499('0x4a')][_0x4499('0x30')]};if(_0x38444c[_0x4499('0x4a')]['MailAccountId']){_0x28af17[_0x4499('0x4c')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4c')];}else if(_0x38444c[_0x4499('0x4a')]['SmsAccountId']){_0x28af17[_0x4499('0x4d')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4d')];}else if(_0x38444c['body'][_0x4499('0x4e')]){_0x28af17[_0x4499('0x4e')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4e')];}else if(_0x38444c[_0x4499('0x4a')][_0x4499('0x4f')]){_0x28af17[_0x4499('0x4f')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4f')];}return db[_0x4499('0x40')]['find']({'where':_0x28af17})[_0x4499('0x23')](function(_0x120aeb){if(_0x120aeb){throw new db['Sequelize'][(_0x4499('0x50'))](_0x4499('0x51'));}return db[_0x4499('0x40')][_0x4499('0x4b')](_0x38444c[_0x4499('0x4a')]);})[_0x4499('0x23')](function(_0x99466b){var _0xbf84ad=_0x38444c[_0x4499('0x52')][_0x4499('0x25')]({'plain':!![]});if(!_0xbf84ad)throw new Error(_0x4499('0x53'));if(_0xbf84ad[_0x4499('0x54')]==='user'){var _0x250bfd=_0x99466b[_0x4499('0x25')]({'plain':!![]});return db[_0x4499('0x55')][_0x4499('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0xbf84ad[_0x4499('0x56')]},'raw':!![]})[_0x4499('0x23')](function(_0x43c697){if(_0x43c697&&_0x43c697[_0x4499('0x57')]===0x0){return db[_0x4499('0x58')][_0x4499('0x4b')]({'name':_0x250bfd[_0x4499('0x29')],'resourceId':_0x250bfd['id'],'type':_0x43c697[_0x4499('0x29')],'sectionId':_0x43c697['id']},{})['then'](function(){return _0x99466b;});}else{return _0x99466b;}})[_0x4499('0x43')](function(_0xb2395e){logger[_0x4499('0x27')](_0x4499('0x59'),_0xb2395e);throw _0xb2395e;});}return _0x99466b;})[_0x4499('0x23')](respondWithResult(_0x462ea9,0xc9))[_0x4499('0x43')](handleError(_0x462ea9,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ad90199..c7f1ae4 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 _0xc2e1=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3771eb,_0x2361c7){var _0x3e4a02=function(_0x5eb364){while(--_0x5eb364){_0x3771eb['push'](_0x3771eb['shift']());}};_0x3e4a02(++_0x2361c7);}(_0xc2e1,0x1b3));var _0x1c2e=function(_0x1a3f08,_0x1ac9e0){_0x1a3f08=_0x1a3f08-0x0;var _0x2057f6=_0xc2e1[_0x1a3f08];return _0x2057f6;};'use strict';var _=require(_0x1c2e('0x0'));var util=require('util');var logger=require(_0x1c2e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1c2e('0x2'));var rp=require(_0x1c2e('0x3'));var fs=require('fs');var path=require(_0x1c2e('0x4'));var rimraf=require(_0x1c2e('0x5'));var config=require(_0x1c2e('0x6'));var attributes=require(_0x1c2e('0x7'));module[_0x1c2e('0x8')]=function(_0x237fa8,_0x31a7df){return _0x237fa8[_0x1c2e('0x9')]('CannedAnswer',attributes,{'tableName':_0x1c2e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c2e('0xb'),'collate':_0x1c2e('0xc')});}; \ No newline at end of file +var _0x3cab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','utf8mb4_unicode_ci'];(function(_0x2d1290,_0xc13145){var _0x861ae2=function(_0x1abac0){while(--_0x1abac0){_0x2d1290['push'](_0x2d1290['shift']());}};_0x861ae2(++_0xc13145);}(_0x3cab,0x1bc));var _0xb3ca=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3cab[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xb3ca('0x0'));var util=require(_0xb3ca('0x1'));var logger=require(_0xb3ca('0x2'))(_0xb3ca('0x3'));var moment=require(_0xb3ca('0x4'));var BPromise=require(_0xb3ca('0x5'));var rp=require(_0xb3ca('0x6'));var fs=require('fs');var path=require(_0xb3ca('0x7'));var rimraf=require('rimraf');var config=require(_0xb3ca('0x8'));var attributes=require(_0xb3ca('0x9'));module[_0xb3ca('0xa')]=function(_0x462312,_0x327f7f){return _0x462312['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb3ca('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 31bea5c..6f0cf8e 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(_0x181431,_0x414c32){var _0xc0536=function(_0x26a622){while(--_0x26a622){_0x181431['push'](_0x181431['shift']());}};_0xc0536(++_0x414c32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x16c4a5,_0x4ce71c){var _0x454081=function(_0x640fc){while(--_0x640fc){_0x16c4a5['push'](_0x16c4a5['shift']());}};_0x454081(++_0x4ce71c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 0e89e92..537ea29 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 _0x9eb9=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x59a0f3,_0x1828e9){var _0x31ea30=function(_0x213711){while(--_0x213711){_0x59a0f3['push'](_0x59a0f3['shift']());}};_0x31ea30(++_0x1828e9);}(_0x9eb9,0x10c));var _0x99eb=function(_0x5a4bf8,_0x131755){_0x5a4bf8=_0x5a4bf8-0x0;var _0x4c0bb3=_0x9eb9[_0x5a4bf8];return _0x4c0bb3;};'use strict';var multer=require(_0x99eb('0x0'));var util=require(_0x99eb('0x1'));var path=require(_0x99eb('0x2'));var timeout=require(_0x99eb('0x3'));var express=require(_0x99eb('0x4'));var router=express[_0x99eb('0x5')]();var fs_extra=require(_0x99eb('0x6'));var auth=require(_0x99eb('0x7'));var interaction=require(_0x99eb('0x8'));var config=require(_0x99eb('0x9'));var controller=require(_0x99eb('0xa'));router[_0x99eb('0xb')]('/',auth[_0x99eb('0xc')](),controller[_0x99eb('0xd')]);router[_0x99eb('0xb')]('/:id',auth[_0x99eb('0xc')](),controller[_0x99eb('0xe')]);router[_0x99eb('0xf')]('/',auth[_0x99eb('0xc')](),controller[_0x99eb('0x10')]);router[_0x99eb('0x11')](_0x99eb('0x12'),auth[_0x99eb('0xc')](),controller[_0x99eb('0x13')]);router[_0x99eb('0x14')](_0x99eb('0x12'),auth[_0x99eb('0xc')](),controller[_0x99eb('0x15')]);module[_0x99eb('0x16')]=router; \ No newline at end of file +var _0x5cfa=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x299c5d,_0x205212){var _0x1985fe=function(_0x286592){while(--_0x286592){_0x299c5d['push'](_0x299c5d['shift']());}};_0x1985fe(++_0x205212);}(_0x5cfa,0x1d5));var _0xa5cf=function(_0x43bcaf,_0x1f439b){_0x43bcaf=_0x43bcaf-0x0;var _0x5e8ba2=_0x5cfa[_0x43bcaf];return _0x5e8ba2;};'use strict';var multer=require('multer');var util=require(_0xa5cf('0x0'));var path=require(_0xa5cf('0x1'));var timeout=require(_0xa5cf('0x2'));var express=require(_0xa5cf('0x3'));var router=express['Router']();var fs_extra=require(_0xa5cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5cf('0x5'));var config=require(_0xa5cf('0x6'));var controller=require(_0xa5cf('0x7'));router['get']('/',auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x9')]);router['get'](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xb')]);router[_0xa5cf('0xc')]('/',auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xd')]);router[_0xa5cf('0xe')](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xf')]);router[_0xa5cf('0x10')](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller['destroy']);module[_0xa5cf('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index f43b2b3..f769ef1 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 _0x5271=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x553019,_0x5dd7b9){var _0x2bc10e=function(_0x365bd4){while(--_0x365bd4){_0x553019['push'](_0x553019['shift']());}};_0x2bc10e(++_0x5dd7b9);}(_0x5271,0xa0));var _0x1527=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x5271[_0x5cb1af];return _0x8d7940;};'use strict';var Sequelize=require(_0x1527('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x1527('0x1')],'allowNull':![],'defaultValue':_0x1527('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1527('0x3')]},'dst':{'type':Sequelize[_0x1527('0x3')]},'dcontext':{'type':Sequelize[_0x1527('0x3')]},'channel':{'type':Sequelize[_0x1527('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x1527('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1527('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1527('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1527('0x3')]},'uniqueid':{'type':Sequelize[_0x1527('0x3')]},'linkedid':{'type':Sequelize[_0x1527('0x3')]},'sequence':{'type':Sequelize[_0x1527('0x3')]},'peeraccount':{'type':Sequelize[_0x1527('0x3')]},'type':{'type':Sequelize[_0x1527('0x3')]},'tag':{'type':Sequelize[_0x1527('0x3')]}}; \ No newline at end of file +var _0xe1bf=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x1e3fb3,_0x156869){var _0x4db740=function(_0x4b5303){while(--_0x4b5303){_0x1e3fb3['push'](_0x1e3fb3['shift']());}};_0x4db740(++_0x156869);}(_0xe1bf,0x67));var _0xfe1b=function(_0x32ae13,_0x8c267a){_0x32ae13=_0x32ae13-0x0;var _0x4b78d8=_0xe1bf[_0x32ae13];return _0x4b78d8;};'use strict';var Sequelize=require('sequelize');module[_0xfe1b('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xfe1b('0x1')},'clid':{'type':Sequelize[_0xfe1b('0x2')]},'src':{'type':Sequelize[_0xfe1b('0x2')]},'dst':{'type':Sequelize[_0xfe1b('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfe1b('0x2')]},'dstchannel':{'type':Sequelize[_0xfe1b('0x2')]},'lastapp':{'type':Sequelize[_0xfe1b('0x2')]},'lastdata':{'type':Sequelize[_0xfe1b('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfe1b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfe1b('0x2')]},'amaflags':{'type':Sequelize[_0xfe1b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xfe1b('0x2')]},'uniqueid':{'type':Sequelize[_0xfe1b('0x2')]},'linkedid':{'type':Sequelize[_0xfe1b('0x2')]},'sequence':{'type':Sequelize[_0xfe1b('0x2')]},'peeraccount':{'type':Sequelize[_0xfe1b('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfe1b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 80ff259..98425b3 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 _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x17ed0e,_0x266562){var _0x16c92a=function(_0x28b59b){while(--_0x28b59b){_0x17ed0e['push'](_0x17ed0e['shift']());}};_0x16c92a(++_0x266562);}(_0x86f4,0x18a));var _0x486f=function(_0x43c7fa,_0x19eba1){_0x43c7fa=_0x43c7fa-0x0;var _0x42bf81=_0x86f4[_0x43c7fa];return _0x42bf81;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));}; \ No newline at end of file +var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5292,0xf7));var _0x2529=function(_0x114b54,_0x3ed9bb){_0x114b54=_0x114b54-0x0;var _0x21c37f=_0x5292[_0x114b54];return _0x21c37f;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 1f38ff8..5a96f42 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52ffc9,_0x3e3b69){var _0x30ea46=function(_0x4875da){while(--_0x4875da){_0x52ffc9['push'](_0x52ffc9['shift']());}};_0x30ea46(++_0x3e3b69);}(_0x7a54,0x106));var _0x47a5=function(_0x2eb3e5,_0x4e7609){_0x2eb3e5=_0x2eb3e5-0x0;var _0x43122d=_0x7a54[_0x2eb3e5];return _0x43122d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3eb755,_0x135c92){var _0x547f03=function(_0x552cf3){while(--_0x552cf3){_0x3eb755['push'](_0x3eb755['shift']());}};_0x547f03(++_0x135c92);}(_0x7a54,0x106));var _0x47a5=function(_0x4933d0,_0x23817d){_0x4933d0=_0x4933d0-0x0;var _0x47c52e=_0x7a54[_0x4933d0];return _0x47c52e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 342903a..b926559 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 _0x934f=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x934f,0x17f));var _0xf934=function(_0x294f4d,_0x35032d){_0x294f4d=_0x294f4d-0x0;var _0x3519ce=_0x934f[_0x294f4d];return _0x3519ce;};'use strict';var _=require(_0xf934('0x0'));var util=require(_0xf934('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf934('0x2'));var fs=require('fs');var Redis=require(_0xf934('0x3'));var db=require(_0xf934('0x4'))['db'];var utils=require(_0xf934('0x5'));var logger=require(_0xf934('0x6'))(_0xf934('0x7'));var config=require(_0xf934('0x8'));var jayson=require(_0xf934('0x9'));var client=jayson[_0xf934('0xa')][_0xf934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ff30a,_0x3517ea,_0x2ef897){return new BPromise(function(_0x62ac2c,_0x562ceb){return client[_0xf934('0xc')](_0x1ff30a,_0x2ef897)['then'](function(_0x28e034){logger[_0xf934('0xd')](_0xf934('0xe'),_0x3517ea,_0xf934('0xf'));logger[_0xf934('0x10')](_0xf934('0x11'),_0x3517ea,_0xf934('0xf'),JSON[_0xf934('0x12')](_0x28e034));if(_0x28e034[_0xf934('0x13')]){if(_0x28e034[_0xf934('0x13')]['code']===0x1f4){logger[_0xf934('0x13')]('Cdr,\x20%s,\x20%s',_0x3517ea,_0x28e034[_0xf934('0x13')]['message']);return _0x562ceb(_0x28e034[_0xf934('0x13')]['message']);}logger[_0xf934('0x13')](_0xf934('0xe'),_0x3517ea,_0x28e034[_0xf934('0x13')][_0xf934('0x14')]);return _0x62ac2c(_0x28e034[_0xf934('0x13')][_0xf934('0x14')]);}else{logger[_0xf934('0xd')](_0xf934('0xe'),_0x3517ea,_0xf934('0xf'));_0x62ac2c(_0x28e034['result']['message']);}})[_0xf934('0x15')](function(_0x212ccb){logger[_0xf934('0x13')](_0xf934('0xe'),_0x3517ea,_0x212ccb);_0x562ceb(_0x212ccb);});});} \ No newline at end of file +var _0x68e4=['stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xde0a73,_0x4aef8c){var _0x167c5b=function(_0x17e55b){while(--_0x17e55b){_0xde0a73['push'](_0xde0a73['shift']());}};_0x167c5b(++_0x4aef8c);}(_0x68e4,0x16d));var _0x468e=function(_0x33a414,_0x3df1ae){_0x33a414=_0x33a414-0x0;var _0x547b48=_0x68e4[_0x33a414];return _0x547b48;};'use strict';var _=require(_0x468e('0x0'));var util=require('util');var moment=require(_0x468e('0x1'));var BPromise=require(_0x468e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x468e('0x3'))['db'];var utils=require(_0x468e('0x4'));var logger=require('../../config/logger')(_0x468e('0x5'));var config=require(_0x468e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x468e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb598,_0x588e2c,_0x35ffc5){return new BPromise(function(_0x5a6470,_0x1a93cd){return client[_0x468e('0x8')](_0x5eb598,_0x35ffc5)[_0x468e('0x9')](function(_0x42d1f5){logger[_0x468e('0xa')](_0x468e('0xb'),_0x588e2c,'request\x20sent');logger[_0x468e('0xc')](_0x468e('0xd'),_0x588e2c,_0x468e('0xe'),JSON[_0x468e('0xf')](_0x42d1f5));if(_0x42d1f5['error']){if(_0x42d1f5[_0x468e('0x10')]['code']===0x1f4){logger[_0x468e('0x10')](_0x468e('0xb'),_0x588e2c,_0x42d1f5[_0x468e('0x10')][_0x468e('0x11')]);return _0x1a93cd(_0x42d1f5[_0x468e('0x10')][_0x468e('0x11')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x588e2c,_0x42d1f5['error']['message']);return _0x5a6470(_0x42d1f5['error'][_0x468e('0x11')]);}else{logger[_0x468e('0xa')](_0x468e('0xb'),_0x588e2c,'request\x20sent');_0x5a6470(_0x42d1f5[_0x468e('0x12')]['message']);}})[_0x468e('0x13')](function(_0x2ebf88){logger['error'](_0x468e('0xb'),_0x588e2c,_0x2ebf88);_0x1a93cd(_0x2ebf88);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3871972..c4443ff 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2e0cfd,_0x505a26){var _0x387a04=function(_0x295f8b){while(--_0x295f8b){_0x2e0cfd['push'](_0x2e0cfd['shift']());}};_0x387a04(++_0x505a26);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d07e1,_0x418799){_0x5d07e1=_0x5d07e1-0x0;var _0x21617f=_0xb10b[_0x5d07e1];return _0x21617f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 88bef2f..6296463 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 _0xdc42=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xdc42,0x1b4));var _0x2dc4=function(_0x40e74c,_0x1883a2){_0x40e74c=_0x40e74c-0x0;var _0x3a8c6b=_0xdc42[_0x40e74c];return _0x3a8c6b;};'use strict';var Sequelize=require(_0x2dc4('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2dc4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2dc4('0x2')]()},'description':{'type':Sequelize[_0x2dc4('0x3')]},'interval':{'type':Sequelize[_0x2dc4('0x3')],'defaultValue':_0x2dc4('0x4')}}; \ No newline at end of file +var _0x66b9=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x66b9,0xe5));var _0x966b=function(_0x2b115d,_0x47fd38){_0x2b115d=_0x2b115d-0x0;var _0x38d65a=_0x66b9[_0x2b115d];return _0x38d65a;};'use strict';var Sequelize=require(_0x966b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x966b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x966b('0x2')],'allowNull':![],'defaultValue':_0x966b('0x3')},'appdata':{'type':Sequelize[_0x966b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x966b('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index cdf778e..c4d9856 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 _0x5127=['sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','send','model','keys','ChatApplication','rawAttributes','intersection','fields','query','attributes','length','merge','options','find','catch','update','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0x5127,0x18f));var _0x7512=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x5127[_0x170772];return _0x3ef69c;};'use strict';var emlformat=require(_0x7512('0x0'));var rimraf=require(_0x7512('0x1'));var zipdir=require(_0x7512('0x2'));var jsonpatch=require(_0x7512('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7512('0x4'));var Mustache=require('mustache');var util=require(_0x7512('0x5'));var path=require(_0x7512('0x6'));var sox=require(_0x7512('0x7'));var csv=require(_0x7512('0x8'));var ejs=require(_0x7512('0x9'));var fs=require('fs');var fs_extra=require(_0x7512('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7512('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7512('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7512('0xd'));var Papa=require(_0x7512('0xe'));var Redis=require(_0x7512('0xf'));var authService=require(_0x7512('0x10'));var qs=require(_0x7512('0x11'));var as=require(_0x7512('0x12'));var hardwareService=require(_0x7512('0x13'));var logger=require(_0x7512('0x14'))(_0x7512('0x15'));var utils=require(_0x7512('0x16'));var config=require(_0x7512('0x17'));var licenseUtil=require(_0x7512('0x18'));var db=require(_0x7512('0x19'))['db'];function respondWithStatusCode(_0x599ce4,_0x472323){_0x472323=_0x472323||0xcc;return function(_0x474746){if(_0x474746){return _0x599ce4[_0x7512('0x1a')](_0x472323);}return _0x599ce4['status'](_0x472323)[_0x7512('0x1b')]();};}function respondWithResult(_0x57813c,_0x3069a1){_0x3069a1=_0x3069a1||0xc8;return function(_0x3ef1fc){if(_0x3ef1fc){return _0x57813c[_0x7512('0x1c')](_0x3069a1)[_0x7512('0x1d')](_0x3ef1fc);}};}function respondWithFilteredResult(_0x4968a5,_0x519aad){return function(_0x5a4101){if(_0x5a4101){var _0x219f4c=typeof _0x519aad[_0x7512('0x1e')]===_0x7512('0x1f')&&typeof _0x519aad[_0x7512('0x20')]==='undefined';var _0x82484a=_0x5a4101['count'];var _0x10858d=_0x219f4c?0x0:_0x519aad[_0x7512('0x1e')];var _0x1d357b=_0x219f4c?_0x5a4101[_0x7512('0x21')]:_0x519aad[_0x7512('0x1e')]+_0x519aad[_0x7512('0x20')];var _0x67c45e;if(_0x1d357b>=_0x82484a){_0x1d357b=_0x82484a;_0x67c45e=0xc8;}else{_0x67c45e=0xce;}_0x4968a5[_0x7512('0x1c')](_0x67c45e);return _0x4968a5[_0x7512('0x22')](_0x7512('0x23'),_0x10858d+'-'+_0x1d357b+'/'+_0x82484a)['json'](_0x5a4101);}return null;};}function patchUpdates(_0x3c8b39){return function(_0x41bb33){try{jsonpatch['apply'](_0x41bb33,_0x3c8b39,!![]);}catch(_0x4862d6){return BPromise[_0x7512('0x24')](_0x4862d6);}return _0x41bb33[_0x7512('0x25')]();};}function saveUpdates(_0x16cabb,_0x2279a0){return function(_0x24baaf){if(_0x24baaf){return _0x24baaf['update'](_0x16cabb)[_0x7512('0x26')](function(_0x28aa80){return _0x28aa80;});}return null;};}function removeEntity(_0x101f57,_0x21cb99){return function(_0x14f0e2){if(_0x14f0e2){return _0x14f0e2['destroy']()[_0x7512('0x26')](function(){_0x101f57[_0x7512('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c88dd,_0x5e0cfd){return function(_0x5df068){if(!_0x5df068){_0x2c88dd[_0x7512('0x1a')](0x194);}return _0x5df068;};}function handleError(_0x3ccd5f,_0x1a5985){_0x1a5985=_0x1a5985||0x1f4;return function(_0x5784ba){logger['error'](_0x5784ba['stack']);if(_0x5784ba[_0x7512('0x27')]){delete _0x5784ba['name'];}_0x3ccd5f['status'](_0x1a5985)[_0x7512('0x28')](_0x5784ba);};}exports['show']=function(_0x1c0442,_0x133d18){var _0x2f8df2={'raw':!![],'where':{'id':_0x1c0442['params']['id']}},_0x4c676c={};_0x4c676c[_0x7512('0x29')]=_[_0x7512('0x2a')](db[_0x7512('0x2b')][_0x7512('0x2c')]);_0x4c676c['query']=_[_0x7512('0x2a')](_0x1c0442['query']);_0x4c676c['filters']=_[_0x7512('0x2d')](_0x4c676c[_0x7512('0x29')],_0x4c676c['query']);_0x2f8df2['attributes']=_[_0x7512('0x2d')](_0x4c676c['model'],qs[_0x7512('0x2e')](_0x1c0442[_0x7512('0x2f')][_0x7512('0x2e')]));_0x2f8df2[_0x7512('0x30')]=_0x2f8df2['attributes'][_0x7512('0x31')]?_0x2f8df2['attributes']:_0x4c676c[_0x7512('0x29')];if(_0x1c0442[_0x7512('0x2f')]['includeAll']){_0x2f8df2['include']=[{'all':!![]}];}_0x2f8df2=_[_0x7512('0x32')]({},_0x2f8df2,_0x1c0442[_0x7512('0x33')]);return db['ChatApplication'][_0x7512('0x34')](_0x2f8df2)[_0x7512('0x26')](handleEntityNotFound(_0x133d18,null))[_0x7512('0x26')](respondWithResult(_0x133d18,null))[_0x7512('0x35')](handleError(_0x133d18,null));};exports[_0x7512('0x36')]=function(_0x20e8fb,_0x5b566d){if(_0x20e8fb[_0x7512('0x37')]['id']){delete _0x20e8fb[_0x7512('0x37')]['id'];}return db[_0x7512('0x2b')]['find']({'where':{'id':_0x20e8fb[_0x7512('0x38')]['id']}})[_0x7512('0x26')](handleEntityNotFound(_0x5b566d,null))['then'](saveUpdates(_0x20e8fb[_0x7512('0x37')],null))[_0x7512('0x26')](respondWithResult(_0x5b566d,null))['catch'](handleError(_0x5b566d,null));};exports[_0x7512('0x39')]=function(_0x5cc6a1,_0x325da0){return db[_0x7512('0x2b')]['find']({'where':{'id':_0x5cc6a1[_0x7512('0x38')]['id']}})['then'](handleEntityNotFound(_0x325da0,null))[_0x7512('0x26')](removeEntity(_0x325da0,null))['catch'](handleError(_0x325da0,null));}; \ No newline at end of file +var _0x4345=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','error','stack','name','show','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','then','catch','body','params','eml-format'];(function(_0x143339,_0x17ee42){var _0x3165ea=function(_0x26ccd7){while(--_0x26ccd7){_0x143339['push'](_0x143339['shift']());}};_0x3165ea(++_0x17ee42);}(_0x4345,0x77));var _0x5434=function(_0x2ddf82,_0x3892a8){_0x2ddf82=_0x2ddf82-0x0;var _0x2d2f1c=_0x4345[_0x2ddf82];return _0x2d2f1c;};'use strict';var emlformat=require(_0x5434('0x0'));var rimraf=require(_0x5434('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5434('0x2'));var rp=require(_0x5434('0x3'));var moment=require(_0x5434('0x4'));var BPromise=require(_0x5434('0x5'));var Mustache=require('mustache');var util=require(_0x5434('0x6'));var path=require('path');var sox=require(_0x5434('0x7'));var csv=require(_0x5434('0x8'));var ejs=require(_0x5434('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5434('0xa'));var squel=require('squel');var crypto=require(_0x5434('0xb'));var jsforce=require(_0x5434('0xc'));var deskjs=require(_0x5434('0xd'));var toCsv=require(_0x5434('0x8'));var querystring=require(_0x5434('0xe'));var Papa=require(_0x5434('0xf'));var Redis=require(_0x5434('0x10'));var authService=require(_0x5434('0x11'));var qs=require(_0x5434('0x12'));var as=require(_0x5434('0x13'));var hardwareService=require(_0x5434('0x14'));var logger=require(_0x5434('0x15'))(_0x5434('0x16'));var utils=require(_0x5434('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5434('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a2d9,_0xf27177){_0xf27177=_0xf27177||0xcc;return function(_0x13a13f){if(_0x13a13f){return _0x36a2d9[_0x5434('0x19')](_0xf27177);}return _0x36a2d9['status'](_0xf27177)[_0x5434('0x1a')]();};}function respondWithResult(_0x223766,_0x5aa606){_0x5aa606=_0x5aa606||0xc8;return function(_0x44ea26){if(_0x44ea26){return _0x223766[_0x5434('0x1b')](_0x5aa606)[_0x5434('0x1c')](_0x44ea26);}};}function respondWithFilteredResult(_0x1a7a2c,_0x48be48){return function(_0x2b88c4){if(_0x2b88c4){var _0x437664=typeof _0x48be48['offset']===_0x5434('0x1d')&&typeof _0x48be48['limit']===_0x5434('0x1d');var _0x42a118=_0x2b88c4[_0x5434('0x1e')];var _0x148b3c=_0x437664?0x0:_0x48be48[_0x5434('0x1f')];var _0x2d60be=_0x437664?_0x2b88c4[_0x5434('0x1e')]:_0x48be48['offset']+_0x48be48[_0x5434('0x20')];var _0x5a4570;if(_0x2d60be>=_0x42a118){_0x2d60be=_0x42a118;_0x5a4570=0xc8;}else{_0x5a4570=0xce;}_0x1a7a2c[_0x5434('0x1b')](_0x5a4570);return _0x1a7a2c['set'](_0x5434('0x21'),_0x148b3c+'-'+_0x2d60be+'/'+_0x42a118)[_0x5434('0x1c')](_0x2b88c4);}return null;};}function patchUpdates(_0x240787){return function(_0x4d34d6){try{jsonpatch[_0x5434('0x22')](_0x4d34d6,_0x240787,!![]);}catch(_0x2513e9){return BPromise[_0x5434('0x23')](_0x2513e9);}return _0x4d34d6[_0x5434('0x24')]();};}function saveUpdates(_0x1da16d,_0x5c43ef){return function(_0x5e92d0){if(_0x5e92d0){return _0x5e92d0[_0x5434('0x25')](_0x1da16d)['then'](function(_0x4524f9){return _0x4524f9;});}return null;};}function removeEntity(_0x85a5a1,_0x464093){return function(_0xd83da2){if(_0xd83da2){return _0xd83da2['destroy']()['then'](function(){_0x85a5a1[_0x5434('0x1b')](0xcc)[_0x5434('0x1a')]();});}};}function handleEntityNotFound(_0x27ea93,_0x417dc1){return function(_0x2c8fb1){if(!_0x2c8fb1){_0x27ea93[_0x5434('0x19')](0x194);}return _0x2c8fb1;};}function handleError(_0xaa9184,_0xa0f1b2){_0xa0f1b2=_0xa0f1b2||0x1f4;return function(_0x1b827f){logger[_0x5434('0x26')](_0x1b827f[_0x5434('0x27')]);if(_0x1b827f[_0x5434('0x28')]){delete _0x1b827f['name'];}_0xaa9184['status'](_0xa0f1b2)['send'](_0x1b827f);};}exports[_0x5434('0x29')]=function(_0x124371,_0x4189f9){var _0x1330ff={'raw':!![],'where':{'id':_0x124371['params']['id']}},_0x4598bd={};_0x4598bd[_0x5434('0x2a')]=_[_0x5434('0x2b')](db['ChatApplication'][_0x5434('0x2c')]);_0x4598bd[_0x5434('0x2d')]=_['keys'](_0x124371['query']);_0x4598bd['filters']=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],_0x4598bd[_0x5434('0x2d')]);_0x1330ff[_0x5434('0x2f')]=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],qs['fields'](_0x124371[_0x5434('0x2d')][_0x5434('0x30')]));_0x1330ff[_0x5434('0x2f')]=_0x1330ff[_0x5434('0x2f')][_0x5434('0x31')]?_0x1330ff[_0x5434('0x2f')]:_0x4598bd[_0x5434('0x2a')];if(_0x124371['query'][_0x5434('0x32')]){_0x1330ff[_0x5434('0x33')]=[{'all':!![]}];}_0x1330ff=_[_0x5434('0x34')]({},_0x1330ff,_0x124371[_0x5434('0x35')]);return db[_0x5434('0x36')][_0x5434('0x37')](_0x1330ff)['then'](handleEntityNotFound(_0x4189f9,null))[_0x5434('0x38')](respondWithResult(_0x4189f9,null))[_0x5434('0x39')](handleError(_0x4189f9,null));};exports[_0x5434('0x25')]=function(_0x168db5,_0x24f907){if(_0x168db5[_0x5434('0x3a')]['id']){delete _0x168db5[_0x5434('0x3a')]['id'];}return db[_0x5434('0x36')][_0x5434('0x37')]({'where':{'id':_0x168db5[_0x5434('0x3b')]['id']}})['then'](handleEntityNotFound(_0x24f907,null))[_0x5434('0x38')](saveUpdates(_0x168db5[_0x5434('0x3a')],null))[_0x5434('0x38')](respondWithResult(_0x24f907,null))[_0x5434('0x39')](handleError(_0x24f907,null));};exports['destroy']=function(_0x243163,_0x1fe399){return db['ChatApplication']['find']({'where':{'id':_0x243163[_0x5434('0x3b')]['id']}})[_0x5434('0x38')](handleEntityNotFound(_0x1fe399,null))['then'](removeEntity(_0x1fe399,null))[_0x5434('0x39')](handleError(_0x1fe399,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7a81c77..65c2863 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 _0x3f47=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x20f8bd,_0xcee953){var _0x3d6de3=function(_0x505ba9){while(--_0x505ba9){_0x20f8bd['push'](_0x20f8bd['shift']());}};_0x3d6de3(++_0xcee953);}(_0x3f47,0x10e));var _0x73f4=function(_0x1056c7,_0x279ac5){_0x1056c7=_0x1056c7-0x0;var _0x4ef73e=_0x3f47[_0x1056c7];return _0x4ef73e;};'use strict';var _=require(_0x73f4('0x0'));var util=require(_0x73f4('0x1'));var logger=require('../../config/logger')(_0x73f4('0x2'));var moment=require('moment');var BPromise=require(_0x73f4('0x3'));var rp=require(_0x73f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73f4('0x5'));var config=require(_0x73f4('0x6'));var attributes=require(_0x73f4('0x7'));module[_0x73f4('0x8')]=function(_0x5a852e,_0x101093){return _0x5a852e[_0x73f4('0x9')](_0x73f4('0xa'),attributes,{'tableName':_0x73f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x73f4('0xc'),'collate':_0x73f4('0xd')});}; \ No newline at end of file +var _0xa3d1=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3af54a,_0x2f617d){var _0x220130=function(_0x527465){while(--_0x527465){_0x3af54a['push'](_0x3af54a['shift']());}};_0x220130(++_0x2f617d);}(_0xa3d1,0x126));var _0x1a3d=function(_0x3a12f5,_0x612f29){_0x3a12f5=_0x3a12f5-0x0;var _0x42e50d=_0xa3d1[_0x3a12f5];return _0x42e50d;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var logger=require(_0x1a3d('0x2'))('api');var moment=require(_0x1a3d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a3d('0x4'));var fs=require('fs');var path=require(_0x1a3d('0x5'));var rimraf=require(_0x1a3d('0x6'));var config=require(_0x1a3d('0x7'));var attributes=require(_0x1a3d('0x8'));module[_0x1a3d('0x9')]=function(_0x3a4a57,_0x144a93){return _0x3a4a57['define'](_0x1a3d('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a3d('0xb'),'collate':_0x1a3d('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 4f2ca39..46d405d 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 _0xcd28=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2313e0,_0x31716d){var _0x58bd80=function(_0x3317e7){while(--_0x3317e7){_0x2313e0['push'](_0x2313e0['shift']());}};_0x58bd80(++_0x31716d);}(_0xcd28,0x133));var _0x8cd2=function(_0xee1383,_0xac1074){_0xee1383=_0xee1383-0x0;var _0x49f3b3=_0xcd28[_0xee1383];return _0x49f3b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cd2('0x0'));var BPromise=require(_0x8cd2('0x1'));var rs=require(_0x8cd2('0x2'));var fs=require('fs');var Redis=require(_0x8cd2('0x3'));var db=require(_0x8cd2('0x4'))['db'];var utils=require(_0x8cd2('0x5'));var logger=require(_0x8cd2('0x6'))(_0x8cd2('0x7'));var config=require('../../config/environment');var jayson=require(_0x8cd2('0x8'));var client=jayson[_0x8cd2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26c45c,_0x114db3,_0x2aea94){return new BPromise(function(_0x23baba,_0x45c9be){return client[_0x8cd2('0xa')](_0x26c45c,_0x2aea94)[_0x8cd2('0xb')](function(_0x23043b){logger['info']('ChatApplication,\x20%s,\x20%s',_0x114db3,'request\x20sent');logger[_0x8cd2('0xc')](_0x8cd2('0xd'),_0x114db3,_0x8cd2('0xe'),JSON[_0x8cd2('0xf')](_0x23043b));if(_0x23043b[_0x8cd2('0x10')]){if(_0x23043b['error'][_0x8cd2('0x11')]===0x1f4){logger['error'](_0x8cd2('0x12'),_0x114db3,_0x23043b[_0x8cd2('0x10')][_0x8cd2('0x13')]);return _0x45c9be(_0x23043b['error'][_0x8cd2('0x13')]);}logger[_0x8cd2('0x10')](_0x8cd2('0x12'),_0x114db3,_0x23043b['error']['message']);return _0x23baba(_0x23043b['error'][_0x8cd2('0x13')]);}else{logger[_0x8cd2('0x14')](_0x8cd2('0x12'),_0x114db3,_0x8cd2('0xe'));_0x23baba(_0x23043b[_0x8cd2('0x15')]['message']);}})[_0x8cd2('0x16')](function(_0x19bc8e){logger[_0x8cd2('0x10')](_0x8cd2('0x12'),_0x114db3,_0x19bc8e);_0x45c9be(_0x19bc8e);});});} \ No newline at end of file +var _0xcc1d=['request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xcc1d,0xba));var _0xdcc1=function(_0x18738e,_0x1e6900){_0x18738e=_0x18738e-0x0;var _0x5809b7=_0xcc1d[_0x18738e];return _0x5809b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdcc1('0x0'));var BPromise=require(_0xdcc1('0x1'));var rs=require(_0xdcc1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcc1('0x3'));var config=require(_0xdcc1('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdcc1('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x298f3e,_0x9f0bd0,_0x3af621){return new BPromise(function(_0x2ddbe1,_0x980b6c){return client[_0xdcc1('0x6')](_0x298f3e,_0x3af621)[_0xdcc1('0x7')](function(_0x3cb63a){logger['info'](_0xdcc1('0x8'),_0x9f0bd0,_0xdcc1('0x9'));logger['debug'](_0xdcc1('0xa'),_0x9f0bd0,'request\x20sent',JSON['stringify'](_0x3cb63a));if(_0x3cb63a[_0xdcc1('0xb')]){if(_0x3cb63a[_0xdcc1('0xb')][_0xdcc1('0xc')]===0x1f4){logger[_0xdcc1('0xb')](_0xdcc1('0x8'),_0x9f0bd0,_0x3cb63a[_0xdcc1('0xb')][_0xdcc1('0xd')]);return _0x980b6c(_0x3cb63a['error'][_0xdcc1('0xd')]);}logger[_0xdcc1('0xb')](_0xdcc1('0x8'),_0x9f0bd0,_0x3cb63a[_0xdcc1('0xb')]['message']);return _0x2ddbe1(_0x3cb63a[_0xdcc1('0xb')]['message']);}else{logger['info'](_0xdcc1('0x8'),_0x9f0bd0,_0xdcc1('0x9'));_0x2ddbe1(_0x3cb63a['result']['message']);}})[_0xdcc1('0xe')](function(_0x1f8b76){logger['error']('ChatApplication,\x20%s,\x20%s',_0x9f0bd0,_0x1f8b76);_0x980b6c(_0x1f8b76);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 246762b..712f665 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 _0x6583=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x6583,0x1b9));var _0x3658=function(_0x34f3c7,_0x393441){_0x34f3c7=_0x34f3c7-0x0;var _0x258767=_0x6583[_0x34f3c7];return _0x258767;};'use strict';var multer=require(_0x3658('0x0'));var util=require(_0x3658('0x1'));var path=require(_0x3658('0x2'));var timeout=require('connect-timeout');var express=require(_0x3658('0x3'));var router=express['Router']();var fs_extra=require(_0x3658('0x4'));var auth=require(_0x3658('0x5'));var interaction=require(_0x3658('0x6'));var config=require(_0x3658('0x7'));var controller=require(_0x3658('0x8'));router[_0x3658('0x9')](_0x3658('0xa'),auth[_0x3658('0xb')](),controller[_0x3658('0xc')]);router[_0x3658('0xd')](_0x3658('0xa'),auth[_0x3658('0xb')](),controller[_0x3658('0xe')]);router[_0x3658('0xf')]('/:id',auth[_0x3658('0xb')](),controller[_0x3658('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0612=['../../components/interaction/service','./chatApplication.controller','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0612,0x162));var _0x2061=function(_0x1f4c4a,_0x1de401){_0x1f4c4a=_0x1f4c4a-0x0;var _0x4ca1ef=_0x0612[_0x1f4c4a];return _0x4ca1ef;};'use strict';var multer=require(_0x2061('0x0'));var util=require(_0x2061('0x1'));var path=require('path');var timeout=require(_0x2061('0x2'));var express=require('express');var router=express[_0x2061('0x3')]();var fs_extra=require(_0x2061('0x4'));var auth=require(_0x2061('0x5'));var interaction=require(_0x2061('0x6'));var config=require('../../config/environment');var controller=require(_0x2061('0x7'));router['get'](_0x2061('0x8'),auth['isAuthenticated'](),controller[_0x2061('0x9')]);router[_0x2061('0xa')](_0x2061('0x8'),auth[_0x2061('0xb')](),controller[_0x2061('0xc')]);router['delete'](_0x2061('0x8'),auth[_0x2061('0xb')](),controller[_0x2061('0xd')]);module[_0x2061('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 3ccfbfd..3e8c0df 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 _0xef18=['STRING','BOOLEAN','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xef18,0xfb));var _0x8ef1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xef18[_0x24f31b];return _0x488401;};'use strict';var Sequelize=require('sequelize');module[_0x8ef1('0x0')]={'name':{'type':Sequelize[_0x8ef1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8ef1('0x1')]},'write':{'type':Sequelize[_0x8ef1('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x89a1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1189aa,_0x19c03a){var _0x95a2ab=function(_0x115330){while(--_0x115330){_0x1189aa['push'](_0x1189aa['shift']());}};_0x95a2ab(++_0x19c03a);}(_0x89a1,0x1db));var _0x189a=function(_0x512652,_0x5ab9f4){_0x512652=_0x512652-0x0;var _0x6ab93a=_0x89a1[_0x512652];return _0x6ab93a;};'use strict';var Sequelize=require(_0x189a('0x0'));module[_0x189a('0x1')]={'name':{'type':Sequelize[_0x189a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x189a('0x2')]},'write':{'type':Sequelize[_0x189a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 68e8cfb..cb1acea 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 _0x3c94=['save','then','destroy','error','stack','name','send','ChatGroup','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','options','hasOwnProperty','nolimit','removeMembers','addMessage','getMessages','order','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatGroup.socket','register','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3c94,0x157));var _0x43c9=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x3c94[_0x4cc280];return _0x16ed24;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x43c9('0x0'));var rp=require(_0x43c9('0x1'));var moment=require(_0x43c9('0x2'));var BPromise=require(_0x43c9('0x3'));var Mustache=require(_0x43c9('0x4'));var util=require(_0x43c9('0x5'));var path=require('path');var sox=require(_0x43c9('0x6'));var csv=require('to-csv');var ejs=require(_0x43c9('0x7'));var fs=require('fs');var fs_extra=require(_0x43c9('0x8'));var _=require(_0x43c9('0x9'));var squel=require(_0x43c9('0xa'));var crypto=require(_0x43c9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x43c9('0xc'));var toCsv=require(_0x43c9('0xd'));var querystring=require('querystring');var Papa=require(_0x43c9('0xe'));var Redis=require('ioredis');var authService=require(_0x43c9('0xf'));var qs=require(_0x43c9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43c9('0x11'));var logger=require(_0x43c9('0x12'))(_0x43c9('0x13'));var utils=require(_0x43c9('0x14'));var config=require(_0x43c9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x43c9('0x16'))['db'];config[_0x43c9('0x17')]=_['defaults'](config['redis'],{'host':_0x43c9('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43c9('0x17')]));require(_0x43c9('0x19'))[_0x43c9('0x1a')](socket);function respondWithStatusCode(_0x559273,_0xe87853){_0xe87853=_0xe87853||0xcc;return function(_0x5edec2){if(_0x5edec2){return _0x559273['sendStatus'](_0xe87853);}return _0x559273['status'](_0xe87853)[_0x43c9('0x1b')]();};}function respondWithResult(_0x36bf21,_0x3f854a){_0x3f854a=_0x3f854a||0xc8;return function(_0x5c3345){if(_0x5c3345){return _0x36bf21[_0x43c9('0x1c')](_0x3f854a)[_0x43c9('0x1d')](_0x5c3345);}};}function respondWithFilteredResult(_0x28cbce,_0x1175eb){return function(_0x71c502){if(_0x71c502){var _0x265be4=typeof _0x1175eb[_0x43c9('0x1e')]===_0x43c9('0x1f')&&typeof _0x1175eb['limit']===_0x43c9('0x1f');var _0x3abd97=_0x71c502[_0x43c9('0x20')];var _0x34677f=_0x265be4?0x0:_0x1175eb[_0x43c9('0x1e')];var _0x142a28=_0x265be4?_0x71c502[_0x43c9('0x20')]:_0x1175eb[_0x43c9('0x1e')]+_0x1175eb[_0x43c9('0x21')];var _0x17388a;if(_0x142a28>=_0x3abd97){_0x142a28=_0x3abd97;_0x17388a=0xc8;}else{_0x17388a=0xce;}_0x28cbce[_0x43c9('0x1c')](_0x17388a);return _0x28cbce['set'](_0x43c9('0x22'),_0x34677f+'-'+_0x142a28+'/'+_0x3abd97)['json'](_0x71c502);}return null;};}function patchUpdates(_0x667627){return function(_0x4f25f4){try{jsonpatch[_0x43c9('0x23')](_0x4f25f4,_0x667627,!![]);}catch(_0x339b20){return BPromise[_0x43c9('0x24')](_0x339b20);}return _0x4f25f4[_0x43c9('0x25')]();};}function saveUpdates(_0x2a78a2,_0x566f83){return function(_0x211955){if(_0x211955){return _0x211955['update'](_0x2a78a2)[_0x43c9('0x26')](function(_0x2d0f46){return _0x2d0f46;});}return null;};}function removeEntity(_0x20adcb,_0x3632df){return function(_0x56ba4f){if(_0x56ba4f){return _0x56ba4f[_0x43c9('0x27')]()[_0x43c9('0x26')](function(){_0x20adcb[_0x43c9('0x1c')](0xcc)[_0x43c9('0x1b')]();});}};}function handleEntityNotFound(_0x247ff5,_0x1793c7){return function(_0x4a1898){if(!_0x4a1898){_0x247ff5['sendStatus'](0x194);}return _0x4a1898;};}function handleError(_0x1ba571,_0xdc9ef2){_0xdc9ef2=_0xdc9ef2||0x1f4;return function(_0x3e32e1){logger[_0x43c9('0x28')](_0x3e32e1[_0x43c9('0x29')]);if(_0x3e32e1[_0x43c9('0x2a')]){delete _0x3e32e1[_0x43c9('0x2a')];}_0x1ba571['status'](_0xdc9ef2)[_0x43c9('0x2b')](_0x3e32e1);};}exports['index']=function(_0x5d3b06,_0x221f2d){var _0x57fd07={},_0x555219={},_0x1274b7={'count':0x0,'rows':[]};var _0x5cc5e5=_['map'](db[_0x43c9('0x2c')]['rawAttributes'],function(_0x14f031){return{'name':_0x14f031['fieldName'],'type':_0x14f031[_0x43c9('0x2d')][_0x43c9('0x2e')]};});_0x555219['model']=_['map'](_0x5cc5e5,_0x43c9('0x2a'));_0x555219[_0x43c9('0x2f')]=_[_0x43c9('0x30')](_0x5d3b06[_0x43c9('0x2f')]);_0x555219[_0x43c9('0x31')]=_[_0x43c9('0x32')](_0x555219[_0x43c9('0x33')],_0x555219[_0x43c9('0x2f')]);_0x57fd07[_0x43c9('0x34')]=_[_0x43c9('0x32')](_0x555219[_0x43c9('0x33')],qs['fields'](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x35')]));_0x57fd07[_0x43c9('0x34')]=_0x57fd07[_0x43c9('0x34')][_0x43c9('0x36')]?_0x57fd07[_0x43c9('0x34')]:_0x555219[_0x43c9('0x33')];if(!_0x5d3b06['query']['hasOwnProperty']('nolimit')){_0x57fd07[_0x43c9('0x21')]=qs['limit'](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x21')]);_0x57fd07[_0x43c9('0x1e')]=qs[_0x43c9('0x1e')](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x1e')]);}_0x57fd07['order']=qs[_0x43c9('0x37')](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x37')]);_0x57fd07[_0x43c9('0x38')]=qs['filters'](_[_0x43c9('0x39')](_0x5d3b06[_0x43c9('0x2f')],_0x555219[_0x43c9('0x31')]),_0x5cc5e5);if(_0x5d3b06['query'][_0x43c9('0x3a')]){_0x57fd07[_0x43c9('0x38')]=_['merge'](_0x57fd07[_0x43c9('0x38')],{'$or':_['map'](_0x5cc5e5,function(_0x4cec43){if(_0x4cec43[_0x43c9('0x2d')]!==_0x43c9('0x3b')){var _0x5437c2={};_0x5437c2[_0x4cec43[_0x43c9('0x2a')]]={'$like':'%'+_0x5d3b06[_0x43c9('0x2f')]['filter']+'%'};return _0x5437c2;}})});}_0x57fd07=_[_0x43c9('0x3c')]({},_0x57fd07,_0x5d3b06['options']);var _0xee9b03={'where':_0x57fd07[_0x43c9('0x38')]};return db['ChatGroup'][_0x43c9('0x20')](_0xee9b03)[_0x43c9('0x26')](function(_0x3b3c67){_0x1274b7['count']=_0x3b3c67;if(_0x5d3b06['query'][_0x43c9('0x3d')]){_0x57fd07[_0x43c9('0x3e')]=[{'all':!![]}];}return db[_0x43c9('0x2c')][_0x43c9('0x3f')](_0x57fd07);})[_0x43c9('0x26')](function(_0xfd13ea){_0x1274b7[_0x43c9('0x40')]=_0xfd13ea;return _0x1274b7;})[_0x43c9('0x26')](respondWithFilteredResult(_0x221f2d,_0x57fd07))[_0x43c9('0x41')](handleError(_0x221f2d,null));};exports[_0x43c9('0x42')]=function(_0x50c08d,_0x45d619){var _0x48d878={'raw':!![],'where':{'id':_0x50c08d[_0x43c9('0x43')]['id']}},_0x5ba81d={};_0x5ba81d[_0x43c9('0x33')]=_[_0x43c9('0x30')](db[_0x43c9('0x2c')][_0x43c9('0x44')]);_0x5ba81d[_0x43c9('0x2f')]=_['keys'](_0x50c08d[_0x43c9('0x2f')]);_0x5ba81d[_0x43c9('0x31')]=_[_0x43c9('0x32')](_0x5ba81d[_0x43c9('0x33')],_0x5ba81d[_0x43c9('0x2f')]);_0x48d878[_0x43c9('0x34')]=_['intersection'](_0x5ba81d[_0x43c9('0x33')],qs['fields'](_0x50c08d['query'][_0x43c9('0x35')]));_0x48d878['attributes']=_0x48d878[_0x43c9('0x34')][_0x43c9('0x36')]?_0x48d878[_0x43c9('0x34')]:_0x5ba81d[_0x43c9('0x33')];if(_0x50c08d[_0x43c9('0x2f')][_0x43c9('0x3d')]){_0x48d878[_0x43c9('0x3e')]=[{'all':!![]}];}_0x48d878=_[_0x43c9('0x3c')]({},_0x48d878,_0x50c08d['options']);return db[_0x43c9('0x2c')][_0x43c9('0x45')](_0x48d878)['then'](handleEntityNotFound(_0x45d619,null))['then'](respondWithResult(_0x45d619,null))[_0x43c9('0x41')](handleError(_0x45d619,null));};exports['create']=function(_0x27bf81,_0x5169b0){return db[_0x43c9('0x2c')][_0x43c9('0x46')](_0x27bf81[_0x43c9('0x47')],{})['then'](respondWithResult(_0x5169b0,0xc9))[_0x43c9('0x41')](handleError(_0x5169b0,null));};exports[_0x43c9('0x48')]=function(_0x21919e,_0x47bf2d){if(_0x21919e[_0x43c9('0x47')]['id']){delete _0x21919e[_0x43c9('0x47')]['id'];}return db[_0x43c9('0x2c')][_0x43c9('0x45')]({'where':{'id':_0x21919e['params']['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x47bf2d,null))[_0x43c9('0x26')](saveUpdates(_0x21919e[_0x43c9('0x47')],null))[_0x43c9('0x26')](respondWithResult(_0x47bf2d,null))[_0x43c9('0x41')](handleError(_0x47bf2d,null));};exports['destroy']=function(_0x3e2575,_0x19b168){return db['ChatGroup'][_0x43c9('0x45')]({'where':{'id':_0x3e2575[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x19b168,null))['then'](removeEntity(_0x19b168,null))[_0x43c9('0x41')](handleError(_0x19b168,null));};exports['describe']=function(_0x236037,_0x3bf7fb){return db[_0x43c9('0x2c')][_0x43c9('0x49')]()['then'](respondWithResult(_0x3bf7fb,null))[_0x43c9('0x41')](handleError(_0x3bf7fb,null));};exports[_0x43c9('0x4a')]=function(_0x29963a,_0x1cb2c2,_0x56a22a){return db[_0x43c9('0x4b')][_0x43c9('0x20')]({'where':{'ChatGroupId':_0x29963a[_0x43c9('0x43')]['id'],'ToId':_0x29963a[_0x43c9('0x4c')]['id'],'read':![]}})[_0x43c9('0x26')](function(_0x566bf5){return{'id':_[_0x43c9('0x4d')](_0x29963a[_0x43c9('0x43')]['id']),'count':_0x566bf5};})[_0x43c9('0x26')](respondWithResult(_0x1cb2c2,null))['catch'](handleError(_0x1cb2c2,null));};exports[_0x43c9('0x4e')]=function(_0x343fef,_0xb8fac5,_0x437d49){return db[_0x43c9('0x2c')][_0x43c9('0x45')]({'where':{'id':_0x343fef['params']['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0xb8fac5,null))[_0x43c9('0x26')](function(_0x305fd6){if(_0x305fd6){return _0x305fd6[_0x43c9('0x4e')](_0x343fef[_0x43c9('0x47')]['ids'],_[_0x43c9('0x4f')](_0x343fef[_0x43c9('0x47')],[_0x43c9('0x50'),'id'])||{});}})[_0x43c9('0x26')](respondWithResult(_0xb8fac5,null))[_0x43c9('0x41')](handleError(_0xb8fac5,null));};exports[_0x43c9('0x51')]=function(_0x136ab3,_0x3d16da,_0x2e3eee){var _0x459322={};var _0x46225b={};var _0x45457f;var _0x5a5bcf;return db['ChatGroup'][_0x43c9('0x52')]({'where':{'id':_0x136ab3[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x3d16da,null))[_0x43c9('0x26')](function(_0x261974){if(_0x261974){_0x45457f=_0x261974;_0x46225b['model']=_[_0x43c9('0x30')](db[_0x43c9('0x53')]['rawAttributes']);_0x46225b[_0x43c9('0x2f')]=_[_0x43c9('0x30')](_0x136ab3[_0x43c9('0x2f')]);_0x46225b[_0x43c9('0x31')]=_[_0x43c9('0x32')](_0x46225b[_0x43c9('0x33')],_0x46225b['query']);_0x459322['attributes']=_['intersection'](_0x46225b[_0x43c9('0x33')],qs['fields'](_0x136ab3[_0x43c9('0x2f')][_0x43c9('0x35')]));_0x459322[_0x43c9('0x34')]=_0x459322['attributes'][_0x43c9('0x36')]?_0x459322[_0x43c9('0x34')]:_0x46225b[_0x43c9('0x33')];_0x459322['order']=qs['sort'](_0x136ab3[_0x43c9('0x2f')][_0x43c9('0x37')]);_0x459322[_0x43c9('0x38')]=qs['filters'](_[_0x43c9('0x39')](_0x136ab3['query'],_0x46225b['filters']));if(_0x136ab3['query'][_0x43c9('0x3a')]){_0x459322[_0x43c9('0x38')]=_[_0x43c9('0x3c')](_0x459322['where'],{'$or':_['map'](_0x459322[_0x43c9('0x34')],function(_0x1964aa){var _0xc8116d={};_0xc8116d[_0x1964aa]={'$like':'%'+_0x136ab3[_0x43c9('0x2f')]['filter']+'%'};return _0xc8116d;})});}_0x459322=_['merge']({},_0x459322,_0x136ab3[_0x43c9('0x54')]);return _0x45457f[_0x43c9('0x51')](_0x459322);}})[_0x43c9('0x26')](function(_0xbf43da){if(_0xbf43da){_0x5a5bcf=_0xbf43da[_0x43c9('0x36')];if(!_0x136ab3[_0x43c9('0x2f')][_0x43c9('0x55')](_0x43c9('0x56'))){_0x459322['limit']=qs[_0x43c9('0x21')](_0x136ab3['query'][_0x43c9('0x21')]);_0x459322['offset']=qs[_0x43c9('0x1e')](_0x136ab3['query']['offset']);}return _0x45457f['getMembers'](_0x459322);}})[_0x43c9('0x26')](function(_0x42e2c3){if(_0x42e2c3){return _0x42e2c3?{'count':_0x5a5bcf,'rows':_0x42e2c3}:null;}})[_0x43c9('0x26')](respondWithResult(_0x3d16da,null))[_0x43c9('0x41')](handleError(_0x3d16da,null));};exports['removeMembers']=function(_0x3a3172,_0x3597fc,_0x3068a0){return db[_0x43c9('0x2c')]['find']({'where':{'id':_0x3a3172[_0x43c9('0x43')]['id']}})['then'](handleEntityNotFound(_0x3597fc,null))[_0x43c9('0x26')](function(_0x36f444){if(_0x36f444){return _0x36f444[_0x43c9('0x57')](_0x3a3172[_0x43c9('0x2f')]['ids']);}})[_0x43c9('0x26')](respondWithStatusCode(_0x3597fc,null))[_0x43c9('0x41')](handleError(_0x3597fc,null));};exports[_0x43c9('0x58')]=function(_0x3ba594,_0x3855cc,_0x4a8bb5){if(_0x3ba594['body']['id']){delete _0x3ba594[_0x43c9('0x47')]['id'];}return db[_0x43c9('0x2c')]['find']({'where':{'id':_0x3ba594[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x3855cc,null))['then'](function(_0x5d0f87){if(_0x5d0f87){_0x3ba594[_0x43c9('0x47')]['ChatGroupId']=_0x5d0f87['id'];return db['ChatInternalMessage'][_0x43c9('0x46')](_0x3ba594[_0x43c9('0x47')]);}})['then'](respondWithResult(_0x3855cc,null))[_0x43c9('0x41')](handleError(_0x3855cc,null));};exports[_0x43c9('0x59')]=function(_0x1a690f,_0x18b8aa,_0x484e76){var _0x1b9e68={};var _0x1046de={};var _0x53f371;var _0x4075fd;return db[_0x43c9('0x2c')][_0x43c9('0x52')]({'where':{'id':_0x1a690f[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x18b8aa,null))[_0x43c9('0x26')](function(_0x83584c){if(_0x83584c){_0x53f371=_0x83584c;_0x1046de[_0x43c9('0x33')]=_[_0x43c9('0x30')](db['ChatInternalMessage'][_0x43c9('0x44')]);_0x1046de[_0x43c9('0x2f')]=_[_0x43c9('0x30')](_0x1a690f[_0x43c9('0x2f')]);_0x1046de[_0x43c9('0x31')]=_['intersection'](_0x1046de[_0x43c9('0x33')],_0x1046de[_0x43c9('0x2f')]);_0x1b9e68[_0x43c9('0x34')]=_[_0x43c9('0x32')](_0x1046de['model'],qs['fields'](_0x1a690f[_0x43c9('0x2f')]['fields']));_0x1b9e68[_0x43c9('0x34')]=_0x1b9e68[_0x43c9('0x34')]['length']?_0x1b9e68[_0x43c9('0x34')]:_0x1046de[_0x43c9('0x33')];_0x1b9e68[_0x43c9('0x5a')]=qs[_0x43c9('0x37')](_0x1a690f['query']['sort']);_0x1b9e68[_0x43c9('0x38')]=qs['filters'](_[_0x43c9('0x39')](_0x1a690f[_0x43c9('0x2f')],_0x1046de[_0x43c9('0x31')]));if(_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x3a')]){_0x1b9e68['where']=_['merge'](_0x1b9e68['where'],{'$or':_[_0x43c9('0x5b')](_0x1b9e68['attributes'],function(_0x4ce8c1){var _0x380855={};_0x380855[_0x4ce8c1]={'$like':'%'+_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x3a')]+'%'};return _0x380855;})});}if(_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x5c')]){var _0x4d47db=_0x1a690f[_0x43c9('0x2f')]['$gte']['split'](',');var _0x208b07={};_0x208b07[_0x4d47db[0x0]]={'$gte':moment(_0x4d47db[0x1])[_0x43c9('0x5d')](_0x43c9('0x5e'))};_0x1b9e68[_0x43c9('0x38')]=_['merge'](_0x1b9e68[_0x43c9('0x38')],_0x208b07);}_0x1b9e68=_[_0x43c9('0x3c')]({},_0x1b9e68,_0x1a690f['options']);return _0x53f371[_0x43c9('0x59')](_0x1b9e68);}})[_0x43c9('0x26')](function(_0x5ce206){if(_0x5ce206){_0x4075fd=_0x5ce206[_0x43c9('0x36')];if(!_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x55')](_0x43c9('0x56'))){_0x1b9e68[_0x43c9('0x21')]=qs[_0x43c9('0x21')](_0x1a690f[_0x43c9('0x2f')]['limit']);_0x1b9e68[_0x43c9('0x1e')]=qs[_0x43c9('0x1e')](_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x1e')]);}return _0x53f371['getMessages'](_0x1b9e68);}})[_0x43c9('0x26')](function(_0x2fecfe){if(_0x2fecfe){return _0x2fecfe?{'count':_0x4075fd,'rows':_0x2fecfe}:null;}})[_0x43c9('0x26')](respondWithResult(_0x18b8aa,null))[_0x43c9('0x41')](handleError(_0x18b8aa,null));}; \ No newline at end of file +var _0x91df=['query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','length','nolimit','removeMembers','ChatGroupId','getMessages','keys','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','name','send','map','rawAttributes','fieldName','key','model'];(function(_0x5dda62,_0x493273){var _0x311c30=function(_0x3a718e){while(--_0x3a718e){_0x5dda62['push'](_0x5dda62['shift']());}};_0x311c30(++_0x493273);}(_0x91df,0xe7));var _0xf91d=function(_0x14f3e5,_0x493260){_0x14f3e5=_0x14f3e5-0x0;var _0x44b556=_0x91df[_0x14f3e5];return _0x44b556;};'use strict';var emlformat=require(_0xf91d('0x0'));var rimraf=require(_0xf91d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf91d('0x2'));var rp=require(_0xf91d('0x3'));var moment=require(_0xf91d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf91d('0x5'));var util=require(_0xf91d('0x6'));var path=require(_0xf91d('0x7'));var sox=require(_0xf91d('0x8'));var csv=require(_0xf91d('0x9'));var ejs=require(_0xf91d('0xa'));var fs=require('fs');var fs_extra=require(_0xf91d('0xb'));var _=require(_0xf91d('0xc'));var squel=require(_0xf91d('0xd'));var crypto=require(_0xf91d('0xe'));var jsforce=require(_0xf91d('0xf'));var deskjs=require(_0xf91d('0x10'));var toCsv=require(_0xf91d('0x9'));var querystring=require(_0xf91d('0x11'));var Papa=require(_0xf91d('0x12'));var Redis=require('ioredis');var authService=require(_0xf91d('0x13'));var qs=require(_0xf91d('0x14'));var as=require(_0xf91d('0x15'));var hardwareService=require(_0xf91d('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf91d('0x17'));var licenseUtil=require(_0xf91d('0x18'));var db=require('../../mysqldb')['db'];config[_0xf91d('0x19')]=_['defaults'](config[_0xf91d('0x19')],{'host':_0xf91d('0x1a'),'port':0x18eb});var socket=require(_0xf91d('0x1b'))(new Redis(config[_0xf91d('0x19')]));require(_0xf91d('0x1c'))['register'](socket);function respondWithStatusCode(_0x15dc95,_0x5cf7ba){_0x5cf7ba=_0x5cf7ba||0xcc;return function(_0x24de90){if(_0x24de90){return _0x15dc95[_0xf91d('0x1d')](_0x5cf7ba);}return _0x15dc95[_0xf91d('0x1e')](_0x5cf7ba)[_0xf91d('0x1f')]();};}function respondWithResult(_0x176931,_0x1196e1){_0x1196e1=_0x1196e1||0xc8;return function(_0x5ed682){if(_0x5ed682){return _0x176931['status'](_0x1196e1)[_0xf91d('0x20')](_0x5ed682);}};}function respondWithFilteredResult(_0x15cae9,_0x4f273e){return function(_0x170bac){if(_0x170bac){var _0x46ae7d=typeof _0x4f273e[_0xf91d('0x21')]==='undefined'&&typeof _0x4f273e[_0xf91d('0x22')]===_0xf91d('0x23');var _0x1c6d81=_0x170bac['count'];var _0x4e358c=_0x46ae7d?0x0:_0x4f273e[_0xf91d('0x21')];var _0x227c67=_0x46ae7d?_0x170bac[_0xf91d('0x24')]:_0x4f273e[_0xf91d('0x21')]+_0x4f273e[_0xf91d('0x22')];var _0x201ec9;if(_0x227c67>=_0x1c6d81){_0x227c67=_0x1c6d81;_0x201ec9=0xc8;}else{_0x201ec9=0xce;}_0x15cae9[_0xf91d('0x1e')](_0x201ec9);return _0x15cae9[_0xf91d('0x25')]('Content-Range',_0x4e358c+'-'+_0x227c67+'/'+_0x1c6d81)[_0xf91d('0x20')](_0x170bac);}return null;};}function patchUpdates(_0x41e934){return function(_0x13db5){try{jsonpatch['apply'](_0x13db5,_0x41e934,!![]);}catch(_0x2212c4){return BPromise['reject'](_0x2212c4);}return _0x13db5['save']();};}function saveUpdates(_0x2ca9a7,_0x4291e3){return function(_0x75dc7e){if(_0x75dc7e){return _0x75dc7e[_0xf91d('0x26')](_0x2ca9a7)[_0xf91d('0x27')](function(_0x58394c){return _0x58394c;});}return null;};}function removeEntity(_0x1bbde2,_0x671ed6){return function(_0x99e8ae){if(_0x99e8ae){return _0x99e8ae[_0xf91d('0x28')]()[_0xf91d('0x27')](function(){_0x1bbde2['status'](0xcc)[_0xf91d('0x1f')]();});}};}function handleEntityNotFound(_0x21225f,_0x48f49a){return function(_0x4d5ed5){if(!_0x4d5ed5){_0x21225f[_0xf91d('0x1d')](0x194);}return _0x4d5ed5;};}function handleError(_0x124af7,_0x1e8dda){_0x1e8dda=_0x1e8dda||0x1f4;return function(_0x562c89){logger['error'](_0x562c89['stack']);if(_0x562c89['name']){delete _0x562c89[_0xf91d('0x29')];}_0x124af7[_0xf91d('0x1e')](_0x1e8dda)[_0xf91d('0x2a')](_0x562c89);};}exports['index']=function(_0x302fe6,_0x50f7bb){var _0x1a3f57={},_0x185629={},_0x4f278e={'count':0x0,'rows':[]};var _0x23afe6=_[_0xf91d('0x2b')](db['ChatGroup'][_0xf91d('0x2c')],function(_0x245556){return{'name':_0x245556[_0xf91d('0x2d')],'type':_0x245556['type'][_0xf91d('0x2e')]};});_0x185629[_0xf91d('0x2f')]=_[_0xf91d('0x2b')](_0x23afe6,_0xf91d('0x29'));_0x185629[_0xf91d('0x30')]=_['keys'](_0x302fe6[_0xf91d('0x30')]);_0x185629[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x185629[_0xf91d('0x2f')],_0x185629[_0xf91d('0x30')]);_0x1a3f57['attributes']=_[_0xf91d('0x32')](_0x185629['model'],qs['fields'](_0x302fe6[_0xf91d('0x30')]['fields']));_0x1a3f57[_0xf91d('0x33')]=_0x1a3f57['attributes']['length']?_0x1a3f57[_0xf91d('0x33')]:_0x185629[_0xf91d('0x2f')];if(!_0x302fe6['query'][_0xf91d('0x34')]('nolimit')){_0x1a3f57['limit']=qs[_0xf91d('0x22')](_0x302fe6[_0xf91d('0x30')][_0xf91d('0x22')]);_0x1a3f57[_0xf91d('0x21')]=qs[_0xf91d('0x21')](_0x302fe6[_0xf91d('0x30')][_0xf91d('0x21')]);}_0x1a3f57[_0xf91d('0x35')]=qs[_0xf91d('0x36')](_0x302fe6[_0xf91d('0x30')][_0xf91d('0x36')]);_0x1a3f57[_0xf91d('0x37')]=qs['filters'](_[_0xf91d('0x38')](_0x302fe6[_0xf91d('0x30')],_0x185629[_0xf91d('0x31')]),_0x23afe6);if(_0x302fe6[_0xf91d('0x30')][_0xf91d('0x39')]){_0x1a3f57[_0xf91d('0x37')]=_[_0xf91d('0x3a')](_0x1a3f57[_0xf91d('0x37')],{'$or':_['map'](_0x23afe6,function(_0x4343a5){if(_0x4343a5[_0xf91d('0x3b')]!==_0xf91d('0x3c')){var _0x4a92e2={};_0x4a92e2[_0x4343a5['name']]={'$like':'%'+_0x302fe6[_0xf91d('0x30')][_0xf91d('0x39')]+'%'};return _0x4a92e2;}})});}_0x1a3f57=_['merge']({},_0x1a3f57,_0x302fe6[_0xf91d('0x3d')]);var _0x4a0173={'where':_0x1a3f57['where']};return db[_0xf91d('0x3e')][_0xf91d('0x24')](_0x4a0173)[_0xf91d('0x27')](function(_0x212df3){_0x4f278e[_0xf91d('0x24')]=_0x212df3;if(_0x302fe6[_0xf91d('0x30')][_0xf91d('0x3f')]){_0x1a3f57[_0xf91d('0x40')]=[{'all':!![]}];}return db[_0xf91d('0x3e')][_0xf91d('0x41')](_0x1a3f57);})['then'](function(_0x5b5eeb){_0x4f278e[_0xf91d('0x42')]=_0x5b5eeb;return _0x4f278e;})[_0xf91d('0x27')](respondWithFilteredResult(_0x50f7bb,_0x1a3f57))[_0xf91d('0x43')](handleError(_0x50f7bb,null));};exports[_0xf91d('0x44')]=function(_0x2de8fb,_0x40384d){var _0x471ade={'raw':!![],'where':{'id':_0x2de8fb[_0xf91d('0x45')]['id']}},_0x2dc947={};_0x2dc947[_0xf91d('0x2f')]=_['keys'](db['ChatGroup'][_0xf91d('0x2c')]);_0x2dc947[_0xf91d('0x30')]=_['keys'](_0x2de8fb['query']);_0x2dc947['filters']=_['intersection'](_0x2dc947[_0xf91d('0x2f')],_0x2dc947['query']);_0x471ade[_0xf91d('0x33')]=_[_0xf91d('0x32')](_0x2dc947['model'],qs[_0xf91d('0x46')](_0x2de8fb[_0xf91d('0x30')]['fields']));_0x471ade[_0xf91d('0x33')]=_0x471ade[_0xf91d('0x33')]['length']?_0x471ade['attributes']:_0x2dc947['model'];if(_0x2de8fb[_0xf91d('0x30')]['includeAll']){_0x471ade['include']=[{'all':!![]}];}_0x471ade=_[_0xf91d('0x3a')]({},_0x471ade,_0x2de8fb[_0xf91d('0x3d')]);return db[_0xf91d('0x3e')][_0xf91d('0x47')](_0x471ade)[_0xf91d('0x27')](handleEntityNotFound(_0x40384d,null))[_0xf91d('0x27')](respondWithResult(_0x40384d,null))[_0xf91d('0x43')](handleError(_0x40384d,null));};exports['create']=function(_0x1161a4,_0x14f3ee){return db[_0xf91d('0x3e')][_0xf91d('0x48')](_0x1161a4['body'],{})[_0xf91d('0x27')](respondWithResult(_0x14f3ee,0xc9))['catch'](handleError(_0x14f3ee,null));};exports[_0xf91d('0x26')]=function(_0xdd8dfa,_0x1e930f){if(_0xdd8dfa[_0xf91d('0x49')]['id']){delete _0xdd8dfa['body']['id'];}return db[_0xf91d('0x3e')]['find']({'where':{'id':_0xdd8dfa['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x1e930f,null))[_0xf91d('0x27')](saveUpdates(_0xdd8dfa[_0xf91d('0x49')],null))[_0xf91d('0x27')](respondWithResult(_0x1e930f,null))[_0xf91d('0x43')](handleError(_0x1e930f,null));};exports['destroy']=function(_0x1ebb1c,_0x2fc0cf){return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x1ebb1c[_0xf91d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2fc0cf,null))[_0xf91d('0x27')](removeEntity(_0x2fc0cf,null))[_0xf91d('0x43')](handleError(_0x2fc0cf,null));};exports[_0xf91d('0x4a')]=function(_0x5a7bb3,_0x340524){return db[_0xf91d('0x3e')][_0xf91d('0x4a')]()['then'](respondWithResult(_0x340524,null))[_0xf91d('0x43')](handleError(_0x340524,null));};exports[_0xf91d('0x4b')]=function(_0x4b1372,_0x174c5b,_0x2c8075){return db[_0xf91d('0x4c')][_0xf91d('0x24')]({'where':{'ChatGroupId':_0x4b1372[_0xf91d('0x45')]['id'],'ToId':_0x4b1372[_0xf91d('0x4d')]['id'],'read':![]}})[_0xf91d('0x27')](function(_0x1abcc7){return{'id':_['toInteger'](_0x4b1372[_0xf91d('0x45')]['id']),'count':_0x1abcc7};})[_0xf91d('0x27')](respondWithResult(_0x174c5b,null))['catch'](handleError(_0x174c5b,null));};exports[_0xf91d('0x4e')]=function(_0x43c27e,_0x48b1dd,_0x354a23){return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x43c27e['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x48b1dd,null))[_0xf91d('0x27')](function(_0xcf18bd){if(_0xcf18bd){return _0xcf18bd[_0xf91d('0x4e')](_0x43c27e[_0xf91d('0x49')][_0xf91d('0x4f')],_[_0xf91d('0x50')](_0x43c27e['body'],[_0xf91d('0x4f'),'id'])||{});}})[_0xf91d('0x27')](respondWithResult(_0x48b1dd,null))['catch'](handleError(_0x48b1dd,null));};exports[_0xf91d('0x51')]=function(_0x211160,_0x578630,_0x362348){var _0x2ef4b9={};var _0x457394={};var _0x3c0058;var _0x40d9b4;return db[_0xf91d('0x3e')][_0xf91d('0x52')]({'where':{'id':_0x211160['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x578630,null))[_0xf91d('0x27')](function(_0x27d4fc){if(_0x27d4fc){_0x3c0058=_0x27d4fc;_0x457394['model']=_['keys'](db[_0xf91d('0x53')][_0xf91d('0x2c')]);_0x457394[_0xf91d('0x30')]=_['keys'](_0x211160[_0xf91d('0x30')]);_0x457394[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x457394[_0xf91d('0x2f')],_0x457394[_0xf91d('0x30')]);_0x2ef4b9['attributes']=_[_0xf91d('0x32')](_0x457394['model'],qs[_0xf91d('0x46')](_0x211160[_0xf91d('0x30')][_0xf91d('0x46')]));_0x2ef4b9[_0xf91d('0x33')]=_0x2ef4b9[_0xf91d('0x33')]['length']?_0x2ef4b9['attributes']:_0x457394[_0xf91d('0x2f')];_0x2ef4b9['order']=qs[_0xf91d('0x36')](_0x211160[_0xf91d('0x30')]['sort']);_0x2ef4b9['where']=qs['filters'](_[_0xf91d('0x38')](_0x211160[_0xf91d('0x30')],_0x457394['filters']));if(_0x211160[_0xf91d('0x30')][_0xf91d('0x39')]){_0x2ef4b9[_0xf91d('0x37')]=_[_0xf91d('0x3a')](_0x2ef4b9['where'],{'$or':_[_0xf91d('0x2b')](_0x2ef4b9[_0xf91d('0x33')],function(_0x298749){var _0x4148bf={};_0x4148bf[_0x298749]={'$like':'%'+_0x211160[_0xf91d('0x30')][_0xf91d('0x39')]+'%'};return _0x4148bf;})});}_0x2ef4b9=_[_0xf91d('0x3a')]({},_0x2ef4b9,_0x211160[_0xf91d('0x3d')]);return _0x3c0058['getMembers'](_0x2ef4b9);}})[_0xf91d('0x27')](function(_0x3038ae){if(_0x3038ae){_0x40d9b4=_0x3038ae[_0xf91d('0x54')];if(!_0x211160['query'][_0xf91d('0x34')](_0xf91d('0x55'))){_0x2ef4b9['limit']=qs[_0xf91d('0x22')](_0x211160[_0xf91d('0x30')][_0xf91d('0x22')]);_0x2ef4b9[_0xf91d('0x21')]=qs[_0xf91d('0x21')](_0x211160[_0xf91d('0x30')][_0xf91d('0x21')]);}return _0x3c0058[_0xf91d('0x51')](_0x2ef4b9);}})[_0xf91d('0x27')](function(_0x41540c){if(_0x41540c){return _0x41540c?{'count':_0x40d9b4,'rows':_0x41540c}:null;}})['then'](respondWithResult(_0x578630,null))[_0xf91d('0x43')](handleError(_0x578630,null));};exports[_0xf91d('0x56')]=function(_0x5ed247,_0x363971,_0x3bb1b1){return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x5ed247[_0xf91d('0x45')]['id']}})['then'](handleEntityNotFound(_0x363971,null))[_0xf91d('0x27')](function(_0x383592){if(_0x383592){return _0x383592[_0xf91d('0x56')](_0x5ed247['query']['ids']);}})[_0xf91d('0x27')](respondWithStatusCode(_0x363971,null))[_0xf91d('0x43')](handleError(_0x363971,null));};exports['addMessage']=function(_0x31696b,_0x503fbe,_0x38a92b){if(_0x31696b[_0xf91d('0x49')]['id']){delete _0x31696b[_0xf91d('0x49')]['id'];}return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x31696b[_0xf91d('0x45')]['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x503fbe,null))['then'](function(_0x105f64){if(_0x105f64){_0x31696b[_0xf91d('0x49')][_0xf91d('0x57')]=_0x105f64['id'];return db[_0xf91d('0x4c')][_0xf91d('0x48')](_0x31696b[_0xf91d('0x49')]);}})[_0xf91d('0x27')](respondWithResult(_0x503fbe,null))['catch'](handleError(_0x503fbe,null));};exports[_0xf91d('0x58')]=function(_0x3f3c34,_0x490e9e,_0x3c2856){var _0x2f17d4={};var _0x4c7c13={};var _0x3f1230;var _0x84ce79;return db[_0xf91d('0x3e')][_0xf91d('0x52')]({'where':{'id':_0x3f3c34['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x490e9e,null))['then'](function(_0x4f0452){if(_0x4f0452){_0x3f1230=_0x4f0452;_0x4c7c13[_0xf91d('0x2f')]=_[_0xf91d('0x59')](db[_0xf91d('0x4c')]['rawAttributes']);_0x4c7c13[_0xf91d('0x30')]=_[_0xf91d('0x59')](_0x3f3c34['query']);_0x4c7c13[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x4c7c13['model'],_0x4c7c13[_0xf91d('0x30')]);_0x2f17d4[_0xf91d('0x33')]=_[_0xf91d('0x32')](_0x4c7c13[_0xf91d('0x2f')],qs['fields'](_0x3f3c34[_0xf91d('0x30')]['fields']));_0x2f17d4[_0xf91d('0x33')]=_0x2f17d4[_0xf91d('0x33')][_0xf91d('0x54')]?_0x2f17d4[_0xf91d('0x33')]:_0x4c7c13['model'];_0x2f17d4[_0xf91d('0x35')]=qs[_0xf91d('0x36')](_0x3f3c34[_0xf91d('0x30')]['sort']);_0x2f17d4[_0xf91d('0x37')]=qs['filters'](_['pick'](_0x3f3c34[_0xf91d('0x30')],_0x4c7c13['filters']));if(_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x39')]){_0x2f17d4[_0xf91d('0x37')]=_[_0xf91d('0x3a')](_0x2f17d4[_0xf91d('0x37')],{'$or':_[_0xf91d('0x2b')](_0x2f17d4[_0xf91d('0x33')],function(_0x2a876d){var _0x1d2955={};_0x1d2955[_0x2a876d]={'$like':'%'+_0x3f3c34[_0xf91d('0x30')]['filter']+'%'};return _0x1d2955;})});}if(_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x5a')]){var _0x2f37b0=_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x5a')]['split'](',');var _0xfa11c0={};_0xfa11c0[_0x2f37b0[0x0]]={'$gte':moment(_0x2f37b0[0x1])[_0xf91d('0x5b')](_0xf91d('0x5c'))};_0x2f17d4['where']=_['merge'](_0x2f17d4[_0xf91d('0x37')],_0xfa11c0);}_0x2f17d4=_[_0xf91d('0x3a')]({},_0x2f17d4,_0x3f3c34[_0xf91d('0x3d')]);return _0x3f1230['getMessages'](_0x2f17d4);}})[_0xf91d('0x27')](function(_0x542a81){if(_0x542a81){_0x84ce79=_0x542a81[_0xf91d('0x54')];if(!_0x3f3c34['query']['hasOwnProperty'](_0xf91d('0x55'))){_0x2f17d4['limit']=qs['limit'](_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x22')]);_0x2f17d4[_0xf91d('0x21')]=qs[_0xf91d('0x21')](_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x21')]);}return _0x3f1230['getMessages'](_0x2f17d4);}})[_0xf91d('0x27')](function(_0x57d3a9){if(_0x57d3a9){return _0x57d3a9?{'count':_0x84ce79,'rows':_0x57d3a9}:null;}})[_0xf91d('0x27')](respondWithResult(_0x490e9e,null))[_0xf91d('0x43')](handleError(_0x490e9e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 589a280..904175e 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 _0x5950=['ChatGroup','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5950,0x11e));var _0x0595=function(_0x4c68bc,_0x1957d7){_0x4c68bc=_0x4c68bc-0x0;var _0x17bb71=_0x5950[_0x4c68bc];return _0x17bb71;};'use strict';var EventEmitter=require(_0x0595('0x0'));var ChatGroup=require(_0x0595('0x1'))['db'][_0x0595('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0595('0x3')](0x0);var events={'afterCreate':_0x0595('0x4'),'afterUpdate':_0x0595('0x5'),'afterDestroy':_0x0595('0x6')};function emitEvent(_0x294438){return function(_0x18065f,_0x5ea571,_0x5ba764){ChatGroupEvents[_0x0595('0x7')](_0x294438+':'+_0x18065f['id'],_0x18065f);ChatGroupEvents[_0x0595('0x7')](_0x294438,_0x18065f);_0x5ba764(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x0595('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x3f1f=['events','../../mysqldb','ChatGroup','emit','hasOwnProperty'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x3f1f,0x109));var _0xf3f1=function(_0x3fafac,_0x339db3){_0x3fafac=_0x3fafac-0x0;var _0xde16a3=_0x3f1f[_0x3fafac];return _0xde16a3;};'use strict';var EventEmitter=require(_0xf3f1('0x0'));var ChatGroup=require(_0xf3f1('0x1'))['db'][_0xf3f1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x53dc9c){return function(_0x37beab,_0x19aacf,_0x57219e){ChatGroupEvents[_0xf3f1('0x3')](_0x53dc9c+':'+_0x37beab['id'],_0x37beab);ChatGroupEvents['emit'](_0x53dc9c,_0x37beab);_0x57219e(null);};}for(var e in events){if(events[_0xf3f1('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 05ee16f..51f3e01 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 _0x893e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash'];(function(_0x14ddd4,_0x5b527d){var _0x421616=function(_0x4f0a42){while(--_0x4f0a42){_0x14ddd4['push'](_0x14ddd4['shift']());}};_0x421616(++_0x5b527d);}(_0x893e,0x1a3));var _0xe893=function(_0xcf4560,_0xee698){_0xcf4560=_0xcf4560-0x0;var _0x1f8a96=_0x893e[_0xcf4560];return _0x1f8a96;};'use strict';var _=require(_0xe893('0x0'));var util=require('util');var logger=require(_0xe893('0x1'))(_0xe893('0x2'));var moment=require(_0xe893('0x3'));var BPromise=require(_0xe893('0x4'));var rp=require(_0xe893('0x5'));var fs=require('fs');var path=require(_0xe893('0x6'));var rimraf=require('rimraf');var config=require(_0xe893('0x7'));var attributes=require(_0xe893('0x8'));module[_0xe893('0x9')]=function(_0x2ce5c5,_0x40902a){return _0x2ce5c5['define'](_0xe893('0xa'),attributes,{'tableName':_0xe893('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5340=['chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x55dc9d,_0x5d9546){var _0x9111eb=function(_0x4d2887){while(--_0x4d2887){_0x55dc9d['push'](_0x55dc9d['shift']());}};_0x9111eb(++_0x5d9546);}(_0x5340,0x181));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0534('0x0'));var util=require(_0x0534('0x1'));var logger=require(_0x0534('0x2'))(_0x0534('0x3'));var moment=require(_0x0534('0x4'));var BPromise=require('bluebird');var rp=require(_0x0534('0x5'));var fs=require('fs');var path=require(_0x0534('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0534('0x7'));module[_0x0534('0x8')]=function(_0x419007,_0xf96404){return _0x419007[_0x0534('0x9')](_0x0534('0xa'),attributes,{'tableName':_0x0534('0xb'),'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 6fd8e9b..37043dc 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 _0xfd28=['message','info','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52ca59,_0x279dda){var _0x1ab7e5=function(_0x2b8c74){while(--_0x2b8c74){_0x52ca59['push'](_0x52ca59['shift']());}};_0x1ab7e5(++_0x279dda);}(_0xfd28,0x148));var _0x8fd2=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xfd28[_0x38b14f];return _0x22a324;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});config[_0x8fd2('0xa')]=_['defaults'](config['redis'],{'host':_0x8fd2('0xb'),'port':0x18eb});var socket=require(_0x8fd2('0xc'))(new Redis(config[_0x8fd2('0xa')]));require('./chatGroup.socket')[_0x8fd2('0xd')](socket);function respondWithRpcPromise(_0x49ca87,_0x2842f3,_0x5aabf0){return new BPromise(function(_0x34ae5c,_0x4fdf0b){return client[_0x8fd2('0xe')](_0x49ca87,_0x5aabf0)['then'](function(_0x1b6558){logger['info'](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));logger[_0x8fd2('0x11')](_0x8fd2('0x12'),_0x2842f3,_0x8fd2('0x10'),JSON[_0x8fd2('0x13')](_0x1b6558));if(_0x1b6558[_0x8fd2('0x14')]){if(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x15')]===0x1f4){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);return _0x4fdf0b(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);}logger['error'](_0x8fd2('0xf'),_0x2842f3,_0x1b6558['error']['message']);return _0x34ae5c(_0x1b6558['error'][_0x8fd2('0x16')]);}else{logger[_0x8fd2('0x17')](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));_0x34ae5c(_0x1b6558['result'][_0x8fd2('0x16')]);}})[_0x8fd2('0x18')](function(_0x411943){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x411943);_0x4fdf0b(_0x411943);});});} \ No newline at end of file +var _0xc8f3=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0xc8f3,0x1d3));var _0x3c8f=function(_0x35fdff,_0x58bf32){_0x35fdff=_0x35fdff-0x0;var _0x44b12a=_0xc8f3[_0x35fdff];return _0x44b12a;};'use strict';var _=require(_0x3c8f('0x0'));var util=require(_0x3c8f('0x1'));var moment=require(_0x3c8f('0x2'));var BPromise=require(_0x3c8f('0x3'));var rs=require(_0x3c8f('0x4'));var fs=require('fs');var Redis=require(_0x3c8f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c8f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c8f('0x7'));var jayson=require(_0x3c8f('0x8'));var client=jayson[_0x3c8f('0x9')][_0x3c8f('0xa')]({'port':0x232a});config[_0x3c8f('0xb')]=_['defaults'](config[_0x3c8f('0xb')],{'host':_0x3c8f('0xc'),'port':0x18eb});var socket=require(_0x3c8f('0xd'))(new Redis(config[_0x3c8f('0xb')]));require(_0x3c8f('0xe'))[_0x3c8f('0xf')](socket);function respondWithRpcPromise(_0x419518,_0x1ce5c4,_0x3e9156){return new BPromise(function(_0x572141,_0x28fccc){return client[_0x3c8f('0x10')](_0x419518,_0x3e9156)['then'](function(_0x2f31f9){logger[_0x3c8f('0x11')](_0x3c8f('0x12'),_0x1ce5c4,'request\x20sent');logger[_0x3c8f('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1ce5c4,_0x3c8f('0x14'),JSON['stringify'](_0x2f31f9));if(_0x2f31f9[_0x3c8f('0x15')]){if(_0x2f31f9['error'][_0x3c8f('0x16')]===0x1f4){logger[_0x3c8f('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1ce5c4,_0x2f31f9[_0x3c8f('0x15')]['message']);return _0x28fccc(_0x2f31f9[_0x3c8f('0x15')][_0x3c8f('0x17')]);}logger[_0x3c8f('0x15')](_0x3c8f('0x12'),_0x1ce5c4,_0x2f31f9[_0x3c8f('0x15')][_0x3c8f('0x17')]);return _0x572141(_0x2f31f9[_0x3c8f('0x15')][_0x3c8f('0x17')]);}else{logger[_0x3c8f('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1ce5c4,_0x3c8f('0x14'));_0x572141(_0x2f31f9[_0x3c8f('0x18')][_0x3c8f('0x17')]);}})['catch'](function(_0x5ee69e){logger['error'](_0x3c8f('0x12'),_0x1ce5c4,_0x5ee69e);_0x28fccc(_0x5ee69e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 7ab62ef..1c82f99 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 _0x0573=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x450bfe,_0x5772a8){var _0x20d151=function(_0x3618de){while(--_0x3618de){_0x450bfe['push'](_0x450bfe['shift']());}};_0x20d151(++_0x5772a8);}(_0x0573,0xdc));var _0x3057=function(_0x360819,_0x3e8e07){_0x360819=_0x360819-0x0;var _0x353edf=_0x0573[_0x360819];return _0x353edf;};'use strict';var ChatGroupEvents=require(_0x3057('0x0'));var events=[_0x3057('0x1'),_0x3057('0x2'),_0x3057('0x3')];function createListener(_0xe8e06,_0x471aea){return function(_0x557113){_0x471aea[_0x3057('0x4')](_0xe8e06,_0x557113);};}function removeListener(_0x455bd9,_0x252fa2){return function(){ChatGroupEvents[_0x3057('0x5')](_0x455bd9,_0x252fa2);};}exports[_0x3057('0x6')]=function(_0x2fd4c6){for(var _0x2c1d90=0x0,_0x2ee40f=events[_0x3057('0x7')];_0x2c1d90<_0x2ee40f;_0x2c1d90++){var _0x2ac437=events[_0x2c1d90];var _0x4f5ebc=createListener(_0x3057('0x8')+_0x2ac437,_0x2fd4c6);ChatGroupEvents['on'](_0x2ac437,_0x4f5ebc);}}; \ No newline at end of file +var _0x5460=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5460,0x72));var _0x0546=function(_0x18b7e8,_0x58058c){_0x18b7e8=_0x18b7e8-0x0;var _0x4a8bc0=_0x5460[_0x18b7e8];return _0x4a8bc0;};'use strict';var ChatGroupEvents=require(_0x0546('0x0'));var events=[_0x0546('0x1'),_0x0546('0x2'),_0x0546('0x3')];function createListener(_0x31c47b,_0x35930d){return function(_0x4ba037){_0x35930d[_0x0546('0x4')](_0x31c47b,_0x4ba037);};}function removeListener(_0x260107,_0x2b1e2a){return function(){ChatGroupEvents[_0x0546('0x5')](_0x260107,_0x2b1e2a);};}exports[_0x0546('0x6')]=function(_0x3b0638){for(var _0x56a284=0x0,_0x2a8f2a=events[_0x0546('0x7')];_0x56a284<_0x2a8f2a;_0x56a284++){var _0x171ae2=events[_0x56a284];var _0x292380=createListener(_0x0546('0x8')+_0x171ae2,_0x3b0638);ChatGroupEvents['on'](_0x171ae2,_0x292380);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 745963a..66534e6 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 _0x1e2b=['post','create','addMembers','addMessage','update','destroy','delete','removeMembers','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./chatGroup.controller','index','get','/describe','describe','/:id','show','/:id/unread','isAuthenticated','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x1e2b,0x1d9));var _0xb1e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e2b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb1e2('0x0'));var util=require(_0xb1e2('0x1'));var path=require(_0xb1e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1e2('0x3')]();var fs_extra=require(_0xb1e2('0x4'));var auth=require(_0xb1e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1e2('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb1e2('0x7')]);router[_0xb1e2('0x8')](_0xb1e2('0x9'),auth['isAuthenticated'](),controller[_0xb1e2('0xa')]);router['get'](_0xb1e2('0xb'),auth['isAuthenticated'](),controller[_0xb1e2('0xc')]);router[_0xb1e2('0x8')](_0xb1e2('0xd'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0xf')]);router[_0xb1e2('0x8')](_0xb1e2('0x10'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x11')]);router[_0xb1e2('0x8')](_0xb1e2('0x12'),auth['isAuthenticated'](),controller[_0xb1e2('0x13')]);router[_0xb1e2('0x14')]('/',auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x15')]);router[_0xb1e2('0x14')](_0xb1e2('0x10'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x16')]);router[_0xb1e2('0x14')](_0xb1e2('0x12'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x17')]);router['put'](_0xb1e2('0xb'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x18')]);router['delete'](_0xb1e2('0xb'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x19')]);router[_0xb1e2('0x1a')](_0xb1e2('0x10'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x1b')]);module[_0xb1e2('0x1c')]=router; \ No newline at end of file +var _0x9c3f=['addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create'];(function(_0x48cf29,_0x2a36f3){var _0x4e81ff=function(_0x4f5513){while(--_0x4f5513){_0x48cf29['push'](_0x48cf29['shift']());}};_0x4e81ff(++_0x2a36f3);}(_0x9c3f,0x19c));var _0xf9c3=function(_0x1991fe,_0x2f3b62){_0x1991fe=_0x1991fe-0x0;var _0x1f6b32=_0x9c3f[_0x1991fe];return _0x1f6b32;};'use strict';var multer=require(_0xf9c3('0x0'));var util=require(_0xf9c3('0x1'));var path=require(_0xf9c3('0x2'));var timeout=require(_0xf9c3('0x3'));var express=require(_0xf9c3('0x4'));var router=express[_0xf9c3('0x5')]();var fs_extra=require(_0xf9c3('0x6'));var auth=require(_0xf9c3('0x7'));var interaction=require(_0xf9c3('0x8'));var config=require(_0xf9c3('0x9'));var controller=require('./chatGroup.controller');router[_0xf9c3('0xa')]('/',auth['isAuthenticated'](),controller[_0xf9c3('0xb')]);router['get'](_0xf9c3('0xc'),auth[_0xf9c3('0xd')](),controller['describe']);router[_0xf9c3('0xa')](_0xf9c3('0xe'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0xf')]);router[_0xf9c3('0xa')](_0xf9c3('0x10'),auth['isAuthenticated'](),controller[_0xf9c3('0x11')]);router[_0xf9c3('0xa')](_0xf9c3('0x12'),auth[_0xf9c3('0xd')](),controller['getMembers']);router['get'](_0xf9c3('0x13'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x14')]);router[_0xf9c3('0x15')]('/',auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x16')]);router['post'](_0xf9c3('0x12'),auth[_0xf9c3('0xd')](),controller['addMembers']);router[_0xf9c3('0x15')]('/:id/messages',auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x17')]);router[_0xf9c3('0x18')](_0xf9c3('0xe'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x19')]);router[_0xf9c3('0x1a')](_0xf9c3('0xe'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x1b')]);router[_0xf9c3('0x1a')](_0xf9c3('0x12'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f15da3f..2218d46 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 _0x9e61=['DATE','ENUM','sequelize','exports','INTEGER','star','thumb','TEXT','STRING','long'];(function(_0x169318,_0x3b4dfa){var _0x5d07b6=function(_0x1376a8){while(--_0x1376a8){_0x169318['push'](_0x169318['shift']());}};_0x5d07b6(++_0x3b4dfa);}(_0x9e61,0xca));var _0x19e6=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x9e61[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x19e6('0x0'));module[_0x19e6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x19e6('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x19e6('0x3'),_0x19e6('0x4')),'defaultValue':_0x19e6('0x3')},'ratingMessage':{'type':Sequelize[_0x19e6('0x5')]},'pathTranscript':{'type':Sequelize[_0x19e6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x19e6('0x6')]},'thirdDisposition':{'type':Sequelize[_0x19e6('0x6')]},'note':{'type':Sequelize[_0x19e6('0x6')]},'browserName':{'type':Sequelize[_0x19e6('0x6')]},'browserVersion':{'type':Sequelize[_0x19e6('0x6')]},'osName':{'type':Sequelize[_0x19e6('0x6')]},'osVersion':{'type':Sequelize[_0x19e6('0x6')]},'deviceModel':{'type':Sequelize[_0x19e6('0x6')]},'deviceVendor':{'type':Sequelize[_0x19e6('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x19e6('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x19e6('0x5')](_0x19e6('0x7'))},'read1stAt':{'type':Sequelize[_0x19e6('0x8')]},'lastMsgAt':{'type':Sequelize[_0x19e6('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x19e6('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x19e6('0x6')]},'customerPort':{'type':Sequelize[_0x19e6('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x19e6('0x2')]}}; \ No newline at end of file +var _0x6a89=['TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x374226,_0x56ec5c){var _0xb2e1e8=function(_0x3a4412){while(--_0x3a4412){_0x374226['push'](_0x374226['shift']());}};_0xb2e1e8(++_0x56ec5c);}(_0x6a89,0x125));var _0x96a8=function(_0x5cc11e,_0x580887){_0x5cc11e=_0x5cc11e-0x0;var _0x4488a7=_0x6a89[_0x5cc11e];return _0x4488a7;};'use strict';var Sequelize=require(_0x96a8('0x0'));module[_0x96a8('0x1')]={'closed':{'type':Sequelize[_0x96a8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x96a8('0x3')]},'ratingType':{'type':Sequelize[_0x96a8('0x4')](_0x96a8('0x5'),_0x96a8('0x6')),'defaultValue':_0x96a8('0x5')},'ratingMessage':{'type':Sequelize[_0x96a8('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x96a8('0x8')]},'disposition':{'type':Sequelize[_0x96a8('0x9')]},'secondDisposition':{'type':Sequelize[_0x96a8('0x9')]},'thirdDisposition':{'type':Sequelize[_0x96a8('0x9')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x96a8('0x9')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x96a8('0x9')]},'deviceModel':{'type':Sequelize[_0x96a8('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x96a8('0x9')]},'referer':{'type':Sequelize[_0x96a8('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x96a8('0x7')](_0x96a8('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x96a8('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x96a8('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x96a8('0x9')]},'customerPort':{'type':Sequelize[_0x96a8('0x9')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x96a8('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x96a8('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index ff7bc7f..bb41fd8 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 _0xf064=['register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','stack','name','send','render','merge','body','contact','account','ChatInteraction','rawAttributes','type','findAll','chat','user','show','params','query','keys','intersection','model','fields','attributes','include','find','catch','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','Unauthorized','attachId','join','server/files/attachments/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsiteId','ContactId','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','User','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','hasOwnProperty','nolimit','sort','where','ChatInteractionId','map','$gte','split','options','rows','getMyMessages','filters','length','pick','filter','secret','includeAgent','push','includeAll','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x346149,_0x38a525){var _0xc2e79d=function(_0x757e0e){while(--_0x757e0e){_0x346149['push'](_0x346149['shift']());}};_0xc2e79d(++_0x38a525);}(_0xf064,0x193));var _0x4f06=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xf064[_0x492535];return _0x256620;};'use strict';var rimraf=require(_0x4f06('0x0'));var zipdir=require(_0x4f06('0x1'));var rp=require(_0x4f06('0x2'));var moment=require(_0x4f06('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f06('0x4'));var util=require('util');var path=require(_0x4f06('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f06('0x6'));var Redis=require(_0x4f06('0x7'));var interaction=require(_0x4f06('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4f06('0x9'));var logger=require(_0x4f06('0xa'))(_0x4f06('0xb'));var config=require(_0x4f06('0xc'));var db=require(_0x4f06('0xd'))['db'];config[_0x4f06('0xe')]=_[_0x4f06('0xf')](config['redis'],{'host':_0x4f06('0x10'),'port':0x18eb});var socket=require(_0x4f06('0x11'))(new Redis(config[_0x4f06('0xe')]));require(_0x4f06('0x12'))[_0x4f06('0x13')](socket);var jayson=require(_0x4f06('0x14'));var client=jayson[_0x4f06('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x4f06('0x15')][_0x4f06('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x3c8d38,_0x407f1c,_0x3628aa,_0x5ddf27){return new BPromise(function(_0x2472a7,_0x30b230){var _0x381c7e=_0x5ddf27||client;return _0x381c7e[_0x4f06('0x17')](_0x3c8d38,_0x3628aa)[_0x4f06('0x18')](function(_0x237924){logger[_0x4f06('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x407f1c,_0x4f06('0x1a'));logger[_0x4f06('0x1b')](_0x4f06('0x1c'),_0x407f1c,_0x4f06('0x1a'),JSON[_0x4f06('0x1d')](_0x237924));if(_0x237924[_0x4f06('0x1e')]){if(_0x237924[_0x4f06('0x1e')][_0x4f06('0x1f')]===0x1f4){logger[_0x4f06('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x407f1c,_0x237924['error'][_0x4f06('0x20')]);return _0x30b230(_0x237924[_0x4f06('0x1e')][_0x4f06('0x20')]);}logger['error'](_0x4f06('0x21'),_0x407f1c,_0x237924[_0x4f06('0x1e')][_0x4f06('0x20')]);return _0x2472a7(_0x237924[_0x4f06('0x1e')][_0x4f06('0x20')]);}else{logger[_0x4f06('0x19')](_0x4f06('0x21'),_0x407f1c,_0x4f06('0x1a'));_0x2472a7(_0x237924[_0x4f06('0x22')][_0x4f06('0x20')]);}})['catch'](function(_0x1c3cce){logger[_0x4f06('0x1e')](_0x4f06('0x21'),_0x407f1c,_0x1c3cce);_0x30b230(_0x1c3cce);});});}function respondWithStatusCode(_0x53d146,_0x37fb71){_0x37fb71=_0x37fb71||0xcc;return function(_0x2a96f6){if(_0x2a96f6){return _0x53d146[_0x4f06('0x23')](_0x37fb71);}return _0x53d146['status'](_0x37fb71)[_0x4f06('0x24')]();};}function respondWithResult(_0x29f8c2,_0x6951f0){_0x6951f0=_0x6951f0||0xc8;return function(_0x3310cd){if(_0x3310cd){return _0x29f8c2[_0x4f06('0x25')](_0x6951f0)[_0x4f06('0x26')](_0x3310cd);}};}function respondWithFilteredResult(_0x207f46,_0x342742){return function(_0x56642a){if(_0x56642a){var _0x5741f3=typeof _0x342742['offset']==='undefined'&&typeof _0x342742[_0x4f06('0x27')]===_0x4f06('0x28');var _0x5620dd=_0x56642a[_0x4f06('0x29')];var _0x9adce4=_0x5741f3?0x0:_0x342742[_0x4f06('0x2a')];var _0x122083=_0x5741f3?_0x56642a[_0x4f06('0x29')]:_0x342742[_0x4f06('0x2a')]+_0x342742[_0x4f06('0x27')];var _0x429657;if(_0x122083>=_0x5620dd){_0x122083=_0x5620dd;_0x429657=0xc8;}else{_0x429657=0xce;}_0x207f46[_0x4f06('0x25')](_0x429657);return _0x207f46[_0x4f06('0x2b')](_0x4f06('0x2c'),_0x9adce4+'-'+_0x122083+'/'+_0x5620dd)['json'](_0x56642a);}return null;};}function saveUpdates(_0x5ce1c1){return function(_0x279e3f){if(_0x279e3f){return _0x279e3f['update'](_0x5ce1c1)[_0x4f06('0x18')](function(_0x2069cb){return _0x2069cb;});}return null;};}function removeEntity(_0x5e11b8){return function(_0x5ea30d){if(_0x5ea30d){return _0x5ea30d['destroy']()[_0x4f06('0x18')](function(){_0x5e11b8[_0x4f06('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x294245){return function(_0x4affb6){if(!_0x4affb6){_0x294245[_0x4f06('0x23')](0x194);}return _0x4affb6;};}function handleError(_0x4a5fcd,_0x43a6d6){_0x43a6d6=_0x43a6d6||0x1f4;return function(_0x86faac){logger['error'](_0x86faac[_0x4f06('0x2d')]);if(_0x86faac[_0x4f06('0x2e')]){delete _0x86faac[_0x4f06('0x2e')];}_0x4a5fcd[_0x4f06('0x25')](_0x43a6d6)[_0x4f06('0x2f')](_0x86faac);};}function getMustacheRender(_0x1ded17,_0x1a1249){return Mustache[_0x4f06('0x30')](_0x1ded17,_[_0x4f06('0x31')](_0x1a1249[_0x4f06('0x32')],{'contact':_0x1a1249[_0x4f06('0x33')],'message':_0x1a1249[_0x4f06('0x20')],'agent':_0x1a1249['agent'],'interaction':_0x1a1249['interaction'],'account':_0x1a1249[_0x4f06('0x34')]}))||'';}exports['index']=function(_0xb40b73,_0xfd5417){var _0x161669={};var _0x2c66b4=_['map'](db[_0x4f06('0x35')][_0x4f06('0x36')],function(_0x42e2b8){return{'name':_0x42e2b8['fieldName'],'type':_0x42e2b8[_0x4f06('0x37')]['key']};});_0x161669=qs['getOptions'](_0x2c66b4,_0xb40b73);return interaction[_0x4f06('0x38')](_0x4f06('0x39'),_0xb40b73['query'],_0xb40b73[_0x4f06('0x3a')],_0x161669,_0x2c66b4)[_0x4f06('0x18')](respondWithFilteredResult(_0xfd5417,_0x161669))['catch'](handleError(_0xfd5417,null));};exports[_0x4f06('0x3b')]=function(_0x1bd786,_0x5af8e6){var _0x16ca31={'raw':![],'where':{'id':_0x1bd786[_0x4f06('0x3c')]['id']}},_0x4cf163={};_0x4cf163['model']=_['keys'](db[_0x4f06('0x35')][_0x4f06('0x36')]);_0x4cf163[_0x4f06('0x3d')]=_[_0x4f06('0x3e')](_0x1bd786[_0x4f06('0x3d')]);_0x4cf163['filters']=_[_0x4f06('0x3f')](_0x4cf163[_0x4f06('0x40')],_0x4cf163[_0x4f06('0x3d')]);_0x16ca31['attributes']=_[_0x4f06('0x3f')](_0x4cf163[_0x4f06('0x40')],qs[_0x4f06('0x41')](_0x1bd786[_0x4f06('0x3d')]['fields']));_0x16ca31['attributes']=_0x16ca31['attributes']['length']?_0x16ca31[_0x4f06('0x42')]:_0x4cf163['model'];if(_0x1bd786[_0x4f06('0x3d')]['includeAll']){_0x16ca31[_0x4f06('0x43')]=[{'all':!![]}];}_0x16ca31=_['merge']({},_0x16ca31,_0x1bd786['options']);return db['ChatInteraction'][_0x4f06('0x44')](_0x16ca31)[_0x4f06('0x18')](handleEntityNotFound(_0x5af8e6,null))['then'](respondWithResult(_0x5af8e6,null))[_0x4f06('0x45')](handleError(_0x5af8e6,null));};exports[_0x4f06('0x46')]=function(_0x3ad316,_0x5e68bd){return db[_0x4f06('0x35')][_0x4f06('0x46')](_0x3ad316[_0x4f06('0x32')],{})[_0x4f06('0x18')](respondWithResult(_0x5e68bd,0xc9))['catch'](handleError(_0x5e68bd,null));};exports[_0x4f06('0x47')]=function(_0x582eb6,_0x3e1987){if(_0x582eb6[_0x4f06('0x32')]['id']){delete _0x582eb6[_0x4f06('0x32')]['id'];}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x582eb6[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x3e1987,null))[_0x4f06('0x18')](saveUpdates(_0x582eb6[_0x4f06('0x32')],null))[_0x4f06('0x18')](respondWithResult(_0x3e1987,null))['catch'](handleError(_0x3e1987,null));};exports[_0x4f06('0x48')]=function(_0x11dca7,_0x58a8ed){return db[_0x4f06('0x35')]['find']({'where':{'id':_0x11dca7[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x58a8ed,null))[_0x4f06('0x18')](removeEntity(_0x58a8ed,null))[_0x4f06('0x45')](handleError(_0x58a8ed,null));};exports[_0x4f06('0x49')]=function(_0x39a8e7,_0x48efd5){return db[_0x4f06('0x35')][_0x4f06('0x49')]()[_0x4f06('0x18')](respondWithResult(_0x48efd5,null))[_0x4f06('0x45')](handleError(_0x48efd5,null));};exports[_0x4f06('0x4a')]=function(_0x4b492e,_0x31c75c){var _0x33179a=_0x4b492e['params']['id'];var _0x310e34;var _0x273b5a;var _0x3c790c;return db[_0x4f06('0x35')][_0x4f06('0x4b')]({'where':{'id':_0x33179a}})[_0x4f06('0x18')](function(_0x11dea3){_0x310e34=_0x11dea3;return db[_0x4f06('0x4c')][_0x4f06('0x4b')]({'where':{'id':_0x11dea3['ChatWebsiteId']},'attributes':['id',_0x4f06('0x4d'),_0x4f06('0x4e'),'vidaooTopic',_0x4f06('0x4f'),_0x4f06('0x50')],'raw':!![]});})['then'](function(_0x56a13c){if(_0x56a13c&&_0x56a13c[_0x4f06('0x4d')]&&_0x56a13c[_0x4f06('0x4e')]){_0x273b5a=_0x56a13c;var _0x558cc6={'interaction':{'id':_0x33179a},'agent':{'id':_0x4b492e[_0x4f06('0x3a')]['id'],'name':_0x4b492e['user']['name'],'fullname':_0x4b492e['user'][_0x4f06('0x51')],'email':_0x4b492e['user'][_0x4f06('0x52')]},'contact':_0x4b492e['body'][_0x4f06('0x33')],'account':_0x4b492e[_0x4f06('0x32')][_0x4f06('0x34')]};var _0x3d2063={'rejectUnauthorized':![],'method':_0x4f06('0x53'),'url':_0x4f06('0x54'),'headers':{'X-APIKEY':_0x56a13c[_0x4f06('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b492e[_0x4f06('0x3a')][_0x4f06('0x52')]],'buttons':null,'topic':_0x273b5a[_0x4f06('0x55')],'note':_[_0x4f06('0x56')](_0x273b5a[_0x4f06('0x4f')])?null:getMustacheRender(_0x273b5a[_0x4f06('0x4f')],_0x558cc6),'metadata':null},'redirect':_0x4f06('0x57'),'json':!![]};try{if(!_[_0x4f06('0x56')](_0x273b5a[_0x4f06('0x50')])){var _0x4a316a=getMustacheRender(_0x273b5a['vidaooMetadata'],_0x558cc6);var _0x3156dd=JSON['parse'](_0x4a316a);_0x3d2063['body']['metadata']=_0x3156dd;}}catch(_0x12cb2a){throw new db[(_0x4f06('0x58'))][(_0x4f06('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3d2063);}else{throw new db[(_0x4f06('0x58'))][(_0x4f06('0x59'))](_0x4f06('0x5a'));}})[_0x4f06('0x18')](function(_0x6a08a1){_0x3c790c=_0x6a08a1;if(_0x3c790c['id']){var _0x2da217={'body':_0x3c790c[_0x4f06('0x5b')],'ChatWebsiteId':_0x273b5a['id'],'ChatInteractionId':_0x310e34['id'],'direction':_0x4f06('0x5c'),'UserId':_0x4b492e[_0x4f06('0x3a')]['id']};return db[_0x4f06('0x5d')][_0x4f06('0x46')](_0x2da217,{});}else{throw new db[(_0x4f06('0x58'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x4f06('0x18')](function(){return _0x310e34['updateAttributes']({'vidaooSessionId':_0x3c790c['id']});})[_0x4f06('0x18')](respondWithResult(_0x31c75c,null))[_0x4f06('0x45')](handleError(_0x31c75c,null));};exports[_0x4f06('0x5e')]=function(_0x5db13f,_0x3ace76){if(_0x5db13f[_0x4f06('0x32')]['id']){delete _0x5db13f[_0x4f06('0x32')]['id'];}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x5db13f[_0x4f06('0x3c')]['id']},'include':[{'model':db[_0x4f06('0x5f')],'as':_0x4f06('0x60')}]})[_0x4f06('0x18')](handleEntityNotFound(_0x3ace76,null))['then'](saveUpdates(_0x5db13f[_0x4f06('0x32')],null))[_0x4f06('0x18')](respondWithResult(_0x3ace76,null))[_0x4f06('0x45')](handleError(_0x3ace76,null));};exports[_0x4f06('0x61')]=function(_0x29c64b,_0x16df28){if(_0x29c64b[_0x4f06('0x32')]['id']){delete _0x29c64b['body']['id'];}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x29c64b[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](function(_0x135d04){if(!_0x135d04){logger[_0x4f06('0x1e')](_0x4f06('0x62'),_0x4f06('0x61'),0x194,_0x4f06('0x63'));_0x16df28[_0x4f06('0x23')](0x194);}else{if(_0x135d04[_0x4f06('0x64')]){throw new db[(_0x4f06('0x58'))][(_0x4f06('0x59'))](_0x4f06('0x65'));}}return _0x135d04;})[_0x4f06('0x18')](function(_0x4c028d){if(_0x4c028d){return _0x4c028d['update']({'closed':_0x29c64b[_0x4f06('0x32')][_0x4f06('0x66')],'disposition':_0x29c64b[_0x4f06('0x32')][_0x4f06('0x67')]})['then'](function(_0x56dd87){return _0x56dd87;});}})[_0x4f06('0x18')](function(){return respondWithRpcPromise(_0x4f06('0x68'),_0x4f06('0x61'),_0x29c64b[_0x4f06('0x32')],client9004);})[_0x4f06('0x18')](respondWithResult(_0x16df28,null))[_0x4f06('0x45')](handleError(_0x16df28,null));};exports[_0x4f06('0x69')]=function(_0x53d82e,_0x326d9f){_0x53d82e['body'][_0x4f06('0x2e')]=_0x53d82e[_0x4f06('0x6a')][_0x4f06('0x6b')];_0x53d82e[_0x4f06('0x32')][_0x4f06('0x6c')]=_0x53d82e[_0x4f06('0x6a')]['filename'];_0x53d82e[_0x4f06('0x32')]['type']=_0x53d82e[_0x4f06('0x6a')][_0x4f06('0x6d')];return db[_0x4f06('0x6e')][_0x4f06('0x46')](_0x53d82e[_0x4f06('0x32')])[_0x4f06('0x18')](respondWithResult(_0x326d9f,0xc9))[_0x4f06('0x45')](handleError(_0x326d9f,null));};exports['attachmentDownload']=function(_0x14093b,_0x2b6452){return db[_0x4f06('0x35')]['findOne']({'where':{'id':_0x14093b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2b6452,null))[_0x4f06('0x18')](function(_0x5a8ed2){if(_0x5a8ed2){if(_0x5a8ed2[_0x4f06('0x66')]){return _0x2b6452['status'](0x193)[_0x4f06('0x26')]({'status':0x193,'message':_0x4f06('0x6f')});}return db['Attachment'][_0x4f06('0x4b')]({'where':{'id':_0x14093b[_0x4f06('0x3d')][_0x4f06('0x70')]},'raw':!![]})[_0x4f06('0x18')](handleEntityNotFound(_0x2b6452,null));}})['then'](function(_0x5d250f){if(_0x5d250f){var _0x3afa41=_0x5d250f['ChatOfflineMessageId']!==null;var _0x5237e3=path[_0x4f06('0x71')](config['root'],_0x4f06('0x72'));if(_0x3afa41){_0x5237e3=path['join'](_0x5237e3,'offline-chat/');}var _0x4410dc=path[_0x4f06('0x71')](_0x5237e3,_0x5d250f[_0x4f06('0x6c')]);return _0x2b6452[_0x4f06('0x73')](_0x4410dc);}})[_0x4f06('0x45')](handleError(_0x2b6452,null));};exports[_0x4f06('0x74')]=function(_0x49be77,_0x3676d3){var _0x309ac2=null;var _0x158963=null;var _0x46fc4e=null;if(_0x49be77[_0x4f06('0x32')]['id']){delete _0x49be77['body']['id'];}if(_0x49be77[_0x4f06('0x32')][_0x4f06('0x75')]){_0x46fc4e=path[_0x4f06('0x71')](config[_0x4f06('0x76')],_0x4f06('0x77'),util[_0x4f06('0x78')](_0x4f06('0x79'),Date[_0x4f06('0x7a')]()));_0x49be77[_0x4f06('0x32')][_0x4f06('0x7b')]=_0x46fc4e;}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x49be77[_0x4f06('0x3c')]['id']},'include':[{'model':db[_0x4f06('0x5d')],'as':_0x4f06('0x7c'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x3676d3,null))[_0x4f06('0x18')](saveUpdates(_0x49be77[_0x4f06('0x32')],null))[_0x4f06('0x18')](function(_0x59cedb){if(_0x59cedb){_0x309ac2=_0x59cedb;return db[_0x4f06('0x4c')][_0x4f06('0x44')]({'where':{'id':_0x309ac2[_0x4f06('0x7d')]}});}})[_0x4f06('0x18')](function(_0x2e3978){if(_0x2e3978){_0x158963=_0x2e3978;return db['CmContact'][_0x4f06('0x44')]({'where':{'id':_0x309ac2[_0x4f06('0x7e')]}});}})[_0x4f06('0x18')](function(_0x4d208b){if(_0x4d208b){if(_0x46fc4e){var _0x4c924b=null;for(var _0x3056c7=0x1;_0x3056c7<_0x309ac2['Messages']['length'];++_0x3056c7){_0x4c924b=_0x309ac2[_0x4f06('0x7c')][_0x3056c7];var _0x5e8538=_0x4c924b[_0x4f06('0x64')]?util['format']('%s%d',_0x158963[_0x4f06('0x7f')],_0x4c924b[_0x4f06('0x64')]):'System';var _0x42bc88=_0x49be77[_0x4f06('0x32')][_0x4f06('0x80')]||util[_0x4f06('0x78')](_0x4f06('0x81'),_0x4f06('0x82'),_0x4c924b[_0x4f06('0x7e')]);switch(_0x158963[_0x4f06('0x83')]){case _0x4f06('0x84'):_0x5e8538=_0x4c924b[_0x4f06('0x64')]?util[_0x4f06('0x78')](_0x4f06('0x81'),_0x158963['agentAlias'],_0x4c924b[_0x4f06('0x64')]):_0x4f06('0x85');break;case _0x4f06('0x86'):_0x5e8538=_0x4c924b[_0x4f06('0x64')]?_0x4c924b[_0x4f06('0x87')][_0x4f06('0x88')]||_0x4c924b['User'][_0x4f06('0x51')]:_0x4f06('0x85');break;case'agent_fullname':_0x5e8538=_0x4c924b[_0x4f06('0x64')]?_0x4c924b['User']['fullname']:'System';break;default:_0x5e8538=_0x4c924b['UserId']?util[_0x4f06('0x78')](_0x4f06('0x81'),_0x158963[_0x4f06('0x7f')],_0x4c924b[_0x4f06('0x64')]):_0x4f06('0x85');}var _0x39c1ea=util[_0x4f06('0x78')](_0x4f06('0x89'),moment(_0x4c924b[_0x4f06('0x8a')])[_0x4f06('0x78')](_0x4f06('0x8b')),_0x4c924b[_0x4f06('0x8c')]==='in'?_0x42bc88:_0x5e8538,_0x4c924b[_0x4f06('0x32')]);if(!_0x4c924b['secret']){fs[_0x4f06('0x8d')](_0x46fc4e,_0x39c1ea);}}return db[_0x4f06('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4f06('0x8f'),'raw':!![],'include':[{'model':db[_0x4f06('0x90')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x4f0dd0){if(!_0x4f0dd0||!_0x4f0dd0[_0x4f06('0x8f')]||!_0x49be77[_0x4f06('0x32')])return _0x309ac2;var _0x44d48b=_0x4f0dd0[_0x4f06('0x91')]();return respondWithRpcPromise(_0x4f06('0x92'),_0x4f06('0x93'),{'account':_0x44d48b,'message':{'from':util[_0x4f06('0x78')](_0x4f06('0x94'),_0x4f0dd0['name'],_0x4f0dd0['email']||_0x4f0dd0[_0x4f06('0x8f')][_0x4f06('0x3a')]),'to':_0x49be77['body'][_0x4f06('0x75')],'subject':_0x4f06('0x95'),'text':util[_0x4f06('0x78')](_0x4f06('0x96'),_0x49be77[_0x4f06('0x32')][_0x4f06('0x75')]),'attachments':[{'path':_0x46fc4e}]}})[_0x4f06('0x18')](function(){return _0x309ac2;})[_0x4f06('0x45')](function(_0x58bfe9){logger[_0x4f06('0x1e')](_0x58bfe9);});})[_0x4f06('0x18')](respondWithStatusCode(_0x3676d3,0xc8))[_0x4f06('0x45')](handleError(_0x3676d3,null));};exports['addMessage']=function(_0x392ab8,_0x3c1623){return db[_0x4f06('0x5d')][_0x4f06('0x44')]({'where':{'id':_0x392ab8[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x3c1623,null))['then'](function(_0x4cb3be){if(_0x4cb3be){return _0x4cb3be['addMessage'](_0x392ab8[_0x4f06('0x32')][_0x4f06('0x97')],_[_0x4f06('0x98')](_0x392ab8[_0x4f06('0x32')],['ids','id'])||{});}})[_0x4f06('0x18')](respondWithResult(_0x3c1623,null))[_0x4f06('0x45')](handleError(_0x3c1623,null));};exports['getMessages']=function(_0xdd7c53,_0x4660e5){var _0x5e0416={'raw':![],'where':{}};var _0x3166bd={};var _0x292094={'count':0x0,'rows':[]};return db[_0x4f06('0x35')]['findOne']({'where':{'id':_0xdd7c53['params']['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x4660e5,null))[_0x4f06('0x18')](function(_0x204207){if(_0x204207){_0x3166bd['model']=_['keys'](db[_0x4f06('0x5d')][_0x4f06('0x36')]);_0x3166bd['query']=_[_0x4f06('0x3e')](_0xdd7c53['query']);_0x3166bd['filters']=_[_0x4f06('0x3f')](_0x3166bd[_0x4f06('0x40')],_0x3166bd[_0x4f06('0x3d')]);_0x5e0416[_0x4f06('0x42')]=_[_0x4f06('0x3f')](_0x3166bd['model'],qs[_0x4f06('0x41')](_0xdd7c53[_0x4f06('0x3d')]['fields']));_0x5e0416[_0x4f06('0x42')]=_0x5e0416[_0x4f06('0x42')]['length']?_0x5e0416[_0x4f06('0x42')]:_0x3166bd[_0x4f06('0x40')];if(!_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x99')](_0x4f06('0x9a'))){_0x5e0416[_0x4f06('0x27')]=qs[_0x4f06('0x27')](_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x27')]);_0x5e0416[_0x4f06('0x2a')]=qs[_0x4f06('0x2a')](_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x2a')]);}_0x5e0416['order']=qs[_0x4f06('0x9b')](_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x9b')]);_0x5e0416[_0x4f06('0x9c')]=qs['filters'](_['pick'](_0xdd7c53[_0x4f06('0x3d')],_0x3166bd['filters']));_0x5e0416[_0x4f06('0x9c')][_0x4f06('0x9d')]=_0x204207['id'];if(_0xdd7c53['query']['filter']){_0x5e0416[_0x4f06('0x9c')]=_['merge'](_0x5e0416[_0x4f06('0x9c')],{'$or':_[_0x4f06('0x9e')](_0x5e0416[_0x4f06('0x42')],function(_0x9a8ce7){var _0x181219={};_0x181219[_0x9a8ce7]={'$like':'%'+_0xdd7c53[_0x4f06('0x3d')]['filter']+'%'};return _0x181219;})});}if(_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x9f')]){var _0x30729c=_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x9f')][_0x4f06('0xa0')](',');var _0x17f31b={};_0x17f31b[_0x30729c[0x0]]={'$gte':moment(_0x30729c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5e0416['where']=_[_0x4f06('0x31')](_0x5e0416[_0x4f06('0x9c')],_0x17f31b);}_0x5e0416=_[_0x4f06('0x31')]({},_0x5e0416,_0xdd7c53[_0x4f06('0xa1')]);return db[_0x4f06('0x5d')]['count']({'where':_0x5e0416[_0x4f06('0x9c')]})[_0x4f06('0x18')](function(_0x4c17b9){_0x292094[_0x4f06('0x29')]=_0x4c17b9;if(_0xdd7c53[_0x4f06('0x3d')]['includeAll']){_0x5e0416['include']=[{'all':!![]}];}return db[_0x4f06('0x5d')]['findAll'](_0x5e0416);})[_0x4f06('0x18')](function(_0x194e8c){_0x292094[_0x4f06('0xa2')]=_0x194e8c;return _0x292094;});}})[_0x4f06('0x18')](respondWithFilteredResult(_0x4660e5,_0x5e0416))[_0x4f06('0x45')](handleError(_0x4660e5,null));};exports[_0x4f06('0xa3')]=function(_0x5d4037,_0x34dbbc){var _0x29d1dd={'where':{}},_0x2f58fd={},_0xcdd8fc={'count':0x0,'rows':[]};return db[_0x4f06('0x35')][_0x4f06('0x4b')]({'where':{'id':_0x5d4037[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x34dbbc,null))['then'](function(_0x27e8b9){if(_0x27e8b9){_0x2f58fd[_0x4f06('0x40')]=_[_0x4f06('0x3e')](db['ChatMessage'][_0x4f06('0x36')]);_0x2f58fd['query']=_[_0x4f06('0x3e')](_0x5d4037['query']);_0x2f58fd[_0x4f06('0xa4')]=_[_0x4f06('0x3f')](_0x2f58fd[_0x4f06('0x40')],_0x2f58fd['query']);_0x29d1dd['attributes']=_[_0x4f06('0x3f')](_0x2f58fd[_0x4f06('0x40')],qs[_0x4f06('0x41')](_0x5d4037[_0x4f06('0x3d')]['fields']));_0x29d1dd['attributes']=_0x29d1dd['attributes'][_0x4f06('0xa5')]?_0x29d1dd[_0x4f06('0x42')]:_0x2f58fd[_0x4f06('0x40')];if(!_0x5d4037[_0x4f06('0x3d')][_0x4f06('0x99')](_0x4f06('0x9a'))){_0x29d1dd[_0x4f06('0x27')]=qs[_0x4f06('0x27')](_0x5d4037[_0x4f06('0x3d')][_0x4f06('0x27')]);_0x29d1dd['offset']=qs[_0x4f06('0x2a')](_0x5d4037[_0x4f06('0x3d')]['offset']);}_0x29d1dd['order']=qs[_0x4f06('0x9b')](_0x5d4037[_0x4f06('0x3d')][_0x4f06('0x9b')]);_0x29d1dd['where']=qs[_0x4f06('0xa4')](_[_0x4f06('0xa6')](_0x5d4037[_0x4f06('0x3d')],_0x2f58fd[_0x4f06('0xa4')]));_0x29d1dd['where'][_0x4f06('0x9d')]=_0x27e8b9['id'];if(_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xa7')]){_0x29d1dd[_0x4f06('0x9c')]=_[_0x4f06('0x31')](_0x29d1dd['where'],{'$or':_[_0x4f06('0x9e')](_0x29d1dd[_0x4f06('0x42')],function(_0x70bf48){var _0x569df3={};_0x569df3[_0x70bf48]={'$like':'%'+_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xa7')]+'%'};return _0x569df3;})});}_0x29d1dd[_0x4f06('0x9c')][_0x4f06('0xa8')]=![];if(_0x5d4037[_0x4f06('0x3d')]['id']){_0x29d1dd[_0x4f06('0x9c')]['id']={'$gt':_0x5d4037['query']['id']};}_0x29d1dd=_[_0x4f06('0x31')]({},_0x29d1dd,_0x5d4037[_0x4f06('0xa1')]);return db['ChatMessage'][_0x4f06('0x29')]({'where':_0x29d1dd[_0x4f06('0x9c')]})[_0x4f06('0x18')](function(_0x116a1d){_0xcdd8fc[_0x4f06('0x29')]=_0x116a1d;_0x29d1dd['include']=[];if(_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xa9')]){_0x29d1dd[_0x4f06('0x43')][_0x4f06('0xaa')]({'model':db[_0x4f06('0x87')],'as':'User','attributes':['id',_0x4f06('0x51'),_0x4f06('0x88')]});}if(_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xab')]){_0x29d1dd['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x29d1dd);})[_0x4f06('0x18')](function(_0x8c8b8a){_0xcdd8fc[_0x4f06('0xa2')]=_0x8c8b8a;return _0xcdd8fc;});}})[_0x4f06('0x18')](respondWithFilteredResult(_0x34dbbc,_0x29d1dd))[_0x4f06('0x45')](handleError(_0x34dbbc,null));};exports[_0x4f06('0xac')]=function(_0x655a36,_0x523e20){return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x655a36[_0x4f06('0x3c')]['id']}})['then'](handleEntityNotFound(_0x523e20,null))['then'](function(_0x51fc1a){if(_0x51fc1a){return _0x51fc1a[_0x4f06('0xad')](_0x655a36[_0x4f06('0x32')][_0x4f06('0x97')],_[_0x4f06('0x98')](_0x655a36[_0x4f06('0x32')],[_0x4f06('0x97'),'id'])||{})[_0x4f06('0xae')](function(){return db[_0x4f06('0xaf')]['findAll']({'attributes':['id',_0x4f06('0x2e'),_0x4f06('0xb0')],'where':{'id':_0x655a36[_0x4f06('0x32')][_0x4f06('0x97')]}});})['then'](function(_0x306eb1){socket[_0x4f06('0xb1')]('chatInteractionTags:save',{'id':Number(_0x655a36[_0x4f06('0x3c')]['id']),'tags':_0x306eb1||[]});return{'id':Number(_0x655a36['params']['id']),'tags':_0x306eb1||[]};});}})[_0x4f06('0x18')](respondWithResult(_0x523e20,null))[_0x4f06('0x45')](handleError(_0x523e20,null));};exports[_0x4f06('0xb2')]=function(_0xda1fcf,_0x1e9f48){return db[_0x4f06('0x35')]['find']({'where':{'id':_0xda1fcf['params']['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x1e9f48,null))['then'](function(_0x1ce628){if(_0x1ce628){return _0x1ce628['removeTags'](_0xda1fcf[_0x4f06('0x3d')]['ids']);}})[_0x4f06('0x18')](respondWithStatusCode(_0x1e9f48,null))[_0x4f06('0x45')](handleError(_0x1e9f48,null));};exports[_0x4f06('0x73')]=function(_0x234c96,_0xded0e4){var _0x92e6d4=moment()[_0x4f06('0xb3')]()[_0x4f06('0xb4')]();var _0x2368b8=path[_0x4f06('0x71')](config['root'],_0x4f06('0xb5'),'files',_0x4f06('0xb6'));var _0x3978da=path[_0x4f06('0x71')](config[_0x4f06('0x76')],'server','files',_0x4f06('0xb7'));var _0x21d630=path[_0x4f06('0x71')](_0x2368b8,_0x92e6d4);var _0x1337a0=util[_0x4f06('0x78')](_0x4f06('0xb8'),_0x234c96[_0x4f06('0x3c')]['id'],_0x92e6d4);var _0x19333c=path[_0x4f06('0x71')](_0x2368b8,_0x1337a0);var _0xfb6946=[];_0xfb6946[_0x4f06('0xaa')]({'model':db[_0x4f06('0x87')],'as':_0x4f06('0x87'),'attributes':['id','fullname'],'raw':!![]});_0xfb6946['push']({'model':db[_0x4f06('0x5f')],'as':_0x4f06('0x60'),'attributes':['id',_0x4f06('0xb9'),_0x4f06('0xba')],'raw':!![]});if(_0x234c96[_0x4f06('0x3d')][_0x4f06('0xb7')]){_0xfb6946[_0x4f06('0xaa')]({'model':db[_0x4f06('0x6e')],'as':_0x4f06('0x6e'),'raw':!![]});}var _0x388ef6=[{'model':db[_0x4f06('0x5d')],'as':_0x4f06('0x7c'),'attributes':['id','body',_0x4f06('0x8a'),_0x4f06('0x8c'),'secret',_0x4f06('0xbb')],'include':_0xfb6946}];_0x388ef6['push']({'model':db['ChatWebsite'],'as':_0x4f06('0xbc'),'attributes':['id',_0x4f06('0x2e')]});_0x388ef6['push']({'model':db[_0x4f06('0x87')],'as':_0x4f06('0xbd'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x4f06('0x44')]({'where':{'id':_0x234c96[_0x4f06('0x3c')]['id']},'include':_0x388ef6})[_0x4f06('0x18')](handleEntityNotFound(_0xded0e4,null))[_0x4f06('0x18')](function(_0x58f1db){if(_0x58f1db){var _0x48481a=_0x58f1db[_0x4f06('0xbe')]({'plain':!![]});fs[_0x4f06('0xbf')](_0x21d630);var _0x2d1978={'channel':_0x4f06('0xc0'),'account':_0x48481a[_0x4f06('0xbc')][_0x4f06('0x2e')],'agent':_0x48481a[_0x4f06('0xbd')]?_0x48481a['Owner']['fullname']:'N.A.','createdAt':moment(_0x48481a['createdAt'])['format'](_0x4f06('0xc1'))['toString'](),'closedAt':_0x48481a['closed']?moment(_0x48481a[_0x4f06('0xc2')])[_0x4f06('0x78')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x48481a[_0x4f06('0x67')],'chatInfo':{'browser':_0x48481a[_0x4f06('0xc3')],'os':_0x48481a[_0x4f06('0xc4')],'referer':_0x48481a[_0x4f06('0xc5')],'customerIp':_0x48481a[_0x4f06('0xc6')],'customerPort':_0x48481a['customerPort']?_0x48481a[_0x4f06('0xc7')]:'N.A.'},'messages':_(_0x48481a[_0x4f06('0x7c')])['tail']()[_0x4f06('0xa7')]({'secret':![]})[_0x4f06('0x9e')](function(_0x2b1a5f){if(_0x2b1a5f[_0x4f06('0x6e')]){var _0x1dbff4=path[_0x4f06('0x71')](_0x3978da,_0x2b1a5f[_0x4f06('0x6e')][_0x4f06('0x6c')]);if(fs[_0x4f06('0xc8')](_0x1dbff4)){fs[_0x4f06('0xc9')](_0x1dbff4)[_0x4f06('0xca')](fs[_0x4f06('0xcb')](path[_0x4f06('0x71')](_0x21d630,_0x2b1a5f[_0x4f06('0x6e')][_0x4f06('0x6c')])));}}return{'date':moment(_0x2b1a5f[_0x4f06('0x8a')])[_0x4f06('0x78')](_0x4f06('0xc1'))[_0x4f06('0xb4')](),'sender':_0x2b1a5f[_0x4f06('0x8c')]===_0x4f06('0x5c')?_0x2b1a5f[_0x4f06('0x87')]?_0x2b1a5f[_0x4f06('0x87')][_0x4f06('0x51')]:'System':_0x2b1a5f[_0x4f06('0x60')][_0x4f06('0xb9')]+(_0x2b1a5f[_0x4f06('0x60')]['lastName']?'\x20'+_0x2b1a5f['Contact'][_0x4f06('0xba')]:''),'body':_0x2b1a5f[_0x4f06('0x6e')]?_0x2b1a5f[_0x4f06('0x6e')]['basename']:_0x2b1a5f[_0x4f06('0x32')],'direction':_0x2b1a5f[_0x4f06('0x8c')]===_0x4f06('0x5c')?'A':'C','secret':_0x2b1a5f['secret'],'read':_0x2b1a5f[_0x4f06('0xbb')],'attachment':_0x2b1a5f[_0x4f06('0x6e')]};})[_0x4f06('0xcc')]()};return ejs[_0x4f06('0xcd')](path[_0x4f06('0x71')](config[_0x4f06('0x76')],'server',_0x4f06('0xce'),_0x4f06('0xcf')),{'interaction':_0x2d1978})[_0x4f06('0x18')](function(_0x148474){var _0x125939=path[_0x4f06('0x71')](_0x21d630,'transcript-'+_0x48481a['id']+'-'+_0x92e6d4+'.pdf');var _0x2783c6={'path':_0x125939,'channel':_0x4f06('0xc0'),'interactionId':_0x48481a['id']};return pdf[_0x4f06('0xd0')](_0x148474,_0x2783c6);})[_0x4f06('0x18')](function(){return new Promise(function(_0x2d7806,_0x402aa2){zipdir(_0x21d630,{'saveTo':_0x19333c},function(_0x55ce12,_0xda293e){if(_0x55ce12)return _0x402aa2(_0x55ce12);return _0x2d7806(_0xda293e);});})[_0x4f06('0x18')](function(){return new BPromise(function(_0x511691,_0x5b02ed){rimraf(_0x21d630,function(_0xdb9927){if(_0xdb9927)_0x5b02ed(_0xdb9927);return _0x511691();});});})[_0x4f06('0x18')](function(){return _0xded0e4[_0x4f06('0x73')](_0x19333c,_0x1337a0,function(_0x4d4b20){if(_0x4d4b20){logger['error'](_0x4f06('0xd1'),_0x4d4b20);}else{fs[_0x4f06('0xd2')](_0x19333c);}});});});}else{return _0xded0e4[_0x4f06('0x23')](0xc8);}})[_0x4f06('0x45')](handleError(_0xded0e4,null));}; \ No newline at end of file +var _0xa6e3=['./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','name','send','render','merge','body','agent','interaction','account','index','map','ChatInteraction','rawAttributes','type','key','findAll','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','find','create','describe','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','originalname','file','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','pathTranscript','Messages','User','ChatWebsiteId','%s%d','agentAlias','Visitor','ContactId','website_alias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','sort','pick','where','ChatInteractionId','filter','$gte','split','options','hasOwnProperty','nolimit','secret','includeAgent','rows','addTags','setTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','push','firstName','lastName','direction','read','Account','Owner','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','N.A.','tail','basename','createReadStream','pipe','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter'];(function(_0x3e5c2b,_0x1bf391){var _0x460f3c=function(_0x344d0a){while(--_0x344d0a){_0x3e5c2b['push'](_0x3e5c2b['shift']());}};_0x460f3c(++_0x1bf391);}(_0xa6e3,0x180));var _0x3a6e=function(_0x58e8eb,_0x2ac0c7){_0x58e8eb=_0x58e8eb-0x0;var _0x168540=_0xa6e3[_0x58e8eb];return _0x168540;};'use strict';var rimraf=require(_0x3a6e('0x0'));var zipdir=require(_0x3a6e('0x1'));var rp=require(_0x3a6e('0x2'));var moment=require(_0x3a6e('0x3'));var BPromise=require(_0x3a6e('0x4'));var Mustache=require(_0x3a6e('0x5'));var util=require(_0x3a6e('0x6'));var path=require('path');var ejs=require(_0x3a6e('0x7'));var fs=require('fs');var _=require(_0x3a6e('0x8'));var Redis=require(_0x3a6e('0x9'));var interaction=require(_0x3a6e('0xa'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x3a6e('0xb'))('api');var config=require(_0x3a6e('0xc'));var db=require(_0x3a6e('0xd'))['db'];config['redis']=_[_0x3a6e('0xe')](config[_0x3a6e('0xf')],{'host':_0x3a6e('0x10'),'port':0x18eb});var socket=require(_0x3a6e('0x11'))(new Redis(config[_0x3a6e('0xf')]));require(_0x3a6e('0x12'))[_0x3a6e('0x13')](socket);var jayson=require(_0x3a6e('0x14'));var client=jayson[_0x3a6e('0x15')][_0x3a6e('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x3a6e('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x204ab7,_0x1fb3ca,_0x397c36,_0x22f25f){return new BPromise(function(_0x2a71c2,_0x3ce009){var _0x1d57ef=_0x22f25f||client;return _0x1d57ef[_0x3a6e('0x17')](_0x204ab7,_0x397c36)[_0x3a6e('0x18')](function(_0x2db7f8){logger['info'](_0x3a6e('0x19'),_0x1fb3ca,'request\x20sent');logger[_0x3a6e('0x1a')](_0x3a6e('0x1b'),_0x1fb3ca,_0x3a6e('0x1c'),JSON[_0x3a6e('0x1d')](_0x2db7f8));if(_0x2db7f8[_0x3a6e('0x1e')]){if(_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x1f')]===0x1f4){logger[_0x3a6e('0x1e')](_0x3a6e('0x19'),_0x1fb3ca,_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);return _0x3ce009(_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);}logger[_0x3a6e('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x1fb3ca,_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);return _0x2a71c2(_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);}else{logger[_0x3a6e('0x21')](_0x3a6e('0x19'),_0x1fb3ca,_0x3a6e('0x1c'));_0x2a71c2(_0x2db7f8[_0x3a6e('0x22')][_0x3a6e('0x20')]);}})['catch'](function(_0x5526ad){logger[_0x3a6e('0x1e')](_0x3a6e('0x19'),_0x1fb3ca,_0x5526ad);_0x3ce009(_0x5526ad);});});}function respondWithStatusCode(_0xab20ae,_0x1681fc){_0x1681fc=_0x1681fc||0xcc;return function(_0x1d0f57){if(_0x1d0f57){return _0xab20ae[_0x3a6e('0x23')](_0x1681fc);}return _0xab20ae[_0x3a6e('0x24')](_0x1681fc)[_0x3a6e('0x25')]();};}function respondWithResult(_0x3e2b60,_0x4ee871){_0x4ee871=_0x4ee871||0xc8;return function(_0x5edfd5){if(_0x5edfd5){return _0x3e2b60[_0x3a6e('0x24')](_0x4ee871)[_0x3a6e('0x26')](_0x5edfd5);}};}function respondWithFilteredResult(_0x5f2e29,_0x52338a){return function(_0x379776){if(_0x379776){var _0x24653a=typeof _0x52338a[_0x3a6e('0x27')]==='undefined'&&typeof _0x52338a[_0x3a6e('0x28')]===_0x3a6e('0x29');var _0x32eef7=_0x379776['count'];var _0x3ada30=_0x24653a?0x0:_0x52338a[_0x3a6e('0x27')];var _0x47543b=_0x24653a?_0x379776[_0x3a6e('0x2a')]:_0x52338a['offset']+_0x52338a['limit'];var _0x39943d;if(_0x47543b>=_0x32eef7){_0x47543b=_0x32eef7;_0x39943d=0xc8;}else{_0x39943d=0xce;}_0x5f2e29[_0x3a6e('0x24')](_0x39943d);return _0x5f2e29['set'](_0x3a6e('0x2b'),_0x3ada30+'-'+_0x47543b+'/'+_0x32eef7)[_0x3a6e('0x26')](_0x379776);}return null;};}function saveUpdates(_0x2a3dc1){return function(_0x124556){if(_0x124556){return _0x124556[_0x3a6e('0x2c')](_0x2a3dc1)[_0x3a6e('0x18')](function(_0x1b78ff){return _0x1b78ff;});}return null;};}function removeEntity(_0x4323ea){return function(_0x5228de){if(_0x5228de){return _0x5228de[_0x3a6e('0x2d')]()['then'](function(){_0x4323ea[_0x3a6e('0x24')](0xcc)[_0x3a6e('0x25')]();});}};}function handleEntityNotFound(_0x598e17){return function(_0x4ef2c2){if(!_0x4ef2c2){_0x598e17[_0x3a6e('0x23')](0x194);}return _0x4ef2c2;};}function handleError(_0xf28a69,_0x3082b2){_0x3082b2=_0x3082b2||0x1f4;return function(_0x657a9a){logger[_0x3a6e('0x1e')](_0x657a9a['stack']);if(_0x657a9a[_0x3a6e('0x2e')]){delete _0x657a9a['name'];}_0xf28a69[_0x3a6e('0x24')](_0x3082b2)[_0x3a6e('0x2f')](_0x657a9a);};}function getMustacheRender(_0x2680ea,_0x1d7e13){return Mustache[_0x3a6e('0x30')](_0x2680ea,_[_0x3a6e('0x31')](_0x1d7e13[_0x3a6e('0x32')],{'contact':_0x1d7e13['contact'],'message':_0x1d7e13[_0x3a6e('0x20')],'agent':_0x1d7e13[_0x3a6e('0x33')],'interaction':_0x1d7e13[_0x3a6e('0x34')],'account':_0x1d7e13[_0x3a6e('0x35')]}))||'';}exports[_0x3a6e('0x36')]=function(_0x4f74c5,_0x52b5e0){var _0x2cb3fb={};var _0x2be13b=_[_0x3a6e('0x37')](db[_0x3a6e('0x38')][_0x3a6e('0x39')],function(_0x289803){return{'name':_0x289803['fieldName'],'type':_0x289803[_0x3a6e('0x3a')][_0x3a6e('0x3b')]};});_0x2cb3fb=qs['getOptions'](_0x2be13b,_0x4f74c5);return interaction[_0x3a6e('0x3c')]('chat',_0x4f74c5[_0x3a6e('0x3d')],_0x4f74c5[_0x3a6e('0x3e')],_0x2cb3fb,_0x2be13b)[_0x3a6e('0x18')](respondWithFilteredResult(_0x52b5e0,_0x2cb3fb))[_0x3a6e('0x3f')](handleError(_0x52b5e0,null));};exports[_0x3a6e('0x40')]=function(_0x1fae97,_0x4306ac){var _0x2b7090={'raw':![],'where':{'id':_0x1fae97[_0x3a6e('0x41')]['id']}},_0x512f10={};_0x512f10[_0x3a6e('0x42')]=_['keys'](db[_0x3a6e('0x38')]['rawAttributes']);_0x512f10[_0x3a6e('0x3d')]=_[_0x3a6e('0x43')](_0x1fae97[_0x3a6e('0x3d')]);_0x512f10[_0x3a6e('0x44')]=_['intersection'](_0x512f10['model'],_0x512f10[_0x3a6e('0x3d')]);_0x2b7090['attributes']=_[_0x3a6e('0x45')](_0x512f10[_0x3a6e('0x42')],qs[_0x3a6e('0x46')](_0x1fae97[_0x3a6e('0x3d')]['fields']));_0x2b7090[_0x3a6e('0x47')]=_0x2b7090[_0x3a6e('0x47')][_0x3a6e('0x48')]?_0x2b7090[_0x3a6e('0x47')]:_0x512f10[_0x3a6e('0x42')];if(_0x1fae97[_0x3a6e('0x3d')][_0x3a6e('0x49')]){_0x2b7090[_0x3a6e('0x4a')]=[{'all':!![]}];}_0x2b7090=_[_0x3a6e('0x31')]({},_0x2b7090,_0x1fae97['options']);return db[_0x3a6e('0x38')][_0x3a6e('0x4b')](_0x2b7090)[_0x3a6e('0x18')](handleEntityNotFound(_0x4306ac,null))[_0x3a6e('0x18')](respondWithResult(_0x4306ac,null))[_0x3a6e('0x3f')](handleError(_0x4306ac,null));};exports[_0x3a6e('0x4c')]=function(_0x1529ec,_0x257a96){return db[_0x3a6e('0x38')][_0x3a6e('0x4c')](_0x1529ec['body'],{})[_0x3a6e('0x18')](respondWithResult(_0x257a96,0xc9))[_0x3a6e('0x3f')](handleError(_0x257a96,null));};exports[_0x3a6e('0x2c')]=function(_0x420a02,_0xc44381){if(_0x420a02[_0x3a6e('0x32')]['id']){delete _0x420a02[_0x3a6e('0x32')]['id'];}return db['ChatInteraction'][_0x3a6e('0x4b')]({'where':{'id':_0x420a02[_0x3a6e('0x41')]['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0xc44381,null))['then'](saveUpdates(_0x420a02['body'],null))[_0x3a6e('0x18')](respondWithResult(_0xc44381,null))[_0x3a6e('0x3f')](handleError(_0xc44381,null));};exports['destroy']=function(_0x508488,_0x578b95){return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x508488[_0x3a6e('0x41')]['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0x578b95,null))[_0x3a6e('0x18')](removeEntity(_0x578b95,null))[_0x3a6e('0x3f')](handleError(_0x578b95,null));};exports['describe']=function(_0x3623cb,_0x417786){return db['ChatInteraction'][_0x3a6e('0x4d')]()['then'](respondWithResult(_0x417786,null))[_0x3a6e('0x3f')](handleError(_0x417786,null));};exports['createVidaooSession']=function(_0x402124,_0x13c206){var _0x17109d=_0x402124[_0x3a6e('0x41')]['id'];var _0x27990a;var _0x4d3a74;var _0x292f68;return db['ChatInteraction']['findOne']({'where':{'id':_0x17109d}})[_0x3a6e('0x18')](function(_0x4e8e3c){_0x27990a=_0x4e8e3c;return db[_0x3a6e('0x4e')][_0x3a6e('0x4f')]({'where':{'id':_0x4e8e3c['ChatWebsiteId']},'attributes':['id',_0x3a6e('0x50'),_0x3a6e('0x51'),_0x3a6e('0x52'),_0x3a6e('0x53'),_0x3a6e('0x54')],'raw':!![]});})[_0x3a6e('0x18')](function(_0x1ae02c){if(_0x1ae02c&&_0x1ae02c[_0x3a6e('0x50')]&&_0x1ae02c[_0x3a6e('0x51')]){_0x4d3a74=_0x1ae02c;var _0x1812c8={'interaction':{'id':_0x17109d},'agent':{'id':_0x402124[_0x3a6e('0x3e')]['id'],'name':_0x402124[_0x3a6e('0x3e')][_0x3a6e('0x2e')],'fullname':_0x402124[_0x3a6e('0x3e')]['fullname'],'email':_0x402124[_0x3a6e('0x3e')]['email']},'contact':_0x402124[_0x3a6e('0x32')]['contact'],'account':_0x402124[_0x3a6e('0x32')][_0x3a6e('0x35')]};var _0x4fea08={'rejectUnauthorized':![],'method':'POST','url':_0x3a6e('0x55'),'headers':{'X-APIKEY':_0x1ae02c[_0x3a6e('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x402124[_0x3a6e('0x3e')][_0x3a6e('0x56')]],'buttons':null,'topic':_0x4d3a74[_0x3a6e('0x52')],'note':_[_0x3a6e('0x57')](_0x4d3a74[_0x3a6e('0x53')])?null:getMustacheRender(_0x4d3a74[_0x3a6e('0x53')],_0x1812c8),'metadata':null},'redirect':_0x3a6e('0x58'),'json':!![]};try{if(!_[_0x3a6e('0x57')](_0x4d3a74[_0x3a6e('0x54')])){var _0x2f4ad1=getMustacheRender(_0x4d3a74[_0x3a6e('0x54')],_0x1812c8);var _0x5acb0c=JSON[_0x3a6e('0x59')](_0x2f4ad1);_0x4fea08[_0x3a6e('0x32')]['metadata']=_0x5acb0c;}}catch(_0x56a64a){throw new db['Sequelize']['ValidationError'](_0x3a6e('0x5a'));}return rp(_0x4fea08);}else{throw new db[(_0x3a6e('0x5b'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3a6e('0x18')](function(_0x49e77d){_0x292f68=_0x49e77d;if(_0x292f68['id']){var _0x509baf={'body':_0x292f68[_0x3a6e('0x5c')],'ChatWebsiteId':_0x4d3a74['id'],'ChatInteractionId':_0x27990a['id'],'direction':_0x3a6e('0x5d'),'UserId':_0x402124[_0x3a6e('0x3e')]['id']};return db[_0x3a6e('0x5e')]['create'](_0x509baf,{});}else{throw new db[(_0x3a6e('0x5b'))][(_0x3a6e('0x5f'))](_0x3a6e('0x60'));}})[_0x3a6e('0x18')](function(){return _0x27990a[_0x3a6e('0x61')]({'vidaooSessionId':_0x292f68['id']});})['then'](respondWithResult(_0x13c206,null))['catch'](handleError(_0x13c206,null));};exports[_0x3a6e('0x62')]=function(_0x571f1a,_0x25d86a){if(_0x571f1a['body']['id']){delete _0x571f1a[_0x3a6e('0x32')]['id'];}return db['ChatInteraction'][_0x3a6e('0x4b')]({'where':{'id':_0x571f1a[_0x3a6e('0x41')]['id']},'include':[{'model':db[_0x3a6e('0x63')],'as':_0x3a6e('0x64')}]})[_0x3a6e('0x18')](handleEntityNotFound(_0x25d86a,null))[_0x3a6e('0x18')](saveUpdates(_0x571f1a[_0x3a6e('0x32')],null))[_0x3a6e('0x18')](respondWithResult(_0x25d86a,null))['catch'](handleError(_0x25d86a,null));};exports[_0x3a6e('0x65')]=function(_0x3d2150,_0x44722f){if(_0x3d2150[_0x3a6e('0x32')]['id']){delete _0x3d2150[_0x3a6e('0x32')]['id'];}return db['ChatInteraction'][_0x3a6e('0x4b')]({'where':{'id':_0x3d2150[_0x3a6e('0x41')]['id']}})['then'](function(_0x21e0c8){if(!_0x21e0c8){logger[_0x3a6e('0x1e')](_0x3a6e('0x66'),'abandon',0x194,_0x3a6e('0x67'));_0x44722f['sendStatus'](0x194);}else{if(_0x21e0c8[_0x3a6e('0x68')]){throw new db[(_0x3a6e('0x5b'))][(_0x3a6e('0x5f'))](_0x3a6e('0x69'));}}return _0x21e0c8;})['then'](function(_0x4a6d3b){if(_0x4a6d3b){return _0x4a6d3b['update']({'closed':_0x3d2150[_0x3a6e('0x32')][_0x3a6e('0x6a')],'disposition':_0x3d2150['body'][_0x3a6e('0x6b')]})['then'](function(_0x57faad){return _0x57faad;});}})['then'](function(){return respondWithRpcPromise(_0x3a6e('0x6c'),_0x3a6e('0x65'),_0x3d2150[_0x3a6e('0x32')],client9004);})[_0x3a6e('0x18')](respondWithResult(_0x44722f,null))['catch'](handleError(_0x44722f,null));};exports['attachmentUpload']=function(_0x383f7b,_0x39e019){_0x383f7b[_0x3a6e('0x32')][_0x3a6e('0x2e')]=_0x383f7b['file'][_0x3a6e('0x6d')];_0x383f7b[_0x3a6e('0x32')]['basename']=_0x383f7b[_0x3a6e('0x6e')]['filename'];_0x383f7b[_0x3a6e('0x32')][_0x3a6e('0x3a')]=_0x383f7b[_0x3a6e('0x6e')][_0x3a6e('0x6f')];return db[_0x3a6e('0x70')][_0x3a6e('0x4c')](_0x383f7b[_0x3a6e('0x32')])[_0x3a6e('0x18')](respondWithResult(_0x39e019,0xc9))['catch'](handleError(_0x39e019,null));};exports[_0x3a6e('0x71')]=function(_0x4fefec,_0x5d44fa){return db[_0x3a6e('0x38')][_0x3a6e('0x4f')]({'where':{'id':_0x4fefec['params']['id']},'raw':!![]})[_0x3a6e('0x18')](handleEntityNotFound(_0x5d44fa,null))[_0x3a6e('0x18')](function(_0x4331ca){if(_0x4331ca){if(_0x4331ca[_0x3a6e('0x6a')]){return _0x5d44fa[_0x3a6e('0x24')](0x193)[_0x3a6e('0x26')]({'status':0x193,'message':_0x3a6e('0x72')});}return db['Attachment'][_0x3a6e('0x4f')]({'where':{'id':_0x4fefec['query']['attachId']},'raw':!![]})[_0x3a6e('0x18')](handleEntityNotFound(_0x5d44fa,null));}})[_0x3a6e('0x18')](function(_0x547d07){if(_0x547d07){var _0x36065c=_0x547d07[_0x3a6e('0x73')]!==null;var _0x5ae17b=path['join'](config[_0x3a6e('0x74')],_0x3a6e('0x75'));if(_0x36065c){_0x5ae17b=path[_0x3a6e('0x76')](_0x5ae17b,_0x3a6e('0x77'));}var _0x25ded0=path[_0x3a6e('0x76')](_0x5ae17b,_0x547d07['basename']);return _0x5d44fa[_0x3a6e('0x78')](_0x25ded0);}})['catch'](handleError(_0x5d44fa,null));};exports[_0x3a6e('0x79')]=function(_0x3b169f,_0x3b2888){var _0x28f8cf=null;var _0x59ee6a=null;var _0x3db094=null;if(_0x3b169f[_0x3a6e('0x32')]['id']){delete _0x3b169f[_0x3a6e('0x32')]['id'];}if(_0x3b169f[_0x3a6e('0x32')][_0x3a6e('0x7a')]){_0x3db094=path[_0x3a6e('0x76')](config['root'],_0x3a6e('0x7b'),util[_0x3a6e('0x7c')]('transcript-%s.txt',Date['now']()));_0x3b169f['body'][_0x3a6e('0x7d')]=_0x3db094;}return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x3b169f[_0x3a6e('0x41')]['id']},'include':[{'model':db[_0x3a6e('0x5e')],'as':_0x3a6e('0x7e'),'include':[{'model':db[_0x3a6e('0x7f')],'as':'User'}]}]})[_0x3a6e('0x18')](handleEntityNotFound(_0x3b2888,null))[_0x3a6e('0x18')](saveUpdates(_0x3b169f[_0x3a6e('0x32')],null))[_0x3a6e('0x18')](function(_0x3b043c){if(_0x3b043c){_0x28f8cf=_0x3b043c;return db['ChatWebsite']['find']({'where':{'id':_0x28f8cf[_0x3a6e('0x80')]}});}})[_0x3a6e('0x18')](function(_0x5478c0){if(_0x5478c0){_0x59ee6a=_0x5478c0;return db[_0x3a6e('0x63')][_0x3a6e('0x4b')]({'where':{'id':_0x28f8cf['ContactId']}});}})[_0x3a6e('0x18')](function(_0x19676b){if(_0x19676b){if(_0x3db094){var _0x5aed5a=null;for(var _0x2c547c=0x1;_0x2c547c<_0x28f8cf[_0x3a6e('0x7e')][_0x3a6e('0x48')];++_0x2c547c){_0x5aed5a=_0x28f8cf[_0x3a6e('0x7e')][_0x2c547c];var _0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?util[_0x3a6e('0x7c')](_0x3a6e('0x81'),_0x59ee6a[_0x3a6e('0x82')],_0x5aed5a[_0x3a6e('0x68')]):'System';var _0x392f19=_0x3b169f[_0x3a6e('0x32')]['customer']||util[_0x3a6e('0x7c')](_0x3a6e('0x81'),_0x3a6e('0x83'),_0x5aed5a[_0x3a6e('0x84')]);switch(_0x59ee6a['agentIdentifier']){case _0x3a6e('0x85'):_0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?util[_0x3a6e('0x7c')](_0x3a6e('0x81'),_0x59ee6a[_0x3a6e('0x82')],_0x5aed5a[_0x3a6e('0x68')]):_0x3a6e('0x86');break;case _0x3a6e('0x87'):_0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?_0x5aed5a[_0x3a6e('0x7f')][_0x3a6e('0x88')]||_0x5aed5a['User'][_0x3a6e('0x89')]:'System';break;case _0x3a6e('0x8a'):_0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?_0x5aed5a[_0x3a6e('0x7f')][_0x3a6e('0x89')]:_0x3a6e('0x86');break;default:_0x4295d7=_0x5aed5a['UserId']?util[_0x3a6e('0x7c')]('%s%d',_0x59ee6a[_0x3a6e('0x82')],_0x5aed5a['UserId']):_0x3a6e('0x86');}var _0x555f0d=util[_0x3a6e('0x7c')](_0x3a6e('0x8b'),moment(_0x5aed5a[_0x3a6e('0x8c')])[_0x3a6e('0x7c')](_0x3a6e('0x8d')),_0x5aed5a['direction']==='in'?_0x392f19:_0x4295d7,_0x5aed5a['body']);if(!_0x5aed5a['secret']){fs['appendFileSync'](_0x3db094,_0x555f0d);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3a6e('0x8e')],'as':_0x3a6e('0x8f'),'raw':!![],'include':[{'model':db[_0x3a6e('0x90')],'as':_0x3a6e('0x90'),'raw':!![]}]}]});}}})[_0x3a6e('0x18')](function(_0x252b97){if(!_0x252b97||!_0x252b97[_0x3a6e('0x8f')]||!_0x3b169f[_0x3a6e('0x32')])return _0x28f8cf;var _0x27957a=_0x252b97[_0x3a6e('0x91')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x27957a,'message':{'from':util[_0x3a6e('0x7c')](_0x3a6e('0x92'),_0x252b97[_0x3a6e('0x2e')],_0x252b97[_0x3a6e('0x56')]||_0x252b97[_0x3a6e('0x8f')][_0x3a6e('0x3e')]),'to':_0x3b169f['body'][_0x3a6e('0x7a')],'subject':'Mail\x20Transcript','text':util['format'](_0x3a6e('0x93'),_0x3b169f[_0x3a6e('0x32')]['mailTranscript']),'attachments':[{'path':_0x3db094}]}})[_0x3a6e('0x18')](function(){return _0x28f8cf;})[_0x3a6e('0x3f')](function(_0x13d46d){logger[_0x3a6e('0x1e')](_0x13d46d);});})['then'](respondWithStatusCode(_0x3b2888,0xc8))['catch'](handleError(_0x3b2888,null));};exports[_0x3a6e('0x94')]=function(_0x23f555,_0xe214b4){return db[_0x3a6e('0x5e')][_0x3a6e('0x4b')]({'where':{'id':_0x23f555[_0x3a6e('0x41')]['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0xe214b4,null))[_0x3a6e('0x18')](function(_0x2b2112){if(_0x2b2112){return _0x2b2112['addMessage'](_0x23f555['body'][_0x3a6e('0x95')],_['omit'](_0x23f555[_0x3a6e('0x32')],['ids','id'])||{});}})[_0x3a6e('0x18')](respondWithResult(_0xe214b4,null))['catch'](handleError(_0xe214b4,null));};exports[_0x3a6e('0x96')]=function(_0x252c8a,_0x40ef33){var _0x7605fc={'raw':![],'where':{}};var _0x363409={};var _0x2f5591={'count':0x0,'rows':[]};return db[_0x3a6e('0x38')][_0x3a6e('0x4f')]({'where':{'id':_0x252c8a['params']['id']}})['then'](handleEntityNotFound(_0x40ef33,null))[_0x3a6e('0x18')](function(_0x2d5cdf){if(_0x2d5cdf){_0x363409['model']=_['keys'](db[_0x3a6e('0x5e')][_0x3a6e('0x39')]);_0x363409[_0x3a6e('0x3d')]=_['keys'](_0x252c8a[_0x3a6e('0x3d')]);_0x363409[_0x3a6e('0x44')]=_['intersection'](_0x363409['model'],_0x363409[_0x3a6e('0x3d')]);_0x7605fc[_0x3a6e('0x47')]=_[_0x3a6e('0x45')](_0x363409[_0x3a6e('0x42')],qs[_0x3a6e('0x46')](_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x46')]));_0x7605fc[_0x3a6e('0x47')]=_0x7605fc['attributes'][_0x3a6e('0x48')]?_0x7605fc[_0x3a6e('0x47')]:_0x363409[_0x3a6e('0x42')];if(!_0x252c8a[_0x3a6e('0x3d')]['hasOwnProperty']('nolimit')){_0x7605fc[_0x3a6e('0x28')]=qs[_0x3a6e('0x28')](_0x252c8a[_0x3a6e('0x3d')]['limit']);_0x7605fc[_0x3a6e('0x27')]=qs[_0x3a6e('0x27')](_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x27')]);}_0x7605fc['order']=qs[_0x3a6e('0x97')](_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x97')]);_0x7605fc['where']=qs['filters'](_[_0x3a6e('0x98')](_0x252c8a['query'],_0x363409[_0x3a6e('0x44')]));_0x7605fc[_0x3a6e('0x99')][_0x3a6e('0x9a')]=_0x2d5cdf['id'];if(_0x252c8a['query'][_0x3a6e('0x9b')]){_0x7605fc[_0x3a6e('0x99')]=_[_0x3a6e('0x31')](_0x7605fc['where'],{'$or':_[_0x3a6e('0x37')](_0x7605fc['attributes'],function(_0x413bb9){var _0x4c8e4a={};_0x4c8e4a[_0x413bb9]={'$like':'%'+_0x252c8a['query'][_0x3a6e('0x9b')]+'%'};return _0x4c8e4a;})});}if(_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x9c')]){var _0x186bf4=_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x9c')][_0x3a6e('0x9d')](',');var _0x18d87a={};_0x18d87a[_0x186bf4[0x0]]={'$gte':moment(_0x186bf4[0x1])[_0x3a6e('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7605fc[_0x3a6e('0x99')]=_['merge'](_0x7605fc['where'],_0x18d87a);}_0x7605fc=_[_0x3a6e('0x31')]({},_0x7605fc,_0x252c8a[_0x3a6e('0x9e')]);return db[_0x3a6e('0x5e')][_0x3a6e('0x2a')]({'where':_0x7605fc[_0x3a6e('0x99')]})[_0x3a6e('0x18')](function(_0x40fc4b){_0x2f5591[_0x3a6e('0x2a')]=_0x40fc4b;if(_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x49')]){_0x7605fc['include']=[{'all':!![]}];}return db[_0x3a6e('0x5e')][_0x3a6e('0x3c')](_0x7605fc);})['then'](function(_0x4b092a){_0x2f5591['rows']=_0x4b092a;return _0x2f5591;});}})[_0x3a6e('0x18')](respondWithFilteredResult(_0x40ef33,_0x7605fc))[_0x3a6e('0x3f')](handleError(_0x40ef33,null));};exports['getMyMessages']=function(_0x44dbe3,_0x256487){var _0x4c1b30={'where':{}},_0x226988={},_0x462caf={'count':0x0,'rows':[]};return db[_0x3a6e('0x38')][_0x3a6e('0x4f')]({'where':{'id':_0x44dbe3['params']['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0x256487,null))[_0x3a6e('0x18')](function(_0x19f1ee){if(_0x19f1ee){_0x226988['model']=_[_0x3a6e('0x43')](db['ChatMessage']['rawAttributes']);_0x226988[_0x3a6e('0x3d')]=_['keys'](_0x44dbe3[_0x3a6e('0x3d')]);_0x226988[_0x3a6e('0x44')]=_[_0x3a6e('0x45')](_0x226988[_0x3a6e('0x42')],_0x226988[_0x3a6e('0x3d')]);_0x4c1b30[_0x3a6e('0x47')]=_[_0x3a6e('0x45')](_0x226988[_0x3a6e('0x42')],qs[_0x3a6e('0x46')](_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x46')]));_0x4c1b30['attributes']=_0x4c1b30[_0x3a6e('0x47')]['length']?_0x4c1b30[_0x3a6e('0x47')]:_0x226988['model'];if(!_0x44dbe3['query'][_0x3a6e('0x9f')](_0x3a6e('0xa0'))){_0x4c1b30[_0x3a6e('0x28')]=qs['limit'](_0x44dbe3['query']['limit']);_0x4c1b30[_0x3a6e('0x27')]=qs['offset'](_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x27')]);}_0x4c1b30['order']=qs[_0x3a6e('0x97')](_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x97')]);_0x4c1b30[_0x3a6e('0x99')]=qs[_0x3a6e('0x44')](_[_0x3a6e('0x98')](_0x44dbe3['query'],_0x226988[_0x3a6e('0x44')]));_0x4c1b30['where'][_0x3a6e('0x9a')]=_0x19f1ee['id'];if(_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x9b')]){_0x4c1b30[_0x3a6e('0x99')]=_[_0x3a6e('0x31')](_0x4c1b30[_0x3a6e('0x99')],{'$or':_[_0x3a6e('0x37')](_0x4c1b30[_0x3a6e('0x47')],function(_0x17d6e0){var _0x413375={};_0x413375[_0x17d6e0]={'$like':'%'+_0x44dbe3['query']['filter']+'%'};return _0x413375;})});}_0x4c1b30['where'][_0x3a6e('0xa1')]=![];if(_0x44dbe3[_0x3a6e('0x3d')]['id']){_0x4c1b30[_0x3a6e('0x99')]['id']={'$gt':_0x44dbe3['query']['id']};}_0x4c1b30=_[_0x3a6e('0x31')]({},_0x4c1b30,_0x44dbe3[_0x3a6e('0x9e')]);return db[_0x3a6e('0x5e')]['count']({'where':_0x4c1b30[_0x3a6e('0x99')]})['then'](function(_0x3bb1b2){_0x462caf[_0x3a6e('0x2a')]=_0x3bb1b2;_0x4c1b30[_0x3a6e('0x4a')]=[];if(_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0xa2')]){_0x4c1b30[_0x3a6e('0x4a')]['push']({'model':db[_0x3a6e('0x7f')],'as':'User','attributes':['id',_0x3a6e('0x89'),_0x3a6e('0x88')]});}if(_0x44dbe3[_0x3a6e('0x3d')]['includeAll']){_0x4c1b30[_0x3a6e('0x4a')]=[{'all':!![]}];}return db[_0x3a6e('0x5e')]['findAll'](_0x4c1b30);})['then'](function(_0x1e0cd8){_0x462caf[_0x3a6e('0xa3')]=_0x1e0cd8;return _0x462caf;});}})[_0x3a6e('0x18')](respondWithFilteredResult(_0x256487,_0x4c1b30))[_0x3a6e('0x3f')](handleError(_0x256487,null));};exports[_0x3a6e('0xa4')]=function(_0x1c7977,_0x1978f9){return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x1c7977[_0x3a6e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1978f9,null))['then'](function(_0x4f48c3){if(_0x4f48c3){return _0x4f48c3[_0x3a6e('0xa5')](_0x1c7977[_0x3a6e('0x32')]['ids'],_[_0x3a6e('0xa6')](_0x1c7977['body'],[_0x3a6e('0x95'),'id'])||{})[_0x3a6e('0xa7')](function(){return db['Tag']['findAll']({'attributes':['id',_0x3a6e('0x2e'),_0x3a6e('0xa8')],'where':{'id':_0x1c7977[_0x3a6e('0x32')][_0x3a6e('0x95')]}});})[_0x3a6e('0x18')](function(_0xf9c8ab){socket[_0x3a6e('0xa9')](_0x3a6e('0xaa'),{'id':Number(_0x1c7977['params']['id']),'tags':_0xf9c8ab||[]});return{'id':Number(_0x1c7977[_0x3a6e('0x41')]['id']),'tags':_0xf9c8ab||[]};});}})['then'](respondWithResult(_0x1978f9,null))[_0x3a6e('0x3f')](handleError(_0x1978f9,null));};exports['removeTags']=function(_0x2cae05,_0x580ca3){return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x2cae05[_0x3a6e('0x41')]['id']}})['then'](handleEntityNotFound(_0x580ca3,null))[_0x3a6e('0x18')](function(_0x3b12fd){if(_0x3b12fd){return _0x3b12fd[_0x3a6e('0xab')](_0x2cae05[_0x3a6e('0x3d')][_0x3a6e('0x95')]);}})['then'](respondWithStatusCode(_0x580ca3,null))[_0x3a6e('0x3f')](handleError(_0x580ca3,null));};exports[_0x3a6e('0x78')]=function(_0x3ea852,_0x115822){var _0x1124d7=moment()[_0x3a6e('0xac')]()[_0x3a6e('0xad')]();var _0x247c7b=path[_0x3a6e('0x76')](config[_0x3a6e('0x74')],_0x3a6e('0xae'),_0x3a6e('0xaf'),_0x3a6e('0xb0'));var _0x56efb2=path[_0x3a6e('0x76')](config[_0x3a6e('0x74')],_0x3a6e('0xae'),_0x3a6e('0xaf'),_0x3a6e('0xb1'));var _0x30cefc=path[_0x3a6e('0x76')](_0x247c7b,_0x1124d7);var _0x29da7b=util[_0x3a6e('0x7c')]('transcript-%d-%s.zip',_0x3ea852['params']['id'],_0x1124d7);var _0x4f9b40=path[_0x3a6e('0x76')](_0x247c7b,_0x29da7b);var _0xd4f9ee=[];_0xd4f9ee[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x7f')],'as':_0x3a6e('0x7f'),'attributes':['id',_0x3a6e('0x89')],'raw':!![]});_0xd4f9ee[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x63')],'as':_0x3a6e('0x64'),'attributes':['id',_0x3a6e('0xb3'),_0x3a6e('0xb4')],'raw':!![]});if(_0x3ea852[_0x3a6e('0x3d')][_0x3a6e('0xb1')]){_0xd4f9ee[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x70')],'as':_0x3a6e('0x70'),'raw':!![]});}var _0xfc4f00=[{'model':db[_0x3a6e('0x5e')],'as':'Messages','attributes':['id',_0x3a6e('0x32'),_0x3a6e('0x8c'),_0x3a6e('0xb5'),_0x3a6e('0xa1'),_0x3a6e('0xb6')],'include':_0xd4f9ee}];_0xfc4f00[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x4e')],'as':_0x3a6e('0xb7'),'attributes':['id',_0x3a6e('0x2e')]});_0xfc4f00[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x7f')],'as':_0x3a6e('0xb8'),'attributes':['id',_0x3a6e('0x89')]});return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x3ea852['params']['id']},'include':_0xfc4f00})[_0x3a6e('0x18')](handleEntityNotFound(_0x115822,null))['then'](function(_0x3f0e72){if(_0x3f0e72){var _0x3ea3cc=_0x3f0e72['get']({'plain':!![]});fs[_0x3a6e('0xb9')](_0x30cefc);var _0x42d244={'channel':_0x3a6e('0xba'),'account':_0x3ea3cc[_0x3a6e('0xb7')][_0x3a6e('0x2e')],'agent':_0x3ea3cc['Owner']?_0x3ea3cc[_0x3a6e('0xb8')][_0x3a6e('0x89')]:'N.A.','createdAt':moment(_0x3ea3cc['createdAt'])[_0x3a6e('0x7c')](_0x3a6e('0xbb'))[_0x3a6e('0xad')](),'closedAt':_0x3ea3cc[_0x3a6e('0x6a')]?moment(_0x3ea3cc['closedAt'])[_0x3a6e('0x7c')](_0x3a6e('0xbb'))[_0x3a6e('0xad')]():'','disposition':_0x3ea3cc[_0x3a6e('0x6b')],'chatInfo':{'browser':_0x3ea3cc[_0x3a6e('0xbc')],'os':_0x3ea3cc[_0x3a6e('0xbd')],'referer':_0x3ea3cc[_0x3a6e('0xbe')],'customerIp':_0x3ea3cc['customerIp'],'customerPort':_0x3ea3cc['customerPort']?_0x3ea3cc['customerPort']:_0x3a6e('0xbf')},'messages':_(_0x3ea3cc[_0x3a6e('0x7e')])[_0x3a6e('0xc0')]()[_0x3a6e('0x9b')]({'secret':![]})[_0x3a6e('0x37')](function(_0x5d33a3){if(_0x5d33a3[_0x3a6e('0x70')]){var _0x1ea433=path[_0x3a6e('0x76')](_0x56efb2,_0x5d33a3['Attachment'][_0x3a6e('0xc1')]);if(fs['existsSync'](_0x1ea433)){fs[_0x3a6e('0xc2')](_0x1ea433)[_0x3a6e('0xc3')](fs['createWriteStream'](path[_0x3a6e('0x76')](_0x30cefc,_0x5d33a3[_0x3a6e('0x70')][_0x3a6e('0xc1')])));}}return{'date':moment(_0x5d33a3[_0x3a6e('0x8c')])[_0x3a6e('0x7c')](_0x3a6e('0xbb'))[_0x3a6e('0xad')](),'sender':_0x5d33a3[_0x3a6e('0xb5')]==='out'?_0x5d33a3[_0x3a6e('0x7f')]?_0x5d33a3[_0x3a6e('0x7f')][_0x3a6e('0x89')]:'System':_0x5d33a3[_0x3a6e('0x64')][_0x3a6e('0xb3')]+(_0x5d33a3[_0x3a6e('0x64')]['lastName']?'\x20'+_0x5d33a3['Contact'][_0x3a6e('0xb4')]:''),'body':_0x5d33a3[_0x3a6e('0x70')]?_0x5d33a3[_0x3a6e('0x70')][_0x3a6e('0xc1')]:_0x5d33a3[_0x3a6e('0x32')],'direction':_0x5d33a3[_0x3a6e('0xb5')]===_0x3a6e('0x5d')?'A':'C','secret':_0x5d33a3['secret'],'read':_0x5d33a3['read'],'attachment':_0x5d33a3[_0x3a6e('0x70')]};})['value']()};return ejs['renderFile'](path[_0x3a6e('0x76')](config[_0x3a6e('0x74')],'server','views',_0x3a6e('0xc4')),{'interaction':_0x42d244})['then'](function(_0x311759){var _0x5cb74d=path[_0x3a6e('0x76')](_0x30cefc,_0x3a6e('0xc5')+_0x3ea3cc['id']+'-'+_0x1124d7+_0x3a6e('0xc6'));var _0x1c5c33={'path':_0x5cb74d,'channel':'Chat','interactionId':_0x3ea3cc['id']};return pdf[_0x3a6e('0xc7')](_0x311759,_0x1c5c33);})['then'](function(){return new Promise(function(_0x30e9e4,_0x40dfa6){zipdir(_0x30cefc,{'saveTo':_0x4f9b40},function(_0xd5ae38,_0x11cc7c){if(_0xd5ae38)return _0x40dfa6(_0xd5ae38);return _0x30e9e4(_0x11cc7c);});})[_0x3a6e('0x18')](function(){return new BPromise(function(_0x20d592,_0x366d68){rimraf(_0x30cefc,function(_0x65be1c){if(_0x65be1c)_0x366d68(_0x65be1c);return _0x20d592();});});})[_0x3a6e('0x18')](function(){return _0x115822[_0x3a6e('0x78')](_0x4f9b40,_0x29da7b,function(_0x51ac86){if(_0x51ac86){logger[_0x3a6e('0x1e')]('err',_0x51ac86);}else{fs[_0x3a6e('0xc8')](_0x4f9b40);}});});});}else{return _0x115822['sendStatus'](0xc8);}})[_0x3a6e('0x3f')](handleError(_0x115822,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 69eef7a..5198f6c 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 _0x8080=['save','remove','getUsers','then','setDataValue','map','findAll','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8080,0x175));var _0x0808=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x8080[_0x4ea69d];return _0x5318e0;};'use strict';var EventEmitter=require(_0x0808('0x0'));var ChatInteraction=require(_0x0808('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x0808('0x1'))['db'][_0x0808('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0808('0x3')](0x0);var events={'afterCreate':_0x0808('0x4'),'afterUpdate':'update','afterDestroy':_0x0808('0x5')};function emitEvent(_0x377249){return function(_0x5ded0c,_0x19cd2c,_0xc8f2cc){_0x5ded0c[_0x0808('0x6')]({'attributes':['id'],'raw':!![]})[_0x0808('0x7')](function(_0x5b7ee2){_0x5ded0c[_0x0808('0x8')]('Users',_0x5b7ee2[_0x0808('0x9')](function(_0x3fa7c4){return{'id':_0x3fa7c4['id']};}));return ChatMessage[_0x0808('0xa')]({'where':{'ChatInteractionId':_0x5ded0c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0808('0x7')](function(_0x20776c){_0x5ded0c['setDataValue']('unreadMessages',_0x20776c['length']);ChatInteractionEvents[_0x0808('0xb')](_0x377249+':'+_0x5ded0c['id'],_0x5ded0c);ChatInteractionEvents[_0x0808('0xb')](_0x377249,_0x5ded0c);_0xc8f2cc(null);})['catch'](_0xc8f2cc(null));};}for(var e in events){if(events[_0x0808('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x6335=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6335,0x18f));var _0x5633=function(_0x178995,_0x3ffcb3){_0x178995=_0x178995-0x0;var _0x5ecec3=_0x6335[_0x178995];return _0x5ecec3;};'use strict';var EventEmitter=require(_0x5633('0x0'));var ChatInteraction=require(_0x5633('0x1'))['db'][_0x5633('0x2')];var ChatMessage=require(_0x5633('0x1'))['db'][_0x5633('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5633('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5633('0x5'),'afterDestroy':_0x5633('0x6')};function emitEvent(_0x43089d){return function(_0x56b5f5,_0x4c2647,_0x4de5ee){_0x56b5f5[_0x5633('0x7')]({'attributes':['id'],'raw':!![]})[_0x5633('0x8')](function(_0x5d0b34){_0x56b5f5[_0x5633('0x9')](_0x5633('0xa'),_0x5d0b34[_0x5633('0xb')](function(_0xdaa62f){return{'id':_0xdaa62f['id']};}));return ChatMessage[_0x5633('0xc')]({'where':{'ChatInteractionId':_0x56b5f5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d924e){_0x56b5f5['setDataValue'](_0x5633('0xd'),_0x4d924e[_0x5633('0xe')]);ChatInteractionEvents[_0x5633('0xf')](_0x43089d+':'+_0x56b5f5['id'],_0x56b5f5);ChatInteractionEvents[_0x5633('0xf')](_0x43089d,_0x56b5f5);_0x4de5ee(null);})[_0x5633('0x10')](_0x4de5ee(null));};}for(var e in events){if(events[_0x5633('0x11')](e)){var event=events[e];ChatInteraction[_0x5633('0x12')](e,emitEvent(event));}}module[_0x5633('0x13')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e223bef..bf34371 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 _0x80d2=['moment','path','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0xb6f924,_0x2f7346){var _0x5e26a9=function(_0x87cf2f){while(--_0x87cf2f){_0xb6f924['push'](_0xb6f924['shift']());}};_0x5e26a9(++_0x2f7346);}(_0x80d2,0xb4));var _0x280d=function(_0x447e2f,_0x48d0e5){_0x447e2f=_0x447e2f-0x0;var _0x254527=_0x80d2[_0x447e2f];return _0x254527;};'use strict';var _=require('lodash');var util=require(_0x280d('0x0'));var logger=require('../../config/logger')(_0x280d('0x1'));var moment=require(_0x280d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x280d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x280d('0x4'));module[_0x280d('0x5')]=function(_0x5348fb,_0x50972d){return _0x5348fb[_0x280d('0x6')]('ChatInteraction',attributes,{'tableName':_0x280d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57c648,_0x5851be,_0x36ef54){if(_0x57c648[_0x280d('0x8')](_0x280d('0x9'))){_0x57c648[_0x280d('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x36ef54(null,_0x57c648);}},'charset':_0x280d('0xb'),'collate':_0x280d('0xc')});}; \ No newline at end of file +var _0x8ee5=['path','rimraf','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x417643,_0x48b479){var _0x1caddc=function(_0x4f4bed){while(--_0x4f4bed){_0x417643['push'](_0x417643['shift']());}};_0x1caddc(++_0x48b479);}(_0x8ee5,0x11a));var _0x58ee=function(_0x59701d,_0xe1b1ad){_0x59701d=_0x59701d-0x0;var _0x1265c0=_0x8ee5[_0x59701d];return _0x1265c0;};'use strict';var _=require(_0x58ee('0x0'));var util=require(_0x58ee('0x1'));var logger=require(_0x58ee('0x2'))(_0x58ee('0x3'));var moment=require(_0x58ee('0x4'));var BPromise=require(_0x58ee('0x5'));var rp=require(_0x58ee('0x6'));var fs=require('fs');var path=require(_0x58ee('0x7'));var rimraf=require(_0x58ee('0x8'));var config=require('../../config/environment');var attributes=require(_0x58ee('0x9'));module['exports']=function(_0x3f9c79,_0x4cd4a7){return _0x3f9c79[_0x58ee('0xa')](_0x58ee('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1619fc,_0x5c5d97,_0x4a69ca){if(_0x1619fc[_0x58ee('0xc')](_0x58ee('0xd'))){_0x1619fc[_0x58ee('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4a69ca(null,_0x1619fc);}},'charset':_0x58ee('0xf'),'collate':_0x58ee('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ff84b09..9567300 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 _0x5ba4=['omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids'];(function(_0x3e2080,_0x567e79){var _0x314d16=function(_0x5c3e3e){while(--_0x5c3e3e){_0x3e2080['push'](_0x3e2080['shift']());}};_0x314d16(++_0x567e79);}(_0x5ba4,0x163));var _0x45ba=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x5ba4[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x45ba('0x0'));var BPromise=require(_0x45ba('0x1'));var rs=require(_0x45ba('0x2'));var fs=require('fs');var Redis=require(_0x45ba('0x3'));var db=require(_0x45ba('0x4'))['db'];var utils=require(_0x45ba('0x5'));var logger=require(_0x45ba('0x6'))('rpc');var config=require(_0x45ba('0x7'));var jayson=require(_0x45ba('0x8'));var client=jayson[_0x45ba('0x9')][_0x45ba('0xa')]({'port':0x232a});config['redis']=_[_0x45ba('0xb')](config[_0x45ba('0xc')],{'host':_0x45ba('0xd'),'port':0x18eb});var socket=require(_0x45ba('0xe'))(new Redis(config[_0x45ba('0xc')]));require(_0x45ba('0xf'))[_0x45ba('0x10')](socket);function respondWithRpcPromise(_0x176ae8,_0x482a5c,_0x495d49){return new BPromise(function(_0xe8aeb0,_0x181dbb){return client['request'](_0x176ae8,_0x495d49)[_0x45ba('0x11')](function(_0x116b06){logger[_0x45ba('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x482a5c,_0x45ba('0x13'));logger[_0x45ba('0x14')](_0x45ba('0x15'),_0x482a5c,_0x45ba('0x13'),JSON['stringify'](_0x116b06));if(_0x116b06[_0x45ba('0x16')]){if(_0x116b06[_0x45ba('0x16')][_0x45ba('0x17')]===0x1f4){logger[_0x45ba('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x482a5c,_0x116b06[_0x45ba('0x16')][_0x45ba('0x18')]);return _0x181dbb(_0x116b06[_0x45ba('0x16')][_0x45ba('0x18')]);}logger['error'](_0x45ba('0x19'),_0x482a5c,_0x116b06[_0x45ba('0x16')][_0x45ba('0x18')]);return _0xe8aeb0(_0x116b06[_0x45ba('0x16')]['message']);}else{logger[_0x45ba('0x12')](_0x45ba('0x19'),_0x482a5c,_0x45ba('0x13'));_0xe8aeb0(_0x116b06[_0x45ba('0x1a')][_0x45ba('0x18')]);}})[_0x45ba('0x1b')](function(_0x2375b5){logger[_0x45ba('0x16')](_0x45ba('0x19'),_0x482a5c,_0x2375b5);_0x181dbb(_0x2375b5);});});}exports[_0x45ba('0x1c')]=function(_0x10520c){var _0x525732=this;return new Promise(function(_0x386ccf,_0x1676df){return db[_0x45ba('0x1d')]['update'](_0x10520c[_0x45ba('0x1e')],{'raw':_0x10520c[_0x45ba('0x1f')]?_0x10520c['options'][_0x45ba('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10520c['options']?_0x10520c[_0x45ba('0x1f')][_0x45ba('0x21')]||null:null,'attributes':_0x10520c[_0x45ba('0x1f')]?_0x10520c[_0x45ba('0x1f')][_0x45ba('0x22')]||null:null,'limit':_0x10520c[_0x45ba('0x1f')]?_0x10520c['options'][_0x45ba('0x23')]||null:null})[_0x45ba('0x11')](function(_0x33f086){logger[_0x45ba('0x12')]('UpdateChatInteraction',_0x10520c);logger[_0x45ba('0x14')]('UpdateChatInteraction',_0x10520c,JSON[_0x45ba('0x24')](_0x33f086));_0x386ccf(_0x33f086);})[_0x45ba('0x1b')](function(_0x5901d9){logger['error'](_0x45ba('0x1c'),_0x5901d9[_0x45ba('0x18')],_0x10520c);_0x1676df(_0x525732[_0x45ba('0x16')](0x1f4,_0x5901d9[_0x45ba('0x18')]));});});};exports[_0x45ba('0x25')]=function(_0x34e395){return new Promise(function(_0x1ddd63,_0x4d2d64){return db[_0x45ba('0x1d')][_0x45ba('0x26')]({'where':_0x34e395[_0x45ba('0x1f')]?_0x34e395[_0x45ba('0x1f')]['where']||null:null})[_0x45ba('0x11')](function(_0x336f5e){if(_0x336f5e){return _0x336f5e[_0x45ba('0x27')](_0x34e395[_0x45ba('0x1e')][_0x45ba('0x28')],_[_0x45ba('0x29')](_0x34e395[_0x45ba('0x1e')],[_0x45ba('0x28'),'id'])||{});}})[_0x45ba('0x2a')](function(_0x3695c2){logger['info'](_0x45ba('0x2b'),_0x34e395);logger[_0x45ba('0x14')](_0x45ba('0x2b'),_0x34e395,JSON[_0x45ba('0x24')](_0x3695c2));_0x1ddd63(_0x3695c2);})[_0x45ba('0x1b')](function(_0x1c5408){logger['error']('AddTags',_0x1c5408['message'],_0x34e395);_0x4d2d64(_this[_0x45ba('0x16')](0x1f4,_0x1c5408[_0x45ba('0x18')]));});});}; \ No newline at end of file +var _0x63c1=['redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','UpdateChatInteraction','ChatInteraction','update','options','raw','where','stringify','catch','AddTagsToChatInteraction','find','addTags','body','ids','spread','AddTags','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x21098f,_0x3e5fd1){var _0x2cf331=function(_0x485ce8){while(--_0x485ce8){_0x21098f['push'](_0x21098f['shift']());}};_0x2cf331(++_0x3e5fd1);}(_0x63c1,0x187));var _0x163c=function(_0x14977a,_0x38700a){_0x14977a=_0x14977a-0x0;var _0x59902d=_0x63c1[_0x14977a];return _0x59902d;};'use strict';var _=require(_0x163c('0x0'));var util=require('util');var moment=require(_0x163c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x163c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x163c('0x3'));var logger=require('../../config/logger')(_0x163c('0x4'));var config=require(_0x163c('0x5'));var jayson=require(_0x163c('0x6'));var client=jayson['client'][_0x163c('0x7')]({'port':0x232a});config['redis']=_[_0x163c('0x8')](config[_0x163c('0x9')],{'host':_0x163c('0xa'),'port':0x18eb});var socket=require(_0x163c('0xb'))(new Redis(config[_0x163c('0x9')]));require(_0x163c('0xc'))[_0x163c('0xd')](socket);function respondWithRpcPromise(_0x3bdfe1,_0x5dec2a,_0x4bc7cd){return new BPromise(function(_0x242c20,_0x258d6c){return client[_0x163c('0xe')](_0x3bdfe1,_0x4bc7cd)[_0x163c('0xf')](function(_0x5a70db){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5dec2a,_0x163c('0x10'));logger[_0x163c('0x11')](_0x163c('0x12'),_0x5dec2a,_0x163c('0x10'),JSON['stringify'](_0x5a70db));if(_0x5a70db[_0x163c('0x13')]){if(_0x5a70db['error'][_0x163c('0x14')]===0x1f4){logger['error'](_0x163c('0x15'),_0x5dec2a,_0x5a70db[_0x163c('0x13')][_0x163c('0x16')]);return _0x258d6c(_0x5a70db['error'][_0x163c('0x16')]);}logger[_0x163c('0x13')](_0x163c('0x15'),_0x5dec2a,_0x5a70db[_0x163c('0x13')][_0x163c('0x16')]);return _0x242c20(_0x5a70db[_0x163c('0x13')]['message']);}else{logger[_0x163c('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x5dec2a,'request\x20sent');_0x242c20(_0x5a70db[_0x163c('0x18')]['message']);}})['catch'](function(_0x4f4068){logger[_0x163c('0x13')](_0x163c('0x15'),_0x5dec2a,_0x4f4068);_0x258d6c(_0x4f4068);});});}exports[_0x163c('0x19')]=function(_0x4f7a81){var _0x47cb53=this;return new Promise(function(_0x94f970,_0x48ec8f){return db[_0x163c('0x1a')][_0x163c('0x1b')](_0x4f7a81['body'],{'raw':_0x4f7a81[_0x163c('0x1c')]?_0x4f7a81[_0x163c('0x1c')][_0x163c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7a81[_0x163c('0x1c')]?_0x4f7a81[_0x163c('0x1c')][_0x163c('0x1e')]||null:null,'attributes':_0x4f7a81['options']?_0x4f7a81['options']['attributes']||null:null,'limit':_0x4f7a81[_0x163c('0x1c')]?_0x4f7a81[_0x163c('0x1c')]['limit']||null:null})[_0x163c('0xf')](function(_0x5b7cfc){logger[_0x163c('0x17')]('UpdateChatInteraction',_0x4f7a81);logger[_0x163c('0x11')](_0x163c('0x19'),_0x4f7a81,JSON[_0x163c('0x1f')](_0x5b7cfc));_0x94f970(_0x5b7cfc);})[_0x163c('0x20')](function(_0x4c5ab0){logger[_0x163c('0x13')](_0x163c('0x19'),_0x4c5ab0[_0x163c('0x16')],_0x4f7a81);_0x48ec8f(_0x47cb53[_0x163c('0x13')](0x1f4,_0x4c5ab0[_0x163c('0x16')]));});});};exports[_0x163c('0x21')]=function(_0x59a552){return new Promise(function(_0x85de7f,_0xf48ae4){return db[_0x163c('0x1a')][_0x163c('0x22')]({'where':_0x59a552[_0x163c('0x1c')]?_0x59a552[_0x163c('0x1c')]['where']||null:null})[_0x163c('0xf')](function(_0x3c8d3e){if(_0x3c8d3e){return _0x3c8d3e[_0x163c('0x23')](_0x59a552[_0x163c('0x24')][_0x163c('0x25')],_['omit'](_0x59a552[_0x163c('0x24')],[_0x163c('0x25'),'id'])||{});}})[_0x163c('0x26')](function(_0x3a0130){logger[_0x163c('0x17')](_0x163c('0x27'),_0x59a552);logger[_0x163c('0x11')](_0x163c('0x27'),_0x59a552,JSON['stringify'](_0x3a0130));_0x85de7f(_0x3a0130);})[_0x163c('0x20')](function(_0x34d644){logger[_0x163c('0x13')]('AddTags',_0x34d644[_0x163c('0x16')],_0x59a552);_0xf48ae4(_this[_0x163c('0x13')](0x1f4,_0x34d644[_0x163c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 594b8de..b9d7c2f 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 _0x620b=['length','update','emit','removeListener','register'];(function(_0x1d2b4b,_0x1b8974){var _0x54d25f=function(_0x1008e2){while(--_0x1008e2){_0x1d2b4b['push'](_0x1d2b4b['shift']());}};_0x54d25f(++_0x1b8974);}(_0x620b,0x1c3));var _0xb620=function(_0x3c87d6,_0x594412){_0x3c87d6=_0x3c87d6-0x0;var _0x1cc644=_0x620b[_0x3c87d6];return _0x1cc644;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xb620('0x0')];function createListener(_0x45ff8c,_0x9eb788){return function(_0xb3ec6c){_0x9eb788[_0xb620('0x1')](_0x45ff8c,_0xb3ec6c);};}function removeListener(_0x18d566,_0xa30b3f){return function(){ChatInteractionEvents[_0xb620('0x2')](_0x18d566,_0xa30b3f);};}exports[_0xb620('0x3')]=function(_0x4c73ba){for(var _0x1a2332=0x0,_0x3819f8=events[_0xb620('0x4')];_0x1a2332<_0x3819f8;_0x1a2332++){var _0x4074ad=events[_0x1a2332];var _0x5153a9=createListener('chatInteraction:'+_0x4074ad,_0x4c73ba);ChatInteractionEvents['on'](_0x4074ad,_0x5153a9);}}; \ No newline at end of file +var _0x6ed3=['save','update','register','./chatInteraction.events'];(function(_0x6fa261,_0x596489){var _0x2938d3=function(_0x51fd60){while(--_0x51fd60){_0x6fa261['push'](_0x6fa261['shift']());}};_0x2938d3(++_0x596489);}(_0x6ed3,0xbb));var _0x36ed=function(_0x2bfa88,_0xc64230){_0x2bfa88=_0x2bfa88-0x0;var _0x2e7039=_0x6ed3[_0x2bfa88];return _0x2e7039;};'use strict';var ChatInteractionEvents=require(_0x36ed('0x0'));var events=[_0x36ed('0x1'),'remove',_0x36ed('0x2')];function createListener(_0x3341a6,_0x11367){return function(_0x4d8531){_0x11367['emit'](_0x3341a6,_0x4d8531);};}function removeListener(_0x18ae74,_0x12ec5a){return function(){ChatInteractionEvents['removeListener'](_0x18ae74,_0x12ec5a);};}exports[_0x36ed('0x3')]=function(_0x13d7f2){for(var _0x1171b9=0x0,_0x3096d5=events['length'];_0x1171b9<_0x3096d5;_0x1171b9++){var _0x50b9a9=events[_0x1171b9];var _0x57748b=createListener('chatInteraction:'+_0x50b9a9,_0x13d7f2);ChatInteractionEvents['on'](_0x50b9a9,_0x57748b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b65f7ba..56d9c3b 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 _0x8f83=['/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','tracked','chat','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages'];(function(_0x27f3b3,_0x456572){var _0x4890b6=function(_0x50eb5b){while(--_0x50eb5b){_0x27f3b3['push'](_0x27f3b3['shift']());}};_0x4890b6(++_0x456572);}(_0x8f83,0xe8));var _0x38f8=function(_0x3f746f,_0xf5194d){_0x3f746f=_0x3f746f-0x0;var _0x40746b=_0x8f83[_0x3f746f];return _0x40746b;};'use strict';var multer=require(_0x38f8('0x0'));var util=require(_0x38f8('0x1'));var path=require(_0x38f8('0x2'));var timeout=require(_0x38f8('0x3'));var express=require(_0x38f8('0x4'));var router=express[_0x38f8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x38f8('0x6'));var interaction=require(_0x38f8('0x7'));var config=require(_0x38f8('0x8'));var controller=require('./chatInteraction.controller');router[_0x38f8('0x9')]('/',auth[_0x38f8('0xa')](),controller['index']);router[_0x38f8('0x9')]('/describe',auth[_0x38f8('0xa')](),controller[_0x38f8('0xb')]);router[_0x38f8('0x9')](_0x38f8('0xc'),auth[_0x38f8('0xd')](),controller[_0x38f8('0xe')]);router[_0x38f8('0x9')](_0x38f8('0xf'),auth[_0x38f8('0xd')](),controller['attachmentDownload']);router[_0x38f8('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x38f8('0x10')]);router[_0x38f8('0x9')](_0x38f8('0x11'),auth[_0x38f8('0xd')](),controller['getMyMessages']);router['get'](_0x38f8('0x12'),auth[_0x38f8('0xa')](),controller[_0x38f8('0x13')]);router[_0x38f8('0x14')]('/',auth[_0x38f8('0xa')](),controller[_0x38f8('0x15')]);router['post'](_0x38f8('0x16'),auth['isAuthenticated'](),controller[_0x38f8('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42e0b6,_0x1e3cd6,_0x48f4ec){_0x48f4ec(null,path['join'](config[_0x38f8('0x18')],'server/files/attachments/'));},'filename':function(_0x5403b8,_0x3d3f69,_0x2708f5){_0x2708f5(null,util[_0x38f8('0x19')](_0x38f8('0x1a'),Date[_0x38f8('0x1b')](),_0x3d3f69[_0x38f8('0x1c')][_0x38f8('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x38f8('0x1e'),upload[_0x38f8('0x1f')](_0x38f8('0x20')),controller[_0x38f8('0x21')]);router[_0x38f8('0x14')](_0x38f8('0x22'),auth[_0x38f8('0xd')](),controller['addMessage']);router[_0x38f8('0x14')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x38f8('0x23')](_0x38f8('0x24'),_0x38f8('0x25')),controller['addTags']);router[_0x38f8('0x26')](_0x38f8('0xc'),auth[_0x38f8('0xa')](),interaction[_0x38f8('0x23')](_0x38f8('0x24'),'chatinteraction:update'),controller[_0x38f8('0x27')]);router[_0x38f8('0x26')](_0x38f8('0x28'),controller[_0x38f8('0x29')]);router[_0x38f8('0x26')](_0x38f8('0x2a'),auth[_0x38f8('0xd')](),controller[_0x38f8('0x2b')]);router[_0x38f8('0x26')](_0x38f8('0x2c'),controller[_0x38f8('0x2d')]);router[_0x38f8('0x2e')]('/:id',auth[_0x38f8('0xa')](),interaction[_0x38f8('0x23')](_0x38f8('0x24'),_0x38f8('0x2f')),controller[_0x38f8('0x30')]);router[_0x38f8('0x2e')]('/:id/tags',auth[_0x38f8('0xa')](),controller['removeTags']);module[_0x38f8('0x31')]=router; \ No newline at end of file +var _0x5e38=['/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','removeTags','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5e38,0x172));var _0x85e3=function(_0x51d32d,_0x4a87fa){_0x51d32d=_0x51d32d-0x0;var _0x5d422b=_0x5e38[_0x51d32d];return _0x5d422b;};'use strict';var multer=require(_0x85e3('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85e3('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x85e3('0x2'));var interaction=require(_0x85e3('0x3'));var config=require(_0x85e3('0x4'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x85e3('0x5')](),controller['index']);router[_0x85e3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x85e3('0x7')]);router['get'](_0x85e3('0x8'),auth[_0x85e3('0x9')](),controller[_0x85e3('0xa')]);router[_0x85e3('0x6')](_0x85e3('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x85e3('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x85e3('0xd')]);router['get'](_0x85e3('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x85e3('0xf')]);router['get']('/:id/download',auth[_0x85e3('0x5')](),controller[_0x85e3('0x10')]);router[_0x85e3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x85e3('0x11')](_0x85e3('0x12'),auth[_0x85e3('0x5')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x85e3('0x13')]({'destination':function(_0xd3399e,_0x2d8054,_0x5928fc){_0x5928fc(null,path[_0x85e3('0x14')](config[_0x85e3('0x15')],_0x85e3('0x16')));},'filename':function(_0x36f9a0,_0x5ce865,_0x5593c9){_0x5593c9(null,util[_0x85e3('0x17')](_0x85e3('0x18'),Date['now'](),_0x5ce865[_0x85e3('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x85e3('0x11')](_0x85e3('0x1a'),upload[_0x85e3('0x1b')](_0x85e3('0x1c')),controller[_0x85e3('0x1d')]);router['post'](_0x85e3('0x1e'),auth[_0x85e3('0x9')](),controller[_0x85e3('0x1f')]);router['post'](_0x85e3('0x20'),auth[_0x85e3('0x5')](),interaction[_0x85e3('0x21')](_0x85e3('0x22'),_0x85e3('0x23')),controller[_0x85e3('0x24')]);router['put'](_0x85e3('0x8'),auth[_0x85e3('0x5')](),interaction[_0x85e3('0x21')]('chat',_0x85e3('0x25')),controller['update']);router[_0x85e3('0x26')](_0x85e3('0x27'),controller[_0x85e3('0x28')]);router[_0x85e3('0x26')](_0x85e3('0x29'),auth[_0x85e3('0x9')](),controller[_0x85e3('0x2a')]);router['put'](_0x85e3('0x2b'),controller['close']);router[_0x85e3('0x2c')](_0x85e3('0x8'),auth[_0x85e3('0x5')](),interaction[_0x85e3('0x21')](_0x85e3('0x22'),'chatinteraction:destroy'),controller[_0x85e3('0x2d')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x85e3('0x2e')]);module[_0x85e3('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index cc92ad4..2b75f10 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 _0x2a35=['sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x271697,_0x6897d6){var _0x426093=function(_0x4d4dfe){while(--_0x4d4dfe){_0x271697['push'](_0x271697['shift']());}};_0x426093(++_0x6897d6);}(_0x2a35,0x15e));var _0x52a3=function(_0x3f4424,_0x227813){_0x3f4424=_0x3f4424-0x0;var _0x13da17=_0x2a35[_0x3f4424];return _0x13da17;};'use strict';var Sequelize=require(_0x52a3('0x0'));module[_0x52a3('0x1')]={'body':{'type':Sequelize[_0x52a3('0x2')](_0x52a3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x52a3('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7b54=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x56f8de,_0x1bee78){var _0x5df982=function(_0x547402){while(--_0x547402){_0x56f8de['push'](_0x56f8de['shift']());}};_0x5df982(++_0x1bee78);}(_0x7b54,0xa8));var _0x47b5=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x7b54[_0x6a0266];return _0x309e00;};'use strict';var Sequelize=require(_0x47b5('0x0'));module[_0x47b5('0x1')]={'body':{'type':Sequelize[_0x47b5('0x2')](_0x47b5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x47b5('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x47b5('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 62984f2..a82bfb8 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 _0xb50e=['VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','index','map','ChatInternalMessage','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','user','fullname','role','internal','lastLoginAt','-online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb50e,0x1c0));var _0xeb50=function(_0x58e389,_0x3ab426){_0x58e389=_0x58e389-0x0;var _0x1437df=_0xb50e[_0x58e389];return _0x1437df;};'use strict';var emlformat=require(_0xeb50('0x0'));var rimraf=require(_0xeb50('0x1'));var zipdir=require(_0xeb50('0x2'));var jsonpatch=require(_0xeb50('0x3'));var rp=require(_0xeb50('0x4'));var moment=require(_0xeb50('0x5'));var BPromise=require(_0xeb50('0x6'));var Mustache=require(_0xeb50('0x7'));var util=require(_0xeb50('0x8'));var path=require(_0xeb50('0x9'));var sox=require(_0xeb50('0xa'));var csv=require(_0xeb50('0xb'));var ejs=require(_0xeb50('0xc'));var fs=require('fs');var fs_extra=require(_0xeb50('0xd'));var _=require(_0xeb50('0xe'));var squel=require(_0xeb50('0xf'));var crypto=require(_0xeb50('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb50('0x11'));var Papa=require('papaparse');var Redis=require(_0xeb50('0x12'));var authService=require(_0xeb50('0x13'));var qs=require(_0xeb50('0x14'));var as=require(_0xeb50('0x15'));var hardwareService=require(_0xeb50('0x16'));var logger=require(_0xeb50('0x17'))(_0xeb50('0x18'));var utils=require(_0xeb50('0x19'));var config=require(_0xeb50('0x1a'));var licenseUtil=require(_0xeb50('0x1b'));var db=require(_0xeb50('0x1c'))['db'];config[_0xeb50('0x1d')]=_[_0xeb50('0x1e')](config[_0xeb50('0x1d')],{'host':_0xeb50('0x1f'),'port':0x18eb});var socket=require(_0xeb50('0x20'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xeb50('0x21')](socket);function respondWithStatusCode(_0x44746b,_0x3a26a1){_0x3a26a1=_0x3a26a1||0xcc;return function(_0x5ca221){if(_0x5ca221){return _0x44746b[_0xeb50('0x22')](_0x3a26a1);}return _0x44746b[_0xeb50('0x23')](_0x3a26a1)['end']();};}function respondWithResult(_0x79a31e,_0x4f761f){_0x4f761f=_0x4f761f||0xc8;return function(_0x559c1a){if(_0x559c1a){return _0x79a31e[_0xeb50('0x23')](_0x4f761f)[_0xeb50('0x24')](_0x559c1a);}};}function respondWithFilteredResult(_0x3809a1,_0x152080){return function(_0x3238e3){if(_0x3238e3){var _0x259e82=typeof _0x152080[_0xeb50('0x25')]==='undefined'&&typeof _0x152080['limit']==='undefined';var _0x11b546=_0x3238e3['count'];var _0x124282=_0x259e82?0x0:_0x152080[_0xeb50('0x25')];var _0x2f64de=_0x259e82?_0x3238e3[_0xeb50('0x26')]:_0x152080[_0xeb50('0x25')]+_0x152080[_0xeb50('0x27')];var _0x3f6651;if(_0x2f64de>=_0x11b546){_0x2f64de=_0x11b546;_0x3f6651=0xc8;}else{_0x3f6651=0xce;}_0x3809a1[_0xeb50('0x23')](_0x3f6651);return _0x3809a1[_0xeb50('0x28')](_0xeb50('0x29'),_0x124282+'-'+_0x2f64de+'/'+_0x11b546)['json'](_0x3238e3);}return null;};}function patchUpdates(_0x3b6860){return function(_0x5c9809){try{jsonpatch[_0xeb50('0x2a')](_0x5c9809,_0x3b6860,!![]);}catch(_0x4da4e4){return BPromise['reject'](_0x4da4e4);}return _0x5c9809[_0xeb50('0x2b')]();};}function saveUpdates(_0x2ec3f8,_0x3cabc2){return function(_0x352dd1){if(_0x352dd1){return _0x352dd1['update'](_0x2ec3f8)[_0xeb50('0x2c')](function(_0x59313b){return _0x59313b;});}return null;};}function removeEntity(_0x301aeb,_0x2747ab){return function(_0x4d652e){if(_0x4d652e){return _0x4d652e[_0xeb50('0x2d')]()[_0xeb50('0x2c')](function(){_0x301aeb[_0xeb50('0x23')](0xcc)[_0xeb50('0x2e')]();});}};}function handleEntityNotFound(_0x19d288,_0x6c8cfc){return function(_0xb9b4db){if(!_0xb9b4db){_0x19d288[_0xeb50('0x22')](0x194);}return _0xb9b4db;};}function handleError(_0x3a7630,_0x252990){_0x252990=_0x252990||0x1f4;return function(_0x254949){logger[_0xeb50('0x2f')](_0x254949[_0xeb50('0x30')]);if(_0x254949[_0xeb50('0x31')]){delete _0x254949[_0xeb50('0x31')];}_0x3a7630[_0xeb50('0x23')](_0x252990)['send'](_0x254949);};}exports[_0xeb50('0x32')]=function(_0x51e92b,_0x22479a){var _0xb20ec3={},_0x2ce348={},_0xf1019c={'count':0x0,'rows':[]};var _0x512acb=_[_0xeb50('0x33')](db[_0xeb50('0x34')]['rawAttributes'],function(_0x1268b6){return{'name':_0x1268b6['fieldName'],'type':_0x1268b6['type'][_0xeb50('0x35')]};});_0x2ce348[_0xeb50('0x36')]=_[_0xeb50('0x33')](_0x512acb,_0xeb50('0x31'));_0x2ce348[_0xeb50('0x37')]=_[_0xeb50('0x38')](_0x51e92b[_0xeb50('0x37')]);_0x2ce348[_0xeb50('0x39')]=_[_0xeb50('0x3a')](_0x2ce348['model'],_0x2ce348[_0xeb50('0x37')]);_0xb20ec3[_0xeb50('0x3b')]=_[_0xeb50('0x3a')](_0x2ce348['model'],qs['fields'](_0x51e92b[_0xeb50('0x37')][_0xeb50('0x3c')]));_0xb20ec3[_0xeb50('0x3b')]=_0xb20ec3[_0xeb50('0x3b')]['length']?_0xb20ec3[_0xeb50('0x3b')]:_0x2ce348[_0xeb50('0x36')];if(!_0x51e92b['query'][_0xeb50('0x3d')](_0xeb50('0x3e'))){_0xb20ec3[_0xeb50('0x27')]=qs[_0xeb50('0x27')](_0x51e92b['query'][_0xeb50('0x27')]);_0xb20ec3[_0xeb50('0x25')]=qs[_0xeb50('0x25')](_0x51e92b['query'][_0xeb50('0x25')]);}_0xb20ec3[_0xeb50('0x3f')]=qs[_0xeb50('0x40')](_0x51e92b[_0xeb50('0x37')]['sort']);_0xb20ec3['where']=qs[_0xeb50('0x39')](_[_0xeb50('0x41')](_0x51e92b[_0xeb50('0x37')],_0x2ce348[_0xeb50('0x39')]),_0x512acb);if(_0x51e92b[_0xeb50('0x37')][_0xeb50('0x42')]){_0xb20ec3[_0xeb50('0x43')]=_[_0xeb50('0x44')](_0xb20ec3['where'],{'$or':_[_0xeb50('0x33')](_0x512acb,function(_0x1514e7){if(_0x1514e7[_0xeb50('0x45')]!=='VIRTUAL'){var _0x562a67={};_0x562a67[_0x1514e7[_0xeb50('0x31')]]={'$like':'%'+_0x51e92b[_0xeb50('0x37')]['filter']+'%'};return _0x562a67;}})});}_0xb20ec3=_[_0xeb50('0x44')]({},_0xb20ec3,_0x51e92b[_0xeb50('0x46')]);var _0x4e8349={'where':_0xb20ec3[_0xeb50('0x43')]};return db[_0xeb50('0x34')]['count'](_0x4e8349)[_0xeb50('0x2c')](function(_0x1ad1dc){_0xf1019c[_0xeb50('0x26')]=_0x1ad1dc;if(_0x51e92b[_0xeb50('0x37')][_0xeb50('0x47')]){_0xb20ec3['include']=[{'all':!![]}];}return db[_0xeb50('0x34')][_0xeb50('0x48')](_0xb20ec3);})[_0xeb50('0x2c')](function(_0x294dcf){_0xf1019c[_0xeb50('0x49')]=_0x294dcf;return _0xf1019c;})[_0xeb50('0x2c')](respondWithFilteredResult(_0x22479a,_0xb20ec3))[_0xeb50('0x4a')](handleError(_0x22479a,null));};exports[_0xeb50('0x4b')]=function(_0x5205af,_0x5c237a){var _0x17cdd0={'raw':!![],'where':{'id':_0x5205af[_0xeb50('0x4c')]['id']}},_0x2d06b1={};_0x2d06b1[_0xeb50('0x36')]=_['keys'](db['ChatInternalMessage'][_0xeb50('0x4d')]);_0x2d06b1[_0xeb50('0x37')]=_['keys'](_0x5205af[_0xeb50('0x37')]);_0x2d06b1['filters']=_[_0xeb50('0x3a')](_0x2d06b1['model'],_0x2d06b1[_0xeb50('0x37')]);_0x17cdd0[_0xeb50('0x3b')]=_[_0xeb50('0x3a')](_0x2d06b1[_0xeb50('0x36')],qs[_0xeb50('0x3c')](_0x5205af[_0xeb50('0x37')][_0xeb50('0x3c')]));_0x17cdd0[_0xeb50('0x3b')]=_0x17cdd0[_0xeb50('0x3b')][_0xeb50('0x4e')]?_0x17cdd0['attributes']:_0x2d06b1[_0xeb50('0x36')];if(_0x5205af[_0xeb50('0x37')]['includeAll']){_0x17cdd0[_0xeb50('0x4f')]=[{'all':!![]}];}_0x17cdd0=_[_0xeb50('0x44')]({},_0x17cdd0,_0x5205af[_0xeb50('0x46')]);return db[_0xeb50('0x34')][_0xeb50('0x50')](_0x17cdd0)[_0xeb50('0x2c')](handleEntityNotFound(_0x5c237a,null))[_0xeb50('0x2c')](respondWithResult(_0x5c237a,null))['catch'](handleError(_0x5c237a,null));};exports[_0xeb50('0x51')]=function(_0x3f45af,_0x3b7841){return db[_0xeb50('0x34')]['create'](_0x3f45af[_0xeb50('0x52')],{})[_0xeb50('0x2c')](respondWithResult(_0x3b7841,0xc9))[_0xeb50('0x4a')](handleError(_0x3b7841,null));};exports['update']=function(_0x17d4b4,_0x2f7576){if(_0x17d4b4['body']['id']){delete _0x17d4b4[_0xeb50('0x52')]['id'];}return db[_0xeb50('0x34')][_0xeb50('0x50')]({'where':{'id':_0x17d4b4['params']['id']}})[_0xeb50('0x2c')](handleEntityNotFound(_0x2f7576,null))[_0xeb50('0x2c')](saveUpdates(_0x17d4b4['body'],null))[_0xeb50('0x2c')](respondWithResult(_0x2f7576,null))[_0xeb50('0x4a')](handleError(_0x2f7576,null));};exports[_0xeb50('0x2d')]=function(_0x4d96c4,_0x55f8c1){return db[_0xeb50('0x34')][_0xeb50('0x50')]({'where':{'id':_0x4d96c4['params']['id']}})[_0xeb50('0x2c')](handleEntityNotFound(_0x55f8c1,null))[_0xeb50('0x2c')](removeEntity(_0x55f8c1,null))[_0xeb50('0x4a')](handleError(_0x55f8c1,null));};exports[_0xeb50('0x53')]=function(_0x61e720,_0x2b1675){return db['ChatInternalMessage'][_0xeb50('0x53')]()[_0xeb50('0x2c')](respondWithResult(_0x2b1675,null))[_0xeb50('0x4a')](handleError(_0x2b1675,null));};function wrapUser(_0x14ca3b){return function(_0x341d17){var _0x37cae6=_0x14ca3b[_0xeb50('0x54')]({'plain':!![]});_0x37cae6[_0xeb50('0x55')]=[];if(_0x341d17){_0x37cae6[_0xeb50('0x56')]=_0x341d17[_0xeb50('0x57')];_0x37cae6[_0xeb50('0x58')]=_0x341d17;}else{_0x37cae6[_0xeb50('0x56')]=moment(0x0)[_0xeb50('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x37cae6[_0xeb50('0x58')]={};}return _0x37cae6;};}exports['getUsers']=function(_0xa69f1c,_0x1e3c58,_0x477e00){var _0x1b4319=[];return db[_0xeb50('0x5a')][_0xeb50('0x48')]({'where':{'role':['agent','admin',_0xeb50('0x5b')]},'attributes':['id',_0xeb50('0x5c'),_0xeb50('0x31'),_0xeb50('0x5d'),'userpic',_0xeb50('0x5e'),'online',_0xeb50('0x5f'),'allowmessenger','showWebBar'],'order':qs[_0xeb50('0x40')](_0xeb50('0x60')),'include':[{'model':db[_0xeb50('0x61')],'as':'VoiceQueues','attributes':['id',_0xeb50('0x31'),_0xeb50('0x45')],'through':{'attributes':[]}}]})[_0xeb50('0x2c')](function(_0x1f1a67){if(_0x1f1a67){var _0x15058b=_0xa69f1c[_0xeb50('0x5b')]['get']({'plain':!![]});if(!_0x15058b)throw new Error(_0xeb50('0x62'));if(_0x15058b[_0xeb50('0x5d')]===_0xeb50('0x5b')){return db[_0xeb50('0x63')][_0xeb50('0x50')]({'where':{'name':'Agents','userProfileId':_0x15058b[_0xeb50('0x64')]},'raw':!![]})[_0xeb50('0x2c')](function(_0x5f07cd){if(_0x5f07cd){if(_0x5f07cd['autoAssociation']===0x0){return db[_0xeb50('0x65')][_0xeb50('0x48')]({'where':{'sectionId':_0x5f07cd['id']},'raw':!![]})[_0xeb50('0x2c')](function(_0xc84453){var _0x56baba=[];if(_['isEmpty'](_0xc84453)){_0x56baba=_[_0xeb50('0x42')](_0x1f1a67,function(_0x532cd7){if(_0x532cd7['role']!==_0xeb50('0x66')){return _0x532cd7;}});return _0x56baba;}else{for(var _0xe0688b=0x0;_0xe0688b<_0x1f1a67[_0xeb50('0x4e')];_0xe0688b++){var _0x12258d=_0x1f1a67[_0xe0688b];if(_0x12258d[_0xeb50('0x5d')]===_0xeb50('0x66')){var _0x3a0e8b=_[_0xeb50('0x50')](_0xc84453,function(_0x49c9da){return _0x49c9da[_0xeb50('0x67')]===_0x12258d['id'];});if(_0x3a0e8b)_0x56baba[_0xeb50('0x68')](_0x12258d);}else{_0x56baba['push'](_0x12258d);}}return _0x56baba;}});}else{return _0x1f1a67;}}else{var _0x26a14e=_[_0xeb50('0x42')](_0x1f1a67,function(_0x5654d3){if(_0x5654d3[_0xeb50('0x5d')]!==_0xeb50('0x66')){return _0x5654d3;}});return _0x26a14e;}});}else{return _0x1f1a67;}}})[_0xeb50('0x2c')](function(_0x5827c0){var _0x4d8da7=[];if(_0x5827c0){_0x1b4319=_0x5827c0;for(var _0x4e8904=0x0;_0x4e8904<_0x5827c0[_0xeb50('0x4e')];_0x4e8904+=0x1){_0x1b4319[_0x4e8904][_0xeb50('0x55')]=[];_0x4d8da7[_0xeb50('0x68')](db[_0xeb50('0x34')][_0xeb50('0x50')]({'where':{'FromId':[_0xa69f1c[_0xeb50('0x5b')]['id'],_0x5827c0[_0x4e8904]['id']],'ToId':[_0xa69f1c[_0xeb50('0x5b')]['id'],_0x5827c0[_0x4e8904]['id']],'ChatGroupId':null},'attributes':['id',_0xeb50('0x57'),_0xeb50('0x69'),_0xeb50('0x6a'),_0xeb50('0x6b'),'body'],'order':qs['sort'](_0xeb50('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5827c0[_0x4e8904])));}return BPromise['all'](_0x4d8da7);}return[];})[_0xeb50('0x2c')](function(_0x55d430){return{'rows':_0x55d430,'count':_0x55d430[_0xeb50('0x4e')]};})[_0xeb50('0x2c')](respondWithResult(_0x1e3c58,null))[_0xeb50('0x4a')](handleError(_0x1e3c58,null));}; \ No newline at end of file +var _0x197d=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','destroy','describe','get','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','push','messages','FromId','ToId','all','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','limit','count','set','apply','save','update','then','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x589da7,_0x165fac){var _0x809a94=function(_0x109c24){while(--_0x109c24){_0x589da7['push'](_0x589da7['shift']());}};_0x809a94(++_0x165fac);}(_0x197d,0x107));var _0xd197=function(_0x30a550,_0x1e4a6e){_0x30a550=_0x30a550-0x0;var _0x494912=_0x197d[_0x30a550];return _0x494912;};'use strict';var emlformat=require(_0xd197('0x0'));var rimraf=require(_0xd197('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd197('0x2'));var rp=require('request-promise');var moment=require(_0xd197('0x3'));var BPromise=require(_0xd197('0x4'));var Mustache=require('mustache');var util=require(_0xd197('0x5'));var path=require(_0xd197('0x6'));var sox=require(_0xd197('0x7'));var csv=require(_0xd197('0x8'));var ejs=require(_0xd197('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd197('0xa'));var crypto=require(_0xd197('0xb'));var jsforce=require(_0xd197('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd197('0x8'));var querystring=require('querystring');var Papa=require(_0xd197('0xd'));var Redis=require(_0xd197('0xe'));var authService=require(_0xd197('0xf'));var qs=require(_0xd197('0x10'));var as=require(_0xd197('0x11'));var hardwareService=require(_0xd197('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd197('0x13'));var config=require(_0xd197('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd197('0x15'))['db'];config[_0xd197('0x16')]=_[_0xd197('0x17')](config[_0xd197('0x16')],{'host':_0xd197('0x18'),'port':0x18eb});var socket=require(_0xd197('0x19'))(new Redis(config[_0xd197('0x16')]));require(_0xd197('0x1a'))[_0xd197('0x1b')](socket);function respondWithStatusCode(_0x29892f,_0x43216b){_0x43216b=_0x43216b||0xcc;return function(_0x22568a){if(_0x22568a){return _0x29892f[_0xd197('0x1c')](_0x43216b);}return _0x29892f['status'](_0x43216b)[_0xd197('0x1d')]();};}function respondWithResult(_0x25f83b,_0x65d231){_0x65d231=_0x65d231||0xc8;return function(_0x90a76f){if(_0x90a76f){return _0x25f83b[_0xd197('0x1e')](_0x65d231)[_0xd197('0x1f')](_0x90a76f);}};}function respondWithFilteredResult(_0x26a1a1,_0x318c26){return function(_0x3698d3){if(_0x3698d3){var _0x2a9541=typeof _0x318c26[_0xd197('0x20')]==='undefined'&&typeof _0x318c26[_0xd197('0x21')]==='undefined';var _0x2d8e81=_0x3698d3['count'];var _0x22ac55=_0x2a9541?0x0:_0x318c26[_0xd197('0x20')];var _0x590261=_0x2a9541?_0x3698d3[_0xd197('0x22')]:_0x318c26[_0xd197('0x20')]+_0x318c26['limit'];var _0x5f5329;if(_0x590261>=_0x2d8e81){_0x590261=_0x2d8e81;_0x5f5329=0xc8;}else{_0x5f5329=0xce;}_0x26a1a1['status'](_0x5f5329);return _0x26a1a1[_0xd197('0x23')]('Content-Range',_0x22ac55+'-'+_0x590261+'/'+_0x2d8e81)[_0xd197('0x1f')](_0x3698d3);}return null;};}function patchUpdates(_0x275871){return function(_0x40c563){try{jsonpatch[_0xd197('0x24')](_0x40c563,_0x275871,!![]);}catch(_0x39d270){return BPromise['reject'](_0x39d270);}return _0x40c563[_0xd197('0x25')]();};}function saveUpdates(_0x4fb6f4,_0x3d66ce){return function(_0x1ac68b){if(_0x1ac68b){return _0x1ac68b[_0xd197('0x26')](_0x4fb6f4)[_0xd197('0x27')](function(_0xeba565){return _0xeba565;});}return null;};}function removeEntity(_0x264f70,_0x34ece9){return function(_0x1bcb9e){if(_0x1bcb9e){return _0x1bcb9e['destroy']()[_0xd197('0x27')](function(){_0x264f70[_0xd197('0x1e')](0xcc)[_0xd197('0x1d')]();});}};}function handleEntityNotFound(_0x14bef8,_0x569eb3){return function(_0x5beba8){if(!_0x5beba8){_0x14bef8['sendStatus'](0x194);}return _0x5beba8;};}function handleError(_0x36f0ba,_0x1c84a0){_0x1c84a0=_0x1c84a0||0x1f4;return function(_0x155bf0){logger[_0xd197('0x28')](_0x155bf0[_0xd197('0x29')]);if(_0x155bf0[_0xd197('0x2a')]){delete _0x155bf0['name'];}_0x36f0ba[_0xd197('0x1e')](_0x1c84a0)['send'](_0x155bf0);};}exports[_0xd197('0x2b')]=function(_0x52059e,_0x1a25b3){var _0x57884e={},_0x30aebd={},_0x430f13={'count':0x0,'rows':[]};var _0x1d5bb5=_[_0xd197('0x2c')](db['ChatInternalMessage'][_0xd197('0x2d')],function(_0x50bea6){return{'name':_0x50bea6['fieldName'],'type':_0x50bea6['type'][_0xd197('0x2e')]};});_0x30aebd[_0xd197('0x2f')]=_[_0xd197('0x2c')](_0x1d5bb5,_0xd197('0x2a'));_0x30aebd[_0xd197('0x30')]=_[_0xd197('0x31')](_0x52059e[_0xd197('0x30')]);_0x30aebd[_0xd197('0x32')]=_['intersection'](_0x30aebd[_0xd197('0x2f')],_0x30aebd['query']);_0x57884e[_0xd197('0x33')]=_[_0xd197('0x34')](_0x30aebd[_0xd197('0x2f')],qs[_0xd197('0x35')](_0x52059e[_0xd197('0x30')][_0xd197('0x35')]));_0x57884e[_0xd197('0x33')]=_0x57884e[_0xd197('0x33')][_0xd197('0x36')]?_0x57884e[_0xd197('0x33')]:_0x30aebd['model'];if(!_0x52059e[_0xd197('0x30')][_0xd197('0x37')](_0xd197('0x38'))){_0x57884e[_0xd197('0x21')]=qs[_0xd197('0x21')](_0x52059e[_0xd197('0x30')][_0xd197('0x21')]);_0x57884e[_0xd197('0x20')]=qs[_0xd197('0x20')](_0x52059e[_0xd197('0x30')][_0xd197('0x20')]);}_0x57884e[_0xd197('0x39')]=qs[_0xd197('0x3a')](_0x52059e['query']['sort']);_0x57884e[_0xd197('0x3b')]=qs[_0xd197('0x32')](_['pick'](_0x52059e[_0xd197('0x30')],_0x30aebd['filters']),_0x1d5bb5);if(_0x52059e[_0xd197('0x30')][_0xd197('0x3c')]){_0x57884e[_0xd197('0x3b')]=_[_0xd197('0x3d')](_0x57884e[_0xd197('0x3b')],{'$or':_['map'](_0x1d5bb5,function(_0x2ede94){if(_0x2ede94['type']!==_0xd197('0x3e')){var _0x1d0d15={};_0x1d0d15[_0x2ede94[_0xd197('0x2a')]]={'$like':'%'+_0x52059e[_0xd197('0x30')][_0xd197('0x3c')]+'%'};return _0x1d0d15;}})});}_0x57884e=_['merge']({},_0x57884e,_0x52059e['options']);var _0x3789f5={'where':_0x57884e['where']};return db[_0xd197('0x3f')][_0xd197('0x22')](_0x3789f5)[_0xd197('0x27')](function(_0x377486){_0x430f13[_0xd197('0x22')]=_0x377486;if(_0x52059e[_0xd197('0x30')][_0xd197('0x40')]){_0x57884e[_0xd197('0x41')]=[{'all':!![]}];}return db[_0xd197('0x3f')][_0xd197('0x42')](_0x57884e);})['then'](function(_0x112479){_0x430f13[_0xd197('0x43')]=_0x112479;return _0x430f13;})[_0xd197('0x27')](respondWithFilteredResult(_0x1a25b3,_0x57884e))[_0xd197('0x44')](handleError(_0x1a25b3,null));};exports[_0xd197('0x45')]=function(_0x5a7d05,_0xd5cdf7){var _0x3b2cc4={'raw':!![],'where':{'id':_0x5a7d05['params']['id']}},_0x12ea6c={};_0x12ea6c[_0xd197('0x2f')]=_['keys'](db[_0xd197('0x3f')][_0xd197('0x2d')]);_0x12ea6c[_0xd197('0x30')]=_[_0xd197('0x31')](_0x5a7d05[_0xd197('0x30')]);_0x12ea6c[_0xd197('0x32')]=_[_0xd197('0x34')](_0x12ea6c[_0xd197('0x2f')],_0x12ea6c[_0xd197('0x30')]);_0x3b2cc4['attributes']=_[_0xd197('0x34')](_0x12ea6c[_0xd197('0x2f')],qs[_0xd197('0x35')](_0x5a7d05[_0xd197('0x30')]['fields']));_0x3b2cc4[_0xd197('0x33')]=_0x3b2cc4['attributes'][_0xd197('0x36')]?_0x3b2cc4['attributes']:_0x12ea6c['model'];if(_0x5a7d05[_0xd197('0x30')][_0xd197('0x40')]){_0x3b2cc4[_0xd197('0x41')]=[{'all':!![]}];}_0x3b2cc4=_['merge']({},_0x3b2cc4,_0x5a7d05[_0xd197('0x46')]);return db['ChatInternalMessage'][_0xd197('0x47')](_0x3b2cc4)[_0xd197('0x27')](handleEntityNotFound(_0xd5cdf7,null))[_0xd197('0x27')](respondWithResult(_0xd5cdf7,null))[_0xd197('0x44')](handleError(_0xd5cdf7,null));};exports[_0xd197('0x48')]=function(_0x167df3,_0x2c6d83){return db[_0xd197('0x3f')][_0xd197('0x48')](_0x167df3[_0xd197('0x49')],{})['then'](respondWithResult(_0x2c6d83,0xc9))[_0xd197('0x44')](handleError(_0x2c6d83,null));};exports[_0xd197('0x26')]=function(_0x585520,_0x26e850){if(_0x585520[_0xd197('0x49')]['id']){delete _0x585520[_0xd197('0x49')]['id'];}return db['ChatInternalMessage'][_0xd197('0x47')]({'where':{'id':_0x585520[_0xd197('0x4a')]['id']}})[_0xd197('0x27')](handleEntityNotFound(_0x26e850,null))[_0xd197('0x27')](saveUpdates(_0x585520['body'],null))[_0xd197('0x27')](respondWithResult(_0x26e850,null))[_0xd197('0x44')](handleError(_0x26e850,null));};exports[_0xd197('0x4b')]=function(_0x4c340c,_0x242e5d){return db[_0xd197('0x3f')][_0xd197('0x47')]({'where':{'id':_0x4c340c['params']['id']}})[_0xd197('0x27')](handleEntityNotFound(_0x242e5d,null))[_0xd197('0x27')](removeEntity(_0x242e5d,null))[_0xd197('0x44')](handleError(_0x242e5d,null));};exports[_0xd197('0x4c')]=function(_0x496a2a,_0x575879){return db[_0xd197('0x3f')][_0xd197('0x4c')]()[_0xd197('0x27')](respondWithResult(_0x575879,null))['catch'](handleError(_0x575879,null));};function wrapUser(_0x21c710){return function(_0x5ef1a0){var _0x51c8ad=_0x21c710[_0xd197('0x4d')]({'plain':!![]});_0x51c8ad['messages']=[];if(_0x5ef1a0){_0x51c8ad[_0xd197('0x4e')]=_0x5ef1a0[_0xd197('0x4f')];_0x51c8ad[_0xd197('0x50')]=_0x5ef1a0;}else{_0x51c8ad[_0xd197('0x4e')]=moment(0x0)[_0xd197('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x51c8ad[_0xd197('0x50')]={};}return _0x51c8ad;};}exports['getUsers']=function(_0x90f26e,_0x5161d3,_0x18f67b){var _0x1e4b69=[];return db[_0xd197('0x52')]['findAll']({'where':{'role':[_0xd197('0x53'),_0xd197('0x54'),'user']},'attributes':['id',_0xd197('0x55'),_0xd197('0x2a'),_0xd197('0x56'),_0xd197('0x57'),_0xd197('0x58'),'online',_0xd197('0x59'),_0xd197('0x5a'),_0xd197('0x5b')],'order':qs[_0xd197('0x3a')](_0xd197('0x5c')),'include':[{'model':db[_0xd197('0x5d')],'as':_0xd197('0x5e'),'attributes':['id',_0xd197('0x2a'),_0xd197('0x5f')],'through':{'attributes':[]}}]})[_0xd197('0x27')](function(_0x30222e){if(_0x30222e){var _0x231149=_0x90f26e[_0xd197('0x60')][_0xd197('0x4d')]({'plain':!![]});if(!_0x231149)throw new Error(_0xd197('0x61'));if(_0x231149['role']==='user'){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x231149[_0xd197('0x62')]},'raw':!![]})[_0xd197('0x27')](function(_0x563b9a){if(_0x563b9a){if(_0x563b9a[_0xd197('0x63')]===0x0){return db[_0xd197('0x64')][_0xd197('0x42')]({'where':{'sectionId':_0x563b9a['id']},'raw':!![]})[_0xd197('0x27')](function(_0x5f44c6){var _0x3e6fce=[];if(_['isEmpty'](_0x5f44c6)){_0x3e6fce=_[_0xd197('0x3c')](_0x30222e,function(_0x184efe){if(_0x184efe[_0xd197('0x56')]!=='agent'){return _0x184efe;}});return _0x3e6fce;}else{for(var _0x26a3c8=0x0;_0x26a3c8<_0x30222e['length'];_0x26a3c8++){var _0x2a951c=_0x30222e[_0x26a3c8];if(_0x2a951c[_0xd197('0x56')]===_0xd197('0x53')){var _0x384d34=_[_0xd197('0x47')](_0x5f44c6,function(_0x1e66ca){return _0x1e66ca['resourceId']===_0x2a951c['id'];});if(_0x384d34)_0x3e6fce[_0xd197('0x65')](_0x2a951c);}else{_0x3e6fce[_0xd197('0x65')](_0x2a951c);}}return _0x3e6fce;}});}else{return _0x30222e;}}else{var _0x603753=_[_0xd197('0x3c')](_0x30222e,function(_0x40c723){if(_0x40c723['role']!==_0xd197('0x53')){return _0x40c723;}});return _0x603753;}});}else{return _0x30222e;}}})[_0xd197('0x27')](function(_0x1d9b9f){var _0x21e87d=[];if(_0x1d9b9f){_0x1e4b69=_0x1d9b9f;for(var _0x4a4b8a=0x0;_0x4a4b8a<_0x1d9b9f[_0xd197('0x36')];_0x4a4b8a+=0x1){_0x1e4b69[_0x4a4b8a][_0xd197('0x66')]=[];_0x21e87d[_0xd197('0x65')](db[_0xd197('0x3f')]['find']({'where':{'FromId':[_0x90f26e[_0xd197('0x60')]['id'],_0x1d9b9f[_0x4a4b8a]['id']],'ToId':[_0x90f26e[_0xd197('0x60')]['id'],_0x1d9b9f[_0x4a4b8a]['id']],'ChatGroupId':null},'attributes':['id',_0xd197('0x4f'),_0xd197('0x67'),_0xd197('0x68'),'read',_0xd197('0x49')],'order':qs[_0xd197('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd197('0x27')](wrapUser(_0x1d9b9f[_0x4a4b8a])));}return BPromise[_0xd197('0x69')](_0x21e87d);}return[];})[_0xd197('0x27')](function(_0x2230d4){return{'rows':_0x2230d4,'count':_0x2230d4['length']};})[_0xd197('0x27')](respondWithResult(_0x5161d3,null))[_0xd197('0x44')](handleError(_0x5161d3,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a065cd4..0d5fa4c 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 _0x26fb=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3869c0,_0x293139){var _0x58fed5=function(_0xa44a1d){while(--_0xa44a1d){_0x3869c0['push'](_0x3869c0['shift']());}};_0x58fed5(++_0x293139);}(_0x26fb,0x1f4));var _0xb26f=function(_0x37bf43,_0x5b2339){_0x37bf43=_0x37bf43-0x0;var _0x4101c5=_0x26fb[_0x37bf43];return _0x4101c5;};'use strict';var EventEmitter=require(_0xb26f('0x0'));var ChatInternalMessage=require(_0xb26f('0x1'))['db'][_0xb26f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb26f('0x3')](0x0);var events={'afterCreate':_0xb26f('0x4'),'afterUpdate':_0xb26f('0x5'),'afterDestroy':_0xb26f('0x6')};function emitEvent(_0x150c69){return function(_0x5ac713,_0xa7193e,_0x1c50e8){ChatInternalMessageEvents[_0xb26f('0x7')](_0x150c69+':'+_0x5ac713['id'],_0x5ac713);ChatInternalMessageEvents[_0xb26f('0x7')](_0x150c69,_0x5ac713);_0x1c50e8(null);};}for(var e in events){if(events[_0xb26f('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb26f('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x2174=['events','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2174,0x142));var _0x4217=function(_0x266d0f,_0x16a276){_0x266d0f=_0x266d0f-0x0;var _0x23d450=_0x2174[_0x266d0f];return _0x23d450;};'use strict';var EventEmitter=require(_0x4217('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4217('0x1')](0x0);var events={'afterCreate':_0x4217('0x2'),'afterUpdate':'update','afterDestroy':_0x4217('0x3')};function emitEvent(_0x1ae667){return function(_0x3a09e,_0x435b31,_0x175ca8){ChatInternalMessageEvents['emit'](_0x1ae667+':'+_0x3a09e['id'],_0x3a09e);ChatInternalMessageEvents[_0x4217('0x4')](_0x1ae667,_0x3a09e);_0x175ca8(null);};}for(var e in events){if(events[_0x4217('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x4217('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 99e489b..deaabb1 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 _0x1973=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x1973,0x74));var _0x3197=function(_0x34b410,_0x571fe7){_0x34b410=_0x34b410-0x0;var _0x5df540=_0x1973[_0x34b410];return _0x5df540;};'use strict';var _=require(_0x3197('0x0'));var util=require(_0x3197('0x1'));var logger=require(_0x3197('0x2'))(_0x3197('0x3'));var moment=require(_0x3197('0x4'));var BPromise=require(_0x3197('0x5'));var rp=require(_0x3197('0x6'));var fs=require('fs');var path=require(_0x3197('0x7'));var rimraf=require(_0x3197('0x8'));var config=require(_0x3197('0x9'));var attributes=require(_0x3197('0xa'));module[_0x3197('0xb')]=function(_0x62dd41,_0x5307aa){return _0x62dd41[_0x3197('0xc')](_0x3197('0xd'),attributes,{'tableName':_0x3197('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3197('0xf'),'collate':_0x3197('0x10')});}; \ No newline at end of file +var _0x07d2=['ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','request-promise','rimraf','exports'];(function(_0x57060b,_0xc6ecc){var _0x101612=function(_0x3f2df3){while(--_0x3f2df3){_0x57060b['push'](_0x57060b['shift']());}};_0x101612(++_0xc6ecc);}(_0x07d2,0xb7));var _0x207d=function(_0x5dc0b0,_0x3bb51b){_0x5dc0b0=_0x5dc0b0-0x0;var _0x4af860=_0x07d2[_0x5dc0b0];return _0x4af860;};'use strict';var _=require(_0x207d('0x0'));var util=require(_0x207d('0x1'));var logger=require(_0x207d('0x2'))(_0x207d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x207d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x207d('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x207d('0x6')]=function(_0x2b100c,_0x4a3654){return _0x2b100c['define'](_0x207d('0x7'),attributes,{'tableName':_0x207d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x207d('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 9b70b2d..e2b144e 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 _0x8f4e=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x8f4e,0x149));var _0xe8f4=function(_0x2954e5,_0x5f04b9){_0x2954e5=_0x2954e5-0x0;var _0x4b4deb=_0x8f4e[_0x2954e5];return _0x4b4deb;};'use strict';var _=require(_0xe8f4('0x0'));var util=require('util');var moment=require(_0xe8f4('0x1'));var BPromise=require(_0xe8f4('0x2'));var rs=require(_0xe8f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8f4('0x4'))['db'];var utils=require(_0xe8f4('0x5'));var logger=require(_0xe8f4('0x6'))(_0xe8f4('0x7'));var config=require(_0xe8f4('0x8'));var jayson=require(_0xe8f4('0x9'));var client=jayson['client'][_0xe8f4('0xa')]({'port':0x232a});config[_0xe8f4('0xb')]=_[_0xe8f4('0xc')](config[_0xe8f4('0xb')],{'host':_0xe8f4('0xd'),'port':0x18eb});var socket=require(_0xe8f4('0xe'))(new Redis(config[_0xe8f4('0xb')]));require(_0xe8f4('0xf'))[_0xe8f4('0x10')](socket);function respondWithRpcPromise(_0x5cce05,_0x5459e4,_0x525340){return new BPromise(function(_0x417426,_0x410a12){return client['request'](_0x5cce05,_0x525340)['then'](function(_0x6a15f){logger[_0xe8f4('0x11')](_0xe8f4('0x12'),_0x5459e4,_0xe8f4('0x13'));logger[_0xe8f4('0x14')](_0xe8f4('0x15'),_0x5459e4,_0xe8f4('0x13'),JSON[_0xe8f4('0x16')](_0x6a15f));if(_0x6a15f['error']){if(_0x6a15f[_0xe8f4('0x17')]['code']===0x1f4){logger[_0xe8f4('0x17')](_0xe8f4('0x12'),_0x5459e4,_0x6a15f[_0xe8f4('0x17')][_0xe8f4('0x18')]);return _0x410a12(_0x6a15f[_0xe8f4('0x17')][_0xe8f4('0x18')]);}logger['error'](_0xe8f4('0x12'),_0x5459e4,_0x6a15f['error']['message']);return _0x417426(_0x6a15f[_0xe8f4('0x17')][_0xe8f4('0x18')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5459e4,'request\x20sent');_0x417426(_0x6a15f['result'][_0xe8f4('0x18')]);}})['catch'](function(_0x303258){logger['error'](_0xe8f4('0x12'),_0x5459e4,_0x303258);_0x410a12(_0x303258);});});} \ No newline at end of file +var _0x7005=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','util','moment'];(function(_0x103206,_0x1fae01){var _0x2e2f53=function(_0x34f7ca){while(--_0x34f7ca){_0x103206['push'](_0x103206['shift']());}};_0x2e2f53(++_0x1fae01);}(_0x7005,0x148));var _0x5700=function(_0x5d8251,_0x633d3){_0x5d8251=_0x5d8251-0x0;var _0x1bff1e=_0x7005[_0x5d8251];return _0x1bff1e;};'use strict';var _=require('lodash');var util=require(_0x5700('0x0'));var moment=require(_0x5700('0x1'));var BPromise=require(_0x5700('0x2'));var rs=require(_0x5700('0x3'));var fs=require('fs');var Redis=require(_0x5700('0x4'));var db=require(_0x5700('0x5'))['db'];var utils=require(_0x5700('0x6'));var logger=require(_0x5700('0x7'))(_0x5700('0x8'));var config=require(_0x5700('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5700('0xa')][_0x5700('0xb')]({'port':0x232a});config[_0x5700('0xc')]=_[_0x5700('0xd')](config[_0x5700('0xc')],{'host':_0x5700('0xe'),'port':0x18eb});var socket=require(_0x5700('0xf'))(new Redis(config[_0x5700('0xc')]));require(_0x5700('0x10'))[_0x5700('0x11')](socket);function respondWithRpcPromise(_0x220c7b,_0x2b1ea4,_0x174106){return new BPromise(function(_0x2924e9,_0x2f09a0){return client[_0x5700('0x12')](_0x220c7b,_0x174106)[_0x5700('0x13')](function(_0x5653b4){logger[_0x5700('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x2b1ea4,_0x5700('0x15'));logger[_0x5700('0x16')](_0x5700('0x17'),_0x2b1ea4,'request\x20sent',JSON[_0x5700('0x18')](_0x5653b4));if(_0x5653b4['error']){if(_0x5653b4[_0x5700('0x19')][_0x5700('0x1a')]===0x1f4){logger['error'](_0x5700('0x1b'),_0x2b1ea4,_0x5653b4['error'][_0x5700('0x1c')]);return _0x2f09a0(_0x5653b4[_0x5700('0x19')][_0x5700('0x1c')]);}logger[_0x5700('0x19')](_0x5700('0x1b'),_0x2b1ea4,_0x5653b4[_0x5700('0x19')][_0x5700('0x1c')]);return _0x2924e9(_0x5653b4['error'][_0x5700('0x1c')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x2b1ea4,_0x5700('0x15'));_0x2924e9(_0x5653b4[_0x5700('0x1d')][_0x5700('0x1c')]);}})['catch'](function(_0x3f6b1d){logger[_0x5700('0x19')](_0x5700('0x1b'),_0x2b1ea4,_0x3f6b1d);_0x2f09a0(_0x3f6b1d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 375e06d..1cd5da3 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 _0x9f2f=['chatInternalMessage:','save','remove','update','emit','removeListener','length'];(function(_0x27443b,_0x263605){var _0x2e00c0=function(_0x5243d1){while(--_0x5243d1){_0x27443b['push'](_0x27443b['shift']());}};_0x2e00c0(++_0x263605);}(_0x9f2f,0x8d));var _0xf9f2=function(_0x168a17,_0x19e250){_0x168a17=_0x168a17-0x0;var _0x53229d=_0x9f2f[_0x168a17];return _0x53229d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xf9f2('0x0'),_0xf9f2('0x1'),_0xf9f2('0x2')];function createListener(_0x242e89,_0x45d024){return function(_0x56c904){_0x45d024[_0xf9f2('0x3')](_0x242e89,_0x56c904);};}function removeListener(_0x5cad40,_0x3f11bd){return function(){ChatInternalMessageEvents[_0xf9f2('0x4')](_0x5cad40,_0x3f11bd);};}exports['register']=function(_0x5c8ae0){for(var _0x2dd0f5=0x0,_0x127c9f=events[_0xf9f2('0x5')];_0x2dd0f5<_0x127c9f;_0x2dd0f5++){var _0x3f3da2=events[_0x2dd0f5];var _0x2e556b=createListener(_0xf9f2('0x6')+_0x3f3da2,_0x5c8ae0);ChatInternalMessageEvents['on'](_0x3f3da2,_0x2e556b);}}; \ No newline at end of file +var _0x0435=['save','remove','update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x339e28,_0x341e2c){var _0x1605dd=function(_0x3c6006){while(--_0x3c6006){_0x339e28['push'](_0x339e28['shift']());}};_0x1605dd(++_0x341e2c);}(_0x0435,0x6f));var _0x5043=function(_0x34ad46,_0x6fbd0c){_0x34ad46=_0x34ad46-0x0;var _0xbdd4ea=_0x0435[_0x34ad46];return _0xbdd4ea;};'use strict';var ChatInternalMessageEvents=require(_0x5043('0x0'));var events=[_0x5043('0x1'),_0x5043('0x2'),_0x5043('0x3')];function createListener(_0x4b54e4,_0xa68eed){return function(_0xfa3dbb){_0xa68eed[_0x5043('0x4')](_0x4b54e4,_0xfa3dbb);};}function removeListener(_0x2791b3,_0x313b2f){return function(){ChatInternalMessageEvents[_0x5043('0x5')](_0x2791b3,_0x313b2f);};}exports[_0x5043('0x6')]=function(_0xeaa8b0){for(var _0x397547=0x0,_0x2a9a4a=events['length'];_0x397547<_0x2a9a4a;_0x397547++){var _0x23ae7d=events[_0x397547];var _0x26dc89=createListener(_0x5043('0x7')+_0x23ae7d,_0xeaa8b0);ChatInternalMessageEvents['on'](_0x23ae7d,_0x26dc89);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index bb38f5e..d54e3fd 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 _0xf3bb=['getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users'];(function(_0x14bec3,_0x5acbb9){var _0x5e0f53=function(_0x57bcf0){while(--_0x57bcf0){_0x14bec3['push'](_0x14bec3['shift']());}};_0x5e0f53(++_0x5acbb9);}(_0xf3bb,0x129));var _0xbf3b=function(_0x3aff2d,_0xa1cd35){_0x3aff2d=_0x3aff2d-0x0;var _0x410121=_0xf3bb[_0x3aff2d];return _0x410121;};'use strict';var multer=require(_0xbf3b('0x0'));var util=require(_0xbf3b('0x1'));var path=require(_0xbf3b('0x2'));var timeout=require(_0xbf3b('0x3'));var express=require(_0xbf3b('0x4'));var router=express[_0xbf3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbf3b('0x6'));var interaction=require(_0xbf3b('0x7'));var config=require(_0xbf3b('0x8'));var controller=require(_0xbf3b('0x9'));router[_0xbf3b('0xa')]('/',auth[_0xbf3b('0xb')](),controller[_0xbf3b('0xc')]);router[_0xbf3b('0xa')](_0xbf3b('0xd'),auth[_0xbf3b('0xb')](),controller['describe']);router[_0xbf3b('0xa')](_0xbf3b('0xe'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0xf')]);router['get'](_0xbf3b('0x10'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x11')]);router[_0xbf3b('0x12')]('/',auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x13')]);router[_0xbf3b('0x14')](_0xbf3b('0x10'),controller[_0xbf3b('0x15')]);router['delete'](_0xbf3b('0x10'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x16')]);module[_0xbf3b('0x17')]=router; \ No newline at end of file +var _0x405f=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/users','getUsers','/:id','post','create','put','delete'];(function(_0xa4cfa2,_0x4fb42d){var _0x4c2f6c=function(_0x5515bf){while(--_0x5515bf){_0xa4cfa2['push'](_0xa4cfa2['shift']());}};_0x4c2f6c(++_0x4fb42d);}(_0x405f,0x127));var _0xf405=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x405f[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require('multer');var util=require(_0xf405('0x0'));var path=require(_0xf405('0x1'));var timeout=require(_0xf405('0x2'));var express=require(_0xf405('0x3'));var router=express[_0xf405('0x4')]();var fs_extra=require(_0xf405('0x5'));var auth=require(_0xf405('0x6'));var interaction=require(_0xf405('0x7'));var config=require(_0xf405('0x8'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xf405('0x9')](),controller[_0xf405('0xa')]);router[_0xf405('0xb')](_0xf405('0xc'),auth[_0xf405('0x9')](),controller['describe']);router[_0xf405('0xb')](_0xf405('0xd'),auth[_0xf405('0x9')](),controller[_0xf405('0xe')]);router[_0xf405('0xb')](_0xf405('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xf405('0x10')]('/',auth[_0xf405('0x9')](),controller[_0xf405('0x11')]);router[_0xf405('0x12')](_0xf405('0xf'),controller['update']);router[_0xf405('0x13')](_0xf405('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf405('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 63d7f0f..1662cd9 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 _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x1d21,0x158));var _0x11d2=function(_0x57f345,_0x316929){_0x57f345=_0x57f345-0x0;var _0x255e43=_0x1d21[_0x57f345];return _0x255e43;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}}; \ No newline at end of file +var _0x3870=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x4bc2ba,_0x537506){var _0xae9c9b=function(_0x1e5bdd){while(--_0x1e5bdd){_0x4bc2ba['push'](_0x4bc2ba['shift']());}};_0xae9c9b(++_0x537506);}(_0x3870,0x146));var _0x0387=function(_0x260114,_0x25294d){_0x260114=_0x260114-0x0;var _0x19da40=_0x3870[_0x260114];return _0x19da40;};'use strict';var Sequelize=require(_0x0387('0x0'));module[_0x0387('0x1')]={'body':{'type':Sequelize[_0x0387('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0387('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0387('0x4')]('in',_0x0387('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0387('0x6')]},'providerName':{'type':Sequelize[_0x0387('0x7')]},'providerResponse':{'type':Sequelize[_0x0387('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index b7bd341..9406d42 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 _0x3333=['message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','show','keys','include','options','find','body','update','params','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','ChatInteraction','read1stAt','format','get','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','interaction','reject','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','User','interface','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4f72d2,_0x1bbac4){var _0x5709af=function(_0x16d769){while(--_0x16d769){_0x4f72d2['push'](_0x4f72d2['shift']());}};_0x5709af(++_0x1bbac4);}(_0x3333,0x1dd));var _0x3333=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x3333[_0x43b08];return _0x5e05f4;};'use strict';var emlformat=require(_0x3333('0x0'));var rimraf=require(_0x3333('0x1'));var zipdir=require(_0x3333('0x2'));var jsonpatch=require(_0x3333('0x3'));var rp=require(_0x3333('0x4'));var moment=require('moment');var BPromise=require(_0x3333('0x5'));var Mustache=require(_0x3333('0x6'));var util=require(_0x3333('0x7'));var path=require(_0x3333('0x8'));var sox=require(_0x3333('0x9'));var csv=require('to-csv');var ejs=require(_0x3333('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3333('0xb'));var squel=require(_0x3333('0xc'));var crypto=require('crypto');var jsforce=require(_0x3333('0xd'));var deskjs=require(_0x3333('0xe'));var toCsv=require(_0x3333('0xf'));var querystring=require(_0x3333('0x10'));var Papa=require(_0x3333('0x11'));var Redis=require(_0x3333('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3333('0x13'));var as=require(_0x3333('0x14'));var hardwareService=require(_0x3333('0x15'));var logger=require(_0x3333('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3333('0x17'));var licenseUtil=require(_0x3333('0x18'));var db=require(_0x3333('0x19'))['db'];config[_0x3333('0x1a')]=_[_0x3333('0x1b')](config[_0x3333('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3333('0x1a')]));require(_0x3333('0x1c'))[_0x3333('0x1d')](socket);var jayson=require(_0x3333('0x1e'));var client=jayson[_0x3333('0x1f')][_0x3333('0x20')]({'port':0x232c});var client9002=jayson[_0x3333('0x1f')][_0x3333('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x49aa4e,_0x5df09d,_0x2dfca7,_0x38f50e){return new BPromise(function(_0x17d388,_0x1b8156){var _0x35e47c=_0x38f50e||client;return _0x35e47c[_0x3333('0x21')](_0x49aa4e,_0x2dfca7)[_0x3333('0x22')](function(_0x381a5f){logger[_0x3333('0x23')](_0x3333('0x24'),_0x5df09d,'request\x20sent');logger[_0x3333('0x25')](_0x3333('0x26'),_0x5df09d,_0x3333('0x27'),JSON[_0x3333('0x28')](_0x381a5f));if(_0x381a5f[_0x3333('0x29')]){if(_0x381a5f[_0x3333('0x29')][_0x3333('0x2a')]===0x1f4){logger['error'](_0x3333('0x24'),_0x5df09d,_0x381a5f[_0x3333('0x29')]['message']);return _0x1b8156(_0x381a5f[_0x3333('0x29')][_0x3333('0x2b')]);}logger['error'](_0x3333('0x24'),_0x5df09d,_0x381a5f[_0x3333('0x29')][_0x3333('0x2b')]);return _0x17d388(_0x381a5f[_0x3333('0x29')][_0x3333('0x2b')]);}else{logger[_0x3333('0x23')](_0x3333('0x24'),_0x5df09d,_0x3333('0x27'));_0x17d388(_0x381a5f[_0x3333('0x2c')][_0x3333('0x2b')]);}})[_0x3333('0x2d')](function(_0x20f743){logger['error'](_0x3333('0x24'),_0x5df09d,_0x20f743);_0x1b8156(_0x20f743);});});}function respondWithStatusCode(_0x11595f,_0x36885b){_0x36885b=_0x36885b||0xcc;return function(_0x4a1dcf){if(_0x4a1dcf){return _0x11595f[_0x3333('0x2e')](_0x36885b);}return _0x11595f[_0x3333('0x2f')](_0x36885b)['end']();};}function respondWithResult(_0x5e5fde,_0x3f2695){_0x3f2695=_0x3f2695||0xc8;return function(_0x576c3c){if(_0x576c3c){return _0x5e5fde[_0x3333('0x2f')](_0x3f2695)[_0x3333('0x30')](_0x576c3c);}};}function respondWithFilteredResult(_0xd2c3a1,_0x1658d9){return function(_0x1360e3){if(_0x1360e3){var _0x24d3be=typeof _0x1658d9[_0x3333('0x31')]==='undefined'&&typeof _0x1658d9[_0x3333('0x32')]==='undefined';var _0x2fd94d=_0x1360e3[_0x3333('0x33')];var _0x59547b=_0x24d3be?0x0:_0x1658d9[_0x3333('0x31')];var _0x105648=_0x24d3be?_0x1360e3[_0x3333('0x33')]:_0x1658d9['offset']+_0x1658d9[_0x3333('0x32')];var _0x181bcb;if(_0x105648>=_0x2fd94d){_0x105648=_0x2fd94d;_0x181bcb=0xc8;}else{_0x181bcb=0xce;}_0xd2c3a1[_0x3333('0x2f')](_0x181bcb);return _0xd2c3a1[_0x3333('0x34')](_0x3333('0x35'),_0x59547b+'-'+_0x105648+'/'+_0x2fd94d)[_0x3333('0x30')](_0x1360e3);}return null;};}function patchUpdates(_0x5440d8){return function(_0x4ccbd4){try{jsonpatch[_0x3333('0x36')](_0x4ccbd4,_0x5440d8,!![]);}catch(_0x40200c){return BPromise['reject'](_0x40200c);}return _0x4ccbd4[_0x3333('0x37')]();};}function saveUpdates(_0x7e1dd5,_0x3f58df){return function(_0x530f2b){if(_0x530f2b){return _0x530f2b['update'](_0x7e1dd5)[_0x3333('0x22')](function(_0x2258e7){return _0x2258e7;});}return null;};}function removeEntity(_0x4f7554,_0x315991){return function(_0x38fc50){if(_0x38fc50){return _0x38fc50[_0x3333('0x38')]()[_0x3333('0x22')](function(){_0x4f7554[_0x3333('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4158d5,_0x801bef){return function(_0x2d6617){if(!_0x2d6617){_0x4158d5[_0x3333('0x2e')](0x194);}return _0x2d6617;};}function handleError(_0x522846,_0x2f062e){_0x2f062e=_0x2f062e||0x1f4;return function(_0x492048){logger['error'](_0x492048[_0x3333('0x39')]);if(_0x492048[_0x3333('0x3a')]){delete _0x492048['name'];}_0x522846[_0x3333('0x2f')](_0x2f062e)[_0x3333('0x3b')](_0x492048);};}exports[_0x3333('0x3c')]=function(_0x55d850,_0x4893a4){var _0x564c3f={},_0x3c22e1={},_0x1e75e5={'count':0x0,'rows':[]};var _0x4326f6=_[_0x3333('0x3d')](db[_0x3333('0x3e')][_0x3333('0x3f')],function(_0x34ea14){return{'name':_0x34ea14['fieldName'],'type':_0x34ea14['type'][_0x3333('0x40')]};});_0x3c22e1['model']=_['map'](_0x4326f6,_0x3333('0x3a'));_0x3c22e1[_0x3333('0x41')]=_['keys'](_0x55d850[_0x3333('0x41')]);_0x3c22e1[_0x3333('0x42')]=_[_0x3333('0x43')](_0x3c22e1[_0x3333('0x44')],_0x3c22e1[_0x3333('0x41')]);_0x564c3f[_0x3333('0x45')]=_['intersection'](_0x3c22e1[_0x3333('0x44')],qs[_0x3333('0x46')](_0x55d850[_0x3333('0x41')]['fields']));_0x564c3f[_0x3333('0x45')]=_0x564c3f[_0x3333('0x45')][_0x3333('0x47')]?_0x564c3f['attributes']:_0x3c22e1[_0x3333('0x44')];if(!_0x55d850[_0x3333('0x41')][_0x3333('0x48')]('nolimit')){_0x564c3f[_0x3333('0x32')]=qs[_0x3333('0x32')](_0x55d850[_0x3333('0x41')]['limit']);_0x564c3f[_0x3333('0x31')]=qs[_0x3333('0x31')](_0x55d850[_0x3333('0x41')][_0x3333('0x31')]);}_0x564c3f['order']=qs[_0x3333('0x49')](_0x55d850[_0x3333('0x41')]['sort']);_0x564c3f[_0x3333('0x4a')]=qs[_0x3333('0x42')](_[_0x3333('0x4b')](_0x55d850[_0x3333('0x41')],_0x3c22e1[_0x3333('0x42')]),_0x4326f6);if(_0x55d850[_0x3333('0x41')][_0x3333('0x4c')]){_0x564c3f[_0x3333('0x4a')]=_[_0x3333('0x4d')](_0x564c3f[_0x3333('0x4a')],{'$or':_[_0x3333('0x3d')](_0x4326f6,function(_0x2f92bf){if(_0x2f92bf[_0x3333('0x4e')]!==_0x3333('0x4f')){var _0x336954={};_0x336954[_0x2f92bf[_0x3333('0x3a')]]={'$like':'%'+_0x55d850[_0x3333('0x41')][_0x3333('0x4c')]+'%'};return _0x336954;}})});}_0x564c3f=_['merge']({},_0x564c3f,_0x55d850['options']);var _0x2af8d8={'where':_0x564c3f[_0x3333('0x4a')]};return db[_0x3333('0x3e')][_0x3333('0x33')](_0x2af8d8)['then'](function(_0x3d2199){_0x1e75e5[_0x3333('0x33')]=_0x3d2199;if(_0x55d850[_0x3333('0x41')][_0x3333('0x50')]){_0x564c3f['include']=[{'all':!![]}];}return db[_0x3333('0x3e')]['findAll'](_0x564c3f);})[_0x3333('0x22')](function(_0x36e41c){_0x1e75e5['rows']=_0x36e41c;return _0x1e75e5;})[_0x3333('0x22')](respondWithFilteredResult(_0x4893a4,_0x564c3f))['catch'](handleError(_0x4893a4,null));};exports[_0x3333('0x51')]=function(_0x171ea,_0x26c2f2){var _0x3c54e9={'raw':!![],'where':{'id':_0x171ea['params']['id']}},_0x373a89={};_0x373a89[_0x3333('0x44')]=_[_0x3333('0x52')](db[_0x3333('0x3e')]['rawAttributes']);_0x373a89[_0x3333('0x41')]=_[_0x3333('0x52')](_0x171ea['query']);_0x373a89[_0x3333('0x42')]=_[_0x3333('0x43')](_0x373a89[_0x3333('0x44')],_0x373a89[_0x3333('0x41')]);_0x3c54e9[_0x3333('0x45')]=_[_0x3333('0x43')](_0x373a89['model'],qs['fields'](_0x171ea[_0x3333('0x41')][_0x3333('0x46')]));_0x3c54e9[_0x3333('0x45')]=_0x3c54e9[_0x3333('0x45')]['length']?_0x3c54e9[_0x3333('0x45')]:_0x373a89['model'];if(_0x171ea['query'][_0x3333('0x50')]){_0x3c54e9[_0x3333('0x53')]=[{'all':!![]}];}_0x3c54e9=_[_0x3333('0x4d')]({},_0x3c54e9,_0x171ea[_0x3333('0x54')]);return db[_0x3333('0x3e')][_0x3333('0x55')](_0x3c54e9)['then'](handleEntityNotFound(_0x26c2f2,null))['then'](respondWithResult(_0x26c2f2,null))[_0x3333('0x2d')](handleError(_0x26c2f2,null));};exports['create']=function(_0x3eb1e5,_0x5cb77b){return db[_0x3333('0x3e')]['create'](_0x3eb1e5[_0x3333('0x56')],{})[_0x3333('0x22')](respondWithResult(_0x5cb77b,0xc9))[_0x3333('0x2d')](handleError(_0x5cb77b,null));};exports[_0x3333('0x57')]=function(_0x687e4e,_0x20ea46){if(_0x687e4e[_0x3333('0x56')]['id']){delete _0x687e4e[_0x3333('0x56')]['id'];}return db[_0x3333('0x3e')][_0x3333('0x55')]({'where':{'id':_0x687e4e['params']['id']}})[_0x3333('0x22')](handleEntityNotFound(_0x20ea46,null))[_0x3333('0x22')](saveUpdates(_0x687e4e[_0x3333('0x56')],null))['then'](respondWithResult(_0x20ea46,null))[_0x3333('0x2d')](handleError(_0x20ea46,null));};exports[_0x3333('0x38')]=function(_0x461062,_0xaca69f){return db[_0x3333('0x3e')][_0x3333('0x55')]({'where':{'id':_0x461062[_0x3333('0x58')]['id']}})[_0x3333('0x22')](handleEntityNotFound(_0xaca69f,null))[_0x3333('0x22')](removeEntity(_0xaca69f,null))[_0x3333('0x2d')](handleError(_0xaca69f,null));};exports[_0x3333('0x59')]=function(_0x599234,_0x5024b0){return db[_0x3333('0x3e')][_0x3333('0x59')]()['then'](respondWithResult(_0x5024b0,null))[_0x3333('0x2d')](handleError(_0x5024b0,null));};var interaction_log=require(_0x3333('0x16'))(_0x3333('0x5a'));exports[_0x3333('0x5b')]=function(_0x44194d,_0x4cbb2d,_0x5b3540){var _0x14be2c={'agent':{},'channel':_0x3333('0x5c')};if(_0x44194d['body']['id']){delete _0x44194d[_0x3333('0x56')]['id'];}_0x44194d[_0x3333('0x56')]['read']=!![];_0x44194d[_0x3333('0x56')]['readAt']=moment()['format'](_0x3333('0x5d'));_0x44194d[_0x3333('0x56')]['UserId']=_0x44194d[_0x3333('0x56')]['UserId']||_0x44194d[_0x3333('0x5e')]['id'];_0x14be2c[_0x3333('0x5f')]['id']=_0x44194d['body'][_0x3333('0x60')];return db[_0x3333('0x3e')]['find']({'where':{'id':_0x44194d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cbb2d,null))[_0x3333('0x22')](saveUpdates(_0x44194d[_0x3333('0x56')],null))[_0x3333('0x22')](function(_0x151084){if(_0x151084){_0x14be2c[_0x3333('0x2b')]=_0x151084['get']({'plain':!![]});return db[_0x3333('0x61')][_0x3333('0x55')]({'where':{'id':_0x151084['ChatInteractionId']}});}return null;})[_0x3333('0x22')](handleEntityNotFound(_0x4cbb2d,null))[_0x3333('0x22')](function(_0x297667){if(_0x297667){return _0x297667['update']({'UserId':_0x44194d[_0x3333('0x56')][_0x3333('0x60')],'read1stAt':_['isNil'](_0x297667[_0x3333('0x62')])?moment()[_0x3333('0x63')](_0x3333('0x5d')):undefined});}return null;})[_0x3333('0x22')](function(_0x38d39b){if(_0x38d39b){_0x14be2c['interaction']=_0x38d39b[_0x3333('0x64')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44194d[_0x3333('0x5e')]['id'],_0x44194d[_0x3333('0x5e')][_0x3333('0x3a')],_0x44194d[_0x3333('0x5e')][_0x3333('0x65')],_0x14be2c['interaction']['id'],_0x44194d[_0x3333('0x56')]?JSON[_0x3333('0x28')](_0x44194d[_0x3333('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3333('0x66'),_0x14be2c);}return null;})[_0x3333('0x22')](function(_0x29d465){var _0xf7df9c=_0x3333('0x67')+_0x29d465[_0x3333('0x2b')]['ContactId'];return db[_0x3333('0x68')][_0x3333('0x41')](_0xf7df9c,{'type':db[_0x3333('0x69')][_0x3333('0x6a')][_0x3333('0x6b')],'raw':!![]})[_0x3333('0x22')](function(_0x320a16){return _0x320a16;});})[_0x3333('0x22')](function(_0x13def5){if(_0x13def5){_0x14be2c[_0x3333('0x2b')][_0x3333('0x6c')]=_0x13def5[0x0];if(!_0x44194d[_0x3333('0x56')][_0x3333('0x60')])return;return db['User'][_0x3333('0x55')]({'where':{'id':_0x44194d[_0x3333('0x56')][_0x3333('0x60')],'role':_0x3333('0x5f')},'attributes':['id',_0x3333('0x3a'),_0x3333('0x6d'),_0x3333('0x6e'),_0x3333('0x6f')],'raw':!![]});}return null;})[_0x3333('0x22')](function(_0x9ef74f){if(!_0x9ef74f)return null;_0x14be2c['message'][_0x3333('0x5f')]=_0x9ef74f;return _0x14be2c;})[_0x3333('0x22')](function(_0x1d2775){if(_0x1d2775){if(_0x44194d[_0x3333('0x56')][_0x3333('0x70')]){_0x14be2c[_0x3333('0x2b')]['interface']=util['format'](_0x3333('0x71'),_0x44194d[_0x3333('0x5e')][_0x3333('0x3a')]);_0x14be2c[_0x3333('0x2b')][_0x3333('0x72')]=_0x14be2c[_0x3333('0x72')];_0x14be2c[_0x3333('0x2b')]['motionChannel']=_0x14be2c[_0x3333('0x72')];_0x14be2c['message'][_0x3333('0x73')]=_0x3333('0x5b');return respondWithRpcPromise(_0x3333('0x74'),_0x3333('0x74'),{'event':_0x3333('0x75'),'message':_['merge'](_0x14be2c[_0x3333('0x2b')],JSON[_0x3333('0x76')](_0x14be2c[_0x3333('0x77')]['formData']))},client9002)[_0x3333('0x22')](function(){return _0x14be2c;});}return _0x14be2c;}return null;})[_0x3333('0x22')](respondWithResult(_0x4cbb2d,null))[_0x3333('0x2d')](handleError(_0x4cbb2d,null));};var interaction_log=require(_0x3333('0x16'))('chat-interactions');exports[_0x3333('0x78')]=function(_0x9034be,_0x3346fd,_0x4ad004){var _0x3c8b3a={'agent':{},'channel':_0x3333('0x5c')};if(_0x9034be[_0x3333('0x56')]['id']){delete _0x9034be['body']['id'];}_0x9034be[_0x3333('0x56')][_0x3333('0x60')]=_0x9034be[_0x3333('0x56')][_0x3333('0x60')]||_0x9034be[_0x3333('0x5e')]['id'];_0x3c8b3a[_0x3333('0x5f')]['id']=_0x9034be[_0x3333('0x56')][_0x3333('0x60')];return db['ChatMessage'][_0x3333('0x55')]({'where':{'id':_0x9034be[_0x3333('0x58')]['id'],'UserId':null}})[_0x3333('0x22')](handleEntityNotFound(_0x3346fd,null))[_0x3333('0x22')](function(_0x3d3ae0){if(_0x3d3ae0){_0x3c8b3a[_0x3333('0x2b')]=_0x3d3ae0['get']({'plain':!![]});return db[_0x3333('0x61')][_0x3333('0x55')]({'where':{'id':_0x3d3ae0[_0x3333('0x79')]}});}return null;})[_0x3333('0x22')](handleEntityNotFound(_0x3346fd,null))['then'](function(_0x1dec05){if(_0x1dec05){_0x3c8b3a[_0x3333('0x77')]=_0x1dec05['get']({'plain':!![]});interaction_log[_0x3333('0x23')](_0x3333('0x7a'),_0x9034be[_0x3333('0x5e')]['id'],_0x9034be['user'][_0x3333('0x3a')],_0x9034be['user'][_0x3333('0x65')],_0x3c8b3a['interaction']['id'],_0x9034be[_0x3333('0x56')]?JSON[_0x3333('0x28')](_0x9034be[_0x3333('0x56')]):_0x3333('0x7b'));return respondWithRpcPromise(_0x3333('0x7c'),_0x3333('0x7d'),_0x3c8b3a);}return null;})['then'](function(_0x493b61){var _0x1bf187=_0x3333('0x67')+_0x493b61[_0x3333('0x2b')]['ContactId'];return db[_0x3333('0x68')]['query'](_0x1bf187,{'type':db[_0x3333('0x69')][_0x3333('0x6a')][_0x3333('0x6b')],'raw':!![]})[_0x3333('0x22')](function(_0x2a85e0){return _0x2a85e0;});})['then'](function(_0x39625d){if(_0x39625d){_0x3c8b3a['message'][_0x3333('0x6c')]=_0x39625d[0x0];if(!_0x9034be[_0x3333('0x56')][_0x3333('0x60')])return;return db[_0x3333('0x7e')][_0x3333('0x55')]({'where':{'id':_0x9034be[_0x3333('0x56')][_0x3333('0x60')],'role':_0x3333('0x5f')},'attributes':['id',_0x3333('0x3a'),_0x3333('0x6d'),_0x3333('0x6e'),'internal'],'raw':!![]});}return null;})[_0x3333('0x22')](function(_0x24325c){if(!_0x24325c)return null;_0x3c8b3a[_0x3333('0x2b')][_0x3333('0x5f')]=_0x24325c;return _0x3c8b3a;})[_0x3333('0x22')](function(_0x13c752){if(_0x13c752){_0x13c752[_0x3333('0x2b')][_0x3333('0x7f')]=util[_0x3333('0x63')]('SIP/%s',_0x9034be[_0x3333('0x5e')][_0x3333('0x3a')]);_0x13c752[_0x3333('0x2b')][_0x3333('0x72')]=_0x3c8b3a[_0x3333('0x72')];_0x13c752[_0x3333('0x2b')][_0x3333('0x80')]=_0x3c8b3a[_0x3333('0x72')];_0x13c752['message']['event']=_0x3333('0x78');respondWithRpcPromise(_0x3333('0x74'),'EventManager',{'event':_0x3333('0x81'),'message':_[_0x3333('0x4d')](_0x3c8b3a[_0x3333('0x2b')],JSON[_0x3333('0x76')](_0x3c8b3a[_0x3333('0x77')]['formData']))},client9002);return _0x3c8b3a;}return null;})[_0x3333('0x22')](respondWithResult(_0x3346fd,null))[_0x3333('0x2d')](handleError(_0x3346fd,null));}; \ No newline at end of file +var _0x0c6e=['../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','ChatMessage','includeAll','include','rows','find','create','body','params','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','format','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5c62bb,_0x4bbd42){var _0x5e9ac1=function(_0x32bf15){while(--_0x32bf15){_0x5c62bb['push'](_0x5c62bb['shift']());}};_0x5e9ac1(++_0x4bbd42);}(_0x0c6e,0x6f));var _0xe0c6=function(_0x421bc6,_0x4f57c3){_0x421bc6=_0x421bc6-0x0;var _0x178c24=_0x0c6e[_0x421bc6];return _0x178c24;};'use strict';var emlformat=require(_0xe0c6('0x0'));var rimraf=require(_0xe0c6('0x1'));var zipdir=require(_0xe0c6('0x2'));var jsonpatch=require(_0xe0c6('0x3'));var rp=require('request-promise');var moment=require(_0xe0c6('0x4'));var BPromise=require(_0xe0c6('0x5'));var Mustache=require('mustache');var util=require(_0xe0c6('0x6'));var path=require(_0xe0c6('0x7'));var sox=require('sox');var csv=require(_0xe0c6('0x8'));var ejs=require(_0xe0c6('0x9'));var fs=require('fs');var fs_extra=require(_0xe0c6('0xa'));var _=require(_0xe0c6('0xb'));var squel=require(_0xe0c6('0xc'));var crypto=require(_0xe0c6('0xd'));var jsforce=require(_0xe0c6('0xe'));var deskjs=require(_0xe0c6('0xf'));var toCsv=require(_0xe0c6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe0c6('0x10'));var authService=require(_0xe0c6('0x11'));var qs=require(_0xe0c6('0x12'));var as=require(_0xe0c6('0x13'));var hardwareService=require(_0xe0c6('0x14'));var logger=require(_0xe0c6('0x15'))(_0xe0c6('0x16'));var utils=require(_0xe0c6('0x17'));var config=require(_0xe0c6('0x18'));var licenseUtil=require(_0xe0c6('0x19'));var db=require(_0xe0c6('0x1a'))['db'];config['redis']=_['defaults'](config[_0xe0c6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0c6('0x1c'))(new Redis(config[_0xe0c6('0x1b')]));require('./chatMessage.socket')[_0xe0c6('0x1d')](socket);var jayson=require(_0xe0c6('0x1e'));var client=jayson[_0xe0c6('0x1f')][_0xe0c6('0x20')]({'port':0x232c});var client9002=jayson[_0xe0c6('0x1f')][_0xe0c6('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xe5bd93,_0x1efa94,_0x5babb2,_0x325239){return new BPromise(function(_0x26a5c3,_0x3684de){var _0x39e221=_0x325239||client;return _0x39e221[_0xe0c6('0x21')](_0xe5bd93,_0x5babb2)[_0xe0c6('0x22')](function(_0x541995){logger[_0xe0c6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x1efa94,_0xe0c6('0x24'));logger[_0xe0c6('0x25')](_0xe0c6('0x26'),_0x1efa94,_0xe0c6('0x24'),JSON['stringify'](_0x541995));if(_0x541995[_0xe0c6('0x27')]){if(_0x541995[_0xe0c6('0x27')][_0xe0c6('0x28')]===0x1f4){logger[_0xe0c6('0x27')](_0xe0c6('0x29'),_0x1efa94,_0x541995[_0xe0c6('0x27')][_0xe0c6('0x2a')]);return _0x3684de(_0x541995['error'][_0xe0c6('0x2a')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x1efa94,_0x541995['error'][_0xe0c6('0x2a')]);return _0x26a5c3(_0x541995[_0xe0c6('0x27')][_0xe0c6('0x2a')]);}else{logger[_0xe0c6('0x23')](_0xe0c6('0x29'),_0x1efa94,_0xe0c6('0x24'));_0x26a5c3(_0x541995[_0xe0c6('0x2b')][_0xe0c6('0x2a')]);}})[_0xe0c6('0x2c')](function(_0x5939fe){logger[_0xe0c6('0x27')](_0xe0c6('0x29'),_0x1efa94,_0x5939fe);_0x3684de(_0x5939fe);});});}function respondWithStatusCode(_0x98adf0,_0xc206b){_0xc206b=_0xc206b||0xcc;return function(_0x409a38){if(_0x409a38){return _0x98adf0[_0xe0c6('0x2d')](_0xc206b);}return _0x98adf0[_0xe0c6('0x2e')](_0xc206b)[_0xe0c6('0x2f')]();};}function respondWithResult(_0x140c9d,_0x45ad48){_0x45ad48=_0x45ad48||0xc8;return function(_0x3dc01f){if(_0x3dc01f){return _0x140c9d[_0xe0c6('0x2e')](_0x45ad48)['json'](_0x3dc01f);}};}function respondWithFilteredResult(_0x5005d1,_0x56bfd5){return function(_0xe2f549){if(_0xe2f549){var _0x2ad4f6=typeof _0x56bfd5[_0xe0c6('0x30')]===_0xe0c6('0x31')&&typeof _0x56bfd5[_0xe0c6('0x32')]===_0xe0c6('0x31');var _0x89a764=_0xe2f549[_0xe0c6('0x33')];var _0x426b1d=_0x2ad4f6?0x0:_0x56bfd5[_0xe0c6('0x30')];var _0x507cbe=_0x2ad4f6?_0xe2f549[_0xe0c6('0x33')]:_0x56bfd5[_0xe0c6('0x30')]+_0x56bfd5[_0xe0c6('0x32')];var _0xa6592d;if(_0x507cbe>=_0x89a764){_0x507cbe=_0x89a764;_0xa6592d=0xc8;}else{_0xa6592d=0xce;}_0x5005d1[_0xe0c6('0x2e')](_0xa6592d);return _0x5005d1[_0xe0c6('0x34')](_0xe0c6('0x35'),_0x426b1d+'-'+_0x507cbe+'/'+_0x89a764)[_0xe0c6('0x36')](_0xe2f549);}return null;};}function patchUpdates(_0x503c4d){return function(_0x37d409){try{jsonpatch[_0xe0c6('0x37')](_0x37d409,_0x503c4d,!![]);}catch(_0x34fb4a){return BPromise[_0xe0c6('0x38')](_0x34fb4a);}return _0x37d409[_0xe0c6('0x39')]();};}function saveUpdates(_0x663c81,_0x2bac13){return function(_0x4930e2){if(_0x4930e2){return _0x4930e2[_0xe0c6('0x3a')](_0x663c81)['then'](function(_0x1bd821){return _0x1bd821;});}return null;};}function removeEntity(_0x2db537,_0x5ca01a){return function(_0x5d240f){if(_0x5d240f){return _0x5d240f[_0xe0c6('0x3b')]()[_0xe0c6('0x22')](function(){_0x2db537[_0xe0c6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x255d54,_0x4c6969){return function(_0x4d492e){if(!_0x4d492e){_0x255d54['sendStatus'](0x194);}return _0x4d492e;};}function handleError(_0x4311ec,_0x43e36a){_0x43e36a=_0x43e36a||0x1f4;return function(_0xc91c32){logger[_0xe0c6('0x27')](_0xc91c32[_0xe0c6('0x3c')]);if(_0xc91c32['name']){delete _0xc91c32[_0xe0c6('0x3d')];}_0x4311ec[_0xe0c6('0x2e')](_0x43e36a)[_0xe0c6('0x3e')](_0xc91c32);};}exports[_0xe0c6('0x3f')]=function(_0x149738,_0x5569b8){var _0x8972de={},_0x244c33={},_0x574ac8={'count':0x0,'rows':[]};var _0x169797=_[_0xe0c6('0x40')](db['ChatMessage'][_0xe0c6('0x41')],function(_0x16b84a){return{'name':_0x16b84a[_0xe0c6('0x42')],'type':_0x16b84a['type']['key']};});_0x244c33[_0xe0c6('0x43')]=_['map'](_0x169797,'name');_0x244c33[_0xe0c6('0x44')]=_[_0xe0c6('0x45')](_0x149738[_0xe0c6('0x44')]);_0x244c33[_0xe0c6('0x46')]=_['intersection'](_0x244c33[_0xe0c6('0x43')],_0x244c33[_0xe0c6('0x44')]);_0x8972de[_0xe0c6('0x47')]=_[_0xe0c6('0x48')](_0x244c33[_0xe0c6('0x43')],qs[_0xe0c6('0x49')](_0x149738[_0xe0c6('0x44')]['fields']));_0x8972de['attributes']=_0x8972de['attributes'][_0xe0c6('0x4a')]?_0x8972de['attributes']:_0x244c33[_0xe0c6('0x43')];if(!_0x149738[_0xe0c6('0x44')][_0xe0c6('0x4b')]('nolimit')){_0x8972de[_0xe0c6('0x32')]=qs[_0xe0c6('0x32')](_0x149738[_0xe0c6('0x44')][_0xe0c6('0x32')]);_0x8972de['offset']=qs[_0xe0c6('0x30')](_0x149738[_0xe0c6('0x44')][_0xe0c6('0x30')]);}_0x8972de[_0xe0c6('0x4c')]=qs[_0xe0c6('0x4d')](_0x149738['query'][_0xe0c6('0x4d')]);_0x8972de[_0xe0c6('0x4e')]=qs[_0xe0c6('0x46')](_['pick'](_0x149738[_0xe0c6('0x44')],_0x244c33[_0xe0c6('0x46')]),_0x169797);if(_0x149738[_0xe0c6('0x44')][_0xe0c6('0x4f')]){_0x8972de['where']=_['merge'](_0x8972de[_0xe0c6('0x4e')],{'$or':_[_0xe0c6('0x40')](_0x169797,function(_0x4eb6b1){if(_0x4eb6b1['type']!==_0xe0c6('0x50')){var _0x3715e7={};_0x3715e7[_0x4eb6b1[_0xe0c6('0x3d')]]={'$like':'%'+_0x149738[_0xe0c6('0x44')][_0xe0c6('0x4f')]+'%'};return _0x3715e7;}})});}_0x8972de=_[_0xe0c6('0x51')]({},_0x8972de,_0x149738[_0xe0c6('0x52')]);var _0x31071b={'where':_0x8972de[_0xe0c6('0x4e')]};return db[_0xe0c6('0x53')][_0xe0c6('0x33')](_0x31071b)[_0xe0c6('0x22')](function(_0x319aa2){_0x574ac8[_0xe0c6('0x33')]=_0x319aa2;if(_0x149738[_0xe0c6('0x44')][_0xe0c6('0x54')]){_0x8972de[_0xe0c6('0x55')]=[{'all':!![]}];}return db[_0xe0c6('0x53')]['findAll'](_0x8972de);})[_0xe0c6('0x22')](function(_0x25f1e3){_0x574ac8[_0xe0c6('0x56')]=_0x25f1e3;return _0x574ac8;})[_0xe0c6('0x22')](respondWithFilteredResult(_0x5569b8,_0x8972de))['catch'](handleError(_0x5569b8,null));};exports['show']=function(_0x3b2e7b,_0xcc16d5){var _0x2b7e4c={'raw':!![],'where':{'id':_0x3b2e7b['params']['id']}},_0x42bf6f={};_0x42bf6f[_0xe0c6('0x43')]=_['keys'](db[_0xe0c6('0x53')]['rawAttributes']);_0x42bf6f[_0xe0c6('0x44')]=_[_0xe0c6('0x45')](_0x3b2e7b[_0xe0c6('0x44')]);_0x42bf6f[_0xe0c6('0x46')]=_[_0xe0c6('0x48')](_0x42bf6f[_0xe0c6('0x43')],_0x42bf6f[_0xe0c6('0x44')]);_0x2b7e4c[_0xe0c6('0x47')]=_[_0xe0c6('0x48')](_0x42bf6f[_0xe0c6('0x43')],qs['fields'](_0x3b2e7b[_0xe0c6('0x44')]['fields']));_0x2b7e4c[_0xe0c6('0x47')]=_0x2b7e4c[_0xe0c6('0x47')][_0xe0c6('0x4a')]?_0x2b7e4c[_0xe0c6('0x47')]:_0x42bf6f[_0xe0c6('0x43')];if(_0x3b2e7b[_0xe0c6('0x44')][_0xe0c6('0x54')]){_0x2b7e4c[_0xe0c6('0x55')]=[{'all':!![]}];}_0x2b7e4c=_[_0xe0c6('0x51')]({},_0x2b7e4c,_0x3b2e7b[_0xe0c6('0x52')]);return db[_0xe0c6('0x53')][_0xe0c6('0x57')](_0x2b7e4c)[_0xe0c6('0x22')](handleEntityNotFound(_0xcc16d5,null))[_0xe0c6('0x22')](respondWithResult(_0xcc16d5,null))[_0xe0c6('0x2c')](handleError(_0xcc16d5,null));};exports[_0xe0c6('0x58')]=function(_0x12cbf4,_0x517430){return db['ChatMessage'][_0xe0c6('0x58')](_0x12cbf4[_0xe0c6('0x59')],{})[_0xe0c6('0x22')](respondWithResult(_0x517430,0xc9))[_0xe0c6('0x2c')](handleError(_0x517430,null));};exports[_0xe0c6('0x3a')]=function(_0x2e2544,_0x1055fd){if(_0x2e2544[_0xe0c6('0x59')]['id']){delete _0x2e2544[_0xe0c6('0x59')]['id'];}return db['ChatMessage'][_0xe0c6('0x57')]({'where':{'id':_0x2e2544[_0xe0c6('0x5a')]['id']}})[_0xe0c6('0x22')](handleEntityNotFound(_0x1055fd,null))[_0xe0c6('0x22')](saveUpdates(_0x2e2544[_0xe0c6('0x59')],null))[_0xe0c6('0x22')](respondWithResult(_0x1055fd,null))['catch'](handleError(_0x1055fd,null));};exports[_0xe0c6('0x3b')]=function(_0x279c4b,_0x4c7b25){return db[_0xe0c6('0x53')][_0xe0c6('0x57')]({'where':{'id':_0x279c4b[_0xe0c6('0x5a')]['id']}})[_0xe0c6('0x22')](handleEntityNotFound(_0x4c7b25,null))[_0xe0c6('0x22')](removeEntity(_0x4c7b25,null))[_0xe0c6('0x2c')](handleError(_0x4c7b25,null));};exports[_0xe0c6('0x5b')]=function(_0x3174b5,_0x41e5ea){return db[_0xe0c6('0x53')][_0xe0c6('0x5b')]()['then'](respondWithResult(_0x41e5ea,null))[_0xe0c6('0x2c')](handleError(_0x41e5ea,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xe0c6('0x5c')]=function(_0x3ec58b,_0x172c37,_0x5155c3){var _0x194893={'agent':{},'channel':_0xe0c6('0x5d')};if(_0x3ec58b['body']['id']){delete _0x3ec58b['body']['id'];}_0x3ec58b[_0xe0c6('0x59')][_0xe0c6('0x5e')]=!![];_0x3ec58b['body'][_0xe0c6('0x5f')]=moment()['format'](_0xe0c6('0x60'));_0x3ec58b[_0xe0c6('0x59')]['UserId']=_0x3ec58b['body'][_0xe0c6('0x61')]||_0x3ec58b[_0xe0c6('0x62')]['id'];_0x194893[_0xe0c6('0x63')]['id']=_0x3ec58b[_0xe0c6('0x59')][_0xe0c6('0x61')];return db[_0xe0c6('0x53')][_0xe0c6('0x57')]({'where':{'id':_0x3ec58b[_0xe0c6('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x172c37,null))[_0xe0c6('0x22')](saveUpdates(_0x3ec58b[_0xe0c6('0x59')],null))['then'](function(_0x144257){if(_0x144257){_0x194893[_0xe0c6('0x2a')]=_0x144257[_0xe0c6('0x64')]({'plain':!![]});return db[_0xe0c6('0x65')][_0xe0c6('0x57')]({'where':{'id':_0x144257[_0xe0c6('0x66')]}});}return null;})[_0xe0c6('0x22')](handleEntityNotFound(_0x172c37,null))['then'](function(_0x481d50){if(_0x481d50){return _0x481d50['update']({'UserId':_0x3ec58b['body']['UserId'],'read1stAt':_['isNil'](_0x481d50[_0xe0c6('0x67')])?moment()[_0xe0c6('0x68')](_0xe0c6('0x60')):undefined});}return null;})[_0xe0c6('0x22')](function(_0x12bbb8){if(_0x12bbb8){_0x194893[_0xe0c6('0x69')]=_0x12bbb8['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ec58b[_0xe0c6('0x62')]['id'],_0x3ec58b['user'][_0xe0c6('0x3d')],_0x3ec58b[_0xe0c6('0x62')][_0xe0c6('0x6a')],_0x194893[_0xe0c6('0x69')]['id'],_0x3ec58b[_0xe0c6('0x59')]?JSON[_0xe0c6('0x6b')](_0x3ec58b[_0xe0c6('0x59')]):_0xe0c6('0x6c'));return respondWithRpcPromise(_0xe0c6('0x6d'),_0xe0c6('0x6e'),_0x194893);}return null;})[_0xe0c6('0x22')](function(_0x479432){var _0x1a1d5e=_0xe0c6('0x6f')+_0x479432['message'][_0xe0c6('0x70')];return db['sequelize'][_0xe0c6('0x44')](_0x1a1d5e,{'type':db[_0xe0c6('0x71')][_0xe0c6('0x72')][_0xe0c6('0x73')],'raw':!![]})[_0xe0c6('0x22')](function(_0x13dd9a){return _0x13dd9a;});})[_0xe0c6('0x22')](function(_0x5a5d4c){if(_0x5a5d4c){_0x194893[_0xe0c6('0x2a')][_0xe0c6('0x74')]=_0x5a5d4c[0x0];if(!_0x3ec58b[_0xe0c6('0x59')][_0xe0c6('0x61')])return;return db[_0xe0c6('0x75')][_0xe0c6('0x57')]({'where':{'id':_0x3ec58b['body'][_0xe0c6('0x61')],'role':_0xe0c6('0x63')},'attributes':['id',_0xe0c6('0x3d'),_0xe0c6('0x76'),_0xe0c6('0x77'),_0xe0c6('0x78')],'raw':!![]});}return null;})['then'](function(_0xa26b9e){if(!_0xa26b9e)return null;_0x194893['message'][_0xe0c6('0x63')]=_0xa26b9e;return _0x194893;})['then'](function(_0x13c328){if(_0x13c328){if(_0x3ec58b[_0xe0c6('0x59')]['manual']){_0x194893['message'][_0xe0c6('0x79')]=util[_0xe0c6('0x68')](_0xe0c6('0x7a'),_0x3ec58b[_0xe0c6('0x62')][_0xe0c6('0x3d')]);_0x194893[_0xe0c6('0x2a')][_0xe0c6('0x7b')]=_0x194893[_0xe0c6('0x7b')];_0x194893[_0xe0c6('0x2a')][_0xe0c6('0x7c')]=_0x194893[_0xe0c6('0x7b')];_0x194893['message'][_0xe0c6('0x7d')]='accept';return respondWithRpcPromise(_0xe0c6('0x7e'),'EventManager',{'event':_0xe0c6('0x7f'),'message':_['merge'](_0x194893[_0xe0c6('0x2a')],JSON[_0xe0c6('0x80')](_0x194893[_0xe0c6('0x69')][_0xe0c6('0x81')]))},client9002)[_0xe0c6('0x22')](function(){return _0x194893;});}return _0x194893;}return null;})['then'](respondWithResult(_0x172c37,null))[_0xe0c6('0x2c')](handleError(_0x172c37,null));};var interaction_log=require(_0xe0c6('0x15'))(_0xe0c6('0x82'));exports[_0xe0c6('0x38')]=function(_0x5dbeaa,_0x47889f,_0x36b433){var _0x456c2f={'agent':{},'channel':'chat'};if(_0x5dbeaa['body']['id']){delete _0x5dbeaa['body']['id'];}_0x5dbeaa['body'][_0xe0c6('0x61')]=_0x5dbeaa[_0xe0c6('0x59')][_0xe0c6('0x61')]||_0x5dbeaa[_0xe0c6('0x62')]['id'];_0x456c2f[_0xe0c6('0x63')]['id']=_0x5dbeaa[_0xe0c6('0x59')][_0xe0c6('0x61')];return db[_0xe0c6('0x53')][_0xe0c6('0x57')]({'where':{'id':_0x5dbeaa[_0xe0c6('0x5a')]['id'],'UserId':null}})[_0xe0c6('0x22')](handleEntityNotFound(_0x47889f,null))[_0xe0c6('0x22')](function(_0x3dff5a){if(_0x3dff5a){_0x456c2f[_0xe0c6('0x2a')]=_0x3dff5a[_0xe0c6('0x64')]({'plain':!![]});return db[_0xe0c6('0x65')]['find']({'where':{'id':_0x3dff5a[_0xe0c6('0x66')]}});}return null;})[_0xe0c6('0x22')](handleEntityNotFound(_0x47889f,null))['then'](function(_0x241315){if(_0x241315){_0x456c2f[_0xe0c6('0x69')]=_0x241315[_0xe0c6('0x64')]({'plain':!![]});interaction_log[_0xe0c6('0x23')](_0xe0c6('0x83'),_0x5dbeaa[_0xe0c6('0x62')]['id'],_0x5dbeaa['user'][_0xe0c6('0x3d')],_0x5dbeaa[_0xe0c6('0x62')][_0xe0c6('0x6a')],_0x456c2f[_0xe0c6('0x69')]['id'],_0x5dbeaa[_0xe0c6('0x59')]?JSON[_0xe0c6('0x6b')](_0x5dbeaa[_0xe0c6('0x59')]):_0xe0c6('0x6c'));return respondWithRpcPromise(_0xe0c6('0x84'),_0xe0c6('0x85'),_0x456c2f);}return null;})[_0xe0c6('0x22')](function(_0x27078f){var _0x5e2452=_0xe0c6('0x6f')+_0x27078f[_0xe0c6('0x2a')][_0xe0c6('0x70')];return db[_0xe0c6('0x86')][_0xe0c6('0x44')](_0x5e2452,{'type':db[_0xe0c6('0x71')][_0xe0c6('0x72')][_0xe0c6('0x73')],'raw':!![]})[_0xe0c6('0x22')](function(_0xa9a61e){return _0xa9a61e;});})[_0xe0c6('0x22')](function(_0x1616f7){if(_0x1616f7){_0x456c2f[_0xe0c6('0x2a')][_0xe0c6('0x74')]=_0x1616f7[0x0];if(!_0x5dbeaa[_0xe0c6('0x59')]['UserId'])return;return db['User'][_0xe0c6('0x57')]({'where':{'id':_0x5dbeaa[_0xe0c6('0x59')][_0xe0c6('0x61')],'role':'agent'},'attributes':['id','name',_0xe0c6('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xe0c6('0x22')](function(_0x5dbeb7){if(!_0x5dbeb7)return null;_0x456c2f[_0xe0c6('0x2a')][_0xe0c6('0x63')]=_0x5dbeb7;return _0x456c2f;})[_0xe0c6('0x22')](function(_0x45621d){if(_0x45621d){_0x45621d['message']['interface']=util[_0xe0c6('0x68')](_0xe0c6('0x7a'),_0x5dbeaa[_0xe0c6('0x62')]['name']);_0x45621d['message'][_0xe0c6('0x7b')]=_0x456c2f[_0xe0c6('0x7b')];_0x45621d['message']['motionChannel']=_0x456c2f[_0xe0c6('0x7b')];_0x45621d['message']['event']=_0xe0c6('0x38');respondWithRpcPromise(_0xe0c6('0x7e'),_0xe0c6('0x7e'),{'event':_0xe0c6('0x87'),'message':_[_0xe0c6('0x51')](_0x456c2f[_0xe0c6('0x2a')],JSON['parse'](_0x456c2f[_0xe0c6('0x69')]['formData']))},client9002);return _0x456c2f;}return null;})[_0xe0c6('0x22')](respondWithResult(_0x47889f,null))['catch'](handleError(_0x47889f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index e8058db..489a807 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 _0x543b=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x568022,_0x3954a8){var _0x3e557c=function(_0x190ef4){while(--_0x190ef4){_0x568022['push'](_0x568022['shift']());}};_0x3e557c(++_0x3954a8);}(_0x543b,0x1d6));var _0xb543=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x543b[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xb543('0x0'));var ChatMessage=require(_0xb543('0x1'))['db'][_0xb543('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb543('0x3')](0x0);var events={'afterCreate':_0xb543('0x4'),'afterUpdate':_0xb543('0x5'),'afterDestroy':_0xb543('0x6')};function emitEvent(_0x531592){return function(_0x47640e,_0x481d94,_0x55b006){ChatMessageEvents[_0xb543('0x7')](_0x531592+':'+_0x47640e['id'],_0x47640e);ChatMessageEvents[_0xb543('0x7')](_0x531592,_0x47640e);_0x55b006(null);};}for(var e in events){if(events[_0xb543('0x8')](e)){var event=events[e];ChatMessage[_0xb543('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xd9c0=['../../mysqldb','ChatMessage','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x3340f9,_0x865171){var _0x1e0f47=function(_0x29221a){while(--_0x29221a){_0x3340f9['push'](_0x3340f9['shift']());}};_0x1e0f47(++_0x865171);}(_0xd9c0,0xa1));var _0x0d9c=function(_0x3c8cb9,_0x250f2d){_0x3c8cb9=_0x3c8cb9-0x0;var _0x38ce3d=_0xd9c0[_0x3c8cb9];return _0x38ce3d;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0d9c('0x0'))['db'][_0x0d9c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0d9c('0x2')](0x0);var events={'afterCreate':_0x0d9c('0x3'),'afterUpdate':_0x0d9c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ca37f){return function(_0x524305,_0x2e7381,_0x2d465c){ChatMessageEvents['emit'](_0x4ca37f+':'+_0x524305['id'],_0x524305);ChatMessageEvents['emit'](_0x4ca37f,_0x524305);_0x2d465c(null);};}for(var e in events){if(events[_0x0d9c('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x0d9c('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 5a45a66..821208d 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 _0xf890=['bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','FULLTEXT','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','lodash','util','../../config/logger','api','moment'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xf890,0xa3));var _0x0f89=function(_0x327005,_0x3b2608){_0x327005=_0x327005-0x0;var _0x5211d7=_0xf890[_0x327005];return _0x5211d7;};'use strict';var _=require(_0x0f89('0x0'));var util=require(_0x0f89('0x1'));var logger=require(_0x0f89('0x2'))(_0x0f89('0x3'));var moment=require(_0x0f89('0x4'));var BPromise=require(_0x0f89('0x5'));var rp=require(_0x0f89('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f89('0x7'));var attributes=require(_0x0f89('0x8'));module[_0x0f89('0x9')]=function(_0x5a532e,_0x20e5af){return _0x5a532e[_0x0f89('0xa')](_0x0f89('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x0f89('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5126c1,_0x3ce6e6,_0x421398){var _0x239229=_0x5a532e['models'];var _0x3e8c0f=_0x5126c1['get']({'plain':!![]});if(_0x3e8c0f[_0x0f89('0xd')][_0x0f89('0xe')]()==='in'||_0x3e8c0f[_0x0f89('0xd')][_0x0f89('0xe')]()==='out'&&!_0x3e8c0f[_0x0f89('0xf')]&&!_[_0x0f89('0x10')](_0x3e8c0f[_0x0f89('0x11')])){_0x239229[_0x0f89('0x12')][_0x0f89('0x13')]({'where':{'id':_0x3e8c0f[_0x0f89('0x14')]}})[_0x0f89('0x15')](function(_0x5c0b2e){if(_0x5c0b2e){_0x5c0b2e['update']({'lastMsgAt':_0x3e8c0f[_0x0f89('0x16')],'lastMsgDirection':_0x3e8c0f[_0x0f89('0xd')][_0x0f89('0xe')]()});}})[_0x0f89('0x17')](function(_0x51ea86){console['error'](_0x51ea86);});}_0x421398();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf963=['api','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x29442f,_0x40121f){var _0x32d130=function(_0x32bed6){while(--_0x32bed6){_0x29442f['push'](_0x29442f['shift']());}};_0x32d130(++_0x40121f);}(_0xf963,0x11f));var _0x3f96=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf963[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3f96('0x0'));var util=require(_0x3f96('0x1'));var logger=require(_0x3f96('0x2'))(_0x3f96('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f96('0x4'));var fs=require('fs');var path=require(_0x3f96('0x5'));var rimraf=require(_0x3f96('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f96('0x7'));module['exports']=function(_0x5dbaa0,_0x505ca5){return _0x5dbaa0[_0x3f96('0x8')](_0x3f96('0x9'),attributes,{'tableName':_0x3f96('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3f96('0xb')],'type':_0x3f96('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x78f002,_0x479674,_0x45648a){var _0x2bbbfb=_0x5dbaa0[_0x3f96('0xd')];var _0x1fceea=_0x78f002[_0x3f96('0xe')]({'plain':!![]});if(_0x1fceea[_0x3f96('0xf')][_0x3f96('0x10')]()==='in'||_0x1fceea[_0x3f96('0xf')]['toLowerCase']()===_0x3f96('0x11')&&!_0x1fceea[_0x3f96('0x12')]&&!_[_0x3f96('0x13')](_0x1fceea['UserId'])){_0x2bbbfb[_0x3f96('0x14')][_0x3f96('0x15')]({'where':{'id':_0x1fceea[_0x3f96('0x16')]}})['then'](function(_0x3b06af){if(_0x3b06af){_0x3b06af[_0x3f96('0x17')]({'lastMsgAt':_0x1fceea[_0x3f96('0x18')],'lastMsgDirection':_0x1fceea[_0x3f96('0xf')][_0x3f96('0x10')]()});}})[_0x3f96('0x19')](function(_0x5066c2){console[_0x3f96('0x1a')](_0x5066c2);});}_0x45648a();}},'charset':_0x3f96('0x1b'),'collate':_0x3f96('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 23f19a6..44c5a68 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 _0x23f9=['message','result','catch','CreateChatMessage','ChatMessage','create','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x16a2ea,_0x2a26ab){var _0x508a44=function(_0x55e3ee){while(--_0x55e3ee){_0x16a2ea['push'](_0x16a2ea['shift']());}};_0x508a44(++_0x2a26ab);}(_0x23f9,0x1d7));var _0x923f=function(_0x2a55f9,_0x370727){_0x2a55f9=_0x2a55f9-0x0;var _0x5a4454=_0x23f9[_0x2a55f9];return _0x5a4454;};'use strict';var _=require(_0x923f('0x0'));var util=require(_0x923f('0x1'));var moment=require(_0x923f('0x2'));var BPromise=require(_0x923f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x923f('0x4'));var db=require(_0x923f('0x5'))['db'];var utils=require(_0x923f('0x6'));var logger=require(_0x923f('0x7'))(_0x923f('0x8'));var config=require('../../config/environment');var jayson=require(_0x923f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x923f('0xa')]=_[_0x923f('0xb')](config[_0x923f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x923f('0xc'))(new Redis(config[_0x923f('0xa')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x41c75f,_0x49fa45,_0x2db217){return new BPromise(function(_0x1805c4,_0x4db75b){return client[_0x923f('0xd')](_0x41c75f,_0x2db217)[_0x923f('0xe')](function(_0x32f2eb){logger[_0x923f('0xf')](_0x923f('0x10'),_0x49fa45,_0x923f('0x11'));logger['debug'](_0x923f('0x12'),_0x49fa45,_0x923f('0x11'),JSON[_0x923f('0x13')](_0x32f2eb));if(_0x32f2eb[_0x923f('0x14')]){if(_0x32f2eb[_0x923f('0x14')][_0x923f('0x15')]===0x1f4){logger[_0x923f('0x14')](_0x923f('0x10'),_0x49fa45,_0x32f2eb[_0x923f('0x14')][_0x923f('0x16')]);return _0x4db75b(_0x32f2eb[_0x923f('0x14')][_0x923f('0x16')]);}logger[_0x923f('0x14')](_0x923f('0x10'),_0x49fa45,_0x32f2eb[_0x923f('0x14')][_0x923f('0x16')]);return _0x1805c4(_0x32f2eb[_0x923f('0x14')]['message']);}else{logger[_0x923f('0xf')]('ChatMessage,\x20%s,\x20%s',_0x49fa45,_0x923f('0x11'));_0x1805c4(_0x32f2eb[_0x923f('0x17')][_0x923f('0x16')]);}})[_0x923f('0x18')](function(_0x14c23a){logger[_0x923f('0x14')]('ChatMessage,\x20%s,\x20%s',_0x49fa45,_0x14c23a);_0x4db75b(_0x14c23a);});});}exports[_0x923f('0x19')]=function(_0x105ff4){var _0x410953=this;return new Promise(function(_0x25908f,_0x26c7e5){return db[_0x923f('0x1a')][_0x923f('0x1b')](_0x105ff4['body'],{'raw':_0x105ff4['options']?_0x105ff4['options'][_0x923f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4fdd19){logger[_0x923f('0xf')](_0x923f('0x19'),_0x105ff4);logger['debug']('CreateChatMessage',_0x105ff4,JSON[_0x923f('0x13')](_0x4fdd19));_0x25908f(_0x4fdd19);})[_0x923f('0x18')](function(_0x49c005){logger['error']('CreateChatMessage',_0x49c005[_0x923f('0x16')],_0x105ff4);_0x26c7e5(_0x410953[_0x923f('0x14')](0x1f4,_0x49c005[_0x923f('0x16')]));});});}; \ No newline at end of file +var _0x1f7e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f7e,0xc6));var _0xe1f7=function(_0x415031,_0x32f470){_0x415031=_0x415031-0x0;var _0x22ee53=_0x1f7e[_0x415031];return _0x22ee53;};'use strict';var _=require(_0xe1f7('0x0'));var util=require(_0xe1f7('0x1'));var moment=require(_0xe1f7('0x2'));var BPromise=require(_0xe1f7('0x3'));var rs=require(_0xe1f7('0x4'));var fs=require('fs');var Redis=require(_0xe1f7('0x5'));var db=require(_0xe1f7('0x6'))['db'];var utils=require(_0xe1f7('0x7'));var logger=require(_0xe1f7('0x8'))(_0xe1f7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe1f7('0xa')][_0xe1f7('0xb')]({'port':0x232a});config[_0xe1f7('0xc')]=_['defaults'](config[_0xe1f7('0xc')],{'host':_0xe1f7('0xd'),'port':0x18eb});var socket=require(_0xe1f7('0xe'))(new Redis(config[_0xe1f7('0xc')]));require(_0xe1f7('0xf'))[_0xe1f7('0x10')](socket);function respondWithRpcPromise(_0x2a425c,_0x5b09a0,_0x367826){return new BPromise(function(_0xac9c2b,_0x178abe){return client['request'](_0x2a425c,_0x367826)[_0xe1f7('0x11')](function(_0x208488){logger[_0xe1f7('0x12')]('ChatMessage,\x20%s,\x20%s',_0x5b09a0,_0xe1f7('0x13'));logger['debug'](_0xe1f7('0x14'),_0x5b09a0,'request\x20sent',JSON['stringify'](_0x208488));if(_0x208488[_0xe1f7('0x15')]){if(_0x208488[_0xe1f7('0x15')][_0xe1f7('0x16')]===0x1f4){logger[_0xe1f7('0x15')](_0xe1f7('0x17'),_0x5b09a0,_0x208488[_0xe1f7('0x15')]['message']);return _0x178abe(_0x208488[_0xe1f7('0x15')][_0xe1f7('0x18')]);}logger[_0xe1f7('0x15')](_0xe1f7('0x17'),_0x5b09a0,_0x208488['error'][_0xe1f7('0x18')]);return _0xac9c2b(_0x208488[_0xe1f7('0x15')][_0xe1f7('0x18')]);}else{logger['info'](_0xe1f7('0x17'),_0x5b09a0,_0xe1f7('0x13'));_0xac9c2b(_0x208488[_0xe1f7('0x19')][_0xe1f7('0x18')]);}})[_0xe1f7('0x1a')](function(_0x1ff8c0){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5b09a0,_0x1ff8c0);_0x178abe(_0x1ff8c0);});});}exports[_0xe1f7('0x1b')]=function(_0x53557f){var _0x662464=this;return new Promise(function(_0x6e7d97,_0x154008){return db['ChatMessage'][_0xe1f7('0x1c')](_0x53557f[_0xe1f7('0x1d')],{'raw':_0x53557f['options']?_0x53557f[_0xe1f7('0x1e')][_0xe1f7('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xc2f8b5){logger['info'](_0xe1f7('0x1b'),_0x53557f);logger[_0xe1f7('0x20')]('CreateChatMessage',_0x53557f,JSON['stringify'](_0xc2f8b5));_0x6e7d97(_0xc2f8b5);})['catch'](function(_0x601a45){logger[_0xe1f7('0x15')](_0xe1f7('0x1b'),_0x601a45[_0xe1f7('0x18')],_0x53557f);_0x154008(_0x662464[_0xe1f7('0x15')](0x1f4,_0x601a45[_0xe1f7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 8c12ad6..d320a6f 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 _0x1c3b=['removeListener','./chatMessage.events','save','remove','emit'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x1c3b,0xab));var _0xb1c3=function(_0x23c087,_0x1b37e4){_0x23c087=_0x23c087-0x0;var _0x45f28b=_0x1c3b[_0x23c087];return _0x45f28b;};'use strict';var ChatMessageEvents=require(_0xb1c3('0x0'));var events=[_0xb1c3('0x1'),_0xb1c3('0x2'),'update'];function createListener(_0x4eeac2,_0x28a375){return function(_0x89ce0b){_0x28a375[_0xb1c3('0x3')](_0x4eeac2,_0x89ce0b);};}function removeListener(_0x34dbb5,_0x24d4c0){return function(){ChatMessageEvents[_0xb1c3('0x4')](_0x34dbb5,_0x24d4c0);};}exports['register']=function(_0x472813){for(var _0x62da34=0x0,_0x211254=events['length'];_0x62da34<_0x211254;_0x62da34++){var _0x504fc9=events[_0x62da34];var _0x4ed6cf=createListener('chatMessage:'+_0x504fc9,_0x472813);ChatMessageEvents['on'](_0x504fc9,_0x4ed6cf);}}; \ No newline at end of file +var _0x2eb2=['chatMessage:','save','remove','update','register','length'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2eb2[_0x4e9628];return _0x27bc8c;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x22eb('0x0'),_0x22eb('0x1'),_0x22eb('0x2')];function createListener(_0x1a002b,_0x1dd079){return function(_0xaf32cf){_0x1dd079['emit'](_0x1a002b,_0xaf32cf);};}function removeListener(_0x27732f,_0x4efe67){return function(){ChatMessageEvents['removeListener'](_0x27732f,_0x4efe67);};}exports[_0x22eb('0x3')]=function(_0x10e116){for(var _0x35dd5b=0x0,_0x2a9850=events[_0x22eb('0x4')];_0x35dd5b<_0x2a9850;_0x35dd5b++){var _0x396806=events[_0x35dd5b];var _0x33ddef=createListener(_0x22eb('0x5')+_0x396806,_0x10e116);ChatMessageEvents['on'](_0x396806,_0x33ddef);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 0f16a2a..216da51 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 _0xea88=['reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','/:id/accept','/:id/reject'];(function(_0x193f7c,_0x742fdb){var _0x3b0f95=function(_0x18375e){while(--_0x18375e){_0x193f7c['push'](_0x193f7c['shift']());}};_0x3b0f95(++_0x742fdb);}(_0xea88,0x153));var _0x8ea8=function(_0xbf2b2b,_0x256e96){_0xbf2b2b=_0xbf2b2b-0x0;var _0x5f83ac=_0xea88[_0xbf2b2b];return _0x5f83ac;};'use strict';var multer=require(_0x8ea8('0x0'));var util=require(_0x8ea8('0x1'));var path=require(_0x8ea8('0x2'));var timeout=require(_0x8ea8('0x3'));var express=require(_0x8ea8('0x4'));var router=express[_0x8ea8('0x5')]();var fs_extra=require(_0x8ea8('0x6'));var auth=require(_0x8ea8('0x7'));var interaction=require(_0x8ea8('0x8'));var config=require('../../config/environment');var controller=require(_0x8ea8('0x9'));router[_0x8ea8('0xa')]('/',auth[_0x8ea8('0xb')](),controller[_0x8ea8('0xc')]);router[_0x8ea8('0xa')](_0x8ea8('0xd'),auth[_0x8ea8('0xb')](),controller['describe']);router['get'](_0x8ea8('0xe'),auth[_0x8ea8('0xb')](),controller[_0x8ea8('0xf')]);router[_0x8ea8('0x10')]('/',auth[_0x8ea8('0xb')](),interaction['tracked']('chat','chatmessage:create'),controller['create']);router[_0x8ea8('0x11')](_0x8ea8('0xe'),controller[_0x8ea8('0x12')]);router[_0x8ea8('0x11')](_0x8ea8('0x13'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x8ea8('0x14'),auth['isAuthenticated'](),controller[_0x8ea8('0x15')]);router[_0x8ea8('0x16')](_0x8ea8('0xe'),auth[_0x8ea8('0xb')](),controller[_0x8ea8('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf8cc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','/describe','describe','get','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x7cb97a,_0x363af9){var _0x1bb58e=function(_0x699dea){while(--_0x699dea){_0x7cb97a['push'](_0x7cb97a['shift']());}};_0x1bb58e(++_0x363af9);}(_0xf8cc,0x1ef));var _0xcf8c=function(_0x20c64e,_0xc3e08e){_0x20c64e=_0x20c64e-0x0;var _0x1fc06e=_0xf8cc[_0x20c64e];return _0x1fc06e;};'use strict';var multer=require(_0xcf8c('0x0'));var util=require(_0xcf8c('0x1'));var path=require('path');var timeout=require(_0xcf8c('0x2'));var express=require('express');var router=express[_0xcf8c('0x3')]();var fs_extra=require(_0xcf8c('0x4'));var auth=require(_0xcf8c('0x5'));var interaction=require(_0xcf8c('0x6'));var config=require(_0xcf8c('0x7'));var controller=require(_0xcf8c('0x8'));router['get']('/',auth[_0xcf8c('0x9')](),controller['index']);router['get'](_0xcf8c('0xa'),auth[_0xcf8c('0x9')](),controller[_0xcf8c('0xb')]);router[_0xcf8c('0xc')](_0xcf8c('0xd'),auth['isAuthenticated'](),controller[_0xcf8c('0xe')]);router[_0xcf8c('0xf')]('/',auth[_0xcf8c('0x9')](),interaction[_0xcf8c('0x10')]('chat',_0xcf8c('0x11')),controller[_0xcf8c('0x12')]);router[_0xcf8c('0x13')](_0xcf8c('0xd'),controller[_0xcf8c('0x14')]);router[_0xcf8c('0x13')](_0xcf8c('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xcf8c('0x13')]('/:id/reject',auth[_0xcf8c('0x9')](),controller[_0xcf8c('0x16')]);router[_0xcf8c('0x17')](_0xcf8c('0xd'),auth[_0xcf8c('0x9')](),controller[_0xcf8c('0x18')]);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 8032123..1f44914 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(_0x1516ad,_0x2d4ee7){var _0x30ee36=function(_0x2c622d){while(--_0x2c622d){_0x1516ad['push'](_0x1516ad['shift']());}};_0x30ee36(++_0x2d4ee7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x48d952,_0x26065d){_0x48d952=_0x48d952-0x0;var _0x594455=_0x5f2f[_0x48d952];return _0x594455;};'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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x0b0e[_0x46111d];return _0xe82586;};'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 2fc66ed..261f7ff 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x177a24,_0xcc1afe){_0x177a24=_0x177a24-0x0;var _0x46e21b=_0x7a54[_0x177a24];return _0x46e21b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x7a54,0x106));var _0x47a5=function(_0x6c36f6,_0x5b76b2){_0x6c36f6=_0x6c36f6-0x0;var _0x2d41b2=_0x7a54[_0x6c36f6];return _0x2d41b2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 0145930..8008d5c 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 _0xbd08=['save','remove','emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage'];(function(_0x3285a3,_0x42b059){var _0x38221e=function(_0x463c69){while(--_0x463c69){_0x3285a3['push'](_0x3285a3['shift']());}};_0x38221e(++_0x42b059);}(_0xbd08,0x6e));var _0x8bd0=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xbd08[_0x3fba9f];return _0x192cf1;};'use strict';var EventEmitter=require(_0x8bd0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x8bd0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8bd0('0x2'),'afterUpdate':'update','afterDestroy':_0x8bd0('0x3')};function emitEvent(_0x21dd29){return function(_0x316930,_0x5e9819,_0x2b53bd){ChatOfflineMessageEvents[_0x8bd0('0x4')](_0x21dd29+':'+_0x316930['id'],_0x316930);ChatOfflineMessageEvents['emit'](_0x21dd29,_0x316930);_0x2b53bd(null);};}for(var e in events){if(events[_0x8bd0('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x8bd0('0x6')](e,emitEvent(event));}}module[_0x8bd0('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x0a08=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0x0a08,0x153));var _0x80a0=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x0a08[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x80a0('0x0'));var ChatOfflineMessage=require(_0x80a0('0x1'))['db'][_0x80a0('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x80a0('0x3')](0x0);var events={'afterCreate':_0x80a0('0x4'),'afterUpdate':_0x80a0('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd5656d){return function(_0x5b7b12,_0x439409,_0x176232){ChatOfflineMessageEvents[_0x80a0('0x6')](_0xd5656d+':'+_0x5b7b12['id'],_0x5b7b12);ChatOfflineMessageEvents[_0x80a0('0x6')](_0xd5656d,_0x5b7b12);_0x176232(null);};}for(var e in events){if(events[_0x80a0('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x80a0('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f038495..15a8dea 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 _0x0b3c=['./chatOfflineMessage.attributes','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0xbea524,_0x39555b){var _0x28bc5f=function(_0x2f758d){while(--_0x2f758d){_0xbea524['push'](_0xbea524['shift']());}};_0x28bc5f(++_0x39555b);}(_0x0b3c,0xeb));var _0xc0b3=function(_0x3a5b1f,_0x57ee12){_0x3a5b1f=_0x3a5b1f-0x0;var _0x2e7fe8=_0x0b3c[_0x3a5b1f];return _0x2e7fe8;};'use strict';var attributes=require(_0xc0b3('0x0'));module['exports']=function(_0x27497c){return _0x27497c[_0xc0b3('0x1')](_0xc0b3('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0b3('0x3'),'collate':_0xc0b3('0x4')});}; \ No newline at end of file +var _0x7082=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3f7101,_0x536e58){var _0x7be955=function(_0x5f07c2){while(--_0x5f07c2){_0x3f7101['push'](_0x3f7101['shift']());}};_0x7be955(++_0x536e58);}(_0x7082,0xf5));var _0x2708=function(_0x4e47f7,_0x205e52){_0x4e47f7=_0x4e47f7-0x0;var _0x24b111=_0x7082[_0x4e47f7];return _0x24b111;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x1bfd72){return _0x1bfd72[_0x2708('0x0')](_0x2708('0x1'),attributes,{'tableName':_0x2708('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2708('0x3'),'collate':_0x2708('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 8d1b889..2055c45 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 _0xd241=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x5a0cfb,_0x299792){var _0x3a3558=function(_0x50a1cc){while(--_0x50a1cc){_0x5a0cfb['push'](_0x5a0cfb['shift']());}};_0x3a3558(++_0x299792);}(_0xd241,0x101));var _0x1d24=function(_0x1e5313,_0x4a63ea){_0x1e5313=_0x1e5313-0x0;var _0x41ba4d=_0xd241[_0x1e5313];return _0x41ba4d;};'use strict';var _=require(_0x1d24('0x0'));var util=require('util');var moment=require(_0x1d24('0x1'));var BPromise=require(_0x1d24('0x2'));var rs=require(_0x1d24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d24('0x4'))['db'];var utils=require(_0x1d24('0x5'));var logger=require(_0x1d24('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1d24('0x7'));var client=jayson['client'][_0x1d24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b9f94,_0x238cdf,_0x556a43){return new BPromise(function(_0x25479b,_0x215dad){return client[_0x1d24('0x9')](_0x4b9f94,_0x556a43)['then'](function(_0x59e191){logger[_0x1d24('0xa')](_0x1d24('0xb'),_0x238cdf,_0x1d24('0xc'));logger[_0x1d24('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x238cdf,_0x1d24('0xc'),JSON[_0x1d24('0xe')](_0x59e191));if(_0x59e191[_0x1d24('0xf')]){if(_0x59e191[_0x1d24('0xf')][_0x1d24('0x10')]===0x1f4){logger[_0x1d24('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x238cdf,_0x59e191[_0x1d24('0xf')][_0x1d24('0x11')]);return _0x215dad(_0x59e191[_0x1d24('0xf')][_0x1d24('0x11')]);}logger[_0x1d24('0xf')](_0x1d24('0xb'),_0x238cdf,_0x59e191[_0x1d24('0xf')][_0x1d24('0x11')]);return _0x25479b(_0x59e191[_0x1d24('0xf')]['message']);}else{logger[_0x1d24('0xa')](_0x1d24('0xb'),_0x238cdf,'request\x20sent');_0x25479b(_0x59e191[_0x1d24('0x12')][_0x1d24('0x11')]);}})[_0x1d24('0x13')](function(_0x5c5135){logger['error'](_0x1d24('0xb'),_0x238cdf,_0x5c5135);_0x215dad(_0x5c5135);});});} \ No newline at end of file +var _0x7513=['bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','util','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7513,0x101));var _0x3751=function(_0x44af93,_0x45fa15){_0x44af93=_0x44af93-0x0;var _0x22eef3=_0x7513[_0x44af93];return _0x22eef3;};'use strict';var _=require(_0x3751('0x0'));var util=require(_0x3751('0x1'));var moment=require(_0x3751('0x2'));var BPromise=require(_0x3751('0x3'));var rs=require(_0x3751('0x4'));var fs=require('fs');var Redis=require(_0x3751('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3751('0x6'));var logger=require('../../config/logger')(_0x3751('0x7'));var config=require('../../config/environment');var jayson=require(_0x3751('0x8'));var client=jayson[_0x3751('0x9')][_0x3751('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52b3fe,_0x584340,_0x13073a){return new BPromise(function(_0x58795d,_0x2ae940){return client[_0x3751('0xb')](_0x52b3fe,_0x13073a)['then'](function(_0x2dc662){logger['info'](_0x3751('0xc'),_0x584340,_0x3751('0xd'));logger[_0x3751('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x584340,_0x3751('0xd'),JSON['stringify'](_0x2dc662));if(_0x2dc662[_0x3751('0xf')]){if(_0x2dc662[_0x3751('0xf')]['code']===0x1f4){logger[_0x3751('0xf')](_0x3751('0xc'),_0x584340,_0x2dc662[_0x3751('0xf')][_0x3751('0x10')]);return _0x2ae940(_0x2dc662[_0x3751('0xf')]['message']);}logger[_0x3751('0xf')](_0x3751('0xc'),_0x584340,_0x2dc662[_0x3751('0xf')][_0x3751('0x10')]);return _0x58795d(_0x2dc662[_0x3751('0xf')][_0x3751('0x10')]);}else{logger[_0x3751('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x584340,_0x3751('0xd'));_0x58795d(_0x2dc662[_0x3751('0x12')][_0x3751('0x10')]);}})[_0x3751('0x13')](function(_0xe36b89){logger['error'](_0x3751('0xc'),_0x584340,_0xe36b89);_0x2ae940(_0xe36b89);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 56c5805..bfe456f 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 _0x1e7e=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path'];(function(_0x2064c8,_0x168039){var _0x23af73=function(_0x2a2d10){while(--_0x2a2d10){_0x2064c8['push'](_0x2064c8['shift']());}};_0x23af73(++_0x168039);}(_0x1e7e,0xda));var _0xe1e7=function(_0x173672,_0x8bc880){_0x173672=_0x173672-0x0;var _0x201e46=_0x1e7e[_0x173672];return _0x201e46;};'use strict';var multer=require(_0xe1e7('0x0'));var util=require('util');var path=require(_0xe1e7('0x1'));var timeout=require(_0xe1e7('0x2'));var express=require('express');var router=express[_0xe1e7('0x3')]();var fs_extra=require(_0xe1e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1e7('0x5'));var config=require(_0xe1e7('0x6'));var controller=require(_0xe1e7('0x7'));router[_0xe1e7('0x8')]('/',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xa')]);router['get'](_0xe1e7('0xb'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xc')]);router['get'](_0xe1e7('0xd'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xe')]);router[_0xe1e7('0xf')]('/',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0x10')]);router[_0xe1e7('0x11')](_0xe1e7('0xd'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0x12')]);router['delete'](_0xe1e7('0xd'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2525=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x1302e6,_0x41dcb9){var _0x17a8b9=function(_0x283ecf){while(--_0x283ecf){_0x1302e6['push'](_0x1302e6['shift']());}};_0x17a8b9(++_0x41dcb9);}(_0x2525,0x162));var _0x5252=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x2525[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x5252('0x0'));var util=require('util');var path=require(_0x5252('0x1'));var timeout=require('connect-timeout');var express=require(_0x5252('0x2'));var router=express[_0x5252('0x3')]();var fs_extra=require(_0x5252('0x4'));var auth=require(_0x5252('0x5'));var interaction=require(_0x5252('0x6'));var config=require(_0x5252('0x7'));var controller=require(_0x5252('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5252('0x9')]);router[_0x5252('0xa')](_0x5252('0xb'),auth[_0x5252('0xc')](),controller[_0x5252('0xd')]);router['get'](_0x5252('0xe'),auth['isAuthenticated'](),controller[_0x5252('0xf')]);router[_0x5252('0x10')]('/',auth[_0x5252('0xc')](),controller[_0x5252('0x11')]);router[_0x5252('0x12')]('/:id',auth[_0x5252('0xc')](),controller[_0x5252('0x13')]);router[_0x5252('0x14')](_0x5252('0xe'),auth[_0x5252('0xc')](),controller[_0x5252('0x15')]);module[_0x5252('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index cb56845..398c3a1 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 _0xef41=['STRING','INTEGER','sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xef41,0x121));var _0x1ef4=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0xef41[_0xfb0cfd];return _0x2fd8aa;};'use strict';var Sequelize=require(_0x1ef4('0x0'));module[_0x1ef4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1ef4('0x2')](_0x1ef4('0x3'),_0x1ef4('0x4')),'defaultValue':_0x1ef4('0x3')},'selector':{'type':Sequelize[_0x1ef4('0x5')]},'timeout':{'type':Sequelize[_0x1ef4('0x6')]}}; \ No newline at end of file +var _0xaaff=['INTEGER','exports','STRING','mouseOver','timeout'];(function(_0x382642,_0x2a2aea){var _0x5f33ed=function(_0x36d4e4){while(--_0x36d4e4){_0x382642['push'](_0x382642['shift']());}};_0x5f33ed(++_0x2a2aea);}(_0xaaff,0x100));var _0xfaaf=function(_0x405022,_0x2377a8){_0x405022=_0x405022-0x0;var _0x3b29e7=_0xaaff[_0x405022];return _0x3b29e7;};'use strict';var Sequelize=require('sequelize');module[_0xfaaf('0x0')]={'name':{'type':Sequelize[_0xfaaf('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfaaf('0x2'),_0xfaaf('0x3')),'defaultValue':_0xfaaf('0x2')},'selector':{'type':Sequelize[_0xfaaf('0x1')]},'timeout':{'type':Sequelize[_0xfaaf('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 8568f59..df55f0f 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 _0xc9b0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','catch','create','body','params','eml-format','rimraf'];(function(_0x1ae78b,_0x289a17){var _0x2046c9=function(_0x3f61a1){while(--_0x3f61a1){_0x1ae78b['push'](_0x1ae78b['shift']());}};_0x2046c9(++_0x289a17);}(_0xc9b0,0x143));var _0x0c9b=function(_0x316e51,_0x2be274){_0x316e51=_0x316e51-0x0;var _0x2ae55c=_0xc9b0[_0x316e51];return _0x2ae55c;};'use strict';var emlformat=require(_0x0c9b('0x0'));var rimraf=require(_0x0c9b('0x1'));var zipdir=require(_0x0c9b('0x2'));var jsonpatch=require(_0x0c9b('0x3'));var rp=require(_0x0c9b('0x4'));var moment=require(_0x0c9b('0x5'));var BPromise=require(_0x0c9b('0x6'));var Mustache=require(_0x0c9b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0c9b('0x8'));var csv=require(_0x0c9b('0x9'));var ejs=require(_0x0c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x0c9b('0xb'));var _=require(_0x0c9b('0xc'));var squel=require(_0x0c9b('0xd'));var crypto=require(_0x0c9b('0xe'));var jsforce=require(_0x0c9b('0xf'));var deskjs=require(_0x0c9b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0c9b('0x11'));var authService=require(_0x0c9b('0x12'));var qs=require(_0x0c9b('0x13'));var as=require(_0x0c9b('0x14'));var hardwareService=require(_0x0c9b('0x15'));var logger=require(_0x0c9b('0x16'))('api');var utils=require(_0x0c9b('0x17'));var config=require(_0x0c9b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c9b('0x19'))['db'];function respondWithStatusCode(_0x4acc77,_0x273644){_0x273644=_0x273644||0xcc;return function(_0xe55deb){if(_0xe55deb){return _0x4acc77[_0x0c9b('0x1a')](_0x273644);}return _0x4acc77[_0x0c9b('0x1b')](_0x273644)[_0x0c9b('0x1c')]();};}function respondWithResult(_0x2bc058,_0x291aeb){_0x291aeb=_0x291aeb||0xc8;return function(_0x41603d){if(_0x41603d){return _0x2bc058[_0x0c9b('0x1b')](_0x291aeb)[_0x0c9b('0x1d')](_0x41603d);}};}function respondWithFilteredResult(_0x4daf5e,_0x5967a6){return function(_0x518486){if(_0x518486){var _0x3ac356=typeof _0x5967a6[_0x0c9b('0x1e')]==='undefined'&&typeof _0x5967a6[_0x0c9b('0x1f')]===_0x0c9b('0x20');var _0x3279cd=_0x518486[_0x0c9b('0x21')];var _0x2b2f65=_0x3ac356?0x0:_0x5967a6[_0x0c9b('0x1e')];var _0x39218d=_0x3ac356?_0x518486['count']:_0x5967a6['offset']+_0x5967a6[_0x0c9b('0x1f')];var _0x49d499;if(_0x39218d>=_0x3279cd){_0x39218d=_0x3279cd;_0x49d499=0xc8;}else{_0x49d499=0xce;}_0x4daf5e[_0x0c9b('0x1b')](_0x49d499);return _0x4daf5e[_0x0c9b('0x22')](_0x0c9b('0x23'),_0x2b2f65+'-'+_0x39218d+'/'+_0x3279cd)[_0x0c9b('0x1d')](_0x518486);}return null;};}function patchUpdates(_0x1bf9f1){return function(_0x3d335c){try{jsonpatch[_0x0c9b('0x24')](_0x3d335c,_0x1bf9f1,!![]);}catch(_0x2269d4){return BPromise[_0x0c9b('0x25')](_0x2269d4);}return _0x3d335c[_0x0c9b('0x26')]();};}function saveUpdates(_0x4cc5cc,_0x19f6e2){return function(_0x3dfd64){if(_0x3dfd64){return _0x3dfd64[_0x0c9b('0x27')](_0x4cc5cc)['then'](function(_0x428a74){return _0x428a74;});}return null;};}function removeEntity(_0x37ee51,_0x2409c6){return function(_0x5c83c8){if(_0x5c83c8){return _0x5c83c8[_0x0c9b('0x28')]()['then'](function(){_0x37ee51[_0x0c9b('0x1b')](0xcc)[_0x0c9b('0x1c')]();});}};}function handleEntityNotFound(_0x2d1ce5,_0x1824d2){return function(_0xd0733f){if(!_0xd0733f){_0x2d1ce5[_0x0c9b('0x1a')](0x194);}return _0xd0733f;};}function handleError(_0x29e457,_0x21748a){_0x21748a=_0x21748a||0x1f4;return function(_0x476c59){logger[_0x0c9b('0x29')](_0x476c59[_0x0c9b('0x2a')]);if(_0x476c59['name']){delete _0x476c59['name'];}_0x29e457[_0x0c9b('0x1b')](_0x21748a)[_0x0c9b('0x2b')](_0x476c59);};}exports[_0x0c9b('0x2c')]=function(_0x2c9f63,_0x4ca17d){var _0x361d03={'raw':!![],'where':{'id':_0x2c9f63['params']['id']}},_0x1391d1={};_0x1391d1[_0x0c9b('0x2d')]=_[_0x0c9b('0x2e')](db[_0x0c9b('0x2f')][_0x0c9b('0x30')]);_0x1391d1[_0x0c9b('0x31')]=_[_0x0c9b('0x2e')](_0x2c9f63['query']);_0x1391d1[_0x0c9b('0x32')]=_[_0x0c9b('0x33')](_0x1391d1['model'],_0x1391d1[_0x0c9b('0x31')]);_0x361d03[_0x0c9b('0x34')]=_[_0x0c9b('0x33')](_0x1391d1[_0x0c9b('0x2d')],qs[_0x0c9b('0x35')](_0x2c9f63[_0x0c9b('0x31')][_0x0c9b('0x35')]));_0x361d03[_0x0c9b('0x34')]=_0x361d03[_0x0c9b('0x34')][_0x0c9b('0x36')]?_0x361d03[_0x0c9b('0x34')]:_0x1391d1['model'];if(_0x2c9f63['query'][_0x0c9b('0x37')]){_0x361d03[_0x0c9b('0x38')]=[{'all':!![]}];}_0x361d03=_[_0x0c9b('0x39')]({},_0x361d03,_0x2c9f63[_0x0c9b('0x3a')]);return db[_0x0c9b('0x2f')][_0x0c9b('0x3b')](_0x361d03)[_0x0c9b('0x3c')](handleEntityNotFound(_0x4ca17d,null))[_0x0c9b('0x3c')](respondWithResult(_0x4ca17d,null))[_0x0c9b('0x3d')](handleError(_0x4ca17d,null));};exports[_0x0c9b('0x3e')]=function(_0x535ab7,_0x1a4513){return db['ChatProactiveAction'][_0x0c9b('0x3e')](_0x535ab7[_0x0c9b('0x3f')],{})[_0x0c9b('0x3c')](respondWithResult(_0x1a4513,0xc9))[_0x0c9b('0x3d')](handleError(_0x1a4513,null));};exports[_0x0c9b('0x27')]=function(_0x5b300a,_0x430db5){if(_0x5b300a['body']['id']){delete _0x5b300a['body']['id'];}return db[_0x0c9b('0x2f')]['find']({'where':{'id':_0x5b300a[_0x0c9b('0x40')]['id']}})[_0x0c9b('0x3c')](handleEntityNotFound(_0x430db5,null))[_0x0c9b('0x3c')](saveUpdates(_0x5b300a[_0x0c9b('0x3f')],null))[_0x0c9b('0x3c')](respondWithResult(_0x430db5,null))[_0x0c9b('0x3d')](handleError(_0x430db5,null));};exports[_0x0c9b('0x28')]=function(_0xa12618,_0x26e3ef){return db[_0x0c9b('0x2f')][_0x0c9b('0x3b')]({'where':{'id':_0xa12618[_0x0c9b('0x40')]['id']}})['then'](handleEntityNotFound(_0x26e3ef,null))[_0x0c9b('0x3c')](removeEntity(_0x26e3ef,null))[_0x0c9b('0x3d')](handleError(_0x26e3ef,null));}; \ No newline at end of file +var _0xdd0c=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','include','merge','find','then','create','body','catch','rimraf','zip-dir','fast-json-patch'];(function(_0x2bb882,_0x1db026){var _0x3b190a=function(_0x390bd3){while(--_0x390bd3){_0x2bb882['push'](_0x2bb882['shift']());}};_0x3b190a(++_0x1db026);}(_0xdd0c,0x165));var _0xcdd0=function(_0x5b16ea,_0x1dc0d6){_0x5b16ea=_0x5b16ea-0x0;var _0x13b4f0=_0xdd0c[_0x5b16ea];return _0x13b4f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={'raw':!![],'where':{'id':_0x4074e0[_0xcdd0('0x2a')]['id']}},_0xd6d64f={};_0xd6d64f['model']=_[_0xcdd0('0x2b')](db[_0xcdd0('0x2c')][_0xcdd0('0x2d')]);_0xd6d64f[_0xcdd0('0x2e')]=_[_0xcdd0('0x2b')](_0x4074e0['query']);_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],_0xd6d64f['query']);_0x28084c['attributes']=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],qs[_0xcdd0('0x32')](_0x4074e0['query'][_0xcdd0('0x32')]));_0x28084c[_0xcdd0('0x33')]=_0x28084c['attributes'][_0xcdd0('0x34')]?_0x28084c[_0xcdd0('0x33')]:_0xd6d64f[_0xcdd0('0x31')];if(_0x4074e0[_0xcdd0('0x2e')]['includeAll']){_0x28084c[_0xcdd0('0x35')]=[{'all':!![]}];}_0x28084c=_[_0xcdd0('0x36')]({},_0x28084c,_0x4074e0['options']);return db[_0xcdd0('0x2c')][_0xcdd0('0x37')](_0x28084c)[_0xcdd0('0x38')](handleEntityNotFound(_0x49cfe0,null))[_0xcdd0('0x38')](respondWithResult(_0x49cfe0,null))['catch'](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x39')]=function(_0x358139,_0x95d87f){return db[_0xcdd0('0x2c')][_0xcdd0('0x39')](_0x358139['body'],{})[_0xcdd0('0x38')](respondWithResult(_0x95d87f,0xc9))['catch'](handleError(_0x95d87f,null));};exports['update']=function(_0x4fd705,_0x407725){if(_0x4fd705[_0xcdd0('0x3a')]['id']){delete _0x4fd705[_0xcdd0('0x3a')]['id'];}return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4fd705[_0xcdd0('0x2a')]['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x407725,null))['then'](saveUpdates(_0x4fd705[_0xcdd0('0x3a')],null))[_0xcdd0('0x38')](respondWithResult(_0x407725,null))[_0xcdd0('0x3b')](handleError(_0x407725,null));};exports[_0xcdd0('0x24')]=function(_0x4e6d31,_0x4934a5){return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4e6d31['params']['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x4934a5,null))[_0xcdd0('0x38')](removeEntity(_0x4934a5,null))['catch'](handleError(_0x4934a5,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1fb7609..e14a680 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 _0xe700=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xe700,0x1e4));var _0x0e70=function(_0xd76c91,_0x15257d){_0xd76c91=_0xd76c91-0x0;var _0x245e91=_0xe700[_0xd76c91];return _0x245e91;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var logger=require(_0x0e70('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0e70('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e70('0x4'));var rimraf=require(_0x0e70('0x5'));var config=require(_0x0e70('0x6'));var attributes=require(_0x0e70('0x7'));module[_0x0e70('0x8')]=function(_0x5210af,_0x11188f){return _0x5210af[_0x0e70('0x9')](_0x0e70('0xa'),attributes,{'tableName':_0x0e70('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb3c=['ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x348cac,_0x2758d2){var _0x5b139a=function(_0x4ef0e1){while(--_0x4ef0e1){_0x348cac['push'](_0x348cac['shift']());}};_0x5b139a(++_0x2758d2);}(_0xfb3c,0x1c9));var _0xcfb3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfb3c[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xcfb3('0x0'));var util=require(_0xcfb3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcfb3('0x2'));var BPromise=require(_0xcfb3('0x3'));var rp=require(_0xcfb3('0x4'));var fs=require('fs');var path=require(_0xcfb3('0x5'));var rimraf=require(_0xcfb3('0x6'));var config=require(_0xcfb3('0x7'));var attributes=require(_0xcfb3('0x8'));module[_0xcfb3('0x9')]=function(_0x174208,_0x893b3){return _0x174208[_0xcfb3('0xa')](_0xcfb3('0xb'),attributes,{'tableName':_0xcfb3('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 0bdd05e..86a3145 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 _0x4ad4=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x4ad4,0xb4));var _0x44ad=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4ad4[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x44ad('0x0'));var moment=require(_0x44ad('0x1'));var BPromise=require(_0x44ad('0x2'));var rs=require(_0x44ad('0x3'));var fs=require('fs');var Redis=require(_0x44ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x44ad('0x5'));var logger=require(_0x44ad('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x44ad('0x7'));var client=jayson['client'][_0x44ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a6602,_0x4fa4cb,_0x3f5938){return new BPromise(function(_0x1d234d,_0x1ed16a){return client['request'](_0x1a6602,_0x3f5938)[_0x44ad('0x9')](function(_0x442cff){logger['info'](_0x44ad('0xa'),_0x4fa4cb,'request\x20sent');logger[_0x44ad('0xb')](_0x44ad('0xc'),_0x4fa4cb,_0x44ad('0xd'),JSON[_0x44ad('0xe')](_0x442cff));if(_0x442cff[_0x44ad('0xf')]){if(_0x442cff[_0x44ad('0xf')][_0x44ad('0x10')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4fa4cb,_0x442cff[_0x44ad('0xf')][_0x44ad('0x11')]);return _0x1ed16a(_0x442cff[_0x44ad('0xf')]['message']);}logger['error'](_0x44ad('0xa'),_0x4fa4cb,_0x442cff[_0x44ad('0xf')]['message']);return _0x1d234d(_0x442cff[_0x44ad('0xf')][_0x44ad('0x11')]);}else{logger[_0x44ad('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fa4cb,_0x44ad('0xd'));_0x1d234d(_0x442cff[_0x44ad('0x13')][_0x44ad('0x11')]);}})['catch'](function(_0x29afbb){logger[_0x44ad('0xf')](_0x44ad('0xa'),_0x4fa4cb,_0x29afbb);_0x1ed16a(_0x29afbb);});});} \ No newline at end of file +var _0xe193=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x154dd2,_0x2b9849){var _0x3ec877=function(_0x40db1c){while(--_0x40db1c){_0x154dd2['push'](_0x154dd2['shift']());}};_0x3ec877(++_0x2b9849);}(_0xe193,0x1e5));var _0x3e19=function(_0x5ad5c6,_0x3ae098){_0x5ad5c6=_0x5ad5c6-0x0;var _0xda0deb=_0xe193[_0x5ad5c6];return _0xda0deb;};'use strict';var _=require(_0x3e19('0x0'));var util=require(_0x3e19('0x1'));var moment=require(_0x3e19('0x2'));var BPromise=require(_0x3e19('0x3'));var rs=require(_0x3e19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e19('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e19('0x6'));var config=require(_0x3e19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3e19('0x8')][_0x3e19('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9684e9,_0x1eb784,_0x2a2cc1){return new BPromise(function(_0x4f24c4,_0x59736f){return client[_0x3e19('0xa')](_0x9684e9,_0x2a2cc1)[_0x3e19('0xb')](function(_0xec5324){logger[_0x3e19('0xc')](_0x3e19('0xd'),_0x1eb784,'request\x20sent');logger[_0x3e19('0xe')](_0x3e19('0xf'),_0x1eb784,'request\x20sent',JSON[_0x3e19('0x10')](_0xec5324));if(_0xec5324[_0x3e19('0x11')]){if(_0xec5324['error'][_0x3e19('0x12')]===0x1f4){logger[_0x3e19('0x11')](_0x3e19('0xd'),_0x1eb784,_0xec5324[_0x3e19('0x11')][_0x3e19('0x13')]);return _0x59736f(_0xec5324[_0x3e19('0x11')][_0x3e19('0x13')]);}logger[_0x3e19('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1eb784,_0xec5324['error'][_0x3e19('0x13')]);return _0x4f24c4(_0xec5324['error'][_0x3e19('0x13')]);}else{logger[_0x3e19('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1eb784,_0x3e19('0x14'));_0x4f24c4(_0xec5324['result'][_0x3e19('0x13')]);}})[_0x3e19('0x15')](function(_0x31da5e){logger[_0x3e19('0x11')](_0x3e19('0xd'),_0x1eb784,_0x31da5e);_0x59736f(_0x31da5e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 208371b..3660300 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 _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x1e2343,_0x47bf9f){var _0x19c248=function(_0x1346d9){while(--_0x1346d9){_0x1e2343['push'](_0x1e2343['shift']());}};_0x19c248(++_0x47bf9f);}(_0x814b,0x1a2));var _0xb814=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0x814b[_0x189d3c];return _0x485959;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb138,0x1dd));var _0x8b13=function(_0x2083d3,_0x2983bc){_0x2083d3=_0x2083d3-0x0;var _0x5b5591=_0xb138[_0x2083d3];return _0x5b5591;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 9281d71..a2de393 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 _0x71a6=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x3ab313,_0x4d6b91){var _0x52e13f=function(_0x3e20e9){while(--_0x3e20e9){_0x3ab313['push'](_0x3ab313['shift']());}};_0x52e13f(++_0x4d6b91);}(_0x71a6,0x10e));var _0x671a=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x71a6[_0x380af2];return _0x1789dc;};'use strict';var Sequelize=require('sequelize');module[_0x671a('0x0')]={'name':{'type':Sequelize[_0x671a('0x1')],'unique':_0x671a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x671a('0x1')]},'timeout':{'type':Sequelize[_0x671a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x671a('0x4')](_0x671a('0x5'),_0x671a('0x6'),_0x671a('0x7'))}}; \ No newline at end of file +var _0x8e6e=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x8e6e,0x10b));var _0xe8e6=function(_0x58a058,_0x5965eb){_0x58a058=_0x58a058-0x0;var _0x347664=_0x8e6e[_0x58a058];return _0x347664;};'use strict';var Sequelize=require(_0xe8e6('0x0'));module[_0xe8e6('0x1')]={'name':{'type':Sequelize[_0xe8e6('0x2')],'unique':_0xe8e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe8e6('0x4')](_0xe8e6('0x5'),_0xe8e6('0x6'),_0xe8e6('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index fa6ed34..1aa52df 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 _0xd35e=['userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','value','removeAgents','forEach','addAgents','spread','isArray','userChatQueue:remove','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','UserProfileResource','destroy','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','filters','intersection','attributes','fields','length','includeAll','merge','create','get','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','keys','UserChatQueue','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','map','options','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','findOne','Team','order','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit'];(function(_0x510bd8,_0x46c1e6){var _0xcd6e09=function(_0x4adabe){while(--_0x4adabe){_0x510bd8['push'](_0x510bd8['shift']());}};_0xcd6e09(++_0x46c1e6);}(_0xd35e,0x17e));var _0xed35=function(_0x49d48d,_0xf1fdaa){_0x49d48d=_0x49d48d-0x0;var _0x46e093=_0xd35e[_0x49d48d];return _0x46e093;};'use strict';var BPromise=require('bluebird');var util=require(_0xed35('0x0'));var _=require(_0xed35('0x1'));var squel=require(_0xed35('0x2'));var Redis=require(_0xed35('0x3'));var qs=require(_0xed35('0x4'));var logger=require(_0xed35('0x5'))('api');var config=require(_0xed35('0x6'));var db=require('../../mysqldb')['db'];config[_0xed35('0x7')]=_[_0xed35('0x8')](config[_0xed35('0x7')],{'host':_0xed35('0x9'),'port':0x18eb});var socket=require(_0xed35('0xa'))(new Redis(config[_0xed35('0x7')]));require(_0xed35('0xb'))[_0xed35('0xc')](socket);function respondWithStatusCode(_0x5f387d,_0x297a68){_0x297a68=_0x297a68||0xcc;return function(_0x30e0ad){if(_0x30e0ad){return _0x5f387d[_0xed35('0xd')](_0x297a68);}return _0x5f387d[_0xed35('0xe')](_0x297a68)['end']();};}function respondWithResult(_0x1a66b9,_0x57e36a){_0x57e36a=_0x57e36a||0xc8;return function(_0x2337c9){if(_0x2337c9){return _0x1a66b9[_0xed35('0xe')](_0x57e36a)[_0xed35('0xf')](_0x2337c9);}};}function respondWithFilteredResult(_0x334059,_0x54acfe){return function(_0x42c087){if(_0x42c087){var _0x5818b8=typeof _0x54acfe['offset']===_0xed35('0x10')&&typeof _0x54acfe[_0xed35('0x11')]===_0xed35('0x10');var _0x9f5209=_0x42c087[_0xed35('0x12')];var _0x24b36d=_0x5818b8?0x0:_0x54acfe[_0xed35('0x13')];var _0x496021=_0x5818b8?_0x42c087[_0xed35('0x12')]:_0x54acfe[_0xed35('0x13')]+_0x54acfe['limit'];var _0xfe4249;if(_0x496021>=_0x9f5209){_0x496021=_0x9f5209;_0xfe4249=0xc8;}else{_0xfe4249=0xce;}_0x334059[_0xed35('0xe')](_0xfe4249);return _0x334059[_0xed35('0x14')](_0xed35('0x15'),_0x24b36d+'-'+_0x496021+'/'+_0x9f5209)['json'](_0x42c087);}return null;};}function saveUpdates(_0x7f651e){return function(_0x29f9a0){if(_0x29f9a0){return _0x29f9a0[_0xed35('0x16')](_0x7f651e)[_0xed35('0x17')](function(_0x52b4a6){return _0x52b4a6;});}return null;};}function removeEntity(_0x36cec5){return function(_0x18c61e){if(_0x18c61e){return _0x18c61e['destroy']()[_0xed35('0x17')](function(){var _0x54b4cc=_0x18c61e['get']({'plain':!![]});var _0x2321f5='ChatQueues';return db[_0xed35('0x18')][_0xed35('0x19')]({'where':{'type':_0x2321f5,'resourceId':_0x54b4cc['id']}})['then'](function(){return _0x18c61e;});})[_0xed35('0x17')](function(){_0x36cec5[_0xed35('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474e2f){return function(_0x594af3){if(!_0x594af3){_0x474e2f[_0xed35('0xd')](0x194);}return _0x594af3;};}function handleError(_0x5d19a9,_0x3a4b82){_0x3a4b82=_0x3a4b82||0x1f4;return function(_0x31accf){logger['error'](_0x31accf[_0xed35('0x1a')]);if(_0x31accf['name']){delete _0x31accf[_0xed35('0x1b')];}_0x5d19a9[_0xed35('0xe')](_0x3a4b82)['send'](_0x31accf);};}exports[_0xed35('0x1c')]=function(_0x4c30cd,_0x5156b2){var _0x2170c3={};var _0x2edd46={'count':0x0,'rows':[]};var _0x5992b4=_['map'](db[_0xed35('0x1d')][_0xed35('0x1e')],function(_0x1ccc0e){return{'name':_0x1ccc0e[_0xed35('0x1f')],'type':_0x1ccc0e[_0xed35('0x20')][_0xed35('0x21')]};});_0x2170c3=qs[_0xed35('0x22')](_0x5992b4,_0x4c30cd);var _0x301bdb={'where':_0x2170c3[_0xed35('0x23')]};return db[_0xed35('0x1d')][_0xed35('0x12')](_0x301bdb)[_0xed35('0x17')](function(_0x1d1427){_0x2edd46[_0xed35('0x12')]=_0x1d1427;_0x2170c3[_0xed35('0x24')]=qs['include'](_0x4c30cd[_0xed35('0x25')]);return db[_0xed35('0x1d')]['findAll'](_0x2170c3);})[_0xed35('0x17')](function(_0x3d3c1a){_0x2edd46[_0xed35('0x26')]=_0x3d3c1a;return _0x2edd46;})['then'](respondWithFilteredResult(_0x5156b2,_0x2170c3))[_0xed35('0x27')](handleError(_0x5156b2,null));};exports[_0xed35('0x28')]=function(_0x4a2e3a,_0x3e1560){var _0x41ce87={'raw':!![],'where':{'id':_0x4a2e3a[_0xed35('0x29')]['id']}},_0x38a400={};_0x38a400[_0xed35('0x2a')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x38a400[_0xed35('0x25')]=_['keys'](_0x4a2e3a['query']);_0x38a400[_0xed35('0x2b')]=_[_0xed35('0x2c')](_0x38a400[_0xed35('0x2a')],_0x38a400[_0xed35('0x25')]);_0x41ce87[_0xed35('0x2d')]=_[_0xed35('0x2c')](_0x38a400['model'],qs['fields'](_0x4a2e3a['query'][_0xed35('0x2e')]));_0x41ce87[_0xed35('0x2d')]=_0x41ce87[_0xed35('0x2d')][_0xed35('0x2f')]?_0x41ce87[_0xed35('0x2d')]:_0x38a400[_0xed35('0x2a')];if(_0x4a2e3a[_0xed35('0x25')][_0xed35('0x30')]){_0x41ce87['include']=[{'all':!![]}];}_0x41ce87=_[_0xed35('0x31')]({},_0x41ce87,_0x4a2e3a['options']);return db[_0xed35('0x1d')]['find'](_0x41ce87)[_0xed35('0x17')](handleEntityNotFound(_0x3e1560,null))[_0xed35('0x17')](respondWithResult(_0x3e1560,null))[_0xed35('0x27')](handleError(_0x3e1560,null));};exports[_0xed35('0x32')]=function(_0xb779c9,_0x14c2a1){return db[_0xed35('0x1d')][_0xed35('0x32')](_0xb779c9['body'],{})['then'](function(_0x55c303){var _0x3885d8=_0xb779c9['user'][_0xed35('0x33')]({'plain':!![]});if(!_0x3885d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3885d8[_0xed35('0x34')]===_0xed35('0x35')){var _0x4ea937=_0x55c303[_0xed35('0x33')]({'plain':!![]});var _0x45750d=_0xed35('0x36');return db[_0xed35('0x37')]['find']({'where':{'name':_0x45750d,'userProfileId':_0x3885d8[_0xed35('0x38')]},'raw':!![]})['then'](function(_0x1205a8){if(_0x1205a8&&_0x1205a8[_0xed35('0x39')]===0x0){return db['UserProfileResource'][_0xed35('0x32')]({'name':_0x4ea937[_0xed35('0x1b')],'resourceId':_0x4ea937['id'],'type':_0x1205a8['name'],'sectionId':_0x1205a8['id']},{})[_0xed35('0x17')](function(){return _0x55c303;});}else{return _0x55c303;}})[_0xed35('0x27')](function(_0x5e5d43){logger['error'](_0xed35('0x3a'),_0x5e5d43);throw _0x5e5d43;});}return _0x55c303;})[_0xed35('0x17')](respondWithResult(_0x14c2a1,0xc9))[_0xed35('0x27')](handleError(_0x14c2a1,null));};exports[_0xed35('0x16')]=function(_0x3a00de,_0x1e103e){if(_0x3a00de[_0xed35('0x3b')]['id']){delete _0x3a00de[_0xed35('0x3b')]['id'];}return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x3a00de['params']['id']}})['then'](handleEntityNotFound(_0x1e103e,null))[_0xed35('0x17')](saveUpdates(_0x3a00de[_0xed35('0x3b')],null))[_0xed35('0x17')](respondWithResult(_0x1e103e,null))[_0xed35('0x27')](handleError(_0x1e103e,null));};exports[_0xed35('0x19')]=function(_0x3ee5d1,_0x358066){return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x3ee5d1[_0xed35('0x29')]['id']}})['then'](handleEntityNotFound(_0x358066,null))['then'](removeEntity(_0x358066,null))[_0xed35('0x27')](handleError(_0x358066,null));};exports['describe']=function(_0x29563d,_0x4fff9b){return db[_0xed35('0x1d')][_0xed35('0x3d')]()[_0xed35('0x17')](respondWithResult(_0x4fff9b,null))[_0xed35('0x27')](handleError(_0x4fff9b,null));};exports[_0xed35('0x3e')]=function(_0xb70763,_0x34d9f7){var _0x42b777={'raw':!![],'where':{}},_0x52d589={},_0x574819;return db[_0xed35('0x1d')]['findOne']({'where':{'id':_0xb70763[_0xed35('0x29')]['id']}})[_0xed35('0x17')](handleEntityNotFound(_0x34d9f7,null))[_0xed35('0x17')](function(_0x4263a3){if(_0x4263a3){_0x574819=_0x4263a3['get']({'plain':!![]});_0x52d589['model']=_[_0xed35('0x3f')](db[_0xed35('0x40')][_0xed35('0x1e')]);_0x52d589[_0xed35('0x25')]=_[_0xed35('0x3f')](_0xb70763['query']);_0x52d589[_0xed35('0x2b')]=_[_0xed35('0x2c')](_0x52d589[_0xed35('0x2a')],_0x52d589[_0xed35('0x25')]);_0x42b777[_0xed35('0x2d')]=_['intersection'](_0x52d589['model'],qs[_0xed35('0x2e')](_0xb70763[_0xed35('0x25')][_0xed35('0x2e')]));_0x42b777['attributes']=_0x42b777[_0xed35('0x2d')][_0xed35('0x2f')]?_0x42b777[_0xed35('0x2d')]:_0x52d589[_0xed35('0x2a')];if(!_0xb70763[_0xed35('0x25')][_0xed35('0x41')](_0xed35('0x42'))){_0x42b777[_0xed35('0x11')]=qs[_0xed35('0x11')](_0xb70763[_0xed35('0x25')][_0xed35('0x11')]);_0x42b777['offset']=qs['offset'](_0xb70763[_0xed35('0x25')]['offset']);}_0x42b777['order']=qs[_0xed35('0x43')](_0xb70763[_0xed35('0x25')][_0xed35('0x43')]);_0x42b777['where']=qs[_0xed35('0x2b')](_[_0xed35('0x44')](_0xb70763[_0xed35('0x25')],_0x52d589[_0xed35('0x2b')]));_0x42b777[_0xed35('0x23')][_0xed35('0x45')]=_0x4263a3['id'];if(_0xb70763[_0xed35('0x25')][_0xed35('0x46')]){_0x42b777['where']=_[_0xed35('0x31')](_0x42b777[_0xed35('0x23')],{'$or':_[_0xed35('0x47')](_0x42b777['attributes'],function(_0x10a8fb){var _0x111ac4={};_0x111ac4[_0x10a8fb]={'$like':'%'+_0xb70763[_0xed35('0x25')][_0xed35('0x46')]+'%'};return _0x111ac4;})});}_0x42b777=_['merge']({},_0x42b777,_0xb70763[_0xed35('0x48')]);return db['UserChatQueue'][_0xed35('0x49')](_0x42b777);}})[_0xed35('0x17')](function(_0x1a35ac){if(_0x1a35ac){return db[_0xed35('0x4a')]['findAndCountAll']({'where':{'id':_['map'](_0x1a35ac,_0xed35('0x4b')),'role':_0xed35('0x4c')},'attributes':['id','name',_0xed35('0x4d'),_0xed35('0x4e'),_0xed35('0x4f')]});}})[_0xed35('0x17')](function(_0x2d9699){if(_0x2d9699){return{'count':_0x2d9699[_0xed35('0x12')],'rows':_[_0xed35('0x47')](_0x2d9699[_0xed35('0x26')],function(_0x2fd9ec){return{'membername':_0x2fd9ec[_0xed35('0x1b')],'UserId':_0x2fd9ec['id'],'queue_name':_0x574819[_0xed35('0x1b')],'ChatQueueId':_0x574819['id'],'interface':util['format'](_0xed35('0x50'),'SIP',_0x2fd9ec[_0xed35('0x1b')]),'penalty':0x0,'paused':_0x2fd9ec[_0xed35('0x4d')],'createdAt':_0x2fd9ec[_0xed35('0x4f')],'updatedAt':_0x2fd9ec[_0xed35('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed35('0x17')](respondWithFilteredResult(_0x34d9f7,_0x42b777))[_0xed35('0x27')](handleError(_0x34d9f7,null));};exports[_0xed35('0x51')]=function(_0xcb7fae,_0x11df9b){var _0x75782={};var _0x5d99f0={};var _0x1e2db8;var _0x430020;return db[_0xed35('0x1d')][_0xed35('0x52')]({'where':{'id':_0xcb7fae[_0xed35('0x29')]['id']}})[_0xed35('0x17')](handleEntityNotFound(_0x11df9b,null))['then'](function(_0x17b984){if(_0x17b984){_0x1e2db8=_0x17b984;_0x5d99f0[_0xed35('0x2a')]=_['keys'](db[_0xed35('0x53')][_0xed35('0x1e')]);_0x5d99f0[_0xed35('0x25')]=_[_0xed35('0x3f')](_0xcb7fae[_0xed35('0x25')]);_0x5d99f0[_0xed35('0x2b')]=_[_0xed35('0x2c')](_0x5d99f0['model'],_0x5d99f0['query']);_0x75782[_0xed35('0x2d')]=_['intersection'](_0x5d99f0[_0xed35('0x2a')],qs[_0xed35('0x2e')](_0xcb7fae['query'][_0xed35('0x2e')]));_0x75782[_0xed35('0x2d')]=_0x75782[_0xed35('0x2d')][_0xed35('0x2f')]?_0x75782['attributes']:_0x5d99f0[_0xed35('0x2a')];_0x75782[_0xed35('0x54')]=qs[_0xed35('0x43')](_0xcb7fae[_0xed35('0x25')][_0xed35('0x43')]);_0x75782[_0xed35('0x23')]=qs[_0xed35('0x2b')](_[_0xed35('0x44')](_0xcb7fae[_0xed35('0x25')],_0x5d99f0[_0xed35('0x2b')]));if(_0xcb7fae[_0xed35('0x25')][_0xed35('0x46')]){_0x75782[_0xed35('0x23')]=_[_0xed35('0x31')](_0x75782[_0xed35('0x23')],{'$or':_[_0xed35('0x47')](_0x75782[_0xed35('0x2d')],function(_0x1ea043){var _0x6a3cb5={};_0x6a3cb5[_0x1ea043]={'$like':'%'+_0xcb7fae['query'][_0xed35('0x46')]+'%'};return _0x6a3cb5;})});}_0x75782=_[_0xed35('0x31')]({},_0x75782,_0xcb7fae[_0xed35('0x48')]);return _0x1e2db8[_0xed35('0x51')](_0x75782);}})[_0xed35('0x17')](function(_0x3cdbb7){if(_0x3cdbb7){_0x430020=_0x3cdbb7['length'];if(!_0xcb7fae['query'][_0xed35('0x41')](_0xed35('0x42'))){_0x75782[_0xed35('0x11')]=qs[_0xed35('0x11')](_0xcb7fae['query'][_0xed35('0x11')]);_0x75782[_0xed35('0x13')]=qs[_0xed35('0x13')](_0xcb7fae[_0xed35('0x25')][_0xed35('0x13')]);}return _0x1e2db8[_0xed35('0x51')](_0x75782);}})[_0xed35('0x17')](function(_0x30e243){if(_0x30e243){return _0x30e243?{'count':_0x430020,'rows':_0x30e243}:null;}})[_0xed35('0x17')](respondWithResult(_0x11df9b,null))[_0xed35('0x27')](handleError(_0x11df9b,null));};exports['addTeams']=function(_0x3ca422,_0x57ae88){var _0x153923=_0x3ca422[_0xed35('0x3b')][_0xed35('0x55')];return db[_0xed35('0x53')][_0xed35('0x49')]({'where':{'id':_0x153923},'attributes':['id'],'include':[{'model':db[_0xed35('0x4a')],'as':_0xed35('0x56'),'attributes':['id',_0xed35('0x1b'),_0xed35('0x57'),_0xed35('0x58'),'interface'],'raw':!![]}]})['then'](function(_0x32fa1e){if(_0x32fa1e){var _0x2a8bb2=_['flatMap'](_0x32fa1e,function(_0x527027){var _0x3a531e=_0x527027[_0xed35('0x33')]({'plain':!![]});return _0x3a531e[_0xed35('0x56')];});return db['ChatQueue'][_0xed35('0x3c')]({'where':{'id':_0x3ca422[_0xed35('0x29')]['id']}})['then'](function(_0x370b2d){return db[_0xed35('0x59')][_0xed35('0x5a')](function(_0xdaf078){return _0x370b2d['addTeams'](_0x153923,{'transaction':_0xdaf078})[_0xed35('0x17')](function(){return BPromise[_0xed35('0x5b')](_0x2a8bb2,function(_0x4dff47){return db[_0xed35('0x40')][_0xed35('0x5c')]({'where':{'UserId':_0x4dff47['id'],'ChatQueueId':_0x3ca422['params']['id']},'transaction':_0xdaf078});});})[_0xed35('0x17')](function(){_0x2a8bb2['forEach'](function(_0x1b0f1e){socket[_0xed35('0x5d')](_0xed35('0x5e'),{'UserId':_0x1b0f1e['id'],'ChatQueueId':_0x370b2d['id']});});});});});}})['then'](respondWithStatusCode(_0x57ae88,null))[_0xed35('0x27')](handleError(_0x57ae88,null));};exports[_0xed35('0x5f')]=function(_0x18069f,_0x413565){return db[_0xed35('0x53')]['findAll']({'where':{'id':_0x18069f['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xed35('0x4a')],'as':_0xed35('0x56'),'attributes':['id'],'raw':!![]}]})[_0xed35('0x17')](handleEntityNotFound(_0x413565,null))['then'](function(_0x134818){var _0x47c2b1=_[_0xed35('0x47')](_0x134818,'id');var _0x14a1df=[];var _0x29f54f=[];var _0x32246c=squel[_0xed35('0x60')]();_0x32246c[_0xed35('0x61')](_0xed35('0x62'))['from'](_0xed35('0x63'),'tq')['join']('user_has_teams','ut',_0xed35('0x64'))[_0xed35('0x23')](_0xed35('0x65'),_0x18069f['params']['id']);for(var _0x3fb64e=0x0;_0x3fb64e<_0x134818[_0xed35('0x2f')];_0x3fb64e+=0x1){let _0x5f2b30=_0x134818[_0x3fb64e];for(var _0x206c96=0x0;_0x206c96<_0x5f2b30[_0xed35('0x56')][_0xed35('0x2f')];_0x206c96+=0x1){let _0x7fd552=_0x5f2b30['Agents'][_0x206c96];var _0x2794ad=_0x32246c[_0xed35('0x66')]();_0x2794ad[_0xed35('0x23')](_0xed35('0x67'),_0x7fd552['id']);_0x29f54f[_0xed35('0x68')](db[_0xed35('0x59')][_0xed35('0x25')](_0x2794ad[_0xed35('0x69')](),{'type':db[_0xed35('0x59')][_0xed35('0x6a')]['SELECT']})[_0xed35('0x17')](function(_0x2f73a7){if(_0x2f73a7[_0xed35('0x2f')]===0x1){return _0x7fd552['id'];}else{var _0x38be96=_[_0xed35('0x6b')](_[_0xed35('0x47')](_0x2f73a7,_0xed35('0x6c')),function(_0xf8f4b7){return _['includes'](_0x47c2b1,_0xf8f4b7);});if(_0x38be96){return _0x7fd552['id'];}}}));}}return BPromise[_0xed35('0x6d')](_0x29f54f)['then'](function(_0x55e697){_0x14a1df=_(_0x14a1df)[_0xed35('0x6e')](_0x55e697)['compact']()[_0xed35('0x6f')]();return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x18069f['params']['id']}})[_0xed35('0x17')](function(_0x2cd00a){return db['sequelize'][_0xed35('0x5a')](function(_0x5c31ce){return _0x2cd00a[_0xed35('0x5f')](_0x18069f['query'][_0xed35('0x55')],{'transaction':_0x5c31ce})[_0xed35('0x17')](function(){if(!_['isEmpty'](_0x14a1df)){return _0x2cd00a[_0xed35('0x70')](_0x14a1df,{'transaction':_0x5c31ce});}})['then'](function(){_0x14a1df[_0xed35('0x71')](function(_0x3c2d8b){socket['emit']('userChatQueue:remove',{'UserId':_0x3c2d8b,'ChatQueueId':_0x2cd00a['id']});});});});});});})[_0xed35('0x17')](respondWithStatusCode(_0x413565,null))['catch'](handleError(_0x413565,null));};exports[_0xed35('0x72')]=function(_0x21a0db,_0x52acd0){return db[_0xed35('0x1d')]['find']({'where':{'id':_0x21a0db[_0xed35('0x29')]['id']}})['then'](handleEntityNotFound(_0x52acd0,null))['then'](function(_0x3dcc48){if(_0x3dcc48){return _0x3dcc48[_0xed35('0x72')](_0x21a0db[_0xed35('0x3b')][_0xed35('0x55')],_['omit'](_0x21a0db[_0xed35('0x3b')],[_0xed35('0x55'),'id'])||{})[_0xed35('0x73')](function(_0xc58052){for(var _0x448b8c=0x0;_0x448b8c<_0x21a0db[_0xed35('0x3b')][_0xed35('0x55')]['length'];_0x448b8c+=0x1){socket[_0xed35('0x5d')](_0xed35('0x5e'),{'UserId':Number(_0x21a0db[_0xed35('0x3b')][_0xed35('0x55')][_0x448b8c]),'ChatQueueId':Number(_0x21a0db['params']['id'])});}return _0xc58052;});}})['then'](respondWithResult(_0x52acd0,null))['catch'](handleError(_0x52acd0,null));};exports[_0xed35('0x70')]=function(_0x3f83f1,_0x250106){return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x3f83f1[_0xed35('0x29')]['id']}})['then'](handleEntityNotFound(_0x250106,null))[_0xed35('0x17')](function(_0x5d407d){if(_0x5d407d){return _0x5d407d['removeAgents'](_0x3f83f1['query'][_0xed35('0x55')])[_0xed35('0x17')](function(){if(_[_0xed35('0x74')](_0x3f83f1[_0xed35('0x25')][_0xed35('0x55')])){for(var _0x3596a0=0x0;_0x3596a0<_0x3f83f1['query'][_0xed35('0x55')]['length'];_0x3596a0+=0x1){socket[_0xed35('0x5d')](_0xed35('0x75'),{'UserId':Number(_0x3f83f1['query']['ids'][_0x3596a0]),'ChatQueueId':Number(_0x3f83f1[_0xed35('0x29')]['id'])});}}else{socket[_0xed35('0x5d')](_0xed35('0x75'),{'UserId':Number(_0x3f83f1[_0xed35('0x25')][_0xed35('0x55')]),'ChatQueueId':Number(_0x3f83f1[_0xed35('0x29')]['id'])});}});}})[_0xed35('0x17')](respondWithStatusCode(_0x250106,null))[_0xed35('0x27')](handleError(_0x250106,null));};exports[_0xed35('0x76')]=function(_0x517e9a,_0x190e62){var _0x3ed7d3={};var _0x1a5a31={};var _0x1c7c55;var _0x1e4481;return db[_0xed35('0x1d')][_0xed35('0x52')]({'where':{'id':_0x517e9a['params']['id']}})[_0xed35('0x17')](handleEntityNotFound(_0x190e62,null))['then'](function(_0x1f014b){if(_0x1f014b){_0x1c7c55=_0x1f014b;_0x1a5a31[_0xed35('0x2a')]=_[_0xed35('0x3f')](db[_0xed35('0x4a')][_0xed35('0x1e')]);_0x1a5a31[_0xed35('0x25')]=_[_0xed35('0x3f')](_0x517e9a[_0xed35('0x25')]);_0x1a5a31['filters']=_['intersection'](_0x1a5a31[_0xed35('0x2a')],_0x1a5a31[_0xed35('0x25')]);_0x3ed7d3[_0xed35('0x2d')]=_[_0xed35('0x2c')](_0x1a5a31[_0xed35('0x2a')],qs[_0xed35('0x2e')](_0x517e9a[_0xed35('0x25')][_0xed35('0x2e')]));_0x3ed7d3['attributes']=_0x3ed7d3['attributes'][_0xed35('0x2f')]?_0x3ed7d3[_0xed35('0x2d')]:_0x1a5a31[_0xed35('0x2a')];_0x3ed7d3['order']=qs['sort'](_0x517e9a['query'][_0xed35('0x43')]);_0x3ed7d3[_0xed35('0x23')]=qs['filters'](_[_0xed35('0x44')](_0x517e9a['query'],_0x1a5a31[_0xed35('0x2b')]));if(_0x517e9a['query'][_0xed35('0x46')]){_0x3ed7d3[_0xed35('0x23')]=_['merge'](_0x3ed7d3['where'],{'$or':_['map'](_0x3ed7d3[_0xed35('0x2d')],function(_0x2ef8b5){var _0x1c3893={};_0x1c3893[_0x2ef8b5]={'$like':'%'+_0x517e9a[_0xed35('0x25')][_0xed35('0x46')]+'%'};return _0x1c3893;})});}_0x3ed7d3=_[_0xed35('0x31')]({},_0x3ed7d3,_0x517e9a[_0xed35('0x48')]);return _0x1c7c55['getAgents'](_0x3ed7d3);}})[_0xed35('0x17')](function(_0x517e14){if(_0x517e14){_0x1e4481=_0x517e14[_0xed35('0x2f')];if(!_0x517e9a['query'][_0xed35('0x41')](_0xed35('0x42'))){_0x3ed7d3['limit']=qs[_0xed35('0x11')](_0x517e9a[_0xed35('0x25')][_0xed35('0x11')]);_0x3ed7d3[_0xed35('0x13')]=qs[_0xed35('0x13')](_0x517e9a[_0xed35('0x25')][_0xed35('0x13')]);}return _0x1c7c55[_0xed35('0x76')](_0x3ed7d3);}})[_0xed35('0x17')](function(_0x5a5ede){if(_0x5a5ede){return _0x5a5ede?{'count':_0x1e4481,'rows':_0x5a5ede}:null;}})['then'](respondWithResult(_0x190e62,null))[_0xed35('0x27')](handleError(_0x190e62,null));}; \ No newline at end of file +var _0x5906=['status','end','json','undefined','count','offset','limit','Content-Range','update','then','destroy','get','ChatQueues','error','stack','send','index','map','ChatQueue','rawAttributes','fieldName','type','getOptions','include','query','rows','catch','params','keys','filters','model','attributes','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','intersection','nolimit','order','sort','where','pick','ChatQueueId','filter','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:remove','getAgents','hasOwnProperty','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus'];(function(_0x5e8897,_0x299e79){var _0x271b50=function(_0x74267a){while(--_0x74267a){_0x5e8897['push'](_0x5e8897['shift']());}};_0x271b50(++_0x299e79);}(_0x5906,0x162));var _0x6590=function(_0x3fed18,_0x5cd50d){_0x3fed18=_0x3fed18-0x0;var _0x1b9e1d=_0x5906[_0x3fed18];return _0x1b9e1d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0x6590('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x6590('0x1'))(_0x6590('0x2'));var config=require(_0x6590('0x3'));var db=require(_0x6590('0x4'))['db'];config[_0x6590('0x5')]=_[_0x6590('0x6')](config[_0x6590('0x5')],{'host':_0x6590('0x7'),'port':0x18eb});var socket=require(_0x6590('0x8'))(new Redis(config[_0x6590('0x5')]));require(_0x6590('0x9'))[_0x6590('0xa')](socket);function respondWithStatusCode(_0x385817,_0x3392cb){_0x3392cb=_0x3392cb||0xcc;return function(_0x17abd6){if(_0x17abd6){return _0x385817[_0x6590('0xb')](_0x3392cb);}return _0x385817[_0x6590('0xc')](_0x3392cb)[_0x6590('0xd')]();};}function respondWithResult(_0x241224,_0x44f300){_0x44f300=_0x44f300||0xc8;return function(_0x5ac623){if(_0x5ac623){return _0x241224[_0x6590('0xc')](_0x44f300)[_0x6590('0xe')](_0x5ac623);}};}function respondWithFilteredResult(_0x1d30e4,_0x3dd8cf){return function(_0x1fd720){if(_0x1fd720){var _0x3df1be=typeof _0x3dd8cf['offset']===_0x6590('0xf')&&typeof _0x3dd8cf['limit']===_0x6590('0xf');var _0x282776=_0x1fd720[_0x6590('0x10')];var _0x5739e3=_0x3df1be?0x0:_0x3dd8cf[_0x6590('0x11')];var _0x3da431=_0x3df1be?_0x1fd720['count']:_0x3dd8cf[_0x6590('0x11')]+_0x3dd8cf[_0x6590('0x12')];var _0x4317c3;if(_0x3da431>=_0x282776){_0x3da431=_0x282776;_0x4317c3=0xc8;}else{_0x4317c3=0xce;}_0x1d30e4[_0x6590('0xc')](_0x4317c3);return _0x1d30e4['set'](_0x6590('0x13'),_0x5739e3+'-'+_0x3da431+'/'+_0x282776)[_0x6590('0xe')](_0x1fd720);}return null;};}function saveUpdates(_0x314110){return function(_0x44f760){if(_0x44f760){return _0x44f760[_0x6590('0x14')](_0x314110)[_0x6590('0x15')](function(_0x34cc9b){return _0x34cc9b;});}return null;};}function removeEntity(_0x38ff2e){return function(_0x2483db){if(_0x2483db){return _0x2483db[_0x6590('0x16')]()['then'](function(){var _0x4ac289=_0x2483db[_0x6590('0x17')]({'plain':!![]});var _0x484804=_0x6590('0x18');return db['UserProfileResource'][_0x6590('0x16')]({'where':{'type':_0x484804,'resourceId':_0x4ac289['id']}})[_0x6590('0x15')](function(){return _0x2483db;});})[_0x6590('0x15')](function(){_0x38ff2e[_0x6590('0xc')](0xcc)[_0x6590('0xd')]();});}};}function handleEntityNotFound(_0x4669da){return function(_0x5a7191){if(!_0x5a7191){_0x4669da[_0x6590('0xb')](0x194);}return _0x5a7191;};}function handleError(_0x2e2c2c,_0x154b1d){_0x154b1d=_0x154b1d||0x1f4;return function(_0x273c76){logger[_0x6590('0x19')](_0x273c76[_0x6590('0x1a')]);if(_0x273c76['name']){delete _0x273c76['name'];}_0x2e2c2c[_0x6590('0xc')](_0x154b1d)[_0x6590('0x1b')](_0x273c76);};}exports[_0x6590('0x1c')]=function(_0x5e359d,_0x5c1b81){var _0x5c8218={};var _0x4346ab={'count':0x0,'rows':[]};var _0x50b437=_[_0x6590('0x1d')](db[_0x6590('0x1e')][_0x6590('0x1f')],function(_0x44198b){return{'name':_0x44198b[_0x6590('0x20')],'type':_0x44198b[_0x6590('0x21')]['key']};});_0x5c8218=qs[_0x6590('0x22')](_0x50b437,_0x5e359d);var _0x841688={'where':_0x5c8218['where']};return db[_0x6590('0x1e')][_0x6590('0x10')](_0x841688)[_0x6590('0x15')](function(_0x65b5b7){_0x4346ab[_0x6590('0x10')]=_0x65b5b7;_0x5c8218[_0x6590('0x23')]=qs['include'](_0x5e359d[_0x6590('0x24')]);return db['ChatQueue']['findAll'](_0x5c8218);})[_0x6590('0x15')](function(_0x1550ae){_0x4346ab[_0x6590('0x25')]=_0x1550ae;return _0x4346ab;})['then'](respondWithFilteredResult(_0x5c1b81,_0x5c8218))[_0x6590('0x26')](handleError(_0x5c1b81,null));};exports['show']=function(_0x251bb8,_0x24f1cd){var _0x7d1b0f={'raw':!![],'where':{'id':_0x251bb8[_0x6590('0x27')]['id']}},_0x1fd4b7={};_0x1fd4b7['model']=_[_0x6590('0x28')](db['ChatQueue']['rawAttributes']);_0x1fd4b7[_0x6590('0x24')]=_['keys'](_0x251bb8[_0x6590('0x24')]);_0x1fd4b7[_0x6590('0x29')]=_['intersection'](_0x1fd4b7[_0x6590('0x2a')],_0x1fd4b7[_0x6590('0x24')]);_0x7d1b0f[_0x6590('0x2b')]=_['intersection'](_0x1fd4b7['model'],qs[_0x6590('0x2c')](_0x251bb8['query'][_0x6590('0x2c')]));_0x7d1b0f['attributes']=_0x7d1b0f[_0x6590('0x2b')][_0x6590('0x2d')]?_0x7d1b0f[_0x6590('0x2b')]:_0x1fd4b7[_0x6590('0x2a')];if(_0x251bb8['query']['includeAll']){_0x7d1b0f[_0x6590('0x23')]=[{'all':!![]}];}_0x7d1b0f=_[_0x6590('0x2e')]({},_0x7d1b0f,_0x251bb8[_0x6590('0x2f')]);return db[_0x6590('0x1e')][_0x6590('0x30')](_0x7d1b0f)[_0x6590('0x15')](handleEntityNotFound(_0x24f1cd,null))['then'](respondWithResult(_0x24f1cd,null))[_0x6590('0x26')](handleError(_0x24f1cd,null));};exports[_0x6590('0x31')]=function(_0x3848fc,_0x49c7f8){return db['ChatQueue']['create'](_0x3848fc[_0x6590('0x32')],{})[_0x6590('0x15')](function(_0x1cbe39){var _0x4e8b06=_0x3848fc[_0x6590('0x33')][_0x6590('0x17')]({'plain':!![]});if(!_0x4e8b06)throw new Error(_0x6590('0x34'));if(_0x4e8b06[_0x6590('0x35')]===_0x6590('0x33')){var _0x2956b5=_0x1cbe39['get']({'plain':!![]});var _0x16b0ec=_0x6590('0x18');return db[_0x6590('0x36')][_0x6590('0x30')]({'where':{'name':_0x16b0ec,'userProfileId':_0x4e8b06[_0x6590('0x37')]},'raw':!![]})[_0x6590('0x15')](function(_0xef5cea){if(_0xef5cea&&_0xef5cea[_0x6590('0x38')]===0x0){return db[_0x6590('0x39')]['create']({'name':_0x2956b5[_0x6590('0x3a')],'resourceId':_0x2956b5['id'],'type':_0xef5cea[_0x6590('0x3a')],'sectionId':_0xef5cea['id']},{})[_0x6590('0x15')](function(){return _0x1cbe39;});}else{return _0x1cbe39;}})[_0x6590('0x26')](function(_0x237b33){logger['error'](_0x6590('0x3b'),_0x237b33);throw _0x237b33;});}return _0x1cbe39;})['then'](respondWithResult(_0x49c7f8,0xc9))[_0x6590('0x26')](handleError(_0x49c7f8,null));};exports[_0x6590('0x14')]=function(_0xb55e3a,_0x42ebeb){if(_0xb55e3a[_0x6590('0x32')]['id']){delete _0xb55e3a[_0x6590('0x32')]['id'];}return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0xb55e3a[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x42ebeb,null))[_0x6590('0x15')](saveUpdates(_0xb55e3a['body'],null))[_0x6590('0x15')](respondWithResult(_0x42ebeb,null))[_0x6590('0x26')](handleError(_0x42ebeb,null));};exports[_0x6590('0x16')]=function(_0x946426,_0x4164fb){return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x946426[_0x6590('0x27')]['id']}})['then'](handleEntityNotFound(_0x4164fb,null))[_0x6590('0x15')](removeEntity(_0x4164fb,null))['catch'](handleError(_0x4164fb,null));};exports[_0x6590('0x3c')]=function(_0x3dcc64,_0x5d2bf9){return db[_0x6590('0x1e')][_0x6590('0x3c')]()[_0x6590('0x15')](respondWithResult(_0x5d2bf9,null))['catch'](handleError(_0x5d2bf9,null));};exports['getMembers']=function(_0x172ea4,_0x120e0f){var _0x5daa0a={'raw':!![],'where':{}},_0x1a1b99={},_0x3889db;return db[_0x6590('0x1e')][_0x6590('0x3d')]({'where':{'id':_0x172ea4[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x120e0f,null))[_0x6590('0x15')](function(_0x439fd1){if(_0x439fd1){_0x3889db=_0x439fd1[_0x6590('0x17')]({'plain':!![]});_0x1a1b99[_0x6590('0x2a')]=_[_0x6590('0x28')](db[_0x6590('0x3e')]['rawAttributes']);_0x1a1b99[_0x6590('0x24')]=_[_0x6590('0x28')](_0x172ea4[_0x6590('0x24')]);_0x1a1b99['filters']=_[_0x6590('0x3f')](_0x1a1b99[_0x6590('0x2a')],_0x1a1b99['query']);_0x5daa0a[_0x6590('0x2b')]=_[_0x6590('0x3f')](_0x1a1b99[_0x6590('0x2a')],qs[_0x6590('0x2c')](_0x172ea4[_0x6590('0x24')][_0x6590('0x2c')]));_0x5daa0a[_0x6590('0x2b')]=_0x5daa0a[_0x6590('0x2b')][_0x6590('0x2d')]?_0x5daa0a['attributes']:_0x1a1b99[_0x6590('0x2a')];if(!_0x172ea4[_0x6590('0x24')]['hasOwnProperty'](_0x6590('0x40'))){_0x5daa0a['limit']=qs['limit'](_0x172ea4['query'][_0x6590('0x12')]);_0x5daa0a[_0x6590('0x11')]=qs[_0x6590('0x11')](_0x172ea4[_0x6590('0x24')][_0x6590('0x11')]);}_0x5daa0a[_0x6590('0x41')]=qs[_0x6590('0x42')](_0x172ea4['query'][_0x6590('0x42')]);_0x5daa0a[_0x6590('0x43')]=qs[_0x6590('0x29')](_[_0x6590('0x44')](_0x172ea4[_0x6590('0x24')],_0x1a1b99[_0x6590('0x29')]));_0x5daa0a[_0x6590('0x43')][_0x6590('0x45')]=_0x439fd1['id'];if(_0x172ea4[_0x6590('0x24')][_0x6590('0x46')]){_0x5daa0a[_0x6590('0x43')]=_[_0x6590('0x2e')](_0x5daa0a['where'],{'$or':_[_0x6590('0x1d')](_0x5daa0a[_0x6590('0x2b')],function(_0x4391eb){var _0x10703f={};_0x10703f[_0x4391eb]={'$like':'%'+_0x172ea4[_0x6590('0x24')][_0x6590('0x46')]+'%'};return _0x10703f;})});}_0x5daa0a=_[_0x6590('0x2e')]({},_0x5daa0a,_0x172ea4[_0x6590('0x2f')]);return db[_0x6590('0x3e')]['findAll'](_0x5daa0a);}})[_0x6590('0x15')](function(_0x2d4183){if(_0x2d4183){return db[_0x6590('0x47')][_0x6590('0x48')]({'where':{'id':_[_0x6590('0x1d')](_0x2d4183,'UserId'),'role':_0x6590('0x49')},'attributes':['id','name',_0x6590('0x4a'),_0x6590('0x4b'),_0x6590('0x4c')]});}})[_0x6590('0x15')](function(_0x332ffd){if(_0x332ffd){return{'count':_0x332ffd[_0x6590('0x10')],'rows':_[_0x6590('0x1d')](_0x332ffd['rows'],function(_0x3cc85e){return{'membername':_0x3cc85e['name'],'UserId':_0x3cc85e['id'],'queue_name':_0x3889db[_0x6590('0x3a')],'ChatQueueId':_0x3889db['id'],'interface':util[_0x6590('0x4d')](_0x6590('0x4e'),'SIP',_0x3cc85e[_0x6590('0x3a')]),'penalty':0x0,'paused':_0x3cc85e['chatPause'],'createdAt':_0x3cc85e[_0x6590('0x4c')],'updatedAt':_0x3cc85e[_0x6590('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6590('0x15')](respondWithFilteredResult(_0x120e0f,_0x5daa0a))[_0x6590('0x26')](handleError(_0x120e0f,null));};exports[_0x6590('0x4f')]=function(_0x4b9a47,_0x31c2dc){var _0x54768a={};var _0x19c5f8={};var _0x22ef9a;var _0x3500c9;return db[_0x6590('0x1e')][_0x6590('0x3d')]({'where':{'id':_0x4b9a47[_0x6590('0x27')]['id']}})['then'](handleEntityNotFound(_0x31c2dc,null))[_0x6590('0x15')](function(_0x336931){if(_0x336931){_0x22ef9a=_0x336931;_0x19c5f8[_0x6590('0x2a')]=_['keys'](db[_0x6590('0x50')][_0x6590('0x1f')]);_0x19c5f8[_0x6590('0x24')]=_[_0x6590('0x28')](_0x4b9a47[_0x6590('0x24')]);_0x19c5f8['filters']=_[_0x6590('0x3f')](_0x19c5f8[_0x6590('0x2a')],_0x19c5f8[_0x6590('0x24')]);_0x54768a['attributes']=_['intersection'](_0x19c5f8['model'],qs[_0x6590('0x2c')](_0x4b9a47[_0x6590('0x24')][_0x6590('0x2c')]));_0x54768a[_0x6590('0x2b')]=_0x54768a[_0x6590('0x2b')][_0x6590('0x2d')]?_0x54768a[_0x6590('0x2b')]:_0x19c5f8['model'];_0x54768a[_0x6590('0x41')]=qs[_0x6590('0x42')](_0x4b9a47[_0x6590('0x24')]['sort']);_0x54768a[_0x6590('0x43')]=qs[_0x6590('0x29')](_[_0x6590('0x44')](_0x4b9a47[_0x6590('0x24')],_0x19c5f8['filters']));if(_0x4b9a47[_0x6590('0x24')][_0x6590('0x46')]){_0x54768a['where']=_['merge'](_0x54768a[_0x6590('0x43')],{'$or':_[_0x6590('0x1d')](_0x54768a['attributes'],function(_0x7c38cb){var _0x2d18cb={};_0x2d18cb[_0x7c38cb]={'$like':'%'+_0x4b9a47[_0x6590('0x24')][_0x6590('0x46')]+'%'};return _0x2d18cb;})});}_0x54768a=_[_0x6590('0x2e')]({},_0x54768a,_0x4b9a47[_0x6590('0x2f')]);return _0x22ef9a[_0x6590('0x4f')](_0x54768a);}})[_0x6590('0x15')](function(_0x57d7e3){if(_0x57d7e3){_0x3500c9=_0x57d7e3[_0x6590('0x2d')];if(!_0x4b9a47[_0x6590('0x24')]['hasOwnProperty']('nolimit')){_0x54768a[_0x6590('0x12')]=qs[_0x6590('0x12')](_0x4b9a47[_0x6590('0x24')][_0x6590('0x12')]);_0x54768a[_0x6590('0x11')]=qs[_0x6590('0x11')](_0x4b9a47[_0x6590('0x24')][_0x6590('0x11')]);}return _0x22ef9a[_0x6590('0x4f')](_0x54768a);}})[_0x6590('0x15')](function(_0x54fbb6){if(_0x54fbb6){return _0x54fbb6?{'count':_0x3500c9,'rows':_0x54fbb6}:null;}})[_0x6590('0x15')](respondWithResult(_0x31c2dc,null))['catch'](handleError(_0x31c2dc,null));};exports[_0x6590('0x51')]=function(_0x4e0ece,_0x1019fe){var _0x53faa9=_0x4e0ece[_0x6590('0x32')][_0x6590('0x52')];return db[_0x6590('0x50')][_0x6590('0x53')]({'where':{'id':_0x53faa9},'attributes':['id'],'include':[{'model':db[_0x6590('0x47')],'as':_0x6590('0x54'),'attributes':['id',_0x6590('0x3a'),_0x6590('0x55'),_0x6590('0x56'),_0x6590('0x57')],'raw':!![]}]})['then'](function(_0x1cda91){if(_0x1cda91){var _0x5333f0=_['flatMap'](_0x1cda91,function(_0x7bde74){var _0x198654=_0x7bde74[_0x6590('0x17')]({'plain':!![]});return _0x198654[_0x6590('0x54')];});return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x4e0ece[_0x6590('0x27')]['id']}})['then'](function(_0xf6d823){return db[_0x6590('0x58')][_0x6590('0x59')](function(_0x393550){return _0xf6d823[_0x6590('0x51')](_0x53faa9,{'transaction':_0x393550})[_0x6590('0x15')](function(){return BPromise[_0x6590('0x5a')](_0x5333f0,function(_0x2a8e9a){return db[_0x6590('0x3e')][_0x6590('0x5b')]({'where':{'UserId':_0x2a8e9a['id'],'ChatQueueId':_0x4e0ece[_0x6590('0x27')]['id']},'transaction':_0x393550});});})[_0x6590('0x15')](function(){_0x5333f0[_0x6590('0x5c')](function(_0x119fe6){socket[_0x6590('0x5d')](_0x6590('0x5e'),{'UserId':_0x119fe6['id'],'ChatQueueId':_0xf6d823['id']});});});});});}})[_0x6590('0x15')](respondWithStatusCode(_0x1019fe,null))[_0x6590('0x26')](handleError(_0x1019fe,null));};exports[_0x6590('0x5f')]=function(_0x5cec8e,_0x3b9b5f){return db['Team'][_0x6590('0x53')]({'where':{'id':_0x5cec8e[_0x6590('0x24')][_0x6590('0x52')]},'attributes':['id'],'include':[{'model':db[_0x6590('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6590('0x15')](handleEntityNotFound(_0x3b9b5f,null))['then'](function(_0x23b801){var _0x31296b=_[_0x6590('0x1d')](_0x23b801,'id');var _0x161306=[];var _0x38989f=[];var _0x1a6ca0=squel[_0x6590('0x60')]();_0x1a6ca0[_0x6590('0x61')](_0x6590('0x62'))['from'](_0x6590('0x63'),'tq')[_0x6590('0x64')](_0x6590('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6590('0x66'),_0x5cec8e[_0x6590('0x27')]['id']);for(var _0x3cb3a6=0x0;_0x3cb3a6<_0x23b801[_0x6590('0x2d')];_0x3cb3a6+=0x1){let _0x561129=_0x23b801[_0x3cb3a6];for(var _0x1e41b=0x0;_0x1e41b<_0x561129['Agents'][_0x6590('0x2d')];_0x1e41b+=0x1){let _0x2837d6=_0x561129['Agents'][_0x1e41b];var _0x40545d=_0x1a6ca0[_0x6590('0x67')]();_0x40545d[_0x6590('0x43')](_0x6590('0x68'),_0x2837d6['id']);_0x38989f[_0x6590('0x69')](db[_0x6590('0x58')]['query'](_0x40545d[_0x6590('0x6a')](),{'type':db['sequelize'][_0x6590('0x6b')][_0x6590('0x6c')]})[_0x6590('0x15')](function(_0x41cda1){if(_0x41cda1[_0x6590('0x2d')]===0x1){return _0x2837d6['id'];}else{var _0x3a2285=_[_0x6590('0x6d')](_[_0x6590('0x1d')](_0x41cda1,_0x6590('0x6e')),function(_0x576da7){return _[_0x6590('0x6f')](_0x31296b,_0x576da7);});if(_0x3a2285){return _0x2837d6['id'];}}}));}}return BPromise['all'](_0x38989f)['then'](function(_0x491037){_0x161306=_(_0x161306)['union'](_0x491037)[_0x6590('0x70')]()[_0x6590('0x71')]();return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x5cec8e[_0x6590('0x27')]['id']}})[_0x6590('0x15')](function(_0x3b8421){return db['sequelize'][_0x6590('0x59')](function(_0x19ead3){return _0x3b8421['removeTeams'](_0x5cec8e['query']['ids'],{'transaction':_0x19ead3})[_0x6590('0x15')](function(){if(!_[_0x6590('0x72')](_0x161306)){return _0x3b8421[_0x6590('0x73')](_0x161306,{'transaction':_0x19ead3});}})[_0x6590('0x15')](function(){_0x161306[_0x6590('0x5c')](function(_0x846eab){socket[_0x6590('0x5d')]('userChatQueue:remove',{'UserId':_0x846eab,'ChatQueueId':_0x3b8421['id']});});});});});});})[_0x6590('0x15')](respondWithStatusCode(_0x3b9b5f,null))[_0x6590('0x26')](handleError(_0x3b9b5f,null));};exports[_0x6590('0x74')]=function(_0x139b6a,_0x30c4dd){return db[_0x6590('0x1e')]['find']({'where':{'id':_0x139b6a[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x30c4dd,null))[_0x6590('0x15')](function(_0x473393){if(_0x473393){return _0x473393[_0x6590('0x74')](_0x139b6a['body'][_0x6590('0x52')],_[_0x6590('0x75')](_0x139b6a[_0x6590('0x32')],['ids','id'])||{})[_0x6590('0x76')](function(_0x560e54){for(var _0x2013c7=0x0;_0x2013c7<_0x139b6a[_0x6590('0x32')][_0x6590('0x52')][_0x6590('0x2d')];_0x2013c7+=0x1){socket['emit'](_0x6590('0x5e'),{'UserId':Number(_0x139b6a[_0x6590('0x32')][_0x6590('0x52')][_0x2013c7]),'ChatQueueId':Number(_0x139b6a[_0x6590('0x27')]['id'])});}return _0x560e54;});}})[_0x6590('0x15')](respondWithResult(_0x30c4dd,null))['catch'](handleError(_0x30c4dd,null));};exports[_0x6590('0x73')]=function(_0x3c3e68,_0x2574ec){return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x3c3e68[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x2574ec,null))[_0x6590('0x15')](function(_0x1f9947){if(_0x1f9947){return _0x1f9947[_0x6590('0x73')](_0x3c3e68[_0x6590('0x24')][_0x6590('0x52')])['then'](function(){if(_['isArray'](_0x3c3e68[_0x6590('0x24')]['ids'])){for(var _0x5dd064=0x0;_0x5dd064<_0x3c3e68[_0x6590('0x24')][_0x6590('0x52')][_0x6590('0x2d')];_0x5dd064+=0x1){socket[_0x6590('0x5d')](_0x6590('0x77'),{'UserId':Number(_0x3c3e68['query'][_0x6590('0x52')][_0x5dd064]),'ChatQueueId':Number(_0x3c3e68[_0x6590('0x27')]['id'])});}}else{socket[_0x6590('0x5d')](_0x6590('0x77'),{'UserId':Number(_0x3c3e68[_0x6590('0x24')][_0x6590('0x52')]),'ChatQueueId':Number(_0x3c3e68['params']['id'])});}});}})[_0x6590('0x15')](respondWithStatusCode(_0x2574ec,null))[_0x6590('0x26')](handleError(_0x2574ec,null));};exports[_0x6590('0x78')]=function(_0x449931,_0x3b8839){var _0x47562f={};var _0x18b747={};var _0x4cb5ef;var _0x3eb36c;return db[_0x6590('0x1e')]['findOne']({'where':{'id':_0x449931['params']['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x3b8839,null))['then'](function(_0x3a731f){if(_0x3a731f){_0x4cb5ef=_0x3a731f;_0x18b747['model']=_[_0x6590('0x28')](db[_0x6590('0x47')][_0x6590('0x1f')]);_0x18b747[_0x6590('0x24')]=_[_0x6590('0x28')](_0x449931['query']);_0x18b747['filters']=_['intersection'](_0x18b747[_0x6590('0x2a')],_0x18b747[_0x6590('0x24')]);_0x47562f[_0x6590('0x2b')]=_['intersection'](_0x18b747[_0x6590('0x2a')],qs[_0x6590('0x2c')](_0x449931['query']['fields']));_0x47562f['attributes']=_0x47562f[_0x6590('0x2b')]['length']?_0x47562f[_0x6590('0x2b')]:_0x18b747['model'];_0x47562f[_0x6590('0x41')]=qs[_0x6590('0x42')](_0x449931[_0x6590('0x24')][_0x6590('0x42')]);_0x47562f[_0x6590('0x43')]=qs['filters'](_['pick'](_0x449931[_0x6590('0x24')],_0x18b747[_0x6590('0x29')]));if(_0x449931[_0x6590('0x24')][_0x6590('0x46')]){_0x47562f[_0x6590('0x43')]=_[_0x6590('0x2e')](_0x47562f[_0x6590('0x43')],{'$or':_[_0x6590('0x1d')](_0x47562f['attributes'],function(_0x368de2){var _0x1e2125={};_0x1e2125[_0x368de2]={'$like':'%'+_0x449931[_0x6590('0x24')][_0x6590('0x46')]+'%'};return _0x1e2125;})});}_0x47562f=_[_0x6590('0x2e')]({},_0x47562f,_0x449931[_0x6590('0x2f')]);return _0x4cb5ef[_0x6590('0x78')](_0x47562f);}})[_0x6590('0x15')](function(_0x1d5e0c){if(_0x1d5e0c){_0x3eb36c=_0x1d5e0c[_0x6590('0x2d')];if(!_0x449931[_0x6590('0x24')][_0x6590('0x79')](_0x6590('0x40'))){_0x47562f[_0x6590('0x12')]=qs[_0x6590('0x12')](_0x449931['query'][_0x6590('0x12')]);_0x47562f[_0x6590('0x11')]=qs[_0x6590('0x11')](_0x449931[_0x6590('0x24')]['offset']);}return _0x4cb5ef[_0x6590('0x78')](_0x47562f);}})[_0x6590('0x15')](function(_0x57d6ca){if(_0x57d6ca){return _0x57d6ca?{'count':_0x3eb36c,'rows':_0x57d6ca}:null;}})[_0x6590('0x15')](respondWithResult(_0x3b8839,null))[_0x6590('0x26')](handleError(_0x3b8839,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 56845b2..59ccc50 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 _0x5a78=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2202cc,_0x2a5a73){var _0x4213c7=function(_0x569056){while(--_0x569056){_0x2202cc['push'](_0x2202cc['shift']());}};_0x4213c7(++_0x2a5a73);}(_0x5a78,0x1ac));var _0x85a7=function(_0x391c38,_0x43bc3d){_0x391c38=_0x391c38-0x0;var _0xbd82e4=_0x5a78[_0x391c38];return _0xbd82e4;};'use strict';var EventEmitter=require(_0x85a7('0x0'));var ChatQueue=require(_0x85a7('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x85a7('0x2')](0x0);var events={'afterCreate':_0x85a7('0x3'),'afterUpdate':'update','afterDestroy':_0x85a7('0x4')};function emitEvent(_0x4d19f4){return function(_0x580f7e,_0x40ad75,_0x3f675b){ChatQueueEvents[_0x85a7('0x5')](_0x4d19f4+':'+_0x580f7e['id'],_0x580f7e);ChatQueueEvents[_0x85a7('0x5')](_0x4d19f4,_0x580f7e);_0x3f675b(null);};}for(var e in events){if(events[_0x85a7('0x6')](e)){var event=events[e];ChatQueue[_0x85a7('0x7')](e,emitEvent(event));}}module[_0x85a7('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xc2a5=['hook','exports','events','ChatQueue','setMaxListeners','emit'];(function(_0x470d01,_0x7729a5){var _0x10be53=function(_0x177e3f){while(--_0x177e3f){_0x470d01['push'](_0x470d01['shift']());}};_0x10be53(++_0x7729a5);}(_0xc2a5,0x1d6));var _0x5c2a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc2a5[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x5c2a('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5c2a('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5c2a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x40570d){return function(_0x44e218,_0x19ddda,_0x25c6c8){ChatQueueEvents[_0x5c2a('0x3')](_0x40570d+':'+_0x44e218['id'],_0x44e218);ChatQueueEvents[_0x5c2a('0x3')](_0x40570d,_0x44e218);_0x25c6c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x5c2a('0x4')](e,emitEvent(event));}}module[_0x5c2a('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index adc4ba3..23161a9 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 _0xfe1a=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0xfe1a,0x1cb));var _0xafe1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfe1a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xafe1('0x0'));var util=require(_0xafe1('0x1'));var logger=require(_0xafe1('0x2'))(_0xafe1('0x3'));var moment=require(_0xafe1('0x4'));var BPromise=require(_0xafe1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafe1('0x6'));var rimraf=require(_0xafe1('0x7'));var config=require('../../config/environment');var attributes=require(_0xafe1('0x8'));module[_0xafe1('0x9')]=function(_0x5217f3,_0x2a0b83){return _0x5217f3[_0xafe1('0xa')](_0xafe1('0xb'),attributes,{'tableName':_0xafe1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e91=['request-promise','../../config/environment','exports','define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5db6fd,_0x265729){var _0x218d95=function(_0x29bff1){while(--_0x29bff1){_0x5db6fd['push'](_0x5db6fd['shift']());}};_0x218d95(++_0x265729);}(_0x6e91,0x73));var _0x16e9=function(_0x3fd6cb,_0xbc9b0c){_0x3fd6cb=_0x3fd6cb-0x0;var _0x20c189=_0x6e91[_0x3fd6cb];return _0x20c189;};'use strict';var _=require(_0x16e9('0x0'));var util=require(_0x16e9('0x1'));var logger=require(_0x16e9('0x2'))(_0x16e9('0x3'));var moment=require(_0x16e9('0x4'));var BPromise=require(_0x16e9('0x5'));var rp=require(_0x16e9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x16e9('0x7'));var attributes=require('./chatQueue.attributes');module[_0x16e9('0x8')]=function(_0x4ecde4,_0x6a63f1){return _0x4ecde4[_0x16e9('0x9')]('ChatQueue',attributes,{'tableName':_0x16e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 656c8cf..bc2a979 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 _0x3d5d=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','include','map','model','attributes','ShowChatQueue','find','lodash','moment'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x3d5d[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var moment=require(_0xd3d5('0x1'));var BPromise=require(_0xd3d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d5('0x3'))['db'];var utils=require(_0xd3d5('0x4'));var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});config[_0xd3d5('0xa')]=_[_0xd3d5('0xb')](config[_0xd3d5('0xa')],{'host':_0xd3d5('0xc'),'port':0x18eb});var socket=require(_0xd3d5('0xd'))(new Redis(config['redis']));require(_0xd3d5('0xe'))['register'](socket);function respondWithRpcPromise(_0x6b10a5,_0x3dd64e,_0x561ca9){return new BPromise(function(_0x30a079,_0x43308d){return client['request'](_0x6b10a5,_0x561ca9)[_0xd3d5('0xf')](function(_0x381d57){logger[_0xd3d5('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3dd64e,'request\x20sent');logger[_0xd3d5('0x11')](_0xd3d5('0x12'),_0x3dd64e,'request\x20sent',JSON[_0xd3d5('0x13')](_0x381d57));if(_0x381d57['error']){if(_0x381d57[_0xd3d5('0x14')][_0xd3d5('0x15')]===0x1f4){logger[_0xd3d5('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3dd64e,_0x381d57['error'][_0xd3d5('0x16')]);return _0x43308d(_0x381d57[_0xd3d5('0x14')]['message']);}logger[_0xd3d5('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3dd64e,_0x381d57[_0xd3d5('0x14')][_0xd3d5('0x16')]);return _0x30a079(_0x381d57[_0xd3d5('0x14')]['message']);}else{logger[_0xd3d5('0x10')](_0xd3d5('0x17'),_0x3dd64e,'request\x20sent');_0x30a079(_0x381d57[_0xd3d5('0x18')]['message']);}})[_0xd3d5('0x19')](function(_0x3c9b37){logger[_0xd3d5('0x14')](_0xd3d5('0x17'),_0x3dd64e,_0x3c9b37);_0x43308d(_0x3c9b37);});});}exports[_0xd3d5('0x1a')]=function(_0x104367){var _0x5d10e4=this;return new Promise(function(_0x4053c5,_0x4893f6){return db[_0xd3d5('0x1b')][_0xd3d5('0x1c')]({'raw':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x1e')]===undefined?!![]:![]:!![],'where':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x1f')]||null:null,'attributes':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')]['attributes']||null:null,'limit':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')]['limit']||null:null,'include':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x20')],function(_0x5dcd2d){return{'model':db[_0x5dcd2d[_0xd3d5('0x22')]],'as':_0x5dcd2d['as'],'attributes':_0x5dcd2d['attributes'],'include':_0x5dcd2d[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x5dcd2d['include'],function(_0x49270d){return{'model':db[_0x49270d[_0xd3d5('0x22')]],'as':_0x49270d['as'],'attributes':_0x49270d[_0xd3d5('0x23')],'include':_0x49270d[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x49270d[_0xd3d5('0x20')],function(_0x41b882){return{'model':db[_0x41b882[_0xd3d5('0x22')]],'as':_0x41b882['as'],'attributes':_0x41b882[_0xd3d5('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3167a8){logger['info'](_0xd3d5('0x1a'),_0x104367);logger['debug'](_0xd3d5('0x1a'),_0x104367,JSON['stringify'](_0x3167a8));_0x4053c5(_0x3167a8);})[_0xd3d5('0x19')](function(_0x472d6c){logger[_0xd3d5('0x14')](_0xd3d5('0x1a'),_0x472d6c[_0xd3d5('0x16')],_0x104367);_0x4893f6(_0x5d10e4[_0xd3d5('0x14')](0x1f4,_0x472d6c[_0xd3d5('0x16')]));});});};exports[_0xd3d5('0x24')]=function(_0x49f071){var _0x25e3ad=this;return new Promise(function(_0x58bb06,_0x274f99){return db[_0xd3d5('0x1b')][_0xd3d5('0x25')]({'raw':_0x49f071[_0xd3d5('0x1d')]?_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x1e')]===undefined?!![]:![]:!![],'where':_0x49f071['options']?_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x1f')]||null:null,'attributes':_0x49f071[_0xd3d5('0x1d')]?_0x49f071['options'][_0xd3d5('0x23')]||null:null,'include':_0x49f071['options']?_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x20')]?_['map'](_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x20')],function(_0xffa54){return{'model':db[_0xffa54[_0xd3d5('0x22')]],'as':_0xffa54['as'],'attributes':_0xffa54[_0xd3d5('0x23')],'include':_0xffa54[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0xffa54[_0xd3d5('0x20')],function(_0x4b3a1b){return{'model':db[_0x4b3a1b['model']],'as':_0x4b3a1b['as'],'attributes':_0x4b3a1b['attributes'],'include':_0x4b3a1b[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x4b3a1b[_0xd3d5('0x20')],function(_0x12fd1d){return{'model':db[_0x12fd1d[_0xd3d5('0x22')]],'as':_0x12fd1d['as'],'attributes':_0x12fd1d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3d5('0xf')](function(_0xb0e19e){logger[_0xd3d5('0x10')](_0xd3d5('0x24'),_0x49f071);logger[_0xd3d5('0x11')](_0xd3d5('0x24'),_0x49f071,JSON[_0xd3d5('0x13')](_0xb0e19e));_0x58bb06(_0xb0e19e);})[_0xd3d5('0x19')](function(_0x123884){logger[_0xd3d5('0x14')](_0xd3d5('0x24'),_0x123884['message'],_0x49f071);_0x274f99(_0x25e3ad[_0xd3d5('0x14')](0x1f4,_0x123884[_0xd3d5('0x16')]));});});}; \ No newline at end of file +var _0x9c1d=['result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x5a24fa,_0x18621c){_0x5a24fa=_0x5a24fa-0x0;var _0x267651=_0x9c1d[_0x5a24fa];return _0x267651;};'use strict';var _=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var moment=require(_0xd9c1('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9c1('0x3'));var fs=require('fs');var Redis=require(_0xd9c1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9c1('0x5'));var logger=require(_0xd9c1('0x6'))('rpc');var config=require(_0xd9c1('0x7'));var jayson=require(_0xd9c1('0x8'));var client=jayson[_0xd9c1('0x9')][_0xd9c1('0xa')]({'port':0x232a});config[_0xd9c1('0xb')]=_[_0xd9c1('0xc')](config[_0xd9c1('0xb')],{'host':_0xd9c1('0xd'),'port':0x18eb});var socket=require(_0xd9c1('0xe'))(new Redis(config['redis']));require(_0xd9c1('0xf'))[_0xd9c1('0x10')](socket);function respondWithRpcPromise(_0x1b0050,_0x19bc13,_0x2f75da){return new BPromise(function(_0x9592c8,_0x3c57e7){return client['request'](_0x1b0050,_0x2f75da)[_0xd9c1('0x11')](function(_0x27336b){logger[_0xd9c1('0x12')]('ChatQueue,\x20%s,\x20%s',_0x19bc13,_0xd9c1('0x13'));logger['debug'](_0xd9c1('0x14'),_0x19bc13,_0xd9c1('0x13'),JSON[_0xd9c1('0x15')](_0x27336b));if(_0x27336b[_0xd9c1('0x16')]){if(_0x27336b[_0xd9c1('0x16')][_0xd9c1('0x17')]===0x1f4){logger[_0xd9c1('0x16')](_0xd9c1('0x18'),_0x19bc13,_0x27336b[_0xd9c1('0x16')][_0xd9c1('0x19')]);return _0x3c57e7(_0x27336b[_0xd9c1('0x16')][_0xd9c1('0x19')]);}logger[_0xd9c1('0x16')](_0xd9c1('0x18'),_0x19bc13,_0x27336b[_0xd9c1('0x16')]['message']);return _0x9592c8(_0x27336b['error'][_0xd9c1('0x19')]);}else{logger[_0xd9c1('0x12')](_0xd9c1('0x18'),_0x19bc13,_0xd9c1('0x13'));_0x9592c8(_0x27336b[_0xd9c1('0x1a')][_0xd9c1('0x19')]);}})[_0xd9c1('0x1b')](function(_0x332f19){logger[_0xd9c1('0x16')]('ChatQueue,\x20%s,\x20%s',_0x19bc13,_0x332f19);_0x3c57e7(_0x332f19);});});}exports[_0xd9c1('0x1c')]=function(_0x11611d){var _0x37701d=this;return new Promise(function(_0x2aea78,_0x4643ad){return db[_0xd9c1('0x1d')]['findAll']({'raw':_0x11611d[_0xd9c1('0x1e')]?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x1f')]===undefined?!![]:![]:!![],'where':_0x11611d['options']?_0x11611d['options'][_0xd9c1('0x20')]||null:null,'attributes':_0x11611d[_0xd9c1('0x1e')]?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x21')]||null:null,'limit':_0x11611d[_0xd9c1('0x1e')]?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x22')]||null:null,'include':_0x11611d['options']?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x23')]?_['map'](_0x11611d['options'][_0xd9c1('0x23')],function(_0x45b15d){return{'model':db[_0x45b15d[_0xd9c1('0x24')]],'as':_0x45b15d['as'],'attributes':_0x45b15d['attributes'],'include':_0x45b15d[_0xd9c1('0x23')]?_[_0xd9c1('0x25')](_0x45b15d['include'],function(_0x4dcc10){return{'model':db[_0x4dcc10[_0xd9c1('0x24')]],'as':_0x4dcc10['as'],'attributes':_0x4dcc10[_0xd9c1('0x21')],'include':_0x4dcc10[_0xd9c1('0x23')]?_[_0xd9c1('0x25')](_0x4dcc10[_0xd9c1('0x23')],function(_0x7373cb){return{'model':db[_0x7373cb[_0xd9c1('0x24')]],'as':_0x7373cb['as'],'attributes':_0x7373cb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9c1('0x11')](function(_0x223b88){logger[_0xd9c1('0x12')](_0xd9c1('0x1c'),_0x11611d);logger[_0xd9c1('0x26')](_0xd9c1('0x1c'),_0x11611d,JSON[_0xd9c1('0x15')](_0x223b88));_0x2aea78(_0x223b88);})[_0xd9c1('0x1b')](function(_0x5a1a5c){logger['error']('GetChatQueue',_0x5a1a5c[_0xd9c1('0x19')],_0x11611d);_0x4643ad(_0x37701d['error'](0x1f4,_0x5a1a5c[_0xd9c1('0x19')]));});});};exports[_0xd9c1('0x27')]=function(_0x587ac9){var _0x337761=this;return new Promise(function(_0x3e128b,_0x108422){return db[_0xd9c1('0x1d')][_0xd9c1('0x28')]({'raw':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x1f')]===undefined?!![]:![]:!![],'where':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x20')]||null:null,'attributes':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9['options']['attributes']||null:null,'include':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x23')]?_['map'](_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x23')],function(_0x5905be){return{'model':db[_0x5905be[_0xd9c1('0x24')]],'as':_0x5905be['as'],'attributes':_0x5905be[_0xd9c1('0x21')],'include':_0x5905be['include']?_['map'](_0x5905be[_0xd9c1('0x23')],function(_0xbdfa7){return{'model':db[_0xbdfa7[_0xd9c1('0x24')]],'as':_0xbdfa7['as'],'attributes':_0xbdfa7[_0xd9c1('0x21')],'include':_0xbdfa7[_0xd9c1('0x23')]?_[_0xd9c1('0x25')](_0xbdfa7['include'],function(_0x2cd0eb){return{'model':db[_0x2cd0eb[_0xd9c1('0x24')]],'as':_0x2cd0eb['as'],'attributes':_0x2cd0eb[_0xd9c1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe0d4a5){logger[_0xd9c1('0x12')](_0xd9c1('0x27'),_0x587ac9);logger[_0xd9c1('0x26')](_0xd9c1('0x27'),_0x587ac9,JSON[_0xd9c1('0x15')](_0xe0d4a5));_0x3e128b(_0xe0d4a5);})[_0xd9c1('0x1b')](function(_0x2fa7c4){logger[_0xd9c1('0x16')](_0xd9c1('0x27'),_0x2fa7c4['message'],_0x587ac9);_0x108422(_0x337761[_0xd9c1('0x16')](0x1f4,_0x2fa7c4[_0xd9c1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f71919a..6d35a7b 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 _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x5ad3[_0x513047];return _0x15b779;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file +var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x4d3b77,_0x3c789c){var _0x1a716a=function(_0x10707c){while(--_0x10707c){_0x4d3b77['push'](_0x4d3b77['shift']());}};_0x1a716a(++_0x3c789c);}(_0x4ea3,0x70));var _0x34ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4ea3[_0x5b644e];return _0x49c6bf;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 10ccf04..7d9cbb3 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x587183,_0x56a369){var _0x3b6591=function(_0x585dc9){while(--_0x585dc9){_0x587183['push'](_0x587183['shift']());}};_0x3b6591(++_0x56a369);}(_0x55ca,0x126));var _0xa55c=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x55ca[_0x1fc18b];return _0x16a351;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=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(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x5fc3[_0x3fd3a3];return _0xa3e4d5;};'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 3e95d41..6a5f941 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 _0x6a24=['exports','STRING','DATE','moment','sequelize'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x6a24,0xb7));var _0x46a2=function(_0x36fcfb,_0x2e95df){_0x36fcfb=_0x36fcfb-0x0;var _0x545820=_0x6a24[_0x36fcfb];return _0x545820;};'use strict';var moment=require(_0x46a2('0x0'));var Sequelize=require(_0x46a2('0x1'));module[_0x46a2('0x2')]={'uniqueid':{'type':Sequelize[_0x46a2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x46a2('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x46a2('0x4')]},'exitAt':{'type':Sequelize[_0x46a2('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2791=['STRING','DATE','moment','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2791,0x66));var _0x1279=function(_0x2df819,_0x366130){_0x2df819=_0x2df819-0x0;var _0x29be16=_0x2791[_0x2df819];return _0x29be16;};'use strict';var moment=require(_0x1279('0x0'));var Sequelize=require(_0x1279('0x1'));module[_0x1279('0x2')]={'uniqueid':{'type':Sequelize[_0x1279('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1279('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1279('0x4')]},'acceptAt':{'type':Sequelize[_0x1279('0x4')]},'exitAt':{'type':Sequelize[_0x1279('0x4')]},'reason':{'type':Sequelize[_0x1279('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 50e332d..f36abdd 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 _0x1a61=['json','offset','limit','undefined','count','set','Content-Range','apply','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','findAll','rows','catch','params','merge','find','create','body','update','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1a61,0x1e6));var _0x11a6=function(_0x244969,_0x3c218c){_0x244969=_0x244969-0x0;var _0x4fd27a=_0x1a61[_0x244969];return _0x4fd27a;};'use strict';var emlformat=require(_0x11a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11a6('0x2'));var moment=require(_0x11a6('0x3'));var BPromise=require(_0x11a6('0x4'));var Mustache=require(_0x11a6('0x5'));var util=require('util');var path=require('path');var sox=require(_0x11a6('0x6'));var csv=require(_0x11a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11a6('0x8'));var _=require(_0x11a6('0x9'));var squel=require(_0x11a6('0xa'));var crypto=require(_0x11a6('0xb'));var jsforce=require(_0x11a6('0xc'));var deskjs=require(_0x11a6('0xd'));var toCsv=require(_0x11a6('0x7'));var querystring=require(_0x11a6('0xe'));var Papa=require(_0x11a6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11a6('0x10'));var hardwareService=require(_0x11a6('0x11'));var logger=require('../../config/logger')(_0x11a6('0x12'));var utils=require(_0x11a6('0x13'));var config=require(_0x11a6('0x14'));var licenseUtil=require(_0x11a6('0x15'));var db=require(_0x11a6('0x16'))['db'];function respondWithStatusCode(_0x41c4aa,_0x52f39a){_0x52f39a=_0x52f39a||0xcc;return function(_0x52c999){if(_0x52c999){return _0x41c4aa[_0x11a6('0x17')](_0x52f39a);}return _0x41c4aa[_0x11a6('0x18')](_0x52f39a)['end']();};}function respondWithResult(_0x1d3123,_0x15d140){_0x15d140=_0x15d140||0xc8;return function(_0x5158ea){if(_0x5158ea){return _0x1d3123[_0x11a6('0x18')](_0x15d140)[_0x11a6('0x19')](_0x5158ea);}};}function respondWithFilteredResult(_0x5b8e51,_0x345c70){return function(_0x2c79f4){if(_0x2c79f4){var _0x1fec24=typeof _0x345c70[_0x11a6('0x1a')]==='undefined'&&typeof _0x345c70[_0x11a6('0x1b')]===_0x11a6('0x1c');var _0xe8ed8=_0x2c79f4[_0x11a6('0x1d')];var _0x1a9d43=_0x1fec24?0x0:_0x345c70[_0x11a6('0x1a')];var _0x2449bf=_0x1fec24?_0x2c79f4[_0x11a6('0x1d')]:_0x345c70[_0x11a6('0x1a')]+_0x345c70[_0x11a6('0x1b')];var _0x2516a4;if(_0x2449bf>=_0xe8ed8){_0x2449bf=_0xe8ed8;_0x2516a4=0xc8;}else{_0x2516a4=0xce;}_0x5b8e51[_0x11a6('0x18')](_0x2516a4);return _0x5b8e51[_0x11a6('0x1e')](_0x11a6('0x1f'),_0x1a9d43+'-'+_0x2449bf+'/'+_0xe8ed8)['json'](_0x2c79f4);}return null;};}function patchUpdates(_0x485a4f){return function(_0xbd4c49){try{jsonpatch[_0x11a6('0x20')](_0xbd4c49,_0x485a4f,!![]);}catch(_0x3d1efd){return BPromise['reject'](_0x3d1efd);}return _0xbd4c49['save']();};}function saveUpdates(_0x7120c0,_0x521f50){return function(_0x707dd2){if(_0x707dd2){return _0x707dd2['update'](_0x7120c0)['then'](function(_0x51fe97){return _0x51fe97;});}return null;};}function removeEntity(_0x5b3a27,_0x111a63){return function(_0x55a043){if(_0x55a043){return _0x55a043[_0x11a6('0x21')]()[_0x11a6('0x22')](function(){_0x5b3a27['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ffd7f,_0x144cc5){return function(_0x34e230){if(!_0x34e230){_0x2ffd7f[_0x11a6('0x17')](0x194);}return _0x34e230;};}function handleError(_0x14f510,_0x407ae0){_0x407ae0=_0x407ae0||0x1f4;return function(_0x40e3b4){logger[_0x11a6('0x23')](_0x40e3b4[_0x11a6('0x24')]);if(_0x40e3b4[_0x11a6('0x25')]){delete _0x40e3b4[_0x11a6('0x25')];}_0x14f510[_0x11a6('0x18')](_0x407ae0)[_0x11a6('0x26')](_0x40e3b4);};}exports[_0x11a6('0x27')]=function(_0x304ad8,_0x453453){var _0x1ddbb2={},_0x1b7f4e={},_0x44c92d={'count':0x0,'rows':[]};var _0x2bfdf6=_[_0x11a6('0x28')](db[_0x11a6('0x29')][_0x11a6('0x2a')],function(_0x1ec7aa){return{'name':_0x1ec7aa[_0x11a6('0x2b')],'type':_0x1ec7aa['type'][_0x11a6('0x2c')]};});_0x1b7f4e['model']=_[_0x11a6('0x28')](_0x2bfdf6,_0x11a6('0x25'));_0x1b7f4e[_0x11a6('0x2d')]=_[_0x11a6('0x2e')](_0x304ad8[_0x11a6('0x2d')]);_0x1b7f4e['filters']=_[_0x11a6('0x2f')](_0x1b7f4e[_0x11a6('0x30')],_0x1b7f4e['query']);_0x1ddbb2['attributes']=_['intersection'](_0x1b7f4e[_0x11a6('0x30')],qs[_0x11a6('0x31')](_0x304ad8['query'][_0x11a6('0x31')]));_0x1ddbb2[_0x11a6('0x32')]=_0x1ddbb2[_0x11a6('0x32')][_0x11a6('0x33')]?_0x1ddbb2[_0x11a6('0x32')]:_0x1b7f4e['model'];if(!_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x34')](_0x11a6('0x35'))){_0x1ddbb2[_0x11a6('0x1b')]=qs[_0x11a6('0x1b')](_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x1b')]);_0x1ddbb2[_0x11a6('0x1a')]=qs[_0x11a6('0x1a')](_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x1a')]);}_0x1ddbb2[_0x11a6('0x36')]=qs[_0x11a6('0x37')](_0x304ad8['query'][_0x11a6('0x37')]);_0x1ddbb2[_0x11a6('0x38')]=qs[_0x11a6('0x39')](_[_0x11a6('0x3a')](_0x304ad8[_0x11a6('0x2d')],_0x1b7f4e[_0x11a6('0x39')]),_0x2bfdf6);if(_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3b')]){_0x1ddbb2[_0x11a6('0x38')]=_['merge'](_0x1ddbb2[_0x11a6('0x38')],{'$or':_[_0x11a6('0x28')](_0x2bfdf6,function(_0x5f38c1){if(_0x5f38c1[_0x11a6('0x3c')]!==_0x11a6('0x3d')){var _0x38aaa7={};_0x38aaa7[_0x5f38c1['name']]={'$like':'%'+_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3b')]+'%'};return _0x38aaa7;}})});}_0x1ddbb2=_['merge']({},_0x1ddbb2,_0x304ad8['options']);var _0x10c485={'where':_0x1ddbb2['where']};return db[_0x11a6('0x29')][_0x11a6('0x1d')](_0x10c485)['then'](function(_0x275aa0){_0x44c92d['count']=_0x275aa0;if(_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3e')]){_0x1ddbb2['include']=[{'all':!![]}];}return db[_0x11a6('0x29')][_0x11a6('0x3f')](_0x1ddbb2);})[_0x11a6('0x22')](function(_0xd769e4){_0x44c92d[_0x11a6('0x40')]=_0xd769e4;return _0x44c92d;})[_0x11a6('0x22')](respondWithFilteredResult(_0x453453,_0x1ddbb2))[_0x11a6('0x41')](handleError(_0x453453,null));};exports['show']=function(_0x1d3a8b,_0x382182){var _0x5f44c1={'raw':!![],'where':{'id':_0x1d3a8b[_0x11a6('0x42')]['id']}},_0x588b96={};_0x588b96['model']=_[_0x11a6('0x2e')](db[_0x11a6('0x29')][_0x11a6('0x2a')]);_0x588b96['query']=_['keys'](_0x1d3a8b['query']);_0x588b96['filters']=_[_0x11a6('0x2f')](_0x588b96['model'],_0x588b96[_0x11a6('0x2d')]);_0x5f44c1[_0x11a6('0x32')]=_['intersection'](_0x588b96['model'],qs['fields'](_0x1d3a8b[_0x11a6('0x2d')][_0x11a6('0x31')]));_0x5f44c1['attributes']=_0x5f44c1[_0x11a6('0x32')]['length']?_0x5f44c1[_0x11a6('0x32')]:_0x588b96['model'];if(_0x1d3a8b[_0x11a6('0x2d')][_0x11a6('0x3e')]){_0x5f44c1['include']=[{'all':!![]}];}_0x5f44c1=_[_0x11a6('0x43')]({},_0x5f44c1,_0x1d3a8b['options']);return db[_0x11a6('0x29')][_0x11a6('0x44')](_0x5f44c1)[_0x11a6('0x22')](handleEntityNotFound(_0x382182,null))[_0x11a6('0x22')](respondWithResult(_0x382182,null))['catch'](handleError(_0x382182,null));};exports[_0x11a6('0x45')]=function(_0x18feb7,_0x25f137){return db[_0x11a6('0x29')][_0x11a6('0x45')](_0x18feb7[_0x11a6('0x46')],{})['then'](respondWithResult(_0x25f137,0xc9))[_0x11a6('0x41')](handleError(_0x25f137,null));};exports[_0x11a6('0x47')]=function(_0x41afe9,_0x5b8bbf){if(_0x41afe9[_0x11a6('0x46')]['id']){delete _0x41afe9[_0x11a6('0x46')]['id'];}return db[_0x11a6('0x29')][_0x11a6('0x44')]({'where':{'id':_0x41afe9[_0x11a6('0x42')]['id']}})[_0x11a6('0x22')](handleEntityNotFound(_0x5b8bbf,null))[_0x11a6('0x22')](saveUpdates(_0x41afe9[_0x11a6('0x46')],null))[_0x11a6('0x22')](respondWithResult(_0x5b8bbf,null))[_0x11a6('0x41')](handleError(_0x5b8bbf,null));};exports[_0x11a6('0x21')]=function(_0x2e105f,_0x1febf1){return db[_0x11a6('0x29')][_0x11a6('0x44')]({'where':{'id':_0x2e105f[_0x11a6('0x42')]['id']}})[_0x11a6('0x22')](handleEntityNotFound(_0x1febf1,null))[_0x11a6('0x22')](removeEntity(_0x1febf1,null))['catch'](handleError(_0x1febf1,null));};exports[_0x11a6('0x48')]=function(_0x5e7235,_0x27c59a){return db['ChatQueueReport'][_0x11a6('0x48')]()[_0x11a6('0x22')](respondWithResult(_0x27c59a,null))[_0x11a6('0x41')](handleError(_0x27c59a,null));}; \ No newline at end of file +var _0xfd20=['map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x2b272b,_0x1af4e3){var _0x2b23ef=function(_0x89a945){while(--_0x89a945){_0x2b272b['push'](_0x2b272b['shift']());}};_0x2b23ef(++_0x1af4e3);}(_0xfd20,0x66));var _0x0fd2=function(_0x332924,_0x240c1c){_0x332924=_0x332924-0x0;var _0x4440e9=_0xfd20[_0x332924];return _0x4440e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['ChatQueueReport']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['ChatQueueReport'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 4c7410c..4d8e2ca 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x478ecf,_0x5887bb){var _0x54ebc8=function(_0x23effb){while(--_0x23effb){_0x478ecf['push'](_0x478ecf['shift']());}};_0x54ebc8(++_0x5887bb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x2b3e7e,_0x37c887){var _0x1e24b2=function(_0x5a761f){while(--_0x5a761f){_0x2b3e7e['push'](_0x2b3e7e['shift']());}};_0x1e24b2(++_0x37c887);}(_0xe706,0xa3));var _0x6e70=function(_0x48f038,_0x2bde84){_0x48f038=_0x48f038-0x0;var _0x2edc62=_0xe706[_0x48f038];return _0x2edc62;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c4590d5..3c19339 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 _0x2454=['../../config/logger','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','body','attributes','UpdateChatQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xba4220,_0x5217a7){var _0x4cdb9d=function(_0x32cae1){while(--_0x32cae1){_0xba4220['push'](_0xba4220['shift']());}};_0x4cdb9d(++_0x5217a7);}(_0x2454,0xea));var _0x4245=function(_0x124810,_0x158e53){_0x124810=_0x124810-0x0;var _0x48d191=_0x2454[_0x124810];return _0x48d191;};'use strict';var _=require('lodash');var util=require(_0x4245('0x0'));var moment=require(_0x4245('0x1'));var BPromise=require(_0x4245('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4245('0x3'));var db=require(_0x4245('0x4'))['db'];var utils=require(_0x4245('0x5'));var logger=require(_0x4245('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4245('0x7')][_0x4245('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fd457,_0x3cc444,_0x117de7){return new BPromise(function(_0xe0fcec,_0x409026){return client[_0x4245('0x9')](_0x2fd457,_0x117de7)[_0x4245('0xa')](function(_0x1193ec){logger['info'](_0x4245('0xb'),_0x3cc444,'request\x20sent');logger[_0x4245('0xc')](_0x4245('0xd'),_0x3cc444,_0x4245('0xe'),JSON[_0x4245('0xf')](_0x1193ec));if(_0x1193ec[_0x4245('0x10')]){if(_0x1193ec[_0x4245('0x10')][_0x4245('0x11')]===0x1f4){logger[_0x4245('0x10')](_0x4245('0xb'),_0x3cc444,_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);return _0x409026(_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3cc444,_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);return _0xe0fcec(_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);}else{logger[_0x4245('0x13')](_0x4245('0xb'),_0x3cc444,_0x4245('0xe'));_0xe0fcec(_0x1193ec['result'][_0x4245('0x12')]);}})[_0x4245('0x14')](function(_0x3d4dbb){logger['error'](_0x4245('0xb'),_0x3cc444,_0x3d4dbb);_0x409026(_0x3d4dbb);});});}exports[_0x4245('0x15')]=function(_0x4d75bf){var _0x500299=this;return new Promise(function(_0x229f68,_0x4e0c19){return db[_0x4245('0x16')][_0x4245('0x17')](_0x4d75bf['body'],{'raw':_0x4d75bf[_0x4245('0x18')]?_0x4d75bf[_0x4245('0x18')][_0x4245('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x520022){logger[_0x4245('0x13')](_0x4245('0x15'),_0x4d75bf);logger['debug']('CreateChatQueueReport',_0x4d75bf,JSON[_0x4245('0xf')](_0x520022));_0x229f68(_0x520022);})[_0x4245('0x14')](function(_0x58f389){logger[_0x4245('0x10')](_0x4245('0x15'),_0x58f389[_0x4245('0x12')],_0x4d75bf);_0x4e0c19(_0x500299[_0x4245('0x10')](0x1f4,_0x58f389[_0x4245('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x35eb47){var _0x4a0514=this;return new Promise(function(_0x513933,_0x242eb7){return db['ChatQueueReport'][_0x4245('0x1a')](_0x35eb47[_0x4245('0x1b')],{'raw':_0x35eb47[_0x4245('0x18')]?_0x35eb47[_0x4245('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35eb47[_0x4245('0x18')]?_0x35eb47[_0x4245('0x18')]['where']||null:null,'attributes':_0x35eb47['options']?_0x35eb47[_0x4245('0x18')][_0x4245('0x1c')]||null:null,'limit':_0x35eb47[_0x4245('0x18')]?_0x35eb47['options']['limit']||null:null})[_0x4245('0xa')](function(_0x210dc7){logger['info']('UpdateChatQueueReport',_0x35eb47);logger[_0x4245('0xc')](_0x4245('0x1d'),_0x35eb47,JSON['stringify'](_0x210dc7));_0x513933(_0x210dc7);})[_0x4245('0x14')](function(_0x10df76){logger['error'](_0x4245('0x1d'),_0x10df76[_0x4245('0x12')],_0x35eb47);_0x242eb7(_0x4a0514[_0x4245('0x10')](0x1f4,_0x10df76[_0x4245('0x12')]));});});}; \ No newline at end of file +var _0x477c=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','where','limit','UpdateChatQueueReport','lodash','bluebird'];(function(_0x49ad15,_0x3fa5a3){var _0x4326bc=function(_0x4533ae){while(--_0x4533ae){_0x49ad15['push'](_0x49ad15['shift']());}};_0x4326bc(++_0x3fa5a3);}(_0x477c,0xe6));var _0xc477=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x477c[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xc477('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc477('0x1'));var rs=require(_0xc477('0x2'));var fs=require('fs');var Redis=require(_0xc477('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc477('0x4'));var logger=require(_0xc477('0x5'))(_0xc477('0x6'));var config=require(_0xc477('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc477('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54247b,_0x4a6afa,_0x32abb6){return new BPromise(function(_0x1203bc,_0x259fe9){return client[_0xc477('0x9')](_0x54247b,_0x32abb6)['then'](function(_0x2fbfb3){logger[_0xc477('0xa')](_0xc477('0xb'),_0x4a6afa,_0xc477('0xc'));logger[_0xc477('0xd')](_0xc477('0xe'),_0x4a6afa,_0xc477('0xc'),JSON[_0xc477('0xf')](_0x2fbfb3));if(_0x2fbfb3[_0xc477('0x10')]){if(_0x2fbfb3[_0xc477('0x10')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4a6afa,_0x2fbfb3[_0xc477('0x10')][_0xc477('0x11')]);return _0x259fe9(_0x2fbfb3[_0xc477('0x10')]['message']);}logger['error'](_0xc477('0xb'),_0x4a6afa,_0x2fbfb3['error'][_0xc477('0x11')]);return _0x1203bc(_0x2fbfb3['error'][_0xc477('0x11')]);}else{logger[_0xc477('0xa')](_0xc477('0xb'),_0x4a6afa,_0xc477('0xc'));_0x1203bc(_0x2fbfb3[_0xc477('0x12')]['message']);}})['catch'](function(_0x4f85fa){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4a6afa,_0x4f85fa);_0x259fe9(_0x4f85fa);});});}exports[_0xc477('0x13')]=function(_0x47f45d){var _0x598f6b=this;return new Promise(function(_0x329c76,_0x18fa31){return db[_0xc477('0x14')][_0xc477('0x15')](_0x47f45d[_0xc477('0x16')],{'raw':_0x47f45d[_0xc477('0x17')]?_0x47f45d[_0xc477('0x17')][_0xc477('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x13fb99){logger[_0xc477('0xa')](_0xc477('0x13'),_0x47f45d);logger[_0xc477('0xd')](_0xc477('0x13'),_0x47f45d,JSON[_0xc477('0xf')](_0x13fb99));_0x329c76(_0x13fb99);})[_0xc477('0x19')](function(_0x2e88ce){logger[_0xc477('0x10')]('CreateChatQueueReport',_0x2e88ce['message'],_0x47f45d);_0x18fa31(_0x598f6b[_0xc477('0x10')](0x1f4,_0x2e88ce[_0xc477('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x27484b){var _0x24be99=this;return new Promise(function(_0x4b73ba,_0x36da45){return db[_0xc477('0x14')]['update'](_0x27484b[_0xc477('0x16')],{'raw':_0x27484b['options']?_0x27484b[_0xc477('0x17')][_0xc477('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27484b['options']?_0x27484b[_0xc477('0x17')][_0xc477('0x1a')]||null:null,'attributes':_0x27484b[_0xc477('0x17')]?_0x27484b[_0xc477('0x17')]['attributes']||null:null,'limit':_0x27484b['options']?_0x27484b[_0xc477('0x17')][_0xc477('0x1b')]||null:null})['then'](function(_0x28870d){logger[_0xc477('0xa')](_0xc477('0x1c'),_0x27484b);logger[_0xc477('0xd')]('UpdateChatQueueReport',_0x27484b,JSON[_0xc477('0xf')](_0x28870d));_0x4b73ba(_0x28870d);})['catch'](function(_0x330d25){logger['error']('UpdateChatQueueReport',_0x330d25['message'],_0x27484b);_0x36da45(_0x24be99[_0xc477('0x10')](0x1f4,_0x330d25[_0xc477('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 69a95c4..64e4d87 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 _0xe3cc=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra'];(function(_0x535246,_0xb9ab72){var _0x43d339=function(_0x41e19d){while(--_0x41e19d){_0x535246['push'](_0x535246['shift']());}};_0x43d339(++_0xb9ab72);}(_0xe3cc,0x9b));var _0xce3c=function(_0x4edae9,_0xc9cdc1){_0x4edae9=_0x4edae9-0x0;var _0x180f85=_0xe3cc[_0x4edae9];return _0x180f85;};'use strict';var multer=require(_0xce3c('0x0'));var util=require('util');var path=require(_0xce3c('0x1'));var timeout=require('connect-timeout');var express=require(_0xce3c('0x2'));var router=express[_0xce3c('0x3')]();var fs_extra=require(_0xce3c('0x4'));var auth=require(_0xce3c('0x5'));var interaction=require(_0xce3c('0x6'));var config=require(_0xce3c('0x7'));var controller=require('./chatQueueReport.controller');router[_0xce3c('0x8')]('/',auth['isAuthenticated'](),controller[_0xce3c('0x9')]);router['get'](_0xce3c('0xa'),auth[_0xce3c('0xb')](),controller[_0xce3c('0xc')]);router[_0xce3c('0x8')](_0xce3c('0xd'),auth[_0xce3c('0xb')](),controller['show']);router[_0xce3c('0xe')]('/',auth['isAuthenticated'](),controller[_0xce3c('0xf')]);router[_0xce3c('0x10')](_0xce3c('0xd'),auth[_0xce3c('0xb')](),controller[_0xce3c('0x11')]);router[_0xce3c('0x12')](_0xce3c('0xd'),auth[_0xce3c('0xb')](),controller[_0xce3c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2e9d=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x2e9d,0x18a));var _0xd2e9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2e9d[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xd2e9('0x0'));var util=require(_0xd2e9('0x1'));var path=require('path');var timeout=require(_0xd2e9('0x2'));var express=require(_0xd2e9('0x3'));var router=express['Router']();var fs_extra=require(_0xd2e9('0x4'));var auth=require(_0xd2e9('0x5'));var interaction=require(_0xd2e9('0x6'));var config=require(_0xd2e9('0x7'));var controller=require('./chatQueueReport.controller');router[_0xd2e9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd2e9('0x8')](_0xd2e9('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xd2e9('0x8')](_0xd2e9('0xa'),auth[_0xd2e9('0xb')](),controller[_0xd2e9('0xc')]);router[_0xd2e9('0xd')]('/',auth['isAuthenticated'](),controller[_0xd2e9('0xe')]);router['put'](_0xd2e9('0xa'),auth[_0xd2e9('0xb')](),controller[_0xd2e9('0xf')]);router[_0xd2e9('0x10')](_0xd2e9('0xa'),auth[_0xd2e9('0xb')](),controller[_0xd2e9('0x11')]);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 cc4a286..06b5655 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1fe085,_0x43bea5){var _0x3a87aa=function(_0x17f072){while(--_0x17f072){_0x1fe085['push'](_0x1fe085['shift']());}};_0x3a87aa(++_0x43bea5);}(_0x70e0,0x17b));var _0x070e=function(_0x24d37b,_0x2bd674){_0x24d37b=_0x24d37b-0x0;var _0x3331f5=_0x70e0[_0x24d37b];return _0x3331f5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3da144,_0x578cbd){var _0x13fdc7=function(_0x2d2919){while(--_0x2d2919){_0x3da144['push'](_0x3da144['shift']());}};_0x13fdc7(++_0x578cbd);}(_0x54ef,0x112));var _0xf54e=function(_0x33f3a0,_0x2f0f49){_0x33f3a0=_0x33f3a0-0x0;var _0xd33834=_0x54ef[_0x33f3a0];return _0xd33834;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1e1be1c..ddfffe4 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 _0x7121=['name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','length','includeAll','catch','create','body','find','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x17901f,_0x4dba8c){var _0x22aaba=function(_0x2a3574){while(--_0x2a3574){_0x17901f['push'](_0x17901f['shift']());}};_0x22aaba(++_0x4dba8c);}(_0x7121,0x1c1));var _0x1712=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7121[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x1712('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1712('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1712('0x2'));var moment=require('moment');var BPromise=require(_0x1712('0x3'));var Mustache=require(_0x1712('0x4'));var util=require(_0x1712('0x5'));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(_0x1712('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1712('0x7'));var deskjs=require(_0x1712('0x8'));var toCsv=require(_0x1712('0x9'));var querystring=require(_0x1712('0xa'));var Papa=require(_0x1712('0xb'));var Redis=require(_0x1712('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1712('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1712('0xe'))(_0x1712('0xf'));var utils=require(_0x1712('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x169606,_0x42467f){_0x42467f=_0x42467f||0xcc;return function(_0x1d4bb6){if(_0x1d4bb6){return _0x169606['sendStatus'](_0x42467f);}return _0x169606['status'](_0x42467f)['end']();};}function respondWithResult(_0x37c455,_0x19242f){_0x19242f=_0x19242f||0xc8;return function(_0xd0b00d){if(_0xd0b00d){return _0x37c455[_0x1712('0x11')](_0x19242f)[_0x1712('0x12')](_0xd0b00d);}};}function respondWithFilteredResult(_0x1dcf6a,_0x564389){return function(_0x47a93d){if(_0x47a93d){var _0x552ba7=typeof _0x564389[_0x1712('0x13')]==='undefined'&&typeof _0x564389[_0x1712('0x14')]===_0x1712('0x15');var _0x505d3e=_0x47a93d[_0x1712('0x16')];var _0x4fee71=_0x552ba7?0x0:_0x564389['offset'];var _0x2e2eeb=_0x552ba7?_0x47a93d[_0x1712('0x16')]:_0x564389[_0x1712('0x13')]+_0x564389[_0x1712('0x14')];var _0x28068b;if(_0x2e2eeb>=_0x505d3e){_0x2e2eeb=_0x505d3e;_0x28068b=0xc8;}else{_0x28068b=0xce;}_0x1dcf6a[_0x1712('0x11')](_0x28068b);return _0x1dcf6a[_0x1712('0x17')](_0x1712('0x18'),_0x4fee71+'-'+_0x2e2eeb+'/'+_0x505d3e)[_0x1712('0x12')](_0x47a93d);}return null;};}function patchUpdates(_0x4169ed){return function(_0x3029d6){try{jsonpatch[_0x1712('0x19')](_0x3029d6,_0x4169ed,!![]);}catch(_0x490e84){return BPromise['reject'](_0x490e84);}return _0x3029d6[_0x1712('0x1a')]();};}function saveUpdates(_0x2e7b45,_0x41083b){return function(_0x4488be){if(_0x4488be){return _0x4488be[_0x1712('0x1b')](_0x2e7b45)[_0x1712('0x1c')](function(_0x1c79a2){return _0x1c79a2;});}return null;};}function removeEntity(_0x545ac2,_0x5de94d){return function(_0x143660){if(_0x143660){return _0x143660[_0x1712('0x1d')]()[_0x1712('0x1c')](function(){_0x545ac2['status'](0xcc)[_0x1712('0x1e')]();});}};}function handleEntityNotFound(_0x59e57f,_0x2feef5){return function(_0x197639){if(!_0x197639){_0x59e57f[_0x1712('0x1f')](0x194);}return _0x197639;};}function handleError(_0x49b366,_0x5d566d){_0x5d566d=_0x5d566d||0x1f4;return function(_0x1b057b){logger[_0x1712('0x20')](_0x1b057b[_0x1712('0x21')]);if(_0x1b057b['name']){delete _0x1b057b[_0x1712('0x22')];}_0x49b366[_0x1712('0x11')](_0x5d566d)[_0x1712('0x23')](_0x1b057b);};}exports[_0x1712('0x24')]=function(_0x33b28d,_0x483ecf){var _0xcb8553={},_0x489d70={},_0x1adb16={'count':0x0,'rows':[]};var _0x238567=_[_0x1712('0x25')](db[_0x1712('0x26')][_0x1712('0x27')],function(_0x2fdeb4){return{'name':_0x2fdeb4[_0x1712('0x28')],'type':_0x2fdeb4[_0x1712('0x29')][_0x1712('0x2a')]};});_0x489d70[_0x1712('0x2b')]=_[_0x1712('0x25')](_0x238567,_0x1712('0x22'));_0x489d70[_0x1712('0x2c')]=_[_0x1712('0x2d')](_0x33b28d[_0x1712('0x2c')]);_0x489d70[_0x1712('0x2e')]=_['intersection'](_0x489d70[_0x1712('0x2b')],_0x489d70[_0x1712('0x2c')]);_0xcb8553[_0x1712('0x2f')]=_[_0x1712('0x30')](_0x489d70['model'],qs[_0x1712('0x31')](_0x33b28d[_0x1712('0x2c')][_0x1712('0x31')]));_0xcb8553[_0x1712('0x2f')]=_0xcb8553['attributes']['length']?_0xcb8553[_0x1712('0x2f')]:_0x489d70['model'];if(!_0x33b28d['query']['hasOwnProperty'](_0x1712('0x32'))){_0xcb8553[_0x1712('0x14')]=qs[_0x1712('0x14')](_0x33b28d[_0x1712('0x2c')][_0x1712('0x14')]);_0xcb8553[_0x1712('0x13')]=qs[_0x1712('0x13')](_0x33b28d[_0x1712('0x2c')]['offset']);}_0xcb8553[_0x1712('0x33')]=qs['sort'](_0x33b28d[_0x1712('0x2c')][_0x1712('0x34')]);_0xcb8553[_0x1712('0x35')]=qs['filters'](_[_0x1712('0x36')](_0x33b28d['query'],_0x489d70['filters']),_0x238567);if(_0x33b28d[_0x1712('0x2c')][_0x1712('0x37')]){_0xcb8553['where']=_['merge'](_0xcb8553[_0x1712('0x35')],{'$or':_['map'](_0x238567,function(_0x294a64){if(_0x294a64[_0x1712('0x29')]!==_0x1712('0x38')){var _0x12601c={};_0x12601c[_0x294a64[_0x1712('0x22')]]={'$like':'%'+_0x33b28d[_0x1712('0x2c')]['filter']+'%'};return _0x12601c;}})});}_0xcb8553=_[_0x1712('0x39')]({},_0xcb8553,_0x33b28d[_0x1712('0x3a')]);var _0x103570={'where':_0xcb8553[_0x1712('0x35')]};return db[_0x1712('0x26')][_0x1712('0x16')](_0x103570)[_0x1712('0x1c')](function(_0x15675b){_0x1adb16[_0x1712('0x16')]=_0x15675b;if(_0x33b28d[_0x1712('0x2c')]['includeAll']){_0xcb8553[_0x1712('0x3b')]=[{'all':!![]}];}return db[_0x1712('0x26')]['findAll'](_0xcb8553);})['then'](function(_0x59e6fd){_0x1adb16[_0x1712('0x3c')]=_0x59e6fd;return _0x1adb16;})[_0x1712('0x1c')](respondWithFilteredResult(_0x483ecf,_0xcb8553))['catch'](handleError(_0x483ecf,null));};exports[_0x1712('0x3d')]=function(_0x292995,_0x3098e8){var _0x5d714f={'raw':!![],'where':{'id':_0x292995['params']['id']}},_0x5095ef={};_0x5095ef['model']=_[_0x1712('0x2d')](db[_0x1712('0x26')]['rawAttributes']);_0x5095ef[_0x1712('0x2c')]=_[_0x1712('0x2d')](_0x292995[_0x1712('0x2c')]);_0x5095ef[_0x1712('0x2e')]=_[_0x1712('0x30')](_0x5095ef[_0x1712('0x2b')],_0x5095ef[_0x1712('0x2c')]);_0x5d714f[_0x1712('0x2f')]=_[_0x1712('0x30')](_0x5095ef[_0x1712('0x2b')],qs[_0x1712('0x31')](_0x292995[_0x1712('0x2c')][_0x1712('0x31')]));_0x5d714f[_0x1712('0x2f')]=_0x5d714f[_0x1712('0x2f')][_0x1712('0x3e')]?_0x5d714f[_0x1712('0x2f')]:_0x5095ef[_0x1712('0x2b')];if(_0x292995[_0x1712('0x2c')][_0x1712('0x3f')]){_0x5d714f['include']=[{'all':!![]}];}_0x5d714f=_['merge']({},_0x5d714f,_0x292995[_0x1712('0x3a')]);return db['ChatTransferReport']['find'](_0x5d714f)[_0x1712('0x1c')](handleEntityNotFound(_0x3098e8,null))[_0x1712('0x1c')](respondWithResult(_0x3098e8,null))[_0x1712('0x40')](handleError(_0x3098e8,null));};exports['create']=function(_0x5ae2dd,_0x4c16a9){return db[_0x1712('0x26')][_0x1712('0x41')](_0x5ae2dd[_0x1712('0x42')],{})[_0x1712('0x1c')](respondWithResult(_0x4c16a9,0xc9))[_0x1712('0x40')](handleError(_0x4c16a9,null));};exports[_0x1712('0x1b')]=function(_0x3f61a3,_0x5f4d83){if(_0x3f61a3[_0x1712('0x42')]['id']){delete _0x3f61a3[_0x1712('0x42')]['id'];}return db['ChatTransferReport'][_0x1712('0x43')]({'where':{'id':_0x3f61a3['params']['id']}})[_0x1712('0x1c')](handleEntityNotFound(_0x5f4d83,null))['then'](saveUpdates(_0x3f61a3[_0x1712('0x42')],null))[_0x1712('0x1c')](respondWithResult(_0x5f4d83,null))[_0x1712('0x40')](handleError(_0x5f4d83,null));};exports[_0x1712('0x1d')]=function(_0x243e5f,_0x5dd471){return db[_0x1712('0x26')][_0x1712('0x43')]({'where':{'id':_0x243e5f['params']['id']}})['then'](handleEntityNotFound(_0x5dd471,null))[_0x1712('0x1c')](removeEntity(_0x5dd471,null))[_0x1712('0x40')](handleError(_0x5dd471,null));};exports[_0x1712('0x44')]=function(_0x5cef41,_0x208d99){return db['ChatTransferReport'][_0x1712('0x44')]()[_0x1712('0x1c')](respondWithResult(_0x208d99,null))[_0x1712('0x40')](handleError(_0x208d99,null));}; \ No newline at end of file +var _0x3b38=['findAll','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include'];(function(_0x2f19d1,_0x2867df){var _0x9fd241=function(_0x181c13){while(--_0x181c13){_0x2f19d1['push'](_0x2f19d1['shift']());}};_0x9fd241(++_0x2867df);}(_0x3b38,0xa2));var _0x83b3=function(_0x19f6ac,_0x508c58){_0x19f6ac=_0x19f6ac-0x0;var _0xcac7da=_0x3b38[_0x19f6ac];return _0xcac7da;};'use strict';var emlformat=require(_0x83b3('0x0'));var rimraf=require(_0x83b3('0x1'));var zipdir=require(_0x83b3('0x2'));var jsonpatch=require(_0x83b3('0x3'));var rp=require(_0x83b3('0x4'));var moment=require(_0x83b3('0x5'));var BPromise=require(_0x83b3('0x6'));var Mustache=require(_0x83b3('0x7'));var util=require('util');var path=require(_0x83b3('0x8'));var sox=require(_0x83b3('0x9'));var csv=require(_0x83b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83b3('0xb'));var _=require(_0x83b3('0xc'));var squel=require(_0x83b3('0xd'));var crypto=require(_0x83b3('0xe'));var jsforce=require(_0x83b3('0xf'));var deskjs=require(_0x83b3('0x10'));var toCsv=require(_0x83b3('0xa'));var querystring=require(_0x83b3('0x11'));var Papa=require(_0x83b3('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x83b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83b3('0x14'))(_0x83b3('0x15'));var utils=require(_0x83b3('0x16'));var config=require(_0x83b3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x83b3('0x18'))['db'];function respondWithStatusCode(_0x81abb,_0xf54d4e){_0xf54d4e=_0xf54d4e||0xcc;return function(_0x39a8d2){if(_0x39a8d2){return _0x81abb[_0x83b3('0x19')](_0xf54d4e);}return _0x81abb[_0x83b3('0x1a')](_0xf54d4e)[_0x83b3('0x1b')]();};}function respondWithResult(_0x48453c,_0x332059){_0x332059=_0x332059||0xc8;return function(_0x29f9ad){if(_0x29f9ad){return _0x48453c[_0x83b3('0x1a')](_0x332059)[_0x83b3('0x1c')](_0x29f9ad);}};}function respondWithFilteredResult(_0x3ea6a7,_0x14918e){return function(_0x4cc6ba){if(_0x4cc6ba){var _0x4b90ff=typeof _0x14918e['offset']===_0x83b3('0x1d')&&typeof _0x14918e[_0x83b3('0x1e')]==='undefined';var _0x436bfc=_0x4cc6ba['count'];var _0x51ebba=_0x4b90ff?0x0:_0x14918e[_0x83b3('0x1f')];var _0xf0fbee=_0x4b90ff?_0x4cc6ba[_0x83b3('0x20')]:_0x14918e[_0x83b3('0x1f')]+_0x14918e[_0x83b3('0x1e')];var _0x5aa7c8;if(_0xf0fbee>=_0x436bfc){_0xf0fbee=_0x436bfc;_0x5aa7c8=0xc8;}else{_0x5aa7c8=0xce;}_0x3ea6a7[_0x83b3('0x1a')](_0x5aa7c8);return _0x3ea6a7[_0x83b3('0x21')](_0x83b3('0x22'),_0x51ebba+'-'+_0xf0fbee+'/'+_0x436bfc)[_0x83b3('0x1c')](_0x4cc6ba);}return null;};}function patchUpdates(_0x5e3d53){return function(_0x7bd0e1){try{jsonpatch[_0x83b3('0x23')](_0x7bd0e1,_0x5e3d53,!![]);}catch(_0x32a442){return BPromise['reject'](_0x32a442);}return _0x7bd0e1[_0x83b3('0x24')]();};}function saveUpdates(_0x5cbcd6,_0x419852){return function(_0xf7c76){if(_0xf7c76){return _0xf7c76[_0x83b3('0x25')](_0x5cbcd6)[_0x83b3('0x26')](function(_0x402373){return _0x402373;});}return null;};}function removeEntity(_0x414af3,_0x17310a){return function(_0x28dd42){if(_0x28dd42){return _0x28dd42[_0x83b3('0x27')]()['then'](function(){_0x414af3[_0x83b3('0x1a')](0xcc)[_0x83b3('0x1b')]();});}};}function handleEntityNotFound(_0x45230b,_0x258d37){return function(_0x38a2b4){if(!_0x38a2b4){_0x45230b[_0x83b3('0x19')](0x194);}return _0x38a2b4;};}function handleError(_0x315e40,_0x3aba73){_0x3aba73=_0x3aba73||0x1f4;return function(_0x522f61){logger[_0x83b3('0x28')](_0x522f61[_0x83b3('0x29')]);if(_0x522f61[_0x83b3('0x2a')]){delete _0x522f61[_0x83b3('0x2a')];}_0x315e40[_0x83b3('0x1a')](_0x3aba73)['send'](_0x522f61);};}exports[_0x83b3('0x2b')]=function(_0x56fab6,_0x542531){var _0xa7f2b8={},_0x107ee7={},_0x4762ed={'count':0x0,'rows':[]};var _0x57dad7=_[_0x83b3('0x2c')](db[_0x83b3('0x2d')][_0x83b3('0x2e')],function(_0x49f306){return{'name':_0x49f306[_0x83b3('0x2f')],'type':_0x49f306[_0x83b3('0x30')][_0x83b3('0x31')]};});_0x107ee7[_0x83b3('0x32')]=_[_0x83b3('0x2c')](_0x57dad7,'name');_0x107ee7[_0x83b3('0x33')]=_['keys'](_0x56fab6['query']);_0x107ee7[_0x83b3('0x34')]=_[_0x83b3('0x35')](_0x107ee7[_0x83b3('0x32')],_0x107ee7[_0x83b3('0x33')]);_0xa7f2b8[_0x83b3('0x36')]=_[_0x83b3('0x35')](_0x107ee7[_0x83b3('0x32')],qs[_0x83b3('0x37')](_0x56fab6[_0x83b3('0x33')][_0x83b3('0x37')]));_0xa7f2b8['attributes']=_0xa7f2b8[_0x83b3('0x36')][_0x83b3('0x38')]?_0xa7f2b8[_0x83b3('0x36')]:_0x107ee7[_0x83b3('0x32')];if(!_0x56fab6[_0x83b3('0x33')][_0x83b3('0x39')](_0x83b3('0x3a'))){_0xa7f2b8[_0x83b3('0x1e')]=qs[_0x83b3('0x1e')](_0x56fab6[_0x83b3('0x33')][_0x83b3('0x1e')]);_0xa7f2b8['offset']=qs[_0x83b3('0x1f')](_0x56fab6[_0x83b3('0x33')][_0x83b3('0x1f')]);}_0xa7f2b8['order']=qs[_0x83b3('0x3b')](_0x56fab6['query'][_0x83b3('0x3b')]);_0xa7f2b8[_0x83b3('0x3c')]=qs[_0x83b3('0x34')](_['pick'](_0x56fab6['query'],_0x107ee7[_0x83b3('0x34')]),_0x57dad7);if(_0x56fab6[_0x83b3('0x33')][_0x83b3('0x3d')]){_0xa7f2b8['where']=_[_0x83b3('0x3e')](_0xa7f2b8[_0x83b3('0x3c')],{'$or':_['map'](_0x57dad7,function(_0x58b1b5){if(_0x58b1b5['type']!==_0x83b3('0x3f')){var _0x34b44d={};_0x34b44d[_0x58b1b5[_0x83b3('0x2a')]]={'$like':'%'+_0x56fab6['query']['filter']+'%'};return _0x34b44d;}})});}_0xa7f2b8=_[_0x83b3('0x3e')]({},_0xa7f2b8,_0x56fab6[_0x83b3('0x40')]);var _0x30461e={'where':_0xa7f2b8[_0x83b3('0x3c')]};return db[_0x83b3('0x2d')][_0x83b3('0x20')](_0x30461e)[_0x83b3('0x26')](function(_0x2bb4db){_0x4762ed[_0x83b3('0x20')]=_0x2bb4db;if(_0x56fab6[_0x83b3('0x33')]['includeAll']){_0xa7f2b8[_0x83b3('0x41')]=[{'all':!![]}];}return db[_0x83b3('0x2d')][_0x83b3('0x42')](_0xa7f2b8);})['then'](function(_0x4df9c6){_0x4762ed[_0x83b3('0x43')]=_0x4df9c6;return _0x4762ed;})['then'](respondWithFilteredResult(_0x542531,_0xa7f2b8))[_0x83b3('0x44')](handleError(_0x542531,null));};exports['show']=function(_0x5a28dc,_0x4138bb){var _0x4a297b={'raw':!![],'where':{'id':_0x5a28dc[_0x83b3('0x45')]['id']}},_0x121893={};_0x121893['model']=_[_0x83b3('0x46')](db[_0x83b3('0x2d')][_0x83b3('0x2e')]);_0x121893[_0x83b3('0x33')]=_[_0x83b3('0x46')](_0x5a28dc['query']);_0x121893[_0x83b3('0x34')]=_[_0x83b3('0x35')](_0x121893[_0x83b3('0x32')],_0x121893[_0x83b3('0x33')]);_0x4a297b['attributes']=_[_0x83b3('0x35')](_0x121893[_0x83b3('0x32')],qs[_0x83b3('0x37')](_0x5a28dc[_0x83b3('0x33')][_0x83b3('0x37')]));_0x4a297b[_0x83b3('0x36')]=_0x4a297b['attributes'][_0x83b3('0x38')]?_0x4a297b[_0x83b3('0x36')]:_0x121893['model'];if(_0x5a28dc[_0x83b3('0x33')][_0x83b3('0x47')]){_0x4a297b['include']=[{'all':!![]}];}_0x4a297b=_[_0x83b3('0x3e')]({},_0x4a297b,_0x5a28dc['options']);return db[_0x83b3('0x2d')][_0x83b3('0x48')](_0x4a297b)[_0x83b3('0x26')](handleEntityNotFound(_0x4138bb,null))['then'](respondWithResult(_0x4138bb,null))[_0x83b3('0x44')](handleError(_0x4138bb,null));};exports[_0x83b3('0x49')]=function(_0xbe121f,_0x138b55){return db[_0x83b3('0x2d')][_0x83b3('0x49')](_0xbe121f[_0x83b3('0x4a')],{})[_0x83b3('0x26')](respondWithResult(_0x138b55,0xc9))[_0x83b3('0x44')](handleError(_0x138b55,null));};exports[_0x83b3('0x25')]=function(_0x6c11bd,_0x7cf904){if(_0x6c11bd['body']['id']){delete _0x6c11bd['body']['id'];}return db[_0x83b3('0x2d')][_0x83b3('0x48')]({'where':{'id':_0x6c11bd[_0x83b3('0x45')]['id']}})[_0x83b3('0x26')](handleEntityNotFound(_0x7cf904,null))[_0x83b3('0x26')](saveUpdates(_0x6c11bd[_0x83b3('0x4a')],null))['then'](respondWithResult(_0x7cf904,null))[_0x83b3('0x44')](handleError(_0x7cf904,null));};exports[_0x83b3('0x27')]=function(_0x253938,_0x10e2f5){return db[_0x83b3('0x2d')][_0x83b3('0x48')]({'where':{'id':_0x253938[_0x83b3('0x45')]['id']}})[_0x83b3('0x26')](handleEntityNotFound(_0x10e2f5,null))[_0x83b3('0x26')](removeEntity(_0x10e2f5,null))[_0x83b3('0x44')](handleError(_0x10e2f5,null));};exports['describe']=function(_0x270dc2,_0x83adf9){return db[_0x83b3('0x2d')][_0x83b3('0x4b')]()[_0x83b3('0x26')](respondWithResult(_0x83adf9,null))['catch'](handleError(_0x83adf9,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 17dbf2b..fd588c3 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 _0xc16b=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x5460e5,_0x13d3d3){var _0x3c327b=function(_0x52c43f){while(--_0x52c43f){_0x5460e5['push'](_0x5460e5['shift']());}};_0x3c327b(++_0x13d3d3);}(_0xc16b,0xa0));var _0xbc16=function(_0x5b3b3b,_0x245a9f){_0x5b3b3b=_0x5b3b3b-0x0;var _0x50cacf=_0xc16b[_0x5b3b3b];return _0x50cacf;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var logger=require('../../config/logger')(_0xbc16('0x2'));var moment=require(_0xbc16('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc16('0x4'));var rimraf=require(_0xbc16('0x5'));var config=require(_0xbc16('0x6'));var attributes=require(_0xbc16('0x7'));module[_0xbc16('0x8')]=function(_0x4b98ba,_0x1a4e19){return _0x4b98ba[_0xbc16('0x9')](_0xbc16('0xa'),attributes,{'tableName':_0xbc16('0xb'),'paranoid':![],'indexes':[{'name':_0xbc16('0xc'),'fields':[_0xbc16('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc447=['../../config/environment','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5cbd8b,_0x2e7a74){var _0xd53d8f=function(_0x2e0eeb){while(--_0x2e0eeb){_0x5cbd8b['push'](_0x5cbd8b['shift']());}};_0xd53d8f(++_0x2e7a74);}(_0xc447,0xa4));var _0x7c44=function(_0x573f8b,_0x34a870){_0x573f8b=_0x573f8b-0x0;var _0x28dd4a=_0xc447[_0x573f8b];return _0x28dd4a;};'use strict';var _=require(_0x7c44('0x0'));var util=require(_0x7c44('0x1'));var logger=require(_0x7c44('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7c44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c44('0x4'));var rimraf=require(_0x7c44('0x5'));var config=require(_0x7c44('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x31f922,_0x281fd3){return _0x31f922[_0x7c44('0x7')]('ChatTransferReport',attributes,{'tableName':_0x7c44('0x8'),'paranoid':![],'indexes':[{'name':_0x7c44('0x9'),'fields':[_0x7c44('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index da49f48..9c45700 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 _0x6ab1=['debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6ab1,0xfc));var _0x16ab=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x6ab1[_0x273f77];return _0x71e147;};'use strict';var _=require(_0x16ab('0x0'));var util=require(_0x16ab('0x1'));var moment=require(_0x16ab('0x2'));var BPromise=require(_0x16ab('0x3'));var rs=require(_0x16ab('0x4'));var fs=require('fs');var Redis=require(_0x16ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x16ab('0x6'));var logger=require(_0x16ab('0x7'))('rpc');var config=require(_0x16ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x16ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f28dc,_0x47be60,_0x5ee303){return new BPromise(function(_0x1b8e08,_0x47271e){return client['request'](_0x2f28dc,_0x5ee303)[_0x16ab('0xa')](function(_0x199628){logger[_0x16ab('0xb')](_0x16ab('0xc'),_0x47be60,_0x16ab('0xd'));logger[_0x16ab('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x47be60,_0x16ab('0xd'),JSON[_0x16ab('0xf')](_0x199628));if(_0x199628[_0x16ab('0x10')]){if(_0x199628[_0x16ab('0x10')]['code']===0x1f4){logger[_0x16ab('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x47be60,_0x199628[_0x16ab('0x10')][_0x16ab('0x11')]);return _0x47271e(_0x199628[_0x16ab('0x10')][_0x16ab('0x11')]);}logger[_0x16ab('0x10')](_0x16ab('0xc'),_0x47be60,_0x199628[_0x16ab('0x10')]['message']);return _0x1b8e08(_0x199628[_0x16ab('0x10')][_0x16ab('0x11')]);}else{logger[_0x16ab('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x47be60,_0x16ab('0xd'));_0x1b8e08(_0x199628[_0x16ab('0x12')][_0x16ab('0x11')]);}})['catch'](function(_0x3fb621){logger[_0x16ab('0x10')](_0x16ab('0xc'),_0x47be60,_0x3fb621);_0x47271e(_0x3fb621);});});} \ No newline at end of file +var _0xe14f=['../../config/environment','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x249f8c,_0xfb3946){var _0x5e224a=function(_0xd4c5a1){while(--_0xd4c5a1){_0x249f8c['push'](_0x249f8c['shift']());}};_0x5e224a(++_0xfb3946);}(_0xe14f,0x1db));var _0xfe14=function(_0x22cabc,_0x39776d){_0x22cabc=_0x22cabc-0x0;var _0x28a8dc=_0xe14f[_0x22cabc];return _0x28a8dc;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var moment=require(_0xfe14('0x2'));var BPromise=require(_0xfe14('0x3'));var rs=require(_0xfe14('0x4'));var fs=require('fs');var Redis=require(_0xfe14('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe14('0x6'))(_0xfe14('0x7'));var config=require(_0xfe14('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfe14('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45141c,_0x56408b,_0x3a0409){return new BPromise(function(_0x38e52b,_0x3e68c0){return client[_0xfe14('0xa')](_0x45141c,_0x3a0409)['then'](function(_0x5a3c48){logger[_0xfe14('0xb')](_0xfe14('0xc'),_0x56408b,_0xfe14('0xd'));logger[_0xfe14('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x56408b,_0xfe14('0xd'),JSON[_0xfe14('0xf')](_0x5a3c48));if(_0x5a3c48[_0xfe14('0x10')]){if(_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x11')]===0x1f4){logger['error'](_0xfe14('0xc'),_0x56408b,_0x5a3c48['error'][_0xfe14('0x12')]);return _0x3e68c0(_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x12')]);}logger[_0xfe14('0x10')](_0xfe14('0xc'),_0x56408b,_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x12')]);return _0x38e52b(_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x12')]);}else{logger['info'](_0xfe14('0xc'),_0x56408b,_0xfe14('0xd'));_0x38e52b(_0x5a3c48[_0xfe14('0x13')][_0xfe14('0x12')]);}})[_0xfe14('0x14')](function(_0x41c9ab){logger['error'](_0xfe14('0xc'),_0x56408b,_0x41c9ab);_0x3e68c0(_0x41c9ab);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 4334230..3e608ad 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 _0x5062=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','path','connect-timeout'];(function(_0x27793a,_0x1bf59a){var _0x4dc325=function(_0x2ccf27){while(--_0x2ccf27){_0x27793a['push'](_0x27793a['shift']());}};_0x4dc325(++_0x1bf59a);}(_0x5062,0xcf));var _0x2506=function(_0x3d6d0e,_0x5f5141){_0x3d6d0e=_0x3d6d0e-0x0;var _0xebbe34=_0x5062[_0x3d6d0e];return _0xebbe34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2506('0x0'));var timeout=require(_0x2506('0x1'));var express=require('express');var router=express[_0x2506('0x2')]();var fs_extra=require(_0x2506('0x3'));var auth=require(_0x2506('0x4'));var interaction=require(_0x2506('0x5'));var config=require(_0x2506('0x6'));var controller=require(_0x2506('0x7'));router[_0x2506('0x8')]('/',auth[_0x2506('0x9')](),controller[_0x2506('0xa')]);router[_0x2506('0x8')]('/describe',auth[_0x2506('0x9')](),controller[_0x2506('0xb')]);router[_0x2506('0x8')](_0x2506('0xc'),auth['isAuthenticated'](),controller[_0x2506('0xd')]);router[_0x2506('0xe')]('/',auth[_0x2506('0x9')](),controller['create']);router[_0x2506('0xf')](_0x2506('0xc'),auth[_0x2506('0x9')](),controller['update']);router[_0x2506('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2506('0x11')]);module[_0x2506('0x12')]=router; \ No newline at end of file +var _0xcbaf=['index','/describe','describe','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x507892,_0x54710d){var _0x2fed57=function(_0x2ed4f0){while(--_0x2ed4f0){_0x507892['push'](_0x507892['shift']());}};_0x2fed57(++_0x54710d);}(_0xcbaf,0x171));var _0xfcba=function(_0x1cab98,_0x1bd8a6){_0x1cab98=_0x1cab98-0x0;var _0x3bef4b=_0xcbaf[_0x1cab98];return _0x3bef4b;};'use strict';var multer=require('multer');var util=require(_0xfcba('0x0'));var path=require(_0xfcba('0x1'));var timeout=require(_0xfcba('0x2'));var express=require(_0xfcba('0x3'));var router=express[_0xfcba('0x4')]();var fs_extra=require(_0xfcba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfcba('0x6'));var controller=require('./chatTransferReport.controller');router[_0xfcba('0x7')]('/',auth[_0xfcba('0x8')](),controller[_0xfcba('0x9')]);router[_0xfcba('0x7')](_0xfcba('0xa'),auth['isAuthenticated'](),controller[_0xfcba('0xb')]);router[_0xfcba('0x7')]('/:id',auth[_0xfcba('0x8')](),controller['show']);router['post']('/',auth[_0xfcba('0x8')](),controller[_0xfcba('0xc')]);router[_0xfcba('0xd')](_0xfcba('0xe'),auth[_0xfcba('0x8')](),controller[_0xfcba('0xf')]);router[_0xfcba('0x10')]('/:id',auth[_0xfcba('0x8')](),controller['destroy']);module[_0xfcba('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e453a40..970cb48 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 _0x2ce1=['ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','INTEGER'];(function(_0x5a0fde,_0x1e9a29){var _0x4816db=function(_0x4af880){while(--_0x4af880){_0x5a0fde['push'](_0x5a0fde['shift']());}};_0x4816db(++_0x1e9a29);}(_0x2ce1,0x1df));var _0x12ce=function(_0x4e2a0a,_0x3ec730){_0x4e2a0a=_0x4e2a0a-0x0;var _0x1f063d=_0x2ce1[_0x4e2a0a];return _0x1f063d;};'use strict';var Sequelize=require(_0x12ce('0x0'));var rs=require(_0x12ce('0x1'));module['exports']={'name':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x12ce('0x2')]},'mapKey':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x3')},'mapKeyOffline':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':_0x12ce('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':_0x12ce('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x12ce('0x7')]('rounded',_0x12ce('0x8')),'defaultValue':_0x12ce('0x9')},'header_online':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xa')},'start_chat_button':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xb')},'offline_chat_button':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xc')},'header_offline':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xd')},'download_transcript':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x12ce('0x10')]},'closingQuestion':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x13')},'noteTitle':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x14')},'placeholderMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x15')},'closingMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x17')},'conditionAgreement':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x18')},'ratingType':{'type':Sequelize[_0x12ce('0x7')](_0x12ce('0x19'),'thumb'),'defaultValue':_0x12ce('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x12ce('0x10')],'defaultValue':function(){return JSON[_0x12ce('0x1a')]({'items':[{'type':_0x12ce('0x1b'),'variable':null,'config':{'placeholder':_0x12ce('0x1c'),'type':_0x12ce('0x1d'),'required':!![]},'props':{'title':_0x12ce('0x1c'),'helpText':''}},{'type':_0x12ce('0x1b'),'props':{'title':_0x12ce('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x12ce('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x12ce('0x1e'))?JSON[_0x12ce('0x1f')](this[_0x12ce('0x20')](_0x12ce('0x1e'))):{};},'set':function(_0x440aa4){return this['setDataValue'](_0x12ce('0x1e'),JSON['stringify'](_0x440aa4));}},'offlineForm':{'type':Sequelize[_0x12ce('0x10')],'defaultValue':function(){return JSON[_0x12ce('0x1a')]({'items':[{'type':_0x12ce('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x12ce('0x3'),'type':_0x12ce('0x3')},'variable':null},{'type':_0x12ce('0x21'),'config':{'placeholder':_0x12ce('0x22')},'props':{'title':_0x12ce('0x22'),'helpText':_0x12ce('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x12ce('0x1f')](this['getDataValue'](_0x12ce('0x24'))):{};},'set':function(_0x303092){return this[_0x12ce('0x25')](_0x12ce('0x24'),JSON['stringify'](_0x303092));}},'token':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':function(){return rs[_0x12ce('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x12ce('0x2')]},'forwardOffline':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x12ce('0x2')]},'waitingTitle':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x17')},'sendUnmanaged':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x12ce('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x12ce('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x12ce('0x2b');}},'notificationSound':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x12ce('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x2d')},'verticalAlignment':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x2e')},'messagesAlignment':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x12ce('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':_0x12ce('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x12ce('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x12ce('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x30')},'systemAvatar':{'type':Sequelize[_0x12ce('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x12ce('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![],'comment':_0x12ce('0x32'),'set':function(_0x5cc6d8){if(!_0x5cc6d8)this[_0x12ce('0x25')](_0x12ce('0x33'),null);this[_0x12ce('0x25')](_0x12ce('0x34'),_0x5cc6d8);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x12ce('0x2')]},'vidaooTopic':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':function(){return _0x12ce('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x12ce('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x12ce('0x10')]}}; \ No newline at end of file +var _0x00b4=['Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00b4,0x76));var _0x400b=function(_0x28db96,_0x1bdda9){_0x28db96=_0x28db96-0x0;var _0x51acc6=_0x00b4[_0x28db96];return _0x51acc6;};'use strict';var Sequelize=require(_0x400b('0x0'));var rs=require('randomstring');module[_0x400b('0x1')]={'name':{'type':Sequelize[_0x400b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'unique':_0x400b('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x4')},'mapKeyOffline':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x4')},'key':{'type':Sequelize[_0x400b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x400b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':_0x400b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':_0x400b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x400b('0x2')]},'animation':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x400b('0x9')]('rounded','squared'),'defaultValue':_0x400b('0xa')},'header_online':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0xb')},'offline_chat_button':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0xd')},'download_transcript':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x12')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x13')},'ratingType':{'type':Sequelize[_0x400b('0x9')]('star',_0x400b('0x14')),'defaultValue':_0x400b('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x400b('0x16')],'defaultValue':function(){return JSON[_0x400b('0x17')]({'items':[{'type':_0x400b('0x18'),'variable':null,'config':{'placeholder':_0x400b('0x19'),'type':_0x400b('0x1a'),'required':!![]},'props':{'title':_0x400b('0x19'),'helpText':''}},{'type':_0x400b('0x18'),'props':{'title':_0x400b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x400b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x400b('0x1b')](_0x400b('0x1c'))?JSON[_0x400b('0x1d')](this['getDataValue'](_0x400b('0x1c'))):{};},'set':function(_0x395325){return this[_0x400b('0x1e')]('onlineForm',JSON['stringify'](_0x395325));}},'offlineForm':{'type':Sequelize[_0x400b('0x16')],'defaultValue':function(){return JSON[_0x400b('0x17')]({'items':[{'type':_0x400b('0x18'),'props':{'title':_0x400b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x400b('0x4'),'type':_0x400b('0x4')},'variable':null},{'type':_0x400b('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x400b('0x20'),'helpText':_0x400b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x400b('0x1b')](_0x400b('0x22'))?JSON['parse'](this[_0x400b('0x1b')](_0x400b('0x22'))):{};},'set':function(_0x43963e){return this[_0x400b('0x1e')](_0x400b('0x22'),JSON[_0x400b('0x17')](_0x43963e));}},'token':{'type':Sequelize[_0x400b('0x2')],'defaultValue':function(){return rs[_0x400b('0x23')]();}},'autoclose':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x400b('0x2')]},'forwardOffline':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x400b('0x2')]},'waitingTitle':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x24')},'waitingMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x27')},'sendUnmanaged':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x400b('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x400b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x400b('0x16')],'defaultValue':function(){return _0x400b('0x28');}},'notificationSound':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x400b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x2a')},'verticalAlignment':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x400b('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':_0x400b('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x400b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x400b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x2e')},'systemAvatar':{'type':Sequelize[_0x400b('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x400b('0xe')],'comment':_0x400b('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![],'comment':_0x400b('0x30'),'set':function(_0x43df8a){if(!_0x43df8a)this['setDataValue'](_0x400b('0x31'),null);this['setDataValue'](_0x400b('0x32'),_0x43df8a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x400b('0x2')]},'vidaooTopic':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x400b('0x2')],'defaultValue':function(){return _0x400b('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x400b('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 81eb114..7d6be0e 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 _0x5096=['params','length','find','catch','create','testWildcardValidity','body','address','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','from','contact','headers','threadId','closed','ChatInteraction','externalUrl','interaction','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','offline','files','ValidationError','difference','send','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','tag','getSnippet','interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','3.9.0','origin','remote','connection','remoteAddress','replace','alignment','color','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','json','getApplications','chatProactiveAction','addProactiveActions','getFields','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','User','getAgents','mustache','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','info','sendStatus','status','end','offset','undefined','count','update','get','ChatWebsites','destroy','stack','name','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','stringify','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','map','query','keys','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show'];(function(_0x17aa2e,_0x15508a){var _0x11bee9=function(_0x2a6a99){while(--_0x2a6a99){_0x17aa2e['push'](_0x17aa2e['shift']());}};_0x11bee9(++_0x15508a);}(_0x5096,0xd6));var _0x6509=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0x5096[_0x65ff6c];return _0x238215;};'use strict';var Mustache=require(_0x6509('0x0'));var util=require(_0x6509('0x1'));var path=require(_0x6509('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6509('0x3'));var _=require(_0x6509('0x4'));var querystring=require(_0x6509('0x5'));var htmlToText=require(_0x6509('0x6'));var Redis=require(_0x6509('0x7'));var jayson=require(_0x6509('0x8'));var qs=require(_0x6509('0x9'));var logger=require('../../config/logger')(_0x6509('0xa'));var config=require(_0x6509('0xb'));var APIBadRequestError=require(_0x6509('0xc'))[_0x6509('0xd')];var APINotFoundError=require(_0x6509('0xc'))[_0x6509('0xe')];var APIOutOfIntervalError=require(_0x6509('0xc'))[_0x6509('0xf')];var APIHandleError=require(_0x6509('0xc'))[_0x6509('0x10')];var APIConflictError=require(_0x6509('0xc'))['APIConflictError'];var wildcardUtils=require(_0x6509('0x11'));var URL=require(_0x6509('0x12'))[_0x6509('0x13')];var db=require(_0x6509('0x14'))['db'];config['redis']=_[_0x6509('0x15')](config[_0x6509('0x16')],{'host':_0x6509('0x17'),'port':0x18eb});var socket=require(_0x6509('0x18'))(new Redis(config[_0x6509('0x16')]));require(_0x6509('0x19'))[_0x6509('0x1a')](socket);var client=jayson[_0x6509('0x1b')][_0x6509('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0x6509('0x1c')]({'port':0x232b});var client9001=jayson['client'][_0x6509('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x35df2b,_0xdb3430,_0x3b9978,_0x4ef411){return new Promise(function(_0x2acec6,_0x44bb20){var _0x53c174=_0x4ef411||client;return _0x53c174['request'](_0x35df2b,_0x3b9978)[_0x6509('0x1d')](function(_0x39267d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xdb3430,_0x6509('0x1e'));logger[_0x6509('0x1f')](_0x6509('0x20'),_0xdb3430,_0x6509('0x1e'),JSON['stringify'](_0x39267d));if(_0x39267d[_0x6509('0x21')]){if(_0x39267d[_0x6509('0x21')][_0x6509('0x22')]===0x1f4){logger[_0x6509('0x21')](_0x6509('0x23'),_0xdb3430,_0x39267d[_0x6509('0x21')][_0x6509('0x24')]);return _0x44bb20(_0x39267d[_0x6509('0x21')][_0x6509('0x24')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0xdb3430,_0x39267d[_0x6509('0x21')][_0x6509('0x24')]);return _0x2acec6(_0x39267d['error'][_0x6509('0x24')]);}else{logger[_0x6509('0x25')](_0x6509('0x23'),_0xdb3430,_0x6509('0x1e'));_0x2acec6(_0x39267d['result']['message']);}})['catch'](function(_0x3015d1){logger[_0x6509('0x21')]('ChatWebsite,\x20%s,\x20%s',_0xdb3430,_0x3015d1);_0x44bb20(_0x3015d1);});});}function respondWithStatusCode(_0x3bc27b,_0x590948){_0x590948=_0x590948||0xcc;return function(_0x1ecc8b){if(_0x1ecc8b){return _0x3bc27b[_0x6509('0x26')](_0x590948);}return _0x3bc27b[_0x6509('0x27')](_0x590948)[_0x6509('0x28')]();};}function respondWithResult(_0x4287c6,_0xa7adf1){_0xa7adf1=_0xa7adf1||0xc8;return function(_0x261130){if(_0x261130){return _0x4287c6[_0x6509('0x27')](_0xa7adf1)['json'](_0x261130);}};}function respondWithFilteredResult(_0x37e9ef,_0x3f517e){return function(_0xcb9d99){if(_0xcb9d99){var _0xa91505=typeof _0x3f517e[_0x6509('0x29')]===_0x6509('0x2a')&&typeof _0x3f517e['limit']===_0x6509('0x2a');var _0x5733c8=_0xcb9d99[_0x6509('0x2b')];var _0x5ac1a8=_0xa91505?0x0:_0x3f517e[_0x6509('0x29')];var _0xbee06f=_0xa91505?_0xcb9d99[_0x6509('0x2b')]:_0x3f517e[_0x6509('0x29')]+_0x3f517e['limit'];var _0x3bb344;if(_0xbee06f>=_0x5733c8){_0xbee06f=_0x5733c8;_0x3bb344=0xc8;}else{_0x3bb344=0xce;}_0x37e9ef[_0x6509('0x27')](_0x3bb344);return _0x37e9ef['set']('Content-Range',_0x5ac1a8+'-'+_0xbee06f+'/'+_0x5733c8)['json'](_0xcb9d99);}return null;};}function saveUpdates(_0x27bd34){return function(_0x20713a){if(_0x20713a){return _0x20713a[_0x6509('0x2c')](_0x27bd34)[_0x6509('0x1d')](function(_0x34871d){return _0x34871d;});}return null;};}function removeEntity(_0x32db78){return function(_0x320b57){if(_0x320b57){return _0x320b57['destroy']()['then'](function(){var _0x3c9e0e=_0x320b57[_0x6509('0x2d')]({'plain':!![]});var _0x43760a=_0x6509('0x2e');return db['UserProfileResource'][_0x6509('0x2f')]({'where':{'type':_0x43760a,'resourceId':_0x3c9e0e['id']}})[_0x6509('0x1d')](function(){return _0x320b57;});})[_0x6509('0x1d')](function(){_0x32db78[_0x6509('0x27')](0xcc)[_0x6509('0x28')]();});}};}function handleEntityNotFound(_0x952bae){return function(_0x2229f9){if(!_0x2229f9){_0x952bae['sendStatus'](0x194);}return _0x2229f9;};}function handleError(_0x3165fa,_0x3613b2){_0x3613b2=_0x3613b2||0x1f4;return function(_0xdd0147){logger[_0x6509('0x21')](_0xdd0147[_0x6509('0x30')]);if(_0xdd0147[_0x6509('0x31')]){delete _0xdd0147[_0x6509('0x31')];}_0x3165fa[_0x6509('0x27')](_0x3613b2)['send'](_0xdd0147);};}function createInteractionObject(_0x1045f1,_0x3b4cb4,_0x14d81c,_0x5ab77f){var _0x19aab7=require(_0x6509('0x32'));var _0x2c1697=new _0x19aab7();var _0x3b6953=_0x2c1697[_0x6509('0x33')](_0x14d81c[_0x6509('0x34')])[_0x6509('0x35')]();var _0x30700b=_0x3b4cb4[_0x6509('0x36')];if(_0x14d81c[_0x6509('0x37')]){_0x30700b=_0x14d81c[_0x6509('0x37')];}else if(_0x14d81c['x-forwarded-for']){_0x30700b=_[_0x6509('0x38')](_0x14d81c[_0x6509('0x39')][_0x6509('0x3a')](','));}return{'ContactId':_0x5ab77f['id'],'ChatWebsiteId':_0x1045f1,'from':(_0x5ab77f['firstName']||'')+'\x20'+(_0x5ab77f[_0x6509('0x3b')]||''),'customerIp':_0x30700b,'customerPort':_0x14d81c['x-real-port']?_0x14d81c[_0x6509('0x3c')]:null,'referer':_0x3b4cb4[_0x6509('0x3d')],'browserName':_0x3b6953['browser']['name']&&_0x3b6953[_0x6509('0x3e')][_0x6509('0x3f')]?util[_0x6509('0x40')](_0x6509('0x41'),_0x3b6953[_0x6509('0x3e')]['name'],_0x3b6953['browser'][_0x6509('0x3f')]):_0x6509('0x42'),'browserVersion':_0x3b6953[_0x6509('0x3e')][_0x6509('0x3f')]||_0x6509('0x42'),'osName':util[_0x6509('0x40')](_0x6509('0x41'),_0x3b6953['os'][_0x6509('0x31')],_0x3b6953['os'][_0x6509('0x3f')]),'osVersion':_0x3b6953['os'][_0x6509('0x3f')],'deviceModel':_0x3b6953[_0x6509('0x43')][_0x6509('0x44')]&&_0x3b6953[_0x6509('0x43')][_0x6509('0x45')]?util[_0x6509('0x40')](_0x6509('0x46'),_0x3b6953[_0x6509('0x43')]['model'],_0x3b6953['device'][_0x6509('0x45')],_0x3b6953[_0x6509('0x43')][_0x6509('0x47')]):null,'deviceVendor':_0x3b6953[_0x6509('0x43')][_0x6509('0x45')],'deviceType':_0x3b6953[_0x6509('0x43')]['type'],'formData':JSON[_0x6509('0x48')](_0x3b4cb4)};}exports['index']=function(_0x480d57,_0x193757){var _0x52c02b={'include':[{'model':db[_0x6509('0x49')],'as':_0x6509('0x4a')}]},_0x4e475c={},_0x40f1d9={'count':0x0,'rows':[]};var _0x3b1303=_['map'](db[_0x6509('0x4b')][_0x6509('0x4c')],function(_0x296a44){return{'name':_0x296a44[_0x6509('0x4d')],'type':_0x296a44['type']['key']};});_0x4e475c['model']=_[_0x6509('0x4e')](_0x3b1303,_0x6509('0x31'));_0x4e475c[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x480d57[_0x6509('0x4f')]);_0x4e475c['filters']=_[_0x6509('0x51')](_0x4e475c[_0x6509('0x44')],_0x4e475c[_0x6509('0x4f')]);_0x52c02b[_0x6509('0x52')]=_[_0x6509('0x51')](_0x4e475c['model'],qs[_0x6509('0x53')](_0x480d57[_0x6509('0x4f')][_0x6509('0x53')]));_0x52c02b[_0x6509('0x52')]=_0x52c02b[_0x6509('0x52')]['length']?_0x52c02b[_0x6509('0x52')]:_0x4e475c['model'];if(!_0x480d57[_0x6509('0x4f')]['hasOwnProperty'](_0x6509('0x54'))){_0x52c02b[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x480d57['query'][_0x6509('0x55')]);_0x52c02b[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x480d57['query'][_0x6509('0x29')]);}_0x52c02b['order']=qs[_0x6509('0x56')](_0x480d57[_0x6509('0x4f')]['sort']);_0x52c02b[_0x6509('0x57')]=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x480d57['query'],_0x4e475c[_0x6509('0x58')]),_0x3b1303);if(_0x480d57['query'][_0x6509('0x5a')]){_0x52c02b['where']=_[_0x6509('0x5b')](_0x52c02b[_0x6509('0x57')],{'$or':_['map'](_0x3b1303,function(_0x548b5e){if(_0x548b5e['type']!==_0x6509('0x5c')){var _0x21ef44={};_0x21ef44[_0x548b5e[_0x6509('0x31')]]={'$like':'%'+_0x480d57['query'][_0x6509('0x5a')]+'%'};return _0x21ef44;}})});}_0x52c02b=_['merge']({},_0x52c02b,_0x480d57[_0x6509('0x5d')]);var _0x1b60a3={'where':_0x52c02b[_0x6509('0x57')]};return db[_0x6509('0x4b')][_0x6509('0x2b')](_0x1b60a3)[_0x6509('0x1d')](function(_0x3fb67a){_0x40f1d9[_0x6509('0x2b')]=_0x3fb67a;if(_0x480d57[_0x6509('0x4f')][_0x6509('0x5e')]){_0x52c02b[_0x6509('0x5f')]=[{'all':!![]}];}return db[_0x6509('0x4b')]['findAll'](_0x52c02b);})[_0x6509('0x1d')](function(_0x4a91eb){_0x40f1d9[_0x6509('0x60')]=_0x4a91eb;return _0x40f1d9;})[_0x6509('0x1d')](respondWithFilteredResult(_0x193757,_0x52c02b))['catch'](handleError(_0x193757,null));};exports[_0x6509('0x61')]=function(_0x353847,_0x13a567){var _0x443ace={'raw':![],'where':{'id':_0x353847[_0x6509('0x62')]['id']},'include':[{'model':db[_0x6509('0x49')],'as':_0x6509('0x4a')}]},_0x1f3178={};_0x1f3178[_0x6509('0x44')]=_[_0x6509('0x50')](db[_0x6509('0x4b')][_0x6509('0x4c')]);_0x1f3178[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x353847['query']);_0x1f3178['filters']=_[_0x6509('0x51')](_0x1f3178['model'],_0x1f3178[_0x6509('0x4f')]);_0x443ace['attributes']=_[_0x6509('0x51')](_0x1f3178[_0x6509('0x44')],qs[_0x6509('0x53')](_0x353847[_0x6509('0x4f')][_0x6509('0x53')]));_0x443ace[_0x6509('0x52')]=_0x443ace[_0x6509('0x52')][_0x6509('0x63')]?_0x443ace['attributes']:_0x1f3178['model'];if(_0x353847['query'][_0x6509('0x5e')]){_0x443ace[_0x6509('0x5f')]=[{'all':!![]}];}_0x443ace=_[_0x6509('0x5b')]({},_0x443ace,_0x353847[_0x6509('0x5d')]);return db[_0x6509('0x4b')][_0x6509('0x64')](_0x443ace)[_0x6509('0x1d')](handleEntityNotFound(_0x13a567,null))[_0x6509('0x1d')](respondWithResult(_0x13a567,null))[_0x6509('0x65')](handleError(_0x13a567,null));};exports[_0x6509('0x66')]=function(_0x5cb310,_0x114ef2){if(!wildcardUtils[_0x6509('0x67')](_0x5cb310[_0x6509('0x68')][_0x6509('0x69')])){return handleError(_0x114ef2,null)(new APIBadRequestError('\x22'+_0x5cb310['body'][_0x6509('0x69')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}return db[_0x6509('0x4b')][_0x6509('0x66')](_0x5cb310['body'],{})[_0x6509('0x1d')](function(_0x3899de){var _0xf3143a=_0x5cb310['user'][_0x6509('0x2d')]({'plain':!![]});if(!_0xf3143a)throw new Error(_0x6509('0x6a'));if(_0xf3143a[_0x6509('0x6b')]==='user'){var _0x5a1e8e=_0x3899de[_0x6509('0x2d')]({'plain':!![]});var _0x5a0820=_0x6509('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x5a0820,'userProfileId':_0xf3143a['userProfileId']},'raw':!![]})[_0x6509('0x1d')](function(_0x8cb18b){if(_0x8cb18b&&_0x8cb18b[_0x6509('0x6c')]===0x0){return db[_0x6509('0x6d')]['create']({'name':_0x5a1e8e['name'],'resourceId':_0x5a1e8e['id'],'type':_0x8cb18b['name'],'sectionId':_0x8cb18b['id']},{})[_0x6509('0x1d')](function(){return _0x3899de;});}else{return _0x3899de;}})['catch'](function(_0x59d131){logger[_0x6509('0x21')](_0x6509('0x6e'),_0x59d131);throw _0x59d131;});}return _0x3899de;})[_0x6509('0x1d')](respondWithResult(_0x114ef2,0xc9))[_0x6509('0x65')](handleError(_0x114ef2,null));};exports['update']=function(_0x2774b4,_0x46a69a){if(!wildcardUtils[_0x6509('0x67')](_0x2774b4[_0x6509('0x68')][_0x6509('0x69')])){return handleError(_0x46a69a,null)(new APIBadRequestError('\x22'+_0x2774b4[_0x6509('0x68')][_0x6509('0x69')]+_0x6509('0x6f')));}if(_0x2774b4[_0x6509('0x68')]['id']){delete _0x2774b4[_0x6509('0x68')]['id'];}return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x2774b4['params']['id']},'include':[{'model':db[_0x6509('0x49')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x46a69a,null))[_0x6509('0x1d')](saveUpdates(_0x2774b4[_0x6509('0x68')],null))['then'](respondWithResult(_0x46a69a,null))[_0x6509('0x65')](handleError(_0x46a69a,null));};exports[_0x6509('0x2f')]=function(_0x3276e5,_0xb85645){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x3276e5[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0xb85645,null))[_0x6509('0x1d')](removeEntity(_0xb85645,null))[_0x6509('0x65')](handleError(_0xb85645,null));};exports[_0x6509('0x70')]=function(_0x2de805,_0x56e9e7){return db['ChatWebsite'][_0x6509('0x70')]()[_0x6509('0x1d')](respondWithResult(_0x56e9e7,null))[_0x6509('0x65')](handleError(_0x56e9e7,null));};exports[_0x6509('0x71')]=function(_0x52757a,_0x33daa8){if(_0x52757a[_0x6509('0x68')]['id']){delete _0x52757a[_0x6509('0x68')]['id'];}return db[_0x6509('0x4b')]['find']({'where':{'id':_0x52757a[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x33daa8,null))[_0x6509('0x1d')](function(_0x3152ff){if(_0x3152ff){_0x52757a[_0x6509('0x68')][_0x6509('0x72')]=_0x3152ff['id'];return db[_0x6509('0x73')][_0x6509('0x66')](_0x52757a[_0x6509('0x68')]);}})[_0x6509('0x1d')](respondWithResult(_0x33daa8,null))[_0x6509('0x65')](handleError(_0x33daa8,null));};exports[_0x6509('0x74')]=function(_0x3f5412,_0x521bef){var _0x2ac517={'raw':![],'where':{}};var _0x2feaf7={};var _0x3cd9bd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6509('0x75')]({'where':{'id':_0x3f5412[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x521bef,null))[_0x6509('0x1d')](function(_0x2938ba){if(_0x2938ba){_0x2feaf7[_0x6509('0x44')]=_['keys'](db[_0x6509('0x73')][_0x6509('0x4c')]);_0x2feaf7[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x3f5412['query']);_0x2feaf7[_0x6509('0x58')]=_[_0x6509('0x51')](_0x2feaf7[_0x6509('0x44')],_0x2feaf7['query']);_0x2ac517[_0x6509('0x52')]=_[_0x6509('0x51')](_0x2feaf7[_0x6509('0x44')],qs['fields'](_0x3f5412['query'][_0x6509('0x53')]));_0x2ac517['attributes']=_0x2ac517['attributes']['length']?_0x2ac517[_0x6509('0x52')]:_0x2feaf7['model'];if(!_0x3f5412['query'][_0x6509('0x76')](_0x6509('0x54'))){_0x2ac517[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x3f5412[_0x6509('0x4f')]['limit']);_0x2ac517[_0x6509('0x29')]=qs['offset'](_0x3f5412[_0x6509('0x4f')][_0x6509('0x29')]);}_0x2ac517[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x3f5412['query']['sort']);_0x2ac517[_0x6509('0x57')]=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x3f5412['query'],_0x2feaf7[_0x6509('0x58')]));_0x2ac517[_0x6509('0x57')][_0x6509('0x72')]=_0x2938ba['id'];if(_0x3f5412['query'][_0x6509('0x5a')]){_0x2ac517[_0x6509('0x57')]=_['merge'](_0x2ac517[_0x6509('0x57')],{'$or':_['map'](_0x2ac517['attributes'],function(_0x37554f){var _0x599a2f={};_0x599a2f[_0x37554f]={'$like':'%'+_0x3f5412[_0x6509('0x4f')][_0x6509('0x5a')]+'%'};return _0x599a2f;})});}_0x2ac517=_[_0x6509('0x5b')]({},_0x2ac517,_0x3f5412[_0x6509('0x5d')]);return db['Disposition'][_0x6509('0x2b')]({'where':_0x2ac517['where']})[_0x6509('0x1d')](function(_0x43fd3f){_0x3cd9bd[_0x6509('0x2b')]=_0x43fd3f;if(_0x3f5412[_0x6509('0x4f')]['includeAll']){_0x2ac517[_0x6509('0x5f')]=[{'all':!![]}];}return db[_0x6509('0x73')][_0x6509('0x78')](_0x2ac517);})[_0x6509('0x1d')](function(_0x3e22e6){_0x3cd9bd[_0x6509('0x60')]=_0x3e22e6;return _0x3cd9bd;});}})['then'](respondWithFilteredResult(_0x521bef,_0x2ac517))[_0x6509('0x65')](handleError(_0x521bef,null));};exports[_0x6509('0x79')]=function(_0x3e0b09,_0x2f9c6b){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x3e0b09[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x2f9c6b,null))['then'](function(_0x3381f3){if(_0x3381f3){return _0x3381f3[_0x6509('0x79')](_0x3e0b09['query']['ids']);}})['then'](respondWithStatusCode(_0x2f9c6b,null))[_0x6509('0x65')](handleError(_0x2f9c6b,null));};exports[_0x6509('0x7a')]=function(_0x37e5ed,_0x3ce243){if(_0x37e5ed['body']['id']){delete _0x37e5ed[_0x6509('0x68')]['id'];}return db[_0x6509('0x4b')]['find']({'where':{'id':_0x37e5ed[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x3ce243,null))[_0x6509('0x1d')](function(_0x2aa56b){if(_0x2aa56b){_0x37e5ed[_0x6509('0x68')][_0x6509('0x72')]=_0x2aa56b['id'];return db[_0x6509('0x7b')][_0x6509('0x66')](_0x37e5ed[_0x6509('0x68')]);}})[_0x6509('0x1d')](respondWithResult(_0x3ce243,null))[_0x6509('0x65')](handleError(_0x3ce243,null));};exports[_0x6509('0x7c')]=function(_0x49a3f0,_0x3aefbb){var _0x3047c9={'raw':![],'where':{}};var _0x5b0749={};var _0x5c8212={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6509('0x75')]({'where':{'id':_0x49a3f0[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x3aefbb,null))['then'](function(_0x2dcfd7){if(_0x2dcfd7){_0x5b0749['model']=_[_0x6509('0x50')](db['CannedAnswer'][_0x6509('0x4c')]);_0x5b0749['query']=_[_0x6509('0x50')](_0x49a3f0['query']);_0x5b0749[_0x6509('0x58')]=_[_0x6509('0x51')](_0x5b0749[_0x6509('0x44')],_0x5b0749[_0x6509('0x4f')]);_0x3047c9[_0x6509('0x52')]=_['intersection'](_0x5b0749['model'],qs[_0x6509('0x53')](_0x49a3f0[_0x6509('0x4f')][_0x6509('0x53')]));_0x3047c9[_0x6509('0x52')]=_0x3047c9['attributes']['length']?_0x3047c9[_0x6509('0x52')]:_0x5b0749[_0x6509('0x44')];if(!_0x49a3f0[_0x6509('0x4f')][_0x6509('0x76')]('nolimit')){_0x3047c9[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x49a3f0[_0x6509('0x4f')][_0x6509('0x55')]);_0x3047c9[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x49a3f0[_0x6509('0x4f')]['offset']);}_0x3047c9['order']=qs[_0x6509('0x56')](_0x49a3f0['query'][_0x6509('0x56')]);_0x3047c9['where']=qs['filters'](_[_0x6509('0x59')](_0x49a3f0[_0x6509('0x4f')],_0x5b0749[_0x6509('0x58')]));_0x3047c9[_0x6509('0x57')][_0x6509('0x72')]=_0x2dcfd7['id'];if(_0x49a3f0[_0x6509('0x4f')][_0x6509('0x5a')]){_0x3047c9[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x3047c9[_0x6509('0x57')],{'$or':_['map'](_0x3047c9['attributes'],function(_0x50270a){var _0x58c68d={};_0x58c68d[_0x50270a]={'$like':'%'+_0x49a3f0['query'][_0x6509('0x5a')]+'%'};return _0x58c68d;})});}_0x3047c9=_['merge']({},_0x3047c9,_0x49a3f0[_0x6509('0x5d')]);return db[_0x6509('0x7b')][_0x6509('0x2b')]({'where':_0x3047c9[_0x6509('0x57')]})[_0x6509('0x1d')](function(_0x130f11){_0x5c8212[_0x6509('0x2b')]=_0x130f11;if(_0x49a3f0['query'][_0x6509('0x5e')]){_0x3047c9[_0x6509('0x5f')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3047c9);})['then'](function(_0x1c8f7e){_0x5c8212[_0x6509('0x60')]=_0x1c8f7e;return _0x5c8212;});}})[_0x6509('0x1d')](respondWithFilteredResult(_0x3aefbb,_0x3047c9))['catch'](handleError(_0x3aefbb,null));};exports[_0x6509('0x7d')]=function(_0x5b91d4,_0x5a077f){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x5b91d4[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x5a077f,null))[_0x6509('0x1d')](function(_0xacd415){if(_0xacd415){return _0xacd415[_0x6509('0x7d')](_0x5b91d4[_0x6509('0x4f')][_0x6509('0x7e')]);}})[_0x6509('0x1d')](respondWithStatusCode(_0x5a077f,null))['catch'](handleError(_0x5a077f,null));};exports[_0x6509('0x7f')]=function(_0x3ee6cf,_0x5c20a1){_0x3ee6cf[_0x6509('0x68')][_0x6509('0x80')]=_0x3ee6cf[_0x6509('0x81')]['filename'];return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x3ee6cf[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x5c20a1,null))[_0x6509('0x1d')](saveUpdates(_0x3ee6cf[_0x6509('0x68')],null))[_0x6509('0x1d')](respondWithResult(_0x5c20a1,null))['catch'](handleError(_0x5c20a1,null));};exports[_0x6509('0x82')]=function(_0x207b0f,_0x33cded){_0x207b0f[_0x6509('0x68')][_0x6509('0x83')]=_0x207b0f[_0x6509('0x81')][_0x6509('0x84')];return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x207b0f[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x33cded,null))[_0x6509('0x1d')](saveUpdates(_0x207b0f['body'],null))[_0x6509('0x1d')](respondWithResult(_0x33cded,null))[_0x6509('0x65')](handleError(_0x33cded,null));};exports['addCustomerAvatar']=function(_0x158232,_0x4b2421){_0x158232[_0x6509('0x68')][_0x6509('0x85')]=_0x158232[_0x6509('0x81')][_0x6509('0x84')];return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x158232[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x4b2421,null))[_0x6509('0x1d')](saveUpdates(_0x158232[_0x6509('0x68')],null))['then'](respondWithResult(_0x4b2421,null))[_0x6509('0x65')](handleError(_0x4b2421,null));};exports[_0x6509('0x86')]=function(_0xafdfc7,_0x32e990){_0xafdfc7[_0x6509('0x68')][_0x6509('0x87')]=_0xafdfc7[_0x6509('0x81')][_0x6509('0x84')];return db[_0x6509('0x4b')]['find']({'where':{'id':_0xafdfc7[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x32e990,null))['then'](saveUpdates(_0xafdfc7[_0x6509('0x68')],null))['then'](respondWithResult(_0x32e990,null))[_0x6509('0x65')](handleError(_0x32e990,null));};exports[_0x6509('0x88')]=function(_0x595926,_0x52b59e){var _0x578686=path[_0x6509('0x89')](config[_0x6509('0x8a')],'server/files/images/logos/default_logo.svg');var _0x89fb0e={'where':{'id':_0x595926[_0x6509('0x62')]['id']},'attributes':['id',_0x6509('0x80')],'raw':!![]};var _0x1b952a=![];return require(_0x6509('0x8b'))[_0x6509('0x8c')]()['then'](function(_0x1ded52){if(_0x1ded52){_0x1b952a=_0x1ded52[_0x6509('0x8d')];}})[_0x6509('0x1d')](function(){return db[_0x6509('0x4b')][_0x6509('0x64')](_0x89fb0e);})[_0x6509('0x1d')](handleEntityNotFound(_0x52b59e,null))[_0x6509('0x1d')](function(_0x4988a1){if(_0x4988a1){if(!_[_0x6509('0x8e')](_0x4988a1[_0x6509('0x80')])){if(fs['existsSync'](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x8f'),_0x4988a1[_0x6509('0x80')]))&&_0x1b952a){_0x578686=path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x8f'),_0x4988a1[_0x6509('0x80')]);}}return _0x52b59e[_0x6509('0x90')](_0x578686);}})[_0x6509('0x65')](handleError(_0x52b59e,null));};exports[_0x6509('0x91')]=function(_0x87e938,_0x340011){var _0x1dd3a0=path[_0x6509('0x89')](config[_0x6509('0x8a')],'server/files/images/avatars/default_avatar.png');var _0x485a63={'where':{'id':_0x87e938['params']['id']},'attributes':['id',_0x6509('0x83')],'raw':!![]};return db['ChatWebsite']['find'](_0x485a63)[_0x6509('0x1d')](handleEntityNotFound(_0x340011,null))['then'](function(_0x450ee7){if(_0x450ee7){if(!_[_0x6509('0x8e')](_0x450ee7[_0x6509('0x83')])){if(fs[_0x6509('0x92')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x93'),_0x450ee7['agentAvatar']))){_0x1dd3a0=path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x93'),_0x450ee7[_0x6509('0x83')]);}}return _0x340011[_0x6509('0x90')](_0x1dd3a0);}})['catch'](handleError(_0x340011,null));};exports[_0x6509('0x94')]=function(_0x12f6b4,_0x30f3fa){var _0x1e0f90=path[_0x6509('0x89')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x599754={'where':{'id':_0x12f6b4[_0x6509('0x62')]['id']},'attributes':['id',_0x6509('0x85'),_0x6509('0x95')],'raw':!![]};return db[_0x6509('0x4b')][_0x6509('0x64')](_0x599754)['then'](handleEntityNotFound(_0x30f3fa,null))[_0x6509('0x1d')](function(_0x10f74e){if(_0x10f74e){if(!_[_0x6509('0x8e')](_0x10f74e[_0x6509('0x85')])){if(fs[_0x6509('0x92')](path['join'](config[_0x6509('0x8a')],_0x6509('0x93'),_0x10f74e['customerAvatar']))&&_0x10f74e['showCustomerAvatar']){_0x1e0f90=path[_0x6509('0x89')](config['root'],_0x6509('0x93'),_0x10f74e['customerAvatar']);}}return _0x30f3fa[_0x6509('0x90')](_0x1e0f90);}})[_0x6509('0x65')](handleError(_0x30f3fa,null));};exports[_0x6509('0x96')]=function(_0x3a74a4,_0x218ba1){var _0xc09a63=path['join'](config[_0x6509('0x8a')],'server/files/images/avatars/system_avatar.png');var _0x242a2d={'where':{'id':_0x3a74a4[_0x6509('0x62')]['id']},'attributes':['id',_0x6509('0x87')],'raw':!![]};return db[_0x6509('0x4b')][_0x6509('0x64')](_0x242a2d)['then'](handleEntityNotFound(_0x218ba1,null))[_0x6509('0x1d')](function(_0x573b7c){if(_0x573b7c){if(!_[_0x6509('0x8e')](_0x573b7c[_0x6509('0x87')])){if(fs[_0x6509('0x92')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x93'),_0x573b7c[_0x6509('0x87')]))){_0xc09a63=path[_0x6509('0x89')](config['root'],_0x6509('0x93'),_0x573b7c['systemAvatar']);}}return _0x218ba1[_0x6509('0x90')](_0xc09a63);}})[_0x6509('0x65')](handleError(_0x218ba1,null));};function checkWebsiteInterval(_0x40df56){var _0x51c35c=_0x40df56['Interval'];if(!_0x51c35c){return Promise[_0x6509('0x97')](_0x40df56);}var _0x21c7f9=_0x40df56[_0x6509('0x98')]||undefined;return _0x51c35c[_0x6509('0x99')](_0x21c7f9)[_0x6509('0x1d')](function(_0x134b8d){if(!_0x134b8d){throw new APIOutOfIntervalError();}return _0x40df56;});}exports[_0x6509('0x9a')]=function(_0x20c370,_0x193d70){var _0x278d45={'body':_0x20c370[_0x6509('0x68')],'channel':_0x6509('0x9b')};var _0x170635=[];var _0x5460a4=[];var _0x572bf7={};var _0x169938=![];if(_0x20c370['body']['id']){delete _0x20c370['body']['id'];}if(_[_0x6509('0x8e')](_0x20c370['body']['from'])){throw new APIBadRequestError(_0x6509('0x9c'));}if(_[_0x6509('0x8e')](_0x20c370[_0x6509('0x68')][_0x6509('0x9d')])){throw new APIBadRequestError(_0x6509('0x9e'));}if(_[_0x6509('0x9f')](_0x20c370[_0x6509('0x68')][_0x6509('0x68')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x1c264e=_0x20c370[_0x6509('0x68')][_0x6509('0x36')]&&_0x20c370[_0x6509('0x68')][_0x6509('0x3d')];return db[_0x6509('0xa0')][_0x6509('0x70')]()['then'](function(_0x314b77){if(!_0x314b77){throw new Error(_0x6509('0xa1'));}_0x170635=Object['keys'](_0x314b77)['filter'](function(_0x1f3923){return![_0x6509('0xa2'),_0x6509('0xa3')]['includes'](_0x1f3923);});_0x5460a4=Object['keys'](_0x314b77)[_0x6509('0x5a')](function(_0x31860d){return![_0x6509('0xa2'),_0x6509('0xa3'),_0x6509('0xa4'),'ListId'][_0x6509('0xa5')](_0x31860d);});if(!_[_0x6509('0xa5')](_0x5460a4,_0x20c370[_0x6509('0x68')]['mapKey'])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x5460a4['join'](',\x20'));}_0x572bf7[_0x20c370[_0x6509('0x68')][_0x6509('0x9d')]]=_0x20c370[_0x6509('0x68')]['from'];})[_0x6509('0x1d')](function(){return db[_0x6509('0x4b')]['find']({'where':{'id':_0x20c370['params']['id']},'include':[{'model':db[_0x6509('0xa6')],'as':_0x6509('0xa7'),'include':[{'model':db[_0x6509('0xa0')],'as':_0x6509('0xa8'),'where':_0x572bf7,'limit':0x1,'order':[[_0x6509('0xa3'),_0x6509('0xa9')]]}]},{'model':db[_0x6509('0xaa')],'as':_0x6509('0xab')},{'model':db[_0x6509('0xac')],'as':'Interval','include':[{'model':db[_0x6509('0xac')],'as':_0x6509('0xad'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x6509('0x1d')](function(_0x4344f2){if(!_0x4344f2){throw new APINotFoundError(util[_0x6509('0x40')](_0x6509('0xae'),_0x20c370[_0x6509('0x62')]['id']));}if(_0x1c264e){return checkWebsiteInterval(_0x4344f2);}return _0x4344f2;})['then'](function(_0x2bc776){_0x278d45[_0x6509('0xaf')]=_0x2bc776;_0x278d45[_0x6509('0xb0')]=_[_0x6509('0xb1')](_0x2bc776[_0x6509('0xab')],[_0x6509('0xb2')],[_0x6509('0xb3')]);if(_0x278d45[_0x6509('0xaf')]['Applications']){delete _0x278d45[_0x6509('0xaf')][_0x6509('0xab')];}_0x278d45[_0x6509('0xb4')]=_0x2bc776['List']||{'id':_0x2bc776[_0x6509('0xb5')]};if(_0x278d45[_0x6509('0xb4')]&&_0x278d45[_0x6509('0xb4')]['Contacts'][_0x6509('0x63')]){return _0x278d45['list']['Contacts'][0x0];}var _0xb1613f=_[_0x6509('0x15')](_0x20c370[_0x6509('0x68')],{'firstName':_0x20c370[_0x6509('0x68')][_0x6509('0xb6')],'ListId':_0x2bc776[_0x6509('0xb5')]});_0xb1613f[_0x20c370['body'][_0x6509('0x9d')]]=_0x20c370[_0x6509('0x68')]['from'];return db['CmContact'][_0x6509('0x66')](_0xb1613f,{'fields':_0x170635,'raw':!![]});})['then'](function(_0x54b063){_0x278d45[_0x6509('0xb7')]=_0x54b063;var _0x3595b6=createInteractionObject(_0x20c370[_0x6509('0x62')]['id'],_0x20c370['body'],_0x20c370[_0x6509('0xb8')],_0x54b063);var _0x5d6f0e={'ChatWebsiteId':_0x20c370[_0x6509('0x62')]['id']};if(_0x20c370[_0x6509('0x68')][_0x6509('0xb9')]){_0x5d6f0e['threadId']=_0x20c370[_0x6509('0x68')][_0x6509('0xb9')];_0x5d6f0e[_0x6509('0xba')]=![];return db[_0x6509('0xbb')][_0x6509('0x64')]({'where':_0x5d6f0e})['then'](function(_0x1372be){var _0x4057e0=_0x20c370[_0x6509('0x68')][_0x6509('0x36')]&&_0x20c370[_0x6509('0x68')][_0x6509('0x3d')];if(_0x1372be){_0x169938=!![];return _0x1372be;}else if(!_0x4057e0&&_0x1372be&&_0x1372be['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x3595b6[_0x6509('0xb9')]=_0x20c370[_0x6509('0x68')]['threadId'];_0x3595b6[_0x6509('0xbc')]=_0x20c370[_0x6509('0x68')]['externalUrl'];return db['ChatInteraction'][_0x6509('0x66')](_0x3595b6);});}_0x5d6f0e['ContactId']=_0x54b063['id'];if(_0x20c370[_0x6509('0x68')]['interaction']&&_0x20c370[_0x6509('0x68')][_0x6509('0xbd')]['id']){_0x5d6f0e['id']=_0x20c370[_0x6509('0x68')][_0x6509('0xbd')]['id'];return db['ChatInteraction']['find']({'where':_0x5d6f0e})['then'](function(_0x4f0357){var _0x3667c3=_0x20c370[_0x6509('0x68')][_0x6509('0x36')]&&_0x20c370[_0x6509('0x68')]['referer'];if(!_0x3667c3&&_0x4f0357&&_0x4f0357[_0x6509('0xba')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x4f0357){_0x169938=!![];return _0x4f0357;}else{return db[_0x6509('0xbb')][_0x6509('0x66')](_0x3595b6);}});}return db[_0x6509('0xbb')]['create'](_0x3595b6);})[_0x6509('0x1d')](function(_0x28f24d){if(!_0x169938){return _0x28f24d;}var _0x524f73={'from':(_0x278d45[_0x6509('0xb7')][_0x6509('0xbe')]||'')+'\x20'+(_0x278d45['contact']['lastName']||'')};if(_0x20c370[_0x6509('0x68')][_0x6509('0xb9')]&&_0x20c370[_0x6509('0x68')][_0x6509('0xbf')]&&_0x20c370[_0x6509('0x68')][_0x6509('0xb9')]!=_0x20c370[_0x6509('0x68')][_0x6509('0xbf')]){_0x524f73['threadId']=_0x20c370[_0x6509('0x68')][_0x6509('0xbf')];}return _0x28f24d['update'](_0x524f73);})[_0x6509('0x1d')](function(_0x42d891){_0x278d45[_0x6509('0xbd')]=_0x42d891[_0x6509('0x2d')]({'plain':!![]});_0x278d45[_0x6509('0xbd')][_0x6509('0xc0')]=!_0x169938;if(_0x278d45[_0x6509('0xbd')][_0x6509('0xc0')]){if(_0x278d45[_0x6509('0xaf')][_0x6509('0xc1')]){_0x278d45['applications']['push']({'id':0x0,'priority':_0x278d45[_0x6509('0xb0')]['length']+0x1,'app':_0x6509('0xc2'),'appdata':_0x6509('0xc3'),'interval':'*,*,*,*'});}}return db[_0x6509('0xc4')][_0x6509('0x66')]({'body':_0x20c370[_0x6509('0x68')]['body'],'ChatWebsiteId':_0x20c370[_0x6509('0x62')]['id'],'ChatInteractionId':_0x42d891['id'],'direction':'in','ContactId':_0x278d45[_0x6509('0xb7')]['id'],'AttachmentId':_0x20c370['body'][_0x6509('0xc5')]});})[_0x6509('0x1d')](function(_0x16e17c){_0x278d45[_0x6509('0x24')]=_0x16e17c;if(!_0x278d45[_0x6509('0xbd')][_0x6509('0xc6')]){return;}return db['User']['find']({'attributes':['id',_0x6509('0x31')],'where':{'id':_0x278d45[_0x6509('0xbd')]['UserId']}});})['then'](function(_0x15ef3c){if(_0x15ef3c){_0x278d45['applications'][_0x6509('0xc7')]({'id':0x0,'priority':0x0,'app':_0x6509('0xc8'),'appdata':_0x15ef3c[_0x6509('0x31')]+','+(_0x278d45[_0x6509('0xaf')]['waitForTheAssignedAgent']||0xa),'interval':_0x6509('0xc9')});_0x278d45[_0x6509('0xca')]=!![];}if(!_0x278d45[_0x6509('0xbd')][_0x6509('0xcb')]){return;}return db[_0x6509('0xcc')][_0x6509('0x64')]({'attributes':['id','name'],'where':{'id':_0x278d45[_0x6509('0xbd')]['queueId']}});})[_0x6509('0x1d')](function(_0x4adf80){if(_0x4adf80){_0x278d45[_0x6509('0xb0')]['unshift']({'id':0x0,'priority':0x1,'app':_0x6509('0xcd'),'appdata':_0x4adf80[_0x6509('0x31')]+','+(_0x278d45['account'][_0x6509('0xce')]||0x12c),'interval':_0x6509('0xc9')});}return respondWithRpcPromise(_0x6509('0xcf'),'startRouting',_0x278d45);})[_0x6509('0x1d')](function(_0x3179f2){respondWithRpcPromise('EventManager',_0x6509('0xd0'),{'event':'notify','message':_0x3179f2},client9002);return _0x3179f2;})['then'](respondWithResult(_0x193d70,null))[_0x6509('0x65')](APIHandleError(_0x193d70));};exports[_0x6509('0xd1')]=function(_0x2a3f9a,_0x56aeea){var _0x110e2c,_0x278975,_0x1c13e0;var _0x40aaa1=[];var _0x436b4b={};var _0x57866f=_0x2a3f9a[_0x6509('0xd2')]||[];var _0x5c390a=[];var _0x1de4b8;return db['CmContact'][_0x6509('0x70')]()['then'](function(_0x27cf36){if(!_0x27cf36){throw new db['Sequelize'][(_0x6509('0xd3'))]('no\x20available\x20attributes');}_0x40aaa1=_[_0x6509('0xd4')](_['keys'](_0x27cf36),[_0x6509('0xa2'),_0x6509('0xa3'),_0x6509('0xa4'),_0x6509('0xb5')]);if(_0x2a3f9a[_0x6509('0x68')]['id']){delete _0x2a3f9a[_0x6509('0x68')]['id'];}if(_[_0x6509('0x8e')](_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')])){throw _0x56aeea[_0x6509('0x27')](0x1f4)[_0x6509('0xd5')](new db[(_0x6509('0xd6'))][(_0x6509('0xd3'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x2a3f9a['body'][_0x6509('0x68')])||_0x2a3f9a['body'][_0x6509('0x68')]===''){throw _0x56aeea[_0x6509('0x27')](0x1f4)[_0x6509('0xd5')](new db[(_0x6509('0xd6'))][(_0x6509('0xd3'))](_0x6509('0xd7')));}if(_[_0x6509('0x8e')](_0x2a3f9a[_0x6509('0x68')]['mapKeyOffline'])){throw _0x56aeea['status'](0x1f4)[_0x6509('0xd5')](new db['Sequelize'][(_0x6509('0xd3'))](_0x6509('0xd8')+_0x40aaa1));}if(!_[_0x6509('0xa5')](_0x40aaa1,_0x2a3f9a[_0x6509('0x68')][_0x6509('0xd9')])){throw _0x56aeea['status'](0x1f4)[_0x6509('0xd5')](new db[(_0x6509('0xd6'))][(_0x6509('0xd3'))](_0x6509('0xda')+_0x40aaa1));}_0x436b4b[_0x2a3f9a['body'][_0x6509('0xd9')]]=_0x2a3f9a['body'][_0x6509('0xb6')];})[_0x6509('0x1d')](function(){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x2a3f9a['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x6509('0xdb')],'as':_0x6509('0xdb')}]});})['then'](handleEntityNotFound(_0x56aeea,null))[_0x6509('0x1d')](function(_0x49172e){if(_0x49172e&&_0x49172e[_0x6509('0xa7')]){_0x278975=_0x49172e;var _0x55d74e=_[_0x6509('0x15')](_0x2a3f9a[_0x6509('0x68')],{'firstName':_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')],'phone':_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')],'ListId':_0x49172e[_0x6509('0xb5')]});_0x55d74e[_0x2a3f9a[_0x6509('0x68')]['mapKeyOffline']]=_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')];return db[_0x6509('0xa0')][_0x6509('0xdc')]({'where':_0x436b4b,'defaults':_0x55d74e});}})[_0x6509('0xdd')](function(_0xb45f5d){if(_0xb45f5d){_0x1c13e0=_0xb45f5d;var _0x52cc3b=fs[_0x6509('0xde')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0xdf')),'utf8');var _0x4bc48b=ejs[_0x6509('0xe0')](_0x52cc3b,{'body':_[_0x6509('0xe1')](_0x2a3f9a['body']['body']),'bodyTitle':_0x278975[_0x6509('0xe2')]});return db['ChatOfflineMessage'][_0x6509('0x66')]({'body':_0x4bc48b,'plainBody':htmlToText[_0x6509('0xe3')](_0x4bc48b),'ContactId':_0xb45f5d['id'],'ChatWebsiteId':_0x278975['id']});}})['then'](function(_0x114439){_0x1de4b8=_0x114439;if(_0x57866f[_0x6509('0x63')]){var _0x568d63=_0x57866f[_0x6509('0x4e')](function(_0x4a7359){return{'name':_0x4a7359[_0x6509('0xe4')],'basename':_0x4a7359[_0x6509('0x84')],'type':_0x4a7359['mimetype'],'ChatOfflineMessageId':_0x114439['id']};});_0x5c390a=_0x568d63[_0x6509('0x4e')](_0x45d749=>{var _0x50e1a4={'filename':_0x45d749[_0x6509('0x31')],'path':path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0xe5'),'files',_0x6509('0xe6'),_0x6509('0xe7'),_0x45d749[_0x6509('0xe8')])};return _0x50e1a4;});if(!_0x278975[_0x6509('0xe9')]){return db[_0x6509('0xea')][_0x6509('0xeb')](function(_0x54e3b9){return db[_0x6509('0xec')][_0x6509('0xed')](_0x568d63,{'transaction':_0x54e3b9});});}}})[_0x6509('0x1d')](function(){if(_0x1de4b8){_0x110e2c=_0x1de4b8;return db[_0x6509('0xdb')][_0x6509('0x75')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6509('0xee'),'raw':!![],'include':[{'model':db[_0x6509('0xef')],'as':_0x6509('0xef'),'raw':!![]}]}]});}})[_0x6509('0x1d')](function(_0x3e5565){if(_0x3e5565&&_0x3e5565[_0x6509('0xee')]&&_0x278975[_0x6509('0xf0')]&&_0x278975[_0x6509('0xf1')]){var _0x172e8f=_0x3e5565['getSmtpOptions']();return respondWithRpcPromise(_0x6509('0xf2'),_0x6509('0xf3'),{'account':_0x172e8f,'message':{'from':util[_0x6509('0x40')](_0x6509('0xf4'),_0x3e5565[_0x6509('0x31')],_0x3e5565[_0x6509('0xf5')]||_0x3e5565[_0x6509('0xee')]['user']),'to':_0x278975[_0x6509('0xf1')],'subject':_0x278975[_0x6509('0xf6')],'html':_0x110e2c[_0x6509('0x68')],'attachments':_0x5c390a}},client9003)[_0x6509('0x1d')](function(){return _0x110e2c;})[_0x6509('0x65')](function(_0x1494d4){logger[_0x6509('0x21')](_0x1494d4);});}})[_0x6509('0x1d')](function(){if(_0x278975&&_0x278975[_0x6509('0xe9')]&&_0x278975['MailAccountId']){var _0x13c12d=[];if(_0x57866f[_0x6509('0x63')]){_0x13c12d=_0x57866f[_0x6509('0x4e')](function(_0x4f7d4b){return{'name':_0x4f7d4b[_0x6509('0xe4')],'basename':_0x4f7d4b[_0x6509('0x84')],'type':_0x4f7d4b[_0x6509('0xf7')],'ChatOfflineMessageId':_0x1de4b8['id']};});}var _0x1d6026;if(!_[_0x6509('0x8e')](_0x278975[_0x6509('0xf8')])){var _0x5fc214=_[_0x6509('0x4e')](_0x2a3f9a[_0x6509('0x68')],function(_0x5d71e7){return _0x5d71e7;});var _0x488e99=_[_0x6509('0xf9')](_0x5fc214)[0x0];var _0x372a76=_[_0x6509('0xfa')](_0x488e99,function(_0x2b52ce){return _0x2b52ce;});_0x1d6026=_0x372a76[0x1][_0x278975[_0x6509('0xf8')]];}var _0x310a9c={'from':_0x1c13e0[_0x6509('0xf5')],'firstName':_0x1c13e0[_0x6509('0xbe')],'lastName':_0x1c13e0['lastName'],'mapKey':_0x6509('0xf5'),'message':{'from':_0x1c13e0[_0x6509('0xf5')],'to':_0x278975[_0x6509('0xdb')][_0x6509('0xf5')],'cc':'','subject':_['isNil'](_0x1d6026)?_0x278975[_0x6509('0xf6')]:_0x1d6026,'messageId':'','sentAt':new Date(),'attach':_0x13c12d[_0x6509('0x63')],'attachments':_0x13c12d,'originChannel':_0x6509('0xfb'),'ChatWebsiteId':_0x278975['id'],'ChatOfflineMessageId':_0x110e2c['id'],'originTo':_0x278975[_0x6509('0xdb')][_0x6509('0xf5')]},'body':_0x110e2c['body']};var _0x841651={'account':{'id':_0x278975[_0x6509('0xfc')]},'body':_0x310a9c,'log':_0x6509('0xfd')};return respondWithRpcPromise('NotifyMailAccount',_0x6509('0xfe'),_0x841651,client9001)[_0x6509('0x1d')](function(){return _0x110e2c;})[_0x6509('0x65')](function(_0x34d250){logger[_0x6509('0x21')](_0x34d250);});}return;})['then'](function(){if(_0x110e2c){return _0x110e2c;}})['then'](respondWithResult(_0x56aeea,null))[_0x6509('0x65')](function(){for(var _0x1cc558 of _0x57866f){var _0x210e0d=path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0xe5'),_0x6509('0xd2'),_0x6509('0xe6'),_0x6509('0xe7'),_0x1cc558[_0x6509('0x84')]);fs_extra['remove'](_0x210e0d)[_0x6509('0x65')](function(_0x9532cc){logger['error'](_0x6509('0xff'),_0x210e0d,_0x9532cc);});}});};exports['addInteraction']=function(_0x5c2bd8,_0x468dd2){return db[_0x6509('0xbb')][_0x6509('0x64')]({'where':{'id':_0x5c2bd8[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x468dd2,null))[_0x6509('0x1d')](function(_0x4ed066){if(_0x4ed066){return _0x4ed066[_0x6509('0x100')](_0x5c2bd8[_0x6509('0x68')][_0x6509('0x7e')],_[_0x6509('0x101')](_0x5c2bd8[_0x6509('0x68')],[_0x6509('0x7e'),'id'])||{});}})[_0x6509('0x1d')](respondWithResult(_0x468dd2,null))[_0x6509('0x65')](handleError(_0x468dd2,null));};exports[_0x6509('0x102')]=function(_0x33266a,_0x28a9ad){var _0x58677d={'raw':![],'where':{}};var _0x27db56={};var _0x2e12e3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6509('0x75')]({'where':{'id':_0x33266a['params']['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x28a9ad,null))[_0x6509('0x1d')](function(_0x211fd7){if(_0x211fd7){_0x27db56[_0x6509('0x44')]=_[_0x6509('0x50')](db[_0x6509('0xbb')][_0x6509('0x4c')]);_0x27db56[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x33266a[_0x6509('0x4f')]);_0x27db56[_0x6509('0x58')]=_[_0x6509('0x51')](_0x27db56['model'],_0x27db56['query']);_0x58677d[_0x6509('0x52')]=_[_0x6509('0x51')](_0x27db56[_0x6509('0x44')],qs['fields'](_0x33266a[_0x6509('0x4f')][_0x6509('0x53')]));_0x58677d[_0x6509('0x52')]=_0x58677d['attributes'][_0x6509('0x63')]?_0x58677d[_0x6509('0x52')]:_0x27db56[_0x6509('0x44')];if(!_0x33266a[_0x6509('0x4f')][_0x6509('0x76')](_0x6509('0x54'))){_0x58677d[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x33266a['query'][_0x6509('0x55')]);_0x58677d['offset']=qs[_0x6509('0x29')](_0x33266a[_0x6509('0x4f')][_0x6509('0x29')]);}_0x58677d[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x33266a['query'][_0x6509('0x56')]);_0x58677d['where']=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x33266a[_0x6509('0x4f')],_0x27db56['filters']));_0x58677d[_0x6509('0x57')][_0x6509('0x72')]=_0x211fd7['id'];if(_0x33266a[_0x6509('0x4f')][_0x6509('0x5a')]){_0x58677d[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x58677d[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x58677d[_0x6509('0x52')],function(_0x538ebe){var _0x3ec479={};_0x3ec479[_0x538ebe]={'$like':'%'+_0x33266a['query']['filter']+'%'};return _0x3ec479;})});}_0x58677d=_[_0x6509('0x5b')]({},_0x58677d,_0x33266a['options']);return db['ChatInteraction'][_0x6509('0x2b')]({'where':_0x58677d[_0x6509('0x57')]})[_0x6509('0x1d')](function(_0x542701){_0x2e12e3[_0x6509('0x2b')]=_0x542701;if(_0x33266a['query'][_0x6509('0x5e')]){_0x58677d[_0x6509('0x5f')]=[{'model':db['CmContact'],'as':_0x6509('0x103'),'required':![]},{'model':db['User'],'as':_0x6509('0x104'),'attributes':[_0x6509('0x31'),'fullname',_0x6509('0x105')],'required':![]},{'model':db[_0x6509('0x106')],'as':_0x6509('0x107'),'attributes':['id',_0x6509('0x31'),'color'],'where':_0x33266a[_0x6509('0x4f')][_0x6509('0x108')]?{'id':_0x33266a[_0x6509('0x4f')][_0x6509('0x108')]}:undefined,'required':_0x33266a[_0x6509('0x4f')]['tag']?!![]:![]}];}return db[_0x6509('0xbb')][_0x6509('0x78')](_0x58677d);})[_0x6509('0x1d')](function(_0x4642b8){_0x2e12e3[_0x6509('0x60')]=_0x4642b8;return _0x2e12e3;});}})[_0x6509('0x1d')](respondWithFilteredResult(_0x28a9ad,_0x58677d))[_0x6509('0x65')](handleError(_0x28a9ad,null));};exports[_0x6509('0x109')]=function(_0x3d1db9,_0x2e2292){var _0x3a84dd=0x0;var _0x69f4=0x0;var _0x1821f5=![];var _0x7fa3de;var _0x293af9;return db['ChatWebsite'][_0x6509('0x64')]({'where':{'id':_0x3d1db9[_0x6509('0x62')]['id']},'include':[{'model':db[_0x6509('0xac')],'as':_0x6509('0xac'),'include':[{'model':db[_0x6509('0xac')],'as':_0x6509('0xad'),'attributes':['id',_0x6509('0x10a')]}]}]})[_0x6509('0x1d')](handleEntityNotFound(_0x2e2292,null))[_0x6509('0x1d')](function(_0x388a4f){if(_0x388a4f){_0x7fa3de=_0x388a4f;return _0x388a4f[_0x6509('0x10b')]({'raw':!![]});}})[_0x6509('0x1d')](function(_0x298039){if(_0x7fa3de){if(_0x298039){_0x293af9=_0x298039;}}return require(_0x6509('0x8b'))[_0x6509('0x8c')]();})[_0x6509('0x1d')](function(_0x39b762){if(_0x39b762){_0x69f4=_0x39b762[_0x6509('0x10c')];_0x1821f5=_0x39b762[_0x6509('0x8d')];}})[_0x6509('0x1d')](function(){return db[_0x6509('0xbb')][_0x6509('0x2b')]({'where':{'closed':![]}});})[_0x6509('0x1d')](function(_0x18ad10){_0x3a84dd=_0x18ad10;if(_0x69f4&&_0x18ad10>_0x69f4){return db[_0x6509('0x10d')][_0x6509('0x75')]({'where':{'id':0x1}})['then'](function(_0x146353){if(_0x146353){_0x146353[_0x6509('0x10e')](_0x6509('0x10f'));}});}})[_0x6509('0x1d')](function(){var _0x3ee6a9=_0x7fa3de[_0x6509('0xac')];var _0x4bb759=_0x7fa3de[_0x6509('0x98')]||undefined;return _0x3ee6a9?_0x3ee6a9[_0x6509('0x99')](_0x4bb759):!![];})['then'](function(_0x3525dc){var _0x2cc222=fs[_0x6509('0xde')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x110')),_0x6509('0x111'));var _0x222a5f=_0x6509('0x112');var _0x19d233=![];try{const _0x249f86=new URL(_0x7fa3de['address']);_0x7fa3de[_0x6509('0x69')]=_0x249f86[_0x6509('0x113')];}catch(_0x5332b2){}var _0x160fe8;if(_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]){_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]=_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]['replace'](/\/$/,'');_0x160fe8=wildcardUtils['testWebsiteWithWildcard'](_0x7fa3de['address'],_0x3d1db9['headers'][_0x6509('0x3d')]);}else{_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]=_0x7fa3de['address'];_0x160fe8=!![];}var _0x3f22af={'chatVersion':_0x222a5f,'chatWebsiteAddressOrigin':_0x160fe8?_0x3d1db9[_0x6509('0xb8')]['referer']:_0x7fa3de['address'],'remote':_0x7fa3de[_0x6509('0x114')],'query':querystring[_0x6509('0x48')](_[_0x6509('0x5b')](_0x7fa3de[_0x6509('0x2d')]({'plain':!![]}),{'customerIp':_0x3d1db9[_0x6509('0xb8')]['x-forwarded-for']||_0x3d1db9[_0x6509('0xb8')]['x-real-ip']||_0x3d1db9[_0x6509('0x115')][_0x6509('0x116')]||_0x3d1db9['ip'],'referer':_0x3d1db9[_0x6509('0xb8')]['referer'],'openedInteractions':_0x3a84dd,'maxInteractions':_0x69f4,'virtual':_0x1821f5[_0x6509('0x10c')],'online':_0x3525dc,'custom':_0x1821f5,'address':_0x160fe8?_0x3d1db9['headers'][_0x6509('0x3d')]:null}))[_0x6509('0x117')](/'/g,'\x5c\x27')};_0x2e2292[_0x6509('0xd5')](ejs[_0x6509('0xe0')](Mustache[_0x6509('0xe0')](_0x2cc222,_0x3f22af),{'proactiveActions':_0x293af9,'alignment':_0x7fa3de[_0x6509('0x118')],'verticalAlignment':_0x7fa3de['verticalAlignment'],'div_color':_0x7fa3de[_0x6509('0x119')],'labelText':_0x7fa3de[_0x6509('0x11a')],'text_color':_0x7fa3de[_0x6509('0x11b')],'text_button_color':_0x7fa3de[_0x6509('0x11c')],'button_color':_0x7fa3de[_0x6509('0x11d')],'background_color':_0x7fa3de['backgroundColor'],'hideWhenOffline':_0x7fa3de[_0x6509('0x11e')],'intervalId':_0x7fa3de[_0x6509('0x11f')],'isDevelopment':_0x19d233,'chatVersion':_0x222a5f}));})[_0x6509('0x65')](handleError(_0x2e2292,null));};exports[_0x6509('0x120')]=function(_0x54afd6,_0x4069e2){var _0x3afc9d=_0x54afd6['params']['id'];var _0x46c887=_0x54afd6[_0x6509('0x68')];var _0x4240a3=0xc8;var _0xa8a847=null;return db[_0x6509('0xea')][_0x6509('0xeb')]({'isolationLevel':db[_0x6509('0xea')][_0x6509('0x121')][_0x6509('0x122')][_0x6509('0x123')]},function(_0x4c8c87){return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x3afc9d},'transaction':_0x4c8c87})[_0x6509('0x1d')](function(_0x3b4458){if(_0x3b4458){return db[_0x6509('0xaa')]['destroy']({'where':{'ChatWebsiteId':_0x3afc9d},'transaction':_0x4c8c87})[_0x6509('0x1d')](function(){var _0x21bd8b=_[_0x6509('0x4e')](_0x46c887,function(_0x56a0ea){_0x56a0ea['ChatWebsiteId']=_0x3afc9d;return _0x56a0ea;});return db[_0x6509('0xaa')][_0x6509('0xed')](_0x21bd8b,{'transaction':_0x4c8c87});});}else{_0x4240a3=0x194;_0xa8a847=[];}});})[_0x6509('0x1d')](function(){if(_0x4240a3!==0x194){return db['ChatApplication'][_0x6509('0x124')]({'where':{'ChatWebsiteId':_0x3afc9d},'order':_0x6509('0xb2')})[_0x6509('0x1d')](function(_0x42bb2c){_0xa8a847=_0x42bb2c;});}})[_0x6509('0x65')](function(_0x4688b0){_0x4240a3=0x1f4;logger[_0x6509('0x21')](_0x4688b0[_0x6509('0x30')]);if(_0x4688b0[_0x6509('0x31')]){delete _0x4688b0[_0x6509('0x31')];}_0xa8a847=_0x4688b0;})[_0x6509('0x125')](function(){if(_0xa8a847===null){_0x4069e2[_0x6509('0x26')](_0x4240a3);}else{if(_0x4240a3===0x1f4){_0x4069e2['status'](_0x4240a3)[_0x6509('0xd5')](_0xa8a847);}else{_0x4069e2[_0x6509('0x27')](_0x4240a3)[_0x6509('0x126')](_0xa8a847);}}});};exports['getApplications']=function(_0x3889d4,_0x17a289){var _0xbf786f={};var _0x2bcec4={};var _0x343aad;var _0x48ff9a;return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x3889d4['params']['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x17a289,null))[_0x6509('0x1d')](function(_0x4ccd96){if(_0x4ccd96){_0x343aad=_0x4ccd96;_0x2bcec4['model']=_[_0x6509('0x50')](db[_0x6509('0xaa')][_0x6509('0x4c')]);_0x2bcec4[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x3889d4['query']);_0x2bcec4[_0x6509('0x58')]=_[_0x6509('0x51')](_0x2bcec4['model'],_0x2bcec4['query']);_0xbf786f[_0x6509('0x52')]=_[_0x6509('0x51')](_0x2bcec4[_0x6509('0x44')],qs[_0x6509('0x53')](_0x3889d4[_0x6509('0x4f')]['fields']));_0xbf786f[_0x6509('0x52')]=_0xbf786f['attributes'][_0x6509('0x63')]?_0xbf786f[_0x6509('0x52')]:_0x2bcec4[_0x6509('0x44')];_0xbf786f['order']=qs[_0x6509('0x56')](_0x3889d4['query'][_0x6509('0x56')]);_0xbf786f[_0x6509('0x57')]=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x3889d4['query'],_0x2bcec4[_0x6509('0x58')]));if(_0x3889d4[_0x6509('0x4f')][_0x6509('0x5a')]){_0xbf786f['where']=_['merge'](_0xbf786f['where'],{'$or':_[_0x6509('0x4e')](_0xbf786f[_0x6509('0x52')],function(_0x3d02bf){var _0x4ba35e={};_0x4ba35e[_0x3d02bf]={'$like':'%'+_0x3889d4['query'][_0x6509('0x5a')]+'%'};return _0x4ba35e;})});}_0xbf786f=_[_0x6509('0x5b')]({},_0xbf786f,_0x3889d4['options']);return _0x343aad[_0x6509('0x127')](_0xbf786f);}})[_0x6509('0x1d')](function(_0x4dabf6){if(_0x4dabf6){_0x48ff9a=_0x4dabf6['length'];if(!_0x3889d4[_0x6509('0x4f')][_0x6509('0x76')](_0x6509('0x54'))){_0xbf786f['limit']=qs[_0x6509('0x55')](_0x3889d4['query'][_0x6509('0x55')]);_0xbf786f[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x3889d4[_0x6509('0x4f')][_0x6509('0x29')]);}return _0x343aad[_0x6509('0x127')](_0xbf786f);}})[_0x6509('0x1d')](function(_0x5ce3f4){if(_0x5ce3f4){return _0x5ce3f4?{'count':_0x48ff9a,'rows':_0x5ce3f4}:null;}})['then'](respondWithResult(_0x17a289,null))[_0x6509('0x65')](handleError(_0x17a289,null));};exports['addProactiveActions']=function(_0x46f155,_0x4329c0){return db[_0x6509('0x128')]['find']({'where':{'id':_0x46f155[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x4329c0,null))[_0x6509('0x1d')](function(_0x585285){if(_0x585285){return _0x585285[_0x6509('0x129')](_0x46f155[_0x6509('0x68')][_0x6509('0x7e')],_[_0x6509('0x101')](_0x46f155[_0x6509('0x68')],[_0x6509('0x7e'),'id'])||{});}})['then'](respondWithResult(_0x4329c0,null))[_0x6509('0x65')](handleError(_0x4329c0,null));};exports['getProactiveActions']=function(_0x3802d1,_0x2c7179){var _0x5c4108={};var _0x131a49={};var _0x2da7b4;var _0x1806be;return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x3802d1['params']['id']}})['then'](handleEntityNotFound(_0x2c7179,null))[_0x6509('0x1d')](function(_0x5cc69b){if(_0x5cc69b){_0x2da7b4=_0x5cc69b;_0x131a49[_0x6509('0x44')]=_[_0x6509('0x50')](db['ChatProactiveAction'][_0x6509('0x4c')]);_0x131a49[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x3802d1[_0x6509('0x4f')]);_0x131a49[_0x6509('0x58')]=_[_0x6509('0x51')](_0x131a49[_0x6509('0x44')],_0x131a49['query']);_0x5c4108[_0x6509('0x52')]=_[_0x6509('0x51')](_0x131a49[_0x6509('0x44')],qs[_0x6509('0x53')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x53')]));_0x5c4108[_0x6509('0x52')]=_0x5c4108[_0x6509('0x52')][_0x6509('0x63')]?_0x5c4108[_0x6509('0x52')]:_0x131a49['model'];_0x5c4108[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x56')]);_0x5c4108['where']=qs[_0x6509('0x58')](_['pick'](_0x3802d1[_0x6509('0x4f')],_0x131a49[_0x6509('0x58')]));if(_0x3802d1['query'][_0x6509('0x5a')]){_0x5c4108[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x5c4108[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x5c4108[_0x6509('0x52')],function(_0x26a972){var _0x2aa41c={};_0x2aa41c[_0x26a972]={'$like':'%'+_0x3802d1[_0x6509('0x4f')]['filter']+'%'};return _0x2aa41c;})});}_0x5c4108=_['merge']({},_0x5c4108,_0x3802d1[_0x6509('0x5d')]);return _0x2da7b4['getProactiveActions'](_0x5c4108);}})[_0x6509('0x1d')](function(_0x45cea7){if(_0x45cea7){_0x1806be=_0x45cea7[_0x6509('0x63')];if(!_0x3802d1[_0x6509('0x4f')]['hasOwnProperty'](_0x6509('0x54'))){_0x5c4108[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x55')]);_0x5c4108[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x29')]);}return _0x2da7b4[_0x6509('0x10b')](_0x5c4108);}})['then'](function(_0x2de5c0){if(_0x2de5c0){return _0x2de5c0?{'count':_0x1806be,'rows':_0x2de5c0}:null;}})[_0x6509('0x1d')](respondWithResult(_0x2c7179,null))[_0x6509('0x65')](handleError(_0x2c7179,null));};exports[_0x6509('0x12a')]=function(_0x3cd06a,_0xd7fc00){var _0x51e175=_0x3cd06a[_0x6509('0x4f')]['online']==='false'?'offlineForm':_0x6509('0x12b');return db[_0x6509('0x4b')][_0x6509('0x64')]({'attributes':['id',_0x51e175],'where':{'id':_0x3cd06a[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0xd7fc00,null))['then'](function(_0x4fe515){if(_0x4fe515){var _0x535c3d=_0x4fe515[_0x51e175];var _0x161674=_0x535c3d&&_0x535c3d['items']?_0x535c3d[_0x6509('0x12c')]:[];_0xd7fc00[_0x6509('0xd5')]({'fromKey':_[_0x6509('0x8e')](_0x535c3d[_0x6509('0x12d')])?undefined:_0x535c3d['fromKey'],'count':_0x161674['length'],'rows':_0x161674});}})[_0x6509('0x65')](handleError(_0xd7fc00,null));};exports[_0x6509('0x12e')]=function(_0x5f004a,_0x59213b){var _0x2bc98b={'raw':![],'where':{}};var _0xf91ab6={};var _0x5df9fa={'count':0x0,'rows':[]};return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x5f004a[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x59213b,null))[_0x6509('0x1d')](function(_0x967928){if(_0x967928){_0xf91ab6[_0x6509('0x44')]=_[_0x6509('0x50')](db['ChatOfflineMessage'][_0x6509('0x4c')]);_0xf91ab6[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x5f004a[_0x6509('0x4f')]);_0xf91ab6[_0x6509('0x58')]=_[_0x6509('0x51')](_0xf91ab6['model'],_0xf91ab6[_0x6509('0x4f')]);_0x2bc98b[_0x6509('0x52')]=_[_0x6509('0x51')](_0xf91ab6[_0x6509('0x44')],qs[_0x6509('0x53')](_0x5f004a['query']['fields']));_0x2bc98b[_0x6509('0x52')]=_0x2bc98b[_0x6509('0x52')][_0x6509('0x63')]?_0x2bc98b[_0x6509('0x52')]:_0xf91ab6[_0x6509('0x44')];if(!_0x5f004a['query'][_0x6509('0x76')](_0x6509('0x54'))){_0x2bc98b['limit']=qs[_0x6509('0x55')](_0x5f004a['query'][_0x6509('0x55')]);_0x2bc98b[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x5f004a[_0x6509('0x4f')][_0x6509('0x29')]);}_0x2bc98b[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x5f004a['query']['sort']);_0x2bc98b[_0x6509('0x57')]=qs[_0x6509('0x58')](_['pick'](_0x5f004a[_0x6509('0x4f')],_0xf91ab6[_0x6509('0x58')]));_0x2bc98b['where'][_0x6509('0x72')]=_0x967928['id'];if(_0x5f004a['query'][_0x6509('0x5a')]){_0x2bc98b['where']=_[_0x6509('0x5b')](_0x2bc98b[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x2bc98b['attributes'],function(_0x2624d8){var _0x7f5a7c={};_0x7f5a7c[_0x2624d8]={'$like':'%'+_0x5f004a['query'][_0x6509('0x5a')]+'%'};return _0x7f5a7c;})});}_0x2bc98b=_[_0x6509('0x5b')]({},_0x2bc98b,_0x5f004a[_0x6509('0x5d')]);return db[_0x6509('0x12f')][_0x6509('0x2b')]({'where':_0x2bc98b[_0x6509('0x57')]})[_0x6509('0x1d')](function(_0x49b16d){_0x5df9fa[_0x6509('0x2b')]=_0x49b16d;if(_0x5f004a[_0x6509('0x4f')]['includeAll']){_0x2bc98b[_0x6509('0x5f')]=[{'all':!![]}];}else{_0x2bc98b[_0x6509('0x5f')]=[{'model':db[_0x6509('0xa0')],'as':_0x6509('0x103'),'required':![]},{'model':db['Attachment'],'as':_0x6509('0x130'),'required':![]}];}return db[_0x6509('0x12f')][_0x6509('0x78')](_0x2bc98b);})[_0x6509('0x1d')](function(_0x46c055){_0x5df9fa[_0x6509('0x60')]=_0x46c055;return _0x5df9fa;});}})[_0x6509('0x1d')](respondWithFilteredResult(_0x59213b,_0x2bc98b))['catch'](handleError(_0x59213b,null));};exports[_0x6509('0x131')]=function(_0x5e92af,_0x55cb59){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x5e92af[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x55cb59,null))[_0x6509('0x1d')](function(_0x52fa05){if(_0x52fa05){return _0x52fa05[_0x6509('0x131')](_0x5e92af[_0x6509('0x68')][_0x6509('0x7e')],_[_0x6509('0x101')](_0x5e92af['body'],[_0x6509('0x7e'),'id'])||{})['spread'](function(_0x3e1a15){for(var _0x30de87=0x0;_0x30de87<_0x5e92af[_0x6509('0x68')]['ids']['length'];_0x30de87+=0x1){socket[_0x6509('0x132')](_0x6509('0x133'),{'UserId':Number(_0x5e92af[_0x6509('0x68')][_0x6509('0x7e')][_0x30de87]),'ChatWebsiteId':Number(_0x5e92af[_0x6509('0x62')]['id'])});}return _0x3e1a15;});}})['then'](respondWithResult(_0x55cb59,null))[_0x6509('0x65')](handleError(_0x55cb59,null));};exports[_0x6509('0x134')]=function(_0x4c2302,_0x23725f){return db['ChatWebsite'][_0x6509('0x64')]({'where':{'id':_0x4c2302[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x23725f,null))[_0x6509('0x1d')](function(_0x214ba6){if(_0x214ba6){return _0x214ba6[_0x6509('0x134')](_0x4c2302['query'][_0x6509('0x7e')])[_0x6509('0x1d')](function(){if(_['isArray'](_0x4c2302[_0x6509('0x4f')][_0x6509('0x7e')])){for(var _0x1b3d6a=0x0;_0x1b3d6a<_0x4c2302[_0x6509('0x4f')][_0x6509('0x7e')][_0x6509('0x63')];_0x1b3d6a+=0x1){socket[_0x6509('0x132')](_0x6509('0x135'),{'UserId':Number(_0x4c2302[_0x6509('0x4f')][_0x6509('0x7e')][_0x1b3d6a]),'ChatWebsiteId':Number(_0x4c2302['params']['id'])});}}else{socket['emit'](_0x6509('0x135'),{'UserId':Number(_0x4c2302['query'][_0x6509('0x7e')]),'ChatWebsiteId':Number(_0x4c2302[_0x6509('0x62')]['id'])});}});}})[_0x6509('0x1d')](respondWithStatusCode(_0x23725f,null))[_0x6509('0x65')](handleError(_0x23725f,null));};exports['getAgents']=function(_0x4fd797,_0x2611d7){var _0x206bcb={};var _0x16460a={};var _0x1f6462;var _0x374fda;return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x4fd797[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x2611d7,null))[_0x6509('0x1d')](function(_0x5ce300){if(_0x5ce300){_0x1f6462=_0x5ce300;_0x16460a[_0x6509('0x44')]=_[_0x6509('0x50')](db[_0x6509('0x136')][_0x6509('0x4c')]);_0x16460a[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x4fd797[_0x6509('0x4f')]);_0x16460a[_0x6509('0x58')]=_[_0x6509('0x51')](_0x16460a[_0x6509('0x44')],_0x16460a[_0x6509('0x4f')]);_0x206bcb[_0x6509('0x52')]=_[_0x6509('0x51')](_0x16460a[_0x6509('0x44')],qs['fields'](_0x4fd797[_0x6509('0x4f')][_0x6509('0x53')]));_0x206bcb[_0x6509('0x52')]=_0x206bcb[_0x6509('0x52')]['length']?_0x206bcb[_0x6509('0x52')]:_0x16460a[_0x6509('0x44')];_0x206bcb[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x4fd797[_0x6509('0x4f')][_0x6509('0x56')]);_0x206bcb['where']=qs[_0x6509('0x58')](_['pick'](_0x4fd797['query'],_0x16460a[_0x6509('0x58')]));if(_0x4fd797[_0x6509('0x4f')][_0x6509('0x5a')]){_0x206bcb[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x206bcb[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x206bcb[_0x6509('0x52')],function(_0x55fba5){var _0x1451dd={};_0x1451dd[_0x55fba5]={'$like':'%'+_0x4fd797['query'][_0x6509('0x5a')]+'%'};return _0x1451dd;})});}_0x206bcb=_[_0x6509('0x5b')]({},_0x206bcb,_0x4fd797[_0x6509('0x5d')]);return _0x1f6462[_0x6509('0x137')](_0x206bcb);}})[_0x6509('0x1d')](function(_0x5d0055){if(_0x5d0055){_0x374fda=_0x5d0055[_0x6509('0x63')];if(!_0x4fd797[_0x6509('0x4f')][_0x6509('0x76')](_0x6509('0x54'))){_0x206bcb[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x4fd797['query'][_0x6509('0x55')]);_0x206bcb[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x4fd797[_0x6509('0x4f')][_0x6509('0x29')]);}return _0x1f6462['getAgents'](_0x206bcb);}})[_0x6509('0x1d')](function(_0x15d848){if(_0x15d848){return _0x15d848?{'count':_0x374fda,'rows':_0x15d848}:null;}})['then'](respondWithResult(_0x2611d7,null))['catch'](handleError(_0x2611d7,null));}; \ No newline at end of file +var _0x2d99=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','model','device','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','map','query','keys','filters','intersection','attributes','fields','length','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','show','params','create','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','order','pick','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','systemAvatar','Interval','resolve','timezone','ifTime','notify','chat','from','mapKey','isEmpty','CmContact','createdAt','updatedAt','CompanyId','ListId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','Applications','priority','list','contact','headers','threadId','closed','ChatInteraction','customerIp','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','queueId','waitForTheAssignedQueue','Start','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','mimetype','server','files','attachments','sequelize','transaction','Attachment','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','subjectOffline','mapValues','lastName','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','testWebsiteWithWildcard','remote','remoteAddress','replace','textColor','textButtonColor','color_button','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0x2d99,0x11b));var _0x92d9=function(_0x2d08c6,_0x3347ee){_0x2d08c6=_0x2d08c6-0x0;var _0x47f4ed=_0x2d99[_0x2d08c6];return _0x47f4ed;};'use strict';var Mustache=require(_0x92d9('0x0'));var util=require(_0x92d9('0x1'));var path=require(_0x92d9('0x2'));var ejs=require(_0x92d9('0x3'));var fs=require('fs');var fs_extra=require(_0x92d9('0x4'));var _=require('lodash');var querystring=require(_0x92d9('0x5'));var htmlToText=require(_0x92d9('0x6'));var Redis=require(_0x92d9('0x7'));var jayson=require(_0x92d9('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x92d9('0x9'))(_0x92d9('0xa'));var config=require('../../config/environment');var APIBadRequestError=require(_0x92d9('0xb'))[_0x92d9('0xc')];var APINotFoundError=require(_0x92d9('0xb'))[_0x92d9('0xd')];var APIOutOfIntervalError=require(_0x92d9('0xb'))[_0x92d9('0xe')];var APIHandleError=require(_0x92d9('0xb'))['handleError'];var APIConflictError=require(_0x92d9('0xb'))[_0x92d9('0xf')];var wildcardUtils=require(_0x92d9('0x10'));var URL=require(_0x92d9('0x11'))[_0x92d9('0x12')];var db=require(_0x92d9('0x13'))['db'];config[_0x92d9('0x14')]=_[_0x92d9('0x15')](config[_0x92d9('0x14')],{'host':_0x92d9('0x16'),'port':0x18eb});var socket=require(_0x92d9('0x17'))(new Redis(config[_0x92d9('0x14')]));require(_0x92d9('0x18'))['register'](socket);var client=jayson[_0x92d9('0x19')][_0x92d9('0x1a')]({'port':0x232c});var client9002=jayson[_0x92d9('0x19')][_0x92d9('0x1a')]({'port':0x232a});var client9003=jayson[_0x92d9('0x19')]['http']({'port':0x232b});var client9001=jayson[_0x92d9('0x19')][_0x92d9('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x1e4b47,_0xa0ebf5,_0x598a9a,_0x58dca1){return new Promise(function(_0x348d3c,_0x33d856){var _0x3b33cc=_0x58dca1||client;return _0x3b33cc[_0x92d9('0x1b')](_0x1e4b47,_0x598a9a)[_0x92d9('0x1c')](function(_0xd83e4c){logger['info'](_0x92d9('0x1d'),_0xa0ebf5,_0x92d9('0x1e'));logger['debug'](_0x92d9('0x1f'),_0xa0ebf5,_0x92d9('0x1e'),JSON[_0x92d9('0x20')](_0xd83e4c));if(_0xd83e4c['error']){if(_0xd83e4c['error'][_0x92d9('0x21')]===0x1f4){logger['error'](_0x92d9('0x1d'),_0xa0ebf5,_0xd83e4c['error'][_0x92d9('0x22')]);return _0x33d856(_0xd83e4c['error']['message']);}logger[_0x92d9('0x23')](_0x92d9('0x1d'),_0xa0ebf5,_0xd83e4c[_0x92d9('0x23')][_0x92d9('0x22')]);return _0x348d3c(_0xd83e4c[_0x92d9('0x23')][_0x92d9('0x22')]);}else{logger[_0x92d9('0x24')](_0x92d9('0x1d'),_0xa0ebf5,_0x92d9('0x1e'));_0x348d3c(_0xd83e4c[_0x92d9('0x25')][_0x92d9('0x22')]);}})[_0x92d9('0x26')](function(_0x478f9f){logger[_0x92d9('0x23')]('ChatWebsite,\x20%s,\x20%s',_0xa0ebf5,_0x478f9f);_0x33d856(_0x478f9f);});});}function respondWithStatusCode(_0x3b3bea,_0x19eff1){_0x19eff1=_0x19eff1||0xcc;return function(_0x363266){if(_0x363266){return _0x3b3bea[_0x92d9('0x27')](_0x19eff1);}return _0x3b3bea[_0x92d9('0x28')](_0x19eff1)[_0x92d9('0x29')]();};}function respondWithResult(_0x29e211,_0xd1d160){_0xd1d160=_0xd1d160||0xc8;return function(_0x17fb89){if(_0x17fb89){return _0x29e211['status'](_0xd1d160)[_0x92d9('0x2a')](_0x17fb89);}};}function respondWithFilteredResult(_0x524db5,_0x54f4f2){return function(_0x365536){if(_0x365536){var _0x546b85=typeof _0x54f4f2[_0x92d9('0x2b')]===_0x92d9('0x2c')&&typeof _0x54f4f2['limit']===_0x92d9('0x2c');var _0x367b90=_0x365536['count'];var _0x3e4fba=_0x546b85?0x0:_0x54f4f2[_0x92d9('0x2b')];var _0x1626c4=_0x546b85?_0x365536['count']:_0x54f4f2[_0x92d9('0x2b')]+_0x54f4f2[_0x92d9('0x2d')];var _0x41f288;if(_0x1626c4>=_0x367b90){_0x1626c4=_0x367b90;_0x41f288=0xc8;}else{_0x41f288=0xce;}_0x524db5[_0x92d9('0x28')](_0x41f288);return _0x524db5[_0x92d9('0x2e')](_0x92d9('0x2f'),_0x3e4fba+'-'+_0x1626c4+'/'+_0x367b90)[_0x92d9('0x2a')](_0x365536);}return null;};}function saveUpdates(_0x22ba32){return function(_0x3cbcc0){if(_0x3cbcc0){return _0x3cbcc0[_0x92d9('0x30')](_0x22ba32)['then'](function(_0x218168){return _0x218168;});}return null;};}function removeEntity(_0x16f2a0){return function(_0x44a777){if(_0x44a777){return _0x44a777[_0x92d9('0x31')]()[_0x92d9('0x1c')](function(){var _0x365afb=_0x44a777[_0x92d9('0x32')]({'plain':!![]});var _0x541631=_0x92d9('0x33');return db[_0x92d9('0x34')][_0x92d9('0x31')]({'where':{'type':_0x541631,'resourceId':_0x365afb['id']}})[_0x92d9('0x1c')](function(){return _0x44a777;});})['then'](function(){_0x16f2a0[_0x92d9('0x28')](0xcc)[_0x92d9('0x29')]();});}};}function handleEntityNotFound(_0x2f5ad5){return function(_0x38afaf){if(!_0x38afaf){_0x2f5ad5[_0x92d9('0x27')](0x194);}return _0x38afaf;};}function handleError(_0x372d0f,_0x38f62d){_0x38f62d=_0x38f62d||0x1f4;return function(_0x49e935){logger[_0x92d9('0x23')](_0x49e935[_0x92d9('0x35')]);if(_0x49e935['name']){delete _0x49e935[_0x92d9('0x36')];}_0x372d0f[_0x92d9('0x28')](_0x38f62d)[_0x92d9('0x37')](_0x49e935);};}function createInteractionObject(_0x3937ca,_0x24096d,_0x5d7ebf,_0x50ae13){var _0x3f4443=require(_0x92d9('0x38'));var _0xd3429c=new _0x3f4443();var _0x3acbe3=_0xd3429c[_0x92d9('0x39')](_0x5d7ebf['user-agent'])['getResult']();var _0x20f575=_0x24096d['customerIp'];if(_0x5d7ebf[_0x92d9('0x3a')]){_0x20f575=_0x5d7ebf['cf-connecting-ip'];}else if(_0x5d7ebf[_0x92d9('0x3b')]){_0x20f575=_[_0x92d9('0x3c')](_0x5d7ebf[_0x92d9('0x3b')][_0x92d9('0x3d')](','));}return{'ContactId':_0x50ae13['id'],'ChatWebsiteId':_0x3937ca,'from':(_0x50ae13[_0x92d9('0x3e')]||'')+'\x20'+(_0x50ae13['lastName']||''),'customerIp':_0x20f575,'customerPort':_0x5d7ebf['x-real-port']?_0x5d7ebf[_0x92d9('0x3f')]:null,'referer':_0x24096d[_0x92d9('0x40')],'browserName':_0x3acbe3['browser'][_0x92d9('0x36')]&&_0x3acbe3[_0x92d9('0x41')][_0x92d9('0x42')]?util[_0x92d9('0x43')](_0x92d9('0x44'),_0x3acbe3['browser']['name'],_0x3acbe3[_0x92d9('0x41')][_0x92d9('0x42')]):'unknown','browserVersion':_0x3acbe3['browser'][_0x92d9('0x42')]||'unknown','osName':util[_0x92d9('0x43')](_0x92d9('0x44'),_0x3acbe3['os'][_0x92d9('0x36')],_0x3acbe3['os'][_0x92d9('0x42')]),'osVersion':_0x3acbe3['os'][_0x92d9('0x42')],'deviceModel':_0x3acbe3['device'][_0x92d9('0x45')]&&_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x47')]?util[_0x92d9('0x43')](_0x92d9('0x48'),_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x45')],_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x47')],_0x3acbe3['device']['type']):null,'deviceVendor':_0x3acbe3[_0x92d9('0x46')]['vendor'],'deviceType':_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x49')],'formData':JSON[_0x92d9('0x20')](_0x24096d)};}exports['index']=function(_0x2fe93f,_0x2ccae3){var _0x499dd0={'include':[{'model':db['Pause'],'as':_0x92d9('0x4a')}]},_0x468473={},_0x58eab7={'count':0x0,'rows':[]};var _0x106fed=_['map'](db[_0x92d9('0x4b')][_0x92d9('0x4c')],function(_0x40e019){return{'name':_0x40e019['fieldName'],'type':_0x40e019[_0x92d9('0x49')][_0x92d9('0x4d')]};});_0x468473[_0x92d9('0x45')]=_[_0x92d9('0x4e')](_0x106fed,_0x92d9('0x36'));_0x468473[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x2fe93f[_0x92d9('0x4f')]);_0x468473[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x468473['model'],_0x468473[_0x92d9('0x4f')]);_0x499dd0[_0x92d9('0x53')]=_['intersection'](_0x468473['model'],qs['fields'](_0x2fe93f[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x499dd0['attributes']=_0x499dd0[_0x92d9('0x53')][_0x92d9('0x55')]?_0x499dd0['attributes']:_0x468473[_0x92d9('0x45')];if(!_0x2fe93f[_0x92d9('0x4f')]['hasOwnProperty']('nolimit')){_0x499dd0['limit']=qs[_0x92d9('0x2d')](_0x2fe93f['query'][_0x92d9('0x2d')]);_0x499dd0[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x2fe93f['query'][_0x92d9('0x2b')]);}_0x499dd0['order']=qs[_0x92d9('0x56')](_0x2fe93f[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x499dd0[_0x92d9('0x57')]=qs['filters'](_['pick'](_0x2fe93f[_0x92d9('0x4f')],_0x468473[_0x92d9('0x51')]),_0x106fed);if(_0x2fe93f[_0x92d9('0x4f')]['filter']){_0x499dd0[_0x92d9('0x57')]=_['merge'](_0x499dd0[_0x92d9('0x57')],{'$or':_[_0x92d9('0x4e')](_0x106fed,function(_0x569449){if(_0x569449[_0x92d9('0x49')]!==_0x92d9('0x58')){var _0x22f675={};_0x22f675[_0x569449['name']]={'$like':'%'+_0x2fe93f['query'][_0x92d9('0x59')]+'%'};return _0x22f675;}})});}_0x499dd0=_[_0x92d9('0x5a')]({},_0x499dd0,_0x2fe93f[_0x92d9('0x5b')]);var _0x552588={'where':_0x499dd0['where']};return db[_0x92d9('0x4b')]['count'](_0x552588)[_0x92d9('0x1c')](function(_0x558775){_0x58eab7[_0x92d9('0x5c')]=_0x558775;if(_0x2fe93f[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x499dd0[_0x92d9('0x5e')]=[{'all':!![]}];}return db[_0x92d9('0x4b')][_0x92d9('0x5f')](_0x499dd0);})['then'](function(_0x549f38){_0x58eab7[_0x92d9('0x60')]=_0x549f38;return _0x58eab7;})[_0x92d9('0x1c')](respondWithFilteredResult(_0x2ccae3,_0x499dd0))[_0x92d9('0x26')](handleError(_0x2ccae3,null));};exports[_0x92d9('0x61')]=function(_0x4d6e10,_0x439acc){var _0x43e62d={'raw':![],'where':{'id':_0x4d6e10[_0x92d9('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x44bc2b={};_0x44bc2b[_0x92d9('0x45')]=_['keys'](db['ChatWebsite'][_0x92d9('0x4c')]);_0x44bc2b[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x4d6e10[_0x92d9('0x4f')]);_0x44bc2b[_0x92d9('0x51')]=_['intersection'](_0x44bc2b[_0x92d9('0x45')],_0x44bc2b['query']);_0x43e62d['attributes']=_[_0x92d9('0x52')](_0x44bc2b[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x4d6e10['query'][_0x92d9('0x54')]));_0x43e62d[_0x92d9('0x53')]=_0x43e62d['attributes'][_0x92d9('0x55')]?_0x43e62d['attributes']:_0x44bc2b['model'];if(_0x4d6e10[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x43e62d[_0x92d9('0x5e')]=[{'all':!![]}];}_0x43e62d=_[_0x92d9('0x5a')]({},_0x43e62d,_0x4d6e10[_0x92d9('0x5b')]);return db[_0x92d9('0x4b')]['find'](_0x43e62d)[_0x92d9('0x1c')](handleEntityNotFound(_0x439acc,null))[_0x92d9('0x1c')](respondWithResult(_0x439acc,null))[_0x92d9('0x26')](handleError(_0x439acc,null));};exports[_0x92d9('0x63')]=function(_0xabc1ef,_0x596d48){if(!wildcardUtils[_0x92d9('0x64')](_0xabc1ef[_0x92d9('0x65')][_0x92d9('0x66')])){return handleError(_0x596d48,null)(new APIBadRequestError('\x22'+_0xabc1ef['body'][_0x92d9('0x66')]+_0x92d9('0x67')));}return db[_0x92d9('0x4b')][_0x92d9('0x63')](_0xabc1ef['body'],{})[_0x92d9('0x1c')](function(_0x351acb){var _0x48861d=_0xabc1ef[_0x92d9('0x68')][_0x92d9('0x32')]({'plain':!![]});if(!_0x48861d)throw new Error(_0x92d9('0x69'));if(_0x48861d[_0x92d9('0x6a')]===_0x92d9('0x68')){var _0x445de4=_0x351acb[_0x92d9('0x32')]({'plain':!![]});var _0x276439=_0x92d9('0x33');return db[_0x92d9('0x6b')]['find']({'where':{'name':_0x276439,'userProfileId':_0x48861d[_0x92d9('0x6c')]},'raw':!![]})[_0x92d9('0x1c')](function(_0x134f9e){if(_0x134f9e&&_0x134f9e['autoAssociation']===0x0){return db[_0x92d9('0x34')]['create']({'name':_0x445de4[_0x92d9('0x36')],'resourceId':_0x445de4['id'],'type':_0x134f9e[_0x92d9('0x36')],'sectionId':_0x134f9e['id']},{})['then'](function(){return _0x351acb;});}else{return _0x351acb;}})[_0x92d9('0x26')](function(_0x15f25b){logger['error'](_0x92d9('0x6d'),_0x15f25b);throw _0x15f25b;});}return _0x351acb;})[_0x92d9('0x1c')](respondWithResult(_0x596d48,0xc9))['catch'](handleError(_0x596d48,null));};exports[_0x92d9('0x30')]=function(_0x222812,_0x4b2047){if(!wildcardUtils[_0x92d9('0x64')](_0x222812[_0x92d9('0x65')]['address'])){return handleError(_0x4b2047,null)(new APIBadRequestError('\x22'+_0x222812['body'][_0x92d9('0x66')]+_0x92d9('0x67')));}if(_0x222812['body']['id']){delete _0x222812['body']['id'];}return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x222812[_0x92d9('0x62')]['id']},'include':[{'model':db[_0x92d9('0x6f')],'as':_0x92d9('0x4a')}]})[_0x92d9('0x1c')](handleEntityNotFound(_0x4b2047,null))[_0x92d9('0x1c')](saveUpdates(_0x222812[_0x92d9('0x65')],null))['then'](respondWithResult(_0x4b2047,null))[_0x92d9('0x26')](handleError(_0x4b2047,null));};exports[_0x92d9('0x31')]=function(_0x50c9d6,_0x4c23bb){return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x50c9d6['params']['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x4c23bb,null))[_0x92d9('0x1c')](removeEntity(_0x4c23bb,null))[_0x92d9('0x26')](handleError(_0x4c23bb,null));};exports[_0x92d9('0x70')]=function(_0x22ddaa,_0xf2c9e3){return db[_0x92d9('0x4b')][_0x92d9('0x70')]()['then'](respondWithResult(_0xf2c9e3,null))['catch'](handleError(_0xf2c9e3,null));};exports[_0x92d9('0x71')]=function(_0x1dd740,_0x48b1b1){if(_0x1dd740['body']['id']){delete _0x1dd740[_0x92d9('0x65')]['id'];}return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x1dd740[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x48b1b1,null))[_0x92d9('0x1c')](function(_0x11dad1){if(_0x11dad1){_0x1dd740[_0x92d9('0x65')][_0x92d9('0x72')]=_0x11dad1['id'];return db[_0x92d9('0x73')][_0x92d9('0x63')](_0x1dd740[_0x92d9('0x65')]);}})[_0x92d9('0x1c')](respondWithResult(_0x48b1b1,null))[_0x92d9('0x26')](handleError(_0x48b1b1,null));};exports[_0x92d9('0x74')]=function(_0x44b69a,_0x3982d6){var _0x2bd543={'raw':![],'where':{}};var _0x5efd61={};var _0xdc58ef={'count':0x0,'rows':[]};return db[_0x92d9('0x4b')][_0x92d9('0x75')]({'where':{'id':_0x44b69a['params']['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x3982d6,null))[_0x92d9('0x1c')](function(_0x142861){if(_0x142861){_0x5efd61[_0x92d9('0x45')]=_[_0x92d9('0x50')](db[_0x92d9('0x73')][_0x92d9('0x4c')]);_0x5efd61['query']=_[_0x92d9('0x50')](_0x44b69a[_0x92d9('0x4f')]);_0x5efd61[_0x92d9('0x51')]=_['intersection'](_0x5efd61[_0x92d9('0x45')],_0x5efd61['query']);_0x2bd543[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x5efd61[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x44b69a['query'][_0x92d9('0x54')]));_0x2bd543[_0x92d9('0x53')]=_0x2bd543[_0x92d9('0x53')][_0x92d9('0x55')]?_0x2bd543['attributes']:_0x5efd61['model'];if(!_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x2bd543['limit']=qs[_0x92d9('0x2d')](_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x2d')]);_0x2bd543[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x2bd543['order']=qs['sort'](_0x44b69a[_0x92d9('0x4f')]['sort']);_0x2bd543['where']=qs[_0x92d9('0x51')](_['pick'](_0x44b69a[_0x92d9('0x4f')],_0x5efd61[_0x92d9('0x51')]));_0x2bd543['where'][_0x92d9('0x72')]=_0x142861['id'];if(_0x44b69a['query'][_0x92d9('0x59')]){_0x2bd543['where']=_[_0x92d9('0x5a')](_0x2bd543['where'],{'$or':_[_0x92d9('0x4e')](_0x2bd543['attributes'],function(_0x192cbb){var _0x1470ba={};_0x1470ba[_0x192cbb]={'$like':'%'+_0x44b69a['query']['filter']+'%'};return _0x1470ba;})});}_0x2bd543=_[_0x92d9('0x5a')]({},_0x2bd543,_0x44b69a[_0x92d9('0x5b')]);return db[_0x92d9('0x73')]['count']({'where':_0x2bd543[_0x92d9('0x57')]})[_0x92d9('0x1c')](function(_0x5248c5){_0xdc58ef[_0x92d9('0x5c')]=_0x5248c5;if(_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x2bd543['include']=[{'all':!![]}];}return db[_0x92d9('0x73')]['findAll'](_0x2bd543);})['then'](function(_0x5eaf47){_0xdc58ef[_0x92d9('0x60')]=_0x5eaf47;return _0xdc58ef;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x3982d6,_0x2bd543))['catch'](handleError(_0x3982d6,null));};exports[_0x92d9('0x78')]=function(_0x22b173,_0x21a274){return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x22b173[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x21a274,null))['then'](function(_0x5135a9){if(_0x5135a9){return _0x5135a9[_0x92d9('0x78')](_0x22b173[_0x92d9('0x4f')][_0x92d9('0x79')]);}})[_0x92d9('0x1c')](respondWithStatusCode(_0x21a274,null))['catch'](handleError(_0x21a274,null));};exports[_0x92d9('0x7a')]=function(_0x10a2e5,_0x57c17e){if(_0x10a2e5[_0x92d9('0x65')]['id']){delete _0x10a2e5[_0x92d9('0x65')]['id'];}return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x10a2e5[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x57c17e,null))[_0x92d9('0x1c')](function(_0x13c854){if(_0x13c854){_0x10a2e5[_0x92d9('0x65')][_0x92d9('0x72')]=_0x13c854['id'];return db[_0x92d9('0x7b')]['create'](_0x10a2e5[_0x92d9('0x65')]);}})[_0x92d9('0x1c')](respondWithResult(_0x57c17e,null))[_0x92d9('0x26')](handleError(_0x57c17e,null));};exports['getAnswers']=function(_0xd74615,_0x2b52b7){var _0x11d419={'raw':![],'where':{}};var _0x39a038={};var _0xdd8102={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x92d9('0x75')]({'where':{'id':_0xd74615[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b52b7,null))[_0x92d9('0x1c')](function(_0x5ef5a6){if(_0x5ef5a6){_0x39a038['model']=_['keys'](db['CannedAnswer'][_0x92d9('0x4c')]);_0x39a038[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0xd74615[_0x92d9('0x4f')]);_0x39a038[_0x92d9('0x51')]=_['intersection'](_0x39a038['model'],_0x39a038[_0x92d9('0x4f')]);_0x11d419[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x39a038[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x11d419[_0x92d9('0x53')]=_0x11d419['attributes'][_0x92d9('0x55')]?_0x11d419[_0x92d9('0x53')]:_0x39a038['model'];if(!_0xd74615['query'][_0x92d9('0x76')](_0x92d9('0x77'))){_0x11d419[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x2d')]);_0x11d419[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x11d419[_0x92d9('0x7c')]=qs['sort'](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x11d419[_0x92d9('0x57')]=qs[_0x92d9('0x51')](_[_0x92d9('0x7d')](_0xd74615['query'],_0x39a038[_0x92d9('0x51')]));_0x11d419['where'][_0x92d9('0x72')]=_0x5ef5a6['id'];if(_0xd74615['query'][_0x92d9('0x59')]){_0x11d419[_0x92d9('0x57')]=_[_0x92d9('0x5a')](_0x11d419[_0x92d9('0x57')],{'$or':_['map'](_0x11d419[_0x92d9('0x53')],function(_0x17ad79){var _0xd00490={};_0xd00490[_0x17ad79]={'$like':'%'+_0xd74615[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0xd00490;})});}_0x11d419=_[_0x92d9('0x5a')]({},_0x11d419,_0xd74615[_0x92d9('0x5b')]);return db[_0x92d9('0x7b')]['count']({'where':_0x11d419[_0x92d9('0x57')]})[_0x92d9('0x1c')](function(_0x360c91){_0xdd8102['count']=_0x360c91;if(_0xd74615[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x11d419[_0x92d9('0x5e')]=[{'all':!![]}];}return db[_0x92d9('0x7b')][_0x92d9('0x5f')](_0x11d419);})['then'](function(_0x14d27f){_0xdd8102['rows']=_0x14d27f;return _0xdd8102;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x2b52b7,_0x11d419))['catch'](handleError(_0x2b52b7,null));};exports[_0x92d9('0x7e')]=function(_0x843e58,_0x2b2479){return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x843e58[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x2b2479,null))['then'](function(_0x2db909){if(_0x2db909){return _0x2db909[_0x92d9('0x7e')](_0x843e58[_0x92d9('0x4f')]['ids']);}})['then'](respondWithStatusCode(_0x2b2479,null))[_0x92d9('0x26')](handleError(_0x2b2479,null));};exports[_0x92d9('0x7f')]=function(_0x2aaa3f,_0x787fa3){_0x2aaa3f[_0x92d9('0x65')][_0x92d9('0x80')]=_0x2aaa3f[_0x92d9('0x81')][_0x92d9('0x82')];return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x2aaa3f[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x787fa3,null))[_0x92d9('0x1c')](saveUpdates(_0x2aaa3f[_0x92d9('0x65')],null))[_0x92d9('0x1c')](respondWithResult(_0x787fa3,null))[_0x92d9('0x26')](handleError(_0x787fa3,null));};exports['addAvatar']=function(_0x35f5b0,_0x612466){_0x35f5b0['body']['agentAvatar']=_0x35f5b0['file']['filename'];return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x35f5b0[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x612466,null))[_0x92d9('0x1c')](saveUpdates(_0x35f5b0[_0x92d9('0x65')],null))[_0x92d9('0x1c')](respondWithResult(_0x612466,null))[_0x92d9('0x26')](handleError(_0x612466,null));};exports[_0x92d9('0x83')]=function(_0x1c027e,_0x39483e){_0x1c027e['body'][_0x92d9('0x84')]=_0x1c027e[_0x92d9('0x81')][_0x92d9('0x82')];return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x1c027e[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x39483e,null))[_0x92d9('0x1c')](saveUpdates(_0x1c027e[_0x92d9('0x65')],null))['then'](respondWithResult(_0x39483e,null))['catch'](handleError(_0x39483e,null));};exports['addSystemAvatar']=function(_0x30c062,_0x58c536){_0x30c062[_0x92d9('0x65')]['systemAvatar']=_0x30c062['file']['filename'];return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x30c062[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x58c536,null))[_0x92d9('0x1c')](saveUpdates(_0x30c062[_0x92d9('0x65')],null))['then'](respondWithResult(_0x58c536,null))['catch'](handleError(_0x58c536,null));};exports['getLogo']=function(_0x1f9273,_0x2cce24){var _0x4a1b05=path['join'](config[_0x92d9('0x85')],_0x92d9('0x86'));var _0x4724fa={'where':{'id':_0x1f9273[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x80')],'raw':!![]};var _0x426886=![];return require(_0x92d9('0x87'))['getLicense']()[_0x92d9('0x1c')](function(_0x4653df){if(_0x4653df){_0x426886=_0x4653df[_0x92d9('0x88')];}})[_0x92d9('0x1c')](function(){return db[_0x92d9('0x4b')][_0x92d9('0x6e')](_0x4724fa);})[_0x92d9('0x1c')](handleEntityNotFound(_0x2cce24,null))[_0x92d9('0x1c')](function(_0x348cb4){if(_0x348cb4){if(!_[_0x92d9('0x89')](_0x348cb4[_0x92d9('0x80')])){if(fs['existsSync'](path['join'](config[_0x92d9('0x85')],_0x92d9('0x8a'),_0x348cb4[_0x92d9('0x80')]))&&_0x426886){_0x4a1b05=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/logos/',_0x348cb4[_0x92d9('0x80')]);}}return _0x2cce24[_0x92d9('0x8c')](_0x4a1b05);}})[_0x92d9('0x26')](handleError(_0x2cce24,null));};exports[_0x92d9('0x8d')]=function(_0x454c17,_0x2aac60){var _0x1d198e=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x8e'));var _0xfbb9ee={'where':{'id':_0x454c17[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x8f')],'raw':!![]};return db[_0x92d9('0x4b')]['find'](_0xfbb9ee)[_0x92d9('0x1c')](handleEntityNotFound(_0x2aac60,null))['then'](function(_0x1e0df5){if(_0x1e0df5){if(!_[_0x92d9('0x89')](_0x1e0df5[_0x92d9('0x8f')])){if(fs[_0x92d9('0x90')](path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x91'),_0x1e0df5[_0x92d9('0x8f')]))){_0x1d198e=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x91'),_0x1e0df5['agentAvatar']);}}return _0x2aac60[_0x92d9('0x8c')](_0x1d198e);}})[_0x92d9('0x26')](handleError(_0x2aac60,null));};exports['getCustomerAvatar']=function(_0x2c028d,_0x3bfa58){var _0x452b1f=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/avatars/customer_avatar.png');var _0x46fd3e={'where':{'id':_0x2c028d[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x84'),_0x92d9('0x92')],'raw':!![]};return db[_0x92d9('0x4b')]['find'](_0x46fd3e)['then'](handleEntityNotFound(_0x3bfa58,null))[_0x92d9('0x1c')](function(_0x2fec38){if(_0x2fec38){if(!_[_0x92d9('0x89')](_0x2fec38[_0x92d9('0x84')])){if(fs[_0x92d9('0x90')](path[_0x92d9('0x8b')](config['root'],_0x92d9('0x91'),_0x2fec38['customerAvatar']))&&_0x2fec38[_0x92d9('0x92')]){_0x452b1f=path[_0x92d9('0x8b')](config['root'],_0x92d9('0x91'),_0x2fec38[_0x92d9('0x84')]);}}return _0x3bfa58[_0x92d9('0x8c')](_0x452b1f);}})[_0x92d9('0x26')](handleError(_0x3bfa58,null));};exports[_0x92d9('0x93')]=function(_0x42785e,_0xa51505){var _0x443faa=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/avatars/system_avatar.png');var _0x2b0b45={'where':{'id':_0x42785e[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x94')],'raw':!![]};return db[_0x92d9('0x4b')][_0x92d9('0x6e')](_0x2b0b45)[_0x92d9('0x1c')](handleEntityNotFound(_0xa51505,null))[_0x92d9('0x1c')](function(_0x5dd80c){if(_0x5dd80c){if(!_[_0x92d9('0x89')](_0x5dd80c[_0x92d9('0x94')])){if(fs[_0x92d9('0x90')](path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x91'),_0x5dd80c[_0x92d9('0x94')]))){_0x443faa=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/avatars/',_0x5dd80c[_0x92d9('0x94')]);}}return _0xa51505['download'](_0x443faa);}})[_0x92d9('0x26')](handleError(_0xa51505,null));};function checkWebsiteInterval(_0x4df746){var _0x4893af=_0x4df746[_0x92d9('0x95')];if(!_0x4893af){return Promise[_0x92d9('0x96')](_0x4df746);}var _0x11f33c=_0x4df746[_0x92d9('0x97')]||undefined;return _0x4893af[_0x92d9('0x98')](_0x11f33c)[_0x92d9('0x1c')](function(_0x4add15){if(!_0x4add15){throw new APIOutOfIntervalError();}return _0x4df746;});}exports[_0x92d9('0x99')]=function(_0x1b328a,_0x35ea79){var _0x1d6bb5={'body':_0x1b328a[_0x92d9('0x65')],'channel':_0x92d9('0x9a')};var _0x2035ef=[];var _0x2d4856=[];var _0x14849f={};var _0x527567=![];if(_0x1b328a[_0x92d9('0x65')]['id']){delete _0x1b328a[_0x92d9('0x65')]['id'];}if(_[_0x92d9('0x89')](_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9b')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_['isNil'](_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9c')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x92d9('0x9d')](_0x1b328a['body'][_0x92d9('0x65')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0xe51afa=_0x1b328a[_0x92d9('0x65')]['customerIp']&&_0x1b328a[_0x92d9('0x65')]['referer'];return db[_0x92d9('0x9e')][_0x92d9('0x70')]()[_0x92d9('0x1c')](function(_0x5ef99c){if(!_0x5ef99c){throw new Error('No\x20available\x20attributes');}_0x2035ef=Object[_0x92d9('0x50')](_0x5ef99c)[_0x92d9('0x59')](function(_0x16e0af){return![_0x92d9('0x9f'),'updatedAt']['includes'](_0x16e0af);});_0x2d4856=Object[_0x92d9('0x50')](_0x5ef99c)['filter'](function(_0xdf392a){return!['createdAt',_0x92d9('0xa0'),_0x92d9('0xa1'),_0x92d9('0xa2')][_0x92d9('0xa3')](_0xdf392a);});if(!_[_0x92d9('0xa3')](_0x2d4856,_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9c')])){throw new APIBadRequestError(_0x92d9('0xa4')+_0x2d4856['join'](',\x20'));}_0x14849f[_0x1b328a[_0x92d9('0x65')]['mapKey']]=_0x1b328a[_0x92d9('0x65')]['from'];})[_0x92d9('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1b328a[_0x92d9('0x62')]['id']},'include':[{'model':db[_0x92d9('0xa5')],'as':_0x92d9('0xa6'),'include':[{'model':db[_0x92d9('0x9e')],'as':_0x92d9('0xa7'),'where':_0x14849f,'limit':0x1,'order':[[_0x92d9('0xa0'),_0x92d9('0xa8')]]}]},{'model':db[_0x92d9('0xa9')],'as':'Applications'},{'model':db[_0x92d9('0x95')],'as':_0x92d9('0x95'),'include':[{'model':db['Interval'],'as':_0x92d9('0xaa'),'attributes':['id',_0x92d9('0xab')],'raw':!![]}]}]});})[_0x92d9('0x1c')](function(_0x355353){if(!_0x355353){throw new APINotFoundError(util[_0x92d9('0x43')](_0x92d9('0xac'),_0x1b328a[_0x92d9('0x62')]['id']));}if(_0xe51afa){return checkWebsiteInterval(_0x355353);}return _0x355353;})['then'](function(_0x3205c1){_0x1d6bb5[_0x92d9('0xad')]=_0x3205c1;_0x1d6bb5['applications']=_['orderBy'](_0x3205c1[_0x92d9('0xae')],[_0x92d9('0xaf')],['asc']);if(_0x1d6bb5[_0x92d9('0xad')][_0x92d9('0xae')]){delete _0x1d6bb5[_0x92d9('0xad')]['Applications'];}_0x1d6bb5['list']=_0x3205c1['List']||{'id':_0x3205c1['ListId']};if(_0x1d6bb5[_0x92d9('0xb0')]&&_0x1d6bb5['list']['Contacts'][_0x92d9('0x55')]){return _0x1d6bb5[_0x92d9('0xb0')]['Contacts'][0x0];}var _0x3b1ac2=_[_0x92d9('0x15')](_0x1b328a[_0x92d9('0x65')],{'firstName':_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9b')],'ListId':_0x3205c1[_0x92d9('0xa2')]});_0x3b1ac2[_0x1b328a[_0x92d9('0x65')]['mapKey']]=_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9b')];return db[_0x92d9('0x9e')][_0x92d9('0x63')](_0x3b1ac2,{'fields':_0x2035ef,'raw':!![]});})[_0x92d9('0x1c')](function(_0x318f60){_0x1d6bb5[_0x92d9('0xb1')]=_0x318f60;var _0x56b564=createInteractionObject(_0x1b328a[_0x92d9('0x62')]['id'],_0x1b328a[_0x92d9('0x65')],_0x1b328a[_0x92d9('0xb2')],_0x318f60);var _0x24123a={'ChatWebsiteId':_0x1b328a[_0x92d9('0x62')]['id']};if(_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb3')]){_0x24123a['threadId']=_0x1b328a[_0x92d9('0x65')]['threadId'];_0x24123a[_0x92d9('0xb4')]=![];return db[_0x92d9('0xb5')][_0x92d9('0x6e')]({'where':_0x24123a})['then'](function(_0x170687){var _0x57c135=_0x1b328a['body'][_0x92d9('0xb6')]&&_0x1b328a[_0x92d9('0x65')]['referer'];if(_0x170687){_0x527567=!![];return _0x170687;}else if(!_0x57c135&&_0x170687&&_0x170687[_0x92d9('0xb4')]){throw new APIConflictError(_0x92d9('0xb7'));}_0x56b564[_0x92d9('0xb3')]=_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb3')];_0x56b564['externalUrl']=_0x1b328a[_0x92d9('0x65')]['externalUrl'];return db[_0x92d9('0xb5')]['create'](_0x56b564);});}_0x24123a[_0x92d9('0xb8')]=_0x318f60['id'];if(_0x1b328a['body']['interaction']&&_0x1b328a['body'][_0x92d9('0xb9')]['id']){_0x24123a['id']=_0x1b328a[_0x92d9('0x65')]['interaction']['id'];return db['ChatInteraction'][_0x92d9('0x6e')]({'where':_0x24123a})[_0x92d9('0x1c')](function(_0x87727c){var _0x4dfb82=_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb6')]&&_0x1b328a[_0x92d9('0x65')][_0x92d9('0x40')];if(!_0x4dfb82&&_0x87727c&&_0x87727c[_0x92d9('0xb4')]){throw new APIConflictError(_0x92d9('0xb7'));}else if(_0x87727c){_0x527567=!![];return _0x87727c;}else{return db[_0x92d9('0xb5')][_0x92d9('0x63')](_0x56b564);}});}return db[_0x92d9('0xb5')][_0x92d9('0x63')](_0x56b564);})['then'](function(_0x511482){if(!_0x527567){return _0x511482;}var _0x35d23d={'from':(_0x1d6bb5[_0x92d9('0xb1')][_0x92d9('0x3e')]||'')+'\x20'+(_0x1d6bb5[_0x92d9('0xb1')]['lastName']||'')};if(_0x1b328a['body'][_0x92d9('0xb3')]&&_0x1b328a[_0x92d9('0x65')]['messageId']&&_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb3')]!=_0x1b328a[_0x92d9('0x65')][_0x92d9('0xba')]){_0x35d23d[_0x92d9('0xb3')]=_0x1b328a[_0x92d9('0x65')]['messageId'];}return _0x511482[_0x92d9('0x30')](_0x35d23d);})['then'](function(_0x947df7){_0x1d6bb5['interaction']=_0x947df7['get']({'plain':!![]});_0x1d6bb5['interaction']['created']=!_0x527567;if(_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xbb')]){if(_0x1d6bb5[_0x92d9('0xad')][_0x92d9('0xbc')]){_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0xbe')]({'id':0x0,'priority':_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0x55')]+0x1,'app':_0x92d9('0xbf'),'appdata':_0x92d9('0xc0'),'interval':_0x92d9('0xc1')});}}return db[_0x92d9('0xc2')][_0x92d9('0x63')]({'body':_0x1b328a[_0x92d9('0x65')][_0x92d9('0x65')],'ChatWebsiteId':_0x1b328a[_0x92d9('0x62')]['id'],'ChatInteractionId':_0x947df7['id'],'direction':'in','ContactId':_0x1d6bb5[_0x92d9('0xb1')]['id'],'AttachmentId':_0x1b328a[_0x92d9('0x65')][_0x92d9('0xc3')]});})[_0x92d9('0x1c')](function(_0x3ed67f){_0x1d6bb5['message']=_0x3ed67f;if(!_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xc4')]){return;}return db[_0x92d9('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xc4')]}});})[_0x92d9('0x1c')](function(_0x335337){if(_0x335337){_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0xc6')]({'id':0x0,'priority':0x0,'app':_0x92d9('0xc7'),'appdata':_0x335337['name']+','+(_0x1d6bb5[_0x92d9('0xad')]['waitForTheAssignedAgent']||0xa),'interval':_0x92d9('0xc1')});_0x1d6bb5[_0x92d9('0xc8')]=!![];}if(!_0x1d6bb5[_0x92d9('0xb9')]['queueId']){return;}return db[_0x92d9('0xc9')]['find']({'attributes':['id',_0x92d9('0x36')],'where':{'id':_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xca')]}});})[_0x92d9('0x1c')](function(_0x252879){if(_0x252879){_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0xc6')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x252879[_0x92d9('0x36')]+','+(_0x1d6bb5['account'][_0x92d9('0xcb')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x92d9('0xcc'),'startRouting',_0x1d6bb5);})[_0x92d9('0x1c')](function(_0x924cbc){respondWithRpcPromise(_0x92d9('0xcd'),_0x92d9('0xcd'),{'event':_0x92d9('0x99'),'message':_0x924cbc},client9002);return _0x924cbc;})['then'](respondWithResult(_0x35ea79,null))['catch'](APIHandleError(_0x35ea79));};exports[_0x92d9('0xce')]=function(_0x3d616c,_0x1bcd73){var _0xcd2ce9,_0x523fa0,_0x10cb0b;var _0x311576=[];var _0x4793da={};var _0x176479=_0x3d616c['files']||[];var _0xa9e0b0=[];var _0xb1d5ea;return db[_0x92d9('0x9e')][_0x92d9('0x70')]()[_0x92d9('0x1c')](function(_0x5a3368){if(!_0x5a3368){throw new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))](_0x92d9('0xd1'));}_0x311576=_['difference'](_['keys'](_0x5a3368),['createdAt',_0x92d9('0xa0'),_0x92d9('0xa1'),_0x92d9('0xa2')]);if(_0x3d616c[_0x92d9('0x65')]['id']){delete _0x3d616c['body']['id'];}if(_[_0x92d9('0x89')](_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')])){throw _0x1bcd73[_0x92d9('0x28')](0x1f4)['send'](new db[(_0x92d9('0xcf'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x92d9('0x89')](_0x3d616c['body'][_0x92d9('0x65')])||_0x3d616c[_0x92d9('0x65')][_0x92d9('0x65')]===''){throw _0x1bcd73[_0x92d9('0x28')](0x1f4)['send'](new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))](_0x92d9('0xd2')));}if(_[_0x92d9('0x89')](_0x3d616c[_0x92d9('0x65')]['mapKeyOffline'])){throw _0x1bcd73[_0x92d9('0x28')](0x1f4)[_0x92d9('0x37')](new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x311576));}if(!_[_0x92d9('0xa3')](_0x311576,_0x3d616c[_0x92d9('0x65')][_0x92d9('0xd3')])){throw _0x1bcd73['status'](0x1f4)[_0x92d9('0x37')](new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))](_0x92d9('0xd4')+_0x311576));}_0x4793da[_0x3d616c[_0x92d9('0x65')][_0x92d9('0xd3')]]=_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')];})['then'](function(){return db['ChatWebsite'][_0x92d9('0x6e')]({'where':{'id':_0x3d616c[_0x92d9('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x92d9('0xa6')},{'model':db[_0x92d9('0xd5')],'as':_0x92d9('0xd5')}]});})[_0x92d9('0x1c')](handleEntityNotFound(_0x1bcd73,null))[_0x92d9('0x1c')](function(_0x2b5c3e){if(_0x2b5c3e&&_0x2b5c3e[_0x92d9('0xa6')]){_0x523fa0=_0x2b5c3e;var _0x29caea=_[_0x92d9('0x15')](_0x3d616c[_0x92d9('0x65')],{'firstName':_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')],'phone':_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')],'ListId':_0x2b5c3e[_0x92d9('0xa2')]});_0x29caea[_0x3d616c[_0x92d9('0x65')]['mapKeyOffline']]=_0x3d616c['body'][_0x92d9('0x9b')];return db['CmContact'][_0x92d9('0xd6')]({'where':_0x4793da,'defaults':_0x29caea});}})[_0x92d9('0xd7')](function(_0x1c202a){if(_0x1c202a){_0x10cb0b=_0x1c202a;var _0x4fa159=fs[_0x92d9('0xd8')](path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/templates/chatOfflineMessage.ejs'),_0x92d9('0xd9'));var _0x1c554a=ejs[_0x92d9('0xda')](_0x4fa159,{'body':_[_0x92d9('0xdb')](_0x3d616c['body'][_0x92d9('0x65')]),'bodyTitle':_0x523fa0[_0x92d9('0xdc')]});return db['ChatOfflineMessage'][_0x92d9('0x63')]({'body':_0x1c554a,'plainBody':htmlToText[_0x92d9('0xdd')](_0x1c554a),'ContactId':_0x1c202a['id'],'ChatWebsiteId':_0x523fa0['id']});}})[_0x92d9('0x1c')](function(_0x13a765){_0xb1d5ea=_0x13a765;if(_0x176479[_0x92d9('0x55')]){var _0x477128=_0x176479[_0x92d9('0x4e')](function(_0x5de1a1){return{'name':_0x5de1a1['originalname'],'basename':_0x5de1a1['filename'],'type':_0x5de1a1[_0x92d9('0xde')],'ChatOfflineMessageId':_0x13a765['id']};});_0xa9e0b0=_0x477128[_0x92d9('0x4e')](_0x4ad04f=>{var _0x56f8d6={'filename':_0x4ad04f[_0x92d9('0x36')],'path':path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0xdf'),_0x92d9('0xe0'),_0x92d9('0xe1'),'offline-chat',_0x4ad04f['basename'])};return _0x56f8d6;});if(!_0x523fa0['openNewInteraction']){return db[_0x92d9('0xe2')][_0x92d9('0xe3')](function(_0x3540a9){return db[_0x92d9('0xe4')]['bulkCreate'](_0x477128,{'transaction':_0x3540a9});});}}})[_0x92d9('0x1c')](function(){if(_0xb1d5ea){_0xcd2ce9=_0xb1d5ea;return db[_0x92d9('0xd5')][_0x92d9('0x75')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x92d9('0xe5'),'raw':!![],'include':[{'model':db[_0x92d9('0xe6')],'as':_0x92d9('0xe6'),'raw':!![]}]}]});}})[_0x92d9('0x1c')](function(_0x4ce013){if(_0x4ce013&&_0x4ce013[_0x92d9('0xe5')]&&_0x523fa0[_0x92d9('0xe7')]&&_0x523fa0[_0x92d9('0xe8')]){var _0x51f2b2=_0x4ce013[_0x92d9('0xe9')]();return respondWithRpcPromise(_0x92d9('0xea'),'sendMail',{'account':_0x51f2b2,'message':{'from':util[_0x92d9('0x43')](_0x92d9('0xeb'),_0x4ce013[_0x92d9('0x36')],_0x4ce013['email']||_0x4ce013['Smtp'][_0x92d9('0x68')]),'to':_0x523fa0['forwardOfflineAddress'],'subject':_0x523fa0[_0x92d9('0xec')],'html':_0xcd2ce9[_0x92d9('0x65')],'attachments':_0xa9e0b0}},client9003)['then'](function(){return _0xcd2ce9;})['catch'](function(_0x3db0a6){logger[_0x92d9('0x23')](_0x3db0a6);});}})[_0x92d9('0x1c')](function(){if(_0x523fa0&&_0x523fa0[_0x92d9('0xed')]&&_0x523fa0[_0x92d9('0xee')]){var _0x1b70be=[];if(_0x176479['length']){_0x1b70be=_0x176479[_0x92d9('0x4e')](function(_0x21c813){return{'name':_0x21c813[_0x92d9('0xef')],'basename':_0x21c813[_0x92d9('0x82')],'type':_0x21c813[_0x92d9('0xde')],'ChatOfflineMessageId':_0xb1d5ea['id']};});}var _0x362b97;if(!_[_0x92d9('0x89')](_0x523fa0[_0x92d9('0xf0')])){var _0x327b44=_[_0x92d9('0x4e')](_0x3d616c[_0x92d9('0x65')],function(_0x26754e){return _0x26754e;});var _0x3d2b5d=_['toPairsIn'](_0x327b44)[0x0];var _0x3d0201=_[_0x92d9('0xf1')](_0x3d2b5d,function(_0xf1d504){return _0xf1d504;});_0x362b97=_0x3d0201[0x1][_0x523fa0[_0x92d9('0xf0')]];}var _0x3a8405={'from':_0x10cb0b['email'],'firstName':_0x10cb0b[_0x92d9('0x3e')],'lastName':_0x10cb0b[_0x92d9('0xf2')],'mapKey':'email','message':{'from':_0x10cb0b[_0x92d9('0xf3')],'to':_0x523fa0[_0x92d9('0xd5')][_0x92d9('0xf3')],'cc':'','subject':_[_0x92d9('0x89')](_0x362b97)?_0x523fa0['offlineMessageSubject']:_0x362b97,'messageId':'','sentAt':new Date(),'attach':_0x1b70be['length'],'attachments':_0x1b70be,'originChannel':'Chat','ChatWebsiteId':_0x523fa0['id'],'ChatOfflineMessageId':_0xcd2ce9['id'],'originTo':_0x523fa0[_0x92d9('0xd5')]['email']},'body':_0xcd2ce9[_0x92d9('0x65')]};var _0x359974={'account':{'id':_0x523fa0[_0x92d9('0xee')]},'body':_0x3a8405,'log':_0x92d9('0xf4')};return respondWithRpcPromise(_0x92d9('0xf4'),_0x92d9('0xf5'),_0x359974,client9001)[_0x92d9('0x1c')](function(){return _0xcd2ce9;})[_0x92d9('0x26')](function(_0xb7c57e){logger[_0x92d9('0x23')](_0xb7c57e);});}return;})[_0x92d9('0x1c')](function(){if(_0xcd2ce9){return _0xcd2ce9;}})[_0x92d9('0x1c')](respondWithResult(_0x1bcd73,null))['catch'](function(){for(var _0x1627a5 of _0x176479){var _0x3f2480=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server','files',_0x92d9('0xe1'),'offline-chat',_0x1627a5[_0x92d9('0x82')]);fs_extra[_0x92d9('0xf6')](_0x3f2480)[_0x92d9('0x26')](function(_0x78cf01){logger[_0x92d9('0x23')](_0x92d9('0xf7'),_0x3f2480,_0x78cf01);});}});};exports['addInteraction']=function(_0x2a1afa,_0x5b08e5){return db['ChatInteraction'][_0x92d9('0x6e')]({'where':{'id':_0x2a1afa[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x5b08e5,null))['then'](function(_0x8a642d){if(_0x8a642d){return _0x8a642d[_0x92d9('0xf8')](_0x2a1afa[_0x92d9('0x65')]['ids'],_[_0x92d9('0xf9')](_0x2a1afa[_0x92d9('0x65')],['ids','id'])||{});}})[_0x92d9('0x1c')](respondWithResult(_0x5b08e5,null))[_0x92d9('0x26')](handleError(_0x5b08e5,null));};exports[_0x92d9('0xfa')]=function(_0x3cb0df,_0x26fb8c){var _0x4fe48d={'raw':![],'where':{}};var _0x36b0df={};var _0x394866={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3cb0df[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x26fb8c,null))[_0x92d9('0x1c')](function(_0xe3e064){if(_0xe3e064){_0x36b0df[_0x92d9('0x45')]=_[_0x92d9('0x50')](db['ChatInteraction'][_0x92d9('0x4c')]);_0x36b0df[_0x92d9('0x4f')]=_['keys'](_0x3cb0df['query']);_0x36b0df[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x36b0df[_0x92d9('0x45')],_0x36b0df[_0x92d9('0x4f')]);_0x4fe48d[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x36b0df['model'],qs[_0x92d9('0x54')](_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x4fe48d[_0x92d9('0x53')]=_0x4fe48d[_0x92d9('0x53')][_0x92d9('0x55')]?_0x4fe48d[_0x92d9('0x53')]:_0x36b0df['model'];if(!_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x4fe48d[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x3cb0df['query']['limit']);_0x4fe48d[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x4fe48d[_0x92d9('0x7c')]=qs[_0x92d9('0x56')](_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x4fe48d[_0x92d9('0x57')]=qs['filters'](_[_0x92d9('0x7d')](_0x3cb0df['query'],_0x36b0df[_0x92d9('0x51')]));_0x4fe48d[_0x92d9('0x57')][_0x92d9('0x72')]=_0xe3e064['id'];if(_0x3cb0df['query']['filter']){_0x4fe48d[_0x92d9('0x57')]=_['merge'](_0x4fe48d[_0x92d9('0x57')],{'$or':_[_0x92d9('0x4e')](_0x4fe48d[_0x92d9('0x53')],function(_0x5d4d63){var _0x4caca1={};_0x4caca1[_0x5d4d63]={'$like':'%'+_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0x4caca1;})});}_0x4fe48d=_[_0x92d9('0x5a')]({},_0x4fe48d,_0x3cb0df[_0x92d9('0x5b')]);return db[_0x92d9('0xb5')]['count']({'where':_0x4fe48d[_0x92d9('0x57')]})[_0x92d9('0x1c')](function(_0x4b9d57){_0x394866[_0x92d9('0x5c')]=_0x4b9d57;if(_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x4fe48d[_0x92d9('0x5e')]=[{'model':db[_0x92d9('0x9e')],'as':_0x92d9('0xfb'),'required':![]},{'model':db[_0x92d9('0xc5')],'as':_0x92d9('0xfc'),'attributes':[_0x92d9('0x36'),_0x92d9('0xfd'),_0x92d9('0xfe')],'required':![]},{'model':db[_0x92d9('0xff')],'as':_0x92d9('0x100'),'attributes':['id','name',_0x92d9('0x101')],'where':_0x3cb0df[_0x92d9('0x4f')]['tag']?{'id':_0x3cb0df[_0x92d9('0x4f')]['tag']}:undefined,'required':_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x102')]?!![]:![]}];}return db[_0x92d9('0xb5')][_0x92d9('0x5f')](_0x4fe48d);})[_0x92d9('0x1c')](function(_0x528244){_0x394866['rows']=_0x528244;return _0x394866;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x26fb8c,_0x4fe48d))[_0x92d9('0x26')](handleError(_0x26fb8c,null));};exports[_0x92d9('0x103')]=function(_0xd67e72,_0x201676){var _0x419a7a=0x0;var _0x29fcbf=0x0;var _0x241805=![];var _0x2a7197;var _0xe2e6bb;return db[_0x92d9('0x4b')]['find']({'where':{'id':_0xd67e72[_0x92d9('0x62')]['id']},'include':[{'model':db[_0x92d9('0x95')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x92d9('0xab')]}]}]})[_0x92d9('0x1c')](handleEntityNotFound(_0x201676,null))['then'](function(_0x2cffba){if(_0x2cffba){_0x2a7197=_0x2cffba;return _0x2cffba[_0x92d9('0x104')]({'raw':!![]});}})['then'](function(_0x45c66c){if(_0x2a7197){if(_0x45c66c){_0xe2e6bb=_0x45c66c;}}return require('../../config/license/util')[_0x92d9('0x105')]();})['then'](function(_0x431515){if(_0x431515){_0x29fcbf=_0x431515[_0x92d9('0x106')];_0x241805=_0x431515[_0x92d9('0x88')];}})[_0x92d9('0x1c')](function(){return db[_0x92d9('0xb5')]['count']({'where':{'closed':![]}});})[_0x92d9('0x1c')](function(_0x88e397){_0x419a7a=_0x88e397;if(_0x29fcbf&&_0x88e397>_0x29fcbf){return db[_0x92d9('0x107')][_0x92d9('0x75')]({'where':{'id':0x1}})[_0x92d9('0x1c')](function(_0xefac7b){if(_0xefac7b){_0xefac7b[_0x92d9('0x108')](_0x92d9('0x109'));}});}})[_0x92d9('0x1c')](function(){var _0x3d2393=_0x2a7197[_0x92d9('0x95')];var _0x18d143=_0x2a7197[_0x92d9('0x97')]||undefined;return _0x3d2393?_0x3d2393[_0x92d9('0x98')](_0x18d143):!![];})[_0x92d9('0x1c')](function(_0x29ac61){var _0x4e408c=fs[_0x92d9('0xd8')](path[_0x92d9('0x8b')](config['root'],_0x92d9('0x10a')),_0x92d9('0xd9'));var _0x29b19b=_0x92d9('0x10b');var _0x29fb68=![];try{const _0x4591d8=new URL(_0x2a7197['address']);_0x2a7197[_0x92d9('0x66')]=_0x4591d8['origin'];}catch(_0x7c1ed8){}var _0x4ff9d5;if(_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]){_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]=_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]['replace'](/\/$/,'');_0x4ff9d5=wildcardUtils[_0x92d9('0x10c')](_0x2a7197[_0x92d9('0x66')],_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]);}else{_0xd67e72['headers'][_0x92d9('0x40')]=_0x2a7197[_0x92d9('0x66')];_0x4ff9d5=!![];}var _0x5f331c={'chatVersion':_0x29b19b,'chatWebsiteAddressOrigin':_0x4ff9d5?_0xd67e72['headers'][_0x92d9('0x40')]:_0x2a7197['address'],'remote':_0x2a7197[_0x92d9('0x10d')],'query':querystring[_0x92d9('0x20')](_[_0x92d9('0x5a')](_0x2a7197[_0x92d9('0x32')]({'plain':!![]}),{'customerIp':_0xd67e72[_0x92d9('0xb2')]['x-forwarded-for']||_0xd67e72['headers']['x-real-ip']||_0xd67e72['connection'][_0x92d9('0x10e')]||_0xd67e72['ip'],'referer':_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')],'openedInteractions':_0x419a7a,'maxInteractions':_0x29fcbf,'virtual':_0x241805[_0x92d9('0x106')],'online':_0x29ac61,'custom':_0x241805,'address':_0x4ff9d5?_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]:null}))[_0x92d9('0x10f')](/'/g,'\x5c\x27')};_0x201676[_0x92d9('0x37')](ejs[_0x92d9('0xda')](Mustache[_0x92d9('0xda')](_0x4e408c,_0x5f331c),{'proactiveActions':_0xe2e6bb,'alignment':_0x2a7197['alignment'],'verticalAlignment':_0x2a7197['verticalAlignment'],'div_color':_0x2a7197[_0x92d9('0x101')],'labelText':_0x2a7197['labelText'],'text_color':_0x2a7197[_0x92d9('0x110')],'text_button_color':_0x2a7197[_0x92d9('0x111')],'button_color':_0x2a7197[_0x92d9('0x112')],'background_color':_0x2a7197['backgroundColor'],'hideWhenOffline':_0x2a7197['hideWhenOffline'],'intervalId':_0x2a7197['IntervalId'],'isDevelopment':_0x29fb68,'chatVersion':_0x29b19b}));})[_0x92d9('0x26')](handleError(_0x201676,null));};exports[_0x92d9('0x113')]=function(_0x1be47d,_0xd0dc15){var _0x22338a=_0x1be47d['params']['id'];var _0x3a936a=_0x1be47d[_0x92d9('0x65')];var _0x15c7fd=0xc8;var _0x171bea=null;return db[_0x92d9('0xe2')][_0x92d9('0xe3')]({'isolationLevel':db[_0x92d9('0xe2')][_0x92d9('0x114')][_0x92d9('0x115')][_0x92d9('0x116')]},function(_0x40f51c){return db['ChatWebsite']['findOne']({'where':{'id':_0x22338a},'transaction':_0x40f51c})[_0x92d9('0x1c')](function(_0x46b609){if(_0x46b609){return db[_0x92d9('0xa9')][_0x92d9('0x31')]({'where':{'ChatWebsiteId':_0x22338a},'transaction':_0x40f51c})['then'](function(){var _0x498b2c=_['map'](_0x3a936a,function(_0x2cdb75){_0x2cdb75[_0x92d9('0x72')]=_0x22338a;return _0x2cdb75;});return db[_0x92d9('0xa9')][_0x92d9('0x117')](_0x498b2c,{'transaction':_0x40f51c});});}else{_0x15c7fd=0x194;_0x171bea=[];}});})['then'](function(){if(_0x15c7fd!==0x194){return db[_0x92d9('0xa9')][_0x92d9('0x118')]({'where':{'ChatWebsiteId':_0x22338a},'order':_0x92d9('0xaf')})[_0x92d9('0x1c')](function(_0x487380){_0x171bea=_0x487380;});}})['catch'](function(_0x204bfa){_0x15c7fd=0x1f4;logger[_0x92d9('0x23')](_0x204bfa['stack']);if(_0x204bfa['name']){delete _0x204bfa[_0x92d9('0x36')];}_0x171bea=_0x204bfa;})[_0x92d9('0x119')](function(){if(_0x171bea===null){_0xd0dc15['sendStatus'](_0x15c7fd);}else{if(_0x15c7fd===0x1f4){_0xd0dc15[_0x92d9('0x28')](_0x15c7fd)[_0x92d9('0x37')](_0x171bea);}else{_0xd0dc15[_0x92d9('0x28')](_0x15c7fd)[_0x92d9('0x2a')](_0x171bea);}}});};exports[_0x92d9('0x11a')]=function(_0x36ab1a,_0x420668){var _0x4adae5={};var _0x34abe8={};var _0x142264;var _0x59c646;return db['ChatWebsite']['findOne']({'where':{'id':_0x36ab1a[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x420668,null))[_0x92d9('0x1c')](function(_0x4dd168){if(_0x4dd168){_0x142264=_0x4dd168;_0x34abe8['model']=_['keys'](db[_0x92d9('0xa9')]['rawAttributes']);_0x34abe8[_0x92d9('0x4f')]=_['keys'](_0x36ab1a[_0x92d9('0x4f')]);_0x34abe8[_0x92d9('0x51')]=_['intersection'](_0x34abe8['model'],_0x34abe8['query']);_0x4adae5[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x34abe8[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x4adae5[_0x92d9('0x53')]=_0x4adae5['attributes'][_0x92d9('0x55')]?_0x4adae5[_0x92d9('0x53')]:_0x34abe8[_0x92d9('0x45')];_0x4adae5[_0x92d9('0x7c')]=qs['sort'](_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x4adae5[_0x92d9('0x57')]=qs['filters'](_[_0x92d9('0x7d')](_0x36ab1a[_0x92d9('0x4f')],_0x34abe8[_0x92d9('0x51')]));if(_0x36ab1a['query'][_0x92d9('0x59')]){_0x4adae5['where']=_[_0x92d9('0x5a')](_0x4adae5[_0x92d9('0x57')],{'$or':_['map'](_0x4adae5[_0x92d9('0x53')],function(_0x3953a4){var _0x364cf6={};_0x364cf6[_0x3953a4]={'$like':'%'+_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0x364cf6;})});}_0x4adae5=_['merge']({},_0x4adae5,_0x36ab1a[_0x92d9('0x5b')]);return _0x142264[_0x92d9('0x11a')](_0x4adae5);}})['then'](function(_0x119632){if(_0x119632){_0x59c646=_0x119632[_0x92d9('0x55')];if(!_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x76')]('nolimit')){_0x4adae5[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x36ab1a['query']['limit']);_0x4adae5[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x2b')]);}return _0x142264['getApplications'](_0x4adae5);}})[_0x92d9('0x1c')](function(_0x59fd97){if(_0x59fd97){return _0x59fd97?{'count':_0x59c646,'rows':_0x59fd97}:null;}})[_0x92d9('0x1c')](respondWithResult(_0x420668,null))[_0x92d9('0x26')](handleError(_0x420668,null));};exports[_0x92d9('0x11b')]=function(_0x1258e7,_0x4651b3){return db[_0x92d9('0x11c')][_0x92d9('0x6e')]({'where':{'id':_0x1258e7[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x4651b3,null))['then'](function(_0x1183b6){if(_0x1183b6){return _0x1183b6[_0x92d9('0x11b')](_0x1258e7[_0x92d9('0x65')][_0x92d9('0x79')],_[_0x92d9('0xf9')](_0x1258e7[_0x92d9('0x65')],[_0x92d9('0x79'),'id'])||{});}})[_0x92d9('0x1c')](respondWithResult(_0x4651b3,null))[_0x92d9('0x26')](handleError(_0x4651b3,null));};exports['getProactiveActions']=function(_0x4d1dfa,_0xd083da){var _0x5d803e={};var _0x868b6c={};var _0x57f091;var _0x20b30f;return db[_0x92d9('0x4b')]['findOne']({'where':{'id':_0x4d1dfa['params']['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0xd083da,null))[_0x92d9('0x1c')](function(_0x2a8449){if(_0x2a8449){_0x57f091=_0x2a8449;_0x868b6c[_0x92d9('0x45')]=_[_0x92d9('0x50')](db[_0x92d9('0x11d')][_0x92d9('0x4c')]);_0x868b6c[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x4d1dfa[_0x92d9('0x4f')]);_0x868b6c['filters']=_[_0x92d9('0x52')](_0x868b6c['model'],_0x868b6c[_0x92d9('0x4f')]);_0x5d803e[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x868b6c[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x5d803e[_0x92d9('0x53')]=_0x5d803e[_0x92d9('0x53')]['length']?_0x5d803e[_0x92d9('0x53')]:_0x868b6c['model'];_0x5d803e[_0x92d9('0x7c')]=qs['sort'](_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x5d803e['where']=qs[_0x92d9('0x51')](_[_0x92d9('0x7d')](_0x4d1dfa[_0x92d9('0x4f')],_0x868b6c['filters']));if(_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x59')]){_0x5d803e['where']=_[_0x92d9('0x5a')](_0x5d803e['where'],{'$or':_[_0x92d9('0x4e')](_0x5d803e[_0x92d9('0x53')],function(_0x30d4a0){var _0x57f908={};_0x57f908[_0x30d4a0]={'$like':'%'+_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0x57f908;})});}_0x5d803e=_[_0x92d9('0x5a')]({},_0x5d803e,_0x4d1dfa[_0x92d9('0x5b')]);return _0x57f091[_0x92d9('0x104')](_0x5d803e);}})['then'](function(_0x5f54ae){if(_0x5f54ae){_0x20b30f=_0x5f54ae[_0x92d9('0x55')];if(!_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x5d803e[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x4d1dfa[_0x92d9('0x4f')]['limit']);_0x5d803e['offset']=qs[_0x92d9('0x2b')](_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x2b')]);}return _0x57f091[_0x92d9('0x104')](_0x5d803e);}})[_0x92d9('0x1c')](function(_0x4749fc){if(_0x4749fc){return _0x4749fc?{'count':_0x20b30f,'rows':_0x4749fc}:null;}})['then'](respondWithResult(_0xd083da,null))[_0x92d9('0x26')](handleError(_0xd083da,null));};exports[_0x92d9('0x11e')]=function(_0x509cbf,_0xf01061){var _0x1c0215=_0x509cbf[_0x92d9('0x4f')][_0x92d9('0x11f')]===_0x92d9('0x120')?_0x92d9('0x121'):_0x92d9('0x122');return db['ChatWebsite'][_0x92d9('0x6e')]({'attributes':['id',_0x1c0215],'where':{'id':_0x509cbf[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0xf01061,null))['then'](function(_0x12df27){if(_0x12df27){var _0x438b21=_0x12df27[_0x1c0215];var _0x532e56=_0x438b21&&_0x438b21[_0x92d9('0x123')]?_0x438b21['items']:[];_0xf01061[_0x92d9('0x37')]({'fromKey':_[_0x92d9('0x89')](_0x438b21['fromKey'])?undefined:_0x438b21[_0x92d9('0x124')],'count':_0x532e56[_0x92d9('0x55')],'rows':_0x532e56});}})[_0x92d9('0x26')](handleError(_0xf01061,null));};exports[_0x92d9('0x125')]=function(_0x3530a7,_0x3bb83b){var _0x292e7c={'raw':![],'where':{}};var _0x4b0c3e={};var _0x2cf33e={'count':0x0,'rows':[]};return db[_0x92d9('0x4b')][_0x92d9('0x75')]({'where':{'id':_0x3530a7[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x3bb83b,null))[_0x92d9('0x1c')](function(_0x242943){if(_0x242943){_0x4b0c3e[_0x92d9('0x45')]=_[_0x92d9('0x50')](db[_0x92d9('0x126')][_0x92d9('0x4c')]);_0x4b0c3e[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x3530a7[_0x92d9('0x4f')]);_0x4b0c3e[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x4b0c3e[_0x92d9('0x45')],_0x4b0c3e['query']);_0x292e7c[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x4b0c3e[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x3530a7['query'][_0x92d9('0x54')]));_0x292e7c['attributes']=_0x292e7c[_0x92d9('0x53')][_0x92d9('0x55')]?_0x292e7c[_0x92d9('0x53')]:_0x4b0c3e[_0x92d9('0x45')];if(!_0x3530a7[_0x92d9('0x4f')]['hasOwnProperty'](_0x92d9('0x77'))){_0x292e7c[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x3530a7['query']['limit']);_0x292e7c[_0x92d9('0x2b')]=qs['offset'](_0x3530a7[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x292e7c['order']=qs['sort'](_0x3530a7['query'][_0x92d9('0x56')]);_0x292e7c[_0x92d9('0x57')]=qs[_0x92d9('0x51')](_[_0x92d9('0x7d')](_0x3530a7[_0x92d9('0x4f')],_0x4b0c3e['filters']));_0x292e7c[_0x92d9('0x57')][_0x92d9('0x72')]=_0x242943['id'];if(_0x3530a7[_0x92d9('0x4f')][_0x92d9('0x59')]){_0x292e7c[_0x92d9('0x57')]=_[_0x92d9('0x5a')](_0x292e7c[_0x92d9('0x57')],{'$or':_['map'](_0x292e7c[_0x92d9('0x53')],function(_0x4365f6){var _0x2d07e9={};_0x2d07e9[_0x4365f6]={'$like':'%'+_0x3530a7[_0x92d9('0x4f')]['filter']+'%'};return _0x2d07e9;})});}_0x292e7c=_[_0x92d9('0x5a')]({},_0x292e7c,_0x3530a7[_0x92d9('0x5b')]);return db[_0x92d9('0x126')][_0x92d9('0x5c')]({'where':_0x292e7c[_0x92d9('0x57')]})['then'](function(_0x29d9f8){_0x2cf33e['count']=_0x29d9f8;if(_0x3530a7[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x292e7c[_0x92d9('0x5e')]=[{'all':!![]}];}else{_0x292e7c[_0x92d9('0x5e')]=[{'model':db[_0x92d9('0x9e')],'as':_0x92d9('0xfb'),'required':![]},{'model':db[_0x92d9('0xe4')],'as':_0x92d9('0x127'),'required':![]}];}return db[_0x92d9('0x126')]['findAll'](_0x292e7c);})['then'](function(_0x10caaf){_0x2cf33e['rows']=_0x10caaf;return _0x2cf33e;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x3bb83b,_0x292e7c))[_0x92d9('0x26')](handleError(_0x3bb83b,null));};exports[_0x92d9('0x128')]=function(_0x1b0cfc,_0x50e9e9){return db['ChatWebsite'][_0x92d9('0x6e')]({'where':{'id':_0x1b0cfc[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x50e9e9,null))[_0x92d9('0x1c')](function(_0x2832af){if(_0x2832af){return _0x2832af['addAgents'](_0x1b0cfc['body']['ids'],_['omit'](_0x1b0cfc[_0x92d9('0x65')],[_0x92d9('0x79'),'id'])||{})['spread'](function(_0x3addb5){for(var _0x3ef666=0x0;_0x3ef666<_0x1b0cfc[_0x92d9('0x65')][_0x92d9('0x79')][_0x92d9('0x55')];_0x3ef666+=0x1){socket[_0x92d9('0x129')]('userChatWebsite:save',{'UserId':Number(_0x1b0cfc[_0x92d9('0x65')]['ids'][_0x3ef666]),'ChatWebsiteId':Number(_0x1b0cfc[_0x92d9('0x62')]['id'])});}return _0x3addb5;});}})[_0x92d9('0x1c')](respondWithResult(_0x50e9e9,null))['catch'](handleError(_0x50e9e9,null));};exports[_0x92d9('0x12a')]=function(_0x307f0f,_0x241220){return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x307f0f[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x241220,null))[_0x92d9('0x1c')](function(_0x445954){if(_0x445954){return _0x445954[_0x92d9('0x12a')](_0x307f0f[_0x92d9('0x4f')]['ids'])[_0x92d9('0x1c')](function(){if(_[_0x92d9('0x12b')](_0x307f0f[_0x92d9('0x4f')][_0x92d9('0x79')])){for(var _0x277733=0x0;_0x277733<_0x307f0f[_0x92d9('0x4f')]['ids']['length'];_0x277733+=0x1){socket[_0x92d9('0x129')](_0x92d9('0x12c'),{'UserId':Number(_0x307f0f[_0x92d9('0x4f')][_0x92d9('0x79')][_0x277733]),'ChatWebsiteId':Number(_0x307f0f[_0x92d9('0x62')]['id'])});}}else{socket[_0x92d9('0x129')](_0x92d9('0x12c'),{'UserId':Number(_0x307f0f[_0x92d9('0x4f')][_0x92d9('0x79')]),'ChatWebsiteId':Number(_0x307f0f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x241220,null))['catch'](handleError(_0x241220,null));};exports['getAgents']=function(_0x3cfdf0,_0x172f64){var _0x5880eb={};var _0x2e08dd={};var _0xd437e1;var _0x2a0dff;return db[_0x92d9('0x4b')]['findOne']({'where':{'id':_0x3cfdf0['params']['id']}})['then'](handleEntityNotFound(_0x172f64,null))[_0x92d9('0x1c')](function(_0x375162){if(_0x375162){_0xd437e1=_0x375162;_0x2e08dd[_0x92d9('0x45')]=_['keys'](db[_0x92d9('0xc5')]['rawAttributes']);_0x2e08dd[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x3cfdf0[_0x92d9('0x4f')]);_0x2e08dd[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x2e08dd['model'],_0x2e08dd[_0x92d9('0x4f')]);_0x5880eb[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x2e08dd[_0x92d9('0x45')],qs['fields'](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x5880eb[_0x92d9('0x53')]=_0x5880eb[_0x92d9('0x53')][_0x92d9('0x55')]?_0x5880eb[_0x92d9('0x53')]:_0x2e08dd[_0x92d9('0x45')];_0x5880eb['order']=qs[_0x92d9('0x56')](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x5880eb['where']=qs['filters'](_[_0x92d9('0x7d')](_0x3cfdf0[_0x92d9('0x4f')],_0x2e08dd[_0x92d9('0x51')]));if(_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x59')]){_0x5880eb['where']=_['merge'](_0x5880eb['where'],{'$or':_[_0x92d9('0x4e')](_0x5880eb[_0x92d9('0x53')],function(_0x25f0d0){var _0x297aee={};_0x297aee[_0x25f0d0]={'$like':'%'+_0x3cfdf0['query']['filter']+'%'};return _0x297aee;})});}_0x5880eb=_['merge']({},_0x5880eb,_0x3cfdf0['options']);return _0xd437e1[_0x92d9('0x12d')](_0x5880eb);}})[_0x92d9('0x1c')](function(_0x15b3d4){if(_0x15b3d4){_0x2a0dff=_0x15b3d4[_0x92d9('0x55')];if(!_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x5880eb['limit']=qs[_0x92d9('0x2d')](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x2d')]);_0x5880eb[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x2b')]);}return _0xd437e1[_0x92d9('0x12d')](_0x5880eb);}})[_0x92d9('0x1c')](function(_0x2fa851){if(_0x2fa851){return _0x2fa851?{'count':_0x2a0dff,'rows':_0x2fa851}:null;}})[_0x92d9('0x1c')](respondWithResult(_0x172f64,null))[_0x92d9('0x26')](handleError(_0x172f64,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e6ecbdc..763c067 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 _0x5ad3=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x29ec38,_0x179d68){var _0x4e1ba3=function(_0x4341b6){while(--_0x4341b6){_0x29ec38['push'](_0x29ec38['shift']());}};_0x4e1ba3(++_0x179d68);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x39cc8f,_0xb60cd8){_0x39cc8f=_0x39cc8f-0x0;var _0x15e616=_0x5ad3[_0x39cc8f];return _0x15e616;};'use strict';var EventEmitter=require(_0x35ad('0x0'));var ChatWebsite=require(_0x35ad('0x1'))['db'][_0x35ad('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x35ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35ad('0x4'),'afterDestroy':_0x35ad('0x5')};function emitEvent(_0xc77352){return function(_0x69a0b3,_0x450f55,_0x1fed0d){ChatWebsiteEvents[_0x35ad('0x6')](_0xc77352+':'+_0x69a0b3['id'],_0x69a0b3);ChatWebsiteEvents[_0x35ad('0x6')](_0xc77352,_0x69a0b3);_0x1fed0d(null);};}for(var e in events){if(events[_0x35ad('0x7')](e)){var event=events[e];ChatWebsite[_0x35ad('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xedd9=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xedd9,0xfc));var _0x9edd=function(_0x115dfa,_0xa32a7b){_0x115dfa=_0x115dfa-0x0;var _0x358464=_0xedd9[_0x115dfa];return _0x358464;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){ChatWebsiteEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);ChatWebsiteEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 549a9ec..965628e 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 _0x44b2=['define','ChatWebsite','lodash','util','bluebird','path','../../config/environment','exports'];(function(_0x15e83d,_0x31f55d){var _0x35c8d3=function(_0x5cc854){while(--_0x5cc854){_0x15e83d['push'](_0x15e83d['shift']());}};_0x35c8d3(++_0x31f55d);}(_0x44b2,0x182));var _0x244b=function(_0x16c263,_0x2b7e51){_0x16c263=_0x16c263-0x0;var _0x4f1434=_0x44b2[_0x16c263];return _0x4f1434;};'use strict';var _=require(_0x244b('0x0'));var util=require(_0x244b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x244b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x244b('0x3'));var rimraf=require('rimraf');var config=require(_0x244b('0x4'));var attributes=require('./chatWebsite.attributes');module[_0x244b('0x5')]=function(_0x541c2f,_0x2ec1a4){return _0x541c2f[_0x244b('0x6')](_0x244b('0x7'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef49=['api','bluebird','request-promise','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3806e6,_0x2f55d1){var _0x43aea8=function(_0x3c9928){while(--_0x3c9928){_0x3806e6['push'](_0x3806e6['shift']());}};_0x43aea8(++_0x2f55d1);}(_0xef49,0x152));var _0x9ef4=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xef49[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x9ef4('0x0'));var util=require(_0x9ef4('0x1'));var logger=require(_0x9ef4('0x2'))(_0x9ef4('0x3'));var moment=require('moment');var BPromise=require(_0x9ef4('0x4'));var rp=require(_0x9ef4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ef4('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ef4('0x7'));module['exports']=function(_0x6621c3,_0x34a36d){return _0x6621c3[_0x9ef4('0x8')](_0x9ef4('0x9'),attributes,{'tableName':_0x9ef4('0xa'),'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 a48528e..08d8026 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 _0x2bb3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x10a66c,_0x2ffcbc){var _0x5e51f9=function(_0x5396fe){while(--_0x5396fe){_0x10a66c['push'](_0x10a66c['shift']());}};_0x5e51f9(++_0x2ffcbc);}(_0x2bb3,0x1ba));var _0x32bb=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x2bb3[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x32bb('0x0'));var util=require(_0x32bb('0x1'));var moment=require(_0x32bb('0x2'));var BPromise=require(_0x32bb('0x3'));var rs=require(_0x32bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32bb('0x5'))['db'];var utils=require(_0x32bb('0x6'));var logger=require(_0x32bb('0x7'))('rpc');var config=require(_0x32bb('0x8'));var jayson=require(_0x32bb('0x9'));var client=jayson[_0x32bb('0xa')]['http']({'port':0x232a});config[_0x32bb('0xb')]=_[_0x32bb('0xc')](config[_0x32bb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x32bb('0xd'))(new Redis(config['redis']));require(_0x32bb('0xe'))[_0x32bb('0xf')](socket);function respondWithRpcPromise(_0x3d4145,_0xe7df81,_0x1dc223){return new BPromise(function(_0x578d11,_0x454196){return client['request'](_0x3d4145,_0x1dc223)[_0x32bb('0x10')](function(_0x23bd0a){logger[_0x32bb('0x11')](_0x32bb('0x12'),_0xe7df81,_0x32bb('0x13'));logger['debug'](_0x32bb('0x14'),_0xe7df81,'request\x20sent',JSON[_0x32bb('0x15')](_0x23bd0a));if(_0x23bd0a[_0x32bb('0x16')]){if(_0x23bd0a[_0x32bb('0x16')]['code']===0x1f4){logger[_0x32bb('0x16')](_0x32bb('0x12'),_0xe7df81,_0x23bd0a[_0x32bb('0x16')][_0x32bb('0x17')]);return _0x454196(_0x23bd0a[_0x32bb('0x16')][_0x32bb('0x17')]);}logger[_0x32bb('0x16')](_0x32bb('0x12'),_0xe7df81,_0x23bd0a[_0x32bb('0x16')][_0x32bb('0x17')]);return _0x578d11(_0x23bd0a['error'][_0x32bb('0x17')]);}else{logger['info'](_0x32bb('0x12'),_0xe7df81,'request\x20sent');_0x578d11(_0x23bd0a[_0x32bb('0x18')]['message']);}})[_0x32bb('0x19')](function(_0x5d9bd2){logger[_0x32bb('0x16')](_0x32bb('0x12'),_0xe7df81,_0x5d9bd2);_0x454196(_0x5d9bd2);});});} \ No newline at end of file +var _0xe28e=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s'];(function(_0x5bb257,_0x2ac141){var _0x1c3de2=function(_0x45882d){while(--_0x45882d){_0x5bb257['push'](_0x5bb257['shift']());}};_0x1c3de2(++_0x2ac141);}(_0xe28e,0xcc));var _0xee28=function(_0x440547,_0x1c21ed){_0x440547=_0x440547-0x0;var _0x2f0d05=_0xe28e[_0x440547];return _0x2f0d05;};'use strict';var _=require(_0xee28('0x0'));var util=require('util');var moment=require(_0xee28('0x1'));var BPromise=require(_0xee28('0x2'));var rs=require(_0xee28('0x3'));var fs=require('fs');var Redis=require(_0xee28('0x4'));var db=require(_0xee28('0x5'))['db'];var utils=require(_0xee28('0x6'));var logger=require(_0xee28('0x7'))(_0xee28('0x8'));var config=require(_0xee28('0x9'));var jayson=require(_0xee28('0xa'));var client=jayson['client'][_0xee28('0xb')]({'port':0x232a});config[_0xee28('0xc')]=_[_0xee28('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xee28('0xe'))(new Redis(config[_0xee28('0xc')]));require(_0xee28('0xf'))[_0xee28('0x10')](socket);function respondWithRpcPromise(_0x198939,_0x2d9337,_0x977c58){return new BPromise(function(_0xe388a5,_0x11f985){return client[_0xee28('0x11')](_0x198939,_0x977c58)[_0xee28('0x12')](function(_0x12b6ad){logger['info'](_0xee28('0x13'),_0x2d9337,_0xee28('0x14'));logger[_0xee28('0x15')](_0xee28('0x16'),_0x2d9337,_0xee28('0x14'),JSON[_0xee28('0x17')](_0x12b6ad));if(_0x12b6ad[_0xee28('0x18')]){if(_0x12b6ad[_0xee28('0x18')]['code']===0x1f4){logger['error'](_0xee28('0x13'),_0x2d9337,_0x12b6ad[_0xee28('0x18')]['message']);return _0x11f985(_0x12b6ad['error'][_0xee28('0x19')]);}logger[_0xee28('0x18')](_0xee28('0x13'),_0x2d9337,_0x12b6ad[_0xee28('0x18')][_0xee28('0x19')]);return _0xe388a5(_0x12b6ad['error'][_0xee28('0x19')]);}else{logger[_0xee28('0x1a')](_0xee28('0x13'),_0x2d9337,'request\x20sent');_0xe388a5(_0x12b6ad[_0xee28('0x1b')]['message']);}})['catch'](function(_0x5f2902){logger['error'](_0xee28('0x13'),_0x2d9337,_0x5f2902);_0x11f985(_0x5f2902);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3833ecd..e6afd08 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 _0x0383=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x6e6589,_0x2fb432){var _0x105522=function(_0x3da193){while(--_0x3da193){_0x6e6589['push'](_0x6e6589['shift']());}};_0x105522(++_0x2fb432);}(_0x0383,0xf6));var _0x3038=function(_0x12dcc2,_0x213ca4){_0x12dcc2=_0x12dcc2-0x0;var _0x337017=_0x0383[_0x12dcc2];return _0x337017;};'use strict';var ChatWebsiteEvents=require(_0x3038('0x0'));var events=[_0x3038('0x1'),_0x3038('0x2'),_0x3038('0x3')];function createListener(_0x457a33,_0x164031){return function(_0x2e390d){_0x164031[_0x3038('0x4')](_0x457a33,_0x2e390d);};}function removeListener(_0x27ca42,_0x44d702){return function(){ChatWebsiteEvents[_0x3038('0x5')](_0x27ca42,_0x44d702);};}exports['register']=function(_0x3fd684){for(var _0x15f9a2=0x0,_0x594738=events[_0x3038('0x6')];_0x15f9a2<_0x594738;_0x15f9a2++){var _0xd55ce3=events[_0x15f9a2];var _0x1f2987=createListener(_0x3038('0x7')+_0xd55ce3,_0x3fd684);ChatWebsiteEvents['on'](_0xd55ce3,_0x1f2987);}}; \ No newline at end of file +var _0x3a12=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3a12,0x125));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var ChatWebsiteEvents=require(_0x23a1('0x0'));var events=[_0x23a1('0x1'),_0x23a1('0x2'),_0x23a1('0x3')];function createListener(_0x3080bc,_0x1f99f9){return function(_0x545b7a){_0x1f99f9[_0x23a1('0x4')](_0x3080bc,_0x545b7a);};}function removeListener(_0xcdc00c,_0x2e059d){return function(){ChatWebsiteEvents[_0x23a1('0x5')](_0xcdc00c,_0x2e059d);};}exports[_0x23a1('0x6')]=function(_0x331c17){for(var _0x5bc7c9=0x0,_0x22f2fa=events[_0x23a1('0x7')];_0x5bc7c9<_0x22f2fa;_0x5bc7c9++){var _0x1b2a4a=events[_0x5bc7c9];var _0x198659=createListener(_0x23a1('0x8')+_0x1b2a4a,_0x331c17);ChatWebsiteEvents['on'](_0x1b2a4a,_0x198659);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index 512d070..6e5505d 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf290=['replace','localhost','test','([\x5cw]+)','exports','escapeRegExp','URL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf290,0xde));var _0x0f29=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0xf290[_0x3c4a7c];return _0xf13d1e;};var escapeRegExp=require('../../../utils/misc')[_0x0f29('0x0')];var URL=require('url')[_0x0f29('0x1')];function testWildcardValidity(_0x4b16e4){let _0xb8a620=!![];try{new URL(_0x4b16e4[_0x0f29('0x2')]('*',_0x0f29('0x3')));}catch(_0x28b644){_0xb8a620=![];}return _0xb8a620&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0f29('0x4')](_0x4b16e4);}function testWebsiteWithWildcard(_0x5984ba,_0x45d37d){let _0x4911fb;const _0x2d5350=escapeRegExp(_0x5984ba)[_0x0f29('0x2')]('\x5c*',_0x0f29('0x5'));try{new URL(_0x5984ba[_0x0f29('0x2')]('\x5c*',_0x0f29('0x3')));_0x4911fb=new RegExp(_0x2d5350)[_0x0f29('0x4')](_0x45d37d);}catch(_0x2be26e){_0x4911fb=![];}return _0x4911fb;}module[_0x0f29('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x5c4a=['url','localhost','test','replace','([\x5cw]+)','exports','escapeRegExp'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x498aaa,_0x5b4e79){_0x498aaa=_0x498aaa-0x0;var _0x4f226e=_0x5c4a[_0x498aaa];return _0x4f226e;};var escapeRegExp=require('../../../utils/misc')[_0xa5c4('0x0')];var URL=require(_0xa5c4('0x1'))['URL'];function testWildcardValidity(_0x1972e1){let _0x2ff2f2=!![];try{new URL(_0x1972e1['replace']('*',_0xa5c4('0x2')));}catch(_0x180239){_0x2ff2f2=![];}return _0x2ff2f2&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xa5c4('0x3')](_0x1972e1);}function testWebsiteWithWildcard(_0x3864c4,_0x747b24){let _0x49af82;const _0x2410cf=escapeRegExp(_0x3864c4)[_0xa5c4('0x4')]('\x5c*',_0xa5c4('0x5'));try{new URL(_0x3864c4[_0xa5c4('0x4')]('\x5c*',_0xa5c4('0x2')));_0x49af82=new RegExp(_0x2410cf)[_0xa5c4('0x3')](_0x747b24);}catch(_0x4cd657){_0x49af82=![];}return _0x49af82;}module[_0xa5c4('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fc3922a..6fe1ae5 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 _0x8626=['originalname','single','file','addLogo','root','addAvatar','server/files/images/avatars/','now','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','any','addInteraction','addApplications','addProactiveActions','/:id/users','put','update','delete','/:id','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getAgents','create','post','addDisposition','diskStorage','join','server/files/images/logos/','format','%s-%s'];(function(_0x11a008,_0x5474ab){var _0x42aff0=function(_0x8495a8){while(--_0x8495a8){_0x11a008['push'](_0x11a008['shift']());}};_0x42aff0(++_0x5474ab);}(_0x8626,0x1be));var _0x6862=function(_0x406c8a,_0x14e83e){_0x406c8a=_0x406c8a-0x0;var _0x2ba7e6=_0x8626[_0x406c8a];return _0x2ba7e6;};'use strict';var multer=require(_0x6862('0x0'));var util=require(_0x6862('0x1'));var path=require(_0x6862('0x2'));var timeout=require(_0x6862('0x3'));var express=require(_0x6862('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6862('0x5'));var interaction=require(_0x6862('0x6'));var config=require(_0x6862('0x7'));var controller=require(_0x6862('0x8'));router['get']('/',auth[_0x6862('0x9')](),controller[_0x6862('0xa')]);router[_0x6862('0xb')]('/describe',auth[_0x6862('0x9')](),controller[_0x6862('0xc')]);router[_0x6862('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6862('0xb')](_0x6862('0xd'),auth[_0x6862('0x9')](),controller[_0x6862('0xe')]);router[_0x6862('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6862('0xf')]);router[_0x6862('0xb')](_0x6862('0x10'),controller[_0x6862('0x11')]);router[_0x6862('0xb')](_0x6862('0x12'),controller[_0x6862('0x13')]);router[_0x6862('0xb')](_0x6862('0x14'),controller[_0x6862('0x15')]);router[_0x6862('0xb')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x6862('0xb')](_0x6862('0x16'),auth[_0x6862('0x9')](),controller['getInteractions']);router[_0x6862('0xb')]('/:id/snippet',controller[_0x6862('0x17')]);router[_0x6862('0xb')](_0x6862('0x18'),auth[_0x6862('0x9')](),controller['getApplications']);router[_0x6862('0xb')](_0x6862('0x19'),auth['isAuthenticated'](),controller[_0x6862('0x1a')]);router[_0x6862('0xb')](_0x6862('0x1b'),controller['getFields']);router[_0x6862('0xb')]('/:id/offline_messages',auth[_0x6862('0x9')](),controller['getOfflineMessages']);router[_0x6862('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0x6862('0x1c')]);router['post']('/',auth[_0x6862('0x9')](),controller[_0x6862('0x1d')]);router[_0x6862('0x1e')](_0x6862('0xd'),auth[_0x6862('0x9')](),controller[_0x6862('0x1f')]);router[_0x6862('0x1e')]('/:id/canned_answers',auth[_0x6862('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x6862('0x20')]({'destination':function(_0x31f4c2,_0x5239e0,_0xb1f6c3){_0xb1f6c3(null,path[_0x6862('0x21')](config['root'],_0x6862('0x22')));},'filename':function(_0xdc856a,_0x3252b7,_0x3ca963){_0x3ca963(null,util[_0x6862('0x23')](_0x6862('0x24'),Date['now'](),_0x3252b7[_0x6862('0x25')]));}})});router[_0x6862('0x1e')]('/:id/logo',upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c8e0f,_0x373b60,_0xf4eec9){_0xf4eec9(null,path['join'](config[_0x6862('0x29')],'server/files/images/avatars/'));},'filename':function(_0x506f8f,_0x137645,_0x33cf0a){_0x33cf0a(null,util[_0x6862('0x23')]('%s-%s',Date['now'](),_0x137645[_0x6862('0x25')]));}})});router[_0x6862('0x1e')](_0x6862('0x12'),upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x2a')]);var upload=multer({'storage':multer[_0x6862('0x20')]({'destination':function(_0x43153c,_0x23f962,_0x2ef709){_0x2ef709(null,path['join'](config['root'],_0x6862('0x2b')));},'filename':function(_0x4fabcf,_0x1ee7d1,_0x2498e8){_0x2498e8(null,util[_0x6862('0x23')](_0x6862('0x24'),Date[_0x6862('0x2c')](),_0x1ee7d1[_0x6862('0x25')]));}})});router['post']('/:id/customer_avatar',upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x203d29,_0x21b8ab,_0x53f885){_0x53f885(null,path[_0x6862('0x21')](config[_0x6862('0x29')],_0x6862('0x2b')));},'filename':function(_0x90fab7,_0x81be14,_0x22f5b1){_0x22f5b1(null,util[_0x6862('0x23')](_0x6862('0x24'),Date['now'](),_0x81be14[_0x6862('0x25')]));}})});router[_0x6862('0x1e')](_0x6862('0x2e'),upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x2f')]);router[_0x6862('0x1e')](_0x6862('0x30'),controller[_0x6862('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x6862('0x20')]({'destination':function(_0x28d3dc,_0x2b8af5,_0xcccac7){const _0x13e7b5=path[_0x6862('0x21')](config[_0x6862('0x29')],_0x6862('0x32'),_0x6862('0x33'),_0x6862('0x34'));fs_extra[_0x6862('0x35')](_0x13e7b5,function(){_0xcccac7(null,_0x13e7b5);});},'filename':function(_0x9911f0,_0x86f412,_0x55ecbc){const _0x5cfc3b=_0x86f412['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x204c95=path['extname'](_0x5cfc3b);const _0x44352f=Date[_0x6862('0x2c')]()+'-'+_0x5cfc3b[_0x6862('0x36')](_0x204c95,'')+_0x204c95;_0x55ecbc(null,_0x44352f);}})});router[_0x6862('0x1e')]('/:id/offline',offlineUploadMulter[_0x6862('0x37')](),controller['offline']);router[_0x6862('0x1e')]('/:id/interactions',auth[_0x6862('0x9')](),controller[_0x6862('0x38')]);router[_0x6862('0x1e')](_0x6862('0x18'),auth[_0x6862('0x9')](),controller[_0x6862('0x39')]);router['post'](_0x6862('0x19'),auth[_0x6862('0x9')](),controller[_0x6862('0x3a')]);router[_0x6862('0x1e')](_0x6862('0x3b'),auth[_0x6862('0x9')](),controller['addAgents']);router[_0x6862('0x3c')]('/:id',auth[_0x6862('0x9')](),controller[_0x6862('0x3d')]);router[_0x6862('0x3e')](_0x6862('0x3f'),auth['isAuthenticated'](),controller[_0x6862('0x40')]);router[_0x6862('0x3e')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x6862('0x3e')](_0x6862('0x41'),auth['isAuthenticated'](),controller[_0x6862('0x42')]);router[_0x6862('0x3e')](_0x6862('0x3b'),auth[_0x6862('0x9')](),controller[_0x6862('0x43')]);module[_0x6862('0x44')]=router; \ No newline at end of file +var _0xd239=['file','addLogo','server/files/images/avatars/','now','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','join','server/files','attachments','offline-chat','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single'];(function(_0x178c72,_0x8c3f70){var _0x45f63f=function(_0x32be15){while(--_0x32be15){_0x178c72['push'](_0x178c72['shift']());}};_0x45f63f(++_0x8c3f70);}(_0xd239,0xb8));var _0x9d23=function(_0x8c7ccf,_0xe3f870){_0x8c7ccf=_0x8c7ccf-0x0;var _0x54f922=_0xd239[_0x8c7ccf];return _0x54f922;};'use strict';var multer=require('multer');var util=require(_0x9d23('0x0'));var path=require(_0x9d23('0x1'));var timeout=require(_0x9d23('0x2'));var express=require(_0x9d23('0x3'));var router=express[_0x9d23('0x4')]();var fs_extra=require(_0x9d23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9d23('0x6'));var config=require(_0x9d23('0x7'));var controller=require(_0x9d23('0x8'));router[_0x9d23('0x9')]('/',auth[_0x9d23('0xa')](),controller[_0x9d23('0xb')]);router[_0x9d23('0x9')]('/describe',auth[_0x9d23('0xa')](),controller[_0x9d23('0xc')]);router['get']('/:id',auth[_0x9d23('0xa')](),controller[_0x9d23('0xd')]);router[_0x9d23('0x9')](_0x9d23('0xe'),auth[_0x9d23('0xa')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9d23('0xf')]);router['get'](_0x9d23('0x10'),controller[_0x9d23('0x11')]);router[_0x9d23('0x9')](_0x9d23('0x12'),controller[_0x9d23('0x13')]);router[_0x9d23('0x9')](_0x9d23('0x14'),controller[_0x9d23('0x15')]);router['get'](_0x9d23('0x16'),controller[_0x9d23('0x17')]);router[_0x9d23('0x9')]('/:id/interactions',auth[_0x9d23('0xa')](),controller[_0x9d23('0x18')]);router[_0x9d23('0x9')](_0x9d23('0x19'),controller[_0x9d23('0x1a')]);router['get'](_0x9d23('0x1b'),auth[_0x9d23('0xa')](),controller['getApplications']);router[_0x9d23('0x9')]('/:id/proactive_actions',auth[_0x9d23('0xa')](),controller['getProactiveActions']);router[_0x9d23('0x9')]('/:id/fields',controller[_0x9d23('0x1c')]);router[_0x9d23('0x9')](_0x9d23('0x1d'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x1e')]);router[_0x9d23('0x9')](_0x9d23('0x1f'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x20')]);router[_0x9d23('0x21')]('/',auth[_0x9d23('0xa')](),controller[_0x9d23('0x22')]);router[_0x9d23('0x21')](_0x9d23('0xe'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x23')]);router[_0x9d23('0x21')]('/:id/canned_answers',auth[_0x9d23('0xa')](),controller[_0x9d23('0x24')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x5a06ba,_0x4e04d4,_0x5d8dbf){_0x5d8dbf(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x27')));},'filename':function(_0x3562c0,_0x3a814a,_0x302b62){_0x302b62(null,util[_0x9d23('0x28')](_0x9d23('0x29'),Date['now'](),_0x3a814a[_0x9d23('0x2a')]));}})});router[_0x9d23('0x21')](_0x9d23('0x10'),upload[_0x9d23('0x2b')](_0x9d23('0x2c')),controller[_0x9d23('0x2d')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x43066a,_0x381191,_0x4a4f56){_0x4a4f56(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x2e')));},'filename':function(_0x33abf0,_0x1a9a62,_0x6a8d76){_0x6a8d76(null,util[_0x9d23('0x28')](_0x9d23('0x29'),Date[_0x9d23('0x2f')](),_0x1a9a62[_0x9d23('0x2a')]));}})});router[_0x9d23('0x21')](_0x9d23('0x12'),upload[_0x9d23('0x2b')](_0x9d23('0x2c')),controller[_0x9d23('0x30')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x2aabd5,_0x566781,_0x2471d9){_0x2471d9(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x2e')));},'filename':function(_0x5e8efe,_0x2df4f8,_0x437d95){_0x437d95(null,util[_0x9d23('0x28')](_0x9d23('0x29'),Date[_0x9d23('0x2f')](),_0x2df4f8['originalname']));}})});router[_0x9d23('0x21')](_0x9d23('0x14'),upload[_0x9d23('0x2b')]('file'),controller[_0x9d23('0x31')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x4192e4,_0x5d602c,_0x37298f){_0x37298f(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x2e')));},'filename':function(_0x4b2c3b,_0x316b59,_0x3238e9){_0x3238e9(null,util[_0x9d23('0x28')]('%s-%s',Date['now'](),_0x316b59['originalname']));}})});router[_0x9d23('0x21')](_0x9d23('0x16'),upload[_0x9d23('0x2b')](_0x9d23('0x2c')),controller[_0x9d23('0x32')]);router[_0x9d23('0x21')](_0x9d23('0x33'),controller[_0x9d23('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x1301ff,_0x406d73,_0x401284){const _0x26d103=path[_0x9d23('0x35')](config[_0x9d23('0x26')],_0x9d23('0x36'),_0x9d23('0x37'),_0x9d23('0x38'));fs_extra['ensureDir'](_0x26d103,function(){_0x401284(null,_0x26d103);});},'filename':function(_0x9d6bd,_0x555c00,_0x3ddb7a){const _0x26e086=_0x555c00[_0x9d23('0x2a')][_0x9d23('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x31308f=path['extname'](_0x26e086);const _0x3b40a8=Date[_0x9d23('0x2f')]()+'-'+_0x26e086[_0x9d23('0x39')](_0x31308f,'')+_0x31308f;_0x3ddb7a(null,_0x3b40a8);}})});router[_0x9d23('0x21')](_0x9d23('0x3a'),offlineUploadMulter[_0x9d23('0x3b')](),controller[_0x9d23('0x3c')]);router[_0x9d23('0x21')](_0x9d23('0x3d'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x3e')]);router[_0x9d23('0x21')]('/:id/applications',auth[_0x9d23('0xa')](),controller[_0x9d23('0x3f')]);router[_0x9d23('0x21')](_0x9d23('0x40'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x41')]);router[_0x9d23('0x21')](_0x9d23('0x1f'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x42')]);router[_0x9d23('0x43')](_0x9d23('0x44'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x45')]);router[_0x9d23('0x46')](_0x9d23('0x44'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x47')]);router['delete'](_0x9d23('0xe'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x48')]);router['delete'](_0x9d23('0x49'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x4a')]);router[_0x9d23('0x46')](_0x9d23('0x1f'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9d23('0x4b')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index a04d3ff..458eecc 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 _0xe90d=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger'];(function(_0x53c2ec,_0x56b6f8){var _0xbd4cd0=function(_0x3640d1){while(--_0x3640d1){_0x53c2ec['push'](_0x53c2ec['shift']());}};_0xbd4cd0(++_0x56b6f8);}(_0xe90d,0x10e));var _0xde90=function(_0x1063d4,_0x483c4d){_0x1063d4=_0x1063d4-0x0;var _0x408256=_0xe90d[_0x1063d4];return _0x408256;};var beaverLogger=require(_0xde90('0x0'));var express=require(_0xde90('0x1'));var auth=require(_0xde90('0x2'));var config=require(_0xde90('0x3'));var router=express[_0xde90('0x4')]();var isProduction=config[_0xde90('0x5')]===_0xde90('0x6')||![];function clientSideLogs(_0x2b7d29,_0x232229,_0x2b4d70){var _0x51e360=_0x2b7d29[_0xde90('0x7')][_0xde90('0x8')](_0xde90('0x9'));if(!_0x51e360){throw new Error(_0xde90('0xa'));}return beaverLogger[_0xde90('0xb')]({'uri':_0xde90('0xc'),'logger':_0x51e360,'enableCors':!isProduction})(_0x2b7d29,_0x232229,_0x2b4d70);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xde90('0xd')]=router; \ No newline at end of file +var _0xb35b=['Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','../components/auth/service','../config/environment'];(function(_0x4057f9,_0x17c5b5){var _0x5552b7=function(_0xeb792f){while(--_0xeb792f){_0x4057f9['push'](_0x4057f9['shift']());}};_0x5552b7(++_0x17c5b5);}(_0xb35b,0x124));var _0xbb35=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xb35b[_0x397cfb];return _0x15fed9;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xbb35('0x0'));var config=require(_0xbb35('0x1'));var router=express[_0xbb35('0x2')]();var isProduction=config[_0xbb35('0x3')]===_0xbb35('0x4')||![];function clientSideLogs(_0x3fcf5d,_0x6863ac,_0x1b79cc){var _0x213373=_0x3fcf5d[_0xbb35('0x5')][_0xbb35('0x6')](_0xbb35('0x7'));if(!_0x213373){throw new Error(_0xbb35('0x8'));}return beaverLogger[_0xbb35('0x9')]({'uri':_0xbb35('0xa'),'logger':_0x213373,'enableCors':!isProduction})(_0x3fcf5d,_0x6863ac,_0x1b79cc);}router[_0xbb35('0xb')](auth[_0xbb35('0xc')](),clientSideLogs);module[_0xbb35('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index e3048b7..a2abaa3 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 _0x3843=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x20d3a2,_0x267ce1){var _0x259ff=function(_0x6645c){while(--_0x6645c){_0x20d3a2['push'](_0x20d3a2['shift']());}};_0x259ff(++_0x267ce1);}(_0x3843,0x1a5));var _0x3384=function(_0x424e46,_0x45de83){_0x424e46=_0x424e46-0x0;var _0x17b7f1=_0x3843[_0x424e46];return _0x17b7f1;};'use strict';var Sequelize=require(_0x3384('0x0'));module[_0x3384('0x1')]={'name':{'type':Sequelize[_0x3384('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3384('0x3')](_0x3384('0x4'),_0x3384('0x5'),_0x3384('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3384('0x3')](_0x3384('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x3384('0x2')],'comment':_0x3384('0x8')},'data2':{'type':Sequelize[_0x3384('0x2')],'comment':_0x3384('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x3384('0xa')},'data4':{'type':Sequelize[_0x3384('0x2')],'comment':_0x3384('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x3384('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x3384('0xd')}}; \ No newline at end of file +var _0x3f8f=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x3f8f,0x1c5));var _0xf3f8=function(_0x1cd6f6,_0x4bfec7){_0x1cd6f6=_0x1cd6f6-0x0;var _0x1a93e5=_0x3f8f[_0x1cd6f6];return _0x1a93e5;};'use strict';var Sequelize=require(_0xf3f8('0x0'));module[_0xf3f8('0x1')]={'name':{'type':Sequelize[_0xf3f8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf3f8('0x3')](_0xf3f8('0x4'),_0xf3f8('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf3f8('0x3')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xf3f8('0x2')],'comment':_0xf3f8('0x6')},'data2':{'type':Sequelize[_0xf3f8('0x2')],'comment':_0xf3f8('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0xf3f8('0x8')},'data4':{'type':Sequelize[_0xf3f8('0x2')],'comment':_0xf3f8('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0xf3f8('0xa')},'data6':{'type':Sequelize[_0xf3f8('0xb')],'comment':_0xf3f8('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index b83beb6..1e21ea3 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 _0x0135=['isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','stringify','ioredis','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','error','stack','name','send','padEnd','map','CloudProvider','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','then','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','length','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii'];(function(_0x1556da,_0x3d9ba9){var _0x4ba1ef=function(_0x2ed733){while(--_0x2ed733){_0x1556da['push'](_0x1556da['shift']());}};_0x4ba1ef(++_0x3d9ba9);}(_0x0135,0x71));var _0x5013=function(_0x556720,_0x43fcdc){_0x556720=_0x556720-0x0;var _0x25e3aa=_0x0135[_0x556720];return _0x25e3aa;};'use strict';var _=require('lodash');var Redis=require(_0x5013('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x5013('0x1'));var config=require(_0x5013('0x2'));var logger=require('../../config/logger')('api');var db=require(_0x5013('0x3'))['db'];var oauth=require(_0x5013('0x4'));config[_0x5013('0x5')]=_[_0x5013('0x6')](config[_0x5013('0x5')],{'host':_0x5013('0x7'),'port':0x18eb});var socket=require(_0x5013('0x8'))(new Redis(config[_0x5013('0x5')]));var redis=new Redis(config[_0x5013('0x5')]);function respondWithStatusCode(_0x32e58d,_0x8c0092){_0x8c0092=_0x8c0092||0xcc;return function(_0x32923b){if(_0x32923b){return _0x32e58d[_0x5013('0x9')](_0x8c0092);}return _0x32e58d[_0x5013('0xa')](_0x8c0092)[_0x5013('0xb')]();};}function respondWithResult(_0xfcf6cf,_0x32f617){_0x32f617=_0x32f617||0xc8;return function(_0x1a6469){if(_0x1a6469){return _0xfcf6cf[_0x5013('0xa')](_0x32f617)[_0x5013('0xc')](_0x1a6469);}};}function respondWithFilteredResult(_0x1bc574,_0x5534f4){return function(_0x3d7326){if(_0x3d7326){var _0x529430=typeof _0x5534f4['offset']===_0x5013('0xd')&&typeof _0x5534f4[_0x5013('0xe')]==='undefined';var _0x41d4bb=_0x3d7326[_0x5013('0xf')];var _0x31769d=_0x529430?0x0:_0x5534f4['offset'];var _0x8dc781=_0x529430?_0x3d7326['count']:_0x5534f4[_0x5013('0x10')]+_0x5534f4['limit'];var _0x2b3af6;if(_0x8dc781>=_0x41d4bb){_0x8dc781=_0x41d4bb;_0x2b3af6=0xc8;}else{_0x2b3af6=0xce;}_0x1bc574[_0x5013('0xa')](_0x2b3af6);return _0x1bc574['set'](_0x5013('0x11'),_0x31769d+'-'+_0x8dc781+'/'+_0x41d4bb)[_0x5013('0xc')](_0x3d7326);}return null;};}function saveUpdates(_0x122a18){return function(_0x4590c0){if(_0x4590c0){return _0x4590c0[_0x5013('0x12')](_0x122a18)['then'](function(_0xfccfd4){return _0xfccfd4;});}return null;};}function removeEntity(_0x1d6f18){return function(_0x5eb037){if(_0x5eb037){return _0x5eb037['destroy']()['then'](function(){_0x1d6f18[_0x5013('0xa')](0xcc)[_0x5013('0xb')]();});}};}function handleEntityNotFound(_0x558c74){return function(_0x4c04da){if(!_0x4c04da){_0x558c74['sendStatus'](0x194);}return _0x4c04da;};}function handleError(_0x1c6425,_0x2d4e66){_0x2d4e66=_0x2d4e66||0x1f4;return function(_0x5a17ca){logger[_0x5013('0x13')](_0x5a17ca[_0x5013('0x14')]);if(_0x5a17ca[_0x5013('0x15')]){delete _0x5a17ca[_0x5013('0x15')];}_0x1c6425['status'](_0x2d4e66)[_0x5013('0x16')](_0x5a17ca);};}function maskClientSecret(_0x3d74bd){return _[_0x5013('0x17')](_0x3d74bd['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x451543,_0x339beb){var _0x5a7bc8={},_0x231a07={},_0x614f83={'count':0x0,'rows':[]};var _0x49ec8d=_[_0x5013('0x18')](db[_0x5013('0x19')][_0x5013('0x1a')],function(_0x17d86e){return{'name':_0x17d86e[_0x5013('0x1b')],'type':_0x17d86e['type'][_0x5013('0x1c')]};});_0x231a07['model']=_['map'](_0x49ec8d,_0x5013('0x15'));_0x231a07['query']=_[_0x5013('0x1d')](_0x451543[_0x5013('0x1e')]);_0x231a07[_0x5013('0x1f')]=_[_0x5013('0x20')](_0x231a07[_0x5013('0x21')],_0x231a07[_0x5013('0x1e')]);_0x5a7bc8[_0x5013('0x22')]=_[_0x5013('0x20')](_0x231a07['model'],qs[_0x5013('0x23')](_0x451543[_0x5013('0x1e')][_0x5013('0x23')]));_0x5a7bc8[_0x5013('0x22')]=_0x5a7bc8[_0x5013('0x22')]['length']?_0x5a7bc8[_0x5013('0x22')]:_0x231a07['model'];if(!_0x451543[_0x5013('0x1e')][_0x5013('0x24')](_0x5013('0x25'))){_0x5a7bc8[_0x5013('0xe')]=qs[_0x5013('0xe')](_0x451543['query'][_0x5013('0xe')]);_0x5a7bc8[_0x5013('0x10')]=qs[_0x5013('0x10')](_0x451543['query'][_0x5013('0x10')]);}_0x5a7bc8[_0x5013('0x26')]=qs['sort'](_0x451543[_0x5013('0x1e')][_0x5013('0x27')]);_0x5a7bc8[_0x5013('0x28')]=qs[_0x5013('0x1f')](_[_0x5013('0x29')](_0x451543[_0x5013('0x1e')],_0x231a07[_0x5013('0x1f')]),_0x49ec8d);if(_0x451543['query'][_0x5013('0x2a')]){_0x5a7bc8[_0x5013('0x28')]=_[_0x5013('0x2b')](_0x5a7bc8['where'],{'$or':_[_0x5013('0x18')](_0x49ec8d,function(_0x262e46){if(_0x262e46[_0x5013('0x2c')]!=='VIRTUAL'){var _0x154bcd={};_0x154bcd[_0x262e46['name']]={'$like':'%'+_0x451543[_0x5013('0x1e')][_0x5013('0x2a')]+'%'};return _0x154bcd;}})});}_0x5a7bc8=_['merge']({},_0x5a7bc8,_0x451543['options']);var _0x481c8a={'where':_0x5a7bc8['where']};return db[_0x5013('0x19')]['count'](_0x481c8a)[_0x5013('0x2d')](function(_0x2786ba){_0x614f83[_0x5013('0xf')]=_0x2786ba;if(_0x451543['query'][_0x5013('0x2e')]){_0x5a7bc8[_0x5013('0x2f')]=[{'all':!![]}];}return db[_0x5013('0x19')][_0x5013('0x30')](_0x5a7bc8);})[_0x5013('0x2d')](function(_0xbd05e6){_0x614f83[_0x5013('0x31')]=_[_0x5013('0x18')](_0xbd05e6,function(_0x5108a8){if(_0x5108a8['service']===_0x5013('0x32')){var _0x15b537=encryptor[_0x5013('0x33')](_0x5108a8[_0x5013('0x34')]);_0x5108a8[_0x5013('0x34')]=maskClientSecret(_0x15b537);}return _0x5108a8;});return _0x614f83;})[_0x5013('0x2d')](respondWithFilteredResult(_0x339beb,_0x5a7bc8))[_0x5013('0x35')](handleError(_0x339beb,null));};exports[_0x5013('0x36')]=function(_0x507329,_0x50a2b6){var _0x4e85fd={'raw':!![],'where':{'id':_0x507329[_0x5013('0x37')]['id']}},_0x56ef52={};_0x56ef52[_0x5013('0x21')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x56ef52[_0x5013('0x1e')]=_[_0x5013('0x1d')](_0x507329[_0x5013('0x1e')]);_0x56ef52['filters']=_[_0x5013('0x20')](_0x56ef52[_0x5013('0x21')],_0x56ef52[_0x5013('0x1e')]);_0x4e85fd['attributes']=_[_0x5013('0x20')](_0x56ef52[_0x5013('0x21')],qs['fields'](_0x507329[_0x5013('0x1e')][_0x5013('0x23')]));_0x4e85fd[_0x5013('0x22')]=_0x4e85fd[_0x5013('0x22')][_0x5013('0x38')]?_0x4e85fd[_0x5013('0x22')]:_0x56ef52[_0x5013('0x21')];if(_0x507329['query'][_0x5013('0x2e')]){_0x4e85fd[_0x5013('0x2f')]=[{'all':!![]}];}_0x4e85fd=_[_0x5013('0x2b')]({},_0x4e85fd,_0x507329[_0x5013('0x39')]);return db[_0x5013('0x19')][_0x5013('0x3a')](_0x4e85fd)['then'](handleEntityNotFound(_0x50a2b6,null))['then'](function(_0x4c0927){if(_0x4c0927[_0x5013('0x3b')]===_0x5013('0x32')){var _0x36a410=encryptor['decryptString'](_0x4c0927[_0x5013('0x34')]);_0x4c0927[_0x5013('0x34')]=maskClientSecret(_0x36a410);}return _0x4c0927;})[_0x5013('0x2d')](respondWithResult(_0x50a2b6,null))[_0x5013('0x35')](handleError(_0x50a2b6,null));};exports[_0x5013('0x3c')]=function(_0x4694e3,_0xb419fa){if(!_0x4694e3[_0x5013('0x3d')][_0x5013('0x15')])throw new Error(_0x5013('0x3e'));if(!_0x4694e3[_0x5013('0x3d')][_0x5013('0x3b')])throw new Error(_0x5013('0x3f'));var _0x3e47b0=db[_0x5013('0x19')]['rawAttributes'][_0x5013('0x3b')][_0x5013('0x40')];if(!_0x3e47b0[_0x5013('0x41')](_0x4694e3[_0x5013('0x3d')]['service']))throw new Error(_0x5013('0x42')+_0x3e47b0[_0x5013('0x43')](',\x20'));if(_0x4694e3[_0x5013('0x3d')]['service']===_0x5013('0x32')&&_0x4694e3[_0x5013('0x3d')][_0x5013('0x34')]){_0x4694e3[_0x5013('0x3d')][_0x5013('0x34')]=encryptor[_0x5013('0x44')](_0x4694e3[_0x5013('0x3d')][_0x5013('0x34')]);}return db[_0x5013('0x19')][_0x5013('0x3c')](_0x4694e3['body'],{})['then'](respondWithResult(_0xb419fa,0xc9))[_0x5013('0x35')](handleError(_0xb419fa,null));};exports[_0x5013('0x12')]=function(_0x470eb8,_0x38e3a7){if(_0x470eb8[_0x5013('0x3d')]['id']){delete _0x470eb8[_0x5013('0x3d')]['id'];}return db['CloudProvider'][_0x5013('0x3a')]({'where':{'id':_0x470eb8[_0x5013('0x37')]['id']}})[_0x5013('0x2d')](handleEntityNotFound(_0x38e3a7,null))['then'](function(_0x59de17){if(_0x59de17['service']==='MicrosoftAzure'&&_0x470eb8[_0x5013('0x3d')][_0x5013('0x34')]){_0x470eb8[_0x5013('0x3d')][_0x5013('0x34')]=encryptor[_0x5013('0x44')](_0x470eb8[_0x5013('0x3d')]['data3']);}return _0x59de17;})[_0x5013('0x2d')](saveUpdates(_0x470eb8[_0x5013('0x3d')],null))[_0x5013('0x2d')](respondWithResult(_0x38e3a7,null))['catch'](handleError(_0x38e3a7,null));};exports['destroy']=function(_0x3f2d53,_0x328625){return db['CloudProvider'][_0x5013('0x3a')]({'where':{'id':_0x3f2d53['params']['id']}})['then'](handleEntityNotFound(_0x328625,null))[_0x5013('0x2d')](removeEntity(_0x328625,null))[_0x5013('0x35')](handleError(_0x328625,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4da103,_0x5cdfbd){return db[_0x5013('0x19')][_0x5013('0x45')]({'where':{'id':_0x4da103[_0x5013('0x37')]['id']},'raw':!![]})[_0x5013('0x2d')](function(_0x56786d){if(!_0x56786d)return _0x5cdfbd[_0x5013('0x9')](0x194);return{'url':oauth[_0x5013('0x46')](_0x56786d,_0x4da103[_0x5013('0x47')]['id'])};})[_0x5013('0x2d')](respondWithResult(_0x5cdfbd,null))[_0x5013('0x35')](handleError(_0x5cdfbd,null));};exports[_0x5013('0x48')]=function(_0x3b8fa1,_0x2e096a){var _0x417ba7=_0x3b8fa1[_0x5013('0x3d')];var _0x4750a2;var _0x3a5ec4;if(_0x417ba7['error'])throw _0x417ba7;redis[_0x5013('0x49')](_0x417ba7['state'])[_0x5013('0x2d')](function(_0x29d87a){if(!_0x29d87a)throw new Error(_0x5013('0x4a'));_0x4750a2=JSON[_0x5013('0x4b')](_0x29d87a);var _0x4be7e8=Buffer[_0x5013('0x4c')](_0x417ba7[_0x5013('0x4d')],_0x5013('0x4e'))[_0x5013('0x4f')](_0x5013('0x50'));_0x3a5ec4=JSON['parse'](_0x4be7e8);if(!oauth[_0x5013('0x51')](_0x417ba7[_0x5013('0x52')],_0x4750a2[_0x5013('0x53')]))throw new Error(_0x5013('0x54'));redis[_0x5013('0x55')](_0x417ba7[_0x5013('0x4d')]);return oauth[_0x5013('0x56')](_0x417ba7[_0x5013('0x57')],_0x4750a2);})[_0x5013('0x2d')](function(_0x1c22dc){_0x4750a2['data5']=_0x1c22dc[_0x5013('0x58')];_0x4750a2[_0x5013('0x59')]=_0x1c22dc[_0x5013('0x5a')];return db[_0x5013('0x19')]['update']({'data5':_0x4750a2[_0x5013('0x5b')],'data6':_0x4750a2[_0x5013('0x59')]},{'where':{'id':_0x4750a2['id']}});})[_0x5013('0x2d')](function(){oauth[_0x5013('0x5c')](_0x4750a2);socket[_0x5013('0x5d')](_0x5013('0x5e'),{'id':_0x3a5ec4['id']});return;})[_0x5013('0x2d')](respondWithStatusCode(_0x2e096a,null))[_0x5013('0x35')](function(_0x3af067){if(_0x3a5ec4){socket[_0x5013('0x5d')](_0x5013('0x5f'),{'id':_0x3a5ec4['id']});}if(!_0x4750a2){logger[_0x5013('0x13')]('Invalid\x20authentication\x20state\x20parameter',_0x3af067);return _0x2e096a[_0x5013('0xa')](0x1f4)[_0x5013('0x16')](_0x3af067['message']);}logger[_0x5013('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4750a2['id'],JSON[_0x5013('0x60')](_0x3af067));});}; \ No newline at end of file +var _0x7539=['message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','Content-Range','update','destroy','then','sendStatus','name','send','padEnd','slice','map','CloudProvider','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','rawAttributes','decryptString','body','Name\x20parameter\x20not\x20specified','values','includes','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x7539,0xc3));var _0x9753=function(_0x517d9e,_0x214a0a){_0x517d9e=_0x517d9e-0x0;var _0x2da8ac=_0x7539[_0x517d9e];return _0x2da8ac;};'use strict';var _=require(_0x9753('0x0'));var Redis=require(_0x9753('0x1'));var qs=require(_0x9753('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x9753('0x3'));var logger=require(_0x9753('0x4'))(_0x9753('0x5'));var db=require(_0x9753('0x6'))['db'];var oauth=require(_0x9753('0x7'));config[_0x9753('0x8')]=_[_0x9753('0x9')](config['redis'],{'host':_0x9753('0xa'),'port':0x18eb});var socket=require(_0x9753('0xb'))(new Redis(config[_0x9753('0x8')]));var redis=new Redis(config[_0x9753('0x8')]);function respondWithStatusCode(_0x3b7676,_0x5249fa){_0x5249fa=_0x5249fa||0xcc;return function(_0x18f283){if(_0x18f283){return _0x3b7676['sendStatus'](_0x5249fa);}return _0x3b7676[_0x9753('0xc')](_0x5249fa)[_0x9753('0xd')]();};}function respondWithResult(_0x59747e,_0x67a90f){_0x67a90f=_0x67a90f||0xc8;return function(_0x23b0ff){if(_0x23b0ff){return _0x59747e[_0x9753('0xc')](_0x67a90f)[_0x9753('0xe')](_0x23b0ff);}};}function respondWithFilteredResult(_0x3fecfd,_0x10ef3b){return function(_0xda86fb){if(_0xda86fb){var _0x357189=typeof _0x10ef3b[_0x9753('0xf')]===_0x9753('0x10')&&typeof _0x10ef3b['limit']==='undefined';var _0x47f812=_0xda86fb['count'];var _0x534b7d=_0x357189?0x0:_0x10ef3b[_0x9753('0xf')];var _0x17024f=_0x357189?_0xda86fb['count']:_0x10ef3b[_0x9753('0xf')]+_0x10ef3b['limit'];var _0x51cef7;if(_0x17024f>=_0x47f812){_0x17024f=_0x47f812;_0x51cef7=0xc8;}else{_0x51cef7=0xce;}_0x3fecfd['status'](_0x51cef7);return _0x3fecfd['set'](_0x9753('0x11'),_0x534b7d+'-'+_0x17024f+'/'+_0x47f812)[_0x9753('0xe')](_0xda86fb);}return null;};}function saveUpdates(_0x321af6){return function(_0x42c87d){if(_0x42c87d){return _0x42c87d[_0x9753('0x12')](_0x321af6)['then'](function(_0x5a7031){return _0x5a7031;});}return null;};}function removeEntity(_0x33ab60){return function(_0x25acfd){if(_0x25acfd){return _0x25acfd[_0x9753('0x13')]()[_0x9753('0x14')](function(){_0x33ab60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1218a7){return function(_0x4e06a3){if(!_0x4e06a3){_0x1218a7[_0x9753('0x15')](0x194);}return _0x4e06a3;};}function handleError(_0x573f4c,_0x14b8af){_0x14b8af=_0x14b8af||0x1f4;return function(_0xba7762){logger['error'](_0xba7762['stack']);if(_0xba7762[_0x9753('0x16')]){delete _0xba7762['name'];}_0x573f4c[_0x9753('0xc')](_0x14b8af)[_0x9753('0x17')](_0xba7762);};}function maskClientSecret(_0x1348bf){return _[_0x9753('0x18')](_0x1348bf[_0x9753('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x50d7df,_0x2123dc){var _0x82166a={},_0x3a1278={},_0x5922b4={'count':0x0,'rows':[]};var _0x177e8f=_[_0x9753('0x1a')](db[_0x9753('0x1b')]['rawAttributes'],function(_0x3766f2){return{'name':_0x3766f2[_0x9753('0x1c')],'type':_0x3766f2[_0x9753('0x1d')]['key']};});_0x3a1278[_0x9753('0x1e')]=_[_0x9753('0x1a')](_0x177e8f,_0x9753('0x16'));_0x3a1278[_0x9753('0x1f')]=_[_0x9753('0x20')](_0x50d7df[_0x9753('0x1f')]);_0x3a1278[_0x9753('0x21')]=_[_0x9753('0x22')](_0x3a1278[_0x9753('0x1e')],_0x3a1278[_0x9753('0x1f')]);_0x82166a[_0x9753('0x23')]=_['intersection'](_0x3a1278[_0x9753('0x1e')],qs['fields'](_0x50d7df[_0x9753('0x1f')][_0x9753('0x24')]));_0x82166a[_0x9753('0x23')]=_0x82166a[_0x9753('0x23')][_0x9753('0x25')]?_0x82166a[_0x9753('0x23')]:_0x3a1278[_0x9753('0x1e')];if(!_0x50d7df[_0x9753('0x1f')][_0x9753('0x26')](_0x9753('0x27'))){_0x82166a[_0x9753('0x28')]=qs[_0x9753('0x28')](_0x50d7df[_0x9753('0x1f')][_0x9753('0x28')]);_0x82166a[_0x9753('0xf')]=qs[_0x9753('0xf')](_0x50d7df['query'][_0x9753('0xf')]);}_0x82166a[_0x9753('0x29')]=qs['sort'](_0x50d7df[_0x9753('0x1f')][_0x9753('0x2a')]);_0x82166a['where']=qs[_0x9753('0x21')](_[_0x9753('0x2b')](_0x50d7df[_0x9753('0x1f')],_0x3a1278[_0x9753('0x21')]),_0x177e8f);if(_0x50d7df[_0x9753('0x1f')][_0x9753('0x2c')]){_0x82166a[_0x9753('0x2d')]=_[_0x9753('0x2e')](_0x82166a[_0x9753('0x2d')],{'$or':_[_0x9753('0x1a')](_0x177e8f,function(_0x5d1eee){if(_0x5d1eee[_0x9753('0x1d')]!==_0x9753('0x2f')){var _0x83167={};_0x83167[_0x5d1eee[_0x9753('0x16')]]={'$like':'%'+_0x50d7df[_0x9753('0x1f')]['filter']+'%'};return _0x83167;}})});}_0x82166a=_[_0x9753('0x2e')]({},_0x82166a,_0x50d7df[_0x9753('0x30')]);var _0x48c01a={'where':_0x82166a[_0x9753('0x2d')]};return db[_0x9753('0x1b')][_0x9753('0x31')](_0x48c01a)[_0x9753('0x14')](function(_0x4b85b0){_0x5922b4[_0x9753('0x31')]=_0x4b85b0;if(_0x50d7df[_0x9753('0x1f')][_0x9753('0x32')]){_0x82166a[_0x9753('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0x9753('0x34')](_0x82166a);})[_0x9753('0x14')](function(_0x4b1d07){_0x5922b4[_0x9753('0x35')]=_['map'](_0x4b1d07,function(_0x5cf2bb){if(_0x5cf2bb[_0x9753('0x36')]===_0x9753('0x37')){var _0x19a5c0=encryptor['decryptString'](_0x5cf2bb[_0x9753('0x38')]);_0x5cf2bb[_0x9753('0x38')]=maskClientSecret(_0x19a5c0);}return _0x5cf2bb;});return _0x5922b4;})[_0x9753('0x14')](respondWithFilteredResult(_0x2123dc,_0x82166a))[_0x9753('0x39')](handleError(_0x2123dc,null));};exports[_0x9753('0x3a')]=function(_0xf0e0d5,_0xf58611){var _0x3e23f5={'raw':!![],'where':{'id':_0xf0e0d5[_0x9753('0x3b')]['id']}},_0x109994={};_0x109994[_0x9753('0x1e')]=_['keys'](db[_0x9753('0x1b')][_0x9753('0x3c')]);_0x109994[_0x9753('0x1f')]=_['keys'](_0xf0e0d5[_0x9753('0x1f')]);_0x109994['filters']=_[_0x9753('0x22')](_0x109994[_0x9753('0x1e')],_0x109994[_0x9753('0x1f')]);_0x3e23f5[_0x9753('0x23')]=_['intersection'](_0x109994['model'],qs['fields'](_0xf0e0d5[_0x9753('0x1f')][_0x9753('0x24')]));_0x3e23f5[_0x9753('0x23')]=_0x3e23f5['attributes'][_0x9753('0x25')]?_0x3e23f5[_0x9753('0x23')]:_0x109994[_0x9753('0x1e')];if(_0xf0e0d5[_0x9753('0x1f')][_0x9753('0x32')]){_0x3e23f5[_0x9753('0x33')]=[{'all':!![]}];}_0x3e23f5=_['merge']({},_0x3e23f5,_0xf0e0d5[_0x9753('0x30')]);return db[_0x9753('0x1b')]['find'](_0x3e23f5)[_0x9753('0x14')](handleEntityNotFound(_0xf58611,null))['then'](function(_0x43bcf7){if(_0x43bcf7[_0x9753('0x36')]==='MicrosoftAzure'){var _0x2090c9=encryptor[_0x9753('0x3d')](_0x43bcf7[_0x9753('0x38')]);_0x43bcf7[_0x9753('0x38')]=maskClientSecret(_0x2090c9);}return _0x43bcf7;})['then'](respondWithResult(_0xf58611,null))[_0x9753('0x39')](handleError(_0xf58611,null));};exports['create']=function(_0x43e402,_0x49d842){if(!_0x43e402[_0x9753('0x3e')][_0x9753('0x16')])throw new Error(_0x9753('0x3f'));if(!_0x43e402[_0x9753('0x3e')][_0x9753('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xe4f5c3=db[_0x9753('0x1b')]['rawAttributes']['service'][_0x9753('0x40')];if(!_0xe4f5c3[_0x9753('0x41')](_0x43e402[_0x9753('0x3e')][_0x9753('0x36')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0xe4f5c3['join'](',\x20'));if(_0x43e402[_0x9753('0x3e')][_0x9753('0x36')]===_0x9753('0x37')&&_0x43e402[_0x9753('0x3e')][_0x9753('0x38')]){_0x43e402['body']['data3']=encryptor[_0x9753('0x42')](_0x43e402[_0x9753('0x3e')][_0x9753('0x38')]);}return db['CloudProvider']['create'](_0x43e402[_0x9753('0x3e')],{})[_0x9753('0x14')](respondWithResult(_0x49d842,0xc9))[_0x9753('0x39')](handleError(_0x49d842,null));};exports[_0x9753('0x12')]=function(_0x5f343a,_0x3160c7){if(_0x5f343a[_0x9753('0x3e')]['id']){delete _0x5f343a[_0x9753('0x3e')]['id'];}return db[_0x9753('0x1b')]['find']({'where':{'id':_0x5f343a['params']['id']}})[_0x9753('0x14')](handleEntityNotFound(_0x3160c7,null))['then'](function(_0x2907c5){if(_0x2907c5[_0x9753('0x36')]==='MicrosoftAzure'&&_0x5f343a['body'][_0x9753('0x38')]){_0x5f343a[_0x9753('0x3e')][_0x9753('0x38')]=encryptor[_0x9753('0x42')](_0x5f343a['body']['data3']);}return _0x2907c5;})[_0x9753('0x14')](saveUpdates(_0x5f343a[_0x9753('0x3e')],null))[_0x9753('0x14')](respondWithResult(_0x3160c7,null))['catch'](handleError(_0x3160c7,null));};exports['destroy']=function(_0x3732ef,_0x451ed9){return db[_0x9753('0x1b')][_0x9753('0x43')]({'where':{'id':_0x3732ef['params']['id']}})[_0x9753('0x14')](handleEntityNotFound(_0x451ed9,null))['then'](removeEntity(_0x451ed9,null))[_0x9753('0x39')](handleError(_0x451ed9,null));};exports['oauth2MicrosoftAuthorize']=function(_0x53d128,_0x16b4a6){return db['CloudProvider'][_0x9753('0x44')]({'where':{'id':_0x53d128[_0x9753('0x3b')]['id']},'raw':!![]})[_0x9753('0x14')](function(_0xe4113f){if(!_0xe4113f)return _0x16b4a6[_0x9753('0x15')](0x194);return{'url':oauth[_0x9753('0x45')](_0xe4113f,_0x53d128['user']['id'])};})[_0x9753('0x14')](respondWithResult(_0x16b4a6,null))[_0x9753('0x39')](handleError(_0x16b4a6,null));};exports[_0x9753('0x46')]=function(_0x457db7,_0x4ee671){var _0x2adc53=_0x457db7['body'];var _0x3761cb;var _0x42fc69;if(_0x2adc53[_0x9753('0x47')])throw _0x2adc53;redis[_0x9753('0x48')](_0x2adc53['state'])['then'](function(_0x37d298){if(!_0x37d298)throw new Error(_0x9753('0x49'));_0x3761cb=JSON[_0x9753('0x4a')](_0x37d298);var _0x3cc3d0=Buffer[_0x9753('0x4b')](_0x2adc53[_0x9753('0x4c')],_0x9753('0x4d'))[_0x9753('0x4e')](_0x9753('0x4f'));_0x42fc69=JSON[_0x9753('0x4a')](_0x3cc3d0);if(!oauth[_0x9753('0x50')](_0x2adc53['id_token'],_0x3761cb[_0x9753('0x51')]))throw new Error(_0x9753('0x52'));redis[_0x9753('0x53')](_0x2adc53['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x2adc53[_0x9753('0x54')],_0x3761cb);})[_0x9753('0x14')](function(_0x1849e2){_0x3761cb[_0x9753('0x55')]=_0x1849e2[_0x9753('0x56')];_0x3761cb[_0x9753('0x57')]=_0x1849e2[_0x9753('0x58')];return db[_0x9753('0x1b')][_0x9753('0x12')]({'data5':_0x3761cb[_0x9753('0x55')],'data6':_0x3761cb[_0x9753('0x57')]},{'where':{'id':_0x3761cb['id']}});})[_0x9753('0x14')](function(){oauth[_0x9753('0x59')](_0x3761cb);socket[_0x9753('0x5a')]('microsoftAuthorization:success',{'id':_0x42fc69['id']});return;})[_0x9753('0x14')](respondWithStatusCode(_0x4ee671,null))[_0x9753('0x39')](function(_0x44b93b){if(_0x42fc69){socket['emit'](_0x9753('0x5b'),{'id':_0x42fc69['id']});}if(!_0x3761cb){logger[_0x9753('0x47')](_0x9753('0x5c'),_0x44b93b);return _0x4ee671[_0x9753('0xc')](0x1f4)['send'](_0x44b93b[_0x9753('0x5d')]);}logger['error'](_0x9753('0x5e'),_0x3761cb['id'],JSON[_0x9753('0x5f')](_0x44b93b));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 2942b4e..e16193f 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 _0xe4a1=['exports','define','cloud_providers','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe4a1,0x93));var _0x1e4a=function(_0x436b5a,_0x37433f){_0x436b5a=_0x436b5a-0x0;var _0x4e9145=_0xe4a1[_0x436b5a];return _0x4e9145;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e4a('0x0'))(_0x1e4a('0x1'));var moment=require(_0x1e4a('0x2'));var BPromise=require(_0x1e4a('0x3'));var rp=require(_0x1e4a('0x4'));var fs=require('fs');var path=require(_0x1e4a('0x5'));var rimraf=require(_0x1e4a('0x6'));var config=require(_0x1e4a('0x7'));var attributes=require(_0x1e4a('0x8'));module[_0x1e4a('0x9')]=function(_0x2ef4c3,_0x3d2611){return _0x2ef4c3[_0x1e4a('0xa')]('CloudProvider',attributes,{'tableName':_0x1e4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5732=['exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x29e7b8,_0x3b733f){var _0x2c6699=function(_0x1f1267){while(--_0x1f1267){_0x29e7b8['push'](_0x29e7b8['shift']());}};_0x2c6699(++_0x3b733f);}(_0x5732,0x1b0));var _0x2573=function(_0x5c4939,_0x39bc44){_0x5c4939=_0x5c4939-0x0;var _0x389665=_0x5732[_0x5c4939];return _0x389665;};'use strict';var _=require(_0x2573('0x0'));var util=require(_0x2573('0x1'));var logger=require(_0x2573('0x2'))(_0x2573('0x3'));var moment=require('moment');var BPromise=require(_0x2573('0x4'));var rp=require(_0x2573('0x5'));var fs=require('fs');var path=require(_0x2573('0x6'));var rimraf=require(_0x2573('0x7'));var config=require(_0x2573('0x8'));var attributes=require(_0x2573('0x9'));module[_0x2573('0xa')]=function(_0x538918,_0x53d1e7){return _0x538918['define'](_0x2573('0xb'),attributes,{'tableName':_0x2573('0xc'),'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 82a6a68..1ba6a95 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 _0xbaae=['code','from','base64','randomBytes','toString','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','nonce','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','decryptString','POST','data2','data5','access_token','data6','refresh_token','catch','bind','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}'];(function(_0x1b9306,_0x585dbe){var _0x3e0a1b=function(_0x3e7ae2){while(--_0x3e7ae2){_0x1b9306['push'](_0x1b9306['shift']());}};_0x3e0a1b(++_0x585dbe);}(_0xbaae,0x1a3));var _0xebaa=function(_0x1b4f29,_0x157eac){_0x1b4f29=_0x1b4f29-0x0;var _0x544af=_0xbaae[_0x1b4f29];return _0x544af;};'use strict';var _=require(_0xebaa('0x0'));var crypto=require(_0xebaa('0x1'));var jwt=require(_0xebaa('0x2'));var moment=require('moment');var Redis=require(_0xebaa('0x3'));var rp=require(_0xebaa('0x4'));var util=require(_0xebaa('0x5'));var encryptor=require(_0xebaa('0x6'));var config=require('../../config/environment');var logger=require(_0xebaa('0x7'))(_0xebaa('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xebaa('0x9'))['db'];config['redis']=_[_0xebaa('0xa')](config[_0xebaa('0xb')],{'host':_0xebaa('0xc'),'port':0x18eb});var redis=new Redis(config[_0xebaa('0xb')]);var MICROSOFT_AUTH_URL=_0xebaa('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xebaa('0xe'),_0xebaa('0xf'),_0xebaa('0x10'),_0xebaa('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xebaa('0x12'),_0xebaa('0x13')],'Dynamics365':[_0xebaa('0xe'),_0xebaa('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xebaa('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x558426){var _0x413630=_[_0xebaa('0x15')](AZURE_AUTH_SCOPES[_0x558426[_0xebaa('0x16')]]);if(_0x558426[_0xebaa('0x16')]===_0xebaa('0x17'))_0x413630[_0xebaa('0x18')](_0x558426['data7']+_0xebaa('0x19'));return _0x413630[_0xebaa('0x1a')]('\x20');}function getAccessTokenScope(_0x5f3bd8){if(_0x5f3bd8[_0xebaa('0x16')]===_0xebaa('0x1b'))return _0xebaa('0x1c');if(_0x5f3bd8[_0xebaa('0x16')]===_0xebaa('0x17'))return _0x5f3bd8['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x9b00a2,_0x31290b){var _0x5dab6e=MICROSOFT_AUTH_URL[_0xebaa('0x1d')](_0xebaa('0x1e'),_0x9b00a2['data2']);var _0x3eb0d3=[_0xebaa('0x1f'),'id_token'];var _0x2040d0=Buffer[_0xebaa('0x20')](JSON['stringify']({'id':_0x31290b}))['toString'](_0xebaa('0x21'));var _0x27c62e=crypto[_0xebaa('0x22')](0x10)[_0xebaa('0x23')](_0xebaa('0x24'));var _0x41203a=getAuthorizationScopes(_0x9b00a2);var _0x209e96=[{'key':'client_id','value':_0x9b00a2[_0xebaa('0x25')]},{'key':_0xebaa('0x26'),'value':encodeURIComponent(_0x3eb0d3['join']('\x20'))},{'key':_0xebaa('0x27'),'value':_0x9b00a2[_0xebaa('0x28')]},{'key':_0xebaa('0x29'),'value':_0xebaa('0x2a')},{'key':'scope','value':encodeURIComponent(_0x41203a)},{'key':'state','value':_0x2040d0},{'key':_0xebaa('0x2b'),'value':_0x27c62e},{'key':'prompt','value':_0xebaa('0x2c')}];var _0x3c6dc4=_0x5dab6e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xebaa('0x15')](_0x209e96,function(_0x22da3f){return _0x22da3f[_0xebaa('0x2d')]+'='+_0x22da3f[_0xebaa('0x2e')];})['join']('&');_0x9b00a2[_0xebaa('0x2f')]={'issuer':_0x5dab6e[_0xebaa('0x1d')](_0xebaa('0x30'),''),'audience':_0x9b00a2['data1'],'state':_0x2040d0,'nonce':_0x27c62e};redis[_0xebaa('0x31')](_0x2040d0,JSON['stringify'](_0x9b00a2));return _0x3c6dc4;}function isValidIdToken(_0x381da2,_0x110834){try{var _0x447188=jwt['decode'](_0x381da2,{'complete':!![]});var _0x3ca0ee=_0x447188[_0xebaa('0x32')];if(_0x3ca0ee[_0xebaa('0x33')]!==_0x110834[_0xebaa('0x34')])return![];if(_0x3ca0ee['aud']!==_0x110834[_0xebaa('0x35')])return![];if(_0x3ca0ee['nonce']!==_0x110834[_0xebaa('0x2b')])return![];if(moment()[_0xebaa('0x36')](moment[_0xebaa('0x37')](_0x3ca0ee[_0xebaa('0x38')])))return![];return!![];}catch(_0x2258b4){throw _0x2258b4;}}function refreshOauth2MicrosoftAccessToken(_0x11b40e){return Promise[_0xebaa('0x39')]()[_0xebaa('0x3a')](function(){if(_0x11b40e[_0xebaa('0x3b')])return _0x11b40e;return db[_0xebaa('0x3c')]['findOne']({'where':{'id':_0x11b40e['id']},'raw':!![]});})[_0xebaa('0x3a')](function(_0x38f76f){var _0x157f03={'grant_type':'refresh_token','refresh_token':_0x38f76f['data6'],'scope':getAccessTokenScope(_0x38f76f),'redirect_uri':_0x38f76f[_0xebaa('0x28')],'client_id':_0x38f76f[_0xebaa('0x25')],'client_secret':encryptor[_0xebaa('0x3d')](_0x38f76f[_0xebaa('0x3b')])};var _0x43c5d1={'method':_0xebaa('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xebaa('0x1d')](_0xebaa('0x1e'),_0x38f76f[_0xebaa('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x157f03,'json':!![]};return rp(_0x43c5d1);})[_0xebaa('0x3a')](function(_0xe36e5a){_0x11b40e[_0xebaa('0x40')]=_0xe36e5a[_0xebaa('0x41')];_0x11b40e[_0xebaa('0x42')]=_0xe36e5a[_0xebaa('0x43')];return db[_0xebaa('0x3c')]['update']({'data5':_0x11b40e[_0xebaa('0x40')],'data6':_0x11b40e[_0xebaa('0x42')]},{'where':{'id':_0x11b40e['id']}});})[_0xebaa('0x3a')](function(){return _0x11b40e;})[_0xebaa('0x44')](function(_0x44f86c){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x11b40e['id'],_0x44f86c);});}function getOauth2MicrosoftAccessToken(_0x568c54,_0x2d58e2){var _0x3f0d07={'grant_type':'authorization_code','code':_0x568c54,'scope':getAccessTokenScope(_0x2d58e2),'redirect_uri':_0x2d58e2[_0xebaa('0x28')],'client_id':_0x2d58e2[_0xebaa('0x25')],'client_secret':encryptor['decryptString'](_0x2d58e2['data3'])};var _0x3b717b={'method':_0xebaa('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xebaa('0x1d')]('{TENANT_ID}',_0x2d58e2[_0xebaa('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f0d07,'json':!![]};return rp(_0x3b717b);}function startRefreshInterval(_0x85e9aa){var _0x5751d2=schedule['intervals'];if(_0x5751d2[_0x85e9aa['id']])clearInterval(_0x5751d2[_0x85e9aa['id']]);_0x5751d2[_0x85e9aa['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xebaa('0x45')](this,{'id':_0x85e9aa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5751d2;}function startAllRefreshIntervals(){return db[_0xebaa('0x3c')][_0xebaa('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x51e13f){var _0x5f3052=_0x51e13f[_0xebaa('0x15')](function(_0xc68884){return refreshOauth2MicrosoftAccessToken(_0xc68884)[_0xebaa('0x3a')](function(_0x5aa804){startRefreshInterval(_0x5aa804);});});return Promise['all'](_0x5f3052);})[_0xebaa('0x44')](function(_0x5220c3){var _0xe732b0=_0x5220c3?util[_0xebaa('0x47')](_0x5220c3,{'showHidden':![],'depth':null}):'';logger[_0xebaa('0x48')](_0xebaa('0x49'),_0xe732b0);});}module[_0xebaa('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x5a44=['base64','randomBytes','hex','data1','redirect_uri','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','code','from','stringify','toString'];(function(_0xe54e68,_0x2163a5){var _0x515cd3=function(_0xa0b062){while(--_0xa0b062){_0xe54e68['push'](_0xe54e68['shift']());}};_0x515cd3(++_0x2163a5);}(_0x5a44,0x1f4));var _0x45a4=function(_0x45bc03,_0x3e130c){_0x45bc03=_0x45bc03-0x0;var _0x4a403b=_0x5a44[_0x45bc03];return _0x4a403b;};'use strict';var _=require('lodash');var crypto=require(_0x45a4('0x0'));var jwt=require(_0x45a4('0x1'));var moment=require(_0x45a4('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x45a4('0x3'));var logger=require(_0x45a4('0x4'))(_0x45a4('0x5'));var schedule=require(_0x45a4('0x6'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x45a4('0x7')](config[_0x45a4('0x8')],{'host':_0x45a4('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x45a4('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x45a4('0xb'),_0x45a4('0xc'),_0x45a4('0xd'),_0x45a4('0xe'),_0x45a4('0xf'),_0x45a4('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x45a4('0xb'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x45a4('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4a7f56){var _0x3b8f3e=_[_0x45a4('0x12')](AZURE_AUTH_SCOPES[_0x4a7f56[_0x45a4('0x13')]]);if(_0x4a7f56[_0x45a4('0x13')]===_0x45a4('0x14'))_0x3b8f3e[_0x45a4('0x15')](_0x4a7f56[_0x45a4('0x16')]+_0x45a4('0x17'));return _0x3b8f3e[_0x45a4('0x18')]('\x20');}function getAccessTokenScope(_0x12e834){if(_0x12e834[_0x45a4('0x13')]===_0x45a4('0x19'))return _0x45a4('0xf');if(_0x12e834['type']===_0x45a4('0x14'))return _0x12e834['data7']+_0x45a4('0x17');}function generateMicrosoftAuthorizationUrl(_0x373426,_0x215ac1){var _0xa4e610=MICROSOFT_AUTH_URL[_0x45a4('0x1a')]('{TENANT_ID}',_0x373426[_0x45a4('0x1b')]);var _0x49adef=[_0x45a4('0x1c'),'id_token'];var _0x31086d=Buffer[_0x45a4('0x1d')](JSON[_0x45a4('0x1e')]({'id':_0x215ac1}))[_0x45a4('0x1f')](_0x45a4('0x20'));var _0x4e042c=crypto[_0x45a4('0x21')](0x10)[_0x45a4('0x1f')](_0x45a4('0x22'));var _0x5aeb24=getAuthorizationScopes(_0x373426);var _0x4d4c66=[{'key':'client_id','value':_0x373426[_0x45a4('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x49adef['join']('\x20'))},{'key':_0x45a4('0x24'),'value':_0x373426['data4']},{'key':'response_mode','value':_0x45a4('0x25')},{'key':_0x45a4('0x26'),'value':encodeURIComponent(_0x5aeb24)},{'key':_0x45a4('0x27'),'value':_0x31086d},{'key':_0x45a4('0x28'),'value':_0x4e042c},{'key':_0x45a4('0x29'),'value':_0x45a4('0x2a')}];var _0x279e98=_0xa4e610+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x45a4('0x12')](_0x4d4c66,function(_0x2ba248){return _0x2ba248[_0x45a4('0x2b')]+'='+_0x2ba248[_0x45a4('0x2c')];})[_0x45a4('0x18')]('&');_0x373426[_0x45a4('0x2d')]={'issuer':_0xa4e610['replace'](_0x45a4('0x2e'),''),'audience':_0x373426[_0x45a4('0x23')],'state':_0x31086d,'nonce':_0x4e042c};redis['set'](_0x31086d,JSON[_0x45a4('0x1e')](_0x373426));return _0x279e98;}function isValidIdToken(_0x565c33,_0x29b5e2){try{var _0xe9fcdb=jwt[_0x45a4('0x2f')](_0x565c33,{'complete':!![]});var _0x4fbf33=_0xe9fcdb[_0x45a4('0x30')];if(_0x4fbf33[_0x45a4('0x31')]!==_0x29b5e2['issuer'])return![];if(_0x4fbf33['aud']!==_0x29b5e2[_0x45a4('0x32')])return![];if(_0x4fbf33[_0x45a4('0x28')]!==_0x29b5e2[_0x45a4('0x28')])return![];if(moment()[_0x45a4('0x33')](moment[_0x45a4('0x34')](_0x4fbf33[_0x45a4('0x35')])))return![];return!![];}catch(_0xc2a8f6){throw _0xc2a8f6;}}function refreshOauth2MicrosoftAccessToken(_0x1f5609){return Promise[_0x45a4('0x36')]()[_0x45a4('0x37')](function(){if(_0x1f5609[_0x45a4('0x38')])return _0x1f5609;return db[_0x45a4('0x39')][_0x45a4('0x3a')]({'where':{'id':_0x1f5609['id']},'raw':!![]});})['then'](function(_0x39d0bb){var _0x54f75c={'grant_type':_0x45a4('0x3b'),'refresh_token':_0x39d0bb[_0x45a4('0x3c')],'scope':getAccessTokenScope(_0x39d0bb),'redirect_uri':_0x39d0bb[_0x45a4('0x3d')],'client_id':_0x39d0bb[_0x45a4('0x23')],'client_secret':encryptor[_0x45a4('0x3e')](_0x39d0bb[_0x45a4('0x38')])};var _0x48ff32={'method':_0x45a4('0x3f'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x39d0bb[_0x45a4('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x54f75c,'json':!![]};return rp(_0x48ff32);})[_0x45a4('0x37')](function(_0x1db2b3){_0x1f5609[_0x45a4('0x40')]=_0x1db2b3[_0x45a4('0x41')];_0x1f5609[_0x45a4('0x3c')]=_0x1db2b3[_0x45a4('0x3b')];return db[_0x45a4('0x39')][_0x45a4('0x42')]({'data5':_0x1f5609[_0x45a4('0x40')],'data6':_0x1f5609[_0x45a4('0x3c')]},{'where':{'id':_0x1f5609['id']}});})['then'](function(){return _0x1f5609;})[_0x45a4('0x43')](function(_0x593ea9){logger['error'](_0x45a4('0x44'),_0x1f5609['id'],_0x593ea9);});}function getOauth2MicrosoftAccessToken(_0x52cb61,_0x4fc032){var _0x3f8288={'grant_type':_0x45a4('0x45'),'code':_0x52cb61,'scope':getAccessTokenScope(_0x4fc032),'redirect_uri':_0x4fc032[_0x45a4('0x3d')],'client_id':_0x4fc032[_0x45a4('0x23')],'client_secret':encryptor['decryptString'](_0x4fc032[_0x45a4('0x38')])};var _0x57bd5e={'method':_0x45a4('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x45a4('0x1a')](_0x45a4('0x46'),_0x4fc032['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f8288,'json':!![]};return rp(_0x57bd5e);}function startRefreshInterval(_0x11d7c3){var _0xe97f2e=schedule['intervals'];if(_0xe97f2e[_0x11d7c3['id']])clearInterval(_0xe97f2e[_0x11d7c3['id']]);_0xe97f2e[_0x11d7c3['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x11d7c3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xe97f2e;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x45a4('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x45a4('0x37')](function(_0x3b3a22){var _0xa64181=_0x3b3a22[_0x45a4('0x12')](function(_0x3c7e95){return refreshOauth2MicrosoftAccessToken(_0x3c7e95)[_0x45a4('0x37')](function(_0x535876){startRefreshInterval(_0x535876);});});return Promise[_0x45a4('0x48')](_0xa64181);})[_0x45a4('0x43')](function(_0x3b643d){var _0x127a34=_0x3b643d?util[_0x45a4('0x49')](_0x3b643d,{'showHidden':![],'depth':null}):'';logger['error'](_0x45a4('0x4a'),_0x127a34);});}module[_0x45a4('0x4b')]={'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 06c4ec6..de05622 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 _0x87bc=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','client'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x87bc,0x189));var _0xc87b=function(_0x56f292,_0x113fc9){_0x56f292=_0x56f292-0x0;var _0x117ee9=_0x87bc[_0x56f292];return _0x117ee9;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var moment=require('moment');var BPromise=require(_0xc87b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc87b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc87b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc87b('0x5')][_0xc87b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x402aac,_0x5d1813,_0x50b19b){return new BPromise(function(_0x4ed0c5,_0x1999f8){return client[_0xc87b('0x7')](_0x402aac,_0x50b19b)[_0xc87b('0x8')](function(_0x19b571){logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));logger[_0xc87b('0xc')](_0xc87b('0xd'),_0x5d1813,'request\x20sent',JSON['stringify'](_0x19b571));if(_0x19b571[_0xc87b('0xe')]){if(_0x19b571['error'][_0xc87b('0xf')]===0x1f4){logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571[_0xc87b('0xe')]['message']);return _0x1999f8(_0x19b571[_0xc87b('0xe')]['message']);}logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571['error'][_0xc87b('0x10')]);return _0x4ed0c5(_0x19b571[_0xc87b('0xe')]['message']);}else{logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));_0x4ed0c5(_0x19b571[_0xc87b('0x11')][_0xc87b('0x10')]);}})[_0xc87b('0x12')](function(_0x4009ef){logger[_0xc87b('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5d1813,_0x4009ef);_0x1999f8(_0x4009ef);});});} \ No newline at end of file +var _0xfb11=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x47d4fc,_0x51d987){var _0x3f3027=function(_0x4e2de6){while(--_0x4e2de6){_0x47d4fc['push'](_0x47d4fc['shift']());}};_0x3f3027(++_0x51d987);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xfb11[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index ce91ee8..9f77370 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x24e1f3,_0x424234){var _0x34fe3f=function(_0x32b238){while(--_0x32b238){_0x24e1f3['push'](_0x24e1f3['shift']());}};_0x34fe3f(++_0x424234);}(_0x2ef3,0xba));var _0x32ef=function(_0x2575d9,_0x7fade9){_0x2575d9=_0x2575d9-0x0;var _0x2fae9e=_0x2ef3[_0x2575d9];return _0x2fae9e;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5adef4,_0x2d3e65){var _0x3672ad=function(_0x1825f8){while(--_0x1825f8){_0x5adef4['push'](_0x5adef4['shift']());}};_0x3672ad(++_0x2d3e65);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f8d68,_0x1918bd){_0x3f8d68=_0x3f8d68-0x0;var _0xfb3ba8=_0x2ef3[_0x3f8d68];return _0xfb3ba8;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 2a0880b..aea90f7 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 _0xfd28=['exports','STRING'];(function(_0x5cc666,_0x4607f3){var _0x379fd0=function(_0x3918af){while(--_0x3918af){_0x5cc666['push'](_0x5cc666['shift']());}};_0x379fd0(++_0x4607f3);}(_0xfd28,0x148));var _0x8fd2=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xfd28[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'name':{'type':Sequelize[_0x8fd2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8fd2('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8fd2('0x1')]},'phone':{'type':Sequelize[_0x8fd2('0x1')]},'fax':{'type':Sequelize[_0x8fd2('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8fd2('0x1')]},'postalCode':{'type':Sequelize[_0x8fd2('0x1')]},'city':{'type':Sequelize[_0x8fd2('0x1')]},'country':{'type':Sequelize[_0x8fd2('0x1')]},'email':{'type':Sequelize[_0x8fd2('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x8fd2('0x1')]},'sCity':{'type':Sequelize[_0x8fd2('0x1')]},'sCountry':{'type':Sequelize[_0x8fd2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x59ad=['STRING','name','sequelize','exports'];(function(_0x4b9050,_0x1d9044){var _0x13aa59=function(_0x40545d){while(--_0x40545d){_0x4b9050['push'](_0x4b9050['shift']());}};_0x13aa59(++_0x1d9044);}(_0x59ad,0xee));var _0xd59a=function(_0xf14432,_0x4b0ed0){_0xf14432=_0xf14432-0x0;var _0x35d0e4=_0x59ad[_0xf14432];return _0x35d0e4;};'use strict';var Sequelize=require(_0xd59a('0x0'));module[_0xd59a('0x1')]={'name':{'type':Sequelize[_0xd59a('0x2')],'unique':_0xd59a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd59a('0x2')]},'companyId':{'type':Sequelize[_0xd59a('0x2')]},'website':{'type':Sequelize[_0xd59a('0x2')]},'phone':{'type':Sequelize[_0xd59a('0x2')]},'fax':{'type':Sequelize[_0xd59a('0x2')]},'type':{'type':Sequelize[_0xd59a('0x2')]},'street':{'type':Sequelize[_0xd59a('0x2')]},'postalCode':{'type':Sequelize[_0xd59a('0x2')]},'city':{'type':Sequelize[_0xd59a('0x2')]},'country':{'type':Sequelize[_0xd59a('0x2')]},'email':{'type':Sequelize[_0xd59a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd59a('0x2')]},'sPostalCode':{'type':Sequelize[_0xd59a('0x2')]},'sCity':{'type':Sequelize[_0xd59a('0x2')]},'sCountry':{'type':Sequelize[_0xd59a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index c4a2fe2..8bc0b2e 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 _0x1171=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','omit','findOne','order','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','count','limit','set','update','then','destroy','get','Companies','end','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource'];(function(_0x57c235,_0x3e998f){var _0x46bdc2=function(_0x43db6b){while(--_0x43db6b){_0x57c235['push'](_0x57c235['shift']());}};_0x46bdc2(++_0x3e998f);}(_0x1171,0x15f));var _0x1117=function(_0x5b8646,_0x3e1589){_0x5b8646=_0x5b8646-0x0;var _0x363e4c=_0x1171[_0x5b8646];return _0x363e4c;};'use strict';var emlformat=require(_0x1117('0x0'));var rimraf=require(_0x1117('0x1'));var zipdir=require(_0x1117('0x2'));var jsonpatch=require(_0x1117('0x3'));var rp=require(_0x1117('0x4'));var moment=require(_0x1117('0x5'));var BPromise=require(_0x1117('0x6'));var Mustache=require(_0x1117('0x7'));var util=require(_0x1117('0x8'));var path=require(_0x1117('0x9'));var sox=require('sox');var csv=require(_0x1117('0xa'));var ejs=require(_0x1117('0xb'));var fs=require('fs');var fs_extra=require(_0x1117('0xc'));var _=require(_0x1117('0xd'));var squel=require('squel');var crypto=require(_0x1117('0xe'));var jsforce=require(_0x1117('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1117('0x10'));var Papa=require(_0x1117('0x11'));var Redis=require(_0x1117('0x12'));var authService=require(_0x1117('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1117('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1117('0x15'))('api');var utils=require(_0x1117('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1117('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f6cc9,_0x19e013){_0x19e013=_0x19e013||0xcc;return function(_0x48302f){if(_0x48302f){return _0x4f6cc9[_0x1117('0x18')](_0x19e013);}return _0x4f6cc9[_0x1117('0x19')](_0x19e013)['end']();};}function respondWithResult(_0xd97153,_0x212b1d){_0x212b1d=_0x212b1d||0xc8;return function(_0x4e53dd){if(_0x4e53dd){return _0xd97153[_0x1117('0x19')](_0x212b1d)[_0x1117('0x1a')](_0x4e53dd);}};}function respondWithFilteredResult(_0x4cbc80,_0x2e6b5f){return function(_0x4c51ca){if(_0x4c51ca){var _0x40718b=typeof _0x2e6b5f[_0x1117('0x1b')]==='undefined'&&typeof _0x2e6b5f['limit']==='undefined';var _0xda8d86=_0x4c51ca[_0x1117('0x1c')];var _0x15eb78=_0x40718b?0x0:_0x2e6b5f[_0x1117('0x1b')];var _0x812fbf=_0x40718b?_0x4c51ca['count']:_0x2e6b5f[_0x1117('0x1b')]+_0x2e6b5f[_0x1117('0x1d')];var _0x14ba55;if(_0x812fbf>=_0xda8d86){_0x812fbf=_0xda8d86;_0x14ba55=0xc8;}else{_0x14ba55=0xce;}_0x4cbc80['status'](_0x14ba55);return _0x4cbc80[_0x1117('0x1e')]('Content-Range',_0x15eb78+'-'+_0x812fbf+'/'+_0xda8d86)[_0x1117('0x1a')](_0x4c51ca);}return null;};}function patchUpdates(_0x5c480b){return function(_0x340388){try{jsonpatch['apply'](_0x340388,_0x5c480b,!![]);}catch(_0x5df12b){return BPromise['reject'](_0x5df12b);}return _0x340388['save']();};}function saveUpdates(_0x53c82f,_0x5a377a){return function(_0x4dec7d){if(_0x4dec7d){return _0x4dec7d[_0x1117('0x1f')](_0x53c82f)[_0x1117('0x20')](function(_0x33ae68){return _0x33ae68;});}return null;};}function removeEntity(_0x474f7c,_0x4494f5){return function(_0x540aa6){if(_0x540aa6){return _0x540aa6[_0x1117('0x21')]()[_0x1117('0x20')](function(){var _0x2b8bf1=_0x540aa6[_0x1117('0x22')]({'plain':!![]});var _0x4bced6=_0x1117('0x23');return db['UserProfileResource'][_0x1117('0x21')]({'where':{'type':_0x4bced6,'resourceId':_0x2b8bf1['id']}})[_0x1117('0x20')](function(){return _0x540aa6;});})['then'](function(){_0x474f7c[_0x1117('0x19')](0xcc)[_0x1117('0x24')]();});}};}function handleEntityNotFound(_0x1e4cac,_0x5e160c){return function(_0x3e6d69){if(!_0x3e6d69){_0x1e4cac['sendStatus'](0x194);}return _0x3e6d69;};}function handleError(_0x339639,_0x135b4c){_0x135b4c=_0x135b4c||0x1f4;return function(_0x1859dd){logger[_0x1117('0x25')](_0x1859dd[_0x1117('0x26')]);if(_0x1859dd[_0x1117('0x27')]){delete _0x1859dd[_0x1117('0x27')];}_0x339639[_0x1117('0x19')](_0x135b4c)[_0x1117('0x28')](_0x1859dd);};}exports[_0x1117('0x29')]=function(_0x968d67,_0x1044b9){var _0x45b55a={},_0x222f85={},_0x451533={'count':0x0,'rows':[]};return db[_0x1117('0x2a')][_0x1117('0x2b')]()[_0x1117('0x20')](function(_0x8233fe){_0x222f85[_0x1117('0x2c')]=_[_0x1117('0x2d')](_0x8233fe);_0x222f85[_0x1117('0x2e')]=_[_0x1117('0x2d')](_0x968d67[_0x1117('0x2e')]);_0x222f85['filters']=_[_0x1117('0x2f')](_0x222f85[_0x1117('0x2c')],_0x222f85[_0x1117('0x2e')]);_0x45b55a[_0x1117('0x30')]=_['intersection'](_0x222f85[_0x1117('0x2c')],qs[_0x1117('0x31')](_0x968d67[_0x1117('0x2e')]['fields']));_0x45b55a[_0x1117('0x30')]=_0x45b55a['attributes'][_0x1117('0x32')]?_0x45b55a[_0x1117('0x30')]:_0x222f85['model'];if(!_0x968d67[_0x1117('0x2e')][_0x1117('0x33')](_0x1117('0x34'))){_0x45b55a[_0x1117('0x1d')]=qs['limit'](_0x968d67[_0x1117('0x2e')]['limit']);_0x45b55a[_0x1117('0x1b')]=qs[_0x1117('0x1b')](_0x968d67['query'][_0x1117('0x1b')]);}_0x45b55a['order']=qs[_0x1117('0x35')](_0x968d67['query'][_0x1117('0x35')]);_0x45b55a['where']=qs['filters'](_[_0x1117('0x36')](_0x968d67[_0x1117('0x2e')],_0x222f85[_0x1117('0x37')]),_0x8233fe);if(_0x968d67['query'][_0x1117('0x38')]){_0x45b55a[_0x1117('0x39')]=_[_0x1117('0x3a')](_0x45b55a[_0x1117('0x39')],{'$or':_['map'](_0x45b55a['attributes'],function(_0x28074c){var _0x409284={};_0x409284[_0x28074c]={'$like':'%'+_0x968d67[_0x1117('0x2e')][_0x1117('0x38')]+'%'};return _0x409284;})});}_0x45b55a=_[_0x1117('0x3a')]({},_0x45b55a,_0x968d67[_0x1117('0x3b')]);var _0x2ab875={'where':_0x45b55a[_0x1117('0x39')]};return db['CmCompany'][_0x1117('0x1c')](_0x2ab875)[_0x1117('0x20')](function(_0x5e2f58){_0x451533['count']=_0x5e2f58;if(_0x968d67[_0x1117('0x2e')][_0x1117('0x3c')]){_0x45b55a[_0x1117('0x3d')]=[{'all':!![]}];}return db[_0x1117('0x2a')]['findAll'](_0x45b55a);})[_0x1117('0x20')](function(_0x356aa8){_0x451533[_0x1117('0x3e')]=_0x356aa8;return _0x451533;})[_0x1117('0x20')](respondWithFilteredResult(_0x1044b9,_0x45b55a))['catch'](handleError(_0x1044b9,null));})[_0x1117('0x3f')](handleError(_0x1044b9,null));};exports[_0x1117('0x40')]=function(_0x48c238,_0x12dead){var _0x56c142={'raw':![],'where':{'id':_0x48c238['params']['id']}},_0x2468f5={};_0x2468f5[_0x1117('0x2c')]=_[_0x1117('0x2d')](db[_0x1117('0x2a')][_0x1117('0x41')]);_0x2468f5[_0x1117('0x2e')]=_[_0x1117('0x2d')](_0x48c238[_0x1117('0x2e')]);_0x2468f5[_0x1117('0x37')]=_[_0x1117('0x2f')](_0x2468f5[_0x1117('0x2c')],_0x2468f5[_0x1117('0x2e')]);_0x56c142[_0x1117('0x30')]=_[_0x1117('0x2f')](_0x2468f5[_0x1117('0x2c')],qs[_0x1117('0x31')](_0x48c238[_0x1117('0x2e')][_0x1117('0x31')]));_0x56c142[_0x1117('0x30')]=_0x56c142[_0x1117('0x30')]['length']?_0x56c142['attributes']:_0x2468f5[_0x1117('0x2c')];if(_0x48c238[_0x1117('0x2e')]['includeAll']){_0x56c142['include']=[{'all':!![]}];}_0x56c142=_[_0x1117('0x3a')]({},_0x56c142,_0x48c238[_0x1117('0x3b')]);return db['CmCompany'][_0x1117('0x42')](_0x56c142)['then'](handleEntityNotFound(_0x12dead,null))[_0x1117('0x20')](respondWithResult(_0x12dead,null))[_0x1117('0x3f')](handleError(_0x12dead,null));};exports['create']=function(_0x233e8a,_0x2457dc){return db[_0x1117('0x2a')][_0x1117('0x43')](_0x233e8a['body'],{})[_0x1117('0x20')](function(_0x3875d3){var _0x3a78b0=_0x233e8a[_0x1117('0x44')][_0x1117('0x22')]({'plain':!![]});if(!_0x3a78b0)throw new Error(_0x1117('0x45'));if(_0x3a78b0[_0x1117('0x46')]===_0x1117('0x44')){var _0x4c78e7=_0x3875d3[_0x1117('0x22')]({'plain':!![]});var _0x5f1dff=_0x1117('0x23');return db[_0x1117('0x47')][_0x1117('0x42')]({'where':{'name':_0x5f1dff,'userProfileId':_0x3a78b0['userProfileId']},'raw':!![]})[_0x1117('0x20')](function(_0x13fcc1){if(_0x13fcc1&&_0x13fcc1[_0x1117('0x48')]===0x0){return db[_0x1117('0x49')][_0x1117('0x43')]({'name':_0x4c78e7[_0x1117('0x27')],'resourceId':_0x4c78e7['id'],'type':_0x13fcc1[_0x1117('0x27')],'sectionId':_0x13fcc1['id']},{})[_0x1117('0x20')](function(){return _0x3875d3;});}else{return _0x3875d3;}})[_0x1117('0x3f')](function(_0x5a8b4a){logger[_0x1117('0x25')](_0x1117('0x4a'),_0x5a8b4a);throw _0x5a8b4a;});}return _0x3875d3;})[_0x1117('0x20')](respondWithResult(_0x2457dc,0xc9))[_0x1117('0x3f')](handleError(_0x2457dc,null));};exports['update']=function(_0x21e231,_0x1e04f9){if(_0x21e231[_0x1117('0x4b')]['id']){delete _0x21e231[_0x1117('0x4b')]['id'];}return db[_0x1117('0x2a')][_0x1117('0x42')]({'where':{'id':_0x21e231['params']['id']}})['then'](handleEntityNotFound(_0x1e04f9,null))[_0x1117('0x20')](saveUpdates(_0x21e231[_0x1117('0x4b')],null))[_0x1117('0x20')](respondWithResult(_0x1e04f9,null))['catch'](handleError(_0x1e04f9,null));};exports[_0x1117('0x21')]=function(_0x3df7cf,_0x28e879){return db[_0x1117('0x2a')]['find']({'where':{'id':_0x3df7cf[_0x1117('0x4c')]['id']}})[_0x1117('0x20')](handleEntityNotFound(_0x28e879,null))[_0x1117('0x20')](removeEntity(_0x28e879,null))[_0x1117('0x3f')](handleError(_0x28e879,null));};exports[_0x1117('0x2b')]=function(_0x332d21,_0x532f0d){return db[_0x1117('0x2a')]['describe']()[_0x1117('0x20')](respondWithResult(_0x532f0d,null))[_0x1117('0x3f')](handleError(_0x532f0d,null));};exports[_0x1117('0x4d')]=function(_0x3456ca,_0x203eaf,_0x481ef2){return db[_0x1117('0x4e')][_0x1117('0x42')]({'where':{'id':_0x3456ca[_0x1117('0x4c')]['id']}})[_0x1117('0x20')](handleEntityNotFound(_0x203eaf,null))[_0x1117('0x20')](function(_0x58a63e){if(_0x58a63e){return _0x58a63e[_0x1117('0x4d')](_0x3456ca[_0x1117('0x4b')][_0x1117('0x4f')],_[_0x1117('0x50')](_0x3456ca[_0x1117('0x4b')],[_0x1117('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x203eaf,null))['catch'](handleError(_0x203eaf,null));};exports['getContacts']=function(_0x25c0ed,_0x85a3c,_0x2c5896){var _0x122230={};var _0x448420={};var _0x5080b1;var _0x4eb8ba;return db[_0x1117('0x2a')][_0x1117('0x51')]({'where':{'id':_0x25c0ed[_0x1117('0x4c')]['id']}})[_0x1117('0x20')](handleEntityNotFound(_0x85a3c,null))[_0x1117('0x20')](function(_0x13def3){if(_0x13def3){_0x5080b1=_0x13def3;_0x448420['model']=_[_0x1117('0x2d')](db[_0x1117('0x4e')][_0x1117('0x41')]);_0x448420[_0x1117('0x2e')]=_['keys'](_0x25c0ed[_0x1117('0x2e')]);_0x448420['filters']=_['intersection'](_0x448420[_0x1117('0x2c')],_0x448420[_0x1117('0x2e')]);_0x122230[_0x1117('0x30')]=_[_0x1117('0x2f')](_0x448420[_0x1117('0x2c')],qs[_0x1117('0x31')](_0x25c0ed[_0x1117('0x2e')][_0x1117('0x31')]));_0x122230[_0x1117('0x30')]=_0x122230['attributes'][_0x1117('0x32')]?_0x122230['attributes']:_0x448420['model'];_0x122230[_0x1117('0x52')]=qs[_0x1117('0x35')](_0x25c0ed['query']['sort']);_0x122230[_0x1117('0x39')]=qs[_0x1117('0x37')](_[_0x1117('0x36')](_0x25c0ed[_0x1117('0x2e')],_0x448420['filters']));if(_0x25c0ed['query'][_0x1117('0x38')]){_0x122230[_0x1117('0x39')]=_[_0x1117('0x3a')](_0x122230[_0x1117('0x39')],{'$or':_[_0x1117('0x53')](_0x122230[_0x1117('0x30')],function(_0x2871c9){var _0x5376a1={};_0x5376a1[_0x2871c9]={'$like':'%'+_0x25c0ed[_0x1117('0x2e')][_0x1117('0x38')]+'%'};return _0x5376a1;})});}_0x122230=_[_0x1117('0x3a')]({},_0x122230,_0x25c0ed[_0x1117('0x3b')]);return _0x5080b1['getContacts'](_0x122230);}})[_0x1117('0x20')](function(_0x5198e5){if(_0x5198e5){_0x4eb8ba=_0x5198e5[_0x1117('0x32')];if(!_0x25c0ed[_0x1117('0x2e')][_0x1117('0x33')]('nolimit')){_0x122230[_0x1117('0x1d')]=qs['limit'](_0x25c0ed[_0x1117('0x2e')][_0x1117('0x1d')]);_0x122230['offset']=qs['offset'](_0x25c0ed[_0x1117('0x2e')][_0x1117('0x1b')]);}return _0x5080b1[_0x1117('0x54')](_0x122230);}})['then'](function(_0x58143d){if(_0x58143d){return _0x58143d?{'count':_0x4eb8ba,'rows':_0x58143d}:null;}})[_0x1117('0x20')](respondWithResult(_0x85a3c,null))[_0x1117('0x3f')](handleError(_0x85a3c,null));}; \ No newline at end of file +var _0xbbef=['index','describe','model','keys','query','filters','intersection','attributes','length','nolimit','where','merge','map','filter','options','includeAll','include','CmCompany','rows','catch','params','rawAttributes','fields','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','order','sort','pick','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send'];(function(_0x54a73a,_0x5f3b71){var _0x453a79=function(_0x356086){while(--_0x356086){_0x54a73a['push'](_0x54a73a['shift']());}};_0x453a79(++_0x5f3b71);}(_0xbbef,0x82));var _0xfbbe=function(_0x58da0a,_0x44ff15){_0x58da0a=_0x58da0a-0x0;var _0x255e3e=_0xbbef[_0x58da0a];return _0x255e3e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbbe('0x0'));var jsonpatch=require(_0xfbbe('0x1'));var rp=require(_0xfbbe('0x2'));var moment=require(_0xfbbe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfbbe('0x4'));var util=require(_0xfbbe('0x5'));var path=require(_0xfbbe('0x6'));var sox=require(_0xfbbe('0x7'));var csv=require(_0xfbbe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbbe('0x9'));var squel=require(_0xfbbe('0xa'));var crypto=require('crypto');var jsforce=require(_0xfbbe('0xb'));var deskjs=require(_0xfbbe('0xc'));var toCsv=require(_0xfbbe('0x8'));var querystring=require(_0xfbbe('0xd'));var Papa=require('papaparse');var Redis=require(_0xfbbe('0xe'));var authService=require(_0xfbbe('0xf'));var qs=require(_0xfbbe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbbe('0x11'));var logger=require(_0xfbbe('0x12'))(_0xfbbe('0x13'));var utils=require('../../config/utils');var config=require(_0xfbbe('0x14'));var licenseUtil=require(_0xfbbe('0x15'));var db=require(_0xfbbe('0x16'))['db'];function respondWithStatusCode(_0x5c90c9,_0xa5a7f2){_0xa5a7f2=_0xa5a7f2||0xcc;return function(_0x3da5ef){if(_0x3da5ef){return _0x5c90c9['sendStatus'](_0xa5a7f2);}return _0x5c90c9['status'](_0xa5a7f2)[_0xfbbe('0x17')]();};}function respondWithResult(_0x9cba0f,_0x3a9121){_0x3a9121=_0x3a9121||0xc8;return function(_0x36996c){if(_0x36996c){return _0x9cba0f[_0xfbbe('0x18')](_0x3a9121)['json'](_0x36996c);}};}function respondWithFilteredResult(_0x1ff678,_0x276882){return function(_0x490076){if(_0x490076){var _0x5b1724=typeof _0x276882['offset']===_0xfbbe('0x19')&&typeof _0x276882[_0xfbbe('0x1a')]===_0xfbbe('0x19');var _0x49096e=_0x490076[_0xfbbe('0x1b')];var _0x2ba3dd=_0x5b1724?0x0:_0x276882[_0xfbbe('0x1c')];var _0x50f9e4=_0x5b1724?_0x490076[_0xfbbe('0x1b')]:_0x276882[_0xfbbe('0x1c')]+_0x276882[_0xfbbe('0x1a')];var _0x397c67;if(_0x50f9e4>=_0x49096e){_0x50f9e4=_0x49096e;_0x397c67=0xc8;}else{_0x397c67=0xce;}_0x1ff678['status'](_0x397c67);return _0x1ff678[_0xfbbe('0x1d')](_0xfbbe('0x1e'),_0x2ba3dd+'-'+_0x50f9e4+'/'+_0x49096e)[_0xfbbe('0x1f')](_0x490076);}return null;};}function patchUpdates(_0x2989a8){return function(_0x4a7b3c){try{jsonpatch[_0xfbbe('0x20')](_0x4a7b3c,_0x2989a8,!![]);}catch(_0x4cc50a){return BPromise[_0xfbbe('0x21')](_0x4cc50a);}return _0x4a7b3c[_0xfbbe('0x22')]();};}function saveUpdates(_0x395740,_0x3730f2){return function(_0x5472cb){if(_0x5472cb){return _0x5472cb[_0xfbbe('0x23')](_0x395740)[_0xfbbe('0x24')](function(_0x112e14){return _0x112e14;});}return null;};}function removeEntity(_0x2314cb,_0x49f5d1){return function(_0x44f761){if(_0x44f761){return _0x44f761[_0xfbbe('0x25')]()['then'](function(){var _0x4994f0=_0x44f761[_0xfbbe('0x26')]({'plain':!![]});var _0x409a4c='Companies';return db[_0xfbbe('0x27')][_0xfbbe('0x25')]({'where':{'type':_0x409a4c,'resourceId':_0x4994f0['id']}})[_0xfbbe('0x24')](function(){return _0x44f761;});})[_0xfbbe('0x24')](function(){_0x2314cb[_0xfbbe('0x18')](0xcc)[_0xfbbe('0x17')]();});}};}function handleEntityNotFound(_0x39f2ee,_0x3ab778){return function(_0x233461){if(!_0x233461){_0x39f2ee[_0xfbbe('0x28')](0x194);}return _0x233461;};}function handleError(_0x33722e,_0xacb1ec){_0xacb1ec=_0xacb1ec||0x1f4;return function(_0x5ebb42){logger['error'](_0x5ebb42[_0xfbbe('0x29')]);if(_0x5ebb42[_0xfbbe('0x2a')]){delete _0x5ebb42['name'];}_0x33722e['status'](_0xacb1ec)[_0xfbbe('0x2b')](_0x5ebb42);};}exports[_0xfbbe('0x2c')]=function(_0x376ed6,_0x2dfeb8){var _0x3733c5={},_0x3b10ac={},_0xdd1131={'count':0x0,'rows':[]};return db['CmCompany'][_0xfbbe('0x2d')]()['then'](function(_0x17ea90){_0x3b10ac[_0xfbbe('0x2e')]=_[_0xfbbe('0x2f')](_0x17ea90);_0x3b10ac[_0xfbbe('0x30')]=_[_0xfbbe('0x2f')](_0x376ed6['query']);_0x3b10ac[_0xfbbe('0x31')]=_[_0xfbbe('0x32')](_0x3b10ac[_0xfbbe('0x2e')],_0x3b10ac[_0xfbbe('0x30')]);_0x3733c5[_0xfbbe('0x33')]=_[_0xfbbe('0x32')](_0x3b10ac['model'],qs['fields'](_0x376ed6['query']['fields']));_0x3733c5[_0xfbbe('0x33')]=_0x3733c5[_0xfbbe('0x33')][_0xfbbe('0x34')]?_0x3733c5[_0xfbbe('0x33')]:_0x3b10ac[_0xfbbe('0x2e')];if(!_0x376ed6[_0xfbbe('0x30')]['hasOwnProperty'](_0xfbbe('0x35'))){_0x3733c5['limit']=qs[_0xfbbe('0x1a')](_0x376ed6['query'][_0xfbbe('0x1a')]);_0x3733c5['offset']=qs['offset'](_0x376ed6[_0xfbbe('0x30')][_0xfbbe('0x1c')]);}_0x3733c5['order']=qs['sort'](_0x376ed6['query']['sort']);_0x3733c5[_0xfbbe('0x36')]=qs[_0xfbbe('0x31')](_['pick'](_0x376ed6[_0xfbbe('0x30')],_0x3b10ac[_0xfbbe('0x31')]),_0x17ea90);if(_0x376ed6['query']['filter']){_0x3733c5[_0xfbbe('0x36')]=_[_0xfbbe('0x37')](_0x3733c5[_0xfbbe('0x36')],{'$or':_[_0xfbbe('0x38')](_0x3733c5[_0xfbbe('0x33')],function(_0x5b71fd){var _0x2cf1ff={};_0x2cf1ff[_0x5b71fd]={'$like':'%'+_0x376ed6['query'][_0xfbbe('0x39')]+'%'};return _0x2cf1ff;})});}_0x3733c5=_[_0xfbbe('0x37')]({},_0x3733c5,_0x376ed6[_0xfbbe('0x3a')]);var _0x282054={'where':_0x3733c5[_0xfbbe('0x36')]};return db['CmCompany']['count'](_0x282054)[_0xfbbe('0x24')](function(_0x1542ee){_0xdd1131[_0xfbbe('0x1b')]=_0x1542ee;if(_0x376ed6[_0xfbbe('0x30')][_0xfbbe('0x3b')]){_0x3733c5[_0xfbbe('0x3c')]=[{'all':!![]}];}return db[_0xfbbe('0x3d')]['findAll'](_0x3733c5);})[_0xfbbe('0x24')](function(_0x11edd9){_0xdd1131[_0xfbbe('0x3e')]=_0x11edd9;return _0xdd1131;})[_0xfbbe('0x24')](respondWithFilteredResult(_0x2dfeb8,_0x3733c5))['catch'](handleError(_0x2dfeb8,null));})[_0xfbbe('0x3f')](handleError(_0x2dfeb8,null));};exports['show']=function(_0x582ae5,_0x51c0eb){var _0x2425d0={'raw':![],'where':{'id':_0x582ae5[_0xfbbe('0x40')]['id']}},_0x26a9d0={};_0x26a9d0[_0xfbbe('0x2e')]=_[_0xfbbe('0x2f')](db['CmCompany'][_0xfbbe('0x41')]);_0x26a9d0['query']=_[_0xfbbe('0x2f')](_0x582ae5[_0xfbbe('0x30')]);_0x26a9d0[_0xfbbe('0x31')]=_[_0xfbbe('0x32')](_0x26a9d0[_0xfbbe('0x2e')],_0x26a9d0['query']);_0x2425d0[_0xfbbe('0x33')]=_[_0xfbbe('0x32')](_0x26a9d0['model'],qs['fields'](_0x582ae5[_0xfbbe('0x30')][_0xfbbe('0x42')]));_0x2425d0[_0xfbbe('0x33')]=_0x2425d0[_0xfbbe('0x33')][_0xfbbe('0x34')]?_0x2425d0['attributes']:_0x26a9d0[_0xfbbe('0x2e')];if(_0x582ae5['query'][_0xfbbe('0x3b')]){_0x2425d0[_0xfbbe('0x3c')]=[{'all':!![]}];}_0x2425d0=_['merge']({},_0x2425d0,_0x582ae5[_0xfbbe('0x3a')]);return db['CmCompany'][_0xfbbe('0x43')](_0x2425d0)[_0xfbbe('0x24')](handleEntityNotFound(_0x51c0eb,null))['then'](respondWithResult(_0x51c0eb,null))[_0xfbbe('0x3f')](handleError(_0x51c0eb,null));};exports[_0xfbbe('0x44')]=function(_0x46ac9a,_0x3517d8){return db[_0xfbbe('0x3d')]['create'](_0x46ac9a['body'],{})['then'](function(_0x1a97d4){var _0x333979=_0x46ac9a[_0xfbbe('0x45')]['get']({'plain':!![]});if(!_0x333979)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x333979[_0xfbbe('0x46')]===_0xfbbe('0x45')){var _0x31a74a=_0x1a97d4[_0xfbbe('0x26')]({'plain':!![]});var _0x2b24c7='Companies';return db[_0xfbbe('0x47')][_0xfbbe('0x43')]({'where':{'name':_0x2b24c7,'userProfileId':_0x333979[_0xfbbe('0x48')]},'raw':!![]})['then'](function(_0xd66fad){if(_0xd66fad&&_0xd66fad[_0xfbbe('0x49')]===0x0){return db[_0xfbbe('0x27')][_0xfbbe('0x44')]({'name':_0x31a74a[_0xfbbe('0x2a')],'resourceId':_0x31a74a['id'],'type':_0xd66fad[_0xfbbe('0x2a')],'sectionId':_0xd66fad['id']},{})[_0xfbbe('0x24')](function(){return _0x1a97d4;});}else{return _0x1a97d4;}})['catch'](function(_0x5d47f8){logger[_0xfbbe('0x4a')](_0xfbbe('0x4b'),_0x5d47f8);throw _0x5d47f8;});}return _0x1a97d4;})[_0xfbbe('0x24')](respondWithResult(_0x3517d8,0xc9))['catch'](handleError(_0x3517d8,null));};exports[_0xfbbe('0x23')]=function(_0x26599d,_0x36482d){if(_0x26599d[_0xfbbe('0x4c')]['id']){delete _0x26599d['body']['id'];}return db[_0xfbbe('0x3d')][_0xfbbe('0x43')]({'where':{'id':_0x26599d[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x36482d,null))[_0xfbbe('0x24')](saveUpdates(_0x26599d[_0xfbbe('0x4c')],null))['then'](respondWithResult(_0x36482d,null))[_0xfbbe('0x3f')](handleError(_0x36482d,null));};exports['destroy']=function(_0x463a32,_0x3ebef8){return db['CmCompany'][_0xfbbe('0x43')]({'where':{'id':_0x463a32[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x3ebef8,null))[_0xfbbe('0x24')](removeEntity(_0x3ebef8,null))[_0xfbbe('0x3f')](handleError(_0x3ebef8,null));};exports[_0xfbbe('0x2d')]=function(_0xd6dcc0,_0x19de48){return db[_0xfbbe('0x3d')][_0xfbbe('0x2d')]()[_0xfbbe('0x24')](respondWithResult(_0x19de48,null))[_0xfbbe('0x3f')](handleError(_0x19de48,null));};exports[_0xfbbe('0x4d')]=function(_0x1d5e97,_0x49dc84,_0x12ca1e){return db[_0xfbbe('0x4e')][_0xfbbe('0x43')]({'where':{'id':_0x1d5e97[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x49dc84,null))['then'](function(_0x2ddbfa){if(_0x2ddbfa){return _0x2ddbfa[_0xfbbe('0x4d')](_0x1d5e97[_0xfbbe('0x4c')][_0xfbbe('0x4f')],_[_0xfbbe('0x50')](_0x1d5e97[_0xfbbe('0x4c')],[_0xfbbe('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x49dc84,null))[_0xfbbe('0x3f')](handleError(_0x49dc84,null));};exports[_0xfbbe('0x51')]=function(_0x407e0b,_0x416b92,_0x1be856){var _0x4f0f76={};var _0x3dd67e={};var _0x38acfe;var _0x1ec3bd;return db[_0xfbbe('0x3d')][_0xfbbe('0x52')]({'where':{'id':_0x407e0b[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x416b92,null))[_0xfbbe('0x24')](function(_0x5e9ec3){if(_0x5e9ec3){_0x38acfe=_0x5e9ec3;_0x3dd67e[_0xfbbe('0x2e')]=_[_0xfbbe('0x2f')](db[_0xfbbe('0x4e')][_0xfbbe('0x41')]);_0x3dd67e[_0xfbbe('0x30')]=_['keys'](_0x407e0b[_0xfbbe('0x30')]);_0x3dd67e[_0xfbbe('0x31')]=_[_0xfbbe('0x32')](_0x3dd67e[_0xfbbe('0x2e')],_0x3dd67e[_0xfbbe('0x30')]);_0x4f0f76['attributes']=_[_0xfbbe('0x32')](_0x3dd67e[_0xfbbe('0x2e')],qs['fields'](_0x407e0b['query'][_0xfbbe('0x42')]));_0x4f0f76[_0xfbbe('0x33')]=_0x4f0f76['attributes'][_0xfbbe('0x34')]?_0x4f0f76[_0xfbbe('0x33')]:_0x3dd67e[_0xfbbe('0x2e')];_0x4f0f76[_0xfbbe('0x53')]=qs['sort'](_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x54')]);_0x4f0f76['where']=qs[_0xfbbe('0x31')](_[_0xfbbe('0x55')](_0x407e0b[_0xfbbe('0x30')],_0x3dd67e[_0xfbbe('0x31')]));if(_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x39')]){_0x4f0f76[_0xfbbe('0x36')]=_['merge'](_0x4f0f76[_0xfbbe('0x36')],{'$or':_['map'](_0x4f0f76[_0xfbbe('0x33')],function(_0x5f241e){var _0x10e7fc={};_0x10e7fc[_0x5f241e]={'$like':'%'+_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x39')]+'%'};return _0x10e7fc;})});}_0x4f0f76=_['merge']({},_0x4f0f76,_0x407e0b[_0xfbbe('0x3a')]);return _0x38acfe['getContacts'](_0x4f0f76);}})[_0xfbbe('0x24')](function(_0x459c1e){if(_0x459c1e){_0x1ec3bd=_0x459c1e['length'];if(!_0x407e0b['query'][_0xfbbe('0x56')](_0xfbbe('0x35'))){_0x4f0f76[_0xfbbe('0x1a')]=qs['limit'](_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x1a')]);_0x4f0f76[_0xfbbe('0x1c')]=qs[_0xfbbe('0x1c')](_0x407e0b['query']['offset']);}return _0x38acfe[_0xfbbe('0x51')](_0x4f0f76);}})['then'](function(_0x55d93d){if(_0x55d93d){return _0x55d93d?{'count':_0x1ec3bd,'rows':_0x55d93d}:null;}})[_0xfbbe('0x24')](respondWithResult(_0x416b92,null))[_0xfbbe('0x3f')](handleError(_0x416b92,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 088be2d..10fffce 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 _0x1a58=['moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','lodash','../../config/logger'];(function(_0x5108f0,_0x3a8263){var _0x7157df=function(_0x442b03){while(--_0x442b03){_0x5108f0['push'](_0x5108f0['shift']());}};_0x7157df(++_0x3a8263);}(_0x1a58,0x12a));var _0x81a5=function(_0x410ccc,_0x53359f){_0x410ccc=_0x410ccc-0x0;var _0x3472f5=_0x1a58[_0x410ccc];return _0x3472f5;};'use strict';var _=require(_0x81a5('0x0'));var util=require('util');var logger=require(_0x81a5('0x1'))('api');var moment=require(_0x81a5('0x2'));var BPromise=require(_0x81a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81a5('0x4'));var rimraf=require(_0x81a5('0x5'));var config=require(_0x81a5('0x6'));var attributes=require(_0x81a5('0x7'));module['exports']=function(_0x19312c,_0x3def88){return _0x19312c['define'](_0x81a5('0x8'),attributes,{'tableName':_0x81a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2baf=['util','api','moment','bluebird','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0x422e79,_0x4e7a2f){var _0x4560ad=function(_0xeaa377){while(--_0xeaa377){_0x422e79['push'](_0x422e79['shift']());}};_0x4560ad(++_0x4e7a2f);}(_0x2baf,0xbc));var _0xf2ba=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x2baf[_0x21205e];return _0x136ebb;};'use strict';var _=require(_0xf2ba('0x0'));var util=require(_0xf2ba('0x1'));var logger=require('../../config/logger')(_0xf2ba('0x2'));var moment=require(_0xf2ba('0x3'));var BPromise=require(_0xf2ba('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(_0xf2ba('0x5'));module['exports']=function(_0x3785f3,_0x3ea093){return _0x3785f3[_0xf2ba('0x6')](_0xf2ba('0x7'),attributes,{'tableName':_0xf2ba('0x8'),'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 4dad229..15027ff 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 _0x9268=['../../config/utils','../../config/logger','../../config/environment','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x9268,0x10b));var _0x8926=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x9268[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0x8926('0x0'));var util=require(_0x8926('0x1'));var moment=require(_0x8926('0x2'));var BPromise=require(_0x8926('0x3'));var rs=require(_0x8926('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8926('0x5'))['db'];var utils=require(_0x8926('0x6'));var logger=require(_0x8926('0x7'))('rpc');var config=require(_0x8926('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c2abd,_0x54f988,_0x20c783){return new BPromise(function(_0x31f2b6,_0x1215b9){return client[_0x8926('0x9')](_0x1c2abd,_0x20c783)[_0x8926('0xa')](function(_0xe2bb31){logger[_0x8926('0xb')](_0x8926('0xc'),_0x54f988,_0x8926('0xd'));logger[_0x8926('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x54f988,_0x8926('0xd'),JSON[_0x8926('0xf')](_0xe2bb31));if(_0xe2bb31[_0x8926('0x10')]){if(_0xe2bb31[_0x8926('0x10')][_0x8926('0x11')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x54f988,_0xe2bb31[_0x8926('0x10')][_0x8926('0x12')]);return _0x1215b9(_0xe2bb31[_0x8926('0x10')]['message']);}logger[_0x8926('0x10')](_0x8926('0xc'),_0x54f988,_0xe2bb31[_0x8926('0x10')][_0x8926('0x12')]);return _0x31f2b6(_0xe2bb31[_0x8926('0x10')][_0x8926('0x12')]);}else{logger['info'](_0x8926('0xc'),_0x54f988,_0x8926('0xd'));_0x31f2b6(_0xe2bb31[_0x8926('0x13')][_0x8926('0x12')]);}})[_0x8926('0x14')](function(_0x576674){logger[_0x8926('0x10')]('CmCompany,\x20%s,\x20%s',_0x54f988,_0x576674);_0x1215b9(_0x576674);});});} \ No newline at end of file +var _0x493c=['../../config/utils','../../config/environment','client','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x42decb,_0x576852){var _0x14e3f2=function(_0x1ab70b){while(--_0x1ab70b){_0x42decb['push'](_0x42decb['shift']());}};_0x14e3f2(++_0x576852);}(_0x493c,0x13f));var _0xc493=function(_0x4c0ba0,_0x1f9a1b){_0x4c0ba0=_0x4c0ba0-0x0;var _0x10be64=_0x493c[_0x4c0ba0];return _0x10be64;};'use strict';var _=require(_0xc493('0x0'));var util=require(_0xc493('0x1'));var moment=require('moment');var BPromise=require(_0xc493('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc493('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc493('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc493('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc493('0x6')][_0xc493('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9050f,_0x3b38a8,_0x311711){return new BPromise(function(_0x16d901,_0x49c485){return client[_0xc493('0x8')](_0x9050f,_0x311711)['then'](function(_0x12f1ff){logger[_0xc493('0x9')]('CmCompany,\x20%s,\x20%s',_0x3b38a8,_0xc493('0xa'));logger[_0xc493('0xb')](_0xc493('0xc'),_0x3b38a8,'request\x20sent',JSON[_0xc493('0xd')](_0x12f1ff));if(_0x12f1ff[_0xc493('0xe')]){if(_0x12f1ff[_0xc493('0xe')]['code']===0x1f4){logger[_0xc493('0xe')](_0xc493('0xf'),_0x3b38a8,_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);return _0x49c485(_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);}logger[_0xc493('0xe')](_0xc493('0xf'),_0x3b38a8,_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);return _0x16d901(_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);}else{logger[_0xc493('0x9')]('CmCompany,\x20%s,\x20%s',_0x3b38a8,_0xc493('0xa'));_0x16d901(_0x12f1ff[_0xc493('0x11')]['message']);}})[_0xc493('0x12')](function(_0x205fa3){logger[_0xc493('0xe')](_0xc493('0xf'),_0x3b38a8,_0x205fa3);_0x49c485(_0x205fa3);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8f876fe..f5ca38a 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 _0x9ab2=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id/contacts','post','create','addContacts','/:id','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ab2,0x192));var _0x29ab=function(_0x138c60,_0x437d9a){_0x138c60=_0x138c60-0x0;var _0xfc850b=_0x9ab2[_0x138c60];return _0xfc850b;};'use strict';var multer=require(_0x29ab('0x0'));var util=require(_0x29ab('0x1'));var path=require('path');var timeout=require(_0x29ab('0x2'));var express=require(_0x29ab('0x3'));var router=express[_0x29ab('0x4')]();var fs_extra=require(_0x29ab('0x5'));var auth=require(_0x29ab('0x6'));var interaction=require(_0x29ab('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x29ab('0x8')]('/',auth[_0x29ab('0x9')](),controller['index']);router['get'](_0x29ab('0xa'),auth[_0x29ab('0x9')](),controller['describe']);router[_0x29ab('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x29ab('0x8')](_0x29ab('0xb'),auth['isAuthenticated'](),controller['getContacts']);router[_0x29ab('0xc')]('/',auth[_0x29ab('0x9')](),controller[_0x29ab('0xd')]);router[_0x29ab('0xc')](_0x29ab('0xb'),auth[_0x29ab('0x9')](),controller[_0x29ab('0xe')]);router['put'](_0x29ab('0xf'),auth['isAuthenticated'](),controller[_0x29ab('0x10')]);router[_0x29ab('0x11')](_0x29ab('0xf'),auth[_0x29ab('0x9')](),controller[_0x29ab('0x12')]);module[_0x29ab('0x13')]=router; \ No newline at end of file +var _0x1094=['getContacts','create','post','update','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts'];(function(_0x4a8d77,_0x376df2){var _0xac3836=function(_0xadaa7e){while(--_0xadaa7e){_0x4a8d77['push'](_0x4a8d77['shift']());}};_0xac3836(++_0x376df2);}(_0x1094,0x101));var _0x4109=function(_0x3b4d1b,_0x12517b){_0x3b4d1b=_0x3b4d1b-0x0;var _0x5a2ffd=_0x1094[_0x3b4d1b];return _0x5a2ffd;};'use strict';var multer=require(_0x4109('0x0'));var util=require('util');var path=require(_0x4109('0x1'));var timeout=require('connect-timeout');var express=require(_0x4109('0x2'));var router=express['Router']();var fs_extra=require(_0x4109('0x3'));var auth=require(_0x4109('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4109('0x5'));var controller=require('./cmCompany.controller');router[_0x4109('0x6')]('/',auth[_0x4109('0x7')](),controller[_0x4109('0x8')]);router[_0x4109('0x6')](_0x4109('0x9'),auth['isAuthenticated'](),controller[_0x4109('0xa')]);router[_0x4109('0x6')](_0x4109('0xb'),auth[_0x4109('0x7')](),controller['show']);router['get'](_0x4109('0xc'),auth[_0x4109('0x7')](),controller[_0x4109('0xd')]);router['post']('/',auth[_0x4109('0x7')](),controller[_0x4109('0xe')]);router[_0x4109('0xf')](_0x4109('0xc'),auth[_0x4109('0x7')](),controller['addContacts']);router['put'](_0x4109('0xb'),auth[_0x4109('0x7')](),controller[_0x4109('0x10')]);router['delete'](_0x4109('0xb'),auth[_0x4109('0x7')](),controller[_0x4109('0x11')]);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 04e8bd5..54698c4 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 _0x0b5e=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x4b96b4,_0x9041f1){var _0x10222b=function(_0x470cf7){while(--_0x470cf7){_0x4b96b4['push'](_0x4b96b4['shift']());}};_0x10222b(++_0x9041f1);}(_0x0b5e,0xd0));var _0xe0b5=function(_0x2a0078,_0x44254d){_0x2a0078=_0x2a0078-0x0;var _0x485cc2=_0x0b5e[_0x2a0078];return _0x485cc2;};'use strict';var _=require(_0xe0b5('0x0'));var Sequelize=require(_0xe0b5('0x1'));module[_0xe0b5('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b5('0x3')]},'street':{'type':Sequelize[_0xe0b5('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe0b5('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe0b5('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe0b5('0x3')]},'fax':{'type':Sequelize[_0xe0b5('0x3')]},'email':{'type':Sequelize[_0xe0b5('0x3')]},'url':{'type':Sequelize[_0xe0b5('0x3')]},'facebook':{'type':Sequelize[_0xe0b5('0x3')]},'fb_data':{'type':Sequelize[_0xe0b5('0x3')]},'twitter':{'type':Sequelize[_0xe0b5('0x3')]},'skype':{'type':Sequelize[_0xe0b5('0x3')]},'teams':{'type':Sequelize[_0xe0b5('0x3')]},'viber':{'type':Sequelize[_0xe0b5('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b5('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xe0b5('0x3')]},'priority':{'type':Sequelize[_0xe0b5('0x5')](0x2)[_0xe0b5('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b5('0x7')],'defaultValue':Sequelize[_0xe0b5('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf168=['UNSIGNED','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xf168,0x11a));var _0x8f16=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xf168[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x8f16('0x0'));var Sequelize=require('sequelize');module[_0x8f16('0x1')]={'firstName':{'type':Sequelize[_0x8f16('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8f16('0x2')]},'postalCode':{'type':Sequelize[_0x8f16('0x2')]},'city':{'type':Sequelize[_0x8f16('0x2')]},'country':{'type':Sequelize[_0x8f16('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f16('0x2')]},'description':{'type':Sequelize[_0x8f16('0x3')]},'phone':{'type':Sequelize[_0x8f16('0x2')]},'mobile':{'type':Sequelize[_0x8f16('0x2')]},'fax':{'type':Sequelize[_0x8f16('0x2')]},'email':{'type':Sequelize[_0x8f16('0x2')]},'url':{'type':Sequelize[_0x8f16('0x2')]},'facebook':{'type':Sequelize[_0x8f16('0x2')]},'fb_data':{'type':Sequelize[_0x8f16('0x2')]},'twitter':{'type':Sequelize[_0x8f16('0x2')]},'skype':{'type':Sequelize[_0x8f16('0x2')]},'teams':{'type':Sequelize[_0x8f16('0x2')]},'viber':{'type':Sequelize[_0x8f16('0x2')]},'line':{'type':Sequelize[_0x8f16('0x2')]},'wechat':{'type':Sequelize[_0x8f16('0x2')]},'telegram':{'type':Sequelize[_0x8f16('0x2')]},'UserId':{'type':Sequelize[_0x8f16('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8f16('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f16('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8f16('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8f16('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e860084..0871e65 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 _0xeb95=['ids','setAdditionalPhones','all','ContactItemType','OrderBy','item_types','ItemTypeId','items','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','order','ContactId','includeAll','include','getHopperHistories','rows','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','split','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','User','agent','No\x20ListId\x20specified','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','mail','chat','sms','fax','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','voice','uniqueid','source','destination','callerid','endtime','duration','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','Tags','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','threadId','findAndCountAll','reverse','slice','moment','bluebird','util','lodash','papaparse','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','json','undefined','offset','count','limit','set','Content-Range','then','status','sendStatus','error','name','send','index','describe','user','catch','destroy','CmContact','find','params','tags','keys','length','startsWith','cf_','columnName','query','analytics','CmCustomField','displayName','alias','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','findAll','from','get','mergeWith','isArray','join','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','create','isNil','dialTimezone','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','findOrCreate','contact','show','Tag','color','tag','Phones','ItemType','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','timezones','isEmpty','table','setFields','toParam','text','phone','filters','intersection','model','attributes','fields','sort','pick','filter','options','nolimit','setTags','findOne'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xeb95,0x176));var _0x5eb9=function(_0x3adcf4,_0x5d78f8){_0x3adcf4=_0x3adcf4-0x0;var _0x495984=_0xeb95[_0x3adcf4];return _0x495984;};'use strict';var moment=require(_0x5eb9('0x0'));var BPromise=require(_0x5eb9('0x1'));var util=require(_0x5eb9('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x5eb9('0x3'));var squel=require('squel');var Papa=require(_0x5eb9('0x4'));var Redis=require('ioredis');var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x5eb9('0x5'));var shared=require('../../config/environment/shared');var db=require(_0x5eb9('0x6'))['db'];config[_0x5eb9('0x7')]=_[_0x5eb9('0x8')](config['redis'],{'host':_0x5eb9('0x9'),'port':0x18eb});var socket=require(_0x5eb9('0xa'))(new Redis(config[_0x5eb9('0x7')]));require(_0x5eb9('0xb'))['register'](socket);function respondWithResult(_0x38d0ee,_0x3aa7e6){_0x3aa7e6=_0x3aa7e6||0xc8;return function(_0x4c5149){if(_0x4c5149){return _0x38d0ee['status'](_0x3aa7e6)[_0x5eb9('0xc')](_0x4c5149);}};}function respondWithFilteredResult(_0x5f1f31,_0x4f0618){return function(_0x443969){if(_0x443969){var _0x319bb3=typeof _0x4f0618['offset']==='undefined'&&typeof _0x4f0618['limit']===_0x5eb9('0xd');var _0x55969d=_0x443969['count'];var _0x1782f3=_0x319bb3?0x0:_0x4f0618[_0x5eb9('0xe')];var _0x3cff1c=_0x319bb3?_0x443969[_0x5eb9('0xf')]:_0x4f0618[_0x5eb9('0xe')]+_0x4f0618[_0x5eb9('0x10')];var _0x228803;if(_0x3cff1c>=_0x55969d){_0x3cff1c=_0x55969d;_0x228803=0xc8;}else{_0x228803=0xce;}_0x5f1f31['status'](_0x228803);return _0x5f1f31[_0x5eb9('0x11')](_0x5eb9('0x12'),_0x1782f3+'-'+_0x3cff1c+'/'+_0x55969d)[_0x5eb9('0xc')](_0x443969);}return null;};}function saveUpdates(_0x11ee6){return function(_0x669600){if(_0x669600){return _0x669600['update'](_0x11ee6)[_0x5eb9('0x13')](function(_0x570c74){return _0x570c74;});}return null;};}function removeEntity(_0x2381ff){return function(_0x346437){if(_0x346437){return _0x346437['destroy']()['then'](function(){_0x2381ff[_0x5eb9('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c6689){return function(_0x456f14){if(!_0x456f14){_0x9c6689[_0x5eb9('0x15')](0x194);}return _0x456f14;};}function handleError(_0x3539cc,_0x7b8cb3){_0x7b8cb3=_0x7b8cb3||0x1f4;return function(_0x13bd39){logger[_0x5eb9('0x16')](_0x13bd39['stack']);if(_0x13bd39[_0x5eb9('0x17')]){delete _0x13bd39[_0x5eb9('0x17')];}_0x3539cc[_0x5eb9('0x14')](_0x7b8cb3)[_0x5eb9('0x18')](_0x13bd39);};}exports[_0x5eb9('0x19')]=function(_0x27d9d6,_0x2daf82){var _0x329aab={};return contacts[_0x5eb9('0x1a')]()['then'](function(_0x3e3cb7){_0x329aab=qs['getOptions'](_0x3e3cb7,_0x27d9d6);return contacts['findAll'](_0x27d9d6['query'],_0x27d9d6[_0x5eb9('0x1b')],_0x329aab,_0x3e3cb7);})[_0x5eb9('0x13')](respondWithFilteredResult(_0x2daf82,_0x329aab))[_0x5eb9('0x1c')](handleError(_0x2daf82,null));};exports[_0x5eb9('0x1d')]=function(_0x2c89f2,_0x4c0405){return db[_0x5eb9('0x1e')][_0x5eb9('0x1f')]({'where':{'id':_0x2c89f2[_0x5eb9('0x20')]['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0x4c0405,null))['then'](removeEntity(_0x4c0405,null))[_0x5eb9('0x1c')](handleError(_0x4c0405,null));};exports[_0x5eb9('0x1a')]=function(_0x1898a6,_0x44ce75){return db[_0x5eb9('0x1e')][_0x5eb9('0x1a')]()['then'](function(_0x155282){delete _0x155282[_0x5eb9('0x21')];for(var _0x38d416=0x0;_0x38d4160x0){return new Promise(function(_0x410ba3){var _0x48e5aa=[];for(var _0x22c06b=0x0;_0x22c06b<_0x45b1a7[_0x5eb9('0x23')];_0x22c06b++){_0x48e5aa[_0x5eb9('0x5f')](insertAdditionalPhones(_0x45b1a7[_0x22c06b][_0x5eb9('0x63')],_0x45b1a7[_0x22c06b]['additionalPhones']));}Promise['all'](_0x48e5aa)[_0x5eb9('0x13')](function(){_0x410ba3(0x1);});})[_0x5eb9('0x13')](function(){return{'success':_0x17ac6a,'failure':_0x58508d,'duplicates':_0x5cfc9e};});}else{return{'success':_0x17ac6a,'failure':_0x58508d,'duplicates':_0x5cfc9e};}}})[_0x5eb9('0x13')](respondWithResult(_0x589861,0xc9))[_0x5eb9('0x1c')](handleError(_0x589861,null));};exports[_0x5eb9('0x64')]=function(_0x3e930d,_0x114ee8){var _0x1b6f69;return db['CmContact']['describe']()[_0x5eb9('0x13')](function(_0x44c74f){return db[_0x5eb9('0x1e')][_0x5eb9('0x1f')]({'where':{'id':_0x3e930d[_0x5eb9('0x20')]['id']},'include':[{'model':db[_0x5eb9('0x65')],'as':'Tags','attributes':['id','name',_0x5eb9('0x66')],'required':_0x3e930d['query'][_0x5eb9('0x67')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x5eb9('0x68'),'where':{'CmContactId':_0x3e930d[_0x5eb9('0x20')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x5eb9('0x69')}]}],'order':[db['sequelize'][_0x5eb9('0x6a')](_0x5eb9('0x6b'))],'attributes':_[_0x5eb9('0x22')](_0x44c74f)});})['then'](function(_0xb48a95){if(!_[_0x5eb9('0x57')](_0xb48a95)){_0x1b6f69=_0xb48a95['get']({'plain':!![]});var _0x99a145={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xb48a95&&_0xb48a95[_0x5eb9('0x61')]){if(_0xb48a95[_0x5eb9('0x61')]){_0x99a145[_0x5eb9('0x60')][_0x5eb9('0x6c')]['push']({'ListId':{'$ne':_0xb48a95[_0x5eb9('0x61')]}});}}return db[_0x5eb9('0x29')]['findAll'](_0x99a145);}})['then'](function(_0x5c5244){if(!_[_0x5eb9('0x57')](_0x5c5244)){return _[_0x5eb9('0x6d')](_0x1b6f69,_[_0x5eb9('0x6e')](_0x5c5244,function(_0x4d3f41){return util[_0x5eb9('0x6f')](_0x5eb9('0x70'),_0x4d3f41['id']);}));}})[_0x5eb9('0x13')](handleEntityNotFound(_0x114ee8,null))[_0x5eb9('0x13')](respondWithResult(_0x114ee8,null))[_0x5eb9('0x1c')](handleError(_0x114ee8,null));};exports[_0x5eb9('0x40')]=function(_0x5f2abe,_0x24a0af){var _0x174518;if(_0x5f2abe[_0x5eb9('0x32')]['id']){delete _0x5f2abe['body']['id'];}if(!_[_0x5eb9('0x57')](_0x5f2abe[_0x5eb9('0x32')][_0x5eb9('0x58')])){var _0x35b252=_0x5f2abe[_0x5eb9('0x32')][_0x5eb9('0x58')];if(!_['isNil'](shared['timezones'][_0x35b252]))_0x5f2abe[_0x5eb9('0x32')][_0x5eb9('0x59')]=shared[_0x5eb9('0x71')][_0x35b252][_0x5eb9('0x59')];}return db['CmContact'][_0x5eb9('0x1f')]({'where':{'id':_0x5f2abe[_0x5eb9('0x20')]['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0x24a0af,null))['then'](saveUpdates(_0x5f2abe[_0x5eb9('0x32')],null))[_0x5eb9('0x13')](function(_0x1b8a49){_0x174518=_0x1b8a49;var _0x1b6d58={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1b8a49&&_0x1b8a49[_0x5eb9('0x61')]){if(_0x1b8a49[_0x5eb9('0x61')]){_0x1b6d58[_0x5eb9('0x60')]['$and'][_0x5eb9('0x5f')]({'ListId':{'$ne':_0x1b8a49['ListId']}});}}return db[_0x5eb9('0x29')][_0x5eb9('0x33')](_0x1b6d58);})[_0x5eb9('0x13')](function(_0x1252a7){if(_0x1252a7){return _[_0x5eb9('0x6d')](_['pickBy'](_0x5f2abe[_0x5eb9('0x32')],function(_0x41fb46,_0x36418a){return _['startsWith'](_0x36418a,_0x5eb9('0x25'));}),_[_0x5eb9('0x6e')](_0x1252a7,function(_0x35319a){return util[_0x5eb9('0x6f')](_0x5eb9('0x70'),_0x35319a['id']);}));}})[_0x5eb9('0x13')](function(_0x543f0e){if(_0x543f0e&&!_[_0x5eb9('0x72')](_0x543f0e)){var _0x41f6cc=squel['update']()[_0x5eb9('0x73')]('cm_contacts')[_0x5eb9('0x74')](_0x543f0e)[_0x5eb9('0x60')]('id\x20=\x20?',_0x5f2abe['params']['id'])[_0x5eb9('0x75')]();return db['sequelize'][_0x5eb9('0x27')](_0x41f6cc[_0x5eb9('0x76')],{'replacements':_0x41f6cc['values']});}})['then'](function(){if(_0x5f2abe[_0x5eb9('0x32')][_0x5eb9('0x77')]&&_0x174518){return db[_0x5eb9('0x39')][_0x5eb9('0x40')]({'phone':_0x5f2abe[_0x5eb9('0x32')][_0x5eb9('0x77')],'OrderBy':0x0},{'where':{'ContactId':_0x174518['id']}});}})['then'](function(){return _0x174518;})[_0x5eb9('0x13')](respondWithResult(_0x24a0af,null))[_0x5eb9('0x1c')](handleError(_0x24a0af,null));};exports['getTags']=function(_0x247764,_0x4cba14){var _0x3a8bb4={};var _0x17330f={};var _0x247382;var _0x86a0d;return db['CmContact']['findOne']({'where':{'id':_0x247764[_0x5eb9('0x20')]['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0x4cba14,null))['then'](function(_0x198cea){if(_0x198cea){_0x247382=_0x198cea;_0x17330f['model']=_['keys'](db['Tag']['rawAttributes']);_0x17330f[_0x5eb9('0x27')]=_['keys'](_0x247764[_0x5eb9('0x27')]);_0x17330f[_0x5eb9('0x78')]=_[_0x5eb9('0x79')](_0x17330f[_0x5eb9('0x7a')],_0x17330f['query']);_0x3a8bb4[_0x5eb9('0x7b')]=_[_0x5eb9('0x79')](_0x17330f[_0x5eb9('0x7a')],qs[_0x5eb9('0x7c')](_0x247764[_0x5eb9('0x27')][_0x5eb9('0x7c')]));_0x3a8bb4[_0x5eb9('0x7b')]=_0x3a8bb4[_0x5eb9('0x7b')][_0x5eb9('0x23')]?_0x3a8bb4['attributes']:_0x17330f[_0x5eb9('0x7a')];_0x3a8bb4['order']=qs[_0x5eb9('0x7d')](_0x247764[_0x5eb9('0x27')][_0x5eb9('0x7d')]);_0x3a8bb4[_0x5eb9('0x60')]=qs[_0x5eb9('0x78')](_[_0x5eb9('0x7e')](_0x247764[_0x5eb9('0x27')],_0x17330f[_0x5eb9('0x78')]));if(_0x247764[_0x5eb9('0x27')]['filter']){_0x3a8bb4['where']=_['merge'](_0x3a8bb4[_0x5eb9('0x60')],{'$or':_[_0x5eb9('0x6e')](_0x3a8bb4[_0x5eb9('0x7b')],function(_0x12903d){var _0x3a91dd={};_0x3a91dd[_0x12903d]={'$like':'%'+_0x247764[_0x5eb9('0x27')][_0x5eb9('0x7f')]+'%'};return _0x3a91dd;})});}_0x3a8bb4=_['merge']({},_0x3a8bb4,_0x247764[_0x5eb9('0x80')]);return _0x247382['getTags'](_0x3a8bb4);}})['then'](function(_0x58f409){if(_0x58f409){_0x86a0d=_0x58f409[_0x5eb9('0x23')];if(!_0x247764[_0x5eb9('0x27')]['hasOwnProperty'](_0x5eb9('0x81'))){_0x3a8bb4[_0x5eb9('0x10')]=qs['limit'](_0x247764[_0x5eb9('0x27')][_0x5eb9('0x10')]);_0x3a8bb4['offset']=qs[_0x5eb9('0xe')](_0x247764['query'][_0x5eb9('0xe')]);}return _0x247382['getTags'](_0x3a8bb4);}})[_0x5eb9('0x13')](function(_0x5da203){if(_0x5da203){return _0x5da203?{'count':_0x86a0d,'rows':_0x5da203}:null;}})['then'](respondWithResult(_0x4cba14,null))[_0x5eb9('0x1c')](handleError(_0x4cba14,null));};exports[_0x5eb9('0x82')]=function(_0x1b8eb3,_0xfc423){if(_0x1b8eb3[_0x5eb9('0x32')]['id']){delete _0x1b8eb3[_0x5eb9('0x32')]['id'];}return db[_0x5eb9('0x1e')][_0x5eb9('0x83')]({'where':{'id':_0x1b8eb3['params']['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0xfc423,null))[_0x5eb9('0x13')](function(_0x2d1e70){if(_0x2d1e70){return _0x2d1e70['setTags'](_0x1b8eb3[_0x5eb9('0x32')][_0x5eb9('0x84')]||[]);}return null;})['then'](respondWithResult(_0xfc423,null))[_0x5eb9('0x1c')](handleError(_0xfc423,null));};exports[_0x5eb9('0x85')]=function(_0x542dfa,_0x48e722){var _0x548577=[];_0x548577['push'](addAdditionalPhones(_0x542dfa['body']));Promise[_0x5eb9('0x86')](_0x548577)[_0x5eb9('0x13')](function(){_0x548577=[];_0x548577[_0x5eb9('0x5f')](deleteCmHopperPhones(_0x542dfa['body']['id']));_0x548577['push'](addCmHopperPhones(_0x542dfa[_0x5eb9('0x32')]['id']));Promise[_0x5eb9('0x86')](_0x548577)[_0x5eb9('0x13')](function(){return[0x1];})[_0x5eb9('0x13')](respondWithResult(_0x48e722,null));});};function addAdditionalPhones(_0x3ed1ea){var _0x43fbe3;return new Promise(function(_0x509b4a){return db['CmContactHasItem'][_0x5eb9('0x1d')]({'where':{'CmContactId':_0x3ed1ea['id']}})[_0x5eb9('0x13')](function(){db[_0x5eb9('0x87')][_0x5eb9('0x33')]({'raw':!![],'attributes':['id',_0x5eb9('0x88')]})[_0x5eb9('0x13')](function(_0x579182){var _0x17fc39=[];for(var _0x14d572=0x0;_0x14d572<_0x3ed1ea['items'][_0x5eb9('0x23')];_0x14d572++){var _0x3d76e6=_0x3ed1ea[_0x5eb9('0x89')]?_[_0x5eb9('0x57')](_0x3ed1ea[_0x5eb9('0x89')][_0x14d572])?'':_0x3ed1ea[_0x5eb9('0x89')][_0x14d572]:_0x3ed1ea['items'][_0x14d572][_0x5eb9('0x8a')]?_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572][_0x5eb9('0x8a')]:'';var _0x321928=_['isNil'](_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572]['description'])?'':_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572][_0x5eb9('0x8c')];var _0x183784=_0x3d76e6+':'+_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572][_0x5eb9('0x77')]+'§'+_0x321928;if(_['isNil'](_0x43fbe3))_0x43fbe3=_0x183784;else _0x43fbe3+=';'+_0x183784;var _0x33237e=null;var _0x5ca85d=null;if(_0x3ed1ea['item_types']){if(!_[_0x5eb9('0x57')](_0x3ed1ea[_0x5eb9('0x89')][_0x14d572])){_0x5ca85d=_[_0x5eb9('0x1f')](_0x579182,function(_0x44197a){return _0x44197a['id']===_0x3ed1ea[_0x5eb9('0x89')][_0x14d572];});if(!_[_0x5eb9('0x57')](_0x5ca85d)){_0x33237e=_0x5ca85d[_0x5eb9('0x88')];}}}else{if(!_['isNil'](_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572])){_0x5ca85d=_[_0x5eb9('0x1f')](_0x579182,function(_0x3550b2){return _0x3550b2['id']===_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572]['ItemTypeId'];});if(!_[_0x5eb9('0x57')](_0x5ca85d)){_0x33237e=_0x14d572;}}}if(_['isNil'](_0x33237e)){_0x33237e=0x64;}_0x17fc39['push'](addAdditionalPhone(_0x3ed1ea['id'],_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572][_0x5eb9('0x77')],_0x3ed1ea['item_types']?_['isNil'](_0x3ed1ea[_0x5eb9('0x89')][_0x14d572])?null:_0x3ed1ea[_0x5eb9('0x89')][_0x14d572]:_0x3ed1ea[_0x5eb9('0x8b')][_0x14d572][_0x5eb9('0x8a')]?_0x3ed1ea['items'][_0x14d572][_0x5eb9('0x8a')]:null,_0x33237e,_0x321928));}Promise[_0x5eb9('0x86')](_0x17fc39)[_0x5eb9('0x13')](function(){db['CmContact']['update']({'AdditionalPhones':_0x43fbe3},{'where':{'id':_0x3ed1ea['id']}})['then'](function(){_0x509b4a(0x1);});});});});});}function addAdditionalPhone(_0x1c2f02,_0x21f10f,_0xa5fcaf,_0xb20b1,_0x4045b2){return db[_0x5eb9('0x4a')][_0x5eb9('0x1f')]({'where':{'CmContactId':_0x1c2f02,'item':_0x21f10f}})[_0x5eb9('0x13')](function(_0xc69348){if(_0xc69348)logger[_0x5eb9('0x3a')](_0x5eb9('0x8d'),_0xc69348);else{db[_0x5eb9('0x4a')][_0x5eb9('0x56')]({'CmContactId':_0x1c2f02,'item':_0x21f10f,'ItemTypeId':_0xa5fcaf,'OrderBy':_0xb20b1,'ItemClass':_0x5eb9('0x8e'),'description':_0x4045b2});}});}function deleteCmHopperPhones(_0xfaa274){return new Promise(function(_0x2e1783){return db[_0x5eb9('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xfaa274}})[_0x5eb9('0x13')](function(_0x3c1a3a){db[_0x5eb9('0x8f')][_0x5eb9('0x1d')]({'where':{'CmHopperId':{'$in':_[_0x5eb9('0x6e')](_0x3c1a3a,'id')}}});})['then'](function(){_0x2e1783(0x1);});});}function addCmHopperPhones(_0x3cb022){return new Promise(function(_0x467c43){return db[_0x5eb9('0x39')][_0x5eb9('0x33')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3cb022}})[_0x5eb9('0x13')](function(_0x1763c4){var _0x4f3c98=[];_[_0x5eb9('0x6e')](_0x1763c4,function(_0x534881){_0x4f3c98[_0x5eb9('0x5f')](createCmHopperPhone(_0x3cb022,_0x534881['id']));});Promise[_0x5eb9('0x86')](_0x4f3c98)['then'](function(){_0x467c43(0x1);});});});}function createCmHopperPhone(_0x5c383b,_0x396ede){return new Promise(function(_0x46e626){db['CmContactHasItem'][_0x5eb9('0x33')]({'raw':!![],'attributes':[_0x5eb9('0x90'),_0x5eb9('0x88')],'where':{'CmContactId':_0x5c383b,'ItemClass':_0x5eb9('0x8e')},'include':[{'model':db[_0x5eb9('0x87')],'attributes':[_0x5eb9('0x88')],'as':'ItemType'}],'order':['OrderBy',db[_0x5eb9('0x91')][_0x5eb9('0x6a')](_0x5eb9('0x92'))]})['then'](function(_0x2492d2){var _0x57dda2=0x1;var _0x4d6401=_[_0x5eb9('0x6e')](_0x2492d2,function(_0x31933c){_0x31933c[_0x5eb9('0x93')]=_0x396ede;_0x31933c['phone']=_0x31933c[_0x5eb9('0x90')];_0x31933c[_0x5eb9('0x88')]=_0x57dda2;delete _0x31933c[_0x5eb9('0x94')];_0x57dda2=_0x57dda2+0x1;return _0x31933c;});return db[_0x5eb9('0x8f')][_0x5eb9('0x5b')](_0x4d6401,{});})[_0x5eb9('0x13')](function(){_0x46e626(0x1);});});}function insertAdditionalPhones(_0x6b431d,_0x3865ca){return new Promise(function(_0x3451c8){var _0x58c996=[];for(var _0x285562=0x0;_0x285562<_0x3865ca['length'];_0x285562++){var _0x3751db=_0x3865ca[_0x285562];_0x58c996[_0x5eb9('0x5f')](parseContactItemType(_0x3751db));}Promise[_0x5eb9('0x86')](_0x58c996)[_0x5eb9('0x13')](function(){var _0x18bc36={'id':_0x6b431d['id'],'items':_0x3865ca};return addAdditionalPhones(_0x18bc36)[_0x5eb9('0x13')](function(){return addCmHopperPhones(_0x6b431d['id']);});})[_0x5eb9('0x13')](function(){_0x3451c8(_0x6b431d);});});}function parseContactItemType(_0x4215bc){return new Promise(function(_0x2a35d2){if(_0x4215bc[_0x5eb9('0x30')](_0x5eb9('0x8a'))){_0x2a35d2(_0x4215bc);}else{return db[_0x5eb9('0x87')][_0x5eb9('0x1f')]({'where':{'name':_0x4215bc[_0x5eb9('0x69')]}})[_0x5eb9('0x13')](function(_0x29430f){if(_[_0x5eb9('0x57')](_0x29430f))_0x4215bc[_0x5eb9('0x8a')]=null;else _0x4215bc[_0x5eb9('0x8a')]=_0x29430f['id'];_0x2a35d2(_0x4215bc);});}});}exports['getAdditionalPhones']=function(_0x40e791,_0x158ffd){return db[_0x5eb9('0x4a')][_0x5eb9('0x33')]({'raw':!![],'where':{'CmContactId':_0x40e791[_0x5eb9('0x20')]['id'],'ItemClass':_0x5eb9('0x8e')},'include':[{'model':db[_0x5eb9('0x87')],'as':_0x5eb9('0x69')}],'order':[[_0x5eb9('0x88')],[db[_0x5eb9('0x91')][_0x5eb9('0x6a')](_0x5eb9('0x92'))]]})[_0x5eb9('0x13')](function(_0x25c22f){return _0x25c22f;})[_0x5eb9('0x13')](respondWithResult(_0x158ffd,null))[_0x5eb9('0x1c')](handleError(_0x158ffd,null));};exports['duplicateAdditionalPhones']=function(_0x10f196,_0x4aa0e3){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x10f196['body'][_0x5eb9('0x95')]}})[_0x5eb9('0x13')](function(_0x4da1cd){var _0x4014de=_['map'](_0x4da1cd,function(_0x229f52){_0x229f52[_0x5eb9('0x96')]=_0x10f196[_0x5eb9('0x32')]['toContactId'];return _0x229f52;});return db['CmContactHasItem'][_0x5eb9('0x5b')](_0x4014de,{});})[_0x5eb9('0x13')](function(){return addCmHopperPhones(_0x10f196[_0x5eb9('0x32')]['toContactId']);})['then'](function(){return['ok'];})[_0x5eb9('0x13')](respondWithResult(_0x4aa0e3,null))[_0x5eb9('0x1c')](handleError(_0x4aa0e3,null));};exports[_0x5eb9('0x97')]=function(_0x31729d,_0x4a6449){var _0x581c68=[];_0x581c68[_0x5eb9('0x5f')](createCmHopperPhone(_0x31729d[_0x5eb9('0x32')]['id'],_0x31729d[_0x5eb9('0x32')][_0x5eb9('0x98')]));Promise['all'](_0x581c68)[_0x5eb9('0x13')](function(){return[0x1];})[_0x5eb9('0x13')](respondWithResult(_0x4a6449,null));};exports[_0x5eb9('0x99')]=function(_0x202cd7,_0x24394f){var _0x2a8b7a={'raw':![],'where':{}};var _0x1b59a7={};var _0x2fd5cb={'count':0x0,'rows':[]};return db[_0x5eb9('0x1e')]['findOne']({'where':{'id':_0x202cd7[_0x5eb9('0x20')]['id']}})['then'](handleEntityNotFound(_0x24394f,null))['then'](function(_0x1edf79){if(_0x1edf79){_0x1b59a7['model']=_['keys'](db[_0x5eb9('0x39')][_0x5eb9('0x9a')]);_0x1b59a7[_0x5eb9('0x27')]=_[_0x5eb9('0x22')](_0x202cd7[_0x5eb9('0x27')]);_0x1b59a7[_0x5eb9('0x78')]=_['intersection'](_0x1b59a7[_0x5eb9('0x7a')],_0x1b59a7[_0x5eb9('0x27')]);_0x2a8b7a['attributes']=_[_0x5eb9('0x79')](_0x1b59a7[_0x5eb9('0x7a')],qs['fields'](_0x202cd7['query'][_0x5eb9('0x7c')]));_0x2a8b7a[_0x5eb9('0x7b')]=_0x2a8b7a[_0x5eb9('0x7b')][_0x5eb9('0x23')]?_0x2a8b7a[_0x5eb9('0x7b')]:_0x1b59a7['model'];if(!_0x202cd7['query'][_0x5eb9('0x30')](_0x5eb9('0x81'))){_0x2a8b7a[_0x5eb9('0x10')]=qs[_0x5eb9('0x10')](_0x202cd7[_0x5eb9('0x27')][_0x5eb9('0x10')]);_0x2a8b7a[_0x5eb9('0xe')]=qs[_0x5eb9('0xe')](_0x202cd7[_0x5eb9('0x27')][_0x5eb9('0xe')]);}_0x2a8b7a[_0x5eb9('0x9b')]=qs['sort'](_0x202cd7[_0x5eb9('0x27')][_0x5eb9('0x7d')]);_0x2a8b7a['where']=qs[_0x5eb9('0x78')](_[_0x5eb9('0x7e')](_0x202cd7['query'],_0x1b59a7[_0x5eb9('0x78')]));_0x2a8b7a[_0x5eb9('0x60')][_0x5eb9('0x9c')]=_0x1edf79['id'];if(_0x202cd7[_0x5eb9('0x27')][_0x5eb9('0x7f')]){_0x2a8b7a['where']=_[_0x5eb9('0x31')](_0x2a8b7a[_0x5eb9('0x60')],{'$or':_[_0x5eb9('0x6e')](_0x2a8b7a[_0x5eb9('0x7b')],function(_0x392f8d){var _0x35fd99={};_0x35fd99[_0x392f8d]={'$like':'%'+_0x202cd7[_0x5eb9('0x27')][_0x5eb9('0x7f')]+'%'};return _0x35fd99;})});}_0x2a8b7a=_[_0x5eb9('0x31')]({},_0x2a8b7a,_0x202cd7['options']);return db['CmHopper']['count']({'where':_0x2a8b7a['where']})[_0x5eb9('0x13')](function(_0xd07728){_0x2fd5cb[_0x5eb9('0xf')]=_0xd07728;if(_0x202cd7[_0x5eb9('0x27')][_0x5eb9('0x9d')]){_0x2a8b7a[_0x5eb9('0x9e')]=[{'all':!![]}];}return db[_0x5eb9('0x39')][_0x5eb9('0x33')](_0x2a8b7a);})[_0x5eb9('0x13')](function(_0x27a89e){_0x2fd5cb['rows']=_0x27a89e;return _0x2fd5cb;});}})[_0x5eb9('0x13')](respondWithFilteredResult(_0x24394f,_0x2a8b7a))[_0x5eb9('0x1c')](handleError(_0x24394f,null));};exports[_0x5eb9('0x9f')]=function(_0x268507,_0x33ccde){var _0x40915e={'raw':!![],'where':{}};var _0x2e88da={};var _0x8959b5={'count':0x0,'rows':[]};return db[_0x5eb9('0x1e')][_0x5eb9('0x83')]({'where':{'id':_0x268507[_0x5eb9('0x20')]['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0x33ccde,null))[_0x5eb9('0x13')](function(_0x156cc7){if(_0x156cc7){_0x2e88da[_0x5eb9('0x7a')]=_[_0x5eb9('0x22')](db[_0x5eb9('0x4c')][_0x5eb9('0x9a')]);_0x2e88da['query']=_['keys'](_0x268507[_0x5eb9('0x27')]);_0x2e88da[_0x5eb9('0x78')]=_['intersection'](_0x2e88da[_0x5eb9('0x7a')],_0x2e88da[_0x5eb9('0x27')]);_0x40915e[_0x5eb9('0x7b')]=_[_0x5eb9('0x79')](_0x2e88da['model'],qs[_0x5eb9('0x7c')](_0x268507[_0x5eb9('0x27')][_0x5eb9('0x7c')]));_0x40915e['attributes']=_0x40915e['attributes'][_0x5eb9('0x23')]?_0x40915e[_0x5eb9('0x7b')]:_0x2e88da[_0x5eb9('0x7a')];if(!_0x268507[_0x5eb9('0x27')][_0x5eb9('0x30')](_0x5eb9('0x81'))){_0x40915e[_0x5eb9('0x10')]=qs[_0x5eb9('0x10')](_0x268507['query'][_0x5eb9('0x10')]);_0x40915e['offset']=qs['offset'](_0x268507['query'][_0x5eb9('0xe')]);}_0x40915e[_0x5eb9('0x9b')]=qs['sort'](_0x268507[_0x5eb9('0x27')]['sort']);_0x40915e[_0x5eb9('0x60')]=qs[_0x5eb9('0x78')](_['pick'](_0x268507[_0x5eb9('0x27')],_0x2e88da[_0x5eb9('0x78')]));_0x40915e[_0x5eb9('0x60')][_0x5eb9('0x9c')]=_0x156cc7['id'];if(_0x268507[_0x5eb9('0x27')][_0x5eb9('0x7f')]){_0x40915e['where']=_['merge'](_0x40915e[_0x5eb9('0x60')],{'$or':_['map'](_0x40915e[_0x5eb9('0x7b')],function(_0xea6b74){var _0x54ba07={};_0x54ba07[_0xea6b74]={'$like':'%'+_0x268507[_0x5eb9('0x27')][_0x5eb9('0x7f')]+'%'};return _0x54ba07;})});}_0x40915e=_[_0x5eb9('0x31')]({},_0x40915e,_0x268507['options']);return db[_0x5eb9('0x4c')]['count']({'where':_0x40915e[_0x5eb9('0x60')]})[_0x5eb9('0x13')](function(_0x8cb772){_0x8959b5[_0x5eb9('0xf')]=_0x8cb772;if(_0x268507['query'][_0x5eb9('0x9d')]){_0x40915e[_0x5eb9('0x9e')]=[{'all':!![]}];}return db[_0x5eb9('0x4c')]['findAll'](_0x40915e);})[_0x5eb9('0x13')](function(_0x55df11){_0x8959b5[_0x5eb9('0xa0')]=_0x55df11;return _0x8959b5;});}})['then'](respondWithFilteredResult(_0x33ccde,_0x40915e))['catch'](handleError(_0x33ccde,null));};exports[_0x5eb9('0xa1')]=function(_0x2bb565,_0x5f1ac2){var _0x5df4f4={'raw':!![],'where':{}};var _0x2a6f36={};var _0x486dc3={'count':0x0,'rows':[]};return db[_0x5eb9('0x1e')][_0x5eb9('0x83')]({'where':{'id':_0x2bb565[_0x5eb9('0x20')]['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0x5f1ac2,null))[_0x5eb9('0x13')](function(_0x168235){if(_0x168235){_0x2a6f36[_0x5eb9('0x7a')]=_['keys'](db[_0x5eb9('0x4b')][_0x5eb9('0x9a')]);_0x2a6f36[_0x5eb9('0x27')]=_['keys'](_0x2bb565['query']);_0x2a6f36[_0x5eb9('0x78')]=_['intersection'](_0x2a6f36[_0x5eb9('0x7a')],_0x2a6f36['query']);_0x5df4f4[_0x5eb9('0x7b')]=_[_0x5eb9('0x79')](_0x2a6f36[_0x5eb9('0x7a')],qs[_0x5eb9('0x7c')](_0x2bb565[_0x5eb9('0x27')][_0x5eb9('0x7c')]));_0x5df4f4['attributes']=_0x5df4f4[_0x5eb9('0x7b')][_0x5eb9('0x23')]?_0x5df4f4[_0x5eb9('0x7b')]:_0x2a6f36[_0x5eb9('0x7a')];if(!_0x2bb565[_0x5eb9('0x27')][_0x5eb9('0x30')](_0x5eb9('0x81'))){_0x5df4f4['limit']=qs[_0x5eb9('0x10')](_0x2bb565['query'][_0x5eb9('0x10')]);_0x5df4f4[_0x5eb9('0xe')]=qs['offset'](_0x2bb565['query']['offset']);}_0x5df4f4[_0x5eb9('0x9b')]=qs[_0x5eb9('0x7d')](_0x2bb565[_0x5eb9('0x27')]['sort']);_0x5df4f4[_0x5eb9('0x60')]=qs[_0x5eb9('0x78')](_[_0x5eb9('0x7e')](_0x2bb565['query'],_0x2a6f36[_0x5eb9('0x78')]));_0x5df4f4[_0x5eb9('0x60')]['ContactId']=_0x168235['id'];if(_0x2bb565[_0x5eb9('0x27')][_0x5eb9('0x7f')]){_0x5df4f4[_0x5eb9('0x60')]=_['merge'](_0x5df4f4[_0x5eb9('0x60')],{'$or':_[_0x5eb9('0x6e')](_0x5df4f4[_0x5eb9('0x7b')],function(_0x26814f){var _0x553a00={};_0x553a00[_0x26814f]={'$like':'%'+_0x2bb565['query'][_0x5eb9('0x7f')]+'%'};return _0x553a00;})});}_0x5df4f4=_[_0x5eb9('0x31')]({},_0x5df4f4,_0x2bb565[_0x5eb9('0x80')]);return db[_0x5eb9('0x4b')]['count']({'where':_0x5df4f4[_0x5eb9('0x60')]})['then'](function(_0x4694d7){_0x486dc3['count']=_0x4694d7;if(_0x2bb565['query'][_0x5eb9('0x9d')]){_0x5df4f4['include']=[{'all':!![]}];}return db[_0x5eb9('0x4b')]['findAll'](_0x5df4f4);})['then'](function(_0x14d441){_0x486dc3[_0x5eb9('0xa0')]=_0x14d441;return _0x486dc3;});}})[_0x5eb9('0x13')](respondWithFilteredResult(_0x5f1ac2,_0x5df4f4))[_0x5eb9('0x1c')](handleError(_0x5f1ac2,null));};exports[_0x5eb9('0xa2')]=function(_0x1d7bdf,_0x3b0f27){var _0x36f43d={'raw':!![],'where':{}};var _0xca12c1={};var _0x15fe48={'count':0x0,'rows':[]};return db[_0x5eb9('0x1e')][_0x5eb9('0x83')]({'where':{'id':_0x1d7bdf[_0x5eb9('0x20')]['id']}})['then'](handleEntityNotFound(_0x3b0f27,null))[_0x5eb9('0x13')](function(_0x10a7dc){if(_0x10a7dc){_0xca12c1[_0x5eb9('0x7a')]=_[_0x5eb9('0x22')](db[_0x5eb9('0x54')][_0x5eb9('0x9a')]);_0xca12c1[_0x5eb9('0x27')]=_[_0x5eb9('0x22')](_0x1d7bdf[_0x5eb9('0x27')]);_0xca12c1[_0x5eb9('0x78')]=_['intersection'](_0xca12c1[_0x5eb9('0x7a')],_0xca12c1[_0x5eb9('0x27')]);_0x36f43d[_0x5eb9('0x7b')]=_[_0x5eb9('0x79')](_0xca12c1[_0x5eb9('0x7a')],qs[_0x5eb9('0x7c')](_0x1d7bdf[_0x5eb9('0x27')][_0x5eb9('0x7c')]));_0x36f43d[_0x5eb9('0x7b')]=_0x36f43d[_0x5eb9('0x7b')][_0x5eb9('0x23')]?_0x36f43d[_0x5eb9('0x7b')]:_0xca12c1['model'];if(!_0x1d7bdf[_0x5eb9('0x27')][_0x5eb9('0x30')](_0x5eb9('0x81'))){_0x36f43d['limit']=qs[_0x5eb9('0x10')](_0x1d7bdf[_0x5eb9('0x27')][_0x5eb9('0x10')]);_0x36f43d[_0x5eb9('0xe')]=qs[_0x5eb9('0xe')](_0x1d7bdf[_0x5eb9('0x27')][_0x5eb9('0xe')]);}_0x36f43d[_0x5eb9('0x9b')]=qs[_0x5eb9('0x7d')](_0x1d7bdf['query'][_0x5eb9('0x7d')]);_0x36f43d[_0x5eb9('0x60')]=qs[_0x5eb9('0x78')](_[_0x5eb9('0x7e')](_0x1d7bdf[_0x5eb9('0x27')],_0xca12c1[_0x5eb9('0x78')]));_0x36f43d[_0x5eb9('0x60')][_0x5eb9('0x9c')]=_0x10a7dc['id'];if(_0x1d7bdf['query']['filter']){_0x36f43d[_0x5eb9('0x60')]=_['merge'](_0x36f43d[_0x5eb9('0x60')],{'$or':_[_0x5eb9('0x6e')](_0x36f43d[_0x5eb9('0x7b')],function(_0x28f8a7){var _0x47529d={};_0x47529d[_0x28f8a7]={'$like':'%'+_0x1d7bdf['query']['filter']+'%'};return _0x47529d;})});}_0x36f43d=_[_0x5eb9('0x31')]({},_0x36f43d,_0x1d7bdf['options']);return db[_0x5eb9('0x54')]['count']({'where':_0x36f43d[_0x5eb9('0x60')]})['then'](function(_0x37aff9){_0x15fe48['count']=_0x37aff9;if(_0x1d7bdf[_0x5eb9('0x27')][_0x5eb9('0x9d')]){_0x36f43d[_0x5eb9('0x9e')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x36f43d);})[_0x5eb9('0x13')](function(_0x2a3ab5){_0x15fe48[_0x5eb9('0xa0')]=_0x2a3ab5;return _0x15fe48;});}})[_0x5eb9('0x13')](respondWithFilteredResult(_0x3b0f27,_0x36f43d))[_0x5eb9('0x1c')](handleError(_0x3b0f27,null));};exports[_0x5eb9('0xa3')]=function(_0x3ba9a4,_0x58272e){try{if(!_0x3ba9a4['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0xa4')]){throw new Error(_0x5eb9('0xa5'));}if(!_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0xa6')]){throw new Error(_0x5eb9('0xa7'));}if(!_0x3ba9a4[_0x5eb9('0x32')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x959d8d=_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0xa4')][_0x5eb9('0xa8')](',');var _0x3bd72b=_0x3ba9a4[_0x5eb9('0x32')]['binding_values'][_0x5eb9('0xa8')](',');if(!_0x959d8d[_0x5eb9('0x23')]||!_0x3bd72b[_0x5eb9('0x23')]||_0x959d8d['length']!==_0x3bd72b[_0x5eb9('0x23')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0x7c')]=_['zipObject'](_0x959d8d,_0x3bd72b);if(!_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0x7c')][_0x5eb9('0x77')]){throw new Error(_0x5eb9('0xa9'));}if(!_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0x7c')]['firstName']){throw new Error(_0x5eb9('0xaa'));}var _0xdb7b82=path['join'](config[_0x5eb9('0xab')],'server/files/tmp',_0x3ba9a4[_0x5eb9('0xac')][_0x5eb9('0xad')]);fs[_0x5eb9('0xae')](_0xdb7b82,parseInt(_0x5eb9('0xaf'),0x8));var _0x1b1fd1=require(_0x5eb9('0xb0'))[_0x5eb9('0xb1')](path[_0x5eb9('0x38')](__dirname,_0x5eb9('0xb2')),[_0xdb7b82,_0x3ba9a4[_0x5eb9('0x32')]['binding_keys'],_0x3ba9a4['body'][_0x5eb9('0xa6')],_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0x61')],_0x3ba9a4[_0x5eb9('0x32')]['CompanyId'],_0x3ba9a4[_0x5eb9('0x32')][_0x5eb9('0x5d')],_0x3ba9a4['body'][_0x5eb9('0xb3')]]);return _0x58272e[_0x5eb9('0x14')](0xc8)[_0x5eb9('0xc')]({'message':_0x5eb9('0xb4'),'pid':_0x1b1fd1['pid']});}catch(_0x3d5bb3){return _0x58272e[_0x5eb9('0x14')](0x1f4)['send'](_0x3d5bb3);}};exports[_0x5eb9('0xb5')]=function(_0x3ee98c,_0x5d8bea){var _0x2c63eb=fs[_0x5eb9('0xb6')](_0x3ee98c[_0x5eb9('0xac')]['path']);Papa[_0x5eb9('0xb7')](_0x2c63eb,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0xe866db){return _0x5d8bea[_0x5eb9('0x14')](0xc8)['json']({'file':_0x3ee98c[_0x5eb9('0xac')],'fields':_0xe866db[_0x5eb9('0xb8')]['fields']});}});};exports[_0x5eb9('0xb9')]=function(_0x22cf3c,_0x25ef91){return db[_0x5eb9('0xba')][_0x5eb9('0x33')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5eb9('0xbb')}})[_0x5eb9('0x13')](function(_0x448280){var _0x1bd22b=![];if(!_0x22cf3c[_0x5eb9('0x32')][_0x5eb9('0x61')]){throw new Error(_0x5eb9('0xbc'));}if(!_0x22cf3c['body'][_0x5eb9('0xbd')]['phone']){throw new Error(_0x5eb9('0xa9'));}if(!_0x22cf3c[_0x5eb9('0x32')][_0x5eb9('0xbd')][_0x5eb9('0xbe')]){throw new Error(_0x5eb9('0xaa'));}if(!_0x22cf3c[_0x5eb9('0x32')][_0x5eb9('0xb3')]){throw new Error(_0x5eb9('0xbf'));}var _0xf83ede=require(_0x5eb9('0xb0'))[_0x5eb9('0xb1')](path[_0x5eb9('0x38')](__dirname,_0x5eb9('0xc0')),[_0x22cf3c[_0x5eb9('0x20')]['id'],JSON['stringify'](_0x22cf3c[_0x5eb9('0x32')]),JSON[_0x5eb9('0xc1')](_0x448280)]);_0xf83ede['on'](_0x5eb9('0xc2'),function(){_0x1bd22b=!![];return _0x25ef91[_0x5eb9('0x14')](0xc8)[_0x5eb9('0xc')]({'message':_0x5eb9('0xc3'),'pid':_0xf83ede[_0x5eb9('0xc4')]});});_0xf83ede['on'](_0x5eb9('0xc5'),function(_0x3299df){if(_0x3299df&&!_0x1bd22b){return _0x25ef91[_0x5eb9('0x14')](0x1f4)[_0x5eb9('0xc')]({'message':_0x5eb9('0xc6'),'pid':_0xf83ede['pid']});}});})['catch'](handleError(_0x25ef91,null));};exports[_0x5eb9('0xc7')]=function(_0x101a02,_0x1564af){return db['User'][_0x5eb9('0x33')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5eb9('0xbb')}})[_0x5eb9('0x13')](function(_0x228905){var _0x4b92c4=![];if(!_0x101a02[_0x5eb9('0x32')][_0x5eb9('0x61')]){throw new Error(_0x5eb9('0xbc'));}if(!_0x101a02[_0x5eb9('0x32')][_0x5eb9('0xbd')][_0x5eb9('0x77')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x101a02[_0x5eb9('0x32')][_0x5eb9('0xbd')][_0x5eb9('0xbe')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x101a02[_0x5eb9('0x32')][_0x5eb9('0xb3')]){throw new Error(_0x5eb9('0xbf'));}var _0x1ab86c=require(_0x5eb9('0xb0'))[_0x5eb9('0xb1')](path[_0x5eb9('0x38')](__dirname,_0x5eb9('0xc8')),[_0x101a02[_0x5eb9('0x20')]['id'],JSON[_0x5eb9('0xc1')](_0x101a02['body']),JSON['stringify'](_0x228905)]);_0x1ab86c['on'](_0x5eb9('0xc2'),function(){_0x4b92c4=!![];return _0x1564af['status'](0xc8)[_0x5eb9('0xc')]({'message':_0x5eb9('0xc3'),'pid':_0x1ab86c[_0x5eb9('0xc4')]});});_0x1ab86c['on'](_0x5eb9('0xc5'),function(_0x738790){if(_0x738790&&!_0x4b92c4){return _0x1564af['status'](0x1f4)[_0x5eb9('0xc')]({'message':_0x5eb9('0xc6'),'pid':_0x1ab86c[_0x5eb9('0xc4')]});}});})[_0x5eb9('0x1c')](handleError(_0x1564af,null));};exports['getJourney']=function(_0x55eec5,_0x24e68f){var _0xe0b38b=[_0x5eb9('0xc9'),_0x5eb9('0xca'),_0x5eb9('0xcb'),'openchannel',_0x5eb9('0xcc'),'whatsapp','voice'];var _0x48f79f={'offset':0x0,'order':qs[_0x5eb9('0x7d')](_0x5eb9('0xcd'))},_0x2d70da={'count':0x0,'rows':[]};Promise[_0x5eb9('0xce')]()['then'](function(){if(_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xcf')]){if(!_[_0x5eb9('0xd0')](_0xe0b38b,_0x55eec5['query'][_0x5eb9('0xcf')][_0x5eb9('0xd1')]())){throw new Error(_0x5eb9('0xd2'));}_0xe0b38b=[_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xcf')]['toLowerCase']()];}if(_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xd3')]){try{var _0x46d355=JSON[_0x5eb9('0xb7')](_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xd3')]);if(!moment(_0x46d355['from'])[_0x5eb9('0xd4')]()){throw new Error(_0x5eb9('0xd5'));}if(!moment(_0x46d355['to'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x481147){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x55eec5[_0x5eb9('0x27')]['hasOwnProperty'](_0x5eb9('0x81'))){_0x48f79f[_0x5eb9('0x10')]=qs[_0x5eb9('0x10')](_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0x10')]||0xa);_0x48f79f[_0x5eb9('0xe')]=qs[_0x5eb9('0xe')](_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xe')]);}var _0x403c7f=_0xe0b38b['map'](function(_0x12ad72){if(_0x12ad72===_0x5eb9('0xd6')){var _0x405aa8={'attributes':['id',_0x5eb9('0xd7'),_0x5eb9('0x2c'),_0x5eb9('0xd8'),_0x5eb9('0xd9'),_0x5eb9('0xda'),'starttime',_0x5eb9('0xdb'),_0x5eb9('0xdc'),'note',_0x5eb9('0xdd'),'userDisposition',_0x5eb9('0xde'),_0x5eb9('0xdf'),_0x5eb9('0xe0')],'where':{'ContactId':_0x55eec5[_0x5eb9('0x20')]['id']},'include':[{'model':db['User'],'as':_0x5eb9('0xba'),'attributes':['id',_0x5eb9('0x17'),_0x5eb9('0xe1'),_0x5eb9('0x2b')]}],'order':[[_0x5eb9('0xdd'),_0x5eb9('0xe2')]]};if(_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xd3')]){_0x405aa8[_0x5eb9('0x60')][_0x5eb9('0xdd')]={'$gte':_0x46d355['from'],'$lte':_0x46d355['to']};}return db[_0x5eb9('0x4e')]['findAndCountAll'](_0x405aa8)['then'](function(_0x1789f1){_0x2d70da['count']+=_0x1789f1[_0x5eb9('0xf')];return _['map'](_0x1789f1[_0x5eb9('0xa0')],function(_0x377d12){var _0x4310db=_0x377d12[_0x5eb9('0x35')]({'plain':!![]});_0x4310db[_0x5eb9('0xcf')]=_0x12ad72;if(_0x4310db[_0x5eb9('0xba')]){_0x4310db[_0x5eb9('0xba')]={'id':_0x4310db[_0x5eb9('0xba')]['id'],'name':_0x4310db[_0x5eb9('0xba')]['name'],'fullname':_0x4310db['User'][_0x5eb9('0xe1')],'alias':_0x4310db[_0x5eb9('0xba')]['alias']};}return _0x4310db;});});}else{var _0x4fb5a1=_['startCase'](_0x12ad72)+(_0x12ad72==='chat'?_0x5eb9('0xe3'):_0x5eb9('0xe4'));var _0x17bf30={'attributes':['id',_0x5eb9('0xe5'),_0x5eb9('0xe6'),'createdAt',_0x5eb9('0xe7'),_0x5eb9('0xe8'),_0x5eb9('0xe9'),_0x5eb9('0xea'),'UserId',_0x4fb5a1+'Id'],'where':{'ContactId':_0x55eec5[_0x5eb9('0x20')]['id']},'include':[{'model':db[_0x4fb5a1],'as':_0x5eb9('0xe4'),'attributes':['id','name',_0x5eb9('0xeb')]},{'model':db['User'],'as':_0x5eb9('0xec'),'attributes':['id','name',_0x5eb9('0xe1')]},{'model':db[_0x5eb9('0x65')],'as':_0x5eb9('0xed'),'attributes':['id',_0x5eb9('0x17'),_0x5eb9('0x66')],'through':{'attributes':[]}}],'order':[[_0x5eb9('0xdd'),_0x5eb9('0xe2')]]};if(_0x55eec5[_0x5eb9('0x27')][_0x5eb9('0xd3')]){_0x17bf30[_0x5eb9('0x60')][_0x5eb9('0xdd')]={'$gte':_0x46d355[_0x5eb9('0x34')],'$lte':_0x46d355['to']};}switch(_0x12ad72){case _0x5eb9('0xca'):_0x17bf30[_0x5eb9('0x7b')][_0x5eb9('0x5f')](_0x5eb9('0xee'),_0x5eb9('0xef'),_0x5eb9('0xf0'),_0x5eb9('0xf1'),'osName',_0x5eb9('0xf2'),_0x5eb9('0xf3'),_0x5eb9('0xf4'),_0x5eb9('0xf5'));break;case _0x5eb9('0xc9'):_0x17bf30[_0x5eb9('0x7b')][_0x5eb9('0x5f')](_0x5eb9('0xf6'),_0x5eb9('0xf7'));break;case _0x5eb9('0xf8'):_0x17bf30['attributes'][_0x5eb9('0x5f')]('externalUrl',_0x5eb9('0xf9'));break;}return db[_['startCase'](_0x12ad72)+'Interaction'][_0x5eb9('0xfa')](_0x17bf30)['then'](function(_0x55b6f8){_0x2d70da[_0x5eb9('0xf')]+=_0x55b6f8[_0x5eb9('0xf')];return _[_0x5eb9('0x6e')](_0x55b6f8[_0x5eb9('0xa0')],function(_0x16c7e8){var _0x356a60=_0x16c7e8[_0x5eb9('0x35')]({'plain':!![]});_0x356a60[_0x5eb9('0xcf')]=_0x12ad72;if(_0x356a60[_0x5eb9('0xec')]){_0x356a60[_0x5eb9('0xec')]={'id':_0x356a60[_0x5eb9('0xec')]['id'],'name':_0x356a60[_0x5eb9('0xec')][_0x5eb9('0x17')],'fullname':_0x356a60['Owner'][_0x5eb9('0xe1')]};}return _0x356a60;});});}});return Promise[_0x5eb9('0x86')](_0x403c7f);})[_0x5eb9('0x13')](function(_0x362166){return _(_0x362166)['flatten']()['sortBy'](_0x5eb9('0xdd'))[_0x5eb9('0xfb')]()['value']();})[_0x5eb9('0x13')](function(_0x46f306){_0x2d70da[_0x5eb9('0xa0')]=_0x48f79f[_0x5eb9('0x10')]?_0x46f306[_0x5eb9('0xfc')](_0x48f79f[_0x5eb9('0xe')],_0x48f79f[_0x5eb9('0xe')]+_0x48f79f[_0x5eb9('0x10')]):_0x46f306;return _0x2d70da;})[_0x5eb9('0x13')](respondWithFilteredResult(_0x24e68f,_0x48f79f))['catch'](handleError(_0x24e68f,null));}; \ No newline at end of file +var _0xe6e5=['then','destroy','end','sendStatus','stack','name','send','index','getOptions','findAll','query','catch','CmContact','find','params','describe','tags','keys','cf_','columnName','displayName','analytics','CmCustomField','length','custom','type','values','info','forEach','hasOwnProperty','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','push','contact','all','tag','CmContactHasItem','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','format','pickBy','startsWith','map','cf_%d','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','sequelize','text','phone','getTags','model','rawAttributes','filters','attributes','intersection','fields','order','sort','pick','filter','options','nolimit','offset','setTags','findOne','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','getHoppers','ContactId','include','rows','getHopperHistories','includeAll','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','User','agent','binding','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csvUpdates','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','duration','note','userSecondDisposition','userThirdDisposition','UserId','alias','DESC','createdAt','findAndCountAll','fullname','startCase','chat','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','Tags','browserName','customerPort','deviceModel','referer','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','value','moment','bluebird','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','undefined','count','limit','set','Content-Range','update'];(function(_0x59661a,_0x2d5ce8){var _0x4a216c=function(_0x4c2285){while(--_0x4c2285){_0x59661a['push'](_0x59661a['shift']());}};_0x4a216c(++_0x2d5ce8);}(_0xe6e5,0x1e7));var _0x5e6e=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xe6e5[_0x22b68a];return _0x1ac67a;};'use strict';var moment=require(_0x5e6e('0x0'));var BPromise=require(_0x5e6e('0x1'));var util=require(_0x5e6e('0x2'));var path=require(_0x5e6e('0x3'));var fs=require('fs');var _=require(_0x5e6e('0x4'));var squel=require(_0x5e6e('0x5'));var Papa=require('papaparse');var Redis=require(_0x5e6e('0x6'));var contacts=require(_0x5e6e('0x7'));var qs=require(_0x5e6e('0x8'));var logger=require(_0x5e6e('0x9'))(_0x5e6e('0xa'));var config=require('../../config/environment');var shared=require(_0x5e6e('0xb'));var db=require(_0x5e6e('0xc'))['db'];config[_0x5e6e('0xd')]=_[_0x5e6e('0xe')](config[_0x5e6e('0xd')],{'host':_0x5e6e('0xf'),'port':0x18eb});var socket=require(_0x5e6e('0x10'))(new Redis(config['redis']));require(_0x5e6e('0x11'))[_0x5e6e('0x12')](socket);function respondWithResult(_0x26ea1b,_0x29f03c){_0x29f03c=_0x29f03c||0xc8;return function(_0x5a843c){if(_0x5a843c){return _0x26ea1b[_0x5e6e('0x13')](_0x29f03c)[_0x5e6e('0x14')](_0x5a843c);}};}function respondWithFilteredResult(_0x56ae06,_0x4468f9){return function(_0x5d61bd){if(_0x5d61bd){var _0x31aa86=typeof _0x4468f9['offset']===_0x5e6e('0x15')&&typeof _0x4468f9['limit']==='undefined';var _0x2c2eb3=_0x5d61bd[_0x5e6e('0x16')];var _0x1bce14=_0x31aa86?0x0:_0x4468f9['offset'];var _0x5911b3=_0x31aa86?_0x5d61bd['count']:_0x4468f9['offset']+_0x4468f9[_0x5e6e('0x17')];var _0x221000;if(_0x5911b3>=_0x2c2eb3){_0x5911b3=_0x2c2eb3;_0x221000=0xc8;}else{_0x221000=0xce;}_0x56ae06[_0x5e6e('0x13')](_0x221000);return _0x56ae06[_0x5e6e('0x18')](_0x5e6e('0x19'),_0x1bce14+'-'+_0x5911b3+'/'+_0x2c2eb3)[_0x5e6e('0x14')](_0x5d61bd);}return null;};}function saveUpdates(_0x4ff27d){return function(_0xd07b99){if(_0xd07b99){return _0xd07b99[_0x5e6e('0x1a')](_0x4ff27d)[_0x5e6e('0x1b')](function(_0x2bcd00){return _0x2bcd00;});}return null;};}function removeEntity(_0x4de0b5){return function(_0x45f127){if(_0x45f127){return _0x45f127[_0x5e6e('0x1c')]()['then'](function(){_0x4de0b5[_0x5e6e('0x13')](0xcc)[_0x5e6e('0x1d')]();});}};}function handleEntityNotFound(_0xd7fd83){return function(_0x1e2e41){if(!_0x1e2e41){_0xd7fd83[_0x5e6e('0x1e')](0x194);}return _0x1e2e41;};}function handleError(_0x2ebda7,_0x42810c){_0x42810c=_0x42810c||0x1f4;return function(_0x284ca0){logger['error'](_0x284ca0[_0x5e6e('0x1f')]);if(_0x284ca0[_0x5e6e('0x20')]){delete _0x284ca0['name'];}_0x2ebda7[_0x5e6e('0x13')](_0x42810c)[_0x5e6e('0x21')](_0x284ca0);};}exports[_0x5e6e('0x22')]=function(_0x35bb90,_0x1095c9){var _0x9d79f7={};return contacts['describe']()[_0x5e6e('0x1b')](function(_0x261e8c){_0x9d79f7=qs[_0x5e6e('0x23')](_0x261e8c,_0x35bb90);return contacts[_0x5e6e('0x24')](_0x35bb90[_0x5e6e('0x25')],_0x35bb90['user'],_0x9d79f7,_0x261e8c);})[_0x5e6e('0x1b')](respondWithFilteredResult(_0x1095c9,_0x9d79f7))[_0x5e6e('0x26')](handleError(_0x1095c9,null));};exports[_0x5e6e('0x1c')]=function(_0x25ba8f,_0x532fe6){return db[_0x5e6e('0x27')][_0x5e6e('0x28')]({'where':{'id':_0x25ba8f[_0x5e6e('0x29')]['id']}})[_0x5e6e('0x1b')](handleEntityNotFound(_0x532fe6,null))['then'](removeEntity(_0x532fe6,null))[_0x5e6e('0x26')](handleError(_0x532fe6,null));};exports['describe']=function(_0xf8f7bd,_0x3cc99f){return db[_0x5e6e('0x27')][_0x5e6e('0x2a')]()[_0x5e6e('0x1b')](function(_0x1c1aab){delete _0x1c1aab[_0x5e6e('0x2b')];for(var _0x54ed59=0x0;_0x54ed590x0){return new Promise(function(_0x11803c){var _0x59b145=[];for(var _0x3ac8a5=0x0;_0x3ac8a5<_0x4a7cb5['length'];_0x3ac8a5++){_0x59b145[_0x5e6e('0x62')](insertAdditionalPhones(_0x4a7cb5[_0x3ac8a5][_0x5e6e('0x63')],_0x4a7cb5[_0x3ac8a5][_0x5e6e('0x5b')]));}Promise[_0x5e6e('0x64')](_0x59b145)['then'](function(){_0x11803c(0x1);});})[_0x5e6e('0x1b')](function(){return{'success':_0x14d039,'failure':_0x1dd2b3,'duplicates':_0x10b5f9};});}else{return{'success':_0x14d039,'failure':_0x1dd2b3,'duplicates':_0x10b5f9};}}})[_0x5e6e('0x1b')](respondWithResult(_0x3ce110,0xc9))[_0x5e6e('0x26')](handleError(_0x3ce110,null));};exports['show']=function(_0x53feab,_0x3c702c){var _0x5ee5bf;return db[_0x5e6e('0x27')][_0x5e6e('0x2a')]()[_0x5e6e('0x1b')](function(_0x22f448){return db[_0x5e6e('0x27')][_0x5e6e('0x28')]({'where':{'id':_0x53feab[_0x5e6e('0x29')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5e6e('0x20'),'color'],'required':_0x53feab[_0x5e6e('0x25')][_0x5e6e('0x65')]?!![]:![]},{'model':db[_0x5e6e('0x66')],'as':_0x5e6e('0x67'),'where':{'CmContactId':_0x53feab[_0x5e6e('0x29')]['id']},'required':![],'include':[{'model':db[_0x5e6e('0x68')],'as':_0x5e6e('0x69')}]}],'order':[db['sequelize'][_0x5e6e('0x6a')](_0x5e6e('0x6b'))],'attributes':_[_0x5e6e('0x2c')](_0x22f448)});})[_0x5e6e('0x1b')](function(_0x542797){if(!_['isNil'](_0x542797)){_0x5ee5bf=_0x542797[_0x5e6e('0x3c')]({'plain':!![]});var _0x5cedba={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x542797&&_0x542797[_0x5e6e('0x61')]){if(_0x542797[_0x5e6e('0x61')]){_0x5cedba[_0x5e6e('0x5f')][_0x5e6e('0x6c')][_0x5e6e('0x62')]({'ListId':{'$ne':_0x542797['ListId']}});}}return db['CmCustomField'][_0x5e6e('0x24')](_0x5cedba);}})['then'](function(_0x387866){if(!_[_0x5e6e('0x57')](_0x387866)){return _[_0x5e6e('0x6d')](_0x5ee5bf,_['map'](_0x387866,function(_0x1d791f){return util[_0x5e6e('0x6e')]('cf_%d',_0x1d791f['id']);}));}})[_0x5e6e('0x1b')](handleEntityNotFound(_0x3c702c,null))[_0x5e6e('0x1b')](respondWithResult(_0x3c702c,null))['catch'](handleError(_0x3c702c,null));};exports['update']=function(_0x1ae1e9,_0x284dd3){var _0x1968f7;if(_0x1ae1e9['body']['id']){delete _0x1ae1e9['body']['id'];}if(!_[_0x5e6e('0x57')](_0x1ae1e9[_0x5e6e('0x3a')][_0x5e6e('0x58')])){var _0x4c35a1=_0x1ae1e9['body']['dialTimezone'];if(!_[_0x5e6e('0x57')](shared[_0x5e6e('0x59')][_0x4c35a1]))_0x1ae1e9['body'][_0x5e6e('0x5a')]=shared[_0x5e6e('0x59')][_0x4c35a1]['utcOffset'];}return db[_0x5e6e('0x27')][_0x5e6e('0x28')]({'where':{'id':_0x1ae1e9[_0x5e6e('0x29')]['id']}})[_0x5e6e('0x1b')](handleEntityNotFound(_0x284dd3,null))[_0x5e6e('0x1b')](saveUpdates(_0x1ae1e9[_0x5e6e('0x3a')],null))['then'](function(_0x181e18){_0x1968f7=_0x181e18;var _0x52601e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x181e18&&_0x181e18['ListId']){if(_0x181e18['ListId']){_0x52601e[_0x5e6e('0x5f')][_0x5e6e('0x6c')][_0x5e6e('0x62')]({'ListId':{'$ne':_0x181e18['ListId']}});}}return db[_0x5e6e('0x31')]['findAll'](_0x52601e);})[_0x5e6e('0x1b')](function(_0x487ebe){if(_0x487ebe){return _['omit'](_[_0x5e6e('0x6f')](_0x1ae1e9['body'],function(_0x5956e8,_0x3c8742){return _[_0x5e6e('0x70')](_0x3c8742,_0x5e6e('0x2d'));}),_[_0x5e6e('0x71')](_0x487ebe,function(_0xc31c75){return util['format'](_0x5e6e('0x72'),_0xc31c75['id']);}));}})[_0x5e6e('0x1b')](function(_0x3409f6){if(_0x3409f6&&!_[_0x5e6e('0x73')](_0x3409f6)){var _0x4bba6c=squel['update']()[_0x5e6e('0x74')](_0x5e6e('0x75'))[_0x5e6e('0x76')](_0x3409f6)['where'](_0x5e6e('0x77'),_0x1ae1e9[_0x5e6e('0x29')]['id'])['toParam']();return db[_0x5e6e('0x78')][_0x5e6e('0x25')](_0x4bba6c[_0x5e6e('0x79')],{'replacements':_0x4bba6c[_0x5e6e('0x35')]});}})[_0x5e6e('0x1b')](function(){if(_0x1ae1e9[_0x5e6e('0x3a')][_0x5e6e('0x7a')]&&_0x1968f7){return db[_0x5e6e('0x40')][_0x5e6e('0x1a')]({'phone':_0x1ae1e9[_0x5e6e('0x3a')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x1968f7['id']}});}})[_0x5e6e('0x1b')](function(){return _0x1968f7;})['then'](respondWithResult(_0x284dd3,null))[_0x5e6e('0x26')](handleError(_0x284dd3,null));};exports[_0x5e6e('0x7b')]=function(_0x5685af,_0x3cc68f){var _0x534765={};var _0x2a9c11={};var _0x3ec080;var _0x52b62e;return db[_0x5e6e('0x27')]['findOne']({'where':{'id':_0x5685af[_0x5e6e('0x29')]['id']}})['then'](handleEntityNotFound(_0x3cc68f,null))[_0x5e6e('0x1b')](function(_0x57f834){if(_0x57f834){_0x3ec080=_0x57f834;_0x2a9c11[_0x5e6e('0x7c')]=_['keys'](db['Tag'][_0x5e6e('0x7d')]);_0x2a9c11[_0x5e6e('0x25')]=_[_0x5e6e('0x2c')](_0x5685af[_0x5e6e('0x25')]);_0x2a9c11[_0x5e6e('0x7e')]=_['intersection'](_0x2a9c11[_0x5e6e('0x7c')],_0x2a9c11['query']);_0x534765[_0x5e6e('0x7f')]=_[_0x5e6e('0x80')](_0x2a9c11['model'],qs[_0x5e6e('0x81')](_0x5685af[_0x5e6e('0x25')][_0x5e6e('0x81')]));_0x534765[_0x5e6e('0x7f')]=_0x534765[_0x5e6e('0x7f')][_0x5e6e('0x32')]?_0x534765[_0x5e6e('0x7f')]:_0x2a9c11[_0x5e6e('0x7c')];_0x534765[_0x5e6e('0x82')]=qs[_0x5e6e('0x83')](_0x5685af[_0x5e6e('0x25')][_0x5e6e('0x83')]);_0x534765[_0x5e6e('0x5f')]=qs['filters'](_[_0x5e6e('0x84')](_0x5685af[_0x5e6e('0x25')],_0x2a9c11[_0x5e6e('0x7e')]));if(_0x5685af[_0x5e6e('0x25')][_0x5e6e('0x85')]){_0x534765[_0x5e6e('0x5f')]=_[_0x5e6e('0x39')](_0x534765[_0x5e6e('0x5f')],{'$or':_[_0x5e6e('0x71')](_0x534765[_0x5e6e('0x7f')],function(_0x450eeb){var _0x15915b={};_0x15915b[_0x450eeb]={'$like':'%'+_0x5685af[_0x5e6e('0x25')][_0x5e6e('0x85')]+'%'};return _0x15915b;})});}_0x534765=_['merge']({},_0x534765,_0x5685af[_0x5e6e('0x86')]);return _0x3ec080[_0x5e6e('0x7b')](_0x534765);}})['then'](function(_0x4c9748){if(_0x4c9748){_0x52b62e=_0x4c9748[_0x5e6e('0x32')];if(!_0x5685af[_0x5e6e('0x25')][_0x5e6e('0x38')](_0x5e6e('0x87'))){_0x534765[_0x5e6e('0x17')]=qs[_0x5e6e('0x17')](_0x5685af[_0x5e6e('0x25')]['limit']);_0x534765[_0x5e6e('0x88')]=qs[_0x5e6e('0x88')](_0x5685af[_0x5e6e('0x25')][_0x5e6e('0x88')]);}return _0x3ec080['getTags'](_0x534765);}})[_0x5e6e('0x1b')](function(_0x564eb8){if(_0x564eb8){return _0x564eb8?{'count':_0x52b62e,'rows':_0x564eb8}:null;}})['then'](respondWithResult(_0x3cc68f,null))['catch'](handleError(_0x3cc68f,null));};exports[_0x5e6e('0x89')]=function(_0x9d86e7,_0xc1e91){if(_0x9d86e7[_0x5e6e('0x3a')]['id']){delete _0x9d86e7[_0x5e6e('0x3a')]['id'];}return db[_0x5e6e('0x27')][_0x5e6e('0x8a')]({'where':{'id':_0x9d86e7[_0x5e6e('0x29')]['id']}})[_0x5e6e('0x1b')](handleEntityNotFound(_0xc1e91,null))[_0x5e6e('0x1b')](function(_0x4c2d7a){if(_0x4c2d7a){return _0x4c2d7a[_0x5e6e('0x89')](_0x9d86e7[_0x5e6e('0x3a')]['ids']||[]);}return null;})[_0x5e6e('0x1b')](respondWithResult(_0xc1e91,null))[_0x5e6e('0x26')](handleError(_0xc1e91,null));};exports[_0x5e6e('0x8b')]=function(_0x4747f5,_0x1281f2){var _0x470f7a=[];_0x470f7a[_0x5e6e('0x62')](addAdditionalPhones(_0x4747f5[_0x5e6e('0x3a')]));Promise[_0x5e6e('0x64')](_0x470f7a)['then'](function(){_0x470f7a=[];_0x470f7a[_0x5e6e('0x62')](deleteCmHopperPhones(_0x4747f5[_0x5e6e('0x3a')]['id']));_0x470f7a[_0x5e6e('0x62')](addCmHopperPhones(_0x4747f5['body']['id']));Promise['all'](_0x470f7a)[_0x5e6e('0x1b')](function(){return[0x1];})[_0x5e6e('0x1b')](respondWithResult(_0x1281f2,null));});};function addAdditionalPhones(_0x2c3ae4){var _0xc1f98b;return new Promise(function(_0x27db91){return db[_0x5e6e('0x66')][_0x5e6e('0x1c')]({'where':{'CmContactId':_0x2c3ae4['id']}})['then'](function(){db[_0x5e6e('0x68')][_0x5e6e('0x24')]({'raw':!![],'attributes':['id',_0x5e6e('0x8c')]})['then'](function(_0x5a6365){var _0x3bec26=[];for(var _0x25a071=0x0;_0x25a071<_0x2c3ae4[_0x5e6e('0x8d')][_0x5e6e('0x32')];_0x25a071++){var _0x85b054=_0x2c3ae4[_0x5e6e('0x8e')]?_[_0x5e6e('0x57')](_0x2c3ae4[_0x5e6e('0x8e')][_0x25a071])?'':_0x2c3ae4[_0x5e6e('0x8e')][_0x25a071]:_0x2c3ae4[_0x5e6e('0x8d')][_0x25a071][_0x5e6e('0x8f')]?_0x2c3ae4[_0x5e6e('0x8d')][_0x25a071][_0x5e6e('0x8f')]:'';var _0x56c48a=_['isNil'](_0x2c3ae4['items'][_0x25a071]['description'])?'':_0x2c3ae4['items'][_0x25a071][_0x5e6e('0x90')];var _0x2b9a36=_0x85b054+':'+_0x2c3ae4[_0x5e6e('0x8d')][_0x25a071][_0x5e6e('0x7a')]+'§'+_0x56c48a;if(_['isNil'](_0xc1f98b))_0xc1f98b=_0x2b9a36;else _0xc1f98b+=';'+_0x2b9a36;var _0x2fd32b=null;var _0x148ee1=null;if(_0x2c3ae4[_0x5e6e('0x8e')]){if(!_[_0x5e6e('0x57')](_0x2c3ae4[_0x5e6e('0x8e')][_0x25a071])){_0x148ee1=_['find'](_0x5a6365,function(_0x4e0058){return _0x4e0058['id']===_0x2c3ae4[_0x5e6e('0x8e')][_0x25a071];});if(!_[_0x5e6e('0x57')](_0x148ee1)){_0x2fd32b=_0x148ee1[_0x5e6e('0x8c')];}}}else{if(!_['isNil'](_0x2c3ae4['items'][_0x25a071])){_0x148ee1=_[_0x5e6e('0x28')](_0x5a6365,function(_0x4d499c){return _0x4d499c['id']===_0x2c3ae4[_0x5e6e('0x8d')][_0x25a071]['ItemTypeId'];});if(!_['isNil'](_0x148ee1)){_0x2fd32b=_0x25a071;}}}if(_['isNil'](_0x2fd32b)){_0x2fd32b=0x64;}_0x3bec26[_0x5e6e('0x62')](addAdditionalPhone(_0x2c3ae4['id'],_0x2c3ae4[_0x5e6e('0x8d')][_0x25a071]['phone'],_0x2c3ae4[_0x5e6e('0x8e')]?_[_0x5e6e('0x57')](_0x2c3ae4['item_types'][_0x25a071])?null:_0x2c3ae4[_0x5e6e('0x8e')][_0x25a071]:_0x2c3ae4[_0x5e6e('0x8d')][_0x25a071][_0x5e6e('0x8f')]?_0x2c3ae4['items'][_0x25a071][_0x5e6e('0x8f')]:null,_0x2fd32b,_0x56c48a));}Promise[_0x5e6e('0x64')](_0x3bec26)[_0x5e6e('0x1b')](function(){db[_0x5e6e('0x27')][_0x5e6e('0x1a')]({'AdditionalPhones':_0xc1f98b},{'where':{'id':_0x2c3ae4['id']}})[_0x5e6e('0x1b')](function(){_0x27db91(0x1);});});});});});}function addAdditionalPhone(_0x3599f8,_0x39d093,_0xe96b2e,_0x1030ed,_0x23e691){return db[_0x5e6e('0x66')][_0x5e6e('0x28')]({'where':{'CmContactId':_0x3599f8,'item':_0x39d093}})['then'](function(_0x527c7d){if(_0x527c7d)logger[_0x5e6e('0x36')](_0x5e6e('0x91'),_0x527c7d);else{db[_0x5e6e('0x66')][_0x5e6e('0x44')]({'CmContactId':_0x3599f8,'item':_0x39d093,'ItemTypeId':_0xe96b2e,'OrderBy':_0x1030ed,'ItemClass':_0x5e6e('0x92'),'description':_0x23e691});}});}function deleteCmHopperPhones(_0xd8a1a){return new Promise(function(_0x37d400){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xd8a1a}})[_0x5e6e('0x1b')](function(_0x222c3b){db['CmHopperAdditionalPhone'][_0x5e6e('0x1c')]({'where':{'CmHopperId':{'$in':_['map'](_0x222c3b,'id')}}});})['then'](function(){_0x37d400(0x1);});});}function addCmHopperPhones(_0x48354f){return new Promise(function(_0x1bef9e){return db[_0x5e6e('0x40')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x48354f}})[_0x5e6e('0x1b')](function(_0x45baae){var _0x10a17a=[];_[_0x5e6e('0x71')](_0x45baae,function(_0x36e91e){_0x10a17a['push'](createCmHopperPhone(_0x48354f,_0x36e91e['id']));});Promise[_0x5e6e('0x64')](_0x10a17a)[_0x5e6e('0x1b')](function(){_0x1bef9e(0x1);});});});}function createCmHopperPhone(_0x2603cd,_0x2442d6){return new Promise(function(_0x32762f){db[_0x5e6e('0x66')][_0x5e6e('0x24')]({'raw':!![],'attributes':[_0x5e6e('0x93'),_0x5e6e('0x8c')],'where':{'CmContactId':_0x2603cd,'ItemClass':_0x5e6e('0x92')},'include':[{'model':db[_0x5e6e('0x68')],'attributes':[_0x5e6e('0x8c')],'as':_0x5e6e('0x69')}],'order':[_0x5e6e('0x8c'),db[_0x5e6e('0x78')][_0x5e6e('0x6a')](_0x5e6e('0x94'))]})[_0x5e6e('0x1b')](function(_0x5a0fcb){var _0x10558d=0x1;var _0x55a7a9=_[_0x5e6e('0x71')](_0x5a0fcb,function(_0x45f7ec){_0x45f7ec[_0x5e6e('0x95')]=_0x2442d6;_0x45f7ec[_0x5e6e('0x7a')]=_0x45f7ec[_0x5e6e('0x93')];_0x45f7ec[_0x5e6e('0x8c')]=_0x10558d;delete _0x45f7ec[_0x5e6e('0x96')];_0x10558d=_0x10558d+0x1;return _0x45f7ec;});return db['CmHopperAdditionalPhone'][_0x5e6e('0x5c')](_0x55a7a9,{});})['then'](function(){_0x32762f(0x1);});});}function insertAdditionalPhones(_0x19a67c,_0x15a71a){return new Promise(function(_0x2806a7){var _0x717339=[];for(var _0xf52b4c=0x0;_0xf52b4c<_0x15a71a['length'];_0xf52b4c++){var _0x226c41=_0x15a71a[_0xf52b4c];_0x717339[_0x5e6e('0x62')](parseContactItemType(_0x226c41));}Promise[_0x5e6e('0x64')](_0x717339)[_0x5e6e('0x1b')](function(){var _0x3f8bfb={'id':_0x19a67c['id'],'items':_0x15a71a};return addAdditionalPhones(_0x3f8bfb)[_0x5e6e('0x1b')](function(){return addCmHopperPhones(_0x19a67c['id']);});})[_0x5e6e('0x1b')](function(){_0x2806a7(_0x19a67c);});});}function parseContactItemType(_0x12019d){return new Promise(function(_0x4170ca){if(_0x12019d['hasOwnProperty'](_0x5e6e('0x8f'))){_0x4170ca(_0x12019d);}else{return db[_0x5e6e('0x68')][_0x5e6e('0x28')]({'where':{'name':_0x12019d[_0x5e6e('0x69')]}})[_0x5e6e('0x1b')](function(_0x461bac){if(_['isNil'](_0x461bac))_0x12019d[_0x5e6e('0x8f')]=null;else _0x12019d[_0x5e6e('0x8f')]=_0x461bac['id'];_0x4170ca(_0x12019d);});}});}exports['getAdditionalPhones']=function(_0x415627,_0x32c190){return db['CmContactHasItem'][_0x5e6e('0x24')]({'raw':!![],'where':{'CmContactId':_0x415627[_0x5e6e('0x29')]['id'],'ItemClass':_0x5e6e('0x92')},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[[_0x5e6e('0x8c')],[db[_0x5e6e('0x78')][_0x5e6e('0x6a')](_0x5e6e('0x94'))]]})[_0x5e6e('0x1b')](function(_0x2ce54a){return _0x2ce54a;})[_0x5e6e('0x1b')](respondWithResult(_0x32c190,null))[_0x5e6e('0x26')](handleError(_0x32c190,null));};exports[_0x5e6e('0x97')]=function(_0x4327c6,_0x2184e0){return db[_0x5e6e('0x66')][_0x5e6e('0x24')]({'raw':!![],'where':{'CmContactId':_0x4327c6[_0x5e6e('0x3a')][_0x5e6e('0x98')]}})[_0x5e6e('0x1b')](function(_0x229cc5){var _0x535fe5=_[_0x5e6e('0x71')](_0x229cc5,function(_0x2d9e00){_0x2d9e00[_0x5e6e('0x99')]=_0x4327c6['body']['toContactId'];return _0x2d9e00;});return db[_0x5e6e('0x66')][_0x5e6e('0x5c')](_0x535fe5,{});})[_0x5e6e('0x1b')](function(){return addCmHopperPhones(_0x4327c6[_0x5e6e('0x3a')]['toContactId']);})[_0x5e6e('0x1b')](function(){return['ok'];})['then'](respondWithResult(_0x2184e0,null))[_0x5e6e('0x26')](handleError(_0x2184e0,null));};exports['rescheduleAdditionalPhones']=function(_0x469121,_0x5d3cb8){var _0x1f790c=[];_0x1f790c[_0x5e6e('0x62')](createCmHopperPhone(_0x469121[_0x5e6e('0x3a')]['id'],_0x469121['body']['hopperId']));Promise[_0x5e6e('0x64')](_0x1f790c)['then'](function(){return[0x1];})[_0x5e6e('0x1b')](respondWithResult(_0x5d3cb8,null));};exports[_0x5e6e('0x9a')]=function(_0x2f89f5,_0xd83504){var _0x49cb74={'raw':![],'where':{}};var _0xac6a30={};var _0x1f92f2={'count':0x0,'rows':[]};return db[_0x5e6e('0x27')][_0x5e6e('0x8a')]({'where':{'id':_0x2f89f5[_0x5e6e('0x29')]['id']}})[_0x5e6e('0x1b')](handleEntityNotFound(_0xd83504,null))[_0x5e6e('0x1b')](function(_0x50866b){if(_0x50866b){_0xac6a30[_0x5e6e('0x7c')]=_[_0x5e6e('0x2c')](db[_0x5e6e('0x40')][_0x5e6e('0x7d')]);_0xac6a30[_0x5e6e('0x25')]=_[_0x5e6e('0x2c')](_0x2f89f5[_0x5e6e('0x25')]);_0xac6a30[_0x5e6e('0x7e')]=_[_0x5e6e('0x80')](_0xac6a30['model'],_0xac6a30['query']);_0x49cb74[_0x5e6e('0x7f')]=_[_0x5e6e('0x80')](_0xac6a30[_0x5e6e('0x7c')],qs[_0x5e6e('0x81')](_0x2f89f5[_0x5e6e('0x25')][_0x5e6e('0x81')]));_0x49cb74['attributes']=_0x49cb74[_0x5e6e('0x7f')][_0x5e6e('0x32')]?_0x49cb74[_0x5e6e('0x7f')]:_0xac6a30['model'];if(!_0x2f89f5[_0x5e6e('0x25')][_0x5e6e('0x38')](_0x5e6e('0x87'))){_0x49cb74['limit']=qs['limit'](_0x2f89f5[_0x5e6e('0x25')][_0x5e6e('0x17')]);_0x49cb74[_0x5e6e('0x88')]=qs[_0x5e6e('0x88')](_0x2f89f5[_0x5e6e('0x25')][_0x5e6e('0x88')]);}_0x49cb74[_0x5e6e('0x82')]=qs[_0x5e6e('0x83')](_0x2f89f5[_0x5e6e('0x25')][_0x5e6e('0x83')]);_0x49cb74[_0x5e6e('0x5f')]=qs['filters'](_['pick'](_0x2f89f5[_0x5e6e('0x25')],_0xac6a30[_0x5e6e('0x7e')]));_0x49cb74['where'][_0x5e6e('0x9b')]=_0x50866b['id'];if(_0x2f89f5[_0x5e6e('0x25')]['filter']){_0x49cb74['where']=_[_0x5e6e('0x39')](_0x49cb74['where'],{'$or':_[_0x5e6e('0x71')](_0x49cb74[_0x5e6e('0x7f')],function(_0x2cec97){var _0x3e5ef2={};_0x3e5ef2[_0x2cec97]={'$like':'%'+_0x2f89f5[_0x5e6e('0x25')][_0x5e6e('0x85')]+'%'};return _0x3e5ef2;})});}_0x49cb74=_[_0x5e6e('0x39')]({},_0x49cb74,_0x2f89f5[_0x5e6e('0x86')]);return db[_0x5e6e('0x40')][_0x5e6e('0x16')]({'where':_0x49cb74[_0x5e6e('0x5f')]})[_0x5e6e('0x1b')](function(_0x25932c){_0x1f92f2[_0x5e6e('0x16')]=_0x25932c;if(_0x2f89f5[_0x5e6e('0x25')]['includeAll']){_0x49cb74[_0x5e6e('0x9c')]=[{'all':!![]}];}return db[_0x5e6e('0x40')]['findAll'](_0x49cb74);})[_0x5e6e('0x1b')](function(_0x33cd97){_0x1f92f2[_0x5e6e('0x9d')]=_0x33cd97;return _0x1f92f2;});}})[_0x5e6e('0x1b')](respondWithFilteredResult(_0xd83504,_0x49cb74))[_0x5e6e('0x26')](handleError(_0xd83504,null));};exports[_0x5e6e('0x9e')]=function(_0x127aaa,_0x177a4a){var _0x507b9f={'raw':!![],'where':{}};var _0x591e8f={};var _0x2df9c4={'count':0x0,'rows':[]};return db[_0x5e6e('0x27')][_0x5e6e('0x8a')]({'where':{'id':_0x127aaa[_0x5e6e('0x29')]['id']}})[_0x5e6e('0x1b')](handleEntityNotFound(_0x177a4a,null))[_0x5e6e('0x1b')](function(_0x13ead5){if(_0x13ead5){_0x591e8f[_0x5e6e('0x7c')]=_[_0x5e6e('0x2c')](db[_0x5e6e('0x4e')][_0x5e6e('0x7d')]);_0x591e8f['query']=_[_0x5e6e('0x2c')](_0x127aaa[_0x5e6e('0x25')]);_0x591e8f[_0x5e6e('0x7e')]=_[_0x5e6e('0x80')](_0x591e8f[_0x5e6e('0x7c')],_0x591e8f[_0x5e6e('0x25')]);_0x507b9f[_0x5e6e('0x7f')]=_[_0x5e6e('0x80')](_0x591e8f[_0x5e6e('0x7c')],qs[_0x5e6e('0x81')](_0x127aaa['query'][_0x5e6e('0x81')]));_0x507b9f[_0x5e6e('0x7f')]=_0x507b9f['attributes']['length']?_0x507b9f[_0x5e6e('0x7f')]:_0x591e8f[_0x5e6e('0x7c')];if(!_0x127aaa[_0x5e6e('0x25')][_0x5e6e('0x38')]('nolimit')){_0x507b9f['limit']=qs['limit'](_0x127aaa['query'][_0x5e6e('0x17')]);_0x507b9f[_0x5e6e('0x88')]=qs['offset'](_0x127aaa[_0x5e6e('0x25')][_0x5e6e('0x88')]);}_0x507b9f[_0x5e6e('0x82')]=qs[_0x5e6e('0x83')](_0x127aaa[_0x5e6e('0x25')]['sort']);_0x507b9f[_0x5e6e('0x5f')]=qs[_0x5e6e('0x7e')](_[_0x5e6e('0x84')](_0x127aaa[_0x5e6e('0x25')],_0x591e8f[_0x5e6e('0x7e')]));_0x507b9f[_0x5e6e('0x5f')][_0x5e6e('0x9b')]=_0x13ead5['id'];if(_0x127aaa['query']['filter']){_0x507b9f[_0x5e6e('0x5f')]=_['merge'](_0x507b9f[_0x5e6e('0x5f')],{'$or':_[_0x5e6e('0x71')](_0x507b9f[_0x5e6e('0x7f')],function(_0x3dfd8a){var _0x411469={};_0x411469[_0x3dfd8a]={'$like':'%'+_0x127aaa['query'][_0x5e6e('0x85')]+'%'};return _0x411469;})});}_0x507b9f=_[_0x5e6e('0x39')]({},_0x507b9f,_0x127aaa['options']);return db['CmHopperHistory']['count']({'where':_0x507b9f[_0x5e6e('0x5f')]})[_0x5e6e('0x1b')](function(_0x587587){_0x2df9c4[_0x5e6e('0x16')]=_0x587587;if(_0x127aaa[_0x5e6e('0x25')][_0x5e6e('0x9f')]){_0x507b9f[_0x5e6e('0x9c')]=[{'all':!![]}];}return db[_0x5e6e('0x4e')][_0x5e6e('0x24')](_0x507b9f);})[_0x5e6e('0x1b')](function(_0x416c9d){_0x2df9c4['rows']=_0x416c9d;return _0x2df9c4;});}})['then'](respondWithFilteredResult(_0x177a4a,_0x507b9f))[_0x5e6e('0x26')](handleError(_0x177a4a,null));};exports[_0x5e6e('0xa0')]=function(_0x59746f,_0x331623){var _0x42c130={'raw':!![],'where':{}};var _0x36714a={};var _0x186d5f={'count':0x0,'rows':[]};return db[_0x5e6e('0x27')][_0x5e6e('0x8a')]({'where':{'id':_0x59746f[_0x5e6e('0x29')]['id']}})['then'](handleEntityNotFound(_0x331623,null))[_0x5e6e('0x1b')](function(_0x38e15f){if(_0x38e15f){_0x36714a[_0x5e6e('0x7c')]=_[_0x5e6e('0x2c')](db[_0x5e6e('0x4d')][_0x5e6e('0x7d')]);_0x36714a['query']=_[_0x5e6e('0x2c')](_0x59746f['query']);_0x36714a[_0x5e6e('0x7e')]=_[_0x5e6e('0x80')](_0x36714a[_0x5e6e('0x7c')],_0x36714a[_0x5e6e('0x25')]);_0x42c130['attributes']=_[_0x5e6e('0x80')](_0x36714a[_0x5e6e('0x7c')],qs[_0x5e6e('0x81')](_0x59746f['query'][_0x5e6e('0x81')]));_0x42c130['attributes']=_0x42c130[_0x5e6e('0x7f')][_0x5e6e('0x32')]?_0x42c130[_0x5e6e('0x7f')]:_0x36714a[_0x5e6e('0x7c')];if(!_0x59746f[_0x5e6e('0x25')][_0x5e6e('0x38')](_0x5e6e('0x87'))){_0x42c130[_0x5e6e('0x17')]=qs[_0x5e6e('0x17')](_0x59746f[_0x5e6e('0x25')][_0x5e6e('0x17')]);_0x42c130[_0x5e6e('0x88')]=qs[_0x5e6e('0x88')](_0x59746f['query'][_0x5e6e('0x88')]);}_0x42c130[_0x5e6e('0x82')]=qs[_0x5e6e('0x83')](_0x59746f['query'][_0x5e6e('0x83')]);_0x42c130[_0x5e6e('0x5f')]=qs['filters'](_['pick'](_0x59746f[_0x5e6e('0x25')],_0x36714a[_0x5e6e('0x7e')]));_0x42c130[_0x5e6e('0x5f')][_0x5e6e('0x9b')]=_0x38e15f['id'];if(_0x59746f[_0x5e6e('0x25')][_0x5e6e('0x85')]){_0x42c130[_0x5e6e('0x5f')]=_[_0x5e6e('0x39')](_0x42c130['where'],{'$or':_['map'](_0x42c130[_0x5e6e('0x7f')],function(_0x15ac00){var _0x4a7354={};_0x4a7354[_0x15ac00]={'$like':'%'+_0x59746f[_0x5e6e('0x25')][_0x5e6e('0x85')]+'%'};return _0x4a7354;})});}_0x42c130=_['merge']({},_0x42c130,_0x59746f[_0x5e6e('0x86')]);return db['CmHopperFinal'][_0x5e6e('0x16')]({'where':_0x42c130['where']})[_0x5e6e('0x1b')](function(_0x2e854e){_0x186d5f['count']=_0x2e854e;if(_0x59746f[_0x5e6e('0x25')][_0x5e6e('0x9f')]){_0x42c130[_0x5e6e('0x9c')]=[{'all':!![]}];}return db[_0x5e6e('0x4d')][_0x5e6e('0x24')](_0x42c130);})[_0x5e6e('0x1b')](function(_0x5100b6){_0x186d5f[_0x5e6e('0x9d')]=_0x5100b6;return _0x186d5f;});}})[_0x5e6e('0x1b')](respondWithFilteredResult(_0x331623,_0x42c130))[_0x5e6e('0x26')](handleError(_0x331623,null));};exports[_0x5e6e('0xa1')]=function(_0x27bdf1,_0x1d6f50){var _0x2e9cfb={'raw':!![],'where':{}};var _0x36b8e1={};var _0x2e778b={'count':0x0,'rows':[]};return db[_0x5e6e('0x27')][_0x5e6e('0x8a')]({'where':{'id':_0x27bdf1[_0x5e6e('0x29')]['id']}})[_0x5e6e('0x1b')](handleEntityNotFound(_0x1d6f50,null))[_0x5e6e('0x1b')](function(_0x2bbb8f){if(_0x2bbb8f){_0x36b8e1[_0x5e6e('0x7c')]=_[_0x5e6e('0x2c')](db[_0x5e6e('0xa2')][_0x5e6e('0x7d')]);_0x36b8e1[_0x5e6e('0x25')]=_[_0x5e6e('0x2c')](_0x27bdf1[_0x5e6e('0x25')]);_0x36b8e1[_0x5e6e('0x7e')]=_[_0x5e6e('0x80')](_0x36b8e1[_0x5e6e('0x7c')],_0x36b8e1[_0x5e6e('0x25')]);_0x2e9cfb[_0x5e6e('0x7f')]=_['intersection'](_0x36b8e1[_0x5e6e('0x7c')],qs[_0x5e6e('0x81')](_0x27bdf1[_0x5e6e('0x25')][_0x5e6e('0x81')]));_0x2e9cfb['attributes']=_0x2e9cfb[_0x5e6e('0x7f')]['length']?_0x2e9cfb['attributes']:_0x36b8e1[_0x5e6e('0x7c')];if(!_0x27bdf1['query'][_0x5e6e('0x38')](_0x5e6e('0x87'))){_0x2e9cfb['limit']=qs[_0x5e6e('0x17')](_0x27bdf1[_0x5e6e('0x25')]['limit']);_0x2e9cfb[_0x5e6e('0x88')]=qs[_0x5e6e('0x88')](_0x27bdf1[_0x5e6e('0x25')][_0x5e6e('0x88')]);}_0x2e9cfb[_0x5e6e('0x82')]=qs[_0x5e6e('0x83')](_0x27bdf1[_0x5e6e('0x25')]['sort']);_0x2e9cfb[_0x5e6e('0x5f')]=qs[_0x5e6e('0x7e')](_[_0x5e6e('0x84')](_0x27bdf1[_0x5e6e('0x25')],_0x36b8e1[_0x5e6e('0x7e')]));_0x2e9cfb[_0x5e6e('0x5f')][_0x5e6e('0x9b')]=_0x2bbb8f['id'];if(_0x27bdf1[_0x5e6e('0x25')][_0x5e6e('0x85')]){_0x2e9cfb['where']=_['merge'](_0x2e9cfb[_0x5e6e('0x5f')],{'$or':_['map'](_0x2e9cfb[_0x5e6e('0x7f')],function(_0x21dd8d){var _0xf84ddc={};_0xf84ddc[_0x21dd8d]={'$like':'%'+_0x27bdf1[_0x5e6e('0x25')][_0x5e6e('0x85')]+'%'};return _0xf84ddc;})});}_0x2e9cfb=_['merge']({},_0x2e9cfb,_0x27bdf1[_0x5e6e('0x86')]);return db[_0x5e6e('0xa2')][_0x5e6e('0x16')]({'where':_0x2e9cfb[_0x5e6e('0x5f')]})['then'](function(_0x32c357){_0x2e778b[_0x5e6e('0x16')]=_0x32c357;if(_0x27bdf1[_0x5e6e('0x25')]['includeAll']){_0x2e9cfb['include']=[{'all':!![]}];}return db[_0x5e6e('0xa2')][_0x5e6e('0x24')](_0x2e9cfb);})['then'](function(_0x4b5c1a){_0x2e778b[_0x5e6e('0x9d')]=_0x4b5c1a;return _0x2e778b;});}})[_0x5e6e('0x1b')](respondWithFilteredResult(_0x1d6f50,_0x2e9cfb))['catch'](handleError(_0x1d6f50,null));};exports[_0x5e6e('0xa3')]=function(_0x24a02a,_0x2a3a0a){try{if(!_0x24a02a[_0x5e6e('0x3a')]['ListId']){throw new Error(_0x5e6e('0xa4'));}if(!_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0xa5')]){throw new Error(_0x5e6e('0xa6'));}if(!_0x24a02a['body'][_0x5e6e('0xa7')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x24a02a['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x240222=_0x24a02a[_0x5e6e('0x3a')]['binding_keys'][_0x5e6e('0xa8')](',');var _0x36f584=_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0xa7')][_0x5e6e('0xa8')](',');if(!_0x240222[_0x5e6e('0x32')]||!_0x36f584[_0x5e6e('0x32')]||_0x240222[_0x5e6e('0x32')]!==_0x36f584['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0x81')]=_[_0x5e6e('0xa9')](_0x240222,_0x36f584);if(!_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0x81')][_0x5e6e('0x7a')]){throw new Error(_0x5e6e('0xaa'));}if(!_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0x81')][_0x5e6e('0xab')]){throw new Error(_0x5e6e('0xac'));}var _0x4c3b1a=path[_0x5e6e('0x3e')](config[_0x5e6e('0xad')],_0x5e6e('0xae'),_0x24a02a[_0x5e6e('0xaf')][_0x5e6e('0xb0')]);fs[_0x5e6e('0xb1')](_0x4c3b1a,parseInt(_0x5e6e('0xb2'),0x8));var _0x47c59d=require('child_process')[_0x5e6e('0xb3')](path[_0x5e6e('0x3e')](__dirname,_0x5e6e('0xb4')),[_0x4c3b1a,_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0xa5')],_0x24a02a['body'][_0x5e6e('0xa7')],_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0x61')],_0x24a02a['body']['CompanyId'],_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0x5e')],_0x24a02a[_0x5e6e('0x3a')][_0x5e6e('0xb5')]]);return _0x2a3a0a[_0x5e6e('0x13')](0xc8)[_0x5e6e('0x14')]({'message':_0x5e6e('0xb6'),'pid':_0x47c59d[_0x5e6e('0xb7')]});}catch(_0x21541b){return _0x2a3a0a[_0x5e6e('0x13')](0x1f4)['send'](_0x21541b);}};exports[_0x5e6e('0xb8')]=function(_0x1203f9,_0x163810){var _0x244db9=fs[_0x5e6e('0xb9')](_0x1203f9[_0x5e6e('0xaf')][_0x5e6e('0x3')]);Papa[_0x5e6e('0xba')](_0x244db9,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x45675b){return _0x163810[_0x5e6e('0x13')](0xc8)[_0x5e6e('0x14')]({'file':_0x1203f9[_0x5e6e('0xaf')],'fields':_0x45675b[_0x5e6e('0xbb')]['fields']});}});};exports[_0x5e6e('0xbc')]=function(_0x2b5375,_0x556dac){return db[_0x5e6e('0xbd')][_0x5e6e('0x24')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5e6e('0xbe')}})[_0x5e6e('0x1b')](function(_0x100e20){var _0x4b735a=![];if(!_0x2b5375[_0x5e6e('0x3a')][_0x5e6e('0x61')]){throw new Error(_0x5e6e('0xa4'));}if(!_0x2b5375['body'][_0x5e6e('0xbf')][_0x5e6e('0x7a')]){throw new Error(_0x5e6e('0xaa'));}if(!_0x2b5375[_0x5e6e('0x3a')]['binding'][_0x5e6e('0xab')]){throw new Error(_0x5e6e('0xac'));}if(!_0x2b5375[_0x5e6e('0x3a')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4abd3d=require(_0x5e6e('0xc0'))['fork'](path[_0x5e6e('0x3e')](__dirname,_0x5e6e('0xc1')),[_0x2b5375['params']['id'],JSON[_0x5e6e('0xc2')](_0x2b5375[_0x5e6e('0x3a')]),JSON[_0x5e6e('0xc2')](_0x100e20)]);_0x4abd3d['on'](_0x5e6e('0xc3'),function(){_0x4b735a=!![];return _0x556dac['status'](0xc8)[_0x5e6e('0x14')]({'message':_0x5e6e('0xc4'),'pid':_0x4abd3d[_0x5e6e('0xb7')]});});_0x4abd3d['on'](_0x5e6e('0xc5'),function(_0x30c01e){if(_0x30c01e&&!_0x4b735a){return _0x556dac[_0x5e6e('0x13')](0x1f4)[_0x5e6e('0x14')]({'message':_0x5e6e('0xc6'),'pid':_0x4abd3d[_0x5e6e('0xb7')]});}});})[_0x5e6e('0x26')](handleError(_0x556dac,null));};exports[_0x5e6e('0xc7')]=function(_0x3f210a,_0x5e6339){return db[_0x5e6e('0xbd')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x5e6e('0xbe')}})[_0x5e6e('0x1b')](function(_0xd81a9c){var _0x30fc7e=![];if(!_0x3f210a[_0x5e6e('0x3a')][_0x5e6e('0x61')]){throw new Error('No\x20ListId\x20specified');}if(!_0x3f210a[_0x5e6e('0x3a')][_0x5e6e('0xbf')][_0x5e6e('0x7a')]){throw new Error(_0x5e6e('0xaa'));}if(!_0x3f210a[_0x5e6e('0x3a')][_0x5e6e('0xbf')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x3f210a[_0x5e6e('0x3a')][_0x5e6e('0xb5')]){throw new Error(_0x5e6e('0xc8'));}var _0xb7708e=require(_0x5e6e('0xc0'))[_0x5e6e('0xb3')](path[_0x5e6e('0x3e')](__dirname,_0x5e6e('0xc9')),[_0x3f210a[_0x5e6e('0x29')]['id'],JSON['stringify'](_0x3f210a['body']),JSON['stringify'](_0xd81a9c)]);_0xb7708e['on'](_0x5e6e('0xc3'),function(){_0x30fc7e=!![];return _0x5e6339[_0x5e6e('0x13')](0xc8)['json']({'message':_0x5e6e('0xc4'),'pid':_0xb7708e[_0x5e6e('0xb7')]});});_0xb7708e['on'](_0x5e6e('0xc5'),function(_0x8abdc1){if(_0x8abdc1&&!_0x30fc7e){return _0x5e6339['status'](0x1f4)[_0x5e6e('0x14')]({'message':'error\x20child\x20process','pid':_0xb7708e['pid']});}});})['catch'](handleError(_0x5e6339,null));};exports[_0x5e6e('0xca')]=function(_0x529682,_0x91022d){var _0x203738=[_0x5e6e('0xcb'),'chat',_0x5e6e('0xcc'),_0x5e6e('0xcd'),_0x5e6e('0xce'),_0x5e6e('0xcf'),_0x5e6e('0xd0')];var _0x2f25cb={'offset':0x0,'order':qs['sort'](_0x5e6e('0xd1'))},_0x2c3c75={'count':0x0,'rows':[]};Promise[_0x5e6e('0xd2')]()['then'](function(){if(_0x529682['query'][_0x5e6e('0xd3')]){if(!_[_0x5e6e('0xd4')](_0x203738,_0x529682['query'][_0x5e6e('0xd3')][_0x5e6e('0xd5')]())){throw new Error(_0x5e6e('0xd6'));}_0x203738=[_0x529682['query']['channel']['toLowerCase']()];}if(_0x529682['query'][_0x5e6e('0xd7')]){try{var _0x4ab6f1=JSON[_0x5e6e('0xba')](_0x529682['query'][_0x5e6e('0xd7')]);if(!moment(_0x4ab6f1[_0x5e6e('0x3b')])[_0x5e6e('0xd8')]()){throw new Error(_0x5e6e('0xd9'));}if(!moment(_0x4ab6f1['to'])[_0x5e6e('0xd8')]()){throw new Error(_0x5e6e('0xda'));}}catch(_0x101366){throw new Error(_0x5e6e('0xdb'));}}if(!_0x529682['query'][_0x5e6e('0x38')](_0x5e6e('0x87'))){_0x2f25cb[_0x5e6e('0x17')]=qs[_0x5e6e('0x17')](_0x529682[_0x5e6e('0x25')][_0x5e6e('0x17')]||0xa);_0x2f25cb['offset']=qs[_0x5e6e('0x88')](_0x529682[_0x5e6e('0x25')]['offset']);}var _0x5be6d9=_0x203738['map'](function(_0x43004b){if(_0x43004b===_0x5e6e('0xd0')){var _0x2bb871={'attributes':['id','uniqueid',_0x5e6e('0x34'),_0x5e6e('0xdc'),_0x5e6e('0xdd'),_0x5e6e('0xde'),_0x5e6e('0xdf'),'endtime',_0x5e6e('0xe0'),_0x5e6e('0xe1'),'createdAt','userDisposition',_0x5e6e('0xe2'),_0x5e6e('0xe3'),_0x5e6e('0xe4')],'where':{'ContactId':_0x529682[_0x5e6e('0x29')]['id']},'include':[{'model':db['User'],'as':_0x5e6e('0xbd'),'attributes':['id',_0x5e6e('0x20'),'fullname',_0x5e6e('0xe5')]}],'order':[['createdAt',_0x5e6e('0xe6')]]};if(_0x529682['query'][_0x5e6e('0xd7')]){_0x2bb871[_0x5e6e('0x5f')][_0x5e6e('0xe7')]={'$gte':_0x4ab6f1[_0x5e6e('0x3b')],'$lte':_0x4ab6f1['to']};}return db[_0x5e6e('0x4f')][_0x5e6e('0xe8')](_0x2bb871)['then'](function(_0x4763f8){_0x2c3c75[_0x5e6e('0x16')]+=_0x4763f8[_0x5e6e('0x16')];return _['map'](_0x4763f8[_0x5e6e('0x9d')],function(_0x483e92){var _0x5cc981=_0x483e92[_0x5e6e('0x3c')]({'plain':!![]});_0x5cc981['channel']=_0x43004b;if(_0x5cc981[_0x5e6e('0xbd')]){_0x5cc981[_0x5e6e('0xbd')]={'id':_0x5cc981[_0x5e6e('0xbd')]['id'],'name':_0x5cc981['User']['name'],'fullname':_0x5cc981['User'][_0x5e6e('0xe9')],'alias':_0x5cc981['User'][_0x5e6e('0xe5')]};}return _0x5cc981;});});}else{var _0x3a3e23=_[_0x5e6e('0xea')](_0x43004b)+(_0x43004b===_0x5e6e('0xeb')?_0x5e6e('0xec'):'Account');var _0x1d7cbb={'attributes':['id',_0x5e6e('0xed'),_0x5e6e('0xee'),_0x5e6e('0xe7'),_0x5e6e('0xe1'),_0x5e6e('0xef'),_0x5e6e('0xf0'),_0x5e6e('0xf1'),_0x5e6e('0xe4'),_0x3a3e23+'Id'],'where':{'ContactId':_0x529682['params']['id']},'include':[{'model':db[_0x3a3e23],'as':'Account','attributes':['id',_0x5e6e('0x20'),_0x5e6e('0xf2')]},{'model':db[_0x5e6e('0xbd')],'as':_0x5e6e('0xf3'),'attributes':['id',_0x5e6e('0x20'),_0x5e6e('0xe9')]},{'model':db['Tag'],'as':_0x5e6e('0xf4'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[['createdAt',_0x5e6e('0xe6')]]};if(_0x529682[_0x5e6e('0x25')][_0x5e6e('0xd7')]){_0x1d7cbb[_0x5e6e('0x5f')][_0x5e6e('0xe7')]={'$gte':_0x4ab6f1[_0x5e6e('0x3b')],'$lte':_0x4ab6f1['to']};}switch(_0x43004b){case _0x5e6e('0xeb'):_0x1d7cbb['attributes']['push'](_0x5e6e('0xf5'),'customerIp',_0x5e6e('0xf6'),_0x5e6e('0xf7'),'osName','ratingMessage','ratingType','ratingValue',_0x5e6e('0xf8'));break;case'mail':_0x1d7cbb['attributes'][_0x5e6e('0x62')](_0x5e6e('0xf9'),_0x5e6e('0xfa'));break;case'openchannel':_0x1d7cbb['attributes'][_0x5e6e('0x62')](_0x5e6e('0xfb'),_0x5e6e('0xfc'));break;}return db[_[_0x5e6e('0xea')](_0x43004b)+'Interaction']['findAndCountAll'](_0x1d7cbb)[_0x5e6e('0x1b')](function(_0x416f26){_0x2c3c75['count']+=_0x416f26[_0x5e6e('0x16')];return _[_0x5e6e('0x71')](_0x416f26['rows'],function(_0x572806){var _0x580499=_0x572806[_0x5e6e('0x3c')]({'plain':!![]});_0x580499[_0x5e6e('0xd3')]=_0x43004b;if(_0x580499[_0x5e6e('0xf3')]){_0x580499[_0x5e6e('0xf3')]={'id':_0x580499[_0x5e6e('0xf3')]['id'],'name':_0x580499[_0x5e6e('0xf3')][_0x5e6e('0x20')],'fullname':_0x580499[_0x5e6e('0xf3')]['fullname']};}return _0x580499;});});}});return Promise['all'](_0x5be6d9);})[_0x5e6e('0x1b')](function(_0x2722c9){return _(_0x2722c9)[_0x5e6e('0xfd')]()[_0x5e6e('0xfe')](_0x5e6e('0xe7'))[_0x5e6e('0xff')]()[_0x5e6e('0x100')]();})[_0x5e6e('0x1b')](function(_0x1f6e32){_0x2c3c75['rows']=_0x2f25cb[_0x5e6e('0x17')]?_0x1f6e32['slice'](_0x2f25cb[_0x5e6e('0x88')],_0x2f25cb[_0x5e6e('0x88')]+_0x2f25cb[_0x5e6e('0x17')]):_0x1f6e32;return _0x2c3c75;})['then'](respondWithFilteredResult(_0x91022d,_0x2f25cb))[_0x5e6e('0x26')](handleError(_0x91022d,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index de519e3..fbab246 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x685c=['exports','events','CmContact','remove','emit','hook'];(function(_0x4e421e,_0x1cf50f){var _0x58e0aa=function(_0xf760c0){while(--_0xf760c0){_0x4e421e['push'](_0x4e421e['shift']());}};_0x58e0aa(++_0x1cf50f);}(_0x685c,0xf1));var _0xc685=function(_0x55b684,_0x56ae50){_0x55b684=_0x55b684-0x0;var _0x45cb0f=_0x685c[_0x55b684];return _0x45cb0f;};'use strict';var EventEmitter=require(_0xc685('0x0'));var CmContact=require('../../mysqldb')['db'][_0xc685('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc685('0x2')};function emitEvent(_0x1fe203){return function(_0x34f83c,_0x4e385b,_0x2903b0){CmContactEvents[_0xc685('0x3')](_0x1fe203+':'+_0x34f83c['id'],_0x34f83c);CmContactEvents[_0xc685('0x3')](_0x1fe203,_0x34f83c);_0x2903b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xc685('0x4')](e,emitEvent(event));}}module[_0xc685('0x5')]=CmContactEvents; \ No newline at end of file +var _0x834b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','update'];(function(_0x4cdfb5,_0x58ce18){var _0x5ca496=function(_0x39e67b){while(--_0x39e67b){_0x4cdfb5['push'](_0x4cdfb5['shift']());}};_0x5ca496(++_0x58ce18);}(_0x834b,0xaf));var _0xb834=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x834b[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0xb834('0x0'));var CmContact=require(_0xb834('0x1'))['db'][_0xb834('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb834('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb834('0x4'),'afterDestroy':_0xb834('0x5')};function emitEvent(_0x4d2c26){return function(_0x36a888,_0x13fe96,_0x19f45b){CmContactEvents['emit'](_0x4d2c26+':'+_0x36a888['id'],_0x36a888);CmContactEvents[_0xb834('0x6')](_0x4d2c26,_0x36a888);_0x19f45b(null);};}for(var e in events){if(events[_0xb834('0x7')](e)){var event=events[e];CmContact[_0xb834('0x8')](e,emitEvent(event));}}module[_0xb834('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 86114f3..09a758f 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f3e=['all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','afterCreate','scheduledat','format','isNil','dialTimezone','VoiceQueue','then','timezones','utcOffset','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ret','CmHopper','cmContact,\x20afterCreate\x20','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','create','cmContact','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','destroy','VoiceQueueId','CampaignId','push'];(function(_0x568e0c,_0x5bab3e){var _0x1abdd9=function(_0x1d6d2e){while(--_0x1d6d2e){_0x568e0c['push'](_0x568e0c['shift']());}};_0x1abdd9(++_0x5bab3e);}(_0x6f3e,0x1ad));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe6f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe6f3('0x1'));var moment=require(_0xe6f3('0x2'));var BPromise=require('bluebird');var rp=require(_0xe6f3('0x3'));var fs=require('fs');var path=require(_0xe6f3('0x4'));var rimraf=require(_0xe6f3('0x5'));var config=require(_0xe6f3('0x6'));var shared=require('../../config/environment/shared');var attributes=require(_0xe6f3('0x7'));module[_0xe6f3('0x8')]=function(_0x55671b,_0x39a676){return _0x55671b[_0xe6f3('0x9')](_0xe6f3('0xa'),attributes,{'tableName':_0xe6f3('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xe6f3('0xc')]},{'name':_0xe6f3('0xd'),'fields':[_0xe6f3('0xe'),_0xe6f3('0xf'),_0xe6f3('0xc'),_0xe6f3('0x10'),'fax',_0xe6f3('0x11')],'type':_0xe6f3('0x12')}],'timestamps':!![],'charset':_0xe6f3('0x13'),'collate':_0xe6f3('0x14'),'hooks':{'afterCreate':function(_0x3501f8,_0x592e0c,_0x38cf35){var _0x3bba66=_0x55671b['models'];var _0x1d0fc5=_0x3501f8[_0xe6f3('0x15')]({'plain':!![]});function _0x33eb0e(){return function(_0x32cede){logger[_0xe6f3('0x16')]('cmContact',_0xe6f3('0x17'),util['inspect'](_0x32cede,{'showHidden':![],'depth':null}));};}function _0x5955da(_0x9dc236,_0x225690){var _0x4aeba6=_0x225690['scheduledat']?_0x225690[_0xe6f3('0x18')]:moment()[_0xe6f3('0x19')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2d8d6d,_0x32b05c){if(_[_0xe6f3('0x1a')](_0x225690[_0xe6f3('0x1b')])){_0x2d8d6d({'ret':_0x4aeba6});}else{_0x3bba66[_0xe6f3('0x1c')]['findOne']({'where':{'id':_0x9dc236['id']}})[_0xe6f3('0x1d')](function(_0x175833){if(!_[_0xe6f3('0x1a')](_0x175833)){var _0x335177=_0x175833[_0xe6f3('0x1b')];if(!_[_0xe6f3('0x1a')](_0x335177)){var _0x2e3640=shared[_0xe6f3('0x1e')];var _0x4d6325=_0x2e3640[_0x335177];var _0xf4b607=_0x2e3640[_0x225690[_0xe6f3('0x1b')]];if(!_[_0xe6f3('0x1a')](_0x4d6325)&&!_[_0xe6f3('0x1a')](_0xf4b607)){var _0x3b2fa2=_0x4d6325[_0xe6f3('0x1f')]-_0xf4b607[_0xe6f3('0x1f')];_0x4aeba6=_0x225690[_0xe6f3('0x18')]?_0x225690['scheduledat']:moment();var _0x359b0c=moment(_0x4aeba6)[_0xe6f3('0x20')](_0x3b2fa2,_0xe6f3('0x21'));_0x2d8d6d({'ret':_0x359b0c[_0xe6f3('0x19')](_0xe6f3('0x22'))});}else _0x2d8d6d({'ret':_0x4aeba6});}else _0x2d8d6d({'ret':_0x4aeba6});}else{_0x2d8d6d({'ret':_0x4aeba6});}});}});return 0xa;}var _0x45e234=function(_0x3bdbf6){return new BPromise(function(_0x2cf507,_0x38abff){_0x5955da(_0x3bdbf6,_0x1d0fc5)['then'](function(_0x103d26){_0x1d0fc5['scheduledat']=_0x103d26[_0xe6f3('0x23')];_0x3bba66[_0xe6f3('0x24')]['findOne']({'where':{'phone':_0x1d0fc5[_0xe6f3('0xc')],'VoiceQueueId':_0x3bdbf6['id']}})[_0xe6f3('0x1d')](function(_0x4402c7){if(!_[_0xe6f3('0x1a')](_0x4402c7)){throw new Error(_0xe6f3('0x25')+_0x1d0fc5[_0xe6f3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x3bdbf6['id']);}return _0x3bba66['CmHopper']['create']({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'priority':_0x1d0fc5[_0xe6f3('0x27')]?_0x1d0fc5[_0xe6f3('0x27')]:0x2,'scheduledat':_0x1d0fc5[_0xe6f3('0x18')]?_0x1d0fc5[_0xe6f3('0x18')]:moment()[_0xe6f3('0x19')](_0xe6f3('0x22')),'callback':_0x1d0fc5[_0xe6f3('0x28')]?!![]:![],'callbackuniqueid':_0x1d0fc5[_0xe6f3('0x28')]?_0x1d0fc5[_0xe6f3('0x28')]:undefined,'callbackat':_0x1d0fc5['callbackUniqueid']?moment()[_0xe6f3('0x19')](_0xe6f3('0x22')):undefined,'VoiceQueueId':_0x3bdbf6['id']});})[_0xe6f3('0x29')](function(_0x3f39b6){_0x38abff(_0x3f39b6);});});});};var _0x3c1ac4=function(_0x44755e){return new BPromise(function(_0x698bc,_0x25304c){_0x5955da(_0x44755e,_0x1d0fc5)[_0xe6f3('0x1d')](function(_0x4c7dd2){_0x1d0fc5[_0xe6f3('0x18')]=_0x4c7dd2[_0xe6f3('0x23')];_0x3bba66[_0xe6f3('0x24')][_0xe6f3('0x2a')]({'where':{'phone':_0x1d0fc5[_0xe6f3('0xc')],'VoiceQueueId':_0x44755e['id']}})[_0xe6f3('0x1d')](function(_0x9e6bff){if(!_[_0xe6f3('0x1a')](_0x9e6bff)){throw new Error(_0xe6f3('0x25')+_0x1d0fc5[_0xe6f3('0xc')]+_0xe6f3('0x2b')+_0x44755e['id']);}return _0x3bba66[_0xe6f3('0x2c')][_0xe6f3('0x2a')]({'where':{'calleridnum':_0x1d0fc5['phone'],'VoiceQueueId':_0x44755e['id']}});})[_0xe6f3('0x1d')](function(_0x5d23da){if(!_[_0xe6f3('0x1a')](_0x5d23da)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1d0fc5['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x44755e['id']);}return _0x3bba66[_0xe6f3('0x24')][_0xe6f3('0x2d')]({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'priority':_0x1d0fc5['priority']?_0x1d0fc5['priority']:0x2,'scheduledat':_0x1d0fc5[_0xe6f3('0x18')]?_0x1d0fc5[_0xe6f3('0x18')]:moment()[_0xe6f3('0x19')](_0xe6f3('0x22')),'callback':_0x1d0fc5[_0xe6f3('0x28')]?!![]:![],'callbackuniqueid':_0x1d0fc5[_0xe6f3('0x28')]?_0x1d0fc5[_0xe6f3('0x28')]:undefined,'callbackat':_0x1d0fc5[_0xe6f3('0x28')]?moment()[_0xe6f3('0x19')](_0xe6f3('0x22')):undefined,'VoiceQueueId':_0x44755e['id']});})[_0xe6f3('0x29')](function(_0x5e75af){_0x25304c(_0x5e75af);});});});};function _0x38012e(){return function(_0x4a618e){logger['error'](_0xe6f3('0x2e'),_0xe6f3('0x17'),util[_0xe6f3('0x2f')](_0x4a618e,{'showHidden':![],'depth':null}));};}function _0x4e7b89(_0x4bbe46,_0x9cb891){var _0x2c5031=_0x9cb891[_0xe6f3('0x18')]?_0x9cb891[_0xe6f3('0x18')]:moment()['format'](_0xe6f3('0x22'));return new BPromise(function(_0x5762ec,_0x14e5fe){if(_['isNil'](_0x9cb891['dialTimezone'])){_0x5762ec({'ret':_0x2c5031});}else{_0x3bba66[_0xe6f3('0x30')][_0xe6f3('0x2a')]({'where':{'id':_0x4bbe46['id']}})[_0xe6f3('0x1d')](function(_0x104cf5){if(!_['isNil'](_0x104cf5)){var _0xd1cdfe=_0x104cf5[_0xe6f3('0x1b')];if(!_['isNil'](_0xd1cdfe)){var _0xa43e57=shared[_0xe6f3('0x1e')];var _0x3cf547=_0xa43e57[_0xd1cdfe];var _0x4f1142=_0xa43e57[_0x9cb891['dialTimezone']];if(!_[_0xe6f3('0x1a')](_0x3cf547)&&!_['isNil'](_0x4f1142)){var _0x2719ca=_0x3cf547['utcOffset']-_0x4f1142[_0xe6f3('0x1f')];_0x2c5031=_0x9cb891[_0xe6f3('0x18')]?_0x9cb891['scheduledat']:moment();var _0x5467fd=moment(_0x2c5031)[_0xe6f3('0x20')](_0x2719ca,_0xe6f3('0x21'));_0x5762ec({'ret':_0x5467fd[_0xe6f3('0x19')](_0xe6f3('0x22'))});}else _0x5762ec({'ret':_0x2c5031});}else _0x5762ec({'ret':_0x2c5031});}else{_0x5762ec({'ret':_0x2c5031});}});}});return 0xa;}var _0x132ff6=function(_0x2e629c){return new BPromise(function(_0x12366f,_0x3ba7a1){_0x4e7b89(_0x2e629c,_0x1d0fc5)[_0xe6f3('0x1d')](function(_0x2fd6e5){_0x1d0fc5[_0xe6f3('0x18')]=_0x2fd6e5[_0xe6f3('0x23')];_0x3bba66[_0xe6f3('0x24')][_0xe6f3('0x2a')]({'where':{'phone':_0x1d0fc5[_0xe6f3('0xc')],'CampaignId':_0x2e629c['id']}})['then'](function(_0x1cf9aa){if(!_[_0xe6f3('0x1a')](_0x1cf9aa)){throw new Error(_0xe6f3('0x25')+_0x1d0fc5[_0xe6f3('0xc')]+_0xe6f3('0x31')+_0x2e629c['id']);}return _0x3bba66['CmHopper'][_0xe6f3('0x2d')]({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'priority':_0x1d0fc5[_0xe6f3('0x27')]?_0x1d0fc5[_0xe6f3('0x27')]:0x2,'scheduledat':_0x1d0fc5[_0xe6f3('0x18')]?_0x1d0fc5[_0xe6f3('0x18')]:moment()['format'](_0xe6f3('0x22')),'callback':_0x1d0fc5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1d0fc5[_0xe6f3('0x28')]?_0x1d0fc5['callbackUniqueid']:undefined,'callbackat':_0x1d0fc5[_0xe6f3('0x28')]?moment()[_0xe6f3('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x2e629c['id']});})[_0xe6f3('0x29')](function(_0x20598d){_0x3ba7a1(_0x20598d);});});});};var _0x3364ef=function(_0xf9969){return new BPromise(function(_0x388f5e,_0x2b2bd4){_0x4e7b89(_0xf9969,_0x1d0fc5)['then'](function(_0x214d45){_0x1d0fc5[_0xe6f3('0x18')]=_0x214d45[_0xe6f3('0x23')];_0x3bba66[_0xe6f3('0x24')][_0xe6f3('0x2a')]({'where':{'phone':_0x1d0fc5['phone'],'CampaignId':_0xf9969['id']}})['then'](function(_0x524489){if(!_[_0xe6f3('0x1a')](_0x524489)){throw new Error(_0xe6f3('0x25')+_0x1d0fc5['phone']+_0xe6f3('0x32')+_0xf9969['id']);}return _0x3bba66[_0xe6f3('0x2c')]['findOne']({'where':{'calleridnum':_0x1d0fc5[_0xe6f3('0xc')],'CampaignId':_0xf9969['id']}});})['then'](function(_0x5a41eb){if(!_[_0xe6f3('0x1a')](_0x5a41eb)){throw new Error(_0xe6f3('0x33')+_0x1d0fc5[_0xe6f3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0xf9969['id']);}return _0x3bba66[_0xe6f3('0x24')]['create']({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'priority':_0x1d0fc5[_0xe6f3('0x27')]?_0x1d0fc5[_0xe6f3('0x27')]:0x2,'scheduledat':_0x1d0fc5[_0xe6f3('0x18')]?_0x1d0fc5[_0xe6f3('0x18')]:moment()[_0xe6f3('0x19')](_0xe6f3('0x22')),'callback':_0x1d0fc5[_0xe6f3('0x28')]?!![]:![],'callbackuniqueid':_0x1d0fc5[_0xe6f3('0x28')]?_0x1d0fc5[_0xe6f3('0x28')]:undefined,'callbackat':_0x1d0fc5[_0xe6f3('0x28')]?moment()[_0xe6f3('0x19')](_0xe6f3('0x22')):undefined,'CampaignId':_0xf9969['id']});})[_0xe6f3('0x29')](function(_0x176acb){_0x2b2bd4(_0x176acb);});});});};if(_0x1d0fc5['ListId']){_0x3bba66[_0xe6f3('0x1c')][_0xe6f3('0x34')]({'where':{'type':_0xe6f3('0x35')},'attributes':['id',_0xe6f3('0x36'),_0xe6f3('0x1b')],'include':[{'model':_0x3bba66[_0xe6f3('0x37')],'as':'Lists','where':{'id':_0x1d0fc5['ListId']}}]})[_0xe6f3('0x1d')](function(_0x538699){if(_0x538699){var _0x185f51=[];for(var _0x51ed3a=0x0,_0xb7aadb;_0x51ed3a<_0x538699[_0xe6f3('0x38')];_0x51ed3a+=0x1){_0xb7aadb=_0x538699[_0x51ed3a][_0xe6f3('0x15')]({'plain':!![]});switch(_0xb7aadb[_0xe6f3('0x36')]){case _0xe6f3('0x39'):_0x3c1ac4(_0xb7aadb)['catch'](_0x33eb0e());break;case _0xe6f3('0x3a'):_0x45e234(_0xb7aadb)[_0xe6f3('0x29')](_0x33eb0e());break;default:_0x4e7b89(_0xb7aadb,_0x1d0fc5)[_0xe6f3('0x1d')](function(_0x5d3083){_0x1d0fc5['scheduledat']=_0x5d3083[_0xe6f3('0x23')];_0x3bba66[_0xe6f3('0x24')][_0xe6f3('0x2d')]({'phone':_0x1d0fc5['phone'],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'scheduledat':_0x1d0fc5[_0xe6f3('0x18')]?_0x1d0fc5[_0xe6f3('0x18')]:moment()[_0xe6f3('0x19')](_0xe6f3('0x22')),'priority':_0x1d0fc5['priority']?_0x1d0fc5['priority']:0x2,'callback':_0x1d0fc5[_0xe6f3('0x28')]?!![]:![],'callbackuniqueid':_0x1d0fc5['callbackUniqueid']?_0x1d0fc5['callbackUniqueid']:undefined,'callbackat':_0x1d0fc5[_0xe6f3('0x28')]?moment()[_0xe6f3('0x19')](_0xe6f3('0x22')):undefined,'VoiceQueueId':_0xb7aadb['id']})[_0xe6f3('0x29')](_0x33eb0e());});}}}})[_0xe6f3('0x1d')](function(){return _0x3bba66[_0xe6f3('0x1c')][_0xe6f3('0x34')]({'where':{'type':_0xe6f3('0x35')},'attributes':['id'],'include':[{'model':_0x3bba66[_0xe6f3('0x37')],'as':_0xe6f3('0x3b'),'where':{'id':_0x1d0fc5[_0xe6f3('0x26')]}}]})['then'](function(_0x17e23b){if(_0x17e23b){var _0x66a7d1=[];for(var _0x22a199=0x0,_0x3a84e7;_0x22a199<_0x17e23b['length'];_0x22a199+=0x1){_0x3a84e7=_0x17e23b[_0x22a199][_0xe6f3('0x15')]({'plain':!![]});_0x3bba66[_0xe6f3('0x3c')][_0xe6f3('0x2d')]({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'VoiceQueueId':_0x3a84e7['id']})['catch'](function(_0x1975a9){logger[_0xe6f3('0x16')](_0xe6f3('0x3d'),_0xe6f3('0x17'),_0x1975a9['message']);});}}});})[_0xe6f3('0x1d')](function(){return _0x3bba66[_0xe6f3('0x30')][_0xe6f3('0x34')]({'attributes':['id',_0xe6f3('0x36'),'dialTimezone'],'include':[{'model':_0x3bba66['CmList'],'as':'Lists','where':{'id':_0x1d0fc5['ListId']}}]})[_0xe6f3('0x1d')](function(_0x437b9f){if(_0x437b9f){var _0x54944a=[];for(var _0x131714=0x0,_0x1c86f3;_0x131714<_0x437b9f[_0xe6f3('0x38')];_0x131714+=0x1){_0x1c86f3=_0x437b9f[_0x131714][_0xe6f3('0x15')]({'plain':!![]});switch(_0x1c86f3[_0xe6f3('0x36')]){case'always':_0x3364ef(_0x1c86f3)[_0xe6f3('0x29')](_0x38012e());break;case'onlyIfOpen':_0x132ff6(_0x1c86f3)['catch'](_0x38012e());break;default:_0x3bba66[_0xe6f3('0x24')][_0xe6f3('0x2d')]({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'scheduledat':_0x1d0fc5[_0xe6f3('0x18')]?_0x1d0fc5[_0xe6f3('0x18')]:moment()[_0xe6f3('0x19')](_0xe6f3('0x22')),'priority':_0x1d0fc5['priority']?_0x1d0fc5[_0xe6f3('0x27')]:0x2,'callback':_0x1d0fc5[_0xe6f3('0x28')]?!![]:![],'callbackuniqueid':_0x1d0fc5['callbackUniqueid']?_0x1d0fc5[_0xe6f3('0x28')]:undefined,'callbackat':_0x1d0fc5[_0xe6f3('0x28')]?moment()[_0xe6f3('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1c86f3['id']})[_0xe6f3('0x29')](_0x38012e());}}}});})[_0xe6f3('0x1d')](function(){return _0x3bba66[_0xe6f3('0x30')][_0xe6f3('0x34')]({'attributes':['id'],'include':[{'model':_0x3bba66[_0xe6f3('0x37')],'as':_0xe6f3('0x3b'),'where':{'id':_0x1d0fc5[_0xe6f3('0x26')]}}]})[_0xe6f3('0x1d')](function(_0x51fa56){if(_0x51fa56){var _0x3e4e1f=[];for(var _0x1863a1=0x0,_0xb2a16f;_0x1863a1<_0x51fa56[_0xe6f3('0x38')];_0x1863a1+=0x1){_0xb2a16f=_0x51fa56[_0x1863a1][_0xe6f3('0x15')]({'plain':!![]});_0x3bba66['CmHopperBlack'][_0xe6f3('0x2d')]({'phone':_0x1d0fc5[_0xe6f3('0xc')],'ContactId':_0x1d0fc5['id'],'ListId':_0x1d0fc5[_0xe6f3('0x26')],'CampaignId':_0xb2a16f['id']})[_0xe6f3('0x29')](function(_0x516ae5){logger['error'](_0xe6f3('0x3d'),'afterCreate',_0x516ae5[_0xe6f3('0x3e')]);});}}});})[_0xe6f3('0x1d')](function(){_0x38cf35();})[_0xe6f3('0x29')](function(_0x520378){logger['error'](_0xe6f3('0x3d'),'afterCreate',_0x520378[_0xe6f3('0x3e')]);_0x38cf35(_0x520378);});}else{_0x38cf35(new Error(_0xe6f3('0x3f')));}},'afterDestroy':function(_0x39f0ca,_0x37db56,_0x4d50b0){var _0x44c214=_0x55671b['models'];var _0x210b4f=_0x39f0ca[_0xe6f3('0x15')]({'plain':!![]});return _0x44c214[_0xe6f3('0x24')][_0xe6f3('0x34')]({'raw':!![],'where':{'ListId':_0x210b4f[_0xe6f3('0x26')],'ContactId':_0x210b4f['id']}})[_0xe6f3('0x1d')](function(_0x3d5af0){if(!_['isEmpty'](_0x3d5af0)){var _0x454c4b=[];for(var _0x1ac429=0x0;_0x1ac429<_0x3d5af0['length'];_0x1ac429+=0x1){var _0x585a34=_0x44c214[_0xe6f3('0x24')][_0xe6f3('0x40')]({'where':{'ListId':_0x3d5af0[_0x1ac429][_0xe6f3('0x26')],'ContactId':_0x3d5af0[_0x1ac429]['ContactId'],'VoiceQueueId':_0x3d5af0[_0x1ac429][_0xe6f3('0x41')],'CampaignId':_0x3d5af0[_0x1ac429][_0xe6f3('0x42')]}});_0x454c4b[_0xe6f3('0x43')](_0x585a34);}return BPromise[_0xe6f3('0x44')](_0x454c4b);}})[_0xe6f3('0x1d')](function(_0x1f15b5){logger['info'](_0xe6f3('0x45'),util[_0xe6f3('0x2f')](_0x1f15b5,{'showHidden':![],'depth':null}));_0x4d50b0();})[_0xe6f3('0x29')](function(_0x3c0bc2){logger[_0xe6f3('0x16')](_0xe6f3('0x46'),util['inspect'](_0x3c0bc2,{'showHidden':![],'depth':null}));_0x4d50b0(_0x3c0bc2);});}}});}; \ No newline at end of file +var _0xcbb0=['exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','email','utf8mb4','models','get','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','cmContact','inspect','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','Lists','length','always','onlyIfOpen','outbound','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','dialCheckDuplicateType','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes'];(function(_0x3e9c04,_0x39186c){var _0x504218=function(_0x4f4a1c){while(--_0x4f4a1c){_0x3e9c04['push'](_0x3e9c04['shift']());}};_0x504218(++_0x39186c);}(_0xcbb0,0x8d));var _0x0cbb=function(_0x17cb5a,_0x10f9bb){_0x17cb5a=_0x17cb5a-0x0;var _0x5dbd50=_0xcbb0[_0x17cb5a];return _0x5dbd50;};'use strict';var _=require(_0x0cbb('0x0'));var util=require(_0x0cbb('0x1'));var logger=require('../../config/logger')(_0x0cbb('0x2'));var moment=require(_0x0cbb('0x3'));var BPromise=require(_0x0cbb('0x4'));var rp=require(_0x0cbb('0x5'));var fs=require('fs');var path=require(_0x0cbb('0x6'));var rimraf=require(_0x0cbb('0x7'));var config=require(_0x0cbb('0x8'));var shared=require(_0x0cbb('0x9'));var attributes=require(_0x0cbb('0xa'));module[_0x0cbb('0xb')]=function(_0x2c6b2e,_0xc2d56f){return _0x2c6b2e['define'](_0x0cbb('0xc'),attributes,{'tableName':_0x0cbb('0xd'),'paranoid':!![],'indexes':[{'name':_0x0cbb('0xe'),'fields':[_0x0cbb('0xe')]},{'name':_0x0cbb('0xf'),'fields':[_0x0cbb('0x10'),'lastName','phone',_0x0cbb('0x11'),'fax',_0x0cbb('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x0cbb('0x13'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x3d294c,_0x5c3ade,_0x7c5c4c){var _0xeabfc8=_0x2c6b2e[_0x0cbb('0x14')];var _0x1b6319=_0x3d294c[_0x0cbb('0x15')]({'plain':!![]});function _0x26c67c(){return function(_0x409668){logger['error']('cmContact',_0x0cbb('0x16'),util['inspect'](_0x409668,{'showHidden':![],'depth':null}));};}function _0xfa739b(_0x57ca2c,_0x4c8707){var _0x1f6fdf=_0x4c8707['scheduledat']?_0x4c8707[_0x0cbb('0x17')]:moment()[_0x0cbb('0x18')](_0x0cbb('0x19'));return new BPromise(function(_0x3cc71f,_0x4eb315){if(_[_0x0cbb('0x1a')](_0x4c8707[_0x0cbb('0x1b')])){_0x3cc71f({'ret':_0x1f6fdf});}else{_0xeabfc8['VoiceQueue'][_0x0cbb('0x1c')]({'where':{'id':_0x57ca2c['id']}})[_0x0cbb('0x1d')](function(_0x47b314){if(!_['isNil'](_0x47b314)){var _0x42ec92=_0x47b314['dialTimezone'];if(!_['isNil'](_0x42ec92)){var _0x2f622f=shared['timezones'];var _0x4b740b=_0x2f622f[_0x42ec92];var _0xe171c5=_0x2f622f[_0x4c8707[_0x0cbb('0x1b')]];if(!_[_0x0cbb('0x1a')](_0x4b740b)&&!_[_0x0cbb('0x1a')](_0xe171c5)){var _0x23a064=_0x4b740b[_0x0cbb('0x1e')]-_0xe171c5['utcOffset'];_0x1f6fdf=_0x4c8707[_0x0cbb('0x17')]?_0x4c8707[_0x0cbb('0x17')]:moment();var _0xb948e0=moment(_0x1f6fdf)[_0x0cbb('0x1f')](_0x23a064,_0x0cbb('0x20'));_0x3cc71f({'ret':_0xb948e0['format'](_0x0cbb('0x19'))});}else _0x3cc71f({'ret':_0x1f6fdf});}else _0x3cc71f({'ret':_0x1f6fdf});}else{_0x3cc71f({'ret':_0x1f6fdf});}});}});return 0xa;}var _0x2119da=function(_0x4f638e){return new BPromise(function(_0x50bc5a,_0x32f672){_0xfa739b(_0x4f638e,_0x1b6319)[_0x0cbb('0x1d')](function(_0x48dd8a){_0x1b6319['scheduledat']=_0x48dd8a[_0x0cbb('0x21')];_0xeabfc8['CmHopper'][_0x0cbb('0x1c')]({'where':{'phone':_0x1b6319[_0x0cbb('0xe')],'VoiceQueueId':_0x4f638e['id']}})[_0x0cbb('0x1d')](function(_0x307975){if(!_[_0x0cbb('0x1a')](_0x307975)){throw new Error(_0x0cbb('0x22')+_0x1b6319[_0x0cbb('0xe')]+_0x0cbb('0x23')+_0x4f638e['id']);}return _0xeabfc8[_0x0cbb('0x24')][_0x0cbb('0x25')]({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319[_0x0cbb('0x26')],'priority':_0x1b6319[_0x0cbb('0x27')]?_0x1b6319[_0x0cbb('0x27')]:0x2,'scheduledat':_0x1b6319[_0x0cbb('0x17')]?_0x1b6319['scheduledat']:moment()[_0x0cbb('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1b6319[_0x0cbb('0x28')]?!![]:![],'callbackuniqueid':_0x1b6319[_0x0cbb('0x28')]?_0x1b6319[_0x0cbb('0x28')]:undefined,'callbackat':_0x1b6319[_0x0cbb('0x28')]?moment()[_0x0cbb('0x18')](_0x0cbb('0x19')):undefined,'VoiceQueueId':_0x4f638e['id']});})[_0x0cbb('0x29')](function(_0x354189){_0x32f672(_0x354189);});});});};var _0x3ee6cf=function(_0x46ae91){return new BPromise(function(_0x2bb4db,_0x55e481){_0xfa739b(_0x46ae91,_0x1b6319)[_0x0cbb('0x1d')](function(_0x3bd2d3){_0x1b6319[_0x0cbb('0x17')]=_0x3bd2d3[_0x0cbb('0x21')];_0xeabfc8[_0x0cbb('0x24')]['findOne']({'where':{'phone':_0x1b6319[_0x0cbb('0xe')],'VoiceQueueId':_0x46ae91['id']}})[_0x0cbb('0x1d')](function(_0x5ac666){if(!_[_0x0cbb('0x1a')](_0x5ac666)){throw new Error(_0x0cbb('0x22')+_0x1b6319['phone']+_0x0cbb('0x2a')+_0x46ae91['id']);}return _0xeabfc8[_0x0cbb('0x2b')][_0x0cbb('0x1c')]({'where':{'calleridnum':_0x1b6319['phone'],'VoiceQueueId':_0x46ae91['id']}});})[_0x0cbb('0x1d')](function(_0x5ae2f4){if(!_['isNil'](_0x5ae2f4)){throw new Error(_0x0cbb('0x2c')+_0x1b6319[_0x0cbb('0xe')]+_0x0cbb('0x2d')+_0x46ae91['id']);}return _0xeabfc8[_0x0cbb('0x24')]['create']({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319[_0x0cbb('0x26')],'priority':_0x1b6319['priority']?_0x1b6319[_0x0cbb('0x27')]:0x2,'scheduledat':_0x1b6319[_0x0cbb('0x17')]?_0x1b6319['scheduledat']:moment()[_0x0cbb('0x18')](_0x0cbb('0x19')),'callback':_0x1b6319[_0x0cbb('0x28')]?!![]:![],'callbackuniqueid':_0x1b6319[_0x0cbb('0x28')]?_0x1b6319[_0x0cbb('0x28')]:undefined,'callbackat':_0x1b6319[_0x0cbb('0x28')]?moment()[_0x0cbb('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x46ae91['id']});})[_0x0cbb('0x29')](function(_0x20c5be){_0x55e481(_0x20c5be);});});});};function _0x1dd8e3(){return function(_0x32d4bc){logger[_0x0cbb('0x2e')](_0x0cbb('0x2f'),'afterCreate',util[_0x0cbb('0x30')](_0x32d4bc,{'showHidden':![],'depth':null}));};}function _0x1c1e65(_0x2b0080,_0x471db2){var _0x2c86a7=_0x471db2[_0x0cbb('0x17')]?_0x471db2[_0x0cbb('0x17')]:moment()[_0x0cbb('0x18')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1efbc6,_0x3e4373){if(_[_0x0cbb('0x1a')](_0x471db2[_0x0cbb('0x1b')])){_0x1efbc6({'ret':_0x2c86a7});}else{_0xeabfc8[_0x0cbb('0x31')]['findOne']({'where':{'id':_0x2b0080['id']}})[_0x0cbb('0x1d')](function(_0x315e63){if(!_[_0x0cbb('0x1a')](_0x315e63)){var _0x178e66=_0x315e63['dialTimezone'];if(!_[_0x0cbb('0x1a')](_0x178e66)){var _0x2f7770=shared[_0x0cbb('0x32')];var _0x41e1a7=_0x2f7770[_0x178e66];var _0xf880cd=_0x2f7770[_0x471db2[_0x0cbb('0x1b')]];if(!_[_0x0cbb('0x1a')](_0x41e1a7)&&!_['isNil'](_0xf880cd)){var _0x53b10c=_0x41e1a7[_0x0cbb('0x1e')]-_0xf880cd[_0x0cbb('0x1e')];_0x2c86a7=_0x471db2[_0x0cbb('0x17')]?_0x471db2[_0x0cbb('0x17')]:moment();var _0x3b9c84=moment(_0x2c86a7)[_0x0cbb('0x1f')](_0x53b10c,'minutes');_0x1efbc6({'ret':_0x3b9c84['format'](_0x0cbb('0x19'))});}else _0x1efbc6({'ret':_0x2c86a7});}else _0x1efbc6({'ret':_0x2c86a7});}else{_0x1efbc6({'ret':_0x2c86a7});}});}});return 0xa;}var _0x9faf83=function(_0x163c3c){return new BPromise(function(_0x29d0de,_0x26601f){_0x1c1e65(_0x163c3c,_0x1b6319)['then'](function(_0x39acd4){_0x1b6319['scheduledat']=_0x39acd4[_0x0cbb('0x21')];_0xeabfc8[_0x0cbb('0x24')]['findOne']({'where':{'phone':_0x1b6319[_0x0cbb('0xe')],'CampaignId':_0x163c3c['id']}})[_0x0cbb('0x1d')](function(_0x5d0213){if(!_[_0x0cbb('0x1a')](_0x5d0213)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1b6319['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x163c3c['id']);}return _0xeabfc8['CmHopper']['create']({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319['ListId'],'priority':_0x1b6319[_0x0cbb('0x27')]?_0x1b6319[_0x0cbb('0x27')]:0x2,'scheduledat':_0x1b6319['scheduledat']?_0x1b6319[_0x0cbb('0x17')]:moment()[_0x0cbb('0x18')](_0x0cbb('0x19')),'callback':_0x1b6319[_0x0cbb('0x28')]?!![]:![],'callbackuniqueid':_0x1b6319[_0x0cbb('0x28')]?_0x1b6319['callbackUniqueid']:undefined,'callbackat':_0x1b6319['callbackUniqueid']?moment()['format'](_0x0cbb('0x19')):undefined,'CampaignId':_0x163c3c['id']});})[_0x0cbb('0x29')](function(_0x20747a){_0x26601f(_0x20747a);});});});};var _0x9662d7=function(_0x591ac8){return new BPromise(function(_0x44490f,_0x26b2e4){_0x1c1e65(_0x591ac8,_0x1b6319)[_0x0cbb('0x1d')](function(_0x31969f){_0x1b6319[_0x0cbb('0x17')]=_0x31969f[_0x0cbb('0x21')];_0xeabfc8['CmHopper'][_0x0cbb('0x1c')]({'where':{'phone':_0x1b6319[_0x0cbb('0xe')],'CampaignId':_0x591ac8['id']}})[_0x0cbb('0x1d')](function(_0x83318c){if(!_['isNil'](_0x83318c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1b6319[_0x0cbb('0xe')]+_0x0cbb('0x33')+_0x591ac8['id']);}return _0xeabfc8[_0x0cbb('0x2b')][_0x0cbb('0x1c')]({'where':{'calleridnum':_0x1b6319[_0x0cbb('0xe')],'CampaignId':_0x591ac8['id']}});})['then'](function(_0x1971cb){if(!_[_0x0cbb('0x1a')](_0x1971cb)){throw new Error(_0x0cbb('0x2c')+_0x1b6319[_0x0cbb('0xe')]+_0x0cbb('0x34')+_0x591ac8['id']);}return _0xeabfc8[_0x0cbb('0x24')][_0x0cbb('0x25')]({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319['ListId'],'priority':_0x1b6319[_0x0cbb('0x27')]?_0x1b6319[_0x0cbb('0x27')]:0x2,'scheduledat':_0x1b6319[_0x0cbb('0x17')]?_0x1b6319[_0x0cbb('0x17')]:moment()['format'](_0x0cbb('0x19')),'callback':_0x1b6319[_0x0cbb('0x28')]?!![]:![],'callbackuniqueid':_0x1b6319['callbackUniqueid']?_0x1b6319[_0x0cbb('0x28')]:undefined,'callbackat':_0x1b6319['callbackUniqueid']?moment()['format'](_0x0cbb('0x19')):undefined,'CampaignId':_0x591ac8['id']});})['catch'](function(_0x57bef1){_0x26b2e4(_0x57bef1);});});});};if(_0x1b6319['ListId']){_0xeabfc8[_0x0cbb('0x35')][_0x0cbb('0x36')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x0cbb('0x1b')],'include':[{'model':_0xeabfc8['CmList'],'as':_0x0cbb('0x37'),'where':{'id':_0x1b6319['ListId']}}]})[_0x0cbb('0x1d')](function(_0x10fcbd){if(_0x10fcbd){var _0x3e8219=[];for(var _0x220040=0x0,_0x59b066;_0x220040<_0x10fcbd[_0x0cbb('0x38')];_0x220040+=0x1){_0x59b066=_0x10fcbd[_0x220040]['get']({'plain':!![]});switch(_0x59b066['dialCheckDuplicateType']){case _0x0cbb('0x39'):_0x3ee6cf(_0x59b066)[_0x0cbb('0x29')](_0x26c67c());break;case _0x0cbb('0x3a'):_0x2119da(_0x59b066)[_0x0cbb('0x29')](_0x26c67c());break;default:_0x1c1e65(_0x59b066,_0x1b6319)[_0x0cbb('0x1d')](function(_0x160538){_0x1b6319[_0x0cbb('0x17')]=_0x160538['ret'];_0xeabfc8[_0x0cbb('0x24')][_0x0cbb('0x25')]({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319[_0x0cbb('0x26')],'scheduledat':_0x1b6319[_0x0cbb('0x17')]?_0x1b6319[_0x0cbb('0x17')]:moment()[_0x0cbb('0x18')](_0x0cbb('0x19')),'priority':_0x1b6319['priority']?_0x1b6319['priority']:0x2,'callback':_0x1b6319[_0x0cbb('0x28')]?!![]:![],'callbackuniqueid':_0x1b6319[_0x0cbb('0x28')]?_0x1b6319[_0x0cbb('0x28')]:undefined,'callbackat':_0x1b6319['callbackUniqueid']?moment()[_0x0cbb('0x18')](_0x0cbb('0x19')):undefined,'VoiceQueueId':_0x59b066['id']})['catch'](_0x26c67c());});}}}})[_0x0cbb('0x1d')](function(){return _0xeabfc8[_0x0cbb('0x35')][_0x0cbb('0x36')]({'where':{'type':_0x0cbb('0x3b')},'attributes':['id'],'include':[{'model':_0xeabfc8[_0x0cbb('0x3c')],'as':_0x0cbb('0x3d'),'where':{'id':_0x1b6319[_0x0cbb('0x26')]}}]})['then'](function(_0x1829b1){if(_0x1829b1){var _0xeeab7f=[];for(var _0x533ce6=0x0,_0x2f0f59;_0x533ce6<_0x1829b1['length'];_0x533ce6+=0x1){_0x2f0f59=_0x1829b1[_0x533ce6]['get']({'plain':!![]});_0xeabfc8[_0x0cbb('0x3e')][_0x0cbb('0x25')]({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319[_0x0cbb('0x26')],'VoiceQueueId':_0x2f0f59['id']})['catch'](function(_0x4c2bad){logger[_0x0cbb('0x2e')](_0x0cbb('0x3f'),_0x0cbb('0x16'),_0x4c2bad[_0x0cbb('0x40')]);});}}});})[_0x0cbb('0x1d')](function(){return _0xeabfc8[_0x0cbb('0x31')]['findAll']({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0xeabfc8['CmList'],'as':_0x0cbb('0x37'),'where':{'id':_0x1b6319[_0x0cbb('0x26')]}}]})['then'](function(_0x392663){if(_0x392663){var _0x169b14=[];for(var _0x40f768=0x0,_0x2d3f97;_0x40f768<_0x392663[_0x0cbb('0x38')];_0x40f768+=0x1){_0x2d3f97=_0x392663[_0x40f768][_0x0cbb('0x15')]({'plain':!![]});switch(_0x2d3f97[_0x0cbb('0x41')]){case'always':_0x9662d7(_0x2d3f97)[_0x0cbb('0x29')](_0x1dd8e3());break;case _0x0cbb('0x3a'):_0x9faf83(_0x2d3f97)[_0x0cbb('0x29')](_0x1dd8e3());break;default:_0xeabfc8[_0x0cbb('0x24')][_0x0cbb('0x25')]({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319[_0x0cbb('0x26')],'scheduledat':_0x1b6319['scheduledat']?_0x1b6319['scheduledat']:moment()[_0x0cbb('0x18')](_0x0cbb('0x19')),'priority':_0x1b6319[_0x0cbb('0x27')]?_0x1b6319[_0x0cbb('0x27')]:0x2,'callback':_0x1b6319[_0x0cbb('0x28')]?!![]:![],'callbackuniqueid':_0x1b6319[_0x0cbb('0x28')]?_0x1b6319[_0x0cbb('0x28')]:undefined,'callbackat':_0x1b6319[_0x0cbb('0x28')]?moment()[_0x0cbb('0x18')](_0x0cbb('0x19')):undefined,'CampaignId':_0x2d3f97['id']})[_0x0cbb('0x29')](_0x1dd8e3());}}}});})[_0x0cbb('0x1d')](function(){return _0xeabfc8[_0x0cbb('0x31')][_0x0cbb('0x36')]({'attributes':['id'],'include':[{'model':_0xeabfc8[_0x0cbb('0x3c')],'as':'BlackLists','where':{'id':_0x1b6319[_0x0cbb('0x26')]}}]})[_0x0cbb('0x1d')](function(_0xaf748b){if(_0xaf748b){var _0x5228bf=[];for(var _0x3e30ee=0x0,_0x11907b;_0x3e30ee<_0xaf748b[_0x0cbb('0x38')];_0x3e30ee+=0x1){_0x11907b=_0xaf748b[_0x3e30ee][_0x0cbb('0x15')]({'plain':!![]});_0xeabfc8[_0x0cbb('0x3e')]['create']({'phone':_0x1b6319[_0x0cbb('0xe')],'ContactId':_0x1b6319['id'],'ListId':_0x1b6319[_0x0cbb('0x26')],'CampaignId':_0x11907b['id']})[_0x0cbb('0x29')](function(_0x688e65){logger[_0x0cbb('0x2e')](_0x0cbb('0x3f'),_0x0cbb('0x16'),_0x688e65[_0x0cbb('0x40')]);});}}});})[_0x0cbb('0x1d')](function(){_0x7c5c4c();})['catch'](function(_0x1727f5){logger['error'](_0x0cbb('0x3f'),_0x0cbb('0x16'),_0x1727f5[_0x0cbb('0x40')]);_0x7c5c4c(_0x1727f5);});}else{_0x7c5c4c(new Error(_0x0cbb('0x42')));}},'afterDestroy':function(_0x23ae16,_0x59e491,_0x192a88){var _0xed1a9e=_0x2c6b2e[_0x0cbb('0x14')];var _0x124c9f=_0x23ae16[_0x0cbb('0x15')]({'plain':!![]});return _0xed1a9e[_0x0cbb('0x24')]['findAll']({'raw':!![],'where':{'ListId':_0x124c9f[_0x0cbb('0x26')],'ContactId':_0x124c9f['id']}})['then'](function(_0x457be1){if(!_[_0x0cbb('0x43')](_0x457be1)){var _0x4f3604=[];for(var _0xc437f=0x0;_0xc437f<_0x457be1['length'];_0xc437f+=0x1){var _0x1ebca6=_0xed1a9e[_0x0cbb('0x24')][_0x0cbb('0x44')]({'where':{'ListId':_0x457be1[_0xc437f][_0x0cbb('0x26')],'ContactId':_0x457be1[_0xc437f][_0x0cbb('0x45')],'VoiceQueueId':_0x457be1[_0xc437f][_0x0cbb('0x46')],'CampaignId':_0x457be1[_0xc437f][_0x0cbb('0x47')]}});_0x4f3604['push'](_0x1ebca6);}return BPromise[_0x0cbb('0x48')](_0x4f3604);}})['then'](function(_0x26d460){logger[_0x0cbb('0x49')](_0x0cbb('0x4a'),util[_0x0cbb('0x30')](_0x26d460,{'showHidden':![],'depth':null}));_0x192a88();})[_0x0cbb('0x29')](function(_0x457c41){logger[_0x0cbb('0x2e')](_0x0cbb('0x4b'),util[_0x0cbb('0x30')](_0x457c41,{'showHidden':![],'depth':null}));_0x192a88(_0x457c41);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 28fb9f4..447f4ca 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0xe5a37b,_0x44052d){var _0x158e48=function(_0x23d6fe){while(--_0x23d6fe){_0xe5a37b['push'](_0xe5a37b['shift']());}};_0x158e48(++_0x44052d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index ee58ae2..182aa9a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6898=['INTEGER','STRING','PHONE','sequelize'];(function(_0x43c157,_0x146178){var _0x59f117=function(_0x1fc3de){while(--_0x1fc3de){_0x43c157['push'](_0x43c157['shift']());}};_0x59f117(++_0x146178);}(_0x6898,0x11b));var _0x8689=function(_0x2842ac,_0x4c5e1d){_0x2842ac=_0x2842ac-0x0;var _0x43f566=_0x6898[_0x2842ac];return _0x43f566;};'use strict';var Sequelize=require(_0x8689('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x8689('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x8689('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x8689('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x8689('0x2')],'defaultValue':_0x8689('0x3')},'OrderBy':{'type':Sequelize[_0x8689('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x8689('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xb2ef=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0xe2711e,_0x185526){var _0x43d4cb=function(_0x163de1){while(--_0x163de1){_0xe2711e['push'](_0xe2711e['shift']());}};_0x43d4cb(++_0x185526);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x232a0b,_0x3966b0){_0x232a0b=_0x232a0b-0x0;var _0x389950=_0xb2ef[_0x232a0b];return _0x389950;};'use strict';var Sequelize=require(_0xfb2e('0x0'));module[_0xfb2e('0x1')]={'CmContactId':{'type':Sequelize[_0xfb2e('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xfb2e('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xfb2e('0x3')],'defaultValue':_0xfb2e('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xfb2e('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index b0dca19..f71d016 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3dd=['where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','end','error','stack','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3d1a14,_0x25aa8c){var _0x1117c1=function(_0x1d4860){while(--_0x1d4860){_0x3d1a14['push'](_0x3d1a14['shift']());}};_0x1117c1(++_0x25aa8c);}(_0xa3dd,0x116));var _0xda3d=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0xa3dd[_0x2f54b6];return _0x169f21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda3d('0x0'));var zipdir=require(_0xda3d('0x1'));var jsonpatch=require(_0xda3d('0x2'));var rp=require(_0xda3d('0x3'));var moment=require(_0xda3d('0x4'));var BPromise=require(_0xda3d('0x5'));var Mustache=require(_0xda3d('0x6'));var util=require(_0xda3d('0x7'));var path=require(_0xda3d('0x8'));var sox=require('sox');var csv=require(_0xda3d('0x9'));var ejs=require(_0xda3d('0xa'));var fs=require('fs');var fs_extra=require(_0xda3d('0xb'));var _=require(_0xda3d('0xc'));var squel=require(_0xda3d('0xd'));var crypto=require('crypto');var jsforce=require(_0xda3d('0xe'));var deskjs=require(_0xda3d('0xf'));var toCsv=require(_0xda3d('0x9'));var querystring=require('querystring');var Papa=require(_0xda3d('0x10'));var Redis=require('ioredis');var authService=require(_0xda3d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xda3d('0x12'));var hardwareService=require(_0xda3d('0x13'));var logger=require('../../config/logger')(_0xda3d('0x14'));var utils=require(_0xda3d('0x15'));var config=require(_0xda3d('0x16'));var licenseUtil=require(_0xda3d('0x17'));var db=require(_0xda3d('0x18'))['db'];function respondWithStatusCode(_0x407514,_0x4deb35){_0x4deb35=_0x4deb35||0xcc;return function(_0xbffbca){if(_0xbffbca){return _0x407514[_0xda3d('0x19')](_0x4deb35);}return _0x407514[_0xda3d('0x1a')](_0x4deb35)['end']();};}function respondWithResult(_0x27ec50,_0x158b83){_0x158b83=_0x158b83||0xc8;return function(_0x221cf0){if(_0x221cf0){return _0x27ec50['status'](_0x158b83)['json'](_0x221cf0);}};}function respondWithFilteredResult(_0x546838,_0x46358a){return function(_0x4e9c74){if(_0x4e9c74){var _0x21f577=typeof _0x46358a[_0xda3d('0x1b')]===_0xda3d('0x1c')&&typeof _0x46358a[_0xda3d('0x1d')]===_0xda3d('0x1c');var _0x3b8d20=_0x4e9c74['count'];var _0x55b61f=_0x21f577?0x0:_0x46358a['offset'];var _0xc26058=_0x21f577?_0x4e9c74[_0xda3d('0x1e')]:_0x46358a[_0xda3d('0x1b')]+_0x46358a[_0xda3d('0x1d')];var _0x27e903;if(_0xc26058>=_0x3b8d20){_0xc26058=_0x3b8d20;_0x27e903=0xc8;}else{_0x27e903=0xce;}_0x546838[_0xda3d('0x1a')](_0x27e903);return _0x546838[_0xda3d('0x1f')](_0xda3d('0x20'),_0x55b61f+'-'+_0xc26058+'/'+_0x3b8d20)[_0xda3d('0x21')](_0x4e9c74);}return null;};}function patchUpdates(_0x1cff3d){return function(_0xf58725){try{jsonpatch[_0xda3d('0x22')](_0xf58725,_0x1cff3d,!![]);}catch(_0x5a83f8){return BPromise[_0xda3d('0x23')](_0x5a83f8);}return _0xf58725[_0xda3d('0x24')]();};}function saveUpdates(_0x205d25,_0x39fae1){return function(_0x54ffbd){if(_0x54ffbd){return _0x54ffbd[_0xda3d('0x25')](_0x205d25)[_0xda3d('0x26')](function(_0x162c7d){return _0x162c7d;});}return null;};}function removeEntity(_0x34b10a,_0x3a79bd){return function(_0x3a72e4){if(_0x3a72e4){return _0x3a72e4[_0xda3d('0x27')]()[_0xda3d('0x26')](function(){var _0x2a5663=_0x3a72e4[_0xda3d('0x28')]({'plain':!![]});var _0x4dddd0=_0xda3d('0x29');return db[_0xda3d('0x2a')][_0xda3d('0x27')]({'where':{'type':_0x4dddd0,'resourceId':_0x2a5663['id']}})[_0xda3d('0x26')](function(){return _0x3a72e4;});})[_0xda3d('0x26')](function(){_0x34b10a[_0xda3d('0x1a')](0xcc)[_0xda3d('0x2b')]();});}};}function handleEntityNotFound(_0x101fb3,_0x53b3a7){return function(_0x5bc504){if(!_0x5bc504){_0x101fb3[_0xda3d('0x19')](0x194);}return _0x5bc504;};}function handleError(_0xb4c982,_0x31684b){_0x31684b=_0x31684b||0x1f4;return function(_0x2aead2){logger[_0xda3d('0x2c')](_0x2aead2[_0xda3d('0x2d')]);if(_0x2aead2['name']){delete _0x2aead2['name'];}_0xb4c982[_0xda3d('0x1a')](_0x31684b)[_0xda3d('0x2e')](_0x2aead2);};}exports[_0xda3d('0x2f')]=function(_0x52f418,_0x1e2a38){var _0x25fe97={},_0x2f2998={},_0x2ef1e4={'count':0x0,'rows':[]};var _0x42d82a=_[_0xda3d('0x30')](db[_0xda3d('0x31')][_0xda3d('0x32')],function(_0x3a7981){return{'name':_0x3a7981[_0xda3d('0x33')],'type':_0x3a7981[_0xda3d('0x34')]['key']};});_0x2f2998[_0xda3d('0x35')]=_[_0xda3d('0x30')](_0x42d82a,_0xda3d('0x36'));_0x2f2998[_0xda3d('0x37')]=_[_0xda3d('0x38')](_0x52f418[_0xda3d('0x37')]);_0x2f2998[_0xda3d('0x39')]=_[_0xda3d('0x3a')](_0x2f2998[_0xda3d('0x35')],_0x2f2998[_0xda3d('0x37')]);_0x25fe97['attributes']=_[_0xda3d('0x3a')](_0x2f2998['model'],qs[_0xda3d('0x3b')](_0x52f418[_0xda3d('0x37')][_0xda3d('0x3b')]));_0x25fe97[_0xda3d('0x3c')]=_0x25fe97[_0xda3d('0x3c')][_0xda3d('0x3d')]?_0x25fe97[_0xda3d('0x3c')]:_0x2f2998[_0xda3d('0x35')];if(!_0x52f418['query'][_0xda3d('0x3e')](_0xda3d('0x3f'))){_0x25fe97['limit']=qs[_0xda3d('0x1d')](_0x52f418[_0xda3d('0x37')][_0xda3d('0x1d')]);_0x25fe97[_0xda3d('0x1b')]=qs[_0xda3d('0x1b')](_0x52f418[_0xda3d('0x37')][_0xda3d('0x1b')]);}_0x25fe97[_0xda3d('0x40')]=qs['sort'](_0x52f418[_0xda3d('0x37')][_0xda3d('0x41')]);_0x25fe97[_0xda3d('0x42')]=qs['filters'](_[_0xda3d('0x43')](_0x52f418[_0xda3d('0x37')],_0x2f2998[_0xda3d('0x39')]),_0x42d82a);if(_0x52f418[_0xda3d('0x37')]['filter']){_0x25fe97['where']=_[_0xda3d('0x44')](_0x25fe97[_0xda3d('0x42')],{'$or':_['map'](_0x42d82a,function(_0x2dd1f8){if(_0x2dd1f8[_0xda3d('0x34')]!==_0xda3d('0x45')){var _0x43502c={};_0x43502c[_0x2dd1f8['name']]={'$like':'%'+_0x52f418[_0xda3d('0x37')][_0xda3d('0x46')]+'%'};return _0x43502c;}})});}_0x25fe97=_['merge']({},_0x25fe97,_0x52f418[_0xda3d('0x47')]);var _0x111ddf={'where':_0x25fe97[_0xda3d('0x42')]};return db['CmContactHasItem']['count'](_0x111ddf)[_0xda3d('0x26')](function(_0x2d8c85){_0x2ef1e4[_0xda3d('0x1e')]=_0x2d8c85;if(_0x52f418[_0xda3d('0x37')][_0xda3d('0x48')]){_0x25fe97[_0xda3d('0x49')]=[{'all':!![]}];}return db[_0xda3d('0x31')]['findAll'](_0x25fe97);})[_0xda3d('0x26')](function(_0x4eef1c){_0x2ef1e4[_0xda3d('0x4a')]=_0x4eef1c;return _0x2ef1e4;})['then'](respondWithFilteredResult(_0x1e2a38,_0x25fe97))[_0xda3d('0x4b')](handleError(_0x1e2a38,null));};exports[_0xda3d('0x4c')]=function(_0x118852,_0x220f75){var _0x4a61e8={'raw':!![],'where':{'id':_0x118852[_0xda3d('0x4d')]['id']}},_0x5b68a6={};_0x5b68a6['model']=_[_0xda3d('0x38')](db[_0xda3d('0x31')][_0xda3d('0x32')]);_0x5b68a6['query']=_[_0xda3d('0x38')](_0x118852[_0xda3d('0x37')]);_0x5b68a6[_0xda3d('0x39')]=_['intersection'](_0x5b68a6[_0xda3d('0x35')],_0x5b68a6[_0xda3d('0x37')]);_0x4a61e8['attributes']=_['intersection'](_0x5b68a6[_0xda3d('0x35')],qs['fields'](_0x118852[_0xda3d('0x37')][_0xda3d('0x3b')]));_0x4a61e8[_0xda3d('0x3c')]=_0x4a61e8[_0xda3d('0x3c')][_0xda3d('0x3d')]?_0x4a61e8['attributes']:_0x5b68a6['model'];if(_0x118852[_0xda3d('0x37')][_0xda3d('0x48')]){_0x4a61e8[_0xda3d('0x49')]=[{'all':!![]}];}_0x4a61e8=_[_0xda3d('0x44')]({},_0x4a61e8,_0x118852['options']);return db[_0xda3d('0x31')][_0xda3d('0x4e')](_0x4a61e8)[_0xda3d('0x26')](handleEntityNotFound(_0x220f75,null))[_0xda3d('0x26')](respondWithResult(_0x220f75,null))['catch'](handleError(_0x220f75,null));};exports[_0xda3d('0x4f')]=function(_0x2e1eb4,_0x3c9f21){return db[_0xda3d('0x31')][_0xda3d('0x4f')](_0x2e1eb4[_0xda3d('0x50')],{})[_0xda3d('0x26')](function(_0x5c1edb){var _0x2bd3ea=_0x2e1eb4[_0xda3d('0x51')]['get']({'plain':!![]});if(!_0x2bd3ea)throw new Error(_0xda3d('0x52'));if(_0x2bd3ea[_0xda3d('0x53')]===_0xda3d('0x51')){var _0xeb9da8=_0x5c1edb[_0xda3d('0x28')]({'plain':!![]});var _0x5486f1=_0xda3d('0x29');return db['UserProfileSection'][_0xda3d('0x4e')]({'where':{'name':_0x5486f1,'userProfileId':_0x2bd3ea['userProfileId']},'raw':!![]})[_0xda3d('0x26')](function(_0x2a8ef0){if(_0x2a8ef0&&_0x2a8ef0[_0xda3d('0x54')]===0x0){return db['UserProfileResource'][_0xda3d('0x4f')]({'name':_0xeb9da8['name'],'resourceId':_0xeb9da8['id'],'type':_0x2a8ef0[_0xda3d('0x36')],'sectionId':_0x2a8ef0['id']},{})[_0xda3d('0x26')](function(){return _0x5c1edb;});}else{return _0x5c1edb;}})[_0xda3d('0x4b')](function(_0x32c03d){logger['error'](_0xda3d('0x55'),_0x32c03d);throw _0x32c03d;});}return _0x5c1edb;})['then'](respondWithResult(_0x3c9f21,0xc9))[_0xda3d('0x4b')](handleError(_0x3c9f21,null));};exports[_0xda3d('0x25')]=function(_0x5c1bf2,_0x2942b5){if(_0x5c1bf2['body']['id']){delete _0x5c1bf2[_0xda3d('0x50')]['id'];}return db[_0xda3d('0x31')][_0xda3d('0x4e')]({'where':{'id':_0x5c1bf2['params']['id']}})[_0xda3d('0x26')](handleEntityNotFound(_0x2942b5,null))[_0xda3d('0x26')](saveUpdates(_0x5c1bf2[_0xda3d('0x50')],null))[_0xda3d('0x26')](respondWithResult(_0x2942b5,null))[_0xda3d('0x4b')](handleError(_0x2942b5,null));};exports[_0xda3d('0x27')]=function(_0x41a5e5,_0x78b090){return db[_0xda3d('0x31')][_0xda3d('0x4e')]({'where':{'id':_0x41a5e5[_0xda3d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x78b090,null))[_0xda3d('0x26')](removeEntity(_0x78b090,null))[_0xda3d('0x4b')](handleError(_0x78b090,null));}; \ No newline at end of file +var _0x04f8=['end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','get','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','show','params','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status'];(function(_0x5b55bc,_0x18f5c6){var _0x2599c5=function(_0x56798b){while(--_0x56798b){_0x5b55bc['push'](_0x5b55bc['shift']());}};_0x2599c5(++_0x18f5c6);}(_0x04f8,0xe4));var _0x804f=function(_0x26641e,_0x40bbf3){_0x26641e=_0x26641e-0x0;var _0x1d2e42=_0x04f8[_0x26641e];return _0x1d2e42;};'use strict';var emlformat=require(_0x804f('0x0'));var rimraf=require(_0x804f('0x1'));var zipdir=require(_0x804f('0x2'));var jsonpatch=require(_0x804f('0x3'));var rp=require(_0x804f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x804f('0x5'));var path=require(_0x804f('0x6'));var sox=require(_0x804f('0x7'));var csv=require(_0x804f('0x8'));var ejs=require(_0x804f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x804f('0xa'));var squel=require(_0x804f('0xb'));var crypto=require('crypto');var jsforce=require(_0x804f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x804f('0x8'));var querystring=require(_0x804f('0xd'));var Papa=require(_0x804f('0xe'));var Redis=require(_0x804f('0xf'));var authService=require(_0x804f('0x10'));var qs=require(_0x804f('0x11'));var as=require(_0x804f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x804f('0x13'))(_0x804f('0x14'));var utils=require('../../config/utils');var config=require(_0x804f('0x15'));var licenseUtil=require(_0x804f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16dfbb,_0x31a149){_0x31a149=_0x31a149||0xcc;return function(_0x342328){if(_0x342328){return _0x16dfbb['sendStatus'](_0x31a149);}return _0x16dfbb[_0x804f('0x17')](_0x31a149)[_0x804f('0x18')]();};}function respondWithResult(_0x93d6d8,_0x24eb7c){_0x24eb7c=_0x24eb7c||0xc8;return function(_0x45db92){if(_0x45db92){return _0x93d6d8[_0x804f('0x17')](_0x24eb7c)['json'](_0x45db92);}};}function respondWithFilteredResult(_0x5b430a,_0xa57742){return function(_0x48f227){if(_0x48f227){var _0xb02e61=typeof _0xa57742[_0x804f('0x19')]==='undefined'&&typeof _0xa57742[_0x804f('0x1a')]===_0x804f('0x1b');var _0x112827=_0x48f227[_0x804f('0x1c')];var _0x5c38ab=_0xb02e61?0x0:_0xa57742[_0x804f('0x19')];var _0x469167=_0xb02e61?_0x48f227['count']:_0xa57742[_0x804f('0x19')]+_0xa57742[_0x804f('0x1a')];var _0x5f562b;if(_0x469167>=_0x112827){_0x469167=_0x112827;_0x5f562b=0xc8;}else{_0x5f562b=0xce;}_0x5b430a[_0x804f('0x17')](_0x5f562b);return _0x5b430a[_0x804f('0x1d')](_0x804f('0x1e'),_0x5c38ab+'-'+_0x469167+'/'+_0x112827)[_0x804f('0x1f')](_0x48f227);}return null;};}function patchUpdates(_0x9a6577){return function(_0x1ab9c1){try{jsonpatch[_0x804f('0x20')](_0x1ab9c1,_0x9a6577,!![]);}catch(_0x2abf88){return BPromise['reject'](_0x2abf88);}return _0x1ab9c1[_0x804f('0x21')]();};}function saveUpdates(_0x557d8a,_0x158885){return function(_0x34217d){if(_0x34217d){return _0x34217d[_0x804f('0x22')](_0x557d8a)['then'](function(_0x10d1f6){return _0x10d1f6;});}return null;};}function removeEntity(_0x4a8dd2,_0x54c30e){return function(_0x1b71ee){if(_0x1b71ee){return _0x1b71ee[_0x804f('0x23')]()[_0x804f('0x24')](function(){var _0x9038fe=_0x1b71ee[_0x804f('0x25')]({'plain':!![]});var _0x5cac13=_0x804f('0x26');return db[_0x804f('0x27')][_0x804f('0x23')]({'where':{'type':_0x5cac13,'resourceId':_0x9038fe['id']}})[_0x804f('0x24')](function(){return _0x1b71ee;});})[_0x804f('0x24')](function(){_0x4a8dd2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bd7bc,_0x5eca25){return function(_0x1bb512){if(!_0x1bb512){_0x3bd7bc[_0x804f('0x28')](0x194);}return _0x1bb512;};}function handleError(_0x49c894,_0x16bb61){_0x16bb61=_0x16bb61||0x1f4;return function(_0x2101d4){logger[_0x804f('0x29')](_0x2101d4[_0x804f('0x2a')]);if(_0x2101d4[_0x804f('0x2b')]){delete _0x2101d4[_0x804f('0x2b')];}_0x49c894[_0x804f('0x17')](_0x16bb61)[_0x804f('0x2c')](_0x2101d4);};}exports[_0x804f('0x2d')]=function(_0x4339f1,_0x587a40){var _0x435678={},_0x4865c5={},_0x4f4b5f={'count':0x0,'rows':[]};var _0x14ffd7=_[_0x804f('0x2e')](db[_0x804f('0x2f')][_0x804f('0x30')],function(_0x19ba36){return{'name':_0x19ba36[_0x804f('0x31')],'type':_0x19ba36[_0x804f('0x32')][_0x804f('0x33')]};});_0x4865c5[_0x804f('0x34')]=_[_0x804f('0x2e')](_0x14ffd7,_0x804f('0x2b'));_0x4865c5['query']=_[_0x804f('0x35')](_0x4339f1['query']);_0x4865c5[_0x804f('0x36')]=_[_0x804f('0x37')](_0x4865c5[_0x804f('0x34')],_0x4865c5[_0x804f('0x38')]);_0x435678[_0x804f('0x39')]=_[_0x804f('0x37')](_0x4865c5[_0x804f('0x34')],qs[_0x804f('0x3a')](_0x4339f1[_0x804f('0x38')]['fields']));_0x435678['attributes']=_0x435678[_0x804f('0x39')][_0x804f('0x3b')]?_0x435678[_0x804f('0x39')]:_0x4865c5[_0x804f('0x34')];if(!_0x4339f1[_0x804f('0x38')][_0x804f('0x3c')](_0x804f('0x3d'))){_0x435678[_0x804f('0x1a')]=qs['limit'](_0x4339f1[_0x804f('0x38')][_0x804f('0x1a')]);_0x435678[_0x804f('0x19')]=qs[_0x804f('0x19')](_0x4339f1[_0x804f('0x38')][_0x804f('0x19')]);}_0x435678[_0x804f('0x3e')]=qs[_0x804f('0x3f')](_0x4339f1[_0x804f('0x38')][_0x804f('0x3f')]);_0x435678[_0x804f('0x40')]=qs[_0x804f('0x36')](_[_0x804f('0x41')](_0x4339f1[_0x804f('0x38')],_0x4865c5['filters']),_0x14ffd7);if(_0x4339f1['query'][_0x804f('0x42')]){_0x435678[_0x804f('0x40')]=_[_0x804f('0x43')](_0x435678[_0x804f('0x40')],{'$or':_[_0x804f('0x2e')](_0x14ffd7,function(_0x292541){if(_0x292541[_0x804f('0x32')]!=='VIRTUAL'){var _0x40aad8={};_0x40aad8[_0x292541['name']]={'$like':'%'+_0x4339f1[_0x804f('0x38')][_0x804f('0x42')]+'%'};return _0x40aad8;}})});}_0x435678=_['merge']({},_0x435678,_0x4339f1[_0x804f('0x44')]);var _0x1b09e3={'where':_0x435678[_0x804f('0x40')]};return db[_0x804f('0x2f')]['count'](_0x1b09e3)[_0x804f('0x24')](function(_0x1fbd32){_0x4f4b5f[_0x804f('0x1c')]=_0x1fbd32;if(_0x4339f1[_0x804f('0x38')]['includeAll']){_0x435678['include']=[{'all':!![]}];}return db[_0x804f('0x2f')]['findAll'](_0x435678);})[_0x804f('0x24')](function(_0x256469){_0x4f4b5f[_0x804f('0x45')]=_0x256469;return _0x4f4b5f;})[_0x804f('0x24')](respondWithFilteredResult(_0x587a40,_0x435678))['catch'](handleError(_0x587a40,null));};exports[_0x804f('0x46')]=function(_0x1a8d75,_0x207744){var _0x2f6da2={'raw':!![],'where':{'id':_0x1a8d75[_0x804f('0x47')]['id']}},_0x19f6a6={};_0x19f6a6['model']=_[_0x804f('0x35')](db['CmContactHasItem']['rawAttributes']);_0x19f6a6[_0x804f('0x38')]=_[_0x804f('0x35')](_0x1a8d75[_0x804f('0x38')]);_0x19f6a6['filters']=_[_0x804f('0x37')](_0x19f6a6[_0x804f('0x34')],_0x19f6a6[_0x804f('0x38')]);_0x2f6da2[_0x804f('0x39')]=_[_0x804f('0x37')](_0x19f6a6['model'],qs[_0x804f('0x3a')](_0x1a8d75[_0x804f('0x38')][_0x804f('0x3a')]));_0x2f6da2[_0x804f('0x39')]=_0x2f6da2[_0x804f('0x39')][_0x804f('0x3b')]?_0x2f6da2['attributes']:_0x19f6a6[_0x804f('0x34')];if(_0x1a8d75['query'][_0x804f('0x48')]){_0x2f6da2[_0x804f('0x49')]=[{'all':!![]}];}_0x2f6da2=_['merge']({},_0x2f6da2,_0x1a8d75[_0x804f('0x44')]);return db[_0x804f('0x2f')]['find'](_0x2f6da2)[_0x804f('0x24')](handleEntityNotFound(_0x207744,null))[_0x804f('0x24')](respondWithResult(_0x207744,null))[_0x804f('0x4a')](handleError(_0x207744,null));};exports['create']=function(_0x478c09,_0x45cc5e){return db['CmContactHasItem'][_0x804f('0x4b')](_0x478c09[_0x804f('0x4c')],{})[_0x804f('0x24')](function(_0x44f01f){var _0x2764e6=_0x478c09[_0x804f('0x4d')][_0x804f('0x25')]({'plain':!![]});if(!_0x2764e6)throw new Error(_0x804f('0x4e'));if(_0x2764e6[_0x804f('0x4f')]===_0x804f('0x4d')){var _0x145522=_0x44f01f[_0x804f('0x25')]({'plain':!![]});var _0x2c6233=_0x804f('0x26');return db[_0x804f('0x50')][_0x804f('0x51')]({'where':{'name':_0x2c6233,'userProfileId':_0x2764e6['userProfileId']},'raw':!![]})[_0x804f('0x24')](function(_0x287819){if(_0x287819&&_0x287819[_0x804f('0x52')]===0x0){return db[_0x804f('0x27')][_0x804f('0x4b')]({'name':_0x145522['name'],'resourceId':_0x145522['id'],'type':_0x287819[_0x804f('0x2b')],'sectionId':_0x287819['id']},{})[_0x804f('0x24')](function(){return _0x44f01f;});}else{return _0x44f01f;}})['catch'](function(_0x262ce4){logger[_0x804f('0x29')](_0x804f('0x53'),_0x262ce4);throw _0x262ce4;});}return _0x44f01f;})[_0x804f('0x24')](respondWithResult(_0x45cc5e,0xc9))['catch'](handleError(_0x45cc5e,null));};exports[_0x804f('0x22')]=function(_0x433d99,_0x27f67e){if(_0x433d99['body']['id']){delete _0x433d99[_0x804f('0x4c')]['id'];}return db[_0x804f('0x2f')]['find']({'where':{'id':_0x433d99[_0x804f('0x47')]['id']}})[_0x804f('0x24')](handleEntityNotFound(_0x27f67e,null))[_0x804f('0x24')](saveUpdates(_0x433d99[_0x804f('0x4c')],null))[_0x804f('0x24')](respondWithResult(_0x27f67e,null))['catch'](handleError(_0x27f67e,null));};exports[_0x804f('0x23')]=function(_0x22584e,_0x34b944){return db[_0x804f('0x2f')][_0x804f('0x51')]({'where':{'id':_0x22584e[_0x804f('0x47')]['id']}})['then'](handleEntityNotFound(_0x34b944,null))['then'](removeEntity(_0x34b944,null))[_0x804f('0x4a')](handleError(_0x34b944,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 126a119..c894ac7 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3984=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','CmContactHasItem','lodash'];(function(_0x2b8c78,_0x177a37){var _0x3c6158=function(_0x4b0d63){while(--_0x4b0d63){_0x2b8c78['push'](_0x2b8c78['shift']());}};_0x3c6158(++_0x177a37);}(_0x3984,0xb3));var _0x4398=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x3984[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x4398('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4398('0x1'));var moment=require(_0x4398('0x2'));var BPromise=require(_0x4398('0x3'));var rp=require(_0x4398('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4398('0x5'));var config=require(_0x4398('0x6'));var attributes=require(_0x4398('0x7'));module['exports']=function(_0x285f3f,_0x540502){return _0x285f3f['define'](_0x4398('0x8'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x593b=['exports','CmContactHasItem','cm_contact_has_items','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x593b,0xfd));var _0xb593=function(_0x2a6aa9,_0x52760e){_0x2a6aa9=_0x2a6aa9-0x0;var _0x135dbe=_0x593b[_0x2a6aa9];return _0x135dbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb593('0x0'))(_0xb593('0x1'));var moment=require(_0xb593('0x2'));var BPromise=require('bluebird');var rp=require(_0xb593('0x3'));var fs=require('fs');var path=require(_0xb593('0x4'));var rimraf=require(_0xb593('0x5'));var config=require(_0xb593('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0xb593('0x7')]=function(_0x1aace8,_0x460009){return _0x1aace8['define'](_0xb593('0x8'),attributes,{'tableName':_0xb593('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index d2d5bb6..7304cb0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5bf8=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','lodash','util'];(function(_0x455284,_0x383648){var _0x3e70dc=function(_0x5297cf){while(--_0x5297cf){_0x455284['push'](_0x455284['shift']());}};_0x3e70dc(++_0x383648);}(_0x5bf8,0x17a));var _0x85bf=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0x5bf8[_0x4991d6];return _0x50faf7;};'use strict';var _=require(_0x85bf('0x0'));var util=require(_0x85bf('0x1'));var moment=require('moment');var BPromise=require(_0x85bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85bf('0x3'));var db=require(_0x85bf('0x4'))['db'];var utils=require(_0x85bf('0x5'));var logger=require('../../config/logger')(_0x85bf('0x6'));var config=require(_0x85bf('0x7'));var jayson=require(_0x85bf('0x8'));var client=jayson[_0x85bf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497aed,_0x5a85aa,_0xc28413){return new BPromise(function(_0x3f6ee6,_0x516c08){return client[_0x85bf('0xa')](_0x497aed,_0xc28413)['then'](function(_0x8ba89d){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x5a85aa,_0x85bf('0xb'));logger[_0x85bf('0xc')](_0x85bf('0xd'),_0x5a85aa,_0x85bf('0xb'),JSON[_0x85bf('0xe')](_0x8ba89d));if(_0x8ba89d[_0x85bf('0xf')]){if(_0x8ba89d[_0x85bf('0xf')][_0x85bf('0x10')]===0x1f4){logger[_0x85bf('0xf')](_0x85bf('0x11'),_0x5a85aa,_0x8ba89d[_0x85bf('0xf')][_0x85bf('0x12')]);return _0x516c08(_0x8ba89d[_0x85bf('0xf')][_0x85bf('0x12')]);}logger[_0x85bf('0xf')](_0x85bf('0x11'),_0x5a85aa,_0x8ba89d[_0x85bf('0xf')][_0x85bf('0x12')]);return _0x3f6ee6(_0x8ba89d['error'][_0x85bf('0x12')]);}else{logger[_0x85bf('0x13')](_0x85bf('0x11'),_0x5a85aa,_0x85bf('0xb'));_0x3f6ee6(_0x8ba89d['result']['message']);}})['catch'](function(_0x14edf9){logger[_0x85bf('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x5a85aa,_0x14edf9);_0x516c08(_0x14edf9);});});} \ No newline at end of file +var _0x1328=['../../config/logger','jayson/promise','client','then','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x1328,0x11b));var _0x8132=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x1328[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0x8132('0x0'));var util=require(_0x8132('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8132('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8132('0x3'))['db'];var utils=require(_0x8132('0x4'));var logger=require(_0x8132('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8132('0x6'));var client=jayson[_0x8132('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ddb53,_0x1cac16,_0xccb3){return new BPromise(function(_0x335c06,_0x237c02){return client['request'](_0x5ddb53,_0xccb3)[_0x8132('0x8')](function(_0x3100c7){logger[_0x8132('0x9')](_0x8132('0xa'),_0x1cac16,'request\x20sent');logger[_0x8132('0xb')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x1cac16,_0x8132('0xc'),JSON[_0x8132('0xd')](_0x3100c7));if(_0x3100c7[_0x8132('0xe')]){if(_0x3100c7[_0x8132('0xe')][_0x8132('0xf')]===0x1f4){logger[_0x8132('0xe')](_0x8132('0xa'),_0x1cac16,_0x3100c7[_0x8132('0xe')][_0x8132('0x10')]);return _0x237c02(_0x3100c7['error'][_0x8132('0x10')]);}logger[_0x8132('0xe')](_0x8132('0xa'),_0x1cac16,_0x3100c7[_0x8132('0xe')][_0x8132('0x10')]);return _0x335c06(_0x3100c7[_0x8132('0xe')][_0x8132('0x10')]);}else{logger[_0x8132('0x9')](_0x8132('0xa'),_0x1cac16,_0x8132('0xc'));_0x335c06(_0x3100c7['result'][_0x8132('0x10')]);}})[_0x8132('0x11')](function(_0x437d88){logger[_0x8132('0xe')](_0x8132('0xa'),_0x1cac16,_0x437d88);_0x237c02(_0x437d88);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 4ffcc4e..40192dd 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc482=['show','post','isAuthenticated','put','update','exports','multer','util','path','express','fs-extra','../../config/environment','./cmContactHasItem.controller','get','index','/:id'];(function(_0x3dbf82,_0x80e2a4){var _0x514652=function(_0x70cd61){while(--_0x70cd61){_0x3dbf82['push'](_0x3dbf82['shift']());}};_0x514652(++_0x80e2a4);}(_0xc482,0x96));var _0x2c48=function(_0x40d59b,_0x2efc7b){_0x40d59b=_0x40d59b-0x0;var _0x1f66dc=_0xc482[_0x40d59b];return _0x1f66dc;};'use strict';var multer=require(_0x2c48('0x0'));var util=require(_0x2c48('0x1'));var path=require(_0x2c48('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c48('0x3'));var router=express['Router']();var fs_extra=require(_0x2c48('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c48('0x5'));var controller=require(_0x2c48('0x6'));router[_0x2c48('0x7')]('/',auth['isAuthenticated'](),controller[_0x2c48('0x8')]);router['get'](_0x2c48('0x9'),auth['isAuthenticated'](),controller[_0x2c48('0xa')]);router[_0x2c48('0xb')]('/',auth[_0x2c48('0xc')](),controller['create']);router[_0x2c48('0xd')](_0x2c48('0x9'),auth[_0x2c48('0xc')](),controller[_0x2c48('0xe')]);router['delete'](_0x2c48('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2c48('0xf')]=router; \ No newline at end of file +var _0x4210=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','post','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4210,0x7a));var _0x0421=function(_0x4f4f56,_0x349b75){_0x4f4f56=_0x4f4f56-0x0;var _0x3ca1ef=_0x4210[_0x4f4f56];return _0x3ca1ef;};'use strict';var multer=require(_0x0421('0x0'));var util=require(_0x0421('0x1'));var path=require(_0x0421('0x2'));var timeout=require(_0x0421('0x3'));var express=require(_0x0421('0x4'));var router=express[_0x0421('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0421('0x6'));var interaction=require(_0x0421('0x7'));var config=require(_0x0421('0x8'));var controller=require(_0x0421('0x9'));router['get']('/',auth[_0x0421('0xa')](),controller['index']);router['get']('/:id',auth[_0x0421('0xa')](),controller['show']);router[_0x0421('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x0421('0xa')](),controller[_0x0421('0xc')]);router['delete'](_0x0421('0xd'),auth[_0x0421('0xa')](),controller[_0x0421('0xe')]);module[_0x0421('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 646936c..3a811dc 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 _0xd7d5=['alias','setDataValue','name','STRING','long','getDataValue','isArray','stringify','values','BOOLEAN','ENUM','voice','sequelize','lodash','VIRTUAL'];(function(_0xcc0273,_0x5b67c5){var _0x3bc2b3=function(_0x75a416){while(--_0x75a416){_0xcc0273['push'](_0xcc0273['shift']());}};_0x3bc2b3(++_0x5b67c5);}(_0xd7d5,0xcf));var _0x5d7d=function(_0x427cfc,_0x2f0925){_0x427cfc=_0x427cfc-0x0;var _0x4f2425=_0xd7d5[_0x427cfc];return _0x4f2425;};'use strict';var Sequelize=require(_0x5d7d('0x0'));var _=require(_0x5d7d('0x1'));module['exports']={'name':{'type':Sequelize[_0x5d7d('0x2')],'get':function(_0x175d17){return this['getDataValue'](_0x5d7d('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x272c25){this[_0x5d7d('0x4')]('alias',_0x272c25?_0x272c25:this['getDataValue'](_0x5d7d('0x5')));}},'type':{'type':Sequelize[_0x5d7d('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x5d7d('0x7')),'get':function(){if(this[_0x5d7d('0x8')]('type')==='select'){return JSON['parse'](this[_0x5d7d('0x8')]('values'));}else{return this[_0x5d7d('0x8')]('values');}},'set':function(_0x212fcf){if(Array[_0x5d7d('0x9')](_0x212fcf)){this['setDataValue']('values',JSON[_0x5d7d('0xa')](_0x212fcf));}else{this[_0x5d7d('0x4')](_0x5d7d('0xb'),_0x212fcf);}}},'required':{'type':Sequelize[_0x5d7d('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x5d7d('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x5d7d('0xd')](_0x5d7d('0xe'))}}; \ No newline at end of file +var _0xb9af=['long','type','select','parse','values','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','VIRTUAL','alias','STRING','getDataValue','TEXT'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xb9af,0x8a));var _0xfb9a=function(_0x2ff2b1,_0x39c367){_0x2ff2b1=_0x2ff2b1-0x0;var _0x15bd18=_0xb9af[_0x2ff2b1];return _0x15bd18;};'use strict';var Sequelize=require(_0xfb9a('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xfb9a('0x1')],'get':function(_0x1269ea){return this['getDataValue'](_0xfb9a('0x2'));}},'alias':{'type':Sequelize[_0xfb9a('0x3')],'allowNull':![],'set':function(_0x4c145c){this['setDataValue'](_0xfb9a('0x2'),_0x4c145c?_0x4c145c:this[_0xfb9a('0x4')]('name'));}},'type':{'type':Sequelize[_0xfb9a('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xfb9a('0x5')](_0xfb9a('0x6')),'get':function(){if(this[_0xfb9a('0x4')](_0xfb9a('0x7'))===_0xfb9a('0x8')){return JSON[_0xfb9a('0x9')](this[_0xfb9a('0x4')](_0xfb9a('0xa')));}else{return this[_0xfb9a('0x4')](_0xfb9a('0xa'));}},'set':function(_0x438795){if(Array['isArray'](_0x438795)){this[_0xfb9a('0xb')]('values',JSON[_0xfb9a('0xc')](_0x438795));}else{this[_0xfb9a('0xb')](_0xfb9a('0xa'),_0x438795);}}},'required':{'type':Sequelize[_0xfb9a('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xfb9a('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xfb9a('0xe')](_0xfb9a('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5e37c2a..d2a5b90 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 _0xa370=['show','params','include','find','catch','body','sequelize','transaction','create','Sequelize','TEXT','number','INTEGER','BOOLEAN','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','CmCustomField','rawAttributes','model','differenceBy','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x2587f8,_0x93567a){var _0x282571=function(_0x2bae50){while(--_0x2bae50){_0x2587f8['push'](_0x2587f8['shift']());}};_0x282571(++_0x93567a);}(_0xa370,0x172));var _0x0a37=function(_0x15d59a,_0x4b13c2){_0x15d59a=_0x15d59a-0x0;var _0x575cd5=_0xa370[_0x15d59a];return _0x575cd5;};'use strict';var emlformat=require(_0x0a37('0x0'));var rimraf=require(_0x0a37('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a37('0x2'));var rp=require(_0x0a37('0x3'));var moment=require(_0x0a37('0x4'));var BPromise=require(_0x0a37('0x5'));var Mustache=require(_0x0a37('0x6'));var util=require('util');var path=require(_0x0a37('0x7'));var sox=require(_0x0a37('0x8'));var csv=require('to-csv');var ejs=require(_0x0a37('0x9'));var fs=require('fs');var fs_extra=require(_0x0a37('0xa'));var _=require(_0x0a37('0xb'));var squel=require(_0x0a37('0xc'));var crypto=require(_0x0a37('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0a37('0xe'));var toCsv=require(_0x0a37('0xf'));var querystring=require(_0x0a37('0x10'));var Papa=require(_0x0a37('0x11'));var Redis=require(_0x0a37('0x12'));var authService=require(_0x0a37('0x13'));var qs=require(_0x0a37('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a37('0x15'));var logger=require(_0x0a37('0x16'))(_0x0a37('0x17'));var utils=require(_0x0a37('0x18'));var config=require(_0x0a37('0x19'));var licenseUtil=require(_0x0a37('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x131f2b,_0x44c978){_0x44c978=_0x44c978||0xcc;return function(_0x2cf95d){if(_0x2cf95d){return _0x131f2b['sendStatus'](_0x44c978);}return _0x131f2b['status'](_0x44c978)['end']();};}function respondWithResult(_0x49419a,_0xe2f38f){_0xe2f38f=_0xe2f38f||0xc8;return function(_0x14c6df){if(_0x14c6df){return _0x49419a[_0x0a37('0x1b')](_0xe2f38f)[_0x0a37('0x1c')](_0x14c6df);}};}function respondWithFilteredResult(_0x3af45e,_0x4cfbb5){return function(_0x9390dd){if(_0x9390dd){var _0x4ac71a=typeof _0x4cfbb5[_0x0a37('0x1d')]==='undefined'&&typeof _0x4cfbb5[_0x0a37('0x1e')]===_0x0a37('0x1f');var _0x5cff0a=_0x9390dd['count'];var _0x41fa3d=_0x4ac71a?0x0:_0x4cfbb5['offset'];var _0x2e4e69=_0x4ac71a?_0x9390dd[_0x0a37('0x20')]:_0x4cfbb5[_0x0a37('0x1d')]+_0x4cfbb5[_0x0a37('0x1e')];var _0x453753;if(_0x2e4e69>=_0x5cff0a){_0x2e4e69=_0x5cff0a;_0x453753=0xc8;}else{_0x453753=0xce;}_0x3af45e[_0x0a37('0x1b')](_0x453753);return _0x3af45e[_0x0a37('0x21')](_0x0a37('0x22'),_0x41fa3d+'-'+_0x2e4e69+'/'+_0x5cff0a)[_0x0a37('0x1c')](_0x9390dd);}return null;};}function patchUpdates(_0x38f79f){return function(_0xcfa166){try{jsonpatch[_0x0a37('0x23')](_0xcfa166,_0x38f79f,!![]);}catch(_0x2e334b){return BPromise[_0x0a37('0x24')](_0x2e334b);}return _0xcfa166[_0x0a37('0x25')]();};}function saveUpdates(_0x153802,_0x5195e7){return function(_0x4600be){if(_0x4600be){return _0x4600be[_0x0a37('0x26')](_0x153802)[_0x0a37('0x27')](function(_0x55fa4e){return _0x55fa4e;});}return null;};}function removeEntity(_0x5c1468,_0x4056a1){return function(_0x45e4bc){if(_0x45e4bc){return _0x45e4bc[_0x0a37('0x28')]()[_0x0a37('0x27')](function(){_0x5c1468[_0x0a37('0x1b')](0xcc)[_0x0a37('0x29')]();});}};}function handleEntityNotFound(_0x337a0e,_0x41f697){return function(_0x1ce122){if(!_0x1ce122){_0x337a0e[_0x0a37('0x2a')](0x194);}return _0x1ce122;};}function handleError(_0x3b7e8f,_0x5e808c){_0x5e808c=_0x5e808c||0x1f4;return function(_0xf4f402){logger['error'](_0xf4f402[_0x0a37('0x2b')]);if(_0xf4f402[_0x0a37('0x2c')]){delete _0xf4f402[_0x0a37('0x2c')];}_0x3b7e8f[_0x0a37('0x1b')](_0x5e808c)['send'](_0xf4f402);};}exports[_0x0a37('0x2d')]=function(_0x2e0608,_0x383615){var _0x1badc2={},_0x465a54={},_0x58f402={'count':0x0,'rows':[]};var _0x212c33=_[_0x0a37('0x2e')](db[_0x0a37('0x2f')][_0x0a37('0x30')],function(_0x492925){return{'name':_0x492925['fieldName'],'type':_0x492925['type']['key']};});_0x465a54[_0x0a37('0x31')]=_[_0x0a37('0x32')](_[_0x0a37('0x2e')](_0x212c33,_0x0a37('0x2c')),[_0x0a37('0x2c')]);_0x465a54[_0x0a37('0x33')]=_[_0x0a37('0x34')](_0x2e0608[_0x0a37('0x33')]);_0x465a54['filters']=_[_0x0a37('0x35')](_0x465a54['model'],_0x465a54[_0x0a37('0x33')]);_0x1badc2[_0x0a37('0x36')]=_['intersection'](_0x465a54[_0x0a37('0x31')],qs['fields'](_0x2e0608['query'][_0x0a37('0x37')]));_0x1badc2[_0x0a37('0x36')]=_0x1badc2[_0x0a37('0x36')][_0x0a37('0x38')]?_0x1badc2[_0x0a37('0x36')]:_0x465a54['model'];if(!_0x2e0608[_0x0a37('0x33')]['hasOwnProperty']('nolimit')){_0x1badc2[_0x0a37('0x1e')]=qs[_0x0a37('0x1e')](_0x2e0608[_0x0a37('0x33')][_0x0a37('0x1e')]);_0x1badc2[_0x0a37('0x1d')]=qs[_0x0a37('0x1d')](_0x2e0608[_0x0a37('0x33')]['offset']);}_0x1badc2[_0x0a37('0x39')]=qs[_0x0a37('0x3a')](_0x2e0608[_0x0a37('0x33')][_0x0a37('0x3a')]);_0x1badc2[_0x0a37('0x3b')]=qs[_0x0a37('0x3c')](_[_0x0a37('0x3d')](_0x2e0608[_0x0a37('0x33')],_0x465a54[_0x0a37('0x3c')]),_0x212c33);if(_0x2e0608[_0x0a37('0x33')][_0x0a37('0x3e')]){_0x1badc2[_0x0a37('0x3b')]=_[_0x0a37('0x3f')](_0x1badc2[_0x0a37('0x3b')],{'$or':_[_0x0a37('0x2e')](_0x212c33,function(_0x7f2451){if(_0x7f2451[_0x0a37('0x40')]!==_0x0a37('0x41')){var _0x532fcb={};_0x532fcb[_0x7f2451[_0x0a37('0x2c')]]={'$like':'%'+_0x2e0608['query'][_0x0a37('0x3e')]+'%'};return _0x532fcb;}})});}_0x1badc2=_[_0x0a37('0x3f')]({},_0x1badc2,_0x2e0608[_0x0a37('0x42')]);var _0x19a542={'where':_0x1badc2['where']};return db[_0x0a37('0x2f')][_0x0a37('0x20')](_0x19a542)[_0x0a37('0x27')](function(_0x314a04){_0x58f402[_0x0a37('0x20')]=_0x314a04;if(_0x2e0608[_0x0a37('0x33')][_0x0a37('0x43')]){_0x1badc2['include']=[{'all':!![]}];}return db['CmCustomField'][_0x0a37('0x44')](_0x1badc2);})['then'](function(_0x5c3705){_0x58f402[_0x0a37('0x45')]=_0x5c3705;return _0x58f402;})['then'](respondWithFilteredResult(_0x383615,_0x1badc2))['catch'](handleError(_0x383615,null));};exports[_0x0a37('0x46')]=function(_0x7466b9,_0x1db49b){var _0x4ff5f0={'raw':!![],'where':{'id':_0x7466b9[_0x0a37('0x47')]['id']}},_0x5aa841={};_0x5aa841['model']=_[_0x0a37('0x34')](db['CmCustomField'][_0x0a37('0x30')]);_0x5aa841['query']=_[_0x0a37('0x34')](_0x7466b9[_0x0a37('0x33')]);_0x5aa841[_0x0a37('0x3c')]=_[_0x0a37('0x35')](_0x5aa841[_0x0a37('0x31')],_0x5aa841[_0x0a37('0x33')]);_0x4ff5f0[_0x0a37('0x36')]=_[_0x0a37('0x35')](_0x5aa841[_0x0a37('0x31')],qs[_0x0a37('0x37')](_0x7466b9[_0x0a37('0x33')][_0x0a37('0x37')]));_0x4ff5f0[_0x0a37('0x36')]=_0x4ff5f0['attributes'][_0x0a37('0x38')]?_0x4ff5f0[_0x0a37('0x36')]:_0x5aa841['model'];if(_0x7466b9['query'][_0x0a37('0x43')]){_0x4ff5f0[_0x0a37('0x48')]=[{'all':!![]}];}_0x4ff5f0=_[_0x0a37('0x3f')]({},_0x4ff5f0,_0x7466b9['options']);return db[_0x0a37('0x2f')][_0x0a37('0x49')](_0x4ff5f0)[_0x0a37('0x27')](handleEntityNotFound(_0x1db49b,null))[_0x0a37('0x27')](respondWithResult(_0x1db49b,null))[_0x0a37('0x4a')](handleError(_0x1db49b,null));};exports[_0x0a37('0x26')]=function(_0x1b61ba,_0x40d103){if(_0x1b61ba[_0x0a37('0x4b')]['id']){delete _0x1b61ba[_0x0a37('0x4b')]['id'];}return db[_0x0a37('0x2f')][_0x0a37('0x49')]({'where':{'id':_0x1b61ba[_0x0a37('0x47')]['id']}})['then'](handleEntityNotFound(_0x40d103,null))[_0x0a37('0x27')](saveUpdates(_0x1b61ba[_0x0a37('0x4b')],null))[_0x0a37('0x27')](respondWithResult(_0x40d103,null))[_0x0a37('0x4a')](handleError(_0x40d103,null));};exports['destroy']=function(_0x3d06c4,_0x5903f2){return db['CmCustomField']['find']({'where':{'id':_0x3d06c4['params']['id']}})['then'](handleEntityNotFound(_0x5903f2,null))[_0x0a37('0x27')](removeEntity(_0x5903f2,null))[_0x0a37('0x4a')](handleError(_0x5903f2,null));};exports['create']=function(_0xef9d81,_0x3d483f){var _0x263977;return db[_0x0a37('0x4c')][_0x0a37('0x4d')](function(_0xd013c9){return db['CmCustomField'][_0x0a37('0x4e')](_0xef9d81[_0x0a37('0x4b')],{'transaction':_0xd013c9})['then'](function(_0x30824a){_0x263977=_0x30824a;var _0x435006={'type':db[_0x0a37('0x4f')]['TEXT'],'transaction':_0xd013c9};switch(_0xef9d81['body'][_0x0a37('0x40')]){case'text':_0x435006[_0x0a37('0x40')]=db[_0x0a37('0x4f')][_0x0a37('0x50')];break;case _0x0a37('0x51'):_0x435006['type']=db[_0x0a37('0x4f')][_0x0a37('0x52')];break;case'switch':_0x435006['type']=db['Sequelize'][_0x0a37('0x53')];_0x435006['defaultValue']=![];break;default:}return db[_0x0a37('0x4c')][_0x0a37('0x54')]['addColumn'](_0x0a37('0x55'),util[_0x0a37('0x56')](_0x0a37('0x57'),_0x263977['id']),_0x435006);})[_0x0a37('0x27')](function(){return _0x263977;});})[_0x0a37('0x27')](respondWithResult(_0x3d483f,0xc9))['catch'](handleError(_0x3d483f,null));}; \ No newline at end of file +var _0xfb14=['include','find','body','create','sequelize','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','map','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','includeAll','rows','catch','show','params'];(function(_0x468401,_0x33bddf){var _0x2a91d2=function(_0x39d914){while(--_0x39d914){_0x468401['push'](_0x468401['shift']());}};_0x2a91d2(++_0x33bddf);}(_0xfb14,0xc6));var _0x4fb1=function(_0xd1ca93,_0x142f75){_0xd1ca93=_0xd1ca93-0x0;var _0x17c2f5=_0xfb14[_0xd1ca93];return _0x17c2f5;};'use strict';var emlformat=require(_0x4fb1('0x0'));var rimraf=require(_0x4fb1('0x1'));var zipdir=require(_0x4fb1('0x2'));var jsonpatch=require(_0x4fb1('0x3'));var rp=require(_0x4fb1('0x4'));var moment=require(_0x4fb1('0x5'));var BPromise=require(_0x4fb1('0x6'));var Mustache=require(_0x4fb1('0x7'));var util=require(_0x4fb1('0x8'));var path=require('path');var sox=require(_0x4fb1('0x9'));var csv=require(_0x4fb1('0xa'));var ejs=require(_0x4fb1('0xb'));var fs=require('fs');var fs_extra=require(_0x4fb1('0xc'));var _=require(_0x4fb1('0xd'));var squel=require(_0x4fb1('0xe'));var crypto=require('crypto');var jsforce=require(_0x4fb1('0xf'));var deskjs=require(_0x4fb1('0x10'));var toCsv=require(_0x4fb1('0xa'));var querystring=require(_0x4fb1('0x11'));var Papa=require(_0x4fb1('0x12'));var Redis=require(_0x4fb1('0x13'));var authService=require(_0x4fb1('0x14'));var qs=require(_0x4fb1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fb1('0x16'));var logger=require('../../config/logger')(_0x4fb1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4fb1('0x18'))['db'];function respondWithStatusCode(_0x238baf,_0x31619a){_0x31619a=_0x31619a||0xcc;return function(_0x7a74c3){if(_0x7a74c3){return _0x238baf['sendStatus'](_0x31619a);}return _0x238baf[_0x4fb1('0x19')](_0x31619a)[_0x4fb1('0x1a')]();};}function respondWithResult(_0x1f20e2,_0x546612){_0x546612=_0x546612||0xc8;return function(_0xd189c){if(_0xd189c){return _0x1f20e2['status'](_0x546612)[_0x4fb1('0x1b')](_0xd189c);}};}function respondWithFilteredResult(_0x11209b,_0x59c73e){return function(_0x1ad967){if(_0x1ad967){var _0x2ea2ab=typeof _0x59c73e[_0x4fb1('0x1c')]===_0x4fb1('0x1d')&&typeof _0x59c73e[_0x4fb1('0x1e')]==='undefined';var _0x1b30cb=_0x1ad967['count'];var _0x3e9305=_0x2ea2ab?0x0:_0x59c73e['offset'];var _0x36418e=_0x2ea2ab?_0x1ad967[_0x4fb1('0x1f')]:_0x59c73e[_0x4fb1('0x1c')]+_0x59c73e[_0x4fb1('0x1e')];var _0x27e246;if(_0x36418e>=_0x1b30cb){_0x36418e=_0x1b30cb;_0x27e246=0xc8;}else{_0x27e246=0xce;}_0x11209b[_0x4fb1('0x19')](_0x27e246);return _0x11209b[_0x4fb1('0x20')](_0x4fb1('0x21'),_0x3e9305+'-'+_0x36418e+'/'+_0x1b30cb)['json'](_0x1ad967);}return null;};}function patchUpdates(_0x203b00){return function(_0x14d4fd){try{jsonpatch[_0x4fb1('0x22')](_0x14d4fd,_0x203b00,!![]);}catch(_0x55c251){return BPromise[_0x4fb1('0x23')](_0x55c251);}return _0x14d4fd[_0x4fb1('0x24')]();};}function saveUpdates(_0x4f7b9b,_0x60a591){return function(_0x4515bf){if(_0x4515bf){return _0x4515bf[_0x4fb1('0x25')](_0x4f7b9b)[_0x4fb1('0x26')](function(_0x2f6d37){return _0x2f6d37;});}return null;};}function removeEntity(_0x2305c1,_0x19a729){return function(_0xb2de1c){if(_0xb2de1c){return _0xb2de1c[_0x4fb1('0x27')]()[_0x4fb1('0x26')](function(){_0x2305c1[_0x4fb1('0x19')](0xcc)[_0x4fb1('0x1a')]();});}};}function handleEntityNotFound(_0x205209,_0x49abbb){return function(_0x7c6661){if(!_0x7c6661){_0x205209[_0x4fb1('0x28')](0x194);}return _0x7c6661;};}function handleError(_0x3158aa,_0x35992d){_0x35992d=_0x35992d||0x1f4;return function(_0x2c69da){logger[_0x4fb1('0x29')](_0x2c69da['stack']);if(_0x2c69da['name']){delete _0x2c69da[_0x4fb1('0x2a')];}_0x3158aa[_0x4fb1('0x19')](_0x35992d)[_0x4fb1('0x2b')](_0x2c69da);};}exports['index']=function(_0xcebbb2,_0x4e1232){var _0x416f01={},_0x3c766f={},_0x1d7046={'count':0x0,'rows':[]};var _0x2c2eeb=_['map'](db[_0x4fb1('0x2c')][_0x4fb1('0x2d')],function(_0x4ac867){return{'name':_0x4ac867[_0x4fb1('0x2e')],'type':_0x4ac867['type'][_0x4fb1('0x2f')]};});_0x3c766f[_0x4fb1('0x30')]=_[_0x4fb1('0x31')](_[_0x4fb1('0x32')](_0x2c2eeb,'name'),[_0x4fb1('0x2a')]);_0x3c766f['query']=_[_0x4fb1('0x33')](_0xcebbb2['query']);_0x3c766f['filters']=_[_0x4fb1('0x34')](_0x3c766f['model'],_0x3c766f['query']);_0x416f01[_0x4fb1('0x35')]=_[_0x4fb1('0x34')](_0x3c766f[_0x4fb1('0x30')],qs[_0x4fb1('0x36')](_0xcebbb2[_0x4fb1('0x37')][_0x4fb1('0x36')]));_0x416f01['attributes']=_0x416f01[_0x4fb1('0x35')][_0x4fb1('0x38')]?_0x416f01[_0x4fb1('0x35')]:_0x3c766f[_0x4fb1('0x30')];if(!_0xcebbb2[_0x4fb1('0x37')][_0x4fb1('0x39')](_0x4fb1('0x3a'))){_0x416f01[_0x4fb1('0x1e')]=qs[_0x4fb1('0x1e')](_0xcebbb2[_0x4fb1('0x37')][_0x4fb1('0x1e')]);_0x416f01['offset']=qs['offset'](_0xcebbb2['query'][_0x4fb1('0x1c')]);}_0x416f01[_0x4fb1('0x3b')]=qs[_0x4fb1('0x3c')](_0xcebbb2['query'][_0x4fb1('0x3c')]);_0x416f01[_0x4fb1('0x3d')]=qs[_0x4fb1('0x3e')](_[_0x4fb1('0x3f')](_0xcebbb2[_0x4fb1('0x37')],_0x3c766f['filters']),_0x2c2eeb);if(_0xcebbb2[_0x4fb1('0x37')][_0x4fb1('0x40')]){_0x416f01['where']=_['merge'](_0x416f01[_0x4fb1('0x3d')],{'$or':_[_0x4fb1('0x32')](_0x2c2eeb,function(_0x4137f4){if(_0x4137f4[_0x4fb1('0x41')]!=='VIRTUAL'){var _0x4db8fa={};_0x4db8fa[_0x4137f4['name']]={'$like':'%'+_0xcebbb2[_0x4fb1('0x37')]['filter']+'%'};return _0x4db8fa;}})});}_0x416f01=_[_0x4fb1('0x42')]({},_0x416f01,_0xcebbb2['options']);var _0x1d4f46={'where':_0x416f01['where']};return db[_0x4fb1('0x2c')][_0x4fb1('0x1f')](_0x1d4f46)[_0x4fb1('0x26')](function(_0x39b381){_0x1d7046[_0x4fb1('0x1f')]=_0x39b381;if(_0xcebbb2['query'][_0x4fb1('0x43')]){_0x416f01['include']=[{'all':!![]}];}return db[_0x4fb1('0x2c')]['findAll'](_0x416f01);})[_0x4fb1('0x26')](function(_0x4054fe){_0x1d7046[_0x4fb1('0x44')]=_0x4054fe;return _0x1d7046;})[_0x4fb1('0x26')](respondWithFilteredResult(_0x4e1232,_0x416f01))[_0x4fb1('0x45')](handleError(_0x4e1232,null));};exports[_0x4fb1('0x46')]=function(_0x1ba1e8,_0x489445){var _0x7a10e3={'raw':!![],'where':{'id':_0x1ba1e8[_0x4fb1('0x47')]['id']}},_0x3d2045={};_0x3d2045[_0x4fb1('0x30')]=_[_0x4fb1('0x33')](db[_0x4fb1('0x2c')]['rawAttributes']);_0x3d2045[_0x4fb1('0x37')]=_[_0x4fb1('0x33')](_0x1ba1e8[_0x4fb1('0x37')]);_0x3d2045['filters']=_[_0x4fb1('0x34')](_0x3d2045[_0x4fb1('0x30')],_0x3d2045[_0x4fb1('0x37')]);_0x7a10e3[_0x4fb1('0x35')]=_[_0x4fb1('0x34')](_0x3d2045[_0x4fb1('0x30')],qs[_0x4fb1('0x36')](_0x1ba1e8[_0x4fb1('0x37')]['fields']));_0x7a10e3[_0x4fb1('0x35')]=_0x7a10e3[_0x4fb1('0x35')][_0x4fb1('0x38')]?_0x7a10e3[_0x4fb1('0x35')]:_0x3d2045[_0x4fb1('0x30')];if(_0x1ba1e8['query'][_0x4fb1('0x43')]){_0x7a10e3[_0x4fb1('0x48')]=[{'all':!![]}];}_0x7a10e3=_['merge']({},_0x7a10e3,_0x1ba1e8['options']);return db[_0x4fb1('0x2c')][_0x4fb1('0x49')](_0x7a10e3)[_0x4fb1('0x26')](handleEntityNotFound(_0x489445,null))[_0x4fb1('0x26')](respondWithResult(_0x489445,null))['catch'](handleError(_0x489445,null));};exports['update']=function(_0x12f84c,_0x165f25){if(_0x12f84c[_0x4fb1('0x4a')]['id']){delete _0x12f84c[_0x4fb1('0x4a')]['id'];}return db[_0x4fb1('0x2c')][_0x4fb1('0x49')]({'where':{'id':_0x12f84c[_0x4fb1('0x47')]['id']}})[_0x4fb1('0x26')](handleEntityNotFound(_0x165f25,null))[_0x4fb1('0x26')](saveUpdates(_0x12f84c['body'],null))[_0x4fb1('0x26')](respondWithResult(_0x165f25,null))[_0x4fb1('0x45')](handleError(_0x165f25,null));};exports[_0x4fb1('0x27')]=function(_0x35fabf,_0x417443){return db[_0x4fb1('0x2c')]['find']({'where':{'id':_0x35fabf[_0x4fb1('0x47')]['id']}})[_0x4fb1('0x26')](handleEntityNotFound(_0x417443,null))['then'](removeEntity(_0x417443,null))[_0x4fb1('0x45')](handleError(_0x417443,null));};exports[_0x4fb1('0x4b')]=function(_0xc908ba,_0x2343a0){var _0x581f70;return db[_0x4fb1('0x4c')]['transaction'](function(_0x177054){return db['CmCustomField'][_0x4fb1('0x4b')](_0xc908ba[_0x4fb1('0x4a')],{'transaction':_0x177054})[_0x4fb1('0x26')](function(_0x16b844){_0x581f70=_0x16b844;var _0x45e80f={'type':db[_0x4fb1('0x4d')]['TEXT'],'transaction':_0x177054};switch(_0xc908ba[_0x4fb1('0x4a')]['type']){case _0x4fb1('0x4e'):_0x45e80f[_0x4fb1('0x41')]=db[_0x4fb1('0x4d')][_0x4fb1('0x4f')];break;case _0x4fb1('0x50'):_0x45e80f[_0x4fb1('0x41')]=db[_0x4fb1('0x4d')][_0x4fb1('0x51')];break;case _0x4fb1('0x52'):_0x45e80f[_0x4fb1('0x41')]=db['Sequelize'][_0x4fb1('0x53')];_0x45e80f[_0x4fb1('0x54')]=![];break;default:}return db[_0x4fb1('0x4c')][_0x4fb1('0x55')][_0x4fb1('0x56')](_0x4fb1('0x57'),util[_0x4fb1('0x58')](_0x4fb1('0x59'),_0x581f70['id']),_0x45e80f);})['then'](function(){return _0x581f70;});})[_0x4fb1('0x26')](respondWithResult(_0x2343a0,0xc9))[_0x4fb1('0x45')](handleError(_0x2343a0,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a78673c..660f901 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 _0xb234=['api','moment','bluebird','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger'];(function(_0x376968,_0x1ec758){var _0x1ade54=function(_0x11b8d6){while(--_0x11b8d6){_0x376968['push'](_0x376968['shift']());}};_0x1ade54(++_0x1ec758);}(_0xb234,0x142));var _0x4b23=function(_0x233e11,_0x329344){_0x233e11=_0x233e11-0x0;var _0xa3d525=_0xb234[_0x233e11];return _0xa3d525;};'use strict';var _=require(_0x4b23('0x0'));var util=require('util');var logger=require(_0x4b23('0x1'))(_0x4b23('0x2'));var moment=require(_0x4b23('0x3'));var BPromise=require(_0x4b23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b23('0x5'));var rimraf=require('rimraf');var config=require(_0x4b23('0x6'));var attributes=require(_0x4b23('0x7'));module[_0x4b23('0x8')]=function(_0x3c70de,_0x4897fd){return _0x3c70de[_0x4b23('0x9')](_0x4b23('0xa'),attributes,{'tableName':_0x4b23('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d81=['CmCustomField','lodash','../../config/logger','moment','request-promise','path','rimraf','./cmCustomField.attributes','exports'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0x8d81,0x10f));var _0x18d8=function(_0x4cd391,_0x414618){_0x4cd391=_0x4cd391-0x0;var _0x232865=_0x8d81[_0x4cd391];return _0x232865;};'use strict';var _=require(_0x18d8('0x0'));var util=require('util');var logger=require(_0x18d8('0x1'))('api');var moment=require(_0x18d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x18d8('0x3'));var fs=require('fs');var path=require(_0x18d8('0x4'));var rimraf=require(_0x18d8('0x5'));var config=require('../../config/environment');var attributes=require(_0x18d8('0x6'));module[_0x18d8('0x7')]=function(_0x233503,_0x43b625){return _0x233503['define'](_0x18d8('0x8'),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 f50684b..5b1d876 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 _0x8d13=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x8d13,0xa1));var _0x38d1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8d13[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x38d1('0x0'));var util=require(_0x38d1('0x1'));var moment=require(_0x38d1('0x2'));var BPromise=require(_0x38d1('0x3'));var rs=require(_0x38d1('0x4'));var fs=require('fs');var Redis=require(_0x38d1('0x5'));var db=require(_0x38d1('0x6'))['db'];var utils=require(_0x38d1('0x7'));var logger=require(_0x38d1('0x8'))(_0x38d1('0x9'));var config=require(_0x38d1('0xa'));var jayson=require(_0x38d1('0xb'));var client=jayson[_0x38d1('0xc')][_0x38d1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2cb399,_0x56316c,_0x4e036f){return new BPromise(function(_0x2ea058,_0x4065d6){return client[_0x38d1('0xe')](_0x2cb399,_0x4e036f)['then'](function(_0xadf1df){logger[_0x38d1('0xf')](_0x38d1('0x10'),_0x56316c,_0x38d1('0x11'));logger[_0x38d1('0x12')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x56316c,'request\x20sent',JSON['stringify'](_0xadf1df));if(_0xadf1df[_0x38d1('0x13')]){if(_0xadf1df['error'][_0x38d1('0x14')]===0x1f4){logger['error'](_0x38d1('0x10'),_0x56316c,_0xadf1df[_0x38d1('0x13')]['message']);return _0x4065d6(_0xadf1df[_0x38d1('0x13')]['message']);}logger[_0x38d1('0x13')]('CmCustomField,\x20%s,\x20%s',_0x56316c,_0xadf1df[_0x38d1('0x13')]['message']);return _0x2ea058(_0xadf1df[_0x38d1('0x13')][_0x38d1('0x15')]);}else{logger[_0x38d1('0xf')](_0x38d1('0x10'),_0x56316c,_0x38d1('0x11'));_0x2ea058(_0xadf1df['result'][_0x38d1('0x15')]);}})[_0x38d1('0x16')](function(_0x52f970){logger[_0x38d1('0x13')](_0x38d1('0x10'),_0x56316c,_0x52f970);_0x4065d6(_0x52f970);});});} \ No newline at end of file +var _0x2ec7=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x2ec7,0x1d0));var _0x72ec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2ec7[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x72ec('0x0'));var util=require(_0x72ec('0x1'));var moment=require(_0x72ec('0x2'));var BPromise=require(_0x72ec('0x3'));var rs=require(_0x72ec('0x4'));var fs=require('fs');var Redis=require(_0x72ec('0x5'));var db=require(_0x72ec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x72ec('0x7'))(_0x72ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x72ec('0x9'));var client=jayson[_0x72ec('0xa')][_0x72ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3701aa,_0x4d6bc1,_0x5e8bd9){return new BPromise(function(_0x2edb4f,_0x32d6e0){return client['request'](_0x3701aa,_0x5e8bd9)[_0x72ec('0xc')](function(_0x508124){logger[_0x72ec('0xd')](_0x72ec('0xe'),_0x4d6bc1,'request\x20sent');logger['debug'](_0x72ec('0xf'),_0x4d6bc1,_0x72ec('0x10'),JSON['stringify'](_0x508124));if(_0x508124[_0x72ec('0x11')]){if(_0x508124[_0x72ec('0x11')][_0x72ec('0x12')]===0x1f4){logger['error'](_0x72ec('0xe'),_0x4d6bc1,_0x508124[_0x72ec('0x11')][_0x72ec('0x13')]);return _0x32d6e0(_0x508124[_0x72ec('0x11')]['message']);}logger['error'](_0x72ec('0xe'),_0x4d6bc1,_0x508124['error'][_0x72ec('0x13')]);return _0x2edb4f(_0x508124[_0x72ec('0x11')][_0x72ec('0x13')]);}else{logger['info'](_0x72ec('0xe'),_0x4d6bc1,_0x72ec('0x10'));_0x2edb4f(_0x508124[_0x72ec('0x14')][_0x72ec('0x13')]);}})[_0x72ec('0x15')](function(_0x17546b){logger[_0x72ec('0x11')](_0x72ec('0xe'),_0x4d6bc1,_0x17546b);_0x32d6e0(_0x17546b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 6ebe6ef..5b1b910 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 _0xff3c=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xff3c,0x179));var _0xcff3=function(_0x55b6af,_0x50fd5a){_0x55b6af=_0x55b6af-0x0;var _0x2646b2=_0xff3c[_0x55b6af];return _0x2646b2;};'use strict';var multer=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var path=require('path');var timeout=require(_0xcff3('0x2'));var express=require(_0xcff3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x4'));var interaction=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var controller=require(_0xcff3('0x7'));router[_0xcff3('0x8')]('/',auth[_0xcff3('0x9')](),controller['index']);router['get'](_0xcff3('0xa'),auth['isAuthenticated'](),controller[_0xcff3('0xb')]);router['post']('/',auth[_0xcff3('0x9')](),controller[_0xcff3('0xc')]);router[_0xcff3('0xd')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xe')]);router[_0xcff3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcff3('0x10')]);module[_0xcff3('0x11')]=router; \ No newline at end of file +var _0x9d5c=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports'];(function(_0x33cca0,_0x1745e0){var _0x3028bf=function(_0x4e35d4){while(--_0x4e35d4){_0x33cca0['push'](_0x33cca0['shift']());}};_0x3028bf(++_0x1745e0);}(_0x9d5c,0x98));var _0xc9d5=function(_0x35f257,_0x1b5b8e){_0x35f257=_0x35f257-0x0;var _0x357721=_0x9d5c[_0x35f257];return _0x357721;};'use strict';var multer=require(_0xc9d5('0x0'));var util=require('util');var path=require(_0xc9d5('0x1'));var timeout=require(_0xc9d5('0x2'));var express=require('express');var router=express[_0xc9d5('0x3')]();var fs_extra=require(_0xc9d5('0x4'));var auth=require(_0xc9d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9d5('0x6'));var controller=require(_0xc9d5('0x7'));router['get']('/',auth[_0xc9d5('0x8')](),controller[_0xc9d5('0x9')]);router[_0xc9d5('0xa')](_0xc9d5('0xb'),auth[_0xc9d5('0x8')](),controller[_0xc9d5('0xc')]);router[_0xc9d5('0xd')]('/',auth[_0xc9d5('0x8')](),controller[_0xc9d5('0xe')]);router[_0xc9d5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc9d5('0x10')]);router['delete'](_0xc9d5('0xb'),auth[_0xc9d5('0x8')](),controller[_0xc9d5('0x11')]);module[_0xc9d5('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 4d05377..92c040b 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 _0xa81d=['contactListQueue','moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','BOOLEAN'];(function(_0x1a088d,_0x44a119){var _0x237d60=function(_0x2d52e9){while(--_0x2d52e9){_0x1a088d['push'](_0x1a088d['shift']());}};_0x237d60(++_0x44a119);}(_0xa81d,0x157));var _0xda81=function(_0x2a1db6,_0x5bd31a){_0x2a1db6=_0x2a1db6-0x0;var _0x41d420=_0xa81d[_0x2a1db6];return _0x41d420;};'use strict';var moment=require(_0xda81('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xda81('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xda81('0x2')],'defaultValue':moment()[_0xda81('0x3')](_0xda81('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xda81('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xda81('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xda81('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xda81('0x8')},'ListId':{'type':Sequelize[_0xda81('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xda81('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xda81('0x5')],'unique':_0xda81('0x8')},'CampaignId':{'type':Sequelize[_0xda81('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xda81('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xda81('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x69eb=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x69eb,0x118));var _0xb69e=function(_0x36cf0e,_0x3871c1){_0x36cf0e=_0x36cf0e-0x0;var _0x19667a=_0x69eb[_0x36cf0e];return _0x19667a;};'use strict';var moment=require(_0xb69e('0x0'));var Sequelize=require(_0xb69e('0x1'));module[_0xb69e('0x2')]={'phone':{'type':Sequelize[_0xb69e('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xb69e('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xb69e('0x5'))},'countbusyretry':{'type':Sequelize[_0xb69e('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb69e('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb69e('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb69e('0x7')]},'priority':{'type':Sequelize[_0xb69e('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb69e('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xb69e('0x8')},'ListId':{'type':Sequelize[_0xb69e('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xb69e('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xb69e('0x6')],'unique':_0xb69e('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xb69e('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb69e('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb69e('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb69e('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb69e('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb69e('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb69e('0x7')],'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 8d591e3..bdd8f01 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 _0x9221=['$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','CmHopper','catch','params','length','include','create','body','update','find','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','isEmpty','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','hopperIds','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getPreviewRecall','transaction','LOCK','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','sendStatus','timezones','push','utcOffset','lodash','../../components/parsers/qs','api','../../config/environment','status','json','offset','undefined','count','set','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike'];(function(_0x53582d,_0x22989b){var _0x119039=function(_0x4e7977){while(--_0x4e7977){_0x53582d['push'](_0x53582d['shift']());}};_0x119039(++_0x22989b);}(_0x9221,0x64));var _0x1922=function(_0x1c011c,_0x384710){_0x1c011c=_0x1c011c-0x0;var _0x277506=_0x9221[_0x1c011c];return _0x277506;};'use strict';var moment=require('moment');var _=require(_0x1922('0x0'));var qs=require(_0x1922('0x1'));var logger=require('../../config/logger')(_0x1922('0x2'));var shared=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x309b6b,_0x43c8a3){_0x43c8a3=_0x43c8a3||0xc8;return function(_0x459eee){if(_0x459eee){return _0x309b6b[_0x1922('0x4')](_0x43c8a3)[_0x1922('0x5')](_0x459eee);}};}function respondWithFilteredResult(_0x1944a5,_0x1351a0){return function(_0x5aa05c){if(_0x5aa05c){var _0x116227=typeof _0x1351a0[_0x1922('0x6')]===_0x1922('0x7')&&typeof _0x1351a0['limit']===_0x1922('0x7');var _0x5e9060=_0x5aa05c[_0x1922('0x8')];var _0xc1ae7=_0x116227?0x0:_0x1351a0[_0x1922('0x6')];var _0x47ba98=_0x116227?_0x5aa05c[_0x1922('0x8')]:_0x1351a0[_0x1922('0x6')]+_0x1351a0['limit'];var _0x38dc10;if(_0x47ba98>=_0x5e9060){_0x47ba98=_0x5e9060;_0x38dc10=0xc8;}else{_0x38dc10=0xce;}_0x1944a5['status'](_0x38dc10);return _0x1944a5[_0x1922('0x9')]('Content-Range',_0xc1ae7+'-'+_0x47ba98+'/'+_0x5e9060)[_0x1922('0x5')](_0x5aa05c);}return null;};}function saveUpdates(_0x1d7cf5,_0x2db5b9){return function(_0x58cfe7){if(_0x58cfe7){return _0x58cfe7['update'](_0x1d7cf5)[_0x1922('0xa')](function(_0x1f1bc6){return _0x1f1bc6;});}return null;};}function handleEntityNotFound(_0x3d1bfb,_0x3116dc){return function(_0x33b35d){if(!_0x33b35d){_0x3d1bfb['sendStatus'](0x194);}return _0x33b35d;};}function handleError(_0x5db997,_0x4cb94e){_0x4cb94e=_0x4cb94e||0x1f4;return function(_0x6b9389){logger[_0x1922('0xb')](_0x6b9389[_0x1922('0xc')]);if(_0x6b9389[_0x1922('0xd')]){delete _0x6b9389['name'];}_0x5db997[_0x1922('0x4')](_0x4cb94e)[_0x1922('0xe')](_0x6b9389);};}exports[_0x1922('0xf')]=function(_0x56b01b,_0x482f68){var _0x372875={},_0x51acda={},_0x3c6f9a={'count':0x0,'rows':[]};var _0x1266c0=_['map'](db['CmHopper'][_0x1922('0x10')],function(_0x5f54b9){return{'name':_0x5f54b9[_0x1922('0x11')],'type':_0x5f54b9[_0x1922('0x12')][_0x1922('0x13')]};});_0x51acda[_0x1922('0x14')]=_['map'](_0x1266c0,_0x1922('0xd'));_0x51acda[_0x1922('0x15')]=_[_0x1922('0x16')](_0x56b01b[_0x1922('0x15')]);_0x51acda['filters']=_[_0x1922('0x17')](_0x51acda[_0x1922('0x14')],_0x51acda[_0x1922('0x15')]);_0x51acda['filters']=_[_0x1922('0x18')](_0x51acda['filters'],['$and',_0x1922('0x19'),_0x1922('0x1a'),_0x1922('0x1b'),_0x1922('0x1c'),_0x1922('0x1d'),_0x1922('0x1e'),_0x1922('0x1f'),_0x1922('0x20'),_0x1922('0x21'),_0x1922('0x22'),_0x1922('0x23'),'$notIn',_0x1922('0x24'),'$notLike',_0x1922('0x25'),_0x1922('0x26'),_0x1922('0x24'),_0x1922('0x27'),_0x1922('0x28'),_0x1922('0x29'),_0x1922('0x2a')]);_0x372875[_0x1922('0x2b')]=_[_0x1922('0x17')](_0x51acda['model'],qs[_0x1922('0x2c')](_0x56b01b[_0x1922('0x15')][_0x1922('0x2c')]));_0x372875[_0x1922('0x2b')]=_0x372875[_0x1922('0x2b')]['length']?_0x372875[_0x1922('0x2b')]:_0x51acda[_0x1922('0x14')];if(!_0x56b01b[_0x1922('0x15')][_0x1922('0x2d')](_0x1922('0x2e'))){_0x372875[_0x1922('0x2f')]=qs[_0x1922('0x2f')](_0x56b01b['query'][_0x1922('0x2f')]);_0x372875[_0x1922('0x6')]=qs[_0x1922('0x6')](_0x56b01b[_0x1922('0x15')][_0x1922('0x6')]);}_0x372875[_0x1922('0x30')]=qs['sort'](_0x56b01b[_0x1922('0x15')][_0x1922('0x31')]);_0x372875[_0x1922('0x32')]=qs[_0x1922('0x33')](_[_0x1922('0x34')](_0x56b01b[_0x1922('0x15')],_0x51acda[_0x1922('0x33')]),_0x1266c0);if(_0x56b01b['query'][_0x1922('0x35')]){_0x372875[_0x1922('0x32')]=_[_0x1922('0x36')](_0x372875[_0x1922('0x32')],{'$or':_[_0x1922('0x37')](_0x1266c0,function(_0x1870f9){if(_0x1870f9['type']!==_0x1922('0x38')){var _0x83fd0f={};_0x83fd0f[_0x1870f9['name']]={'$like':'%'+_0x56b01b[_0x1922('0x15')][_0x1922('0x35')]+'%'};return _0x83fd0f;}})});}_0x372875=_['merge']({},_0x372875,_0x56b01b[_0x1922('0x39')]);var _0x12a534={'where':_0x372875[_0x1922('0x32')]};return db['CmHopper'][_0x1922('0x8')](_0x12a534)[_0x1922('0xa')](function(_0x51eb82){_0x3c6f9a[_0x1922('0x8')]=_0x51eb82;if(_0x56b01b[_0x1922('0x15')][_0x1922('0x3a')]){_0x372875['include']=[{'all':!![]}];}return db[_0x1922('0x3b')]['findAll'](_0x372875);})[_0x1922('0xa')](function(_0x575110){_0x3c6f9a['rows']=_0x575110;return _0x3c6f9a;})[_0x1922('0xa')](respondWithFilteredResult(_0x482f68,_0x372875))[_0x1922('0x3c')](handleError(_0x482f68,null));};exports['show']=function(_0x119bba,_0x447b8e){var _0x3bc2c9={'raw':!![],'where':{'id':_0x119bba[_0x1922('0x3d')]['id']}},_0x1d57d3={};_0x1d57d3['model']=_['keys'](db[_0x1922('0x3b')][_0x1922('0x10')]);_0x1d57d3[_0x1922('0x15')]=_[_0x1922('0x16')](_0x119bba[_0x1922('0x15')]);_0x1d57d3[_0x1922('0x33')]=_['intersection'](_0x1d57d3[_0x1922('0x14')],_0x1d57d3[_0x1922('0x15')]);_0x3bc2c9[_0x1922('0x2b')]=_[_0x1922('0x17')](_0x1d57d3[_0x1922('0x14')],qs[_0x1922('0x2c')](_0x119bba[_0x1922('0x15')]['fields']));_0x3bc2c9[_0x1922('0x2b')]=_0x3bc2c9[_0x1922('0x2b')][_0x1922('0x3e')]?_0x3bc2c9['attributes']:_0x1d57d3[_0x1922('0x14')];if(_0x119bba['query'][_0x1922('0x3a')]){_0x3bc2c9[_0x1922('0x3f')]=[{'all':!![]}];}_0x3bc2c9=_[_0x1922('0x36')]({},_0x3bc2c9,_0x119bba[_0x1922('0x39')]);return db[_0x1922('0x3b')]['find'](_0x3bc2c9)[_0x1922('0xa')](handleEntityNotFound(_0x447b8e,null))[_0x1922('0xa')](respondWithResult(_0x447b8e,null))[_0x1922('0x3c')](handleError(_0x447b8e,null));};exports[_0x1922('0x40')]=function(_0x4910ed,_0x24dce1){return db['CmHopper'][_0x1922('0x40')](_0x4910ed[_0x1922('0x41')],{})[_0x1922('0xa')](respondWithResult(_0x24dce1,0xc9))[_0x1922('0x3c')](handleError(_0x24dce1,null));};exports[_0x1922('0x42')]=function(_0x4cd5c,_0x19faee){if(_0x4cd5c['body']['id']){delete _0x4cd5c['body']['id'];}return db['CmHopper'][_0x1922('0x43')]({'where':{'id':_0x4cd5c[_0x1922('0x3d')]['id']}})[_0x1922('0xa')](handleEntityNotFound(_0x19faee,null))[_0x1922('0xa')](saveUpdates(_0x4cd5c[_0x1922('0x41')],null))[_0x1922('0xa')](respondWithResult(_0x19faee,null))[_0x1922('0x3c')](handleError(_0x19faee,null));};exports[_0x1922('0x44')]=function(_0x5da273,_0x5b34d3){return db[_0x1922('0x3b')]['describe']()[_0x1922('0xa')](respondWithResult(_0x5b34d3,null))[_0x1922('0x3c')](handleError(_0x5b34d3,null));};exports[_0x1922('0x45')]=function(_0x1c241b,_0x1e6d2f){var _0x5b51c2;var _0x4f25cb=_0x1c241b['params']['id'];return db[_0x1922('0x3b')]['find']({'where':{'id':_0x1c241b['params']['id']}})[_0x1922('0xa')](handleEntityNotFound(_0x1e6d2f,null))[_0x1922('0xa')](function(_0x22d668){if(_0x22d668){return _0x22d668['destroy']()['then'](function(_0x57a002){return _0x57a002;});}})['then'](function(_0x2234da){_0x5b51c2=_0x2234da;if(_0x2234da){if(_0x2234da[_0x1922('0x46')]||_0x2234da[_0x1922('0x47')]){return db[_0x2234da[_0x1922('0x46')]?'VoiceQueue':_0x1922('0x48')][_0x1922('0x43')]({'where':{'id':_0x2234da[_0x1922('0x46')]?_0x2234da[_0x1922('0x46')]:_0x2234da['CampaignId']},'attributes':['id',_0x1922('0xd')],'raw':!![]});}}})[_0x1922('0xa')](function(_0x4a3416){var _0x256a47={};if(_0x4a3416){_[_0x1922('0x36')](_0x256a47,_[_0x1922('0x49')](_0x5b51c2[_0x1922('0x4a')],[_0x1922('0x4b'),_0x1922('0x4c'),'id']));_0x256a47[_0x1922('0x4d')]=0x15;_0x256a47[_0x1922('0x4e')]=_0x1922('0x4f');_0x256a47[_0x1922('0x50')]=_0x4a3416[_0x1922('0xd')];_0x256a47[_0x1922('0x51')]=_0x1c241b[_0x1922('0x52')][_0x1922('0xd')];_0x256a47[_0x1922('0x53')]=_0x1c241b['user']['id'];_0x256a47[_0x1922('0x4f')]=!![];_0x256a47[_0x1922('0x54')]=moment()[_0x1922('0x55')](_0x1922('0x56'));_0x256a47['calleridnum']=_0x5b51c2['phone'];_0x256a47['campaigntype']=_0x5b51c2[_0x1922('0x46')]?_0x1922('0x57'):_0x1922('0x58');return db[_0x1922('0x59')][_0x1922('0x43')]({'where':{'id':_0x256a47[_0x1922('0x5a')]},'attributes':[_0x1922('0x5b'),_0x1922('0x5c')]})[_0x1922('0xa')](function(_0x4b2aa0){if(!_[_0x1922('0x5d')](_0x1e6d2f)&&!_['isNil'](_0x4b2aa0[_0x1922('0x5b')])){_0x256a47['calleridname']=_0x4b2aa0[_0x1922('0x5b')];if(!_[_0x1922('0x5d')](_0x4b2aa0['lastName'])){_0x256a47[_0x1922('0x5e')]+='\x20'+_0x4b2aa0['lastName'];}}})[_0x1922('0x5f')](function(){return db[_0x1922('0x60')][_0x1922('0x40')](_0x256a47);});}})[_0x1922('0xa')](function(_0x2e227d){return db[_0x1922('0x61')]['destroy']({'where':{'CmHopperId':_0x4f25cb}});})[_0x1922('0xa')](function(){return _0x1e6d2f[_0x1922('0x4')](0xcc)[_0x1922('0x62')]();})[_0x1922('0x3c')](handleError(_0x1e6d2f,null));};exports[_0x1922('0x63')]=function(_0x105271,_0x10a7ce){var _0x39f5da=[];return db[_0x1922('0x59')][_0x1922('0x44')]()[_0x1922('0xa')](function(_0x4ff467){_0x39f5da=_[_0x1922('0x16')](_0x4ff467);return _0x105271[_0x1922('0x52')][_0x1922('0x64')]({'where':{'type':_0x1922('0x65'),'dialActive':!![],'dialMethod':_0x1922('0x66')},'attributes':['id',_0x1922('0x67'),_0x1922('0x68')],'raw':!![]});})[_0x1922('0xa')](function(_0x2cc3a3){if(_0x2cc3a3&&_0x2cc3a3[_0x1922('0x3e')]){return db[_0x1922('0x69')]['transaction'](function(_0x1c53d7){var _0x3f1a8e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1922('0x55')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x1922('0x37')](_0x2cc3a3,'id')},'$or':[{'UserId':null},{'UserId':_0x105271[_0x1922('0x52')]['id']}]};var _0x287726={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2cc3a3)['filter'](['dialPreviewAutoRecallMe',0x0])[_0x1922('0x37')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x105271[_0x1922('0x52')]['id']}]};var _0x232ea0={'$or':[_0x3f1a8e,_0x287726]};var _0x20c36d=[];if(_0x105271[_0x1922('0x41')]['direction']&&_0x105271[_0x1922('0x41')][_0x1922('0x6a')]===_0x1922('0x6b')){if(!_[_0x1922('0x6c')](_0x105271[_0x1922('0x41')]['hopperIds'])){_0x232ea0['id']={'$in':_0x105271[_0x1922('0x41')]['hopperIds']};}_0x20c36d=[[_0x1922('0x6d'),_0x1922('0x6e')],[_0x1922('0x6f'),_0x2cc3a3[0x0]['dialOrderByScheduledAt']===_0x1922('0x6e')?'DESC':'ASC'],db[_0x1922('0x69')]['literal'](_0x1922('0x70')),['id',_0x1922('0x71')]];}else{if(!_[_0x1922('0x6c')](_0x105271[_0x1922('0x41')][_0x1922('0x72')])){_0x232ea0['id']={'$notIn':_0x105271[_0x1922('0x41')][_0x1922('0x72')]};}_0x20c36d=[[_0x1922('0x6d'),'DESC'],[_0x1922('0x6f'),_0x2cc3a3[0x0][_0x1922('0x67')]],db[_0x1922('0x69')][_0x1922('0x73')](_0x1922('0x74')),['id',_0x1922('0x6e')]];}return db[_0x1922('0x3b')][_0x1922('0x75')]({'attributes':['id',_0x1922('0x76'),_0x1922('0x77'),_0x1922('0x78')],'where':_0x232ea0,'order':_0x20c36d,'transaction':_0x1c53d7,'lock':_0x1c53d7['LOCK'][_0x1922('0x79')],'include':[{'model':db[_0x1922('0x59')],'as':_0x1922('0x7a'),'attributes':_0x39f5da,'include':[{'model':db[_0x1922('0x7b')],'as':_0x1922('0x7c'),'attributes':['id',_0x1922('0xd')]}]},{'model':db[_0x1922('0x7d')],'as':_0x1922('0x7e'),'attributes':['id',_0x1922('0xd')]},{'model':db[_0x1922('0x7f')],'as':_0x1922('0x80'),'attributes':['id',_0x1922('0xd'),_0x1922('0x81')]}]})[_0x1922('0xa')](function(_0x2b4e65){if(_0x2b4e65){return _0x2b4e65[_0x1922('0x42')]({'UserId':_0x105271[_0x1922('0x52')]['id']},{'transaction':_0x1c53d7});}});});}})[_0x1922('0xa')](handleEntityNotFound(_0x10a7ce,null))[_0x1922('0xa')](respondWithResult(_0x10a7ce,null))[_0x1922('0x3c')](handleError(_0x10a7ce,null));};exports[_0x1922('0x82')]=function(_0x9eaf53,_0x4caf03,_0x362013){var _0x1e6fbd=[];var _0x390dba=_0x9eaf53[_0x1922('0x3d')]['id'];var _0x188aa8=_0x9eaf53['user']['id'];return db[_0x1922('0x59')]['describe']()[_0x1922('0xa')](function(_0x3274e5){_0x1e6fbd=_[_0x1922('0x16')](_0x3274e5);return db[_0x1922('0x69')][_0x1922('0x83')](function(_0x300f26){const _0x472e27={'id':_0x390dba};return db['CmHopper'][_0x1922('0x75')]({'attributes':['id',_0x1922('0x76'),_0x1922('0x78')],'where':_0x472e27,'transaction':_0x300f26,'lock':_0x300f26[_0x1922('0x84')][_0x1922('0x79')],'include':[{'model':db[_0x1922('0x59')],'as':_0x1922('0x7a'),'attributes':_0x1e6fbd,'include':[{'model':db['CmCompany'],'as':_0x1922('0x7c'),'attributes':['id',_0x1922('0xd')]}]},{'model':db[_0x1922('0x7d')],'as':_0x1922('0x7e'),'attributes':['id',_0x1922('0xd')]},{'model':db[_0x1922('0x7f')],'as':_0x1922('0x80'),'attributes':['id',_0x1922('0xd'),_0x1922('0x81')]}]})[_0x1922('0xa')](function(_0x50bc2a){if(_0x50bc2a){return _0x50bc2a[_0x1922('0x42')]({'UserId':_0x188aa8},{'transaction':_0x300f26});}});});})['then'](handleEntityNotFound(_0x4caf03,null))[_0x1922('0xa')](respondWithResult(_0x4caf03,null))[_0x1922('0x3c')](handleError(_0x4caf03,null));};exports[_0x1922('0x85')]=function(_0x146038,_0x5da520){return _0x146038['user'][_0x1922('0x64')]({'where':{'type':_0x1922('0x65'),'dialActive':!![],'dialMethod':_0x1922('0x66')},'attributes':['id'],'raw':!![]})['then'](function(_0x430369){if(_0x430369&&_0x430369['length']){return db[_0x1922('0x3b')][_0x1922('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1922('0x55')](_0x1922('0x56'))},'VoiceQueueId':{'$in':_[_0x1922('0x37')](_0x430369,'id')},'$or':[{'UserId':null},{'UserId':_0x146038[_0x1922('0x52')]['id']}]}});}return 0x0;})[_0x1922('0xa')](function(_0x3688c5){if(!_['isNil'](_0x3688c5)&&_['isNumber'](_0x3688c5)){return _0x5da520['status'](0xc8)[_0x1922('0x5')]({'contacts':_0x3688c5});}else{logger[_0x1922('0xb')](_0x1922('0x86'),_0x1922('0x85'),0x194,'entity\x20not\x20found');_0x5da520[_0x1922('0x87')](0x194);}})['catch'](handleError(_0x5da520,null));};exports['getTimezones']=function(_0x58348f,_0x1ea53b){var _0x24e99d=shared[_0x1922('0x88')];var _0x5d2f1a=[];_['map'](_0x24e99d,function(_0xb13ce3){_0x5d2f1a[_0x1922('0x89')]({'id':_0xb13ce3[_0x1922('0xd')],'name':_0xb13ce3[_0x1922('0xd')],'utcOffset':_0xb13ce3[_0x1922('0x8a')]});});return _0x1ea53b['status'](0xc8)[_0x1922('0x5')]({'tz':_0x5d2f1a});};exports['getTimezone']=function(_0x3ab941,_0x4672a3){var _0x2c70b6=shared[_0x1922('0x88')];var _0x203037={};if(!_[_0x1922('0x5d')](_0x2c70b6[_0x3ab941[_0x1922('0x41')]['id']]))_0x203037=_0x2c70b6[_0x3ab941[_0x1922('0x41')]['id']];return _0x4672a3[_0x1922('0x4')](0xc8)[_0x1922('0x5')](_0x203037);}; \ No newline at end of file +var _0xfd87=['count','set','Content-Range','update','then','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','rows','catch','show','create','body','find','params','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','dataValues','createdAt','updatedAt','state','statedesc','membername','user','UserId','deleted','deletedat','calleridnum','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','hopperIds','priority','ASC','DESC','isEmpty','scheduledAt','scheduledat','phone','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','LOCK','CmList','getOpenContacts','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7fd8('0x0'));var _=require(_0x7fd8('0x1'));var qs=require(_0x7fd8('0x2'));var logger=require(_0x7fd8('0x3'))(_0x7fd8('0x4'));var shared=require(_0x7fd8('0x5'));var db=require(_0x7fd8('0x6'))['db'];function respondWithResult(_0x42b06c,_0x4429f2){_0x4429f2=_0x4429f2||0xc8;return function(_0x43b442){if(_0x43b442){return _0x42b06c[_0x7fd8('0x7')](_0x4429f2)['json'](_0x43b442);}};}function respondWithFilteredResult(_0x1395b6,_0x10a778){return function(_0x55681d){if(_0x55681d){var _0x378037=typeof _0x10a778[_0x7fd8('0x8')]===_0x7fd8('0x9')&&typeof _0x10a778[_0x7fd8('0xa')]===_0x7fd8('0x9');var _0x515439=_0x55681d[_0x7fd8('0xb')];var _0x18e3ea=_0x378037?0x0:_0x10a778[_0x7fd8('0x8')];var _0x596d03=_0x378037?_0x55681d['count']:_0x10a778['offset']+_0x10a778[_0x7fd8('0xa')];var _0x4e6096;if(_0x596d03>=_0x515439){_0x596d03=_0x515439;_0x4e6096=0xc8;}else{_0x4e6096=0xce;}_0x1395b6[_0x7fd8('0x7')](_0x4e6096);return _0x1395b6[_0x7fd8('0xc')](_0x7fd8('0xd'),_0x18e3ea+'-'+_0x596d03+'/'+_0x515439)['json'](_0x55681d);}return null;};}function saveUpdates(_0x136770,_0x2cccdb){return function(_0xe84aa7){if(_0xe84aa7){return _0xe84aa7[_0x7fd8('0xe')](_0x136770)[_0x7fd8('0xf')](function(_0x5b7061){return _0x5b7061;});}return null;};}function handleEntityNotFound(_0x1af365,_0x17a3a1){return function(_0x1d481a){if(!_0x1d481a){_0x1af365[_0x7fd8('0x10')](0x194);}return _0x1d481a;};}function handleError(_0x250a02,_0x38d45a){_0x38d45a=_0x38d45a||0x1f4;return function(_0x1a4a52){logger[_0x7fd8('0x11')](_0x1a4a52[_0x7fd8('0x12')]);if(_0x1a4a52[_0x7fd8('0x13')]){delete _0x1a4a52[_0x7fd8('0x13')];}_0x250a02['status'](_0x38d45a)['send'](_0x1a4a52);};}exports['index']=function(_0xab57f7,_0xce23dc){var _0x48734c={},_0x39e301={},_0xb6f53b={'count':0x0,'rows':[]};var _0x40b134=_[_0x7fd8('0x14')](db[_0x7fd8('0x15')][_0x7fd8('0x16')],function(_0x2edf31){return{'name':_0x2edf31[_0x7fd8('0x17')],'type':_0x2edf31['type'][_0x7fd8('0x18')]};});_0x39e301[_0x7fd8('0x19')]=_[_0x7fd8('0x14')](_0x40b134,_0x7fd8('0x13'));_0x39e301[_0x7fd8('0x1a')]=_[_0x7fd8('0x1b')](_0xab57f7['query']);_0x39e301[_0x7fd8('0x1c')]=_[_0x7fd8('0x1d')](_0x39e301[_0x7fd8('0x19')],_0x39e301[_0x7fd8('0x1a')]);_0x39e301['filters']=_[_0x7fd8('0x1e')](_0x39e301[_0x7fd8('0x1c')],[_0x7fd8('0x1f'),_0x7fd8('0x20'),_0x7fd8('0x21'),'$gte','$lt',_0x7fd8('0x22'),_0x7fd8('0x23'),_0x7fd8('0x24'),_0x7fd8('0x25'),_0x7fd8('0x26'),'$notBetween',_0x7fd8('0x27'),_0x7fd8('0x28'),_0x7fd8('0x29'),_0x7fd8('0x2a'),_0x7fd8('0x2b'),'$notILike','$like',_0x7fd8('0x2c'),_0x7fd8('0x2d'),_0x7fd8('0x2e'),_0x7fd8('0x2f')]);_0x48734c['attributes']=_['intersection'](_0x39e301[_0x7fd8('0x19')],qs['fields'](_0xab57f7[_0x7fd8('0x1a')][_0x7fd8('0x30')]));_0x48734c[_0x7fd8('0x31')]=_0x48734c['attributes'][_0x7fd8('0x32')]?_0x48734c['attributes']:_0x39e301[_0x7fd8('0x19')];if(!_0xab57f7[_0x7fd8('0x1a')][_0x7fd8('0x33')](_0x7fd8('0x34'))){_0x48734c[_0x7fd8('0xa')]=qs[_0x7fd8('0xa')](_0xab57f7[_0x7fd8('0x1a')]['limit']);_0x48734c[_0x7fd8('0x8')]=qs[_0x7fd8('0x8')](_0xab57f7[_0x7fd8('0x1a')][_0x7fd8('0x8')]);}_0x48734c[_0x7fd8('0x35')]=qs[_0x7fd8('0x36')](_0xab57f7[_0x7fd8('0x1a')][_0x7fd8('0x36')]);_0x48734c['where']=qs['filters'](_[_0x7fd8('0x37')](_0xab57f7[_0x7fd8('0x1a')],_0x39e301[_0x7fd8('0x1c')]),_0x40b134);if(_0xab57f7['query'][_0x7fd8('0x38')]){_0x48734c['where']=_['merge'](_0x48734c[_0x7fd8('0x39')],{'$or':_[_0x7fd8('0x14')](_0x40b134,function(_0x298dd6){if(_0x298dd6[_0x7fd8('0x3a')]!==_0x7fd8('0x3b')){var _0x3a889e={};_0x3a889e[_0x298dd6[_0x7fd8('0x13')]]={'$like':'%'+_0xab57f7[_0x7fd8('0x1a')]['filter']+'%'};return _0x3a889e;}})});}_0x48734c=_[_0x7fd8('0x3c')]({},_0x48734c,_0xab57f7['options']);var _0x5e6231={'where':_0x48734c[_0x7fd8('0x39')]};return db['CmHopper']['count'](_0x5e6231)['then'](function(_0x6c5e52){_0xb6f53b[_0x7fd8('0xb')]=_0x6c5e52;if(_0xab57f7['query'][_0x7fd8('0x3d')]){_0x48734c[_0x7fd8('0x3e')]=[{'all':!![]}];}return db[_0x7fd8('0x15')]['findAll'](_0x48734c);})['then'](function(_0x4ec65a){_0xb6f53b[_0x7fd8('0x3f')]=_0x4ec65a;return _0xb6f53b;})[_0x7fd8('0xf')](respondWithFilteredResult(_0xce23dc,_0x48734c))[_0x7fd8('0x40')](handleError(_0xce23dc,null));};exports[_0x7fd8('0x41')]=function(_0x1d2eca,_0x1b8737){var _0x2b5abb={'raw':!![],'where':{'id':_0x1d2eca['params']['id']}},_0x501f59={};_0x501f59['model']=_[_0x7fd8('0x1b')](db[_0x7fd8('0x15')][_0x7fd8('0x16')]);_0x501f59['query']=_[_0x7fd8('0x1b')](_0x1d2eca[_0x7fd8('0x1a')]);_0x501f59[_0x7fd8('0x1c')]=_[_0x7fd8('0x1d')](_0x501f59['model'],_0x501f59[_0x7fd8('0x1a')]);_0x2b5abb[_0x7fd8('0x31')]=_['intersection'](_0x501f59[_0x7fd8('0x19')],qs['fields'](_0x1d2eca[_0x7fd8('0x1a')][_0x7fd8('0x30')]));_0x2b5abb[_0x7fd8('0x31')]=_0x2b5abb[_0x7fd8('0x31')]['length']?_0x2b5abb[_0x7fd8('0x31')]:_0x501f59[_0x7fd8('0x19')];if(_0x1d2eca[_0x7fd8('0x1a')][_0x7fd8('0x3d')]){_0x2b5abb[_0x7fd8('0x3e')]=[{'all':!![]}];}_0x2b5abb=_[_0x7fd8('0x3c')]({},_0x2b5abb,_0x1d2eca['options']);return db['CmHopper']['find'](_0x2b5abb)[_0x7fd8('0xf')](handleEntityNotFound(_0x1b8737,null))[_0x7fd8('0xf')](respondWithResult(_0x1b8737,null))['catch'](handleError(_0x1b8737,null));};exports['create']=function(_0x328e81,_0x371a02){return db['CmHopper'][_0x7fd8('0x42')](_0x328e81[_0x7fd8('0x43')],{})[_0x7fd8('0xf')](respondWithResult(_0x371a02,0xc9))['catch'](handleError(_0x371a02,null));};exports[_0x7fd8('0xe')]=function(_0x47462e,_0x4f6a65){if(_0x47462e[_0x7fd8('0x43')]['id']){delete _0x47462e['body']['id'];}return db[_0x7fd8('0x15')][_0x7fd8('0x44')]({'where':{'id':_0x47462e[_0x7fd8('0x45')]['id']}})[_0x7fd8('0xf')](handleEntityNotFound(_0x4f6a65,null))[_0x7fd8('0xf')](saveUpdates(_0x47462e[_0x7fd8('0x43')],null))[_0x7fd8('0xf')](respondWithResult(_0x4f6a65,null))[_0x7fd8('0x40')](handleError(_0x4f6a65,null));};exports['describe']=function(_0x1666e7,_0x5ca89e){return db[_0x7fd8('0x15')][_0x7fd8('0x46')]()['then'](respondWithResult(_0x5ca89e,null))[_0x7fd8('0x40')](handleError(_0x5ca89e,null));};exports[_0x7fd8('0x47')]=function(_0x5cbc91,_0x5e3a45){var _0x59dc51;var _0xcfb3a8=_0x5cbc91['params']['id'];return db[_0x7fd8('0x15')][_0x7fd8('0x44')]({'where':{'id':_0x5cbc91[_0x7fd8('0x45')]['id']}})[_0x7fd8('0xf')](handleEntityNotFound(_0x5e3a45,null))[_0x7fd8('0xf')](function(_0x4bbd34){if(_0x4bbd34){return _0x4bbd34['destroy']()[_0x7fd8('0xf')](function(_0x46c230){return _0x46c230;});}})[_0x7fd8('0xf')](function(_0x169317){_0x59dc51=_0x169317;if(_0x169317){if(_0x169317['VoiceQueueId']||_0x169317[_0x7fd8('0x48')]){return db[_0x169317['VoiceQueueId']?_0x7fd8('0x49'):_0x7fd8('0x4a')][_0x7fd8('0x44')]({'where':{'id':_0x169317[_0x7fd8('0x4b')]?_0x169317[_0x7fd8('0x4b')]:_0x169317[_0x7fd8('0x48')]},'attributes':['id',_0x7fd8('0x13')],'raw':!![]});}}})[_0x7fd8('0xf')](function(_0x369e11){var _0x20f460={};if(_0x369e11){_[_0x7fd8('0x3c')](_0x20f460,_['omit'](_0x59dc51[_0x7fd8('0x4c')],[_0x7fd8('0x4d'),_0x7fd8('0x4e'),'id']));_0x20f460[_0x7fd8('0x4f')]=0x15;_0x20f460[_0x7fd8('0x50')]='deleted';_0x20f460['campaign']=_0x369e11['name'];_0x20f460[_0x7fd8('0x51')]=_0x5cbc91[_0x7fd8('0x52')][_0x7fd8('0x13')];_0x20f460[_0x7fd8('0x53')]=_0x5cbc91[_0x7fd8('0x52')]['id'];_0x20f460[_0x7fd8('0x54')]=!![];_0x20f460[_0x7fd8('0x55')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x20f460[_0x7fd8('0x56')]=_0x59dc51['phone'];_0x20f460[_0x7fd8('0x57')]=_0x59dc51[_0x7fd8('0x4b')]?'queue':_0x7fd8('0x58');return db[_0x7fd8('0x59')]['find']({'where':{'id':_0x20f460[_0x7fd8('0x5a')]},'attributes':[_0x7fd8('0x5b'),_0x7fd8('0x5c')]})[_0x7fd8('0xf')](function(_0x47013a){if(!_[_0x7fd8('0x5d')](_0x5e3a45)&&!_[_0x7fd8('0x5d')](_0x47013a['firstName'])){_0x20f460[_0x7fd8('0x5e')]=_0x47013a[_0x7fd8('0x5b')];if(!_[_0x7fd8('0x5d')](_0x47013a[_0x7fd8('0x5c')])){_0x20f460[_0x7fd8('0x5e')]+='\x20'+_0x47013a['lastName'];}}})[_0x7fd8('0x5f')](function(){return db[_0x7fd8('0x60')][_0x7fd8('0x42')](_0x20f460);});}})['then'](function(_0x5e7495){return db[_0x7fd8('0x61')][_0x7fd8('0x47')]({'where':{'CmHopperId':_0xcfb3a8}});})[_0x7fd8('0xf')](function(){return _0x5e3a45[_0x7fd8('0x7')](0xcc)[_0x7fd8('0x62')]();})[_0x7fd8('0x40')](handleError(_0x5e3a45,null));};exports['getPreview']=function(_0x24756f,_0x1cb6e4){var _0xa04550=[];return db[_0x7fd8('0x59')]['describe']()[_0x7fd8('0xf')](function(_0x6118d7){_0xa04550=_[_0x7fd8('0x1b')](_0x6118d7);return _0x24756f[_0x7fd8('0x52')][_0x7fd8('0x63')]({'where':{'type':_0x7fd8('0x64'),'dialActive':!![],'dialMethod':_0x7fd8('0x65')},'attributes':['id',_0x7fd8('0x66'),_0x7fd8('0x67')],'raw':!![]});})[_0x7fd8('0xf')](function(_0x3fc049){if(_0x3fc049&&_0x3fc049[_0x7fd8('0x32')]){return db[_0x7fd8('0x68')][_0x7fd8('0x69')](function(_0x5cb9a0){var _0x48e1cc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7fd8('0x6a')](_0x7fd8('0x6b'))},'VoiceQueueId':{'$in':_[_0x7fd8('0x14')](_0x3fc049,'id')},'$or':[{'UserId':null},{'UserId':_0x24756f[_0x7fd8('0x52')]['id']}]};var _0xd62b0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3fc049)['filter'](['dialPreviewAutoRecallMe',0x0])[_0x7fd8('0x14')]('id')[_0x7fd8('0x6c')]()},'$or':[{'UserId':null},{'UserId':_0x24756f['user']['id']}]};var _0x4c04b3={'$or':[_0x48e1cc,_0xd62b0]};var _0x489bf3=[];if(_0x24756f[_0x7fd8('0x43')][_0x7fd8('0x6d')]&&_0x24756f[_0x7fd8('0x43')][_0x7fd8('0x6d')]===_0x7fd8('0x6e')){if(!_['isEmpty'](_0x24756f['body'][_0x7fd8('0x6f')])){_0x4c04b3['id']={'$in':_0x24756f[_0x7fd8('0x43')]['hopperIds']};}_0x489bf3=[[_0x7fd8('0x70'),_0x7fd8('0x71')],['scheduledAt',_0x3fc049[0x0][_0x7fd8('0x66')]==='ASC'?_0x7fd8('0x72'):'ASC'],db[_0x7fd8('0x68')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7fd8('0x72')]];}else{if(!_[_0x7fd8('0x73')](_0x24756f['body'][_0x7fd8('0x6f')])){_0x4c04b3['id']={'$notIn':_0x24756f['body'][_0x7fd8('0x6f')]};}_0x489bf3=[[_0x7fd8('0x70'),_0x7fd8('0x72')],[_0x7fd8('0x74'),_0x3fc049[0x0][_0x7fd8('0x66')]],db[_0x7fd8('0x68')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x7fd8('0x71')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x7fd8('0x75'),_0x7fd8('0x76'),_0x7fd8('0x77')],'where':_0x4c04b3,'order':_0x489bf3,'transaction':_0x5cb9a0,'lock':_0x5cb9a0['LOCK'][_0x7fd8('0x78')],'include':[{'model':db[_0x7fd8('0x59')],'as':_0x7fd8('0x79'),'attributes':_0xa04550,'include':[{'model':db[_0x7fd8('0x7a')],'as':_0x7fd8('0x7b'),'attributes':['id',_0x7fd8('0x13')]}]},{'model':db['CmList'],'as':_0x7fd8('0x7c'),'attributes':['id',_0x7fd8('0x13')]},{'model':db[_0x7fd8('0x49')],'as':_0x7fd8('0x7d'),'attributes':['id',_0x7fd8('0x13'),_0x7fd8('0x7e')]}]})[_0x7fd8('0xf')](function(_0x1c46eb){if(_0x1c46eb){return _0x1c46eb['update']({'UserId':_0x24756f[_0x7fd8('0x52')]['id']},{'transaction':_0x5cb9a0});}});});}})[_0x7fd8('0xf')](handleEntityNotFound(_0x1cb6e4,null))[_0x7fd8('0xf')](respondWithResult(_0x1cb6e4,null))['catch'](handleError(_0x1cb6e4,null));};exports[_0x7fd8('0x7f')]=function(_0x4394f3,_0x1fd9bc,_0x4426cb){var _0x43fef0=[];var _0xafff06=_0x4394f3['params']['id'];var _0x335333=_0x4394f3[_0x7fd8('0x52')]['id'];return db[_0x7fd8('0x59')][_0x7fd8('0x46')]()['then'](function(_0x72429a){_0x43fef0=_[_0x7fd8('0x1b')](_0x72429a);return db[_0x7fd8('0x68')][_0x7fd8('0x69')](function(_0x42e7ae){const _0x296119={'id':_0xafff06};return db['CmHopper']['findOne']({'attributes':['id','scheduledat',_0x7fd8('0x77')],'where':_0x296119,'transaction':_0x42e7ae,'lock':_0x42e7ae[_0x7fd8('0x80')]['UPDATE'],'include':[{'model':db[_0x7fd8('0x59')],'as':'Contact','attributes':_0x43fef0,'include':[{'model':db[_0x7fd8('0x7a')],'as':_0x7fd8('0x7b'),'attributes':['id',_0x7fd8('0x13')]}]},{'model':db[_0x7fd8('0x81')],'as':_0x7fd8('0x7c'),'attributes':['id',_0x7fd8('0x13')]},{'model':db[_0x7fd8('0x49')],'as':_0x7fd8('0x7d'),'attributes':['id',_0x7fd8('0x13'),_0x7fd8('0x7e')]}]})[_0x7fd8('0xf')](function(_0x446b01){if(_0x446b01){return _0x446b01[_0x7fd8('0xe')]({'UserId':_0x335333},{'transaction':_0x42e7ae});}});});})['then'](handleEntityNotFound(_0x1fd9bc,null))[_0x7fd8('0xf')](respondWithResult(_0x1fd9bc,null))[_0x7fd8('0x40')](handleError(_0x1fd9bc,null));};exports[_0x7fd8('0x82')]=function(_0x3c353c,_0x68df89){return _0x3c353c['user'][_0x7fd8('0x63')]({'where':{'type':_0x7fd8('0x64'),'dialActive':!![],'dialMethod':_0x7fd8('0x65')},'attributes':['id'],'raw':!![]})[_0x7fd8('0xf')](function(_0x58f956){if(_0x58f956&&_0x58f956[_0x7fd8('0x32')]){return db[_0x7fd8('0x15')][_0x7fd8('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7fd8('0x6a')](_0x7fd8('0x6b'))},'VoiceQueueId':{'$in':_['map'](_0x58f956,'id')},'$or':[{'UserId':null},{'UserId':_0x3c353c[_0x7fd8('0x52')]['id']}]}});}return 0x0;})['then'](function(_0x111114){if(!_[_0x7fd8('0x5d')](_0x111114)&&_[_0x7fd8('0x83')](_0x111114)){return _0x68df89['status'](0xc8)[_0x7fd8('0x84')]({'contacts':_0x111114});}else{logger[_0x7fd8('0x11')](_0x7fd8('0x85'),_0x7fd8('0x82'),0x194,'entity\x20not\x20found');_0x68df89[_0x7fd8('0x10')](0x194);}})[_0x7fd8('0x40')](handleError(_0x68df89,null));};exports[_0x7fd8('0x86')]=function(_0x4cfe36,_0x408a07){var _0x148843=shared[_0x7fd8('0x87')];var _0xb66bee=[];_[_0x7fd8('0x14')](_0x148843,function(_0x147343){_0xb66bee[_0x7fd8('0x88')]({'id':_0x147343[_0x7fd8('0x13')],'name':_0x147343[_0x7fd8('0x13')],'utcOffset':_0x147343[_0x7fd8('0x89')]});});return _0x408a07['status'](0xc8)[_0x7fd8('0x84')]({'tz':_0xb66bee});};exports[_0x7fd8('0x8a')]=function(_0x2affd1,_0x15025d){var _0x56aff8=shared[_0x7fd8('0x87')];var _0x5f28fa={};if(!_['isNil'](_0x56aff8[_0x2affd1[_0x7fd8('0x43')]['id']]))_0x5f28fa=_0x56aff8[_0x2affd1['body']['id']];return _0x15025d[_0x7fd8('0x7')](0xc8)[_0x7fd8('0x84')](_0x5f28fa);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index dfe4408..b26dfb1 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 _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x5ef70d,_0x1b14c0){var _0x307667=function(_0x49509b){while(--_0x49509b){_0x5ef70d['push'](_0x5ef70d['shift']());}};_0x307667(++_0x1b14c0);}(_0x2a07,0x74));var _0x72a0=function(_0x178619,_0x35734e){_0x178619=_0x178619-0x0;var _0x2a71e9=_0x2a07[_0x178619];return _0x2a71e9;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api'];(function(_0x86c253,_0x3029ef){var _0x3c7c6b=function(_0xae35ce){while(--_0xae35ce){_0x86c253['push'](_0x86c253['shift']());}};_0x3c7c6b(++_0x3029ef);}(_0x7096,0x10c));var _0x6709=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7096[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x6709('0xd')]},{'name':_0x6709('0xe'),'fields':[_0x6709('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d68ca62..93e41b5 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 _0xf5fd=['UPDATE','CmContact','Contact','keys','User','Agent','name','length','includes','push','update','all','GetContactDialer','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','UserId','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','lodash','util','moment','bluebird','GetCmHopper','CmHopper','findAll','options','raw','where','limit','map','include','model','attributes','then','debug','stringify','catch','error','message','ShowCmHopper','find','info','create','body','CreateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','UpdateCmHopper','DestroyCmHopper','destroy','describe','sequelize','transaction','order','LOCK'];(function(_0xe6e557,_0x4f724b){var _0x15f8a1=function(_0x50a1cf){while(--_0x50a1cf){_0xe6e557['push'](_0xe6e557['shift']());}};_0x15f8a1(++_0x4f724b);}(_0xf5fd,0xc8));var _0xdf5f=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xf5fd[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xdf5f('0x0'));var util=require(_0xdf5f('0x1'));var moment=require(_0xdf5f('0x2'));var BPromise=require(_0xdf5f('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');exports[_0xdf5f('0x4')]=function(_0x3ad100){var _0x356f09=this;return new Promise(function(_0x31f9f8,_0x4835a8){return db[_0xdf5f('0x5')][_0xdf5f('0x6')]({'raw':_0x3ad100[_0xdf5f('0x7')]?_0x3ad100['options'][_0xdf5f('0x8')]===undefined?!![]:![]:!![],'where':_0x3ad100[_0xdf5f('0x7')]?_0x3ad100[_0xdf5f('0x7')][_0xdf5f('0x9')]||null:null,'attributes':_0x3ad100[_0xdf5f('0x7')]?_0x3ad100['options']['attributes']||null:null,'limit':_0x3ad100[_0xdf5f('0x7')]?_0x3ad100[_0xdf5f('0x7')][_0xdf5f('0xa')]||null:null,'include':_0x3ad100[_0xdf5f('0x7')]?_0x3ad100[_0xdf5f('0x7')]['include']?_[_0xdf5f('0xb')](_0x3ad100[_0xdf5f('0x7')][_0xdf5f('0xc')],function(_0x42f66b){return{'model':db[_0x42f66b[_0xdf5f('0xd')]],'as':_0x42f66b['as'],'attributes':_0x42f66b[_0xdf5f('0xe')],'include':_0x42f66b[_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x42f66b[_0xdf5f('0xc')],function(_0x28954b){return{'model':db[_0x28954b[_0xdf5f('0xd')]],'as':_0x28954b['as'],'attributes':_0x28954b['attributes'],'include':_0x28954b[_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x28954b[_0xdf5f('0xc')],function(_0x25a40c){return{'model':db[_0x25a40c[_0xdf5f('0xd')]],'as':_0x25a40c['as'],'attributes':_0x25a40c[_0xdf5f('0xe')]};}):[]};}):[]};}):[]:[]})[_0xdf5f('0xf')](function(_0x3844ea){logger['info'](_0xdf5f('0x4'),_0x3ad100);logger[_0xdf5f('0x10')](_0xdf5f('0x4'),_0x3ad100,JSON[_0xdf5f('0x11')](_0x3844ea));_0x31f9f8(_0x3844ea);})[_0xdf5f('0x12')](function(_0x3b40b3){logger[_0xdf5f('0x13')](_0xdf5f('0x4'),_0x3b40b3[_0xdf5f('0x14')],_0x3ad100);_0x4835a8(_0x356f09[_0xdf5f('0x13')](0x1f4,_0x3b40b3[_0xdf5f('0x14')]));});});};exports[_0xdf5f('0x15')]=function(_0x49008f){var _0x1d3b6b=this;return new Promise(function(_0x9c63e7,_0x19b674){return db['CmHopper'][_0xdf5f('0x16')]({'raw':_0x49008f[_0xdf5f('0x7')]?_0x49008f[_0xdf5f('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x49008f[_0xdf5f('0x7')]?_0x49008f['options']['where']||null:null,'attributes':_0x49008f['options']?_0x49008f[_0xdf5f('0x7')][_0xdf5f('0xe')]||null:null,'include':_0x49008f[_0xdf5f('0x7')]?_0x49008f[_0xdf5f('0x7')][_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x49008f['options'][_0xdf5f('0xc')],function(_0x18415d){return{'model':db[_0x18415d[_0xdf5f('0xd')]],'as':_0x18415d['as'],'attributes':_0x18415d[_0xdf5f('0xe')],'include':_0x18415d[_0xdf5f('0xc')]?_['map'](_0x18415d[_0xdf5f('0xc')],function(_0x54cb1d){return{'model':db[_0x54cb1d[_0xdf5f('0xd')]],'as':_0x54cb1d['as'],'attributes':_0x54cb1d['attributes'],'include':_0x54cb1d[_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x54cb1d[_0xdf5f('0xc')],function(_0x37f092){return{'model':db[_0x37f092[_0xdf5f('0xd')]],'as':_0x37f092['as'],'attributes':_0x37f092['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf5f('0xf')](function(_0x454712){logger[_0xdf5f('0x17')]('ShowCmHopper',_0x49008f);logger[_0xdf5f('0x10')](_0xdf5f('0x15'),_0x49008f,JSON[_0xdf5f('0x11')](_0x454712));_0x9c63e7(_0x454712);})[_0xdf5f('0x12')](function(_0x78d926){logger[_0xdf5f('0x13')]('ShowCmHopper',_0x78d926[_0xdf5f('0x14')],_0x49008f);_0x19b674(_0x1d3b6b[_0xdf5f('0x13')](0x1f4,_0x78d926[_0xdf5f('0x14')]));});});};exports['CreateCmHopper']=function(_0x475251){var _0x501f37=this;return new Promise(function(_0x1afa54,_0x20f4df){return db[_0xdf5f('0x5')][_0xdf5f('0x18')](_0x475251[_0xdf5f('0x19')],{'raw':_0x475251['options']?_0x475251[_0xdf5f('0x7')][_0xdf5f('0x8')]===undefined?!![]:![]:!![]})[_0xdf5f('0xf')](function(_0x2a1aac){logger['info']('CreateCmHopper',_0x475251);logger['debug'](_0xdf5f('0x1a'),_0x475251,JSON[_0xdf5f('0x11')](_0x2a1aac));_0x1afa54(_0x2a1aac);})[_0xdf5f('0x12')](function(_0x39a09a){logger[_0xdf5f('0x13')](_0xdf5f('0x1a'),_0x39a09a[_0xdf5f('0x14')],_0x475251);_0x20f4df(_0x501f37[_0xdf5f('0x13')](0x1f4,_0x39a09a['message']));});});};exports['UpdateCmHopper']=function(_0x9325c0){var _0x49bcc8=this;return new Promise(function(_0x37b8c4,_0x51fb53){return db[_0xdf5f('0x5')]['update'](_0x9325c0[_0xdf5f('0x19')],{'raw':_0x9325c0[_0xdf5f('0x7')]?_0x9325c0[_0xdf5f('0x7')][_0xdf5f('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9325c0[_0xdf5f('0x7')]?_0x9325c0['options'][_0xdf5f('0x9')]||null:null,'attributes':_0x9325c0[_0xdf5f('0x7')]?_0x9325c0[_0xdf5f('0x7')][_0xdf5f('0xe')]||null:null,'limit':_0x9325c0['options']?_0x9325c0[_0xdf5f('0x7')][_0xdf5f('0xa')]||null:null})['then'](function(_0x3b1692){logger['info']('UpdateCmHopper',_0x9325c0);logger[_0xdf5f('0x17')](_0xdf5f('0x1b'),JSON[_0xdf5f('0x11')](_0x9325c0['options'][_0xdf5f('0x9')]),_0x9325c0[_0xdf5f('0x19')][_0xdf5f('0x1c')]);logger[_0xdf5f('0x10')](_0xdf5f('0x1d'),_0x9325c0,JSON[_0xdf5f('0x11')](_0x3b1692));_0x37b8c4(_0x3b1692);})[_0xdf5f('0x12')](function(_0x4329f2){logger[_0xdf5f('0x13')](_0xdf5f('0x1d'),_0x4329f2[_0xdf5f('0x14')],_0x9325c0);_0x51fb53(_0x49bcc8[_0xdf5f('0x13')](0x1f4,_0x4329f2[_0xdf5f('0x14')]));});});};exports[_0xdf5f('0x1e')]=function(_0x5e3bf0){var _0x42dfd4=this;return new Promise(function(_0x207120,_0x40a40b){return db[_0xdf5f('0x5')][_0xdf5f('0x1f')]({'where':_0x5e3bf0[_0xdf5f('0x7')]?_0x5e3bf0['options'][_0xdf5f('0x9')]||null:null})[_0xdf5f('0xf')](function(_0x522b8b){logger['info'](_0xdf5f('0x1e'),_0x5e3bf0);logger[_0xdf5f('0x10')]('DestroyCmHopper',_0x5e3bf0,JSON[_0xdf5f('0x11')](_0x522b8b));_0x207120(_0x522b8b);})[_0xdf5f('0x12')](function(_0x2cde7a){logger['error'](_0xdf5f('0x1e'),_0x2cde7a[_0xdf5f('0x14')],_0x5e3bf0);_0x40a40b(_0x42dfd4[_0xdf5f('0x13')](0x1f4,_0x2cde7a[_0xdf5f('0x14')]));});});};exports['GetContactDialer']=function(_0x3e7222){var _0x4f8a25=this;return new Promise(function(_0x1b71f6,_0x3e36db){return db['CmContact'][_0xdf5f('0x20')]()[_0xdf5f('0xf')](function(_0x33d81a){return db[_0xdf5f('0x21')][_0xdf5f('0x22')](function(_0x3c3e5a){return db['CmHopper'][_0xdf5f('0x6')]({'where':_0x3e7222[_0xdf5f('0x7')]?_0x3e7222['options']['where']||null:null,'attributes':_0x3e7222[_0xdf5f('0x7')]?_0x3e7222['options']['attributes']||null:null,'limit':_0x3e7222[_0xdf5f('0x7')]?_0x3e7222[_0xdf5f('0x7')][_0xdf5f('0xa')]||null:null,'order':_0x3e7222[_0xdf5f('0x7')]?_0x3e7222[_0xdf5f('0x7')][_0xdf5f('0x23')]||null:null,'transaction':_0x3c3e5a,'lock':_0x3c3e5a[_0xdf5f('0x24')][_0xdf5f('0x25')],'include':[{'model':db[_0xdf5f('0x26')],'as':_0xdf5f('0x27'),'attributes':_[_0xdf5f('0x28')](_0x33d81a)},{'model':db[_0xdf5f('0x29')],'as':_0xdf5f('0x2a'),'attributes':['id',_0xdf5f('0x2b'),'voicePause']}]})[_0xdf5f('0xf')](function(_0x258391){var _0x34a776=[];var _0x5f05ee=[];for(var _0x559244=0x0;_0x559244<_0x258391[_0xdf5f('0x2c')];_0x559244+=0x1){var _0x2991c4=_0x258391[_0x559244]['UserId'];if(_0x2991c4===null){_0x34a776['push'](_0x258391[_0x559244]['update'](_0x3e7222[_0xdf5f('0x19')],{'transaction':_0x3c3e5a}));}else if(!_0x5f05ee[_0xdf5f('0x2d')](_0x2991c4)){_0x5f05ee[_0xdf5f('0x2e')](_0x2991c4);_0x34a776[_0xdf5f('0x2e')](_0x258391[_0x559244][_0xdf5f('0x2f')](_0x3e7222['body'],{'transaction':_0x3c3e5a}));}}return BPromise[_0xdf5f('0x30')](_0x34a776);});})[_0xdf5f('0xf')](function(_0x3c3065){logger[_0xdf5f('0x17')](_0xdf5f('0x31'),_0x3e7222);if(_0x3c3065[_0xdf5f('0x2c')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x3c3065[0x0][_0xdf5f('0x32')]['id'],_0x3c3065[0x0][_0xdf5f('0x32')][_0xdf5f('0x33')],_0x3c3065[0x0][_0xdf5f('0x32')][_0xdf5f('0x1c')]);}logger['debug']('GetContactDialer',_0x3e7222,JSON['stringify'](_0x3c3065));_0x1b71f6(_0x3c3065);})[_0xdf5f('0x12')](function(_0x2d90ad){logger[_0xdf5f('0x13')](_0xdf5f('0x31'),_0x2d90ad[_0xdf5f('0x14')],_0x3e7222);_0x3e36db(_0x4f8a25['error'](0x1f4,_0x2d90ad[_0xdf5f('0x14')]));});});});};exports[_0xdf5f('0x34')]=function(_0x55edc3){var _0x425645=this;return new Promise(function(_0x290232,_0x3a05c2){return db[_0xdf5f('0x21')]['transaction'](function(_0x2377ec){return db[_0xdf5f('0x35')][_0xdf5f('0x18')](_0x55edc3['body'],{'raw':_0x55edc3[_0xdf5f('0x7')]?_0x55edc3[_0xdf5f('0x7')][_0xdf5f('0x8')]===undefined?!![]:![]:!![],'transaction':_0x2377ec})['then'](function(){logger[_0xdf5f('0x17')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xdf5f('0x11')](_0x55edc3['options'][_0xdf5f('0x9')]),_0x55edc3[_0xdf5f('0x7')][_0xdf5f('0x9')][_0xdf5f('0x1c')]);return db[_0xdf5f('0x5')][_0xdf5f('0x1f')]({'where':_0x55edc3[_0xdf5f('0x7')]?_0x55edc3[_0xdf5f('0x7')]['where']||null:null,'transaction':_0x2377ec});});})['then'](function(_0x1a6a0d){logger[_0xdf5f('0x17')]('MoveContactManagedDialer',_0x55edc3);logger[_0xdf5f('0x10')](_0xdf5f('0x34'),_0x55edc3,JSON[_0xdf5f('0x11')](_0x1a6a0d));_0x290232(_0x1a6a0d);})[_0xdf5f('0x12')](function(_0x23d223){logger[_0xdf5f('0x13')](_0xdf5f('0x34'),_0x23d223['message'],_0x55edc3);_0x3a05c2(_0x425645['error'](0x1f4,_0x23d223[_0xdf5f('0x14')]));});});};exports[_0xdf5f('0x36')]=function(_0x2ee129){var _0x4ad5a4=this;return new Promise(function(_0xfb146a,_0x3138de){return db['CmHopper'][_0xdf5f('0x6')]({'raw':_0x2ee129[_0xdf5f('0x7')]?_0x2ee129[_0xdf5f('0x7')][_0xdf5f('0x8')]===undefined?!![]:![]:!![],'where':_0x2ee129[_0xdf5f('0x7')]?_0x2ee129[_0xdf5f('0x7')][_0xdf5f('0x9')]||null:null,'attributes':[[db[_0xdf5f('0x21')]['fn'](_0xdf5f('0x37'),db[_0xdf5f('0x21')]['fn']('IF',db['sequelize'][_0xdf5f('0x38')](_0xdf5f('0x39')+util[_0xdf5f('0x3a')](_0xdf5f('0x3b'),moment()[_0xdf5f('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xdf5f('0x3c')))),'contactsRescheduled']]})[_0xdf5f('0xf')](function(_0x426b10){logger[_0xdf5f('0x17')]('CountReScheduled',_0x2ee129);logger[_0xdf5f('0x10')](_0xdf5f('0x36'),_0x2ee129,JSON[_0xdf5f('0x11')](_0x426b10));_0xfb146a(_0x426b10);})['catch'](function(_0x12a232){logger[_0xdf5f('0x13')](_0xdf5f('0x36'),_0x12a232['message'],_0x2ee129);_0x3138de(_0x4ad5a4[_0xdf5f('0x13')](0x1f4,_0x12a232[_0xdf5f('0x14')]));});});};exports['GetContactRecallMe']=function(_0x201ad6){var _0x32b6bd=this;return new Promise(function(_0x9ff6c6,_0x309830){return db['CmContact'][_0xdf5f('0x20')]()[_0xdf5f('0xf')](function(){return db[_0xdf5f('0x21')][_0xdf5f('0x22')](function(_0x22405f){return db[_0xdf5f('0x5')][_0xdf5f('0x6')]({'where':_0x201ad6['options']?_0x201ad6[_0xdf5f('0x7')][_0xdf5f('0x9')]||null:null,'attributes':_0x201ad6['options']?_0x201ad6[_0xdf5f('0x7')][_0xdf5f('0xe')]||null:null,'limit':0x1,'order':_0x201ad6[_0xdf5f('0x7')]?_0x201ad6['options'][_0xdf5f('0x23')]||null:null,'group':db[_0xdf5f('0x5')][_0xdf5f('0x3d')],'transaction':_0x22405f,'lock':_0x22405f[_0xdf5f('0x24')]['UPDATE'],'include':_0x201ad6[_0xdf5f('0x7')]?_0x201ad6[_0xdf5f('0x7')][_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x201ad6[_0xdf5f('0x7')]['include'],function(_0x39146e){return{'model':db[_0x39146e[_0xdf5f('0xd')]],'as':_0x39146e['as'],'attributes':_0x39146e['attributes'],'include':_0x39146e[_0xdf5f('0xc')]?_['map'](_0x39146e[_0xdf5f('0xc')],function(_0x24e3bb){return{'model':db[_0x24e3bb[_0xdf5f('0xd')]],'as':_0x24e3bb['as'],'attributes':_0x24e3bb[_0xdf5f('0xe')],'include':_0x24e3bb[_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x24e3bb[_0xdf5f('0xc')],function(_0x2ca082){return{'model':db[_0x2ca082[_0xdf5f('0xd')]],'as':_0x2ca082['as'],'attributes':_0x2ca082['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x371bc3){var _0x4478a1=[];for(var _0x5ee9ec=0x0;_0x5ee9ec<_0x371bc3[_0xdf5f('0x2c')];_0x5ee9ec+=0x1){_0x4478a1['push'](_0x371bc3[_0x5ee9ec][_0xdf5f('0x2f')](_0x201ad6[_0xdf5f('0x19')],{'transaction':_0x22405f}));}return BPromise[_0xdf5f('0x30')](_0x4478a1);});})[_0xdf5f('0xf')](function(_0x28ec8f){logger[_0xdf5f('0x17')](_0xdf5f('0x3e'),_0x201ad6);logger[_0xdf5f('0x10')]('GetContactRecallMe',_0x201ad6,JSON[_0xdf5f('0x11')](_0x28ec8f));_0x9ff6c6(_0x28ec8f);})['catch'](function(_0x40cd59){logger['error'](_0xdf5f('0x3e'),_0x40cd59[_0xdf5f('0x14')],_0x201ad6);_0x309830(_0x32b6bd[_0xdf5f('0x13')](0x1f4,_0x40cd59[_0xdf5f('0x14')]));});});});};exports[_0xdf5f('0x3f')]=function(_0x5c02b6){var _0x51964f=this;return new Promise(function(_0x5ad55e,_0x32a889){db['CmContact'][_0xdf5f('0x20')]()['then'](function(_0xd324b6){return db[_0xdf5f('0x5')]['findAll']({'raw':_0x5c02b6[_0xdf5f('0x7')]?_0x5c02b6[_0xdf5f('0x7')][_0xdf5f('0x8')]===undefined?!![]:![]:!![],'where':_0x5c02b6['options']?_0x5c02b6[_0xdf5f('0x7')][_0xdf5f('0x9')]||null:null,'attributes':_0x5c02b6[_0xdf5f('0x7')]?_0x5c02b6['options']['attributes']||null:null,'limit':_0x5c02b6[_0xdf5f('0x7')]?_0x5c02b6[_0xdf5f('0x7')][_0xdf5f('0xa')]||null:null,'include':_0x5c02b6[_0xdf5f('0x7')]?_0x5c02b6[_0xdf5f('0x7')][_0xdf5f('0xc')]?_['map'](_0x5c02b6[_0xdf5f('0x7')]['include'],function(_0x2df93e){return{'model':db[_0x2df93e['model']],'as':_0x2df93e['as'],'attributes':_0x2df93e['as']===_0xdf5f('0x27')?_['keys'](_0xd324b6):_0x2df93e[_0xdf5f('0xe')],'include':_0x2df93e[_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x2df93e[_0xdf5f('0xc')],function(_0x5498ca){return{'model':db[_0x5498ca['model']],'as':_0x5498ca['as'],'attributes':_0x5498ca[_0xdf5f('0xe')],'include':_0x5498ca[_0xdf5f('0xc')]?_[_0xdf5f('0xb')](_0x5498ca['include'],function(_0x52f353){return{'model':db[_0x52f353[_0xdf5f('0xd')]],'as':_0x52f353['as'],'attributes':_0x52f353[_0xdf5f('0xe')]};}):[]};}):[]};}):[]:[]})[_0xdf5f('0xf')](function(_0x25a58d){logger[_0xdf5f('0x17')]('GetCmHopper',_0x5c02b6);logger[_0xdf5f('0x10')](_0xdf5f('0x4'),_0x5c02b6,JSON[_0xdf5f('0x11')](_0x25a58d));_0x5ad55e(_0x25a58d);})[_0xdf5f('0x12')](function(_0x23842d){logger['error'](_0xdf5f('0x4'),_0x23842d[_0xdf5f('0x14')],_0x5c02b6);_0x32a889(_0x51964f[_0xdf5f('0x13')](0x1f4,_0x23842d[_0xdf5f('0x14')]));});});});};exports[_0xdf5f('0x40')]=function(_0x2e3deb){var _0x170545=this;return new Promise(function(_0x54fea0,_0x1eae72){return db['CmContact'][_0xdf5f('0x41')]({'raw':!![],'where':{'phone':_0x2e3deb[_0xdf5f('0x7')][_0xdf5f('0x9')][_0xdf5f('0x42')]},'attributes':['id',_0xdf5f('0x43')],'order':[['id',_0xdf5f('0x44')]]})['then'](function(_0x2aa88d){logger[_0xdf5f('0x17')](_0xdf5f('0x45'),_0x2e3deb);logger[_0xdf5f('0x10')](_0xdf5f('0x45'),_0x2e3deb,JSON['stringify'](_0x2aa88d));_0x54fea0(_0x2aa88d);})[_0xdf5f('0x12')](function(_0x2005db){logger['error']('getContactByPhone',_0x2005db[_0xdf5f('0x14')],_0x2e3deb);_0x1eae72(_0x170545['error'](0x1f4,_0x2005db[_0xdf5f('0x14')]));});});};exports[_0xdf5f('0x46')]=function(_0x12f008){var _0x312baa=this;return new Promise(function(_0x5dbb5b,_0x55ace3){return db[_0xdf5f('0x21')][_0xdf5f('0x22')](function(_0x7e89cf){var _0x4f6f80=_0x12f008[_0xdf5f('0x7')]&&_0x12f008[_0xdf5f('0x7')][_0xdf5f('0x9')]?_0x12f008[_0xdf5f('0x7')][_0xdf5f('0x9')]:{};return db[_0xdf5f('0x5')]['update'](_0x12f008[_0xdf5f('0x19')],{'where':_0x4f6f80,'transaction':_0x7e89cf})[_0xdf5f('0xf')](function(_0x4cbfaa){logger['info'](_0xdf5f('0x46'),_0x12f008);logger[_0xdf5f('0x10')](_0xdf5f('0x46'),_0x12f008,JSON['stringify'](_0x4cbfaa));_0x5dbb5b(_0x4cbfaa);})[_0xdf5f('0x12')](function(_0x54072d){logger[_0xdf5f('0x13')]('ResetActiveCalls',_0x54072d[_0xdf5f('0x14')],_0x12f008);_0x55ace3(_0x312baa[_0xdf5f('0x13')](0x1f4,_0x54072d['message']));});});});};exports[_0xdf5f('0x47')]=function(_0x5ba3b3){var _0x1a9321=this;var _0x14e687=_0x5ba3b3[_0xdf5f('0x19')]['where'][_0xdf5f('0x48')];var _0x227fe0=_0x5ba3b3[_0xdf5f('0x19')][_0xdf5f('0x9')][_0xdf5f('0x49')];var _0x1860b3=_0x5ba3b3['body']['where'][_0xdf5f('0x4a')];return new Promise(function(_0x3c4d5c,_0x14cd07){return db[_0xdf5f('0x5')]['findAll']({'where':{'voiceQueueId':{'$in':_0x14e687},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xdf5f('0x38')](_0xdf5f('0x4b')+_0x227fe0+_0xdf5f('0x4c')),'$gt':db['sequelize']['literal'](_0xdf5f('0x4d'))}},'UserId':{'$in':_0x1860b3}},'include':[{'model':db[_0xdf5f('0x26')],'as':_0xdf5f('0x27')},{'model':db[_0xdf5f('0x29')],'as':_0xdf5f('0x2a'),'attributes':['id',_0xdf5f('0x2b'),'voicePause']},{'model':db[_0xdf5f('0x4e')],'as':'List'}]})[_0xdf5f('0xf')](function(_0x30ad6c){if(_0x30ad6c[_0xdf5f('0x2c')]>0x0){return db[_0xdf5f('0x21')][_0xdf5f('0x22')](function(_0x2d9be2){return db[_0xdf5f('0x5')][_0xdf5f('0x2f')]({'recallmeNotifiedDate':db['sequelize']['literal'](_0xdf5f('0x4d'))},{'where':{'id':{'$in':_[_0xdf5f('0xb')](_0x30ad6c,'id')}},'transaction':_0x2d9be2})['then'](function(){_0x3c4d5c(_0x30ad6c);})[_0xdf5f('0x12')](function(_0x22e16d){logger[_0xdf5f('0x13')](_0xdf5f('0x47'),_0x22e16d[_0xdf5f('0x14')],_0x5ba3b3);_0x14cd07(_0x1a9321[_0xdf5f('0x13')](0x1f4,_0x22e16d[_0xdf5f('0x14')]));});})[_0xdf5f('0x12')](function(_0x5197b0){logger['error'](_0xdf5f('0x47'),_0x5197b0[_0xdf5f('0x14')],_0x5ba3b3);_0x14cd07(_0x1a9321[_0xdf5f('0x13')](0x1f4,_0x5197b0['message']));});}else{_0x3c4d5c(_0x30ad6c);}});});}; \ No newline at end of file +var _0xe0e7=['debug','stringify','catch','message','error','ShowCmHopper','CmHopper','find','info','create','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','util','moment','../../mysqldb','../../config/logger','rpc','findAll','options','raw','where','limit','map','include','model','attributes','then','GetCmHopper'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe0e7,0x17b));var _0x7e0e=function(_0x20e79a,_0x322d4e){_0x20e79a=_0x20e79a-0x0;var _0x70801f=_0xe0e7[_0x20e79a];return _0x70801f;};'use strict';var _=require('lodash');var util=require(_0x7e0e('0x0'));var moment=require(_0x7e0e('0x1'));var BPromise=require('bluebird');var db=require(_0x7e0e('0x2'))['db'];var logger=require(_0x7e0e('0x3'))(_0x7e0e('0x4'));exports['GetCmHopper']=function(_0x2ac11f){var _0x5b4dac=this;return new Promise(function(_0x216b0f,_0x5bd25f){return db['CmHopper'][_0x7e0e('0x5')]({'raw':_0x2ac11f[_0x7e0e('0x6')]?_0x2ac11f[_0x7e0e('0x6')][_0x7e0e('0x7')]===undefined?!![]:![]:!![],'where':_0x2ac11f[_0x7e0e('0x6')]?_0x2ac11f[_0x7e0e('0x6')][_0x7e0e('0x8')]||null:null,'attributes':_0x2ac11f[_0x7e0e('0x6')]?_0x2ac11f[_0x7e0e('0x6')]['attributes']||null:null,'limit':_0x2ac11f[_0x7e0e('0x6')]?_0x2ac11f[_0x7e0e('0x6')][_0x7e0e('0x9')]||null:null,'include':_0x2ac11f[_0x7e0e('0x6')]?_0x2ac11f['options']['include']?_[_0x7e0e('0xa')](_0x2ac11f[_0x7e0e('0x6')][_0x7e0e('0xb')],function(_0x186c0d){return{'model':db[_0x186c0d[_0x7e0e('0xc')]],'as':_0x186c0d['as'],'attributes':_0x186c0d[_0x7e0e('0xd')],'include':_0x186c0d['include']?_[_0x7e0e('0xa')](_0x186c0d[_0x7e0e('0xb')],function(_0x4174ad){return{'model':db[_0x4174ad['model']],'as':_0x4174ad['as'],'attributes':_0x4174ad['attributes'],'include':_0x4174ad['include']?_[_0x7e0e('0xa')](_0x4174ad['include'],function(_0x40d7f0){return{'model':db[_0x40d7f0[_0x7e0e('0xc')]],'as':_0x40d7f0['as'],'attributes':_0x40d7f0[_0x7e0e('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7e0e('0xe')](function(_0x30d1f5){logger['info'](_0x7e0e('0xf'),_0x2ac11f);logger[_0x7e0e('0x10')](_0x7e0e('0xf'),_0x2ac11f,JSON[_0x7e0e('0x11')](_0x30d1f5));_0x216b0f(_0x30d1f5);})[_0x7e0e('0x12')](function(_0x4b17ad){logger['error']('GetCmHopper',_0x4b17ad[_0x7e0e('0x13')],_0x2ac11f);_0x5bd25f(_0x5b4dac[_0x7e0e('0x14')](0x1f4,_0x4b17ad[_0x7e0e('0x13')]));});});};exports[_0x7e0e('0x15')]=function(_0x20ecf4){var _0x1eddd4=this;return new Promise(function(_0x3a5434,_0x44ef5c){return db[_0x7e0e('0x16')][_0x7e0e('0x17')]({'raw':_0x20ecf4[_0x7e0e('0x6')]?_0x20ecf4['options'][_0x7e0e('0x7')]===undefined?!![]:![]:!![],'where':_0x20ecf4[_0x7e0e('0x6')]?_0x20ecf4['options'][_0x7e0e('0x8')]||null:null,'attributes':_0x20ecf4['options']?_0x20ecf4[_0x7e0e('0x6')][_0x7e0e('0xd')]||null:null,'include':_0x20ecf4[_0x7e0e('0x6')]?_0x20ecf4[_0x7e0e('0x6')][_0x7e0e('0xb')]?_[_0x7e0e('0xa')](_0x20ecf4['options']['include'],function(_0x46ceec){return{'model':db[_0x46ceec['model']],'as':_0x46ceec['as'],'attributes':_0x46ceec[_0x7e0e('0xd')],'include':_0x46ceec[_0x7e0e('0xb')]?_[_0x7e0e('0xa')](_0x46ceec[_0x7e0e('0xb')],function(_0x4a4d5d){return{'model':db[_0x4a4d5d[_0x7e0e('0xc')]],'as':_0x4a4d5d['as'],'attributes':_0x4a4d5d[_0x7e0e('0xd')],'include':_0x4a4d5d[_0x7e0e('0xb')]?_[_0x7e0e('0xa')](_0x4a4d5d[_0x7e0e('0xb')],function(_0x418fde){return{'model':db[_0x418fde[_0x7e0e('0xc')]],'as':_0x418fde['as'],'attributes':_0x418fde[_0x7e0e('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7e0e('0xe')](function(_0x4d4d25){logger[_0x7e0e('0x18')]('ShowCmHopper',_0x20ecf4);logger[_0x7e0e('0x10')](_0x7e0e('0x15'),_0x20ecf4,JSON['stringify'](_0x4d4d25));_0x3a5434(_0x4d4d25);})['catch'](function(_0x33541d){logger[_0x7e0e('0x14')](_0x7e0e('0x15'),_0x33541d[_0x7e0e('0x13')],_0x20ecf4);_0x44ef5c(_0x1eddd4[_0x7e0e('0x14')](0x1f4,_0x33541d[_0x7e0e('0x13')]));});});};exports['CreateCmHopper']=function(_0x3d4a2e){var _0x35c04c=this;return new Promise(function(_0xdd7460,_0x351bfb){return db['CmHopper'][_0x7e0e('0x19')](_0x3d4a2e['body'],{'raw':_0x3d4a2e[_0x7e0e('0x6')]?_0x3d4a2e[_0x7e0e('0x6')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3a3e19){logger[_0x7e0e('0x18')]('CreateCmHopper',_0x3d4a2e);logger[_0x7e0e('0x10')]('CreateCmHopper',_0x3d4a2e,JSON['stringify'](_0x3a3e19));_0xdd7460(_0x3a3e19);})[_0x7e0e('0x12')](function(_0x3fb6ac){logger[_0x7e0e('0x14')](_0x7e0e('0x1a'),_0x3fb6ac[_0x7e0e('0x13')],_0x3d4a2e);_0x351bfb(_0x35c04c['error'](0x1f4,_0x3fb6ac[_0x7e0e('0x13')]));});});};exports['UpdateCmHopper']=function(_0xc9e654){var _0x2bf57b=this;return new Promise(function(_0x5c4894,_0x4fbc66){return db[_0x7e0e('0x16')]['update'](_0xc9e654['body'],{'raw':_0xc9e654[_0x7e0e('0x6')]?_0xc9e654[_0x7e0e('0x6')][_0x7e0e('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9e654[_0x7e0e('0x6')]?_0xc9e654['options'][_0x7e0e('0x8')]||null:null,'attributes':_0xc9e654[_0x7e0e('0x6')]?_0xc9e654[_0x7e0e('0x6')][_0x7e0e('0xd')]||null:null,'limit':_0xc9e654[_0x7e0e('0x6')]?_0xc9e654[_0x7e0e('0x6')][_0x7e0e('0x9')]||null:null})[_0x7e0e('0xe')](function(_0x24210a){logger[_0x7e0e('0x18')](_0x7e0e('0x1b'),_0xc9e654);logger[_0x7e0e('0x18')](_0x7e0e('0x1c'),JSON['stringify'](_0xc9e654[_0x7e0e('0x6')][_0x7e0e('0x8')]),_0xc9e654[_0x7e0e('0x1d')][_0x7e0e('0x1e')]);logger['debug'](_0x7e0e('0x1b'),_0xc9e654,JSON[_0x7e0e('0x11')](_0x24210a));_0x5c4894(_0x24210a);})['catch'](function(_0x11685d){logger[_0x7e0e('0x14')](_0x7e0e('0x1b'),_0x11685d[_0x7e0e('0x13')],_0xc9e654);_0x4fbc66(_0x2bf57b[_0x7e0e('0x14')](0x1f4,_0x11685d[_0x7e0e('0x13')]));});});};exports[_0x7e0e('0x1f')]=function(_0x2fcba2){var _0x59e1db=this;return new Promise(function(_0x4aff56,_0x313d56){return db[_0x7e0e('0x16')]['destroy']({'where':_0x2fcba2[_0x7e0e('0x6')]?_0x2fcba2[_0x7e0e('0x6')][_0x7e0e('0x8')]||null:null})[_0x7e0e('0xe')](function(_0x13276b){logger[_0x7e0e('0x18')]('DestroyCmHopper',_0x2fcba2);logger[_0x7e0e('0x10')](_0x7e0e('0x1f'),_0x2fcba2,JSON['stringify'](_0x13276b));_0x4aff56(_0x13276b);})[_0x7e0e('0x12')](function(_0x3e43b0){logger[_0x7e0e('0x14')](_0x7e0e('0x1f'),_0x3e43b0['message'],_0x2fcba2);_0x313d56(_0x59e1db['error'](0x1f4,_0x3e43b0['message']));});});};exports[_0x7e0e('0x20')]=function(_0x456a4c){var _0x3e17dd=this;return new Promise(function(_0x5392f5,_0x596b89){return db[_0x7e0e('0x21')][_0x7e0e('0x22')]()[_0x7e0e('0xe')](function(_0x15df40){return db['sequelize'][_0x7e0e('0x23')](function(_0x172bf1){return db[_0x7e0e('0x16')]['findAll']({'where':_0x456a4c[_0x7e0e('0x6')]?_0x456a4c[_0x7e0e('0x6')][_0x7e0e('0x8')]||null:null,'attributes':_0x456a4c['options']?_0x456a4c[_0x7e0e('0x6')][_0x7e0e('0xd')]||null:null,'limit':_0x456a4c[_0x7e0e('0x6')]?_0x456a4c[_0x7e0e('0x6')]['limit']||null:null,'order':_0x456a4c['options']?_0x456a4c[_0x7e0e('0x6')][_0x7e0e('0x24')]||null:null,'transaction':_0x172bf1,'lock':_0x172bf1[_0x7e0e('0x25')][_0x7e0e('0x26')],'include':[{'model':db[_0x7e0e('0x21')],'as':_0x7e0e('0x27'),'attributes':_[_0x7e0e('0x28')](_0x15df40)},{'model':db[_0x7e0e('0x29')],'as':_0x7e0e('0x2a'),'attributes':['id',_0x7e0e('0x2b'),_0x7e0e('0x2c')]}]})[_0x7e0e('0xe')](function(_0x1b4646){var _0x527b5f=[];var _0x30b0b7=[];for(var _0x2827d5=0x0;_0x2827d5<_0x1b4646[_0x7e0e('0x2d')];_0x2827d5+=0x1){var _0x559808=_0x1b4646[_0x2827d5][_0x7e0e('0x2e')];if(_0x559808===null){_0x527b5f[_0x7e0e('0x2f')](_0x1b4646[_0x2827d5][_0x7e0e('0x30')](_0x456a4c[_0x7e0e('0x1d')],{'transaction':_0x172bf1}));}else if(!_0x30b0b7[_0x7e0e('0x31')](_0x559808)){_0x30b0b7[_0x7e0e('0x2f')](_0x559808);_0x527b5f[_0x7e0e('0x2f')](_0x1b4646[_0x2827d5][_0x7e0e('0x30')](_0x456a4c['body'],{'transaction':_0x172bf1}));}}return BPromise[_0x7e0e('0x32')](_0x527b5f);});})[_0x7e0e('0xe')](function(_0x33710b){logger[_0x7e0e('0x18')](_0x7e0e('0x20'),_0x456a4c);if(_0x33710b[_0x7e0e('0x2d')]>0x0){logger[_0x7e0e('0x18')](_0x7e0e('0x33'),_0x33710b[0x0][_0x7e0e('0x34')]['id'],_0x33710b[0x0][_0x7e0e('0x34')][_0x7e0e('0x35')],_0x33710b[0x0][_0x7e0e('0x34')][_0x7e0e('0x1e')]);}logger[_0x7e0e('0x10')](_0x7e0e('0x20'),_0x456a4c,JSON[_0x7e0e('0x11')](_0x33710b));_0x5392f5(_0x33710b);})['catch'](function(_0x342511){logger['error']('GetContactDialer',_0x342511[_0x7e0e('0x13')],_0x456a4c);_0x596b89(_0x3e17dd[_0x7e0e('0x14')](0x1f4,_0x342511[_0x7e0e('0x13')]));});});});};exports[_0x7e0e('0x36')]=function(_0x4956c0){var _0x315e25=this;return new Promise(function(_0x1c093e,_0x10a315){return db[_0x7e0e('0x37')][_0x7e0e('0x23')](function(_0x4becfa){return db[_0x7e0e('0x38')][_0x7e0e('0x19')](_0x4956c0[_0x7e0e('0x1d')],{'raw':_0x4956c0[_0x7e0e('0x6')]?_0x4956c0['options'][_0x7e0e('0x7')]===undefined?!![]:![]:!![],'transaction':_0x4becfa})[_0x7e0e('0xe')](function(){logger[_0x7e0e('0x18')](_0x7e0e('0x39'),JSON[_0x7e0e('0x11')](_0x4956c0['options']['where']),_0x4956c0[_0x7e0e('0x6')][_0x7e0e('0x8')]['active']);return db[_0x7e0e('0x16')][_0x7e0e('0x3a')]({'where':_0x4956c0[_0x7e0e('0x6')]?_0x4956c0[_0x7e0e('0x6')][_0x7e0e('0x8')]||null:null,'transaction':_0x4becfa});});})['then'](function(_0x1bd407){logger[_0x7e0e('0x18')](_0x7e0e('0x36'),_0x4956c0);logger['debug'](_0x7e0e('0x36'),_0x4956c0,JSON[_0x7e0e('0x11')](_0x1bd407));_0x1c093e(_0x1bd407);})['catch'](function(_0x1aff06){logger[_0x7e0e('0x14')](_0x7e0e('0x36'),_0x1aff06[_0x7e0e('0x13')],_0x4956c0);_0x10a315(_0x315e25['error'](0x1f4,_0x1aff06[_0x7e0e('0x13')]));});});};exports[_0x7e0e('0x3b')]=function(_0x5aa338){var _0x535078=this;return new Promise(function(_0x4cf54e,_0x2d3605){return db[_0x7e0e('0x16')]['findAll']({'raw':_0x5aa338[_0x7e0e('0x6')]?_0x5aa338[_0x7e0e('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x5aa338[_0x7e0e('0x6')]?_0x5aa338[_0x7e0e('0x6')][_0x7e0e('0x8')]||null:null,'attributes':[[db[_0x7e0e('0x37')]['fn'](_0x7e0e('0x3c'),db[_0x7e0e('0x37')]['fn']('IF',db[_0x7e0e('0x37')]['literal']('`scheduledat`\x20>=\x20'+util[_0x7e0e('0x3d')](_0x7e0e('0x3e'),moment()[_0x7e0e('0x3d')](_0x7e0e('0x3f')))+_0x7e0e('0x40')))),_0x7e0e('0x41')]]})['then'](function(_0x23584f){logger[_0x7e0e('0x18')](_0x7e0e('0x3b'),_0x5aa338);logger[_0x7e0e('0x10')](_0x7e0e('0x3b'),_0x5aa338,JSON['stringify'](_0x23584f));_0x4cf54e(_0x23584f);})[_0x7e0e('0x12')](function(_0x59a077){logger['error']('CountReScheduled',_0x59a077[_0x7e0e('0x13')],_0x5aa338);_0x2d3605(_0x535078[_0x7e0e('0x14')](0x1f4,_0x59a077['message']));});});};exports[_0x7e0e('0x42')]=function(_0xb6841c){var _0x57a506=this;return new Promise(function(_0x1beecf,_0xbe26b8){return db[_0x7e0e('0x21')][_0x7e0e('0x22')]()[_0x7e0e('0xe')](function(){return db[_0x7e0e('0x37')]['transaction'](function(_0x8b3b78){return db['CmHopper'][_0x7e0e('0x5')]({'where':_0xb6841c[_0x7e0e('0x6')]?_0xb6841c['options'][_0x7e0e('0x8')]||null:null,'attributes':_0xb6841c[_0x7e0e('0x6')]?_0xb6841c[_0x7e0e('0x6')][_0x7e0e('0xd')]||null:null,'limit':0x1,'order':_0xb6841c[_0x7e0e('0x6')]?_0xb6841c[_0x7e0e('0x6')][_0x7e0e('0x24')]||null:null,'group':db['CmHopper'][_0x7e0e('0x2e')],'transaction':_0x8b3b78,'lock':_0x8b3b78[_0x7e0e('0x25')][_0x7e0e('0x26')],'include':_0xb6841c['options']?_0xb6841c[_0x7e0e('0x6')][_0x7e0e('0xb')]?_[_0x7e0e('0xa')](_0xb6841c[_0x7e0e('0x6')][_0x7e0e('0xb')],function(_0x3b5094){return{'model':db[_0x3b5094['model']],'as':_0x3b5094['as'],'attributes':_0x3b5094[_0x7e0e('0xd')],'include':_0x3b5094[_0x7e0e('0xb')]?_[_0x7e0e('0xa')](_0x3b5094[_0x7e0e('0xb')],function(_0x46cf11){return{'model':db[_0x46cf11[_0x7e0e('0xc')]],'as':_0x46cf11['as'],'attributes':_0x46cf11[_0x7e0e('0xd')],'include':_0x46cf11[_0x7e0e('0xb')]?_['map'](_0x46cf11[_0x7e0e('0xb')],function(_0x473bc7){return{'model':db[_0x473bc7[_0x7e0e('0xc')]],'as':_0x473bc7['as'],'attributes':_0x473bc7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a7dc1){var _0x46b6b2=[];for(var _0x30e22f=0x0;_0x30e22f<_0x2a7dc1[_0x7e0e('0x2d')];_0x30e22f+=0x1){_0x46b6b2[_0x7e0e('0x2f')](_0x2a7dc1[_0x30e22f]['update'](_0xb6841c[_0x7e0e('0x1d')],{'transaction':_0x8b3b78}));}return BPromise['all'](_0x46b6b2);});})[_0x7e0e('0xe')](function(_0x3d47e7){logger[_0x7e0e('0x18')](_0x7e0e('0x42'),_0xb6841c);logger[_0x7e0e('0x10')](_0x7e0e('0x42'),_0xb6841c,JSON[_0x7e0e('0x11')](_0x3d47e7));_0x1beecf(_0x3d47e7);})[_0x7e0e('0x12')](function(_0x19f602){logger['error'](_0x7e0e('0x42'),_0x19f602[_0x7e0e('0x13')],_0xb6841c);_0xbe26b8(_0x57a506[_0x7e0e('0x14')](0x1f4,_0x19f602[_0x7e0e('0x13')]));});});});};exports[_0x7e0e('0x43')]=function(_0x17beb5){var _0x2d52d0=this;return new Promise(function(_0x1f0282,_0x496f61){db[_0x7e0e('0x21')]['describe']()['then'](function(_0x156f04){return db['CmHopper'][_0x7e0e('0x5')]({'raw':_0x17beb5[_0x7e0e('0x6')]?_0x17beb5[_0x7e0e('0x6')][_0x7e0e('0x7')]===undefined?!![]:![]:!![],'where':_0x17beb5['options']?_0x17beb5[_0x7e0e('0x6')][_0x7e0e('0x8')]||null:null,'attributes':_0x17beb5[_0x7e0e('0x6')]?_0x17beb5[_0x7e0e('0x6')][_0x7e0e('0xd')]||null:null,'limit':_0x17beb5[_0x7e0e('0x6')]?_0x17beb5[_0x7e0e('0x6')][_0x7e0e('0x9')]||null:null,'include':_0x17beb5[_0x7e0e('0x6')]?_0x17beb5[_0x7e0e('0x6')][_0x7e0e('0xb')]?_['map'](_0x17beb5[_0x7e0e('0x6')][_0x7e0e('0xb')],function(_0x1be775){return{'model':db[_0x1be775[_0x7e0e('0xc')]],'as':_0x1be775['as'],'attributes':_0x1be775['as']===_0x7e0e('0x27')?_[_0x7e0e('0x28')](_0x156f04):_0x1be775[_0x7e0e('0xd')],'include':_0x1be775[_0x7e0e('0xb')]?_['map'](_0x1be775[_0x7e0e('0xb')],function(_0x106117){return{'model':db[_0x106117[_0x7e0e('0xc')]],'as':_0x106117['as'],'attributes':_0x106117[_0x7e0e('0xd')],'include':_0x106117[_0x7e0e('0xb')]?_[_0x7e0e('0xa')](_0x106117[_0x7e0e('0xb')],function(_0x5192f2){return{'model':db[_0x5192f2['model']],'as':_0x5192f2['as'],'attributes':_0x5192f2[_0x7e0e('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7e0e('0xe')](function(_0x264d2d){logger[_0x7e0e('0x18')](_0x7e0e('0xf'),_0x17beb5);logger[_0x7e0e('0x10')]('GetCmHopper',_0x17beb5,JSON[_0x7e0e('0x11')](_0x264d2d));_0x1f0282(_0x264d2d);})[_0x7e0e('0x12')](function(_0x85534c){logger[_0x7e0e('0x14')](_0x7e0e('0xf'),_0x85534c['message'],_0x17beb5);_0x496f61(_0x2d52d0[_0x7e0e('0x14')](0x1f4,_0x85534c[_0x7e0e('0x13')]));});});});};exports['GetContactByPhone']=function(_0x48ee3a){var _0x41db03=this;return new Promise(function(_0x311315,_0x47122b){return db[_0x7e0e('0x21')]['findOne']({'raw':!![],'where':{'phone':_0x48ee3a[_0x7e0e('0x6')]['where'][_0x7e0e('0x44')]},'attributes':['id','dialTimezone'],'order':[['id',_0x7e0e('0x45')]]})[_0x7e0e('0xe')](function(_0x8296c){logger[_0x7e0e('0x18')]('getContactByPhone',_0x48ee3a);logger['debug']('getContactByPhone',_0x48ee3a,JSON['stringify'](_0x8296c));_0x311315(_0x8296c);})['catch'](function(_0xd8f0b6){logger[_0x7e0e('0x14')](_0x7e0e('0x46'),_0xd8f0b6['message'],_0x48ee3a);_0x47122b(_0x41db03['error'](0x1f4,_0xd8f0b6[_0x7e0e('0x13')]));});});};exports[_0x7e0e('0x47')]=function(_0x189f38){var _0x195bf5=this;return new Promise(function(_0x55c126,_0x47d8f6){return db[_0x7e0e('0x37')][_0x7e0e('0x23')](function(_0x3e4435){var _0x2743d=_0x189f38[_0x7e0e('0x6')]&&_0x189f38[_0x7e0e('0x6')][_0x7e0e('0x8')]?_0x189f38[_0x7e0e('0x6')][_0x7e0e('0x8')]:{};return db['CmHopper'][_0x7e0e('0x30')](_0x189f38[_0x7e0e('0x1d')],{'where':_0x2743d,'transaction':_0x3e4435})[_0x7e0e('0xe')](function(_0xc08a67){logger[_0x7e0e('0x18')](_0x7e0e('0x47'),_0x189f38);logger[_0x7e0e('0x10')](_0x7e0e('0x47'),_0x189f38,JSON[_0x7e0e('0x11')](_0xc08a67));_0x55c126(_0xc08a67);})[_0x7e0e('0x12')](function(_0x536ac8){logger[_0x7e0e('0x14')](_0x7e0e('0x47'),_0x536ac8[_0x7e0e('0x13')],_0x189f38);_0x47d8f6(_0x195bf5[_0x7e0e('0x14')](0x1f4,_0x536ac8[_0x7e0e('0x13')]));});});});};exports[_0x7e0e('0x48')]=function(_0x460128){var _0x68d7de=this;var _0x1fd10f=_0x460128[_0x7e0e('0x1d')]['where'][_0x7e0e('0x49')];var _0x4648f8=_0x460128[_0x7e0e('0x1d')][_0x7e0e('0x8')][_0x7e0e('0x4a')];var _0x5cca4d=_0x460128[_0x7e0e('0x1d')][_0x7e0e('0x8')]['availableAgentsIds'];return new Promise(function(_0x5cd487,_0x75060c){return db[_0x7e0e('0x16')][_0x7e0e('0x5')]({'where':{'voiceQueueId':{'$in':_0x1fd10f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7e0e('0x37')][_0x7e0e('0x4b')](_0x7e0e('0x4c')+_0x4648f8+_0x7e0e('0x4d')),'$gt':db[_0x7e0e('0x37')][_0x7e0e('0x4b')](_0x7e0e('0x4e'))}},'UserId':{'$in':_0x5cca4d}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0x7e0e('0x29')],'as':_0x7e0e('0x2a'),'attributes':['id','name',_0x7e0e('0x2c')]},{'model':db['CmList'],'as':'List'}]})[_0x7e0e('0xe')](function(_0xb4ebd){if(_0xb4ebd[_0x7e0e('0x2d')]>0x0){return db[_0x7e0e('0x37')][_0x7e0e('0x23')](function(_0x205d56){return db[_0x7e0e('0x16')][_0x7e0e('0x30')]({'recallmeNotifiedDate':db['sequelize'][_0x7e0e('0x4b')]('NOW()')},{'where':{'id':{'$in':_[_0x7e0e('0xa')](_0xb4ebd,'id')}},'transaction':_0x205d56})[_0x7e0e('0xe')](function(){_0x5cd487(_0xb4ebd);})[_0x7e0e('0x12')](function(_0x3f6860){logger[_0x7e0e('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x3f6860[_0x7e0e('0x13')],_0x460128);_0x75060c(_0x68d7de['error'](0x1f4,_0x3f6860[_0x7e0e('0x13')]));});})[_0x7e0e('0x12')](function(_0x20e304){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x20e304[_0x7e0e('0x13')],_0x460128);_0x75060c(_0x68d7de[_0x7e0e('0x14')](0x1f4,_0x20e304[_0x7e0e('0x13')]));});}else{_0x5cd487(_0xb4ebd);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 7b054a0..44276ea 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 _0x9071=['describe','/opencontacts','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update','delete','exports','Router','../../components/auth/service','get','isAuthenticated','/describe'];(function(_0x469cae,_0x22fd94){var _0x4f85aa=function(_0x20a62f){while(--_0x20a62f){_0x469cae['push'](_0x469cae['shift']());}};_0x4f85aa(++_0x22fd94);}(_0x9071,0x16b));var _0x1907=function(_0x399d08,_0x314da5){_0x399d08=_0x399d08-0x0;var _0x46edd2=_0x9071[_0x399d08];return _0x46edd2;};'use strict';var express=require('express');var router=express[_0x1907('0x0')]();var auth=require(_0x1907('0x1'));var controller=require('./cmHopper.controller');router[_0x1907('0x2')]('/',auth[_0x1907('0x3')](),controller['index']);router[_0x1907('0x2')](_0x1907('0x4'),auth[_0x1907('0x3')](),controller[_0x1907('0x5')]);router[_0x1907('0x2')](_0x1907('0x6'),auth[_0x1907('0x3')](),controller[_0x1907('0x7')]);router['get'](_0x1907('0x8'),auth[_0x1907('0x3')](),controller['getTimezones']);router[_0x1907('0x2')](_0x1907('0x9'),auth[_0x1907('0x3')](),controller[_0x1907('0xa')]);router[_0x1907('0x2')](_0x1907('0xb'),auth[_0x1907('0x3')](),controller[_0x1907('0xc')]);router[_0x1907('0xd')]('/',auth['isAuthenticated'](),controller[_0x1907('0xe')]);router['post'](_0x1907('0xf'),auth[_0x1907('0x3')](),controller[_0x1907('0x10')]);router[_0x1907('0xd')](_0x1907('0x11'),auth[_0x1907('0x3')](),controller[_0x1907('0x12')]);router[_0x1907('0x13')](_0x1907('0x9'),auth[_0x1907('0x3')](),controller[_0x1907('0x14')]);router[_0x1907('0x15')](_0x1907('0x9'),auth[_0x1907('0x3')](),controller['destroy']);module[_0x1907('0x16')]=router; \ No newline at end of file +var _0x935d=['getPreview','/timezone','getTimezone','delete','destroy','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','/timezones','/:id','show','getPreviewRecall','create','post'];(function(_0x85d355,_0x546c82){var _0x31057a=function(_0x5d5dbc){while(--_0x5d5dbc){_0x85d355['push'](_0x85d355['shift']());}};_0x31057a(++_0x546c82);}(_0x935d,0xa5));var _0xd935=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x935d[_0x4bacb6];return _0x58c029;};'use strict';var express=require(_0xd935('0x0'));var router=express[_0xd935('0x1')]();var auth=require(_0xd935('0x2'));var controller=require(_0xd935('0x3'));router[_0xd935('0x4')]('/',auth[_0xd935('0x5')](),controller[_0xd935('0x6')]);router[_0xd935('0x4')]('/describe',auth[_0xd935('0x5')](),controller['describe']);router['get'](_0xd935('0x7'),auth[_0xd935('0x5')](),controller[_0xd935('0x8')]);router['get'](_0xd935('0x9'),auth[_0xd935('0x5')](),controller['getTimezones']);router['get'](_0xd935('0xa'),auth[_0xd935('0x5')](),controller[_0xd935('0xb')]);router[_0xd935('0x4')]('/:id/previewrecall',auth[_0xd935('0x5')](),controller[_0xd935('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd935('0xd')]);router[_0xd935('0xe')]('/preview',auth[_0xd935('0x5')](),controller[_0xd935('0xf')]);router[_0xd935('0xe')](_0xd935('0x10'),auth[_0xd935('0x5')](),controller[_0xd935('0x11')]);router['put'](_0xd935('0xa'),auth[_0xd935('0x5')](),controller['update']);router[_0xd935('0x12')]('/:id',auth[_0xd935('0x5')](),controller[_0xd935('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 46021c5..8fd01cd 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6173=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','INTEGER','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6173,0x156));var _0x3617=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6173[_0x1035c1];return _0x308d67;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x3617('0x0')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x3617('0x2')],'defaultValue':moment()[_0x3617('0x3')](_0x3617('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3617('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x95f4=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x95f4,0x190));var _0x495f=function(_0x371bed,_0x3480ea){_0x371bed=_0x371bed-0x0;var _0x1405f2=_0x95f4[_0x371bed];return _0x1405f2;};'use strict';var moment=require(_0x495f('0x0'));var Sequelize=require(_0x495f('0x1'));module[_0x495f('0x2')]={'CmHopperId':{'type':Sequelize[_0x495f('0x3')]},'phone':{'type':Sequelize[_0x495f('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x495f('0x5')],'defaultValue':moment()['format'](_0x495f('0x6'))},'countbusyretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x495f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 8fd108d..b4fb27c 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a5a=['options','CmHopperAdditionalPhone','includeAll','include','findAll','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge'];(function(_0x1741c2,_0x22b19c){var _0x3ed7d=function(_0x415158){while(--_0x415158){_0x1741c2['push'](_0x1741c2['shift']());}};_0x3ed7d(++_0x22b19c);}(_0x2a5a,0x10a));var _0xa2a5=function(_0x305d91,_0x273939){_0x305d91=_0x305d91-0x0;var _0x5a545d=_0x2a5a[_0x305d91];return _0x5a545d;};'use strict';var emlformat=require(_0xa2a5('0x0'));var rimraf=require(_0xa2a5('0x1'));var zipdir=require(_0xa2a5('0x2'));var jsonpatch=require(_0xa2a5('0x3'));var rp=require(_0xa2a5('0x4'));var moment=require(_0xa2a5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa2a5('0x6'));var path=require(_0xa2a5('0x7'));var sox=require('sox');var csv=require(_0xa2a5('0x8'));var ejs=require(_0xa2a5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2a5('0xa'));var squel=require(_0xa2a5('0xb'));var crypto=require('crypto');var jsforce=require(_0xa2a5('0xc'));var deskjs=require(_0xa2a5('0xd'));var toCsv=require(_0xa2a5('0x8'));var querystring=require(_0xa2a5('0xe'));var Papa=require(_0xa2a5('0xf'));var Redis=require('ioredis');var authService=require(_0xa2a5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa2a5('0x11'));var logger=require('../../config/logger')(_0xa2a5('0x12'));var utils=require(_0xa2a5('0x13'));var config=require(_0xa2a5('0x14'));var licenseUtil=require(_0xa2a5('0x15'));var db=require(_0xa2a5('0x16'))['db'];function respondWithStatusCode(_0x167ed1,_0x3386ae){_0x3386ae=_0x3386ae||0xcc;return function(_0x4a7e1a){if(_0x4a7e1a){return _0x167ed1[_0xa2a5('0x17')](_0x3386ae);}return _0x167ed1['status'](_0x3386ae)[_0xa2a5('0x18')]();};}function respondWithResult(_0x334234,_0x1a1d47){_0x1a1d47=_0x1a1d47||0xc8;return function(_0x1be6ab){if(_0x1be6ab){return _0x334234[_0xa2a5('0x19')](_0x1a1d47)[_0xa2a5('0x1a')](_0x1be6ab);}};}function respondWithFilteredResult(_0x186df9,_0x45909d){return function(_0x4ccdf6){if(_0x4ccdf6){var _0x9c074f=typeof _0x45909d['offset']==='undefined'&&typeof _0x45909d['limit']==='undefined';var _0x2c3e94=_0x4ccdf6[_0xa2a5('0x1b')];var _0x43dec1=_0x9c074f?0x0:_0x45909d[_0xa2a5('0x1c')];var _0xd46a0d=_0x9c074f?_0x4ccdf6[_0xa2a5('0x1b')]:_0x45909d[_0xa2a5('0x1c')]+_0x45909d[_0xa2a5('0x1d')];var _0x223e2f;if(_0xd46a0d>=_0x2c3e94){_0xd46a0d=_0x2c3e94;_0x223e2f=0xc8;}else{_0x223e2f=0xce;}_0x186df9[_0xa2a5('0x19')](_0x223e2f);return _0x186df9[_0xa2a5('0x1e')](_0xa2a5('0x1f'),_0x43dec1+'-'+_0xd46a0d+'/'+_0x2c3e94)[_0xa2a5('0x1a')](_0x4ccdf6);}return null;};}function patchUpdates(_0x2d2174){return function(_0x429f34){try{jsonpatch[_0xa2a5('0x20')](_0x429f34,_0x2d2174,!![]);}catch(_0x1f6415){return BPromise[_0xa2a5('0x21')](_0x1f6415);}return _0x429f34['save']();};}function saveUpdates(_0x404549,_0x1895f6){return function(_0x58dc7b){if(_0x58dc7b){return _0x58dc7b[_0xa2a5('0x22')](_0x404549)[_0xa2a5('0x23')](function(_0x179bc9){return _0x179bc9;});}return null;};}function removeEntity(_0x20e0ee,_0x1e9aa0){return function(_0x4b50bb){if(_0x4b50bb){return _0x4b50bb[_0xa2a5('0x24')]()['then'](function(){var _0x49ac0c=_0x4b50bb['get']({'plain':!![]});var _0x118b5e=_0xa2a5('0x25');return db[_0xa2a5('0x26')][_0xa2a5('0x24')]({'where':{'type':_0x118b5e,'resourceId':_0x49ac0c['id']}})[_0xa2a5('0x23')](function(){return _0x4b50bb;});})[_0xa2a5('0x23')](function(){_0x20e0ee[_0xa2a5('0x19')](0xcc)[_0xa2a5('0x18')]();});}};}function handleEntityNotFound(_0x49770d,_0x48cabd){return function(_0x5c9fa7){if(!_0x5c9fa7){_0x49770d[_0xa2a5('0x17')](0x194);}return _0x5c9fa7;};}function handleError(_0x5e61bb,_0x138553){_0x138553=_0x138553||0x1f4;return function(_0x50dc15){logger[_0xa2a5('0x27')](_0x50dc15[_0xa2a5('0x28')]);if(_0x50dc15['name']){delete _0x50dc15[_0xa2a5('0x29')];}_0x5e61bb[_0xa2a5('0x19')](_0x138553)[_0xa2a5('0x2a')](_0x50dc15);};}exports[_0xa2a5('0x2b')]=function(_0x45ca62,_0x37535a){var _0x788847={},_0x12de21={},_0x2d16e1={'count':0x0,'rows':[]};var _0x180442=_[_0xa2a5('0x2c')](db['CmHopperAdditionalPhone'][_0xa2a5('0x2d')],function(_0x5620d0){return{'name':_0x5620d0['fieldName'],'type':_0x5620d0['type'][_0xa2a5('0x2e')]};});_0x12de21[_0xa2a5('0x2f')]=_[_0xa2a5('0x2c')](_0x180442,_0xa2a5('0x29'));_0x12de21[_0xa2a5('0x30')]=_['keys'](_0x45ca62[_0xa2a5('0x30')]);_0x12de21[_0xa2a5('0x31')]=_['intersection'](_0x12de21[_0xa2a5('0x2f')],_0x12de21[_0xa2a5('0x30')]);_0x788847[_0xa2a5('0x32')]=_[_0xa2a5('0x33')](_0x12de21[_0xa2a5('0x2f')],qs[_0xa2a5('0x34')](_0x45ca62[_0xa2a5('0x30')][_0xa2a5('0x34')]));_0x788847[_0xa2a5('0x32')]=_0x788847[_0xa2a5('0x32')][_0xa2a5('0x35')]?_0x788847['attributes']:_0x12de21[_0xa2a5('0x2f')];if(!_0x45ca62[_0xa2a5('0x30')][_0xa2a5('0x36')]('nolimit')){_0x788847[_0xa2a5('0x1d')]=qs[_0xa2a5('0x1d')](_0x45ca62[_0xa2a5('0x30')][_0xa2a5('0x1d')]);_0x788847['offset']=qs[_0xa2a5('0x1c')](_0x45ca62[_0xa2a5('0x30')][_0xa2a5('0x1c')]);}_0x788847[_0xa2a5('0x37')]=qs[_0xa2a5('0x38')](_0x45ca62[_0xa2a5('0x30')]['sort']);_0x788847[_0xa2a5('0x39')]=qs['filters'](_[_0xa2a5('0x3a')](_0x45ca62[_0xa2a5('0x30')],_0x12de21[_0xa2a5('0x31')]),_0x180442);if(_0x45ca62['query']['filter']){_0x788847['where']=_['merge'](_0x788847[_0xa2a5('0x39')],{'$or':_[_0xa2a5('0x2c')](_0x180442,function(_0x4f91b5){if(_0x4f91b5['type']!==_0xa2a5('0x3b')){var _0x435e32={};_0x435e32[_0x4f91b5[_0xa2a5('0x29')]]={'$like':'%'+_0x45ca62['query'][_0xa2a5('0x3c')]+'%'};return _0x435e32;}})});}_0x788847=_[_0xa2a5('0x3d')]({},_0x788847,_0x45ca62[_0xa2a5('0x3e')]);var _0x4b2440={'where':_0x788847[_0xa2a5('0x39')]};return db[_0xa2a5('0x3f')][_0xa2a5('0x1b')](_0x4b2440)[_0xa2a5('0x23')](function(_0x3410a6){_0x2d16e1[_0xa2a5('0x1b')]=_0x3410a6;if(_0x45ca62[_0xa2a5('0x30')][_0xa2a5('0x40')]){_0x788847[_0xa2a5('0x41')]=[{'all':!![]}];}return db[_0xa2a5('0x3f')][_0xa2a5('0x42')](_0x788847);})['then'](function(_0x474f37){_0x2d16e1['rows']=_0x474f37;return _0x2d16e1;})[_0xa2a5('0x23')](respondWithFilteredResult(_0x37535a,_0x788847))[_0xa2a5('0x43')](handleError(_0x37535a,null));};exports[_0xa2a5('0x44')]=function(_0x28cc79,_0x5478de){var _0x557534={'raw':!![],'where':{'id':_0x28cc79[_0xa2a5('0x45')]['id']}},_0x2e70e9={};_0x2e70e9[_0xa2a5('0x2f')]=_[_0xa2a5('0x46')](db[_0xa2a5('0x3f')]['rawAttributes']);_0x2e70e9[_0xa2a5('0x30')]=_[_0xa2a5('0x46')](_0x28cc79[_0xa2a5('0x30')]);_0x2e70e9[_0xa2a5('0x31')]=_[_0xa2a5('0x33')](_0x2e70e9['model'],_0x2e70e9['query']);_0x557534[_0xa2a5('0x32')]=_[_0xa2a5('0x33')](_0x2e70e9[_0xa2a5('0x2f')],qs[_0xa2a5('0x34')](_0x28cc79[_0xa2a5('0x30')][_0xa2a5('0x34')]));_0x557534[_0xa2a5('0x32')]=_0x557534[_0xa2a5('0x32')][_0xa2a5('0x35')]?_0x557534['attributes']:_0x2e70e9[_0xa2a5('0x2f')];if(_0x28cc79['query'][_0xa2a5('0x40')]){_0x557534[_0xa2a5('0x41')]=[{'all':!![]}];}_0x557534=_[_0xa2a5('0x3d')]({},_0x557534,_0x28cc79['options']);return db[_0xa2a5('0x3f')][_0xa2a5('0x47')](_0x557534)[_0xa2a5('0x23')](handleEntityNotFound(_0x5478de,null))[_0xa2a5('0x23')](respondWithResult(_0x5478de,null))[_0xa2a5('0x43')](handleError(_0x5478de,null));};exports['create']=function(_0x56856c,_0x236e41){return db[_0xa2a5('0x3f')][_0xa2a5('0x48')](_0x56856c['body'],{})['then'](function(_0x26c8ce){var _0x319787=_0x56856c[_0xa2a5('0x49')][_0xa2a5('0x4a')]({'plain':!![]});if(!_0x319787)throw new Error(_0xa2a5('0x4b'));if(_0x319787[_0xa2a5('0x4c')]==='user'){var _0x57b08f=_0x26c8ce[_0xa2a5('0x4a')]({'plain':!![]});var _0x3e79d6='CmHopperAdditionalPhones';return db[_0xa2a5('0x4d')][_0xa2a5('0x47')]({'where':{'name':_0x3e79d6,'userProfileId':_0x319787[_0xa2a5('0x4e')]},'raw':!![]})['then'](function(_0xeebd30){if(_0xeebd30&&_0xeebd30[_0xa2a5('0x4f')]===0x0){return db[_0xa2a5('0x26')][_0xa2a5('0x48')]({'name':_0x57b08f[_0xa2a5('0x29')],'resourceId':_0x57b08f['id'],'type':_0xeebd30['name'],'sectionId':_0xeebd30['id']},{})[_0xa2a5('0x23')](function(){return _0x26c8ce;});}else{return _0x26c8ce;}})['catch'](function(_0x603e38){logger[_0xa2a5('0x27')](_0xa2a5('0x50'),_0x603e38);throw _0x603e38;});}return _0x26c8ce;})[_0xa2a5('0x23')](respondWithResult(_0x236e41,0xc9))[_0xa2a5('0x43')](handleError(_0x236e41,null));};exports['update']=function(_0x1f6bcf,_0x20d3bb){if(_0x1f6bcf[_0xa2a5('0x51')]['id']){delete _0x1f6bcf[_0xa2a5('0x51')]['id'];}return db[_0xa2a5('0x3f')][_0xa2a5('0x47')]({'where':{'id':_0x1f6bcf[_0xa2a5('0x45')]['id']}})['then'](handleEntityNotFound(_0x20d3bb,null))[_0xa2a5('0x23')](saveUpdates(_0x1f6bcf[_0xa2a5('0x51')],null))['then'](respondWithResult(_0x20d3bb,null))[_0xa2a5('0x43')](handleError(_0x20d3bb,null));};exports[_0xa2a5('0x24')]=function(_0x3364e5,_0x31b136){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x3364e5['params']['id']}})[_0xa2a5('0x23')](handleEntityNotFound(_0x31b136,null))[_0xa2a5('0x23')](removeEntity(_0x31b136,null))[_0xa2a5('0x43')](handleError(_0x31b136,null));}; \ No newline at end of file +var _0xc39a=['limit','offset','count','set','Content-Range','apply','reject','update','then','get','error','name','send','map','CmHopperAdditionalPhone','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined'];(function(_0x3ed4fc,_0x3678d7){var _0x2fd4d4=function(_0x543f2c){while(--_0x543f2c){_0x3ed4fc['push'](_0x3ed4fc['shift']());}};_0x2fd4d4(++_0x3678d7);}(_0xc39a,0x130));var _0xac39=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc39a[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xac39('0x0'));var rimraf=require(_0xac39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac39('0x2'));var moment=require(_0xac39('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac39('0x4'));var util=require(_0xac39('0x5'));var path=require(_0xac39('0x6'));var sox=require(_0xac39('0x7'));var csv=require(_0xac39('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac39('0x9'));var _=require('lodash');var squel=require(_0xac39('0xa'));var crypto=require('crypto');var jsforce=require(_0xac39('0xb'));var deskjs=require(_0xac39('0xc'));var toCsv=require(_0xac39('0x8'));var querystring=require(_0xac39('0xd'));var Papa=require(_0xac39('0xe'));var Redis=require(_0xac39('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xac39('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac39('0x11'))(_0xac39('0x12'));var utils=require(_0xac39('0x13'));var config=require(_0xac39('0x14'));var licenseUtil=require(_0xac39('0x15'));var db=require(_0xac39('0x16'))['db'];function respondWithStatusCode(_0x4e83d0,_0x192793){_0x192793=_0x192793||0xcc;return function(_0xa37405){if(_0xa37405){return _0x4e83d0[_0xac39('0x17')](_0x192793);}return _0x4e83d0['status'](_0x192793)[_0xac39('0x18')]();};}function respondWithResult(_0x4310dc,_0x3b60dc){_0x3b60dc=_0x3b60dc||0xc8;return function(_0x4aeb4b){if(_0x4aeb4b){return _0x4310dc[_0xac39('0x19')](_0x3b60dc)[_0xac39('0x1a')](_0x4aeb4b);}};}function respondWithFilteredResult(_0x1013bb,_0x3675f6){return function(_0x30d88b){if(_0x30d88b){var _0x148255=typeof _0x3675f6['offset']===_0xac39('0x1b')&&typeof _0x3675f6[_0xac39('0x1c')]===_0xac39('0x1b');var _0x3f630e=_0x30d88b['count'];var _0x444459=_0x148255?0x0:_0x3675f6[_0xac39('0x1d')];var _0x314df6=_0x148255?_0x30d88b[_0xac39('0x1e')]:_0x3675f6[_0xac39('0x1d')]+_0x3675f6['limit'];var _0x238859;if(_0x314df6>=_0x3f630e){_0x314df6=_0x3f630e;_0x238859=0xc8;}else{_0x238859=0xce;}_0x1013bb[_0xac39('0x19')](_0x238859);return _0x1013bb[_0xac39('0x1f')](_0xac39('0x20'),_0x444459+'-'+_0x314df6+'/'+_0x3f630e)[_0xac39('0x1a')](_0x30d88b);}return null;};}function patchUpdates(_0x45ec28){return function(_0x51d922){try{jsonpatch[_0xac39('0x21')](_0x51d922,_0x45ec28,!![]);}catch(_0x2f619b){return BPromise[_0xac39('0x22')](_0x2f619b);}return _0x51d922['save']();};}function saveUpdates(_0x285511,_0x1ff01b){return function(_0x5bf22b){if(_0x5bf22b){return _0x5bf22b[_0xac39('0x23')](_0x285511)[_0xac39('0x24')](function(_0x2bd616){return _0x2bd616;});}return null;};}function removeEntity(_0x4e6f48,_0x4d3312){return function(_0x113953){if(_0x113953){return _0x113953['destroy']()[_0xac39('0x24')](function(){var _0x45b90e=_0x113953[_0xac39('0x25')]({'plain':!![]});var _0x41fc2c='CmHopperAdditionalPhones';return db['UserProfileResource']['destroy']({'where':{'type':_0x41fc2c,'resourceId':_0x45b90e['id']}})[_0xac39('0x24')](function(){return _0x113953;});})[_0xac39('0x24')](function(){_0x4e6f48[_0xac39('0x19')](0xcc)[_0xac39('0x18')]();});}};}function handleEntityNotFound(_0x58fc4a,_0x13ee11){return function(_0x1e50ba){if(!_0x1e50ba){_0x58fc4a[_0xac39('0x17')](0x194);}return _0x1e50ba;};}function handleError(_0x56f9c3,_0x14fcda){_0x14fcda=_0x14fcda||0x1f4;return function(_0xae05fe){logger[_0xac39('0x26')](_0xae05fe['stack']);if(_0xae05fe[_0xac39('0x27')]){delete _0xae05fe['name'];}_0x56f9c3[_0xac39('0x19')](_0x14fcda)[_0xac39('0x28')](_0xae05fe);};}exports['index']=function(_0x289015,_0x544d2f){var _0xa6dbdb={},_0x63e88={},_0xb5622e={'count':0x0,'rows':[]};var _0xb192fc=_[_0xac39('0x29')](db[_0xac39('0x2a')]['rawAttributes'],function(_0x17ca46){return{'name':_0x17ca46[_0xac39('0x2b')],'type':_0x17ca46[_0xac39('0x2c')][_0xac39('0x2d')]};});_0x63e88[_0xac39('0x2e')]=_['map'](_0xb192fc,_0xac39('0x27'));_0x63e88[_0xac39('0x2f')]=_[_0xac39('0x30')](_0x289015[_0xac39('0x2f')]);_0x63e88[_0xac39('0x31')]=_[_0xac39('0x32')](_0x63e88[_0xac39('0x2e')],_0x63e88[_0xac39('0x2f')]);_0xa6dbdb[_0xac39('0x33')]=_[_0xac39('0x32')](_0x63e88[_0xac39('0x2e')],qs[_0xac39('0x34')](_0x289015['query'][_0xac39('0x34')]));_0xa6dbdb[_0xac39('0x33')]=_0xa6dbdb[_0xac39('0x33')][_0xac39('0x35')]?_0xa6dbdb[_0xac39('0x33')]:_0x63e88[_0xac39('0x2e')];if(!_0x289015[_0xac39('0x2f')][_0xac39('0x36')]('nolimit')){_0xa6dbdb[_0xac39('0x1c')]=qs[_0xac39('0x1c')](_0x289015[_0xac39('0x2f')][_0xac39('0x1c')]);_0xa6dbdb[_0xac39('0x1d')]=qs[_0xac39('0x1d')](_0x289015[_0xac39('0x2f')]['offset']);}_0xa6dbdb[_0xac39('0x37')]=qs[_0xac39('0x38')](_0x289015[_0xac39('0x2f')][_0xac39('0x38')]);_0xa6dbdb[_0xac39('0x39')]=qs[_0xac39('0x31')](_[_0xac39('0x3a')](_0x289015['query'],_0x63e88['filters']),_0xb192fc);if(_0x289015[_0xac39('0x2f')][_0xac39('0x3b')]){_0xa6dbdb[_0xac39('0x39')]=_[_0xac39('0x3c')](_0xa6dbdb[_0xac39('0x39')],{'$or':_[_0xac39('0x29')](_0xb192fc,function(_0x118b84){if(_0x118b84['type']!==_0xac39('0x3d')){var _0x1e46e7={};_0x1e46e7[_0x118b84[_0xac39('0x27')]]={'$like':'%'+_0x289015['query']['filter']+'%'};return _0x1e46e7;}})});}_0xa6dbdb=_[_0xac39('0x3c')]({},_0xa6dbdb,_0x289015['options']);var _0x314c73={'where':_0xa6dbdb[_0xac39('0x39')]};return db[_0xac39('0x2a')]['count'](_0x314c73)[_0xac39('0x24')](function(_0x194acf){_0xb5622e[_0xac39('0x1e')]=_0x194acf;if(_0x289015[_0xac39('0x2f')][_0xac39('0x3e')]){_0xa6dbdb[_0xac39('0x3f')]=[{'all':!![]}];}return db[_0xac39('0x2a')][_0xac39('0x40')](_0xa6dbdb);})[_0xac39('0x24')](function(_0x9e709){_0xb5622e[_0xac39('0x41')]=_0x9e709;return _0xb5622e;})[_0xac39('0x24')](respondWithFilteredResult(_0x544d2f,_0xa6dbdb))['catch'](handleError(_0x544d2f,null));};exports[_0xac39('0x42')]=function(_0x301975,_0x278e74){var _0x1ed97b={'raw':!![],'where':{'id':_0x301975['params']['id']}},_0x1e153c={};_0x1e153c['model']=_['keys'](db['CmHopperAdditionalPhone'][_0xac39('0x43')]);_0x1e153c[_0xac39('0x2f')]=_[_0xac39('0x30')](_0x301975[_0xac39('0x2f')]);_0x1e153c['filters']=_['intersection'](_0x1e153c[_0xac39('0x2e')],_0x1e153c['query']);_0x1ed97b['attributes']=_[_0xac39('0x32')](_0x1e153c[_0xac39('0x2e')],qs[_0xac39('0x34')](_0x301975[_0xac39('0x2f')]['fields']));_0x1ed97b[_0xac39('0x33')]=_0x1ed97b[_0xac39('0x33')]['length']?_0x1ed97b[_0xac39('0x33')]:_0x1e153c[_0xac39('0x2e')];if(_0x301975[_0xac39('0x2f')][_0xac39('0x3e')]){_0x1ed97b[_0xac39('0x3f')]=[{'all':!![]}];}_0x1ed97b=_[_0xac39('0x3c')]({},_0x1ed97b,_0x301975[_0xac39('0x44')]);return db[_0xac39('0x2a')][_0xac39('0x45')](_0x1ed97b)[_0xac39('0x24')](handleEntityNotFound(_0x278e74,null))[_0xac39('0x24')](respondWithResult(_0x278e74,null))[_0xac39('0x46')](handleError(_0x278e74,null));};exports[_0xac39('0x47')]=function(_0x5f19dc,_0x465df6){return db[_0xac39('0x2a')][_0xac39('0x47')](_0x5f19dc[_0xac39('0x48')],{})[_0xac39('0x24')](function(_0x102d30){var _0x2a4b1=_0x5f19dc[_0xac39('0x49')]['get']({'plain':!![]});if(!_0x2a4b1)throw new Error(_0xac39('0x4a'));if(_0x2a4b1['role']===_0xac39('0x49')){var _0x19a76f=_0x102d30[_0xac39('0x25')]({'plain':!![]});var _0x39c62c=_0xac39('0x4b');return db[_0xac39('0x4c')]['find']({'where':{'name':_0x39c62c,'userProfileId':_0x2a4b1[_0xac39('0x4d')]},'raw':!![]})['then'](function(_0x3d0471){if(_0x3d0471&&_0x3d0471[_0xac39('0x4e')]===0x0){return db[_0xac39('0x4f')][_0xac39('0x47')]({'name':_0x19a76f[_0xac39('0x27')],'resourceId':_0x19a76f['id'],'type':_0x3d0471[_0xac39('0x27')],'sectionId':_0x3d0471['id']},{})['then'](function(){return _0x102d30;});}else{return _0x102d30;}})[_0xac39('0x46')](function(_0x48ce9b){logger[_0xac39('0x26')](_0xac39('0x50'),_0x48ce9b);throw _0x48ce9b;});}return _0x102d30;})[_0xac39('0x24')](respondWithResult(_0x465df6,0xc9))[_0xac39('0x46')](handleError(_0x465df6,null));};exports[_0xac39('0x23')]=function(_0x10e90c,_0x5eb3b0){if(_0x10e90c[_0xac39('0x48')]['id']){delete _0x10e90c[_0xac39('0x48')]['id'];}return db[_0xac39('0x2a')]['find']({'where':{'id':_0x10e90c[_0xac39('0x51')]['id']}})[_0xac39('0x24')](handleEntityNotFound(_0x5eb3b0,null))[_0xac39('0x24')](saveUpdates(_0x10e90c[_0xac39('0x48')],null))[_0xac39('0x24')](respondWithResult(_0x5eb3b0,null))[_0xac39('0x46')](handleError(_0x5eb3b0,null));};exports[_0xac39('0x52')]=function(_0x17eee1,_0x2d5110){return db[_0xac39('0x2a')][_0xac39('0x45')]({'where':{'id':_0x17eee1[_0xac39('0x51')]['id']}})[_0xac39('0x24')](handleEntityNotFound(_0x2d5110,null))[_0xac39('0x24')](removeEntity(_0x2d5110,null))[_0xac39('0x46')](handleError(_0x2d5110,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index a8b651b..f25f90b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3590=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','cm_hopper_additional_phones','lodash'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3590,0x167));var _0x0359=function(_0x174158,_0x50e28b){_0x174158=_0x174158-0x0;var _0x748afa=_0x3590[_0x174158];return _0x748afa;};'use strict';var _=require(_0x0359('0x0'));var util=require(_0x0359('0x1'));var logger=require(_0x0359('0x2'))(_0x0359('0x3'));var moment=require('moment');var BPromise=require(_0x0359('0x4'));var rp=require(_0x0359('0x5'));var fs=require('fs');var path=require(_0x0359('0x6'));var rimraf=require(_0x0359('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x21e3d2,_0x3b06fc){return _0x21e3d2[_0x0359('0x8')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x0359('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0c2=['request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x436873,_0x3f6143){var _0x333709=function(_0x272272){while(--_0x272272){_0x436873['push'](_0x436873['shift']());}};_0x333709(++_0x3f6143);}(_0xb0c2,0x1aa));var _0x2b0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2b0c('0x0'));var util=require(_0x2b0c('0x1'));var logger=require(_0x2b0c('0x2'))(_0x2b0c('0x3'));var moment=require(_0x2b0c('0x4'));var BPromise=require(_0x2b0c('0x5'));var rp=require(_0x2b0c('0x6'));var fs=require('fs');var path=require(_0x2b0c('0x7'));var rimraf=require('rimraf');var config=require(_0x2b0c('0x8'));var attributes=require(_0x2b0c('0x9'));module[_0x2b0c('0xa')]=function(_0x5080d0,_0x55fc15){return _0x5080d0[_0x2b0c('0xb')]('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 3bfa8cf..50c6ca7 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf0=['countbusyretry','countabandonedretry','entity','SwapAdditionalPhones','CmHopper','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x4cf0,0x13a));var _0x04cf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4cf0[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x04cf('0x0'));var util=require(_0x04cf('0x1'));var moment=require(_0x04cf('0x2'));var BPromise=require(_0x04cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04cf('0x4'));var db=require(_0x04cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x04cf('0x6'))('rpc');var config=require(_0x04cf('0x7'));var jayson=require(_0x04cf('0x8'));var client=jayson[_0x04cf('0x9')][_0x04cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f2029,_0x1f055d,_0x225ae7){return new BPromise(function(_0x6fe5d4,_0x586a63){return client[_0x04cf('0xb')](_0x1f2029,_0x225ae7)['then'](function(_0x5b6a46){logger[_0x04cf('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1f055d,_0x04cf('0xd'));logger[_0x04cf('0xe')](_0x04cf('0xf'),_0x1f055d,_0x04cf('0xd'),JSON[_0x04cf('0x10')](_0x5b6a46));if(_0x5b6a46[_0x04cf('0x11')]){if(_0x5b6a46[_0x04cf('0x11')][_0x04cf('0x12')]===0x1f4){logger[_0x04cf('0x11')](_0x04cf('0x13'),_0x1f055d,_0x5b6a46[_0x04cf('0x11')]['message']);return _0x586a63(_0x5b6a46[_0x04cf('0x11')]['message']);}logger['error'](_0x04cf('0x13'),_0x1f055d,_0x5b6a46['error'][_0x04cf('0x14')]);return _0x6fe5d4(_0x5b6a46['error'][_0x04cf('0x14')]);}else{logger[_0x04cf('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1f055d,'request\x20sent');_0x6fe5d4(_0x5b6a46['result'][_0x04cf('0x14')]);}})[_0x04cf('0x15')](function(_0x9eafde){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1f055d,_0x9eafde);_0x586a63(_0x9eafde);});});}exports[_0x04cf('0x16')]=function(_0x3525d2){var _0x955111=this;return new Promise(function(_0x3bee15,_0x368507){return db['CmHopper'][_0x04cf('0x17')]({'raw':!![],'where':{'ContactId':_0x3525d2[_0x04cf('0x18')][_0x04cf('0x19')],'ListId':_0x3525d2[_0x04cf('0x18')][_0x04cf('0x1a')],'VoiceQueueId':_0x3525d2['body'][_0x04cf('0x1b')]===undefined?null:_0x3525d2[_0x04cf('0x18')]['VoiceQueueId'],'CampaignId':_0x3525d2[_0x04cf('0x18')][_0x04cf('0x1c')]===undefined?null:_0x3525d2[_0x04cf('0x18')][_0x04cf('0x1c')]}})[_0x04cf('0x1d')](function(_0x551761){if(_0x551761!=null){return db[_0x04cf('0x1e')][_0x04cf('0x17')]({'raw':!![],'where':{'CmHopperId':_0x551761['id'],'OrderBy':{'$gt':_0x551761[_0x04cf('0x1f')]}},'order':[[_0x04cf('0x1f'),_0x04cf('0x20')]]})[_0x04cf('0x1d')](function(_0x2b801f){var _0x2f1fcc=0x0;if(_0x2b801f){if(_0x2b801f['countbusyretry']+_0x2b801f[_0x04cf('0x21')]+_0x2b801f[_0x04cf('0x22')]+_0x2b801f[_0x04cf('0x23')]+_0x2b801f[_0x04cf('0x24')]+_0x2b801f['countabandonedretry']+_0x2b801f[_0x04cf('0x25')]+_0x2b801f[_0x04cf('0x26')]<_0x3525d2['entity'][_0x04cf('0x27')])_0x2f1fcc=0x1;_0x3bee15({'additional':_0x2f1fcc});}else{return db[_0x04cf('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x551761['id']},'order':[[_0x04cf('0x1f'),'ASC']]})[_0x04cf('0x1d')](function(_0x44143f){var _0x1b064d=0x0;if(_0x44143f){if(_0x44143f[_0x04cf('0x28')]+_0x44143f[_0x04cf('0x21')]+_0x44143f['countnoanswerretry']+_0x44143f['countnosuchnumberretry']+_0x44143f[_0x04cf('0x24')]+_0x44143f[_0x04cf('0x29')]+_0x44143f[_0x04cf('0x25')]+_0x44143f[_0x04cf('0x26')]<_0x3525d2[_0x04cf('0x2a')]['dialGlobalMaxRetry'])_0x1b064d=0x1;_0x3bee15({'additional':_0x1b064d});}else{_0x3bee15({'additional':0x0});}})[_0x04cf('0x15')](function(_0x41fde6){logger[_0x04cf('0x11')](_0x04cf('0x16'),_0x41fde6[_0x04cf('0x14')]);_0x368507(_0x955111['error'](0x1f4,_0x41fde6[_0x04cf('0x14')]));});}})[_0x04cf('0x15')](function(_0x1b63da){logger[_0x04cf('0x11')](_0x04cf('0x16'),_0x1b63da[_0x04cf('0x14')]);_0x368507(_0x955111[_0x04cf('0x11')](0x1f4,_0x1b63da[_0x04cf('0x14')]));});}else _0x3bee15({'additional':0x0});});});};exports[_0x04cf('0x2b')]=function(_0x38adbe){var _0x421ebb=this;return new Promise(function(_0x53b155,_0x4a6caf){return db[_0x04cf('0x2c')][_0x04cf('0x17')]({'raw':!![],'where':{'ContactId':_0x38adbe[_0x04cf('0x18')]['ContactId'],'ListId':_0x38adbe['body'][_0x04cf('0x1a')],'VoiceQueueId':_0x38adbe[_0x04cf('0x18')][_0x04cf('0x1b')]===undefined?null:_0x38adbe[_0x04cf('0x18')][_0x04cf('0x1b')],'CampaignId':_0x38adbe[_0x04cf('0x18')][_0x04cf('0x1c')]===undefined?null:_0x38adbe[_0x04cf('0x18')][_0x04cf('0x1c')]}})[_0x04cf('0x1d')](function(_0x1be0d8){if(_0x1be0d8!=null){return db[_0x04cf('0x1e')][_0x04cf('0x17')]({'raw':!![],'where':{'CmHopperId':_0x1be0d8['id'],'OrderBy':{'$gte':_0x1be0d8[_0x04cf('0x1f')]}},'order':[[_0x04cf('0x1f'),_0x04cf('0x20')]]})['then'](function(_0x213a97){if(_0x213a97)return activateAdditionalPhone(_0x1be0d8,_0x38adbe[_0x04cf('0x18')],_0x213a97,_0x38adbe['duration'],_0x38adbe[_0x04cf('0x2d')])['then'](function(_0x2cdb42){_0x53b155(_0x2cdb42);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x1be0d8['id']},'order':[['OrderBy',_0x04cf('0x20')]]})['then'](function(_0x5b52e6){if(_0x5b52e6)return activateAdditionalPhone(_0x1be0d8,_0x38adbe['body'],_0x5b52e6,_0x38adbe['duration'],_0x38adbe[_0x04cf('0x2d')])[_0x04cf('0x1d')](function(_0x767ba6){_0x53b155(_0x767ba6);});else{_0x53b155({'id':_0x1be0d8['id'],'phone':''});}})[_0x04cf('0x15')](function(_0x3d542d){logger[_0x04cf('0x11')](_0x04cf('0x16'),_0x3d542d[_0x04cf('0x14')]);_0x4a6caf(_0x421ebb['error'](0x1f4,_0x3d542d[_0x04cf('0x14')]));});}})['catch'](function(_0x40b95d){logger[_0x04cf('0x11')](_0x04cf('0x16'),_0x40b95d[_0x04cf('0x14')]);_0x4a6caf(_0x421ebb[_0x04cf('0x11')](0x1f4,_0x40b95d[_0x04cf('0x14')]));});}else _0x53b155(0x1);});});};function activateAdditionalPhone(_0x1bea28,_0x2a669b,_0x6af6a1,_0x5a39b9,_0xd309b2){return new Promise(function(_0x4b53d8,_0x48df49){var _0x892813;if(_['isNil'](_0x6af6a1[_0x04cf('0x2e')])){_0x6af6a1[_0x04cf('0x2e')]=moment();}if(moment()>moment(_0x6af6a1[_0x04cf('0x2e')])){_0x892813=moment()[_0x04cf('0x2f')](_0xd309b2||0x3,_0x04cf('0x30'));}else{if(_0x6af6a1[_0x04cf('0x1f')]==0x0){_0x892813=moment(_0x6af6a1[_0x04cf('0x2e')]);}else{_0x892813=moment()[_0x04cf('0x2f')](_0xd309b2||0x3,_0x04cf('0x30'));}}if(_[_0x04cf('0x31')](_0x892813)){_0x892813=moment()[_0x04cf('0x2f')](_0xd309b2||0x3,_0x04cf('0x30'));}var _0x32c151={'phone':_0x1bea28[_0x04cf('0x32')],'active':0x0,'OrderBy':_[_0x04cf('0x31')](_0x1bea28['OrderBy'])?0x0:_0x1bea28['OrderBy'],'scheduledat':moment()[_0x04cf('0x2f')](_0x5a39b9||0x1,_0x04cf('0x30')),'countbusyretry':_0x2a669b[_0x04cf('0x28')],'countcongestionretry':_0x2a669b['countcongestionretry'],'countnoanswerretry':_0x2a669b['countnoanswerretry'],'countnosuchnumberretry':_0x2a669b[_0x04cf('0x23')],'countdropretry':_0x2a669b[_0x04cf('0x24')],'countabandonedretry':_0x2a669b[_0x04cf('0x29')],'countmachineretry':_0x2a669b[_0x04cf('0x25')],'countagentrejectretry':_0x2a669b[_0x04cf('0x26')],'createdAt':_0x2a669b[_0x04cf('0x33')],'updatedAt':_0x2a669b[_0x04cf('0x34')]};var _0x5a6d9d={'CmHopperId':_0x1bea28['id'],'phone':_0x6af6a1['phone'],'active':0x0,'OrderBy':_['isNil'](_0x6af6a1[_0x04cf('0x1f')])?0x0:_0x6af6a1[_0x04cf('0x1f')],'scheduledat':_0x892813,'countbusyretry':_0x6af6a1[_0x04cf('0x28')],'countcongestionretry':_0x6af6a1[_0x04cf('0x21')],'countnoanswerretry':_0x6af6a1[_0x04cf('0x22')],'countnosuchnumberretry':_0x6af6a1[_0x04cf('0x23')],'countdropretry':_0x6af6a1[_0x04cf('0x24')],'countabandonedretry':_0x6af6a1[_0x04cf('0x29')],'countmachineretry':_0x6af6a1[_0x04cf('0x25')],'countagentrejectretry':_0x6af6a1[_0x04cf('0x26')],'createdAt':_0x6af6a1[_0x04cf('0x33')],'updatedAt':_0x6af6a1[_0x04cf('0x34')]};return db[_0x04cf('0x35')][_0x04cf('0x36')](function(_0x59cedb){return db[_0x04cf('0x1e')][_0x04cf('0x37')](_0x32c151,{'where':{'id':_0x6af6a1['id']}},{'transaction':_0x59cedb})[_0x04cf('0x1d')](function(){return db[_0x04cf('0x2c')][_0x04cf('0x37')](_0x5a6d9d,{'where':{'id':_0x1bea28['id']}},{'transaction':_0x59cedb});});})[_0x04cf('0x1d')](function(_0x467e30){_0x4b53d8({'id':_0x1bea28['id'],'phone':_0x6af6a1[_0x04cf('0x32')]});})[_0x04cf('0x15')](function(_0x209e2a){logger[_0x04cf('0x11')](_0x04cf('0x38'),_0x209e2a[_0x04cf('0x14')]);_0x48df49({'error':_0x209e2a[_0x04cf('0x14')]});});});}exports[_0x04cf('0x39')]=function(_0x5d2117){var _0x30e3dc=this;return new Promise(function(_0x388177,_0x3b03b5){return db[_0x04cf('0x2c')][_0x04cf('0x37')](_0x5d2117[_0x04cf('0x18')][_0x04cf('0x3a')],{'where':{'id':_0x5d2117['body']['id']}})[_0x04cf('0x1d')](function(_0x10e906){_0x388177(_0x10e906);})['catch'](function(_0x45fabc){logger['error'](_0x04cf('0x39'),_0x45fabc['message']);_0x3b03b5(_0x30e3dc[_0x04cf('0x11')](0x1f4,_0x45fabc['message']));});});}; \ No newline at end of file +var _0x13a3=['body','ContactId','ListId','VoiceQueueId','CampaignId','then','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','ASC','countcongestionretry','countdropretry','catch','duration','isNil','scheduledat','add','minutes','countagentrejectretry','createdAt','updatedAt','phone','sequelize','transaction','update','CmHopper','field','IncrementPreviewCounters','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','VerifyAdditionalPhones','findOne'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x13a3,0x102));var _0x313a=function(_0x1872bb,_0x91004d){_0x1872bb=_0x1872bb-0x0;var _0x17e08f=_0x13a3[_0x1872bb];return _0x17e08f;};'use strict';var _=require(_0x313a('0x0'));var util=require(_0x313a('0x1'));var moment=require(_0x313a('0x2'));var BPromise=require(_0x313a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x313a('0x4'))['db'];var utils=require(_0x313a('0x5'));var logger=require(_0x313a('0x6'))(_0x313a('0x7'));var config=require(_0x313a('0x8'));var jayson=require(_0x313a('0x9'));var client=jayson[_0x313a('0xa')][_0x313a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1afdc2,_0x31a964,_0x5525e4){return new BPromise(function(_0x30fb98,_0x5a9a3a){return client[_0x313a('0xc')](_0x1afdc2,_0x5525e4)['then'](function(_0x28549a){logger[_0x313a('0xd')](_0x313a('0xe'),_0x31a964,_0x313a('0xf'));logger['debug'](_0x313a('0x10'),_0x31a964,_0x313a('0xf'),JSON['stringify'](_0x28549a));if(_0x28549a[_0x313a('0x11')]){if(_0x28549a[_0x313a('0x11')][_0x313a('0x12')]===0x1f4){logger[_0x313a('0x11')](_0x313a('0xe'),_0x31a964,_0x28549a[_0x313a('0x11')][_0x313a('0x13')]);return _0x5a9a3a(_0x28549a[_0x313a('0x11')][_0x313a('0x13')]);}logger['error'](_0x313a('0xe'),_0x31a964,_0x28549a[_0x313a('0x11')]['message']);return _0x30fb98(_0x28549a[_0x313a('0x11')][_0x313a('0x13')]);}else{logger[_0x313a('0xd')](_0x313a('0xe'),_0x31a964,'request\x20sent');_0x30fb98(_0x28549a['result'][_0x313a('0x13')]);}})['catch'](function(_0x46cba4){logger[_0x313a('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x31a964,_0x46cba4);_0x5a9a3a(_0x46cba4);});});}exports[_0x313a('0x14')]=function(_0x27082a){var _0x1ea401=this;return new Promise(function(_0x14c331,_0x58c8a1){return db['CmHopper'][_0x313a('0x15')]({'raw':!![],'where':{'ContactId':_0x27082a[_0x313a('0x16')][_0x313a('0x17')],'ListId':_0x27082a['body'][_0x313a('0x18')],'VoiceQueueId':_0x27082a[_0x313a('0x16')][_0x313a('0x19')]===undefined?null:_0x27082a[_0x313a('0x16')][_0x313a('0x19')],'CampaignId':_0x27082a[_0x313a('0x16')][_0x313a('0x1a')]===undefined?null:_0x27082a[_0x313a('0x16')][_0x313a('0x1a')]}})[_0x313a('0x1b')](function(_0x4645cb){if(_0x4645cb!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4645cb['id'],'OrderBy':{'$gt':_0x4645cb[_0x313a('0x1c')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x45e2ef){var _0x29635c=0x0;if(_0x45e2ef){if(_0x45e2ef[_0x313a('0x1d')]+_0x45e2ef['countcongestionretry']+_0x45e2ef[_0x313a('0x1e')]+_0x45e2ef[_0x313a('0x1f')]+_0x45e2ef['countdropretry']+_0x45e2ef[_0x313a('0x20')]+_0x45e2ef[_0x313a('0x21')]+_0x45e2ef['countagentrejectretry']<_0x27082a[_0x313a('0x22')][_0x313a('0x23')])_0x29635c=0x1;_0x14c331({'additional':_0x29635c});}else{return db[_0x313a('0x24')][_0x313a('0x15')]({'raw':!![],'where':{'CmHopperId':_0x4645cb['id']},'order':[['OrderBy',_0x313a('0x25')]]})[_0x313a('0x1b')](function(_0x411a56){var _0x5520d2=0x0;if(_0x411a56){if(_0x411a56[_0x313a('0x1d')]+_0x411a56[_0x313a('0x26')]+_0x411a56[_0x313a('0x1e')]+_0x411a56[_0x313a('0x1f')]+_0x411a56[_0x313a('0x27')]+_0x411a56[_0x313a('0x20')]+_0x411a56[_0x313a('0x21')]+_0x411a56['countagentrejectretry']<_0x27082a[_0x313a('0x22')][_0x313a('0x23')])_0x5520d2=0x1;_0x14c331({'additional':_0x5520d2});}else{_0x14c331({'additional':0x0});}})[_0x313a('0x28')](function(_0x2d5b17){logger[_0x313a('0x11')]('VerifyAdditionalPhones',_0x2d5b17[_0x313a('0x13')]);_0x58c8a1(_0x1ea401[_0x313a('0x11')](0x1f4,_0x2d5b17[_0x313a('0x13')]));});}})[_0x313a('0x28')](function(_0x775679){logger[_0x313a('0x11')](_0x313a('0x14'),_0x775679[_0x313a('0x13')]);_0x58c8a1(_0x1ea401[_0x313a('0x11')](0x1f4,_0x775679[_0x313a('0x13')]));});}else _0x14c331({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x243a53){var _0x5e3606=this;return new Promise(function(_0x4f5af7,_0x184a8f){return db['CmHopper'][_0x313a('0x15')]({'raw':!![],'where':{'ContactId':_0x243a53[_0x313a('0x16')][_0x313a('0x17')],'ListId':_0x243a53['body'][_0x313a('0x18')],'VoiceQueueId':_0x243a53[_0x313a('0x16')][_0x313a('0x19')]===undefined?null:_0x243a53[_0x313a('0x16')][_0x313a('0x19')],'CampaignId':_0x243a53[_0x313a('0x16')][_0x313a('0x1a')]===undefined?null:_0x243a53[_0x313a('0x16')][_0x313a('0x1a')]}})[_0x313a('0x1b')](function(_0x509501){if(_0x509501!=null){return db[_0x313a('0x24')][_0x313a('0x15')]({'raw':!![],'where':{'CmHopperId':_0x509501['id'],'OrderBy':{'$gte':_0x509501[_0x313a('0x1c')]}},'order':[[_0x313a('0x1c'),'ASC']]})[_0x313a('0x1b')](function(_0x5cf36a){if(_0x5cf36a)return activateAdditionalPhone(_0x509501,_0x243a53[_0x313a('0x16')],_0x5cf36a,_0x243a53[_0x313a('0x29')],_0x243a53['waitTime'])[_0x313a('0x1b')](function(_0x1688af){_0x4f5af7(_0x1688af);});else{return db[_0x313a('0x24')][_0x313a('0x15')]({'raw':!![],'where':{'CmHopperId':_0x509501['id']},'order':[[_0x313a('0x1c'),_0x313a('0x25')]]})['then'](function(_0x1c181e){if(_0x1c181e)return activateAdditionalPhone(_0x509501,_0x243a53[_0x313a('0x16')],_0x1c181e,_0x243a53['duration'],_0x243a53['waitTime'])[_0x313a('0x1b')](function(_0x20cd1b){_0x4f5af7(_0x20cd1b);});else{_0x4f5af7({'id':_0x509501['id'],'phone':''});}})[_0x313a('0x28')](function(_0x5580b7){logger[_0x313a('0x11')](_0x313a('0x14'),_0x5580b7[_0x313a('0x13')]);_0x184a8f(_0x5e3606['error'](0x1f4,_0x5580b7[_0x313a('0x13')]));});}})[_0x313a('0x28')](function(_0x1eaf3e){logger[_0x313a('0x11')]('VerifyAdditionalPhones',_0x1eaf3e[_0x313a('0x13')]);_0x184a8f(_0x5e3606['error'](0x1f4,_0x1eaf3e[_0x313a('0x13')]));});}else _0x4f5af7(0x1);});});};function activateAdditionalPhone(_0x183489,_0x504f88,_0x148271,_0x45f7c0,_0x22272d){return new Promise(function(_0x300506,_0x4ca6d0){var _0x3886a8;if(_[_0x313a('0x2a')](_0x148271[_0x313a('0x2b')])){_0x148271[_0x313a('0x2b')]=moment();}if(moment()>moment(_0x148271[_0x313a('0x2b')])){_0x3886a8=moment()[_0x313a('0x2c')](_0x22272d||0x3,_0x313a('0x2d'));}else{if(_0x148271['OrderBy']==0x0){_0x3886a8=moment(_0x148271['scheduledat']);}else{_0x3886a8=moment()['add'](_0x22272d||0x3,_0x313a('0x2d'));}}if(_[_0x313a('0x2a')](_0x3886a8)){_0x3886a8=moment()[_0x313a('0x2c')](_0x22272d||0x3,_0x313a('0x2d'));}var _0x453218={'phone':_0x183489['phone'],'active':0x0,'OrderBy':_['isNil'](_0x183489[_0x313a('0x1c')])?0x0:_0x183489[_0x313a('0x1c')],'scheduledat':moment()[_0x313a('0x2c')](_0x45f7c0||0x1,_0x313a('0x2d')),'countbusyretry':_0x504f88[_0x313a('0x1d')],'countcongestionretry':_0x504f88[_0x313a('0x26')],'countnoanswerretry':_0x504f88[_0x313a('0x1e')],'countnosuchnumberretry':_0x504f88['countnosuchnumberretry'],'countdropretry':_0x504f88[_0x313a('0x27')],'countabandonedretry':_0x504f88[_0x313a('0x20')],'countmachineretry':_0x504f88[_0x313a('0x21')],'countagentrejectretry':_0x504f88[_0x313a('0x2e')],'createdAt':_0x504f88[_0x313a('0x2f')],'updatedAt':_0x504f88[_0x313a('0x30')]};var _0x2810cb={'CmHopperId':_0x183489['id'],'phone':_0x148271[_0x313a('0x31')],'active':0x0,'OrderBy':_[_0x313a('0x2a')](_0x148271['OrderBy'])?0x0:_0x148271['OrderBy'],'scheduledat':_0x3886a8,'countbusyretry':_0x148271['countbusyretry'],'countcongestionretry':_0x148271[_0x313a('0x26')],'countnoanswerretry':_0x148271[_0x313a('0x1e')],'countnosuchnumberretry':_0x148271['countnosuchnumberretry'],'countdropretry':_0x148271[_0x313a('0x27')],'countabandonedretry':_0x148271[_0x313a('0x20')],'countmachineretry':_0x148271[_0x313a('0x21')],'countagentrejectretry':_0x148271['countagentrejectretry'],'createdAt':_0x148271[_0x313a('0x2f')],'updatedAt':_0x148271[_0x313a('0x30')]};return db[_0x313a('0x32')][_0x313a('0x33')](function(_0x59e069){return db[_0x313a('0x24')][_0x313a('0x34')](_0x453218,{'where':{'id':_0x148271['id']}},{'transaction':_0x59e069})[_0x313a('0x1b')](function(){return db[_0x313a('0x35')][_0x313a('0x34')](_0x2810cb,{'where':{'id':_0x183489['id']}},{'transaction':_0x59e069});});})[_0x313a('0x1b')](function(_0x31226c){_0x300506({'id':_0x183489['id'],'phone':_0x148271[_0x313a('0x31')]});})['catch'](function(_0x160300){logger[_0x313a('0x11')]('activateAdditionalPhone',_0x160300[_0x313a('0x13')]);_0x4ca6d0({'error':_0x160300[_0x313a('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x54d46d){var _0xbcad07=this;return new Promise(function(_0x177072,_0x27aaa4){return db[_0x313a('0x35')][_0x313a('0x34')](_0x54d46d[_0x313a('0x16')][_0x313a('0x36')],{'where':{'id':_0x54d46d[_0x313a('0x16')]['id']}})[_0x313a('0x1b')](function(_0x57e791){_0x177072(_0x57e791);})[_0x313a('0x28')](function(_0x278623){logger[_0x313a('0x11')](_0x313a('0x37'),_0x278623[_0x313a('0x13')]);_0x27aaa4(_0xbcad07[_0x313a('0x11')](0x1f4,_0x278623[_0x313a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 0dddfaf..a68d748 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8581=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','util','path'];(function(_0x1d231f,_0x47f708){var _0x18fd60=function(_0x51eb89){while(--_0x51eb89){_0x1d231f['push'](_0x1d231f['shift']());}};_0x18fd60(++_0x47f708);}(_0x8581,0x163));var _0x1858=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x8581[_0x276468];return _0x36dc3a;};'use strict';var multer=require('multer');var util=require(_0x1858('0x0'));var path=require(_0x1858('0x1'));var timeout=require('connect-timeout');var express=require(_0x1858('0x2'));var router=express[_0x1858('0x3')]();var fs_extra=require(_0x1858('0x4'));var auth=require(_0x1858('0x5'));var interaction=require(_0x1858('0x6'));var config=require(_0x1858('0x7'));var controller=require(_0x1858('0x8'));router[_0x1858('0x9')]('/',auth[_0x1858('0xa')](),controller[_0x1858('0xb')]);router[_0x1858('0x9')](_0x1858('0xc'),auth[_0x1858('0xa')](),controller['show']);router[_0x1858('0xd')]('/',auth[_0x1858('0xa')](),controller[_0x1858('0xe')]);router['put']('/:id',auth[_0x1858('0xa')](),controller['update']);router[_0x1858('0xf')](_0x1858('0xc'),auth[_0x1858('0xa')](),controller[_0x1858('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbd20=['isAuthenticated','create','put','update','delete','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','show','post'];(function(_0x5c736b,_0x915334){var _0xd3161f=function(_0x14227c){while(--_0x14227c){_0x5c736b['push'](_0x5c736b['shift']());}};_0xd3161f(++_0x915334);}(_0xbd20,0x14a));var _0x0bd2=function(_0x53972e,_0x275c){_0x53972e=_0x53972e-0x0;var _0xc48fcf=_0xbd20[_0x53972e];return _0xc48fcf;};'use strict';var multer=require(_0x0bd2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0bd2('0x1'));var express=require(_0x0bd2('0x2'));var router=express[_0x0bd2('0x3')]();var fs_extra=require(_0x0bd2('0x4'));var auth=require(_0x0bd2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bd2('0x6'));var controller=require(_0x0bd2('0x7'));router[_0x0bd2('0x8')]('/',auth['isAuthenticated'](),controller[_0x0bd2('0x9')]);router[_0x0bd2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0bd2('0xa')]);router[_0x0bd2('0xb')]('/',auth[_0x0bd2('0xc')](),controller[_0x0bd2('0xd')]);router[_0x0bd2('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0bd2('0xf')]);router[_0x0bd2('0x10')](_0x0bd2('0x11'),auth[_0x0bd2('0xc')](),controller[_0x0bd2('0x12')]);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 f07d4c3..0b5d961 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 _0xef4e=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x1ed928,_0x3c33b0){var _0x36712a=function(_0x4cbcf6){while(--_0x4cbcf6){_0x1ed928['push'](_0x1ed928['shift']());}};_0x36712a(++_0x3c33b0);}(_0xef4e,0xc2));var _0xeef4=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xef4e[_0x40be86];return _0xda3c3b;};'use strict';var moment=require(_0xeef4('0x0'));var Sequelize=require(_0xeef4('0x1'));module[_0xeef4('0x2')]={'phone':{'type':Sequelize[_0xeef4('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xeef4('0x4')],'unique':_0xeef4('0x5')},'ListId':{'type':Sequelize[_0xeef4('0x4')],'unique':_0xeef4('0x5')},'VoiceQueueId':{'type':Sequelize[_0xeef4('0x4')],'unique':_0xeef4('0x5')}}; \ No newline at end of file +var _0x2171=['STRING','INTEGER','contactListQueue','sequelize','exports'];(function(_0x2a4555,_0x3fc654){var _0x1261fc=function(_0x1d269f){while(--_0x1d269f){_0x2a4555['push'](_0x2a4555['shift']());}};_0x1261fc(++_0x3fc654);}(_0x2171,0x143));var _0x1217=function(_0x188165,_0x4de657){_0x188165=_0x188165-0x0;var _0x2ab64a=_0x2171[_0x188165];return _0x2ab64a;};'use strict';var moment=require('moment');var Sequelize=require(_0x1217('0x0'));module[_0x1217('0x1')]={'phone':{'type':Sequelize[_0x1217('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x1217('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x1217('0x3')],'unique':_0x1217('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 339988d..7c3bb65 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 _0x3cfc=['count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','CmHopperBlack','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit'];(function(_0x486dce,_0xa9f04d){var _0x310dbd=function(_0x19258c){while(--_0x19258c){_0x486dce['push'](_0x486dce['shift']());}};_0x310dbd(++_0xa9f04d);}(_0x3cfc,0x1e2));var _0xc3cf=function(_0x297360,_0x48a996){_0x297360=_0x297360-0x0;var _0x5676a8=_0x3cfc[_0x297360];return _0x5676a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3cf('0x0'));var zipdir=require(_0xc3cf('0x1'));var jsonpatch=require(_0xc3cf('0x2'));var rp=require(_0xc3cf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc3cf('0x4'));var util=require(_0xc3cf('0x5'));var path=require(_0xc3cf('0x6'));var sox=require(_0xc3cf('0x7'));var csv=require(_0xc3cf('0x8'));var ejs=require(_0xc3cf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3cf('0xa'));var squel=require(_0xc3cf('0xb'));var crypto=require(_0xc3cf('0xc'));var jsforce=require(_0xc3cf('0xd'));var deskjs=require(_0xc3cf('0xe'));var toCsv=require(_0xc3cf('0x8'));var querystring=require(_0xc3cf('0xf'));var Papa=require(_0xc3cf('0x10'));var Redis=require(_0xc3cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc3cf('0x12'));var as=require(_0xc3cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3cf('0x14'))(_0xc3cf('0x15'));var utils=require(_0xc3cf('0x16'));var config=require(_0xc3cf('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20bd55,_0x55bb7a){_0x55bb7a=_0x55bb7a||0xcc;return function(_0x4ac423){if(_0x4ac423){return _0x20bd55[_0xc3cf('0x18')](_0x55bb7a);}return _0x20bd55[_0xc3cf('0x19')](_0x55bb7a)[_0xc3cf('0x1a')]();};}function respondWithResult(_0x3abe64,_0x23e4a8){_0x23e4a8=_0x23e4a8||0xc8;return function(_0xe7dcfb){if(_0xe7dcfb){return _0x3abe64['status'](_0x23e4a8)['json'](_0xe7dcfb);}};}function respondWithFilteredResult(_0x11a16f,_0x547295){return function(_0x4040f4){if(_0x4040f4){var _0x3d678f=typeof _0x547295[_0xc3cf('0x1b')]==='undefined'&&typeof _0x547295[_0xc3cf('0x1c')]==='undefined';var _0x3b6bdf=_0x4040f4['count'];var _0x27c1c5=_0x3d678f?0x0:_0x547295[_0xc3cf('0x1b')];var _0x3c9295=_0x3d678f?_0x4040f4[_0xc3cf('0x1d')]:_0x547295[_0xc3cf('0x1b')]+_0x547295[_0xc3cf('0x1c')];var _0x1ebd9c;if(_0x3c9295>=_0x3b6bdf){_0x3c9295=_0x3b6bdf;_0x1ebd9c=0xc8;}else{_0x1ebd9c=0xce;}_0x11a16f[_0xc3cf('0x19')](_0x1ebd9c);return _0x11a16f[_0xc3cf('0x1e')](_0xc3cf('0x1f'),_0x27c1c5+'-'+_0x3c9295+'/'+_0x3b6bdf)[_0xc3cf('0x20')](_0x4040f4);}return null;};}function patchUpdates(_0x5a7732){return function(_0x2f419c){try{jsonpatch[_0xc3cf('0x21')](_0x2f419c,_0x5a7732,!![]);}catch(_0x1a57b3){return BPromise[_0xc3cf('0x22')](_0x1a57b3);}return _0x2f419c[_0xc3cf('0x23')]();};}function saveUpdates(_0xb562d3,_0x1554f5){return function(_0x18d0b6){if(_0x18d0b6){return _0x18d0b6[_0xc3cf('0x24')](_0xb562d3)[_0xc3cf('0x25')](function(_0x31ef90){return _0x31ef90;});}return null;};}function removeEntity(_0x5bf437,_0x9a5a3f){return function(_0x1c751d){if(_0x1c751d){return _0x1c751d[_0xc3cf('0x26')]()['then'](function(){_0x5bf437[_0xc3cf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2e5a,_0x289e9c){return function(_0x39a180){if(!_0x39a180){_0x1c2e5a['sendStatus'](0x194);}return _0x39a180;};}function handleError(_0xc1f4e1,_0x41f1d5){_0x41f1d5=_0x41f1d5||0x1f4;return function(_0x228655){logger[_0xc3cf('0x27')](_0x228655['stack']);if(_0x228655[_0xc3cf('0x28')]){delete _0x228655[_0xc3cf('0x28')];}_0xc1f4e1[_0xc3cf('0x19')](_0x41f1d5)[_0xc3cf('0x29')](_0x228655);};}exports[_0xc3cf('0x2a')]=function(_0x15643e,_0x29a953){var _0x220597={},_0x5b1065={},_0x415d1f={'count':0x0,'rows':[]};var _0x467ae4=_['map'](db[_0xc3cf('0x2b')]['rawAttributes'],function(_0x55bf34){return{'name':_0x55bf34[_0xc3cf('0x2c')],'type':_0x55bf34[_0xc3cf('0x2d')]['key']};});_0x5b1065[_0xc3cf('0x2e')]=_[_0xc3cf('0x2f')](_0x467ae4,'name');_0x5b1065[_0xc3cf('0x30')]=_['keys'](_0x15643e[_0xc3cf('0x30')]);_0x5b1065[_0xc3cf('0x31')]=_[_0xc3cf('0x32')](_0x5b1065[_0xc3cf('0x2e')],_0x5b1065['query']);_0x220597[_0xc3cf('0x33')]=_[_0xc3cf('0x32')](_0x5b1065[_0xc3cf('0x2e')],qs[_0xc3cf('0x34')](_0x15643e[_0xc3cf('0x30')][_0xc3cf('0x34')]));_0x220597[_0xc3cf('0x33')]=_0x220597['attributes'][_0xc3cf('0x35')]?_0x220597[_0xc3cf('0x33')]:_0x5b1065[_0xc3cf('0x2e')];if(!_0x15643e[_0xc3cf('0x30')]['hasOwnProperty'](_0xc3cf('0x36'))){_0x220597[_0xc3cf('0x1c')]=qs[_0xc3cf('0x1c')](_0x15643e['query']['limit']);_0x220597[_0xc3cf('0x1b')]=qs[_0xc3cf('0x1b')](_0x15643e['query'][_0xc3cf('0x1b')]);}_0x220597[_0xc3cf('0x37')]=qs['sort'](_0x15643e[_0xc3cf('0x30')][_0xc3cf('0x38')]);_0x220597[_0xc3cf('0x39')]=qs[_0xc3cf('0x31')](_[_0xc3cf('0x3a')](_0x15643e[_0xc3cf('0x30')],_0x5b1065[_0xc3cf('0x31')]),_0x467ae4);if(_0x15643e[_0xc3cf('0x30')][_0xc3cf('0x3b')]){_0x220597[_0xc3cf('0x39')]=_[_0xc3cf('0x3c')](_0x220597[_0xc3cf('0x39')],{'$or':_['map'](_0x467ae4,function(_0x51db27){if(_0x51db27[_0xc3cf('0x2d')]!=='VIRTUAL'){var _0x1bd8ff={};_0x1bd8ff[_0x51db27[_0xc3cf('0x28')]]={'$like':'%'+_0x15643e[_0xc3cf('0x30')][_0xc3cf('0x3b')]+'%'};return _0x1bd8ff;}})});}_0x220597=_[_0xc3cf('0x3c')]({},_0x220597,_0x15643e[_0xc3cf('0x3d')]);var _0x4435bb={'where':_0x220597[_0xc3cf('0x39')]};return db[_0xc3cf('0x2b')][_0xc3cf('0x1d')](_0x4435bb)[_0xc3cf('0x25')](function(_0x51808c){_0x415d1f['count']=_0x51808c;if(_0x15643e[_0xc3cf('0x30')][_0xc3cf('0x3e')]){_0x220597[_0xc3cf('0x3f')]=[{'all':!![]}];}return db[_0xc3cf('0x2b')]['findAll'](_0x220597);})[_0xc3cf('0x25')](function(_0x31f7cb){_0x415d1f[_0xc3cf('0x40')]=_0x31f7cb;return _0x415d1f;})[_0xc3cf('0x25')](respondWithFilteredResult(_0x29a953,_0x220597))[_0xc3cf('0x41')](handleError(_0x29a953,null));};exports[_0xc3cf('0x42')]=function(_0x4da18c,_0x55c95b){var _0x42312a={'raw':!![],'where':{'id':_0x4da18c[_0xc3cf('0x43')]['id']}},_0x1e4abe={};_0x1e4abe[_0xc3cf('0x2e')]=_['keys'](db['CmHopperBlack'][_0xc3cf('0x44')]);_0x1e4abe[_0xc3cf('0x30')]=_[_0xc3cf('0x45')](_0x4da18c[_0xc3cf('0x30')]);_0x1e4abe['filters']=_[_0xc3cf('0x32')](_0x1e4abe[_0xc3cf('0x2e')],_0x1e4abe[_0xc3cf('0x30')]);_0x42312a[_0xc3cf('0x33')]=_[_0xc3cf('0x32')](_0x1e4abe[_0xc3cf('0x2e')],qs[_0xc3cf('0x34')](_0x4da18c[_0xc3cf('0x30')][_0xc3cf('0x34')]));_0x42312a[_0xc3cf('0x33')]=_0x42312a['attributes']['length']?_0x42312a['attributes']:_0x1e4abe['model'];if(_0x4da18c['query'][_0xc3cf('0x3e')]){_0x42312a[_0xc3cf('0x3f')]=[{'all':!![]}];}_0x42312a=_[_0xc3cf('0x3c')]({},_0x42312a,_0x4da18c[_0xc3cf('0x3d')]);return db['CmHopperBlack'][_0xc3cf('0x46')](_0x42312a)[_0xc3cf('0x25')](handleEntityNotFound(_0x55c95b,null))[_0xc3cf('0x25')](respondWithResult(_0x55c95b,null))['catch'](handleError(_0x55c95b,null));};exports[_0xc3cf('0x24')]=function(_0x35a3ba,_0x1f2cbd){if(_0x35a3ba[_0xc3cf('0x47')]['id']){delete _0x35a3ba[_0xc3cf('0x47')]['id'];}return db[_0xc3cf('0x2b')][_0xc3cf('0x46')]({'where':{'id':_0x35a3ba[_0xc3cf('0x43')]['id']}})[_0xc3cf('0x25')](handleEntityNotFound(_0x1f2cbd,null))['then'](saveUpdates(_0x35a3ba[_0xc3cf('0x47')],null))[_0xc3cf('0x25')](respondWithResult(_0x1f2cbd,null))[_0xc3cf('0x41')](handleError(_0x1f2cbd,null));};exports[_0xc3cf('0x26')]=function(_0x3831a4,_0x129602){return db[_0xc3cf('0x2b')][_0xc3cf('0x46')]({'where':{'id':_0x3831a4[_0xc3cf('0x43')]['id']}})[_0xc3cf('0x25')](handleEntityNotFound(_0x129602,null))['then'](removeEntity(_0x129602,null))[_0xc3cf('0x41')](handleError(_0x129602,null));};exports[_0xc3cf('0x48')]=function(_0x41d5b0,_0x5cb80b){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x5cb80b,null))['catch'](handleError(_0x5cb80b,null));}; \ No newline at end of file +var _0x8e8c=['stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','intersection','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy'];(function(_0xd7f3ea,_0x2da7d8){var _0x4362b2=function(_0x167fbe){while(--_0x167fbe){_0xd7f3ea['push'](_0xd7f3ea['shift']());}};_0x4362b2(++_0x2da7d8);}(_0x8e8c,0x1cc));var _0xc8e8=function(_0x3285d4,_0x136036){_0x3285d4=_0x3285d4-0x0;var _0x5408c9=_0x8e8c[_0x3285d4];return _0x5408c9;};'use strict';var emlformat=require(_0xc8e8('0x0'));var rimraf=require(_0xc8e8('0x1'));var zipdir=require(_0xc8e8('0x2'));var jsonpatch=require(_0xc8e8('0x3'));var rp=require(_0xc8e8('0x4'));var moment=require(_0xc8e8('0x5'));var BPromise=require(_0xc8e8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc8e8('0x7'));var sox=require(_0xc8e8('0x8'));var csv=require('to-csv');var ejs=require(_0xc8e8('0x9'));var fs=require('fs');var fs_extra=require(_0xc8e8('0xa'));var _=require(_0xc8e8('0xb'));var squel=require(_0xc8e8('0xc'));var crypto=require(_0xc8e8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc8e8('0xe'));var toCsv=require(_0xc8e8('0xf'));var querystring=require(_0xc8e8('0x10'));var Papa=require(_0xc8e8('0x11'));var Redis=require('ioredis');var authService=require(_0xc8e8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8e8('0x13'));var logger=require('../../config/logger')(_0xc8e8('0x14'));var utils=require('../../config/utils');var config=require(_0xc8e8('0x15'));var licenseUtil=require(_0xc8e8('0x16'));var db=require(_0xc8e8('0x17'))['db'];function respondWithStatusCode(_0x57a96e,_0x5cca18){_0x5cca18=_0x5cca18||0xcc;return function(_0x599f61){if(_0x599f61){return _0x57a96e[_0xc8e8('0x18')](_0x5cca18);}return _0x57a96e[_0xc8e8('0x19')](_0x5cca18)['end']();};}function respondWithResult(_0x18fb99,_0x5a5510){_0x5a5510=_0x5a5510||0xc8;return function(_0x42acfe){if(_0x42acfe){return _0x18fb99[_0xc8e8('0x19')](_0x5a5510)[_0xc8e8('0x1a')](_0x42acfe);}};}function respondWithFilteredResult(_0x1d4df3,_0x45c75c){return function(_0x4bf21f){if(_0x4bf21f){var _0x141433=typeof _0x45c75c['offset']===_0xc8e8('0x1b')&&typeof _0x45c75c[_0xc8e8('0x1c')]===_0xc8e8('0x1b');var _0x5ed4cc=_0x4bf21f[_0xc8e8('0x1d')];var _0x46c2dd=_0x141433?0x0:_0x45c75c['offset'];var _0x51387f=_0x141433?_0x4bf21f['count']:_0x45c75c[_0xc8e8('0x1e')]+_0x45c75c[_0xc8e8('0x1c')];var _0x2d88eb;if(_0x51387f>=_0x5ed4cc){_0x51387f=_0x5ed4cc;_0x2d88eb=0xc8;}else{_0x2d88eb=0xce;}_0x1d4df3[_0xc8e8('0x19')](_0x2d88eb);return _0x1d4df3['set'](_0xc8e8('0x1f'),_0x46c2dd+'-'+_0x51387f+'/'+_0x5ed4cc)[_0xc8e8('0x1a')](_0x4bf21f);}return null;};}function patchUpdates(_0x10ba8f){return function(_0x7d6dc2){try{jsonpatch[_0xc8e8('0x20')](_0x7d6dc2,_0x10ba8f,!![]);}catch(_0x1a9618){return BPromise['reject'](_0x1a9618);}return _0x7d6dc2[_0xc8e8('0x21')]();};}function saveUpdates(_0x1240d7,_0x39eb62){return function(_0xd4114b){if(_0xd4114b){return _0xd4114b[_0xc8e8('0x22')](_0x1240d7)[_0xc8e8('0x23')](function(_0x313413){return _0x313413;});}return null;};}function removeEntity(_0x5e1f45,_0x1b2199){return function(_0x56bb5d){if(_0x56bb5d){return _0x56bb5d[_0xc8e8('0x24')]()['then'](function(){_0x5e1f45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1583a5,_0x5c11e0){return function(_0x2b0b2b){if(!_0x2b0b2b){_0x1583a5['sendStatus'](0x194);}return _0x2b0b2b;};}function handleError(_0x4f36c8,_0x1b8999){_0x1b8999=_0x1b8999||0x1f4;return function(_0x3e2806){logger['error'](_0x3e2806[_0xc8e8('0x25')]);if(_0x3e2806['name']){delete _0x3e2806[_0xc8e8('0x26')];}_0x4f36c8[_0xc8e8('0x19')](_0x1b8999)[_0xc8e8('0x27')](_0x3e2806);};}exports['index']=function(_0x35d62e,_0x30d17c){var _0x2427f5={},_0x4fda3b={},_0x18a8a5={'count':0x0,'rows':[]};var _0x44344e=_[_0xc8e8('0x28')](db[_0xc8e8('0x29')][_0xc8e8('0x2a')],function(_0x16f56c){return{'name':_0x16f56c[_0xc8e8('0x2b')],'type':_0x16f56c[_0xc8e8('0x2c')]['key']};});_0x4fda3b[_0xc8e8('0x2d')]=_[_0xc8e8('0x28')](_0x44344e,_0xc8e8('0x26'));_0x4fda3b[_0xc8e8('0x2e')]=_[_0xc8e8('0x2f')](_0x35d62e[_0xc8e8('0x2e')]);_0x4fda3b[_0xc8e8('0x30')]=_['intersection'](_0x4fda3b['model'],_0x4fda3b[_0xc8e8('0x2e')]);_0x2427f5[_0xc8e8('0x31')]=_['intersection'](_0x4fda3b[_0xc8e8('0x2d')],qs[_0xc8e8('0x32')](_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x32')]));_0x2427f5['attributes']=_0x2427f5[_0xc8e8('0x31')][_0xc8e8('0x33')]?_0x2427f5[_0xc8e8('0x31')]:_0x4fda3b['model'];if(!_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x34')](_0xc8e8('0x35'))){_0x2427f5[_0xc8e8('0x1c')]=qs[_0xc8e8('0x1c')](_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x1c')]);_0x2427f5[_0xc8e8('0x1e')]=qs[_0xc8e8('0x1e')](_0x35d62e[_0xc8e8('0x2e')]['offset']);}_0x2427f5[_0xc8e8('0x36')]=qs['sort'](_0x35d62e['query'][_0xc8e8('0x37')]);_0x2427f5[_0xc8e8('0x38')]=qs[_0xc8e8('0x30')](_[_0xc8e8('0x39')](_0x35d62e[_0xc8e8('0x2e')],_0x4fda3b[_0xc8e8('0x30')]),_0x44344e);if(_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x3a')]){_0x2427f5[_0xc8e8('0x38')]=_[_0xc8e8('0x3b')](_0x2427f5['where'],{'$or':_[_0xc8e8('0x28')](_0x44344e,function(_0x312ea8){if(_0x312ea8[_0xc8e8('0x2c')]!=='VIRTUAL'){var _0x58b8ed={};_0x58b8ed[_0x312ea8[_0xc8e8('0x26')]]={'$like':'%'+_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x3a')]+'%'};return _0x58b8ed;}})});}_0x2427f5=_[_0xc8e8('0x3b')]({},_0x2427f5,_0x35d62e[_0xc8e8('0x3c')]);var _0x3104aa={'where':_0x2427f5[_0xc8e8('0x38')]};return db[_0xc8e8('0x29')][_0xc8e8('0x1d')](_0x3104aa)[_0xc8e8('0x23')](function(_0x572c1d){_0x18a8a5[_0xc8e8('0x1d')]=_0x572c1d;if(_0x35d62e['query'][_0xc8e8('0x3d')]){_0x2427f5[_0xc8e8('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc8e8('0x3f')](_0x2427f5);})[_0xc8e8('0x23')](function(_0x260c8a){_0x18a8a5['rows']=_0x260c8a;return _0x18a8a5;})[_0xc8e8('0x23')](respondWithFilteredResult(_0x30d17c,_0x2427f5))[_0xc8e8('0x40')](handleError(_0x30d17c,null));};exports[_0xc8e8('0x41')]=function(_0x8c7b70,_0x41b245){var _0x5585ed={'raw':!![],'where':{'id':_0x8c7b70[_0xc8e8('0x42')]['id']}},_0x52db48={};_0x52db48['model']=_['keys'](db[_0xc8e8('0x29')][_0xc8e8('0x2a')]);_0x52db48[_0xc8e8('0x2e')]=_[_0xc8e8('0x2f')](_0x8c7b70[_0xc8e8('0x2e')]);_0x52db48[_0xc8e8('0x30')]=_['intersection'](_0x52db48[_0xc8e8('0x2d')],_0x52db48[_0xc8e8('0x2e')]);_0x5585ed[_0xc8e8('0x31')]=_[_0xc8e8('0x43')](_0x52db48[_0xc8e8('0x2d')],qs[_0xc8e8('0x32')](_0x8c7b70['query'][_0xc8e8('0x32')]));_0x5585ed['attributes']=_0x5585ed['attributes'][_0xc8e8('0x33')]?_0x5585ed[_0xc8e8('0x31')]:_0x52db48[_0xc8e8('0x2d')];if(_0x8c7b70['query'][_0xc8e8('0x3d')]){_0x5585ed['include']=[{'all':!![]}];}_0x5585ed=_[_0xc8e8('0x3b')]({},_0x5585ed,_0x8c7b70['options']);return db[_0xc8e8('0x29')][_0xc8e8('0x44')](_0x5585ed)[_0xc8e8('0x23')](handleEntityNotFound(_0x41b245,null))[_0xc8e8('0x23')](respondWithResult(_0x41b245,null))[_0xc8e8('0x40')](handleError(_0x41b245,null));};exports['update']=function(_0x47f450,_0x4c5fa8){if(_0x47f450[_0xc8e8('0x45')]['id']){delete _0x47f450[_0xc8e8('0x45')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x47f450['params']['id']}})[_0xc8e8('0x23')](handleEntityNotFound(_0x4c5fa8,null))[_0xc8e8('0x23')](saveUpdates(_0x47f450['body'],null))['then'](respondWithResult(_0x4c5fa8,null))[_0xc8e8('0x40')](handleError(_0x4c5fa8,null));};exports['destroy']=function(_0x45e0c3,_0x5c0735){return db[_0xc8e8('0x29')][_0xc8e8('0x44')]({'where':{'id':_0x45e0c3[_0xc8e8('0x42')]['id']}})[_0xc8e8('0x23')](handleEntityNotFound(_0x5c0735,null))['then'](removeEntity(_0x5c0735,null))[_0xc8e8('0x40')](handleError(_0x5c0735,null));};exports['describe']=function(_0x1e185a,_0x3d7624){return db[_0xc8e8('0x29')][_0xc8e8('0x46')]()['then'](respondWithResult(_0x3d7624,null))[_0xc8e8('0x40')](handleError(_0x3d7624,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 713597e..a777309 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 _0x7c6c=['lodash','../../config/logger','api','rimraf','./cmHopperBlack.attributes','exports','cm_hopper_black'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7c6c,0x1ea));var _0xc7c6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x7c6c[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xc7c6('0x0'));var util=require('util');var logger=require(_0xc7c6('0x1'))(_0xc7c6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc7c6('0x3'));var config=require('../../config/environment');var attributes=require(_0xc7c6('0x4'));module[_0xc7c6('0x5')]=function(_0x86a643,_0xa76b33){return _0x86a643['define']('CmHopperBlack',attributes,{'tableName':_0xc7c6('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0f7=['../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x686067,_0x5a237e){var _0x3f4b7c=function(_0x97caed){while(--_0x97caed){_0x686067['push'](_0x686067['shift']());}};_0x3f4b7c(++_0x5a237e);}(_0xd0f7,0x139));var _0x7d0f=function(_0x486c91,_0x257b1b){_0x486c91=_0x486c91-0x0;var _0x4de8b0=_0xd0f7[_0x486c91];return _0x4de8b0;};'use strict';var _=require(_0x7d0f('0x0'));var util=require(_0x7d0f('0x1'));var logger=require(_0x7d0f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d0f('0x3'));var fs=require('fs');var path=require(_0x7d0f('0x4'));var rimraf=require(_0x7d0f('0x5'));var config=require(_0x7d0f('0x6'));var attributes=require(_0x7d0f('0x7'));module[_0x7d0f('0x8')]=function(_0x252399,_0x48d49a){return _0x252399['define'](_0x7d0f('0x9'),attributes,{'tableName':_0x7d0f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index f6f39be..3e38af5 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 _0x941b=['result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','CmHopperBlack','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message'];(function(_0x12fb25,_0x4f82f3){var _0x2ec03a=function(_0x2f4b67){while(--_0x2f4b67){_0x12fb25['push'](_0x12fb25['shift']());}};_0x2ec03a(++_0x4f82f3);}(_0x941b,0xef));var _0xb941=function(_0x2a7c75,_0x4dc168){_0x2a7c75=_0x2a7c75-0x0;var _0x3efdf9=_0x941b[_0x2a7c75];return _0x3efdf9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb941('0x0'));var BPromise=require(_0xb941('0x1'));var rs=require(_0xb941('0x2'));var fs=require('fs');var Redis=require(_0xb941('0x3'));var db=require(_0xb941('0x4'))['db'];var utils=require(_0xb941('0x5'));var logger=require(_0xb941('0x6'))(_0xb941('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb941('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58cdba,_0x2ae72b,_0x26649c){return new BPromise(function(_0xc4e8b5,_0xaa9c71){return client[_0xb941('0x9')](_0x58cdba,_0x26649c)[_0xb941('0xa')](function(_0x1bffcd){logger[_0xb941('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x2ae72b,_0xb941('0xc'));logger[_0xb941('0xd')](_0xb941('0xe'),_0x2ae72b,_0xb941('0xc'),JSON[_0xb941('0xf')](_0x1bffcd));if(_0x1bffcd[_0xb941('0x10')]){if(_0x1bffcd[_0xb941('0x10')][_0xb941('0x11')]===0x1f4){logger['error'](_0xb941('0x12'),_0x2ae72b,_0x1bffcd[_0xb941('0x10')][_0xb941('0x13')]);return _0xaa9c71(_0x1bffcd[_0xb941('0x10')]['message']);}logger['error'](_0xb941('0x12'),_0x2ae72b,_0x1bffcd[_0xb941('0x10')][_0xb941('0x13')]);return _0xc4e8b5(_0x1bffcd['error']['message']);}else{logger[_0xb941('0xb')](_0xb941('0x12'),_0x2ae72b,'request\x20sent');_0xc4e8b5(_0x1bffcd[_0xb941('0x14')][_0xb941('0x13')]);}})[_0xb941('0x15')](function(_0x1c1902){logger[_0xb941('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2ae72b,_0x1c1902);_0xaa9c71(_0x1c1902);});});}exports[_0xb941('0x16')]=function(_0x1f9247){var _0x1ffe6b=this;return new Promise(function(_0x71d37a,_0x324dbc){return db['CmHopperBlack'][_0xb941('0x17')]({'raw':_0x1f9247[_0xb941('0x18')]?_0x1f9247[_0xb941('0x18')][_0xb941('0x19')]===undefined?!![]:![]:!![],'where':_0x1f9247[_0xb941('0x18')]?_0x1f9247[_0xb941('0x18')][_0xb941('0x1a')]||null:null,'attributes':_0x1f9247[_0xb941('0x18')]?_0x1f9247[_0xb941('0x18')][_0xb941('0x1b')]||null:null,'limit':_0x1f9247[_0xb941('0x18')]?_0x1f9247['options'][_0xb941('0x1c')]||null:null,'include':_0x1f9247[_0xb941('0x18')]?_0x1f9247[_0xb941('0x18')][_0xb941('0x1d')]?_['map'](_0x1f9247[_0xb941('0x18')]['include'],function(_0x114db7){return{'model':db[_0x114db7['model']],'as':_0x114db7['as'],'attributes':_0x114db7[_0xb941('0x1b')],'include':_0x114db7[_0xb941('0x1d')]?_[_0xb941('0x1e')](_0x114db7[_0xb941('0x1d')],function(_0x212f6c){return{'model':db[_0x212f6c['model']],'as':_0x212f6c['as'],'attributes':_0x212f6c[_0xb941('0x1b')],'include':_0x212f6c[_0xb941('0x1d')]?_[_0xb941('0x1e')](_0x212f6c[_0xb941('0x1d')],function(_0x4d98f0){return{'model':db[_0x4d98f0['model']],'as':_0x4d98f0['as'],'attributes':_0x4d98f0[_0xb941('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x437f08){logger[_0xb941('0xb')](_0xb941('0x16'),_0x1f9247);logger['debug']('GetCmHopperBlack',_0x1f9247,JSON[_0xb941('0xf')](_0x437f08));_0x71d37a(_0x437f08);})[_0xb941('0x15')](function(_0x468425){logger[_0xb941('0x10')](_0xb941('0x16'),_0x468425[_0xb941('0x13')],_0x1f9247);_0x324dbc(_0x1ffe6b[_0xb941('0x10')](0x1f4,_0x468425[_0xb941('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x1a26cb){var _0x28e39d=this;return new Promise(function(_0x552417,_0xecb4f4){return db[_0xb941('0x1f')][_0xb941('0x20')](_0x1a26cb[_0xb941('0x21')],{'raw':_0x1a26cb[_0xb941('0x18')]?_0x1a26cb['options'][_0xb941('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a26cb['options']?_0x1a26cb[_0xb941('0x18')][_0xb941('0x1a')]||null:null,'attributes':_0x1a26cb[_0xb941('0x18')]?_0x1a26cb['options'][_0xb941('0x1b')]||null:null,'limit':_0x1a26cb[_0xb941('0x18')]?_0x1a26cb[_0xb941('0x18')]['limit']||null:null})[_0xb941('0xa')](function(_0x3bcdfc){logger[_0xb941('0xb')]('UpdateCmHopperBlack',_0x1a26cb);logger[_0xb941('0xd')]('UpdateCmHopperBlack',_0x1a26cb,JSON[_0xb941('0xf')](_0x3bcdfc));_0x552417(_0x3bcdfc);})[_0xb941('0x15')](function(_0x58e4ce){logger['error'](_0xb941('0x22'),_0x58e4ce['message'],_0x1a26cb);_0xecb4f4(_0x28e39d[_0xb941('0x10')](0x1f4,_0x58e4ce[_0xb941('0x13')]));});});};exports[_0xb941('0x23')]=function(_0x4b07ed){var _0x1c4521=this;return new Promise(function(_0x36b751,_0x31d0b3){return db[_0xb941('0x1f')][_0xb941('0x24')]({'where':_0x4b07ed[_0xb941('0x18')]?_0x4b07ed['options'][_0xb941('0x1a')]||null:null})[_0xb941('0xa')](function(_0x1cc1f9){logger['info'](_0xb941('0x23'),_0x4b07ed);logger[_0xb941('0xd')](_0xb941('0x23'),_0x4b07ed,JSON['stringify'](_0x1cc1f9));_0x36b751(_0x1cc1f9);})[_0xb941('0x15')](function(_0x531d90){logger[_0xb941('0x10')](_0xb941('0x23'),_0x531d90[_0xb941('0x13')],_0x4b07ed);_0x31d0b3(_0x1c4521[_0xb941('0x10')](0x1f4,_0x531d90[_0xb941('0x13')]));});});}; \ No newline at end of file +var _0x39a6=['error','message','info','result','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4569fb,_0x394fdb){var _0x5387ce=function(_0x111f8c){while(--_0x111f8c){_0x4569fb['push'](_0x4569fb['shift']());}};_0x5387ce(++_0x394fdb);}(_0x39a6,0xfd));var _0x639a=function(_0x4bde61,_0x37941a){_0x4bde61=_0x4bde61-0x0;var _0x215b96=_0x39a6[_0x4bde61];return _0x215b96;};'use strict';var _=require(_0x639a('0x0'));var util=require(_0x639a('0x1'));var moment=require(_0x639a('0x2'));var BPromise=require(_0x639a('0x3'));var rs=require(_0x639a('0x4'));var fs=require('fs');var Redis=require(_0x639a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x639a('0x6'));var logger=require(_0x639a('0x7'))(_0x639a('0x8'));var config=require(_0x639a('0x9'));var jayson=require(_0x639a('0xa'));var client=jayson[_0x639a('0xb')][_0x639a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12eda6,_0x28870f,_0x564ae5){return new BPromise(function(_0x17c2e5,_0x3b7c91){return client[_0x639a('0xd')](_0x12eda6,_0x564ae5)[_0x639a('0xe')](function(_0x33b0ff){logger['info'](_0x639a('0xf'),_0x28870f,_0x639a('0x10'));logger[_0x639a('0x11')](_0x639a('0x12'),_0x28870f,'request\x20sent',JSON[_0x639a('0x13')](_0x33b0ff));if(_0x33b0ff[_0x639a('0x14')]){if(_0x33b0ff[_0x639a('0x14')]['code']===0x1f4){logger[_0x639a('0x14')](_0x639a('0xf'),_0x28870f,_0x33b0ff[_0x639a('0x14')][_0x639a('0x15')]);return _0x3b7c91(_0x33b0ff['error']['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x28870f,_0x33b0ff[_0x639a('0x14')]['message']);return _0x17c2e5(_0x33b0ff['error']['message']);}else{logger[_0x639a('0x16')]('CmHopperBlack,\x20%s,\x20%s',_0x28870f,_0x639a('0x10'));_0x17c2e5(_0x33b0ff[_0x639a('0x17')][_0x639a('0x15')]);}})[_0x639a('0x18')](function(_0x33488c){logger[_0x639a('0x14')](_0x639a('0xf'),_0x28870f,_0x33488c);_0x3b7c91(_0x33488c);});});}exports[_0x639a('0x19')]=function(_0x183275){var _0x245611=this;return new Promise(function(_0x21a073,_0x28ea30){return db['CmHopperBlack'][_0x639a('0x1a')]({'raw':_0x183275[_0x639a('0x1b')]?_0x183275[_0x639a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x183275['options']?_0x183275[_0x639a('0x1b')][_0x639a('0x1c')]||null:null,'attributes':_0x183275[_0x639a('0x1b')]?_0x183275[_0x639a('0x1b')][_0x639a('0x1d')]||null:null,'limit':_0x183275['options']?_0x183275[_0x639a('0x1b')][_0x639a('0x1e')]||null:null,'include':_0x183275[_0x639a('0x1b')]?_0x183275['options'][_0x639a('0x1f')]?_[_0x639a('0x20')](_0x183275[_0x639a('0x1b')]['include'],function(_0x531663){return{'model':db[_0x531663[_0x639a('0x21')]],'as':_0x531663['as'],'attributes':_0x531663['attributes'],'include':_0x531663[_0x639a('0x1f')]?_[_0x639a('0x20')](_0x531663[_0x639a('0x1f')],function(_0x51b731){return{'model':db[_0x51b731[_0x639a('0x21')]],'as':_0x51b731['as'],'attributes':_0x51b731['attributes'],'include':_0x51b731[_0x639a('0x1f')]?_['map'](_0x51b731[_0x639a('0x1f')],function(_0x4cf819){return{'model':db[_0x4cf819[_0x639a('0x21')]],'as':_0x4cf819['as'],'attributes':_0x4cf819['attributes']};}):[]};}):[]};}):[]:[]})[_0x639a('0xe')](function(_0x523989){logger[_0x639a('0x16')](_0x639a('0x19'),_0x183275);logger[_0x639a('0x11')](_0x639a('0x19'),_0x183275,JSON['stringify'](_0x523989));_0x21a073(_0x523989);})[_0x639a('0x18')](function(_0x616236){logger[_0x639a('0x14')](_0x639a('0x19'),_0x616236[_0x639a('0x15')],_0x183275);_0x28ea30(_0x245611['error'](0x1f4,_0x616236[_0x639a('0x15')]));});});};exports[_0x639a('0x22')]=function(_0x4fe24e){var _0x1fb92c=this;return new Promise(function(_0x293367,_0x306926){return db['CmHopperBlack'][_0x639a('0x23')](_0x4fe24e['body'],{'raw':_0x4fe24e[_0x639a('0x1b')]?_0x4fe24e['options'][_0x639a('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fe24e['options']?_0x4fe24e[_0x639a('0x1b')][_0x639a('0x1c')]||null:null,'attributes':_0x4fe24e[_0x639a('0x1b')]?_0x4fe24e[_0x639a('0x1b')]['attributes']||null:null,'limit':_0x4fe24e[_0x639a('0x1b')]?_0x4fe24e[_0x639a('0x1b')][_0x639a('0x1e')]||null:null})[_0x639a('0xe')](function(_0x43dd46){logger[_0x639a('0x16')]('UpdateCmHopperBlack',_0x4fe24e);logger['debug'](_0x639a('0x22'),_0x4fe24e,JSON[_0x639a('0x13')](_0x43dd46));_0x293367(_0x43dd46);})[_0x639a('0x18')](function(_0x1cc795){logger[_0x639a('0x14')](_0x639a('0x22'),_0x1cc795['message'],_0x4fe24e);_0x306926(_0x1fb92c['error'](0x1f4,_0x1cc795[_0x639a('0x15')]));});});};exports[_0x639a('0x25')]=function(_0x150464){var _0x32bcca=this;return new Promise(function(_0x189b8c,_0xb41ff4){return db['CmHopperBlack'][_0x639a('0x26')]({'where':_0x150464[_0x639a('0x1b')]?_0x150464[_0x639a('0x1b')][_0x639a('0x1c')]||null:null})[_0x639a('0xe')](function(_0xaf2775){logger[_0x639a('0x16')]('DestroyCmHopperBlack',_0x150464);logger[_0x639a('0x11')](_0x639a('0x25'),_0x150464,JSON[_0x639a('0x13')](_0xaf2775));_0x189b8c(_0xaf2775);})[_0x639a('0x18')](function(_0xebb4bf){logger['error'](_0x639a('0x25'),_0xebb4bf['message'],_0x150464);_0xb41ff4(_0x32bcca[_0x639a('0x14')](0x1f4,_0xebb4bf[_0x639a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8d303c3..d481c84 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 _0x1883=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4240d8,_0x4dba1b){var _0x3b42d4=function(_0x4cddd3){while(--_0x4cddd3){_0x4240d8['push'](_0x4240d8['shift']());}};_0x3b42d4(++_0x4dba1b);}(_0x1883,0xab));var _0x3188=function(_0x13b46b,_0x5911b6){_0x13b46b=_0x13b46b-0x0;var _0x28719b=_0x1883[_0x13b46b];return _0x28719b;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['describe']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')]('/:id',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5fab=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4c1195,_0x2022ec){var _0xcabe5f=function(_0x9d0ac){while(--_0x9d0ac){_0x4c1195['push'](_0x4c1195['shift']());}};_0xcabe5f(++_0x2022ec);}(_0x5fab,0x177));var _0xb5fa=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x5fab[_0x4e697a];return _0x88850c;};'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['put']('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);module[_0xb5fa('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 685e60f..979f509 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 _0xf715=['DATE','getDataValue','endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x57a749,_0xbeb6a1){var _0x140804=function(_0x28aec0){while(--_0x28aec0){_0x57a749['push'](_0x57a749['shift']());}};_0x140804(++_0xbeb6a1);}(_0xf715,0x16f));var _0x5f71=function(_0x5ad07a,_0x29f321){_0x5ad07a=_0x5ad07a-0x0;var _0x216e17=_0xf715[_0x5ad07a];return _0x216e17;};'use strict';var Sequelize=require(_0x5f71('0x0'));var moment=require(_0x5f71('0x1'));module[_0x5f71('0x2')]={'state':{'type':Sequelize[_0x5f71('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x5f71('0x4')]},'scheduledat':{'type':Sequelize[_0x5f71('0x5')]},'countbusyretry':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5f71('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5f71('0x4')]},'calleridnum':{'type':Sequelize[_0x5f71('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5f71('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5f71('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5f71('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5f71('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5f71('0x4')]},'membername':{'type':Sequelize[_0x5f71('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5f71('0x4')]},'secondDisposition':{'type':Sequelize[_0x5f71('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5f71('0x4')]},'dispositionat':{'type':Sequelize[_0x5f71('0x5')],'set':function(_0x507e8d){var _0x29fcf6=this[_0x5f71('0x6')](_0x5f71('0x7'));if(_0x29fcf6&&_0x507e8d){this[_0x5f71('0x8')](_0x5f71('0x9'),moment(_0x507e8d)['diff'](moment(_0x29fcf6),_0x5f71('0xa')));}}},'amd':{'type':Sequelize[_0x5f71('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5f71('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5f71('0x5')]},'callback':{'type':Sequelize[_0x5f71('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5f71('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5f71('0x5')]},'deleted':{'type':Sequelize[_0x5f71('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5f71('0x5')]},'recallme':{'type':Sequelize[_0x5f71('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5f71('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5f71('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x896b=['DATE','endtime','followuptime','diff','BOOLEAN','sequelize','moment','INTEGER','STRING'];(function(_0x420865,_0x4488ce){var _0x3c3225=function(_0x406aa3){while(--_0x406aa3){_0x420865['push'](_0x420865['shift']());}};_0x3c3225(++_0x4488ce);}(_0x896b,0x9e));var _0xb896=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x896b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb896('0x0'));var moment=require(_0xb896('0x1'));module['exports']={'state':{'type':Sequelize[_0xb896('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb896('0x3')]},'scheduledat':{'type':Sequelize[_0xb896('0x4')]},'countbusyretry':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb896('0x3')]},'calleridnum':{'type':Sequelize[_0xb896('0x3')]},'calleridname':{'type':Sequelize[_0xb896('0x3')]},'starttime':{'type':Sequelize[_0xb896('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb896('0x4')]},'droptime':{'type':Sequelize[_0xb896('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb896('0x3')]},'campaign':{'type':Sequelize[_0xb896('0x3')]},'campaigntype':{'type':Sequelize[_0xb896('0x3')]},'membername':{'type':Sequelize[_0xb896('0x3')]},'reason':{'type':Sequelize[_0xb896('0x3')]},'disposition':{'type':Sequelize[_0xb896('0x3')]},'secondDisposition':{'type':Sequelize[_0xb896('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb896('0x3')]},'dispositionat':{'type':Sequelize[_0xb896('0x4')],'set':function(_0x54d9ad){var _0x1f756c=this['getDataValue'](_0xb896('0x5'));if(_0x1f756c&&_0x54d9ad){this['setDataValue'](_0xb896('0x6'),moment(_0x54d9ad)[_0xb896('0x7')](moment(_0x1f756c),'seconds'));}}},'amd':{'type':Sequelize[_0xb896('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb896('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb896('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb896('0x4')]},'callback':{'type':Sequelize[_0xb896('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb896('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb896('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb896('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a470b79..d5a1730 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 _0xba34=['insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','state\x20=\x20?','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0xba34,0x119));var _0x4ba3=function(_0x27ea16,_0x32fec4){_0x27ea16=_0x27ea16-0x0;var _0x2ba757=_0xba34[_0x27ea16];return _0x2ba757;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['describe']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['describe']()[_0x4ba3('0x26')](respondWithResult(_0x1fe115,null))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports[_0x4ba3('0x25')]=function(_0x58648d,_0x47f588){if(_0x58648d[_0x4ba3('0x49')]['uniqueid']){delete _0x58648d[_0x4ba3('0x49')][_0x4ba3('0x4a')];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'uniqueid':_0x58648d[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x47f588,null))['then'](saveUpdates(_0x58648d[_0x4ba3('0x49')],null))[_0x4ba3('0x26')](respondWithResult(_0x47f588,null))['catch'](handleError(_0x47f588,null));};exports[_0x4ba3('0x4c')]=function(_0x12ae6f,_0x156c2d,_0x19d6a3){return db[_0x4ba3('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x12ae6f[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),_0x4ba3('0x53')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x4ba3('0x54')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5a')))),_0x4ba3('0x5b')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x156c2d,null))[_0x4ba3('0x26')](respondWithResult(_0x156c2d,null))[_0x4ba3('0x46')](handleError(_0x156c2d,null));};exports[_0x4ba3('0x5d')]=function(_0xf0fd32,_0x4b5289,_0x3d9a7e){return db[_0x4ba3('0x2d')][_0x4ba3('0x44')]({'raw':![],'where':{'CampaignId':_0xf0fd32[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),'noAnswerContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x5e')))),'busyContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5f')))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4ba3('0x5b')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x4b5289,null))['then'](respondWithResult(_0x4b5289,null))[_0x4ba3('0x46')](handleError(_0x4b5289,null));};exports[_0x4ba3('0x60')]=function(_0x5dce8f,_0x37fedb,_0x2ed729){return db[_0x4ba3('0x61')][_0x4ba3('0x48')]({'where':{'id':_0x5dce8f[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x37fedb,null))[_0x4ba3('0x26')](function(_0x329874){var _0x360127;if(_0x329874){_0x360127=squel['insert']()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),_0x4ba3('0x66'),_0x4ba3('0x67'),_0x4ba3('0x68'),_0x4ba3('0x69'),_0x4ba3('0x6a'),_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')]('ANY_VALUE(calleridnum)',_0x4ba3('0x65'))[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')]('ANY_VALUE(ContactId)','ContactId')[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x6f'),_0x4ba3('0x69'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')]('state\x20=\x20?',_0x5dce8f[_0x4ba3('0x49')][_0x4ba3('0x75')][_0x4ba3('0x74')]())['where'](_0x4ba3('0x76'))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')]('cm_hopper')['where'](_0x4ba3('0x73'),_0x5dce8f['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field']('calleridnum')[_0x4ba3('0x71')](_0x4ba3('0x72'))['where'](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')](_0x4ba3('0x67')))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x360127);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x37fedb,null))['catch'](handleError(_0x37fedb,null));};exports[_0x4ba3('0x7a')]=function(_0x13dbc4,_0x4e334c,_0x39d1d3){return db[_0x4ba3('0x7b')]['find']({'where':{'id':_0x13dbc4['params']['id']}})['then'](handleEntityNotFound(_0x4e334c,null))['then'](function(_0x206e93){var _0x2d57a7;if(_0x206e93){_0x2d57a7=squel[_0x4ba3('0x7c')]()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),'scheduledAt',_0x4ba3('0x67'),'ListId',_0x4ba3('0x7d'),'createdAt',_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x7e'),_0x4ba3('0x65'))['field']('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')](_0x4ba3('0x7f'),_0x4ba3('0x67'))[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x80'),_0x4ba3('0x7d'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x81'),_0x13dbc4['body']['state'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x76'))['where'](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')](_0x4ba3('0x63'))['where'](_0x4ba3('0x82'),_0x13dbc4['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field'](_0x4ba3('0x83'))[_0x4ba3('0x71')]('cm_hopper_final')[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')]('ContactId'))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x2d57a7);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x4e334c,null))['catch'](handleError(_0x4e334c,null));};exports[_0x4ba3('0x84')]=function(_0x38a7a8,_0x5553eb,_0x402ab1){return db[_0x4ba3('0x85')][_0x4ba3('0x86')]({'where':{'VoiceQueueId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x69')],'CampaignId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x7d')],'ContactId':_0x38a7a8[_0x4ba3('0x49')]['ContactId']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5553eb,null))[_0x4ba3('0x26')](function(_0xfb16a6){if(_0xfb16a6){return _0xfb16a6;}return null;})[_0x4ba3('0x26')](respondWithResult(_0x5553eb,null))[_0x4ba3('0x46')](handleError(_0x5553eb,null));}; \ No newline at end of file +var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','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','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x11cd17,_0x489e02){var _0x3343ad=function(_0xfb1588){while(--_0xfb1588){_0x11cd17['push'](_0x11cd17['shift']());}};_0x3343ad(++_0x489e02);}(_0x781d,0x14a));var _0xd781=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x781d[_0x501510];return _0x1e6ee5;};'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['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index dde3af8..0b8d550 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 _0xfa20=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x408828,_0x3f348c){var _0x4cbdec=function(_0x61c756){while(--_0x61c756){_0x408828['push'](_0x408828['shift']());}};_0x4cbdec(++_0x3f348c);}(_0xfa20,0xc9));var _0x0fa2=function(_0x2fcd6e,_0xc2f135){_0x2fcd6e=_0x2fcd6e-0x0;var _0x7789a3=_0xfa20[_0x2fcd6e];return _0x7789a3;};'use strict';var _=require(_0x0fa2('0x0'));var util=require(_0x0fa2('0x1'));var logger=require(_0x0fa2('0x2'))(_0x0fa2('0x3'));var moment=require(_0x0fa2('0x4'));var BPromise=require(_0x0fa2('0x5'));var rp=require(_0x0fa2('0x6'));var fs=require('fs');var path=require(_0x0fa2('0x7'));var rimraf=require(_0x0fa2('0x8'));var config=require(_0x0fa2('0x9'));var attributes=require(_0x0fa2('0xa'));module['exports']=function(_0x189740,_0x3a9a5f){return _0x189740[_0x0fa2('0xb')](_0x0fa2('0xc'),attributes,{'tableName':_0x0fa2('0xd'),'paranoid':![],'indexes':[{'name':_0x0fa2('0xe'),'fields':[_0x0fa2('0xe')]},{'name':'uniqueid','fields':[_0x0fa2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8c0=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','path','exports'];(function(_0x4221bf,_0x5c86fa){var _0x5d5d99=function(_0x2fab2){while(--_0x2fab2){_0x4221bf['push'](_0x4221bf['shift']());}};_0x5d5d99(++_0x5c86fa);}(_0xf8c0,0x10d));var _0x0f8c=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xf8c0[_0x43fdf8];return _0x1160c6;};'use strict';var _=require(_0x0f8c('0x0'));var util=require(_0x0f8c('0x1'));var logger=require(_0x0f8c('0x2'))(_0x0f8c('0x3'));var moment=require('moment');var BPromise=require(_0x0f8c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f8c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x0f8c('0x6')]=function(_0x173f8f,_0x488892){return _0x173f8f[_0x0f8c('0x7')](_0x0f8c('0x8'),attributes,{'tableName':_0x0f8c('0x9'),'paranoid':![],'indexes':[{'name':_0x0f8c('0xa'),'fields':[_0x0f8c('0xa')]},{'name':_0x0f8c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 1233f4c..649a648 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2f4e06,_0x458e2c){var _0x25fb60=function(_0x56a29f){while(--_0x56a29f){_0x2f4e06['push'](_0x2f4e06['shift']());}};_0x25fb60(++_0x458e2c);}(_0xb10b,0x12a));var _0xbb10=function(_0x28f3a5,_0x2a84af){_0x28f3a5=_0x28f3a5-0x0;var _0x1a60bc=_0xb10b[_0x28f3a5];return _0x1a60bc;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x9fd77a,_0x3ea75f){var _0x5dc4a6=function(_0x4aa0d6){while(--_0x4aa0d6){_0x9fd77a['push'](_0x9fd77a['shift']());}};_0x5dc4a6(++_0x3ea75f);}(_0x7a54,0x106));var _0x47a5=function(_0x4ac175,_0xd68907){_0x4ac175=_0x4ac175-0x0;var _0x7620da=_0x7a54[_0x4ac175];return _0x7620da;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index c34d6af..1ff8229 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 _0x2ef4=['isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopperFinal.controller','get'];(function(_0x34d0de,_0x1e83d0){var _0x2a50e8=function(_0x1724f8){while(--_0x1724f8){_0x34d0de['push'](_0x34d0de['shift']());}};_0x2a50e8(++_0x1e83d0);}(_0x2ef4,0x143));var _0x42ef=function(_0x43134c,_0x429046){_0x43134c=_0x43134c-0x0;var _0x402213=_0x2ef4[_0x43134c];return _0x402213;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x42ef('0x0'));var timeout=require(_0x42ef('0x1'));var express=require(_0x42ef('0x2'));var router=express[_0x42ef('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x42ef('0x4'));var config=require('../../config/environment');var controller=require(_0x42ef('0x5'));router[_0x42ef('0x6')]('/',auth[_0x42ef('0x7')](),controller['index']);router[_0x42ef('0x6')](_0x42ef('0x8'),auth[_0x42ef('0x7')](),controller[_0x42ef('0x9')]);router['get'](_0x42ef('0xa'),auth[_0x42ef('0x7')](),controller[_0x42ef('0xb')]);router['get'](_0x42ef('0xc'),auth[_0x42ef('0x7')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x42ef('0x6')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x42ef('0xd')]);router[_0x42ef('0xe')](_0x42ef('0xf'),auth[_0x42ef('0x7')](),controller[_0x42ef('0x10')]);router[_0x42ef('0xe')]('/voice/campaign/moveContacts/:id',auth[_0x42ef('0x7')](),controller[_0x42ef('0x11')]);router[_0x42ef('0xe')](_0x42ef('0x12'),auth['isAuthenticated'](),controller[_0x42ef('0x13')]);router[_0x42ef('0x14')](_0x42ef('0xa'),auth[_0x42ef('0x7')](),controller['update']);module[_0x42ef('0x15')]=router; \ No newline at end of file +var _0x66fa=['moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id'];(function(_0x229527,_0x337664){var _0x1b88d3=function(_0x571b4e){while(--_0x571b4e){_0x229527['push'](_0x229527['shift']());}};_0x1b88d3(++_0x337664);}(_0x66fa,0x126));var _0xa66f=function(_0x2ebddb,_0x20f4e7){_0x2ebddb=_0x2ebddb-0x0;var _0x45d4e8=_0x66fa[_0x2ebddb];return _0x45d4e8;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require(_0xa66f('0x2'));var timeout=require(_0xa66f('0x3'));var express=require('express');var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xa66f('0x7')]('/',auth[_0xa66f('0x8')](),controller[_0xa66f('0x9')]);router[_0xa66f('0x7')](_0xa66f('0xa'),auth[_0xa66f('0x8')](),controller['describe']);router[_0xa66f('0x7')](_0xa66f('0xb'),auth[_0xa66f('0x8')](),controller['show']);router[_0xa66f('0x7')](_0xa66f('0xc'),auth['isAuthenticated'](),controller[_0xa66f('0xd')]);router['get'](_0xa66f('0xe'),auth[_0xa66f('0x8')](),controller[_0xa66f('0xf')]);router[_0xa66f('0x10')](_0xa66f('0x11'),auth[_0xa66f('0x8')](),controller[_0xa66f('0x12')]);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x8')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x10')](_0xa66f('0x15'),auth[_0xa66f('0x8')](),controller[_0xa66f('0x16')]);router[_0xa66f('0x17')](_0xa66f('0xb'),auth[_0xa66f('0x8')](),controller[_0xa66f('0x18')]);module[_0xa66f('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 604540e..5f88e0d 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 _0xa1ad=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0xa1ad,0xf7));var _0xda1a=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0xa1ad[_0x2af160];return _0x439d67;};'use strict';var Sequelize=require(_0xda1a('0x0'));module[_0xda1a('0x1')]={'state':{'type':Sequelize[_0xda1a('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xda1a('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xda1a('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xda1a('0x4')]},'originatecalleridname':{'type':Sequelize[_0xda1a('0x4')]},'calleridnum':{'type':Sequelize[_0xda1a('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xda1a('0x3')]},'responsetime':{'type':Sequelize[_0xda1a('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xda1a('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xda1a('0x4')]},'campaign':{'type':Sequelize[_0xda1a('0x4')]},'campaigntype':{'type':Sequelize[_0xda1a('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xda1a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xda1a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xda1a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xda1a('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xda1a('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xda1a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xda1a('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xda1a('0x4')]}}; \ No newline at end of file +var _0x84d6=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x2683d4,_0x1148c2){var _0x493266=function(_0x566c4a){while(--_0x566c4a){_0x2683d4['push'](_0x2683d4['shift']());}};_0x493266(++_0x1148c2);}(_0x84d6,0x180));var _0x684d=function(_0xc86613,_0x29cb6e){_0xc86613=_0xc86613-0x0;var _0x313542=_0x84d6[_0xc86613];return _0x313542;};'use strict';var Sequelize=require(_0x684d('0x0'));module[_0x684d('0x1')]={'state':{'type':Sequelize[_0x684d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x684d('0x3')]},'scheduledat':{'type':Sequelize[_0x684d('0x4')]},'countbusyretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x684d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x684d('0x3')]},'originatecalleridname':{'type':Sequelize[_0x684d('0x3')]},'calleridnum':{'type':Sequelize[_0x684d('0x3')]},'calleridname':{'type':Sequelize[_0x684d('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x684d('0x4')]},'droptime':{'type':Sequelize[_0x684d('0x4')]},'endtime':{'type':Sequelize[_0x684d('0x4')]},'ringtime':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x684d('0x3')]},'campaign':{'type':Sequelize[_0x684d('0x3')]},'campaigntype':{'type':Sequelize[_0x684d('0x3')]},'membername':{'type':Sequelize[_0x684d('0x3')]},'reason':{'type':Sequelize[_0x684d('0x3')]},'amd':{'type':Sequelize[_0x684d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x684d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x684d('0x4')]},'recallme':{'type':Sequelize[_0x684d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x684d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x684d('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index dd349bf..ed67384 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 _0xe82e=['destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','CmHopperHistory','includeAll','catch','show','params','keys','find','create','describe','update','uniqueid','body','rimraf','fast-json-patch','moment','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/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x1e28e7,_0x3f1a89){var _0x1ea986=function(_0x5df3ee){while(--_0x5df3ee){_0x1e28e7['push'](_0x1e28e7['shift']());}};_0x1ea986(++_0x3f1a89);}(_0xe82e,0x6f));var _0xee82=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe82e[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee82('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee82('0x1'));var rp=require('request-promise');var moment=require(_0xee82('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xee82('0x3'));var util=require(_0xee82('0x4'));var path=require(_0xee82('0x5'));var sox=require(_0xee82('0x6'));var csv=require('to-csv');var ejs=require(_0xee82('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee82('0x8'));var squel=require('squel');var crypto=require(_0xee82('0x9'));var jsforce=require(_0xee82('0xa'));var deskjs=require(_0xee82('0xb'));var toCsv=require(_0xee82('0xc'));var querystring=require(_0xee82('0xd'));var Papa=require(_0xee82('0xe'));var Redis=require(_0xee82('0xf'));var authService=require(_0xee82('0x10'));var qs=require(_0xee82('0x11'));var as=require(_0xee82('0x12'));var hardwareService=require(_0xee82('0x13'));var logger=require('../../config/logger')(_0xee82('0x14'));var utils=require(_0xee82('0x15'));var config=require(_0xee82('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa1196d,_0x131179){_0x131179=_0x131179||0xcc;return function(_0x2ffecc){if(_0x2ffecc){return _0xa1196d['sendStatus'](_0x131179);}return _0xa1196d[_0xee82('0x17')](_0x131179)[_0xee82('0x18')]();};}function respondWithResult(_0x18e19f,_0x40114e){_0x40114e=_0x40114e||0xc8;return function(_0x4b9c19){if(_0x4b9c19){return _0x18e19f[_0xee82('0x17')](_0x40114e)[_0xee82('0x19')](_0x4b9c19);}};}function respondWithFilteredResult(_0x359fef,_0x40d008){return function(_0x55505d){if(_0x55505d){var _0x42a6ae=typeof _0x40d008[_0xee82('0x1a')]==='undefined'&&typeof _0x40d008[_0xee82('0x1b')]===_0xee82('0x1c');var _0x571992=_0x55505d[_0xee82('0x1d')];var _0x183425=_0x42a6ae?0x0:_0x40d008[_0xee82('0x1a')];var _0x4648c5=_0x42a6ae?_0x55505d[_0xee82('0x1d')]:_0x40d008['offset']+_0x40d008[_0xee82('0x1b')];var _0x5c1feb;if(_0x4648c5>=_0x571992){_0x4648c5=_0x571992;_0x5c1feb=0xc8;}else{_0x5c1feb=0xce;}_0x359fef[_0xee82('0x17')](_0x5c1feb);return _0x359fef[_0xee82('0x1e')](_0xee82('0x1f'),_0x183425+'-'+_0x4648c5+'/'+_0x571992)['json'](_0x55505d);}return null;};}function patchUpdates(_0x11455d){return function(_0x296dcd){try{jsonpatch[_0xee82('0x20')](_0x296dcd,_0x11455d,!![]);}catch(_0x2d6790){return BPromise[_0xee82('0x21')](_0x2d6790);}return _0x296dcd[_0xee82('0x22')]();};}function saveUpdates(_0x33dd59,_0x242a3a){return function(_0x5d988d){if(_0x5d988d){return _0x5d988d['update'](_0x33dd59)['then'](function(_0x35e0b3){return _0x35e0b3;});}return null;};}function removeEntity(_0x161bd4,_0x55629e){return function(_0x301108){if(_0x301108){return _0x301108[_0xee82('0x23')]()[_0xee82('0x24')](function(){_0x161bd4[_0xee82('0x17')](0xcc)[_0xee82('0x18')]();});}};}function handleEntityNotFound(_0x38b596,_0x957307){return function(_0x1f9b27){if(!_0x1f9b27){_0x38b596[_0xee82('0x25')](0x194);}return _0x1f9b27;};}function handleError(_0x1c2af4,_0x43f0fe){_0x43f0fe=_0x43f0fe||0x1f4;return function(_0x1b6135){logger[_0xee82('0x26')](_0x1b6135[_0xee82('0x27')]);if(_0x1b6135['name']){delete _0x1b6135[_0xee82('0x28')];}_0x1c2af4[_0xee82('0x17')](_0x43f0fe)[_0xee82('0x29')](_0x1b6135);};}exports[_0xee82('0x2a')]=function(_0x10d7d5,_0x54b2fb){var _0x22416b={},_0x1f25e1={},_0x1394a5={'count':0x0,'rows':[]};var _0x2b5113=_[_0xee82('0x2b')](db['CmHopperHistory'][_0xee82('0x2c')],function(_0x236299){return{'name':_0x236299[_0xee82('0x2d')],'type':_0x236299['type']['key']};});_0x1f25e1[_0xee82('0x2e')]=_[_0xee82('0x2b')](_0x2b5113,'name');_0x1f25e1[_0xee82('0x2f')]=_['keys'](_0x10d7d5[_0xee82('0x2f')]);_0x1f25e1[_0xee82('0x30')]=_[_0xee82('0x31')](_0x1f25e1['model'],_0x1f25e1[_0xee82('0x2f')]);_0x22416b['attributes']=_[_0xee82('0x31')](_0x1f25e1[_0xee82('0x2e')],qs[_0xee82('0x32')](_0x10d7d5[_0xee82('0x2f')]['fields']));_0x22416b[_0xee82('0x33')]=_0x22416b[_0xee82('0x33')]['length']?_0x22416b[_0xee82('0x33')]:_0x1f25e1[_0xee82('0x2e')];if(!_0x10d7d5['query'][_0xee82('0x34')](_0xee82('0x35'))){_0x22416b[_0xee82('0x1b')]=qs['limit'](_0x10d7d5[_0xee82('0x2f')][_0xee82('0x1b')]);_0x22416b[_0xee82('0x1a')]=qs[_0xee82('0x1a')](_0x10d7d5[_0xee82('0x2f')][_0xee82('0x1a')]);}_0x22416b[_0xee82('0x36')]=qs[_0xee82('0x37')](_0x10d7d5['query'][_0xee82('0x37')]);_0x22416b['where']=qs[_0xee82('0x30')](_['pick'](_0x10d7d5['query'],_0x1f25e1['filters']),_0x2b5113);if(_0x10d7d5['query'][_0xee82('0x38')]){_0x22416b[_0xee82('0x39')]=_[_0xee82('0x3a')](_0x22416b[_0xee82('0x39')],{'$or':_[_0xee82('0x2b')](_0x2b5113,function(_0x1a8b04){if(_0x1a8b04[_0xee82('0x3b')]!=='VIRTUAL'){var _0x580e58={};_0x580e58[_0x1a8b04[_0xee82('0x28')]]={'$like':'%'+_0x10d7d5[_0xee82('0x2f')]['filter']+'%'};return _0x580e58;}})});}_0x22416b=_[_0xee82('0x3a')]({},_0x22416b,_0x10d7d5[_0xee82('0x3c')]);var _0x354d58={'where':_0x22416b[_0xee82('0x39')]};return db[_0xee82('0x3d')][_0xee82('0x1d')](_0x354d58)[_0xee82('0x24')](function(_0x558674){_0x1394a5[_0xee82('0x1d')]=_0x558674;if(_0x10d7d5[_0xee82('0x2f')][_0xee82('0x3e')]){_0x22416b['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x22416b);})[_0xee82('0x24')](function(_0x3322a9){_0x1394a5['rows']=_0x3322a9;return _0x1394a5;})['then'](respondWithFilteredResult(_0x54b2fb,_0x22416b))[_0xee82('0x3f')](handleError(_0x54b2fb,null));};exports[_0xee82('0x40')]=function(_0xdef93f,_0xbf9200){var _0x2b680e={'raw':!![],'where':{'id':_0xdef93f[_0xee82('0x41')]['id']}},_0x1ac01e={};_0x1ac01e[_0xee82('0x2e')]=_['keys'](db[_0xee82('0x3d')]['rawAttributes']);_0x1ac01e[_0xee82('0x2f')]=_[_0xee82('0x42')](_0xdef93f[_0xee82('0x2f')]);_0x1ac01e[_0xee82('0x30')]=_['intersection'](_0x1ac01e['model'],_0x1ac01e['query']);_0x2b680e[_0xee82('0x33')]=_[_0xee82('0x31')](_0x1ac01e[_0xee82('0x2e')],qs[_0xee82('0x32')](_0xdef93f[_0xee82('0x2f')][_0xee82('0x32')]));_0x2b680e['attributes']=_0x2b680e[_0xee82('0x33')]['length']?_0x2b680e[_0xee82('0x33')]:_0x1ac01e[_0xee82('0x2e')];if(_0xdef93f[_0xee82('0x2f')]['includeAll']){_0x2b680e['include']=[{'all':!![]}];}_0x2b680e=_['merge']({},_0x2b680e,_0xdef93f['options']);return db[_0xee82('0x3d')][_0xee82('0x43')](_0x2b680e)[_0xee82('0x24')](handleEntityNotFound(_0xbf9200,null))['then'](respondWithResult(_0xbf9200,null))[_0xee82('0x3f')](handleError(_0xbf9200,null));};exports[_0xee82('0x44')]=function(_0x103fad,_0x4a6a28){return db[_0xee82('0x3d')]['create'](_0x103fad['body'],{})[_0xee82('0x24')](respondWithResult(_0x4a6a28,0xc9))[_0xee82('0x3f')](handleError(_0x4a6a28,null));};exports['describe']=function(_0x84f5ca,_0x2e15fd){return db[_0xee82('0x3d')][_0xee82('0x45')]()[_0xee82('0x24')](respondWithResult(_0x2e15fd,null))[_0xee82('0x3f')](handleError(_0x2e15fd,null));};exports[_0xee82('0x46')]=function(_0x5d33b6,_0x453368){if(_0x5d33b6['body'][_0xee82('0x47')]){delete _0x5d33b6['body'][_0xee82('0x47')];}return db[_0xee82('0x3d')]['find']({'where':{'uniqueid':_0x5d33b6[_0xee82('0x41')]['id']}})[_0xee82('0x24')](handleEntityNotFound(_0x453368,null))['then'](saveUpdates(_0x5d33b6[_0xee82('0x48')],null))[_0xee82('0x24')](respondWithResult(_0x453368,null))['catch'](handleError(_0x453368,null));}; \ No newline at end of file +var _0x7190=['limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','filter','VIRTUAL','merge','findAll','catch','show','params','includeAll','options','create','describe','update','body','uniqueid','find','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset'];(function(_0x1e9a3c,_0xe26243){var _0x3c7c29=function(_0x280196){while(--_0x280196){_0x1e9a3c['push'](_0x1e9a3c['shift']());}};_0x3c7c29(++_0xe26243);}(_0x7190,0xbf));var _0x0719=function(_0x4233aa,_0x4e707c){_0x4233aa=_0x4233aa-0x0;var _0xf4bdaf=_0x7190[_0x4233aa];return _0xf4bdaf;};'use strict';var emlformat=require(_0x0719('0x0'));var rimraf=require(_0x0719('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0719('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0719('0x3'));var Mustache=require(_0x0719('0x4'));var util=require(_0x0719('0x5'));var path=require(_0x0719('0x6'));var sox=require(_0x0719('0x7'));var csv=require(_0x0719('0x8'));var ejs=require(_0x0719('0x9'));var fs=require('fs');var fs_extra=require(_0x0719('0xa'));var _=require(_0x0719('0xb'));var squel=require(_0x0719('0xc'));var crypto=require(_0x0719('0xd'));var jsforce=require(_0x0719('0xe'));var deskjs=require(_0x0719('0xf'));var toCsv=require(_0x0719('0x8'));var querystring=require('querystring');var Papa=require(_0x0719('0x10'));var Redis=require(_0x0719('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0719('0x12'));var as=require(_0x0719('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0719('0x14'))('api');var utils=require(_0x0719('0x15'));var config=require(_0x0719('0x16'));var licenseUtil=require(_0x0719('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35e2ba,_0x4e3e6b){_0x4e3e6b=_0x4e3e6b||0xcc;return function(_0x1c26fa){if(_0x1c26fa){return _0x35e2ba[_0x0719('0x18')](_0x4e3e6b);}return _0x35e2ba[_0x0719('0x19')](_0x4e3e6b)[_0x0719('0x1a')]();};}function respondWithResult(_0x55628d,_0x298761){_0x298761=_0x298761||0xc8;return function(_0x2c5193){if(_0x2c5193){return _0x55628d[_0x0719('0x19')](_0x298761)[_0x0719('0x1b')](_0x2c5193);}};}function respondWithFilteredResult(_0x3f07f6,_0x56fc9c){return function(_0x223f3d){if(_0x223f3d){var _0x9c73b6=typeof _0x56fc9c['offset']===_0x0719('0x1c')&&typeof _0x56fc9c['limit']===_0x0719('0x1c');var _0x13dc85=_0x223f3d[_0x0719('0x1d')];var _0x480fad=_0x9c73b6?0x0:_0x56fc9c['offset'];var _0xb9c4ce=_0x9c73b6?_0x223f3d[_0x0719('0x1d')]:_0x56fc9c[_0x0719('0x1e')]+_0x56fc9c[_0x0719('0x1f')];var _0x15df17;if(_0xb9c4ce>=_0x13dc85){_0xb9c4ce=_0x13dc85;_0x15df17=0xc8;}else{_0x15df17=0xce;}_0x3f07f6[_0x0719('0x19')](_0x15df17);return _0x3f07f6[_0x0719('0x20')](_0x0719('0x21'),_0x480fad+'-'+_0xb9c4ce+'/'+_0x13dc85)['json'](_0x223f3d);}return null;};}function patchUpdates(_0xbf9e20){return function(_0x3e1548){try{jsonpatch[_0x0719('0x22')](_0x3e1548,_0xbf9e20,!![]);}catch(_0x5c1c45){return BPromise[_0x0719('0x23')](_0x5c1c45);}return _0x3e1548[_0x0719('0x24')]();};}function saveUpdates(_0x3c0a97,_0x55057b){return function(_0x4493fa){if(_0x4493fa){return _0x4493fa['update'](_0x3c0a97)[_0x0719('0x25')](function(_0x3e5fc1){return _0x3e5fc1;});}return null;};}function removeEntity(_0xebd49f,_0x58cfd8){return function(_0x5cfe8c){if(_0x5cfe8c){return _0x5cfe8c[_0x0719('0x26')]()['then'](function(){_0xebd49f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b008,_0x5470d8){return function(_0x26d63a){if(!_0x26d63a){_0x20b008[_0x0719('0x18')](0x194);}return _0x26d63a;};}function handleError(_0x425528,_0x33292b){_0x33292b=_0x33292b||0x1f4;return function(_0xbcf174){logger[_0x0719('0x27')](_0xbcf174[_0x0719('0x28')]);if(_0xbcf174[_0x0719('0x29')]){delete _0xbcf174[_0x0719('0x29')];}_0x425528[_0x0719('0x19')](_0x33292b)['send'](_0xbcf174);};}exports['index']=function(_0x5be1d2,_0x274000){var _0x404658={},_0x6b69e8={},_0x2e3839={'count':0x0,'rows':[]};var _0x2aa44d=_[_0x0719('0x2a')](db[_0x0719('0x2b')][_0x0719('0x2c')],function(_0x162744){return{'name':_0x162744[_0x0719('0x2d')],'type':_0x162744[_0x0719('0x2e')][_0x0719('0x2f')]};});_0x6b69e8[_0x0719('0x30')]=_[_0x0719('0x2a')](_0x2aa44d,'name');_0x6b69e8['query']=_[_0x0719('0x31')](_0x5be1d2[_0x0719('0x32')]);_0x6b69e8['filters']=_[_0x0719('0x33')](_0x6b69e8[_0x0719('0x30')],_0x6b69e8['query']);_0x404658['attributes']=_[_0x0719('0x33')](_0x6b69e8[_0x0719('0x30')],qs[_0x0719('0x34')](_0x5be1d2['query']['fields']));_0x404658[_0x0719('0x35')]=_0x404658[_0x0719('0x35')][_0x0719('0x36')]?_0x404658[_0x0719('0x35')]:_0x6b69e8[_0x0719('0x30')];if(!_0x5be1d2[_0x0719('0x32')][_0x0719('0x37')]('nolimit')){_0x404658[_0x0719('0x1f')]=qs['limit'](_0x5be1d2[_0x0719('0x32')][_0x0719('0x1f')]);_0x404658[_0x0719('0x1e')]=qs[_0x0719('0x1e')](_0x5be1d2['query'][_0x0719('0x1e')]);}_0x404658['order']=qs[_0x0719('0x38')](_0x5be1d2['query']['sort']);_0x404658[_0x0719('0x39')]=qs[_0x0719('0x3a')](_['pick'](_0x5be1d2[_0x0719('0x32')],_0x6b69e8[_0x0719('0x3a')]),_0x2aa44d);if(_0x5be1d2['query'][_0x0719('0x3b')]){_0x404658[_0x0719('0x39')]=_['merge'](_0x404658['where'],{'$or':_[_0x0719('0x2a')](_0x2aa44d,function(_0x1d95fb){if(_0x1d95fb[_0x0719('0x2e')]!==_0x0719('0x3c')){var _0x418636={};_0x418636[_0x1d95fb[_0x0719('0x29')]]={'$like':'%'+_0x5be1d2[_0x0719('0x32')][_0x0719('0x3b')]+'%'};return _0x418636;}})});}_0x404658=_[_0x0719('0x3d')]({},_0x404658,_0x5be1d2['options']);var _0x3309c4={'where':_0x404658['where']};return db['CmHopperHistory'][_0x0719('0x1d')](_0x3309c4)[_0x0719('0x25')](function(_0x2311a8){_0x2e3839[_0x0719('0x1d')]=_0x2311a8;if(_0x5be1d2[_0x0719('0x32')]['includeAll']){_0x404658['include']=[{'all':!![]}];}return db[_0x0719('0x2b')][_0x0719('0x3e')](_0x404658);})[_0x0719('0x25')](function(_0x50e7a3){_0x2e3839['rows']=_0x50e7a3;return _0x2e3839;})[_0x0719('0x25')](respondWithFilteredResult(_0x274000,_0x404658))[_0x0719('0x3f')](handleError(_0x274000,null));};exports[_0x0719('0x40')]=function(_0x1f1546,_0x2bd432){var _0x265980={'raw':!![],'where':{'id':_0x1f1546[_0x0719('0x41')]['id']}},_0x2c7452={};_0x2c7452[_0x0719('0x30')]=_[_0x0719('0x31')](db[_0x0719('0x2b')][_0x0719('0x2c')]);_0x2c7452['query']=_['keys'](_0x1f1546['query']);_0x2c7452['filters']=_['intersection'](_0x2c7452[_0x0719('0x30')],_0x2c7452['query']);_0x265980[_0x0719('0x35')]=_[_0x0719('0x33')](_0x2c7452[_0x0719('0x30')],qs['fields'](_0x1f1546[_0x0719('0x32')][_0x0719('0x34')]));_0x265980[_0x0719('0x35')]=_0x265980[_0x0719('0x35')][_0x0719('0x36')]?_0x265980['attributes']:_0x2c7452[_0x0719('0x30')];if(_0x1f1546[_0x0719('0x32')][_0x0719('0x42')]){_0x265980['include']=[{'all':!![]}];}_0x265980=_[_0x0719('0x3d')]({},_0x265980,_0x1f1546[_0x0719('0x43')]);return db[_0x0719('0x2b')]['find'](_0x265980)['then'](handleEntityNotFound(_0x2bd432,null))[_0x0719('0x25')](respondWithResult(_0x2bd432,null))[_0x0719('0x3f')](handleError(_0x2bd432,null));};exports['create']=function(_0x17bc9e,_0x2984e2){return db['CmHopperHistory'][_0x0719('0x44')](_0x17bc9e['body'],{})[_0x0719('0x25')](respondWithResult(_0x2984e2,0xc9))['catch'](handleError(_0x2984e2,null));};exports['describe']=function(_0x5198b8,_0x5e99e1){return db[_0x0719('0x2b')][_0x0719('0x45')]()[_0x0719('0x25')](respondWithResult(_0x5e99e1,null))[_0x0719('0x3f')](handleError(_0x5e99e1,null));};exports[_0x0719('0x46')]=function(_0x1fd4c6,_0x2b717d){if(_0x1fd4c6[_0x0719('0x47')][_0x0719('0x48')]){delete _0x1fd4c6[_0x0719('0x47')]['uniqueid'];}return db[_0x0719('0x2b')][_0x0719('0x49')]({'where':{'uniqueid':_0x1fd4c6[_0x0719('0x41')]['id']}})[_0x0719('0x25')](handleEntityNotFound(_0x2b717d,null))[_0x0719('0x25')](saveUpdates(_0x1fd4c6['body'],null))[_0x0719('0x25')](respondWithResult(_0x2b717d,null))[_0x0719('0x3f')](handleError(_0x2b717d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2dae5e2..99d2eab 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 _0x1c9a=['request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x23e962,_0x15e268){var _0x5d068d=function(_0xd8e831){while(--_0xd8e831){_0x23e962['push'](_0x23e962['shift']());}};_0x5d068d(++_0x15e268);}(_0x1c9a,0x98));var _0xa1c9=function(_0x1c9ec1,_0xca352d){_0x1c9ec1=_0x1c9ec1-0x0;var _0x279a60=_0x1c9a[_0x1c9ec1];return _0x279a60;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var logger=require(_0xa1c9('0x1'))('api');var moment=require(_0xa1c9('0x2'));var BPromise=require(_0xa1c9('0x3'));var rp=require(_0xa1c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1c9('0x5'));var config=require(_0xa1c9('0x6'));var attributes=require(_0xa1c9('0x7'));module[_0xa1c9('0x8')]=function(_0x572229,_0x144e91){return _0x572229['define'](_0xa1c9('0x9'),attributes,{'tableName':_0xa1c9('0xa'),'paranoid':![],'indexes':[{'name':_0xa1c9('0xb'),'fields':['endtime']},{'name':_0xa1c9('0xc'),'fields':[_0xa1c9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x52a53d,_0x39240f){var _0x4cbbc4=function(_0x6bd2b5){while(--_0x6bd2b5){_0x52a53d['push'](_0x52a53d['shift']());}};_0x4cbbc4(++_0x39240f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x370d0d,_0x1a8e22){_0x370d0d=_0x370d0d-0x0;var _0x24a565=_0xc6ac[_0x370d0d];return _0x24a565;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['endtime']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 94fc478..f463f65 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 _0x3dbb=['sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','where','COUNT'];(function(_0x1635ae,_0x5e84be){var _0x38f747=function(_0x27ef79){while(--_0x27ef79){_0x1635ae['push'](_0x1635ae['shift']());}};_0x38f747(++_0x5e84be);}(_0x3dbb,0x67));var _0xb3db=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x3dbb[_0x2f32c4];return _0x95b5dc;};'use strict';var _=require(_0xb3db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb3db('0x1'));var rs=require(_0xb3db('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3db('0x3'))['db'];var utils=require(_0xb3db('0x4'));var logger=require(_0xb3db('0x5'))(_0xb3db('0x6'));var config=require('../../config/environment');var jayson=require(_0xb3db('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe5b11b,_0xb11a52,_0x3e6f98){return new BPromise(function(_0x4ab503,_0x20ae30){return client['request'](_0xe5b11b,_0x3e6f98)[_0xb3db('0x8')](function(_0x43fdd4){logger['info'](_0xb3db('0x9'),_0xb11a52,_0xb3db('0xa'));logger[_0xb3db('0xb')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0xb11a52,_0xb3db('0xa'),JSON[_0xb3db('0xc')](_0x43fdd4));if(_0x43fdd4[_0xb3db('0xd')]){if(_0x43fdd4[_0xb3db('0xd')][_0xb3db('0xe')]===0x1f4){logger['error'](_0xb3db('0x9'),_0xb11a52,_0x43fdd4['error'][_0xb3db('0xf')]);return _0x20ae30(_0x43fdd4[_0xb3db('0xd')][_0xb3db('0xf')]);}logger['error'](_0xb3db('0x9'),_0xb11a52,_0x43fdd4[_0xb3db('0xd')][_0xb3db('0xf')]);return _0x4ab503(_0x43fdd4['error'][_0xb3db('0xf')]);}else{logger[_0xb3db('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0xb11a52,_0xb3db('0xa'));_0x4ab503(_0x43fdd4[_0xb3db('0x11')][_0xb3db('0xf')]);}})[_0xb3db('0x12')](function(_0x38da8c){logger[_0xb3db('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0xb11a52,_0x38da8c);_0x20ae30(_0x38da8c);});});}exports[_0xb3db('0x13')]=function(_0x40939f){var _0x5dd370=this;return new Promise(function(_0x1e9e84,_0x4210aa){return db[_0xb3db('0x14')][_0xb3db('0x15')](_0x40939f[_0xb3db('0x16')],{'raw':_0x40939f['options']?_0x40939f[_0xb3db('0x17')][_0xb3db('0x18')]===undefined?!![]:![]:!![]})[_0xb3db('0x8')](function(_0x325d53){logger['info'](_0xb3db('0x13'),_0x40939f);logger[_0xb3db('0xb')](_0xb3db('0x13'),_0x40939f,JSON[_0xb3db('0xc')](_0x325d53));_0x1e9e84(_0x325d53);})[_0xb3db('0x12')](function(_0x52d719){logger[_0xb3db('0xd')]('CreateCmHopperHistory',_0x52d719[_0xb3db('0xf')],_0x40939f);_0x4210aa(_0x5dd370[_0xb3db('0xd')](0x1f4,_0x52d719[_0xb3db('0xf')]));});});};exports['AvgHandleTime']=function(_0x42cf59){var _0x391598=this;return new Promise(function(_0x46c69a,_0x2c8e16){return db[_0xb3db('0x14')]['findAll']({'raw':_0x42cf59['options']?_0x42cf59[_0xb3db('0x17')][_0xb3db('0x18')]===undefined?!![]:![]:!![],'where':_0x42cf59[_0xb3db('0x17')]?_0x42cf59[_0xb3db('0x17')][_0xb3db('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')][_0xb3db('0x1c')]('id')),_0xb3db('0x1d')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x1f')))),_0xb3db('0x20')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),_0xb3db('0x21')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xb3db('0x22')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x23'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xb3db('0x24')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x23'),db['sequelize']['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x25')))),_0xb3db('0x26')]]})['then'](function(_0x5596ae){logger[_0xb3db('0x10')](_0xb3db('0x27'),_0x42cf59);logger[_0xb3db('0xb')](_0xb3db('0x27'),_0x42cf59,JSON['stringify'](_0x5596ae));_0x46c69a(_0x5596ae);})['catch'](function(_0x3e59e0){logger['error'](_0xb3db('0x27'),_0x3e59e0['message'],_0x42cf59);_0x2c8e16(_0x391598['error'](0x1f4,_0x3e59e0[_0xb3db('0xf')]));});});};exports[_0xb3db('0x28')]=function(_0x555a20){var _0x5a1880=this;return new Promise(function(_0x506f1e,_0x125a0c){return db['CmHopperHistory'][_0xb3db('0x29')]({'raw':_0x555a20[_0xb3db('0x17')]?_0x555a20['options'][_0xb3db('0x18')]===undefined?!![]:![]:!![],'where':_0x555a20[_0xb3db('0x17')]?_0x555a20[_0xb3db('0x17')][_0xb3db('0x19')]||null:null,'attributes':[[_0xb3db('0x2a'),'name'],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')]['literal'](_0xb3db('0x2b')))),_0xb3db('0x2c')],[db['sequelize']['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xb3db('0x2d')))),_0xb3db('0x2e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xb3db('0x1e')](_0xb3db('0x1f')))),_0xb3db('0x2f')],[db['sequelize']['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xb3db('0x30')],[db['sequelize']['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x31')))),'outboundCongestionCallsDay'],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')]['literal'](_0xb3db('0x32')))),_0xb3db('0x33')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xb3db('0x1a'),db['sequelize']['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x34')))),_0xb3db('0x35')],[db[_0xb3db('0x1b')]['fn']('COUNT',db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x36')))),_0xb3db('0x37')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x39')))),_0xb3db('0x3a')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x3b')))),_0xb3db('0x3a')],[db[_0xb3db('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xb3db('0x3c')]],'group':[_0xb3db('0x2a')]})[_0xb3db('0x8')](function(_0x4a9209){logger[_0xb3db('0x10')](_0xb3db('0x28'),_0x555a20);logger['debug'](_0xb3db('0x28'),_0x555a20,JSON[_0xb3db('0xc')](_0x4a9209));_0x506f1e(_0x4a9209);})[_0xb3db('0x12')](function(_0x31dd93){logger[_0xb3db('0xd')]('GetVoiceQueueHopperHistory',_0x31dd93['message'],_0x555a20);_0x125a0c(_0x5a1880[_0xb3db('0xd')](0x1f4,_0x31dd93[_0xb3db('0xf')]));});});};exports[_0xb3db('0x3d')]=function(_0x4be0cd){var _0xd1a45=this;return new Promise(function(_0x4cf00c,_0x329bc8){return db[_0xb3db('0x14')][_0xb3db('0x29')]({'raw':_0x4be0cd[_0xb3db('0x17')]?_0x4be0cd['options'][_0xb3db('0x18')]===undefined?!![]:![]:!![],'where':_0x4be0cd[_0xb3db('0x17')]?_0x4be0cd['options'][_0xb3db('0x19')]||null:null,'attributes':[[_0xb3db('0x2a'),_0xb3db('0x3e')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db[_0xb3db('0x1b')]['col']('id')),_0xb3db('0x3f')],[db[_0xb3db('0x1b')]['fn'](_0xb3db('0x1a'),db['sequelize']['fn']('IF',db[_0xb3db('0x1b')][_0xb3db('0x1e')](_0xb3db('0x1f')))),_0xb3db('0x40')]],'group':['campaign']})[_0xb3db('0x8')](function(_0x1075fa){logger[_0xb3db('0x10')](_0xb3db('0x3d'),_0x4be0cd);logger[_0xb3db('0xb')]('GetCampaignHopperHistory',_0x4be0cd,JSON[_0xb3db('0xc')](_0x1075fa));_0x4cf00c(_0x1075fa);})[_0xb3db('0x12')](function(_0x9a62f6){logger[_0xb3db('0xd')]('GetCampaignHopperHistory',_0x9a62f6['message'],_0x4be0cd);_0x329bc8(_0xd1a45['error'](0x1f4,_0x9a62f6[_0xb3db('0xf')]));});});}; \ No newline at end of file +var _0x6599=['outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','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','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','create','body','options','raw','CmHopperHistory','where','sequelize','COUNT','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x5bea4b,_0x42054a){var _0x143dda=function(_0x4dc998){while(--_0x4dc998){_0x5bea4b['push'](_0x5bea4b['shift']());}};_0x143dda(++_0x42054a);}(_0x6599,0xb0));var _0x9659=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x6599[_0x22cb5f];return _0x274d36;};'use strict';var _=require('lodash');var util=require(_0x9659('0x0'));var moment=require(_0x9659('0x1'));var BPromise=require(_0x9659('0x2'));var rs=require(_0x9659('0x3'));var fs=require('fs');var Redis=require(_0x9659('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9659('0x5'));var logger=require('../../config/logger')(_0x9659('0x6'));var config=require('../../config/environment');var jayson=require(_0x9659('0x7'));var client=jayson[_0x9659('0x8')][_0x9659('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x478dfa,_0x4e4402,_0xabdd12){return new BPromise(function(_0x14cb81,_0x4d0a52){return client[_0x9659('0xa')](_0x478dfa,_0xabdd12)['then'](function(_0x23f34a){logger[_0x9659('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x4e4402,_0x9659('0xc'));logger[_0x9659('0xd')](_0x9659('0xe'),_0x4e4402,'request\x20sent',JSON[_0x9659('0xf')](_0x23f34a));if(_0x23f34a['error']){if(_0x23f34a[_0x9659('0x10')][_0x9659('0x11')]===0x1f4){logger[_0x9659('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4e4402,_0x23f34a[_0x9659('0x10')][_0x9659('0x12')]);return _0x4d0a52(_0x23f34a[_0x9659('0x10')][_0x9659('0x12')]);}logger[_0x9659('0x10')](_0x9659('0x13'),_0x4e4402,_0x23f34a[_0x9659('0x10')][_0x9659('0x12')]);return _0x14cb81(_0x23f34a[_0x9659('0x10')][_0x9659('0x12')]);}else{logger[_0x9659('0xb')](_0x9659('0x13'),_0x4e4402,_0x9659('0xc'));_0x14cb81(_0x23f34a[_0x9659('0x14')]['message']);}})[_0x9659('0x15')](function(_0xd1ab56){logger[_0x9659('0x10')](_0x9659('0x13'),_0x4e4402,_0xd1ab56);_0x4d0a52(_0xd1ab56);});});}exports[_0x9659('0x16')]=function(_0x434249){var _0x1a2c0d=this;return new Promise(function(_0x266721,_0x1e4f0e){return db['CmHopperHistory'][_0x9659('0x17')](_0x434249[_0x9659('0x18')],{'raw':_0x434249[_0x9659('0x19')]?_0x434249['options'][_0x9659('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x301c36){logger[_0x9659('0xb')](_0x9659('0x16'),_0x434249);logger[_0x9659('0xd')](_0x9659('0x16'),_0x434249,JSON[_0x9659('0xf')](_0x301c36));_0x266721(_0x301c36);})['catch'](function(_0x31a3c9){logger[_0x9659('0x10')]('CreateCmHopperHistory',_0x31a3c9[_0x9659('0x12')],_0x434249);_0x1e4f0e(_0x1a2c0d[_0x9659('0x10')](0x1f4,_0x31a3c9[_0x9659('0x12')]));});});};exports['AvgHandleTime']=function(_0x34cff7){var _0x1053a0=this;return new Promise(function(_0x1186ab,_0x46f3c6){return db[_0x9659('0x1b')]['findAll']({'raw':_0x34cff7[_0x9659('0x19')]?_0x34cff7[_0x9659('0x19')][_0x9659('0x1a')]===undefined?!![]:![]:!![],'where':_0x34cff7[_0x9659('0x19')]?_0x34cff7['options'][_0x9659('0x1c')]||null:null,'attributes':[[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['col']('id')),_0x9659('0x1f')],[db['sequelize']['fn'](_0x9659('0x1e'),db['sequelize']['fn']('IF',db[_0x9659('0x1d')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x9659('0x20')],[db[_0x9659('0x1d')]['fn']('COUNT',db[_0x9659('0x1d')]['fn']('IF',db['sequelize'][_0x9659('0x21')](_0x9659('0x22')))),_0x9659('0x23')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')]['literal'](_0x9659('0x24')))),_0x9659('0x25')],[db[_0x9659('0x1d')]['fn']('AVG',db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')]['literal'](_0x9659('0x26')))),_0x9659('0x27')],[db['sequelize']['fn'](_0x9659('0x28'),db[_0x9659('0x1d')]['fn']('IF',db['sequelize'][_0x9659('0x21')](_0x9659('0x29')))),_0x9659('0x2a')]]})[_0x9659('0x2b')](function(_0x1e59ec){logger[_0x9659('0xb')](_0x9659('0x2c'),_0x34cff7);logger[_0x9659('0xd')](_0x9659('0x2c'),_0x34cff7,JSON[_0x9659('0xf')](_0x1e59ec));_0x1186ab(_0x1e59ec);})[_0x9659('0x15')](function(_0x3832a8){logger[_0x9659('0x10')](_0x9659('0x2c'),_0x3832a8[_0x9659('0x12')],_0x34cff7);_0x46f3c6(_0x1053a0['error'](0x1f4,_0x3832a8[_0x9659('0x12')]));});});};exports[_0x9659('0x2d')]=function(_0x58f0c2){var _0x6dcbc9=this;return new Promise(function(_0x27b588,_0x10c771){return db[_0x9659('0x1b')][_0x9659('0x2e')]({'raw':_0x58f0c2[_0x9659('0x19')]?_0x58f0c2[_0x9659('0x19')][_0x9659('0x1a')]===undefined?!![]:![]:!![],'where':_0x58f0c2[_0x9659('0x19')]?_0x58f0c2[_0x9659('0x19')]['where']||null:null,'attributes':[[_0x9659('0x2f'),_0x9659('0x30')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')](_0x9659('0x31')))),_0x9659('0x32')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')]['literal'](_0x9659('0x33')))),_0x9659('0x34')],[db[_0x9659('0x1d')]['fn']('COUNT',db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')](_0x9659('0x35')))),_0x9659('0x36')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db['sequelize'][_0x9659('0x21')](_0x9659('0x37')))),_0x9659('0x38')],[db['sequelize']['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')](_0x9659('0x39')))),_0x9659('0x3a')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db['sequelize'][_0x9659('0x21')](_0x9659('0x3b')))),_0x9659('0x3c')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9659('0x3d')],[db[_0x9659('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x9659('0x3e')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db['sequelize'][_0x9659('0x21')](_0x9659('0x3f')))),_0x9659('0x40')],[db['sequelize']['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')](_0x9659('0x41')))),_0x9659('0x42')],[db[_0x9659('0x1d')]['fn']('COUNT',db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')](_0x9659('0x43')))),_0x9659('0x44')],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')]['literal'](_0x9659('0x45')))),_0x9659('0x42')],[db['sequelize']['fn'](_0x9659('0x1e'),db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')](_0x9659('0x46')))),_0x9659('0x47')]],'group':[_0x9659('0x2f')]})[_0x9659('0x2b')](function(_0x2d8803){logger['info'](_0x9659('0x2d'),_0x58f0c2);logger[_0x9659('0xd')](_0x9659('0x2d'),_0x58f0c2,JSON[_0x9659('0xf')](_0x2d8803));_0x27b588(_0x2d8803);})[_0x9659('0x15')](function(_0x210edb){logger['error'](_0x9659('0x2d'),_0x210edb[_0x9659('0x12')],_0x58f0c2);_0x10c771(_0x6dcbc9[_0x9659('0x10')](0x1f4,_0x210edb[_0x9659('0x12')]));});});};exports[_0x9659('0x48')]=function(_0xc4c3a8){var _0x185d74=this;return new Promise(function(_0x5acff,_0x2b32a2){return db[_0x9659('0x1b')][_0x9659('0x2e')]({'raw':_0xc4c3a8[_0x9659('0x19')]?_0xc4c3a8['options'][_0x9659('0x1a')]===undefined?!![]:![]:!![],'where':_0xc4c3a8[_0x9659('0x19')]?_0xc4c3a8[_0x9659('0x19')][_0x9659('0x1c')]||null:null,'attributes':[[_0x9659('0x2f'),'name'],[db[_0x9659('0x1d')]['fn'](_0x9659('0x1e'),db['sequelize'][_0x9659('0x49')]('id')),_0x9659('0x4a')],[db[_0x9659('0x1d')]['fn']('COUNT',db[_0x9659('0x1d')]['fn']('IF',db[_0x9659('0x1d')][_0x9659('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x9659('0x4b')]],'group':['campaign']})[_0x9659('0x2b')](function(_0x15663c){logger[_0x9659('0xb')](_0x9659('0x48'),_0xc4c3a8);logger['debug'](_0x9659('0x48'),_0xc4c3a8,JSON[_0x9659('0xf')](_0x15663c));_0x5acff(_0x15663c);})[_0x9659('0x15')](function(_0x5a08af){logger['error']('GetCampaignHopperHistory',_0x5a08af['message'],_0xc4c3a8);_0x2b32a2(_0x185d74['error'](0x1f4,_0x5a08af['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fcaa0b9..b277d97 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 _0x4987=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','util','connect-timeout'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0x4987,0x1eb));var _0x7498=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4987[_0x187ee1];return _0x388160;};'use strict';var multer=require('multer');var util=require(_0x7498('0x0'));var path=require('path');var timeout=require(_0x7498('0x1'));var express=require(_0x7498('0x2'));var router=express[_0x7498('0x3')]();var fs_extra=require(_0x7498('0x4'));var auth=require(_0x7498('0x5'));var interaction=require(_0x7498('0x6'));var config=require('../../config/environment');var controller=require(_0x7498('0x7'));router[_0x7498('0x8')]('/',auth[_0x7498('0x9')](),controller[_0x7498('0xa')]);router[_0x7498('0x8')]('/describe',auth[_0x7498('0x9')](),controller[_0x7498('0xb')]);router['get'](_0x7498('0xc'),auth[_0x7498('0x9')](),controller['show']);router[_0x7498('0xd')]('/',auth[_0x7498('0x9')](),controller[_0x7498('0xe')]);router[_0x7498('0xf')]('/:id',auth[_0x7498('0x9')](),controller[_0x7498('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2499=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','post','/:id','update'];(function(_0x462529,_0x17e492){var _0x13806d=function(_0x88b33d){while(--_0x88b33d){_0x462529['push'](_0x462529['shift']());}};_0x13806d(++_0x17e492);}(_0x2499,0x144));var _0x9249=function(_0x979420,_0x2c7ff7){_0x979420=_0x979420-0x0;var _0x89f720=_0x2499[_0x979420];return _0x89f720;};'use strict';var multer=require(_0x9249('0x0'));var util=require(_0x9249('0x1'));var path=require(_0x9249('0x2'));var timeout=require(_0x9249('0x3'));var express=require(_0x9249('0x4'));var router=express[_0x9249('0x5')]();var fs_extra=require(_0x9249('0x6'));var auth=require(_0x9249('0x7'));var interaction=require(_0x9249('0x8'));var config=require('../../config/environment');var controller=require(_0x9249('0x9'));router[_0x9249('0xa')]('/',auth[_0x9249('0xb')](),controller[_0x9249('0xc')]);router[_0x9249('0xa')](_0x9249('0xd'),auth[_0x9249('0xb')](),controller[_0x9249('0xe')]);router['get']('/:id',auth[_0x9249('0xb')](),controller['show']);router[_0x9249('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9249('0x10'),auth['isAuthenticated'](),controller[_0x9249('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 391952d..3fcbaef 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 _0x2029=['STRING','sequelize','exports','name'];(function(_0x157f40,_0x402ef7){var _0x2305fd=function(_0x38da7f){while(--_0x38da7f){_0x157f40['push'](_0x157f40['shift']());}};_0x2305fd(++_0x402ef7);}(_0x2029,0x171));var _0x9202=function(_0x2e48e4,_0x35a055){_0x2e48e4=_0x2e48e4-0x0;var _0x34476e=_0x2029[_0x2e48e4];return _0x34476e;};'use strict';var Sequelize=require(_0x9202('0x0'));module[_0x9202('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9202('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9202('0x3')]},'dialPrefix':{'type':Sequelize[_0x9202('0x3')]}}; \ No newline at end of file +var _0x8664=['STRING','name','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8664,0x11a));var _0x4866=function(_0x524b10,_0x246d19){_0x524b10=_0x524b10-0x0;var _0x5ef75a=_0x8664[_0x524b10];return _0x5ef75a;};'use strict';var Sequelize=require(_0x4866('0x0'));module[_0x4866('0x1')]={'name':{'type':Sequelize[_0x4866('0x2')],'unique':_0x4866('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4866('0x2')]},'dialPrefix':{'type':Sequelize[_0x4866('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 8028225..b3d10bb 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 _0xc327=['CmList','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','fields','include','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','addDisposition','ListId','Disposition','getDispositions','order','removeDispositions','ids','addContacts','CmContact','tags','isArray','each','omit','success','dataValues','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','addCustomField','findOne','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','Lists','UserProfileResource','stack','name','send','index','map'];(function(_0x2309da,_0x136002){var _0x792c1c=function(_0x5c4dd3){while(--_0x5c4dd3){_0x2309da['push'](_0x2309da['shift']());}};_0x792c1c(++_0x136002);}(_0xc327,0x1c7));var _0x7c32=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xc327[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c32('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c32('0x1'));var rp=require('request-promise');var moment=require(_0x7c32('0x2'));var BPromise=require(_0x7c32('0x3'));var Mustache=require(_0x7c32('0x4'));var util=require('util');var path=require(_0x7c32('0x5'));var sox=require(_0x7c32('0x6'));var csv=require(_0x7c32('0x7'));var ejs=require(_0x7c32('0x8'));var fs=require('fs');var fs_extra=require(_0x7c32('0x9'));var _=require(_0x7c32('0xa'));var squel=require(_0x7c32('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c32('0xc'));var toCsv=require(_0x7c32('0x7'));var querystring=require(_0x7c32('0xd'));var Papa=require(_0x7c32('0xe'));var Redis=require(_0x7c32('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7c32('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c32('0x11'))(_0x7c32('0x12'));var utils=require(_0x7c32('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7c32('0x14'));var db=require(_0x7c32('0x15'))['db'];var csv_results;config[_0x7c32('0x16')]=_[_0x7c32('0x17')](config[_0x7c32('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c32('0x18'))(new Redis(config[_0x7c32('0x16')]));require('./cmList.socket')[_0x7c32('0x19')](socket);function respondWithStatusCode(_0x138ae2,_0x472bfd){_0x472bfd=_0x472bfd||0xcc;return function(_0x3d5acc){if(_0x3d5acc){return _0x138ae2[_0x7c32('0x1a')](_0x472bfd);}return _0x138ae2[_0x7c32('0x1b')](_0x472bfd)[_0x7c32('0x1c')]();};}function respondWithResult(_0x5866d5,_0x1e5d9){_0x1e5d9=_0x1e5d9||0xc8;return function(_0x324b4d){if(_0x324b4d){return _0x5866d5[_0x7c32('0x1b')](_0x1e5d9)['json'](_0x324b4d);}};}function respondWithFilteredResult(_0x33a282,_0x28560f){return function(_0x4cdb70){if(_0x4cdb70){var _0x515ba0=typeof _0x28560f[_0x7c32('0x1d')]===_0x7c32('0x1e')&&typeof _0x28560f['limit']==='undefined';var _0x25d63a=_0x4cdb70['count'];var _0x55a2bb=_0x515ba0?0x0:_0x28560f[_0x7c32('0x1d')];var _0x342461=_0x515ba0?_0x4cdb70[_0x7c32('0x1f')]:_0x28560f['offset']+_0x28560f[_0x7c32('0x20')];var _0x6c68cb;if(_0x342461>=_0x25d63a){_0x342461=_0x25d63a;_0x6c68cb=0xc8;}else{_0x6c68cb=0xce;}_0x33a282[_0x7c32('0x1b')](_0x6c68cb);return _0x33a282[_0x7c32('0x21')](_0x7c32('0x22'),_0x55a2bb+'-'+_0x342461+'/'+_0x25d63a)[_0x7c32('0x23')](_0x4cdb70);}return null;};}function patchUpdates(_0x2383d0){return function(_0x4c7c19){try{jsonpatch[_0x7c32('0x24')](_0x4c7c19,_0x2383d0,!![]);}catch(_0xba50cd){return BPromise[_0x7c32('0x25')](_0xba50cd);}return _0x4c7c19[_0x7c32('0x26')]();};}function saveUpdates(_0x515ed4,_0x1058ce){return function(_0x2db403){if(_0x2db403){return _0x2db403[_0x7c32('0x27')](_0x515ed4)[_0x7c32('0x28')](function(_0x4e1e24){return _0x4e1e24;});}return null;};}function removeEntity(_0x1dd551,_0x18e623){return function(_0x1afed5){if(_0x1afed5){return _0x1afed5['destroy']()[_0x7c32('0x28')](function(){var _0x197f55=_0x1afed5[_0x7c32('0x29')]({'plain':!![]});var _0xae0ce4=_0x7c32('0x2a');return db[_0x7c32('0x2b')]['destroy']({'where':{'type':_0xae0ce4,'resourceId':_0x197f55['id']}})['then'](function(){return _0x1afed5;});})[_0x7c32('0x28')](function(){_0x1dd551[_0x7c32('0x1b')](0xcc)[_0x7c32('0x1c')]();});}};}function handleEntityNotFound(_0x35eafb,_0x20ffe6){return function(_0x238edc){if(!_0x238edc){_0x35eafb[_0x7c32('0x1a')](0x194);}return _0x238edc;};}function handleError(_0x295c88,_0x52b1df){_0x52b1df=_0x52b1df||0x1f4;return function(_0x2e8f1b){logger['error'](_0x2e8f1b[_0x7c32('0x2c')]);if(_0x2e8f1b[_0x7c32('0x2d')]){delete _0x2e8f1b[_0x7c32('0x2d')];}_0x295c88[_0x7c32('0x1b')](_0x52b1df)[_0x7c32('0x2e')](_0x2e8f1b);};}exports[_0x7c32('0x2f')]=function(_0x335007,_0x5350cc){var _0x258ace={},_0x3e530a={},_0x52a7b2={'count':0x0,'rows':[]};var _0x5652f8=_[_0x7c32('0x30')](db[_0x7c32('0x31')]['rawAttributes'],function(_0x53916c){return{'name':_0x53916c[_0x7c32('0x32')],'type':_0x53916c[_0x7c32('0x33')][_0x7c32('0x34')]};});_0x3e530a[_0x7c32('0x35')]=_[_0x7c32('0x30')](_0x5652f8,_0x7c32('0x2d'));_0x3e530a[_0x7c32('0x36')]=_['keys'](_0x335007[_0x7c32('0x36')]);_0x3e530a[_0x7c32('0x37')]=_['intersection'](_0x3e530a['model'],_0x3e530a[_0x7c32('0x36')]);_0x258ace['attributes']=_[_0x7c32('0x38')](_0x3e530a[_0x7c32('0x35')],qs['fields'](_0x335007[_0x7c32('0x36')]['fields']));_0x258ace[_0x7c32('0x39')]=_0x258ace[_0x7c32('0x39')][_0x7c32('0x3a')]?_0x258ace[_0x7c32('0x39')]:_0x3e530a[_0x7c32('0x35')];if(!_0x335007[_0x7c32('0x36')][_0x7c32('0x3b')](_0x7c32('0x3c'))){_0x258ace['limit']=qs[_0x7c32('0x20')](_0x335007[_0x7c32('0x36')][_0x7c32('0x20')]);_0x258ace[_0x7c32('0x1d')]=qs[_0x7c32('0x1d')](_0x335007['query']['offset']);}_0x258ace['order']=qs[_0x7c32('0x3d')](_0x335007['query']['sort']);_0x258ace['where']=qs[_0x7c32('0x37')](_[_0x7c32('0x3e')](_0x335007[_0x7c32('0x36')],_0x3e530a['filters']),_0x5652f8);if(_0x335007[_0x7c32('0x36')]['filter']){_0x258ace[_0x7c32('0x3f')]=_[_0x7c32('0x40')](_0x258ace[_0x7c32('0x3f')],{'$or':_[_0x7c32('0x30')](_0x5652f8,function(_0x55baf2){if(_0x55baf2[_0x7c32('0x33')]!==_0x7c32('0x41')){var _0x7799a3={};_0x7799a3[_0x55baf2[_0x7c32('0x2d')]]={'$like':'%'+_0x335007[_0x7c32('0x36')][_0x7c32('0x42')]+'%'};return _0x7799a3;}})});}_0x258ace=_[_0x7c32('0x40')]({},_0x258ace,_0x335007['options']);var _0x1eaea4={'where':_0x258ace[_0x7c32('0x3f')]};return db[_0x7c32('0x31')]['count'](_0x1eaea4)['then'](function(_0xc785e8){_0x52a7b2[_0x7c32('0x1f')]=_0xc785e8;if(_0x335007[_0x7c32('0x36')][_0x7c32('0x43')]){_0x258ace['include']=[{'all':!![]}];}return db['CmList'][_0x7c32('0x44')](_0x258ace);})[_0x7c32('0x28')](function(_0x427059){_0x52a7b2[_0x7c32('0x45')]=_0x427059;return _0x52a7b2;})['then'](respondWithFilteredResult(_0x5350cc,_0x258ace))[_0x7c32('0x46')](handleError(_0x5350cc,null));};exports[_0x7c32('0x47')]=function(_0x3ac823,_0x2eb9b8){var _0x502a57={'raw':![],'where':{'id':_0x3ac823[_0x7c32('0x48')]['id']}},_0x2338dd={};_0x2338dd[_0x7c32('0x35')]=_[_0x7c32('0x49')](db[_0x7c32('0x31')][_0x7c32('0x4a')]);_0x2338dd[_0x7c32('0x36')]=_[_0x7c32('0x49')](_0x3ac823[_0x7c32('0x36')]);_0x2338dd[_0x7c32('0x37')]=_[_0x7c32('0x38')](_0x2338dd['model'],_0x2338dd[_0x7c32('0x36')]);_0x502a57[_0x7c32('0x39')]=_['intersection'](_0x2338dd[_0x7c32('0x35')],qs[_0x7c32('0x4b')](_0x3ac823[_0x7c32('0x36')][_0x7c32('0x4b')]));_0x502a57[_0x7c32('0x39')]=_0x502a57['attributes']['length']?_0x502a57[_0x7c32('0x39')]:_0x2338dd['model'];if(_0x3ac823[_0x7c32('0x36')][_0x7c32('0x43')]){_0x502a57[_0x7c32('0x4c')]=[{'all':!![]}];}_0x502a57=_[_0x7c32('0x40')]({},_0x502a57,_0x3ac823[_0x7c32('0x4d')]);return db['CmList']['find'](_0x502a57)[_0x7c32('0x28')](handleEntityNotFound(_0x2eb9b8,null))[_0x7c32('0x28')](respondWithResult(_0x2eb9b8,null))[_0x7c32('0x46')](handleError(_0x2eb9b8,null));};exports[_0x7c32('0x4e')]=function(_0x145929,_0x520588){return db[_0x7c32('0x31')]['create'](_0x145929['body'],{})[_0x7c32('0x28')](function(_0x194871){var _0x24409f=_0x145929['user'][_0x7c32('0x29')]({'plain':!![]});if(!_0x24409f)throw new Error(_0x7c32('0x4f'));if(_0x24409f[_0x7c32('0x50')]===_0x7c32('0x51')){var _0x67ea2c=_0x194871[_0x7c32('0x29')]({'plain':!![]});var _0x56c55f=_0x7c32('0x2a');return db[_0x7c32('0x52')][_0x7c32('0x53')]({'where':{'name':_0x56c55f,'userProfileId':_0x24409f[_0x7c32('0x54')]},'raw':!![]})[_0x7c32('0x28')](function(_0x335c1f){if(_0x335c1f&&_0x335c1f[_0x7c32('0x55')]===0x0){return db[_0x7c32('0x2b')][_0x7c32('0x4e')]({'name':_0x67ea2c['name'],'resourceId':_0x67ea2c['id'],'type':_0x335c1f[_0x7c32('0x2d')],'sectionId':_0x335c1f['id']},{})[_0x7c32('0x28')](function(){return _0x194871;});}else{return _0x194871;}})[_0x7c32('0x46')](function(_0x261a08){logger[_0x7c32('0x56')](_0x7c32('0x57'),_0x261a08);throw _0x261a08;});}return _0x194871;})['then'](respondWithResult(_0x520588,0xc9))['catch'](handleError(_0x520588,null));};exports[_0x7c32('0x27')]=function(_0x17da97,_0x553f09){if(_0x17da97['body']['id']){delete _0x17da97[_0x7c32('0x58')]['id'];}return db[_0x7c32('0x31')][_0x7c32('0x53')]({'where':{'id':_0x17da97[_0x7c32('0x48')]['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x553f09,null))[_0x7c32('0x28')](saveUpdates(_0x17da97[_0x7c32('0x58')],null))[_0x7c32('0x28')](respondWithResult(_0x553f09,null))[_0x7c32('0x46')](handleError(_0x553f09,null));};exports[_0x7c32('0x59')]=function(_0x1b7dc3,_0x12213a){return db[_0x7c32('0x31')]['find']({'where':{'id':_0x1b7dc3['params']['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x12213a,null))[_0x7c32('0x28')](removeEntity(_0x12213a,null))[_0x7c32('0x46')](handleError(_0x12213a,null));};exports[_0x7c32('0x5a')]=function(_0x385c57,_0xfd6fb3){return db[_0x7c32('0x31')][_0x7c32('0x5a')]()[_0x7c32('0x28')](respondWithResult(_0xfd6fb3,null))['catch'](handleError(_0xfd6fb3,null));};exports[_0x7c32('0x5b')]=function(_0x57a8f6,_0x572711,_0x577c2a){if(_0x57a8f6['body']['id']){delete _0x57a8f6[_0x7c32('0x58')]['id'];}return db[_0x7c32('0x31')][_0x7c32('0x53')]({'where':{'id':_0x57a8f6[_0x7c32('0x48')]['id']}})['then'](handleEntityNotFound(_0x572711,null))[_0x7c32('0x28')](function(_0x17c048){if(_0x17c048){_0x57a8f6[_0x7c32('0x58')][_0x7c32('0x5c')]=_0x17c048['id'];return db[_0x7c32('0x5d')]['create'](_0x57a8f6['body']);}})[_0x7c32('0x28')](respondWithResult(_0x572711,null))[_0x7c32('0x46')](handleError(_0x572711,null));};exports[_0x7c32('0x5e')]=function(_0x3fcff0,_0x302f9c,_0x483a9e){var _0x1b5ed3={'raw':![],'where':{}};var _0x835d32={};var _0x19eec8={'count':0x0,'rows':[]};return db[_0x7c32('0x31')]['findOne']({'where':{'id':_0x3fcff0[_0x7c32('0x48')]['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x302f9c,null))['then'](function(_0x271994){if(_0x271994){_0x835d32[_0x7c32('0x35')]=_[_0x7c32('0x49')](db[_0x7c32('0x5d')][_0x7c32('0x4a')]);_0x835d32[_0x7c32('0x36')]=_[_0x7c32('0x49')](_0x3fcff0[_0x7c32('0x36')]);_0x835d32[_0x7c32('0x37')]=_[_0x7c32('0x38')](_0x835d32[_0x7c32('0x35')],_0x835d32[_0x7c32('0x36')]);_0x1b5ed3[_0x7c32('0x39')]=_['intersection'](_0x835d32['model'],qs['fields'](_0x3fcff0[_0x7c32('0x36')]['fields']));_0x1b5ed3[_0x7c32('0x39')]=_0x1b5ed3[_0x7c32('0x39')]['length']?_0x1b5ed3[_0x7c32('0x39')]:_0x835d32['model'];if(!_0x3fcff0[_0x7c32('0x36')][_0x7c32('0x3b')](_0x7c32('0x3c'))){_0x1b5ed3[_0x7c32('0x20')]=qs['limit'](_0x3fcff0['query'][_0x7c32('0x20')]);_0x1b5ed3[_0x7c32('0x1d')]=qs[_0x7c32('0x1d')](_0x3fcff0[_0x7c32('0x36')]['offset']);}_0x1b5ed3[_0x7c32('0x5f')]=qs[_0x7c32('0x3d')](_0x3fcff0[_0x7c32('0x36')][_0x7c32('0x3d')]);_0x1b5ed3[_0x7c32('0x3f')]=qs[_0x7c32('0x37')](_['pick'](_0x3fcff0['query'],_0x835d32[_0x7c32('0x37')]));_0x1b5ed3['where'][_0x7c32('0x5c')]=_0x271994['id'];if(_0x3fcff0[_0x7c32('0x36')][_0x7c32('0x42')]){_0x1b5ed3['where']=_[_0x7c32('0x40')](_0x1b5ed3[_0x7c32('0x3f')],{'$or':_[_0x7c32('0x30')](_0x1b5ed3[_0x7c32('0x39')],function(_0xb4bafd){var _0x272d1b={};_0x272d1b[_0xb4bafd]={'$like':'%'+_0x3fcff0['query'][_0x7c32('0x42')]+'%'};return _0x272d1b;})});}_0x1b5ed3=_['merge']({},_0x1b5ed3,_0x3fcff0['options']);return db[_0x7c32('0x5d')][_0x7c32('0x1f')]({'where':_0x1b5ed3[_0x7c32('0x3f')]})[_0x7c32('0x28')](function(_0x115097){_0x19eec8['count']=_0x115097;if(_0x3fcff0[_0x7c32('0x36')][_0x7c32('0x43')]){_0x1b5ed3[_0x7c32('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x7c32('0x44')](_0x1b5ed3);})[_0x7c32('0x28')](function(_0x1e94cd){_0x19eec8[_0x7c32('0x45')]=_0x1e94cd;return _0x19eec8;});}})[_0x7c32('0x28')](respondWithFilteredResult(_0x302f9c,_0x1b5ed3))[_0x7c32('0x46')](handleError(_0x302f9c,null));};exports['removeDispositions']=function(_0x4a2e7f,_0x74f5b4,_0xc293ee){return db['CmList']['find']({'where':{'id':_0x4a2e7f[_0x7c32('0x48')]['id']}})['then'](handleEntityNotFound(_0x74f5b4,null))['then'](function(_0x425a8e){if(_0x425a8e){return _0x425a8e[_0x7c32('0x60')](_0x4a2e7f[_0x7c32('0x36')][_0x7c32('0x61')]);}})[_0x7c32('0x28')](respondWithStatusCode(_0x74f5b4,null))[_0x7c32('0x46')](handleError(_0x74f5b4,null));};exports[_0x7c32('0x62')]=function(_0x337a1c,_0xab3ae8,_0x4a0a63){return db[_0x7c32('0x31')][_0x7c32('0x53')]({'where':{'id':_0x337a1c[_0x7c32('0x48')]['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0xab3ae8,null))[_0x7c32('0x28')](function(_0x1dfd21){if(_0x1dfd21){var _0x2e10df=[];var _0x166f55={'success':[],'errors':[]};return db[_0x7c32('0x63')][_0x7c32('0x5a')]()[_0x7c32('0x28')](function(_0x3ef940){if(_0x337a1c[_0x7c32('0x58')][_0x7c32('0x64')]&&_[_0x7c32('0x65')](_0x337a1c[_0x7c32('0x58')]['tags'])){if(_0x337a1c[_0x7c32('0x58')]['tags'][_0x7c32('0x3a')]){_0x337a1c['body'][_0x7c32('0x64')]=_0x337a1c['body'][_0x7c32('0x64')]['join'](';')+';';}else{_0x337a1c['body'][_0x7c32('0x64')]=null;}}else{_0x337a1c[_0x7c32('0x58')][_0x7c32('0x64')]=null;}if(_0x337a1c[_0x7c32('0x58')]&&_[_0x7c32('0x65')](_0x337a1c[_0x7c32('0x58')])){for(var _0xbbd7ea=0x0;_0xbbd7ea<_0x337a1c['body']['length'];_0xbbd7ea+=0x1){_0x337a1c[_0x7c32('0x58')][_0xbbd7ea][_0x7c32('0x5c')]=_0x337a1c[_0x7c32('0x48')]['id'];_0x2e10df['push'](_0x337a1c[_0x7c32('0x58')][_0xbbd7ea]);}return BPromise[_0x7c32('0x66')](_0x2e10df,function(_0x219d94){return db[_0x7c32('0x63')][_0x7c32('0x4e')](_[_0x7c32('0x67')](_0x219d94,[_0x7c32('0x61'),'id'])||{},{'fields':_[_0x7c32('0x49')](_0x3ef940),'raw':!![]})[_0x7c32('0x28')](function(_0x2af2f0){_0x166f55[_0x7c32('0x68')]['push'](_0x2af2f0[_0x7c32('0x69')]);})[_0x7c32('0x46')](function(_0x51cfa5){_0x166f55['errors'][_0x7c32('0x6a')]({'data':_0x219d94,'error':_0x51cfa5[_0x7c32('0x6b')]});});})[_0x7c32('0x28')](function(_0xc98bbe){return _0x166f55;})['catch'](function(_0xda4d5c){return _0xda4d5c;});}else{_0xab3ae8[_0x7c32('0x1b')](0x190)[_0x7c32('0x23')]({'message':_0x7c32('0x6c')});}});}})[_0x7c32('0x28')](respondWithResult(_0xab3ae8,null))[_0x7c32('0x46')](handleError(_0xab3ae8,null));};exports[_0x7c32('0x6d')]=function(_0x3c8bae,_0x2871f9,_0x326ccc){var _0x5d90dd;return db[_0x7c32('0x31')][_0x7c32('0x53')]({'where':{'id':_0x3c8bae[_0x7c32('0x48')]['id']},'include':[{'model':db[_0x7c32('0x6e')],'as':_0x7c32('0x6f')}]})[_0x7c32('0x28')](handleEntityNotFound(_0x2871f9,null))[_0x7c32('0x28')](function(_0x56b320){if(_0x56b320){_0x5d90dd=_0x56b320;return db[_0x7c32('0x63')][_0x7c32('0x4a')];}})['then'](function(_0x2a0a06){if(_0x2a0a06){var _0x44a143={};var _0x794e91={};_0x794e91[_0x7c32('0x35')]=_['concat'](_[_0x7c32('0x49')](_0x2a0a06),_[_0x7c32('0x30')](_0x5d90dd[_0x7c32('0x6f')],function(_0x5b1f60){return util['format']('cf_%d',_0x5b1f60['id']);}));_0x794e91[_0x7c32('0x36')]=_[_0x7c32('0x49')](_0x3c8bae[_0x7c32('0x36')]);_0x794e91[_0x7c32('0x37')]=_['intersection'](_0x794e91[_0x7c32('0x35')],_0x794e91[_0x7c32('0x36')]);_0x44a143[_0x7c32('0x39')]=_[_0x7c32('0x38')](_0x794e91['model'],qs[_0x7c32('0x4b')](_0x3c8bae['query'][_0x7c32('0x4b')]));_0x44a143['attributes']=_0x44a143[_0x7c32('0x39')][_0x7c32('0x3a')]?_0x44a143[_0x7c32('0x39')]:_0x794e91[_0x7c32('0x35')];if(!_0x3c8bae[_0x7c32('0x36')][_0x7c32('0x3b')](_0x7c32('0x3c'))){_0x44a143[_0x7c32('0x20')]=qs['limit'](_0x3c8bae[_0x7c32('0x36')][_0x7c32('0x20')]);_0x44a143[_0x7c32('0x1d')]=qs[_0x7c32('0x1d')](_0x3c8bae['query'][_0x7c32('0x1d')]);}_0x44a143[_0x7c32('0x5f')]=qs[_0x7c32('0x3d')](_0x3c8bae['query'][_0x7c32('0x3d')]);_0x44a143[_0x7c32('0x3f')]=qs[_0x7c32('0x37')](_[_0x7c32('0x3e')](_0x3c8bae['query'],_0x794e91['filters']));_0x44a143['raw']=!![];if(_0x3c8bae[_0x7c32('0x36')][_0x7c32('0x42')]){_0x44a143[_0x7c32('0x3f')]=_[_0x7c32('0x40')](_0x44a143[_0x7c32('0x3f')],{'$or':_['map'](_0x44a143['attributes'],function(_0x3ea8d3){var _0x393e5b={};_0x393e5b[_0x3ea8d3]={'$like':'%'+_0x3c8bae[_0x7c32('0x36')][_0x7c32('0x42')]+'%'};return _0x393e5b;})});}_0x44a143=_[_0x7c32('0x40')]({},_0x44a143,_0x3c8bae[_0x7c32('0x4d')]);return _0x5d90dd[_0x7c32('0x6d')](_0x44a143);}})[_0x7c32('0x28')](respondWithResult(_0x2871f9,null))['catch'](handleError(_0x2871f9,null));};exports['getContactsCsv']=function(_0x1da29e,_0x17f229,_0x1a5b8f){var _0x1394dd;var _0x6b32ee;var _0xd1eccd;var _0x2ac07b=_0x1da29e[_0x7c32('0x48')]['id'];csv_results=[];return db[_0x7c32('0x70')]['findAll']({'attributes':['id','name'],'raw':!![],'order':[_0x7c32('0x71')]})[_0x7c32('0x28')](function(_0x4355d0){_0x1394dd=_0x4355d0;var _0x3baf7a=_['keys'](db[_0x7c32('0x63')][_0x7c32('0x4a')]);return db[_0x7c32('0x6e')]['findAll']({'raw':!![],'attributes':['id',_0x7c32('0x72')]})[_0x7c32('0x28')](function(_0x4118de){_0x6b32ee=_0x4118de;var _0x52f5f1=squel[_0x7c32('0x73')]()[_0x7c32('0x4b')](_0x3baf7a)[_0x7c32('0x74')](_0x7c32('0x75'),'c')['where'](_0x7c32('0x76'),_0x2ac07b)[_0x7c32('0x3f')](_0x7c32('0x77'))[_0x7c32('0x78')]();for(var _0x37d55a=0x0;_0x37d55a<_0x6b32ee['length'];_0x37d55a++){_0x52f5f1[_0x7c32('0x79')](_0x7c32('0x7a')+_0x6b32ee[_0x37d55a]['id'],_0x7c32('0x7b')+_0x6b32ee[_0x37d55a][_0x7c32('0x72')]);}for(var _0x37d55a=0x0;_0x37d55a<_0x1394dd[_0x7c32('0x3a')];_0x37d55a++){_0x52f5f1[_0x7c32('0x79')](squel[_0x7c32('0x73')]()['field'](_0x7c32('0x7c'))[_0x7c32('0x74')](_0x7c32('0x7d'))[_0x7c32('0x3f')](_0x7c32('0x7e'),_0x1394dd[_0x37d55a]['id'])['where'](_0x7c32('0x7f')),_0x7c32('0x80')+_0x1394dd[_0x37d55a][_0x7c32('0x2d')]);_0x52f5f1['field'](squel['select']()[_0x7c32('0x79')](_0x7c32('0x81'))[_0x7c32('0x74')]('cm_contact_has_items')[_0x7c32('0x3f')](_0x7c32('0x7e'),_0x1394dd[_0x37d55a]['id'])[_0x7c32('0x3f')](_0x7c32('0x7f')),'description_additionalPhone_'+_0x1394dd[_0x37d55a][_0x7c32('0x2d')]);}var _0x4c57b2=[];_0x4c57b2[_0x7c32('0x6a')](_0x52f5f1[_0x7c32('0x82')]());BPromise[_0x7c32('0x66')](_0x4c57b2,handleQuery)['then'](function(_0x135770){handleQuery(_0x52f5f1[_0x7c32('0x82')]());var _0x4980f3=csv_results[0x0];if(!_[_0x7c32('0x83')](_0x4980f3)){var _0x8891fe=toCsv(_0x4980f3);var _0x3c106b=Date[_0x7c32('0x84')]();fs[_0x7c32('0x85')](util[_0x7c32('0x86')](_0x7c32('0x87'),_0x2ac07b,_0x3c106b),_0x8891fe);_0x17f229[_0x7c32('0x88')](_0x7c32('0x89'),_0x7c32('0x8a')+util[_0x7c32('0x86')](_0x7c32('0x8b'),_0x2ac07b,_0x3c106b));_0x17f229[_0x7c32('0x88')]('Content-type',_0x7c32('0x8c'));return _0x17f229[_0x7c32('0x8d')](util[_0x7c32('0x86')](_0x7c32('0x87'),_0x2ac07b,_0x3c106b));}else{return _0x17f229[_0x7c32('0x1a')](0xcc);}});});});};exports[_0x7c32('0x8e')]=function(_0x21de30,_0x4d21e7,_0x35addf){var _0xcad400;delete _0x21de30['body']['id'];return db[_0x7c32('0x31')][_0x7c32('0x8f')]({'where':{'id':_0x21de30[_0x7c32('0x48')]['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x4d21e7,null))[_0x7c32('0x28')](function(_0x2a954d){if(_0x2a954d){return db['sequelize']['transaction'](function(_0x3a765c){return db[_0x7c32('0x6e')][_0x7c32('0x4e')](_0x21de30[_0x7c32('0x58')],{'transaction':_0x3a765c})['then'](function(_0xf2301e){_0xcad400=_0xf2301e;return _0x2a954d[_0x7c32('0x90')](_0xf2301e,{'transaction':_0x3a765c});})[_0x7c32('0x28')](function(){var _0x43e4fc={'type':db[_0x7c32('0x91')]['TEXT'],'transaction':_0x3a765c};switch(_0x21de30[_0x7c32('0x58')][_0x7c32('0x33')]){case _0x7c32('0x92'):_0x43e4fc[_0x7c32('0x33')]=db['Sequelize'][_0x7c32('0x93')];break;case _0x7c32('0x94'):_0x43e4fc[_0x7c32('0x33')]=db[_0x7c32('0x91')][_0x7c32('0x95')];break;case _0x7c32('0x96'):_0x43e4fc[_0x7c32('0x33')]=db[_0x7c32('0x91')][_0x7c32('0x97')];_0x43e4fc[_0x7c32('0x98')]=![];break;default:}return db[_0x7c32('0x99')][_0x7c32('0x9a')][_0x7c32('0x9b')](_0x7c32('0x75'),util[_0x7c32('0x86')]('cf_%s',_0xcad400['id']),_0x43e4fc);})[_0x7c32('0x28')](function(){return _0xcad400;});});}})[_0x7c32('0x28')](respondWithResult(_0x4d21e7,null))[_0x7c32('0x46')](handleError(_0x4d21e7,null));};exports[_0x7c32('0x9c')]=function(_0x486e76,_0x48309d,_0x1783ec){var _0x26f246={};var _0x33b188={};var _0x35ac70;var _0x1796c9;return db[_0x7c32('0x31')][_0x7c32('0x8f')]({'where':{'id':_0x486e76['params']['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x48309d,null))[_0x7c32('0x28')](function(_0x2fdb2d){if(_0x2fdb2d){_0x35ac70=_0x2fdb2d;_0x33b188[_0x7c32('0x35')]=_[_0x7c32('0x49')](db['CmCustomField'][_0x7c32('0x4a')]);_0x33b188[_0x7c32('0x36')]=_[_0x7c32('0x49')](_0x486e76['query']);_0x33b188[_0x7c32('0x37')]=_['intersection'](_0x33b188[_0x7c32('0x35')],_0x33b188[_0x7c32('0x36')]);_0x26f246[_0x7c32('0x39')]=_[_0x7c32('0x38')](_0x33b188[_0x7c32('0x35')],qs[_0x7c32('0x4b')](_0x486e76['query'][_0x7c32('0x4b')]));_0x26f246['attributes']=_0x26f246[_0x7c32('0x39')][_0x7c32('0x3a')]?_0x26f246[_0x7c32('0x39')]:_0x33b188[_0x7c32('0x35')];_0x26f246[_0x7c32('0x5f')]=qs[_0x7c32('0x3d')](_0x486e76[_0x7c32('0x36')][_0x7c32('0x3d')]);_0x26f246['where']=qs['filters'](_[_0x7c32('0x3e')](_0x486e76[_0x7c32('0x36')],_0x33b188[_0x7c32('0x37')]));_0x26f246[_0x7c32('0x3f')]=_[_0x7c32('0x40')](_0x26f246[_0x7c32('0x3f')],{'$or':[{'ListId':_0x2fdb2d['id']},{'ListId':null}]});if(_0x486e76[_0x7c32('0x36')][_0x7c32('0x42')]){_0x26f246[_0x7c32('0x3f')]=_[_0x7c32('0x40')](_0x26f246[_0x7c32('0x3f')],{'$or':_[_0x7c32('0x30')](_0x26f246[_0x7c32('0x39')],function(_0x5a0aa6){var _0x5cd953={};_0x5cd953[_0x5a0aa6]={'$like':'%'+_0x486e76[_0x7c32('0x36')][_0x7c32('0x42')]+'%'};return _0x5cd953;})});}_0x26f246=_['merge']({},_0x26f246,_0x486e76[_0x7c32('0x4d')]);return db[_0x7c32('0x6e')]['findAndCountAll'](_0x26f246);}})[_0x7c32('0x28')](respondWithResult(_0x48309d,null))[_0x7c32('0x46')](handleError(_0x48309d,null));};exports[_0x7c32('0x9d')]=function(_0x3efb8a,_0x4581a3){return db[_0x7c32('0x6e')][_0x7c32('0x9e')]({'where':{'ListId':null}})[_0x7c32('0x28')](handleEntityNotFound(_0x4581a3,null))[_0x7c32('0x28')](function(_0x4f6d9e){return _0x4f6d9e;})[_0x7c32('0x28')](respondWithResult(_0x4581a3,null))['catch'](handleError(_0x4581a3,null));};exports[_0x7c32('0x9f')]=function(_0x5149a5,_0x16ab6f,_0x5ef535){return db[_0x7c32('0x31')][_0x7c32('0x53')]({'where':{'id':_0x5149a5[_0x7c32('0x48')]['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x16ab6f,null))[_0x7c32('0x28')](function(_0x5789ec){if(_0x5789ec){return _0x5789ec[_0x7c32('0x9f')](_0x5149a5['body']['ids'],_['omit'](_0x5149a5[_0x7c32('0x58')],[_0x7c32('0x61'),'id'])||{})[_0x7c32('0xa0')](function(_0x1682d5){for(var _0x4a6d69=0x0;_0x4a6d69<_0x5149a5[_0x7c32('0x58')][_0x7c32('0x61')][_0x7c32('0x3a')];_0x4a6d69+=0x1){socket[_0x7c32('0xa1')](_0x7c32('0xa2'),{'UserId':Number(_0x5149a5[_0x7c32('0x58')][_0x7c32('0x61')][_0x4a6d69]),'CmListId':Number(_0x5149a5[_0x7c32('0x48')]['id'])});}return _0x1682d5;});}})[_0x7c32('0x28')](respondWithResult(_0x16ab6f,null))[_0x7c32('0x46')](handleError(_0x16ab6f,null));};exports[_0x7c32('0xa3')]=function(_0x35eedd,_0x563dd3,_0x2a3949){return db[_0x7c32('0x31')][_0x7c32('0x53')]({'where':{'id':_0x35eedd['params']['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x563dd3,null))['then'](function(_0xbdf8d6){if(_0xbdf8d6){return _0xbdf8d6['removeAgents'](_0x35eedd[_0x7c32('0x36')]['ids'])[_0x7c32('0x28')](function(){if(_[_0x7c32('0x65')](_0x35eedd[_0x7c32('0x36')][_0x7c32('0x61')])){for(var _0x3a28c8=0x0;_0x3a28c8<_0x35eedd[_0x7c32('0x36')][_0x7c32('0x61')][_0x7c32('0x3a')];_0x3a28c8+=0x1){socket[_0x7c32('0xa1')](_0x7c32('0xa4'),{'UserId':Number(_0x35eedd['query']['ids'][_0x3a28c8]),'CmListId':Number(_0x35eedd[_0x7c32('0x48')]['id'])});}}else{socket[_0x7c32('0xa1')]('userCmList:remove',{'UserId':Number(_0x35eedd[_0x7c32('0x36')][_0x7c32('0x61')]),'CmListId':Number(_0x35eedd['params']['id'])});}});}})[_0x7c32('0x28')](respondWithStatusCode(_0x563dd3,null))['catch'](handleError(_0x563dd3,null));};exports[_0x7c32('0xa5')]=function(_0x37baa3,_0x1b918,_0x4630f1){var _0x298cc5={};var _0x544c9b={};var _0x952baa;var _0x42c059;return db[_0x7c32('0x31')][_0x7c32('0x8f')]({'where':{'id':_0x37baa3[_0x7c32('0x48')]['id']}})[_0x7c32('0x28')](handleEntityNotFound(_0x1b918,null))[_0x7c32('0x28')](function(_0x3c0c61){if(_0x3c0c61){_0x952baa=_0x3c0c61;_0x544c9b[_0x7c32('0x35')]=_[_0x7c32('0x49')](db[_0x7c32('0xa6')][_0x7c32('0x4a')]);_0x544c9b[_0x7c32('0x36')]=_[_0x7c32('0x49')](_0x37baa3[_0x7c32('0x36')]);_0x544c9b[_0x7c32('0x37')]=_[_0x7c32('0x38')](_0x544c9b[_0x7c32('0x35')],_0x544c9b[_0x7c32('0x36')]);_0x298cc5['attributes']=_[_0x7c32('0x38')](_0x544c9b['model'],qs[_0x7c32('0x4b')](_0x37baa3[_0x7c32('0x36')]['fields']));_0x298cc5[_0x7c32('0x39')]=_0x298cc5[_0x7c32('0x39')][_0x7c32('0x3a')]?_0x298cc5['attributes']:_0x544c9b[_0x7c32('0x35')];_0x298cc5[_0x7c32('0x5f')]=qs[_0x7c32('0x3d')](_0x37baa3[_0x7c32('0x36')][_0x7c32('0x3d')]);_0x298cc5[_0x7c32('0x3f')]=qs[_0x7c32('0x37')](_['pick'](_0x37baa3['query'],_0x544c9b[_0x7c32('0x37')]));if(_0x37baa3['query']['filter']){_0x298cc5[_0x7c32('0x3f')]=_[_0x7c32('0x40')](_0x298cc5[_0x7c32('0x3f')],{'$or':_[_0x7c32('0x30')](_0x298cc5[_0x7c32('0x39')],function(_0x5adeb4){var _0x3d09f7={};_0x3d09f7[_0x5adeb4]={'$like':'%'+_0x37baa3[_0x7c32('0x36')][_0x7c32('0x42')]+'%'};return _0x3d09f7;})});}_0x298cc5=_[_0x7c32('0x40')]({},_0x298cc5,_0x37baa3[_0x7c32('0x4d')]);return _0x952baa[_0x7c32('0xa5')](_0x298cc5);}})['then'](function(_0x4e1c37){if(_0x4e1c37){_0x42c059=_0x4e1c37[_0x7c32('0x3a')];if(!_0x37baa3['query'][_0x7c32('0x3b')](_0x7c32('0x3c'))){_0x298cc5[_0x7c32('0x20')]=qs['limit'](_0x37baa3[_0x7c32('0x36')][_0x7c32('0x20')]);_0x298cc5[_0x7c32('0x1d')]=qs[_0x7c32('0x1d')](_0x37baa3['query']['offset']);}return _0x952baa['getAgents'](_0x298cc5);}})[_0x7c32('0x28')](function(_0x5853d5){if(_0x5853d5){return _0x5853d5?{'count':_0x42c059,'rows':_0x5853d5}:null;}})[_0x7c32('0x28')](respondWithResult(_0x1b918,null))[_0x7c32('0x46')](handleError(_0x1b918,null));};function handleQuery(_0x16ea3e){logger[_0x7c32('0xa7')](_0x16ea3e);return db[_0x7c32('0x99')][_0x7c32('0x36')](_0x16ea3e)[_0x7c32('0xa0')](function(_0x230bf1){csv_results[_0x7c32('0x6a')](_0x230bf1);})['catch'](function(_0x3a6ed0){logger[_0x7c32('0x56')](_0x3a6ed0[_0x7c32('0x6b')]);});} \ No newline at end of file +var _0xf3f3=['queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','index','map','CmList','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','rawAttributes','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','omit','success','message','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','defaultValue'];(function(_0x22ae60,_0x383dbf){var _0x5bba4d=function(_0x35788b){while(--_0x35788b){_0x22ae60['push'](_0x22ae60['shift']());}};_0x5bba4d(++_0x383dbf);}(_0xf3f3,0xae));var _0x3f3f=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xf3f3[_0x4bd06e];return _0x85ebb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f3f('0x0'));var zipdir=require(_0x3f3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f3f('0x2'));var moment=require('moment');var BPromise=require(_0x3f3f('0x3'));var Mustache=require(_0x3f3f('0x4'));var util=require('util');var path=require(_0x3f3f('0x5'));var sox=require('sox');var csv=require(_0x3f3f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f3f('0x7'));var _=require(_0x3f3f('0x8'));var squel=require(_0x3f3f('0x9'));var crypto=require('crypto');var jsforce=require(_0x3f3f('0xa'));var deskjs=require(_0x3f3f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3f3f('0xc'));var Papa=require(_0x3f3f('0xd'));var Redis=require(_0x3f3f('0xe'));var authService=require(_0x3f3f('0xf'));var qs=require(_0x3f3f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f3f('0x11'))(_0x3f3f('0x12'));var utils=require(_0x3f3f('0x13'));var config=require(_0x3f3f('0x14'));var licenseUtil=require(_0x3f3f('0x15'));var db=require(_0x3f3f('0x16'))['db'];var csv_results;config[_0x3f3f('0x17')]=_[_0x3f3f('0x18')](config['redis'],{'host':_0x3f3f('0x19'),'port':0x18eb});var socket=require(_0x3f3f('0x1a'))(new Redis(config['redis']));require(_0x3f3f('0x1b'))[_0x3f3f('0x1c')](socket);function respondWithStatusCode(_0x1bb94f,_0x492b37){_0x492b37=_0x492b37||0xcc;return function(_0xcb898c){if(_0xcb898c){return _0x1bb94f['sendStatus'](_0x492b37);}return _0x1bb94f['status'](_0x492b37)['end']();};}function respondWithResult(_0x3721d7,_0x350e7e){_0x350e7e=_0x350e7e||0xc8;return function(_0x4f2d1b){if(_0x4f2d1b){return _0x3721d7[_0x3f3f('0x1d')](_0x350e7e)[_0x3f3f('0x1e')](_0x4f2d1b);}};}function respondWithFilteredResult(_0x2b0264,_0x4fb977){return function(_0x44cf72){if(_0x44cf72){var _0x404508=typeof _0x4fb977[_0x3f3f('0x1f')]==='undefined'&&typeof _0x4fb977[_0x3f3f('0x20')]==='undefined';var _0x2af268=_0x44cf72[_0x3f3f('0x21')];var _0x1b698e=_0x404508?0x0:_0x4fb977['offset'];var _0x8749a0=_0x404508?_0x44cf72[_0x3f3f('0x21')]:_0x4fb977['offset']+_0x4fb977[_0x3f3f('0x20')];var _0x5e2fb2;if(_0x8749a0>=_0x2af268){_0x8749a0=_0x2af268;_0x5e2fb2=0xc8;}else{_0x5e2fb2=0xce;}_0x2b0264[_0x3f3f('0x1d')](_0x5e2fb2);return _0x2b0264[_0x3f3f('0x22')](_0x3f3f('0x23'),_0x1b698e+'-'+_0x8749a0+'/'+_0x2af268)['json'](_0x44cf72);}return null;};}function patchUpdates(_0x1070ec){return function(_0x33b7ca){try{jsonpatch['apply'](_0x33b7ca,_0x1070ec,!![]);}catch(_0x51221e){return BPromise[_0x3f3f('0x24')](_0x51221e);}return _0x33b7ca[_0x3f3f('0x25')]();};}function saveUpdates(_0x2e6006,_0x4d18f7){return function(_0xe9f52f){if(_0xe9f52f){return _0xe9f52f[_0x3f3f('0x26')](_0x2e6006)[_0x3f3f('0x27')](function(_0x1f06b7){return _0x1f06b7;});}return null;};}function removeEntity(_0x3caf4f,_0x4c35f3){return function(_0x34cd96){if(_0x34cd96){return _0x34cd96[_0x3f3f('0x28')]()[_0x3f3f('0x27')](function(){var _0xeee8c1=_0x34cd96[_0x3f3f('0x29')]({'plain':!![]});var _0x229981='Lists';return db[_0x3f3f('0x2a')]['destroy']({'where':{'type':_0x229981,'resourceId':_0xeee8c1['id']}})[_0x3f3f('0x27')](function(){return _0x34cd96;});})['then'](function(){_0x3caf4f[_0x3f3f('0x1d')](0xcc)[_0x3f3f('0x2b')]();});}};}function handleEntityNotFound(_0x26b23b,_0x1c0ca2){return function(_0x4299ab){if(!_0x4299ab){_0x26b23b['sendStatus'](0x194);}return _0x4299ab;};}function handleError(_0x3485b1,_0x1bf18b){_0x1bf18b=_0x1bf18b||0x1f4;return function(_0x1b004e){logger[_0x3f3f('0x2c')](_0x1b004e['stack']);if(_0x1b004e[_0x3f3f('0x2d')]){delete _0x1b004e[_0x3f3f('0x2d')];}_0x3485b1[_0x3f3f('0x1d')](_0x1bf18b)['send'](_0x1b004e);};}exports[_0x3f3f('0x2e')]=function(_0x71a485,_0x46e23e){var _0x41d034={},_0x31a7b7={},_0x3a425f={'count':0x0,'rows':[]};var _0x52fc3c=_[_0x3f3f('0x2f')](db[_0x3f3f('0x30')]['rawAttributes'],function(_0x35eb8d){return{'name':_0x35eb8d[_0x3f3f('0x31')],'type':_0x35eb8d[_0x3f3f('0x32')][_0x3f3f('0x33')]};});_0x31a7b7[_0x3f3f('0x34')]=_['map'](_0x52fc3c,_0x3f3f('0x2d'));_0x31a7b7[_0x3f3f('0x35')]=_[_0x3f3f('0x36')](_0x71a485[_0x3f3f('0x35')]);_0x31a7b7[_0x3f3f('0x37')]=_[_0x3f3f('0x38')](_0x31a7b7[_0x3f3f('0x34')],_0x31a7b7[_0x3f3f('0x35')]);_0x41d034[_0x3f3f('0x39')]=_[_0x3f3f('0x38')](_0x31a7b7[_0x3f3f('0x34')],qs['fields'](_0x71a485[_0x3f3f('0x35')]['fields']));_0x41d034[_0x3f3f('0x39')]=_0x41d034[_0x3f3f('0x39')][_0x3f3f('0x3a')]?_0x41d034[_0x3f3f('0x39')]:_0x31a7b7[_0x3f3f('0x34')];if(!_0x71a485['query'][_0x3f3f('0x3b')](_0x3f3f('0x3c'))){_0x41d034['limit']=qs['limit'](_0x71a485[_0x3f3f('0x35')]['limit']);_0x41d034[_0x3f3f('0x1f')]=qs[_0x3f3f('0x1f')](_0x71a485[_0x3f3f('0x35')][_0x3f3f('0x1f')]);}_0x41d034[_0x3f3f('0x3d')]=qs[_0x3f3f('0x3e')](_0x71a485['query'][_0x3f3f('0x3e')]);_0x41d034['where']=qs[_0x3f3f('0x37')](_[_0x3f3f('0x3f')](_0x71a485['query'],_0x31a7b7[_0x3f3f('0x37')]),_0x52fc3c);if(_0x71a485[_0x3f3f('0x35')][_0x3f3f('0x40')]){_0x41d034[_0x3f3f('0x41')]=_['merge'](_0x41d034['where'],{'$or':_[_0x3f3f('0x2f')](_0x52fc3c,function(_0x1e9e65){if(_0x1e9e65[_0x3f3f('0x32')]!=='VIRTUAL'){var _0x14a873={};_0x14a873[_0x1e9e65[_0x3f3f('0x2d')]]={'$like':'%'+_0x71a485['query']['filter']+'%'};return _0x14a873;}})});}_0x41d034=_[_0x3f3f('0x42')]({},_0x41d034,_0x71a485[_0x3f3f('0x43')]);var _0x95d6={'where':_0x41d034[_0x3f3f('0x41')]};return db[_0x3f3f('0x30')]['count'](_0x95d6)[_0x3f3f('0x27')](function(_0x1662d6){_0x3a425f[_0x3f3f('0x21')]=_0x1662d6;if(_0x71a485[_0x3f3f('0x35')][_0x3f3f('0x44')]){_0x41d034[_0x3f3f('0x45')]=[{'all':!![]}];}return db[_0x3f3f('0x30')]['findAll'](_0x41d034);})[_0x3f3f('0x27')](function(_0x438b66){_0x3a425f[_0x3f3f('0x46')]=_0x438b66;return _0x3a425f;})[_0x3f3f('0x27')](respondWithFilteredResult(_0x46e23e,_0x41d034))['catch'](handleError(_0x46e23e,null));};exports[_0x3f3f('0x47')]=function(_0x2a965a,_0x2c8d2c){var _0x358a28={'raw':![],'where':{'id':_0x2a965a[_0x3f3f('0x48')]['id']}},_0x4598a0={};_0x4598a0[_0x3f3f('0x34')]=_[_0x3f3f('0x36')](db['CmList'][_0x3f3f('0x49')]);_0x4598a0[_0x3f3f('0x35')]=_[_0x3f3f('0x36')](_0x2a965a[_0x3f3f('0x35')]);_0x4598a0[_0x3f3f('0x37')]=_[_0x3f3f('0x38')](_0x4598a0['model'],_0x4598a0[_0x3f3f('0x35')]);_0x358a28[_0x3f3f('0x39')]=_['intersection'](_0x4598a0[_0x3f3f('0x34')],qs[_0x3f3f('0x4a')](_0x2a965a[_0x3f3f('0x35')][_0x3f3f('0x4a')]));_0x358a28[_0x3f3f('0x39')]=_0x358a28[_0x3f3f('0x39')]['length']?_0x358a28[_0x3f3f('0x39')]:_0x4598a0[_0x3f3f('0x34')];if(_0x2a965a[_0x3f3f('0x35')]['includeAll']){_0x358a28['include']=[{'all':!![]}];}_0x358a28=_['merge']({},_0x358a28,_0x2a965a[_0x3f3f('0x43')]);return db[_0x3f3f('0x30')][_0x3f3f('0x4b')](_0x358a28)['then'](handleEntityNotFound(_0x2c8d2c,null))[_0x3f3f('0x27')](respondWithResult(_0x2c8d2c,null))[_0x3f3f('0x4c')](handleError(_0x2c8d2c,null));};exports[_0x3f3f('0x4d')]=function(_0x1e0ea3,_0x2b2948){return db[_0x3f3f('0x30')][_0x3f3f('0x4d')](_0x1e0ea3[_0x3f3f('0x4e')],{})[_0x3f3f('0x27')](function(_0x2a24b8){var _0x2af1d7=_0x1e0ea3[_0x3f3f('0x4f')]['get']({'plain':!![]});if(!_0x2af1d7)throw new Error(_0x3f3f('0x50'));if(_0x2af1d7[_0x3f3f('0x51')]===_0x3f3f('0x4f')){var _0x42bfe4=_0x2a24b8[_0x3f3f('0x29')]({'plain':!![]});var _0x455e02=_0x3f3f('0x52');return db[_0x3f3f('0x53')]['find']({'where':{'name':_0x455e02,'userProfileId':_0x2af1d7['userProfileId']},'raw':!![]})[_0x3f3f('0x27')](function(_0x24ed7b){if(_0x24ed7b&&_0x24ed7b[_0x3f3f('0x54')]===0x0){return db[_0x3f3f('0x2a')][_0x3f3f('0x4d')]({'name':_0x42bfe4[_0x3f3f('0x2d')],'resourceId':_0x42bfe4['id'],'type':_0x24ed7b['name'],'sectionId':_0x24ed7b['id']},{})[_0x3f3f('0x27')](function(){return _0x2a24b8;});}else{return _0x2a24b8;}})['catch'](function(_0x1942b7){logger[_0x3f3f('0x2c')](_0x3f3f('0x55'),_0x1942b7);throw _0x1942b7;});}return _0x2a24b8;})['then'](respondWithResult(_0x2b2948,0xc9))['catch'](handleError(_0x2b2948,null));};exports[_0x3f3f('0x26')]=function(_0x495829,_0x4fdb26){if(_0x495829['body']['id']){delete _0x495829[_0x3f3f('0x4e')]['id'];}return db[_0x3f3f('0x30')][_0x3f3f('0x4b')]({'where':{'id':_0x495829['params']['id']}})['then'](handleEntityNotFound(_0x4fdb26,null))[_0x3f3f('0x27')](saveUpdates(_0x495829[_0x3f3f('0x4e')],null))[_0x3f3f('0x27')](respondWithResult(_0x4fdb26,null))[_0x3f3f('0x4c')](handleError(_0x4fdb26,null));};exports[_0x3f3f('0x28')]=function(_0x263c69,_0x14c9b2){return db['CmList'][_0x3f3f('0x4b')]({'where':{'id':_0x263c69[_0x3f3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x14c9b2,null))[_0x3f3f('0x27')](removeEntity(_0x14c9b2,null))[_0x3f3f('0x4c')](handleError(_0x14c9b2,null));};exports[_0x3f3f('0x56')]=function(_0x485ebd,_0x251e41){return db['CmList'][_0x3f3f('0x56')]()[_0x3f3f('0x27')](respondWithResult(_0x251e41,null))[_0x3f3f('0x4c')](handleError(_0x251e41,null));};exports['addDisposition']=function(_0x388479,_0x565d3e,_0x22e419){if(_0x388479[_0x3f3f('0x4e')]['id']){delete _0x388479[_0x3f3f('0x4e')]['id'];}return db['CmList']['find']({'where':{'id':_0x388479[_0x3f3f('0x48')]['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x565d3e,null))[_0x3f3f('0x27')](function(_0x44ab06){if(_0x44ab06){_0x388479[_0x3f3f('0x4e')][_0x3f3f('0x57')]=_0x44ab06['id'];return db[_0x3f3f('0x58')][_0x3f3f('0x4d')](_0x388479[_0x3f3f('0x4e')]);}})[_0x3f3f('0x27')](respondWithResult(_0x565d3e,null))[_0x3f3f('0x4c')](handleError(_0x565d3e,null));};exports[_0x3f3f('0x59')]=function(_0x54ec7c,_0x1c4bb2,_0x136277){var _0x4bab13={'raw':![],'where':{}};var _0x208d6d={};var _0x552dbf={'count':0x0,'rows':[]};return db[_0x3f3f('0x30')][_0x3f3f('0x5a')]({'where':{'id':_0x54ec7c[_0x3f3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c4bb2,null))[_0x3f3f('0x27')](function(_0x469821){if(_0x469821){_0x208d6d[_0x3f3f('0x34')]=_['keys'](db[_0x3f3f('0x58')][_0x3f3f('0x49')]);_0x208d6d[_0x3f3f('0x35')]=_['keys'](_0x54ec7c[_0x3f3f('0x35')]);_0x208d6d[_0x3f3f('0x37')]=_[_0x3f3f('0x38')](_0x208d6d[_0x3f3f('0x34')],_0x208d6d[_0x3f3f('0x35')]);_0x4bab13[_0x3f3f('0x39')]=_['intersection'](_0x208d6d['model'],qs['fields'](_0x54ec7c[_0x3f3f('0x35')][_0x3f3f('0x4a')]));_0x4bab13[_0x3f3f('0x39')]=_0x4bab13[_0x3f3f('0x39')][_0x3f3f('0x3a')]?_0x4bab13[_0x3f3f('0x39')]:_0x208d6d[_0x3f3f('0x34')];if(!_0x54ec7c['query']['hasOwnProperty'](_0x3f3f('0x3c'))){_0x4bab13[_0x3f3f('0x20')]=qs[_0x3f3f('0x20')](_0x54ec7c[_0x3f3f('0x35')][_0x3f3f('0x20')]);_0x4bab13[_0x3f3f('0x1f')]=qs[_0x3f3f('0x1f')](_0x54ec7c[_0x3f3f('0x35')][_0x3f3f('0x1f')]);}_0x4bab13[_0x3f3f('0x3d')]=qs[_0x3f3f('0x3e')](_0x54ec7c[_0x3f3f('0x35')][_0x3f3f('0x3e')]);_0x4bab13[_0x3f3f('0x41')]=qs[_0x3f3f('0x37')](_[_0x3f3f('0x3f')](_0x54ec7c['query'],_0x208d6d[_0x3f3f('0x37')]));_0x4bab13[_0x3f3f('0x41')][_0x3f3f('0x57')]=_0x469821['id'];if(_0x54ec7c[_0x3f3f('0x35')][_0x3f3f('0x40')]){_0x4bab13[_0x3f3f('0x41')]=_['merge'](_0x4bab13['where'],{'$or':_[_0x3f3f('0x2f')](_0x4bab13[_0x3f3f('0x39')],function(_0xdf4a5b){var _0x47be43={};_0x47be43[_0xdf4a5b]={'$like':'%'+_0x54ec7c['query'][_0x3f3f('0x40')]+'%'};return _0x47be43;})});}_0x4bab13=_[_0x3f3f('0x42')]({},_0x4bab13,_0x54ec7c['options']);return db['Disposition']['count']({'where':_0x4bab13[_0x3f3f('0x41')]})[_0x3f3f('0x27')](function(_0x57c452){_0x552dbf[_0x3f3f('0x21')]=_0x57c452;if(_0x54ec7c[_0x3f3f('0x35')]['includeAll']){_0x4bab13[_0x3f3f('0x45')]=[{'all':!![]}];}return db[_0x3f3f('0x58')][_0x3f3f('0x5b')](_0x4bab13);})[_0x3f3f('0x27')](function(_0x1bbe9b){_0x552dbf['rows']=_0x1bbe9b;return _0x552dbf;});}})[_0x3f3f('0x27')](respondWithFilteredResult(_0x1c4bb2,_0x4bab13))[_0x3f3f('0x4c')](handleError(_0x1c4bb2,null));};exports[_0x3f3f('0x5c')]=function(_0x41e6a3,_0x21ed40,_0x662dbc){return db[_0x3f3f('0x30')][_0x3f3f('0x4b')]({'where':{'id':_0x41e6a3['params']['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x21ed40,null))[_0x3f3f('0x27')](function(_0x12a210){if(_0x12a210){return _0x12a210['removeDispositions'](_0x41e6a3[_0x3f3f('0x35')][_0x3f3f('0x5d')]);}})[_0x3f3f('0x27')](respondWithStatusCode(_0x21ed40,null))['catch'](handleError(_0x21ed40,null));};exports[_0x3f3f('0x5e')]=function(_0x5357f4,_0x2376ee,_0x17d1c2){return db[_0x3f3f('0x30')]['find']({'where':{'id':_0x5357f4['params']['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x2376ee,null))[_0x3f3f('0x27')](function(_0x407567){if(_0x407567){var _0x5ddee0=[];var _0x171a2b={'success':[],'errors':[]};return db[_0x3f3f('0x5f')][_0x3f3f('0x56')]()[_0x3f3f('0x27')](function(_0x4e6c7b){if(_0x5357f4[_0x3f3f('0x4e')]['tags']&&_[_0x3f3f('0x60')](_0x5357f4[_0x3f3f('0x4e')][_0x3f3f('0x61')])){if(_0x5357f4['body'][_0x3f3f('0x61')][_0x3f3f('0x3a')]){_0x5357f4[_0x3f3f('0x4e')][_0x3f3f('0x61')]=_0x5357f4['body'][_0x3f3f('0x61')]['join'](';')+';';}else{_0x5357f4['body'][_0x3f3f('0x61')]=null;}}else{_0x5357f4['body'][_0x3f3f('0x61')]=null;}if(_0x5357f4['body']&&_['isArray'](_0x5357f4[_0x3f3f('0x4e')])){for(var _0xc86cd4=0x0;_0xc86cd4<_0x5357f4[_0x3f3f('0x4e')][_0x3f3f('0x3a')];_0xc86cd4+=0x1){_0x5357f4[_0x3f3f('0x4e')][_0xc86cd4]['ListId']=_0x5357f4[_0x3f3f('0x48')]['id'];_0x5ddee0[_0x3f3f('0x62')](_0x5357f4[_0x3f3f('0x4e')][_0xc86cd4]);}return BPromise[_0x3f3f('0x63')](_0x5ddee0,function(_0x2640b5){return db[_0x3f3f('0x5f')][_0x3f3f('0x4d')](_[_0x3f3f('0x64')](_0x2640b5,[_0x3f3f('0x5d'),'id'])||{},{'fields':_[_0x3f3f('0x36')](_0x4e6c7b),'raw':!![]})[_0x3f3f('0x27')](function(_0x34e6ad){_0x171a2b[_0x3f3f('0x65')][_0x3f3f('0x62')](_0x34e6ad['dataValues']);})['catch'](function(_0x564060){_0x171a2b['errors']['push']({'data':_0x2640b5,'error':_0x564060[_0x3f3f('0x66')]});});})[_0x3f3f('0x27')](function(_0x1648e1){return _0x171a2b;})[_0x3f3f('0x4c')](function(_0x54f0df){return _0x54f0df;});}else{_0x2376ee[_0x3f3f('0x1d')](0x190)[_0x3f3f('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x3f3f('0x27')](respondWithResult(_0x2376ee,null))[_0x3f3f('0x4c')](handleError(_0x2376ee,null));};exports['getContacts']=function(_0x118ca0,_0x2a95a3,_0x3e7a9f){var _0x1594f0;return db[_0x3f3f('0x30')][_0x3f3f('0x4b')]({'where':{'id':_0x118ca0[_0x3f3f('0x48')]['id']},'include':[{'model':db[_0x3f3f('0x67')],'as':_0x3f3f('0x68')}]})[_0x3f3f('0x27')](handleEntityNotFound(_0x2a95a3,null))['then'](function(_0x4699af){if(_0x4699af){_0x1594f0=_0x4699af;return db[_0x3f3f('0x5f')][_0x3f3f('0x49')];}})[_0x3f3f('0x27')](function(_0x4600e1){if(_0x4600e1){var _0x1fb0d6={};var _0x34e723={};_0x34e723[_0x3f3f('0x34')]=_[_0x3f3f('0x69')](_[_0x3f3f('0x36')](_0x4600e1),_[_0x3f3f('0x2f')](_0x1594f0[_0x3f3f('0x68')],function(_0x27599c){return util[_0x3f3f('0x6a')](_0x3f3f('0x6b'),_0x27599c['id']);}));_0x34e723[_0x3f3f('0x35')]=_['keys'](_0x118ca0[_0x3f3f('0x35')]);_0x34e723[_0x3f3f('0x37')]=_[_0x3f3f('0x38')](_0x34e723['model'],_0x34e723[_0x3f3f('0x35')]);_0x1fb0d6[_0x3f3f('0x39')]=_[_0x3f3f('0x38')](_0x34e723[_0x3f3f('0x34')],qs[_0x3f3f('0x4a')](_0x118ca0[_0x3f3f('0x35')][_0x3f3f('0x4a')]));_0x1fb0d6[_0x3f3f('0x39')]=_0x1fb0d6[_0x3f3f('0x39')][_0x3f3f('0x3a')]?_0x1fb0d6[_0x3f3f('0x39')]:_0x34e723['model'];if(!_0x118ca0['query'][_0x3f3f('0x3b')](_0x3f3f('0x3c'))){_0x1fb0d6['limit']=qs[_0x3f3f('0x20')](_0x118ca0['query'][_0x3f3f('0x20')]);_0x1fb0d6['offset']=qs[_0x3f3f('0x1f')](_0x118ca0[_0x3f3f('0x35')][_0x3f3f('0x1f')]);}_0x1fb0d6[_0x3f3f('0x3d')]=qs[_0x3f3f('0x3e')](_0x118ca0[_0x3f3f('0x35')]['sort']);_0x1fb0d6[_0x3f3f('0x41')]=qs['filters'](_[_0x3f3f('0x3f')](_0x118ca0[_0x3f3f('0x35')],_0x34e723[_0x3f3f('0x37')]));_0x1fb0d6[_0x3f3f('0x6c')]=!![];if(_0x118ca0[_0x3f3f('0x35')][_0x3f3f('0x40')]){_0x1fb0d6[_0x3f3f('0x41')]=_[_0x3f3f('0x42')](_0x1fb0d6[_0x3f3f('0x41')],{'$or':_[_0x3f3f('0x2f')](_0x1fb0d6[_0x3f3f('0x39')],function(_0x56ce92){var _0x5f1dae={};_0x5f1dae[_0x56ce92]={'$like':'%'+_0x118ca0[_0x3f3f('0x35')]['filter']+'%'};return _0x5f1dae;})});}_0x1fb0d6=_[_0x3f3f('0x42')]({},_0x1fb0d6,_0x118ca0[_0x3f3f('0x43')]);return _0x1594f0[_0x3f3f('0x6d')](_0x1fb0d6);}})['then'](respondWithResult(_0x2a95a3,null))[_0x3f3f('0x4c')](handleError(_0x2a95a3,null));};exports[_0x3f3f('0x6e')]=function(_0x2203fd,_0xe88ff,_0x33b1a0){var _0x534eb3;var _0x1b4cba;var _0x4a1e43;var _0x24118b=_0x2203fd[_0x3f3f('0x48')]['id'];csv_results=[];return db[_0x3f3f('0x6f')][_0x3f3f('0x5b')]({'attributes':['id',_0x3f3f('0x2d')],'raw':!![],'order':[_0x3f3f('0x70')]})['then'](function(_0x4a5e98){_0x534eb3=_0x4a5e98;var _0x3f984f=_[_0x3f3f('0x36')](db['CmContact'][_0x3f3f('0x49')]);return db[_0x3f3f('0x67')][_0x3f3f('0x5b')]({'raw':!![],'attributes':['id',_0x3f3f('0x71')]})[_0x3f3f('0x27')](function(_0x5de01d){_0x1b4cba=_0x5de01d;var _0x1de89c=squel[_0x3f3f('0x72')]()['fields'](_0x3f984f)[_0x3f3f('0x73')]('cm_contacts','c')['where'](_0x3f3f('0x74'),_0x24118b)[_0x3f3f('0x41')](_0x3f3f('0x75'))[_0x3f3f('0x76')]();for(var _0x4f59d2=0x0;_0x4f59d2<_0x1b4cba[_0x3f3f('0x3a')];_0x4f59d2++){_0x1de89c[_0x3f3f('0x77')](_0x3f3f('0x78')+_0x1b4cba[_0x4f59d2]['id'],_0x3f3f('0x79')+_0x1b4cba[_0x4f59d2]['alias']);}for(var _0x4f59d2=0x0;_0x4f59d2<_0x534eb3[_0x3f3f('0x3a')];_0x4f59d2++){_0x1de89c['field'](squel['select']()[_0x3f3f('0x77')](_0x3f3f('0x7a'))[_0x3f3f('0x73')](_0x3f3f('0x7b'))['where'](_0x3f3f('0x7c'),_0x534eb3[_0x4f59d2]['id'])[_0x3f3f('0x41')](_0x3f3f('0x7d')),_0x3f3f('0x7e')+_0x534eb3[_0x4f59d2][_0x3f3f('0x2d')]);_0x1de89c[_0x3f3f('0x77')](squel[_0x3f3f('0x72')]()[_0x3f3f('0x77')]('description')['from'](_0x3f3f('0x7b'))[_0x3f3f('0x41')](_0x3f3f('0x7c'),_0x534eb3[_0x4f59d2]['id'])[_0x3f3f('0x41')](_0x3f3f('0x7d')),_0x3f3f('0x7f')+_0x534eb3[_0x4f59d2]['name']);}var _0x7fb358=[];_0x7fb358[_0x3f3f('0x62')](_0x1de89c['toString']());BPromise[_0x3f3f('0x63')](_0x7fb358,handleQuery)[_0x3f3f('0x27')](function(_0x50c22c){handleQuery(_0x1de89c[_0x3f3f('0x80')]());var _0x3b4ed0=csv_results[0x0];if(!_[_0x3f3f('0x81')](_0x3b4ed0)){var _0x32ec45=toCsv(_0x3b4ed0);var _0xe88570=Date['now']();fs['writeFileSync'](util[_0x3f3f('0x6a')](_0x3f3f('0x82'),_0x24118b,_0xe88570),_0x32ec45);_0xe88ff[_0x3f3f('0x83')](_0x3f3f('0x84'),_0x3f3f('0x85')+util[_0x3f3f('0x6a')](_0x3f3f('0x86'),_0x24118b,_0xe88570));_0xe88ff[_0x3f3f('0x83')](_0x3f3f('0x87'),_0x3f3f('0x88'));return _0xe88ff['download'](util[_0x3f3f('0x6a')](_0x3f3f('0x82'),_0x24118b,_0xe88570));}else{return _0xe88ff[_0x3f3f('0x89')](0xcc);}});});});};exports[_0x3f3f('0x8a')]=function(_0x3af24a,_0x7d3ff8,_0x7a63d0){var _0x4553e5;delete _0x3af24a[_0x3f3f('0x4e')]['id'];return db[_0x3f3f('0x30')][_0x3f3f('0x5a')]({'where':{'id':_0x3af24a[_0x3f3f('0x48')]['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x7d3ff8,null))['then'](function(_0x5dad15){if(_0x5dad15){return db[_0x3f3f('0x8b')][_0x3f3f('0x8c')](function(_0x328588){return db[_0x3f3f('0x67')][_0x3f3f('0x4d')](_0x3af24a[_0x3f3f('0x4e')],{'transaction':_0x328588})[_0x3f3f('0x27')](function(_0x4ea620){_0x4553e5=_0x4ea620;return _0x5dad15[_0x3f3f('0x8d')](_0x4ea620,{'transaction':_0x328588});})[_0x3f3f('0x27')](function(){var _0x6cd5b4={'type':db[_0x3f3f('0x8e')][_0x3f3f('0x8f')],'transaction':_0x328588};switch(_0x3af24a[_0x3f3f('0x4e')][_0x3f3f('0x32')]){case'text':_0x6cd5b4[_0x3f3f('0x32')]=db[_0x3f3f('0x8e')][_0x3f3f('0x8f')];break;case _0x3f3f('0x90'):_0x6cd5b4['type']=db['Sequelize'][_0x3f3f('0x91')];break;case _0x3f3f('0x92'):_0x6cd5b4[_0x3f3f('0x32')]=db[_0x3f3f('0x8e')]['BOOLEAN'];_0x6cd5b4[_0x3f3f('0x93')]=![];break;default:}return db[_0x3f3f('0x8b')][_0x3f3f('0x94')][_0x3f3f('0x95')]('cm_contacts',util[_0x3f3f('0x6a')](_0x3f3f('0x96'),_0x4553e5['id']),_0x6cd5b4);})[_0x3f3f('0x27')](function(){return _0x4553e5;});});}})['then'](respondWithResult(_0x7d3ff8,null))['catch'](handleError(_0x7d3ff8,null));};exports[_0x3f3f('0x97')]=function(_0x45f07a,_0x34b18a,_0x20ad33){var _0xb69720={};var _0x45a7b6={};var _0x82aeb4;var _0x3c9eb1;return db['CmList'][_0x3f3f('0x5a')]({'where':{'id':_0x45f07a[_0x3f3f('0x48')]['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x34b18a,null))[_0x3f3f('0x27')](function(_0x2eca5b){if(_0x2eca5b){_0x82aeb4=_0x2eca5b;_0x45a7b6['model']=_[_0x3f3f('0x36')](db[_0x3f3f('0x67')][_0x3f3f('0x49')]);_0x45a7b6[_0x3f3f('0x35')]=_['keys'](_0x45f07a[_0x3f3f('0x35')]);_0x45a7b6[_0x3f3f('0x37')]=_[_0x3f3f('0x38')](_0x45a7b6[_0x3f3f('0x34')],_0x45a7b6[_0x3f3f('0x35')]);_0xb69720['attributes']=_[_0x3f3f('0x38')](_0x45a7b6[_0x3f3f('0x34')],qs[_0x3f3f('0x4a')](_0x45f07a[_0x3f3f('0x35')][_0x3f3f('0x4a')]));_0xb69720[_0x3f3f('0x39')]=_0xb69720[_0x3f3f('0x39')]['length']?_0xb69720[_0x3f3f('0x39')]:_0x45a7b6['model'];_0xb69720[_0x3f3f('0x3d')]=qs[_0x3f3f('0x3e')](_0x45f07a[_0x3f3f('0x35')][_0x3f3f('0x3e')]);_0xb69720['where']=qs[_0x3f3f('0x37')](_[_0x3f3f('0x3f')](_0x45f07a[_0x3f3f('0x35')],_0x45a7b6['filters']));_0xb69720[_0x3f3f('0x41')]=_[_0x3f3f('0x42')](_0xb69720[_0x3f3f('0x41')],{'$or':[{'ListId':_0x2eca5b['id']},{'ListId':null}]});if(_0x45f07a[_0x3f3f('0x35')][_0x3f3f('0x40')]){_0xb69720[_0x3f3f('0x41')]=_[_0x3f3f('0x42')](_0xb69720[_0x3f3f('0x41')],{'$or':_['map'](_0xb69720[_0x3f3f('0x39')],function(_0x334e8e){var _0x1ed968={};_0x1ed968[_0x334e8e]={'$like':'%'+_0x45f07a['query'][_0x3f3f('0x40')]+'%'};return _0x1ed968;})});}_0xb69720=_[_0x3f3f('0x42')]({},_0xb69720,_0x45f07a[_0x3f3f('0x43')]);return db[_0x3f3f('0x67')][_0x3f3f('0x98')](_0xb69720);}})[_0x3f3f('0x27')](respondWithResult(_0x34b18a,null))[_0x3f3f('0x4c')](handleError(_0x34b18a,null));};exports['getGlobalCustomFields']=function(_0x53f4d5,_0x166156){return db[_0x3f3f('0x67')]['findAndCountAll']({'where':{'ListId':null}})[_0x3f3f('0x27')](handleEntityNotFound(_0x166156,null))['then'](function(_0x395e63){return _0x395e63;})[_0x3f3f('0x27')](respondWithResult(_0x166156,null))['catch'](handleError(_0x166156,null));};exports[_0x3f3f('0x99')]=function(_0x597daf,_0x32a123,_0x5093b1){return db['CmList'][_0x3f3f('0x4b')]({'where':{'id':_0x597daf[_0x3f3f('0x48')]['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x32a123,null))[_0x3f3f('0x27')](function(_0x1872eb){if(_0x1872eb){return _0x1872eb['addAgents'](_0x597daf[_0x3f3f('0x4e')][_0x3f3f('0x5d')],_[_0x3f3f('0x64')](_0x597daf[_0x3f3f('0x4e')],[_0x3f3f('0x5d'),'id'])||{})[_0x3f3f('0x9a')](function(_0x697101){for(var _0x265a76=0x0;_0x265a76<_0x597daf[_0x3f3f('0x4e')][_0x3f3f('0x5d')][_0x3f3f('0x3a')];_0x265a76+=0x1){socket[_0x3f3f('0x9b')](_0x3f3f('0x9c'),{'UserId':Number(_0x597daf[_0x3f3f('0x4e')][_0x3f3f('0x5d')][_0x265a76]),'CmListId':Number(_0x597daf[_0x3f3f('0x48')]['id'])});}return _0x697101;});}})[_0x3f3f('0x27')](respondWithResult(_0x32a123,null))[_0x3f3f('0x4c')](handleError(_0x32a123,null));};exports['removeAgents']=function(_0x5a4fc7,_0x219268,_0x469314){return db[_0x3f3f('0x30')][_0x3f3f('0x4b')]({'where':{'id':_0x5a4fc7[_0x3f3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x219268,null))['then'](function(_0xf4f5db){if(_0xf4f5db){return _0xf4f5db[_0x3f3f('0x9d')](_0x5a4fc7[_0x3f3f('0x35')][_0x3f3f('0x5d')])['then'](function(){if(_[_0x3f3f('0x60')](_0x5a4fc7[_0x3f3f('0x35')][_0x3f3f('0x5d')])){for(var _0x28abda=0x0;_0x28abda<_0x5a4fc7[_0x3f3f('0x35')][_0x3f3f('0x5d')][_0x3f3f('0x3a')];_0x28abda+=0x1){socket['emit'](_0x3f3f('0x9e'),{'UserId':Number(_0x5a4fc7[_0x3f3f('0x35')]['ids'][_0x28abda]),'CmListId':Number(_0x5a4fc7[_0x3f3f('0x48')]['id'])});}}else{socket['emit'](_0x3f3f('0x9e'),{'UserId':Number(_0x5a4fc7[_0x3f3f('0x35')][_0x3f3f('0x5d')]),'CmListId':Number(_0x5a4fc7[_0x3f3f('0x48')]['id'])});}});}})[_0x3f3f('0x27')](respondWithStatusCode(_0x219268,null))[_0x3f3f('0x4c')](handleError(_0x219268,null));};exports['getAgents']=function(_0x18d938,_0x59ca7f,_0x30e75a){var _0x3e9d05={};var _0x47b4b0={};var _0x522ef6;var _0x36642b;return db[_0x3f3f('0x30')][_0x3f3f('0x5a')]({'where':{'id':_0x18d938[_0x3f3f('0x48')]['id']}})[_0x3f3f('0x27')](handleEntityNotFound(_0x59ca7f,null))[_0x3f3f('0x27')](function(_0x7f96e){if(_0x7f96e){_0x522ef6=_0x7f96e;_0x47b4b0['model']=_[_0x3f3f('0x36')](db['User'][_0x3f3f('0x49')]);_0x47b4b0[_0x3f3f('0x35')]=_['keys'](_0x18d938['query']);_0x47b4b0[_0x3f3f('0x37')]=_[_0x3f3f('0x38')](_0x47b4b0['model'],_0x47b4b0[_0x3f3f('0x35')]);_0x3e9d05['attributes']=_[_0x3f3f('0x38')](_0x47b4b0[_0x3f3f('0x34')],qs['fields'](_0x18d938[_0x3f3f('0x35')][_0x3f3f('0x4a')]));_0x3e9d05['attributes']=_0x3e9d05[_0x3f3f('0x39')][_0x3f3f('0x3a')]?_0x3e9d05[_0x3f3f('0x39')]:_0x47b4b0['model'];_0x3e9d05[_0x3f3f('0x3d')]=qs[_0x3f3f('0x3e')](_0x18d938[_0x3f3f('0x35')]['sort']);_0x3e9d05[_0x3f3f('0x41')]=qs[_0x3f3f('0x37')](_[_0x3f3f('0x3f')](_0x18d938[_0x3f3f('0x35')],_0x47b4b0[_0x3f3f('0x37')]));if(_0x18d938[_0x3f3f('0x35')][_0x3f3f('0x40')]){_0x3e9d05[_0x3f3f('0x41')]=_[_0x3f3f('0x42')](_0x3e9d05[_0x3f3f('0x41')],{'$or':_[_0x3f3f('0x2f')](_0x3e9d05[_0x3f3f('0x39')],function(_0x53b577){var _0x553713={};_0x553713[_0x53b577]={'$like':'%'+_0x18d938[_0x3f3f('0x35')][_0x3f3f('0x40')]+'%'};return _0x553713;})});}_0x3e9d05=_[_0x3f3f('0x42')]({},_0x3e9d05,_0x18d938['options']);return _0x522ef6[_0x3f3f('0x9f')](_0x3e9d05);}})[_0x3f3f('0x27')](function(_0x182191){if(_0x182191){_0x36642b=_0x182191['length'];if(!_0x18d938[_0x3f3f('0x35')][_0x3f3f('0x3b')]('nolimit')){_0x3e9d05[_0x3f3f('0x20')]=qs[_0x3f3f('0x20')](_0x18d938[_0x3f3f('0x35')][_0x3f3f('0x20')]);_0x3e9d05[_0x3f3f('0x1f')]=qs[_0x3f3f('0x1f')](_0x18d938[_0x3f3f('0x35')]['offset']);}return _0x522ef6[_0x3f3f('0x9f')](_0x3e9d05);}})['then'](function(_0x5e0166){if(_0x5e0166){return _0x5e0166?{'count':_0x36642b,'rows':_0x5e0166}:null;}})[_0x3f3f('0x27')](respondWithResult(_0x59ca7f,null))[_0x3f3f('0x4c')](handleError(_0x59ca7f,null));};function handleQuery(_0x25c5f0){logger[_0x3f3f('0xa0')](_0x25c5f0);return db[_0x3f3f('0x8b')][_0x3f3f('0x35')](_0x25c5f0)['spread'](function(_0x4880e2){csv_results[_0x3f3f('0x62')](_0x4880e2);})['catch'](function(_0x293a7c){logger[_0x3f3f('0x2c')](_0x293a7c['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index fbf9e68..46018ae 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x20d7a4,_0x140fc3){var _0x56cdc8=function(_0x178f82){while(--_0x178f82){_0x20d7a4['push'](_0x20d7a4['shift']());}};_0x56cdc8(++_0x140fc3);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x5fc3[_0xcfc44];return _0x307a25;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 5036387..7e38d0a 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x56c230,_0x56a54b){var _0x3170fa=function(_0x4a74a5){while(--_0x4a74a5){_0x56c230['push'](_0x56c230['shift']());}};_0x3170fa(++_0x56a54b);}(_0xbec5,0xe5));var _0x5bec=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0xbec5[_0x2a7b50];return _0x4224c9;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x3b4137,_0x3729ae){var _0x4606ab=function(_0x11b5ce){while(--_0x11b5ce){_0x3b4137['push'](_0x3b4137['shift']());}};_0x4606ab(++_0x3729ae);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 95bbf1a..410ac88 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 _0x84fd=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x84fd,0x134));var _0xd84f=function(_0xbf4c60,_0x4756fd){_0xbf4c60=_0xbf4c60-0x0;var _0x3c9136=_0x84fd[_0xbf4c60];return _0x3c9136;};'use strict';var _=require(_0xd84f('0x0'));var util=require(_0xd84f('0x1'));var moment=require(_0xd84f('0x2'));var BPromise=require(_0xd84f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd84f('0x4'));var db=require(_0xd84f('0x5'))['db'];var utils=require(_0xd84f('0x6'));var logger=require(_0xd84f('0x7'))(_0xd84f('0x8'));var config=require('../../config/environment');var jayson=require(_0xd84f('0x9'));var client=jayson[_0xd84f('0xa')]['http']({'port':0x232a});config[_0xd84f('0xb')]=_[_0xd84f('0xc')](config[_0xd84f('0xb')],{'host':_0xd84f('0xd'),'port':0x18eb});var socket=require(_0xd84f('0xe'))(new Redis(config['redis']));require(_0xd84f('0xf'))[_0xd84f('0x10')](socket);function respondWithRpcPromise(_0x3f0207,_0x4ad08d,_0x27d908){return new BPromise(function(_0x4ba248,_0x30e1f8){return client[_0xd84f('0x11')](_0x3f0207,_0x27d908)['then'](function(_0x537ff5){logger[_0xd84f('0x12')](_0xd84f('0x13'),_0x4ad08d,'request\x20sent');logger[_0xd84f('0x14')](_0xd84f('0x15'),_0x4ad08d,'request\x20sent',JSON[_0xd84f('0x16')](_0x537ff5));if(_0x537ff5[_0xd84f('0x17')]){if(_0x537ff5[_0xd84f('0x17')]['code']===0x1f4){logger[_0xd84f('0x17')](_0xd84f('0x13'),_0x4ad08d,_0x537ff5[_0xd84f('0x17')]['message']);return _0x30e1f8(_0x537ff5['error'][_0xd84f('0x18')]);}logger['error'](_0xd84f('0x13'),_0x4ad08d,_0x537ff5[_0xd84f('0x17')][_0xd84f('0x18')]);return _0x4ba248(_0x537ff5[_0xd84f('0x17')][_0xd84f('0x18')]);}else{logger[_0xd84f('0x12')]('CmList,\x20%s,\x20%s',_0x4ad08d,_0xd84f('0x19'));_0x4ba248(_0x537ff5[_0xd84f('0x1a')]['message']);}})[_0xd84f('0x1b')](function(_0x196e4a){logger[_0xd84f('0x17')](_0xd84f('0x13'),_0x4ad08d,_0x196e4a);_0x30e1f8(_0x196e4a);});});} \ No newline at end of file +var _0x124f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x124f,0x127));var _0xf124=function(_0x1c29df,_0x21ee17){_0x1c29df=_0x1c29df-0x0;var _0x262ce0=_0x124f[_0x1c29df];return _0x262ce0;};'use strict';var _=require(_0xf124('0x0'));var util=require(_0xf124('0x1'));var moment=require(_0xf124('0x2'));var BPromise=require(_0xf124('0x3'));var rs=require(_0xf124('0x4'));var fs=require('fs');var Redis=require(_0xf124('0x5'));var db=require(_0xf124('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf124('0x7'))(_0xf124('0x8'));var config=require(_0xf124('0x9'));var jayson=require(_0xf124('0xa'));var client=jayson[_0xf124('0xb')][_0xf124('0xc')]({'port':0x232a});config[_0xf124('0xd')]=_[_0xf124('0xe')](config['redis'],{'host':_0xf124('0xf'),'port':0x18eb});var socket=require(_0xf124('0x10'))(new Redis(config[_0xf124('0xd')]));require(_0xf124('0x11'))[_0xf124('0x12')](socket);function respondWithRpcPromise(_0x52b8f8,_0x36f119,_0x58abdb){return new BPromise(function(_0x28cb46,_0x9ce20){return client[_0xf124('0x13')](_0x52b8f8,_0x58abdb)[_0xf124('0x14')](function(_0xbd7275){logger[_0xf124('0x15')](_0xf124('0x16'),_0x36f119,_0xf124('0x17'));logger[_0xf124('0x18')]('CmList,\x20%s,\x20%s,\x20%s',_0x36f119,_0xf124('0x17'),JSON[_0xf124('0x19')](_0xbd7275));if(_0xbd7275[_0xf124('0x1a')]){if(_0xbd7275[_0xf124('0x1a')]['code']===0x1f4){logger[_0xf124('0x1a')](_0xf124('0x16'),_0x36f119,_0xbd7275[_0xf124('0x1a')][_0xf124('0x1b')]);return _0x9ce20(_0xbd7275[_0xf124('0x1a')][_0xf124('0x1b')]);}logger[_0xf124('0x1a')]('CmList,\x20%s,\x20%s',_0x36f119,_0xbd7275['error'][_0xf124('0x1b')]);return _0x28cb46(_0xbd7275['error'][_0xf124('0x1b')]);}else{logger[_0xf124('0x15')](_0xf124('0x16'),_0x36f119,_0xf124('0x17'));_0x28cb46(_0xbd7275[_0xf124('0x1c')][_0xf124('0x1b')]);}})[_0xf124('0x1d')](function(_0xdf98b2){logger[_0xf124('0x1a')](_0xf124('0x16'),_0x36f119,_0xdf98b2);_0x9ce20(_0xdf98b2);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d4c0bb3..779969b 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 _0x12c6=['register','length','./cmList.events','save','update','removeListener'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x12c6,0x68));var _0x612c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x12c6[_0x4ae6ef];return _0x3cbb4e;};'use strict';var CmListEvents=require(_0x612c('0x0'));var events=[_0x612c('0x1'),'remove',_0x612c('0x2')];function createListener(_0x2eba7d,_0x157769){return function(_0x4f042a){_0x157769['emit'](_0x2eba7d,_0x4f042a);};}function removeListener(_0x3208b1,_0x25baae){return function(){CmListEvents[_0x612c('0x3')](_0x3208b1,_0x25baae);};}exports[_0x612c('0x4')]=function(_0x5ee8f1){for(var _0x58d38f=0x0,_0x260938=events[_0x612c('0x5')];_0x58d38f<_0x260938;_0x58d38f++){var _0x4b2e37=events[_0x58d38f];var _0x5aa725=createListener('cmList:'+_0x4b2e37,_0x5ee8f1);CmListEvents['on'](_0x4b2e37,_0x5aa725);}}; \ No newline at end of file +var _0x8d19=['./cmList.events','save','update','emit','removeListener','length','cmList:'];(function(_0x33131e,_0x27c1ee){var _0x2bc457=function(_0x5c59fd){while(--_0x5c59fd){_0x33131e['push'](_0x33131e['shift']());}};_0x2bc457(++_0x27c1ee);}(_0x8d19,0x142));var _0x98d1=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8d19[_0x2b5eae];return _0x5f3ac9;};'use strict';var CmListEvents=require(_0x98d1('0x0'));var events=[_0x98d1('0x1'),'remove',_0x98d1('0x2')];function createListener(_0x3e5d36,_0x1ff67a){return function(_0x428e7e){_0x1ff67a[_0x98d1('0x3')](_0x3e5d36,_0x428e7e);};}function removeListener(_0xfcfe7b,_0x1f0517){return function(){CmListEvents[_0x98d1('0x4')](_0xfcfe7b,_0x1f0517);};}exports['register']=function(_0x5be1df){for(var _0x497392=0x0,_0x3acff4=events[_0x98d1('0x5')];_0x497392<_0x3acff4;_0x497392++){var _0x159547=events[_0x497392];var _0x462f5f=createListener(_0x98d1('0x6')+_0x159547,_0x5be1df);CmListEvents['on'](_0x159547,_0x462f5f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index a99c907..a60fe40 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 _0x367c=['update','delete','removeDispositions','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x367c,0x1b4));var _0xc367=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x367c[_0x1f71d8];return _0x10b045;};'use strict';var multer=require('multer');var util=require(_0xc367('0x0'));var path=require(_0xc367('0x1'));var timeout=require(_0xc367('0x2'));var express=require(_0xc367('0x3'));var router=express[_0xc367('0x4')]();var fs_extra=require(_0xc367('0x5'));var auth=require(_0xc367('0x6'));var interaction=require(_0xc367('0x7'));var config=require(_0xc367('0x8'));var controller=require(_0xc367('0x9'));router[_0xc367('0xa')]('/',auth[_0xc367('0xb')](),controller['index']);router['get'](_0xc367('0xc'),auth[_0xc367('0xb')](),controller[_0xc367('0xd')]);router[_0xc367('0xa')](_0xc367('0xe'),auth[_0xc367('0xb')](),controller[_0xc367('0xf')]);router[_0xc367('0xa')]('/:id',auth[_0xc367('0xb')](),controller[_0xc367('0x10')]);router[_0xc367('0xa')](_0xc367('0x11'),auth[_0xc367('0xb')](),controller[_0xc367('0x12')]);router[_0xc367('0xa')](_0xc367('0x13'),auth['isAuthenticated'](),controller[_0xc367('0x14')]);router['get'](_0xc367('0x15'),auth[_0xc367('0xb')](),controller['getContactsCsv']);router[_0xc367('0xa')](_0xc367('0x16'),auth[_0xc367('0xb')](),controller[_0xc367('0x17')]);router['get'](_0xc367('0x18'),auth['isAuthenticated'](),controller[_0xc367('0x19')]);router[_0xc367('0x1a')]('/',auth[_0xc367('0xb')](),controller[_0xc367('0x1b')]);router[_0xc367('0x1a')](_0xc367('0x11'),auth[_0xc367('0xb')](),controller[_0xc367('0x1c')]);router[_0xc367('0x1a')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xc367('0x1d')]);router[_0xc367('0x1a')](_0xc367('0x16'),auth[_0xc367('0xb')](),controller[_0xc367('0x1e')]);router['post'](_0xc367('0x18'),auth[_0xc367('0xb')](),controller['addAgents']);router['put'](_0xc367('0x1f'),auth['isAuthenticated'](),controller[_0xc367('0x20')]);router[_0xc367('0x21')](_0xc367('0x1f'),auth[_0xc367('0xb')](),controller['destroy']);router[_0xc367('0x21')](_0xc367('0x11'),auth[_0xc367('0xb')](),controller[_0xc367('0x22')]);router[_0xc367('0x21')](_0xc367('0x18'),auth[_0xc367('0xb')](),controller[_0xc367('0x23')]);module['exports']=router; \ No newline at end of file +var _0xf9f9=['update','destroy','delete','removeDispositions','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put'];(function(_0xd1a41d,_0x11e22d){var _0x2d95a7=function(_0x4d1791){while(--_0x4d1791){_0xd1a41d['push'](_0xd1a41d['shift']());}};_0x2d95a7(++_0x11e22d);}(_0xf9f9,0x15b));var _0x9f9f=function(_0x2c5759,_0xe54d3c){_0x2c5759=_0x2c5759-0x0;var _0x314822=_0xf9f9[_0x2c5759];return _0x314822;};'use strict';var multer=require(_0x9f9f('0x0'));var util=require('util');var path=require(_0x9f9f('0x1'));var timeout=require(_0x9f9f('0x2'));var express=require(_0x9f9f('0x3'));var router=express['Router']();var fs_extra=require(_0x9f9f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f9f('0x5'));var config=require(_0x9f9f('0x6'));var controller=require(_0x9f9f('0x7'));router[_0x9f9f('0x8')]('/',auth[_0x9f9f('0x9')](),controller[_0x9f9f('0xa')]);router['get'](_0x9f9f('0xb'),auth['isAuthenticated'](),controller[_0x9f9f('0xc')]);router[_0x9f9f('0x8')](_0x9f9f('0xd'),auth['isAuthenticated'](),controller[_0x9f9f('0xe')]);router[_0x9f9f('0x8')](_0x9f9f('0xf'),auth['isAuthenticated'](),controller[_0x9f9f('0x10')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9f9f('0x11')]);router[_0x9f9f('0x8')](_0x9f9f('0x12'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x13')]);router[_0x9f9f('0x8')](_0x9f9f('0x14'),auth['isAuthenticated'](),controller[_0x9f9f('0x15')]);router['get']('/:id/fields',auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x16')]);router[_0x9f9f('0x8')]('/:id/users',auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x17')]);router[_0x9f9f('0x18')]('/',auth[_0x9f9f('0x9')](),controller['create']);router['post'](_0x9f9f('0x19'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x1a')]);router[_0x9f9f('0x18')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x9f9f('0x1b')]);router[_0x9f9f('0x18')](_0x9f9f('0x1c'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x1d')]);router['post'](_0x9f9f('0x1e'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x1f')]);router[_0x9f9f('0x20')](_0x9f9f('0xf'),auth['isAuthenticated'](),controller[_0x9f9f('0x21')]);router['delete'](_0x9f9f('0xf'),auth['isAuthenticated'](),controller[_0x9f9f('0x22')]);router[_0x9f9f('0x23')](_0x9f9f('0x19'),auth['isAuthenticated'](),controller[_0x9f9f('0x24')]);router[_0x9f9f('0x23')]('/:id/users',auth[_0x9f9f('0x9')](),controller['removeAgents']);module[_0x9f9f('0x25')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 726e2ac..bdbe29e 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 _0x0087=['STRING','exports','VIRTUAL','field'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x0087,0x65));var _0x7008=function(_0x39b5bd,_0x398098){_0x39b5bd=_0x39b5bd-0x0;var _0x3791cb=_0x0087[_0x39b5bd];return _0x3791cb;};'use strict';var Sequelize=require('sequelize');module[_0x7008('0x0')]={'name':{'type':Sequelize[_0x7008('0x1')],'get':function(_0x3d8d7b){return this['getDataValue'](_0x7008('0x2'));}},'field':{'type':Sequelize[_0x7008('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x7008('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x7008('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xd760=['exports','getDataValue','field','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd760,0x1d0));var _0x0d76=function(_0x2e03a1,_0x10187c){_0x2e03a1=_0x2e03a1-0x0;var _0x5c667c=_0xd760[_0x2e03a1];return _0x5c667c;};'use strict';var Sequelize=require('sequelize');module[_0x0d76('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x488c40){return this[_0x0d76('0x1')](_0x0d76('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0d76('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x0d76('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 3c05cf3..81ff783 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4f90b9,_0x15b058){var _0x34fc60=function(_0x4d7263){while(--_0x4d7263){_0x4f90b9['push'](_0x4f90b9['shift']());}};_0x34fc60(++_0x15b058);}(_0x7a54,0x106));var _0x47a5=function(_0x1eab65,_0x59148d){_0x1eab65=_0x1eab65-0x0;var _0x172d34=_0x7a54[_0x1eab65];return _0x172d34;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0xfd1e7a,_0x5669bd){var _0x4b6085=function(_0x426919){while(--_0x426919){_0xfd1e7a['push'](_0xfd1e7a['shift']());}};_0x4b6085(++_0x5669bd);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 7b9a868..cbb2d91 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 _0xa256=['rimraf','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x53c493,_0x425909){var _0x1478ab=function(_0x411efa){while(--_0x411efa){_0x53c493['push'](_0x53c493['shift']());}};_0x1478ab(++_0x425909);}(_0xa256,0x13e));var _0x6a25=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa256[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require('lodash');var util=require(_0x6a25('0x0'));var logger=require(_0x6a25('0x1'))(_0x6a25('0x2'));var moment=require('moment');var BPromise=require(_0x6a25('0x3'));var rp=require(_0x6a25('0x4'));var fs=require('fs');var path=require(_0x6a25('0x5'));var rimraf=require(_0x6a25('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a25('0x7'));module[_0x6a25('0x8')]=function(_0x2650d6,_0x19f251){return _0x2650d6[_0x6a25('0x9')](_0x6a25('0xa'),attributes,{'tableName':_0x6a25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0e9=['exports','define','Condition','tools_conditions','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x3af7d4,_0x2f817b){var _0x4c8da4=function(_0x1b4c4f){while(--_0x1b4c4f){_0x3af7d4['push'](_0x3af7d4['shift']());}};_0x4c8da4(++_0x2f817b);}(_0xf0e9,0xcc));var _0x9f0e=function(_0x5b26f6,_0x556145){_0x5b26f6=_0x5b26f6-0x0;var _0x85411d=_0xf0e9[_0x5b26f6];return _0x85411d;};'use strict';var _=require(_0x9f0e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9f0e('0x1'));var moment=require('moment');var BPromise=require(_0x9f0e('0x2'));var rp=require(_0x9f0e('0x3'));var fs=require('fs');var path=require(_0x9f0e('0x4'));var rimraf=require(_0x9f0e('0x5'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x9f0e('0x6')]=function(_0x2f104d,_0x5a26f8){return _0x2f104d[_0x9f0e('0x7')](_0x9f0e('0x8'),attributes,{'tableName':_0x9f0e('0x9'),'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 165f655..c8d6929 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 _0x70cf=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x416728,_0x286fd8){var _0x4204d1=function(_0x38efaa){while(--_0x38efaa){_0x416728['push'](_0x416728['shift']());}};_0x4204d1(++_0x286fd8);}(_0x70cf,0x158));var _0xf70c=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x70cf[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xf70c('0x0'));var util=require('util');var moment=require(_0xf70c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf70c('0x2'));var db=require(_0xf70c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf70c('0x4'))(_0xf70c('0x5'));var config=require(_0xf70c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf70c('0x7')][_0xf70c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x297faa,_0x26d638,_0x2a6d85){return new BPromise(function(_0x176d2a,_0x4df111){return client[_0xf70c('0x9')](_0x297faa,_0x2a6d85)[_0xf70c('0xa')](function(_0x4e3582){logger[_0xf70c('0xb')](_0xf70c('0xc'),_0x26d638,_0xf70c('0xd'));logger[_0xf70c('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x26d638,_0xf70c('0xd'),JSON[_0xf70c('0xf')](_0x4e3582));if(_0x4e3582[_0xf70c('0x10')]){if(_0x4e3582[_0xf70c('0x10')][_0xf70c('0x11')]===0x1f4){logger[_0xf70c('0x10')]('Condition,\x20%s,\x20%s',_0x26d638,_0x4e3582['error'][_0xf70c('0x12')]);return _0x4df111(_0x4e3582[_0xf70c('0x10')][_0xf70c('0x12')]);}logger['error'](_0xf70c('0xc'),_0x26d638,_0x4e3582[_0xf70c('0x10')][_0xf70c('0x12')]);return _0x176d2a(_0x4e3582[_0xf70c('0x10')][_0xf70c('0x12')]);}else{logger[_0xf70c('0xb')](_0xf70c('0xc'),_0x26d638,_0xf70c('0xd'));_0x176d2a(_0x4e3582[_0xf70c('0x13')]['message']);}})[_0xf70c('0x14')](function(_0x540a9e){logger['error'](_0xf70c('0xc'),_0x26d638,_0x540a9e);_0x4df111(_0x540a9e);});});} \ No newline at end of file +var _0xeaa2=['rpc','../../config/environment','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0xeaa2,0x160));var _0x2eaa=function(_0x2f202e,_0x5ed293){_0x2f202e=_0x2f202e-0x0;var _0x398ac6=_0xeaa2[_0x2f202e];return _0x398ac6;};'use strict';var _=require(_0x2eaa('0x0'));var util=require(_0x2eaa('0x1'));var moment=require('moment');var BPromise=require(_0x2eaa('0x2'));var rs=require(_0x2eaa('0x3'));var fs=require('fs');var Redis=require(_0x2eaa('0x4'));var db=require(_0x2eaa('0x5'))['db'];var utils=require(_0x2eaa('0x6'));var logger=require(_0x2eaa('0x7'))(_0x2eaa('0x8'));var config=require(_0x2eaa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2eaa('0xa')][_0x2eaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c1c61,_0x12bfae,_0x7cbc9){return new BPromise(function(_0x1580ce,_0x2e7e33){return client[_0x2eaa('0xc')](_0x1c1c61,_0x7cbc9)[_0x2eaa('0xd')](function(_0x23a4eb){logger['info'](_0x2eaa('0xe'),_0x12bfae,_0x2eaa('0xf'));logger[_0x2eaa('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x12bfae,_0x2eaa('0xf'),JSON[_0x2eaa('0x11')](_0x23a4eb));if(_0x23a4eb[_0x2eaa('0x12')]){if(_0x23a4eb['error'][_0x2eaa('0x13')]===0x1f4){logger['error'](_0x2eaa('0xe'),_0x12bfae,_0x23a4eb[_0x2eaa('0x12')][_0x2eaa('0x14')]);return _0x2e7e33(_0x23a4eb[_0x2eaa('0x12')]['message']);}logger[_0x2eaa('0x12')](_0x2eaa('0xe'),_0x12bfae,_0x23a4eb[_0x2eaa('0x12')][_0x2eaa('0x14')]);return _0x1580ce(_0x23a4eb[_0x2eaa('0x12')][_0x2eaa('0x14')]);}else{logger[_0x2eaa('0x15')](_0x2eaa('0xe'),_0x12bfae,_0x2eaa('0xf'));_0x1580ce(_0x23a4eb[_0x2eaa('0x16')][_0x2eaa('0x14')]);}})[_0x2eaa('0x17')](function(_0x3a604d){logger['error'](_0x2eaa('0xe'),_0x12bfae,_0x3a604d);_0x2e7e33(_0x3a604d);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index b051211..60d1a0a 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 _0x34fc=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','delete','multer'];(function(_0x2d86f2,_0x5e1b5c){var _0x4d2124=function(_0x4b6c2f){while(--_0x4b6c2f){_0x2d86f2['push'](_0x2d86f2['shift']());}};_0x4d2124(++_0x5e1b5c);}(_0x34fc,0xd7));var _0xc34f=function(_0x19677a,_0x5a5a53){_0x19677a=_0x19677a-0x0;var _0x5895aa=_0x34fc[_0x19677a];return _0x5895aa;};'use strict';var multer=require(_0xc34f('0x0'));var util=require(_0xc34f('0x1'));var path=require(_0xc34f('0x2'));var timeout=require(_0xc34f('0x3'));var express=require('express');var router=express[_0xc34f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc34f('0x5'));var interaction=require(_0xc34f('0x6'));var config=require(_0xc34f('0x7'));var controller=require('./condition.controller');router[_0xc34f('0x8')](_0xc34f('0x9'),auth[_0xc34f('0xa')](),controller['update']);router[_0xc34f('0xb')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf717=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2eef02,_0x408f43){var _0xf0bbda=function(_0x47baa1){while(--_0x47baa1){_0x2eef02['push'](_0x2eef02['shift']());}};_0xf0bbda(++_0x408f43);}(_0xf717,0xb6));var _0x7f71=function(_0x5d5e39,_0x500a9e){_0x5d5e39=_0x5d5e39-0x0;var _0x45efe1=_0xf717[_0x5d5e39];return _0x45efe1;};'use strict';var multer=require(_0x7f71('0x0'));var util=require(_0x7f71('0x1'));var path=require(_0x7f71('0x2'));var timeout=require(_0x7f71('0x3'));var express=require(_0x7f71('0x4'));var router=express[_0x7f71('0x5')]();var fs_extra=require(_0x7f71('0x6'));var auth=require(_0x7f71('0x7'));var interaction=require(_0x7f71('0x8'));var config=require(_0x7f71('0x9'));var controller=require(_0x7f71('0xa'));router[_0x7f71('0xb')](_0x7f71('0xc'),auth[_0x7f71('0xd')](),controller['update']);router[_0x7f71('0xe')](_0x7f71('0xc'),auth[_0x7f71('0xd')](),controller[_0x7f71('0xf')]);module[_0x7f71('0x10')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 617daaf..719e5a5 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad13=['INTEGER','sequelize','STRING','name'];(function(_0x2351fe,_0x3d5327){var _0x98f64c=function(_0x540471){while(--_0x540471){_0x2351fe['push'](_0x2351fe['shift']());}};_0x98f64c(++_0x3d5327);}(_0xad13,0x79));var _0x3ad1=function(_0x101951,_0x42317d){_0x101951=_0x101951-0x0;var _0x114fd2=_0xad13[_0x101951];return _0x114fd2;};'use strict';var Sequelize=require(_0x3ad1('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ad1('0x1')],'allowNull':![],'unique':_0x3ad1('0x2')},'OrderBy':{'type':Sequelize[_0x3ad1('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x3ad1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3d18=['STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d18,0x174));var _0x83d1=function(_0x4182c9,_0x4cb37e){_0x4182c9=_0x4182c9-0x0;var _0x36ed74=_0x3d18[_0x4182c9];return _0x36ed74;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x83d1('0x0')],'allowNull':![],'unique':_0x83d1('0x1')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x83d1('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 392e291..4b92b64 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d11=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x2f9d3e,_0x29345f){var _0x32d8e6=function(_0x9f63fc){while(--_0x9f63fc){_0x2f9d3e['push'](_0x2f9d3e['shift']());}};_0x32d8e6(++_0x29345f);}(_0x6d11,0xbf));var _0x16d1=function(_0x3bbdc6,_0x262329){_0x3bbdc6=_0x3bbdc6-0x0;var _0x50a293=_0x6d11[_0x3bbdc6];return _0x50a293;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){var _0x21e122=_0x215c23[_0x16d1('0x24')]({'plain':!![]});var _0x335c24=_0x16d1('0x25');return db[_0x16d1('0x26')][_0x16d1('0x23')]({'where':{'type':_0x335c24,'resourceId':_0x21e122['id']}})[_0x16d1('0x22')](function(){return _0x215c23;});})[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ae4e,_0x440a47){return function(_0x4257f1){if(!_0x4257f1){_0x25ae4e['sendStatus'](0x194);}return _0x4257f1;};}function handleError(_0x28837c,_0x1deb1e){_0x1deb1e=_0x1deb1e||0x1f4;return function(_0x364bf7){logger[_0x16d1('0x27')](_0x364bf7[_0x16d1('0x28')]);if(_0x364bf7[_0x16d1('0x29')]){delete _0x364bf7[_0x16d1('0x29')];}_0x28837c['status'](_0x1deb1e)[_0x16d1('0x2a')](_0x364bf7);};}exports[_0x16d1('0x2b')]=function(_0x31c4e9,_0x30cd8f){var _0x55c021={},_0x4b27f6={},_0x2f16ee={'count':0x0,'rows':[]};var _0x4ab3d4=_[_0x16d1('0x2c')](db[_0x16d1('0x2d')][_0x16d1('0x2e')],function(_0x2b4dbd){return{'name':_0x2b4dbd[_0x16d1('0x2f')],'type':_0x2b4dbd[_0x16d1('0x30')][_0x16d1('0x31')]};});_0x4b27f6[_0x16d1('0x32')]=_[_0x16d1('0x2c')](_0x4ab3d4,_0x16d1('0x29'));_0x4b27f6[_0x16d1('0x33')]=_[_0x16d1('0x34')](_0x31c4e9['query']);_0x4b27f6[_0x16d1('0x35')]=_['intersection'](_0x4b27f6[_0x16d1('0x32')],_0x4b27f6[_0x16d1('0x33')]);_0x55c021[_0x16d1('0x36')]=_[_0x16d1('0x37')](_0x4b27f6[_0x16d1('0x32')],qs[_0x16d1('0x38')](_0x31c4e9['query']['fields']));_0x55c021['attributes']=_0x55c021[_0x16d1('0x36')][_0x16d1('0x39')]?_0x55c021[_0x16d1('0x36')]:_0x4b27f6[_0x16d1('0x32')];if(!_0x31c4e9['query'][_0x16d1('0x3a')](_0x16d1('0x3b'))){_0x55c021['limit']=qs['limit'](_0x31c4e9['query'][_0x16d1('0x1f')]);_0x55c021[_0x16d1('0x1d')]=qs[_0x16d1('0x1d')](_0x31c4e9['query'][_0x16d1('0x1d')]);}_0x55c021[_0x16d1('0x3c')]=qs[_0x16d1('0x3d')](_0x31c4e9[_0x16d1('0x33')][_0x16d1('0x3d')]);_0x55c021[_0x16d1('0x3e')]=qs[_0x16d1('0x35')](_['pick'](_0x31c4e9['query'],_0x4b27f6['filters']),_0x4ab3d4);if(_0x31c4e9[_0x16d1('0x33')][_0x16d1('0x3f')]){_0x55c021[_0x16d1('0x3e')]=_[_0x16d1('0x40')](_0x55c021[_0x16d1('0x3e')],{'$or':_[_0x16d1('0x2c')](_0x4ab3d4,function(_0x364c39){if(_0x364c39[_0x16d1('0x30')]!=='VIRTUAL'){var _0x180f55={};_0x180f55[_0x364c39['name']]={'$like':'%'+_0x31c4e9['query'][_0x16d1('0x3f')]+'%'};return _0x180f55;}})});}_0x55c021=_[_0x16d1('0x40')]({},_0x55c021,_0x31c4e9[_0x16d1('0x41')]);var _0x3a0343={'where':_0x55c021[_0x16d1('0x3e')]};return db[_0x16d1('0x2d')]['count'](_0x3a0343)[_0x16d1('0x22')](function(_0x525212){_0x2f16ee['count']=_0x525212;if(_0x31c4e9['query']['includeAll']){_0x55c021[_0x16d1('0x42')]=[{'all':!![]}];}return db[_0x16d1('0x2d')][_0x16d1('0x43')](_0x55c021);})[_0x16d1('0x22')](function(_0x53de06){_0x2f16ee[_0x16d1('0x44')]=_0x53de06;return _0x2f16ee;})['then'](respondWithFilteredResult(_0x30cd8f,_0x55c021))[_0x16d1('0x45')](handleError(_0x30cd8f,null));};exports[_0x16d1('0x46')]=function(_0x19ac7c,_0x2e4971){var _0x1a109d={'raw':!![],'where':{'id':_0x19ac7c[_0x16d1('0x47')]['id']}},_0x116f51={};_0x116f51[_0x16d1('0x32')]=_[_0x16d1('0x34')](db[_0x16d1('0x2d')][_0x16d1('0x2e')]);_0x116f51[_0x16d1('0x33')]=_[_0x16d1('0x34')](_0x19ac7c[_0x16d1('0x33')]);_0x116f51[_0x16d1('0x35')]=_['intersection'](_0x116f51['model'],_0x116f51[_0x16d1('0x33')]);_0x1a109d[_0x16d1('0x36')]=_[_0x16d1('0x37')](_0x116f51[_0x16d1('0x32')],qs[_0x16d1('0x38')](_0x19ac7c[_0x16d1('0x33')]['fields']));_0x1a109d[_0x16d1('0x36')]=_0x1a109d[_0x16d1('0x36')][_0x16d1('0x39')]?_0x1a109d['attributes']:_0x116f51['model'];if(_0x19ac7c[_0x16d1('0x33')][_0x16d1('0x48')]){_0x1a109d['include']=[{'all':!![]}];}_0x1a109d=_[_0x16d1('0x40')]({},_0x1a109d,_0x19ac7c['options']);return db[_0x16d1('0x2d')][_0x16d1('0x49')](_0x1a109d)[_0x16d1('0x22')](handleEntityNotFound(_0x2e4971,null))[_0x16d1('0x22')](respondWithResult(_0x2e4971,null))['catch'](handleError(_0x2e4971,null));};exports['create']=function(_0x1d92cd,_0x8bb0c1){return db['ContactItemType'][_0x16d1('0x4a')](_0x1d92cd[_0x16d1('0x4b')],{})[_0x16d1('0x22')](function(_0x117da5){var _0x3b77db=_0x1d92cd['user'][_0x16d1('0x24')]({'plain':!![]});if(!_0x3b77db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b77db[_0x16d1('0x4c')]===_0x16d1('0x4d')){var _0x5d384c=_0x117da5[_0x16d1('0x24')]({'plain':!![]});var _0xd3a7f8=_0x16d1('0x25');return db[_0x16d1('0x4e')]['find']({'where':{'name':_0xd3a7f8,'userProfileId':_0x3b77db['userProfileId']},'raw':!![]})['then'](function(_0x34e266){if(_0x34e266&&_0x34e266[_0x16d1('0x4f')]===0x0){return db[_0x16d1('0x26')][_0x16d1('0x4a')]({'name':_0x5d384c['name'],'resourceId':_0x5d384c['id'],'type':_0x34e266[_0x16d1('0x29')],'sectionId':_0x34e266['id']},{})[_0x16d1('0x22')](function(){return _0x117da5;});}else{return _0x117da5;}})['catch'](function(_0x1e1bbc){logger[_0x16d1('0x27')](_0x16d1('0x50'),_0x1e1bbc);throw _0x1e1bbc;});}return _0x117da5;})[_0x16d1('0x22')](respondWithResult(_0x8bb0c1,0xc9))['catch'](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x51')]=function(_0x2b0aa7,_0xb9fb43){if(_0x2b0aa7['body']['id']){delete _0x2b0aa7['body']['id'];}return db[_0x16d1('0x2d')][_0x16d1('0x49')]({'where':{'id':_0x2b0aa7['params']['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0xb9fb43,null))[_0x16d1('0x22')](saveUpdates(_0x2b0aa7[_0x16d1('0x4b')],null))['then'](respondWithResult(_0xb9fb43,null))[_0x16d1('0x45')](handleError(_0xb9fb43,null));};exports[_0x16d1('0x23')]=function(_0x11209f,_0x4b3079){return db[_0x16d1('0x2d')][_0x16d1('0x49')]({'where':{'id':_0x11209f['params']['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x4b3079,null))[_0x16d1('0x22')](db['CmContactHasItem'][_0x16d1('0x51')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x11209f[_0x16d1('0x47')]['id']}}))[_0x16d1('0x22')](removeEntity(_0x4b3079,null))[_0x16d1('0x45')](handleError(_0x4b3079,null));}; \ No newline at end of file +var _0x955f=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','user','catch'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x955f,0x1eb));var _0xf955=function(_0x1e1594,_0x5712aa){_0x1e1594=_0x1e1594-0x0;var _0x16ef8b=_0x955f[_0x1e1594];return _0x16ef8b;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];function respondWithStatusCode(_0x542347,_0x23e0c6){_0x23e0c6=_0x23e0c6||0xcc;return function(_0x50d9a9){if(_0x50d9a9){return _0x542347[_0xf955('0x17')](_0x23e0c6);}return _0x542347[_0xf955('0x18')](_0x23e0c6)[_0xf955('0x19')]();};}function respondWithResult(_0x109bc5,_0x2080c4){_0x2080c4=_0x2080c4||0xc8;return function(_0x341b8c){if(_0x341b8c){return _0x109bc5[_0xf955('0x18')](_0x2080c4)[_0xf955('0x1a')](_0x341b8c);}};}function respondWithFilteredResult(_0x3c6af7,_0x24e75c){return function(_0x5350e4){if(_0x5350e4){var _0xc29b35=typeof _0x24e75c['offset']===_0xf955('0x1b')&&typeof _0x24e75c[_0xf955('0x1c')]===_0xf955('0x1b');var _0x15c07c=_0x5350e4['count'];var _0x5ac6cb=_0xc29b35?0x0:_0x24e75c[_0xf955('0x1d')];var _0xe6de5c=_0xc29b35?_0x5350e4[_0xf955('0x1e')]:_0x24e75c['offset']+_0x24e75c[_0xf955('0x1c')];var _0x3576fa;if(_0xe6de5c>=_0x15c07c){_0xe6de5c=_0x15c07c;_0x3576fa=0xc8;}else{_0x3576fa=0xce;}_0x3c6af7[_0xf955('0x18')](_0x3576fa);return _0x3c6af7[_0xf955('0x1f')](_0xf955('0x20'),_0x5ac6cb+'-'+_0xe6de5c+'/'+_0x15c07c)['json'](_0x5350e4);}return null;};}function patchUpdates(_0x17d86a){return function(_0x3dbbe8){try{jsonpatch[_0xf955('0x21')](_0x3dbbe8,_0x17d86a,!![]);}catch(_0x488d04){return BPromise[_0xf955('0x22')](_0x488d04);}return _0x3dbbe8['save']();};}function saveUpdates(_0x21ae24,_0x43b078){return function(_0x37143d){if(_0x37143d){return _0x37143d[_0xf955('0x23')](_0x21ae24)[_0xf955('0x24')](function(_0x565641){return _0x565641;});}return null;};}function removeEntity(_0x25f4f2,_0x5fab1c){return function(_0x3585c7){if(_0x3585c7){return _0x3585c7[_0xf955('0x25')]()[_0xf955('0x24')](function(){var _0x102e36=_0x3585c7[_0xf955('0x26')]({'plain':!![]});var _0x552cf3=_0xf955('0x27');return db[_0xf955('0x28')][_0xf955('0x25')]({'where':{'type':_0x552cf3,'resourceId':_0x102e36['id']}})[_0xf955('0x24')](function(){return _0x3585c7;});})[_0xf955('0x24')](function(){_0x25f4f2[_0xf955('0x18')](0xcc)[_0xf955('0x19')]();});}};}function handleEntityNotFound(_0x51f3ab,_0x3caea6){return function(_0x145098){if(!_0x145098){_0x51f3ab[_0xf955('0x17')](0x194);}return _0x145098;};}function handleError(_0xbd0b74,_0x28fa9c){_0x28fa9c=_0x28fa9c||0x1f4;return function(_0x264f6d){logger['error'](_0x264f6d[_0xf955('0x29')]);if(_0x264f6d[_0xf955('0x2a')]){delete _0x264f6d['name'];}_0xbd0b74[_0xf955('0x18')](_0x28fa9c)[_0xf955('0x2b')](_0x264f6d);};}exports[_0xf955('0x2c')]=function(_0x1ef794,_0x59bfb5){var _0x3a951c={},_0x518fb3={},_0x227104={'count':0x0,'rows':[]};var _0x2c222a=_[_0xf955('0x2d')](db[_0xf955('0x2e')][_0xf955('0x2f')],function(_0x32121b){return{'name':_0x32121b[_0xf955('0x30')],'type':_0x32121b[_0xf955('0x31')]['key']};});_0x518fb3[_0xf955('0x32')]=_[_0xf955('0x2d')](_0x2c222a,_0xf955('0x2a'));_0x518fb3[_0xf955('0x33')]=_['keys'](_0x1ef794[_0xf955('0x33')]);_0x518fb3[_0xf955('0x34')]=_[_0xf955('0x35')](_0x518fb3[_0xf955('0x32')],_0x518fb3[_0xf955('0x33')]);_0x3a951c['attributes']=_['intersection'](_0x518fb3['model'],qs[_0xf955('0x36')](_0x1ef794[_0xf955('0x33')][_0xf955('0x36')]));_0x3a951c[_0xf955('0x37')]=_0x3a951c[_0xf955('0x37')][_0xf955('0x38')]?_0x3a951c['attributes']:_0x518fb3[_0xf955('0x32')];if(!_0x1ef794['query'][_0xf955('0x39')](_0xf955('0x3a'))){_0x3a951c[_0xf955('0x1c')]=qs['limit'](_0x1ef794[_0xf955('0x33')]['limit']);_0x3a951c[_0xf955('0x1d')]=qs[_0xf955('0x1d')](_0x1ef794[_0xf955('0x33')][_0xf955('0x1d')]);}_0x3a951c['order']=qs[_0xf955('0x3b')](_0x1ef794[_0xf955('0x33')]['sort']);_0x3a951c[_0xf955('0x3c')]=qs[_0xf955('0x34')](_[_0xf955('0x3d')](_0x1ef794['query'],_0x518fb3[_0xf955('0x34')]),_0x2c222a);if(_0x1ef794[_0xf955('0x33')][_0xf955('0x3e')]){_0x3a951c['where']=_[_0xf955('0x3f')](_0x3a951c[_0xf955('0x3c')],{'$or':_[_0xf955('0x2d')](_0x2c222a,function(_0x2069f3){if(_0x2069f3[_0xf955('0x31')]!==_0xf955('0x40')){var _0x2b614d={};_0x2b614d[_0x2069f3[_0xf955('0x2a')]]={'$like':'%'+_0x1ef794['query'][_0xf955('0x3e')]+'%'};return _0x2b614d;}})});}_0x3a951c=_[_0xf955('0x3f')]({},_0x3a951c,_0x1ef794[_0xf955('0x41')]);var _0xe633fa={'where':_0x3a951c[_0xf955('0x3c')]};return db[_0xf955('0x2e')][_0xf955('0x1e')](_0xe633fa)[_0xf955('0x24')](function(_0x47651b){_0x227104[_0xf955('0x1e')]=_0x47651b;if(_0x1ef794[_0xf955('0x33')][_0xf955('0x42')]){_0x3a951c[_0xf955('0x43')]=[{'all':!![]}];}return db[_0xf955('0x2e')][_0xf955('0x44')](_0x3a951c);})[_0xf955('0x24')](function(_0x356ec2){_0x227104[_0xf955('0x45')]=_0x356ec2;return _0x227104;})[_0xf955('0x24')](respondWithFilteredResult(_0x59bfb5,_0x3a951c))['catch'](handleError(_0x59bfb5,null));};exports[_0xf955('0x46')]=function(_0x25d809,_0x2db18d){var _0x5f0ef9={'raw':!![],'where':{'id':_0x25d809['params']['id']}},_0x16fc1a={};_0x16fc1a[_0xf955('0x32')]=_['keys'](db[_0xf955('0x2e')][_0xf955('0x2f')]);_0x16fc1a[_0xf955('0x33')]=_[_0xf955('0x47')](_0x25d809['query']);_0x16fc1a[_0xf955('0x34')]=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],_0x16fc1a['query']);_0x5f0ef9['attributes']=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],qs[_0xf955('0x36')](_0x25d809[_0xf955('0x33')]['fields']));_0x5f0ef9[_0xf955('0x37')]=_0x5f0ef9[_0xf955('0x37')][_0xf955('0x38')]?_0x5f0ef9['attributes']:_0x16fc1a[_0xf955('0x32')];if(_0x25d809['query'][_0xf955('0x42')]){_0x5f0ef9[_0xf955('0x43')]=[{'all':!![]}];}_0x5f0ef9=_[_0xf955('0x3f')]({},_0x5f0ef9,_0x25d809['options']);return db[_0xf955('0x2e')][_0xf955('0x48')](_0x5f0ef9)[_0xf955('0x24')](handleEntityNotFound(_0x2db18d,null))[_0xf955('0x24')](respondWithResult(_0x2db18d,null))['catch'](handleError(_0x2db18d,null));};exports[_0xf955('0x49')]=function(_0x4ff0f1,_0x1c6d76){return db[_0xf955('0x2e')][_0xf955('0x49')](_0x4ff0f1['body'],{})[_0xf955('0x24')](function(_0x4e7269){var _0x35c23c=_0x4ff0f1['user'][_0xf955('0x26')]({'plain':!![]});if(!_0x35c23c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c23c['role']===_0xf955('0x4a')){var _0x45c7fe=_0x4e7269['get']({'plain':!![]});var _0x142e8f='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x142e8f,'userProfileId':_0x35c23c['userProfileId']},'raw':!![]})[_0xf955('0x24')](function(_0x1abe1c){if(_0x1abe1c&&_0x1abe1c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf955('0x49')]({'name':_0x45c7fe[_0xf955('0x2a')],'resourceId':_0x45c7fe['id'],'type':_0x1abe1c[_0xf955('0x2a')],'sectionId':_0x1abe1c['id']},{})[_0xf955('0x24')](function(){return _0x4e7269;});}else{return _0x4e7269;}})[_0xf955('0x4b')](function(_0xa56483){logger[_0xf955('0x4c')](_0xf955('0x4d'),_0xa56483);throw _0xa56483;});}return _0x4e7269;})[_0xf955('0x24')](respondWithResult(_0x1c6d76,0xc9))[_0xf955('0x4b')](handleError(_0x1c6d76,null));};exports[_0xf955('0x23')]=function(_0x350873,_0x47a3a6){if(_0x350873[_0xf955('0x4e')]['id']){delete _0x350873[_0xf955('0x4e')]['id'];}return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x350873[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47a3a6,null))[_0xf955('0x24')](saveUpdates(_0x350873[_0xf955('0x4e')],null))[_0xf955('0x24')](respondWithResult(_0x47a3a6,null))[_0xf955('0x4b')](handleError(_0x47a3a6,null));};exports[_0xf955('0x25')]=function(_0x9057df,_0x228d59){return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x9057df[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x228d59,null))[_0xf955('0x24')](db[_0xf955('0x50')][_0xf955('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x9057df[_0xf955('0x4f')]['id']}}))[_0xf955('0x24')](removeEntity(_0x228d59,null))[_0xf955('0x4b')](handleError(_0x228d59,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 353e09f..83c4431 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa196=['bluebird','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x4287fe,_0x14ad49){var _0x329a39=function(_0x3c30a9){while(--_0x3c30a9){_0x4287fe['push'](_0x4287fe['shift']());}};_0x329a39(++_0x14ad49);}(_0xa196,0x1f0));var _0x6a19=function(_0x2b1b6e,_0x5703bb){_0x2b1b6e=_0x2b1b6e-0x0;var _0xc8f810=_0xa196[_0x2b1b6e];return _0xc8f810;};'use strict';var _=require(_0x6a19('0x0'));var util=require(_0x6a19('0x1'));var logger=require(_0x6a19('0x2'))(_0x6a19('0x3'));var moment=require('moment');var BPromise=require(_0x6a19('0x4'));var rp=require(_0x6a19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a19('0x6'));var config=require(_0x6a19('0x7'));var attributes=require(_0x6a19('0x8'));module[_0x6a19('0x9')]=function(_0x40bba7,_0xa55607){return _0x40bba7['define']('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d48=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','define'];(function(_0x1c2d88,_0x969c07){var _0x5a2c9f=function(_0xe6420f){while(--_0xe6420f){_0x1c2d88['push'](_0x1c2d88['shift']());}};_0x5a2c9f(++_0x969c07);}(_0x1d48,0x129));var _0x81d4=function(_0x2683e7,_0x36cb22){_0x2683e7=_0x2683e7-0x0;var _0x397e26=_0x1d48[_0x2683e7];return _0x397e26;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x81d4('0x0'))(_0x81d4('0x1'));var moment=require(_0x81d4('0x2'));var BPromise=require('bluebird');var rp=require(_0x81d4('0x3'));var fs=require('fs');var path=require(_0x81d4('0x4'));var rimraf=require(_0x81d4('0x5'));var config=require(_0x81d4('0x6'));var attributes=require(_0x81d4('0x7'));module['exports']=function(_0x3ecb19,_0x52160a){return _0x3ecb19[_0x81d4('0x8')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index d16a492..ac1a6ee 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08ff=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x271e94,_0x3f0a3c){var _0x4ff072=function(_0xc3d40a){while(--_0xc3d40a){_0x271e94['push'](_0x271e94['shift']());}};_0x4ff072(++_0x3f0a3c);}(_0x08ff,0x72));var _0xf08f=function(_0x41e393,_0x35417e){_0x41e393=_0x41e393-0x0;var _0x27db09=_0x08ff[_0x41e393];return _0x27db09;};'use strict';var _=require(_0xf08f('0x0'));var util=require(_0xf08f('0x1'));var moment=require(_0xf08f('0x2'));var BPromise=require(_0xf08f('0x3'));var rs=require(_0xf08f('0x4'));var fs=require('fs');var Redis=require(_0xf08f('0x5'));var db=require(_0xf08f('0x6'))['db'];var utils=require(_0xf08f('0x7'));var logger=require('../../config/logger')(_0xf08f('0x8'));var config=require(_0xf08f('0x9'));var jayson=require(_0xf08f('0xa'));var client=jayson[_0xf08f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f3e3,_0x3e73b6,_0x423606){return new BPromise(function(_0x61cf64,_0x2679b6){return client[_0xf08f('0xc')](_0x54f3e3,_0x423606)[_0xf08f('0xd')](function(_0x202f7a){logger[_0xf08f('0xe')](_0xf08f('0xf'),_0x3e73b6,'request\x20sent');logger['debug'](_0xf08f('0x10'),_0x3e73b6,_0xf08f('0x11'),JSON[_0xf08f('0x12')](_0x202f7a));if(_0x202f7a[_0xf08f('0x13')]){if(_0x202f7a[_0xf08f('0x13')][_0xf08f('0x14')]===0x1f4){logger[_0xf08f('0x13')](_0xf08f('0xf'),_0x3e73b6,_0x202f7a[_0xf08f('0x13')]['message']);return _0x2679b6(_0x202f7a['error'][_0xf08f('0x15')]);}logger['error'](_0xf08f('0xf'),_0x3e73b6,_0x202f7a[_0xf08f('0x13')]['message']);return _0x61cf64(_0x202f7a[_0xf08f('0x13')][_0xf08f('0x15')]);}else{logger[_0xf08f('0xe')](_0xf08f('0xf'),_0x3e73b6,_0xf08f('0x11'));_0x61cf64(_0x202f7a[_0xf08f('0x16')]['message']);}})['catch'](function(_0x5ce845){logger[_0xf08f('0x13')]('ContactItemType,\x20%s,\x20%s',_0x3e73b6,_0x5ce845);_0x2679b6(_0x5ce845);});});} \ No newline at end of file +var _0xce5b=['client','http','info','ContactItemType,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x5df584,_0x1279d3){var _0x283d94=function(_0x39aca9){while(--_0x39aca9){_0x5df584['push'](_0x5df584['shift']());}};_0x283d94(++_0x1279d3);}(_0xce5b,0x76));var _0xbce5=function(_0x3329bf,_0x121dc3){_0x3329bf=_0x3329bf-0x0;var _0x56d49c=_0xce5b[_0x3329bf];return _0x56d49c;};'use strict';var _=require(_0xbce5('0x0'));var util=require(_0xbce5('0x1'));var moment=require(_0xbce5('0x2'));var BPromise=require(_0xbce5('0x3'));var rs=require(_0xbce5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbce5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce5('0x6'))(_0xbce5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbce5('0x8')][_0xbce5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45a360,_0x2e2d25,_0xbf3f37){return new BPromise(function(_0x48dabf,_0x529566){return client['request'](_0x45a360,_0xbf3f37)['then'](function(_0x2721bb){logger[_0xbce5('0xa')](_0xbce5('0xb'),_0x2e2d25,'request\x20sent');logger[_0xbce5('0xc')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x2e2d25,_0xbce5('0xd'),JSON['stringify'](_0x2721bb));if(_0x2721bb[_0xbce5('0xe')]){if(_0x2721bb[_0xbce5('0xe')][_0xbce5('0xf')]===0x1f4){logger[_0xbce5('0xe')](_0xbce5('0xb'),_0x2e2d25,_0x2721bb[_0xbce5('0xe')][_0xbce5('0x10')]);return _0x529566(_0x2721bb['error']['message']);}logger[_0xbce5('0xe')](_0xbce5('0xb'),_0x2e2d25,_0x2721bb[_0xbce5('0xe')]['message']);return _0x48dabf(_0x2721bb[_0xbce5('0xe')][_0xbce5('0x10')]);}else{logger[_0xbce5('0xa')]('ContactItemType,\x20%s,\x20%s',_0x2e2d25,_0xbce5('0xd'));_0x48dabf(_0x2721bb[_0xbce5('0x11')][_0xbce5('0x10')]);}})['catch'](function(_0x5e0236){logger['error'](_0xbce5('0xb'),_0x2e2d25,_0x5e0236);_0x529566(_0x5e0236);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 0037285..fd67bd3 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61b6=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x26ec0e,_0x55d2e3){var _0x4da538=function(_0x2aecf0){while(--_0x2aecf0){_0x26ec0e['push'](_0x26ec0e['shift']());}};_0x4da538(++_0x55d2e3);}(_0x61b6,0x18d));var _0x661b=function(_0x1cbac5,_0x4647d1){_0x1cbac5=_0x1cbac5-0x0;var _0x45d333=_0x61b6[_0x1cbac5];return _0x45d333;};'use strict';var multer=require(_0x661b('0x0'));var util=require(_0x661b('0x1'));var path=require(_0x661b('0x2'));var timeout=require(_0x661b('0x3'));var express=require(_0x661b('0x4'));var router=express['Router']();var fs_extra=require(_0x661b('0x5'));var auth=require(_0x661b('0x6'));var interaction=require(_0x661b('0x7'));var config=require('../../config/environment');var controller=require(_0x661b('0x8'));router[_0x661b('0x9')]('/',auth[_0x661b('0xa')](),controller[_0x661b('0xb')]);router[_0x661b('0x9')](_0x661b('0xc'),auth['isAuthenticated'](),controller[_0x661b('0xd')]);router[_0x661b('0xe')]('/',auth[_0x661b('0xa')](),controller['create']);router[_0x661b('0xf')]('/:id',auth[_0x661b('0xa')](),controller[_0x661b('0x10')]);router[_0x661b('0x11')]('/:id',auth[_0x661b('0xa')](),controller[_0x661b('0x12')]);module[_0x661b('0x13')]=router; \ No newline at end of file +var _0x9219=['/:id','update','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','isAuthenticated','create','put'];(function(_0x460498,_0x376c49){var _0x2730c3=function(_0x4a9a90){while(--_0x4a9a90){_0x460498['push'](_0x460498['shift']());}};_0x2730c3(++_0x376c49);}(_0x9219,0x73));var _0x9921=function(_0x126cfc,_0x528b1c){_0x126cfc=_0x126cfc-0x0;var _0x43c787=_0x9219[_0x126cfc];return _0x43c787;};'use strict';var multer=require(_0x9921('0x0'));var util=require(_0x9921('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9921('0x2'));var router=express[_0x9921('0x3')]();var fs_extra=require(_0x9921('0x4'));var auth=require(_0x9921('0x5'));var interaction=require(_0x9921('0x6'));var config=require('../../config/environment');var controller=require(_0x9921('0x7'));router['get']('/',auth[_0x9921('0x8')](),controller['index']);router['get']('/:id',auth[_0x9921('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9921('0x9')]);router[_0x9921('0xa')](_0x9921('0xb'),auth[_0x9921('0x8')](),controller[_0x9921('0xc')]);router['delete'](_0x9921('0xb'),auth[_0x9921('0x8')](),controller[_0x9921('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 0474803..62d0744 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 _0xbaf0=['name','exports','STRING'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 +var _0x2032=['name','exports','STRING'];(function(_0x526ee4,_0x4cad06){var _0x5c5d52=function(_0x2ee422){while(--_0x2ee422){_0x526ee4['push'](_0x526ee4['shift']());}};_0x5c5d52(++_0x4cad06);}(_0x2032,0xd9));var _0x2203=function(_0x3cbe09,_0x17164f){_0x3cbe09=_0x3cbe09-0x0;var _0x14245e=_0x2032[_0x3cbe09];return _0x14245e;};'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 9b3513c..0effdde 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 _0x2c5e=['attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboard.socket','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','key','query','keys','filters','model','fields','attributes','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1'];(function(_0x6b48b0,_0x29e7bb){var _0x47318e=function(_0x51f9d8){while(--_0x51f9d8){_0x6b48b0['push'](_0x6b48b0['shift']());}};_0x47318e(++_0x29e7bb);}(_0x2c5e,0x181));var _0xe2c5=function(_0x46ef1e,_0x57d69b){_0x46ef1e=_0x46ef1e-0x0;var _0x34d2cf=_0x2c5e[_0x46ef1e];return _0x34d2cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2c5('0x0'));var zipdir=require(_0xe2c5('0x1'));var jsonpatch=require(_0xe2c5('0x2'));var rp=require(_0xe2c5('0x3'));var moment=require(_0xe2c5('0x4'));var BPromise=require(_0xe2c5('0x5'));var Mustache=require(_0xe2c5('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe2c5('0x7'));var csv=require(_0xe2c5('0x8'));var ejs=require(_0xe2c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe2c5('0xa'));var crypto=require(_0xe2c5('0xb'));var jsforce=require(_0xe2c5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe2c5('0x8'));var querystring=require(_0xe2c5('0xd'));var Papa=require(_0xe2c5('0xe'));var Redis=require(_0xe2c5('0xf'));var authService=require(_0xe2c5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe2c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe2c5('0x12'));var utils=require(_0xe2c5('0x13'));var config=require(_0xe2c5('0x14'));var licenseUtil=require(_0xe2c5('0x15'));var db=require('../../mysqldb')['db'];config[_0xe2c5('0x16')]=_[_0xe2c5('0x17')](config[_0xe2c5('0x16')],{'host':_0xe2c5('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe2c5('0x19'))['register'](socket);function respondWithStatusCode(_0x3dead0,_0xb84ee9){_0xb84ee9=_0xb84ee9||0xcc;return function(_0x43df6a){if(_0x43df6a){return _0x3dead0[_0xe2c5('0x1a')](_0xb84ee9);}return _0x3dead0[_0xe2c5('0x1b')](_0xb84ee9)['end']();};}function respondWithResult(_0x39472f,_0x14aba6){_0x14aba6=_0x14aba6||0xc8;return function(_0x408e4d){if(_0x408e4d){return _0x39472f['status'](_0x14aba6)[_0xe2c5('0x1c')](_0x408e4d);}};}function respondWithFilteredResult(_0x56e73d,_0x43f6e6){return function(_0x29162f){if(_0x29162f){var _0x340438=typeof _0x43f6e6[_0xe2c5('0x1d')]==='undefined'&&typeof _0x43f6e6['limit']==='undefined';var _0x27990e=_0x29162f[_0xe2c5('0x1e')];var _0x163a08=_0x340438?0x0:_0x43f6e6['offset'];var _0x52cfe4=_0x340438?_0x29162f['count']:_0x43f6e6[_0xe2c5('0x1d')]+_0x43f6e6[_0xe2c5('0x1f')];var _0x72f398;if(_0x52cfe4>=_0x27990e){_0x52cfe4=_0x27990e;_0x72f398=0xc8;}else{_0x72f398=0xce;}_0x56e73d[_0xe2c5('0x1b')](_0x72f398);return _0x56e73d[_0xe2c5('0x20')](_0xe2c5('0x21'),_0x163a08+'-'+_0x52cfe4+'/'+_0x27990e)[_0xe2c5('0x1c')](_0x29162f);}return null;};}function patchUpdates(_0x531714){return function(_0x560e02){try{jsonpatch[_0xe2c5('0x22')](_0x560e02,_0x531714,!![]);}catch(_0x5f3bc2){return BPromise[_0xe2c5('0x23')](_0x5f3bc2);}return _0x560e02[_0xe2c5('0x24')]();};}function saveUpdates(_0x435ccc,_0x3993a7){return function(_0x5a6084){if(_0x5a6084){return _0x5a6084[_0xe2c5('0x25')](_0x435ccc)[_0xe2c5('0x26')](function(_0x4b60c5){return _0x4b60c5;});}return null;};}function removeEntity(_0x5d882a,_0x10749e){return function(_0x5d2888){if(_0x5d2888){return _0x5d2888[_0xe2c5('0x27')]()[_0xe2c5('0x26')](function(){var _0x5de39e=_0x5d2888[_0xe2c5('0x28')]({'plain':!![]});var _0x422261='CustomDashboards';return db[_0xe2c5('0x29')]['destroy']({'where':{'type':_0x422261,'resourceId':_0x5de39e['id']}})[_0xe2c5('0x26')](function(){return _0x5d2888;});})[_0xe2c5('0x26')](function(){_0x5d882a[_0xe2c5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32816e,_0x2dfb96){return function(_0x1f638f){if(!_0x1f638f){_0x32816e[_0xe2c5('0x1a')](0x194);}return _0x1f638f;};}function handleError(_0x2587a6,_0x39c311){_0x39c311=_0x39c311||0x1f4;return function(_0x41c96c){logger[_0xe2c5('0x2a')](_0x41c96c[_0xe2c5('0x2b')]);if(_0x41c96c[_0xe2c5('0x2c')]){delete _0x41c96c[_0xe2c5('0x2c')];}_0x2587a6['status'](_0x39c311)['send'](_0x41c96c);};}exports[_0xe2c5('0x2d')]=function(_0x1e6e1d,_0x515f00){var _0x2b7611={},_0x1320ba={},_0x5a65cf={'count':0x0,'rows':[]};var _0x2f474b=_[_0xe2c5('0x2e')](db[_0xe2c5('0x2f')][_0xe2c5('0x30')],function(_0x5907a6){return{'name':_0x5907a6['fieldName'],'type':_0x5907a6['type'][_0xe2c5('0x31')]};});_0x1320ba['model']=_[_0xe2c5('0x2e')](_0x2f474b,_0xe2c5('0x2c'));_0x1320ba[_0xe2c5('0x32')]=_[_0xe2c5('0x33')](_0x1e6e1d[_0xe2c5('0x32')]);_0x1320ba[_0xe2c5('0x34')]=_['intersection'](_0x1320ba['model'],_0x1320ba[_0xe2c5('0x32')]);_0x2b7611['attributes']=_['intersection'](_0x1320ba[_0xe2c5('0x35')],qs[_0xe2c5('0x36')](_0x1e6e1d[_0xe2c5('0x32')][_0xe2c5('0x36')]));_0x2b7611['attributes']=_0x2b7611[_0xe2c5('0x37')]['length']?_0x2b7611[_0xe2c5('0x37')]:_0x1320ba['model'];if(!_0x1e6e1d[_0xe2c5('0x32')]['hasOwnProperty']('nolimit')){_0x2b7611[_0xe2c5('0x1f')]=qs['limit'](_0x1e6e1d[_0xe2c5('0x32')]['limit']);_0x2b7611[_0xe2c5('0x1d')]=qs['offset'](_0x1e6e1d[_0xe2c5('0x32')]['offset']);}_0x2b7611[_0xe2c5('0x38')]=qs['sort'](_0x1e6e1d['query'][_0xe2c5('0x39')]);_0x2b7611['where']=qs[_0xe2c5('0x34')](_[_0xe2c5('0x3a')](_0x1e6e1d['query'],_0x1320ba['filters']),_0x2f474b);if(_0x1e6e1d['query'][_0xe2c5('0x3b')]){_0x2b7611[_0xe2c5('0x3c')]=_[_0xe2c5('0x3d')](_0x2b7611[_0xe2c5('0x3c')],{'$or':_['map'](_0x2f474b,function(_0x380390){if(_0x380390['type']!==_0xe2c5('0x3e')){var _0xbde236={};_0xbde236[_0x380390[_0xe2c5('0x2c')]]={'$like':'%'+_0x1e6e1d[_0xe2c5('0x32')][_0xe2c5('0x3b')]+'%'};return _0xbde236;}})});}_0x2b7611=_['merge']({},_0x2b7611,_0x1e6e1d[_0xe2c5('0x3f')]);var _0x889c7f={'where':_0x2b7611[_0xe2c5('0x3c')]};return db[_0xe2c5('0x2f')]['count'](_0x889c7f)['then'](function(_0x4df152){_0x5a65cf[_0xe2c5('0x1e')]=_0x4df152;if(_0x1e6e1d['query'][_0xe2c5('0x40')]){_0x2b7611[_0xe2c5('0x41')]=[{'all':!![]}];}return db[_0xe2c5('0x2f')][_0xe2c5('0x42')](_0x2b7611);})['then'](function(_0x542c68){_0x5a65cf['rows']=_0x542c68;return _0x5a65cf;})[_0xe2c5('0x26')](respondWithFilteredResult(_0x515f00,_0x2b7611))[_0xe2c5('0x43')](handleError(_0x515f00,null));};exports['show']=function(_0x56857d,_0x305eb8){var _0x480c9b={'raw':![],'where':{'id':_0x56857d[_0xe2c5('0x44')]['id']}},_0x2315d3={};_0x2315d3['model']=_[_0xe2c5('0x33')](db[_0xe2c5('0x2f')]['rawAttributes']);_0x2315d3['query']=_[_0xe2c5('0x33')](_0x56857d[_0xe2c5('0x32')]);_0x2315d3[_0xe2c5('0x34')]=_[_0xe2c5('0x45')](_0x2315d3['model'],_0x2315d3[_0xe2c5('0x32')]);_0x480c9b[_0xe2c5('0x37')]=_[_0xe2c5('0x45')](_0x2315d3['model'],qs[_0xe2c5('0x36')](_0x56857d[_0xe2c5('0x32')]['fields']));_0x480c9b[_0xe2c5('0x37')]=_0x480c9b[_0xe2c5('0x37')][_0xe2c5('0x46')]?_0x480c9b[_0xe2c5('0x37')]:_0x2315d3[_0xe2c5('0x35')];if(_0x56857d[_0xe2c5('0x32')][_0xe2c5('0x40')]){_0x480c9b[_0xe2c5('0x41')]=[{'all':!![]}];}_0x480c9b=_[_0xe2c5('0x3d')]({},_0x480c9b,_0x56857d[_0xe2c5('0x3f')]);return db[_0xe2c5('0x2f')][_0xe2c5('0x47')](_0x480c9b)['then'](handleEntityNotFound(_0x305eb8,null))[_0xe2c5('0x26')](respondWithResult(_0x305eb8,null))[_0xe2c5('0x43')](handleError(_0x305eb8,null));};exports[_0xe2c5('0x48')]=function(_0x40a641,_0x108329){return db[_0xe2c5('0x2f')][_0xe2c5('0x48')](_0x40a641[_0xe2c5('0x49')],{})[_0xe2c5('0x26')](function(_0x169d09){var _0x4d52ab=_0x40a641[_0xe2c5('0x4a')][_0xe2c5('0x28')]({'plain':!![]});if(!_0x4d52ab)throw new Error(_0xe2c5('0x4b'));if(_0x4d52ab['role']==='user'){var _0x17fcd4=_0x169d09[_0xe2c5('0x28')]({'plain':!![]});var _0x102537=_0xe2c5('0x4c');return db[_0xe2c5('0x4d')][_0xe2c5('0x47')]({'where':{'name':_0x102537,'userProfileId':_0x4d52ab[_0xe2c5('0x4e')]},'raw':!![]})['then'](function(_0x347686){if(_0x347686&&_0x347686[_0xe2c5('0x4f')]===0x0){return db[_0xe2c5('0x29')][_0xe2c5('0x48')]({'name':_0x17fcd4[_0xe2c5('0x2c')],'resourceId':_0x17fcd4['id'],'type':_0x347686[_0xe2c5('0x2c')],'sectionId':_0x347686['id']},{})[_0xe2c5('0x26')](function(){return _0x169d09;});}else{return _0x169d09;}})[_0xe2c5('0x43')](function(_0x8cf475){logger[_0xe2c5('0x2a')](_0xe2c5('0x50'),_0x8cf475);throw _0x8cf475;});}return _0x169d09;})[_0xe2c5('0x26')](respondWithResult(_0x108329,0xc9))['catch'](handleError(_0x108329,null));};exports[_0xe2c5('0x51')]=function(_0x3a7d97,_0x19b9bc){var _0x1679cd={'where':{'id':_0x3a7d97[_0xe2c5('0x44')]['id']}},_0x278aae={};_0x278aae[_0xe2c5('0x35')]=_['keys'](db[_0xe2c5('0x2f')]['rawAttributes']);_0x1679cd[_0xe2c5('0x37')]=_[_0xe2c5('0x45')](_0x278aae['model'],qs[_0xe2c5('0x36')](_0x3a7d97[_0xe2c5('0x32')][_0xe2c5('0x36')]));_0x1679cd['attributes']=_0x1679cd[_0xe2c5('0x37')][_0xe2c5('0x46')]?_0x1679cd[_0xe2c5('0x37')]:_0x278aae['model'];if(_0x3a7d97[_0xe2c5('0x32')]['includeAll']){_0x1679cd[_0xe2c5('0x41')]=[{'all':!![]}];}_0x1679cd=_['merge']({},_0x1679cd,_0x3a7d97[_0xe2c5('0x3f')]);return db[_0xe2c5('0x2f')]['find'](_0x1679cd)[_0xe2c5('0x26')](handleEntityNotFound(_0x19b9bc,null))['then'](function(_0x4779f3){if(_0x4779f3){var _0x1d0f5e=_0x4779f3[_0xe2c5('0x28')]({'plain':!![]});_0x1d0f5e=qs[_0xe2c5('0x52')](_0x1d0f5e,['id',_0xe2c5('0x53'),'updatedAt']);_0x3a7d97[_0xe2c5('0x49')]=_['omit'](_0x3a7d97[_0xe2c5('0x49')],['id','createdAt',_0xe2c5('0x54')]);return db[_0xe2c5('0x2f')]['create'](_[_0xe2c5('0x3d')](_0x1d0f5e,_0x3a7d97[_0xe2c5('0x49')]),{'include':_0x3a7d97[_0xe2c5('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xe2c5('0x26')](function(_0x2ecbee){var _0x5178eb=_0x3a7d97['user'][_0xe2c5('0x28')]({'plain':!![]});if(!_0x5178eb)throw new Error(_0xe2c5('0x4b'));if(_0x5178eb[_0xe2c5('0x55')]===_0xe2c5('0x4a')){var _0x11e65f=_0x2ecbee[_0xe2c5('0x28')]({'plain':!![]});var _0x2d1580=_0xe2c5('0x4c');return db['UserProfileSection'][_0xe2c5('0x47')]({'where':{'name':_0x2d1580,'userProfileId':_0x5178eb[_0xe2c5('0x4e')]},'raw':!![]})['then'](function(_0x83a82f){if(_0x83a82f&&_0x83a82f[_0xe2c5('0x4f')]===0x0){return db['UserProfileResource'][_0xe2c5('0x48')]({'name':_0x11e65f[_0xe2c5('0x2c')],'resourceId':_0x11e65f['id'],'type':_0x83a82f[_0xe2c5('0x2c')],'sectionId':_0x83a82f['id']},{})['then'](function(){return _0x2ecbee;});}else{return _0x2ecbee;}})[_0xe2c5('0x43')](function(_0x38773c){logger[_0xe2c5('0x2a')](_0xe2c5('0x50'),_0x38773c);throw _0x38773c;});}return _0x2ecbee;});}})['then'](respondWithResult(_0x19b9bc,0xc9))[_0xe2c5('0x43')](handleError(_0x19b9bc,null));};exports['update']=function(_0x131e12,_0x347fd8){if(_0x131e12[_0xe2c5('0x49')]['id']){delete _0x131e12[_0xe2c5('0x49')]['id'];}return db[_0xe2c5('0x2f')][_0xe2c5('0x47')]({'where':{'id':_0x131e12[_0xe2c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x347fd8,null))[_0xe2c5('0x26')](saveUpdates(_0x131e12[_0xe2c5('0x49')],null))[_0xe2c5('0x26')](respondWithResult(_0x347fd8,null))['catch'](handleError(_0x347fd8,null));};exports[_0xe2c5('0x27')]=function(_0x4af9e6,_0x5c08f9){return db[_0xe2c5('0x2f')][_0xe2c5('0x47')]({'where':{'id':_0x4af9e6[_0xe2c5('0x44')]['id']}})[_0xe2c5('0x26')](handleEntityNotFound(_0x5c08f9,null))[_0xe2c5('0x26')](removeEntity(_0x5c08f9,null))[_0xe2c5('0x43')](handleError(_0x5c08f9,null));};function widgetAttributes(_0x3bb69b){try{switch(_0x3bb69b['type']){case _0xe2c5('0x56'):return[{'name':'attrUrl','value':_0x3bb69b[_0xe2c5('0x57')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x0]?_0x3bb69b['attrs'][0x0]['value']:undefined)||'https://'}];case _0xe2c5('0x59'):return[{'name':_0xe2c5('0x5a'),'value':_0x3bb69b[_0xe2c5('0x5a')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x0]?_0x3bb69b[_0xe2c5('0x58')][0x0][_0xe2c5('0x5b')]:undefined)||''}];case _0xe2c5('0x5c'):return[{'name':_0xe2c5('0x5d'),'value':_0x3bb69b[_0xe2c5('0x5d')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x0]?_0x3bb69b[_0xe2c5('0x58')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xe2c5('0x5e'),'value':_0x3bb69b[_0xe2c5('0x5e')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x1]?_0x3bb69b[_0xe2c5('0x58')][0x1][_0xe2c5('0x5b')]:undefined)||_0xe2c5('0x5f')},{'name':_0xe2c5('0x60'),'value':_0x3bb69b[_0xe2c5('0x60')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x2]?_0x3bb69b[_0xe2c5('0x58')][0x2][_0xe2c5('0x5b')]:undefined)||0xc}];case _0xe2c5('0x61'):return[{'name':_0xe2c5('0x62'),'value':_0x3bb69b[_0xe2c5('0x62')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b['attrs'][0x0]?_0x3bb69b[_0xe2c5('0x58')][0x0]['value']:undefined)||_0xe2c5('0x63')},{'name':_0xe2c5('0x64'),'value':_0x3bb69b[_0xe2c5('0x64')]||(_0x3bb69b['attrs']&&_0x3bb69b[_0xe2c5('0x58')][0x1]?_0x3bb69b['attrs'][0x1]['value']:undefined)||[]},{'name':_0xe2c5('0x60'),'value':_0x3bb69b[_0xe2c5('0x60')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x2]?_0x3bb69b[_0xe2c5('0x58')][0x2][_0xe2c5('0x5b')]:undefined)||0x14},{'name':_0xe2c5('0x65'),'value':_0x3bb69b[_0xe2c5('0x65')]||(_0x3bb69b['attrs']&&_0x3bb69b[_0xe2c5('0x58')][0x3]?_0x3bb69b[_0xe2c5('0x58')][0x3]['value']:undefined)||_0xe2c5('0x66')},{'name':_0xe2c5('0x67'),'value':_0x3bb69b[_0xe2c5('0x67')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x4]?_0x3bb69b[_0xe2c5('0x58')][0x4]['value']:undefined)||''},{'name':_0xe2c5('0x68'),'value':_0x3bb69b[_0xe2c5('0x68')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x5]?_0x3bb69b[_0xe2c5('0x58')][0x5][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x69'),'value':_0x3bb69b['attrSmsAccounts']||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x6]?_0x3bb69b[_0xe2c5('0x58')][0x6][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x6a'),'value':_0x3bb69b[_0xe2c5('0x6a')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x7]?_0x3bb69b['attrs'][0x7][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x6b'),'value':_0x3bb69b[_0xe2c5('0x6b')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x8]?_0x3bb69b[_0xe2c5('0x58')][0x8][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x6c'),'value':_0x3bb69b[_0xe2c5('0x6c')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x9]?_0x3bb69b['attrs'][0x9]['value']:undefined)||''}];case'multibar-chart':case _0xe2c5('0x6d'):return[{'name':_0xe2c5('0x6e'),'value':_0x3bb69b[_0xe2c5('0x6e')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x0]?_0x3bb69b['attrs'][0x0][_0xe2c5('0x5b')]:undefined)||_0xe2c5('0x63')},{'name':_0xe2c5('0x6f'),'value':_0x3bb69b[_0xe2c5('0x6f')]||(_0x3bb69b['attrs']&&_0x3bb69b[_0xe2c5('0x58')][0x1]?_0x3bb69b[_0xe2c5('0x58')][0x1][_0xe2c5('0x5b')]:undefined)||null},{'name':_0xe2c5('0x70'),'value':_0x3bb69b[_0xe2c5('0x70')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x2]?_0x3bb69b[_0xe2c5('0x58')][0x2]['value']:undefined)||null},{'name':_0xe2c5('0x64'),'value':_0x3bb69b[_0xe2c5('0x64')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b['attrs'][0x3]?_0x3bb69b['attrs'][0x3][_0xe2c5('0x5b')]:undefined)||[]},{'name':_0xe2c5('0x65'),'value':_0x3bb69b['attrChannel']||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b['attrs'][0x4]?_0x3bb69b[_0xe2c5('0x58')][0x4][_0xe2c5('0x5b')]:undefined)||_0xe2c5('0x66')},{'name':_0xe2c5('0x67'),'value':_0x3bb69b[_0xe2c5('0x67')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x5]?_0x3bb69b[_0xe2c5('0x58')][0x5][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x68'),'value':_0x3bb69b['attrFaxAccounts']||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x6]?_0x3bb69b[_0xe2c5('0x58')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x3bb69b[_0xe2c5('0x69')]||(_0x3bb69b['attrs']&&_0x3bb69b['attrs'][0x7]?_0x3bb69b[_0xe2c5('0x58')][0x7][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x6a'),'value':_0x3bb69b[_0xe2c5('0x6a')]||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x8]?_0x3bb69b[_0xe2c5('0x58')][0x8][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x6b'),'value':_0x3bb69b[_0xe2c5('0x6b')]||(_0x3bb69b['attrs']&&_0x3bb69b['attrs'][0x9]?_0x3bb69b[_0xe2c5('0x58')][0x9][_0xe2c5('0x5b')]:undefined)||''},{'name':_0xe2c5('0x6c'),'value':_0x3bb69b[_0xe2c5('0x6c')]||(_0x3bb69b['attrs']&&_0x3bb69b['attrs'][0xa]?_0x3bb69b[_0xe2c5('0x58')][0xa]['value']:undefined)||''}];case _0xe2c5('0x71'):return[{'name':_0xe2c5('0x72'),'type':_0x3bb69b['reportType']||(_0x3bb69b['attrs']&&_0x3bb69b['attrs'][0x0]?_0x3bb69b[_0xe2c5('0x58')][0x0][_0xe2c5('0x73')]:undefined)||null,'value':_0x3bb69b['attrReport']||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x0]?_0x3bb69b[_0xe2c5('0x58')][0x0][_0xe2c5('0x5b')]:undefined)||null},{'name':_0xe2c5('0x74'),'value':_0x3bb69b['attrRefresh']||(_0x3bb69b[_0xe2c5('0x58')]&&_0x3bb69b[_0xe2c5('0x58')][0x1]?_0x3bb69b[_0xe2c5('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x28bf59){logger[_0xe2c5('0x2a')](_0xe2c5('0x75'),JSON[_0xe2c5('0x76')](_0x28bf59));return[];}}exports['addItem']=function(_0x40849b,_0x2d749e,_0x405583){if(_0x40849b['body']['id']){delete _0x40849b['body']['id'];}return db[_0xe2c5('0x2f')][_0xe2c5('0x47')]({'where':{'id':_0x40849b[_0xe2c5('0x44')]['id']}})[_0xe2c5('0x26')](handleEntityNotFound(_0x2d749e,null))[_0xe2c5('0x26')](function(_0x4e0c19){if(_0x4e0c19){_0x40849b[_0xe2c5('0x49')][_0xe2c5('0x77')]=_0x4e0c19['id'];_0x40849b[_0xe2c5('0x49')][_0xe2c5('0x58')]=widgetAttributes(_0x40849b[_0xe2c5('0x49')]);return db[_0xe2c5('0x78')][_0xe2c5('0x48')](_0x40849b[_0xe2c5('0x49')]);}})['then'](respondWithResult(_0x2d749e,null))[_0xe2c5('0x43')](handleError(_0x2d749e,null));};exports[_0xe2c5('0x79')]=function(_0xff353d,_0x47b757,_0x3d8e0d){var _0x1890fe={};var _0x3cc245={};var _0x4478c3;var _0x2b9fb4;return db[_0xe2c5('0x2f')][_0xe2c5('0x7a')]({'where':{'id':_0xff353d[_0xe2c5('0x44')]['id']}})[_0xe2c5('0x26')](handleEntityNotFound(_0x47b757,null))[_0xe2c5('0x26')](function(_0x2bd39d){if(_0x2bd39d){_0x4478c3=_0x2bd39d;_0x3cc245[_0xe2c5('0x35')]=_[_0xe2c5('0x33')](db['DashboardItem'][_0xe2c5('0x30')]);_0x3cc245[_0xe2c5('0x32')]=_['keys'](_0xff353d['query']);_0x3cc245['filters']=_[_0xe2c5('0x45')](_0x3cc245['model'],_0x3cc245[_0xe2c5('0x32')]);_0x1890fe['attributes']=_[_0xe2c5('0x45')](_0x3cc245['model'],qs['fields'](_0xff353d[_0xe2c5('0x32')]['fields']));_0x1890fe[_0xe2c5('0x37')]=_0x1890fe[_0xe2c5('0x37')][_0xe2c5('0x46')]?_0x1890fe[_0xe2c5('0x37')]:_0x3cc245[_0xe2c5('0x35')];_0x1890fe['order']=qs[_0xe2c5('0x39')](_0xff353d[_0xe2c5('0x32')][_0xe2c5('0x39')]);_0x1890fe[_0xe2c5('0x3c')]=qs[_0xe2c5('0x34')](_[_0xe2c5('0x3a')](_0xff353d['query'],_0x3cc245['filters']));if(_0xff353d[_0xe2c5('0x32')]['filter']){_0x1890fe['where']=_['merge'](_0x1890fe[_0xe2c5('0x3c')],{'$or':_['map'](_0x1890fe[_0xe2c5('0x37')],function(_0x261ba9){var _0x3fd286={};_0x3fd286[_0x261ba9]={'$like':'%'+_0xff353d[_0xe2c5('0x32')]['filter']+'%'};return _0x3fd286;})});}_0x1890fe=_['merge']({},_0x1890fe,_0xff353d[_0xe2c5('0x3f')]);return _0x4478c3[_0xe2c5('0x79')](_0x1890fe);}})[_0xe2c5('0x26')](function(_0x1af378){if(_0x1af378){_0x2b9fb4=_0x1af378[_0xe2c5('0x46')];if(!_0xff353d[_0xe2c5('0x32')]['hasOwnProperty'](_0xe2c5('0x7b'))){_0x1890fe[_0xe2c5('0x1f')]=qs[_0xe2c5('0x1f')](_0xff353d[_0xe2c5('0x32')][_0xe2c5('0x1f')]);_0x1890fe['offset']=qs['offset'](_0xff353d[_0xe2c5('0x32')][_0xe2c5('0x1d')]);}return _0x4478c3[_0xe2c5('0x79')](_0x1890fe);}})['then'](function(_0x2b6d58){if(_0x2b6d58){return _0x2b6d58?{'count':_0x2b9fb4,'rows':_0x2b6d58}:null;}})[_0xe2c5('0x26')](respondWithResult(_0x47b757,null))[_0xe2c5('0x43')](handleError(_0x47b757,null));}; \ No newline at end of file +var _0x1152=['attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','pick','hasOwnProperty','nolimit','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','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','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset','undefined','count','limit','set','apply','then','destroy','CustomDashboards','UserProfileResource','end','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','find','create','body','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','get','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrOpenchannelAccounts','web-report','reportType','attrReport'];(function(_0x3af770,_0x1a957a){var _0x42c9a9=function(_0x2afac3){while(--_0x2afac3){_0x3af770['push'](_0x3af770['shift']());}};_0x42c9a9(++_0x1a957a);}(_0x1152,0x10b));var _0x2115=function(_0x329808,_0x343255){_0x329808=_0x329808-0x0;var _0x1bbad0=_0x1152[_0x329808];return _0x1bbad0;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2115('0x1'));var rp=require(_0x2115('0x2'));var moment=require(_0x2115('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2115('0x4'));var util=require(_0x2115('0x5'));var path=require('path');var sox=require(_0x2115('0x6'));var csv=require(_0x2115('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2115('0x8'));var squel=require(_0x2115('0x9'));var crypto=require(_0x2115('0xa'));var jsforce=require(_0x2115('0xb'));var deskjs=require(_0x2115('0xc'));var toCsv=require(_0x2115('0x7'));var querystring=require(_0x2115('0xd'));var Papa=require(_0x2115('0xe'));var Redis=require(_0x2115('0xf'));var authService=require(_0x2115('0x10'));var qs=require(_0x2115('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2115('0x12'));var logger=require('../../config/logger')(_0x2115('0x13'));var utils=require(_0x2115('0x14'));var config=require(_0x2115('0x15'));var licenseUtil=require(_0x2115('0x16'));var db=require('../../mysqldb')['db'];config[_0x2115('0x17')]=_[_0x2115('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2115('0x19'))(new Redis(config[_0x2115('0x17')]));require(_0x2115('0x1a'))['register'](socket);function respondWithStatusCode(_0x1130fc,_0x54e81e){_0x54e81e=_0x54e81e||0xcc;return function(_0x1230e8){if(_0x1230e8){return _0x1130fc[_0x2115('0x1b')](_0x54e81e);}return _0x1130fc['status'](_0x54e81e)['end']();};}function respondWithResult(_0x226c09,_0x167c26){_0x167c26=_0x167c26||0xc8;return function(_0x2be9d6){if(_0x2be9d6){return _0x226c09[_0x2115('0x1c')](_0x167c26)[_0x2115('0x1d')](_0x2be9d6);}};}function respondWithFilteredResult(_0x5337b5,_0x5d777b){return function(_0x58b3f6){if(_0x58b3f6){var _0x3200a0=typeof _0x5d777b[_0x2115('0x1e')]===_0x2115('0x1f')&&typeof _0x5d777b['limit']==='undefined';var _0x10d0cf=_0x58b3f6[_0x2115('0x20')];var _0x3f9ef0=_0x3200a0?0x0:_0x5d777b[_0x2115('0x1e')];var _0x495010=_0x3200a0?_0x58b3f6['count']:_0x5d777b[_0x2115('0x1e')]+_0x5d777b[_0x2115('0x21')];var _0x23e612;if(_0x495010>=_0x10d0cf){_0x495010=_0x10d0cf;_0x23e612=0xc8;}else{_0x23e612=0xce;}_0x5337b5[_0x2115('0x1c')](_0x23e612);return _0x5337b5[_0x2115('0x22')]('Content-Range',_0x3f9ef0+'-'+_0x495010+'/'+_0x10d0cf)[_0x2115('0x1d')](_0x58b3f6);}return null;};}function patchUpdates(_0x31524a){return function(_0x3f9b4e){try{jsonpatch[_0x2115('0x23')](_0x3f9b4e,_0x31524a,!![]);}catch(_0x5eccf8){return BPromise['reject'](_0x5eccf8);}return _0x3f9b4e['save']();};}function saveUpdates(_0x588490,_0x39e937){return function(_0x36aea8){if(_0x36aea8){return _0x36aea8['update'](_0x588490)[_0x2115('0x24')](function(_0x20e805){return _0x20e805;});}return null;};}function removeEntity(_0x1489a7,_0x27d496){return function(_0x2fd815){if(_0x2fd815){return _0x2fd815[_0x2115('0x25')]()['then'](function(){var _0x2ef6eb=_0x2fd815['get']({'plain':!![]});var _0x58844b=_0x2115('0x26');return db[_0x2115('0x27')]['destroy']({'where':{'type':_0x58844b,'resourceId':_0x2ef6eb['id']}})['then'](function(){return _0x2fd815;});})['then'](function(){_0x1489a7['status'](0xcc)[_0x2115('0x28')]();});}};}function handleEntityNotFound(_0x235acb,_0xe8623e){return function(_0x4d48d9){if(!_0x4d48d9){_0x235acb[_0x2115('0x1b')](0x194);}return _0x4d48d9;};}function handleError(_0x34dbbe,_0x4e2b46){_0x4e2b46=_0x4e2b46||0x1f4;return function(_0x41d8b0){logger['error'](_0x41d8b0[_0x2115('0x29')]);if(_0x41d8b0[_0x2115('0x2a')]){delete _0x41d8b0['name'];}_0x34dbbe[_0x2115('0x1c')](_0x4e2b46)[_0x2115('0x2b')](_0x41d8b0);};}exports[_0x2115('0x2c')]=function(_0x4c9a4e,_0xb82d54){var _0x1e31a5={},_0x1d69af={},_0x5c67a8={'count':0x0,'rows':[]};var _0x402cfd=_[_0x2115('0x2d')](db[_0x2115('0x2e')][_0x2115('0x2f')],function(_0x1b32e3){return{'name':_0x1b32e3[_0x2115('0x30')],'type':_0x1b32e3[_0x2115('0x31')][_0x2115('0x32')]};});_0x1d69af[_0x2115('0x33')]=_[_0x2115('0x2d')](_0x402cfd,_0x2115('0x2a'));_0x1d69af[_0x2115('0x34')]=_[_0x2115('0x35')](_0x4c9a4e[_0x2115('0x34')]);_0x1d69af[_0x2115('0x36')]=_[_0x2115('0x37')](_0x1d69af[_0x2115('0x33')],_0x1d69af[_0x2115('0x34')]);_0x1e31a5[_0x2115('0x38')]=_[_0x2115('0x37')](_0x1d69af[_0x2115('0x33')],qs[_0x2115('0x39')](_0x4c9a4e[_0x2115('0x34')]['fields']));_0x1e31a5['attributes']=_0x1e31a5[_0x2115('0x38')][_0x2115('0x3a')]?_0x1e31a5[_0x2115('0x38')]:_0x1d69af[_0x2115('0x33')];if(!_0x4c9a4e[_0x2115('0x34')]['hasOwnProperty']('nolimit')){_0x1e31a5['limit']=qs[_0x2115('0x21')](_0x4c9a4e[_0x2115('0x34')][_0x2115('0x21')]);_0x1e31a5['offset']=qs['offset'](_0x4c9a4e[_0x2115('0x34')][_0x2115('0x1e')]);}_0x1e31a5['order']=qs[_0x2115('0x3b')](_0x4c9a4e[_0x2115('0x34')][_0x2115('0x3b')]);_0x1e31a5[_0x2115('0x3c')]=qs['filters'](_['pick'](_0x4c9a4e[_0x2115('0x34')],_0x1d69af['filters']),_0x402cfd);if(_0x4c9a4e['query'][_0x2115('0x3d')]){_0x1e31a5['where']=_[_0x2115('0x3e')](_0x1e31a5['where'],{'$or':_[_0x2115('0x2d')](_0x402cfd,function(_0x211c43){if(_0x211c43[_0x2115('0x31')]!==_0x2115('0x3f')){var _0x52f49d={};_0x52f49d[_0x211c43['name']]={'$like':'%'+_0x4c9a4e[_0x2115('0x34')][_0x2115('0x3d')]+'%'};return _0x52f49d;}})});}_0x1e31a5=_[_0x2115('0x3e')]({},_0x1e31a5,_0x4c9a4e['options']);var _0x432650={'where':_0x1e31a5[_0x2115('0x3c')]};return db[_0x2115('0x2e')]['count'](_0x432650)['then'](function(_0x426d84){_0x5c67a8['count']=_0x426d84;if(_0x4c9a4e[_0x2115('0x34')][_0x2115('0x40')]){_0x1e31a5['include']=[{'all':!![]}];}return db[_0x2115('0x2e')][_0x2115('0x41')](_0x1e31a5);})[_0x2115('0x24')](function(_0x345192){_0x5c67a8[_0x2115('0x42')]=_0x345192;return _0x5c67a8;})[_0x2115('0x24')](respondWithFilteredResult(_0xb82d54,_0x1e31a5))[_0x2115('0x43')](handleError(_0xb82d54,null));};exports['show']=function(_0x1ec937,_0x90d803){var _0x529a71={'raw':![],'where':{'id':_0x1ec937[_0x2115('0x44')]['id']}},_0x241ce5={};_0x241ce5[_0x2115('0x33')]=_[_0x2115('0x35')](db[_0x2115('0x2e')][_0x2115('0x2f')]);_0x241ce5[_0x2115('0x34')]=_[_0x2115('0x35')](_0x1ec937[_0x2115('0x34')]);_0x241ce5[_0x2115('0x36')]=_[_0x2115('0x37')](_0x241ce5['model'],_0x241ce5[_0x2115('0x34')]);_0x529a71[_0x2115('0x38')]=_['intersection'](_0x241ce5['model'],qs[_0x2115('0x39')](_0x1ec937['query'][_0x2115('0x39')]));_0x529a71[_0x2115('0x38')]=_0x529a71[_0x2115('0x38')][_0x2115('0x3a')]?_0x529a71['attributes']:_0x241ce5[_0x2115('0x33')];if(_0x1ec937['query'][_0x2115('0x40')]){_0x529a71[_0x2115('0x45')]=[{'all':!![]}];}_0x529a71=_[_0x2115('0x3e')]({},_0x529a71,_0x1ec937['options']);return db[_0x2115('0x2e')][_0x2115('0x46')](_0x529a71)['then'](handleEntityNotFound(_0x90d803,null))['then'](respondWithResult(_0x90d803,null))[_0x2115('0x43')](handleError(_0x90d803,null));};exports[_0x2115('0x47')]=function(_0x377dfd,_0x1578ca){return db['Dashboard'][_0x2115('0x47')](_0x377dfd[_0x2115('0x48')],{})[_0x2115('0x24')](function(_0x4265de){var _0x42bcc1=_0x377dfd['user']['get']({'plain':!![]});if(!_0x42bcc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42bcc1[_0x2115('0x49')]===_0x2115('0x4a')){var _0x595bce=_0x4265de['get']({'plain':!![]});var _0x1c6f36=_0x2115('0x26');return db[_0x2115('0x4b')][_0x2115('0x46')]({'where':{'name':_0x1c6f36,'userProfileId':_0x42bcc1['userProfileId']},'raw':!![]})['then'](function(_0x3a2baa){if(_0x3a2baa&&_0x3a2baa[_0x2115('0x4c')]===0x0){return db[_0x2115('0x27')][_0x2115('0x47')]({'name':_0x595bce['name'],'resourceId':_0x595bce['id'],'type':_0x3a2baa[_0x2115('0x2a')],'sectionId':_0x3a2baa['id']},{})[_0x2115('0x24')](function(){return _0x4265de;});}else{return _0x4265de;}})[_0x2115('0x43')](function(_0x1b31bf){logger[_0x2115('0x4d')](_0x2115('0x4e'),_0x1b31bf);throw _0x1b31bf;});}return _0x4265de;})[_0x2115('0x24')](respondWithResult(_0x1578ca,0xc9))[_0x2115('0x43')](handleError(_0x1578ca,null));};exports['clone']=function(_0x4ce468,_0x27717f){var _0x19b98d={'where':{'id':_0x4ce468['params']['id']}},_0x3e6f25={};_0x3e6f25[_0x2115('0x33')]=_[_0x2115('0x35')](db[_0x2115('0x2e')][_0x2115('0x2f')]);_0x19b98d[_0x2115('0x38')]=_[_0x2115('0x37')](_0x3e6f25[_0x2115('0x33')],qs[_0x2115('0x39')](_0x4ce468[_0x2115('0x34')]['fields']));_0x19b98d[_0x2115('0x38')]=_0x19b98d[_0x2115('0x38')][_0x2115('0x3a')]?_0x19b98d[_0x2115('0x38')]:_0x3e6f25[_0x2115('0x33')];if(_0x4ce468[_0x2115('0x34')][_0x2115('0x40')]){_0x19b98d[_0x2115('0x45')]=[{'all':!![]}];}_0x19b98d=_[_0x2115('0x3e')]({},_0x19b98d,_0x4ce468[_0x2115('0x4f')]);return db['Dashboard'][_0x2115('0x46')](_0x19b98d)[_0x2115('0x24')](handleEntityNotFound(_0x27717f,null))[_0x2115('0x24')](function(_0x4e39b9){if(_0x4e39b9){var _0x35e218=_0x4e39b9[_0x2115('0x50')]({'plain':!![]});_0x35e218=qs[_0x2115('0x51')](_0x35e218,['id',_0x2115('0x52'),_0x2115('0x53')]);_0x4ce468[_0x2115('0x48')]=_[_0x2115('0x51')](_0x4ce468['body'],['id',_0x2115('0x52'),'updatedAt']);return db['Dashboard'][_0x2115('0x47')](_[_0x2115('0x3e')](_0x35e218,_0x4ce468['body']),{'include':_0x4ce468[_0x2115('0x34')][_0x2115('0x40')]?[{'all':!![]}]:undefined})[_0x2115('0x24')](function(_0x283820){var _0x416a94=_0x4ce468[_0x2115('0x4a')][_0x2115('0x50')]({'plain':!![]});if(!_0x416a94)throw new Error(_0x2115('0x54'));if(_0x416a94['role']==='user'){var _0x4297da=_0x283820['get']({'plain':!![]});var _0x495340=_0x2115('0x26');return db[_0x2115('0x4b')][_0x2115('0x46')]({'where':{'name':_0x495340,'userProfileId':_0x416a94[_0x2115('0x55')]},'raw':!![]})[_0x2115('0x24')](function(_0x3636b5){if(_0x3636b5&&_0x3636b5['autoAssociation']===0x0){return db[_0x2115('0x27')][_0x2115('0x47')]({'name':_0x4297da[_0x2115('0x2a')],'resourceId':_0x4297da['id'],'type':_0x3636b5['name'],'sectionId':_0x3636b5['id']},{})[_0x2115('0x24')](function(){return _0x283820;});}else{return _0x283820;}})[_0x2115('0x43')](function(_0x40df86){logger[_0x2115('0x4d')](_0x2115('0x4e'),_0x40df86);throw _0x40df86;});}return _0x283820;});}})['then'](respondWithResult(_0x27717f,0xc9))[_0x2115('0x43')](handleError(_0x27717f,null));};exports[_0x2115('0x56')]=function(_0x128c69,_0x2dfdcc){if(_0x128c69['body']['id']){delete _0x128c69[_0x2115('0x48')]['id'];}return db['Dashboard'][_0x2115('0x46')]({'where':{'id':_0x128c69['params']['id']}})[_0x2115('0x24')](handleEntityNotFound(_0x2dfdcc,null))[_0x2115('0x24')](saveUpdates(_0x128c69[_0x2115('0x48')],null))[_0x2115('0x24')](respondWithResult(_0x2dfdcc,null))[_0x2115('0x43')](handleError(_0x2dfdcc,null));};exports[_0x2115('0x25')]=function(_0x20844c,_0x28e4d5){return db[_0x2115('0x2e')][_0x2115('0x46')]({'where':{'id':_0x20844c['params']['id']}})[_0x2115('0x24')](handleEntityNotFound(_0x28e4d5,null))['then'](removeEntity(_0x28e4d5,null))[_0x2115('0x43')](handleError(_0x28e4d5,null));};function widgetAttributes(_0x2ded58){try{switch(_0x2ded58[_0x2115('0x31')]){case _0x2115('0x57'):return[{'name':_0x2115('0x58'),'value':_0x2ded58[_0x2115('0x58')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58[_0x2115('0x59')][0x0]['value']:undefined)||_0x2115('0x5a')}];case _0x2115('0x5b'):return[{'name':'attrPath','value':_0x2ded58[_0x2115('0x5c')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58[_0x2115('0x59')][0x0][_0x2115('0x5d')]:undefined)||''}];case _0x2115('0x5e'):return[{'name':_0x2115('0x5f'),'value':_0x2ded58[_0x2115('0x5f')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58[_0x2115('0x59')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x2ded58[_0x2115('0x60')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x1]?_0x2ded58['attrs'][0x1][_0x2115('0x5d')]:undefined)||_0x2115('0x61')},{'name':_0x2115('0x62'),'value':_0x2ded58['attrFontSize']||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x2]?_0x2ded58[_0x2115('0x59')][0x2][_0x2115('0x5d')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2ded58[_0x2115('0x63')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58[_0x2115('0x59')][0x0][_0x2115('0x5d')]:undefined)||_0x2115('0x64')},{'name':'attrVoiceQueues','value':_0x2ded58[_0x2115('0x65')]||(_0x2ded58['attrs']&&_0x2ded58['attrs'][0x1]?_0x2ded58[_0x2115('0x59')][0x1][_0x2115('0x5d')]:undefined)||[]},{'name':_0x2115('0x62'),'value':_0x2ded58[_0x2115('0x62')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x2]?_0x2ded58[_0x2115('0x59')][0x2][_0x2115('0x5d')]:undefined)||0x14},{'name':_0x2115('0x66'),'value':_0x2ded58[_0x2115('0x66')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x3]?_0x2ded58[_0x2115('0x59')][0x3][_0x2115('0x5d')]:undefined)||'voice'},{'name':_0x2115('0x67'),'value':_0x2ded58['attrEmailAccounts']||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x4]?_0x2ded58[_0x2115('0x59')][0x4][_0x2115('0x5d')]:undefined)||''},{'name':_0x2115('0x68'),'value':_0x2ded58[_0x2115('0x68')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x5]?_0x2ded58[_0x2115('0x59')][0x5][_0x2115('0x5d')]:undefined)||''},{'name':_0x2115('0x69'),'value':_0x2ded58['attrSmsAccounts']||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x6]?_0x2ded58[_0x2115('0x59')][0x6][_0x2115('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2ded58['attrOpenchannelAccounts']||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x7]?_0x2ded58['attrs'][0x7]['value']:undefined)||''},{'name':_0x2115('0x6a'),'value':_0x2ded58[_0x2115('0x6a')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x8]?_0x2ded58[_0x2115('0x59')][0x8][_0x2115('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2ded58[_0x2115('0x6b')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x9]?_0x2ded58[_0x2115('0x59')][0x9][_0x2115('0x5d')]:undefined)||''}];case _0x2115('0x6c'):case _0x2115('0x6d'):return[{'name':_0x2115('0x6e'),'value':_0x2ded58[_0x2115('0x6e')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58['attrs'][0x0][_0x2115('0x5d')]:undefined)||'total'},{'name':_0x2115('0x6f'),'value':_0x2ded58[_0x2115('0x6f')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x1]?_0x2ded58['attrs'][0x1][_0x2115('0x5d')]:undefined)||null},{'name':_0x2115('0x70'),'value':_0x2ded58[_0x2115('0x70')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x2]?_0x2ded58[_0x2115('0x59')][0x2][_0x2115('0x5d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2ded58['attrVoiceQueues']||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x3]?_0x2ded58[_0x2115('0x59')][0x3][_0x2115('0x5d')]:undefined)||[]},{'name':_0x2115('0x66'),'value':_0x2ded58[_0x2115('0x66')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x4]?_0x2ded58[_0x2115('0x59')][0x4][_0x2115('0x5d')]:undefined)||'voice'},{'name':_0x2115('0x67'),'value':_0x2ded58[_0x2115('0x67')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x5]?_0x2ded58[_0x2115('0x59')][0x5][_0x2115('0x5d')]:undefined)||''},{'name':_0x2115('0x68'),'value':_0x2ded58[_0x2115('0x68')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x6]?_0x2ded58[_0x2115('0x59')][0x6][_0x2115('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2ded58[_0x2115('0x69')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x7]?_0x2ded58[_0x2115('0x59')][0x7][_0x2115('0x5d')]:undefined)||''},{'name':_0x2115('0x71'),'value':_0x2ded58[_0x2115('0x71')]||(_0x2ded58['attrs']&&_0x2ded58[_0x2115('0x59')][0x8]?_0x2ded58[_0x2115('0x59')][0x8][_0x2115('0x5d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2ded58['attrWhatsappAccounts']||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x9]?_0x2ded58[_0x2115('0x59')][0x9][_0x2115('0x5d')]:undefined)||''},{'name':_0x2115('0x6b'),'value':_0x2ded58[_0x2115('0x6b')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0xa]?_0x2ded58['attrs'][0xa][_0x2115('0x5d')]:undefined)||''}];case _0x2115('0x72'):return[{'name':'attrReport','type':_0x2ded58[_0x2115('0x73')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58[_0x2115('0x59')][0x0][_0x2115('0x31')]:undefined)||null,'value':_0x2ded58[_0x2115('0x74')]||(_0x2ded58[_0x2115('0x59')]&&_0x2ded58[_0x2115('0x59')][0x0]?_0x2ded58[_0x2115('0x59')][0x0]['value']:undefined)||null},{'name':_0x2115('0x75'),'value':_0x2ded58[_0x2115('0x75')]||(_0x2ded58['attrs']&&_0x2ded58['attrs'][0x1]?_0x2ded58[_0x2115('0x59')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3745e0){logger[_0x2115('0x4d')](_0x2115('0x76'),JSON[_0x2115('0x77')](_0x3745e0));return[];}}exports[_0x2115('0x78')]=function(_0x36b753,_0x4fde2b,_0x6bb848){if(_0x36b753[_0x2115('0x48')]['id']){delete _0x36b753[_0x2115('0x48')]['id'];}return db[_0x2115('0x2e')][_0x2115('0x46')]({'where':{'id':_0x36b753[_0x2115('0x44')]['id']}})[_0x2115('0x24')](handleEntityNotFound(_0x4fde2b,null))[_0x2115('0x24')](function(_0x36fe27){if(_0x36fe27){_0x36b753[_0x2115('0x48')][_0x2115('0x79')]=_0x36fe27['id'];_0x36b753[_0x2115('0x48')][_0x2115('0x59')]=widgetAttributes(_0x36b753['body']);return db['DashboardItem']['create'](_0x36b753[_0x2115('0x48')]);}})[_0x2115('0x24')](respondWithResult(_0x4fde2b,null))[_0x2115('0x43')](handleError(_0x4fde2b,null));};exports[_0x2115('0x7a')]=function(_0x28aff2,_0x53388d,_0x2c18d6){var _0x312f68={};var _0x333072={};var _0x48da5c;var _0x157a1d;return db[_0x2115('0x2e')][_0x2115('0x7b')]({'where':{'id':_0x28aff2[_0x2115('0x44')]['id']}})[_0x2115('0x24')](handleEntityNotFound(_0x53388d,null))[_0x2115('0x24')](function(_0x1e6f65){if(_0x1e6f65){_0x48da5c=_0x1e6f65;_0x333072[_0x2115('0x33')]=_[_0x2115('0x35')](db[_0x2115('0x7c')][_0x2115('0x2f')]);_0x333072[_0x2115('0x34')]=_[_0x2115('0x35')](_0x28aff2[_0x2115('0x34')]);_0x333072['filters']=_['intersection'](_0x333072['model'],_0x333072[_0x2115('0x34')]);_0x312f68[_0x2115('0x38')]=_[_0x2115('0x37')](_0x333072[_0x2115('0x33')],qs['fields'](_0x28aff2['query'][_0x2115('0x39')]));_0x312f68[_0x2115('0x38')]=_0x312f68[_0x2115('0x38')][_0x2115('0x3a')]?_0x312f68[_0x2115('0x38')]:_0x333072[_0x2115('0x33')];_0x312f68['order']=qs[_0x2115('0x3b')](_0x28aff2[_0x2115('0x34')][_0x2115('0x3b')]);_0x312f68[_0x2115('0x3c')]=qs['filters'](_[_0x2115('0x7d')](_0x28aff2[_0x2115('0x34')],_0x333072[_0x2115('0x36')]));if(_0x28aff2['query'][_0x2115('0x3d')]){_0x312f68[_0x2115('0x3c')]=_[_0x2115('0x3e')](_0x312f68[_0x2115('0x3c')],{'$or':_[_0x2115('0x2d')](_0x312f68[_0x2115('0x38')],function(_0x46f9af){var _0x5e1bf9={};_0x5e1bf9[_0x46f9af]={'$like':'%'+_0x28aff2['query']['filter']+'%'};return _0x5e1bf9;})});}_0x312f68=_[_0x2115('0x3e')]({},_0x312f68,_0x28aff2['options']);return _0x48da5c[_0x2115('0x7a')](_0x312f68);}})[_0x2115('0x24')](function(_0x2ae57b){if(_0x2ae57b){_0x157a1d=_0x2ae57b[_0x2115('0x3a')];if(!_0x28aff2[_0x2115('0x34')][_0x2115('0x7e')](_0x2115('0x7f'))){_0x312f68['limit']=qs['limit'](_0x28aff2[_0x2115('0x34')][_0x2115('0x21')]);_0x312f68[_0x2115('0x1e')]=qs[_0x2115('0x1e')](_0x28aff2[_0x2115('0x34')][_0x2115('0x1e')]);}return _0x48da5c[_0x2115('0x7a')](_0x312f68);}})[_0x2115('0x24')](function(_0x4ca29c){if(_0x4ca29c){return _0x4ca29c?{'count':_0x157a1d,'rows':_0x4ca29c}:null;}})[_0x2115('0x24')](respondWithResult(_0x53388d,null))[_0x2115('0x43')](handleError(_0x53388d,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 3f174b8..1e1c9ad 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 _0x9583=['events','../../mysqldb','Dashboard','save','emit','hook','exports'];(function(_0x51069d,_0x51ce9d){var _0x3d9440=function(_0x14f0e5){while(--_0x14f0e5){_0x51069d['push'](_0x51069d['shift']());}};_0x3d9440(++_0x51ce9d);}(_0x9583,0xcb));var _0x3958=function(_0x43aac1,_0x181944){_0x43aac1=_0x43aac1-0x0;var _0x3cc143=_0x9583[_0x43aac1];return _0x3cc143;};'use strict';var EventEmitter=require(_0x3958('0x0'));var Dashboard=require(_0x3958('0x1'))['db'][_0x3958('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3958('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x54d56a){return function(_0x432cf7,_0x3b9d9c,_0xeab3b4){DashboardEvents[_0x3958('0x4')](_0x54d56a+':'+_0x432cf7['id'],_0x432cf7);DashboardEvents[_0x3958('0x4')](_0x54d56a,_0x432cf7);_0xeab3b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x3958('0x5')](e,emitEvent(event));}}module[_0x3958('0x6')]=DashboardEvents; \ No newline at end of file +var _0x4421=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','update'];(function(_0x3c23c8,_0x361ce2){var _0x4e494a=function(_0x327935){while(--_0x327935){_0x3c23c8['push'](_0x3c23c8['shift']());}};_0x4e494a(++_0x361ce2);}(_0x4421,0x163));var _0x1442=function(_0x391e0a,_0x168392){_0x391e0a=_0x391e0a-0x0;var _0x258d57=_0x4421[_0x391e0a];return _0x258d57;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x1442('0x0'))['db'][_0x1442('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1442('0x2')](0x0);var events={'afterCreate':_0x1442('0x3'),'afterUpdate':_0x1442('0x4'),'afterDestroy':_0x1442('0x5')};function emitEvent(_0xf37556){return function(_0x3ebf6a,_0x12c293,_0x2242b0){DashboardEvents[_0x1442('0x6')](_0xf37556+':'+_0x3ebf6a['id'],_0x3ebf6a);DashboardEvents[_0x1442('0x6')](_0xf37556,_0x3ebf6a);_0x2242b0(null);};}for(var e in events){if(events[_0x1442('0x7')](e)){var event=events[e];Dashboard[_0x1442('0x8')](e,emitEvent(event));}}module[_0x1442('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 6e16e9a..899f077 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 _0xdeff=['api','moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util'];(function(_0x15ca40,_0x3fed78){var _0x5be3f1=function(_0x1e58d4){while(--_0x1e58d4){_0x15ca40['push'](_0x15ca40['shift']());}};_0x5be3f1(++_0x3fed78);}(_0xdeff,0x82));var _0xfdef=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xdeff[_0x36f47c];return _0x296c55;};'use strict';var _=require(_0xfdef('0x0'));var util=require(_0xfdef('0x1'));var logger=require('../../config/logger')(_0xfdef('0x2'));var moment=require(_0xfdef('0x3'));var BPromise=require(_0xfdef('0x4'));var rp=require(_0xfdef('0x5'));var fs=require('fs');var path=require(_0xfdef('0x6'));var rimraf=require('rimraf');var config=require(_0xfdef('0x7'));var attributes=require(_0xfdef('0x8'));module[_0xfdef('0x9')]=function(_0x4a14ab,_0x5e3669){return _0x4a14ab[_0xfdef('0xa')](_0xfdef('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1178=['define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x19cedd,_0x2aed35){var _0x586d22=function(_0x45adb5){while(--_0x45adb5){_0x19cedd['push'](_0x19cedd['shift']());}};_0x586d22(++_0x2aed35);}(_0x1178,0xb7));var _0x8117=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1178[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8117('0x0'));var util=require(_0x8117('0x1'));var logger=require(_0x8117('0x2'))(_0x8117('0x3'));var moment=require(_0x8117('0x4'));var BPromise=require(_0x8117('0x5'));var rp=require(_0x8117('0x6'));var fs=require('fs');var path=require(_0x8117('0x7'));var rimraf=require(_0x8117('0x8'));var config=require(_0x8117('0x9'));var attributes=require(_0x8117('0xa'));module[_0x8117('0xb')]=function(_0x4b1d50,_0x536c79){return _0x4b1d50[_0x8117('0xc')](_0x8117('0xd'),attributes,{'tableName':_0x8117('0xe'),'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 3d529b4..642cb69 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 _0x3703=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3703,0x8a));var _0x3370=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x3703[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0x3370('0x0'));var util=require(_0x3370('0x1'));var moment=require(_0x3370('0x2'));var BPromise=require(_0x3370('0x3'));var rs=require(_0x3370('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3370('0x5'))(_0x3370('0x6'));var config=require(_0x3370('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3370('0x8')][_0x3370('0x9')]({'port':0x232a});config[_0x3370('0xa')]=_[_0x3370('0xb')](config[_0x3370('0xa')],{'host':_0x3370('0xc'),'port':0x18eb});var socket=require(_0x3370('0xd'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x48c3d0,_0x2b09b8,_0x5a5f7f){return new BPromise(function(_0x1b396c,_0x3299fb){return client[_0x3370('0xe')](_0x48c3d0,_0x5a5f7f)[_0x3370('0xf')](function(_0x50890c){logger[_0x3370('0x10')](_0x3370('0x11'),_0x2b09b8,_0x3370('0x12'));logger[_0x3370('0x13')](_0x3370('0x14'),_0x2b09b8,'request\x20sent',JSON[_0x3370('0x15')](_0x50890c));if(_0x50890c[_0x3370('0x16')]){if(_0x50890c[_0x3370('0x16')][_0x3370('0x17')]===0x1f4){logger[_0x3370('0x16')](_0x3370('0x11'),_0x2b09b8,_0x50890c[_0x3370('0x16')][_0x3370('0x18')]);return _0x3299fb(_0x50890c['error'][_0x3370('0x18')]);}logger['error'](_0x3370('0x11'),_0x2b09b8,_0x50890c[_0x3370('0x16')][_0x3370('0x18')]);return _0x1b396c(_0x50890c[_0x3370('0x16')][_0x3370('0x18')]);}else{logger[_0x3370('0x10')](_0x3370('0x11'),_0x2b09b8,_0x3370('0x12'));_0x1b396c(_0x50890c[_0x3370('0x19')][_0x3370('0x18')]);}})['catch'](function(_0x50b14b){logger[_0x3370('0x16')](_0x3370('0x11'),_0x2b09b8,_0x50b14b);_0x3299fb(_0x50b14b);});});} \ No newline at end of file +var _0x846d=['socket.io-emitter','request','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x22126b,_0x2d833c){var _0x2d099b=function(_0x269fe9){while(--_0x269fe9){_0x22126b['push'](_0x22126b['shift']());}};_0x2d099b(++_0x2d833c);}(_0x846d,0x173));var _0xd846=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x846d[_0x4e198a];return _0xb84bfe;};'use strict';var _=require('lodash');var util=require(_0xd846('0x0'));var moment=require('moment');var BPromise=require(_0xd846('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd846('0x2'));var db=require(_0xd846('0x3'))['db'];var utils=require(_0xd846('0x4'));var logger=require(_0xd846('0x5'))(_0xd846('0x6'));var config=require(_0xd846('0x7'));var jayson=require(_0xd846('0x8'));var client=jayson[_0xd846('0x9')][_0xd846('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd846('0xb')],{'host':_0xd846('0xc'),'port':0x18eb});var socket=require(_0xd846('0xd'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x2da5f4,_0x418c95,_0x1d76a8){return new BPromise(function(_0x19329b,_0x959c76){return client[_0xd846('0xe')](_0x2da5f4,_0x1d76a8)['then'](function(_0x5cf278){logger[_0xd846('0xf')]('Dashboard,\x20%s,\x20%s',_0x418c95,_0xd846('0x10'));logger[_0xd846('0x11')](_0xd846('0x12'),_0x418c95,_0xd846('0x10'),JSON['stringify'](_0x5cf278));if(_0x5cf278[_0xd846('0x13')]){if(_0x5cf278[_0xd846('0x13')][_0xd846('0x14')]===0x1f4){logger[_0xd846('0x13')](_0xd846('0x15'),_0x418c95,_0x5cf278[_0xd846('0x13')][_0xd846('0x16')]);return _0x959c76(_0x5cf278['error'][_0xd846('0x16')]);}logger[_0xd846('0x13')](_0xd846('0x15'),_0x418c95,_0x5cf278[_0xd846('0x13')][_0xd846('0x16')]);return _0x19329b(_0x5cf278[_0xd846('0x13')][_0xd846('0x16')]);}else{logger[_0xd846('0xf')](_0xd846('0x15'),_0x418c95,_0xd846('0x10'));_0x19329b(_0x5cf278[_0xd846('0x17')][_0xd846('0x16')]);}})['catch'](function(_0x434e4b){logger[_0xd846('0x13')](_0xd846('0x15'),_0x418c95,_0x434e4b);_0x959c76(_0x434e4b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3563e05..cdfbb70 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 _0x3623=['length','dashboard:','save','remove','emit','register'];(function(_0x165615,_0x5db1d5){var _0x2ed9e0=function(_0x1acbe8){while(--_0x1acbe8){_0x165615['push'](_0x165615['shift']());}};_0x2ed9e0(++_0x5db1d5);}(_0x3623,0x74));var _0x3362=function(_0x2df84d,_0x56d874){_0x2df84d=_0x2df84d-0x0;var _0x2634ce=_0x3623[_0x2df84d];return _0x2634ce;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x3362('0x0'),_0x3362('0x1'),'update'];function createListener(_0x110c52,_0x2f0a4d){return function(_0x20434c){_0x2f0a4d[_0x3362('0x2')](_0x110c52,_0x20434c);};}function removeListener(_0x28523e,_0x49a998){return function(){DashboardEvents['removeListener'](_0x28523e,_0x49a998);};}exports[_0x3362('0x3')]=function(_0x371a02){for(var _0x2e98cf=0x0,_0x533f91=events[_0x3362('0x4')];_0x2e98cf<_0x533f91;_0x2e98cf++){var _0x15b736=events[_0x2e98cf];var _0x2469e5=createListener(_0x3362('0x5')+_0x15b736,_0x371a02);DashboardEvents['on'](_0x15b736,_0x2469e5);}}; \ No newline at end of file +var _0x7c98=['./dashboard.events','update','emit','removeListener','register','length','dashboard:'];(function(_0x31949d,_0xa371f2){var _0x367ada=function(_0x24a55b){while(--_0x24a55b){_0x31949d['push'](_0x31949d['shift']());}};_0x367ada(++_0xa371f2);}(_0x7c98,0xd2));var _0x87c9=function(_0x1dd034,_0x5f5a76){_0x1dd034=_0x1dd034-0x0;var _0x4ecb48=_0x7c98[_0x1dd034];return _0x4ecb48;};'use strict';var DashboardEvents=require(_0x87c9('0x0'));var events=['save','remove',_0x87c9('0x1')];function createListener(_0x5880e0,_0x3daba0){return function(_0x49de75){_0x3daba0[_0x87c9('0x2')](_0x5880e0,_0x49de75);};}function removeListener(_0x3be14b,_0x29f417){return function(){DashboardEvents[_0x87c9('0x3')](_0x3be14b,_0x29f417);};}exports[_0x87c9('0x4')]=function(_0x2b2aff){for(var _0x55c114=0x0,_0x28579a=events[_0x87c9('0x5')];_0x55c114<_0x28579a;_0x55c114++){var _0x35f5ca=events[_0x55c114];var _0x2e4b11=createListener(_0x87c9('0x6')+_0x35f5ca,_0x2b2aff);DashboardEvents['on'](_0x35f5ca,_0x2e4b11);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b5de714..8f8b1dd 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 _0x5f6d=['create','/:id/clone','clone','addItem','put','/:id','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','post'];(function(_0xb92b7a,_0x1cb4e7){var _0x4b2aac=function(_0x3c3103){while(--_0x3c3103){_0xb92b7a['push'](_0xb92b7a['shift']());}};_0x4b2aac(++_0x1cb4e7);}(_0x5f6d,0x162));var _0xd5f6=function(_0x6ee51a,_0xc35002){_0x6ee51a=_0x6ee51a-0x0;var _0x3b6017=_0x5f6d[_0x6ee51a];return _0x3b6017;};'use strict';var multer=require(_0xd5f6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd5f6('0x1'));var express=require(_0xd5f6('0x2'));var router=express['Router']();var fs_extra=require(_0xd5f6('0x3'));var auth=require(_0xd5f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd5f6('0x5'));var controller=require(_0xd5f6('0x6'));router[_0xd5f6('0x7')]('/',auth[_0xd5f6('0x8')](),controller[_0xd5f6('0x9')]);router['get']('/:id',auth[_0xd5f6('0x8')](),controller[_0xd5f6('0xa')]);router[_0xd5f6('0x7')](_0xd5f6('0xb'),auth[_0xd5f6('0x8')](),controller[_0xd5f6('0xc')]);router[_0xd5f6('0xd')]('/',auth[_0xd5f6('0x8')](),controller[_0xd5f6('0xe')]);router[_0xd5f6('0xd')](_0xd5f6('0xf'),auth[_0xd5f6('0x8')](),controller[_0xd5f6('0x10')]);router[_0xd5f6('0xd')](_0xd5f6('0xb'),auth[_0xd5f6('0x8')](),controller[_0xd5f6('0x11')]);router[_0xd5f6('0x12')](_0xd5f6('0x13'),auth[_0xd5f6('0x8')](),controller['update']);router[_0xd5f6('0x14')](_0xd5f6('0x13'),auth['isAuthenticated'](),controller[_0xd5f6('0x15')]);module[_0xd5f6('0x16')]=router; \ No newline at end of file +var _0x5161=['delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','update'];(function(_0xa026b8,_0x30b0cb){var _0x46c85d=function(_0x5813da){while(--_0x5813da){_0xa026b8['push'](_0xa026b8['shift']());}};_0x46c85d(++_0x30b0cb);}(_0x5161,0x135));var _0x1516=function(_0x18475d,_0x5d584f){_0x18475d=_0x18475d-0x0;var _0x17a2ff=_0x5161[_0x18475d];return _0x17a2ff;};'use strict';var multer=require(_0x1516('0x0'));var util=require(_0x1516('0x1'));var path=require('path');var timeout=require(_0x1516('0x2'));var express=require(_0x1516('0x3'));var router=express[_0x1516('0x4')]();var fs_extra=require(_0x1516('0x5'));var auth=require(_0x1516('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1516('0x7'));var controller=require('./dashboard.controller');router[_0x1516('0x8')]('/',auth[_0x1516('0x9')](),controller[_0x1516('0xa')]);router[_0x1516('0x8')](_0x1516('0xb'),auth[_0x1516('0x9')](),controller[_0x1516('0xc')]);router[_0x1516('0x8')](_0x1516('0xd'),auth[_0x1516('0x9')](),controller[_0x1516('0xe')]);router[_0x1516('0xf')]('/',auth[_0x1516('0x9')](),controller[_0x1516('0x10')]);router['post'](_0x1516('0x11'),auth[_0x1516('0x9')](),controller[_0x1516('0x12')]);router['post'](_0x1516('0xd'),auth[_0x1516('0x9')](),controller['addItem']);router[_0x1516('0x13')](_0x1516('0xb'),auth['isAuthenticated'](),controller[_0x1516('0x14')]);router[_0x1516('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index adb7591..3a8395d 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 _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabce,0x103));var _0xeabc=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xabce[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xacf4=['lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xacf4,0xe7));var _0x4acf=function(_0xe5745d,_0x22ed33){_0xe5745d=_0xe5745d-0x0;var _0x58787a=_0xacf4[_0xe5745d];return _0x58787a;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4acf('0x0'));module[_0x4acf('0x1')]={'title':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4acf('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4acf('0x3')](_0x4acf('0x4')),'get':function(){try{return JSON[_0x4acf('0x5')](this['getDataValue'](_0x4acf('0x6')));}catch(_0x2124c8){return[];}},'set':function(_0x4e0c43){try{this[_0x4acf('0x7')](_0x4acf('0x6'),JSON[_0x4acf('0x8')](_0x4e0c43));}catch(_0x45a5a4){this[_0x4acf('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4acf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4acf('0x9')]},'col':{'type':Sequelize[_0x4acf('0x9')]},'background':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':_0x4acf('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 1256cac..c149307 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 _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(_0x2daca8,_0x1def67){var _0x17d635=function(_0x4235d2){while(--_0x4235d2){_0x2daca8['push'](_0x2daca8['shift']());}};_0x17d635(++_0x1def67);}(_0xb145,0xa3));var _0x5b14=function(_0x4f52d6,_0x10798c){_0x4f52d6=_0x4f52d6-0x0;var _0x412e9e=_0xb145[_0x4f52d6];return _0x412e9e;};'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 +var _0x5226=['attrSerie1','total','attrSerie3','attrFaxAccounts','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','destroy','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart'];(function(_0xd1f920,_0x18dbc8){var _0x11fd3c=function(_0x550f37){while(--_0x550f37){_0xd1f920['push'](_0xd1f920['shift']());}};_0x11fd3c(++_0x18dbc8);}(_0x5226,0x137));var _0x6522=function(_0x1d33d2,_0x16650e){_0x1d33d2=_0x1d33d2-0x0;var _0x4b5460=_0x5226[_0x1d33d2];return _0x4b5460;};'use strict';var emlformat=require(_0x6522('0x0'));var rimraf=require(_0x6522('0x1'));var zipdir=require(_0x6522('0x2'));var jsonpatch=require(_0x6522('0x3'));var rp=require(_0x6522('0x4'));var moment=require('moment');var BPromise=require(_0x6522('0x5'));var Mustache=require(_0x6522('0x6'));var util=require(_0x6522('0x7'));var path=require('path');var sox=require(_0x6522('0x8'));var csv=require('to-csv');var ejs=require(_0x6522('0x9'));var fs=require('fs');var fs_extra=require(_0x6522('0xa'));var _=require(_0x6522('0xb'));var squel=require(_0x6522('0xc'));var crypto=require(_0x6522('0xd'));var jsforce=require(_0x6522('0xe'));var deskjs=require(_0x6522('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6522('0x10'));var Redis=require(_0x6522('0x11'));var authService=require(_0x6522('0x12'));var qs=require(_0x6522('0x13'));var as=require(_0x6522('0x14'));var hardwareService=require(_0x6522('0x15'));var logger=require(_0x6522('0x16'))(_0x6522('0x17'));var utils=require(_0x6522('0x18'));var config=require(_0x6522('0x19'));var licenseUtil=require(_0x6522('0x1a'));var db=require(_0x6522('0x1b'))['db'];config[_0x6522('0x1c')]=_['defaults'](config[_0x6522('0x1c')],{'host':_0x6522('0x1d'),'port':0x18eb});var socket=require(_0x6522('0x1e'))(new Redis(config[_0x6522('0x1c')]));require(_0x6522('0x1f'))['register'](socket);function respondWithStatusCode(_0x3c855a,_0x2ab9a0){_0x2ab9a0=_0x2ab9a0||0xcc;return function(_0x26ed67){if(_0x26ed67){return _0x3c855a[_0x6522('0x20')](_0x2ab9a0);}return _0x3c855a[_0x6522('0x21')](_0x2ab9a0)[_0x6522('0x22')]();};}function respondWithResult(_0x31ddff,_0x1e12b7){_0x1e12b7=_0x1e12b7||0xc8;return function(_0x36a557){if(_0x36a557){return _0x31ddff[_0x6522('0x21')](_0x1e12b7)[_0x6522('0x23')](_0x36a557);}};}function respondWithFilteredResult(_0x434a84,_0x51a8e0){return function(_0x6f0909){if(_0x6f0909){var _0x1edcb6=typeof _0x51a8e0[_0x6522('0x24')]===_0x6522('0x25')&&typeof _0x51a8e0['limit']===_0x6522('0x25');var _0x9a5622=_0x6f0909['count'];var _0x38aae6=_0x1edcb6?0x0:_0x51a8e0['offset'];var _0x1bb7df=_0x1edcb6?_0x6f0909[_0x6522('0x26')]:_0x51a8e0[_0x6522('0x24')]+_0x51a8e0[_0x6522('0x27')];var _0x44bd23;if(_0x1bb7df>=_0x9a5622){_0x1bb7df=_0x9a5622;_0x44bd23=0xc8;}else{_0x44bd23=0xce;}_0x434a84[_0x6522('0x21')](_0x44bd23);return _0x434a84['set'](_0x6522('0x28'),_0x38aae6+'-'+_0x1bb7df+'/'+_0x9a5622)[_0x6522('0x23')](_0x6f0909);}return null;};}function patchUpdates(_0x13ec44){return function(_0x14ba8f){try{jsonpatch[_0x6522('0x29')](_0x14ba8f,_0x13ec44,!![]);}catch(_0x16c3cf){return BPromise['reject'](_0x16c3cf);}return _0x14ba8f[_0x6522('0x2a')]();};}function saveUpdates(_0x415f16,_0xcb377c){return function(_0x2c3269){if(_0x2c3269){return _0x2c3269['update'](_0x415f16)['then'](function(_0x263d7d){return _0x263d7d;});}return null;};}function removeEntity(_0x38045b,_0x2c20dc){return function(_0x29b7f4){if(_0x29b7f4){return _0x29b7f4['destroy']()[_0x6522('0x2b')](function(){_0x38045b[_0x6522('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x375555,_0x2f6e86){return function(_0x23dc77){if(!_0x23dc77){_0x375555[_0x6522('0x20')](0x194);}return _0x23dc77;};}function handleError(_0x5db9bb,_0x204305){_0x204305=_0x204305||0x1f4;return function(_0x27bbc0){logger[_0x6522('0x2c')](_0x27bbc0[_0x6522('0x2d')]);if(_0x27bbc0[_0x6522('0x2e')]){delete _0x27bbc0[_0x6522('0x2e')];}_0x5db9bb[_0x6522('0x21')](_0x204305)[_0x6522('0x2f')](_0x27bbc0);};}exports[_0x6522('0x30')]=function(_0x2c57f7,_0x9e6606){var _0x2c2e97={'raw':![],'where':{'id':_0x2c57f7[_0x6522('0x31')]['id']}},_0x4c4d29={};_0x4c4d29[_0x6522('0x32')]=_[_0x6522('0x33')](db[_0x6522('0x34')][_0x6522('0x35')]);_0x4c4d29[_0x6522('0x36')]=_['keys'](_0x2c57f7[_0x6522('0x36')]);_0x4c4d29[_0x6522('0x37')]=_[_0x6522('0x38')](_0x4c4d29[_0x6522('0x32')],_0x4c4d29[_0x6522('0x36')]);_0x2c2e97[_0x6522('0x39')]=_[_0x6522('0x38')](_0x4c4d29[_0x6522('0x32')],qs[_0x6522('0x3a')](_0x2c57f7[_0x6522('0x36')][_0x6522('0x3a')]));_0x2c2e97[_0x6522('0x39')]=_0x2c2e97[_0x6522('0x39')]['length']?_0x2c2e97['attributes']:_0x4c4d29['model'];if(_0x2c57f7[_0x6522('0x36')][_0x6522('0x3b')]){_0x2c2e97[_0x6522('0x3c')]=[{'all':!![]}];}_0x2c2e97=_[_0x6522('0x3d')]({},_0x2c2e97,_0x2c57f7[_0x6522('0x3e')]);return db[_0x6522('0x34')]['find'](_0x2c2e97)[_0x6522('0x2b')](handleEntityNotFound(_0x9e6606,null))[_0x6522('0x2b')](respondWithResult(_0x9e6606,null))[_0x6522('0x3f')](handleError(_0x9e6606,null));};exports[_0x6522('0x40')]=function(_0x15d709,_0x4ec7ab){return db['DashboardItem']['find']({'where':{'id':_0x15d709[_0x6522('0x31')]['id']}})[_0x6522('0x2b')](handleEntityNotFound(_0x4ec7ab,null))['then'](removeEntity(_0x4ec7ab,null))['catch'](handleError(_0x4ec7ab,null));};function widgetAttributes(_0xed4641){try{switch(_0xed4641['type']){case'iframe':return[{'name':_0x6522('0x41'),'value':_0xed4641[_0x6522('0x41')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0]['value']:undefined)||_0x6522('0x43')}];case _0x6522('0x44'):return[{'name':_0x6522('0x45'),'value':_0xed4641[_0x6522('0x45')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641['attrs'][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x46')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0xed4641[_0x6522('0x47')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x46')]:undefined)||'HH:mm:ss'},{'name':_0x6522('0x48'),'value':_0xed4641[_0x6522('0x48')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x1]?_0xed4641[_0x6522('0x42')][0x1][_0x6522('0x46')]:undefined)||'0.00'},{'name':_0x6522('0x49'),'value':_0xed4641['attrFontSize']||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x2]?_0xed4641[_0x6522('0x42')][0x2][_0x6522('0x46')]:undefined)||0xc}];case _0x6522('0x4a'):return[{'name':'attrMetric','value':_0xed4641[_0x6522('0x4b')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641['attrs'][0x0][_0x6522('0x46')]:undefined)||'total'},{'name':_0x6522('0x4c'),'value':_0xed4641[_0x6522('0x4c')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641['attrs'][0x1]?_0xed4641[_0x6522('0x42')][0x1][_0x6522('0x46')]:undefined)||[]},{'name':_0x6522('0x49'),'value':_0xed4641[_0x6522('0x49')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x2]?_0xed4641[_0x6522('0x42')][0x2][_0x6522('0x46')]:undefined)||0x14},{'name':_0x6522('0x4d'),'value':_0xed4641[_0x6522('0x4d')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x3]?_0xed4641[_0x6522('0x42')][0x3][_0x6522('0x46')]:undefined)||_0x6522('0x4e')},{'name':_0x6522('0x4f'),'value':_0xed4641[_0x6522('0x4f')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x4]?_0xed4641[_0x6522('0x42')][0x4][_0x6522('0x46')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xed4641['attrFaxAccounts']||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x5]?_0xed4641['attrs'][0x5][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x50'),'value':_0xed4641['attrSmsAccounts']||(_0xed4641['attrs']&&_0xed4641['attrs'][0x6]?_0xed4641['attrs'][0x6][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x51'),'value':_0xed4641[_0x6522('0x51')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x7]?_0xed4641[_0x6522('0x42')][0x7]['value']:undefined)||''},{'name':_0x6522('0x52'),'value':_0xed4641[_0x6522('0x52')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x8]?_0xed4641[_0x6522('0x42')][0x8][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x53'),'value':_0xed4641[_0x6522('0x53')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x9]?_0xed4641[_0x6522('0x42')][0x9][_0x6522('0x46')]:undefined)||''}];case'multibar-chart':case _0x6522('0x54'):return[{'name':_0x6522('0x55'),'value':_0xed4641[_0x6522('0x55')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0]['value']:undefined)||_0x6522('0x56')},{'name':'attrSerie2','value':_0xed4641['attrSerie2']||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x1]?_0xed4641['attrs'][0x1]['value']:undefined)||null},{'name':_0x6522('0x57'),'value':_0xed4641['attrSerie3']||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x2]?_0xed4641[_0x6522('0x42')][0x2][_0x6522('0x46')]:undefined)||null},{'name':_0x6522('0x4c'),'value':_0xed4641[_0x6522('0x4c')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x3]?_0xed4641['attrs'][0x3][_0x6522('0x46')]:undefined)||[]},{'name':_0x6522('0x4d'),'value':_0xed4641[_0x6522('0x4d')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x4]?_0xed4641['attrs'][0x4][_0x6522('0x46')]:undefined)||_0x6522('0x4e')},{'name':_0x6522('0x4f'),'value':_0xed4641[_0x6522('0x4f')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x5]?_0xed4641[_0x6522('0x42')][0x5][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x58'),'value':_0xed4641[_0x6522('0x58')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x6]?_0xed4641[_0x6522('0x42')][0x6][_0x6522('0x46')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xed4641[_0x6522('0x50')]||(_0xed4641['attrs']&&_0xed4641['attrs'][0x7]?_0xed4641[_0x6522('0x42')][0x7][_0x6522('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xed4641[_0x6522('0x51')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x8]?_0xed4641[_0x6522('0x42')][0x8][_0x6522('0x46')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xed4641[_0x6522('0x52')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x9]?_0xed4641[_0x6522('0x42')][0x9][_0x6522('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0xed4641[_0x6522('0x53')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641['attrs'][0xa]?_0xed4641['attrs'][0xa][_0x6522('0x46')]:undefined)||''}];case _0x6522('0x59'):return[{'name':_0x6522('0x5a'),'type':_0xed4641[_0x6522('0x5b')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x5c')]:undefined)||null,'value':_0xed4641[_0x6522('0x5a')]||(_0xed4641['attrs']&&_0xed4641['attrs'][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x46')]:undefined)||null},{'name':_0x6522('0x5d'),'value':_0xed4641[_0x6522('0x5d')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x1]?_0xed4641[_0x6522('0x42')][0x1][_0x6522('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x3e4686){logger[_0x6522('0x2c')](_0x6522('0x5e'),JSON[_0x6522('0x5f')](_0x3e4686));return[];}}exports['create']=function(_0x1cac9e,_0x24c8f8){if(_0x1cac9e[_0x6522('0x60')]){_0x1cac9e[_0x6522('0x60')]['attrs']=widgetAttributes(_0x1cac9e[_0x6522('0x60')]);}return db[_0x6522('0x34')]['create'](_0x1cac9e[_0x6522('0x60')],{})[_0x6522('0x2b')](respondWithResult(_0x24c8f8,0xc9))[_0x6522('0x3f')](handleError(_0x24c8f8,null));};exports[_0x6522('0x61')]=function(_0x1c0ede,_0x11f1e1){if(_0x1c0ede[_0x6522('0x60')]['id']){delete _0x1c0ede[_0x6522('0x60')]['id'];}_0x1c0ede[_0x6522('0x60')][_0x6522('0x42')]=widgetAttributes(_0x1c0ede[_0x6522('0x60')]);return db[_0x6522('0x34')][_0x6522('0x62')]({'where':{'id':_0x1c0ede['params']['id']}})['then'](handleEntityNotFound(_0x11f1e1,null))[_0x6522('0x2b')](saveUpdates(_0x1c0ede['body'],null))[_0x6522('0x2b')](respondWithResult(_0x11f1e1,null))['catch'](handleError(_0x11f1e1,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4b983a2..1457d14 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 _0x156d=['emit','hasOwnProperty','hook','exports','DashboardItem','setMaxListeners','save'];(function(_0x1e7261,_0x12a56f){var _0x1d5505=function(_0x54cadc){while(--_0x54cadc){_0x1e7261['push'](_0x1e7261['shift']());}};_0x1d5505(++_0x12a56f);}(_0x156d,0x162));var _0xd156=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x156d[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xd156('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd156('0x1')](0x0);var events={'afterCreate':_0xd156('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b432d){return function(_0x16a821,_0xf1f7c3,_0x27c11b){DashboardItemEvents['emit'](_0x3b432d+':'+_0x16a821['id'],_0x16a821);DashboardItemEvents[_0xd156('0x3')](_0x3b432d,_0x16a821);_0x27c11b(null);};}for(var e in events){if(events[_0xd156('0x4')](e)){var event=events[e];DashboardItem[_0xd156('0x5')](e,emitEvent(event));}}module[_0xd156('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x4260=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x4ed9ef,_0x381176){var _0x2bb85b=function(_0x35c24d){while(--_0x35c24d){_0x4ed9ef['push'](_0x4ed9ef['shift']());}};_0x2bb85b(++_0x381176);}(_0x4260,0x98));var _0x0426=function(_0x237f49,_0x5f32aa){_0x237f49=_0x237f49-0x0;var _0x480824=_0x4260[_0x237f49];return _0x480824;};'use strict';var EventEmitter=require(_0x0426('0x0'));var DashboardItem=require(_0x0426('0x1'))['db'][_0x0426('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0426('0x3')](0x0);var events={'afterCreate':_0x0426('0x4'),'afterUpdate':_0x0426('0x5'),'afterDestroy':_0x0426('0x6')};function emitEvent(_0x4b3b7d){return function(_0x110f72,_0x302241,_0x5f0352){DashboardItemEvents[_0x0426('0x7')](_0x4b3b7d+':'+_0x110f72['id'],_0x110f72);DashboardItemEvents[_0x0426('0x7')](_0x4b3b7d,_0x110f72);_0x5f0352(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x0426('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index a5b8dc9..7e94b3c 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 _0x64e6=['api','moment','request-promise','path','exports','define','dashboard_items','util','../../config/logger'];(function(_0x56d916,_0x380ed0){var _0x364716=function(_0x32c065){while(--_0x32c065){_0x56d916['push'](_0x56d916['shift']());}};_0x364716(++_0x380ed0);}(_0x64e6,0xcd));var _0x664e=function(_0x405113,_0x12834a){_0x405113=_0x405113-0x0;var _0x890bcc=_0x64e6[_0x405113];return _0x890bcc;};'use strict';var _=require('lodash');var util=require(_0x664e('0x0'));var logger=require(_0x664e('0x1'))(_0x664e('0x2'));var moment=require(_0x664e('0x3'));var BPromise=require('bluebird');var rp=require(_0x664e('0x4'));var fs=require('fs');var path=require(_0x664e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x664e('0x6')]=function(_0x4d634c,_0x2e3184){return _0x4d634c[_0x664e('0x7')]('DashboardItem',attributes,{'tableName':_0x664e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a73=['dashboard_items','lodash','util','bluebird','request-promise','rimraf','./dashboardItem.attributes','DashboardItem'];(function(_0x432b9d,_0x2c3d74){var _0x2e5770=function(_0x2747d1){while(--_0x2747d1){_0x432b9d['push'](_0x432b9d['shift']());}};_0x2e5770(++_0x2c3d74);}(_0x6a73,0x171));var _0x36a7=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0x6a73[_0x57db49];return _0xd0636f;};'use strict';var _=require(_0x36a7('0x0'));var util=require(_0x36a7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x36a7('0x2'));var rp=require(_0x36a7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36a7('0x4'));var config=require('../../config/environment');var attributes=require(_0x36a7('0x5'));module['exports']=function(_0x23ecdb,_0x1ef676){return _0x23ecdb['define'](_0x36a7('0x6'),attributes,{'tableName':_0x36a7('0x7'),'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 8319b3b..4bdff13 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 _0xfee6=['./dashboardItem.socket','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4347c9,_0x5e702f){var _0x863115=function(_0x1a3b36){while(--_0x1a3b36){_0x4347c9['push'](_0x4347c9['shift']());}};_0x863115(++_0x5e702f);}(_0xfee6,0xff));var _0x6fee=function(_0x20c12a,_0x2585e5){_0x20c12a=_0x20c12a-0x0;var _0x1f7791=_0xfee6[_0x20c12a];return _0x1f7791;};'use strict';var _=require(_0x6fee('0x0'));var util=require(_0x6fee('0x1'));var moment=require(_0x6fee('0x2'));var BPromise=require(_0x6fee('0x3'));var rs=require(_0x6fee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6fee('0x5'));var logger=require('../../config/logger')(_0x6fee('0x6'));var config=require(_0x6fee('0x7'));var jayson=require(_0x6fee('0x8'));var client=jayson[_0x6fee('0x9')][_0x6fee('0xa')]({'port':0x232a});config[_0x6fee('0xb')]=_[_0x6fee('0xc')](config['redis'],{'host':_0x6fee('0xd'),'port':0x18eb});var socket=require(_0x6fee('0xe'))(new Redis(config['redis']));require(_0x6fee('0xf'))[_0x6fee('0x10')](socket);function respondWithRpcPromise(_0x31992b,_0x180533,_0x3c4340){return new BPromise(function(_0x57c8a6,_0x5e717f){return client[_0x6fee('0x11')](_0x31992b,_0x3c4340)[_0x6fee('0x12')](function(_0x288c48){logger[_0x6fee('0x13')]('DashboardItem,\x20%s,\x20%s',_0x180533,_0x6fee('0x14'));logger[_0x6fee('0x15')](_0x6fee('0x16'),_0x180533,_0x6fee('0x14'),JSON[_0x6fee('0x17')](_0x288c48));if(_0x288c48[_0x6fee('0x18')]){if(_0x288c48[_0x6fee('0x18')][_0x6fee('0x19')]===0x1f4){logger[_0x6fee('0x18')](_0x6fee('0x1a'),_0x180533,_0x288c48[_0x6fee('0x18')][_0x6fee('0x1b')]);return _0x5e717f(_0x288c48[_0x6fee('0x18')][_0x6fee('0x1b')]);}logger[_0x6fee('0x18')](_0x6fee('0x1a'),_0x180533,_0x288c48[_0x6fee('0x18')][_0x6fee('0x1b')]);return _0x57c8a6(_0x288c48[_0x6fee('0x18')]['message']);}else{logger[_0x6fee('0x13')](_0x6fee('0x1a'),_0x180533,_0x6fee('0x14'));_0x57c8a6(_0x288c48[_0x6fee('0x1c')][_0x6fee('0x1b')]);}})[_0x6fee('0x1d')](function(_0x54bcaf){logger[_0x6fee('0x18')](_0x6fee('0x1a'),_0x180533,_0x54bcaf);_0x5e717f(_0x54bcaf);});});} \ No newline at end of file +var _0xc24e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','result','util','randomstring','../../mysqldb'];(function(_0x3bb571,_0x32cfb7){var _0x54ff33=function(_0x447f2f){while(--_0x447f2f){_0x3bb571['push'](_0x3bb571['shift']());}};_0x54ff33(++_0x32cfb7);}(_0xc24e,0x183));var _0xec24=function(_0x164726,_0x11f6d3){_0x164726=_0x164726-0x0;var _0x29150a=_0xc24e[_0x164726];return _0x29150a;};'use strict';var _=require('lodash');var util=require(_0xec24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xec24('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec24('0x2'))['db'];var utils=require(_0xec24('0x3'));var logger=require(_0xec24('0x4'))('rpc');var config=require(_0xec24('0x5'));var jayson=require(_0xec24('0x6'));var client=jayson[_0xec24('0x7')][_0xec24('0x8')]({'port':0x232a});config[_0xec24('0x9')]=_[_0xec24('0xa')](config[_0xec24('0x9')],{'host':_0xec24('0xb'),'port':0x18eb});var socket=require(_0xec24('0xc'))(new Redis(config[_0xec24('0x9')]));require(_0xec24('0xd'))[_0xec24('0xe')](socket);function respondWithRpcPromise(_0x2719f3,_0x4d533f,_0x1c3417){return new BPromise(function(_0x2e56a0,_0x4ea495){return client[_0xec24('0xf')](_0x2719f3,_0x1c3417)[_0xec24('0x10')](function(_0x5504d0){logger[_0xec24('0x11')]('DashboardItem,\x20%s,\x20%s',_0x4d533f,_0xec24('0x12'));logger[_0xec24('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4d533f,'request\x20sent',JSON[_0xec24('0x14')](_0x5504d0));if(_0x5504d0[_0xec24('0x15')]){if(_0x5504d0[_0xec24('0x15')][_0xec24('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x4d533f,_0x5504d0[_0xec24('0x15')]['message']);return _0x4ea495(_0x5504d0[_0xec24('0x15')][_0xec24('0x17')]);}logger[_0xec24('0x15')]('DashboardItem,\x20%s,\x20%s',_0x4d533f,_0x5504d0[_0xec24('0x15')][_0xec24('0x17')]);return _0x2e56a0(_0x5504d0[_0xec24('0x15')][_0xec24('0x17')]);}else{logger[_0xec24('0x11')](_0xec24('0x18'),_0x4d533f,_0xec24('0x12'));_0x2e56a0(_0x5504d0[_0xec24('0x19')]['message']);}})['catch'](function(_0x328db1){logger[_0xec24('0x15')](_0xec24('0x18'),_0x4d533f,_0x328db1);_0x4ea495(_0x328db1);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 09b5860..77faa15 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 _0xb9a0=['./dashboardItem.events','save','remove','update','emit','register','dashboardItem:'];(function(_0x1d930b,_0xb8483b){var _0x4ce07d=function(_0x497ccf){while(--_0x497ccf){_0x1d930b['push'](_0x1d930b['shift']());}};_0x4ce07d(++_0xb8483b);}(_0xb9a0,0xa1));var _0x0b9a=function(_0x595619,_0x3b7ea6){_0x595619=_0x595619-0x0;var _0x30a1e4=_0xb9a0[_0x595619];return _0x30a1e4;};'use strict';var DashboardItemEvents=require(_0x0b9a('0x0'));var events=[_0x0b9a('0x1'),_0x0b9a('0x2'),_0x0b9a('0x3')];function createListener(_0x1a11aa,_0x53801a){return function(_0x474f7d){_0x53801a[_0x0b9a('0x4')](_0x1a11aa,_0x474f7d);};}function removeListener(_0x52ec31,_0x24eee5){return function(){DashboardItemEvents['removeListener'](_0x52ec31,_0x24eee5);};}exports[_0x0b9a('0x5')]=function(_0x33230f){for(var _0x312e3e=0x0,_0x4ac088=events['length'];_0x312e3e<_0x4ac088;_0x312e3e++){var _0x1465b5=events[_0x312e3e];var _0x1b50f7=createListener(_0x0b9a('0x6')+_0x1465b5,_0x33230f);DashboardItemEvents['on'](_0x1465b5,_0x1b50f7);}}; \ No newline at end of file +var _0x95a6=['emit','removeListener','register','dashboardItem:','./dashboardItem.events','save','update'];(function(_0x3b86d5,_0x2264a2){var _0x527c20=function(_0x29f33c){while(--_0x29f33c){_0x3b86d5['push'](_0x3b86d5['shift']());}};_0x527c20(++_0x2264a2);}(_0x95a6,0x10e));var _0x695a=function(_0x526d51,_0x22fa21){_0x526d51=_0x526d51-0x0;var _0x545b1d=_0x95a6[_0x526d51];return _0x545b1d;};'use strict';var DashboardItemEvents=require(_0x695a('0x0'));var events=[_0x695a('0x1'),'remove',_0x695a('0x2')];function createListener(_0x4d6889,_0x39f1fb){return function(_0x91c8b9){_0x39f1fb[_0x695a('0x3')](_0x4d6889,_0x91c8b9);};}function removeListener(_0x45571f,_0x3add7f){return function(){DashboardItemEvents[_0x695a('0x4')](_0x45571f,_0x3add7f);};}exports[_0x695a('0x5')]=function(_0x3a4e69){for(var _0x50c82d=0x0,_0x3bfac2=events['length'];_0x50c82d<_0x3bfac2;_0x50c82d++){var _0x4b0e69=events[_0x50c82d];var _0x1530b7=createListener(_0x695a('0x6')+_0x4b0e69,_0x3a4e69);DashboardItemEvents['on'](_0x4b0e69,_0x1530b7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 39ec3c0..dec056f 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 _0x7f4f=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get'];(function(_0x5d9d06,_0x347308){var _0x18cf4a=function(_0x23d263){while(--_0x23d263){_0x5d9d06['push'](_0x5d9d06['shift']());}};_0x18cf4a(++_0x347308);}(_0x7f4f,0xdb));var _0xf7f4=function(_0x4f8669,_0x1095dd){_0x4f8669=_0x4f8669-0x0;var _0x581aaa=_0x7f4f[_0x4f8669];return _0x581aaa;};'use strict';var multer=require(_0xf7f4('0x0'));var util=require('util');var path=require(_0xf7f4('0x1'));var timeout=require(_0xf7f4('0x2'));var express=require(_0xf7f4('0x3'));var router=express[_0xf7f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf7f4('0x5'));var interaction=require(_0xf7f4('0x6'));var config=require('../../config/environment');var controller=require(_0xf7f4('0x7'));router[_0xf7f4('0x8')](_0xf7f4('0x9'),auth[_0xf7f4('0xa')](),controller[_0xf7f4('0xb')]);router[_0xf7f4('0xc')]('/',auth[_0xf7f4('0xa')](),controller[_0xf7f4('0xd')]);router[_0xf7f4('0xe')](_0xf7f4('0x9'),auth[_0xf7f4('0xa')](),controller[_0xf7f4('0xf')]);router[_0xf7f4('0x10')](_0xf7f4('0x9'),auth[_0xf7f4('0xa')](),controller[_0xf7f4('0x11')]);module[_0xf7f4('0x12')]=router; \ No newline at end of file +var _0x454a=['create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x454a,0xae));var _0xa454=function(_0x527666,_0x5009c3){_0x527666=_0x527666-0x0;var _0x359827=_0x454a[_0x527666];return _0x359827;};'use strict';var multer=require(_0xa454('0x0'));var util=require('util');var path=require(_0xa454('0x1'));var timeout=require(_0xa454('0x2'));var express=require(_0xa454('0x3'));var router=express[_0xa454('0x4')]();var fs_extra=require(_0xa454('0x5'));var auth=require(_0xa454('0x6'));var interaction=require(_0xa454('0x7'));var config=require(_0xa454('0x8'));var controller=require('./dashboardItem.controller');router[_0xa454('0x9')](_0xa454('0xa'),auth[_0xa454('0xb')](),controller['show']);router[_0xa454('0xc')]('/',auth[_0xa454('0xb')](),controller[_0xa454('0xd')]);router[_0xa454('0xe')](_0xa454('0xa'),auth[_0xa454('0xb')](),controller[_0xa454('0xf')]);router[_0xa454('0x10')](_0xa454('0xa'),auth[_0xa454('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f0e6377..fb34296 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 _0x2df3=['STRING','ENUM','first','second','third','sequelize','exports'];(function(_0x39e4a1,_0x4edcc5){var _0x55b30e=function(_0x5efd8e){while(--_0x5efd8e){_0x39e4a1['push'](_0x39e4a1['shift']());}};_0x55b30e(++_0x4edcc5);}(_0x2df3,0xd0));var _0x32df=function(_0x3ce2ba,_0x1fcb4d){_0x3ce2ba=_0x3ce2ba-0x0;var _0xe75af3=_0x2df3[_0x3ce2ba];return _0xe75af3;};'use strict';var Sequelize=require(_0x32df('0x0'));module[_0x32df('0x1')]={'name':{'type':Sequelize[_0x32df('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x32df('0x3')](_0x32df('0x4'),_0x32df('0x5'),_0x32df('0x6')),'allowNull':![],'defaultValue':_0x32df('0x4')},'description':{'type':Sequelize[_0x32df('0x2')]}}; \ No newline at end of file +var _0x1e5b=['exports','ENUM','first','second','STRING'];(function(_0x20ff08,_0x33b79f){var _0x37a85f=function(_0xa8b024){while(--_0xa8b024){_0x20ff08['push'](_0x20ff08['shift']());}};_0x37a85f(++_0x33b79f);}(_0x1e5b,0x82));var _0xb1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xb1e5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xb1e5('0x1')](_0xb1e5('0x2'),_0xb1e5('0x3'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xb1e5('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 9a555ad..e980a01 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 _0x4a99=['includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','user','role','find','userProfileId','autoAssociation','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','Dispositions','UserProfileResource','then','error','stack','name','index','map','Disposition','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x220902,_0x421928){var _0x5e7f1b=function(_0x35aaf2){while(--_0x35aaf2){_0x220902['push'](_0x220902['shift']());}};_0x5e7f1b(++_0x421928);}(_0x4a99,0x1aa));var _0x94a9=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4a99[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0x94a9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94a9('0x1'));var rp=require(_0x94a9('0x2'));var moment=require('moment');var BPromise=require(_0x94a9('0x3'));var Mustache=require('mustache');var util=require(_0x94a9('0x4'));var path=require(_0x94a9('0x5'));var sox=require(_0x94a9('0x6'));var csv=require('to-csv');var ejs=require(_0x94a9('0x7'));var fs=require('fs');var fs_extra=require(_0x94a9('0x8'));var _=require('lodash');var squel=require(_0x94a9('0x9'));var crypto=require(_0x94a9('0xa'));var jsforce=require(_0x94a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x94a9('0xc'));var querystring=require('querystring');var Papa=require(_0x94a9('0xd'));var Redis=require(_0x94a9('0xe'));var authService=require(_0x94a9('0xf'));var qs=require(_0x94a9('0x10'));var as=require(_0x94a9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94a9('0x12'))(_0x94a9('0x13'));var utils=require(_0x94a9('0x14'));var config=require(_0x94a9('0x15'));var licenseUtil=require(_0x94a9('0x16'));var db=require(_0x94a9('0x17'))['db'];function respondWithStatusCode(_0x458862,_0x54800a){_0x54800a=_0x54800a||0xcc;return function(_0x5c2acb){if(_0x5c2acb){return _0x458862[_0x94a9('0x18')](_0x54800a);}return _0x458862[_0x94a9('0x19')](_0x54800a)[_0x94a9('0x1a')]();};}function respondWithResult(_0x1fecdc,_0x3d29a3){_0x3d29a3=_0x3d29a3||0xc8;return function(_0xb1794d){if(_0xb1794d){return _0x1fecdc[_0x94a9('0x19')](_0x3d29a3)['json'](_0xb1794d);}};}function respondWithFilteredResult(_0x4fe0ff,_0x352197){return function(_0x25f346){if(_0x25f346){var _0x5b3006=typeof _0x352197['offset']===_0x94a9('0x1b')&&typeof _0x352197[_0x94a9('0x1c')]===_0x94a9('0x1b');var _0x1fd764=_0x25f346[_0x94a9('0x1d')];var _0x32596a=_0x5b3006?0x0:_0x352197[_0x94a9('0x1e')];var _0x50f4a6=_0x5b3006?_0x25f346[_0x94a9('0x1d')]:_0x352197[_0x94a9('0x1e')]+_0x352197[_0x94a9('0x1c')];var _0x4bbed8;if(_0x50f4a6>=_0x1fd764){_0x50f4a6=_0x1fd764;_0x4bbed8=0xc8;}else{_0x4bbed8=0xce;}_0x4fe0ff['status'](_0x4bbed8);return _0x4fe0ff[_0x94a9('0x1f')](_0x94a9('0x20'),_0x32596a+'-'+_0x50f4a6+'/'+_0x1fd764)['json'](_0x25f346);}return null;};}function patchUpdates(_0x369210){return function(_0x1fb178){try{jsonpatch[_0x94a9('0x21')](_0x1fb178,_0x369210,!![]);}catch(_0x346ee1){return BPromise[_0x94a9('0x22')](_0x346ee1);}return _0x1fb178[_0x94a9('0x23')]();};}function saveUpdates(_0x397db8,_0xa0f131){return function(_0x5244df){if(_0x5244df){return _0x5244df[_0x94a9('0x24')](_0x397db8)['then'](function(_0x23038e){return _0x23038e;});}return null;};}function removeEntity(_0x39b9b8,_0x4e96b1){return function(_0x5ebc84){if(_0x5ebc84){return _0x5ebc84[_0x94a9('0x25')]()['then'](function(){var _0x5924c6=_0x5ebc84[_0x94a9('0x26')]({'plain':!![]});var _0x1b393e=_0x94a9('0x27');return db[_0x94a9('0x28')][_0x94a9('0x25')]({'where':{'type':_0x1b393e,'resourceId':_0x5924c6['id']}})['then'](function(){return _0x5ebc84;});})[_0x94a9('0x29')](function(){_0x39b9b8[_0x94a9('0x19')](0xcc)[_0x94a9('0x1a')]();});}};}function handleEntityNotFound(_0x1b6a5a,_0x2f6033){return function(_0x5aedca){if(!_0x5aedca){_0x1b6a5a[_0x94a9('0x18')](0x194);}return _0x5aedca;};}function handleError(_0x51487f,_0x3dd9f8){_0x3dd9f8=_0x3dd9f8||0x1f4;return function(_0x196b1c){logger[_0x94a9('0x2a')](_0x196b1c[_0x94a9('0x2b')]);if(_0x196b1c[_0x94a9('0x2c')]){delete _0x196b1c['name'];}_0x51487f[_0x94a9('0x19')](_0x3dd9f8)['send'](_0x196b1c);};}exports[_0x94a9('0x2d')]=function(_0xbfc50d,_0x300404){var _0x3ed257={},_0x46b386={},_0x334010={'count':0x0,'rows':[]};var _0x2e51ee=_[_0x94a9('0x2e')](db[_0x94a9('0x2f')][_0x94a9('0x30')],function(_0x1a339a){return{'name':_0x1a339a['fieldName'],'type':_0x1a339a[_0x94a9('0x31')][_0x94a9('0x32')]};});_0x46b386[_0x94a9('0x33')]=_[_0x94a9('0x2e')](_0x2e51ee,_0x94a9('0x2c'));_0x46b386[_0x94a9('0x34')]=_['keys'](_0xbfc50d[_0x94a9('0x34')]);_0x46b386[_0x94a9('0x35')]=_[_0x94a9('0x36')](_0x46b386[_0x94a9('0x33')],_0x46b386[_0x94a9('0x34')]);_0x3ed257['attributes']=_[_0x94a9('0x36')](_0x46b386[_0x94a9('0x33')],qs['fields'](_0xbfc50d[_0x94a9('0x34')][_0x94a9('0x37')]));_0x3ed257[_0x94a9('0x38')]=_0x3ed257[_0x94a9('0x38')]['length']?_0x3ed257[_0x94a9('0x38')]:_0x46b386[_0x94a9('0x33')];if(!_0xbfc50d[_0x94a9('0x34')][_0x94a9('0x39')]('nolimit')){_0x3ed257[_0x94a9('0x1c')]=qs[_0x94a9('0x1c')](_0xbfc50d[_0x94a9('0x34')]['limit']);_0x3ed257[_0x94a9('0x1e')]=qs[_0x94a9('0x1e')](_0xbfc50d[_0x94a9('0x34')][_0x94a9('0x1e')]);}_0x3ed257[_0x94a9('0x3a')]=qs[_0x94a9('0x3b')](_0xbfc50d[_0x94a9('0x34')][_0x94a9('0x3b')]);_0x3ed257[_0x94a9('0x3c')]=qs[_0x94a9('0x35')](_[_0x94a9('0x3d')](_0xbfc50d[_0x94a9('0x34')],_0x46b386[_0x94a9('0x35')]),_0x2e51ee);if(_0xbfc50d[_0x94a9('0x34')][_0x94a9('0x3e')]){_0x3ed257[_0x94a9('0x3c')]=_[_0x94a9('0x3f')](_0x3ed257['where'],{'$or':_[_0x94a9('0x2e')](_0x2e51ee,function(_0x531f6d){if(_0x531f6d[_0x94a9('0x31')]!==_0x94a9('0x40')){var _0xe599f6={};_0xe599f6[_0x531f6d[_0x94a9('0x2c')]]={'$like':'%'+_0xbfc50d['query'][_0x94a9('0x3e')]+'%'};return _0xe599f6;}})});}_0x3ed257=_[_0x94a9('0x3f')]({},_0x3ed257,_0xbfc50d[_0x94a9('0x41')]);var _0x4534f8={'where':_0x3ed257['where']};return db[_0x94a9('0x2f')][_0x94a9('0x1d')](_0x4534f8)[_0x94a9('0x29')](function(_0x51875e){_0x334010[_0x94a9('0x1d')]=_0x51875e;if(_0xbfc50d[_0x94a9('0x34')][_0x94a9('0x42')]){_0x3ed257[_0x94a9('0x43')]=[{'all':!![]}];}return db[_0x94a9('0x2f')][_0x94a9('0x44')](_0x3ed257);})[_0x94a9('0x29')](function(_0x4f9167){_0x334010[_0x94a9('0x45')]=_0x4f9167;return _0x334010;})[_0x94a9('0x29')](respondWithFilteredResult(_0x300404,_0x3ed257))[_0x94a9('0x46')](handleError(_0x300404,null));};exports[_0x94a9('0x47')]=function(_0x4a7ae3,_0x2feae9){var _0x42603c={'raw':!![],'where':{'id':_0x4a7ae3[_0x94a9('0x48')]['id']}},_0x3afb20={};_0x3afb20[_0x94a9('0x33')]=_[_0x94a9('0x49')](db[_0x94a9('0x2f')][_0x94a9('0x30')]);_0x3afb20[_0x94a9('0x34')]=_[_0x94a9('0x49')](_0x4a7ae3[_0x94a9('0x34')]);_0x3afb20['filters']=_['intersection'](_0x3afb20[_0x94a9('0x33')],_0x3afb20[_0x94a9('0x34')]);_0x42603c[_0x94a9('0x38')]=_[_0x94a9('0x36')](_0x3afb20['model'],qs['fields'](_0x4a7ae3['query'][_0x94a9('0x37')]));_0x42603c['attributes']=_0x42603c[_0x94a9('0x38')][_0x94a9('0x4a')]?_0x42603c[_0x94a9('0x38')]:_0x3afb20[_0x94a9('0x33')];if(_0x4a7ae3[_0x94a9('0x34')][_0x94a9('0x42')]){_0x42603c[_0x94a9('0x43')]=[{'all':!![]}];}_0x42603c=_[_0x94a9('0x3f')]({},_0x42603c,_0x4a7ae3[_0x94a9('0x41')]);return db[_0x94a9('0x2f')]['find'](_0x42603c)[_0x94a9('0x29')](handleEntityNotFound(_0x2feae9,null))['then'](respondWithResult(_0x2feae9,null))['catch'](handleError(_0x2feae9,null));};exports[_0x94a9('0x4b')]=function(_0xd28312,_0x4e617c){return db[_0x94a9('0x2f')][_0x94a9('0x4b')](_0xd28312[_0x94a9('0x4c')],{})['then'](function(_0x526d9a){var _0x4d2997=_0xd28312[_0x94a9('0x4d')][_0x94a9('0x26')]({'plain':!![]});if(!_0x4d2997)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d2997[_0x94a9('0x4e')]===_0x94a9('0x4d')){var _0xe707e6=_0x526d9a['get']({'plain':!![]});var _0x3e77f2=_0x94a9('0x27');return db['UserProfileSection'][_0x94a9('0x4f')]({'where':{'name':_0x3e77f2,'userProfileId':_0x4d2997[_0x94a9('0x50')]},'raw':!![]})[_0x94a9('0x29')](function(_0xc0f61b){if(_0xc0f61b&&_0xc0f61b[_0x94a9('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xe707e6[_0x94a9('0x2c')],'resourceId':_0xe707e6['id'],'type':_0xc0f61b[_0x94a9('0x2c')],'sectionId':_0xc0f61b['id']},{})[_0x94a9('0x29')](function(){return _0x526d9a;});}else{return _0x526d9a;}})[_0x94a9('0x46')](function(_0x143d8f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x143d8f);throw _0x143d8f;});}return _0x526d9a;})[_0x94a9('0x29')](respondWithResult(_0x4e617c,0xc9))['catch'](handleError(_0x4e617c,null));};exports[_0x94a9('0x24')]=function(_0x1829df,_0x34575f){if(_0x1829df['body']['id']){delete _0x1829df['body']['id'];}return db['Disposition'][_0x94a9('0x4f')]({'where':{'id':_0x1829df[_0x94a9('0x48')]['id']}})[_0x94a9('0x29')](handleEntityNotFound(_0x34575f,null))['then'](saveUpdates(_0x1829df[_0x94a9('0x4c')],null))[_0x94a9('0x29')](respondWithResult(_0x34575f,null))[_0x94a9('0x46')](handleError(_0x34575f,null));};exports[_0x94a9('0x25')]=function(_0x4d6362,_0x543c01){return db['Disposition'][_0x94a9('0x4f')]({'where':{'id':_0x4d6362[_0x94a9('0x48')]['id']}})[_0x94a9('0x29')](handleEntityNotFound(_0x543c01,null))[_0x94a9('0x29')](removeEntity(_0x543c01,null))['catch'](handleError(_0x543c01,null));}; \ No newline at end of file +var _0x0804=['offset','limit','set','Content-Range','reject','save','destroy','then','Dispositions','UserProfileResource','error','stack','send','map','rawAttributes','key','model','name','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','Disposition','findAll','params','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count'];(function(_0x861b93,_0x530847){var _0x3e8988=function(_0x290a3f){while(--_0x290a3f){_0x861b93['push'](_0x861b93['shift']());}};_0x3e8988(++_0x530847);}(_0x0804,0x175));var _0x4080=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x0804[_0x2f3794];return _0x1c9fbe;};'use strict';var emlformat=require(_0x4080('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4080('0x1'));var jsonpatch=require(_0x4080('0x2'));var rp=require(_0x4080('0x3'));var moment=require('moment');var BPromise=require(_0x4080('0x4'));var Mustache=require(_0x4080('0x5'));var util=require(_0x4080('0x6'));var path=require(_0x4080('0x7'));var sox=require(_0x4080('0x8'));var csv=require(_0x4080('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4080('0xa'));var _=require(_0x4080('0xb'));var squel=require(_0x4080('0xc'));var crypto=require(_0x4080('0xd'));var jsforce=require(_0x4080('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4080('0xf'));var Papa=require(_0x4080('0x10'));var Redis=require(_0x4080('0x11'));var authService=require(_0x4080('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4080('0x13'));var logger=require(_0x4080('0x14'))(_0x4080('0x15'));var utils=require(_0x4080('0x16'));var config=require(_0x4080('0x17'));var licenseUtil=require(_0x4080('0x18'));var db=require(_0x4080('0x19'))['db'];function respondWithStatusCode(_0x2e2895,_0x79cc8e){_0x79cc8e=_0x79cc8e||0xcc;return function(_0x56cc47){if(_0x56cc47){return _0x2e2895[_0x4080('0x1a')](_0x79cc8e);}return _0x2e2895['status'](_0x79cc8e)[_0x4080('0x1b')]();};}function respondWithResult(_0x237b05,_0x58cc13){_0x58cc13=_0x58cc13||0xc8;return function(_0x3377f2){if(_0x3377f2){return _0x237b05[_0x4080('0x1c')](_0x58cc13)[_0x4080('0x1d')](_0x3377f2);}};}function respondWithFilteredResult(_0x20fa70,_0x14c9b2){return function(_0x43eb6e){if(_0x43eb6e){var _0x686a0d=typeof _0x14c9b2['offset']==='undefined'&&typeof _0x14c9b2['limit']===_0x4080('0x1e');var _0x5874e1=_0x43eb6e[_0x4080('0x1f')];var _0x3a153e=_0x686a0d?0x0:_0x14c9b2[_0x4080('0x20')];var _0x3b104b=_0x686a0d?_0x43eb6e[_0x4080('0x1f')]:_0x14c9b2[_0x4080('0x20')]+_0x14c9b2[_0x4080('0x21')];var _0x288926;if(_0x3b104b>=_0x5874e1){_0x3b104b=_0x5874e1;_0x288926=0xc8;}else{_0x288926=0xce;}_0x20fa70[_0x4080('0x1c')](_0x288926);return _0x20fa70[_0x4080('0x22')](_0x4080('0x23'),_0x3a153e+'-'+_0x3b104b+'/'+_0x5874e1)[_0x4080('0x1d')](_0x43eb6e);}return null;};}function patchUpdates(_0x59b19d){return function(_0x366c36){try{jsonpatch['apply'](_0x366c36,_0x59b19d,!![]);}catch(_0x281d9b){return BPromise[_0x4080('0x24')](_0x281d9b);}return _0x366c36[_0x4080('0x25')]();};}function saveUpdates(_0x361c40,_0x2c2453){return function(_0x3a41ff){if(_0x3a41ff){return _0x3a41ff['update'](_0x361c40)['then'](function(_0x34cf97){return _0x34cf97;});}return null;};}function removeEntity(_0x3b700f,_0x258451){return function(_0x1d075c){if(_0x1d075c){return _0x1d075c[_0x4080('0x26')]()[_0x4080('0x27')](function(){var _0x106693=_0x1d075c['get']({'plain':!![]});var _0x42e00b=_0x4080('0x28');return db[_0x4080('0x29')][_0x4080('0x26')]({'where':{'type':_0x42e00b,'resourceId':_0x106693['id']}})['then'](function(){return _0x1d075c;});})[_0x4080('0x27')](function(){_0x3b700f[_0x4080('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xda29a3,_0x309d5c){return function(_0x249060){if(!_0x249060){_0xda29a3[_0x4080('0x1a')](0x194);}return _0x249060;};}function handleError(_0x33c090,_0x64be3b){_0x64be3b=_0x64be3b||0x1f4;return function(_0x28c12f){logger[_0x4080('0x2a')](_0x28c12f[_0x4080('0x2b')]);if(_0x28c12f['name']){delete _0x28c12f['name'];}_0x33c090['status'](_0x64be3b)[_0x4080('0x2c')](_0x28c12f);};}exports['index']=function(_0x54ca72,_0x262463){var _0x4f58ff={},_0x160d03={},_0x42887f={'count':0x0,'rows':[]};var _0x24aaf3=_[_0x4080('0x2d')](db['Disposition'][_0x4080('0x2e')],function(_0x5ce817){return{'name':_0x5ce817['fieldName'],'type':_0x5ce817['type'][_0x4080('0x2f')]};});_0x160d03[_0x4080('0x30')]=_[_0x4080('0x2d')](_0x24aaf3,_0x4080('0x31'));_0x160d03[_0x4080('0x32')]=_['keys'](_0x54ca72[_0x4080('0x32')]);_0x160d03[_0x4080('0x33')]=_[_0x4080('0x34')](_0x160d03['model'],_0x160d03['query']);_0x4f58ff[_0x4080('0x35')]=_['intersection'](_0x160d03[_0x4080('0x30')],qs['fields'](_0x54ca72[_0x4080('0x32')]['fields']));_0x4f58ff[_0x4080('0x35')]=_0x4f58ff[_0x4080('0x35')]['length']?_0x4f58ff[_0x4080('0x35')]:_0x160d03[_0x4080('0x30')];if(!_0x54ca72[_0x4080('0x32')][_0x4080('0x36')](_0x4080('0x37'))){_0x4f58ff['limit']=qs[_0x4080('0x21')](_0x54ca72[_0x4080('0x32')][_0x4080('0x21')]);_0x4f58ff['offset']=qs[_0x4080('0x20')](_0x54ca72['query'][_0x4080('0x20')]);}_0x4f58ff[_0x4080('0x38')]=qs['sort'](_0x54ca72[_0x4080('0x32')][_0x4080('0x39')]);_0x4f58ff['where']=qs[_0x4080('0x33')](_[_0x4080('0x3a')](_0x54ca72[_0x4080('0x32')],_0x160d03[_0x4080('0x33')]),_0x24aaf3);if(_0x54ca72[_0x4080('0x32')][_0x4080('0x3b')]){_0x4f58ff[_0x4080('0x3c')]=_[_0x4080('0x3d')](_0x4f58ff['where'],{'$or':_[_0x4080('0x2d')](_0x24aaf3,function(_0x2ce308){if(_0x2ce308[_0x4080('0x3e')]!=='VIRTUAL'){var _0x471b6d={};_0x471b6d[_0x2ce308['name']]={'$like':'%'+_0x54ca72[_0x4080('0x32')][_0x4080('0x3b')]+'%'};return _0x471b6d;}})});}_0x4f58ff=_['merge']({},_0x4f58ff,_0x54ca72[_0x4080('0x3f')]);var _0x13b0ec={'where':_0x4f58ff[_0x4080('0x3c')]};return db[_0x4080('0x40')][_0x4080('0x1f')](_0x13b0ec)[_0x4080('0x27')](function(_0x365d51){_0x42887f[_0x4080('0x1f')]=_0x365d51;if(_0x54ca72[_0x4080('0x32')]['includeAll']){_0x4f58ff['include']=[{'all':!![]}];}return db[_0x4080('0x40')][_0x4080('0x41')](_0x4f58ff);})[_0x4080('0x27')](function(_0x1bc296){_0x42887f['rows']=_0x1bc296;return _0x42887f;})[_0x4080('0x27')](respondWithFilteredResult(_0x262463,_0x4f58ff))['catch'](handleError(_0x262463,null));};exports['show']=function(_0x278495,_0x4ba5d6){var _0x2cef49={'raw':!![],'where':{'id':_0x278495[_0x4080('0x42')]['id']}},_0x308340={};_0x308340[_0x4080('0x30')]=_['keys'](db['Disposition']['rawAttributes']);_0x308340['query']=_[_0x4080('0x43')](_0x278495[_0x4080('0x32')]);_0x308340[_0x4080('0x33')]=_[_0x4080('0x34')](_0x308340[_0x4080('0x30')],_0x308340['query']);_0x2cef49[_0x4080('0x35')]=_[_0x4080('0x34')](_0x308340[_0x4080('0x30')],qs['fields'](_0x278495[_0x4080('0x32')]['fields']));_0x2cef49['attributes']=_0x2cef49['attributes']['length']?_0x2cef49[_0x4080('0x35')]:_0x308340[_0x4080('0x30')];if(_0x278495[_0x4080('0x32')]['includeAll']){_0x2cef49[_0x4080('0x44')]=[{'all':!![]}];}_0x2cef49=_[_0x4080('0x3d')]({},_0x2cef49,_0x278495['options']);return db[_0x4080('0x40')][_0x4080('0x45')](_0x2cef49)[_0x4080('0x27')](handleEntityNotFound(_0x4ba5d6,null))['then'](respondWithResult(_0x4ba5d6,null))[_0x4080('0x46')](handleError(_0x4ba5d6,null));};exports[_0x4080('0x47')]=function(_0x213f45,_0x58202b){return db[_0x4080('0x40')][_0x4080('0x47')](_0x213f45[_0x4080('0x48')],{})['then'](function(_0x4d465b){var _0x145e49=_0x213f45[_0x4080('0x49')]['get']({'plain':!![]});if(!_0x145e49)throw new Error(_0x4080('0x4a'));if(_0x145e49[_0x4080('0x4b')]===_0x4080('0x49')){var _0x30b362=_0x4d465b[_0x4080('0x4c')]({'plain':!![]});var _0x648e80=_0x4080('0x28');return db[_0x4080('0x4d')]['find']({'where':{'name':_0x648e80,'userProfileId':_0x145e49[_0x4080('0x4e')]},'raw':!![]})[_0x4080('0x27')](function(_0x4dde66){if(_0x4dde66&&_0x4dde66[_0x4080('0x4f')]===0x0){return db['UserProfileResource'][_0x4080('0x47')]({'name':_0x30b362['name'],'resourceId':_0x30b362['id'],'type':_0x4dde66['name'],'sectionId':_0x4dde66['id']},{})[_0x4080('0x27')](function(){return _0x4d465b;});}else{return _0x4d465b;}})[_0x4080('0x46')](function(_0xc0f54d){logger['error'](_0x4080('0x50'),_0xc0f54d);throw _0xc0f54d;});}return _0x4d465b;})[_0x4080('0x27')](respondWithResult(_0x58202b,0xc9))[_0x4080('0x46')](handleError(_0x58202b,null));};exports['update']=function(_0x4ff9ae,_0xbcbfb1){if(_0x4ff9ae[_0x4080('0x48')]['id']){delete _0x4ff9ae[_0x4080('0x48')]['id'];}return db[_0x4080('0x40')][_0x4080('0x45')]({'where':{'id':_0x4ff9ae[_0x4080('0x42')]['id']}})[_0x4080('0x27')](handleEntityNotFound(_0xbcbfb1,null))[_0x4080('0x27')](saveUpdates(_0x4ff9ae[_0x4080('0x48')],null))[_0x4080('0x27')](respondWithResult(_0xbcbfb1,null))[_0x4080('0x46')](handleError(_0xbcbfb1,null));};exports[_0x4080('0x26')]=function(_0x254bb7,_0x15a2f3){return db['Disposition'][_0x4080('0x45')]({'where':{'id':_0x254bb7[_0x4080('0x42')]['id']}})[_0x4080('0x27')](handleEntityNotFound(_0x15a2f3,null))[_0x4080('0x27')](removeEntity(_0x15a2f3,null))[_0x4080('0x46')](handleError(_0x15a2f3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 382b4e1..2934fa8 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 _0x1773=['name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./disposition.attributes','define','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms'];(function(_0x51fc4d,_0x105298){var _0x48788e=function(_0x1d87f7){while(--_0x1d87f7){_0x51fc4d['push'](_0x51fc4d['shift']());}};_0x48788e(++_0x105298);}(_0x1773,0x1a9));var _0x3177=function(_0x47e915,_0x4afe78){_0x47e915=_0x47e915-0x0;var _0x3f6ccf=_0x1773[_0x47e915];return _0x3f6ccf;};'use strict';var _=require(_0x3177('0x0'));var util=require(_0x3177('0x1'));var logger=require(_0x3177('0x2'))(_0x3177('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3177('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3177('0x5'));var config=require(_0x3177('0x6'));var attributes=require(_0x3177('0x7'));module['exports']=function(_0x16e885,_0x3d07a7){return _0x16e885[_0x3177('0x8')]('Disposition',attributes,{'tableName':_0x3177('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x3177('0xa'),_0x3177('0xb')]},{'unique':!![],'name':_0x3177('0xc'),'fields':['name',_0x3177('0xd')]},{'unique':!![],'name':_0x3177('0xe'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0x3177('0xf'),'fields':[_0x3177('0xa'),'SmsAccountId']},{'unique':!![],'name':_0x3177('0x10'),'fields':[_0x3177('0xa'),_0x3177('0x11')]},{'unique':!![],'name':_0x3177('0x12'),'fields':[_0x3177('0xa'),'OpenchannelAccountId']},{'unique':!![],'name':_0x3177('0x13'),'fields':[_0x3177('0xa'),_0x3177('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x77e5=['name','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','bluebird','../../config/environment','define','name_voice','ListId','name_chat'];(function(_0x11b55e,_0x47f1ff){var _0x268a13=function(_0x3dc694){while(--_0x3dc694){_0x11b55e['push'](_0x11b55e['shift']());}};_0x268a13(++_0x47f1ff);}(_0x77e5,0x1b8));var _0x577e=function(_0x4b6019,_0x500a56){_0x4b6019=_0x4b6019-0x0;var _0x27b8eb=_0x77e5[_0x4b6019];return _0x27b8eb;};'use strict';var _=require(_0x577e('0x0'));var util=require(_0x577e('0x1'));var logger=require(_0x577e('0x2'))(_0x577e('0x3'));var moment=require('moment');var BPromise=require(_0x577e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x577e('0x5'));var attributes=require('./disposition.attributes');module['exports']=function(_0x337c4f,_0x216bb1){return _0x337c4f[_0x577e('0x6')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x577e('0x7'),'fields':['name',_0x577e('0x8')]},{'unique':!![],'name':_0x577e('0x9'),'fields':[_0x577e('0xa'),'ChatWebsiteId']},{'unique':!![],'name':_0x577e('0xb'),'fields':['name',_0x577e('0xc')]},{'unique':!![],'name':'name_sms','fields':[_0x577e('0xa'),_0x577e('0xd')]},{'unique':!![],'name':_0x577e('0xe'),'fields':[_0x577e('0xa'),_0x577e('0xf')]},{'unique':!![],'name':_0x577e('0x10'),'fields':['name',_0x577e('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x577e('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 1d0c4f4..925c1a9 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(_0x13cc36,_0x121bfe){var _0x391fd2=function(_0x424002){while(--_0x424002){_0x13cc36['push'](_0x13cc36['shift']());}};_0x391fd2(++_0x121bfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x1c460e,_0xafaa8a){var _0x1a4498=function(_0x1b2b01){while(--_0x1b2b01){_0x1c460e['push'](_0x1c460e['shift']());}};_0x1a4498(++_0xafaa8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 7a70169..258917f 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 _0x9af4=['update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put'];(function(_0x2ee69d,_0x308214){var _0x3abd2a=function(_0x37f5d4){while(--_0x37f5d4){_0x2ee69d['push'](_0x2ee69d['shift']());}};_0x3abd2a(++_0x308214);}(_0x9af4,0x183));var _0x49af=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9af4[_0x279d37];return _0x530173;};'use strict';var multer=require(_0x49af('0x0'));var util=require(_0x49af('0x1'));var path=require(_0x49af('0x2'));var timeout=require('connect-timeout');var express=require(_0x49af('0x3'));var router=express[_0x49af('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x49af('0x5'));var config=require(_0x49af('0x6'));var controller=require('./disposition.controller');router[_0x49af('0x7')]('/',auth['isAuthenticated'](),controller[_0x49af('0x8')]);router['get'](_0x49af('0x9'),auth[_0x49af('0xa')](),controller['show']);router['post']('/',auth[_0x49af('0xa')](),controller[_0x49af('0xb')]);router[_0x49af('0xc')](_0x49af('0x9'),auth[_0x49af('0xa')](),controller[_0x49af('0xd')]);router[_0x49af('0xe')](_0x49af('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x49af('0xf')]=router; \ No newline at end of file +var _0x5532=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','index','get'];(function(_0x3c1bfe,_0x2915dd){var _0x55fc6d=function(_0x324bd8){while(--_0x324bd8){_0x3c1bfe['push'](_0x3c1bfe['shift']());}};_0x55fc6d(++_0x2915dd);}(_0x5532,0x19a));var _0x2553=function(_0x113ad0,_0x476444){_0x113ad0=_0x113ad0-0x0;var _0x2f7717=_0x5532[_0x113ad0];return _0x2f7717;};'use strict';var multer=require(_0x2553('0x0'));var util=require(_0x2553('0x1'));var path=require(_0x2553('0x2'));var timeout=require('connect-timeout');var express=require(_0x2553('0x3'));var router=express['Router']();var fs_extra=require(_0x2553('0x4'));var auth=require(_0x2553('0x5'));var interaction=require(_0x2553('0x6'));var config=require('../../config/environment');var controller=require(_0x2553('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2553('0x8')]);router[_0x2553('0x9')]('/:id',auth[_0x2553('0xa')](),controller[_0x2553('0xb')]);router[_0x2553('0xc')]('/',auth[_0x2553('0xa')](),controller[_0x2553('0xd')]);router[_0x2553('0xe')](_0x2553('0xf'),auth[_0x2553('0xa')](),controller[_0x2553('0x10')]);router[_0x2553('0x11')]('/:id',auth[_0x2553('0xa')](),controller[_0x2553('0x12')]);module[_0x2553('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 681386b..f65bb7b 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 _0xeff8=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x15b192,_0x38c235){var _0x396e73=function(_0x4ba480){while(--_0x4ba480){_0x15b192['push'](_0x15b192['shift']());}};_0x396e73(++_0x38c235);}(_0xeff8,0x186));var _0x8eff=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xeff8[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8eff('0x2')]},'ecm':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x8eff('0x2')],'defaultValue':_0x8eff('0x5')},'localstationid':{'type':Sequelize[_0x8eff('0x2')],'unique':_0x8eff('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x8eff('0x7'),_0x8eff('0x8'),_0x8eff('0x9'),_0x8eff('0xa'),'12000',_0x8eff('0xb')),'defaultValue':_0x8eff('0x8')},'maxrate':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x7'),'4800','7200',_0x8eff('0xa'),_0x8eff('0xc'),_0x8eff('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8eff('0x2')],'defaultValue':_0x8eff('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8eff('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8eff('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x8eff('0xf'),_0x8eff('0x10'),_0x8eff('0x11')),'defaultValue':_0x8eff('0x12')},'key':{'type':Sequelize[_0x8eff('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8eff('0x13');}},'notificationSound':{'type':Sequelize[_0x8eff('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8eff('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8eff('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8eff('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8eff('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8eff('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8eff('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8eff('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8eff('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x8eff('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8eff('0x16'),'set':function(_0x38fb15){if(!_0x38fb15)this[_0x8eff('0x17')](_0x8eff('0x18'),null);this[_0x8eff('0x17')](_0x8eff('0x19'),_0x38fb15);}}}; \ No newline at end of file +var _0x0af5=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports'];(function(_0x3a46b7,_0x38b8ea){var _0x57413a=function(_0x23eea5){while(--_0x23eea5){_0x3a46b7['push'](_0x3a46b7['shift']());}};_0x57413a(++_0x38b8ea);}(_0x0af5,0x158));var _0x50af=function(_0x2b1615,_0x177a3c){_0x2b1615=_0x2b1615-0x0;var _0x5e24c6=_0x0af5[_0x2b1615];return _0x5e24c6;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x50af('0x1')]},'ecm':{'type':Sequelize[_0x50af('0x2')](_0x50af('0x3'),'no'),'defaultValue':_0x50af('0x3')},'headerinfo':{'type':Sequelize[_0x50af('0x1')],'defaultValue':_0x50af('0x4')},'localstationid':{'type':Sequelize[_0x50af('0x1')],'unique':_0x50af('0x5')},'minrate':{'type':Sequelize[_0x50af('0x2')](_0x50af('0x6'),'4800','7200',_0x50af('0x7'),_0x50af('0x8'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x50af('0x2')](_0x50af('0x6'),'4800','7200',_0x50af('0x7'),_0x50af('0x8'),'14400'),'defaultValue':_0x50af('0x9')},'modem':{'type':Sequelize[_0x50af('0x1')],'defaultValue':_0x50af('0xa')},'gateway':{'type':Sequelize[_0x50af('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x50af('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x50af('0x2')](_0x50af('0xc'),_0x50af('0xd'),_0x50af('0xe'),_0x50af('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x50af('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50af('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x50af('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x50af('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50af('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x50af('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x50af('0x11')],'defaultValue':![],'comment':_0x50af('0x13'),'set':function(_0x30e2ec){if(!_0x30e2ec)this[_0x50af('0x14')](_0x50af('0x15'),null);this[_0x50af('0x14')](_0x50af('0x16'),_0x30e2ec);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 31cae74..8292fcd 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 _0x7ac9=['apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','mandatoryDispositionPause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','finally','send','getApplications','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','gateway','maxrate','minrate','modem','t38timeout','Set','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','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./faxAccount.socket','jayson/promise','client','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','undefined','count','offset','limit','set','json'];(function(_0x214a03,_0x2e4061){var _0xda476a=function(_0x1c46b2){while(--_0x1c46b2){_0x214a03['push'](_0x214a03['shift']());}};_0xda476a(++_0x2e4061);}(_0x7ac9,0x157));var _0x97ac=function(_0x476e8b,_0x42e119){_0x476e8b=_0x476e8b-0x0;var _0x5068c8=_0x7ac9[_0x476e8b];return _0x5068c8;};'use strict';var emlformat=require(_0x97ac('0x0'));var rimraf=require(_0x97ac('0x1'));var zipdir=require(_0x97ac('0x2'));var jsonpatch=require(_0x97ac('0x3'));var rp=require('request-promise');var moment=require(_0x97ac('0x4'));var BPromise=require(_0x97ac('0x5'));var Mustache=require(_0x97ac('0x6'));var util=require(_0x97ac('0x7'));var path=require(_0x97ac('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x97ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x97ac('0xa'));var crypto=require(_0x97ac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x97ac('0xc'));var toCsv=require(_0x97ac('0xd'));var querystring=require('querystring');var Papa=require(_0x97ac('0xe'));var Redis=require(_0x97ac('0xf'));var authService=require(_0x97ac('0x10'));var qs=require(_0x97ac('0x11'));var as=require(_0x97ac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97ac('0x13'))(_0x97ac('0x14'));var utils=require(_0x97ac('0x15'));var config=require(_0x97ac('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x97ac('0x17')]=_['defaults'](config[_0x97ac('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x97ac('0x18'))(new Redis(config['redis']));require(_0x97ac('0x19'))['register'](socket);var jayson=require(_0x97ac('0x1a'));var client=jayson[_0x97ac('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x97ac('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48dc7a,_0x1aeb52,_0x32eb1d,_0xe2ba5a){return new BPromise(function(_0x128b10,_0x48edf7){var _0x2e265d=_0xe2ba5a||client;return _0x2e265d[_0x97ac('0x1c')](_0x48dc7a,_0x32eb1d)[_0x97ac('0x1d')](function(_0x524b6e){logger[_0x97ac('0x1e')](_0x97ac('0x1f'),_0x1aeb52,'request\x20sent');logger['debug'](_0x97ac('0x20'),_0x1aeb52,_0x97ac('0x21'),JSON[_0x97ac('0x22')](_0x524b6e));if(_0x524b6e[_0x97ac('0x23')]){if(_0x524b6e[_0x97ac('0x23')]['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1aeb52,_0x524b6e[_0x97ac('0x23')]['message']);return _0x48edf7(_0x524b6e[_0x97ac('0x23')][_0x97ac('0x24')]);}logger[_0x97ac('0x23')](_0x97ac('0x1f'),_0x1aeb52,_0x524b6e['error'][_0x97ac('0x24')]);return _0x128b10(_0x524b6e[_0x97ac('0x23')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x1aeb52,_0x97ac('0x21'));_0x128b10(_0x524b6e[_0x97ac('0x25')]['message']);}})[_0x97ac('0x26')](function(_0x5c3989){logger[_0x97ac('0x23')](_0x97ac('0x1f'),_0x1aeb52,_0x5c3989);_0x48edf7(_0x5c3989);});});}function respondWithStatusCode(_0x32a5c8,_0x34f904){_0x34f904=_0x34f904||0xcc;return function(_0x53e27b){if(_0x53e27b){return _0x32a5c8['sendStatus'](_0x34f904);}return _0x32a5c8[_0x97ac('0x27')](_0x34f904)[_0x97ac('0x28')]();};}function respondWithResult(_0x57abaf,_0x66b08e){_0x66b08e=_0x66b08e||0xc8;return function(_0x56b78b){if(_0x56b78b){return _0x57abaf[_0x97ac('0x27')](_0x66b08e)['json'](_0x56b78b);}};}function respondWithFilteredResult(_0x1fae3f,_0x4920b5){return function(_0x44c2f4){if(_0x44c2f4){var _0x2ede9e=typeof _0x4920b5['offset']==='undefined'&&typeof _0x4920b5['limit']===_0x97ac('0x29');var _0x134612=_0x44c2f4[_0x97ac('0x2a')];var _0x1dfab6=_0x2ede9e?0x0:_0x4920b5[_0x97ac('0x2b')];var _0x3ffbb9=_0x2ede9e?_0x44c2f4[_0x97ac('0x2a')]:_0x4920b5['offset']+_0x4920b5[_0x97ac('0x2c')];var _0x14d7f6;if(_0x3ffbb9>=_0x134612){_0x3ffbb9=_0x134612;_0x14d7f6=0xc8;}else{_0x14d7f6=0xce;}_0x1fae3f[_0x97ac('0x27')](_0x14d7f6);return _0x1fae3f[_0x97ac('0x2d')]('Content-Range',_0x1dfab6+'-'+_0x3ffbb9+'/'+_0x134612)[_0x97ac('0x2e')](_0x44c2f4);}return null;};}function patchUpdates(_0x9334bb){return function(_0x4d4d7f){try{jsonpatch[_0x97ac('0x2f')](_0x4d4d7f,_0x9334bb,!![]);}catch(_0x2edfde){return BPromise[_0x97ac('0x30')](_0x2edfde);}return _0x4d4d7f[_0x97ac('0x31')]();};}function saveUpdates(_0x43f709,_0x3140a4){return function(_0x172a95){if(_0x172a95){return _0x172a95[_0x97ac('0x32')](_0x43f709)['then'](function(_0x5cb814){return _0x5cb814;});}return null;};}function removeEntity(_0x541a55,_0x57395f){return function(_0x29d70e){if(_0x29d70e){return _0x29d70e[_0x97ac('0x33')]()[_0x97ac('0x1d')](function(){var _0xc6d041=_0x29d70e[_0x97ac('0x34')]({'plain':!![]});var _0x35581d=_0x97ac('0x35');return db[_0x97ac('0x36')]['destroy']({'where':{'type':_0x35581d,'resourceId':_0xc6d041['id']}})[_0x97ac('0x1d')](function(){return _0x29d70e;});})[_0x97ac('0x1d')](function(){_0x541a55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5913ae,_0x2c70c5){return function(_0xe07cc0){if(!_0xe07cc0){_0x5913ae[_0x97ac('0x37')](0x194);}return _0xe07cc0;};}function handleError(_0x2e9909,_0x3e1ac7){_0x3e1ac7=_0x3e1ac7||0x1f4;return function(_0x28e6b7){logger[_0x97ac('0x23')](_0x28e6b7[_0x97ac('0x38')]);if(_0x28e6b7[_0x97ac('0x39')]){delete _0x28e6b7['name'];}_0x2e9909[_0x97ac('0x27')](_0x3e1ac7)['send'](_0x28e6b7);};}exports[_0x97ac('0x3a')]=function(_0x5eae43,_0x961e44){var _0x562eea={'include':[{'model':db[_0x97ac('0x3b')],'as':'mandatoryDispositionPause'}]},_0x1c7b93={},_0x39ced8={'count':0x0,'rows':[]};var _0x70b783=_[_0x97ac('0x3c')](db[_0x97ac('0x3d')][_0x97ac('0x3e')],function(_0x2c7e23){return{'name':_0x2c7e23[_0x97ac('0x3f')],'type':_0x2c7e23[_0x97ac('0x40')][_0x97ac('0x41')]};});_0x1c7b93[_0x97ac('0x42')]=_[_0x97ac('0x3c')](_0x70b783,'name');_0x1c7b93[_0x97ac('0x43')]=_['keys'](_0x5eae43[_0x97ac('0x43')]);_0x1c7b93[_0x97ac('0x44')]=_['intersection'](_0x1c7b93[_0x97ac('0x42')],_0x1c7b93[_0x97ac('0x43')]);_0x562eea[_0x97ac('0x45')]=_[_0x97ac('0x46')](_0x1c7b93[_0x97ac('0x42')],qs[_0x97ac('0x47')](_0x5eae43['query'][_0x97ac('0x47')]));_0x562eea[_0x97ac('0x45')]=_0x562eea['attributes'][_0x97ac('0x48')]?_0x562eea[_0x97ac('0x45')]:_0x1c7b93[_0x97ac('0x42')];if(!_0x5eae43[_0x97ac('0x43')]['hasOwnProperty'](_0x97ac('0x49'))){_0x562eea[_0x97ac('0x2c')]=qs[_0x97ac('0x2c')](_0x5eae43['query'][_0x97ac('0x2c')]);_0x562eea[_0x97ac('0x2b')]=qs['offset'](_0x5eae43[_0x97ac('0x43')][_0x97ac('0x2b')]);}_0x562eea[_0x97ac('0x4a')]=qs[_0x97ac('0x4b')](_0x5eae43['query']['sort']);_0x562eea[_0x97ac('0x4c')]=qs[_0x97ac('0x44')](_['pick'](_0x5eae43[_0x97ac('0x43')],_0x1c7b93[_0x97ac('0x44')]),_0x70b783);if(_0x5eae43[_0x97ac('0x43')]['filter']){_0x562eea['where']=_[_0x97ac('0x4d')](_0x562eea[_0x97ac('0x4c')],{'$or':_[_0x97ac('0x3c')](_0x70b783,function(_0x770c8b){if(_0x770c8b[_0x97ac('0x40')]!==_0x97ac('0x4e')){var _0x1c3f6a={};_0x1c3f6a[_0x770c8b['name']]={'$like':'%'+_0x5eae43['query'][_0x97ac('0x4f')]+'%'};return _0x1c3f6a;}})});}_0x562eea=_[_0x97ac('0x4d')]({},_0x562eea,_0x5eae43[_0x97ac('0x50')]);var _0x1156b0={'where':_0x562eea['where']};return db['FaxAccount'][_0x97ac('0x2a')](_0x1156b0)[_0x97ac('0x1d')](function(_0x1e7ea8){_0x39ced8[_0x97ac('0x2a')]=_0x1e7ea8;if(_0x5eae43[_0x97ac('0x43')][_0x97ac('0x51')]){_0x562eea[_0x97ac('0x52')]=[{'all':!![]}];}return db[_0x97ac('0x3d')][_0x97ac('0x53')](_0x562eea);})[_0x97ac('0x1d')](function(_0x218bdf){_0x39ced8['rows']=_0x218bdf;return _0x39ced8;})[_0x97ac('0x1d')](respondWithFilteredResult(_0x961e44,_0x562eea))[_0x97ac('0x26')](handleError(_0x961e44,null));};exports['show']=function(_0x53917a,_0x506c2c){var _0x1ead3e={'raw':![],'where':{'id':_0x53917a[_0x97ac('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x97ac('0x55')}]},_0x12162c={};_0x12162c[_0x97ac('0x42')]=_[_0x97ac('0x56')](db[_0x97ac('0x3d')][_0x97ac('0x3e')]);_0x12162c['query']=_['keys'](_0x53917a[_0x97ac('0x43')]);_0x12162c['filters']=_[_0x97ac('0x46')](_0x12162c[_0x97ac('0x42')],_0x12162c[_0x97ac('0x43')]);_0x1ead3e[_0x97ac('0x45')]=_[_0x97ac('0x46')](_0x12162c[_0x97ac('0x42')],qs['fields'](_0x53917a[_0x97ac('0x43')][_0x97ac('0x47')]));_0x1ead3e['attributes']=_0x1ead3e[_0x97ac('0x45')][_0x97ac('0x48')]?_0x1ead3e[_0x97ac('0x45')]:_0x12162c['model'];if(_0x53917a[_0x97ac('0x43')][_0x97ac('0x51')]){_0x1ead3e[_0x97ac('0x52')]=[{'all':!![]}];}_0x1ead3e=_[_0x97ac('0x4d')]({},_0x1ead3e,_0x53917a['options']);return db['FaxAccount'][_0x97ac('0x57')](_0x1ead3e)[_0x97ac('0x1d')](handleEntityNotFound(_0x506c2c,null))[_0x97ac('0x1d')](respondWithResult(_0x506c2c,null))['catch'](handleError(_0x506c2c,null));};exports[_0x97ac('0x58')]=function(_0x19aee0,_0x40e398){return db[_0x97ac('0x3d')][_0x97ac('0x58')](_0x19aee0[_0x97ac('0x59')],{})[_0x97ac('0x1d')](function(_0x1cf3c8){var _0x1ebd44=_0x19aee0[_0x97ac('0x5a')][_0x97ac('0x34')]({'plain':!![]});if(!_0x1ebd44)throw new Error(_0x97ac('0x5b'));if(_0x1ebd44[_0x97ac('0x5c')]==='user'){var _0x49def8=_0x1cf3c8['get']({'plain':!![]});var _0x2d82ae=_0x97ac('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x2d82ae,'userProfileId':_0x1ebd44[_0x97ac('0x5d')]},'raw':!![]})[_0x97ac('0x1d')](function(_0x41fde8){if(_0x41fde8&&_0x41fde8[_0x97ac('0x5e')]===0x0){return db['UserProfileResource'][_0x97ac('0x58')]({'name':_0x49def8[_0x97ac('0x39')],'resourceId':_0x49def8['id'],'type':_0x41fde8[_0x97ac('0x39')],'sectionId':_0x41fde8['id']},{})[_0x97ac('0x1d')](function(){return _0x1cf3c8;});}else{return _0x1cf3c8;}})[_0x97ac('0x26')](function(_0x6bc80a){logger['error'](_0x97ac('0x5f'),_0x6bc80a);throw _0x6bc80a;});}return _0x1cf3c8;})[_0x97ac('0x1d')](respondWithResult(_0x40e398,0xc9))[_0x97ac('0x26')](handleError(_0x40e398,null));};exports[_0x97ac('0x32')]=function(_0x18f4a2,_0x43f365){if(_0x18f4a2[_0x97ac('0x59')]['id']){delete _0x18f4a2[_0x97ac('0x59')]['id'];}return db[_0x97ac('0x3d')][_0x97ac('0x57')]({'where':{'id':_0x18f4a2[_0x97ac('0x54')]['id']},'include':[{'model':db[_0x97ac('0x3b')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x43f365,null))[_0x97ac('0x1d')](saveUpdates(_0x18f4a2[_0x97ac('0x59')],null))[_0x97ac('0x1d')](respondWithResult(_0x43f365,null))[_0x97ac('0x26')](handleError(_0x43f365,null));};exports['destroy']=function(_0x2cd9da,_0xfa3e64){return db['FaxAccount'][_0x97ac('0x57')]({'where':{'id':_0x2cd9da[_0x97ac('0x54')]['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0xfa3e64,null))['then'](removeEntity(_0xfa3e64,null))[_0x97ac('0x26')](handleError(_0xfa3e64,null));};exports[_0x97ac('0x60')]=function(_0x26a496,_0x49dfc0){return db['FaxAccount'][_0x97ac('0x60')]()[_0x97ac('0x1d')](respondWithResult(_0x49dfc0,null))[_0x97ac('0x26')](handleError(_0x49dfc0,null));};exports[_0x97ac('0x61')]=function(_0x438145,_0x39341e,_0x5b0c9e){if(_0x438145['body']['id']){delete _0x438145[_0x97ac('0x59')]['id'];}return db['FaxAccount'][_0x97ac('0x57')]({'where':{'id':_0x438145['params']['id']}})['then'](handleEntityNotFound(_0x39341e,null))[_0x97ac('0x1d')](function(_0x301f1b){if(_0x301f1b){_0x438145[_0x97ac('0x59')][_0x97ac('0x62')]=_0x301f1b['id'];return db[_0x97ac('0x63')][_0x97ac('0x58')](_0x438145[_0x97ac('0x59')]);}})[_0x97ac('0x1d')](respondWithResult(_0x39341e,null))[_0x97ac('0x26')](handleError(_0x39341e,null));};exports[_0x97ac('0x64')]=function(_0x1f3cfa,_0x23ccdc,_0x4b2b9e){var _0x12860e={'raw':![],'where':{}};var _0x254348={};var _0x54d408={'count':0x0,'rows':[]};return db[_0x97ac('0x3d')][_0x97ac('0x65')]({'where':{'id':_0x1f3cfa[_0x97ac('0x54')]['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x23ccdc,null))[_0x97ac('0x1d')](function(_0x3d4eb){if(_0x3d4eb){_0x254348['model']=_[_0x97ac('0x56')](db[_0x97ac('0x63')][_0x97ac('0x3e')]);_0x254348[_0x97ac('0x43')]=_[_0x97ac('0x56')](_0x1f3cfa[_0x97ac('0x43')]);_0x254348[_0x97ac('0x44')]=_[_0x97ac('0x46')](_0x254348[_0x97ac('0x42')],_0x254348[_0x97ac('0x43')]);_0x12860e['attributes']=_[_0x97ac('0x46')](_0x254348['model'],qs['fields'](_0x1f3cfa['query'][_0x97ac('0x47')]));_0x12860e[_0x97ac('0x45')]=_0x12860e[_0x97ac('0x45')]['length']?_0x12860e[_0x97ac('0x45')]:_0x254348[_0x97ac('0x42')];if(!_0x1f3cfa[_0x97ac('0x43')][_0x97ac('0x66')]('nolimit')){_0x12860e[_0x97ac('0x2c')]=qs['limit'](_0x1f3cfa[_0x97ac('0x43')][_0x97ac('0x2c')]);_0x12860e['offset']=qs['offset'](_0x1f3cfa['query'][_0x97ac('0x2b')]);}_0x12860e[_0x97ac('0x4a')]=qs[_0x97ac('0x4b')](_0x1f3cfa[_0x97ac('0x43')][_0x97ac('0x4b')]);_0x12860e[_0x97ac('0x4c')]=qs['filters'](_[_0x97ac('0x67')](_0x1f3cfa['query'],_0x254348[_0x97ac('0x44')]));_0x12860e['where'][_0x97ac('0x62')]=_0x3d4eb['id'];if(_0x1f3cfa['query'][_0x97ac('0x4f')]){_0x12860e[_0x97ac('0x4c')]=_[_0x97ac('0x4d')](_0x12860e[_0x97ac('0x4c')],{'$or':_[_0x97ac('0x3c')](_0x12860e[_0x97ac('0x45')],function(_0x6dfbf0){var _0x470eb6={};_0x470eb6[_0x6dfbf0]={'$like':'%'+_0x1f3cfa[_0x97ac('0x43')][_0x97ac('0x4f')]+'%'};return _0x470eb6;})});}_0x12860e=_['merge']({},_0x12860e,_0x1f3cfa['options']);return db[_0x97ac('0x63')][_0x97ac('0x2a')]({'where':_0x12860e[_0x97ac('0x4c')]})[_0x97ac('0x1d')](function(_0x2d3505){_0x54d408[_0x97ac('0x2a')]=_0x2d3505;if(_0x1f3cfa[_0x97ac('0x43')][_0x97ac('0x51')]){_0x12860e[_0x97ac('0x52')]=[{'all':!![]}];}return db[_0x97ac('0x63')]['findAll'](_0x12860e);})['then'](function(_0x41fd65){_0x54d408[_0x97ac('0x68')]=_0x41fd65;return _0x54d408;});}})['then'](respondWithFilteredResult(_0x23ccdc,_0x12860e))['catch'](handleError(_0x23ccdc,null));};exports[_0x97ac('0x69')]=function(_0x4cf2cd,_0x60133f,_0x27b7a4){return db[_0x97ac('0x3d')][_0x97ac('0x57')]({'where':{'id':_0x4cf2cd[_0x97ac('0x54')]['id']}})['then'](handleEntityNotFound(_0x60133f,null))[_0x97ac('0x1d')](function(_0x34a54a){if(_0x34a54a){return _0x34a54a[_0x97ac('0x69')](_0x4cf2cd[_0x97ac('0x43')][_0x97ac('0x6a')]);}})[_0x97ac('0x1d')](respondWithStatusCode(_0x60133f,null))[_0x97ac('0x26')](handleError(_0x60133f,null));};exports[_0x97ac('0x6b')]=function(_0x19acbb,_0x34cb4a,_0x51c0a9){if(_0x19acbb[_0x97ac('0x59')]['id']){delete _0x19acbb[_0x97ac('0x59')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x19acbb['params']['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x34cb4a,null))[_0x97ac('0x1d')](function(_0x40152f){if(_0x40152f){_0x19acbb[_0x97ac('0x59')][_0x97ac('0x62')]=_0x40152f['id'];return db[_0x97ac('0x6c')][_0x97ac('0x58')](_0x19acbb[_0x97ac('0x59')]);}})['then'](respondWithResult(_0x34cb4a,null))[_0x97ac('0x26')](handleError(_0x34cb4a,null));};exports[_0x97ac('0x6d')]=function(_0x4c6754,_0x415c9c,_0x3f8542){var _0x2bedbd={'raw':![],'where':{}};var _0x1959a2={};var _0x5b5bec={'count':0x0,'rows':[]};return db[_0x97ac('0x3d')][_0x97ac('0x65')]({'where':{'id':_0x4c6754[_0x97ac('0x54')]['id']}})['then'](handleEntityNotFound(_0x415c9c,null))[_0x97ac('0x1d')](function(_0xc8616d){if(_0xc8616d){_0x1959a2[_0x97ac('0x42')]=_[_0x97ac('0x56')](db[_0x97ac('0x6c')][_0x97ac('0x3e')]);_0x1959a2[_0x97ac('0x43')]=_[_0x97ac('0x56')](_0x4c6754[_0x97ac('0x43')]);_0x1959a2['filters']=_[_0x97ac('0x46')](_0x1959a2['model'],_0x1959a2[_0x97ac('0x43')]);_0x2bedbd[_0x97ac('0x45')]=_[_0x97ac('0x46')](_0x1959a2[_0x97ac('0x42')],qs[_0x97ac('0x47')](_0x4c6754['query'][_0x97ac('0x47')]));_0x2bedbd[_0x97ac('0x45')]=_0x2bedbd[_0x97ac('0x45')]['length']?_0x2bedbd['attributes']:_0x1959a2[_0x97ac('0x42')];if(!_0x4c6754['query']['hasOwnProperty']('nolimit')){_0x2bedbd['limit']=qs[_0x97ac('0x2c')](_0x4c6754[_0x97ac('0x43')][_0x97ac('0x2c')]);_0x2bedbd[_0x97ac('0x2b')]=qs[_0x97ac('0x2b')](_0x4c6754[_0x97ac('0x43')][_0x97ac('0x2b')]);}_0x2bedbd[_0x97ac('0x4a')]=qs[_0x97ac('0x4b')](_0x4c6754['query'][_0x97ac('0x4b')]);_0x2bedbd['where']=qs[_0x97ac('0x44')](_[_0x97ac('0x67')](_0x4c6754[_0x97ac('0x43')],_0x1959a2['filters']));_0x2bedbd[_0x97ac('0x4c')][_0x97ac('0x62')]=_0xc8616d['id'];if(_0x4c6754[_0x97ac('0x43')][_0x97ac('0x4f')]){_0x2bedbd[_0x97ac('0x4c')]=_['merge'](_0x2bedbd[_0x97ac('0x4c')],{'$or':_['map'](_0x2bedbd['attributes'],function(_0x2f9f0f){var _0x542e31={};_0x542e31[_0x2f9f0f]={'$like':'%'+_0x4c6754['query']['filter']+'%'};return _0x542e31;})});}_0x2bedbd=_[_0x97ac('0x4d')]({},_0x2bedbd,_0x4c6754[_0x97ac('0x50')]);return db[_0x97ac('0x6c')][_0x97ac('0x2a')]({'where':_0x2bedbd[_0x97ac('0x4c')]})[_0x97ac('0x1d')](function(_0x576057){_0x5b5bec[_0x97ac('0x2a')]=_0x576057;if(_0x4c6754[_0x97ac('0x43')]['includeAll']){_0x2bedbd[_0x97ac('0x52')]=[{'all':!![]}];}return db[_0x97ac('0x6c')][_0x97ac('0x53')](_0x2bedbd);})[_0x97ac('0x1d')](function(_0x1cf9ed){_0x5b5bec[_0x97ac('0x68')]=_0x1cf9ed;return _0x5b5bec;});}})['then'](respondWithFilteredResult(_0x415c9c,_0x2bedbd))[_0x97ac('0x26')](handleError(_0x415c9c,null));};exports['removeAnswers']=function(_0x52ab79,_0x6ebd53,_0x4417ec){return db[_0x97ac('0x3d')][_0x97ac('0x57')]({'where':{'id':_0x52ab79[_0x97ac('0x54')]['id']}})['then'](handleEntityNotFound(_0x6ebd53,null))[_0x97ac('0x1d')](function(_0x40242c){if(_0x40242c){return _0x40242c[_0x97ac('0x6e')](_0x52ab79['query']['ids']);}})[_0x97ac('0x1d')](respondWithStatusCode(_0x6ebd53,null))[_0x97ac('0x26')](handleError(_0x6ebd53,null));};exports[_0x97ac('0x6f')]=function(_0x49c6cb,_0x26a820,_0x1113fd){return db[_0x97ac('0x70')][_0x97ac('0x57')]({'where':{'id':_0x49c6cb[_0x97ac('0x54')]['id']}})['then'](handleEntityNotFound(_0x26a820,null))[_0x97ac('0x1d')](function(_0x544003){if(_0x544003){return _0x544003[_0x97ac('0x6f')](_0x49c6cb[_0x97ac('0x59')][_0x97ac('0x6a')],_['omit'](_0x49c6cb['body'],[_0x97ac('0x6a'),'id'])||{});}})[_0x97ac('0x1d')](respondWithResult(_0x26a820,null))[_0x97ac('0x26')](handleError(_0x26a820,null));};exports[_0x97ac('0x71')]=function(_0x554048,_0x395121,_0x291746){var _0x5ed641={'raw':![],'where':{}};var _0xb71c3f={};var _0x226d40={'count':0x0,'rows':[]};return db[_0x97ac('0x3d')]['findOne']({'where':{'id':_0x554048[_0x97ac('0x54')]['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x395121,null))[_0x97ac('0x1d')](function(_0xd101a1){if(_0xd101a1){_0xb71c3f[_0x97ac('0x42')]=_[_0x97ac('0x56')](db['FaxInteraction'][_0x97ac('0x3e')]);_0xb71c3f[_0x97ac('0x43')]=_['keys'](_0x554048['query']);_0xb71c3f['filters']=_[_0x97ac('0x46')](_0xb71c3f[_0x97ac('0x42')],_0xb71c3f[_0x97ac('0x43')]);_0x5ed641['attributes']=_['intersection'](_0xb71c3f[_0x97ac('0x42')],qs[_0x97ac('0x47')](_0x554048['query'][_0x97ac('0x47')]));_0x5ed641[_0x97ac('0x45')]=_0x5ed641[_0x97ac('0x45')][_0x97ac('0x48')]?_0x5ed641[_0x97ac('0x45')]:_0xb71c3f[_0x97ac('0x42')];if(!_0x554048[_0x97ac('0x43')]['hasOwnProperty'](_0x97ac('0x49'))){_0x5ed641[_0x97ac('0x2c')]=qs[_0x97ac('0x2c')](_0x554048[_0x97ac('0x43')][_0x97ac('0x2c')]);_0x5ed641[_0x97ac('0x2b')]=qs['offset'](_0x554048[_0x97ac('0x43')][_0x97ac('0x2b')]);}_0x5ed641[_0x97ac('0x4a')]=qs[_0x97ac('0x4b')](_0x554048['query'][_0x97ac('0x4b')]);_0x5ed641[_0x97ac('0x4c')]=qs[_0x97ac('0x44')](_[_0x97ac('0x67')](_0x554048[_0x97ac('0x43')],_0xb71c3f[_0x97ac('0x44')]));_0x5ed641[_0x97ac('0x4c')][_0x97ac('0x62')]=_0xd101a1['id'];if(_0x554048[_0x97ac('0x43')][_0x97ac('0x4f')]){_0x5ed641['where']=_[_0x97ac('0x4d')](_0x5ed641[_0x97ac('0x4c')],{'$or':_['map'](_0x5ed641[_0x97ac('0x45')],function(_0xe37173){var _0x2530a6={};_0x2530a6[_0xe37173]={'$like':'%'+_0x554048[_0x97ac('0x43')]['filter']+'%'};return _0x2530a6;})});}_0x5ed641=_['merge']({},_0x5ed641,_0x554048[_0x97ac('0x50')]);return db['FaxInteraction'][_0x97ac('0x2a')]({'where':_0x5ed641['where']})[_0x97ac('0x1d')](function(_0x4b9e8a){_0x226d40['count']=_0x4b9e8a;if(_0x554048['query'][_0x97ac('0x51')]){_0x5ed641[_0x97ac('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x97ac('0x72')],'as':_0x97ac('0x73'),'attributes':[_0x97ac('0x39'),_0x97ac('0x74'),_0x97ac('0x75')],'required':![]},{'model':db[_0x97ac('0x76')],'as':_0x97ac('0x77'),'attributes':['id',_0x97ac('0x39'),'color'],'where':_0x554048[_0x97ac('0x43')][_0x97ac('0x78')]?{'id':_0x554048['query']['tag']}:undefined,'required':_0x554048['query']['tag']?!![]:![]}];}return db[_0x97ac('0x70')][_0x97ac('0x53')](_0x5ed641);})[_0x97ac('0x1d')](function(_0x5f0c0d){_0x226d40['rows']=_0x5f0c0d;return _0x226d40;});}})[_0x97ac('0x1d')](respondWithFilteredResult(_0x395121,_0x5ed641))[_0x97ac('0x26')](handleError(_0x395121,null));};exports['addApplications']=function(_0x11b4d3,_0x5cfb23){var _0x21d606=_0x11b4d3['params']['id'];var _0x22a061=_0x11b4d3['body'];var _0x34114a=0xc8;var _0x393f9b=null;return db[_0x97ac('0x79')][_0x97ac('0x7a')]({'isolationLevel':db[_0x97ac('0x79')][_0x97ac('0x7b')][_0x97ac('0x7c')]['READ_COMMITTED']},function(_0x2c7e07){return db['FaxAccount'][_0x97ac('0x65')]({'where':{'id':_0x21d606},'transaction':_0x2c7e07})[_0x97ac('0x1d')](function(_0x4cfc69){if(_0x4cfc69){return db[_0x97ac('0x7d')][_0x97ac('0x33')]({'where':{'FaxAccountId':_0x21d606},'transaction':_0x2c7e07})['then'](function(){var _0xbbb55f=_[_0x97ac('0x3c')](_0x22a061,function(_0x1a427a){_0x1a427a[_0x97ac('0x62')]=_0x21d606;return _0x1a427a;});return db[_0x97ac('0x7d')][_0x97ac('0x7e')](_0xbbb55f,{'transaction':_0x2c7e07});});}else{_0x34114a=0x194;_0x393f9b=[];}});})[_0x97ac('0x1d')](function(){if(_0x34114a!==0x194){return db[_0x97ac('0x7d')]['findAndCountAll']({'where':{'FaxAccountId':_0x21d606},'order':_0x97ac('0x7f')})['then'](function(_0x1876b2){_0x393f9b=_0x1876b2;});}})['catch'](function(_0x23c69c){_0x34114a=0x1f4;logger['error'](_0x23c69c[_0x97ac('0x38')]);if(_0x23c69c[_0x97ac('0x39')]){delete _0x23c69c[_0x97ac('0x39')];}_0x393f9b=_0x23c69c;})[_0x97ac('0x80')](function(){if(_0x393f9b===null){_0x5cfb23['sendStatus'](_0x34114a);}else{if(_0x34114a===0x1f4){_0x5cfb23['status'](_0x34114a)[_0x97ac('0x81')](_0x393f9b);}else{_0x5cfb23[_0x97ac('0x27')](_0x34114a)[_0x97ac('0x2e')](_0x393f9b);}}});};exports['getApplications']=function(_0x5c3332,_0x324204,_0x62d53b){var _0x219ff6={};var _0x528281={};var _0xb22101;var _0x59835e;return db[_0x97ac('0x3d')]['findOne']({'where':{'id':_0x5c3332[_0x97ac('0x54')]['id']}})['then'](handleEntityNotFound(_0x324204,null))['then'](function(_0x2cd41b){if(_0x2cd41b){_0xb22101=_0x2cd41b;_0x528281[_0x97ac('0x42')]=_[_0x97ac('0x56')](db[_0x97ac('0x7d')][_0x97ac('0x3e')]);_0x528281[_0x97ac('0x43')]=_[_0x97ac('0x56')](_0x5c3332['query']);_0x528281['filters']=_[_0x97ac('0x46')](_0x528281[_0x97ac('0x42')],_0x528281[_0x97ac('0x43')]);_0x219ff6[_0x97ac('0x45')]=_[_0x97ac('0x46')](_0x528281['model'],qs['fields'](_0x5c3332['query'][_0x97ac('0x47')]));_0x219ff6[_0x97ac('0x45')]=_0x219ff6[_0x97ac('0x45')]['length']?_0x219ff6['attributes']:_0x528281[_0x97ac('0x42')];_0x219ff6[_0x97ac('0x4a')]=qs[_0x97ac('0x4b')](_0x5c3332['query'][_0x97ac('0x4b')]);_0x219ff6[_0x97ac('0x4c')]=qs[_0x97ac('0x44')](_[_0x97ac('0x67')](_0x5c3332[_0x97ac('0x43')],_0x528281[_0x97ac('0x44')]));if(_0x5c3332[_0x97ac('0x43')][_0x97ac('0x4f')]){_0x219ff6[_0x97ac('0x4c')]=_[_0x97ac('0x4d')](_0x219ff6['where'],{'$or':_[_0x97ac('0x3c')](_0x219ff6[_0x97ac('0x45')],function(_0x391aed){var _0x507ae7={};_0x507ae7[_0x391aed]={'$like':'%'+_0x5c3332[_0x97ac('0x43')]['filter']+'%'};return _0x507ae7;})});}_0x219ff6=_[_0x97ac('0x4d')]({},_0x219ff6,_0x5c3332[_0x97ac('0x50')]);return _0xb22101[_0x97ac('0x82')](_0x219ff6);}})[_0x97ac('0x1d')](function(_0x3a9aba){if(_0x3a9aba){_0x59835e=_0x3a9aba[_0x97ac('0x48')];if(!_0x5c3332[_0x97ac('0x43')][_0x97ac('0x66')](_0x97ac('0x49'))){_0x219ff6[_0x97ac('0x2c')]=qs[_0x97ac('0x2c')](_0x5c3332[_0x97ac('0x43')][_0x97ac('0x2c')]);_0x219ff6['offset']=qs[_0x97ac('0x2b')](_0x5c3332[_0x97ac('0x43')][_0x97ac('0x2b')]);}return _0xb22101[_0x97ac('0x82')](_0x219ff6);}})[_0x97ac('0x1d')](function(_0x56141a){if(_0x56141a){return _0x56141a?{'count':_0x59835e,'rows':_0x56141a}:null;}})[_0x97ac('0x1d')](respondWithResult(_0x324204,null))['catch'](handleError(_0x324204,null));};function Extension(_0x435044,_0x26e787,_0x2ed5fa,_0x35e417){this['context']=_0x97ac('0x83');this[_0x97ac('0x84')]=_0x435044[_0x97ac('0x85')];this[_0x97ac('0x86')]=_0x35e417;this[_0x97ac('0x40')]='system';this[_0x97ac('0x87')]=_0x97ac('0x88');this[_0x97ac('0x62')]=_0x435044['id'];this[_0x97ac('0x7f')]=_0x26e787;this[_0x97ac('0x89')]=_0x2ed5fa;}function createExtensionsReciveFax(_0x29a8ba){var _0x22eb87=0x1;var _0x21c656=[];_0x21c656[_0x97ac('0x8a')](new Extension(_0x29a8ba,_0x22eb87,'',_0x97ac('0x8b')));_0x22eb87+=0x1;_0x21c656[_0x97ac('0x8a')](new Extension(_0x29a8ba,_0x22eb87,_0x97ac('0x8c'),'Set'));_0x22eb87+=0x1;for(var _0x31c26b in _0x29a8ba){if(_0x29a8ba[_0x97ac('0x66')](_0x31c26b)&&(_0x31c26b==='ecm'||_0x31c26b===_0x97ac('0x85')||_0x31c26b===_0x97ac('0x8d')||_0x31c26b==='faxdetect'||_0x31c26b==='headerinfo'||_0x31c26b===_0x97ac('0x8e')||_0x31c26b===_0x97ac('0x8f')||_0x31c26b===_0x97ac('0x90')||_0x31c26b===_0x97ac('0x91'))){_0x21c656[_0x97ac('0x8a')](new Extension(_0x29a8ba,_0x22eb87,'FAXOPT('+_0x31c26b+')='+_0x29a8ba[_0x31c26b],_0x97ac('0x92')));_0x22eb87+=0x1;}}_0x21c656[_0x97ac('0x8a')](new Extension(_0x29a8ba,_0x22eb87,'6',_0x97ac('0x93')));_0x22eb87+=0x1;_0x21c656[_0x97ac('0x8a')](new Extension(_0x29a8ba,_0x22eb87,_0x97ac('0x94'),'ReceiveFax'));_0x22eb87=0x0;return _0x21c656;}exports[_0x97ac('0x95')]=function(_0x39504b,_0x536cec,_0x56118d){var _0x5d5ea7;return db[_0x97ac('0x79')][_0x97ac('0x7a')](function(_0x1d71ea){return db[_0x97ac('0x3d')][_0x97ac('0x58')](_0x39504b[_0x97ac('0x59')],{'transaction':_0x1d71ea})[_0x97ac('0x1d')](function(_0x47bf18){_0x5d5ea7=_0x47bf18[_0x97ac('0x34')]({'plain':!![]});return db[_0x97ac('0x96')][_0x97ac('0x7e')](createExtensionsReciveFax(_0x5d5ea7),{'transaction':_0x1d71ea});});})[_0x97ac('0x1d')](function(){return _0x5d5ea7;})[_0x97ac('0x1d')](respondWithResult(_0x536cec,null))[_0x97ac('0x26')](handleError(_0x536cec,null));};exports[_0x97ac('0x97')]=function(_0x2846db,_0x561f61,_0x247cd8){var _0x598b50;return db['sequelize'][_0x97ac('0x7a')](function(_0x3cea14){return db[_0x97ac('0x3d')][_0x97ac('0x32')](_0x2846db[_0x97ac('0x59')],{'where':{'id':_0x2846db[_0x97ac('0x59')]['id']},'transaction':_0x3cea14})[_0x97ac('0x1d')](function(_0x451e9f){return db['VoiceExtension'][_0x97ac('0x33')]({'where':{'FaxAccountId':_0x2846db[_0x97ac('0x59')]['id']},'transaction':_0x3cea14})[_0x97ac('0x1d')](function(_0x470eff){return db['VoiceExtension'][_0x97ac('0x7e')](createExtensionsReciveFax(_[_0x97ac('0x98')](_0x2846db[_0x97ac('0x59')],[_0x97ac('0x99'),_0x97ac('0x41'),_0x97ac('0x9a'),_0x97ac('0x9b'),_0x97ac('0x9c'),_0x97ac('0x9d')])),{'transaction':_0x3cea14});});});})[_0x97ac('0x1d')](function(){return db[_0x97ac('0x3d')]['findById'](_0x2846db[_0x97ac('0x59')]['id']);})[_0x97ac('0x1d')](respondWithResult(_0x561f61,null))[_0x97ac('0x26')](handleError(_0x561f61,null));};exports[_0x97ac('0x9e')]=function(_0x589754,_0x514779,_0x5c9325){var _0x386b8e={'raw':!![],'where':{}};var _0x4856b5={};var _0x17740b={'count':0x0,'rows':[]};return db[_0x97ac('0x3d')]['findOne']({'where':{'id':_0x589754[_0x97ac('0x54')]['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x514779,null))[_0x97ac('0x1d')](function(_0x23f2c6){if(_0x23f2c6){_0x4856b5['model']=_[_0x97ac('0x56')](db[_0x97ac('0x9f')][_0x97ac('0x3e')]);_0x4856b5[_0x97ac('0x43')]=_[_0x97ac('0x56')](_0x589754[_0x97ac('0x43')]);_0x4856b5[_0x97ac('0x44')]=_['intersection'](_0x4856b5[_0x97ac('0x42')],_0x4856b5[_0x97ac('0x43')]);_0x386b8e[_0x97ac('0x45')]=_['intersection'](_0x4856b5[_0x97ac('0x42')],qs['fields'](_0x589754[_0x97ac('0x43')][_0x97ac('0x47')]));_0x386b8e[_0x97ac('0x45')]=_0x386b8e['attributes'][_0x97ac('0x48')]?_0x386b8e[_0x97ac('0x45')]:_0x4856b5[_0x97ac('0x42')];if(!_0x589754[_0x97ac('0x43')][_0x97ac('0x66')](_0x97ac('0x49'))){_0x386b8e[_0x97ac('0x2c')]=qs[_0x97ac('0x2c')](_0x589754['query'][_0x97ac('0x2c')]);_0x386b8e[_0x97ac('0x2b')]=qs[_0x97ac('0x2b')](_0x589754[_0x97ac('0x43')][_0x97ac('0x2b')]);}_0x386b8e[_0x97ac('0x4a')]=qs[_0x97ac('0x4b')](_0x589754[_0x97ac('0x43')]['sort']);_0x386b8e[_0x97ac('0x4c')]=qs[_0x97ac('0x44')](_[_0x97ac('0x67')](_0x589754[_0x97ac('0x43')],_0x4856b5['filters']));_0x386b8e[_0x97ac('0x4c')][_0x97ac('0x62')]=_0x23f2c6['id'];if(_0x589754[_0x97ac('0x43')][_0x97ac('0x4f')]){_0x386b8e[_0x97ac('0x4c')]=_[_0x97ac('0x4d')](_0x386b8e[_0x97ac('0x4c')],{'$or':_['map'](_0x386b8e['attributes'],function(_0x2f57a8){var _0x12fbda={};_0x12fbda[_0x2f57a8]={'$like':'%'+_0x589754[_0x97ac('0x43')][_0x97ac('0x4f')]+'%'};return _0x12fbda;})});}if(_0x589754[_0x97ac('0x43')][_0x97ac('0xa0')]){var _0x2df71b=_0x589754[_0x97ac('0x43')]['$gte'][_0x97ac('0xa1')](',');var _0x189312={};_0x189312[_0x2df71b[0x0]]={'$gte':moment(_0x2df71b[0x1])[_0x97ac('0xa2')](_0x97ac('0xa3'))};_0x386b8e['where']=_[_0x97ac('0x4d')](_0x386b8e[_0x97ac('0x4c')],_0x189312);}_0x386b8e=_[_0x97ac('0x4d')]({},_0x386b8e,_0x589754[_0x97ac('0x50')]);return db[_0x97ac('0x9f')][_0x97ac('0x2a')]({'where':_0x386b8e[_0x97ac('0x4c')]})[_0x97ac('0x1d')](function(_0x5953d8){_0x17740b[_0x97ac('0x2a')]=_0x5953d8;if(_0x589754[_0x97ac('0x43')][_0x97ac('0x51')]){_0x386b8e[_0x97ac('0x52')]=[{'all':!![]}];}return db[_0x97ac('0x9f')]['findAll'](_0x386b8e);})[_0x97ac('0x1d')](function(_0x3ccdff){_0x17740b[_0x97ac('0x68')]=_0x3ccdff;return _0x17740b;});}})[_0x97ac('0x1d')](respondWithFilteredResult(_0x514779,_0x386b8e))[_0x97ac('0x26')](handleError(_0x514779,null));};exports[_0x97ac('0x81')]=function(_0xce6f50,_0x4c6d20,_0x2541a2){var _0x342196,_0x5d3aff={},_0x5e5282;if(_0xce6f50[_0x97ac('0x59')]['to']){_0x5e5282=_0xce6f50['body']['to'][0x0];}return db[_0x97ac('0x3d')][_0x97ac('0x57')]({'where':{'id':_0xce6f50['params']['id']},'include':[{'model':db[_0x97ac('0xa4')],'as':_0x97ac('0xa5'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x5e5282},'limit':0x1,'order':[[_0x97ac('0x9b'),_0x97ac('0xa6')]]}]}]})[_0x97ac('0x1d')](handleEntityNotFound(_0x4c6d20,null))['then'](function(_0x459f10){_0x342196=_0x459f10;if(_0xce6f50[_0x97ac('0x59')]['attachments']&&_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')]['length']){for(var _0xd28d6e=0x0;_0xd28d6e<_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][_0x97ac('0x48')];_0xd28d6e+=0x1){_0xce6f50['body'][_0x97ac('0xa7')][_0xd28d6e]={'filename':_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][_0xd28d6e]['name'],'id':_0xce6f50[_0x97ac('0x59')]['attachments'][_0xd28d6e]['id'],'path':path[_0x97ac('0xa8')](config[_0x97ac('0xa9')],_0x97ac('0xaa'),_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][_0xd28d6e]['basename'])};}}return respondWithRpcPromise(_0x97ac('0xab'),_0x97ac('0xab'),{'FaxAccountId':_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x54')]['id'])?undefined:_0xce6f50[_0x97ac('0x54')]['id'],'path':_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][0x0][_0x97ac('0x8')])?undefined:_0xce6f50[_0x97ac('0x59')]['attachments'][0x0][_0x97ac('0x8')],'fax':_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x59')]['to'][0x0])?undefined:_0xce6f50[_0x97ac('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x342196){if(_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x59')][_0x97ac('0xad')])){_0xce6f50[_0x97ac('0x59')]['from']=util[_0x97ac('0xa2')](_0x97ac('0xae'),_0x342196[_0x97ac('0x39')],_0x342196[_0x97ac('0xaf')]);}if(_0x342196['List']){if(_0x342196[_0x97ac('0xa5')][_0x97ac('0xb0')]['length']){return _0x342196['List'][_0x97ac('0xb0')][0x0];}else{return db['CmContact'][_0x97ac('0x58')](_[_0x97ac('0xb1')](_0xce6f50[_0x97ac('0x59')],{'firstName':_0xce6f50['body']['to'][0x0],'phone':_0xce6f50[_0x97ac('0x59')]['to'][0x0],'fax':_0xce6f50[_0x97ac('0x59')]['to'][0x0],'ListId':_0x342196[_0x97ac('0x9d')]}));}}else{throw new Error(_0x97ac('0xb2'));}}else{throw new Error(_0x97ac('0xb3'));}})[_0x97ac('0x1d')](function(_0x569ab3){if(_0x569ab3){return db['FaxInteraction'][_0x97ac('0x57')]({'where':{'ContactId':_0x569ab3['id'],'closed':![],'FaxAccountId':_0x342196['id']}})['then'](function(_0x2fc64d){if(_0x2fc64d){return[_0x2fc64d,![]];}return db['FaxInteraction'][_0x97ac('0x58')]({'UserId':_0xce6f50[_0x97ac('0x5a')]['id'],'ContactId':_0x569ab3['id'],'FaxAccountId':_0x342196['id'],'fax':_0xce6f50[_0x97ac('0x59')]['to'][0x0],'firstMsgDirection':_0x97ac('0xb4'),'Messages':[_[_0x97ac('0x4d')](_0xce6f50[_0x97ac('0x59')],{'read':![],'body':_0xce6f50['body'][_0x97ac('0xa7')][0x0]['filename'],'FaxAccountId':_0x342196['id'],'UserId':_0xce6f50[_0x97ac('0x5a')]['id'],'ContactId':_0x569ab3['id'],'AttachmentId':_0xce6f50[_0x97ac('0x59')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x97ac('0x9f')],'as':_0x97ac('0xb5')}]})[_0x97ac('0x1d')](function(_0x4b8322){return[_0x4b8322,!![]];});});}else{throw new Error(_0x97ac('0xb6'));}})[_0x97ac('0xb7')](function(_0x3d2d6d,_0x1c0232){if(_0x1c0232){return _0x3d2d6d;}return db['FaxMessage'][_0x97ac('0x58')]({'direction':'out','read':![],'body':_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][0x0][_0x97ac('0xb8')],'FaxAccountId':_0x342196['id'],'FaxInteractionId':_0x3d2d6d['id'],'UserId':_0xce6f50[_0x97ac('0x5a')]['id'],'ContactId':_0x3d2d6d['ContactId'],'AttachmentId':_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][0x0]['id']})[_0x97ac('0x1d')](function(_0x48a385){_0x3d2d6d[_0x97ac('0xb9')][_0x97ac('0xb5')]=[];_0x3d2d6d[_0x97ac('0xb9')][_0x97ac('0xb5')][_0x97ac('0x8a')](_0x48a385[_0x97ac('0xb9')]);return _0x3d2d6d;});})[_0x97ac('0x1d')](function(_0x451090){respondWithRpcPromise(_0x97ac('0xba'),_0x97ac('0xba'),{'FaxAccountId':_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x54')]['id'])?undefined:_0xce6f50[_0x97ac('0x54')]['id'],'path':_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x59')]['attachments'][0x0]['path'])?undefined:_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][0x0][_0x97ac('0x8')],'fax':_[_0x97ac('0xac')](_0xce6f50[_0x97ac('0x59')]['to'][0x0])?undefined:_0xce6f50[_0x97ac('0x59')]['to'][0x0],'AttachmentId':_0xce6f50[_0x97ac('0x59')][_0x97ac('0xa7')][0x0]['id']},client9002)[_0x97ac('0x1d')](function(_0x53660d){logger[_0x97ac('0x1e')](_0x97ac('0xbb'),_0x53660d);})[_0x97ac('0x26')](function(_0x12bef9){logger['info'](_0x97ac('0xbb'),_0x12bef9);});return _0x451090;})['then'](respondWithResult(_0x4c6d20,null))[_0x97ac('0x26')](handleError(_0x4c6d20,null));};exports[_0x97ac('0xbc')]=function(_0x525b58,_0x4a29c4,_0x41be14){return db[_0x97ac('0x3d')][_0x97ac('0x57')]({'where':{'id':_0x525b58['params']['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x4a29c4,null))[_0x97ac('0x1d')](function(_0x2371e6){if(_0x2371e6){return _0x2371e6[_0x97ac('0xbc')](_0x525b58['body']['ids'],_[_0x97ac('0x98')](_0x525b58[_0x97ac('0x59')],[_0x97ac('0x6a'),'id'])||{})['spread'](function(_0x24bf94){for(var _0x3bec30=0x0;_0x3bec30<_0x525b58[_0x97ac('0x59')][_0x97ac('0x6a')]['length'];_0x3bec30+=0x1){socket['emit'](_0x97ac('0xbd'),{'UserId':Number(_0x525b58[_0x97ac('0x59')]['ids'][_0x3bec30]),'FaxAccountId':Number(_0x525b58[_0x97ac('0x54')]['id'])});}return _0x24bf94;});}})['then'](respondWithResult(_0x4a29c4,null))[_0x97ac('0x26')](handleError(_0x4a29c4,null));};exports[_0x97ac('0xbe')]=function(_0x4ec3bb,_0x2d09f2,_0x4920b3){return db[_0x97ac('0x3d')][_0x97ac('0x57')]({'where':{'id':_0x4ec3bb[_0x97ac('0x54')]['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x2d09f2,null))['then'](function(_0x13579b){if(_0x13579b){return _0x13579b[_0x97ac('0xbe')](_0x4ec3bb[_0x97ac('0x43')]['ids'])['then'](function(){if(_[_0x97ac('0xbf')](_0x4ec3bb['query'][_0x97ac('0x6a')])){for(var _0x310fcc=0x0;_0x310fcc<_0x4ec3bb[_0x97ac('0x43')][_0x97ac('0x6a')][_0x97ac('0x48')];_0x310fcc+=0x1){socket['emit'](_0x97ac('0xc0'),{'UserId':Number(_0x4ec3bb['query'][_0x97ac('0x6a')][_0x310fcc]),'FaxAccountId':Number(_0x4ec3bb['params']['id'])});}}else{socket[_0x97ac('0xc1')](_0x97ac('0xc0'),{'UserId':Number(_0x4ec3bb[_0x97ac('0x43')]['ids']),'FaxAccountId':Number(_0x4ec3bb[_0x97ac('0x54')]['id'])});}});}})[_0x97ac('0x1d')](respondWithStatusCode(_0x2d09f2,null))['catch'](handleError(_0x2d09f2,null));};exports['getAgents']=function(_0x33ccd5,_0x3923bc,_0x345575){var _0x160dff={};var _0x112ccb={};var _0x24bfd6;var _0x36a0f7;return db[_0x97ac('0x3d')]['findOne']({'where':{'id':_0x33ccd5[_0x97ac('0x54')]['id']}})[_0x97ac('0x1d')](handleEntityNotFound(_0x3923bc,null))[_0x97ac('0x1d')](function(_0x289f88){if(_0x289f88){_0x24bfd6=_0x289f88;_0x112ccb[_0x97ac('0x42')]=_['keys'](db[_0x97ac('0x72')]['rawAttributes']);_0x112ccb['query']=_[_0x97ac('0x56')](_0x33ccd5[_0x97ac('0x43')]);_0x112ccb[_0x97ac('0x44')]=_[_0x97ac('0x46')](_0x112ccb[_0x97ac('0x42')],_0x112ccb[_0x97ac('0x43')]);_0x160dff[_0x97ac('0x45')]=_['intersection'](_0x112ccb[_0x97ac('0x42')],qs[_0x97ac('0x47')](_0x33ccd5['query'][_0x97ac('0x47')]));_0x160dff[_0x97ac('0x45')]=_0x160dff[_0x97ac('0x45')][_0x97ac('0x48')]?_0x160dff[_0x97ac('0x45')]:_0x112ccb[_0x97ac('0x42')];_0x160dff['order']=qs['sort'](_0x33ccd5[_0x97ac('0x43')][_0x97ac('0x4b')]);_0x160dff[_0x97ac('0x4c')]=qs[_0x97ac('0x44')](_[_0x97ac('0x67')](_0x33ccd5[_0x97ac('0x43')],_0x112ccb['filters']));if(_0x33ccd5['query'][_0x97ac('0x4f')]){_0x160dff[_0x97ac('0x4c')]=_[_0x97ac('0x4d')](_0x160dff[_0x97ac('0x4c')],{'$or':_[_0x97ac('0x3c')](_0x160dff[_0x97ac('0x45')],function(_0x2cdb17){var _0x490b51={};_0x490b51[_0x2cdb17]={'$like':'%'+_0x33ccd5['query']['filter']+'%'};return _0x490b51;})});}_0x160dff=_[_0x97ac('0x4d')]({},_0x160dff,_0x33ccd5[_0x97ac('0x50')]);return _0x24bfd6[_0x97ac('0xc2')](_0x160dff);}})[_0x97ac('0x1d')](function(_0x30738d){if(_0x30738d){_0x36a0f7=_0x30738d['length'];if(!_0x33ccd5[_0x97ac('0x43')][_0x97ac('0x66')]('nolimit')){_0x160dff[_0x97ac('0x2c')]=qs[_0x97ac('0x2c')](_0x33ccd5['query'][_0x97ac('0x2c')]);_0x160dff[_0x97ac('0x2b')]=qs['offset'](_0x33ccd5[_0x97ac('0x43')]['offset']);}return _0x24bfd6[_0x97ac('0xc2')](_0x160dff);}})[_0x97ac('0x1d')](function(_0x4016e8){if(_0x4016e8){return _0x4016e8?{'count':_0x36a0f7,'rows':_0x4016e8}:null;}})[_0x97ac('0x1d')](respondWithResult(_0x3923bc,null))[_0x97ac('0x26')](handleError(_0x3923bc,null));}; \ No newline at end of file +var _0x8080=['addDisposition','FaxAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','ids','order','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','send','getApplications','context','from-voip-provider','system','description','appdata','push','Answer','Set','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','bulkCreate','omit','createdAt','updatedAt','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','CmContact','Contacts','attachments','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','get','FaxAccounts','UserProfileResource','destroy','stack','name','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','Pause','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe'];(function(_0x422059,_0x55d477){var _0x3669d9=function(_0x1d1a61){while(--_0x1d1a61){_0x422059['push'](_0x422059['shift']());}};_0x3669d9(++_0x55d477);}(_0x8080,0x11a));var _0x0808=function(_0x1e8d03,_0x33fae0){_0x1e8d03=_0x1e8d03-0x0;var _0x225ee9=_0x8080[_0x1e8d03];return _0x225ee9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0808('0x0'));var jsonpatch=require(_0x0808('0x1'));var rp=require(_0x0808('0x2'));var moment=require(_0x0808('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0808('0x4'));var util=require(_0x0808('0x5'));var path=require(_0x0808('0x6'));var sox=require('sox');var csv=require(_0x0808('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0808('0x8'));var _=require(_0x0808('0x9'));var squel=require(_0x0808('0xa'));var crypto=require('crypto');var jsforce=require(_0x0808('0xb'));var deskjs=require(_0x0808('0xc'));var toCsv=require(_0x0808('0x7'));var querystring=require(_0x0808('0xd'));var Papa=require(_0x0808('0xe'));var Redis=require(_0x0808('0xf'));var authService=require(_0x0808('0x10'));var qs=require(_0x0808('0x11'));var as=require(_0x0808('0x12'));var hardwareService=require(_0x0808('0x13'));var logger=require(_0x0808('0x14'))(_0x0808('0x15'));var utils=require(_0x0808('0x16'));var config=require(_0x0808('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0808('0x18')]=_[_0x0808('0x19')](config[_0x0808('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0808('0x1a'))(new Redis(config[_0x0808('0x18')]));require('./faxAccount.socket')[_0x0808('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0808('0x1c')][_0x0808('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x0808('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x52fc1c,_0x3e2b5c,_0x3aeca9,_0x42c7c5){return new BPromise(function(_0x2ef0ef,_0x27f0ce){var _0x51377c=_0x42c7c5||client;return _0x51377c[_0x0808('0x1e')](_0x52fc1c,_0x3aeca9)[_0x0808('0x1f')](function(_0x7865a5){logger[_0x0808('0x20')](_0x0808('0x21'),_0x3e2b5c,_0x0808('0x22'));logger[_0x0808('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3e2b5c,'request\x20sent',JSON[_0x0808('0x24')](_0x7865a5));if(_0x7865a5[_0x0808('0x25')]){if(_0x7865a5[_0x0808('0x25')][_0x0808('0x26')]===0x1f4){logger[_0x0808('0x25')](_0x0808('0x21'),_0x3e2b5c,_0x7865a5['error'][_0x0808('0x27')]);return _0x27f0ce(_0x7865a5[_0x0808('0x25')][_0x0808('0x27')]);}logger[_0x0808('0x25')](_0x0808('0x21'),_0x3e2b5c,_0x7865a5[_0x0808('0x25')][_0x0808('0x27')]);return _0x2ef0ef(_0x7865a5[_0x0808('0x25')][_0x0808('0x27')]);}else{logger[_0x0808('0x20')]('FaxAccount,\x20%s,\x20%s',_0x3e2b5c,_0x0808('0x22'));_0x2ef0ef(_0x7865a5[_0x0808('0x28')][_0x0808('0x27')]);}})[_0x0808('0x29')](function(_0x8191ac){logger['error'](_0x0808('0x21'),_0x3e2b5c,_0x8191ac);_0x27f0ce(_0x8191ac);});});}function respondWithStatusCode(_0x197988,_0x85862e){_0x85862e=_0x85862e||0xcc;return function(_0x1e8195){if(_0x1e8195){return _0x197988[_0x0808('0x2a')](_0x85862e);}return _0x197988[_0x0808('0x2b')](_0x85862e)[_0x0808('0x2c')]();};}function respondWithResult(_0x11d00b,_0x3dac14){_0x3dac14=_0x3dac14||0xc8;return function(_0x587d93){if(_0x587d93){return _0x11d00b[_0x0808('0x2b')](_0x3dac14)[_0x0808('0x2d')](_0x587d93);}};}function respondWithFilteredResult(_0x5d6187,_0x200b90){return function(_0x3a59e7){if(_0x3a59e7){var _0x45efc1=typeof _0x200b90[_0x0808('0x2e')]===_0x0808('0x2f')&&typeof _0x200b90[_0x0808('0x30')]==='undefined';var _0x4a513=_0x3a59e7['count'];var _0x75026f=_0x45efc1?0x0:_0x200b90['offset'];var _0x3302b7=_0x45efc1?_0x3a59e7['count']:_0x200b90[_0x0808('0x2e')]+_0x200b90[_0x0808('0x30')];var _0x54e097;if(_0x3302b7>=_0x4a513){_0x3302b7=_0x4a513;_0x54e097=0xc8;}else{_0x54e097=0xce;}_0x5d6187[_0x0808('0x2b')](_0x54e097);return _0x5d6187[_0x0808('0x31')](_0x0808('0x32'),_0x75026f+'-'+_0x3302b7+'/'+_0x4a513)[_0x0808('0x2d')](_0x3a59e7);}return null;};}function patchUpdates(_0x2a2dcc){return function(_0x4e4270){try{jsonpatch['apply'](_0x4e4270,_0x2a2dcc,!![]);}catch(_0x19fc6f){return BPromise[_0x0808('0x33')](_0x19fc6f);}return _0x4e4270[_0x0808('0x34')]();};}function saveUpdates(_0x2bc10f,_0x525fb4){return function(_0x35411a){if(_0x35411a){return _0x35411a[_0x0808('0x35')](_0x2bc10f)[_0x0808('0x1f')](function(_0x32e792){return _0x32e792;});}return null;};}function removeEntity(_0x3d53ae,_0xf8d00f){return function(_0x483174){if(_0x483174){return _0x483174['destroy']()[_0x0808('0x1f')](function(){var _0x263120=_0x483174[_0x0808('0x36')]({'plain':!![]});var _0x1dc25f=_0x0808('0x37');return db[_0x0808('0x38')][_0x0808('0x39')]({'where':{'type':_0x1dc25f,'resourceId':_0x263120['id']}})['then'](function(){return _0x483174;});})['then'](function(){_0x3d53ae[_0x0808('0x2b')](0xcc)[_0x0808('0x2c')]();});}};}function handleEntityNotFound(_0x42e506,_0x1198cf){return function(_0xa1350d){if(!_0xa1350d){_0x42e506[_0x0808('0x2a')](0x194);}return _0xa1350d;};}function handleError(_0x18d692,_0x2bacfd){_0x2bacfd=_0x2bacfd||0x1f4;return function(_0x47ab10){logger['error'](_0x47ab10[_0x0808('0x3a')]);if(_0x47ab10[_0x0808('0x3b')]){delete _0x47ab10[_0x0808('0x3b')];}_0x18d692[_0x0808('0x2b')](_0x2bacfd)['send'](_0x47ab10);};}exports[_0x0808('0x3c')]=function(_0x5a9a0e,_0x484e5b){var _0x222190={'include':[{'model':db['Pause'],'as':_0x0808('0x3d')}]},_0x3a29db={},_0x45c6f5={'count':0x0,'rows':[]};var _0x134277=_['map'](db[_0x0808('0x3e')][_0x0808('0x3f')],function(_0x483bfb){return{'name':_0x483bfb[_0x0808('0x40')],'type':_0x483bfb[_0x0808('0x41')][_0x0808('0x42')]};});_0x3a29db[_0x0808('0x43')]=_[_0x0808('0x44')](_0x134277,_0x0808('0x3b'));_0x3a29db[_0x0808('0x45')]=_[_0x0808('0x46')](_0x5a9a0e['query']);_0x3a29db[_0x0808('0x47')]=_[_0x0808('0x48')](_0x3a29db[_0x0808('0x43')],_0x3a29db['query']);_0x222190[_0x0808('0x49')]=_['intersection'](_0x3a29db[_0x0808('0x43')],qs[_0x0808('0x4a')](_0x5a9a0e['query'][_0x0808('0x4a')]));_0x222190[_0x0808('0x49')]=_0x222190[_0x0808('0x49')][_0x0808('0x4b')]?_0x222190['attributes']:_0x3a29db[_0x0808('0x43')];if(!_0x5a9a0e[_0x0808('0x45')][_0x0808('0x4c')]('nolimit')){_0x222190[_0x0808('0x30')]=qs[_0x0808('0x30')](_0x5a9a0e[_0x0808('0x45')][_0x0808('0x30')]);_0x222190[_0x0808('0x2e')]=qs['offset'](_0x5a9a0e[_0x0808('0x45')]['offset']);}_0x222190['order']=qs[_0x0808('0x4d')](_0x5a9a0e[_0x0808('0x45')]['sort']);_0x222190[_0x0808('0x4e')]=qs[_0x0808('0x47')](_[_0x0808('0x4f')](_0x5a9a0e[_0x0808('0x45')],_0x3a29db['filters']),_0x134277);if(_0x5a9a0e[_0x0808('0x45')][_0x0808('0x50')]){_0x222190['where']=_[_0x0808('0x51')](_0x222190[_0x0808('0x4e')],{'$or':_[_0x0808('0x44')](_0x134277,function(_0x199f22){if(_0x199f22[_0x0808('0x41')]!=='VIRTUAL'){var _0x24360e={};_0x24360e[_0x199f22[_0x0808('0x3b')]]={'$like':'%'+_0x5a9a0e['query'][_0x0808('0x50')]+'%'};return _0x24360e;}})});}_0x222190=_[_0x0808('0x51')]({},_0x222190,_0x5a9a0e[_0x0808('0x52')]);var _0x389afd={'where':_0x222190['where']};return db[_0x0808('0x3e')][_0x0808('0x53')](_0x389afd)[_0x0808('0x1f')](function(_0xaef0f5){_0x45c6f5[_0x0808('0x53')]=_0xaef0f5;if(_0x5a9a0e[_0x0808('0x45')][_0x0808('0x54')]){_0x222190['include']=[{'all':!![]}];}return db[_0x0808('0x3e')][_0x0808('0x55')](_0x222190);})[_0x0808('0x1f')](function(_0xf2523){_0x45c6f5[_0x0808('0x56')]=_0xf2523;return _0x45c6f5;})[_0x0808('0x1f')](respondWithFilteredResult(_0x484e5b,_0x222190))[_0x0808('0x29')](handleError(_0x484e5b,null));};exports[_0x0808('0x57')]=function(_0x101294,_0x353f6a){var _0x5d1136={'raw':![],'where':{'id':_0x101294[_0x0808('0x58')]['id']},'include':[{'model':db[_0x0808('0x59')],'as':_0x0808('0x3d')}]},_0x17d86c={};_0x17d86c['model']=_[_0x0808('0x46')](db['FaxAccount']['rawAttributes']);_0x17d86c[_0x0808('0x45')]=_['keys'](_0x101294[_0x0808('0x45')]);_0x17d86c[_0x0808('0x47')]=_['intersection'](_0x17d86c['model'],_0x17d86c['query']);_0x5d1136[_0x0808('0x49')]=_['intersection'](_0x17d86c[_0x0808('0x43')],qs[_0x0808('0x4a')](_0x101294[_0x0808('0x45')][_0x0808('0x4a')]));_0x5d1136[_0x0808('0x49')]=_0x5d1136[_0x0808('0x49')][_0x0808('0x4b')]?_0x5d1136[_0x0808('0x49')]:_0x17d86c[_0x0808('0x43')];if(_0x101294[_0x0808('0x45')][_0x0808('0x54')]){_0x5d1136[_0x0808('0x5a')]=[{'all':!![]}];}_0x5d1136=_[_0x0808('0x51')]({},_0x5d1136,_0x101294[_0x0808('0x52')]);return db['FaxAccount']['find'](_0x5d1136)[_0x0808('0x1f')](handleEntityNotFound(_0x353f6a,null))[_0x0808('0x1f')](respondWithResult(_0x353f6a,null))['catch'](handleError(_0x353f6a,null));};exports[_0x0808('0x5b')]=function(_0x50abbc,_0x1abb77){return db[_0x0808('0x3e')]['create'](_0x50abbc['body'],{})[_0x0808('0x1f')](function(_0x4cdb9d){var _0x70b39c=_0x50abbc['user']['get']({'plain':!![]});if(!_0x70b39c)throw new Error(_0x0808('0x5c'));if(_0x70b39c[_0x0808('0x5d')]===_0x0808('0x5e')){var _0x3bb757=_0x4cdb9d[_0x0808('0x36')]({'plain':!![]});var _0x270ca3=_0x0808('0x37');return db[_0x0808('0x5f')]['find']({'where':{'name':_0x270ca3,'userProfileId':_0x70b39c[_0x0808('0x60')]},'raw':!![]})[_0x0808('0x1f')](function(_0x489cfe){if(_0x489cfe&&_0x489cfe[_0x0808('0x61')]===0x0){return db[_0x0808('0x38')][_0x0808('0x5b')]({'name':_0x3bb757[_0x0808('0x3b')],'resourceId':_0x3bb757['id'],'type':_0x489cfe[_0x0808('0x3b')],'sectionId':_0x489cfe['id']},{})[_0x0808('0x1f')](function(){return _0x4cdb9d;});}else{return _0x4cdb9d;}})[_0x0808('0x29')](function(_0x2540e0){logger[_0x0808('0x25')](_0x0808('0x62'),_0x2540e0);throw _0x2540e0;});}return _0x4cdb9d;})[_0x0808('0x1f')](respondWithResult(_0x1abb77,0xc9))['catch'](handleError(_0x1abb77,null));};exports[_0x0808('0x35')]=function(_0x34ce0d,_0x106615){if(_0x34ce0d[_0x0808('0x63')]['id']){delete _0x34ce0d[_0x0808('0x63')]['id'];}return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x34ce0d[_0x0808('0x58')]['id']},'include':[{'model':db[_0x0808('0x59')],'as':'mandatoryDispositionPause'}]})[_0x0808('0x1f')](handleEntityNotFound(_0x106615,null))[_0x0808('0x1f')](saveUpdates(_0x34ce0d[_0x0808('0x63')],null))[_0x0808('0x1f')](respondWithResult(_0x106615,null))[_0x0808('0x29')](handleError(_0x106615,null));};exports[_0x0808('0x39')]=function(_0x22f64c,_0x5a60eb){return db[_0x0808('0x3e')]['find']({'where':{'id':_0x22f64c[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x5a60eb,null))[_0x0808('0x1f')](removeEntity(_0x5a60eb,null))[_0x0808('0x29')](handleError(_0x5a60eb,null));};exports['describe']=function(_0x407a8f,_0x568788){return db[_0x0808('0x3e')][_0x0808('0x65')]()[_0x0808('0x1f')](respondWithResult(_0x568788,null))[_0x0808('0x29')](handleError(_0x568788,null));};exports[_0x0808('0x66')]=function(_0x193c14,_0x139da4,_0x54e51e){if(_0x193c14[_0x0808('0x63')]['id']){delete _0x193c14[_0x0808('0x63')]['id'];}return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x193c14[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x139da4,null))[_0x0808('0x1f')](function(_0x33756f){if(_0x33756f){_0x193c14['body'][_0x0808('0x67')]=_0x33756f['id'];return db['Disposition'][_0x0808('0x5b')](_0x193c14[_0x0808('0x63')]);}})[_0x0808('0x1f')](respondWithResult(_0x139da4,null))[_0x0808('0x29')](handleError(_0x139da4,null));};exports[_0x0808('0x68')]=function(_0x3c8c74,_0x4d3c5d,_0x156678){var _0x2aa497={'raw':![],'where':{}};var _0xdec7ad={};var _0x4e97d2={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0808('0x69')]({'where':{'id':_0x3c8c74[_0x0808('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d3c5d,null))['then'](function(_0x451784){if(_0x451784){_0xdec7ad[_0x0808('0x43')]=_['keys'](db[_0x0808('0x6a')][_0x0808('0x3f')]);_0xdec7ad[_0x0808('0x45')]=_['keys'](_0x3c8c74[_0x0808('0x45')]);_0xdec7ad[_0x0808('0x47')]=_[_0x0808('0x48')](_0xdec7ad['model'],_0xdec7ad['query']);_0x2aa497['attributes']=_[_0x0808('0x48')](_0xdec7ad[_0x0808('0x43')],qs[_0x0808('0x4a')](_0x3c8c74[_0x0808('0x45')]['fields']));_0x2aa497['attributes']=_0x2aa497[_0x0808('0x49')][_0x0808('0x4b')]?_0x2aa497[_0x0808('0x49')]:_0xdec7ad[_0x0808('0x43')];if(!_0x3c8c74['query'][_0x0808('0x4c')](_0x0808('0x6b'))){_0x2aa497[_0x0808('0x30')]=qs[_0x0808('0x30')](_0x3c8c74[_0x0808('0x45')][_0x0808('0x30')]);_0x2aa497[_0x0808('0x2e')]=qs[_0x0808('0x2e')](_0x3c8c74[_0x0808('0x45')][_0x0808('0x2e')]);}_0x2aa497['order']=qs['sort'](_0x3c8c74['query'][_0x0808('0x4d')]);_0x2aa497[_0x0808('0x4e')]=qs[_0x0808('0x47')](_[_0x0808('0x4f')](_0x3c8c74[_0x0808('0x45')],_0xdec7ad[_0x0808('0x47')]));_0x2aa497[_0x0808('0x4e')][_0x0808('0x67')]=_0x451784['id'];if(_0x3c8c74[_0x0808('0x45')][_0x0808('0x50')]){_0x2aa497['where']=_[_0x0808('0x51')](_0x2aa497[_0x0808('0x4e')],{'$or':_['map'](_0x2aa497['attributes'],function(_0x56dbf8){var _0x7b2adc={};_0x7b2adc[_0x56dbf8]={'$like':'%'+_0x3c8c74[_0x0808('0x45')][_0x0808('0x50')]+'%'};return _0x7b2adc;})});}_0x2aa497=_[_0x0808('0x51')]({},_0x2aa497,_0x3c8c74[_0x0808('0x52')]);return db[_0x0808('0x6a')][_0x0808('0x53')]({'where':_0x2aa497[_0x0808('0x4e')]})['then'](function(_0x49b5c7){_0x4e97d2['count']=_0x49b5c7;if(_0x3c8c74[_0x0808('0x45')]['includeAll']){_0x2aa497['include']=[{'all':!![]}];}return db[_0x0808('0x6a')][_0x0808('0x55')](_0x2aa497);})[_0x0808('0x1f')](function(_0x109f0f){_0x4e97d2[_0x0808('0x56')]=_0x109f0f;return _0x4e97d2;});}})[_0x0808('0x1f')](respondWithFilteredResult(_0x4d3c5d,_0x2aa497))[_0x0808('0x29')](handleError(_0x4d3c5d,null));};exports[_0x0808('0x6c')]=function(_0x5c94bb,_0x50c9b7,_0x586598){return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x5c94bb[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x50c9b7,null))['then'](function(_0x371454){if(_0x371454){return _0x371454['removeDispositions'](_0x5c94bb[_0x0808('0x45')]['ids']);}})[_0x0808('0x1f')](respondWithStatusCode(_0x50c9b7,null))[_0x0808('0x29')](handleError(_0x50c9b7,null));};exports['addAnswer']=function(_0x49f4bd,_0x33afce,_0x2fb5af){if(_0x49f4bd[_0x0808('0x63')]['id']){delete _0x49f4bd[_0x0808('0x63')]['id'];}return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x49f4bd[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x33afce,null))[_0x0808('0x1f')](function(_0x3781b0){if(_0x3781b0){_0x49f4bd['body'][_0x0808('0x67')]=_0x3781b0['id'];return db[_0x0808('0x6d')]['create'](_0x49f4bd[_0x0808('0x63')]);}})[_0x0808('0x1f')](respondWithResult(_0x33afce,null))[_0x0808('0x29')](handleError(_0x33afce,null));};exports[_0x0808('0x6e')]=function(_0x174f3d,_0x15fc3e,_0x48060){var _0x15553e={'raw':![],'where':{}};var _0x55cdb9={};var _0x570670={'count':0x0,'rows':[]};return db[_0x0808('0x3e')][_0x0808('0x69')]({'where':{'id':_0x174f3d[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x15fc3e,null))[_0x0808('0x1f')](function(_0x2c7fef){if(_0x2c7fef){_0x55cdb9['model']=_[_0x0808('0x46')](db[_0x0808('0x6d')][_0x0808('0x3f')]);_0x55cdb9[_0x0808('0x45')]=_[_0x0808('0x46')](_0x174f3d[_0x0808('0x45')]);_0x55cdb9[_0x0808('0x47')]=_[_0x0808('0x48')](_0x55cdb9[_0x0808('0x43')],_0x55cdb9[_0x0808('0x45')]);_0x15553e[_0x0808('0x49')]=_['intersection'](_0x55cdb9[_0x0808('0x43')],qs[_0x0808('0x4a')](_0x174f3d[_0x0808('0x45')]['fields']));_0x15553e[_0x0808('0x49')]=_0x15553e['attributes'][_0x0808('0x4b')]?_0x15553e[_0x0808('0x49')]:_0x55cdb9[_0x0808('0x43')];if(!_0x174f3d[_0x0808('0x45')][_0x0808('0x4c')](_0x0808('0x6b'))){_0x15553e[_0x0808('0x30')]=qs[_0x0808('0x30')](_0x174f3d[_0x0808('0x45')][_0x0808('0x30')]);_0x15553e[_0x0808('0x2e')]=qs['offset'](_0x174f3d['query'][_0x0808('0x2e')]);}_0x15553e['order']=qs[_0x0808('0x4d')](_0x174f3d[_0x0808('0x45')]['sort']);_0x15553e[_0x0808('0x4e')]=qs['filters'](_[_0x0808('0x4f')](_0x174f3d[_0x0808('0x45')],_0x55cdb9[_0x0808('0x47')]));_0x15553e[_0x0808('0x4e')][_0x0808('0x67')]=_0x2c7fef['id'];if(_0x174f3d[_0x0808('0x45')][_0x0808('0x50')]){_0x15553e['where']=_['merge'](_0x15553e[_0x0808('0x4e')],{'$or':_[_0x0808('0x44')](_0x15553e[_0x0808('0x49')],function(_0x3a190e){var _0x885c88={};_0x885c88[_0x3a190e]={'$like':'%'+_0x174f3d[_0x0808('0x45')][_0x0808('0x50')]+'%'};return _0x885c88;})});}_0x15553e=_[_0x0808('0x51')]({},_0x15553e,_0x174f3d['options']);return db['CannedAnswer']['count']({'where':_0x15553e[_0x0808('0x4e')]})['then'](function(_0x1411ee){_0x570670[_0x0808('0x53')]=_0x1411ee;if(_0x174f3d[_0x0808('0x45')]['includeAll']){_0x15553e['include']=[{'all':!![]}];}return db[_0x0808('0x6d')][_0x0808('0x55')](_0x15553e);})['then'](function(_0x6dbd8e){_0x570670[_0x0808('0x56')]=_0x6dbd8e;return _0x570670;});}})[_0x0808('0x1f')](respondWithFilteredResult(_0x15fc3e,_0x15553e))[_0x0808('0x29')](handleError(_0x15fc3e,null));};exports[_0x0808('0x6f')]=function(_0x26fd87,_0x5b5893,_0x2f2bd9){return db[_0x0808('0x3e')]['find']({'where':{'id':_0x26fd87['params']['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x5b5893,null))[_0x0808('0x1f')](function(_0x1a73bd){if(_0x1a73bd){return _0x1a73bd[_0x0808('0x6f')](_0x26fd87[_0x0808('0x45')]['ids']);}})[_0x0808('0x1f')](respondWithStatusCode(_0x5b5893,null))[_0x0808('0x29')](handleError(_0x5b5893,null));};exports['addInteraction']=function(_0x2d1357,_0x4e73ed,_0x4671d4){return db[_0x0808('0x70')][_0x0808('0x64')]({'where':{'id':_0x2d1357[_0x0808('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e73ed,null))[_0x0808('0x1f')](function(_0x3019ab){if(_0x3019ab){return _0x3019ab[_0x0808('0x71')](_0x2d1357['body'][_0x0808('0x72')],_['omit'](_0x2d1357[_0x0808('0x63')],[_0x0808('0x72'),'id'])||{});}})[_0x0808('0x1f')](respondWithResult(_0x4e73ed,null))[_0x0808('0x29')](handleError(_0x4e73ed,null));};exports['getInteractions']=function(_0xe6264b,_0x427a70,_0x36ebcc){var _0x216116={'raw':![],'where':{}};var _0x8bbf0a={};var _0x14d99a={'count':0x0,'rows':[]};return db[_0x0808('0x3e')]['findOne']({'where':{'id':_0xe6264b[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x427a70,null))['then'](function(_0x6342dd){if(_0x6342dd){_0x8bbf0a[_0x0808('0x43')]=_[_0x0808('0x46')](db[_0x0808('0x70')][_0x0808('0x3f')]);_0x8bbf0a[_0x0808('0x45')]=_[_0x0808('0x46')](_0xe6264b[_0x0808('0x45')]);_0x8bbf0a['filters']=_[_0x0808('0x48')](_0x8bbf0a['model'],_0x8bbf0a[_0x0808('0x45')]);_0x216116[_0x0808('0x49')]=_['intersection'](_0x8bbf0a[_0x0808('0x43')],qs[_0x0808('0x4a')](_0xe6264b[_0x0808('0x45')][_0x0808('0x4a')]));_0x216116[_0x0808('0x49')]=_0x216116['attributes'][_0x0808('0x4b')]?_0x216116['attributes']:_0x8bbf0a[_0x0808('0x43')];if(!_0xe6264b['query'][_0x0808('0x4c')](_0x0808('0x6b'))){_0x216116['limit']=qs['limit'](_0xe6264b[_0x0808('0x45')]['limit']);_0x216116['offset']=qs['offset'](_0xe6264b[_0x0808('0x45')][_0x0808('0x2e')]);}_0x216116[_0x0808('0x73')]=qs[_0x0808('0x4d')](_0xe6264b[_0x0808('0x45')][_0x0808('0x4d')]);_0x216116[_0x0808('0x4e')]=qs[_0x0808('0x47')](_[_0x0808('0x4f')](_0xe6264b[_0x0808('0x45')],_0x8bbf0a[_0x0808('0x47')]));_0x216116[_0x0808('0x4e')]['FaxAccountId']=_0x6342dd['id'];if(_0xe6264b['query'][_0x0808('0x50')]){_0x216116['where']=_[_0x0808('0x51')](_0x216116[_0x0808('0x4e')],{'$or':_[_0x0808('0x44')](_0x216116[_0x0808('0x49')],function(_0x951f05){var _0x22a572={};_0x22a572[_0x951f05]={'$like':'%'+_0xe6264b[_0x0808('0x45')]['filter']+'%'};return _0x22a572;})});}_0x216116=_[_0x0808('0x51')]({},_0x216116,_0xe6264b[_0x0808('0x52')]);return db['FaxInteraction']['count']({'where':_0x216116['where']})[_0x0808('0x1f')](function(_0x544c04){_0x14d99a['count']=_0x544c04;if(_0xe6264b[_0x0808('0x45')][_0x0808('0x54')]){_0x216116['include']=[{'model':db['CmContact'],'as':_0x0808('0x74'),'required':![]},{'model':db[_0x0808('0x75')],'as':_0x0808('0x76'),'attributes':[_0x0808('0x3b'),_0x0808('0x77'),_0x0808('0x78')],'required':![]},{'model':db[_0x0808('0x79')],'as':_0x0808('0x7a'),'attributes':['id',_0x0808('0x3b'),_0x0808('0x7b')],'where':_0xe6264b[_0x0808('0x45')][_0x0808('0x7c')]?{'id':_0xe6264b['query']['tag']}:undefined,'required':_0xe6264b[_0x0808('0x45')][_0x0808('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0x0808('0x55')](_0x216116);})[_0x0808('0x1f')](function(_0x47e287){_0x14d99a[_0x0808('0x56')]=_0x47e287;return _0x14d99a;});}})[_0x0808('0x1f')](respondWithFilteredResult(_0x427a70,_0x216116))[_0x0808('0x29')](handleError(_0x427a70,null));};exports['addApplications']=function(_0x2115e2,_0x372c28){var _0x5dc55f=_0x2115e2[_0x0808('0x58')]['id'];var _0x17cf85=_0x2115e2['body'];var _0x160852=0xc8;var _0x3b7076=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0808('0x7d')][_0x0808('0x7e')][_0x0808('0x7f')][_0x0808('0x80')]},function(_0x6d64ea){return db[_0x0808('0x3e')][_0x0808('0x69')]({'where':{'id':_0x5dc55f},'transaction':_0x6d64ea})[_0x0808('0x1f')](function(_0x48a6e6){if(_0x48a6e6){return db[_0x0808('0x81')]['destroy']({'where':{'FaxAccountId':_0x5dc55f},'transaction':_0x6d64ea})['then'](function(){var _0x5657a9=_[_0x0808('0x44')](_0x17cf85,function(_0x4333fd){_0x4333fd[_0x0808('0x67')]=_0x5dc55f;return _0x4333fd;});return db['FaxApplication']['bulkCreate'](_0x5657a9,{'transaction':_0x6d64ea});});}else{_0x160852=0x194;_0x3b7076=[];}});})[_0x0808('0x1f')](function(){if(_0x160852!==0x194){return db['FaxApplication'][_0x0808('0x82')]({'where':{'FaxAccountId':_0x5dc55f},'order':_0x0808('0x83')})[_0x0808('0x1f')](function(_0x4a227f){_0x3b7076=_0x4a227f;});}})['catch'](function(_0x458e1b){_0x160852=0x1f4;logger[_0x0808('0x25')](_0x458e1b[_0x0808('0x3a')]);if(_0x458e1b['name']){delete _0x458e1b[_0x0808('0x3b')];}_0x3b7076=_0x458e1b;})['finally'](function(){if(_0x3b7076===null){_0x372c28[_0x0808('0x2a')](_0x160852);}else{if(_0x160852===0x1f4){_0x372c28[_0x0808('0x2b')](_0x160852)[_0x0808('0x84')](_0x3b7076);}else{_0x372c28[_0x0808('0x2b')](_0x160852)['json'](_0x3b7076);}}});};exports[_0x0808('0x85')]=function(_0xcb14ad,_0x571211,_0x5bf88a){var _0x14d2f1={};var _0x835149={};var _0x7cf364;var _0x44aa70;return db[_0x0808('0x3e')][_0x0808('0x69')]({'where':{'id':_0xcb14ad[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x571211,null))[_0x0808('0x1f')](function(_0x4d1723){if(_0x4d1723){_0x7cf364=_0x4d1723;_0x835149[_0x0808('0x43')]=_[_0x0808('0x46')](db['FaxApplication'][_0x0808('0x3f')]);_0x835149[_0x0808('0x45')]=_[_0x0808('0x46')](_0xcb14ad[_0x0808('0x45')]);_0x835149['filters']=_[_0x0808('0x48')](_0x835149[_0x0808('0x43')],_0x835149[_0x0808('0x45')]);_0x14d2f1['attributes']=_[_0x0808('0x48')](_0x835149[_0x0808('0x43')],qs[_0x0808('0x4a')](_0xcb14ad[_0x0808('0x45')][_0x0808('0x4a')]));_0x14d2f1['attributes']=_0x14d2f1['attributes'][_0x0808('0x4b')]?_0x14d2f1[_0x0808('0x49')]:_0x835149[_0x0808('0x43')];_0x14d2f1[_0x0808('0x73')]=qs[_0x0808('0x4d')](_0xcb14ad['query'][_0x0808('0x4d')]);_0x14d2f1[_0x0808('0x4e')]=qs[_0x0808('0x47')](_['pick'](_0xcb14ad[_0x0808('0x45')],_0x835149[_0x0808('0x47')]));if(_0xcb14ad['query'][_0x0808('0x50')]){_0x14d2f1[_0x0808('0x4e')]=_['merge'](_0x14d2f1[_0x0808('0x4e')],{'$or':_[_0x0808('0x44')](_0x14d2f1[_0x0808('0x49')],function(_0x2ade01){var _0x30da77={};_0x30da77[_0x2ade01]={'$like':'%'+_0xcb14ad[_0x0808('0x45')][_0x0808('0x50')]+'%'};return _0x30da77;})});}_0x14d2f1=_[_0x0808('0x51')]({},_0x14d2f1,_0xcb14ad[_0x0808('0x52')]);return _0x7cf364[_0x0808('0x85')](_0x14d2f1);}})[_0x0808('0x1f')](function(_0x25267b){if(_0x25267b){_0x44aa70=_0x25267b[_0x0808('0x4b')];if(!_0xcb14ad[_0x0808('0x45')][_0x0808('0x4c')](_0x0808('0x6b'))){_0x14d2f1[_0x0808('0x30')]=qs[_0x0808('0x30')](_0xcb14ad[_0x0808('0x45')][_0x0808('0x30')]);_0x14d2f1[_0x0808('0x2e')]=qs[_0x0808('0x2e')](_0xcb14ad[_0x0808('0x45')][_0x0808('0x2e')]);}return _0x7cf364[_0x0808('0x85')](_0x14d2f1);}})[_0x0808('0x1f')](function(_0x21f5f3){if(_0x21f5f3){return _0x21f5f3?{'count':_0x44aa70,'rows':_0x21f5f3}:null;}})['then'](respondWithResult(_0x571211,null))[_0x0808('0x29')](handleError(_0x571211,null));};function Extension(_0xb6c404,_0xc9da23,_0x4a4943,_0x56a278){this[_0x0808('0x86')]=_0x0808('0x87');this['exten']=_0xb6c404['localstationid'];this['app']=_0x56a278;this['type']=_0x0808('0x88');this[_0x0808('0x89')]='Fax\x20Extension';this[_0x0808('0x67')]=_0xb6c404['id'];this[_0x0808('0x83')]=_0xc9da23;this[_0x0808('0x8a')]=_0x4a4943;}function createExtensionsReciveFax(_0x48c8db){var _0x577b9a=0x1;var _0x5f51c1=[];_0x5f51c1[_0x0808('0x8b')](new Extension(_0x48c8db,_0x577b9a,'',_0x0808('0x8c')));_0x577b9a+=0x1;_0x5f51c1[_0x0808('0x8b')](new Extension(_0x48c8db,_0x577b9a,'CDR(type)=inbound-fax',_0x0808('0x8d')));_0x577b9a+=0x1;for(var _0x221c7e in _0x48c8db){if(_0x48c8db['hasOwnProperty'](_0x221c7e)&&(_0x221c7e==='ecm'||_0x221c7e==='localstationid'||_0x221c7e===_0x0808('0x8e')||_0x221c7e===_0x0808('0x8f')||_0x221c7e===_0x0808('0x90')||_0x221c7e===_0x0808('0x91')||_0x221c7e==='minrate'||_0x221c7e===_0x0808('0x92')||_0x221c7e===_0x0808('0x93'))){_0x5f51c1[_0x0808('0x8b')](new Extension(_0x48c8db,_0x577b9a,_0x0808('0x94')+_0x221c7e+')='+_0x48c8db[_0x221c7e],'Set'));_0x577b9a+=0x1;}}_0x5f51c1['push'](new Extension(_0x48c8db,_0x577b9a,'6','Wait'));_0x577b9a+=0x1;_0x5f51c1[_0x0808('0x8b')](new Extension(_0x48c8db,_0x577b9a,_0x0808('0x95'),_0x0808('0x96')));_0x577b9a=0x0;return _0x5f51c1;}exports[_0x0808('0x97')]=function(_0x200e9f,_0x29461c,_0x4dc9d2){var _0x28a59b;return db[_0x0808('0x7d')][_0x0808('0x98')](function(_0xdc06ea){return db[_0x0808('0x3e')][_0x0808('0x5b')](_0x200e9f['body'],{'transaction':_0xdc06ea})[_0x0808('0x1f')](function(_0x4816e1){_0x28a59b=_0x4816e1[_0x0808('0x36')]({'plain':!![]});return db[_0x0808('0x99')]['bulkCreate'](createExtensionsReciveFax(_0x28a59b),{'transaction':_0xdc06ea});});})[_0x0808('0x1f')](function(){return _0x28a59b;})['then'](respondWithResult(_0x29461c,null))[_0x0808('0x29')](handleError(_0x29461c,null));};exports[_0x0808('0x9a')]=function(_0x178428,_0x589911,_0x13f96b){var _0x2c63cb;return db[_0x0808('0x7d')][_0x0808('0x98')](function(_0x5c798e){return db['FaxAccount'][_0x0808('0x35')](_0x178428['body'],{'where':{'id':_0x178428[_0x0808('0x63')]['id']},'transaction':_0x5c798e})['then'](function(_0x2ebfeb){return db[_0x0808('0x99')][_0x0808('0x39')]({'where':{'FaxAccountId':_0x178428[_0x0808('0x63')]['id']},'transaction':_0x5c798e})['then'](function(_0x14b881){return db[_0x0808('0x99')][_0x0808('0x9b')](createExtensionsReciveFax(_[_0x0808('0x9c')](_0x178428['body'],['tech','key',_0x0808('0x9d'),_0x0808('0x9e'),'TrunkId',_0x0808('0x9f')])),{'transaction':_0x5c798e});});});})[_0x0808('0x1f')](function(){return db[_0x0808('0x3e')][_0x0808('0xa0')](_0x178428[_0x0808('0x63')]['id']);})[_0x0808('0x1f')](respondWithResult(_0x589911,null))[_0x0808('0x29')](handleError(_0x589911,null));};exports[_0x0808('0xa1')]=function(_0x5c3ed6,_0x3ede28,_0x252c8c){var _0x3d16fe={'raw':!![],'where':{}};var _0x453573={};var _0x5b38c9={'count':0x0,'rows':[]};return db[_0x0808('0x3e')][_0x0808('0x69')]({'where':{'id':_0x5c3ed6['params']['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x3ede28,null))[_0x0808('0x1f')](function(_0xe25f6b){if(_0xe25f6b){_0x453573[_0x0808('0x43')]=_[_0x0808('0x46')](db['FaxMessage'][_0x0808('0x3f')]);_0x453573[_0x0808('0x45')]=_[_0x0808('0x46')](_0x5c3ed6[_0x0808('0x45')]);_0x453573['filters']=_['intersection'](_0x453573[_0x0808('0x43')],_0x453573['query']);_0x3d16fe[_0x0808('0x49')]=_[_0x0808('0x48')](_0x453573[_0x0808('0x43')],qs[_0x0808('0x4a')](_0x5c3ed6[_0x0808('0x45')][_0x0808('0x4a')]));_0x3d16fe[_0x0808('0x49')]=_0x3d16fe[_0x0808('0x49')]['length']?_0x3d16fe['attributes']:_0x453573[_0x0808('0x43')];if(!_0x5c3ed6[_0x0808('0x45')][_0x0808('0x4c')]('nolimit')){_0x3d16fe[_0x0808('0x30')]=qs[_0x0808('0x30')](_0x5c3ed6[_0x0808('0x45')][_0x0808('0x30')]);_0x3d16fe[_0x0808('0x2e')]=qs['offset'](_0x5c3ed6['query'][_0x0808('0x2e')]);}_0x3d16fe[_0x0808('0x73')]=qs[_0x0808('0x4d')](_0x5c3ed6[_0x0808('0x45')][_0x0808('0x4d')]);_0x3d16fe[_0x0808('0x4e')]=qs[_0x0808('0x47')](_[_0x0808('0x4f')](_0x5c3ed6['query'],_0x453573[_0x0808('0x47')]));_0x3d16fe[_0x0808('0x4e')][_0x0808('0x67')]=_0xe25f6b['id'];if(_0x5c3ed6['query'][_0x0808('0x50')]){_0x3d16fe[_0x0808('0x4e')]=_[_0x0808('0x51')](_0x3d16fe[_0x0808('0x4e')],{'$or':_[_0x0808('0x44')](_0x3d16fe[_0x0808('0x49')],function(_0x47d432){var _0x2eb8ec={};_0x2eb8ec[_0x47d432]={'$like':'%'+_0x5c3ed6[_0x0808('0x45')][_0x0808('0x50')]+'%'};return _0x2eb8ec;})});}if(_0x5c3ed6[_0x0808('0x45')][_0x0808('0xa2')]){var _0xc23c8f=_0x5c3ed6[_0x0808('0x45')][_0x0808('0xa2')][_0x0808('0xa3')](',');var _0x5950cf={};_0x5950cf[_0xc23c8f[0x0]]={'$gte':moment(_0xc23c8f[0x1])[_0x0808('0xa4')](_0x0808('0xa5'))};_0x3d16fe['where']=_[_0x0808('0x51')](_0x3d16fe[_0x0808('0x4e')],_0x5950cf);}_0x3d16fe=_['merge']({},_0x3d16fe,_0x5c3ed6[_0x0808('0x52')]);return db[_0x0808('0xa6')][_0x0808('0x53')]({'where':_0x3d16fe['where']})[_0x0808('0x1f')](function(_0x25f602){_0x5b38c9[_0x0808('0x53')]=_0x25f602;if(_0x5c3ed6[_0x0808('0x45')][_0x0808('0x54')]){_0x3d16fe['include']=[{'all':!![]}];}return db[_0x0808('0xa6')][_0x0808('0x55')](_0x3d16fe);})[_0x0808('0x1f')](function(_0x55bc54){_0x5b38c9[_0x0808('0x56')]=_0x55bc54;return _0x5b38c9;});}})[_0x0808('0x1f')](respondWithFilteredResult(_0x3ede28,_0x3d16fe))[_0x0808('0x29')](handleError(_0x3ede28,null));};exports[_0x0808('0x84')]=function(_0x286c56,_0x2f3cfe,_0x4e9822){var _0x36c465,_0x446514={},_0x56b742;if(_0x286c56['body']['to']){_0x56b742=_0x286c56[_0x0808('0x63')]['to'][0x0];}return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x286c56['params']['id']},'include':[{'model':db['CmList'],'as':_0x0808('0xa7'),'include':[{'model':db[_0x0808('0xa8')],'as':_0x0808('0xa9'),'where':{'fax':_0x56b742},'limit':0x1,'order':[[_0x0808('0x9e'),'DESC']]}]}]})[_0x0808('0x1f')](handleEntityNotFound(_0x2f3cfe,null))['then'](function(_0x1c1659){_0x36c465=_0x1c1659;if(_0x286c56[_0x0808('0x63')][_0x0808('0xaa')]&&_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][_0x0808('0x4b')]){for(var _0x50399a=0x0;_0x50399a<_0x286c56['body'][_0x0808('0xaa')][_0x0808('0x4b')];_0x50399a+=0x1){_0x286c56[_0x0808('0x63')]['attachments'][_0x50399a]={'filename':_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][_0x50399a][_0x0808('0x3b')],'id':_0x286c56['body'][_0x0808('0xaa')][_0x50399a]['id'],'path':path['join'](config[_0x0808('0xab')],'server/files/attachments',_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][_0x50399a][_0x0808('0xac')])};}}return respondWithRpcPromise(_0x0808('0xad'),_0x0808('0xad'),{'FaxAccountId':_['isNil'](_0x286c56[_0x0808('0x58')]['id'])?undefined:_0x286c56[_0x0808('0x58')]['id'],'path':_[_0x0808('0xae')](_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0][_0x0808('0x6')])?undefined:_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0][_0x0808('0x6')],'fax':_[_0x0808('0xae')](_0x286c56['body']['to'][0x0])?undefined:_0x286c56[_0x0808('0x63')]['to'][0x0]},client9002);})[_0x0808('0x1f')](function(){if(_0x36c465){if(_[_0x0808('0xae')](_0x286c56[_0x0808('0x63')]['from'])){_0x286c56[_0x0808('0x63')][_0x0808('0xaf')]=util[_0x0808('0xa4')](_0x0808('0xb0'),_0x36c465[_0x0808('0x3b')],_0x36c465[_0x0808('0xb1')]);}if(_0x36c465[_0x0808('0xa7')]){if(_0x36c465[_0x0808('0xa7')][_0x0808('0xa9')][_0x0808('0x4b')]){return _0x36c465[_0x0808('0xa7')][_0x0808('0xa9')][0x0];}else{return db[_0x0808('0xa8')][_0x0808('0x5b')](_[_0x0808('0x19')](_0x286c56[_0x0808('0x63')],{'firstName':_0x286c56[_0x0808('0x63')]['to'][0x0],'phone':_0x286c56[_0x0808('0x63')]['to'][0x0],'fax':_0x286c56[_0x0808('0x63')]['to'][0x0],'ListId':_0x36c465[_0x0808('0x9f')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x0808('0x1f')](function(_0xcf278f){if(_0xcf278f){return db['FaxInteraction'][_0x0808('0x64')]({'where':{'ContactId':_0xcf278f['id'],'closed':![],'FaxAccountId':_0x36c465['id']}})[_0x0808('0x1f')](function(_0x3e2fcb){if(_0x3e2fcb){return[_0x3e2fcb,![]];}return db[_0x0808('0x70')][_0x0808('0x5b')]({'UserId':_0x286c56['user']['id'],'ContactId':_0xcf278f['id'],'FaxAccountId':_0x36c465['id'],'fax':_0x286c56[_0x0808('0x63')]['to'][0x0],'firstMsgDirection':_0x0808('0xb2'),'Messages':[_['merge'](_0x286c56['body'],{'read':![],'body':_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0][_0x0808('0xb3')],'FaxAccountId':_0x36c465['id'],'UserId':_0x286c56[_0x0808('0x5e')]['id'],'ContactId':_0xcf278f['id'],'AttachmentId':_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x0808('0xb4')}]})['then'](function(_0x3592e7){return[_0x3592e7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0808('0xb5')](function(_0x34f065,_0x14c734){if(_0x14c734){return _0x34f065;}return db['FaxMessage'][_0x0808('0x5b')]({'direction':_0x0808('0xb2'),'read':![],'body':_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0][_0x0808('0xb3')],'FaxAccountId':_0x36c465['id'],'FaxInteractionId':_0x34f065['id'],'UserId':_0x286c56['user']['id'],'ContactId':_0x34f065[_0x0808('0xb6')],'AttachmentId':_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0]['id']})[_0x0808('0x1f')](function(_0x277acb){_0x34f065[_0x0808('0xb7')][_0x0808('0xb4')]=[];_0x34f065['dataValues'][_0x0808('0xb4')][_0x0808('0x8b')](_0x277acb[_0x0808('0xb7')]);return _0x34f065;});})[_0x0808('0x1f')](function(_0x292d91){respondWithRpcPromise(_0x0808('0xb8'),_0x0808('0xb8'),{'FaxAccountId':_[_0x0808('0xae')](_0x286c56[_0x0808('0x58')]['id'])?undefined:_0x286c56[_0x0808('0x58')]['id'],'path':_[_0x0808('0xae')](_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0][_0x0808('0x6')])?undefined:_0x286c56['body'][_0x0808('0xaa')][0x0][_0x0808('0x6')],'fax':_[_0x0808('0xae')](_0x286c56[_0x0808('0x63')]['to'][0x0])?undefined:_0x286c56[_0x0808('0x63')]['to'][0x0],'AttachmentId':_0x286c56[_0x0808('0x63')][_0x0808('0xaa')][0x0]['id']},client9002)[_0x0808('0x1f')](function(_0x27c05d){logger[_0x0808('0x20')]('SendFaxRpc,\x20%s',_0x27c05d);})[_0x0808('0x29')](function(_0x38763d){logger[_0x0808('0x20')](_0x0808('0xb9'),_0x38763d);});return _0x292d91;})[_0x0808('0x1f')](respondWithResult(_0x2f3cfe,null))[_0x0808('0x29')](handleError(_0x2f3cfe,null));};exports['addAgents']=function(_0x41e33a,_0x10b139,_0x5c482f){return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x41e33a[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x10b139,null))[_0x0808('0x1f')](function(_0x254b91){if(_0x254b91){return _0x254b91[_0x0808('0xba')](_0x41e33a[_0x0808('0x63')][_0x0808('0x72')],_[_0x0808('0x9c')](_0x41e33a[_0x0808('0x63')],[_0x0808('0x72'),'id'])||{})[_0x0808('0xb5')](function(_0x235aee){for(var _0x5733fe=0x0;_0x5733fe<_0x41e33a[_0x0808('0x63')][_0x0808('0x72')][_0x0808('0x4b')];_0x5733fe+=0x1){socket[_0x0808('0xbb')]('userFaxAccount:save',{'UserId':Number(_0x41e33a[_0x0808('0x63')]['ids'][_0x5733fe]),'FaxAccountId':Number(_0x41e33a[_0x0808('0x58')]['id'])});}return _0x235aee;});}})[_0x0808('0x1f')](respondWithResult(_0x10b139,null))[_0x0808('0x29')](handleError(_0x10b139,null));};exports[_0x0808('0xbc')]=function(_0x54ae13,_0x19c0c6,_0x44535c){return db[_0x0808('0x3e')][_0x0808('0x64')]({'where':{'id':_0x54ae13[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x19c0c6,null))[_0x0808('0x1f')](function(_0x1c3801){if(_0x1c3801){return _0x1c3801[_0x0808('0xbc')](_0x54ae13[_0x0808('0x45')][_0x0808('0x72')])[_0x0808('0x1f')](function(){if(_[_0x0808('0xbd')](_0x54ae13[_0x0808('0x45')][_0x0808('0x72')])){for(var _0x21f604=0x0;_0x21f604<_0x54ae13[_0x0808('0x45')][_0x0808('0x72')][_0x0808('0x4b')];_0x21f604+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x54ae13[_0x0808('0x45')][_0x0808('0x72')][_0x21f604]),'FaxAccountId':Number(_0x54ae13[_0x0808('0x58')]['id'])});}}else{socket['emit'](_0x0808('0xbe'),{'UserId':Number(_0x54ae13[_0x0808('0x45')][_0x0808('0x72')]),'FaxAccountId':Number(_0x54ae13['params']['id'])});}});}})[_0x0808('0x1f')](respondWithStatusCode(_0x19c0c6,null))[_0x0808('0x29')](handleError(_0x19c0c6,null));};exports[_0x0808('0xbf')]=function(_0x7d6ca8,_0x26c1b4,_0x2e701f){var _0x1fd93={};var _0x4f6a5e={};var _0xcb9df6;var _0x5ac4f6;return db[_0x0808('0x3e')][_0x0808('0x69')]({'where':{'id':_0x7d6ca8[_0x0808('0x58')]['id']}})[_0x0808('0x1f')](handleEntityNotFound(_0x26c1b4,null))[_0x0808('0x1f')](function(_0x4d0f9d){if(_0x4d0f9d){_0xcb9df6=_0x4d0f9d;_0x4f6a5e['model']=_['keys'](db[_0x0808('0x75')][_0x0808('0x3f')]);_0x4f6a5e['query']=_['keys'](_0x7d6ca8[_0x0808('0x45')]);_0x4f6a5e['filters']=_[_0x0808('0x48')](_0x4f6a5e[_0x0808('0x43')],_0x4f6a5e[_0x0808('0x45')]);_0x1fd93[_0x0808('0x49')]=_[_0x0808('0x48')](_0x4f6a5e[_0x0808('0x43')],qs[_0x0808('0x4a')](_0x7d6ca8[_0x0808('0x45')][_0x0808('0x4a')]));_0x1fd93['attributes']=_0x1fd93[_0x0808('0x49')][_0x0808('0x4b')]?_0x1fd93['attributes']:_0x4f6a5e[_0x0808('0x43')];_0x1fd93[_0x0808('0x73')]=qs[_0x0808('0x4d')](_0x7d6ca8[_0x0808('0x45')][_0x0808('0x4d')]);_0x1fd93[_0x0808('0x4e')]=qs[_0x0808('0x47')](_[_0x0808('0x4f')](_0x7d6ca8[_0x0808('0x45')],_0x4f6a5e[_0x0808('0x47')]));if(_0x7d6ca8[_0x0808('0x45')][_0x0808('0x50')]){_0x1fd93[_0x0808('0x4e')]=_[_0x0808('0x51')](_0x1fd93['where'],{'$or':_['map'](_0x1fd93['attributes'],function(_0xe8fa1f){var _0x1b9a60={};_0x1b9a60[_0xe8fa1f]={'$like':'%'+_0x7d6ca8[_0x0808('0x45')][_0x0808('0x50')]+'%'};return _0x1b9a60;})});}_0x1fd93=_[_0x0808('0x51')]({},_0x1fd93,_0x7d6ca8[_0x0808('0x52')]);return _0xcb9df6[_0x0808('0xbf')](_0x1fd93);}})[_0x0808('0x1f')](function(_0x1a233e){if(_0x1a233e){_0x5ac4f6=_0x1a233e[_0x0808('0x4b')];if(!_0x7d6ca8[_0x0808('0x45')][_0x0808('0x4c')](_0x0808('0x6b'))){_0x1fd93[_0x0808('0x30')]=qs[_0x0808('0x30')](_0x7d6ca8[_0x0808('0x45')][_0x0808('0x30')]);_0x1fd93[_0x0808('0x2e')]=qs['offset'](_0x7d6ca8[_0x0808('0x45')][_0x0808('0x2e')]);}return _0xcb9df6[_0x0808('0xbf')](_0x1fd93);}})[_0x0808('0x1f')](function(_0x4e1244){if(_0x4e1244){return _0x4e1244?{'count':_0x5ac4f6,'rows':_0x4e1244}:null;}})[_0x0808('0x1f')](respondWithResult(_0x26c1b4,null))[_0x0808('0x29')](handleError(_0x26c1b4,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index f7fe296..1cf661c 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 _0xc5e5=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xc5e5,0x1e1));var _0x5c5e=function(_0x451b05,_0xf7b9c6){_0x451b05=_0x451b05-0x0;var _0x55fcc4=_0xc5e5[_0x451b05];return _0x55fcc4;};'use strict';var EventEmitter=require(_0x5c5e('0x0'));var FaxAccount=require(_0x5c5e('0x1'))['db'][_0x5c5e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5c5e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c5e('0x4'),'afterDestroy':_0x5c5e('0x5')};function emitEvent(_0xf3454a){return function(_0x1b98a6,_0xb1f72c,_0x5c76c5){FaxAccountEvents[_0x5c5e('0x6')](_0xf3454a+':'+_0x1b98a6['id'],_0x1b98a6);FaxAccountEvents[_0x5c5e('0x6')](_0xf3454a,_0x1b98a6);_0x5c76c5(null);};}for(var e in events){if(events[_0x5c5e('0x7')](e)){var event=events[e];FaxAccount[_0x5c5e('0x8')](e,emitEvent(event));}}module[_0x5c5e('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x4bc7=['hook','exports','FaxAccount','setMaxListeners','remove','emit'];(function(_0x41f745,_0x4b5c4a){var _0x2cbbcb=function(_0x4d5c74){while(--_0x4d5c74){_0x41f745['push'](_0x41f745['shift']());}};_0x2cbbcb(++_0x4b5c4a);}(_0x4bc7,0x188));var _0x74bc=function(_0x3ba537,_0x56b969){_0x3ba537=_0x3ba537-0x0;var _0x585c1a=_0x4bc7[_0x3ba537];return _0x585c1a;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x74bc('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x74bc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x74bc('0x2')};function emitEvent(_0x5b08d0){return function(_0x249871,_0x3089fb,_0x2eee2f){FaxAccountEvents['emit'](_0x5b08d0+':'+_0x249871['id'],_0x249871);FaxAccountEvents[_0x74bc('0x3')](_0x5b08d0,_0x249871);_0x2eee2f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x74bc('0x4')](e,emitEvent(event));}}module[_0x74bc('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 3482e65..e43aeac 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 _0x5406=['./faxAccount.attributes','exports','define','FaxAccount','lodash','util','../../config/logger','moment','rimraf'];(function(_0x558980,_0x19bd71){var _0x3bbc70=function(_0x2a93af){while(--_0x2a93af){_0x558980['push'](_0x558980['shift']());}};_0x3bbc70(++_0x19bd71);}(_0x5406,0x17e));var _0x6540=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x5406[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x6540('0x0'));var util=require(_0x6540('0x1'));var logger=require(_0x6540('0x2'))('api');var moment=require(_0x6540('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6540('0x4'));var config=require('../../config/environment');var attributes=require(_0x6540('0x5'));module[_0x6540('0x6')]=function(_0x298321,_0x3fd186){return _0x298321[_0x6540('0x7')](_0x6540('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa67b=['define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports'];(function(_0x9f42c5,_0xbf9b7d){var _0x586fa8=function(_0x232150){while(--_0x232150){_0x9f42c5['push'](_0x9f42c5['shift']());}};_0x586fa8(++_0xbf9b7d);}(_0xa67b,0x1f2));var _0xba67=function(_0x45fd6d,_0x571072){_0x45fd6d=_0x45fd6d-0x0;var _0x5d27bd=_0xa67b[_0x45fd6d];return _0x5d27bd;};'use strict';var _=require(_0xba67('0x0'));var util=require(_0xba67('0x1'));var logger=require(_0xba67('0x2'))('api');var moment=require(_0xba67('0x3'));var BPromise=require(_0xba67('0x4'));var rp=require(_0xba67('0x5'));var fs=require('fs');var path=require(_0xba67('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xba67('0x7')]=function(_0x528601,_0x13da7b){return _0x528601[_0xba67('0x8')](_0xba67('0x9'),attributes,{'tableName':_0xba67('0xa'),'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 3c3d94d..aa13b00 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 _0x51a3=['waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','length','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent'];(function(_0x493299,_0xfb0840){var _0x4f291a=function(_0x14495c){while(--_0x14495c){_0x493299['push'](_0x493299['shift']());}};_0x4f291a(++_0xfb0840);}(_0x51a3,0xcb));var _0x351a=function(_0x18f146,_0x49aaad){_0x18f146=_0x18f146-0x0;var _0x29073d=_0x51a3[_0x18f146];return _0x29073d;};'use strict';var _=require('lodash');var util=require(_0x351a('0x0'));var moment=require('moment');var BPromise=require(_0x351a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x351a('0x2'));var db=require(_0x351a('0x3'))['db'];var utils=require(_0x351a('0x4'));var logger=require(_0x351a('0x5'))(_0x351a('0x6'));var config=require('../../config/environment');var jayson=require(_0x351a('0x7'));var client=jayson[_0x351a('0x8')][_0x351a('0x9')]({'port':0x232c});config[_0x351a('0xa')]=_['defaults'](config[_0x351a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x351a('0xb'))(new Redis(config['redis']));require(_0x351a('0xc'))[_0x351a('0xd')](socket);function respondWithRpcPromise(_0x59ad5b,_0x88396e,_0x2c1b49){return new BPromise(function(_0x398ab0,_0x81aa0b){return client[_0x351a('0xe')](_0x59ad5b,_0x2c1b49)[_0x351a('0xf')](function(_0x20e994){logger[_0x351a('0x10')]('FaxAccount,\x20%s,\x20%s',_0x88396e,'request\x20sent');logger[_0x351a('0x11')](_0x351a('0x12'),_0x88396e,_0x351a('0x13'),JSON['stringify'](_0x20e994));if(_0x20e994[_0x351a('0x14')]){if(_0x20e994['error'][_0x351a('0x15')]===0x1f4){logger[_0x351a('0x14')](_0x351a('0x16'),_0x88396e,_0x20e994[_0x351a('0x14')]['message']);return _0x81aa0b(_0x20e994[_0x351a('0x14')]['message']);}logger[_0x351a('0x14')](_0x351a('0x16'),_0x88396e,_0x20e994['error'][_0x351a('0x17')]);return _0x398ab0(_0x20e994[_0x351a('0x14')][_0x351a('0x17')]);}else{logger[_0x351a('0x10')](_0x351a('0x16'),_0x88396e,_0x351a('0x13'));_0x398ab0(_0x20e994[_0x351a('0x18')][_0x351a('0x17')]);}})[_0x351a('0x19')](function(_0x2d228e){logger[_0x351a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x88396e,_0x2d228e);_0x81aa0b(_0x2d228e);});});}exports[_0x351a('0x1a')]=function(_0x53abc1){var _0x38cd8d=this;return new Promise(function(_0x36fd89,_0x11bf41){return db[_0x351a('0x1b')][_0x351a('0x1c')]({'raw':_0x53abc1[_0x351a('0x1d')]?_0x53abc1[_0x351a('0x1d')][_0x351a('0x1e')]===undefined?!![]:![]:!![],'where':_0x53abc1['options']?_0x53abc1['options'][_0x351a('0x1f')]||null:null,'attributes':_0x53abc1[_0x351a('0x1d')]?_0x53abc1['options'][_0x351a('0x20')]||null:null,'limit':_0x53abc1[_0x351a('0x1d')]?_0x53abc1['options'][_0x351a('0x21')]||null:null,'include':_0x53abc1[_0x351a('0x1d')]?_0x53abc1[_0x351a('0x1d')][_0x351a('0x22')]?_[_0x351a('0x23')](_0x53abc1[_0x351a('0x1d')]['include'],function(_0x2ba065){return{'model':db[_0x2ba065['model']],'as':_0x2ba065['as'],'attributes':_0x2ba065[_0x351a('0x20')],'include':_0x2ba065[_0x351a('0x22')]?_[_0x351a('0x23')](_0x2ba065['include'],function(_0x4000e1){return{'model':db[_0x4000e1['model']],'as':_0x4000e1['as'],'attributes':_0x4000e1[_0x351a('0x20')],'include':_0x4000e1[_0x351a('0x22')]?_[_0x351a('0x23')](_0x4000e1['include'],function(_0x42ccd3){return{'model':db[_0x42ccd3[_0x351a('0x24')]],'as':_0x42ccd3['as'],'attributes':_0x42ccd3[_0x351a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42e95a){logger[_0x351a('0x10')](_0x351a('0x1a'),_0x53abc1);logger[_0x351a('0x11')]('GetFaxAccount',_0x53abc1,JSON['stringify'](_0x42e95a));_0x36fd89(_0x42e95a);})[_0x351a('0x19')](function(_0x2e8c3e){logger[_0x351a('0x14')](_0x351a('0x1a'),_0x2e8c3e[_0x351a('0x17')],_0x53abc1);_0x11bf41(_0x38cd8d[_0x351a('0x14')](0x1f4,_0x2e8c3e[_0x351a('0x17')]));});});};exports[_0x351a('0x25')]=function(_0x363b8f,_0x4576f4,_0x512911){var _0x239e61=this;return new Promise(function(_0x5e54e9,_0x5e4ff2){var _0x378789={'body':_0x363b8f[_0x351a('0x26')],'channel':_0x351a('0x27')};var _0x2c448c=[];var _0x5b610a=[];var _0x305636={};return db[_0x351a('0x28')][_0x351a('0x29')]()[_0x351a('0xf')](function(_0x3a4fb7){if(!_0x3a4fb7){throw new db[(_0x351a('0x2a'))][(_0x351a('0x2b'))](_0x351a('0x2c'));}_0x2c448c=_[_0x351a('0x2d')](_[_0x351a('0x2e')](_0x3a4fb7),[_0x351a('0x2f'),_0x351a('0x30')]);_0x5b610a=_[_0x351a('0x2d')](_[_0x351a('0x2e')](_0x3a4fb7),['createdAt',_0x351a('0x30'),'CompanyId',_0x351a('0x31')]);if(_0x363b8f[_0x351a('0x26')]['id']){delete _0x363b8f[_0x351a('0x26')]['id'];}if(_['isNil'](_0x363b8f[_0x351a('0x26')][_0x351a('0x32')])){throw new db['Sequelize']['ValidationError'](_0x351a('0x33'));}if(_[_0x351a('0x34')](_0x363b8f[_0x351a('0x26')][_0x351a('0x26')])||_0x363b8f[_0x351a('0x26')][_0x351a('0x26')]===''){throw new db['Sequelize'][(_0x351a('0x2b'))](_0x351a('0x35'));}if(_[_0x351a('0x34')](_0x363b8f[_0x351a('0x26')][_0x351a('0x36')])){throw new db[(_0x351a('0x2a'))][(_0x351a('0x2b'))](_0x351a('0x37')+_0x5b610a);}if(!_[_0x351a('0x38')](_0x5b610a,_0x363b8f[_0x351a('0x26')][_0x351a('0x36')])){throw new db['Sequelize'][(_0x351a('0x2b'))](_0x351a('0x39')+_0x5b610a);}_0x305636[_0x363b8f['body'][_0x351a('0x36')]]=_0x363b8f[_0x351a('0x26')]['from'];})[_0x351a('0xf')](function(){return db['FaxAccount'][_0x351a('0x3a')]({'where':{'id':_0x363b8f[_0x351a('0x3b')]['id']},'include':[{'model':db[_0x351a('0x3c')],'as':_0x351a('0x3d'),'include':[{'model':db[_0x351a('0x28')],'as':_0x351a('0x3e'),'where':_0x305636,'limit':0x1,'order':[[_0x351a('0x30'),_0x351a('0x3f')]]}]},{'model':db['FaxApplication'],'as':_0x351a('0x40')}]});})[_0x351a('0xf')](function(_0x3d90e0){if(_0x3d90e0&&_0x3d90e0['List']){var _0x5e0a93=_0x3d90e0['get']({'plain':!![]});_0x378789['account']=_0x5e0a93;_0x378789[_0x351a('0x41')]=_0x5e0a93['Applications'];_0x378789[_0x351a('0x42')]=_0x5e0a93[_0x351a('0x3d')];_0x378789[_0x351a('0x41')]=_[_0x351a('0x43')](_0x378789[_0x351a('0x41')],[_0x351a('0x44')],[_0x351a('0x45')]);if(_0x378789[_0x351a('0x3b')][_0x351a('0x40')]){delete _0x378789[_0x351a('0x3b')][_0x351a('0x40')];}if(_0x378789[_0x351a('0x3b')]['List']&&_0x378789[_0x351a('0x3b')][_0x351a('0x3d')][_0x351a('0x3e')]['length']){return _0x378789[_0x351a('0x3b')][_0x351a('0x3d')][_0x351a('0x3e')][0x0];}var _0x3b13b4=_[_0x351a('0x46')](_0x363b8f[_0x351a('0x26')],{'firstName':_0x363b8f[_0x351a('0x26')][_0x351a('0x32')],'ListId':_0x5e0a93[_0x351a('0x31')]});_0x3b13b4[_0x363b8f[_0x351a('0x26')]['mapKey']]=_0x363b8f[_0x351a('0x26')][_0x351a('0x32')];return db[_0x351a('0x28')][_0x351a('0x47')](_0x3b13b4,{'fields':_0x2c448c,'raw':!![]});}})[_0x351a('0xf')](function(_0x2f0008){_0x378789[_0x351a('0x48')]=_0x2f0008;if(_0x2f0008){var _0x1952c3={'ContactId':_0x2f0008['id'],'FaxAccountId':_0x363b8f[_0x351a('0x3b')]['id'],'fax':_0x2f0008[_0x351a('0x27')]};return db[_0x351a('0x49')][_0x351a('0x3a')]({'where':{'ContactId':_0x2f0008['id'],'closed':![],'FaxAccountId':_0x363b8f[_0x351a('0x3b')]['id']}})[_0x351a('0xf')](function(_0x2d5df3){if(_0x2d5df3){return[_0x2d5df3,![]];}return db[_0x351a('0x49')][_0x351a('0x47')](_0x1952c3)[_0x351a('0xf')](function(_0x15413e){return[_0x15413e,!![]];});});}else{throw new Error(_0x351a('0x4a'));}})[_0x351a('0x4b')](function(_0x1f4652,_0x45c670){var _0x5e6aea=_0x1f4652[_0x351a('0x4c')]({'plain':!![]});if(_0x45c670){if(_0x378789[_0x351a('0x3b')][_0x351a('0x4d')]){_0x378789['applications']['push']({'id':0x0,'priority':_0x378789['applications'][_0x351a('0x4e')]+0x1,'app':'close','appdata':_0x351a('0x4f'),'interval':_0x351a('0x50')});}_0x5e6aea['created']=!![];}else{_0x5e6aea[_0x351a('0x51')]=![];}_0x378789['interaction']=_0x5e6aea;return db[_0x351a('0x52')][_0x351a('0x47')]({'body':_0x363b8f[_0x351a('0x26')]['body'],'FaxAccountId':_0x363b8f[_0x351a('0x3b')]['id'],'FaxInteractionId':_0x1f4652['id'],'direction':'in','ContactId':_0x1f4652[_0x351a('0x53')],'AttachmentId':_0x363b8f[_0x351a('0x26')][_0x351a('0x54')]});})[_0x351a('0xf')](function(_0x41d049){_0x378789[_0x351a('0x17')]=_0x41d049;if(!_0x378789[_0x351a('0x55')][_0x351a('0x56')])return;return db[_0x351a('0x57')][_0x351a('0x3a')]({'attributes':['id',_0x351a('0x58')],'where':{'id':_0x378789['interaction'][_0x351a('0x56')]}});})[_0x351a('0xf')](function(_0x2af48f){if(_0x2af48f){_0x378789[_0x351a('0x41')][_0x351a('0x59')]({'id':0x0,'priority':0x0,'app':_0x351a('0x5a'),'appdata':_0x2af48f['name']+','+(_0x378789[_0x351a('0x3b')][_0x351a('0x5b')]||0xa),'interval':_0x351a('0x50')});}if(!_0x378789[_0x351a('0x55')][_0x351a('0x5c')])return;return db[_0x351a('0x5d')][_0x351a('0x3a')]({'attributes':['id','name'],'where':{'id':_0x378789['interaction']['queueId']}});})[_0x351a('0xf')](function(_0x5e5155){if(_0x5e5155){_0x378789[_0x351a('0x41')][_0x351a('0x59')]({'id':0x0,'priority':0x1,'app':_0x351a('0x5e'),'appdata':_0x5e5155[_0x351a('0x58')]+','+(_0x378789[_0x351a('0x3b')][_0x351a('0x5f')]||0x12c),'interval':_0x351a('0x50')});}return respondWithRpcPromise(_0x351a('0x60'),_0x351a('0x61'),_0x378789);})['then'](function(_0x3a2102){_0x5e54e9(_0x3a2102);})['catch'](function(_0x524d24){_0x5e4ff2(_0x239e61['error'](0x1f4,_0x524d24[_0x351a('0x17')]));});});}; \ No newline at end of file +var _0xf289=['name','waitForTheAssignedAgent','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','FaxApplication','get','applications','Applications','priority','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','find','unshift'];(function(_0x4b3f3e,_0x47dfcc){var _0x921fc3=function(_0x3e4b3b){while(--_0x3e4b3b){_0x4b3f3e['push'](_0x4b3f3e['shift']());}};_0x921fc3(++_0x47dfcc);}(_0xf289,0x1c4));var _0x9f28=function(_0x18c472,_0x12335f){_0x18c472=_0x18c472-0x0;var _0x178de4=_0xf289[_0x18c472];return _0x178de4;};'use strict';var _=require('lodash');var util=require(_0x9f28('0x0'));var moment=require('moment');var BPromise=require(_0x9f28('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f28('0x2'))['db'];var utils=require(_0x9f28('0x3'));var logger=require(_0x9f28('0x4'))(_0x9f28('0x5'));var config=require(_0x9f28('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9f28('0x7')][_0x9f28('0x8')]({'port':0x232c});config[_0x9f28('0x9')]=_['defaults'](config[_0x9f28('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f28('0xa'))(new Redis(config['redis']));require(_0x9f28('0xb'))[_0x9f28('0xc')](socket);function respondWithRpcPromise(_0x54177b,_0x6e107d,_0x3d2249){return new BPromise(function(_0x45dae8,_0x1d2d7b){return client[_0x9f28('0xd')](_0x54177b,_0x3d2249)[_0x9f28('0xe')](function(_0x232c15){logger[_0x9f28('0xf')](_0x9f28('0x10'),_0x6e107d,_0x9f28('0x11'));logger[_0x9f28('0x12')](_0x9f28('0x13'),_0x6e107d,_0x9f28('0x11'),JSON['stringify'](_0x232c15));if(_0x232c15[_0x9f28('0x14')]){if(_0x232c15[_0x9f28('0x14')][_0x9f28('0x15')]===0x1f4){logger[_0x9f28('0x14')](_0x9f28('0x10'),_0x6e107d,_0x232c15[_0x9f28('0x14')][_0x9f28('0x16')]);return _0x1d2d7b(_0x232c15['error'][_0x9f28('0x16')]);}logger[_0x9f28('0x14')](_0x9f28('0x10'),_0x6e107d,_0x232c15[_0x9f28('0x14')][_0x9f28('0x16')]);return _0x45dae8(_0x232c15[_0x9f28('0x14')][_0x9f28('0x16')]);}else{logger[_0x9f28('0xf')](_0x9f28('0x10'),_0x6e107d,_0x9f28('0x11'));_0x45dae8(_0x232c15[_0x9f28('0x17')][_0x9f28('0x16')]);}})[_0x9f28('0x18')](function(_0x47b7d7){logger[_0x9f28('0x14')]('FaxAccount,\x20%s,\x20%s',_0x6e107d,_0x47b7d7);_0x1d2d7b(_0x47b7d7);});});}exports['GetFaxAccount']=function(_0x538132){var _0x32637f=this;return new Promise(function(_0x574032,_0x5783bc){return db[_0x9f28('0x19')][_0x9f28('0x1a')]({'raw':_0x538132[_0x9f28('0x1b')]?_0x538132['options'][_0x9f28('0x1c')]===undefined?!![]:![]:!![],'where':_0x538132['options']?_0x538132['options'][_0x9f28('0x1d')]||null:null,'attributes':_0x538132[_0x9f28('0x1b')]?_0x538132[_0x9f28('0x1b')][_0x9f28('0x1e')]||null:null,'limit':_0x538132[_0x9f28('0x1b')]?_0x538132['options'][_0x9f28('0x1f')]||null:null,'include':_0x538132['options']?_0x538132[_0x9f28('0x1b')][_0x9f28('0x20')]?_['map'](_0x538132[_0x9f28('0x1b')][_0x9f28('0x20')],function(_0x470c08){return{'model':db[_0x470c08[_0x9f28('0x21')]],'as':_0x470c08['as'],'attributes':_0x470c08[_0x9f28('0x1e')],'include':_0x470c08['include']?_['map'](_0x470c08[_0x9f28('0x20')],function(_0x4b962c){return{'model':db[_0x4b962c[_0x9f28('0x21')]],'as':_0x4b962c['as'],'attributes':_0x4b962c[_0x9f28('0x1e')],'include':_0x4b962c[_0x9f28('0x20')]?_['map'](_0x4b962c['include'],function(_0x2354d2){return{'model':db[_0x2354d2[_0x9f28('0x21')]],'as':_0x2354d2['as'],'attributes':_0x2354d2[_0x9f28('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9f28('0xe')](function(_0x132b18){logger[_0x9f28('0xf')](_0x9f28('0x22'),_0x538132);logger[_0x9f28('0x12')]('GetFaxAccount',_0x538132,JSON['stringify'](_0x132b18));_0x574032(_0x132b18);})[_0x9f28('0x18')](function(_0x371c65){logger[_0x9f28('0x14')](_0x9f28('0x22'),_0x371c65[_0x9f28('0x16')],_0x538132);_0x5783bc(_0x32637f[_0x9f28('0x14')](0x1f4,_0x371c65[_0x9f28('0x16')]));});});};exports[_0x9f28('0x23')]=function(_0x412171,_0x19adc3,_0x297e19){var _0x191d29=this;return new Promise(function(_0x3e71f7,_0x435128){var _0x7f66df={'body':_0x412171[_0x9f28('0x24')],'channel':_0x9f28('0x25')};var _0x143785=[];var _0xa46551=[];var _0x23060f={};return db[_0x9f28('0x26')]['describe']()[_0x9f28('0xe')](function(_0x29aa72){if(!_0x29aa72){throw new db[(_0x9f28('0x27'))][(_0x9f28('0x28'))](_0x9f28('0x29'));}_0x143785=_[_0x9f28('0x2a')](_[_0x9f28('0x2b')](_0x29aa72),['createdAt','updatedAt']);_0xa46551=_[_0x9f28('0x2a')](_[_0x9f28('0x2b')](_0x29aa72),['createdAt',_0x9f28('0x2c'),_0x9f28('0x2d'),_0x9f28('0x2e')]);if(_0x412171[_0x9f28('0x24')]['id']){delete _0x412171['body']['id'];}if(_[_0x9f28('0x2f')](_0x412171['body'][_0x9f28('0x30')])){throw new db[(_0x9f28('0x27'))][(_0x9f28('0x28'))](_0x9f28('0x31'));}if(_[_0x9f28('0x2f')](_0x412171[_0x9f28('0x24')]['body'])||_0x412171['body'][_0x9f28('0x24')]===''){throw new db[(_0x9f28('0x27'))][(_0x9f28('0x28'))](_0x9f28('0x32'));}if(_['isNil'](_0x412171['body'][_0x9f28('0x33')])){throw new db[(_0x9f28('0x27'))][(_0x9f28('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xa46551);}if(!_[_0x9f28('0x34')](_0xa46551,_0x412171[_0x9f28('0x24')][_0x9f28('0x33')])){throw new db[(_0x9f28('0x27'))][(_0x9f28('0x28'))](_0x9f28('0x35')+_0xa46551);}_0x23060f[_0x412171[_0x9f28('0x24')][_0x9f28('0x33')]]=_0x412171[_0x9f28('0x24')][_0x9f28('0x30')];})['then'](function(){return db[_0x9f28('0x19')]['find']({'where':{'id':_0x412171[_0x9f28('0x36')]['id']},'include':[{'model':db[_0x9f28('0x37')],'as':_0x9f28('0x38'),'include':[{'model':db['CmContact'],'as':_0x9f28('0x39'),'where':_0x23060f,'limit':0x1,'order':[[_0x9f28('0x2c'),_0x9f28('0x3a')]]}]},{'model':db[_0x9f28('0x3b')],'as':'Applications'}]});})['then'](function(_0x2a28f4){if(_0x2a28f4&&_0x2a28f4['List']){var _0x240020=_0x2a28f4[_0x9f28('0x3c')]({'plain':!![]});_0x7f66df[_0x9f28('0x36')]=_0x240020;_0x7f66df[_0x9f28('0x3d')]=_0x240020[_0x9f28('0x3e')];_0x7f66df['list']=_0x240020['List'];_0x7f66df[_0x9f28('0x3d')]=_['orderBy'](_0x7f66df[_0x9f28('0x3d')],[_0x9f28('0x3f')],['asc']);if(_0x7f66df[_0x9f28('0x36')][_0x9f28('0x3e')]){delete _0x7f66df[_0x9f28('0x36')]['Applications'];}if(_0x7f66df[_0x9f28('0x36')][_0x9f28('0x38')]&&_0x7f66df[_0x9f28('0x36')][_0x9f28('0x38')][_0x9f28('0x39')][_0x9f28('0x40')]){return _0x7f66df[_0x9f28('0x36')][_0x9f28('0x38')]['Contacts'][0x0];}var _0x4177ba=_['defaults'](_0x412171['body'],{'firstName':_0x412171[_0x9f28('0x24')]['from'],'ListId':_0x240020[_0x9f28('0x2e')]});_0x4177ba[_0x412171[_0x9f28('0x24')][_0x9f28('0x33')]]=_0x412171[_0x9f28('0x24')][_0x9f28('0x30')];return db[_0x9f28('0x26')][_0x9f28('0x41')](_0x4177ba,{'fields':_0x143785,'raw':!![]});}})[_0x9f28('0xe')](function(_0x32ae5f){_0x7f66df[_0x9f28('0x42')]=_0x32ae5f;if(_0x32ae5f){var _0x399448={'ContactId':_0x32ae5f['id'],'FaxAccountId':_0x412171[_0x9f28('0x36')]['id'],'fax':_0x32ae5f[_0x9f28('0x25')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x32ae5f['id'],'closed':![],'FaxAccountId':_0x412171[_0x9f28('0x36')]['id']}})[_0x9f28('0xe')](function(_0x3619db){if(_0x3619db){return[_0x3619db,![]];}return db[_0x9f28('0x43')][_0x9f28('0x41')](_0x399448)['then'](function(_0x2aa69e){return[_0x2aa69e,!![]];});});}else{throw new Error(_0x9f28('0x44'));}})['spread'](function(_0x1d6fe3,_0x356e49){var _0x396a9c=_0x1d6fe3[_0x9f28('0x3c')]({'plain':!![]});if(_0x356e49){if(_0x7f66df[_0x9f28('0x36')][_0x9f28('0x45')]){_0x7f66df[_0x9f28('0x3d')]['push']({'id':0x0,'priority':_0x7f66df[_0x9f28('0x3d')]['length']+0x1,'app':_0x9f28('0x46'),'appdata':_0x9f28('0x47'),'interval':_0x9f28('0x48')});}_0x396a9c[_0x9f28('0x49')]=!![];}else{_0x396a9c[_0x9f28('0x49')]=![];}_0x7f66df[_0x9f28('0x4a')]=_0x396a9c;return db[_0x9f28('0x4b')][_0x9f28('0x41')]({'body':_0x412171[_0x9f28('0x24')][_0x9f28('0x24')],'FaxAccountId':_0x412171[_0x9f28('0x36')]['id'],'FaxInteractionId':_0x1d6fe3['id'],'direction':'in','ContactId':_0x1d6fe3[_0x9f28('0x4c')],'AttachmentId':_0x412171[_0x9f28('0x24')][_0x9f28('0x4d')]});})[_0x9f28('0xe')](function(_0x514450){_0x7f66df[_0x9f28('0x16')]=_0x514450;if(!_0x7f66df[_0x9f28('0x4a')][_0x9f28('0x4e')])return;return db[_0x9f28('0x4f')][_0x9f28('0x50')]({'attributes':['id','name'],'where':{'id':_0x7f66df[_0x9f28('0x4a')][_0x9f28('0x4e')]}});})['then'](function(_0x548ea8){if(_0x548ea8){_0x7f66df[_0x9f28('0x3d')][_0x9f28('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x548ea8[_0x9f28('0x52')]+','+(_0x7f66df['account'][_0x9f28('0x53')]||0xa),'interval':_0x9f28('0x48')});}if(!_0x7f66df[_0x9f28('0x4a')]['queueId'])return;return db[_0x9f28('0x54')][_0x9f28('0x50')]({'attributes':['id',_0x9f28('0x52')],'where':{'id':_0x7f66df[_0x9f28('0x4a')]['queueId']}});})[_0x9f28('0xe')](function(_0x36ec0f){if(_0x36ec0f){_0x7f66df[_0x9f28('0x3d')]['unshift']({'id':0x0,'priority':0x1,'app':_0x9f28('0x55'),'appdata':_0x36ec0f[_0x9f28('0x52')]+','+(_0x7f66df[_0x9f28('0x36')][_0x9f28('0x56')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9f28('0x57'),_0x9f28('0x58'),_0x7f66df);})[_0x9f28('0xe')](function(_0x399e83){_0x3e71f7(_0x399e83);})[_0x9f28('0x18')](function(_0x312b88){_0x435128(_0x191d29[_0x9f28('0x14')](0x1f4,_0x312b88[_0x9f28('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6826af6..ee4d32d 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 _0x7126=['update','removeListener','length','faxAccount:','save','remove'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x7126,0x18a));var _0x6712=function(_0x24a3dd,_0x467fa3){_0x24a3dd=_0x24a3dd-0x0;var _0x2467ee=_0x7126[_0x24a3dd];return _0x2467ee;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x6712('0x0'),_0x6712('0x1'),_0x6712('0x2')];function createListener(_0x500ee3,_0x14945e){return function(_0x44562d){_0x14945e['emit'](_0x500ee3,_0x44562d);};}function removeListener(_0x1011bb,_0x185cef){return function(){FaxAccountEvents[_0x6712('0x3')](_0x1011bb,_0x185cef);};}exports['register']=function(_0x4c012d){for(var _0x25921d=0x0,_0xa1587e=events[_0x6712('0x4')];_0x25921d<_0xa1587e;_0x25921d++){var _0x41917e=events[_0x25921d];var _0x455eab=createListener(_0x6712('0x5')+_0x41917e,_0x4c012d);FaxAccountEvents['on'](_0x41917e,_0x455eab);}}; \ No newline at end of file +var _0x2230=['./faxAccount.events','save','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x2230,0x1e8));var _0x0223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2230[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0x0223('0x0'));var events=[_0x0223('0x1'),_0x0223('0x2'),_0x0223('0x3')];function createListener(_0x220a23,_0x359617){return function(_0x5929e2){_0x359617[_0x0223('0x4')](_0x220a23,_0x5929e2);};}function removeListener(_0x51b881,_0xaaa26c){return function(){FaxAccountEvents[_0x0223('0x5')](_0x51b881,_0xaaa26c);};}exports[_0x0223('0x6')]=function(_0x1a575c){for(var _0x269a9a=0x0,_0x5f9ccc=events['length'];_0x269a9a<_0x5f9ccc;_0x269a9a++){var _0x2d0b03=events[_0x269a9a];var _0x165ae1=createListener(_0x0223('0x7')+_0x2d0b03,_0x1a575c);FaxAccountEvents['on'](_0x2d0b03,_0x165ae1);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2319c8c..e065fae 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 _0x2a9e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create','/:id/dispositions','addDisposition','addAnswer','post','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','update','removeDispositions','removeAnswers','delete','removeAgents','exports','multer','path','connect-timeout'];(function(_0x1d5663,_0x2f6a69){var _0x344a4d=function(_0x3f3e93){while(--_0x3f3e93){_0x1d5663['push'](_0x1d5663['shift']());}};_0x344a4d(++_0x2f6a69);}(_0x2a9e,0x16e));var _0xe2a9=function(_0x44c01f,_0xf8d144){_0x44c01f=_0x44c01f-0x0;var _0x5a0c7c=_0x2a9e[_0x44c01f];return _0x5a0c7c;};'use strict';var multer=require(_0xe2a9('0x0'));var util=require('util');var path=require(_0xe2a9('0x1'));var timeout=require(_0xe2a9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe2a9('0x3'));var auth=require(_0xe2a9('0x4'));var interaction=require(_0xe2a9('0x5'));var config=require(_0xe2a9('0x6'));var controller=require(_0xe2a9('0x7'));router[_0xe2a9('0x8')]('/',auth['isAuthenticated'](),controller[_0xe2a9('0x9')]);router[_0xe2a9('0x8')](_0xe2a9('0xa'),auth[_0xe2a9('0xb')](),controller['describe']);router[_0xe2a9('0x8')](_0xe2a9('0xc'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0xd')]);router[_0xe2a9('0x8')]('/:id/dispositions',auth[_0xe2a9('0xb')](),controller['getDispositions']);router['get'](_0xe2a9('0xe'),auth[_0xe2a9('0xb')](),controller['getAnswers']);router['get'](_0xe2a9('0xf'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x10')]);router[_0xe2a9('0x8')](_0xe2a9('0x11'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x12')]);router[_0xe2a9('0x8')](_0xe2a9('0x13'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x14')]);router[_0xe2a9('0x8')](_0xe2a9('0x15'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x16')]);router['post']('/',auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x17')]);router['post'](_0xe2a9('0x18'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x19')]);router['post'](_0xe2a9('0xe'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x1a')]);router[_0xe2a9('0x1b')](_0xe2a9('0xf'),auth[_0xe2a9('0xb')](),controller['addInteraction']);router[_0xe2a9('0x1b')](_0xe2a9('0x11'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x1c')]);router[_0xe2a9('0x1b')](_0xe2a9('0x1d'),auth[_0xe2a9('0xb')](),controller['addAccountApplications']);router[_0xe2a9('0x1b')](_0xe2a9('0x1e'),auth['isAuthenticated'](),controller[_0xe2a9('0x1f')]);router[_0xe2a9('0x1b')](_0xe2a9('0x20'),auth[_0xe2a9('0xb')](),controller['send']);router[_0xe2a9('0x1b')]('/:id/users',auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x21')]);router[_0xe2a9('0x22')](_0xe2a9('0xc'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x23')]);router['delete'](_0xe2a9('0xc'),auth[_0xe2a9('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe2a9('0x24')]);router['delete'](_0xe2a9('0xe'),auth['isAuthenticated'](),controller[_0xe2a9('0x25')]);router[_0xe2a9('0x26')](_0xe2a9('0x15'),auth[_0xe2a9('0xb')](),controller[_0xe2a9('0x27')]);module[_0xe2a9('0x28')]=router; \ No newline at end of file +var _0x1c6e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','/:id/dispositions','/:id/canned_answers','addAnswer','addInteraction','/addaccountapplications','updateAccountApplications','/:id/send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x57436d,_0x352644){var _0x25a27c=function(_0x3e5c57){while(--_0x3e5c57){_0x57436d['push'](_0x57436d['shift']());}};_0x25a27c(++_0x352644);}(_0x1c6e,0x79));var _0xe1c6=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x1c6e[_0x4c7b20];return _0x4872bd;};'use strict';var multer=require(_0xe1c6('0x0'));var util=require(_0xe1c6('0x1'));var path=require(_0xe1c6('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1c6('0x3'));var router=express[_0xe1c6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe1c6('0x5'));var interaction=require(_0xe1c6('0x6'));var config=require(_0xe1c6('0x7'));var controller=require('./faxAccount.controller');router[_0xe1c6('0x8')]('/',auth[_0xe1c6('0x9')](),controller[_0xe1c6('0xa')]);router[_0xe1c6('0x8')](_0xe1c6('0xb'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0xc')]);router[_0xe1c6('0x8')](_0xe1c6('0xd'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0xe')]);router[_0xe1c6('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe1c6('0xf')]);router[_0xe1c6('0x8')]('/:id/canned_answers',auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x10')]);router[_0xe1c6('0x8')](_0xe1c6('0x11'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x12')]);router[_0xe1c6('0x8')](_0xe1c6('0x13'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x14')]);router[_0xe1c6('0x8')](_0xe1c6('0x15'),auth['isAuthenticated'](),controller[_0xe1c6('0x16')]);router[_0xe1c6('0x8')](_0xe1c6('0x17'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe1c6('0x18')]('/',auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x19')]);router['post'](_0xe1c6('0x1a'),auth[_0xe1c6('0x9')](),controller['addDisposition']);router['post'](_0xe1c6('0x1b'),auth['isAuthenticated'](),controller[_0xe1c6('0x1c')]);router[_0xe1c6('0x18')](_0xe1c6('0x11'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x1d')]);router[_0xe1c6('0x18')]('/:id/applications',auth[_0xe1c6('0x9')](),controller['addApplications']);router[_0xe1c6('0x18')](_0xe1c6('0x1e'),auth[_0xe1c6('0x9')](),controller['addAccountApplications']);router[_0xe1c6('0x18')]('/updateaccountapplications',auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x1f')]);router[_0xe1c6('0x18')](_0xe1c6('0x20'),auth['isAuthenticated'](),controller['send']);router['post'](_0xe1c6('0x17'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x21')]);router['put']('/:id',auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x22')]);router[_0xe1c6('0x23')](_0xe1c6('0xd'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x24')]);router[_0xe1c6('0x23')](_0xe1c6('0x1a'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x25')]);router[_0xe1c6('0x23')]('/:id/canned_answers',auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x26')]);router[_0xe1c6('0x23')](_0xe1c6('0x17'),auth[_0xe1c6('0x9')](),controller[_0xe1c6('0x27')]);module[_0xe1c6('0x28')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a64d8e2..a516f87 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 _0xa135=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x387603,_0x5a2d1){var _0x55ea9e=function(_0x46c5be){while(--_0x46c5be){_0x387603['push'](_0x387603['shift']());}};_0x55ea9e(++_0x5a2d1);}(_0xa135,0x1e8));var _0x5a13=function(_0xdbe65d,_0x39a0f9){_0xdbe65d=_0xdbe65d-0x0;var _0x463ed=_0xa135[_0xdbe65d];return _0x463ed;};'use strict';var Sequelize=require(_0x5a13('0x0'));module[_0x5a13('0x1')]={'priority':{'type':Sequelize[_0x5a13('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5a13('0x3')],'allowNull':![],'defaultValue':_0x5a13('0x4')},'appdata':{'type':Sequelize[_0x5a13('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5a13('0x6')}}; \ No newline at end of file +var _0x1472=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x1472,0xe9));var _0x2147=function(_0x227cfb,_0x4f42cf){_0x227cfb=_0x227cfb-0x0;var _0x131407=_0x1472[_0x227cfb];return _0x131407;};'use strict';var Sequelize=require(_0x2147('0x0'));module[_0x2147('0x1')]={'priority':{'type':Sequelize[_0x2147('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2147('0x3')],'allowNull':![],'defaultValue':_0x2147('0x4')},'appdata':{'type':Sequelize[_0x2147('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2147('0x3')],'defaultValue':_0x2147('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4fb66d0..030064e 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 _0xfda0=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','rimraf','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x465e89,_0x2cc5a3){var _0x3234a0=function(_0x47824a){while(--_0x47824a){_0x465e89['push'](_0x465e89['shift']());}};_0x3234a0(++_0x2cc5a3);}(_0xfda0,0xce));var _0x0fda=function(_0x4eb3b1,_0x3aec62){_0x4eb3b1=_0x4eb3b1-0x0;var _0x51c22c=_0xfda0[_0x4eb3b1];return _0x51c22c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fda('0x0'));var zipdir=require(_0x0fda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fda('0x2'));var moment=require('moment');var BPromise=require(_0x0fda('0x3'));var Mustache=require(_0x0fda('0x4'));var util=require(_0x0fda('0x5'));var path=require(_0x0fda('0x6'));var sox=require(_0x0fda('0x7'));var csv=require('to-csv');var ejs=require(_0x0fda('0x8'));var fs=require('fs');var fs_extra=require(_0x0fda('0x9'));var _=require(_0x0fda('0xa'));var squel=require(_0x0fda('0xb'));var crypto=require(_0x0fda('0xc'));var jsforce=require(_0x0fda('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0fda('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0fda('0xf'));var qs=require(_0x0fda('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fda('0x11'))(_0x0fda('0x12'));var utils=require(_0x0fda('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fda('0x14'))['db'];function respondWithStatusCode(_0x3f7f29,_0x37a9f9){_0x37a9f9=_0x37a9f9||0xcc;return function(_0x1c678d){if(_0x1c678d){return _0x3f7f29[_0x0fda('0x15')](_0x37a9f9);}return _0x3f7f29[_0x0fda('0x16')](_0x37a9f9)[_0x0fda('0x17')]();};}function respondWithResult(_0xfa8e9c,_0x347363){_0x347363=_0x347363||0xc8;return function(_0xa6526e){if(_0xa6526e){return _0xfa8e9c[_0x0fda('0x16')](_0x347363)[_0x0fda('0x18')](_0xa6526e);}};}function respondWithFilteredResult(_0x50ad6b,_0x3f1c6d){return function(_0x19dcd0){if(_0x19dcd0){var _0x105f2f=typeof _0x3f1c6d['offset']===_0x0fda('0x19')&&typeof _0x3f1c6d['limit']==='undefined';var _0x19f6d7=_0x19dcd0[_0x0fda('0x1a')];var _0x47b025=_0x105f2f?0x0:_0x3f1c6d[_0x0fda('0x1b')];var _0x40d4d2=_0x105f2f?_0x19dcd0[_0x0fda('0x1a')]:_0x3f1c6d[_0x0fda('0x1b')]+_0x3f1c6d['limit'];var _0x43cf1f;if(_0x40d4d2>=_0x19f6d7){_0x40d4d2=_0x19f6d7;_0x43cf1f=0xc8;}else{_0x43cf1f=0xce;}_0x50ad6b[_0x0fda('0x16')](_0x43cf1f);return _0x50ad6b[_0x0fda('0x1c')](_0x0fda('0x1d'),_0x47b025+'-'+_0x40d4d2+'/'+_0x19f6d7)[_0x0fda('0x18')](_0x19dcd0);}return null;};}function patchUpdates(_0x29098f){return function(_0x803539){try{jsonpatch['apply'](_0x803539,_0x29098f,!![]);}catch(_0x66c421){return BPromise[_0x0fda('0x1e')](_0x66c421);}return _0x803539[_0x0fda('0x1f')]();};}function saveUpdates(_0x29c44b,_0x5b0d6f){return function(_0x5d6c4c){if(_0x5d6c4c){return _0x5d6c4c['update'](_0x29c44b)[_0x0fda('0x20')](function(_0x2afa2c){return _0x2afa2c;});}return null;};}function removeEntity(_0x292002,_0xb475a){return function(_0x5a2f22){if(_0x5a2f22){return _0x5a2f22[_0x0fda('0x21')]()['then'](function(){_0x292002[_0x0fda('0x16')](0xcc)[_0x0fda('0x17')]();});}};}function handleEntityNotFound(_0x4f374a,_0x48552e){return function(_0x183a7){if(!_0x183a7){_0x4f374a['sendStatus'](0x194);}return _0x183a7;};}function handleError(_0x35987d,_0x546e93){_0x546e93=_0x546e93||0x1f4;return function(_0x50f419){logger[_0x0fda('0x22')](_0x50f419[_0x0fda('0x23')]);if(_0x50f419['name']){delete _0x50f419[_0x0fda('0x24')];}_0x35987d[_0x0fda('0x16')](_0x546e93)[_0x0fda('0x25')](_0x50f419);};}exports[_0x0fda('0x26')]=function(_0x155024,_0x35d82e){var _0x4bf153={},_0x537992={},_0x37e5dc={'count':0x0,'rows':[]};var _0x1bac52=_[_0x0fda('0x27')](db[_0x0fda('0x28')][_0x0fda('0x29')],function(_0x40a3ee){return{'name':_0x40a3ee['fieldName'],'type':_0x40a3ee[_0x0fda('0x2a')][_0x0fda('0x2b')]};});_0x537992[_0x0fda('0x2c')]=_[_0x0fda('0x27')](_0x1bac52,_0x0fda('0x24'));_0x537992[_0x0fda('0x2d')]=_[_0x0fda('0x2e')](_0x155024[_0x0fda('0x2d')]);_0x537992[_0x0fda('0x2f')]=_['intersection'](_0x537992[_0x0fda('0x2c')],_0x537992[_0x0fda('0x2d')]);_0x4bf153[_0x0fda('0x30')]=_[_0x0fda('0x31')](_0x537992[_0x0fda('0x2c')],qs[_0x0fda('0x32')](_0x155024[_0x0fda('0x2d')][_0x0fda('0x32')]));_0x4bf153[_0x0fda('0x30')]=_0x4bf153[_0x0fda('0x30')]['length']?_0x4bf153[_0x0fda('0x30')]:_0x537992[_0x0fda('0x2c')];if(!_0x155024[_0x0fda('0x2d')][_0x0fda('0x33')](_0x0fda('0x34'))){_0x4bf153[_0x0fda('0x35')]=qs[_0x0fda('0x35')](_0x155024[_0x0fda('0x2d')]['limit']);_0x4bf153[_0x0fda('0x1b')]=qs['offset'](_0x155024[_0x0fda('0x2d')][_0x0fda('0x1b')]);}_0x4bf153['order']=qs['sort'](_0x155024['query'][_0x0fda('0x36')]);_0x4bf153['where']=qs[_0x0fda('0x2f')](_[_0x0fda('0x37')](_0x155024[_0x0fda('0x2d')],_0x537992['filters']),_0x1bac52);if(_0x155024[_0x0fda('0x2d')][_0x0fda('0x38')]){_0x4bf153[_0x0fda('0x39')]=_[_0x0fda('0x3a')](_0x4bf153[_0x0fda('0x39')],{'$or':_[_0x0fda('0x27')](_0x1bac52,function(_0xb7eed9){if(_0xb7eed9[_0x0fda('0x2a')]!==_0x0fda('0x3b')){var _0x4dc06d={};_0x4dc06d[_0xb7eed9[_0x0fda('0x24')]]={'$like':'%'+_0x155024[_0x0fda('0x2d')][_0x0fda('0x38')]+'%'};return _0x4dc06d;}})});}_0x4bf153=_[_0x0fda('0x3a')]({},_0x4bf153,_0x155024[_0x0fda('0x3c')]);var _0x2e8132={'where':_0x4bf153['where']};return db[_0x0fda('0x28')][_0x0fda('0x1a')](_0x2e8132)[_0x0fda('0x20')](function(_0xc5b532){_0x37e5dc['count']=_0xc5b532;if(_0x155024['query'][_0x0fda('0x3d')]){_0x4bf153[_0x0fda('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x4bf153);})[_0x0fda('0x20')](function(_0x1d2765){_0x37e5dc[_0x0fda('0x3f')]=_0x1d2765;return _0x37e5dc;})[_0x0fda('0x20')](respondWithFilteredResult(_0x35d82e,_0x4bf153))[_0x0fda('0x40')](handleError(_0x35d82e,null));};exports[_0x0fda('0x41')]=function(_0x571f58,_0x4e4db7){var _0x44b909={'raw':!![],'where':{'id':_0x571f58[_0x0fda('0x42')]['id']}},_0x3fe0e4={};_0x3fe0e4[_0x0fda('0x2c')]=_[_0x0fda('0x2e')](db[_0x0fda('0x28')][_0x0fda('0x29')]);_0x3fe0e4[_0x0fda('0x2d')]=_[_0x0fda('0x2e')](_0x571f58[_0x0fda('0x2d')]);_0x3fe0e4['filters']=_[_0x0fda('0x31')](_0x3fe0e4['model'],_0x3fe0e4[_0x0fda('0x2d')]);_0x44b909['attributes']=_[_0x0fda('0x31')](_0x3fe0e4[_0x0fda('0x2c')],qs[_0x0fda('0x32')](_0x571f58['query'][_0x0fda('0x32')]));_0x44b909[_0x0fda('0x30')]=_0x44b909[_0x0fda('0x30')]['length']?_0x44b909['attributes']:_0x3fe0e4[_0x0fda('0x2c')];if(_0x571f58[_0x0fda('0x2d')][_0x0fda('0x3d')]){_0x44b909[_0x0fda('0x3e')]=[{'all':!![]}];}_0x44b909=_[_0x0fda('0x3a')]({},_0x44b909,_0x571f58[_0x0fda('0x3c')]);return db[_0x0fda('0x28')][_0x0fda('0x43')](_0x44b909)['then'](handleEntityNotFound(_0x4e4db7,null))[_0x0fda('0x20')](respondWithResult(_0x4e4db7,null))[_0x0fda('0x40')](handleError(_0x4e4db7,null));};exports[_0x0fda('0x44')]=function(_0x21f028,_0x124176){return db['FaxApplication'][_0x0fda('0x44')](_0x21f028[_0x0fda('0x45')],{})[_0x0fda('0x20')](respondWithResult(_0x124176,0xc9))[_0x0fda('0x40')](handleError(_0x124176,null));};exports[_0x0fda('0x46')]=function(_0x217727,_0xb37f47){if(_0x217727['body']['id']){delete _0x217727[_0x0fda('0x45')]['id'];}return db[_0x0fda('0x28')][_0x0fda('0x43')]({'where':{'id':_0x217727['params']['id']}})[_0x0fda('0x20')](handleEntityNotFound(_0xb37f47,null))[_0x0fda('0x20')](saveUpdates(_0x217727['body'],null))[_0x0fda('0x20')](respondWithResult(_0xb37f47,null))['catch'](handleError(_0xb37f47,null));};exports['destroy']=function(_0x1bfc86,_0x267e6a){return db[_0x0fda('0x28')][_0x0fda('0x43')]({'where':{'id':_0x1bfc86[_0x0fda('0x42')]['id']}})[_0x0fda('0x20')](handleEntityNotFound(_0x267e6a,null))['then'](removeEntity(_0x267e6a,null))[_0x0fda('0x40')](handleError(_0x267e6a,null));}; \ No newline at end of file +var _0xe50a=['sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','FaxApplication','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x44c817,_0x593100){var _0x424d3c=function(_0x5ea3ad){while(--_0x5ea3ad){_0x44c817['push'](_0x44c817['shift']());}};_0x424d3c(++_0x593100);}(_0xe50a,0x117));var _0xae50=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe50a[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0xae50('0x0'));var rimraf=require(_0xae50('0x1'));var zipdir=require(_0xae50('0x2'));var jsonpatch=require(_0xae50('0x3'));var rp=require(_0xae50('0x4'));var moment=require(_0xae50('0x5'));var BPromise=require(_0xae50('0x6'));var Mustache=require(_0xae50('0x7'));var util=require(_0xae50('0x8'));var path=require(_0xae50('0x9'));var sox=require(_0xae50('0xa'));var csv=require(_0xae50('0xb'));var ejs=require(_0xae50('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae50('0xd'));var squel=require(_0xae50('0xe'));var crypto=require(_0xae50('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xae50('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae50('0x11'));var Redis=require('ioredis');var authService=require(_0xae50('0x12'));var qs=require(_0xae50('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae50('0x14'))(_0xae50('0x15'));var utils=require(_0xae50('0x16'));var config=require(_0xae50('0x17'));var licenseUtil=require(_0xae50('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbccb8e,_0x21bb16){_0x21bb16=_0x21bb16||0xcc;return function(_0x5a1fbc){if(_0x5a1fbc){return _0xbccb8e[_0xae50('0x19')](_0x21bb16);}return _0xbccb8e['status'](_0x21bb16)[_0xae50('0x1a')]();};}function respondWithResult(_0x321f14,_0x59c685){_0x59c685=_0x59c685||0xc8;return function(_0xb92e87){if(_0xb92e87){return _0x321f14[_0xae50('0x1b')](_0x59c685)[_0xae50('0x1c')](_0xb92e87);}};}function respondWithFilteredResult(_0x1a97e5,_0x270d80){return function(_0x47f244){if(_0x47f244){var _0x14f70e=typeof _0x270d80[_0xae50('0x1d')]==='undefined'&&typeof _0x270d80[_0xae50('0x1e')]===_0xae50('0x1f');var _0x8ccb26=_0x47f244[_0xae50('0x20')];var _0x314387=_0x14f70e?0x0:_0x270d80[_0xae50('0x1d')];var _0x2153d0=_0x14f70e?_0x47f244[_0xae50('0x20')]:_0x270d80['offset']+_0x270d80[_0xae50('0x1e')];var _0x2f59da;if(_0x2153d0>=_0x8ccb26){_0x2153d0=_0x8ccb26;_0x2f59da=0xc8;}else{_0x2f59da=0xce;}_0x1a97e5[_0xae50('0x1b')](_0x2f59da);return _0x1a97e5[_0xae50('0x21')]('Content-Range',_0x314387+'-'+_0x2153d0+'/'+_0x8ccb26)['json'](_0x47f244);}return null;};}function patchUpdates(_0x86b159){return function(_0x28964b){try{jsonpatch[_0xae50('0x22')](_0x28964b,_0x86b159,!![]);}catch(_0x5101d4){return BPromise[_0xae50('0x23')](_0x5101d4);}return _0x28964b[_0xae50('0x24')]();};}function saveUpdates(_0x5364c3,_0x52f7c5){return function(_0x4092d4){if(_0x4092d4){return _0x4092d4[_0xae50('0x25')](_0x5364c3)[_0xae50('0x26')](function(_0x9f9e1b){return _0x9f9e1b;});}return null;};}function removeEntity(_0x3f95c0,_0x1c7752){return function(_0x440d86){if(_0x440d86){return _0x440d86[_0xae50('0x27')]()[_0xae50('0x26')](function(){_0x3f95c0['status'](0xcc)[_0xae50('0x1a')]();});}};}function handleEntityNotFound(_0x3438db,_0xc3a87a){return function(_0x352289){if(!_0x352289){_0x3438db[_0xae50('0x19')](0x194);}return _0x352289;};}function handleError(_0x5f5cd1,_0x24079f){_0x24079f=_0x24079f||0x1f4;return function(_0x48a5a7){logger['error'](_0x48a5a7[_0xae50('0x28')]);if(_0x48a5a7[_0xae50('0x29')]){delete _0x48a5a7[_0xae50('0x29')];}_0x5f5cd1['status'](_0x24079f)[_0xae50('0x2a')](_0x48a5a7);};}exports[_0xae50('0x2b')]=function(_0x1d63ab,_0x1e002b){var _0x241742={},_0x401639={},_0x31fb99={'count':0x0,'rows':[]};var _0x18e522=_[_0xae50('0x2c')](db['FaxApplication'][_0xae50('0x2d')],function(_0xf60cac){return{'name':_0xf60cac[_0xae50('0x2e')],'type':_0xf60cac['type'][_0xae50('0x2f')]};});_0x401639[_0xae50('0x30')]=_[_0xae50('0x2c')](_0x18e522,_0xae50('0x29'));_0x401639[_0xae50('0x31')]=_[_0xae50('0x32')](_0x1d63ab['query']);_0x401639[_0xae50('0x33')]=_[_0xae50('0x34')](_0x401639[_0xae50('0x30')],_0x401639[_0xae50('0x31')]);_0x241742[_0xae50('0x35')]=_['intersection'](_0x401639[_0xae50('0x30')],qs[_0xae50('0x36')](_0x1d63ab[_0xae50('0x31')]['fields']));_0x241742[_0xae50('0x35')]=_0x241742[_0xae50('0x35')][_0xae50('0x37')]?_0x241742[_0xae50('0x35')]:_0x401639[_0xae50('0x30')];if(!_0x1d63ab['query'][_0xae50('0x38')](_0xae50('0x39'))){_0x241742['limit']=qs[_0xae50('0x1e')](_0x1d63ab[_0xae50('0x31')]['limit']);_0x241742[_0xae50('0x1d')]=qs['offset'](_0x1d63ab[_0xae50('0x31')][_0xae50('0x1d')]);}_0x241742[_0xae50('0x3a')]=qs[_0xae50('0x3b')](_0x1d63ab[_0xae50('0x31')][_0xae50('0x3b')]);_0x241742['where']=qs[_0xae50('0x33')](_[_0xae50('0x3c')](_0x1d63ab['query'],_0x401639['filters']),_0x18e522);if(_0x1d63ab[_0xae50('0x31')]['filter']){_0x241742[_0xae50('0x3d')]=_[_0xae50('0x3e')](_0x241742[_0xae50('0x3d')],{'$or':_[_0xae50('0x2c')](_0x18e522,function(_0x22d61e){if(_0x22d61e['type']!==_0xae50('0x3f')){var _0x82e6d7={};_0x82e6d7[_0x22d61e[_0xae50('0x29')]]={'$like':'%'+_0x1d63ab[_0xae50('0x31')][_0xae50('0x40')]+'%'};return _0x82e6d7;}})});}_0x241742=_[_0xae50('0x3e')]({},_0x241742,_0x1d63ab[_0xae50('0x41')]);var _0x4905ba={'where':_0x241742['where']};return db[_0xae50('0x42')][_0xae50('0x20')](_0x4905ba)['then'](function(_0x5f0721){_0x31fb99[_0xae50('0x20')]=_0x5f0721;if(_0x1d63ab[_0xae50('0x31')][_0xae50('0x43')]){_0x241742[_0xae50('0x44')]=[{'all':!![]}];}return db[_0xae50('0x42')]['findAll'](_0x241742);})[_0xae50('0x26')](function(_0x21f9f7){_0x31fb99[_0xae50('0x45')]=_0x21f9f7;return _0x31fb99;})[_0xae50('0x26')](respondWithFilteredResult(_0x1e002b,_0x241742))[_0xae50('0x46')](handleError(_0x1e002b,null));};exports[_0xae50('0x47')]=function(_0x53304d,_0x3b49f7){var _0x56cf74={'raw':!![],'where':{'id':_0x53304d[_0xae50('0x48')]['id']}},_0x419a69={};_0x419a69[_0xae50('0x30')]=_[_0xae50('0x32')](db[_0xae50('0x42')][_0xae50('0x2d')]);_0x419a69[_0xae50('0x31')]=_['keys'](_0x53304d[_0xae50('0x31')]);_0x419a69[_0xae50('0x33')]=_[_0xae50('0x34')](_0x419a69['model'],_0x419a69['query']);_0x56cf74[_0xae50('0x35')]=_['intersection'](_0x419a69[_0xae50('0x30')],qs[_0xae50('0x36')](_0x53304d[_0xae50('0x31')][_0xae50('0x36')]));_0x56cf74[_0xae50('0x35')]=_0x56cf74[_0xae50('0x35')][_0xae50('0x37')]?_0x56cf74[_0xae50('0x35')]:_0x419a69[_0xae50('0x30')];if(_0x53304d['query']['includeAll']){_0x56cf74[_0xae50('0x44')]=[{'all':!![]}];}_0x56cf74=_[_0xae50('0x3e')]({},_0x56cf74,_0x53304d['options']);return db[_0xae50('0x42')][_0xae50('0x49')](_0x56cf74)[_0xae50('0x26')](handleEntityNotFound(_0x3b49f7,null))['then'](respondWithResult(_0x3b49f7,null))[_0xae50('0x46')](handleError(_0x3b49f7,null));};exports[_0xae50('0x4a')]=function(_0x34e08a,_0x58ba74){return db[_0xae50('0x42')][_0xae50('0x4a')](_0x34e08a[_0xae50('0x4b')],{})[_0xae50('0x26')](respondWithResult(_0x58ba74,0xc9))[_0xae50('0x46')](handleError(_0x58ba74,null));};exports[_0xae50('0x25')]=function(_0x288e4a,_0xd8b57a){if(_0x288e4a['body']['id']){delete _0x288e4a[_0xae50('0x4b')]['id'];}return db[_0xae50('0x42')]['find']({'where':{'id':_0x288e4a['params']['id']}})[_0xae50('0x26')](handleEntityNotFound(_0xd8b57a,null))['then'](saveUpdates(_0x288e4a['body'],null))['then'](respondWithResult(_0xd8b57a,null))[_0xae50('0x46')](handleError(_0xd8b57a,null));};exports[_0xae50('0x27')]=function(_0x565939,_0x32efa7){return db['FaxApplication'][_0xae50('0x49')]({'where':{'id':_0x565939[_0xae50('0x48')]['id']}})[_0xae50('0x26')](handleEntityNotFound(_0x32efa7,null))['then'](removeEntity(_0x32efa7,null))[_0xae50('0x46')](handleError(_0x32efa7,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 0dd2f91..6db5f92 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 _0xdbb0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdbb0,0x195));var _0x0dbb=function(_0x1c725e,_0x4196b7){_0x1c725e=_0x1c725e-0x0;var _0x57c74d=_0xdbb0[_0x1c725e];return _0x57c74d;};'use strict';var _=require(_0x0dbb('0x0'));var util=require(_0x0dbb('0x1'));var logger=require(_0x0dbb('0x2'))(_0x0dbb('0x3'));var moment=require(_0x0dbb('0x4'));var BPromise=require(_0x0dbb('0x5'));var rp=require(_0x0dbb('0x6'));var fs=require('fs');var path=require(_0x0dbb('0x7'));var rimraf=require(_0x0dbb('0x8'));var config=require(_0x0dbb('0x9'));var attributes=require(_0x0dbb('0xa'));module[_0x0dbb('0xb')]=function(_0x2841d7,_0x1bf306){return _0x2841d7['define'](_0x0dbb('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0dbb('0xd'),'collate':_0x0dbb('0xe')});}; \ No newline at end of file +var _0xd0fa=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xd0fa,0xb1));var _0xad0f=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd0fa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xad0f('0x0'));var util=require(_0xad0f('0x1'));var logger=require(_0xad0f('0x2'))(_0xad0f('0x3'));var moment=require(_0xad0f('0x4'));var BPromise=require(_0xad0f('0x5'));var rp=require(_0xad0f('0x6'));var fs=require('fs');var path=require(_0xad0f('0x7'));var rimraf=require(_0xad0f('0x8'));var config=require(_0xad0f('0x9'));var attributes=require(_0xad0f('0xa'));module[_0xad0f('0xb')]=function(_0x3e0bc2,_0x506c6d){return _0x3e0bc2['define'](_0xad0f('0xc'),attributes,{'tableName':_0xad0f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad0f('0xe'),'collate':_0xad0f('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6ad7da6..144199e 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 _0xc9e1=['code','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a51db,_0x2eecdc){var _0xea0473=function(_0x54b391){while(--_0x54b391){_0x1a51db['push'](_0x1a51db['shift']());}};_0xea0473(++_0x2eecdc);}(_0xc9e1,0x1cb));var _0x1c9e=function(_0x2c4a16,_0x47f017){_0x2c4a16=_0x2c4a16-0x0;var _0x36b838=_0xc9e1[_0x2c4a16];return _0x36b838;};'use strict';var _=require(_0x1c9e('0x0'));var util=require(_0x1c9e('0x1'));var moment=require(_0x1c9e('0x2'));var BPromise=require(_0x1c9e('0x3'));var rs=require(_0x1c9e('0x4'));var fs=require('fs');var Redis=require(_0x1c9e('0x5'));var db=require(_0x1c9e('0x6'))['db'];var utils=require(_0x1c9e('0x7'));var logger=require('../../config/logger')(_0x1c9e('0x8'));var config=require(_0x1c9e('0x9'));var jayson=require(_0x1c9e('0xa'));var client=jayson[_0x1c9e('0xb')][_0x1c9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x192fa5,_0x5ed43d,_0x16db80){return new BPromise(function(_0x3430e2,_0x278783){return client[_0x1c9e('0xd')](_0x192fa5,_0x16db80)[_0x1c9e('0xe')](function(_0x1acc25){logger[_0x1c9e('0xf')](_0x1c9e('0x10'),_0x5ed43d,_0x1c9e('0x11'));logger['debug'](_0x1c9e('0x12'),_0x5ed43d,'request\x20sent',JSON[_0x1c9e('0x13')](_0x1acc25));if(_0x1acc25[_0x1c9e('0x14')]){if(_0x1acc25[_0x1c9e('0x14')][_0x1c9e('0x15')]===0x1f4){logger['error'](_0x1c9e('0x10'),_0x5ed43d,_0x1acc25['error']['message']);return _0x278783(_0x1acc25['error'][_0x1c9e('0x16')]);}logger[_0x1c9e('0x14')](_0x1c9e('0x10'),_0x5ed43d,_0x1acc25['error']['message']);return _0x3430e2(_0x1acc25['error']['message']);}else{logger[_0x1c9e('0xf')](_0x1c9e('0x10'),_0x5ed43d,_0x1c9e('0x11'));_0x3430e2(_0x1acc25[_0x1c9e('0x17')]['message']);}})[_0x1c9e('0x18')](function(_0x1443b2){logger[_0x1c9e('0x14')](_0x1c9e('0x10'),_0x5ed43d,_0x1443b2);_0x278783(_0x1443b2);});});}exports[_0x1c9e('0x19')]=function(_0x3b6f2d){var _0x363563=this;return new Promise(function(_0x4ab3a4,_0xf02070){return db[_0x1c9e('0x1a')]['update'](_0x3b6f2d[_0x1c9e('0x1b')],{'raw':_0x3b6f2d['options']?_0x3b6f2d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b6f2d[_0x1c9e('0x1c')]?_0x3b6f2d[_0x1c9e('0x1c')][_0x1c9e('0x1d')]||null:null,'attributes':_0x3b6f2d['options']?_0x3b6f2d[_0x1c9e('0x1c')]['attributes']||null:null,'limit':_0x3b6f2d[_0x1c9e('0x1c')]?_0x3b6f2d[_0x1c9e('0x1c')][_0x1c9e('0x1e')]||null:null})[_0x1c9e('0xe')](function(_0x3879d5){logger['info']('UpdateFaxApplication',_0x3b6f2d);logger[_0x1c9e('0x1f')](_0x1c9e('0x19'),_0x3b6f2d,JSON[_0x1c9e('0x13')](_0x3879d5));_0x4ab3a4(_0x3879d5);})[_0x1c9e('0x18')](function(_0x1eac5e){logger[_0x1c9e('0x14')](_0x1c9e('0x19'),_0x1eac5e['message'],_0x3b6f2d);_0xf02070(_0x363563['error'](0x1f4,_0x1eac5e[_0x1c9e('0x16')]));});});}; \ No newline at end of file +var _0x070f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','catch','lodash','util','moment','bluebird'];(function(_0x122fa0,_0x4b8d15){var _0x4859de=function(_0x3f180d){while(--_0x3f180d){_0x122fa0['push'](_0x122fa0['shift']());}};_0x4859de(++_0x4b8d15);}(_0x070f,0x9c));var _0xf070=function(_0x362723,_0x52903c){_0x362723=_0x362723-0x0;var _0x53eabc=_0x070f[_0x362723];return _0x53eabc;};'use strict';var _=require(_0xf070('0x0'));var util=require(_0xf070('0x1'));var moment=require(_0xf070('0x2'));var BPromise=require(_0xf070('0x3'));var rs=require(_0xf070('0x4'));var fs=require('fs');var Redis=require(_0xf070('0x5'));var db=require(_0xf070('0x6'))['db'];var utils=require(_0xf070('0x7'));var logger=require(_0xf070('0x8'))(_0xf070('0x9'));var config=require(_0xf070('0xa'));var jayson=require(_0xf070('0xb'));var client=jayson[_0xf070('0xc')][_0xf070('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b06ab,_0x276e23,_0x1b1093){return new BPromise(function(_0x3bb11e,_0x3100a6){return client['request'](_0x4b06ab,_0x1b1093)[_0xf070('0xe')](function(_0x347256){logger[_0xf070('0xf')](_0xf070('0x10'),_0x276e23,_0xf070('0x11'));logger[_0xf070('0x12')](_0xf070('0x13'),_0x276e23,_0xf070('0x11'),JSON['stringify'](_0x347256));if(_0x347256[_0xf070('0x14')]){if(_0x347256['error'][_0xf070('0x15')]===0x1f4){logger[_0xf070('0x14')](_0xf070('0x10'),_0x276e23,_0x347256[_0xf070('0x14')][_0xf070('0x16')]);return _0x3100a6(_0x347256['error']['message']);}logger[_0xf070('0x14')](_0xf070('0x10'),_0x276e23,_0x347256[_0xf070('0x14')][_0xf070('0x16')]);return _0x3bb11e(_0x347256[_0xf070('0x14')][_0xf070('0x16')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x276e23,'request\x20sent');_0x3bb11e(_0x347256[_0xf070('0x17')]['message']);}})['catch'](function(_0x55431b){logger['error'](_0xf070('0x10'),_0x276e23,_0x55431b);_0x3100a6(_0x55431b);});});}exports[_0xf070('0x18')]=function(_0x43f25c){var _0x519319=this;return new Promise(function(_0x551d,_0x204c5b){return db[_0xf070('0x19')][_0xf070('0x1a')](_0x43f25c[_0xf070('0x1b')],{'raw':_0x43f25c[_0xf070('0x1c')]?_0x43f25c['options'][_0xf070('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f25c[_0xf070('0x1c')]?_0x43f25c['options']['where']||null:null,'attributes':_0x43f25c[_0xf070('0x1c')]?_0x43f25c[_0xf070('0x1c')][_0xf070('0x1e')]||null:null,'limit':_0x43f25c[_0xf070('0x1c')]?_0x43f25c[_0xf070('0x1c')]['limit']||null:null})['then'](function(_0x3f9128){logger[_0xf070('0xf')](_0xf070('0x18'),_0x43f25c);logger[_0xf070('0x12')](_0xf070('0x18'),_0x43f25c,JSON['stringify'](_0x3f9128));_0x551d(_0x3f9128);})[_0xf070('0x1f')](function(_0x207c92){logger[_0xf070('0x14')]('UpdateFaxApplication',_0x207c92[_0xf070('0x16')],_0x43f25c);_0x204c5b(_0x519319[_0xf070('0x14')](0x1f4,_0x207c92[_0xf070('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 78a2ef2..acc3acd 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 _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router; \ No newline at end of file +var _0x0b0e=['./faxApplication.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x0b0e[_0x136a0d];return _0x212ea5;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 8ff8b91..1a05743 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 _0x66fa=['exports','DATE','STRING','ENUM','out','INTEGER','sequelize'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x66fa,0x117));var _0xa66f=function(_0x58d615,_0xfa01b9){_0x58d615=_0x58d615-0x0;var _0xadb66f=_0x66fa[_0x58d615];return _0xadb66f;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa66f('0x2')]},'disposition':{'type':Sequelize[_0xa66f('0x3')]},'secondDisposition':{'type':Sequelize[_0xa66f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa66f('0x3')]},'note':{'type':Sequelize[_0xa66f('0x3')]},'read1stAt':{'type':Sequelize[_0xa66f('0x2')]},'fax':{'type':Sequelize[_0xa66f('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa66f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa66f('0x4')]('in',_0xa66f('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xa66f('0x6')]}}; \ No newline at end of file +var _0xe2fe=['DATE','STRING','out','INTEGER','sequelize'];(function(_0x1c3ad0,_0x389868){var _0x185376=function(_0x3ee39e){while(--_0x3ee39e){_0x1c3ad0['push'](_0x1c3ad0['shift']());}};_0x185376(++_0x389868);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xee2f('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xee2f('0x2')]},'thirdDisposition':{'type':Sequelize[_0xee2f('0x2')]},'note':{'type':Sequelize[_0xee2f('0x2')]},'read1stAt':{'type':Sequelize[_0xee2f('0x1')]},'fax':{'type':Sequelize[_0xee2f('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xee2f('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xee2f('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xee2f('0x3')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xee2f('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 75c4f73..08684d7 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 _0xfe31=['nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','count','findAll','rows','addTags','setTags','omit','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','basename','resolve','log','err','unlinkSync','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','type','getOptions','query','user','show','params','model','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','update','destroy','describe','FaxMessage','addMessage','ids','getMessages','findOne','keys','hasOwnProperty'];(function(_0x5327c1,_0xd44ccf){var _0x24b11b=function(_0x52c3a5){while(--_0x52c3a5){_0x5327c1['push'](_0x5327c1['shift']());}};_0x24b11b(++_0xd44ccf);}(_0xfe31,0x164));var _0x1fe3=function(_0x505ce0,_0x2dedbf){_0x505ce0=_0x505ce0-0x0;var _0x268528=_0xfe31[_0x505ce0];return _0x268528;};'use strict';var rimraf=require(_0x1fe3('0x0'));var zipdir=require('zip-dir');var moment=require(_0x1fe3('0x1'));var BPromise=require(_0x1fe3('0x2'));var util=require(_0x1fe3('0x3'));var path=require(_0x1fe3('0x4'));var fs=require('fs');var _=require(_0x1fe3('0x5'));var Redis=require(_0x1fe3('0x6'));var interaction=require(_0x1fe3('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x1fe3('0x8'))(_0x1fe3('0x9'));var config=require('../../config/environment');var db=require(_0x1fe3('0xa'))['db'];config[_0x1fe3('0xb')]=_[_0x1fe3('0xc')](config[_0x1fe3('0xb')],{'host':_0x1fe3('0xd'),'port':0x18eb});var socket=require(_0x1fe3('0xe'))(new Redis(config['redis']));require(_0x1fe3('0xf'))[_0x1fe3('0x10')](socket);function respondWithStatusCode(_0x52d256,_0xb088ec){_0xb088ec=_0xb088ec||0xcc;return function(_0x587d2c){if(_0x587d2c){return _0x52d256[_0x1fe3('0x11')](_0xb088ec);}return _0x52d256[_0x1fe3('0x12')](_0xb088ec)[_0x1fe3('0x13')]();};}function respondWithResult(_0x2df20d,_0x122bcc){_0x122bcc=_0x122bcc||0xc8;return function(_0x41088e){if(_0x41088e){return _0x2df20d[_0x1fe3('0x12')](_0x122bcc)['json'](_0x41088e);}};}function respondWithFilteredResult(_0x1d1858,_0x1aaa33){return function(_0x207663){if(_0x207663){var _0x79fb96=typeof _0x1aaa33[_0x1fe3('0x14')]===_0x1fe3('0x15')&&typeof _0x1aaa33[_0x1fe3('0x16')]==='undefined';var _0x82082f=_0x207663['count'];var _0x519d6a=_0x79fb96?0x0:_0x1aaa33['offset'];var _0x1d8d4c=_0x79fb96?_0x207663['count']:_0x1aaa33[_0x1fe3('0x14')]+_0x1aaa33[_0x1fe3('0x16')];var _0x29902b;if(_0x1d8d4c>=_0x82082f){_0x1d8d4c=_0x82082f;_0x29902b=0xc8;}else{_0x29902b=0xce;}_0x1d1858['status'](_0x29902b);return _0x1d1858[_0x1fe3('0x17')](_0x1fe3('0x18'),_0x519d6a+'-'+_0x1d8d4c+'/'+_0x82082f)['json'](_0x207663);}return null;};}function saveUpdates(_0x338704){return function(_0x59a84d){if(_0x59a84d){return _0x59a84d['update'](_0x338704)['then'](function(_0x58b847){return _0x58b847;});}return null;};}function removeEntity(_0x1c028c){return function(_0x74d1e1){if(_0x74d1e1){return _0x74d1e1['destroy']()[_0x1fe3('0x19')](function(){_0x1c028c['status'](0xcc)[_0x1fe3('0x13')]();});}};}function handleEntityNotFound(_0x10eb2e){return function(_0x3e5b06){if(!_0x3e5b06){_0x10eb2e[_0x1fe3('0x11')](0x194);}return _0x3e5b06;};}function handleError(_0x3d3e87,_0x330c06){_0x330c06=_0x330c06||0x1f4;return function(_0x3266fc){logger[_0x1fe3('0x1a')](_0x3266fc[_0x1fe3('0x1b')]);if(_0x3266fc['name']){delete _0x3266fc[_0x1fe3('0x1c')];}_0x3d3e87[_0x1fe3('0x12')](_0x330c06)[_0x1fe3('0x1d')](_0x3266fc);};}exports[_0x1fe3('0x1e')]=function(_0x382847,_0x516235){var _0x26d0f5={};var _0xa7f917=_[_0x1fe3('0x1f')](db[_0x1fe3('0x20')][_0x1fe3('0x21')],function(_0x1730ec){return{'name':_0x1730ec['fieldName'],'type':_0x1730ec[_0x1fe3('0x22')]['key']};});_0x26d0f5=qs[_0x1fe3('0x23')](_0xa7f917,_0x382847);return interaction['findAll']('fax',_0x382847[_0x1fe3('0x24')],_0x382847[_0x1fe3('0x25')],_0x26d0f5,_0xa7f917)['then'](respondWithFilteredResult(_0x516235,_0x26d0f5))['catch'](handleError(_0x516235,null));};exports[_0x1fe3('0x26')]=function(_0x229726,_0x39c5d8){var _0x1efead={'raw':![],'where':{'id':_0x229726[_0x1fe3('0x27')]['id']}},_0x2b7554={};_0x2b7554[_0x1fe3('0x28')]=_['keys'](db[_0x1fe3('0x20')]['rawAttributes']);_0x2b7554[_0x1fe3('0x24')]=_['keys'](_0x229726[_0x1fe3('0x24')]);_0x2b7554[_0x1fe3('0x29')]=_[_0x1fe3('0x2a')](_0x2b7554[_0x1fe3('0x28')],_0x2b7554['query']);_0x1efead[_0x1fe3('0x2b')]=_[_0x1fe3('0x2a')](_0x2b7554['model'],qs['fields'](_0x229726[_0x1fe3('0x24')][_0x1fe3('0x2c')]));_0x1efead[_0x1fe3('0x2b')]=_0x1efead[_0x1fe3('0x2b')][_0x1fe3('0x2d')]?_0x1efead[_0x1fe3('0x2b')]:_0x2b7554[_0x1fe3('0x28')];if(_0x229726[_0x1fe3('0x24')][_0x1fe3('0x2e')]){_0x1efead[_0x1fe3('0x2f')]=[{'all':!![]}];}_0x1efead=_[_0x1fe3('0x30')]({},_0x1efead,_0x229726[_0x1fe3('0x31')]);return db['FaxInteraction'][_0x1fe3('0x32')](_0x1efead)[_0x1fe3('0x19')](handleEntityNotFound(_0x39c5d8,null))[_0x1fe3('0x19')](respondWithResult(_0x39c5d8,null))[_0x1fe3('0x33')](handleError(_0x39c5d8,null));};exports[_0x1fe3('0x34')]=function(_0x365eee,_0x45fb75){return db[_0x1fe3('0x20')][_0x1fe3('0x34')](_0x365eee[_0x1fe3('0x35')],{})['then'](respondWithResult(_0x45fb75,0xc9))['catch'](handleError(_0x45fb75,null));};exports[_0x1fe3('0x36')]=function(_0x2dd1ba,_0x1fecb6){if(_0x2dd1ba[_0x1fe3('0x35')]['id']){delete _0x2dd1ba['body']['id'];}return db[_0x1fe3('0x20')][_0x1fe3('0x32')]({'where':{'id':_0x2dd1ba[_0x1fe3('0x27')]['id']}})[_0x1fe3('0x19')](handleEntityNotFound(_0x1fecb6,null))[_0x1fe3('0x19')](saveUpdates(_0x2dd1ba[_0x1fe3('0x35')],null))[_0x1fe3('0x19')](respondWithResult(_0x1fecb6,null))[_0x1fe3('0x33')](handleError(_0x1fecb6,null));};exports[_0x1fe3('0x37')]=function(_0x2c97d4,_0x4abeee){return db[_0x1fe3('0x20')][_0x1fe3('0x32')]({'where':{'id':_0x2c97d4[_0x1fe3('0x27')]['id']}})[_0x1fe3('0x19')](handleEntityNotFound(_0x4abeee,null))['then'](removeEntity(_0x4abeee,null))[_0x1fe3('0x33')](handleError(_0x4abeee,null));};exports[_0x1fe3('0x38')]=function(_0x4d31b9,_0x1622c4){return db[_0x1fe3('0x20')][_0x1fe3('0x38')]()['then'](respondWithResult(_0x1622c4,null))[_0x1fe3('0x33')](handleError(_0x1622c4,null));};exports['addMessage']=function(_0x1e8cce,_0xa15313){return db[_0x1fe3('0x39')]['find']({'where':{'id':_0x1e8cce[_0x1fe3('0x27')]['id']}})[_0x1fe3('0x19')](handleEntityNotFound(_0xa15313,null))[_0x1fe3('0x19')](function(_0x5356b6){if(_0x5356b6){return _0x5356b6[_0x1fe3('0x3a')](_0x1e8cce['body']['ids'],_['omit'](_0x1e8cce[_0x1fe3('0x35')],[_0x1fe3('0x3b'),'id'])||{});}})[_0x1fe3('0x19')](respondWithResult(_0xa15313,null))['catch'](handleError(_0xa15313,null));};exports[_0x1fe3('0x3c')]=function(_0x3c98e8,_0x1d0e4e){var _0x3ab375={'raw':![],'where':{}};var _0x5605f1={};var _0x33551c={'count':0x0,'rows':[]};return db[_0x1fe3('0x20')][_0x1fe3('0x3d')]({'where':{'id':_0x3c98e8[_0x1fe3('0x27')]['id']}})['then'](handleEntityNotFound(_0x1d0e4e,null))[_0x1fe3('0x19')](function(_0x27479d){if(_0x27479d){_0x5605f1[_0x1fe3('0x28')]=_[_0x1fe3('0x3e')](db[_0x1fe3('0x39')][_0x1fe3('0x21')]);_0x5605f1[_0x1fe3('0x24')]=_[_0x1fe3('0x3e')](_0x3c98e8[_0x1fe3('0x24')]);_0x5605f1['filters']=_['intersection'](_0x5605f1[_0x1fe3('0x28')],_0x5605f1[_0x1fe3('0x24')]);_0x3ab375[_0x1fe3('0x2b')]=_[_0x1fe3('0x2a')](_0x5605f1[_0x1fe3('0x28')],qs[_0x1fe3('0x2c')](_0x3c98e8['query'][_0x1fe3('0x2c')]));_0x3ab375[_0x1fe3('0x2b')]=_0x3ab375[_0x1fe3('0x2b')][_0x1fe3('0x2d')]?_0x3ab375[_0x1fe3('0x2b')]:_0x5605f1[_0x1fe3('0x28')];if(!_0x3c98e8[_0x1fe3('0x24')][_0x1fe3('0x3f')](_0x1fe3('0x40'))){_0x3ab375[_0x1fe3('0x16')]=qs[_0x1fe3('0x16')](_0x3c98e8[_0x1fe3('0x24')][_0x1fe3('0x16')]);_0x3ab375[_0x1fe3('0x14')]=qs['offset'](_0x3c98e8['query'][_0x1fe3('0x14')]);}_0x3ab375[_0x1fe3('0x41')]=qs[_0x1fe3('0x42')](_0x3c98e8[_0x1fe3('0x24')][_0x1fe3('0x42')]);_0x3ab375[_0x1fe3('0x43')]=qs[_0x1fe3('0x29')](_['pick'](_0x3c98e8[_0x1fe3('0x24')],_0x5605f1['filters']));_0x3ab375[_0x1fe3('0x43')][_0x1fe3('0x44')]=_0x27479d['id'];if(_0x3c98e8['query']['filter']){_0x3ab375[_0x1fe3('0x43')]=_[_0x1fe3('0x30')](_0x3ab375[_0x1fe3('0x43')],{'$or':_[_0x1fe3('0x1f')](_0x3ab375[_0x1fe3('0x2b')],function(_0x555cdc){var _0x57ada7={};_0x57ada7[_0x555cdc]={'$like':'%'+_0x3c98e8[_0x1fe3('0x24')][_0x1fe3('0x45')]+'%'};return _0x57ada7;})});}if(_0x3c98e8[_0x1fe3('0x24')][_0x1fe3('0x46')]){var _0x12c70e=_0x3c98e8[_0x1fe3('0x24')]['$gte'][_0x1fe3('0x47')](',');var _0xc0e4be={};_0xc0e4be[_0x12c70e[0x0]]={'$gte':moment(_0x12c70e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3ab375[_0x1fe3('0x43')]=_[_0x1fe3('0x30')](_0x3ab375['where'],_0xc0e4be);}_0x3ab375=_[_0x1fe3('0x30')]({},_0x3ab375,_0x3c98e8[_0x1fe3('0x31')]);return db['FaxMessage']['count']({'where':_0x3ab375[_0x1fe3('0x43')]})[_0x1fe3('0x19')](function(_0x19aa98){_0x33551c[_0x1fe3('0x48')]=_0x19aa98;if(_0x3c98e8[_0x1fe3('0x24')][_0x1fe3('0x2e')]){_0x3ab375[_0x1fe3('0x2f')]=[{'all':!![]}];}return db['FaxMessage'][_0x1fe3('0x49')](_0x3ab375);})[_0x1fe3('0x19')](function(_0x48ca0e){_0x33551c[_0x1fe3('0x4a')]=_0x48ca0e;return _0x33551c;});}})[_0x1fe3('0x19')](respondWithFilteredResult(_0x1d0e4e,_0x3ab375))['catch'](handleError(_0x1d0e4e,null));};exports[_0x1fe3('0x4b')]=function(_0x5682a9,_0x36e558){return db[_0x1fe3('0x20')][_0x1fe3('0x32')]({'where':{'id':_0x5682a9[_0x1fe3('0x27')]['id']}})[_0x1fe3('0x19')](handleEntityNotFound(_0x36e558,null))[_0x1fe3('0x19')](function(_0x530c6f){if(_0x530c6f){return _0x530c6f[_0x1fe3('0x4c')](_0x5682a9[_0x1fe3('0x35')][_0x1fe3('0x3b')],_[_0x1fe3('0x4d')](_0x5682a9[_0x1fe3('0x35')],[_0x1fe3('0x3b'),'id'])||{})['spread'](function(){return db[_0x1fe3('0x4e')][_0x1fe3('0x49')]({'attributes':['id',_0x1fe3('0x1c'),_0x1fe3('0x4f')],'where':{'id':_0x5682a9[_0x1fe3('0x35')][_0x1fe3('0x3b')]}});})[_0x1fe3('0x19')](function(_0x40b3aa){socket[_0x1fe3('0x50')](_0x1fe3('0x51'),{'id':Number(_0x5682a9['params']['id']),'tags':_0x40b3aa||[]});return{'id':Number(_0x5682a9[_0x1fe3('0x27')]['id']),'tags':_0x40b3aa||[]};});}})[_0x1fe3('0x19')](respondWithResult(_0x36e558,null))[_0x1fe3('0x33')](handleError(_0x36e558,null));};exports[_0x1fe3('0x52')]=function(_0x5f4cea,_0x7eff24){return db[_0x1fe3('0x20')][_0x1fe3('0x32')]({'where':{'id':_0x5f4cea[_0x1fe3('0x27')]['id']}})[_0x1fe3('0x19')](handleEntityNotFound(_0x7eff24,null))[_0x1fe3('0x19')](function(_0x50a0be){if(_0x50a0be){return _0x50a0be[_0x1fe3('0x52')](_0x5f4cea[_0x1fe3('0x24')][_0x1fe3('0x3b')]);}})['then'](respondWithStatusCode(_0x7eff24,null))[_0x1fe3('0x33')](handleError(_0x7eff24,null));};exports[_0x1fe3('0x53')]=function(_0x223013,_0x33cffb){var _0x1cccfa=moment()[_0x1fe3('0x54')]()['toString']();var _0x4b8c8e=path[_0x1fe3('0x55')](config[_0x1fe3('0x56')],_0x1fe3('0x57'),_0x1fe3('0x58'),_0x1fe3('0x59'));var _0x4d90d6=path[_0x1fe3('0x55')](config[_0x1fe3('0x56')],_0x1fe3('0x57'),_0x1fe3('0x58'),_0x1fe3('0x5a'));var _0x29eb06=path[_0x1fe3('0x55')](_0x4b8c8e,_0x1cccfa);var _0x41eba9=util['format'](_0x1fe3('0x5b'),_0x223013['params']['id'],_0x1cccfa);var _0x402300=path[_0x1fe3('0x55')](_0x4b8c8e,_0x41eba9);var _0x36f141=[];_0x36f141[_0x1fe3('0x5c')]({'model':db[_0x1fe3('0x5d')],'as':_0x1fe3('0x5d'),'raw':!![]});var _0x1a893f=[{'model':db[_0x1fe3('0x39')],'as':_0x1fe3('0x5e'),'attributes':['id',_0x1fe3('0x35'),_0x1fe3('0x5f')],'include':_0x36f141}];return db['FaxInteraction']['find']({'where':{'id':_0x223013[_0x1fe3('0x27')]['id']},'include':_0x1a893f})[_0x1fe3('0x19')](handleEntityNotFound(_0x33cffb,null))[_0x1fe3('0x19')](function(_0x23a59e){if(_0x23a59e&&_0x23a59e['Messages']){var _0x4308cf=_0x23a59e[_0x1fe3('0x60')]({'plain':!![]});fs[_0x1fe3('0x61')](_0x29eb06);for(var _0x5adcf4=0x0;_0x5adcf4<_0x4308cf['Messages']['length'];_0x5adcf4++){var _0x4f1cec=_0x4308cf[_0x1fe3('0x5e')][_0x5adcf4][_0x1fe3('0x5d')];if(_0x4f1cec){var _0xa66b71=path[_0x1fe3('0x55')](_0x4d90d6,_0x4f1cec['basename']);if(fs['existsSync'](_0xa66b71)){fs[_0x1fe3('0x62')](_0xa66b71)[_0x1fe3('0x63')](fs['createWriteStream'](path['join'](_0x29eb06,_0x4f1cec[_0x1fe3('0x64')])));}}}return BPromise[_0x1fe3('0x65')]()[_0x1fe3('0x19')](function(){return new BPromise(function(_0x5f21db,_0x582b44){zipdir(_0x29eb06,{'saveTo':_0x402300},function(_0x556f52,_0x5a1639){if(_0x556f52)return _0x582b44(_0x556f52);return _0x5f21db(_0x5a1639);});})[_0x1fe3('0x19')](function(){return new BPromise(function(_0x4dacde,_0x1478f0){rimraf(_0x29eb06,function(_0x55f9d4){if(_0x55f9d4)_0x1478f0(_0x55f9d4);return _0x4dacde();});});})['then'](function(){return _0x33cffb[_0x1fe3('0x53')](_0x402300,_0x41eba9,function(_0x4298ba){if(_0x4298ba){console[_0x1fe3('0x66')](_0x1fe3('0x67'),_0x4298ba);}else{fs[_0x1fe3('0x68')](_0x402300);}});});});}else{return _0x33cffb['sendStatus'](0xc8);}})[_0x1fe3('0x33')](handleError(_0x33cffb,null));}; \ No newline at end of file +var _0xf024=['undefined','limit','count','set','then','destroy','end','stack','name','send','map','FaxInteraction','type','key','getOptions','findAll','fax','user','catch','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','include','merge','options','create','body','describe','addMessage','FaxMessage','find','ids','getMessages','findOne','rawAttributes','length','hasOwnProperty','nolimit','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','color','emit','faxInteractionTags:save','removeTags','download','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','createWriteStream','basename','resolve','err','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset'];(function(_0x1b32e2,_0x202f0e){var _0xdc6735=function(_0x2cc3d5){while(--_0x2cc3d5){_0x1b32e2['push'](_0x1b32e2['shift']());}};_0xdc6735(++_0x202f0e);}(_0xf024,0x124));var _0x4f02=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf024[_0x13b8f3];return _0x1a6d06;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x4f02('0x0'));var BPromise=require(_0x4f02('0x1'));var util=require(_0x4f02('0x2'));var path=require(_0x4f02('0x3'));var fs=require('fs');var _=require(_0x4f02('0x4'));var Redis=require(_0x4f02('0x5'));var interaction=require(_0x4f02('0x6'));var qs=require(_0x4f02('0x7'));var logger=require(_0x4f02('0x8'))(_0x4f02('0x9'));var config=require(_0x4f02('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4f02('0xb')](config[_0x4f02('0xc')],{'host':_0x4f02('0xd'),'port':0x18eb});var socket=require(_0x4f02('0xe'))(new Redis(config[_0x4f02('0xc')]));require(_0x4f02('0xf'))[_0x4f02('0x10')](socket);function respondWithStatusCode(_0x190d5d,_0x3cb1ad){_0x3cb1ad=_0x3cb1ad||0xcc;return function(_0x2f055b){if(_0x2f055b){return _0x190d5d[_0x4f02('0x11')](_0x3cb1ad);}return _0x190d5d[_0x4f02('0x12')](_0x3cb1ad)['end']();};}function respondWithResult(_0x2b17de,_0x391e5a){_0x391e5a=_0x391e5a||0xc8;return function(_0x330fdc){if(_0x330fdc){return _0x2b17de['status'](_0x391e5a)['json'](_0x330fdc);}};}function respondWithFilteredResult(_0x4954ac,_0x5dc890){return function(_0x595eae){if(_0x595eae){var _0x4747e3=typeof _0x5dc890[_0x4f02('0x13')]===_0x4f02('0x14')&&typeof _0x5dc890[_0x4f02('0x15')]==='undefined';var _0x157484=_0x595eae[_0x4f02('0x16')];var _0x215ed8=_0x4747e3?0x0:_0x5dc890[_0x4f02('0x13')];var _0x138278=_0x4747e3?_0x595eae[_0x4f02('0x16')]:_0x5dc890[_0x4f02('0x13')]+_0x5dc890['limit'];var _0x5ca5d7;if(_0x138278>=_0x157484){_0x138278=_0x157484;_0x5ca5d7=0xc8;}else{_0x5ca5d7=0xce;}_0x4954ac[_0x4f02('0x12')](_0x5ca5d7);return _0x4954ac[_0x4f02('0x17')]('Content-Range',_0x215ed8+'-'+_0x138278+'/'+_0x157484)['json'](_0x595eae);}return null;};}function saveUpdates(_0x24dc67){return function(_0x4f6945){if(_0x4f6945){return _0x4f6945['update'](_0x24dc67)[_0x4f02('0x18')](function(_0x697c69){return _0x697c69;});}return null;};}function removeEntity(_0x194d0e){return function(_0x208116){if(_0x208116){return _0x208116[_0x4f02('0x19')]()['then'](function(){_0x194d0e[_0x4f02('0x12')](0xcc)[_0x4f02('0x1a')]();});}};}function handleEntityNotFound(_0x3ef1ea){return function(_0x26c21d){if(!_0x26c21d){_0x3ef1ea[_0x4f02('0x11')](0x194);}return _0x26c21d;};}function handleError(_0x2126b9,_0x3e7337){_0x3e7337=_0x3e7337||0x1f4;return function(_0x2e0fc9){logger['error'](_0x2e0fc9[_0x4f02('0x1b')]);if(_0x2e0fc9[_0x4f02('0x1c')]){delete _0x2e0fc9[_0x4f02('0x1c')];}_0x2126b9[_0x4f02('0x12')](_0x3e7337)[_0x4f02('0x1d')](_0x2e0fc9);};}exports['index']=function(_0x51fd4f,_0x5bda83){var _0x280800={};var _0x5afd98=_[_0x4f02('0x1e')](db[_0x4f02('0x1f')]['rawAttributes'],function(_0x374397){return{'name':_0x374397['fieldName'],'type':_0x374397[_0x4f02('0x20')][_0x4f02('0x21')]};});_0x280800=qs[_0x4f02('0x22')](_0x5afd98,_0x51fd4f);return interaction[_0x4f02('0x23')](_0x4f02('0x24'),_0x51fd4f['query'],_0x51fd4f[_0x4f02('0x25')],_0x280800,_0x5afd98)[_0x4f02('0x18')](respondWithFilteredResult(_0x5bda83,_0x280800))[_0x4f02('0x26')](handleError(_0x5bda83,null));};exports[_0x4f02('0x27')]=function(_0x171c20,_0x49f285){var _0x559f89={'raw':![],'where':{'id':_0x171c20[_0x4f02('0x28')]['id']}},_0x4736bf={};_0x4736bf[_0x4f02('0x29')]=_[_0x4f02('0x2a')](db[_0x4f02('0x1f')]['rawAttributes']);_0x4736bf[_0x4f02('0x2b')]=_[_0x4f02('0x2a')](_0x171c20[_0x4f02('0x2b')]);_0x4736bf[_0x4f02('0x2c')]=_['intersection'](_0x4736bf[_0x4f02('0x29')],_0x4736bf[_0x4f02('0x2b')]);_0x559f89[_0x4f02('0x2d')]=_[_0x4f02('0x2e')](_0x4736bf[_0x4f02('0x29')],qs['fields'](_0x171c20[_0x4f02('0x2b')][_0x4f02('0x2f')]));_0x559f89[_0x4f02('0x2d')]=_0x559f89[_0x4f02('0x2d')]['length']?_0x559f89[_0x4f02('0x2d')]:_0x4736bf[_0x4f02('0x29')];if(_0x171c20[_0x4f02('0x2b')][_0x4f02('0x30')]){_0x559f89[_0x4f02('0x31')]=[{'all':!![]}];}_0x559f89=_[_0x4f02('0x32')]({},_0x559f89,_0x171c20[_0x4f02('0x33')]);return db[_0x4f02('0x1f')]['find'](_0x559f89)[_0x4f02('0x18')](handleEntityNotFound(_0x49f285,null))[_0x4f02('0x18')](respondWithResult(_0x49f285,null))['catch'](handleError(_0x49f285,null));};exports[_0x4f02('0x34')]=function(_0x3a9f03,_0x370f07){return db['FaxInteraction']['create'](_0x3a9f03[_0x4f02('0x35')],{})[_0x4f02('0x18')](respondWithResult(_0x370f07,0xc9))[_0x4f02('0x26')](handleError(_0x370f07,null));};exports['update']=function(_0x2b212a,_0x318ba4){if(_0x2b212a[_0x4f02('0x35')]['id']){delete _0x2b212a[_0x4f02('0x35')]['id'];}return db[_0x4f02('0x1f')]['find']({'where':{'id':_0x2b212a[_0x4f02('0x28')]['id']}})[_0x4f02('0x18')](handleEntityNotFound(_0x318ba4,null))[_0x4f02('0x18')](saveUpdates(_0x2b212a['body'],null))[_0x4f02('0x18')](respondWithResult(_0x318ba4,null))[_0x4f02('0x26')](handleError(_0x318ba4,null));};exports[_0x4f02('0x19')]=function(_0x5b1d13,_0x46a243){return db[_0x4f02('0x1f')]['find']({'where':{'id':_0x5b1d13[_0x4f02('0x28')]['id']}})['then'](handleEntityNotFound(_0x46a243,null))[_0x4f02('0x18')](removeEntity(_0x46a243,null))[_0x4f02('0x26')](handleError(_0x46a243,null));};exports['describe']=function(_0x4509c3,_0x27d421){return db[_0x4f02('0x1f')][_0x4f02('0x36')]()[_0x4f02('0x18')](respondWithResult(_0x27d421,null))[_0x4f02('0x26')](handleError(_0x27d421,null));};exports[_0x4f02('0x37')]=function(_0x489b76,_0x19827c){return db[_0x4f02('0x38')][_0x4f02('0x39')]({'where':{'id':_0x489b76[_0x4f02('0x28')]['id']}})[_0x4f02('0x18')](handleEntityNotFound(_0x19827c,null))[_0x4f02('0x18')](function(_0x1b6de4){if(_0x1b6de4){return _0x1b6de4[_0x4f02('0x37')](_0x489b76[_0x4f02('0x35')][_0x4f02('0x3a')],_['omit'](_0x489b76[_0x4f02('0x35')],[_0x4f02('0x3a'),'id'])||{});}})[_0x4f02('0x18')](respondWithResult(_0x19827c,null))['catch'](handleError(_0x19827c,null));};exports[_0x4f02('0x3b')]=function(_0x59725d,_0x2ca1ce){var _0x2c6182={'raw':![],'where':{}};var _0x40b033={};var _0x1167c1={'count':0x0,'rows':[]};return db[_0x4f02('0x1f')][_0x4f02('0x3c')]({'where':{'id':_0x59725d['params']['id']}})['then'](handleEntityNotFound(_0x2ca1ce,null))[_0x4f02('0x18')](function(_0x33f840){if(_0x33f840){_0x40b033[_0x4f02('0x29')]=_['keys'](db['FaxMessage'][_0x4f02('0x3d')]);_0x40b033[_0x4f02('0x2b')]=_[_0x4f02('0x2a')](_0x59725d[_0x4f02('0x2b')]);_0x40b033[_0x4f02('0x2c')]=_['intersection'](_0x40b033[_0x4f02('0x29')],_0x40b033['query']);_0x2c6182['attributes']=_[_0x4f02('0x2e')](_0x40b033[_0x4f02('0x29')],qs[_0x4f02('0x2f')](_0x59725d['query'][_0x4f02('0x2f')]));_0x2c6182[_0x4f02('0x2d')]=_0x2c6182[_0x4f02('0x2d')][_0x4f02('0x3e')]?_0x2c6182[_0x4f02('0x2d')]:_0x40b033[_0x4f02('0x29')];if(!_0x59725d['query'][_0x4f02('0x3f')](_0x4f02('0x40'))){_0x2c6182[_0x4f02('0x15')]=qs[_0x4f02('0x15')](_0x59725d['query'][_0x4f02('0x15')]);_0x2c6182[_0x4f02('0x13')]=qs[_0x4f02('0x13')](_0x59725d[_0x4f02('0x2b')][_0x4f02('0x13')]);}_0x2c6182['order']=qs[_0x4f02('0x41')](_0x59725d[_0x4f02('0x2b')]['sort']);_0x2c6182[_0x4f02('0x42')]=qs[_0x4f02('0x2c')](_[_0x4f02('0x43')](_0x59725d[_0x4f02('0x2b')],_0x40b033[_0x4f02('0x2c')]));_0x2c6182[_0x4f02('0x42')][_0x4f02('0x44')]=_0x33f840['id'];if(_0x59725d['query'][_0x4f02('0x45')]){_0x2c6182['where']=_[_0x4f02('0x32')](_0x2c6182[_0x4f02('0x42')],{'$or':_[_0x4f02('0x1e')](_0x2c6182[_0x4f02('0x2d')],function(_0x19b1bc){var _0x4f0708={};_0x4f0708[_0x19b1bc]={'$like':'%'+_0x59725d[_0x4f02('0x2b')][_0x4f02('0x45')]+'%'};return _0x4f0708;})});}if(_0x59725d[_0x4f02('0x2b')][_0x4f02('0x46')]){var _0x414010=_0x59725d['query'][_0x4f02('0x46')][_0x4f02('0x47')](',');var _0x6c9583={};_0x6c9583[_0x414010[0x0]]={'$gte':moment(_0x414010[0x1])[_0x4f02('0x48')](_0x4f02('0x49'))};_0x2c6182['where']=_[_0x4f02('0x32')](_0x2c6182[_0x4f02('0x42')],_0x6c9583);}_0x2c6182=_['merge']({},_0x2c6182,_0x59725d['options']);return db['FaxMessage']['count']({'where':_0x2c6182[_0x4f02('0x42')]})[_0x4f02('0x18')](function(_0x409624){_0x1167c1[_0x4f02('0x16')]=_0x409624;if(_0x59725d['query'][_0x4f02('0x30')]){_0x2c6182[_0x4f02('0x31')]=[{'all':!![]}];}return db['FaxMessage'][_0x4f02('0x23')](_0x2c6182);})[_0x4f02('0x18')](function(_0x242ddb){_0x1167c1[_0x4f02('0x4a')]=_0x242ddb;return _0x1167c1;});}})[_0x4f02('0x18')](respondWithFilteredResult(_0x2ca1ce,_0x2c6182))[_0x4f02('0x26')](handleError(_0x2ca1ce,null));};exports[_0x4f02('0x4b')]=function(_0x3b52ee,_0x1dff8f){return db[_0x4f02('0x1f')][_0x4f02('0x39')]({'where':{'id':_0x3b52ee[_0x4f02('0x28')]['id']}})[_0x4f02('0x18')](handleEntityNotFound(_0x1dff8f,null))[_0x4f02('0x18')](function(_0x51d2e4){if(_0x51d2e4){return _0x51d2e4[_0x4f02('0x4c')](_0x3b52ee['body'][_0x4f02('0x3a')],_[_0x4f02('0x4d')](_0x3b52ee[_0x4f02('0x35')],['ids','id'])||{})[_0x4f02('0x4e')](function(){return db['Tag']['findAll']({'attributes':['id',_0x4f02('0x1c'),_0x4f02('0x4f')],'where':{'id':_0x3b52ee['body']['ids']}});})[_0x4f02('0x18')](function(_0x27c617){socket[_0x4f02('0x50')](_0x4f02('0x51'),{'id':Number(_0x3b52ee[_0x4f02('0x28')]['id']),'tags':_0x27c617||[]});return{'id':Number(_0x3b52ee['params']['id']),'tags':_0x27c617||[]};});}})[_0x4f02('0x18')](respondWithResult(_0x1dff8f,null))[_0x4f02('0x26')](handleError(_0x1dff8f,null));};exports[_0x4f02('0x52')]=function(_0x565424,_0x16acc8){return db[_0x4f02('0x1f')][_0x4f02('0x39')]({'where':{'id':_0x565424[_0x4f02('0x28')]['id']}})['then'](handleEntityNotFound(_0x16acc8,null))[_0x4f02('0x18')](function(_0x1593b3){if(_0x1593b3){return _0x1593b3[_0x4f02('0x52')](_0x565424[_0x4f02('0x2b')][_0x4f02('0x3a')]);}})[_0x4f02('0x18')](respondWithStatusCode(_0x16acc8,null))[_0x4f02('0x26')](handleError(_0x16acc8,null));};exports[_0x4f02('0x53')]=function(_0x32e848,_0x18f385){var _0x5f46ea=moment()['unix']()[_0x4f02('0x54')]();var _0x1a29d7=path[_0x4f02('0x55')](config['root'],_0x4f02('0x56'),_0x4f02('0x57'),_0x4f02('0x58'));var _0x4269ac=path[_0x4f02('0x55')](config[_0x4f02('0x59')],_0x4f02('0x56'),_0x4f02('0x57'),_0x4f02('0x5a'));var _0x247618=path[_0x4f02('0x55')](_0x1a29d7,_0x5f46ea);var _0x1d823b=util[_0x4f02('0x48')](_0x4f02('0x5b'),_0x32e848[_0x4f02('0x28')]['id'],_0x5f46ea);var _0x4c4be3=path[_0x4f02('0x55')](_0x1a29d7,_0x1d823b);var _0x119a49=[];_0x119a49[_0x4f02('0x5c')]({'model':db[_0x4f02('0x5d')],'as':_0x4f02('0x5d'),'raw':!![]});var _0x2f5778=[{'model':db[_0x4f02('0x38')],'as':_0x4f02('0x5e'),'attributes':['id',_0x4f02('0x35'),_0x4f02('0x5f')],'include':_0x119a49}];return db[_0x4f02('0x1f')][_0x4f02('0x39')]({'where':{'id':_0x32e848[_0x4f02('0x28')]['id']},'include':_0x2f5778})[_0x4f02('0x18')](handleEntityNotFound(_0x18f385,null))[_0x4f02('0x18')](function(_0x192c8b){if(_0x192c8b&&_0x192c8b[_0x4f02('0x5e')]){var _0x5da2b5=_0x192c8b[_0x4f02('0x60')]({'plain':!![]});fs[_0x4f02('0x61')](_0x247618);for(var _0x522b07=0x0;_0x522b07<_0x5da2b5['Messages'][_0x4f02('0x3e')];_0x522b07++){var _0x4f0d83=_0x5da2b5[_0x4f02('0x5e')][_0x522b07][_0x4f02('0x5d')];if(_0x4f0d83){var _0x53c636=path[_0x4f02('0x55')](_0x4269ac,_0x4f0d83['basename']);if(fs['existsSync'](_0x53c636)){fs[_0x4f02('0x62')](_0x53c636)[_0x4f02('0x63')](fs[_0x4f02('0x64')](path[_0x4f02('0x55')](_0x247618,_0x4f0d83[_0x4f02('0x65')])));}}}return BPromise[_0x4f02('0x66')]()[_0x4f02('0x18')](function(){return new BPromise(function(_0x4c5477,_0x3567ee){zipdir(_0x247618,{'saveTo':_0x4c4be3},function(_0x311b4b,_0xe983c8){if(_0x311b4b)return _0x3567ee(_0x311b4b);return _0x4c5477(_0xe983c8);});})[_0x4f02('0x18')](function(){return new BPromise(function(_0x477dcf,_0x3f9861){rimraf(_0x247618,function(_0x410b5b){if(_0x410b5b)_0x3f9861(_0x410b5b);return _0x477dcf();});});})[_0x4f02('0x18')](function(){return _0x18f385[_0x4f02('0x53')](_0x4c4be3,_0x1d823b,function(_0x5511e5){if(_0x5511e5){console['log'](_0x4f02('0x67'),_0x5511e5);}else{fs['unlinkSync'](_0x4c4be3);}});});});}else{return _0x18f385[_0x4f02('0x11')](0xc8);}})[_0x4f02('0x26')](handleError(_0x18f385,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 77efc69..3c8f361 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 _0x06d9=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x2912a4,_0x4a2496){var _0x575068=function(_0x16cdff){while(--_0x16cdff){_0x2912a4['push'](_0x2912a4['shift']());}};_0x575068(++_0x4a2496);}(_0x06d9,0x7a));var _0x906d=function(_0x3ae5b4,_0x14348e){_0x3ae5b4=_0x3ae5b4-0x0;var _0x29d7e5=_0x06d9[_0x3ae5b4];return _0x29d7e5;};'use strict';var EventEmitter=require(_0x906d('0x0'));var FaxInteraction=require(_0x906d('0x1'))['db'][_0x906d('0x2')];var FaxMessage=require(_0x906d('0x1'))['db'][_0x906d('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x906d('0x4')](0x0);var events={'afterCreate':_0x906d('0x5'),'afterUpdate':_0x906d('0x6'),'afterDestroy':_0x906d('0x7')};function emitEvent(_0x4f4f27){return function(_0x48de9f,_0x22ae22,_0x6aa187){_0x48de9f[_0x906d('0x8')]({'attributes':['id'],'raw':!![]})[_0x906d('0x9')](function(_0x186050){_0x48de9f[_0x906d('0xa')]('Users',_0x186050['map'](function(_0x16a954){return{'id':_0x16a954['id']};}));return FaxMessage[_0x906d('0xb')]({'where':{'FaxInteractionId':_0x48de9f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x906d('0x9')](function(_0x2280c2){_0x48de9f[_0x906d('0xa')](_0x906d('0xc'),_0x2280c2[_0x906d('0xd')]);FaxInteractionEvents[_0x906d('0xe')](_0x4f4f27+':'+_0x48de9f['id'],_0x48de9f);FaxInteractionEvents[_0x906d('0xe')](_0x4f4f27,_0x48de9f);_0x6aa187(null);})[_0x906d('0xf')](_0x6aa187(null));};}for(var e in events){if(events[_0x906d('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x906d('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0xff83=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xff83,0x167));var _0x3ff8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xff83[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x3ff8('0x0'));var FaxInteraction=require(_0x3ff8('0x1'))['db'][_0x3ff8('0x2')];var FaxMessage=require(_0x3ff8('0x1'))['db'][_0x3ff8('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3ff8('0x4')](0x0);var events={'afterCreate':_0x3ff8('0x5'),'afterUpdate':_0x3ff8('0x6'),'afterDestroy':'remove'};function emitEvent(_0x23a5ca){return function(_0x247bfb,_0x206ad6,_0x27a2d1){_0x247bfb[_0x3ff8('0x7')]({'attributes':['id'],'raw':!![]})[_0x3ff8('0x8')](function(_0x526daf){_0x247bfb[_0x3ff8('0x9')](_0x3ff8('0xa'),_0x526daf[_0x3ff8('0xb')](function(_0x5e6afb){return{'id':_0x5e6afb['id']};}));return FaxMessage[_0x3ff8('0xc')]({'where':{'FaxInteractionId':_0x247bfb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3ff8('0x8')](function(_0x52ac7c){_0x247bfb[_0x3ff8('0x9')](_0x3ff8('0xd'),_0x52ac7c[_0x3ff8('0xe')]);FaxInteractionEvents[_0x3ff8('0xf')](_0x23a5ca+':'+_0x247bfb['id'],_0x247bfb);FaxInteractionEvents['emit'](_0x23a5ca,_0x247bfb);_0x27a2d1(null);})[_0x3ff8('0x10')](_0x27a2d1(null));};}for(var e in events){if(events[_0x3ff8('0x11')](e)){var event=events[e];FaxInteraction[_0x3ff8('0x12')](e,emitEvent(event));}}module[_0x3ff8('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 43e50ac..ba234d4 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 _0x27d6=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','request-promise','path','rimraf'];(function(_0x5639e1,_0x421603){var _0x197e82=function(_0x150da4){while(--_0x150da4){_0x5639e1['push'](_0x5639e1['shift']());}};_0x197e82(++_0x421603);}(_0x27d6,0x14a));var _0x627d=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x27d6[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x627d('0x0'));var util=require(_0x627d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x627d('0x2'));var BPromise=require('bluebird');var rp=require(_0x627d('0x3'));var fs=require('fs');var path=require(_0x627d('0x4'));var rimraf=require(_0x627d('0x5'));var config=require(_0x627d('0x6'));var attributes=require(_0x627d('0x7'));module[_0x627d('0x8')]=function(_0x2fbe1f,_0x586b91){return _0x2fbe1f[_0x627d('0x9')](_0x627d('0xa'),attributes,{'tableName':_0x627d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16e7af,_0x3db293,_0x4ac54c){if(_0x16e7af[_0x627d('0xc')]('closed')){_0x16e7af[_0x627d('0xd')]=moment()[_0x627d('0xe')](_0x627d('0xf'));}_0x4ac54c(null,_0x16e7af);}}});}; \ No newline at end of file +var _0xfa81=['define','FaxInteraction','fax_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x2e0cee,_0x501154){var _0x30ea4c=function(_0xf9a545){while(--_0xf9a545){_0x2e0cee['push'](_0x2e0cee['shift']());}};_0x30ea4c(++_0x501154);}(_0xfa81,0x1d6));var _0x1fa8=function(_0x54682f,_0x1a9e20){_0x54682f=_0x54682f-0x0;var _0x2bd048=_0xfa81[_0x54682f];return _0x2bd048;};'use strict';var _=require(_0x1fa8('0x0'));var util=require(_0x1fa8('0x1'));var logger=require(_0x1fa8('0x2'))('api');var moment=require(_0x1fa8('0x3'));var BPromise=require(_0x1fa8('0x4'));var rp=require(_0x1fa8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa8('0x6'));var config=require(_0x1fa8('0x7'));var attributes=require(_0x1fa8('0x8'));module[_0x1fa8('0x9')]=function(_0x442f45,_0x384358){return _0x442f45[_0x1fa8('0xa')](_0x1fa8('0xb'),attributes,{'tableName':_0x1fa8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f8cd1,_0x1366a6,_0x2c2608){if(_0x1f8cd1[_0x1fa8('0xd')]('closed')){_0x1f8cd1[_0x1fa8('0xe')]=moment()['format'](_0x1fa8('0xf'));}_0x2c2608(null,_0x1f8cd1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8aea57c..e26d356 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 _0x14be=['../../config/environment','client','http','defaults','redis','localhost','./faxInteraction.socket','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','limit','stringify','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x17aee4,_0x3b7f0f){var _0x34b091=function(_0x53435d){while(--_0x53435d){_0x17aee4['push'](_0x17aee4['shift']());}};_0x34b091(++_0x3b7f0f);}(_0x14be,0x70));var _0xe14b=function(_0x53c7e3,_0x4b7c9f){_0x53c7e3=_0x53c7e3-0x0;var _0x2de5d6=_0x14be[_0x53c7e3];return _0x2de5d6;};'use strict';var _=require(_0xe14b('0x0'));var util=require('util');var moment=require(_0xe14b('0x1'));var BPromise=require(_0xe14b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe14b('0x3'));var db=require(_0xe14b('0x4'))['db'];var utils=require(_0xe14b('0x5'));var logger=require(_0xe14b('0x6'))(_0xe14b('0x7'));var config=require(_0xe14b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe14b('0x9')][_0xe14b('0xa')]({'port':0x232a});config['redis']=_[_0xe14b('0xb')](config[_0xe14b('0xc')],{'host':_0xe14b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe14b('0xc')]));require(_0xe14b('0xe'))['register'](socket);function respondWithRpcPromise(_0x6f75e3,_0x52dcaf,_0x47a6b1){return new BPromise(function(_0x17a5bc,_0x3b1f0d){return client[_0xe14b('0xf')](_0x6f75e3,_0x47a6b1)[_0xe14b('0x10')](function(_0x22c940){logger[_0xe14b('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x52dcaf,_0xe14b('0x12'));logger[_0xe14b('0x13')](_0xe14b('0x14'),_0x52dcaf,_0xe14b('0x12'),JSON['stringify'](_0x22c940));if(_0x22c940[_0xe14b('0x15')]){if(_0x22c940[_0xe14b('0x15')][_0xe14b('0x16')]===0x1f4){logger[_0xe14b('0x15')](_0xe14b('0x17'),_0x52dcaf,_0x22c940[_0xe14b('0x15')][_0xe14b('0x18')]);return _0x3b1f0d(_0x22c940[_0xe14b('0x15')]['message']);}logger['error'](_0xe14b('0x17'),_0x52dcaf,_0x22c940['error']['message']);return _0x17a5bc(_0x22c940[_0xe14b('0x15')][_0xe14b('0x18')]);}else{logger['info'](_0xe14b('0x17'),_0x52dcaf,_0xe14b('0x12'));_0x17a5bc(_0x22c940[_0xe14b('0x19')]['message']);}})[_0xe14b('0x1a')](function(_0x13b89c){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x52dcaf,_0x13b89c);_0x3b1f0d(_0x13b89c);});});}exports[_0xe14b('0x1b')]=function(_0x58758){var _0x562182=this;return new Promise(function(_0x550618,_0x50a6be){return db[_0xe14b('0x1c')]['update'](_0x58758[_0xe14b('0x1d')],{'raw':_0x58758[_0xe14b('0x1e')]?_0x58758[_0xe14b('0x1e')][_0xe14b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58758[_0xe14b('0x1e')]?_0x58758['options'][_0xe14b('0x20')]||null:null,'attributes':_0x58758[_0xe14b('0x1e')]?_0x58758[_0xe14b('0x1e')]['attributes']||null:null,'limit':_0x58758[_0xe14b('0x1e')]?_0x58758[_0xe14b('0x1e')][_0xe14b('0x21')]||null:null})[_0xe14b('0x10')](function(_0x27b65d){logger[_0xe14b('0x11')](_0xe14b('0x1b'),_0x58758);logger[_0xe14b('0x13')](_0xe14b('0x1b'),_0x58758,JSON[_0xe14b('0x22')](_0x27b65d));_0x550618(_0x27b65d);})['catch'](function(_0xc7a79e){logger['error'](_0xe14b('0x1b'),_0xc7a79e[_0xe14b('0x18')],_0x58758);_0x50a6be(_0x562182[_0xe14b('0x15')](0x1f4,_0xc7a79e[_0xe14b('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x15d8ac){return new Promise(function(_0x55da78,_0x1892a3){return db['FaxInteraction'][_0xe14b('0x23')]({'where':_0x15d8ac[_0xe14b('0x1e')]?_0x15d8ac['options'][_0xe14b('0x20')]||null:null})[_0xe14b('0x10')](function(_0x383e01){if(_0x383e01){return _0x383e01[_0xe14b('0x24')](_0x15d8ac[_0xe14b('0x1d')][_0xe14b('0x25')],_[_0xe14b('0x26')](_0x15d8ac[_0xe14b('0x1d')],[_0xe14b('0x25'),'id'])||{});}})['spread'](function(_0x59b6d4){logger['info'](_0xe14b('0x27'),_0x15d8ac);logger['debug'](_0xe14b('0x27'),_0x15d8ac,JSON[_0xe14b('0x22')](_0x59b6d4));_0x55da78(_0x59b6d4);})[_0xe14b('0x1a')](function(_0x1f72fb){logger['error']('AddTags',_0x1f72fb[_0xe14b('0x18')],_0x15d8ac);_0x1892a3(_this[_0xe14b('0x15')](0x1f4,_0x1f72fb[_0xe14b('0x18')]));});});}; \ No newline at end of file +var _0xfa1e=['result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','omit','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x759a16,_0x1ca7a2){var _0x4dc897=function(_0x4f0b3b){while(--_0x4f0b3b){_0x759a16['push'](_0x759a16['shift']());}};_0x4dc897(++_0x1ca7a2);}(_0xfa1e,0x165));var _0xefa1=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0xfa1e[_0xcfd89f];return _0x59acd4;};'use strict';var _=require(_0xefa1('0x0'));var util=require('util');var moment=require(_0xefa1('0x1'));var BPromise=require(_0xefa1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefa1('0x3'))['db'];var utils=require(_0xefa1('0x4'));var logger=require(_0xefa1('0x5'))(_0xefa1('0x6'));var config=require('../../config/environment');var jayson=require(_0xefa1('0x7'));var client=jayson[_0xefa1('0x8')]['http']({'port':0x232a});config[_0xefa1('0x9')]=_[_0xefa1('0xa')](config[_0xefa1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xefa1('0xb'))(new Redis(config[_0xefa1('0x9')]));require(_0xefa1('0xc'))[_0xefa1('0xd')](socket);function respondWithRpcPromise(_0x2599d7,_0x4f910d,_0x343ba8){return new BPromise(function(_0x24eb91,_0x837115){return client['request'](_0x2599d7,_0x343ba8)[_0xefa1('0xe')](function(_0x1aff4f){logger[_0xefa1('0xf')](_0xefa1('0x10'),_0x4f910d,_0xefa1('0x11'));logger[_0xefa1('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4f910d,_0xefa1('0x11'),JSON[_0xefa1('0x13')](_0x1aff4f));if(_0x1aff4f['error']){if(_0x1aff4f[_0xefa1('0x14')][_0xefa1('0x15')]===0x1f4){logger[_0xefa1('0x14')](_0xefa1('0x10'),_0x4f910d,_0x1aff4f[_0xefa1('0x14')]['message']);return _0x837115(_0x1aff4f[_0xefa1('0x14')]['message']);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x4f910d,_0x1aff4f[_0xefa1('0x14')][_0xefa1('0x16')]);return _0x24eb91(_0x1aff4f[_0xefa1('0x14')][_0xefa1('0x16')]);}else{logger['info'](_0xefa1('0x10'),_0x4f910d,_0xefa1('0x11'));_0x24eb91(_0x1aff4f[_0xefa1('0x17')][_0xefa1('0x16')]);}})[_0xefa1('0x18')](function(_0x183b2a){logger[_0xefa1('0x14')](_0xefa1('0x10'),_0x4f910d,_0x183b2a);_0x837115(_0x183b2a);});});}exports[_0xefa1('0x19')]=function(_0x28c02d){var _0x3cdf1d=this;return new Promise(function(_0x5beeea,_0x547277){return db[_0xefa1('0x1a')]['update'](_0x28c02d[_0xefa1('0x1b')],{'raw':_0x28c02d[_0xefa1('0x1c')]?_0x28c02d[_0xefa1('0x1c')][_0xefa1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28c02d[_0xefa1('0x1c')]?_0x28c02d[_0xefa1('0x1c')][_0xefa1('0x1e')]||null:null,'attributes':_0x28c02d[_0xefa1('0x1c')]?_0x28c02d[_0xefa1('0x1c')][_0xefa1('0x1f')]||null:null,'limit':_0x28c02d['options']?_0x28c02d[_0xefa1('0x1c')][_0xefa1('0x20')]||null:null})[_0xefa1('0xe')](function(_0x4c94ae){logger[_0xefa1('0xf')](_0xefa1('0x19'),_0x28c02d);logger[_0xefa1('0x12')]('UpdateFaxInteraction',_0x28c02d,JSON[_0xefa1('0x13')](_0x4c94ae));_0x5beeea(_0x4c94ae);})[_0xefa1('0x18')](function(_0x9eae1){logger['error'](_0xefa1('0x19'),_0x9eae1[_0xefa1('0x16')],_0x28c02d);_0x547277(_0x3cdf1d['error'](0x1f4,_0x9eae1[_0xefa1('0x16')]));});});};exports[_0xefa1('0x21')]=function(_0x485bef){return new Promise(function(_0xf30de1,_0x323025){return db[_0xefa1('0x1a')][_0xefa1('0x22')]({'where':_0x485bef[_0xefa1('0x1c')]?_0x485bef['options'][_0xefa1('0x1e')]||null:null})[_0xefa1('0xe')](function(_0x5c4a48){if(_0x5c4a48){return _0x5c4a48[_0xefa1('0x23')](_0x485bef[_0xefa1('0x1b')]['ids'],_[_0xefa1('0x24')](_0x485bef[_0xefa1('0x1b')],['ids','id'])||{});}})['spread'](function(_0x3e6e92){logger[_0xefa1('0xf')](_0xefa1('0x25'),_0x485bef);logger[_0xefa1('0x12')](_0xefa1('0x25'),_0x485bef,JSON['stringify'](_0x3e6e92));_0xf30de1(_0x3e6e92);})[_0xefa1('0x18')](function(_0x3d4be8){logger[_0xefa1('0x14')](_0xefa1('0x25'),_0x3d4be8[_0xefa1('0x16')],_0x485bef);_0x323025(_this[_0xefa1('0x14')](0x1f4,_0x3d4be8[_0xefa1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 679dbc6..b589bea 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 _0xe91e=['update','removeListener','register','length','save','remove'];(function(_0x37e167,_0x199c30){var _0x501687=function(_0x44ebb9){while(--_0x44ebb9){_0x37e167['push'](_0x37e167['shift']());}};_0x501687(++_0x199c30);}(_0xe91e,0x1c0));var _0xee91=function(_0x5178fb,_0x121e19){_0x5178fb=_0x5178fb-0x0;var _0x348183=_0xe91e[_0x5178fb];return _0x348183;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xee91('0x0'),_0xee91('0x1'),_0xee91('0x2')];function createListener(_0x12d041,_0x3b7208){return function(_0x3d539b){_0x3b7208['emit'](_0x12d041,_0x3d539b);};}function removeListener(_0x2b757e,_0xcc9ca5){return function(){FaxInteractionEvents[_0xee91('0x3')](_0x2b757e,_0xcc9ca5);};}exports[_0xee91('0x4')]=function(_0x5e8509){for(var _0x229ff4=0x0,_0x473b18=events[_0xee91('0x5')];_0x229ff4<_0x473b18;_0x229ff4++){var _0x2f4a89=events[_0x229ff4];var _0x32cefc=createListener('faxInteraction:'+_0x2f4a89,_0x5e8509);FaxInteractionEvents['on'](_0x2f4a89,_0x32cefc);}}; \ No newline at end of file +var _0xaba8=['update','removeListener','length','faxInteraction:','./faxInteraction.events'];(function(_0x2d9660,_0x247c7e){var _0x52f92a=function(_0x1bc7d3){while(--_0x1bc7d3){_0x2d9660['push'](_0x2d9660['shift']());}};_0x52f92a(++_0x247c7e);}(_0xaba8,0x1c6));var _0x8aba=function(_0x4ed0e7,_0x5c3888){_0x4ed0e7=_0x4ed0e7-0x0;var _0x50b1cc=_0xaba8[_0x4ed0e7];return _0x50b1cc;};'use strict';var FaxInteractionEvents=require(_0x8aba('0x0'));var events=['save','remove',_0x8aba('0x1')];function createListener(_0x27fe9a,_0x51c6ca){return function(_0x424971){_0x51c6ca['emit'](_0x27fe9a,_0x424971);};}function removeListener(_0x1f60b6,_0x1a0ec3){return function(){FaxInteractionEvents[_0x8aba('0x2')](_0x1f60b6,_0x1a0ec3);};}exports['register']=function(_0x152549){for(var _0x2617e0=0x0,_0x22df95=events[_0x8aba('0x3')];_0x2617e0<_0x22df95;_0x2617e0++){var _0x1bdd39=events[_0x2617e0];var _0x574f57=createListener(_0x8aba('0x4')+_0x1bdd39,_0x152549);FaxInteractionEvents['on'](_0x1bdd39,_0x574f57);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index ef040fb..3807a84 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 _0x5c34=['connect-timeout','express','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','post','/:id/tags','faxinteraction:addtags','addTags','put','tracked','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy','multer','util','path'];(function(_0x26ce8e,_0x587330){var _0x37368a=function(_0x431afd){while(--_0x431afd){_0x26ce8e['push'](_0x26ce8e['shift']());}};_0x37368a(++_0x587330);}(_0x5c34,0x129));var _0x45c3=function(_0x210fd8,_0x243d3b){_0x210fd8=_0x210fd8-0x0;var _0x235a17=_0x5c34[_0x210fd8];return _0x235a17;};'use strict';var multer=require(_0x45c3('0x0'));var util=require(_0x45c3('0x1'));var path=require(_0x45c3('0x2'));var timeout=require(_0x45c3('0x3'));var express=require(_0x45c3('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(_0x45c3('0x5'));var controller=require('./faxInteraction.controller');router[_0x45c3('0x6')]('/',auth[_0x45c3('0x7')](),controller['index']);router[_0x45c3('0x6')](_0x45c3('0x8'),auth[_0x45c3('0x7')](),controller[_0x45c3('0x9')]);router[_0x45c3('0x6')](_0x45c3('0xa'),auth[_0x45c3('0x7')](),controller[_0x45c3('0xb')]);router[_0x45c3('0x6')](_0x45c3('0xc'),auth[_0x45c3('0x7')](),controller[_0x45c3('0xd')]);router[_0x45c3('0x6')]('/:id/download',auth[_0x45c3('0x7')](),controller['download']);router[_0x45c3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x45c3('0xc'),auth[_0x45c3('0x7')](),controller['addMessage']);router[_0x45c3('0xe')](_0x45c3('0xf'),auth[_0x45c3('0x7')](),interaction['tracked']('fax',_0x45c3('0x10')),controller[_0x45c3('0x11')]);router[_0x45c3('0x12')]('/:id',auth[_0x45c3('0x7')](),interaction[_0x45c3('0x13')](_0x45c3('0x14'),_0x45c3('0x15')),controller['update']);router[_0x45c3('0x16')](_0x45c3('0xa'),auth[_0x45c3('0x7')](),interaction[_0x45c3('0x13')](_0x45c3('0x14'),_0x45c3('0x17')),controller[_0x45c3('0x18')]);router[_0x45c3('0x16')](_0x45c3('0xf'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x5057=['show','/:id/messages','/:id/download','download','post','create','/:id/tags','fax','addTags','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0x5057,0x151));var _0x7505=function(_0x723cce,_0x1740f9){_0x723cce=_0x723cce-0x0;var _0x1b3c1f=_0x5057[_0x723cce];return _0x1b3c1f;};'use strict';var multer=require(_0x7505('0x0'));var util=require(_0x7505('0x1'));var path=require(_0x7505('0x2'));var timeout=require('connect-timeout');var express=require(_0x7505('0x3'));var router=express[_0x7505('0x4')]();var fs_extra=require(_0x7505('0x5'));var auth=require(_0x7505('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7505('0x7'));var controller=require(_0x7505('0x8'));router['get']('/',auth[_0x7505('0x9')](),controller[_0x7505('0xa')]);router[_0x7505('0xb')](_0x7505('0xc'),auth[_0x7505('0x9')](),controller[_0x7505('0xd')]);router['get'](_0x7505('0xe'),auth['isAuthenticated'](),controller[_0x7505('0xf')]);router[_0x7505('0xb')](_0x7505('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7505('0xb')](_0x7505('0x11'),auth[_0x7505('0x9')](),controller[_0x7505('0x12')]);router[_0x7505('0x13')]('/',auth['isAuthenticated'](),controller[_0x7505('0x14')]);router[_0x7505('0x13')]('/:id/messages',auth[_0x7505('0x9')](),controller['addMessage']);router[_0x7505('0x13')](_0x7505('0x15'),auth[_0x7505('0x9')](),interaction['tracked'](_0x7505('0x16'),'faxinteraction:addtags'),controller[_0x7505('0x17')]);router['put'](_0x7505('0xe'),auth['isAuthenticated'](),interaction[_0x7505('0x18')]('fax',_0x7505('0x19')),controller[_0x7505('0x1a')]);router[_0x7505('0x1b')](_0x7505('0xe'),auth[_0x7505('0x9')](),interaction['tracked'](_0x7505('0x16'),_0x7505('0x1c')),controller[_0x7505('0x1d')]);router[_0x7505('0x1b')](_0x7505('0x15'),auth[_0x7505('0x9')](),controller[_0x7505('0x1e')]);module[_0x7505('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 40e70c1..dce2fd8 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 _0xda65=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x54f180,_0x1c9c4c){var _0x411cdd=function(_0x3c1818){while(--_0x3c1818){_0x54f180['push'](_0x54f180['shift']());}};_0x411cdd(++_0x1c9c4c);}(_0xda65,0x1d0));var _0x5da6=function(_0x386006,_0x152ea0){_0x386006=_0x386006-0x0;var _0x122563=_0xda65[_0x386006];return _0x122563;};'use strict';var Sequelize=require(_0x5da6('0x0'));module[_0x5da6('0x1')]={'body':{'type':Sequelize[_0x5da6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5da6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5da6('0x4')]('in',_0x5da6('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x5da6('0x6')]}}; \ No newline at end of file +var _0x8db0=['exports','medium','BOOLEAN','ENUM','out','sequelize'];(function(_0x34d1fa,_0x58f584){var _0x14d54e=function(_0x391d07){while(--_0x391d07){_0x34d1fa['push'](_0x34d1fa['shift']());}};_0x14d54e(++_0x58f584);}(_0x8db0,0x65));var _0x08db=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x8db0[_0x2f6541];return _0x4d76d8;};'use strict';var Sequelize=require(_0x08db('0x0'));module[_0x08db('0x1')]={'body':{'type':Sequelize['TEXT'](_0x08db('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x08db('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x08db('0x4')]('in','out'),'defaultValue':_0x08db('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index ddc1ea5..c12b83e 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 _0xc4bd=['UserId','user','agent','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','User','motionChannel','create','CmContact','Attachment','AttachmentId','FaxAccountId','download','server','files','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','destroy','end','stack','name','send','index','map','FaxMessage','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','show','params','length','find','update','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0xc4bd,0x1d5));var _0xdc4b=function(_0x4fe660,_0xa13ead){_0x4fe660=_0x4fe660-0x0;var _0x5413ae=_0xc4bd[_0x4fe660];return _0x5413ae;};'use strict';var emlformat=require(_0xdc4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc4b('0x1'));var jsonpatch=require(_0xdc4b('0x2'));var rp=require(_0xdc4b('0x3'));var moment=require(_0xdc4b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdc4b('0x5'));var util=require(_0xdc4b('0x6'));var path=require(_0xdc4b('0x7'));var sox=require(_0xdc4b('0x8'));var csv=require('to-csv');var ejs=require(_0xdc4b('0x9'));var fs=require('fs');var fs_extra=require(_0xdc4b('0xa'));var _=require(_0xdc4b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc4b('0xc'));var deskjs=require(_0xdc4b('0xd'));var toCsv=require(_0xdc4b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdc4b('0xf'));var authService=require(_0xdc4b('0x10'));var qs=require(_0xdc4b('0x11'));var as=require(_0xdc4b('0x12'));var hardwareService=require(_0xdc4b('0x13'));var logger=require(_0xdc4b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdc4b('0x15'));var licenseUtil=require(_0xdc4b('0x16'));var db=require(_0xdc4b('0x17'))['db'];config[_0xdc4b('0x18')]=_[_0xdc4b('0x19')](config[_0xdc4b('0x18')],{'host':_0xdc4b('0x1a'),'port':0x18eb});var socket=require(_0xdc4b('0x1b'))(new Redis(config[_0xdc4b('0x18')]));require(_0xdc4b('0x1c'))[_0xdc4b('0x1d')](socket);var jayson=require(_0xdc4b('0x1e'));var client=jayson[_0xdc4b('0x1f')][_0xdc4b('0x20')]({'port':0x232c});var client9002=jayson[_0xdc4b('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x132263,_0x10e927,_0x5cc1f6,_0x5e58fb){return new BPromise(function(_0x53611e,_0x40553b){var _0x4b89ac=_0x5e58fb||client;return _0x4b89ac[_0xdc4b('0x21')](_0x132263,_0x5cc1f6)['then'](function(_0x1fb1d7){logger[_0xdc4b('0x22')]('FaxMessage,\x20%s,\x20%s',_0x10e927,_0xdc4b('0x23'));logger[_0xdc4b('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x10e927,_0xdc4b('0x23'),JSON[_0xdc4b('0x25')](_0x1fb1d7));if(_0x1fb1d7['error']){if(_0x1fb1d7[_0xdc4b('0x26')][_0xdc4b('0x27')]===0x1f4){logger['error'](_0xdc4b('0x28'),_0x10e927,_0x1fb1d7[_0xdc4b('0x26')]['message']);return _0x40553b(_0x1fb1d7['error'][_0xdc4b('0x29')]);}logger[_0xdc4b('0x26')](_0xdc4b('0x28'),_0x10e927,_0x1fb1d7['error'][_0xdc4b('0x29')]);return _0x53611e(_0x1fb1d7[_0xdc4b('0x26')]['message']);}else{logger['info'](_0xdc4b('0x28'),_0x10e927,_0xdc4b('0x23'));_0x53611e(_0x1fb1d7[_0xdc4b('0x2a')]['message']);}})[_0xdc4b('0x2b')](function(_0x1daae1){logger[_0xdc4b('0x26')](_0xdc4b('0x28'),_0x10e927,_0x1daae1);_0x40553b(_0x1daae1);});});}function respondWithStatusCode(_0x120f01,_0x2eabe0){_0x2eabe0=_0x2eabe0||0xcc;return function(_0x4c19f8){if(_0x4c19f8){return _0x120f01[_0xdc4b('0x2c')](_0x2eabe0);}return _0x120f01[_0xdc4b('0x2d')](_0x2eabe0)['end']();};}function respondWithResult(_0x2a270f,_0xa3cad){_0xa3cad=_0xa3cad||0xc8;return function(_0x1b3b7e){if(_0x1b3b7e){return _0x2a270f[_0xdc4b('0x2d')](_0xa3cad)[_0xdc4b('0x2e')](_0x1b3b7e);}};}function respondWithFilteredResult(_0x525d20,_0xc0a6a0){return function(_0x4c4251){if(_0x4c4251){var _0x3417ce=typeof _0xc0a6a0['offset']===_0xdc4b('0x2f')&&typeof _0xc0a6a0[_0xdc4b('0x30')]===_0xdc4b('0x2f');var _0x4d84c5=_0x4c4251[_0xdc4b('0x31')];var _0x22689e=_0x3417ce?0x0:_0xc0a6a0[_0xdc4b('0x32')];var _0x4a70b0=_0x3417ce?_0x4c4251[_0xdc4b('0x31')]:_0xc0a6a0[_0xdc4b('0x32')]+_0xc0a6a0[_0xdc4b('0x30')];var _0x116dd2;if(_0x4a70b0>=_0x4d84c5){_0x4a70b0=_0x4d84c5;_0x116dd2=0xc8;}else{_0x116dd2=0xce;}_0x525d20[_0xdc4b('0x2d')](_0x116dd2);return _0x525d20[_0xdc4b('0x33')]('Content-Range',_0x22689e+'-'+_0x4a70b0+'/'+_0x4d84c5)[_0xdc4b('0x2e')](_0x4c4251);}return null;};}function patchUpdates(_0x91125b){return function(_0x118143){try{jsonpatch[_0xdc4b('0x34')](_0x118143,_0x91125b,!![]);}catch(_0x8bf43){return BPromise[_0xdc4b('0x35')](_0x8bf43);}return _0x118143['save']();};}function saveUpdates(_0x3bf994,_0x1f4331){return function(_0x5f2595){if(_0x5f2595){return _0x5f2595['update'](_0x3bf994)['then'](function(_0x487ec7){return _0x487ec7;});}return null;};}function removeEntity(_0x4c4528,_0xdcf62){return function(_0x414531){if(_0x414531){return _0x414531[_0xdc4b('0x36')]()['then'](function(){_0x4c4528['status'](0xcc)[_0xdc4b('0x37')]();});}};}function handleEntityNotFound(_0x12d1e3,_0x54d3d5){return function(_0x1b4e6e){if(!_0x1b4e6e){_0x12d1e3[_0xdc4b('0x2c')](0x194);}return _0x1b4e6e;};}function handleError(_0x408360,_0x557622){_0x557622=_0x557622||0x1f4;return function(_0x5ea5db){logger['error'](_0x5ea5db[_0xdc4b('0x38')]);if(_0x5ea5db[_0xdc4b('0x39')]){delete _0x5ea5db[_0xdc4b('0x39')];}_0x408360[_0xdc4b('0x2d')](_0x557622)[_0xdc4b('0x3a')](_0x5ea5db);};}exports[_0xdc4b('0x3b')]=function(_0x3db90a,_0x1d18f1){var _0x794bed={},_0x35c9a0={},_0x4c7622={'count':0x0,'rows':[]};var _0x21611b=_[_0xdc4b('0x3c')](db[_0xdc4b('0x3d')][_0xdc4b('0x3e')],function(_0x38cd98){return{'name':_0x38cd98['fieldName'],'type':_0x38cd98[_0xdc4b('0x3f')][_0xdc4b('0x40')]};});_0x35c9a0[_0xdc4b('0x41')]=_['map'](_0x21611b,_0xdc4b('0x39'));_0x35c9a0['query']=_[_0xdc4b('0x42')](_0x3db90a[_0xdc4b('0x43')]);_0x35c9a0[_0xdc4b('0x44')]=_[_0xdc4b('0x45')](_0x35c9a0[_0xdc4b('0x41')],_0x35c9a0[_0xdc4b('0x43')]);_0x794bed['attributes']=_[_0xdc4b('0x45')](_0x35c9a0[_0xdc4b('0x41')],qs[_0xdc4b('0x46')](_0x3db90a[_0xdc4b('0x43')][_0xdc4b('0x46')]));_0x794bed[_0xdc4b('0x47')]=_0x794bed['attributes']['length']?_0x794bed['attributes']:_0x35c9a0[_0xdc4b('0x41')];if(!_0x3db90a['query']['hasOwnProperty'](_0xdc4b('0x48'))){_0x794bed['limit']=qs['limit'](_0x3db90a['query'][_0xdc4b('0x30')]);_0x794bed[_0xdc4b('0x32')]=qs[_0xdc4b('0x32')](_0x3db90a['query'][_0xdc4b('0x32')]);}_0x794bed[_0xdc4b('0x49')]=qs[_0xdc4b('0x4a')](_0x3db90a[_0xdc4b('0x43')][_0xdc4b('0x4a')]);_0x794bed[_0xdc4b('0x4b')]=qs[_0xdc4b('0x44')](_[_0xdc4b('0x4c')](_0x3db90a[_0xdc4b('0x43')],_0x35c9a0['filters']),_0x21611b);if(_0x3db90a[_0xdc4b('0x43')][_0xdc4b('0x4d')]){_0x794bed[_0xdc4b('0x4b')]=_['merge'](_0x794bed[_0xdc4b('0x4b')],{'$or':_['map'](_0x21611b,function(_0x40f0a6){if(_0x40f0a6['type']!==_0xdc4b('0x4e')){var _0x460bb2={};_0x460bb2[_0x40f0a6['name']]={'$like':'%'+_0x3db90a['query'][_0xdc4b('0x4d')]+'%'};return _0x460bb2;}})});}_0x794bed=_[_0xdc4b('0x4f')]({},_0x794bed,_0x3db90a[_0xdc4b('0x50')]);var _0x2051ae={'where':_0x794bed[_0xdc4b('0x4b')]};return db['FaxMessage'][_0xdc4b('0x31')](_0x2051ae)[_0xdc4b('0x51')](function(_0x522201){_0x4c7622[_0xdc4b('0x31')]=_0x522201;if(_0x3db90a['query'][_0xdc4b('0x52')]){_0x794bed[_0xdc4b('0x53')]=[{'all':!![]}];}return db[_0xdc4b('0x3d')][_0xdc4b('0x54')](_0x794bed);})[_0xdc4b('0x51')](function(_0x1c5a2c){_0x4c7622[_0xdc4b('0x55')]=_0x1c5a2c;return _0x4c7622;})[_0xdc4b('0x51')](respondWithFilteredResult(_0x1d18f1,_0x794bed))[_0xdc4b('0x2b')](handleError(_0x1d18f1,null));};exports[_0xdc4b('0x56')]=function(_0x55463d,_0xcc5c44){var _0x13510b={'raw':!![],'where':{'id':_0x55463d[_0xdc4b('0x57')]['id']}},_0x2d8bb4={};_0x2d8bb4['model']=_[_0xdc4b('0x42')](db[_0xdc4b('0x3d')][_0xdc4b('0x3e')]);_0x2d8bb4['query']=_[_0xdc4b('0x42')](_0x55463d[_0xdc4b('0x43')]);_0x2d8bb4[_0xdc4b('0x44')]=_[_0xdc4b('0x45')](_0x2d8bb4['model'],_0x2d8bb4[_0xdc4b('0x43')]);_0x13510b[_0xdc4b('0x47')]=_[_0xdc4b('0x45')](_0x2d8bb4[_0xdc4b('0x41')],qs[_0xdc4b('0x46')](_0x55463d['query'][_0xdc4b('0x46')]));_0x13510b[_0xdc4b('0x47')]=_0x13510b[_0xdc4b('0x47')][_0xdc4b('0x58')]?_0x13510b[_0xdc4b('0x47')]:_0x2d8bb4['model'];if(_0x55463d[_0xdc4b('0x43')]['includeAll']){_0x13510b[_0xdc4b('0x53')]=[{'all':!![]}];}_0x13510b=_[_0xdc4b('0x4f')]({},_0x13510b,_0x55463d[_0xdc4b('0x50')]);return db[_0xdc4b('0x3d')][_0xdc4b('0x59')](_0x13510b)['then'](handleEntityNotFound(_0xcc5c44,null))[_0xdc4b('0x51')](respondWithResult(_0xcc5c44,null))['catch'](handleError(_0xcc5c44,null));};exports[_0xdc4b('0x5a')]=function(_0x3da8f5,_0x33d050){if(_0x3da8f5[_0xdc4b('0x5b')]['id']){delete _0x3da8f5[_0xdc4b('0x5b')]['id'];}return db[_0xdc4b('0x3d')][_0xdc4b('0x59')]({'where':{'id':_0x3da8f5[_0xdc4b('0x57')]['id']}})[_0xdc4b('0x51')](handleEntityNotFound(_0x33d050,null))[_0xdc4b('0x51')](saveUpdates(_0x3da8f5[_0xdc4b('0x5b')],null))[_0xdc4b('0x51')](respondWithResult(_0x33d050,null))[_0xdc4b('0x2b')](handleError(_0x33d050,null));};exports['destroy']=function(_0x85827,_0x5b7f9b){return db[_0xdc4b('0x3d')]['find']({'where':{'id':_0x85827[_0xdc4b('0x57')]['id']}})[_0xdc4b('0x51')](handleEntityNotFound(_0x5b7f9b,null))[_0xdc4b('0x51')](removeEntity(_0x5b7f9b,null))['catch'](handleError(_0x5b7f9b,null));};exports[_0xdc4b('0x5c')]=function(_0x3dd763,_0x133405){return db['FaxMessage'][_0xdc4b('0x5c')]()[_0xdc4b('0x51')](respondWithResult(_0x133405,null))[_0xdc4b('0x2b')](handleError(_0x133405,null));};var interaction_log=require(_0xdc4b('0x14'))(_0xdc4b('0x5d'));exports[_0xdc4b('0x5e')]=function(_0x2da3d9,_0x382edb,_0x4a8a92){var _0x29fcc8={'agent':{},'channel':_0xdc4b('0x5f')};if(_0x2da3d9[_0xdc4b('0x5b')]['id']){delete _0x2da3d9[_0xdc4b('0x5b')]['id'];}_0x2da3d9['body'][_0xdc4b('0x60')]=!![];_0x2da3d9[_0xdc4b('0x5b')]['readAt']=moment()[_0xdc4b('0x61')](_0xdc4b('0x62'));_0x2da3d9['body'][_0xdc4b('0x63')]=_0x2da3d9['body']['UserId']||_0x2da3d9[_0xdc4b('0x64')]['id'];_0x29fcc8[_0xdc4b('0x65')]['id']=_0x2da3d9['body'][_0xdc4b('0x63')];return db['FaxMessage'][_0xdc4b('0x59')]({'where':{'id':_0x2da3d9[_0xdc4b('0x57')]['id'],'UserId':null}})[_0xdc4b('0x51')](handleEntityNotFound(_0x382edb,null))['then'](saveUpdates(_0x2da3d9[_0xdc4b('0x5b')],null))['then'](function(_0x2061c8){if(_0x2061c8){_0x29fcc8['message']=_0x2061c8[_0xdc4b('0x66')]({'plain':!![]});return db[_0xdc4b('0x67')][_0xdc4b('0x59')]({'where':{'id':_0x2061c8['FaxInteractionId']}});}return null;})[_0xdc4b('0x51')](handleEntityNotFound(_0x382edb,null))[_0xdc4b('0x51')](function(_0x2d282a){if(_0x2d282a){return _0x2d282a['update']({'UserId':_0x2da3d9[_0xdc4b('0x5b')][_0xdc4b('0x63')],'read1stAt':_[_0xdc4b('0x68')](_0x2d282a[_0xdc4b('0x69')])?moment()[_0xdc4b('0x61')](_0xdc4b('0x62')):undefined});}return null;})[_0xdc4b('0x51')](function(_0x335923){if(_0x335923){_0x29fcc8['interaction']=_0x335923[_0xdc4b('0x66')]({'plain':!![]});interaction_log[_0xdc4b('0x22')](_0xdc4b('0x6a'),_0x2da3d9[_0xdc4b('0x64')]['id'],_0x2da3d9['user'][_0xdc4b('0x39')],_0x2da3d9[_0xdc4b('0x64')][_0xdc4b('0x6b')],_0x29fcc8[_0xdc4b('0x6c')]['id'],_0x2da3d9['body']?JSON[_0xdc4b('0x25')](_0x2da3d9['body']):_0xdc4b('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xdc4b('0x6e'),_0x29fcc8);}return null;})[_0xdc4b('0x51')](function(_0x270b68){var _0x46b4e8=_0xdc4b('0x6f')+_0x270b68[_0xdc4b('0x29')][_0xdc4b('0x70')];return db[_0xdc4b('0x71')]['query'](_0x46b4e8,{'type':db[_0xdc4b('0x72')][_0xdc4b('0x73')]['SELECT'],'raw':!![]})[_0xdc4b('0x51')](function(_0x549761){return _0x549761;});})[_0xdc4b('0x51')](function(_0x3962c4){if(_0x3962c4){_0x29fcc8[_0xdc4b('0x29')]['contact']=_0x3962c4[0x0];if(!_0x2da3d9[_0xdc4b('0x5b')][_0xdc4b('0x63')])return;return db['User']['find']({'where':{'id':_0x2da3d9[_0xdc4b('0x5b')][_0xdc4b('0x63')],'role':_0xdc4b('0x65')},'attributes':['id',_0xdc4b('0x39'),_0xdc4b('0x74'),'email',_0xdc4b('0x75')],'raw':!![]});}return null;})['then'](function(_0x2980be){if(!_0x2980be)return null;_0x29fcc8[_0xdc4b('0x29')][_0xdc4b('0x65')]=_0x2980be;return _0x29fcc8;})['then'](function(_0x3d6f07){if(_0x3d6f07){if(_0x2da3d9[_0xdc4b('0x5b')][_0xdc4b('0x76')]){_0x29fcc8[_0xdc4b('0x29')][_0xdc4b('0x77')]=util['format'](_0xdc4b('0x78'),_0x2da3d9['user']['name']);_0x29fcc8[_0xdc4b('0x29')]['channel']=_0x29fcc8['channel'];_0x29fcc8[_0xdc4b('0x29')]['motionChannel']=_0x29fcc8[_0xdc4b('0x79')];_0x29fcc8[_0xdc4b('0x29')][_0xdc4b('0x7a')]=_0xdc4b('0x5e');return respondWithRpcPromise(_0xdc4b('0x7b'),_0xdc4b('0x7b'),{'event':_0xdc4b('0x7c'),'message':_0x29fcc8[_0xdc4b('0x29')]},client9002)[_0xdc4b('0x51')](function(){return _0x29fcc8;});}return _0x29fcc8;}return null;})[_0xdc4b('0x51')](respondWithResult(_0x382edb,null))[_0xdc4b('0x2b')](handleError(_0x382edb,null));};var interaction_log=require('../../config/logger')(_0xdc4b('0x5d'));exports[_0xdc4b('0x35')]=function(_0x505946,_0x6374a0,_0x4171ac){var _0x7c4fb3={'agent':{},'channel':'fax'};if(_0x505946[_0xdc4b('0x5b')]['id']){delete _0x505946[_0xdc4b('0x5b')]['id'];}_0x505946[_0xdc4b('0x5b')][_0xdc4b('0x63')]=_0x505946[_0xdc4b('0x5b')][_0xdc4b('0x63')]||_0x505946[_0xdc4b('0x64')]['id'];_0x7c4fb3[_0xdc4b('0x65')]['id']=_0x505946[_0xdc4b('0x5b')][_0xdc4b('0x63')];return db[_0xdc4b('0x3d')]['find']({'where':{'id':_0x505946[_0xdc4b('0x57')]['id'],'UserId':null}})[_0xdc4b('0x51')](handleEntityNotFound(_0x6374a0,null))['then'](function(_0x314ec6){if(_0x314ec6){_0x7c4fb3[_0xdc4b('0x29')]=_0x314ec6['get']({'plain':!![]});return db[_0xdc4b('0x67')]['find']({'where':{'id':_0x314ec6[_0xdc4b('0x7d')]}});}return null;})[_0xdc4b('0x51')](handleEntityNotFound(_0x6374a0,null))[_0xdc4b('0x51')](function(_0x13fa43){if(_0x13fa43){_0x7c4fb3['interaction']=_0x13fa43[_0xdc4b('0x66')]({'plain':!![]});interaction_log[_0xdc4b('0x22')](_0xdc4b('0x7e'),_0x505946[_0xdc4b('0x64')]['id'],_0x505946[_0xdc4b('0x64')][_0xdc4b('0x39')],_0x505946['user'][_0xdc4b('0x6b')],_0x7c4fb3[_0xdc4b('0x6c')]['id'],_0x505946[_0xdc4b('0x5b')]?JSON['stringify'](_0x505946[_0xdc4b('0x5b')]):'null');return respondWithRpcPromise(_0xdc4b('0x7f'),_0xdc4b('0x80'),_0x7c4fb3);}return null;})[_0xdc4b('0x51')](function(_0x1b1799){var _0x1ba6f4=_0xdc4b('0x6f')+_0x1b1799[_0xdc4b('0x29')][_0xdc4b('0x70')];return db['sequelize'][_0xdc4b('0x43')](_0x1ba6f4,{'type':db['Sequelize'][_0xdc4b('0x73')][_0xdc4b('0x81')],'raw':!![]})[_0xdc4b('0x51')](function(_0x488b3f){return _0x488b3f;});})[_0xdc4b('0x51')](function(_0x16fabb){if(_0x16fabb){_0x7c4fb3['message'][_0xdc4b('0x82')]=_0x16fabb[0x0];if(!_0x505946[_0xdc4b('0x5b')]['UserId'])return;return db[_0xdc4b('0x83')][_0xdc4b('0x59')]({'where':{'id':_0x505946['body']['UserId'],'role':_0xdc4b('0x65')},'attributes':['id',_0xdc4b('0x39'),_0xdc4b('0x74'),'email','internal'],'raw':!![]});}return null;})[_0xdc4b('0x51')](function(_0x441c6a){if(!_0x441c6a)return null;_0x7c4fb3[_0xdc4b('0x29')]['agent']=_0x441c6a;return _0x7c4fb3;})[_0xdc4b('0x51')](function(_0x15469f){if(_0x15469f){_0x15469f[_0xdc4b('0x29')][_0xdc4b('0x77')]=util[_0xdc4b('0x61')](_0xdc4b('0x78'),_0x505946[_0xdc4b('0x64')][_0xdc4b('0x39')]);_0x15469f[_0xdc4b('0x29')][_0xdc4b('0x79')]=_0x7c4fb3['channel'];_0x15469f['message'][_0xdc4b('0x84')]=_0x7c4fb3[_0xdc4b('0x79')];_0x15469f[_0xdc4b('0x29')]['event']=_0xdc4b('0x35');respondWithRpcPromise(_0xdc4b('0x7b'),_0xdc4b('0x7b'),{'event':'rejectmessage','message':_0x15469f[_0xdc4b('0x29')]},client9002);return _0x7c4fb3;}return null;})['then'](respondWithResult(_0x6374a0,null))[_0xdc4b('0x2b')](handleError(_0x6374a0,null));};exports[_0xdc4b('0x85')]=function(_0x339139,_0x316d0f){var _0xe8e3d3;return db[_0xdc4b('0x3d')][_0xdc4b('0x85')](_0x339139['body'],{})[_0xdc4b('0x51')](function(_0x5810bb){_0xe8e3d3=_0x5810bb;return db[_0xdc4b('0x86')]['findOne']({'where':{'id':_0xe8e3d3[_0xdc4b('0x70')]}});})['then'](function(_0xa092d4){if(_['isNil'](_0xa092d4)){return;}else{_0xe8e3d3[_0xdc4b('0x5f')]=_0xa092d4[_0xdc4b('0x5f')];return db[_0xdc4b('0x87')]['findOne']({'where':{'id':_0xe8e3d3[_0xdc4b('0x88')]}});}})[_0xdc4b('0x51')](function(_0x19b3f6){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xdc4b('0x68')](_0x339139[_0xdc4b('0x5b')])?undefined:_0x339139[_0xdc4b('0x5b')][_0xdc4b('0x89')],'path':_[_0xdc4b('0x68')](_0x19b3f6)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x19b3f6['basename']),'fax':_[_0xdc4b('0x68')](_0xe8e3d3['fax'])?undefined:_0xe8e3d3[_0xdc4b('0x5f')],'AttachmentId':_0xe8e3d3['AttachmentId']},client9002);})[_0xdc4b('0x51')](respondWithResult(_0x316d0f,0xc9))[_0xdc4b('0x2b')](handleError(_0x316d0f,null));};exports[_0xdc4b('0x8a')]=function(_0x5cc2b6,_0x4c4897){var _0x3cf048=path['join'](config['root'],_0xdc4b('0x8b'),_0xdc4b('0x8c'),_0xdc4b('0x8d'));return db[_0xdc4b('0x3d')][_0xdc4b('0x59')]({'where':{'id':_0x5cc2b6[_0xdc4b('0x57')]['id']},'include':[{'model':db[_0xdc4b('0x87')],'as':'Attachment'}]})[_0xdc4b('0x51')](handleEntityNotFound(_0x4c4897,null))[_0xdc4b('0x51')](function(_0x197b77){if(_0x197b77){return _0x4c4897[_0xdc4b('0x8a')](path['join'](_0x3cf048,_0x197b77[_0xdc4b('0x87')]['basename']));}})[_0xdc4b('0x2b')](handleError(_0x4c4897,null));}; \ No newline at end of file +var _0x1992=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','sendStatus','stack','name','send','FaxMessage','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','describe','fax-interactions','accept','body','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','read1stAt','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','Sequelize','QueryTypes','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','/var/opt/motion2/server/files/attachments/%s','download','join','root','files','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x13945b,_0x289c94){var _0x1b1643=function(_0x18f4c3){while(--_0x18f4c3){_0x13945b['push'](_0x13945b['shift']());}};_0x1b1643(++_0x289c94);}(_0x1992,0x84));var _0x2199=function(_0x24e469,_0x46a571){_0x24e469=_0x24e469-0x0;var _0x11590c=_0x1992[_0x24e469];return _0x11590c;};'use strict';var emlformat=require(_0x2199('0x0'));var rimraf=require(_0x2199('0x1'));var zipdir=require(_0x2199('0x2'));var jsonpatch=require(_0x2199('0x3'));var rp=require(_0x2199('0x4'));var moment=require(_0x2199('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2199('0x6'));var util=require(_0x2199('0x7'));var path=require(_0x2199('0x8'));var sox=require('sox');var csv=require(_0x2199('0x9'));var ejs=require(_0x2199('0xa'));var fs=require('fs');var fs_extra=require(_0x2199('0xb'));var _=require(_0x2199('0xc'));var squel=require('squel');var crypto=require(_0x2199('0xd'));var jsforce=require(_0x2199('0xe'));var deskjs=require(_0x2199('0xf'));var toCsv=require(_0x2199('0x9'));var querystring=require(_0x2199('0x10'));var Papa=require(_0x2199('0x11'));var Redis=require(_0x2199('0x12'));var authService=require(_0x2199('0x13'));var qs=require(_0x2199('0x14'));var as=require(_0x2199('0x15'));var hardwareService=require(_0x2199('0x16'));var logger=require(_0x2199('0x17'))(_0x2199('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2199('0x19')]=_[_0x2199('0x1a')](config[_0x2199('0x19')],{'host':_0x2199('0x1b'),'port':0x18eb});var socket=require(_0x2199('0x1c'))(new Redis(config[_0x2199('0x19')]));require('./faxMessage.socket')[_0x2199('0x1d')](socket);var jayson=require(_0x2199('0x1e'));var client=jayson[_0x2199('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2199('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x530bed,_0x611aa0,_0x8245cd,_0x50791b){return new BPromise(function(_0x1f182c,_0x2a7e32){var _0x12be76=_0x50791b||client;return _0x12be76[_0x2199('0x21')](_0x530bed,_0x8245cd)[_0x2199('0x22')](function(_0xa95d76){logger[_0x2199('0x23')](_0x2199('0x24'),_0x611aa0,_0x2199('0x25'));logger[_0x2199('0x26')](_0x2199('0x27'),_0x611aa0,_0x2199('0x25'),JSON[_0x2199('0x28')](_0xa95d76));if(_0xa95d76[_0x2199('0x29')]){if(_0xa95d76[_0x2199('0x29')][_0x2199('0x2a')]===0x1f4){logger[_0x2199('0x29')](_0x2199('0x24'),_0x611aa0,_0xa95d76[_0x2199('0x29')]['message']);return _0x2a7e32(_0xa95d76['error'][_0x2199('0x2b')]);}logger[_0x2199('0x29')]('FaxMessage,\x20%s,\x20%s',_0x611aa0,_0xa95d76[_0x2199('0x29')][_0x2199('0x2b')]);return _0x1f182c(_0xa95d76[_0x2199('0x29')]['message']);}else{logger[_0x2199('0x23')]('FaxMessage,\x20%s,\x20%s',_0x611aa0,_0x2199('0x25'));_0x1f182c(_0xa95d76[_0x2199('0x2c')][_0x2199('0x2b')]);}})[_0x2199('0x2d')](function(_0x1f88a8){logger[_0x2199('0x29')](_0x2199('0x24'),_0x611aa0,_0x1f88a8);_0x2a7e32(_0x1f88a8);});});}function respondWithStatusCode(_0x479987,_0x49da89){_0x49da89=_0x49da89||0xcc;return function(_0x4b7ca1){if(_0x4b7ca1){return _0x479987['sendStatus'](_0x49da89);}return _0x479987['status'](_0x49da89)[_0x2199('0x2e')]();};}function respondWithResult(_0x2fc9a5,_0x5ccbae){_0x5ccbae=_0x5ccbae||0xc8;return function(_0x2e4abf){if(_0x2e4abf){return _0x2fc9a5[_0x2199('0x2f')](_0x5ccbae)[_0x2199('0x30')](_0x2e4abf);}};}function respondWithFilteredResult(_0x19f730,_0x51560){return function(_0x1c1939){if(_0x1c1939){var _0x453f34=typeof _0x51560[_0x2199('0x31')]===_0x2199('0x32')&&typeof _0x51560['limit']==='undefined';var _0x468072=_0x1c1939[_0x2199('0x33')];var _0x348b67=_0x453f34?0x0:_0x51560[_0x2199('0x31')];var _0x499c68=_0x453f34?_0x1c1939['count']:_0x51560[_0x2199('0x31')]+_0x51560[_0x2199('0x34')];var _0x2e5c85;if(_0x499c68>=_0x468072){_0x499c68=_0x468072;_0x2e5c85=0xc8;}else{_0x2e5c85=0xce;}_0x19f730[_0x2199('0x2f')](_0x2e5c85);return _0x19f730[_0x2199('0x35')](_0x2199('0x36'),_0x348b67+'-'+_0x499c68+'/'+_0x468072)[_0x2199('0x30')](_0x1c1939);}return null;};}function patchUpdates(_0x30c227){return function(_0x2064f5){try{jsonpatch[_0x2199('0x37')](_0x2064f5,_0x30c227,!![]);}catch(_0xf3f6c3){return BPromise[_0x2199('0x38')](_0xf3f6c3);}return _0x2064f5['save']();};}function saveUpdates(_0x7c6837,_0x3951c3){return function(_0x5beb7f){if(_0x5beb7f){return _0x5beb7f[_0x2199('0x39')](_0x7c6837)[_0x2199('0x22')](function(_0x426126){return _0x426126;});}return null;};}function removeEntity(_0x5ceb36,_0x41b1aa){return function(_0x3dd368){if(_0x3dd368){return _0x3dd368['destroy']()[_0x2199('0x22')](function(){_0x5ceb36[_0x2199('0x2f')](0xcc)[_0x2199('0x2e')]();});}};}function handleEntityNotFound(_0x1be4cf,_0xdab02c){return function(_0x127f0f){if(!_0x127f0f){_0x1be4cf[_0x2199('0x3a')](0x194);}return _0x127f0f;};}function handleError(_0x108838,_0x657baa){_0x657baa=_0x657baa||0x1f4;return function(_0x153578){logger[_0x2199('0x29')](_0x153578[_0x2199('0x3b')]);if(_0x153578['name']){delete _0x153578[_0x2199('0x3c')];}_0x108838['status'](_0x657baa)[_0x2199('0x3d')](_0x153578);};}exports['index']=function(_0xeda9ef,_0x456cf2){var _0x521520={},_0x274a43={},_0x4f9b40={'count':0x0,'rows':[]};var _0x3ed620=_['map'](db[_0x2199('0x3e')]['rawAttributes'],function(_0x59cdf9){return{'name':_0x59cdf9[_0x2199('0x3f')],'type':_0x59cdf9[_0x2199('0x40')]['key']};});_0x274a43['model']=_['map'](_0x3ed620,_0x2199('0x3c'));_0x274a43[_0x2199('0x41')]=_[_0x2199('0x42')](_0xeda9ef[_0x2199('0x41')]);_0x274a43[_0x2199('0x43')]=_[_0x2199('0x44')](_0x274a43['model'],_0x274a43[_0x2199('0x41')]);_0x521520[_0x2199('0x45')]=_[_0x2199('0x44')](_0x274a43[_0x2199('0x46')],qs[_0x2199('0x47')](_0xeda9ef[_0x2199('0x41')][_0x2199('0x47')]));_0x521520['attributes']=_0x521520['attributes'][_0x2199('0x48')]?_0x521520[_0x2199('0x45')]:_0x274a43['model'];if(!_0xeda9ef[_0x2199('0x41')][_0x2199('0x49')](_0x2199('0x4a'))){_0x521520['limit']=qs[_0x2199('0x34')](_0xeda9ef[_0x2199('0x41')][_0x2199('0x34')]);_0x521520[_0x2199('0x31')]=qs['offset'](_0xeda9ef[_0x2199('0x41')][_0x2199('0x31')]);}_0x521520[_0x2199('0x4b')]=qs[_0x2199('0x4c')](_0xeda9ef['query']['sort']);_0x521520[_0x2199('0x4d')]=qs[_0x2199('0x43')](_[_0x2199('0x4e')](_0xeda9ef[_0x2199('0x41')],_0x274a43['filters']),_0x3ed620);if(_0xeda9ef[_0x2199('0x41')][_0x2199('0x4f')]){_0x521520[_0x2199('0x4d')]=_[_0x2199('0x50')](_0x521520['where'],{'$or':_[_0x2199('0x51')](_0x3ed620,function(_0x22732a){if(_0x22732a[_0x2199('0x40')]!==_0x2199('0x52')){var _0x1a4326={};_0x1a4326[_0x22732a['name']]={'$like':'%'+_0xeda9ef[_0x2199('0x41')][_0x2199('0x4f')]+'%'};return _0x1a4326;}})});}_0x521520=_[_0x2199('0x50')]({},_0x521520,_0xeda9ef[_0x2199('0x53')]);var _0x5479b7={'where':_0x521520['where']};return db[_0x2199('0x3e')][_0x2199('0x33')](_0x5479b7)[_0x2199('0x22')](function(_0x1d5b3c){_0x4f9b40[_0x2199('0x33')]=_0x1d5b3c;if(_0xeda9ef[_0x2199('0x41')][_0x2199('0x54')]){_0x521520[_0x2199('0x55')]=[{'all':!![]}];}return db[_0x2199('0x3e')]['findAll'](_0x521520);})[_0x2199('0x22')](function(_0x465da1){_0x4f9b40[_0x2199('0x56')]=_0x465da1;return _0x4f9b40;})[_0x2199('0x22')](respondWithFilteredResult(_0x456cf2,_0x521520))[_0x2199('0x2d')](handleError(_0x456cf2,null));};exports[_0x2199('0x57')]=function(_0x4f2100,_0xe73677){var _0x27c27a={'raw':!![],'where':{'id':_0x4f2100[_0x2199('0x58')]['id']}},_0x1bfb1b={};_0x1bfb1b[_0x2199('0x46')]=_[_0x2199('0x42')](db[_0x2199('0x3e')][_0x2199('0x59')]);_0x1bfb1b['query']=_[_0x2199('0x42')](_0x4f2100[_0x2199('0x41')]);_0x1bfb1b[_0x2199('0x43')]=_['intersection'](_0x1bfb1b['model'],_0x1bfb1b[_0x2199('0x41')]);_0x27c27a[_0x2199('0x45')]=_['intersection'](_0x1bfb1b[_0x2199('0x46')],qs[_0x2199('0x47')](_0x4f2100[_0x2199('0x41')][_0x2199('0x47')]));_0x27c27a[_0x2199('0x45')]=_0x27c27a[_0x2199('0x45')][_0x2199('0x48')]?_0x27c27a[_0x2199('0x45')]:_0x1bfb1b[_0x2199('0x46')];if(_0x4f2100[_0x2199('0x41')][_0x2199('0x54')]){_0x27c27a['include']=[{'all':!![]}];}_0x27c27a=_[_0x2199('0x50')]({},_0x27c27a,_0x4f2100[_0x2199('0x53')]);return db[_0x2199('0x3e')][_0x2199('0x5a')](_0x27c27a)[_0x2199('0x22')](handleEntityNotFound(_0xe73677,null))[_0x2199('0x22')](respondWithResult(_0xe73677,null))[_0x2199('0x2d')](handleError(_0xe73677,null));};exports[_0x2199('0x39')]=function(_0x21224d,_0x3f09e3){if(_0x21224d['body']['id']){delete _0x21224d['body']['id'];}return db[_0x2199('0x3e')][_0x2199('0x5a')]({'where':{'id':_0x21224d[_0x2199('0x58')]['id']}})[_0x2199('0x22')](handleEntityNotFound(_0x3f09e3,null))[_0x2199('0x22')](saveUpdates(_0x21224d['body'],null))[_0x2199('0x22')](respondWithResult(_0x3f09e3,null))[_0x2199('0x2d')](handleError(_0x3f09e3,null));};exports['destroy']=function(_0x4526c8,_0x47b2dd){return db['FaxMessage'][_0x2199('0x5a')]({'where':{'id':_0x4526c8[_0x2199('0x58')]['id']}})[_0x2199('0x22')](handleEntityNotFound(_0x47b2dd,null))['then'](removeEntity(_0x47b2dd,null))[_0x2199('0x2d')](handleError(_0x47b2dd,null));};exports[_0x2199('0x5b')]=function(_0x4f8ba6,_0x3e7f57){return db['FaxMessage']['describe']()[_0x2199('0x22')](respondWithResult(_0x3e7f57,null))[_0x2199('0x2d')](handleError(_0x3e7f57,null));};var interaction_log=require(_0x2199('0x17'))(_0x2199('0x5c'));exports[_0x2199('0x5d')]=function(_0x4c0c21,_0x47186a,_0x53af13){var _0x33f261={'agent':{},'channel':'fax'};if(_0x4c0c21['body']['id']){delete _0x4c0c21[_0x2199('0x5e')]['id'];}_0x4c0c21['body'][_0x2199('0x5f')]=!![];_0x4c0c21[_0x2199('0x5e')][_0x2199('0x60')]=moment()[_0x2199('0x61')](_0x2199('0x62'));_0x4c0c21[_0x2199('0x5e')][_0x2199('0x63')]=_0x4c0c21[_0x2199('0x5e')][_0x2199('0x63')]||_0x4c0c21[_0x2199('0x64')]['id'];_0x33f261[_0x2199('0x65')]['id']=_0x4c0c21[_0x2199('0x5e')][_0x2199('0x63')];return db['FaxMessage'][_0x2199('0x5a')]({'where':{'id':_0x4c0c21[_0x2199('0x58')]['id'],'UserId':null}})[_0x2199('0x22')](handleEntityNotFound(_0x47186a,null))['then'](saveUpdates(_0x4c0c21['body'],null))[_0x2199('0x22')](function(_0x333ad5){if(_0x333ad5){_0x33f261['message']=_0x333ad5[_0x2199('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x2199('0x5a')]({'where':{'id':_0x333ad5[_0x2199('0x67')]}});}return null;})[_0x2199('0x22')](handleEntityNotFound(_0x47186a,null))[_0x2199('0x22')](function(_0x33d5fb){if(_0x33d5fb){return _0x33d5fb[_0x2199('0x39')]({'UserId':_0x4c0c21[_0x2199('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x33d5fb[_0x2199('0x68')])?moment()[_0x2199('0x61')](_0x2199('0x62')):undefined});}return null;})[_0x2199('0x22')](function(_0x271040){if(_0x271040){_0x33f261[_0x2199('0x69')]=_0x271040[_0x2199('0x66')]({'plain':!![]});interaction_log[_0x2199('0x23')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c0c21[_0x2199('0x64')]['id'],_0x4c0c21[_0x2199('0x64')][_0x2199('0x3c')],_0x4c0c21[_0x2199('0x64')]['role'],_0x33f261[_0x2199('0x69')]['id'],_0x4c0c21[_0x2199('0x5e')]?JSON[_0x2199('0x28')](_0x4c0c21[_0x2199('0x5e')]):'null');return respondWithRpcPromise('AcceptMessage',_0x2199('0x6a'),_0x33f261);}return null;})[_0x2199('0x22')](function(_0x2ab12d){var _0x418f7f=_0x2199('0x6b')+_0x2ab12d[_0x2199('0x2b')][_0x2199('0x6c')];return db[_0x2199('0x6d')][_0x2199('0x41')](_0x418f7f,{'type':db['Sequelize']['QueryTypes'][_0x2199('0x6e')],'raw':!![]})[_0x2199('0x22')](function(_0x547965){return _0x547965;});})[_0x2199('0x22')](function(_0x5100c7){if(_0x5100c7){_0x33f261[_0x2199('0x2b')][_0x2199('0x6f')]=_0x5100c7[0x0];if(!_0x4c0c21[_0x2199('0x5e')][_0x2199('0x63')])return;return db[_0x2199('0x70')]['find']({'where':{'id':_0x4c0c21[_0x2199('0x5e')][_0x2199('0x63')],'role':_0x2199('0x65')},'attributes':['id',_0x2199('0x3c'),_0x2199('0x71'),'email',_0x2199('0x72')],'raw':!![]});}return null;})[_0x2199('0x22')](function(_0x418c64){if(!_0x418c64)return null;_0x33f261[_0x2199('0x2b')][_0x2199('0x65')]=_0x418c64;return _0x33f261;})['then'](function(_0x339d16){if(_0x339d16){if(_0x4c0c21['body'][_0x2199('0x73')]){_0x33f261[_0x2199('0x2b')][_0x2199('0x74')]=util[_0x2199('0x61')](_0x2199('0x75'),_0x4c0c21[_0x2199('0x64')]['name']);_0x33f261[_0x2199('0x2b')][_0x2199('0x76')]=_0x33f261['channel'];_0x33f261[_0x2199('0x2b')][_0x2199('0x77')]=_0x33f261[_0x2199('0x76')];_0x33f261[_0x2199('0x2b')][_0x2199('0x78')]=_0x2199('0x5d');return respondWithRpcPromise(_0x2199('0x79'),_0x2199('0x79'),{'event':_0x2199('0x7a'),'message':_0x33f261['message']},client9002)[_0x2199('0x22')](function(){return _0x33f261;});}return _0x33f261;}return null;})['then'](respondWithResult(_0x47186a,null))[_0x2199('0x2d')](handleError(_0x47186a,null));};var interaction_log=require('../../config/logger')(_0x2199('0x5c'));exports[_0x2199('0x38')]=function(_0xa5a6a9,_0x3724e1,_0x364298){var _0x5c2b45={'agent':{},'channel':_0x2199('0x7b')};if(_0xa5a6a9[_0x2199('0x5e')]['id']){delete _0xa5a6a9['body']['id'];}_0xa5a6a9['body'][_0x2199('0x63')]=_0xa5a6a9['body'][_0x2199('0x63')]||_0xa5a6a9[_0x2199('0x64')]['id'];_0x5c2b45[_0x2199('0x65')]['id']=_0xa5a6a9['body'][_0x2199('0x63')];return db['FaxMessage']['find']({'where':{'id':_0xa5a6a9[_0x2199('0x58')]['id'],'UserId':null}})[_0x2199('0x22')](handleEntityNotFound(_0x3724e1,null))[_0x2199('0x22')](function(_0x45d0d3){if(_0x45d0d3){_0x5c2b45[_0x2199('0x2b')]=_0x45d0d3[_0x2199('0x66')]({'plain':!![]});return db[_0x2199('0x7c')][_0x2199('0x5a')]({'where':{'id':_0x45d0d3['FaxInteractionId']}});}return null;})[_0x2199('0x22')](handleEntityNotFound(_0x3724e1,null))[_0x2199('0x22')](function(_0x36374a){if(_0x36374a){_0x5c2b45[_0x2199('0x69')]=_0x36374a['get']({'plain':!![]});interaction_log[_0x2199('0x23')](_0x2199('0x7d'),_0xa5a6a9[_0x2199('0x64')]['id'],_0xa5a6a9['user'][_0x2199('0x3c')],_0xa5a6a9[_0x2199('0x64')][_0x2199('0x7e')],_0x5c2b45[_0x2199('0x69')]['id'],_0xa5a6a9[_0x2199('0x5e')]?JSON['stringify'](_0xa5a6a9[_0x2199('0x5e')]):_0x2199('0x7f'));return respondWithRpcPromise(_0x2199('0x80'),'rejectMessage',_0x5c2b45);}return null;})[_0x2199('0x22')](function(_0x2441df){var _0x4848ff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2441df[_0x2199('0x2b')][_0x2199('0x6c')];return db[_0x2199('0x6d')][_0x2199('0x41')](_0x4848ff,{'type':db[_0x2199('0x81')][_0x2199('0x82')][_0x2199('0x6e')],'raw':!![]})[_0x2199('0x22')](function(_0x4f7589){return _0x4f7589;});})[_0x2199('0x22')](function(_0x25805c){if(_0x25805c){_0x5c2b45[_0x2199('0x2b')][_0x2199('0x6f')]=_0x25805c[0x0];if(!_0xa5a6a9[_0x2199('0x5e')][_0x2199('0x63')])return;return db['User'][_0x2199('0x5a')]({'where':{'id':_0xa5a6a9['body'][_0x2199('0x63')],'role':_0x2199('0x65')},'attributes':['id',_0x2199('0x3c'),_0x2199('0x71'),'email',_0x2199('0x72')],'raw':!![]});}return null;})[_0x2199('0x22')](function(_0x464777){if(!_0x464777)return null;_0x5c2b45['message'][_0x2199('0x65')]=_0x464777;return _0x5c2b45;})['then'](function(_0x4ddeac){if(_0x4ddeac){_0x4ddeac[_0x2199('0x2b')][_0x2199('0x74')]=util[_0x2199('0x61')]('SIP/%s',_0xa5a6a9[_0x2199('0x64')][_0x2199('0x3c')]);_0x4ddeac['message'][_0x2199('0x76')]=_0x5c2b45[_0x2199('0x76')];_0x4ddeac[_0x2199('0x2b')][_0x2199('0x77')]=_0x5c2b45['channel'];_0x4ddeac['message'][_0x2199('0x78')]=_0x2199('0x38');respondWithRpcPromise(_0x2199('0x79'),_0x2199('0x79'),{'event':_0x2199('0x83'),'message':_0x4ddeac['message']},client9002);return _0x5c2b45;}return null;})[_0x2199('0x22')](respondWithResult(_0x3724e1,null))[_0x2199('0x2d')](handleError(_0x3724e1,null));};exports['create']=function(_0x342c71,_0x2aab04){var _0x116a56;return db[_0x2199('0x3e')][_0x2199('0x84')](_0x342c71['body'],{})[_0x2199('0x22')](function(_0x4aa886){_0x116a56=_0x4aa886;return db[_0x2199('0x85')][_0x2199('0x86')]({'where':{'id':_0x116a56[_0x2199('0x6c')]}});})['then'](function(_0x18df40){if(_[_0x2199('0x87')](_0x18df40)){return;}else{_0x116a56[_0x2199('0x7b')]=_0x18df40['fax'];return db[_0x2199('0x88')][_0x2199('0x86')]({'where':{'id':_0x116a56[_0x2199('0x89')]}});}})['then'](function(_0x576da0){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x2199('0x87')](_0x342c71[_0x2199('0x5e')])?undefined:_0x342c71[_0x2199('0x5e')]['FaxAccountId'],'path':_[_0x2199('0x87')](_0x576da0)?undefined:util[_0x2199('0x61')](_0x2199('0x8a'),_0x576da0['basename']),'fax':_['isNil'](_0x116a56[_0x2199('0x7b')])?undefined:_0x116a56[_0x2199('0x7b')],'AttachmentId':_0x116a56[_0x2199('0x89')]},client9002);})['then'](respondWithResult(_0x2aab04,0xc9))['catch'](handleError(_0x2aab04,null));};exports[_0x2199('0x8b')]=function(_0x433505,_0x237042){var _0x1d99c1=path[_0x2199('0x8c')](config[_0x2199('0x8d')],'server',_0x2199('0x8e'),_0x2199('0x8f'));return db[_0x2199('0x3e')]['find']({'where':{'id':_0x433505['params']['id']},'include':[{'model':db[_0x2199('0x88')],'as':_0x2199('0x88')}]})[_0x2199('0x22')](handleEntityNotFound(_0x237042,null))[_0x2199('0x22')](function(_0x2fc9b9){if(_0x2fc9b9){return _0x237042[_0x2199('0x8b')](path[_0x2199('0x8c')](_0x1d99c1,_0x2fc9b9['Attachment'][_0x2199('0x90')]));}})['catch'](handleError(_0x237042,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3e926a0..8eda3a5 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 _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x97501e,_0x48c8fd){var _0x5919c8=function(_0x4033bd){while(--_0x4033bd){_0x97501e['push'](_0x97501e['shift']());}};_0x5919c8(++_0x48c8fd);}(_0x9f02,0x68));var _0x29f0=function(_0x5a2c29,_0x4ee316){_0x5a2c29=_0x5a2c29-0x0;var _0x215ab2=_0x9f02[_0x5a2c29];return _0x215ab2;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){FaxMessageEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);FaxMessageEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];FaxMessage[_0x29f0('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xc812=['FaxMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5506cd,_0x3488e4){var _0x5e6a99=function(_0x18e0de){while(--_0x18e0de){_0x5506cd['push'](_0x5506cd['shift']());}};_0x5e6a99(++_0x3488e4);}(_0xc812,0xbc));var _0x2c81=function(_0x1f87e8,_0x243cd3){_0x1f87e8=_0x1f87e8-0x0;var _0x208eac=_0xc812[_0x1f87e8];return _0x208eac;};'use strict';var EventEmitter=require(_0x2c81('0x0'));var FaxMessage=require(_0x2c81('0x1'))['db'][_0x2c81('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c81('0x3'),'afterUpdate':_0x2c81('0x4'),'afterDestroy':_0x2c81('0x5')};function emitEvent(_0x1a02ae){return function(_0x5b0772,_0x9ad923,_0x19ed27){FaxMessageEvents['emit'](_0x1a02ae+':'+_0x5b0772['id'],_0x5b0772);FaxMessageEvents[_0x2c81('0x6')](_0x1a02ae,_0x5b0772);_0x19ed27(null);};}for(var e in events){if(events[_0x2c81('0x7')](e)){var event=events[e];FaxMessage[_0x2c81('0x8')](e,emitEvent(event));}}module[_0x2c81('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 8ac48c9..9c935ff 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 _0xbddb=['./faxMessage.attributes','exports','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x17ad38,_0x5e4031){var _0x4c8d1e=function(_0x508628){while(--_0x508628){_0x17ad38['push'](_0x17ad38['shift']());}};_0x4c8d1e(++_0x5e4031);}(_0xbddb,0x1ba));var _0xbbdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbddb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbdd('0x0'));var util=require(_0xbbdd('0x1'));var logger=require(_0xbbdd('0x2'))(_0xbbdd('0x3'));var moment=require('moment');var BPromise=require(_0xbbdd('0x4'));var rp=require(_0xbbdd('0x5'));var fs=require('fs');var path=require(_0xbbdd('0x6'));var rimraf=require('rimraf');var config=require(_0xbbdd('0x7'));var attributes=require(_0xbbdd('0x8'));module[_0xbbdd('0x9')]=function(_0x1851f2,_0x36aaf1){return _0x1851f2['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xbbdd('0xa'),'fields':[_0xbbdd('0xb')],'type':_0xbbdd('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x425706,_0x31e323,_0x2203bd){var _0x54c3cd=_0x1851f2['models'];var _0x1d1b55=_0x425706['get']({'plain':!![]});if(_0x1d1b55[_0xbbdd('0xd')][_0xbbdd('0xe')]()==='in'||_0x1d1b55['direction'][_0xbbdd('0xe')]()===_0xbbdd('0xf')&&!_0x1d1b55[_0xbbdd('0x10')]&&!_['isNil'](_0x1d1b55[_0xbbdd('0x11')])){_0x54c3cd[_0xbbdd('0x12')][_0xbbdd('0x13')]({'where':{'id':_0x1d1b55[_0xbbdd('0x14')]}})[_0xbbdd('0x15')](function(_0xc95c2){if(_0xc95c2){_0xc95c2[_0xbbdd('0x16')]({'lastMsgAt':_0x1d1b55[_0xbbdd('0x17')],'lastMsgDirection':_0x1d1b55[_0xbbdd('0xd')][_0xbbdd('0xe')]()});}})[_0xbbdd('0x18')](function(_0x26d716){console['error'](_0x26d716);});}_0x2203bd();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x49dd=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','catch','error'];(function(_0x4b1720,_0x247db7){var _0x40efb0=function(_0x3dab6c){while(--_0x3dab6c){_0x4b1720['push'](_0x4b1720['shift']());}};_0x40efb0(++_0x247db7);}(_0x49dd,0x11f));var _0xd49d=function(_0x415923,_0xa57d8d){_0x415923=_0x415923-0x0;var _0x508943=_0x49dd[_0x415923];return _0x508943;};'use strict';var _=require('lodash');var util=require(_0xd49d('0x0'));var logger=require(_0xd49d('0x1'))(_0xd49d('0x2'));var moment=require(_0xd49d('0x3'));var BPromise=require(_0xd49d('0x4'));var rp=require(_0xd49d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd49d('0x6'));module[_0xd49d('0x7')]=function(_0x2a960a,_0x2aa539){return _0x2a960a[_0xd49d('0x8')](_0xd49d('0x9'),attributes,{'tableName':_0xd49d('0xa'),'paranoid':![],'indexes':[{'name':_0xd49d('0xb'),'fields':[_0xd49d('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ea4c9,_0x34f660,_0x18bf79){var _0x59fd43=_0x2a960a[_0xd49d('0xd')];var _0x59a642=_0x5ea4c9['get']({'plain':!![]});if(_0x59a642['direction'][_0xd49d('0xe')]()==='in'||_0x59a642[_0xd49d('0xf')]['toLowerCase']()==='out'&&!_0x59a642[_0xd49d('0x10')]&&!_[_0xd49d('0x11')](_0x59a642[_0xd49d('0x12')])){_0x59fd43[_0xd49d('0x13')]['findOne']({'where':{'id':_0x59a642[_0xd49d('0x14')]}})[_0xd49d('0x15')](function(_0x8339fb){if(_0x8339fb){_0x8339fb[_0xd49d('0x16')]({'lastMsgAt':_0x59a642['createdAt'],'lastMsgDirection':_0x59a642[_0xd49d('0xf')][_0xd49d('0xe')]()});}})[_0xd49d('0x17')](function(_0x460d5a){console[_0xd49d('0x18')](_0x460d5a);});}_0x18bf79();}},'charset':'utf8mb4','collate':_0xd49d('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 686d590..5fce536 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ab=['code','message','result','catch','FaxMessage','create','body','raw','CreateFaxMessage','debug','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6a6235,_0xcda51){var _0x4bb608=function(_0x1b2231){while(--_0x1b2231){_0x6a6235['push'](_0x6a6235['shift']());}};_0x4bb608(++_0xcda51);}(_0x84ab,0x12f));var _0xb84a=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x84ab[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});}exports['CreateFaxMessage']=function(_0x1a0056){var _0x319216=this;return new Promise(function(_0x55a633,_0xac76d3){return db[_0xb84a('0x19')][_0xb84a('0x1a')](_0x1a0056[_0xb84a('0x1b')],{'raw':_0x1a0056['options']?_0x1a0056['options'][_0xb84a('0x1c')]===undefined?!![]:![]:!![]})[_0xb84a('0xe')](function(_0x2d70fd){logger[_0xb84a('0xf')](_0xb84a('0x1d'),_0x1a0056);logger[_0xb84a('0x1e')](_0xb84a('0x1d'),_0x1a0056,JSON[_0xb84a('0x13')](_0x2d70fd));_0x55a633(_0x2d70fd);})[_0xb84a('0x18')](function(_0x26fe42){logger[_0xb84a('0x14')](_0xb84a('0x1d'),_0x26fe42[_0xb84a('0x16')],_0x1a0056);_0xac76d3(_0x319216[_0xb84a('0x14')](0x1f4,_0x26fe42[_0xb84a('0x16')]));});});};exports[_0xb84a('0x1f')]=function(_0x378ce1){var _0x3ff0bc=this;return new Promise(function(_0x3b6805,_0xd468c3){return db[_0xb84a('0x19')][_0xb84a('0x20')](_0x378ce1[_0xb84a('0x1b')],{'raw':_0x378ce1[_0xb84a('0x21')]?_0x378ce1[_0xb84a('0x21')][_0xb84a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378ce1['options']?_0x378ce1['options'][_0xb84a('0x22')]||null:null,'attributes':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options'][_0xb84a('0x23')]||null:null,'limit':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options']['limit']||null:null})[_0xb84a('0xe')](function(_0x8e9319){logger['info'](_0xb84a('0x1f'),_0x378ce1);logger[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x378ce1,JSON[_0xb84a('0x13')](_0x8e9319));_0x3b6805(_0x8e9319);})[_0xb84a('0x18')](function(_0x144c25){logger[_0xb84a('0x14')](_0xb84a('0x1f'),_0x144c25['message'],_0x378ce1);_0xd468c3(_0x3ff0bc[_0xb84a('0x14')](0x1f4,_0x144c25['message']));});});}; \ No newline at end of file +var _0x54ef=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','request','then','info','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2f1c70,_0x1e332){var _0x1e0302=function(_0x33f0d9){while(--_0x33f0d9){_0x2f1c70['push'](_0x2f1c70['shift']());}};_0x1e0302(++_0x1e332);}(_0x54ef,0x112));var _0xf54e=function(_0x5e6f02,_0xaf60fa){_0x5e6f02=_0x5e6f02-0x0;var _0x16a578=_0x54ef[_0x5e6f02];return _0x16a578;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});config[_0xf54e('0xb')]=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));require(_0xf54e('0xe'))['register'](socket);function respondWithRpcPromise(_0x26fc3e,_0xefa1c0,_0x6b9e61){return new BPromise(function(_0x3ecfb3,_0x5f232a){return client[_0xf54e('0xf')](_0x26fc3e,_0x6b9e61)[_0xf54e('0x10')](function(_0x143d66){logger[_0xf54e('0x11')]('FaxMessage,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'),JSON[_0xf54e('0x13')](_0x143d66));if(_0x143d66[_0xf54e('0x14')]){if(_0x143d66[_0xf54e('0x14')]['code']===0x1f4){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);return _0x5f232a(_0x143d66['error'][_0xf54e('0x16')]);}logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66['error']['message']);return _0x3ecfb3(_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);}else{logger[_0xf54e('0x11')](_0xf54e('0x15'),_0xefa1c0,_0xf54e('0x12'));_0x3ecfb3(_0x143d66[_0xf54e('0x17')][_0xf54e('0x16')]);}})[_0xf54e('0x18')](function(_0x1dcc04){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x1dcc04);_0x5f232a(_0x1dcc04);});});}exports['CreateFaxMessage']=function(_0x48a7e1){var _0x23e14=this;return new Promise(function(_0x59f338,_0x3e1556){return db[_0xf54e('0x19')][_0xf54e('0x1a')](_0x48a7e1[_0xf54e('0x1b')],{'raw':_0x48a7e1[_0xf54e('0x1c')]?_0x48a7e1[_0xf54e('0x1c')][_0xf54e('0x1d')]===undefined?!![]:![]:!![]})[_0xf54e('0x10')](function(_0x3c0169){logger[_0xf54e('0x11')](_0xf54e('0x1e'),_0x48a7e1);logger['debug'](_0xf54e('0x1e'),_0x48a7e1,JSON['stringify'](_0x3c0169));_0x59f338(_0x3c0169);})[_0xf54e('0x18')](function(_0x272df6){logger[_0xf54e('0x14')](_0xf54e('0x1e'),_0x272df6[_0xf54e('0x16')],_0x48a7e1);_0x3e1556(_0x23e14[_0xf54e('0x14')](0x1f4,_0x272df6[_0xf54e('0x16')]));});});};exports[_0xf54e('0x1f')]=function(_0x2342a9){var _0x33457f=this;return new Promise(function(_0xf6cdd7,_0x39c0ae){return db[_0xf54e('0x19')]['update'](_0x2342a9[_0xf54e('0x1b')],{'raw':_0x2342a9['options']?_0x2342a9[_0xf54e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x20')]||null:null,'attributes':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x21')]||null:null,'limit':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9['options']['limit']||null:null})[_0xf54e('0x10')](function(_0x258d29){logger[_0xf54e('0x11')](_0xf54e('0x1f'),_0x2342a9);logger[_0xf54e('0x22')](_0xf54e('0x1f'),_0x2342a9,JSON[_0xf54e('0x13')](_0x258d29));_0xf6cdd7(_0x258d29);})[_0xf54e('0x18')](function(_0x3ae704){logger[_0xf54e('0x14')]('UpdateFaxMessage',_0x3ae704['message'],_0x2342a9);_0x39c0ae(_0x33457f[_0xf54e('0x14')](0x1f4,_0x3ae704[_0xf54e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 9b941ce..301e105 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 _0x8864=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8864,0x17b));var _0x4886=function(_0x3a1522,_0x51684f){_0x3a1522=_0x3a1522-0x0;var _0x2c7785=_0x8864[_0x3a1522];return _0x2c7785;};'use strict';var FaxMessageEvents=require(_0x4886('0x0'));var events=[_0x4886('0x1'),_0x4886('0x2'),'update'];function createListener(_0x3283b3,_0x4f9f21){return function(_0x5bf8ff){_0x4f9f21[_0x4886('0x3')](_0x3283b3,_0x5bf8ff);};}function removeListener(_0x1c0eb7,_0x4bd31b){return function(){FaxMessageEvents[_0x4886('0x4')](_0x1c0eb7,_0x4bd31b);};}exports[_0x4886('0x5')]=function(_0x199e79){for(var _0x2bb926=0x0,_0x5b78ad=events[_0x4886('0x6')];_0x2bb926<_0x5b78ad;_0x2bb926++){var _0x1d1c33=events[_0x2bb926];var _0x4fd6d2=createListener(_0x4886('0x7')+_0x1d1c33,_0x199e79);FaxMessageEvents['on'](_0x1d1c33,_0x4fd6d2);}}; \ No newline at end of file +var _0x21b4=['emit','removeListener','faxMessage:','./faxMessage.events','save','remove'];(function(_0x13a9b1,_0x341a46){var _0x396ff8=function(_0xd2fd7d){while(--_0xd2fd7d){_0x13a9b1['push'](_0x13a9b1['shift']());}};_0x396ff8(++_0x341a46);}(_0x21b4,0x10b));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require(_0x421b('0x0'));var events=[_0x421b('0x1'),_0x421b('0x2'),'update'];function createListener(_0x5ab94a,_0x64d268){return function(_0xafcf05){_0x64d268[_0x421b('0x3')](_0x5ab94a,_0xafcf05);};}function removeListener(_0x17d36a,_0x32fa78){return function(){FaxMessageEvents[_0x421b('0x4')](_0x17d36a,_0x32fa78);};}exports['register']=function(_0x4f125c){for(var _0x19f313=0x0,_0x1776d3=events['length'];_0x19f313<_0x1776d3;_0x19f313++){var _0x1daa48=events[_0x19f313];var _0x29f393=createListener(_0x421b('0x5')+_0x1daa48,_0x4f125c);FaxMessageEvents['on'](_0x1daa48,_0x29f393);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 5e8291f..20913ca 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 _0x6e6c=['reject','/:id','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxMessage.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id',auth[_0xc6e6('0x7')](),controller['show']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')]('/',auth[_0xc6e6('0x7')](),interaction[_0xc6e6('0xd')](_0xc6e6('0xe'),_0xc6e6('0xf')),controller['create']);router[_0xc6e6('0x10')]('/:id',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x11')]);router[_0xc6e6('0x10')](_0xc6e6('0x12'),auth['isAuthenticated'](),controller[_0xc6e6('0x13')]);router[_0xc6e6('0x10')](_0xc6e6('0x14'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x15')]);router['delete'](_0xc6e6('0x16'),auth[_0xc6e6('0x7')](),controller['destroy']);module[_0xc6e6('0x17')]=router; \ No newline at end of file +var _0xb469=['reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download','download','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb469,0x13b));var _0x9b46=function(_0x30de0c,_0xfa3f7){_0x30de0c=_0x30de0c-0x0;var _0xf38475=_0xb469[_0x30de0c];return _0xf38475;};'use strict';var multer=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var path=require(_0x9b46('0x2'));var timeout=require(_0x9b46('0x3'));var express=require(_0x9b46('0x4'));var router=express[_0x9b46('0x5')]();var fs_extra=require(_0x9b46('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9b46('0x7'));var config=require(_0x9b46('0x8'));var controller=require('./faxMessage.controller');router[_0x9b46('0x9')]('/',auth[_0x9b46('0xa')](),controller['index']);router[_0x9b46('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9b46('0xb')]);router['get'](_0x9b46('0xc'),auth[_0x9b46('0xa')](),controller[_0x9b46('0xd')]);router['get'](_0x9b46('0xe'),auth['isAuthenticated'](),controller[_0x9b46('0xf')]);router['post']('/',auth[_0x9b46('0xa')](),interaction['tracked'](_0x9b46('0x10'),_0x9b46('0x11')),controller['create']);router[_0x9b46('0x12')](_0x9b46('0xc'),auth['isAuthenticated'](),controller[_0x9b46('0x13')]);router[_0x9b46('0x12')](_0x9b46('0x14'),auth[_0x9b46('0xa')](),controller[_0x9b46('0x15')]);router[_0x9b46('0x12')](_0x9b46('0x16'),auth[_0x9b46('0xa')](),controller[_0x9b46('0x17')]);router[_0x9b46('0x18')](_0x9b46('0xc'),auth[_0x9b46('0xa')](),controller[_0x9b46('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b9659e9..c2308b4 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 _0xeab8=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x474e27,_0x3c0c1b){var _0x525979=function(_0xf4cbad){while(--_0xf4cbad){_0x474e27['push'](_0x474e27['shift']());}};_0x525979(++_0x3c0c1b);}(_0xeab8,0x147));var _0x8eab=function(_0x1dd313,_0x9edf){_0x1dd313=_0x1dd313-0x0;var _0x20bede=_0xeab8[_0x1dd313];return _0x20bede;};'use strict';var Sequelize=require(_0x8eab('0x0'));module['exports']={'name':{'type':Sequelize[_0x8eab('0x1')],'unique':_0x8eab('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8eab('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8eab('0x4')](_0x8eab('0x5'),_0x8eab('0x6'),_0x8eab('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8eab('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1069=['beepall','roundrobin','sequelize','exports','STRING','name','rrmemory'];(function(_0x5b2767,_0xc983df){var _0x482816=function(_0x1c8a6c){while(--_0x1c8a6c){_0x5b2767['push'](_0x5b2767['shift']());}};_0x482816(++_0xc983df);}(_0x1069,0x167));var _0x9106=function(_0x23c447,_0x67046a){_0x23c447=_0x23c447-0x0;var _0x70f697=_0x1069[_0x23c447];return _0x70f697;};'use strict';var Sequelize=require(_0x9106('0x0'));module[_0x9106('0x1')]={'name':{'type':Sequelize[_0x9106('0x2')],'unique':_0x9106('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9106('0x4'),_0x9106('0x5'),_0x9106('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index e7264f6..28ea0ec 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 _0x6eec=['isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','where','FaxQueue','include','findAll','rows','catch','model','keys','query','filters','intersection','fields','attributes','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','sort','pick','FaxQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userFaxQueue:save','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','compact','value'];(function(_0x31e4bd,_0xd39c02){var _0x2cdebc=function(_0x387d98){while(--_0x387d98){_0x31e4bd['push'](_0x31e4bd['shift']());}};_0x2cdebc(++_0xd39c02);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var _=require(_0xc6ee('0x2'));var squel=require(_0xc6ee('0x3'));var Redis=require('ioredis');var qs=require(_0xc6ee('0x4'));var logger=require(_0xc6ee('0x5'))('api');var config=require(_0xc6ee('0x6'));var db=require(_0xc6ee('0x7'))['db'];config[_0xc6ee('0x8')]=_[_0xc6ee('0x9')](config[_0xc6ee('0x8')],{'host':_0xc6ee('0xa'),'port':0x18eb});var socket=require(_0xc6ee('0xb'))(new Redis(config[_0xc6ee('0x8')]));require(_0xc6ee('0xc'))['register'](socket);function respondWithStatusCode(_0x5d1421,_0xfcd175){_0xfcd175=_0xfcd175||0xcc;return function(_0x2a4706){if(_0x2a4706){return _0x5d1421['sendStatus'](_0xfcd175);}return _0x5d1421[_0xc6ee('0xd')](_0xfcd175)['end']();};}function respondWithResult(_0x294274,_0x2e999c){_0x2e999c=_0x2e999c||0xc8;return function(_0x405ce3){if(_0x405ce3){return _0x294274[_0xc6ee('0xd')](_0x2e999c)['json'](_0x405ce3);}};}function respondWithFilteredResult(_0x122a94,_0x1727a7){return function(_0xe87f07){if(_0xe87f07){var _0x4b415c=typeof _0x1727a7[_0xc6ee('0xe')]===_0xc6ee('0xf')&&typeof _0x1727a7[_0xc6ee('0x10')]==='undefined';var _0x2380d2=_0xe87f07[_0xc6ee('0x11')];var _0x42fb9c=_0x4b415c?0x0:_0x1727a7['offset'];var _0xe04579=_0x4b415c?_0xe87f07[_0xc6ee('0x11')]:_0x1727a7[_0xc6ee('0xe')]+_0x1727a7['limit'];var _0x43ef07;if(_0xe04579>=_0x2380d2){_0xe04579=_0x2380d2;_0x43ef07=0xc8;}else{_0x43ef07=0xce;}_0x122a94[_0xc6ee('0xd')](_0x43ef07);return _0x122a94[_0xc6ee('0x12')](_0xc6ee('0x13'),_0x42fb9c+'-'+_0xe04579+'/'+_0x2380d2)[_0xc6ee('0x14')](_0xe87f07);}return null;};}function saveUpdates(_0x18fea5){return function(_0x26b187){if(_0x26b187){return _0x26b187[_0xc6ee('0x15')](_0x18fea5)[_0xc6ee('0x16')](function(_0x26862c){return _0x26862c;});}return null;};}function removeEntity(_0x2ca012){return function(_0x27818f){if(_0x27818f){return _0x27818f[_0xc6ee('0x17')]()[_0xc6ee('0x16')](function(){var _0x14d899=_0x27818f[_0xc6ee('0x18')]({'plain':!![]});var _0x1997cd=_0xc6ee('0x19');return db[_0xc6ee('0x1a')][_0xc6ee('0x17')]({'where':{'type':_0x1997cd,'resourceId':_0x14d899['id']}})[_0xc6ee('0x16')](function(){return _0x27818f;});})['then'](function(){_0x2ca012[_0xc6ee('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x525e66){return function(_0x3beb1e){if(!_0x3beb1e){_0x525e66[_0xc6ee('0x1b')](0x194);}return _0x3beb1e;};}function handleError(_0x459db2,_0x561d66){_0x561d66=_0x561d66||0x1f4;return function(_0x8247b0){logger['error'](_0x8247b0[_0xc6ee('0x1c')]);if(_0x8247b0['name']){delete _0x8247b0[_0xc6ee('0x1d')];}_0x459db2[_0xc6ee('0xd')](_0x561d66)[_0xc6ee('0x1e')](_0x8247b0);};}exports[_0xc6ee('0x1f')]=function(_0x1b48a4,_0xfe2627){var _0x5f57cc={};var _0x5240e2={'count':0x0,'rows':[]};var _0x3ec62b=_[_0xc6ee('0x20')](db['FaxQueue'][_0xc6ee('0x21')],function(_0x5674c6){return{'name':_0x5674c6[_0xc6ee('0x22')],'type':_0x5674c6[_0xc6ee('0x23')][_0xc6ee('0x24')]};});_0x5f57cc=qs['getOptions'](_0x3ec62b,_0x1b48a4);var _0x29757f={'where':_0x5f57cc[_0xc6ee('0x25')]};return db[_0xc6ee('0x26')][_0xc6ee('0x11')](_0x29757f)[_0xc6ee('0x16')](function(_0x3c9ece){_0x5240e2[_0xc6ee('0x11')]=_0x3c9ece;_0x5f57cc['include']=qs[_0xc6ee('0x27')](_0x1b48a4['query']);return db[_0xc6ee('0x26')][_0xc6ee('0x28')](_0x5f57cc);})[_0xc6ee('0x16')](function(_0x425bb7){_0x5240e2[_0xc6ee('0x29')]=_0x425bb7;return _0x5240e2;})['then'](respondWithFilteredResult(_0xfe2627,_0x5f57cc))[_0xc6ee('0x2a')](handleError(_0xfe2627,null));};exports['show']=function(_0x2702f3,_0x9b269f){var _0x46b964={'raw':!![],'where':{'id':_0x2702f3['params']['id']}},_0x2e0526={};_0x2e0526[_0xc6ee('0x2b')]=_[_0xc6ee('0x2c')](db['FaxQueue'][_0xc6ee('0x21')]);_0x2e0526['query']=_[_0xc6ee('0x2c')](_0x2702f3[_0xc6ee('0x2d')]);_0x2e0526[_0xc6ee('0x2e')]=_[_0xc6ee('0x2f')](_0x2e0526[_0xc6ee('0x2b')],_0x2e0526['query']);_0x46b964['attributes']=_[_0xc6ee('0x2f')](_0x2e0526['model'],qs[_0xc6ee('0x30')](_0x2702f3[_0xc6ee('0x2d')][_0xc6ee('0x30')]));_0x46b964[_0xc6ee('0x31')]=_0x46b964[_0xc6ee('0x31')][_0xc6ee('0x32')]?_0x46b964[_0xc6ee('0x31')]:_0x2e0526[_0xc6ee('0x2b')];if(_0x2702f3['query']['includeAll']){_0x46b964[_0xc6ee('0x27')]=[{'all':!![]}];}_0x46b964=_[_0xc6ee('0x33')]({},_0x46b964,_0x2702f3[_0xc6ee('0x34')]);return db[_0xc6ee('0x26')]['find'](_0x46b964)[_0xc6ee('0x16')](handleEntityNotFound(_0x9b269f,null))[_0xc6ee('0x16')](respondWithResult(_0x9b269f,null))[_0xc6ee('0x2a')](handleError(_0x9b269f,null));};exports[_0xc6ee('0x35')]=function(_0x19bbb0,_0x148a74){return db['FaxQueue']['create'](_0x19bbb0[_0xc6ee('0x36')],{})['then'](function(_0x526043){var _0x185a19=_0x19bbb0[_0xc6ee('0x37')][_0xc6ee('0x18')]({'plain':!![]});if(!_0x185a19)throw new Error(_0xc6ee('0x38'));if(_0x185a19['role']===_0xc6ee('0x37')){var _0x2a577b=_0x526043[_0xc6ee('0x18')]({'plain':!![]});var _0x969c3c=_0xc6ee('0x19');return db[_0xc6ee('0x39')]['find']({'where':{'name':_0x969c3c,'userProfileId':_0x185a19[_0xc6ee('0x3a')]},'raw':!![]})[_0xc6ee('0x16')](function(_0x300018){if(_0x300018&&_0x300018[_0xc6ee('0x3b')]===0x0){return db['UserProfileResource'][_0xc6ee('0x35')]({'name':_0x2a577b['name'],'resourceId':_0x2a577b['id'],'type':_0x300018[_0xc6ee('0x1d')],'sectionId':_0x300018['id']},{})[_0xc6ee('0x16')](function(){return _0x526043;});}else{return _0x526043;}})['catch'](function(_0x5c6452){logger['error'](_0xc6ee('0x3c'),_0x5c6452);throw _0x5c6452;});}return _0x526043;})[_0xc6ee('0x16')](respondWithResult(_0x148a74,0xc9))['catch'](handleError(_0x148a74,null));};exports['update']=function(_0x4d8b7a,_0x5a0c22){if(_0x4d8b7a['body']['id']){delete _0x4d8b7a[_0xc6ee('0x36')]['id'];}return db[_0xc6ee('0x26')][_0xc6ee('0x3d')]({'where':{'id':_0x4d8b7a['params']['id']}})['then'](handleEntityNotFound(_0x5a0c22,null))['then'](saveUpdates(_0x4d8b7a['body'],null))['then'](respondWithResult(_0x5a0c22,null))['catch'](handleError(_0x5a0c22,null));};exports['destroy']=function(_0x1a1bf2,_0x55f159){return db['FaxQueue'][_0xc6ee('0x3d')]({'where':{'id':_0x1a1bf2[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](handleEntityNotFound(_0x55f159,null))[_0xc6ee('0x16')](removeEntity(_0x55f159,null))[_0xc6ee('0x2a')](handleError(_0x55f159,null));};exports[_0xc6ee('0x3f')]=function(_0x5d5afc,_0x1ffe0c){return db[_0xc6ee('0x26')]['describe']()['then'](respondWithResult(_0x1ffe0c,null))[_0xc6ee('0x2a')](handleError(_0x1ffe0c,null));};exports[_0xc6ee('0x40')]=function(_0x43b9cf,_0xbf853a){var _0x124a5b={'raw':!![],'where':{}},_0x38cb59={},_0x5ae2e5;return db[_0xc6ee('0x26')][_0xc6ee('0x41')]({'where':{'id':_0x43b9cf[_0xc6ee('0x3e')]['id']}})['then'](handleEntityNotFound(_0xbf853a,null))[_0xc6ee('0x16')](function(_0x4f8784){if(_0x4f8784){_0x5ae2e5=_0x4f8784[_0xc6ee('0x18')]({'plain':!![]});_0x38cb59[_0xc6ee('0x2b')]=_[_0xc6ee('0x2c')](db[_0xc6ee('0x42')][_0xc6ee('0x21')]);_0x38cb59[_0xc6ee('0x2d')]=_[_0xc6ee('0x2c')](_0x43b9cf[_0xc6ee('0x2d')]);_0x38cb59['filters']=_['intersection'](_0x38cb59[_0xc6ee('0x2b')],_0x38cb59[_0xc6ee('0x2d')]);_0x124a5b[_0xc6ee('0x31')]=_[_0xc6ee('0x2f')](_0x38cb59['model'],qs['fields'](_0x43b9cf['query'][_0xc6ee('0x30')]));_0x124a5b[_0xc6ee('0x31')]=_0x124a5b['attributes']['length']?_0x124a5b['attributes']:_0x38cb59[_0xc6ee('0x2b')];if(!_0x43b9cf['query'][_0xc6ee('0x43')](_0xc6ee('0x44'))){_0x124a5b['limit']=qs['limit'](_0x43b9cf['query'][_0xc6ee('0x10')]);_0x124a5b[_0xc6ee('0xe')]=qs['offset'](_0x43b9cf['query'][_0xc6ee('0xe')]);}_0x124a5b[_0xc6ee('0x45')]=qs[_0xc6ee('0x46')](_0x43b9cf['query'][_0xc6ee('0x46')]);_0x124a5b['where']=qs[_0xc6ee('0x2e')](_[_0xc6ee('0x47')](_0x43b9cf[_0xc6ee('0x2d')],_0x38cb59[_0xc6ee('0x2e')]));_0x124a5b['where'][_0xc6ee('0x48')]=_0x4f8784['id'];if(_0x43b9cf[_0xc6ee('0x2d')][_0xc6ee('0x49')]){_0x124a5b[_0xc6ee('0x25')]=_[_0xc6ee('0x33')](_0x124a5b['where'],{'$or':_['map'](_0x124a5b[_0xc6ee('0x31')],function(_0xafdbe7){var _0x1a2dd5={};_0x1a2dd5[_0xafdbe7]={'$like':'%'+_0x43b9cf[_0xc6ee('0x2d')][_0xc6ee('0x49')]+'%'};return _0x1a2dd5;})});}_0x124a5b=_[_0xc6ee('0x33')]({},_0x124a5b,_0x43b9cf[_0xc6ee('0x34')]);return db[_0xc6ee('0x42')][_0xc6ee('0x28')](_0x124a5b);}})[_0xc6ee('0x16')](function(_0x5358a9){if(_0x5358a9){return db[_0xc6ee('0x4a')][_0xc6ee('0x4b')]({'where':{'id':_['map'](_0x5358a9,'UserId'),'role':_0xc6ee('0x4c')},'attributes':['id','name','faxPause',_0xc6ee('0x4d'),_0xc6ee('0x4e')]});}})[_0xc6ee('0x16')](function(_0x4b9c54){if(_0x4b9c54){return{'count':_0x4b9c54[_0xc6ee('0x11')],'rows':_[_0xc6ee('0x20')](_0x4b9c54['rows'],function(_0x408104){return{'membername':_0x408104['name'],'UserId':_0x408104['id'],'queue_name':_0x5ae2e5['name'],'FaxQueueId':_0x5ae2e5['id'],'interface':util['format'](_0xc6ee('0x4f'),_0xc6ee('0x50'),_0x408104[_0xc6ee('0x1d')]),'penalty':0x0,'paused':_0x408104[_0xc6ee('0x51')],'createdAt':_0x408104[_0xc6ee('0x4e')],'updatedAt':_0x408104[_0xc6ee('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc6ee('0x16')](respondWithFilteredResult(_0xbf853a,_0x124a5b))['catch'](handleError(_0xbf853a,null));};exports[_0xc6ee('0x52')]=function(_0x1108b0,_0x4b198d){var _0x2cd6c6={};var _0x2ca821={};var _0x306a02;var _0x192ee5;return db[_0xc6ee('0x26')][_0xc6ee('0x41')]({'where':{'id':_0x1108b0[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](handleEntityNotFound(_0x4b198d,null))['then'](function(_0x1e707b){if(_0x1e707b){_0x306a02=_0x1e707b;_0x2ca821[_0xc6ee('0x2b')]=_[_0xc6ee('0x2c')](db[_0xc6ee('0x53')][_0xc6ee('0x21')]);_0x2ca821[_0xc6ee('0x2d')]=_[_0xc6ee('0x2c')](_0x1108b0[_0xc6ee('0x2d')]);_0x2ca821[_0xc6ee('0x2e')]=_[_0xc6ee('0x2f')](_0x2ca821['model'],_0x2ca821[_0xc6ee('0x2d')]);_0x2cd6c6[_0xc6ee('0x31')]=_[_0xc6ee('0x2f')](_0x2ca821[_0xc6ee('0x2b')],qs[_0xc6ee('0x30')](_0x1108b0['query'][_0xc6ee('0x30')]));_0x2cd6c6['attributes']=_0x2cd6c6['attributes']['length']?_0x2cd6c6[_0xc6ee('0x31')]:_0x2ca821[_0xc6ee('0x2b')];_0x2cd6c6['order']=qs[_0xc6ee('0x46')](_0x1108b0['query']['sort']);_0x2cd6c6[_0xc6ee('0x25')]=qs[_0xc6ee('0x2e')](_[_0xc6ee('0x47')](_0x1108b0[_0xc6ee('0x2d')],_0x2ca821[_0xc6ee('0x2e')]));if(_0x1108b0['query']['filter']){_0x2cd6c6['where']=_[_0xc6ee('0x33')](_0x2cd6c6[_0xc6ee('0x25')],{'$or':_[_0xc6ee('0x20')](_0x2cd6c6[_0xc6ee('0x31')],function(_0x229e08){var _0xe35b6f={};_0xe35b6f[_0x229e08]={'$like':'%'+_0x1108b0[_0xc6ee('0x2d')][_0xc6ee('0x49')]+'%'};return _0xe35b6f;})});}_0x2cd6c6=_['merge']({},_0x2cd6c6,_0x1108b0['options']);return _0x306a02['getTeams'](_0x2cd6c6);}})['then'](function(_0x577250){if(_0x577250){_0x192ee5=_0x577250[_0xc6ee('0x32')];if(!_0x1108b0[_0xc6ee('0x2d')]['hasOwnProperty'](_0xc6ee('0x44'))){_0x2cd6c6[_0xc6ee('0x10')]=qs[_0xc6ee('0x10')](_0x1108b0[_0xc6ee('0x2d')][_0xc6ee('0x10')]);_0x2cd6c6[_0xc6ee('0xe')]=qs['offset'](_0x1108b0['query'][_0xc6ee('0xe')]);}return _0x306a02[_0xc6ee('0x52')](_0x2cd6c6);}})[_0xc6ee('0x16')](function(_0x5720cc){if(_0x5720cc){return _0x5720cc?{'count':_0x192ee5,'rows':_0x5720cc}:null;}})[_0xc6ee('0x16')](respondWithResult(_0x4b198d,null))['catch'](handleError(_0x4b198d,null));};exports[_0xc6ee('0x54')]=function(_0x49ac50,_0x27248c){var _0x2b4223=_0x49ac50[_0xc6ee('0x36')][_0xc6ee('0x55')];return db[_0xc6ee('0x53')][_0xc6ee('0x28')]({'where':{'id':_0x2b4223},'attributes':['id'],'include':[{'model':db[_0xc6ee('0x4a')],'as':_0xc6ee('0x56'),'attributes':['id','name',_0xc6ee('0x57'),_0xc6ee('0x58'),_0xc6ee('0x59')],'raw':!![]}]})['then'](function(_0x1e7567){if(_0x1e7567){var _0x3cbc05=_[_0xc6ee('0x5a')](_0x1e7567,function(_0x9ef9d5){var _0x4c50ed=_0x9ef9d5[_0xc6ee('0x18')]({'plain':!![]});return _0x4c50ed[_0xc6ee('0x56')];});return db[_0xc6ee('0x26')]['find']({'where':{'id':_0x49ac50[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](function(_0x4b722a){return db[_0xc6ee('0x5b')][_0xc6ee('0x5c')](function(_0x636040){return _0x4b722a[_0xc6ee('0x54')](_0x2b4223,{'transaction':_0x636040})[_0xc6ee('0x16')](function(){return BPromise[_0xc6ee('0x5d')](_0x3cbc05,function(_0x34a046){return db[_0xc6ee('0x42')]['findOrCreate']({'where':{'UserId':_0x34a046['id'],'FaxQueueId':_0x49ac50[_0xc6ee('0x3e')]['id']},'transaction':_0x636040});});})[_0xc6ee('0x16')](function(){_0x3cbc05[_0xc6ee('0x5e')](function(_0x1e4a38){socket[_0xc6ee('0x5f')](_0xc6ee('0x60'),{'UserId':_0x1e4a38['id'],'FaxQueueId':_0x4b722a['id']});});});});});}})['then'](respondWithStatusCode(_0x27248c,null))['catch'](handleError(_0x27248c,null));};exports['removeTeams']=function(_0x3c2e8f,_0x1bf18c){return db[_0xc6ee('0x53')][_0xc6ee('0x28')]({'where':{'id':_0x3c2e8f[_0xc6ee('0x2d')][_0xc6ee('0x55')]},'attributes':['id'],'include':[{'model':db[_0xc6ee('0x4a')],'as':_0xc6ee('0x56'),'attributes':['id'],'raw':!![]}]})[_0xc6ee('0x16')](handleEntityNotFound(_0x1bf18c,null))[_0xc6ee('0x16')](function(_0x4b6a81){var _0x50404b=_[_0xc6ee('0x20')](_0x4b6a81,'id');var _0x3ab874=[];var _0x2c05d6=[];var _0x5aef5e=squel['select']();_0x5aef5e[_0xc6ee('0x61')](_0xc6ee('0x62'))['from']('team_has_fax_queues','tq')['join'](_0xc6ee('0x63'),'ut',_0xc6ee('0x64'))[_0xc6ee('0x25')](_0xc6ee('0x65'),_0x3c2e8f['params']['id']);for(var _0x2e2e47=0x0;_0x2e2e47<_0x4b6a81[_0xc6ee('0x32')];_0x2e2e47+=0x1){let _0xe416e9=_0x4b6a81[_0x2e2e47];for(var _0x47d35a=0x0;_0x47d35a<_0xe416e9[_0xc6ee('0x56')][_0xc6ee('0x32')];_0x47d35a+=0x1){let _0x5460cc=_0xe416e9[_0xc6ee('0x56')][_0x47d35a];var _0x4a193f=_0x5aef5e[_0xc6ee('0x66')]();_0x4a193f[_0xc6ee('0x25')](_0xc6ee('0x67'),_0x5460cc['id']);_0x2c05d6[_0xc6ee('0x68')](db[_0xc6ee('0x5b')][_0xc6ee('0x2d')](_0x4a193f[_0xc6ee('0x69')](),{'type':db[_0xc6ee('0x5b')]['QueryTypes']['SELECT']})[_0xc6ee('0x16')](function(_0x17ea1a){if(_0x17ea1a['length']===0x1){return _0x5460cc['id'];}else{var _0x411f9d=_[_0xc6ee('0x6a')](_[_0xc6ee('0x20')](_0x17ea1a,'TeamId'),function(_0x2f3536){return _['includes'](_0x50404b,_0x2f3536);});if(_0x411f9d){return _0x5460cc['id'];}}}));}}return BPromise[_0xc6ee('0x6b')](_0x2c05d6)[_0xc6ee('0x16')](function(_0x2e4390){_0x3ab874=_(_0x3ab874)['union'](_0x2e4390)[_0xc6ee('0x6c')]()[_0xc6ee('0x6d')]();return db['FaxQueue'][_0xc6ee('0x3d')]({'where':{'id':_0x3c2e8f[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](function(_0x5c11da){return db['sequelize'][_0xc6ee('0x5c')](function(_0x44e4cc){return _0x5c11da['removeTeams'](_0x3c2e8f['query'][_0xc6ee('0x55')],{'transaction':_0x44e4cc})['then'](function(){if(!_[_0xc6ee('0x6e')](_0x3ab874)){return _0x5c11da[_0xc6ee('0x6f')](_0x3ab874,{'transaction':_0x44e4cc});}})['then'](function(){_0x3ab874[_0xc6ee('0x5e')](function(_0x294fc4){socket[_0xc6ee('0x5f')](_0xc6ee('0x70'),{'UserId':_0x294fc4,'FaxQueueId':_0x5c11da['id']});});});});});});})[_0xc6ee('0x16')](respondWithStatusCode(_0x1bf18c,null))[_0xc6ee('0x2a')](handleError(_0x1bf18c,null));};exports[_0xc6ee('0x71')]=function(_0x2970c0,_0x2fe2d5){return db[_0xc6ee('0x26')][_0xc6ee('0x3d')]({'where':{'id':_0x2970c0[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](handleEntityNotFound(_0x2fe2d5,null))[_0xc6ee('0x16')](function(_0x3928f1){if(_0x3928f1){return _0x3928f1[_0xc6ee('0x71')](_0x2970c0[_0xc6ee('0x36')][_0xc6ee('0x55')],_[_0xc6ee('0x72')](_0x2970c0[_0xc6ee('0x36')],[_0xc6ee('0x55'),'id'])||{})[_0xc6ee('0x73')](function(_0x2385c9){for(var _0x2966c8=0x0;_0x2966c8<_0x2970c0['body'][_0xc6ee('0x55')][_0xc6ee('0x32')];_0x2966c8+=0x1){socket[_0xc6ee('0x5f')](_0xc6ee('0x60'),{'UserId':Number(_0x2970c0[_0xc6ee('0x36')][_0xc6ee('0x55')][_0x2966c8]),'FaxQueueId':Number(_0x2970c0[_0xc6ee('0x3e')]['id'])});}return _0x2385c9;});}})[_0xc6ee('0x16')](respondWithResult(_0x2fe2d5,null))[_0xc6ee('0x2a')](handleError(_0x2fe2d5,null));};exports[_0xc6ee('0x6f')]=function(_0x384db5,_0x129035){return db[_0xc6ee('0x26')][_0xc6ee('0x3d')]({'where':{'id':_0x384db5[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](handleEntityNotFound(_0x129035,null))[_0xc6ee('0x16')](function(_0x380971){if(_0x380971){return _0x380971['removeAgents'](_0x384db5[_0xc6ee('0x2d')]['ids'])[_0xc6ee('0x16')](function(){if(_[_0xc6ee('0x74')](_0x384db5[_0xc6ee('0x2d')][_0xc6ee('0x55')])){for(var _0x30e9fd=0x0;_0x30e9fd<_0x384db5['query'][_0xc6ee('0x55')][_0xc6ee('0x32')];_0x30e9fd+=0x1){socket[_0xc6ee('0x5f')](_0xc6ee('0x70'),{'UserId':Number(_0x384db5[_0xc6ee('0x2d')][_0xc6ee('0x55')][_0x30e9fd]),'FaxQueueId':Number(_0x384db5[_0xc6ee('0x3e')]['id'])});}}else{socket[_0xc6ee('0x5f')]('userFaxQueue:remove',{'UserId':Number(_0x384db5[_0xc6ee('0x2d')]['ids']),'FaxQueueId':Number(_0x384db5[_0xc6ee('0x3e')]['id'])});}});}})['then'](respondWithStatusCode(_0x129035,null))[_0xc6ee('0x2a')](handleError(_0x129035,null));};exports[_0xc6ee('0x75')]=function(_0x2546cc,_0x21ad9e){var _0x55d720={};var _0x554c69={};var _0x326373;var _0xcf06b5;return db[_0xc6ee('0x26')][_0xc6ee('0x41')]({'where':{'id':_0x2546cc[_0xc6ee('0x3e')]['id']}})[_0xc6ee('0x16')](handleEntityNotFound(_0x21ad9e,null))[_0xc6ee('0x16')](function(_0x16ca4d){if(_0x16ca4d){_0x326373=_0x16ca4d;_0x554c69[_0xc6ee('0x2b')]=_[_0xc6ee('0x2c')](db[_0xc6ee('0x4a')]['rawAttributes']);_0x554c69['query']=_[_0xc6ee('0x2c')](_0x2546cc[_0xc6ee('0x2d')]);_0x554c69[_0xc6ee('0x2e')]=_[_0xc6ee('0x2f')](_0x554c69['model'],_0x554c69[_0xc6ee('0x2d')]);_0x55d720[_0xc6ee('0x31')]=_['intersection'](_0x554c69[_0xc6ee('0x2b')],qs[_0xc6ee('0x30')](_0x2546cc[_0xc6ee('0x2d')][_0xc6ee('0x30')]));_0x55d720[_0xc6ee('0x31')]=_0x55d720['attributes'][_0xc6ee('0x32')]?_0x55d720['attributes']:_0x554c69[_0xc6ee('0x2b')];_0x55d720[_0xc6ee('0x45')]=qs['sort'](_0x2546cc['query'][_0xc6ee('0x46')]);_0x55d720[_0xc6ee('0x25')]=qs[_0xc6ee('0x2e')](_[_0xc6ee('0x47')](_0x2546cc[_0xc6ee('0x2d')],_0x554c69['filters']));if(_0x2546cc['query'][_0xc6ee('0x49')]){_0x55d720[_0xc6ee('0x25')]=_[_0xc6ee('0x33')](_0x55d720[_0xc6ee('0x25')],{'$or':_[_0xc6ee('0x20')](_0x55d720['attributes'],function(_0x770a2b){var _0x3d2248={};_0x3d2248[_0x770a2b]={'$like':'%'+_0x2546cc['query']['filter']+'%'};return _0x3d2248;})});}_0x55d720=_[_0xc6ee('0x33')]({},_0x55d720,_0x2546cc[_0xc6ee('0x34')]);return _0x326373[_0xc6ee('0x75')](_0x55d720);}})['then'](function(_0x1cedf5){if(_0x1cedf5){_0xcf06b5=_0x1cedf5[_0xc6ee('0x32')];if(!_0x2546cc[_0xc6ee('0x2d')]['hasOwnProperty'](_0xc6ee('0x44'))){_0x55d720[_0xc6ee('0x10')]=qs[_0xc6ee('0x10')](_0x2546cc[_0xc6ee('0x2d')][_0xc6ee('0x10')]);_0x55d720[_0xc6ee('0xe')]=qs[_0xc6ee('0xe')](_0x2546cc[_0xc6ee('0x2d')][_0xc6ee('0xe')]);}return _0x326373[_0xc6ee('0x75')](_0x55d720);}})['then'](function(_0x21965c){if(_0x21965c){return _0x21965c?{'count':_0xcf06b5,'rows':_0x21965c}:null;}})[_0xc6ee('0x16')](respondWithResult(_0x21ad9e,null))[_0xc6ee('0x2a')](handleError(_0x21ad9e,null));}; \ No newline at end of file +var _0x1261=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserFaxQueue','hasOwnProperty','nolimit','order','pick','FaxQueueId','filter','merge','findAll','findAndCountAll','agent','faxPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','Team','sort','addTeams','ids','User','voicePause','interface','flatMap','transaction','each','forEach','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray','findOne','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','name','index','map','FaxQueue','fieldName','type','where','include','catch','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','find','create','user','role','UserProfileSection','userProfileId'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x1261,0x144));var _0x1126=function(_0x543eac,_0x3a39a1){_0x543eac=_0x543eac-0x0;var _0x16c036=_0x1261[_0x543eac];return _0x16c036;};'use strict';var BPromise=require('bluebird');var util=require(_0x1126('0x0'));var _=require(_0x1126('0x1'));var squel=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var qs=require(_0x1126('0x4'));var logger=require(_0x1126('0x5'))(_0x1126('0x6'));var config=require(_0x1126('0x7'));var db=require(_0x1126('0x8'))['db'];config[_0x1126('0x9')]=_['defaults'](config['redis'],{'host':_0x1126('0xa'),'port':0x18eb});var socket=require(_0x1126('0xb'))(new Redis(config['redis']));require(_0x1126('0xc'))[_0x1126('0xd')](socket);function respondWithStatusCode(_0x245be9,_0x3abb0b){_0x3abb0b=_0x3abb0b||0xcc;return function(_0x2d9033){if(_0x2d9033){return _0x245be9['sendStatus'](_0x3abb0b);}return _0x245be9[_0x1126('0xe')](_0x3abb0b)[_0x1126('0xf')]();};}function respondWithResult(_0x167ef1,_0x5e72e2){_0x5e72e2=_0x5e72e2||0xc8;return function(_0x34571c){if(_0x34571c){return _0x167ef1['status'](_0x5e72e2)['json'](_0x34571c);}};}function respondWithFilteredResult(_0x15c071,_0x561b93){return function(_0x15e89b){if(_0x15e89b){var _0x1b364a=typeof _0x561b93[_0x1126('0x10')]===_0x1126('0x11')&&typeof _0x561b93[_0x1126('0x12')]===_0x1126('0x11');var _0xd8ca42=_0x15e89b[_0x1126('0x13')];var _0x43850b=_0x1b364a?0x0:_0x561b93['offset'];var _0x5de9a7=_0x1b364a?_0x15e89b[_0x1126('0x13')]:_0x561b93[_0x1126('0x10')]+_0x561b93[_0x1126('0x12')];var _0x4be0c6;if(_0x5de9a7>=_0xd8ca42){_0x5de9a7=_0xd8ca42;_0x4be0c6=0xc8;}else{_0x4be0c6=0xce;}_0x15c071[_0x1126('0xe')](_0x4be0c6);return _0x15c071['set'](_0x1126('0x14'),_0x43850b+'-'+_0x5de9a7+'/'+_0xd8ca42)[_0x1126('0x15')](_0x15e89b);}return null;};}function saveUpdates(_0x257b5f){return function(_0x4e1c97){if(_0x4e1c97){return _0x4e1c97[_0x1126('0x16')](_0x257b5f)[_0x1126('0x17')](function(_0x4a7b49){return _0x4a7b49;});}return null;};}function removeEntity(_0x4d2b38){return function(_0x22ae0b){if(_0x22ae0b){return _0x22ae0b[_0x1126('0x18')]()['then'](function(){var _0x548359=_0x22ae0b[_0x1126('0x19')]({'plain':!![]});var _0x58b109=_0x1126('0x1a');return db[_0x1126('0x1b')][_0x1126('0x18')]({'where':{'type':_0x58b109,'resourceId':_0x548359['id']}})['then'](function(){return _0x22ae0b;});})[_0x1126('0x17')](function(){_0x4d2b38['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30f6b3){return function(_0x3a9bed){if(!_0x3a9bed){_0x30f6b3[_0x1126('0x1c')](0x194);}return _0x3a9bed;};}function handleError(_0x36d254,_0x526ca1){_0x526ca1=_0x526ca1||0x1f4;return function(_0x29ab60){logger[_0x1126('0x1d')](_0x29ab60['stack']);if(_0x29ab60[_0x1126('0x1e')]){delete _0x29ab60['name'];}_0x36d254['status'](_0x526ca1)['send'](_0x29ab60);};}exports[_0x1126('0x1f')]=function(_0x15bcc3,_0x329914){var _0x34bcf1={};var _0x566c09={'count':0x0,'rows':[]};var _0x1b07a7=_[_0x1126('0x20')](db[_0x1126('0x21')]['rawAttributes'],function(_0x35eec3){return{'name':_0x35eec3[_0x1126('0x22')],'type':_0x35eec3[_0x1126('0x23')]['key']};});_0x34bcf1=qs['getOptions'](_0x1b07a7,_0x15bcc3);var _0xeb7d89={'where':_0x34bcf1[_0x1126('0x24')]};return db['FaxQueue'][_0x1126('0x13')](_0xeb7d89)[_0x1126('0x17')](function(_0x4a334a){_0x566c09[_0x1126('0x13')]=_0x4a334a;_0x34bcf1['include']=qs[_0x1126('0x25')](_0x15bcc3['query']);return db[_0x1126('0x21')]['findAll'](_0x34bcf1);})[_0x1126('0x17')](function(_0x5f2611){_0x566c09['rows']=_0x5f2611;return _0x566c09;})['then'](respondWithFilteredResult(_0x329914,_0x34bcf1))[_0x1126('0x26')](handleError(_0x329914,null));};exports[_0x1126('0x27')]=function(_0x1cef48,_0x5b8bea){var _0x2a3055={'raw':!![],'where':{'id':_0x1cef48['params']['id']}},_0x226afb={};_0x226afb[_0x1126('0x28')]=_[_0x1126('0x29')](db[_0x1126('0x21')][_0x1126('0x2a')]);_0x226afb['query']=_['keys'](_0x1cef48[_0x1126('0x2b')]);_0x226afb[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x226afb[_0x1126('0x28')],_0x226afb['query']);_0x2a3055[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x226afb[_0x1126('0x28')],qs[_0x1126('0x2f')](_0x1cef48[_0x1126('0x2b')]['fields']));_0x2a3055[_0x1126('0x2e')]=_0x2a3055[_0x1126('0x2e')][_0x1126('0x30')]?_0x2a3055[_0x1126('0x2e')]:_0x226afb['model'];if(_0x1cef48['query'][_0x1126('0x31')]){_0x2a3055[_0x1126('0x25')]=[{'all':!![]}];}_0x2a3055=_['merge']({},_0x2a3055,_0x1cef48[_0x1126('0x32')]);return db[_0x1126('0x21')][_0x1126('0x33')](_0x2a3055)['then'](handleEntityNotFound(_0x5b8bea,null))['then'](respondWithResult(_0x5b8bea,null))[_0x1126('0x26')](handleError(_0x5b8bea,null));};exports[_0x1126('0x34')]=function(_0x3aa08f,_0x156554){return db['FaxQueue'][_0x1126('0x34')](_0x3aa08f['body'],{})[_0x1126('0x17')](function(_0x20e43a){var _0xfa96e0=_0x3aa08f[_0x1126('0x35')][_0x1126('0x19')]({'plain':!![]});if(!_0xfa96e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfa96e0[_0x1126('0x36')]===_0x1126('0x35')){var _0x2939a9=_0x20e43a[_0x1126('0x19')]({'plain':!![]});var _0x3469a2=_0x1126('0x1a');return db[_0x1126('0x37')]['find']({'where':{'name':_0x3469a2,'userProfileId':_0xfa96e0[_0x1126('0x38')]},'raw':!![]})[_0x1126('0x17')](function(_0x227a6b){if(_0x227a6b&&_0x227a6b[_0x1126('0x39')]===0x0){return db[_0x1126('0x1b')]['create']({'name':_0x2939a9['name'],'resourceId':_0x2939a9['id'],'type':_0x227a6b[_0x1126('0x1e')],'sectionId':_0x227a6b['id']},{})[_0x1126('0x17')](function(){return _0x20e43a;});}else{return _0x20e43a;}})[_0x1126('0x26')](function(_0x21c38e){logger[_0x1126('0x1d')](_0x1126('0x3a'),_0x21c38e);throw _0x21c38e;});}return _0x20e43a;})['then'](respondWithResult(_0x156554,0xc9))['catch'](handleError(_0x156554,null));};exports['update']=function(_0xb8054e,_0x5d4194){if(_0xb8054e[_0x1126('0x3b')]['id']){delete _0xb8054e[_0x1126('0x3b')]['id'];}return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0xb8054e['params']['id']}})['then'](handleEntityNotFound(_0x5d4194,null))[_0x1126('0x17')](saveUpdates(_0xb8054e[_0x1126('0x3b')],null))[_0x1126('0x17')](respondWithResult(_0x5d4194,null))['catch'](handleError(_0x5d4194,null));};exports[_0x1126('0x18')]=function(_0x5f35fa,_0x3a5f20){return db['FaxQueue'][_0x1126('0x33')]({'where':{'id':_0x5f35fa[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x3a5f20,null))['then'](removeEntity(_0x3a5f20,null))[_0x1126('0x26')](handleError(_0x3a5f20,null));};exports[_0x1126('0x3d')]=function(_0xf8ec5f,_0x48c694){return db['FaxQueue']['describe']()[_0x1126('0x17')](respondWithResult(_0x48c694,null))['catch'](handleError(_0x48c694,null));};exports[_0x1126('0x3e')]=function(_0x507568,_0x2f45b9){var _0x323499={'raw':!![],'where':{}},_0x146066={},_0x120de1;return db[_0x1126('0x21')]['findOne']({'where':{'id':_0x507568[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x2f45b9,null))['then'](function(_0x1a15f8){if(_0x1a15f8){_0x120de1=_0x1a15f8[_0x1126('0x19')]({'plain':!![]});_0x146066['model']=_[_0x1126('0x29')](db[_0x1126('0x3f')]['rawAttributes']);_0x146066[_0x1126('0x2b')]=_[_0x1126('0x29')](_0x507568[_0x1126('0x2b')]);_0x146066['filters']=_[_0x1126('0x2d')](_0x146066[_0x1126('0x28')],_0x146066[_0x1126('0x2b')]);_0x323499[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x146066[_0x1126('0x28')],qs[_0x1126('0x2f')](_0x507568[_0x1126('0x2b')]['fields']));_0x323499[_0x1126('0x2e')]=_0x323499['attributes'][_0x1126('0x30')]?_0x323499[_0x1126('0x2e')]:_0x146066['model'];if(!_0x507568['query'][_0x1126('0x40')](_0x1126('0x41'))){_0x323499[_0x1126('0x12')]=qs['limit'](_0x507568[_0x1126('0x2b')][_0x1126('0x12')]);_0x323499[_0x1126('0x10')]=qs[_0x1126('0x10')](_0x507568['query'][_0x1126('0x10')]);}_0x323499[_0x1126('0x42')]=qs['sort'](_0x507568['query']['sort']);_0x323499['where']=qs[_0x1126('0x2c')](_[_0x1126('0x43')](_0x507568['query'],_0x146066[_0x1126('0x2c')]));_0x323499[_0x1126('0x24')][_0x1126('0x44')]=_0x1a15f8['id'];if(_0x507568[_0x1126('0x2b')][_0x1126('0x45')]){_0x323499['where']=_[_0x1126('0x46')](_0x323499[_0x1126('0x24')],{'$or':_['map'](_0x323499[_0x1126('0x2e')],function(_0x476aca){var _0xcc9499={};_0xcc9499[_0x476aca]={'$like':'%'+_0x507568[_0x1126('0x2b')][_0x1126('0x45')]+'%'};return _0xcc9499;})});}_0x323499=_['merge']({},_0x323499,_0x507568[_0x1126('0x32')]);return db['UserFaxQueue'][_0x1126('0x47')](_0x323499);}})[_0x1126('0x17')](function(_0x33c971){if(_0x33c971){return db['User'][_0x1126('0x48')]({'where':{'id':_[_0x1126('0x20')](_0x33c971,'UserId'),'role':_0x1126('0x49')},'attributes':['id',_0x1126('0x1e'),_0x1126('0x4a'),'updatedAt',_0x1126('0x4b')]});}})[_0x1126('0x17')](function(_0x22ab18){if(_0x22ab18){return{'count':_0x22ab18[_0x1126('0x13')],'rows':_[_0x1126('0x20')](_0x22ab18[_0x1126('0x4c')],function(_0x30c848){return{'membername':_0x30c848[_0x1126('0x1e')],'UserId':_0x30c848['id'],'queue_name':_0x120de1['name'],'FaxQueueId':_0x120de1['id'],'interface':util[_0x1126('0x4d')](_0x1126('0x4e'),_0x1126('0x4f'),_0x30c848[_0x1126('0x1e')]),'penalty':0x0,'paused':_0x30c848[_0x1126('0x4a')],'createdAt':_0x30c848['createdAt'],'updatedAt':_0x30c848[_0x1126('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1126('0x17')](respondWithFilteredResult(_0x2f45b9,_0x323499))['catch'](handleError(_0x2f45b9,null));};exports[_0x1126('0x51')]=function(_0x5246aa,_0x272274){var _0x10ff91={};var _0x478806={};var _0x3062d6;var _0x21d4ef;return db[_0x1126('0x21')]['findOne']({'where':{'id':_0x5246aa[_0x1126('0x3c')]['id']}})['then'](handleEntityNotFound(_0x272274,null))['then'](function(_0xbdc58){if(_0xbdc58){_0x3062d6=_0xbdc58;_0x478806[_0x1126('0x28')]=_[_0x1126('0x29')](db[_0x1126('0x52')][_0x1126('0x2a')]);_0x478806[_0x1126('0x2b')]=_[_0x1126('0x29')](_0x5246aa['query']);_0x478806[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x478806[_0x1126('0x28')],_0x478806[_0x1126('0x2b')]);_0x10ff91[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x478806['model'],qs['fields'](_0x5246aa[_0x1126('0x2b')][_0x1126('0x2f')]));_0x10ff91['attributes']=_0x10ff91['attributes']['length']?_0x10ff91['attributes']:_0x478806[_0x1126('0x28')];_0x10ff91[_0x1126('0x42')]=qs[_0x1126('0x53')](_0x5246aa['query'][_0x1126('0x53')]);_0x10ff91[_0x1126('0x24')]=qs[_0x1126('0x2c')](_[_0x1126('0x43')](_0x5246aa[_0x1126('0x2b')],_0x478806[_0x1126('0x2c')]));if(_0x5246aa[_0x1126('0x2b')]['filter']){_0x10ff91[_0x1126('0x24')]=_[_0x1126('0x46')](_0x10ff91[_0x1126('0x24')],{'$or':_[_0x1126('0x20')](_0x10ff91[_0x1126('0x2e')],function(_0x56c003){var _0x5d758d={};_0x5d758d[_0x56c003]={'$like':'%'+_0x5246aa[_0x1126('0x2b')][_0x1126('0x45')]+'%'};return _0x5d758d;})});}_0x10ff91=_['merge']({},_0x10ff91,_0x5246aa[_0x1126('0x32')]);return _0x3062d6[_0x1126('0x51')](_0x10ff91);}})[_0x1126('0x17')](function(_0x6a41c0){if(_0x6a41c0){_0x21d4ef=_0x6a41c0[_0x1126('0x30')];if(!_0x5246aa[_0x1126('0x2b')][_0x1126('0x40')](_0x1126('0x41'))){_0x10ff91[_0x1126('0x12')]=qs[_0x1126('0x12')](_0x5246aa[_0x1126('0x2b')][_0x1126('0x12')]);_0x10ff91[_0x1126('0x10')]=qs['offset'](_0x5246aa[_0x1126('0x2b')][_0x1126('0x10')]);}return _0x3062d6[_0x1126('0x51')](_0x10ff91);}})['then'](function(_0x484881){if(_0x484881){return _0x484881?{'count':_0x21d4ef,'rows':_0x484881}:null;}})[_0x1126('0x17')](respondWithResult(_0x272274,null))[_0x1126('0x26')](handleError(_0x272274,null));};exports[_0x1126('0x54')]=function(_0x3bfeb8,_0x51929e){var _0x590ee9=_0x3bfeb8['body'][_0x1126('0x55')];return db[_0x1126('0x52')][_0x1126('0x47')]({'where':{'id':_0x590ee9},'attributes':['id'],'include':[{'model':db[_0x1126('0x56')],'as':'Agents','attributes':['id',_0x1126('0x1e'),'online',_0x1126('0x57'),_0x1126('0x58')],'raw':!![]}]})[_0x1126('0x17')](function(_0xe8bda7){if(_0xe8bda7){var _0x3263cf=_[_0x1126('0x59')](_0xe8bda7,function(_0x9a61b1){var _0x5f5a36=_0x9a61b1[_0x1126('0x19')]({'plain':!![]});return _0x5f5a36['Agents'];});return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0x3bfeb8['params']['id']}})[_0x1126('0x17')](function(_0x372fbe){return db['sequelize'][_0x1126('0x5a')](function(_0x1442ab){return _0x372fbe['addTeams'](_0x590ee9,{'transaction':_0x1442ab})['then'](function(){return BPromise[_0x1126('0x5b')](_0x3263cf,function(_0xa27290){return db[_0x1126('0x3f')]['findOrCreate']({'where':{'UserId':_0xa27290['id'],'FaxQueueId':_0x3bfeb8['params']['id']},'transaction':_0x1442ab});});})['then'](function(){_0x3263cf[_0x1126('0x5c')](function(_0x4e5b01){socket['emit'](_0x1126('0x5d'),{'UserId':_0x4e5b01['id'],'FaxQueueId':_0x372fbe['id']});});});});});}})['then'](respondWithStatusCode(_0x51929e,null))[_0x1126('0x26')](handleError(_0x51929e,null));};exports[_0x1126('0x5e')]=function(_0x51ccdc,_0x133075){return db[_0x1126('0x52')][_0x1126('0x47')]({'where':{'id':_0x51ccdc[_0x1126('0x2b')][_0x1126('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1126('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x1126('0x17')](handleEntityNotFound(_0x133075,null))['then'](function(_0xd182b1){var _0x2d6fcf=_[_0x1126('0x20')](_0xd182b1,'id');var _0x2af2d0=[];var _0x2598a7=[];var _0x2cf3b9=squel[_0x1126('0x60')]();_0x2cf3b9[_0x1126('0x61')](_0x1126('0x62'))[_0x1126('0x63')](_0x1126('0x64'),'tq')[_0x1126('0x65')](_0x1126('0x66'),'ut',_0x1126('0x67'))[_0x1126('0x24')](_0x1126('0x68'),_0x51ccdc['params']['id']);for(var _0x31cfb5=0x0;_0x31cfb5<_0xd182b1[_0x1126('0x30')];_0x31cfb5+=0x1){let _0x33cccf=_0xd182b1[_0x31cfb5];for(var _0x1483f4=0x0;_0x1483f4<_0x33cccf[_0x1126('0x5f')]['length'];_0x1483f4+=0x1){let _0xd11e1f=_0x33cccf['Agents'][_0x1483f4];var _0x5bdb30=_0x2cf3b9[_0x1126('0x69')]();_0x5bdb30[_0x1126('0x24')]('ut.UserId\x20=\x20?',_0xd11e1f['id']);_0x2598a7['push'](db[_0x1126('0x6a')][_0x1126('0x2b')](_0x5bdb30[_0x1126('0x6b')](),{'type':db[_0x1126('0x6a')][_0x1126('0x6c')][_0x1126('0x6d')]})[_0x1126('0x17')](function(_0x35a9a4){if(_0x35a9a4[_0x1126('0x30')]===0x1){return _0xd11e1f['id'];}else{var _0x5644ea=_[_0x1126('0x6e')](_[_0x1126('0x20')](_0x35a9a4,_0x1126('0x6f')),function(_0xc69f7c){return _[_0x1126('0x70')](_0x2d6fcf,_0xc69f7c);});if(_0x5644ea){return _0xd11e1f['id'];}}}));}}return BPromise[_0x1126('0x71')](_0x2598a7)['then'](function(_0xadea7b){_0x2af2d0=_(_0x2af2d0)[_0x1126('0x72')](_0xadea7b)[_0x1126('0x73')]()[_0x1126('0x74')]();return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0x51ccdc[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](function(_0x38eac6){return db[_0x1126('0x6a')]['transaction'](function(_0x50238d){return _0x38eac6[_0x1126('0x5e')](_0x51ccdc['query'][_0x1126('0x55')],{'transaction':_0x50238d})['then'](function(){if(!_[_0x1126('0x75')](_0x2af2d0)){return _0x38eac6['removeAgents'](_0x2af2d0,{'transaction':_0x50238d});}})[_0x1126('0x17')](function(){_0x2af2d0['forEach'](function(_0x5c5044){socket['emit'](_0x1126('0x76'),{'UserId':_0x5c5044,'FaxQueueId':_0x38eac6['id']});});});});});});})[_0x1126('0x17')](respondWithStatusCode(_0x133075,null))['catch'](handleError(_0x133075,null));};exports['addAgents']=function(_0x44325d,_0xe2f82d){return db[_0x1126('0x21')]['find']({'where':{'id':_0x44325d['params']['id']}})[_0x1126('0x17')](handleEntityNotFound(_0xe2f82d,null))['then'](function(_0x41679a){if(_0x41679a){return _0x41679a[_0x1126('0x77')](_0x44325d[_0x1126('0x3b')][_0x1126('0x55')],_[_0x1126('0x78')](_0x44325d['body'],['ids','id'])||{})[_0x1126('0x79')](function(_0xd808db){for(var _0xfc9fb4=0x0;_0xfc9fb4<_0x44325d[_0x1126('0x3b')][_0x1126('0x55')][_0x1126('0x30')];_0xfc9fb4+=0x1){socket[_0x1126('0x7a')](_0x1126('0x5d'),{'UserId':Number(_0x44325d[_0x1126('0x3b')][_0x1126('0x55')][_0xfc9fb4]),'FaxQueueId':Number(_0x44325d[_0x1126('0x3c')]['id'])});}return _0xd808db;});}})['then'](respondWithResult(_0xe2f82d,null))[_0x1126('0x26')](handleError(_0xe2f82d,null));};exports['removeAgents']=function(_0x99eb4e,_0x4ec8b9){return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0x99eb4e[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x4ec8b9,null))['then'](function(_0x429183){if(_0x429183){return _0x429183[_0x1126('0x7b')](_0x99eb4e['query']['ids'])[_0x1126('0x17')](function(){if(_[_0x1126('0x7c')](_0x99eb4e[_0x1126('0x2b')]['ids'])){for(var _0x8e044c=0x0;_0x8e044c<_0x99eb4e['query'][_0x1126('0x55')][_0x1126('0x30')];_0x8e044c+=0x1){socket['emit'](_0x1126('0x76'),{'UserId':Number(_0x99eb4e[_0x1126('0x2b')][_0x1126('0x55')][_0x8e044c]),'FaxQueueId':Number(_0x99eb4e[_0x1126('0x3c')]['id'])});}}else{socket[_0x1126('0x7a')]('userFaxQueue:remove',{'UserId':Number(_0x99eb4e[_0x1126('0x2b')][_0x1126('0x55')]),'FaxQueueId':Number(_0x99eb4e[_0x1126('0x3c')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ec8b9,null))['catch'](handleError(_0x4ec8b9,null));};exports['getAgents']=function(_0x9d7607,_0x463051){var _0x1a7c9b={};var _0x2a1b22={};var _0x4fcca3;var _0x101553;return db[_0x1126('0x21')][_0x1126('0x7d')]({'where':{'id':_0x9d7607[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x463051,null))['then'](function(_0x1d5379){if(_0x1d5379){_0x4fcca3=_0x1d5379;_0x2a1b22[_0x1126('0x28')]=_['keys'](db[_0x1126('0x56')]['rawAttributes']);_0x2a1b22['query']=_[_0x1126('0x29')](_0x9d7607['query']);_0x2a1b22[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x2a1b22[_0x1126('0x28')],_0x2a1b22[_0x1126('0x2b')]);_0x1a7c9b[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x2a1b22[_0x1126('0x28')],qs[_0x1126('0x2f')](_0x9d7607[_0x1126('0x2b')]['fields']));_0x1a7c9b[_0x1126('0x2e')]=_0x1a7c9b[_0x1126('0x2e')][_0x1126('0x30')]?_0x1a7c9b[_0x1126('0x2e')]:_0x2a1b22['model'];_0x1a7c9b[_0x1126('0x42')]=qs[_0x1126('0x53')](_0x9d7607[_0x1126('0x2b')][_0x1126('0x53')]);_0x1a7c9b['where']=qs['filters'](_['pick'](_0x9d7607[_0x1126('0x2b')],_0x2a1b22['filters']));if(_0x9d7607[_0x1126('0x2b')][_0x1126('0x45')]){_0x1a7c9b['where']=_['merge'](_0x1a7c9b[_0x1126('0x24')],{'$or':_[_0x1126('0x20')](_0x1a7c9b['attributes'],function(_0x1e4172){var _0x1f9a7c={};_0x1f9a7c[_0x1e4172]={'$like':'%'+_0x9d7607['query'][_0x1126('0x45')]+'%'};return _0x1f9a7c;})});}_0x1a7c9b=_['merge']({},_0x1a7c9b,_0x9d7607[_0x1126('0x32')]);return _0x4fcca3[_0x1126('0x7e')](_0x1a7c9b);}})[_0x1126('0x17')](function(_0x4b65d8){if(_0x4b65d8){_0x101553=_0x4b65d8[_0x1126('0x30')];if(!_0x9d7607[_0x1126('0x2b')][_0x1126('0x40')](_0x1126('0x41'))){_0x1a7c9b[_0x1126('0x12')]=qs[_0x1126('0x12')](_0x9d7607[_0x1126('0x2b')][_0x1126('0x12')]);_0x1a7c9b[_0x1126('0x10')]=qs[_0x1126('0x10')](_0x9d7607[_0x1126('0x2b')][_0x1126('0x10')]);}return _0x4fcca3[_0x1126('0x7e')](_0x1a7c9b);}})[_0x1126('0x17')](function(_0x12ffa5){if(_0x12ffa5){return _0x12ffa5?{'count':_0x101553,'rows':_0x12ffa5}:null;}})[_0x1126('0x17')](respondWithResult(_0x463051,null))[_0x1126('0x26')](handleError(_0x463051,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fe41a86..a61b20a 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 _0xeb41=['emit','hasOwnProperty','hook','exports','events','FaxQueue','save'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xeb41,0x1a1));var _0x1eb4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xeb41[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x1eb4('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x1eb4('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1eb4('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x319070){return function(_0x31d918,_0x54da67,_0x5bea0d){FaxQueueEvents[_0x1eb4('0x3')](_0x319070+':'+_0x31d918['id'],_0x31d918);FaxQueueEvents['emit'](_0x319070,_0x31d918);_0x5bea0d(null);};}for(var e in events){if(events[_0x1eb4('0x4')](e)){var event=events[e];FaxQueue[_0x1eb4('0x5')](e,emitEvent(event));}}module[_0x1eb4('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0xe346=['events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x27d813,_0x39aa42){var _0x249870=function(_0x58c92b){while(--_0x58c92b){_0x27d813['push'](_0x27d813['shift']());}};_0x249870(++_0x39aa42);}(_0xe346,0x105));var _0x6e34=function(_0x2af569,_0x21d377){_0x2af569=_0x2af569-0x0;var _0x336636=_0xe346[_0x2af569];return _0x336636;};'use strict';var EventEmitter=require(_0x6e34('0x0'));var FaxQueue=require(_0x6e34('0x1'))['db'][_0x6e34('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6e34('0x3')](0x0);var events={'afterCreate':_0x6e34('0x4'),'afterUpdate':_0x6e34('0x5'),'afterDestroy':_0x6e34('0x6')};function emitEvent(_0x5aa653){return function(_0x3c7434,_0x1c6fea,_0x5ecac6){FaxQueueEvents[_0x6e34('0x7')](_0x5aa653+':'+_0x3c7434['id'],_0x3c7434);FaxQueueEvents[_0x6e34('0x7')](_0x5aa653,_0x3c7434);_0x5ecac6(null);};}for(var e in events){if(events[_0x6e34('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 9ce0ad3..543ceb5 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 _0x6619=['bluebird','request-promise','path','define','fax_queues','lodash','util','api','moment'];(function(_0x2ae8f5,_0x5ce818){var _0x454f5d=function(_0x382af1){while(--_0x382af1){_0x2ae8f5['push'](_0x2ae8f5['shift']());}};_0x454f5d(++_0x5ce818);}(_0x6619,0x140));var _0x9661=function(_0x7e10a2,_0x2bc699){_0x7e10a2=_0x7e10a2-0x0;var _0x4ad2be=_0x6619[_0x7e10a2];return _0x4ad2be;};'use strict';var _=require(_0x9661('0x0'));var util=require(_0x9661('0x1'));var logger=require('../../config/logger')(_0x9661('0x2'));var moment=require(_0x9661('0x3'));var BPromise=require(_0x9661('0x4'));var rp=require(_0x9661('0x5'));var fs=require('fs');var path=require(_0x9661('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module['exports']=function(_0x4cce26,_0x4937d1){return _0x4cce26[_0x9661('0x7')]('FaxQueue',attributes,{'tableName':_0x9661('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9462=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x5451b7,_0x2b65e9){var _0x4eafb6=function(_0x582cb8){while(--_0x582cb8){_0x5451b7['push'](_0x5451b7['shift']());}};_0x4eafb6(++_0x2b65e9);}(_0x9462,0x8e));var _0x2946=function(_0x2246d8,_0x18d75a){_0x2246d8=_0x2246d8-0x0;var _0x4b6134=_0x9462[_0x2246d8];return _0x4b6134;};'use strict';var _=require(_0x2946('0x0'));var util=require(_0x2946('0x1'));var logger=require(_0x2946('0x2'))(_0x2946('0x3'));var moment=require(_0x2946('0x4'));var BPromise=require(_0x2946('0x5'));var rp=require(_0x2946('0x6'));var fs=require('fs');var path=require(_0x2946('0x7'));var rimraf=require(_0x2946('0x8'));var config=require(_0x2946('0x9'));var attributes=require(_0x2946('0xa'));module[_0x2946('0xb')]=function(_0x35ff91,_0x1d8a81){return _0x35ff91['define'](_0x2946('0xc'),attributes,{'tableName':_0x2946('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index d81d552..f4270d6 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 _0x10ad=['http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0x10ad,0xbc));var _0xd10a=function(_0x554426,_0x2f4360){_0x554426=_0x554426-0x0;var _0x49ad51=_0x10ad[_0x554426];return _0x49ad51;};'use strict';var _=require(_0xd10a('0x0'));var util=require(_0xd10a('0x1'));var moment=require(_0xd10a('0x2'));var BPromise=require(_0xd10a('0x3'));var rs=require(_0xd10a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd10a('0x5'))['db'];var utils=require(_0xd10a('0x6'));var logger=require(_0xd10a('0x7'))(_0xd10a('0x8'));var config=require(_0xd10a('0x9'));var jayson=require(_0xd10a('0xa'));var client=jayson[_0xd10a('0xb')][_0xd10a('0xc')]({'port':0x232a});config[_0xd10a('0xd')]=_[_0xd10a('0xe')](config['redis'],{'host':_0xd10a('0xf'),'port':0x18eb});var socket=require(_0xd10a('0x10'))(new Redis(config[_0xd10a('0xd')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x16e9e3,_0x15b261,_0x22cb45){return new BPromise(function(_0x1cbed5,_0x1e1173){return client[_0xd10a('0x11')](_0x16e9e3,_0x22cb45)[_0xd10a('0x12')](function(_0x5ca2aa){logger[_0xd10a('0x13')](_0xd10a('0x14'),_0x15b261,'request\x20sent');logger[_0xd10a('0x15')](_0xd10a('0x16'),_0x15b261,_0xd10a('0x17'),JSON[_0xd10a('0x18')](_0x5ca2aa));if(_0x5ca2aa[_0xd10a('0x19')]){if(_0x5ca2aa[_0xd10a('0x19')][_0xd10a('0x1a')]===0x1f4){logger[_0xd10a('0x19')](_0xd10a('0x14'),_0x15b261,_0x5ca2aa[_0xd10a('0x19')]['message']);return _0x1e1173(_0x5ca2aa[_0xd10a('0x19')][_0xd10a('0x1b')]);}logger[_0xd10a('0x19')](_0xd10a('0x14'),_0x15b261,_0x5ca2aa[_0xd10a('0x19')]['message']);return _0x1cbed5(_0x5ca2aa[_0xd10a('0x19')][_0xd10a('0x1b')]);}else{logger[_0xd10a('0x13')](_0xd10a('0x14'),_0x15b261,_0xd10a('0x17'));_0x1cbed5(_0x5ca2aa['result'][_0xd10a('0x1b')]);}})[_0xd10a('0x1c')](function(_0xd40d63){logger[_0xd10a('0x19')](_0xd10a('0x14'),_0x15b261,_0xd40d63);_0x1e1173(_0xd40d63);});});}exports[_0xd10a('0x1d')]=function(_0xc295de){var _0x2ee625=this;return new Promise(function(_0x44e6bf,_0x51ef1d){return db[_0xd10a('0x1e')]['findAll']({'raw':_0xc295de[_0xd10a('0x1f')]?_0xc295de[_0xd10a('0x1f')][_0xd10a('0x20')]===undefined?!![]:![]:!![],'where':_0xc295de[_0xd10a('0x1f')]?_0xc295de[_0xd10a('0x1f')][_0xd10a('0x21')]||null:null,'attributes':_0xc295de[_0xd10a('0x1f')]?_0xc295de['options'][_0xd10a('0x22')]||null:null,'limit':_0xc295de[_0xd10a('0x1f')]?_0xc295de['options'][_0xd10a('0x23')]||null:null,'include':_0xc295de[_0xd10a('0x1f')]?_0xc295de[_0xd10a('0x1f')][_0xd10a('0x24')]?_[_0xd10a('0x25')](_0xc295de['options'][_0xd10a('0x24')],function(_0x338598){return{'model':db[_0x338598[_0xd10a('0x26')]],'as':_0x338598['as'],'attributes':_0x338598[_0xd10a('0x22')],'include':_0x338598['include']?_[_0xd10a('0x25')](_0x338598['include'],function(_0x4eb156){return{'model':db[_0x4eb156['model']],'as':_0x4eb156['as'],'attributes':_0x4eb156['attributes'],'include':_0x4eb156['include']?_[_0xd10a('0x25')](_0x4eb156[_0xd10a('0x24')],function(_0x4dda06){return{'model':db[_0x4dda06[_0xd10a('0x26')]],'as':_0x4dda06['as'],'attributes':_0x4dda06[_0xd10a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x12')](function(_0x3d3c62){logger[_0xd10a('0x13')](_0xd10a('0x1d'),_0xc295de);logger[_0xd10a('0x15')](_0xd10a('0x1d'),_0xc295de,JSON[_0xd10a('0x18')](_0x3d3c62));_0x44e6bf(_0x3d3c62);})[_0xd10a('0x1c')](function(_0x1589be){logger[_0xd10a('0x19')](_0xd10a('0x1d'),_0x1589be['message'],_0xc295de);_0x51ef1d(_0x2ee625[_0xd10a('0x19')](0x1f4,_0x1589be[_0xd10a('0x1b')]));});});};exports['ShowFaxQueue']=function(_0x421060){var _0x4db87d=this;return new Promise(function(_0x161815,_0x17a3bd){return db[_0xd10a('0x1e')]['find']({'raw':_0x421060[_0xd10a('0x1f')]?_0x421060['options'][_0xd10a('0x20')]===undefined?!![]:![]:!![],'where':_0x421060[_0xd10a('0x1f')]?_0x421060[_0xd10a('0x1f')][_0xd10a('0x21')]||null:null,'attributes':_0x421060[_0xd10a('0x1f')]?_0x421060[_0xd10a('0x1f')][_0xd10a('0x22')]||null:null,'include':_0x421060[_0xd10a('0x1f')]?_0x421060[_0xd10a('0x1f')][_0xd10a('0x24')]?_[_0xd10a('0x25')](_0x421060[_0xd10a('0x1f')][_0xd10a('0x24')],function(_0x5cacf9){return{'model':db[_0x5cacf9[_0xd10a('0x26')]],'as':_0x5cacf9['as'],'attributes':_0x5cacf9[_0xd10a('0x22')],'include':_0x5cacf9[_0xd10a('0x24')]?_[_0xd10a('0x25')](_0x5cacf9[_0xd10a('0x24')],function(_0x337502){return{'model':db[_0x337502['model']],'as':_0x337502['as'],'attributes':_0x337502[_0xd10a('0x22')],'include':_0x337502['include']?_[_0xd10a('0x25')](_0x337502[_0xd10a('0x24')],function(_0x220969){return{'model':db[_0x220969[_0xd10a('0x26')]],'as':_0x220969['as'],'attributes':_0x220969[_0xd10a('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9c6d){logger[_0xd10a('0x13')](_0xd10a('0x27'),_0x421060);logger[_0xd10a('0x15')](_0xd10a('0x27'),_0x421060,JSON[_0xd10a('0x18')](_0x5e9c6d));_0x161815(_0x5e9c6d);})['catch'](function(_0x2e742a){logger[_0xd10a('0x19')](_0xd10a('0x27'),_0x2e742a['message'],_0x421060);_0x17a3bd(_0x4db87d['error'](0x1f4,_0x2e742a[_0xd10a('0x1b')]));});});}; \ No newline at end of file +var _0xfe19=['debug','catch','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','FaxQueue','findAll','options','raw','where','include','map','model','attributes','GetFaxQueue'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0xfe19,0x1b3));var _0x9fe1=function(_0x4e9f12,_0x7122af){_0x4e9f12=_0x4e9f12-0x0;var _0x23aecd=_0xfe19[_0x4e9f12];return _0x23aecd;};'use strict';var _=require(_0x9fe1('0x0'));var util=require(_0x9fe1('0x1'));var moment=require(_0x9fe1('0x2'));var BPromise=require(_0x9fe1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fe1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9fe1('0x5'))('rpc');var config=require(_0x9fe1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9fe1('0x7')][_0x9fe1('0x8')]({'port':0x232a});config[_0x9fe1('0x9')]=_[_0x9fe1('0xa')](config[_0x9fe1('0x9')],{'host':_0x9fe1('0xb'),'port':0x18eb});var socket=require(_0x9fe1('0xc'))(new Redis(config[_0x9fe1('0x9')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x116501,_0x3309c9,_0x2cbeda){return new BPromise(function(_0x4a90ed,_0x31aab4){return client['request'](_0x116501,_0x2cbeda)[_0x9fe1('0xd')](function(_0x1ca76f){logger['info'](_0x9fe1('0xe'),_0x3309c9,_0x9fe1('0xf'));logger['debug'](_0x9fe1('0x10'),_0x3309c9,_0x9fe1('0xf'),JSON[_0x9fe1('0x11')](_0x1ca76f));if(_0x1ca76f[_0x9fe1('0x12')]){if(_0x1ca76f[_0x9fe1('0x12')][_0x9fe1('0x13')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3309c9,_0x1ca76f[_0x9fe1('0x12')][_0x9fe1('0x14')]);return _0x31aab4(_0x1ca76f[_0x9fe1('0x12')][_0x9fe1('0x14')]);}logger[_0x9fe1('0x12')](_0x9fe1('0xe'),_0x3309c9,_0x1ca76f[_0x9fe1('0x12')][_0x9fe1('0x14')]);return _0x4a90ed(_0x1ca76f['error']['message']);}else{logger[_0x9fe1('0x15')](_0x9fe1('0xe'),_0x3309c9,_0x9fe1('0xf'));_0x4a90ed(_0x1ca76f[_0x9fe1('0x16')][_0x9fe1('0x14')]);}})['catch'](function(_0x49af6f){logger[_0x9fe1('0x12')](_0x9fe1('0xe'),_0x3309c9,_0x49af6f);_0x31aab4(_0x49af6f);});});}exports['GetFaxQueue']=function(_0x5b4faa){var _0x3400b8=this;return new Promise(function(_0x4c61dc,_0x51f305){return db[_0x9fe1('0x17')][_0x9fe1('0x18')]({'raw':_0x5b4faa['options']?_0x5b4faa[_0x9fe1('0x19')][_0x9fe1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b4faa['options']?_0x5b4faa['options'][_0x9fe1('0x1b')]||null:null,'attributes':_0x5b4faa[_0x9fe1('0x19')]?_0x5b4faa[_0x9fe1('0x19')]['attributes']||null:null,'limit':_0x5b4faa[_0x9fe1('0x19')]?_0x5b4faa['options']['limit']||null:null,'include':_0x5b4faa[_0x9fe1('0x19')]?_0x5b4faa['options'][_0x9fe1('0x1c')]?_[_0x9fe1('0x1d')](_0x5b4faa[_0x9fe1('0x19')][_0x9fe1('0x1c')],function(_0x111e1f){return{'model':db[_0x111e1f[_0x9fe1('0x1e')]],'as':_0x111e1f['as'],'attributes':_0x111e1f[_0x9fe1('0x1f')],'include':_0x111e1f[_0x9fe1('0x1c')]?_[_0x9fe1('0x1d')](_0x111e1f[_0x9fe1('0x1c')],function(_0x3b8966){return{'model':db[_0x3b8966[_0x9fe1('0x1e')]],'as':_0x3b8966['as'],'attributes':_0x3b8966[_0x9fe1('0x1f')],'include':_0x3b8966[_0x9fe1('0x1c')]?_['map'](_0x3b8966['include'],function(_0x3cc37b){return{'model':db[_0x3cc37b[_0x9fe1('0x1e')]],'as':_0x3cc37b['as'],'attributes':_0x3cc37b[_0x9fe1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9fe1('0xd')](function(_0x56bc92){logger[_0x9fe1('0x15')](_0x9fe1('0x20'),_0x5b4faa);logger[_0x9fe1('0x21')](_0x9fe1('0x20'),_0x5b4faa,JSON['stringify'](_0x56bc92));_0x4c61dc(_0x56bc92);})[_0x9fe1('0x22')](function(_0x1e640d){logger['error'](_0x9fe1('0x20'),_0x1e640d[_0x9fe1('0x14')],_0x5b4faa);_0x51f305(_0x3400b8[_0x9fe1('0x12')](0x1f4,_0x1e640d[_0x9fe1('0x14')]));});});};exports['ShowFaxQueue']=function(_0x4e5792){var _0x2a9f90=this;return new Promise(function(_0x1f7c1b,_0xfd394){return db[_0x9fe1('0x17')]['find']({'raw':_0x4e5792[_0x9fe1('0x19')]?_0x4e5792[_0x9fe1('0x19')][_0x9fe1('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e5792[_0x9fe1('0x19')]?_0x4e5792['options'][_0x9fe1('0x1b')]||null:null,'attributes':_0x4e5792[_0x9fe1('0x19')]?_0x4e5792[_0x9fe1('0x19')][_0x9fe1('0x1f')]||null:null,'include':_0x4e5792[_0x9fe1('0x19')]?_0x4e5792['options'][_0x9fe1('0x1c')]?_[_0x9fe1('0x1d')](_0x4e5792['options']['include'],function(_0x315d1e){return{'model':db[_0x315d1e[_0x9fe1('0x1e')]],'as':_0x315d1e['as'],'attributes':_0x315d1e[_0x9fe1('0x1f')],'include':_0x315d1e[_0x9fe1('0x1c')]?_[_0x9fe1('0x1d')](_0x315d1e[_0x9fe1('0x1c')],function(_0x17e51c){return{'model':db[_0x17e51c[_0x9fe1('0x1e')]],'as':_0x17e51c['as'],'attributes':_0x17e51c[_0x9fe1('0x1f')],'include':_0x17e51c['include']?_[_0x9fe1('0x1d')](_0x17e51c['include'],function(_0x1cfebc){return{'model':db[_0x1cfebc[_0x9fe1('0x1e')]],'as':_0x1cfebc['as'],'attributes':_0x1cfebc['attributes']};}):[]};}):[]};}):[]:[]})[_0x9fe1('0xd')](function(_0x3ee1fd){logger[_0x9fe1('0x15')](_0x9fe1('0x23'),_0x4e5792);logger[_0x9fe1('0x21')](_0x9fe1('0x23'),_0x4e5792,JSON['stringify'](_0x3ee1fd));_0x1f7c1b(_0x3ee1fd);})['catch'](function(_0x27f1ef){logger[_0x9fe1('0x12')](_0x9fe1('0x23'),_0x27f1ef[_0x9fe1('0x14')],_0x4e5792);_0xfd394(_0x2a9f90[_0x9fe1('0x12')](0x1f4,_0x27f1ef[_0x9fe1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 56ba73d..0b42f3a 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 _0xcebf=['remove','update','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x10acdf,_0xa50b51){var _0x476063=function(_0x1b973d){while(--_0x1b973d){_0x10acdf['push'](_0x10acdf['shift']());}};_0x476063(++_0xa50b51);}(_0xcebf,0xd6));var _0xfceb=function(_0x442d41,_0x547170){_0x442d41=_0x442d41-0x0;var _0x45bb52=_0xcebf[_0x442d41];return _0x45bb52;};'use strict';var FaxQueueEvents=require(_0xfceb('0x0'));var events=[_0xfceb('0x1'),_0xfceb('0x2'),_0xfceb('0x3')];function createListener(_0xbd63bd,_0x5b5067){return function(_0x4c06a4){_0x5b5067['emit'](_0xbd63bd,_0x4c06a4);};}function removeListener(_0x1bc3a2,_0x1b7e47){return function(){FaxQueueEvents[_0xfceb('0x4')](_0x1bc3a2,_0x1b7e47);};}exports[_0xfceb('0x5')]=function(_0x931525){for(var _0x261e08=0x0,_0x16b240=events[_0xfceb('0x6')];_0x261e08<_0x16b240;_0x261e08++){var _0x513190=events[_0x261e08];var _0x5e8920=createListener(_0xfceb('0x7')+_0x513190,_0x931525);FaxQueueEvents['on'](_0x513190,_0x5e8920);}}; \ No newline at end of file +var _0xcbd1=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x571098,_0x5721a8){var _0x41e5ab=function(_0x1bae03){while(--_0x1bae03){_0x571098['push'](_0x571098['shift']());}};_0x41e5ab(++_0x5721a8);}(_0xcbd1,0x15b));var _0x1cbd=function(_0x40ac03,_0x24c9db){_0x40ac03=_0x40ac03-0x0;var _0x4c26a3=_0xcbd1[_0x40ac03];return _0x4c26a3;};'use strict';var FaxQueueEvents=require(_0x1cbd('0x0'));var events=[_0x1cbd('0x1'),_0x1cbd('0x2'),_0x1cbd('0x3')];function createListener(_0x383061,_0x1b33cf){return function(_0x36d569){_0x1b33cf[_0x1cbd('0x4')](_0x383061,_0x36d569);};}function removeListener(_0x159d92,_0x4b0ff2){return function(){FaxQueueEvents[_0x1cbd('0x5')](_0x159d92,_0x4b0ff2);};}exports[_0x1cbd('0x6')]=function(_0x2afb5f){for(var _0x73b901=0x0,_0x2c93a3=events[_0x1cbd('0x7')];_0x73b901<_0x2c93a3;_0x73b901++){var _0x208c8d=events[_0x73b901];var _0x28305f=createListener(_0x1cbd('0x8')+_0x208c8d,_0x2afb5f);FaxQueueEvents['on'](_0x208c8d,_0x28305f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 765eeae..97a1738 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 _0x8085=['Router','fs-extra','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','connect-timeout','express'];(function(_0x7b73ce,_0x13b3fe){var _0x31a748=function(_0x224d79){while(--_0x224d79){_0x7b73ce['push'](_0x7b73ce['shift']());}};_0x31a748(++_0x13b3fe);}(_0x8085,0x71));var _0x5808=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x8085[_0x28611e];return _0x530f69;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var fs_extra=require(_0x5808('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5808('0x5'));var controller=require(_0x5808('0x6'));router['get']('/',auth[_0x5808('0x7')](),controller[_0x5808('0x8')]);router[_0x5808('0x9')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xb')]);router[_0x5808('0x9')](_0x5808('0xc'),auth[_0x5808('0x7')](),controller[_0x5808('0xd')]);router[_0x5808('0x9')](_0x5808('0xe'),auth[_0x5808('0x7')](),controller[_0x5808('0xf')]);router[_0x5808('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5808('0x10')]);router[_0x5808('0x9')](_0x5808('0x11'),auth[_0x5808('0x7')](),controller[_0x5808('0x12')]);router[_0x5808('0x13')]('/',auth[_0x5808('0x7')](),controller['create']);router['post'](_0x5808('0x14'),auth[_0x5808('0x7')](),controller[_0x5808('0x15')]);router[_0x5808('0x13')](_0x5808('0x11'),auth[_0x5808('0x7')](),controller[_0x5808('0x16')]);router[_0x5808('0x17')](_0x5808('0xc'),auth[_0x5808('0x7')](),controller[_0x5808('0x18')]);router['delete'](_0x5808('0xc'),auth['isAuthenticated'](),controller[_0x5808('0x19')]);router[_0x5808('0x1a')](_0x5808('0x14'),auth['isAuthenticated'](),controller[_0x5808('0x1b')]);router[_0x5808('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0x5808('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x6a55=['index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x13dcbf,_0x2576c6){var _0x251d94=function(_0x5480dc){while(--_0x5480dc){_0x13dcbf['push'](_0x13dcbf['shift']());}};_0x251d94(++_0x2576c6);}(_0x6a55,0xdb));var _0x56a5=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x6a55[_0x38ced4];return _0x547c07;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./faxQueue.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x4')]('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0x9')]);router[_0x56a5('0x4')](_0x56a5('0xa'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xb')]);router[_0x56a5('0x4')](_0x56a5('0xc'),auth[_0x56a5('0x5')](),controller['getTeams']);router['get'](_0x56a5('0xd'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xe')]);router[_0x56a5('0xf')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x10')]);router['post']('/:id/teams',auth[_0x56a5('0x5')](),controller[_0x56a5('0x11')]);router[_0x56a5('0xf')](_0x56a5('0xd'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x12')]);router[_0x56a5('0x13')]('/:id',auth[_0x56a5('0x5')](),controller['update']);router[_0x56a5('0x14')]('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0x15')]);router[_0x56a5('0x14')](_0x56a5('0xc'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x16')]);router[_0x56a5('0x14')]('/:id/users',auth[_0x56a5('0x5')](),controller[_0x56a5('0x17')]);module[_0x56a5('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8e95fc8..2b9b225 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 _0xa48b=['STRING','moment','sequelize','exports','DATE'];(function(_0x57d19e,_0x33f1a8){var _0x1dfa04=function(_0x22df5b){while(--_0x22df5b){_0x57d19e['push'](_0x57d19e['shift']());}};_0x1dfa04(++_0x33f1a8);}(_0xa48b,0xc4));var _0xba48=function(_0x3bb8bd,_0x1aa192){_0x3bb8bd=_0x3bb8bd-0x0;var _0x47461e=_0xa48b[_0x3bb8bd];return _0x47461e;};'use strict';var moment=require(_0xba48('0x0'));var Sequelize=require(_0xba48('0x1'));module[_0xba48('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xba48('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba48('0x3')]},'reason':{'type':Sequelize[_0xba48('0x4')]}}; \ No newline at end of file +var _0x4afa=['sequelize','exports','STRING','DATE'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x4afa,0x10c));var _0xa4af=function(_0x1b3746,_0x311230){_0x1b3746=_0x1b3746-0x0;var _0x317103=_0x4afa[_0x1b3746];return _0x317103;};'use strict';var moment=require('moment');var Sequelize=require(_0xa4af('0x0'));module[_0xa4af('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa4af('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa4af('0x3')]},'acceptAt':{'type':Sequelize[_0xa4af('0x3')]},'exitAt':{'type':Sequelize[_0xa4af('0x3')]},'reason':{'type':Sequelize[_0xa4af('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0ea1af2..89918eb 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 _0xe79a=['../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','update','destroy','then','name','send','map','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','FaxQueueReport','includeAll','rows','catch','show','rawAttributes','keys','include','find','create','body','params','describe','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xe79a,0x70));var _0xae79=function(_0x4941c6,_0x3ca9f8){_0x4941c6=_0x4941c6-0x0;var _0x4d3654=_0xe79a[_0x4941c6];return _0x4d3654;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xae79('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae79('0x1'));var moment=require(_0xae79('0x2'));var BPromise=require(_0xae79('0x3'));var Mustache=require(_0xae79('0x4'));var util=require('util');var path=require(_0xae79('0x5'));var sox=require(_0xae79('0x6'));var csv=require(_0xae79('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae79('0x8'));var _=require(_0xae79('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xae79('0xa'));var deskjs=require(_0xae79('0xb'));var toCsv=require('to-csv');var querystring=require(_0xae79('0xc'));var Papa=require('papaparse');var Redis=require(_0xae79('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae79('0xe'));var hardwareService=require(_0xae79('0xf'));var logger=require(_0xae79('0x10'))('api');var utils=require(_0xae79('0x11'));var config=require(_0xae79('0x12'));var licenseUtil=require(_0xae79('0x13'));var db=require(_0xae79('0x14'))['db'];function respondWithStatusCode(_0x326e99,_0x147a72){_0x147a72=_0x147a72||0xcc;return function(_0x1e1dbc){if(_0x1e1dbc){return _0x326e99[_0xae79('0x15')](_0x147a72);}return _0x326e99[_0xae79('0x16')](_0x147a72)[_0xae79('0x17')]();};}function respondWithResult(_0x478937,_0xdbae20){_0xdbae20=_0xdbae20||0xc8;return function(_0x456180){if(_0x456180){return _0x478937[_0xae79('0x16')](_0xdbae20)[_0xae79('0x18')](_0x456180);}};}function respondWithFilteredResult(_0x4c8f9a,_0x4e4615){return function(_0x101327){if(_0x101327){var _0x27809a=typeof _0x4e4615['offset']===_0xae79('0x19')&&typeof _0x4e4615['limit']===_0xae79('0x19');var _0x44f55e=_0x101327[_0xae79('0x1a')];var _0x371944=_0x27809a?0x0:_0x4e4615[_0xae79('0x1b')];var _0x5cb7d5=_0x27809a?_0x101327[_0xae79('0x1a')]:_0x4e4615[_0xae79('0x1b')]+_0x4e4615[_0xae79('0x1c')];var _0x23fd7d;if(_0x5cb7d5>=_0x44f55e){_0x5cb7d5=_0x44f55e;_0x23fd7d=0xc8;}else{_0x23fd7d=0xce;}_0x4c8f9a[_0xae79('0x16')](_0x23fd7d);return _0x4c8f9a[_0xae79('0x1d')]('Content-Range',_0x371944+'-'+_0x5cb7d5+'/'+_0x44f55e)[_0xae79('0x18')](_0x101327);}return null;};}function patchUpdates(_0x1c4840){return function(_0x27b5fe){try{jsonpatch['apply'](_0x27b5fe,_0x1c4840,!![]);}catch(_0xb0d047){return BPromise[_0xae79('0x1e')](_0xb0d047);}return _0x27b5fe['save']();};}function saveUpdates(_0x2c83e3,_0x2d006d){return function(_0x173ded){if(_0x173ded){return _0x173ded[_0xae79('0x1f')](_0x2c83e3)['then'](function(_0x42fbbc){return _0x42fbbc;});}return null;};}function removeEntity(_0x33f0c5,_0x49c55e){return function(_0x5d4a57){if(_0x5d4a57){return _0x5d4a57[_0xae79('0x20')]()[_0xae79('0x21')](function(){_0x33f0c5['status'](0xcc)[_0xae79('0x17')]();});}};}function handleEntityNotFound(_0x6a289b,_0x819255){return function(_0x1621e0){if(!_0x1621e0){_0x6a289b['sendStatus'](0x194);}return _0x1621e0;};}function handleError(_0x1e8618,_0x504d65){_0x504d65=_0x504d65||0x1f4;return function(_0x3ee7ea){logger['error'](_0x3ee7ea['stack']);if(_0x3ee7ea[_0xae79('0x22')]){delete _0x3ee7ea['name'];}_0x1e8618[_0xae79('0x16')](_0x504d65)[_0xae79('0x23')](_0x3ee7ea);};}exports['index']=function(_0x55731c,_0x85caa7){var _0x5b43cd={},_0x7281ce={},_0x15a04b={'count':0x0,'rows':[]};var _0xcd6911=_[_0xae79('0x24')](db['FaxQueueReport']['rawAttributes'],function(_0x36a0cf){return{'name':_0x36a0cf['fieldName'],'type':_0x36a0cf[_0xae79('0x25')][_0xae79('0x26')]};});_0x7281ce[_0xae79('0x27')]=_[_0xae79('0x24')](_0xcd6911,_0xae79('0x22'));_0x7281ce[_0xae79('0x28')]=_['keys'](_0x55731c[_0xae79('0x28')]);_0x7281ce[_0xae79('0x29')]=_[_0xae79('0x2a')](_0x7281ce['model'],_0x7281ce[_0xae79('0x28')]);_0x5b43cd[_0xae79('0x2b')]=_[_0xae79('0x2a')](_0x7281ce[_0xae79('0x27')],qs[_0xae79('0x2c')](_0x55731c['query'][_0xae79('0x2c')]));_0x5b43cd[_0xae79('0x2b')]=_0x5b43cd[_0xae79('0x2b')]['length']?_0x5b43cd['attributes']:_0x7281ce[_0xae79('0x27')];if(!_0x55731c[_0xae79('0x28')][_0xae79('0x2d')]('nolimit')){_0x5b43cd[_0xae79('0x1c')]=qs[_0xae79('0x1c')](_0x55731c['query'][_0xae79('0x1c')]);_0x5b43cd[_0xae79('0x1b')]=qs[_0xae79('0x1b')](_0x55731c['query'][_0xae79('0x1b')]);}_0x5b43cd[_0xae79('0x2e')]=qs[_0xae79('0x2f')](_0x55731c[_0xae79('0x28')][_0xae79('0x2f')]);_0x5b43cd['where']=qs[_0xae79('0x29')](_[_0xae79('0x30')](_0x55731c[_0xae79('0x28')],_0x7281ce[_0xae79('0x29')]),_0xcd6911);if(_0x55731c['query'][_0xae79('0x31')]){_0x5b43cd[_0xae79('0x32')]=_[_0xae79('0x33')](_0x5b43cd['where'],{'$or':_[_0xae79('0x24')](_0xcd6911,function(_0x377b46){if(_0x377b46[_0xae79('0x25')]!=='VIRTUAL'){var _0x19d6f1={};_0x19d6f1[_0x377b46[_0xae79('0x22')]]={'$like':'%'+_0x55731c['query'][_0xae79('0x31')]+'%'};return _0x19d6f1;}})});}_0x5b43cd=_[_0xae79('0x33')]({},_0x5b43cd,_0x55731c[_0xae79('0x34')]);var _0x50c9e4={'where':_0x5b43cd[_0xae79('0x32')]};return db[_0xae79('0x35')][_0xae79('0x1a')](_0x50c9e4)[_0xae79('0x21')](function(_0x343b7a){_0x15a04b[_0xae79('0x1a')]=_0x343b7a;if(_0x55731c[_0xae79('0x28')][_0xae79('0x36')]){_0x5b43cd['include']=[{'all':!![]}];}return db[_0xae79('0x35')]['findAll'](_0x5b43cd);})[_0xae79('0x21')](function(_0x3a8c4b){_0x15a04b[_0xae79('0x37')]=_0x3a8c4b;return _0x15a04b;})[_0xae79('0x21')](respondWithFilteredResult(_0x85caa7,_0x5b43cd))[_0xae79('0x38')](handleError(_0x85caa7,null));};exports[_0xae79('0x39')]=function(_0x5b8962,_0x2ea9d6){var _0x326d50={'raw':!![],'where':{'id':_0x5b8962['params']['id']}},_0x40cbe9={};_0x40cbe9[_0xae79('0x27')]=_['keys'](db[_0xae79('0x35')][_0xae79('0x3a')]);_0x40cbe9[_0xae79('0x28')]=_[_0xae79('0x3b')](_0x5b8962[_0xae79('0x28')]);_0x40cbe9['filters']=_[_0xae79('0x2a')](_0x40cbe9[_0xae79('0x27')],_0x40cbe9[_0xae79('0x28')]);_0x326d50[_0xae79('0x2b')]=_[_0xae79('0x2a')](_0x40cbe9[_0xae79('0x27')],qs['fields'](_0x5b8962[_0xae79('0x28')]['fields']));_0x326d50[_0xae79('0x2b')]=_0x326d50[_0xae79('0x2b')]['length']?_0x326d50[_0xae79('0x2b')]:_0x40cbe9[_0xae79('0x27')];if(_0x5b8962['query']['includeAll']){_0x326d50[_0xae79('0x3c')]=[{'all':!![]}];}_0x326d50=_[_0xae79('0x33')]({},_0x326d50,_0x5b8962['options']);return db['FaxQueueReport'][_0xae79('0x3d')](_0x326d50)[_0xae79('0x21')](handleEntityNotFound(_0x2ea9d6,null))[_0xae79('0x21')](respondWithResult(_0x2ea9d6,null))[_0xae79('0x38')](handleError(_0x2ea9d6,null));};exports['create']=function(_0x5b15b9,_0x596a2b){return db['FaxQueueReport'][_0xae79('0x3e')](_0x5b15b9[_0xae79('0x3f')],{})[_0xae79('0x21')](respondWithResult(_0x596a2b,0xc9))[_0xae79('0x38')](handleError(_0x596a2b,null));};exports[_0xae79('0x1f')]=function(_0x34f1b4,_0x2cea67){if(_0x34f1b4[_0xae79('0x3f')]['id']){delete _0x34f1b4['body']['id'];}return db[_0xae79('0x35')][_0xae79('0x3d')]({'where':{'id':_0x34f1b4[_0xae79('0x40')]['id']}})[_0xae79('0x21')](handleEntityNotFound(_0x2cea67,null))[_0xae79('0x21')](saveUpdates(_0x34f1b4[_0xae79('0x3f')],null))['then'](respondWithResult(_0x2cea67,null))[_0xae79('0x38')](handleError(_0x2cea67,null));};exports[_0xae79('0x20')]=function(_0x7f74fb,_0x6865a8){return db['FaxQueueReport']['find']({'where':{'id':_0x7f74fb[_0xae79('0x40')]['id']}})[_0xae79('0x21')](handleEntityNotFound(_0x6865a8,null))['then'](removeEntity(_0x6865a8,null))[_0xae79('0x38')](handleError(_0x6865a8,null));};exports['describe']=function(_0x384f6a,_0x26aa45){return db[_0xae79('0x35')][_0xae79('0x41')]()['then'](respondWithResult(_0x26aa45,null))[_0xae79('0x38')](handleError(_0x26aa45,null));}; \ No newline at end of file +var _0xe28e=['squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','send','index','map','FaxQueueReport','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x3797f1,_0x4c7281){var _0x366490=function(_0x3b39bd){while(--_0x3b39bd){_0x3797f1['push'](_0x3797f1['shift']());}};_0x366490(++_0x4c7281);}(_0xe28e,0x1ba));var _0xee28=function(_0x377b33,_0x3c57cc){_0x377b33=_0x377b33-0x0;var _0x4dad04=_0xe28e[_0x377b33];return _0x4dad04;};'use strict';var emlformat=require(_0xee28('0x0'));var rimraf=require(_0xee28('0x1'));var zipdir=require(_0xee28('0x2'));var jsonpatch=require(_0xee28('0x3'));var rp=require(_0xee28('0x4'));var moment=require(_0xee28('0x5'));var BPromise=require(_0xee28('0x6'));var Mustache=require(_0xee28('0x7'));var util=require(_0xee28('0x8'));var path=require(_0xee28('0x9'));var sox=require(_0xee28('0xa'));var csv=require(_0xee28('0xb'));var ejs=require(_0xee28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xb'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var as=require(_0xee28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee28('0x15'))(_0xee28('0x16'));var utils=require('../../config/utils');var config=require(_0xee28('0x17'));var licenseUtil=require(_0xee28('0x18'));var db=require(_0xee28('0x19'))['db'];function respondWithStatusCode(_0x2488cf,_0x267031){_0x267031=_0x267031||0xcc;return function(_0x46e784){if(_0x46e784){return _0x2488cf[_0xee28('0x1a')](_0x267031);}return _0x2488cf['status'](_0x267031)[_0xee28('0x1b')]();};}function respondWithResult(_0x1df69a,_0x555b9c){_0x555b9c=_0x555b9c||0xc8;return function(_0x331b7c){if(_0x331b7c){return _0x1df69a[_0xee28('0x1c')](_0x555b9c)['json'](_0x331b7c);}};}function respondWithFilteredResult(_0x11ac93,_0x17c99a){return function(_0x3d3a5c){if(_0x3d3a5c){var _0x343358=typeof _0x17c99a[_0xee28('0x1d')]===_0xee28('0x1e')&&typeof _0x17c99a['limit']===_0xee28('0x1e');var _0x5de212=_0x3d3a5c[_0xee28('0x1f')];var _0x19472a=_0x343358?0x0:_0x17c99a['offset'];var _0x355b07=_0x343358?_0x3d3a5c['count']:_0x17c99a[_0xee28('0x1d')]+_0x17c99a['limit'];var _0x28da88;if(_0x355b07>=_0x5de212){_0x355b07=_0x5de212;_0x28da88=0xc8;}else{_0x28da88=0xce;}_0x11ac93['status'](_0x28da88);return _0x11ac93[_0xee28('0x20')]('Content-Range',_0x19472a+'-'+_0x355b07+'/'+_0x5de212)[_0xee28('0x21')](_0x3d3a5c);}return null;};}function patchUpdates(_0x2a01ff){return function(_0x96f5db){try{jsonpatch[_0xee28('0x22')](_0x96f5db,_0x2a01ff,!![]);}catch(_0x21ee24){return BPromise[_0xee28('0x23')](_0x21ee24);}return _0x96f5db[_0xee28('0x24')]();};}function saveUpdates(_0x4bda53,_0x342798){return function(_0x44d7ff){if(_0x44d7ff){return _0x44d7ff[_0xee28('0x25')](_0x4bda53)['then'](function(_0x5b500b){return _0x5b500b;});}return null;};}function removeEntity(_0x17d8e4,_0x4a524d){return function(_0x1519ae){if(_0x1519ae){return _0x1519ae[_0xee28('0x26')]()[_0xee28('0x27')](function(){_0x17d8e4[_0xee28('0x1c')](0xcc)[_0xee28('0x1b')]();});}};}function handleEntityNotFound(_0x95d917,_0x2a7c95){return function(_0x733ca8){if(!_0x733ca8){_0x95d917[_0xee28('0x1a')](0x194);}return _0x733ca8;};}function handleError(_0x4ce19b,_0x2c847b){_0x2c847b=_0x2c847b||0x1f4;return function(_0x5b1b1e){logger['error'](_0x5b1b1e['stack']);if(_0x5b1b1e['name']){delete _0x5b1b1e['name'];}_0x4ce19b[_0xee28('0x1c')](_0x2c847b)[_0xee28('0x28')](_0x5b1b1e);};}exports[_0xee28('0x29')]=function(_0x469889,_0x346201){var _0x417840={},_0xbafd67={},_0x4fcc8f={'count':0x0,'rows':[]};var _0x84e0ba=_[_0xee28('0x2a')](db[_0xee28('0x2b')]['rawAttributes'],function(_0x14f7c4){return{'name':_0x14f7c4[_0xee28('0x2c')],'type':_0x14f7c4[_0xee28('0x2d')][_0xee28('0x2e')]};});_0xbafd67[_0xee28('0x2f')]=_[_0xee28('0x2a')](_0x84e0ba,_0xee28('0x30'));_0xbafd67['query']=_[_0xee28('0x31')](_0x469889[_0xee28('0x32')]);_0xbafd67['filters']=_[_0xee28('0x33')](_0xbafd67[_0xee28('0x2f')],_0xbafd67[_0xee28('0x32')]);_0x417840[_0xee28('0x34')]=_[_0xee28('0x33')](_0xbafd67[_0xee28('0x2f')],qs[_0xee28('0x35')](_0x469889['query']['fields']));_0x417840['attributes']=_0x417840[_0xee28('0x34')][_0xee28('0x36')]?_0x417840[_0xee28('0x34')]:_0xbafd67[_0xee28('0x2f')];if(!_0x469889[_0xee28('0x32')][_0xee28('0x37')]('nolimit')){_0x417840[_0xee28('0x38')]=qs[_0xee28('0x38')](_0x469889['query']['limit']);_0x417840[_0xee28('0x1d')]=qs[_0xee28('0x1d')](_0x469889['query']['offset']);}_0x417840[_0xee28('0x39')]=qs[_0xee28('0x3a')](_0x469889['query'][_0xee28('0x3a')]);_0x417840[_0xee28('0x3b')]=qs[_0xee28('0x3c')](_[_0xee28('0x3d')](_0x469889[_0xee28('0x32')],_0xbafd67[_0xee28('0x3c')]),_0x84e0ba);if(_0x469889[_0xee28('0x32')][_0xee28('0x3e')]){_0x417840[_0xee28('0x3b')]=_[_0xee28('0x3f')](_0x417840[_0xee28('0x3b')],{'$or':_[_0xee28('0x2a')](_0x84e0ba,function(_0x486d55){if(_0x486d55[_0xee28('0x2d')]!=='VIRTUAL'){var _0x4b0b75={};_0x4b0b75[_0x486d55[_0xee28('0x30')]]={'$like':'%'+_0x469889['query'][_0xee28('0x3e')]+'%'};return _0x4b0b75;}})});}_0x417840=_['merge']({},_0x417840,_0x469889[_0xee28('0x40')]);var _0x4d096c={'where':_0x417840[_0xee28('0x3b')]};return db[_0xee28('0x2b')][_0xee28('0x1f')](_0x4d096c)[_0xee28('0x27')](function(_0x58ebb5){_0x4fcc8f[_0xee28('0x1f')]=_0x58ebb5;if(_0x469889['query'][_0xee28('0x41')]){_0x417840[_0xee28('0x42')]=[{'all':!![]}];}return db[_0xee28('0x2b')][_0xee28('0x43')](_0x417840);})[_0xee28('0x27')](function(_0x2e046e){_0x4fcc8f[_0xee28('0x44')]=_0x2e046e;return _0x4fcc8f;})['then'](respondWithFilteredResult(_0x346201,_0x417840))['catch'](handleError(_0x346201,null));};exports[_0xee28('0x45')]=function(_0x5c710d,_0x52b666){var _0x4064cf={'raw':!![],'where':{'id':_0x5c710d['params']['id']}},_0x14bd8d={};_0x14bd8d[_0xee28('0x2f')]=_[_0xee28('0x31')](db[_0xee28('0x2b')][_0xee28('0x46')]);_0x14bd8d[_0xee28('0x32')]=_[_0xee28('0x31')](_0x5c710d[_0xee28('0x32')]);_0x14bd8d['filters']=_[_0xee28('0x33')](_0x14bd8d[_0xee28('0x2f')],_0x14bd8d[_0xee28('0x32')]);_0x4064cf[_0xee28('0x34')]=_[_0xee28('0x33')](_0x14bd8d['model'],qs[_0xee28('0x35')](_0x5c710d[_0xee28('0x32')]['fields']));_0x4064cf[_0xee28('0x34')]=_0x4064cf[_0xee28('0x34')][_0xee28('0x36')]?_0x4064cf[_0xee28('0x34')]:_0x14bd8d[_0xee28('0x2f')];if(_0x5c710d[_0xee28('0x32')]['includeAll']){_0x4064cf[_0xee28('0x42')]=[{'all':!![]}];}_0x4064cf=_['merge']({},_0x4064cf,_0x5c710d['options']);return db[_0xee28('0x2b')][_0xee28('0x47')](_0x4064cf)['then'](handleEntityNotFound(_0x52b666,null))[_0xee28('0x27')](respondWithResult(_0x52b666,null))[_0xee28('0x48')](handleError(_0x52b666,null));};exports[_0xee28('0x49')]=function(_0x5d07ed,_0x57e57e){return db[_0xee28('0x2b')][_0xee28('0x49')](_0x5d07ed[_0xee28('0x4a')],{})[_0xee28('0x27')](respondWithResult(_0x57e57e,0xc9))[_0xee28('0x48')](handleError(_0x57e57e,null));};exports[_0xee28('0x25')]=function(_0x2574c5,_0x2b5f36){if(_0x2574c5[_0xee28('0x4a')]['id']){delete _0x2574c5[_0xee28('0x4a')]['id'];}return db['FaxQueueReport'][_0xee28('0x47')]({'where':{'id':_0x2574c5['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x2b5f36,null))[_0xee28('0x27')](saveUpdates(_0x2574c5[_0xee28('0x4a')],null))[_0xee28('0x27')](respondWithResult(_0x2b5f36,null))[_0xee28('0x48')](handleError(_0x2b5f36,null));};exports['destroy']=function(_0x5247fe,_0x5ca018){return db[_0xee28('0x2b')]['find']({'where':{'id':_0x5247fe['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x5ca018,null))['then'](removeEntity(_0x5ca018,null))[_0xee28('0x48')](handleError(_0x5ca018,null));};exports[_0xee28('0x4b')]=function(_0x45c4c0,_0x3a4e74){return db[_0xee28('0x2b')][_0xee28('0x4b')]()[_0xee28('0x27')](respondWithResult(_0x3a4e74,null))[_0xee28('0x48')](handleError(_0x3a4e74,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b22bf0e..f9ce61d 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x25327e,_0xb2a66d){var _0xdc22cb=function(_0x1eac23){while(--_0x1eac23){_0x25327e['push'](_0x25327e['shift']());}};_0xdc22cb(++_0xb2a66d);}(_0x5fab,0x177));var _0xb5fa=function(_0x469218,_0x440d05){_0x469218=_0x469218-0x0;var _0x187b4a=_0x5fab[_0x469218];return _0x187b4a;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x4ce26c,_0x1ad38b){var _0x461547=function(_0x5d12a7){while(--_0x5d12a7){_0x4ce26c['push'](_0x4ce26c['shift']());}};_0x461547(++_0x1ad38b);}(_0x326f,0xd1));var _0xf326=function(_0x3a3c3b,_0x1ef69d){_0x3a3c3b=_0x3a3c3b-0x0;var _0x310269=_0x326f[_0x3a3c3b];return _0x310269;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 1c26e7f..687c395 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 _0xface=['update','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','info','UpdateFaxQueueReport'];(function(_0x1b640f,_0x215390){var _0x560770=function(_0x5335ba){while(--_0x5335ba){_0x1b640f['push'](_0x1b640f['shift']());}};_0x560770(++_0x215390);}(_0xface,0xcb));var _0xefac=function(_0x256179,_0x1d3bdf){_0x256179=_0x256179-0x0;var _0x13dc42=_0xface[_0x256179];return _0x13dc42;};'use strict';var _=require('lodash');var util=require(_0xefac('0x0'));var moment=require(_0xefac('0x1'));var BPromise=require(_0xefac('0x2'));var rs=require(_0xefac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefac('0x4'))['db'];var utils=require(_0xefac('0x5'));var logger=require('../../config/logger')(_0xefac('0x6'));var config=require(_0xefac('0x7'));var jayson=require(_0xefac('0x8'));var client=jayson[_0xefac('0x9')][_0xefac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58f17d,_0x9f3109,_0x1e2b2e){return new BPromise(function(_0x5f44b4,_0x479ec8){return client['request'](_0x58f17d,_0x1e2b2e)[_0xefac('0xb')](function(_0x5bdc8b){logger['info'](_0xefac('0xc'),_0x9f3109,_0xefac('0xd'));logger[_0xefac('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x9f3109,'request\x20sent',JSON[_0xefac('0xf')](_0x5bdc8b));if(_0x5bdc8b['error']){if(_0x5bdc8b[_0xefac('0x10')][_0xefac('0x11')]===0x1f4){logger['error'](_0xefac('0xc'),_0x9f3109,_0x5bdc8b[_0xefac('0x10')][_0xefac('0x12')]);return _0x479ec8(_0x5bdc8b[_0xefac('0x10')][_0xefac('0x12')]);}logger[_0xefac('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x9f3109,_0x5bdc8b[_0xefac('0x10')][_0xefac('0x12')]);return _0x5f44b4(_0x5bdc8b[_0xefac('0x10')][_0xefac('0x12')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x9f3109,'request\x20sent');_0x5f44b4(_0x5bdc8b[_0xefac('0x13')][_0xefac('0x12')]);}})[_0xefac('0x14')](function(_0x32deaf){logger[_0xefac('0x10')](_0xefac('0xc'),_0x9f3109,_0x32deaf);_0x479ec8(_0x32deaf);});});}exports[_0xefac('0x15')]=function(_0x275daa){var _0x58732f=this;return new Promise(function(_0x5f382c,_0x3c1ea9){return db[_0xefac('0x16')][_0xefac('0x17')](_0x275daa[_0xefac('0x18')],{'raw':_0x275daa[_0xefac('0x19')]?_0x275daa[_0xefac('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2548e4){logger[_0xefac('0x1a')](_0xefac('0x15'),_0x275daa);logger[_0xefac('0xe')]('CreateFaxQueueReport',_0x275daa,JSON[_0xefac('0xf')](_0x2548e4));_0x5f382c(_0x2548e4);})[_0xefac('0x14')](function(_0x35d038){logger[_0xefac('0x10')](_0xefac('0x15'),_0x35d038[_0xefac('0x12')],_0x275daa);_0x3c1ea9(_0x58732f[_0xefac('0x10')](0x1f4,_0x35d038['message']));});});};exports[_0xefac('0x1b')]=function(_0x402602){var _0x133c9d=this;return new Promise(function(_0x5bd096,_0xa9b324){return db['FaxQueueReport'][_0xefac('0x1c')](_0x402602[_0xefac('0x18')],{'raw':_0x402602[_0xefac('0x19')]?_0x402602['options'][_0xefac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x402602[_0xefac('0x19')]?_0x402602[_0xefac('0x19')][_0xefac('0x1e')]||null:null,'attributes':_0x402602[_0xefac('0x19')]?_0x402602[_0xefac('0x19')][_0xefac('0x1f')]||null:null,'limit':_0x402602[_0xefac('0x19')]?_0x402602[_0xefac('0x19')][_0xefac('0x20')]||null:null})[_0xefac('0xb')](function(_0x56e565){logger[_0xefac('0x1a')](_0xefac('0x1b'),_0x402602);logger[_0xefac('0xe')]('UpdateFaxQueueReport',_0x402602,JSON[_0xefac('0xf')](_0x56e565));_0x5bd096(_0x56e565);})[_0xefac('0x14')](function(_0x2384d5){logger[_0xefac('0x10')](_0xefac('0x1b'),_0x2384d5[_0xefac('0x12')],_0x402602);_0xa9b324(_0x133c9d[_0xefac('0x10')](0x1f4,_0x2384d5[_0xefac('0x12')]));});});}; \ No newline at end of file +var _0xf7af=['FaxQueueReport','body','options','raw','then','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport'];(function(_0x39d6a8,_0xc9c91a){var _0x93f3db=function(_0x953b09){while(--_0x953b09){_0x39d6a8['push'](_0x39d6a8['shift']());}};_0x93f3db(++_0xc9c91a);}(_0xf7af,0x92));var _0xff7a=function(_0x5d4570,_0x259bbb){_0x5d4570=_0x5d4570-0x0;var _0x356fdc=_0xf7af[_0x5d4570];return _0x356fdc;};'use strict';var _=require(_0xff7a('0x0'));var util=require(_0xff7a('0x1'));var moment=require(_0xff7a('0x2'));var BPromise=require(_0xff7a('0x3'));var rs=require(_0xff7a('0x4'));var fs=require('fs');var Redis=require(_0xff7a('0x5'));var db=require(_0xff7a('0x6'))['db'];var utils=require(_0xff7a('0x7'));var logger=require(_0xff7a('0x8'))(_0xff7a('0x9'));var config=require(_0xff7a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xff7a('0xb')][_0xff7a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c67de,_0x233b73,_0x544474){return new BPromise(function(_0x4ed07e,_0x289703){return client[_0xff7a('0xd')](_0x1c67de,_0x544474)['then'](function(_0x5262fd){logger[_0xff7a('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x233b73,_0xff7a('0xf'));logger[_0xff7a('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x233b73,_0xff7a('0xf'),JSON[_0xff7a('0x11')](_0x5262fd));if(_0x5262fd[_0xff7a('0x12')]){if(_0x5262fd[_0xff7a('0x12')]['code']===0x1f4){logger[_0xff7a('0x12')](_0xff7a('0x13'),_0x233b73,_0x5262fd[_0xff7a('0x12')]['message']);return _0x289703(_0x5262fd['error'][_0xff7a('0x14')]);}logger[_0xff7a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x233b73,_0x5262fd['error']['message']);return _0x4ed07e(_0x5262fd[_0xff7a('0x12')][_0xff7a('0x14')]);}else{logger[_0xff7a('0xe')](_0xff7a('0x13'),_0x233b73,_0xff7a('0xf'));_0x4ed07e(_0x5262fd[_0xff7a('0x15')]['message']);}})[_0xff7a('0x16')](function(_0x1ed13b){logger[_0xff7a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x233b73,_0x1ed13b);_0x289703(_0x1ed13b);});});}exports[_0xff7a('0x17')]=function(_0x2ef871){var _0x5490b0=this;return new Promise(function(_0x263646,_0x303137){return db[_0xff7a('0x18')]['create'](_0x2ef871[_0xff7a('0x19')],{'raw':_0x2ef871['options']?_0x2ef871[_0xff7a('0x1a')][_0xff7a('0x1b')]===undefined?!![]:![]:!![]})[_0xff7a('0x1c')](function(_0x52e78b){logger[_0xff7a('0xe')](_0xff7a('0x17'),_0x2ef871);logger[_0xff7a('0x10')](_0xff7a('0x17'),_0x2ef871,JSON[_0xff7a('0x11')](_0x52e78b));_0x263646(_0x52e78b);})[_0xff7a('0x16')](function(_0x2cc9dc){logger[_0xff7a('0x12')](_0xff7a('0x17'),_0x2cc9dc[_0xff7a('0x14')],_0x2ef871);_0x303137(_0x5490b0[_0xff7a('0x12')](0x1f4,_0x2cc9dc[_0xff7a('0x14')]));});});};exports[_0xff7a('0x1d')]=function(_0x309814){var _0x3e160f=this;return new Promise(function(_0x5c02cd,_0x3e2e28){return db[_0xff7a('0x18')][_0xff7a('0x1e')](_0x309814[_0xff7a('0x19')],{'raw':_0x309814['options']?_0x309814[_0xff7a('0x1a')][_0xff7a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309814[_0xff7a('0x1a')]?_0x309814[_0xff7a('0x1a')][_0xff7a('0x1f')]||null:null,'attributes':_0x309814[_0xff7a('0x1a')]?_0x309814[_0xff7a('0x1a')][_0xff7a('0x20')]||null:null,'limit':_0x309814['options']?_0x309814[_0xff7a('0x1a')][_0xff7a('0x21')]||null:null})[_0xff7a('0x1c')](function(_0xe9763c){logger[_0xff7a('0xe')](_0xff7a('0x1d'),_0x309814);logger[_0xff7a('0x10')]('UpdateFaxQueueReport',_0x309814,JSON[_0xff7a('0x11')](_0xe9763c));_0x5c02cd(_0xe9763c);})[_0xff7a('0x16')](function(_0x1cc1cb){logger[_0xff7a('0x12')](_0xff7a('0x1d'),_0x1cc1cb[_0xff7a('0x14')],_0x309814);_0x3e2e28(_0x3e160f[_0xff7a('0x12')](0x1f4,_0x1cc1cb['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ca1ce14..0a2a89d 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 _0x72ff=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','show','post','put','/:id','update','delete','exports','multer','util','path'];(function(_0x3d3b94,_0x51a2e4){var _0x515d33=function(_0x2aaa05){while(--_0x2aaa05){_0x3d3b94['push'](_0x3d3b94['shift']());}};_0x515d33(++_0x51a2e4);}(_0x72ff,0x129));var _0xf72f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x72ff[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0xf72f('0x0'));var util=require(_0xf72f('0x1'));var path=require(_0xf72f('0x2'));var timeout=require(_0xf72f('0x3'));var express=require(_0xf72f('0x4'));var router=express[_0xf72f('0x5')]();var fs_extra=require(_0xf72f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf72f('0x7'));var config=require('../../config/environment');var controller=require(_0xf72f('0x8'));router[_0xf72f('0x9')]('/',auth[_0xf72f('0xa')](),controller[_0xf72f('0xb')]);router[_0xf72f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xf72f('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf72f('0xd')]);router[_0xf72f('0xe')]('/',auth[_0xf72f('0xa')](),controller['create']);router[_0xf72f('0xf')](_0xf72f('0x10'),auth[_0xf72f('0xa')](),controller[_0xf72f('0x11')]);router[_0xf72f('0x12')](_0xf72f('0x10'),auth[_0xf72f('0xa')](),controller['destroy']);module[_0xf72f('0x13')]=router; \ No newline at end of file +var _0x6d89=['./faxQueueReport.controller','isAuthenticated','get','/describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11afcf,_0x46133b){var _0x209a87=function(_0x1d6b6c){while(--_0x1d6b6c){_0x11afcf['push'](_0x11afcf['shift']());}};_0x209a87(++_0x46133b);}(_0x6d89,0x10f));var _0x96d8=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x6d89[_0xe1b5f6];return _0x44636e;};'use strict';var multer=require(_0x96d8('0x0'));var util=require(_0x96d8('0x1'));var path=require(_0x96d8('0x2'));var timeout=require(_0x96d8('0x3'));var express=require(_0x96d8('0x4'));var router=express['Router']();var fs_extra=require(_0x96d8('0x5'));var auth=require(_0x96d8('0x6'));var interaction=require(_0x96d8('0x7'));var config=require(_0x96d8('0x8'));var controller=require(_0x96d8('0x9'));router['get']('/',auth[_0x96d8('0xa')](),controller['index']);router[_0x96d8('0xb')](_0x96d8('0xc'),auth[_0x96d8('0xa')](),controller['describe']);router['get'](_0x96d8('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x96d8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x96d8('0xf')]('/:id',auth[_0x96d8('0xa')](),controller[_0x96d8('0x10')]);router[_0x96d8('0x11')](_0x96d8('0xd'),auth['isAuthenticated'](),controller[_0x96d8('0x12')]);module[_0x96d8('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 1c17add..6a45374 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4358cb,_0x1f1c23){var _0x59a7e4=function(_0x5a1e15){while(--_0x5a1e15){_0x4358cb['push'](_0x4358cb['shift']());}};_0x59a7e4(++_0x1f1c23);}(_0x54ef,0x112));var _0xf54e=function(_0x5b60ba,_0x1b4054){_0x5b60ba=_0x5b60ba-0x0;var _0x2de4d2=_0x54ef[_0x5b60ba];return _0x2de4d2;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x46e3ff,_0x50ca39){var _0x4bf847=function(_0x3fa9b9){while(--_0x3fa9b9){_0x46e3ff['push'](_0x46e3ff['shift']());}};_0x4bf847(++_0x50ca39);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a88f47c..e03998b 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 _0x2ea6=['util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4b88f8,_0x20ae18){var _0x15ecc5=function(_0x24bb95){while(--_0x24bb95){_0x4b88f8['push'](_0x4b88f8['shift']());}};_0x15ecc5(++_0x20ae18);}(_0x2ea6,0xe1));var _0x62ea=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x2ea6[_0xd1c39b];return _0x58f5bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62ea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62ea('0x1'));var rp=require(_0x62ea('0x2'));var moment=require(_0x62ea('0x3'));var BPromise=require(_0x62ea('0x4'));var Mustache=require(_0x62ea('0x5'));var util=require(_0x62ea('0x6'));var path=require(_0x62ea('0x7'));var sox=require('sox');var csv=require(_0x62ea('0x8'));var ejs=require(_0x62ea('0x9'));var fs=require('fs');var fs_extra=require(_0x62ea('0xa'));var _=require(_0x62ea('0xb'));var squel=require('squel');var crypto=require(_0x62ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x62ea('0xd'));var toCsv=require(_0x62ea('0x8'));var querystring=require('querystring');var Papa=require(_0x62ea('0xe'));var Redis=require(_0x62ea('0xf'));var authService=require(_0x62ea('0x10'));var qs=require(_0x62ea('0x11'));var as=require(_0x62ea('0x12'));var hardwareService=require(_0x62ea('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x62ea('0x14'));var config=require(_0x62ea('0x15'));var licenseUtil=require(_0x62ea('0x16'));var db=require(_0x62ea('0x17'))['db'];function respondWithStatusCode(_0x427b8d,_0x286fbc){_0x286fbc=_0x286fbc||0xcc;return function(_0x5bc82e){if(_0x5bc82e){return _0x427b8d[_0x62ea('0x18')](_0x286fbc);}return _0x427b8d[_0x62ea('0x19')](_0x286fbc)[_0x62ea('0x1a')]();};}function respondWithResult(_0x447ccb,_0x45bb94){_0x45bb94=_0x45bb94||0xc8;return function(_0x211e92){if(_0x211e92){return _0x447ccb[_0x62ea('0x19')](_0x45bb94)[_0x62ea('0x1b')](_0x211e92);}};}function respondWithFilteredResult(_0xe01d77,_0x366c29){return function(_0x4ebd79){if(_0x4ebd79){var _0x5aac9b=typeof _0x366c29[_0x62ea('0x1c')]===_0x62ea('0x1d')&&typeof _0x366c29[_0x62ea('0x1e')]===_0x62ea('0x1d');var _0x5dbf7f=_0x4ebd79[_0x62ea('0x1f')];var _0x4bc6bb=_0x5aac9b?0x0:_0x366c29['offset'];var _0x339735=_0x5aac9b?_0x4ebd79[_0x62ea('0x1f')]:_0x366c29[_0x62ea('0x1c')]+_0x366c29['limit'];var _0x8ccd58;if(_0x339735>=_0x5dbf7f){_0x339735=_0x5dbf7f;_0x8ccd58=0xc8;}else{_0x8ccd58=0xce;}_0xe01d77['status'](_0x8ccd58);return _0xe01d77[_0x62ea('0x20')]('Content-Range',_0x4bc6bb+'-'+_0x339735+'/'+_0x5dbf7f)['json'](_0x4ebd79);}return null;};}function patchUpdates(_0x2d8677){return function(_0x10b276){try{jsonpatch[_0x62ea('0x21')](_0x10b276,_0x2d8677,!![]);}catch(_0x2de664){return BPromise[_0x62ea('0x22')](_0x2de664);}return _0x10b276['save']();};}function saveUpdates(_0x180c07,_0x532c1d){return function(_0x17eea0){if(_0x17eea0){return _0x17eea0[_0x62ea('0x23')](_0x180c07)['then'](function(_0xa0bc9f){return _0xa0bc9f;});}return null;};}function removeEntity(_0x3de059,_0x2c43ee){return function(_0x4b8881){if(_0x4b8881){return _0x4b8881['destroy']()[_0x62ea('0x24')](function(){_0x3de059[_0x62ea('0x19')](0xcc)[_0x62ea('0x1a')]();});}};}function handleEntityNotFound(_0x33cf04,_0x224c39){return function(_0x4ac647){if(!_0x4ac647){_0x33cf04['sendStatus'](0x194);}return _0x4ac647;};}function handleError(_0xa2dc65,_0x214b2e){_0x214b2e=_0x214b2e||0x1f4;return function(_0x377c3e){logger[_0x62ea('0x25')](_0x377c3e[_0x62ea('0x26')]);if(_0x377c3e[_0x62ea('0x27')]){delete _0x377c3e[_0x62ea('0x27')];}_0xa2dc65[_0x62ea('0x19')](_0x214b2e)[_0x62ea('0x28')](_0x377c3e);};}exports[_0x62ea('0x29')]=function(_0x3806a8,_0x8c154a){var _0x825732={},_0x14dc18={},_0x48e805={'count':0x0,'rows':[]};var _0x1f8ec9=_[_0x62ea('0x2a')](db[_0x62ea('0x2b')]['rawAttributes'],function(_0x16e3d6){return{'name':_0x16e3d6[_0x62ea('0x2c')],'type':_0x16e3d6[_0x62ea('0x2d')][_0x62ea('0x2e')]};});_0x14dc18[_0x62ea('0x2f')]=_['map'](_0x1f8ec9,_0x62ea('0x27'));_0x14dc18[_0x62ea('0x30')]=_[_0x62ea('0x31')](_0x3806a8[_0x62ea('0x30')]);_0x14dc18[_0x62ea('0x32')]=_[_0x62ea('0x33')](_0x14dc18['model'],_0x14dc18[_0x62ea('0x30')]);_0x825732['attributes']=_[_0x62ea('0x33')](_0x14dc18['model'],qs['fields'](_0x3806a8[_0x62ea('0x30')][_0x62ea('0x34')]));_0x825732[_0x62ea('0x35')]=_0x825732[_0x62ea('0x35')][_0x62ea('0x36')]?_0x825732[_0x62ea('0x35')]:_0x14dc18[_0x62ea('0x2f')];if(!_0x3806a8[_0x62ea('0x30')][_0x62ea('0x37')]('nolimit')){_0x825732['limit']=qs[_0x62ea('0x1e')](_0x3806a8['query']['limit']);_0x825732['offset']=qs[_0x62ea('0x1c')](_0x3806a8[_0x62ea('0x30')][_0x62ea('0x1c')]);}_0x825732[_0x62ea('0x38')]=qs[_0x62ea('0x39')](_0x3806a8[_0x62ea('0x30')]['sort']);_0x825732['where']=qs['filters'](_[_0x62ea('0x3a')](_0x3806a8[_0x62ea('0x30')],_0x14dc18[_0x62ea('0x32')]),_0x1f8ec9);if(_0x3806a8[_0x62ea('0x30')]['filter']){_0x825732['where']=_['merge'](_0x825732[_0x62ea('0x3b')],{'$or':_[_0x62ea('0x2a')](_0x1f8ec9,function(_0x1d412a){if(_0x1d412a[_0x62ea('0x2d')]!==_0x62ea('0x3c')){var _0xc25f95={};_0xc25f95[_0x1d412a['name']]={'$like':'%'+_0x3806a8[_0x62ea('0x30')][_0x62ea('0x3d')]+'%'};return _0xc25f95;}})});}_0x825732=_[_0x62ea('0x3e')]({},_0x825732,_0x3806a8[_0x62ea('0x3f')]);var _0x142366={'where':_0x825732[_0x62ea('0x3b')]};return db[_0x62ea('0x2b')][_0x62ea('0x1f')](_0x142366)[_0x62ea('0x24')](function(_0x53e49c){_0x48e805[_0x62ea('0x1f')]=_0x53e49c;if(_0x3806a8[_0x62ea('0x30')]['includeAll']){_0x825732['include']=[{'all':!![]}];}return db[_0x62ea('0x2b')][_0x62ea('0x40')](_0x825732);})[_0x62ea('0x24')](function(_0x278aa1){_0x48e805[_0x62ea('0x41')]=_0x278aa1;return _0x48e805;})['then'](respondWithFilteredResult(_0x8c154a,_0x825732))[_0x62ea('0x42')](handleError(_0x8c154a,null));};exports[_0x62ea('0x43')]=function(_0x91090b,_0x48c84f){var _0x45e855={'raw':!![],'where':{'id':_0x91090b[_0x62ea('0x44')]['id']}},_0x124558={};_0x124558[_0x62ea('0x2f')]=_['keys'](db['FaxTransferReport'][_0x62ea('0x45')]);_0x124558[_0x62ea('0x30')]=_[_0x62ea('0x31')](_0x91090b[_0x62ea('0x30')]);_0x124558[_0x62ea('0x32')]=_[_0x62ea('0x33')](_0x124558[_0x62ea('0x2f')],_0x124558['query']);_0x45e855[_0x62ea('0x35')]=_[_0x62ea('0x33')](_0x124558[_0x62ea('0x2f')],qs['fields'](_0x91090b[_0x62ea('0x30')][_0x62ea('0x34')]));_0x45e855['attributes']=_0x45e855['attributes'][_0x62ea('0x36')]?_0x45e855['attributes']:_0x124558[_0x62ea('0x2f')];if(_0x91090b[_0x62ea('0x30')][_0x62ea('0x46')]){_0x45e855[_0x62ea('0x47')]=[{'all':!![]}];}_0x45e855=_[_0x62ea('0x3e')]({},_0x45e855,_0x91090b[_0x62ea('0x3f')]);return db[_0x62ea('0x2b')][_0x62ea('0x48')](_0x45e855)['then'](handleEntityNotFound(_0x48c84f,null))['then'](respondWithResult(_0x48c84f,null))['catch'](handleError(_0x48c84f,null));};exports['create']=function(_0x1689c7,_0x3d6747){return db[_0x62ea('0x2b')][_0x62ea('0x49')](_0x1689c7[_0x62ea('0x4a')],{})['then'](respondWithResult(_0x3d6747,0xc9))[_0x62ea('0x42')](handleError(_0x3d6747,null));};exports[_0x62ea('0x23')]=function(_0x1e572e,_0x317879){if(_0x1e572e['body']['id']){delete _0x1e572e['body']['id'];}return db[_0x62ea('0x2b')]['find']({'where':{'id':_0x1e572e['params']['id']}})[_0x62ea('0x24')](handleEntityNotFound(_0x317879,null))[_0x62ea('0x24')](saveUpdates(_0x1e572e[_0x62ea('0x4a')],null))[_0x62ea('0x24')](respondWithResult(_0x317879,null))[_0x62ea('0x42')](handleError(_0x317879,null));};exports[_0x62ea('0x4b')]=function(_0x5d476a,_0x20e09c){return db[_0x62ea('0x2b')][_0x62ea('0x48')]({'where':{'id':_0x5d476a['params']['id']}})['then'](handleEntityNotFound(_0x20e09c,null))[_0x62ea('0x24')](removeEntity(_0x20e09c,null))['catch'](handleError(_0x20e09c,null));};exports[_0x62ea('0x4c')]=function(_0x163d30,_0x598517){return db[_0x62ea('0x2b')][_0x62ea('0x4c')]()[_0x62ea('0x24')](respondWithResult(_0x598517,null))[_0x62ea('0x42')](handleError(_0x598517,null));}; \ No newline at end of file +var _0xc8a4=['type','key','keys','query','filters','intersection','model','fields','attributes','sort','where','filter','merge','VIRTUAL','options','includeAll','include','FaxTransferReport','rows','show','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x526713,_0x2d99c7){var _0x883e74=function(_0x477c82){while(--_0x477c82){_0x526713['push'](_0x526713['shift']());}};_0x883e74(++_0x2d99c7);}(_0xc8a4,0x1dc));var _0x4c8a=function(_0x2cc1f2,_0x29f13e){_0x2cc1f2=_0x2cc1f2-0x0;var _0xc22d02=_0xc8a4[_0x2cc1f2];return _0xc22d02;};'use strict';var emlformat=require(_0x4c8a('0x0'));var rimraf=require(_0x4c8a('0x1'));var zipdir=require(_0x4c8a('0x2'));var jsonpatch=require(_0x4c8a('0x3'));var rp=require(_0x4c8a('0x4'));var moment=require('moment');var BPromise=require(_0x4c8a('0x5'));var Mustache=require(_0x4c8a('0x6'));var util=require(_0x4c8a('0x7'));var path=require(_0x4c8a('0x8'));var sox=require('sox');var csv=require(_0x4c8a('0x9'));var ejs=require(_0x4c8a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c8a('0xb'));var squel=require(_0x4c8a('0xc'));var crypto=require(_0x4c8a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4c8a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4c8a('0xf'));var Papa=require('papaparse');var Redis=require(_0x4c8a('0x10'));var authService=require(_0x4c8a('0x11'));var qs=require(_0x4c8a('0x12'));var as=require(_0x4c8a('0x13'));var hardwareService=require(_0x4c8a('0x14'));var logger=require(_0x4c8a('0x15'))(_0x4c8a('0x16'));var utils=require(_0x4c8a('0x17'));var config=require(_0x4c8a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c8a('0x19'))['db'];function respondWithStatusCode(_0x4d987b,_0x2bed3c){_0x2bed3c=_0x2bed3c||0xcc;return function(_0x9ce93a){if(_0x9ce93a){return _0x4d987b[_0x4c8a('0x1a')](_0x2bed3c);}return _0x4d987b['status'](_0x2bed3c)[_0x4c8a('0x1b')]();};}function respondWithResult(_0x4e74b7,_0x409c86){_0x409c86=_0x409c86||0xc8;return function(_0x35d376){if(_0x35d376){return _0x4e74b7['status'](_0x409c86)['json'](_0x35d376);}};}function respondWithFilteredResult(_0x28b3b0,_0x2a2245){return function(_0x5b47c4){if(_0x5b47c4){var _0x4a717b=typeof _0x2a2245['offset']===_0x4c8a('0x1c')&&typeof _0x2a2245[_0x4c8a('0x1d')]===_0x4c8a('0x1c');var _0x58ae9a=_0x5b47c4[_0x4c8a('0x1e')];var _0x4cb4b1=_0x4a717b?0x0:_0x2a2245[_0x4c8a('0x1f')];var _0xdfc5bc=_0x4a717b?_0x5b47c4[_0x4c8a('0x1e')]:_0x2a2245[_0x4c8a('0x1f')]+_0x2a2245['limit'];var _0x1171ea;if(_0xdfc5bc>=_0x58ae9a){_0xdfc5bc=_0x58ae9a;_0x1171ea=0xc8;}else{_0x1171ea=0xce;}_0x28b3b0[_0x4c8a('0x20')](_0x1171ea);return _0x28b3b0[_0x4c8a('0x21')](_0x4c8a('0x22'),_0x4cb4b1+'-'+_0xdfc5bc+'/'+_0x58ae9a)[_0x4c8a('0x23')](_0x5b47c4);}return null;};}function patchUpdates(_0x4a1daa){return function(_0x2cec76){try{jsonpatch[_0x4c8a('0x24')](_0x2cec76,_0x4a1daa,!![]);}catch(_0x11f749){return BPromise[_0x4c8a('0x25')](_0x11f749);}return _0x2cec76[_0x4c8a('0x26')]();};}function saveUpdates(_0x258910,_0x1eb96d){return function(_0x511f5d){if(_0x511f5d){return _0x511f5d[_0x4c8a('0x27')](_0x258910)[_0x4c8a('0x28')](function(_0x4aa3cd){return _0x4aa3cd;});}return null;};}function removeEntity(_0x337bcb,_0xb3cf9d){return function(_0x323350){if(_0x323350){return _0x323350[_0x4c8a('0x29')]()[_0x4c8a('0x28')](function(){_0x337bcb[_0x4c8a('0x20')](0xcc)[_0x4c8a('0x1b')]();});}};}function handleEntityNotFound(_0x93cf41,_0x1cbe5c){return function(_0x1f257d){if(!_0x1f257d){_0x93cf41['sendStatus'](0x194);}return _0x1f257d;};}function handleError(_0xa0b8e8,_0xaec35a){_0xaec35a=_0xaec35a||0x1f4;return function(_0x5a7f6f){logger['error'](_0x5a7f6f[_0x4c8a('0x2a')]);if(_0x5a7f6f[_0x4c8a('0x2b')]){delete _0x5a7f6f[_0x4c8a('0x2b')];}_0xa0b8e8[_0x4c8a('0x20')](_0xaec35a)[_0x4c8a('0x2c')](_0x5a7f6f);};}exports[_0x4c8a('0x2d')]=function(_0x419ae8,_0x1932af){var _0x55a9b1={},_0x3589a4={},_0x241f20={'count':0x0,'rows':[]};var _0x58d7a4=_[_0x4c8a('0x2e')](db['FaxTransferReport'][_0x4c8a('0x2f')],function(_0x4b7adc){return{'name':_0x4b7adc[_0x4c8a('0x30')],'type':_0x4b7adc[_0x4c8a('0x31')][_0x4c8a('0x32')]};});_0x3589a4['model']=_['map'](_0x58d7a4,_0x4c8a('0x2b'));_0x3589a4['query']=_[_0x4c8a('0x33')](_0x419ae8[_0x4c8a('0x34')]);_0x3589a4[_0x4c8a('0x35')]=_[_0x4c8a('0x36')](_0x3589a4[_0x4c8a('0x37')],_0x3589a4[_0x4c8a('0x34')]);_0x55a9b1['attributes']=_[_0x4c8a('0x36')](_0x3589a4['model'],qs[_0x4c8a('0x38')](_0x419ae8[_0x4c8a('0x34')][_0x4c8a('0x38')]));_0x55a9b1[_0x4c8a('0x39')]=_0x55a9b1['attributes']['length']?_0x55a9b1['attributes']:_0x3589a4['model'];if(!_0x419ae8[_0x4c8a('0x34')]['hasOwnProperty']('nolimit')){_0x55a9b1[_0x4c8a('0x1d')]=qs[_0x4c8a('0x1d')](_0x419ae8['query'][_0x4c8a('0x1d')]);_0x55a9b1['offset']=qs[_0x4c8a('0x1f')](_0x419ae8[_0x4c8a('0x34')][_0x4c8a('0x1f')]);}_0x55a9b1['order']=qs['sort'](_0x419ae8[_0x4c8a('0x34')][_0x4c8a('0x3a')]);_0x55a9b1[_0x4c8a('0x3b')]=qs[_0x4c8a('0x35')](_['pick'](_0x419ae8[_0x4c8a('0x34')],_0x3589a4[_0x4c8a('0x35')]),_0x58d7a4);if(_0x419ae8[_0x4c8a('0x34')][_0x4c8a('0x3c')]){_0x55a9b1[_0x4c8a('0x3b')]=_[_0x4c8a('0x3d')](_0x55a9b1[_0x4c8a('0x3b')],{'$or':_[_0x4c8a('0x2e')](_0x58d7a4,function(_0x192d7f){if(_0x192d7f[_0x4c8a('0x31')]!==_0x4c8a('0x3e')){var _0x5a5f47={};_0x5a5f47[_0x192d7f[_0x4c8a('0x2b')]]={'$like':'%'+_0x419ae8[_0x4c8a('0x34')][_0x4c8a('0x3c')]+'%'};return _0x5a5f47;}})});}_0x55a9b1=_[_0x4c8a('0x3d')]({},_0x55a9b1,_0x419ae8[_0x4c8a('0x3f')]);var _0x225b76={'where':_0x55a9b1[_0x4c8a('0x3b')]};return db['FaxTransferReport'][_0x4c8a('0x1e')](_0x225b76)['then'](function(_0xf52fc0){_0x241f20[_0x4c8a('0x1e')]=_0xf52fc0;if(_0x419ae8[_0x4c8a('0x34')][_0x4c8a('0x40')]){_0x55a9b1[_0x4c8a('0x41')]=[{'all':!![]}];}return db[_0x4c8a('0x42')]['findAll'](_0x55a9b1);})[_0x4c8a('0x28')](function(_0x11a516){_0x241f20[_0x4c8a('0x43')]=_0x11a516;return _0x241f20;})['then'](respondWithFilteredResult(_0x1932af,_0x55a9b1))['catch'](handleError(_0x1932af,null));};exports[_0x4c8a('0x44')]=function(_0x4d0060,_0x1ec757){var _0x2301f0={'raw':!![],'where':{'id':_0x4d0060['params']['id']}},_0x3161c2={};_0x3161c2[_0x4c8a('0x37')]=_[_0x4c8a('0x33')](db[_0x4c8a('0x42')][_0x4c8a('0x2f')]);_0x3161c2[_0x4c8a('0x34')]=_[_0x4c8a('0x33')](_0x4d0060[_0x4c8a('0x34')]);_0x3161c2[_0x4c8a('0x35')]=_[_0x4c8a('0x36')](_0x3161c2[_0x4c8a('0x37')],_0x3161c2[_0x4c8a('0x34')]);_0x2301f0[_0x4c8a('0x39')]=_[_0x4c8a('0x36')](_0x3161c2[_0x4c8a('0x37')],qs[_0x4c8a('0x38')](_0x4d0060[_0x4c8a('0x34')][_0x4c8a('0x38')]));_0x2301f0['attributes']=_0x2301f0[_0x4c8a('0x39')]['length']?_0x2301f0['attributes']:_0x3161c2[_0x4c8a('0x37')];if(_0x4d0060['query'][_0x4c8a('0x40')]){_0x2301f0[_0x4c8a('0x41')]=[{'all':!![]}];}_0x2301f0=_[_0x4c8a('0x3d')]({},_0x2301f0,_0x4d0060[_0x4c8a('0x3f')]);return db[_0x4c8a('0x42')][_0x4c8a('0x45')](_0x2301f0)[_0x4c8a('0x28')](handleEntityNotFound(_0x1ec757,null))[_0x4c8a('0x28')](respondWithResult(_0x1ec757,null))['catch'](handleError(_0x1ec757,null));};exports[_0x4c8a('0x46')]=function(_0x3f9e06,_0x38e1e7){return db[_0x4c8a('0x42')]['create'](_0x3f9e06['body'],{})[_0x4c8a('0x28')](respondWithResult(_0x38e1e7,0xc9))[_0x4c8a('0x47')](handleError(_0x38e1e7,null));};exports[_0x4c8a('0x27')]=function(_0x9080b8,_0x5caeac){if(_0x9080b8[_0x4c8a('0x48')]['id']){delete _0x9080b8[_0x4c8a('0x48')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x9080b8[_0x4c8a('0x49')]['id']}})['then'](handleEntityNotFound(_0x5caeac,null))[_0x4c8a('0x28')](saveUpdates(_0x9080b8[_0x4c8a('0x48')],null))[_0x4c8a('0x28')](respondWithResult(_0x5caeac,null))['catch'](handleError(_0x5caeac,null));};exports[_0x4c8a('0x29')]=function(_0x47218f,_0x544caf){return db['FaxTransferReport']['find']({'where':{'id':_0x47218f['params']['id']}})[_0x4c8a('0x28')](handleEntityNotFound(_0x544caf,null))[_0x4c8a('0x28')](removeEntity(_0x544caf,null))[_0x4c8a('0x47')](handleError(_0x544caf,null));};exports['describe']=function(_0x211e28,_0x42d9a4){return db[_0x4c8a('0x42')][_0x4c8a('0x4a')]()['then'](respondWithResult(_0x42d9a4,null))[_0x4c8a('0x47')](handleError(_0x42d9a4,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 2100313..7994db5 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 _0xbdd4=['../../config/logger','api','moment','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','uniqueid','lodash'];(function(_0x42062c,_0x4be70b){var _0x5bf454=function(_0x3e792f){while(--_0x3e792f){_0x42062c['push'](_0x42062c['shift']());}};_0x5bf454(++_0x4be70b);}(_0xbdd4,0xe6));var _0x4bdd=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xbdd4[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x4bdd('0x0'));var util=require('util');var logger=require(_0x4bdd('0x1'))(_0x4bdd('0x2'));var moment=require(_0x4bdd('0x3'));var BPromise=require('bluebird');var rp=require(_0x4bdd('0x4'));var fs=require('fs');var path=require(_0x4bdd('0x5'));var rimraf=require(_0x4bdd('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bdd('0x7'));module[_0x4bdd('0x8')]=function(_0x4dbb2e,_0x57b374){return _0x4dbb2e[_0x4bdd('0x9')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4bdd('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6427=['rimraf','./faxTransferReport.attributes','exports','define','uniqueid','lodash','util','moment','path'];(function(_0x20d39b,_0xa1e8c2){var _0x422960=function(_0x153d63){while(--_0x153d63){_0x20d39b['push'](_0x20d39b['shift']());}};_0x422960(++_0xa1e8c2);}(_0x6427,0x191));var _0x7642=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6427[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x7642('0x0'));var util=require(_0x7642('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7642('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7642('0x3'));var rimraf=require(_0x7642('0x4'));var config=require('../../config/environment');var attributes=require(_0x7642('0x5'));module[_0x7642('0x6')]=function(_0x541e3c,_0x404548){return _0x541e3c[_0x7642('0x7')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7642('0x8'),'fields':[_0x7642('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 38bd9fc..3f52fb1 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 _0x9323=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch'];(function(_0x51cf27,_0x7cbe9b){var _0x19b777=function(_0x21265a){while(--_0x21265a){_0x51cf27['push'](_0x51cf27['shift']());}};_0x19b777(++_0x7cbe9b);}(_0x9323,0x1b8));var _0x3932=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9323[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3932('0x0'));var util=require(_0x3932('0x1'));var moment=require(_0x3932('0x2'));var BPromise=require(_0x3932('0x3'));var rs=require(_0x3932('0x4'));var fs=require('fs');var Redis=require(_0x3932('0x5'));var db=require(_0x3932('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3932('0x7'));var config=require(_0x3932('0x8'));var jayson=require(_0x3932('0x9'));var client=jayson[_0x3932('0xa')][_0x3932('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f8737,_0x20450f,_0x2b1705){return new BPromise(function(_0x436de3,_0xabaa85){return client[_0x3932('0xc')](_0x4f8737,_0x2b1705)[_0x3932('0xd')](function(_0x45f226){logger[_0x3932('0xe')](_0x3932('0xf'),_0x20450f,'request\x20sent');logger[_0x3932('0x10')](_0x3932('0x11'),_0x20450f,_0x3932('0x12'),JSON['stringify'](_0x45f226));if(_0x45f226[_0x3932('0x13')]){if(_0x45f226[_0x3932('0x13')]['code']===0x1f4){logger[_0x3932('0x13')](_0x3932('0xf'),_0x20450f,_0x45f226[_0x3932('0x13')][_0x3932('0x14')]);return _0xabaa85(_0x45f226[_0x3932('0x13')][_0x3932('0x14')]);}logger[_0x3932('0x13')](_0x3932('0xf'),_0x20450f,_0x45f226['error']['message']);return _0x436de3(_0x45f226[_0x3932('0x13')]['message']);}else{logger[_0x3932('0xe')](_0x3932('0xf'),_0x20450f,'request\x20sent');_0x436de3(_0x45f226['result'][_0x3932('0x14')]);}})[_0x3932('0x15')](function(_0x38affa){logger[_0x3932('0x13')](_0x3932('0xf'),_0x20450f,_0x38affa);_0xabaa85(_0x38affa);});});} \ No newline at end of file +var _0x5e3f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x3679a4,_0x40ea13){var _0x3ac97e=function(_0x15c0a4){while(--_0x15c0a4){_0x3679a4['push'](_0x3679a4['shift']());}};_0x3ac97e(++_0x40ea13);}(_0x5e3f,0xa4));var _0xf5e3=function(_0x20faae,_0x48a339){_0x20faae=_0x20faae-0x0;var _0x27b18b=_0x5e3f[_0x20faae];return _0x27b18b;};'use strict';var _=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var moment=require(_0xf5e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf5e3('0x3'));var fs=require('fs');var Redis=require(_0xf5e3('0x4'));var db=require(_0xf5e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5e3('0x6'))(_0xf5e3('0x7'));var config=require(_0xf5e3('0x8'));var jayson=require(_0xf5e3('0x9'));var client=jayson[_0xf5e3('0xa')][_0xf5e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x534df0,_0x5b3174,_0x295d3a){return new BPromise(function(_0x220f43,_0x3dcc62){return client[_0xf5e3('0xc')](_0x534df0,_0x295d3a)[_0xf5e3('0xd')](function(_0x2ec976){logger['info'](_0xf5e3('0xe'),_0x5b3174,_0xf5e3('0xf'));logger[_0xf5e3('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x5b3174,_0xf5e3('0xf'),JSON[_0xf5e3('0x11')](_0x2ec976));if(_0x2ec976[_0xf5e3('0x12')]){if(_0x2ec976[_0xf5e3('0x12')][_0xf5e3('0x13')]===0x1f4){logger[_0xf5e3('0x12')](_0xf5e3('0xe'),_0x5b3174,_0x2ec976[_0xf5e3('0x12')][_0xf5e3('0x14')]);return _0x3dcc62(_0x2ec976[_0xf5e3('0x12')][_0xf5e3('0x14')]);}logger['error'](_0xf5e3('0xe'),_0x5b3174,_0x2ec976[_0xf5e3('0x12')][_0xf5e3('0x14')]);return _0x220f43(_0x2ec976[_0xf5e3('0x12')]['message']);}else{logger[_0xf5e3('0x15')](_0xf5e3('0xe'),_0x5b3174,_0xf5e3('0xf'));_0x220f43(_0x2ec976[_0xf5e3('0x16')][_0xf5e3('0x14')]);}})[_0xf5e3('0x17')](function(_0x15a930){logger[_0xf5e3('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x5b3174,_0x15a930);_0x3dcc62(_0x15a930);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2c57215..8648bb6 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 _0xd65f=['express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','util','path'];(function(_0x364273,_0x12ac4c){var _0x4d8673=function(_0xc5ea44){while(--_0xc5ea44){_0x364273['push'](_0x364273['shift']());}};_0x4d8673(++_0x12ac4c);}(_0xd65f,0xfa));var _0xfd65=function(_0x478970,_0x5df032){_0x478970=_0x478970-0x0;var _0x1759f1=_0xd65f[_0x478970];return _0x1759f1;};'use strict';var multer=require('multer');var util=require(_0xfd65('0x0'));var path=require(_0xfd65('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd65('0x2'));var router=express['Router']();var fs_extra=require(_0xfd65('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd65('0x4'));var config=require(_0xfd65('0x5'));var controller=require(_0xfd65('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfd65('0x7')](_0xfd65('0x8'),auth[_0xfd65('0x9')](),controller[_0xfd65('0xa')]);router[_0xfd65('0x7')](_0xfd65('0xb'),auth[_0xfd65('0x9')](),controller['show']);router[_0xfd65('0xc')]('/',auth[_0xfd65('0x9')](),controller[_0xfd65('0xd')]);router[_0xfd65('0xe')]('/:id',auth[_0xfd65('0x9')](),controller['update']);router[_0xfd65('0xf')](_0xfd65('0xb'),auth[_0xfd65('0x9')](),controller[_0xfd65('0x10')]);module[_0xfd65('0x11')]=router; \ No newline at end of file +var _0xe58e=['put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x3c495f,_0x201f95){var _0x5d62de=function(_0x25ef50){while(--_0x25ef50){_0x3c495f['push'](_0x3c495f['shift']());}};_0x5d62de(++_0x201f95);}(_0xe58e,0xec));var _0xee58=function(_0x5e0e9b,_0x17d638){_0x5e0e9b=_0x5e0e9b-0x0;var _0x42fb18=_0xe58e[_0x5e0e9b];return _0x42fb18;};'use strict';var multer=require(_0xee58('0x0'));var util=require('util');var path=require(_0xee58('0x1'));var timeout=require(_0xee58('0x2'));var express=require('express');var router=express[_0xee58('0x3')]();var fs_extra=require(_0xee58('0x4'));var auth=require(_0xee58('0x5'));var interaction=require(_0xee58('0x6'));var config=require(_0xee58('0x7'));var controller=require(_0xee58('0x8'));router[_0xee58('0x9')]('/',auth[_0xee58('0xa')](),controller[_0xee58('0xb')]);router[_0xee58('0x9')](_0xee58('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xee58('0xd'),auth[_0xee58('0xa')](),controller[_0xee58('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee58('0xf')]);router[_0xee58('0x10')](_0xee58('0xd'),auth['isAuthenticated'](),controller[_0xee58('0x11')]);router[_0xee58('0x12')](_0xee58('0xd'),auth[_0xee58('0xa')](),controller[_0xee58('0x13')]);module[_0xee58('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2ecd6c2..a9cb6ad 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 _0xbb48=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','getConfigurations','/:id/fields','post','create','/:id/configurations','put','update','delete','destroy'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbb48,0x9b));var _0x8bb4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xbb48[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x8bb4('0x0'));var util=require(_0x8bb4('0x1'));var path=require(_0x8bb4('0x2'));var timeout=require(_0x8bb4('0x3'));var express=require('express');var router=express[_0x8bb4('0x4')]();var fs_extra=require(_0x8bb4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8bb4('0x6'));var controller=require(_0x8bb4('0x7'));router['get']('/',auth[_0x8bb4('0x8')](),controller[_0x8bb4('0x9')]);router[_0x8bb4('0xa')](_0x8bb4('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x8bb4('0xc')]);router[_0x8bb4('0xa')](_0x8bb4('0xd'),auth[_0x8bb4('0x8')](),controller['getFields']);router[_0x8bb4('0xe')]('/',auth[_0x8bb4('0x8')](),controller[_0x8bb4('0xf')]);router[_0x8bb4('0xe')](_0x8bb4('0x10'),auth[_0x8bb4('0x8')](),controller['addConfiguration']);router[_0x8bb4('0x11')]('/:id',auth[_0x8bb4('0x8')](),controller[_0x8bb4('0x12')]);router[_0x8bb4('0x13')]('/:id',auth[_0x8bb4('0x8')](),controller[_0x8bb4('0x14')]);module[_0x8bb4('0x15')]=router; \ No newline at end of file +var _0xc89d=['path','connect-timeout','fs-extra','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','show','getConfigurations','post','addConfiguration','put','update','delete','destroy','multer','util'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xc89d,0x17a));var _0xdc89=function(_0xf7341c,_0x46711a){_0xf7341c=_0xf7341c-0x0;var _0x35efed=_0xc89d[_0xf7341c];return _0x35efed;};'use strict';var multer=require(_0xdc89('0x0'));var util=require(_0xdc89('0x1'));var path=require(_0xdc89('0x2'));var timeout=require(_0xdc89('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdc89('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdc89('0x5'));var controller=require(_0xdc89('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdc89('0x7')]);router[_0xdc89('0x8')](_0xdc89('0x9'),auth[_0xdc89('0xa')](),controller[_0xdc89('0xb')]);router[_0xdc89('0x8')]('/:id/configurations',auth[_0xdc89('0xa')](),controller[_0xdc89('0xc')]);router[_0xdc89('0x8')]('/:id/fields',auth[_0xdc89('0xa')](),controller['getFields']);router[_0xdc89('0xd')]('/',auth[_0xdc89('0xa')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xdc89('0xe')]);router[_0xdc89('0xf')](_0xdc89('0x9'),auth[_0xdc89('0xa')](),controller[_0xdc89('0x10')]);router[_0xdc89('0x11')](_0xdc89('0x9'),auth[_0xdc89('0xa')](),controller[_0xdc89('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e6d7229..ed04e62 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 _0xc63a=['STRING','ENUM','basic','newTab','integrationTab','exports'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0xc63a,0x77));var _0xac63=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xc63a[_0xbb14db];return _0x36bed7;};'use strict';var Sequelize=require('sequelize');module[_0xac63('0x0')]={'name':{'type':Sequelize[_0xac63('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xac63('0x1')]},'authType':{'type':Sequelize[_0xac63('0x2')](_0xac63('0x3')),'defaultValue':_0xac63('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xac63('0x1')]},'token':{'type':Sequelize[_0xac63('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xac63('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xac63('0x4')),'defaultValue':_0xac63('0x5')}}; \ No newline at end of file +var _0xe95f=['ENUM','basic','integrationTab','newTab','exports','STRING'];(function(_0x272402,_0x283488){var _0x4f8f2b=function(_0x55bc53){while(--_0x55bc53){_0x272402['push'](_0x272402['shift']());}};_0x4f8f2b(++_0x283488);}(_0xe95f,0x1d2));var _0xfe95=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe95f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xfe95('0x0')]={'name':{'type':Sequelize[_0xfe95('0x1')]},'description':{'type':Sequelize[_0xfe95('0x1')]},'username':{'type':Sequelize[_0xfe95('0x1')]},'remoteUri':{'type':Sequelize[_0xfe95('0x1')]},'authType':{'type':Sequelize[_0xfe95('0x2')](_0xfe95('0x3')),'defaultValue':_0xfe95('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xfe95('0x1')]},'consumerSecret':{'type':Sequelize[_0xfe95('0x1')]},'token':{'type':Sequelize[_0xfe95('0x1')]},'tokenSecret':{'type':Sequelize[_0xfe95('0x1')]},'serverUrl':{'type':Sequelize[_0xfe95('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfe95('0x2')](_0xfe95('0x4'),_0xfe95('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 56022a2..7dbc896 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 _0xbdcb=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','show','params','includeAll','catch','create','body','update','find','getConfigurations','length','addConfiguration','findOne','AccountId','channel','getDescriptions','DeskConfiguration','DeskField','Subjects','getFields','priority','remoteUri','authType','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','%s/custom_fields','basic','Authorization','format','%s:%s','username','password','toString','base64','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x48d7aa,_0x52349c){var _0x138fc6=function(_0x273dd9){while(--_0x273dd9){_0x48d7aa['push'](_0x48d7aa['shift']());}};_0x138fc6(++_0x52349c);}(_0xbdcb,0x13d));var _0xbbdc=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xbdcb[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xbbdc('0x0'));var rimraf=require(_0xbbdc('0x1'));var zipdir=require(_0xbbdc('0x2'));var jsonpatch=require(_0xbbdc('0x3'));var rp=require(_0xbbdc('0x4'));var moment=require(_0xbbdc('0x5'));var BPromise=require(_0xbbdc('0x6'));var Mustache=require(_0xbbdc('0x7'));var util=require('util');var path=require(_0xbbdc('0x8'));var sox=require('sox');var csv=require(_0xbbdc('0x9'));var ejs=require(_0xbbdc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbdc('0xb'));var squel=require(_0xbbdc('0xc'));var crypto=require('crypto');var jsforce=require(_0xbbdc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbbdc('0x9'));var querystring=require(_0xbbdc('0xe'));var Papa=require(_0xbbdc('0xf'));var Redis=require(_0xbbdc('0x10'));var authService=require(_0xbbdc('0x11'));var qs=require(_0xbbdc('0x12'));var as=require(_0xbbdc('0x13'));var hardwareService=require(_0xbbdc('0x14'));var logger=require(_0xbbdc('0x15'))(_0xbbdc('0x16'));var utils=require(_0xbbdc('0x17'));var config=require(_0xbbdc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbbdc('0x19'))['db'];var integrations=require(_0xbbdc('0x1a'));function respondWithStatusCode(_0x59f1b3,_0x19f00a){_0x19f00a=_0x19f00a||0xcc;return function(_0x575b83){if(_0x575b83){return _0x59f1b3[_0xbbdc('0x1b')](_0x19f00a);}return _0x59f1b3[_0xbbdc('0x1c')](_0x19f00a)[_0xbbdc('0x1d')]();};}function respondWithResult(_0x32f94a,_0x33f3c8){_0x33f3c8=_0x33f3c8||0xc8;return function(_0x45a6a2){if(_0x45a6a2){return _0x32f94a[_0xbbdc('0x1c')](_0x33f3c8)[_0xbbdc('0x1e')](_0x45a6a2);}};}function respondWithFilteredResult(_0x12a743,_0x1f094a){return function(_0xba1ec3){if(_0xba1ec3){var _0xe9db45=typeof _0x1f094a[_0xbbdc('0x1f')]==='undefined'&&typeof _0x1f094a[_0xbbdc('0x20')]===_0xbbdc('0x21');var _0x11109e=_0xba1ec3['count'];var _0x3fb965=_0xe9db45?0x0:_0x1f094a[_0xbbdc('0x1f')];var _0xded6c2=_0xe9db45?_0xba1ec3[_0xbbdc('0x22')]:_0x1f094a[_0xbbdc('0x1f')]+_0x1f094a[_0xbbdc('0x20')];var _0x3042b3;if(_0xded6c2>=_0x11109e){_0xded6c2=_0x11109e;_0x3042b3=0xc8;}else{_0x3042b3=0xce;}_0x12a743[_0xbbdc('0x1c')](_0x3042b3);return _0x12a743[_0xbbdc('0x23')](_0xbbdc('0x24'),_0x3fb965+'-'+_0xded6c2+'/'+_0x11109e)[_0xbbdc('0x1e')](_0xba1ec3);}return null;};}function patchUpdates(_0x45275d){return function(_0x259f30){try{jsonpatch[_0xbbdc('0x25')](_0x259f30,_0x45275d,!![]);}catch(_0x30b623){return BPromise[_0xbbdc('0x26')](_0x30b623);}return _0x259f30[_0xbbdc('0x27')]();};}function saveUpdates(_0x1478a1,_0xf7ef4d){return function(_0x1266d6){if(_0x1266d6){return _0x1266d6['update'](_0x1478a1)[_0xbbdc('0x28')](function(_0x53eae1){return _0x53eae1;});}return null;};}function removeEntity(_0x921301,_0x20644a){return function(_0x1188cd){if(_0x1188cd){return _0x1188cd[_0xbbdc('0x29')]()[_0xbbdc('0x28')](function(){_0x921301[_0xbbdc('0x1c')](0xcc)[_0xbbdc('0x1d')]();});}};}function handleEntityNotFound(_0x2cc37b,_0x1e7479){return function(_0x310120){if(!_0x310120){_0x2cc37b[_0xbbdc('0x1b')](0x194);}return _0x310120;};}function handleError(_0x5019b1,_0x24498b){_0x24498b=_0x24498b||0x1f4;return function(_0x201458){logger[_0xbbdc('0x2a')](_0x201458[_0xbbdc('0x2b')]);if(_0x201458['name']){delete _0x201458[_0xbbdc('0x2c')];}_0x5019b1[_0xbbdc('0x1c')](_0x24498b)[_0xbbdc('0x2d')](_0x201458);};}exports[_0xbbdc('0x2e')]=function(_0x3d50dc,_0x3dba0e){var _0x575928={},_0x5cdd78={},_0x2aa231={'count':0x0,'rows':[]};var _0x2b2095=_['map'](db[_0xbbdc('0x2f')][_0xbbdc('0x30')],function(_0x5a7085){return{'name':_0x5a7085[_0xbbdc('0x31')],'type':_0x5a7085[_0xbbdc('0x32')][_0xbbdc('0x33')]};});_0x5cdd78[_0xbbdc('0x34')]=_[_0xbbdc('0x35')](_0x2b2095,_0xbbdc('0x2c'));_0x5cdd78[_0xbbdc('0x36')]=_[_0xbbdc('0x37')](_0x3d50dc['query']);_0x5cdd78[_0xbbdc('0x38')]=_[_0xbbdc('0x39')](_0x5cdd78[_0xbbdc('0x34')],_0x5cdd78[_0xbbdc('0x36')]);_0x575928['attributes']=_['intersection'](_0x5cdd78['model'],qs[_0xbbdc('0x3a')](_0x3d50dc['query'][_0xbbdc('0x3a')]));_0x575928[_0xbbdc('0x3b')]=_0x575928[_0xbbdc('0x3b')]['length']?_0x575928['attributes']:_0x5cdd78['model'];if(!_0x3d50dc[_0xbbdc('0x36')][_0xbbdc('0x3c')](_0xbbdc('0x3d'))){_0x575928[_0xbbdc('0x20')]=qs[_0xbbdc('0x20')](_0x3d50dc[_0xbbdc('0x36')][_0xbbdc('0x20')]);_0x575928[_0xbbdc('0x1f')]=qs[_0xbbdc('0x1f')](_0x3d50dc[_0xbbdc('0x36')]['offset']);}_0x575928[_0xbbdc('0x3e')]=qs[_0xbbdc('0x3f')](_0x3d50dc['query'][_0xbbdc('0x3f')]);_0x575928[_0xbbdc('0x40')]=qs[_0xbbdc('0x38')](_[_0xbbdc('0x41')](_0x3d50dc[_0xbbdc('0x36')],_0x5cdd78['filters']),_0x2b2095);if(_0x3d50dc[_0xbbdc('0x36')][_0xbbdc('0x42')]){_0x575928[_0xbbdc('0x40')]=_[_0xbbdc('0x43')](_0x575928[_0xbbdc('0x40')],{'$or':_[_0xbbdc('0x35')](_0x2b2095,function(_0x31ec1a){if(_0x31ec1a['type']!==_0xbbdc('0x44')){var _0x1097b1={};_0x1097b1[_0x31ec1a[_0xbbdc('0x2c')]]={'$like':'%'+_0x3d50dc[_0xbbdc('0x36')][_0xbbdc('0x42')]+'%'};return _0x1097b1;}})});}_0x575928=_[_0xbbdc('0x43')]({},_0x575928,_0x3d50dc[_0xbbdc('0x45')]);var _0x5208d8={'where':_0x575928[_0xbbdc('0x40')]};return db[_0xbbdc('0x2f')][_0xbbdc('0x22')](_0x5208d8)['then'](function(_0x82cf57){_0x2aa231[_0xbbdc('0x22')]=_0x82cf57;if(_0x3d50dc[_0xbbdc('0x36')]['includeAll']){_0x575928['include']=[{'all':!![]}];}return db[_0xbbdc('0x2f')]['findAll'](_0x575928);})['then'](function(_0x376e2d){_0x2aa231['rows']=_0x376e2d;return _0x2aa231;})['then'](respondWithFilteredResult(_0x3dba0e,_0x575928))['catch'](handleError(_0x3dba0e,null));};exports[_0xbbdc('0x46')]=function(_0x565014,_0x3d71d2){var _0x36f873={'raw':![],'where':{'id':_0x565014[_0xbbdc('0x47')]['id']}},_0x486321={};_0x486321[_0xbbdc('0x34')]=_[_0xbbdc('0x37')](db['DeskAccount']['rawAttributes']);_0x486321[_0xbbdc('0x36')]=_[_0xbbdc('0x37')](_0x565014[_0xbbdc('0x36')]);_0x486321[_0xbbdc('0x38')]=_['intersection'](_0x486321[_0xbbdc('0x34')],_0x486321['query']);_0x36f873[_0xbbdc('0x3b')]=_[_0xbbdc('0x39')](_0x486321['model'],qs['fields'](_0x565014[_0xbbdc('0x36')][_0xbbdc('0x3a')]));_0x36f873[_0xbbdc('0x3b')]=_0x36f873[_0xbbdc('0x3b')]['length']?_0x36f873[_0xbbdc('0x3b')]:_0x486321[_0xbbdc('0x34')];if(_0x565014[_0xbbdc('0x36')][_0xbbdc('0x48')]){_0x36f873['include']=[{'all':!![]}];}_0x36f873=_[_0xbbdc('0x43')]({},_0x36f873,_0x565014['options']);return db[_0xbbdc('0x2f')]['find'](_0x36f873)[_0xbbdc('0x28')](handleEntityNotFound(_0x3d71d2,null))[_0xbbdc('0x28')](respondWithResult(_0x3d71d2,null))[_0xbbdc('0x49')](handleError(_0x3d71d2,null));};exports[_0xbbdc('0x4a')]=function(_0x497059,_0x3fcafe){return db[_0xbbdc('0x2f')][_0xbbdc('0x4a')](_0x497059[_0xbbdc('0x4b')],{})[_0xbbdc('0x28')](respondWithResult(_0x3fcafe,0xc9))[_0xbbdc('0x49')](handleError(_0x3fcafe,null));};exports[_0xbbdc('0x4c')]=function(_0x5cd03c,_0x2412b0){if(_0x5cd03c['body']['id']){delete _0x5cd03c[_0xbbdc('0x4b')]['id'];}return db[_0xbbdc('0x2f')][_0xbbdc('0x4d')]({'where':{'id':_0x5cd03c[_0xbbdc('0x47')]['id']}})['then'](handleEntityNotFound(_0x2412b0,null))[_0xbbdc('0x28')](saveUpdates(_0x5cd03c[_0xbbdc('0x4b')],null))[_0xbbdc('0x28')](respondWithResult(_0x2412b0,null))[_0xbbdc('0x49')](handleError(_0x2412b0,null));};exports['destroy']=function(_0x896dcc,_0x121880){return db[_0xbbdc('0x2f')]['find']({'where':{'id':_0x896dcc['params']['id']}})[_0xbbdc('0x28')](handleEntityNotFound(_0x121880,null))[_0xbbdc('0x28')](removeEntity(_0x121880,null))['catch'](handleError(_0x121880,null));};exports[_0xbbdc('0x4e')]=function(_0x4adbf3,_0x4cfd38,_0x363d24){var _0x48891f={};var _0x1b58ef={};var _0x20eba7;var _0x430702;return db['DeskAccount']['findOne']({'where':{'id':_0x4adbf3['params']['id']}})[_0xbbdc('0x28')](handleEntityNotFound(_0x4cfd38,null))[_0xbbdc('0x28')](function(_0x33894d){if(_0x33894d){_0x20eba7=_0x33894d;_0x1b58ef[_0xbbdc('0x34')]=_[_0xbbdc('0x37')](db['DeskConfiguration'][_0xbbdc('0x30')]);_0x1b58ef['query']=_[_0xbbdc('0x37')](_0x4adbf3[_0xbbdc('0x36')]);_0x1b58ef['filters']=_[_0xbbdc('0x39')](_0x1b58ef['model'],_0x1b58ef[_0xbbdc('0x36')]);_0x48891f[_0xbbdc('0x3b')]=_['intersection'](_0x1b58ef[_0xbbdc('0x34')],qs[_0xbbdc('0x3a')](_0x4adbf3[_0xbbdc('0x36')][_0xbbdc('0x3a')]));_0x48891f[_0xbbdc('0x3b')]=_0x48891f[_0xbbdc('0x3b')]['length']?_0x48891f[_0xbbdc('0x3b')]:_0x1b58ef[_0xbbdc('0x34')];_0x48891f[_0xbbdc('0x3e')]=qs[_0xbbdc('0x3f')](_0x4adbf3['query'][_0xbbdc('0x3f')]);_0x48891f['where']=qs[_0xbbdc('0x38')](_[_0xbbdc('0x41')](_0x4adbf3['query'],_0x1b58ef[_0xbbdc('0x38')]));if(_0x4adbf3[_0xbbdc('0x36')]['filter']){_0x48891f[_0xbbdc('0x40')]=_[_0xbbdc('0x43')](_0x48891f['where'],{'$or':_[_0xbbdc('0x35')](_0x48891f[_0xbbdc('0x3b')],function(_0x540cb1){var _0x27f882={};_0x27f882[_0x540cb1]={'$like':'%'+_0x4adbf3['query'][_0xbbdc('0x42')]+'%'};return _0x27f882;})});}_0x48891f=_['merge']({},_0x48891f,_0x4adbf3[_0xbbdc('0x45')]);return _0x20eba7[_0xbbdc('0x4e')](_0x48891f);}})['then'](function(_0x2a58c6){if(_0x2a58c6){_0x430702=_0x2a58c6[_0xbbdc('0x4f')];if(!_0x4adbf3[_0xbbdc('0x36')][_0xbbdc('0x3c')](_0xbbdc('0x3d'))){_0x48891f[_0xbbdc('0x20')]=qs[_0xbbdc('0x20')](_0x4adbf3[_0xbbdc('0x36')][_0xbbdc('0x20')]);_0x48891f[_0xbbdc('0x1f')]=qs['offset'](_0x4adbf3[_0xbbdc('0x36')][_0xbbdc('0x1f')]);}return _0x20eba7[_0xbbdc('0x4e')](_0x48891f);}})[_0xbbdc('0x28')](function(_0x3d7a96){if(_0x3d7a96){return _0x3d7a96?{'count':_0x430702,'rows':_0x3d7a96}:null;}})[_0xbbdc('0x28')](respondWithResult(_0x4cfd38,null))[_0xbbdc('0x49')](handleError(_0x4cfd38,null));};exports[_0xbbdc('0x50')]=function(_0x807376,_0x287893,_0x1f5f4c){if(_0x807376[_0xbbdc('0x4b')]['id']){delete _0x807376[_0xbbdc('0x4b')]['id'];}return db['DeskAccount'][_0xbbdc('0x51')]({'where':{'id':_0x807376[_0xbbdc('0x47')]['id']}})[_0xbbdc('0x28')](handleEntityNotFound(_0x287893,null))['then'](function(_0x5731ed){if(_0x5731ed){_0x807376[_0xbbdc('0x4b')][_0xbbdc('0x52')]=_0x5731ed['id'];_0x807376['body']['Subjects']=integrations['getSubjects'](_0x807376[_0xbbdc('0x4b')][_0xbbdc('0x53')],_0x807376['body']['type']);_0x807376['body']['Descriptions']=integrations[_0xbbdc('0x54')](_0x807376[_0xbbdc('0x4b')][_0xbbdc('0x53')],_0x807376[_0xbbdc('0x4b')][_0xbbdc('0x32')]);return db[_0xbbdc('0x55')][_0xbbdc('0x4a')](_0x807376[_0xbbdc('0x4b')],{'include':[{'model':db[_0xbbdc('0x56')],'as':_0xbbdc('0x57')},{'model':db[_0xbbdc('0x56')],'as':'Descriptions'}]});}return null;})[_0xbbdc('0x28')](respondWithResult(_0x287893,null))[_0xbbdc('0x49')](handleError(_0x287893,null));};exports[_0xbbdc('0x58')]=function(_0x3937b0,_0x48b3ea,_0x287c55){var _0x2e89e9=[{'name':_0xbbdc('0x59'),'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 _0x3a6e3d='';return db['DeskAccount'][_0xbbdc('0x51')]({'where':{'id':_0x3937b0[_0xbbdc('0x47')]['id']},'attributes':['id',_0xbbdc('0x5a'),_0xbbdc('0x5b'),'username','password',_0xbbdc('0x5c'),_0xbbdc('0x5d'),'token',_0xbbdc('0x5e')]})['then'](handleEntityNotFound(_0x48b3ea,null))[_0xbbdc('0x28')](function(_0x58ec03){if(_0x58ec03){_0x3a6e3d=_0x58ec03[_0xbbdc('0x5a')];var _0x2e69a6=_0x3a6e3d['slice'](-0x1);if(_0x2e69a6==='/'){_0x3a6e3d=_0x3a6e3d[_0xbbdc('0x5f')](0x0,_0x3a6e3d[_0xbbdc('0x60')](_0x2e69a6));}var _0x55012f={'method':_0xbbdc('0x61'),'uri':util['format'](_0xbbdc('0x62'),_0x3a6e3d),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x58ec03[_0xbbdc('0x5b')]===_0xbbdc('0x63')){_0x55012f['headers'][_0xbbdc('0x64')]=util[_0xbbdc('0x65')]('Basic\x20%s',new Buffer(util[_0xbbdc('0x65')](_0xbbdc('0x66'),_0x58ec03[_0xbbdc('0x67')],_0x58ec03[_0xbbdc('0x68')]))[_0xbbdc('0x69')](_0xbbdc('0x6a')));}return rp(_0x55012f)[_0xbbdc('0x28')](function(_0x5d28c2){return _0x2e89e9[_0xbbdc('0x6b')](_[_0xbbdc('0x35')](_0x5d28c2[_0xbbdc('0x6c')]['entries'],function(_0x5c75a7){return{'id':_0x5c75a7[_0xbbdc('0x2c')],'name':_0x5c75a7['name'],'type':_0x5c75a7[_0xbbdc('0x32')],'active':_0x5c75a7[_0xbbdc('0x6d')],'label':_0x5c75a7[_0xbbdc('0x6e')],'custom':!![]};}));});}})['then'](function(_0x1d05d7){return{'count':_0x1d05d7[_0xbbdc('0x4f')],'rows':_0x1d05d7};})[_0xbbdc('0x28')](respondWithResult(_0x48b3ea,null))[_0xbbdc('0x49')](function(_0x62bd5d){var _0x18189b=_0x3937b0[_0xbbdc('0x36')][_0xbbdc('0x6f')]?0x1f4:_0x62bd5d[_0xbbdc('0x70')]||0x1f4;logger[_0xbbdc('0x2a')](_0xbbdc('0x71'),_0xbbdc('0x58'),_0x18189b,JSON['stringify'](_0x62bd5d));delete _0x62bd5d[_0xbbdc('0x2c')];if(_0x18189b===0x191){_0x18189b=0x190;}_0x48b3ea[_0xbbdc('0x1c')](_0x18189b)[_0xbbdc('0x2d')](_0x3937b0['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x62bd5d['statusCode']}:_0x62bd5d);});}; \ No newline at end of file +var _0xa227=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','DeskAccount','include','rows','catch','params','find','create','body','getConfigurations','findOne','DeskConfiguration','filter','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','GET','format','application/json','basic','headers','Authorization','toString','base64','concat','entries','active','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','util'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0xa227,0x69));var _0x7a22=function(_0x584660,_0x1cedb2){_0x584660=_0x584660-0x0;var _0x34bbc2=_0xa227[_0x584660];return _0x34bbc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a22('0x0'));var zipdir=require(_0x7a22('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a22('0x2'));var moment=require(_0x7a22('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7a22('0x4'));var path=require('path');var sox=require(_0x7a22('0x5'));var csv=require(_0x7a22('0x6'));var ejs=require(_0x7a22('0x7'));var fs=require('fs');var fs_extra=require(_0x7a22('0x8'));var _=require(_0x7a22('0x9'));var squel=require(_0x7a22('0xa'));var crypto=require(_0x7a22('0xb'));var jsforce=require(_0x7a22('0xc'));var deskjs=require(_0x7a22('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a22('0xe'));var Papa=require(_0x7a22('0xf'));var Redis=require(_0x7a22('0x10'));var authService=require(_0x7a22('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7a22('0x12'));var hardwareService=require(_0x7a22('0x13'));var logger=require(_0x7a22('0x14'))(_0x7a22('0x15'));var utils=require(_0x7a22('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7a22('0x17'));var db=require(_0x7a22('0x18'))['db'];var integrations=require(_0x7a22('0x19'));function respondWithStatusCode(_0xa0ae8c,_0x400004){_0x400004=_0x400004||0xcc;return function(_0x4dabe7){if(_0x4dabe7){return _0xa0ae8c[_0x7a22('0x1a')](_0x400004);}return _0xa0ae8c[_0x7a22('0x1b')](_0x400004)['end']();};}function respondWithResult(_0x329da7,_0x20fc0c){_0x20fc0c=_0x20fc0c||0xc8;return function(_0x57ac74){if(_0x57ac74){return _0x329da7[_0x7a22('0x1b')](_0x20fc0c)[_0x7a22('0x1c')](_0x57ac74);}};}function respondWithFilteredResult(_0x56b7d9,_0x1c5702){return function(_0xe80d41){if(_0xe80d41){var _0x224f40=typeof _0x1c5702['offset']===_0x7a22('0x1d')&&typeof _0x1c5702['limit']===_0x7a22('0x1d');var _0xc71cc5=_0xe80d41[_0x7a22('0x1e')];var _0x3199e5=_0x224f40?0x0:_0x1c5702[_0x7a22('0x1f')];var _0x55c311=_0x224f40?_0xe80d41[_0x7a22('0x1e')]:_0x1c5702[_0x7a22('0x1f')]+_0x1c5702[_0x7a22('0x20')];var _0x593da9;if(_0x55c311>=_0xc71cc5){_0x55c311=_0xc71cc5;_0x593da9=0xc8;}else{_0x593da9=0xce;}_0x56b7d9['status'](_0x593da9);return _0x56b7d9[_0x7a22('0x21')](_0x7a22('0x22'),_0x3199e5+'-'+_0x55c311+'/'+_0xc71cc5)[_0x7a22('0x1c')](_0xe80d41);}return null;};}function patchUpdates(_0x5cbeb2){return function(_0x2e827a){try{jsonpatch['apply'](_0x2e827a,_0x5cbeb2,!![]);}catch(_0x3b999f){return BPromise[_0x7a22('0x23')](_0x3b999f);}return _0x2e827a[_0x7a22('0x24')]();};}function saveUpdates(_0x2c3377,_0x58aeec){return function(_0x2ff937){if(_0x2ff937){return _0x2ff937[_0x7a22('0x25')](_0x2c3377)[_0x7a22('0x26')](function(_0x30a1bb){return _0x30a1bb;});}return null;};}function removeEntity(_0xa35d49,_0x1c7e17){return function(_0x518012){if(_0x518012){return _0x518012[_0x7a22('0x27')]()['then'](function(){_0xa35d49[_0x7a22('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36923c,_0x9016aa){return function(_0x2541ec){if(!_0x2541ec){_0x36923c[_0x7a22('0x1a')](0x194);}return _0x2541ec;};}function handleError(_0x2d1cfe,_0x116406){_0x116406=_0x116406||0x1f4;return function(_0xe70680){logger['error'](_0xe70680['stack']);if(_0xe70680[_0x7a22('0x28')]){delete _0xe70680[_0x7a22('0x28')];}_0x2d1cfe[_0x7a22('0x1b')](_0x116406)[_0x7a22('0x29')](_0xe70680);};}exports[_0x7a22('0x2a')]=function(_0x19fa69,_0x19f89a){var _0x518217={},_0x34c952={},_0x16b047={'count':0x0,'rows':[]};var _0x5f905b=_[_0x7a22('0x2b')](db['DeskAccount'][_0x7a22('0x2c')],function(_0x211ba7){return{'name':_0x211ba7[_0x7a22('0x2d')],'type':_0x211ba7[_0x7a22('0x2e')]['key']};});_0x34c952[_0x7a22('0x2f')]=_['map'](_0x5f905b,_0x7a22('0x28'));_0x34c952['query']=_[_0x7a22('0x30')](_0x19fa69[_0x7a22('0x31')]);_0x34c952[_0x7a22('0x32')]=_[_0x7a22('0x33')](_0x34c952[_0x7a22('0x2f')],_0x34c952['query']);_0x518217[_0x7a22('0x34')]=_['intersection'](_0x34c952['model'],qs[_0x7a22('0x35')](_0x19fa69[_0x7a22('0x31')][_0x7a22('0x35')]));_0x518217[_0x7a22('0x34')]=_0x518217[_0x7a22('0x34')][_0x7a22('0x36')]?_0x518217['attributes']:_0x34c952[_0x7a22('0x2f')];if(!_0x19fa69['query'][_0x7a22('0x37')](_0x7a22('0x38'))){_0x518217[_0x7a22('0x20')]=qs[_0x7a22('0x20')](_0x19fa69[_0x7a22('0x31')][_0x7a22('0x20')]);_0x518217['offset']=qs[_0x7a22('0x1f')](_0x19fa69[_0x7a22('0x31')][_0x7a22('0x1f')]);}_0x518217['order']=qs[_0x7a22('0x39')](_0x19fa69[_0x7a22('0x31')][_0x7a22('0x39')]);_0x518217[_0x7a22('0x3a')]=qs['filters'](_[_0x7a22('0x3b')](_0x19fa69[_0x7a22('0x31')],_0x34c952[_0x7a22('0x32')]),_0x5f905b);if(_0x19fa69[_0x7a22('0x31')]['filter']){_0x518217[_0x7a22('0x3a')]=_[_0x7a22('0x3c')](_0x518217['where'],{'$or':_[_0x7a22('0x2b')](_0x5f905b,function(_0x357503){if(_0x357503[_0x7a22('0x2e')]!==_0x7a22('0x3d')){var _0x5e2ab2={};_0x5e2ab2[_0x357503[_0x7a22('0x28')]]={'$like':'%'+_0x19fa69['query']['filter']+'%'};return _0x5e2ab2;}})});}_0x518217=_[_0x7a22('0x3c')]({},_0x518217,_0x19fa69[_0x7a22('0x3e')]);var _0x3d4b6e={'where':_0x518217[_0x7a22('0x3a')]};return db[_0x7a22('0x3f')][_0x7a22('0x1e')](_0x3d4b6e)[_0x7a22('0x26')](function(_0xcbf1e5){_0x16b047[_0x7a22('0x1e')]=_0xcbf1e5;if(_0x19fa69[_0x7a22('0x31')]['includeAll']){_0x518217[_0x7a22('0x40')]=[{'all':!![]}];}return db[_0x7a22('0x3f')]['findAll'](_0x518217);})[_0x7a22('0x26')](function(_0x498095){_0x16b047[_0x7a22('0x41')]=_0x498095;return _0x16b047;})[_0x7a22('0x26')](respondWithFilteredResult(_0x19f89a,_0x518217))[_0x7a22('0x42')](handleError(_0x19f89a,null));};exports['show']=function(_0x1387fd,_0x1d9024){var _0x34cde9={'raw':![],'where':{'id':_0x1387fd[_0x7a22('0x43')]['id']}},_0x202b71={};_0x202b71['model']=_[_0x7a22('0x30')](db[_0x7a22('0x3f')][_0x7a22('0x2c')]);_0x202b71['query']=_[_0x7a22('0x30')](_0x1387fd[_0x7a22('0x31')]);_0x202b71[_0x7a22('0x32')]=_[_0x7a22('0x33')](_0x202b71['model'],_0x202b71[_0x7a22('0x31')]);_0x34cde9[_0x7a22('0x34')]=_[_0x7a22('0x33')](_0x202b71[_0x7a22('0x2f')],qs['fields'](_0x1387fd['query']['fields']));_0x34cde9[_0x7a22('0x34')]=_0x34cde9[_0x7a22('0x34')][_0x7a22('0x36')]?_0x34cde9['attributes']:_0x202b71[_0x7a22('0x2f')];if(_0x1387fd[_0x7a22('0x31')]['includeAll']){_0x34cde9['include']=[{'all':!![]}];}_0x34cde9=_['merge']({},_0x34cde9,_0x1387fd[_0x7a22('0x3e')]);return db['DeskAccount'][_0x7a22('0x44')](_0x34cde9)[_0x7a22('0x26')](handleEntityNotFound(_0x1d9024,null))[_0x7a22('0x26')](respondWithResult(_0x1d9024,null))['catch'](handleError(_0x1d9024,null));};exports[_0x7a22('0x45')]=function(_0x38109a,_0xadbfd){return db['DeskAccount'][_0x7a22('0x45')](_0x38109a[_0x7a22('0x46')],{})[_0x7a22('0x26')](respondWithResult(_0xadbfd,0xc9))[_0x7a22('0x42')](handleError(_0xadbfd,null));};exports['update']=function(_0x239a0b,_0x47d6da){if(_0x239a0b[_0x7a22('0x46')]['id']){delete _0x239a0b['body']['id'];}return db[_0x7a22('0x3f')]['find']({'where':{'id':_0x239a0b[_0x7a22('0x43')]['id']}})[_0x7a22('0x26')](handleEntityNotFound(_0x47d6da,null))[_0x7a22('0x26')](saveUpdates(_0x239a0b[_0x7a22('0x46')],null))[_0x7a22('0x26')](respondWithResult(_0x47d6da,null))[_0x7a22('0x42')](handleError(_0x47d6da,null));};exports['destroy']=function(_0x48a319,_0x596032){return db[_0x7a22('0x3f')][_0x7a22('0x44')]({'where':{'id':_0x48a319[_0x7a22('0x43')]['id']}})[_0x7a22('0x26')](handleEntityNotFound(_0x596032,null))[_0x7a22('0x26')](removeEntity(_0x596032,null))[_0x7a22('0x42')](handleError(_0x596032,null));};exports[_0x7a22('0x47')]=function(_0x46c186,_0x3c567d,_0x4a8d42){var _0xf5cf65={};var _0x37933b={};var _0x4da9e5;var _0x57ded9;return db[_0x7a22('0x3f')][_0x7a22('0x48')]({'where':{'id':_0x46c186[_0x7a22('0x43')]['id']}})[_0x7a22('0x26')](handleEntityNotFound(_0x3c567d,null))[_0x7a22('0x26')](function(_0x542327){if(_0x542327){_0x4da9e5=_0x542327;_0x37933b[_0x7a22('0x2f')]=_[_0x7a22('0x30')](db[_0x7a22('0x49')][_0x7a22('0x2c')]);_0x37933b[_0x7a22('0x31')]=_[_0x7a22('0x30')](_0x46c186[_0x7a22('0x31')]);_0x37933b['filters']=_['intersection'](_0x37933b['model'],_0x37933b[_0x7a22('0x31')]);_0xf5cf65[_0x7a22('0x34')]=_[_0x7a22('0x33')](_0x37933b[_0x7a22('0x2f')],qs[_0x7a22('0x35')](_0x46c186[_0x7a22('0x31')][_0x7a22('0x35')]));_0xf5cf65[_0x7a22('0x34')]=_0xf5cf65[_0x7a22('0x34')][_0x7a22('0x36')]?_0xf5cf65['attributes']:_0x37933b[_0x7a22('0x2f')];_0xf5cf65['order']=qs[_0x7a22('0x39')](_0x46c186['query'][_0x7a22('0x39')]);_0xf5cf65['where']=qs['filters'](_[_0x7a22('0x3b')](_0x46c186[_0x7a22('0x31')],_0x37933b[_0x7a22('0x32')]));if(_0x46c186[_0x7a22('0x31')][_0x7a22('0x4a')]){_0xf5cf65[_0x7a22('0x3a')]=_['merge'](_0xf5cf65[_0x7a22('0x3a')],{'$or':_[_0x7a22('0x2b')](_0xf5cf65[_0x7a22('0x34')],function(_0x1f4ce3){var _0x41ccc7={};_0x41ccc7[_0x1f4ce3]={'$like':'%'+_0x46c186['query']['filter']+'%'};return _0x41ccc7;})});}_0xf5cf65=_['merge']({},_0xf5cf65,_0x46c186[_0x7a22('0x3e')]);return _0x4da9e5[_0x7a22('0x47')](_0xf5cf65);}})[_0x7a22('0x26')](function(_0x25bb6b){if(_0x25bb6b){_0x57ded9=_0x25bb6b['length'];if(!_0x46c186[_0x7a22('0x31')][_0x7a22('0x37')]('nolimit')){_0xf5cf65[_0x7a22('0x20')]=qs[_0x7a22('0x20')](_0x46c186[_0x7a22('0x31')]['limit']);_0xf5cf65['offset']=qs[_0x7a22('0x1f')](_0x46c186[_0x7a22('0x31')]['offset']);}return _0x4da9e5['getConfigurations'](_0xf5cf65);}})['then'](function(_0x21a239){if(_0x21a239){return _0x21a239?{'count':_0x57ded9,'rows':_0x21a239}:null;}})[_0x7a22('0x26')](respondWithResult(_0x3c567d,null))['catch'](handleError(_0x3c567d,null));};exports['addConfiguration']=function(_0x5cfd24,_0x39a314,_0x15c1d3){if(_0x5cfd24[_0x7a22('0x46')]['id']){delete _0x5cfd24[_0x7a22('0x46')]['id'];}return db[_0x7a22('0x3f')][_0x7a22('0x48')]({'where':{'id':_0x5cfd24['params']['id']}})['then'](handleEntityNotFound(_0x39a314,null))[_0x7a22('0x26')](function(_0x12842d){if(_0x12842d){_0x5cfd24[_0x7a22('0x46')][_0x7a22('0x4b')]=_0x12842d['id'];_0x5cfd24['body'][_0x7a22('0x4c')]=integrations[_0x7a22('0x4d')](_0x5cfd24[_0x7a22('0x46')][_0x7a22('0x4e')],_0x5cfd24[_0x7a22('0x46')][_0x7a22('0x2e')]);_0x5cfd24[_0x7a22('0x46')][_0x7a22('0x4f')]=integrations[_0x7a22('0x50')](_0x5cfd24[_0x7a22('0x46')][_0x7a22('0x4e')],_0x5cfd24['body']['type']);return db['DeskConfiguration'][_0x7a22('0x45')](_0x5cfd24[_0x7a22('0x46')],{'include':[{'model':db[_0x7a22('0x51')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x7a22('0x4f')}]});}return null;})['then'](respondWithResult(_0x39a314,null))[_0x7a22('0x42')](handleError(_0x39a314,null));};exports[_0x7a22('0x52')]=function(_0x9333f5,_0x1e1aab,_0x2433af){var _0x549b62=[{'name':_0x7a22('0x53'),'label':_0x7a22('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x81be0a='';return db[_0x7a22('0x3f')][_0x7a22('0x48')]({'where':{'id':_0x9333f5['params']['id']},'attributes':['id',_0x7a22('0x54'),_0x7a22('0x55'),_0x7a22('0x56'),_0x7a22('0x57'),_0x7a22('0x58'),_0x7a22('0x59'),_0x7a22('0x5a'),_0x7a22('0x5b')]})[_0x7a22('0x26')](handleEntityNotFound(_0x1e1aab,null))[_0x7a22('0x26')](function(_0x4410ec){if(_0x4410ec){_0x81be0a=_0x4410ec[_0x7a22('0x54')];var _0x41bca3=_0x81be0a[_0x7a22('0x5c')](-0x1);if(_0x41bca3==='/'){_0x81be0a=_0x81be0a['substring'](0x0,_0x81be0a['lastIndexOf'](_0x41bca3));}var _0x1ceb7b={'method':_0x7a22('0x5d'),'uri':util[_0x7a22('0x5e')]('%s/custom_fields',_0x81be0a),'headers':{'Content-Type':_0x7a22('0x5f'),'Accept':_0x7a22('0x5f')},'json':!![]};if(_0x4410ec[_0x7a22('0x55')]===_0x7a22('0x60')){_0x1ceb7b[_0x7a22('0x61')][_0x7a22('0x62')]=util['format']('Basic\x20%s',new Buffer(util[_0x7a22('0x5e')]('%s:%s',_0x4410ec['username'],_0x4410ec[_0x7a22('0x57')]))[_0x7a22('0x63')](_0x7a22('0x64')));}return rp(_0x1ceb7b)[_0x7a22('0x26')](function(_0x189bd6){return _0x549b62[_0x7a22('0x65')](_[_0x7a22('0x2b')](_0x189bd6['_embedded'][_0x7a22('0x66')],function(_0x4058e2){return{'id':_0x4058e2[_0x7a22('0x28')],'name':_0x4058e2[_0x7a22('0x28')],'type':_0x4058e2[_0x7a22('0x2e')],'active':_0x4058e2[_0x7a22('0x67')],'label':_0x4058e2['label'],'custom':!![]};}));});}})[_0x7a22('0x26')](function(_0x1c2c36){return{'count':_0x1c2c36[_0x7a22('0x36')],'rows':_0x1c2c36};})[_0x7a22('0x26')](respondWithResult(_0x1e1aab,null))[_0x7a22('0x42')](function(_0x20282){var _0x4c743a=_0x9333f5[_0x7a22('0x31')]['test']?0x1f4:_0x20282['statusCode']||0x1f4;logger[_0x7a22('0x68')](_0x7a22('0x69'),'getFields',_0x4c743a,JSON[_0x7a22('0x6a')](_0x20282));delete _0x20282[_0x7a22('0x28')];if(_0x4c743a===0x191){_0x4c743a=0x190;}_0x1e1aab[_0x7a22('0x1b')](_0x4c743a)['send'](_0x9333f5[_0x7a22('0x31')][_0x7a22('0x6b')]?{'message':_0x7a22('0x6c'),'statusCode':_0x20282[_0x7a22('0x6d')]}:_0x20282);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d77035a..fa54cf6 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 _0xafb5=['DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x411631,_0x5cc5c3){var _0x490190=function(_0x19148d){while(--_0x19148d){_0x411631['push'](_0x411631['shift']());}};_0x490190(++_0x5cc5c3);}(_0xafb5,0x141));var _0x5afb=function(_0x14ee3f,_0x9befd8){_0x14ee3f=_0x14ee3f-0x0;var _0x34a03b=_0xafb5[_0x14ee3f];return _0x34a03b;};'use strict';var _=require(_0x5afb('0x0'));var util=require('util');var logger=require(_0x5afb('0x1'))(_0x5afb('0x2'));var moment=require(_0x5afb('0x3'));var BPromise=require('bluebird');var rp=require(_0x5afb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5afb('0x5'));var attributes=require(_0x5afb('0x6'));var integrations=require(_0x5afb('0x7'));module[_0x5afb('0x8')]=function(_0x156f6e,_0x43ccb9){return _0x156f6e['define'](_0x5afb('0x9'),attributes,{'tableName':_0x5afb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaac4=['../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x311374,_0x132c28){var _0x1bf041=function(_0x97fff2){while(--_0x97fff2){_0x311374['push'](_0x311374['shift']());}};_0x1bf041(++_0x132c28);}(_0xaac4,0x73));var _0x4aac=function(_0x2c3514,_0x5604d4){_0x2c3514=_0x2c3514-0x0;var _0x22ab07=_0xaac4[_0x2c3514];return _0x22ab07;};'use strict';var _=require(_0x4aac('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4aac('0x1'));var moment=require(_0x4aac('0x2'));var BPromise=require(_0x4aac('0x3'));var rp=require(_0x4aac('0x4'));var fs=require('fs');var path=require(_0x4aac('0x5'));var rimraf=require('rimraf');var config=require(_0x4aac('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x4aac('0x7'));module[_0x4aac('0x8')]=function(_0x5710ee,_0x366bf8){return _0x5710ee[_0x4aac('0x9')]('DeskAccount',attributes,{'tableName':_0x4aac('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 2bef3a7..ea2268d 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 _0x4a02=['findAll','options','raw','where','attributes','limit','map','include','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x4a02,0x192));var _0x24a0=function(_0x52ba85,_0x571ad9){_0x52ba85=_0x52ba85-0x0;var _0x111605=_0x4a02[_0x52ba85];return _0x111605;};'use strict';var _=require(_0x24a0('0x0'));var util=require(_0x24a0('0x1'));var moment=require(_0x24a0('0x2'));var BPromise=require(_0x24a0('0x3'));var rs=require(_0x24a0('0x4'));var fs=require('fs');var Redis=require(_0x24a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x24a0('0x6'));var logger=require(_0x24a0('0x7'))(_0x24a0('0x8'));var config=require(_0x24a0('0x9'));var jayson=require(_0x24a0('0xa'));var client=jayson[_0x24a0('0xb')][_0x24a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c19ce,_0x16c619,_0x9e65a0){return new BPromise(function(_0x3af9ef,_0xd9e1b7){return client[_0x24a0('0xd')](_0x5c19ce,_0x9e65a0)[_0x24a0('0xe')](function(_0x3d613e){logger[_0x24a0('0xf')]('DeskAccount,\x20%s,\x20%s',_0x16c619,_0x24a0('0x10'));logger[_0x24a0('0x11')](_0x24a0('0x12'),_0x16c619,_0x24a0('0x10'),JSON[_0x24a0('0x13')](_0x3d613e));if(_0x3d613e[_0x24a0('0x14')]){if(_0x3d613e[_0x24a0('0x14')][_0x24a0('0x15')]===0x1f4){logger[_0x24a0('0x14')](_0x24a0('0x16'),_0x16c619,_0x3d613e[_0x24a0('0x14')][_0x24a0('0x17')]);return _0xd9e1b7(_0x3d613e[_0x24a0('0x14')][_0x24a0('0x17')]);}logger[_0x24a0('0x14')]('DeskAccount,\x20%s,\x20%s',_0x16c619,_0x3d613e[_0x24a0('0x14')][_0x24a0('0x17')]);return _0x3af9ef(_0x3d613e[_0x24a0('0x14')]['message']);}else{logger[_0x24a0('0xf')]('DeskAccount,\x20%s,\x20%s',_0x16c619,_0x24a0('0x10'));_0x3af9ef(_0x3d613e[_0x24a0('0x18')][_0x24a0('0x17')]);}})[_0x24a0('0x19')](function(_0x193949){logger['error']('DeskAccount,\x20%s,\x20%s',_0x16c619,_0x193949);_0xd9e1b7(_0x193949);});});}exports['GetDeskAccount']=function(_0x3b3187){var _0xc943a8=this;return new Promise(function(_0xef19af,_0x34b8c4){return db[_0x24a0('0x1a')][_0x24a0('0x1b')]({'raw':_0x3b3187[_0x24a0('0x1c')]?_0x3b3187[_0x24a0('0x1c')][_0x24a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b3187[_0x24a0('0x1c')]?_0x3b3187['options'][_0x24a0('0x1e')]||null:null,'attributes':_0x3b3187[_0x24a0('0x1c')]?_0x3b3187[_0x24a0('0x1c')][_0x24a0('0x1f')]||null:null,'limit':_0x3b3187[_0x24a0('0x1c')]?_0x3b3187[_0x24a0('0x1c')][_0x24a0('0x20')]||null:null,'include':_0x3b3187[_0x24a0('0x1c')]?_0x3b3187[_0x24a0('0x1c')]['include']?_[_0x24a0('0x21')](_0x3b3187[_0x24a0('0x1c')][_0x24a0('0x22')],function(_0x423665){return{'model':db[_0x423665[_0x24a0('0x23')]],'as':_0x423665['as'],'attributes':_0x423665[_0x24a0('0x1f')],'include':_0x423665[_0x24a0('0x22')]?_[_0x24a0('0x21')](_0x423665[_0x24a0('0x22')],function(_0x43931a){return{'model':db[_0x43931a[_0x24a0('0x23')]],'as':_0x43931a['as'],'attributes':_0x43931a[_0x24a0('0x1f')],'include':_0x43931a[_0x24a0('0x22')]?_['map'](_0x43931a[_0x24a0('0x22')],function(_0x2b50da){return{'model':db[_0x2b50da['model']],'as':_0x2b50da['as'],'attributes':_0x2b50da[_0x24a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x24a0('0xe')](function(_0xad2997){logger[_0x24a0('0xf')](_0x24a0('0x24'),_0x3b3187);logger[_0x24a0('0x11')](_0x24a0('0x24'),_0x3b3187,JSON['stringify'](_0xad2997));_0xef19af(_0xad2997);})[_0x24a0('0x19')](function(_0xc73ad5){logger['error'](_0x24a0('0x24'),_0xc73ad5[_0x24a0('0x17')],_0x3b3187);_0x34b8c4(_0xc943a8[_0x24a0('0x14')](0x1f4,_0xc73ad5[_0x24a0('0x17')]));});});};exports[_0x24a0('0x25')]=function(_0x4f3cf5){var _0x2a2a83=this;return new Promise(function(_0x34fc97,_0x1959c0){return db[_0x24a0('0x1a')][_0x24a0('0x26')]({'raw':_0x4f3cf5[_0x24a0('0x1c')]?_0x4f3cf5[_0x24a0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4f3cf5[_0x24a0('0x1c')]?_0x4f3cf5['options'][_0x24a0('0x1e')]||null:null,'attributes':_0x4f3cf5[_0x24a0('0x1c')]?_0x4f3cf5['options']['attributes']||null:null,'include':_0x4f3cf5['options']?_0x4f3cf5[_0x24a0('0x1c')][_0x24a0('0x22')]?_['map'](_0x4f3cf5[_0x24a0('0x1c')][_0x24a0('0x22')],function(_0x3c4296){return{'model':db[_0x3c4296[_0x24a0('0x23')]],'as':_0x3c4296['as'],'attributes':_0x3c4296['attributes'],'include':_0x3c4296[_0x24a0('0x22')]?_[_0x24a0('0x21')](_0x3c4296[_0x24a0('0x22')],function(_0x1dddb6){return{'model':db[_0x1dddb6[_0x24a0('0x23')]],'as':_0x1dddb6['as'],'attributes':_0x1dddb6['attributes'],'include':_0x1dddb6['include']?_[_0x24a0('0x21')](_0x1dddb6[_0x24a0('0x22')],function(_0x5a6d8a){return{'model':db[_0x5a6d8a[_0x24a0('0x23')]],'as':_0x5a6d8a['as'],'attributes':_0x5a6d8a[_0x24a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x24a0('0xe')](function(_0x193b4a){logger[_0x24a0('0xf')](_0x24a0('0x25'),_0x4f3cf5);logger[_0x24a0('0x11')]('ShowDeskAccount',_0x4f3cf5,JSON[_0x24a0('0x13')](_0x193b4a));_0x34fc97(_0x193b4a);})[_0x24a0('0x19')](function(_0x2d47a3){logger[_0x24a0('0x14')]('ShowDeskAccount',_0x2d47a3[_0x24a0('0x17')],_0x4f3cf5);_0x1959c0(_0x2a2a83[_0x24a0('0x14')](0x1f4,_0x2d47a3[_0x24a0('0x17')]));});});}; \ No newline at end of file +var _0x3543=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowDeskAccount','DeskAccount','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x1e52cb,_0x1f9dc4){var _0x259b73=function(_0x1c3c6c){while(--_0x1c3c6c){_0x1e52cb['push'](_0x1e52cb['shift']());}};_0x259b73(++_0x1f9dc4);}(_0x3543,0x105));var _0x3354=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x3543[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require(_0x3354('0x0'));var moment=require(_0x3354('0x1'));var BPromise=require(_0x3354('0x2'));var rs=require(_0x3354('0x3'));var fs=require('fs');var Redis=require(_0x3354('0x4'));var db=require(_0x3354('0x5'))['db'];var utils=require(_0x3354('0x6'));var logger=require(_0x3354('0x7'))(_0x3354('0x8'));var config=require('../../config/environment');var jayson=require(_0x3354('0x9'));var client=jayson[_0x3354('0xa')][_0x3354('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x399123,_0x2221de,_0x4811d6){return new BPromise(function(_0x2f19b3,_0x5ad3ff){return client[_0x3354('0xc')](_0x399123,_0x4811d6)[_0x3354('0xd')](function(_0x3a84fd){logger[_0x3354('0xe')](_0x3354('0xf'),_0x2221de,_0x3354('0x10'));logger[_0x3354('0x11')](_0x3354('0x12'),_0x2221de,'request\x20sent',JSON[_0x3354('0x13')](_0x3a84fd));if(_0x3a84fd['error']){if(_0x3a84fd[_0x3354('0x14')][_0x3354('0x15')]===0x1f4){logger[_0x3354('0x14')](_0x3354('0xf'),_0x2221de,_0x3a84fd[_0x3354('0x14')][_0x3354('0x16')]);return _0x5ad3ff(_0x3a84fd['error'][_0x3354('0x16')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x2221de,_0x3a84fd[_0x3354('0x14')][_0x3354('0x16')]);return _0x2f19b3(_0x3a84fd[_0x3354('0x14')][_0x3354('0x16')]);}else{logger[_0x3354('0xe')](_0x3354('0xf'),_0x2221de,_0x3354('0x10'));_0x2f19b3(_0x3a84fd[_0x3354('0x17')][_0x3354('0x16')]);}})[_0x3354('0x18')](function(_0x5dfb06){logger[_0x3354('0x14')]('DeskAccount,\x20%s,\x20%s',_0x2221de,_0x5dfb06);_0x5ad3ff(_0x5dfb06);});});}exports[_0x3354('0x19')]=function(_0xa963b2){var _0x200320=this;return new Promise(function(_0x2ca559,_0x216bc3){return db['DeskAccount'][_0x3354('0x1a')]({'raw':_0xa963b2[_0x3354('0x1b')]?_0xa963b2[_0x3354('0x1b')][_0x3354('0x1c')]===undefined?!![]:![]:!![],'where':_0xa963b2[_0x3354('0x1b')]?_0xa963b2[_0x3354('0x1b')][_0x3354('0x1d')]||null:null,'attributes':_0xa963b2[_0x3354('0x1b')]?_0xa963b2[_0x3354('0x1b')]['attributes']||null:null,'limit':_0xa963b2[_0x3354('0x1b')]?_0xa963b2['options'][_0x3354('0x1e')]||null:null,'include':_0xa963b2[_0x3354('0x1b')]?_0xa963b2[_0x3354('0x1b')][_0x3354('0x1f')]?_[_0x3354('0x20')](_0xa963b2[_0x3354('0x1b')][_0x3354('0x1f')],function(_0x26e25d){return{'model':db[_0x26e25d[_0x3354('0x21')]],'as':_0x26e25d['as'],'attributes':_0x26e25d['attributes'],'include':_0x26e25d['include']?_[_0x3354('0x20')](_0x26e25d[_0x3354('0x1f')],function(_0x16bf21){return{'model':db[_0x16bf21[_0x3354('0x21')]],'as':_0x16bf21['as'],'attributes':_0x16bf21['attributes'],'include':_0x16bf21[_0x3354('0x1f')]?_['map'](_0x16bf21[_0x3354('0x1f')],function(_0x106984){return{'model':db[_0x106984[_0x3354('0x21')]],'as':_0x106984['as'],'attributes':_0x106984[_0x3354('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3354('0xd')](function(_0x569de8){logger[_0x3354('0xe')]('GetDeskAccount',_0xa963b2);logger[_0x3354('0x11')]('GetDeskAccount',_0xa963b2,JSON['stringify'](_0x569de8));_0x2ca559(_0x569de8);})[_0x3354('0x18')](function(_0x22cea2){logger[_0x3354('0x14')](_0x3354('0x19'),_0x22cea2[_0x3354('0x16')],_0xa963b2);_0x216bc3(_0x200320['error'](0x1f4,_0x22cea2[_0x3354('0x16')]));});});};exports[_0x3354('0x23')]=function(_0x317981){var _0x4bc092=this;return new Promise(function(_0x25ddb4,_0x41f371){return db[_0x3354('0x24')][_0x3354('0x25')]({'raw':_0x317981[_0x3354('0x1b')]?_0x317981[_0x3354('0x1b')][_0x3354('0x1c')]===undefined?!![]:![]:!![],'where':_0x317981[_0x3354('0x1b')]?_0x317981['options'][_0x3354('0x1d')]||null:null,'attributes':_0x317981[_0x3354('0x1b')]?_0x317981[_0x3354('0x1b')][_0x3354('0x22')]||null:null,'include':_0x317981[_0x3354('0x1b')]?_0x317981[_0x3354('0x1b')][_0x3354('0x1f')]?_[_0x3354('0x20')](_0x317981[_0x3354('0x1b')][_0x3354('0x1f')],function(_0xd11864){return{'model':db[_0xd11864[_0x3354('0x21')]],'as':_0xd11864['as'],'attributes':_0xd11864[_0x3354('0x22')],'include':_0xd11864[_0x3354('0x1f')]?_['map'](_0xd11864[_0x3354('0x1f')],function(_0x44e6d4){return{'model':db[_0x44e6d4[_0x3354('0x21')]],'as':_0x44e6d4['as'],'attributes':_0x44e6d4[_0x3354('0x22')],'include':_0x44e6d4['include']?_[_0x3354('0x20')](_0x44e6d4['include'],function(_0x2e4950){return{'model':db[_0x2e4950['model']],'as':_0x2e4950['as'],'attributes':_0x2e4950[_0x3354('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3354('0xd')](function(_0x43be60){logger[_0x3354('0xe')](_0x3354('0x23'),_0x317981);logger['debug']('ShowDeskAccount',_0x317981,JSON[_0x3354('0x13')](_0x43be60));_0x25ddb4(_0x43be60);})['catch'](function(_0x11c315){logger[_0x3354('0x14')](_0x3354('0x23'),_0x11c315[_0x3354('0x16')],_0x317981);_0x41f371(_0x4bc092[_0x3354('0x14')](0x1f4,_0x11c315[_0x3354('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 21e5667..720a43b 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0x55ca,0x126));var _0xa55c=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x55ca[_0x578275];return _0xf78041;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x56e0fb,_0x4a2de7){var _0x22b957=function(_0x11b457){while(--_0x11b457){_0x56e0fb['push'](_0x56e0fb['shift']());}};_0x22b957(++_0x4a2de7);}(_0x34e8,0x12c));var _0x834e=function(_0x69f4c5,_0x4dd38d){_0x69f4c5=_0x69f4c5-0x0;var _0x55f7f6=_0x34e8[_0x69f4c5];return _0x55f7f6;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ae6ae99..29319d6 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 _0xaeb8=['STRING'];(function(_0x557cac,_0xf0d45f){var _0x45a05f=function(_0x506d17){while(--_0x506d17){_0x557cac['push'](_0x557cac['shift']());}};_0x45a05f(++_0xf0d45f);}(_0xaeb8,0x109));var _0x8aeb=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0xaeb8[_0x4599b6];return _0x2e014c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8aeb('0x0')]}}; \ No newline at end of file +var _0xb66a=['sequelize','exports'];(function(_0x2bef65,_0x13fecd){var _0x16c29e=function(_0x3bc2d5){while(--_0x3bc2d5){_0x2bef65['push'](_0x2bef65['shift']());}};_0x16c29e(++_0x13fecd);}(_0xb66a,0x18e));var _0xab66=function(_0x3d3426,_0x302e8c){_0x3d3426=_0x3d3426-0x0;var _0x5ab087=_0xb66a[_0x3d3426];return _0x5ab087;};'use strict';var Sequelize=require(_0xab66('0x0'));module[_0xab66('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 c19e893..1ca0c7c 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 _0x9f93=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','send','map','DeskConfiguration','rawAttributes','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getFields','findOne','keys','nolimit','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2157ab,_0x2b4a5b){var _0x5121e0=function(_0x46ab70){while(--_0x46ab70){_0x2157ab['push'](_0x2157ab['shift']());}};_0x5121e0(++_0x2b4a5b);}(_0x9f93,0x93));var _0x39f9=function(_0x4718c4,_0x522978){_0x4718c4=_0x4718c4-0x0;var _0x5f58a3=_0x9f93[_0x4718c4];return _0x5f58a3;};'use strict';var emlformat=require(_0x39f9('0x0'));var rimraf=require(_0x39f9('0x1'));var zipdir=require(_0x39f9('0x2'));var jsonpatch=require(_0x39f9('0x3'));var rp=require(_0x39f9('0x4'));var moment=require(_0x39f9('0x5'));var BPromise=require(_0x39f9('0x6'));var Mustache=require(_0x39f9('0x7'));var util=require(_0x39f9('0x8'));var path=require(_0x39f9('0x9'));var sox=require(_0x39f9('0xa'));var csv=require(_0x39f9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39f9('0xc'));var _=require('lodash');var squel=require(_0x39f9('0xd'));var crypto=require(_0x39f9('0xe'));var jsforce=require(_0x39f9('0xf'));var deskjs=require(_0x39f9('0x10'));var toCsv=require(_0x39f9('0xb'));var querystring=require('querystring');var Papa=require(_0x39f9('0x11'));var Redis=require(_0x39f9('0x12'));var authService=require(_0x39f9('0x13'));var qs=require(_0x39f9('0x14'));var as=require(_0x39f9('0x15'));var hardwareService=require(_0x39f9('0x16'));var logger=require('../../config/logger')(_0x39f9('0x17'));var utils=require(_0x39f9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x39f9('0x19'));var db=require(_0x39f9('0x1a'))['db'];function respondWithStatusCode(_0xcbc741,_0x4da622){_0x4da622=_0x4da622||0xcc;return function(_0x5f5aa8){if(_0x5f5aa8){return _0xcbc741[_0x39f9('0x1b')](_0x4da622);}return _0xcbc741[_0x39f9('0x1c')](_0x4da622)['end']();};}function respondWithResult(_0x207320,_0x4a4986){_0x4a4986=_0x4a4986||0xc8;return function(_0x45c42a){if(_0x45c42a){return _0x207320[_0x39f9('0x1c')](_0x4a4986)['json'](_0x45c42a);}};}function respondWithFilteredResult(_0x10f396,_0x518e7b){return function(_0x577bf4){if(_0x577bf4){var _0x87dcf6=typeof _0x518e7b[_0x39f9('0x1d')]===_0x39f9('0x1e')&&typeof _0x518e7b[_0x39f9('0x1f')]===_0x39f9('0x1e');var _0x259404=_0x577bf4[_0x39f9('0x20')];var _0x301df2=_0x87dcf6?0x0:_0x518e7b[_0x39f9('0x1d')];var _0x4ba267=_0x87dcf6?_0x577bf4[_0x39f9('0x20')]:_0x518e7b[_0x39f9('0x1d')]+_0x518e7b[_0x39f9('0x1f')];var _0x4741ad;if(_0x4ba267>=_0x259404){_0x4ba267=_0x259404;_0x4741ad=0xc8;}else{_0x4741ad=0xce;}_0x10f396[_0x39f9('0x1c')](_0x4741ad);return _0x10f396[_0x39f9('0x21')]('Content-Range',_0x301df2+'-'+_0x4ba267+'/'+_0x259404)[_0x39f9('0x22')](_0x577bf4);}return null;};}function patchUpdates(_0x164e02){return function(_0x43d95a){try{jsonpatch['apply'](_0x43d95a,_0x164e02,!![]);}catch(_0x316f31){return BPromise[_0x39f9('0x23')](_0x316f31);}return _0x43d95a[_0x39f9('0x24')]();};}function saveUpdates(_0x5dca0f,_0x41f8ea){return function(_0x5ab9e1){if(_0x5ab9e1){return _0x5ab9e1[_0x39f9('0x25')](_0x5dca0f)[_0x39f9('0x26')](function(_0x12aa11){return _0x12aa11;});}return null;};}function removeEntity(_0x1bde76,_0x43a1ac){return function(_0x9e7fcb){if(_0x9e7fcb){return _0x9e7fcb[_0x39f9('0x27')]()[_0x39f9('0x26')](function(){_0x1bde76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e28c,_0x5294e5){return function(_0x2904b3){if(!_0x2904b3){_0x26e28c['sendStatus'](0x194);}return _0x2904b3;};}function handleError(_0x3c7e69,_0x57e1b4){_0x57e1b4=_0x57e1b4||0x1f4;return function(_0xd5ecea){logger[_0x39f9('0x28')](_0xd5ecea[_0x39f9('0x29')]);if(_0xd5ecea['name']){delete _0xd5ecea[_0x39f9('0x2a')];}_0x3c7e69[_0x39f9('0x1c')](_0x57e1b4)[_0x39f9('0x2b')](_0xd5ecea);};}exports['index']=function(_0x3b9ab5,_0x4da713){var _0x3d7116={},_0x10b948={},_0x40e26a={'count':0x0,'rows':[]};var _0x368762=_[_0x39f9('0x2c')](db[_0x39f9('0x2d')][_0x39f9('0x2e')],function(_0x178fee){return{'name':_0x178fee['fieldName'],'type':_0x178fee[_0x39f9('0x2f')]['key']};});_0x10b948['model']=_[_0x39f9('0x2c')](_0x368762,_0x39f9('0x2a'));_0x10b948[_0x39f9('0x30')]=_['keys'](_0x3b9ab5[_0x39f9('0x30')]);_0x10b948[_0x39f9('0x31')]=_[_0x39f9('0x32')](_0x10b948[_0x39f9('0x33')],_0x10b948[_0x39f9('0x30')]);_0x3d7116[_0x39f9('0x34')]=_[_0x39f9('0x32')](_0x10b948[_0x39f9('0x33')],qs['fields'](_0x3b9ab5[_0x39f9('0x30')][_0x39f9('0x35')]));_0x3d7116[_0x39f9('0x34')]=_0x3d7116[_0x39f9('0x34')]['length']?_0x3d7116[_0x39f9('0x34')]:_0x10b948[_0x39f9('0x33')];if(!_0x3b9ab5[_0x39f9('0x30')][_0x39f9('0x36')]('nolimit')){_0x3d7116[_0x39f9('0x1f')]=qs[_0x39f9('0x1f')](_0x3b9ab5[_0x39f9('0x30')]['limit']);_0x3d7116[_0x39f9('0x1d')]=qs[_0x39f9('0x1d')](_0x3b9ab5[_0x39f9('0x30')][_0x39f9('0x1d')]);}_0x3d7116[_0x39f9('0x37')]=qs[_0x39f9('0x38')](_0x3b9ab5['query'][_0x39f9('0x38')]);_0x3d7116[_0x39f9('0x39')]=qs[_0x39f9('0x31')](_[_0x39f9('0x3a')](_0x3b9ab5[_0x39f9('0x30')],_0x10b948['filters']),_0x368762);if(_0x3b9ab5[_0x39f9('0x30')]['filter']){_0x3d7116[_0x39f9('0x39')]=_[_0x39f9('0x3b')](_0x3d7116[_0x39f9('0x39')],{'$or':_['map'](_0x368762,function(_0x68e2a9){if(_0x68e2a9[_0x39f9('0x2f')]!==_0x39f9('0x3c')){var _0x46a00b={};_0x46a00b[_0x68e2a9[_0x39f9('0x2a')]]={'$like':'%'+_0x3b9ab5['query'][_0x39f9('0x3d')]+'%'};return _0x46a00b;}})});}_0x3d7116=_[_0x39f9('0x3b')]({},_0x3d7116,_0x3b9ab5[_0x39f9('0x3e')]);var _0x5ddc67={'where':_0x3d7116[_0x39f9('0x39')]};return db[_0x39f9('0x2d')][_0x39f9('0x20')](_0x5ddc67)[_0x39f9('0x26')](function(_0x1c76fe){_0x40e26a[_0x39f9('0x20')]=_0x1c76fe;if(_0x3b9ab5[_0x39f9('0x30')][_0x39f9('0x3f')]){_0x3d7116[_0x39f9('0x40')]=[{'all':!![]}];}return db[_0x39f9('0x2d')][_0x39f9('0x41')](_0x3d7116);})[_0x39f9('0x26')](function(_0x590375){_0x40e26a[_0x39f9('0x42')]=_0x590375;return _0x40e26a;})[_0x39f9('0x26')](respondWithFilteredResult(_0x4da713,_0x3d7116))[_0x39f9('0x43')](handleError(_0x4da713,null));};exports[_0x39f9('0x44')]=function(_0x17cce8,_0x4ffd6c){var _0x5d80ae={'raw':![],'where':{'id':_0x17cce8['params']['id']}},_0xc1deed={};_0xc1deed[_0x39f9('0x33')]=_['keys'](db[_0x39f9('0x2d')]['rawAttributes']);_0xc1deed[_0x39f9('0x30')]=_['keys'](_0x17cce8[_0x39f9('0x30')]);_0xc1deed['filters']=_['intersection'](_0xc1deed[_0x39f9('0x33')],_0xc1deed[_0x39f9('0x30')]);_0x5d80ae[_0x39f9('0x34')]=_[_0x39f9('0x32')](_0xc1deed[_0x39f9('0x33')],qs['fields'](_0x17cce8[_0x39f9('0x30')][_0x39f9('0x35')]));_0x5d80ae[_0x39f9('0x34')]=_0x5d80ae[_0x39f9('0x34')][_0x39f9('0x45')]?_0x5d80ae[_0x39f9('0x34')]:_0xc1deed['model'];if(_0x17cce8['query']['includeAll']){_0x5d80ae[_0x39f9('0x40')]=[{'all':!![]}];}_0x5d80ae=_['merge']({},_0x5d80ae,_0x17cce8[_0x39f9('0x3e')]);return db[_0x39f9('0x2d')][_0x39f9('0x46')](_0x5d80ae)['then'](handleEntityNotFound(_0x4ffd6c,null))[_0x39f9('0x26')](respondWithResult(_0x4ffd6c,null))[_0x39f9('0x43')](handleError(_0x4ffd6c,null));};exports[_0x39f9('0x47')]=function(_0x5a036e,_0x11a59f){return db[_0x39f9('0x2d')][_0x39f9('0x47')](_0x5a036e['body'],{})['then'](respondWithResult(_0x11a59f,0xc9))[_0x39f9('0x43')](handleError(_0x11a59f,null));};exports[_0x39f9('0x25')]=function(_0x325f86,_0x1bf20e){if(_0x325f86[_0x39f9('0x48')]['id']){delete _0x325f86[_0x39f9('0x48')]['id'];}return db[_0x39f9('0x2d')][_0x39f9('0x46')]({'where':{'id':_0x325f86['params']['id']}})[_0x39f9('0x26')](handleEntityNotFound(_0x1bf20e,null))[_0x39f9('0x26')](saveUpdates(_0x325f86[_0x39f9('0x48')],null))['then'](respondWithResult(_0x1bf20e,null))['catch'](handleError(_0x1bf20e,null));};exports['destroy']=function(_0x2b31a9,_0x131a98){return db[_0x39f9('0x2d')]['find']({'where':{'id':_0x2b31a9[_0x39f9('0x49')]['id']}})['then'](handleEntityNotFound(_0x131a98,null))[_0x39f9('0x26')](removeEntity(_0x131a98,null))['catch'](handleError(_0x131a98,null));};exports[_0x39f9('0x4a')]=function(_0x5065c5,_0x202449,_0x5de5fb){var _0x12ae2f={};var _0x258371={};var _0x53227e;var _0x3d901c;return db[_0x39f9('0x2d')][_0x39f9('0x4b')]({'where':{'id':_0x5065c5[_0x39f9('0x49')]['id']}})[_0x39f9('0x26')](handleEntityNotFound(_0x202449,null))[_0x39f9('0x26')](function(_0x16cfd2){if(_0x16cfd2){_0x53227e=_0x16cfd2;_0x258371[_0x39f9('0x33')]=_[_0x39f9('0x4c')](db['DeskField'][_0x39f9('0x2e')]);_0x258371['query']=_['keys'](_0x5065c5[_0x39f9('0x30')]);_0x258371[_0x39f9('0x31')]=_[_0x39f9('0x32')](_0x258371[_0x39f9('0x33')],_0x258371['query']);_0x12ae2f['attributes']=_[_0x39f9('0x32')](_0x258371['model'],qs[_0x39f9('0x35')](_0x5065c5[_0x39f9('0x30')][_0x39f9('0x35')]));_0x12ae2f['attributes']=_0x12ae2f[_0x39f9('0x34')][_0x39f9('0x45')]?_0x12ae2f[_0x39f9('0x34')]:_0x258371[_0x39f9('0x33')];_0x12ae2f[_0x39f9('0x37')]=qs[_0x39f9('0x38')](_0x5065c5['query']['sort']);_0x12ae2f[_0x39f9('0x39')]=qs['filters'](_['pick'](_0x5065c5[_0x39f9('0x30')],_0x258371[_0x39f9('0x31')]));if(_0x5065c5[_0x39f9('0x30')][_0x39f9('0x3d')]){_0x12ae2f[_0x39f9('0x39')]=_['merge'](_0x12ae2f[_0x39f9('0x39')],{'$or':_[_0x39f9('0x2c')](_0x12ae2f['attributes'],function(_0xe078f4){var _0x2680b9={};_0x2680b9[_0xe078f4]={'$like':'%'+_0x5065c5[_0x39f9('0x30')][_0x39f9('0x3d')]+'%'};return _0x2680b9;})});}_0x12ae2f=_['merge']({},_0x12ae2f,_0x5065c5[_0x39f9('0x3e')]);return _0x53227e[_0x39f9('0x4a')](_0x12ae2f);}})['then'](function(_0x26e0ec){if(_0x26e0ec){_0x3d901c=_0x26e0ec[_0x39f9('0x45')];if(!_0x5065c5[_0x39f9('0x30')][_0x39f9('0x36')](_0x39f9('0x4d'))){_0x12ae2f[_0x39f9('0x1f')]=qs['limit'](_0x5065c5['query'][_0x39f9('0x1f')]);_0x12ae2f['offset']=qs[_0x39f9('0x1d')](_0x5065c5['query'][_0x39f9('0x1d')]);}return _0x53227e['getFields'](_0x12ae2f);}})[_0x39f9('0x26')](function(_0x1ca38f){if(_0x1ca38f){return _0x1ca38f?{'count':_0x3d901c,'rows':_0x1ca38f}:null;}})[_0x39f9('0x26')](respondWithResult(_0x202449,null))[_0x39f9('0x43')](handleError(_0x202449,null));};exports['getSubjects']=function(_0x35ff25,_0x10707e,_0x388b5c){var _0x3ce845={};var _0x8f5436={};var _0x415763;var _0x380b1e;return db[_0x39f9('0x2d')][_0x39f9('0x4b')]({'where':{'id':_0x35ff25[_0x39f9('0x49')]['id']}})[_0x39f9('0x26')](handleEntityNotFound(_0x10707e,null))['then'](function(_0x300ce9){if(_0x300ce9){_0x415763=_0x300ce9;_0x8f5436[_0x39f9('0x33')]=_[_0x39f9('0x4c')](db[_0x39f9('0x4e')]['rawAttributes']);_0x8f5436[_0x39f9('0x30')]=_[_0x39f9('0x4c')](_0x35ff25[_0x39f9('0x30')]);_0x8f5436['filters']=_[_0x39f9('0x32')](_0x8f5436['model'],_0x8f5436[_0x39f9('0x30')]);_0x3ce845[_0x39f9('0x34')]=_[_0x39f9('0x32')](_0x8f5436['model'],qs[_0x39f9('0x35')](_0x35ff25[_0x39f9('0x30')][_0x39f9('0x35')]));_0x3ce845[_0x39f9('0x34')]=_0x3ce845[_0x39f9('0x34')][_0x39f9('0x45')]?_0x3ce845['attributes']:_0x8f5436[_0x39f9('0x33')];_0x3ce845['order']=qs['sort'](_0x35ff25[_0x39f9('0x30')][_0x39f9('0x38')]);_0x3ce845[_0x39f9('0x39')]=qs['filters'](_[_0x39f9('0x3a')](_0x35ff25[_0x39f9('0x30')],_0x8f5436[_0x39f9('0x31')]));if(_0x35ff25[_0x39f9('0x30')][_0x39f9('0x3d')]){_0x3ce845['where']=_['merge'](_0x3ce845[_0x39f9('0x39')],{'$or':_[_0x39f9('0x2c')](_0x3ce845['attributes'],function(_0x116a0d){var _0x5b68c7={};_0x5b68c7[_0x116a0d]={'$like':'%'+_0x35ff25[_0x39f9('0x30')]['filter']+'%'};return _0x5b68c7;})});}_0x3ce845=_[_0x39f9('0x3b')]({},_0x3ce845,_0x35ff25[_0x39f9('0x3e')]);return _0x415763[_0x39f9('0x4f')](_0x3ce845);}})[_0x39f9('0x26')](function(_0x47baa1){if(_0x47baa1){_0x380b1e=_0x47baa1['length'];if(!_0x35ff25[_0x39f9('0x30')][_0x39f9('0x36')](_0x39f9('0x4d'))){_0x3ce845[_0x39f9('0x1f')]=qs[_0x39f9('0x1f')](_0x35ff25[_0x39f9('0x30')][_0x39f9('0x1f')]);_0x3ce845[_0x39f9('0x1d')]=qs[_0x39f9('0x1d')](_0x35ff25['query'][_0x39f9('0x1d')]);}return _0x415763[_0x39f9('0x4f')](_0x3ce845);}})[_0x39f9('0x26')](function(_0x21f8ad){if(_0x21f8ad){return _0x21f8ad?{'count':_0x380b1e,'rows':_0x21f8ad}:null;}})[_0x39f9('0x26')](respondWithResult(_0x10707e,null))[_0x39f9('0x43')](handleError(_0x10707e,null));};exports[_0x39f9('0x50')]=function(_0x159b42,_0x436b95,_0x1fe8a6){var _0xaaf1d5={};var _0x339ff2={};var _0x1039fb;var _0x3a1a92;return db[_0x39f9('0x2d')][_0x39f9('0x4b')]({'where':{'id':_0x159b42[_0x39f9('0x49')]['id']}})[_0x39f9('0x26')](handleEntityNotFound(_0x436b95,null))[_0x39f9('0x26')](function(_0x1f7ee0){if(_0x1f7ee0){_0x1039fb=_0x1f7ee0;_0x339ff2[_0x39f9('0x33')]=_['keys'](db[_0x39f9('0x4e')][_0x39f9('0x2e')]);_0x339ff2[_0x39f9('0x30')]=_[_0x39f9('0x4c')](_0x159b42[_0x39f9('0x30')]);_0x339ff2[_0x39f9('0x31')]=_[_0x39f9('0x32')](_0x339ff2[_0x39f9('0x33')],_0x339ff2['query']);_0xaaf1d5['attributes']=_[_0x39f9('0x32')](_0x339ff2[_0x39f9('0x33')],qs['fields'](_0x159b42[_0x39f9('0x30')][_0x39f9('0x35')]));_0xaaf1d5['attributes']=_0xaaf1d5[_0x39f9('0x34')][_0x39f9('0x45')]?_0xaaf1d5['attributes']:_0x339ff2[_0x39f9('0x33')];_0xaaf1d5[_0x39f9('0x37')]=qs['sort'](_0x159b42[_0x39f9('0x30')][_0x39f9('0x38')]);_0xaaf1d5[_0x39f9('0x39')]=qs[_0x39f9('0x31')](_[_0x39f9('0x3a')](_0x159b42[_0x39f9('0x30')],_0x339ff2[_0x39f9('0x31')]));if(_0x159b42['query'][_0x39f9('0x3d')]){_0xaaf1d5[_0x39f9('0x39')]=_[_0x39f9('0x3b')](_0xaaf1d5[_0x39f9('0x39')],{'$or':_['map'](_0xaaf1d5[_0x39f9('0x34')],function(_0x12a4cc){var _0x1ac109={};_0x1ac109[_0x12a4cc]={'$like':'%'+_0x159b42[_0x39f9('0x30')][_0x39f9('0x3d')]+'%'};return _0x1ac109;})});}_0xaaf1d5=_[_0x39f9('0x3b')]({},_0xaaf1d5,_0x159b42['options']);return _0x1039fb['getDescriptions'](_0xaaf1d5);}})[_0x39f9('0x26')](function(_0xe6cbb0){if(_0xe6cbb0){_0x3a1a92=_0xe6cbb0[_0x39f9('0x45')];if(!_0x159b42['query'][_0x39f9('0x36')](_0x39f9('0x4d'))){_0xaaf1d5['limit']=qs[_0x39f9('0x1f')](_0x159b42[_0x39f9('0x30')][_0x39f9('0x1f')]);_0xaaf1d5[_0x39f9('0x1d')]=qs[_0x39f9('0x1d')](_0x159b42[_0x39f9('0x30')][_0x39f9('0x1d')]);}return _0x1039fb[_0x39f9('0x50')](_0xaaf1d5);}})[_0x39f9('0x26')](function(_0x561843){if(_0x561843){return _0x561843?{'count':_0x3a1a92,'rows':_0x561843}:null;}})['then'](respondWithResult(_0x436b95,null))[_0x39f9('0x43')](handleError(_0x436b95,null));};exports[_0x39f9('0x51')]=function(_0x32f1f7,_0x342f91,_0x1e94bd){var _0x3e0763={};var _0x3b4249={};var _0x447d35;var _0x3a9b25;return db[_0x39f9('0x2d')]['findOne']({'where':{'id':_0x32f1f7[_0x39f9('0x49')]['id']}})['then'](handleEntityNotFound(_0x342f91,null))[_0x39f9('0x26')](function(_0x560154){if(_0x560154){_0x447d35=_0x560154;_0x3b4249[_0x39f9('0x33')]=_[_0x39f9('0x4c')](db[_0x39f9('0x52')]['rawAttributes']);_0x3b4249[_0x39f9('0x30')]=_[_0x39f9('0x4c')](_0x32f1f7[_0x39f9('0x30')]);_0x3b4249['filters']=_[_0x39f9('0x32')](_0x3b4249['model'],_0x3b4249[_0x39f9('0x30')]);_0x3e0763[_0x39f9('0x34')]=_[_0x39f9('0x32')](_0x3b4249[_0x39f9('0x33')],qs['fields'](_0x32f1f7[_0x39f9('0x30')]['fields']));_0x3e0763[_0x39f9('0x34')]=_0x3e0763['attributes'][_0x39f9('0x45')]?_0x3e0763[_0x39f9('0x34')]:_0x3b4249[_0x39f9('0x33')];_0x3e0763[_0x39f9('0x37')]=qs[_0x39f9('0x38')](_0x32f1f7[_0x39f9('0x30')][_0x39f9('0x38')]);_0x3e0763[_0x39f9('0x39')]=qs[_0x39f9('0x31')](_[_0x39f9('0x3a')](_0x32f1f7[_0x39f9('0x30')],_0x3b4249[_0x39f9('0x31')]));if(_0x32f1f7[_0x39f9('0x30')]['filter']){_0x3e0763[_0x39f9('0x39')]=_[_0x39f9('0x3b')](_0x3e0763[_0x39f9('0x39')],{'$or':_[_0x39f9('0x2c')](_0x3e0763[_0x39f9('0x34')],function(_0x5e2dff){var _0xc8eae6={};_0xc8eae6[_0x5e2dff]={'$like':'%'+_0x32f1f7[_0x39f9('0x30')][_0x39f9('0x3d')]+'%'};return _0xc8eae6;})});}_0x3e0763=_[_0x39f9('0x3b')]({},_0x3e0763,_0x32f1f7['options']);return _0x447d35['getTags'](_0x3e0763);}})['then'](function(_0x554fda){if(_0x554fda){_0x3a9b25=_0x554fda[_0x39f9('0x45')];if(!_0x32f1f7[_0x39f9('0x30')]['hasOwnProperty'](_0x39f9('0x4d'))){_0x3e0763[_0x39f9('0x1f')]=qs[_0x39f9('0x1f')](_0x32f1f7[_0x39f9('0x30')][_0x39f9('0x1f')]);_0x3e0763[_0x39f9('0x1d')]=qs[_0x39f9('0x1d')](_0x32f1f7[_0x39f9('0x30')][_0x39f9('0x1d')]);}return _0x447d35[_0x39f9('0x51')](_0x3e0763);}})[_0x39f9('0x26')](function(_0x1aeca6){if(_0x1aeca6){return _0x1aeca6?{'count':_0x3a9b25,'rows':_0x1aeca6}:null;}})[_0x39f9('0x26')](respondWithResult(_0x342f91,null))[_0x39f9('0x43')](handleError(_0x342f91,null));};exports['setTags']=function(_0x950778,_0x183cbd,_0x29c7e4){if(_0x950778[_0x39f9('0x48')]['id']){delete _0x950778['body']['id'];}return db[_0x39f9('0x2d')][_0x39f9('0x4b')]({'where':{'id':_0x950778[_0x39f9('0x49')]['id']}})['then'](handleEntityNotFound(_0x183cbd,null))[_0x39f9('0x26')](function(_0x4d1d91){if(_0x4d1d91){return _0x4d1d91[_0x39f9('0x53')](_0x950778[_0x39f9('0x48')][_0x39f9('0x54')]||[]);}return null;})[_0x39f9('0x26')](respondWithResult(_0x183cbd,null))[_0x39f9('0x43')](handleError(_0x183cbd,null));}; \ No newline at end of file +var _0xea86=['apply','reject','save','update','then','sendStatus','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','intersection','includeAll','find','create','body','destroy','params','getFields','findOne','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range'];(function(_0x356738,_0x375739){var _0x380d79=function(_0x327aa4){while(--_0x327aa4){_0x356738['push'](_0x356738['shift']());}};_0x380d79(++_0x375739);}(_0xea86,0xd8));var _0x6ea8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xea86[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x6ea8('0x0'));var rimraf=require(_0x6ea8('0x1'));var zipdir=require(_0x6ea8('0x2'));var jsonpatch=require(_0x6ea8('0x3'));var rp=require(_0x6ea8('0x4'));var moment=require(_0x6ea8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6ea8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6ea8('0x7'));var csv=require(_0x6ea8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ea8('0x9'));var _=require(_0x6ea8('0xa'));var squel=require(_0x6ea8('0xb'));var crypto=require('crypto');var jsforce=require(_0x6ea8('0xc'));var deskjs=require(_0x6ea8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6ea8('0xe'));var Papa=require(_0x6ea8('0xf'));var Redis=require('ioredis');var authService=require(_0x6ea8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6ea8('0x11'));var hardwareService=require(_0x6ea8('0x12'));var logger=require(_0x6ea8('0x13'))('api');var utils=require(_0x6ea8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6ea8('0x15'));var db=require(_0x6ea8('0x16'))['db'];function respondWithStatusCode(_0x3860c1,_0x14c22b){_0x14c22b=_0x14c22b||0xcc;return function(_0xe91d79){if(_0xe91d79){return _0x3860c1['sendStatus'](_0x14c22b);}return _0x3860c1[_0x6ea8('0x17')](_0x14c22b)['end']();};}function respondWithResult(_0x2ae436,_0x5c1cb4){_0x5c1cb4=_0x5c1cb4||0xc8;return function(_0x40bb7f){if(_0x40bb7f){return _0x2ae436[_0x6ea8('0x17')](_0x5c1cb4)[_0x6ea8('0x18')](_0x40bb7f);}};}function respondWithFilteredResult(_0x10e33d,_0xb457e3){return function(_0x30b5c4){if(_0x30b5c4){var _0x28d301=typeof _0xb457e3[_0x6ea8('0x19')]===_0x6ea8('0x1a')&&typeof _0xb457e3['limit']==='undefined';var _0x1f5aef=_0x30b5c4[_0x6ea8('0x1b')];var _0x1a812f=_0x28d301?0x0:_0xb457e3[_0x6ea8('0x19')];var _0x31ab9e=_0x28d301?_0x30b5c4[_0x6ea8('0x1b')]:_0xb457e3[_0x6ea8('0x19')]+_0xb457e3[_0x6ea8('0x1c')];var _0x1c89d8;if(_0x31ab9e>=_0x1f5aef){_0x31ab9e=_0x1f5aef;_0x1c89d8=0xc8;}else{_0x1c89d8=0xce;}_0x10e33d[_0x6ea8('0x17')](_0x1c89d8);return _0x10e33d['set'](_0x6ea8('0x1d'),_0x1a812f+'-'+_0x31ab9e+'/'+_0x1f5aef)[_0x6ea8('0x18')](_0x30b5c4);}return null;};}function patchUpdates(_0x3ad8a6){return function(_0x4b6785){try{jsonpatch[_0x6ea8('0x1e')](_0x4b6785,_0x3ad8a6,!![]);}catch(_0x49bd24){return BPromise[_0x6ea8('0x1f')](_0x49bd24);}return _0x4b6785[_0x6ea8('0x20')]();};}function saveUpdates(_0x33195e,_0x14b80c){return function(_0x589ac9){if(_0x589ac9){return _0x589ac9[_0x6ea8('0x21')](_0x33195e)[_0x6ea8('0x22')](function(_0x50a36b){return _0x50a36b;});}return null;};}function removeEntity(_0x26769a,_0x28fe55){return function(_0x2597fa){if(_0x2597fa){return _0x2597fa['destroy']()['then'](function(){_0x26769a[_0x6ea8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x710fbd,_0x1a6ee2){return function(_0x3439bd){if(!_0x3439bd){_0x710fbd[_0x6ea8('0x23')](0x194);}return _0x3439bd;};}function handleError(_0x59537e,_0x4b272c){_0x4b272c=_0x4b272c||0x1f4;return function(_0x12d8e2){logger[_0x6ea8('0x24')](_0x12d8e2[_0x6ea8('0x25')]);if(_0x12d8e2[_0x6ea8('0x26')]){delete _0x12d8e2[_0x6ea8('0x26')];}_0x59537e[_0x6ea8('0x17')](_0x4b272c)[_0x6ea8('0x27')](_0x12d8e2);};}exports['index']=function(_0x2f34d3,_0x4cfd20){var _0x27ac7f={},_0x10a163={},_0x269945={'count':0x0,'rows':[]};var _0x46cf72=_['map'](db[_0x6ea8('0x28')][_0x6ea8('0x29')],function(_0x380937){return{'name':_0x380937[_0x6ea8('0x2a')],'type':_0x380937[_0x6ea8('0x2b')][_0x6ea8('0x2c')]};});_0x10a163[_0x6ea8('0x2d')]=_[_0x6ea8('0x2e')](_0x46cf72,'name');_0x10a163[_0x6ea8('0x2f')]=_[_0x6ea8('0x30')](_0x2f34d3['query']);_0x10a163['filters']=_['intersection'](_0x10a163[_0x6ea8('0x2d')],_0x10a163[_0x6ea8('0x2f')]);_0x27ac7f['attributes']=_['intersection'](_0x10a163[_0x6ea8('0x2d')],qs[_0x6ea8('0x31')](_0x2f34d3['query'][_0x6ea8('0x31')]));_0x27ac7f[_0x6ea8('0x32')]=_0x27ac7f[_0x6ea8('0x32')][_0x6ea8('0x33')]?_0x27ac7f[_0x6ea8('0x32')]:_0x10a163['model'];if(!_0x2f34d3[_0x6ea8('0x2f')][_0x6ea8('0x34')](_0x6ea8('0x35'))){_0x27ac7f[_0x6ea8('0x1c')]=qs[_0x6ea8('0x1c')](_0x2f34d3['query'][_0x6ea8('0x1c')]);_0x27ac7f['offset']=qs[_0x6ea8('0x19')](_0x2f34d3['query']['offset']);}_0x27ac7f[_0x6ea8('0x36')]=qs[_0x6ea8('0x37')](_0x2f34d3[_0x6ea8('0x2f')]['sort']);_0x27ac7f[_0x6ea8('0x38')]=qs[_0x6ea8('0x39')](_[_0x6ea8('0x3a')](_0x2f34d3[_0x6ea8('0x2f')],_0x10a163[_0x6ea8('0x39')]),_0x46cf72);if(_0x2f34d3[_0x6ea8('0x2f')][_0x6ea8('0x3b')]){_0x27ac7f[_0x6ea8('0x38')]=_['merge'](_0x27ac7f[_0x6ea8('0x38')],{'$or':_[_0x6ea8('0x2e')](_0x46cf72,function(_0x2f4e9b){if(_0x2f4e9b['type']!==_0x6ea8('0x3c')){var _0x25acfa={};_0x25acfa[_0x2f4e9b['name']]={'$like':'%'+_0x2f34d3[_0x6ea8('0x2f')][_0x6ea8('0x3b')]+'%'};return _0x25acfa;}})});}_0x27ac7f=_[_0x6ea8('0x3d')]({},_0x27ac7f,_0x2f34d3[_0x6ea8('0x3e')]);var _0x2a59e8={'where':_0x27ac7f[_0x6ea8('0x38')]};return db['DeskConfiguration'][_0x6ea8('0x1b')](_0x2a59e8)[_0x6ea8('0x22')](function(_0x2e4cc8){_0x269945[_0x6ea8('0x1b')]=_0x2e4cc8;if(_0x2f34d3[_0x6ea8('0x2f')]['includeAll']){_0x27ac7f[_0x6ea8('0x3f')]=[{'all':!![]}];}return db[_0x6ea8('0x28')][_0x6ea8('0x40')](_0x27ac7f);})[_0x6ea8('0x22')](function(_0x379778){_0x269945[_0x6ea8('0x41')]=_0x379778;return _0x269945;})['then'](respondWithFilteredResult(_0x4cfd20,_0x27ac7f))[_0x6ea8('0x42')](handleError(_0x4cfd20,null));};exports['show']=function(_0x4dd4d4,_0x1eb3c0){var _0x3ef29d={'raw':![],'where':{'id':_0x4dd4d4['params']['id']}},_0x49f563={};_0x49f563['model']=_['keys'](db[_0x6ea8('0x28')][_0x6ea8('0x29')]);_0x49f563[_0x6ea8('0x2f')]=_[_0x6ea8('0x30')](_0x4dd4d4[_0x6ea8('0x2f')]);_0x49f563[_0x6ea8('0x39')]=_[_0x6ea8('0x43')](_0x49f563[_0x6ea8('0x2d')],_0x49f563[_0x6ea8('0x2f')]);_0x3ef29d[_0x6ea8('0x32')]=_[_0x6ea8('0x43')](_0x49f563[_0x6ea8('0x2d')],qs[_0x6ea8('0x31')](_0x4dd4d4['query'][_0x6ea8('0x31')]));_0x3ef29d['attributes']=_0x3ef29d[_0x6ea8('0x32')][_0x6ea8('0x33')]?_0x3ef29d[_0x6ea8('0x32')]:_0x49f563[_0x6ea8('0x2d')];if(_0x4dd4d4[_0x6ea8('0x2f')][_0x6ea8('0x44')]){_0x3ef29d['include']=[{'all':!![]}];}_0x3ef29d=_[_0x6ea8('0x3d')]({},_0x3ef29d,_0x4dd4d4[_0x6ea8('0x3e')]);return db[_0x6ea8('0x28')][_0x6ea8('0x45')](_0x3ef29d)[_0x6ea8('0x22')](handleEntityNotFound(_0x1eb3c0,null))[_0x6ea8('0x22')](respondWithResult(_0x1eb3c0,null))['catch'](handleError(_0x1eb3c0,null));};exports[_0x6ea8('0x46')]=function(_0xe814cf,_0x23c225){return db['DeskConfiguration'][_0x6ea8('0x46')](_0xe814cf['body'],{})[_0x6ea8('0x22')](respondWithResult(_0x23c225,0xc9))[_0x6ea8('0x42')](handleError(_0x23c225,null));};exports[_0x6ea8('0x21')]=function(_0x5a090d,_0x4debec){if(_0x5a090d[_0x6ea8('0x47')]['id']){delete _0x5a090d[_0x6ea8('0x47')]['id'];}return db[_0x6ea8('0x28')]['find']({'where':{'id':_0x5a090d['params']['id']}})['then'](handleEntityNotFound(_0x4debec,null))[_0x6ea8('0x22')](saveUpdates(_0x5a090d[_0x6ea8('0x47')],null))[_0x6ea8('0x22')](respondWithResult(_0x4debec,null))[_0x6ea8('0x42')](handleError(_0x4debec,null));};exports[_0x6ea8('0x48')]=function(_0x36e7da,_0x18e128){return db['DeskConfiguration'][_0x6ea8('0x45')]({'where':{'id':_0x36e7da[_0x6ea8('0x49')]['id']}})['then'](handleEntityNotFound(_0x18e128,null))[_0x6ea8('0x22')](removeEntity(_0x18e128,null))['catch'](handleError(_0x18e128,null));};exports[_0x6ea8('0x4a')]=function(_0x45bff1,_0x47684c,_0x3385c5){var _0x219ee2={};var _0x1ce565={};var _0x293bd6;var _0x28ff5a;return db[_0x6ea8('0x28')][_0x6ea8('0x4b')]({'where':{'id':_0x45bff1['params']['id']}})[_0x6ea8('0x22')](handleEntityNotFound(_0x47684c,null))[_0x6ea8('0x22')](function(_0x28937b){if(_0x28937b){_0x293bd6=_0x28937b;_0x1ce565['model']=_[_0x6ea8('0x30')](db['DeskField'][_0x6ea8('0x29')]);_0x1ce565[_0x6ea8('0x2f')]=_[_0x6ea8('0x30')](_0x45bff1['query']);_0x1ce565[_0x6ea8('0x39')]=_['intersection'](_0x1ce565[_0x6ea8('0x2d')],_0x1ce565[_0x6ea8('0x2f')]);_0x219ee2['attributes']=_[_0x6ea8('0x43')](_0x1ce565[_0x6ea8('0x2d')],qs[_0x6ea8('0x31')](_0x45bff1['query'][_0x6ea8('0x31')]));_0x219ee2[_0x6ea8('0x32')]=_0x219ee2['attributes']['length']?_0x219ee2[_0x6ea8('0x32')]:_0x1ce565[_0x6ea8('0x2d')];_0x219ee2[_0x6ea8('0x36')]=qs['sort'](_0x45bff1[_0x6ea8('0x2f')][_0x6ea8('0x37')]);_0x219ee2['where']=qs[_0x6ea8('0x39')](_['pick'](_0x45bff1[_0x6ea8('0x2f')],_0x1ce565[_0x6ea8('0x39')]));if(_0x45bff1['query'][_0x6ea8('0x3b')]){_0x219ee2[_0x6ea8('0x38')]=_[_0x6ea8('0x3d')](_0x219ee2[_0x6ea8('0x38')],{'$or':_[_0x6ea8('0x2e')](_0x219ee2[_0x6ea8('0x32')],function(_0x21b7bf){var _0x384f11={};_0x384f11[_0x21b7bf]={'$like':'%'+_0x45bff1[_0x6ea8('0x2f')][_0x6ea8('0x3b')]+'%'};return _0x384f11;})});}_0x219ee2=_[_0x6ea8('0x3d')]({},_0x219ee2,_0x45bff1[_0x6ea8('0x3e')]);return _0x293bd6[_0x6ea8('0x4a')](_0x219ee2);}})[_0x6ea8('0x22')](function(_0x205c88){if(_0x205c88){_0x28ff5a=_0x205c88[_0x6ea8('0x33')];if(!_0x45bff1[_0x6ea8('0x2f')][_0x6ea8('0x34')]('nolimit')){_0x219ee2['limit']=qs['limit'](_0x45bff1[_0x6ea8('0x2f')][_0x6ea8('0x1c')]);_0x219ee2[_0x6ea8('0x19')]=qs['offset'](_0x45bff1['query'][_0x6ea8('0x19')]);}return _0x293bd6[_0x6ea8('0x4a')](_0x219ee2);}})['then'](function(_0xdbd419){if(_0xdbd419){return _0xdbd419?{'count':_0x28ff5a,'rows':_0xdbd419}:null;}})[_0x6ea8('0x22')](respondWithResult(_0x47684c,null))['catch'](handleError(_0x47684c,null));};exports[_0x6ea8('0x4c')]=function(_0x157846,_0xb60a78,_0x24357e){var _0x4c28ec={};var _0x268a04={};var _0xaa98c4;var _0x25574d;return db[_0x6ea8('0x28')][_0x6ea8('0x4b')]({'where':{'id':_0x157846['params']['id']}})[_0x6ea8('0x22')](handleEntityNotFound(_0xb60a78,null))[_0x6ea8('0x22')](function(_0x41d8ed){if(_0x41d8ed){_0xaa98c4=_0x41d8ed;_0x268a04[_0x6ea8('0x2d')]=_['keys'](db[_0x6ea8('0x4d')][_0x6ea8('0x29')]);_0x268a04[_0x6ea8('0x2f')]=_[_0x6ea8('0x30')](_0x157846[_0x6ea8('0x2f')]);_0x268a04[_0x6ea8('0x39')]=_[_0x6ea8('0x43')](_0x268a04['model'],_0x268a04[_0x6ea8('0x2f')]);_0x4c28ec[_0x6ea8('0x32')]=_[_0x6ea8('0x43')](_0x268a04[_0x6ea8('0x2d')],qs['fields'](_0x157846['query'][_0x6ea8('0x31')]));_0x4c28ec[_0x6ea8('0x32')]=_0x4c28ec[_0x6ea8('0x32')][_0x6ea8('0x33')]?_0x4c28ec[_0x6ea8('0x32')]:_0x268a04['model'];_0x4c28ec[_0x6ea8('0x36')]=qs[_0x6ea8('0x37')](_0x157846[_0x6ea8('0x2f')][_0x6ea8('0x37')]);_0x4c28ec[_0x6ea8('0x38')]=qs[_0x6ea8('0x39')](_[_0x6ea8('0x3a')](_0x157846[_0x6ea8('0x2f')],_0x268a04['filters']));if(_0x157846['query'][_0x6ea8('0x3b')]){_0x4c28ec[_0x6ea8('0x38')]=_['merge'](_0x4c28ec[_0x6ea8('0x38')],{'$or':_[_0x6ea8('0x2e')](_0x4c28ec['attributes'],function(_0x206d53){var _0x5307cb={};_0x5307cb[_0x206d53]={'$like':'%'+_0x157846[_0x6ea8('0x2f')][_0x6ea8('0x3b')]+'%'};return _0x5307cb;})});}_0x4c28ec=_[_0x6ea8('0x3d')]({},_0x4c28ec,_0x157846[_0x6ea8('0x3e')]);return _0xaa98c4['getSubjects'](_0x4c28ec);}})[_0x6ea8('0x22')](function(_0x114a78){if(_0x114a78){_0x25574d=_0x114a78[_0x6ea8('0x33')];if(!_0x157846['query'][_0x6ea8('0x34')](_0x6ea8('0x35'))){_0x4c28ec[_0x6ea8('0x1c')]=qs[_0x6ea8('0x1c')](_0x157846[_0x6ea8('0x2f')][_0x6ea8('0x1c')]);_0x4c28ec[_0x6ea8('0x19')]=qs[_0x6ea8('0x19')](_0x157846['query'][_0x6ea8('0x19')]);}return _0xaa98c4[_0x6ea8('0x4c')](_0x4c28ec);}})[_0x6ea8('0x22')](function(_0x58bec9){if(_0x58bec9){return _0x58bec9?{'count':_0x25574d,'rows':_0x58bec9}:null;}})[_0x6ea8('0x22')](respondWithResult(_0xb60a78,null))[_0x6ea8('0x42')](handleError(_0xb60a78,null));};exports[_0x6ea8('0x4e')]=function(_0x2e2372,_0x205a8d,_0xf1b984){var _0x4df362={};var _0x4fa7b0={};var _0x47cc8a;var _0x22f6b7;return db[_0x6ea8('0x28')][_0x6ea8('0x4b')]({'where':{'id':_0x2e2372['params']['id']}})['then'](handleEntityNotFound(_0x205a8d,null))[_0x6ea8('0x22')](function(_0x4b43ec){if(_0x4b43ec){_0x47cc8a=_0x4b43ec;_0x4fa7b0[_0x6ea8('0x2d')]=_[_0x6ea8('0x30')](db[_0x6ea8('0x4d')][_0x6ea8('0x29')]);_0x4fa7b0[_0x6ea8('0x2f')]=_['keys'](_0x2e2372[_0x6ea8('0x2f')]);_0x4fa7b0[_0x6ea8('0x39')]=_[_0x6ea8('0x43')](_0x4fa7b0[_0x6ea8('0x2d')],_0x4fa7b0[_0x6ea8('0x2f')]);_0x4df362[_0x6ea8('0x32')]=_[_0x6ea8('0x43')](_0x4fa7b0[_0x6ea8('0x2d')],qs['fields'](_0x2e2372['query']['fields']));_0x4df362[_0x6ea8('0x32')]=_0x4df362[_0x6ea8('0x32')][_0x6ea8('0x33')]?_0x4df362[_0x6ea8('0x32')]:_0x4fa7b0['model'];_0x4df362[_0x6ea8('0x36')]=qs[_0x6ea8('0x37')](_0x2e2372[_0x6ea8('0x2f')]['sort']);_0x4df362[_0x6ea8('0x38')]=qs[_0x6ea8('0x39')](_['pick'](_0x2e2372[_0x6ea8('0x2f')],_0x4fa7b0[_0x6ea8('0x39')]));if(_0x2e2372[_0x6ea8('0x2f')]['filter']){_0x4df362[_0x6ea8('0x38')]=_[_0x6ea8('0x3d')](_0x4df362[_0x6ea8('0x38')],{'$or':_['map'](_0x4df362[_0x6ea8('0x32')],function(_0x37a88e){var _0x465470={};_0x465470[_0x37a88e]={'$like':'%'+_0x2e2372[_0x6ea8('0x2f')][_0x6ea8('0x3b')]+'%'};return _0x465470;})});}_0x4df362=_['merge']({},_0x4df362,_0x2e2372[_0x6ea8('0x3e')]);return _0x47cc8a['getDescriptions'](_0x4df362);}})[_0x6ea8('0x22')](function(_0x29c81e){if(_0x29c81e){_0x22f6b7=_0x29c81e[_0x6ea8('0x33')];if(!_0x2e2372[_0x6ea8('0x2f')]['hasOwnProperty']('nolimit')){_0x4df362[_0x6ea8('0x1c')]=qs['limit'](_0x2e2372[_0x6ea8('0x2f')]['limit']);_0x4df362[_0x6ea8('0x19')]=qs[_0x6ea8('0x19')](_0x2e2372[_0x6ea8('0x2f')]['offset']);}return _0x47cc8a['getDescriptions'](_0x4df362);}})[_0x6ea8('0x22')](function(_0x39ed07){if(_0x39ed07){return _0x39ed07?{'count':_0x22f6b7,'rows':_0x39ed07}:null;}})['then'](respondWithResult(_0x205a8d,null))['catch'](handleError(_0x205a8d,null));};exports[_0x6ea8('0x4f')]=function(_0x32c969,_0x229ff5,_0x39ae8){var _0x4802d7={};var _0x11a54b={};var _0x22b862;var _0x41b2f1;return db[_0x6ea8('0x28')]['findOne']({'where':{'id':_0x32c969[_0x6ea8('0x49')]['id']}})[_0x6ea8('0x22')](handleEntityNotFound(_0x229ff5,null))[_0x6ea8('0x22')](function(_0x4aa675){if(_0x4aa675){_0x22b862=_0x4aa675;_0x11a54b[_0x6ea8('0x2d')]=_[_0x6ea8('0x30')](db['Tag'][_0x6ea8('0x29')]);_0x11a54b[_0x6ea8('0x2f')]=_['keys'](_0x32c969['query']);_0x11a54b[_0x6ea8('0x39')]=_['intersection'](_0x11a54b[_0x6ea8('0x2d')],_0x11a54b[_0x6ea8('0x2f')]);_0x4802d7['attributes']=_['intersection'](_0x11a54b['model'],qs[_0x6ea8('0x31')](_0x32c969['query'][_0x6ea8('0x31')]));_0x4802d7[_0x6ea8('0x32')]=_0x4802d7[_0x6ea8('0x32')]['length']?_0x4802d7[_0x6ea8('0x32')]:_0x11a54b['model'];_0x4802d7[_0x6ea8('0x36')]=qs[_0x6ea8('0x37')](_0x32c969[_0x6ea8('0x2f')][_0x6ea8('0x37')]);_0x4802d7[_0x6ea8('0x38')]=qs['filters'](_['pick'](_0x32c969[_0x6ea8('0x2f')],_0x11a54b['filters']));if(_0x32c969[_0x6ea8('0x2f')][_0x6ea8('0x3b')]){_0x4802d7[_0x6ea8('0x38')]=_['merge'](_0x4802d7[_0x6ea8('0x38')],{'$or':_[_0x6ea8('0x2e')](_0x4802d7[_0x6ea8('0x32')],function(_0x408207){var _0x12d4af={};_0x12d4af[_0x408207]={'$like':'%'+_0x32c969[_0x6ea8('0x2f')][_0x6ea8('0x3b')]+'%'};return _0x12d4af;})});}_0x4802d7=_[_0x6ea8('0x3d')]({},_0x4802d7,_0x32c969[_0x6ea8('0x3e')]);return _0x22b862[_0x6ea8('0x4f')](_0x4802d7);}})[_0x6ea8('0x22')](function(_0xd44559){if(_0xd44559){_0x41b2f1=_0xd44559[_0x6ea8('0x33')];if(!_0x32c969['query'][_0x6ea8('0x34')]('nolimit')){_0x4802d7[_0x6ea8('0x1c')]=qs[_0x6ea8('0x1c')](_0x32c969[_0x6ea8('0x2f')][_0x6ea8('0x1c')]);_0x4802d7[_0x6ea8('0x19')]=qs[_0x6ea8('0x19')](_0x32c969[_0x6ea8('0x2f')][_0x6ea8('0x19')]);}return _0x22b862[_0x6ea8('0x4f')](_0x4802d7);}})['then'](function(_0x49fa59){if(_0x49fa59){return _0x49fa59?{'count':_0x41b2f1,'rows':_0x49fa59}:null;}})['then'](respondWithResult(_0x229ff5,null))['catch'](handleError(_0x229ff5,null));};exports[_0x6ea8('0x50')]=function(_0x255897,_0x372c00,_0x224d05){if(_0x255897['body']['id']){delete _0x255897[_0x6ea8('0x47')]['id'];}return db[_0x6ea8('0x28')][_0x6ea8('0x4b')]({'where':{'id':_0x255897[_0x6ea8('0x49')]['id']}})[_0x6ea8('0x22')](handleEntityNotFound(_0x372c00,null))[_0x6ea8('0x22')](function(_0x1200de){if(_0x1200de){return _0x1200de[_0x6ea8('0x50')](_0x255897[_0x6ea8('0x47')][_0x6ea8('0x51')]||[]);}return null;})[_0x6ea8('0x22')](respondWithResult(_0x372c00,null))[_0x6ea8('0x42')](handleError(_0x372c00,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 9722a04..0447f8e 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 _0x0580=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','../../config/logger','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0580,0x1d0));var _0x0058=function(_0x131f98,_0x58cf97){_0x131f98=_0x131f98-0x0;var _0x474238=_0x0580[_0x131f98];return _0x474238;};'use strict';var _=require(_0x0058('0x0'));var util=require(_0x0058('0x1'));var logger=require(_0x0058('0x2'))('api');var moment=require(_0x0058('0x3'));var BPromise=require(_0x0058('0x4'));var rp=require(_0x0058('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0058('0x6'));var config=require(_0x0058('0x7'));var attributes=require(_0x0058('0x8'));module[_0x0058('0x9')]=function(_0x2a4dbc,_0xc3712a){return _0x2a4dbc[_0x0058('0xa')](_0x0058('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4086=['api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x2cd796,_0x47d578){var _0x42e314=function(_0x36d3f5){while(--_0x36d3f5){_0x2cd796['push'](_0x2cd796['shift']());}};_0x42e314(++_0x47d578);}(_0x4086,0xdd));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6408('0x0'));var util=require(_0x6408('0x1'));var logger=require(_0x6408('0x2'))(_0x6408('0x3'));var moment=require(_0x6408('0x4'));var BPromise=require(_0x6408('0x5'));var rp=require(_0x6408('0x6'));var fs=require('fs');var path=require(_0x6408('0x7'));var rimraf=require(_0x6408('0x8'));var config=require('../../config/environment');var attributes=require(_0x6408('0x9'));module[_0x6408('0xa')]=function(_0x151059,_0x1ce7be){return _0x151059[_0x6408('0xb')](_0x6408('0xc'),attributes,{'tableName':_0x6408('0xd'),'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 6381fc8..49ee762 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 _0xafa7=['error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xafa7,0x122));var _0x7afa=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0xafa7[_0x4d67b8];return _0x55af3b;};'use strict';var _=require(_0x7afa('0x0'));var util=require(_0x7afa('0x1'));var moment=require('moment');var BPromise=require(_0x7afa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7afa('0x3'));var db=require(_0x7afa('0x4'))['db'];var utils=require(_0x7afa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7afa('0x6'));var jayson=require(_0x7afa('0x7'));var client=jayson[_0x7afa('0x8')][_0x7afa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2243f6,_0x2b826f,_0x59c1f0){return new BPromise(function(_0xde102c,_0x225de7){return client[_0x7afa('0xa')](_0x2243f6,_0x59c1f0)[_0x7afa('0xb')](function(_0x40bff1){logger[_0x7afa('0xc')](_0x7afa('0xd'),_0x2b826f,'request\x20sent');logger[_0x7afa('0xe')](_0x7afa('0xf'),_0x2b826f,_0x7afa('0x10'),JSON[_0x7afa('0x11')](_0x40bff1));if(_0x40bff1[_0x7afa('0x12')]){if(_0x40bff1[_0x7afa('0x12')][_0x7afa('0x13')]===0x1f4){logger[_0x7afa('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2b826f,_0x40bff1['error']['message']);return _0x225de7(_0x40bff1[_0x7afa('0x12')][_0x7afa('0x14')]);}logger[_0x7afa('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2b826f,_0x40bff1[_0x7afa('0x12')][_0x7afa('0x14')]);return _0xde102c(_0x40bff1[_0x7afa('0x12')]['message']);}else{logger['info'](_0x7afa('0xd'),_0x2b826f,'request\x20sent');_0xde102c(_0x40bff1[_0x7afa('0x15')]['message']);}})['catch'](function(_0xc6fd10){logger[_0x7afa('0x12')](_0x7afa('0xd'),_0x2b826f,_0xc6fd10);_0x225de7(_0xc6fd10);});});} \ No newline at end of file +var _0x0570=['request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x0570,0x172));var _0x0057=function(_0x57ca00,_0x4ce92b){_0x57ca00=_0x57ca00-0x0;var _0x552f28=_0x0570[_0x57ca00];return _0x552f28;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5096e2,_0xc86734,_0x529f55){return new BPromise(function(_0x15d424,_0x2f9d7f){return client[_0x0057('0xa')](_0x5096e2,_0x529f55)[_0x0057('0xb')](function(_0x29b7c6){logger['info'](_0x0057('0xc'),_0xc86734,_0x0057('0xd'));logger[_0x0057('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'),JSON[_0x0057('0xf')](_0x29b7c6));if(_0x29b7c6['error']){if(_0x29b7c6['error'][_0x0057('0x10')]===0x1f4){logger[_0x0057('0x11')](_0x0057('0xc'),_0xc86734,_0x29b7c6['error'][_0x0057('0x12')]);return _0x2f9d7f(_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);}logger[_0x0057('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0xc86734,_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);return _0x15d424(_0x29b7c6['error'][_0x0057('0x12')]);}else{logger[_0x0057('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'));_0x15d424(_0x29b7c6['result'][_0x0057('0x12')]);}})['catch'](function(_0x4be851){logger[_0x0057('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0xc86734,_0x4be851);_0x2f9d7f(_0x4be851);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4847279..487666e 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 _0xd3f3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4148e2,_0x23b194){var _0x34f35e=function(_0x3fba92){while(--_0x3fba92){_0x4148e2['push'](_0x4148e2['shift']());}};_0x34f35e(++_0x23b194);}(_0xd3f3,0xf0));var _0x3d3f=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xd3f3[_0x4b6830];return _0x239e4a;};'use strict';var multer=require(_0x3d3f('0x0'));var util=require('util');var path=require(_0x3d3f('0x1'));var timeout=require(_0x3d3f('0x2'));var express=require(_0x3d3f('0x3'));var router=express[_0x3d3f('0x4')]();var fs_extra=require(_0x3d3f('0x5'));var auth=require(_0x3d3f('0x6'));var interaction=require(_0x3d3f('0x7'));var config=require(_0x3d3f('0x8'));var controller=require('./intDeskField.controller');router[_0x3d3f('0x9')]('/',auth[_0x3d3f('0xa')](),controller[_0x3d3f('0xb')]);router[_0x3d3f('0x9')](_0x3d3f('0xc'),auth[_0x3d3f('0xa')](),controller[_0x3d3f('0xd')]);router[_0x3d3f('0xe')]('/',auth[_0x3d3f('0xa')](),controller['create']);router[_0x3d3f('0xf')](_0x3d3f('0xc'),auth[_0x3d3f('0xa')](),controller[_0x3d3f('0x10')]);router['delete'](_0x3d3f('0xc'),auth[_0x3d3f('0xa')](),controller[_0x3d3f('0x11')]);module[_0x3d3f('0x12')]=router; \ No newline at end of file +var _0x3bd3=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','show'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x3bd3,0x110));var _0x33bd=function(_0x524dfb,_0x954399){_0x524dfb=_0x524dfb-0x0;var _0x3bec28=_0x3bd3[_0x524dfb];return _0x3bec28;};'use strict';var multer=require(_0x33bd('0x0'));var util=require(_0x33bd('0x1'));var path=require(_0x33bd('0x2'));var timeout=require(_0x33bd('0x3'));var express=require(_0x33bd('0x4'));var router=express[_0x33bd('0x5')]();var fs_extra=require(_0x33bd('0x6'));var auth=require(_0x33bd('0x7'));var interaction=require(_0x33bd('0x8'));var config=require('../../config/environment');var controller=require(_0x33bd('0x9'));router[_0x33bd('0xa')]('/',auth[_0x33bd('0xb')](),controller[_0x33bd('0xc')]);router['get']('/:id',auth[_0x33bd('0xb')](),controller[_0x33bd('0xd')]);router[_0x33bd('0xe')]('/',auth[_0x33bd('0xb')](),controller[_0x33bd('0xf')]);router[_0x33bd('0x10')](_0x33bd('0x11'),auth['isAuthenticated'](),controller[_0x33bd('0x12')]);router[_0x33bd('0x13')]('/:id',auth[_0x33bd('0xb')](),controller[_0x33bd('0x14')]);module[_0x33bd('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 4362dea..a833629 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 _0xa7e3=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x2f345b,_0x1503eb){var _0x2c556b=function(_0x378633){while(--_0x378633){_0x2f345b['push'](_0x2f345b['shift']());}};_0x2c556b(++_0x1503eb);}(_0xa7e3,0x1d0));var _0x3a7e=function(_0x48beb3,_0x5a0a80){_0x48beb3=_0x48beb3-0x0;var _0x2e94be=_0xa7e3[_0x48beb3];return _0x2e94be;};'use strict';var Sequelize=require(_0x3a7e('0x0'));module[_0x3a7e('0x1')]={'type':{'type':Sequelize[_0x3a7e('0x2')]('string','variable',_0x3a7e('0x3'),_0x3a7e('0x4'),_0x3a7e('0x5')),'defaultValue':_0x3a7e('0x6')},'content':{'type':Sequelize[_0x3a7e('0x7')]},'key':{'type':Sequelize[_0x3a7e('0x7')]},'keyType':{'type':Sequelize[_0x3a7e('0x2')](_0x3a7e('0x6'),_0x3a7e('0x8'),_0x3a7e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3a7e('0x7')]},'nameField':{'type':Sequelize[_0x3a7e('0x7')]},'customField':{'type':Sequelize[_0x3a7e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a7e('0x7')]}}; \ No newline at end of file +var _0x788e=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0xd69e68,_0x6e75cf){var _0x38c3ef=function(_0x3693b9){while(--_0x3693b9){_0xd69e68['push'](_0xd69e68['shift']());}};_0x38c3ef(++_0x6e75cf);}(_0x788e,0xdd));var _0xe788=function(_0x571ede,_0x4b1f0a){_0x571ede=_0x571ede-0x0;var _0x4c6bf5=_0x788e[_0x571ede];return _0x4c6bf5;};'use strict';var Sequelize=require(_0xe788('0x0'));module[_0xe788('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe788('0x2'),_0xe788('0x3'),_0xe788('0x4'),_0xe788('0x5'),_0xe788('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe788('0x7')]},'key':{'type':Sequelize[_0xe788('0x7')]},'keyType':{'type':Sequelize[_0xe788('0x8')](_0xe788('0x2'),_0xe788('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe788('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe788('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe788('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7f064a1..a7e0657 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 _0x29af=['merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x3ae8f4,_0x2920f4){var _0x367312=function(_0x4dffbf){while(--_0x4dffbf){_0x3ae8f4['push'](_0x3ae8f4['shift']());}};_0x367312(++_0x2920f4);}(_0x29af,0x134));var _0xf29a=function(_0x4bc346,_0x32aa26){_0x4bc346=_0x4bc346-0x0;var _0x5277db=_0x29af[_0x4bc346];return _0x5277db;};'use strict';var emlformat=require(_0xf29a('0x0'));var rimraf=require(_0xf29a('0x1'));var zipdir=require(_0xf29a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf29a('0x3'));var moment=require(_0xf29a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf29a('0x5'));var util=require('util');var path=require(_0xf29a('0x6'));var sox=require(_0xf29a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf29a('0x8'));var _=require(_0xf29a('0x9'));var squel=require(_0xf29a('0xa'));var crypto=require(_0xf29a('0xb'));var jsforce=require(_0xf29a('0xc'));var deskjs=require(_0xf29a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf29a('0xe'));var Papa=require(_0xf29a('0xf'));var Redis=require(_0xf29a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf29a('0x11'));var hardwareService=require(_0xf29a('0x12'));var logger=require(_0xf29a('0x13'))(_0xf29a('0x14'));var utils=require(_0xf29a('0x15'));var config=require(_0xf29a('0x16'));var licenseUtil=require(_0xf29a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x446d4a,_0x19aa54){_0x19aa54=_0x19aa54||0xcc;return function(_0x23db30){if(_0x23db30){return _0x446d4a[_0xf29a('0x18')](_0x19aa54);}return _0x446d4a[_0xf29a('0x19')](_0x19aa54)[_0xf29a('0x1a')]();};}function respondWithResult(_0x3af6e8,_0x4de143){_0x4de143=_0x4de143||0xc8;return function(_0x4fc117){if(_0x4fc117){return _0x3af6e8['status'](_0x4de143)[_0xf29a('0x1b')](_0x4fc117);}};}function respondWithFilteredResult(_0x38dd20,_0x19de15){return function(_0x16913b){if(_0x16913b){var _0x17faf4=typeof _0x19de15['offset']===_0xf29a('0x1c')&&typeof _0x19de15[_0xf29a('0x1d')]===_0xf29a('0x1c');var _0x283fe5=_0x16913b[_0xf29a('0x1e')];var _0xd4ca39=_0x17faf4?0x0:_0x19de15[_0xf29a('0x1f')];var _0x296829=_0x17faf4?_0x16913b[_0xf29a('0x1e')]:_0x19de15[_0xf29a('0x1f')]+_0x19de15['limit'];var _0x474e1f;if(_0x296829>=_0x283fe5){_0x296829=_0x283fe5;_0x474e1f=0xc8;}else{_0x474e1f=0xce;}_0x38dd20[_0xf29a('0x19')](_0x474e1f);return _0x38dd20['set'](_0xf29a('0x20'),_0xd4ca39+'-'+_0x296829+'/'+_0x283fe5)[_0xf29a('0x1b')](_0x16913b);}return null;};}function patchUpdates(_0x191534){return function(_0x5c9395){try{jsonpatch[_0xf29a('0x21')](_0x5c9395,_0x191534,!![]);}catch(_0x560b73){return BPromise[_0xf29a('0x22')](_0x560b73);}return _0x5c9395[_0xf29a('0x23')]();};}function saveUpdates(_0x7bc34e,_0x1c3187){return function(_0x4d557c){if(_0x4d557c){return _0x4d557c[_0xf29a('0x24')](_0x7bc34e)[_0xf29a('0x25')](function(_0x43ce76){return _0x43ce76;});}return null;};}function removeEntity(_0xc0484c,_0x35af39){return function(_0x162538){if(_0x162538){return _0x162538[_0xf29a('0x26')]()['then'](function(){_0xc0484c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a5f,_0x4b610c){return function(_0x3635a6){if(!_0x3635a6){_0x262a5f[_0xf29a('0x18')](0x194);}return _0x3635a6;};}function handleError(_0x45a396,_0x5aee4a){_0x5aee4a=_0x5aee4a||0x1f4;return function(_0x181c3a){logger[_0xf29a('0x27')](_0x181c3a[_0xf29a('0x28')]);if(_0x181c3a[_0xf29a('0x29')]){delete _0x181c3a[_0xf29a('0x29')];}_0x45a396[_0xf29a('0x19')](_0x5aee4a)['send'](_0x181c3a);};}exports[_0xf29a('0x2a')]=function(_0x43b4ab,_0x524c16){var _0x4b7e38={},_0x4fdd1b={},_0x2707ef={'count':0x0,'rows':[]};var _0x2dfe2a=_[_0xf29a('0x2b')](db[_0xf29a('0x2c')][_0xf29a('0x2d')],function(_0x1a3c70){return{'name':_0x1a3c70[_0xf29a('0x2e')],'type':_0x1a3c70['type'][_0xf29a('0x2f')]};});_0x4fdd1b[_0xf29a('0x30')]=_[_0xf29a('0x2b')](_0x2dfe2a,_0xf29a('0x29'));_0x4fdd1b[_0xf29a('0x31')]=_[_0xf29a('0x32')](_0x43b4ab[_0xf29a('0x31')]);_0x4fdd1b['filters']=_[_0xf29a('0x33')](_0x4fdd1b['model'],_0x4fdd1b[_0xf29a('0x31')]);_0x4b7e38[_0xf29a('0x34')]=_[_0xf29a('0x33')](_0x4fdd1b[_0xf29a('0x30')],qs[_0xf29a('0x35')](_0x43b4ab['query'][_0xf29a('0x35')]));_0x4b7e38['attributes']=_0x4b7e38[_0xf29a('0x34')][_0xf29a('0x36')]?_0x4b7e38['attributes']:_0x4fdd1b[_0xf29a('0x30')];if(!_0x43b4ab[_0xf29a('0x31')]['hasOwnProperty'](_0xf29a('0x37'))){_0x4b7e38[_0xf29a('0x1d')]=qs[_0xf29a('0x1d')](_0x43b4ab[_0xf29a('0x31')][_0xf29a('0x1d')]);_0x4b7e38[_0xf29a('0x1f')]=qs['offset'](_0x43b4ab[_0xf29a('0x31')][_0xf29a('0x1f')]);}_0x4b7e38[_0xf29a('0x38')]=qs['sort'](_0x43b4ab[_0xf29a('0x31')][_0xf29a('0x39')]);_0x4b7e38[_0xf29a('0x3a')]=qs[_0xf29a('0x3b')](_[_0xf29a('0x3c')](_0x43b4ab[_0xf29a('0x31')],_0x4fdd1b[_0xf29a('0x3b')]),_0x2dfe2a);if(_0x43b4ab[_0xf29a('0x31')][_0xf29a('0x3d')]){_0x4b7e38[_0xf29a('0x3a')]=_[_0xf29a('0x3e')](_0x4b7e38[_0xf29a('0x3a')],{'$or':_['map'](_0x2dfe2a,function(_0x4d3ddb){if(_0x4d3ddb[_0xf29a('0x3f')]!==_0xf29a('0x40')){var _0x27243d={};_0x27243d[_0x4d3ddb['name']]={'$like':'%'+_0x43b4ab[_0xf29a('0x31')][_0xf29a('0x3d')]+'%'};return _0x27243d;}})});}_0x4b7e38=_[_0xf29a('0x3e')]({},_0x4b7e38,_0x43b4ab[_0xf29a('0x41')]);var _0x18d95d={'where':_0x4b7e38[_0xf29a('0x3a')]};return db[_0xf29a('0x2c')][_0xf29a('0x1e')](_0x18d95d)[_0xf29a('0x25')](function(_0x56e9f3){_0x2707ef[_0xf29a('0x1e')]=_0x56e9f3;if(_0x43b4ab['query'][_0xf29a('0x42')]){_0x4b7e38['include']=[{'all':!![]}];}return db[_0xf29a('0x2c')][_0xf29a('0x43')](_0x4b7e38);})['then'](function(_0x492d41){_0x2707ef['rows']=_0x492d41;return _0x2707ef;})[_0xf29a('0x25')](respondWithFilteredResult(_0x524c16,_0x4b7e38))[_0xf29a('0x44')](handleError(_0x524c16,null));};exports[_0xf29a('0x45')]=function(_0xe8375d,_0x41aa32){var _0x548345={'raw':!![],'where':{'id':_0xe8375d[_0xf29a('0x46')]['id']}},_0x19d031={};_0x19d031[_0xf29a('0x30')]=_[_0xf29a('0x32')](db['DeskField'][_0xf29a('0x2d')]);_0x19d031[_0xf29a('0x31')]=_[_0xf29a('0x32')](_0xe8375d[_0xf29a('0x31')]);_0x19d031[_0xf29a('0x3b')]=_[_0xf29a('0x33')](_0x19d031[_0xf29a('0x30')],_0x19d031[_0xf29a('0x31')]);_0x548345[_0xf29a('0x34')]=_[_0xf29a('0x33')](_0x19d031[_0xf29a('0x30')],qs[_0xf29a('0x35')](_0xe8375d[_0xf29a('0x31')][_0xf29a('0x35')]));_0x548345[_0xf29a('0x34')]=_0x548345[_0xf29a('0x34')][_0xf29a('0x36')]?_0x548345[_0xf29a('0x34')]:_0x19d031[_0xf29a('0x30')];if(_0xe8375d[_0xf29a('0x31')]['includeAll']){_0x548345['include']=[{'all':!![]}];}_0x548345=_[_0xf29a('0x3e')]({},_0x548345,_0xe8375d[_0xf29a('0x41')]);return db[_0xf29a('0x2c')][_0xf29a('0x47')](_0x548345)[_0xf29a('0x25')](handleEntityNotFound(_0x41aa32,null))[_0xf29a('0x25')](respondWithResult(_0x41aa32,null))[_0xf29a('0x44')](handleError(_0x41aa32,null));};exports[_0xf29a('0x48')]=function(_0x1cf705,_0x3a892c){return db[_0xf29a('0x2c')][_0xf29a('0x48')](_0x1cf705[_0xf29a('0x49')],{})[_0xf29a('0x25')](respondWithResult(_0x3a892c,0xc9))[_0xf29a('0x44')](handleError(_0x3a892c,null));};exports[_0xf29a('0x24')]=function(_0x2ec29f,_0x2ba2f0){if(_0x2ec29f[_0xf29a('0x49')]['id']){delete _0x2ec29f[_0xf29a('0x49')]['id'];}return db[_0xf29a('0x2c')][_0xf29a('0x47')]({'where':{'id':_0x2ec29f['params']['id']}})[_0xf29a('0x25')](handleEntityNotFound(_0x2ba2f0,null))[_0xf29a('0x25')](saveUpdates(_0x2ec29f[_0xf29a('0x49')],null))[_0xf29a('0x25')](respondWithResult(_0x2ba2f0,null))[_0xf29a('0x44')](handleError(_0x2ba2f0,null));};exports['destroy']=function(_0x348e3f,_0x1f8e53){return db[_0xf29a('0x2c')]['find']({'where':{'id':_0x348e3f['params']['id']}})['then'](handleEntityNotFound(_0x1f8e53,null))[_0xf29a('0x25')](removeEntity(_0x1f8e53,null))[_0xf29a('0x44')](handleError(_0x1f8e53,null));}; \ No newline at end of file +var _0x556b=['send','index','DeskField','rawAttributes','type','model','name','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','map','merge','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x59af9d,_0x2ba234){var _0x200c6a=function(_0x5a4c9f){while(--_0x5a4c9f){_0x59af9d['push'](_0x59af9d['shift']());}};_0x200c6a(++_0x2ba234);}(_0x556b,0x1d7));var _0xb556=function(_0x3dc130,_0x116fd2){_0x3dc130=_0x3dc130-0x0;var _0x46651a=_0x556b[_0x3dc130];return _0x46651a;};'use strict';var emlformat=require(_0xb556('0x0'));var rimraf=require(_0xb556('0x1'));var zipdir=require(_0xb556('0x2'));var jsonpatch=require(_0xb556('0x3'));var rp=require(_0xb556('0x4'));var moment=require('moment');var BPromise=require(_0xb556('0x5'));var Mustache=require(_0xb556('0x6'));var util=require(_0xb556('0x7'));var path=require(_0xb556('0x8'));var sox=require(_0xb556('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb556('0xa'));var squel=require(_0xb556('0xb'));var crypto=require(_0xb556('0xc'));var jsforce=require(_0xb556('0xd'));var deskjs=require(_0xb556('0xe'));var toCsv=require(_0xb556('0xf'));var querystring=require(_0xb556('0x10'));var Papa=require(_0xb556('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb556('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb556('0x13'));var logger=require(_0xb556('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb556('0x15'));var licenseUtil=require(_0xb556('0x16'));var db=require(_0xb556('0x17'))['db'];function respondWithStatusCode(_0x40d9f2,_0xef593){_0xef593=_0xef593||0xcc;return function(_0x383401){if(_0x383401){return _0x40d9f2['sendStatus'](_0xef593);}return _0x40d9f2['status'](_0xef593)[_0xb556('0x18')]();};}function respondWithResult(_0x5a002a,_0x29fa7e){_0x29fa7e=_0x29fa7e||0xc8;return function(_0x52ff5e){if(_0x52ff5e){return _0x5a002a['status'](_0x29fa7e)['json'](_0x52ff5e);}};}function respondWithFilteredResult(_0x39305f,_0x9c69d9){return function(_0xffd07){if(_0xffd07){var _0x329bd0=typeof _0x9c69d9[_0xb556('0x19')]===_0xb556('0x1a')&&typeof _0x9c69d9[_0xb556('0x1b')]===_0xb556('0x1a');var _0xcfaa19=_0xffd07['count'];var _0x475808=_0x329bd0?0x0:_0x9c69d9[_0xb556('0x19')];var _0xb378b2=_0x329bd0?_0xffd07[_0xb556('0x1c')]:_0x9c69d9['offset']+_0x9c69d9[_0xb556('0x1b')];var _0x355b15;if(_0xb378b2>=_0xcfaa19){_0xb378b2=_0xcfaa19;_0x355b15=0xc8;}else{_0x355b15=0xce;}_0x39305f[_0xb556('0x1d')](_0x355b15);return _0x39305f[_0xb556('0x1e')]('Content-Range',_0x475808+'-'+_0xb378b2+'/'+_0xcfaa19)[_0xb556('0x1f')](_0xffd07);}return null;};}function patchUpdates(_0x3f1f30){return function(_0xa840e7){try{jsonpatch[_0xb556('0x20')](_0xa840e7,_0x3f1f30,!![]);}catch(_0x49d0b5){return BPromise[_0xb556('0x21')](_0x49d0b5);}return _0xa840e7[_0xb556('0x22')]();};}function saveUpdates(_0x21a3b6,_0x126af6){return function(_0x420ddb){if(_0x420ddb){return _0x420ddb[_0xb556('0x23')](_0x21a3b6)[_0xb556('0x24')](function(_0x5f10a5){return _0x5f10a5;});}return null;};}function removeEntity(_0x33797a,_0x3d5ae7){return function(_0x12b195){if(_0x12b195){return _0x12b195[_0xb556('0x25')]()[_0xb556('0x24')](function(){_0x33797a[_0xb556('0x1d')](0xcc)[_0xb556('0x18')]();});}};}function handleEntityNotFound(_0x442264,_0x22abed){return function(_0x184e87){if(!_0x184e87){_0x442264[_0xb556('0x26')](0x194);}return _0x184e87;};}function handleError(_0x3a328c,_0xb89dbe){_0xb89dbe=_0xb89dbe||0x1f4;return function(_0x1962b1){logger['error'](_0x1962b1[_0xb556('0x27')]);if(_0x1962b1['name']){delete _0x1962b1['name'];}_0x3a328c['status'](_0xb89dbe)[_0xb556('0x28')](_0x1962b1);};}exports[_0xb556('0x29')]=function(_0x27fd7e,_0x58180c){var _0x19544e={},_0x3c9a87={},_0x5d8d06={'count':0x0,'rows':[]};var _0x58990f=_['map'](db[_0xb556('0x2a')][_0xb556('0x2b')],function(_0x4bba03){return{'name':_0x4bba03['fieldName'],'type':_0x4bba03[_0xb556('0x2c')]['key']};});_0x3c9a87[_0xb556('0x2d')]=_['map'](_0x58990f,_0xb556('0x2e'));_0x3c9a87['query']=_[_0xb556('0x2f')](_0x27fd7e[_0xb556('0x30')]);_0x3c9a87['filters']=_['intersection'](_0x3c9a87[_0xb556('0x2d')],_0x3c9a87[_0xb556('0x30')]);_0x19544e[_0xb556('0x31')]=_['intersection'](_0x3c9a87[_0xb556('0x2d')],qs[_0xb556('0x32')](_0x27fd7e[_0xb556('0x30')][_0xb556('0x32')]));_0x19544e['attributes']=_0x19544e[_0xb556('0x31')][_0xb556('0x33')]?_0x19544e['attributes']:_0x3c9a87['model'];if(!_0x27fd7e[_0xb556('0x30')][_0xb556('0x34')](_0xb556('0x35'))){_0x19544e['limit']=qs[_0xb556('0x1b')](_0x27fd7e[_0xb556('0x30')]['limit']);_0x19544e[_0xb556('0x19')]=qs[_0xb556('0x19')](_0x27fd7e[_0xb556('0x30')]['offset']);}_0x19544e['order']=qs[_0xb556('0x36')](_0x27fd7e[_0xb556('0x30')][_0xb556('0x36')]);_0x19544e['where']=qs[_0xb556('0x37')](_[_0xb556('0x38')](_0x27fd7e['query'],_0x3c9a87['filters']),_0x58990f);if(_0x27fd7e[_0xb556('0x30')][_0xb556('0x39')]){_0x19544e['where']=_['merge'](_0x19544e[_0xb556('0x3a')],{'$or':_[_0xb556('0x3b')](_0x58990f,function(_0x38c26d){if(_0x38c26d[_0xb556('0x2c')]!=='VIRTUAL'){var _0x348a8e={};_0x348a8e[_0x38c26d['name']]={'$like':'%'+_0x27fd7e['query'][_0xb556('0x39')]+'%'};return _0x348a8e;}})});}_0x19544e=_[_0xb556('0x3c')]({},_0x19544e,_0x27fd7e[_0xb556('0x3d')]);var _0x15add6={'where':_0x19544e[_0xb556('0x3a')]};return db[_0xb556('0x2a')]['count'](_0x15add6)[_0xb556('0x24')](function(_0xe1e49){_0x5d8d06[_0xb556('0x1c')]=_0xe1e49;if(_0x27fd7e[_0xb556('0x30')][_0xb556('0x3e')]){_0x19544e['include']=[{'all':!![]}];}return db[_0xb556('0x2a')][_0xb556('0x3f')](_0x19544e);})['then'](function(_0x107746){_0x5d8d06[_0xb556('0x40')]=_0x107746;return _0x5d8d06;})[_0xb556('0x24')](respondWithFilteredResult(_0x58180c,_0x19544e))[_0xb556('0x41')](handleError(_0x58180c,null));};exports[_0xb556('0x42')]=function(_0x35c0ad,_0xfb9f2b){var _0x488888={'raw':!![],'where':{'id':_0x35c0ad[_0xb556('0x43')]['id']}},_0x51ad59={};_0x51ad59[_0xb556('0x2d')]=_['keys'](db['DeskField'][_0xb556('0x2b')]);_0x51ad59[_0xb556('0x30')]=_[_0xb556('0x2f')](_0x35c0ad['query']);_0x51ad59[_0xb556('0x37')]=_['intersection'](_0x51ad59[_0xb556('0x2d')],_0x51ad59[_0xb556('0x30')]);_0x488888[_0xb556('0x31')]=_[_0xb556('0x44')](_0x51ad59['model'],qs[_0xb556('0x32')](_0x35c0ad[_0xb556('0x30')]['fields']));_0x488888[_0xb556('0x31')]=_0x488888[_0xb556('0x31')][_0xb556('0x33')]?_0x488888[_0xb556('0x31')]:_0x51ad59['model'];if(_0x35c0ad[_0xb556('0x30')][_0xb556('0x3e')]){_0x488888[_0xb556('0x45')]=[{'all':!![]}];}_0x488888=_[_0xb556('0x3c')]({},_0x488888,_0x35c0ad['options']);return db['DeskField'][_0xb556('0x46')](_0x488888)[_0xb556('0x24')](handleEntityNotFound(_0xfb9f2b,null))['then'](respondWithResult(_0xfb9f2b,null))[_0xb556('0x41')](handleError(_0xfb9f2b,null));};exports[_0xb556('0x47')]=function(_0x55b9a1,_0x29ac04){return db[_0xb556('0x2a')][_0xb556('0x47')](_0x55b9a1[_0xb556('0x48')],{})[_0xb556('0x24')](respondWithResult(_0x29ac04,0xc9))[_0xb556('0x41')](handleError(_0x29ac04,null));};exports[_0xb556('0x23')]=function(_0x167e6b,_0x221df8){if(_0x167e6b[_0xb556('0x48')]['id']){delete _0x167e6b[_0xb556('0x48')]['id'];}return db[_0xb556('0x2a')][_0xb556('0x46')]({'where':{'id':_0x167e6b[_0xb556('0x43')]['id']}})[_0xb556('0x24')](handleEntityNotFound(_0x221df8,null))[_0xb556('0x24')](saveUpdates(_0x167e6b['body'],null))[_0xb556('0x24')](respondWithResult(_0x221df8,null))[_0xb556('0x41')](handleError(_0x221df8,null));};exports['destroy']=function(_0x496b7f,_0x4686d5){return db[_0xb556('0x2a')][_0xb556('0x46')]({'where':{'id':_0x496b7f[_0xb556('0x43')]['id']}})['then'](handleEntityNotFound(_0x4686d5,null))['then'](removeEntity(_0x4686d5,null))[_0xb556('0x41')](handleError(_0x4686d5,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 8b183d6..e3fe2c3 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 _0x8262=['api','request-promise','path','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x55abcb,_0x1c8ce0){var _0x10b891=function(_0x2d58cd){while(--_0x2d58cd){_0x55abcb['push'](_0x55abcb['shift']());}};_0x10b891(++_0x1c8ce0);}(_0x8262,0x176));var _0x2826=function(_0x5272a9,_0x4efdfc){_0x5272a9=_0x5272a9-0x0;var _0xa7a812=_0x8262[_0x5272a9];return _0xa7a812;};'use strict';var _=require(_0x2826('0x0'));var util=require(_0x2826('0x1'));var logger=require(_0x2826('0x2'))(_0x2826('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2826('0x4'));var fs=require('fs');var path=require(_0x2826('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2826('0x6'));module[_0x2826('0x7')]=function(_0x4ff12a,_0x58ca8f){return _0x4ff12a[_0x2826('0x8')](_0x2826('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x2826('0xa'),'fields':[_0x2826('0xb'),_0x2826('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad8f=['DeskField','int_desk_fields','desk_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x447b19,_0x7df010){var _0x3d92e0=function(_0x1a1e0b){while(--_0x1a1e0b){_0x447b19['push'](_0x447b19['shift']());}};_0x3d92e0(++_0x7df010);}(_0xad8f,0xd4));var _0xfad8=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xad8f[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0xfad8('0x0'));var logger=require(_0xfad8('0x1'))(_0xfad8('0x2'));var moment=require(_0xfad8('0x3'));var BPromise=require(_0xfad8('0x4'));var rp=require(_0xfad8('0x5'));var fs=require('fs');var path=require(_0xfad8('0x6'));var rimraf=require(_0xfad8('0x7'));var config=require(_0xfad8('0x8'));var attributes=require(_0xfad8('0x9'));module[_0xfad8('0xa')]=function(_0x2df88f,_0x2a16c3){return _0x2df88f[_0xfad8('0xb')](_0xfad8('0xc'),attributes,{'tableName':_0xfad8('0xd'),'paranoid':![],'indexes':[{'name':_0xfad8('0xe'),'fields':['idField',_0xfad8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 86e0953..1a63c96 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 _0x83ac=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x46c93e,_0x51e179){var _0x1fbd53=function(_0x5e710a){while(--_0x5e710a){_0x46c93e['push'](_0x46c93e['shift']());}};_0x1fbd53(++_0x51e179);}(_0x83ac,0x13b));var _0xc83a=function(_0x58cb7f,_0x381869){_0x58cb7f=_0x58cb7f-0x0;var _0x4076dc=_0x83ac[_0x58cb7f];return _0x4076dc;};'use strict';var _=require('lodash');var util=require(_0xc83a('0x0'));var moment=require(_0xc83a('0x1'));var BPromise=require(_0xc83a('0x2'));var rs=require(_0xc83a('0x3'));var fs=require('fs');var Redis=require(_0xc83a('0x4'));var db=require(_0xc83a('0x5'))['db'];var utils=require(_0xc83a('0x6'));var logger=require(_0xc83a('0x7'))('rpc');var config=require(_0xc83a('0x8'));var jayson=require(_0xc83a('0x9'));var client=jayson[_0xc83a('0xa')][_0xc83a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b347f,_0x5f618b,_0x3fcf5f){return new BPromise(function(_0x37ef9f,_0x266588){return client['request'](_0x1b347f,_0x3fcf5f)[_0xc83a('0xc')](function(_0x8cbf2b){logger[_0xc83a('0xd')](_0xc83a('0xe'),_0x5f618b,'request\x20sent');logger['debug'](_0xc83a('0xf'),_0x5f618b,_0xc83a('0x10'),JSON[_0xc83a('0x11')](_0x8cbf2b));if(_0x8cbf2b[_0xc83a('0x12')]){if(_0x8cbf2b[_0xc83a('0x12')][_0xc83a('0x13')]===0x1f4){logger[_0xc83a('0x12')](_0xc83a('0xe'),_0x5f618b,_0x8cbf2b['error'][_0xc83a('0x14')]);return _0x266588(_0x8cbf2b[_0xc83a('0x12')][_0xc83a('0x14')]);}logger[_0xc83a('0x12')](_0xc83a('0xe'),_0x5f618b,_0x8cbf2b[_0xc83a('0x12')][_0xc83a('0x14')]);return _0x37ef9f(_0x8cbf2b[_0xc83a('0x12')][_0xc83a('0x14')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x5f618b,_0xc83a('0x10'));_0x37ef9f(_0x8cbf2b[_0xc83a('0x15')][_0xc83a('0x14')]);}})[_0xc83a('0x16')](function(_0x495008){logger['error'](_0xc83a('0xe'),_0x5f618b,_0x495008);_0x266588(_0x495008);});});} \ No newline at end of file +var _0x34c0=['stringify','error','message','DeskField,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent'];(function(_0x1c4982,_0x56c863){var _0x31de9b=function(_0xcb537e){while(--_0xcb537e){_0x1c4982['push'](_0x1c4982['shift']());}};_0x31de9b(++_0x56c863);}(_0x34c0,0x1ab));var _0x034c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x034c('0x0'));var util=require('util');var moment=require(_0x034c('0x1'));var BPromise=require(_0x034c('0x2'));var rs=require(_0x034c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x034c('0x4'))['db'];var utils=require(_0x034c('0x5'));var logger=require('../../config/logger')(_0x034c('0x6'));var config=require(_0x034c('0x7'));var jayson=require(_0x034c('0x8'));var client=jayson['client'][_0x034c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29d566,_0x1b53c6,_0x1af3bb){return new BPromise(function(_0x22da50,_0x2e7c9e){return client[_0x034c('0xa')](_0x29d566,_0x1af3bb)[_0x034c('0xb')](function(_0x3a880e){logger['info']('DeskField,\x20%s,\x20%s',_0x1b53c6,_0x034c('0xc'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x1b53c6,_0x034c('0xc'),JSON[_0x034c('0xd')](_0x3a880e));if(_0x3a880e[_0x034c('0xe')]){if(_0x3a880e['error']['code']===0x1f4){logger[_0x034c('0xe')]('DeskField,\x20%s,\x20%s',_0x1b53c6,_0x3a880e[_0x034c('0xe')][_0x034c('0xf')]);return _0x2e7c9e(_0x3a880e[_0x034c('0xe')][_0x034c('0xf')]);}logger[_0x034c('0xe')](_0x034c('0x10'),_0x1b53c6,_0x3a880e[_0x034c('0xe')][_0x034c('0xf')]);return _0x22da50(_0x3a880e[_0x034c('0xe')][_0x034c('0xf')]);}else{logger[_0x034c('0x11')](_0x034c('0x10'),_0x1b53c6,_0x034c('0xc'));_0x22da50(_0x3a880e[_0x034c('0x12')][_0x034c('0xf')]);}})[_0x034c('0x13')](function(_0x43671a){logger[_0x034c('0xe')](_0x034c('0x10'),_0x1b53c6,_0x43671a);_0x2e7c9e(_0x43671a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a289c85..1637fe0 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 _0xf5ef=['/:id/fields','getFields','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x3140a9,_0x4a71a2){var _0x410664=function(_0x531c07){while(--_0x531c07){_0x3140a9['push'](_0x3140a9['shift']());}};_0x410664(++_0x4a71a2);}(_0xf5ef,0xcd));var _0xff5e=function(_0x4d3b3c,_0x4263d8){_0x4d3b3c=_0x4d3b3c-0x0;var _0x404715=_0xf5ef[_0x4d3b3c];return _0x404715;};'use strict';var multer=require(_0xff5e('0x0'));var util=require(_0xff5e('0x1'));var path=require(_0xff5e('0x2'));var timeout=require(_0xff5e('0x3'));var express=require(_0xff5e('0x4'));var router=express[_0xff5e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xff5e('0x6'));var interaction=require(_0xff5e('0x7'));var config=require(_0xff5e('0x8'));var controller=require('./intDynamics365Account.controller');router[_0xff5e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff5e('0x9')](_0xff5e('0xa'),auth[_0xff5e('0xb')](),controller[_0xff5e('0xc')]);router['get'](_0xff5e('0xd'),auth[_0xff5e('0xb')](),controller[_0xff5e('0xe')]);router[_0xff5e('0x9')](_0xff5e('0xf'),auth[_0xff5e('0xb')](),controller[_0xff5e('0x10')]);router['post']('/',auth[_0xff5e('0xb')](),controller[_0xff5e('0x11')]);router['post'](_0xff5e('0xd'),auth[_0xff5e('0xb')](),controller['addConfiguration']);router[_0xff5e('0x12')](_0xff5e('0xa'),auth[_0xff5e('0xb')](),controller[_0xff5e('0x13')]);router[_0xff5e('0x14')]('/:id',auth[_0xff5e('0xb')](),controller[_0xff5e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8935=['getConfigurations','getFields','post','addConfiguration','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','/:id/configurations'];(function(_0x43b3ac,_0x294393){var _0x816124=function(_0x157bb5){while(--_0x157bb5){_0x43b3ac['push'](_0x43b3ac['shift']());}};_0x816124(++_0x294393);}(_0x8935,0xd9));var _0x5893=function(_0x1830b6,_0x25b50f){_0x1830b6=_0x1830b6-0x0;var _0x2fe25c=_0x8935[_0x1830b6];return _0x2fe25c;};'use strict';var multer=require(_0x5893('0x0'));var util=require('util');var path=require(_0x5893('0x1'));var timeout=require(_0x5893('0x2'));var express=require(_0x5893('0x3'));var router=express[_0x5893('0x4')]();var fs_extra=require(_0x5893('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5893('0x6'));var config=require(_0x5893('0x7'));var controller=require(_0x5893('0x8'));router['get']('/',auth[_0x5893('0x9')](),controller[_0x5893('0xa')]);router[_0x5893('0xb')](_0x5893('0xc'),auth[_0x5893('0x9')](),controller['show']);router[_0x5893('0xb')](_0x5893('0xd'),auth[_0x5893('0x9')](),controller[_0x5893('0xe')]);router[_0x5893('0xb')]('/:id/fields',auth[_0x5893('0x9')](),controller[_0x5893('0xf')]);router[_0x5893('0x10')]('/',auth[_0x5893('0x9')](),controller['create']);router['post'](_0x5893('0xd'),auth[_0x5893('0x9')](),controller[_0x5893('0x11')]);router['put'](_0x5893('0xc'),auth[_0x5893('0x9')](),controller[_0x5893('0x12')]);router[_0x5893('0x13')](_0x5893('0xc'),auth[_0x5893('0x9')](),controller[_0x5893('0x14')]);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 657a8b3..512eaea 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 _0xdb94=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb94,0xe5));var _0x4db9=function(_0x137167,_0x201304){_0x137167=_0x137167-0x0;var _0x14c105=_0xdb94[_0x137167];return _0x14c105;};'use strict';var Sequelize=require('sequelize');module[_0x4db9('0x0')]={'name':{'type':Sequelize[_0x4db9('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4db9('0x1')]},'remoteUri':{'type':Sequelize[_0x4db9('0x1')]},'tenantId':{'type':Sequelize[_0x4db9('0x1')]},'clientId':{'type':Sequelize[_0x4db9('0x1')]},'clientSecret':{'type':Sequelize[_0x4db9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4db9('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4074=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4986d1,_0x124dee){var _0x1bca82=function(_0x5a1ff4){while(--_0x5a1ff4){_0x4986d1['push'](_0x4986d1['shift']());}};_0x1bca82(++_0x124dee);}(_0x4074,0xf0));var _0x4407=function(_0x5090d5,_0x54ab00){_0x5090d5=_0x5090d5-0x0;var _0x3496f3=_0x4074[_0x5090d5];return _0x3496f3;};'use strict';var Sequelize=require(_0x4407('0x0'));module[_0x4407('0x1')]={'name':{'type':Sequelize[_0x4407('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4407('0x2')]},'remoteUri':{'type':Sequelize[_0x4407('0x2')]},'tenantId':{'type':Sequelize[_0x4407('0x2')]},'clientId':{'type':Sequelize[_0x4407('0x2')]},'clientSecret':{'type':Sequelize[_0x4407('0x2')]},'serverUrl':{'type':Sequelize[_0x4407('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4407('0x2')]},'modernAuthentication':{'type':Sequelize[_0x4407('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c9b6608..cba2e88 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 _0xcb67=['msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','remoteUri','https://login.microsoftonline.com/','tenantId','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','all','isNil','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','length','statusCode','status','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','count','limit','set','Content-Range','destroy','then','sendStatus','error','stack','name','send','index','map','Dynamics365Account','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','body','update','find','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname'];(function(_0xf1f37e,_0x159a20){var _0x2e3a6d=function(_0x4163cd){while(--_0x4163cd){_0xf1f37e['push'](_0xf1f37e['shift']());}};_0x2e3a6d(++_0x159a20);}(_0xcb67,0x104));var _0x7cb6=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xcb67[_0x56e4e7];return _0x383618;};'use strict';var rp=require('request-promise');var util=require('util');var _=require('lodash');var qs=require(_0x7cb6('0x0'));var logger=require(_0x7cb6('0x1'))(_0x7cb6('0x2'));var db=require(_0x7cb6('0x3'))['db'];var integrations=require(_0x7cb6('0x4'));function respondWithResult(_0xdcc2fc,_0x389202){_0x389202=_0x389202||0xc8;return function(_0x11c7f5){if(_0x11c7f5){return _0xdcc2fc['status'](_0x389202)[_0x7cb6('0x5')](_0x11c7f5);}};}function respondWithFilteredResult(_0x4b9f51,_0xbf489f){return function(_0x3c5fcc){if(_0x3c5fcc){var _0x3d6b69=typeof _0xbf489f[_0x7cb6('0x6')]===_0x7cb6('0x7')&&typeof _0xbf489f['limit']===_0x7cb6('0x7');var _0x54f222=_0x3c5fcc[_0x7cb6('0x8')];var _0x3760d7=_0x3d6b69?0x0:_0xbf489f[_0x7cb6('0x6')];var _0x5e903e=_0x3d6b69?_0x3c5fcc['count']:_0xbf489f['offset']+_0xbf489f[_0x7cb6('0x9')];var _0xe52fca;if(_0x5e903e>=_0x54f222){_0x5e903e=_0x54f222;_0xe52fca=0xc8;}else{_0xe52fca=0xce;}_0x4b9f51['status'](_0xe52fca);return _0x4b9f51[_0x7cb6('0xa')](_0x7cb6('0xb'),_0x3760d7+'-'+_0x5e903e+'/'+_0x54f222)[_0x7cb6('0x5')](_0x3c5fcc);}return null;};}function saveUpdates(_0x250054){return function(_0x1103c6){if(_0x1103c6){return _0x1103c6['update'](_0x250054)['then'](function(_0x25eaf0){return _0x25eaf0;});}return null;};}function removeEntity(_0x45c11d){return function(_0x1fccde){if(_0x1fccde){return _0x1fccde[_0x7cb6('0xc')]()[_0x7cb6('0xd')](function(){_0x45c11d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ea7){return function(_0x75a3ad){if(!_0x75a3ad){_0x55ea7[_0x7cb6('0xe')](0x194);}return _0x75a3ad;};}function handleError(_0x5d6588,_0x11854e){_0x11854e=_0x11854e||0x1f4;return function(_0x14b5c4){logger[_0x7cb6('0xf')](_0x14b5c4[_0x7cb6('0x10')]);if(_0x14b5c4[_0x7cb6('0x11')]){delete _0x14b5c4['name'];}_0x5d6588['status'](_0x11854e)[_0x7cb6('0x12')](_0x14b5c4);};}exports[_0x7cb6('0x13')]=function(_0x309f1f,_0x11cbd3){var _0xefba5={},_0x5d133b={},_0x79e822={'count':0x0,'rows':[]};var _0x492ed7=_[_0x7cb6('0x14')](db[_0x7cb6('0x15')]['rawAttributes'],function(_0x8eb4b6){return{'name':_0x8eb4b6['fieldName'],'type':_0x8eb4b6[_0x7cb6('0x16')][_0x7cb6('0x17')]};});_0x5d133b[_0x7cb6('0x18')]=_['map'](_0x492ed7,_0x7cb6('0x11'));_0x5d133b[_0x7cb6('0x19')]=_[_0x7cb6('0x1a')](_0x309f1f['query']);_0x5d133b['filters']=_['intersection'](_0x5d133b[_0x7cb6('0x18')],_0x5d133b[_0x7cb6('0x19')]);_0xefba5[_0x7cb6('0x1b')]=_[_0x7cb6('0x1c')](_0x5d133b[_0x7cb6('0x18')],qs[_0x7cb6('0x1d')](_0x309f1f[_0x7cb6('0x19')][_0x7cb6('0x1d')]));_0xefba5['attributes']=_0xefba5[_0x7cb6('0x1b')]['length']?_0xefba5['attributes']:_0x5d133b[_0x7cb6('0x18')];if(!_0x309f1f[_0x7cb6('0x19')][_0x7cb6('0x1e')](_0x7cb6('0x1f'))){_0xefba5['limit']=qs[_0x7cb6('0x9')](_0x309f1f[_0x7cb6('0x19')]['limit']);_0xefba5[_0x7cb6('0x6')]=qs[_0x7cb6('0x6')](_0x309f1f[_0x7cb6('0x19')][_0x7cb6('0x6')]);}_0xefba5[_0x7cb6('0x20')]=qs[_0x7cb6('0x21')](_0x309f1f[_0x7cb6('0x19')][_0x7cb6('0x21')]);_0xefba5[_0x7cb6('0x22')]=qs['filters'](_['pick'](_0x309f1f[_0x7cb6('0x19')],_0x5d133b[_0x7cb6('0x23')]),_0x492ed7);if(_0x309f1f['query'][_0x7cb6('0x24')]){_0xefba5[_0x7cb6('0x22')]=_[_0x7cb6('0x25')](_0xefba5[_0x7cb6('0x22')],{'$or':_['map'](_0x492ed7,function(_0x4d59e2){if(_0x4d59e2[_0x7cb6('0x16')]!=='VIRTUAL'){var _0x375734={};_0x375734[_0x4d59e2[_0x7cb6('0x11')]]={'$like':'%'+_0x309f1f[_0x7cb6('0x19')][_0x7cb6('0x24')]+'%'};return _0x375734;}})});}_0xefba5=_[_0x7cb6('0x25')]({},_0xefba5,_0x309f1f[_0x7cb6('0x26')]);var _0x278a37={'where':_0xefba5[_0x7cb6('0x22')]};return db[_0x7cb6('0x15')][_0x7cb6('0x8')](_0x278a37)[_0x7cb6('0xd')](function(_0x15c0f5){_0x79e822['count']=_0x15c0f5;if(_0x309f1f['query'][_0x7cb6('0x27')]){_0xefba5[_0x7cb6('0x28')]=[{'all':!![]}];}return db[_0x7cb6('0x15')][_0x7cb6('0x29')](_0xefba5);})[_0x7cb6('0xd')](function(_0x48875f){_0x79e822['rows']=_0x48875f;return _0x79e822;})[_0x7cb6('0xd')](respondWithFilteredResult(_0x11cbd3,_0xefba5))[_0x7cb6('0x2a')](handleError(_0x11cbd3,null));};exports[_0x7cb6('0x2b')]=function(_0x7173ea,_0x50b798){var _0x8abf1f={'raw':![],'where':{'id':_0x7173ea[_0x7cb6('0x2c')]['id']}},_0x2f5fb4={};_0x2f5fb4['model']=_[_0x7cb6('0x1a')](db[_0x7cb6('0x15')][_0x7cb6('0x2d')]);_0x2f5fb4[_0x7cb6('0x19')]=_[_0x7cb6('0x1a')](_0x7173ea[_0x7cb6('0x19')]);_0x2f5fb4[_0x7cb6('0x23')]=_[_0x7cb6('0x1c')](_0x2f5fb4['model'],_0x2f5fb4[_0x7cb6('0x19')]);_0x8abf1f[_0x7cb6('0x1b')]=_[_0x7cb6('0x1c')](_0x2f5fb4['model'],qs[_0x7cb6('0x1d')](_0x7173ea[_0x7cb6('0x19')][_0x7cb6('0x1d')]));_0x8abf1f[_0x7cb6('0x1b')]=_0x8abf1f['attributes']['length']?_0x8abf1f[_0x7cb6('0x1b')]:_0x2f5fb4['model'];if(_0x7173ea[_0x7cb6('0x19')]['includeAll']){_0x8abf1f[_0x7cb6('0x28')]=[{'all':!![]}];}_0x8abf1f=_[_0x7cb6('0x25')]({},_0x8abf1f,_0x7173ea[_0x7cb6('0x26')]);return db['Dynamics365Account']['find'](_0x8abf1f)[_0x7cb6('0xd')](handleEntityNotFound(_0x50b798,null))['then'](respondWithResult(_0x50b798,null))[_0x7cb6('0x2a')](handleError(_0x50b798,null));};exports['create']=function(_0x20e4da,_0x32df41){return db[_0x7cb6('0x15')]['create'](_0x20e4da[_0x7cb6('0x2e')],{})[_0x7cb6('0xd')](respondWithResult(_0x32df41,0xc9))[_0x7cb6('0x2a')](handleError(_0x32df41,null));};exports[_0x7cb6('0x2f')]=function(_0x548e52,_0x577967){if(_0x548e52[_0x7cb6('0x2e')]['id']){delete _0x548e52[_0x7cb6('0x2e')]['id'];}return db['Dynamics365Account'][_0x7cb6('0x30')]({'where':{'id':_0x548e52[_0x7cb6('0x2c')]['id']}})['then'](handleEntityNotFound(_0x577967,null))[_0x7cb6('0xd')](saveUpdates(_0x548e52[_0x7cb6('0x2e')],null))['then'](respondWithResult(_0x577967,null))[_0x7cb6('0x2a')](handleError(_0x577967,null));};exports[_0x7cb6('0xc')]=function(_0x1312d3,_0x444913){return db[_0x7cb6('0x15')][_0x7cb6('0x30')]({'where':{'id':_0x1312d3[_0x7cb6('0x2c')]['id']}})[_0x7cb6('0xd')](handleEntityNotFound(_0x444913,null))['then'](removeEntity(_0x444913,null))[_0x7cb6('0x2a')](handleError(_0x444913,null));};exports['getConfigurations']=function(_0x16b2f6,_0x1fcbe7){var _0x27f843={};var _0x2ddbdf={};var _0x51d857;var _0x142ff7;return db[_0x7cb6('0x15')][_0x7cb6('0x31')]({'where':{'id':_0x16b2f6[_0x7cb6('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1fcbe7,null))[_0x7cb6('0xd')](function(_0x21a881){if(_0x21a881){_0x51d857=_0x21a881;_0x2ddbdf['model']=_[_0x7cb6('0x1a')](db[_0x7cb6('0x32')][_0x7cb6('0x2d')]);_0x2ddbdf[_0x7cb6('0x19')]=_[_0x7cb6('0x1a')](_0x16b2f6[_0x7cb6('0x19')]);_0x2ddbdf[_0x7cb6('0x23')]=_[_0x7cb6('0x1c')](_0x2ddbdf[_0x7cb6('0x18')],_0x2ddbdf['query']);_0x27f843[_0x7cb6('0x1b')]=_[_0x7cb6('0x1c')](_0x2ddbdf[_0x7cb6('0x18')],qs[_0x7cb6('0x1d')](_0x16b2f6[_0x7cb6('0x19')][_0x7cb6('0x1d')]));_0x27f843['attributes']=_0x27f843['attributes']['length']?_0x27f843[_0x7cb6('0x1b')]:_0x2ddbdf[_0x7cb6('0x18')];_0x27f843[_0x7cb6('0x20')]=qs[_0x7cb6('0x21')](_0x16b2f6['query'][_0x7cb6('0x21')]);_0x27f843[_0x7cb6('0x22')]=qs[_0x7cb6('0x23')](_['pick'](_0x16b2f6[_0x7cb6('0x19')],_0x2ddbdf[_0x7cb6('0x23')]));if(_0x16b2f6[_0x7cb6('0x19')][_0x7cb6('0x24')]){_0x27f843[_0x7cb6('0x22')]=_[_0x7cb6('0x25')](_0x27f843['where'],{'$or':_[_0x7cb6('0x14')](_0x27f843[_0x7cb6('0x1b')],function(_0x105e6a){var _0x18e0d4={};_0x18e0d4[_0x105e6a]={'$like':'%'+_0x16b2f6['query'][_0x7cb6('0x24')]+'%'};return _0x18e0d4;})});}_0x27f843=_['merge']({},_0x27f843,_0x16b2f6[_0x7cb6('0x26')]);return _0x51d857[_0x7cb6('0x33')](_0x27f843);}})[_0x7cb6('0xd')](function(_0x4e22cf){if(_0x4e22cf){_0x142ff7=_0x4e22cf['length'];if(!_0x16b2f6[_0x7cb6('0x19')][_0x7cb6('0x1e')](_0x7cb6('0x1f'))){_0x27f843[_0x7cb6('0x9')]=qs[_0x7cb6('0x9')](_0x16b2f6[_0x7cb6('0x19')][_0x7cb6('0x9')]);_0x27f843[_0x7cb6('0x6')]=qs[_0x7cb6('0x6')](_0x16b2f6['query']['offset']);}return _0x51d857[_0x7cb6('0x33')](_0x27f843);}})[_0x7cb6('0xd')](function(_0x31da03){if(_0x31da03){return _0x31da03?{'count':_0x142ff7,'rows':_0x31da03}:null;}})[_0x7cb6('0xd')](respondWithResult(_0x1fcbe7,null))['catch'](handleError(_0x1fcbe7,null));};exports[_0x7cb6('0x34')]=function(_0x302d25,_0x3c5426){if(_0x302d25[_0x7cb6('0x2e')]['id']){delete _0x302d25['body']['id'];}return db[_0x7cb6('0x15')][_0x7cb6('0x31')]({'where':{'id':_0x302d25['params']['id']}})[_0x7cb6('0xd')](handleEntityNotFound(_0x3c5426,null))[_0x7cb6('0xd')](function(_0x1f8a39){if(_0x1f8a39){_0x302d25[_0x7cb6('0x2e')][_0x7cb6('0x35')]=_0x1f8a39['id'];_0x302d25[_0x7cb6('0x2e')][_0x7cb6('0x36')]=integrations[_0x7cb6('0x37')](_0x302d25['body'][_0x7cb6('0x38')],_0x302d25['body'][_0x7cb6('0x16')]);_0x302d25[_0x7cb6('0x2e')][_0x7cb6('0x39')]=integrations[_0x7cb6('0x3a')](_0x302d25['body']['channel'],_0x302d25[_0x7cb6('0x2e')]['type']);return db[_0x7cb6('0x32')][_0x7cb6('0x3b')](_0x302d25[_0x7cb6('0x2e')],{'include':[{'model':db[_0x7cb6('0x3c')],'as':_0x7cb6('0x36')},{'model':db[_0x7cb6('0x3c')],'as':'Descriptions'}]});}return null;})[_0x7cb6('0xd')](respondWithResult(_0x3c5426,null))[_0x7cb6('0x2a')](handleError(_0x3c5426,null));};function sanitizeRemoteUri(_0x2864bd){var _0x59a88a=_0x2864bd['slice'](-0x1);if(_0x59a88a==='/')return _0x2864bd[_0x7cb6('0x3d')](0x0,_0x2864bd[_0x7cb6('0x3e')](_0x59a88a));return _0x2864bd;}function getWebApiUrl(_0x354b74){return util[_0x7cb6('0x3f')](_0x7cb6('0x40'),_0x354b74);}exports[_0x7cb6('0x41')]=function(_0x5ef496,_0x21b179){var _0x1776df=_0x5ef496['query'][_0x7cb6('0x42')];var _0x23cf47=_0x1776df==='incident'?_0x7cb6('0x43'):_0x7cb6('0x44');var _0x339e97='';var _0x2df47b='';var _0x76b62='';var _0x3d0457='';var _0x442c43='';var _0x21368f='';var _0x3bc762='';var _0x523b63='';var _0x4e5a50=[_0x7cb6('0x45'),_0x7cb6('0x46'),'customerid',_0x7cb6('0x47'),_0x7cb6('0x48'),_0x7cb6('0x49'),'phonenumber',_0x7cb6('0x4a'),_0x7cb6('0x4b'),'phonecall_activity_parties'];var _0x36201d=[_0x7cb6('0x4c'),'accountidyominame',_0x7cb6('0x4d'),_0x7cb6('0x4e'),_0x7cb6('0x4f'),'contactidyominame','contractdetailidname','contractidname',_0x7cb6('0x50'),_0x7cb6('0x51'),_0x7cb6('0x52'),_0x7cb6('0x53'),_0x7cb6('0x54'),_0x7cb6('0x55'),_0x7cb6('0x56'),_0x7cb6('0x57'),_0x7cb6('0x58'),'customeridyominame',_0x7cb6('0x59'),_0x7cb6('0x5a'),_0x7cb6('0x5b'),_0x7cb6('0x5c'),'escalatedon','exchangerate',_0x7cb6('0x5d'),_0x7cb6('0x5e'),_0x7cb6('0x5f'),'influencescore','kbarticleidname',_0x7cb6('0x60'),_0x7cb6('0x61'),_0x7cb6('0x62'),_0x7cb6('0x63'),'modifiedbyname',_0x7cb6('0x64'),'modifiedon',_0x7cb6('0x65'),'modifiedonbehalfbyyominame',_0x7cb6('0x66'),_0x7cb6('0x67'),_0x7cb6('0x68'),'onholdtime','overriddencreatedon',_0x7cb6('0x69'),'owneridtype',_0x7cb6('0x6a'),'parentcaseidname',_0x7cb6('0x6b'),_0x7cb6('0x6c'),'prioritycodename',_0x7cb6('0x6d'),_0x7cb6('0x6e'),_0x7cb6('0x6f'),_0x7cb6('0x70'),_0x7cb6('0x71'),_0x7cb6('0x72'),_0x7cb6('0x73'),_0x7cb6('0x74'),_0x7cb6('0x75'),_0x7cb6('0x76'),'socialprofileidname','statecode',_0x7cb6('0x77'),_0x7cb6('0x78'),'ticketnumber',_0x7cb6('0x79'),_0x7cb6('0x7a'),_0x7cb6('0x7b'),_0x7cb6('0x7c'),_0x7cb6('0x7d')];var _0x511227=_0x4e5a50[_0x7cb6('0x7e')](_0x36201d);return db[_0x7cb6('0x15')][_0x7cb6('0x31')]({'where':{'id':_0x5ef496[_0x7cb6('0x2c')]['id']},'attributes':['id','username',_0x7cb6('0x7f'),'remoteUri','tenantId',_0x7cb6('0x80'),_0x7cb6('0x81'),_0x7cb6('0x82')],'include':[{'model':db[_0x7cb6('0x83')],'as':_0x7cb6('0x83'),'attributes':['id',_0x7cb6('0x84'),'data7']}]})[_0x7cb6('0xd')](handleEntityNotFound(_0x21b179,null))['then'](function(_0x2d5a9d){if(_0x2d5a9d){if(_0x2d5a9d[_0x7cb6('0x82')]){_0x2d5a9d[_0x7cb6('0x85')]=_0x2d5a9d[_0x7cb6('0x83')][_0x7cb6('0x84')];_0x523b63=sanitizeRemoteUri(_0x2d5a9d['CloudProvider'][_0x7cb6('0x86')]);_0x3bc762=getWebApiUrl(_0x523b63);return _0x2d5a9d;}_0x523b63=sanitizeRemoteUri(_0x2d5a9d[_0x7cb6('0x87')]);_0x3bc762=getWebApiUrl(_0x523b63);var _0xd373e7={'method':'POST','uri':_0x7cb6('0x88')+_0x2d5a9d[_0x7cb6('0x89')]+_0x7cb6('0x8a'),'form':{'client_id':_0x2d5a9d[_0x7cb6('0x80')],'resource':_0x523b63,'username':_0x2d5a9d[_0x7cb6('0x8b')],'password':_0x2d5a9d[_0x7cb6('0x7f')],'grant_type':_0x7cb6('0x7f'),'client_secret':_0x2d5a9d[_0x7cb6('0x81')]},'json':!![]};return rp(_0xd373e7);}})['then'](function(_0x4afef9){_0x21368f=_0x4afef9[_0x7cb6('0x85')];var _0x26f227={'method':_0x7cb6('0x8c'),'uri':encodeURI(_0x3bc762+_0x7cb6('0x8d')+_0x23cf47+'\x27'),'headers':{'Authorization':_0x7cb6('0x8e')+_0x21368f,'If-None-Match':null,'OData-Version':_0x7cb6('0x8f')},'json':!![]};return rp(_0x26f227);})[_0x7cb6('0xd')](function(_0x1b8fd6){var _0x494bc8=_0x1b8fd6[_0x7cb6('0x90')][0x0];var _0x3a0ebb=_0x494bc8[_0x7cb6('0x91')];var _0x21f807={'method':_0x7cb6('0x8c'),'uri':_0x3bc762+_0x7cb6('0x92')+_0x3a0ebb+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x7cb6('0x8e')+_0x21368f,'If-None-Match':null,'OData-Version':_0x7cb6('0x8f')},'json':!![]};return rp(_0x21f807);})['then'](function(_0x1a151d){_0x339e97=_0x1a151d;_0x2df47b=_0x339e97[_0x7cb6('0x93')];_0x2df47b=_[_0x7cb6('0x94')](_0x2df47b,function(_0x413fee){return!_0x511227[_0x7cb6('0x95')](_0x413fee[_0x7cb6('0x96')]);});var _0x4d536c=[];var _0x242c4f=[];_0x2df47b[_0x7cb6('0x97')](function(_0x431ccd){if(_0x431ccd[_0x7cb6('0x98')]){var _0x2f3bbc=_0x431ccd[_0x7cb6('0x98')]['substring'](_0x431ccd[_0x7cb6('0x98')][_0x7cb6('0x3e')]('.')+0x1);if(_0x2f3bbc==='PicklistAttributeMetadata'){_0x4d536c['push'](getSelectList(_0x3bc762,_0x1776df,_0x242c4f,_0x339e97[_0x7cb6('0x91')],_0x431ccd[_0x7cb6('0x91')],_0x21368f));}}});return Promise[_0x7cb6('0x99')](_0x4d536c);})[_0x7cb6('0xd')](function(_0x4b2c40){_0x76b62=_0x4b2c40[0x0];var _0x30e366=[];var _0x686819=[];_0x2df47b['forEach'](function(_0x158aa6){if(!_[_0x7cb6('0x9a')](_0x158aa6[_0x7cb6('0x98')])){var _0x4163b3=_0x158aa6[_0x7cb6('0x98')][_0x7cb6('0x3d')](_0x158aa6[_0x7cb6('0x98')][_0x7cb6('0x3e')]('.')+0x1);if(_0x4163b3==='BooleanAttributeMetadata'){_0x30e366[_0x7cb6('0x9b')](getBooleanList(_0x3bc762,_0x1776df,_0x686819,_0x339e97[_0x7cb6('0x91')],_0x158aa6[_0x7cb6('0x91')],_0x21368f));}}});return Promise['all'](_0x30e366);})[_0x7cb6('0xd')](function(_0xc2ef08){_0x3d0457=_0xc2ef08[0x0];var _0x240d16=[];var _0x22959f=[];_0x2df47b[_0x7cb6('0x97')](function(_0x2bf607){if(_0x2bf607['@odata.type']){var _0x183a6e=_0x2bf607['@odata.type']['substring'](_0x2bf607['@odata.type']['lastIndexOf']('.')+0x1);if(_0x183a6e==='StringAttributeMetadata'||_0x183a6e===_0x7cb6('0x9c')||_0x183a6e===_0x7cb6('0x9d')||_0x183a6e===_0x7cb6('0x9e')||_0x183a6e===_0x7cb6('0x9f')||_0x183a6e===_0x7cb6('0xa0')||_0x183a6e===_0x7cb6('0xa1')||_0x183a6e==='EntityNameAttributeMetadata'||_0x183a6e==='StateAttributeMetadata'||_0x183a6e==='DecimalAttributeMetadata'){_0x240d16[_0x7cb6('0x9b')](getInputList(_0x3bc762,_0x1776df,_0x183a6e,_0x22959f,_0x339e97['MetadataId'],_0x2bf607['MetadataId'],_0x21368f));}}});return Promise['all'](_0x240d16);})[_0x7cb6('0xd')](function(_0x338e55){_0x442c43=_0x338e55[0x0];var _0x2a89da=_0x76b62[_0x7cb6('0x7e')](_0x3d0457)[_0x7cb6('0x7e')](_0x442c43);var _0x2b8f4e={'count':_0x2a89da[_0x7cb6('0xa2')],'rows':_0x2a89da};return _0x2b8f4e;})[_0x7cb6('0xd')](respondWithResult(_0x21b179,null))[_0x7cb6('0x2a')](function(_0x2808f8){var _0xfde867=_0x5ef496[_0x7cb6('0x19')]['test']?0x1f4:_0x2808f8[_0x7cb6('0xa3')]||0x1f4;logger[_0x7cb6('0xf')](_0x2808f8[_0x7cb6('0x10')]);delete _0x2808f8[_0x7cb6('0x11')];if(_0xfde867===0x191){_0xfde867=0x190;}_0x21b179[_0x7cb6('0xa4')](_0xfde867)['send'](_0x5ef496[_0x7cb6('0x19')][_0x7cb6('0xa5')]?{'message':_0x7cb6('0xa6'),'statusCode':_0x2808f8[_0x7cb6('0xa3')]}:_0x2808f8);});};function getSelectList(_0xea0290,_0x65895,_0x3dc978,_0x306bbd,_0x1af2e0,_0x4e4041){var _0x23cfc1={'method':_0x7cb6('0x8c'),'uri':_0xea0290+_0x7cb6('0x92')+_0x306bbd+_0x7cb6('0xa7')+_0x1af2e0+_0x7cb6('0xa8')+_0x7cb6('0xa9'),'headers':{'Authorization':'Bearer\x20'+_0x4e4041,'If-None-Match':null,'OData-Version':_0x7cb6('0x8f')},'json':!![]};return rp(_0x23cfc1)[_0x7cb6('0xd')](function(_0x5f4ef5){var _0x130bd2=[];var _0x1ad737=_0x5f4ef5['OptionSet'][_0x7cb6('0xaa')];_0x1ad737[_0x7cb6('0x97')](function(_0x3f6542){_0x130bd2[_0x7cb6('0x9b')]({'name':_0x3f6542[_0x7cb6('0xab')][_0x7cb6('0xac')][_0x7cb6('0xab')],'value':String(_0x3f6542[_0x7cb6('0xad')])});});var _0x1587ea={'id':_0x65895+'_'+_0x5f4ef5[_0x7cb6('0x96')],'name':_0x5f4ef5[_0x7cb6('0xae')][_0x7cb6('0xac')][_0x7cb6('0xab')],'custom':![],'options':_0x130bd2};_0x3dc978[_0x7cb6('0x9b')](_0x1587ea);return _0x3dc978;});}function getBooleanList(_0x563b23,_0x37ce80,_0x29bfa9,_0x59010c,_0x4ba409,_0x12b1db){var _0x1902db={'method':_0x7cb6('0x8c'),'uri':_0x563b23+_0x7cb6('0x92')+_0x59010c+_0x7cb6('0xa7')+_0x4ba409+_0x7cb6('0xaf'),'headers':{'Authorization':_0x7cb6('0x8e')+_0x12b1db,'If-None-Match':null,'OData-Version':_0x7cb6('0x8f')},'json':!![]};return rp(_0x1902db)[_0x7cb6('0xd')](function(_0x3bcbad){var _0xb31040=[];_0xb31040[_0x7cb6('0x9b')]({'name':_0x3bcbad[_0x7cb6('0xb0')][_0x7cb6('0xb1')][_0x7cb6('0xab')][_0x7cb6('0xac')][_0x7cb6('0xab')],'value':_0x7cb6('0xb2')},{'name':_0x3bcbad['OptionSet'][_0x7cb6('0xb3')][_0x7cb6('0xab')]['UserLocalizedLabel'][_0x7cb6('0xab')],'value':'false'});var _0x437c76={'id':_0x37ce80+'_'+_0x3bcbad['LogicalName'],'name':_0x3bcbad[_0x7cb6('0xae')]['UserLocalizedLabel'][_0x7cb6('0xab')],'custom':![],'options':_0xb31040};_0x29bfa9['push'](_0x437c76);return _0x29bfa9;});}function getInputList(_0x2d3176,_0x34fb6c,_0x3cc218,_0x46444f,_0x4a73f5,_0x3b6f86,_0x5bba12){var _0x2bcf73={'method':_0x7cb6('0x8c'),'uri':_0x2d3176+_0x7cb6('0x92')+_0x4a73f5+_0x7cb6('0xa7')+_0x3b6f86+_0x7cb6('0xb4')+_0x3cc218+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x5bba12,'If-None-Match':null,'OData-Version':_0x7cb6('0x8f')},'json':!![]};return rp(_0x2bcf73)['then'](function(_0x1603f8){var _0x283303={'id':_0x34fb6c+'_'+_0x1603f8[_0x7cb6('0x96')],'name':_0x1603f8[_0x7cb6('0xae')][_0x7cb6('0xac')]?_0x1603f8[_0x7cb6('0xae')][_0x7cb6('0xac')][_0x7cb6('0xab')]:_0x1603f8[_0x7cb6('0x96')],'custom':![],'options':[]};_0x46444f['push'](_0x283303);return _0x46444f;});} \ No newline at end of file +var _0x9091=['body','params','getConfigurations','findOne','sort','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','create','Dynamics365Field','slice','substring','lastIndexOf','format','ticketType','Incident','PhoneCall','title','ownerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','true',')/Microsoft.Dynamics.CRM.','DisplayName','request-promise','lodash','../../config/logger','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','status','Content-Range','update','then','destroy','end','sendStatus','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','find'];(function(_0x4e311a,_0x52c44c){var _0x5eb6bc=function(_0xd89418){while(--_0xd89418){_0x4e311a['push'](_0x4e311a['shift']());}};_0x5eb6bc(++_0x52c44c);}(_0x9091,0x1ed));var _0x1909=function(_0x379244,_0x15b47d){_0x379244=_0x379244-0x0;var _0x4fee8c=_0x9091[_0x379244];return _0x4fee8c;};'use strict';var rp=require(_0x1909('0x0'));var util=require('util');var _=require(_0x1909('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x1909('0x2'))('api');var db=require(_0x1909('0x3'))['db'];var integrations=require(_0x1909('0x4'));function respondWithResult(_0x44f6f9,_0x522e9a){_0x522e9a=_0x522e9a||0xc8;return function(_0x5a183e){if(_0x5a183e){return _0x44f6f9['status'](_0x522e9a)[_0x1909('0x5')](_0x5a183e);}};}function respondWithFilteredResult(_0x53bf6b,_0x3dd05e){return function(_0xdcee18){if(_0xdcee18){var _0x20a7fc=typeof _0x3dd05e[_0x1909('0x6')]===_0x1909('0x7')&&typeof _0x3dd05e[_0x1909('0x8')]==='undefined';var _0x2936ee=_0xdcee18['count'];var _0x49a143=_0x20a7fc?0x0:_0x3dd05e[_0x1909('0x6')];var _0x3129fb=_0x20a7fc?_0xdcee18['count']:_0x3dd05e[_0x1909('0x6')]+_0x3dd05e[_0x1909('0x8')];var _0x58708a;if(_0x3129fb>=_0x2936ee){_0x3129fb=_0x2936ee;_0x58708a=0xc8;}else{_0x58708a=0xce;}_0x53bf6b[_0x1909('0x9')](_0x58708a);return _0x53bf6b['set'](_0x1909('0xa'),_0x49a143+'-'+_0x3129fb+'/'+_0x2936ee)[_0x1909('0x5')](_0xdcee18);}return null;};}function saveUpdates(_0x52a882){return function(_0x5e6a49){if(_0x5e6a49){return _0x5e6a49[_0x1909('0xb')](_0x52a882)[_0x1909('0xc')](function(_0x219082){return _0x219082;});}return null;};}function removeEntity(_0x4b1572){return function(_0x35222e){if(_0x35222e){return _0x35222e[_0x1909('0xd')]()[_0x1909('0xc')](function(){_0x4b1572[_0x1909('0x9')](0xcc)[_0x1909('0xe')]();});}};}function handleEntityNotFound(_0x5c828a){return function(_0x3d3e89){if(!_0x3d3e89){_0x5c828a[_0x1909('0xf')](0x194);}return _0x3d3e89;};}function handleError(_0x1aca4d,_0x1c4df7){_0x1c4df7=_0x1c4df7||0x1f4;return function(_0x1e904e){logger['error'](_0x1e904e[_0x1909('0x10')]);if(_0x1e904e[_0x1909('0x11')]){delete _0x1e904e['name'];}_0x1aca4d[_0x1909('0x9')](_0x1c4df7)['send'](_0x1e904e);};}exports[_0x1909('0x12')]=function(_0x3c4304,_0x2b5ee1){var _0xb39d7a={},_0x412fb4={},_0x36f3de={'count':0x0,'rows':[]};var _0x2f172f=_[_0x1909('0x13')](db[_0x1909('0x14')][_0x1909('0x15')],function(_0x500568){return{'name':_0x500568[_0x1909('0x16')],'type':_0x500568[_0x1909('0x17')][_0x1909('0x18')]};});_0x412fb4['model']=_[_0x1909('0x13')](_0x2f172f,_0x1909('0x11'));_0x412fb4[_0x1909('0x19')]=_[_0x1909('0x1a')](_0x3c4304[_0x1909('0x19')]);_0x412fb4[_0x1909('0x1b')]=_[_0x1909('0x1c')](_0x412fb4['model'],_0x412fb4[_0x1909('0x19')]);_0xb39d7a[_0x1909('0x1d')]=_[_0x1909('0x1c')](_0x412fb4['model'],qs['fields'](_0x3c4304[_0x1909('0x19')][_0x1909('0x1e')]));_0xb39d7a['attributes']=_0xb39d7a['attributes'][_0x1909('0x1f')]?_0xb39d7a[_0x1909('0x1d')]:_0x412fb4[_0x1909('0x20')];if(!_0x3c4304[_0x1909('0x19')][_0x1909('0x21')]('nolimit')){_0xb39d7a['limit']=qs[_0x1909('0x8')](_0x3c4304[_0x1909('0x19')][_0x1909('0x8')]);_0xb39d7a[_0x1909('0x6')]=qs[_0x1909('0x6')](_0x3c4304[_0x1909('0x19')][_0x1909('0x6')]);}_0xb39d7a['order']=qs['sort'](_0x3c4304[_0x1909('0x19')]['sort']);_0xb39d7a[_0x1909('0x22')]=qs[_0x1909('0x1b')](_[_0x1909('0x23')](_0x3c4304[_0x1909('0x19')],_0x412fb4[_0x1909('0x1b')]),_0x2f172f);if(_0x3c4304['query'][_0x1909('0x24')]){_0xb39d7a['where']=_[_0x1909('0x25')](_0xb39d7a[_0x1909('0x22')],{'$or':_[_0x1909('0x13')](_0x2f172f,function(_0x1fc1ec){if(_0x1fc1ec[_0x1909('0x17')]!==_0x1909('0x26')){var _0x21feb6={};_0x21feb6[_0x1fc1ec[_0x1909('0x11')]]={'$like':'%'+_0x3c4304[_0x1909('0x19')][_0x1909('0x24')]+'%'};return _0x21feb6;}})});}_0xb39d7a=_[_0x1909('0x25')]({},_0xb39d7a,_0x3c4304[_0x1909('0x27')]);var _0xafa686={'where':_0xb39d7a[_0x1909('0x22')]};return db[_0x1909('0x14')]['count'](_0xafa686)['then'](function(_0x3807c8){_0x36f3de[_0x1909('0x28')]=_0x3807c8;if(_0x3c4304[_0x1909('0x19')][_0x1909('0x29')]){_0xb39d7a[_0x1909('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0xb39d7a);})[_0x1909('0xc')](function(_0x1cc611){_0x36f3de[_0x1909('0x2b')]=_0x1cc611;return _0x36f3de;})[_0x1909('0xc')](respondWithFilteredResult(_0x2b5ee1,_0xb39d7a))[_0x1909('0x2c')](handleError(_0x2b5ee1,null));};exports[_0x1909('0x2d')]=function(_0xd96dc4,_0x4d3ac4){var _0xcad6d7={'raw':![],'where':{'id':_0xd96dc4['params']['id']}},_0x317495={};_0x317495[_0x1909('0x20')]=_[_0x1909('0x1a')](db[_0x1909('0x14')][_0x1909('0x15')]);_0x317495[_0x1909('0x19')]=_['keys'](_0xd96dc4['query']);_0x317495[_0x1909('0x1b')]=_['intersection'](_0x317495['model'],_0x317495[_0x1909('0x19')]);_0xcad6d7[_0x1909('0x1d')]=_[_0x1909('0x1c')](_0x317495[_0x1909('0x20')],qs[_0x1909('0x1e')](_0xd96dc4[_0x1909('0x19')][_0x1909('0x1e')]));_0xcad6d7[_0x1909('0x1d')]=_0xcad6d7[_0x1909('0x1d')][_0x1909('0x1f')]?_0xcad6d7[_0x1909('0x1d')]:_0x317495['model'];if(_0xd96dc4[_0x1909('0x19')][_0x1909('0x29')]){_0xcad6d7[_0x1909('0x2a')]=[{'all':!![]}];}_0xcad6d7=_[_0x1909('0x25')]({},_0xcad6d7,_0xd96dc4[_0x1909('0x27')]);return db[_0x1909('0x14')][_0x1909('0x2e')](_0xcad6d7)[_0x1909('0xc')](handleEntityNotFound(_0x4d3ac4,null))[_0x1909('0xc')](respondWithResult(_0x4d3ac4,null))[_0x1909('0x2c')](handleError(_0x4d3ac4,null));};exports['create']=function(_0x2776fa,_0x541592){return db['Dynamics365Account']['create'](_0x2776fa[_0x1909('0x2f')],{})['then'](respondWithResult(_0x541592,0xc9))[_0x1909('0x2c')](handleError(_0x541592,null));};exports['update']=function(_0x5282cd,_0x133152){if(_0x5282cd['body']['id']){delete _0x5282cd[_0x1909('0x2f')]['id'];}return db[_0x1909('0x14')][_0x1909('0x2e')]({'where':{'id':_0x5282cd[_0x1909('0x30')]['id']}})[_0x1909('0xc')](handleEntityNotFound(_0x133152,null))['then'](saveUpdates(_0x5282cd[_0x1909('0x2f')],null))[_0x1909('0xc')](respondWithResult(_0x133152,null))[_0x1909('0x2c')](handleError(_0x133152,null));};exports['destroy']=function(_0x4a834c,_0x182e6a){return db[_0x1909('0x14')]['find']({'where':{'id':_0x4a834c[_0x1909('0x30')]['id']}})[_0x1909('0xc')](handleEntityNotFound(_0x182e6a,null))[_0x1909('0xc')](removeEntity(_0x182e6a,null))[_0x1909('0x2c')](handleError(_0x182e6a,null));};exports[_0x1909('0x31')]=function(_0x2b4969,_0x43140d){var _0x453555={};var _0x4f68d6={};var _0x38fb64;var _0x914f56;return db[_0x1909('0x14')][_0x1909('0x32')]({'where':{'id':_0x2b4969[_0x1909('0x30')]['id']}})[_0x1909('0xc')](handleEntityNotFound(_0x43140d,null))[_0x1909('0xc')](function(_0x572ba4){if(_0x572ba4){_0x38fb64=_0x572ba4;_0x4f68d6[_0x1909('0x20')]=_['keys'](db['Dynamics365Configuration'][_0x1909('0x15')]);_0x4f68d6[_0x1909('0x19')]=_['keys'](_0x2b4969['query']);_0x4f68d6[_0x1909('0x1b')]=_['intersection'](_0x4f68d6['model'],_0x4f68d6[_0x1909('0x19')]);_0x453555['attributes']=_[_0x1909('0x1c')](_0x4f68d6[_0x1909('0x20')],qs['fields'](_0x2b4969['query'][_0x1909('0x1e')]));_0x453555[_0x1909('0x1d')]=_0x453555[_0x1909('0x1d')][_0x1909('0x1f')]?_0x453555[_0x1909('0x1d')]:_0x4f68d6[_0x1909('0x20')];_0x453555['order']=qs[_0x1909('0x33')](_0x2b4969['query'][_0x1909('0x33')]);_0x453555[_0x1909('0x22')]=qs[_0x1909('0x1b')](_['pick'](_0x2b4969['query'],_0x4f68d6[_0x1909('0x1b')]));if(_0x2b4969[_0x1909('0x19')]['filter']){_0x453555['where']=_[_0x1909('0x25')](_0x453555[_0x1909('0x22')],{'$or':_[_0x1909('0x13')](_0x453555['attributes'],function(_0x48339f){var _0x3bf4e6={};_0x3bf4e6[_0x48339f]={'$like':'%'+_0x2b4969[_0x1909('0x19')][_0x1909('0x24')]+'%'};return _0x3bf4e6;})});}_0x453555=_[_0x1909('0x25')]({},_0x453555,_0x2b4969[_0x1909('0x27')]);return _0x38fb64[_0x1909('0x31')](_0x453555);}})[_0x1909('0xc')](function(_0x437f6d){if(_0x437f6d){_0x914f56=_0x437f6d[_0x1909('0x1f')];if(!_0x2b4969[_0x1909('0x19')][_0x1909('0x21')](_0x1909('0x34'))){_0x453555[_0x1909('0x8')]=qs[_0x1909('0x8')](_0x2b4969[_0x1909('0x19')]['limit']);_0x453555[_0x1909('0x6')]=qs[_0x1909('0x6')](_0x2b4969[_0x1909('0x19')][_0x1909('0x6')]);}return _0x38fb64[_0x1909('0x31')](_0x453555);}})['then'](function(_0x3b259c){if(_0x3b259c){return _0x3b259c?{'count':_0x914f56,'rows':_0x3b259c}:null;}})[_0x1909('0xc')](respondWithResult(_0x43140d,null))[_0x1909('0x2c')](handleError(_0x43140d,null));};exports[_0x1909('0x35')]=function(_0x4e4608,_0x319877){if(_0x4e4608['body']['id']){delete _0x4e4608[_0x1909('0x2f')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x4e4608[_0x1909('0x30')]['id']}})[_0x1909('0xc')](handleEntityNotFound(_0x319877,null))['then'](function(_0x2f43c5){if(_0x2f43c5){_0x4e4608[_0x1909('0x2f')][_0x1909('0x36')]=_0x2f43c5['id'];_0x4e4608[_0x1909('0x2f')][_0x1909('0x37')]=integrations['getSubjects'](_0x4e4608[_0x1909('0x2f')][_0x1909('0x38')],_0x4e4608[_0x1909('0x2f')][_0x1909('0x17')]);_0x4e4608[_0x1909('0x2f')][_0x1909('0x39')]=integrations[_0x1909('0x3a')](_0x4e4608[_0x1909('0x2f')][_0x1909('0x38')],_0x4e4608['body']['type']);return db[_0x1909('0x3b')][_0x1909('0x3c')](_0x4e4608[_0x1909('0x2f')],{'include':[{'model':db[_0x1909('0x3d')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x1909('0x39')}]});}return null;})[_0x1909('0xc')](respondWithResult(_0x319877,null))[_0x1909('0x2c')](handleError(_0x319877,null));};function sanitizeRemoteUri(_0x1d24c3){var _0x2a0f01=_0x1d24c3[_0x1909('0x3e')](-0x1);if(_0x2a0f01==='/')return _0x1d24c3[_0x1909('0x3f')](0x0,_0x1d24c3[_0x1909('0x40')](_0x2a0f01));return _0x1d24c3;}function getWebApiUrl(_0xa05b7b){return util[_0x1909('0x41')]('%s/api/data/v9.0/',_0xa05b7b);}exports['getFields']=function(_0x4d62da,_0x677e45){var _0x1d03ed=_0x4d62da[_0x1909('0x19')][_0x1909('0x42')];var _0x3dc161=_0x1d03ed==='incident'?_0x1909('0x43'):_0x1909('0x44');var _0x12dd5a='';var _0x343e44='';var _0x1ecadb='';var _0x2beea1='';var _0x156db6='';var _0x1d6086='';var _0x43a7ce='';var _0x16bf87='';var _0xd84d1e=[_0x1909('0x45'),'description','customerid',_0x1909('0x46'),_0x1909('0x47'),'subject',_0x1909('0x48'),_0x1909('0x49'),'directioncode',_0x1909('0x4a')];var _0x224d4f=[_0x1909('0x4b'),_0x1909('0x4c'),_0x1909('0x4d'),_0x1909('0x4e'),'contactidname',_0x1909('0x4f'),_0x1909('0x50'),_0x1909('0x51'),_0x1909('0x52'),_0x1909('0x53'),_0x1909('0x54'),'createdbyyominame',_0x1909('0x55'),_0x1909('0x56'),_0x1909('0x57'),'customeridname',_0x1909('0x58'),_0x1909('0x59'),_0x1909('0x5a'),_0x1909('0x5b'),_0x1909('0x5c'),_0x1909('0x5d'),'escalatedon',_0x1909('0x5e'),_0x1909('0x5f'),_0x1909('0x60'),_0x1909('0x61'),'influencescore',_0x1909('0x62'),'lastonholdtime','masteridname',_0x1909('0x63'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x1909('0x64'),'modifiedon',_0x1909('0x65'),_0x1909('0x66'),_0x1909('0x67'),'msdyn_iotalertname','numberofchildincidents',_0x1909('0x68'),_0x1909('0x69'),_0x1909('0x6a'),'owneridtype',_0x1909('0x6b'),_0x1909('0x6c'),'primarycontactidname',_0x1909('0x6d'),_0x1909('0x6e'),_0x1909('0x6f'),_0x1909('0x70'),'resolveby',_0x1909('0x71'),_0x1909('0x72'),_0x1909('0x73'),_0x1909('0x74'),_0x1909('0x75'),_0x1909('0x76'),_0x1909('0x77'),_0x1909('0x78'),_0x1909('0x79'),_0x1909('0x7a'),'subjectidname','ticketnumber','timezoneruleversionnumber',_0x1909('0x7b'),_0x1909('0x7c'),_0x1909('0x7d'),'versionnumber'];var _0x5de051=_0xd84d1e[_0x1909('0x7e')](_0x224d4f);return db['Dynamics365Account'][_0x1909('0x32')]({'where':{'id':_0x4d62da[_0x1909('0x30')]['id']},'attributes':['id',_0x1909('0x7f'),_0x1909('0x80'),_0x1909('0x81'),_0x1909('0x82'),'clientId',_0x1909('0x83'),_0x1909('0x84')],'include':[{'model':db['CloudProvider'],'as':_0x1909('0x85'),'attributes':['id','data5',_0x1909('0x86')]}]})[_0x1909('0xc')](handleEntityNotFound(_0x677e45,null))[_0x1909('0xc')](function(_0x3001ac){if(_0x3001ac){if(_0x3001ac[_0x1909('0x84')]){_0x3001ac[_0x1909('0x87')]=_0x3001ac[_0x1909('0x85')][_0x1909('0x88')];_0x16bf87=sanitizeRemoteUri(_0x3001ac['CloudProvider'][_0x1909('0x86')]);_0x43a7ce=getWebApiUrl(_0x16bf87);return _0x3001ac;}_0x16bf87=sanitizeRemoteUri(_0x3001ac[_0x1909('0x81')]);_0x43a7ce=getWebApiUrl(_0x16bf87);var _0x2559d1={'method':_0x1909('0x89'),'uri':_0x1909('0x8a')+_0x3001ac['tenantId']+_0x1909('0x8b'),'form':{'client_id':_0x3001ac['clientId'],'resource':_0x16bf87,'username':_0x3001ac[_0x1909('0x7f')],'password':_0x3001ac[_0x1909('0x80')],'grant_type':_0x1909('0x80'),'client_secret':_0x3001ac[_0x1909('0x83')]},'json':!![]};return rp(_0x2559d1);}})[_0x1909('0xc')](function(_0x21b6b8){_0x1d6086=_0x21b6b8[_0x1909('0x87')];var _0x10cc66={'method':_0x1909('0x8c'),'uri':encodeURI(_0x43a7ce+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3dc161+'\x27'),'headers':{'Authorization':_0x1909('0x8d')+_0x1d6086,'If-None-Match':null,'OData-Version':_0x1909('0x8e')},'json':!![]};return rp(_0x10cc66);})[_0x1909('0xc')](function(_0x5d685a){var _0x105718=_0x5d685a[_0x1909('0x8f')][0x0];var _0x46130b=_0x105718[_0x1909('0x90')];var _0x38ecf3={'method':_0x1909('0x8c'),'uri':_0x43a7ce+_0x1909('0x91')+_0x46130b+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x1909('0x8d')+_0x1d6086,'If-None-Match':null,'OData-Version':_0x1909('0x8e')},'json':!![]};return rp(_0x38ecf3);})[_0x1909('0xc')](function(_0x4b6cf5){_0x12dd5a=_0x4b6cf5;_0x343e44=_0x12dd5a[_0x1909('0x92')];_0x343e44=_[_0x1909('0x93')](_0x343e44,function(_0x417159){return!_0x5de051[_0x1909('0x94')](_0x417159[_0x1909('0x95')]);});var _0x36b4e7=[];var _0x267b64=[];_0x343e44[_0x1909('0x96')](function(_0x46c321){if(_0x46c321[_0x1909('0x97')]){var _0x50fe53=_0x46c321[_0x1909('0x97')][_0x1909('0x3f')](_0x46c321[_0x1909('0x97')][_0x1909('0x40')]('.')+0x1);if(_0x50fe53===_0x1909('0x98')){_0x36b4e7['push'](getSelectList(_0x43a7ce,_0x1d03ed,_0x267b64,_0x12dd5a[_0x1909('0x90')],_0x46c321['MetadataId'],_0x1d6086));}}});return Promise[_0x1909('0x99')](_0x36b4e7);})[_0x1909('0xc')](function(_0x1c8615){_0x1ecadb=_0x1c8615[0x0];var _0x4e5f27=[];var _0x541190=[];_0x343e44[_0x1909('0x96')](function(_0x1ce9c5){if(!_[_0x1909('0x9a')](_0x1ce9c5[_0x1909('0x97')])){var _0x390b79=_0x1ce9c5[_0x1909('0x97')][_0x1909('0x3f')](_0x1ce9c5[_0x1909('0x97')]['lastIndexOf']('.')+0x1);if(_0x390b79===_0x1909('0x9b')){_0x4e5f27[_0x1909('0x9c')](getBooleanList(_0x43a7ce,_0x1d03ed,_0x541190,_0x12dd5a[_0x1909('0x90')],_0x1ce9c5['MetadataId'],_0x1d6086));}}});return Promise[_0x1909('0x99')](_0x4e5f27);})[_0x1909('0xc')](function(_0x26d2ee){_0x2beea1=_0x26d2ee[0x0];var _0x29ec7f=[];var _0x48de3f=[];_0x343e44[_0x1909('0x96')](function(_0x1fe85a){if(_0x1fe85a[_0x1909('0x97')]){var _0x17b1cd=_0x1fe85a[_0x1909('0x97')][_0x1909('0x3f')](_0x1fe85a[_0x1909('0x97')][_0x1909('0x40')]('.')+0x1);if(_0x17b1cd===_0x1909('0x9d')||_0x17b1cd===_0x1909('0x9e')||_0x17b1cd==='BigIntAttributeMetadata'||_0x17b1cd===_0x1909('0x9f')||_0x17b1cd==='MemoAttributeMetadata'||_0x17b1cd===_0x1909('0xa0')||_0x17b1cd===_0x1909('0xa1')||_0x17b1cd===_0x1909('0xa2')||_0x17b1cd===_0x1909('0xa3')||_0x17b1cd===_0x1909('0xa4')){_0x29ec7f[_0x1909('0x9c')](getInputList(_0x43a7ce,_0x1d03ed,_0x17b1cd,_0x48de3f,_0x12dd5a[_0x1909('0x90')],_0x1fe85a[_0x1909('0x90')],_0x1d6086));}}});return Promise[_0x1909('0x99')](_0x29ec7f);})['then'](function(_0x4373b6){_0x156db6=_0x4373b6[0x0];var _0x46222c=_0x1ecadb['concat'](_0x2beea1)[_0x1909('0x7e')](_0x156db6);var _0x64578b={'count':_0x46222c[_0x1909('0x1f')],'rows':_0x46222c};return _0x64578b;})[_0x1909('0xc')](respondWithResult(_0x677e45,null))[_0x1909('0x2c')](function(_0x3fe7a6){var _0x5bcf1f=_0x4d62da[_0x1909('0x19')][_0x1909('0xa5')]?0x1f4:_0x3fe7a6[_0x1909('0xa6')]||0x1f4;logger[_0x1909('0xa7')](_0x3fe7a6[_0x1909('0x10')]);delete _0x3fe7a6[_0x1909('0x11')];if(_0x5bcf1f===0x191){_0x5bcf1f=0x190;}_0x677e45[_0x1909('0x9')](_0x5bcf1f)['send'](_0x4d62da[_0x1909('0x19')][_0x1909('0xa5')]?{'message':_0x1909('0xa8'),'statusCode':_0x3fe7a6[_0x1909('0xa6')]}:_0x3fe7a6);});};function getSelectList(_0x568383,_0x1e9ad4,_0x30efc3,_0x98b424,_0x3f3de8,_0x3521eb){var _0x2c8ee2={'method':_0x1909('0x8c'),'uri':_0x568383+_0x1909('0x91')+_0x98b424+_0x1909('0xa9')+_0x3f3de8+_0x1909('0xaa')+_0x1909('0xab'),'headers':{'Authorization':_0x1909('0x8d')+_0x3521eb,'If-None-Match':null,'OData-Version':_0x1909('0x8e')},'json':!![]};return rp(_0x2c8ee2)[_0x1909('0xc')](function(_0x19267b){var _0x4b32bb=[];var _0x35d054=_0x19267b[_0x1909('0xac')][_0x1909('0xad')];_0x35d054[_0x1909('0x96')](function(_0x132ec6){_0x4b32bb[_0x1909('0x9c')]({'name':_0x132ec6['Label'][_0x1909('0xae')][_0x1909('0xaf')],'value':String(_0x132ec6[_0x1909('0xb0')])});});var _0x360758={'id':_0x1e9ad4+'_'+_0x19267b[_0x1909('0x95')],'name':_0x19267b['DisplayName'][_0x1909('0xae')][_0x1909('0xaf')],'custom':![],'options':_0x4b32bb};_0x30efc3[_0x1909('0x9c')](_0x360758);return _0x30efc3;});}function getBooleanList(_0x604c13,_0x2b8814,_0x546b49,_0x270dcf,_0xcf0776,_0x1cb0e8){var _0x59f4a7={'method':_0x1909('0x8c'),'uri':_0x604c13+'EntityDefinitions('+_0x270dcf+_0x1909('0xa9')+_0xcf0776+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x1909('0x8d')+_0x1cb0e8,'If-None-Match':null,'OData-Version':_0x1909('0x8e')},'json':!![]};return rp(_0x59f4a7)[_0x1909('0xc')](function(_0x27bc42){var _0x134f79=[];_0x134f79[_0x1909('0x9c')]({'name':_0x27bc42['OptionSet']['TrueOption'][_0x1909('0xaf')][_0x1909('0xae')][_0x1909('0xaf')],'value':_0x1909('0xb1')},{'name':_0x27bc42[_0x1909('0xac')]['FalseOption'][_0x1909('0xaf')]['UserLocalizedLabel'][_0x1909('0xaf')],'value':'false'});var _0xcfa20f={'id':_0x2b8814+'_'+_0x27bc42[_0x1909('0x95')],'name':_0x27bc42['DisplayName'][_0x1909('0xae')][_0x1909('0xaf')],'custom':![],'options':_0x134f79};_0x546b49['push'](_0xcfa20f);return _0x546b49;});}function getInputList(_0x5d8b93,_0x40214d,_0x327903,_0x3bf4ed,_0x2900ca,_0x3afbd6,_0x14348b){var _0xd9b919={'method':'GET','uri':_0x5d8b93+'EntityDefinitions('+_0x2900ca+_0x1909('0xa9')+_0x3afbd6+_0x1909('0xb2')+_0x327903+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x14348b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xd9b919)[_0x1909('0xc')](function(_0x41d335){var _0x3003d1={'id':_0x40214d+'_'+_0x41d335[_0x1909('0x95')],'name':_0x41d335[_0x1909('0xb3')]['UserLocalizedLabel']?_0x41d335['DisplayName']['UserLocalizedLabel']['Label']:_0x41d335[_0x1909('0x95')],'custom':![],'options':[]};_0x3bf4ed[_0x1909('0x9c')](_0x3003d1);return _0x3bf4ed;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index a0d4ac6..63d020d 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1df972,_0x44f81b){var _0x55448c=function(_0x3fd184){while(--_0x3fd184){_0x1df972['push'](_0x1df972['shift']());}};_0x55448c(++_0x44f81b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x568922,_0x51d358){var _0xbbb82c=function(_0x31607e){while(--_0x31607e){_0x568922['push'](_0x568922['shift']());}};_0xbbb82c(++_0x51d358);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 3f6ed51..0477ee6 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 _0x786a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','Dynamics365Account','findAll','options','raw','attributes','include','map','model','GetDynamics365Account','ShowDynamics365Account','where','moment'];(function(_0x35a16b,_0x520804){var _0x3b72b9=function(_0x253752){while(--_0x253752){_0x35a16b['push'](_0x35a16b['shift']());}};_0x3b72b9(++_0x520804);}(_0x786a,0x1ec));var _0xa786=function(_0x5cc2fd,_0xf2cd4b){_0x5cc2fd=_0x5cc2fd-0x0;var _0x5a3c0a=_0x786a[_0x5cc2fd];return _0x5a3c0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa786('0x0'));var BPromise=require(_0xa786('0x1'));var rs=require(_0xa786('0x2'));var fs=require('fs');var Redis=require(_0xa786('0x3'));var db=require(_0xa786('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa786('0x5'))('rpc');var config=require(_0xa786('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfc981a,_0x133476,_0x3b4630){return new BPromise(function(_0x57d256,_0x1c633e){return client[_0xa786('0x7')](_0xfc981a,_0x3b4630)[_0xa786('0x8')](function(_0x57a378){logger['info'](_0xa786('0x9'),_0x133476,'request\x20sent');logger[_0xa786('0xa')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x133476,_0xa786('0xb'),JSON[_0xa786('0xc')](_0x57a378));if(_0x57a378[_0xa786('0xd')]){if(_0x57a378[_0xa786('0xd')]['code']===0x1f4){logger['error'](_0xa786('0x9'),_0x133476,_0x57a378[_0xa786('0xd')][_0xa786('0xe')]);return _0x1c633e(_0x57a378['error'][_0xa786('0xe')]);}logger['error'](_0xa786('0x9'),_0x133476,_0x57a378[_0xa786('0xd')][_0xa786('0xe')]);return _0x57d256(_0x57a378[_0xa786('0xd')][_0xa786('0xe')]);}else{logger[_0xa786('0xf')](_0xa786('0x9'),_0x133476,_0xa786('0xb'));_0x57d256(_0x57a378[_0xa786('0x10')][_0xa786('0xe')]);}})[_0xa786('0x11')](function(_0x3a7561){logger['error'](_0xa786('0x9'),_0x133476,_0x3a7561);_0x1c633e(_0x3a7561);});});}exports['GetDynamics365Account']=function(_0x4821d0){var _0x4d69a9=this;return new Promise(function(_0x3c0d63,_0x518183){return db[_0xa786('0x12')][_0xa786('0x13')]({'raw':_0x4821d0[_0xa786('0x14')]?_0x4821d0['options'][_0xa786('0x15')]===undefined?!![]:![]:!![],'where':_0x4821d0[_0xa786('0x14')]?_0x4821d0[_0xa786('0x14')]['where']||null:null,'attributes':_0x4821d0['options']?_0x4821d0[_0xa786('0x14')][_0xa786('0x16')]||null:null,'limit':_0x4821d0[_0xa786('0x14')]?_0x4821d0[_0xa786('0x14')]['limit']||null:null,'include':_0x4821d0[_0xa786('0x14')]?_0x4821d0[_0xa786('0x14')][_0xa786('0x17')]?_[_0xa786('0x18')](_0x4821d0['options'][_0xa786('0x17')],function(_0x27fc88){return{'model':db[_0x27fc88['model']],'as':_0x27fc88['as'],'attributes':_0x27fc88['attributes'],'include':_0x27fc88['include']?_['map'](_0x27fc88[_0xa786('0x17')],function(_0x21d30d){return{'model':db[_0x21d30d[_0xa786('0x19')]],'as':_0x21d30d['as'],'attributes':_0x21d30d[_0xa786('0x16')],'include':_0x21d30d['include']?_['map'](_0x21d30d[_0xa786('0x17')],function(_0x4948c2){return{'model':db[_0x4948c2['model']],'as':_0x4948c2['as'],'attributes':_0x4948c2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa786('0x8')](function(_0x36e956){logger[_0xa786('0xf')](_0xa786('0x1a'),_0x4821d0);logger['debug'](_0xa786('0x1a'),_0x4821d0,JSON[_0xa786('0xc')](_0x36e956));_0x3c0d63(_0x36e956);})['catch'](function(_0x3b27f6){logger[_0xa786('0xd')](_0xa786('0x1a'),_0x3b27f6[_0xa786('0xe')],_0x4821d0);_0x518183(_0x4d69a9[_0xa786('0xd')](0x1f4,_0x3b27f6[_0xa786('0xe')]));});});};exports[_0xa786('0x1b')]=function(_0x293790){var _0x3b8880=this;return new Promise(function(_0x3e9544,_0x4abcb8){return db['Dynamics365Account']['find']({'raw':_0x293790[_0xa786('0x14')]?_0x293790[_0xa786('0x14')][_0xa786('0x15')]===undefined?!![]:![]:!![],'where':_0x293790[_0xa786('0x14')]?_0x293790[_0xa786('0x14')][_0xa786('0x1c')]||null:null,'attributes':_0x293790[_0xa786('0x14')]?_0x293790[_0xa786('0x14')][_0xa786('0x16')]||null:null,'include':_0x293790['options']?_0x293790[_0xa786('0x14')]['include']?_[_0xa786('0x18')](_0x293790[_0xa786('0x14')][_0xa786('0x17')],function(_0x153ab4){return{'model':db[_0x153ab4[_0xa786('0x19')]],'as':_0x153ab4['as'],'attributes':_0x153ab4[_0xa786('0x16')],'include':_0x153ab4[_0xa786('0x17')]?_[_0xa786('0x18')](_0x153ab4[_0xa786('0x17')],function(_0x2d0a71){return{'model':db[_0x2d0a71[_0xa786('0x19')]],'as':_0x2d0a71['as'],'attributes':_0x2d0a71[_0xa786('0x16')],'include':_0x2d0a71[_0xa786('0x17')]?_[_0xa786('0x18')](_0x2d0a71[_0xa786('0x17')],function(_0x4cd54c){return{'model':db[_0x4cd54c['model']],'as':_0x4cd54c['as'],'attributes':_0x4cd54c[_0xa786('0x16')]};}):[]};}):[]};}):[]:[]})[_0xa786('0x8')](function(_0x844d02){logger[_0xa786('0xf')](_0xa786('0x1b'),_0x293790);logger['debug'](_0xa786('0x1b'),_0x293790,JSON[_0xa786('0xc')](_0x844d02));_0x3e9544(_0x844d02);})[_0xa786('0x11')](function(_0x29b264){logger[_0xa786('0xd')](_0xa786('0x1b'),_0x29b264['message'],_0x293790);_0x4abcb8(_0x3b8880['error'](0x1f4,_0x29b264[_0xa786('0xe')]));});});}; \ No newline at end of file +var _0x71e8=['findAll','options','raw','where','attributes','include','map','model','GetDynamics365Account','stringify','catch','ShowDynamics365Account','Dynamics365Account','find','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x71e8,0x18e));var _0x871e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71e8[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x871e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x871e('0x1'));var rs=require(_0x871e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x871e('0x3'));var logger=require(_0x871e('0x4'))(_0x871e('0x5'));var config=require(_0x871e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x871e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ee3e,_0x2059ef,_0x5bede6){return new BPromise(function(_0x139397,_0x48ae25){return client[_0x871e('0x8')](_0x49ee3e,_0x5bede6)[_0x871e('0x9')](function(_0x9e90c1){logger[_0x871e('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x2059ef,_0x871e('0xb'));logger[_0x871e('0xc')](_0x871e('0xd'),_0x2059ef,_0x871e('0xb'),JSON['stringify'](_0x9e90c1));if(_0x9e90c1[_0x871e('0xe')]){if(_0x9e90c1[_0x871e('0xe')][_0x871e('0xf')]===0x1f4){logger[_0x871e('0xe')](_0x871e('0x10'),_0x2059ef,_0x9e90c1[_0x871e('0xe')][_0x871e('0x11')]);return _0x48ae25(_0x9e90c1[_0x871e('0xe')]['message']);}logger[_0x871e('0xe')](_0x871e('0x10'),_0x2059ef,_0x9e90c1[_0x871e('0xe')][_0x871e('0x11')]);return _0x139397(_0x9e90c1[_0x871e('0xe')][_0x871e('0x11')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x2059ef,'request\x20sent');_0x139397(_0x9e90c1['result'][_0x871e('0x11')]);}})['catch'](function(_0xa7436){logger[_0x871e('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2059ef,_0xa7436);_0x48ae25(_0xa7436);});});}exports['GetDynamics365Account']=function(_0x2b201a){var _0x3f09b2=this;return new Promise(function(_0x3e30f0,_0x763962){return db['Dynamics365Account'][_0x871e('0x12')]({'raw':_0x2b201a[_0x871e('0x13')]?_0x2b201a['options'][_0x871e('0x14')]===undefined?!![]:![]:!![],'where':_0x2b201a['options']?_0x2b201a[_0x871e('0x13')][_0x871e('0x15')]||null:null,'attributes':_0x2b201a[_0x871e('0x13')]?_0x2b201a['options'][_0x871e('0x16')]||null:null,'limit':_0x2b201a['options']?_0x2b201a['options']['limit']||null:null,'include':_0x2b201a[_0x871e('0x13')]?_0x2b201a['options'][_0x871e('0x17')]?_[_0x871e('0x18')](_0x2b201a[_0x871e('0x13')][_0x871e('0x17')],function(_0x2a872d){return{'model':db[_0x2a872d[_0x871e('0x19')]],'as':_0x2a872d['as'],'attributes':_0x2a872d[_0x871e('0x16')],'include':_0x2a872d['include']?_[_0x871e('0x18')](_0x2a872d[_0x871e('0x17')],function(_0x5a8df9){return{'model':db[_0x5a8df9['model']],'as':_0x5a8df9['as'],'attributes':_0x5a8df9[_0x871e('0x16')],'include':_0x5a8df9[_0x871e('0x17')]?_[_0x871e('0x18')](_0x5a8df9[_0x871e('0x17')],function(_0x4aff81){return{'model':db[_0x4aff81[_0x871e('0x19')]],'as':_0x4aff81['as'],'attributes':_0x4aff81[_0x871e('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2daf89){logger[_0x871e('0xa')](_0x871e('0x1a'),_0x2b201a);logger[_0x871e('0xc')](_0x871e('0x1a'),_0x2b201a,JSON[_0x871e('0x1b')](_0x2daf89));_0x3e30f0(_0x2daf89);})[_0x871e('0x1c')](function(_0x59d8b2){logger[_0x871e('0xe')]('GetDynamics365Account',_0x59d8b2[_0x871e('0x11')],_0x2b201a);_0x763962(_0x3f09b2[_0x871e('0xe')](0x1f4,_0x59d8b2[_0x871e('0x11')]));});});};exports[_0x871e('0x1d')]=function(_0x20d07e){var _0x43b88e=this;return new Promise(function(_0x41b3da,_0x1fca3e){return db[_0x871e('0x1e')][_0x871e('0x1f')]({'raw':_0x20d07e['options']?_0x20d07e['options'][_0x871e('0x14')]===undefined?!![]:![]:!![],'where':_0x20d07e[_0x871e('0x13')]?_0x20d07e[_0x871e('0x13')]['where']||null:null,'attributes':_0x20d07e[_0x871e('0x13')]?_0x20d07e[_0x871e('0x13')]['attributes']||null:null,'include':_0x20d07e[_0x871e('0x13')]?_0x20d07e[_0x871e('0x13')][_0x871e('0x17')]?_['map'](_0x20d07e[_0x871e('0x13')][_0x871e('0x17')],function(_0x1564a7){return{'model':db[_0x1564a7[_0x871e('0x19')]],'as':_0x1564a7['as'],'attributes':_0x1564a7['attributes'],'include':_0x1564a7[_0x871e('0x17')]?_[_0x871e('0x18')](_0x1564a7['include'],function(_0x50056f){return{'model':db[_0x50056f[_0x871e('0x19')]],'as':_0x50056f['as'],'attributes':_0x50056f[_0x871e('0x16')],'include':_0x50056f[_0x871e('0x17')]?_[_0x871e('0x18')](_0x50056f[_0x871e('0x17')],function(_0x31733a){return{'model':db[_0x31733a[_0x871e('0x19')]],'as':_0x31733a['as'],'attributes':_0x31733a[_0x871e('0x16')]};}):[]};}):[]};}):[]:[]})[_0x871e('0x9')](function(_0x9e5df2){logger[_0x871e('0xa')](_0x871e('0x1d'),_0x20d07e);logger[_0x871e('0xc')](_0x871e('0x1d'),_0x20d07e,JSON[_0x871e('0x1b')](_0x9e5df2));_0x41b3da(_0x9e5df2);})[_0x871e('0x1c')](function(_0x30f82d){logger[_0x871e('0xe')](_0x871e('0x1d'),_0x30f82d[_0x871e('0x11')],_0x20d07e);_0x1fca3e(_0x43b88e[_0x871e('0xe')](0x1f4,_0x30f82d[_0x871e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 347e096..d06cad4 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 _0xa72d=['isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x5134c7,_0x1d2de5){var _0x151312=function(_0x44d3c1){while(--_0x44d3c1){_0x5134c7['push'](_0x5134c7['shift']());}};_0x151312(++_0x1d2de5);}(_0xa72d,0x1bf));var _0xda72=function(_0x352570,_0x349450){_0x352570=_0x352570-0x0;var _0x4a8dd6=_0xa72d[_0x352570];return _0x4a8dd6;};'use strict';var multer=require(_0xda72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda72('0x1'));var express=require(_0xda72('0x2'));var router=express[_0xda72('0x3')]();var fs_extra=require(_0xda72('0x4'));var auth=require(_0xda72('0x5'));var interaction=require(_0xda72('0x6'));var config=require(_0xda72('0x7'));var controller=require(_0xda72('0x8'));router['get']('/',auth[_0xda72('0x9')](),controller[_0xda72('0xa')]);router[_0xda72('0xb')]('/:id',auth[_0xda72('0x9')](),controller[_0xda72('0xc')]);router[_0xda72('0xb')](_0xda72('0xd'),auth[_0xda72('0x9')](),controller[_0xda72('0xe')]);router[_0xda72('0xb')](_0xda72('0xf'),auth[_0xda72('0x9')](),controller['getSubjects']);router['get'](_0xda72('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xda72('0x11')]('/',auth[_0xda72('0x9')](),controller['create']);router[_0xda72('0x12')](_0xda72('0x13'),auth[_0xda72('0x9')](),controller[_0xda72('0x14')]);router[_0xda72('0x15')]('/:id',auth[_0xda72('0x9')](),controller[_0xda72('0x16')]);module[_0xda72('0x17')]=router; \ No newline at end of file +var _0x3149=['getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x1088e8,_0x410fed){var _0x42021b=function(_0x125305){while(--_0x125305){_0x1088e8['push'](_0x1088e8['shift']());}};_0x42021b(++_0x410fed);}(_0x3149,0x181));var _0x9314=function(_0x37b402,_0x228b61){_0x37b402=_0x37b402-0x0;var _0x5299e6=_0x3149[_0x37b402];return _0x5299e6;};'use strict';var multer=require(_0x9314('0x0'));var util=require('util');var path=require(_0x9314('0x1'));var timeout=require(_0x9314('0x2'));var express=require(_0x9314('0x3'));var router=express[_0x9314('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9314('0x5'));var interaction=require(_0x9314('0x6'));var config=require(_0x9314('0x7'));var controller=require(_0x9314('0x8'));router[_0x9314('0x9')]('/',auth['isAuthenticated'](),controller[_0x9314('0xa')]);router[_0x9314('0x9')](_0x9314('0xb'),auth[_0x9314('0xc')](),controller[_0x9314('0xd')]);router['get'](_0x9314('0xe'),auth['isAuthenticated'](),controller[_0x9314('0xf')]);router['get'](_0x9314('0x10'),auth[_0x9314('0xc')](),controller['getSubjects']);router[_0x9314('0x9')]('/:id/descriptions',auth[_0x9314('0xc')](),controller[_0x9314('0x11')]);router[_0x9314('0x12')]('/',auth['isAuthenticated'](),controller[_0x9314('0x13')]);router[_0x9314('0x14')](_0x9314('0xb'),auth[_0x9314('0xc')](),controller[_0x9314('0x15')]);router[_0x9314('0x16')](_0x9314('0xb'),auth['isAuthenticated'](),controller[_0x9314('0x17')]);module[_0x9314('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index c281e2a..18a5fe9 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 _0x6774=['sequelize','STRING','ENUM','incident','phonecall','contact','nothing','BOOLEAN'];(function(_0x1867b1,_0x426ad3){var _0x1b62a6=function(_0x2e5144){while(--_0x2e5144){_0x1867b1['push'](_0x1867b1['shift']());}};_0x1b62a6(++_0x426ad3);}(_0x6774,0x1e0));var _0x4677=function(_0x2b6c93,_0x398ada){_0x2b6c93=_0x2b6c93-0x0;var _0x48f27a=_0x6774[_0x2b6c93];return _0x48f27a;};'use strict';var Sequelize=require(_0x4677('0x0'));module['exports']={'name':{'type':Sequelize[_0x4677('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x4677('0x2')](_0x4677('0x3'),_0x4677('0x4')),'defaultValue':_0x4677('0x3')},'moduleCreate':{'type':Sequelize[_0x4677('0x2')](_0x4677('0x5'),_0x4677('0x6')),'defaultValue':_0x4677('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x4677('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x4677('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa27c=['BOOLEAN','sequelize','STRING','ENUM','incident'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa27c,0xab));var _0xca27=function(_0x16f147,_0x50a6f7){_0x16f147=_0x16f147-0x0;var _0x55b504=_0xa27c[_0x16f147];return _0x55b504;};'use strict';var Sequelize=require(_0xca27('0x0'));module['exports']={'name':{'type':Sequelize[_0xca27('0x1')]},'description':{'type':Sequelize[_0xca27('0x1')]},'ticketType':{'type':Sequelize[_0xca27('0x2')](_0xca27('0x3'),'phonecall'),'defaultValue':_0xca27('0x3')},'moduleCreate':{'type':Sequelize['ENUM']('contact','nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xca27('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xca27('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3456cca..0807924 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 _0x0e51=['../../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','reject','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','options','includeAll','include','rows','catch','params','rawAttributes','merge','find','create','update','body','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x2946f2,_0x3ca115){var _0x510c26=function(_0x399acf){while(--_0x399acf){_0x2946f2['push'](_0x2946f2['shift']());}};_0x510c26(++_0x3ca115);}(_0x0e51,0x8e));var _0x10e5=function(_0x3d08fa,_0x5d4047){_0x3d08fa=_0x3d08fa-0x0;var _0x34fab6=_0x0e51[_0x3d08fa];return _0x34fab6;};'use strict';var emlformat=require(_0x10e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10e5('0x1'));var jsonpatch=require(_0x10e5('0x2'));var rp=require(_0x10e5('0x3'));var moment=require(_0x10e5('0x4'));var BPromise=require(_0x10e5('0x5'));var Mustache=require(_0x10e5('0x6'));var util=require('util');var path=require(_0x10e5('0x7'));var sox=require(_0x10e5('0x8'));var csv=require(_0x10e5('0x9'));var ejs=require(_0x10e5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x10e5('0xb'));var crypto=require(_0x10e5('0xc'));var jsforce=require(_0x10e5('0xd'));var deskjs=require(_0x10e5('0xe'));var toCsv=require(_0x10e5('0x9'));var querystring=require(_0x10e5('0xf'));var Papa=require(_0x10e5('0x10'));var Redis=require(_0x10e5('0x11'));var authService=require(_0x10e5('0x12'));var qs=require(_0x10e5('0x13'));var as=require(_0x10e5('0x14'));var hardwareService=require(_0x10e5('0x15'));var logger=require('../../config/logger')(_0x10e5('0x16'));var utils=require(_0x10e5('0x17'));var config=require(_0x10e5('0x18'));var licenseUtil=require(_0x10e5('0x19'));var db=require(_0x10e5('0x1a'))['db'];function respondWithStatusCode(_0x2d0997,_0x5bfc7c){_0x5bfc7c=_0x5bfc7c||0xcc;return function(_0x3cf23f){if(_0x3cf23f){return _0x2d0997['sendStatus'](_0x5bfc7c);}return _0x2d0997[_0x10e5('0x1b')](_0x5bfc7c)[_0x10e5('0x1c')]();};}function respondWithResult(_0x4c887c,_0x344c70){_0x344c70=_0x344c70||0xc8;return function(_0x10ea47){if(_0x10ea47){return _0x4c887c['status'](_0x344c70)[_0x10e5('0x1d')](_0x10ea47);}};}function respondWithFilteredResult(_0x30f3d2,_0x224708){return function(_0x2bd8e9){if(_0x2bd8e9){var _0x2cd974=typeof _0x224708[_0x10e5('0x1e')]===_0x10e5('0x1f')&&typeof _0x224708[_0x10e5('0x20')]===_0x10e5('0x1f');var _0x295adc=_0x2bd8e9['count'];var _0x5d51d0=_0x2cd974?0x0:_0x224708[_0x10e5('0x1e')];var _0x2b5276=_0x2cd974?_0x2bd8e9[_0x10e5('0x21')]:_0x224708[_0x10e5('0x1e')]+_0x224708['limit'];var _0x21d41d;if(_0x2b5276>=_0x295adc){_0x2b5276=_0x295adc;_0x21d41d=0xc8;}else{_0x21d41d=0xce;}_0x30f3d2['status'](_0x21d41d);return _0x30f3d2[_0x10e5('0x22')]('Content-Range',_0x5d51d0+'-'+_0x2b5276+'/'+_0x295adc)[_0x10e5('0x1d')](_0x2bd8e9);}return null;};}function patchUpdates(_0x2a213f){return function(_0x29e766){try{jsonpatch['apply'](_0x29e766,_0x2a213f,!![]);}catch(_0x243a64){return BPromise[_0x10e5('0x23')](_0x243a64);}return _0x29e766['save']();};}function saveUpdates(_0x1aef7a,_0x3b270d){return function(_0x2136cc){if(_0x2136cc){return _0x2136cc['update'](_0x1aef7a)[_0x10e5('0x24')](function(_0x5ab187){return _0x5ab187;});}return null;};}function removeEntity(_0x2b076a,_0x34ebdc){return function(_0x35948b){if(_0x35948b){return _0x35948b[_0x10e5('0x25')]()['then'](function(){_0x2b076a[_0x10e5('0x1b')](0xcc)[_0x10e5('0x1c')]();});}};}function handleEntityNotFound(_0x4caafc,_0x3cc8c0){return function(_0x5df79b){if(!_0x5df79b){_0x4caafc[_0x10e5('0x26')](0x194);}return _0x5df79b;};}function handleError(_0x4a3d4e,_0x198848){_0x198848=_0x198848||0x1f4;return function(_0xbf3959){logger[_0x10e5('0x27')](_0xbf3959[_0x10e5('0x28')]);if(_0xbf3959['name']){delete _0xbf3959[_0x10e5('0x29')];}_0x4a3d4e['status'](_0x198848)[_0x10e5('0x2a')](_0xbf3959);};}exports[_0x10e5('0x2b')]=function(_0x4bddda,_0xe185cb){var _0x4eab43={},_0x3c80e0={},_0x2b0486={'count':0x0,'rows':[]};var _0x514018=_[_0x10e5('0x2c')](db[_0x10e5('0x2d')]['rawAttributes'],function(_0x17b431){return{'name':_0x17b431['fieldName'],'type':_0x17b431[_0x10e5('0x2e')][_0x10e5('0x2f')]};});_0x3c80e0['model']=_[_0x10e5('0x2c')](_0x514018,'name');_0x3c80e0[_0x10e5('0x30')]=_[_0x10e5('0x31')](_0x4bddda[_0x10e5('0x30')]);_0x3c80e0['filters']=_['intersection'](_0x3c80e0[_0x10e5('0x32')],_0x3c80e0[_0x10e5('0x30')]);_0x4eab43[_0x10e5('0x33')]=_[_0x10e5('0x34')](_0x3c80e0[_0x10e5('0x32')],qs[_0x10e5('0x35')](_0x4bddda[_0x10e5('0x30')][_0x10e5('0x35')]));_0x4eab43['attributes']=_0x4eab43['attributes'][_0x10e5('0x36')]?_0x4eab43[_0x10e5('0x33')]:_0x3c80e0['model'];if(!_0x4bddda[_0x10e5('0x30')][_0x10e5('0x37')](_0x10e5('0x38'))){_0x4eab43['limit']=qs['limit'](_0x4bddda['query']['limit']);_0x4eab43[_0x10e5('0x1e')]=qs[_0x10e5('0x1e')](_0x4bddda[_0x10e5('0x30')][_0x10e5('0x1e')]);}_0x4eab43['order']=qs['sort'](_0x4bddda[_0x10e5('0x30')][_0x10e5('0x39')]);_0x4eab43[_0x10e5('0x3a')]=qs[_0x10e5('0x3b')](_[_0x10e5('0x3c')](_0x4bddda[_0x10e5('0x30')],_0x3c80e0['filters']),_0x514018);if(_0x4bddda[_0x10e5('0x30')][_0x10e5('0x3d')]){_0x4eab43[_0x10e5('0x3a')]=_['merge'](_0x4eab43['where'],{'$or':_[_0x10e5('0x2c')](_0x514018,function(_0x312c67){if(_0x312c67[_0x10e5('0x2e')]!=='VIRTUAL'){var _0x1f44e8={};_0x1f44e8[_0x312c67[_0x10e5('0x29')]]={'$like':'%'+_0x4bddda[_0x10e5('0x30')]['filter']+'%'};return _0x1f44e8;}})});}_0x4eab43=_['merge']({},_0x4eab43,_0x4bddda[_0x10e5('0x3e')]);var _0x593f53={'where':_0x4eab43[_0x10e5('0x3a')]};return db['Dynamics365Configuration'][_0x10e5('0x21')](_0x593f53)[_0x10e5('0x24')](function(_0x3dcad7){_0x2b0486[_0x10e5('0x21')]=_0x3dcad7;if(_0x4bddda[_0x10e5('0x30')][_0x10e5('0x3f')]){_0x4eab43[_0x10e5('0x40')]=[{'all':!![]}];}return db[_0x10e5('0x2d')]['findAll'](_0x4eab43);})[_0x10e5('0x24')](function(_0x38f639){_0x2b0486[_0x10e5('0x41')]=_0x38f639;return _0x2b0486;})[_0x10e5('0x24')](respondWithFilteredResult(_0xe185cb,_0x4eab43))[_0x10e5('0x42')](handleError(_0xe185cb,null));};exports['show']=function(_0x41539e,_0x50185e){var _0x4d3a51={'raw':![],'where':{'id':_0x41539e[_0x10e5('0x43')]['id']}},_0x515297={};_0x515297[_0x10e5('0x32')]=_[_0x10e5('0x31')](db[_0x10e5('0x2d')][_0x10e5('0x44')]);_0x515297[_0x10e5('0x30')]=_['keys'](_0x41539e[_0x10e5('0x30')]);_0x515297['filters']=_[_0x10e5('0x34')](_0x515297['model'],_0x515297['query']);_0x4d3a51[_0x10e5('0x33')]=_[_0x10e5('0x34')](_0x515297['model'],qs[_0x10e5('0x35')](_0x41539e[_0x10e5('0x30')][_0x10e5('0x35')]));_0x4d3a51[_0x10e5('0x33')]=_0x4d3a51['attributes'][_0x10e5('0x36')]?_0x4d3a51[_0x10e5('0x33')]:_0x515297[_0x10e5('0x32')];if(_0x41539e[_0x10e5('0x30')][_0x10e5('0x3f')]){_0x4d3a51[_0x10e5('0x40')]=[{'all':!![]}];}_0x4d3a51=_[_0x10e5('0x45')]({},_0x4d3a51,_0x41539e[_0x10e5('0x3e')]);return db[_0x10e5('0x2d')][_0x10e5('0x46')](_0x4d3a51)[_0x10e5('0x24')](handleEntityNotFound(_0x50185e,null))[_0x10e5('0x24')](respondWithResult(_0x50185e,null))['catch'](handleError(_0x50185e,null));};exports[_0x10e5('0x47')]=function(_0x36d980,_0x16a6a0){return db[_0x10e5('0x2d')]['create'](_0x36d980['body'],{})['then'](respondWithResult(_0x16a6a0,0xc9))[_0x10e5('0x42')](handleError(_0x16a6a0,null));};exports[_0x10e5('0x48')]=function(_0x50f27e,_0x487e75){if(_0x50f27e[_0x10e5('0x49')]['id']){delete _0x50f27e['body']['id'];}return db[_0x10e5('0x2d')][_0x10e5('0x46')]({'where':{'id':_0x50f27e[_0x10e5('0x43')]['id']}})[_0x10e5('0x24')](handleEntityNotFound(_0x487e75,null))['then'](saveUpdates(_0x50f27e['body'],null))['then'](respondWithResult(_0x487e75,null))[_0x10e5('0x42')](handleError(_0x487e75,null));};exports['destroy']=function(_0xcfc181,_0x247aa2){return db[_0x10e5('0x2d')][_0x10e5('0x46')]({'where':{'id':_0xcfc181['params']['id']}})[_0x10e5('0x24')](handleEntityNotFound(_0x247aa2,null))['then'](removeEntity(_0x247aa2,null))[_0x10e5('0x42')](handleError(_0x247aa2,null));};exports[_0x10e5('0x4a')]=function(_0x15e9c5,_0xfa8803,_0x460aea){var _0x498e0a={};var _0x368f54={};var _0x1fcd82;var _0x4776a9;return db[_0x10e5('0x2d')][_0x10e5('0x4b')]({'where':{'id':_0x15e9c5['params']['id']}})['then'](handleEntityNotFound(_0xfa8803,null))['then'](function(_0x4829da){if(_0x4829da){_0x1fcd82=_0x4829da;_0x368f54[_0x10e5('0x32')]=_[_0x10e5('0x31')](db[_0x10e5('0x4c')][_0x10e5('0x44')]);_0x368f54[_0x10e5('0x30')]=_[_0x10e5('0x31')](_0x15e9c5['query']);_0x368f54[_0x10e5('0x3b')]=_['intersection'](_0x368f54[_0x10e5('0x32')],_0x368f54['query']);_0x498e0a[_0x10e5('0x33')]=_['intersection'](_0x368f54[_0x10e5('0x32')],qs[_0x10e5('0x35')](_0x15e9c5['query'][_0x10e5('0x35')]));_0x498e0a[_0x10e5('0x33')]=_0x498e0a[_0x10e5('0x33')][_0x10e5('0x36')]?_0x498e0a[_0x10e5('0x33')]:_0x368f54[_0x10e5('0x32')];_0x498e0a[_0x10e5('0x4d')]=qs[_0x10e5('0x39')](_0x15e9c5['query'][_0x10e5('0x39')]);_0x498e0a[_0x10e5('0x3a')]=qs[_0x10e5('0x3b')](_[_0x10e5('0x3c')](_0x15e9c5[_0x10e5('0x30')],_0x368f54[_0x10e5('0x3b')]));if(_0x15e9c5[_0x10e5('0x30')]['filter']){_0x498e0a['where']=_[_0x10e5('0x45')](_0x498e0a[_0x10e5('0x3a')],{'$or':_[_0x10e5('0x2c')](_0x498e0a[_0x10e5('0x33')],function(_0xcbada){var _0x34f472={};_0x34f472[_0xcbada]={'$like':'%'+_0x15e9c5['query'][_0x10e5('0x3d')]+'%'};return _0x34f472;})});}_0x498e0a=_[_0x10e5('0x45')]({},_0x498e0a,_0x15e9c5[_0x10e5('0x3e')]);return _0x1fcd82[_0x10e5('0x4a')](_0x498e0a);}})[_0x10e5('0x24')](function(_0xe8030f){if(_0xe8030f){_0x4776a9=_0xe8030f[_0x10e5('0x36')];if(!_0x15e9c5[_0x10e5('0x30')]['hasOwnProperty']('nolimit')){_0x498e0a[_0x10e5('0x20')]=qs[_0x10e5('0x20')](_0x15e9c5[_0x10e5('0x30')][_0x10e5('0x20')]);_0x498e0a[_0x10e5('0x1e')]=qs[_0x10e5('0x1e')](_0x15e9c5[_0x10e5('0x30')][_0x10e5('0x1e')]);}return _0x1fcd82[_0x10e5('0x4a')](_0x498e0a);}})[_0x10e5('0x24')](function(_0x13e8cc){if(_0x13e8cc){return _0x13e8cc?{'count':_0x4776a9,'rows':_0x13e8cc}:null;}})[_0x10e5('0x24')](respondWithResult(_0xfa8803,null))[_0x10e5('0x42')](handleError(_0xfa8803,null));};exports[_0x10e5('0x4e')]=function(_0x9354cb,_0x47fa20,_0x2a6179){var _0x4cc019={};var _0x56bf62={};var _0x4ec85d;var _0x28e372;return db['Dynamics365Configuration'][_0x10e5('0x4b')]({'where':{'id':_0x9354cb['params']['id']}})[_0x10e5('0x24')](handleEntityNotFound(_0x47fa20,null))[_0x10e5('0x24')](function(_0x63b754){if(_0x63b754){_0x4ec85d=_0x63b754;_0x56bf62[_0x10e5('0x32')]=_[_0x10e5('0x31')](db['Dynamics365Field'][_0x10e5('0x44')]);_0x56bf62[_0x10e5('0x30')]=_[_0x10e5('0x31')](_0x9354cb[_0x10e5('0x30')]);_0x56bf62[_0x10e5('0x3b')]=_[_0x10e5('0x34')](_0x56bf62['model'],_0x56bf62[_0x10e5('0x30')]);_0x4cc019['attributes']=_['intersection'](_0x56bf62['model'],qs[_0x10e5('0x35')](_0x9354cb[_0x10e5('0x30')][_0x10e5('0x35')]));_0x4cc019[_0x10e5('0x33')]=_0x4cc019[_0x10e5('0x33')]['length']?_0x4cc019[_0x10e5('0x33')]:_0x56bf62[_0x10e5('0x32')];_0x4cc019[_0x10e5('0x4d')]=qs['sort'](_0x9354cb[_0x10e5('0x30')][_0x10e5('0x39')]);_0x4cc019[_0x10e5('0x3a')]=qs[_0x10e5('0x3b')](_[_0x10e5('0x3c')](_0x9354cb[_0x10e5('0x30')],_0x56bf62[_0x10e5('0x3b')]));if(_0x9354cb['query']['filter']){_0x4cc019[_0x10e5('0x3a')]=_[_0x10e5('0x45')](_0x4cc019[_0x10e5('0x3a')],{'$or':_[_0x10e5('0x2c')](_0x4cc019[_0x10e5('0x33')],function(_0x3da55b){var _0x28632a={};_0x28632a[_0x3da55b]={'$like':'%'+_0x9354cb[_0x10e5('0x30')][_0x10e5('0x3d')]+'%'};return _0x28632a;})});}_0x4cc019=_[_0x10e5('0x45')]({},_0x4cc019,_0x9354cb[_0x10e5('0x3e')]);return _0x4ec85d[_0x10e5('0x4e')](_0x4cc019);}})['then'](function(_0x43e64f){if(_0x43e64f){_0x28e372=_0x43e64f[_0x10e5('0x36')];if(!_0x9354cb[_0x10e5('0x30')][_0x10e5('0x37')](_0x10e5('0x38'))){_0x4cc019['limit']=qs[_0x10e5('0x20')](_0x9354cb['query'][_0x10e5('0x20')]);_0x4cc019['offset']=qs[_0x10e5('0x1e')](_0x9354cb[_0x10e5('0x30')][_0x10e5('0x1e')]);}return _0x4ec85d[_0x10e5('0x4e')](_0x4cc019);}})[_0x10e5('0x24')](function(_0x50154b){if(_0x50154b){return _0x50154b?{'count':_0x28e372,'rows':_0x50154b}:null;}})[_0x10e5('0x24')](respondWithResult(_0x47fa20,null))[_0x10e5('0x42')](handleError(_0x47fa20,null));};exports[_0x10e5('0x4f')]=function(_0x5976c7,_0x323437,_0x15ae4b){var _0xd15c74={};var _0x6c0037={};var _0x3150e7;var _0x173c0a;return db[_0x10e5('0x2d')][_0x10e5('0x4b')]({'where':{'id':_0x5976c7['params']['id']}})[_0x10e5('0x24')](handleEntityNotFound(_0x323437,null))[_0x10e5('0x24')](function(_0xe36ebd){if(_0xe36ebd){_0x3150e7=_0xe36ebd;_0x6c0037['model']=_['keys'](db[_0x10e5('0x4c')][_0x10e5('0x44')]);_0x6c0037['query']=_[_0x10e5('0x31')](_0x5976c7[_0x10e5('0x30')]);_0x6c0037['filters']=_['intersection'](_0x6c0037[_0x10e5('0x32')],_0x6c0037[_0x10e5('0x30')]);_0xd15c74[_0x10e5('0x33')]=_['intersection'](_0x6c0037[_0x10e5('0x32')],qs[_0x10e5('0x35')](_0x5976c7[_0x10e5('0x30')][_0x10e5('0x35')]));_0xd15c74[_0x10e5('0x33')]=_0xd15c74[_0x10e5('0x33')][_0x10e5('0x36')]?_0xd15c74[_0x10e5('0x33')]:_0x6c0037['model'];_0xd15c74[_0x10e5('0x4d')]=qs['sort'](_0x5976c7[_0x10e5('0x30')][_0x10e5('0x39')]);_0xd15c74[_0x10e5('0x3a')]=qs['filters'](_[_0x10e5('0x3c')](_0x5976c7[_0x10e5('0x30')],_0x6c0037['filters']));if(_0x5976c7[_0x10e5('0x30')][_0x10e5('0x3d')]){_0xd15c74[_0x10e5('0x3a')]=_[_0x10e5('0x45')](_0xd15c74[_0x10e5('0x3a')],{'$or':_[_0x10e5('0x2c')](_0xd15c74['attributes'],function(_0x189307){var _0x3dc25f={};_0x3dc25f[_0x189307]={'$like':'%'+_0x5976c7[_0x10e5('0x30')][_0x10e5('0x3d')]+'%'};return _0x3dc25f;})});}_0xd15c74=_[_0x10e5('0x45')]({},_0xd15c74,_0x5976c7[_0x10e5('0x3e')]);return _0x3150e7['getDescriptions'](_0xd15c74);}})[_0x10e5('0x24')](function(_0x91ad97){if(_0x91ad97){_0x173c0a=_0x91ad97['length'];if(!_0x5976c7[_0x10e5('0x30')]['hasOwnProperty'](_0x10e5('0x38'))){_0xd15c74[_0x10e5('0x20')]=qs[_0x10e5('0x20')](_0x5976c7[_0x10e5('0x30')][_0x10e5('0x20')]);_0xd15c74[_0x10e5('0x1e')]=qs['offset'](_0x5976c7['query'][_0x10e5('0x1e')]);}return _0x3150e7[_0x10e5('0x4f')](_0xd15c74);}})['then'](function(_0x24fb74){if(_0x24fb74){return _0x24fb74?{'count':_0x173c0a,'rows':_0x24fb74}:null;}})[_0x10e5('0x24')](respondWithResult(_0x323437,null))[_0x10e5('0x42')](handleError(_0x323437,null));}; \ No newline at end of file +var _0x93e9=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','params','includeAll','find','create','body','destroy','Dynamics365Field','order','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3102ce,_0x237f66){var _0x535895=function(_0xd34964){while(--_0xd34964){_0x3102ce['push'](_0x3102ce['shift']());}};_0x535895(++_0x237f66);}(_0x93e9,0xa3));var _0x993e=function(_0x453271,_0x52ee0f){_0x453271=_0x453271-0x0;var _0x54530b=_0x93e9[_0x453271];return _0x54530b;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require(_0x993e('0x7'));var util=require(_0x993e('0x8'));var path=require(_0x993e('0x9'));var sox=require(_0x993e('0xa'));var csv=require(_0x993e('0xb'));var ejs=require(_0x993e('0xc'));var fs=require('fs');var fs_extra=require(_0x993e('0xd'));var _=require(_0x993e('0xe'));var squel=require('squel');var crypto=require(_0x993e('0xf'));var jsforce=require(_0x993e('0x10'));var deskjs=require(_0x993e('0x11'));var toCsv=require(_0x993e('0xb'));var querystring=require(_0x993e('0x12'));var Papa=require(_0x993e('0x13'));var Redis=require(_0x993e('0x14'));var authService=require(_0x993e('0x15'));var qs=require(_0x993e('0x16'));var as=require(_0x993e('0x17'));var hardwareService=require(_0x993e('0x18'));var logger=require(_0x993e('0x19'))(_0x993e('0x1a'));var utils=require(_0x993e('0x1b'));var config=require(_0x993e('0x1c'));var licenseUtil=require(_0x993e('0x1d'));var db=require(_0x993e('0x1e'))['db'];function respondWithStatusCode(_0x55a7fd,_0x2f2c30){_0x2f2c30=_0x2f2c30||0xcc;return function(_0x5c14bb){if(_0x5c14bb){return _0x55a7fd['sendStatus'](_0x2f2c30);}return _0x55a7fd[_0x993e('0x1f')](_0x2f2c30)['end']();};}function respondWithResult(_0x26f5a3,_0x28be6d){_0x28be6d=_0x28be6d||0xc8;return function(_0x4c4bc8){if(_0x4c4bc8){return _0x26f5a3[_0x993e('0x1f')](_0x28be6d)['json'](_0x4c4bc8);}};}function respondWithFilteredResult(_0x51766a,_0xf00024){return function(_0x10835a){if(_0x10835a){var _0x564502=typeof _0xf00024[_0x993e('0x20')]===_0x993e('0x21')&&typeof _0xf00024[_0x993e('0x22')]===_0x993e('0x21');var _0x3ce3a6=_0x10835a[_0x993e('0x23')];var _0x2cfccb=_0x564502?0x0:_0xf00024[_0x993e('0x20')];var _0x11639c=_0x564502?_0x10835a[_0x993e('0x23')]:_0xf00024[_0x993e('0x20')]+_0xf00024['limit'];var _0x2c7ac7;if(_0x11639c>=_0x3ce3a6){_0x11639c=_0x3ce3a6;_0x2c7ac7=0xc8;}else{_0x2c7ac7=0xce;}_0x51766a['status'](_0x2c7ac7);return _0x51766a[_0x993e('0x24')](_0x993e('0x25'),_0x2cfccb+'-'+_0x11639c+'/'+_0x3ce3a6)[_0x993e('0x26')](_0x10835a);}return null;};}function patchUpdates(_0x4c2dae){return function(_0x5dd777){try{jsonpatch[_0x993e('0x27')](_0x5dd777,_0x4c2dae,!![]);}catch(_0x16b27e){return BPromise[_0x993e('0x28')](_0x16b27e);}return _0x5dd777['save']();};}function saveUpdates(_0x557c08,_0xa7cae4){return function(_0x4d6b86){if(_0x4d6b86){return _0x4d6b86['update'](_0x557c08)[_0x993e('0x29')](function(_0x2488d4){return _0x2488d4;});}return null;};}function removeEntity(_0x12fc37,_0x205f74){return function(_0x158027){if(_0x158027){return _0x158027['destroy']()[_0x993e('0x29')](function(){_0x12fc37[_0x993e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fde8f,_0x4a8de4){return function(_0x184a5e){if(!_0x184a5e){_0x1fde8f['sendStatus'](0x194);}return _0x184a5e;};}function handleError(_0x313112,_0xccbe09){_0xccbe09=_0xccbe09||0x1f4;return function(_0x4df3fc){logger[_0x993e('0x2a')](_0x4df3fc[_0x993e('0x2b')]);if(_0x4df3fc[_0x993e('0x2c')]){delete _0x4df3fc['name'];}_0x313112[_0x993e('0x1f')](_0xccbe09)[_0x993e('0x2d')](_0x4df3fc);};}exports[_0x993e('0x2e')]=function(_0x23f338,_0x4a68de){var _0x54f972={},_0x1b49f7={},_0xd1bc14={'count':0x0,'rows':[]};var _0x514bec=_[_0x993e('0x2f')](db[_0x993e('0x30')][_0x993e('0x31')],function(_0x54d0cf){return{'name':_0x54d0cf[_0x993e('0x32')],'type':_0x54d0cf[_0x993e('0x33')][_0x993e('0x34')]};});_0x1b49f7[_0x993e('0x35')]=_['map'](_0x514bec,_0x993e('0x2c'));_0x1b49f7[_0x993e('0x36')]=_[_0x993e('0x37')](_0x23f338[_0x993e('0x36')]);_0x1b49f7[_0x993e('0x38')]=_[_0x993e('0x39')](_0x1b49f7[_0x993e('0x35')],_0x1b49f7['query']);_0x54f972[_0x993e('0x3a')]=_[_0x993e('0x39')](_0x1b49f7['model'],qs[_0x993e('0x3b')](_0x23f338[_0x993e('0x36')][_0x993e('0x3b')]));_0x54f972[_0x993e('0x3a')]=_0x54f972['attributes'][_0x993e('0x3c')]?_0x54f972[_0x993e('0x3a')]:_0x1b49f7[_0x993e('0x35')];if(!_0x23f338['query'][_0x993e('0x3d')](_0x993e('0x3e'))){_0x54f972[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x23f338[_0x993e('0x36')]['limit']);_0x54f972[_0x993e('0x20')]=qs['offset'](_0x23f338[_0x993e('0x36')][_0x993e('0x20')]);}_0x54f972['order']=qs[_0x993e('0x3f')](_0x23f338[_0x993e('0x36')][_0x993e('0x3f')]);_0x54f972[_0x993e('0x40')]=qs[_0x993e('0x38')](_[_0x993e('0x41')](_0x23f338[_0x993e('0x36')],_0x1b49f7[_0x993e('0x38')]),_0x514bec);if(_0x23f338['query'][_0x993e('0x42')]){_0x54f972[_0x993e('0x40')]=_['merge'](_0x54f972['where'],{'$or':_[_0x993e('0x2f')](_0x514bec,function(_0x1e46c5){if(_0x1e46c5[_0x993e('0x33')]!==_0x993e('0x43')){var _0x2bef12={};_0x2bef12[_0x1e46c5[_0x993e('0x2c')]]={'$like':'%'+_0x23f338[_0x993e('0x36')]['filter']+'%'};return _0x2bef12;}})});}_0x54f972=_[_0x993e('0x44')]({},_0x54f972,_0x23f338[_0x993e('0x45')]);var _0x3a3c88={'where':_0x54f972[_0x993e('0x40')]};return db[_0x993e('0x30')][_0x993e('0x23')](_0x3a3c88)[_0x993e('0x29')](function(_0x549d82){_0xd1bc14[_0x993e('0x23')]=_0x549d82;if(_0x23f338[_0x993e('0x36')]['includeAll']){_0x54f972['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x54f972);})[_0x993e('0x29')](function(_0xf0c04a){_0xd1bc14[_0x993e('0x46')]=_0xf0c04a;return _0xd1bc14;})[_0x993e('0x29')](respondWithFilteredResult(_0x4a68de,_0x54f972))[_0x993e('0x47')](handleError(_0x4a68de,null));};exports[_0x993e('0x48')]=function(_0x5dc1b7,_0x1ae59c){var _0x2bf119={'raw':![],'where':{'id':_0x5dc1b7[_0x993e('0x49')]['id']}},_0x471b12={};_0x471b12['model']=_['keys'](db[_0x993e('0x30')][_0x993e('0x31')]);_0x471b12[_0x993e('0x36')]=_['keys'](_0x5dc1b7[_0x993e('0x36')]);_0x471b12[_0x993e('0x38')]=_[_0x993e('0x39')](_0x471b12[_0x993e('0x35')],_0x471b12[_0x993e('0x36')]);_0x2bf119['attributes']=_['intersection'](_0x471b12[_0x993e('0x35')],qs[_0x993e('0x3b')](_0x5dc1b7['query']['fields']));_0x2bf119['attributes']=_0x2bf119['attributes'][_0x993e('0x3c')]?_0x2bf119[_0x993e('0x3a')]:_0x471b12['model'];if(_0x5dc1b7[_0x993e('0x36')][_0x993e('0x4a')]){_0x2bf119['include']=[{'all':!![]}];}_0x2bf119=_[_0x993e('0x44')]({},_0x2bf119,_0x5dc1b7[_0x993e('0x45')]);return db[_0x993e('0x30')][_0x993e('0x4b')](_0x2bf119)[_0x993e('0x29')](handleEntityNotFound(_0x1ae59c,null))['then'](respondWithResult(_0x1ae59c,null))[_0x993e('0x47')](handleError(_0x1ae59c,null));};exports[_0x993e('0x4c')]=function(_0x5b1149,_0x196e37){return db[_0x993e('0x30')][_0x993e('0x4c')](_0x5b1149[_0x993e('0x4d')],{})[_0x993e('0x29')](respondWithResult(_0x196e37,0xc9))[_0x993e('0x47')](handleError(_0x196e37,null));};exports['update']=function(_0x552f4b,_0x4c82e0){if(_0x552f4b[_0x993e('0x4d')]['id']){delete _0x552f4b['body']['id'];}return db[_0x993e('0x30')][_0x993e('0x4b')]({'where':{'id':_0x552f4b[_0x993e('0x49')]['id']}})[_0x993e('0x29')](handleEntityNotFound(_0x4c82e0,null))[_0x993e('0x29')](saveUpdates(_0x552f4b[_0x993e('0x4d')],null))[_0x993e('0x29')](respondWithResult(_0x4c82e0,null))['catch'](handleError(_0x4c82e0,null));};exports[_0x993e('0x4e')]=function(_0x42d16d,_0x3ddb4d){return db[_0x993e('0x30')][_0x993e('0x4b')]({'where':{'id':_0x42d16d[_0x993e('0x49')]['id']}})[_0x993e('0x29')](handleEntityNotFound(_0x3ddb4d,null))[_0x993e('0x29')](removeEntity(_0x3ddb4d,null))[_0x993e('0x47')](handleError(_0x3ddb4d,null));};exports['getFields']=function(_0x4bb88e,_0x33eb12,_0x37ca61){var _0x2dc676={};var _0x2524c2={};var _0x23717d;var _0x4374aa;return db[_0x993e('0x30')]['findOne']({'where':{'id':_0x4bb88e[_0x993e('0x49')]['id']}})[_0x993e('0x29')](handleEntityNotFound(_0x33eb12,null))[_0x993e('0x29')](function(_0x33ab31){if(_0x33ab31){_0x23717d=_0x33ab31;_0x2524c2[_0x993e('0x35')]=_[_0x993e('0x37')](db[_0x993e('0x4f')][_0x993e('0x31')]);_0x2524c2[_0x993e('0x36')]=_[_0x993e('0x37')](_0x4bb88e[_0x993e('0x36')]);_0x2524c2[_0x993e('0x38')]=_[_0x993e('0x39')](_0x2524c2[_0x993e('0x35')],_0x2524c2[_0x993e('0x36')]);_0x2dc676[_0x993e('0x3a')]=_[_0x993e('0x39')](_0x2524c2['model'],qs[_0x993e('0x3b')](_0x4bb88e['query'][_0x993e('0x3b')]));_0x2dc676[_0x993e('0x3a')]=_0x2dc676[_0x993e('0x3a')][_0x993e('0x3c')]?_0x2dc676['attributes']:_0x2524c2[_0x993e('0x35')];_0x2dc676[_0x993e('0x50')]=qs[_0x993e('0x3f')](_0x4bb88e[_0x993e('0x36')][_0x993e('0x3f')]);_0x2dc676['where']=qs['filters'](_[_0x993e('0x41')](_0x4bb88e[_0x993e('0x36')],_0x2524c2['filters']));if(_0x4bb88e[_0x993e('0x36')][_0x993e('0x42')]){_0x2dc676[_0x993e('0x40')]=_[_0x993e('0x44')](_0x2dc676[_0x993e('0x40')],{'$or':_['map'](_0x2dc676[_0x993e('0x3a')],function(_0x43519d){var _0x39525a={};_0x39525a[_0x43519d]={'$like':'%'+_0x4bb88e['query']['filter']+'%'};return _0x39525a;})});}_0x2dc676=_[_0x993e('0x44')]({},_0x2dc676,_0x4bb88e[_0x993e('0x45')]);return _0x23717d[_0x993e('0x51')](_0x2dc676);}})[_0x993e('0x29')](function(_0xa5028b){if(_0xa5028b){_0x4374aa=_0xa5028b['length'];if(!_0x4bb88e[_0x993e('0x36')][_0x993e('0x3d')](_0x993e('0x3e'))){_0x2dc676[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x4bb88e[_0x993e('0x36')]['limit']);_0x2dc676[_0x993e('0x20')]=qs[_0x993e('0x20')](_0x4bb88e[_0x993e('0x36')][_0x993e('0x20')]);}return _0x23717d[_0x993e('0x51')](_0x2dc676);}})[_0x993e('0x29')](function(_0x4951da){if(_0x4951da){return _0x4951da?{'count':_0x4374aa,'rows':_0x4951da}:null;}})[_0x993e('0x29')](respondWithResult(_0x33eb12,null))[_0x993e('0x47')](handleError(_0x33eb12,null));};exports[_0x993e('0x52')]=function(_0xa1d9dc,_0x5051a7,_0x34b234){var _0x13c59b={};var _0x5df963={};var _0x32151f;var _0x2da891;return db[_0x993e('0x30')][_0x993e('0x53')]({'where':{'id':_0xa1d9dc[_0x993e('0x49')]['id']}})['then'](handleEntityNotFound(_0x5051a7,null))[_0x993e('0x29')](function(_0x416d55){if(_0x416d55){_0x32151f=_0x416d55;_0x5df963[_0x993e('0x35')]=_[_0x993e('0x37')](db[_0x993e('0x4f')]['rawAttributes']);_0x5df963['query']=_[_0x993e('0x37')](_0xa1d9dc[_0x993e('0x36')]);_0x5df963['filters']=_[_0x993e('0x39')](_0x5df963[_0x993e('0x35')],_0x5df963['query']);_0x13c59b[_0x993e('0x3a')]=_['intersection'](_0x5df963['model'],qs[_0x993e('0x3b')](_0xa1d9dc[_0x993e('0x36')][_0x993e('0x3b')]));_0x13c59b[_0x993e('0x3a')]=_0x13c59b[_0x993e('0x3a')][_0x993e('0x3c')]?_0x13c59b[_0x993e('0x3a')]:_0x5df963[_0x993e('0x35')];_0x13c59b[_0x993e('0x50')]=qs[_0x993e('0x3f')](_0xa1d9dc[_0x993e('0x36')]['sort']);_0x13c59b[_0x993e('0x40')]=qs[_0x993e('0x38')](_[_0x993e('0x41')](_0xa1d9dc['query'],_0x5df963[_0x993e('0x38')]));if(_0xa1d9dc[_0x993e('0x36')][_0x993e('0x42')]){_0x13c59b[_0x993e('0x40')]=_['merge'](_0x13c59b[_0x993e('0x40')],{'$or':_['map'](_0x13c59b['attributes'],function(_0x214da2){var _0xd3ecda={};_0xd3ecda[_0x214da2]={'$like':'%'+_0xa1d9dc[_0x993e('0x36')][_0x993e('0x42')]+'%'};return _0xd3ecda;})});}_0x13c59b=_[_0x993e('0x44')]({},_0x13c59b,_0xa1d9dc['options']);return _0x32151f['getSubjects'](_0x13c59b);}})['then'](function(_0x50c09e){if(_0x50c09e){_0x2da891=_0x50c09e[_0x993e('0x3c')];if(!_0xa1d9dc[_0x993e('0x36')]['hasOwnProperty']('nolimit')){_0x13c59b[_0x993e('0x22')]=qs[_0x993e('0x22')](_0xa1d9dc[_0x993e('0x36')]['limit']);_0x13c59b[_0x993e('0x20')]=qs[_0x993e('0x20')](_0xa1d9dc[_0x993e('0x36')][_0x993e('0x20')]);}return _0x32151f['getSubjects'](_0x13c59b);}})[_0x993e('0x29')](function(_0x285fc4){if(_0x285fc4){return _0x285fc4?{'count':_0x2da891,'rows':_0x285fc4}:null;}})[_0x993e('0x29')](respondWithResult(_0x5051a7,null))[_0x993e('0x47')](handleError(_0x5051a7,null));};exports[_0x993e('0x54')]=function(_0x342dec,_0x125835,_0x550128){var _0x2df57e={};var _0x4a26fe={};var _0x3ee855;var _0x4cdcd1;return db[_0x993e('0x30')][_0x993e('0x53')]({'where':{'id':_0x342dec[_0x993e('0x49')]['id']}})[_0x993e('0x29')](handleEntityNotFound(_0x125835,null))[_0x993e('0x29')](function(_0x2e1995){if(_0x2e1995){_0x3ee855=_0x2e1995;_0x4a26fe[_0x993e('0x35')]=_[_0x993e('0x37')](db['Dynamics365Field'][_0x993e('0x31')]);_0x4a26fe[_0x993e('0x36')]=_[_0x993e('0x37')](_0x342dec[_0x993e('0x36')]);_0x4a26fe[_0x993e('0x38')]=_[_0x993e('0x39')](_0x4a26fe[_0x993e('0x35')],_0x4a26fe[_0x993e('0x36')]);_0x2df57e['attributes']=_['intersection'](_0x4a26fe[_0x993e('0x35')],qs[_0x993e('0x3b')](_0x342dec[_0x993e('0x36')]['fields']));_0x2df57e['attributes']=_0x2df57e[_0x993e('0x3a')]['length']?_0x2df57e['attributes']:_0x4a26fe[_0x993e('0x35')];_0x2df57e['order']=qs[_0x993e('0x3f')](_0x342dec[_0x993e('0x36')]['sort']);_0x2df57e[_0x993e('0x40')]=qs[_0x993e('0x38')](_[_0x993e('0x41')](_0x342dec['query'],_0x4a26fe['filters']));if(_0x342dec[_0x993e('0x36')][_0x993e('0x42')]){_0x2df57e[_0x993e('0x40')]=_[_0x993e('0x44')](_0x2df57e[_0x993e('0x40')],{'$or':_[_0x993e('0x2f')](_0x2df57e[_0x993e('0x3a')],function(_0x261ad7){var _0x4f3331={};_0x4f3331[_0x261ad7]={'$like':'%'+_0x342dec[_0x993e('0x36')][_0x993e('0x42')]+'%'};return _0x4f3331;})});}_0x2df57e=_[_0x993e('0x44')]({},_0x2df57e,_0x342dec['options']);return _0x3ee855[_0x993e('0x54')](_0x2df57e);}})[_0x993e('0x29')](function(_0x226bee){if(_0x226bee){_0x4cdcd1=_0x226bee[_0x993e('0x3c')];if(!_0x342dec[_0x993e('0x36')][_0x993e('0x3d')](_0x993e('0x3e'))){_0x2df57e['limit']=qs['limit'](_0x342dec[_0x993e('0x36')][_0x993e('0x22')]);_0x2df57e[_0x993e('0x20')]=qs['offset'](_0x342dec[_0x993e('0x36')][_0x993e('0x20')]);}return _0x3ee855['getDescriptions'](_0x2df57e);}})[_0x993e('0x29')](function(_0x3a776c){if(_0x3a776c){return _0x3a776c?{'count':_0x4cdcd1,'rows':_0x3a776c}:null;}})[_0x993e('0x29')](respondWithResult(_0x125835,null))[_0x993e('0x47')](handleError(_0x125835,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7e59cb8..1f9d606 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 _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x214b2b,_0x1986db){var _0xae84ee=function(_0xe6aff0){while(--_0xe6aff0){_0x214b2b['push'](_0x214b2b['shift']());}};_0xae84ee(++_0x1986db);}(_0xa41a,0x6b));var _0xaa41=function(_0x1743eb,_0x36332c){_0x1743eb=_0x1743eb-0x0;var _0x11895d=_0xa41a[_0x1743eb];return _0x11895d;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x374320,_0x55464d){var _0x6a96c9=function(_0x3231a8){while(--_0x3231a8){_0x374320['push'](_0x374320['shift']());}};_0x6a96c9(++_0x55464d);}(_0xaa88,0x137));var _0x8aa8=function(_0x47e309,_0x1e771a){_0x47e309=_0x47e309-0x0;var _0x2e1900=_0xaa88[_0x47e309];return _0x2e1900;};'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/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 7bf123b..21a0691 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 _0x1022=['info','debug','request\x20sent','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3a8c49,_0x19a5b2){var _0x5cb9eb=function(_0x23c1dd){while(--_0x23c1dd){_0x3a8c49['push'](_0x3a8c49['shift']());}};_0x5cb9eb(++_0x19a5b2);}(_0x1022,0xcf));var _0x2102=function(_0x5d465d,_0x21b8ef){_0x5d465d=_0x5d465d-0x0;var _0x272927=_0x1022[_0x5d465d];return _0x272927;};'use strict';var _=require(_0x2102('0x0'));var util=require('util');var moment=require(_0x2102('0x1'));var BPromise=require(_0x2102('0x2'));var rs=require(_0x2102('0x3'));var fs=require('fs');var Redis=require(_0x2102('0x4'));var db=require(_0x2102('0x5'))['db'];var utils=require(_0x2102('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2102('0x7'));var jayson=require(_0x2102('0x8'));var client=jayson[_0x2102('0x9')][_0x2102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a06,_0x43a84d,_0x302814){return new BPromise(function(_0x1089b7,_0xabbf21){return client[_0x2102('0xb')](_0x227a06,_0x302814)[_0x2102('0xc')](function(_0x13a866){logger[_0x2102('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43a84d,'request\x20sent');logger[_0x2102('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x43a84d,_0x2102('0xf'),JSON[_0x2102('0x10')](_0x13a866));if(_0x13a866[_0x2102('0x11')]){if(_0x13a866[_0x2102('0x11')][_0x2102('0x12')]===0x1f4){logger[_0x2102('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43a84d,_0x13a866[_0x2102('0x11')][_0x2102('0x13')]);return _0xabbf21(_0x13a866['error']['message']);}logger[_0x2102('0x11')](_0x2102('0x14'),_0x43a84d,_0x13a866[_0x2102('0x11')]['message']);return _0x1089b7(_0x13a866[_0x2102('0x11')]['message']);}else{logger['info'](_0x2102('0x14'),_0x43a84d,_0x2102('0xf'));_0x1089b7(_0x13a866['result'][_0x2102('0x13')]);}})[_0x2102('0x15')](function(_0x4ad9d1){logger[_0x2102('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43a84d,_0x4ad9d1);_0xabbf21(_0x4ad9d1);});});} \ No newline at end of file +var _0xc796=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x40c763,_0x5386c0){var _0x14e3b6=function(_0x44f6dc){while(--_0x44f6dc){_0x40c763['push'](_0x40c763['shift']());}};_0x14e3b6(++_0x5386c0);}(_0xc796,0x1a3));var _0x6c79=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0xc796[_0xab0515];return _0x443d59;};'use strict';var _=require(_0x6c79('0x0'));var util=require(_0x6c79('0x1'));var moment=require(_0x6c79('0x2'));var BPromise=require(_0x6c79('0x3'));var rs=require(_0x6c79('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c79('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c79('0x6'))('rpc');var config=require(_0x6c79('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6c79('0x8')][_0x6c79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eeeda,_0x46246b,_0x8faa3b){return new BPromise(function(_0x5c6ab6,_0x1aaa74){return client['request'](_0x2eeeda,_0x8faa3b)['then'](function(_0x39b52a){logger[_0x6c79('0xa')](_0x6c79('0xb'),_0x46246b,_0x6c79('0xc'));logger[_0x6c79('0xd')](_0x6c79('0xe'),_0x46246b,_0x6c79('0xc'),JSON['stringify'](_0x39b52a));if(_0x39b52a[_0x6c79('0xf')]){if(_0x39b52a[_0x6c79('0xf')][_0x6c79('0x10')]===0x1f4){logger[_0x6c79('0xf')](_0x6c79('0xb'),_0x46246b,_0x39b52a['error'][_0x6c79('0x11')]);return _0x1aaa74(_0x39b52a[_0x6c79('0xf')][_0x6c79('0x11')]);}logger[_0x6c79('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x46246b,_0x39b52a[_0x6c79('0xf')][_0x6c79('0x11')]);return _0x5c6ab6(_0x39b52a['error'][_0x6c79('0x11')]);}else{logger[_0x6c79('0xa')](_0x6c79('0xb'),_0x46246b,_0x6c79('0xc'));_0x5c6ab6(_0x39b52a['result'][_0x6c79('0x11')]);}})['catch'](function(_0x3096b5){logger[_0x6c79('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x46246b,_0x3096b5);_0x1aaa74(_0x3096b5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 792dfe2..2a7bb7a 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 _0x8219=['show','isAuthenticated','create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','index','/:id'];(function(_0xb06354,_0x464d11){var _0x44da6c=function(_0x1c900f){while(--_0x1c900f){_0xb06354['push'](_0xb06354['shift']());}};_0x44da6c(++_0x464d11);}(_0x8219,0x149));var _0x9821=function(_0x2929ba,_0x506aa6){_0x2929ba=_0x2929ba-0x0;var _0x365e6e=_0x8219[_0x2929ba];return _0x365e6e;};'use strict';var multer=require(_0x9821('0x0'));var util=require(_0x9821('0x1'));var path=require(_0x9821('0x2'));var timeout=require(_0x9821('0x3'));var express=require(_0x9821('0x4'));var router=express[_0x9821('0x5')]();var fs_extra=require(_0x9821('0x6'));var auth=require(_0x9821('0x7'));var interaction=require(_0x9821('0x8'));var config=require(_0x9821('0x9'));var controller=require(_0x9821('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x9821('0xb')]);router['get'](_0x9821('0xc'),auth['isAuthenticated'](),controller[_0x9821('0xd')]);router['post']('/',auth[_0x9821('0xe')](),controller[_0x9821('0xf')]);router['put']('/:id',auth[_0x9821('0xe')](),controller['update']);router['delete'](_0x9821('0xc'),auth[_0x9821('0xe')](),controller[_0x9821('0x10')]);module[_0x9821('0x11')]=router; \ No newline at end of file +var _0x8123=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x25e2a5,_0x2d7270){var _0x429243=function(_0x16853){while(--_0x16853){_0x25e2a5['push'](_0x25e2a5['shift']());}};_0x429243(++_0x2d7270);}(_0x8123,0x10d));var _0x3812=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8123[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x3812('0x0'));var util=require(_0x3812('0x1'));var path=require('path');var timeout=require(_0x3812('0x2'));var express=require('express');var router=express[_0x3812('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3812('0x4'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x3812('0x5')]('/',auth[_0x3812('0x6')](),controller[_0x3812('0x7')]);router['get'](_0x3812('0x8'),auth[_0x3812('0x6')](),controller[_0x3812('0x9')]);router[_0x3812('0xa')]('/',auth[_0x3812('0x6')](),controller[_0x3812('0xb')]);router[_0x3812('0xc')](_0x3812('0x8'),auth[_0x3812('0x6')](),controller[_0x3812('0xd')]);router['delete'](_0x3812('0x8'),auth[_0x3812('0x6')](),controller[_0x3812('0xe')]);module[_0x3812('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index dea82f0..2898dda 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 _0xec02=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x405600,_0x19dd0c){var _0x168eb4=function(_0x1cf172){while(--_0x1cf172){_0x405600['push'](_0x405600['shift']());}};_0x168eb4(++_0x19dd0c);}(_0xec02,0x171));var _0x2ec0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xec02[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x2ec0('0x0'));module[_0x2ec0('0x1')]={'type':{'type':Sequelize[_0x2ec0('0x2')](_0x2ec0('0x3'),'variable',_0x2ec0('0x4'),_0x2ec0('0x5'),_0x2ec0('0x6')),'defaultValue':_0x2ec0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2ec0('0x7')]},'keyType':{'type':Sequelize[_0x2ec0('0x2')]('string',_0x2ec0('0x8'),_0x2ec0('0x4'))},'keyContent':{'type':Sequelize[_0x2ec0('0x7')]},'idField':{'type':Sequelize[_0x2ec0('0x7')]},'nameField':{'type':Sequelize[_0x2ec0('0x7')]},'customField':{'type':Sequelize[_0x2ec0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ec0('0x7')]}}; \ No newline at end of file +var _0xecc7=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xecc7,0x1df));var _0x7ecc=function(_0x5407ab,_0x1c4865){_0x5407ab=_0x5407ab-0x0;var _0x1d79e9=_0xecc7[_0x5407ab];return _0x1d79e9;};'use strict';var Sequelize=require('sequelize');module[_0x7ecc('0x0')]={'type':{'type':Sequelize[_0x7ecc('0x1')](_0x7ecc('0x2'),_0x7ecc('0x3'),_0x7ecc('0x4'),_0x7ecc('0x5'),_0x7ecc('0x6')),'defaultValue':_0x7ecc('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7ecc('0x2'),_0x7ecc('0x3'),_0x7ecc('0x4'))},'keyContent':{'type':Sequelize[_0x7ecc('0x7')]},'idField':{'type':Sequelize[_0x7ecc('0x7')]},'nameField':{'type':Sequelize[_0x7ecc('0x7')]},'customField':{'type':Sequelize[_0x7ecc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7ecc('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 99e02ea..19dce63 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 _0x1929=['attributes','fields','model','order','where','filters','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','keys','query'];(function(_0x5a3051,_0x468e1b){var _0x3d24b7=function(_0x2d8af5){while(--_0x2d8af5){_0x5a3051['push'](_0x5a3051['shift']());}};_0x3d24b7(++_0x468e1b);}(_0x1929,0xed));var _0x9192=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x1929[_0x1d2bbb];return _0x38082b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9192('0x0'));var jsonpatch=require(_0x9192('0x1'));var rp=require(_0x9192('0x2'));var moment=require(_0x9192('0x3'));var BPromise=require(_0x9192('0x4'));var Mustache=require('mustache');var util=require(_0x9192('0x5'));var path=require(_0x9192('0x6'));var sox=require(_0x9192('0x7'));var csv=require(_0x9192('0x8'));var ejs=require(_0x9192('0x9'));var fs=require('fs');var fs_extra=require(_0x9192('0xa'));var _=require(_0x9192('0xb'));var squel=require(_0x9192('0xc'));var crypto=require(_0x9192('0xd'));var jsforce=require(_0x9192('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9192('0x8'));var querystring=require(_0x9192('0xf'));var Papa=require(_0x9192('0x10'));var Redis=require(_0x9192('0x11'));var authService=require(_0x9192('0x12'));var qs=require(_0x9192('0x13'));var as=require(_0x9192('0x14'));var hardwareService=require(_0x9192('0x15'));var logger=require(_0x9192('0x16'))(_0x9192('0x17'));var utils=require('../../config/utils');var config=require(_0x9192('0x18'));var licenseUtil=require(_0x9192('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d2b99,_0x59a6b0){_0x59a6b0=_0x59a6b0||0xcc;return function(_0x422d14){if(_0x422d14){return _0x2d2b99[_0x9192('0x1a')](_0x59a6b0);}return _0x2d2b99[_0x9192('0x1b')](_0x59a6b0)[_0x9192('0x1c')]();};}function respondWithResult(_0x413d13,_0x59aa47){_0x59aa47=_0x59aa47||0xc8;return function(_0xf640c0){if(_0xf640c0){return _0x413d13[_0x9192('0x1b')](_0x59aa47)['json'](_0xf640c0);}};}function respondWithFilteredResult(_0x2031e9,_0x193202){return function(_0x233356){if(_0x233356){var _0x3b1f62=typeof _0x193202['offset']==='undefined'&&typeof _0x193202[_0x9192('0x1d')]==='undefined';var _0x59b01d=_0x233356['count'];var _0x1564d5=_0x3b1f62?0x0:_0x193202[_0x9192('0x1e')];var _0x5c7825=_0x3b1f62?_0x233356[_0x9192('0x1f')]:_0x193202[_0x9192('0x1e')]+_0x193202[_0x9192('0x1d')];var _0x5b6b4e;if(_0x5c7825>=_0x59b01d){_0x5c7825=_0x59b01d;_0x5b6b4e=0xc8;}else{_0x5b6b4e=0xce;}_0x2031e9['status'](_0x5b6b4e);return _0x2031e9[_0x9192('0x20')](_0x9192('0x21'),_0x1564d5+'-'+_0x5c7825+'/'+_0x59b01d)['json'](_0x233356);}return null;};}function patchUpdates(_0x43edee){return function(_0x157810){try{jsonpatch[_0x9192('0x22')](_0x157810,_0x43edee,!![]);}catch(_0x140863){return BPromise[_0x9192('0x23')](_0x140863);}return _0x157810[_0x9192('0x24')]();};}function saveUpdates(_0x4a8956,_0x46dbe1){return function(_0x5cac6b){if(_0x5cac6b){return _0x5cac6b[_0x9192('0x25')](_0x4a8956)[_0x9192('0x26')](function(_0x1b7445){return _0x1b7445;});}return null;};}function removeEntity(_0x237152,_0x3d37ce){return function(_0xd6e9a5){if(_0xd6e9a5){return _0xd6e9a5['destroy']()[_0x9192('0x26')](function(){_0x237152['status'](0xcc)[_0x9192('0x1c')]();});}};}function handleEntityNotFound(_0x2f78cb,_0x8a77df){return function(_0x1e43fd){if(!_0x1e43fd){_0x2f78cb[_0x9192('0x1a')](0x194);}return _0x1e43fd;};}function handleError(_0x562421,_0x15e46b){_0x15e46b=_0x15e46b||0x1f4;return function(_0x5ad57b){logger[_0x9192('0x27')](_0x5ad57b[_0x9192('0x28')]);if(_0x5ad57b['name']){delete _0x5ad57b[_0x9192('0x29')];}_0x562421[_0x9192('0x1b')](_0x15e46b)[_0x9192('0x2a')](_0x5ad57b);};}exports[_0x9192('0x2b')]=function(_0x16d469,_0x4dc81c){var _0x2e611b={},_0x40893d={},_0x23edb4={'count':0x0,'rows':[]};var _0x48703c=_[_0x9192('0x2c')](db[_0x9192('0x2d')][_0x9192('0x2e')],function(_0x271eae){return{'name':_0x271eae[_0x9192('0x2f')],'type':_0x271eae[_0x9192('0x30')]['key']};});_0x40893d['model']=_[_0x9192('0x2c')](_0x48703c,_0x9192('0x29'));_0x40893d['query']=_[_0x9192('0x31')](_0x16d469[_0x9192('0x32')]);_0x40893d['filters']=_['intersection'](_0x40893d['model'],_0x40893d[_0x9192('0x32')]);_0x2e611b[_0x9192('0x33')]=_['intersection'](_0x40893d['model'],qs['fields'](_0x16d469[_0x9192('0x32')][_0x9192('0x34')]));_0x2e611b[_0x9192('0x33')]=_0x2e611b[_0x9192('0x33')]['length']?_0x2e611b[_0x9192('0x33')]:_0x40893d[_0x9192('0x35')];if(!_0x16d469[_0x9192('0x32')]['hasOwnProperty']('nolimit')){_0x2e611b[_0x9192('0x1d')]=qs['limit'](_0x16d469[_0x9192('0x32')][_0x9192('0x1d')]);_0x2e611b['offset']=qs[_0x9192('0x1e')](_0x16d469['query'][_0x9192('0x1e')]);}_0x2e611b[_0x9192('0x36')]=qs['sort'](_0x16d469[_0x9192('0x32')]['sort']);_0x2e611b[_0x9192('0x37')]=qs[_0x9192('0x38')](_['pick'](_0x16d469[_0x9192('0x32')],_0x40893d['filters']),_0x48703c);if(_0x16d469[_0x9192('0x32')]['filter']){_0x2e611b[_0x9192('0x37')]=_[_0x9192('0x39')](_0x2e611b[_0x9192('0x37')],{'$or':_[_0x9192('0x2c')](_0x48703c,function(_0x5c2ba7){if(_0x5c2ba7[_0x9192('0x30')]!==_0x9192('0x3a')){var _0x3886ff={};_0x3886ff[_0x5c2ba7[_0x9192('0x29')]]={'$like':'%'+_0x16d469[_0x9192('0x32')]['filter']+'%'};return _0x3886ff;}})});}_0x2e611b=_[_0x9192('0x39')]({},_0x2e611b,_0x16d469[_0x9192('0x3b')]);var _0x4acf16={'where':_0x2e611b[_0x9192('0x37')]};return db[_0x9192('0x2d')]['count'](_0x4acf16)['then'](function(_0x61114e){_0x23edb4[_0x9192('0x1f')]=_0x61114e;if(_0x16d469['query'][_0x9192('0x3c')]){_0x2e611b[_0x9192('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x2e611b);})['then'](function(_0x3bd000){_0x23edb4[_0x9192('0x3e')]=_0x3bd000;return _0x23edb4;})['then'](respondWithFilteredResult(_0x4dc81c,_0x2e611b))[_0x9192('0x3f')](handleError(_0x4dc81c,null));};exports[_0x9192('0x40')]=function(_0x5fe960,_0x589f3f){var _0x1d6db2={'raw':!![],'where':{'id':_0x5fe960[_0x9192('0x41')]['id']}},_0x12f9b9={};_0x12f9b9[_0x9192('0x35')]=_['keys'](db[_0x9192('0x2d')][_0x9192('0x2e')]);_0x12f9b9[_0x9192('0x32')]=_[_0x9192('0x31')](_0x5fe960[_0x9192('0x32')]);_0x12f9b9[_0x9192('0x38')]=_[_0x9192('0x42')](_0x12f9b9[_0x9192('0x35')],_0x12f9b9[_0x9192('0x32')]);_0x1d6db2[_0x9192('0x33')]=_['intersection'](_0x12f9b9[_0x9192('0x35')],qs['fields'](_0x5fe960[_0x9192('0x32')]['fields']));_0x1d6db2[_0x9192('0x33')]=_0x1d6db2[_0x9192('0x33')][_0x9192('0x43')]?_0x1d6db2[_0x9192('0x33')]:_0x12f9b9[_0x9192('0x35')];if(_0x5fe960['query'][_0x9192('0x3c')]){_0x1d6db2[_0x9192('0x3d')]=[{'all':!![]}];}_0x1d6db2=_[_0x9192('0x39')]({},_0x1d6db2,_0x5fe960[_0x9192('0x3b')]);return db[_0x9192('0x2d')][_0x9192('0x44')](_0x1d6db2)[_0x9192('0x26')](handleEntityNotFound(_0x589f3f,null))[_0x9192('0x26')](respondWithResult(_0x589f3f,null))['catch'](handleError(_0x589f3f,null));};exports[_0x9192('0x45')]=function(_0x408b89,_0x19b7a9){return db[_0x9192('0x2d')][_0x9192('0x45')](_0x408b89[_0x9192('0x46')],{})[_0x9192('0x26')](respondWithResult(_0x19b7a9,0xc9))[_0x9192('0x3f')](handleError(_0x19b7a9,null));};exports[_0x9192('0x25')]=function(_0xdb188e,_0x57df06){if(_0xdb188e['body']['id']){delete _0xdb188e[_0x9192('0x46')]['id'];}return db[_0x9192('0x2d')][_0x9192('0x44')]({'where':{'id':_0xdb188e[_0x9192('0x41')]['id']}})[_0x9192('0x26')](handleEntityNotFound(_0x57df06,null))['then'](saveUpdates(_0xdb188e[_0x9192('0x46')],null))['then'](respondWithResult(_0x57df06,null))[_0x9192('0x3f')](handleError(_0x57df06,null));};exports[_0x9192('0x47')]=function(_0x5e0b0c,_0xb5ed62){return db[_0x9192('0x2d')]['find']({'where':{'id':_0x5e0b0c[_0x9192('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5ed62,null))[_0x9192('0x26')](removeEntity(_0xb5ed62,null))[_0x9192('0x3f')](handleError(_0xb5ed62,null));}; \ No newline at end of file +var _0x63b3=['show','params','length','includeAll','find','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','end','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','Dynamics365Field','include','catch'];(function(_0x867f95,_0x43d423){var _0x4cd98d=function(_0x85348e){while(--_0x85348e){_0x867f95['push'](_0x867f95['shift']());}};_0x4cd98d(++_0x43d423);}(_0x63b3,0xdf));var _0x363b=function(_0x17cffd,_0x545117){_0x17cffd=_0x17cffd-0x0;var _0x9f0892=_0x63b3[_0x17cffd];return _0x9f0892;};'use strict';var emlformat=require(_0x363b('0x0'));var rimraf=require(_0x363b('0x1'));var zipdir=require(_0x363b('0x2'));var jsonpatch=require(_0x363b('0x3'));var rp=require(_0x363b('0x4'));var moment=require(_0x363b('0x5'));var BPromise=require(_0x363b('0x6'));var Mustache=require(_0x363b('0x7'));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(_0x363b('0x8'));var _=require('lodash');var squel=require(_0x363b('0x9'));var crypto=require(_0x363b('0xa'));var jsforce=require(_0x363b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x363b('0xc'));var querystring=require(_0x363b('0xd'));var Papa=require(_0x363b('0xe'));var Redis=require('ioredis');var authService=require(_0x363b('0xf'));var qs=require(_0x363b('0x10'));var as=require(_0x363b('0x11'));var hardwareService=require(_0x363b('0x12'));var logger=require(_0x363b('0x13'))(_0x363b('0x14'));var utils=require(_0x363b('0x15'));var config=require(_0x363b('0x16'));var licenseUtil=require(_0x363b('0x17'));var db=require(_0x363b('0x18'))['db'];function respondWithStatusCode(_0xef3d00,_0x44dea0){_0x44dea0=_0x44dea0||0xcc;return function(_0xd9ca6f){if(_0xd9ca6f){return _0xef3d00['sendStatus'](_0x44dea0);}return _0xef3d00[_0x363b('0x19')](_0x44dea0)['end']();};}function respondWithResult(_0x8c89c5,_0x2edda4){_0x2edda4=_0x2edda4||0xc8;return function(_0x50b571){if(_0x50b571){return _0x8c89c5['status'](_0x2edda4)[_0x363b('0x1a')](_0x50b571);}};}function respondWithFilteredResult(_0x58df5f,_0xacd846){return function(_0x4c904c){if(_0x4c904c){var _0x2f07c3=typeof _0xacd846[_0x363b('0x1b')]===_0x363b('0x1c')&&typeof _0xacd846['limit']===_0x363b('0x1c');var _0x306b80=_0x4c904c[_0x363b('0x1d')];var _0x5566b2=_0x2f07c3?0x0:_0xacd846[_0x363b('0x1b')];var _0x961430=_0x2f07c3?_0x4c904c[_0x363b('0x1d')]:_0xacd846[_0x363b('0x1b')]+_0xacd846[_0x363b('0x1e')];var _0x381662;if(_0x961430>=_0x306b80){_0x961430=_0x306b80;_0x381662=0xc8;}else{_0x381662=0xce;}_0x58df5f[_0x363b('0x19')](_0x381662);return _0x58df5f[_0x363b('0x1f')]('Content-Range',_0x5566b2+'-'+_0x961430+'/'+_0x306b80)['json'](_0x4c904c);}return null;};}function patchUpdates(_0x2625da){return function(_0x40a25b){try{jsonpatch[_0x363b('0x20')](_0x40a25b,_0x2625da,!![]);}catch(_0x5b3d61){return BPromise[_0x363b('0x21')](_0x5b3d61);}return _0x40a25b[_0x363b('0x22')]();};}function saveUpdates(_0x4b20de,_0x5361b4){return function(_0x426750){if(_0x426750){return _0x426750['update'](_0x4b20de)['then'](function(_0x43d54e){return _0x43d54e;});}return null;};}function removeEntity(_0x5caac5,_0x2fbdcf){return function(_0x16bd06){if(_0x16bd06){return _0x16bd06[_0x363b('0x23')]()[_0x363b('0x24')](function(){_0x5caac5[_0x363b('0x19')](0xcc)[_0x363b('0x25')]();});}};}function handleEntityNotFound(_0x10cb8a,_0x4ec252){return function(_0x481931){if(!_0x481931){_0x10cb8a[_0x363b('0x26')](0x194);}return _0x481931;};}function handleError(_0xa617d6,_0x793653){_0x793653=_0x793653||0x1f4;return function(_0x15ff8f){logger[_0x363b('0x27')](_0x15ff8f['stack']);if(_0x15ff8f['name']){delete _0x15ff8f[_0x363b('0x28')];}_0xa617d6['status'](_0x793653)[_0x363b('0x29')](_0x15ff8f);};}exports['index']=function(_0x1a9ce7,_0x53912a){var _0x3dc0ca={},_0x318dd7={},_0x246a10={'count':0x0,'rows':[]};var _0x567b50=_[_0x363b('0x2a')](db['Dynamics365Field'][_0x363b('0x2b')],function(_0x4c9cee){return{'name':_0x4c9cee[_0x363b('0x2c')],'type':_0x4c9cee[_0x363b('0x2d')][_0x363b('0x2e')]};});_0x318dd7[_0x363b('0x2f')]=_[_0x363b('0x2a')](_0x567b50,_0x363b('0x28'));_0x318dd7[_0x363b('0x30')]=_[_0x363b('0x31')](_0x1a9ce7[_0x363b('0x30')]);_0x318dd7[_0x363b('0x32')]=_[_0x363b('0x33')](_0x318dd7[_0x363b('0x2f')],_0x318dd7['query']);_0x3dc0ca[_0x363b('0x34')]=_[_0x363b('0x33')](_0x318dd7[_0x363b('0x2f')],qs[_0x363b('0x35')](_0x1a9ce7[_0x363b('0x30')][_0x363b('0x35')]));_0x3dc0ca[_0x363b('0x34')]=_0x3dc0ca[_0x363b('0x34')]['length']?_0x3dc0ca['attributes']:_0x318dd7[_0x363b('0x2f')];if(!_0x1a9ce7[_0x363b('0x30')][_0x363b('0x36')](_0x363b('0x37'))){_0x3dc0ca[_0x363b('0x1e')]=qs['limit'](_0x1a9ce7['query'][_0x363b('0x1e')]);_0x3dc0ca[_0x363b('0x1b')]=qs[_0x363b('0x1b')](_0x1a9ce7[_0x363b('0x30')]['offset']);}_0x3dc0ca[_0x363b('0x38')]=qs[_0x363b('0x39')](_0x1a9ce7[_0x363b('0x30')][_0x363b('0x39')]);_0x3dc0ca['where']=qs['filters'](_['pick'](_0x1a9ce7[_0x363b('0x30')],_0x318dd7[_0x363b('0x32')]),_0x567b50);if(_0x1a9ce7['query'][_0x363b('0x3a')]){_0x3dc0ca[_0x363b('0x3b')]=_[_0x363b('0x3c')](_0x3dc0ca[_0x363b('0x3b')],{'$or':_['map'](_0x567b50,function(_0xe7ad27){if(_0xe7ad27['type']!=='VIRTUAL'){var _0x5a337c={};_0x5a337c[_0xe7ad27['name']]={'$like':'%'+_0x1a9ce7[_0x363b('0x30')][_0x363b('0x3a')]+'%'};return _0x5a337c;}})});}_0x3dc0ca=_[_0x363b('0x3c')]({},_0x3dc0ca,_0x1a9ce7[_0x363b('0x3d')]);var _0x5eab19={'where':_0x3dc0ca[_0x363b('0x3b')]};return db[_0x363b('0x3e')][_0x363b('0x1d')](_0x5eab19)[_0x363b('0x24')](function(_0x5b92b8){_0x246a10[_0x363b('0x1d')]=_0x5b92b8;if(_0x1a9ce7[_0x363b('0x30')]['includeAll']){_0x3dc0ca[_0x363b('0x3f')]=[{'all':!![]}];}return db[_0x363b('0x3e')]['findAll'](_0x3dc0ca);})[_0x363b('0x24')](function(_0x4ef699){_0x246a10['rows']=_0x4ef699;return _0x246a10;})[_0x363b('0x24')](respondWithFilteredResult(_0x53912a,_0x3dc0ca))[_0x363b('0x40')](handleError(_0x53912a,null));};exports[_0x363b('0x41')]=function(_0x3599c0,_0x58aedf){var _0x3fae4b={'raw':!![],'where':{'id':_0x3599c0[_0x363b('0x42')]['id']}},_0x17198a={};_0x17198a[_0x363b('0x2f')]=_[_0x363b('0x31')](db['Dynamics365Field'][_0x363b('0x2b')]);_0x17198a[_0x363b('0x30')]=_['keys'](_0x3599c0[_0x363b('0x30')]);_0x17198a[_0x363b('0x32')]=_['intersection'](_0x17198a[_0x363b('0x2f')],_0x17198a[_0x363b('0x30')]);_0x3fae4b[_0x363b('0x34')]=_[_0x363b('0x33')](_0x17198a['model'],qs['fields'](_0x3599c0['query'][_0x363b('0x35')]));_0x3fae4b[_0x363b('0x34')]=_0x3fae4b['attributes'][_0x363b('0x43')]?_0x3fae4b[_0x363b('0x34')]:_0x17198a[_0x363b('0x2f')];if(_0x3599c0[_0x363b('0x30')][_0x363b('0x44')]){_0x3fae4b[_0x363b('0x3f')]=[{'all':!![]}];}_0x3fae4b=_[_0x363b('0x3c')]({},_0x3fae4b,_0x3599c0['options']);return db[_0x363b('0x3e')][_0x363b('0x45')](_0x3fae4b)[_0x363b('0x24')](handleEntityNotFound(_0x58aedf,null))['then'](respondWithResult(_0x58aedf,null))[_0x363b('0x40')](handleError(_0x58aedf,null));};exports['create']=function(_0x3d79fb,_0x36690f){return db[_0x363b('0x3e')]['create'](_0x3d79fb['body'],{})['then'](respondWithResult(_0x36690f,0xc9))[_0x363b('0x40')](handleError(_0x36690f,null));};exports[_0x363b('0x46')]=function(_0x4c399a,_0x5f251e){if(_0x4c399a[_0x363b('0x47')]['id']){delete _0x4c399a['body']['id'];}return db['Dynamics365Field'][_0x363b('0x45')]({'where':{'id':_0x4c399a[_0x363b('0x42')]['id']}})[_0x363b('0x24')](handleEntityNotFound(_0x5f251e,null))[_0x363b('0x24')](saveUpdates(_0x4c399a[_0x363b('0x47')],null))['then'](respondWithResult(_0x5f251e,null))[_0x363b('0x40')](handleError(_0x5f251e,null));};exports['destroy']=function(_0x2c099e,_0x2e68a0){return db[_0x363b('0x3e')][_0x363b('0x45')]({'where':{'id':_0x2c099e[_0x363b('0x42')]['id']}})[_0x363b('0x24')](handleEntityNotFound(_0x2e68a0,null))[_0x363b('0x24')](removeEntity(_0x2e68a0,null))[_0x363b('0x40')](handleError(_0x2e68a0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index aa5d95b..f989ddd 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 _0x88da=['exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x21c594,_0x49eafe){var _0x5c9c00=function(_0x471d68){while(--_0x471d68){_0x21c594['push'](_0x21c594['shift']());}};_0x5c9c00(++_0x49eafe);}(_0x88da,0x13a));var _0xa88d=function(_0x20fafb,_0x16e9a2){_0x20fafb=_0x20fafb-0x0;var _0x2e0a54=_0x88da[_0x20fafb];return _0x2e0a54;};'use strict';var _=require(_0xa88d('0x0'));var util=require(_0xa88d('0x1'));var logger=require(_0xa88d('0x2'))(_0xa88d('0x3'));var moment=require(_0xa88d('0x4'));var BPromise=require(_0xa88d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa88d('0x6'));var rimraf=require('rimraf');var config=require(_0xa88d('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0xa88d('0x8')]=function(_0x52ffb5,_0x351f94){return _0x52ffb5[_0xa88d('0x9')](_0xa88d('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xa88d('0xb'),'fields':[_0xa88d('0xc'),_0xa88d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb8a=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','exports'];(function(_0x400a4f,_0x302b31){var _0x2d0335=function(_0x3d0955){while(--_0x3d0955){_0x400a4f['push'](_0x400a4f['shift']());}};_0x2d0335(++_0x302b31);}(_0xcb8a,0xf3));var _0xacb8=function(_0x2d97ac,_0x41e63e){_0x2d97ac=_0x2d97ac-0x0;var _0x5acd9f=_0xcb8a[_0x2d97ac];return _0x5acd9f;};'use strict';var _=require('lodash');var util=require(_0xacb8('0x0'));var logger=require(_0xacb8('0x1'))(_0xacb8('0x2'));var moment=require(_0xacb8('0x3'));var BPromise=require(_0xacb8('0x4'));var rp=require(_0xacb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacb8('0x6'));var config=require('../../config/environment');var attributes=require(_0xacb8('0x7'));module[_0xacb8('0x8')]=function(_0x5830ed,_0x5a05f4){return _0x5830ed[_0xacb8('0x9')](_0xacb8('0xa'),attributes,{'tableName':_0xacb8('0xb'),'paranoid':![],'indexes':[{'name':_0xacb8('0xc'),'fields':['idField',_0xacb8('0xd')],'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 bd25bae..7e052c3 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 _0x1da3=['http','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x292c84,_0x395fa5){var _0x51ad06=function(_0x362850){while(--_0x362850){_0x292c84['push'](_0x292c84['shift']());}};_0x51ad06(++_0x395fa5);}(_0x1da3,0x14d));var _0x31da=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1da3[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x31da('0x0'));var util=require('util');var moment=require(_0x31da('0x1'));var BPromise=require('bluebird');var rs=require(_0x31da('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31da('0x3'))['db'];var utils=require(_0x31da('0x4'));var logger=require(_0x31da('0x5'))('rpc');var config=require(_0x31da('0x6'));var jayson=require(_0x31da('0x7'));var client=jayson[_0x31da('0x8')][_0x31da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x714519,_0x2a2650,_0x408288){return new BPromise(function(_0x583f42,_0xe277ab){return client['request'](_0x714519,_0x408288)[_0x31da('0xa')](function(_0x54bb40){logger[_0x31da('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x2a2650,_0x31da('0xc'));logger['debug'](_0x31da('0xd'),_0x2a2650,_0x31da('0xc'),JSON[_0x31da('0xe')](_0x54bb40));if(_0x54bb40[_0x31da('0xf')]){if(_0x54bb40[_0x31da('0xf')]['code']===0x1f4){logger[_0x31da('0xf')](_0x31da('0x10'),_0x2a2650,_0x54bb40[_0x31da('0xf')]['message']);return _0xe277ab(_0x54bb40[_0x31da('0xf')][_0x31da('0x11')]);}logger[_0x31da('0xf')](_0x31da('0x10'),_0x2a2650,_0x54bb40[_0x31da('0xf')][_0x31da('0x11')]);return _0x583f42(_0x54bb40[_0x31da('0xf')][_0x31da('0x11')]);}else{logger[_0x31da('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x2a2650,'request\x20sent');_0x583f42(_0x54bb40['result'][_0x31da('0x11')]);}})['catch'](function(_0x450de2){logger[_0x31da('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x2a2650,_0x450de2);_0xe277ab(_0x450de2);});});} \ No newline at end of file +var _0x60fb=['error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x60fb,0x1a8));var _0xb60f=function(_0x173172,_0x2e7b5f){_0x173172=_0x173172-0x0;var _0x50c018=_0x60fb[_0x173172];return _0x50c018;};'use strict';var _=require(_0xb60f('0x0'));var util=require('util');var moment=require(_0xb60f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb60f('0x2'));var fs=require('fs');var Redis=require(_0xb60f('0x3'));var db=require(_0xb60f('0x4'))['db'];var utils=require(_0xb60f('0x5'));var logger=require(_0xb60f('0x6'))(_0xb60f('0x7'));var config=require(_0xb60f('0x8'));var jayson=require(_0xb60f('0x9'));var client=jayson[_0xb60f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40609d,_0x3e8f7f,_0x52de1e){return new BPromise(function(_0x709f64,_0x55400d){return client[_0xb60f('0xb')](_0x40609d,_0x52de1e)[_0xb60f('0xc')](function(_0x17f654){logger[_0xb60f('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3e8f7f,_0xb60f('0xe'));logger[_0xb60f('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3e8f7f,_0xb60f('0xe'),JSON['stringify'](_0x17f654));if(_0x17f654[_0xb60f('0x10')]){if(_0x17f654[_0xb60f('0x10')][_0xb60f('0x11')]===0x1f4){logger[_0xb60f('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x3e8f7f,_0x17f654[_0xb60f('0x10')][_0xb60f('0x12')]);return _0x55400d(_0x17f654[_0xb60f('0x10')][_0xb60f('0x12')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3e8f7f,_0x17f654[_0xb60f('0x10')][_0xb60f('0x12')]);return _0x709f64(_0x17f654[_0xb60f('0x10')][_0xb60f('0x12')]);}else{logger[_0xb60f('0xd')](_0xb60f('0x13'),_0x3e8f7f,_0xb60f('0xe'));_0x709f64(_0x17f654[_0xb60f('0x14')][_0xb60f('0x12')]);}})[_0xb60f('0x15')](function(_0xa990d4){logger[_0xb60f('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x3e8f7f,_0xa990d4);_0x55400d(_0xa990d4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 059f05a..8076d0c 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 _0x3eb4=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0x3eb4,0x13a));var _0x43eb=function(_0x1637d9,_0x16e500){_0x1637d9=_0x1637d9-0x0;var _0x2c89e6=_0x3eb4[_0x1637d9];return _0x2c89e6;};'use strict';var multer=require(_0x43eb('0x0'));var util=require(_0x43eb('0x1'));var path=require(_0x43eb('0x2'));var timeout=require(_0x43eb('0x3'));var express=require(_0x43eb('0x4'));var router=express[_0x43eb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x43eb('0x6'));var config=require(_0x43eb('0x7'));var controller=require(_0x43eb('0x8'));router[_0x43eb('0x9')]('/',auth[_0x43eb('0xa')](),controller[_0x43eb('0xb')]);router[_0x43eb('0x9')]('/:id',auth[_0x43eb('0xa')](),controller[_0x43eb('0xc')]);router[_0x43eb('0x9')](_0x43eb('0xd'),auth[_0x43eb('0xa')](),controller[_0x43eb('0xe')]);router[_0x43eb('0x9')](_0x43eb('0xf'),auth[_0x43eb('0xa')](),controller['getFields']);router[_0x43eb('0x10')]('/',auth['isAuthenticated'](),controller[_0x43eb('0x11')]);router[_0x43eb('0x10')](_0x43eb('0xd'),auth[_0x43eb('0xa')](),controller[_0x43eb('0x12')]);router[_0x43eb('0x13')](_0x43eb('0x14'),auth[_0x43eb('0xa')](),controller[_0x43eb('0x15')]);router[_0x43eb('0x16')](_0x43eb('0x14'),auth[_0x43eb('0xa')](),controller[_0x43eb('0x17')]);module['exports']=router; \ No newline at end of file +var _0xd65e=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','/:id'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0xd65e,0x9c));var _0xed65=function(_0x424746,_0x3eac28){_0x424746=_0x424746-0x0;var _0xe8b699=_0xd65e[_0x424746];return _0xe8b699;};'use strict';var multer=require(_0xed65('0x0'));var util=require(_0xed65('0x1'));var path=require(_0xed65('0x2'));var timeout=require('connect-timeout');var express=require(_0xed65('0x3'));var router=express[_0xed65('0x4')]();var fs_extra=require(_0xed65('0x5'));var auth=require(_0xed65('0x6'));var interaction=require(_0xed65('0x7'));var config=require('../../config/environment');var controller=require(_0xed65('0x8'));router[_0xed65('0x9')]('/',auth[_0xed65('0xa')](),controller[_0xed65('0xb')]);router['get']('/:id',auth[_0xed65('0xa')](),controller[_0xed65('0xc')]);router[_0xed65('0x9')]('/:id/configurations',auth[_0xed65('0xa')](),controller[_0xed65('0xd')]);router[_0xed65('0x9')](_0xed65('0xe'),auth[_0xed65('0xa')](),controller[_0xed65('0xf')]);router[_0xed65('0x10')]('/',auth[_0xed65('0xa')](),controller[_0xed65('0x11')]);router[_0xed65('0x10')](_0xed65('0x12'),auth[_0xed65('0xa')](),controller['addConfiguration']);router['put'](_0xed65('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xed65('0x14')]('/:id',auth[_0xed65('0xa')](),controller[_0xed65('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 860fdc5..dd2e245 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 _0xd117=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4c2501,_0x1209d9){var _0x292cdb=function(_0x496712){while(--_0x496712){_0x4c2501['push'](_0x4c2501['shift']());}};_0x292cdb(++_0x1209d9);}(_0xd117,0x182));var _0x7d11=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xd117[_0x277721];return _0x286051;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'apiKey':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8aad=['STRING','username','sequelize','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8aad,0x146));var _0xd8aa=function(_0x39bdc9,_0x4b87b0){_0x39bdc9=_0x39bdc9-0x0;var _0x3e0339=_0x8aad[_0x39bdc9];return _0x3e0339;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x3')},'apiKey':{'type':Sequelize[_0xd8aa('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd8aa('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 9389d73..c1f7dff 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 _0x3f59=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','keys','length','create','body','find','destroy','getConfigurations','findOne','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','apiKey','toString','subject','agent','description','source','group','company','default','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials'];(function(_0x29142d,_0x3bf0fe){var _0x254ba4=function(_0x265c86){while(--_0x265c86){_0x29142d['push'](_0x29142d['shift']());}};_0x254ba4(++_0x3bf0fe);}(_0x3f59,0x1b0));var _0x93f5=function(_0x1853f5,_0x119c11){_0x1853f5=_0x1853f5-0x0;var _0x245b22=_0x3f59[_0x1853f5];return _0x245b22;};'use strict';var emlformat=require(_0x93f5('0x0'));var rimraf=require(_0x93f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f5('0x2'));var rp=require(_0x93f5('0x3'));var moment=require(_0x93f5('0x4'));var BPromise=require(_0x93f5('0x5'));var Mustache=require(_0x93f5('0x6'));var util=require(_0x93f5('0x7'));var path=require(_0x93f5('0x8'));var sox=require(_0x93f5('0x9'));var csv=require(_0x93f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93f5('0xb'));var squel=require(_0x93f5('0xc'));var crypto=require(_0x93f5('0xd'));var jsforce=require(_0x93f5('0xe'));var deskjs=require(_0x93f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93f5('0x10'));var qs=require(_0x93f5('0x11'));var as=require(_0x93f5('0x12'));var hardwareService=require(_0x93f5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x93f5('0x14'));var config=require(_0x93f5('0x15'));var licenseUtil=require(_0x93f5('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x93f5('0x17'));function respondWithStatusCode(_0x4ea7b4,_0x3e7e84){_0x3e7e84=_0x3e7e84||0xcc;return function(_0x107b90){if(_0x107b90){return _0x4ea7b4[_0x93f5('0x18')](_0x3e7e84);}return _0x4ea7b4[_0x93f5('0x19')](_0x3e7e84)[_0x93f5('0x1a')]();};}function respondWithResult(_0x45a275,_0x5d6001){_0x5d6001=_0x5d6001||0xc8;return function(_0x108b11){if(_0x108b11){return _0x45a275[_0x93f5('0x19')](_0x5d6001)[_0x93f5('0x1b')](_0x108b11);}};}function respondWithFilteredResult(_0x2ab5ce,_0x316fb2){return function(_0x22bcd7){if(_0x22bcd7){var _0x36aa85=typeof _0x316fb2[_0x93f5('0x1c')]===_0x93f5('0x1d')&&typeof _0x316fb2[_0x93f5('0x1e')]===_0x93f5('0x1d');var _0x869415=_0x22bcd7['count'];var _0x8d8ffe=_0x36aa85?0x0:_0x316fb2[_0x93f5('0x1c')];var _0x45eac3=_0x36aa85?_0x22bcd7[_0x93f5('0x1f')]:_0x316fb2[_0x93f5('0x1c')]+_0x316fb2['limit'];var _0x34edb9;if(_0x45eac3>=_0x869415){_0x45eac3=_0x869415;_0x34edb9=0xc8;}else{_0x34edb9=0xce;}_0x2ab5ce[_0x93f5('0x19')](_0x34edb9);return _0x2ab5ce[_0x93f5('0x20')](_0x93f5('0x21'),_0x8d8ffe+'-'+_0x45eac3+'/'+_0x869415)[_0x93f5('0x1b')](_0x22bcd7);}return null;};}function patchUpdates(_0xb44720){return function(_0x17e4ef){try{jsonpatch[_0x93f5('0x22')](_0x17e4ef,_0xb44720,!![]);}catch(_0x466ad7){return BPromise[_0x93f5('0x23')](_0x466ad7);}return _0x17e4ef[_0x93f5('0x24')]();};}function saveUpdates(_0xb59065,_0x330869){return function(_0x5b1a1f){if(_0x5b1a1f){return _0x5b1a1f[_0x93f5('0x25')](_0xb59065)[_0x93f5('0x26')](function(_0x34f8ce){return _0x34f8ce;});}return null;};}function removeEntity(_0x3ffe51,_0x365afd){return function(_0x1b4576){if(_0x1b4576){return _0x1b4576['destroy']()[_0x93f5('0x26')](function(){_0x3ffe51[_0x93f5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107d91,_0x43fad9){return function(_0x57ae09){if(!_0x57ae09){_0x107d91['sendStatus'](0x194);}return _0x57ae09;};}function handleError(_0x403b45,_0x11e86c){_0x11e86c=_0x11e86c||0x1f4;return function(_0x469968){logger[_0x93f5('0x27')](_0x469968['stack']);if(_0x469968[_0x93f5('0x28')]){delete _0x469968['name'];}_0x403b45[_0x93f5('0x19')](_0x11e86c)[_0x93f5('0x29')](_0x469968);};}exports['index']=function(_0x36d579,_0x95e47e){var _0x136dc4={},_0x5e5cb5={},_0x3090a9={'count':0x0,'rows':[]};var _0x4883c6=_[_0x93f5('0x2a')](db['FreshdeskAccount'][_0x93f5('0x2b')],function(_0x2484bc){return{'name':_0x2484bc['fieldName'],'type':_0x2484bc[_0x93f5('0x2c')][_0x93f5('0x2d')]};});_0x5e5cb5[_0x93f5('0x2e')]=_[_0x93f5('0x2a')](_0x4883c6,'name');_0x5e5cb5[_0x93f5('0x2f')]=_['keys'](_0x36d579[_0x93f5('0x2f')]);_0x5e5cb5['filters']=_[_0x93f5('0x30')](_0x5e5cb5[_0x93f5('0x2e')],_0x5e5cb5[_0x93f5('0x2f')]);_0x136dc4[_0x93f5('0x31')]=_['intersection'](_0x5e5cb5[_0x93f5('0x2e')],qs[_0x93f5('0x32')](_0x36d579[_0x93f5('0x2f')][_0x93f5('0x32')]));_0x136dc4['attributes']=_0x136dc4[_0x93f5('0x31')]['length']?_0x136dc4[_0x93f5('0x31')]:_0x5e5cb5[_0x93f5('0x2e')];if(!_0x36d579[_0x93f5('0x2f')][_0x93f5('0x33')]('nolimit')){_0x136dc4[_0x93f5('0x1e')]=qs['limit'](_0x36d579[_0x93f5('0x2f')]['limit']);_0x136dc4['offset']=qs[_0x93f5('0x1c')](_0x36d579[_0x93f5('0x2f')][_0x93f5('0x1c')]);}_0x136dc4['order']=qs[_0x93f5('0x34')](_0x36d579[_0x93f5('0x2f')]['sort']);_0x136dc4[_0x93f5('0x35')]=qs['filters'](_[_0x93f5('0x36')](_0x36d579['query'],_0x5e5cb5[_0x93f5('0x37')]),_0x4883c6);if(_0x36d579[_0x93f5('0x2f')][_0x93f5('0x38')]){_0x136dc4[_0x93f5('0x35')]=_[_0x93f5('0x39')](_0x136dc4['where'],{'$or':_[_0x93f5('0x2a')](_0x4883c6,function(_0x364b5d){if(_0x364b5d[_0x93f5('0x2c')]!==_0x93f5('0x3a')){var _0x5c8687={};_0x5c8687[_0x364b5d[_0x93f5('0x28')]]={'$like':'%'+_0x36d579['query'][_0x93f5('0x38')]+'%'};return _0x5c8687;}})});}_0x136dc4=_[_0x93f5('0x39')]({},_0x136dc4,_0x36d579[_0x93f5('0x3b')]);var _0x1a6e28={'where':_0x136dc4[_0x93f5('0x35')]};return db[_0x93f5('0x3c')]['count'](_0x1a6e28)[_0x93f5('0x26')](function(_0x4f45d8){_0x3090a9[_0x93f5('0x1f')]=_0x4f45d8;if(_0x36d579[_0x93f5('0x2f')]['includeAll']){_0x136dc4[_0x93f5('0x3d')]=[{'all':!![]}];}return db[_0x93f5('0x3c')][_0x93f5('0x3e')](_0x136dc4);})[_0x93f5('0x26')](function(_0x53958b){_0x3090a9[_0x93f5('0x3f')]=_0x53958b;return _0x3090a9;})['then'](respondWithFilteredResult(_0x95e47e,_0x136dc4))[_0x93f5('0x40')](handleError(_0x95e47e,null));};exports[_0x93f5('0x41')]=function(_0x283261,_0x24d2dc){var _0xd4d915={'raw':![],'where':{'id':_0x283261[_0x93f5('0x42')]['id']}},_0x1d4c11={};_0x1d4c11['model']=_[_0x93f5('0x43')](db[_0x93f5('0x3c')][_0x93f5('0x2b')]);_0x1d4c11[_0x93f5('0x2f')]=_[_0x93f5('0x43')](_0x283261[_0x93f5('0x2f')]);_0x1d4c11[_0x93f5('0x37')]=_[_0x93f5('0x30')](_0x1d4c11['model'],_0x1d4c11['query']);_0xd4d915[_0x93f5('0x31')]=_['intersection'](_0x1d4c11[_0x93f5('0x2e')],qs['fields'](_0x283261[_0x93f5('0x2f')][_0x93f5('0x32')]));_0xd4d915['attributes']=_0xd4d915['attributes'][_0x93f5('0x44')]?_0xd4d915['attributes']:_0x1d4c11[_0x93f5('0x2e')];if(_0x283261[_0x93f5('0x2f')]['includeAll']){_0xd4d915[_0x93f5('0x3d')]=[{'all':!![]}];}_0xd4d915=_[_0x93f5('0x39')]({},_0xd4d915,_0x283261[_0x93f5('0x3b')]);return db[_0x93f5('0x3c')]['find'](_0xd4d915)[_0x93f5('0x26')](handleEntityNotFound(_0x24d2dc,null))['then'](respondWithResult(_0x24d2dc,null))[_0x93f5('0x40')](handleError(_0x24d2dc,null));};exports[_0x93f5('0x45')]=function(_0x548ee2,_0x5be105){return db[_0x93f5('0x3c')][_0x93f5('0x45')](_0x548ee2['body'],{})[_0x93f5('0x26')](respondWithResult(_0x5be105,0xc9))[_0x93f5('0x40')](handleError(_0x5be105,null));};exports[_0x93f5('0x25')]=function(_0x576500,_0x544091){if(_0x576500[_0x93f5('0x46')]['id']){delete _0x576500[_0x93f5('0x46')]['id'];}return db['FreshdeskAccount'][_0x93f5('0x47')]({'where':{'id':_0x576500['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x544091,null))[_0x93f5('0x26')](saveUpdates(_0x576500[_0x93f5('0x46')],null))[_0x93f5('0x26')](respondWithResult(_0x544091,null))[_0x93f5('0x40')](handleError(_0x544091,null));};exports[_0x93f5('0x48')]=function(_0x970bcf,_0x14e053){return db[_0x93f5('0x3c')][_0x93f5('0x47')]({'where':{'id':_0x970bcf[_0x93f5('0x42')]['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x14e053,null))[_0x93f5('0x26')](removeEntity(_0x14e053,null))[_0x93f5('0x40')](handleError(_0x14e053,null));};exports[_0x93f5('0x49')]=function(_0xd2d30a,_0x178b03,_0x389f31){var _0x2f81c2={};var _0x57cff5={};var _0x26507f;var _0x4c0810;return db['FreshdeskAccount'][_0x93f5('0x4a')]({'where':{'id':_0xd2d30a['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x178b03,null))['then'](function(_0x4366d7){if(_0x4366d7){_0x26507f=_0x4366d7;_0x57cff5[_0x93f5('0x2e')]=_['keys'](db['FreshdeskConfiguration'][_0x93f5('0x2b')]);_0x57cff5['query']=_[_0x93f5('0x43')](_0xd2d30a[_0x93f5('0x2f')]);_0x57cff5[_0x93f5('0x37')]=_['intersection'](_0x57cff5['model'],_0x57cff5[_0x93f5('0x2f')]);_0x2f81c2['attributes']=_['intersection'](_0x57cff5['model'],qs['fields'](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x32')]));_0x2f81c2[_0x93f5('0x31')]=_0x2f81c2[_0x93f5('0x31')]['length']?_0x2f81c2['attributes']:_0x57cff5['model'];_0x2f81c2[_0x93f5('0x4b')]=qs[_0x93f5('0x34')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x34')]);_0x2f81c2[_0x93f5('0x35')]=qs[_0x93f5('0x37')](_['pick'](_0xd2d30a['query'],_0x57cff5['filters']));if(_0xd2d30a[_0x93f5('0x2f')]['filter']){_0x2f81c2[_0x93f5('0x35')]=_['merge'](_0x2f81c2[_0x93f5('0x35')],{'$or':_[_0x93f5('0x2a')](_0x2f81c2[_0x93f5('0x31')],function(_0x204467){var _0x5eb615={};_0x5eb615[_0x204467]={'$like':'%'+_0xd2d30a['query'][_0x93f5('0x38')]+'%'};return _0x5eb615;})});}_0x2f81c2=_[_0x93f5('0x39')]({},_0x2f81c2,_0xd2d30a[_0x93f5('0x3b')]);return _0x26507f[_0x93f5('0x49')](_0x2f81c2);}})[_0x93f5('0x26')](function(_0x246484){if(_0x246484){_0x4c0810=_0x246484[_0x93f5('0x44')];if(!_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x33')](_0x93f5('0x4c'))){_0x2f81c2[_0x93f5('0x1e')]=qs[_0x93f5('0x1e')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x1e')]);_0x2f81c2[_0x93f5('0x1c')]=qs[_0x93f5('0x1c')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x1c')]);}return _0x26507f[_0x93f5('0x49')](_0x2f81c2);}})[_0x93f5('0x26')](function(_0x5ad360){if(_0x5ad360){return _0x5ad360?{'count':_0x4c0810,'rows':_0x5ad360}:null;}})['then'](respondWithResult(_0x178b03,null))['catch'](handleError(_0x178b03,null));};exports[_0x93f5('0x4d')]=function(_0x1296b0,_0x49e4a1,_0x2882d7){if(_0x1296b0[_0x93f5('0x46')]['id']){delete _0x1296b0[_0x93f5('0x46')]['id'];}return db[_0x93f5('0x3c')][_0x93f5('0x4a')]({'where':{'id':_0x1296b0['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x49e4a1,null))[_0x93f5('0x26')](function(_0x251f7a){if(_0x251f7a){_0x1296b0[_0x93f5('0x46')][_0x93f5('0x4e')]=_0x251f7a['id'];_0x1296b0[_0x93f5('0x46')][_0x93f5('0x4f')]=integrations[_0x93f5('0x50')](_0x1296b0['body'][_0x93f5('0x51')],_0x1296b0[_0x93f5('0x46')][_0x93f5('0x2c')]);_0x1296b0['body'][_0x93f5('0x52')]=integrations['getDescriptions'](_0x1296b0['body'][_0x93f5('0x51')],_0x1296b0[_0x93f5('0x46')][_0x93f5('0x2c')]);return db['FreshdeskConfiguration'][_0x93f5('0x45')](_0x1296b0[_0x93f5('0x46')],{'include':[{'model':db[_0x93f5('0x53')],'as':'Subjects'},{'model':db[_0x93f5('0x53')],'as':_0x93f5('0x52')}]});}return null;})[_0x93f5('0x26')](respondWithResult(_0x49e4a1,null))['catch'](handleError(_0x49e4a1,null));};exports[_0x93f5('0x54')]=function(_0x1c5fd4,_0x30d670,_0x365520){var _0x28cff8='';return db[_0x93f5('0x3c')]['findOne']({'where':{'id':_0x1c5fd4[_0x93f5('0x42')]['id']},'attributes':['id',_0x93f5('0x55'),'apiKey']})[_0x93f5('0x26')](handleEntityNotFound(_0x30d670,null))[_0x93f5('0x26')](function(_0x1290e4){if(_0x1290e4){_0x28cff8=_0x1290e4[_0x93f5('0x55')];var _0x18f25d=_0x28cff8[_0x93f5('0x56')](-0x1);if(_0x18f25d==='/'){_0x28cff8=_0x28cff8[_0x93f5('0x57')](0x0,_0x28cff8['lastIndexOf'](_0x18f25d));}return rp({'method':_0x93f5('0x58'),'uri':util['format'](_0x93f5('0x59'),_0x28cff8,_0x93f5('0x5a')),'headers':{'Authorization':util[_0x93f5('0x5b')](_0x93f5('0x5c'),new Buffer(util[_0x93f5('0x5b')]('%s:X',_0x1290e4[_0x93f5('0x5d')]))[_0x93f5('0x5e')]('base64'))},'json':!![]});}})[_0x93f5('0x26')](function(_0x2cf8c5){if(_0x2cf8c5){var _0x48b41b=['requester',_0x93f5('0x5f'),_0x93f5('0x60'),_0x93f5('0x61'),_0x93f5('0x19'),'priority','group',_0x93f5('0x62'),'ticket_type',_0x93f5('0x63'),_0x93f5('0x64')];_['remove'](_0x2cf8c5,function(_0x385392){return _0x48b41b['includes'](_0x385392[_0x93f5('0x28')])||!_0x385392[_0x93f5('0x65')]&&_0x385392[_0x93f5('0x2c')]!=='custom_text'&&_0x385392[_0x93f5('0x2c')]!=='custom_dropdown';});return{'count':_0x2cf8c5[_0x93f5('0x44')],'rows':_[_0x93f5('0x2a')](_0x2cf8c5,function(_0x13c1df){return{'id':_0x13c1df[_0x93f5('0x28')],'name':_0x13c1df[_0x93f5('0x66')],'custom':!_0x13c1df[_0x93f5('0x65')],'options':_0x13c1df['choices']?_[_0x93f5('0x2a')](_0x13c1df[_0x93f5('0x67')],function(_0x149fec){return{'name':_['capitalize'](_0x149fec),'value':_0x149fec};}):[]};})};}})[_0x93f5('0x26')](respondWithResult(_0x30d670,null))[_0x93f5('0x40')](function(_0xfaac55){var _0x57e0c4=_0x1c5fd4[_0x93f5('0x2f')][_0x93f5('0x68')]?0x1f4:_0xfaac55[_0x93f5('0x69')]||0x1f4;logger['error'](_0x93f5('0x6a'),_0x93f5('0x54'),_0x57e0c4,JSON['stringify'](_0xfaac55));delete _0xfaac55[_0x93f5('0x28')];if(_0x57e0c4===0x191){_0x57e0c4=0x190;}_0x30d670[_0x93f5('0x19')](_0x57e0c4)[_0x93f5('0x29')](_0x1c5fd4[_0x93f5('0x2f')]['test']?{'message':_0x93f5('0x6b'),'statusCode':_0xfaac55[_0x93f5('0x69')]}:_0xfaac55);});}; \ No newline at end of file +var _0x33a1=['%s/%s','Basic\x20%s','base64','requester','agent','description','group','source','ticket_type','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','FreshdeskField','remoteUri','slice','substring','GET','format'];(function(_0xa99abd,_0x3ea6c2){var _0x16f824=function(_0x51af3f){while(--_0x51af3f){_0xa99abd['push'](_0xa99abd['shift']());}};_0x16f824(++_0x3ea6c2);}(_0x33a1,0x7c));var _0x133a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x33a1[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x133a('0x0'));var rimraf=require(_0x133a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x133a('0x2'));var Mustache=require(_0x133a('0x3'));var util=require(_0x133a('0x4'));var path=require('path');var sox=require(_0x133a('0x5'));var csv=require(_0x133a('0x6'));var ejs=require(_0x133a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x133a('0x8'));var squel=require(_0x133a('0x9'));var crypto=require(_0x133a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x133a('0xb'));var toCsv=require(_0x133a('0x6'));var querystring=require(_0x133a('0xc'));var Papa=require(_0x133a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x133a('0xe'));var hardwareService=require(_0x133a('0xf'));var logger=require(_0x133a('0x10'))(_0x133a('0x11'));var utils=require(_0x133a('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x133a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56ccca,_0x504181){_0x504181=_0x504181||0xcc;return function(_0x39c7b5){if(_0x39c7b5){return _0x56ccca['sendStatus'](_0x504181);}return _0x56ccca[_0x133a('0x14')](_0x504181)[_0x133a('0x15')]();};}function respondWithResult(_0x3ed1b1,_0x56a6dd){_0x56a6dd=_0x56a6dd||0xc8;return function(_0x5b8131){if(_0x5b8131){return _0x3ed1b1[_0x133a('0x14')](_0x56a6dd)[_0x133a('0x16')](_0x5b8131);}};}function respondWithFilteredResult(_0x587863,_0x1221bc){return function(_0x49066a){if(_0x49066a){var _0x4c95ea=typeof _0x1221bc['offset']===_0x133a('0x17')&&typeof _0x1221bc['limit']===_0x133a('0x17');var _0x3119bb=_0x49066a['count'];var _0xb91a9e=_0x4c95ea?0x0:_0x1221bc[_0x133a('0x18')];var _0x5483dc=_0x4c95ea?_0x49066a['count']:_0x1221bc[_0x133a('0x18')]+_0x1221bc['limit'];var _0x3084b5;if(_0x5483dc>=_0x3119bb){_0x5483dc=_0x3119bb;_0x3084b5=0xc8;}else{_0x3084b5=0xce;}_0x587863[_0x133a('0x14')](_0x3084b5);return _0x587863[_0x133a('0x19')](_0x133a('0x1a'),_0xb91a9e+'-'+_0x5483dc+'/'+_0x3119bb)[_0x133a('0x16')](_0x49066a);}return null;};}function patchUpdates(_0x5dcdd0){return function(_0x5deb69){try{jsonpatch[_0x133a('0x1b')](_0x5deb69,_0x5dcdd0,!![]);}catch(_0x3a4cba){return BPromise[_0x133a('0x1c')](_0x3a4cba);}return _0x5deb69[_0x133a('0x1d')]();};}function saveUpdates(_0x122405,_0xceda38){return function(_0x5cf4cb){if(_0x5cf4cb){return _0x5cf4cb['update'](_0x122405)['then'](function(_0x4a137c){return _0x4a137c;});}return null;};}function removeEntity(_0xa50e62,_0x63f401){return function(_0x1d4035){if(_0x1d4035){return _0x1d4035['destroy']()[_0x133a('0x1e')](function(){_0xa50e62[_0x133a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x201dce,_0x3ba968){return function(_0x4d1abd){if(!_0x4d1abd){_0x201dce[_0x133a('0x1f')](0x194);}return _0x4d1abd;};}function handleError(_0x2952f8,_0x935699){_0x935699=_0x935699||0x1f4;return function(_0x3d4ef7){logger[_0x133a('0x20')](_0x3d4ef7[_0x133a('0x21')]);if(_0x3d4ef7[_0x133a('0x22')]){delete _0x3d4ef7[_0x133a('0x22')];}_0x2952f8[_0x133a('0x14')](_0x935699)[_0x133a('0x23')](_0x3d4ef7);};}exports[_0x133a('0x24')]=function(_0x5b28c5,_0x294885){var _0x5413aa={},_0x1f3c7d={},_0x47bd6d={'count':0x0,'rows':[]};var _0x1f75da=_['map'](db[_0x133a('0x25')][_0x133a('0x26')],function(_0x380b2a){return{'name':_0x380b2a[_0x133a('0x27')],'type':_0x380b2a[_0x133a('0x28')][_0x133a('0x29')]};});_0x1f3c7d[_0x133a('0x2a')]=_[_0x133a('0x2b')](_0x1f75da,_0x133a('0x22'));_0x1f3c7d[_0x133a('0x2c')]=_[_0x133a('0x2d')](_0x5b28c5[_0x133a('0x2c')]);_0x1f3c7d[_0x133a('0x2e')]=_[_0x133a('0x2f')](_0x1f3c7d[_0x133a('0x2a')],_0x1f3c7d[_0x133a('0x2c')]);_0x5413aa[_0x133a('0x30')]=_[_0x133a('0x2f')](_0x1f3c7d[_0x133a('0x2a')],qs[_0x133a('0x31')](_0x5b28c5['query'][_0x133a('0x31')]));_0x5413aa[_0x133a('0x30')]=_0x5413aa[_0x133a('0x30')][_0x133a('0x32')]?_0x5413aa['attributes']:_0x1f3c7d[_0x133a('0x2a')];if(!_0x5b28c5[_0x133a('0x2c')][_0x133a('0x33')]('nolimit')){_0x5413aa[_0x133a('0x34')]=qs[_0x133a('0x34')](_0x5b28c5[_0x133a('0x2c')][_0x133a('0x34')]);_0x5413aa[_0x133a('0x18')]=qs[_0x133a('0x18')](_0x5b28c5[_0x133a('0x2c')][_0x133a('0x18')]);}_0x5413aa[_0x133a('0x35')]=qs[_0x133a('0x36')](_0x5b28c5['query'][_0x133a('0x36')]);_0x5413aa[_0x133a('0x37')]=qs[_0x133a('0x2e')](_[_0x133a('0x38')](_0x5b28c5[_0x133a('0x2c')],_0x1f3c7d['filters']),_0x1f75da);if(_0x5b28c5[_0x133a('0x2c')][_0x133a('0x39')]){_0x5413aa['where']=_[_0x133a('0x3a')](_0x5413aa[_0x133a('0x37')],{'$or':_['map'](_0x1f75da,function(_0xb06cf4){if(_0xb06cf4[_0x133a('0x28')]!==_0x133a('0x3b')){var _0x51c1aa={};_0x51c1aa[_0xb06cf4[_0x133a('0x22')]]={'$like':'%'+_0x5b28c5[_0x133a('0x2c')][_0x133a('0x39')]+'%'};return _0x51c1aa;}})});}_0x5413aa=_[_0x133a('0x3a')]({},_0x5413aa,_0x5b28c5['options']);var _0x55b286={'where':_0x5413aa[_0x133a('0x37')]};return db[_0x133a('0x25')][_0x133a('0x3c')](_0x55b286)['then'](function(_0x14d76a){_0x47bd6d['count']=_0x14d76a;if(_0x5b28c5['query'][_0x133a('0x3d')]){_0x5413aa[_0x133a('0x3e')]=[{'all':!![]}];}return db[_0x133a('0x25')][_0x133a('0x3f')](_0x5413aa);})[_0x133a('0x1e')](function(_0x3dd5a5){_0x47bd6d[_0x133a('0x40')]=_0x3dd5a5;return _0x47bd6d;})[_0x133a('0x1e')](respondWithFilteredResult(_0x294885,_0x5413aa))[_0x133a('0x41')](handleError(_0x294885,null));};exports['show']=function(_0x57586f,_0x55bdd2){var _0x17cba4={'raw':![],'where':{'id':_0x57586f[_0x133a('0x42')]['id']}},_0x13afe4={};_0x13afe4[_0x133a('0x2a')]=_[_0x133a('0x2d')](db[_0x133a('0x25')][_0x133a('0x26')]);_0x13afe4['query']=_[_0x133a('0x2d')](_0x57586f[_0x133a('0x2c')]);_0x13afe4[_0x133a('0x2e')]=_['intersection'](_0x13afe4['model'],_0x13afe4[_0x133a('0x2c')]);_0x17cba4['attributes']=_[_0x133a('0x2f')](_0x13afe4[_0x133a('0x2a')],qs[_0x133a('0x31')](_0x57586f['query']['fields']));_0x17cba4[_0x133a('0x30')]=_0x17cba4[_0x133a('0x30')]['length']?_0x17cba4[_0x133a('0x30')]:_0x13afe4[_0x133a('0x2a')];if(_0x57586f['query']['includeAll']){_0x17cba4['include']=[{'all':!![]}];}_0x17cba4=_[_0x133a('0x3a')]({},_0x17cba4,_0x57586f[_0x133a('0x43')]);return db[_0x133a('0x25')][_0x133a('0x44')](_0x17cba4)[_0x133a('0x1e')](handleEntityNotFound(_0x55bdd2,null))[_0x133a('0x1e')](respondWithResult(_0x55bdd2,null))[_0x133a('0x41')](handleError(_0x55bdd2,null));};exports['create']=function(_0x3d35d3,_0x2c9992){return db['FreshdeskAccount'][_0x133a('0x45')](_0x3d35d3[_0x133a('0x46')],{})[_0x133a('0x1e')](respondWithResult(_0x2c9992,0xc9))['catch'](handleError(_0x2c9992,null));};exports['update']=function(_0x46f12b,_0x3f868d){if(_0x46f12b['body']['id']){delete _0x46f12b[_0x133a('0x46')]['id'];}return db[_0x133a('0x25')][_0x133a('0x44')]({'where':{'id':_0x46f12b[_0x133a('0x42')]['id']}})[_0x133a('0x1e')](handleEntityNotFound(_0x3f868d,null))[_0x133a('0x1e')](saveUpdates(_0x46f12b[_0x133a('0x46')],null))['then'](respondWithResult(_0x3f868d,null))[_0x133a('0x41')](handleError(_0x3f868d,null));};exports[_0x133a('0x47')]=function(_0x295b55,_0x3fa32d){return db['FreshdeskAccount'][_0x133a('0x44')]({'where':{'id':_0x295b55['params']['id']}})[_0x133a('0x1e')](handleEntityNotFound(_0x3fa32d,null))[_0x133a('0x1e')](removeEntity(_0x3fa32d,null))[_0x133a('0x41')](handleError(_0x3fa32d,null));};exports[_0x133a('0x48')]=function(_0x297bb3,_0x457e28,_0x1d1f89){var _0x2fe365={};var _0xbdc574={};var _0x2549ca;var _0x216aad;return db[_0x133a('0x25')][_0x133a('0x49')]({'where':{'id':_0x297bb3[_0x133a('0x42')]['id']}})[_0x133a('0x1e')](handleEntityNotFound(_0x457e28,null))['then'](function(_0x1d1bfa){if(_0x1d1bfa){_0x2549ca=_0x1d1bfa;_0xbdc574['model']=_[_0x133a('0x2d')](db[_0x133a('0x4a')][_0x133a('0x26')]);_0xbdc574['query']=_[_0x133a('0x2d')](_0x297bb3[_0x133a('0x2c')]);_0xbdc574['filters']=_['intersection'](_0xbdc574[_0x133a('0x2a')],_0xbdc574[_0x133a('0x2c')]);_0x2fe365['attributes']=_['intersection'](_0xbdc574[_0x133a('0x2a')],qs[_0x133a('0x31')](_0x297bb3[_0x133a('0x2c')]['fields']));_0x2fe365[_0x133a('0x30')]=_0x2fe365[_0x133a('0x30')]['length']?_0x2fe365[_0x133a('0x30')]:_0xbdc574['model'];_0x2fe365[_0x133a('0x35')]=qs[_0x133a('0x36')](_0x297bb3[_0x133a('0x2c')]['sort']);_0x2fe365[_0x133a('0x37')]=qs['filters'](_[_0x133a('0x38')](_0x297bb3[_0x133a('0x2c')],_0xbdc574[_0x133a('0x2e')]));if(_0x297bb3[_0x133a('0x2c')][_0x133a('0x39')]){_0x2fe365['where']=_[_0x133a('0x3a')](_0x2fe365[_0x133a('0x37')],{'$or':_['map'](_0x2fe365[_0x133a('0x30')],function(_0x2048e6){var _0x4421fa={};_0x4421fa[_0x2048e6]={'$like':'%'+_0x297bb3['query'][_0x133a('0x39')]+'%'};return _0x4421fa;})});}_0x2fe365=_['merge']({},_0x2fe365,_0x297bb3[_0x133a('0x43')]);return _0x2549ca[_0x133a('0x48')](_0x2fe365);}})['then'](function(_0x22a768){if(_0x22a768){_0x216aad=_0x22a768[_0x133a('0x32')];if(!_0x297bb3[_0x133a('0x2c')][_0x133a('0x33')]('nolimit')){_0x2fe365[_0x133a('0x34')]=qs[_0x133a('0x34')](_0x297bb3[_0x133a('0x2c')][_0x133a('0x34')]);_0x2fe365['offset']=qs['offset'](_0x297bb3[_0x133a('0x2c')]['offset']);}return _0x2549ca[_0x133a('0x48')](_0x2fe365);}})[_0x133a('0x1e')](function(_0x3bfece){if(_0x3bfece){return _0x3bfece?{'count':_0x216aad,'rows':_0x3bfece}:null;}})[_0x133a('0x1e')](respondWithResult(_0x457e28,null))[_0x133a('0x41')](handleError(_0x457e28,null));};exports[_0x133a('0x4b')]=function(_0x50d0de,_0x24ecc0,_0x1bb45c){if(_0x50d0de[_0x133a('0x46')]['id']){delete _0x50d0de['body']['id'];}return db[_0x133a('0x25')][_0x133a('0x49')]({'where':{'id':_0x50d0de['params']['id']}})[_0x133a('0x1e')](handleEntityNotFound(_0x24ecc0,null))[_0x133a('0x1e')](function(_0x1ea3f4){if(_0x1ea3f4){_0x50d0de[_0x133a('0x46')]['AccountId']=_0x1ea3f4['id'];_0x50d0de['body'][_0x133a('0x4c')]=integrations[_0x133a('0x4d')](_0x50d0de[_0x133a('0x46')][_0x133a('0x4e')],_0x50d0de['body'][_0x133a('0x28')]);_0x50d0de['body'][_0x133a('0x4f')]=integrations['getDescriptions'](_0x50d0de[_0x133a('0x46')][_0x133a('0x4e')],_0x50d0de[_0x133a('0x46')]['type']);return db['FreshdeskConfiguration'][_0x133a('0x45')](_0x50d0de[_0x133a('0x46')],{'include':[{'model':db[_0x133a('0x50')],'as':_0x133a('0x4c')},{'model':db['FreshdeskField'],'as':_0x133a('0x4f')}]});}return null;})[_0x133a('0x1e')](respondWithResult(_0x24ecc0,null))['catch'](handleError(_0x24ecc0,null));};exports['getFields']=function(_0x2dc7e5,_0x1a5884,_0x3c1c86){var _0x33773e='';return db['FreshdeskAccount'][_0x133a('0x49')]({'where':{'id':_0x2dc7e5['params']['id']},'attributes':['id',_0x133a('0x51'),'apiKey']})[_0x133a('0x1e')](handleEntityNotFound(_0x1a5884,null))[_0x133a('0x1e')](function(_0x46e8cb){if(_0x46e8cb){_0x33773e=_0x46e8cb[_0x133a('0x51')];var _0x2a05ed=_0x33773e[_0x133a('0x52')](-0x1);if(_0x2a05ed==='/'){_0x33773e=_0x33773e[_0x133a('0x53')](0x0,_0x33773e['lastIndexOf'](_0x2a05ed));}return rp({'method':_0x133a('0x54'),'uri':util[_0x133a('0x55')](_0x133a('0x56'),_0x33773e,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x133a('0x55')](_0x133a('0x57'),new Buffer(util[_0x133a('0x55')]('%s:X',_0x46e8cb['apiKey']))['toString'](_0x133a('0x58')))},'json':!![]});}})[_0x133a('0x1e')](function(_0x24e68f){if(_0x24e68f){var _0x47be30=[_0x133a('0x59'),'subject',_0x133a('0x5a'),_0x133a('0x5b'),_0x133a('0x14'),'priority',_0x133a('0x5c'),_0x133a('0x5d'),_0x133a('0x5e'),_0x133a('0x5c'),'company'];_['remove'](_0x24e68f,function(_0x55fd0e){return _0x47be30[_0x133a('0x5f')](_0x55fd0e[_0x133a('0x22')])||!_0x55fd0e[_0x133a('0x60')]&&_0x55fd0e[_0x133a('0x28')]!=='custom_text'&&_0x55fd0e[_0x133a('0x28')]!==_0x133a('0x61');});return{'count':_0x24e68f['length'],'rows':_[_0x133a('0x2b')](_0x24e68f,function(_0x7c4d0d){return{'id':_0x7c4d0d['name'],'name':_0x7c4d0d[_0x133a('0x62')],'custom':!_0x7c4d0d['default'],'options':_0x7c4d0d[_0x133a('0x63')]?_[_0x133a('0x2b')](_0x7c4d0d[_0x133a('0x63')],function(_0x1012da){return{'name':_[_0x133a('0x64')](_0x1012da),'value':_0x1012da};}):[]};})};}})[_0x133a('0x1e')](respondWithResult(_0x1a5884,null))['catch'](function(_0x4130ac){var _0x5d7e28=_0x2dc7e5[_0x133a('0x2c')][_0x133a('0x65')]?0x1f4:_0x4130ac[_0x133a('0x66')]||0x1f4;logger[_0x133a('0x20')](_0x133a('0x67'),'getFields',_0x5d7e28,JSON[_0x133a('0x68')](_0x4130ac));delete _0x4130ac[_0x133a('0x22')];if(_0x5d7e28===0x191){_0x5d7e28=0x190;}_0x1a5884['status'](_0x5d7e28)['send'](_0x2dc7e5[_0x133a('0x2c')][_0x133a('0x65')]?{'message':'Wrong\x20credentials','statusCode':_0x4130ac['statusCode']}:_0x4130ac);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index ca59c8f..33ac541 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 _0xbfc7=['../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbfc7,0x1b0));var _0x7bfc=function(_0x4866c2,_0x533c69){_0x4866c2=_0x4866c2-0x0;var _0x9595a3=_0xbfc7[_0x4866c2];return _0x9595a3;};'use strict';var _=require(_0x7bfc('0x0'));var util=require(_0x7bfc('0x1'));var logger=require('../../config/logger')(_0x7bfc('0x2'));var moment=require(_0x7bfc('0x3'));var BPromise=require(_0x7bfc('0x4'));var rp=require(_0x7bfc('0x5'));var fs=require('fs');var path=require(_0x7bfc('0x6'));var rimraf=require(_0x7bfc('0x7'));var config=require(_0x7bfc('0x8'));var attributes=require(_0x7bfc('0x9'));var integrations=require(_0x7bfc('0xa'));module['exports']=function(_0x290b40,_0x1bbc7d){return _0x290b40['define'](_0x7bfc('0xb'),attributes,{'tableName':_0x7bfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e35=['api','bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','../../config/logger'];(function(_0x8873b4,_0xa9231a){var _0x5c7c83=function(_0x558161){while(--_0x558161){_0x8873b4['push'](_0x8873b4['shift']());}};_0x5c7c83(++_0xa9231a);}(_0x6e35,0x14d));var _0x56e3=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x6e35[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x56e3('0x0'));var util=require(_0x56e3('0x1'));var logger=require(_0x56e3('0x2'))(_0x56e3('0x3'));var moment=require('moment');var BPromise=require(_0x56e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56e3('0x5'));var rimraf=require(_0x56e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x56e3('0x7'));var integrations=require(_0x56e3('0x8'));module[_0x56e3('0x9')]=function(_0x2032dc,_0xe6834f){return _0x2032dc[_0x56e3('0xa')](_0x56e3('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 33d01f2..0c85c52 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 _0x296c=['FreshdeskAccount','options','raw','where','limit','include','map','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x4aabc1,_0x15e9b0){var _0x302c36=function(_0x5d2280){while(--_0x5d2280){_0x4aabc1['push'](_0x4aabc1['shift']());}};_0x302c36(++_0x15e9b0);}(_0x296c,0x8f));var _0xc296=function(_0x25da30,_0x225537){_0x25da30=_0x25da30-0x0;var _0x57b643=_0x296c[_0x25da30];return _0x57b643;};'use strict';var _=require(_0xc296('0x0'));var util=require(_0xc296('0x1'));var moment=require(_0xc296('0x2'));var BPromise=require('bluebird');var rs=require(_0xc296('0x3'));var fs=require('fs');var Redis=require(_0xc296('0x4'));var db=require(_0xc296('0x5'))['db'];var utils=require(_0xc296('0x6'));var logger=require('../../config/logger')(_0xc296('0x7'));var config=require(_0xc296('0x8'));var jayson=require(_0xc296('0x9'));var client=jayson[_0xc296('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5342e9,_0x3d7db3,_0x1b6c4d){return new BPromise(function(_0x2b5ed4,_0x4f3d2a){return client[_0xc296('0xb')](_0x5342e9,_0x1b6c4d)[_0xc296('0xc')](function(_0x1b5909){logger[_0xc296('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x3d7db3,_0xc296('0xe'));logger[_0xc296('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3d7db3,'request\x20sent',JSON[_0xc296('0x10')](_0x1b5909));if(_0x1b5909['error']){if(_0x1b5909[_0xc296('0x11')]['code']===0x1f4){logger[_0xc296('0x11')](_0xc296('0x12'),_0x3d7db3,_0x1b5909[_0xc296('0x11')][_0xc296('0x13')]);return _0x4f3d2a(_0x1b5909[_0xc296('0x11')][_0xc296('0x13')]);}logger['error'](_0xc296('0x12'),_0x3d7db3,_0x1b5909[_0xc296('0x11')][_0xc296('0x13')]);return _0x2b5ed4(_0x1b5909[_0xc296('0x11')][_0xc296('0x13')]);}else{logger['info'](_0xc296('0x12'),_0x3d7db3,_0xc296('0xe'));_0x2b5ed4(_0x1b5909[_0xc296('0x14')][_0xc296('0x13')]);}})[_0xc296('0x15')](function(_0x1a3048){logger[_0xc296('0x11')](_0xc296('0x12'),_0x3d7db3,_0x1a3048);_0x4f3d2a(_0x1a3048);});});}exports['GetFreshdeskAccount']=function(_0x1a1359){var _0x3b83e7=this;return new Promise(function(_0x92d757,_0x3d0ec7){return db[_0xc296('0x16')]['findAll']({'raw':_0x1a1359[_0xc296('0x17')]?_0x1a1359[_0xc296('0x17')][_0xc296('0x18')]===undefined?!![]:![]:!![],'where':_0x1a1359[_0xc296('0x17')]?_0x1a1359[_0xc296('0x17')][_0xc296('0x19')]||null:null,'attributes':_0x1a1359[_0xc296('0x17')]?_0x1a1359[_0xc296('0x17')]['attributes']||null:null,'limit':_0x1a1359[_0xc296('0x17')]?_0x1a1359[_0xc296('0x17')][_0xc296('0x1a')]||null:null,'include':_0x1a1359[_0xc296('0x17')]?_0x1a1359['options'][_0xc296('0x1b')]?_[_0xc296('0x1c')](_0x1a1359[_0xc296('0x17')]['include'],function(_0x342a39){return{'model':db[_0x342a39[_0xc296('0x1d')]],'as':_0x342a39['as'],'attributes':_0x342a39[_0xc296('0x1e')],'include':_0x342a39[_0xc296('0x1b')]?_[_0xc296('0x1c')](_0x342a39[_0xc296('0x1b')],function(_0x237c72){return{'model':db[_0x237c72['model']],'as':_0x237c72['as'],'attributes':_0x237c72['attributes'],'include':_0x237c72[_0xc296('0x1b')]?_['map'](_0x237c72[_0xc296('0x1b')],function(_0x5e2643){return{'model':db[_0x5e2643['model']],'as':_0x5e2643['as'],'attributes':_0x5e2643['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x19e159){logger[_0xc296('0xd')](_0xc296('0x1f'),_0x1a1359);logger[_0xc296('0xf')](_0xc296('0x1f'),_0x1a1359,JSON[_0xc296('0x10')](_0x19e159));_0x92d757(_0x19e159);})[_0xc296('0x15')](function(_0x27a7d1){logger[_0xc296('0x11')](_0xc296('0x1f'),_0x27a7d1[_0xc296('0x13')],_0x1a1359);_0x3d0ec7(_0x3b83e7['error'](0x1f4,_0x27a7d1[_0xc296('0x13')]));});});};exports[_0xc296('0x20')]=function(_0x25b091){var _0x5a43bb=this;return new Promise(function(_0x232c39,_0x39fa97){return db['FreshdeskAccount']['find']({'raw':_0x25b091[_0xc296('0x17')]?_0x25b091['options'][_0xc296('0x18')]===undefined?!![]:![]:!![],'where':_0x25b091[_0xc296('0x17')]?_0x25b091[_0xc296('0x17')][_0xc296('0x19')]||null:null,'attributes':_0x25b091[_0xc296('0x17')]?_0x25b091[_0xc296('0x17')][_0xc296('0x1e')]||null:null,'include':_0x25b091['options']?_0x25b091[_0xc296('0x17')][_0xc296('0x1b')]?_[_0xc296('0x1c')](_0x25b091[_0xc296('0x17')][_0xc296('0x1b')],function(_0x5845ad){return{'model':db[_0x5845ad['model']],'as':_0x5845ad['as'],'attributes':_0x5845ad['attributes'],'include':_0x5845ad[_0xc296('0x1b')]?_['map'](_0x5845ad[_0xc296('0x1b')],function(_0x19b012){return{'model':db[_0x19b012['model']],'as':_0x19b012['as'],'attributes':_0x19b012[_0xc296('0x1e')],'include':_0x19b012['include']?_[_0xc296('0x1c')](_0x19b012[_0xc296('0x1b')],function(_0x151ceb){return{'model':db[_0x151ceb[_0xc296('0x1d')]],'as':_0x151ceb['as'],'attributes':_0x151ceb[_0xc296('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc296('0xc')](function(_0x4ea557){logger[_0xc296('0xd')]('ShowFreshdeskAccount',_0x25b091);logger[_0xc296('0xf')](_0xc296('0x20'),_0x25b091,JSON[_0xc296('0x10')](_0x4ea557));_0x232c39(_0x4ea557);})[_0xc296('0x15')](function(_0x675501){logger[_0xc296('0x11')]('ShowFreshdeskAccount',_0x675501[_0xc296('0x13')],_0x25b091);_0x39fa97(_0x5a43bb['error'](0x1f4,_0x675501[_0xc296('0x13')]));});});}; \ No newline at end of file +var _0x12ee=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','find','moment'];(function(_0x46b061,_0x55dad6){var _0x37321f=function(_0x48acd8){while(--_0x48acd8){_0x46b061['push'](_0x46b061['shift']());}};_0x37321f(++_0x55dad6);}(_0x12ee,0x1a3));var _0xe12e=function(_0x35031a,_0x1c8c62){_0x35031a=_0x35031a-0x0;var _0x44ec8f=_0x12ee[_0x35031a];return _0x44ec8f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe12e('0x0'));var BPromise=require(_0xe12e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe12e('0x2'));var db=require(_0xe12e('0x3'))['db'];var utils=require(_0xe12e('0x4'));var logger=require(_0xe12e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe12e('0x6'));var client=jayson[_0xe12e('0x7')][_0xe12e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a7db1,_0x50cddc,_0x2bdf37){return new BPromise(function(_0xa71b8e,_0x3a838c){return client[_0xe12e('0x9')](_0x1a7db1,_0x2bdf37)[_0xe12e('0xa')](function(_0x609808){logger['info'](_0xe12e('0xb'),_0x50cddc,_0xe12e('0xc'));logger[_0xe12e('0xd')](_0xe12e('0xe'),_0x50cddc,'request\x20sent',JSON[_0xe12e('0xf')](_0x609808));if(_0x609808[_0xe12e('0x10')]){if(_0x609808[_0xe12e('0x10')][_0xe12e('0x11')]===0x1f4){logger[_0xe12e('0x10')](_0xe12e('0xb'),_0x50cddc,_0x609808[_0xe12e('0x10')]['message']);return _0x3a838c(_0x609808[_0xe12e('0x10')][_0xe12e('0x12')]);}logger[_0xe12e('0x10')](_0xe12e('0xb'),_0x50cddc,_0x609808['error'][_0xe12e('0x12')]);return _0xa71b8e(_0x609808[_0xe12e('0x10')]['message']);}else{logger[_0xe12e('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x50cddc,_0xe12e('0xc'));_0xa71b8e(_0x609808[_0xe12e('0x14')]['message']);}})['catch'](function(_0x215548){logger[_0xe12e('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x50cddc,_0x215548);_0x3a838c(_0x215548);});});}exports[_0xe12e('0x15')]=function(_0x368857){var _0x170ea6=this;return new Promise(function(_0x48ff4f,_0x503dee){return db[_0xe12e('0x16')][_0xe12e('0x17')]({'raw':_0x368857[_0xe12e('0x18')]?_0x368857['options'][_0xe12e('0x19')]===undefined?!![]:![]:!![],'where':_0x368857[_0xe12e('0x18')]?_0x368857[_0xe12e('0x18')][_0xe12e('0x1a')]||null:null,'attributes':_0x368857[_0xe12e('0x18')]?_0x368857['options'][_0xe12e('0x1b')]||null:null,'limit':_0x368857[_0xe12e('0x18')]?_0x368857[_0xe12e('0x18')][_0xe12e('0x1c')]||null:null,'include':_0x368857[_0xe12e('0x18')]?_0x368857[_0xe12e('0x18')][_0xe12e('0x1d')]?_[_0xe12e('0x1e')](_0x368857[_0xe12e('0x18')][_0xe12e('0x1d')],function(_0x9d3d64){return{'model':db[_0x9d3d64[_0xe12e('0x1f')]],'as':_0x9d3d64['as'],'attributes':_0x9d3d64[_0xe12e('0x1b')],'include':_0x9d3d64['include']?_['map'](_0x9d3d64[_0xe12e('0x1d')],function(_0x1e87bc){return{'model':db[_0x1e87bc[_0xe12e('0x1f')]],'as':_0x1e87bc['as'],'attributes':_0x1e87bc[_0xe12e('0x1b')],'include':_0x1e87bc[_0xe12e('0x1d')]?_[_0xe12e('0x1e')](_0x1e87bc[_0xe12e('0x1d')],function(_0x1dd7f5){return{'model':db[_0x1dd7f5[_0xe12e('0x1f')]],'as':_0x1dd7f5['as'],'attributes':_0x1dd7f5[_0xe12e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe12e('0xa')](function(_0x8e65c0){logger['info']('GetFreshdeskAccount',_0x368857);logger[_0xe12e('0xd')](_0xe12e('0x15'),_0x368857,JSON['stringify'](_0x8e65c0));_0x48ff4f(_0x8e65c0);})[_0xe12e('0x20')](function(_0x15c43a){logger['error'](_0xe12e('0x15'),_0x15c43a['message'],_0x368857);_0x503dee(_0x170ea6[_0xe12e('0x10')](0x1f4,_0x15c43a[_0xe12e('0x12')]));});});};exports[_0xe12e('0x21')]=function(_0x4b4325){var _0x53fcbf=this;return new Promise(function(_0x358166,_0x3986c4){return db[_0xe12e('0x16')][_0xe12e('0x22')]({'raw':_0x4b4325[_0xe12e('0x18')]?_0x4b4325[_0xe12e('0x18')][_0xe12e('0x19')]===undefined?!![]:![]:!![],'where':_0x4b4325[_0xe12e('0x18')]?_0x4b4325[_0xe12e('0x18')][_0xe12e('0x1a')]||null:null,'attributes':_0x4b4325[_0xe12e('0x18')]?_0x4b4325[_0xe12e('0x18')]['attributes']||null:null,'include':_0x4b4325['options']?_0x4b4325[_0xe12e('0x18')][_0xe12e('0x1d')]?_[_0xe12e('0x1e')](_0x4b4325[_0xe12e('0x18')]['include'],function(_0x2dc54b){return{'model':db[_0x2dc54b[_0xe12e('0x1f')]],'as':_0x2dc54b['as'],'attributes':_0x2dc54b[_0xe12e('0x1b')],'include':_0x2dc54b[_0xe12e('0x1d')]?_[_0xe12e('0x1e')](_0x2dc54b[_0xe12e('0x1d')],function(_0x297e70){return{'model':db[_0x297e70[_0xe12e('0x1f')]],'as':_0x297e70['as'],'attributes':_0x297e70[_0xe12e('0x1b')],'include':_0x297e70['include']?_[_0xe12e('0x1e')](_0x297e70[_0xe12e('0x1d')],function(_0x59129f){return{'model':db[_0x59129f['model']],'as':_0x59129f['as'],'attributes':_0x59129f[_0xe12e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48b155){logger[_0xe12e('0x13')](_0xe12e('0x21'),_0x4b4325);logger[_0xe12e('0xd')](_0xe12e('0x21'),_0x4b4325,JSON['stringify'](_0x48b155));_0x358166(_0x48b155);})[_0xe12e('0x20')](function(_0x7ce564){logger[_0xe12e('0x10')](_0xe12e('0x21'),_0x7ce564[_0xe12e('0x12')],_0x4b4325);_0x3986c4(_0x53fcbf[_0xe12e('0x10')](0x1f4,_0x7ce564[_0xe12e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 9cf9294..7d12e57 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 _0x68c4=['fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','/:id/descriptions','/:id/tags','create','post','setTags','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x68c4,0x1a1));var _0x468c=function(_0x59bd2d,_0x307929){_0x59bd2d=_0x59bd2d-0x0;var _0x572487=_0x68c4[_0x59bd2d];return _0x572487;};'use strict';var multer=require(_0x468c('0x0'));var util=require('util');var path=require(_0x468c('0x1'));var timeout=require(_0x468c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x468c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x468c('0x4'));var config=require(_0x468c('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x468c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x468c('0x6')](_0x468c('0x7'),auth['isAuthenticated'](),controller[_0x468c('0x8')]);router['get'](_0x468c('0x9'),auth[_0x468c('0xa')](),controller['getFields']);router[_0x468c('0x6')](_0x468c('0xb'),auth[_0x468c('0xa')](),controller['getSubjects']);router[_0x468c('0x6')](_0x468c('0xc'),auth[_0x468c('0xa')](),controller['getDescriptions']);router[_0x468c('0x6')](_0x468c('0xd'),auth[_0x468c('0xa')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x468c('0xe')]);router[_0x468c('0xf')](_0x468c('0xd'),auth[_0x468c('0xa')](),controller[_0x468c('0x10')]);router[_0x468c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x468c('0x12')]);router[_0x468c('0x13')](_0x468c('0x7'),auth[_0x468c('0xa')](),controller['destroy']);module[_0x468c('0x14')]=router; \ No newline at end of file +var _0x1ad7=['isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get'];(function(_0x55a801,_0x1769e7){var _0x303292=function(_0x367c62){while(--_0x367c62){_0x55a801['push'](_0x55a801['shift']());}};_0x303292(++_0x1769e7);}(_0x1ad7,0x154));var _0x71ad=function(_0xf022be,_0x14e78e){_0xf022be=_0xf022be-0x0;var _0x18d7d5=_0x1ad7[_0xf022be];return _0x18d7d5;};'use strict';var multer=require(_0x71ad('0x0'));var util=require(_0x71ad('0x1'));var path=require(_0x71ad('0x2'));var timeout=require(_0x71ad('0x3'));var express=require(_0x71ad('0x4'));var router=express[_0x71ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x71ad('0x6'));var interaction=require(_0x71ad('0x7'));var config=require(_0x71ad('0x8'));var controller=require(_0x71ad('0x9'));router[_0x71ad('0xa')]('/',auth[_0x71ad('0xb')](),controller[_0x71ad('0xc')]);router[_0x71ad('0xa')]('/:id',auth[_0x71ad('0xb')](),controller['show']);router[_0x71ad('0xa')](_0x71ad('0xd'),auth[_0x71ad('0xb')](),controller[_0x71ad('0xe')]);router[_0x71ad('0xa')](_0x71ad('0xf'),auth['isAuthenticated'](),controller[_0x71ad('0x10')]);router[_0x71ad('0xa')](_0x71ad('0x11'),auth[_0x71ad('0xb')](),controller[_0x71ad('0x12')]);router[_0x71ad('0xa')](_0x71ad('0x13'),auth[_0x71ad('0xb')](),controller[_0x71ad('0x14')]);router[_0x71ad('0x15')]('/',auth[_0x71ad('0xb')](),controller[_0x71ad('0x16')]);router[_0x71ad('0x15')](_0x71ad('0x13'),auth['isAuthenticated'](),controller['setTags']);router[_0x71ad('0x17')](_0x71ad('0x18'),auth[_0x71ad('0xb')](),controller[_0x71ad('0x19')]);router['delete'](_0x71ad('0x18'),auth[_0x71ad('0xb')](),controller['destroy']);module[_0x71ad('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e9db517..eabf00e 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 _0x1ac6=['STRING','exports'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0x1ac6,0x11d));var _0x61ac=function(_0x1193eb,_0x2a1969){_0x1193eb=_0x1193eb-0x0;var _0x5507f2=_0x1ac6[_0x1193eb];return _0x5507f2;};'use strict';var Sequelize=require('sequelize');module[_0x61ac('0x0')]={'name':{'type':Sequelize[_0x61ac('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xccb6=['exports','STRING','sequelize'];(function(_0x49e52,_0x5d4d48){var _0x4d707c=function(_0x22453d){while(--_0x22453d){_0x49e52['push'](_0x49e52['shift']());}};_0x4d707c(++_0x5d4d48);}(_0xccb6,0x9e));var _0x6ccb=function(_0xed9c99,_0x2217b1){_0xed9c99=_0xed9c99-0x0;var _0x5443a1=_0xccb6[_0xed9c99];return _0x5443a1;};'use strict';var Sequelize=require(_0x6ccb('0x0'));module[_0x6ccb('0x1')]={'name':{'type':Sequelize[_0x6ccb('0x2')]},'description':{'type':Sequelize[_0x6ccb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 221f0c5..2f96ad6 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 _0x4f90=['map','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','FreshdeskConfiguration','includeAll','findAll','rows','params','include','find','create','body','catch','getFields','findOne','FreshdeskField','filter','nolimit','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4f90,0x122));var _0x04f9=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0x4f90[_0xf72786];return _0x113f3e;};'use strict';var emlformat=require(_0x04f9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x04f9('0x1'));var rp=require(_0x04f9('0x2'));var moment=require('moment');var BPromise=require(_0x04f9('0x3'));var Mustache=require(_0x04f9('0x4'));var util=require('util');var path=require('path');var sox=require(_0x04f9('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04f9('0x6'));var _=require(_0x04f9('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x04f9('0x8'));var deskjs=require(_0x04f9('0x9'));var toCsv=require(_0x04f9('0xa'));var querystring=require('querystring');var Papa=require(_0x04f9('0xb'));var Redis=require(_0x04f9('0xc'));var authService=require(_0x04f9('0xd'));var qs=require(_0x04f9('0xe'));var as=require(_0x04f9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x04f9('0x10'));var utils=require(_0x04f9('0x11'));var config=require(_0x04f9('0x12'));var licenseUtil=require(_0x04f9('0x13'));var db=require(_0x04f9('0x14'))['db'];function respondWithStatusCode(_0x6201b1,_0x2f49fc){_0x2f49fc=_0x2f49fc||0xcc;return function(_0x4491df){if(_0x4491df){return _0x6201b1[_0x04f9('0x15')](_0x2f49fc);}return _0x6201b1[_0x04f9('0x16')](_0x2f49fc)[_0x04f9('0x17')]();};}function respondWithResult(_0x3f8dbc,_0x281788){_0x281788=_0x281788||0xc8;return function(_0x76ad){if(_0x76ad){return _0x3f8dbc[_0x04f9('0x16')](_0x281788)[_0x04f9('0x18')](_0x76ad);}};}function respondWithFilteredResult(_0x4b4c2a,_0x280326){return function(_0x4392ac){if(_0x4392ac){var _0x459216=typeof _0x280326[_0x04f9('0x19')]===_0x04f9('0x1a')&&typeof _0x280326[_0x04f9('0x1b')]===_0x04f9('0x1a');var _0x2e16ff=_0x4392ac[_0x04f9('0x1c')];var _0x5d1d39=_0x459216?0x0:_0x280326['offset'];var _0x5cd1e5=_0x459216?_0x4392ac[_0x04f9('0x1c')]:_0x280326[_0x04f9('0x19')]+_0x280326[_0x04f9('0x1b')];var _0x29b728;if(_0x5cd1e5>=_0x2e16ff){_0x5cd1e5=_0x2e16ff;_0x29b728=0xc8;}else{_0x29b728=0xce;}_0x4b4c2a[_0x04f9('0x16')](_0x29b728);return _0x4b4c2a[_0x04f9('0x1d')](_0x04f9('0x1e'),_0x5d1d39+'-'+_0x5cd1e5+'/'+_0x2e16ff)['json'](_0x4392ac);}return null;};}function patchUpdates(_0x53a0b7){return function(_0x814688){try{jsonpatch[_0x04f9('0x1f')](_0x814688,_0x53a0b7,!![]);}catch(_0x3c588d){return BPromise[_0x04f9('0x20')](_0x3c588d);}return _0x814688[_0x04f9('0x21')]();};}function saveUpdates(_0x33f02a,_0x29f2d3){return function(_0x1d4167){if(_0x1d4167){return _0x1d4167[_0x04f9('0x22')](_0x33f02a)[_0x04f9('0x23')](function(_0xc25186){return _0xc25186;});}return null;};}function removeEntity(_0x354ac6,_0x5ab20e){return function(_0x2c148a){if(_0x2c148a){return _0x2c148a[_0x04f9('0x24')]()['then'](function(){_0x354ac6[_0x04f9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x554a03,_0x3df149){return function(_0x236370){if(!_0x236370){_0x554a03['sendStatus'](0x194);}return _0x236370;};}function handleError(_0x4ae61c,_0x2611cf){_0x2611cf=_0x2611cf||0x1f4;return function(_0x1a43ab){logger[_0x04f9('0x25')](_0x1a43ab[_0x04f9('0x26')]);if(_0x1a43ab[_0x04f9('0x27')]){delete _0x1a43ab[_0x04f9('0x27')];}_0x4ae61c['status'](_0x2611cf)[_0x04f9('0x28')](_0x1a43ab);};}exports[_0x04f9('0x29')]=function(_0x4edcd4,_0x3d1f4b){var _0x58a76a={},_0x4337fd={},_0x30641f={'count':0x0,'rows':[]};var _0x5a8e03=_[_0x04f9('0x2a')](db['FreshdeskConfiguration'][_0x04f9('0x2b')],function(_0x5bb5c3){return{'name':_0x5bb5c3[_0x04f9('0x2c')],'type':_0x5bb5c3['type'][_0x04f9('0x2d')]};});_0x4337fd['model']=_[_0x04f9('0x2a')](_0x5a8e03,_0x04f9('0x27'));_0x4337fd['query']=_[_0x04f9('0x2e')](_0x4edcd4['query']);_0x4337fd[_0x04f9('0x2f')]=_[_0x04f9('0x30')](_0x4337fd[_0x04f9('0x31')],_0x4337fd['query']);_0x58a76a[_0x04f9('0x32')]=_[_0x04f9('0x30')](_0x4337fd['model'],qs['fields'](_0x4edcd4[_0x04f9('0x33')][_0x04f9('0x34')]));_0x58a76a['attributes']=_0x58a76a[_0x04f9('0x32')][_0x04f9('0x35')]?_0x58a76a[_0x04f9('0x32')]:_0x4337fd[_0x04f9('0x31')];if(!_0x4edcd4['query'][_0x04f9('0x36')]('nolimit')){_0x58a76a[_0x04f9('0x1b')]=qs[_0x04f9('0x1b')](_0x4edcd4[_0x04f9('0x33')][_0x04f9('0x1b')]);_0x58a76a[_0x04f9('0x19')]=qs['offset'](_0x4edcd4[_0x04f9('0x33')][_0x04f9('0x19')]);}_0x58a76a[_0x04f9('0x37')]=qs[_0x04f9('0x38')](_0x4edcd4[_0x04f9('0x33')]['sort']);_0x58a76a[_0x04f9('0x39')]=qs[_0x04f9('0x2f')](_[_0x04f9('0x3a')](_0x4edcd4['query'],_0x4337fd[_0x04f9('0x2f')]),_0x5a8e03);if(_0x4edcd4[_0x04f9('0x33')]['filter']){_0x58a76a[_0x04f9('0x39')]=_['merge'](_0x58a76a[_0x04f9('0x39')],{'$or':_[_0x04f9('0x2a')](_0x5a8e03,function(_0x55d02a){if(_0x55d02a[_0x04f9('0x3b')]!==_0x04f9('0x3c')){var _0x4c025d={};_0x4c025d[_0x55d02a[_0x04f9('0x27')]]={'$like':'%'+_0x4edcd4[_0x04f9('0x33')]['filter']+'%'};return _0x4c025d;}})});}_0x58a76a=_[_0x04f9('0x3d')]({},_0x58a76a,_0x4edcd4[_0x04f9('0x3e')]);var _0x3714bb={'where':_0x58a76a['where']};return db[_0x04f9('0x3f')]['count'](_0x3714bb)[_0x04f9('0x23')](function(_0x255977){_0x30641f['count']=_0x255977;if(_0x4edcd4[_0x04f9('0x33')][_0x04f9('0x40')]){_0x58a76a['include']=[{'all':!![]}];}return db[_0x04f9('0x3f')][_0x04f9('0x41')](_0x58a76a);})[_0x04f9('0x23')](function(_0xdd8161){_0x30641f[_0x04f9('0x42')]=_0xdd8161;return _0x30641f;})[_0x04f9('0x23')](respondWithFilteredResult(_0x3d1f4b,_0x58a76a))['catch'](handleError(_0x3d1f4b,null));};exports['show']=function(_0x5f0e34,_0x374e30){var _0x2dadc6={'raw':![],'where':{'id':_0x5f0e34[_0x04f9('0x43')]['id']}},_0x22a48f={};_0x22a48f[_0x04f9('0x31')]=_[_0x04f9('0x2e')](db[_0x04f9('0x3f')][_0x04f9('0x2b')]);_0x22a48f[_0x04f9('0x33')]=_[_0x04f9('0x2e')](_0x5f0e34[_0x04f9('0x33')]);_0x22a48f[_0x04f9('0x2f')]=_[_0x04f9('0x30')](_0x22a48f['model'],_0x22a48f[_0x04f9('0x33')]);_0x2dadc6[_0x04f9('0x32')]=_[_0x04f9('0x30')](_0x22a48f['model'],qs[_0x04f9('0x34')](_0x5f0e34[_0x04f9('0x33')][_0x04f9('0x34')]));_0x2dadc6['attributes']=_0x2dadc6[_0x04f9('0x32')]['length']?_0x2dadc6['attributes']:_0x22a48f[_0x04f9('0x31')];if(_0x5f0e34[_0x04f9('0x33')][_0x04f9('0x40')]){_0x2dadc6[_0x04f9('0x44')]=[{'all':!![]}];}_0x2dadc6=_[_0x04f9('0x3d')]({},_0x2dadc6,_0x5f0e34['options']);return db[_0x04f9('0x3f')][_0x04f9('0x45')](_0x2dadc6)['then'](handleEntityNotFound(_0x374e30,null))[_0x04f9('0x23')](respondWithResult(_0x374e30,null))['catch'](handleError(_0x374e30,null));};exports[_0x04f9('0x46')]=function(_0x449304,_0x57ba96){return db['FreshdeskConfiguration'][_0x04f9('0x46')](_0x449304[_0x04f9('0x47')],{})['then'](respondWithResult(_0x57ba96,0xc9))[_0x04f9('0x48')](handleError(_0x57ba96,null));};exports['update']=function(_0x44cb15,_0x1a0c85){if(_0x44cb15[_0x04f9('0x47')]['id']){delete _0x44cb15[_0x04f9('0x47')]['id'];}return db[_0x04f9('0x3f')][_0x04f9('0x45')]({'where':{'id':_0x44cb15[_0x04f9('0x43')]['id']}})[_0x04f9('0x23')](handleEntityNotFound(_0x1a0c85,null))[_0x04f9('0x23')](saveUpdates(_0x44cb15[_0x04f9('0x47')],null))[_0x04f9('0x23')](respondWithResult(_0x1a0c85,null))['catch'](handleError(_0x1a0c85,null));};exports[_0x04f9('0x24')]=function(_0x4422d7,_0x3b417b){return db[_0x04f9('0x3f')][_0x04f9('0x45')]({'where':{'id':_0x4422d7[_0x04f9('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b417b,null))[_0x04f9('0x23')](removeEntity(_0x3b417b,null))['catch'](handleError(_0x3b417b,null));};exports[_0x04f9('0x49')]=function(_0x2be7a0,_0x17e094,_0x5d25c5){var _0x2a3b94={};var _0x157611={};var _0x1f6e66;var _0x54be6f;return db[_0x04f9('0x3f')][_0x04f9('0x4a')]({'where':{'id':_0x2be7a0[_0x04f9('0x43')]['id']}})[_0x04f9('0x23')](handleEntityNotFound(_0x17e094,null))['then'](function(_0x37e28b){if(_0x37e28b){_0x1f6e66=_0x37e28b;_0x157611[_0x04f9('0x31')]=_[_0x04f9('0x2e')](db[_0x04f9('0x4b')][_0x04f9('0x2b')]);_0x157611[_0x04f9('0x33')]=_[_0x04f9('0x2e')](_0x2be7a0[_0x04f9('0x33')]);_0x157611[_0x04f9('0x2f')]=_[_0x04f9('0x30')](_0x157611[_0x04f9('0x31')],_0x157611[_0x04f9('0x33')]);_0x2a3b94[_0x04f9('0x32')]=_[_0x04f9('0x30')](_0x157611['model'],qs[_0x04f9('0x34')](_0x2be7a0['query'][_0x04f9('0x34')]));_0x2a3b94[_0x04f9('0x32')]=_0x2a3b94[_0x04f9('0x32')][_0x04f9('0x35')]?_0x2a3b94['attributes']:_0x157611[_0x04f9('0x31')];_0x2a3b94[_0x04f9('0x37')]=qs['sort'](_0x2be7a0['query'][_0x04f9('0x38')]);_0x2a3b94['where']=qs[_0x04f9('0x2f')](_[_0x04f9('0x3a')](_0x2be7a0[_0x04f9('0x33')],_0x157611[_0x04f9('0x2f')]));if(_0x2be7a0['query'][_0x04f9('0x4c')]){_0x2a3b94[_0x04f9('0x39')]=_[_0x04f9('0x3d')](_0x2a3b94[_0x04f9('0x39')],{'$or':_[_0x04f9('0x2a')](_0x2a3b94[_0x04f9('0x32')],function(_0x483695){var _0x3fe432={};_0x3fe432[_0x483695]={'$like':'%'+_0x2be7a0[_0x04f9('0x33')][_0x04f9('0x4c')]+'%'};return _0x3fe432;})});}_0x2a3b94=_[_0x04f9('0x3d')]({},_0x2a3b94,_0x2be7a0[_0x04f9('0x3e')]);return _0x1f6e66['getFields'](_0x2a3b94);}})[_0x04f9('0x23')](function(_0x594186){if(_0x594186){_0x54be6f=_0x594186['length'];if(!_0x2be7a0[_0x04f9('0x33')][_0x04f9('0x36')](_0x04f9('0x4d'))){_0x2a3b94['limit']=qs[_0x04f9('0x1b')](_0x2be7a0[_0x04f9('0x33')][_0x04f9('0x1b')]);_0x2a3b94[_0x04f9('0x19')]=qs[_0x04f9('0x19')](_0x2be7a0[_0x04f9('0x33')]['offset']);}return _0x1f6e66['getFields'](_0x2a3b94);}})[_0x04f9('0x23')](function(_0x57a346){if(_0x57a346){return _0x57a346?{'count':_0x54be6f,'rows':_0x57a346}:null;}})['then'](respondWithResult(_0x17e094,null))['catch'](handleError(_0x17e094,null));};exports[_0x04f9('0x4e')]=function(_0x27abaf,_0x228aa4,_0x37474e){var _0x260c91={};var _0x54501b={};var _0x181210;var _0x42cb32;return db[_0x04f9('0x3f')][_0x04f9('0x4a')]({'where':{'id':_0x27abaf[_0x04f9('0x43')]['id']}})[_0x04f9('0x23')](handleEntityNotFound(_0x228aa4,null))[_0x04f9('0x23')](function(_0x4751d6){if(_0x4751d6){_0x181210=_0x4751d6;_0x54501b[_0x04f9('0x31')]=_[_0x04f9('0x2e')](db[_0x04f9('0x4b')][_0x04f9('0x2b')]);_0x54501b['query']=_[_0x04f9('0x2e')](_0x27abaf[_0x04f9('0x33')]);_0x54501b[_0x04f9('0x2f')]=_[_0x04f9('0x30')](_0x54501b[_0x04f9('0x31')],_0x54501b[_0x04f9('0x33')]);_0x260c91[_0x04f9('0x32')]=_[_0x04f9('0x30')](_0x54501b[_0x04f9('0x31')],qs['fields'](_0x27abaf[_0x04f9('0x33')]['fields']));_0x260c91[_0x04f9('0x32')]=_0x260c91[_0x04f9('0x32')][_0x04f9('0x35')]?_0x260c91['attributes']:_0x54501b[_0x04f9('0x31')];_0x260c91[_0x04f9('0x37')]=qs['sort'](_0x27abaf['query']['sort']);_0x260c91[_0x04f9('0x39')]=qs[_0x04f9('0x2f')](_['pick'](_0x27abaf['query'],_0x54501b[_0x04f9('0x2f')]));if(_0x27abaf[_0x04f9('0x33')][_0x04f9('0x4c')]){_0x260c91[_0x04f9('0x39')]=_[_0x04f9('0x3d')](_0x260c91[_0x04f9('0x39')],{'$or':_['map'](_0x260c91[_0x04f9('0x32')],function(_0x2010d9){var _0x27454f={};_0x27454f[_0x2010d9]={'$like':'%'+_0x27abaf[_0x04f9('0x33')][_0x04f9('0x4c')]+'%'};return _0x27454f;})});}_0x260c91=_['merge']({},_0x260c91,_0x27abaf['options']);return _0x181210[_0x04f9('0x4e')](_0x260c91);}})[_0x04f9('0x23')](function(_0x3c683c){if(_0x3c683c){_0x42cb32=_0x3c683c['length'];if(!_0x27abaf[_0x04f9('0x33')]['hasOwnProperty']('nolimit')){_0x260c91[_0x04f9('0x1b')]=qs[_0x04f9('0x1b')](_0x27abaf[_0x04f9('0x33')][_0x04f9('0x1b')]);_0x260c91[_0x04f9('0x19')]=qs[_0x04f9('0x19')](_0x27abaf[_0x04f9('0x33')]['offset']);}return _0x181210[_0x04f9('0x4e')](_0x260c91);}})[_0x04f9('0x23')](function(_0x44b6f7){if(_0x44b6f7){return _0x44b6f7?{'count':_0x42cb32,'rows':_0x44b6f7}:null;}})[_0x04f9('0x23')](respondWithResult(_0x228aa4,null))[_0x04f9('0x48')](handleError(_0x228aa4,null));};exports[_0x04f9('0x4f')]=function(_0x44c93e,_0x54d4e5,_0x6c4ea){var _0x125850={};var _0x20eac9={};var _0x245751;var _0xadd545;return db[_0x04f9('0x3f')][_0x04f9('0x4a')]({'where':{'id':_0x44c93e[_0x04f9('0x43')]['id']}})[_0x04f9('0x23')](handleEntityNotFound(_0x54d4e5,null))[_0x04f9('0x23')](function(_0x4a9293){if(_0x4a9293){_0x245751=_0x4a9293;_0x20eac9[_0x04f9('0x31')]=_['keys'](db[_0x04f9('0x4b')]['rawAttributes']);_0x20eac9[_0x04f9('0x33')]=_[_0x04f9('0x2e')](_0x44c93e['query']);_0x20eac9[_0x04f9('0x2f')]=_[_0x04f9('0x30')](_0x20eac9[_0x04f9('0x31')],_0x20eac9[_0x04f9('0x33')]);_0x125850[_0x04f9('0x32')]=_[_0x04f9('0x30')](_0x20eac9[_0x04f9('0x31')],qs[_0x04f9('0x34')](_0x44c93e[_0x04f9('0x33')][_0x04f9('0x34')]));_0x125850[_0x04f9('0x32')]=_0x125850[_0x04f9('0x32')][_0x04f9('0x35')]?_0x125850[_0x04f9('0x32')]:_0x20eac9[_0x04f9('0x31')];_0x125850['order']=qs['sort'](_0x44c93e['query']['sort']);_0x125850[_0x04f9('0x39')]=qs[_0x04f9('0x2f')](_[_0x04f9('0x3a')](_0x44c93e[_0x04f9('0x33')],_0x20eac9[_0x04f9('0x2f')]));if(_0x44c93e[_0x04f9('0x33')][_0x04f9('0x4c')]){_0x125850[_0x04f9('0x39')]=_[_0x04f9('0x3d')](_0x125850[_0x04f9('0x39')],{'$or':_[_0x04f9('0x2a')](_0x125850[_0x04f9('0x32')],function(_0x2d2823){var _0x16db1c={};_0x16db1c[_0x2d2823]={'$like':'%'+_0x44c93e[_0x04f9('0x33')]['filter']+'%'};return _0x16db1c;})});}_0x125850=_[_0x04f9('0x3d')]({},_0x125850,_0x44c93e[_0x04f9('0x3e')]);return _0x245751[_0x04f9('0x4f')](_0x125850);}})[_0x04f9('0x23')](function(_0x101e50){if(_0x101e50){_0xadd545=_0x101e50[_0x04f9('0x35')];if(!_0x44c93e[_0x04f9('0x33')]['hasOwnProperty']('nolimit')){_0x125850[_0x04f9('0x1b')]=qs[_0x04f9('0x1b')](_0x44c93e[_0x04f9('0x33')][_0x04f9('0x1b')]);_0x125850['offset']=qs['offset'](_0x44c93e[_0x04f9('0x33')][_0x04f9('0x19')]);}return _0x245751[_0x04f9('0x4f')](_0x125850);}})[_0x04f9('0x23')](function(_0x40c8fc){if(_0x40c8fc){return _0x40c8fc?{'count':_0xadd545,'rows':_0x40c8fc}:null;}})['then'](respondWithResult(_0x54d4e5,null))[_0x04f9('0x48')](handleError(_0x54d4e5,null));};exports[_0x04f9('0x50')]=function(_0x36091e,_0x206b83,_0x5b54aa){var _0xa394e1={};var _0x534385={};var _0x39c587;var _0x243f9d;return db[_0x04f9('0x3f')][_0x04f9('0x4a')]({'where':{'id':_0x36091e[_0x04f9('0x43')]['id']}})[_0x04f9('0x23')](handleEntityNotFound(_0x206b83,null))['then'](function(_0x2974ef){if(_0x2974ef){_0x39c587=_0x2974ef;_0x534385[_0x04f9('0x31')]=_[_0x04f9('0x2e')](db[_0x04f9('0x51')][_0x04f9('0x2b')]);_0x534385[_0x04f9('0x33')]=_[_0x04f9('0x2e')](_0x36091e[_0x04f9('0x33')]);_0x534385[_0x04f9('0x2f')]=_[_0x04f9('0x30')](_0x534385[_0x04f9('0x31')],_0x534385[_0x04f9('0x33')]);_0xa394e1['attributes']=_[_0x04f9('0x30')](_0x534385[_0x04f9('0x31')],qs['fields'](_0x36091e[_0x04f9('0x33')][_0x04f9('0x34')]));_0xa394e1[_0x04f9('0x32')]=_0xa394e1[_0x04f9('0x32')][_0x04f9('0x35')]?_0xa394e1[_0x04f9('0x32')]:_0x534385['model'];_0xa394e1['order']=qs[_0x04f9('0x38')](_0x36091e[_0x04f9('0x33')]['sort']);_0xa394e1['where']=qs['filters'](_[_0x04f9('0x3a')](_0x36091e[_0x04f9('0x33')],_0x534385[_0x04f9('0x2f')]));if(_0x36091e['query'][_0x04f9('0x4c')]){_0xa394e1[_0x04f9('0x39')]=_[_0x04f9('0x3d')](_0xa394e1[_0x04f9('0x39')],{'$or':_[_0x04f9('0x2a')](_0xa394e1[_0x04f9('0x32')],function(_0x21da5f){var _0x4c6e10={};_0x4c6e10[_0x21da5f]={'$like':'%'+_0x36091e[_0x04f9('0x33')][_0x04f9('0x4c')]+'%'};return _0x4c6e10;})});}_0xa394e1=_[_0x04f9('0x3d')]({},_0xa394e1,_0x36091e[_0x04f9('0x3e')]);return _0x39c587[_0x04f9('0x50')](_0xa394e1);}})[_0x04f9('0x23')](function(_0x5efe98){if(_0x5efe98){_0x243f9d=_0x5efe98[_0x04f9('0x35')];if(!_0x36091e[_0x04f9('0x33')][_0x04f9('0x36')]('nolimit')){_0xa394e1[_0x04f9('0x1b')]=qs[_0x04f9('0x1b')](_0x36091e[_0x04f9('0x33')]['limit']);_0xa394e1['offset']=qs[_0x04f9('0x19')](_0x36091e[_0x04f9('0x33')][_0x04f9('0x19')]);}return _0x39c587[_0x04f9('0x50')](_0xa394e1);}})[_0x04f9('0x23')](function(_0xc52290){if(_0xc52290){return _0xc52290?{'count':_0x243f9d,'rows':_0xc52290}:null;}})[_0x04f9('0x23')](respondWithResult(_0x206b83,null))[_0x04f9('0x48')](handleError(_0x206b83,null));};exports['setTags']=function(_0x3a25f9,_0x8f17c5,_0x4a9cc4){if(_0x3a25f9[_0x04f9('0x47')]['id']){delete _0x3a25f9['body']['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3a25f9[_0x04f9('0x43')]['id']}})[_0x04f9('0x23')](handleEntityNotFound(_0x8f17c5,null))[_0x04f9('0x23')](function(_0x14a482){if(_0x14a482){return _0x14a482['setTags'](_0x3a25f9['body'][_0x04f9('0x52')]||[]);}return null;})[_0x04f9('0x23')](respondWithResult(_0x8f17c5,null))[_0x04f9('0x48')](handleError(_0x8f17c5,null));}; \ No newline at end of file +var _0x84b6=['find','create','body','getFields','findOne','sort','filter','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','length'];(function(_0x5ea948,_0x4c13be){var _0x3535e1=function(_0x18a1c9){while(--_0x18a1c9){_0x5ea948['push'](_0x5ea948['shift']());}};_0x3535e1(++_0x4c13be);}(_0x84b6,0x151));var _0x684b=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x84b6[_0x1e3c16];return _0x47a0c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x684b('0x0'));var zipdir=require(_0x684b('0x1'));var jsonpatch=require(_0x684b('0x2'));var rp=require(_0x684b('0x3'));var moment=require(_0x684b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x684b('0x5'));var path=require(_0x684b('0x6'));var sox=require('sox');var csv=require(_0x684b('0x7'));var ejs=require(_0x684b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x684b('0x9'));var crypto=require(_0x684b('0xa'));var jsforce=require(_0x684b('0xb'));var deskjs=require(_0x684b('0xc'));var toCsv=require(_0x684b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x684b('0xd'));var authService=require(_0x684b('0xe'));var qs=require(_0x684b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x684b('0x10'));var logger=require(_0x684b('0x11'))(_0x684b('0x12'));var utils=require(_0x684b('0x13'));var config=require(_0x684b('0x14'));var licenseUtil=require(_0x684b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50a9f6,_0x124007){_0x124007=_0x124007||0xcc;return function(_0x32b1d6){if(_0x32b1d6){return _0x50a9f6[_0x684b('0x16')](_0x124007);}return _0x50a9f6[_0x684b('0x17')](_0x124007)[_0x684b('0x18')]();};}function respondWithResult(_0x285a1e,_0x5c0fe0){_0x5c0fe0=_0x5c0fe0||0xc8;return function(_0x35765c){if(_0x35765c){return _0x285a1e[_0x684b('0x17')](_0x5c0fe0)[_0x684b('0x19')](_0x35765c);}};}function respondWithFilteredResult(_0x2376bd,_0x632642){return function(_0x42b75a){if(_0x42b75a){var _0x31a947=typeof _0x632642['offset']===_0x684b('0x1a')&&typeof _0x632642[_0x684b('0x1b')]==='undefined';var _0x28bc43=_0x42b75a['count'];var _0x301263=_0x31a947?0x0:_0x632642[_0x684b('0x1c')];var _0x593ba6=_0x31a947?_0x42b75a[_0x684b('0x1d')]:_0x632642[_0x684b('0x1c')]+_0x632642[_0x684b('0x1b')];var _0x49d28a;if(_0x593ba6>=_0x28bc43){_0x593ba6=_0x28bc43;_0x49d28a=0xc8;}else{_0x49d28a=0xce;}_0x2376bd[_0x684b('0x17')](_0x49d28a);return _0x2376bd[_0x684b('0x1e')](_0x684b('0x1f'),_0x301263+'-'+_0x593ba6+'/'+_0x28bc43)[_0x684b('0x19')](_0x42b75a);}return null;};}function patchUpdates(_0x422b12){return function(_0x4024ae){try{jsonpatch['apply'](_0x4024ae,_0x422b12,!![]);}catch(_0x5e9127){return BPromise[_0x684b('0x20')](_0x5e9127);}return _0x4024ae[_0x684b('0x21')]();};}function saveUpdates(_0x202db9,_0x13ce9e){return function(_0x3f6e03){if(_0x3f6e03){return _0x3f6e03[_0x684b('0x22')](_0x202db9)[_0x684b('0x23')](function(_0xcd38b8){return _0xcd38b8;});}return null;};}function removeEntity(_0x56dfba,_0x5dc651){return function(_0x4882a9){if(_0x4882a9){return _0x4882a9[_0x684b('0x24')]()['then'](function(){_0x56dfba[_0x684b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f8ac,_0x5e1f93){return function(_0x121216){if(!_0x121216){_0x19f8ac['sendStatus'](0x194);}return _0x121216;};}function handleError(_0x243c54,_0x54bc18){_0x54bc18=_0x54bc18||0x1f4;return function(_0x10cd44){logger[_0x684b('0x25')](_0x10cd44[_0x684b('0x26')]);if(_0x10cd44[_0x684b('0x27')]){delete _0x10cd44[_0x684b('0x27')];}_0x243c54[_0x684b('0x17')](_0x54bc18)[_0x684b('0x28')](_0x10cd44);};}exports[_0x684b('0x29')]=function(_0x1d80ef,_0x90688e){var _0x37098f={},_0x4f9c9c={},_0x421401={'count':0x0,'rows':[]};var _0x327304=_[_0x684b('0x2a')](db[_0x684b('0x2b')][_0x684b('0x2c')],function(_0x3dbc15){return{'name':_0x3dbc15['fieldName'],'type':_0x3dbc15[_0x684b('0x2d')][_0x684b('0x2e')]};});_0x4f9c9c[_0x684b('0x2f')]=_[_0x684b('0x2a')](_0x327304,_0x684b('0x27'));_0x4f9c9c[_0x684b('0x30')]=_[_0x684b('0x31')](_0x1d80ef[_0x684b('0x30')]);_0x4f9c9c[_0x684b('0x32')]=_['intersection'](_0x4f9c9c[_0x684b('0x2f')],_0x4f9c9c['query']);_0x37098f['attributes']=_['intersection'](_0x4f9c9c['model'],qs['fields'](_0x1d80ef['query'][_0x684b('0x33')]));_0x37098f[_0x684b('0x34')]=_0x37098f['attributes']['length']?_0x37098f[_0x684b('0x34')]:_0x4f9c9c['model'];if(!_0x1d80ef[_0x684b('0x30')][_0x684b('0x35')](_0x684b('0x36'))){_0x37098f[_0x684b('0x1b')]=qs[_0x684b('0x1b')](_0x1d80ef[_0x684b('0x30')][_0x684b('0x1b')]);_0x37098f['offset']=qs['offset'](_0x1d80ef[_0x684b('0x30')]['offset']);}_0x37098f[_0x684b('0x37')]=qs['sort'](_0x1d80ef[_0x684b('0x30')]['sort']);_0x37098f[_0x684b('0x38')]=qs[_0x684b('0x32')](_[_0x684b('0x39')](_0x1d80ef[_0x684b('0x30')],_0x4f9c9c[_0x684b('0x32')]),_0x327304);if(_0x1d80ef['query']['filter']){_0x37098f[_0x684b('0x38')]=_[_0x684b('0x3a')](_0x37098f[_0x684b('0x38')],{'$or':_[_0x684b('0x2a')](_0x327304,function(_0x5e4810){if(_0x5e4810[_0x684b('0x2d')]!==_0x684b('0x3b')){var _0x4e53c7={};_0x4e53c7[_0x5e4810[_0x684b('0x27')]]={'$like':'%'+_0x1d80ef[_0x684b('0x30')]['filter']+'%'};return _0x4e53c7;}})});}_0x37098f=_[_0x684b('0x3a')]({},_0x37098f,_0x1d80ef[_0x684b('0x3c')]);var _0x3f7ebd={'where':_0x37098f[_0x684b('0x38')]};return db[_0x684b('0x2b')][_0x684b('0x1d')](_0x3f7ebd)['then'](function(_0x3c278b){_0x421401[_0x684b('0x1d')]=_0x3c278b;if(_0x1d80ef['query'][_0x684b('0x3d')]){_0x37098f['include']=[{'all':!![]}];}return db[_0x684b('0x2b')]['findAll'](_0x37098f);})[_0x684b('0x23')](function(_0x2e99bf){_0x421401[_0x684b('0x3e')]=_0x2e99bf;return _0x421401;})[_0x684b('0x23')](respondWithFilteredResult(_0x90688e,_0x37098f))[_0x684b('0x3f')](handleError(_0x90688e,null));};exports[_0x684b('0x40')]=function(_0x34fdea,_0x512e4e){var _0x3d8e7b={'raw':![],'where':{'id':_0x34fdea[_0x684b('0x41')]['id']}},_0x19ff58={};_0x19ff58[_0x684b('0x2f')]=_[_0x684b('0x31')](db[_0x684b('0x2b')][_0x684b('0x2c')]);_0x19ff58['query']=_['keys'](_0x34fdea[_0x684b('0x30')]);_0x19ff58[_0x684b('0x32')]=_[_0x684b('0x42')](_0x19ff58[_0x684b('0x2f')],_0x19ff58['query']);_0x3d8e7b[_0x684b('0x34')]=_[_0x684b('0x42')](_0x19ff58[_0x684b('0x2f')],qs[_0x684b('0x33')](_0x34fdea[_0x684b('0x30')][_0x684b('0x33')]));_0x3d8e7b[_0x684b('0x34')]=_0x3d8e7b[_0x684b('0x34')][_0x684b('0x43')]?_0x3d8e7b['attributes']:_0x19ff58['model'];if(_0x34fdea[_0x684b('0x30')][_0x684b('0x3d')]){_0x3d8e7b['include']=[{'all':!![]}];}_0x3d8e7b=_[_0x684b('0x3a')]({},_0x3d8e7b,_0x34fdea['options']);return db[_0x684b('0x2b')][_0x684b('0x44')](_0x3d8e7b)[_0x684b('0x23')](handleEntityNotFound(_0x512e4e,null))['then'](respondWithResult(_0x512e4e,null))[_0x684b('0x3f')](handleError(_0x512e4e,null));};exports[_0x684b('0x45')]=function(_0x3ee989,_0x540aaf){return db[_0x684b('0x2b')][_0x684b('0x45')](_0x3ee989[_0x684b('0x46')],{})[_0x684b('0x23')](respondWithResult(_0x540aaf,0xc9))[_0x684b('0x3f')](handleError(_0x540aaf,null));};exports['update']=function(_0x464d8a,_0x1b65e7){if(_0x464d8a[_0x684b('0x46')]['id']){delete _0x464d8a[_0x684b('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x684b('0x44')]({'where':{'id':_0x464d8a['params']['id']}})[_0x684b('0x23')](handleEntityNotFound(_0x1b65e7,null))[_0x684b('0x23')](saveUpdates(_0x464d8a[_0x684b('0x46')],null))[_0x684b('0x23')](respondWithResult(_0x1b65e7,null))[_0x684b('0x3f')](handleError(_0x1b65e7,null));};exports['destroy']=function(_0x2b5f78,_0x49e5f2){return db[_0x684b('0x2b')][_0x684b('0x44')]({'where':{'id':_0x2b5f78[_0x684b('0x41')]['id']}})[_0x684b('0x23')](handleEntityNotFound(_0x49e5f2,null))['then'](removeEntity(_0x49e5f2,null))[_0x684b('0x3f')](handleError(_0x49e5f2,null));};exports[_0x684b('0x47')]=function(_0x106860,_0xb0c1ef,_0x6f4ba2){var _0x3d4242={};var _0x578ca4={};var _0x1ee52c;var _0x285cf5;return db[_0x684b('0x2b')][_0x684b('0x48')]({'where':{'id':_0x106860['params']['id']}})[_0x684b('0x23')](handleEntityNotFound(_0xb0c1ef,null))['then'](function(_0x4a4fb7){if(_0x4a4fb7){_0x1ee52c=_0x4a4fb7;_0x578ca4[_0x684b('0x2f')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x578ca4[_0x684b('0x30')]=_[_0x684b('0x31')](_0x106860[_0x684b('0x30')]);_0x578ca4[_0x684b('0x32')]=_[_0x684b('0x42')](_0x578ca4[_0x684b('0x2f')],_0x578ca4[_0x684b('0x30')]);_0x3d4242[_0x684b('0x34')]=_[_0x684b('0x42')](_0x578ca4[_0x684b('0x2f')],qs['fields'](_0x106860[_0x684b('0x30')][_0x684b('0x33')]));_0x3d4242[_0x684b('0x34')]=_0x3d4242['attributes']['length']?_0x3d4242[_0x684b('0x34')]:_0x578ca4['model'];_0x3d4242[_0x684b('0x37')]=qs['sort'](_0x106860[_0x684b('0x30')][_0x684b('0x49')]);_0x3d4242[_0x684b('0x38')]=qs[_0x684b('0x32')](_[_0x684b('0x39')](_0x106860[_0x684b('0x30')],_0x578ca4[_0x684b('0x32')]));if(_0x106860['query'][_0x684b('0x4a')]){_0x3d4242[_0x684b('0x38')]=_[_0x684b('0x3a')](_0x3d4242[_0x684b('0x38')],{'$or':_[_0x684b('0x2a')](_0x3d4242[_0x684b('0x34')],function(_0x2fdc28){var _0x510d95={};_0x510d95[_0x2fdc28]={'$like':'%'+_0x106860[_0x684b('0x30')][_0x684b('0x4a')]+'%'};return _0x510d95;})});}_0x3d4242=_['merge']({},_0x3d4242,_0x106860[_0x684b('0x3c')]);return _0x1ee52c[_0x684b('0x47')](_0x3d4242);}})[_0x684b('0x23')](function(_0x37233e){if(_0x37233e){_0x285cf5=_0x37233e[_0x684b('0x43')];if(!_0x106860[_0x684b('0x30')][_0x684b('0x35')](_0x684b('0x36'))){_0x3d4242[_0x684b('0x1b')]=qs[_0x684b('0x1b')](_0x106860[_0x684b('0x30')][_0x684b('0x1b')]);_0x3d4242[_0x684b('0x1c')]=qs[_0x684b('0x1c')](_0x106860['query'][_0x684b('0x1c')]);}return _0x1ee52c[_0x684b('0x47')](_0x3d4242);}})[_0x684b('0x23')](function(_0x4a8724){if(_0x4a8724){return _0x4a8724?{'count':_0x285cf5,'rows':_0x4a8724}:null;}})[_0x684b('0x23')](respondWithResult(_0xb0c1ef,null))[_0x684b('0x3f')](handleError(_0xb0c1ef,null));};exports['getSubjects']=function(_0xb93dc0,_0x4e0454,_0x1cb176){var _0x5ab51a={};var _0x2a6a82={};var _0x55c31c;var _0x21e244;return db[_0x684b('0x2b')][_0x684b('0x48')]({'where':{'id':_0xb93dc0[_0x684b('0x41')]['id']}})[_0x684b('0x23')](handleEntityNotFound(_0x4e0454,null))['then'](function(_0x4f0dd9){if(_0x4f0dd9){_0x55c31c=_0x4f0dd9;_0x2a6a82[_0x684b('0x2f')]=_[_0x684b('0x31')](db[_0x684b('0x4b')][_0x684b('0x2c')]);_0x2a6a82[_0x684b('0x30')]=_[_0x684b('0x31')](_0xb93dc0['query']);_0x2a6a82[_0x684b('0x32')]=_[_0x684b('0x42')](_0x2a6a82[_0x684b('0x2f')],_0x2a6a82[_0x684b('0x30')]);_0x5ab51a[_0x684b('0x34')]=_[_0x684b('0x42')](_0x2a6a82[_0x684b('0x2f')],qs[_0x684b('0x33')](_0xb93dc0[_0x684b('0x30')][_0x684b('0x33')]));_0x5ab51a[_0x684b('0x34')]=_0x5ab51a[_0x684b('0x34')][_0x684b('0x43')]?_0x5ab51a[_0x684b('0x34')]:_0x2a6a82[_0x684b('0x2f')];_0x5ab51a['order']=qs[_0x684b('0x49')](_0xb93dc0['query'][_0x684b('0x49')]);_0x5ab51a['where']=qs[_0x684b('0x32')](_[_0x684b('0x39')](_0xb93dc0[_0x684b('0x30')],_0x2a6a82[_0x684b('0x32')]));if(_0xb93dc0[_0x684b('0x30')][_0x684b('0x4a')]){_0x5ab51a[_0x684b('0x38')]=_[_0x684b('0x3a')](_0x5ab51a[_0x684b('0x38')],{'$or':_[_0x684b('0x2a')](_0x5ab51a[_0x684b('0x34')],function(_0x48c3ab){var _0xacaa28={};_0xacaa28[_0x48c3ab]={'$like':'%'+_0xb93dc0['query'][_0x684b('0x4a')]+'%'};return _0xacaa28;})});}_0x5ab51a=_[_0x684b('0x3a')]({},_0x5ab51a,_0xb93dc0[_0x684b('0x3c')]);return _0x55c31c[_0x684b('0x4c')](_0x5ab51a);}})['then'](function(_0x3d1cef){if(_0x3d1cef){_0x21e244=_0x3d1cef[_0x684b('0x43')];if(!_0xb93dc0[_0x684b('0x30')][_0x684b('0x35')]('nolimit')){_0x5ab51a[_0x684b('0x1b')]=qs['limit'](_0xb93dc0[_0x684b('0x30')][_0x684b('0x1b')]);_0x5ab51a[_0x684b('0x1c')]=qs['offset'](_0xb93dc0[_0x684b('0x30')][_0x684b('0x1c')]);}return _0x55c31c['getSubjects'](_0x5ab51a);}})[_0x684b('0x23')](function(_0x4a3099){if(_0x4a3099){return _0x4a3099?{'count':_0x21e244,'rows':_0x4a3099}:null;}})[_0x684b('0x23')](respondWithResult(_0x4e0454,null))['catch'](handleError(_0x4e0454,null));};exports[_0x684b('0x4d')]=function(_0x2f3ce0,_0x23b12f,_0x13618c){var _0x1cecd8={};var _0x2c987f={};var _0x4fff6d;var _0x347ec9;return db[_0x684b('0x2b')][_0x684b('0x48')]({'where':{'id':_0x2f3ce0['params']['id']}})[_0x684b('0x23')](handleEntityNotFound(_0x23b12f,null))['then'](function(_0x3a5dbb){if(_0x3a5dbb){_0x4fff6d=_0x3a5dbb;_0x2c987f[_0x684b('0x2f')]=_[_0x684b('0x31')](db[_0x684b('0x4b')][_0x684b('0x2c')]);_0x2c987f[_0x684b('0x30')]=_[_0x684b('0x31')](_0x2f3ce0[_0x684b('0x30')]);_0x2c987f[_0x684b('0x32')]=_['intersection'](_0x2c987f['model'],_0x2c987f[_0x684b('0x30')]);_0x1cecd8[_0x684b('0x34')]=_[_0x684b('0x42')](_0x2c987f['model'],qs['fields'](_0x2f3ce0[_0x684b('0x30')][_0x684b('0x33')]));_0x1cecd8[_0x684b('0x34')]=_0x1cecd8['attributes'][_0x684b('0x43')]?_0x1cecd8[_0x684b('0x34')]:_0x2c987f[_0x684b('0x2f')];_0x1cecd8[_0x684b('0x37')]=qs[_0x684b('0x49')](_0x2f3ce0[_0x684b('0x30')][_0x684b('0x49')]);_0x1cecd8['where']=qs[_0x684b('0x32')](_[_0x684b('0x39')](_0x2f3ce0[_0x684b('0x30')],_0x2c987f[_0x684b('0x32')]));if(_0x2f3ce0[_0x684b('0x30')][_0x684b('0x4a')]){_0x1cecd8[_0x684b('0x38')]=_[_0x684b('0x3a')](_0x1cecd8[_0x684b('0x38')],{'$or':_['map'](_0x1cecd8[_0x684b('0x34')],function(_0x2c70d8){var _0x2fc370={};_0x2fc370[_0x2c70d8]={'$like':'%'+_0x2f3ce0[_0x684b('0x30')]['filter']+'%'};return _0x2fc370;})});}_0x1cecd8=_['merge']({},_0x1cecd8,_0x2f3ce0[_0x684b('0x3c')]);return _0x4fff6d[_0x684b('0x4d')](_0x1cecd8);}})['then'](function(_0x7a5dc8){if(_0x7a5dc8){_0x347ec9=_0x7a5dc8[_0x684b('0x43')];if(!_0x2f3ce0[_0x684b('0x30')][_0x684b('0x35')](_0x684b('0x36'))){_0x1cecd8[_0x684b('0x1b')]=qs[_0x684b('0x1b')](_0x2f3ce0[_0x684b('0x30')]['limit']);_0x1cecd8[_0x684b('0x1c')]=qs['offset'](_0x2f3ce0[_0x684b('0x30')][_0x684b('0x1c')]);}return _0x4fff6d[_0x684b('0x4d')](_0x1cecd8);}})[_0x684b('0x23')](function(_0x4790dc){if(_0x4790dc){return _0x4790dc?{'count':_0x347ec9,'rows':_0x4790dc}:null;}})['then'](respondWithResult(_0x23b12f,null))['catch'](handleError(_0x23b12f,null));};exports['getTags']=function(_0x34e28b,_0x3b4dcc,_0xca1bee){var _0x49513f={};var _0x4b28d0={};var _0x14d105;var _0x5376ba;return db['FreshdeskConfiguration'][_0x684b('0x48')]({'where':{'id':_0x34e28b['params']['id']}})['then'](handleEntityNotFound(_0x3b4dcc,null))[_0x684b('0x23')](function(_0x5114e2){if(_0x5114e2){_0x14d105=_0x5114e2;_0x4b28d0[_0x684b('0x2f')]=_[_0x684b('0x31')](db[_0x684b('0x4e')]['rawAttributes']);_0x4b28d0[_0x684b('0x30')]=_[_0x684b('0x31')](_0x34e28b['query']);_0x4b28d0[_0x684b('0x32')]=_[_0x684b('0x42')](_0x4b28d0[_0x684b('0x2f')],_0x4b28d0['query']);_0x49513f[_0x684b('0x34')]=_[_0x684b('0x42')](_0x4b28d0[_0x684b('0x2f')],qs['fields'](_0x34e28b[_0x684b('0x30')][_0x684b('0x33')]));_0x49513f[_0x684b('0x34')]=_0x49513f['attributes'][_0x684b('0x43')]?_0x49513f[_0x684b('0x34')]:_0x4b28d0[_0x684b('0x2f')];_0x49513f['order']=qs[_0x684b('0x49')](_0x34e28b[_0x684b('0x30')][_0x684b('0x49')]);_0x49513f[_0x684b('0x38')]=qs['filters'](_[_0x684b('0x39')](_0x34e28b[_0x684b('0x30')],_0x4b28d0[_0x684b('0x32')]));if(_0x34e28b[_0x684b('0x30')][_0x684b('0x4a')]){_0x49513f['where']=_[_0x684b('0x3a')](_0x49513f[_0x684b('0x38')],{'$or':_[_0x684b('0x2a')](_0x49513f['attributes'],function(_0x234e38){var _0x2c6092={};_0x2c6092[_0x234e38]={'$like':'%'+_0x34e28b[_0x684b('0x30')][_0x684b('0x4a')]+'%'};return _0x2c6092;})});}_0x49513f=_['merge']({},_0x49513f,_0x34e28b[_0x684b('0x3c')]);return _0x14d105['getTags'](_0x49513f);}})[_0x684b('0x23')](function(_0x36845c){if(_0x36845c){_0x5376ba=_0x36845c[_0x684b('0x43')];if(!_0x34e28b[_0x684b('0x30')][_0x684b('0x35')](_0x684b('0x36'))){_0x49513f[_0x684b('0x1b')]=qs['limit'](_0x34e28b[_0x684b('0x30')][_0x684b('0x1b')]);_0x49513f[_0x684b('0x1c')]=qs[_0x684b('0x1c')](_0x34e28b[_0x684b('0x30')][_0x684b('0x1c')]);}return _0x14d105[_0x684b('0x4f')](_0x49513f);}})[_0x684b('0x23')](function(_0x49d6d7){if(_0x49d6d7){return _0x49d6d7?{'count':_0x5376ba,'rows':_0x49d6d7}:null;}})[_0x684b('0x23')](respondWithResult(_0x3b4dcc,null))[_0x684b('0x3f')](handleError(_0x3b4dcc,null));};exports['setTags']=function(_0x2a1ad9,_0x1f47dd,_0x36092b){if(_0x2a1ad9[_0x684b('0x46')]['id']){delete _0x2a1ad9[_0x684b('0x46')]['id'];}return db[_0x684b('0x2b')]['findOne']({'where':{'id':_0x2a1ad9[_0x684b('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f47dd,null))[_0x684b('0x23')](function(_0x1f8ec5){if(_0x1f8ec5){return _0x1f8ec5['setTags'](_0x2a1ad9['body'][_0x684b('0x50')]||[]);}return null;})[_0x684b('0x23')](respondWithResult(_0x1f47dd,null))['catch'](handleError(_0x1f47dd,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index ffa65e9..f8495a9 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 _0xf5fd=['exports','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0xf5fd,0x188));var _0xdf5f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf5fd[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf5f('0x0'));var util=require(_0xdf5f('0x1'));var logger=require(_0xdf5f('0x2'))(_0xdf5f('0x3'));var moment=require(_0xdf5f('0x4'));var BPromise=require(_0xdf5f('0x5'));var rp=require(_0xdf5f('0x6'));var fs=require('fs');var path=require(_0xdf5f('0x7'));var rimraf=require(_0xdf5f('0x8'));var config=require(_0xdf5f('0x9'));var attributes=require(_0xdf5f('0xa'));module[_0xdf5f('0xb')]=function(_0x373633,_0x1bbba5){return _0x373633['define']('FreshdeskConfiguration',attributes,{'tableName':_0xdf5f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0430=['../../config/environment','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x0430,0x1b1));var _0x0043=function(_0x2d56ef,_0x399c70){_0x2d56ef=_0x2d56ef-0x0;var _0x29b4ca=_0x0430[_0x2d56ef];return _0x29b4ca;};'use strict';var _=require(_0x0043('0x0'));var util=require(_0x0043('0x1'));var logger=require(_0x0043('0x2'))('api');var moment=require(_0x0043('0x3'));var BPromise=require(_0x0043('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0043('0x5'));var rimraf=require(_0x0043('0x6'));var config=require(_0x0043('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x0043('0x8')]=function(_0x56aa7f,_0x2f3ab8){return _0x56aa7f[_0x0043('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x0043('0xa'),'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 1238451..b24be07 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 _0x2f06=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x49a58b,_0x28625d){var _0x3a9645=function(_0x15121d){while(--_0x15121d){_0x49a58b['push'](_0x49a58b['shift']());}};_0x3a9645(++_0x28625d);}(_0x2f06,0x1cd));var _0x62f0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2f06[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x62f0('0x0'));var util=require(_0x62f0('0x1'));var moment=require(_0x62f0('0x2'));var BPromise=require(_0x62f0('0x3'));var rs=require(_0x62f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62f0('0x5'))['db'];var utils=require(_0x62f0('0x6'));var logger=require(_0x62f0('0x7'))(_0x62f0('0x8'));var config=require(_0x62f0('0x9'));var jayson=require(_0x62f0('0xa'));var client=jayson[_0x62f0('0xb')][_0x62f0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41caa4,_0x297a21,_0x46e2f8){return new BPromise(function(_0x8e8838,_0x20cbe1){return client[_0x62f0('0xd')](_0x41caa4,_0x46e2f8)[_0x62f0('0xe')](function(_0x521275){logger[_0x62f0('0xf')](_0x62f0('0x10'),_0x297a21,_0x62f0('0x11'));logger[_0x62f0('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x297a21,'request\x20sent',JSON['stringify'](_0x521275));if(_0x521275[_0x62f0('0x13')]){if(_0x521275[_0x62f0('0x13')]['code']===0x1f4){logger[_0x62f0('0x13')](_0x62f0('0x10'),_0x297a21,_0x521275[_0x62f0('0x13')][_0x62f0('0x14')]);return _0x20cbe1(_0x521275[_0x62f0('0x13')]['message']);}logger[_0x62f0('0x13')](_0x62f0('0x10'),_0x297a21,_0x521275[_0x62f0('0x13')][_0x62f0('0x14')]);return _0x8e8838(_0x521275[_0x62f0('0x13')][_0x62f0('0x14')]);}else{logger['info'](_0x62f0('0x10'),_0x297a21,'request\x20sent');_0x8e8838(_0x521275[_0x62f0('0x15')][_0x62f0('0x14')]);}})[_0x62f0('0x16')](function(_0x530b97){logger[_0x62f0('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x297a21,_0x530b97);_0x20cbe1(_0x530b97);});});} \ No newline at end of file +var _0xe861=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message'];(function(_0x12a275,_0x31c510){var _0x2e63f4=function(_0x3d1a2b){while(--_0x3d1a2b){_0x12a275['push'](_0x12a275['shift']());}};_0x2e63f4(++_0x31c510);}(_0xe861,0x179));var _0x1e86=function(_0xcfc89b,_0x43479d){_0xcfc89b=_0xcfc89b-0x0;var _0x39341b=_0xe861[_0xcfc89b];return _0x39341b;};'use strict';var _=require(_0x1e86('0x0'));var util=require('util');var moment=require(_0x1e86('0x1'));var BPromise=require(_0x1e86('0x2'));var rs=require(_0x1e86('0x3'));var fs=require('fs');var Redis=require(_0x1e86('0x4'));var db=require(_0x1e86('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e86('0x6'))(_0x1e86('0x7'));var config=require(_0x1e86('0x8'));var jayson=require(_0x1e86('0x9'));var client=jayson[_0x1e86('0xa')][_0x1e86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xebf8e1,_0x5e507e,_0x54b4db){return new BPromise(function(_0x364b34,_0x1b659b){return client[_0x1e86('0xc')](_0xebf8e1,_0x54b4db)['then'](function(_0x5b9ccf){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e507e,_0x1e86('0xd'));logger['debug'](_0x1e86('0xe'),_0x5e507e,'request\x20sent',JSON['stringify'](_0x5b9ccf));if(_0x5b9ccf[_0x1e86('0xf')]){if(_0x5b9ccf[_0x1e86('0xf')][_0x1e86('0x10')]===0x1f4){logger[_0x1e86('0xf')](_0x1e86('0x11'),_0x5e507e,_0x5b9ccf['error']['message']);return _0x1b659b(_0x5b9ccf[_0x1e86('0xf')]['message']);}logger[_0x1e86('0xf')](_0x1e86('0x11'),_0x5e507e,_0x5b9ccf['error'][_0x1e86('0x12')]);return _0x364b34(_0x5b9ccf[_0x1e86('0xf')]['message']);}else{logger[_0x1e86('0x13')](_0x1e86('0x11'),_0x5e507e,_0x1e86('0xd'));_0x364b34(_0x5b9ccf[_0x1e86('0x14')][_0x1e86('0x12')]);}})[_0x1e86('0x15')](function(_0x1bd708){logger[_0x1e86('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e507e,_0x1bd708);_0x1b659b(_0x1bd708);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index cab0784..f73cd0b 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 _0xf772=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer'];(function(_0x47e8e0,_0x3418f1){var _0x3a671f=function(_0x33963d){while(--_0x33963d){_0x47e8e0['push'](_0x47e8e0['shift']());}};_0x3a671f(++_0x3418f1);}(_0xf772,0x168));var _0x2f77=function(_0x30f4f2,_0x5aef0a){_0x30f4f2=_0x30f4f2-0x0;var _0x38c6c0=_0xf772[_0x30f4f2];return _0x38c6c0;};'use strict';var multer=require(_0x2f77('0x0'));var util=require(_0x2f77('0x1'));var path=require(_0x2f77('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f77('0x3'));var router=express['Router']();var fs_extra=require(_0x2f77('0x4'));var auth=require(_0x2f77('0x5'));var interaction=require(_0x2f77('0x6'));var config=require(_0x2f77('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x2f77('0x8')]('/',auth['isAuthenticated'](),controller[_0x2f77('0x9')]);router[_0x2f77('0x8')](_0x2f77('0xa'),auth[_0x2f77('0xb')](),controller[_0x2f77('0xc')]);router[_0x2f77('0xd')]('/',auth[_0x2f77('0xb')](),controller['create']);router[_0x2f77('0xe')](_0x2f77('0xa'),auth[_0x2f77('0xb')](),controller[_0x2f77('0xf')]);router[_0x2f77('0x10')](_0x2f77('0xa'),auth[_0x2f77('0xb')](),controller[_0x2f77('0x11')]);module[_0x2f77('0x12')]=router; \ No newline at end of file +var _0x0ace=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x370bbe,_0x5a20a6){var _0x41d4e3=function(_0x3d8c22){while(--_0x3d8c22){_0x370bbe['push'](_0x370bbe['shift']());}};_0x41d4e3(++_0x5a20a6);}(_0x0ace,0xeb));var _0xe0ac=function(_0x1fd450,_0x42cbf6){_0x1fd450=_0x1fd450-0x0;var _0x4cb0a5=_0x0ace[_0x1fd450];return _0x4cb0a5;};'use strict';var multer=require(_0xe0ac('0x0'));var util=require(_0xe0ac('0x1'));var path=require('path');var timeout=require(_0xe0ac('0x2'));var express=require(_0xe0ac('0x3'));var router=express[_0xe0ac('0x4')]();var fs_extra=require(_0xe0ac('0x5'));var auth=require(_0xe0ac('0x6'));var interaction=require(_0xe0ac('0x7'));var config=require(_0xe0ac('0x8'));var controller=require(_0xe0ac('0x9'));router[_0xe0ac('0xa')]('/',auth[_0xe0ac('0xb')](),controller[_0xe0ac('0xc')]);router['get'](_0xe0ac('0xd'),auth[_0xe0ac('0xb')](),controller[_0xe0ac('0xe')]);router[_0xe0ac('0xf')]('/',auth[_0xe0ac('0xb')](),controller[_0xe0ac('0x10')]);router[_0xe0ac('0x11')](_0xe0ac('0xd'),auth[_0xe0ac('0xb')](),controller[_0xe0ac('0x12')]);router[_0xe0ac('0x13')](_0xe0ac('0xd'),auth[_0xe0ac('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 1bdd42d..553cef2 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 _0xcfef=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xcfef,0x164));var _0xfcfe=function(_0x14ac1e,_0x454c12){_0x14ac1e=_0x14ac1e-0x0;var _0x506260=_0xcfef[_0x14ac1e];return _0x506260;};'use strict';var Sequelize=require(_0xfcfe('0x0'));module[_0xfcfe('0x1')]={'type':{'type':Sequelize[_0xfcfe('0x2')](_0xfcfe('0x3'),_0xfcfe('0x4'),_0xfcfe('0x5'),_0xfcfe('0x6'),_0xfcfe('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfcfe('0x8')]},'key':{'type':Sequelize[_0xfcfe('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfcfe('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfcfe('0x8')]},'nameField':{'type':Sequelize[_0xfcfe('0x8')]},'customField':{'type':Sequelize[_0xfcfe('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfcfe('0x8')]}}; \ No newline at end of file +var _0x8bd0=['sequelize','exports','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x5b10e0,_0x8fa359){var _0x417976=function(_0x5c23c7){while(--_0x5c23c7){_0x5b10e0['push'](_0x5b10e0['shift']());}};_0x417976(++_0x8fa359);}(_0x8bd0,0xe1));var _0x08bd=function(_0x4f46e6,_0x1e71d1){_0x4f46e6=_0x4f46e6-0x0;var _0x2f1799=_0x8bd0[_0x4f46e6];return _0x2f1799;};'use strict';var Sequelize=require(_0x08bd('0x0'));module[_0x08bd('0x1')]={'type':{'type':Sequelize['ENUM'](_0x08bd('0x2'),'variable',_0x08bd('0x3'),_0x08bd('0x4'),_0x08bd('0x5')),'defaultValue':_0x08bd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x08bd('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x08bd('0x7'),_0x08bd('0x3'))},'keyContent':{'type':Sequelize[_0x08bd('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x08bd('0x6')]},'customField':{'type':Sequelize[_0x08bd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x08bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7108a2d..84b7fe4 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 _0x9348=['undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','FreshdeskField','count','include','findAll','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../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','limit'];(function(_0x4a2d63,_0x468f30){var _0x502f29=function(_0x2995ff){while(--_0x2995ff){_0x4a2d63['push'](_0x4a2d63['shift']());}};_0x502f29(++_0x468f30);}(_0x9348,0x10d));var _0x8934=function(_0x1a772f,_0x483183){_0x1a772f=_0x1a772f-0x0;var _0x512135=_0x9348[_0x1a772f];return _0x512135;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['FreshdeskField'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['FreshdeskField'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));}; \ No newline at end of file +var _0x6953=['rimraf','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6953,0x91));var _0x3695=function(_0x1f214b,_0x2fc240){_0x1f214b=_0x1f214b-0x0;var _0x472309=_0x6953[_0x1f214b];return _0x472309;};'use strict';var emlformat=require(_0x3695('0x0'));var rimraf=require(_0x3695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3695('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3695('0x3'));var util=require(_0x3695('0x4'));var path=require(_0x3695('0x5'));var sox=require('sox');var csv=require(_0x3695('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3695('0x7'));var _=require(_0x3695('0x8'));var squel=require(_0x3695('0x9'));var crypto=require(_0x3695('0xa'));var jsforce=require(_0x3695('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3695('0x6'));var querystring=require('querystring');var Papa=require(_0x3695('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3695('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3695('0xe'));var logger=require(_0x3695('0xf'))(_0x3695('0x10'));var utils=require(_0x3695('0x11'));var config=require(_0x3695('0x12'));var licenseUtil=require(_0x3695('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19080e,_0x345587){_0x345587=_0x345587||0xcc;return function(_0x212011){if(_0x212011){return _0x19080e[_0x3695('0x14')](_0x345587);}return _0x19080e[_0x3695('0x15')](_0x345587)[_0x3695('0x16')]();};}function respondWithResult(_0x439bd9,_0x4df429){_0x4df429=_0x4df429||0xc8;return function(_0x26dfc9){if(_0x26dfc9){return _0x439bd9[_0x3695('0x15')](_0x4df429)[_0x3695('0x17')](_0x26dfc9);}};}function respondWithFilteredResult(_0x4ca317,_0x3aa59d){return function(_0x231c7d){if(_0x231c7d){var _0x2cdd3=typeof _0x3aa59d[_0x3695('0x18')]===_0x3695('0x19')&&typeof _0x3aa59d[_0x3695('0x1a')]===_0x3695('0x19');var _0x4fa2d9=_0x231c7d[_0x3695('0x1b')];var _0x5edf8d=_0x2cdd3?0x0:_0x3aa59d[_0x3695('0x18')];var _0xcc93bb=_0x2cdd3?_0x231c7d[_0x3695('0x1b')]:_0x3aa59d[_0x3695('0x18')]+_0x3aa59d[_0x3695('0x1a')];var _0x5dec2a;if(_0xcc93bb>=_0x4fa2d9){_0xcc93bb=_0x4fa2d9;_0x5dec2a=0xc8;}else{_0x5dec2a=0xce;}_0x4ca317[_0x3695('0x15')](_0x5dec2a);return _0x4ca317[_0x3695('0x1c')](_0x3695('0x1d'),_0x5edf8d+'-'+_0xcc93bb+'/'+_0x4fa2d9)[_0x3695('0x17')](_0x231c7d);}return null;};}function patchUpdates(_0xc076a9){return function(_0x1ebba8){try{jsonpatch[_0x3695('0x1e')](_0x1ebba8,_0xc076a9,!![]);}catch(_0xb85811){return BPromise[_0x3695('0x1f')](_0xb85811);}return _0x1ebba8[_0x3695('0x20')]();};}function saveUpdates(_0x1b97d2,_0xf2c747){return function(_0x459f33){if(_0x459f33){return _0x459f33[_0x3695('0x21')](_0x1b97d2)['then'](function(_0x42648c){return _0x42648c;});}return null;};}function removeEntity(_0xdb0934,_0x4899c0){return function(_0x4940e9){if(_0x4940e9){return _0x4940e9[_0x3695('0x22')]()[_0x3695('0x23')](function(){_0xdb0934[_0x3695('0x15')](0xcc)[_0x3695('0x16')]();});}};}function handleEntityNotFound(_0x534d38,_0x180f77){return function(_0x48c2fd){if(!_0x48c2fd){_0x534d38[_0x3695('0x14')](0x194);}return _0x48c2fd;};}function handleError(_0x5319f4,_0xe085de){_0xe085de=_0xe085de||0x1f4;return function(_0x5adea3){logger[_0x3695('0x24')](_0x5adea3[_0x3695('0x25')]);if(_0x5adea3[_0x3695('0x26')]){delete _0x5adea3[_0x3695('0x26')];}_0x5319f4[_0x3695('0x15')](_0xe085de)[_0x3695('0x27')](_0x5adea3);};}exports['index']=function(_0x2be6ee,_0x354ae0){var _0x5f193c={},_0x392107={},_0x4d0742={'count':0x0,'rows':[]};var _0x39c39f=_[_0x3695('0x28')](db[_0x3695('0x29')][_0x3695('0x2a')],function(_0x30a5ba){return{'name':_0x30a5ba[_0x3695('0x2b')],'type':_0x30a5ba[_0x3695('0x2c')][_0x3695('0x2d')]};});_0x392107['model']=_[_0x3695('0x28')](_0x39c39f,_0x3695('0x26'));_0x392107[_0x3695('0x2e')]=_['keys'](_0x2be6ee['query']);_0x392107[_0x3695('0x2f')]=_['intersection'](_0x392107[_0x3695('0x30')],_0x392107[_0x3695('0x2e')]);_0x5f193c['attributes']=_[_0x3695('0x31')](_0x392107['model'],qs[_0x3695('0x32')](_0x2be6ee[_0x3695('0x2e')][_0x3695('0x32')]));_0x5f193c[_0x3695('0x33')]=_0x5f193c[_0x3695('0x33')][_0x3695('0x34')]?_0x5f193c['attributes']:_0x392107[_0x3695('0x30')];if(!_0x2be6ee[_0x3695('0x2e')]['hasOwnProperty'](_0x3695('0x35'))){_0x5f193c[_0x3695('0x1a')]=qs['limit'](_0x2be6ee['query']['limit']);_0x5f193c['offset']=qs[_0x3695('0x18')](_0x2be6ee[_0x3695('0x2e')]['offset']);}_0x5f193c[_0x3695('0x36')]=qs[_0x3695('0x37')](_0x2be6ee[_0x3695('0x2e')][_0x3695('0x37')]);_0x5f193c['where']=qs['filters'](_[_0x3695('0x38')](_0x2be6ee[_0x3695('0x2e')],_0x392107['filters']),_0x39c39f);if(_0x2be6ee[_0x3695('0x2e')][_0x3695('0x39')]){_0x5f193c[_0x3695('0x3a')]=_[_0x3695('0x3b')](_0x5f193c[_0x3695('0x3a')],{'$or':_[_0x3695('0x28')](_0x39c39f,function(_0x36cfd5){if(_0x36cfd5[_0x3695('0x2c')]!==_0x3695('0x3c')){var _0x927c71={};_0x927c71[_0x36cfd5[_0x3695('0x26')]]={'$like':'%'+_0x2be6ee[_0x3695('0x2e')][_0x3695('0x39')]+'%'};return _0x927c71;}})});}_0x5f193c=_[_0x3695('0x3b')]({},_0x5f193c,_0x2be6ee[_0x3695('0x3d')]);var _0x318551={'where':_0x5f193c['where']};return db[_0x3695('0x29')][_0x3695('0x1b')](_0x318551)[_0x3695('0x23')](function(_0xb0931){_0x4d0742[_0x3695('0x1b')]=_0xb0931;if(_0x2be6ee[_0x3695('0x2e')][_0x3695('0x3e')]){_0x5f193c['include']=[{'all':!![]}];}return db[_0x3695('0x29')][_0x3695('0x3f')](_0x5f193c);})[_0x3695('0x23')](function(_0x547af9){_0x4d0742[_0x3695('0x40')]=_0x547af9;return _0x4d0742;})[_0x3695('0x23')](respondWithFilteredResult(_0x354ae0,_0x5f193c))[_0x3695('0x41')](handleError(_0x354ae0,null));};exports[_0x3695('0x42')]=function(_0x22d1e1,_0x322923){var _0x4261d1={'raw':!![],'where':{'id':_0x22d1e1[_0x3695('0x43')]['id']}},_0x5b825a={};_0x5b825a['model']=_['keys'](db[_0x3695('0x29')]['rawAttributes']);_0x5b825a[_0x3695('0x2e')]=_[_0x3695('0x44')](_0x22d1e1[_0x3695('0x2e')]);_0x5b825a[_0x3695('0x2f')]=_['intersection'](_0x5b825a[_0x3695('0x30')],_0x5b825a[_0x3695('0x2e')]);_0x4261d1[_0x3695('0x33')]=_['intersection'](_0x5b825a[_0x3695('0x30')],qs[_0x3695('0x32')](_0x22d1e1[_0x3695('0x2e')][_0x3695('0x32')]));_0x4261d1[_0x3695('0x33')]=_0x4261d1[_0x3695('0x33')][_0x3695('0x34')]?_0x4261d1[_0x3695('0x33')]:_0x5b825a[_0x3695('0x30')];if(_0x22d1e1['query']['includeAll']){_0x4261d1[_0x3695('0x45')]=[{'all':!![]}];}_0x4261d1=_[_0x3695('0x3b')]({},_0x4261d1,_0x22d1e1[_0x3695('0x3d')]);return db['FreshdeskField'][_0x3695('0x46')](_0x4261d1)[_0x3695('0x23')](handleEntityNotFound(_0x322923,null))[_0x3695('0x23')](respondWithResult(_0x322923,null))['catch'](handleError(_0x322923,null));};exports[_0x3695('0x47')]=function(_0x161752,_0x3d6a61){return db[_0x3695('0x29')][_0x3695('0x47')](_0x161752['body'],{})[_0x3695('0x23')](respondWithResult(_0x3d6a61,0xc9))[_0x3695('0x41')](handleError(_0x3d6a61,null));};exports[_0x3695('0x21')]=function(_0x361a9f,_0x557619){if(_0x361a9f[_0x3695('0x48')]['id']){delete _0x361a9f['body']['id'];}return db['FreshdeskField'][_0x3695('0x46')]({'where':{'id':_0x361a9f[_0x3695('0x43')]['id']}})[_0x3695('0x23')](handleEntityNotFound(_0x557619,null))[_0x3695('0x23')](saveUpdates(_0x361a9f[_0x3695('0x48')],null))['then'](respondWithResult(_0x557619,null))['catch'](handleError(_0x557619,null));};exports['destroy']=function(_0x5173b8,_0x5eeaca){return db['FreshdeskField']['find']({'where':{'id':_0x5173b8['params']['id']}})[_0x3695('0x23')](handleEntityNotFound(_0x5eeaca,null))[_0x3695('0x23')](removeEntity(_0x5eeaca,null))['catch'](handleError(_0x5eeaca,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 36ca2ae..29d0ee7 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 _0x209f=['freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields'];(function(_0x5197e6,_0x3cd1d1){var _0x318101=function(_0x4be36d){while(--_0x4be36d){_0x5197e6['push'](_0x5197e6['shift']());}};_0x318101(++_0x3cd1d1);}(_0x209f,0x199));var _0xf209=function(_0x795791,_0x33a328){_0x795791=_0x795791-0x0;var _0xed46d1=_0x209f[_0x795791];return _0xed46d1;};'use strict';var _=require(_0xf209('0x0'));var util=require('util');var logger=require(_0xf209('0x1'))(_0xf209('0x2'));var moment=require('moment');var BPromise=require(_0xf209('0x3'));var rp=require(_0xf209('0x4'));var fs=require('fs');var path=require(_0xf209('0x5'));var rimraf=require('rimraf');var config=require(_0xf209('0x6'));var attributes=require(_0xf209('0x7'));module[_0xf209('0x8')]=function(_0x24b4e2,_0x46c481){return _0x24b4e2['define'](_0xf209('0x9'),attributes,{'tableName':_0xf209('0xa'),'paranoid':![],'indexes':[{'name':_0xf209('0xb'),'fields':[_0xf209('0xc'),_0xf209('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe526=['FreshdeskField','freshdesk_unique_index','idField','FieldId','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define'];(function(_0xd03355,_0x2ffd0b){var _0x49bafd=function(_0x32dc40){while(--_0x32dc40){_0xd03355['push'](_0xd03355['shift']());}};_0x49bafd(++_0x2ffd0b);}(_0xe526,0x6c));var _0x6e52=function(_0x5b8a2d,_0x27f682){_0x5b8a2d=_0x5b8a2d-0x0;var _0x3c4bbe=_0xe526[_0x5b8a2d];return _0x3c4bbe;};'use strict';var _=require('lodash');var util=require(_0x6e52('0x0'));var logger=require('../../config/logger')(_0x6e52('0x1'));var moment=require('moment');var BPromise=require(_0x6e52('0x2'));var rp=require(_0x6e52('0x3'));var fs=require('fs');var path=require(_0x6e52('0x4'));var rimraf=require(_0x6e52('0x5'));var config=require(_0x6e52('0x6'));var attributes=require(_0x6e52('0x7'));module['exports']=function(_0xf6cc3a,_0x652124){return _0xf6cc3a[_0x6e52('0x8')](_0x6e52('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x6e52('0xa'),'fields':[_0x6e52('0xb'),_0x6e52('0xc')],'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 6c3d5ef..16cb3e8 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 _0xe42a=['request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x189c67,_0x55f88d){var _0x406e91=function(_0x3cb25f){while(--_0x3cb25f){_0x189c67['push'](_0x189c67['shift']());}};_0x406e91(++_0x55f88d);}(_0xe42a,0x1ad));var _0xae42=function(_0x4f7a0f,_0x59d351){_0x4f7a0f=_0x4f7a0f-0x0;var _0x40e483=_0xe42a[_0x4f7a0f];return _0x40e483;};'use strict';var _=require(_0xae42('0x0'));var util=require(_0xae42('0x1'));var moment=require(_0xae42('0x2'));var BPromise=require(_0xae42('0x3'));var rs=require(_0xae42('0x4'));var fs=require('fs');var Redis=require(_0xae42('0x5'));var db=require(_0xae42('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae42('0x7'))(_0xae42('0x8'));var config=require(_0xae42('0x9'));var jayson=require(_0xae42('0xa'));var client=jayson[_0xae42('0xb')][_0xae42('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39a81f,_0x368633,_0x46a0dd){return new BPromise(function(_0x2f578c,_0x520d8c){return client[_0xae42('0xd')](_0x39a81f,_0x46a0dd)[_0xae42('0xe')](function(_0xa52871){logger[_0xae42('0xf')](_0xae42('0x10'),_0x368633,_0xae42('0x11'));logger[_0xae42('0x12')](_0xae42('0x13'),_0x368633,'request\x20sent',JSON[_0xae42('0x14')](_0xa52871));if(_0xa52871[_0xae42('0x15')]){if(_0xa52871[_0xae42('0x15')][_0xae42('0x16')]===0x1f4){logger[_0xae42('0x15')]('FreshdeskField,\x20%s,\x20%s',_0x368633,_0xa52871[_0xae42('0x15')]['message']);return _0x520d8c(_0xa52871[_0xae42('0x15')]['message']);}logger[_0xae42('0x15')](_0xae42('0x10'),_0x368633,_0xa52871['error']['message']);return _0x2f578c(_0xa52871[_0xae42('0x15')][_0xae42('0x17')]);}else{logger[_0xae42('0xf')](_0xae42('0x10'),_0x368633,_0xae42('0x11'));_0x2f578c(_0xa52871[_0xae42('0x18')][_0xae42('0x17')]);}})[_0xae42('0x19')](function(_0x121f0c){logger[_0xae42('0x15')](_0xae42('0x10'),_0x368633,_0x121f0c);_0x520d8c(_0x121f0c);});});} \ No newline at end of file +var _0x92a2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x7e918f,_0x48cf10){var _0x5b35ab=function(_0x1455be){while(--_0x1455be){_0x7e918f['push'](_0x7e918f['shift']());}};_0x5b35ab(++_0x48cf10);}(_0x92a2,0x134));var _0x292a=function(_0x23a182,_0x1b0c10){_0x23a182=_0x23a182-0x0;var _0x4144b1=_0x92a2[_0x23a182];return _0x4144b1;};'use strict';var _=require(_0x292a('0x0'));var util=require('util');var moment=require(_0x292a('0x1'));var BPromise=require(_0x292a('0x2'));var rs=require(_0x292a('0x3'));var fs=require('fs');var Redis=require(_0x292a('0x4'));var db=require(_0x292a('0x5'))['db'];var utils=require(_0x292a('0x6'));var logger=require(_0x292a('0x7'))('rpc');var config=require(_0x292a('0x8'));var jayson=require(_0x292a('0x9'));var client=jayson[_0x292a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c854d,_0x523cf2,_0x23038e){return new BPromise(function(_0x259841,_0x3a2e29){return client[_0x292a('0xb')](_0x1c854d,_0x23038e)[_0x292a('0xc')](function(_0x2b98f3){logger[_0x292a('0xd')](_0x292a('0xe'),_0x523cf2,_0x292a('0xf'));logger[_0x292a('0x10')](_0x292a('0x11'),_0x523cf2,_0x292a('0xf'),JSON[_0x292a('0x12')](_0x2b98f3));if(_0x2b98f3[_0x292a('0x13')]){if(_0x2b98f3['error'][_0x292a('0x14')]===0x1f4){logger[_0x292a('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x523cf2,_0x2b98f3['error'][_0x292a('0x15')]);return _0x3a2e29(_0x2b98f3[_0x292a('0x13')]['message']);}logger[_0x292a('0x13')](_0x292a('0xe'),_0x523cf2,_0x2b98f3[_0x292a('0x13')][_0x292a('0x15')]);return _0x259841(_0x2b98f3[_0x292a('0x13')]['message']);}else{logger[_0x292a('0xd')](_0x292a('0xe'),_0x523cf2,_0x292a('0xf'));_0x259841(_0x2b98f3[_0x292a('0x16')][_0x292a('0x15')]);}})[_0x292a('0x17')](function(_0x45bda2){logger['error'](_0x292a('0xe'),_0x523cf2,_0x45bda2);_0x3a2e29(_0x45bda2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 78b6eb1..8dfae69 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 _0xe5b5=['index','/:id','show','/:id/configurations','getConfigurations','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x4395cb,_0x32a140){var _0x2833d5=function(_0x575626){while(--_0x575626){_0x4395cb['push'](_0x4395cb['shift']());}};_0x2833d5(++_0x32a140);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0xe5b5[_0x571a17];return _0x3ef337;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/fields',auth[_0x5e5b('0xc')](),controller['getFields']);router[_0x5e5b('0x12')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router[_0x5e5b('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5e5b('0x14')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x15')]);router[_0x5e5b('0x16')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller['destroy']);module[_0x5e5b('0x17')]=router; \ No newline at end of file +var _0x57f8=['/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x39b40f,_0x5633ae){var _0x223bf5=function(_0x4d3b6a){while(--_0x4d3b6a){_0x39b40f['push'](_0x39b40f['shift']());}};_0x223bf5(++_0x5633ae);}(_0x57f8,0x198));var _0x857f=function(_0x51227e,_0x21f277){_0x51227e=_0x51227e-0x0;var _0x457194=_0x57f8[_0x51227e];return _0x457194;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['getConfigurations']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['getFields']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),controller[_0x857f('0x10')]);router[_0x857f('0xf')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller[_0x857f('0x11')]);router['put'](_0x857f('0xc'),auth[_0x857f('0xb')](),controller[_0x857f('0x12')]);router[_0x857f('0x13')](_0x857f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x857f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7399308..ecf477b 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 _0x7916=['sequelize','STRING','username','remoteUri'];(function(_0x2c42fa,_0x19563e){var _0x19b5b8=function(_0x3775db){while(--_0x3775db){_0x2c42fa['push'](_0x2c42fa['shift']());}};_0x19b5b8(++_0x19563e);}(_0x7916,0x128));var _0x6791=function(_0x49e3a4,_0x263356){_0x49e3a4=_0x49e3a4-0x0;var _0x1e36a5=_0x7916[_0x49e3a4];return _0x1e36a5;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')]},'description':{'type':Sequelize[_0x6791('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6791('0x2')},'apiKey':{'type':Sequelize[_0x6791('0x1')]},'remoteUri':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5204=['exports','STRING','username','sequelize'];(function(_0x658d6c,_0x297996){var _0xba451a=function(_0x160e90){while(--_0x160e90){_0x658d6c['push'](_0x658d6c['shift']());}};_0xba451a(++_0x297996);}(_0x5204,0xdf));var _0x4520=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x5204[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 9aec5b1..f122bea 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 _0xc413=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','status','index','map','FreshsalesAccount','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','name','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','rawAttributes','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','apiKey','test','statusCode','error','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x3d0b8a,_0x2d35a6){var _0x19289b=function(_0x31d7d3){while(--_0x31d7d3){_0x3d0b8a['push'](_0x3d0b8a['shift']());}};_0x19289b(++_0x2d35a6);}(_0xc413,0x173));var _0x3c41=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xc413[_0x618414];return _0x21c19a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c41('0x0'));var zipdir=require(_0x3c41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c41('0x2'));var moment=require(_0x3c41('0x3'));var BPromise=require(_0x3c41('0x4'));var Mustache=require(_0x3c41('0x5'));var util=require('util');var path=require(_0x3c41('0x6'));var sox=require(_0x3c41('0x7'));var csv=require(_0x3c41('0x8'));var ejs=require(_0x3c41('0x9'));var fs=require('fs');var fs_extra=require(_0x3c41('0xa'));var _=require(_0x3c41('0xb'));var squel=require(_0x3c41('0xc'));var crypto=require(_0x3c41('0xd'));var jsforce=require(_0x3c41('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3c41('0xf'));var Papa=require(_0x3c41('0x10'));var Redis=require(_0x3c41('0x11'));var authService=require(_0x3c41('0x12'));var qs=require(_0x3c41('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c41('0x14'))(_0x3c41('0x15'));var utils=require(_0x3c41('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3c41('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4af4bf,_0x37b135){_0x37b135=_0x37b135||0xcc;return function(_0x1a5da0){if(_0x1a5da0){return _0x4af4bf[_0x3c41('0x18')](_0x37b135);}return _0x4af4bf['status'](_0x37b135)[_0x3c41('0x19')]();};}function respondWithResult(_0xd06aa2,_0x256850){_0x256850=_0x256850||0xc8;return function(_0x35cf3e){if(_0x35cf3e){return _0xd06aa2['status'](_0x256850)[_0x3c41('0x1a')](_0x35cf3e);}};}function respondWithFilteredResult(_0x402c1f,_0x3239a1){return function(_0x3bf421){if(_0x3bf421){var _0x2eef82=typeof _0x3239a1[_0x3c41('0x1b')]===_0x3c41('0x1c')&&typeof _0x3239a1[_0x3c41('0x1d')]===_0x3c41('0x1c');var _0x2c2f23=_0x3bf421['count'];var _0x20f0bc=_0x2eef82?0x0:_0x3239a1[_0x3c41('0x1b')];var _0x45d070=_0x2eef82?_0x3bf421[_0x3c41('0x1e')]:_0x3239a1['offset']+_0x3239a1['limit'];var _0x3eb284;if(_0x45d070>=_0x2c2f23){_0x45d070=_0x2c2f23;_0x3eb284=0xc8;}else{_0x3eb284=0xce;}_0x402c1f['status'](_0x3eb284);return _0x402c1f[_0x3c41('0x1f')](_0x3c41('0x20'),_0x20f0bc+'-'+_0x45d070+'/'+_0x2c2f23)[_0x3c41('0x1a')](_0x3bf421);}return null;};}function patchUpdates(_0xd4eb0f){return function(_0x493ede){try{jsonpatch[_0x3c41('0x21')](_0x493ede,_0xd4eb0f,!![]);}catch(_0xc3af4a){return BPromise[_0x3c41('0x22')](_0xc3af4a);}return _0x493ede[_0x3c41('0x23')]();};}function saveUpdates(_0x228d0c,_0xdabf3){return function(_0x216aa2){if(_0x216aa2){return _0x216aa2['update'](_0x228d0c)[_0x3c41('0x24')](function(_0x234f43){return _0x234f43;});}return null;};}function removeEntity(_0x4312b,_0x1063f3){return function(_0x11a530){if(_0x11a530){return _0x11a530[_0x3c41('0x25')]()[_0x3c41('0x24')](function(){_0x4312b[_0x3c41('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d24a,_0x1a74e3){return function(_0x4e8bf9){if(!_0x4e8bf9){_0x44d24a[_0x3c41('0x18')](0x194);}return _0x4e8bf9;};}function handleError(_0x2a314e,_0x5b7e75){_0x5b7e75=_0x5b7e75||0x1f4;return function(_0x24164d){logger['error'](_0x24164d['stack']);if(_0x24164d['name']){delete _0x24164d['name'];}_0x2a314e[_0x3c41('0x26')](_0x5b7e75)['send'](_0x24164d);};}exports[_0x3c41('0x27')]=function(_0x10abc6,_0x37a58f){var _0x43f825={},_0x49a87f={},_0x402a2b={'count':0x0,'rows':[]};var _0x5a42bf=_[_0x3c41('0x28')](db[_0x3c41('0x29')]['rawAttributes'],function(_0x19d3fa){return{'name':_0x19d3fa[_0x3c41('0x2a')],'type':_0x19d3fa[_0x3c41('0x2b')][_0x3c41('0x2c')]};});_0x49a87f[_0x3c41('0x2d')]=_['map'](_0x5a42bf,'name');_0x49a87f['query']=_[_0x3c41('0x2e')](_0x10abc6[_0x3c41('0x2f')]);_0x49a87f[_0x3c41('0x30')]=_[_0x3c41('0x31')](_0x49a87f[_0x3c41('0x2d')],_0x49a87f['query']);_0x43f825['attributes']=_['intersection'](_0x49a87f[_0x3c41('0x2d')],qs['fields'](_0x10abc6['query'][_0x3c41('0x32')]));_0x43f825[_0x3c41('0x33')]=_0x43f825[_0x3c41('0x33')][_0x3c41('0x34')]?_0x43f825[_0x3c41('0x33')]:_0x49a87f[_0x3c41('0x2d')];if(!_0x10abc6[_0x3c41('0x2f')]['hasOwnProperty'](_0x3c41('0x35'))){_0x43f825[_0x3c41('0x1d')]=qs[_0x3c41('0x1d')](_0x10abc6['query'][_0x3c41('0x1d')]);_0x43f825[_0x3c41('0x1b')]=qs[_0x3c41('0x1b')](_0x10abc6[_0x3c41('0x2f')]['offset']);}_0x43f825[_0x3c41('0x36')]=qs['sort'](_0x10abc6[_0x3c41('0x2f')][_0x3c41('0x37')]);_0x43f825[_0x3c41('0x38')]=qs[_0x3c41('0x30')](_[_0x3c41('0x39')](_0x10abc6[_0x3c41('0x2f')],_0x49a87f[_0x3c41('0x30')]),_0x5a42bf);if(_0x10abc6[_0x3c41('0x2f')][_0x3c41('0x3a')]){_0x43f825['where']=_['merge'](_0x43f825['where'],{'$or':_[_0x3c41('0x28')](_0x5a42bf,function(_0x42c0cb){if(_0x42c0cb[_0x3c41('0x2b')]!==_0x3c41('0x3b')){var _0x4d51ea={};_0x4d51ea[_0x42c0cb[_0x3c41('0x3c')]]={'$like':'%'+_0x10abc6[_0x3c41('0x2f')][_0x3c41('0x3a')]+'%'};return _0x4d51ea;}})});}_0x43f825=_[_0x3c41('0x3d')]({},_0x43f825,_0x10abc6[_0x3c41('0x3e')]);var _0x3d9319={'where':_0x43f825['where']};return db[_0x3c41('0x29')]['count'](_0x3d9319)[_0x3c41('0x24')](function(_0x1b77f3){_0x402a2b['count']=_0x1b77f3;if(_0x10abc6[_0x3c41('0x2f')]['includeAll']){_0x43f825[_0x3c41('0x3f')]=[{'all':!![]}];}return db[_0x3c41('0x29')][_0x3c41('0x40')](_0x43f825);})[_0x3c41('0x24')](function(_0x5bbed3){_0x402a2b[_0x3c41('0x41')]=_0x5bbed3;return _0x402a2b;})['then'](respondWithFilteredResult(_0x37a58f,_0x43f825))[_0x3c41('0x42')](handleError(_0x37a58f,null));};exports[_0x3c41('0x43')]=function(_0x48209f,_0x19b460){var _0x1dc4cb={'raw':![],'where':{'id':_0x48209f[_0x3c41('0x44')]['id']}},_0x518625={};_0x518625['model']=_['keys'](db[_0x3c41('0x29')]['rawAttributes']);_0x518625[_0x3c41('0x2f')]=_[_0x3c41('0x2e')](_0x48209f[_0x3c41('0x2f')]);_0x518625[_0x3c41('0x30')]=_['intersection'](_0x518625['model'],_0x518625['query']);_0x1dc4cb[_0x3c41('0x33')]=_[_0x3c41('0x31')](_0x518625[_0x3c41('0x2d')],qs[_0x3c41('0x32')](_0x48209f[_0x3c41('0x2f')]['fields']));_0x1dc4cb[_0x3c41('0x33')]=_0x1dc4cb['attributes'][_0x3c41('0x34')]?_0x1dc4cb[_0x3c41('0x33')]:_0x518625[_0x3c41('0x2d')];if(_0x48209f[_0x3c41('0x2f')][_0x3c41('0x45')]){_0x1dc4cb[_0x3c41('0x3f')]=[{'all':!![]}];}_0x1dc4cb=_['merge']({},_0x1dc4cb,_0x48209f['options']);return db['FreshsalesAccount'][_0x3c41('0x46')](_0x1dc4cb)[_0x3c41('0x24')](handleEntityNotFound(_0x19b460,null))[_0x3c41('0x24')](respondWithResult(_0x19b460,null))[_0x3c41('0x42')](handleError(_0x19b460,null));};exports[_0x3c41('0x47')]=function(_0x52a2f1,_0x4752db){return db['FreshsalesAccount'][_0x3c41('0x47')](_0x52a2f1[_0x3c41('0x48')],{})['then'](respondWithResult(_0x4752db,0xc9))[_0x3c41('0x42')](handleError(_0x4752db,null));};exports['update']=function(_0xc8ad9f,_0x4a06bc){if(_0xc8ad9f['body']['id']){delete _0xc8ad9f[_0x3c41('0x48')]['id'];}return db[_0x3c41('0x29')]['find']({'where':{'id':_0xc8ad9f[_0x3c41('0x44')]['id']}})[_0x3c41('0x24')](handleEntityNotFound(_0x4a06bc,null))[_0x3c41('0x24')](saveUpdates(_0xc8ad9f['body'],null))['then'](respondWithResult(_0x4a06bc,null))[_0x3c41('0x42')](handleError(_0x4a06bc,null));};exports['destroy']=function(_0xe9a4ac,_0x19dece){return db[_0x3c41('0x29')]['find']({'where':{'id':_0xe9a4ac[_0x3c41('0x44')]['id']}})['then'](handleEntityNotFound(_0x19dece,null))[_0x3c41('0x24')](removeEntity(_0x19dece,null))[_0x3c41('0x42')](handleError(_0x19dece,null));};exports[_0x3c41('0x49')]=function(_0x13214a,_0x3b1145,_0x32cee2){var _0xcd8b9f={};var _0x40312e={};var _0x2da112;var _0x3361d0;return db[_0x3c41('0x29')][_0x3c41('0x4a')]({'where':{'id':_0x13214a[_0x3c41('0x44')]['id']}})[_0x3c41('0x24')](handleEntityNotFound(_0x3b1145,null))[_0x3c41('0x24')](function(_0x1e15ea){if(_0x1e15ea){_0x2da112=_0x1e15ea;_0x40312e[_0x3c41('0x2d')]=_[_0x3c41('0x2e')](db[_0x3c41('0x4b')][_0x3c41('0x4c')]);_0x40312e[_0x3c41('0x2f')]=_[_0x3c41('0x2e')](_0x13214a[_0x3c41('0x2f')]);_0x40312e[_0x3c41('0x30')]=_[_0x3c41('0x31')](_0x40312e['model'],_0x40312e[_0x3c41('0x2f')]);_0xcd8b9f[_0x3c41('0x33')]=_[_0x3c41('0x31')](_0x40312e[_0x3c41('0x2d')],qs[_0x3c41('0x32')](_0x13214a['query'][_0x3c41('0x32')]));_0xcd8b9f[_0x3c41('0x33')]=_0xcd8b9f[_0x3c41('0x33')]['length']?_0xcd8b9f['attributes']:_0x40312e[_0x3c41('0x2d')];_0xcd8b9f[_0x3c41('0x36')]=qs[_0x3c41('0x37')](_0x13214a[_0x3c41('0x2f')][_0x3c41('0x37')]);_0xcd8b9f[_0x3c41('0x38')]=qs['filters'](_[_0x3c41('0x39')](_0x13214a[_0x3c41('0x2f')],_0x40312e[_0x3c41('0x30')]));if(_0x13214a[_0x3c41('0x2f')][_0x3c41('0x3a')]){_0xcd8b9f[_0x3c41('0x38')]=_[_0x3c41('0x3d')](_0xcd8b9f['where'],{'$or':_[_0x3c41('0x28')](_0xcd8b9f[_0x3c41('0x33')],function(_0x52cd42){var _0x48b816={};_0x48b816[_0x52cd42]={'$like':'%'+_0x13214a[_0x3c41('0x2f')][_0x3c41('0x3a')]+'%'};return _0x48b816;})});}_0xcd8b9f=_[_0x3c41('0x3d')]({},_0xcd8b9f,_0x13214a[_0x3c41('0x3e')]);return _0x2da112['getConfigurations'](_0xcd8b9f);}})['then'](function(_0x222ead){if(_0x222ead){_0x3361d0=_0x222ead[_0x3c41('0x34')];if(!_0x13214a[_0x3c41('0x2f')][_0x3c41('0x4d')]('nolimit')){_0xcd8b9f[_0x3c41('0x1d')]=qs[_0x3c41('0x1d')](_0x13214a['query'][_0x3c41('0x1d')]);_0xcd8b9f['offset']=qs['offset'](_0x13214a[_0x3c41('0x2f')][_0x3c41('0x1b')]);}return _0x2da112[_0x3c41('0x49')](_0xcd8b9f);}})[_0x3c41('0x24')](function(_0x17c179){if(_0x17c179){return _0x17c179?{'count':_0x3361d0,'rows':_0x17c179}:null;}})[_0x3c41('0x24')](respondWithResult(_0x3b1145,null))[_0x3c41('0x42')](handleError(_0x3b1145,null));};exports['addConfiguration']=function(_0x501107,_0x2ee9e9,_0x4b8a99){if(_0x501107[_0x3c41('0x48')]['id']){delete _0x501107['body']['id'];}return db[_0x3c41('0x29')][_0x3c41('0x4a')]({'where':{'id':_0x501107['params']['id']}})[_0x3c41('0x24')](handleEntityNotFound(_0x2ee9e9,null))['then'](function(_0x297e5b){if(_0x297e5b){_0x501107[_0x3c41('0x48')][_0x3c41('0x4e')]=_0x297e5b['id'];_0x501107['body'][_0x3c41('0x4f')]=integrations[_0x3c41('0x50')](_0x501107['body']['channel'],_0x501107[_0x3c41('0x48')][_0x3c41('0x2b')]);_0x501107[_0x3c41('0x48')][_0x3c41('0x51')]=integrations[_0x3c41('0x52')](_0x501107[_0x3c41('0x48')][_0x3c41('0x53')],_0x501107[_0x3c41('0x48')][_0x3c41('0x2b')]);return db[_0x3c41('0x4b')]['create'](_0x501107[_0x3c41('0x48')],{'include':[{'model':db[_0x3c41('0x54')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x3c41('0x51')}]});}return null;})['then'](respondWithResult(_0x2ee9e9,null))[_0x3c41('0x42')](handleError(_0x2ee9e9,null));};exports[_0x3c41('0x55')]=function(_0x22d706,_0x1693c4,_0x240ca4){var _0x1e239d='';var _0x1c8ddd='';return db[_0x3c41('0x29')]['findOne']({'where':{'id':_0x22d706['params']['id']},'attributes':['id',_0x3c41('0x56'),'remoteUri','apiKey']})[_0x3c41('0x24')](handleEntityNotFound(_0x1693c4,null))['then'](function(_0x2bc192){if(_0x2bc192){_0x1c8ddd=_0x2bc192[_0x3c41('0x56')];_0x1e239d=_0x2bc192[_0x3c41('0x57')];var _0x263e72=_0x2bc192[_0x3c41('0x57')]['slice'](-0x1);if(_0x263e72==='/'){_0x1e239d=_0x1e239d['substring'](0x0,_0x1e239d[_0x3c41('0x58')](_0x263e72));}return rp({'method':_0x3c41('0x59'),'uri':util['format'](_0x3c41('0x5a'),_0x1e239d,_0x3c41('0x5b')),'headers':{'Authorization':_0x3c41('0x5c')+_0x2bc192[_0x3c41('0x5d')]},'json':!![]});}})[_0x3c41('0x24')](function(_0x5021fd){if(_0x5021fd){var _0x53ea9a=_0x5021fd['users'];var _0x34f978=![];var _0x593bb0=null;for(_0x593bb0=0x0;_0x593bb0<_0x53ea9a[_0x3c41('0x34')];_0x593bb0++){if(_0x53ea9a[_0x593bb0]['email']===_0x1c8ddd){_0x34f978=!![];}}if(_0x34f978){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x1693c4,null))[_0x3c41('0x42')](function(_0x3ed0eb){var _0x2b3a27=_0x22d706[_0x3c41('0x2f')][_0x3c41('0x5e')]?0x1f4:_0x3ed0eb[_0x3c41('0x5f')]||0x1f4;logger[_0x3c41('0x60')]('getFields,\x20%s,\x20%s,\x20%s',_0x3c41('0x55'),_0x2b3a27,JSON[_0x3c41('0x61')](_0x3ed0eb));delete _0x3ed0eb[_0x3c41('0x3c')];if(_0x2b3a27===0x191){_0x2b3a27=0x190;}_0x1693c4['status'](_0x2b3a27)['send'](_0x22d706[_0x3c41('0x2f')][_0x3c41('0x5e')]?{'message':_0x3c41('0x62'),'statusCode':_0x3ed0eb[_0x3c41('0x5f')]}:_0x3ed0eb);});}; \ No newline at end of file +var _0xa2d8=['undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','getConfigurations','findOne','order','Subjects','getSubjects','channel','Descriptions','FreshsalesConfiguration','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset'];(function(_0x17c84b,_0x209fb2){var _0x168720=function(_0xdafa7f){while(--_0xdafa7f){_0x17c84b['push'](_0x17c84b['shift']());}};_0x168720(++_0x209fb2);}(_0xa2d8,0x115));var _0x8a2d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa2d8[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x8a2d('0x0'));var rimraf=require(_0x8a2d('0x1'));var zipdir=require(_0x8a2d('0x2'));var jsonpatch=require(_0x8a2d('0x3'));var rp=require('request-promise');var moment=require(_0x8a2d('0x4'));var BPromise=require(_0x8a2d('0x5'));var Mustache=require('mustache');var util=require(_0x8a2d('0x6'));var path=require(_0x8a2d('0x7'));var sox=require(_0x8a2d('0x8'));var csv=require(_0x8a2d('0x9'));var ejs=require(_0x8a2d('0xa'));var fs=require('fs');var fs_extra=require(_0x8a2d('0xb'));var _=require(_0x8a2d('0xc'));var squel=require(_0x8a2d('0xd'));var crypto=require(_0x8a2d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8a2d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8a2d('0x10'));var Papa=require(_0x8a2d('0x11'));var Redis=require(_0x8a2d('0x12'));var authService=require(_0x8a2d('0x13'));var qs=require(_0x8a2d('0x14'));var as=require(_0x8a2d('0x15'));var hardwareService=require(_0x8a2d('0x16'));var logger=require('../../config/logger')(_0x8a2d('0x17'));var utils=require('../../config/utils');var config=require(_0x8a2d('0x18'));var licenseUtil=require(_0x8a2d('0x19'));var db=require(_0x8a2d('0x1a'))['db'];var integrations=require(_0x8a2d('0x1b'));function respondWithStatusCode(_0x51c8f8,_0x540eef){_0x540eef=_0x540eef||0xcc;return function(_0x206e06){if(_0x206e06){return _0x51c8f8['sendStatus'](_0x540eef);}return _0x51c8f8[_0x8a2d('0x1c')](_0x540eef)[_0x8a2d('0x1d')]();};}function respondWithResult(_0x424faf,_0x84847b){_0x84847b=_0x84847b||0xc8;return function(_0xc60c4){if(_0xc60c4){return _0x424faf[_0x8a2d('0x1c')](_0x84847b)[_0x8a2d('0x1e')](_0xc60c4);}};}function respondWithFilteredResult(_0xc9eb09,_0x56e98b){return function(_0x4f6e7a){if(_0x4f6e7a){var _0x545db7=typeof _0x56e98b[_0x8a2d('0x1f')]===_0x8a2d('0x20')&&typeof _0x56e98b[_0x8a2d('0x21')]===_0x8a2d('0x20');var _0x2549ee=_0x4f6e7a[_0x8a2d('0x22')];var _0x5f594a=_0x545db7?0x0:_0x56e98b[_0x8a2d('0x1f')];var _0x5e84d1=_0x545db7?_0x4f6e7a[_0x8a2d('0x22')]:_0x56e98b[_0x8a2d('0x1f')]+_0x56e98b['limit'];var _0x3ffde5;if(_0x5e84d1>=_0x2549ee){_0x5e84d1=_0x2549ee;_0x3ffde5=0xc8;}else{_0x3ffde5=0xce;}_0xc9eb09['status'](_0x3ffde5);return _0xc9eb09[_0x8a2d('0x23')]('Content-Range',_0x5f594a+'-'+_0x5e84d1+'/'+_0x2549ee)['json'](_0x4f6e7a);}return null;};}function patchUpdates(_0x3eed25){return function(_0x1a4a81){try{jsonpatch[_0x8a2d('0x24')](_0x1a4a81,_0x3eed25,!![]);}catch(_0x53abf0){return BPromise['reject'](_0x53abf0);}return _0x1a4a81[_0x8a2d('0x25')]();};}function saveUpdates(_0x3a55fe,_0x46fd21){return function(_0x31b03f){if(_0x31b03f){return _0x31b03f[_0x8a2d('0x26')](_0x3a55fe)[_0x8a2d('0x27')](function(_0xfceea9){return _0xfceea9;});}return null;};}function removeEntity(_0x4a9e15,_0x431eaa){return function(_0x4decaa){if(_0x4decaa){return _0x4decaa[_0x8a2d('0x28')]()[_0x8a2d('0x27')](function(){_0x4a9e15[_0x8a2d('0x1c')](0xcc)[_0x8a2d('0x1d')]();});}};}function handleEntityNotFound(_0x4c31b3,_0xf3d64){return function(_0x516d99){if(!_0x516d99){_0x4c31b3[_0x8a2d('0x29')](0x194);}return _0x516d99;};}function handleError(_0x522e2b,_0x2df8fd){_0x2df8fd=_0x2df8fd||0x1f4;return function(_0x277247){logger['error'](_0x277247[_0x8a2d('0x2a')]);if(_0x277247['name']){delete _0x277247[_0x8a2d('0x2b')];}_0x522e2b[_0x8a2d('0x1c')](_0x2df8fd)[_0x8a2d('0x2c')](_0x277247);};}exports[_0x8a2d('0x2d')]=function(_0x53b0f8,_0x1ed4bd){var _0x4ec402={},_0x47b64b={},_0x2b5bc6={'count':0x0,'rows':[]};var _0x4390fd=_[_0x8a2d('0x2e')](db[_0x8a2d('0x2f')][_0x8a2d('0x30')],function(_0x5e3a7c){return{'name':_0x5e3a7c[_0x8a2d('0x31')],'type':_0x5e3a7c[_0x8a2d('0x32')]['key']};});_0x47b64b[_0x8a2d('0x33')]=_['map'](_0x4390fd,_0x8a2d('0x2b'));_0x47b64b['query']=_['keys'](_0x53b0f8[_0x8a2d('0x34')]);_0x47b64b[_0x8a2d('0x35')]=_[_0x8a2d('0x36')](_0x47b64b['model'],_0x47b64b['query']);_0x4ec402['attributes']=_['intersection'](_0x47b64b[_0x8a2d('0x33')],qs[_0x8a2d('0x37')](_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x37')]));_0x4ec402[_0x8a2d('0x38')]=_0x4ec402[_0x8a2d('0x38')][_0x8a2d('0x39')]?_0x4ec402[_0x8a2d('0x38')]:_0x47b64b[_0x8a2d('0x33')];if(!_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x3a')](_0x8a2d('0x3b'))){_0x4ec402[_0x8a2d('0x21')]=qs[_0x8a2d('0x21')](_0x53b0f8['query']['limit']);_0x4ec402['offset']=qs[_0x8a2d('0x1f')](_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x1f')]);}_0x4ec402['order']=qs[_0x8a2d('0x3c')](_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x3c')]);_0x4ec402['where']=qs[_0x8a2d('0x35')](_[_0x8a2d('0x3d')](_0x53b0f8[_0x8a2d('0x34')],_0x47b64b[_0x8a2d('0x35')]),_0x4390fd);if(_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x3e')]){_0x4ec402[_0x8a2d('0x3f')]=_[_0x8a2d('0x40')](_0x4ec402[_0x8a2d('0x3f')],{'$or':_[_0x8a2d('0x2e')](_0x4390fd,function(_0x8e5414){if(_0x8e5414[_0x8a2d('0x32')]!=='VIRTUAL'){var _0x48decb={};_0x48decb[_0x8e5414[_0x8a2d('0x2b')]]={'$like':'%'+_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x3e')]+'%'};return _0x48decb;}})});}_0x4ec402=_[_0x8a2d('0x40')]({},_0x4ec402,_0x53b0f8[_0x8a2d('0x41')]);var _0x37d7e9={'where':_0x4ec402['where']};return db[_0x8a2d('0x2f')][_0x8a2d('0x22')](_0x37d7e9)[_0x8a2d('0x27')](function(_0xe577ea){_0x2b5bc6[_0x8a2d('0x22')]=_0xe577ea;if(_0x53b0f8[_0x8a2d('0x34')][_0x8a2d('0x42')]){_0x4ec402[_0x8a2d('0x43')]=[{'all':!![]}];}return db[_0x8a2d('0x2f')][_0x8a2d('0x44')](_0x4ec402);})[_0x8a2d('0x27')](function(_0x5d5f51){_0x2b5bc6['rows']=_0x5d5f51;return _0x2b5bc6;})['then'](respondWithFilteredResult(_0x1ed4bd,_0x4ec402))[_0x8a2d('0x45')](handleError(_0x1ed4bd,null));};exports['show']=function(_0x1ab598,_0x16cc26){var _0xedf719={'raw':![],'where':{'id':_0x1ab598[_0x8a2d('0x46')]['id']}},_0x3aa189={};_0x3aa189['model']=_[_0x8a2d('0x47')](db[_0x8a2d('0x2f')]['rawAttributes']);_0x3aa189[_0x8a2d('0x34')]=_[_0x8a2d('0x47')](_0x1ab598[_0x8a2d('0x34')]);_0x3aa189[_0x8a2d('0x35')]=_['intersection'](_0x3aa189[_0x8a2d('0x33')],_0x3aa189['query']);_0xedf719[_0x8a2d('0x38')]=_[_0x8a2d('0x36')](_0x3aa189['model'],qs[_0x8a2d('0x37')](_0x1ab598[_0x8a2d('0x34')][_0x8a2d('0x37')]));_0xedf719['attributes']=_0xedf719['attributes']['length']?_0xedf719[_0x8a2d('0x38')]:_0x3aa189[_0x8a2d('0x33')];if(_0x1ab598[_0x8a2d('0x34')][_0x8a2d('0x42')]){_0xedf719[_0x8a2d('0x43')]=[{'all':!![]}];}_0xedf719=_[_0x8a2d('0x40')]({},_0xedf719,_0x1ab598[_0x8a2d('0x41')]);return db[_0x8a2d('0x2f')][_0x8a2d('0x48')](_0xedf719)['then'](handleEntityNotFound(_0x16cc26,null))[_0x8a2d('0x27')](respondWithResult(_0x16cc26,null))[_0x8a2d('0x45')](handleError(_0x16cc26,null));};exports[_0x8a2d('0x49')]=function(_0x1e9af1,_0x288544){return db[_0x8a2d('0x2f')]['create'](_0x1e9af1[_0x8a2d('0x4a')],{})['then'](respondWithResult(_0x288544,0xc9))[_0x8a2d('0x45')](handleError(_0x288544,null));};exports[_0x8a2d('0x26')]=function(_0x34b7d4,_0x8e5024){if(_0x34b7d4[_0x8a2d('0x4a')]['id']){delete _0x34b7d4[_0x8a2d('0x4a')]['id'];}return db[_0x8a2d('0x2f')][_0x8a2d('0x48')]({'where':{'id':_0x34b7d4[_0x8a2d('0x46')]['id']}})['then'](handleEntityNotFound(_0x8e5024,null))[_0x8a2d('0x27')](saveUpdates(_0x34b7d4[_0x8a2d('0x4a')],null))['then'](respondWithResult(_0x8e5024,null))[_0x8a2d('0x45')](handleError(_0x8e5024,null));};exports[_0x8a2d('0x28')]=function(_0x447fbf,_0x37a46f){return db[_0x8a2d('0x2f')][_0x8a2d('0x48')]({'where':{'id':_0x447fbf[_0x8a2d('0x46')]['id']}})['then'](handleEntityNotFound(_0x37a46f,null))[_0x8a2d('0x27')](removeEntity(_0x37a46f,null))[_0x8a2d('0x45')](handleError(_0x37a46f,null));};exports[_0x8a2d('0x4b')]=function(_0x5413ad,_0x47b012,_0x55947e){var _0x3961ce={};var _0x1f7087={};var _0x432002;var _0x32a5e1;return db[_0x8a2d('0x2f')][_0x8a2d('0x4c')]({'where':{'id':_0x5413ad['params']['id']}})['then'](handleEntityNotFound(_0x47b012,null))[_0x8a2d('0x27')](function(_0x1de029){if(_0x1de029){_0x432002=_0x1de029;_0x1f7087[_0x8a2d('0x33')]=_[_0x8a2d('0x47')](db['FreshsalesConfiguration'][_0x8a2d('0x30')]);_0x1f7087[_0x8a2d('0x34')]=_[_0x8a2d('0x47')](_0x5413ad[_0x8a2d('0x34')]);_0x1f7087['filters']=_['intersection'](_0x1f7087[_0x8a2d('0x33')],_0x1f7087['query']);_0x3961ce['attributes']=_[_0x8a2d('0x36')](_0x1f7087['model'],qs['fields'](_0x5413ad[_0x8a2d('0x34')]['fields']));_0x3961ce[_0x8a2d('0x38')]=_0x3961ce[_0x8a2d('0x38')][_0x8a2d('0x39')]?_0x3961ce[_0x8a2d('0x38')]:_0x1f7087[_0x8a2d('0x33')];_0x3961ce[_0x8a2d('0x4d')]=qs[_0x8a2d('0x3c')](_0x5413ad[_0x8a2d('0x34')][_0x8a2d('0x3c')]);_0x3961ce[_0x8a2d('0x3f')]=qs['filters'](_[_0x8a2d('0x3d')](_0x5413ad['query'],_0x1f7087['filters']));if(_0x5413ad[_0x8a2d('0x34')][_0x8a2d('0x3e')]){_0x3961ce['where']=_['merge'](_0x3961ce[_0x8a2d('0x3f')],{'$or':_[_0x8a2d('0x2e')](_0x3961ce[_0x8a2d('0x38')],function(_0x26fac1){var _0x558350={};_0x558350[_0x26fac1]={'$like':'%'+_0x5413ad[_0x8a2d('0x34')][_0x8a2d('0x3e')]+'%'};return _0x558350;})});}_0x3961ce=_[_0x8a2d('0x40')]({},_0x3961ce,_0x5413ad[_0x8a2d('0x41')]);return _0x432002['getConfigurations'](_0x3961ce);}})['then'](function(_0x722f34){if(_0x722f34){_0x32a5e1=_0x722f34['length'];if(!_0x5413ad[_0x8a2d('0x34')][_0x8a2d('0x3a')]('nolimit')){_0x3961ce[_0x8a2d('0x21')]=qs[_0x8a2d('0x21')](_0x5413ad[_0x8a2d('0x34')][_0x8a2d('0x21')]);_0x3961ce[_0x8a2d('0x1f')]=qs[_0x8a2d('0x1f')](_0x5413ad[_0x8a2d('0x34')][_0x8a2d('0x1f')]);}return _0x432002[_0x8a2d('0x4b')](_0x3961ce);}})[_0x8a2d('0x27')](function(_0x2738ab){if(_0x2738ab){return _0x2738ab?{'count':_0x32a5e1,'rows':_0x2738ab}:null;}})[_0x8a2d('0x27')](respondWithResult(_0x47b012,null))[_0x8a2d('0x45')](handleError(_0x47b012,null));};exports['addConfiguration']=function(_0x309884,_0x41a4fb,_0x499086){if(_0x309884[_0x8a2d('0x4a')]['id']){delete _0x309884[_0x8a2d('0x4a')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x309884[_0x8a2d('0x46')]['id']}})['then'](handleEntityNotFound(_0x41a4fb,null))[_0x8a2d('0x27')](function(_0x471be2){if(_0x471be2){_0x309884[_0x8a2d('0x4a')]['AccountId']=_0x471be2['id'];_0x309884[_0x8a2d('0x4a')][_0x8a2d('0x4e')]=integrations[_0x8a2d('0x4f')](_0x309884[_0x8a2d('0x4a')][_0x8a2d('0x50')],_0x309884[_0x8a2d('0x4a')][_0x8a2d('0x32')]);_0x309884[_0x8a2d('0x4a')][_0x8a2d('0x51')]=integrations['getDescriptions'](_0x309884[_0x8a2d('0x4a')][_0x8a2d('0x50')],_0x309884[_0x8a2d('0x4a')][_0x8a2d('0x32')]);return db[_0x8a2d('0x52')][_0x8a2d('0x49')](_0x309884[_0x8a2d('0x4a')],{'include':[{'model':db['FreshsalesField'],'as':_0x8a2d('0x4e')},{'model':db['FreshsalesField'],'as':_0x8a2d('0x51')}]});}return null;})[_0x8a2d('0x27')](respondWithResult(_0x41a4fb,null))['catch'](handleError(_0x41a4fb,null));};exports[_0x8a2d('0x53')]=function(_0x5ccc49,_0x34f4b9,_0x328f78){var _0x266b11='';var _0x5827db='';return db[_0x8a2d('0x2f')]['findOne']({'where':{'id':_0x5ccc49[_0x8a2d('0x46')]['id']},'attributes':['id',_0x8a2d('0x54'),_0x8a2d('0x55'),_0x8a2d('0x56')]})[_0x8a2d('0x27')](handleEntityNotFound(_0x34f4b9,null))[_0x8a2d('0x27')](function(_0x4bf4ed){if(_0x4bf4ed){_0x5827db=_0x4bf4ed[_0x8a2d('0x54')];_0x266b11=_0x4bf4ed[_0x8a2d('0x55')];var _0x3dd606=_0x4bf4ed[_0x8a2d('0x55')][_0x8a2d('0x57')](-0x1);if(_0x3dd606==='/'){_0x266b11=_0x266b11['substring'](0x0,_0x266b11[_0x8a2d('0x58')](_0x3dd606));}return rp({'method':_0x8a2d('0x59'),'uri':util[_0x8a2d('0x5a')](_0x8a2d('0x5b'),_0x266b11,_0x8a2d('0x5c')),'headers':{'Authorization':_0x8a2d('0x5d')+_0x4bf4ed['apiKey']},'json':!![]});}})['then'](function(_0xc389f9){if(_0xc389f9){var _0x1d3b06=_0xc389f9[_0x8a2d('0x5e')];var _0x485a7=![];var _0x18a399=null;for(_0x18a399=0x0;_0x18a399<_0x1d3b06[_0x8a2d('0x39')];_0x18a399++){if(_0x1d3b06[_0x18a399][_0x8a2d('0x5f')]===_0x5827db){_0x485a7=!![];}}if(_0x485a7){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8a2d('0x60')});}}})['then'](respondWithResult(_0x34f4b9,null))[_0x8a2d('0x45')](function(_0x31bfcb){var _0x4af850=_0x5ccc49['query'][_0x8a2d('0x61')]?0x1f4:_0x31bfcb[_0x8a2d('0x62')]||0x1f4;logger[_0x8a2d('0x63')](_0x8a2d('0x64'),'getFields',_0x4af850,JSON[_0x8a2d('0x65')](_0x31bfcb));delete _0x31bfcb['name'];if(_0x4af850===0x191){_0x4af850=0x190;}_0x34f4b9[_0x8a2d('0x1c')](_0x4af850)[_0x8a2d('0x2c')](_0x5ccc49['query'][_0x8a2d('0x61')]?{'message':_0x8a2d('0x66'),'statusCode':_0x31bfcb[_0x8a2d('0x62')]}:_0x31bfcb);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 17a2bee..4ca233a 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts'];(function(_0x4ecd85,_0x8cdecc){var _0x398c95=function(_0x4d98b5){while(--_0x4d98b5){_0x4ecd85['push'](_0x4ecd85['shift']());}};_0x398c95(++_0x8cdecc);}(_0x1261,0x144));var _0x1126=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0x1261[_0x2e4a0f];return _0x25a3cd;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x33af,0xec));var _0xf33a=function(_0x282f96,_0x2be4be){_0x282f96=_0x282f96-0x0;var _0x12d02b=_0x33af[_0x282f96];return _0x12d02b;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));var integrations=require(_0xf33a('0x8'));module['exports']=function(_0xc0dd13,_0x384b14){return _0xc0dd13[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 67eeb59..5011a54 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 _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','raw','ShowFreshsalesAccount'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'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')]('FreshsalesAccount,\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')]({'raw':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x531f75[_0x2227('0x1b')]?_0x531f75['options'][_0x2227('0x1c')]||null:null,'attributes':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'limit':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1e')]||null:null,'include':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1f')]?_[_0x2227('0x20')](_0x531f75['options'][_0x2227('0x1f')],function(_0x42d500){return{'model':db[_0x42d500['model']],'as':_0x42d500['as'],'attributes':_0x42d500[_0x2227('0x1d')],'include':_0x42d500[_0x2227('0x1f')]?_['map'](_0x42d500['include'],function(_0x17c7a4){return{'model':db[_0x17c7a4[_0x2227('0x21')]],'as':_0x17c7a4['as'],'attributes':_0x17c7a4[_0x2227('0x1d')],'include':_0x17c7a4[_0x2227('0x1f')]?_['map'](_0x17c7a4[_0x2227('0x1f')],function(_0x301304){return{'model':db[_0x301304[_0x2227('0x21')]],'as':_0x301304['as'],'attributes':_0x301304[_0x2227('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x204def){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x204def));_0x620012(_0x204def);})['catch'](function(_0x5d1d56){logger[_0x2227('0x12')]('GetFreshsalesAccount',_0x5d1d56[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0x5d1d56['message']));});});};exports['ShowFreshsalesAccount']=function(_0x1f1ba7){var _0x1818ba=this;return new Promise(function(_0x21838a,_0x4cc1e1){return db[_0x2227('0x19')]['find']({'raw':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x22')]===undefined?!![]:![]:!![],'where':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1c')]||null:null,'attributes':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'include':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')]['include']?_[_0x2227('0x20')](_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1f')],function(_0x6cd5d7){return{'model':db[_0x6cd5d7['model']],'as':_0x6cd5d7['as'],'attributes':_0x6cd5d7[_0x2227('0x1d')],'include':_0x6cd5d7[_0x2227('0x1f')]?_[_0x2227('0x20')](_0x6cd5d7[_0x2227('0x1f')],function(_0x5186a6){return{'model':db[_0x5186a6[_0x2227('0x21')]],'as':_0x5186a6['as'],'attributes':_0x5186a6[_0x2227('0x1d')],'include':_0x5186a6[_0x2227('0x1f')]?_['map'](_0x5186a6['include'],function(_0x35d9f1){return{'model':db[_0x35d9f1[_0x2227('0x21')]],'as':_0x35d9f1['as'],'attributes':_0x35d9f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2227('0xc')](function(_0x9a8cc3){logger['info'](_0x2227('0x23'),_0x1f1ba7);logger['debug'](_0x2227('0x23'),_0x1f1ba7,JSON[_0x2227('0x11')](_0x9a8cc3));_0x21838a(_0x9a8cc3);})[_0x2227('0x17')](function(_0x36db00){logger['error'](_0x2227('0x23'),_0x36db00['message'],_0x1f1ba7);_0x4cc1e1(_0x1818ba[_0x2227('0x12')](0x1f4,_0x36db00[_0x2227('0x15')]));});});}; \ No newline at end of file +var _0x2542=['options','raw','attributes','include','map','model','catch','ShowFreshsalesAccount','FreshsalesAccount','find','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','GetFreshsalesAccount','findAll'];(function(_0x309f40,_0x467a80){var _0x3d8d95=function(_0x245987){while(--_0x245987){_0x309f40['push'](_0x309f40['shift']());}};_0x3d8d95(++_0x467a80);}(_0x2542,0x169));var _0x2254=function(_0x59131,_0x507aa2){_0x59131=_0x59131-0x0;var _0x5eee1a=_0x2542[_0x59131];return _0x5eee1a;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}exports[_0x2254('0x16')]=function(_0x1ae11e){var _0x34f90e=this;return new Promise(function(_0x497724,_0x51b395){return db['FreshsalesAccount'][_0x2254('0x17')]({'raw':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')][_0x2254('0x19')]===undefined?!![]:![]:!![],'where':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')]['where']||null:null,'attributes':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')][_0x2254('0x1a')]||null:null,'limit':_0x1ae11e['options']?_0x1ae11e['options']['limit']||null:null,'include':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')][_0x2254('0x1b')]?_['map'](_0x1ae11e['options']['include'],function(_0x540020){return{'model':db[_0x540020['model']],'as':_0x540020['as'],'attributes':_0x540020['attributes'],'include':_0x540020[_0x2254('0x1b')]?_[_0x2254('0x1c')](_0x540020[_0x2254('0x1b')],function(_0x265467){return{'model':db[_0x265467[_0x2254('0x1d')]],'as':_0x265467['as'],'attributes':_0x265467[_0x2254('0x1a')],'include':_0x265467['include']?_['map'](_0x265467[_0x2254('0x1b')],function(_0x4f6877){return{'model':db[_0x4f6877[_0x2254('0x1d')]],'as':_0x4f6877['as'],'attributes':_0x4f6877[_0x2254('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2254('0xc')](function(_0x3aa0bd){logger[_0x2254('0xd')]('GetFreshsalesAccount',_0x1ae11e);logger[_0x2254('0xf')](_0x2254('0x16'),_0x1ae11e,JSON[_0x2254('0x12')](_0x3aa0bd));_0x497724(_0x3aa0bd);})[_0x2254('0x1e')](function(_0x13366a){logger[_0x2254('0x14')](_0x2254('0x16'),_0x13366a[_0x2254('0x15')],_0x1ae11e);_0x51b395(_0x34f90e[_0x2254('0x14')](0x1f4,_0x13366a[_0x2254('0x15')]));});});};exports[_0x2254('0x1f')]=function(_0xad7774){var _0x220f2a=this;return new Promise(function(_0x27d30a,_0x4577f4){return db[_0x2254('0x20')][_0x2254('0x21')]({'raw':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')][_0x2254('0x22')]||null:null,'attributes':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')][_0x2254('0x1a')]||null:null,'include':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')][_0x2254('0x1b')]?_['map'](_0xad7774[_0x2254('0x18')][_0x2254('0x1b')],function(_0x503540){return{'model':db[_0x503540[_0x2254('0x1d')]],'as':_0x503540['as'],'attributes':_0x503540[_0x2254('0x1a')],'include':_0x503540[_0x2254('0x1b')]?_[_0x2254('0x1c')](_0x503540['include'],function(_0x4a2df0){return{'model':db[_0x4a2df0[_0x2254('0x1d')]],'as':_0x4a2df0['as'],'attributes':_0x4a2df0['attributes'],'include':_0x4a2df0[_0x2254('0x1b')]?_[_0x2254('0x1c')](_0x4a2df0[_0x2254('0x1b')],function(_0x141ddc){return{'model':db[_0x141ddc[_0x2254('0x1d')]],'as':_0x141ddc['as'],'attributes':_0x141ddc[_0x2254('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2254('0xc')](function(_0x51f235){logger[_0x2254('0xd')](_0x2254('0x1f'),_0xad7774);logger[_0x2254('0xf')](_0x2254('0x1f'),_0xad7774,JSON[_0x2254('0x12')](_0x51f235));_0x27d30a(_0x51f235);})[_0x2254('0x1e')](function(_0x3e7ccb){logger[_0x2254('0x14')](_0x2254('0x1f'),_0x3e7ccb[_0x2254('0x15')],_0xad7774);_0x4577f4(_0x220f2a['error'](0x1f4,_0x3e7ccb[_0x2254('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 2c88109..0238b8f 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 _0x6e84=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','getDescriptions','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x6e84,0x104));var _0x46e8=function(_0x38d291,_0x29789d){_0x38d291=_0x38d291-0x0;var _0x31a421=_0x6e84[_0x38d291];return _0x31a421;};'use strict';var multer=require(_0x46e8('0x0'));var util=require('util');var path=require(_0x46e8('0x1'));var timeout=require(_0x46e8('0x2'));var express=require(_0x46e8('0x3'));var router=express[_0x46e8('0x4')]();var fs_extra=require(_0x46e8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x46e8('0x6'));var config=require(_0x46e8('0x7'));var controller=require(_0x46e8('0x8'));router[_0x46e8('0x9')]('/',auth[_0x46e8('0xa')](),controller['index']);router['get'](_0x46e8('0xb'),auth[_0x46e8('0xa')](),controller[_0x46e8('0xc')]);router[_0x46e8('0x9')](_0x46e8('0xd'),auth['isAuthenticated'](),controller[_0x46e8('0xe')]);router[_0x46e8('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x46e8('0xf')]);router[_0x46e8('0x9')]('/:id/fields',auth[_0x46e8('0xa')](),controller[_0x46e8('0x10')]);router[_0x46e8('0x11')]('/',auth[_0x46e8('0xa')](),controller[_0x46e8('0x12')]);router[_0x46e8('0x13')](_0x46e8('0xb'),auth[_0x46e8('0xa')](),controller[_0x46e8('0x14')]);router[_0x46e8('0x15')](_0x46e8('0xb'),auth[_0x46e8('0xa')](),controller[_0x46e8('0x16')]);module[_0x46e8('0x17')]=router; \ No newline at end of file +var _0xd477=['/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x1ea170,_0x28d157){var _0x32487e=function(_0x5bebe9){while(--_0x5bebe9){_0x1ea170['push'](_0x1ea170['shift']());}};_0x32487e(++_0x28d157);}(_0xd477,0x1ed));var _0x7d47=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0xd477[_0x15ec4e];return _0xb5e5dd;};'use strict';var multer=require(_0x7d47('0x0'));var util=require('util');var path=require(_0x7d47('0x1'));var timeout=require(_0x7d47('0x2'));var express=require(_0x7d47('0x3'));var router=express[_0x7d47('0x4')]();var fs_extra=require(_0x7d47('0x5'));var auth=require(_0x7d47('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d47('0x7'));router[_0x7d47('0x8')]('/',auth[_0x7d47('0x9')](),controller[_0x7d47('0xa')]);router['get'](_0x7d47('0xb'),auth[_0x7d47('0x9')](),controller[_0x7d47('0xc')]);router[_0x7d47('0x8')](_0x7d47('0xd'),auth[_0x7d47('0x9')](),controller['getSubjects']);router[_0x7d47('0x8')](_0x7d47('0xe'),auth[_0x7d47('0x9')](),controller[_0x7d47('0xf')]);router[_0x7d47('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7d47('0x10')]);router[_0x7d47('0x11')]('/',auth[_0x7d47('0x9')](),controller[_0x7d47('0x12')]);router[_0x7d47('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7d47('0x14')]);router[_0x7d47('0x15')](_0x7d47('0xb'),auth['isAuthenticated'](),controller[_0x7d47('0x16')]);module[_0x7d47('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 811ca79..cab570e 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 _0x41f5=['sequelize','STRING'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x41f5,0x92));var _0x541f=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x41f5[_0x3fd3a3];return _0xa3e4d5;};'use strict';var Sequelize=require(_0x541f('0x0'));module['exports']={'name':{'type':Sequelize[_0x541f('0x1')]},'description':{'type':Sequelize[_0x541f('0x1')]}}; \ No newline at end of file +var _0xae5a=['exports','STRING','sequelize'];(function(_0xad2182,_0x16d18f){var _0x2275d0=function(_0x54b76d){while(--_0x54b76d){_0xad2182['push'](_0xad2182['shift']());}};_0x2275d0(++_0x16d18f);}(_0xae5a,0xec));var _0xaae5=function(_0x8841a9,_0x11db72){_0x8841a9=_0x8841a9-0x0;var _0x207982=_0xae5a[_0x8841a9];return _0x207982;};'use strict';var Sequelize=require(_0xaae5('0x0'));module[_0xaae5('0x1')]={'name':{'type':Sequelize[_0xaae5('0x2')]},'description':{'type':Sequelize[_0xaae5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ccbae63..9c13398 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 _0xd74b=['params','keys','length','find','create','body','update','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','end','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshsalesConfiguration','includeAll','include','findAll','then','rows','catch','show'];(function(_0x29f27e,_0x2169b6){var _0x4b1fef=function(_0x20fb63){while(--_0x20fb63){_0x29f27e['push'](_0x29f27e['shift']());}};_0x4b1fef(++_0x2169b6);}(_0xd74b,0x10b));var _0xbd74=function(_0x5ebffd,_0x3b5822){_0x5ebffd=_0x5ebffd-0x0;var _0x4e10fd=_0xd74b[_0x5ebffd];return _0x4e10fd;};'use strict';var emlformat=require(_0xbd74('0x0'));var rimraf=require(_0xbd74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd74('0x2'));var moment=require('moment');var BPromise=require(_0xbd74('0x3'));var Mustache=require(_0xbd74('0x4'));var util=require(_0xbd74('0x5'));var path=require(_0xbd74('0x6'));var sox=require(_0xbd74('0x7'));var csv=require(_0xbd74('0x8'));var ejs=require(_0xbd74('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd74('0xa'));var squel=require(_0xbd74('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd74('0xc'));var deskjs=require(_0xbd74('0xd'));var toCsv=require(_0xbd74('0x8'));var querystring=require(_0xbd74('0xe'));var Papa=require(_0xbd74('0xf'));var Redis=require(_0xbd74('0x10'));var authService=require(_0xbd74('0x11'));var qs=require(_0xbd74('0x12'));var as=require(_0xbd74('0x13'));var hardwareService=require(_0xbd74('0x14'));var logger=require(_0xbd74('0x15'))(_0xbd74('0x16'));var utils=require('../../config/utils');var config=require(_0xbd74('0x17'));var licenseUtil=require(_0xbd74('0x18'));var db=require(_0xbd74('0x19'))['db'];function respondWithStatusCode(_0x334395,_0xf93088){_0xf93088=_0xf93088||0xcc;return function(_0x5adc87){if(_0x5adc87){return _0x334395[_0xbd74('0x1a')](_0xf93088);}return _0x334395[_0xbd74('0x1b')](_0xf93088)['end']();};}function respondWithResult(_0x2a29d2,_0x303695){_0x303695=_0x303695||0xc8;return function(_0x2a4ee6){if(_0x2a4ee6){return _0x2a29d2[_0xbd74('0x1b')](_0x303695)['json'](_0x2a4ee6);}};}function respondWithFilteredResult(_0x3ac3aa,_0x3da0fc){return function(_0x47ca7d){if(_0x47ca7d){var _0x2e1abe=typeof _0x3da0fc[_0xbd74('0x1c')]===_0xbd74('0x1d')&&typeof _0x3da0fc[_0xbd74('0x1e')]===_0xbd74('0x1d');var _0x3e282e=_0x47ca7d[_0xbd74('0x1f')];var _0x4b481b=_0x2e1abe?0x0:_0x3da0fc[_0xbd74('0x1c')];var _0x3e30e4=_0x2e1abe?_0x47ca7d[_0xbd74('0x1f')]:_0x3da0fc[_0xbd74('0x1c')]+_0x3da0fc[_0xbd74('0x1e')];var _0x5423b7;if(_0x3e30e4>=_0x3e282e){_0x3e30e4=_0x3e282e;_0x5423b7=0xc8;}else{_0x5423b7=0xce;}_0x3ac3aa[_0xbd74('0x1b')](_0x5423b7);return _0x3ac3aa[_0xbd74('0x20')](_0xbd74('0x21'),_0x4b481b+'-'+_0x3e30e4+'/'+_0x3e282e)[_0xbd74('0x22')](_0x47ca7d);}return null;};}function patchUpdates(_0x48e4c0){return function(_0x220fef){try{jsonpatch[_0xbd74('0x23')](_0x220fef,_0x48e4c0,!![]);}catch(_0x215995){return BPromise[_0xbd74('0x24')](_0x215995);}return _0x220fef[_0xbd74('0x25')]();};}function saveUpdates(_0x31a946,_0x1269a2){return function(_0x35aba){if(_0x35aba){return _0x35aba['update'](_0x31a946)['then'](function(_0x36cd49){return _0x36cd49;});}return null;};}function removeEntity(_0x220b1d,_0x2d7788){return function(_0x550526){if(_0x550526){return _0x550526[_0xbd74('0x26')]()['then'](function(){_0x220b1d[_0xbd74('0x1b')](0xcc)[_0xbd74('0x27')]();});}};}function handleEntityNotFound(_0x45eb0d,_0x444e47){return function(_0x4b2083){if(!_0x4b2083){_0x45eb0d[_0xbd74('0x1a')](0x194);}return _0x4b2083;};}function handleError(_0x33ab19,_0x2fcd23){_0x2fcd23=_0x2fcd23||0x1f4;return function(_0x308df9){logger[_0xbd74('0x28')](_0x308df9[_0xbd74('0x29')]);if(_0x308df9['name']){delete _0x308df9['name'];}_0x33ab19[_0xbd74('0x1b')](_0x2fcd23)[_0xbd74('0x2a')](_0x308df9);};}exports[_0xbd74('0x2b')]=function(_0x23ddf4,_0x2e3969){var _0x333a17={},_0x23a809={},_0x57bbd8={'count':0x0,'rows':[]};var _0x5e1d8c=_[_0xbd74('0x2c')](db['FreshsalesConfiguration'][_0xbd74('0x2d')],function(_0x172b09){return{'name':_0x172b09[_0xbd74('0x2e')],'type':_0x172b09[_0xbd74('0x2f')][_0xbd74('0x30')]};});_0x23a809[_0xbd74('0x31')]=_['map'](_0x5e1d8c,_0xbd74('0x32'));_0x23a809[_0xbd74('0x33')]=_['keys'](_0x23ddf4[_0xbd74('0x33')]);_0x23a809[_0xbd74('0x34')]=_[_0xbd74('0x35')](_0x23a809[_0xbd74('0x31')],_0x23a809[_0xbd74('0x33')]);_0x333a17[_0xbd74('0x36')]=_['intersection'](_0x23a809[_0xbd74('0x31')],qs[_0xbd74('0x37')](_0x23ddf4['query'][_0xbd74('0x37')]));_0x333a17[_0xbd74('0x36')]=_0x333a17[_0xbd74('0x36')]['length']?_0x333a17['attributes']:_0x23a809['model'];if(!_0x23ddf4['query'][_0xbd74('0x38')](_0xbd74('0x39'))){_0x333a17['limit']=qs[_0xbd74('0x1e')](_0x23ddf4[_0xbd74('0x33')]['limit']);_0x333a17[_0xbd74('0x1c')]=qs[_0xbd74('0x1c')](_0x23ddf4['query']['offset']);}_0x333a17[_0xbd74('0x3a')]=qs[_0xbd74('0x3b')](_0x23ddf4[_0xbd74('0x33')]['sort']);_0x333a17[_0xbd74('0x3c')]=qs[_0xbd74('0x34')](_[_0xbd74('0x3d')](_0x23ddf4[_0xbd74('0x33')],_0x23a809[_0xbd74('0x34')]),_0x5e1d8c);if(_0x23ddf4['query'][_0xbd74('0x3e')]){_0x333a17[_0xbd74('0x3c')]=_[_0xbd74('0x3f')](_0x333a17[_0xbd74('0x3c')],{'$or':_[_0xbd74('0x2c')](_0x5e1d8c,function(_0x8c99f3){if(_0x8c99f3['type']!=='VIRTUAL'){var _0x35fb3b={};_0x35fb3b[_0x8c99f3[_0xbd74('0x32')]]={'$like':'%'+_0x23ddf4['query'][_0xbd74('0x3e')]+'%'};return _0x35fb3b;}})});}_0x333a17=_[_0xbd74('0x3f')]({},_0x333a17,_0x23ddf4[_0xbd74('0x40')]);var _0x6753e8={'where':_0x333a17[_0xbd74('0x3c')]};return db[_0xbd74('0x41')][_0xbd74('0x1f')](_0x6753e8)['then'](function(_0xfbab26){_0x57bbd8[_0xbd74('0x1f')]=_0xfbab26;if(_0x23ddf4[_0xbd74('0x33')][_0xbd74('0x42')]){_0x333a17[_0xbd74('0x43')]=[{'all':!![]}];}return db[_0xbd74('0x41')][_0xbd74('0x44')](_0x333a17);})[_0xbd74('0x45')](function(_0x182e79){_0x57bbd8[_0xbd74('0x46')]=_0x182e79;return _0x57bbd8;})[_0xbd74('0x45')](respondWithFilteredResult(_0x2e3969,_0x333a17))[_0xbd74('0x47')](handleError(_0x2e3969,null));};exports[_0xbd74('0x48')]=function(_0x476e20,_0xe31fc6){var _0x337936={'raw':![],'where':{'id':_0x476e20[_0xbd74('0x49')]['id']}},_0x5bf725={};_0x5bf725['model']=_[_0xbd74('0x4a')](db[_0xbd74('0x41')][_0xbd74('0x2d')]);_0x5bf725[_0xbd74('0x33')]=_[_0xbd74('0x4a')](_0x476e20[_0xbd74('0x33')]);_0x5bf725[_0xbd74('0x34')]=_[_0xbd74('0x35')](_0x5bf725[_0xbd74('0x31')],_0x5bf725['query']);_0x337936['attributes']=_[_0xbd74('0x35')](_0x5bf725['model'],qs[_0xbd74('0x37')](_0x476e20[_0xbd74('0x33')]['fields']));_0x337936['attributes']=_0x337936[_0xbd74('0x36')][_0xbd74('0x4b')]?_0x337936['attributes']:_0x5bf725[_0xbd74('0x31')];if(_0x476e20[_0xbd74('0x33')][_0xbd74('0x42')]){_0x337936[_0xbd74('0x43')]=[{'all':!![]}];}_0x337936=_[_0xbd74('0x3f')]({},_0x337936,_0x476e20[_0xbd74('0x40')]);return db[_0xbd74('0x41')][_0xbd74('0x4c')](_0x337936)['then'](handleEntityNotFound(_0xe31fc6,null))[_0xbd74('0x45')](respondWithResult(_0xe31fc6,null))[_0xbd74('0x47')](handleError(_0xe31fc6,null));};exports[_0xbd74('0x4d')]=function(_0x3e1c41,_0x591c1e){return db['FreshsalesConfiguration'][_0xbd74('0x4d')](_0x3e1c41[_0xbd74('0x4e')],{})[_0xbd74('0x45')](respondWithResult(_0x591c1e,0xc9))[_0xbd74('0x47')](handleError(_0x591c1e,null));};exports[_0xbd74('0x4f')]=function(_0x586659,_0x220759){if(_0x586659[_0xbd74('0x4e')]['id']){delete _0x586659[_0xbd74('0x4e')]['id'];}return db[_0xbd74('0x41')][_0xbd74('0x4c')]({'where':{'id':_0x586659[_0xbd74('0x49')]['id']}})[_0xbd74('0x45')](handleEntityNotFound(_0x220759,null))[_0xbd74('0x45')](saveUpdates(_0x586659[_0xbd74('0x4e')],null))[_0xbd74('0x45')](respondWithResult(_0x220759,null))[_0xbd74('0x47')](handleError(_0x220759,null));};exports[_0xbd74('0x26')]=function(_0x8583f8,_0x3924b9){return db[_0xbd74('0x41')][_0xbd74('0x4c')]({'where':{'id':_0x8583f8[_0xbd74('0x49')]['id']}})[_0xbd74('0x45')](handleEntityNotFound(_0x3924b9,null))[_0xbd74('0x45')](removeEntity(_0x3924b9,null))[_0xbd74('0x47')](handleError(_0x3924b9,null));};exports[_0xbd74('0x50')]=function(_0x4989a1,_0x3ea77c,_0x8075b9){var _0x15b964={};var _0x5d69b1={};var _0x28f637;var _0x89984f;return db[_0xbd74('0x41')][_0xbd74('0x51')]({'where':{'id':_0x4989a1[_0xbd74('0x49')]['id']}})[_0xbd74('0x45')](handleEntityNotFound(_0x3ea77c,null))[_0xbd74('0x45')](function(_0x5eeec){if(_0x5eeec){_0x28f637=_0x5eeec;_0x5d69b1['model']=_['keys'](db[_0xbd74('0x52')]['rawAttributes']);_0x5d69b1[_0xbd74('0x33')]=_['keys'](_0x4989a1[_0xbd74('0x33')]);_0x5d69b1[_0xbd74('0x34')]=_[_0xbd74('0x35')](_0x5d69b1[_0xbd74('0x31')],_0x5d69b1[_0xbd74('0x33')]);_0x15b964['attributes']=_['intersection'](_0x5d69b1[_0xbd74('0x31')],qs[_0xbd74('0x37')](_0x4989a1['query'][_0xbd74('0x37')]));_0x15b964[_0xbd74('0x36')]=_0x15b964[_0xbd74('0x36')][_0xbd74('0x4b')]?_0x15b964['attributes']:_0x5d69b1['model'];_0x15b964[_0xbd74('0x3a')]=qs[_0xbd74('0x3b')](_0x4989a1[_0xbd74('0x33')][_0xbd74('0x3b')]);_0x15b964[_0xbd74('0x3c')]=qs[_0xbd74('0x34')](_[_0xbd74('0x3d')](_0x4989a1[_0xbd74('0x33')],_0x5d69b1[_0xbd74('0x34')]));if(_0x4989a1[_0xbd74('0x33')][_0xbd74('0x3e')]){_0x15b964['where']=_['merge'](_0x15b964[_0xbd74('0x3c')],{'$or':_[_0xbd74('0x2c')](_0x15b964[_0xbd74('0x36')],function(_0x16e19e){var _0xe47ea9={};_0xe47ea9[_0x16e19e]={'$like':'%'+_0x4989a1[_0xbd74('0x33')][_0xbd74('0x3e')]+'%'};return _0xe47ea9;})});}_0x15b964=_[_0xbd74('0x3f')]({},_0x15b964,_0x4989a1[_0xbd74('0x40')]);return _0x28f637[_0xbd74('0x50')](_0x15b964);}})[_0xbd74('0x45')](function(_0x4d9d76){if(_0x4d9d76){_0x89984f=_0x4d9d76['length'];if(!_0x4989a1[_0xbd74('0x33')][_0xbd74('0x38')](_0xbd74('0x39'))){_0x15b964[_0xbd74('0x1e')]=qs[_0xbd74('0x1e')](_0x4989a1['query']['limit']);_0x15b964[_0xbd74('0x1c')]=qs['offset'](_0x4989a1[_0xbd74('0x33')][_0xbd74('0x1c')]);}return _0x28f637[_0xbd74('0x50')](_0x15b964);}})[_0xbd74('0x45')](function(_0x228773){if(_0x228773){return _0x228773?{'count':_0x89984f,'rows':_0x228773}:null;}})[_0xbd74('0x45')](respondWithResult(_0x3ea77c,null))['catch'](handleError(_0x3ea77c,null));};exports[_0xbd74('0x53')]=function(_0x5cddfe,_0x5d4492,_0x491097){var _0x289f61={};var _0x1533d8={};var _0x1e65f3;var _0x149bc2;return db['FreshsalesConfiguration'][_0xbd74('0x51')]({'where':{'id':_0x5cddfe[_0xbd74('0x49')]['id']}})[_0xbd74('0x45')](handleEntityNotFound(_0x5d4492,null))[_0xbd74('0x45')](function(_0x516a5b){if(_0x516a5b){_0x1e65f3=_0x516a5b;_0x1533d8[_0xbd74('0x31')]=_[_0xbd74('0x4a')](db[_0xbd74('0x52')][_0xbd74('0x2d')]);_0x1533d8[_0xbd74('0x33')]=_[_0xbd74('0x4a')](_0x5cddfe[_0xbd74('0x33')]);_0x1533d8[_0xbd74('0x34')]=_[_0xbd74('0x35')](_0x1533d8[_0xbd74('0x31')],_0x1533d8[_0xbd74('0x33')]);_0x289f61[_0xbd74('0x36')]=_['intersection'](_0x1533d8[_0xbd74('0x31')],qs[_0xbd74('0x37')](_0x5cddfe[_0xbd74('0x33')][_0xbd74('0x37')]));_0x289f61['attributes']=_0x289f61[_0xbd74('0x36')][_0xbd74('0x4b')]?_0x289f61[_0xbd74('0x36')]:_0x1533d8[_0xbd74('0x31')];_0x289f61[_0xbd74('0x3a')]=qs[_0xbd74('0x3b')](_0x5cddfe[_0xbd74('0x33')][_0xbd74('0x3b')]);_0x289f61[_0xbd74('0x3c')]=qs[_0xbd74('0x34')](_[_0xbd74('0x3d')](_0x5cddfe[_0xbd74('0x33')],_0x1533d8[_0xbd74('0x34')]));if(_0x5cddfe[_0xbd74('0x33')][_0xbd74('0x3e')]){_0x289f61[_0xbd74('0x3c')]=_[_0xbd74('0x3f')](_0x289f61[_0xbd74('0x3c')],{'$or':_[_0xbd74('0x2c')](_0x289f61[_0xbd74('0x36')],function(_0x595b2a){var _0x3311f7={};_0x3311f7[_0x595b2a]={'$like':'%'+_0x5cddfe[_0xbd74('0x33')][_0xbd74('0x3e')]+'%'};return _0x3311f7;})});}_0x289f61=_[_0xbd74('0x3f')]({},_0x289f61,_0x5cddfe[_0xbd74('0x40')]);return _0x1e65f3[_0xbd74('0x53')](_0x289f61);}})[_0xbd74('0x45')](function(_0x4bf592){if(_0x4bf592){_0x149bc2=_0x4bf592['length'];if(!_0x5cddfe[_0xbd74('0x33')]['hasOwnProperty'](_0xbd74('0x39'))){_0x289f61['limit']=qs[_0xbd74('0x1e')](_0x5cddfe[_0xbd74('0x33')][_0xbd74('0x1e')]);_0x289f61[_0xbd74('0x1c')]=qs['offset'](_0x5cddfe[_0xbd74('0x33')]['offset']);}return _0x1e65f3[_0xbd74('0x53')](_0x289f61);}})[_0xbd74('0x45')](function(_0x287146){if(_0x287146){return _0x287146?{'count':_0x149bc2,'rows':_0x287146}:null;}})['then'](respondWithResult(_0x5d4492,null))[_0xbd74('0x47')](handleError(_0x5d4492,null));};exports[_0xbd74('0x54')]=function(_0xb95bbb,_0x38f5c6,_0x58a361){var _0x4793a9={};var _0x11548c={};var _0x7ae217;var _0x13af06;return db['FreshsalesConfiguration'][_0xbd74('0x51')]({'where':{'id':_0xb95bbb[_0xbd74('0x49')]['id']}})[_0xbd74('0x45')](handleEntityNotFound(_0x38f5c6,null))[_0xbd74('0x45')](function(_0x22c4f){if(_0x22c4f){_0x7ae217=_0x22c4f;_0x11548c[_0xbd74('0x31')]=_[_0xbd74('0x4a')](db[_0xbd74('0x52')][_0xbd74('0x2d')]);_0x11548c[_0xbd74('0x33')]=_[_0xbd74('0x4a')](_0xb95bbb['query']);_0x11548c['filters']=_[_0xbd74('0x35')](_0x11548c[_0xbd74('0x31')],_0x11548c[_0xbd74('0x33')]);_0x4793a9['attributes']=_[_0xbd74('0x35')](_0x11548c[_0xbd74('0x31')],qs[_0xbd74('0x37')](_0xb95bbb[_0xbd74('0x33')][_0xbd74('0x37')]));_0x4793a9[_0xbd74('0x36')]=_0x4793a9[_0xbd74('0x36')][_0xbd74('0x4b')]?_0x4793a9[_0xbd74('0x36')]:_0x11548c[_0xbd74('0x31')];_0x4793a9[_0xbd74('0x3a')]=qs['sort'](_0xb95bbb[_0xbd74('0x33')][_0xbd74('0x3b')]);_0x4793a9[_0xbd74('0x3c')]=qs[_0xbd74('0x34')](_[_0xbd74('0x3d')](_0xb95bbb[_0xbd74('0x33')],_0x11548c[_0xbd74('0x34')]));if(_0xb95bbb[_0xbd74('0x33')][_0xbd74('0x3e')]){_0x4793a9[_0xbd74('0x3c')]=_[_0xbd74('0x3f')](_0x4793a9['where'],{'$or':_[_0xbd74('0x2c')](_0x4793a9[_0xbd74('0x36')],function(_0x4d86ab){var _0x32ab71={};_0x32ab71[_0x4d86ab]={'$like':'%'+_0xb95bbb[_0xbd74('0x33')][_0xbd74('0x3e')]+'%'};return _0x32ab71;})});}_0x4793a9=_[_0xbd74('0x3f')]({},_0x4793a9,_0xb95bbb[_0xbd74('0x40')]);return _0x7ae217[_0xbd74('0x54')](_0x4793a9);}})['then'](function(_0x4624fb){if(_0x4624fb){_0x13af06=_0x4624fb[_0xbd74('0x4b')];if(!_0xb95bbb[_0xbd74('0x33')][_0xbd74('0x38')]('nolimit')){_0x4793a9[_0xbd74('0x1e')]=qs[_0xbd74('0x1e')](_0xb95bbb['query']['limit']);_0x4793a9[_0xbd74('0x1c')]=qs[_0xbd74('0x1c')](_0xb95bbb[_0xbd74('0x33')][_0xbd74('0x1c')]);}return _0x7ae217['getFields'](_0x4793a9);}})[_0xbd74('0x45')](function(_0x59f73b){if(_0x59f73b){return _0x59f73b?{'count':_0x13af06,'rows':_0x59f73b}:null;}})['then'](respondWithResult(_0x38f5c6,null))[_0xbd74('0x47')](handleError(_0x38f5c6,null));}; \ No newline at end of file +var _0x1060=['keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','findOne','FreshsalesField','order','getSubjects','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','name','send','index','map','FreshsalesConfiguration','fieldName','key','model'];(function(_0x1bc96d,_0x33d6f7){var _0x29744b=function(_0x2f31db){while(--_0x2f31db){_0x1bc96d['push'](_0x1bc96d['shift']());}};_0x29744b(++_0x33d6f7);}(_0x1060,0x14b));var _0x0106=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1060[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0x0106('0x0'));var rimraf=require(_0x0106('0x1'));var zipdir=require(_0x0106('0x2'));var jsonpatch=require(_0x0106('0x3'));var rp=require(_0x0106('0x4'));var moment=require(_0x0106('0x5'));var BPromise=require(_0x0106('0x6'));var Mustache=require(_0x0106('0x7'));var util=require(_0x0106('0x8'));var path=require(_0x0106('0x9'));var sox=require(_0x0106('0xa'));var csv=require(_0x0106('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0106('0xc'));var _=require(_0x0106('0xd'));var squel=require(_0x0106('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0106('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0106('0x10'));var Redis=require(_0x0106('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0106('0x12'));var hardwareService=require(_0x0106('0x13'));var logger=require(_0x0106('0x14'))('api');var utils=require(_0x0106('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0106('0x16'))['db'];function respondWithStatusCode(_0x243b21,_0x919723){_0x919723=_0x919723||0xcc;return function(_0x604541){if(_0x604541){return _0x243b21[_0x0106('0x17')](_0x919723);}return _0x243b21[_0x0106('0x18')](_0x919723)[_0x0106('0x19')]();};}function respondWithResult(_0x1caa87,_0x11fd5f){_0x11fd5f=_0x11fd5f||0xc8;return function(_0x26045c){if(_0x26045c){return _0x1caa87['status'](_0x11fd5f)['json'](_0x26045c);}};}function respondWithFilteredResult(_0xb296c,_0x54a724){return function(_0x1ef7e4){if(_0x1ef7e4){var _0x55432f=typeof _0x54a724[_0x0106('0x1a')]===_0x0106('0x1b')&&typeof _0x54a724[_0x0106('0x1c')]===_0x0106('0x1b');var _0x470576=_0x1ef7e4[_0x0106('0x1d')];var _0xf4edc0=_0x55432f?0x0:_0x54a724[_0x0106('0x1a')];var _0x556499=_0x55432f?_0x1ef7e4[_0x0106('0x1d')]:_0x54a724[_0x0106('0x1a')]+_0x54a724[_0x0106('0x1c')];var _0xfabf06;if(_0x556499>=_0x470576){_0x556499=_0x470576;_0xfabf06=0xc8;}else{_0xfabf06=0xce;}_0xb296c[_0x0106('0x18')](_0xfabf06);return _0xb296c[_0x0106('0x1e')]('Content-Range',_0xf4edc0+'-'+_0x556499+'/'+_0x470576)[_0x0106('0x1f')](_0x1ef7e4);}return null;};}function patchUpdates(_0x4a40e0){return function(_0x14b86a){try{jsonpatch[_0x0106('0x20')](_0x14b86a,_0x4a40e0,!![]);}catch(_0x1fc771){return BPromise[_0x0106('0x21')](_0x1fc771);}return _0x14b86a['save']();};}function saveUpdates(_0x2c34bc,_0x303fba){return function(_0x11a71a){if(_0x11a71a){return _0x11a71a['update'](_0x2c34bc)[_0x0106('0x22')](function(_0x3cf796){return _0x3cf796;});}return null;};}function removeEntity(_0x1225b7,_0x4a57ee){return function(_0x3e290a){if(_0x3e290a){return _0x3e290a[_0x0106('0x23')]()[_0x0106('0x22')](function(){_0x1225b7[_0x0106('0x18')](0xcc)[_0x0106('0x19')]();});}};}function handleEntityNotFound(_0x3c8d9c,_0x1aa812){return function(_0xfe6e65){if(!_0xfe6e65){_0x3c8d9c[_0x0106('0x17')](0x194);}return _0xfe6e65;};}function handleError(_0x151a21,_0xc984cc){_0xc984cc=_0xc984cc||0x1f4;return function(_0x1519ee){logger['error'](_0x1519ee['stack']);if(_0x1519ee[_0x0106('0x24')]){delete _0x1519ee[_0x0106('0x24')];}_0x151a21[_0x0106('0x18')](_0xc984cc)[_0x0106('0x25')](_0x1519ee);};}exports[_0x0106('0x26')]=function(_0xb0b26a,_0x88aa61){var _0x3d09e8={},_0x404db9={},_0x33d7e5={'count':0x0,'rows':[]};var _0xf1e961=_[_0x0106('0x27')](db[_0x0106('0x28')]['rawAttributes'],function(_0x425eb9){return{'name':_0x425eb9[_0x0106('0x29')],'type':_0x425eb9['type'][_0x0106('0x2a')]};});_0x404db9[_0x0106('0x2b')]=_['map'](_0xf1e961,_0x0106('0x24'));_0x404db9['query']=_[_0x0106('0x2c')](_0xb0b26a[_0x0106('0x2d')]);_0x404db9[_0x0106('0x2e')]=_['intersection'](_0x404db9[_0x0106('0x2b')],_0x404db9[_0x0106('0x2d')]);_0x3d09e8[_0x0106('0x2f')]=_[_0x0106('0x30')](_0x404db9['model'],qs[_0x0106('0x31')](_0xb0b26a[_0x0106('0x2d')]['fields']));_0x3d09e8[_0x0106('0x2f')]=_0x3d09e8[_0x0106('0x2f')][_0x0106('0x32')]?_0x3d09e8['attributes']:_0x404db9[_0x0106('0x2b')];if(!_0xb0b26a[_0x0106('0x2d')][_0x0106('0x33')](_0x0106('0x34'))){_0x3d09e8[_0x0106('0x1c')]=qs['limit'](_0xb0b26a[_0x0106('0x2d')][_0x0106('0x1c')]);_0x3d09e8[_0x0106('0x1a')]=qs['offset'](_0xb0b26a[_0x0106('0x2d')][_0x0106('0x1a')]);}_0x3d09e8['order']=qs[_0x0106('0x35')](_0xb0b26a[_0x0106('0x2d')][_0x0106('0x35')]);_0x3d09e8[_0x0106('0x36')]=qs['filters'](_[_0x0106('0x37')](_0xb0b26a[_0x0106('0x2d')],_0x404db9[_0x0106('0x2e')]),_0xf1e961);if(_0xb0b26a[_0x0106('0x2d')][_0x0106('0x38')]){_0x3d09e8[_0x0106('0x36')]=_['merge'](_0x3d09e8['where'],{'$or':_['map'](_0xf1e961,function(_0x423e79){if(_0x423e79['type']!==_0x0106('0x39')){var _0x47bb30={};_0x47bb30[_0x423e79['name']]={'$like':'%'+_0xb0b26a[_0x0106('0x2d')]['filter']+'%'};return _0x47bb30;}})});}_0x3d09e8=_[_0x0106('0x3a')]({},_0x3d09e8,_0xb0b26a[_0x0106('0x3b')]);var _0x3e58f3={'where':_0x3d09e8[_0x0106('0x36')]};return db['FreshsalesConfiguration']['count'](_0x3e58f3)[_0x0106('0x22')](function(_0x11a37f){_0x33d7e5[_0x0106('0x1d')]=_0x11a37f;if(_0xb0b26a[_0x0106('0x2d')][_0x0106('0x3c')]){_0x3d09e8[_0x0106('0x3d')]=[{'all':!![]}];}return db[_0x0106('0x28')]['findAll'](_0x3d09e8);})[_0x0106('0x22')](function(_0x1631e7){_0x33d7e5[_0x0106('0x3e')]=_0x1631e7;return _0x33d7e5;})[_0x0106('0x22')](respondWithFilteredResult(_0x88aa61,_0x3d09e8))[_0x0106('0x3f')](handleError(_0x88aa61,null));};exports['show']=function(_0x175031,_0x166952){var _0xaa3d01={'raw':![],'where':{'id':_0x175031[_0x0106('0x40')]['id']}},_0x1bce22={};_0x1bce22['model']=_[_0x0106('0x2c')](db[_0x0106('0x28')][_0x0106('0x41')]);_0x1bce22[_0x0106('0x2d')]=_[_0x0106('0x2c')](_0x175031['query']);_0x1bce22['filters']=_[_0x0106('0x30')](_0x1bce22[_0x0106('0x2b')],_0x1bce22['query']);_0xaa3d01[_0x0106('0x2f')]=_[_0x0106('0x30')](_0x1bce22[_0x0106('0x2b')],qs[_0x0106('0x31')](_0x175031[_0x0106('0x2d')]['fields']));_0xaa3d01[_0x0106('0x2f')]=_0xaa3d01[_0x0106('0x2f')][_0x0106('0x32')]?_0xaa3d01[_0x0106('0x2f')]:_0x1bce22[_0x0106('0x2b')];if(_0x175031[_0x0106('0x2d')][_0x0106('0x3c')]){_0xaa3d01[_0x0106('0x3d')]=[{'all':!![]}];}_0xaa3d01=_['merge']({},_0xaa3d01,_0x175031['options']);return db['FreshsalesConfiguration'][_0x0106('0x42')](_0xaa3d01)[_0x0106('0x22')](handleEntityNotFound(_0x166952,null))['then'](respondWithResult(_0x166952,null))[_0x0106('0x3f')](handleError(_0x166952,null));};exports['create']=function(_0x55a952,_0x5ea042){return db[_0x0106('0x28')][_0x0106('0x43')](_0x55a952['body'],{})['then'](respondWithResult(_0x5ea042,0xc9))['catch'](handleError(_0x5ea042,null));};exports['update']=function(_0x2e04e0,_0x40b7f7){if(_0x2e04e0['body']['id']){delete _0x2e04e0[_0x0106('0x44')]['id'];}return db[_0x0106('0x28')]['find']({'where':{'id':_0x2e04e0['params']['id']}})['then'](handleEntityNotFound(_0x40b7f7,null))[_0x0106('0x22')](saveUpdates(_0x2e04e0[_0x0106('0x44')],null))['then'](respondWithResult(_0x40b7f7,null))[_0x0106('0x3f')](handleError(_0x40b7f7,null));};exports[_0x0106('0x23')]=function(_0xf83e1a,_0x593d80){return db[_0x0106('0x28')][_0x0106('0x42')]({'where':{'id':_0xf83e1a[_0x0106('0x40')]['id']}})[_0x0106('0x22')](handleEntityNotFound(_0x593d80,null))[_0x0106('0x22')](removeEntity(_0x593d80,null))[_0x0106('0x3f')](handleError(_0x593d80,null));};exports['getSubjects']=function(_0x5667bb,_0x12c1b0,_0x1999a9){var _0x1b453b={};var _0x851f48={};var _0x46bd42;var _0x2f586d;return db['FreshsalesConfiguration'][_0x0106('0x45')]({'where':{'id':_0x5667bb[_0x0106('0x40')]['id']}})[_0x0106('0x22')](handleEntityNotFound(_0x12c1b0,null))[_0x0106('0x22')](function(_0x446590){if(_0x446590){_0x46bd42=_0x446590;_0x851f48['model']=_[_0x0106('0x2c')](db[_0x0106('0x46')][_0x0106('0x41')]);_0x851f48[_0x0106('0x2d')]=_[_0x0106('0x2c')](_0x5667bb['query']);_0x851f48[_0x0106('0x2e')]=_['intersection'](_0x851f48[_0x0106('0x2b')],_0x851f48[_0x0106('0x2d')]);_0x1b453b['attributes']=_[_0x0106('0x30')](_0x851f48[_0x0106('0x2b')],qs['fields'](_0x5667bb[_0x0106('0x2d')][_0x0106('0x31')]));_0x1b453b['attributes']=_0x1b453b[_0x0106('0x2f')][_0x0106('0x32')]?_0x1b453b['attributes']:_0x851f48[_0x0106('0x2b')];_0x1b453b[_0x0106('0x47')]=qs[_0x0106('0x35')](_0x5667bb['query'][_0x0106('0x35')]);_0x1b453b[_0x0106('0x36')]=qs['filters'](_[_0x0106('0x37')](_0x5667bb[_0x0106('0x2d')],_0x851f48[_0x0106('0x2e')]));if(_0x5667bb[_0x0106('0x2d')]['filter']){_0x1b453b[_0x0106('0x36')]=_['merge'](_0x1b453b[_0x0106('0x36')],{'$or':_[_0x0106('0x27')](_0x1b453b[_0x0106('0x2f')],function(_0x66ccc3){var _0x31beae={};_0x31beae[_0x66ccc3]={'$like':'%'+_0x5667bb[_0x0106('0x2d')][_0x0106('0x38')]+'%'};return _0x31beae;})});}_0x1b453b=_['merge']({},_0x1b453b,_0x5667bb[_0x0106('0x3b')]);return _0x46bd42[_0x0106('0x48')](_0x1b453b);}})['then'](function(_0x186679){if(_0x186679){_0x2f586d=_0x186679[_0x0106('0x32')];if(!_0x5667bb[_0x0106('0x2d')][_0x0106('0x33')](_0x0106('0x34'))){_0x1b453b[_0x0106('0x1c')]=qs['limit'](_0x5667bb[_0x0106('0x2d')]['limit']);_0x1b453b['offset']=qs[_0x0106('0x1a')](_0x5667bb[_0x0106('0x2d')][_0x0106('0x1a')]);}return _0x46bd42[_0x0106('0x48')](_0x1b453b);}})[_0x0106('0x22')](function(_0x127e2c){if(_0x127e2c){return _0x127e2c?{'count':_0x2f586d,'rows':_0x127e2c}:null;}})[_0x0106('0x22')](respondWithResult(_0x12c1b0,null))[_0x0106('0x3f')](handleError(_0x12c1b0,null));};exports[_0x0106('0x49')]=function(_0x16dd62,_0xdcfd96,_0x54f567){var _0x10b092={};var _0x44e5bc={};var _0x384f73;var _0x20cc99;return db[_0x0106('0x28')][_0x0106('0x45')]({'where':{'id':_0x16dd62['params']['id']}})[_0x0106('0x22')](handleEntityNotFound(_0xdcfd96,null))[_0x0106('0x22')](function(_0x11005a){if(_0x11005a){_0x384f73=_0x11005a;_0x44e5bc[_0x0106('0x2b')]=_[_0x0106('0x2c')](db[_0x0106('0x46')][_0x0106('0x41')]);_0x44e5bc[_0x0106('0x2d')]=_['keys'](_0x16dd62[_0x0106('0x2d')]);_0x44e5bc['filters']=_['intersection'](_0x44e5bc['model'],_0x44e5bc[_0x0106('0x2d')]);_0x10b092[_0x0106('0x2f')]=_['intersection'](_0x44e5bc[_0x0106('0x2b')],qs[_0x0106('0x31')](_0x16dd62['query']['fields']));_0x10b092[_0x0106('0x2f')]=_0x10b092[_0x0106('0x2f')][_0x0106('0x32')]?_0x10b092[_0x0106('0x2f')]:_0x44e5bc['model'];_0x10b092[_0x0106('0x47')]=qs[_0x0106('0x35')](_0x16dd62[_0x0106('0x2d')]['sort']);_0x10b092[_0x0106('0x36')]=qs['filters'](_['pick'](_0x16dd62[_0x0106('0x2d')],_0x44e5bc[_0x0106('0x2e')]));if(_0x16dd62[_0x0106('0x2d')]['filter']){_0x10b092[_0x0106('0x36')]=_['merge'](_0x10b092[_0x0106('0x36')],{'$or':_['map'](_0x10b092[_0x0106('0x2f')],function(_0x196b7e){var _0x2a16ea={};_0x2a16ea[_0x196b7e]={'$like':'%'+_0x16dd62[_0x0106('0x2d')][_0x0106('0x38')]+'%'};return _0x2a16ea;})});}_0x10b092=_[_0x0106('0x3a')]({},_0x10b092,_0x16dd62[_0x0106('0x3b')]);return _0x384f73[_0x0106('0x49')](_0x10b092);}})[_0x0106('0x22')](function(_0x547cfd){if(_0x547cfd){_0x20cc99=_0x547cfd[_0x0106('0x32')];if(!_0x16dd62[_0x0106('0x2d')][_0x0106('0x33')](_0x0106('0x34'))){_0x10b092[_0x0106('0x1c')]=qs[_0x0106('0x1c')](_0x16dd62[_0x0106('0x2d')][_0x0106('0x1c')]);_0x10b092['offset']=qs[_0x0106('0x1a')](_0x16dd62[_0x0106('0x2d')][_0x0106('0x1a')]);}return _0x384f73[_0x0106('0x49')](_0x10b092);}})[_0x0106('0x22')](function(_0x227b19){if(_0x227b19){return _0x227b19?{'count':_0x20cc99,'rows':_0x227b19}:null;}})[_0x0106('0x22')](respondWithResult(_0xdcfd96,null))[_0x0106('0x3f')](handleError(_0xdcfd96,null));};exports[_0x0106('0x4a')]=function(_0x481054,_0x294a15,_0x2b3680){var _0x5062e1={};var _0x1e7827={};var _0x80f63d;var _0x222f49;return db['FreshsalesConfiguration'][_0x0106('0x45')]({'where':{'id':_0x481054[_0x0106('0x40')]['id']}})[_0x0106('0x22')](handleEntityNotFound(_0x294a15,null))[_0x0106('0x22')](function(_0x41333c){if(_0x41333c){_0x80f63d=_0x41333c;_0x1e7827[_0x0106('0x2b')]=_[_0x0106('0x2c')](db[_0x0106('0x46')]['rawAttributes']);_0x1e7827['query']=_[_0x0106('0x2c')](_0x481054[_0x0106('0x2d')]);_0x1e7827[_0x0106('0x2e')]=_[_0x0106('0x30')](_0x1e7827[_0x0106('0x2b')],_0x1e7827[_0x0106('0x2d')]);_0x5062e1[_0x0106('0x2f')]=_[_0x0106('0x30')](_0x1e7827[_0x0106('0x2b')],qs[_0x0106('0x31')](_0x481054[_0x0106('0x2d')]['fields']));_0x5062e1['attributes']=_0x5062e1[_0x0106('0x2f')][_0x0106('0x32')]?_0x5062e1['attributes']:_0x1e7827['model'];_0x5062e1[_0x0106('0x47')]=qs[_0x0106('0x35')](_0x481054[_0x0106('0x2d')][_0x0106('0x35')]);_0x5062e1[_0x0106('0x36')]=qs[_0x0106('0x2e')](_[_0x0106('0x37')](_0x481054[_0x0106('0x2d')],_0x1e7827[_0x0106('0x2e')]));if(_0x481054['query'][_0x0106('0x38')]){_0x5062e1[_0x0106('0x36')]=_['merge'](_0x5062e1['where'],{'$or':_[_0x0106('0x27')](_0x5062e1['attributes'],function(_0x14f455){var _0x1d9f57={};_0x1d9f57[_0x14f455]={'$like':'%'+_0x481054[_0x0106('0x2d')][_0x0106('0x38')]+'%'};return _0x1d9f57;})});}_0x5062e1=_['merge']({},_0x5062e1,_0x481054[_0x0106('0x3b')]);return _0x80f63d[_0x0106('0x4a')](_0x5062e1);}})[_0x0106('0x22')](function(_0x4a3bf4){if(_0x4a3bf4){_0x222f49=_0x4a3bf4['length'];if(!_0x481054[_0x0106('0x2d')][_0x0106('0x33')](_0x0106('0x34'))){_0x5062e1[_0x0106('0x1c')]=qs['limit'](_0x481054[_0x0106('0x2d')][_0x0106('0x1c')]);_0x5062e1['offset']=qs[_0x0106('0x1a')](_0x481054[_0x0106('0x2d')][_0x0106('0x1a')]);}return _0x80f63d[_0x0106('0x4a')](_0x5062e1);}})[_0x0106('0x22')](function(_0x306dfc){if(_0x306dfc){return _0x306dfc?{'count':_0x222f49,'rows':_0x306dfc}:null;}})[_0x0106('0x22')](respondWithResult(_0x294a15,null))['catch'](handleError(_0x294a15,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9a805e9..141207c 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 _0x7c40=['define','FreshsalesConfiguration','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x7c40,0x14a));var _0x07c4=function(_0xe30f66,_0x201e2c){_0xe30f66=_0xe30f66-0x0;var _0x3b1784=_0x7c40[_0xe30f66];return _0x3b1784;};'use strict';var _=require(_0x07c4('0x0'));var util=require('util');var logger=require(_0x07c4('0x1'))(_0x07c4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07c4('0x3'));var rimraf=require(_0x07c4('0x4'));var config=require(_0x07c4('0x5'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0xa183ba,_0x203c50){return _0xa183ba[_0x07c4('0x6')](_0x07c4('0x7'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd77d=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','util','../../config/logger','api','moment','request-promise'];(function(_0x29ee43,_0x37f00e){var _0x4d8059=function(_0x56b52b){while(--_0x56b52b){_0x29ee43['push'](_0x29ee43['shift']());}};_0x4d8059(++_0x37f00e);}(_0xd77d,0xd7));var _0xdd77=function(_0x2df9bc,_0x4e3d97){_0x2df9bc=_0x2df9bc-0x0;var _0x4fd55c=_0xd77d[_0x2df9bc];return _0x4fd55c;};'use strict';var _=require('lodash');var util=require(_0xdd77('0x0'));var logger=require(_0xdd77('0x1'))(_0xdd77('0x2'));var moment=require(_0xdd77('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd77('0x4'));var fs=require('fs');var path=require(_0xdd77('0x5'));var rimraf=require(_0xdd77('0x6'));var config=require(_0xdd77('0x7'));var attributes=require(_0xdd77('0x8'));module['exports']=function(_0x8c25c5,_0x52bfd3){return _0x8c25c5[_0xdd77('0x9')](_0xdd77('0xa'),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 b280186..a1c54de 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 _0xefe9=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xefe9,0xf0));var _0x9efe=function(_0x251eed,_0x328654){_0x251eed=_0x251eed-0x0;var _0x13db86=_0xefe9[_0x251eed];return _0x13db86;};'use strict';var _=require('lodash');var util=require(_0x9efe('0x0'));var moment=require('moment');var BPromise=require(_0x9efe('0x1'));var rs=require(_0x9efe('0x2'));var fs=require('fs');var Redis=require(_0x9efe('0x3'));var db=require(_0x9efe('0x4'))['db'];var utils=require(_0x9efe('0x5'));var logger=require('../../config/logger')(_0x9efe('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9efe('0x7')][_0x9efe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43a536,_0x268271,_0x3be11f){return new BPromise(function(_0xe5b095,_0x385c28){return client[_0x9efe('0x9')](_0x43a536,_0x3be11f)[_0x9efe('0xa')](function(_0x36064d){logger['info'](_0x9efe('0xb'),_0x268271,_0x9efe('0xc'));logger[_0x9efe('0xd')](_0x9efe('0xe'),_0x268271,'request\x20sent',JSON[_0x9efe('0xf')](_0x36064d));if(_0x36064d['error']){if(_0x36064d['error']['code']===0x1f4){logger[_0x9efe('0x10')](_0x9efe('0xb'),_0x268271,_0x36064d[_0x9efe('0x10')][_0x9efe('0x11')]);return _0x385c28(_0x36064d[_0x9efe('0x10')][_0x9efe('0x11')]);}logger['error'](_0x9efe('0xb'),_0x268271,_0x36064d[_0x9efe('0x10')][_0x9efe('0x11')]);return _0xe5b095(_0x36064d['error']['message']);}else{logger['info'](_0x9efe('0xb'),_0x268271,_0x9efe('0xc'));_0xe5b095(_0x36064d[_0x9efe('0x12')][_0x9efe('0x11')]);}})[_0x9efe('0x13')](function(_0x74dd60){logger[_0x9efe('0x10')](_0x9efe('0xb'),_0x268271,_0x74dd60);_0x385c28(_0x74dd60);});});} \ No newline at end of file +var _0xcb5a=['code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','stringify','error'];(function(_0x2e7f42,_0x14c27d){var _0x126f6b=function(_0x5964e9){while(--_0x5964e9){_0x2e7f42['push'](_0x2e7f42['shift']());}};_0x126f6b(++_0x14c27d);}(_0xcb5a,0x1e8));var _0xacb5=function(_0x4cebba,_0x53404b){_0x4cebba=_0x4cebba-0x0;var _0x5f2ff4=_0xcb5a[_0x4cebba];return _0x5f2ff4;};'use strict';var _=require(_0xacb5('0x0'));var util=require(_0xacb5('0x1'));var moment=require(_0xacb5('0x2'));var BPromise=require(_0xacb5('0x3'));var rs=require(_0xacb5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xacb5('0x5'));var logger=require(_0xacb5('0x6'))('rpc');var config=require(_0xacb5('0x7'));var jayson=require(_0xacb5('0x8'));var client=jayson[_0xacb5('0x9')][_0xacb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xedc698,_0x48fc39,_0x79d9bc){return new BPromise(function(_0x5d11d3,_0x5a95e3){return client[_0xacb5('0xb')](_0xedc698,_0x79d9bc)[_0xacb5('0xc')](function(_0x4ac3c6){logger[_0xacb5('0xd')](_0xacb5('0xe'),_0x48fc39,'request\x20sent');logger[_0xacb5('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x48fc39,'request\x20sent',JSON[_0xacb5('0x10')](_0x4ac3c6));if(_0x4ac3c6[_0xacb5('0x11')]){if(_0x4ac3c6['error'][_0xacb5('0x12')]===0x1f4){logger[_0xacb5('0x11')](_0xacb5('0xe'),_0x48fc39,_0x4ac3c6[_0xacb5('0x11')][_0xacb5('0x13')]);return _0x5a95e3(_0x4ac3c6['error'][_0xacb5('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x48fc39,_0x4ac3c6[_0xacb5('0x11')][_0xacb5('0x13')]);return _0x5d11d3(_0x4ac3c6[_0xacb5('0x11')][_0xacb5('0x13')]);}else{logger[_0xacb5('0xd')](_0xacb5('0xe'),_0x48fc39,_0xacb5('0x14'));_0x5d11d3(_0x4ac3c6[_0xacb5('0x15')][_0xacb5('0x13')]);}})[_0xacb5('0x16')](function(_0x5731d1){logger[_0xacb5('0x11')](_0xacb5('0xe'),_0x48fc39,_0x5731d1);_0x5a95e3(_0x5731d1);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8533f8f..d8c1864 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 _0xe0b2=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xe0b2,0xec));var _0x2e0b=function(_0x5379a9,_0x234e13){_0x5379a9=_0x5379a9-0x0;var _0x41d877=_0xe0b2[_0x5379a9];return _0x41d877;};'use strict';var multer=require('multer');var util=require(_0x2e0b('0x0'));var path=require(_0x2e0b('0x1'));var timeout=require(_0x2e0b('0x2'));var express=require(_0x2e0b('0x3'));var router=express[_0x2e0b('0x4')]();var fs_extra=require(_0x2e0b('0x5'));var auth=require(_0x2e0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2e0b('0x7'));var controller=require(_0x2e0b('0x8'));router[_0x2e0b('0x9')]('/',auth[_0x2e0b('0xa')](),controller[_0x2e0b('0xb')]);router[_0x2e0b('0x9')]('/:id',auth[_0x2e0b('0xa')](),controller['show']);router[_0x2e0b('0xc')]('/',auth[_0x2e0b('0xa')](),controller[_0x2e0b('0xd')]);router[_0x2e0b('0xe')](_0x2e0b('0xf'),auth[_0x2e0b('0xa')](),controller[_0x2e0b('0x10')]);router[_0x2e0b('0x11')](_0x2e0b('0xf'),auth['isAuthenticated'](),controller[_0x2e0b('0x12')]);module[_0x2e0b('0x13')]=router; \ No newline at end of file +var _0xbefe=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','exports','util'];(function(_0x4f3af4,_0x2d048c){var _0x557e86=function(_0x222f68){while(--_0x222f68){_0x4f3af4['push'](_0x4f3af4['shift']());}};_0x557e86(++_0x2d048c);}(_0xbefe,0x168));var _0xebef=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0xbefe[_0x77d310];return _0x2cdce4;};'use strict';var multer=require('multer');var util=require(_0xebef('0x0'));var path=require('path');var timeout=require(_0xebef('0x1'));var express=require(_0xebef('0x2'));var router=express[_0xebef('0x3')]();var fs_extra=require(_0xebef('0x4'));var auth=require(_0xebef('0x5'));var interaction=require(_0xebef('0x6'));var config=require(_0xebef('0x7'));var controller=require(_0xebef('0x8'));router['get']('/',auth[_0xebef('0x9')](),controller[_0xebef('0xa')]);router[_0xebef('0xb')]('/:id',auth[_0xebef('0x9')](),controller[_0xebef('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebef('0xd')]);router[_0xebef('0xe')](_0xebef('0xf'),auth[_0xebef('0x9')](),controller[_0xebef('0x10')]);router[_0xebef('0x11')](_0xebef('0xf'),auth[_0xebef('0x9')](),controller['destroy']);module[_0xebef('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 41aee07..b6c21c9 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 _0x13a1=['variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0x14915d,_0x46bdd6){var _0x4852d8=function(_0x5c46fc){while(--_0x5c46fc){_0x14915d['push'](_0x14915d['shift']());}};_0x4852d8(++_0x46bdd6);}(_0x13a1,0x1f2));var _0x113a=function(_0xb4f07e,_0x282f5f){_0xb4f07e=_0xb4f07e-0x0;var _0x27238e=_0x13a1[_0xb4f07e];return _0x27238e;};'use strict';var Sequelize=require('sequelize');module[_0x113a('0x0')]={'type':{'type':Sequelize[_0x113a('0x1')](_0x113a('0x2'),'variable',_0x113a('0x3'),_0x113a('0x4'),'picklist'),'defaultValue':_0x113a('0x2')},'content':{'type':Sequelize[_0x113a('0x5')]},'key':{'type':Sequelize[_0x113a('0x5')]},'keyType':{'type':Sequelize[_0x113a('0x1')](_0x113a('0x2'),_0x113a('0x6'),_0x113a('0x3'))},'keyContent':{'type':Sequelize[_0x113a('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x113a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x113a('0x5')]}}; \ No newline at end of file +var _0x962d=['customVariable','sequelize','exports','ENUM','variable','picklist','STRING'];(function(_0x5a57cd,_0x498a68){var _0x3b9e9d=function(_0x467509){while(--_0x467509){_0x5a57cd['push'](_0x5a57cd['shift']());}};_0x3b9e9d(++_0x498a68);}(_0x962d,0x10b));var _0xd962=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x962d[_0x15ea09];return _0x3e9c78;};'use strict';var Sequelize=require(_0xd962('0x0'));module[_0xd962('0x1')]={'type':{'type':Sequelize[_0xd962('0x2')]('string',_0xd962('0x3'),'customVariable','keyValue',_0xd962('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd962('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd962('0x2')]('string',_0xd962('0x3'),_0xd962('0x6'))},'keyContent':{'type':Sequelize[_0xd962('0x5')]},'idField':{'type':Sequelize[_0xd962('0x5')]},'nameField':{'type':Sequelize[_0xd962('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd962('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 95e2c52..0e234f5 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 _0xd540=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x5ccb24,_0x17801a){var _0x109d5a=function(_0x4ec24f){while(--_0x4ec24f){_0x5ccb24['push'](_0x5ccb24['shift']());}};_0x109d5a(++_0x17801a);}(_0xd540,0x1ad));var _0x0d54=function(_0x153507,_0x2f8f3d){_0x153507=_0x153507-0x0;var _0x452180=_0xd540[_0x153507];return _0x452180;};'use strict';var emlformat=require(_0x0d54('0x0'));var rimraf=require(_0x0d54('0x1'));var zipdir=require(_0x0d54('0x2'));var jsonpatch=require(_0x0d54('0x3'));var rp=require(_0x0d54('0x4'));var moment=require(_0x0d54('0x5'));var BPromise=require(_0x0d54('0x6'));var Mustache=require(_0x0d54('0x7'));var util=require(_0x0d54('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0d54('0x9'));var ejs=require(_0x0d54('0xa'));var fs=require('fs');var fs_extra=require(_0x0d54('0xb'));var _=require('lodash');var squel=require(_0x0d54('0xc'));var crypto=require(_0x0d54('0xd'));var jsforce=require(_0x0d54('0xe'));var deskjs=require(_0x0d54('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d54('0x10'));var Redis=require('ioredis');var authService=require(_0x0d54('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d54('0x12'));var hardwareService=require(_0x0d54('0x13'));var logger=require('../../config/logger')(_0x0d54('0x14'));var utils=require(_0x0d54('0x15'));var config=require(_0x0d54('0x16'));var licenseUtil=require(_0x0d54('0x17'));var db=require(_0x0d54('0x18'))['db'];function respondWithStatusCode(_0x4855a8,_0x3bdc2b){_0x3bdc2b=_0x3bdc2b||0xcc;return function(_0x498ab9){if(_0x498ab9){return _0x4855a8[_0x0d54('0x19')](_0x3bdc2b);}return _0x4855a8[_0x0d54('0x1a')](_0x3bdc2b)[_0x0d54('0x1b')]();};}function respondWithResult(_0x2dbb75,_0x150395){_0x150395=_0x150395||0xc8;return function(_0x5215b6){if(_0x5215b6){return _0x2dbb75['status'](_0x150395)['json'](_0x5215b6);}};}function respondWithFilteredResult(_0x22db05,_0x5739f6){return function(_0xa8f762){if(_0xa8f762){var _0x1f9077=typeof _0x5739f6[_0x0d54('0x1c')]===_0x0d54('0x1d')&&typeof _0x5739f6[_0x0d54('0x1e')]===_0x0d54('0x1d');var _0x2b60cc=_0xa8f762[_0x0d54('0x1f')];var _0x33c67c=_0x1f9077?0x0:_0x5739f6[_0x0d54('0x1c')];var _0x8f963f=_0x1f9077?_0xa8f762[_0x0d54('0x1f')]:_0x5739f6[_0x0d54('0x1c')]+_0x5739f6[_0x0d54('0x1e')];var _0x56d1c4;if(_0x8f963f>=_0x2b60cc){_0x8f963f=_0x2b60cc;_0x56d1c4=0xc8;}else{_0x56d1c4=0xce;}_0x22db05['status'](_0x56d1c4);return _0x22db05[_0x0d54('0x20')](_0x0d54('0x21'),_0x33c67c+'-'+_0x8f963f+'/'+_0x2b60cc)['json'](_0xa8f762);}return null;};}function patchUpdates(_0xc389c7){return function(_0x51cbf9){try{jsonpatch[_0x0d54('0x22')](_0x51cbf9,_0xc389c7,!![]);}catch(_0x192692){return BPromise[_0x0d54('0x23')](_0x192692);}return _0x51cbf9[_0x0d54('0x24')]();};}function saveUpdates(_0x22f820,_0x17e94){return function(_0x4bb63b){if(_0x4bb63b){return _0x4bb63b[_0x0d54('0x25')](_0x22f820)[_0x0d54('0x26')](function(_0x59d0b5){return _0x59d0b5;});}return null;};}function removeEntity(_0x339762,_0x105a02){return function(_0x5111a1){if(_0x5111a1){return _0x5111a1[_0x0d54('0x27')]()['then'](function(){_0x339762[_0x0d54('0x1a')](0xcc)[_0x0d54('0x1b')]();});}};}function handleEntityNotFound(_0x20bf61,_0x3150b3){return function(_0x502291){if(!_0x502291){_0x20bf61[_0x0d54('0x19')](0x194);}return _0x502291;};}function handleError(_0x4b9591,_0x1e64fb){_0x1e64fb=_0x1e64fb||0x1f4;return function(_0x4690de){logger[_0x0d54('0x28')](_0x4690de[_0x0d54('0x29')]);if(_0x4690de[_0x0d54('0x2a')]){delete _0x4690de[_0x0d54('0x2a')];}_0x4b9591[_0x0d54('0x1a')](_0x1e64fb)[_0x0d54('0x2b')](_0x4690de);};}exports[_0x0d54('0x2c')]=function(_0x5afc27,_0x79342f){var _0x362a62={},_0x5da21b={},_0x523c92={'count':0x0,'rows':[]};var _0x3ae2fe=_[_0x0d54('0x2d')](db[_0x0d54('0x2e')][_0x0d54('0x2f')],function(_0x11b9aa){return{'name':_0x11b9aa[_0x0d54('0x30')],'type':_0x11b9aa[_0x0d54('0x31')]['key']};});_0x5da21b[_0x0d54('0x32')]=_[_0x0d54('0x2d')](_0x3ae2fe,_0x0d54('0x2a'));_0x5da21b[_0x0d54('0x33')]=_['keys'](_0x5afc27['query']);_0x5da21b['filters']=_['intersection'](_0x5da21b['model'],_0x5da21b['query']);_0x362a62['attributes']=_[_0x0d54('0x34')](_0x5da21b[_0x0d54('0x32')],qs[_0x0d54('0x35')](_0x5afc27['query'][_0x0d54('0x35')]));_0x362a62[_0x0d54('0x36')]=_0x362a62[_0x0d54('0x36')][_0x0d54('0x37')]?_0x362a62['attributes']:_0x5da21b[_0x0d54('0x32')];if(!_0x5afc27[_0x0d54('0x33')][_0x0d54('0x38')](_0x0d54('0x39'))){_0x362a62[_0x0d54('0x1e')]=qs[_0x0d54('0x1e')](_0x5afc27[_0x0d54('0x33')][_0x0d54('0x1e')]);_0x362a62[_0x0d54('0x1c')]=qs[_0x0d54('0x1c')](_0x5afc27[_0x0d54('0x33')][_0x0d54('0x1c')]);}_0x362a62[_0x0d54('0x3a')]=qs[_0x0d54('0x3b')](_0x5afc27[_0x0d54('0x33')][_0x0d54('0x3b')]);_0x362a62[_0x0d54('0x3c')]=qs[_0x0d54('0x3d')](_[_0x0d54('0x3e')](_0x5afc27['query'],_0x5da21b[_0x0d54('0x3d')]),_0x3ae2fe);if(_0x5afc27['query'][_0x0d54('0x3f')]){_0x362a62[_0x0d54('0x3c')]=_[_0x0d54('0x40')](_0x362a62[_0x0d54('0x3c')],{'$or':_[_0x0d54('0x2d')](_0x3ae2fe,function(_0x2cd13b){if(_0x2cd13b[_0x0d54('0x31')]!==_0x0d54('0x41')){var _0x141abc={};_0x141abc[_0x2cd13b[_0x0d54('0x2a')]]={'$like':'%'+_0x5afc27['query']['filter']+'%'};return _0x141abc;}})});}_0x362a62=_[_0x0d54('0x40')]({},_0x362a62,_0x5afc27[_0x0d54('0x42')]);var _0x383c36={'where':_0x362a62[_0x0d54('0x3c')]};return db['FreshsalesField']['count'](_0x383c36)[_0x0d54('0x26')](function(_0x285b93){_0x523c92[_0x0d54('0x1f')]=_0x285b93;if(_0x5afc27['query'][_0x0d54('0x43')]){_0x362a62[_0x0d54('0x44')]=[{'all':!![]}];}return db[_0x0d54('0x2e')][_0x0d54('0x45')](_0x362a62);})[_0x0d54('0x26')](function(_0x572634){_0x523c92[_0x0d54('0x46')]=_0x572634;return _0x523c92;})[_0x0d54('0x26')](respondWithFilteredResult(_0x79342f,_0x362a62))[_0x0d54('0x47')](handleError(_0x79342f,null));};exports['show']=function(_0x37979d,_0x48ac05){var _0x321c6d={'raw':!![],'where':{'id':_0x37979d[_0x0d54('0x48')]['id']}},_0x48adcd={};_0x48adcd[_0x0d54('0x32')]=_['keys'](db[_0x0d54('0x2e')][_0x0d54('0x2f')]);_0x48adcd[_0x0d54('0x33')]=_[_0x0d54('0x49')](_0x37979d[_0x0d54('0x33')]);_0x48adcd['filters']=_['intersection'](_0x48adcd[_0x0d54('0x32')],_0x48adcd[_0x0d54('0x33')]);_0x321c6d[_0x0d54('0x36')]=_[_0x0d54('0x34')](_0x48adcd['model'],qs[_0x0d54('0x35')](_0x37979d[_0x0d54('0x33')]['fields']));_0x321c6d[_0x0d54('0x36')]=_0x321c6d[_0x0d54('0x36')][_0x0d54('0x37')]?_0x321c6d[_0x0d54('0x36')]:_0x48adcd[_0x0d54('0x32')];if(_0x37979d[_0x0d54('0x33')][_0x0d54('0x43')]){_0x321c6d[_0x0d54('0x44')]=[{'all':!![]}];}_0x321c6d=_[_0x0d54('0x40')]({},_0x321c6d,_0x37979d[_0x0d54('0x42')]);return db['FreshsalesField']['find'](_0x321c6d)[_0x0d54('0x26')](handleEntityNotFound(_0x48ac05,null))[_0x0d54('0x26')](respondWithResult(_0x48ac05,null))[_0x0d54('0x47')](handleError(_0x48ac05,null));};exports[_0x0d54('0x4a')]=function(_0x4c8582,_0x437f29){return db['FreshsalesField']['create'](_0x4c8582[_0x0d54('0x4b')],{})['then'](respondWithResult(_0x437f29,0xc9))['catch'](handleError(_0x437f29,null));};exports[_0x0d54('0x25')]=function(_0x3250cb,_0x1c76bd){if(_0x3250cb[_0x0d54('0x4b')]['id']){delete _0x3250cb[_0x0d54('0x4b')]['id'];}return db[_0x0d54('0x2e')][_0x0d54('0x4c')]({'where':{'id':_0x3250cb[_0x0d54('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c76bd,null))[_0x0d54('0x26')](saveUpdates(_0x3250cb['body'],null))[_0x0d54('0x26')](respondWithResult(_0x1c76bd,null))['catch'](handleError(_0x1c76bd,null));};exports[_0x0d54('0x27')]=function(_0x521607,_0x200a2a){return db[_0x0d54('0x2e')]['find']({'where':{'id':_0x521607['params']['id']}})[_0x0d54('0x26')](handleEntityNotFound(_0x200a2a,null))[_0x0d54('0x26')](removeEntity(_0x200a2a,null))[_0x0d54('0x47')](handleError(_0x200a2a,null));}; \ No newline at end of file +var _0x64bf=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','length','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','FreshsalesField','rawAttributes','type','model','query','keys','filters'];(function(_0x1d2e96,_0x5ac8c7){var _0x5846fd=function(_0xb8440d){while(--_0xb8440d){_0x1d2e96['push'](_0x1d2e96['shift']());}};_0x5846fd(++_0x5ac8c7);}(_0x64bf,0xb2));var _0xf64b=function(_0x37b8b8,_0x25a846){_0x37b8b8=_0x37b8b8-0x0;var _0x1fd994=_0x64bf[_0x37b8b8];return _0x1fd994;};'use strict';var emlformat=require(_0xf64b('0x0'));var rimraf=require(_0xf64b('0x1'));var zipdir=require(_0xf64b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf64b('0x3'));var moment=require(_0xf64b('0x4'));var BPromise=require(_0xf64b('0x5'));var Mustache=require(_0xf64b('0x6'));var util=require(_0xf64b('0x7'));var path=require(_0xf64b('0x8'));var sox=require(_0xf64b('0x9'));var csv=require('to-csv');var ejs=require(_0xf64b('0xa'));var fs=require('fs');var fs_extra=require(_0xf64b('0xb'));var _=require(_0xf64b('0xc'));var squel=require(_0xf64b('0xd'));var crypto=require(_0xf64b('0xe'));var jsforce=require(_0xf64b('0xf'));var deskjs=require(_0xf64b('0x10'));var toCsv=require(_0xf64b('0x11'));var querystring=require('querystring');var Papa=require(_0xf64b('0x12'));var Redis=require('ioredis');var authService=require(_0xf64b('0x13'));var qs=require(_0xf64b('0x14'));var as=require(_0xf64b('0x15'));var hardwareService=require(_0xf64b('0x16'));var logger=require(_0xf64b('0x17'))(_0xf64b('0x18'));var utils=require(_0xf64b('0x19'));var config=require(_0xf64b('0x1a'));var licenseUtil=require(_0xf64b('0x1b'));var db=require(_0xf64b('0x1c'))['db'];function respondWithStatusCode(_0x54a023,_0x1a8e86){_0x1a8e86=_0x1a8e86||0xcc;return function(_0xe3b48b){if(_0xe3b48b){return _0x54a023[_0xf64b('0x1d')](_0x1a8e86);}return _0x54a023[_0xf64b('0x1e')](_0x1a8e86)[_0xf64b('0x1f')]();};}function respondWithResult(_0x3686c1,_0x5e5021){_0x5e5021=_0x5e5021||0xc8;return function(_0x381836){if(_0x381836){return _0x3686c1['status'](_0x5e5021)[_0xf64b('0x20')](_0x381836);}};}function respondWithFilteredResult(_0x1e1e9b,_0x38f3ba){return function(_0x58c831){if(_0x58c831){var _0x3227a0=typeof _0x38f3ba[_0xf64b('0x21')]===_0xf64b('0x22')&&typeof _0x38f3ba[_0xf64b('0x23')]===_0xf64b('0x22');var _0xf6d3e5=_0x58c831[_0xf64b('0x24')];var _0x1e0a9a=_0x3227a0?0x0:_0x38f3ba['offset'];var _0x10e165=_0x3227a0?_0x58c831[_0xf64b('0x24')]:_0x38f3ba[_0xf64b('0x21')]+_0x38f3ba['limit'];var _0x400a5f;if(_0x10e165>=_0xf6d3e5){_0x10e165=_0xf6d3e5;_0x400a5f=0xc8;}else{_0x400a5f=0xce;}_0x1e1e9b[_0xf64b('0x1e')](_0x400a5f);return _0x1e1e9b[_0xf64b('0x25')](_0xf64b('0x26'),_0x1e0a9a+'-'+_0x10e165+'/'+_0xf6d3e5)[_0xf64b('0x20')](_0x58c831);}return null;};}function patchUpdates(_0x1e006d){return function(_0x21bbea){try{jsonpatch[_0xf64b('0x27')](_0x21bbea,_0x1e006d,!![]);}catch(_0x4c7e68){return BPromise[_0xf64b('0x28')](_0x4c7e68);}return _0x21bbea[_0xf64b('0x29')]();};}function saveUpdates(_0x3011f5,_0x94da11){return function(_0x5a3ff3){if(_0x5a3ff3){return _0x5a3ff3[_0xf64b('0x2a')](_0x3011f5)[_0xf64b('0x2b')](function(_0x5ac703){return _0x5ac703;});}return null;};}function removeEntity(_0x521cf7,_0x99c2bd){return function(_0x18d6c2){if(_0x18d6c2){return _0x18d6c2[_0xf64b('0x2c')]()[_0xf64b('0x2b')](function(){_0x521cf7['status'](0xcc)[_0xf64b('0x1f')]();});}};}function handleEntityNotFound(_0x500b99,_0x361524){return function(_0x23d33a){if(!_0x23d33a){_0x500b99[_0xf64b('0x1d')](0x194);}return _0x23d33a;};}function handleError(_0x56cd42,_0x464f4a){_0x464f4a=_0x464f4a||0x1f4;return function(_0x42bc4b){logger[_0xf64b('0x2d')](_0x42bc4b['stack']);if(_0x42bc4b[_0xf64b('0x2e')]){delete _0x42bc4b[_0xf64b('0x2e')];}_0x56cd42[_0xf64b('0x1e')](_0x464f4a)[_0xf64b('0x2f')](_0x42bc4b);};}exports['index']=function(_0x5764ac,_0x9312b7){var _0xaf50f5={},_0x54b9eb={},_0x3e38b6={'count':0x0,'rows':[]};var _0x4919a7=_[_0xf64b('0x30')](db[_0xf64b('0x31')][_0xf64b('0x32')],function(_0xf9dcf7){return{'name':_0xf9dcf7['fieldName'],'type':_0xf9dcf7[_0xf64b('0x33')]['key']};});_0x54b9eb[_0xf64b('0x34')]=_[_0xf64b('0x30')](_0x4919a7,_0xf64b('0x2e'));_0x54b9eb[_0xf64b('0x35')]=_[_0xf64b('0x36')](_0x5764ac['query']);_0x54b9eb[_0xf64b('0x37')]=_[_0xf64b('0x38')](_0x54b9eb[_0xf64b('0x34')],_0x54b9eb[_0xf64b('0x35')]);_0xaf50f5[_0xf64b('0x39')]=_[_0xf64b('0x38')](_0x54b9eb['model'],qs[_0xf64b('0x3a')](_0x5764ac[_0xf64b('0x35')][_0xf64b('0x3a')]));_0xaf50f5[_0xf64b('0x39')]=_0xaf50f5['attributes']['length']?_0xaf50f5[_0xf64b('0x39')]:_0x54b9eb['model'];if(!_0x5764ac[_0xf64b('0x35')][_0xf64b('0x3b')](_0xf64b('0x3c'))){_0xaf50f5[_0xf64b('0x23')]=qs[_0xf64b('0x23')](_0x5764ac[_0xf64b('0x35')][_0xf64b('0x23')]);_0xaf50f5[_0xf64b('0x21')]=qs[_0xf64b('0x21')](_0x5764ac[_0xf64b('0x35')][_0xf64b('0x21')]);}_0xaf50f5[_0xf64b('0x3d')]=qs[_0xf64b('0x3e')](_0x5764ac['query'][_0xf64b('0x3e')]);_0xaf50f5[_0xf64b('0x3f')]=qs['filters'](_['pick'](_0x5764ac[_0xf64b('0x35')],_0x54b9eb['filters']),_0x4919a7);if(_0x5764ac[_0xf64b('0x35')][_0xf64b('0x40')]){_0xaf50f5[_0xf64b('0x3f')]=_['merge'](_0xaf50f5['where'],{'$or':_[_0xf64b('0x30')](_0x4919a7,function(_0x43bd0f){if(_0x43bd0f['type']!==_0xf64b('0x41')){var _0x40a19a={};_0x40a19a[_0x43bd0f[_0xf64b('0x2e')]]={'$like':'%'+_0x5764ac['query'][_0xf64b('0x40')]+'%'};return _0x40a19a;}})});}_0xaf50f5=_[_0xf64b('0x42')]({},_0xaf50f5,_0x5764ac[_0xf64b('0x43')]);var _0x1e8116={'where':_0xaf50f5[_0xf64b('0x3f')]};return db[_0xf64b('0x31')][_0xf64b('0x24')](_0x1e8116)[_0xf64b('0x2b')](function(_0x3df665){_0x3e38b6[_0xf64b('0x24')]=_0x3df665;if(_0x5764ac[_0xf64b('0x35')][_0xf64b('0x44')]){_0xaf50f5[_0xf64b('0x45')]=[{'all':!![]}];}return db[_0xf64b('0x31')][_0xf64b('0x46')](_0xaf50f5);})[_0xf64b('0x2b')](function(_0x2a58f8){_0x3e38b6[_0xf64b('0x47')]=_0x2a58f8;return _0x3e38b6;})[_0xf64b('0x2b')](respondWithFilteredResult(_0x9312b7,_0xaf50f5))['catch'](handleError(_0x9312b7,null));};exports['show']=function(_0x1f15d3,_0x4659d8){var _0x1c7181={'raw':!![],'where':{'id':_0x1f15d3[_0xf64b('0x48')]['id']}},_0x1defa5={};_0x1defa5[_0xf64b('0x34')]=_[_0xf64b('0x36')](db[_0xf64b('0x31')]['rawAttributes']);_0x1defa5[_0xf64b('0x35')]=_[_0xf64b('0x36')](_0x1f15d3[_0xf64b('0x35')]);_0x1defa5[_0xf64b('0x37')]=_[_0xf64b('0x38')](_0x1defa5[_0xf64b('0x34')],_0x1defa5[_0xf64b('0x35')]);_0x1c7181[_0xf64b('0x39')]=_[_0xf64b('0x38')](_0x1defa5[_0xf64b('0x34')],qs[_0xf64b('0x3a')](_0x1f15d3[_0xf64b('0x35')][_0xf64b('0x3a')]));_0x1c7181[_0xf64b('0x39')]=_0x1c7181[_0xf64b('0x39')][_0xf64b('0x49')]?_0x1c7181['attributes']:_0x1defa5[_0xf64b('0x34')];if(_0x1f15d3[_0xf64b('0x35')][_0xf64b('0x44')]){_0x1c7181[_0xf64b('0x45')]=[{'all':!![]}];}_0x1c7181=_['merge']({},_0x1c7181,_0x1f15d3[_0xf64b('0x43')]);return db[_0xf64b('0x31')]['find'](_0x1c7181)[_0xf64b('0x2b')](handleEntityNotFound(_0x4659d8,null))[_0xf64b('0x2b')](respondWithResult(_0x4659d8,null))[_0xf64b('0x4a')](handleError(_0x4659d8,null));};exports[_0xf64b('0x4b')]=function(_0x14ac45,_0x384e57){return db[_0xf64b('0x31')][_0xf64b('0x4b')](_0x14ac45[_0xf64b('0x4c')],{})[_0xf64b('0x2b')](respondWithResult(_0x384e57,0xc9))[_0xf64b('0x4a')](handleError(_0x384e57,null));};exports['update']=function(_0x543903,_0x3dcae4){if(_0x543903[_0xf64b('0x4c')]['id']){delete _0x543903[_0xf64b('0x4c')]['id'];}return db[_0xf64b('0x31')][_0xf64b('0x4d')]({'where':{'id':_0x543903['params']['id']}})[_0xf64b('0x2b')](handleEntityNotFound(_0x3dcae4,null))['then'](saveUpdates(_0x543903[_0xf64b('0x4c')],null))['then'](respondWithResult(_0x3dcae4,null))['catch'](handleError(_0x3dcae4,null));};exports[_0xf64b('0x2c')]=function(_0x3f42d9,_0x11cbc4){return db[_0xf64b('0x31')][_0xf64b('0x4d')]({'where':{'id':_0x3f42d9[_0xf64b('0x48')]['id']}})[_0xf64b('0x2b')](handleEntityNotFound(_0x11cbc4,null))[_0xf64b('0x2b')](removeEntity(_0x11cbc4,null))[_0xf64b('0x4a')](handleError(_0x11cbc4,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index fa603e8..5f74350 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 _0xef0f=['request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','FieldId','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef0f,0x168));var _0xfef0=function(_0x5e3e7c,_0x527a46){_0x5e3e7c=_0x5e3e7c-0x0;var _0x38fe49=_0xef0f[_0x5e3e7c];return _0x38fe49;};'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_freshsales_fields','paranoid':![],'indexes':[{'name':_0xfef0('0xb'),'fields':['idField',_0xfef0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb11=['bluebird','path','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x366cd6,_0xc04558){var _0x2502bf=function(_0x5827e4){while(--_0x5827e4){_0x366cd6['push'](_0x366cd6['shift']());}};_0x2502bf(++_0xc04558);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xfb11[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));module['exports']=function(_0x25d44f,_0x133727){return _0x25d44f['define'](_0x1fb1('0x7'),attributes,{'tableName':_0x1fb1('0x8'),'paranoid':![],'indexes':[{'name':_0x1fb1('0x9'),'fields':[_0x1fb1('0xa'),_0x1fb1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index a2443bf..8c2b192 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0x524e,0x15e));var _0xe524=function(_0x1f36b9,_0x22f1e4){_0x1f36b9=_0x1f36b9-0x0;var _0x5c6f08=_0x524e[_0x1f36b9];return _0x5c6f08;};'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')]('FreshsalesField,\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')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x237e45,_0x2f8d71){var _0x96b3b1=function(_0x38a53f){while(--_0x38a53f){_0x237e45['push'](_0x237e45['shift']());}};_0x96b3b1(++_0x2f8d71);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 8f0c7c4..2b4bc5a 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x522141,_0x55df23){var _0x238e7e=function(_0x2d6c88){while(--_0x2d6c88){_0x522141['push'](_0x522141['shift']());}};_0x238e7e(++_0x55df23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x32043a,_0x58d9f8){var _0xc10212=function(_0x10c0bc){while(--_0x10c0bc){_0x32043a['push'](_0x32043a['shift']());}};_0xc10212(++_0x58d9f8);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0061750..992fe87 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 _0x4efb=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x3f4b55,_0x598de6){var _0xc7cb1a=function(_0x255f5a){while(--_0x255f5a){_0x3f4b55['push'](_0x3f4b55['shift']());}};_0xc7cb1a(++_0x598de6);}(_0x4efb,0xfa));var _0xb4ef=function(_0x3b7c6d,_0x4c6bd6){_0x3b7c6d=_0x3b7c6d-0x0;var _0x1ace06=_0x4efb[_0x3b7c6d];return _0x1ace06;};'use strict';var Sequelize=require('sequelize');module[_0xb4ef('0x0')]={'name':{'type':Sequelize[_0xb4ef('0x1')]},'description':{'type':Sequelize[_0xb4ef('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb4ef('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb4ef('0x1')]},'clientId':{'type':Sequelize[_0xb4ef('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb4ef('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb4ef('0x3')](_0xb4ef('0x4'),_0xb4ef('0x5')),'defaultValue':_0xb4ef('0x4')}}; \ No newline at end of file +var _0xa1c5=['sequelize','exports','STRING','username','integrationTab','newTab'];(function(_0x1f686d,_0x47ab23){var _0x63346a=function(_0x41d93d){while(--_0x41d93d){_0x1f686d['push'](_0x1f686d['shift']());}};_0x63346a(++_0x47ab23);}(_0xa1c5,0x96));var _0x5a1c=function(_0x4cd438,_0x220d7b){_0x4cd438=_0x4cd438-0x0;var _0x80f58=_0xa1c5[_0x4cd438];return _0x80f58;};'use strict';var Sequelize=require(_0x5a1c('0x0'));module[_0x5a1c('0x1')]={'name':{'type':Sequelize[_0x5a1c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x5a1c('0x3')},'remoteUri':{'type':Sequelize[_0x5a1c('0x2')]},'password':{'type':Sequelize[_0x5a1c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5a1c('0x2')]},'securityToken':{'type':Sequelize[_0x5a1c('0x2')]},'serverUrl':{'type':Sequelize[_0x5a1c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5a1c('0x4'),_0x5a1c('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 e2a418a..693920d 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 _0x2812=['catch','params','find','create','body','getConfigurations','order','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x2812,0xb7));var _0x2281=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x2812[_0x337748];return _0x3bb03f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2281('0x0'));var zipdir=require(_0x2281('0x1'));var jsonpatch=require(_0x2281('0x2'));var rp=require(_0x2281('0x3'));var moment=require(_0x2281('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2281('0x5'));var util=require(_0x2281('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2281('0x7'));var ejs=require(_0x2281('0x8'));var fs=require('fs');var fs_extra=require(_0x2281('0x9'));var _=require(_0x2281('0xa'));var squel=require(_0x2281('0xb'));var crypto=require('crypto');var jsforce=require(_0x2281('0xc'));var deskjs=require(_0x2281('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2281('0xe'));var Redis=require('ioredis');var authService=require(_0x2281('0xf'));var qs=require(_0x2281('0x10'));var as=require(_0x2281('0x11'));var hardwareService=require(_0x2281('0x12'));var logger=require(_0x2281('0x13'))(_0x2281('0x14'));var utils=require('../../config/utils');var config=require(_0x2281('0x15'));var licenseUtil=require(_0x2281('0x16'));var db=require(_0x2281('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x166766,_0x237c46){_0x237c46=_0x237c46||0xcc;return function(_0xf49abd){if(_0xf49abd){return _0x166766['sendStatus'](_0x237c46);}return _0x166766[_0x2281('0x18')](_0x237c46)[_0x2281('0x19')]();};}function respondWithResult(_0x2d3332,_0x297f8a){_0x297f8a=_0x297f8a||0xc8;return function(_0x3f7557){if(_0x3f7557){return _0x2d3332[_0x2281('0x18')](_0x297f8a)[_0x2281('0x1a')](_0x3f7557);}};}function respondWithFilteredResult(_0x41ecda,_0x4eaac5){return function(_0x46eca4){if(_0x46eca4){var _0x1d119b=typeof _0x4eaac5['offset']===_0x2281('0x1b')&&typeof _0x4eaac5['limit']===_0x2281('0x1b');var _0x39c9ee=_0x46eca4[_0x2281('0x1c')];var _0x24ceae=_0x1d119b?0x0:_0x4eaac5[_0x2281('0x1d')];var _0x39c7d1=_0x1d119b?_0x46eca4[_0x2281('0x1c')]:_0x4eaac5['offset']+_0x4eaac5[_0x2281('0x1e')];var _0x32b35f;if(_0x39c7d1>=_0x39c9ee){_0x39c7d1=_0x39c9ee;_0x32b35f=0xc8;}else{_0x32b35f=0xce;}_0x41ecda[_0x2281('0x18')](_0x32b35f);return _0x41ecda['set']('Content-Range',_0x24ceae+'-'+_0x39c7d1+'/'+_0x39c9ee)['json'](_0x46eca4);}return null;};}function patchUpdates(_0x1e4f6d){return function(_0x117e94){try{jsonpatch[_0x2281('0x1f')](_0x117e94,_0x1e4f6d,!![]);}catch(_0x25be24){return BPromise[_0x2281('0x20')](_0x25be24);}return _0x117e94[_0x2281('0x21')]();};}function saveUpdates(_0x25d7d9,_0x4248d4){return function(_0x582e7a){if(_0x582e7a){return _0x582e7a[_0x2281('0x22')](_0x25d7d9)['then'](function(_0x3bedcf){return _0x3bedcf;});}return null;};}function removeEntity(_0x40cf6f,_0x3c92bd){return function(_0x1315f1){if(_0x1315f1){return _0x1315f1[_0x2281('0x23')]()[_0x2281('0x24')](function(){_0x40cf6f[_0x2281('0x18')](0xcc)[_0x2281('0x19')]();});}};}function handleEntityNotFound(_0x22886e,_0x4c41b0){return function(_0x26ba3d){if(!_0x26ba3d){_0x22886e[_0x2281('0x25')](0x194);}return _0x26ba3d;};}function handleError(_0x822f3d,_0xd2f351){_0xd2f351=_0xd2f351||0x1f4;return function(_0x18de72){logger[_0x2281('0x26')](_0x18de72[_0x2281('0x27')]);if(_0x18de72['name']){delete _0x18de72[_0x2281('0x28')];}_0x822f3d[_0x2281('0x18')](_0xd2f351)[_0x2281('0x29')](_0x18de72);};}exports['index']=function(_0x5d5f73,_0x547f4d){var _0xd9b12e={},_0xd568cf={},_0x478edf={'count':0x0,'rows':[]};var _0x215d78=_[_0x2281('0x2a')](db[_0x2281('0x2b')][_0x2281('0x2c')],function(_0x162626){return{'name':_0x162626[_0x2281('0x2d')],'type':_0x162626[_0x2281('0x2e')][_0x2281('0x2f')]};});_0xd568cf[_0x2281('0x30')]=_['map'](_0x215d78,_0x2281('0x28'));_0xd568cf[_0x2281('0x31')]=_[_0x2281('0x32')](_0x5d5f73[_0x2281('0x31')]);_0xd568cf[_0x2281('0x33')]=_[_0x2281('0x34')](_0xd568cf['model'],_0xd568cf[_0x2281('0x31')]);_0xd9b12e['attributes']=_[_0x2281('0x34')](_0xd568cf[_0x2281('0x30')],qs['fields'](_0x5d5f73[_0x2281('0x31')][_0x2281('0x35')]));_0xd9b12e[_0x2281('0x36')]=_0xd9b12e[_0x2281('0x36')][_0x2281('0x37')]?_0xd9b12e[_0x2281('0x36')]:_0xd568cf['model'];if(!_0x5d5f73[_0x2281('0x31')][_0x2281('0x38')](_0x2281('0x39'))){_0xd9b12e[_0x2281('0x1e')]=qs[_0x2281('0x1e')](_0x5d5f73[_0x2281('0x31')]['limit']);_0xd9b12e['offset']=qs[_0x2281('0x1d')](_0x5d5f73['query'][_0x2281('0x1d')]);}_0xd9b12e['order']=qs[_0x2281('0x3a')](_0x5d5f73[_0x2281('0x31')][_0x2281('0x3a')]);_0xd9b12e[_0x2281('0x3b')]=qs['filters'](_[_0x2281('0x3c')](_0x5d5f73['query'],_0xd568cf[_0x2281('0x33')]),_0x215d78);if(_0x5d5f73[_0x2281('0x31')][_0x2281('0x3d')]){_0xd9b12e['where']=_[_0x2281('0x3e')](_0xd9b12e[_0x2281('0x3b')],{'$or':_[_0x2281('0x2a')](_0x215d78,function(_0x116a24){if(_0x116a24[_0x2281('0x2e')]!==_0x2281('0x3f')){var _0x17773d={};_0x17773d[_0x116a24[_0x2281('0x28')]]={'$like':'%'+_0x5d5f73[_0x2281('0x31')]['filter']+'%'};return _0x17773d;}})});}_0xd9b12e=_[_0x2281('0x3e')]({},_0xd9b12e,_0x5d5f73[_0x2281('0x40')]);var _0x12db40={'where':_0xd9b12e['where']};return db[_0x2281('0x2b')][_0x2281('0x1c')](_0x12db40)[_0x2281('0x24')](function(_0x5047cd){_0x478edf['count']=_0x5047cd;if(_0x5d5f73[_0x2281('0x31')][_0x2281('0x41')]){_0xd9b12e[_0x2281('0x42')]=[{'all':!![]}];}return db[_0x2281('0x2b')][_0x2281('0x43')](_0xd9b12e);})['then'](function(_0x293b69){_0x478edf[_0x2281('0x44')]=_0x293b69;return _0x478edf;})['then'](respondWithFilteredResult(_0x547f4d,_0xd9b12e))[_0x2281('0x45')](handleError(_0x547f4d,null));};exports['show']=function(_0x263340,_0x44c2da){var _0x32b3d0={'raw':![],'where':{'id':_0x263340[_0x2281('0x46')]['id']}},_0x1ab6a2={};_0x1ab6a2['model']=_[_0x2281('0x32')](db['SalesforceAccount'][_0x2281('0x2c')]);_0x1ab6a2[_0x2281('0x31')]=_[_0x2281('0x32')](_0x263340[_0x2281('0x31')]);_0x1ab6a2[_0x2281('0x33')]=_[_0x2281('0x34')](_0x1ab6a2[_0x2281('0x30')],_0x1ab6a2[_0x2281('0x31')]);_0x32b3d0[_0x2281('0x36')]=_[_0x2281('0x34')](_0x1ab6a2[_0x2281('0x30')],qs['fields'](_0x263340['query']['fields']));_0x32b3d0[_0x2281('0x36')]=_0x32b3d0['attributes'][_0x2281('0x37')]?_0x32b3d0[_0x2281('0x36')]:_0x1ab6a2['model'];if(_0x263340['query'][_0x2281('0x41')]){_0x32b3d0[_0x2281('0x42')]=[{'all':!![]}];}_0x32b3d0=_['merge']({},_0x32b3d0,_0x263340[_0x2281('0x40')]);return db['SalesforceAccount'][_0x2281('0x47')](_0x32b3d0)['then'](handleEntityNotFound(_0x44c2da,null))[_0x2281('0x24')](respondWithResult(_0x44c2da,null))[_0x2281('0x45')](handleError(_0x44c2da,null));};exports[_0x2281('0x48')]=function(_0x4ae6ca,_0x3c836e){return db[_0x2281('0x2b')][_0x2281('0x48')](_0x4ae6ca[_0x2281('0x49')],{})[_0x2281('0x24')](respondWithResult(_0x3c836e,0xc9))[_0x2281('0x45')](handleError(_0x3c836e,null));};exports['update']=function(_0x2698ba,_0x5d5712){if(_0x2698ba[_0x2281('0x49')]['id']){delete _0x2698ba[_0x2281('0x49')]['id'];}return db[_0x2281('0x2b')][_0x2281('0x47')]({'where':{'id':_0x2698ba[_0x2281('0x46')]['id']}})[_0x2281('0x24')](handleEntityNotFound(_0x5d5712,null))[_0x2281('0x24')](saveUpdates(_0x2698ba[_0x2281('0x49')],null))[_0x2281('0x24')](respondWithResult(_0x5d5712,null))[_0x2281('0x45')](handleError(_0x5d5712,null));};exports[_0x2281('0x23')]=function(_0x19d162,_0x478cc8){return db[_0x2281('0x2b')][_0x2281('0x47')]({'where':{'id':_0x19d162[_0x2281('0x46')]['id']}})[_0x2281('0x24')](handleEntityNotFound(_0x478cc8,null))[_0x2281('0x24')](removeEntity(_0x478cc8,null))[_0x2281('0x45')](handleError(_0x478cc8,null));};exports[_0x2281('0x4a')]=function(_0x216ae8,_0x3899d8,_0x2dd912){var _0x16a473={};var _0x4108b6={};var _0x13d2fd;var _0x2b0678;return db[_0x2281('0x2b')]['findOne']({'where':{'id':_0x216ae8[_0x2281('0x46')]['id']}})[_0x2281('0x24')](handleEntityNotFound(_0x3899d8,null))[_0x2281('0x24')](function(_0x3d2eb5){if(_0x3d2eb5){_0x13d2fd=_0x3d2eb5;_0x4108b6[_0x2281('0x30')]=_['keys'](db['SalesforceConfiguration'][_0x2281('0x2c')]);_0x4108b6['query']=_[_0x2281('0x32')](_0x216ae8[_0x2281('0x31')]);_0x4108b6[_0x2281('0x33')]=_[_0x2281('0x34')](_0x4108b6[_0x2281('0x30')],_0x4108b6[_0x2281('0x31')]);_0x16a473[_0x2281('0x36')]=_[_0x2281('0x34')](_0x4108b6[_0x2281('0x30')],qs['fields'](_0x216ae8[_0x2281('0x31')][_0x2281('0x35')]));_0x16a473['attributes']=_0x16a473[_0x2281('0x36')][_0x2281('0x37')]?_0x16a473[_0x2281('0x36')]:_0x4108b6[_0x2281('0x30')];_0x16a473[_0x2281('0x4b')]=qs[_0x2281('0x3a')](_0x216ae8[_0x2281('0x31')][_0x2281('0x3a')]);_0x16a473['where']=qs['filters'](_['pick'](_0x216ae8[_0x2281('0x31')],_0x4108b6['filters']));if(_0x216ae8[_0x2281('0x31')][_0x2281('0x3d')]){_0x16a473[_0x2281('0x3b')]=_[_0x2281('0x3e')](_0x16a473[_0x2281('0x3b')],{'$or':_[_0x2281('0x2a')](_0x16a473[_0x2281('0x36')],function(_0x117408){var _0x335c7f={};_0x335c7f[_0x117408]={'$like':'%'+_0x216ae8[_0x2281('0x31')][_0x2281('0x3d')]+'%'};return _0x335c7f;})});}_0x16a473=_[_0x2281('0x3e')]({},_0x16a473,_0x216ae8[_0x2281('0x40')]);return _0x13d2fd[_0x2281('0x4a')](_0x16a473);}})[_0x2281('0x24')](function(_0x351815){if(_0x351815){_0x2b0678=_0x351815[_0x2281('0x37')];if(!_0x216ae8['query'][_0x2281('0x38')](_0x2281('0x39'))){_0x16a473[_0x2281('0x1e')]=qs['limit'](_0x216ae8[_0x2281('0x31')]['limit']);_0x16a473[_0x2281('0x1d')]=qs['offset'](_0x216ae8[_0x2281('0x31')]['offset']);}return _0x13d2fd[_0x2281('0x4a')](_0x16a473);}})[_0x2281('0x24')](function(_0x342684){if(_0x342684){return _0x342684?{'count':_0x2b0678,'rows':_0x342684}:null;}})[_0x2281('0x24')](respondWithResult(_0x3899d8,null))[_0x2281('0x45')](handleError(_0x3899d8,null));};exports[_0x2281('0x4c')]=function(_0x81b44e,_0x3a852d,_0x6177de){if(_0x81b44e['body']['id']){delete _0x81b44e['body']['id'];}return db[_0x2281('0x2b')][_0x2281('0x4d')]({'where':{'id':_0x81b44e[_0x2281('0x46')]['id']}})[_0x2281('0x24')](handleEntityNotFound(_0x3a852d,null))[_0x2281('0x24')](function(_0x1ef25c){if(_0x1ef25c){_0x81b44e[_0x2281('0x49')]['AccountId']=_0x1ef25c['id'];_0x81b44e[_0x2281('0x49')][_0x2281('0x4e')]=integrations[_0x2281('0x4f')](_0x81b44e[_0x2281('0x49')][_0x2281('0x50')],_0x81b44e['body']['type']);_0x81b44e[_0x2281('0x49')][_0x2281('0x51')]=integrations[_0x2281('0x52')](_0x81b44e[_0x2281('0x49')]['channel'],_0x81b44e[_0x2281('0x49')][_0x2281('0x2e')]);return db[_0x2281('0x53')][_0x2281('0x48')](_0x81b44e[_0x2281('0x49')],{'include':[{'model':db['SalesforceField'],'as':_0x2281('0x4e')},{'model':db[_0x2281('0x54')],'as':'Descriptions'}]});}return null;})[_0x2281('0x24')](respondWithResult(_0x3a852d,null))[_0x2281('0x45')](handleError(_0x3a852d,null));};exports[_0x2281('0x55')]=function(_0x4662b6,_0x5ddec3,_0x513eb2){var _0x1b17f4;var _0x3c8aeb='';var _0x1f01a5=_0x2281('0x56');return db[_0x2281('0x2b')][_0x2281('0x4d')]({'where':{'id':_0x4662b6['params']['id']},'attributes':['id',_0x2281('0x57'),_0x2281('0x58'),_0x2281('0x59'),_0x2281('0x5a'),_0x2281('0x5b'),_0x2281('0x5c')]})[_0x2281('0x24')](handleEntityNotFound(_0x5ddec3,null))[_0x2281('0x24')](function(_0xa2caba){if(_0xa2caba){_0x3c8aeb=_0xa2caba[_0x2281('0x57')];var _0x25a796=_0x3c8aeb[_0x2281('0x5d')](-0x1);if(_0x25a796==='/'){_0x3c8aeb=_0x3c8aeb[_0x2281('0x5e')](0x0,_0x3c8aeb['lastIndexOf'](_0x25a796));}_0x1b17f4=new jsforce[(_0x2281('0x5f'))]({'oauth2':{'loginUrl':_0x3c8aeb,'clientId':_0xa2caba[_0x2281('0x58')],'clientSecret':_0xa2caba['clientSecret']}});return _0x1b17f4[_0x2281('0x60')](_0xa2caba[_0x2281('0x5a')],_0xa2caba[_0x2281('0x5b')][_0x2281('0x61')](_0xa2caba['securityToken']));}})[_0x2281('0x24')](function(_0x1af99e){if(_0x1af99e){if(!_[_0x2281('0x62')](_0x4662b6['query'][_0x2281('0x63')])){_0x1f01a5=_0x4662b6[_0x2281('0x31')]['ticketType'];}return _0x1b17f4[_0x2281('0x64')](_0x1f01a5)[_0x2281('0x65')]();}})[_0x2281('0x24')](function(_0x4ee059){var _0x1608a6=[_0x2281('0x66'),_0x2281('0x67'),_0x2281('0x68'),_0x2281('0x69'),_0x2281('0x6a'),_0x2281('0x6b')];var _0x24d45c=[_0x2281('0x6c'),'int','picklist',_0x2281('0x6d'),_0x2281('0x6e'),_0x2281('0x6f'),_0x2281('0x70')];if(_0x4ee059){_[_0x2281('0x71')](_0x4ee059[_0x2281('0x35')],function(_0x5d5abf){return _0x1608a6['includes'](_0x5d5abf[_0x2281('0x28')])||!_0x24d45c[_0x2281('0x72')](_0x5d5abf[_0x2281('0x2e')]);});return{'count':_0x4ee059[_0x2281('0x35')][_0x2281('0x37')],'rows':_[_0x2281('0x2a')](_0x4ee059['fields'],function(_0x3ae4b4){return{'id':_0x3ae4b4[_0x2281('0x28')],'name':_0x3ae4b4[_0x2281('0x73')],'custom':_0x3ae4b4[_0x2281('0x74')],'options':_0x3ae4b4['picklistValues'][_0x2281('0x37')]>0x0?_[_0x2281('0x2a')](_0x3ae4b4[_0x2281('0x75')],function(_0x56c028){return{'name':_0x56c028[_0x2281('0x73')],'value':_0x56c028[_0x2281('0x76')]};}):_0x3ae4b4[_0x2281('0x2e')]==_0x2281('0x6d')?[{'name':'True','value':_0x2281('0x77')},{'name':'False','value':_0x2281('0x78')}]:[]};})};}})[_0x2281('0x24')](respondWithResult(_0x5ddec3,null))[_0x2281('0x45')](function(_0x3da9c4){var _0xd84b1a=_0x4662b6[_0x2281('0x31')][_0x2281('0x79')]?0x1f4:_0x3da9c4[_0x2281('0x7a')]||0x1f4;logger[_0x2281('0x26')](_0x2281('0x7b'),_0x2281('0x55'),_0xd84b1a,JSON[_0x2281('0x7c')](_0x3da9c4));delete _0x3da9c4['name'];if(_0xd84b1a===0x191){_0xd84b1a=0x190;}_0x5ddec3[_0x2281('0x18')](_0xd84b1a)['send'](_0x4662b6[_0x2281('0x31')][_0x2281('0x79')]?{'message':_0x2281('0x7d'),'statusCode':_0x3da9c4[_0x2281('0x7a')]}:_0x3da9c4);});}; \ No newline at end of file +var _0x1933=['order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','remoteUri','clientId','username','securityToken','slice','substring','lastIndexOf','login','concat','isNil','ticketType','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','boolean','email','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','index','SalesforceAccount','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','map','type','VIRTUAL','options','includeAll','include','findAll','show','params','length','merge','catch','create','body','find','getConfigurations','findOne','SalesforceConfiguration'];(function(_0x2b9002,_0x1e5306){var _0x2835e9=function(_0x406001){while(--_0x406001){_0x2b9002['push'](_0x2b9002['shift']());}};_0x2835e9(++_0x1e5306);}(_0x1933,0xa7));var _0x3193=function(_0x45ad39,_0x1709b3){_0x45ad39=_0x45ad39-0x0;var _0x2a5772=_0x1933[_0x45ad39];return _0x2a5772;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3193('0x0'));var zipdir=require(_0x3193('0x1'));var jsonpatch=require(_0x3193('0x2'));var rp=require(_0x3193('0x3'));var moment=require(_0x3193('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3193('0x5'));var util=require(_0x3193('0x6'));var path=require(_0x3193('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3193('0x8'));var fs=require('fs');var fs_extra=require(_0x3193('0x9'));var _=require(_0x3193('0xa'));var squel=require(_0x3193('0xb'));var crypto=require(_0x3193('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3193('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3193('0xe'));var Redis=require(_0x3193('0xf'));var authService=require(_0x3193('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3193('0x11'));var hardwareService=require(_0x3193('0x12'));var logger=require(_0x3193('0x13'))(_0x3193('0x14'));var utils=require(_0x3193('0x15'));var config=require(_0x3193('0x16'));var licenseUtil=require(_0x3193('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5a5411,_0x32e551){_0x32e551=_0x32e551||0xcc;return function(_0x57f3db){if(_0x57f3db){return _0x5a5411[_0x3193('0x18')](_0x32e551);}return _0x5a5411['status'](_0x32e551)[_0x3193('0x19')]();};}function respondWithResult(_0x1a9e1d,_0x5e4b83){_0x5e4b83=_0x5e4b83||0xc8;return function(_0x59a3ab){if(_0x59a3ab){return _0x1a9e1d[_0x3193('0x1a')](_0x5e4b83)[_0x3193('0x1b')](_0x59a3ab);}};}function respondWithFilteredResult(_0x248b95,_0x53064d){return function(_0xee07b0){if(_0xee07b0){var _0x25c089=typeof _0x53064d[_0x3193('0x1c')]===_0x3193('0x1d')&&typeof _0x53064d[_0x3193('0x1e')]===_0x3193('0x1d');var _0x12c863=_0xee07b0[_0x3193('0x1f')];var _0x2f210a=_0x25c089?0x0:_0x53064d['offset'];var _0x14efbe=_0x25c089?_0xee07b0[_0x3193('0x1f')]:_0x53064d[_0x3193('0x1c')]+_0x53064d['limit'];var _0x59821f;if(_0x14efbe>=_0x12c863){_0x14efbe=_0x12c863;_0x59821f=0xc8;}else{_0x59821f=0xce;}_0x248b95[_0x3193('0x1a')](_0x59821f);return _0x248b95[_0x3193('0x20')](_0x3193('0x21'),_0x2f210a+'-'+_0x14efbe+'/'+_0x12c863)[_0x3193('0x1b')](_0xee07b0);}return null;};}function patchUpdates(_0x2899f0){return function(_0x5596fc){try{jsonpatch['apply'](_0x5596fc,_0x2899f0,!![]);}catch(_0x20f603){return BPromise[_0x3193('0x22')](_0x20f603);}return _0x5596fc['save']();};}function saveUpdates(_0xf45b55,_0x150adb){return function(_0x40bfe8){if(_0x40bfe8){return _0x40bfe8[_0x3193('0x23')](_0xf45b55)[_0x3193('0x24')](function(_0xafe44b){return _0xafe44b;});}return null;};}function removeEntity(_0xc6971f,_0x480cce){return function(_0x14ee9b){if(_0x14ee9b){return _0x14ee9b[_0x3193('0x25')]()[_0x3193('0x24')](function(){_0xc6971f['status'](0xcc)[_0x3193('0x19')]();});}};}function handleEntityNotFound(_0x381e11,_0x40e6ac){return function(_0x536989){if(!_0x536989){_0x381e11[_0x3193('0x18')](0x194);}return _0x536989;};}function handleError(_0x36298c,_0x41e79a){_0x41e79a=_0x41e79a||0x1f4;return function(_0x37a475){logger[_0x3193('0x26')](_0x37a475[_0x3193('0x27')]);if(_0x37a475[_0x3193('0x28')]){delete _0x37a475[_0x3193('0x28')];}_0x36298c[_0x3193('0x1a')](_0x41e79a)['send'](_0x37a475);};}exports[_0x3193('0x29')]=function(_0x30e0db,_0x34ada1){var _0x574642={},_0x4289df={},_0x5e3697={'count':0x0,'rows':[]};var _0x1e789b=_['map'](db[_0x3193('0x2a')][_0x3193('0x2b')],function(_0x3a8bd1){return{'name':_0x3a8bd1['fieldName'],'type':_0x3a8bd1['type'][_0x3193('0x2c')]};});_0x4289df[_0x3193('0x2d')]=_['map'](_0x1e789b,_0x3193('0x28'));_0x4289df[_0x3193('0x2e')]=_[_0x3193('0x2f')](_0x30e0db[_0x3193('0x2e')]);_0x4289df[_0x3193('0x30')]=_['intersection'](_0x4289df[_0x3193('0x2d')],_0x4289df[_0x3193('0x2e')]);_0x574642[_0x3193('0x31')]=_[_0x3193('0x32')](_0x4289df[_0x3193('0x2d')],qs['fields'](_0x30e0db[_0x3193('0x2e')][_0x3193('0x33')]));_0x574642[_0x3193('0x31')]=_0x574642[_0x3193('0x31')]['length']?_0x574642[_0x3193('0x31')]:_0x4289df[_0x3193('0x2d')];if(!_0x30e0db['query']['hasOwnProperty'](_0x3193('0x34'))){_0x574642[_0x3193('0x1e')]=qs[_0x3193('0x1e')](_0x30e0db[_0x3193('0x2e')][_0x3193('0x1e')]);_0x574642[_0x3193('0x1c')]=qs[_0x3193('0x1c')](_0x30e0db[_0x3193('0x2e')][_0x3193('0x1c')]);}_0x574642['order']=qs[_0x3193('0x35')](_0x30e0db['query'][_0x3193('0x35')]);_0x574642[_0x3193('0x36')]=qs[_0x3193('0x30')](_[_0x3193('0x37')](_0x30e0db['query'],_0x4289df['filters']),_0x1e789b);if(_0x30e0db['query'][_0x3193('0x38')]){_0x574642[_0x3193('0x36')]=_['merge'](_0x574642[_0x3193('0x36')],{'$or':_[_0x3193('0x39')](_0x1e789b,function(_0x14ae24){if(_0x14ae24[_0x3193('0x3a')]!==_0x3193('0x3b')){var _0x4ef26a={};_0x4ef26a[_0x14ae24[_0x3193('0x28')]]={'$like':'%'+_0x30e0db['query'][_0x3193('0x38')]+'%'};return _0x4ef26a;}})});}_0x574642=_['merge']({},_0x574642,_0x30e0db[_0x3193('0x3c')]);var _0x3e82e2={'where':_0x574642['where']};return db['SalesforceAccount'][_0x3193('0x1f')](_0x3e82e2)[_0x3193('0x24')](function(_0x2dedb){_0x5e3697[_0x3193('0x1f')]=_0x2dedb;if(_0x30e0db[_0x3193('0x2e')][_0x3193('0x3d')]){_0x574642[_0x3193('0x3e')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x3193('0x3f')](_0x574642);})[_0x3193('0x24')](function(_0x2001d1){_0x5e3697['rows']=_0x2001d1;return _0x5e3697;})[_0x3193('0x24')](respondWithFilteredResult(_0x34ada1,_0x574642))['catch'](handleError(_0x34ada1,null));};exports[_0x3193('0x40')]=function(_0x222e7e,_0x3f71b8){var _0x94fe57={'raw':![],'where':{'id':_0x222e7e[_0x3193('0x41')]['id']}},_0x221aae={};_0x221aae['model']=_[_0x3193('0x2f')](db['SalesforceAccount'][_0x3193('0x2b')]);_0x221aae['query']=_['keys'](_0x222e7e[_0x3193('0x2e')]);_0x221aae['filters']=_[_0x3193('0x32')](_0x221aae['model'],_0x221aae[_0x3193('0x2e')]);_0x94fe57['attributes']=_[_0x3193('0x32')](_0x221aae[_0x3193('0x2d')],qs[_0x3193('0x33')](_0x222e7e['query'][_0x3193('0x33')]));_0x94fe57[_0x3193('0x31')]=_0x94fe57[_0x3193('0x31')][_0x3193('0x42')]?_0x94fe57['attributes']:_0x221aae[_0x3193('0x2d')];if(_0x222e7e[_0x3193('0x2e')]['includeAll']){_0x94fe57[_0x3193('0x3e')]=[{'all':!![]}];}_0x94fe57=_[_0x3193('0x43')]({},_0x94fe57,_0x222e7e[_0x3193('0x3c')]);return db[_0x3193('0x2a')]['find'](_0x94fe57)[_0x3193('0x24')](handleEntityNotFound(_0x3f71b8,null))[_0x3193('0x24')](respondWithResult(_0x3f71b8,null))[_0x3193('0x44')](handleError(_0x3f71b8,null));};exports[_0x3193('0x45')]=function(_0x19650b,_0x222bb5){return db[_0x3193('0x2a')][_0x3193('0x45')](_0x19650b['body'],{})[_0x3193('0x24')](respondWithResult(_0x222bb5,0xc9))[_0x3193('0x44')](handleError(_0x222bb5,null));};exports[_0x3193('0x23')]=function(_0x2317a0,_0x56f2b1){if(_0x2317a0[_0x3193('0x46')]['id']){delete _0x2317a0[_0x3193('0x46')]['id'];}return db[_0x3193('0x2a')]['find']({'where':{'id':_0x2317a0[_0x3193('0x41')]['id']}})[_0x3193('0x24')](handleEntityNotFound(_0x56f2b1,null))[_0x3193('0x24')](saveUpdates(_0x2317a0['body'],null))[_0x3193('0x24')](respondWithResult(_0x56f2b1,null))['catch'](handleError(_0x56f2b1,null));};exports[_0x3193('0x25')]=function(_0x1251d3,_0xc5e821){return db[_0x3193('0x2a')][_0x3193('0x47')]({'where':{'id':_0x1251d3[_0x3193('0x41')]['id']}})[_0x3193('0x24')](handleEntityNotFound(_0xc5e821,null))[_0x3193('0x24')](removeEntity(_0xc5e821,null))[_0x3193('0x44')](handleError(_0xc5e821,null));};exports[_0x3193('0x48')]=function(_0x190157,_0x497769,_0x32c63b){var _0x3c348a={};var _0x368568={};var _0xd65969;var _0x1acaf2;return db[_0x3193('0x2a')][_0x3193('0x49')]({'where':{'id':_0x190157[_0x3193('0x41')]['id']}})['then'](handleEntityNotFound(_0x497769,null))['then'](function(_0x3922e5){if(_0x3922e5){_0xd65969=_0x3922e5;_0x368568[_0x3193('0x2d')]=_[_0x3193('0x2f')](db[_0x3193('0x4a')][_0x3193('0x2b')]);_0x368568[_0x3193('0x2e')]=_[_0x3193('0x2f')](_0x190157[_0x3193('0x2e')]);_0x368568[_0x3193('0x30')]=_[_0x3193('0x32')](_0x368568[_0x3193('0x2d')],_0x368568['query']);_0x3c348a[_0x3193('0x31')]=_[_0x3193('0x32')](_0x368568[_0x3193('0x2d')],qs[_0x3193('0x33')](_0x190157[_0x3193('0x2e')][_0x3193('0x33')]));_0x3c348a['attributes']=_0x3c348a[_0x3193('0x31')][_0x3193('0x42')]?_0x3c348a[_0x3193('0x31')]:_0x368568['model'];_0x3c348a[_0x3193('0x4b')]=qs[_0x3193('0x35')](_0x190157[_0x3193('0x2e')][_0x3193('0x35')]);_0x3c348a[_0x3193('0x36')]=qs[_0x3193('0x30')](_[_0x3193('0x37')](_0x190157['query'],_0x368568[_0x3193('0x30')]));if(_0x190157[_0x3193('0x2e')][_0x3193('0x38')]){_0x3c348a[_0x3193('0x36')]=_[_0x3193('0x43')](_0x3c348a[_0x3193('0x36')],{'$or':_[_0x3193('0x39')](_0x3c348a[_0x3193('0x31')],function(_0x209922){var _0x152c8d={};_0x152c8d[_0x209922]={'$like':'%'+_0x190157['query']['filter']+'%'};return _0x152c8d;})});}_0x3c348a=_[_0x3193('0x43')]({},_0x3c348a,_0x190157[_0x3193('0x3c')]);return _0xd65969['getConfigurations'](_0x3c348a);}})[_0x3193('0x24')](function(_0x14b392){if(_0x14b392){_0x1acaf2=_0x14b392['length'];if(!_0x190157[_0x3193('0x2e')][_0x3193('0x4c')](_0x3193('0x34'))){_0x3c348a[_0x3193('0x1e')]=qs[_0x3193('0x1e')](_0x190157[_0x3193('0x2e')]['limit']);_0x3c348a['offset']=qs[_0x3193('0x1c')](_0x190157[_0x3193('0x2e')][_0x3193('0x1c')]);}return _0xd65969[_0x3193('0x48')](_0x3c348a);}})['then'](function(_0x5d4eef){if(_0x5d4eef){return _0x5d4eef?{'count':_0x1acaf2,'rows':_0x5d4eef}:null;}})['then'](respondWithResult(_0x497769,null))[_0x3193('0x44')](handleError(_0x497769,null));};exports[_0x3193('0x4d')]=function(_0x4b6830,_0x482dc5,_0x57bfa2){if(_0x4b6830[_0x3193('0x46')]['id']){delete _0x4b6830[_0x3193('0x46')]['id'];}return db[_0x3193('0x2a')][_0x3193('0x49')]({'where':{'id':_0x4b6830['params']['id']}})[_0x3193('0x24')](handleEntityNotFound(_0x482dc5,null))[_0x3193('0x24')](function(_0x148537){if(_0x148537){_0x4b6830[_0x3193('0x46')]['AccountId']=_0x148537['id'];_0x4b6830['body'][_0x3193('0x4e')]=integrations[_0x3193('0x4f')](_0x4b6830[_0x3193('0x46')][_0x3193('0x50')],_0x4b6830[_0x3193('0x46')]['type']);_0x4b6830[_0x3193('0x46')]['Descriptions']=integrations[_0x3193('0x51')](_0x4b6830['body'][_0x3193('0x50')],_0x4b6830['body'][_0x3193('0x3a')]);return db[_0x3193('0x4a')][_0x3193('0x45')](_0x4b6830[_0x3193('0x46')],{'include':[{'model':db[_0x3193('0x52')],'as':_0x3193('0x4e')},{'model':db[_0x3193('0x52')],'as':_0x3193('0x53')}]});}return null;})[_0x3193('0x24')](respondWithResult(_0x482dc5,null))[_0x3193('0x44')](handleError(_0x482dc5,null));};exports[_0x3193('0x54')]=function(_0x29ae39,_0x48b961,_0x593221){var _0x2a6b8a;var _0x4dc370='';var _0x213243='Task';return db[_0x3193('0x2a')][_0x3193('0x49')]({'where':{'id':_0x29ae39[_0x3193('0x41')]['id']},'attributes':['id',_0x3193('0x55'),_0x3193('0x56'),'clientSecret',_0x3193('0x57'),'password',_0x3193('0x58')]})[_0x3193('0x24')](handleEntityNotFound(_0x48b961,null))[_0x3193('0x24')](function(_0xeb7d2b){if(_0xeb7d2b){_0x4dc370=_0xeb7d2b[_0x3193('0x55')];var _0x4edd17=_0x4dc370[_0x3193('0x59')](-0x1);if(_0x4edd17==='/'){_0x4dc370=_0x4dc370[_0x3193('0x5a')](0x0,_0x4dc370[_0x3193('0x5b')](_0x4edd17));}_0x2a6b8a=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4dc370,'clientId':_0xeb7d2b['clientId'],'clientSecret':_0xeb7d2b['clientSecret']}});return _0x2a6b8a[_0x3193('0x5c')](_0xeb7d2b[_0x3193('0x57')],_0xeb7d2b['password'][_0x3193('0x5d')](_0xeb7d2b['securityToken']));}})['then'](function(_0x1e27ae){if(_0x1e27ae){if(!_[_0x3193('0x5e')](_0x29ae39[_0x3193('0x2e')][_0x3193('0x5f')])){_0x213243=_0x29ae39[_0x3193('0x2e')][_0x3193('0x5f')];}return _0x2a6b8a['sobject'](_0x213243)[_0x3193('0x60')]();}})['then'](function(_0x2d6f31){var _0x51442b=['OwnerId',_0x3193('0x61'),_0x3193('0x62'),_0x3193('0x63'),_0x3193('0x64'),_0x3193('0x65')];var _0x318f45=['string','int','picklist',_0x3193('0x66'),_0x3193('0x67'),'textarea',_0x3193('0x68')];if(_0x2d6f31){_[_0x3193('0x69')](_0x2d6f31['fields'],function(_0x16e498){return _0x51442b[_0x3193('0x6a')](_0x16e498['name'])||!_0x318f45['includes'](_0x16e498[_0x3193('0x3a')]);});return{'count':_0x2d6f31['fields'][_0x3193('0x42')],'rows':_[_0x3193('0x39')](_0x2d6f31[_0x3193('0x33')],function(_0x4c353f){return{'id':_0x4c353f['name'],'name':_0x4c353f[_0x3193('0x6b')],'custom':_0x4c353f[_0x3193('0x6c')],'options':_0x4c353f[_0x3193('0x6d')][_0x3193('0x42')]>0x0?_[_0x3193('0x39')](_0x4c353f[_0x3193('0x6d')],function(_0x5304f1){return{'name':_0x5304f1[_0x3193('0x6b')],'value':_0x5304f1[_0x3193('0x6e')]};}):_0x4c353f['type']==_0x3193('0x66')?[{'name':_0x3193('0x6f'),'value':_0x3193('0x70')},{'name':_0x3193('0x71'),'value':_0x3193('0x72')}]:[]};})};}})[_0x3193('0x24')](respondWithResult(_0x48b961,null))[_0x3193('0x44')](function(_0x27bad0){var _0x2c7fc0=_0x29ae39['query'][_0x3193('0x73')]?0x1f4:_0x27bad0[_0x3193('0x74')]||0x1f4;logger[_0x3193('0x26')](_0x3193('0x75'),'getFields',_0x2c7fc0,JSON[_0x3193('0x76')](_0x27bad0));delete _0x27bad0[_0x3193('0x28')];if(_0x2c7fc0===0x191){_0x2c7fc0=0x190;}_0x48b961[_0x3193('0x1a')](_0x2c7fc0)[_0x3193('0x77')](_0x29ae39[_0x3193('0x2e')][_0x3193('0x73')]?{'message':_0x3193('0x78'),'statusCode':_0x27bad0[_0x3193('0x74')]}:_0x27bad0);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ae3853e..847bd2f 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 _0x0cc3=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','lodash','api'];(function(_0x390e55,_0xd2a8d9){var _0x420578=function(_0x15cdb4){while(--_0x15cdb4){_0x390e55['push'](_0x390e55['shift']());}};_0x420578(++_0xd2a8d9);}(_0x0cc3,0x195));var _0x30cc=function(_0x4f705c,_0x31e403){_0x4f705c=_0x4f705c-0x0;var _0x506455=_0x0cc3[_0x4f705c];return _0x506455;};'use strict';var _=require(_0x30cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30cc('0x1'));var moment=require('moment');var BPromise=require(_0x30cc('0x2'));var rp=require(_0x30cc('0x3'));var fs=require('fs');var path=require(_0x30cc('0x4'));var rimraf=require(_0x30cc('0x5'));var config=require(_0x30cc('0x6'));var attributes=require(_0x30cc('0x7'));var integrations=require(_0x30cc('0x8'));module['exports']=function(_0x255ccf,_0x105406){return _0x255ccf[_0x30cc('0x9')](_0x30cc('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbde8=['exports','define','int_salesforce_accounts','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x47516e,_0x579fcc){var _0x384bcd=function(_0x4e41c7){while(--_0x4e41c7){_0x47516e['push'](_0x47516e['shift']());}};_0x384bcd(++_0x579fcc);}(_0xbde8,0x155));var _0x8bde=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0xbde8[_0x351b46];return _0x1515df;};'use strict';var _=require(_0x8bde('0x0'));var util=require(_0x8bde('0x1'));var logger=require('../../config/logger')(_0x8bde('0x2'));var moment=require(_0x8bde('0x3'));var BPromise=require(_0x8bde('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bde('0x5'));var rimraf=require(_0x8bde('0x6'));var config=require(_0x8bde('0x7'));var attributes=require(_0x8bde('0x8'));var integrations=require(_0x8bde('0x9'));module[_0x8bde('0xa')]=function(_0x2a3965,_0x2fa161){return _0x2a3965[_0x8bde('0xb')]('SalesforceAccount',attributes,{'tableName':_0x8bde('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 057381f..a88d9d2 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 _0x0e0f=['rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','map','include','then','ShowSalesforceAccount','find','model','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x0e0f,0x19f));var _0xf0e0=function(_0xa7c51d,_0x208771){_0xa7c51d=_0xa7c51d-0x0;var _0x26febd=_0x0e0f[_0xa7c51d];return _0x26febd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0e0('0x0'));var BPromise=require(_0xf0e0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0e0('0x2'))['db'];var utils=require(_0xf0e0('0x3'));var logger=require(_0xf0e0('0x4'))(_0xf0e0('0x5'));var config=require(_0xf0e0('0x6'));var jayson=require(_0xf0e0('0x7'));var client=jayson[_0xf0e0('0x8')][_0xf0e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42cda2,_0x4450a3,_0x462788){return new BPromise(function(_0x1cfaa2,_0x14b29a){return client[_0xf0e0('0xa')](_0x42cda2,_0x462788)['then'](function(_0x134dba){logger[_0xf0e0('0xb')](_0xf0e0('0xc'),_0x4450a3,_0xf0e0('0xd'));logger[_0xf0e0('0xe')](_0xf0e0('0xf'),_0x4450a3,_0xf0e0('0xd'),JSON[_0xf0e0('0x10')](_0x134dba));if(_0x134dba[_0xf0e0('0x11')]){if(_0x134dba['error'][_0xf0e0('0x12')]===0x1f4){logger[_0xf0e0('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4450a3,_0x134dba[_0xf0e0('0x11')][_0xf0e0('0x13')]);return _0x14b29a(_0x134dba[_0xf0e0('0x11')][_0xf0e0('0x13')]);}logger['error'](_0xf0e0('0xc'),_0x4450a3,_0x134dba['error'][_0xf0e0('0x13')]);return _0x1cfaa2(_0x134dba[_0xf0e0('0x11')]['message']);}else{logger[_0xf0e0('0xb')](_0xf0e0('0xc'),_0x4450a3,_0xf0e0('0xd'));_0x1cfaa2(_0x134dba[_0xf0e0('0x14')][_0xf0e0('0x13')]);}})[_0xf0e0('0x15')](function(_0x7d4121){logger['error'](_0xf0e0('0xc'),_0x4450a3,_0x7d4121);_0x14b29a(_0x7d4121);});});}exports[_0xf0e0('0x16')]=function(_0x1ed20a){var _0xdc7a47=this;return new Promise(function(_0x32b34a,_0x31428f){return db[_0xf0e0('0x17')][_0xf0e0('0x18')]({'raw':_0x1ed20a[_0xf0e0('0x19')]?_0x1ed20a[_0xf0e0('0x19')][_0xf0e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ed20a[_0xf0e0('0x19')]?_0x1ed20a[_0xf0e0('0x19')][_0xf0e0('0x1b')]||null:null,'attributes':_0x1ed20a['options']?_0x1ed20a[_0xf0e0('0x19')][_0xf0e0('0x1c')]||null:null,'limit':_0x1ed20a[_0xf0e0('0x19')]?_0x1ed20a[_0xf0e0('0x19')]['limit']||null:null,'include':_0x1ed20a['options']?_0x1ed20a['options']['include']?_[_0xf0e0('0x1d')](_0x1ed20a['options'][_0xf0e0('0x1e')],function(_0x50c3b2){return{'model':db[_0x50c3b2['model']],'as':_0x50c3b2['as'],'attributes':_0x50c3b2[_0xf0e0('0x1c')],'include':_0x50c3b2[_0xf0e0('0x1e')]?_[_0xf0e0('0x1d')](_0x50c3b2[_0xf0e0('0x1e')],function(_0x1657c7){return{'model':db[_0x1657c7['model']],'as':_0x1657c7['as'],'attributes':_0x1657c7[_0xf0e0('0x1c')],'include':_0x1657c7[_0xf0e0('0x1e')]?_['map'](_0x1657c7['include'],function(_0x1a3b20){return{'model':db[_0x1a3b20['model']],'as':_0x1a3b20['as'],'attributes':_0x1a3b20['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0e0('0x1f')](function(_0x1f46d6){logger['info']('GetSalesforceAccount',_0x1ed20a);logger[_0xf0e0('0xe')]('GetSalesforceAccount',_0x1ed20a,JSON[_0xf0e0('0x10')](_0x1f46d6));_0x32b34a(_0x1f46d6);})[_0xf0e0('0x15')](function(_0x303fd5){logger[_0xf0e0('0x11')](_0xf0e0('0x16'),_0x303fd5[_0xf0e0('0x13')],_0x1ed20a);_0x31428f(_0xdc7a47[_0xf0e0('0x11')](0x1f4,_0x303fd5['message']));});});};exports[_0xf0e0('0x20')]=function(_0x2dc593){var _0x54a8c4=this;return new Promise(function(_0x34cca1,_0x3c98d6){return db['SalesforceAccount'][_0xf0e0('0x21')]({'raw':_0x2dc593[_0xf0e0('0x19')]?_0x2dc593['options']['raw']===undefined?!![]:![]:!![],'where':_0x2dc593['options']?_0x2dc593['options']['where']||null:null,'attributes':_0x2dc593[_0xf0e0('0x19')]?_0x2dc593[_0xf0e0('0x19')][_0xf0e0('0x1c')]||null:null,'include':_0x2dc593['options']?_0x2dc593[_0xf0e0('0x19')][_0xf0e0('0x1e')]?_[_0xf0e0('0x1d')](_0x2dc593['options'][_0xf0e0('0x1e')],function(_0x5a6fa1){return{'model':db[_0x5a6fa1[_0xf0e0('0x22')]],'as':_0x5a6fa1['as'],'attributes':_0x5a6fa1[_0xf0e0('0x1c')],'include':_0x5a6fa1[_0xf0e0('0x1e')]?_[_0xf0e0('0x1d')](_0x5a6fa1['include'],function(_0x351a07){return{'model':db[_0x351a07[_0xf0e0('0x22')]],'as':_0x351a07['as'],'attributes':_0x351a07['attributes'],'include':_0x351a07[_0xf0e0('0x1e')]?_['map'](_0x351a07[_0xf0e0('0x1e')],function(_0x2d2f72){return{'model':db[_0x2d2f72['model']],'as':_0x2d2f72['as'],'attributes':_0x2d2f72[_0xf0e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf0e0('0x1f')](function(_0x5cf1b5){logger[_0xf0e0('0xb')](_0xf0e0('0x20'),_0x2dc593);logger[_0xf0e0('0xe')](_0xf0e0('0x20'),_0x2dc593,JSON[_0xf0e0('0x10')](_0x5cf1b5));_0x34cca1(_0x5cf1b5);})[_0xf0e0('0x15')](function(_0x41f5bb){logger[_0xf0e0('0x11')](_0xf0e0('0x20'),_0x41f5bb[_0xf0e0('0x13')],_0x2dc593);_0x3c98d6(_0x54a8c4[_0xf0e0('0x11')](0x1f4,_0x41f5bb[_0xf0e0('0x13')]));});});}; \ No newline at end of file +var _0xcc7d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','GetSalesforceAccount','catch','ShowSalesforceAccount','find','lodash','util'];(function(_0x41f868,_0x253a6a){var _0xce8ba=function(_0x1eb35f){while(--_0x1eb35f){_0x41f868['push'](_0x41f868['shift']());}};_0xce8ba(++_0x253a6a);}(_0xcc7d,0x1ae));var _0xdcc7=function(_0xa4a1e4,_0x7afc8c){_0xa4a1e4=_0xa4a1e4-0x0;var _0x1036bc=_0xcc7d[_0xa4a1e4];return _0x1036bc;};'use strict';var _=require(_0xdcc7('0x0'));var util=require(_0xdcc7('0x1'));var moment=require('moment');var BPromise=require(_0xdcc7('0x2'));var rs=require(_0xdcc7('0x3'));var fs=require('fs');var Redis=require(_0xdcc7('0x4'));var db=require(_0xdcc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcc7('0x6'))('rpc');var config=require(_0xdcc7('0x7'));var jayson=require(_0xdcc7('0x8'));var client=jayson[_0xdcc7('0x9')][_0xdcc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f9f4a,_0x160fa4,_0x4f7762){return new BPromise(function(_0x3f06b0,_0x3be02a){return client[_0xdcc7('0xb')](_0x4f9f4a,_0x4f7762)[_0xdcc7('0xc')](function(_0x1c0928){logger[_0xdcc7('0xd')](_0xdcc7('0xe'),_0x160fa4,_0xdcc7('0xf'));logger['debug'](_0xdcc7('0x10'),_0x160fa4,_0xdcc7('0xf'),JSON[_0xdcc7('0x11')](_0x1c0928));if(_0x1c0928[_0xdcc7('0x12')]){if(_0x1c0928['error']['code']===0x1f4){logger[_0xdcc7('0x12')](_0xdcc7('0xe'),_0x160fa4,_0x1c0928['error'][_0xdcc7('0x13')]);return _0x3be02a(_0x1c0928[_0xdcc7('0x12')][_0xdcc7('0x13')]);}logger[_0xdcc7('0x12')](_0xdcc7('0xe'),_0x160fa4,_0x1c0928['error'][_0xdcc7('0x13')]);return _0x3f06b0(_0x1c0928[_0xdcc7('0x12')][_0xdcc7('0x13')]);}else{logger[_0xdcc7('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x160fa4,_0xdcc7('0xf'));_0x3f06b0(_0x1c0928[_0xdcc7('0x14')][_0xdcc7('0x13')]);}})['catch'](function(_0x2e4aea){logger['error'](_0xdcc7('0xe'),_0x160fa4,_0x2e4aea);_0x3be02a(_0x2e4aea);});});}exports['GetSalesforceAccount']=function(_0x289dc0){var _0x36bf3=this;return new Promise(function(_0x3ffbb8,_0x1e42e6){return db[_0xdcc7('0x15')][_0xdcc7('0x16')]({'raw':_0x289dc0[_0xdcc7('0x17')]?_0x289dc0['options'][_0xdcc7('0x18')]===undefined?!![]:![]:!![],'where':_0x289dc0['options']?_0x289dc0[_0xdcc7('0x17')][_0xdcc7('0x19')]||null:null,'attributes':_0x289dc0[_0xdcc7('0x17')]?_0x289dc0[_0xdcc7('0x17')]['attributes']||null:null,'limit':_0x289dc0[_0xdcc7('0x17')]?_0x289dc0[_0xdcc7('0x17')][_0xdcc7('0x1a')]||null:null,'include':_0x289dc0[_0xdcc7('0x17')]?_0x289dc0[_0xdcc7('0x17')][_0xdcc7('0x1b')]?_[_0xdcc7('0x1c')](_0x289dc0['options'][_0xdcc7('0x1b')],function(_0x28104b){return{'model':db[_0x28104b[_0xdcc7('0x1d')]],'as':_0x28104b['as'],'attributes':_0x28104b[_0xdcc7('0x1e')],'include':_0x28104b[_0xdcc7('0x1b')]?_[_0xdcc7('0x1c')](_0x28104b[_0xdcc7('0x1b')],function(_0x1ce7c9){return{'model':db[_0x1ce7c9[_0xdcc7('0x1d')]],'as':_0x1ce7c9['as'],'attributes':_0x1ce7c9[_0xdcc7('0x1e')],'include':_0x1ce7c9[_0xdcc7('0x1b')]?_['map'](_0x1ce7c9['include'],function(_0x1a3d61){return{'model':db[_0x1a3d61[_0xdcc7('0x1d')]],'as':_0x1a3d61['as'],'attributes':_0x1a3d61['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2e68){logger['info']('GetSalesforceAccount',_0x289dc0);logger[_0xdcc7('0x1f')](_0xdcc7('0x20'),_0x289dc0,JSON[_0xdcc7('0x11')](_0x3a2e68));_0x3ffbb8(_0x3a2e68);})[_0xdcc7('0x21')](function(_0xb1ff05){logger['error'](_0xdcc7('0x20'),_0xb1ff05[_0xdcc7('0x13')],_0x289dc0);_0x1e42e6(_0x36bf3[_0xdcc7('0x12')](0x1f4,_0xb1ff05['message']));});});};exports[_0xdcc7('0x22')]=function(_0x19111b){var _0x169e2f=this;return new Promise(function(_0x1a1550,_0x3fffe4){return db['SalesforceAccount'][_0xdcc7('0x23')]({'raw':_0x19111b[_0xdcc7('0x17')]?_0x19111b['options'][_0xdcc7('0x18')]===undefined?!![]:![]:!![],'where':_0x19111b['options']?_0x19111b['options'][_0xdcc7('0x19')]||null:null,'attributes':_0x19111b[_0xdcc7('0x17')]?_0x19111b[_0xdcc7('0x17')]['attributes']||null:null,'include':_0x19111b[_0xdcc7('0x17')]?_0x19111b['options'][_0xdcc7('0x1b')]?_['map'](_0x19111b[_0xdcc7('0x17')][_0xdcc7('0x1b')],function(_0x51c484){return{'model':db[_0x51c484['model']],'as':_0x51c484['as'],'attributes':_0x51c484['attributes'],'include':_0x51c484[_0xdcc7('0x1b')]?_[_0xdcc7('0x1c')](_0x51c484['include'],function(_0x2de45a){return{'model':db[_0x2de45a[_0xdcc7('0x1d')]],'as':_0x2de45a['as'],'attributes':_0x2de45a[_0xdcc7('0x1e')],'include':_0x2de45a[_0xdcc7('0x1b')]?_[_0xdcc7('0x1c')](_0x2de45a[_0xdcc7('0x1b')],function(_0x5a6eb7){return{'model':db[_0x5a6eb7['model']],'as':_0x5a6eb7['as'],'attributes':_0x5a6eb7[_0xdcc7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdcc7('0xc')](function(_0x17efb4){logger[_0xdcc7('0xd')](_0xdcc7('0x22'),_0x19111b);logger[_0xdcc7('0x1f')](_0xdcc7('0x22'),_0x19111b,JSON[_0xdcc7('0x11')](_0x17efb4));_0x1a1550(_0x17efb4);})[_0xdcc7('0x21')](function(_0xf6c7a2){logger[_0xdcc7('0x12')](_0xdcc7('0x22'),_0xf6c7a2['message'],_0x19111b);_0x3fffe4(_0x169e2f[_0xdcc7('0x12')](0x1f4,_0xf6c7a2[_0xdcc7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 3c7b4c0..c81e650 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x5eb48c,_0x3604af){var _0x1e7919=function(_0x22a5bb){while(--_0x22a5bb){_0x5eb48c['push'](_0x5eb48c['shift']());}};_0x1e7919(++_0x3604af);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xdb28,0x106));var _0x8db2=function(_0x2865d8,_0x42de40){_0x2865d8=_0x2865d8-0x0;var _0x229dfd=_0xdb28[_0x2865d8];return _0x229dfd;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f1d564c..f9fc594 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 _0x9137=['Task','Case','contact_lead','contact','nothing','account','STRING','ENUM'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9137,0x7e));var _0x7913=function(_0x281820,_0x47572b){_0x281820=_0x281820-0x0;var _0x2d05f6=_0x9137[_0x281820];return _0x2d05f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7913('0x0')]},'description':{'type':Sequelize[_0x7913('0x0')]},'ticketType':{'type':Sequelize[_0x7913('0x1')](_0x7913('0x2'),_0x7913('0x3')),'defaultValue':_0x7913('0x2')},'moduleSearch':{'type':Sequelize[_0x7913('0x1')](_0x7913('0x4'),_0x7913('0x5'),'lead','account_contact_lead','account'),'defaultValue':_0x7913('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x7913('0x6'),_0x7913('0x5'),'lead',_0x7913('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x7913('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x7913('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x7913('0x0')]},'additionalSearchLead':{'type':Sequelize[_0x7913('0x0')]}}; \ No newline at end of file +var _0x4a4d=['ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING'];(function(_0x253498,_0x4ba257){var _0x5b7a5a=function(_0xbe404a){while(--_0xbe404a){_0x253498['push'](_0x253498['shift']());}};_0x5b7a5a(++_0x4ba257);}(_0x4a4d,0x111));var _0xd4a4=function(_0x8e2e88,_0x112b81){_0x8e2e88=_0x8e2e88-0x0;var _0x2cf053=_0x4a4d[_0x8e2e88];return _0x2cf053;};'use strict';var Sequelize=require(_0xd4a4('0x0'));module[_0xd4a4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd4a4('0x2')]},'ticketType':{'type':Sequelize[_0xd4a4('0x3')](_0xd4a4('0x4'),_0xd4a4('0x5')),'defaultValue':_0xd4a4('0x4')},'moduleSearch':{'type':Sequelize[_0xd4a4('0x3')](_0xd4a4('0x6'),_0xd4a4('0x7'),_0xd4a4('0x8'),_0xd4a4('0x9'),_0xd4a4('0xa')),'defaultValue':_0xd4a4('0x6')},'moduleCreate':{'type':Sequelize[_0xd4a4('0x3')](_0xd4a4('0xb'),_0xd4a4('0x7'),'lead',_0xd4a4('0xa')),'defaultValue':_0xd4a4('0x8')},'leadId':{'type':Sequelize[_0xd4a4('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xd4a4('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xd4a4('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xd4a4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 403d8ef..662bd50 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 _0x0441=['end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','findAll','rows','show','params','options','find','create','body','catch','getFields','SalesforceField','merge','findOne','pick','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x298e62,_0x4d42bc){var _0x48ba2b=function(_0x1a5471){while(--_0x1a5471){_0x298e62['push'](_0x298e62['shift']());}};_0x48ba2b(++_0x4d42bc);}(_0x0441,0x8c));var _0x1044=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x0441[_0x1f71d8];return _0x10b045;};'use strict';var emlformat=require(_0x1044('0x0'));var rimraf=require(_0x1044('0x1'));var zipdir=require(_0x1044('0x2'));var jsonpatch=require(_0x1044('0x3'));var rp=require('request-promise');var moment=require(_0x1044('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1044('0x5'));var util=require(_0x1044('0x6'));var path=require(_0x1044('0x7'));var sox=require(_0x1044('0x8'));var csv=require(_0x1044('0x9'));var ejs=require(_0x1044('0xa'));var fs=require('fs');var fs_extra=require(_0x1044('0xb'));var _=require(_0x1044('0xc'));var squel=require(_0x1044('0xd'));var crypto=require(_0x1044('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1044('0xf'));var toCsv=require(_0x1044('0x9'));var querystring=require(_0x1044('0x10'));var Papa=require(_0x1044('0x11'));var Redis=require(_0x1044('0x12'));var authService=require(_0x1044('0x13'));var qs=require(_0x1044('0x14'));var as=require(_0x1044('0x15'));var hardwareService=require(_0x1044('0x16'));var logger=require(_0x1044('0x17'))(_0x1044('0x18'));var utils=require(_0x1044('0x19'));var config=require(_0x1044('0x1a'));var licenseUtil=require(_0x1044('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9c42,_0x14c595){_0x14c595=_0x14c595||0xcc;return function(_0x488155){if(_0x488155){return _0x3d9c42[_0x1044('0x1c')](_0x14c595);}return _0x3d9c42[_0x1044('0x1d')](_0x14c595)[_0x1044('0x1e')]();};}function respondWithResult(_0x400d2b,_0x58971b){_0x58971b=_0x58971b||0xc8;return function(_0x516567){if(_0x516567){return _0x400d2b[_0x1044('0x1d')](_0x58971b)[_0x1044('0x1f')](_0x516567);}};}function respondWithFilteredResult(_0x354850,_0xc5f3d4){return function(_0xefdb07){if(_0xefdb07){var _0x4c6082=typeof _0xc5f3d4['offset']===_0x1044('0x20')&&typeof _0xc5f3d4['limit']===_0x1044('0x20');var _0x34d817=_0xefdb07[_0x1044('0x21')];var _0xa3870d=_0x4c6082?0x0:_0xc5f3d4[_0x1044('0x22')];var _0x8c4a07=_0x4c6082?_0xefdb07[_0x1044('0x21')]:_0xc5f3d4[_0x1044('0x22')]+_0xc5f3d4[_0x1044('0x23')];var _0x36f88a;if(_0x8c4a07>=_0x34d817){_0x8c4a07=_0x34d817;_0x36f88a=0xc8;}else{_0x36f88a=0xce;}_0x354850[_0x1044('0x1d')](_0x36f88a);return _0x354850[_0x1044('0x24')](_0x1044('0x25'),_0xa3870d+'-'+_0x8c4a07+'/'+_0x34d817)[_0x1044('0x1f')](_0xefdb07);}return null;};}function patchUpdates(_0x135a74){return function(_0x262402){try{jsonpatch[_0x1044('0x26')](_0x262402,_0x135a74,!![]);}catch(_0x3e5ba5){return BPromise[_0x1044('0x27')](_0x3e5ba5);}return _0x262402[_0x1044('0x28')]();};}function saveUpdates(_0x1e81c5,_0x1bb5a9){return function(_0x3dfb6d){if(_0x3dfb6d){return _0x3dfb6d[_0x1044('0x29')](_0x1e81c5)[_0x1044('0x2a')](function(_0x489645){return _0x489645;});}return null;};}function removeEntity(_0x41cccc,_0x53b7ee){return function(_0x4294a0){if(_0x4294a0){return _0x4294a0[_0x1044('0x2b')]()['then'](function(){_0x41cccc[_0x1044('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b5e3,_0x5d0035){return function(_0x2d7c34){if(!_0x2d7c34){_0x3b5e3['sendStatus'](0x194);}return _0x2d7c34;};}function handleError(_0xba4699,_0xb1c1d3){_0xb1c1d3=_0xb1c1d3||0x1f4;return function(_0x28f90b){logger['error'](_0x28f90b[_0x1044('0x2c')]);if(_0x28f90b['name']){delete _0x28f90b[_0x1044('0x2d')];}_0xba4699[_0x1044('0x1d')](_0xb1c1d3)[_0x1044('0x2e')](_0x28f90b);};}exports[_0x1044('0x2f')]=function(_0x56e754,_0x3949a7){var _0x41b432={},_0x880eb0={},_0x13b9c5={'count':0x0,'rows':[]};var _0x3c3eb3=_['map'](db[_0x1044('0x30')][_0x1044('0x31')],function(_0x368487){return{'name':_0x368487[_0x1044('0x32')],'type':_0x368487['type']['key']};});_0x880eb0['model']=_[_0x1044('0x33')](_0x3c3eb3,_0x1044('0x2d'));_0x880eb0[_0x1044('0x34')]=_[_0x1044('0x35')](_0x56e754[_0x1044('0x34')]);_0x880eb0[_0x1044('0x36')]=_[_0x1044('0x37')](_0x880eb0[_0x1044('0x38')],_0x880eb0[_0x1044('0x34')]);_0x41b432[_0x1044('0x39')]=_[_0x1044('0x37')](_0x880eb0['model'],qs['fields'](_0x56e754[_0x1044('0x34')][_0x1044('0x3a')]));_0x41b432[_0x1044('0x39')]=_0x41b432[_0x1044('0x39')][_0x1044('0x3b')]?_0x41b432[_0x1044('0x39')]:_0x880eb0['model'];if(!_0x56e754[_0x1044('0x34')]['hasOwnProperty'](_0x1044('0x3c'))){_0x41b432[_0x1044('0x23')]=qs[_0x1044('0x23')](_0x56e754[_0x1044('0x34')][_0x1044('0x23')]);_0x41b432[_0x1044('0x22')]=qs['offset'](_0x56e754['query'][_0x1044('0x22')]);}_0x41b432[_0x1044('0x3d')]=qs[_0x1044('0x3e')](_0x56e754[_0x1044('0x34')][_0x1044('0x3e')]);_0x41b432[_0x1044('0x3f')]=qs['filters'](_['pick'](_0x56e754['query'],_0x880eb0[_0x1044('0x36')]),_0x3c3eb3);if(_0x56e754[_0x1044('0x34')][_0x1044('0x40')]){_0x41b432[_0x1044('0x3f')]=_['merge'](_0x41b432[_0x1044('0x3f')],{'$or':_['map'](_0x3c3eb3,function(_0x4be5f1){if(_0x4be5f1[_0x1044('0x41')]!==_0x1044('0x42')){var _0xcca54b={};_0xcca54b[_0x4be5f1[_0x1044('0x2d')]]={'$like':'%'+_0x56e754[_0x1044('0x34')][_0x1044('0x40')]+'%'};return _0xcca54b;}})});}_0x41b432=_['merge']({},_0x41b432,_0x56e754['options']);var _0x131eab={'where':_0x41b432['where']};return db['SalesforceConfiguration']['count'](_0x131eab)[_0x1044('0x2a')](function(_0x1bf974){_0x13b9c5[_0x1044('0x21')]=_0x1bf974;if(_0x56e754[_0x1044('0x34')][_0x1044('0x43')]){_0x41b432['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x1044('0x44')](_0x41b432);})[_0x1044('0x2a')](function(_0x24e6d6){_0x13b9c5[_0x1044('0x45')]=_0x24e6d6;return _0x13b9c5;})[_0x1044('0x2a')](respondWithFilteredResult(_0x3949a7,_0x41b432))['catch'](handleError(_0x3949a7,null));};exports[_0x1044('0x46')]=function(_0x36b98c,_0xf1a0f2){var _0x46d3f3={'raw':![],'where':{'id':_0x36b98c[_0x1044('0x47')]['id']}},_0xa34b64={};_0xa34b64[_0x1044('0x38')]=_[_0x1044('0x35')](db[_0x1044('0x30')][_0x1044('0x31')]);_0xa34b64['query']=_[_0x1044('0x35')](_0x36b98c['query']);_0xa34b64[_0x1044('0x36')]=_[_0x1044('0x37')](_0xa34b64['model'],_0xa34b64[_0x1044('0x34')]);_0x46d3f3[_0x1044('0x39')]=_[_0x1044('0x37')](_0xa34b64['model'],qs['fields'](_0x36b98c[_0x1044('0x34')][_0x1044('0x3a')]));_0x46d3f3['attributes']=_0x46d3f3[_0x1044('0x39')]['length']?_0x46d3f3[_0x1044('0x39')]:_0xa34b64[_0x1044('0x38')];if(_0x36b98c[_0x1044('0x34')][_0x1044('0x43')]){_0x46d3f3['include']=[{'all':!![]}];}_0x46d3f3=_['merge']({},_0x46d3f3,_0x36b98c[_0x1044('0x48')]);return db[_0x1044('0x30')][_0x1044('0x49')](_0x46d3f3)[_0x1044('0x2a')](handleEntityNotFound(_0xf1a0f2,null))[_0x1044('0x2a')](respondWithResult(_0xf1a0f2,null))['catch'](handleError(_0xf1a0f2,null));};exports['create']=function(_0x54a110,_0x2dbb7f){return db['SalesforceConfiguration'][_0x1044('0x4a')](_0x54a110[_0x1044('0x4b')],{})['then'](respondWithResult(_0x2dbb7f,0xc9))[_0x1044('0x4c')](handleError(_0x2dbb7f,null));};exports['update']=function(_0x1bdacb,_0x34672c){if(_0x1bdacb[_0x1044('0x4b')]['id']){delete _0x1bdacb[_0x1044('0x4b')]['id'];}return db[_0x1044('0x30')][_0x1044('0x49')]({'where':{'id':_0x1bdacb[_0x1044('0x47')]['id']}})[_0x1044('0x2a')](handleEntityNotFound(_0x34672c,null))[_0x1044('0x2a')](saveUpdates(_0x1bdacb[_0x1044('0x4b')],null))['then'](respondWithResult(_0x34672c,null))['catch'](handleError(_0x34672c,null));};exports[_0x1044('0x2b')]=function(_0x323c2e,_0x290ce3){return db['SalesforceConfiguration']['find']({'where':{'id':_0x323c2e[_0x1044('0x47')]['id']}})['then'](handleEntityNotFound(_0x290ce3,null))['then'](removeEntity(_0x290ce3,null))[_0x1044('0x4c')](handleError(_0x290ce3,null));};exports[_0x1044('0x4d')]=function(_0x1f5e33,_0x599ccb,_0x3074bb){var _0xbced45={};var _0x88a193={};var _0x21db77;var _0x437b89;return db[_0x1044('0x30')]['findOne']({'where':{'id':_0x1f5e33[_0x1044('0x47')]['id']}})[_0x1044('0x2a')](handleEntityNotFound(_0x599ccb,null))[_0x1044('0x2a')](function(_0x132eb8){if(_0x132eb8){_0x21db77=_0x132eb8;_0x88a193['model']=_[_0x1044('0x35')](db[_0x1044('0x4e')][_0x1044('0x31')]);_0x88a193[_0x1044('0x34')]=_[_0x1044('0x35')](_0x1f5e33['query']);_0x88a193['filters']=_['intersection'](_0x88a193[_0x1044('0x38')],_0x88a193[_0x1044('0x34')]);_0xbced45['attributes']=_[_0x1044('0x37')](_0x88a193[_0x1044('0x38')],qs[_0x1044('0x3a')](_0x1f5e33[_0x1044('0x34')]['fields']));_0xbced45[_0x1044('0x39')]=_0xbced45['attributes'][_0x1044('0x3b')]?_0xbced45[_0x1044('0x39')]:_0x88a193[_0x1044('0x38')];_0xbced45['order']=qs[_0x1044('0x3e')](_0x1f5e33['query']['sort']);_0xbced45[_0x1044('0x3f')]=qs['filters'](_['pick'](_0x1f5e33[_0x1044('0x34')],_0x88a193[_0x1044('0x36')]));if(_0x1f5e33['query']['filter']){_0xbced45[_0x1044('0x3f')]=_[_0x1044('0x4f')](_0xbced45[_0x1044('0x3f')],{'$or':_[_0x1044('0x33')](_0xbced45['attributes'],function(_0x215bf5){var _0x49d303={};_0x49d303[_0x215bf5]={'$like':'%'+_0x1f5e33[_0x1044('0x34')][_0x1044('0x40')]+'%'};return _0x49d303;})});}_0xbced45=_[_0x1044('0x4f')]({},_0xbced45,_0x1f5e33[_0x1044('0x48')]);return _0x21db77[_0x1044('0x4d')](_0xbced45);}})[_0x1044('0x2a')](function(_0x2cb9e4){if(_0x2cb9e4){_0x437b89=_0x2cb9e4[_0x1044('0x3b')];if(!_0x1f5e33[_0x1044('0x34')]['hasOwnProperty'](_0x1044('0x3c'))){_0xbced45[_0x1044('0x23')]=qs[_0x1044('0x23')](_0x1f5e33[_0x1044('0x34')][_0x1044('0x23')]);_0xbced45[_0x1044('0x22')]=qs['offset'](_0x1f5e33[_0x1044('0x34')][_0x1044('0x22')]);}return _0x21db77['getFields'](_0xbced45);}})['then'](function(_0x31b206){if(_0x31b206){return _0x31b206?{'count':_0x437b89,'rows':_0x31b206}:null;}})[_0x1044('0x2a')](respondWithResult(_0x599ccb,null))[_0x1044('0x4c')](handleError(_0x599ccb,null));};exports['getSubjects']=function(_0xaee93b,_0x38eb67,_0x441902){var _0x4c795c={};var _0x7a8def={};var _0x2a5fd0;var _0x107bd0;return db[_0x1044('0x30')][_0x1044('0x50')]({'where':{'id':_0xaee93b[_0x1044('0x47')]['id']}})[_0x1044('0x2a')](handleEntityNotFound(_0x38eb67,null))['then'](function(_0x5b3e3a){if(_0x5b3e3a){_0x2a5fd0=_0x5b3e3a;_0x7a8def['model']=_[_0x1044('0x35')](db[_0x1044('0x4e')][_0x1044('0x31')]);_0x7a8def[_0x1044('0x34')]=_[_0x1044('0x35')](_0xaee93b[_0x1044('0x34')]);_0x7a8def[_0x1044('0x36')]=_[_0x1044('0x37')](_0x7a8def[_0x1044('0x38')],_0x7a8def[_0x1044('0x34')]);_0x4c795c[_0x1044('0x39')]=_[_0x1044('0x37')](_0x7a8def[_0x1044('0x38')],qs[_0x1044('0x3a')](_0xaee93b[_0x1044('0x34')][_0x1044('0x3a')]));_0x4c795c[_0x1044('0x39')]=_0x4c795c[_0x1044('0x39')][_0x1044('0x3b')]?_0x4c795c[_0x1044('0x39')]:_0x7a8def[_0x1044('0x38')];_0x4c795c[_0x1044('0x3d')]=qs[_0x1044('0x3e')](_0xaee93b[_0x1044('0x34')]['sort']);_0x4c795c[_0x1044('0x3f')]=qs[_0x1044('0x36')](_[_0x1044('0x51')](_0xaee93b[_0x1044('0x34')],_0x7a8def[_0x1044('0x36')]));if(_0xaee93b[_0x1044('0x34')][_0x1044('0x40')]){_0x4c795c['where']=_[_0x1044('0x4f')](_0x4c795c['where'],{'$or':_['map'](_0x4c795c[_0x1044('0x39')],function(_0x13375f){var _0x3c7dd5={};_0x3c7dd5[_0x13375f]={'$like':'%'+_0xaee93b[_0x1044('0x34')][_0x1044('0x40')]+'%'};return _0x3c7dd5;})});}_0x4c795c=_[_0x1044('0x4f')]({},_0x4c795c,_0xaee93b[_0x1044('0x48')]);return _0x2a5fd0[_0x1044('0x52')](_0x4c795c);}})['then'](function(_0x11a975){if(_0x11a975){_0x107bd0=_0x11a975[_0x1044('0x3b')];if(!_0xaee93b[_0x1044('0x34')]['hasOwnProperty'](_0x1044('0x3c'))){_0x4c795c[_0x1044('0x23')]=qs[_0x1044('0x23')](_0xaee93b[_0x1044('0x34')]['limit']);_0x4c795c['offset']=qs['offset'](_0xaee93b[_0x1044('0x34')][_0x1044('0x22')]);}return _0x2a5fd0[_0x1044('0x52')](_0x4c795c);}})[_0x1044('0x2a')](function(_0x2dfa61){if(_0x2dfa61){return _0x2dfa61?{'count':_0x107bd0,'rows':_0x2dfa61}:null;}})['then'](respondWithResult(_0x38eb67,null))[_0x1044('0x4c')](handleError(_0x38eb67,null));};exports['getDescriptions']=function(_0x58124b,_0x5db35b,_0x29acdd){var _0x5671bb={};var _0x308943={};var _0x4464fd;var _0x4692a4;return db[_0x1044('0x30')][_0x1044('0x50')]({'where':{'id':_0x58124b[_0x1044('0x47')]['id']}})[_0x1044('0x2a')](handleEntityNotFound(_0x5db35b,null))[_0x1044('0x2a')](function(_0x4adee5){if(_0x4adee5){_0x4464fd=_0x4adee5;_0x308943['model']=_[_0x1044('0x35')](db[_0x1044('0x4e')][_0x1044('0x31')]);_0x308943[_0x1044('0x34')]=_[_0x1044('0x35')](_0x58124b[_0x1044('0x34')]);_0x308943['filters']=_[_0x1044('0x37')](_0x308943[_0x1044('0x38')],_0x308943[_0x1044('0x34')]);_0x5671bb[_0x1044('0x39')]=_['intersection'](_0x308943['model'],qs[_0x1044('0x3a')](_0x58124b[_0x1044('0x34')][_0x1044('0x3a')]));_0x5671bb['attributes']=_0x5671bb[_0x1044('0x39')][_0x1044('0x3b')]?_0x5671bb[_0x1044('0x39')]:_0x308943[_0x1044('0x38')];_0x5671bb[_0x1044('0x3d')]=qs[_0x1044('0x3e')](_0x58124b[_0x1044('0x34')][_0x1044('0x3e')]);_0x5671bb[_0x1044('0x3f')]=qs[_0x1044('0x36')](_[_0x1044('0x51')](_0x58124b['query'],_0x308943[_0x1044('0x36')]));if(_0x58124b[_0x1044('0x34')]['filter']){_0x5671bb['where']=_['merge'](_0x5671bb[_0x1044('0x3f')],{'$or':_[_0x1044('0x33')](_0x5671bb['attributes'],function(_0x3102f3){var _0x5d7223={};_0x5d7223[_0x3102f3]={'$like':'%'+_0x58124b['query']['filter']+'%'};return _0x5d7223;})});}_0x5671bb=_[_0x1044('0x4f')]({},_0x5671bb,_0x58124b[_0x1044('0x48')]);return _0x4464fd[_0x1044('0x53')](_0x5671bb);}})[_0x1044('0x2a')](function(_0x393b87){if(_0x393b87){_0x4692a4=_0x393b87[_0x1044('0x3b')];if(!_0x58124b['query'][_0x1044('0x54')](_0x1044('0x3c'))){_0x5671bb[_0x1044('0x23')]=qs[_0x1044('0x23')](_0x58124b['query'][_0x1044('0x23')]);_0x5671bb['offset']=qs['offset'](_0x58124b[_0x1044('0x34')][_0x1044('0x22')]);}return _0x4464fd[_0x1044('0x53')](_0x5671bb);}})[_0x1044('0x2a')](function(_0x31480b){if(_0x31480b){return _0x31480b?{'count':_0x4692a4,'rows':_0x31480b}:null;}})[_0x1044('0x2a')](respondWithResult(_0x5db35b,null))[_0x1044('0x4c')](handleError(_0x5db35b,null));}; \ No newline at end of file +var _0xf977=['filter','merge','options','includeAll','include','findAll','rows','params','catch','create','body','find','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf977,0x161));var _0x7f97=function(_0x51bcd1,_0x59c0e3){_0x51bcd1=_0x51bcd1-0x0;var _0x4b08bc=_0xf977[_0x51bcd1];return _0x4b08bc;};'use strict';var emlformat=require(_0x7f97('0x0'));var rimraf=require(_0x7f97('0x1'));var zipdir=require(_0x7f97('0x2'));var jsonpatch=require(_0x7f97('0x3'));var rp=require(_0x7f97('0x4'));var moment=require(_0x7f97('0x5'));var BPromise=require(_0x7f97('0x6'));var Mustache=require(_0x7f97('0x7'));var util=require(_0x7f97('0x8'));var path=require(_0x7f97('0x9'));var sox=require(_0x7f97('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f97('0xb'));var squel=require('squel');var crypto=require(_0x7f97('0xc'));var jsforce=require(_0x7f97('0xd'));var deskjs=require(_0x7f97('0xe'));var toCsv=require(_0x7f97('0xf'));var querystring=require(_0x7f97('0x10'));var Papa=require('papaparse');var Redis=require(_0x7f97('0x11'));var authService=require(_0x7f97('0x12'));var qs=require(_0x7f97('0x13'));var as=require(_0x7f97('0x14'));var hardwareService=require(_0x7f97('0x15'));var logger=require('../../config/logger')(_0x7f97('0x16'));var utils=require(_0x7f97('0x17'));var config=require(_0x7f97('0x18'));var licenseUtil=require(_0x7f97('0x19'));var db=require(_0x7f97('0x1a'))['db'];function respondWithStatusCode(_0x58305c,_0x14d25d){_0x14d25d=_0x14d25d||0xcc;return function(_0x20386f){if(_0x20386f){return _0x58305c[_0x7f97('0x1b')](_0x14d25d);}return _0x58305c[_0x7f97('0x1c')](_0x14d25d)[_0x7f97('0x1d')]();};}function respondWithResult(_0x286293,_0x72e7ba){_0x72e7ba=_0x72e7ba||0xc8;return function(_0x854b08){if(_0x854b08){return _0x286293['status'](_0x72e7ba)[_0x7f97('0x1e')](_0x854b08);}};}function respondWithFilteredResult(_0x851c19,_0x101206){return function(_0x1201ee){if(_0x1201ee){var _0x1ebd13=typeof _0x101206['offset']==='undefined'&&typeof _0x101206[_0x7f97('0x1f')]===_0x7f97('0x20');var _0xde56a0=_0x1201ee[_0x7f97('0x21')];var _0x54d1b8=_0x1ebd13?0x0:_0x101206['offset'];var _0x353065=_0x1ebd13?_0x1201ee[_0x7f97('0x21')]:_0x101206[_0x7f97('0x22')]+_0x101206[_0x7f97('0x1f')];var _0x130973;if(_0x353065>=_0xde56a0){_0x353065=_0xde56a0;_0x130973=0xc8;}else{_0x130973=0xce;}_0x851c19[_0x7f97('0x1c')](_0x130973);return _0x851c19[_0x7f97('0x23')](_0x7f97('0x24'),_0x54d1b8+'-'+_0x353065+'/'+_0xde56a0)[_0x7f97('0x1e')](_0x1201ee);}return null;};}function patchUpdates(_0x37dcac){return function(_0x53e2cc){try{jsonpatch[_0x7f97('0x25')](_0x53e2cc,_0x37dcac,!![]);}catch(_0x44e7eb){return BPromise[_0x7f97('0x26')](_0x44e7eb);}return _0x53e2cc['save']();};}function saveUpdates(_0x1a5f6b,_0x1b645a){return function(_0x282a4c){if(_0x282a4c){return _0x282a4c[_0x7f97('0x27')](_0x1a5f6b)[_0x7f97('0x28')](function(_0x14f793){return _0x14f793;});}return null;};}function removeEntity(_0x24f475,_0x594048){return function(_0x223be2){if(_0x223be2){return _0x223be2[_0x7f97('0x29')]()[_0x7f97('0x28')](function(){_0x24f475[_0x7f97('0x1c')](0xcc)[_0x7f97('0x1d')]();});}};}function handleEntityNotFound(_0x4eade7,_0x15e1e0){return function(_0x1a7f43){if(!_0x1a7f43){_0x4eade7[_0x7f97('0x1b')](0x194);}return _0x1a7f43;};}function handleError(_0x23c804,_0x1eadaa){_0x1eadaa=_0x1eadaa||0x1f4;return function(_0x2f588c){logger[_0x7f97('0x2a')](_0x2f588c[_0x7f97('0x2b')]);if(_0x2f588c[_0x7f97('0x2c')]){delete _0x2f588c[_0x7f97('0x2c')];}_0x23c804[_0x7f97('0x1c')](_0x1eadaa)[_0x7f97('0x2d')](_0x2f588c);};}exports[_0x7f97('0x2e')]=function(_0xe9787d,_0x473aec){var _0xf6cdf2={},_0x1f3d7a={},_0x13c5f3={'count':0x0,'rows':[]};var _0x453f2a=_[_0x7f97('0x2f')](db[_0x7f97('0x30')][_0x7f97('0x31')],function(_0x56dd07){return{'name':_0x56dd07[_0x7f97('0x32')],'type':_0x56dd07[_0x7f97('0x33')][_0x7f97('0x34')]};});_0x1f3d7a[_0x7f97('0x35')]=_[_0x7f97('0x2f')](_0x453f2a,_0x7f97('0x2c'));_0x1f3d7a['query']=_[_0x7f97('0x36')](_0xe9787d[_0x7f97('0x37')]);_0x1f3d7a[_0x7f97('0x38')]=_[_0x7f97('0x39')](_0x1f3d7a[_0x7f97('0x35')],_0x1f3d7a[_0x7f97('0x37')]);_0xf6cdf2[_0x7f97('0x3a')]=_['intersection'](_0x1f3d7a[_0x7f97('0x35')],qs['fields'](_0xe9787d[_0x7f97('0x37')][_0x7f97('0x3b')]));_0xf6cdf2[_0x7f97('0x3a')]=_0xf6cdf2['attributes'][_0x7f97('0x3c')]?_0xf6cdf2[_0x7f97('0x3a')]:_0x1f3d7a['model'];if(!_0xe9787d[_0x7f97('0x37')][_0x7f97('0x3d')](_0x7f97('0x3e'))){_0xf6cdf2[_0x7f97('0x1f')]=qs[_0x7f97('0x1f')](_0xe9787d[_0x7f97('0x37')][_0x7f97('0x1f')]);_0xf6cdf2[_0x7f97('0x22')]=qs[_0x7f97('0x22')](_0xe9787d['query'][_0x7f97('0x22')]);}_0xf6cdf2[_0x7f97('0x3f')]=qs[_0x7f97('0x40')](_0xe9787d[_0x7f97('0x37')][_0x7f97('0x40')]);_0xf6cdf2[_0x7f97('0x41')]=qs[_0x7f97('0x38')](_[_0x7f97('0x42')](_0xe9787d[_0x7f97('0x37')],_0x1f3d7a[_0x7f97('0x38')]),_0x453f2a);if(_0xe9787d[_0x7f97('0x37')][_0x7f97('0x43')]){_0xf6cdf2[_0x7f97('0x41')]=_[_0x7f97('0x44')](_0xf6cdf2[_0x7f97('0x41')],{'$or':_[_0x7f97('0x2f')](_0x453f2a,function(_0x543afb){if(_0x543afb['type']!=='VIRTUAL'){var _0x25047d={};_0x25047d[_0x543afb[_0x7f97('0x2c')]]={'$like':'%'+_0xe9787d[_0x7f97('0x37')][_0x7f97('0x43')]+'%'};return _0x25047d;}})});}_0xf6cdf2=_[_0x7f97('0x44')]({},_0xf6cdf2,_0xe9787d[_0x7f97('0x45')]);var _0x4dead3={'where':_0xf6cdf2[_0x7f97('0x41')]};return db[_0x7f97('0x30')][_0x7f97('0x21')](_0x4dead3)[_0x7f97('0x28')](function(_0x31e746){_0x13c5f3['count']=_0x31e746;if(_0xe9787d[_0x7f97('0x37')][_0x7f97('0x46')]){_0xf6cdf2[_0x7f97('0x47')]=[{'all':!![]}];}return db[_0x7f97('0x30')][_0x7f97('0x48')](_0xf6cdf2);})['then'](function(_0x4a870f){_0x13c5f3[_0x7f97('0x49')]=_0x4a870f;return _0x13c5f3;})[_0x7f97('0x28')](respondWithFilteredResult(_0x473aec,_0xf6cdf2))['catch'](handleError(_0x473aec,null));};exports['show']=function(_0x2d03ca,_0x172406){var _0x319390={'raw':![],'where':{'id':_0x2d03ca[_0x7f97('0x4a')]['id']}},_0x204248={};_0x204248[_0x7f97('0x35')]=_[_0x7f97('0x36')](db[_0x7f97('0x30')][_0x7f97('0x31')]);_0x204248[_0x7f97('0x37')]=_[_0x7f97('0x36')](_0x2d03ca['query']);_0x204248['filters']=_[_0x7f97('0x39')](_0x204248[_0x7f97('0x35')],_0x204248[_0x7f97('0x37')]);_0x319390[_0x7f97('0x3a')]=_[_0x7f97('0x39')](_0x204248['model'],qs[_0x7f97('0x3b')](_0x2d03ca[_0x7f97('0x37')][_0x7f97('0x3b')]));_0x319390[_0x7f97('0x3a')]=_0x319390[_0x7f97('0x3a')][_0x7f97('0x3c')]?_0x319390[_0x7f97('0x3a')]:_0x204248[_0x7f97('0x35')];if(_0x2d03ca[_0x7f97('0x37')][_0x7f97('0x46')]){_0x319390[_0x7f97('0x47')]=[{'all':!![]}];}_0x319390=_['merge']({},_0x319390,_0x2d03ca[_0x7f97('0x45')]);return db['SalesforceConfiguration']['find'](_0x319390)[_0x7f97('0x28')](handleEntityNotFound(_0x172406,null))[_0x7f97('0x28')](respondWithResult(_0x172406,null))[_0x7f97('0x4b')](handleError(_0x172406,null));};exports[_0x7f97('0x4c')]=function(_0x170e2f,_0x5cccc9){return db['SalesforceConfiguration'][_0x7f97('0x4c')](_0x170e2f[_0x7f97('0x4d')],{})['then'](respondWithResult(_0x5cccc9,0xc9))['catch'](handleError(_0x5cccc9,null));};exports[_0x7f97('0x27')]=function(_0xf5a00b,_0x49d47a){if(_0xf5a00b[_0x7f97('0x4d')]['id']){delete _0xf5a00b['body']['id'];}return db['SalesforceConfiguration'][_0x7f97('0x4e')]({'where':{'id':_0xf5a00b['params']['id']}})['then'](handleEntityNotFound(_0x49d47a,null))[_0x7f97('0x28')](saveUpdates(_0xf5a00b[_0x7f97('0x4d')],null))[_0x7f97('0x28')](respondWithResult(_0x49d47a,null))['catch'](handleError(_0x49d47a,null));};exports['destroy']=function(_0x3aa799,_0x29230a){return db['SalesforceConfiguration']['find']({'where':{'id':_0x3aa799[_0x7f97('0x4a')]['id']}})[_0x7f97('0x28')](handleEntityNotFound(_0x29230a,null))[_0x7f97('0x28')](removeEntity(_0x29230a,null))[_0x7f97('0x4b')](handleError(_0x29230a,null));};exports['getFields']=function(_0x45c635,_0x233b45,_0x256c1b){var _0x3b00d5={};var _0x1d195b={};var _0x749f30;var _0x4b0fff;return db['SalesforceConfiguration'][_0x7f97('0x4f')]({'where':{'id':_0x45c635[_0x7f97('0x4a')]['id']}})['then'](handleEntityNotFound(_0x233b45,null))[_0x7f97('0x28')](function(_0x47ccbb){if(_0x47ccbb){_0x749f30=_0x47ccbb;_0x1d195b[_0x7f97('0x35')]=_[_0x7f97('0x36')](db[_0x7f97('0x50')][_0x7f97('0x31')]);_0x1d195b[_0x7f97('0x37')]=_['keys'](_0x45c635[_0x7f97('0x37')]);_0x1d195b[_0x7f97('0x38')]=_[_0x7f97('0x39')](_0x1d195b[_0x7f97('0x35')],_0x1d195b[_0x7f97('0x37')]);_0x3b00d5['attributes']=_[_0x7f97('0x39')](_0x1d195b['model'],qs['fields'](_0x45c635['query'][_0x7f97('0x3b')]));_0x3b00d5['attributes']=_0x3b00d5[_0x7f97('0x3a')][_0x7f97('0x3c')]?_0x3b00d5[_0x7f97('0x3a')]:_0x1d195b['model'];_0x3b00d5[_0x7f97('0x3f')]=qs['sort'](_0x45c635['query'][_0x7f97('0x40')]);_0x3b00d5[_0x7f97('0x41')]=qs['filters'](_[_0x7f97('0x42')](_0x45c635[_0x7f97('0x37')],_0x1d195b[_0x7f97('0x38')]));if(_0x45c635[_0x7f97('0x37')][_0x7f97('0x43')]){_0x3b00d5['where']=_[_0x7f97('0x44')](_0x3b00d5[_0x7f97('0x41')],{'$or':_[_0x7f97('0x2f')](_0x3b00d5[_0x7f97('0x3a')],function(_0x3b3657){var _0x2170f2={};_0x2170f2[_0x3b3657]={'$like':'%'+_0x45c635[_0x7f97('0x37')][_0x7f97('0x43')]+'%'};return _0x2170f2;})});}_0x3b00d5=_[_0x7f97('0x44')]({},_0x3b00d5,_0x45c635['options']);return _0x749f30[_0x7f97('0x51')](_0x3b00d5);}})[_0x7f97('0x28')](function(_0x4c9330){if(_0x4c9330){_0x4b0fff=_0x4c9330[_0x7f97('0x3c')];if(!_0x45c635[_0x7f97('0x37')]['hasOwnProperty'](_0x7f97('0x3e'))){_0x3b00d5['limit']=qs[_0x7f97('0x1f')](_0x45c635[_0x7f97('0x37')][_0x7f97('0x1f')]);_0x3b00d5['offset']=qs[_0x7f97('0x22')](_0x45c635[_0x7f97('0x37')][_0x7f97('0x22')]);}return _0x749f30['getFields'](_0x3b00d5);}})[_0x7f97('0x28')](function(_0x325130){if(_0x325130){return _0x325130?{'count':_0x4b0fff,'rows':_0x325130}:null;}})[_0x7f97('0x28')](respondWithResult(_0x233b45,null))[_0x7f97('0x4b')](handleError(_0x233b45,null));};exports[_0x7f97('0x52')]=function(_0x1b4fc3,_0x365e03,_0x2dc24d){var _0x84e9c2={};var _0x1c7b81={};var _0x589596;var _0x13d43d;return db[_0x7f97('0x30')][_0x7f97('0x4f')]({'where':{'id':_0x1b4fc3[_0x7f97('0x4a')]['id']}})['then'](handleEntityNotFound(_0x365e03,null))[_0x7f97('0x28')](function(_0x2050d8){if(_0x2050d8){_0x589596=_0x2050d8;_0x1c7b81[_0x7f97('0x35')]=_[_0x7f97('0x36')](db[_0x7f97('0x50')][_0x7f97('0x31')]);_0x1c7b81[_0x7f97('0x37')]=_['keys'](_0x1b4fc3[_0x7f97('0x37')]);_0x1c7b81[_0x7f97('0x38')]=_[_0x7f97('0x39')](_0x1c7b81[_0x7f97('0x35')],_0x1c7b81[_0x7f97('0x37')]);_0x84e9c2[_0x7f97('0x3a')]=_[_0x7f97('0x39')](_0x1c7b81[_0x7f97('0x35')],qs['fields'](_0x1b4fc3['query']['fields']));_0x84e9c2[_0x7f97('0x3a')]=_0x84e9c2['attributes']['length']?_0x84e9c2[_0x7f97('0x3a')]:_0x1c7b81[_0x7f97('0x35')];_0x84e9c2[_0x7f97('0x3f')]=qs['sort'](_0x1b4fc3['query'][_0x7f97('0x40')]);_0x84e9c2[_0x7f97('0x41')]=qs['filters'](_[_0x7f97('0x42')](_0x1b4fc3[_0x7f97('0x37')],_0x1c7b81[_0x7f97('0x38')]));if(_0x1b4fc3[_0x7f97('0x37')][_0x7f97('0x43')]){_0x84e9c2[_0x7f97('0x41')]=_[_0x7f97('0x44')](_0x84e9c2['where'],{'$or':_[_0x7f97('0x2f')](_0x84e9c2[_0x7f97('0x3a')],function(_0x4f5c40){var _0x29d887={};_0x29d887[_0x4f5c40]={'$like':'%'+_0x1b4fc3[_0x7f97('0x37')][_0x7f97('0x43')]+'%'};return _0x29d887;})});}_0x84e9c2=_['merge']({},_0x84e9c2,_0x1b4fc3[_0x7f97('0x45')]);return _0x589596[_0x7f97('0x52')](_0x84e9c2);}})[_0x7f97('0x28')](function(_0x4bd775){if(_0x4bd775){_0x13d43d=_0x4bd775['length'];if(!_0x1b4fc3['query'][_0x7f97('0x3d')](_0x7f97('0x3e'))){_0x84e9c2[_0x7f97('0x1f')]=qs[_0x7f97('0x1f')](_0x1b4fc3[_0x7f97('0x37')][_0x7f97('0x1f')]);_0x84e9c2[_0x7f97('0x22')]=qs[_0x7f97('0x22')](_0x1b4fc3[_0x7f97('0x37')][_0x7f97('0x22')]);}return _0x589596[_0x7f97('0x52')](_0x84e9c2);}})[_0x7f97('0x28')](function(_0x5cac21){if(_0x5cac21){return _0x5cac21?{'count':_0x13d43d,'rows':_0x5cac21}:null;}})[_0x7f97('0x28')](respondWithResult(_0x365e03,null))[_0x7f97('0x4b')](handleError(_0x365e03,null));};exports[_0x7f97('0x53')]=function(_0x158385,_0x3b3204,_0x785f76){var _0x22eddc={};var _0x132e9f={};var _0x4ad550;var _0x5d2bef;return db[_0x7f97('0x30')][_0x7f97('0x4f')]({'where':{'id':_0x158385[_0x7f97('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b3204,null))[_0x7f97('0x28')](function(_0xf70717){if(_0xf70717){_0x4ad550=_0xf70717;_0x132e9f['model']=_['keys'](db[_0x7f97('0x50')][_0x7f97('0x31')]);_0x132e9f[_0x7f97('0x37')]=_[_0x7f97('0x36')](_0x158385[_0x7f97('0x37')]);_0x132e9f['filters']=_[_0x7f97('0x39')](_0x132e9f[_0x7f97('0x35')],_0x132e9f[_0x7f97('0x37')]);_0x22eddc[_0x7f97('0x3a')]=_[_0x7f97('0x39')](_0x132e9f[_0x7f97('0x35')],qs[_0x7f97('0x3b')](_0x158385['query'][_0x7f97('0x3b')]));_0x22eddc[_0x7f97('0x3a')]=_0x22eddc['attributes'][_0x7f97('0x3c')]?_0x22eddc[_0x7f97('0x3a')]:_0x132e9f[_0x7f97('0x35')];_0x22eddc[_0x7f97('0x3f')]=qs[_0x7f97('0x40')](_0x158385[_0x7f97('0x37')]['sort']);_0x22eddc[_0x7f97('0x41')]=qs[_0x7f97('0x38')](_[_0x7f97('0x42')](_0x158385[_0x7f97('0x37')],_0x132e9f[_0x7f97('0x38')]));if(_0x158385[_0x7f97('0x37')]['filter']){_0x22eddc[_0x7f97('0x41')]=_[_0x7f97('0x44')](_0x22eddc['where'],{'$or':_[_0x7f97('0x2f')](_0x22eddc[_0x7f97('0x3a')],function(_0x12be15){var _0x3dc832={};_0x3dc832[_0x12be15]={'$like':'%'+_0x158385[_0x7f97('0x37')][_0x7f97('0x43')]+'%'};return _0x3dc832;})});}_0x22eddc=_[_0x7f97('0x44')]({},_0x22eddc,_0x158385[_0x7f97('0x45')]);return _0x4ad550[_0x7f97('0x53')](_0x22eddc);}})[_0x7f97('0x28')](function(_0x17ab95){if(_0x17ab95){_0x5d2bef=_0x17ab95['length'];if(!_0x158385[_0x7f97('0x37')][_0x7f97('0x3d')](_0x7f97('0x3e'))){_0x22eddc[_0x7f97('0x1f')]=qs[_0x7f97('0x1f')](_0x158385[_0x7f97('0x37')][_0x7f97('0x1f')]);_0x22eddc[_0x7f97('0x22')]=qs[_0x7f97('0x22')](_0x158385[_0x7f97('0x37')][_0x7f97('0x22')]);}return _0x4ad550[_0x7f97('0x53')](_0x22eddc);}})['then'](function(_0x19ed4b){if(_0x19ed4b){return _0x19ed4b?{'count':_0x5d2bef,'rows':_0x19ed4b}:null;}})[_0x7f97('0x28')](respondWithResult(_0x3b3204,null))[_0x7f97('0x4b')](handleError(_0x3b3204,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 60a8059..64637ba 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 _0x4481=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intSalesforceConfiguration.attributes'];(function(_0x539eba,_0x30a5ee){var _0x437dc9=function(_0x524970){while(--_0x524970){_0x539eba['push'](_0x539eba['shift']());}};_0x437dc9(++_0x30a5ee);}(_0x4481,0x1c4));var _0x1448=function(_0x52d0d7,_0x106cf2){_0x52d0d7=_0x52d0d7-0x0;var _0x4c4b28=_0x4481[_0x52d0d7];return _0x4c4b28;};'use strict';var _=require(_0x1448('0x0'));var util=require(_0x1448('0x1'));var logger=require(_0x1448('0x2'))(_0x1448('0x3'));var moment=require(_0x1448('0x4'));var BPromise=require(_0x1448('0x5'));var rp=require(_0x1448('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1448('0x7'));module['exports']=function(_0x3ca35c,_0x476a25){return _0x3ca35c['define'](_0x1448('0x8'),attributes,{'tableName':_0x1448('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacc7=['int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xacc7,0xf1));var _0x7acc=function(_0x5a2291,_0x3ddda7){_0x5a2291=_0x5a2291-0x0;var _0x10e3f5=_0xacc7[_0x5a2291];return _0x10e3f5;};'use strict';var _=require(_0x7acc('0x0'));var util=require(_0x7acc('0x1'));var logger=require(_0x7acc('0x2'))(_0x7acc('0x3'));var moment=require(_0x7acc('0x4'));var BPromise=require(_0x7acc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7acc('0x6'));module[_0x7acc('0x7')]=function(_0x3911bf,_0x1435bd){return _0x3911bf['define'](_0x7acc('0x8'),attributes,{'tableName':_0x7acc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 59bad17..aa81bbd 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 _0x52b6=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x52b6,0xb2));var _0x652b=function(_0x385669,_0x43d386){_0x385669=_0x385669-0x0;var _0x11e2d2=_0x52b6[_0x385669];return _0x11e2d2;};'use strict';var _=require('lodash');var util=require(_0x652b('0x0'));var moment=require(_0x652b('0x1'));var BPromise=require(_0x652b('0x2'));var rs=require(_0x652b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x652b('0x4'))['db'];var utils=require(_0x652b('0x5'));var logger=require(_0x652b('0x6'))(_0x652b('0x7'));var config=require(_0x652b('0x8'));var jayson=require(_0x652b('0x9'));var client=jayson[_0x652b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15039c,_0x2d0d98,_0x32349f){return new BPromise(function(_0x1c3419,_0x160bb){return client[_0x652b('0xb')](_0x15039c,_0x32349f)[_0x652b('0xc')](function(_0x5af55d){logger[_0x652b('0xd')](_0x652b('0xe'),_0x2d0d98,'request\x20sent');logger[_0x652b('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2d0d98,'request\x20sent',JSON[_0x652b('0x10')](_0x5af55d));if(_0x5af55d['error']){if(_0x5af55d['error'][_0x652b('0x11')]===0x1f4){logger[_0x652b('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d0d98,_0x5af55d[_0x652b('0x12')][_0x652b('0x13')]);return _0x160bb(_0x5af55d[_0x652b('0x12')][_0x652b('0x13')]);}logger[_0x652b('0x12')](_0x652b('0xe'),_0x2d0d98,_0x5af55d['error'][_0x652b('0x13')]);return _0x1c3419(_0x5af55d[_0x652b('0x12')]['message']);}else{logger[_0x652b('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d0d98,'request\x20sent');_0x1c3419(_0x5af55d[_0x652b('0x14')][_0x652b('0x13')]);}})[_0x652b('0x15')](function(_0x1d8770){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2d0d98,_0x1d8770);_0x160bb(_0x1d8770);});});} \ No newline at end of file +var _0xaed3=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5423d6,_0x21af16){var _0x14b02f=function(_0x400ae1){while(--_0x400ae1){_0x5423d6['push'](_0x5423d6['shift']());}};_0x14b02f(++_0x21af16);}(_0xaed3,0x13d));var _0x3aed=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xaed3[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x3aed('0x0'));var util=require(_0x3aed('0x1'));var moment=require(_0x3aed('0x2'));var BPromise=require(_0x3aed('0x3'));var rs=require(_0x3aed('0x4'));var fs=require('fs');var Redis=require(_0x3aed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3aed('0x6'));var logger=require(_0x3aed('0x7'))(_0x3aed('0x8'));var config=require(_0x3aed('0x9'));var jayson=require(_0x3aed('0xa'));var client=jayson[_0x3aed('0xb')][_0x3aed('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22c6ad,_0x196f79,_0x53f61e){return new BPromise(function(_0x4c4d38,_0x10fe06){return client['request'](_0x22c6ad,_0x53f61e)[_0x3aed('0xd')](function(_0x5ab074){logger[_0x3aed('0xe')](_0x3aed('0xf'),_0x196f79,'request\x20sent');logger[_0x3aed('0x10')](_0x3aed('0x11'),_0x196f79,_0x3aed('0x12'),JSON[_0x3aed('0x13')](_0x5ab074));if(_0x5ab074[_0x3aed('0x14')]){if(_0x5ab074[_0x3aed('0x14')][_0x3aed('0x15')]===0x1f4){logger['error'](_0x3aed('0xf'),_0x196f79,_0x5ab074[_0x3aed('0x14')][_0x3aed('0x16')]);return _0x10fe06(_0x5ab074[_0x3aed('0x14')][_0x3aed('0x16')]);}logger[_0x3aed('0x14')](_0x3aed('0xf'),_0x196f79,_0x5ab074[_0x3aed('0x14')][_0x3aed('0x16')]);return _0x4c4d38(_0x5ab074[_0x3aed('0x14')][_0x3aed('0x16')]);}else{logger['info'](_0x3aed('0xf'),_0x196f79,_0x3aed('0x12'));_0x4c4d38(_0x5ab074['result'][_0x3aed('0x16')]);}})[_0x3aed('0x17')](function(_0x1ba4ef){logger[_0x3aed('0x14')](_0x3aed('0xf'),_0x196f79,_0x1ba4ef);_0x10fe06(_0x1ba4ef);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 85feead..765c40f 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 _0x746d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x24f5b8,_0x554904){var _0x51e6d0=function(_0x3522be){while(--_0x3522be){_0x24f5b8['push'](_0x24f5b8['shift']());}};_0x51e6d0(++_0x554904);}(_0x746d,0xda));var _0xd746=function(_0x5b3c06,_0x1b7e19){_0x5b3c06=_0x5b3c06-0x0;var _0x5a10b3=_0x746d[_0x5b3c06];return _0x5a10b3;};'use strict';var multer=require(_0xd746('0x0'));var util=require(_0xd746('0x1'));var path=require(_0xd746('0x2'));var timeout=require(_0xd746('0x3'));var express=require(_0xd746('0x4'));var router=express['Router']();var fs_extra=require(_0xd746('0x5'));var auth=require(_0xd746('0x6'));var interaction=require(_0xd746('0x7'));var config=require(_0xd746('0x8'));var controller=require('./intSalesforceField.controller');router[_0xd746('0x9')]('/',auth[_0xd746('0xa')](),controller[_0xd746('0xb')]);router[_0xd746('0x9')](_0xd746('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd746('0xd')]('/',auth['isAuthenticated'](),controller[_0xd746('0xe')]);router[_0xd746('0xf')](_0xd746('0xc'),auth[_0xd746('0xa')](),controller[_0xd746('0x10')]);router[_0xd746('0x11')](_0xd746('0xc'),auth[_0xd746('0xa')](),controller[_0xd746('0x12')]);module[_0xd746('0x13')]=router; \ No newline at end of file +var _0xef9d=['../../components/interaction/service','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x34f950,_0x1ce5b9){var _0x593002=function(_0x3f129a){while(--_0x3f129a){_0x34f950['push'](_0x34f950['shift']());}};_0x593002(++_0x1ce5b9);}(_0xef9d,0x1de));var _0xdef9=function(_0x1d0487,_0x24e562){_0x1d0487=_0x1d0487-0x0;var _0x2d3823=_0xef9d[_0x1d0487];return _0x2d3823;};'use strict';var multer=require(_0xdef9('0x0'));var util=require(_0xdef9('0x1'));var path=require(_0xdef9('0x2'));var timeout=require(_0xdef9('0x3'));var express=require(_0xdef9('0x4'));var router=express[_0xdef9('0x5')]();var fs_extra=require(_0xdef9('0x6'));var auth=require(_0xdef9('0x7'));var interaction=require(_0xdef9('0x8'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0xdef9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdef9('0x9')](_0xdef9('0xa'),auth[_0xdef9('0xb')](),controller['show']);router[_0xdef9('0xc')]('/',auth[_0xdef9('0xb')](),controller[_0xdef9('0xd')]);router[_0xdef9('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdef9('0xf')]('/:id',auth[_0xdef9('0xb')](),controller[_0xdef9('0x10')]);module[_0xdef9('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 634af2e..2102b4b 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 _0x38db=['string','variable','keyValue','picklist','STRING','sequelize','ENUM'];(function(_0xd44b3,_0x2cc1ea){var _0x4a7ea3=function(_0x249901){while(--_0x249901){_0xd44b3['push'](_0xd44b3['shift']());}};_0x4a7ea3(++_0x2cc1ea);}(_0x38db,0x186));var _0xb38d=function(_0x268d50,_0x590046){_0x268d50=_0x268d50-0x0;var _0x584a5d=_0x38db[_0x268d50];return _0x584a5d;};'use strict';var Sequelize=require(_0xb38d('0x0'));module['exports']={'type':{'type':Sequelize[_0xb38d('0x1')](_0xb38d('0x2'),_0xb38d('0x3'),'customVariable',_0xb38d('0x4'),_0xb38d('0x5')),'defaultValue':_0xb38d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb38d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xb38d('0x2'),_0xb38d('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb38d('0x6')]},'variableName':{'type':Sequelize[_0xb38d('0x6')]}}; \ No newline at end of file +var _0x9eb6=['ENUM','string','variable','picklist','STRING','sequelize','exports'];(function(_0x4e5d67,_0x54dffc){var _0x4acdf3=function(_0x53e5a3){while(--_0x53e5a3){_0x4e5d67['push'](_0x4e5d67['shift']());}};_0x4acdf3(++_0x54dffc);}(_0x9eb6,0xde));var _0x69eb=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x9eb6[_0x59bcb1];return _0x4a737f;};'use strict';var Sequelize=require(_0x69eb('0x0'));module[_0x69eb('0x1')]={'type':{'type':Sequelize[_0x69eb('0x2')](_0x69eb('0x3'),_0x69eb('0x4'),'customVariable','keyValue',_0x69eb('0x5')),'defaultValue':_0x69eb('0x3')},'content':{'type':Sequelize[_0x69eb('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x69eb('0x2')](_0x69eb('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x69eb('0x6')]},'idField':{'type':Sequelize[_0x69eb('0x6')]},'variableName':{'type':Sequelize[_0x69eb('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 04fa93e..f36e6d5 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 _0x582a=['destroy','end','error','stack','name','send','index','map','SalesforceField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','count','limit','Content-Range','json','apply','reject','save','update','then'];(function(_0x115303,_0x47d05f){var _0x1e695f=function(_0x2dbdf2){while(--_0x2dbdf2){_0x115303['push'](_0x115303['shift']());}};_0x1e695f(++_0x47d05f);}(_0x582a,0x10a));var _0xa582=function(_0x5885e4,_0x23d7b7){_0x5885e4=_0x5885e4-0x0;var _0x154bab=_0x582a[_0x5885e4];return _0x154bab;};'use strict';var emlformat=require(_0xa582('0x0'));var rimraf=require(_0xa582('0x1'));var zipdir=require(_0xa582('0x2'));var jsonpatch=require(_0xa582('0x3'));var rp=require(_0xa582('0x4'));var moment=require(_0xa582('0x5'));var BPromise=require(_0xa582('0x6'));var Mustache=require(_0xa582('0x7'));var util=require('util');var path=require(_0xa582('0x8'));var sox=require('sox');var csv=require(_0xa582('0x9'));var ejs=require(_0xa582('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa582('0xb'));var squel=require('squel');var crypto=require(_0xa582('0xc'));var jsforce=require(_0xa582('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa582('0xe'));var Papa=require(_0xa582('0xf'));var Redis=require('ioredis');var authService=require(_0xa582('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa582('0x11'));var hardwareService=require(_0xa582('0x12'));var logger=require(_0xa582('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa582('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa582('0x15'))['db'];function respondWithStatusCode(_0x1235cb,_0x106dd3){_0x106dd3=_0x106dd3||0xcc;return function(_0x17b8a7){if(_0x17b8a7){return _0x1235cb[_0xa582('0x16')](_0x106dd3);}return _0x1235cb[_0xa582('0x17')](_0x106dd3)['end']();};}function respondWithResult(_0x96adbb,_0x308817){_0x308817=_0x308817||0xc8;return function(_0x3a1f2d){if(_0x3a1f2d){return _0x96adbb['status'](_0x308817)['json'](_0x3a1f2d);}};}function respondWithFilteredResult(_0x3607d2,_0x29e470){return function(_0x5478da){if(_0x5478da){var _0x35648f=typeof _0x29e470[_0xa582('0x18')]==='undefined'&&typeof _0x29e470['limit']==='undefined';var _0x659b63=_0x5478da[_0xa582('0x19')];var _0x2a0a2b=_0x35648f?0x0:_0x29e470[_0xa582('0x18')];var _0x3ac65d=_0x35648f?_0x5478da[_0xa582('0x19')]:_0x29e470[_0xa582('0x18')]+_0x29e470[_0xa582('0x1a')];var _0x2b8b10;if(_0x3ac65d>=_0x659b63){_0x3ac65d=_0x659b63;_0x2b8b10=0xc8;}else{_0x2b8b10=0xce;}_0x3607d2[_0xa582('0x17')](_0x2b8b10);return _0x3607d2['set'](_0xa582('0x1b'),_0x2a0a2b+'-'+_0x3ac65d+'/'+_0x659b63)[_0xa582('0x1c')](_0x5478da);}return null;};}function patchUpdates(_0x2387f0){return function(_0x1c588f){try{jsonpatch[_0xa582('0x1d')](_0x1c588f,_0x2387f0,!![]);}catch(_0x2e94b2){return BPromise[_0xa582('0x1e')](_0x2e94b2);}return _0x1c588f[_0xa582('0x1f')]();};}function saveUpdates(_0x3695fe,_0x31af38){return function(_0x3ea150){if(_0x3ea150){return _0x3ea150[_0xa582('0x20')](_0x3695fe)[_0xa582('0x21')](function(_0x268852){return _0x268852;});}return null;};}function removeEntity(_0x3a1be1,_0x46c919){return function(_0xb9e95b){if(_0xb9e95b){return _0xb9e95b[_0xa582('0x22')]()['then'](function(){_0x3a1be1[_0xa582('0x17')](0xcc)[_0xa582('0x23')]();});}};}function handleEntityNotFound(_0x42809e,_0x5e785c){return function(_0x487e1b){if(!_0x487e1b){_0x42809e[_0xa582('0x16')](0x194);}return _0x487e1b;};}function handleError(_0x1f3f27,_0x2f06b6){_0x2f06b6=_0x2f06b6||0x1f4;return function(_0x1fbe4f){logger[_0xa582('0x24')](_0x1fbe4f[_0xa582('0x25')]);if(_0x1fbe4f['name']){delete _0x1fbe4f[_0xa582('0x26')];}_0x1f3f27[_0xa582('0x17')](_0x2f06b6)[_0xa582('0x27')](_0x1fbe4f);};}exports[_0xa582('0x28')]=function(_0xd37fcd,_0x204577){var _0x23bdf8={},_0x3087af={},_0x3631ab={'count':0x0,'rows':[]};var _0x328c7c=_[_0xa582('0x29')](db[_0xa582('0x2a')]['rawAttributes'],function(_0x4df3de){return{'name':_0x4df3de[_0xa582('0x2b')],'type':_0x4df3de[_0xa582('0x2c')][_0xa582('0x2d')]};});_0x3087af[_0xa582('0x2e')]=_['map'](_0x328c7c,_0xa582('0x26'));_0x3087af[_0xa582('0x2f')]=_['keys'](_0xd37fcd[_0xa582('0x2f')]);_0x3087af[_0xa582('0x30')]=_[_0xa582('0x31')](_0x3087af[_0xa582('0x2e')],_0x3087af[_0xa582('0x2f')]);_0x23bdf8['attributes']=_[_0xa582('0x31')](_0x3087af[_0xa582('0x2e')],qs[_0xa582('0x32')](_0xd37fcd[_0xa582('0x2f')][_0xa582('0x32')]));_0x23bdf8[_0xa582('0x33')]=_0x23bdf8[_0xa582('0x33')][_0xa582('0x34')]?_0x23bdf8['attributes']:_0x3087af[_0xa582('0x2e')];if(!_0xd37fcd[_0xa582('0x2f')][_0xa582('0x35')](_0xa582('0x36'))){_0x23bdf8[_0xa582('0x1a')]=qs[_0xa582('0x1a')](_0xd37fcd['query'][_0xa582('0x1a')]);_0x23bdf8[_0xa582('0x18')]=qs[_0xa582('0x18')](_0xd37fcd[_0xa582('0x2f')]['offset']);}_0x23bdf8[_0xa582('0x37')]=qs[_0xa582('0x38')](_0xd37fcd['query']['sort']);_0x23bdf8[_0xa582('0x39')]=qs[_0xa582('0x30')](_[_0xa582('0x3a')](_0xd37fcd[_0xa582('0x2f')],_0x3087af[_0xa582('0x30')]),_0x328c7c);if(_0xd37fcd[_0xa582('0x2f')]['filter']){_0x23bdf8[_0xa582('0x39')]=_[_0xa582('0x3b')](_0x23bdf8[_0xa582('0x39')],{'$or':_[_0xa582('0x29')](_0x328c7c,function(_0x5d061c){if(_0x5d061c[_0xa582('0x2c')]!==_0xa582('0x3c')){var _0x29b1e9={};_0x29b1e9[_0x5d061c['name']]={'$like':'%'+_0xd37fcd[_0xa582('0x2f')][_0xa582('0x3d')]+'%'};return _0x29b1e9;}})});}_0x23bdf8=_['merge']({},_0x23bdf8,_0xd37fcd[_0xa582('0x3e')]);var _0x5cfd42={'where':_0x23bdf8[_0xa582('0x39')]};return db['SalesforceField'][_0xa582('0x19')](_0x5cfd42)[_0xa582('0x21')](function(_0x3369a3){_0x3631ab[_0xa582('0x19')]=_0x3369a3;if(_0xd37fcd[_0xa582('0x2f')][_0xa582('0x3f')]){_0x23bdf8[_0xa582('0x40')]=[{'all':!![]}];}return db[_0xa582('0x2a')][_0xa582('0x41')](_0x23bdf8);})[_0xa582('0x21')](function(_0x838751){_0x3631ab[_0xa582('0x42')]=_0x838751;return _0x3631ab;})[_0xa582('0x21')](respondWithFilteredResult(_0x204577,_0x23bdf8))[_0xa582('0x43')](handleError(_0x204577,null));};exports[_0xa582('0x44')]=function(_0x38c4fd,_0x2d0ef6){var _0x58e36c={'raw':!![],'where':{'id':_0x38c4fd[_0xa582('0x45')]['id']}},_0x5af5c1={};_0x5af5c1['model']=_[_0xa582('0x46')](db[_0xa582('0x2a')][_0xa582('0x47')]);_0x5af5c1['query']=_['keys'](_0x38c4fd['query']);_0x5af5c1[_0xa582('0x30')]=_['intersection'](_0x5af5c1[_0xa582('0x2e')],_0x5af5c1[_0xa582('0x2f')]);_0x58e36c[_0xa582('0x33')]=_[_0xa582('0x31')](_0x5af5c1[_0xa582('0x2e')],qs[_0xa582('0x32')](_0x38c4fd[_0xa582('0x2f')][_0xa582('0x32')]));_0x58e36c[_0xa582('0x33')]=_0x58e36c[_0xa582('0x33')][_0xa582('0x34')]?_0x58e36c[_0xa582('0x33')]:_0x5af5c1['model'];if(_0x38c4fd['query'][_0xa582('0x3f')]){_0x58e36c[_0xa582('0x40')]=[{'all':!![]}];}_0x58e36c=_['merge']({},_0x58e36c,_0x38c4fd['options']);return db[_0xa582('0x2a')]['find'](_0x58e36c)[_0xa582('0x21')](handleEntityNotFound(_0x2d0ef6,null))[_0xa582('0x21')](respondWithResult(_0x2d0ef6,null))[_0xa582('0x43')](handleError(_0x2d0ef6,null));};exports[_0xa582('0x48')]=function(_0x58691a,_0x411633){return db[_0xa582('0x2a')]['create'](_0x58691a[_0xa582('0x49')],{})['then'](respondWithResult(_0x411633,0xc9))['catch'](handleError(_0x411633,null));};exports[_0xa582('0x20')]=function(_0x3165cd,_0xb3ad0f){if(_0x3165cd[_0xa582('0x49')]['id']){delete _0x3165cd[_0xa582('0x49')]['id'];}return db['SalesforceField'][_0xa582('0x4a')]({'where':{'id':_0x3165cd[_0xa582('0x45')]['id']}})[_0xa582('0x21')](handleEntityNotFound(_0xb3ad0f,null))[_0xa582('0x21')](saveUpdates(_0x3165cd[_0xa582('0x49')],null))[_0xa582('0x21')](respondWithResult(_0xb3ad0f,null))[_0xa582('0x43')](handleError(_0xb3ad0f,null));};exports[_0xa582('0x22')]=function(_0x170a33,_0x33dc2b){return db[_0xa582('0x2a')][_0xa582('0x4a')]({'where':{'id':_0x170a33['params']['id']}})[_0xa582('0x21')](handleEntityNotFound(_0x33dc2b,null))['then'](removeEntity(_0x33dc2b,null))[_0xa582('0x43')](handleError(_0x33dc2b,null));}; \ No newline at end of file +var _0xb81a=['SalesforceField','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','send','map'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xb81a,0x133));var _0xab81=function(_0x1b9464,_0x9c4cab){_0x1b9464=_0x1b9464-0x0;var _0x5bdf8e=_0xb81a[_0x1b9464];return _0x5bdf8e;};'use strict';var emlformat=require(_0xab81('0x0'));var rimraf=require(_0xab81('0x1'));var zipdir=require(_0xab81('0x2'));var jsonpatch=require(_0xab81('0x3'));var rp=require(_0xab81('0x4'));var moment=require(_0xab81('0x5'));var BPromise=require(_0xab81('0x6'));var Mustache=require('mustache');var util=require(_0xab81('0x7'));var path=require(_0xab81('0x8'));var sox=require('sox');var csv=require(_0xab81('0x9'));var ejs=require(_0xab81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab81('0xb'));var squel=require(_0xab81('0xc'));var crypto=require(_0xab81('0xd'));var jsforce=require(_0xab81('0xe'));var deskjs=require(_0xab81('0xf'));var toCsv=require(_0xab81('0x9'));var querystring=require(_0xab81('0x10'));var Papa=require(_0xab81('0x11'));var Redis=require(_0xab81('0x12'));var authService=require(_0xab81('0x13'));var qs=require(_0xab81('0x14'));var as=require(_0xab81('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab81('0x16'));var utils=require(_0xab81('0x17'));var config=require(_0xab81('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d12f,_0x144500){_0x144500=_0x144500||0xcc;return function(_0x556e28){if(_0x556e28){return _0x27d12f[_0xab81('0x19')](_0x144500);}return _0x27d12f[_0xab81('0x1a')](_0x144500)[_0xab81('0x1b')]();};}function respondWithResult(_0x587f4d,_0x2c5564){_0x2c5564=_0x2c5564||0xc8;return function(_0x153dc1){if(_0x153dc1){return _0x587f4d[_0xab81('0x1a')](_0x2c5564)[_0xab81('0x1c')](_0x153dc1);}};}function respondWithFilteredResult(_0x5e8f24,_0x27f11e){return function(_0x10bf0d){if(_0x10bf0d){var _0x24f221=typeof _0x27f11e[_0xab81('0x1d')]===_0xab81('0x1e')&&typeof _0x27f11e[_0xab81('0x1f')]===_0xab81('0x1e');var _0x118404=_0x10bf0d['count'];var _0x5bdcbe=_0x24f221?0x0:_0x27f11e[_0xab81('0x1d')];var _0x1f749d=_0x24f221?_0x10bf0d[_0xab81('0x20')]:_0x27f11e[_0xab81('0x1d')]+_0x27f11e[_0xab81('0x1f')];var _0x163386;if(_0x1f749d>=_0x118404){_0x1f749d=_0x118404;_0x163386=0xc8;}else{_0x163386=0xce;}_0x5e8f24[_0xab81('0x1a')](_0x163386);return _0x5e8f24[_0xab81('0x21')](_0xab81('0x22'),_0x5bdcbe+'-'+_0x1f749d+'/'+_0x118404)['json'](_0x10bf0d);}return null;};}function patchUpdates(_0x3144f9){return function(_0x17dc6f){try{jsonpatch[_0xab81('0x23')](_0x17dc6f,_0x3144f9,!![]);}catch(_0xb1596a){return BPromise[_0xab81('0x24')](_0xb1596a);}return _0x17dc6f['save']();};}function saveUpdates(_0x31968a,_0x17cab6){return function(_0x7930f8){if(_0x7930f8){return _0x7930f8[_0xab81('0x25')](_0x31968a)[_0xab81('0x26')](function(_0x8fd1c5){return _0x8fd1c5;});}return null;};}function removeEntity(_0x4a1557,_0x57f3d4){return function(_0x5c34c5){if(_0x5c34c5){return _0x5c34c5[_0xab81('0x27')]()[_0xab81('0x26')](function(){_0x4a1557['status'](0xcc)[_0xab81('0x1b')]();});}};}function handleEntityNotFound(_0x4ce55d,_0x9b812d){return function(_0x574c9d){if(!_0x574c9d){_0x4ce55d[_0xab81('0x19')](0x194);}return _0x574c9d;};}function handleError(_0x2fea7b,_0x5b1cf3){_0x5b1cf3=_0x5b1cf3||0x1f4;return function(_0x3d38f1){logger[_0xab81('0x28')](_0x3d38f1['stack']);if(_0x3d38f1['name']){delete _0x3d38f1['name'];}_0x2fea7b[_0xab81('0x1a')](_0x5b1cf3)[_0xab81('0x29')](_0x3d38f1);};}exports['index']=function(_0x20eccd,_0x4f5c6c){var _0x573864={},_0xa6d87f={},_0x477771={'count':0x0,'rows':[]};var _0x2e8b8e=_[_0xab81('0x2a')](db[_0xab81('0x2b')][_0xab81('0x2c')],function(_0x5bc2ef){return{'name':_0x5bc2ef['fieldName'],'type':_0x5bc2ef[_0xab81('0x2d')][_0xab81('0x2e')]};});_0xa6d87f[_0xab81('0x2f')]=_[_0xab81('0x2a')](_0x2e8b8e,_0xab81('0x30'));_0xa6d87f[_0xab81('0x31')]=_['keys'](_0x20eccd[_0xab81('0x31')]);_0xa6d87f[_0xab81('0x32')]=_[_0xab81('0x33')](_0xa6d87f[_0xab81('0x2f')],_0xa6d87f[_0xab81('0x31')]);_0x573864[_0xab81('0x34')]=_['intersection'](_0xa6d87f[_0xab81('0x2f')],qs['fields'](_0x20eccd[_0xab81('0x31')][_0xab81('0x35')]));_0x573864['attributes']=_0x573864[_0xab81('0x34')]['length']?_0x573864[_0xab81('0x34')]:_0xa6d87f['model'];if(!_0x20eccd[_0xab81('0x31')][_0xab81('0x36')](_0xab81('0x37'))){_0x573864[_0xab81('0x1f')]=qs[_0xab81('0x1f')](_0x20eccd['query'][_0xab81('0x1f')]);_0x573864[_0xab81('0x1d')]=qs[_0xab81('0x1d')](_0x20eccd[_0xab81('0x31')]['offset']);}_0x573864['order']=qs[_0xab81('0x38')](_0x20eccd[_0xab81('0x31')][_0xab81('0x38')]);_0x573864[_0xab81('0x39')]=qs[_0xab81('0x32')](_['pick'](_0x20eccd[_0xab81('0x31')],_0xa6d87f['filters']),_0x2e8b8e);if(_0x20eccd[_0xab81('0x31')][_0xab81('0x3a')]){_0x573864[_0xab81('0x39')]=_[_0xab81('0x3b')](_0x573864['where'],{'$or':_[_0xab81('0x2a')](_0x2e8b8e,function(_0xac2292){if(_0xac2292[_0xab81('0x2d')]!==_0xab81('0x3c')){var _0x4b3377={};_0x4b3377[_0xac2292[_0xab81('0x30')]]={'$like':'%'+_0x20eccd['query'][_0xab81('0x3a')]+'%'};return _0x4b3377;}})});}_0x573864=_[_0xab81('0x3b')]({},_0x573864,_0x20eccd[_0xab81('0x3d')]);var _0x47ce92={'where':_0x573864[_0xab81('0x39')]};return db['SalesforceField'][_0xab81('0x20')](_0x47ce92)['then'](function(_0x11f371){_0x477771[_0xab81('0x20')]=_0x11f371;if(_0x20eccd['query'][_0xab81('0x3e')]){_0x573864[_0xab81('0x3f')]=[{'all':!![]}];}return db[_0xab81('0x2b')][_0xab81('0x40')](_0x573864);})['then'](function(_0x3c8f89){_0x477771['rows']=_0x3c8f89;return _0x477771;})[_0xab81('0x26')](respondWithFilteredResult(_0x4f5c6c,_0x573864))[_0xab81('0x41')](handleError(_0x4f5c6c,null));};exports['show']=function(_0x131997,_0x477e60){var _0x382db0={'raw':!![],'where':{'id':_0x131997[_0xab81('0x42')]['id']}},_0x7cbef9={};_0x7cbef9[_0xab81('0x2f')]=_['keys'](db[_0xab81('0x2b')]['rawAttributes']);_0x7cbef9[_0xab81('0x31')]=_['keys'](_0x131997[_0xab81('0x31')]);_0x7cbef9[_0xab81('0x32')]=_[_0xab81('0x33')](_0x7cbef9[_0xab81('0x2f')],_0x7cbef9['query']);_0x382db0[_0xab81('0x34')]=_['intersection'](_0x7cbef9[_0xab81('0x2f')],qs[_0xab81('0x35')](_0x131997['query'][_0xab81('0x35')]));_0x382db0[_0xab81('0x34')]=_0x382db0[_0xab81('0x34')]['length']?_0x382db0[_0xab81('0x34')]:_0x7cbef9[_0xab81('0x2f')];if(_0x131997[_0xab81('0x31')][_0xab81('0x3e')]){_0x382db0[_0xab81('0x3f')]=[{'all':!![]}];}_0x382db0=_[_0xab81('0x3b')]({},_0x382db0,_0x131997[_0xab81('0x3d')]);return db[_0xab81('0x2b')][_0xab81('0x43')](_0x382db0)['then'](handleEntityNotFound(_0x477e60,null))[_0xab81('0x26')](respondWithResult(_0x477e60,null))[_0xab81('0x41')](handleError(_0x477e60,null));};exports[_0xab81('0x44')]=function(_0x4cef31,_0x215db4){return db[_0xab81('0x2b')][_0xab81('0x44')](_0x4cef31['body'],{})[_0xab81('0x26')](respondWithResult(_0x215db4,0xc9))[_0xab81('0x41')](handleError(_0x215db4,null));};exports[_0xab81('0x25')]=function(_0x3345a5,_0x5a4768){if(_0x3345a5[_0xab81('0x45')]['id']){delete _0x3345a5[_0xab81('0x45')]['id'];}return db[_0xab81('0x2b')]['find']({'where':{'id':_0x3345a5[_0xab81('0x42')]['id']}})[_0xab81('0x26')](handleEntityNotFound(_0x5a4768,null))[_0xab81('0x26')](saveUpdates(_0x3345a5['body'],null))[_0xab81('0x26')](respondWithResult(_0x5a4768,null))[_0xab81('0x41')](handleError(_0x5a4768,null));};exports['destroy']=function(_0x5c6195,_0x1dcb2f){return db[_0xab81('0x2b')][_0xab81('0x43')]({'where':{'id':_0x5c6195[_0xab81('0x42')]['id']}})['then'](handleEntityNotFound(_0x1dcb2f,null))[_0xab81('0x26')](removeEntity(_0x1dcb2f,null))[_0xab81('0x41')](handleError(_0x1dcb2f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e06199b..f8656fd 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 _0x3c3a=['lodash','util','api','moment','bluebird','request-promise','rimraf','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x3c3a,0x12b));var _0xa3c3=function(_0x3eb1da,_0x2a0c10){_0x3eb1da=_0x3eb1da-0x0;var _0x189f03=_0x3c3a[_0x3eb1da];return _0x189f03;};'use strict';var _=require(_0xa3c3('0x0'));var util=require(_0xa3c3('0x1'));var logger=require('../../config/logger')(_0xa3c3('0x2'));var moment=require(_0xa3c3('0x3'));var BPromise=require(_0xa3c3('0x4'));var rp=require(_0xa3c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3c3('0x6'));var config=require('../../config/environment');var attributes=require(_0xa3c3('0x7'));module['exports']=function(_0x120aec,_0x5b3180){return _0x120aec['define'](_0xa3c3('0x8'),attributes,{'tableName':_0xa3c3('0x9'),'paranoid':![],'indexes':[{'name':_0xa3c3('0xa'),'fields':[_0xa3c3('0xb'),_0xa3c3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64c4=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes'];(function(_0x2af47e,_0x1d2a86){var _0x5bca26=function(_0x4ba3db){while(--_0x4ba3db){_0x2af47e['push'](_0x2af47e['shift']());}};_0x5bca26(++_0x1d2a86);}(_0x64c4,0x142));var _0x464c=function(_0x28c372,_0x46b647){_0x28c372=_0x28c372-0x0;var _0x381389=_0x64c4[_0x28c372];return _0x381389;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x464c('0x0'))(_0x464c('0x1'));var moment=require(_0x464c('0x2'));var BPromise=require(_0x464c('0x3'));var rp=require(_0x464c('0x4'));var fs=require('fs');var path=require(_0x464c('0x5'));var rimraf=require(_0x464c('0x6'));var config=require('../../config/environment');var attributes=require(_0x464c('0x7'));module[_0x464c('0x8')]=function(_0x23b175,_0x40fa18){return _0x23b175[_0x464c('0x9')](_0x464c('0xa'),attributes,{'tableName':_0x464c('0xb'),'paranoid':![],'indexes':[{'name':_0x464c('0xc'),'fields':[_0x464c('0xd'),_0x464c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index a696713..867c22b 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 _0x3038=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x3038,0x157));var _0x8303=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x3038[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0x8303('0x0'));var util=require(_0x8303('0x1'));var moment=require(_0x8303('0x2'));var BPromise=require(_0x8303('0x3'));var rs=require(_0x8303('0x4'));var fs=require('fs');var Redis=require(_0x8303('0x5'));var db=require(_0x8303('0x6'))['db'];var utils=require(_0x8303('0x7'));var logger=require('../../config/logger')(_0x8303('0x8'));var config=require(_0x8303('0x9'));var jayson=require(_0x8303('0xa'));var client=jayson['client'][_0x8303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2286,_0x1c4409,_0xf0376f){return new BPromise(function(_0x316f8a,_0x17dd66){return client[_0x8303('0xc')](_0x3c2286,_0xf0376f)[_0x8303('0xd')](function(_0x2e53ad){logger[_0x8303('0xe')](_0x8303('0xf'),_0x1c4409,_0x8303('0x10'));logger[_0x8303('0x11')](_0x8303('0x12'),_0x1c4409,_0x8303('0x10'),JSON[_0x8303('0x13')](_0x2e53ad));if(_0x2e53ad['error']){if(_0x2e53ad[_0x8303('0x14')][_0x8303('0x15')]===0x1f4){logger['error'](_0x8303('0xf'),_0x1c4409,_0x2e53ad[_0x8303('0x14')][_0x8303('0x16')]);return _0x17dd66(_0x2e53ad[_0x8303('0x14')][_0x8303('0x16')]);}logger[_0x8303('0x14')](_0x8303('0xf'),_0x1c4409,_0x2e53ad[_0x8303('0x14')][_0x8303('0x16')]);return _0x316f8a(_0x2e53ad[_0x8303('0x14')][_0x8303('0x16')]);}else{logger['info'](_0x8303('0xf'),_0x1c4409,'request\x20sent');_0x316f8a(_0x2e53ad[_0x8303('0x17')][_0x8303('0x16')]);}})[_0x8303('0x18')](function(_0x458018){logger[_0x8303('0x14')]('SalesforceField,\x20%s,\x20%s',_0x1c4409,_0x458018);_0x17dd66(_0x458018);});});} \ No newline at end of file +var _0x1a3a=['error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2fda05,_0x442a79){var _0x521ad9=function(_0x2cb82b){while(--_0x2cb82b){_0x2fda05['push'](_0x2fda05['shift']());}};_0x521ad9(++_0x442a79);}(_0x1a3a,0x9d));var _0xa1a3=function(_0x580a90,_0x4095ce){_0x580a90=_0x580a90-0x0;var _0x4c7d83=_0x1a3a[_0x580a90];return _0x4c7d83;};'use strict';var _=require(_0xa1a3('0x0'));var util=require('util');var moment=require(_0xa1a3('0x1'));var BPromise=require(_0xa1a3('0x2'));var rs=require(_0xa1a3('0x3'));var fs=require('fs');var Redis=require(_0xa1a3('0x4'));var db=require(_0xa1a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1a3('0x6'))('rpc');var config=require(_0xa1a3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa1a3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c68d3,_0x34c057,_0x5e33aa){return new BPromise(function(_0xf3b8ee,_0x113dab){return client['request'](_0x2c68d3,_0x5e33aa)['then'](function(_0x313d81){logger[_0xa1a3('0x9')](_0xa1a3('0xa'),_0x34c057,_0xa1a3('0xb'));logger[_0xa1a3('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x34c057,_0xa1a3('0xb'),JSON['stringify'](_0x313d81));if(_0x313d81[_0xa1a3('0xd')]){if(_0x313d81[_0xa1a3('0xd')][_0xa1a3('0xe')]===0x1f4){logger[_0xa1a3('0xd')](_0xa1a3('0xa'),_0x34c057,_0x313d81['error'][_0xa1a3('0xf')]);return _0x113dab(_0x313d81['error'][_0xa1a3('0xf')]);}logger[_0xa1a3('0xd')](_0xa1a3('0xa'),_0x34c057,_0x313d81['error']['message']);return _0xf3b8ee(_0x313d81[_0xa1a3('0xd')][_0xa1a3('0xf')]);}else{logger[_0xa1a3('0x9')](_0xa1a3('0xa'),_0x34c057,'request\x20sent');_0xf3b8ee(_0x313d81['result'][_0xa1a3('0xf')]);}})[_0xa1a3('0x10')](function(_0x55e977){logger['error'](_0xa1a3('0xa'),_0x34c057,_0x55e977);_0x113dab(_0x55e977);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 19c1041..64f8809 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 _0xf2a9=['../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','/:id','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xf2a9,0x77));var _0x9f2a=function(_0xe59a39,_0x441985){_0xe59a39=_0xe59a39-0x0;var _0x28d5de=_0xf2a9[_0xe59a39];return _0x28d5de;};'use strict';var multer=require('multer');var util=require(_0x9f2a('0x0'));var path=require(_0x9f2a('0x1'));var timeout=require(_0x9f2a('0x2'));var express=require('express');var router=express[_0x9f2a('0x3')]();var fs_extra=require(_0x9f2a('0x4'));var auth=require(_0x9f2a('0x5'));var interaction=require(_0x9f2a('0x6'));var config=require(_0x9f2a('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x9f2a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9f2a('0x8')]('/:id',auth[_0x9f2a('0x9')](),controller[_0x9f2a('0xa')]);router[_0x9f2a('0x8')](_0x9f2a('0xb'),auth[_0x9f2a('0x9')](),controller[_0x9f2a('0xc')]);router['get']('/:id/fields',auth[_0x9f2a('0x9')](),controller[_0x9f2a('0xd')]);router[_0x9f2a('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f2a('0xf')]);router[_0x9f2a('0xe')](_0x9f2a('0xb'),auth[_0x9f2a('0x9')](),controller[_0x9f2a('0x10')]);router['put'](_0x9f2a('0x11'),auth[_0x9f2a('0x9')](),controller[_0x9f2a('0x12')]);router[_0x9f2a('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9f2a('0x14')]=router; \ No newline at end of file +var _0x2888=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x2888,0x97));var _0x8288=function(_0xb97434,_0x427ea5){_0xb97434=_0xb97434-0x0;var _0xdc1951=_0x2888[_0xb97434];return _0xdc1951;};'use strict';var multer=require(_0x8288('0x0'));var util=require(_0x8288('0x1'));var path=require('path');var timeout=require(_0x8288('0x2'));var express=require(_0x8288('0x3'));var router=express[_0x8288('0x4')]();var fs_extra=require(_0x8288('0x5'));var auth=require(_0x8288('0x6'));var interaction=require(_0x8288('0x7'));var config=require(_0x8288('0x8'));var controller=require(_0x8288('0x9'));router['get']('/',auth[_0x8288('0xa')](),controller['index']);router[_0x8288('0xb')](_0x8288('0xc'),auth['isAuthenticated'](),controller[_0x8288('0xd')]);router[_0x8288('0xb')]('/:id/configurations',auth[_0x8288('0xa')](),controller[_0x8288('0xe')]);router[_0x8288('0xb')](_0x8288('0xf'),auth[_0x8288('0xa')](),controller[_0x8288('0x10')]);router[_0x8288('0x11')]('/',auth[_0x8288('0xa')](),controller[_0x8288('0x12')]);router[_0x8288('0x11')](_0x8288('0x13'),auth[_0x8288('0xa')](),controller[_0x8288('0x14')]);router[_0x8288('0x15')](_0x8288('0xc'),auth[_0x8288('0xa')](),controller[_0x8288('0x16')]);router[_0x8288('0x17')](_0x8288('0xc'),auth['isAuthenticated'](),controller[_0x8288('0x18')]);module[_0x8288('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 13a48b5..1928223 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 _0x477e=['sequelize','STRING','username','remoteUri'];(function(_0x4283b5,_0x507296){var _0x2b6412=function(_0x170067){while(--_0x170067){_0x4283b5['push'](_0x4283b5['shift']());}};_0x2b6412(++_0x507296);}(_0x477e,0xd8));var _0xe477=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x477e[_0x454165];return _0x56db53;};'use strict';var Sequelize=require(_0xe477('0x0'));module['exports']={'name':{'type':Sequelize[_0xe477('0x1')]},'description':{'type':Sequelize[_0xe477('0x1')]},'username':{'type':Sequelize[_0xe477('0x1')],'unique':_0xe477('0x2')},'password':{'type':Sequelize[_0xe477('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe477('0x1')],'unique':_0xe477('0x3')},'serverUrl':{'type':Sequelize[_0xe477('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x22a4=['exports','STRING','username','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x22a4,0xcb));var _0x422a=function(_0x3403ec,_0x33f0c2){_0x3403ec=_0x3403ec-0x0;var _0x4b8260=_0x22a4[_0x3403ec];return _0x4b8260;};'use strict';var Sequelize=require(_0x422a('0x0'));module[_0x422a('0x1')]={'name':{'type':Sequelize[_0x422a('0x2')]},'description':{'type':Sequelize[_0x422a('0x2')]},'username':{'type':Sequelize[_0x422a('0x2')],'unique':_0x422a('0x3')},'password':{'type':Sequelize[_0x422a('0x2')]},'email':{'type':Sequelize[_0x422a('0x2')]},'remoteUri':{'type':Sequelize[_0x422a('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x422a('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 a36c604..5336504 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 _0x543e=['parent_incident','sys_id','reopened_by','problem_id','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','category','username','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','internalType','label','push','all','remove','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','send','Wrong\x20credentials','True','true','False','false','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','end','error','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','hold_reason','knowledge','subcategory','close_code','parent','made_sla','caused_by','child_incidents','approval_history','resolved_by','opened_by','user_input','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','calendar_duration','notify','sys_class_name','closed_by','follow_up'];(function(_0x34ecbf,_0x210898){var _0x115f8a=function(_0x559567){while(--_0x559567){_0x34ecbf['push'](_0x34ecbf['shift']());}};_0x115f8a(++_0x210898);}(_0x543e,0xe6));var _0xe543=function(_0xbefcf8,_0x35ecee){_0xbefcf8=_0xbefcf8-0x0;var _0x2aece2=_0x543e[_0xbefcf8];return _0x2aece2;};'use strict';var emlformat=require(_0xe543('0x0'));var rimraf=require(_0xe543('0x1'));var zipdir=require(_0xe543('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe543('0x3'));var moment=require(_0xe543('0x4'));var BPromise=require(_0xe543('0x5'));var Mustache=require(_0xe543('0x6'));var util=require(_0xe543('0x7'));var path=require(_0xe543('0x8'));var sox=require('sox');var csv=require(_0xe543('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe543('0xa'));var _=require(_0xe543('0xb'));var squel=require(_0xe543('0xc'));var crypto=require('crypto');var jsforce=require(_0xe543('0xd'));var deskjs=require(_0xe543('0xe'));var toCsv=require(_0xe543('0x9'));var querystring=require('querystring');var Papa=require(_0xe543('0xf'));var Redis=require(_0xe543('0x10'));var authService=require(_0xe543('0x11'));var qs=require(_0xe543('0x12'));var as=require(_0xe543('0x13'));var hardwareService=require(_0xe543('0x14'));var logger=require(_0xe543('0x15'))('api');var utils=require(_0xe543('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe543('0x17'));var db=require(_0xe543('0x18'))['db'];var integrations=require(_0xe543('0x19'));function respondWithStatusCode(_0x1150f0,_0x3c5bc9){_0x3c5bc9=_0x3c5bc9||0xcc;return function(_0x5662){if(_0x5662){return _0x1150f0[_0xe543('0x1a')](_0x3c5bc9);}return _0x1150f0['status'](_0x3c5bc9)['end']();};}function respondWithResult(_0x3997b4,_0x3c13b7){_0x3c13b7=_0x3c13b7||0xc8;return function(_0x404dd0){if(_0x404dd0){return _0x3997b4['status'](_0x3c13b7)[_0xe543('0x1b')](_0x404dd0);}};}function respondWithFilteredResult(_0x12b71f,_0x32a3a2){return function(_0xea70bd){if(_0xea70bd){var _0x583ab2=typeof _0x32a3a2[_0xe543('0x1c')]===_0xe543('0x1d')&&typeof _0x32a3a2[_0xe543('0x1e')]==='undefined';var _0x60959d=_0xea70bd[_0xe543('0x1f')];var _0x5df30e=_0x583ab2?0x0:_0x32a3a2[_0xe543('0x1c')];var _0xd595b0=_0x583ab2?_0xea70bd['count']:_0x32a3a2[_0xe543('0x1c')]+_0x32a3a2[_0xe543('0x1e')];var _0x4f64e3;if(_0xd595b0>=_0x60959d){_0xd595b0=_0x60959d;_0x4f64e3=0xc8;}else{_0x4f64e3=0xce;}_0x12b71f[_0xe543('0x20')](_0x4f64e3);return _0x12b71f[_0xe543('0x21')](_0xe543('0x22'),_0x5df30e+'-'+_0xd595b0+'/'+_0x60959d)[_0xe543('0x1b')](_0xea70bd);}return null;};}function patchUpdates(_0x2ecd1d){return function(_0x14878a){try{jsonpatch[_0xe543('0x23')](_0x14878a,_0x2ecd1d,!![]);}catch(_0x3b3629){return BPromise[_0xe543('0x24')](_0x3b3629);}return _0x14878a['save']();};}function saveUpdates(_0x5f57e3,_0x4e14e7){return function(_0x4692c1){if(_0x4692c1){return _0x4692c1[_0xe543('0x25')](_0x5f57e3)['then'](function(_0x58eadb){return _0x58eadb;});}return null;};}function removeEntity(_0x5dbfab,_0x406a6a){return function(_0x565871){if(_0x565871){return _0x565871['destroy']()['then'](function(){_0x5dbfab[_0xe543('0x20')](0xcc)[_0xe543('0x26')]();});}};}function handleEntityNotFound(_0x5aa192,_0x43c89a){return function(_0x2309a3){if(!_0x2309a3){_0x5aa192[_0xe543('0x1a')](0x194);}return _0x2309a3;};}function handleError(_0x399d85,_0xc22738){_0xc22738=_0xc22738||0x1f4;return function(_0x3b33ce){logger[_0xe543('0x27')](_0x3b33ce['stack']);if(_0x3b33ce[_0xe543('0x28')]){delete _0x3b33ce[_0xe543('0x28')];}_0x399d85[_0xe543('0x20')](_0xc22738)['send'](_0x3b33ce);};}exports[_0xe543('0x29')]=function(_0x39ed98,_0x11900f){var _0x269698={},_0x594c85={},_0x2f7911={'count':0x0,'rows':[]};var _0xf7daf=_[_0xe543('0x2a')](db[_0xe543('0x2b')][_0xe543('0x2c')],function(_0x3cb3d5){return{'name':_0x3cb3d5[_0xe543('0x2d')],'type':_0x3cb3d5[_0xe543('0x2e')][_0xe543('0x2f')]};});_0x594c85[_0xe543('0x30')]=_[_0xe543('0x2a')](_0xf7daf,'name');_0x594c85[_0xe543('0x31')]=_['keys'](_0x39ed98['query']);_0x594c85['filters']=_[_0xe543('0x32')](_0x594c85[_0xe543('0x30')],_0x594c85['query']);_0x269698[_0xe543('0x33')]=_[_0xe543('0x32')](_0x594c85[_0xe543('0x30')],qs[_0xe543('0x34')](_0x39ed98['query'][_0xe543('0x34')]));_0x269698[_0xe543('0x33')]=_0x269698[_0xe543('0x33')][_0xe543('0x35')]?_0x269698['attributes']:_0x594c85[_0xe543('0x30')];if(!_0x39ed98[_0xe543('0x31')][_0xe543('0x36')](_0xe543('0x37'))){_0x269698['limit']=qs[_0xe543('0x1e')](_0x39ed98[_0xe543('0x31')][_0xe543('0x1e')]);_0x269698[_0xe543('0x1c')]=qs[_0xe543('0x1c')](_0x39ed98[_0xe543('0x31')][_0xe543('0x1c')]);}_0x269698[_0xe543('0x38')]=qs[_0xe543('0x39')](_0x39ed98['query']['sort']);_0x269698[_0xe543('0x3a')]=qs[_0xe543('0x3b')](_[_0xe543('0x3c')](_0x39ed98[_0xe543('0x31')],_0x594c85['filters']),_0xf7daf);if(_0x39ed98['query'][_0xe543('0x3d')]){_0x269698[_0xe543('0x3a')]=_[_0xe543('0x3e')](_0x269698[_0xe543('0x3a')],{'$or':_[_0xe543('0x2a')](_0xf7daf,function(_0x5bb2c4){if(_0x5bb2c4[_0xe543('0x2e')]!==_0xe543('0x3f')){var _0x6a8f1b={};_0x6a8f1b[_0x5bb2c4[_0xe543('0x28')]]={'$like':'%'+_0x39ed98[_0xe543('0x31')][_0xe543('0x3d')]+'%'};return _0x6a8f1b;}})});}_0x269698=_['merge']({},_0x269698,_0x39ed98[_0xe543('0x40')]);var _0x10609f={'where':_0x269698[_0xe543('0x3a')]};return db[_0xe543('0x2b')]['count'](_0x10609f)[_0xe543('0x41')](function(_0x30115f){_0x2f7911[_0xe543('0x1f')]=_0x30115f;if(_0x39ed98[_0xe543('0x31')][_0xe543('0x42')]){_0x269698[_0xe543('0x43')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xe543('0x44')](_0x269698);})['then'](function(_0x14b278){_0x2f7911['rows']=_0x14b278;return _0x2f7911;})[_0xe543('0x41')](respondWithFilteredResult(_0x11900f,_0x269698))[_0xe543('0x45')](handleError(_0x11900f,null));};exports[_0xe543('0x46')]=function(_0x20fe4a,_0xeff25c){var _0x41b8e6={'raw':![],'where':{'id':_0x20fe4a[_0xe543('0x47')]['id']}},_0x530b5e={};_0x530b5e[_0xe543('0x30')]=_[_0xe543('0x48')](db[_0xe543('0x2b')][_0xe543('0x2c')]);_0x530b5e[_0xe543('0x31')]=_[_0xe543('0x48')](_0x20fe4a[_0xe543('0x31')]);_0x530b5e[_0xe543('0x3b')]=_[_0xe543('0x32')](_0x530b5e[_0xe543('0x30')],_0x530b5e[_0xe543('0x31')]);_0x41b8e6[_0xe543('0x33')]=_[_0xe543('0x32')](_0x530b5e['model'],qs[_0xe543('0x34')](_0x20fe4a['query'][_0xe543('0x34')]));_0x41b8e6[_0xe543('0x33')]=_0x41b8e6['attributes']['length']?_0x41b8e6['attributes']:_0x530b5e['model'];if(_0x20fe4a[_0xe543('0x31')][_0xe543('0x42')]){_0x41b8e6[_0xe543('0x43')]=[{'all':!![]}];}_0x41b8e6=_[_0xe543('0x3e')]({},_0x41b8e6,_0x20fe4a[_0xe543('0x40')]);return db[_0xe543('0x2b')][_0xe543('0x49')](_0x41b8e6)['then'](handleEntityNotFound(_0xeff25c,null))['then'](respondWithResult(_0xeff25c,null))[_0xe543('0x45')](handleError(_0xeff25c,null));};exports[_0xe543('0x4a')]=function(_0x8aae87,_0x32c43e){return db[_0xe543('0x2b')]['create'](_0x8aae87[_0xe543('0x4b')],{})[_0xe543('0x41')](respondWithResult(_0x32c43e,0xc9))['catch'](handleError(_0x32c43e,null));};exports[_0xe543('0x25')]=function(_0x21d634,_0x3f9080){if(_0x21d634[_0xe543('0x4b')]['id']){delete _0x21d634['body']['id'];}return db[_0xe543('0x2b')]['find']({'where':{'id':_0x21d634['params']['id']}})[_0xe543('0x41')](handleEntityNotFound(_0x3f9080,null))[_0xe543('0x41')](saveUpdates(_0x21d634[_0xe543('0x4b')],null))[_0xe543('0x41')](respondWithResult(_0x3f9080,null))['catch'](handleError(_0x3f9080,null));};exports[_0xe543('0x4c')]=function(_0x315337,_0x30cb9a){return db[_0xe543('0x2b')][_0xe543('0x49')]({'where':{'id':_0x315337['params']['id']}})[_0xe543('0x41')](handleEntityNotFound(_0x30cb9a,null))['then'](removeEntity(_0x30cb9a,null))[_0xe543('0x45')](handleError(_0x30cb9a,null));};exports[_0xe543('0x4d')]=function(_0x366416,_0x1d7baa,_0x26c049){var _0x45a07f={};var _0x4ebd02={};var _0x1cc099;var _0x5c5a1c;return db['ServicenowAccount'][_0xe543('0x4e')]({'where':{'id':_0x366416[_0xe543('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d7baa,null))[_0xe543('0x41')](function(_0x267793){if(_0x267793){_0x1cc099=_0x267793;_0x4ebd02[_0xe543('0x30')]=_[_0xe543('0x48')](db[_0xe543('0x4f')]['rawAttributes']);_0x4ebd02[_0xe543('0x31')]=_['keys'](_0x366416[_0xe543('0x31')]);_0x4ebd02[_0xe543('0x3b')]=_[_0xe543('0x32')](_0x4ebd02[_0xe543('0x30')],_0x4ebd02['query']);_0x45a07f['attributes']=_['intersection'](_0x4ebd02['model'],qs['fields'](_0x366416[_0xe543('0x31')]['fields']));_0x45a07f[_0xe543('0x33')]=_0x45a07f[_0xe543('0x33')][_0xe543('0x35')]?_0x45a07f[_0xe543('0x33')]:_0x4ebd02[_0xe543('0x30')];_0x45a07f[_0xe543('0x38')]=qs['sort'](_0x366416[_0xe543('0x31')][_0xe543('0x39')]);_0x45a07f['where']=qs[_0xe543('0x3b')](_['pick'](_0x366416[_0xe543('0x31')],_0x4ebd02[_0xe543('0x3b')]));if(_0x366416[_0xe543('0x31')][_0xe543('0x3d')]){_0x45a07f[_0xe543('0x3a')]=_['merge'](_0x45a07f[_0xe543('0x3a')],{'$or':_[_0xe543('0x2a')](_0x45a07f['attributes'],function(_0x275e3b){var _0x34c02a={};_0x34c02a[_0x275e3b]={'$like':'%'+_0x366416[_0xe543('0x31')][_0xe543('0x3d')]+'%'};return _0x34c02a;})});}_0x45a07f=_[_0xe543('0x3e')]({},_0x45a07f,_0x366416['options']);return _0x1cc099['getConfigurations'](_0x45a07f);}})['then'](function(_0x1b19c0){if(_0x1b19c0){_0x5c5a1c=_0x1b19c0['length'];if(!_0x366416[_0xe543('0x31')]['hasOwnProperty'](_0xe543('0x37'))){_0x45a07f[_0xe543('0x1e')]=qs[_0xe543('0x1e')](_0x366416[_0xe543('0x31')][_0xe543('0x1e')]);_0x45a07f['offset']=qs[_0xe543('0x1c')](_0x366416[_0xe543('0x31')][_0xe543('0x1c')]);}return _0x1cc099[_0xe543('0x4d')](_0x45a07f);}})[_0xe543('0x41')](function(_0xf882b7){if(_0xf882b7){return _0xf882b7?{'count':_0x5c5a1c,'rows':_0xf882b7}:null;}})['then'](respondWithResult(_0x1d7baa,null))[_0xe543('0x45')](handleError(_0x1d7baa,null));};exports[_0xe543('0x50')]=function(_0x40b422,_0x42ea55,_0x760ca5){if(_0x40b422['body']['id']){delete _0x40b422[_0xe543('0x4b')]['id'];}return db[_0xe543('0x2b')][_0xe543('0x4e')]({'where':{'id':_0x40b422[_0xe543('0x47')]['id']}})[_0xe543('0x41')](handleEntityNotFound(_0x42ea55,null))[_0xe543('0x41')](function(_0x32d30f){if(_0x32d30f){_0x40b422['body'][_0xe543('0x51')]=_0x32d30f['id'];_0x40b422['body'][_0xe543('0x52')]=integrations[_0xe543('0x53')](_0x40b422[_0xe543('0x4b')][_0xe543('0x54')],_0x40b422[_0xe543('0x4b')][_0xe543('0x2e')]);_0x40b422[_0xe543('0x4b')]['Descriptions']=integrations[_0xe543('0x55')](_0x40b422[_0xe543('0x4b')]['channel'],_0x40b422[_0xe543('0x4b')][_0xe543('0x2e')]);return db[_0xe543('0x4f')][_0xe543('0x4a')](_0x40b422[_0xe543('0x4b')],{'include':[{'model':db['ServicenowField'],'as':_0xe543('0x52')},{'model':db['ServicenowField'],'as':_0xe543('0x56')}]});}return null;})['then'](respondWithResult(_0x42ea55,null))[_0xe543('0x45')](handleError(_0x42ea55,null));};exports[_0xe543('0x57')]=function(_0x40da0d,_0x20d3de,_0xcadbdb){var _0x4c4056=['made_sla',_0xe543('0x58'),_0xe543('0x59'),_0xe543('0x5a'),_0xe543('0x5b'),'notify','incident_state','severity','category'];var _0x16c753=[_0xe543('0x5c'),_0xe543('0x5d'),_0xe543('0x5e'),'watch_list','upon_reject','sys_updated_on',_0xe543('0x5f'),_0xe543('0x58'),_0xe543('0x60'),'number',_0xe543('0x61'),'sys_updated_by',_0xe543('0x62'),_0xe543('0x63'),'sys_created_on','sys_domain','state',_0xe543('0x64'),'knowledge',_0xe543('0x38'),_0xe543('0x65'),_0xe543('0x66'),_0xe543('0x67'),_0xe543('0x68'),_0xe543('0x69'),_0xe543('0x6a'),_0xe543('0x6b'),_0xe543('0x6c'),_0xe543('0x6d'),_0xe543('0x6e'),_0xe543('0x6f'),_0xe543('0x70'),_0xe543('0x71'),_0xe543('0x72'),_0xe543('0x73'),_0xe543('0x74'),_0xe543('0x75'),_0xe543('0x76'),_0xe543('0x77'),_0xe543('0x78'),_0xe543('0x79'),_0xe543('0x5a'),_0xe543('0x7a'),'short_description',_0xe543('0x5b'),_0xe543('0x7b'),'delivery_task',_0xe543('0x7c'),_0xe543('0x7d'),_0xe543('0x7e'),'additional_assignee_list','description',_0xe543('0x7f'),_0xe543('0x80'),_0xe543('0x81'),'close_notes',_0xe543('0x82'),_0xe543('0x83'),_0xe543('0x84'),_0xe543('0x85'),'contact_type',_0xe543('0x86'),'incident_state','urgency',_0xe543('0x87'),'company',_0xe543('0x88'),_0xe543('0x89'),_0xe543('0x8a'),_0xe543('0x8b'),_0xe543('0x8c'),_0xe543('0x8d'),_0xe543('0x8e'),_0xe543('0x8f'),_0xe543('0x90'),_0xe543('0x91'),_0xe543('0x92'),_0xe543('0x93'),_0xe543('0x94'),_0xe543('0x95'),'correlation_id',_0xe543('0x96'),_0xe543('0x97')];var _0x483673='';var _0x361b42='';var _0x4ff75f=[];var _0x3984f4='';var _0x12e673='';var _0x247957=[];var _0x445431='';var _0x7a117f='';var _0x5b8750={};var _0x2afd2b='';return db[_0xe543('0x2b')][_0xe543('0x4e')]({'where':{'id':_0x40da0d['params']['id']},'attributes':['id',_0xe543('0x98'),'password','email','remoteUri',_0xe543('0x99')]})[_0xe543('0x41')](handleEntityNotFound(_0x20d3de,null))['then'](function(_0x11c62c){if(_0x11c62c){_0x2afd2b=_0x11c62c[_0xe543('0x9a')];var _0x21c01c=_0x2afd2b['slice'](-0x1);if(_0x21c01c==='/'){_0x2afd2b=_0x2afd2b[_0xe543('0x9b')](0x0,_0x2afd2b[_0xe543('0x9c')](_0x21c01c));}_0x7a117f=util[_0xe543('0x9d')](_0xe543('0x9e'),_0x2afd2b);_0x445431=util['format'](_0xe543('0x9f'),_0x2afd2b);_0x5b8750={'user':_0x11c62c[_0xe543('0x98')],'pass':_0x11c62c['password']};var _0xde1996={'method':_0xe543('0xa0'),'uri':_0x7a117f+_0xe543('0xa1'),'auth':_0x5b8750,'json':!![]};return rp(_0xde1996);}})[_0xe543('0x41')](function(_0x4cc74c){if(_0x4cc74c[_0xe543('0xa2')][_0xe543('0x35')]>0x0){_0x483673=_0x4cc74c[_0xe543('0xa2')];}console['log']('incident\x20table\x20objects',_0x483673);_0x247957=[];_0x361b42=Object[_0xe543('0xa3')]([],_0x483673);_['remove'](_0x361b42,function(_0x309983){return!_0x4c4056[_0xe543('0xa4')](_0x309983[_0xe543('0x28')]);});_0x361b42[_0xe543('0xa5')](function(_0x312e0c){var _0x34649c=createFieldObject(_0x445431,_0x5b8750,_0x312e0c[_0xe543('0xa6')],_0x312e0c['name'],_0x312e0c[_0xe543('0xa7')],![]);_0x247957[_0xe543('0xa8')](_0x34649c);});return Promise[_0xe543('0xa9')](_0x247957);})[_0xe543('0x41')](function(_0x47a564){_0x4ff75f=_0x47a564;_0x3984f4=Object[_0xe543('0xa3')]([],_0x483673);console['log']('TCL:\x20_object',_0x483673);_[_0xe543('0xaa')](_0x3984f4,function(_0x1f5333){return _0x16c753[_0xe543('0xa4')](_0x1f5333[_0xe543('0x28')]);});console[_0xe543('0xab')](_0xe543('0xac'),_0x3984f4);_0x247957=[];_0x3984f4[_0xe543('0xa5')](function(_0x44a8f6){var _0x17f774=createFieldObject(_0x445431,_0x5b8750,_0x44a8f6[_0xe543('0xa6')],_0x44a8f6[_0xe543('0x28')],_0x44a8f6[_0xe543('0xa7')],!![]);_0x247957[_0xe543('0xa8')](_0x17f774);});return Promise[_0xe543('0xa9')](_0x247957);})[_0xe543('0x41')](function(_0x453520){_0x12e673=_0x453520;var _0x26dac9=_0x4ff75f['concat'](_0x12e673);return{'count':_0x26dac9[_0xe543('0x35')],'rows':_0x26dac9};})['then'](respondWithResult(_0x20d3de,null))[_0xe543('0x45')](function(_0x4dffcf){console[_0xe543('0xab')](_0xe543('0xad')+_0x4dffcf);var _0x3a7cbc=_0x40da0d[_0xe543('0x31')][_0xe543('0xae')]?0x1f4:_0x4dffcf['statusCode']||0x1f4;logger[_0xe543('0x27')](_0x4dffcf['stack']);delete _0x4dffcf[_0xe543('0x28')];if(_0x3a7cbc===0x191){_0x3a7cbc=0x190;}_0x20d3de['status'](_0x3a7cbc)[_0xe543('0xaf')](_0x40da0d['query'][_0xe543('0xae')]?{'message':_0xe543('0xb0'),'statusCode':_0x4dffcf['statusCode']}:_0x4dffcf);});};function createFieldObject(_0x28ac31,_0x4bce5b,_0x462da0,_0x48d97f,_0x3158fe,_0xa21570){return new Promise(function(_0x109ce9,_0x304056){var _0x44410e={'id':_0x48d97f,'name':_0x3158fe,'custom':_0xa21570};if(_0x462da0==='boolean'){_0x44410e[_0xe543('0x40')]=[{'name':_0xe543('0xb1'),'value':_0xe543('0xb2')},{'name':_0xe543('0xb3'),'value':_0xe543('0xb4')}];_0x109ce9(_0x44410e);}else{var _0x56eae5={'method':_0xe543('0xa0'),'uri':_0x28ac31+'sys_choice?sysparm_query=name=incident^element='+_0x48d97f,'auth':_0x4bce5b,'json':!![]};return rp(_0x56eae5)[_0xe543('0x41')](function(_0x4d9182){var _0x2eadb1=[];if(_0x4d9182[_0xe543('0xa2')][_0xe543('0x35')]>0x0){_0x4d9182[_0xe543('0xa2')]['forEach'](function(_0x2f7508){if(_0x2f7508['inactive']==='false'){var _0x2a81e4={'name':_0x2f7508[_0xe543('0xa7')],'value':_0x2f7508['value']};_0x2eadb1[_0xe543('0xa8')](_0x2a81e4);}});}_0x44410e['options']=_0x2eadb1;if(_0x44410e[_0xe543('0x40')]['length']>0x0){_0x109ce9(_0x44410e);}else{if(_0xa21570==![]){_0x109ce9();}else{_0x109ce9(_0x44410e);}}});}});} \ No newline at end of file +var _0x2d3e=['password','remoteUri','serverUrl','substring','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','statusCode','test','Wrong\x20credentials','boolean','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','length','include','find','create','body','update','ServicenowConfiguration','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','work_start','assignment_group','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','incident_state','urgency','problem_id','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','location','username'];(function(_0x229344,_0x3af03d){var _0x426f93=function(_0x380924){while(--_0x380924){_0x229344['push'](_0x229344['shift']());}};_0x426f93(++_0x3af03d);}(_0x2d3e,0x17c));var _0xe2d3=function(_0x32c99a,_0x45ca14){_0x32c99a=_0x32c99a-0x0;var _0x5ee563=_0x2d3e[_0x32c99a];return _0x5ee563;};'use strict';var emlformat=require(_0xe2d3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe2d3('0x1'));var rp=require(_0xe2d3('0x2'));var moment=require('moment');var BPromise=require(_0xe2d3('0x3'));var Mustache=require('mustache');var util=require(_0xe2d3('0x4'));var path=require(_0xe2d3('0x5'));var sox=require('sox');var csv=require(_0xe2d3('0x6'));var ejs=require(_0xe2d3('0x7'));var fs=require('fs');var fs_extra=require(_0xe2d3('0x8'));var _=require(_0xe2d3('0x9'));var squel=require(_0xe2d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe2d3('0xb'));var toCsv=require(_0xe2d3('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe2d3('0xc'));var authService=require(_0xe2d3('0xd'));var qs=require(_0xe2d3('0xe'));var as=require(_0xe2d3('0xf'));var hardwareService=require(_0xe2d3('0x10'));var logger=require(_0xe2d3('0x11'))('api');var utils=require(_0xe2d3('0x12'));var config=require(_0xe2d3('0x13'));var licenseUtil=require(_0xe2d3('0x14'));var db=require(_0xe2d3('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bc7c3,_0x190a8f){_0x190a8f=_0x190a8f||0xcc;return function(_0x410324){if(_0x410324){return _0x5bc7c3[_0xe2d3('0x16')](_0x190a8f);}return _0x5bc7c3['status'](_0x190a8f)[_0xe2d3('0x17')]();};}function respondWithResult(_0x10b2de,_0x1b998c){_0x1b998c=_0x1b998c||0xc8;return function(_0x128c4d){if(_0x128c4d){return _0x10b2de[_0xe2d3('0x18')](_0x1b998c)['json'](_0x128c4d);}};}function respondWithFilteredResult(_0x52f668,_0x5afe8f){return function(_0xa60a65){if(_0xa60a65){var _0x3754bb=typeof _0x5afe8f['offset']==='undefined'&&typeof _0x5afe8f[_0xe2d3('0x19')]===_0xe2d3('0x1a');var _0x15aa2c=_0xa60a65['count'];var _0x5203fc=_0x3754bb?0x0:_0x5afe8f[_0xe2d3('0x1b')];var _0x585d60=_0x3754bb?_0xa60a65[_0xe2d3('0x1c')]:_0x5afe8f[_0xe2d3('0x1b')]+_0x5afe8f[_0xe2d3('0x19')];var _0x28dcea;if(_0x585d60>=_0x15aa2c){_0x585d60=_0x15aa2c;_0x28dcea=0xc8;}else{_0x28dcea=0xce;}_0x52f668[_0xe2d3('0x18')](_0x28dcea);return _0x52f668['set'](_0xe2d3('0x1d'),_0x5203fc+'-'+_0x585d60+'/'+_0x15aa2c)[_0xe2d3('0x1e')](_0xa60a65);}return null;};}function patchUpdates(_0x359e18){return function(_0x15f667){try{jsonpatch['apply'](_0x15f667,_0x359e18,!![]);}catch(_0x4b9abd){return BPromise[_0xe2d3('0x1f')](_0x4b9abd);}return _0x15f667[_0xe2d3('0x20')]();};}function saveUpdates(_0x3988df,_0x27d7a3){return function(_0x29d5f7){if(_0x29d5f7){return _0x29d5f7['update'](_0x3988df)[_0xe2d3('0x21')](function(_0x5f3c0b){return _0x5f3c0b;});}return null;};}function removeEntity(_0x19e27e,_0x57b20b){return function(_0x2cd436){if(_0x2cd436){return _0x2cd436[_0xe2d3('0x22')]()[_0xe2d3('0x21')](function(){_0x19e27e['status'](0xcc)[_0xe2d3('0x17')]();});}};}function handleEntityNotFound(_0x340e45,_0x5ebd22){return function(_0x410990){if(!_0x410990){_0x340e45[_0xe2d3('0x16')](0x194);}return _0x410990;};}function handleError(_0x4e78d3,_0x1947fb){_0x1947fb=_0x1947fb||0x1f4;return function(_0x386c5b){logger[_0xe2d3('0x23')](_0x386c5b[_0xe2d3('0x24')]);if(_0x386c5b[_0xe2d3('0x25')]){delete _0x386c5b[_0xe2d3('0x25')];}_0x4e78d3['status'](_0x1947fb)[_0xe2d3('0x26')](_0x386c5b);};}exports[_0xe2d3('0x27')]=function(_0x221dea,_0x4dc644){var _0x5ee65c={},_0x1f1014={},_0x243af9={'count':0x0,'rows':[]};var _0x22c3bb=_[_0xe2d3('0x28')](db[_0xe2d3('0x29')][_0xe2d3('0x2a')],function(_0x45cdce){return{'name':_0x45cdce[_0xe2d3('0x2b')],'type':_0x45cdce['type'][_0xe2d3('0x2c')]};});_0x1f1014['model']=_[_0xe2d3('0x28')](_0x22c3bb,'name');_0x1f1014[_0xe2d3('0x2d')]=_[_0xe2d3('0x2e')](_0x221dea['query']);_0x1f1014['filters']=_['intersection'](_0x1f1014[_0xe2d3('0x2f')],_0x1f1014[_0xe2d3('0x2d')]);_0x5ee65c[_0xe2d3('0x30')]=_[_0xe2d3('0x31')](_0x1f1014[_0xe2d3('0x2f')],qs[_0xe2d3('0x32')](_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x32')]));_0x5ee65c[_0xe2d3('0x30')]=_0x5ee65c[_0xe2d3('0x30')]['length']?_0x5ee65c['attributes']:_0x1f1014[_0xe2d3('0x2f')];if(!_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x33')](_0xe2d3('0x34'))){_0x5ee65c[_0xe2d3('0x19')]=qs['limit'](_0x221dea[_0xe2d3('0x2d')]['limit']);_0x5ee65c['offset']=qs[_0xe2d3('0x1b')](_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x1b')]);}_0x5ee65c[_0xe2d3('0x35')]=qs[_0xe2d3('0x36')](_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x36')]);_0x5ee65c['where']=qs['filters'](_[_0xe2d3('0x37')](_0x221dea[_0xe2d3('0x2d')],_0x1f1014[_0xe2d3('0x38')]),_0x22c3bb);if(_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x39')]){_0x5ee65c[_0xe2d3('0x3a')]=_['merge'](_0x5ee65c[_0xe2d3('0x3a')],{'$or':_[_0xe2d3('0x28')](_0x22c3bb,function(_0x2ff1c0){if(_0x2ff1c0[_0xe2d3('0x3b')]!==_0xe2d3('0x3c')){var _0xc5231a={};_0xc5231a[_0x2ff1c0[_0xe2d3('0x25')]]={'$like':'%'+_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x39')]+'%'};return _0xc5231a;}})});}_0x5ee65c=_[_0xe2d3('0x3d')]({},_0x5ee65c,_0x221dea[_0xe2d3('0x3e')]);var _0x1aa753={'where':_0x5ee65c[_0xe2d3('0x3a')]};return db['ServicenowAccount'][_0xe2d3('0x1c')](_0x1aa753)['then'](function(_0x245f1c){_0x243af9[_0xe2d3('0x1c')]=_0x245f1c;if(_0x221dea[_0xe2d3('0x2d')][_0xe2d3('0x3f')]){_0x5ee65c['include']=[{'all':!![]}];}return db[_0xe2d3('0x29')]['findAll'](_0x5ee65c);})[_0xe2d3('0x21')](function(_0x1bb93b){_0x243af9[_0xe2d3('0x40')]=_0x1bb93b;return _0x243af9;})[_0xe2d3('0x21')](respondWithFilteredResult(_0x4dc644,_0x5ee65c))[_0xe2d3('0x41')](handleError(_0x4dc644,null));};exports[_0xe2d3('0x42')]=function(_0x553a31,_0x2b7c16){var _0x4740c0={'raw':![],'where':{'id':_0x553a31[_0xe2d3('0x43')]['id']}},_0x39a7f5={};_0x39a7f5['model']=_[_0xe2d3('0x2e')](db[_0xe2d3('0x29')]['rawAttributes']);_0x39a7f5[_0xe2d3('0x2d')]=_[_0xe2d3('0x2e')](_0x553a31[_0xe2d3('0x2d')]);_0x39a7f5[_0xe2d3('0x38')]=_[_0xe2d3('0x31')](_0x39a7f5[_0xe2d3('0x2f')],_0x39a7f5[_0xe2d3('0x2d')]);_0x4740c0[_0xe2d3('0x30')]=_['intersection'](_0x39a7f5[_0xe2d3('0x2f')],qs[_0xe2d3('0x32')](_0x553a31[_0xe2d3('0x2d')]['fields']));_0x4740c0[_0xe2d3('0x30')]=_0x4740c0[_0xe2d3('0x30')][_0xe2d3('0x44')]?_0x4740c0[_0xe2d3('0x30')]:_0x39a7f5[_0xe2d3('0x2f')];if(_0x553a31['query'][_0xe2d3('0x3f')]){_0x4740c0[_0xe2d3('0x45')]=[{'all':!![]}];}_0x4740c0=_['merge']({},_0x4740c0,_0x553a31[_0xe2d3('0x3e')]);return db[_0xe2d3('0x29')][_0xe2d3('0x46')](_0x4740c0)[_0xe2d3('0x21')](handleEntityNotFound(_0x2b7c16,null))[_0xe2d3('0x21')](respondWithResult(_0x2b7c16,null))['catch'](handleError(_0x2b7c16,null));};exports[_0xe2d3('0x47')]=function(_0x414928,_0x2b6465){return db[_0xe2d3('0x29')][_0xe2d3('0x47')](_0x414928[_0xe2d3('0x48')],{})[_0xe2d3('0x21')](respondWithResult(_0x2b6465,0xc9))[_0xe2d3('0x41')](handleError(_0x2b6465,null));};exports[_0xe2d3('0x49')]=function(_0x56e952,_0x526b02){if(_0x56e952[_0xe2d3('0x48')]['id']){delete _0x56e952['body']['id'];}return db[_0xe2d3('0x29')][_0xe2d3('0x46')]({'where':{'id':_0x56e952[_0xe2d3('0x43')]['id']}})[_0xe2d3('0x21')](handleEntityNotFound(_0x526b02,null))[_0xe2d3('0x21')](saveUpdates(_0x56e952['body'],null))[_0xe2d3('0x21')](respondWithResult(_0x526b02,null))[_0xe2d3('0x41')](handleError(_0x526b02,null));};exports[_0xe2d3('0x22')]=function(_0x51d445,_0x417b22){return db['ServicenowAccount'][_0xe2d3('0x46')]({'where':{'id':_0x51d445[_0xe2d3('0x43')]['id']}})[_0xe2d3('0x21')](handleEntityNotFound(_0x417b22,null))[_0xe2d3('0x21')](removeEntity(_0x417b22,null))[_0xe2d3('0x41')](handleError(_0x417b22,null));};exports['getConfigurations']=function(_0x5a9dff,_0x296d93,_0x2e8b44){var _0x2e9a59={};var _0x5d15cd={};var _0x4c7c97;var _0x2db6a2;return db[_0xe2d3('0x29')]['findOne']({'where':{'id':_0x5a9dff[_0xe2d3('0x43')]['id']}})[_0xe2d3('0x21')](handleEntityNotFound(_0x296d93,null))['then'](function(_0x28bfc7){if(_0x28bfc7){_0x4c7c97=_0x28bfc7;_0x5d15cd[_0xe2d3('0x2f')]=_[_0xe2d3('0x2e')](db[_0xe2d3('0x4a')][_0xe2d3('0x2a')]);_0x5d15cd['query']=_['keys'](_0x5a9dff['query']);_0x5d15cd[_0xe2d3('0x38')]=_[_0xe2d3('0x31')](_0x5d15cd[_0xe2d3('0x2f')],_0x5d15cd[_0xe2d3('0x2d')]);_0x2e9a59[_0xe2d3('0x30')]=_[_0xe2d3('0x31')](_0x5d15cd['model'],qs[_0xe2d3('0x32')](_0x5a9dff[_0xe2d3('0x2d')][_0xe2d3('0x32')]));_0x2e9a59[_0xe2d3('0x30')]=_0x2e9a59[_0xe2d3('0x30')][_0xe2d3('0x44')]?_0x2e9a59[_0xe2d3('0x30')]:_0x5d15cd[_0xe2d3('0x2f')];_0x2e9a59[_0xe2d3('0x35')]=qs[_0xe2d3('0x36')](_0x5a9dff['query'][_0xe2d3('0x36')]);_0x2e9a59['where']=qs[_0xe2d3('0x38')](_['pick'](_0x5a9dff[_0xe2d3('0x2d')],_0x5d15cd[_0xe2d3('0x38')]));if(_0x5a9dff[_0xe2d3('0x2d')][_0xe2d3('0x39')]){_0x2e9a59[_0xe2d3('0x3a')]=_[_0xe2d3('0x3d')](_0x2e9a59['where'],{'$or':_[_0xe2d3('0x28')](_0x2e9a59[_0xe2d3('0x30')],function(_0x1964f6){var _0x1b3a63={};_0x1b3a63[_0x1964f6]={'$like':'%'+_0x5a9dff[_0xe2d3('0x2d')][_0xe2d3('0x39')]+'%'};return _0x1b3a63;})});}_0x2e9a59=_[_0xe2d3('0x3d')]({},_0x2e9a59,_0x5a9dff[_0xe2d3('0x3e')]);return _0x4c7c97[_0xe2d3('0x4b')](_0x2e9a59);}})[_0xe2d3('0x21')](function(_0x47c760){if(_0x47c760){_0x2db6a2=_0x47c760['length'];if(!_0x5a9dff[_0xe2d3('0x2d')][_0xe2d3('0x33')](_0xe2d3('0x34'))){_0x2e9a59['limit']=qs[_0xe2d3('0x19')](_0x5a9dff[_0xe2d3('0x2d')]['limit']);_0x2e9a59[_0xe2d3('0x1b')]=qs[_0xe2d3('0x1b')](_0x5a9dff[_0xe2d3('0x2d')]['offset']);}return _0x4c7c97[_0xe2d3('0x4b')](_0x2e9a59);}})['then'](function(_0x2a1827){if(_0x2a1827){return _0x2a1827?{'count':_0x2db6a2,'rows':_0x2a1827}:null;}})['then'](respondWithResult(_0x296d93,null))['catch'](handleError(_0x296d93,null));};exports['addConfiguration']=function(_0x1ff9ce,_0x501fd6,_0x331620){if(_0x1ff9ce[_0xe2d3('0x48')]['id']){delete _0x1ff9ce[_0xe2d3('0x48')]['id'];}return db[_0xe2d3('0x29')][_0xe2d3('0x4c')]({'where':{'id':_0x1ff9ce[_0xe2d3('0x43')]['id']}})[_0xe2d3('0x21')](handleEntityNotFound(_0x501fd6,null))['then'](function(_0xbfaa5e){if(_0xbfaa5e){_0x1ff9ce['body'][_0xe2d3('0x4d')]=_0xbfaa5e['id'];_0x1ff9ce['body'][_0xe2d3('0x4e')]=integrations[_0xe2d3('0x4f')](_0x1ff9ce[_0xe2d3('0x48')][_0xe2d3('0x50')],_0x1ff9ce[_0xe2d3('0x48')][_0xe2d3('0x3b')]);_0x1ff9ce['body'][_0xe2d3('0x51')]=integrations[_0xe2d3('0x52')](_0x1ff9ce[_0xe2d3('0x48')][_0xe2d3('0x50')],_0x1ff9ce[_0xe2d3('0x48')][_0xe2d3('0x3b')]);return db[_0xe2d3('0x4a')][_0xe2d3('0x47')](_0x1ff9ce[_0xe2d3('0x48')],{'include':[{'model':db[_0xe2d3('0x53')],'as':'Subjects'},{'model':db[_0xe2d3('0x53')],'as':_0xe2d3('0x51')}]});}return null;})[_0xe2d3('0x21')](respondWithResult(_0x501fd6,null))[_0xe2d3('0x41')](handleError(_0x501fd6,null));};exports[_0xe2d3('0x54')]=function(_0x539faf,_0xdc897e,_0xe0cabf){var _0x4b80b3=[_0xe2d3('0x55'),_0xe2d3('0x56'),_0xe2d3('0x57'),_0xe2d3('0x58'),_0xe2d3('0x59'),'notify','incident_state',_0xe2d3('0x5a'),_0xe2d3('0x5b')];var _0x3207fc=[_0xe2d3('0x5c'),_0xe2d3('0x55'),_0xe2d3('0x5d'),_0xe2d3('0x5e'),'upon_reject',_0xe2d3('0x5f'),_0xe2d3('0x60'),_0xe2d3('0x56'),_0xe2d3('0x61'),_0xe2d3('0x62'),'resolved_by',_0xe2d3('0x63'),'opened_by','user_input',_0xe2d3('0x64'),_0xe2d3('0x65'),'state',_0xe2d3('0x66'),_0xe2d3('0x57'),_0xe2d3('0x35'),_0xe2d3('0x67'),_0xe2d3('0x68'),_0xe2d3('0x69'),_0xe2d3('0x6a'),_0xe2d3('0x6b'),_0xe2d3('0x6c'),'work_notes_list',_0xe2d3('0x6d'),_0xe2d3('0x6e'),_0xe2d3('0x6f'),_0xe2d3('0x70'),_0xe2d3('0x71'),_0xe2d3('0x72'),_0xe2d3('0x73'),'business_duration',_0xe2d3('0x74'),_0xe2d3('0x75'),_0xe2d3('0x76'),_0xe2d3('0x77'),_0xe2d3('0x78'),_0xe2d3('0x79'),_0xe2d3('0x58'),'work_notes',_0xe2d3('0x7a'),'close_code',_0xe2d3('0x7b'),'delivery_task',_0xe2d3('0x7c'),_0xe2d3('0x7d'),'business_stc',_0xe2d3('0x7e'),_0xe2d3('0x7f'),_0xe2d3('0x80'),_0xe2d3('0x81'),_0xe2d3('0x82'),_0xe2d3('0x83'),_0xe2d3('0x84'),_0xe2d3('0x85'),'parent_incident','sys_id','contact_type','reopened_by',_0xe2d3('0x86'),_0xe2d3('0x87'),_0xe2d3('0x88'),'company',_0xe2d3('0x89'),'activity_due',_0xe2d3('0x8a'),_0xe2d3('0x5a'),_0xe2d3('0x8b'),'sla_due',_0xe2d3('0x8c'),_0xe2d3('0x8d'),_0xe2d3('0x8e'),_0xe2d3('0x8f'),_0xe2d3('0x90'),_0xe2d3('0x91'),'escalation','upon_approval','correlation_id',_0xe2d3('0x92'),_0xe2d3('0x5b')];var _0x3ea802='';var _0x40246a='';var _0x437c9c=[];var _0x52cf6d='';var _0x146047='';var _0x146751=[];var _0x3df638='';var _0x125d8d='';var _0x500035={};var _0x35c664='';return db[_0xe2d3('0x29')][_0xe2d3('0x4c')]({'where':{'id':_0x539faf['params']['id']},'attributes':['id',_0xe2d3('0x93'),_0xe2d3('0x94'),'email',_0xe2d3('0x95'),_0xe2d3('0x96')]})[_0xe2d3('0x21')](handleEntityNotFound(_0xdc897e,null))[_0xe2d3('0x21')](function(_0x23e59f){if(_0x23e59f){_0x35c664=_0x23e59f[_0xe2d3('0x95')];var _0x732a3b=_0x35c664['slice'](-0x1);if(_0x732a3b==='/'){_0x35c664=_0x35c664[_0xe2d3('0x97')](0x0,_0x35c664['lastIndexOf'](_0x732a3b));}_0x125d8d=util[_0xe2d3('0x98')]('%s/api/now/doc/table/schema/',_0x35c664);_0x3df638=util[_0xe2d3('0x98')](_0xe2d3('0x99'),_0x35c664);_0x500035={'user':_0x23e59f['username'],'pass':_0x23e59f[_0xe2d3('0x94')]};var _0x3a7921={'method':'GET','uri':_0x125d8d+_0xe2d3('0x9a'),'auth':_0x500035,'json':!![]};return rp(_0x3a7921);}})[_0xe2d3('0x21')](function(_0x413ebf){if(_0x413ebf[_0xe2d3('0x9b')][_0xe2d3('0x44')]>0x0){_0x3ea802=_0x413ebf[_0xe2d3('0x9b')];}console[_0xe2d3('0x9c')](_0xe2d3('0x9d'),_0x3ea802);_0x146751=[];_0x40246a=Object[_0xe2d3('0x9e')]([],_0x3ea802);_[_0xe2d3('0x9f')](_0x40246a,function(_0x3cbfdc){return!_0x4b80b3[_0xe2d3('0xa0')](_0x3cbfdc[_0xe2d3('0x25')]);});_0x40246a[_0xe2d3('0xa1')](function(_0x25e852){var _0x52b3f1=createFieldObject(_0x3df638,_0x500035,_0x25e852[_0xe2d3('0xa2')],_0x25e852[_0xe2d3('0x25')],_0x25e852[_0xe2d3('0xa3')],![]);_0x146751['push'](_0x52b3f1);});return Promise[_0xe2d3('0xa4')](_0x146751);})[_0xe2d3('0x21')](function(_0x23bf6b){_0x437c9c=_0x23bf6b;_0x52cf6d=Object[_0xe2d3('0x9e')]([],_0x3ea802);console[_0xe2d3('0x9c')](_0xe2d3('0xa5'),_0x3ea802);_[_0xe2d3('0x9f')](_0x52cf6d,function(_0x4096f1){return _0x3207fc[_0xe2d3('0xa0')](_0x4096f1[_0xe2d3('0x25')]);});console[_0xe2d3('0x9c')](_0xe2d3('0xa6'),_0x52cf6d);_0x146751=[];_0x52cf6d[_0xe2d3('0xa1')](function(_0x288b7b){var _0x3d958e=createFieldObject(_0x3df638,_0x500035,_0x288b7b['internalType'],_0x288b7b[_0xe2d3('0x25')],_0x288b7b[_0xe2d3('0xa3')],!![]);_0x146751[_0xe2d3('0xa7')](_0x3d958e);});return Promise[_0xe2d3('0xa4')](_0x146751);})[_0xe2d3('0x21')](function(_0x5999e9){_0x146047=_0x5999e9;var _0x57d7c2=_0x437c9c['concat'](_0x146047);return{'count':_0x57d7c2['length'],'rows':_0x57d7c2};})[_0xe2d3('0x21')](respondWithResult(_0xdc897e,null))['catch'](function(_0x1a5074){console[_0xe2d3('0x9c')]('ServiceNow\x20error:\x20'+_0x1a5074);var _0x42975a=_0x539faf[_0xe2d3('0x2d')]['test']?0x1f4:_0x1a5074[_0xe2d3('0xa8')]||0x1f4;logger['error'](_0x1a5074['stack']);delete _0x1a5074[_0xe2d3('0x25')];if(_0x42975a===0x191){_0x42975a=0x190;}_0xdc897e[_0xe2d3('0x18')](_0x42975a)[_0xe2d3('0x26')](_0x539faf[_0xe2d3('0x2d')][_0xe2d3('0xa9')]?{'message':_0xe2d3('0xaa'),'statusCode':_0x1a5074[_0xe2d3('0xa8')]}:_0x1a5074);});};function createFieldObject(_0x30226f,_0xbc9696,_0x2e24e2,_0x1b698d,_0x531fb4,_0x103b92){return new Promise(function(_0x3f084c,_0x4aef4c){var _0x1a614e={'id':_0x1b698d,'name':_0x531fb4,'custom':_0x103b92};if(_0x2e24e2===_0xe2d3('0xab')){_0x1a614e['options']=[{'name':'True','value':'true'},{'name':'False','value':_0xe2d3('0xac')}];_0x3f084c(_0x1a614e);}else{var _0x1630c8={'method':'GET','uri':_0x30226f+_0xe2d3('0xad')+_0x1b698d,'auth':_0xbc9696,'json':!![]};return rp(_0x1630c8)['then'](function(_0x5b8632){var _0xe7bd6=[];if(_0x5b8632['result'][_0xe2d3('0x44')]>0x0){_0x5b8632['result'][_0xe2d3('0xa1')](function(_0x33a35f){if(_0x33a35f[_0xe2d3('0xae')]===_0xe2d3('0xac')){var _0x585a11={'name':_0x33a35f['label'],'value':_0x33a35f[_0xe2d3('0xaf')]};_0xe7bd6[_0xe2d3('0xa7')](_0x585a11);}});}_0x1a614e[_0xe2d3('0x3e')]=_0xe7bd6;if(_0x1a614e['options'][_0xe2d3('0x44')]>0x0){_0x3f084c(_0x1a614e);}else{if(_0x103b92==![]){_0x3f084c();}else{_0x3f084c(_0x1a614e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index ba1f18e..4d4576c 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 _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes','exports','int_servicenow_accounts'];(function(_0x57da40,_0x1a3fe6){var _0x34df4f=function(_0x3e3d90){while(--_0x3e3d90){_0x57da40['push'](_0x57da40['shift']());}};_0x34df4f(++_0x1a3fe6);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x186020,_0x1fc7f9){_0x186020=_0x186020-0x0;var _0x30380a=_0xfdbd[_0x186020];return _0x30380a;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xdfdb('0xa')]=function(_0x41bd5e,_0x489f19){return _0x41bd5e['define']('ServicenowAccount',attributes,{'tableName':_0xdfdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0x159183,_0xb67a84){var _0x17eca7=function(_0x414087){while(--_0x414087){_0x159183['push'](_0x159183['shift']());}};_0x17eca7(++_0xb67a84);}(_0x2675,0x75));var _0x5267=function(_0x4e436f,_0x9c7bf4){_0x4e436f=_0x4e436f-0x0;var _0x2218a2=_0x2675[_0x4e436f];return _0x2218a2;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));var integrations=require(_0x5267('0x6'));module[_0x5267('0x7')]=function(_0x10f92c,_0x20f065){return _0x10f92c[_0x5267('0x8')]('ServicenowAccount',attributes,{'tableName':_0x5267('0x9'),'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 be567c6..2d92ecd 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 _0xb768=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','limit','include','model','attributes','map','ShowServicenowAccount','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then'];(function(_0x384447,_0x41669a){var _0x3810db=function(_0x3f1288){while(--_0x3f1288){_0x384447['push'](_0x384447['shift']());}};_0x3810db(++_0x41669a);}(_0xb768,0x7d));var _0x8b76=function(_0x53aaf8,_0x863bcb){_0x53aaf8=_0x53aaf8-0x0;var _0x1fedb1=_0xb768[_0x53aaf8];return _0x1fedb1;};'use strict';var _=require(_0x8b76('0x0'));var util=require('util');var moment=require(_0x8b76('0x1'));var BPromise=require(_0x8b76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b76('0x3'));var db=require(_0x8b76('0x4'))['db'];var utils=require(_0x8b76('0x5'));var logger=require(_0x8b76('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b76('0x7'));var client=jayson[_0x8b76('0x8')][_0x8b76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5478c3,_0x1f5d0e,_0x3855ae){return new BPromise(function(_0x24b778,_0x5afae5){return client['request'](_0x5478c3,_0x3855ae)[_0x8b76('0xa')](function(_0x5b1e29){logger[_0x8b76('0xb')](_0x8b76('0xc'),_0x1f5d0e,_0x8b76('0xd'));logger[_0x8b76('0xe')](_0x8b76('0xf'),_0x1f5d0e,_0x8b76('0xd'),JSON[_0x8b76('0x10')](_0x5b1e29));if(_0x5b1e29['error']){if(_0x5b1e29[_0x8b76('0x11')]['code']===0x1f4){logger[_0x8b76('0x11')](_0x8b76('0xc'),_0x1f5d0e,_0x5b1e29[_0x8b76('0x11')][_0x8b76('0x12')]);return _0x5afae5(_0x5b1e29[_0x8b76('0x11')][_0x8b76('0x12')]);}logger[_0x8b76('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1f5d0e,_0x5b1e29[_0x8b76('0x11')]['message']);return _0x24b778(_0x5b1e29['error']['message']);}else{logger[_0x8b76('0xb')](_0x8b76('0xc'),_0x1f5d0e,'request\x20sent');_0x24b778(_0x5b1e29[_0x8b76('0x13')][_0x8b76('0x12')]);}})[_0x8b76('0x14')](function(_0xdb2928){logger[_0x8b76('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1f5d0e,_0xdb2928);_0x5afae5(_0xdb2928);});});}exports[_0x8b76('0x15')]=function(_0x5838ce){var _0x53274=this;return new Promise(function(_0xa00f2,_0x29de95){return db[_0x8b76('0x16')][_0x8b76('0x17')]({'raw':_0x5838ce[_0x8b76('0x18')]?_0x5838ce[_0x8b76('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5838ce[_0x8b76('0x18')]?_0x5838ce[_0x8b76('0x18')][_0x8b76('0x19')]||null:null,'attributes':_0x5838ce[_0x8b76('0x18')]?_0x5838ce['options']['attributes']||null:null,'limit':_0x5838ce[_0x8b76('0x18')]?_0x5838ce[_0x8b76('0x18')][_0x8b76('0x1a')]||null:null,'include':_0x5838ce['options']?_0x5838ce[_0x8b76('0x18')][_0x8b76('0x1b')]?_['map'](_0x5838ce['options'][_0x8b76('0x1b')],function(_0x5aeb99){return{'model':db[_0x5aeb99[_0x8b76('0x1c')]],'as':_0x5aeb99['as'],'attributes':_0x5aeb99[_0x8b76('0x1d')],'include':_0x5aeb99[_0x8b76('0x1b')]?_[_0x8b76('0x1e')](_0x5aeb99[_0x8b76('0x1b')],function(_0x11189d){return{'model':db[_0x11189d['model']],'as':_0x11189d['as'],'attributes':_0x11189d['attributes'],'include':_0x11189d[_0x8b76('0x1b')]?_[_0x8b76('0x1e')](_0x11189d[_0x8b76('0x1b')],function(_0x128668){return{'model':db[_0x128668[_0x8b76('0x1c')]],'as':_0x128668['as'],'attributes':_0x128668['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44f404){logger[_0x8b76('0xb')](_0x8b76('0x15'),_0x5838ce);logger[_0x8b76('0xe')]('GetServicenowAccount',_0x5838ce,JSON['stringify'](_0x44f404));_0xa00f2(_0x44f404);})[_0x8b76('0x14')](function(_0x2e1d76){logger['error']('GetServicenowAccount',_0x2e1d76['message'],_0x5838ce);_0x29de95(_0x53274[_0x8b76('0x11')](0x1f4,_0x2e1d76[_0x8b76('0x12')]));});});};exports[_0x8b76('0x1f')]=function(_0x41d77c){var _0x21abbb=this;return new Promise(function(_0x3dbc31,_0x26f4fc){return db[_0x8b76('0x16')][_0x8b76('0x20')]({'raw':_0x41d77c['options']?_0x41d77c[_0x8b76('0x18')][_0x8b76('0x21')]===undefined?!![]:![]:!![],'where':_0x41d77c[_0x8b76('0x18')]?_0x41d77c['options'][_0x8b76('0x19')]||null:null,'attributes':_0x41d77c[_0x8b76('0x18')]?_0x41d77c['options'][_0x8b76('0x1d')]||null:null,'include':_0x41d77c['options']?_0x41d77c[_0x8b76('0x18')]['include']?_[_0x8b76('0x1e')](_0x41d77c[_0x8b76('0x18')]['include'],function(_0x461924){return{'model':db[_0x461924[_0x8b76('0x1c')]],'as':_0x461924['as'],'attributes':_0x461924['attributes'],'include':_0x461924['include']?_[_0x8b76('0x1e')](_0x461924['include'],function(_0x4236d2){return{'model':db[_0x4236d2['model']],'as':_0x4236d2['as'],'attributes':_0x4236d2['attributes'],'include':_0x4236d2[_0x8b76('0x1b')]?_[_0x8b76('0x1e')](_0x4236d2[_0x8b76('0x1b')],function(_0x5ab669){return{'model':db[_0x5ab669[_0x8b76('0x1c')]],'as':_0x5ab669['as'],'attributes':_0x5ab669[_0x8b76('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8b76('0xa')](function(_0x50c52f){logger['info'](_0x8b76('0x1f'),_0x41d77c);logger[_0x8b76('0xe')]('ShowServicenowAccount',_0x41d77c,JSON[_0x8b76('0x10')](_0x50c52f));_0x3dbc31(_0x50c52f);})['catch'](function(_0x42bb27){logger[_0x8b76('0x11')](_0x8b76('0x1f'),_0x42bb27[_0x8b76('0x12')],_0x41d77c);_0x26f4fc(_0x21abbb[_0x8b76('0x11')](0x1f4,_0x42bb27[_0x8b76('0x12')]));});});}; \ No newline at end of file +var _0x7409=['map','model','attributes','then','debug','catch','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','GetServicenowAccount','ServicenowAccount','options','raw','where','limit','include'];(function(_0x8e8849,_0x39e175){var _0x46d9dc=function(_0x5a56a8){while(--_0x5a56a8){_0x8e8849['push'](_0x8e8849['shift']());}};_0x46d9dc(++_0x39e175);}(_0x7409,0x6e));var _0x9740=function(_0x5a9fb9,_0xb126c4){_0x5a9fb9=_0x5a9fb9-0x0;var _0x110430=_0x7409[_0x5a9fb9];return _0x110430;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var moment=require('moment');var BPromise=require(_0x9740('0x2'));var rs=require(_0x9740('0x3'));var fs=require('fs');var Redis=require(_0x9740('0x4'));var db=require(_0x9740('0x5'))['db'];var utils=require(_0x9740('0x6'));var logger=require(_0x9740('0x7'))(_0x9740('0x8'));var config=require(_0x9740('0x9'));var jayson=require(_0x9740('0xa'));var client=jayson['client'][_0x9740('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x96d19c,_0x2929cd,_0x529edf){return new BPromise(function(_0x279226,_0x2dc9a6){return client[_0x9740('0xc')](_0x96d19c,_0x529edf)['then'](function(_0x142319){logger['info'](_0x9740('0xd'),_0x2929cd,_0x9740('0xe'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2929cd,'request\x20sent',JSON[_0x9740('0xf')](_0x142319));if(_0x142319[_0x9740('0x10')]){if(_0x142319[_0x9740('0x10')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2929cd,_0x142319['error']['message']);return _0x2dc9a6(_0x142319['error']['message']);}logger[_0x9740('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x2929cd,_0x142319['error'][_0x9740('0x11')]);return _0x279226(_0x142319['error'][_0x9740('0x11')]);}else{logger[_0x9740('0x12')](_0x9740('0xd'),_0x2929cd,_0x9740('0xe'));_0x279226(_0x142319['result'][_0x9740('0x11')]);}})['catch'](function(_0x35e98c){logger[_0x9740('0x10')](_0x9740('0xd'),_0x2929cd,_0x35e98c);_0x2dc9a6(_0x35e98c);});});}exports[_0x9740('0x13')]=function(_0x22843a){var _0xa6cedd=this;return new Promise(function(_0xd5d590,_0x1c8210){return db[_0x9740('0x14')]['findAll']({'raw':_0x22843a[_0x9740('0x15')]?_0x22843a[_0x9740('0x15')][_0x9740('0x16')]===undefined?!![]:![]:!![],'where':_0x22843a[_0x9740('0x15')]?_0x22843a[_0x9740('0x15')][_0x9740('0x17')]||null:null,'attributes':_0x22843a[_0x9740('0x15')]?_0x22843a[_0x9740('0x15')]['attributes']||null:null,'limit':_0x22843a[_0x9740('0x15')]?_0x22843a['options'][_0x9740('0x18')]||null:null,'include':_0x22843a[_0x9740('0x15')]?_0x22843a[_0x9740('0x15')][_0x9740('0x19')]?_[_0x9740('0x1a')](_0x22843a[_0x9740('0x15')]['include'],function(_0x2550f2){return{'model':db[_0x2550f2[_0x9740('0x1b')]],'as':_0x2550f2['as'],'attributes':_0x2550f2[_0x9740('0x1c')],'include':_0x2550f2[_0x9740('0x19')]?_[_0x9740('0x1a')](_0x2550f2[_0x9740('0x19')],function(_0x15aa2f){return{'model':db[_0x15aa2f[_0x9740('0x1b')]],'as':_0x15aa2f['as'],'attributes':_0x15aa2f[_0x9740('0x1c')],'include':_0x15aa2f['include']?_[_0x9740('0x1a')](_0x15aa2f['include'],function(_0x4e5074){return{'model':db[_0x4e5074['model']],'as':_0x4e5074['as'],'attributes':_0x4e5074['attributes']};}):[]};}):[]};}):[]:[]})[_0x9740('0x1d')](function(_0x169d65){logger[_0x9740('0x12')]('GetServicenowAccount',_0x22843a);logger[_0x9740('0x1e')](_0x9740('0x13'),_0x22843a,JSON[_0x9740('0xf')](_0x169d65));_0xd5d590(_0x169d65);})[_0x9740('0x1f')](function(_0x4cdccd){logger[_0x9740('0x10')](_0x9740('0x13'),_0x4cdccd[_0x9740('0x11')],_0x22843a);_0x1c8210(_0xa6cedd['error'](0x1f4,_0x4cdccd[_0x9740('0x11')]));});});};exports[_0x9740('0x20')]=function(_0x1fdd06){var _0x2bba86=this;return new Promise(function(_0x3dcc58,_0x194451){return db[_0x9740('0x14')][_0x9740('0x21')]({'raw':_0x1fdd06[_0x9740('0x15')]?_0x1fdd06[_0x9740('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1fdd06[_0x9740('0x15')]?_0x1fdd06[_0x9740('0x15')][_0x9740('0x17')]||null:null,'attributes':_0x1fdd06[_0x9740('0x15')]?_0x1fdd06[_0x9740('0x15')][_0x9740('0x1c')]||null:null,'include':_0x1fdd06['options']?_0x1fdd06[_0x9740('0x15')]['include']?_['map'](_0x1fdd06[_0x9740('0x15')][_0x9740('0x19')],function(_0x431fae){return{'model':db[_0x431fae[_0x9740('0x1b')]],'as':_0x431fae['as'],'attributes':_0x431fae[_0x9740('0x1c')],'include':_0x431fae['include']?_[_0x9740('0x1a')](_0x431fae[_0x9740('0x19')],function(_0x2f4f6e){return{'model':db[_0x2f4f6e[_0x9740('0x1b')]],'as':_0x2f4f6e['as'],'attributes':_0x2f4f6e[_0x9740('0x1c')],'include':_0x2f4f6e[_0x9740('0x19')]?_[_0x9740('0x1a')](_0x2f4f6e[_0x9740('0x19')],function(_0x33bb9c){return{'model':db[_0x33bb9c[_0x9740('0x1b')]],'as':_0x33bb9c['as'],'attributes':_0x33bb9c[_0x9740('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9740('0x1d')](function(_0x19920d){logger[_0x9740('0x12')](_0x9740('0x20'),_0x1fdd06);logger[_0x9740('0x1e')](_0x9740('0x20'),_0x1fdd06,JSON[_0x9740('0xf')](_0x19920d));_0x3dcc58(_0x19920d);})[_0x9740('0x1f')](function(_0xb9c606){logger[_0x9740('0x10')](_0x9740('0x20'),_0xb9c606['message'],_0x1fdd06);_0x194451(_0x2bba86[_0x9740('0x10')](0x1f4,_0xb9c606['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f592ce7..2d3d988 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 _0xf3e6=['isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x18af92,_0xd3b64){var _0x1e7ff1=function(_0x56620c){while(--_0x56620c){_0x18af92['push'](_0x18af92['shift']());}};_0x1e7ff1(++_0xd3b64);}(_0xf3e6,0xe8));var _0x6f3e=function(_0x225470,_0x3fdb2e){_0x225470=_0x225470-0x0;var _0x1a6d59=_0xf3e6[_0x225470];return _0x1a6d59;};'use strict';var multer=require(_0x6f3e('0x0'));var util=require(_0x6f3e('0x1'));var path=require('path');var timeout=require(_0x6f3e('0x2'));var express=require(_0x6f3e('0x3'));var router=express[_0x6f3e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f3e('0x5'));var controller=require(_0x6f3e('0x6'));router[_0x6f3e('0x7')]('/',auth[_0x6f3e('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6f3e('0x9')]);router[_0x6f3e('0x7')](_0x6f3e('0xa'),auth[_0x6f3e('0x8')](),controller['getFields']);router[_0x6f3e('0x7')](_0x6f3e('0xb'),auth[_0x6f3e('0x8')](),controller[_0x6f3e('0xc')]);router[_0x6f3e('0x7')]('/:id/descriptions',auth[_0x6f3e('0x8')](),controller[_0x6f3e('0xd')]);router[_0x6f3e('0xe')]('/',auth[_0x6f3e('0x8')](),controller[_0x6f3e('0xf')]);router['put'](_0x6f3e('0x10'),auth[_0x6f3e('0x8')](),controller[_0x6f3e('0x11')]);router[_0x6f3e('0x12')](_0x6f3e('0x10'),auth[_0x6f3e('0x8')](),controller['destroy']);module[_0x6f3e('0x13')]=router; \ No newline at end of file +var _0x2e8f=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','post'];(function(_0x296378,_0x131677){var _0x5880d5=function(_0x1b122e){while(--_0x1b122e){_0x296378['push'](_0x296378['shift']());}};_0x5880d5(++_0x131677);}(_0x2e8f,0x79));var _0xf2e8=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x2e8f[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xf2e8('0x0'));var util=require('util');var path=require(_0xf2e8('0x1'));var timeout=require(_0xf2e8('0x2'));var express=require(_0xf2e8('0x3'));var router=express[_0xf2e8('0x4')]();var fs_extra=require(_0xf2e8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf2e8('0x6'));var controller=require(_0xf2e8('0x7'));router[_0xf2e8('0x8')]('/',auth['isAuthenticated'](),controller[_0xf2e8('0x9')]);router[_0xf2e8('0x8')](_0xf2e8('0xa'),auth[_0xf2e8('0xb')](),controller['show']);router[_0xf2e8('0x8')]('/:id/fields',auth[_0xf2e8('0xb')](),controller[_0xf2e8('0xc')]);router[_0xf2e8('0x8')](_0xf2e8('0xd'),auth[_0xf2e8('0xb')](),controller[_0xf2e8('0xe')]);router[_0xf2e8('0x8')]('/:id/descriptions',auth[_0xf2e8('0xb')](),controller[_0xf2e8('0xf')]);router[_0xf2e8('0x10')]('/',auth[_0xf2e8('0xb')](),controller[_0xf2e8('0x11')]);router[_0xf2e8('0x12')](_0xf2e8('0xa'),auth[_0xf2e8('0xb')](),controller[_0xf2e8('0x13')]);router[_0xf2e8('0x14')](_0xf2e8('0xa'),auth[_0xf2e8('0xb')](),controller[_0xf2e8('0x15')]);module[_0xf2e8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d395381..2e59e29 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 _0x36eb=['STRING','sequelize','exports'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x36eb,0x7c));var _0xb36e=function(_0x17a82c,_0x516120){_0x17a82c=_0x17a82c-0x0;var _0x4ccc98=_0x36eb[_0x17a82c];return _0x4ccc98;};'use strict';var Sequelize=require(_0xb36e('0x0'));module[_0xb36e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb36e('0x2')]}}; \ No newline at end of file +var _0xfb8b=['sequelize','exports','STRING'];(function(_0x14637b,_0x1f1073){var _0x493860=function(_0x35471d){while(--_0x35471d){_0x14637b['push'](_0x14637b['shift']());}};_0x493860(++_0x1f1073);}(_0xfb8b,0x114));var _0xbfb8=function(_0x40dea0,_0x2cfa79){_0x40dea0=_0x40dea0-0x0;var _0x2a6ccb=_0xfb8b[_0x40dea0];return _0x2a6ccb;};'use strict';var Sequelize=require(_0xbfb8('0x0'));module[_0xbfb8('0x1')]={'name':{'type':Sequelize[_0xbfb8('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d5e26cf..48d7d40 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 _0x1427=['sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','ServicenowConfiguration','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','getSubjects','ServicenowField','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','key','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','limit','order'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1427,0x1a9));var _0x7142=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1427[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7142('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7142('0x1'));var rp=require(_0x7142('0x2'));var moment=require(_0x7142('0x3'));var BPromise=require(_0x7142('0x4'));var Mustache=require(_0x7142('0x5'));var util=require(_0x7142('0x6'));var path=require(_0x7142('0x7'));var sox=require('sox');var csv=require(_0x7142('0x8'));var ejs=require(_0x7142('0x9'));var fs=require('fs');var fs_extra=require(_0x7142('0xa'));var _=require(_0x7142('0xb'));var squel=require(_0x7142('0xc'));var crypto=require(_0x7142('0xd'));var jsforce=require(_0x7142('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7142('0x8'));var querystring=require(_0x7142('0xf'));var Papa=require(_0x7142('0x10'));var Redis=require(_0x7142('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7142('0x12'));var as=require(_0x7142('0x13'));var hardwareService=require(_0x7142('0x14'));var logger=require(_0x7142('0x15'))(_0x7142('0x16'));var utils=require(_0x7142('0x17'));var config=require(_0x7142('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58726d,_0x44a7dc){_0x44a7dc=_0x44a7dc||0xcc;return function(_0x489212){if(_0x489212){return _0x58726d['sendStatus'](_0x44a7dc);}return _0x58726d[_0x7142('0x19')](_0x44a7dc)[_0x7142('0x1a')]();};}function respondWithResult(_0x50a1ce,_0x15f625){_0x15f625=_0x15f625||0xc8;return function(_0x2449d5){if(_0x2449d5){return _0x50a1ce[_0x7142('0x19')](_0x15f625)[_0x7142('0x1b')](_0x2449d5);}};}function respondWithFilteredResult(_0x44fa4e,_0x56ae90){return function(_0x5ee049){if(_0x5ee049){var _0x444c78=typeof _0x56ae90[_0x7142('0x1c')]===_0x7142('0x1d')&&typeof _0x56ae90['limit']===_0x7142('0x1d');var _0x10ab83=_0x5ee049[_0x7142('0x1e')];var _0x5aea06=_0x444c78?0x0:_0x56ae90['offset'];var _0x356a86=_0x444c78?_0x5ee049[_0x7142('0x1e')]:_0x56ae90[_0x7142('0x1c')]+_0x56ae90['limit'];var _0x149422;if(_0x356a86>=_0x10ab83){_0x356a86=_0x10ab83;_0x149422=0xc8;}else{_0x149422=0xce;}_0x44fa4e[_0x7142('0x19')](_0x149422);return _0x44fa4e['set'](_0x7142('0x1f'),_0x5aea06+'-'+_0x356a86+'/'+_0x10ab83)[_0x7142('0x1b')](_0x5ee049);}return null;};}function patchUpdates(_0x41c97b){return function(_0x5a79a7){try{jsonpatch[_0x7142('0x20')](_0x5a79a7,_0x41c97b,!![]);}catch(_0x8762ff){return BPromise[_0x7142('0x21')](_0x8762ff);}return _0x5a79a7['save']();};}function saveUpdates(_0x526e7d,_0x2560e6){return function(_0x3ca2ab){if(_0x3ca2ab){return _0x3ca2ab[_0x7142('0x22')](_0x526e7d)[_0x7142('0x23')](function(_0x517a0d){return _0x517a0d;});}return null;};}function removeEntity(_0x4b9e28,_0x3f8125){return function(_0x2fc22e){if(_0x2fc22e){return _0x2fc22e[_0x7142('0x24')]()['then'](function(){_0x4b9e28[_0x7142('0x19')](0xcc)[_0x7142('0x1a')]();});}};}function handleEntityNotFound(_0x219f05,_0x20e190){return function(_0x2955b5){if(!_0x2955b5){_0x219f05['sendStatus'](0x194);}return _0x2955b5;};}function handleError(_0x661c08,_0x302f01){_0x302f01=_0x302f01||0x1f4;return function(_0x566621){logger[_0x7142('0x25')](_0x566621['stack']);if(_0x566621[_0x7142('0x26')]){delete _0x566621[_0x7142('0x26')];}_0x661c08[_0x7142('0x19')](_0x302f01)[_0x7142('0x27')](_0x566621);};}exports[_0x7142('0x28')]=function(_0x241104,_0x3aac26){var _0x545533={},_0x214226={},_0x5c0573={'count':0x0,'rows':[]};var _0x4ee0b5=_[_0x7142('0x29')](db['ServicenowConfiguration']['rawAttributes'],function(_0x17f8c){return{'name':_0x17f8c['fieldName'],'type':_0x17f8c['type'][_0x7142('0x2a')]};});_0x214226['model']=_[_0x7142('0x29')](_0x4ee0b5,_0x7142('0x26'));_0x214226['query']=_[_0x7142('0x2b')](_0x241104[_0x7142('0x2c')]);_0x214226[_0x7142('0x2d')]=_['intersection'](_0x214226['model'],_0x214226['query']);_0x545533['attributes']=_[_0x7142('0x2e')](_0x214226['model'],qs[_0x7142('0x2f')](_0x241104[_0x7142('0x2c')][_0x7142('0x2f')]));_0x545533[_0x7142('0x30')]=_0x545533[_0x7142('0x30')][_0x7142('0x31')]?_0x545533[_0x7142('0x30')]:_0x214226[_0x7142('0x32')];if(!_0x241104['query'][_0x7142('0x33')](_0x7142('0x34'))){_0x545533[_0x7142('0x35')]=qs[_0x7142('0x35')](_0x241104[_0x7142('0x2c')][_0x7142('0x35')]);_0x545533[_0x7142('0x1c')]=qs[_0x7142('0x1c')](_0x241104['query']['offset']);}_0x545533[_0x7142('0x36')]=qs[_0x7142('0x37')](_0x241104['query'][_0x7142('0x37')]);_0x545533[_0x7142('0x38')]=qs[_0x7142('0x2d')](_[_0x7142('0x39')](_0x241104['query'],_0x214226['filters']),_0x4ee0b5);if(_0x241104[_0x7142('0x2c')][_0x7142('0x3a')]){_0x545533[_0x7142('0x38')]=_['merge'](_0x545533['where'],{'$or':_[_0x7142('0x29')](_0x4ee0b5,function(_0x353922){if(_0x353922[_0x7142('0x3b')]!==_0x7142('0x3c')){var _0x5c37c9={};_0x5c37c9[_0x353922['name']]={'$like':'%'+_0x241104[_0x7142('0x2c')][_0x7142('0x3a')]+'%'};return _0x5c37c9;}})});}_0x545533=_[_0x7142('0x3d')]({},_0x545533,_0x241104[_0x7142('0x3e')]);var _0xbc527b={'where':_0x545533[_0x7142('0x38')]};return db['ServicenowConfiguration']['count'](_0xbc527b)[_0x7142('0x23')](function(_0x1b0c9e){_0x5c0573['count']=_0x1b0c9e;if(_0x241104['query'][_0x7142('0x3f')]){_0x545533[_0x7142('0x40')]=[{'all':!![]}];}return db[_0x7142('0x41')][_0x7142('0x42')](_0x545533);})['then'](function(_0x3f10a3){_0x5c0573[_0x7142('0x43')]=_0x3f10a3;return _0x5c0573;})['then'](respondWithFilteredResult(_0x3aac26,_0x545533))[_0x7142('0x44')](handleError(_0x3aac26,null));};exports[_0x7142('0x45')]=function(_0x50b0b8,_0x35619b){var _0x144106={'raw':![],'where':{'id':_0x50b0b8[_0x7142('0x46')]['id']}},_0x4a7737={};_0x4a7737[_0x7142('0x32')]=_[_0x7142('0x2b')](db[_0x7142('0x41')][_0x7142('0x47')]);_0x4a7737['query']=_[_0x7142('0x2b')](_0x50b0b8[_0x7142('0x2c')]);_0x4a7737['filters']=_[_0x7142('0x2e')](_0x4a7737['model'],_0x4a7737[_0x7142('0x2c')]);_0x144106['attributes']=_[_0x7142('0x2e')](_0x4a7737[_0x7142('0x32')],qs[_0x7142('0x2f')](_0x50b0b8[_0x7142('0x2c')][_0x7142('0x2f')]));_0x144106['attributes']=_0x144106[_0x7142('0x30')][_0x7142('0x31')]?_0x144106[_0x7142('0x30')]:_0x4a7737['model'];if(_0x50b0b8[_0x7142('0x2c')][_0x7142('0x3f')]){_0x144106[_0x7142('0x40')]=[{'all':!![]}];}_0x144106=_[_0x7142('0x3d')]({},_0x144106,_0x50b0b8[_0x7142('0x3e')]);return db['ServicenowConfiguration'][_0x7142('0x48')](_0x144106)['then'](handleEntityNotFound(_0x35619b,null))[_0x7142('0x23')](respondWithResult(_0x35619b,null))['catch'](handleError(_0x35619b,null));};exports['create']=function(_0x52f0a5,_0x4966d1){return db['ServicenowConfiguration'][_0x7142('0x49')](_0x52f0a5[_0x7142('0x4a')],{})[_0x7142('0x23')](respondWithResult(_0x4966d1,0xc9))[_0x7142('0x44')](handleError(_0x4966d1,null));};exports[_0x7142('0x22')]=function(_0x4ddd5a,_0x50754f){if(_0x4ddd5a[_0x7142('0x4a')]['id']){delete _0x4ddd5a[_0x7142('0x4a')]['id'];}return db[_0x7142('0x41')][_0x7142('0x48')]({'where':{'id':_0x4ddd5a[_0x7142('0x46')]['id']}})[_0x7142('0x23')](handleEntityNotFound(_0x50754f,null))['then'](saveUpdates(_0x4ddd5a[_0x7142('0x4a')],null))[_0x7142('0x23')](respondWithResult(_0x50754f,null))[_0x7142('0x44')](handleError(_0x50754f,null));};exports['destroy']=function(_0x5f2b9e,_0x247c7c){return db[_0x7142('0x41')][_0x7142('0x48')]({'where':{'id':_0x5f2b9e['params']['id']}})['then'](handleEntityNotFound(_0x247c7c,null))[_0x7142('0x23')](removeEntity(_0x247c7c,null))[_0x7142('0x44')](handleError(_0x247c7c,null));};exports[_0x7142('0x4b')]=function(_0x13f004,_0x375a5c,_0x1ea5d0){var _0x61fffb={};var _0xe94fba={};var _0x53bb30;var _0x33369d;return db[_0x7142('0x41')][_0x7142('0x4c')]({'where':{'id':_0x13f004[_0x7142('0x46')]['id']}})['then'](handleEntityNotFound(_0x375a5c,null))[_0x7142('0x23')](function(_0x255b14){if(_0x255b14){_0x53bb30=_0x255b14;_0xe94fba[_0x7142('0x32')]=_[_0x7142('0x2b')](db['ServicenowField'][_0x7142('0x47')]);_0xe94fba[_0x7142('0x2c')]=_['keys'](_0x13f004[_0x7142('0x2c')]);_0xe94fba[_0x7142('0x2d')]=_[_0x7142('0x2e')](_0xe94fba['model'],_0xe94fba[_0x7142('0x2c')]);_0x61fffb[_0x7142('0x30')]=_[_0x7142('0x2e')](_0xe94fba[_0x7142('0x32')],qs[_0x7142('0x2f')](_0x13f004[_0x7142('0x2c')][_0x7142('0x2f')]));_0x61fffb[_0x7142('0x30')]=_0x61fffb[_0x7142('0x30')][_0x7142('0x31')]?_0x61fffb[_0x7142('0x30')]:_0xe94fba[_0x7142('0x32')];_0x61fffb[_0x7142('0x36')]=qs[_0x7142('0x37')](_0x13f004[_0x7142('0x2c')][_0x7142('0x37')]);_0x61fffb[_0x7142('0x38')]=qs[_0x7142('0x2d')](_['pick'](_0x13f004['query'],_0xe94fba[_0x7142('0x2d')]));if(_0x13f004[_0x7142('0x2c')]['filter']){_0x61fffb[_0x7142('0x38')]=_[_0x7142('0x3d')](_0x61fffb[_0x7142('0x38')],{'$or':_[_0x7142('0x29')](_0x61fffb[_0x7142('0x30')],function(_0x2b8066){var _0x25c44c={};_0x25c44c[_0x2b8066]={'$like':'%'+_0x13f004[_0x7142('0x2c')][_0x7142('0x3a')]+'%'};return _0x25c44c;})});}_0x61fffb=_[_0x7142('0x3d')]({},_0x61fffb,_0x13f004[_0x7142('0x3e')]);return _0x53bb30[_0x7142('0x4b')](_0x61fffb);}})[_0x7142('0x23')](function(_0x292dc1){if(_0x292dc1){_0x33369d=_0x292dc1[_0x7142('0x31')];if(!_0x13f004[_0x7142('0x2c')][_0x7142('0x33')](_0x7142('0x34'))){_0x61fffb[_0x7142('0x35')]=qs[_0x7142('0x35')](_0x13f004[_0x7142('0x2c')][_0x7142('0x35')]);_0x61fffb[_0x7142('0x1c')]=qs['offset'](_0x13f004[_0x7142('0x2c')][_0x7142('0x1c')]);}return _0x53bb30['getFields'](_0x61fffb);}})[_0x7142('0x23')](function(_0x38d928){if(_0x38d928){return _0x38d928?{'count':_0x33369d,'rows':_0x38d928}:null;}})[_0x7142('0x23')](respondWithResult(_0x375a5c,null))['catch'](handleError(_0x375a5c,null));};exports[_0x7142('0x4d')]=function(_0xe45419,_0x11728d,_0x6e58f9){var _0x3ded1b={};var _0x15e6a4={};var _0x112eba;var _0x45e5e4;return db[_0x7142('0x41')]['findOne']({'where':{'id':_0xe45419['params']['id']}})[_0x7142('0x23')](handleEntityNotFound(_0x11728d,null))[_0x7142('0x23')](function(_0x486229){if(_0x486229){_0x112eba=_0x486229;_0x15e6a4[_0x7142('0x32')]=_['keys'](db[_0x7142('0x4e')]['rawAttributes']);_0x15e6a4[_0x7142('0x2c')]=_['keys'](_0xe45419[_0x7142('0x2c')]);_0x15e6a4[_0x7142('0x2d')]=_['intersection'](_0x15e6a4[_0x7142('0x32')],_0x15e6a4[_0x7142('0x2c')]);_0x3ded1b['attributes']=_[_0x7142('0x2e')](_0x15e6a4[_0x7142('0x32')],qs[_0x7142('0x2f')](_0xe45419[_0x7142('0x2c')][_0x7142('0x2f')]));_0x3ded1b['attributes']=_0x3ded1b['attributes'][_0x7142('0x31')]?_0x3ded1b['attributes']:_0x15e6a4[_0x7142('0x32')];_0x3ded1b['order']=qs[_0x7142('0x37')](_0xe45419[_0x7142('0x2c')][_0x7142('0x37')]);_0x3ded1b[_0x7142('0x38')]=qs['filters'](_[_0x7142('0x39')](_0xe45419[_0x7142('0x2c')],_0x15e6a4[_0x7142('0x2d')]));if(_0xe45419[_0x7142('0x2c')][_0x7142('0x3a')]){_0x3ded1b['where']=_[_0x7142('0x3d')](_0x3ded1b[_0x7142('0x38')],{'$or':_['map'](_0x3ded1b['attributes'],function(_0x178409){var _0x43a1ae={};_0x43a1ae[_0x178409]={'$like':'%'+_0xe45419[_0x7142('0x2c')][_0x7142('0x3a')]+'%'};return _0x43a1ae;})});}_0x3ded1b=_[_0x7142('0x3d')]({},_0x3ded1b,_0xe45419[_0x7142('0x3e')]);return _0x112eba[_0x7142('0x4d')](_0x3ded1b);}})['then'](function(_0x167836){if(_0x167836){_0x45e5e4=_0x167836[_0x7142('0x31')];if(!_0xe45419[_0x7142('0x2c')][_0x7142('0x33')](_0x7142('0x34'))){_0x3ded1b['limit']=qs[_0x7142('0x35')](_0xe45419[_0x7142('0x2c')][_0x7142('0x35')]);_0x3ded1b[_0x7142('0x1c')]=qs['offset'](_0xe45419[_0x7142('0x2c')][_0x7142('0x1c')]);}return _0x112eba[_0x7142('0x4d')](_0x3ded1b);}})[_0x7142('0x23')](function(_0x13f5a6){if(_0x13f5a6){return _0x13f5a6?{'count':_0x45e5e4,'rows':_0x13f5a6}:null;}})[_0x7142('0x23')](respondWithResult(_0x11728d,null))[_0x7142('0x44')](handleError(_0x11728d,null));};exports[_0x7142('0x4f')]=function(_0x2618b4,_0x1a2ae0,_0x36b21b){var _0x2eab96={};var _0x4773a7={};var _0x227602;var _0x5c971e;return db[_0x7142('0x41')][_0x7142('0x4c')]({'where':{'id':_0x2618b4[_0x7142('0x46')]['id']}})[_0x7142('0x23')](handleEntityNotFound(_0x1a2ae0,null))[_0x7142('0x23')](function(_0x46b726){if(_0x46b726){_0x227602=_0x46b726;_0x4773a7[_0x7142('0x32')]=_[_0x7142('0x2b')](db[_0x7142('0x4e')][_0x7142('0x47')]);_0x4773a7[_0x7142('0x2c')]=_['keys'](_0x2618b4[_0x7142('0x2c')]);_0x4773a7['filters']=_[_0x7142('0x2e')](_0x4773a7[_0x7142('0x32')],_0x4773a7[_0x7142('0x2c')]);_0x2eab96[_0x7142('0x30')]=_[_0x7142('0x2e')](_0x4773a7[_0x7142('0x32')],qs['fields'](_0x2618b4['query']['fields']));_0x2eab96['attributes']=_0x2eab96[_0x7142('0x30')][_0x7142('0x31')]?_0x2eab96[_0x7142('0x30')]:_0x4773a7[_0x7142('0x32')];_0x2eab96[_0x7142('0x36')]=qs[_0x7142('0x37')](_0x2618b4[_0x7142('0x2c')]['sort']);_0x2eab96[_0x7142('0x38')]=qs[_0x7142('0x2d')](_[_0x7142('0x39')](_0x2618b4[_0x7142('0x2c')],_0x4773a7[_0x7142('0x2d')]));if(_0x2618b4[_0x7142('0x2c')][_0x7142('0x3a')]){_0x2eab96['where']=_[_0x7142('0x3d')](_0x2eab96[_0x7142('0x38')],{'$or':_[_0x7142('0x29')](_0x2eab96[_0x7142('0x30')],function(_0x43ca1b){var _0x16c970={};_0x16c970[_0x43ca1b]={'$like':'%'+_0x2618b4[_0x7142('0x2c')]['filter']+'%'};return _0x16c970;})});}_0x2eab96=_[_0x7142('0x3d')]({},_0x2eab96,_0x2618b4[_0x7142('0x3e')]);return _0x227602[_0x7142('0x4f')](_0x2eab96);}})[_0x7142('0x23')](function(_0x1a23c5){if(_0x1a23c5){_0x5c971e=_0x1a23c5[_0x7142('0x31')];if(!_0x2618b4[_0x7142('0x2c')]['hasOwnProperty'](_0x7142('0x34'))){_0x2eab96['limit']=qs[_0x7142('0x35')](_0x2618b4[_0x7142('0x2c')]['limit']);_0x2eab96[_0x7142('0x1c')]=qs[_0x7142('0x1c')](_0x2618b4[_0x7142('0x2c')][_0x7142('0x1c')]);}return _0x227602[_0x7142('0x4f')](_0x2eab96);}})[_0x7142('0x23')](function(_0x458966){if(_0x458966){return _0x458966?{'count':_0x5c971e,'rows':_0x458966}:null;}})[_0x7142('0x23')](respondWithResult(_0x1a2ae0,null))[_0x7142('0x44')](handleError(_0x1a2ae0,null));}; \ No newline at end of file +var _0xbbac=['filter','merge','VIRTUAL','options','rows','catch','show','params','include','create','update','body','find','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','error','name','ServicenowConfiguration','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0xbbac,0x18f));var _0xcbba=function(_0x2d269e,_0x4b2f76){_0x2d269e=_0x2d269e-0x0;var _0x595612=_0xbbac[_0x2d269e];return _0x595612;};'use strict';var emlformat=require(_0xcbba('0x0'));var rimraf=require(_0xcbba('0x1'));var zipdir=require(_0xcbba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbba('0x3'));var moment=require(_0xcbba('0x4'));var BPromise=require(_0xcbba('0x5'));var Mustache=require('mustache');var util=require(_0xcbba('0x6'));var path=require(_0xcbba('0x7'));var sox=require(_0xcbba('0x8'));var csv=require('to-csv');var ejs=require(_0xcbba('0x9'));var fs=require('fs');var fs_extra=require(_0xcbba('0xa'));var _=require(_0xcbba('0xb'));var squel=require(_0xcbba('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbba('0xd'));var querystring=require(_0xcbba('0xe'));var Papa=require(_0xcbba('0xf'));var Redis=require(_0xcbba('0x10'));var authService=require(_0xcbba('0x11'));var qs=require(_0xcbba('0x12'));var as=require(_0xcbba('0x13'));var hardwareService=require(_0xcbba('0x14'));var logger=require('../../config/logger')(_0xcbba('0x15'));var utils=require(_0xcbba('0x16'));var config=require(_0xcbba('0x17'));var licenseUtil=require(_0xcbba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dcf48,_0x2800db){_0x2800db=_0x2800db||0xcc;return function(_0x4667eb){if(_0x4667eb){return _0x3dcf48[_0xcbba('0x19')](_0x2800db);}return _0x3dcf48[_0xcbba('0x1a')](_0x2800db)[_0xcbba('0x1b')]();};}function respondWithResult(_0x122614,_0x152cc7){_0x152cc7=_0x152cc7||0xc8;return function(_0x228afc){if(_0x228afc){return _0x122614[_0xcbba('0x1a')](_0x152cc7)[_0xcbba('0x1c')](_0x228afc);}};}function respondWithFilteredResult(_0x3d3f84,_0x14b944){return function(_0x1eb8e8){if(_0x1eb8e8){var _0x3c9630=typeof _0x14b944[_0xcbba('0x1d')]===_0xcbba('0x1e')&&typeof _0x14b944['limit']===_0xcbba('0x1e');var _0x5ee134=_0x1eb8e8[_0xcbba('0x1f')];var _0x33fc68=_0x3c9630?0x0:_0x14b944['offset'];var _0x31d28c=_0x3c9630?_0x1eb8e8['count']:_0x14b944[_0xcbba('0x1d')]+_0x14b944['limit'];var _0x1a4a29;if(_0x31d28c>=_0x5ee134){_0x31d28c=_0x5ee134;_0x1a4a29=0xc8;}else{_0x1a4a29=0xce;}_0x3d3f84[_0xcbba('0x1a')](_0x1a4a29);return _0x3d3f84['set'](_0xcbba('0x20'),_0x33fc68+'-'+_0x31d28c+'/'+_0x5ee134)[_0xcbba('0x1c')](_0x1eb8e8);}return null;};}function patchUpdates(_0x51813f){return function(_0x671985){try{jsonpatch[_0xcbba('0x21')](_0x671985,_0x51813f,!![]);}catch(_0x1f6a9f){return BPromise['reject'](_0x1f6a9f);}return _0x671985[_0xcbba('0x22')]();};}function saveUpdates(_0xe16ba0,_0x351a1e){return function(_0xf663fe){if(_0xf663fe){return _0xf663fe['update'](_0xe16ba0)[_0xcbba('0x23')](function(_0x275f31){return _0x275f31;});}return null;};}function removeEntity(_0x595e31,_0x550445){return function(_0x19fbaf){if(_0x19fbaf){return _0x19fbaf[_0xcbba('0x24')]()[_0xcbba('0x23')](function(){_0x595e31[_0xcbba('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1022ce,_0x1084b2){return function(_0x4b3407){if(!_0x4b3407){_0x1022ce[_0xcbba('0x19')](0x194);}return _0x4b3407;};}function handleError(_0x32664d,_0x523331){_0x523331=_0x523331||0x1f4;return function(_0xa7544f){logger[_0xcbba('0x25')](_0xa7544f['stack']);if(_0xa7544f[_0xcbba('0x26')]){delete _0xa7544f['name'];}_0x32664d[_0xcbba('0x1a')](_0x523331)['send'](_0xa7544f);};}exports['index']=function(_0xf23041,_0x16f17e){var _0x48d666={},_0xf6c53c={},_0x390a58={'count':0x0,'rows':[]};var _0x4697df=_['map'](db[_0xcbba('0x27')][_0xcbba('0x28')],function(_0x468d19){return{'name':_0x468d19['fieldName'],'type':_0x468d19['type'][_0xcbba('0x29')]};});_0xf6c53c[_0xcbba('0x2a')]=_[_0xcbba('0x2b')](_0x4697df,_0xcbba('0x26'));_0xf6c53c[_0xcbba('0x2c')]=_[_0xcbba('0x2d')](_0xf23041[_0xcbba('0x2c')]);_0xf6c53c[_0xcbba('0x2e')]=_[_0xcbba('0x2f')](_0xf6c53c['model'],_0xf6c53c[_0xcbba('0x2c')]);_0x48d666[_0xcbba('0x30')]=_[_0xcbba('0x2f')](_0xf6c53c['model'],qs[_0xcbba('0x31')](_0xf23041['query']['fields']));_0x48d666['attributes']=_0x48d666['attributes'][_0xcbba('0x32')]?_0x48d666[_0xcbba('0x30')]:_0xf6c53c['model'];if(!_0xf23041[_0xcbba('0x2c')][_0xcbba('0x33')](_0xcbba('0x34'))){_0x48d666[_0xcbba('0x35')]=qs[_0xcbba('0x35')](_0xf23041[_0xcbba('0x2c')]['limit']);_0x48d666['offset']=qs[_0xcbba('0x1d')](_0xf23041[_0xcbba('0x2c')][_0xcbba('0x1d')]);}_0x48d666['order']=qs[_0xcbba('0x36')](_0xf23041[_0xcbba('0x2c')][_0xcbba('0x36')]);_0x48d666[_0xcbba('0x37')]=qs[_0xcbba('0x2e')](_[_0xcbba('0x38')](_0xf23041[_0xcbba('0x2c')],_0xf6c53c[_0xcbba('0x2e')]),_0x4697df);if(_0xf23041['query'][_0xcbba('0x39')]){_0x48d666[_0xcbba('0x37')]=_[_0xcbba('0x3a')](_0x48d666[_0xcbba('0x37')],{'$or':_[_0xcbba('0x2b')](_0x4697df,function(_0x18518c){if(_0x18518c['type']!==_0xcbba('0x3b')){var _0x3ac868={};_0x3ac868[_0x18518c['name']]={'$like':'%'+_0xf23041['query'][_0xcbba('0x39')]+'%'};return _0x3ac868;}})});}_0x48d666=_[_0xcbba('0x3a')]({},_0x48d666,_0xf23041[_0xcbba('0x3c')]);var _0x4fd745={'where':_0x48d666[_0xcbba('0x37')]};return db[_0xcbba('0x27')][_0xcbba('0x1f')](_0x4fd745)[_0xcbba('0x23')](function(_0x11fcc2){_0x390a58[_0xcbba('0x1f')]=_0x11fcc2;if(_0xf23041['query']['includeAll']){_0x48d666['include']=[{'all':!![]}];}return db[_0xcbba('0x27')]['findAll'](_0x48d666);})[_0xcbba('0x23')](function(_0x177903){_0x390a58[_0xcbba('0x3d')]=_0x177903;return _0x390a58;})[_0xcbba('0x23')](respondWithFilteredResult(_0x16f17e,_0x48d666))[_0xcbba('0x3e')](handleError(_0x16f17e,null));};exports[_0xcbba('0x3f')]=function(_0x495746,_0x5dfe9f){var _0x42c7e8={'raw':![],'where':{'id':_0x495746[_0xcbba('0x40')]['id']}},_0x13ac16={};_0x13ac16[_0xcbba('0x2a')]=_[_0xcbba('0x2d')](db['ServicenowConfiguration'][_0xcbba('0x28')]);_0x13ac16['query']=_[_0xcbba('0x2d')](_0x495746[_0xcbba('0x2c')]);_0x13ac16[_0xcbba('0x2e')]=_[_0xcbba('0x2f')](_0x13ac16[_0xcbba('0x2a')],_0x13ac16[_0xcbba('0x2c')]);_0x42c7e8[_0xcbba('0x30')]=_['intersection'](_0x13ac16[_0xcbba('0x2a')],qs[_0xcbba('0x31')](_0x495746[_0xcbba('0x2c')][_0xcbba('0x31')]));_0x42c7e8[_0xcbba('0x30')]=_0x42c7e8[_0xcbba('0x30')][_0xcbba('0x32')]?_0x42c7e8['attributes']:_0x13ac16[_0xcbba('0x2a')];if(_0x495746[_0xcbba('0x2c')]['includeAll']){_0x42c7e8[_0xcbba('0x41')]=[{'all':!![]}];}_0x42c7e8=_[_0xcbba('0x3a')]({},_0x42c7e8,_0x495746[_0xcbba('0x3c')]);return db[_0xcbba('0x27')]['find'](_0x42c7e8)[_0xcbba('0x23')](handleEntityNotFound(_0x5dfe9f,null))[_0xcbba('0x23')](respondWithResult(_0x5dfe9f,null))[_0xcbba('0x3e')](handleError(_0x5dfe9f,null));};exports[_0xcbba('0x42')]=function(_0x1b1c71,_0x330bb6){return db[_0xcbba('0x27')]['create'](_0x1b1c71['body'],{})['then'](respondWithResult(_0x330bb6,0xc9))['catch'](handleError(_0x330bb6,null));};exports[_0xcbba('0x43')]=function(_0x3f367d,_0x1ebce8){if(_0x3f367d[_0xcbba('0x44')]['id']){delete _0x3f367d[_0xcbba('0x44')]['id'];}return db[_0xcbba('0x27')][_0xcbba('0x45')]({'where':{'id':_0x3f367d['params']['id']}})[_0xcbba('0x23')](handleEntityNotFound(_0x1ebce8,null))['then'](saveUpdates(_0x3f367d[_0xcbba('0x44')],null))['then'](respondWithResult(_0x1ebce8,null))[_0xcbba('0x3e')](handleError(_0x1ebce8,null));};exports[_0xcbba('0x24')]=function(_0x3ff8f8,_0x4765c3){return db[_0xcbba('0x27')][_0xcbba('0x45')]({'where':{'id':_0x3ff8f8[_0xcbba('0x40')]['id']}})[_0xcbba('0x23')](handleEntityNotFound(_0x4765c3,null))[_0xcbba('0x23')](removeEntity(_0x4765c3,null))[_0xcbba('0x3e')](handleError(_0x4765c3,null));};exports[_0xcbba('0x46')]=function(_0x2a7cb0,_0x318f02,_0x3c45cf){var _0x247b06={};var _0x57ed7a={};var _0x240d91;var _0x170189;return db[_0xcbba('0x27')][_0xcbba('0x47')]({'where':{'id':_0x2a7cb0['params']['id']}})[_0xcbba('0x23')](handleEntityNotFound(_0x318f02,null))[_0xcbba('0x23')](function(_0x37c481){if(_0x37c481){_0x240d91=_0x37c481;_0x57ed7a[_0xcbba('0x2a')]=_[_0xcbba('0x2d')](db[_0xcbba('0x48')]['rawAttributes']);_0x57ed7a[_0xcbba('0x2c')]=_[_0xcbba('0x2d')](_0x2a7cb0[_0xcbba('0x2c')]);_0x57ed7a[_0xcbba('0x2e')]=_[_0xcbba('0x2f')](_0x57ed7a[_0xcbba('0x2a')],_0x57ed7a[_0xcbba('0x2c')]);_0x247b06[_0xcbba('0x30')]=_['intersection'](_0x57ed7a[_0xcbba('0x2a')],qs[_0xcbba('0x31')](_0x2a7cb0['query'][_0xcbba('0x31')]));_0x247b06[_0xcbba('0x30')]=_0x247b06[_0xcbba('0x30')][_0xcbba('0x32')]?_0x247b06[_0xcbba('0x30')]:_0x57ed7a['model'];_0x247b06[_0xcbba('0x49')]=qs['sort'](_0x2a7cb0[_0xcbba('0x2c')]['sort']);_0x247b06[_0xcbba('0x37')]=qs[_0xcbba('0x2e')](_[_0xcbba('0x38')](_0x2a7cb0[_0xcbba('0x2c')],_0x57ed7a['filters']));if(_0x2a7cb0['query']['filter']){_0x247b06['where']=_[_0xcbba('0x3a')](_0x247b06[_0xcbba('0x37')],{'$or':_[_0xcbba('0x2b')](_0x247b06['attributes'],function(_0x4e432d){var _0x4484fc={};_0x4484fc[_0x4e432d]={'$like':'%'+_0x2a7cb0[_0xcbba('0x2c')][_0xcbba('0x39')]+'%'};return _0x4484fc;})});}_0x247b06=_[_0xcbba('0x3a')]({},_0x247b06,_0x2a7cb0['options']);return _0x240d91[_0xcbba('0x46')](_0x247b06);}})[_0xcbba('0x23')](function(_0x3225f5){if(_0x3225f5){_0x170189=_0x3225f5[_0xcbba('0x32')];if(!_0x2a7cb0[_0xcbba('0x2c')][_0xcbba('0x33')]('nolimit')){_0x247b06[_0xcbba('0x35')]=qs[_0xcbba('0x35')](_0x2a7cb0[_0xcbba('0x2c')][_0xcbba('0x35')]);_0x247b06['offset']=qs[_0xcbba('0x1d')](_0x2a7cb0['query']['offset']);}return _0x240d91[_0xcbba('0x46')](_0x247b06);}})[_0xcbba('0x23')](function(_0x29a185){if(_0x29a185){return _0x29a185?{'count':_0x170189,'rows':_0x29a185}:null;}})['then'](respondWithResult(_0x318f02,null))[_0xcbba('0x3e')](handleError(_0x318f02,null));};exports[_0xcbba('0x4a')]=function(_0x1c31d8,_0x5a625f,_0x11274a){var _0x844362={};var _0x4cd354={};var _0x2227fb;var _0x58ff39;return db[_0xcbba('0x27')]['findOne']({'where':{'id':_0x1c31d8[_0xcbba('0x40')]['id']}})[_0xcbba('0x23')](handleEntityNotFound(_0x5a625f,null))[_0xcbba('0x23')](function(_0xbc7bfa){if(_0xbc7bfa){_0x2227fb=_0xbc7bfa;_0x4cd354['model']=_[_0xcbba('0x2d')](db['ServicenowField']['rawAttributes']);_0x4cd354[_0xcbba('0x2c')]=_[_0xcbba('0x2d')](_0x1c31d8[_0xcbba('0x2c')]);_0x4cd354[_0xcbba('0x2e')]=_['intersection'](_0x4cd354[_0xcbba('0x2a')],_0x4cd354[_0xcbba('0x2c')]);_0x844362['attributes']=_[_0xcbba('0x2f')](_0x4cd354[_0xcbba('0x2a')],qs[_0xcbba('0x31')](_0x1c31d8['query']['fields']));_0x844362[_0xcbba('0x30')]=_0x844362['attributes']['length']?_0x844362[_0xcbba('0x30')]:_0x4cd354[_0xcbba('0x2a')];_0x844362[_0xcbba('0x49')]=qs[_0xcbba('0x36')](_0x1c31d8[_0xcbba('0x2c')]['sort']);_0x844362[_0xcbba('0x37')]=qs[_0xcbba('0x2e')](_[_0xcbba('0x38')](_0x1c31d8[_0xcbba('0x2c')],_0x4cd354[_0xcbba('0x2e')]));if(_0x1c31d8[_0xcbba('0x2c')][_0xcbba('0x39')]){_0x844362[_0xcbba('0x37')]=_[_0xcbba('0x3a')](_0x844362[_0xcbba('0x37')],{'$or':_[_0xcbba('0x2b')](_0x844362['attributes'],function(_0x10a796){var _0x486ae0={};_0x486ae0[_0x10a796]={'$like':'%'+_0x1c31d8[_0xcbba('0x2c')][_0xcbba('0x39')]+'%'};return _0x486ae0;})});}_0x844362=_[_0xcbba('0x3a')]({},_0x844362,_0x1c31d8[_0xcbba('0x3c')]);return _0x2227fb[_0xcbba('0x4a')](_0x844362);}})[_0xcbba('0x23')](function(_0x22078e){if(_0x22078e){_0x58ff39=_0x22078e[_0xcbba('0x32')];if(!_0x1c31d8[_0xcbba('0x2c')][_0xcbba('0x33')](_0xcbba('0x34'))){_0x844362[_0xcbba('0x35')]=qs['limit'](_0x1c31d8[_0xcbba('0x2c')][_0xcbba('0x35')]);_0x844362[_0xcbba('0x1d')]=qs[_0xcbba('0x1d')](_0x1c31d8['query'][_0xcbba('0x1d')]);}return _0x2227fb[_0xcbba('0x4a')](_0x844362);}})[_0xcbba('0x23')](function(_0x14fb62){if(_0x14fb62){return _0x14fb62?{'count':_0x58ff39,'rows':_0x14fb62}:null;}})[_0xcbba('0x23')](respondWithResult(_0x5a625f,null))['catch'](handleError(_0x5a625f,null));};exports[_0xcbba('0x4b')]=function(_0x112cf5,_0x39322b,_0x5274ef){var _0x386f28={};var _0x3c51f2={};var _0x42fd90;var _0x13c742;return db['ServicenowConfiguration'][_0xcbba('0x47')]({'where':{'id':_0x112cf5[_0xcbba('0x40')]['id']}})[_0xcbba('0x23')](handleEntityNotFound(_0x39322b,null))['then'](function(_0x55c6b3){if(_0x55c6b3){_0x42fd90=_0x55c6b3;_0x3c51f2[_0xcbba('0x2a')]=_[_0xcbba('0x2d')](db[_0xcbba('0x48')][_0xcbba('0x28')]);_0x3c51f2['query']=_[_0xcbba('0x2d')](_0x112cf5[_0xcbba('0x2c')]);_0x3c51f2[_0xcbba('0x2e')]=_[_0xcbba('0x2f')](_0x3c51f2[_0xcbba('0x2a')],_0x3c51f2[_0xcbba('0x2c')]);_0x386f28[_0xcbba('0x30')]=_[_0xcbba('0x2f')](_0x3c51f2[_0xcbba('0x2a')],qs[_0xcbba('0x31')](_0x112cf5[_0xcbba('0x2c')][_0xcbba('0x31')]));_0x386f28[_0xcbba('0x30')]=_0x386f28[_0xcbba('0x30')][_0xcbba('0x32')]?_0x386f28[_0xcbba('0x30')]:_0x3c51f2[_0xcbba('0x2a')];_0x386f28[_0xcbba('0x49')]=qs[_0xcbba('0x36')](_0x112cf5['query'][_0xcbba('0x36')]);_0x386f28[_0xcbba('0x37')]=qs[_0xcbba('0x2e')](_[_0xcbba('0x38')](_0x112cf5['query'],_0x3c51f2['filters']));if(_0x112cf5['query'][_0xcbba('0x39')]){_0x386f28[_0xcbba('0x37')]=_[_0xcbba('0x3a')](_0x386f28[_0xcbba('0x37')],{'$or':_[_0xcbba('0x2b')](_0x386f28[_0xcbba('0x30')],function(_0x27e9aa){var _0x4fe5cd={};_0x4fe5cd[_0x27e9aa]={'$like':'%'+_0x112cf5['query'][_0xcbba('0x39')]+'%'};return _0x4fe5cd;})});}_0x386f28=_['merge']({},_0x386f28,_0x112cf5[_0xcbba('0x3c')]);return _0x42fd90[_0xcbba('0x4b')](_0x386f28);}})[_0xcbba('0x23')](function(_0x20c228){if(_0x20c228){_0x13c742=_0x20c228[_0xcbba('0x32')];if(!_0x112cf5[_0xcbba('0x2c')][_0xcbba('0x33')]('nolimit')){_0x386f28[_0xcbba('0x35')]=qs[_0xcbba('0x35')](_0x112cf5[_0xcbba('0x2c')][_0xcbba('0x35')]);_0x386f28[_0xcbba('0x1d')]=qs[_0xcbba('0x1d')](_0x112cf5[_0xcbba('0x2c')][_0xcbba('0x1d')]);}return _0x42fd90[_0xcbba('0x4b')](_0x386f28);}})['then'](function(_0x3ddeff){if(_0x3ddeff){return _0x3ddeff?{'count':_0x13c742,'rows':_0x3ddeff}:null;}})[_0xcbba('0x23')](respondWithResult(_0x39322b,null))[_0xcbba('0x3e')](handleError(_0x39322b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ce45e07..0e512fd 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 _0x5386=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations'];(function(_0x1e2c91,_0x1f259a){var _0x3e85b0=function(_0x41e7bc){while(--_0x41e7bc){_0x1e2c91['push'](_0x1e2c91['shift']());}};_0x3e85b0(++_0x1f259a);}(_0x5386,0x1e1));var _0x6538=function(_0x3c97e3,_0x321677){_0x3c97e3=_0x3c97e3-0x0;var _0x9bb0ed=_0x5386[_0x3c97e3];return _0x9bb0ed;};'use strict';var _=require(_0x6538('0x0'));var util=require(_0x6538('0x1'));var logger=require(_0x6538('0x2'))(_0x6538('0x3'));var moment=require('moment');var BPromise=require(_0x6538('0x4'));var rp=require(_0x6538('0x5'));var fs=require('fs');var path=require(_0x6538('0x6'));var rimraf=require(_0x6538('0x7'));var config=require(_0x6538('0x8'));var attributes=require(_0x6538('0x9'));module[_0x6538('0xa')]=function(_0x2433c9,_0x4ed3fa){return _0x2433c9[_0x6538('0xb')]('ServicenowConfiguration',attributes,{'tableName':_0x6538('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ServicenowConfiguration'];(function(_0x5f24dd,_0x3538dd){var _0x2d8f94=function(_0x50ed30){while(--_0x50ed30){_0x5f24dd['push'](_0x5f24dd['shift']());}};_0x2d8f94(++_0x3538dd);}(_0x8f4c,0x113));var _0xc8f4=function(_0x20352e,_0x1ee2ac){_0x20352e=_0x20352e-0x0;var _0x5a9319=_0x8f4c[_0x20352e];return _0x5a9319;};'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('./intServicenowConfiguration.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 75d0dc3..ffd1c98 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 _0x9199=['message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x4562b6,_0x2fd3bf){var _0x751dfa=function(_0x35a4d0){while(--_0x35a4d0){_0x4562b6['push'](_0x4562b6['shift']());}};_0x751dfa(++_0x2fd3bf);}(_0x9199,0x1e9));var _0x9919=function(_0x5b5c45,_0x199467){_0x5b5c45=_0x5b5c45-0x0;var _0x2cd0dd=_0x9199[_0x5b5c45];return _0x2cd0dd;};'use strict';var _=require(_0x9919('0x0'));var util=require(_0x9919('0x1'));var moment=require('moment');var BPromise=require(_0x9919('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9919('0x3'));var db=require(_0x9919('0x4'))['db'];var utils=require(_0x9919('0x5'));var logger=require('../../config/logger')(_0x9919('0x6'));var config=require(_0x9919('0x7'));var jayson=require(_0x9919('0x8'));var client=jayson['client'][_0x9919('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40520a,_0x2ed62b,_0x4ef41b){return new BPromise(function(_0x208e9d,_0x4a76e8){return client[_0x9919('0xa')](_0x40520a,_0x4ef41b)['then'](function(_0x2f6736){logger['info'](_0x9919('0xb'),_0x2ed62b,_0x9919('0xc'));logger['debug'](_0x9919('0xd'),_0x2ed62b,_0x9919('0xc'),JSON['stringify'](_0x2f6736));if(_0x2f6736[_0x9919('0xe')]){if(_0x2f6736[_0x9919('0xe')]['code']===0x1f4){logger[_0x9919('0xe')](_0x9919('0xb'),_0x2ed62b,_0x2f6736['error'][_0x9919('0xf')]);return _0x4a76e8(_0x2f6736[_0x9919('0xe')][_0x9919('0xf')]);}logger[_0x9919('0xe')](_0x9919('0xb'),_0x2ed62b,_0x2f6736[_0x9919('0xe')][_0x9919('0xf')]);return _0x208e9d(_0x2f6736[_0x9919('0xe')][_0x9919('0xf')]);}else{logger[_0x9919('0x10')](_0x9919('0xb'),_0x2ed62b,_0x9919('0xc'));_0x208e9d(_0x2f6736[_0x9919('0x11')][_0x9919('0xf')]);}})['catch'](function(_0x382e8a){logger[_0x9919('0xe')](_0x9919('0xb'),_0x2ed62b,_0x382e8a);_0x4a76e8(_0x382e8a);});});} \ No newline at end of file +var _0x3dec=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x535b26,_0xeb426b){var _0x1ec755=function(_0x188fb9){while(--_0x188fb9){_0x535b26['push'](_0x535b26['shift']());}};_0x1ec755(++_0xeb426b);}(_0x3dec,0x8e));var _0xc3de=function(_0x21fc68,_0x459828){_0x21fc68=_0x21fc68-0x0;var _0x3561e1=_0x3dec[_0x21fc68];return _0x3561e1;};'use strict';var _=require(_0xc3de('0x0'));var util=require(_0xc3de('0x1'));var moment=require(_0xc3de('0x2'));var BPromise=require(_0xc3de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3de('0x4'))['db'];var utils=require(_0xc3de('0x5'));var logger=require('../../config/logger')(_0xc3de('0x6'));var config=require(_0xc3de('0x7'));var jayson=require(_0xc3de('0x8'));var client=jayson[_0xc3de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x225c8e,_0x2c79f3,_0x295b66){return new BPromise(function(_0x47957a,_0x1cf2c9){return client[_0xc3de('0xa')](_0x225c8e,_0x295b66)[_0xc3de('0xb')](function(_0x1d86ce){logger[_0xc3de('0xc')](_0xc3de('0xd'),_0x2c79f3,_0xc3de('0xe'));logger[_0xc3de('0xf')](_0xc3de('0x10'),_0x2c79f3,'request\x20sent',JSON['stringify'](_0x1d86ce));if(_0x1d86ce[_0xc3de('0x11')]){if(_0x1d86ce[_0xc3de('0x11')][_0xc3de('0x12')]===0x1f4){logger[_0xc3de('0x11')](_0xc3de('0xd'),_0x2c79f3,_0x1d86ce[_0xc3de('0x11')][_0xc3de('0x13')]);return _0x1cf2c9(_0x1d86ce[_0xc3de('0x11')][_0xc3de('0x13')]);}logger[_0xc3de('0x11')](_0xc3de('0xd'),_0x2c79f3,_0x1d86ce['error'][_0xc3de('0x13')]);return _0x47957a(_0x1d86ce['error'][_0xc3de('0x13')]);}else{logger[_0xc3de('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2c79f3,_0xc3de('0xe'));_0x47957a(_0x1d86ce[_0xc3de('0x14')][_0xc3de('0x13')]);}})[_0xc3de('0x15')](function(_0x26e440){logger[_0xc3de('0x11')](_0xc3de('0xd'),_0x2c79f3,_0x26e440);_0x1cf2c9(_0x26e440);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 78a0808..52519c4 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 _0x4b46=['get','/:id','show','post','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','isAuthenticated'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0x4b46,0x1a8));var _0x64b4=function(_0x30b307,_0x42cea0){_0x30b307=_0x30b307-0x0;var _0x15e995=_0x4b46[_0x30b307];return _0x15e995;};'use strict';var multer=require(_0x64b4('0x0'));var util=require('util');var path=require(_0x64b4('0x1'));var timeout=require('connect-timeout');var express=require(_0x64b4('0x2'));var router=express[_0x64b4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x64b4('0x4'));var interaction=require(_0x64b4('0x5'));var config=require('../../config/environment');var controller=require(_0x64b4('0x6'));router['get']('/',auth[_0x64b4('0x7')](),controller['index']);router[_0x64b4('0x8')](_0x64b4('0x9'),auth['isAuthenticated'](),controller[_0x64b4('0xa')]);router[_0x64b4('0xb')]('/',auth[_0x64b4('0x7')](),controller['create']);router['put']('/:id',auth[_0x64b4('0x7')](),controller[_0x64b4('0xc')]);router[_0x64b4('0xd')]('/:id',auth[_0x64b4('0x7')](),controller[_0x64b4('0xe')]);module[_0x64b4('0xf')]=router; \ No newline at end of file +var _0x00be=['isAuthenticated','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id'];(function(_0x14a83a,_0x54500b){var _0x474b3d=function(_0x252db6){while(--_0x252db6){_0x14a83a['push'](_0x14a83a['shift']());}};_0x474b3d(++_0x54500b);}(_0x00be,0xe3));var _0xe00b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x00be[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0xe00b('0x0'));var util=require(_0xe00b('0x1'));var path=require(_0xe00b('0x2'));var timeout=require(_0xe00b('0x3'));var express=require(_0xe00b('0x4'));var router=express['Router']();var fs_extra=require(_0xe00b('0x5'));var auth=require(_0xe00b('0x6'));var interaction=require(_0xe00b('0x7'));var config=require(_0xe00b('0x8'));var controller=require(_0xe00b('0x9'));router[_0xe00b('0xa')]('/',auth['isAuthenticated'](),controller[_0xe00b('0xb')]);router[_0xe00b('0xa')](_0xe00b('0xc'),auth[_0xe00b('0xd')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe00b('0xc'),auth[_0xe00b('0xd')](),controller[_0xe00b('0xe')]);router['delete'](_0xe00b('0xc'),auth['isAuthenticated'](),controller[_0xe00b('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 74854da..2bc064b 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 _0xecc1=['STRING','customVariable','sequelize','ENUM','variable','picklist','string'];(function(_0x20259c,_0xe43fb2){var _0x4d988e=function(_0x2097b9){while(--_0x2097b9){_0x20259c['push'](_0x20259c['shift']());}};_0x4d988e(++_0xe43fb2);}(_0xecc1,0x167));var _0x1ecc=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xecc1[_0x1dbaf7];return _0x593f05;};'use strict';var Sequelize=require(_0x1ecc('0x0'));module['exports']={'type':{'type':Sequelize[_0x1ecc('0x1')]('string',_0x1ecc('0x2'),'customVariable','keyValue',_0x1ecc('0x3')),'defaultValue':_0x1ecc('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1ecc('0x5')]},'keyType':{'type':Sequelize[_0x1ecc('0x1')]('string',_0x1ecc('0x2'),_0x1ecc('0x6'))},'keyContent':{'type':Sequelize[_0x1ecc('0x5')]},'idField':{'type':Sequelize[_0x1ecc('0x5')]},'nameField':{'type':Sequelize[_0x1ecc('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ecc('0x5')]}}; \ No newline at end of file +var _0xb3bf=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x45f723,_0x2dc573){var _0x516734=function(_0x19453f){while(--_0x19453f){_0x45f723['push'](_0x45f723['shift']());}};_0x516734(++_0x2dc573);}(_0xb3bf,0x13f));var _0xfb3b=function(_0x3b4ce6,_0x5c5d3f){_0x3b4ce6=_0x3b4ce6-0x0;var _0x3098ed=_0xb3bf[_0x3b4ce6];return _0x3098ed;};'use strict';var Sequelize=require(_0xfb3b('0x0'));module[_0xfb3b('0x1')]={'type':{'type':Sequelize[_0xfb3b('0x2')](_0xfb3b('0x3'),'variable',_0xfb3b('0x4'),_0xfb3b('0x5'),_0xfb3b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfb3b('0x7')]},'keyType':{'type':Sequelize[_0xfb3b('0x2')](_0xfb3b('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xfb3b('0x7')]},'idField':{'type':Sequelize[_0xfb3b('0x7')]},'nameField':{'type':Sequelize[_0xfb3b('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfb3b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 04057fe..d009ad3 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 _0xd846=['model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','fields','options','find','catch','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','query','keys','filters','attributes','intersection'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd846,0xad));var _0x6d84=function(_0x35b214,_0x158bd2){_0x35b214=_0x35b214-0x0;var _0x515407=_0xd846[_0x35b214];return _0x515407;};'use strict';var emlformat=require(_0x6d84('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d84('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d84('0x2'));var moment=require(_0x6d84('0x3'));var BPromise=require(_0x6d84('0x4'));var Mustache=require(_0x6d84('0x5'));var util=require(_0x6d84('0x6'));var path=require(_0x6d84('0x7'));var sox=require(_0x6d84('0x8'));var csv=require('to-csv');var ejs=require(_0x6d84('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d84('0xa'));var squel=require('squel');var crypto=require(_0x6d84('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6d84('0xc'));var toCsv=require(_0x6d84('0xd'));var querystring=require(_0x6d84('0xe'));var Papa=require(_0x6d84('0xf'));var Redis=require(_0x6d84('0x10'));var authService=require(_0x6d84('0x11'));var qs=require(_0x6d84('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d84('0x13'));var logger=require(_0x6d84('0x14'))(_0x6d84('0x15'));var utils=require(_0x6d84('0x16'));var config=require(_0x6d84('0x17'));var licenseUtil=require(_0x6d84('0x18'));var db=require(_0x6d84('0x19'))['db'];function respondWithStatusCode(_0x484600,_0x21e9b0){_0x21e9b0=_0x21e9b0||0xcc;return function(_0xaa0476){if(_0xaa0476){return _0x484600[_0x6d84('0x1a')](_0x21e9b0);}return _0x484600[_0x6d84('0x1b')](_0x21e9b0)[_0x6d84('0x1c')]();};}function respondWithResult(_0x4a91b0,_0x41f00a){_0x41f00a=_0x41f00a||0xc8;return function(_0x4abb41){if(_0x4abb41){return _0x4a91b0[_0x6d84('0x1b')](_0x41f00a)[_0x6d84('0x1d')](_0x4abb41);}};}function respondWithFilteredResult(_0x494ecd,_0x278bc0){return function(_0x32276e){if(_0x32276e){var _0x51e97b=typeof _0x278bc0[_0x6d84('0x1e')]==='undefined'&&typeof _0x278bc0[_0x6d84('0x1f')]===_0x6d84('0x20');var _0x4a9e9f=_0x32276e[_0x6d84('0x21')];var _0x52ac23=_0x51e97b?0x0:_0x278bc0[_0x6d84('0x1e')];var _0x119077=_0x51e97b?_0x32276e[_0x6d84('0x21')]:_0x278bc0[_0x6d84('0x1e')]+_0x278bc0[_0x6d84('0x1f')];var _0x3abe9e;if(_0x119077>=_0x4a9e9f){_0x119077=_0x4a9e9f;_0x3abe9e=0xc8;}else{_0x3abe9e=0xce;}_0x494ecd[_0x6d84('0x1b')](_0x3abe9e);return _0x494ecd[_0x6d84('0x22')](_0x6d84('0x23'),_0x52ac23+'-'+_0x119077+'/'+_0x4a9e9f)['json'](_0x32276e);}return null;};}function patchUpdates(_0x26289a){return function(_0x55f2b6){try{jsonpatch[_0x6d84('0x24')](_0x55f2b6,_0x26289a,!![]);}catch(_0x777d98){return BPromise['reject'](_0x777d98);}return _0x55f2b6[_0x6d84('0x25')]();};}function saveUpdates(_0x14640d,_0x219095){return function(_0x253ef8){if(_0x253ef8){return _0x253ef8[_0x6d84('0x26')](_0x14640d)[_0x6d84('0x27')](function(_0x5f494f){return _0x5f494f;});}return null;};}function removeEntity(_0x546c6d,_0x5eeaf2){return function(_0x523869){if(_0x523869){return _0x523869['destroy']()[_0x6d84('0x27')](function(){_0x546c6d[_0x6d84('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48a3f2,_0x5e67c9){return function(_0x438277){if(!_0x438277){_0x48a3f2[_0x6d84('0x1a')](0x194);}return _0x438277;};}function handleError(_0xc1136f,_0x2e05f0){_0x2e05f0=_0x2e05f0||0x1f4;return function(_0x6ac4fc){logger[_0x6d84('0x28')](_0x6ac4fc[_0x6d84('0x29')]);if(_0x6ac4fc[_0x6d84('0x2a')]){delete _0x6ac4fc[_0x6d84('0x2a')];}_0xc1136f[_0x6d84('0x1b')](_0x2e05f0)[_0x6d84('0x2b')](_0x6ac4fc);};}exports[_0x6d84('0x2c')]=function(_0x41c540,_0x4a8adf){var _0x44c981={},_0x2faa00={},_0x8b6e04={'count':0x0,'rows':[]};var _0x140b60=_[_0x6d84('0x2d')](db[_0x6d84('0x2e')][_0x6d84('0x2f')],function(_0xff1523){return{'name':_0xff1523['fieldName'],'type':_0xff1523[_0x6d84('0x30')][_0x6d84('0x31')]};});_0x2faa00['model']=_[_0x6d84('0x2d')](_0x140b60,_0x6d84('0x2a'));_0x2faa00[_0x6d84('0x32')]=_[_0x6d84('0x33')](_0x41c540[_0x6d84('0x32')]);_0x2faa00[_0x6d84('0x34')]=_['intersection'](_0x2faa00['model'],_0x2faa00['query']);_0x44c981[_0x6d84('0x35')]=_[_0x6d84('0x36')](_0x2faa00[_0x6d84('0x37')],qs['fields'](_0x41c540[_0x6d84('0x32')]['fields']));_0x44c981['attributes']=_0x44c981[_0x6d84('0x35')]['length']?_0x44c981[_0x6d84('0x35')]:_0x2faa00[_0x6d84('0x37')];if(!_0x41c540['query'][_0x6d84('0x38')](_0x6d84('0x39'))){_0x44c981['limit']=qs[_0x6d84('0x1f')](_0x41c540[_0x6d84('0x32')][_0x6d84('0x1f')]);_0x44c981[_0x6d84('0x1e')]=qs[_0x6d84('0x1e')](_0x41c540[_0x6d84('0x32')][_0x6d84('0x1e')]);}_0x44c981[_0x6d84('0x3a')]=qs[_0x6d84('0x3b')](_0x41c540[_0x6d84('0x32')][_0x6d84('0x3b')]);_0x44c981[_0x6d84('0x3c')]=qs['filters'](_[_0x6d84('0x3d')](_0x41c540[_0x6d84('0x32')],_0x2faa00['filters']),_0x140b60);if(_0x41c540[_0x6d84('0x32')][_0x6d84('0x3e')]){_0x44c981[_0x6d84('0x3c')]=_[_0x6d84('0x3f')](_0x44c981[_0x6d84('0x3c')],{'$or':_[_0x6d84('0x2d')](_0x140b60,function(_0x135360){if(_0x135360[_0x6d84('0x30')]!==_0x6d84('0x40')){var _0x2862e2={};_0x2862e2[_0x135360[_0x6d84('0x2a')]]={'$like':'%'+_0x41c540[_0x6d84('0x32')][_0x6d84('0x3e')]+'%'};return _0x2862e2;}})});}_0x44c981=_[_0x6d84('0x3f')]({},_0x44c981,_0x41c540['options']);var _0x2398f2={'where':_0x44c981[_0x6d84('0x3c')]};return db['ServicenowField'][_0x6d84('0x21')](_0x2398f2)[_0x6d84('0x27')](function(_0x2198e5){_0x8b6e04[_0x6d84('0x21')]=_0x2198e5;if(_0x41c540[_0x6d84('0x32')][_0x6d84('0x41')]){_0x44c981['include']=[{'all':!![]}];}return db[_0x6d84('0x2e')][_0x6d84('0x42')](_0x44c981);})[_0x6d84('0x27')](function(_0x2f96d0){_0x8b6e04[_0x6d84('0x43')]=_0x2f96d0;return _0x8b6e04;})[_0x6d84('0x27')](respondWithFilteredResult(_0x4a8adf,_0x44c981))['catch'](handleError(_0x4a8adf,null));};exports['show']=function(_0x25273c,_0x405b3a){var _0x1c1e5a={'raw':!![],'where':{'id':_0x25273c[_0x6d84('0x44')]['id']}},_0x15407a={};_0x15407a[_0x6d84('0x37')]=_['keys'](db[_0x6d84('0x2e')][_0x6d84('0x2f')]);_0x15407a[_0x6d84('0x32')]=_[_0x6d84('0x33')](_0x25273c[_0x6d84('0x32')]);_0x15407a['filters']=_['intersection'](_0x15407a['model'],_0x15407a[_0x6d84('0x32')]);_0x1c1e5a[_0x6d84('0x35')]=_[_0x6d84('0x36')](_0x15407a[_0x6d84('0x37')],qs[_0x6d84('0x45')](_0x25273c[_0x6d84('0x32')][_0x6d84('0x45')]));_0x1c1e5a[_0x6d84('0x35')]=_0x1c1e5a['attributes']['length']?_0x1c1e5a[_0x6d84('0x35')]:_0x15407a['model'];if(_0x25273c[_0x6d84('0x32')][_0x6d84('0x41')]){_0x1c1e5a['include']=[{'all':!![]}];}_0x1c1e5a=_[_0x6d84('0x3f')]({},_0x1c1e5a,_0x25273c[_0x6d84('0x46')]);return db[_0x6d84('0x2e')][_0x6d84('0x47')](_0x1c1e5a)['then'](handleEntityNotFound(_0x405b3a,null))['then'](respondWithResult(_0x405b3a,null))[_0x6d84('0x48')](handleError(_0x405b3a,null));};exports[_0x6d84('0x49')]=function(_0x5ab3dc,_0x43c389){return db[_0x6d84('0x2e')][_0x6d84('0x49')](_0x5ab3dc[_0x6d84('0x4a')],{})[_0x6d84('0x27')](respondWithResult(_0x43c389,0xc9))[_0x6d84('0x48')](handleError(_0x43c389,null));};exports[_0x6d84('0x26')]=function(_0x5e2900,_0x5c8d33){if(_0x5e2900[_0x6d84('0x4a')]['id']){delete _0x5e2900[_0x6d84('0x4a')]['id'];}return db[_0x6d84('0x2e')][_0x6d84('0x47')]({'where':{'id':_0x5e2900[_0x6d84('0x44')]['id']}})[_0x6d84('0x27')](handleEntityNotFound(_0x5c8d33,null))[_0x6d84('0x27')](saveUpdates(_0x5e2900[_0x6d84('0x4a')],null))[_0x6d84('0x27')](respondWithResult(_0x5c8d33,null))['catch'](handleError(_0x5c8d33,null));};exports[_0x6d84('0x4b')]=function(_0x109fe7,_0x3e8703){return db[_0x6d84('0x2e')][_0x6d84('0x47')]({'where':{'id':_0x109fe7[_0x6d84('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e8703,null))[_0x6d84('0x27')](removeEntity(_0x3e8703,null))['catch'](handleError(_0x3e8703,null));}; \ No newline at end of file +var _0x7b0f=['send','index','map','ServicenowField','rawAttributes','fieldName','model','keys','filters','query','attributes','intersection','fields','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','error','stack','name'];(function(_0x4437db,_0xb4e66a){var _0x128b3e=function(_0x2f48ab){while(--_0x2f48ab){_0x4437db['push'](_0x4437db['shift']());}};_0x128b3e(++_0xb4e66a);}(_0x7b0f,0x1ce));var _0xf7b0=function(_0x40ea15,_0x3853b5){_0x40ea15=_0x40ea15-0x0;var _0x20d4d9=_0x7b0f[_0x40ea15];return _0x20d4d9;};'use strict';var emlformat=require(_0xf7b0('0x0'));var rimraf=require(_0xf7b0('0x1'));var zipdir=require(_0xf7b0('0x2'));var jsonpatch=require(_0xf7b0('0x3'));var rp=require('request-promise');var moment=require(_0xf7b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7b0('0x5'));var util=require(_0xf7b0('0x6'));var path=require(_0xf7b0('0x7'));var sox=require('sox');var csv=require(_0xf7b0('0x8'));var ejs=require(_0xf7b0('0x9'));var fs=require('fs');var fs_extra=require(_0xf7b0('0xa'));var _=require(_0xf7b0('0xb'));var squel=require('squel');var crypto=require(_0xf7b0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf7b0('0x8'));var querystring=require(_0xf7b0('0xd'));var Papa=require(_0xf7b0('0xe'));var Redis=require(_0xf7b0('0xf'));var authService=require(_0xf7b0('0x10'));var qs=require(_0xf7b0('0x11'));var as=require(_0xf7b0('0x12'));var hardwareService=require(_0xf7b0('0x13'));var logger=require(_0xf7b0('0x14'))(_0xf7b0('0x15'));var utils=require(_0xf7b0('0x16'));var config=require(_0xf7b0('0x17'));var licenseUtil=require(_0xf7b0('0x18'));var db=require(_0xf7b0('0x19'))['db'];function respondWithStatusCode(_0x532c4b,_0x37ca30){_0x37ca30=_0x37ca30||0xcc;return function(_0x382df0){if(_0x382df0){return _0x532c4b[_0xf7b0('0x1a')](_0x37ca30);}return _0x532c4b['status'](_0x37ca30)[_0xf7b0('0x1b')]();};}function respondWithResult(_0x3c842b,_0x479101){_0x479101=_0x479101||0xc8;return function(_0x1546db){if(_0x1546db){return _0x3c842b[_0xf7b0('0x1c')](_0x479101)[_0xf7b0('0x1d')](_0x1546db);}};}function respondWithFilteredResult(_0x5ca6f1,_0x1c42d6){return function(_0x5b9518){if(_0x5b9518){var _0x568a7d=typeof _0x1c42d6[_0xf7b0('0x1e')]===_0xf7b0('0x1f')&&typeof _0x1c42d6['limit']===_0xf7b0('0x1f');var _0x3c6163=_0x5b9518['count'];var _0x37c834=_0x568a7d?0x0:_0x1c42d6[_0xf7b0('0x1e')];var _0x2b71c6=_0x568a7d?_0x5b9518[_0xf7b0('0x20')]:_0x1c42d6[_0xf7b0('0x1e')]+_0x1c42d6[_0xf7b0('0x21')];var _0x255a70;if(_0x2b71c6>=_0x3c6163){_0x2b71c6=_0x3c6163;_0x255a70=0xc8;}else{_0x255a70=0xce;}_0x5ca6f1[_0xf7b0('0x1c')](_0x255a70);return _0x5ca6f1[_0xf7b0('0x22')](_0xf7b0('0x23'),_0x37c834+'-'+_0x2b71c6+'/'+_0x3c6163)['json'](_0x5b9518);}return null;};}function patchUpdates(_0x2f73c3){return function(_0x52e0cf){try{jsonpatch[_0xf7b0('0x24')](_0x52e0cf,_0x2f73c3,!![]);}catch(_0x4d5f8c){return BPromise['reject'](_0x4d5f8c);}return _0x52e0cf[_0xf7b0('0x25')]();};}function saveUpdates(_0x3c46be,_0x40edfb){return function(_0x5a70cc){if(_0x5a70cc){return _0x5a70cc['update'](_0x3c46be)['then'](function(_0x210a3b){return _0x210a3b;});}return null;};}function removeEntity(_0x36e02d,_0x31acff){return function(_0x5d7444){if(_0x5d7444){return _0x5d7444[_0xf7b0('0x26')]()['then'](function(){_0x36e02d[_0xf7b0('0x1c')](0xcc)[_0xf7b0('0x1b')]();});}};}function handleEntityNotFound(_0x1abd85,_0x3ffff7){return function(_0x16d636){if(!_0x16d636){_0x1abd85[_0xf7b0('0x1a')](0x194);}return _0x16d636;};}function handleError(_0x364bca,_0x1943bc){_0x1943bc=_0x1943bc||0x1f4;return function(_0x1fb7ab){logger[_0xf7b0('0x27')](_0x1fb7ab[_0xf7b0('0x28')]);if(_0x1fb7ab[_0xf7b0('0x29')]){delete _0x1fb7ab[_0xf7b0('0x29')];}_0x364bca[_0xf7b0('0x1c')](_0x1943bc)[_0xf7b0('0x2a')](_0x1fb7ab);};}exports[_0xf7b0('0x2b')]=function(_0x1c81e7,_0x4de9b4){var _0xf9bfb={},_0x458778={},_0xd3c33d={'count':0x0,'rows':[]};var _0x1c9327=_[_0xf7b0('0x2c')](db[_0xf7b0('0x2d')][_0xf7b0('0x2e')],function(_0xcac160){return{'name':_0xcac160[_0xf7b0('0x2f')],'type':_0xcac160['type']['key']};});_0x458778[_0xf7b0('0x30')]=_[_0xf7b0('0x2c')](_0x1c9327,_0xf7b0('0x29'));_0x458778['query']=_[_0xf7b0('0x31')](_0x1c81e7['query']);_0x458778[_0xf7b0('0x32')]=_['intersection'](_0x458778[_0xf7b0('0x30')],_0x458778[_0xf7b0('0x33')]);_0xf9bfb[_0xf7b0('0x34')]=_[_0xf7b0('0x35')](_0x458778['model'],qs[_0xf7b0('0x36')](_0x1c81e7[_0xf7b0('0x33')][_0xf7b0('0x36')]));_0xf9bfb[_0xf7b0('0x34')]=_0xf9bfb[_0xf7b0('0x34')]['length']?_0xf9bfb[_0xf7b0('0x34')]:_0x458778[_0xf7b0('0x30')];if(!_0x1c81e7[_0xf7b0('0x33')]['hasOwnProperty']('nolimit')){_0xf9bfb['limit']=qs['limit'](_0x1c81e7[_0xf7b0('0x33')][_0xf7b0('0x21')]);_0xf9bfb[_0xf7b0('0x1e')]=qs[_0xf7b0('0x1e')](_0x1c81e7[_0xf7b0('0x33')]['offset']);}_0xf9bfb[_0xf7b0('0x37')]=qs[_0xf7b0('0x38')](_0x1c81e7[_0xf7b0('0x33')][_0xf7b0('0x38')]);_0xf9bfb[_0xf7b0('0x39')]=qs[_0xf7b0('0x32')](_['pick'](_0x1c81e7['query'],_0x458778[_0xf7b0('0x32')]),_0x1c9327);if(_0x1c81e7[_0xf7b0('0x33')][_0xf7b0('0x3a')]){_0xf9bfb[_0xf7b0('0x39')]=_[_0xf7b0('0x3b')](_0xf9bfb[_0xf7b0('0x39')],{'$or':_[_0xf7b0('0x2c')](_0x1c9327,function(_0xd9ff1){if(_0xd9ff1[_0xf7b0('0x3c')]!==_0xf7b0('0x3d')){var _0x30213c={};_0x30213c[_0xd9ff1[_0xf7b0('0x29')]]={'$like':'%'+_0x1c81e7[_0xf7b0('0x33')][_0xf7b0('0x3a')]+'%'};return _0x30213c;}})});}_0xf9bfb=_['merge']({},_0xf9bfb,_0x1c81e7[_0xf7b0('0x3e')]);var _0x126ac3={'where':_0xf9bfb[_0xf7b0('0x39')]};return db[_0xf7b0('0x2d')][_0xf7b0('0x20')](_0x126ac3)['then'](function(_0x37a8a6){_0xd3c33d['count']=_0x37a8a6;if(_0x1c81e7[_0xf7b0('0x33')][_0xf7b0('0x3f')]){_0xf9bfb[_0xf7b0('0x40')]=[{'all':!![]}];}return db[_0xf7b0('0x2d')][_0xf7b0('0x41')](_0xf9bfb);})[_0xf7b0('0x42')](function(_0x1104a4){_0xd3c33d['rows']=_0x1104a4;return _0xd3c33d;})['then'](respondWithFilteredResult(_0x4de9b4,_0xf9bfb))[_0xf7b0('0x43')](handleError(_0x4de9b4,null));};exports['show']=function(_0x3e47ab,_0x44bc59){var _0x4034db={'raw':!![],'where':{'id':_0x3e47ab[_0xf7b0('0x44')]['id']}},_0x2c4757={};_0x2c4757['model']=_[_0xf7b0('0x31')](db[_0xf7b0('0x2d')][_0xf7b0('0x2e')]);_0x2c4757['query']=_['keys'](_0x3e47ab[_0xf7b0('0x33')]);_0x2c4757[_0xf7b0('0x32')]=_[_0xf7b0('0x35')](_0x2c4757[_0xf7b0('0x30')],_0x2c4757[_0xf7b0('0x33')]);_0x4034db[_0xf7b0('0x34')]=_[_0xf7b0('0x35')](_0x2c4757[_0xf7b0('0x30')],qs[_0xf7b0('0x36')](_0x3e47ab[_0xf7b0('0x33')][_0xf7b0('0x36')]));_0x4034db['attributes']=_0x4034db[_0xf7b0('0x34')]['length']?_0x4034db[_0xf7b0('0x34')]:_0x2c4757[_0xf7b0('0x30')];if(_0x3e47ab[_0xf7b0('0x33')]['includeAll']){_0x4034db[_0xf7b0('0x40')]=[{'all':!![]}];}_0x4034db=_['merge']({},_0x4034db,_0x3e47ab[_0xf7b0('0x3e')]);return db[_0xf7b0('0x2d')]['find'](_0x4034db)[_0xf7b0('0x42')](handleEntityNotFound(_0x44bc59,null))[_0xf7b0('0x42')](respondWithResult(_0x44bc59,null))[_0xf7b0('0x43')](handleError(_0x44bc59,null));};exports[_0xf7b0('0x45')]=function(_0x5270c0,_0x2075bf){return db['ServicenowField']['create'](_0x5270c0[_0xf7b0('0x46')],{})['then'](respondWithResult(_0x2075bf,0xc9))[_0xf7b0('0x43')](handleError(_0x2075bf,null));};exports['update']=function(_0x1b3e85,_0x326be0){if(_0x1b3e85['body']['id']){delete _0x1b3e85[_0xf7b0('0x46')]['id'];}return db[_0xf7b0('0x2d')][_0xf7b0('0x47')]({'where':{'id':_0x1b3e85['params']['id']}})[_0xf7b0('0x42')](handleEntityNotFound(_0x326be0,null))[_0xf7b0('0x42')](saveUpdates(_0x1b3e85[_0xf7b0('0x46')],null))['then'](respondWithResult(_0x326be0,null))['catch'](handleError(_0x326be0,null));};exports['destroy']=function(_0x45a463,_0x197e28){return db[_0xf7b0('0x2d')][_0xf7b0('0x47')]({'where':{'id':_0x45a463[_0xf7b0('0x44')]['id']}})[_0xf7b0('0x42')](handleEntityNotFound(_0x197e28,null))[_0xf7b0('0x42')](removeEntity(_0x197e28,null))[_0xf7b0('0x43')](handleError(_0x197e28,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 19d1232..bf775cd 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 _0xee3e=['api','bluebird','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x586207,_0x297988){var _0x3032a3=function(_0x4ace85){while(--_0x4ace85){_0x586207['push'](_0x586207['shift']());}};_0x3032a3(++_0x297988);}(_0xee3e,0x1aa));var _0xeee3=function(_0x41a097,_0x51dce8){_0x41a097=_0x41a097-0x0;var _0x45486b=_0xee3e[_0x41a097];return _0x45486b;};'use strict';var _=require(_0xeee3('0x0'));var util=require(_0xeee3('0x1'));var logger=require(_0xeee3('0x2'))(_0xeee3('0x3'));var moment=require('moment');var BPromise=require(_0xeee3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeee3('0x5'));var attributes=require(_0xeee3('0x6'));module[_0xeee3('0x7')]=function(_0x3eb011,_0x3487c2){return _0x3eb011[_0xeee3('0x8')](_0xeee3('0x9'),attributes,{'tableName':_0xeee3('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xeee3('0xb'),_0xeee3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x96ce=['api','moment','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x96ce,0x123));var _0xe96c=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0x96ce[_0x127c7b];return _0x1708eb;};'use strict';var _=require(_0xe96c('0x0'));var util=require(_0xe96c('0x1'));var logger=require(_0xe96c('0x2'))(_0xe96c('0x3'));var moment=require(_0xe96c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe96c('0x5'));var rimraf=require(_0xe96c('0x6'));var config=require(_0xe96c('0x7'));var attributes=require(_0xe96c('0x8'));module[_0xe96c('0x9')]=function(_0x28f80a,_0x59bb93){return _0x28f80a[_0xe96c('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xe96c('0xb'),'fields':[_0xe96c('0xc'),_0xe96c('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 5bead7f..864a44f 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x382868,_0xb5acfd){_0x382868=_0x382868-0x0;var _0x43e191=_0xbdb7[_0x382868];return _0x43e191;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _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(_0x568b6a,_0x302921){var _0x9de80c=function(_0x5a5fc4){while(--_0x5a5fc4){_0x568b6a['push'](_0x568b6a['shift']());}};_0x9de80c(++_0x302921);}(_0xb43b,0x1b2));var _0xbb43=function(_0xaa8745,_0x11a703){_0xaa8745=_0xaa8745-0x0;var _0x1fcd1e=_0xb43b[_0xaa8745];return _0x1fcd1e;};'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 4692583..d171d1a 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(_0x6ca7e6,_0x8d1556){var _0x1b2bd5=function(_0x39472a){while(--_0x39472a){_0x6ca7e6['push'](_0x6ca7e6['shift']());}};_0x1b2bd5(++_0x8d1556);}(_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','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1d70a4,_0x379d2c){var _0xe10a25=function(_0x3d8368){while(--_0x3d8368){_0x1d70a4['push'](_0x1d70a4['shift']());}};_0xe10a25(++_0x379d2c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 5b13694..2eb965a 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(_0x115382,_0x4f08c4){var _0x24dea7=function(_0x1e646e){while(--_0x1e646e){_0x115382['push'](_0x115382['shift']());}};_0x24dea7(++_0x4f08c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x264295,_0x172c74){var _0x414112=function(_0x42bfec){while(--_0x42bfec){_0x264295['push'](_0x264295['shift']());}};_0x414112(++_0x172c74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 ba236db..56c38e0 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 _0xdc91=['%s%s','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','/service/v4_1/rest.php','get_module_fields','stringify','values','module_fields','remove','includes','label','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','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','save','update','then','destroy','end','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','findOne','SugarcrmConfiguration','pick','getConfigurations','AccountId','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','slice','lastIndexOf','POST'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0xdc91,0x183));var _0x1dc9=function(_0x4d8900,_0x2559a1){_0x4d8900=_0x4d8900-0x0;var _0x217e05=_0xdc91[_0x4d8900];return _0x217e05;};'use strict';var emlformat=require(_0x1dc9('0x0'));var rimraf=require(_0x1dc9('0x1'));var zipdir=require(_0x1dc9('0x2'));var jsonpatch=require(_0x1dc9('0x3'));var rp=require(_0x1dc9('0x4'));var moment=require('moment');var BPromise=require(_0x1dc9('0x5'));var Mustache=require(_0x1dc9('0x6'));var util=require(_0x1dc9('0x7'));var path=require('path');var sox=require(_0x1dc9('0x8'));var csv=require('to-csv');var ejs=require(_0x1dc9('0x9'));var fs=require('fs');var fs_extra=require(_0x1dc9('0xa'));var _=require(_0x1dc9('0xb'));var squel=require(_0x1dc9('0xc'));var crypto=require(_0x1dc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1dc9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1dc9('0xf'));var authService=require(_0x1dc9('0x10'));var qs=require(_0x1dc9('0x11'));var as=require(_0x1dc9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dc9('0x13'))(_0x1dc9('0x14'));var utils=require(_0x1dc9('0x15'));var config=require(_0x1dc9('0x16'));var licenseUtil=require(_0x1dc9('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1dc9('0x18'));function respondWithStatusCode(_0x209472,_0x34b914){_0x34b914=_0x34b914||0xcc;return function(_0x469e31){if(_0x469e31){return _0x209472[_0x1dc9('0x19')](_0x34b914);}return _0x209472['status'](_0x34b914)['end']();};}function respondWithResult(_0x4572b4,_0x5d2478){_0x5d2478=_0x5d2478||0xc8;return function(_0xd6c7a9){if(_0xd6c7a9){return _0x4572b4[_0x1dc9('0x1a')](_0x5d2478)[_0x1dc9('0x1b')](_0xd6c7a9);}};}function respondWithFilteredResult(_0x1abf27,_0x5c346f){return function(_0x3d5833){if(_0x3d5833){var _0x2b14ec=typeof _0x5c346f[_0x1dc9('0x1c')]===_0x1dc9('0x1d')&&typeof _0x5c346f[_0x1dc9('0x1e')]===_0x1dc9('0x1d');var _0x13028e=_0x3d5833[_0x1dc9('0x1f')];var _0x187922=_0x2b14ec?0x0:_0x5c346f[_0x1dc9('0x1c')];var _0x4e3eb7=_0x2b14ec?_0x3d5833['count']:_0x5c346f[_0x1dc9('0x1c')]+_0x5c346f['limit'];var _0x80913f;if(_0x4e3eb7>=_0x13028e){_0x4e3eb7=_0x13028e;_0x80913f=0xc8;}else{_0x80913f=0xce;}_0x1abf27['status'](_0x80913f);return _0x1abf27[_0x1dc9('0x20')](_0x1dc9('0x21'),_0x187922+'-'+_0x4e3eb7+'/'+_0x13028e)['json'](_0x3d5833);}return null;};}function patchUpdates(_0x2a4119){return function(_0x4830ed){try{jsonpatch[_0x1dc9('0x22')](_0x4830ed,_0x2a4119,!![]);}catch(_0x396524){return BPromise[_0x1dc9('0x23')](_0x396524);}return _0x4830ed[_0x1dc9('0x24')]();};}function saveUpdates(_0x237cfc,_0x173fbf){return function(_0x3f2f51){if(_0x3f2f51){return _0x3f2f51[_0x1dc9('0x25')](_0x237cfc)[_0x1dc9('0x26')](function(_0x1d6911){return _0x1d6911;});}return null;};}function removeEntity(_0x3fc0c6,_0x2d94eb){return function(_0x125ae8){if(_0x125ae8){return _0x125ae8[_0x1dc9('0x27')]()[_0x1dc9('0x26')](function(){_0x3fc0c6['status'](0xcc)[_0x1dc9('0x28')]();});}};}function handleEntityNotFound(_0x2aa67a,_0x2ae3b1){return function(_0x59a651){if(!_0x59a651){_0x2aa67a[_0x1dc9('0x19')](0x194);}return _0x59a651;};}function handleError(_0x5e84ae,_0xf13b6f){_0xf13b6f=_0xf13b6f||0x1f4;return function(_0x182281){logger['error'](_0x182281['stack']);if(_0x182281[_0x1dc9('0x29')]){delete _0x182281[_0x1dc9('0x29')];}_0x5e84ae[_0x1dc9('0x1a')](_0xf13b6f)[_0x1dc9('0x2a')](_0x182281);};}exports[_0x1dc9('0x2b')]=function(_0x53c72a,_0xadad88){var _0x47ed2e={},_0x2b712c={},_0x46040a={'count':0x0,'rows':[]};var _0x43ee8f=_[_0x1dc9('0x2c')](db[_0x1dc9('0x2d')][_0x1dc9('0x2e')],function(_0xec2367){return{'name':_0xec2367[_0x1dc9('0x2f')],'type':_0xec2367[_0x1dc9('0x30')]['key']};});_0x2b712c[_0x1dc9('0x31')]=_[_0x1dc9('0x2c')](_0x43ee8f,_0x1dc9('0x29'));_0x2b712c['query']=_[_0x1dc9('0x32')](_0x53c72a['query']);_0x2b712c['filters']=_[_0x1dc9('0x33')](_0x2b712c[_0x1dc9('0x31')],_0x2b712c[_0x1dc9('0x34')]);_0x47ed2e[_0x1dc9('0x35')]=_[_0x1dc9('0x33')](_0x2b712c[_0x1dc9('0x31')],qs[_0x1dc9('0x36')](_0x53c72a['query']['fields']));_0x47ed2e[_0x1dc9('0x35')]=_0x47ed2e[_0x1dc9('0x35')][_0x1dc9('0x37')]?_0x47ed2e[_0x1dc9('0x35')]:_0x2b712c[_0x1dc9('0x31')];if(!_0x53c72a[_0x1dc9('0x34')][_0x1dc9('0x38')](_0x1dc9('0x39'))){_0x47ed2e[_0x1dc9('0x1e')]=qs['limit'](_0x53c72a[_0x1dc9('0x34')]['limit']);_0x47ed2e[_0x1dc9('0x1c')]=qs[_0x1dc9('0x1c')](_0x53c72a[_0x1dc9('0x34')][_0x1dc9('0x1c')]);}_0x47ed2e[_0x1dc9('0x3a')]=qs[_0x1dc9('0x3b')](_0x53c72a['query'][_0x1dc9('0x3b')]);_0x47ed2e[_0x1dc9('0x3c')]=qs[_0x1dc9('0x3d')](_['pick'](_0x53c72a[_0x1dc9('0x34')],_0x2b712c[_0x1dc9('0x3d')]),_0x43ee8f);if(_0x53c72a[_0x1dc9('0x34')][_0x1dc9('0x3e')]){_0x47ed2e['where']=_['merge'](_0x47ed2e[_0x1dc9('0x3c')],{'$or':_[_0x1dc9('0x2c')](_0x43ee8f,function(_0x2804d6){if(_0x2804d6[_0x1dc9('0x30')]!==_0x1dc9('0x3f')){var _0x5adf0b={};_0x5adf0b[_0x2804d6[_0x1dc9('0x29')]]={'$like':'%'+_0x53c72a[_0x1dc9('0x34')][_0x1dc9('0x3e')]+'%'};return _0x5adf0b;}})});}_0x47ed2e=_[_0x1dc9('0x40')]({},_0x47ed2e,_0x53c72a[_0x1dc9('0x41')]);var _0x31d776={'where':_0x47ed2e[_0x1dc9('0x3c')]};return db[_0x1dc9('0x2d')][_0x1dc9('0x1f')](_0x31d776)['then'](function(_0x455e46){_0x46040a['count']=_0x455e46;if(_0x53c72a[_0x1dc9('0x34')][_0x1dc9('0x42')]){_0x47ed2e[_0x1dc9('0x43')]=[{'all':!![]}];}return db[_0x1dc9('0x2d')][_0x1dc9('0x44')](_0x47ed2e);})[_0x1dc9('0x26')](function(_0x3f8327){_0x46040a['rows']=_0x3f8327;return _0x46040a;})[_0x1dc9('0x26')](respondWithFilteredResult(_0xadad88,_0x47ed2e))[_0x1dc9('0x45')](handleError(_0xadad88,null));};exports[_0x1dc9('0x46')]=function(_0x319657,_0x50e669){var _0x20ecf1={'raw':![],'where':{'id':_0x319657[_0x1dc9('0x47')]['id']}},_0x26fca0={};_0x26fca0[_0x1dc9('0x31')]=_[_0x1dc9('0x32')](db['SugarcrmAccount']['rawAttributes']);_0x26fca0['query']=_[_0x1dc9('0x32')](_0x319657[_0x1dc9('0x34')]);_0x26fca0[_0x1dc9('0x3d')]=_[_0x1dc9('0x33')](_0x26fca0[_0x1dc9('0x31')],_0x26fca0[_0x1dc9('0x34')]);_0x20ecf1[_0x1dc9('0x35')]=_[_0x1dc9('0x33')](_0x26fca0[_0x1dc9('0x31')],qs[_0x1dc9('0x36')](_0x319657[_0x1dc9('0x34')][_0x1dc9('0x36')]));_0x20ecf1[_0x1dc9('0x35')]=_0x20ecf1[_0x1dc9('0x35')]['length']?_0x20ecf1[_0x1dc9('0x35')]:_0x26fca0[_0x1dc9('0x31')];if(_0x319657[_0x1dc9('0x34')][_0x1dc9('0x42')]){_0x20ecf1[_0x1dc9('0x43')]=[{'all':!![]}];}_0x20ecf1=_['merge']({},_0x20ecf1,_0x319657[_0x1dc9('0x41')]);return db[_0x1dc9('0x2d')][_0x1dc9('0x48')](_0x20ecf1)[_0x1dc9('0x26')](handleEntityNotFound(_0x50e669,null))['then'](respondWithResult(_0x50e669,null))[_0x1dc9('0x45')](handleError(_0x50e669,null));};exports[_0x1dc9('0x49')]=function(_0x41ce6d,_0x2ca706){return db[_0x1dc9('0x2d')]['create'](_0x41ce6d[_0x1dc9('0x4a')],{})[_0x1dc9('0x26')](respondWithResult(_0x2ca706,0xc9))[_0x1dc9('0x45')](handleError(_0x2ca706,null));};exports[_0x1dc9('0x25')]=function(_0x31c890,_0x13d76a){if(_0x31c890[_0x1dc9('0x4a')]['id']){delete _0x31c890[_0x1dc9('0x4a')]['id'];}return db['SugarcrmAccount'][_0x1dc9('0x48')]({'where':{'id':_0x31c890[_0x1dc9('0x47')]['id']}})['then'](handleEntityNotFound(_0x13d76a,null))[_0x1dc9('0x26')](saveUpdates(_0x31c890[_0x1dc9('0x4a')],null))[_0x1dc9('0x26')](respondWithResult(_0x13d76a,null))['catch'](handleError(_0x13d76a,null));};exports[_0x1dc9('0x27')]=function(_0xd1bd7a,_0x27430c){return db[_0x1dc9('0x2d')]['find']({'where':{'id':_0xd1bd7a[_0x1dc9('0x47')]['id']}})[_0x1dc9('0x26')](handleEntityNotFound(_0x27430c,null))['then'](removeEntity(_0x27430c,null))[_0x1dc9('0x45')](handleError(_0x27430c,null));};exports['getConfigurations']=function(_0x7869af,_0x3be9f3,_0x19d9b3){var _0x1fe8ac={};var _0x436572={};var _0x1d559b;var _0xf809f4;return db[_0x1dc9('0x2d')][_0x1dc9('0x4b')]({'where':{'id':_0x7869af[_0x1dc9('0x47')]['id']}})[_0x1dc9('0x26')](handleEntityNotFound(_0x3be9f3,null))['then'](function(_0x4a59ac){if(_0x4a59ac){_0x1d559b=_0x4a59ac;_0x436572[_0x1dc9('0x31')]=_[_0x1dc9('0x32')](db[_0x1dc9('0x4c')][_0x1dc9('0x2e')]);_0x436572[_0x1dc9('0x34')]=_[_0x1dc9('0x32')](_0x7869af['query']);_0x436572[_0x1dc9('0x3d')]=_[_0x1dc9('0x33')](_0x436572[_0x1dc9('0x31')],_0x436572['query']);_0x1fe8ac[_0x1dc9('0x35')]=_[_0x1dc9('0x33')](_0x436572[_0x1dc9('0x31')],qs['fields'](_0x7869af[_0x1dc9('0x34')][_0x1dc9('0x36')]));_0x1fe8ac[_0x1dc9('0x35')]=_0x1fe8ac['attributes']['length']?_0x1fe8ac[_0x1dc9('0x35')]:_0x436572[_0x1dc9('0x31')];_0x1fe8ac[_0x1dc9('0x3a')]=qs[_0x1dc9('0x3b')](_0x7869af['query']['sort']);_0x1fe8ac[_0x1dc9('0x3c')]=qs['filters'](_[_0x1dc9('0x4d')](_0x7869af['query'],_0x436572[_0x1dc9('0x3d')]));if(_0x7869af[_0x1dc9('0x34')][_0x1dc9('0x3e')]){_0x1fe8ac[_0x1dc9('0x3c')]=_['merge'](_0x1fe8ac[_0x1dc9('0x3c')],{'$or':_[_0x1dc9('0x2c')](_0x1fe8ac[_0x1dc9('0x35')],function(_0x2730c0){var _0x43f8a1={};_0x43f8a1[_0x2730c0]={'$like':'%'+_0x7869af[_0x1dc9('0x34')][_0x1dc9('0x3e')]+'%'};return _0x43f8a1;})});}_0x1fe8ac=_[_0x1dc9('0x40')]({},_0x1fe8ac,_0x7869af[_0x1dc9('0x41')]);return _0x1d559b[_0x1dc9('0x4e')](_0x1fe8ac);}})[_0x1dc9('0x26')](function(_0x530f6d){if(_0x530f6d){_0xf809f4=_0x530f6d[_0x1dc9('0x37')];if(!_0x7869af['query'][_0x1dc9('0x38')]('nolimit')){_0x1fe8ac['limit']=qs[_0x1dc9('0x1e')](_0x7869af[_0x1dc9('0x34')][_0x1dc9('0x1e')]);_0x1fe8ac['offset']=qs[_0x1dc9('0x1c')](_0x7869af[_0x1dc9('0x34')][_0x1dc9('0x1c')]);}return _0x1d559b[_0x1dc9('0x4e')](_0x1fe8ac);}})[_0x1dc9('0x26')](function(_0x172556){if(_0x172556){return _0x172556?{'count':_0xf809f4,'rows':_0x172556}:null;}})[_0x1dc9('0x26')](respondWithResult(_0x3be9f3,null))[_0x1dc9('0x45')](handleError(_0x3be9f3,null));};exports['addConfiguration']=function(_0x1131a6,_0x4d47e6,_0x5e8588){if(_0x1131a6['body']['id']){delete _0x1131a6['body']['id'];}return db['SugarcrmAccount'][_0x1dc9('0x4b')]({'where':{'id':_0x1131a6[_0x1dc9('0x47')]['id']}})[_0x1dc9('0x26')](handleEntityNotFound(_0x4d47e6,null))[_0x1dc9('0x26')](function(_0x15be9c){if(_0x15be9c){_0x1131a6[_0x1dc9('0x4a')][_0x1dc9('0x4f')]=_0x15be9c['id'];_0x1131a6[_0x1dc9('0x4a')]['Subjects']=integrations['getSubjects'](_0x1131a6[_0x1dc9('0x4a')][_0x1dc9('0x50')],_0x1131a6['body'][_0x1dc9('0x30')]);_0x1131a6[_0x1dc9('0x4a')][_0x1dc9('0x51')]=integrations['getDescriptions'](_0x1131a6[_0x1dc9('0x4a')][_0x1dc9('0x50')],_0x1131a6[_0x1dc9('0x4a')][_0x1dc9('0x30')]);return db[_0x1dc9('0x4c')]['create'](_0x1131a6[_0x1dc9('0x4a')],{'include':[{'model':db[_0x1dc9('0x52')],'as':'Subjects'},{'model':db[_0x1dc9('0x52')],'as':_0x1dc9('0x51')}]});}return null;})[_0x1dc9('0x26')](respondWithResult(_0x4d47e6,null))[_0x1dc9('0x45')](handleError(_0x4d47e6,null));};exports['getFields']=function(_0x4acf2a,_0x4f9d96,_0x1a130d){var _0xfa6e03='';var _0x36aed4=['id',_0x1dc9('0x29'),_0x1dc9('0x53'),_0x1dc9('0x54'),_0x1dc9('0x55'),_0x1dc9('0x56'),_0x1dc9('0x57'),_0x1dc9('0x58'),_0x1dc9('0x59'),_0x1dc9('0x5a'),_0x1dc9('0x5b'),'direction'];return db[_0x1dc9('0x2d')][_0x1dc9('0x4b')]({'where':{'id':_0x4acf2a[_0x1dc9('0x47')]['id']},'attributes':['id','username',_0x1dc9('0x5c'),_0x1dc9('0x5d')]})[_0x1dc9('0x26')](handleEntityNotFound(_0x4f9d96,null))['then'](function(_0x3e8aa4){if(_0x3e8aa4){_0xfa6e03=_0x3e8aa4[_0x1dc9('0x5d')];var _0x20a726=_0xfa6e03[_0x1dc9('0x5e')](-0x1);if(_0x20a726==='/'){_0xfa6e03=_0xfa6e03['substring'](0x0,_0xfa6e03[_0x1dc9('0x5f')](_0x20a726));}return rp({'method':_0x1dc9('0x60'),'uri':util['format'](_0x1dc9('0x61'),_0xfa6e03,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x1dc9('0x62'),'response_type':_0x1dc9('0x62'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3e8aa4[_0x1dc9('0x63')],'password':_0x3e8aa4[_0x1dc9('0x5c')],'encryption':_0x1dc9('0x64')},'application':_0x1dc9('0x65')})}});}})[_0x1dc9('0x26')](function(_0x358d91){if(_0x358d91&&_0x358d91[_0x1dc9('0x29')]!==_0x1dc9('0x66')&&_0x358d91[_0x1dc9('0x29')]!==_0x1dc9('0x67')){return rp({'method':'POST','uri':util[_0x1dc9('0x68')]('%s%s',_0xfa6e03,_0x1dc9('0x69')),'json':!![],'form':{'method':_0x1dc9('0x6a'),'input_type':'JSON','response_type':_0x1dc9('0x62'),'rest_data':JSON[_0x1dc9('0x6b')]({'session':_0x358d91['id'],'module_name':'Calls'})}})[_0x1dc9('0x26')](function(_0x3a9ccb){if(_0x3a9ccb){var _0x216154=_[_0x1dc9('0x6c')](_0x3a9ccb[_0x1dc9('0x6d')]);_[_0x1dc9('0x6e')](_0x216154,function(_0x354f4a){return _0x36aed4[_0x1dc9('0x6f')](_0x354f4a[_0x1dc9('0x29')]);});return{'count':_0x216154[_0x1dc9('0x37')],'rows':_[_0x1dc9('0x2c')](_0x216154,function(_0x62bb63){return{'id':_0x62bb63[_0x1dc9('0x29')],'name':_0x62bb63[_0x1dc9('0x70')],'custom':_[_0x1dc9('0x71')](_0x62bb63[_0x1dc9('0x29')],'_c')?!![]:![],'options':_0x62bb63[_0x1dc9('0x41')]?_[_0x1dc9('0x2c')](_['values'](_0x62bb63[_0x1dc9('0x41')]),function(_0x481e2a){return{'name':_0x481e2a[_0x1dc9('0x72')],'value':_0x481e2a[_0x1dc9('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x4f9d96,null))['catch'](function(_0x47592e){var _0x27e6b0=_0x4acf2a[_0x1dc9('0x34')]['test']?0x1f4:_0x47592e[_0x1dc9('0x73')]||0x1f4;logger[_0x1dc9('0x74')](_0x1dc9('0x75'),_0x1dc9('0x76'),_0x27e6b0,JSON[_0x1dc9('0x6b')](_0x47592e));delete _0x47592e['name'];if(_0x27e6b0===0x191){_0x27e6b0=0x190;}_0x4f9d96[_0x1dc9('0x1a')](_0x27e6b0)[_0x1dc9('0x2a')](_0x4acf2a['query'][_0x1dc9('0x77')]?{'message':_0x1dc9('0x78'),'statusCode':_0x47592e[_0x1dc9('0x73')]}:_0x47592e);});}else{var _0x4d4752=0x1f4;_0x4f9d96['status'](_0x4d4752)['send']({'message':_0x1dc9('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x760e=['status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SugarcrmAccount','include','findAll','catch','params','includeAll','create','body','update','find','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','slice','substring','POST','%s%s','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x10b565,_0x36c8e7){var _0x2d84e4=function(_0x317b46){while(--_0x317b46){_0x10b565['push'](_0x10b565['shift']());}};_0x2d84e4(++_0x36c8e7);}(_0x760e,0x1d4));var _0xe760=function(_0x1323a5,_0x4b3ac4){_0x1323a5=_0x1323a5-0x0;var _0x30fec9=_0x760e[_0x1323a5];return _0x30fec9;};'use strict';var emlformat=require(_0xe760('0x0'));var rimraf=require(_0xe760('0x1'));var zipdir=require(_0xe760('0x2'));var jsonpatch=require(_0xe760('0x3'));var rp=require('request-promise');var moment=require(_0xe760('0x4'));var BPromise=require(_0xe760('0x5'));var Mustache=require(_0xe760('0x6'));var util=require('util');var path=require(_0xe760('0x7'));var sox=require(_0xe760('0x8'));var csv=require(_0xe760('0x9'));var ejs=require(_0xe760('0xa'));var fs=require('fs');var fs_extra=require(_0xe760('0xb'));var _=require(_0xe760('0xc'));var squel=require(_0xe760('0xd'));var crypto=require('crypto');var jsforce=require(_0xe760('0xe'));var deskjs=require(_0xe760('0xf'));var toCsv=require(_0xe760('0x9'));var querystring=require(_0xe760('0x10'));var Papa=require(_0xe760('0x11'));var Redis=require(_0xe760('0x12'));var authService=require(_0xe760('0x13'));var qs=require(_0xe760('0x14'));var as=require(_0xe760('0x15'));var hardwareService=require(_0xe760('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe760('0x17'));var config=require(_0xe760('0x18'));var licenseUtil=require(_0xe760('0x19'));var db=require(_0xe760('0x1a'))['db'];var integrations=require(_0xe760('0x1b'));function respondWithStatusCode(_0x4c46be,_0x50ced6){_0x50ced6=_0x50ced6||0xcc;return function(_0x11e58a){if(_0x11e58a){return _0x4c46be['sendStatus'](_0x50ced6);}return _0x4c46be[_0xe760('0x1c')](_0x50ced6)[_0xe760('0x1d')]();};}function respondWithResult(_0x32882a,_0xb7b5a6){_0xb7b5a6=_0xb7b5a6||0xc8;return function(_0x13c081){if(_0x13c081){return _0x32882a[_0xe760('0x1c')](_0xb7b5a6)[_0xe760('0x1e')](_0x13c081);}};}function respondWithFilteredResult(_0x40ebd3,_0x3b758a){return function(_0x1fa666){if(_0x1fa666){var _0x532806=typeof _0x3b758a[_0xe760('0x1f')]==='undefined'&&typeof _0x3b758a[_0xe760('0x20')]===_0xe760('0x21');var _0x248fec=_0x1fa666[_0xe760('0x22')];var _0x4b0b0a=_0x532806?0x0:_0x3b758a[_0xe760('0x1f')];var _0x7ebf45=_0x532806?_0x1fa666[_0xe760('0x22')]:_0x3b758a['offset']+_0x3b758a[_0xe760('0x20')];var _0xefdbd8;if(_0x7ebf45>=_0x248fec){_0x7ebf45=_0x248fec;_0xefdbd8=0xc8;}else{_0xefdbd8=0xce;}_0x40ebd3[_0xe760('0x1c')](_0xefdbd8);return _0x40ebd3[_0xe760('0x23')]('Content-Range',_0x4b0b0a+'-'+_0x7ebf45+'/'+_0x248fec)[_0xe760('0x1e')](_0x1fa666);}return null;};}function patchUpdates(_0x2d2348){return function(_0x33cb81){try{jsonpatch[_0xe760('0x24')](_0x33cb81,_0x2d2348,!![]);}catch(_0x58f803){return BPromise[_0xe760('0x25')](_0x58f803);}return _0x33cb81[_0xe760('0x26')]();};}function saveUpdates(_0x5362ed,_0x12fffe){return function(_0x260221){if(_0x260221){return _0x260221['update'](_0x5362ed)[_0xe760('0x27')](function(_0xeb86be){return _0xeb86be;});}return null;};}function removeEntity(_0x38996b,_0xa8f91e){return function(_0x47abba){if(_0x47abba){return _0x47abba[_0xe760('0x28')]()[_0xe760('0x27')](function(){_0x38996b[_0xe760('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a9ff6,_0x5b8165){return function(_0x2310d7){if(!_0x2310d7){_0x8a9ff6[_0xe760('0x29')](0x194);}return _0x2310d7;};}function handleError(_0x2d3f3f,_0x284d20){_0x284d20=_0x284d20||0x1f4;return function(_0x4d6e2b){logger[_0xe760('0x2a')](_0x4d6e2b['stack']);if(_0x4d6e2b[_0xe760('0x2b')]){delete _0x4d6e2b[_0xe760('0x2b')];}_0x2d3f3f['status'](_0x284d20)['send'](_0x4d6e2b);};}exports[_0xe760('0x2c')]=function(_0x44e92d,_0x8e7d4a){var _0x21fe9a={},_0x2ddc10={},_0x4ba8ad={'count':0x0,'rows':[]};var _0x425b65=_[_0xe760('0x2d')](db['SugarcrmAccount'][_0xe760('0x2e')],function(_0x506a96){return{'name':_0x506a96[_0xe760('0x2f')],'type':_0x506a96['type']['key']};});_0x2ddc10[_0xe760('0x30')]=_[_0xe760('0x2d')](_0x425b65,_0xe760('0x2b'));_0x2ddc10['query']=_[_0xe760('0x31')](_0x44e92d['query']);_0x2ddc10[_0xe760('0x32')]=_[_0xe760('0x33')](_0x2ddc10[_0xe760('0x30')],_0x2ddc10[_0xe760('0x34')]);_0x21fe9a[_0xe760('0x35')]=_[_0xe760('0x33')](_0x2ddc10[_0xe760('0x30')],qs[_0xe760('0x36')](_0x44e92d[_0xe760('0x34')]['fields']));_0x21fe9a[_0xe760('0x35')]=_0x21fe9a[_0xe760('0x35')][_0xe760('0x37')]?_0x21fe9a[_0xe760('0x35')]:_0x2ddc10['model'];if(!_0x44e92d[_0xe760('0x34')]['hasOwnProperty'](_0xe760('0x38'))){_0x21fe9a[_0xe760('0x20')]=qs['limit'](_0x44e92d[_0xe760('0x34')][_0xe760('0x20')]);_0x21fe9a[_0xe760('0x1f')]=qs[_0xe760('0x1f')](_0x44e92d['query'][_0xe760('0x1f')]);}_0x21fe9a[_0xe760('0x39')]=qs[_0xe760('0x3a')](_0x44e92d[_0xe760('0x34')][_0xe760('0x3a')]);_0x21fe9a[_0xe760('0x3b')]=qs[_0xe760('0x32')](_[_0xe760('0x3c')](_0x44e92d[_0xe760('0x34')],_0x2ddc10[_0xe760('0x32')]),_0x425b65);if(_0x44e92d[_0xe760('0x34')][_0xe760('0x3d')]){_0x21fe9a['where']=_[_0xe760('0x3e')](_0x21fe9a[_0xe760('0x3b')],{'$or':_[_0xe760('0x2d')](_0x425b65,function(_0x2dcd27){if(_0x2dcd27[_0xe760('0x3f')]!==_0xe760('0x40')){var _0x5dccf4={};_0x5dccf4[_0x2dcd27['name']]={'$like':'%'+_0x44e92d['query']['filter']+'%'};return _0x5dccf4;}})});}_0x21fe9a=_[_0xe760('0x3e')]({},_0x21fe9a,_0x44e92d[_0xe760('0x41')]);var _0xd88eb4={'where':_0x21fe9a[_0xe760('0x3b')]};return db[_0xe760('0x42')]['count'](_0xd88eb4)[_0xe760('0x27')](function(_0x5d8286){_0x4ba8ad[_0xe760('0x22')]=_0x5d8286;if(_0x44e92d[_0xe760('0x34')]['includeAll']){_0x21fe9a[_0xe760('0x43')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xe760('0x44')](_0x21fe9a);})[_0xe760('0x27')](function(_0x384dfd){_0x4ba8ad['rows']=_0x384dfd;return _0x4ba8ad;})[_0xe760('0x27')](respondWithFilteredResult(_0x8e7d4a,_0x21fe9a))[_0xe760('0x45')](handleError(_0x8e7d4a,null));};exports['show']=function(_0x36c649,_0x33a3cc){var _0x4608b2={'raw':![],'where':{'id':_0x36c649[_0xe760('0x46')]['id']}},_0x45563e={};_0x45563e['model']=_['keys'](db[_0xe760('0x42')][_0xe760('0x2e')]);_0x45563e[_0xe760('0x34')]=_[_0xe760('0x31')](_0x36c649['query']);_0x45563e[_0xe760('0x32')]=_['intersection'](_0x45563e[_0xe760('0x30')],_0x45563e[_0xe760('0x34')]);_0x4608b2[_0xe760('0x35')]=_[_0xe760('0x33')](_0x45563e[_0xe760('0x30')],qs[_0xe760('0x36')](_0x36c649[_0xe760('0x34')][_0xe760('0x36')]));_0x4608b2[_0xe760('0x35')]=_0x4608b2['attributes'][_0xe760('0x37')]?_0x4608b2[_0xe760('0x35')]:_0x45563e[_0xe760('0x30')];if(_0x36c649[_0xe760('0x34')][_0xe760('0x47')]){_0x4608b2['include']=[{'all':!![]}];}_0x4608b2=_[_0xe760('0x3e')]({},_0x4608b2,_0x36c649[_0xe760('0x41')]);return db['SugarcrmAccount']['find'](_0x4608b2)['then'](handleEntityNotFound(_0x33a3cc,null))['then'](respondWithResult(_0x33a3cc,null))['catch'](handleError(_0x33a3cc,null));};exports[_0xe760('0x48')]=function(_0x2fb45d,_0x1c43ca){return db[_0xe760('0x42')][_0xe760('0x48')](_0x2fb45d[_0xe760('0x49')],{})[_0xe760('0x27')](respondWithResult(_0x1c43ca,0xc9))[_0xe760('0x45')](handleError(_0x1c43ca,null));};exports[_0xe760('0x4a')]=function(_0x8307bb,_0x307aa7){if(_0x8307bb[_0xe760('0x49')]['id']){delete _0x8307bb[_0xe760('0x49')]['id'];}return db[_0xe760('0x42')][_0xe760('0x4b')]({'where':{'id':_0x8307bb[_0xe760('0x46')]['id']}})[_0xe760('0x27')](handleEntityNotFound(_0x307aa7,null))[_0xe760('0x27')](saveUpdates(_0x8307bb[_0xe760('0x49')],null))[_0xe760('0x27')](respondWithResult(_0x307aa7,null))[_0xe760('0x45')](handleError(_0x307aa7,null));};exports[_0xe760('0x28')]=function(_0xbc2220,_0x5cc07c){return db[_0xe760('0x42')][_0xe760('0x4b')]({'where':{'id':_0xbc2220[_0xe760('0x46')]['id']}})[_0xe760('0x27')](handleEntityNotFound(_0x5cc07c,null))[_0xe760('0x27')](removeEntity(_0x5cc07c,null))[_0xe760('0x45')](handleError(_0x5cc07c,null));};exports[_0xe760('0x4c')]=function(_0x40ae88,_0x440c56,_0x24cc5e){var _0x532e16={};var _0x4bf161={};var _0x163e7f;var _0x3845f0;return db[_0xe760('0x42')][_0xe760('0x4d')]({'where':{'id':_0x40ae88[_0xe760('0x46')]['id']}})[_0xe760('0x27')](handleEntityNotFound(_0x440c56,null))['then'](function(_0x1e41bf){if(_0x1e41bf){_0x163e7f=_0x1e41bf;_0x4bf161[_0xe760('0x30')]=_[_0xe760('0x31')](db[_0xe760('0x4e')][_0xe760('0x2e')]);_0x4bf161[_0xe760('0x34')]=_['keys'](_0x40ae88[_0xe760('0x34')]);_0x4bf161[_0xe760('0x32')]=_[_0xe760('0x33')](_0x4bf161[_0xe760('0x30')],_0x4bf161['query']);_0x532e16[_0xe760('0x35')]=_[_0xe760('0x33')](_0x4bf161[_0xe760('0x30')],qs[_0xe760('0x36')](_0x40ae88[_0xe760('0x34')][_0xe760('0x36')]));_0x532e16[_0xe760('0x35')]=_0x532e16[_0xe760('0x35')]['length']?_0x532e16['attributes']:_0x4bf161[_0xe760('0x30')];_0x532e16['order']=qs[_0xe760('0x3a')](_0x40ae88['query'][_0xe760('0x3a')]);_0x532e16[_0xe760('0x3b')]=qs[_0xe760('0x32')](_['pick'](_0x40ae88['query'],_0x4bf161[_0xe760('0x32')]));if(_0x40ae88['query'][_0xe760('0x3d')]){_0x532e16[_0xe760('0x3b')]=_[_0xe760('0x3e')](_0x532e16[_0xe760('0x3b')],{'$or':_[_0xe760('0x2d')](_0x532e16[_0xe760('0x35')],function(_0x49fa95){var _0x5d1933={};_0x5d1933[_0x49fa95]={'$like':'%'+_0x40ae88[_0xe760('0x34')]['filter']+'%'};return _0x5d1933;})});}_0x532e16=_[_0xe760('0x3e')]({},_0x532e16,_0x40ae88['options']);return _0x163e7f[_0xe760('0x4c')](_0x532e16);}})[_0xe760('0x27')](function(_0xc32246){if(_0xc32246){_0x3845f0=_0xc32246[_0xe760('0x37')];if(!_0x40ae88[_0xe760('0x34')][_0xe760('0x4f')]('nolimit')){_0x532e16[_0xe760('0x20')]=qs[_0xe760('0x20')](_0x40ae88['query'][_0xe760('0x20')]);_0x532e16[_0xe760('0x1f')]=qs[_0xe760('0x1f')](_0x40ae88[_0xe760('0x34')][_0xe760('0x1f')]);}return _0x163e7f[_0xe760('0x4c')](_0x532e16);}})[_0xe760('0x27')](function(_0xef4131){if(_0xef4131){return _0xef4131?{'count':_0x3845f0,'rows':_0xef4131}:null;}})['then'](respondWithResult(_0x440c56,null))[_0xe760('0x45')](handleError(_0x440c56,null));};exports[_0xe760('0x50')]=function(_0x2e96fe,_0x360495,_0x29a6dd){if(_0x2e96fe[_0xe760('0x49')]['id']){delete _0x2e96fe[_0xe760('0x49')]['id'];}return db[_0xe760('0x42')][_0xe760('0x4d')]({'where':{'id':_0x2e96fe[_0xe760('0x46')]['id']}})['then'](handleEntityNotFound(_0x360495,null))[_0xe760('0x27')](function(_0x3c6cdc){if(_0x3c6cdc){_0x2e96fe['body'][_0xe760('0x51')]=_0x3c6cdc['id'];_0x2e96fe[_0xe760('0x49')]['Subjects']=integrations[_0xe760('0x52')](_0x2e96fe[_0xe760('0x49')][_0xe760('0x53')],_0x2e96fe[_0xe760('0x49')][_0xe760('0x3f')]);_0x2e96fe['body']['Descriptions']=integrations[_0xe760('0x54')](_0x2e96fe[_0xe760('0x49')][_0xe760('0x53')],_0x2e96fe[_0xe760('0x49')]['type']);return db[_0xe760('0x4e')][_0xe760('0x48')](_0x2e96fe[_0xe760('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xe760('0x55')},{'model':db['SugarcrmField'],'as':_0xe760('0x56')}]});}return null;})[_0xe760('0x27')](respondWithResult(_0x360495,null))['catch'](handleError(_0x360495,null));};exports[_0xe760('0x57')]=function(_0x6d44ac,_0x297657,_0x10a1bf){var _0x58760a='';var _0x550dd1=['id',_0xe760('0x2b'),_0xe760('0x58'),_0xe760('0x59'),_0xe760('0x5a'),_0xe760('0x5b'),_0xe760('0x5c'),_0xe760('0x5d'),_0xe760('0x5e'),_0xe760('0x5f'),_0xe760('0x60'),_0xe760('0x61')];return db['SugarcrmAccount'][_0xe760('0x4d')]({'where':{'id':_0x6d44ac['params']['id']},'attributes':['id',_0xe760('0x62'),_0xe760('0x63'),'remoteUri']})[_0xe760('0x27')](handleEntityNotFound(_0x297657,null))[_0xe760('0x27')](function(_0x2db835){if(_0x2db835){_0x58760a=_0x2db835['remoteUri'];var _0x3b42dd=_0x58760a[_0xe760('0x64')](-0x1);if(_0x3b42dd==='/'){_0x58760a=_0x58760a[_0xe760('0x65')](0x0,_0x58760a['lastIndexOf'](_0x3b42dd));}return rp({'method':_0xe760('0x66'),'uri':util['format'](_0xe760('0x67'),_0x58760a,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0xe760('0x68'),'response_type':'JSON','rest_data':JSON[_0xe760('0x69')]({'user_auth':{'user_name':_0x2db835[_0xe760('0x62')],'password':_0x2db835[_0xe760('0x63')],'encryption':_0xe760('0x6a')},'application':_0xe760('0x6b')})}});}})['then'](function(_0x4edd8f){if(_0x4edd8f&&_0x4edd8f[_0xe760('0x2b')]!==_0xe760('0x6c')&&_0x4edd8f[_0xe760('0x2b')]!==_0xe760('0x6d')){return rp({'method':_0xe760('0x66'),'uri':util[_0xe760('0x6e')](_0xe760('0x67'),_0x58760a,_0xe760('0x6f')),'json':!![],'form':{'method':_0xe760('0x70'),'input_type':_0xe760('0x68'),'response_type':_0xe760('0x68'),'rest_data':JSON[_0xe760('0x69')]({'session':_0x4edd8f['id'],'module_name':_0xe760('0x71')})}})[_0xe760('0x27')](function(_0x523945){if(_0x523945){var _0x114f53=_[_0xe760('0x72')](_0x523945[_0xe760('0x73')]);_[_0xe760('0x74')](_0x114f53,function(_0x356c00){return _0x550dd1[_0xe760('0x75')](_0x356c00[_0xe760('0x2b')]);});return{'count':_0x114f53[_0xe760('0x37')],'rows':_['map'](_0x114f53,function(_0x484956){return{'id':_0x484956[_0xe760('0x2b')],'name':_0x484956['label'],'custom':_[_0xe760('0x76')](_0x484956[_0xe760('0x2b')],'_c')?!![]:![],'options':_0x484956[_0xe760('0x41')]?_[_0xe760('0x2d')](_[_0xe760('0x72')](_0x484956[_0xe760('0x41')]),function(_0x33f9f3){return{'name':_0x33f9f3['value'],'value':_0x33f9f3[_0xe760('0x2b')]};}):[]};})};}})[_0xe760('0x27')](respondWithResult(_0x297657,null))[_0xe760('0x45')](function(_0x5e3c94){var _0x677628=_0x6d44ac[_0xe760('0x34')][_0xe760('0x77')]?0x1f4:_0x5e3c94[_0xe760('0x78')]||0x1f4;logger[_0xe760('0x2a')](_0xe760('0x79'),_0xe760('0x57'),_0x677628,JSON[_0xe760('0x69')](_0x5e3c94));delete _0x5e3c94[_0xe760('0x2b')];if(_0x677628===0x191){_0x677628=0x190;}_0x297657[_0xe760('0x1c')](_0x677628)[_0xe760('0x7a')](_0x6d44ac[_0xe760('0x34')][_0xe760('0x77')]?{'message':_0xe760('0x7b'),'statusCode':_0x5e3c94['statusCode']}:_0x5e3c94);});}else{var _0x2aaa68=0x1f4;_0x297657['status'](_0x2aaa68)[_0xe760('0x7a')]({'message':_0xe760('0x7b'),'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 dd4d19b..298fc41 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 _0x2b7e=['bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','api','moment'];(function(_0x44da96,_0x1f19d5){var _0x519253=function(_0x3ee327){while(--_0x3ee327){_0x44da96['push'](_0x44da96['shift']());}};_0x519253(++_0x1f19d5);}(_0x2b7e,0xe1));var _0xe2b7=function(_0x2a63f2,_0x2367bb){_0x2a63f2=_0x2a63f2-0x0;var _0x2801ef=_0x2b7e[_0x2a63f2];return _0x2801ef;};'use strict';var _=require('lodash');var util=require(_0xe2b7('0x0'));var logger=require('../../config/logger')(_0xe2b7('0x1'));var moment=require(_0xe2b7('0x2'));var BPromise=require(_0xe2b7('0x3'));var rp=require(_0xe2b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2b7('0x5'));var config=require(_0xe2b7('0x6'));var attributes=require(_0xe2b7('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe2b7('0x8')]=function(_0x45068f,_0x36372b){return _0x45068f[_0xe2b7('0x9')](_0xe2b7('0xa'),attributes,{'tableName':_0xe2b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b4b=['SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','bluebird','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x250bf7,_0xe89f16){var _0x58fe2b=function(_0x2a135a){while(--_0x2a135a){_0x250bf7['push'](_0x250bf7['shift']());}};_0x58fe2b(++_0xe89f16);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x0b4b[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0xb0b4('0x0'));var util=require('util');var logger=require(_0xb0b4('0x1'))(_0xb0b4('0x2'));var moment=require('moment');var BPromise=require(_0xb0b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0b4('0x4'));var rimraf=require('rimraf');var config=require(_0xb0b4('0x5'));var attributes=require(_0xb0b4('0x6'));var integrations=require(_0xb0b4('0x7'));module[_0xb0b4('0x8')]=function(_0x791956,_0x378f36){return _0x791956[_0xb0b4('0x9')](_0xb0b4('0xa'),attributes,{'tableName':_0xb0b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 5747efb..a19a6ec 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 _0x3cdd=['find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount'];(function(_0xfa92ca,_0x3aecda){var _0x39b4c3=function(_0x13e34b){while(--_0x13e34b){_0xfa92ca['push'](_0xfa92ca['shift']());}};_0x39b4c3(++_0x3aecda);}(_0x3cdd,0xb5));var _0xd3cd=function(_0x2bfd12,_0x48f8eb){_0x2bfd12=_0x2bfd12-0x0;var _0x1abe17=_0x3cdd[_0x2bfd12];return _0x1abe17;};'use strict';var _=require(_0xd3cd('0x0'));var util=require(_0xd3cd('0x1'));var moment=require(_0xd3cd('0x2'));var BPromise=require(_0xd3cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3cd('0x4'))['db'];var utils=require(_0xd3cd('0x5'));var logger=require(_0xd3cd('0x6'))(_0xd3cd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd3cd('0x8')][_0xd3cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x589326,_0x312a6b,_0x1ca36a){return new BPromise(function(_0x23e219,_0x14cd07){return client[_0xd3cd('0xa')](_0x589326,_0x1ca36a)[_0xd3cd('0xb')](function(_0x14546c){logger[_0xd3cd('0xc')](_0xd3cd('0xd'),_0x312a6b,_0xd3cd('0xe'));logger[_0xd3cd('0xf')](_0xd3cd('0x10'),_0x312a6b,_0xd3cd('0xe'),JSON[_0xd3cd('0x11')](_0x14546c));if(_0x14546c[_0xd3cd('0x12')]){if(_0x14546c[_0xd3cd('0x12')][_0xd3cd('0x13')]===0x1f4){logger[_0xd3cd('0x12')](_0xd3cd('0xd'),_0x312a6b,_0x14546c[_0xd3cd('0x12')]['message']);return _0x14cd07(_0x14546c[_0xd3cd('0x12')][_0xd3cd('0x14')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x312a6b,_0x14546c[_0xd3cd('0x12')][_0xd3cd('0x14')]);return _0x23e219(_0x14546c[_0xd3cd('0x12')][_0xd3cd('0x14')]);}else{logger[_0xd3cd('0xc')](_0xd3cd('0xd'),_0x312a6b,_0xd3cd('0xe'));_0x23e219(_0x14546c[_0xd3cd('0x15')][_0xd3cd('0x14')]);}})[_0xd3cd('0x16')](function(_0x4093da){logger[_0xd3cd('0x12')](_0xd3cd('0xd'),_0x312a6b,_0x4093da);_0x14cd07(_0x4093da);});});}exports['GetSugarcrmAccount']=function(_0x56fdba){var _0x4b6d01=this;return new Promise(function(_0x861d67,_0x9a94c7){return db[_0xd3cd('0x17')][_0xd3cd('0x18')]({'raw':_0x56fdba[_0xd3cd('0x19')]?_0x56fdba[_0xd3cd('0x19')][_0xd3cd('0x1a')]===undefined?!![]:![]:!![],'where':_0x56fdba[_0xd3cd('0x19')]?_0x56fdba[_0xd3cd('0x19')][_0xd3cd('0x1b')]||null:null,'attributes':_0x56fdba[_0xd3cd('0x19')]?_0x56fdba[_0xd3cd('0x19')][_0xd3cd('0x1c')]||null:null,'limit':_0x56fdba[_0xd3cd('0x19')]?_0x56fdba[_0xd3cd('0x19')][_0xd3cd('0x1d')]||null:null,'include':_0x56fdba['options']?_0x56fdba[_0xd3cd('0x19')][_0xd3cd('0x1e')]?_['map'](_0x56fdba[_0xd3cd('0x19')][_0xd3cd('0x1e')],function(_0x511bbb){return{'model':db[_0x511bbb['model']],'as':_0x511bbb['as'],'attributes':_0x511bbb['attributes'],'include':_0x511bbb['include']?_[_0xd3cd('0x1f')](_0x511bbb[_0xd3cd('0x1e')],function(_0x55a3cf){return{'model':db[_0x55a3cf[_0xd3cd('0x20')]],'as':_0x55a3cf['as'],'attributes':_0x55a3cf[_0xd3cd('0x1c')],'include':_0x55a3cf['include']?_[_0xd3cd('0x1f')](_0x55a3cf[_0xd3cd('0x1e')],function(_0x2e183c){return{'model':db[_0x2e183c[_0xd3cd('0x20')]],'as':_0x2e183c['as'],'attributes':_0x2e183c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3cd('0xb')](function(_0xd39b24){logger[_0xd3cd('0xc')]('GetSugarcrmAccount',_0x56fdba);logger[_0xd3cd('0xf')]('GetSugarcrmAccount',_0x56fdba,JSON[_0xd3cd('0x11')](_0xd39b24));_0x861d67(_0xd39b24);})[_0xd3cd('0x16')](function(_0x5dbccf){logger[_0xd3cd('0x12')](_0xd3cd('0x21'),_0x5dbccf['message'],_0x56fdba);_0x9a94c7(_0x4b6d01['error'](0x1f4,_0x5dbccf[_0xd3cd('0x14')]));});});};exports[_0xd3cd('0x22')]=function(_0x4a48b8){var _0x307ae4=this;return new Promise(function(_0x2bb2d8,_0x4f0440){return db[_0xd3cd('0x17')][_0xd3cd('0x23')]({'raw':_0x4a48b8['options']?_0x4a48b8[_0xd3cd('0x19')][_0xd3cd('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a48b8['options']?_0x4a48b8[_0xd3cd('0x19')][_0xd3cd('0x1b')]||null:null,'attributes':_0x4a48b8['options']?_0x4a48b8['options'][_0xd3cd('0x1c')]||null:null,'include':_0x4a48b8['options']?_0x4a48b8[_0xd3cd('0x19')][_0xd3cd('0x1e')]?_[_0xd3cd('0x1f')](_0x4a48b8[_0xd3cd('0x19')][_0xd3cd('0x1e')],function(_0x1a6e23){return{'model':db[_0x1a6e23[_0xd3cd('0x20')]],'as':_0x1a6e23['as'],'attributes':_0x1a6e23[_0xd3cd('0x1c')],'include':_0x1a6e23[_0xd3cd('0x1e')]?_[_0xd3cd('0x1f')](_0x1a6e23[_0xd3cd('0x1e')],function(_0x5c5415){return{'model':db[_0x5c5415['model']],'as':_0x5c5415['as'],'attributes':_0x5c5415[_0xd3cd('0x1c')],'include':_0x5c5415[_0xd3cd('0x1e')]?_[_0xd3cd('0x1f')](_0x5c5415['include'],function(_0xea9e06){return{'model':db[_0xea9e06['model']],'as':_0xea9e06['as'],'attributes':_0xea9e06[_0xd3cd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd3cd('0xb')](function(_0x4fb7a3){logger[_0xd3cd('0xc')]('ShowSugarcrmAccount',_0x4a48b8);logger[_0xd3cd('0xf')](_0xd3cd('0x22'),_0x4a48b8,JSON['stringify'](_0x4fb7a3));_0x2bb2d8(_0x4fb7a3);})[_0xd3cd('0x16')](function(_0x3c3a62){logger[_0xd3cd('0x12')](_0xd3cd('0x22'),_0x3c3a62['message'],_0x4a48b8);_0x4f0440(_0x307ae4[_0xd3cd('0x12')](0x1f4,_0x3c3a62[_0xd3cd('0x14')]));});});}; \ No newline at end of file +var _0xfeca=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','ShowSugarcrmAccount','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3c9fcf,_0x4f639f){var _0x26d6a5=function(_0x352d4c){while(--_0x352d4c){_0x3c9fcf['push'](_0x3c9fcf['shift']());}};_0x26d6a5(++_0x4f639f);}(_0xfeca,0x1ad));var _0xafec=function(_0x44c2a4,_0xe609b){_0x44c2a4=_0x44c2a4-0x0;var _0x5e1427=_0xfeca[_0x44c2a4];return _0x5e1427;};'use strict';var _=require(_0xafec('0x0'));var util=require('util');var moment=require(_0xafec('0x1'));var BPromise=require('bluebird');var rs=require(_0xafec('0x2'));var fs=require('fs');var Redis=require(_0xafec('0x3'));var db=require(_0xafec('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xafec('0x5'));var config=require(_0xafec('0x6'));var jayson=require(_0xafec('0x7'));var client=jayson[_0xafec('0x8')][_0xafec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7c8b8f,_0xc085bc,_0x3abf8c){return new BPromise(function(_0x6eeb97,_0xff4fda){return client[_0xafec('0xa')](_0x7c8b8f,_0x3abf8c)[_0xafec('0xb')](function(_0x2ad403){logger[_0xafec('0xc')](_0xafec('0xd'),_0xc085bc,_0xafec('0xe'));logger[_0xafec('0xf')](_0xafec('0x10'),_0xc085bc,_0xafec('0xe'),JSON[_0xafec('0x11')](_0x2ad403));if(_0x2ad403[_0xafec('0x12')]){if(_0x2ad403[_0xafec('0x12')]['code']===0x1f4){logger[_0xafec('0x12')](_0xafec('0xd'),_0xc085bc,_0x2ad403[_0xafec('0x12')][_0xafec('0x13')]);return _0xff4fda(_0x2ad403[_0xafec('0x12')]['message']);}logger['error'](_0xafec('0xd'),_0xc085bc,_0x2ad403[_0xafec('0x12')][_0xafec('0x13')]);return _0x6eeb97(_0x2ad403[_0xafec('0x12')][_0xafec('0x13')]);}else{logger[_0xafec('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0xc085bc,_0xafec('0xe'));_0x6eeb97(_0x2ad403['result']['message']);}})[_0xafec('0x14')](function(_0x19159b){logger[_0xafec('0x12')](_0xafec('0xd'),_0xc085bc,_0x19159b);_0xff4fda(_0x19159b);});});}exports[_0xafec('0x15')]=function(_0x374638){var _0x3a9a87=this;return new Promise(function(_0x2ac40c,_0x88915e){return db[_0xafec('0x16')][_0xafec('0x17')]({'raw':_0x374638[_0xafec('0x18')]?_0x374638['options'][_0xafec('0x19')]===undefined?!![]:![]:!![],'where':_0x374638[_0xafec('0x18')]?_0x374638[_0xafec('0x18')]['where']||null:null,'attributes':_0x374638[_0xafec('0x18')]?_0x374638['options'][_0xafec('0x1a')]||null:null,'limit':_0x374638[_0xafec('0x18')]?_0x374638[_0xafec('0x18')][_0xafec('0x1b')]||null:null,'include':_0x374638[_0xafec('0x18')]?_0x374638[_0xafec('0x18')][_0xafec('0x1c')]?_[_0xafec('0x1d')](_0x374638[_0xafec('0x18')][_0xafec('0x1c')],function(_0x5e110c){return{'model':db[_0x5e110c[_0xafec('0x1e')]],'as':_0x5e110c['as'],'attributes':_0x5e110c['attributes'],'include':_0x5e110c[_0xafec('0x1c')]?_[_0xafec('0x1d')](_0x5e110c['include'],function(_0xe2c10a){return{'model':db[_0xe2c10a[_0xafec('0x1e')]],'as':_0xe2c10a['as'],'attributes':_0xe2c10a[_0xafec('0x1a')],'include':_0xe2c10a[_0xafec('0x1c')]?_[_0xafec('0x1d')](_0xe2c10a['include'],function(_0x210263){return{'model':db[_0x210263[_0xafec('0x1e')]],'as':_0x210263['as'],'attributes':_0x210263[_0xafec('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xafec('0xb')](function(_0x2826ab){logger[_0xafec('0xc')](_0xafec('0x15'),_0x374638);logger[_0xafec('0xf')](_0xafec('0x15'),_0x374638,JSON[_0xafec('0x11')](_0x2826ab));_0x2ac40c(_0x2826ab);})[_0xafec('0x14')](function(_0x587f08){logger['error'](_0xafec('0x15'),_0x587f08[_0xafec('0x13')],_0x374638);_0x88915e(_0x3a9a87[_0xafec('0x12')](0x1f4,_0x587f08[_0xafec('0x13')]));});});};exports[_0xafec('0x1f')]=function(_0x598d3c){var _0x3dca1f=this;return new Promise(function(_0x135886,_0x5cae0c){return db[_0xafec('0x16')][_0xafec('0x20')]({'raw':_0x598d3c[_0xafec('0x18')]?_0x598d3c[_0xafec('0x18')][_0xafec('0x19')]===undefined?!![]:![]:!![],'where':_0x598d3c[_0xafec('0x18')]?_0x598d3c[_0xafec('0x18')][_0xafec('0x21')]||null:null,'attributes':_0x598d3c['options']?_0x598d3c[_0xafec('0x18')]['attributes']||null:null,'include':_0x598d3c[_0xafec('0x18')]?_0x598d3c[_0xafec('0x18')]['include']?_[_0xafec('0x1d')](_0x598d3c['options'][_0xafec('0x1c')],function(_0x5b44d3){return{'model':db[_0x5b44d3['model']],'as':_0x5b44d3['as'],'attributes':_0x5b44d3[_0xafec('0x1a')],'include':_0x5b44d3[_0xafec('0x1c')]?_['map'](_0x5b44d3[_0xafec('0x1c')],function(_0xe0dc18){return{'model':db[_0xe0dc18[_0xafec('0x1e')]],'as':_0xe0dc18['as'],'attributes':_0xe0dc18['attributes'],'include':_0xe0dc18[_0xafec('0x1c')]?_[_0xafec('0x1d')](_0xe0dc18[_0xafec('0x1c')],function(_0x3c5edb){return{'model':db[_0x3c5edb['model']],'as':_0x3c5edb['as'],'attributes':_0x3c5edb[_0xafec('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xafec('0xb')](function(_0x5dfccb){logger['info'](_0xafec('0x1f'),_0x598d3c);logger[_0xafec('0xf')](_0xafec('0x1f'),_0x598d3c,JSON[_0xafec('0x11')](_0x5dfccb));_0x135886(_0x5dfccb);})[_0xafec('0x14')](function(_0x1d6e16){logger[_0xafec('0x12')]('ShowSugarcrmAccount',_0x1d6e16[_0xafec('0x13')],_0x598d3c);_0x5cae0c(_0x3dca1f[_0xafec('0x12')](0x1f4,_0x1d6e16[_0xafec('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 0dfb9ca..49dc093 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 _0xc429=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','create','put','delete','destroy','exports','multer','util'];(function(_0x115726,_0x3d4a89){var _0x27d130=function(_0xf2afb3){while(--_0xf2afb3){_0x115726['push'](_0x115726['shift']());}};_0x27d130(++_0x3d4a89);}(_0xc429,0xfa));var _0x9c42=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xc429[_0x31a938];return _0x1bf341;};'use strict';var multer=require(_0x9c42('0x0'));var util=require(_0x9c42('0x1'));var path=require('path');var timeout=require(_0x9c42('0x2'));var express=require(_0x9c42('0x3'));var router=express['Router']();var fs_extra=require(_0x9c42('0x4'));var auth=require(_0x9c42('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c42('0x6'));var controller=require(_0x9c42('0x7'));router[_0x9c42('0x8')]('/',auth['isAuthenticated'](),controller[_0x9c42('0x9')]);router[_0x9c42('0x8')](_0x9c42('0xa'),auth[_0x9c42('0xb')](),controller[_0x9c42('0xc')]);router[_0x9c42('0x8')](_0x9c42('0xd'),auth[_0x9c42('0xb')](),controller['getFields']);router['get'](_0x9c42('0xe'),auth['isAuthenticated'](),controller[_0x9c42('0xf')]);router[_0x9c42('0x8')]('/:id/descriptions',auth[_0x9c42('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0x9c42('0xb')](),controller[_0x9c42('0x10')]);router[_0x9c42('0x11')](_0x9c42('0xa'),auth[_0x9c42('0xb')](),controller['update']);router[_0x9c42('0x12')](_0x9c42('0xa'),auth[_0x9c42('0xb')](),controller[_0x9c42('0x13')]);module[_0x9c42('0x14')]=router; \ No newline at end of file +var _0x26f0=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x2737b9,_0x591d52){var _0x19b617=function(_0x4cd3ae){while(--_0x4cd3ae){_0x2737b9['push'](_0x2737b9['shift']());}};_0x19b617(++_0x591d52);}(_0x26f0,0xf4));var _0x026f=function(_0x3d980e,_0x3cea3f){_0x3d980e=_0x3d980e-0x0;var _0x4517c7=_0x26f0[_0x3d980e];return _0x4517c7;};'use strict';var multer=require(_0x026f('0x0'));var util=require(_0x026f('0x1'));var path=require(_0x026f('0x2'));var timeout=require(_0x026f('0x3'));var express=require('express');var router=express[_0x026f('0x4')]();var fs_extra=require(_0x026f('0x5'));var auth=require(_0x026f('0x6'));var interaction=require(_0x026f('0x7'));var config=require(_0x026f('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x026f('0x9')]('/',auth['isAuthenticated'](),controller[_0x026f('0xa')]);router['get'](_0x026f('0xb'),auth[_0x026f('0xc')](),controller['show']);router[_0x026f('0x9')]('/:id/fields',auth[_0x026f('0xc')](),controller[_0x026f('0xd')]);router['get'](_0x026f('0xe'),auth['isAuthenticated'](),controller[_0x026f('0xf')]);router[_0x026f('0x9')](_0x026f('0x10'),auth[_0x026f('0xc')](),controller[_0x026f('0x11')]);router[_0x026f('0x12')]('/',auth[_0x026f('0xc')](),controller['create']);router[_0x026f('0x13')](_0x026f('0xb'),auth[_0x026f('0xc')](),controller[_0x026f('0x14')]);router[_0x026f('0x15')](_0x026f('0xb'),auth[_0x026f('0xc')](),controller[_0x026f('0x16')]);module[_0x026f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index fe2ad44..bafefae 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 _0xb050=['STRING','sequelize','exports'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0xb050,0x145));var _0x0b05=function(_0x979d28,_0x4811d9){_0x979d28=_0x979d28-0x0;var _0x208b30=_0xb050[_0x979d28];return _0x208b30;};'use strict';var Sequelize=require(_0x0b05('0x0'));module[_0x0b05('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0b05('0x2')]}}; \ No newline at end of file +var _0x048c=['exports','STRING'];(function(_0x332926,_0x199a9f){var _0x2fb205=function(_0x59e599){while(--_0x59e599){_0x332926['push'](_0x332926['shift']());}};_0x2fb205(++_0x199a9f);}(_0x048c,0x1cc));var _0xc048=function(_0xcd02aa,_0x13625a){_0xcd02aa=_0xcd02aa-0x0;var _0x4b6d99=_0x048c[_0xcd02aa];return _0x4b6d99;};'use strict';var Sequelize=require('sequelize');module[_0xc048('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc048('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 07d2410..9158926 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 _0x1eb7=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','sendStatus','error','name','send','SugarcrmConfiguration','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','then','includeAll','include','rows','show','params','rawAttributes','options','find','catch','create','body','destroy','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x509c7d,_0x226ce5){var _0xb8d722=function(_0x6c6129){while(--_0x6c6129){_0x509c7d['push'](_0x509c7d['shift']());}};_0xb8d722(++_0x226ce5);}(_0x1eb7,0x99));var _0x71eb=function(_0x231b1d,_0x144539){_0x231b1d=_0x231b1d-0x0;var _0x4b6cd1=_0x1eb7[_0x231b1d];return _0x4b6cd1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x71eb('0x0'));var jsonpatch=require(_0x71eb('0x1'));var rp=require('request-promise');var moment=require(_0x71eb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x71eb('0x3'));var util=require(_0x71eb('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x71eb('0x5'));var ejs=require(_0x71eb('0x6'));var fs=require('fs');var fs_extra=require(_0x71eb('0x7'));var _=require(_0x71eb('0x8'));var squel=require(_0x71eb('0x9'));var crypto=require(_0x71eb('0xa'));var jsforce=require(_0x71eb('0xb'));var deskjs=require(_0x71eb('0xc'));var toCsv=require(_0x71eb('0x5'));var querystring=require(_0x71eb('0xd'));var Papa=require(_0x71eb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x71eb('0xf'));var as=require(_0x71eb('0x10'));var hardwareService=require(_0x71eb('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x71eb('0x12'));var config=require(_0x71eb('0x13'));var licenseUtil=require(_0x71eb('0x14'));var db=require(_0x71eb('0x15'))['db'];function respondWithStatusCode(_0x3156a7,_0x3bcf14){_0x3bcf14=_0x3bcf14||0xcc;return function(_0x37e833){if(_0x37e833){return _0x3156a7['sendStatus'](_0x3bcf14);}return _0x3156a7[_0x71eb('0x16')](_0x3bcf14)[_0x71eb('0x17')]();};}function respondWithResult(_0xffac45,_0x3ed87e){_0x3ed87e=_0x3ed87e||0xc8;return function(_0x33113b){if(_0x33113b){return _0xffac45[_0x71eb('0x16')](_0x3ed87e)[_0x71eb('0x18')](_0x33113b);}};}function respondWithFilteredResult(_0x4a6abb,_0x1c8078){return function(_0x558bcb){if(_0x558bcb){var _0x3496e7=typeof _0x1c8078[_0x71eb('0x19')]===_0x71eb('0x1a')&&typeof _0x1c8078['limit']==='undefined';var _0x4ffe61=_0x558bcb['count'];var _0x4670f0=_0x3496e7?0x0:_0x1c8078[_0x71eb('0x19')];var _0x1d5a48=_0x3496e7?_0x558bcb[_0x71eb('0x1b')]:_0x1c8078[_0x71eb('0x19')]+_0x1c8078[_0x71eb('0x1c')];var _0x242c87;if(_0x1d5a48>=_0x4ffe61){_0x1d5a48=_0x4ffe61;_0x242c87=0xc8;}else{_0x242c87=0xce;}_0x4a6abb[_0x71eb('0x16')](_0x242c87);return _0x4a6abb[_0x71eb('0x1d')](_0x71eb('0x1e'),_0x4670f0+'-'+_0x1d5a48+'/'+_0x4ffe61)[_0x71eb('0x18')](_0x558bcb);}return null;};}function patchUpdates(_0x26754e){return function(_0x4d6942){try{jsonpatch[_0x71eb('0x1f')](_0x4d6942,_0x26754e,!![]);}catch(_0x5ade1c){return BPromise[_0x71eb('0x20')](_0x5ade1c);}return _0x4d6942[_0x71eb('0x21')]();};}function saveUpdates(_0x12551e,_0x40fc12){return function(_0x60f576){if(_0x60f576){return _0x60f576[_0x71eb('0x22')](_0x12551e)['then'](function(_0x10b9ab){return _0x10b9ab;});}return null;};}function removeEntity(_0x5ce6f0,_0x1688bc){return function(_0x4cdd71){if(_0x4cdd71){return _0x4cdd71['destroy']()['then'](function(){_0x5ce6f0[_0x71eb('0x16')](0xcc)[_0x71eb('0x17')]();});}};}function handleEntityNotFound(_0x5528d3,_0x558e8d){return function(_0x46e632){if(!_0x46e632){_0x5528d3[_0x71eb('0x23')](0x194);}return _0x46e632;};}function handleError(_0x5d3081,_0x13c5fa){_0x13c5fa=_0x13c5fa||0x1f4;return function(_0x2f2159){logger[_0x71eb('0x24')](_0x2f2159['stack']);if(_0x2f2159[_0x71eb('0x25')]){delete _0x2f2159['name'];}_0x5d3081[_0x71eb('0x16')](_0x13c5fa)[_0x71eb('0x26')](_0x2f2159);};}exports['index']=function(_0x248d1e,_0x5a3393){var _0x4a41ea={},_0x2dc224={},_0x54ffbb={'count':0x0,'rows':[]};var _0x5b08c7=_['map'](db[_0x71eb('0x27')]['rawAttributes'],function(_0x376f84){return{'name':_0x376f84[_0x71eb('0x28')],'type':_0x376f84[_0x71eb('0x29')][_0x71eb('0x2a')]};});_0x2dc224['model']=_[_0x71eb('0x2b')](_0x5b08c7,_0x71eb('0x25'));_0x2dc224[_0x71eb('0x2c')]=_[_0x71eb('0x2d')](_0x248d1e['query']);_0x2dc224['filters']=_[_0x71eb('0x2e')](_0x2dc224[_0x71eb('0x2f')],_0x2dc224[_0x71eb('0x2c')]);_0x4a41ea['attributes']=_[_0x71eb('0x2e')](_0x2dc224[_0x71eb('0x2f')],qs[_0x71eb('0x30')](_0x248d1e['query'][_0x71eb('0x30')]));_0x4a41ea[_0x71eb('0x31')]=_0x4a41ea[_0x71eb('0x31')][_0x71eb('0x32')]?_0x4a41ea[_0x71eb('0x31')]:_0x2dc224[_0x71eb('0x2f')];if(!_0x248d1e[_0x71eb('0x2c')][_0x71eb('0x33')](_0x71eb('0x34'))){_0x4a41ea[_0x71eb('0x1c')]=qs[_0x71eb('0x1c')](_0x248d1e['query']['limit']);_0x4a41ea[_0x71eb('0x19')]=qs['offset'](_0x248d1e[_0x71eb('0x2c')]['offset']);}_0x4a41ea[_0x71eb('0x35')]=qs['sort'](_0x248d1e[_0x71eb('0x2c')][_0x71eb('0x36')]);_0x4a41ea[_0x71eb('0x37')]=qs[_0x71eb('0x38')](_[_0x71eb('0x39')](_0x248d1e[_0x71eb('0x2c')],_0x2dc224['filters']),_0x5b08c7);if(_0x248d1e[_0x71eb('0x2c')][_0x71eb('0x3a')]){_0x4a41ea[_0x71eb('0x37')]=_['merge'](_0x4a41ea[_0x71eb('0x37')],{'$or':_['map'](_0x5b08c7,function(_0x43f971){if(_0x43f971[_0x71eb('0x29')]!==_0x71eb('0x3b')){var _0x1aed98={};_0x1aed98[_0x43f971[_0x71eb('0x25')]]={'$like':'%'+_0x248d1e[_0x71eb('0x2c')][_0x71eb('0x3a')]+'%'};return _0x1aed98;}})});}_0x4a41ea=_[_0x71eb('0x3c')]({},_0x4a41ea,_0x248d1e['options']);var _0x825204={'where':_0x4a41ea[_0x71eb('0x37')]};return db[_0x71eb('0x27')][_0x71eb('0x1b')](_0x825204)[_0x71eb('0x3d')](function(_0x53670a){_0x54ffbb[_0x71eb('0x1b')]=_0x53670a;if(_0x248d1e[_0x71eb('0x2c')][_0x71eb('0x3e')]){_0x4a41ea[_0x71eb('0x3f')]=[{'all':!![]}];}return db[_0x71eb('0x27')]['findAll'](_0x4a41ea);})[_0x71eb('0x3d')](function(_0x454d61){_0x54ffbb[_0x71eb('0x40')]=_0x454d61;return _0x54ffbb;})[_0x71eb('0x3d')](respondWithFilteredResult(_0x5a3393,_0x4a41ea))['catch'](handleError(_0x5a3393,null));};exports[_0x71eb('0x41')]=function(_0x1c1e30,_0x899606){var _0x1b65e0={'raw':![],'where':{'id':_0x1c1e30[_0x71eb('0x42')]['id']}},_0x1d5628={};_0x1d5628[_0x71eb('0x2f')]=_[_0x71eb('0x2d')](db[_0x71eb('0x27')][_0x71eb('0x43')]);_0x1d5628[_0x71eb('0x2c')]=_[_0x71eb('0x2d')](_0x1c1e30[_0x71eb('0x2c')]);_0x1d5628['filters']=_[_0x71eb('0x2e')](_0x1d5628[_0x71eb('0x2f')],_0x1d5628[_0x71eb('0x2c')]);_0x1b65e0[_0x71eb('0x31')]=_[_0x71eb('0x2e')](_0x1d5628[_0x71eb('0x2f')],qs[_0x71eb('0x30')](_0x1c1e30[_0x71eb('0x2c')][_0x71eb('0x30')]));_0x1b65e0[_0x71eb('0x31')]=_0x1b65e0[_0x71eb('0x31')]['length']?_0x1b65e0[_0x71eb('0x31')]:_0x1d5628[_0x71eb('0x2f')];if(_0x1c1e30[_0x71eb('0x2c')][_0x71eb('0x3e')]){_0x1b65e0[_0x71eb('0x3f')]=[{'all':!![]}];}_0x1b65e0=_[_0x71eb('0x3c')]({},_0x1b65e0,_0x1c1e30[_0x71eb('0x44')]);return db[_0x71eb('0x27')][_0x71eb('0x45')](_0x1b65e0)[_0x71eb('0x3d')](handleEntityNotFound(_0x899606,null))[_0x71eb('0x3d')](respondWithResult(_0x899606,null))[_0x71eb('0x46')](handleError(_0x899606,null));};exports[_0x71eb('0x47')]=function(_0x47c97d,_0x34ac30){return db['SugarcrmConfiguration'][_0x71eb('0x47')](_0x47c97d[_0x71eb('0x48')],{})[_0x71eb('0x3d')](respondWithResult(_0x34ac30,0xc9))[_0x71eb('0x46')](handleError(_0x34ac30,null));};exports[_0x71eb('0x22')]=function(_0x5666d2,_0x22826d){if(_0x5666d2[_0x71eb('0x48')]['id']){delete _0x5666d2['body']['id'];}return db[_0x71eb('0x27')][_0x71eb('0x45')]({'where':{'id':_0x5666d2['params']['id']}})[_0x71eb('0x3d')](handleEntityNotFound(_0x22826d,null))[_0x71eb('0x3d')](saveUpdates(_0x5666d2[_0x71eb('0x48')],null))['then'](respondWithResult(_0x22826d,null))[_0x71eb('0x46')](handleError(_0x22826d,null));};exports[_0x71eb('0x49')]=function(_0x38d6d3,_0xd8bcf0){return db['SugarcrmConfiguration'][_0x71eb('0x45')]({'where':{'id':_0x38d6d3[_0x71eb('0x42')]['id']}})[_0x71eb('0x3d')](handleEntityNotFound(_0xd8bcf0,null))[_0x71eb('0x3d')](removeEntity(_0xd8bcf0,null))[_0x71eb('0x46')](handleError(_0xd8bcf0,null));};exports[_0x71eb('0x4a')]=function(_0x3dccdf,_0x2764d6,_0x44c078){var _0x852ccd={};var _0x235938={};var _0x36c38f;var _0x47ff3a;return db[_0x71eb('0x27')]['findOne']({'where':{'id':_0x3dccdf[_0x71eb('0x42')]['id']}})[_0x71eb('0x3d')](handleEntityNotFound(_0x2764d6,null))[_0x71eb('0x3d')](function(_0x549fa6){if(_0x549fa6){_0x36c38f=_0x549fa6;_0x235938[_0x71eb('0x2f')]=_[_0x71eb('0x2d')](db[_0x71eb('0x4b')][_0x71eb('0x43')]);_0x235938[_0x71eb('0x2c')]=_['keys'](_0x3dccdf[_0x71eb('0x2c')]);_0x235938[_0x71eb('0x38')]=_[_0x71eb('0x2e')](_0x235938['model'],_0x235938['query']);_0x852ccd[_0x71eb('0x31')]=_[_0x71eb('0x2e')](_0x235938[_0x71eb('0x2f')],qs[_0x71eb('0x30')](_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x30')]));_0x852ccd[_0x71eb('0x31')]=_0x852ccd['attributes'][_0x71eb('0x32')]?_0x852ccd[_0x71eb('0x31')]:_0x235938[_0x71eb('0x2f')];_0x852ccd['order']=qs[_0x71eb('0x36')](_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x36')]);_0x852ccd[_0x71eb('0x37')]=qs[_0x71eb('0x38')](_[_0x71eb('0x39')](_0x3dccdf[_0x71eb('0x2c')],_0x235938[_0x71eb('0x38')]));if(_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x3a')]){_0x852ccd[_0x71eb('0x37')]=_['merge'](_0x852ccd[_0x71eb('0x37')],{'$or':_[_0x71eb('0x2b')](_0x852ccd[_0x71eb('0x31')],function(_0x5a7010){var _0x3ad792={};_0x3ad792[_0x5a7010]={'$like':'%'+_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x3a')]+'%'};return _0x3ad792;})});}_0x852ccd=_[_0x71eb('0x3c')]({},_0x852ccd,_0x3dccdf[_0x71eb('0x44')]);return _0x36c38f[_0x71eb('0x4a')](_0x852ccd);}})['then'](function(_0x2f8ce1){if(_0x2f8ce1){_0x47ff3a=_0x2f8ce1['length'];if(!_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x33')](_0x71eb('0x34'))){_0x852ccd[_0x71eb('0x1c')]=qs['limit'](_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x1c')]);_0x852ccd[_0x71eb('0x19')]=qs[_0x71eb('0x19')](_0x3dccdf[_0x71eb('0x2c')][_0x71eb('0x19')]);}return _0x36c38f[_0x71eb('0x4a')](_0x852ccd);}})[_0x71eb('0x3d')](function(_0x41112b){if(_0x41112b){return _0x41112b?{'count':_0x47ff3a,'rows':_0x41112b}:null;}})[_0x71eb('0x3d')](respondWithResult(_0x2764d6,null))[_0x71eb('0x46')](handleError(_0x2764d6,null));};exports[_0x71eb('0x4c')]=function(_0x3b2277,_0x27b107,_0x228523){var _0x556ddd={};var _0x4a0b83={};var _0x3cbca6;var _0x1ca4d9;return db['SugarcrmConfiguration'][_0x71eb('0x4d')]({'where':{'id':_0x3b2277['params']['id']}})[_0x71eb('0x3d')](handleEntityNotFound(_0x27b107,null))[_0x71eb('0x3d')](function(_0x54ea47){if(_0x54ea47){_0x3cbca6=_0x54ea47;_0x4a0b83[_0x71eb('0x2f')]=_[_0x71eb('0x2d')](db[_0x71eb('0x4b')][_0x71eb('0x43')]);_0x4a0b83[_0x71eb('0x2c')]=_[_0x71eb('0x2d')](_0x3b2277[_0x71eb('0x2c')]);_0x4a0b83[_0x71eb('0x38')]=_[_0x71eb('0x2e')](_0x4a0b83[_0x71eb('0x2f')],_0x4a0b83[_0x71eb('0x2c')]);_0x556ddd[_0x71eb('0x31')]=_[_0x71eb('0x2e')](_0x4a0b83[_0x71eb('0x2f')],qs[_0x71eb('0x30')](_0x3b2277[_0x71eb('0x2c')][_0x71eb('0x30')]));_0x556ddd['attributes']=_0x556ddd['attributes'][_0x71eb('0x32')]?_0x556ddd[_0x71eb('0x31')]:_0x4a0b83[_0x71eb('0x2f')];_0x556ddd['order']=qs['sort'](_0x3b2277[_0x71eb('0x2c')][_0x71eb('0x36')]);_0x556ddd[_0x71eb('0x37')]=qs[_0x71eb('0x38')](_['pick'](_0x3b2277[_0x71eb('0x2c')],_0x4a0b83['filters']));if(_0x3b2277['query'][_0x71eb('0x3a')]){_0x556ddd['where']=_[_0x71eb('0x3c')](_0x556ddd[_0x71eb('0x37')],{'$or':_[_0x71eb('0x2b')](_0x556ddd[_0x71eb('0x31')],function(_0x325cdd){var _0x5939ae={};_0x5939ae[_0x325cdd]={'$like':'%'+_0x3b2277[_0x71eb('0x2c')][_0x71eb('0x3a')]+'%'};return _0x5939ae;})});}_0x556ddd=_[_0x71eb('0x3c')]({},_0x556ddd,_0x3b2277[_0x71eb('0x44')]);return _0x3cbca6[_0x71eb('0x4c')](_0x556ddd);}})[_0x71eb('0x3d')](function(_0x2fef0a){if(_0x2fef0a){_0x1ca4d9=_0x2fef0a[_0x71eb('0x32')];if(!_0x3b2277[_0x71eb('0x2c')][_0x71eb('0x33')](_0x71eb('0x34'))){_0x556ddd['limit']=qs[_0x71eb('0x1c')](_0x3b2277[_0x71eb('0x2c')][_0x71eb('0x1c')]);_0x556ddd[_0x71eb('0x19')]=qs['offset'](_0x3b2277[_0x71eb('0x2c')][_0x71eb('0x19')]);}return _0x3cbca6[_0x71eb('0x4c')](_0x556ddd);}})[_0x71eb('0x3d')](function(_0x371761){if(_0x371761){return _0x371761?{'count':_0x1ca4d9,'rows':_0x371761}:null;}})[_0x71eb('0x3d')](respondWithResult(_0x27b107,null))['catch'](handleError(_0x27b107,null));};exports[_0x71eb('0x4e')]=function(_0x20acc1,_0xf27add,_0x2e9c17){var _0x685e0e={};var _0x45a67f={};var _0x433887;var _0x5519ee;return db[_0x71eb('0x27')]['findOne']({'where':{'id':_0x20acc1[_0x71eb('0x42')]['id']}})['then'](handleEntityNotFound(_0xf27add,null))[_0x71eb('0x3d')](function(_0x7e24d5){if(_0x7e24d5){_0x433887=_0x7e24d5;_0x45a67f[_0x71eb('0x2f')]=_['keys'](db[_0x71eb('0x4b')]['rawAttributes']);_0x45a67f['query']=_['keys'](_0x20acc1['query']);_0x45a67f[_0x71eb('0x38')]=_['intersection'](_0x45a67f[_0x71eb('0x2f')],_0x45a67f[_0x71eb('0x2c')]);_0x685e0e['attributes']=_['intersection'](_0x45a67f[_0x71eb('0x2f')],qs[_0x71eb('0x30')](_0x20acc1[_0x71eb('0x2c')][_0x71eb('0x30')]));_0x685e0e[_0x71eb('0x31')]=_0x685e0e[_0x71eb('0x31')][_0x71eb('0x32')]?_0x685e0e[_0x71eb('0x31')]:_0x45a67f[_0x71eb('0x2f')];_0x685e0e[_0x71eb('0x35')]=qs['sort'](_0x20acc1['query']['sort']);_0x685e0e[_0x71eb('0x37')]=qs[_0x71eb('0x38')](_['pick'](_0x20acc1[_0x71eb('0x2c')],_0x45a67f[_0x71eb('0x38')]));if(_0x20acc1[_0x71eb('0x2c')][_0x71eb('0x3a')]){_0x685e0e['where']=_['merge'](_0x685e0e[_0x71eb('0x37')],{'$or':_[_0x71eb('0x2b')](_0x685e0e[_0x71eb('0x31')],function(_0x39f440){var _0x1efea4={};_0x1efea4[_0x39f440]={'$like':'%'+_0x20acc1[_0x71eb('0x2c')][_0x71eb('0x3a')]+'%'};return _0x1efea4;})});}_0x685e0e=_['merge']({},_0x685e0e,_0x20acc1[_0x71eb('0x44')]);return _0x433887[_0x71eb('0x4e')](_0x685e0e);}})[_0x71eb('0x3d')](function(_0x45a038){if(_0x45a038){_0x5519ee=_0x45a038[_0x71eb('0x32')];if(!_0x20acc1[_0x71eb('0x2c')][_0x71eb('0x33')](_0x71eb('0x34'))){_0x685e0e[_0x71eb('0x1c')]=qs[_0x71eb('0x1c')](_0x20acc1[_0x71eb('0x2c')][_0x71eb('0x1c')]);_0x685e0e['offset']=qs[_0x71eb('0x19')](_0x20acc1[_0x71eb('0x2c')][_0x71eb('0x19')]);}return _0x433887['getDescriptions'](_0x685e0e);}})['then'](function(_0x218e2b){if(_0x218e2b){return _0x218e2b?{'count':_0x5519ee,'rows':_0x218e2b}:null;}})['then'](respondWithResult(_0xf27add,null))[_0x71eb('0x46')](handleError(_0xf27add,null));}; \ No newline at end of file +var _0x382b=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','filters','find','create','body','params','findOne','SugarcrmField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','update','destroy','then','error','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type'];(function(_0x3bd82a,_0x5bde5b){var _0x480b2d=function(_0x31e018){while(--_0x31e018){_0x3bd82a['push'](_0x3bd82a['shift']());}};_0x480b2d(++_0x5bde5b);}(_0x382b,0xbf));var _0xb382=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x382b[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xb382('0x0'));var rimraf=require(_0xb382('0x1'));var zipdir=require(_0xb382('0x2'));var jsonpatch=require(_0xb382('0x3'));var rp=require('request-promise');var moment=require(_0xb382('0x4'));var BPromise=require(_0xb382('0x5'));var Mustache=require('mustache');var util=require(_0xb382('0x6'));var path=require(_0xb382('0x7'));var sox=require(_0xb382('0x8'));var csv=require(_0xb382('0x9'));var ejs=require(_0xb382('0xa'));var fs=require('fs');var fs_extra=require(_0xb382('0xb'));var _=require('lodash');var squel=require(_0xb382('0xc'));var crypto=require(_0xb382('0xd'));var jsforce=require(_0xb382('0xe'));var deskjs=require(_0xb382('0xf'));var toCsv=require(_0xb382('0x9'));var querystring=require(_0xb382('0x10'));var Papa=require(_0xb382('0x11'));var Redis=require(_0xb382('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb382('0x13'));var hardwareService=require(_0xb382('0x14'));var logger=require(_0xb382('0x15'))(_0xb382('0x16'));var utils=require(_0xb382('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb382('0x18'));var db=require(_0xb382('0x19'))['db'];function respondWithStatusCode(_0x272d16,_0x5af4c7){_0x5af4c7=_0x5af4c7||0xcc;return function(_0x202869){if(_0x202869){return _0x272d16[_0xb382('0x1a')](_0x5af4c7);}return _0x272d16[_0xb382('0x1b')](_0x5af4c7)[_0xb382('0x1c')]();};}function respondWithResult(_0x5087f4,_0x10f408){_0x10f408=_0x10f408||0xc8;return function(_0x47fad1){if(_0x47fad1){return _0x5087f4[_0xb382('0x1b')](_0x10f408)[_0xb382('0x1d')](_0x47fad1);}};}function respondWithFilteredResult(_0x247bf9,_0x2014ae){return function(_0x3aced1){if(_0x3aced1){var _0x4a17ed=typeof _0x2014ae[_0xb382('0x1e')]===_0xb382('0x1f')&&typeof _0x2014ae[_0xb382('0x20')]===_0xb382('0x1f');var _0x4da52a=_0x3aced1[_0xb382('0x21')];var _0x2369d0=_0x4a17ed?0x0:_0x2014ae[_0xb382('0x1e')];var _0x493efd=_0x4a17ed?_0x3aced1[_0xb382('0x21')]:_0x2014ae['offset']+_0x2014ae['limit'];var _0x1e2025;if(_0x493efd>=_0x4da52a){_0x493efd=_0x4da52a;_0x1e2025=0xc8;}else{_0x1e2025=0xce;}_0x247bf9[_0xb382('0x1b')](_0x1e2025);return _0x247bf9[_0xb382('0x22')](_0xb382('0x23'),_0x2369d0+'-'+_0x493efd+'/'+_0x4da52a)[_0xb382('0x1d')](_0x3aced1);}return null;};}function patchUpdates(_0x141647){return function(_0x2a5223){try{jsonpatch[_0xb382('0x24')](_0x2a5223,_0x141647,!![]);}catch(_0x42ec9a){return BPromise[_0xb382('0x25')](_0x42ec9a);}return _0x2a5223['save']();};}function saveUpdates(_0x18c24a,_0x21b40f){return function(_0x4885c5){if(_0x4885c5){return _0x4885c5[_0xb382('0x26')](_0x18c24a)['then'](function(_0x190d6c){return _0x190d6c;});}return null;};}function removeEntity(_0x51a787,_0x34de02){return function(_0x36558f){if(_0x36558f){return _0x36558f[_0xb382('0x27')]()[_0xb382('0x28')](function(){_0x51a787[_0xb382('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36548c,_0x4bb70b){return function(_0x4f840e){if(!_0x4f840e){_0x36548c[_0xb382('0x1a')](0x194);}return _0x4f840e;};}function handleError(_0x30f53a,_0x54d03c){_0x54d03c=_0x54d03c||0x1f4;return function(_0x3fef24){logger[_0xb382('0x29')](_0x3fef24['stack']);if(_0x3fef24[_0xb382('0x2a')]){delete _0x3fef24['name'];}_0x30f53a['status'](_0x54d03c)[_0xb382('0x2b')](_0x3fef24);};}exports['index']=function(_0x284698,_0x3064f8){var _0x13ebc5={},_0x231b7c={},_0x14538b={'count':0x0,'rows':[]};var _0x125474=_[_0xb382('0x2c')](db[_0xb382('0x2d')][_0xb382('0x2e')],function(_0xd5f942){return{'name':_0xd5f942[_0xb382('0x2f')],'type':_0xd5f942[_0xb382('0x30')][_0xb382('0x31')]};});_0x231b7c[_0xb382('0x32')]=_['map'](_0x125474,'name');_0x231b7c[_0xb382('0x33')]=_[_0xb382('0x34')](_0x284698[_0xb382('0x33')]);_0x231b7c['filters']=_[_0xb382('0x35')](_0x231b7c[_0xb382('0x32')],_0x231b7c[_0xb382('0x33')]);_0x13ebc5[_0xb382('0x36')]=_['intersection'](_0x231b7c['model'],qs[_0xb382('0x37')](_0x284698[_0xb382('0x33')][_0xb382('0x37')]));_0x13ebc5['attributes']=_0x13ebc5[_0xb382('0x36')][_0xb382('0x38')]?_0x13ebc5['attributes']:_0x231b7c['model'];if(!_0x284698[_0xb382('0x33')][_0xb382('0x39')](_0xb382('0x3a'))){_0x13ebc5[_0xb382('0x20')]=qs[_0xb382('0x20')](_0x284698[_0xb382('0x33')][_0xb382('0x20')]);_0x13ebc5[_0xb382('0x1e')]=qs[_0xb382('0x1e')](_0x284698[_0xb382('0x33')]['offset']);}_0x13ebc5['order']=qs[_0xb382('0x3b')](_0x284698[_0xb382('0x33')][_0xb382('0x3b')]);_0x13ebc5[_0xb382('0x3c')]=qs['filters'](_[_0xb382('0x3d')](_0x284698['query'],_0x231b7c['filters']),_0x125474);if(_0x284698[_0xb382('0x33')][_0xb382('0x3e')]){_0x13ebc5[_0xb382('0x3c')]=_[_0xb382('0x3f')](_0x13ebc5[_0xb382('0x3c')],{'$or':_[_0xb382('0x2c')](_0x125474,function(_0x51a6ed){if(_0x51a6ed[_0xb382('0x30')]!=='VIRTUAL'){var _0x1fc5a5={};_0x1fc5a5[_0x51a6ed[_0xb382('0x2a')]]={'$like':'%'+_0x284698['query'][_0xb382('0x3e')]+'%'};return _0x1fc5a5;}})});}_0x13ebc5=_['merge']({},_0x13ebc5,_0x284698[_0xb382('0x40')]);var _0x56a9dc={'where':_0x13ebc5[_0xb382('0x3c')]};return db[_0xb382('0x2d')][_0xb382('0x21')](_0x56a9dc)['then'](function(_0x5aafff){_0x14538b[_0xb382('0x21')]=_0x5aafff;if(_0x284698[_0xb382('0x33')][_0xb382('0x41')]){_0x13ebc5['include']=[{'all':!![]}];}return db[_0xb382('0x2d')]['findAll'](_0x13ebc5);})[_0xb382('0x28')](function(_0x3d86cb){_0x14538b[_0xb382('0x42')]=_0x3d86cb;return _0x14538b;})[_0xb382('0x28')](respondWithFilteredResult(_0x3064f8,_0x13ebc5))[_0xb382('0x43')](handleError(_0x3064f8,null));};exports[_0xb382('0x44')]=function(_0x445ba6,_0x5266ec){var _0x3a6487={'raw':![],'where':{'id':_0x445ba6['params']['id']}},_0x528cec={};_0x528cec[_0xb382('0x32')]=_[_0xb382('0x34')](db[_0xb382('0x2d')][_0xb382('0x2e')]);_0x528cec[_0xb382('0x33')]=_[_0xb382('0x34')](_0x445ba6[_0xb382('0x33')]);_0x528cec[_0xb382('0x45')]=_['intersection'](_0x528cec['model'],_0x528cec[_0xb382('0x33')]);_0x3a6487[_0xb382('0x36')]=_[_0xb382('0x35')](_0x528cec['model'],qs[_0xb382('0x37')](_0x445ba6[_0xb382('0x33')][_0xb382('0x37')]));_0x3a6487[_0xb382('0x36')]=_0x3a6487[_0xb382('0x36')][_0xb382('0x38')]?_0x3a6487[_0xb382('0x36')]:_0x528cec[_0xb382('0x32')];if(_0x445ba6[_0xb382('0x33')]['includeAll']){_0x3a6487['include']=[{'all':!![]}];}_0x3a6487=_['merge']({},_0x3a6487,_0x445ba6['options']);return db[_0xb382('0x2d')][_0xb382('0x46')](_0x3a6487)['then'](handleEntityNotFound(_0x5266ec,null))[_0xb382('0x28')](respondWithResult(_0x5266ec,null))[_0xb382('0x43')](handleError(_0x5266ec,null));};exports[_0xb382('0x47')]=function(_0x25dbad,_0x5cd737){return db['SugarcrmConfiguration'][_0xb382('0x47')](_0x25dbad[_0xb382('0x48')],{})[_0xb382('0x28')](respondWithResult(_0x5cd737,0xc9))['catch'](handleError(_0x5cd737,null));};exports[_0xb382('0x26')]=function(_0x2772a0,_0x3fbcf5){if(_0x2772a0[_0xb382('0x48')]['id']){delete _0x2772a0['body']['id'];}return db['SugarcrmConfiguration'][_0xb382('0x46')]({'where':{'id':_0x2772a0[_0xb382('0x49')]['id']}})[_0xb382('0x28')](handleEntityNotFound(_0x3fbcf5,null))['then'](saveUpdates(_0x2772a0[_0xb382('0x48')],null))[_0xb382('0x28')](respondWithResult(_0x3fbcf5,null))[_0xb382('0x43')](handleError(_0x3fbcf5,null));};exports['destroy']=function(_0x26649b,_0x31e937){return db['SugarcrmConfiguration'][_0xb382('0x46')]({'where':{'id':_0x26649b[_0xb382('0x49')]['id']}})[_0xb382('0x28')](handleEntityNotFound(_0x31e937,null))[_0xb382('0x28')](removeEntity(_0x31e937,null))['catch'](handleError(_0x31e937,null));};exports['getFields']=function(_0x59e150,_0x51f688,_0x36d7e4){var _0x367356={};var _0x12483e={};var _0x345cbd;var _0x91cc22;return db[_0xb382('0x2d')][_0xb382('0x4a')]({'where':{'id':_0x59e150[_0xb382('0x49')]['id']}})['then'](handleEntityNotFound(_0x51f688,null))[_0xb382('0x28')](function(_0x47e233){if(_0x47e233){_0x345cbd=_0x47e233;_0x12483e[_0xb382('0x32')]=_[_0xb382('0x34')](db[_0xb382('0x4b')]['rawAttributes']);_0x12483e[_0xb382('0x33')]=_[_0xb382('0x34')](_0x59e150[_0xb382('0x33')]);_0x12483e[_0xb382('0x45')]=_[_0xb382('0x35')](_0x12483e[_0xb382('0x32')],_0x12483e[_0xb382('0x33')]);_0x367356[_0xb382('0x36')]=_[_0xb382('0x35')](_0x12483e[_0xb382('0x32')],qs[_0xb382('0x37')](_0x59e150[_0xb382('0x33')][_0xb382('0x37')]));_0x367356[_0xb382('0x36')]=_0x367356[_0xb382('0x36')]['length']?_0x367356[_0xb382('0x36')]:_0x12483e[_0xb382('0x32')];_0x367356[_0xb382('0x4c')]=qs[_0xb382('0x3b')](_0x59e150[_0xb382('0x33')][_0xb382('0x3b')]);_0x367356[_0xb382('0x3c')]=qs[_0xb382('0x45')](_[_0xb382('0x3d')](_0x59e150[_0xb382('0x33')],_0x12483e[_0xb382('0x45')]));if(_0x59e150[_0xb382('0x33')]['filter']){_0x367356['where']=_['merge'](_0x367356[_0xb382('0x3c')],{'$or':_[_0xb382('0x2c')](_0x367356[_0xb382('0x36')],function(_0x5a8814){var _0x1ab79a={};_0x1ab79a[_0x5a8814]={'$like':'%'+_0x59e150[_0xb382('0x33')]['filter']+'%'};return _0x1ab79a;})});}_0x367356=_[_0xb382('0x3f')]({},_0x367356,_0x59e150[_0xb382('0x40')]);return _0x345cbd['getFields'](_0x367356);}})[_0xb382('0x28')](function(_0xc2edf5){if(_0xc2edf5){_0x91cc22=_0xc2edf5['length'];if(!_0x59e150['query']['hasOwnProperty'](_0xb382('0x3a'))){_0x367356['limit']=qs[_0xb382('0x20')](_0x59e150['query'][_0xb382('0x20')]);_0x367356[_0xb382('0x1e')]=qs[_0xb382('0x1e')](_0x59e150[_0xb382('0x33')][_0xb382('0x1e')]);}return _0x345cbd[_0xb382('0x4d')](_0x367356);}})[_0xb382('0x28')](function(_0x25c55b){if(_0x25c55b){return _0x25c55b?{'count':_0x91cc22,'rows':_0x25c55b}:null;}})[_0xb382('0x28')](respondWithResult(_0x51f688,null))[_0xb382('0x43')](handleError(_0x51f688,null));};exports['getSubjects']=function(_0x4e7019,_0x976b6c,_0x94e058){var _0x4568ab={};var _0x10020d={};var _0x57401a;var _0x24079b;return db[_0xb382('0x2d')]['findOne']({'where':{'id':_0x4e7019[_0xb382('0x49')]['id']}})[_0xb382('0x28')](handleEntityNotFound(_0x976b6c,null))[_0xb382('0x28')](function(_0x38c6c1){if(_0x38c6c1){_0x57401a=_0x38c6c1;_0x10020d[_0xb382('0x32')]=_[_0xb382('0x34')](db[_0xb382('0x4b')]['rawAttributes']);_0x10020d['query']=_[_0xb382('0x34')](_0x4e7019[_0xb382('0x33')]);_0x10020d[_0xb382('0x45')]=_[_0xb382('0x35')](_0x10020d['model'],_0x10020d['query']);_0x4568ab['attributes']=_[_0xb382('0x35')](_0x10020d[_0xb382('0x32')],qs[_0xb382('0x37')](_0x4e7019[_0xb382('0x33')]['fields']));_0x4568ab[_0xb382('0x36')]=_0x4568ab[_0xb382('0x36')]['length']?_0x4568ab[_0xb382('0x36')]:_0x10020d[_0xb382('0x32')];_0x4568ab[_0xb382('0x4c')]=qs['sort'](_0x4e7019[_0xb382('0x33')][_0xb382('0x3b')]);_0x4568ab[_0xb382('0x3c')]=qs[_0xb382('0x45')](_[_0xb382('0x3d')](_0x4e7019['query'],_0x10020d[_0xb382('0x45')]));if(_0x4e7019['query'][_0xb382('0x3e')]){_0x4568ab['where']=_[_0xb382('0x3f')](_0x4568ab[_0xb382('0x3c')],{'$or':_['map'](_0x4568ab['attributes'],function(_0x4b71af){var _0x3f7612={};_0x3f7612[_0x4b71af]={'$like':'%'+_0x4e7019[_0xb382('0x33')][_0xb382('0x3e')]+'%'};return _0x3f7612;})});}_0x4568ab=_['merge']({},_0x4568ab,_0x4e7019[_0xb382('0x40')]);return _0x57401a[_0xb382('0x4e')](_0x4568ab);}})[_0xb382('0x28')](function(_0x296a51){if(_0x296a51){_0x24079b=_0x296a51[_0xb382('0x38')];if(!_0x4e7019[_0xb382('0x33')][_0xb382('0x39')](_0xb382('0x3a'))){_0x4568ab[_0xb382('0x20')]=qs[_0xb382('0x20')](_0x4e7019[_0xb382('0x33')]['limit']);_0x4568ab[_0xb382('0x1e')]=qs[_0xb382('0x1e')](_0x4e7019[_0xb382('0x33')][_0xb382('0x1e')]);}return _0x57401a[_0xb382('0x4e')](_0x4568ab);}})[_0xb382('0x28')](function(_0x3f4a45){if(_0x3f4a45){return _0x3f4a45?{'count':_0x24079b,'rows':_0x3f4a45}:null;}})[_0xb382('0x28')](respondWithResult(_0x976b6c,null))[_0xb382('0x43')](handleError(_0x976b6c,null));};exports[_0xb382('0x4f')]=function(_0x5ae3d3,_0x229174,_0x3dc68b){var _0x440f91={};var _0x2e45bf={};var _0x11b170;var _0x2ff3e7;return db['SugarcrmConfiguration'][_0xb382('0x4a')]({'where':{'id':_0x5ae3d3[_0xb382('0x49')]['id']}})[_0xb382('0x28')](handleEntityNotFound(_0x229174,null))[_0xb382('0x28')](function(_0x438d16){if(_0x438d16){_0x11b170=_0x438d16;_0x2e45bf['model']=_['keys'](db[_0xb382('0x4b')][_0xb382('0x2e')]);_0x2e45bf['query']=_[_0xb382('0x34')](_0x5ae3d3[_0xb382('0x33')]);_0x2e45bf[_0xb382('0x45')]=_[_0xb382('0x35')](_0x2e45bf[_0xb382('0x32')],_0x2e45bf[_0xb382('0x33')]);_0x440f91[_0xb382('0x36')]=_[_0xb382('0x35')](_0x2e45bf[_0xb382('0x32')],qs[_0xb382('0x37')](_0x5ae3d3[_0xb382('0x33')][_0xb382('0x37')]));_0x440f91[_0xb382('0x36')]=_0x440f91['attributes']['length']?_0x440f91[_0xb382('0x36')]:_0x2e45bf[_0xb382('0x32')];_0x440f91['order']=qs[_0xb382('0x3b')](_0x5ae3d3[_0xb382('0x33')][_0xb382('0x3b')]);_0x440f91[_0xb382('0x3c')]=qs[_0xb382('0x45')](_[_0xb382('0x3d')](_0x5ae3d3[_0xb382('0x33')],_0x2e45bf[_0xb382('0x45')]));if(_0x5ae3d3[_0xb382('0x33')][_0xb382('0x3e')]){_0x440f91[_0xb382('0x3c')]=_[_0xb382('0x3f')](_0x440f91[_0xb382('0x3c')],{'$or':_['map'](_0x440f91[_0xb382('0x36')],function(_0x2de56e){var _0x1abb0f={};_0x1abb0f[_0x2de56e]={'$like':'%'+_0x5ae3d3['query']['filter']+'%'};return _0x1abb0f;})});}_0x440f91=_[_0xb382('0x3f')]({},_0x440f91,_0x5ae3d3[_0xb382('0x40')]);return _0x11b170[_0xb382('0x4f')](_0x440f91);}})[_0xb382('0x28')](function(_0x439d12){if(_0x439d12){_0x2ff3e7=_0x439d12[_0xb382('0x38')];if(!_0x5ae3d3[_0xb382('0x33')]['hasOwnProperty'](_0xb382('0x3a'))){_0x440f91[_0xb382('0x20')]=qs[_0xb382('0x20')](_0x5ae3d3['query'][_0xb382('0x20')]);_0x440f91[_0xb382('0x1e')]=qs[_0xb382('0x1e')](_0x5ae3d3[_0xb382('0x33')][_0xb382('0x1e')]);}return _0x11b170[_0xb382('0x4f')](_0x440f91);}})[_0xb382('0x28')](function(_0x335255){if(_0x335255){return _0x335255?{'count':_0x2ff3e7,'rows':_0x335255}:null;}})[_0xb382('0x28')](respondWithResult(_0x229174,null))[_0xb382('0x43')](handleError(_0x229174,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 2c8d0e5..acd5926 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 _0x7e20=['request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x16216f,_0x57c1ac){var _0x3de213=function(_0x2046fa){while(--_0x2046fa){_0x16216f['push'](_0x16216f['shift']());}};_0x3de213(++_0x57c1ac);}(_0x7e20,0xa3));var _0x07e2=function(_0x572373,_0x10e86f){_0x572373=_0x572373-0x0;var _0x11d070=_0x7e20[_0x572373];return _0x11d070;};'use strict';var _=require(_0x07e2('0x0'));var util=require(_0x07e2('0x1'));var logger=require(_0x07e2('0x2'))(_0x07e2('0x3'));var moment=require(_0x07e2('0x4'));var BPromise=require(_0x07e2('0x5'));var rp=require(_0x07e2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07e2('0x7'));var config=require(_0x07e2('0x8'));var attributes=require(_0x07e2('0x9'));module[_0x07e2('0xa')]=function(_0x52372c,_0x2634da){return _0x52372c['define'](_0x07e2('0xb'),attributes,{'tableName':_0x07e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbea=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdbea,0x149));var _0xadbe=function(_0x479dfd,_0x47ff77){_0x479dfd=_0x479dfd-0x0;var _0x5b82b4=_0xdbea[_0x479dfd];return _0x5b82b4;};'use strict';var _=require(_0xadbe('0x0'));var util=require('util');var logger=require(_0xadbe('0x1'))(_0xadbe('0x2'));var moment=require(_0xadbe('0x3'));var BPromise=require(_0xadbe('0x4'));var rp=require(_0xadbe('0x5'));var fs=require('fs');var path=require(_0xadbe('0x6'));var rimraf=require(_0xadbe('0x7'));var config=require(_0xadbe('0x8'));var attributes=require(_0xadbe('0x9'));module['exports']=function(_0x326515,_0x4b945d){return _0x326515['define'](_0xadbe('0xa'),attributes,{'tableName':_0xadbe('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 989b31e..f71d180 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 _0x894e=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x894e,0xbb));var _0xe894=function(_0x584a03,_0x59e0c8){_0x584a03=_0x584a03-0x0;var _0x29d9c9=_0x894e[_0x584a03];return _0x29d9c9;};'use strict';var _=require('lodash');var util=require(_0xe894('0x0'));var moment=require(_0xe894('0x1'));var BPromise=require(_0xe894('0x2'));var rs=require(_0xe894('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe894('0x4'))['db'];var utils=require(_0xe894('0x5'));var logger=require(_0xe894('0x6'))(_0xe894('0x7'));var config=require(_0xe894('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe894('0x9')][_0xe894('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23bf2c,_0x34eda4,_0x431f92){return new BPromise(function(_0x2803d8,_0x76d5dd){return client[_0xe894('0xb')](_0x23bf2c,_0x431f92)[_0xe894('0xc')](function(_0x2d9001){logger['info'](_0xe894('0xd'),_0x34eda4,_0xe894('0xe'));logger[_0xe894('0xf')](_0xe894('0x10'),_0x34eda4,_0xe894('0xe'),JSON['stringify'](_0x2d9001));if(_0x2d9001[_0xe894('0x11')]){if(_0x2d9001[_0xe894('0x11')][_0xe894('0x12')]===0x1f4){logger['error'](_0xe894('0xd'),_0x34eda4,_0x2d9001[_0xe894('0x11')][_0xe894('0x13')]);return _0x76d5dd(_0x2d9001[_0xe894('0x11')][_0xe894('0x13')]);}logger[_0xe894('0x11')](_0xe894('0xd'),_0x34eda4,_0x2d9001[_0xe894('0x11')][_0xe894('0x13')]);return _0x2803d8(_0x2d9001['error']['message']);}else{logger[_0xe894('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x34eda4,'request\x20sent');_0x2803d8(_0x2d9001['result'][_0xe894('0x13')]);}})[_0xe894('0x15')](function(_0x445af3){logger['error'](_0xe894('0xd'),_0x34eda4,_0x445af3);_0x76d5dd(_0x445af3);});});} \ No newline at end of file +var _0x76aa=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x283c38,_0x28eb9c){var _0x5de6e5=function(_0x41194b){while(--_0x41194b){_0x283c38['push'](_0x283c38['shift']());}};_0x5de6e5(++_0x28eb9c);}(_0x76aa,0x1f4));var _0xa76a=function(_0x22147e,_0x168f4c){_0x22147e=_0x22147e-0x0;var _0x42829a=_0x76aa[_0x22147e];return _0x42829a;};'use strict';var _=require(_0xa76a('0x0'));var util=require(_0xa76a('0x1'));var moment=require(_0xa76a('0x2'));var BPromise=require(_0xa76a('0x3'));var rs=require(_0xa76a('0x4'));var fs=require('fs');var Redis=require(_0xa76a('0x5'));var db=require(_0xa76a('0x6'))['db'];var utils=require(_0xa76a('0x7'));var logger=require(_0xa76a('0x8'))('rpc');var config=require(_0xa76a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa76a('0xa')][_0xa76a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11b2f8,_0x28d06b,_0x2b7a1d){return new BPromise(function(_0x5b42b5,_0x460d58){return client[_0xa76a('0xc')](_0x11b2f8,_0x2b7a1d)[_0xa76a('0xd')](function(_0x441175){logger['info'](_0xa76a('0xe'),_0x28d06b,_0xa76a('0xf'));logger[_0xa76a('0x10')](_0xa76a('0x11'),_0x28d06b,'request\x20sent',JSON[_0xa76a('0x12')](_0x441175));if(_0x441175['error']){if(_0x441175[_0xa76a('0x13')]['code']===0x1f4){logger[_0xa76a('0x13')](_0xa76a('0xe'),_0x28d06b,_0x441175[_0xa76a('0x13')][_0xa76a('0x14')]);return _0x460d58(_0x441175[_0xa76a('0x13')][_0xa76a('0x14')]);}logger[_0xa76a('0x13')](_0xa76a('0xe'),_0x28d06b,_0x441175['error'][_0xa76a('0x14')]);return _0x5b42b5(_0x441175[_0xa76a('0x13')][_0xa76a('0x14')]);}else{logger['info'](_0xa76a('0xe'),_0x28d06b,'request\x20sent');_0x5b42b5(_0x441175[_0xa76a('0x15')]['message']);}})[_0xa76a('0x16')](function(_0x538a87){logger[_0xa76a('0x13')](_0xa76a('0xe'),_0x28d06b,_0x538a87);_0x460d58(_0x538a87);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index c3d6265..a161f31 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 _0xb55d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x303054,_0xfbb65a){var _0x3a7287=function(_0x3f0a0d){while(--_0x3f0a0d){_0x303054['push'](_0x303054['shift']());}};_0x3a7287(++_0xfbb65a);}(_0xb55d,0xaa));var _0xdb55=function(_0x5322e4,_0x4313f0){_0x5322e4=_0x5322e4-0x0;var _0x118dc0=_0xb55d[_0x5322e4];return _0x118dc0;};'use strict';var multer=require('multer');var util=require(_0xdb55('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdb55('0x1'));var router=express[_0xdb55('0x2')]();var fs_extra=require(_0xdb55('0x3'));var auth=require(_0xdb55('0x4'));var interaction=require(_0xdb55('0x5'));var config=require(_0xdb55('0x6'));var controller=require(_0xdb55('0x7'));router['get']('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0x9')]);router[_0xdb55('0xa')](_0xdb55('0xb'),auth[_0xdb55('0x8')](),controller[_0xdb55('0xc')]);router[_0xdb55('0xd')]('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0xe')]);router[_0xdb55('0xf')](_0xdb55('0xb'),auth['isAuthenticated'](),controller[_0xdb55('0x10')]);router[_0xdb55('0x11')](_0xdb55('0xb'),auth[_0xdb55('0x8')](),controller[_0xdb55('0x12')]);module['exports']=router; \ No newline at end of file +var _0x52ce=['update','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','put'];(function(_0x34b0ba,_0x261567){var _0x138788=function(_0x194226){while(--_0x194226){_0x34b0ba['push'](_0x34b0ba['shift']());}};_0x138788(++_0x261567);}(_0x52ce,0x102));var _0xe52c=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x52ce[_0x4b7895];return _0x264180;};'use strict';var multer=require('multer');var util=require(_0xe52c('0x0'));var path=require(_0xe52c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe52c('0x2')]();var fs_extra=require(_0xe52c('0x3'));var auth=require(_0xe52c('0x4'));var interaction=require(_0xe52c('0x5'));var config=require(_0xe52c('0x6'));var controller=require(_0xe52c('0x7'));router['get']('/',auth[_0xe52c('0x8')](),controller[_0xe52c('0x9')]);router[_0xe52c('0xa')](_0xe52c('0xb'),auth[_0xe52c('0x8')](),controller[_0xe52c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe52c('0xd')]('/:id',auth[_0xe52c('0x8')](),controller[_0xe52c('0xe')]);router[_0xe52c('0xf')](_0xe52c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe52c('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 d29e25d..2aec608 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 _0x3b26=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','exports'];(function(_0x104693,_0x5ae6b6){var _0x1bffc5=function(_0x5ac614){while(--_0x5ac614){_0x104693['push'](_0x104693['shift']());}};_0x1bffc5(++_0x5ae6b6);}(_0x3b26,0x87));var _0x63b2=function(_0x59d347,_0x2ce76c){_0x59d347=_0x59d347-0x0;var _0x51940b=_0x3b26[_0x59d347];return _0x51940b;};'use strict';var Sequelize=require('sequelize');module[_0x63b2('0x0')]={'type':{'type':Sequelize[_0x63b2('0x1')](_0x63b2('0x2'),_0x63b2('0x3'),'customVariable',_0x63b2('0x4'),_0x63b2('0x5')),'defaultValue':_0x63b2('0x2')},'content':{'type':Sequelize[_0x63b2('0x6')]},'key':{'type':Sequelize[_0x63b2('0x6')]},'keyType':{'type':Sequelize[_0x63b2('0x1')](_0x63b2('0x2'),_0x63b2('0x3'),_0x63b2('0x7'))},'keyContent':{'type':Sequelize[_0x63b2('0x6')]},'idField':{'type':Sequelize[_0x63b2('0x6')]},'nameField':{'type':Sequelize[_0x63b2('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x63b2('0x6')]}}; \ No newline at end of file +var _0x051e=['variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','exports'];(function(_0x5de320,_0x1439d6){var _0x34ec93=function(_0x206abc){while(--_0x206abc){_0x5de320['push'](_0x5de320['shift']());}};_0x34ec93(++_0x1439d6);}(_0x051e,0xd7));var _0xe051=function(_0x82dd94,_0x247ebf){_0x82dd94=_0x82dd94-0x0;var _0x368f56=_0x051e[_0x82dd94];return _0x368f56;};'use strict';var Sequelize=require('sequelize');module[_0xe051('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xe051('0x1'),_0xe051('0x2'),_0xe051('0x3'),_0xe051('0x4')),'defaultValue':_0xe051('0x5')},'content':{'type':Sequelize[_0xe051('0x6')]},'key':{'type':Sequelize[_0xe051('0x6')]},'keyType':{'type':Sequelize[_0xe051('0x7')](_0xe051('0x5'),_0xe051('0x1'),_0xe051('0x2'))},'keyContent':{'type':Sequelize[_0xe051('0x6')]},'idField':{'type':Sequelize[_0xe051('0x6')]},'nameField':{'type':Sequelize[_0xe051('0x6')]},'customField':{'type':Sequelize[_0xe051('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe051('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8c4d720..1ef76c8 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 _0x56de=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','pick','merge','filter','options','where','include','SugarcrmField','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x56de,0xcc));var _0xe56d=function(_0x46f504,_0x47a51c){_0x46f504=_0x46f504-0x0;var _0x2b92dc=_0x56de[_0x46f504];return _0x2b92dc;};'use strict';var emlformat=require(_0xe56d('0x0'));var rimraf=require(_0xe56d('0x1'));var zipdir=require(_0xe56d('0x2'));var jsonpatch=require(_0xe56d('0x3'));var rp=require(_0xe56d('0x4'));var moment=require(_0xe56d('0x5'));var BPromise=require(_0xe56d('0x6'));var Mustache=require(_0xe56d('0x7'));var util=require('util');var path=require(_0xe56d('0x8'));var sox=require(_0xe56d('0x9'));var csv=require(_0xe56d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe56d('0xb'));var _=require(_0xe56d('0xc'));var squel=require(_0xe56d('0xd'));var crypto=require(_0xe56d('0xe'));var jsforce=require(_0xe56d('0xf'));var deskjs=require(_0xe56d('0x10'));var toCsv=require(_0xe56d('0xa'));var querystring=require(_0xe56d('0x11'));var Papa=require('papaparse');var Redis=require(_0xe56d('0x12'));var authService=require(_0xe56d('0x13'));var qs=require(_0xe56d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe56d('0x15'));var logger=require(_0xe56d('0x16'))(_0xe56d('0x17'));var utils=require('../../config/utils');var config=require(_0xe56d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe56d('0x19'))['db'];function respondWithStatusCode(_0x3473d8,_0x3c2f05){_0x3c2f05=_0x3c2f05||0xcc;return function(_0x49f6a2){if(_0x49f6a2){return _0x3473d8['sendStatus'](_0x3c2f05);}return _0x3473d8[_0xe56d('0x1a')](_0x3c2f05)[_0xe56d('0x1b')]();};}function respondWithResult(_0xbc1caf,_0x4fc302){_0x4fc302=_0x4fc302||0xc8;return function(_0x3d8d97){if(_0x3d8d97){return _0xbc1caf[_0xe56d('0x1a')](_0x4fc302)['json'](_0x3d8d97);}};}function respondWithFilteredResult(_0x53e8c7,_0x384fc1){return function(_0x4cad1d){if(_0x4cad1d){var _0x47ffb8=typeof _0x384fc1[_0xe56d('0x1c')]==='undefined'&&typeof _0x384fc1['limit']===_0xe56d('0x1d');var _0x49079a=_0x4cad1d[_0xe56d('0x1e')];var _0x138260=_0x47ffb8?0x0:_0x384fc1['offset'];var _0x3f126c=_0x47ffb8?_0x4cad1d['count']:_0x384fc1[_0xe56d('0x1c')]+_0x384fc1['limit'];var _0x50d7d1;if(_0x3f126c>=_0x49079a){_0x3f126c=_0x49079a;_0x50d7d1=0xc8;}else{_0x50d7d1=0xce;}_0x53e8c7[_0xe56d('0x1a')](_0x50d7d1);return _0x53e8c7[_0xe56d('0x1f')](_0xe56d('0x20'),_0x138260+'-'+_0x3f126c+'/'+_0x49079a)[_0xe56d('0x21')](_0x4cad1d);}return null;};}function patchUpdates(_0x520329){return function(_0xbbfd20){try{jsonpatch['apply'](_0xbbfd20,_0x520329,!![]);}catch(_0x3d4fa2){return BPromise[_0xe56d('0x22')](_0x3d4fa2);}return _0xbbfd20[_0xe56d('0x23')]();};}function saveUpdates(_0x215937,_0x4f8ac1){return function(_0x5d6d7b){if(_0x5d6d7b){return _0x5d6d7b[_0xe56d('0x24')](_0x215937)[_0xe56d('0x25')](function(_0x4f88b2){return _0x4f88b2;});}return null;};}function removeEntity(_0x2d3997,_0x3c7349){return function(_0x447c2b){if(_0x447c2b){return _0x447c2b[_0xe56d('0x26')]()[_0xe56d('0x25')](function(){_0x2d3997[_0xe56d('0x1a')](0xcc)[_0xe56d('0x1b')]();});}};}function handleEntityNotFound(_0x2eddd4,_0x41920a){return function(_0x8b9ce4){if(!_0x8b9ce4){_0x2eddd4['sendStatus'](0x194);}return _0x8b9ce4;};}function handleError(_0x238791,_0x50671f){_0x50671f=_0x50671f||0x1f4;return function(_0x5a307b){logger[_0xe56d('0x27')](_0x5a307b[_0xe56d('0x28')]);if(_0x5a307b[_0xe56d('0x29')]){delete _0x5a307b['name'];}_0x238791['status'](_0x50671f)['send'](_0x5a307b);};}exports[_0xe56d('0x2a')]=function(_0x4cbc77,_0x4bef33){var _0x32582c={},_0x2264e7={},_0x377181={'count':0x0,'rows':[]};var _0x38fd51=_[_0xe56d('0x2b')](db['SugarcrmField'][_0xe56d('0x2c')],function(_0x3f2d8f){return{'name':_0x3f2d8f[_0xe56d('0x2d')],'type':_0x3f2d8f[_0xe56d('0x2e')]['key']};});_0x2264e7[_0xe56d('0x2f')]=_['map'](_0x38fd51,'name');_0x2264e7[_0xe56d('0x30')]=_['keys'](_0x4cbc77[_0xe56d('0x30')]);_0x2264e7[_0xe56d('0x31')]=_[_0xe56d('0x32')](_0x2264e7[_0xe56d('0x2f')],_0x2264e7[_0xe56d('0x30')]);_0x32582c['attributes']=_[_0xe56d('0x32')](_0x2264e7[_0xe56d('0x2f')],qs[_0xe56d('0x33')](_0x4cbc77[_0xe56d('0x30')][_0xe56d('0x33')]));_0x32582c[_0xe56d('0x34')]=_0x32582c[_0xe56d('0x34')][_0xe56d('0x35')]?_0x32582c[_0xe56d('0x34')]:_0x2264e7[_0xe56d('0x2f')];if(!_0x4cbc77['query'][_0xe56d('0x36')](_0xe56d('0x37'))){_0x32582c[_0xe56d('0x38')]=qs[_0xe56d('0x38')](_0x4cbc77[_0xe56d('0x30')][_0xe56d('0x38')]);_0x32582c['offset']=qs[_0xe56d('0x1c')](_0x4cbc77['query'][_0xe56d('0x1c')]);}_0x32582c['order']=qs['sort'](_0x4cbc77['query']['sort']);_0x32582c['where']=qs[_0xe56d('0x31')](_[_0xe56d('0x39')](_0x4cbc77[_0xe56d('0x30')],_0x2264e7[_0xe56d('0x31')]),_0x38fd51);if(_0x4cbc77[_0xe56d('0x30')]['filter']){_0x32582c['where']=_[_0xe56d('0x3a')](_0x32582c['where'],{'$or':_[_0xe56d('0x2b')](_0x38fd51,function(_0x7bdd0d){if(_0x7bdd0d[_0xe56d('0x2e')]!=='VIRTUAL'){var _0x43b579={};_0x43b579[_0x7bdd0d['name']]={'$like':'%'+_0x4cbc77[_0xe56d('0x30')][_0xe56d('0x3b')]+'%'};return _0x43b579;}})});}_0x32582c=_['merge']({},_0x32582c,_0x4cbc77[_0xe56d('0x3c')]);var _0x37998b={'where':_0x32582c[_0xe56d('0x3d')]};return db['SugarcrmField'][_0xe56d('0x1e')](_0x37998b)['then'](function(_0xcf468c){_0x377181['count']=_0xcf468c;if(_0x4cbc77[_0xe56d('0x30')]['includeAll']){_0x32582c[_0xe56d('0x3e')]=[{'all':!![]}];}return db[_0xe56d('0x3f')][_0xe56d('0x40')](_0x32582c);})[_0xe56d('0x25')](function(_0x2d8357){_0x377181[_0xe56d('0x41')]=_0x2d8357;return _0x377181;})[_0xe56d('0x25')](respondWithFilteredResult(_0x4bef33,_0x32582c))[_0xe56d('0x42')](handleError(_0x4bef33,null));};exports[_0xe56d('0x43')]=function(_0x21e072,_0x261656){var _0x261d48={'raw':!![],'where':{'id':_0x21e072[_0xe56d('0x44')]['id']}},_0x26cf8a={};_0x26cf8a['model']=_[_0xe56d('0x45')](db['SugarcrmField'][_0xe56d('0x2c')]);_0x26cf8a[_0xe56d('0x30')]=_[_0xe56d('0x45')](_0x21e072['query']);_0x26cf8a[_0xe56d('0x31')]=_[_0xe56d('0x32')](_0x26cf8a[_0xe56d('0x2f')],_0x26cf8a['query']);_0x261d48['attributes']=_[_0xe56d('0x32')](_0x26cf8a[_0xe56d('0x2f')],qs['fields'](_0x21e072[_0xe56d('0x30')][_0xe56d('0x33')]));_0x261d48[_0xe56d('0x34')]=_0x261d48[_0xe56d('0x34')]['length']?_0x261d48[_0xe56d('0x34')]:_0x26cf8a[_0xe56d('0x2f')];if(_0x21e072['query'][_0xe56d('0x46')]){_0x261d48[_0xe56d('0x3e')]=[{'all':!![]}];}_0x261d48=_['merge']({},_0x261d48,_0x21e072[_0xe56d('0x3c')]);return db[_0xe56d('0x3f')][_0xe56d('0x47')](_0x261d48)[_0xe56d('0x25')](handleEntityNotFound(_0x261656,null))[_0xe56d('0x25')](respondWithResult(_0x261656,null))[_0xe56d('0x42')](handleError(_0x261656,null));};exports['create']=function(_0x53ddf3,_0x4f0ac3){return db['SugarcrmField'][_0xe56d('0x48')](_0x53ddf3['body'],{})[_0xe56d('0x25')](respondWithResult(_0x4f0ac3,0xc9))[_0xe56d('0x42')](handleError(_0x4f0ac3,null));};exports[_0xe56d('0x24')]=function(_0x2e8aea,_0x4036fa){if(_0x2e8aea['body']['id']){delete _0x2e8aea[_0xe56d('0x49')]['id'];}return db[_0xe56d('0x3f')]['find']({'where':{'id':_0x2e8aea[_0xe56d('0x44')]['id']}})[_0xe56d('0x25')](handleEntityNotFound(_0x4036fa,null))[_0xe56d('0x25')](saveUpdates(_0x2e8aea[_0xe56d('0x49')],null))['then'](respondWithResult(_0x4036fa,null))[_0xe56d('0x42')](handleError(_0x4036fa,null));};exports[_0xe56d('0x26')]=function(_0x27cfe6,_0xf447d3){return db[_0xe56d('0x3f')][_0xe56d('0x47')]({'where':{'id':_0x27cfe6[_0xe56d('0x44')]['id']}})[_0xe56d('0x25')](handleEntityNotFound(_0xf447d3,null))[_0xe56d('0x25')](removeEntity(_0xf447d3,null))['catch'](handleError(_0xf447d3,null));}; \ No newline at end of file +var _0x814f=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','mustache','util','ejs','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/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes'];(function(_0x263999,_0x477176){var _0x336996=function(_0x43c50a){while(--_0x43c50a){_0x263999['push'](_0x263999['shift']());}};_0x336996(++_0x477176);}(_0x814f,0xfa));var _0xf814=function(_0x521a9e,_0x12dc38){_0x521a9e=_0x521a9e-0x0;var _0x72bfce=_0x814f[_0x521a9e];return _0x72bfce;};'use strict';var emlformat=require(_0xf814('0x0'));var rimraf=require(_0xf814('0x1'));var zipdir=require(_0xf814('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf814('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf814('0x4'));var util=require(_0xf814('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf814('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf814('0x7'));var squel=require(_0xf814('0x8'));var crypto=require(_0xf814('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf814('0xa'));var toCsv=require(_0xf814('0xb'));var querystring=require(_0xf814('0xc'));var Papa=require(_0xf814('0xd'));var Redis=require('ioredis');var authService=require(_0xf814('0xe'));var qs=require(_0xf814('0xf'));var as=require(_0xf814('0x10'));var hardwareService=require(_0xf814('0x11'));var logger=require(_0xf814('0x12'))(_0xf814('0x13'));var utils=require(_0xf814('0x14'));var config=require(_0xf814('0x15'));var licenseUtil=require(_0xf814('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x589e52,_0x118de1){_0x118de1=_0x118de1||0xcc;return function(_0x2d8182){if(_0x2d8182){return _0x589e52[_0xf814('0x17')](_0x118de1);}return _0x589e52[_0xf814('0x18')](_0x118de1)[_0xf814('0x19')]();};}function respondWithResult(_0x7f5232,_0x480935){_0x480935=_0x480935||0xc8;return function(_0x45a2c6){if(_0x45a2c6){return _0x7f5232[_0xf814('0x18')](_0x480935)[_0xf814('0x1a')](_0x45a2c6);}};}function respondWithFilteredResult(_0x15b3bd,_0x3dde43){return function(_0x5b40e8){if(_0x5b40e8){var _0x1d8b10=typeof _0x3dde43['offset']==='undefined'&&typeof _0x3dde43[_0xf814('0x1b')]===_0xf814('0x1c');var _0x57fd52=_0x5b40e8[_0xf814('0x1d')];var _0x4ef21f=_0x1d8b10?0x0:_0x3dde43[_0xf814('0x1e')];var _0x211618=_0x1d8b10?_0x5b40e8[_0xf814('0x1d')]:_0x3dde43[_0xf814('0x1e')]+_0x3dde43[_0xf814('0x1b')];var _0x24d077;if(_0x211618>=_0x57fd52){_0x211618=_0x57fd52;_0x24d077=0xc8;}else{_0x24d077=0xce;}_0x15b3bd[_0xf814('0x18')](_0x24d077);return _0x15b3bd[_0xf814('0x1f')](_0xf814('0x20'),_0x4ef21f+'-'+_0x211618+'/'+_0x57fd52)['json'](_0x5b40e8);}return null;};}function patchUpdates(_0x288acb){return function(_0x387f26){try{jsonpatch[_0xf814('0x21')](_0x387f26,_0x288acb,!![]);}catch(_0x16e017){return BPromise[_0xf814('0x22')](_0x16e017);}return _0x387f26[_0xf814('0x23')]();};}function saveUpdates(_0x528231,_0x514302){return function(_0x5067f1){if(_0x5067f1){return _0x5067f1[_0xf814('0x24')](_0x528231)[_0xf814('0x25')](function(_0x37fbed){return _0x37fbed;});}return null;};}function removeEntity(_0x41e9dc,_0x5378de){return function(_0x2e30f1){if(_0x2e30f1){return _0x2e30f1['destroy']()[_0xf814('0x25')](function(){_0x41e9dc['status'](0xcc)[_0xf814('0x19')]();});}};}function handleEntityNotFound(_0x24724f,_0x131376){return function(_0x30655a){if(!_0x30655a){_0x24724f[_0xf814('0x17')](0x194);}return _0x30655a;};}function handleError(_0x20bb17,_0x14ef8b){_0x14ef8b=_0x14ef8b||0x1f4;return function(_0x44b2f6){logger[_0xf814('0x26')](_0x44b2f6[_0xf814('0x27')]);if(_0x44b2f6[_0xf814('0x28')]){delete _0x44b2f6['name'];}_0x20bb17[_0xf814('0x18')](_0x14ef8b)[_0xf814('0x29')](_0x44b2f6);};}exports[_0xf814('0x2a')]=function(_0xc439cf,_0x412122){var _0x497574={},_0x1ff2f0={},_0x471480={'count':0x0,'rows':[]};var _0x596f9c=_[_0xf814('0x2b')](db[_0xf814('0x2c')][_0xf814('0x2d')],function(_0x46c406){return{'name':_0x46c406[_0xf814('0x2e')],'type':_0x46c406['type'][_0xf814('0x2f')]};});_0x1ff2f0[_0xf814('0x30')]=_[_0xf814('0x2b')](_0x596f9c,'name');_0x1ff2f0[_0xf814('0x31')]=_[_0xf814('0x32')](_0xc439cf[_0xf814('0x31')]);_0x1ff2f0[_0xf814('0x33')]=_[_0xf814('0x34')](_0x1ff2f0['model'],_0x1ff2f0[_0xf814('0x31')]);_0x497574['attributes']=_[_0xf814('0x34')](_0x1ff2f0['model'],qs[_0xf814('0x35')](_0xc439cf[_0xf814('0x31')][_0xf814('0x35')]));_0x497574['attributes']=_0x497574[_0xf814('0x36')][_0xf814('0x37')]?_0x497574[_0xf814('0x36')]:_0x1ff2f0['model'];if(!_0xc439cf[_0xf814('0x31')][_0xf814('0x38')]('nolimit')){_0x497574[_0xf814('0x1b')]=qs[_0xf814('0x1b')](_0xc439cf['query']['limit']);_0x497574[_0xf814('0x1e')]=qs[_0xf814('0x1e')](_0xc439cf[_0xf814('0x31')]['offset']);}_0x497574[_0xf814('0x39')]=qs[_0xf814('0x3a')](_0xc439cf['query'][_0xf814('0x3a')]);_0x497574[_0xf814('0x3b')]=qs[_0xf814('0x33')](_['pick'](_0xc439cf[_0xf814('0x31')],_0x1ff2f0[_0xf814('0x33')]),_0x596f9c);if(_0xc439cf[_0xf814('0x31')][_0xf814('0x3c')]){_0x497574[_0xf814('0x3b')]=_[_0xf814('0x3d')](_0x497574[_0xf814('0x3b')],{'$or':_['map'](_0x596f9c,function(_0x253e5e){if(_0x253e5e['type']!==_0xf814('0x3e')){var _0x3d833f={};_0x3d833f[_0x253e5e[_0xf814('0x28')]]={'$like':'%'+_0xc439cf[_0xf814('0x31')][_0xf814('0x3c')]+'%'};return _0x3d833f;}})});}_0x497574=_[_0xf814('0x3d')]({},_0x497574,_0xc439cf['options']);var _0x40b124={'where':_0x497574[_0xf814('0x3b')]};return db[_0xf814('0x2c')][_0xf814('0x1d')](_0x40b124)[_0xf814('0x25')](function(_0x2f085f){_0x471480[_0xf814('0x1d')]=_0x2f085f;if(_0xc439cf[_0xf814('0x31')][_0xf814('0x3f')]){_0x497574['include']=[{'all':!![]}];}return db[_0xf814('0x2c')][_0xf814('0x40')](_0x497574);})[_0xf814('0x25')](function(_0xd36eaf){_0x471480[_0xf814('0x41')]=_0xd36eaf;return _0x471480;})[_0xf814('0x25')](respondWithFilteredResult(_0x412122,_0x497574))[_0xf814('0x42')](handleError(_0x412122,null));};exports[_0xf814('0x43')]=function(_0x1ebfe0,_0x2bbf6a){var _0x2e0089={'raw':!![],'where':{'id':_0x1ebfe0[_0xf814('0x44')]['id']}},_0x132eae={};_0x132eae['model']=_[_0xf814('0x32')](db[_0xf814('0x2c')][_0xf814('0x2d')]);_0x132eae[_0xf814('0x31')]=_[_0xf814('0x32')](_0x1ebfe0[_0xf814('0x31')]);_0x132eae[_0xf814('0x33')]=_[_0xf814('0x34')](_0x132eae[_0xf814('0x30')],_0x132eae[_0xf814('0x31')]);_0x2e0089[_0xf814('0x36')]=_[_0xf814('0x34')](_0x132eae[_0xf814('0x30')],qs[_0xf814('0x35')](_0x1ebfe0[_0xf814('0x31')]['fields']));_0x2e0089['attributes']=_0x2e0089['attributes']['length']?_0x2e0089[_0xf814('0x36')]:_0x132eae[_0xf814('0x30')];if(_0x1ebfe0[_0xf814('0x31')][_0xf814('0x3f')]){_0x2e0089['include']=[{'all':!![]}];}_0x2e0089=_[_0xf814('0x3d')]({},_0x2e0089,_0x1ebfe0[_0xf814('0x45')]);return db['SugarcrmField'][_0xf814('0x46')](_0x2e0089)[_0xf814('0x25')](handleEntityNotFound(_0x2bbf6a,null))[_0xf814('0x25')](respondWithResult(_0x2bbf6a,null))[_0xf814('0x42')](handleError(_0x2bbf6a,null));};exports[_0xf814('0x47')]=function(_0x5261aa,_0xf17a8c){return db[_0xf814('0x2c')][_0xf814('0x47')](_0x5261aa['body'],{})[_0xf814('0x25')](respondWithResult(_0xf17a8c,0xc9))[_0xf814('0x42')](handleError(_0xf17a8c,null));};exports[_0xf814('0x24')]=function(_0x3eb29e,_0x5779d7){if(_0x3eb29e['body']['id']){delete _0x3eb29e['body']['id'];}return db[_0xf814('0x2c')][_0xf814('0x46')]({'where':{'id':_0x3eb29e[_0xf814('0x44')]['id']}})[_0xf814('0x25')](handleEntityNotFound(_0x5779d7,null))[_0xf814('0x25')](saveUpdates(_0x3eb29e[_0xf814('0x48')],null))[_0xf814('0x25')](respondWithResult(_0x5779d7,null))[_0xf814('0x42')](handleError(_0x5779d7,null));};exports[_0xf814('0x49')]=function(_0x3e7f8c,_0x24262e){return db['SugarcrmField'][_0xf814('0x46')]({'where':{'id':_0x3e7f8c['params']['id']}})['then'](handleEntityNotFound(_0x24262e,null))[_0xf814('0x25')](removeEntity(_0x24262e,null))[_0xf814('0x42')](handleError(_0x24262e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index bcccc78..0cb7775 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 _0x51e2=['SugarcrmField','sugarcrm_unique_index','idField','lodash','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2b32ca,_0x35fb03){var _0x169a94=function(_0x4ef5a4){while(--_0x4ef5a4){_0x2b32ca['push'](_0x2b32ca['shift']());}};_0x169a94(++_0x35fb03);}(_0x51e2,0x19a));var _0x251e=function(_0x1b2938,_0x181306){_0x1b2938=_0x1b2938-0x0;var _0x5a112e=_0x51e2[_0x1b2938];return _0x5a112e;};'use strict';var _=require(_0x251e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x251e('0x1'));var BPromise=require(_0x251e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x251e('0x3'));var rimraf=require(_0x251e('0x4'));var config=require(_0x251e('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x251e('0x6')]=function(_0x3abaff,_0x4d5d24){return _0x3abaff[_0x251e('0x7')](_0x251e('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x251e('0x9'),'fields':[_0x251e('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa5d6=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa5d6,0x186));var _0x6a5d=function(_0x16c812,_0x7fc2af){_0x16c812=_0x16c812-0x0;var _0x4814fe=_0xa5d6[_0x16c812];return _0x4814fe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a5d('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6a5d('0x1'));var rp=require(_0x6a5d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a5d('0x3'));var config=require(_0x6a5d('0x4'));var attributes=require(_0x6a5d('0x5'));module[_0x6a5d('0x6')]=function(_0x15d4a1,_0x311588){return _0x15d4a1[_0x6a5d('0x7')](_0x6a5d('0x8'),attributes,{'tableName':_0x6a5d('0x9'),'paranoid':![],'indexes':[{'name':_0x6a5d('0xa'),'fields':['idField',_0x6a5d('0xb')],'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 2b19154..ad0dcc6 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 _0x9cf7=['info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x9cf7,0xdf));var _0x79cf=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x9cf7[_0x42245d];return _0x4b211a;};'use strict';var _=require('lodash');var util=require(_0x79cf('0x0'));var moment=require('moment');var BPromise=require(_0x79cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79cf('0x2'));var db=require(_0x79cf('0x3'))['db'];var utils=require(_0x79cf('0x4'));var logger=require(_0x79cf('0x5'))(_0x79cf('0x6'));var config=require('../../config/environment');var jayson=require(_0x79cf('0x7'));var client=jayson[_0x79cf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd18efd,_0x5ccf32,_0x277b97){return new BPromise(function(_0x5ebec8,_0xb5a017){return client['request'](_0xd18efd,_0x277b97)[_0x79cf('0x9')](function(_0x2fbaf2){logger['info'](_0x79cf('0xa'),_0x5ccf32,_0x79cf('0xb'));logger[_0x79cf('0xc')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x5ccf32,'request\x20sent',JSON[_0x79cf('0xd')](_0x2fbaf2));if(_0x2fbaf2[_0x79cf('0xe')]){if(_0x2fbaf2[_0x79cf('0xe')][_0x79cf('0xf')]===0x1f4){logger[_0x79cf('0xe')](_0x79cf('0xa'),_0x5ccf32,_0x2fbaf2['error'][_0x79cf('0x10')]);return _0xb5a017(_0x2fbaf2[_0x79cf('0xe')][_0x79cf('0x10')]);}logger[_0x79cf('0xe')](_0x79cf('0xa'),_0x5ccf32,_0x2fbaf2[_0x79cf('0xe')][_0x79cf('0x10')]);return _0x5ebec8(_0x2fbaf2[_0x79cf('0xe')][_0x79cf('0x10')]);}else{logger[_0x79cf('0x11')](_0x79cf('0xa'),_0x5ccf32,_0x79cf('0xb'));_0x5ebec8(_0x2fbaf2[_0x79cf('0x12')][_0x79cf('0x10')]);}})[_0x79cf('0x13')](function(_0x520e7f){logger[_0x79cf('0xe')](_0x79cf('0xa'),_0x5ccf32,_0x520e7f);_0xb5a017(_0x520e7f);});});} \ No newline at end of file +var _0x3d95=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','code','error','SugarcrmField,\x20%s,\x20%s','message','info','request\x20sent','result','catch','util','moment'];(function(_0x4390f3,_0x48017d){var _0x2e5694=function(_0x4fcfa4){while(--_0x4fcfa4){_0x4390f3['push'](_0x4390f3['shift']());}};_0x2e5694(++_0x48017d);}(_0x3d95,0x136));var _0x53d9=function(_0x5f2512,_0x2819cf){_0x5f2512=_0x5f2512-0x0;var _0x2f1662=_0x3d95[_0x5f2512];return _0x2f1662;};'use strict';var _=require('lodash');var util=require(_0x53d9('0x0'));var moment=require(_0x53d9('0x1'));var BPromise=require(_0x53d9('0x2'));var rs=require(_0x53d9('0x3'));var fs=require('fs');var Redis=require(_0x53d9('0x4'));var db=require(_0x53d9('0x5'))['db'];var utils=require(_0x53d9('0x6'));var logger=require(_0x53d9('0x7'))(_0x53d9('0x8'));var config=require(_0x53d9('0x9'));var jayson=require(_0x53d9('0xa'));var client=jayson[_0x53d9('0xb')][_0x53d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3180d7,_0x169cae,_0x208296){return new BPromise(function(_0x56e257,_0x2a7439){return client['request'](_0x3180d7,_0x208296)[_0x53d9('0xd')](function(_0x5ced5f){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x169cae,'request\x20sent');logger[_0x53d9('0xe')](_0x53d9('0xf'),_0x169cae,'request\x20sent',JSON['stringify'](_0x5ced5f));if(_0x5ced5f['error']){if(_0x5ced5f['error'][_0x53d9('0x10')]===0x1f4){logger[_0x53d9('0x11')](_0x53d9('0x12'),_0x169cae,_0x5ced5f[_0x53d9('0x11')]['message']);return _0x2a7439(_0x5ced5f[_0x53d9('0x11')][_0x53d9('0x13')]);}logger[_0x53d9('0x11')](_0x53d9('0x12'),_0x169cae,_0x5ced5f[_0x53d9('0x11')][_0x53d9('0x13')]);return _0x56e257(_0x5ced5f['error']['message']);}else{logger[_0x53d9('0x14')](_0x53d9('0x12'),_0x169cae,_0x53d9('0x15'));_0x56e257(_0x5ced5f[_0x53d9('0x16')][_0x53d9('0x13')]);}})[_0x53d9('0x17')](function(_0x44bbe3){logger[_0x53d9('0x11')](_0x53d9('0x12'),_0x169cae,_0x44bbe3);_0x2a7439(_0x44bbe3);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 69d4ef3..a9ec46a 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 _0x135c=['getConfigurations','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x58e867,_0x48f5e2){var _0x3b25ee=function(_0x49dba5){while(--_0x49dba5){_0x58e867['push'](_0x58e867['shift']());}};_0x3b25ee(++_0x48f5e2);}(_0x135c,0xda));var _0xc135=function(_0x11754e,_0x1fe2f4){_0x11754e=_0x11754e-0x0;var _0x45b1b2=_0x135c[_0x11754e];return _0x45b1b2;};'use strict';var multer=require(_0xc135('0x0'));var util=require(_0xc135('0x1'));var path=require('path');var timeout=require(_0xc135('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc135('0x3'));var auth=require(_0xc135('0x4'));var interaction=require(_0xc135('0x5'));var config=require('../../config/environment');var controller=require(_0xc135('0x6'));router[_0xc135('0x7')]('/',auth[_0xc135('0x8')](),controller[_0xc135('0x9')]);router[_0xc135('0x7')](_0xc135('0xa'),auth[_0xc135('0x8')](),controller[_0xc135('0xb')]);router[_0xc135('0x7')](_0xc135('0xc'),auth['isAuthenticated'](),controller[_0xc135('0xd')]);router[_0xc135('0x7')]('/:id/fields',auth[_0xc135('0x8')](),controller[_0xc135('0xe')]);router[_0xc135('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc135('0xc'),auth[_0xc135('0x8')](),controller[_0xc135('0x10')]);router['put'](_0xc135('0xa'),auth['isAuthenticated'](),controller[_0xc135('0x11')]);router[_0xc135('0x12')](_0xc135('0xa'),auth[_0xc135('0x8')](),controller[_0xc135('0x13')]);module[_0xc135('0x14')]=router; \ No newline at end of file +var _0x34ea=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','exports'];(function(_0x4be00e,_0x103947){var _0x3fd9ac=function(_0x13cc57){while(--_0x13cc57){_0x4be00e['push'](_0x4be00e['shift']());}};_0x3fd9ac(++_0x103947);}(_0x34ea,0xa8));var _0xa34e=function(_0x5edb7e,_0x338142){_0x5edb7e=_0x5edb7e-0x0;var _0x19fe94=_0x34ea[_0x5edb7e];return _0x19fe94;};'use strict';var multer=require(_0xa34e('0x0'));var util=require(_0xa34e('0x1'));var path=require(_0xa34e('0x2'));var timeout=require(_0xa34e('0x3'));var express=require(_0xa34e('0x4'));var router=express[_0xa34e('0x5')]();var fs_extra=require(_0xa34e('0x6'));var auth=require(_0xa34e('0x7'));var interaction=require(_0xa34e('0x8'));var config=require(_0xa34e('0x9'));var controller=require('./intVtigerAccount.controller');router[_0xa34e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa34e('0xa')](_0xa34e('0xb'),auth[_0xa34e('0xc')](),controller['show']);router[_0xa34e('0xa')](_0xa34e('0xd'),auth[_0xa34e('0xc')](),controller[_0xa34e('0xe')]);router[_0xa34e('0xa')]('/:id/fields',auth[_0xa34e('0xc')](),controller['getFields']);router['post']('/',auth[_0xa34e('0xc')](),controller['create']);router[_0xa34e('0xf')](_0xa34e('0xd'),auth[_0xa34e('0xc')](),controller[_0xa34e('0x10')]);router[_0xa34e('0x11')]('/:id',auth[_0xa34e('0xc')](),controller[_0xa34e('0x12')]);router[_0xa34e('0x13')](_0xa34e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa34e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e5473ad..31fd4f1 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 _0x7789=['STRING','HelpDesk','sequelize'];(function(_0x28cc9d,_0x18c1a8){var _0x2d746e=function(_0x3ee69b){while(--_0x3ee69b){_0x28cc9d['push'](_0x28cc9d['shift']());}};_0x2d746e(++_0x18c1a8);}(_0x7789,0xdd));var _0x9778=function(_0xe0b0b0,_0x42c647){_0xe0b0b0=_0xe0b0b0-0x0;var _0x2f0dc2=_0x7789[_0xe0b0b0];return _0x2f0dc2;};'use strict';var Sequelize=require(_0x9778('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9778('0x1')]},'username':{'type':Sequelize[_0x9778('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9778('0x1')],'allowNull':![],'defaultValue':_0x9778('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9778('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3dac=['sequelize','exports','STRING'];(function(_0xe04ebf,_0x5b44cd){var _0x36256f=function(_0x472c78){while(--_0x472c78){_0xe04ebf['push'](_0xe04ebf['shift']());}};_0x36256f(++_0x5b44cd);}(_0x3dac,0xa2));var _0xc3da=function(_0x19631e,_0x4ff76e){_0x19631e=_0x19631e-0x0;var _0xa9b9ec=_0x3dac[_0x19631e];return _0xa9b9ec;};'use strict';var Sequelize=require(_0xc3da('0x0'));module[_0xc3da('0x1')]={'name':{'type':Sequelize[_0xc3da('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc3da('0x2')]},'username':{'type':Sequelize[_0xc3da('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc3da('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xc3da('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xc3da('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xc3da('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 fb18366..e72002b 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 _0xd572=['sendStatus','status','end','undefined','count','offset','limit','reject','save','update','then','error','stack','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','VtigerField','md5','getFields','description','moduleName','remoteUri','serverUrl','username','substring','format','GET','getchallenge','POST','login','result','success','describe','sessionName','autogenerated','reference','includes','remove','editable','label','startsWith','cf_','picklist','picklistValues','value','log','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x9bd13b,_0x3b6743){var _0x41c5fb=function(_0x3bdcfa){while(--_0x3bdcfa){_0x9bd13b['push'](_0x9bd13b['shift']());}};_0x41c5fb(++_0x3b6743);}(_0xd572,0x14f));var _0x2d57=function(_0x1506f2,_0x22dd8a){_0x1506f2=_0x1506f2-0x0;var _0x59846d=_0xd572[_0x1506f2];return _0x59846d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d57('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d57('0x1'));var rp=require(_0x2d57('0x2'));var moment=require('moment');var BPromise=require(_0x2d57('0x3'));var Mustache=require(_0x2d57('0x4'));var util=require(_0x2d57('0x5'));var path=require('path');var sox=require(_0x2d57('0x6'));var csv=require(_0x2d57('0x7'));var ejs=require(_0x2d57('0x8'));var fs=require('fs');var fs_extra=require(_0x2d57('0x9'));var _=require(_0x2d57('0xa'));var squel=require(_0x2d57('0xb'));var crypto=require(_0x2d57('0xc'));var jsforce=require(_0x2d57('0xd'));var deskjs=require(_0x2d57('0xe'));var toCsv=require(_0x2d57('0x7'));var querystring=require(_0x2d57('0xf'));var Papa=require(_0x2d57('0x10'));var Redis=require(_0x2d57('0x11'));var authService=require(_0x2d57('0x12'));var qs=require(_0x2d57('0x13'));var as=require(_0x2d57('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d57('0x15'))(_0x2d57('0x16'));var utils=require(_0x2d57('0x17'));var config=require(_0x2d57('0x18'));var licenseUtil=require(_0x2d57('0x19'));var db=require(_0x2d57('0x1a'))['db'];var integrations=require(_0x2d57('0x1b'));function respondWithStatusCode(_0x5f525d,_0x52e237){_0x52e237=_0x52e237||0xcc;return function(_0x25e0e2){if(_0x25e0e2){return _0x5f525d[_0x2d57('0x1c')](_0x52e237);}return _0x5f525d[_0x2d57('0x1d')](_0x52e237)[_0x2d57('0x1e')]();};}function respondWithResult(_0x49f484,_0x170aaa){_0x170aaa=_0x170aaa||0xc8;return function(_0x5066ec){if(_0x5066ec){return _0x49f484[_0x2d57('0x1d')](_0x170aaa)['json'](_0x5066ec);}};}function respondWithFilteredResult(_0x50d4e4,_0x265935){return function(_0x205660){if(_0x205660){var _0x490798=typeof _0x265935['offset']==='undefined'&&typeof _0x265935['limit']===_0x2d57('0x1f');var _0x34cc7d=_0x205660[_0x2d57('0x20')];var _0x3e80d7=_0x490798?0x0:_0x265935[_0x2d57('0x21')];var _0x3a2a00=_0x490798?_0x205660[_0x2d57('0x20')]:_0x265935[_0x2d57('0x21')]+_0x265935[_0x2d57('0x22')];var _0x4b28b8;if(_0x3a2a00>=_0x34cc7d){_0x3a2a00=_0x34cc7d;_0x4b28b8=0xc8;}else{_0x4b28b8=0xce;}_0x50d4e4[_0x2d57('0x1d')](_0x4b28b8);return _0x50d4e4['set']('Content-Range',_0x3e80d7+'-'+_0x3a2a00+'/'+_0x34cc7d)['json'](_0x205660);}return null;};}function patchUpdates(_0x22b939){return function(_0x403afb){try{jsonpatch['apply'](_0x403afb,_0x22b939,!![]);}catch(_0x2d3550){return BPromise[_0x2d57('0x23')](_0x2d3550);}return _0x403afb[_0x2d57('0x24')]();};}function saveUpdates(_0x4aa703,_0x3d2a05){return function(_0x1d4139){if(_0x1d4139){return _0x1d4139[_0x2d57('0x25')](_0x4aa703)['then'](function(_0x5b34cf){return _0x5b34cf;});}return null;};}function removeEntity(_0x208606,_0x1ec122){return function(_0x440106){if(_0x440106){return _0x440106['destroy']()[_0x2d57('0x26')](function(){_0x208606['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f09b0,_0x173993){return function(_0x26f20d){if(!_0x26f20d){_0x2f09b0[_0x2d57('0x1c')](0x194);}return _0x26f20d;};}function handleError(_0x163513,_0x3ca7d6){_0x3ca7d6=_0x3ca7d6||0x1f4;return function(_0x307b8a){logger[_0x2d57('0x27')](_0x307b8a[_0x2d57('0x28')]);if(_0x307b8a['name']){delete _0x307b8a[_0x2d57('0x29')];}_0x163513['status'](_0x3ca7d6)[_0x2d57('0x2a')](_0x307b8a);};}exports[_0x2d57('0x2b')]=function(_0x31c0b2,_0x42e406){var _0x33b431={},_0x1c5425={},_0x192aad={'count':0x0,'rows':[]};var _0x3c78ea=_[_0x2d57('0x2c')](db[_0x2d57('0x2d')]['rawAttributes'],function(_0x46beb9){return{'name':_0x46beb9[_0x2d57('0x2e')],'type':_0x46beb9[_0x2d57('0x2f')][_0x2d57('0x30')]};});_0x1c5425[_0x2d57('0x31')]=_[_0x2d57('0x2c')](_0x3c78ea,_0x2d57('0x29'));_0x1c5425[_0x2d57('0x32')]=_[_0x2d57('0x33')](_0x31c0b2[_0x2d57('0x32')]);_0x1c5425[_0x2d57('0x34')]=_[_0x2d57('0x35')](_0x1c5425['model'],_0x1c5425[_0x2d57('0x32')]);_0x33b431['attributes']=_[_0x2d57('0x35')](_0x1c5425[_0x2d57('0x31')],qs['fields'](_0x31c0b2[_0x2d57('0x32')][_0x2d57('0x36')]));_0x33b431[_0x2d57('0x37')]=_0x33b431[_0x2d57('0x37')][_0x2d57('0x38')]?_0x33b431[_0x2d57('0x37')]:_0x1c5425['model'];if(!_0x31c0b2['query'][_0x2d57('0x39')](_0x2d57('0x3a'))){_0x33b431[_0x2d57('0x22')]=qs[_0x2d57('0x22')](_0x31c0b2[_0x2d57('0x32')]['limit']);_0x33b431[_0x2d57('0x21')]=qs[_0x2d57('0x21')](_0x31c0b2[_0x2d57('0x32')][_0x2d57('0x21')]);}_0x33b431[_0x2d57('0x3b')]=qs[_0x2d57('0x3c')](_0x31c0b2[_0x2d57('0x32')]['sort']);_0x33b431[_0x2d57('0x3d')]=qs['filters'](_[_0x2d57('0x3e')](_0x31c0b2[_0x2d57('0x32')],_0x1c5425[_0x2d57('0x34')]),_0x3c78ea);if(_0x31c0b2['query'][_0x2d57('0x3f')]){_0x33b431[_0x2d57('0x3d')]=_[_0x2d57('0x40')](_0x33b431['where'],{'$or':_['map'](_0x3c78ea,function(_0x5631d3){if(_0x5631d3[_0x2d57('0x2f')]!==_0x2d57('0x41')){var _0x1aade0={};_0x1aade0[_0x5631d3[_0x2d57('0x29')]]={'$like':'%'+_0x31c0b2['query'][_0x2d57('0x3f')]+'%'};return _0x1aade0;}})});}_0x33b431=_[_0x2d57('0x40')]({},_0x33b431,_0x31c0b2[_0x2d57('0x42')]);var _0x3ec60f={'where':_0x33b431[_0x2d57('0x3d')]};return db[_0x2d57('0x2d')][_0x2d57('0x20')](_0x3ec60f)[_0x2d57('0x26')](function(_0x809eb0){_0x192aad[_0x2d57('0x20')]=_0x809eb0;if(_0x31c0b2['query'][_0x2d57('0x43')]){_0x33b431[_0x2d57('0x44')]=[{'all':!![]}];}return db['VtigerAccount'][_0x2d57('0x45')](_0x33b431);})[_0x2d57('0x26')](function(_0x362ae4){_0x192aad[_0x2d57('0x46')]=_0x362ae4;return _0x192aad;})[_0x2d57('0x26')](respondWithFilteredResult(_0x42e406,_0x33b431))[_0x2d57('0x47')](handleError(_0x42e406,null));};exports[_0x2d57('0x48')]=function(_0x1f9b1d,_0x335bc3){var _0x11b197={'raw':![],'where':{'id':_0x1f9b1d[_0x2d57('0x49')]['id']}},_0x53554b={};_0x53554b[_0x2d57('0x31')]=_[_0x2d57('0x33')](db[_0x2d57('0x2d')][_0x2d57('0x4a')]);_0x53554b[_0x2d57('0x32')]=_[_0x2d57('0x33')](_0x1f9b1d[_0x2d57('0x32')]);_0x53554b[_0x2d57('0x34')]=_[_0x2d57('0x35')](_0x53554b[_0x2d57('0x31')],_0x53554b[_0x2d57('0x32')]);_0x11b197['attributes']=_[_0x2d57('0x35')](_0x53554b[_0x2d57('0x31')],qs[_0x2d57('0x36')](_0x1f9b1d[_0x2d57('0x32')][_0x2d57('0x36')]));_0x11b197[_0x2d57('0x37')]=_0x11b197[_0x2d57('0x37')][_0x2d57('0x38')]?_0x11b197[_0x2d57('0x37')]:_0x53554b[_0x2d57('0x31')];if(_0x1f9b1d['query'][_0x2d57('0x43')]){_0x11b197[_0x2d57('0x44')]=[{'all':!![]}];}_0x11b197=_[_0x2d57('0x40')]({},_0x11b197,_0x1f9b1d[_0x2d57('0x42')]);return db[_0x2d57('0x2d')][_0x2d57('0x4b')](_0x11b197)['then'](handleEntityNotFound(_0x335bc3,null))[_0x2d57('0x26')](respondWithResult(_0x335bc3,null))[_0x2d57('0x47')](handleError(_0x335bc3,null));};exports['create']=function(_0x536eda,_0x4e7e50){return db[_0x2d57('0x2d')]['create'](_0x536eda[_0x2d57('0x4c')],{})['then'](respondWithResult(_0x4e7e50,0xc9))[_0x2d57('0x47')](handleError(_0x4e7e50,null));};exports[_0x2d57('0x25')]=function(_0x56e854,_0x96e47e){if(_0x56e854['body']['id']){delete _0x56e854[_0x2d57('0x4c')]['id'];}return db[_0x2d57('0x2d')][_0x2d57('0x4b')]({'where':{'id':_0x56e854[_0x2d57('0x49')]['id']}})[_0x2d57('0x26')](handleEntityNotFound(_0x96e47e,null))[_0x2d57('0x26')](saveUpdates(_0x56e854['body'],null))[_0x2d57('0x26')](respondWithResult(_0x96e47e,null))[_0x2d57('0x47')](handleError(_0x96e47e,null));};exports['destroy']=function(_0x277cfb,_0x5a7c82){return db[_0x2d57('0x2d')]['find']({'where':{'id':_0x277cfb[_0x2d57('0x49')]['id']}})[_0x2d57('0x26')](handleEntityNotFound(_0x5a7c82,null))[_0x2d57('0x26')](removeEntity(_0x5a7c82,null))[_0x2d57('0x47')](handleError(_0x5a7c82,null));};exports[_0x2d57('0x4d')]=function(_0x13ca0c,_0x97fe1,_0x1dbbd8){var _0x131cb1={};var _0x3d1d9d={};var _0x455cf0;var _0x4416e6;return db['VtigerAccount'][_0x2d57('0x4e')]({'where':{'id':_0x13ca0c['params']['id']}})[_0x2d57('0x26')](handleEntityNotFound(_0x97fe1,null))['then'](function(_0xe6cf6a){if(_0xe6cf6a){_0x455cf0=_0xe6cf6a;_0x3d1d9d[_0x2d57('0x31')]=_[_0x2d57('0x33')](db[_0x2d57('0x4f')]['rawAttributes']);_0x3d1d9d[_0x2d57('0x32')]=_['keys'](_0x13ca0c['query']);_0x3d1d9d['filters']=_['intersection'](_0x3d1d9d[_0x2d57('0x31')],_0x3d1d9d[_0x2d57('0x32')]);_0x131cb1['attributes']=_[_0x2d57('0x35')](_0x3d1d9d[_0x2d57('0x31')],qs['fields'](_0x13ca0c[_0x2d57('0x32')][_0x2d57('0x36')]));_0x131cb1[_0x2d57('0x37')]=_0x131cb1[_0x2d57('0x37')][_0x2d57('0x38')]?_0x131cb1[_0x2d57('0x37')]:_0x3d1d9d[_0x2d57('0x31')];_0x131cb1['order']=qs['sort'](_0x13ca0c[_0x2d57('0x32')][_0x2d57('0x3c')]);_0x131cb1[_0x2d57('0x3d')]=qs[_0x2d57('0x34')](_[_0x2d57('0x3e')](_0x13ca0c[_0x2d57('0x32')],_0x3d1d9d[_0x2d57('0x34')]));if(_0x13ca0c[_0x2d57('0x32')]['filter']){_0x131cb1['where']=_[_0x2d57('0x40')](_0x131cb1[_0x2d57('0x3d')],{'$or':_[_0x2d57('0x2c')](_0x131cb1[_0x2d57('0x37')],function(_0x20110d){var _0x2b730e={};_0x2b730e[_0x20110d]={'$like':'%'+_0x13ca0c[_0x2d57('0x32')]['filter']+'%'};return _0x2b730e;})});}_0x131cb1=_[_0x2d57('0x40')]({},_0x131cb1,_0x13ca0c[_0x2d57('0x42')]);return _0x455cf0['getConfigurations'](_0x131cb1);}})['then'](function(_0x1953e9){if(_0x1953e9){_0x4416e6=_0x1953e9[_0x2d57('0x38')];if(!_0x13ca0c[_0x2d57('0x32')][_0x2d57('0x39')]('nolimit')){_0x131cb1[_0x2d57('0x22')]=qs[_0x2d57('0x22')](_0x13ca0c[_0x2d57('0x32')][_0x2d57('0x22')]);_0x131cb1[_0x2d57('0x21')]=qs[_0x2d57('0x21')](_0x13ca0c['query'][_0x2d57('0x21')]);}return _0x455cf0[_0x2d57('0x4d')](_0x131cb1);}})[_0x2d57('0x26')](function(_0x3f9e04){if(_0x3f9e04){return _0x3f9e04?{'count':_0x4416e6,'rows':_0x3f9e04}:null;}})[_0x2d57('0x26')](respondWithResult(_0x97fe1,null))[_0x2d57('0x47')](handleError(_0x97fe1,null));};exports[_0x2d57('0x50')]=function(_0x17700e,_0x1bb78a,_0x842c5b){if(_0x17700e[_0x2d57('0x4c')]['id']){delete _0x17700e['body']['id'];}return db[_0x2d57('0x2d')][_0x2d57('0x4e')]({'where':{'id':_0x17700e[_0x2d57('0x49')]['id']}})[_0x2d57('0x26')](handleEntityNotFound(_0x1bb78a,null))[_0x2d57('0x26')](function(_0x45b1bc){if(_0x45b1bc){_0x17700e['body']['AccountId']=_0x45b1bc['id'];_0x17700e[_0x2d57('0x4c')][_0x2d57('0x51')]=integrations[_0x2d57('0x52')](_0x17700e[_0x2d57('0x4c')]['channel'],_0x17700e[_0x2d57('0x4c')][_0x2d57('0x2f')]);_0x17700e[_0x2d57('0x4c')][_0x2d57('0x53')]=integrations[_0x2d57('0x54')](_0x17700e[_0x2d57('0x4c')][_0x2d57('0x55')],_0x17700e[_0x2d57('0x4c')][_0x2d57('0x2f')]);return db['VtigerConfiguration'][_0x2d57('0x56')](_0x17700e[_0x2d57('0x4c')],{'include':[{'model':db[_0x2d57('0x57')],'as':_0x2d57('0x51')},{'model':db[_0x2d57('0x57')],'as':_0x2d57('0x53')}]});}return null;})['then'](respondWithResult(_0x1bb78a,null))['catch'](handleError(_0x1bb78a,null));};var md5=require(_0x2d57('0x58'));exports[_0x2d57('0x59')]=function(_0x4b97c3,_0x25d090,_0x2e0a7f){var _0x36e910=null;var _0xf1775f=null;var _0x374acc=null;var _0x222877=null;var _0x3c540e='';return db[_0x2d57('0x2d')][_0x2d57('0x4e')]({'where':{'id':_0x4b97c3['params']['id']},'attributes':['id','name','username',_0x2d57('0x5a'),_0x2d57('0x5b'),_0x2d57('0x5c'),_0x2d57('0x5d'),'accessKey']})[_0x2d57('0x26')](handleEntityNotFound(_0x25d090,null))[_0x2d57('0x26')](function(_0x5d7bfb){if(_0x5d7bfb){_0x36e910=_0x5d7bfb[_0x2d57('0x5e')];_0xf1775f=_0x5d7bfb['accessKey'];_0x374acc=_0x5d7bfb[_0x2d57('0x5b')];_0x3c540e=_0x5d7bfb[_0x2d57('0x5c')];var _0x397ef6=_0x3c540e['slice'](-0x1);if(_0x397ef6==='/'){_0x3c540e=_0x3c540e[_0x2d57('0x5f')](0x0,_0x3c540e['lastIndexOf'](_0x397ef6));}_0x222877=util[_0x2d57('0x60')]('%s/webservice.php',_0x3c540e);var _0x2ca2af={'method':_0x2d57('0x61'),'uri':_0x222877,'qs':{'operation':_0x2d57('0x62'),'username':_0x5d7bfb[_0x2d57('0x5e')]},'json':!![]};return rp(_0x2ca2af);}})[_0x2d57('0x26')](function(_0x40d6fa){if(_0x40d6fa['success']){var _0x14e9e2={'method':_0x2d57('0x63'),'uri':_0x222877,'form':{'operation':_0x2d57('0x64'),'username':_0x36e910,'accessKey':md5(_0x40d6fa[_0x2d57('0x65')]['token']+_0xf1775f)},'json':!![]};return rp(_0x14e9e2);}})[_0x2d57('0x26')](function(_0x480be3){if(_0x480be3[_0x2d57('0x66')]){var _0x289b15={'method':'GET','uri':_0x222877,'qs':{'operation':_0x2d57('0x67'),'username':_0x36e910,'sessionName':_0x480be3[_0x2d57('0x65')][_0x2d57('0x68')],'elementType':_0x374acc},'json':!![]};return rp(_0x289b15);}})['then'](function(_0x2b5991){if(_0x2b5991[_0x2d57('0x66')]){var _0x118c45=[_0x2d57('0x69'),_0x2d57('0x6a'),'owner'];_['remove'](_0x2b5991[_0x2d57('0x65')][_0x2d57('0x36')],function(_0x3eb95c){return _0x118c45[_0x2d57('0x6b')](_0x3eb95c[_0x2d57('0x2f')][_0x2d57('0x29')]);});_[_0x2d57('0x6c')](_0x2b5991[_0x2d57('0x65')]['fields'],function(_0x290cbf){return _0x290cbf[_0x2d57('0x6d')]==='false';});return{'count':_0x2b5991[_0x2d57('0x65')][_0x2d57('0x36')][_0x2d57('0x38')],'rows':_[_0x2d57('0x2c')](_0x2b5991[_0x2d57('0x65')][_0x2d57('0x36')],function(_0x4c6e87){return{'id':_0x4c6e87[_0x2d57('0x29')],'name':_0x4c6e87[_0x2d57('0x6e')],'custom':_[_0x2d57('0x6f')](_0x4c6e87['name'],_0x2d57('0x70'))?!![]:![],'options':_0x4c6e87['type']['name']===_0x2d57('0x71')&&_0x4c6e87[_0x2d57('0x2f')]['picklistValues']['length']>0x0?_[_0x2d57('0x2c')](_0x4c6e87[_0x2d57('0x2f')][_0x2d57('0x72')],function(_0x55f5a2){return{'name':_0x55f5a2[_0x2d57('0x6e')],'value':_0x55f5a2[_0x2d57('0x73')]};}):[]};})};}})[_0x2d57('0x26')](respondWithResult(_0x25d090,null))[_0x2d57('0x47')](function(_0x4d0eef){console[_0x2d57('0x74')]('vTiger\x20error:\x20'+_0x4d0eef);var _0x1a3c58=_0x4b97c3[_0x2d57('0x32')][_0x2d57('0x75')]?0x1f4:_0x4d0eef['statusCode']||0x1f4;logger['error'](_0x2d57('0x76'),_0x2d57('0x59'),_0x1a3c58,JSON['stringify'](_0x4d0eef));delete _0x4d0eef[_0x2d57('0x29')];if(_0x1a3c58===0x191){_0x1a3c58=0x190;}_0x25d090[_0x2d57('0x1d')](_0x1a3c58)[_0x2d57('0x2a')](_0x4b97c3[_0x2d57('0x32')]['test']?{'message':_0x2d57('0x77'),'statusCode':_0x4d0eef[_0x2d57('0x78')]}:_0x4d0eef);});}; \ No newline at end of file +var _0x2c98=['sox','to-csv','ejs','lodash','squel','crypto','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','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','moduleName','remoteUri','serverUrl','accessKey','lastIndexOf','%s/webservice.php','GET','POST','login','result','success','sessionName','autogenerated','owner','includes','remove','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x42ab56,_0x358dc3){var _0x256d09=function(_0x4fe951){while(--_0x4fe951){_0x42ab56['push'](_0x42ab56['shift']());}};_0x256d09(++_0x358dc3);}(_0x2c98,0x1d1));var _0x82c9=function(_0x3949ac,_0x1b0e2e){_0x3949ac=_0x3949ac-0x0;var _0x3a8ea4=_0x2c98[_0x3949ac];return _0x3a8ea4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82c9('0x0'));var zipdir=require(_0x82c9('0x1'));var jsonpatch=require(_0x82c9('0x2'));var rp=require(_0x82c9('0x3'));var moment=require(_0x82c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82c9('0x5'));var util=require(_0x82c9('0x6'));var path=require('path');var sox=require(_0x82c9('0x7'));var csv=require(_0x82c9('0x8'));var ejs=require(_0x82c9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82c9('0xa'));var squel=require(_0x82c9('0xb'));var crypto=require(_0x82c9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x82c9('0x8'));var querystring=require(_0x82c9('0xd'));var Papa=require(_0x82c9('0xe'));var Redis=require('ioredis');var authService=require(_0x82c9('0xf'));var qs=require(_0x82c9('0x10'));var as=require(_0x82c9('0x11'));var hardwareService=require(_0x82c9('0x12'));var logger=require(_0x82c9('0x13'))(_0x82c9('0x14'));var utils=require(_0x82c9('0x15'));var config=require(_0x82c9('0x16'));var licenseUtil=require(_0x82c9('0x17'));var db=require(_0x82c9('0x18'))['db'];var integrations=require(_0x82c9('0x19'));function respondWithStatusCode(_0x291c30,_0x30e04f){_0x30e04f=_0x30e04f||0xcc;return function(_0xbaf44){if(_0xbaf44){return _0x291c30[_0x82c9('0x1a')](_0x30e04f);}return _0x291c30[_0x82c9('0x1b')](_0x30e04f)[_0x82c9('0x1c')]();};}function respondWithResult(_0x5c096f,_0x1f16f5){_0x1f16f5=_0x1f16f5||0xc8;return function(_0x1c641a){if(_0x1c641a){return _0x5c096f[_0x82c9('0x1b')](_0x1f16f5)['json'](_0x1c641a);}};}function respondWithFilteredResult(_0x52bb51,_0x31b4a2){return function(_0x4c25fc){if(_0x4c25fc){var _0x3e15a7=typeof _0x31b4a2['offset']===_0x82c9('0x1d')&&typeof _0x31b4a2[_0x82c9('0x1e')]===_0x82c9('0x1d');var _0x445be0=_0x4c25fc[_0x82c9('0x1f')];var _0x347b94=_0x3e15a7?0x0:_0x31b4a2[_0x82c9('0x20')];var _0x4d23e8=_0x3e15a7?_0x4c25fc[_0x82c9('0x1f')]:_0x31b4a2['offset']+_0x31b4a2[_0x82c9('0x1e')];var _0x37590c;if(_0x4d23e8>=_0x445be0){_0x4d23e8=_0x445be0;_0x37590c=0xc8;}else{_0x37590c=0xce;}_0x52bb51['status'](_0x37590c);return _0x52bb51[_0x82c9('0x21')](_0x82c9('0x22'),_0x347b94+'-'+_0x4d23e8+'/'+_0x445be0)[_0x82c9('0x23')](_0x4c25fc);}return null;};}function patchUpdates(_0x7c3f){return function(_0x8d05f4){try{jsonpatch[_0x82c9('0x24')](_0x8d05f4,_0x7c3f,!![]);}catch(_0x54a910){return BPromise[_0x82c9('0x25')](_0x54a910);}return _0x8d05f4[_0x82c9('0x26')]();};}function saveUpdates(_0x37f085,_0x4436a1){return function(_0x190422){if(_0x190422){return _0x190422['update'](_0x37f085)[_0x82c9('0x27')](function(_0x1539d9){return _0x1539d9;});}return null;};}function removeEntity(_0x315f47,_0x1993bd){return function(_0x40b9d0){if(_0x40b9d0){return _0x40b9d0[_0x82c9('0x28')]()[_0x82c9('0x27')](function(){_0x315f47[_0x82c9('0x1b')](0xcc)[_0x82c9('0x1c')]();});}};}function handleEntityNotFound(_0x38b537,_0x48a13b){return function(_0x77593a){if(!_0x77593a){_0x38b537[_0x82c9('0x1a')](0x194);}return _0x77593a;};}function handleError(_0x1e481c,_0x1e3246){_0x1e3246=_0x1e3246||0x1f4;return function(_0x7b414f){logger[_0x82c9('0x29')](_0x7b414f[_0x82c9('0x2a')]);if(_0x7b414f[_0x82c9('0x2b')]){delete _0x7b414f[_0x82c9('0x2b')];}_0x1e481c[_0x82c9('0x1b')](_0x1e3246)[_0x82c9('0x2c')](_0x7b414f);};}exports[_0x82c9('0x2d')]=function(_0x3b4e49,_0x5a8ac1){var _0x176ce9={},_0x1eda9b={},_0x40cbb6={'count':0x0,'rows':[]};var _0x3c2181=_['map'](db[_0x82c9('0x2e')][_0x82c9('0x2f')],function(_0xdb0d01){return{'name':_0xdb0d01[_0x82c9('0x30')],'type':_0xdb0d01[_0x82c9('0x31')][_0x82c9('0x32')]};});_0x1eda9b['model']=_[_0x82c9('0x33')](_0x3c2181,_0x82c9('0x2b'));_0x1eda9b[_0x82c9('0x34')]=_[_0x82c9('0x35')](_0x3b4e49[_0x82c9('0x34')]);_0x1eda9b[_0x82c9('0x36')]=_[_0x82c9('0x37')](_0x1eda9b[_0x82c9('0x38')],_0x1eda9b[_0x82c9('0x34')]);_0x176ce9[_0x82c9('0x39')]=_['intersection'](_0x1eda9b['model'],qs[_0x82c9('0x3a')](_0x3b4e49[_0x82c9('0x34')][_0x82c9('0x3a')]));_0x176ce9[_0x82c9('0x39')]=_0x176ce9[_0x82c9('0x39')][_0x82c9('0x3b')]?_0x176ce9[_0x82c9('0x39')]:_0x1eda9b[_0x82c9('0x38')];if(!_0x3b4e49[_0x82c9('0x34')][_0x82c9('0x3c')](_0x82c9('0x3d'))){_0x176ce9['limit']=qs[_0x82c9('0x1e')](_0x3b4e49['query']['limit']);_0x176ce9[_0x82c9('0x20')]=qs[_0x82c9('0x20')](_0x3b4e49['query']['offset']);}_0x176ce9[_0x82c9('0x3e')]=qs[_0x82c9('0x3f')](_0x3b4e49[_0x82c9('0x34')]['sort']);_0x176ce9['where']=qs[_0x82c9('0x36')](_[_0x82c9('0x40')](_0x3b4e49[_0x82c9('0x34')],_0x1eda9b['filters']),_0x3c2181);if(_0x3b4e49[_0x82c9('0x34')]['filter']){_0x176ce9[_0x82c9('0x41')]=_[_0x82c9('0x42')](_0x176ce9[_0x82c9('0x41')],{'$or':_[_0x82c9('0x33')](_0x3c2181,function(_0x23f803){if(_0x23f803['type']!==_0x82c9('0x43')){var _0x48ceaa={};_0x48ceaa[_0x23f803[_0x82c9('0x2b')]]={'$like':'%'+_0x3b4e49[_0x82c9('0x34')][_0x82c9('0x44')]+'%'};return _0x48ceaa;}})});}_0x176ce9=_[_0x82c9('0x42')]({},_0x176ce9,_0x3b4e49[_0x82c9('0x45')]);var _0x4ea666={'where':_0x176ce9[_0x82c9('0x41')]};return db[_0x82c9('0x2e')][_0x82c9('0x1f')](_0x4ea666)['then'](function(_0x3e3312){_0x40cbb6['count']=_0x3e3312;if(_0x3b4e49[_0x82c9('0x34')][_0x82c9('0x46')]){_0x176ce9[_0x82c9('0x47')]=[{'all':!![]}];}return db[_0x82c9('0x2e')][_0x82c9('0x48')](_0x176ce9);})[_0x82c9('0x27')](function(_0x38ca68){_0x40cbb6['rows']=_0x38ca68;return _0x40cbb6;})[_0x82c9('0x27')](respondWithFilteredResult(_0x5a8ac1,_0x176ce9))[_0x82c9('0x49')](handleError(_0x5a8ac1,null));};exports[_0x82c9('0x4a')]=function(_0x8b6995,_0x18dede){var _0xb3bf08={'raw':![],'where':{'id':_0x8b6995[_0x82c9('0x4b')]['id']}},_0xb10833={};_0xb10833['model']=_[_0x82c9('0x35')](db[_0x82c9('0x2e')]['rawAttributes']);_0xb10833[_0x82c9('0x34')]=_[_0x82c9('0x35')](_0x8b6995[_0x82c9('0x34')]);_0xb10833['filters']=_[_0x82c9('0x37')](_0xb10833[_0x82c9('0x38')],_0xb10833['query']);_0xb3bf08[_0x82c9('0x39')]=_[_0x82c9('0x37')](_0xb10833['model'],qs[_0x82c9('0x3a')](_0x8b6995[_0x82c9('0x34')][_0x82c9('0x3a')]));_0xb3bf08[_0x82c9('0x39')]=_0xb3bf08[_0x82c9('0x39')][_0x82c9('0x3b')]?_0xb3bf08[_0x82c9('0x39')]:_0xb10833[_0x82c9('0x38')];if(_0x8b6995['query'][_0x82c9('0x46')]){_0xb3bf08[_0x82c9('0x47')]=[{'all':!![]}];}_0xb3bf08=_[_0x82c9('0x42')]({},_0xb3bf08,_0x8b6995['options']);return db[_0x82c9('0x2e')][_0x82c9('0x4c')](_0xb3bf08)['then'](handleEntityNotFound(_0x18dede,null))[_0x82c9('0x27')](respondWithResult(_0x18dede,null))[_0x82c9('0x49')](handleError(_0x18dede,null));};exports[_0x82c9('0x4d')]=function(_0x445194,_0x1120af){return db[_0x82c9('0x2e')][_0x82c9('0x4d')](_0x445194[_0x82c9('0x4e')],{})[_0x82c9('0x27')](respondWithResult(_0x1120af,0xc9))['catch'](handleError(_0x1120af,null));};exports[_0x82c9('0x4f')]=function(_0x131159,_0x6dba37){if(_0x131159[_0x82c9('0x4e')]['id']){delete _0x131159[_0x82c9('0x4e')]['id'];}return db[_0x82c9('0x2e')][_0x82c9('0x4c')]({'where':{'id':_0x131159[_0x82c9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6dba37,null))[_0x82c9('0x27')](saveUpdates(_0x131159['body'],null))[_0x82c9('0x27')](respondWithResult(_0x6dba37,null))[_0x82c9('0x49')](handleError(_0x6dba37,null));};exports[_0x82c9('0x28')]=function(_0x313ec7,_0x2271cf){return db[_0x82c9('0x2e')][_0x82c9('0x4c')]({'where':{'id':_0x313ec7[_0x82c9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2271cf,null))[_0x82c9('0x27')](removeEntity(_0x2271cf,null))['catch'](handleError(_0x2271cf,null));};exports[_0x82c9('0x50')]=function(_0x3d450c,_0x18d188,_0x446155){var _0x5b1375={};var _0x443b87={};var _0x1b36d4;var _0x33667e;return db[_0x82c9('0x2e')][_0x82c9('0x51')]({'where':{'id':_0x3d450c[_0x82c9('0x4b')]['id']}})[_0x82c9('0x27')](handleEntityNotFound(_0x18d188,null))[_0x82c9('0x27')](function(_0xbf112c){if(_0xbf112c){_0x1b36d4=_0xbf112c;_0x443b87[_0x82c9('0x38')]=_['keys'](db[_0x82c9('0x52')][_0x82c9('0x2f')]);_0x443b87[_0x82c9('0x34')]=_[_0x82c9('0x35')](_0x3d450c[_0x82c9('0x34')]);_0x443b87[_0x82c9('0x36')]=_[_0x82c9('0x37')](_0x443b87['model'],_0x443b87[_0x82c9('0x34')]);_0x5b1375[_0x82c9('0x39')]=_[_0x82c9('0x37')](_0x443b87[_0x82c9('0x38')],qs['fields'](_0x3d450c[_0x82c9('0x34')][_0x82c9('0x3a')]));_0x5b1375[_0x82c9('0x39')]=_0x5b1375['attributes'][_0x82c9('0x3b')]?_0x5b1375[_0x82c9('0x39')]:_0x443b87[_0x82c9('0x38')];_0x5b1375[_0x82c9('0x3e')]=qs[_0x82c9('0x3f')](_0x3d450c['query']['sort']);_0x5b1375[_0x82c9('0x41')]=qs[_0x82c9('0x36')](_[_0x82c9('0x40')](_0x3d450c[_0x82c9('0x34')],_0x443b87[_0x82c9('0x36')]));if(_0x3d450c[_0x82c9('0x34')]['filter']){_0x5b1375['where']=_['merge'](_0x5b1375[_0x82c9('0x41')],{'$or':_[_0x82c9('0x33')](_0x5b1375[_0x82c9('0x39')],function(_0x307183){var _0x5be06e={};_0x5be06e[_0x307183]={'$like':'%'+_0x3d450c[_0x82c9('0x34')][_0x82c9('0x44')]+'%'};return _0x5be06e;})});}_0x5b1375=_['merge']({},_0x5b1375,_0x3d450c[_0x82c9('0x45')]);return _0x1b36d4[_0x82c9('0x50')](_0x5b1375);}})[_0x82c9('0x27')](function(_0x26df11){if(_0x26df11){_0x33667e=_0x26df11[_0x82c9('0x3b')];if(!_0x3d450c['query'][_0x82c9('0x3c')](_0x82c9('0x3d'))){_0x5b1375[_0x82c9('0x1e')]=qs[_0x82c9('0x1e')](_0x3d450c[_0x82c9('0x34')][_0x82c9('0x1e')]);_0x5b1375[_0x82c9('0x20')]=qs[_0x82c9('0x20')](_0x3d450c[_0x82c9('0x34')][_0x82c9('0x20')]);}return _0x1b36d4[_0x82c9('0x50')](_0x5b1375);}})[_0x82c9('0x27')](function(_0x102d4f){if(_0x102d4f){return _0x102d4f?{'count':_0x33667e,'rows':_0x102d4f}:null;}})[_0x82c9('0x27')](respondWithResult(_0x18d188,null))[_0x82c9('0x49')](handleError(_0x18d188,null));};exports['addConfiguration']=function(_0x3c1ccd,_0x106ec9,_0x4237e1){if(_0x3c1ccd[_0x82c9('0x4e')]['id']){delete _0x3c1ccd[_0x82c9('0x4e')]['id'];}return db[_0x82c9('0x2e')][_0x82c9('0x51')]({'where':{'id':_0x3c1ccd[_0x82c9('0x4b')]['id']}})[_0x82c9('0x27')](handleEntityNotFound(_0x106ec9,null))[_0x82c9('0x27')](function(_0x5a3a32){if(_0x5a3a32){_0x3c1ccd[_0x82c9('0x4e')]['AccountId']=_0x5a3a32['id'];_0x3c1ccd[_0x82c9('0x4e')][_0x82c9('0x53')]=integrations[_0x82c9('0x54')](_0x3c1ccd[_0x82c9('0x4e')][_0x82c9('0x55')],_0x3c1ccd[_0x82c9('0x4e')][_0x82c9('0x31')]);_0x3c1ccd['body'][_0x82c9('0x56')]=integrations[_0x82c9('0x57')](_0x3c1ccd[_0x82c9('0x4e')][_0x82c9('0x55')],_0x3c1ccd[_0x82c9('0x4e')][_0x82c9('0x31')]);return db['VtigerConfiguration'][_0x82c9('0x4d')](_0x3c1ccd[_0x82c9('0x4e')],{'include':[{'model':db[_0x82c9('0x58')],'as':_0x82c9('0x53')},{'model':db[_0x82c9('0x58')],'as':_0x82c9('0x56')}]});}return null;})[_0x82c9('0x27')](respondWithResult(_0x106ec9,null))[_0x82c9('0x49')](handleError(_0x106ec9,null));};var md5=require('md5');exports['getFields']=function(_0x378bdb,_0xacd92a,_0x244d7f){var _0x5b0ae7=null;var _0x2b6a76=null;var _0x16b22c=null;var _0x4fe196=null;var _0x4364f4='';return db['VtigerAccount'][_0x82c9('0x51')]({'where':{'id':_0x378bdb[_0x82c9('0x4b')]['id']},'attributes':['id',_0x82c9('0x2b'),_0x82c9('0x59'),'description',_0x82c9('0x5a'),_0x82c9('0x5b'),_0x82c9('0x5c'),'accessKey']})[_0x82c9('0x27')](handleEntityNotFound(_0xacd92a,null))['then'](function(_0x3540eb){if(_0x3540eb){_0x5b0ae7=_0x3540eb['username'];_0x2b6a76=_0x3540eb[_0x82c9('0x5d')];_0x16b22c=_0x3540eb[_0x82c9('0x5a')];_0x4364f4=_0x3540eb[_0x82c9('0x5b')];var _0x5ee0e5=_0x4364f4['slice'](-0x1);if(_0x5ee0e5==='/'){_0x4364f4=_0x4364f4['substring'](0x0,_0x4364f4[_0x82c9('0x5e')](_0x5ee0e5));}_0x4fe196=util['format'](_0x82c9('0x5f'),_0x4364f4);var _0x36882f={'method':_0x82c9('0x60'),'uri':_0x4fe196,'qs':{'operation':'getchallenge','username':_0x3540eb[_0x82c9('0x59')]},'json':!![]};return rp(_0x36882f);}})[_0x82c9('0x27')](function(_0x18d5f8){if(_0x18d5f8['success']){var _0xe6d4f0={'method':_0x82c9('0x61'),'uri':_0x4fe196,'form':{'operation':_0x82c9('0x62'),'username':_0x5b0ae7,'accessKey':md5(_0x18d5f8[_0x82c9('0x63')]['token']+_0x2b6a76)},'json':!![]};return rp(_0xe6d4f0);}})[_0x82c9('0x27')](function(_0x254492){if(_0x254492[_0x82c9('0x64')]){var _0x3a5fe5={'method':_0x82c9('0x60'),'uri':_0x4fe196,'qs':{'operation':'describe','username':_0x5b0ae7,'sessionName':_0x254492['result'][_0x82c9('0x65')],'elementType':_0x16b22c},'json':!![]};return rp(_0x3a5fe5);}})[_0x82c9('0x27')](function(_0xa3981a){if(_0xa3981a[_0x82c9('0x64')]){var _0x10b9a0=[_0x82c9('0x66'),'reference',_0x82c9('0x67')];_['remove'](_0xa3981a['result'][_0x82c9('0x3a')],function(_0x8b2745){return _0x10b9a0[_0x82c9('0x68')](_0x8b2745[_0x82c9('0x31')][_0x82c9('0x2b')]);});_[_0x82c9('0x69')](_0xa3981a[_0x82c9('0x63')][_0x82c9('0x3a')],function(_0x47664a){return _0x47664a['editable']===_0x82c9('0x6a');});return{'count':_0xa3981a[_0x82c9('0x63')][_0x82c9('0x3a')][_0x82c9('0x3b')],'rows':_['map'](_0xa3981a[_0x82c9('0x63')]['fields'],function(_0x5aa88b){return{'id':_0x5aa88b[_0x82c9('0x2b')],'name':_0x5aa88b[_0x82c9('0x6b')],'custom':_['startsWith'](_0x5aa88b[_0x82c9('0x2b')],_0x82c9('0x6c'))?!![]:![],'options':_0x5aa88b[_0x82c9('0x31')][_0x82c9('0x2b')]===_0x82c9('0x6d')&&_0x5aa88b[_0x82c9('0x31')][_0x82c9('0x6e')][_0x82c9('0x3b')]>0x0?_['map'](_0x5aa88b[_0x82c9('0x31')]['picklistValues'],function(_0x131a77){return{'name':_0x131a77[_0x82c9('0x6b')],'value':_0x131a77[_0x82c9('0x6f')]};}):[]};})};}})['then'](respondWithResult(_0xacd92a,null))[_0x82c9('0x49')](function(_0x12a864){console[_0x82c9('0x70')](_0x82c9('0x71')+_0x12a864);var _0x195168=_0x378bdb[_0x82c9('0x34')][_0x82c9('0x72')]?0x1f4:_0x12a864['statusCode']||0x1f4;logger[_0x82c9('0x29')](_0x82c9('0x73'),'getFields',_0x195168,JSON['stringify'](_0x12a864));delete _0x12a864[_0x82c9('0x2b')];if(_0x195168===0x191){_0x195168=0x190;}_0xacd92a[_0x82c9('0x1b')](_0x195168)[_0x82c9('0x2c')](_0x378bdb['query']['test']?{'message':_0x82c9('0x74'),'statusCode':_0x12a864[_0x82c9('0x75')]}:_0x12a864);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0d23816..3018e2d 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 _0x11d6=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount'];(function(_0x21816c,_0x880c58){var _0x38c5dd=function(_0x4deee5){while(--_0x4deee5){_0x21816c['push'](_0x21816c['shift']());}};_0x38c5dd(++_0x880c58);}(_0x11d6,0xcc));var _0x611d=function(_0x8b60b8,_0x2b61dd){_0x8b60b8=_0x8b60b8-0x0;var _0x9db4bf=_0x11d6[_0x8b60b8];return _0x9db4bf;};'use strict';var _=require(_0x611d('0x0'));var util=require(_0x611d('0x1'));var logger=require(_0x611d('0x2'))('api');var moment=require(_0x611d('0x3'));var BPromise=require(_0x611d('0x4'));var rp=require(_0x611d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x611d('0x6'));var config=require(_0x611d('0x7'));var attributes=require(_0x611d('0x8'));var integrations=require(_0x611d('0x9'));module[_0x611d('0xa')]=function(_0x2345a4,_0x261e1a){return _0x2345a4['define'](_0x611d('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8dd=['int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define'];(function(_0x35d147,_0x86fd){var _0x57a2ec=function(_0x1d0fed){while(--_0x1d0fed){_0x35d147['push'](_0x35d147['shift']());}};_0x57a2ec(++_0x86fd);}(_0xc8dd,0x127));var _0xdc8d=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0xc8dd[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0xdc8d('0x0'));var util=require(_0xdc8d('0x1'));var logger=require(_0xdc8d('0x2'))(_0xdc8d('0x3'));var moment=require(_0xdc8d('0x4'));var BPromise=require(_0xdc8d('0x5'));var rp=require(_0xdc8d('0x6'));var fs=require('fs');var path=require(_0xdc8d('0x7'));var rimraf=require(_0xdc8d('0x8'));var config=require(_0xdc8d('0x9'));var attributes=require(_0xdc8d('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xdc8d('0xb')]=function(_0x3eef22,_0x1c5b65){return _0x3eef22[_0xdc8d('0xc')]('VtigerAccount',attributes,{'tableName':_0xdc8d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 76c1847..7dc6efc 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 _0x6324=['message','info','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s'];(function(_0x2f0e20,_0x4e75f2){var _0x2ebd44=function(_0x1e7296){while(--_0x1e7296){_0x2f0e20['push'](_0x2f0e20['shift']());}};_0x2ebd44(++_0x4e75f2);}(_0x6324,0x142));var _0x4632=function(_0x4ae506,_0x5a97ed){_0x4ae506=_0x4ae506-0x0;var _0x18e3a1=_0x6324[_0x4ae506];return _0x18e3a1;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});}exports[_0x4632('0x16')]=function(_0x1a94c0){var _0x5b28b7=this;return new Promise(function(_0x3cddfa,_0x1894bb){return db['VtigerAccount']['findAll']({'raw':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x18')]===undefined?!![]:![]:!![],'where':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x19')]||null:null,'attributes':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x1a')]||null:null,'limit':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x1b')]||null:null,'include':_0x1a94c0[_0x4632('0x17')]?_0x1a94c0[_0x4632('0x17')][_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x1a94c0[_0x4632('0x17')][_0x4632('0x1c')],function(_0x380a9f){return{'model':db[_0x380a9f[_0x4632('0x1e')]],'as':_0x380a9f['as'],'attributes':_0x380a9f[_0x4632('0x1a')],'include':_0x380a9f[_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x380a9f[_0x4632('0x1c')],function(_0xb074d){return{'model':db[_0xb074d[_0x4632('0x1e')]],'as':_0xb074d['as'],'attributes':_0xb074d[_0x4632('0x1a')],'include':_0xb074d[_0x4632('0x1c')]?_[_0x4632('0x1d')](_0xb074d[_0x4632('0x1c')],function(_0x22d0f5){return{'model':db[_0x22d0f5[_0x4632('0x1e')]],'as':_0x22d0f5['as'],'attributes':_0x22d0f5[_0x4632('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57798a){logger[_0x4632('0x13')](_0x4632('0x16'),_0x1a94c0);logger[_0x4632('0xc')](_0x4632('0x16'),_0x1a94c0,JSON[_0x4632('0xe')](_0x57798a));_0x3cddfa(_0x57798a);})[_0x4632('0x15')](function(_0x3570b2){logger['error'](_0x4632('0x16'),_0x3570b2[_0x4632('0x12')],_0x1a94c0);_0x1894bb(_0x5b28b7['error'](0x1f4,_0x3570b2[_0x4632('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x6599ad){var _0x4cb661=this;return new Promise(function(_0x4fda35,_0x1973eb){return db[_0x4632('0x1f')][_0x4632('0x20')]({'raw':_0x6599ad['options']?_0x6599ad['options'][_0x4632('0x18')]===undefined?!![]:![]:!![],'where':_0x6599ad[_0x4632('0x17')]?_0x6599ad['options']['where']||null:null,'attributes':_0x6599ad[_0x4632('0x17')]?_0x6599ad[_0x4632('0x17')]['attributes']||null:null,'include':_0x6599ad[_0x4632('0x17')]?_0x6599ad[_0x4632('0x17')][_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x6599ad[_0x4632('0x17')]['include'],function(_0x5f0382){return{'model':db[_0x5f0382[_0x4632('0x1e')]],'as':_0x5f0382['as'],'attributes':_0x5f0382['attributes'],'include':_0x5f0382['include']?_[_0x4632('0x1d')](_0x5f0382['include'],function(_0x49355c){return{'model':db[_0x49355c[_0x4632('0x1e')]],'as':_0x49355c['as'],'attributes':_0x49355c['attributes'],'include':_0x49355c[_0x4632('0x1c')]?_[_0x4632('0x1d')](_0x49355c[_0x4632('0x1c')],function(_0x52dd7f){return{'model':db[_0x52dd7f[_0x4632('0x1e')]],'as':_0x52dd7f['as'],'attributes':_0x52dd7f[_0x4632('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4632('0xa')](function(_0xca07f5){logger[_0x4632('0x13')]('ShowVtigerAccount',_0x6599ad);logger['debug'](_0x4632('0x21'),_0x6599ad,JSON[_0x4632('0xe')](_0xca07f5));_0x4fda35(_0xca07f5);})[_0x4632('0x15')](function(_0x4f40af){logger['error']('ShowVtigerAccount',_0x4f40af[_0x4632('0x12')],_0x6599ad);_0x1973eb(_0x4cb661[_0x4632('0xf')](0x1f4,_0x4f40af['message']));});});}; \ No newline at end of file +var _0x0fd9=['../../config/environment','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x0fd9,0xa3));var _0x90fd=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0x0fd9[_0x40ebff];return _0x40122a;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var moment=require(_0x90fd('0x1'));var BPromise=require(_0x90fd('0x2'));var rs=require(_0x90fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90fd('0x4'));var logger=require(_0x90fd('0x5'))(_0x90fd('0x6'));var config=require(_0x90fd('0x7'));var jayson=require(_0x90fd('0x8'));var client=jayson[_0x90fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff2d4,_0x128c17,_0x50c778){return new BPromise(function(_0x5a604a,_0x2acef7){return client[_0x90fd('0xa')](_0x4ff2d4,_0x50c778)['then'](function(_0x234ba9){logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));logger[_0x90fd('0xe')](_0x90fd('0xf'),_0x128c17,_0x90fd('0xd'),JSON[_0x90fd('0x10')](_0x234ba9));if(_0x234ba9[_0x90fd('0x11')]){if(_0x234ba9['error'][_0x90fd('0x12')]===0x1f4){logger[_0x90fd('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x2acef7(_0x234ba9[_0x90fd('0x11')]['message']);}logger[_0x90fd('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x5a604a(_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);}else{logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));_0x5a604a(_0x234ba9['result']['message']);}})[_0x90fd('0x14')](function(_0x43d804){logger['error'](_0x90fd('0xc'),_0x128c17,_0x43d804);_0x2acef7(_0x43d804);});});}exports[_0x90fd('0x15')]=function(_0x1fcc87){var _0x4d8f3b=this;return new Promise(function(_0x3f9c76,_0x16e9e3){return db[_0x90fd('0x16')][_0x90fd('0x17')]({'raw':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x19')]===undefined?!![]:![]:!![],'where':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1a')]||null:null,'attributes':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1b')]||null:null,'limit':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')]['limit']||null:null,'include':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1c')],function(_0x30f67e){return{'model':db[_0x30f67e[_0x90fd('0x1e')]],'as':_0x30f67e['as'],'attributes':_0x30f67e['attributes'],'include':_0x30f67e[_0x90fd('0x1c')]?_['map'](_0x30f67e[_0x90fd('0x1c')],function(_0x18d5b3){return{'model':db[_0x18d5b3[_0x90fd('0x1e')]],'as':_0x18d5b3['as'],'attributes':_0x18d5b3[_0x90fd('0x1b')],'include':_0x18d5b3[_0x90fd('0x1c')]?_['map'](_0x18d5b3[_0x90fd('0x1c')],function(_0xe333f0){return{'model':db[_0xe333f0[_0x90fd('0x1e')]],'as':_0xe333f0['as'],'attributes':_0xe333f0[_0x90fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x90fd('0x1f')](function(_0x428bc2){logger['info']('GetVtigerAccount',_0x1fcc87);logger[_0x90fd('0xe')](_0x90fd('0x15'),_0x1fcc87,JSON[_0x90fd('0x10')](_0x428bc2));_0x3f9c76(_0x428bc2);})[_0x90fd('0x14')](function(_0x397aaf){logger['error']('GetVtigerAccount',_0x397aaf[_0x90fd('0x13')],_0x1fcc87);_0x16e9e3(_0x4d8f3b[_0x90fd('0x11')](0x1f4,_0x397aaf[_0x90fd('0x13')]));});});};exports[_0x90fd('0x20')]=function(_0x4a3ae4){var _0x59aede=this;return new Promise(function(_0x12dea4,_0x21a9cf){return db[_0x90fd('0x16')][_0x90fd('0x21')]({'raw':_0x4a3ae4['options']?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x19')]===undefined?!![]:![]:!![],'where':_0x4a3ae4[_0x90fd('0x18')]?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1a')]||null:null,'attributes':_0x4a3ae4[_0x90fd('0x18')]?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1b')]||null:null,'include':_0x4a3ae4[_0x90fd('0x18')]?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1c')],function(_0x209e5c){return{'model':db[_0x209e5c[_0x90fd('0x1e')]],'as':_0x209e5c['as'],'attributes':_0x209e5c['attributes'],'include':_0x209e5c[_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x209e5c[_0x90fd('0x1c')],function(_0x3aee5){return{'model':db[_0x3aee5[_0x90fd('0x1e')]],'as':_0x3aee5['as'],'attributes':_0x3aee5[_0x90fd('0x1b')],'include':_0x3aee5[_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x3aee5[_0x90fd('0x1c')],function(_0x186f4f){return{'model':db[_0x186f4f[_0x90fd('0x1e')]],'as':_0x186f4f['as'],'attributes':_0x186f4f[_0x90fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x90fd('0x1f')](function(_0x4c20b0){logger[_0x90fd('0xb')](_0x90fd('0x20'),_0x4a3ae4);logger[_0x90fd('0xe')](_0x90fd('0x20'),_0x4a3ae4,JSON['stringify'](_0x4c20b0));_0x12dea4(_0x4c20b0);})[_0x90fd('0x14')](function(_0x2c4f37){logger[_0x90fd('0x11')]('ShowVtigerAccount',_0x2c4f37['message'],_0x4a3ae4);_0x21a9cf(_0x59aede[_0x90fd('0x11')](0x1f4,_0x2c4f37[_0x90fd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index e489e2f..fa2ab83 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 _0x83bf=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x2cc37d,_0x5b1496){var _0x1f468b=function(_0x1e2c01){while(--_0x1e2c01){_0x2cc37d['push'](_0x2cc37d['shift']());}};_0x1f468b(++_0x5b1496);}(_0x83bf,0x15a));var _0xf83b=function(_0x340a1a,_0x1ef855){_0x340a1a=_0x340a1a-0x0;var _0x23a45c=_0x83bf[_0x340a1a];return _0x23a45c;};'use strict';var multer=require('multer');var util=require(_0xf83b('0x0'));var path=require(_0xf83b('0x1'));var timeout=require(_0xf83b('0x2'));var express=require('express');var router=express[_0xf83b('0x3')]();var fs_extra=require(_0xf83b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf83b('0x5'));var config=require(_0xf83b('0x6'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0xf83b('0x7')](),controller[_0xf83b('0x8')]);router[_0xf83b('0x9')](_0xf83b('0xa'),auth[_0xf83b('0x7')](),controller['show']);router[_0xf83b('0x9')](_0xf83b('0xb'),auth['isAuthenticated'](),controller[_0xf83b('0xc')]);router[_0xf83b('0x9')]('/:id/subjects',auth[_0xf83b('0x7')](),controller[_0xf83b('0xd')]);router[_0xf83b('0x9')](_0xf83b('0xe'),auth[_0xf83b('0x7')](),controller[_0xf83b('0xf')]);router[_0xf83b('0x10')]('/',auth[_0xf83b('0x7')](),controller[_0xf83b('0x11')]);router[_0xf83b('0x12')](_0xf83b('0xa'),auth[_0xf83b('0x7')](),controller[_0xf83b('0x13')]);router[_0xf83b('0x14')]('/:id',auth[_0xf83b('0x7')](),controller[_0xf83b('0x15')]);module[_0xf83b('0x16')]=router; \ No newline at end of file +var _0x5d84=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x2adf51,_0x2dfab0){var _0x4c9876=function(_0x1a3524){while(--_0x1a3524){_0x2adf51['push'](_0x2adf51['shift']());}};_0x4c9876(++_0x2dfab0);}(_0x5d84,0x1a0));var _0x45d8=function(_0x24c228,_0xa0b01d){_0x24c228=_0x24c228-0x0;var _0xb1035e=_0x5d84[_0x24c228];return _0xb1035e;};'use strict';var multer=require(_0x45d8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x45d8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x45d8('0x2'));var auth=require(_0x45d8('0x3'));var interaction=require(_0x45d8('0x4'));var config=require(_0x45d8('0x5'));var controller=require(_0x45d8('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x45d8('0x7')](_0x45d8('0x8'),auth[_0x45d8('0x9')](),controller[_0x45d8('0xa')]);router[_0x45d8('0x7')](_0x45d8('0xb'),auth['isAuthenticated'](),controller[_0x45d8('0xc')]);router[_0x45d8('0x7')]('/:id/subjects',auth[_0x45d8('0x9')](),controller[_0x45d8('0xd')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x45d8('0xe')]);router[_0x45d8('0xf')]('/',auth['isAuthenticated'](),controller[_0x45d8('0x10')]);router[_0x45d8('0x11')](_0x45d8('0x8'),auth[_0x45d8('0x9')](),controller[_0x45d8('0x12')]);router[_0x45d8('0x13')](_0x45d8('0x8'),auth['isAuthenticated'](),controller[_0x45d8('0x14')]);module[_0x45d8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c0bcaac..c0c33b9 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 _0x9d59=['sequelize','exports','STRING'];(function(_0x2d2a92,_0x597388){var _0xfa8639=function(_0x29fa65){while(--_0x29fa65){_0x2d2a92['push'](_0x2d2a92['shift']());}};_0xfa8639(++_0x597388);}(_0x9d59,0x141));var _0x99d5=function(_0x1b429f,_0x3ab8d3){_0x1b429f=_0x1b429f-0x0;var _0x1b371e=_0x9d59[_0x1b429f];return _0x1b371e;};'use strict';var Sequelize=require(_0x99d5('0x0'));module[_0x99d5('0x1')]={'name':{'type':Sequelize[_0x99d5('0x2')]},'description':{'type':Sequelize[_0x99d5('0x2')]}}; \ No newline at end of file +var _0xd6b4=['STRING'];(function(_0x4c03ea,_0x3465be){var _0x7a6922=function(_0xd50354){while(--_0xd50354){_0x4c03ea['push'](_0x4c03ea['shift']());}};_0x7a6922(++_0x3465be);}(_0xd6b4,0x1ca));var _0x4d6b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6b4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4d6b('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 492fd1a..670cc86 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 _0xb4c2=['getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','catch','getFields','findOne','params','VtigerField','nolimit'];(function(_0x4f91e4,_0x11cd4c){var _0xedeb8e=function(_0x354fdd){while(--_0x354fdd){_0x4f91e4['push'](_0x4f91e4['shift']());}};_0xedeb8e(++_0x11cd4c);}(_0xb4c2,0x19c));var _0x2b4c=function(_0x4329f8,_0x13df36){_0x4329f8=_0x4329f8-0x0;var _0x5f496f=_0xb4c2[_0x4329f8];return _0x5f496f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b4c('0x0'));var zipdir=require(_0x2b4c('0x1'));var jsonpatch=require(_0x2b4c('0x2'));var rp=require(_0x2b4c('0x3'));var moment=require(_0x2b4c('0x4'));var BPromise=require(_0x2b4c('0x5'));var Mustache=require(_0x2b4c('0x6'));var util=require(_0x2b4c('0x7'));var path=require(_0x2b4c('0x8'));var sox=require(_0x2b4c('0x9'));var csv=require(_0x2b4c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b4c('0xb'));var _=require('lodash');var squel=require(_0x2b4c('0xc'));var crypto=require('crypto');var jsforce=require(_0x2b4c('0xd'));var deskjs=require(_0x2b4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b4c('0xf'));var Papa=require(_0x2b4c('0x10'));var Redis=require(_0x2b4c('0x11'));var authService=require(_0x2b4c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b4c('0x13'));var hardwareService=require(_0x2b4c('0x14'));var logger=require(_0x2b4c('0x15'))(_0x2b4c('0x16'));var utils=require(_0x2b4c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b4c('0x18'));var db=require(_0x2b4c('0x19'))['db'];function respondWithStatusCode(_0x2650d0,_0x12ab59){_0x12ab59=_0x12ab59||0xcc;return function(_0x340de0){if(_0x340de0){return _0x2650d0[_0x2b4c('0x1a')](_0x12ab59);}return _0x2650d0[_0x2b4c('0x1b')](_0x12ab59)[_0x2b4c('0x1c')]();};}function respondWithResult(_0x323ebe,_0x425240){_0x425240=_0x425240||0xc8;return function(_0x52dc26){if(_0x52dc26){return _0x323ebe[_0x2b4c('0x1b')](_0x425240)[_0x2b4c('0x1d')](_0x52dc26);}};}function respondWithFilteredResult(_0x38c517,_0x2f6fd5){return function(_0x1e9508){if(_0x1e9508){var _0x7fcee9=typeof _0x2f6fd5[_0x2b4c('0x1e')]==='undefined'&&typeof _0x2f6fd5[_0x2b4c('0x1f')]===_0x2b4c('0x20');var _0x3fa354=_0x1e9508[_0x2b4c('0x21')];var _0x396824=_0x7fcee9?0x0:_0x2f6fd5[_0x2b4c('0x1e')];var _0x38d460=_0x7fcee9?_0x1e9508[_0x2b4c('0x21')]:_0x2f6fd5[_0x2b4c('0x1e')]+_0x2f6fd5[_0x2b4c('0x1f')];var _0x33fe96;if(_0x38d460>=_0x3fa354){_0x38d460=_0x3fa354;_0x33fe96=0xc8;}else{_0x33fe96=0xce;}_0x38c517[_0x2b4c('0x1b')](_0x33fe96);return _0x38c517[_0x2b4c('0x22')](_0x2b4c('0x23'),_0x396824+'-'+_0x38d460+'/'+_0x3fa354)[_0x2b4c('0x1d')](_0x1e9508);}return null;};}function patchUpdates(_0xb251){return function(_0x17a169){try{jsonpatch[_0x2b4c('0x24')](_0x17a169,_0xb251,!![]);}catch(_0x16bbbc){return BPromise[_0x2b4c('0x25')](_0x16bbbc);}return _0x17a169['save']();};}function saveUpdates(_0x830d7c,_0x3cb67b){return function(_0x2d268d){if(_0x2d268d){return _0x2d268d[_0x2b4c('0x26')](_0x830d7c)['then'](function(_0x2e3a06){return _0x2e3a06;});}return null;};}function removeEntity(_0x417a85,_0x5c437e){return function(_0x3bc9c1){if(_0x3bc9c1){return _0x3bc9c1['destroy']()[_0x2b4c('0x27')](function(){_0x417a85['status'](0xcc)[_0x2b4c('0x1c')]();});}};}function handleEntityNotFound(_0x4e66ce,_0x48aa0a){return function(_0x38d163){if(!_0x38d163){_0x4e66ce['sendStatus'](0x194);}return _0x38d163;};}function handleError(_0x25a7cf,_0x93f24a){_0x93f24a=_0x93f24a||0x1f4;return function(_0x40b940){logger[_0x2b4c('0x28')](_0x40b940[_0x2b4c('0x29')]);if(_0x40b940[_0x2b4c('0x2a')]){delete _0x40b940[_0x2b4c('0x2a')];}_0x25a7cf['status'](_0x93f24a)[_0x2b4c('0x2b')](_0x40b940);};}exports[_0x2b4c('0x2c')]=function(_0xf77b17,_0x189a20){var _0x37f7cb={},_0x1ae3f9={},_0x2fd4b0={'count':0x0,'rows':[]};var _0x28704b=_[_0x2b4c('0x2d')](db[_0x2b4c('0x2e')][_0x2b4c('0x2f')],function(_0x1c9a1b){return{'name':_0x1c9a1b[_0x2b4c('0x30')],'type':_0x1c9a1b[_0x2b4c('0x31')]['key']};});_0x1ae3f9['model']=_[_0x2b4c('0x2d')](_0x28704b,_0x2b4c('0x2a'));_0x1ae3f9['query']=_[_0x2b4c('0x32')](_0xf77b17[_0x2b4c('0x33')]);_0x1ae3f9['filters']=_['intersection'](_0x1ae3f9[_0x2b4c('0x34')],_0x1ae3f9[_0x2b4c('0x33')]);_0x37f7cb[_0x2b4c('0x35')]=_[_0x2b4c('0x36')](_0x1ae3f9['model'],qs[_0x2b4c('0x37')](_0xf77b17[_0x2b4c('0x33')][_0x2b4c('0x37')]));_0x37f7cb[_0x2b4c('0x35')]=_0x37f7cb[_0x2b4c('0x35')][_0x2b4c('0x38')]?_0x37f7cb[_0x2b4c('0x35')]:_0x1ae3f9['model'];if(!_0xf77b17[_0x2b4c('0x33')][_0x2b4c('0x39')]('nolimit')){_0x37f7cb[_0x2b4c('0x1f')]=qs[_0x2b4c('0x1f')](_0xf77b17[_0x2b4c('0x33')]['limit']);_0x37f7cb[_0x2b4c('0x1e')]=qs[_0x2b4c('0x1e')](_0xf77b17[_0x2b4c('0x33')][_0x2b4c('0x1e')]);}_0x37f7cb[_0x2b4c('0x3a')]=qs[_0x2b4c('0x3b')](_0xf77b17[_0x2b4c('0x33')][_0x2b4c('0x3b')]);_0x37f7cb[_0x2b4c('0x3c')]=qs[_0x2b4c('0x3d')](_[_0x2b4c('0x3e')](_0xf77b17[_0x2b4c('0x33')],_0x1ae3f9['filters']),_0x28704b);if(_0xf77b17[_0x2b4c('0x33')][_0x2b4c('0x3f')]){_0x37f7cb[_0x2b4c('0x3c')]=_[_0x2b4c('0x40')](_0x37f7cb[_0x2b4c('0x3c')],{'$or':_[_0x2b4c('0x2d')](_0x28704b,function(_0x289afb){if(_0x289afb[_0x2b4c('0x31')]!==_0x2b4c('0x41')){var _0x4ac01d={};_0x4ac01d[_0x289afb['name']]={'$like':'%'+_0xf77b17[_0x2b4c('0x33')][_0x2b4c('0x3f')]+'%'};return _0x4ac01d;}})});}_0x37f7cb=_['merge']({},_0x37f7cb,_0xf77b17[_0x2b4c('0x42')]);var _0x51bb5f={'where':_0x37f7cb[_0x2b4c('0x3c')]};return db[_0x2b4c('0x2e')][_0x2b4c('0x21')](_0x51bb5f)[_0x2b4c('0x27')](function(_0x3f638f){_0x2fd4b0[_0x2b4c('0x21')]=_0x3f638f;if(_0xf77b17['query'][_0x2b4c('0x43')]){_0x37f7cb[_0x2b4c('0x44')]=[{'all':!![]}];}return db[_0x2b4c('0x2e')][_0x2b4c('0x45')](_0x37f7cb);})['then'](function(_0x12d558){_0x2fd4b0[_0x2b4c('0x46')]=_0x12d558;return _0x2fd4b0;})['then'](respondWithFilteredResult(_0x189a20,_0x37f7cb))['catch'](handleError(_0x189a20,null));};exports['show']=function(_0x4dd851,_0x2a3c2e){var _0xbe7f3c={'raw':![],'where':{'id':_0x4dd851['params']['id']}},_0x3cf504={};_0x3cf504[_0x2b4c('0x34')]=_[_0x2b4c('0x32')](db[_0x2b4c('0x2e')]['rawAttributes']);_0x3cf504['query']=_[_0x2b4c('0x32')](_0x4dd851[_0x2b4c('0x33')]);_0x3cf504[_0x2b4c('0x3d')]=_[_0x2b4c('0x36')](_0x3cf504[_0x2b4c('0x34')],_0x3cf504['query']);_0xbe7f3c['attributes']=_[_0x2b4c('0x36')](_0x3cf504[_0x2b4c('0x34')],qs[_0x2b4c('0x37')](_0x4dd851[_0x2b4c('0x33')][_0x2b4c('0x37')]));_0xbe7f3c[_0x2b4c('0x35')]=_0xbe7f3c['attributes'][_0x2b4c('0x38')]?_0xbe7f3c[_0x2b4c('0x35')]:_0x3cf504[_0x2b4c('0x34')];if(_0x4dd851[_0x2b4c('0x33')][_0x2b4c('0x43')]){_0xbe7f3c[_0x2b4c('0x44')]=[{'all':!![]}];}_0xbe7f3c=_[_0x2b4c('0x40')]({},_0xbe7f3c,_0x4dd851[_0x2b4c('0x42')]);return db[_0x2b4c('0x2e')][_0x2b4c('0x47')](_0xbe7f3c)[_0x2b4c('0x27')](handleEntityNotFound(_0x2a3c2e,null))[_0x2b4c('0x27')](respondWithResult(_0x2a3c2e,null))['catch'](handleError(_0x2a3c2e,null));};exports[_0x2b4c('0x48')]=function(_0x4aa4ec,_0x48a4a3){return db[_0x2b4c('0x2e')][_0x2b4c('0x48')](_0x4aa4ec['body'],{})[_0x2b4c('0x27')](respondWithResult(_0x48a4a3,0xc9))['catch'](handleError(_0x48a4a3,null));};exports['update']=function(_0x38f932,_0x3d23a4){if(_0x38f932['body']['id']){delete _0x38f932['body']['id'];}return db['VtigerConfiguration'][_0x2b4c('0x47')]({'where':{'id':_0x38f932['params']['id']}})[_0x2b4c('0x27')](handleEntityNotFound(_0x3d23a4,null))[_0x2b4c('0x27')](saveUpdates(_0x38f932[_0x2b4c('0x49')],null))['then'](respondWithResult(_0x3d23a4,null))[_0x2b4c('0x4a')](handleError(_0x3d23a4,null));};exports['destroy']=function(_0x400267,_0x30a16b){return db[_0x2b4c('0x2e')]['find']({'where':{'id':_0x400267['params']['id']}})[_0x2b4c('0x27')](handleEntityNotFound(_0x30a16b,null))[_0x2b4c('0x27')](removeEntity(_0x30a16b,null))['catch'](handleError(_0x30a16b,null));};exports[_0x2b4c('0x4b')]=function(_0x1c951d,_0x44d046,_0x1fee4b){var _0x50c0fd={};var _0x20d62e={};var _0x4a0c8b;var _0x36dfbc;return db['VtigerConfiguration'][_0x2b4c('0x4c')]({'where':{'id':_0x1c951d[_0x2b4c('0x4d')]['id']}})[_0x2b4c('0x27')](handleEntityNotFound(_0x44d046,null))['then'](function(_0x25e61e){if(_0x25e61e){_0x4a0c8b=_0x25e61e;_0x20d62e[_0x2b4c('0x34')]=_[_0x2b4c('0x32')](db[_0x2b4c('0x4e')][_0x2b4c('0x2f')]);_0x20d62e['query']=_[_0x2b4c('0x32')](_0x1c951d[_0x2b4c('0x33')]);_0x20d62e['filters']=_[_0x2b4c('0x36')](_0x20d62e[_0x2b4c('0x34')],_0x20d62e[_0x2b4c('0x33')]);_0x50c0fd[_0x2b4c('0x35')]=_['intersection'](_0x20d62e[_0x2b4c('0x34')],qs[_0x2b4c('0x37')](_0x1c951d['query'][_0x2b4c('0x37')]));_0x50c0fd[_0x2b4c('0x35')]=_0x50c0fd[_0x2b4c('0x35')]['length']?_0x50c0fd[_0x2b4c('0x35')]:_0x20d62e[_0x2b4c('0x34')];_0x50c0fd[_0x2b4c('0x3a')]=qs['sort'](_0x1c951d[_0x2b4c('0x33')][_0x2b4c('0x3b')]);_0x50c0fd[_0x2b4c('0x3c')]=qs[_0x2b4c('0x3d')](_['pick'](_0x1c951d[_0x2b4c('0x33')],_0x20d62e['filters']));if(_0x1c951d['query'][_0x2b4c('0x3f')]){_0x50c0fd['where']=_[_0x2b4c('0x40')](_0x50c0fd[_0x2b4c('0x3c')],{'$or':_[_0x2b4c('0x2d')](_0x50c0fd[_0x2b4c('0x35')],function(_0x2380ee){var _0x91cf95={};_0x91cf95[_0x2380ee]={'$like':'%'+_0x1c951d[_0x2b4c('0x33')][_0x2b4c('0x3f')]+'%'};return _0x91cf95;})});}_0x50c0fd=_['merge']({},_0x50c0fd,_0x1c951d[_0x2b4c('0x42')]);return _0x4a0c8b[_0x2b4c('0x4b')](_0x50c0fd);}})['then'](function(_0x11bc83){if(_0x11bc83){_0x36dfbc=_0x11bc83[_0x2b4c('0x38')];if(!_0x1c951d[_0x2b4c('0x33')][_0x2b4c('0x39')](_0x2b4c('0x4f'))){_0x50c0fd[_0x2b4c('0x1f')]=qs['limit'](_0x1c951d[_0x2b4c('0x33')][_0x2b4c('0x1f')]);_0x50c0fd[_0x2b4c('0x1e')]=qs[_0x2b4c('0x1e')](_0x1c951d[_0x2b4c('0x33')][_0x2b4c('0x1e')]);}return _0x4a0c8b[_0x2b4c('0x4b')](_0x50c0fd);}})[_0x2b4c('0x27')](function(_0x24e91e){if(_0x24e91e){return _0x24e91e?{'count':_0x36dfbc,'rows':_0x24e91e}:null;}})[_0x2b4c('0x27')](respondWithResult(_0x44d046,null))[_0x2b4c('0x4a')](handleError(_0x44d046,null));};exports[_0x2b4c('0x50')]=function(_0x4ebb5c,_0x56fa22,_0x339599){var _0x583580={};var _0x2578e2={};var _0x5e67e5;var _0x26a65c;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4ebb5c[_0x2b4c('0x4d')]['id']}})[_0x2b4c('0x27')](handleEntityNotFound(_0x56fa22,null))[_0x2b4c('0x27')](function(_0x1df7fa){if(_0x1df7fa){_0x5e67e5=_0x1df7fa;_0x2578e2[_0x2b4c('0x34')]=_['keys'](db[_0x2b4c('0x4e')]['rawAttributes']);_0x2578e2[_0x2b4c('0x33')]=_[_0x2b4c('0x32')](_0x4ebb5c['query']);_0x2578e2['filters']=_[_0x2b4c('0x36')](_0x2578e2['model'],_0x2578e2[_0x2b4c('0x33')]);_0x583580['attributes']=_['intersection'](_0x2578e2[_0x2b4c('0x34')],qs[_0x2b4c('0x37')](_0x4ebb5c[_0x2b4c('0x33')][_0x2b4c('0x37')]));_0x583580[_0x2b4c('0x35')]=_0x583580['attributes'][_0x2b4c('0x38')]?_0x583580[_0x2b4c('0x35')]:_0x2578e2[_0x2b4c('0x34')];_0x583580[_0x2b4c('0x3a')]=qs[_0x2b4c('0x3b')](_0x4ebb5c[_0x2b4c('0x33')][_0x2b4c('0x3b')]);_0x583580[_0x2b4c('0x3c')]=qs[_0x2b4c('0x3d')](_['pick'](_0x4ebb5c[_0x2b4c('0x33')],_0x2578e2[_0x2b4c('0x3d')]));if(_0x4ebb5c['query'][_0x2b4c('0x3f')]){_0x583580[_0x2b4c('0x3c')]=_[_0x2b4c('0x40')](_0x583580[_0x2b4c('0x3c')],{'$or':_[_0x2b4c('0x2d')](_0x583580[_0x2b4c('0x35')],function(_0x223c4a){var _0x27d637={};_0x27d637[_0x223c4a]={'$like':'%'+_0x4ebb5c[_0x2b4c('0x33')][_0x2b4c('0x3f')]+'%'};return _0x27d637;})});}_0x583580=_[_0x2b4c('0x40')]({},_0x583580,_0x4ebb5c['options']);return _0x5e67e5['getSubjects'](_0x583580);}})[_0x2b4c('0x27')](function(_0x35bffc){if(_0x35bffc){_0x26a65c=_0x35bffc[_0x2b4c('0x38')];if(!_0x4ebb5c[_0x2b4c('0x33')][_0x2b4c('0x39')]('nolimit')){_0x583580[_0x2b4c('0x1f')]=qs[_0x2b4c('0x1f')](_0x4ebb5c[_0x2b4c('0x33')]['limit']);_0x583580[_0x2b4c('0x1e')]=qs[_0x2b4c('0x1e')](_0x4ebb5c[_0x2b4c('0x33')][_0x2b4c('0x1e')]);}return _0x5e67e5[_0x2b4c('0x50')](_0x583580);}})[_0x2b4c('0x27')](function(_0xbc5450){if(_0xbc5450){return _0xbc5450?{'count':_0x26a65c,'rows':_0xbc5450}:null;}})[_0x2b4c('0x27')](respondWithResult(_0x56fa22,null))['catch'](handleError(_0x56fa22,null));};exports[_0x2b4c('0x51')]=function(_0xb82a8f,_0x104580,_0x361392){var _0x40fa09={};var _0x50fd99={};var _0x194f66;var _0x6e50c3;return db[_0x2b4c('0x2e')]['findOne']({'where':{'id':_0xb82a8f['params']['id']}})[_0x2b4c('0x27')](handleEntityNotFound(_0x104580,null))['then'](function(_0x1fc3ed){if(_0x1fc3ed){_0x194f66=_0x1fc3ed;_0x50fd99[_0x2b4c('0x34')]=_['keys'](db[_0x2b4c('0x4e')]['rawAttributes']);_0x50fd99[_0x2b4c('0x33')]=_[_0x2b4c('0x32')](_0xb82a8f['query']);_0x50fd99[_0x2b4c('0x3d')]=_['intersection'](_0x50fd99['model'],_0x50fd99[_0x2b4c('0x33')]);_0x40fa09['attributes']=_['intersection'](_0x50fd99[_0x2b4c('0x34')],qs[_0x2b4c('0x37')](_0xb82a8f[_0x2b4c('0x33')]['fields']));_0x40fa09[_0x2b4c('0x35')]=_0x40fa09[_0x2b4c('0x35')][_0x2b4c('0x38')]?_0x40fa09[_0x2b4c('0x35')]:_0x50fd99[_0x2b4c('0x34')];_0x40fa09[_0x2b4c('0x3a')]=qs[_0x2b4c('0x3b')](_0xb82a8f[_0x2b4c('0x33')][_0x2b4c('0x3b')]);_0x40fa09[_0x2b4c('0x3c')]=qs[_0x2b4c('0x3d')](_[_0x2b4c('0x3e')](_0xb82a8f[_0x2b4c('0x33')],_0x50fd99[_0x2b4c('0x3d')]));if(_0xb82a8f[_0x2b4c('0x33')]['filter']){_0x40fa09['where']=_[_0x2b4c('0x40')](_0x40fa09[_0x2b4c('0x3c')],{'$or':_['map'](_0x40fa09[_0x2b4c('0x35')],function(_0x14da78){var _0x263e67={};_0x263e67[_0x14da78]={'$like':'%'+_0xb82a8f[_0x2b4c('0x33')][_0x2b4c('0x3f')]+'%'};return _0x263e67;})});}_0x40fa09=_[_0x2b4c('0x40')]({},_0x40fa09,_0xb82a8f['options']);return _0x194f66[_0x2b4c('0x51')](_0x40fa09);}})[_0x2b4c('0x27')](function(_0x35a3a3){if(_0x35a3a3){_0x6e50c3=_0x35a3a3[_0x2b4c('0x38')];if(!_0xb82a8f[_0x2b4c('0x33')][_0x2b4c('0x39')]('nolimit')){_0x40fa09[_0x2b4c('0x1f')]=qs[_0x2b4c('0x1f')](_0xb82a8f[_0x2b4c('0x33')]['limit']);_0x40fa09[_0x2b4c('0x1e')]=qs[_0x2b4c('0x1e')](_0xb82a8f[_0x2b4c('0x33')][_0x2b4c('0x1e')]);}return _0x194f66[_0x2b4c('0x51')](_0x40fa09);}})['then'](function(_0x499177){if(_0x499177){return _0x499177?{'count':_0x6e50c3,'rows':_0x499177}:null;}})[_0x2b4c('0x27')](respondWithResult(_0x104580,null))[_0x2b4c('0x4a')](handleError(_0x104580,null));}; \ No newline at end of file +var _0x340d=['destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','VtigerField','pick','getFields','getSubjects','nolimit','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x340d,0x11c));var _0xd340=function(_0x7f89ee,_0x2ad151){_0x7f89ee=_0x7f89ee-0x0;var _0x1d5523=_0x340d[_0x7f89ee];return _0x1d5523;};'use strict';var emlformat=require(_0xd340('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd340('0x1'));var jsonpatch=require(_0xd340('0x2'));var rp=require(_0xd340('0x3'));var moment=require(_0xd340('0x4'));var BPromise=require(_0xd340('0x5'));var Mustache=require(_0xd340('0x6'));var util=require(_0xd340('0x7'));var path=require(_0xd340('0x8'));var sox=require(_0xd340('0x9'));var csv=require(_0xd340('0xa'));var ejs=require(_0xd340('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd340('0xc'));var squel=require(_0xd340('0xd'));var crypto=require(_0xd340('0xe'));var jsforce=require(_0xd340('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd340('0xa'));var querystring=require(_0xd340('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd340('0x11'));var as=require(_0xd340('0x12'));var hardwareService=require(_0xd340('0x13'));var logger=require('../../config/logger')(_0xd340('0x14'));var utils=require(_0xd340('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd340('0x16'))['db'];function respondWithStatusCode(_0x59c819,_0x405119){_0x405119=_0x405119||0xcc;return function(_0x5056ef){if(_0x5056ef){return _0x59c819['sendStatus'](_0x405119);}return _0x59c819[_0xd340('0x17')](_0x405119)[_0xd340('0x18')]();};}function respondWithResult(_0x4aeda0,_0x1ee933){_0x1ee933=_0x1ee933||0xc8;return function(_0x19b6b0){if(_0x19b6b0){return _0x4aeda0[_0xd340('0x17')](_0x1ee933)[_0xd340('0x19')](_0x19b6b0);}};}function respondWithFilteredResult(_0x85e745,_0x179971){return function(_0x33859f){if(_0x33859f){var _0x172a39=typeof _0x179971[_0xd340('0x1a')]===_0xd340('0x1b')&&typeof _0x179971[_0xd340('0x1c')]==='undefined';var _0x80b902=_0x33859f[_0xd340('0x1d')];var _0x1d90f6=_0x172a39?0x0:_0x179971[_0xd340('0x1a')];var _0x216d27=_0x172a39?_0x33859f['count']:_0x179971['offset']+_0x179971[_0xd340('0x1c')];var _0x32eb77;if(_0x216d27>=_0x80b902){_0x216d27=_0x80b902;_0x32eb77=0xc8;}else{_0x32eb77=0xce;}_0x85e745[_0xd340('0x17')](_0x32eb77);return _0x85e745[_0xd340('0x1e')](_0xd340('0x1f'),_0x1d90f6+'-'+_0x216d27+'/'+_0x80b902)[_0xd340('0x19')](_0x33859f);}return null;};}function patchUpdates(_0x3a5021){return function(_0xb7f093){try{jsonpatch[_0xd340('0x20')](_0xb7f093,_0x3a5021,!![]);}catch(_0x48ab86){return BPromise[_0xd340('0x21')](_0x48ab86);}return _0xb7f093[_0xd340('0x22')]();};}function saveUpdates(_0x353736,_0x3d37c6){return function(_0x964eea){if(_0x964eea){return _0x964eea[_0xd340('0x23')](_0x353736)['then'](function(_0xb878b4){return _0xb878b4;});}return null;};}function removeEntity(_0x1e2cb6,_0x16a20e){return function(_0x4fca88){if(_0x4fca88){return _0x4fca88[_0xd340('0x24')]()['then'](function(){_0x1e2cb6[_0xd340('0x17')](0xcc)[_0xd340('0x18')]();});}};}function handleEntityNotFound(_0x193298,_0x129706){return function(_0x4eecde){if(!_0x4eecde){_0x193298['sendStatus'](0x194);}return _0x4eecde;};}function handleError(_0x557556,_0x330ed3){_0x330ed3=_0x330ed3||0x1f4;return function(_0x30dda0){logger[_0xd340('0x25')](_0x30dda0[_0xd340('0x26')]);if(_0x30dda0[_0xd340('0x27')]){delete _0x30dda0['name'];}_0x557556[_0xd340('0x17')](_0x330ed3)[_0xd340('0x28')](_0x30dda0);};}exports[_0xd340('0x29')]=function(_0x4616d0,_0x1b3123){var _0x3b83d1={},_0x488f69={},_0x3548c8={'count':0x0,'rows':[]};var _0x842235=_['map'](db[_0xd340('0x2a')][_0xd340('0x2b')],function(_0x2e2f45){return{'name':_0x2e2f45['fieldName'],'type':_0x2e2f45[_0xd340('0x2c')]['key']};});_0x488f69[_0xd340('0x2d')]=_['map'](_0x842235,_0xd340('0x27'));_0x488f69[_0xd340('0x2e')]=_[_0xd340('0x2f')](_0x4616d0['query']);_0x488f69[_0xd340('0x30')]=_['intersection'](_0x488f69[_0xd340('0x2d')],_0x488f69[_0xd340('0x2e')]);_0x3b83d1[_0xd340('0x31')]=_[_0xd340('0x32')](_0x488f69[_0xd340('0x2d')],qs['fields'](_0x4616d0[_0xd340('0x2e')][_0xd340('0x33')]));_0x3b83d1[_0xd340('0x31')]=_0x3b83d1['attributes'][_0xd340('0x34')]?_0x3b83d1[_0xd340('0x31')]:_0x488f69['model'];if(!_0x4616d0[_0xd340('0x2e')][_0xd340('0x35')]('nolimit')){_0x3b83d1[_0xd340('0x1c')]=qs[_0xd340('0x1c')](_0x4616d0[_0xd340('0x2e')]['limit']);_0x3b83d1[_0xd340('0x1a')]=qs[_0xd340('0x1a')](_0x4616d0[_0xd340('0x2e')][_0xd340('0x1a')]);}_0x3b83d1[_0xd340('0x36')]=qs[_0xd340('0x37')](_0x4616d0[_0xd340('0x2e')][_0xd340('0x37')]);_0x3b83d1[_0xd340('0x38')]=qs[_0xd340('0x30')](_['pick'](_0x4616d0[_0xd340('0x2e')],_0x488f69[_0xd340('0x30')]),_0x842235);if(_0x4616d0[_0xd340('0x2e')][_0xd340('0x39')]){_0x3b83d1['where']=_[_0xd340('0x3a')](_0x3b83d1[_0xd340('0x38')],{'$or':_[_0xd340('0x3b')](_0x842235,function(_0x35b746){if(_0x35b746[_0xd340('0x2c')]!==_0xd340('0x3c')){var _0x201946={};_0x201946[_0x35b746[_0xd340('0x27')]]={'$like':'%'+_0x4616d0[_0xd340('0x2e')][_0xd340('0x39')]+'%'};return _0x201946;}})});}_0x3b83d1=_[_0xd340('0x3a')]({},_0x3b83d1,_0x4616d0[_0xd340('0x3d')]);var _0x4f43a4={'where':_0x3b83d1[_0xd340('0x38')]};return db[_0xd340('0x2a')][_0xd340('0x1d')](_0x4f43a4)[_0xd340('0x3e')](function(_0x236198){_0x3548c8['count']=_0x236198;if(_0x4616d0['query'][_0xd340('0x3f')]){_0x3b83d1['include']=[{'all':!![]}];}return db[_0xd340('0x2a')][_0xd340('0x40')](_0x3b83d1);})[_0xd340('0x3e')](function(_0x23d0d2){_0x3548c8[_0xd340('0x41')]=_0x23d0d2;return _0x3548c8;})[_0xd340('0x3e')](respondWithFilteredResult(_0x1b3123,_0x3b83d1))[_0xd340('0x42')](handleError(_0x1b3123,null));};exports[_0xd340('0x43')]=function(_0x4fee49,_0x14d0b2){var _0x4ba344={'raw':![],'where':{'id':_0x4fee49[_0xd340('0x44')]['id']}},_0x4942e2={};_0x4942e2[_0xd340('0x2d')]=_[_0xd340('0x2f')](db[_0xd340('0x2a')][_0xd340('0x2b')]);_0x4942e2[_0xd340('0x2e')]=_[_0xd340('0x2f')](_0x4fee49[_0xd340('0x2e')]);_0x4942e2[_0xd340('0x30')]=_[_0xd340('0x32')](_0x4942e2['model'],_0x4942e2['query']);_0x4ba344[_0xd340('0x31')]=_['intersection'](_0x4942e2['model'],qs[_0xd340('0x33')](_0x4fee49['query']['fields']));_0x4ba344[_0xd340('0x31')]=_0x4ba344[_0xd340('0x31')][_0xd340('0x34')]?_0x4ba344[_0xd340('0x31')]:_0x4942e2[_0xd340('0x2d')];if(_0x4fee49[_0xd340('0x2e')][_0xd340('0x3f')]){_0x4ba344[_0xd340('0x45')]=[{'all':!![]}];}_0x4ba344=_['merge']({},_0x4ba344,_0x4fee49['options']);return db[_0xd340('0x2a')][_0xd340('0x46')](_0x4ba344)[_0xd340('0x3e')](handleEntityNotFound(_0x14d0b2,null))[_0xd340('0x3e')](respondWithResult(_0x14d0b2,null))[_0xd340('0x42')](handleError(_0x14d0b2,null));};exports[_0xd340('0x47')]=function(_0x1e53ff,_0x259419){return db[_0xd340('0x2a')]['create'](_0x1e53ff['body'],{})[_0xd340('0x3e')](respondWithResult(_0x259419,0xc9))[_0xd340('0x42')](handleError(_0x259419,null));};exports['update']=function(_0x502706,_0x4716b6){if(_0x502706[_0xd340('0x48')]['id']){delete _0x502706[_0xd340('0x48')]['id'];}return db[_0xd340('0x2a')]['find']({'where':{'id':_0x502706[_0xd340('0x44')]['id']}})[_0xd340('0x3e')](handleEntityNotFound(_0x4716b6,null))[_0xd340('0x3e')](saveUpdates(_0x502706[_0xd340('0x48')],null))['then'](respondWithResult(_0x4716b6,null))[_0xd340('0x42')](handleError(_0x4716b6,null));};exports['destroy']=function(_0x5091b0,_0x57b6a2){return db[_0xd340('0x2a')]['find']({'where':{'id':_0x5091b0[_0xd340('0x44')]['id']}})[_0xd340('0x3e')](handleEntityNotFound(_0x57b6a2,null))['then'](removeEntity(_0x57b6a2,null))[_0xd340('0x42')](handleError(_0x57b6a2,null));};exports['getFields']=function(_0x4288ca,_0x1852e5,_0x4ca8b1){var _0x5b44fb={};var _0x48fe3a={};var _0x3f35b;var _0xca8f1b;return db[_0xd340('0x2a')]['findOne']({'where':{'id':_0x4288ca[_0xd340('0x44')]['id']}})[_0xd340('0x3e')](handleEntityNotFound(_0x1852e5,null))[_0xd340('0x3e')](function(_0x3f5d94){if(_0x3f5d94){_0x3f35b=_0x3f5d94;_0x48fe3a[_0xd340('0x2d')]=_['keys'](db[_0xd340('0x49')]['rawAttributes']);_0x48fe3a[_0xd340('0x2e')]=_[_0xd340('0x2f')](_0x4288ca[_0xd340('0x2e')]);_0x48fe3a[_0xd340('0x30')]=_['intersection'](_0x48fe3a['model'],_0x48fe3a[_0xd340('0x2e')]);_0x5b44fb[_0xd340('0x31')]=_[_0xd340('0x32')](_0x48fe3a['model'],qs[_0xd340('0x33')](_0x4288ca[_0xd340('0x2e')][_0xd340('0x33')]));_0x5b44fb[_0xd340('0x31')]=_0x5b44fb['attributes'][_0xd340('0x34')]?_0x5b44fb[_0xd340('0x31')]:_0x48fe3a[_0xd340('0x2d')];_0x5b44fb['order']=qs[_0xd340('0x37')](_0x4288ca[_0xd340('0x2e')][_0xd340('0x37')]);_0x5b44fb[_0xd340('0x38')]=qs['filters'](_[_0xd340('0x4a')](_0x4288ca[_0xd340('0x2e')],_0x48fe3a[_0xd340('0x30')]));if(_0x4288ca[_0xd340('0x2e')][_0xd340('0x39')]){_0x5b44fb[_0xd340('0x38')]=_[_0xd340('0x3a')](_0x5b44fb['where'],{'$or':_['map'](_0x5b44fb['attributes'],function(_0x8f253e){var _0x5bd45b={};_0x5bd45b[_0x8f253e]={'$like':'%'+_0x4288ca[_0xd340('0x2e')][_0xd340('0x39')]+'%'};return _0x5bd45b;})});}_0x5b44fb=_[_0xd340('0x3a')]({},_0x5b44fb,_0x4288ca['options']);return _0x3f35b[_0xd340('0x4b')](_0x5b44fb);}})['then'](function(_0x27c6c6){if(_0x27c6c6){_0xca8f1b=_0x27c6c6[_0xd340('0x34')];if(!_0x4288ca[_0xd340('0x2e')][_0xd340('0x35')]('nolimit')){_0x5b44fb[_0xd340('0x1c')]=qs[_0xd340('0x1c')](_0x4288ca[_0xd340('0x2e')][_0xd340('0x1c')]);_0x5b44fb['offset']=qs[_0xd340('0x1a')](_0x4288ca[_0xd340('0x2e')][_0xd340('0x1a')]);}return _0x3f35b['getFields'](_0x5b44fb);}})[_0xd340('0x3e')](function(_0x1fd602){if(_0x1fd602){return _0x1fd602?{'count':_0xca8f1b,'rows':_0x1fd602}:null;}})['then'](respondWithResult(_0x1852e5,null))[_0xd340('0x42')](handleError(_0x1852e5,null));};exports['getSubjects']=function(_0x219f52,_0x3df0c5,_0x353868){var _0x49bcce={};var _0x43581b={};var _0x1e0916;var _0x14c632;return db[_0xd340('0x2a')]['findOne']({'where':{'id':_0x219f52['params']['id']}})[_0xd340('0x3e')](handleEntityNotFound(_0x3df0c5,null))[_0xd340('0x3e')](function(_0x1b41d2){if(_0x1b41d2){_0x1e0916=_0x1b41d2;_0x43581b[_0xd340('0x2d')]=_['keys'](db[_0xd340('0x49')]['rawAttributes']);_0x43581b[_0xd340('0x2e')]=_[_0xd340('0x2f')](_0x219f52[_0xd340('0x2e')]);_0x43581b[_0xd340('0x30')]=_['intersection'](_0x43581b['model'],_0x43581b[_0xd340('0x2e')]);_0x49bcce[_0xd340('0x31')]=_[_0xd340('0x32')](_0x43581b[_0xd340('0x2d')],qs[_0xd340('0x33')](_0x219f52['query'][_0xd340('0x33')]));_0x49bcce[_0xd340('0x31')]=_0x49bcce[_0xd340('0x31')][_0xd340('0x34')]?_0x49bcce[_0xd340('0x31')]:_0x43581b[_0xd340('0x2d')];_0x49bcce['order']=qs[_0xd340('0x37')](_0x219f52[_0xd340('0x2e')][_0xd340('0x37')]);_0x49bcce[_0xd340('0x38')]=qs[_0xd340('0x30')](_[_0xd340('0x4a')](_0x219f52[_0xd340('0x2e')],_0x43581b['filters']));if(_0x219f52['query']['filter']){_0x49bcce[_0xd340('0x38')]=_[_0xd340('0x3a')](_0x49bcce[_0xd340('0x38')],{'$or':_[_0xd340('0x3b')](_0x49bcce[_0xd340('0x31')],function(_0x526308){var _0x151557={};_0x151557[_0x526308]={'$like':'%'+_0x219f52[_0xd340('0x2e')][_0xd340('0x39')]+'%'};return _0x151557;})});}_0x49bcce=_[_0xd340('0x3a')]({},_0x49bcce,_0x219f52[_0xd340('0x3d')]);return _0x1e0916[_0xd340('0x4c')](_0x49bcce);}})['then'](function(_0x1de39b){if(_0x1de39b){_0x14c632=_0x1de39b['length'];if(!_0x219f52['query']['hasOwnProperty'](_0xd340('0x4d'))){_0x49bcce['limit']=qs['limit'](_0x219f52[_0xd340('0x2e')]['limit']);_0x49bcce[_0xd340('0x1a')]=qs['offset'](_0x219f52[_0xd340('0x2e')][_0xd340('0x1a')]);}return _0x1e0916[_0xd340('0x4c')](_0x49bcce);}})['then'](function(_0xe6ac90){if(_0xe6ac90){return _0xe6ac90?{'count':_0x14c632,'rows':_0xe6ac90}:null;}})[_0xd340('0x3e')](respondWithResult(_0x3df0c5,null))[_0xd340('0x42')](handleError(_0x3df0c5,null));};exports[_0xd340('0x4e')]=function(_0x5badb9,_0x2d46f1,_0x9050e1){var _0x2260e1={};var _0x523af6={};var _0x4ba590;var _0x5b979a;return db[_0xd340('0x2a')][_0xd340('0x4f')]({'where':{'id':_0x5badb9['params']['id']}})[_0xd340('0x3e')](handleEntityNotFound(_0x2d46f1,null))[_0xd340('0x3e')](function(_0x42de6a){if(_0x42de6a){_0x4ba590=_0x42de6a;_0x523af6[_0xd340('0x2d')]=_['keys'](db[_0xd340('0x49')][_0xd340('0x2b')]);_0x523af6[_0xd340('0x2e')]=_[_0xd340('0x2f')](_0x5badb9[_0xd340('0x2e')]);_0x523af6[_0xd340('0x30')]=_[_0xd340('0x32')](_0x523af6['model'],_0x523af6[_0xd340('0x2e')]);_0x2260e1[_0xd340('0x31')]=_[_0xd340('0x32')](_0x523af6[_0xd340('0x2d')],qs[_0xd340('0x33')](_0x5badb9[_0xd340('0x2e')][_0xd340('0x33')]));_0x2260e1[_0xd340('0x31')]=_0x2260e1[_0xd340('0x31')][_0xd340('0x34')]?_0x2260e1[_0xd340('0x31')]:_0x523af6[_0xd340('0x2d')];_0x2260e1[_0xd340('0x36')]=qs[_0xd340('0x37')](_0x5badb9[_0xd340('0x2e')]['sort']);_0x2260e1[_0xd340('0x38')]=qs[_0xd340('0x30')](_['pick'](_0x5badb9[_0xd340('0x2e')],_0x523af6[_0xd340('0x30')]));if(_0x5badb9['query']['filter']){_0x2260e1[_0xd340('0x38')]=_[_0xd340('0x3a')](_0x2260e1[_0xd340('0x38')],{'$or':_[_0xd340('0x3b')](_0x2260e1[_0xd340('0x31')],function(_0x54c171){var _0x5da964={};_0x5da964[_0x54c171]={'$like':'%'+_0x5badb9[_0xd340('0x2e')][_0xd340('0x39')]+'%'};return _0x5da964;})});}_0x2260e1=_[_0xd340('0x3a')]({},_0x2260e1,_0x5badb9['options']);return _0x4ba590['getDescriptions'](_0x2260e1);}})[_0xd340('0x3e')](function(_0x49a8a9){if(_0x49a8a9){_0x5b979a=_0x49a8a9[_0xd340('0x34')];if(!_0x5badb9[_0xd340('0x2e')][_0xd340('0x35')](_0xd340('0x4d'))){_0x2260e1[_0xd340('0x1c')]=qs[_0xd340('0x1c')](_0x5badb9['query'][_0xd340('0x1c')]);_0x2260e1[_0xd340('0x1a')]=qs[_0xd340('0x1a')](_0x5badb9[_0xd340('0x2e')]['offset']);}return _0x4ba590[_0xd340('0x4e')](_0x2260e1);}})[_0xd340('0x3e')](function(_0x56e250){if(_0x56e250){return _0x56e250?{'count':_0x5b979a,'rows':_0x56e250}:null;}})[_0xd340('0x3e')](respondWithResult(_0x2d46f1,null))[_0xd340('0x42')](handleError(_0x2d46f1,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a4b7900..dd7fd43 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 _0xe391=['define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports'];(function(_0x175bd3,_0x5c33f9){var _0x4d6e8f=function(_0x4d8a83){while(--_0x4d8a83){_0x175bd3['push'](_0x175bd3['shift']());}};_0x4d6e8f(++_0x5c33f9);}(_0xe391,0x65));var _0x1e39=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0xe391[_0x507403];return _0x1327c;};'use strict';var _=require(_0x1e39('0x0'));var util=require(_0x1e39('0x1'));var logger=require(_0x1e39('0x2'))(_0x1e39('0x3'));var moment=require(_0x1e39('0x4'));var BPromise=require(_0x1e39('0x5'));var rp=require(_0x1e39('0x6'));var fs=require('fs');var path=require(_0x1e39('0x7'));var rimraf=require('rimraf');var config=require(_0x1e39('0x8'));var attributes=require(_0x1e39('0x9'));module[_0x1e39('0xa')]=function(_0x3d987e,_0x2d99c7){return _0x3d987e[_0x1e39('0xb')](_0x1e39('0xc'),attributes,{'tableName':_0x1e39('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbd2=['../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xf33afd,_0x2363b6){var _0x5f432a=function(_0x2599b5){while(--_0x2599b5){_0xf33afd['push'](_0xf33afd['shift']());}};_0x5f432a(++_0x2363b6);}(_0xbbd2,0x1d1));var _0x2bbd=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xbbd2[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0x2bbd('0x0'));var util=require('util');var logger=require(_0x2bbd('0x1'))(_0x2bbd('0x2'));var moment=require(_0x2bbd('0x3'));var BPromise=require(_0x2bbd('0x4'));var rp=require(_0x2bbd('0x5'));var fs=require('fs');var path=require(_0x2bbd('0x6'));var rimraf=require(_0x2bbd('0x7'));var config=require(_0x2bbd('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x2bbd('0x9')]=function(_0x564d61,_0x88f1a8){return _0x564d61[_0x2bbd('0xa')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 37063be..5c84ac6 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 _0xa057=['error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa057,0x71));var _0x7a05=function(_0x4d78f3,_0x52e922){_0x4d78f3=_0x4d78f3-0x0;var _0x5f3cae=_0xa057[_0x4d78f3];return _0x5f3cae;};'use strict';var _=require(_0x7a05('0x0'));var util=require('util');var moment=require(_0x7a05('0x1'));var BPromise=require(_0x7a05('0x2'));var rs=require(_0x7a05('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a05('0x4'))(_0x7a05('0x5'));var config=require('../../config/environment');var jayson=require(_0x7a05('0x6'));var client=jayson[_0x7a05('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xebf832,_0x929e19,_0x2b3711){return new BPromise(function(_0x5197dc,_0x3eb475){return client[_0x7a05('0x8')](_0xebf832,_0x2b3711)[_0x7a05('0x9')](function(_0x5e3877){logger[_0x7a05('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x929e19,_0x7a05('0xb'));logger[_0x7a05('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x929e19,_0x7a05('0xb'),JSON['stringify'](_0x5e3877));if(_0x5e3877[_0x7a05('0xd')]){if(_0x5e3877[_0x7a05('0xd')][_0x7a05('0xe')]===0x1f4){logger[_0x7a05('0xd')](_0x7a05('0xf'),_0x929e19,_0x5e3877[_0x7a05('0xd')][_0x7a05('0x10')]);return _0x3eb475(_0x5e3877[_0x7a05('0xd')][_0x7a05('0x10')]);}logger[_0x7a05('0xd')](_0x7a05('0xf'),_0x929e19,_0x5e3877[_0x7a05('0xd')]['message']);return _0x5197dc(_0x5e3877[_0x7a05('0xd')][_0x7a05('0x10')]);}else{logger[_0x7a05('0xa')](_0x7a05('0xf'),_0x929e19,_0x7a05('0xb'));_0x5197dc(_0x5e3877['result'][_0x7a05('0x10')]);}})[_0x7a05('0x11')](function(_0x2350ba){logger['error'](_0x7a05('0xf'),_0x929e19,_0x2350ba);_0x3eb475(_0x2350ba);});});} \ No newline at end of file +var _0x475e=['jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4a8ce2,_0x4cd94e){var _0x38c265=function(_0x1fb277){while(--_0x1fb277){_0x4a8ce2['push'](_0x4a8ce2['shift']());}};_0x38c265(++_0x4cd94e);}(_0x475e,0x160));var _0xe475=function(_0x4b093a,_0x96977){_0x4b093a=_0x4b093a-0x0;var _0x5712f5=_0x475e[_0x4b093a];return _0x5712f5;};'use strict';var _=require(_0xe475('0x0'));var util=require(_0xe475('0x1'));var moment=require(_0xe475('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe475('0x3'));var db=require(_0xe475('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe475('0x5'))(_0xe475('0x6'));var config=require(_0xe475('0x7'));var jayson=require(_0xe475('0x8'));var client=jayson[_0xe475('0x9')][_0xe475('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c62a,_0x52cd72,_0x3ab43c){return new BPromise(function(_0x193a7e,_0xce8cac){return client['request'](_0x56c62a,_0x3ab43c)['then'](function(_0x15a174){logger[_0xe475('0xb')](_0xe475('0xc'),_0x52cd72,'request\x20sent');logger[_0xe475('0xd')](_0xe475('0xe'),_0x52cd72,_0xe475('0xf'),JSON[_0xe475('0x10')](_0x15a174));if(_0x15a174[_0xe475('0x11')]){if(_0x15a174[_0xe475('0x11')]['code']===0x1f4){logger[_0xe475('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x52cd72,_0x15a174['error'][_0xe475('0x12')]);return _0xce8cac(_0x15a174['error']['message']);}logger[_0xe475('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x52cd72,_0x15a174[_0xe475('0x11')][_0xe475('0x12')]);return _0x193a7e(_0x15a174[_0xe475('0x11')]['message']);}else{logger[_0xe475('0xb')](_0xe475('0xc'),_0x52cd72,_0xe475('0xf'));_0x193a7e(_0x15a174['result'][_0xe475('0x12')]);}})[_0xe475('0x13')](function(_0x3464d7){logger[_0xe475('0x11')](_0xe475('0xc'),_0x52cd72,_0x3464d7);_0xce8cac(_0x3464d7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 25de4b1..8391651 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 _0xfee5=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','update','delete','destroy','exports','path'];(function(_0x230227,_0x59cfc4){var _0x5ce780=function(_0x40e585){while(--_0x40e585){_0x230227['push'](_0x230227['shift']());}};_0x5ce780(++_0x59cfc4);}(_0xfee5,0x10f));var _0x5fee=function(_0x4f3678,_0x4c4bf3){_0x4f3678=_0x4f3678-0x0;var _0x46f59e=_0xfee5[_0x4f3678];return _0x46f59e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5fee('0x0'));var timeout=require(_0x5fee('0x1'));var express=require(_0x5fee('0x2'));var router=express[_0x5fee('0x3')]();var fs_extra=require(_0x5fee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5fee('0x5'));var config=require(_0x5fee('0x6'));var controller=require('./intVtigerField.controller');router[_0x5fee('0x7')]('/',auth['isAuthenticated'](),controller[_0x5fee('0x8')]);router['get'](_0x5fee('0x9'),auth[_0x5fee('0xa')](),controller[_0x5fee('0xb')]);router[_0x5fee('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x5fee('0xa')](),controller[_0x5fee('0xd')]);router[_0x5fee('0xe')]('/:id',auth[_0x5fee('0xa')](),controller[_0x5fee('0xf')]);module[_0x5fee('0x10')]=router; \ No newline at end of file +var _0x0a22=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x82885d,_0x4bdfbd){var _0x39c9b9=function(_0x1f3365){while(--_0x1f3365){_0x82885d['push'](_0x82885d['shift']());}};_0x39c9b9(++_0x4bdfbd);}(_0x0a22,0x1eb));var _0x20a2=function(_0x4336a6,_0x1bb68b){_0x4336a6=_0x4336a6-0x0;var _0x2331c8=_0x0a22[_0x4336a6];return _0x2331c8;};'use strict';var multer=require(_0x20a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x20a2('0x1'));var express=require(_0x20a2('0x2'));var router=express[_0x20a2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x20a2('0x4'));var interaction=require(_0x20a2('0x5'));var config=require(_0x20a2('0x6'));var controller=require(_0x20a2('0x7'));router[_0x20a2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x20a2('0x8')](_0x20a2('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x20a2('0xa')](),controller[_0x20a2('0xb')]);router[_0x20a2('0xc')]('/:id',auth[_0x20a2('0xa')](),controller[_0x20a2('0xd')]);router[_0x20a2('0xe')](_0x20a2('0x9'),auth[_0x20a2('0xa')](),controller[_0x20a2('0xf')]);module[_0x20a2('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 3f054b6..42d1614 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 _0x4a72=['keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x4a72,0x1d1));var _0x24a7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4a72[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x24a7('0x0'));module[_0x24a7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x24a7('0x2'),_0x24a7('0x3'),_0x24a7('0x4'),_0x24a7('0x5'),_0x24a7('0x6')),'defaultValue':_0x24a7('0x2')},'content':{'type':Sequelize[_0x24a7('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x24a7('0x8')](_0x24a7('0x2'),_0x24a7('0x3'),_0x24a7('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x24a7('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x24a7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x24a7('0x7')]}}; \ No newline at end of file +var _0x5aea=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x1b4326,_0x5eef0e){var _0x53999e=function(_0x235bd0){while(--_0x235bd0){_0x1b4326['push'](_0x1b4326['shift']());}};_0x53999e(++_0x5eef0e);}(_0x5aea,0x198));var _0xa5ae=function(_0x30bec1,_0x2c0639){_0x30bec1=_0x30bec1-0x0;var _0x36ce28=_0x5aea[_0x30bec1];return _0x36ce28;};'use strict';var Sequelize=require(_0xa5ae('0x0'));module[_0xa5ae('0x1')]={'type':{'type':Sequelize[_0xa5ae('0x2')](_0xa5ae('0x3'),_0xa5ae('0x4'),_0xa5ae('0x5'),_0xa5ae('0x6'),_0xa5ae('0x7')),'defaultValue':_0xa5ae('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xa5ae('0x3'),_0xa5ae('0x4'),_0xa5ae('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa5ae('0x8')]},'nameField':{'type':Sequelize[_0xa5ae('0x8')]},'customField':{'type':Sequelize[_0xa5ae('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5ae('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d6574ca..dbb35b4 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 _0x3c8b=['include','rows','catch','params','rawAttributes','fields','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','destroy','end','stack','name','send','index','map','VtigerField','key','model','keys','query','intersection','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x2f5232,_0x58debd){var _0x46a04b=function(_0x298780){while(--_0x298780){_0x2f5232['push'](_0x2f5232['shift']());}};_0x46a04b(++_0x58debd);}(_0x3c8b,0x96));var _0xb3c8=function(_0xff4a41,_0x39cc00){_0xff4a41=_0xff4a41-0x0;var _0x75d316=_0x3c8b[_0xff4a41];return _0x75d316;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3c8('0x0'));var zipdir=require(_0xb3c8('0x1'));var jsonpatch=require(_0xb3c8('0x2'));var rp=require(_0xb3c8('0x3'));var moment=require('moment');var BPromise=require(_0xb3c8('0x4'));var Mustache=require(_0xb3c8('0x5'));var util=require('util');var path=require(_0xb3c8('0x6'));var sox=require(_0xb3c8('0x7'));var csv=require('to-csv');var ejs=require(_0xb3c8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3c8('0x9'));var squel=require(_0xb3c8('0xa'));var crypto=require(_0xb3c8('0xb'));var jsforce=require(_0xb3c8('0xc'));var deskjs=require(_0xb3c8('0xd'));var toCsv=require(_0xb3c8('0xe'));var querystring=require(_0xb3c8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb3c8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3c8('0x11'));var logger=require(_0xb3c8('0x12'))(_0xb3c8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb3c8('0x14'));var db=require(_0xb3c8('0x15'))['db'];function respondWithStatusCode(_0x1a9ac7,_0xe2b671){_0xe2b671=_0xe2b671||0xcc;return function(_0x2084ea){if(_0x2084ea){return _0x1a9ac7[_0xb3c8('0x16')](_0xe2b671);}return _0x1a9ac7[_0xb3c8('0x17')](_0xe2b671)['end']();};}function respondWithResult(_0x37cb34,_0x1348ba){_0x1348ba=_0x1348ba||0xc8;return function(_0x13f803){if(_0x13f803){return _0x37cb34[_0xb3c8('0x17')](_0x1348ba)['json'](_0x13f803);}};}function respondWithFilteredResult(_0x345746,_0x3c5522){return function(_0x261c5c){if(_0x261c5c){var _0x4ea64d=typeof _0x3c5522[_0xb3c8('0x18')]==='undefined'&&typeof _0x3c5522[_0xb3c8('0x19')]===_0xb3c8('0x1a');var _0x2e799e=_0x261c5c[_0xb3c8('0x1b')];var _0x176162=_0x4ea64d?0x0:_0x3c5522[_0xb3c8('0x18')];var _0x2242c2=_0x4ea64d?_0x261c5c[_0xb3c8('0x1b')]:_0x3c5522['offset']+_0x3c5522[_0xb3c8('0x19')];var _0x3d2cc5;if(_0x2242c2>=_0x2e799e){_0x2242c2=_0x2e799e;_0x3d2cc5=0xc8;}else{_0x3d2cc5=0xce;}_0x345746['status'](_0x3d2cc5);return _0x345746[_0xb3c8('0x1c')]('Content-Range',_0x176162+'-'+_0x2242c2+'/'+_0x2e799e)[_0xb3c8('0x1d')](_0x261c5c);}return null;};}function patchUpdates(_0xb459da){return function(_0x5dcd8b){try{jsonpatch[_0xb3c8('0x1e')](_0x5dcd8b,_0xb459da,!![]);}catch(_0x3d9f89){return BPromise['reject'](_0x3d9f89);}return _0x5dcd8b[_0xb3c8('0x1f')]();};}function saveUpdates(_0x14c555,_0x32daf0){return function(_0x31c717){if(_0x31c717){return _0x31c717[_0xb3c8('0x20')](_0x14c555)[_0xb3c8('0x21')](function(_0x4f089a){return _0x4f089a;});}return null;};}function removeEntity(_0x585cea,_0x422b6b){return function(_0x351e21){if(_0x351e21){return _0x351e21[_0xb3c8('0x22')]()[_0xb3c8('0x21')](function(){_0x585cea[_0xb3c8('0x17')](0xcc)[_0xb3c8('0x23')]();});}};}function handleEntityNotFound(_0x42e3c0,_0xf002d1){return function(_0x4f4fa3){if(!_0x4f4fa3){_0x42e3c0['sendStatus'](0x194);}return _0x4f4fa3;};}function handleError(_0x1b7f5e,_0x2fbebd){_0x2fbebd=_0x2fbebd||0x1f4;return function(_0x44a692){logger['error'](_0x44a692[_0xb3c8('0x24')]);if(_0x44a692[_0xb3c8('0x25')]){delete _0x44a692[_0xb3c8('0x25')];}_0x1b7f5e['status'](_0x2fbebd)[_0xb3c8('0x26')](_0x44a692);};}exports[_0xb3c8('0x27')]=function(_0x24b05d,_0x262a3e){var _0x217887={},_0x4ed08f={},_0x465219={'count':0x0,'rows':[]};var _0x21ecdf=_[_0xb3c8('0x28')](db[_0xb3c8('0x29')]['rawAttributes'],function(_0x1e07f3){return{'name':_0x1e07f3['fieldName'],'type':_0x1e07f3['type'][_0xb3c8('0x2a')]};});_0x4ed08f[_0xb3c8('0x2b')]=_[_0xb3c8('0x28')](_0x21ecdf,_0xb3c8('0x25'));_0x4ed08f['query']=_[_0xb3c8('0x2c')](_0x24b05d[_0xb3c8('0x2d')]);_0x4ed08f['filters']=_[_0xb3c8('0x2e')](_0x4ed08f[_0xb3c8('0x2b')],_0x4ed08f[_0xb3c8('0x2d')]);_0x217887[_0xb3c8('0x2f')]=_[_0xb3c8('0x2e')](_0x4ed08f[_0xb3c8('0x2b')],qs['fields'](_0x24b05d[_0xb3c8('0x2d')]['fields']));_0x217887[_0xb3c8('0x2f')]=_0x217887[_0xb3c8('0x2f')]['length']?_0x217887[_0xb3c8('0x2f')]:_0x4ed08f[_0xb3c8('0x2b')];if(!_0x24b05d['query'][_0xb3c8('0x30')]('nolimit')){_0x217887[_0xb3c8('0x19')]=qs[_0xb3c8('0x19')](_0x24b05d[_0xb3c8('0x2d')][_0xb3c8('0x19')]);_0x217887[_0xb3c8('0x18')]=qs[_0xb3c8('0x18')](_0x24b05d[_0xb3c8('0x2d')][_0xb3c8('0x18')]);}_0x217887[_0xb3c8('0x31')]=qs['sort'](_0x24b05d[_0xb3c8('0x2d')][_0xb3c8('0x32')]);_0x217887[_0xb3c8('0x33')]=qs[_0xb3c8('0x34')](_[_0xb3c8('0x35')](_0x24b05d[_0xb3c8('0x2d')],_0x4ed08f[_0xb3c8('0x34')]),_0x21ecdf);if(_0x24b05d[_0xb3c8('0x2d')][_0xb3c8('0x36')]){_0x217887['where']=_[_0xb3c8('0x37')](_0x217887[_0xb3c8('0x33')],{'$or':_['map'](_0x21ecdf,function(_0x2bba96){if(_0x2bba96[_0xb3c8('0x38')]!==_0xb3c8('0x39')){var _0x597293={};_0x597293[_0x2bba96[_0xb3c8('0x25')]]={'$like':'%'+_0x24b05d[_0xb3c8('0x2d')][_0xb3c8('0x36')]+'%'};return _0x597293;}})});}_0x217887=_[_0xb3c8('0x37')]({},_0x217887,_0x24b05d[_0xb3c8('0x3a')]);var _0x386964={'where':_0x217887[_0xb3c8('0x33')]};return db['VtigerField'][_0xb3c8('0x1b')](_0x386964)['then'](function(_0x29fc9e){_0x465219['count']=_0x29fc9e;if(_0x24b05d['query'][_0xb3c8('0x3b')]){_0x217887[_0xb3c8('0x3c')]=[{'all':!![]}];}return db[_0xb3c8('0x29')]['findAll'](_0x217887);})['then'](function(_0x48a444){_0x465219[_0xb3c8('0x3d')]=_0x48a444;return _0x465219;})['then'](respondWithFilteredResult(_0x262a3e,_0x217887))[_0xb3c8('0x3e')](handleError(_0x262a3e,null));};exports['show']=function(_0xe2bace,_0x1f74be){var _0x127fc5={'raw':!![],'where':{'id':_0xe2bace[_0xb3c8('0x3f')]['id']}},_0x21e3c2={};_0x21e3c2[_0xb3c8('0x2b')]=_['keys'](db['VtigerField'][_0xb3c8('0x40')]);_0x21e3c2[_0xb3c8('0x2d')]=_['keys'](_0xe2bace[_0xb3c8('0x2d')]);_0x21e3c2['filters']=_[_0xb3c8('0x2e')](_0x21e3c2[_0xb3c8('0x2b')],_0x21e3c2[_0xb3c8('0x2d')]);_0x127fc5[_0xb3c8('0x2f')]=_['intersection'](_0x21e3c2[_0xb3c8('0x2b')],qs[_0xb3c8('0x41')](_0xe2bace[_0xb3c8('0x2d')]['fields']));_0x127fc5[_0xb3c8('0x2f')]=_0x127fc5[_0xb3c8('0x2f')][_0xb3c8('0x42')]?_0x127fc5['attributes']:_0x21e3c2[_0xb3c8('0x2b')];if(_0xe2bace[_0xb3c8('0x2d')]['includeAll']){_0x127fc5['include']=[{'all':!![]}];}_0x127fc5=_[_0xb3c8('0x37')]({},_0x127fc5,_0xe2bace['options']);return db[_0xb3c8('0x29')][_0xb3c8('0x43')](_0x127fc5)[_0xb3c8('0x21')](handleEntityNotFound(_0x1f74be,null))[_0xb3c8('0x21')](respondWithResult(_0x1f74be,null))[_0xb3c8('0x3e')](handleError(_0x1f74be,null));};exports[_0xb3c8('0x44')]=function(_0x405f9e,_0x5f9a54){return db['VtigerField']['create'](_0x405f9e[_0xb3c8('0x45')],{})['then'](respondWithResult(_0x5f9a54,0xc9))[_0xb3c8('0x3e')](handleError(_0x5f9a54,null));};exports[_0xb3c8('0x20')]=function(_0x5ad19e,_0x32247e){if(_0x5ad19e[_0xb3c8('0x45')]['id']){delete _0x5ad19e[_0xb3c8('0x45')]['id'];}return db[_0xb3c8('0x29')][_0xb3c8('0x43')]({'where':{'id':_0x5ad19e['params']['id']}})['then'](handleEntityNotFound(_0x32247e,null))['then'](saveUpdates(_0x5ad19e[_0xb3c8('0x45')],null))[_0xb3c8('0x21')](respondWithResult(_0x32247e,null))[_0xb3c8('0x3e')](handleError(_0x32247e,null));};exports[_0xb3c8('0x22')]=function(_0x30a439,_0x13ee22){return db[_0xb3c8('0x29')][_0xb3c8('0x43')]({'where':{'id':_0x30a439[_0xb3c8('0x3f')]['id']}})[_0xb3c8('0x21')](handleEntityNotFound(_0x13ee22,null))[_0xb3c8('0x21')](removeEntity(_0x13ee22,null))[_0xb3c8('0x3e')](handleError(_0x13ee22,null));}; \ No newline at end of file +var _0xaa49=['ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','intersection','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaa49,0x1be));var _0x9aa4=function(_0x5979eb,_0x1d2730){_0x5979eb=_0x5979eb-0x0;var _0x574c6d=_0xaa49[_0x5979eb];return _0x574c6d;};'use strict';var emlformat=require(_0x9aa4('0x0'));var rimraf=require(_0x9aa4('0x1'));var zipdir=require(_0x9aa4('0x2'));var jsonpatch=require(_0x9aa4('0x3'));var rp=require(_0x9aa4('0x4'));var moment=require(_0x9aa4('0x5'));var BPromise=require(_0x9aa4('0x6'));var Mustache=require('mustache');var util=require(_0x9aa4('0x7'));var path=require(_0x9aa4('0x8'));var sox=require('sox');var csv=require(_0x9aa4('0x9'));var ejs=require(_0x9aa4('0xa'));var fs=require('fs');var fs_extra=require(_0x9aa4('0xb'));var _=require(_0x9aa4('0xc'));var squel=require(_0x9aa4('0xd'));var crypto=require('crypto');var jsforce=require(_0x9aa4('0xe'));var deskjs=require(_0x9aa4('0xf'));var toCsv=require(_0x9aa4('0x9'));var querystring=require('querystring');var Papa=require(_0x9aa4('0x10'));var Redis=require(_0x9aa4('0x11'));var authService=require(_0x9aa4('0x12'));var qs=require(_0x9aa4('0x13'));var as=require(_0x9aa4('0x14'));var hardwareService=require(_0x9aa4('0x15'));var logger=require(_0x9aa4('0x16'))(_0x9aa4('0x17'));var utils=require(_0x9aa4('0x18'));var config=require(_0x9aa4('0x19'));var licenseUtil=require(_0x9aa4('0x1a'));var db=require(_0x9aa4('0x1b'))['db'];function respondWithStatusCode(_0x52a10f,_0x5f33f0){_0x5f33f0=_0x5f33f0||0xcc;return function(_0x5ddab6){if(_0x5ddab6){return _0x52a10f[_0x9aa4('0x1c')](_0x5f33f0);}return _0x52a10f[_0x9aa4('0x1d')](_0x5f33f0)[_0x9aa4('0x1e')]();};}function respondWithResult(_0x2c9a57,_0x251495){_0x251495=_0x251495||0xc8;return function(_0x1f669a){if(_0x1f669a){return _0x2c9a57[_0x9aa4('0x1d')](_0x251495)[_0x9aa4('0x1f')](_0x1f669a);}};}function respondWithFilteredResult(_0x1dd579,_0xd6d4b0){return function(_0x330eb1){if(_0x330eb1){var _0x3c56a2=typeof _0xd6d4b0[_0x9aa4('0x20')]===_0x9aa4('0x21')&&typeof _0xd6d4b0[_0x9aa4('0x22')]===_0x9aa4('0x21');var _0x38b346=_0x330eb1[_0x9aa4('0x23')];var _0x4b8806=_0x3c56a2?0x0:_0xd6d4b0[_0x9aa4('0x20')];var _0x7f2348=_0x3c56a2?_0x330eb1[_0x9aa4('0x23')]:_0xd6d4b0[_0x9aa4('0x20')]+_0xd6d4b0[_0x9aa4('0x22')];var _0x4b75e7;if(_0x7f2348>=_0x38b346){_0x7f2348=_0x38b346;_0x4b75e7=0xc8;}else{_0x4b75e7=0xce;}_0x1dd579[_0x9aa4('0x1d')](_0x4b75e7);return _0x1dd579['set']('Content-Range',_0x4b8806+'-'+_0x7f2348+'/'+_0x38b346)[_0x9aa4('0x1f')](_0x330eb1);}return null;};}function patchUpdates(_0x40e705){return function(_0x115664){try{jsonpatch[_0x9aa4('0x24')](_0x115664,_0x40e705,!![]);}catch(_0x449ac2){return BPromise[_0x9aa4('0x25')](_0x449ac2);}return _0x115664[_0x9aa4('0x26')]();};}function saveUpdates(_0x419e89,_0x22916c){return function(_0x467778){if(_0x467778){return _0x467778[_0x9aa4('0x27')](_0x419e89)[_0x9aa4('0x28')](function(_0x539c33){return _0x539c33;});}return null;};}function removeEntity(_0x28f69d,_0x666dfb){return function(_0x4b55b0){if(_0x4b55b0){return _0x4b55b0[_0x9aa4('0x29')]()['then'](function(){_0x28f69d[_0x9aa4('0x1d')](0xcc)[_0x9aa4('0x1e')]();});}};}function handleEntityNotFound(_0x38ffc0,_0x46f256){return function(_0x43fc8a){if(!_0x43fc8a){_0x38ffc0[_0x9aa4('0x1c')](0x194);}return _0x43fc8a;};}function handleError(_0x1de803,_0x5e6582){_0x5e6582=_0x5e6582||0x1f4;return function(_0x2ac59f){logger[_0x9aa4('0x2a')](_0x2ac59f['stack']);if(_0x2ac59f[_0x9aa4('0x2b')]){delete _0x2ac59f[_0x9aa4('0x2b')];}_0x1de803[_0x9aa4('0x1d')](_0x5e6582)['send'](_0x2ac59f);};}exports[_0x9aa4('0x2c')]=function(_0x1d5d7c,_0x2af671){var _0x2d624e={},_0x42fe24={},_0x301ccd={'count':0x0,'rows':[]};var _0x3733c5=_['map'](db[_0x9aa4('0x2d')][_0x9aa4('0x2e')],function(_0x33dbde){return{'name':_0x33dbde[_0x9aa4('0x2f')],'type':_0x33dbde[_0x9aa4('0x30')][_0x9aa4('0x31')]};});_0x42fe24[_0x9aa4('0x32')]=_[_0x9aa4('0x33')](_0x3733c5,_0x9aa4('0x2b'));_0x42fe24[_0x9aa4('0x34')]=_[_0x9aa4('0x35')](_0x1d5d7c[_0x9aa4('0x34')]);_0x42fe24[_0x9aa4('0x36')]=_['intersection'](_0x42fe24[_0x9aa4('0x32')],_0x42fe24[_0x9aa4('0x34')]);_0x2d624e[_0x9aa4('0x37')]=_['intersection'](_0x42fe24[_0x9aa4('0x32')],qs['fields'](_0x1d5d7c[_0x9aa4('0x34')][_0x9aa4('0x38')]));_0x2d624e[_0x9aa4('0x37')]=_0x2d624e[_0x9aa4('0x37')][_0x9aa4('0x39')]?_0x2d624e[_0x9aa4('0x37')]:_0x42fe24['model'];if(!_0x1d5d7c[_0x9aa4('0x34')][_0x9aa4('0x3a')]('nolimit')){_0x2d624e[_0x9aa4('0x22')]=qs['limit'](_0x1d5d7c['query'][_0x9aa4('0x22')]);_0x2d624e[_0x9aa4('0x20')]=qs[_0x9aa4('0x20')](_0x1d5d7c[_0x9aa4('0x34')][_0x9aa4('0x20')]);}_0x2d624e['order']=qs[_0x9aa4('0x3b')](_0x1d5d7c[_0x9aa4('0x34')]['sort']);_0x2d624e[_0x9aa4('0x3c')]=qs[_0x9aa4('0x36')](_[_0x9aa4('0x3d')](_0x1d5d7c[_0x9aa4('0x34')],_0x42fe24['filters']),_0x3733c5);if(_0x1d5d7c['query']['filter']){_0x2d624e['where']=_[_0x9aa4('0x3e')](_0x2d624e[_0x9aa4('0x3c')],{'$or':_[_0x9aa4('0x33')](_0x3733c5,function(_0x5f3f03){if(_0x5f3f03['type']!==_0x9aa4('0x3f')){var _0x28428f={};_0x28428f[_0x5f3f03[_0x9aa4('0x2b')]]={'$like':'%'+_0x1d5d7c['query'][_0x9aa4('0x40')]+'%'};return _0x28428f;}})});}_0x2d624e=_[_0x9aa4('0x3e')]({},_0x2d624e,_0x1d5d7c['options']);var _0x3b0495={'where':_0x2d624e['where']};return db['VtigerField'][_0x9aa4('0x23')](_0x3b0495)['then'](function(_0x39feca){_0x301ccd[_0x9aa4('0x23')]=_0x39feca;if(_0x1d5d7c[_0x9aa4('0x34')][_0x9aa4('0x41')]){_0x2d624e[_0x9aa4('0x42')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x2d624e);})[_0x9aa4('0x28')](function(_0x4fd393){_0x301ccd[_0x9aa4('0x43')]=_0x4fd393;return _0x301ccd;})[_0x9aa4('0x28')](respondWithFilteredResult(_0x2af671,_0x2d624e))[_0x9aa4('0x44')](handleError(_0x2af671,null));};exports[_0x9aa4('0x45')]=function(_0x261d23,_0x18133e){var _0x3c9a9c={'raw':!![],'where':{'id':_0x261d23[_0x9aa4('0x46')]['id']}},_0x3f2454={};_0x3f2454[_0x9aa4('0x32')]=_['keys'](db[_0x9aa4('0x2d')][_0x9aa4('0x2e')]);_0x3f2454[_0x9aa4('0x34')]=_[_0x9aa4('0x35')](_0x261d23['query']);_0x3f2454[_0x9aa4('0x36')]=_[_0x9aa4('0x47')](_0x3f2454['model'],_0x3f2454['query']);_0x3c9a9c['attributes']=_[_0x9aa4('0x47')](_0x3f2454[_0x9aa4('0x32')],qs['fields'](_0x261d23[_0x9aa4('0x34')][_0x9aa4('0x38')]));_0x3c9a9c['attributes']=_0x3c9a9c[_0x9aa4('0x37')][_0x9aa4('0x39')]?_0x3c9a9c[_0x9aa4('0x37')]:_0x3f2454[_0x9aa4('0x32')];if(_0x261d23[_0x9aa4('0x34')]['includeAll']){_0x3c9a9c['include']=[{'all':!![]}];}_0x3c9a9c=_[_0x9aa4('0x3e')]({},_0x3c9a9c,_0x261d23[_0x9aa4('0x48')]);return db[_0x9aa4('0x2d')][_0x9aa4('0x49')](_0x3c9a9c)[_0x9aa4('0x28')](handleEntityNotFound(_0x18133e,null))[_0x9aa4('0x28')](respondWithResult(_0x18133e,null))[_0x9aa4('0x44')](handleError(_0x18133e,null));};exports[_0x9aa4('0x4a')]=function(_0xc790f5,_0x4d7d87){return db[_0x9aa4('0x2d')][_0x9aa4('0x4a')](_0xc790f5[_0x9aa4('0x4b')],{})[_0x9aa4('0x28')](respondWithResult(_0x4d7d87,0xc9))[_0x9aa4('0x44')](handleError(_0x4d7d87,null));};exports[_0x9aa4('0x27')]=function(_0x1ffacc,_0x3edeff){if(_0x1ffacc[_0x9aa4('0x4b')]['id']){delete _0x1ffacc[_0x9aa4('0x4b')]['id'];}return db[_0x9aa4('0x2d')][_0x9aa4('0x49')]({'where':{'id':_0x1ffacc[_0x9aa4('0x46')]['id']}})['then'](handleEntityNotFound(_0x3edeff,null))[_0x9aa4('0x28')](saveUpdates(_0x1ffacc[_0x9aa4('0x4b')],null))['then'](respondWithResult(_0x3edeff,null))[_0x9aa4('0x44')](handleError(_0x3edeff,null));};exports['destroy']=function(_0x1b75f8,_0x3a6d08){return db['VtigerField'][_0x9aa4('0x49')]({'where':{'id':_0x1b75f8[_0x9aa4('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a6d08,null))[_0x9aa4('0x28')](removeEntity(_0x3a6d08,null))[_0x9aa4('0x44')](handleError(_0x3a6d08,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bcc6c3f..0d2c262 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 _0x076d=['idField','FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','define','VtigerField','vtiger_unique_index'];(function(_0x15f917,_0x26ef6e){var _0x571326=function(_0x101f7c){while(--_0x101f7c){_0x15f917['push'](_0x15f917['shift']());}};_0x571326(++_0x26ef6e);}(_0x076d,0x1d6));var _0xd076=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x076d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd076('0x0'));var util=require('util');var logger=require(_0xd076('0x1'))(_0xd076('0x2'));var moment=require(_0xd076('0x3'));var BPromise=require('bluebird');var rp=require(_0xd076('0x4'));var fs=require('fs');var path=require(_0xd076('0x5'));var rimraf=require(_0xd076('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x2fd5dd,_0xa26631){return _0x2fd5dd[_0xd076('0x7')](_0xd076('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xd076('0x9'),'fields':[_0xd076('0xa'),_0xd076('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcfbb=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','../../config/logger','api','moment'];(function(_0x3da347,_0x1bafd2){var _0x3383dc=function(_0x5787ab){while(--_0x5787ab){_0x3da347['push'](_0x3da347['shift']());}};_0x3383dc(++_0x1bafd2);}(_0xcfbb,0x137));var _0xbcfb=function(_0xc68650,_0x258343){_0xc68650=_0xc68650-0x0;var _0x57bd40=_0xcfbb[_0xc68650];return _0x57bd40;};'use strict';var _=require('lodash');var util=require(_0xbcfb('0x0'));var logger=require(_0xbcfb('0x1'))(_0xbcfb('0x2'));var moment=require(_0xbcfb('0x3'));var BPromise=require(_0xbcfb('0x4'));var rp=require(_0xbcfb('0x5'));var fs=require('fs');var path=require(_0xbcfb('0x6'));var rimraf=require(_0xbcfb('0x7'));var config=require(_0xbcfb('0x8'));var attributes=require(_0xbcfb('0x9'));module['exports']=function(_0x4ebf19,_0x357955){return _0x4ebf19[_0xbcfb('0xa')](_0xbcfb('0xb'),attributes,{'tableName':_0xbcfb('0xc'),'paranoid':![],'indexes':[{'name':_0xbcfb('0xd'),'fields':['idField',_0xbcfb('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 ece49cd..8556e88 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 _0xabdb=['stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x351a3a,_0x26b064){var _0x523f7a=function(_0x122d70){while(--_0x122d70){_0x351a3a['push'](_0x351a3a['shift']());}};_0x523f7a(++_0x26b064);}(_0xabdb,0xbe));var _0xbabd=function(_0x12f9f7,_0x17aac7){_0x12f9f7=_0x12f9f7-0x0;var _0x22f3bd=_0xabdb[_0x12f9f7];return _0x22f3bd;};'use strict';var _=require('lodash');var util=require(_0xbabd('0x0'));var moment=require(_0xbabd('0x1'));var BPromise=require(_0xbabd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbabd('0x3'));var db=require(_0xbabd('0x4'))['db'];var utils=require(_0xbabd('0x5'));var logger=require(_0xbabd('0x6'))(_0xbabd('0x7'));var config=require('../../config/environment');var jayson=require(_0xbabd('0x8'));var client=jayson[_0xbabd('0x9')][_0xbabd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x127968,_0x2d1fa3,_0x1e1538){return new BPromise(function(_0x345d0d,_0x4d1ec2){return client['request'](_0x127968,_0x1e1538)[_0xbabd('0xb')](function(_0x5136bd){logger[_0xbabd('0xc')](_0xbabd('0xd'),_0x2d1fa3,_0xbabd('0xe'));logger[_0xbabd('0xf')](_0xbabd('0x10'),_0x2d1fa3,'request\x20sent',JSON[_0xbabd('0x11')](_0x5136bd));if(_0x5136bd[_0xbabd('0x12')]){if(_0x5136bd[_0xbabd('0x12')][_0xbabd('0x13')]===0x1f4){logger[_0xbabd('0x12')](_0xbabd('0xd'),_0x2d1fa3,_0x5136bd[_0xbabd('0x12')][_0xbabd('0x14')]);return _0x4d1ec2(_0x5136bd['error'][_0xbabd('0x14')]);}logger['error'](_0xbabd('0xd'),_0x2d1fa3,_0x5136bd[_0xbabd('0x12')][_0xbabd('0x14')]);return _0x345d0d(_0x5136bd[_0xbabd('0x12')]['message']);}else{logger[_0xbabd('0xc')](_0xbabd('0xd'),_0x2d1fa3,_0xbabd('0xe'));_0x345d0d(_0x5136bd[_0xbabd('0x15')][_0xbabd('0x14')]);}})[_0xbabd('0x16')](function(_0x21dfd7){logger['error'](_0xbabd('0xd'),_0x2d1fa3,_0x21dfd7);_0x4d1ec2(_0x21dfd7);});});} \ No newline at end of file +var _0x47f0=['client','request','info','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5b50af,_0x432375){var _0x386b39=function(_0x215c94){while(--_0x215c94){_0x5b50af['push'](_0x5b50af['shift']());}};_0x386b39(++_0x432375);}(_0x47f0,0xe7));var _0x047f=function(_0x45e5f2,_0xc803d0){_0x45e5f2=_0x45e5f2-0x0;var _0x333b0a=_0x47f0[_0x45e5f2];return _0x333b0a;};'use strict';var _=require(_0x047f('0x0'));var util=require(_0x047f('0x1'));var moment=require(_0x047f('0x2'));var BPromise=require(_0x047f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x047f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x047f('0x5'));var logger=require('../../config/logger')(_0x047f('0x6'));var config=require(_0x047f('0x7'));var jayson=require(_0x047f('0x8'));var client=jayson[_0x047f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x280c20,_0x2bcdee,_0x3b2cb6){return new BPromise(function(_0x2ee25d,_0x51f499){return client[_0x047f('0xa')](_0x280c20,_0x3b2cb6)['then'](function(_0x5e6439){logger[_0x047f('0xb')]('VtigerField,\x20%s,\x20%s',_0x2bcdee,'request\x20sent');logger['debug'](_0x047f('0xc'),_0x2bcdee,_0x047f('0xd'),JSON[_0x047f('0xe')](_0x5e6439));if(_0x5e6439[_0x047f('0xf')]){if(_0x5e6439['error']['code']===0x1f4){logger[_0x047f('0xf')](_0x047f('0x10'),_0x2bcdee,_0x5e6439[_0x047f('0xf')][_0x047f('0x11')]);return _0x51f499(_0x5e6439[_0x047f('0xf')]['message']);}logger[_0x047f('0xf')](_0x047f('0x10'),_0x2bcdee,_0x5e6439[_0x047f('0xf')][_0x047f('0x11')]);return _0x2ee25d(_0x5e6439[_0x047f('0xf')][_0x047f('0x11')]);}else{logger['info'](_0x047f('0x10'),_0x2bcdee,_0x047f('0xd'));_0x2ee25d(_0x5e6439[_0x047f('0x12')][_0x047f('0x11')]);}})[_0x047f('0x13')](function(_0x1cad4b){logger[_0x047f('0xf')]('VtigerField,\x20%s,\x20%s',_0x2bcdee,_0x1cad4b);_0x51f499(_0x1cad4b);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 1ebf618..5b6b759 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 _0xac4b=['/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xac4b,0x145));var _0xbac4=function(_0x4c36ac,_0x342bb5){_0x4c36ac=_0x4c36ac-0x0;var _0x5096ed=_0xac4b[_0x4c36ac];return _0x5096ed;};'use strict';var multer=require(_0xbac4('0x0'));var util=require(_0xbac4('0x1'));var path=require(_0xbac4('0x2'));var timeout=require(_0xbac4('0x3'));var express=require(_0xbac4('0x4'));var router=express[_0xbac4('0x5')]();var fs_extra=require(_0xbac4('0x6'));var auth=require(_0xbac4('0x7'));var interaction=require(_0xbac4('0x8'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xbac4('0x9')]('/',auth[_0xbac4('0xa')](),controller[_0xbac4('0xb')]);router[_0xbac4('0x9')]('/:id',auth[_0xbac4('0xa')](),controller[_0xbac4('0xc')]);router[_0xbac4('0x9')](_0xbac4('0xd'),auth[_0xbac4('0xa')](),controller[_0xbac4('0xe')]);router[_0xbac4('0x9')]('/:id/fields',auth[_0xbac4('0xa')](),controller[_0xbac4('0xf')]);router[_0xbac4('0x10')]('/',auth[_0xbac4('0xa')](),controller[_0xbac4('0x11')]);router['post'](_0xbac4('0xd'),auth[_0xbac4('0xa')](),controller[_0xbac4('0x12')]);router[_0xbac4('0x13')](_0xbac4('0x14'),auth[_0xbac4('0xa')](),controller[_0xbac4('0x15')]);router['delete'](_0xbac4('0x14'),auth[_0xbac4('0xa')](),controller['destroy']);module[_0xbac4('0x16')]=router; \ No newline at end of file +var _0xd9d6=['./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x5c002b,_0x3ca3a9){var _0x1ce73b=function(_0x22275d){while(--_0x22275d){_0x5c002b['push'](_0x5c002b['shift']());}};_0x1ce73b(++_0x3ca3a9);}(_0xd9d6,0x19c));var _0x6d9d=function(_0x120c03,_0x1a8eab){_0x120c03=_0x120c03-0x0;var _0x2f04a8=_0xd9d6[_0x120c03];return _0x2f04a8;};'use strict';var multer=require(_0x6d9d('0x0'));var util=require(_0x6d9d('0x1'));var path=require('path');var timeout=require(_0x6d9d('0x2'));var express=require(_0x6d9d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d9d('0x4'));var config=require(_0x6d9d('0x5'));var controller=require(_0x6d9d('0x6'));router[_0x6d9d('0x7')]('/',auth[_0x6d9d('0x8')](),controller[_0x6d9d('0x9')]);router['get'](_0x6d9d('0xa'),auth[_0x6d9d('0x8')](),controller[_0x6d9d('0xb')]);router[_0x6d9d('0x7')](_0x6d9d('0xc'),auth['isAuthenticated'](),controller[_0x6d9d('0xd')]);router['get'](_0x6d9d('0xe'),auth[_0x6d9d('0x8')](),controller[_0x6d9d('0xf')]);router[_0x6d9d('0x10')]('/',auth['isAuthenticated'](),controller[_0x6d9d('0x11')]);router[_0x6d9d('0x10')](_0x6d9d('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x6d9d('0x12')](_0x6d9d('0xa'),auth['isAuthenticated'](),controller[_0x6d9d('0x13')]);router[_0x6d9d('0x14')]('/:id',auth[_0x6d9d('0x8')](),controller['destroy']);module[_0x6d9d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 1ce5072..332d982 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 _0xc0d7=['integrationTab','STRING','username','remoteUri','ENUM','password'];(function(_0x380af2,_0x36cf66){var _0x1789dc=function(_0x37b604){while(--_0x37b604){_0x380af2['push'](_0x380af2['shift']());}};_0x1789dc(++_0x36cf66);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x3859dc,_0x3840f3){_0x3859dc=_0x3859dc-0x0;var _0x2e6935=_0xc0d7[_0x3859dc];return _0x2e6935;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c0d('0x0')]},'username':{'type':Sequelize[_0x7c0d('0x0')],'unique':_0x7c0d('0x1')},'password':{'type':Sequelize[_0x7c0d('0x0')]},'token':{'type':Sequelize[_0x7c0d('0x0')]},'remoteUri':{'type':Sequelize[_0x7c0d('0x0')],'unique':_0x7c0d('0x2')},'authType':{'type':Sequelize[_0x7c0d('0x3')](_0x7c0d('0x4'),'token'),'defaultValue':_0x7c0d('0x4')},'serverUrl':{'type':Sequelize[_0x7c0d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x7c0d('0x3')](_0x7c0d('0x5'),'newTab'),'defaultValue':_0x7c0d('0x5')}}; \ No newline at end of file +var _0xc43c=['password','token','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x189796,_0x2ad6b2){var _0x1936f7=function(_0x31b704){while(--_0x31b704){_0x189796['push'](_0x189796['shift']());}};_0x1936f7(++_0x2ad6b2);}(_0xc43c,0xd4));var _0xcc43=function(_0x4c5e87,_0xe807b2){_0x4c5e87=_0x4c5e87-0x0;var _0x31f67c=_0xc43c[_0x4c5e87];return _0x31f67c;};'use strict';var Sequelize=require(_0xcc43('0x0'));module[_0xcc43('0x1')]={'name':{'type':Sequelize[_0xcc43('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xcc43('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xcc43('0x3')](_0xcc43('0x4'),_0xcc43('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xcc43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcc43('0x3')](_0xcc43('0x6'),_0xcc43('0x7')),'defaultValue':_0xcc43('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 658fb29..e8e82f9 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 _0x5c00=['getDescriptions','username','token','authType','remoteUri','slice','substring','GET','%s/%s','ticket_fields','password','%s:%s','toString','headers','format','Basic\x20%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','includes','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','reject','save','update','then','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','options','find','catch','create','body','destroy','params','getConfigurations','findOne','ZendeskConfiguration','AccountId','channel'];(function(_0x178f9c,_0x9dc87a){var _0x413f4a=function(_0xfe1042){while(--_0xfe1042){_0x178f9c['push'](_0x178f9c['shift']());}};_0x413f4a(++_0x9dc87a);}(_0x5c00,0x17e));var _0x05c0=function(_0x1dad4f,_0x13b837){_0x1dad4f=_0x1dad4f-0x0;var _0x22468b=_0x5c00[_0x1dad4f];return _0x22468b;};'use strict';var emlformat=require(_0x05c0('0x0'));var rimraf=require(_0x05c0('0x1'));var zipdir=require(_0x05c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c0('0x3'));var moment=require('moment');var BPromise=require(_0x05c0('0x4'));var Mustache=require(_0x05c0('0x5'));var util=require(_0x05c0('0x6'));var path=require(_0x05c0('0x7'));var sox=require('sox');var csv=require(_0x05c0('0x8'));var ejs=require(_0x05c0('0x9'));var fs=require('fs');var fs_extra=require(_0x05c0('0xa'));var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var licenseUtil=require(_0x05c0('0x17'));var db=require(_0x05c0('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e39d4,_0x5eec41){_0x5eec41=_0x5eec41||0xcc;return function(_0x16a290){if(_0x16a290){return _0x4e39d4[_0x05c0('0x19')](_0x5eec41);}return _0x4e39d4[_0x05c0('0x1a')](_0x5eec41)[_0x05c0('0x1b')]();};}function respondWithResult(_0x25764b,_0xe57ed0){_0xe57ed0=_0xe57ed0||0xc8;return function(_0x331799){if(_0x331799){return _0x25764b[_0x05c0('0x1a')](_0xe57ed0)['json'](_0x331799);}};}function respondWithFilteredResult(_0x238e25,_0x161a5f){return function(_0x4bb164){if(_0x4bb164){var _0x29e6b0=typeof _0x161a5f[_0x05c0('0x1c')]===_0x05c0('0x1d')&&typeof _0x161a5f[_0x05c0('0x1e')]===_0x05c0('0x1d');var _0x38f994=_0x4bb164['count'];var _0x422401=_0x29e6b0?0x0:_0x161a5f[_0x05c0('0x1c')];var _0x4613c0=_0x29e6b0?_0x4bb164['count']:_0x161a5f[_0x05c0('0x1c')]+_0x161a5f[_0x05c0('0x1e')];var _0x10685b;if(_0x4613c0>=_0x38f994){_0x4613c0=_0x38f994;_0x10685b=0xc8;}else{_0x10685b=0xce;}_0x238e25[_0x05c0('0x1a')](_0x10685b);return _0x238e25[_0x05c0('0x1f')]('Content-Range',_0x422401+'-'+_0x4613c0+'/'+_0x38f994)[_0x05c0('0x20')](_0x4bb164);}return null;};}function patchUpdates(_0x1014ef){return function(_0x5313b0){try{jsonpatch['apply'](_0x5313b0,_0x1014ef,!![]);}catch(_0x5e4b80){return BPromise[_0x05c0('0x21')](_0x5e4b80);}return _0x5313b0[_0x05c0('0x22')]();};}function saveUpdates(_0x83f29,_0x8e2d4){return function(_0x5b3acb){if(_0x5b3acb){return _0x5b3acb[_0x05c0('0x23')](_0x83f29)[_0x05c0('0x24')](function(_0x5b4eef){return _0x5b4eef;});}return null;};}function removeEntity(_0x9b4930,_0x1abbf3){return function(_0x4ba978){if(_0x4ba978){return _0x4ba978['destroy']()['then'](function(){_0x9b4930['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df135,_0x15b497){return function(_0x48b56f){if(!_0x48b56f){_0x3df135[_0x05c0('0x19')](0x194);}return _0x48b56f;};}function handleError(_0x336e1b,_0x3617dc){_0x3617dc=_0x3617dc||0x1f4;return function(_0x889c75){logger['error'](_0x889c75[_0x05c0('0x25')]);if(_0x889c75[_0x05c0('0x26')]){delete _0x889c75[_0x05c0('0x26')];}_0x336e1b[_0x05c0('0x1a')](_0x3617dc)[_0x05c0('0x27')](_0x889c75);};}exports[_0x05c0('0x28')]=function(_0x57886b,_0x56ba64){var _0x2df109={},_0xbe7d9e={},_0x2053d5={'count':0x0,'rows':[]};var _0xd6574e=_[_0x05c0('0x29')](db[_0x05c0('0x2a')][_0x05c0('0x2b')],function(_0x3c9eb1){return{'name':_0x3c9eb1[_0x05c0('0x2c')],'type':_0x3c9eb1[_0x05c0('0x2d')][_0x05c0('0x2e')]};});_0xbe7d9e[_0x05c0('0x2f')]=_['map'](_0xd6574e,'name');_0xbe7d9e[_0x05c0('0x30')]=_[_0x05c0('0x31')](_0x57886b[_0x05c0('0x30')]);_0xbe7d9e['filters']=_[_0x05c0('0x32')](_0xbe7d9e[_0x05c0('0x2f')],_0xbe7d9e['query']);_0x2df109[_0x05c0('0x33')]=_['intersection'](_0xbe7d9e[_0x05c0('0x2f')],qs[_0x05c0('0x34')](_0x57886b[_0x05c0('0x30')][_0x05c0('0x34')]));_0x2df109[_0x05c0('0x33')]=_0x2df109[_0x05c0('0x33')][_0x05c0('0x35')]?_0x2df109[_0x05c0('0x33')]:_0xbe7d9e[_0x05c0('0x2f')];if(!_0x57886b[_0x05c0('0x30')][_0x05c0('0x36')](_0x05c0('0x37'))){_0x2df109[_0x05c0('0x1e')]=qs[_0x05c0('0x1e')](_0x57886b[_0x05c0('0x30')][_0x05c0('0x1e')]);_0x2df109[_0x05c0('0x1c')]=qs[_0x05c0('0x1c')](_0x57886b[_0x05c0('0x30')][_0x05c0('0x1c')]);}_0x2df109[_0x05c0('0x38')]=qs[_0x05c0('0x39')](_0x57886b[_0x05c0('0x30')][_0x05c0('0x39')]);_0x2df109[_0x05c0('0x3a')]=qs[_0x05c0('0x3b')](_[_0x05c0('0x3c')](_0x57886b[_0x05c0('0x30')],_0xbe7d9e[_0x05c0('0x3b')]),_0xd6574e);if(_0x57886b[_0x05c0('0x30')][_0x05c0('0x3d')]){_0x2df109[_0x05c0('0x3a')]=_[_0x05c0('0x3e')](_0x2df109['where'],{'$or':_[_0x05c0('0x29')](_0xd6574e,function(_0x249101){if(_0x249101[_0x05c0('0x2d')]!==_0x05c0('0x3f')){var _0x49f829={};_0x49f829[_0x249101['name']]={'$like':'%'+_0x57886b[_0x05c0('0x30')][_0x05c0('0x3d')]+'%'};return _0x49f829;}})});}_0x2df109=_[_0x05c0('0x3e')]({},_0x2df109,_0x57886b['options']);var _0x29dc87={'where':_0x2df109[_0x05c0('0x3a')]};return db[_0x05c0('0x2a')][_0x05c0('0x40')](_0x29dc87)['then'](function(_0x152c6a){_0x2053d5[_0x05c0('0x40')]=_0x152c6a;if(_0x57886b['query'][_0x05c0('0x41')]){_0x2df109[_0x05c0('0x42')]=[{'all':!![]}];}return db[_0x05c0('0x2a')][_0x05c0('0x43')](_0x2df109);})[_0x05c0('0x24')](function(_0x398a6e){_0x2053d5[_0x05c0('0x44')]=_0x398a6e;return _0x2053d5;})['then'](respondWithFilteredResult(_0x56ba64,_0x2df109))['catch'](handleError(_0x56ba64,null));};exports[_0x05c0('0x45')]=function(_0x1d1d94,_0xaa5d53){var _0x11f079={'raw':![],'where':{'id':_0x1d1d94['params']['id']}},_0x14aba3={};_0x14aba3[_0x05c0('0x2f')]=_[_0x05c0('0x31')](db[_0x05c0('0x2a')][_0x05c0('0x2b')]);_0x14aba3[_0x05c0('0x30')]=_[_0x05c0('0x31')](_0x1d1d94[_0x05c0('0x30')]);_0x14aba3['filters']=_[_0x05c0('0x32')](_0x14aba3[_0x05c0('0x2f')],_0x14aba3[_0x05c0('0x30')]);_0x11f079[_0x05c0('0x33')]=_[_0x05c0('0x32')](_0x14aba3[_0x05c0('0x2f')],qs[_0x05c0('0x34')](_0x1d1d94[_0x05c0('0x30')][_0x05c0('0x34')]));_0x11f079[_0x05c0('0x33')]=_0x11f079[_0x05c0('0x33')]['length']?_0x11f079['attributes']:_0x14aba3[_0x05c0('0x2f')];if(_0x1d1d94[_0x05c0('0x30')][_0x05c0('0x41')]){_0x11f079[_0x05c0('0x42')]=[{'all':!![]}];}_0x11f079=_[_0x05c0('0x3e')]({},_0x11f079,_0x1d1d94[_0x05c0('0x46')]);return db['ZendeskAccount'][_0x05c0('0x47')](_0x11f079)[_0x05c0('0x24')](handleEntityNotFound(_0xaa5d53,null))[_0x05c0('0x24')](respondWithResult(_0xaa5d53,null))[_0x05c0('0x48')](handleError(_0xaa5d53,null));};exports['create']=function(_0x34e94e,_0x2440e8){return db[_0x05c0('0x2a')][_0x05c0('0x49')](_0x34e94e['body'],{})[_0x05c0('0x24')](respondWithResult(_0x2440e8,0xc9))[_0x05c0('0x48')](handleError(_0x2440e8,null));};exports[_0x05c0('0x23')]=function(_0x9b521b,_0x5ef6cf){if(_0x9b521b[_0x05c0('0x4a')]['id']){delete _0x9b521b[_0x05c0('0x4a')]['id'];}return db['ZendeskAccount'][_0x05c0('0x47')]({'where':{'id':_0x9b521b['params']['id']}})['then'](handleEntityNotFound(_0x5ef6cf,null))[_0x05c0('0x24')](saveUpdates(_0x9b521b['body'],null))[_0x05c0('0x24')](respondWithResult(_0x5ef6cf,null))[_0x05c0('0x48')](handleError(_0x5ef6cf,null));};exports[_0x05c0('0x4b')]=function(_0x371aff,_0x3ccae9){return db[_0x05c0('0x2a')]['find']({'where':{'id':_0x371aff[_0x05c0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ccae9,null))[_0x05c0('0x24')](removeEntity(_0x3ccae9,null))[_0x05c0('0x48')](handleError(_0x3ccae9,null));};exports[_0x05c0('0x4d')]=function(_0x13ad38,_0x1496d4,_0x37ad50){var _0x156087={};var _0x551b7b={};var _0x5215b4;var _0x523153;return db[_0x05c0('0x2a')][_0x05c0('0x4e')]({'where':{'id':_0x13ad38['params']['id']}})['then'](handleEntityNotFound(_0x1496d4,null))[_0x05c0('0x24')](function(_0x1a72d6){if(_0x1a72d6){_0x5215b4=_0x1a72d6;_0x551b7b[_0x05c0('0x2f')]=_[_0x05c0('0x31')](db[_0x05c0('0x4f')][_0x05c0('0x2b')]);_0x551b7b[_0x05c0('0x30')]=_['keys'](_0x13ad38[_0x05c0('0x30')]);_0x551b7b[_0x05c0('0x3b')]=_[_0x05c0('0x32')](_0x551b7b[_0x05c0('0x2f')],_0x551b7b['query']);_0x156087[_0x05c0('0x33')]=_['intersection'](_0x551b7b[_0x05c0('0x2f')],qs[_0x05c0('0x34')](_0x13ad38['query'][_0x05c0('0x34')]));_0x156087['attributes']=_0x156087[_0x05c0('0x33')][_0x05c0('0x35')]?_0x156087[_0x05c0('0x33')]:_0x551b7b[_0x05c0('0x2f')];_0x156087[_0x05c0('0x38')]=qs[_0x05c0('0x39')](_0x13ad38['query'][_0x05c0('0x39')]);_0x156087[_0x05c0('0x3a')]=qs[_0x05c0('0x3b')](_[_0x05c0('0x3c')](_0x13ad38[_0x05c0('0x30')],_0x551b7b[_0x05c0('0x3b')]));if(_0x13ad38['query'][_0x05c0('0x3d')]){_0x156087[_0x05c0('0x3a')]=_[_0x05c0('0x3e')](_0x156087[_0x05c0('0x3a')],{'$or':_[_0x05c0('0x29')](_0x156087[_0x05c0('0x33')],function(_0xf5e123){var _0x866523={};_0x866523[_0xf5e123]={'$like':'%'+_0x13ad38[_0x05c0('0x30')][_0x05c0('0x3d')]+'%'};return _0x866523;})});}_0x156087=_[_0x05c0('0x3e')]({},_0x156087,_0x13ad38[_0x05c0('0x46')]);return _0x5215b4['getConfigurations'](_0x156087);}})['then'](function(_0x5269b4){if(_0x5269b4){_0x523153=_0x5269b4[_0x05c0('0x35')];if(!_0x13ad38[_0x05c0('0x30')][_0x05c0('0x36')]('nolimit')){_0x156087[_0x05c0('0x1e')]=qs[_0x05c0('0x1e')](_0x13ad38[_0x05c0('0x30')][_0x05c0('0x1e')]);_0x156087[_0x05c0('0x1c')]=qs[_0x05c0('0x1c')](_0x13ad38[_0x05c0('0x30')]['offset']);}return _0x5215b4[_0x05c0('0x4d')](_0x156087);}})[_0x05c0('0x24')](function(_0x355b44){if(_0x355b44){return _0x355b44?{'count':_0x523153,'rows':_0x355b44}:null;}})[_0x05c0('0x24')](respondWithResult(_0x1496d4,null))['catch'](handleError(_0x1496d4,null));};exports['addConfiguration']=function(_0x5e4941,_0x3b74c5,_0x2b8a13){if(_0x5e4941[_0x05c0('0x4a')]['id']){delete _0x5e4941[_0x05c0('0x4a')]['id'];}return db[_0x05c0('0x2a')][_0x05c0('0x4e')]({'where':{'id':_0x5e4941[_0x05c0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b74c5,null))[_0x05c0('0x24')](function(_0x225397){if(_0x225397){_0x5e4941[_0x05c0('0x4a')][_0x05c0('0x50')]=_0x225397['id'];_0x5e4941[_0x05c0('0x4a')]['Subjects']=integrations['getSubjects'](_0x5e4941[_0x05c0('0x4a')][_0x05c0('0x51')],_0x5e4941['body'][_0x05c0('0x2d')]);_0x5e4941['body']['Descriptions']=integrations[_0x05c0('0x52')](_0x5e4941[_0x05c0('0x4a')][_0x05c0('0x51')],_0x5e4941['body']['type']);return db[_0x05c0('0x4f')][_0x05c0('0x49')](_0x5e4941[_0x05c0('0x4a')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3b74c5,null))[_0x05c0('0x48')](handleError(_0x3b74c5,null));};exports['getFields']=function(_0x496acf,_0x5bb9ef,_0xd7a2f3){var _0x1a6dc4='';return db[_0x05c0('0x2a')]['findOne']({'where':{'id':_0x496acf[_0x05c0('0x4c')]['id']},'attributes':['id',_0x05c0('0x53'),'password',_0x05c0('0x54'),_0x05c0('0x55'),_0x05c0('0x56')]})[_0x05c0('0x24')](handleEntityNotFound(_0x5bb9ef,null))['then'](function(_0x35ef76){if(_0x35ef76){_0x1a6dc4=_0x35ef76[_0x05c0('0x56')];var _0xc150e3=_0x1a6dc4[_0x05c0('0x57')](-0x1);if(_0xc150e3==='/'){_0x1a6dc4=_0x1a6dc4[_0x05c0('0x58')](0x0,_0x1a6dc4['lastIndexOf'](_0xc150e3));}var _0x4aee38={'method':_0x05c0('0x59'),'uri':util['format'](_0x05c0('0x5a'),_0x1a6dc4,_0x05c0('0x5b')),'json':!![]};switch(_0x35ef76['authType']){case _0x05c0('0x5c'):_0x4aee38['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x05c0('0x5d'),_0x35ef76[_0x05c0('0x53')],_0x35ef76[_0x05c0('0x5c')]))[_0x05c0('0x5e')]('base64'))};break;case _0x05c0('0x54'):_0x4aee38[_0x05c0('0x5f')]={'Authorization':util[_0x05c0('0x60')](_0x05c0('0x61'),new Buffer(util[_0x05c0('0x60')]('%s/token:%s',_0x35ef76[_0x05c0('0x53')],_0x35ef76['token']))['toString'](_0x05c0('0x62')))};break;default:throw new db[(_0x05c0('0x63'))][(_0x05c0('0x64'))](_0x05c0('0x65'));}return rp(_0x4aee38);}})[_0x05c0('0x24')](function(_0x4577ee){if(_0x4577ee){var _0x4c3c73=['subject',_0x05c0('0x66'),_0x05c0('0x67'),_0x05c0('0x68')];_['remove'](_0x4577ee[_0x05c0('0x5b')],function(_0x7c5ce6){return _0x4c3c73[_0x05c0('0x69')](_0x7c5ce6[_0x05c0('0x2d')]);});return{'count':_0x4577ee[_0x05c0('0x5b')][_0x05c0('0x35')],'rows':_['map'](_0x4577ee[_0x05c0('0x5b')],function(_0x464ae0){return{'id':_0x464ae0['id'],'name':_0x464ae0['position']>0x7?_0x464ae0[_0x05c0('0x6a')]:_0x464ae0[_0x05c0('0x2d')],'custom':_0x464ae0['position']>0x7?!![]:![],'options':_0x464ae0[_0x05c0('0x6b')]?_0x464ae0[_0x05c0('0x6b')]:_0x464ae0[_0x05c0('0x6c')]?_0x464ae0[_0x05c0('0x6c')]:[]};})};}})[_0x05c0('0x24')](respondWithResult(_0x5bb9ef,null))[_0x05c0('0x48')](function(_0x544d6c){var _0x63f20=_0x496acf['query'][_0x05c0('0x6d')]?0x1f4:_0x544d6c[_0x05c0('0x6e')]||0x1f4;logger[_0x05c0('0x6f')](_0x05c0('0x70'),_0x05c0('0x71'),_0x63f20,JSON[_0x05c0('0x72')](_0x544d6c));delete _0x544d6c[_0x05c0('0x26')];if(_0x63f20===0x191){_0x63f20=0x190;}_0x5bb9ef[_0x05c0('0x1a')](_0x63f20)[_0x05c0('0x27')](_0x496acf[_0x05c0('0x30')]['test']?{'message':_0x05c0('0x73'),'statusCode':_0x544d6c['statusCode']}:_0x544d6c);});}; \ No newline at end of file +var _0xa902=['%s:%s','base64','%s/token:%s','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','destroy','then','end','error','stack','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','sort','map','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','findOne','username','password','remoteUri','slice','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s'];(function(_0x5e4e3b,_0x411edc){var _0x1bb015=function(_0x458438){while(--_0x458438){_0x5e4e3b['push'](_0x5e4e3b['shift']());}};_0x1bb015(++_0x411edc);}(_0xa902,0x8d));var _0x2a90=function(_0x524f4a,_0x49d5a2){_0x524f4a=_0x524f4a-0x0;var _0x417848=_0xa902[_0x524f4a];return _0x417848;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f6953,_0x57aee3){_0x57aee3=_0x57aee3||0xcc;return function(_0x407ce5){if(_0x407ce5){return _0x1f6953[_0x2a90('0x17')](_0x57aee3);}return _0x1f6953[_0x2a90('0x18')](_0x57aee3)['end']();};}function respondWithResult(_0x56d1b8,_0x57227c){_0x57227c=_0x57227c||0xc8;return function(_0x46cb32){if(_0x46cb32){return _0x56d1b8[_0x2a90('0x18')](_0x57227c)['json'](_0x46cb32);}};}function respondWithFilteredResult(_0x1ff63d,_0x21c648){return function(_0x312782){if(_0x312782){var _0x25bd0e=typeof _0x21c648[_0x2a90('0x19')]===_0x2a90('0x1a')&&typeof _0x21c648[_0x2a90('0x1b')]===_0x2a90('0x1a');var _0x43eea5=_0x312782['count'];var _0x162f0b=_0x25bd0e?0x0:_0x21c648[_0x2a90('0x19')];var _0x4190ff=_0x25bd0e?_0x312782['count']:_0x21c648[_0x2a90('0x19')]+_0x21c648[_0x2a90('0x1b')];var _0x148d18;if(_0x4190ff>=_0x43eea5){_0x4190ff=_0x43eea5;_0x148d18=0xc8;}else{_0x148d18=0xce;}_0x1ff63d[_0x2a90('0x18')](_0x148d18);return _0x1ff63d[_0x2a90('0x1c')](_0x2a90('0x1d'),_0x162f0b+'-'+_0x4190ff+'/'+_0x43eea5)[_0x2a90('0x1e')](_0x312782);}return null;};}function patchUpdates(_0x114d42){return function(_0xf97adb){try{jsonpatch[_0x2a90('0x1f')](_0xf97adb,_0x114d42,!![]);}catch(_0x1340b9){return BPromise[_0x2a90('0x20')](_0x1340b9);}return _0xf97adb['save']();};}function saveUpdates(_0x3da7d0,_0x217873){return function(_0x2955a9){if(_0x2955a9){return _0x2955a9[_0x2a90('0x21')](_0x3da7d0)['then'](function(_0x180485){return _0x180485;});}return null;};}function removeEntity(_0xd033d,_0x4ed9e6){return function(_0x1bcfd7){if(_0x1bcfd7){return _0x1bcfd7[_0x2a90('0x22')]()[_0x2a90('0x23')](function(){_0xd033d[_0x2a90('0x18')](0xcc)[_0x2a90('0x24')]();});}};}function handleEntityNotFound(_0x1303d9,_0x29ed73){return function(_0x24a6d3){if(!_0x24a6d3){_0x1303d9['sendStatus'](0x194);}return _0x24a6d3;};}function handleError(_0x27f883,_0x17f978){_0x17f978=_0x17f978||0x1f4;return function(_0x3934d4){logger[_0x2a90('0x25')](_0x3934d4[_0x2a90('0x26')]);if(_0x3934d4['name']){delete _0x3934d4['name'];}_0x27f883[_0x2a90('0x18')](_0x17f978)['send'](_0x3934d4);};}exports['index']=function(_0x4969c3,_0x2d83b3){var _0x3c78f5={},_0x595638={},_0x5bd700={'count':0x0,'rows':[]};var _0x1add9a=_['map'](db[_0x2a90('0x27')][_0x2a90('0x28')],function(_0x3b580f){return{'name':_0x3b580f[_0x2a90('0x29')],'type':_0x3b580f[_0x2a90('0x2a')][_0x2a90('0x2b')]};});_0x595638[_0x2a90('0x2c')]=_['map'](_0x1add9a,_0x2a90('0x2d'));_0x595638[_0x2a90('0x2e')]=_[_0x2a90('0x2f')](_0x4969c3['query']);_0x595638[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0x595638[_0x2a90('0x2c')],_0x595638[_0x2a90('0x2e')]);_0x3c78f5['attributes']=_[_0x2a90('0x31')](_0x595638[_0x2a90('0x2c')],qs[_0x2a90('0x32')](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x32')]));_0x3c78f5[_0x2a90('0x33')]=_0x3c78f5['attributes'][_0x2a90('0x34')]?_0x3c78f5[_0x2a90('0x33')]:_0x595638[_0x2a90('0x2c')];if(!_0x4969c3[_0x2a90('0x2e')]['hasOwnProperty'](_0x2a90('0x35'))){_0x3c78f5[_0x2a90('0x1b')]=qs['limit'](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x1b')]);_0x3c78f5['offset']=qs['offset'](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x19')]);}_0x3c78f5[_0x2a90('0x36')]=qs['sort'](_0x4969c3[_0x2a90('0x2e')]['sort']);_0x3c78f5[_0x2a90('0x37')]=qs['filters'](_[_0x2a90('0x38')](_0x4969c3['query'],_0x595638['filters']),_0x1add9a);if(_0x4969c3[_0x2a90('0x2e')]['filter']){_0x3c78f5[_0x2a90('0x37')]=_[_0x2a90('0x39')](_0x3c78f5[_0x2a90('0x37')],{'$or':_['map'](_0x1add9a,function(_0x57a2a5){if(_0x57a2a5[_0x2a90('0x2a')]!==_0x2a90('0x3a')){var _0x4eb7d9={};_0x4eb7d9[_0x57a2a5[_0x2a90('0x2d')]]={'$like':'%'+_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x3b')]+'%'};return _0x4eb7d9;}})});}_0x3c78f5=_['merge']({},_0x3c78f5,_0x4969c3[_0x2a90('0x3c')]);var _0x1db9d8={'where':_0x3c78f5['where']};return db[_0x2a90('0x27')][_0x2a90('0x3d')](_0x1db9d8)[_0x2a90('0x23')](function(_0x28f289){_0x5bd700[_0x2a90('0x3d')]=_0x28f289;if(_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x3e')]){_0x3c78f5[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x27')][_0x2a90('0x40')](_0x3c78f5);})[_0x2a90('0x23')](function(_0x3dba8a){_0x5bd700[_0x2a90('0x41')]=_0x3dba8a;return _0x5bd700;})[_0x2a90('0x23')](respondWithFilteredResult(_0x2d83b3,_0x3c78f5))['catch'](handleError(_0x2d83b3,null));};exports[_0x2a90('0x42')]=function(_0x3a70fe,_0x528b41){var _0x1045bb={'raw':![],'where':{'id':_0x3a70fe[_0x2a90('0x43')]['id']}},_0x1e971c={};_0x1e971c[_0x2a90('0x2c')]=_[_0x2a90('0x2f')](db['ZendeskAccount'][_0x2a90('0x28')]);_0x1e971c['query']=_[_0x2a90('0x2f')](_0x3a70fe['query']);_0x1e971c[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0x1e971c[_0x2a90('0x2c')],_0x1e971c[_0x2a90('0x2e')]);_0x1045bb[_0x2a90('0x33')]=_[_0x2a90('0x31')](_0x1e971c[_0x2a90('0x2c')],qs['fields'](_0x3a70fe['query'][_0x2a90('0x32')]));_0x1045bb[_0x2a90('0x33')]=_0x1045bb[_0x2a90('0x33')][_0x2a90('0x34')]?_0x1045bb[_0x2a90('0x33')]:_0x1e971c[_0x2a90('0x2c')];if(_0x3a70fe[_0x2a90('0x2e')][_0x2a90('0x3e')]){_0x1045bb['include']=[{'all':!![]}];}_0x1045bb=_[_0x2a90('0x39')]({},_0x1045bb,_0x3a70fe['options']);return db[_0x2a90('0x27')][_0x2a90('0x44')](_0x1045bb)['then'](handleEntityNotFound(_0x528b41,null))[_0x2a90('0x23')](respondWithResult(_0x528b41,null))[_0x2a90('0x45')](handleError(_0x528b41,null));};exports[_0x2a90('0x46')]=function(_0x1d55db,_0x175d59){return db[_0x2a90('0x27')][_0x2a90('0x46')](_0x1d55db['body'],{})['then'](respondWithResult(_0x175d59,0xc9))[_0x2a90('0x45')](handleError(_0x175d59,null));};exports[_0x2a90('0x21')]=function(_0x42c890,_0x43266a){if(_0x42c890[_0x2a90('0x47')]['id']){delete _0x42c890['body']['id'];}return db['ZendeskAccount'][_0x2a90('0x44')]({'where':{'id':_0x42c890[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x43266a,null))['then'](saveUpdates(_0x42c890['body'],null))[_0x2a90('0x23')](respondWithResult(_0x43266a,null))['catch'](handleError(_0x43266a,null));};exports[_0x2a90('0x22')]=function(_0x3dfe72,_0x272d07){return db[_0x2a90('0x27')][_0x2a90('0x44')]({'where':{'id':_0x3dfe72[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x272d07,null))[_0x2a90('0x23')](removeEntity(_0x272d07,null))[_0x2a90('0x45')](handleError(_0x272d07,null));};exports['getConfigurations']=function(_0x265769,_0x4d1303,_0x4c8bae){var _0x46f687={};var _0xe47c6b={};var _0x5819ab;var _0x4c0cb2;return db[_0x2a90('0x27')]['findOne']({'where':{'id':_0x265769[_0x2a90('0x43')]['id']}})[_0x2a90('0x23')](handleEntityNotFound(_0x4d1303,null))['then'](function(_0x366429){if(_0x366429){_0x5819ab=_0x366429;_0xe47c6b[_0x2a90('0x2c')]=_[_0x2a90('0x2f')](db['ZendeskConfiguration'][_0x2a90('0x28')]);_0xe47c6b[_0x2a90('0x2e')]=_['keys'](_0x265769['query']);_0xe47c6b[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0xe47c6b['model'],_0xe47c6b[_0x2a90('0x2e')]);_0x46f687['attributes']=_[_0x2a90('0x31')](_0xe47c6b['model'],qs[_0x2a90('0x32')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x32')]));_0x46f687['attributes']=_0x46f687['attributes']['length']?_0x46f687[_0x2a90('0x33')]:_0xe47c6b[_0x2a90('0x2c')];_0x46f687[_0x2a90('0x36')]=qs[_0x2a90('0x48')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x48')]);_0x46f687[_0x2a90('0x37')]=qs[_0x2a90('0x30')](_[_0x2a90('0x38')](_0x265769[_0x2a90('0x2e')],_0xe47c6b[_0x2a90('0x30')]));if(_0x265769[_0x2a90('0x2e')][_0x2a90('0x3b')]){_0x46f687['where']=_['merge'](_0x46f687['where'],{'$or':_[_0x2a90('0x49')](_0x46f687[_0x2a90('0x33')],function(_0x13270d){var _0x400aca={};_0x400aca[_0x13270d]={'$like':'%'+_0x265769[_0x2a90('0x2e')][_0x2a90('0x3b')]+'%'};return _0x400aca;})});}_0x46f687=_[_0x2a90('0x39')]({},_0x46f687,_0x265769[_0x2a90('0x3c')]);return _0x5819ab[_0x2a90('0x4a')](_0x46f687);}})[_0x2a90('0x23')](function(_0x50973b){if(_0x50973b){_0x4c0cb2=_0x50973b[_0x2a90('0x34')];if(!_0x265769[_0x2a90('0x2e')][_0x2a90('0x4b')](_0x2a90('0x35'))){_0x46f687[_0x2a90('0x1b')]=qs['limit'](_0x265769[_0x2a90('0x2e')]['limit']);_0x46f687[_0x2a90('0x19')]=qs[_0x2a90('0x19')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x19')]);}return _0x5819ab[_0x2a90('0x4a')](_0x46f687);}})[_0x2a90('0x23')](function(_0x44b211){if(_0x44b211){return _0x44b211?{'count':_0x4c0cb2,'rows':_0x44b211}:null;}})['then'](respondWithResult(_0x4d1303,null))[_0x2a90('0x45')](handleError(_0x4d1303,null));};exports[_0x2a90('0x4c')]=function(_0xf88bbb,_0x48f9fa,_0xa1234a){if(_0xf88bbb[_0x2a90('0x47')]['id']){delete _0xf88bbb[_0x2a90('0x47')]['id'];}return db[_0x2a90('0x27')]['findOne']({'where':{'id':_0xf88bbb[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x48f9fa,null))[_0x2a90('0x23')](function(_0x94e9fb){if(_0x94e9fb){_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4d')]=_0x94e9fb['id'];_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4e')]=integrations['getSubjects'](_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4f')],_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x2a')]);_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x50')]=integrations[_0x2a90('0x51')](_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4f')],_0xf88bbb['body'][_0x2a90('0x2a')]);return db[_0x2a90('0x52')][_0x2a90('0x46')](_0xf88bbb['body'],{'include':[{'model':db[_0x2a90('0x53')],'as':_0x2a90('0x4e')},{'model':db[_0x2a90('0x53')],'as':_0x2a90('0x50')}]});}return null;})[_0x2a90('0x23')](respondWithResult(_0x48f9fa,null))['catch'](handleError(_0x48f9fa,null));};exports[_0x2a90('0x54')]=function(_0x5e0bf2,_0x5a770b,_0x9fafd){var _0x4e1dcd='';return db['ZendeskAccount'][_0x2a90('0x55')]({'where':{'id':_0x5e0bf2['params']['id']},'attributes':['id',_0x2a90('0x56'),_0x2a90('0x57'),'token','authType',_0x2a90('0x58')]})['then'](handleEntityNotFound(_0x5a770b,null))['then'](function(_0xd52ae2){if(_0xd52ae2){_0x4e1dcd=_0xd52ae2[_0x2a90('0x58')];var _0x1db063=_0x4e1dcd[_0x2a90('0x59')](-0x1);if(_0x1db063==='/'){_0x4e1dcd=_0x4e1dcd['substring'](0x0,_0x4e1dcd['lastIndexOf'](_0x1db063));}var _0x370144={'method':_0x2a90('0x5a'),'uri':util[_0x2a90('0x5b')](_0x2a90('0x5c'),_0x4e1dcd,_0x2a90('0x5d')),'json':!![]};switch(_0xd52ae2[_0x2a90('0x5e')]){case _0x2a90('0x57'):_0x370144[_0x2a90('0x5f')]={'Authorization':util[_0x2a90('0x5b')](_0x2a90('0x60'),new Buffer(util[_0x2a90('0x5b')](_0x2a90('0x61'),_0xd52ae2['username'],_0xd52ae2[_0x2a90('0x57')]))['toString'](_0x2a90('0x62')))};break;case'token':_0x370144[_0x2a90('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x2a90('0x5b')](_0x2a90('0x63'),_0xd52ae2[_0x2a90('0x56')],_0xd52ae2[_0x2a90('0x64')]))['toString']('base64'))};break;default:throw new db[(_0x2a90('0x65'))][(_0x2a90('0x66'))](_0x2a90('0x67'));}return rp(_0x370144);}})[_0x2a90('0x23')](function(_0x59b9e6){if(_0x59b9e6){var _0x3b0d5e=[_0x2a90('0x68'),_0x2a90('0x69'),_0x2a90('0x6a'),_0x2a90('0x6b')];_[_0x2a90('0x6c')](_0x59b9e6[_0x2a90('0x5d')],function(_0x4d46f5){return _0x3b0d5e[_0x2a90('0x6d')](_0x4d46f5[_0x2a90('0x2a')]);});return{'count':_0x59b9e6[_0x2a90('0x5d')][_0x2a90('0x34')],'rows':_[_0x2a90('0x49')](_0x59b9e6[_0x2a90('0x5d')],function(_0x1bbadd){return{'id':_0x1bbadd['id'],'name':_0x1bbadd[_0x2a90('0x6e')]>0x7?_0x1bbadd['title']:_0x1bbadd[_0x2a90('0x2a')],'custom':_0x1bbadd[_0x2a90('0x6e')]>0x7?!![]:![],'options':_0x1bbadd['system_field_options']?_0x1bbadd[_0x2a90('0x6f')]:_0x1bbadd[_0x2a90('0x70')]?_0x1bbadd[_0x2a90('0x70')]:[]};})};}})[_0x2a90('0x23')](respondWithResult(_0x5a770b,null))[_0x2a90('0x45')](function(_0x16e9e7){var _0x4b4a47=_0x5e0bf2[_0x2a90('0x2e')][_0x2a90('0x71')]?0x1f4:_0x16e9e7[_0x2a90('0x72')]||0x1f4;logger[_0x2a90('0x25')](_0x2a90('0x73'),_0x2a90('0x54'),_0x4b4a47,JSON[_0x2a90('0x74')](_0x16e9e7));delete _0x16e9e7[_0x2a90('0x2d')];if(_0x4b4a47===0x191){_0x4b4a47=0x190;}_0x5a770b['status'](_0x4b4a47)[_0x2a90('0x75')](_0x5e0bf2[_0x2a90('0x2e')][_0x2a90('0x71')]?{'message':_0x2a90('0x76'),'statusCode':_0x16e9e7[_0x2a90('0x72')]}:_0x16e9e7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index aa5c957..5fd41ef 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 _0x5cb5=['ZendeskAccount','int_zendesk_accounts','lodash','api','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x2e1b7f,_0x37a3b9){var _0x3a2d38=function(_0x406fe6){while(--_0x406fe6){_0x2e1b7f['push'](_0x2e1b7f['shift']());}};_0x3a2d38(++_0x37a3b9);}(_0x5cb5,0x18e));var _0x55cb=function(_0x33d68b,_0x521331){_0x33d68b=_0x33d68b-0x0;var _0x41ff94=_0x5cb5[_0x33d68b];return _0x41ff94;};'use strict';var _=require(_0x55cb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55cb('0x1'));var moment=require('moment');var BPromise=require(_0x55cb('0x2'));var rp=require(_0x55cb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x55cb('0x4'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x55cb('0x5'));module[_0x55cb('0x6')]=function(_0x2f971a,_0x4c31ea){return _0x2f971a['define'](_0x55cb('0x7'),attributes,{'tableName':_0x55cb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ab8=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x380643,_0x473b02){var _0x2ebc30=function(_0x1c77d6){while(--_0x1c77d6){_0x380643['push'](_0x380643['shift']());}};_0x2ebc30(++_0x473b02);}(_0x7ab8,0x1ef));var _0x87ab=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7ab8[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x87ab('0x0'));var util=require(_0x87ab('0x1'));var logger=require('../../config/logger')(_0x87ab('0x2'));var moment=require(_0x87ab('0x3'));var BPromise=require(_0x87ab('0x4'));var rp=require(_0x87ab('0x5'));var fs=require('fs');var path=require(_0x87ab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87ab('0x7'));var integrations=require(_0x87ab('0x8'));module['exports']=function(_0x1b501d,_0x36c213){return _0x1b501d[_0x87ab('0x9')](_0x87ab('0xa'),attributes,{'tableName':_0x87ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index bfc54da..b883a79 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 _0x2d1b=['bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ZendeskAccount','options','raw','attributes','map','include','model','GetZendeskAccount','stringify','find','ShowZendeskAccount','lodash','util','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2d1b,0x1bf));var _0xb2d1=function(_0x356f04,_0x14d24a){_0x356f04=_0x356f04-0x0;var _0x448dc9=_0x2d1b[_0x356f04];return _0x448dc9;};'use strict';var _=require(_0xb2d1('0x0'));var util=require(_0xb2d1('0x1'));var moment=require(_0xb2d1('0x2'));var BPromise=require(_0xb2d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2d1('0x4'))['db'];var utils=require(_0xb2d1('0x5'));var logger=require('../../config/logger')(_0xb2d1('0x6'));var config=require(_0xb2d1('0x7'));var jayson=require(_0xb2d1('0x8'));var client=jayson['client'][_0xb2d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3698b6,_0x449071,_0x536731){return new BPromise(function(_0x394fdb,_0x3401c7){return client['request'](_0x3698b6,_0x536731)[_0xb2d1('0xa')](function(_0x592420){logger[_0xb2d1('0xb')](_0xb2d1('0xc'),_0x449071,'request\x20sent');logger[_0xb2d1('0xd')](_0xb2d1('0xe'),_0x449071,'request\x20sent',JSON['stringify'](_0x592420));if(_0x592420['error']){if(_0x592420[_0xb2d1('0xf')][_0xb2d1('0x10')]===0x1f4){logger[_0xb2d1('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x449071,_0x592420['error']['message']);return _0x3401c7(_0x592420[_0xb2d1('0xf')]['message']);}logger[_0xb2d1('0xf')](_0xb2d1('0xc'),_0x449071,_0x592420[_0xb2d1('0xf')][_0xb2d1('0x11')]);return _0x394fdb(_0x592420[_0xb2d1('0xf')][_0xb2d1('0x11')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x449071,'request\x20sent');_0x394fdb(_0x592420['result'][_0xb2d1('0x11')]);}})[_0xb2d1('0x12')](function(_0x3ef291){logger['error'](_0xb2d1('0xc'),_0x449071,_0x3ef291);_0x3401c7(_0x3ef291);});});}exports['GetZendeskAccount']=function(_0x43c955){var _0x14083b=this;return new Promise(function(_0x1c6e63,_0x248758){return db[_0xb2d1('0x13')]['findAll']({'raw':_0x43c955[_0xb2d1('0x14')]?_0x43c955[_0xb2d1('0x14')][_0xb2d1('0x15')]===undefined?!![]:![]:!![],'where':_0x43c955[_0xb2d1('0x14')]?_0x43c955[_0xb2d1('0x14')]['where']||null:null,'attributes':_0x43c955[_0xb2d1('0x14')]?_0x43c955[_0xb2d1('0x14')][_0xb2d1('0x16')]||null:null,'limit':_0x43c955[_0xb2d1('0x14')]?_0x43c955[_0xb2d1('0x14')]['limit']||null:null,'include':_0x43c955[_0xb2d1('0x14')]?_0x43c955[_0xb2d1('0x14')]['include']?_[_0xb2d1('0x17')](_0x43c955[_0xb2d1('0x14')][_0xb2d1('0x18')],function(_0x5372a4){return{'model':db[_0x5372a4[_0xb2d1('0x19')]],'as':_0x5372a4['as'],'attributes':_0x5372a4[_0xb2d1('0x16')],'include':_0x5372a4[_0xb2d1('0x18')]?_['map'](_0x5372a4[_0xb2d1('0x18')],function(_0x4dd383){return{'model':db[_0x4dd383[_0xb2d1('0x19')]],'as':_0x4dd383['as'],'attributes':_0x4dd383[_0xb2d1('0x16')],'include':_0x4dd383[_0xb2d1('0x18')]?_[_0xb2d1('0x17')](_0x4dd383[_0xb2d1('0x18')],function(_0x1a3aec){return{'model':db[_0x1a3aec[_0xb2d1('0x19')]],'as':_0x1a3aec['as'],'attributes':_0x1a3aec['attributes']};}):[]};}):[]};}):[]:[]})[_0xb2d1('0xa')](function(_0x4828f6){logger['info'](_0xb2d1('0x1a'),_0x43c955);logger[_0xb2d1('0xd')]('GetZendeskAccount',_0x43c955,JSON[_0xb2d1('0x1b')](_0x4828f6));_0x1c6e63(_0x4828f6);})[_0xb2d1('0x12')](function(_0x552d35){logger[_0xb2d1('0xf')](_0xb2d1('0x1a'),_0x552d35['message'],_0x43c955);_0x248758(_0x14083b[_0xb2d1('0xf')](0x1f4,_0x552d35[_0xb2d1('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x19ece3){var _0x316b60=this;return new Promise(function(_0x85b129,_0x17d394){return db['ZendeskAccount'][_0xb2d1('0x1c')]({'raw':_0x19ece3[_0xb2d1('0x14')]?_0x19ece3[_0xb2d1('0x14')][_0xb2d1('0x15')]===undefined?!![]:![]:!![],'where':_0x19ece3[_0xb2d1('0x14')]?_0x19ece3['options']['where']||null:null,'attributes':_0x19ece3[_0xb2d1('0x14')]?_0x19ece3['options']['attributes']||null:null,'include':_0x19ece3['options']?_0x19ece3[_0xb2d1('0x14')][_0xb2d1('0x18')]?_['map'](_0x19ece3[_0xb2d1('0x14')][_0xb2d1('0x18')],function(_0x3a635a){return{'model':db[_0x3a635a['model']],'as':_0x3a635a['as'],'attributes':_0x3a635a['attributes'],'include':_0x3a635a[_0xb2d1('0x18')]?_[_0xb2d1('0x17')](_0x3a635a['include'],function(_0x18db9c){return{'model':db[_0x18db9c[_0xb2d1('0x19')]],'as':_0x18db9c['as'],'attributes':_0x18db9c['attributes'],'include':_0x18db9c['include']?_[_0xb2d1('0x17')](_0x18db9c[_0xb2d1('0x18')],function(_0x15028e){return{'model':db[_0x15028e[_0xb2d1('0x19')]],'as':_0x15028e['as'],'attributes':_0x15028e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb2d1('0xa')](function(_0xdee29d){logger[_0xb2d1('0xb')](_0xb2d1('0x1d'),_0x19ece3);logger[_0xb2d1('0xd')](_0xb2d1('0x1d'),_0x19ece3,JSON['stringify'](_0xdee29d));_0x85b129(_0xdee29d);})[_0xb2d1('0x12')](function(_0x46ce84){logger[_0xb2d1('0xf')](_0xb2d1('0x1d'),_0x46ce84[_0xb2d1('0x11')],_0x19ece3);_0x17d394(_0x316b60['error'](0x1f4,_0x46ce84['message']));});});}; \ No newline at end of file +var _0x6239=['code','message','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','include','model','map','ShowZendeskAccount','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0x6239,0x164));var _0x9623=function(_0x3ecaed,_0x6a02f6){_0x3ecaed=_0x3ecaed-0x0;var _0x5906b7=_0x6239[_0x3ecaed];return _0x5906b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9623('0x0'));var BPromise=require(_0x9623('0x1'));var rs=require(_0x9623('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9623('0x3'));var logger=require(_0x9623('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9623('0x5')][_0x9623('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3c9f30,_0xfba22e,_0x23a5d7){return new BPromise(function(_0x3aa61e,_0x1918b8){return client[_0x9623('0x7')](_0x3c9f30,_0x23a5d7)[_0x9623('0x8')](function(_0x2861cf){logger[_0x9623('0x9')](_0x9623('0xa'),_0xfba22e,'request\x20sent');logger[_0x9623('0xb')](_0x9623('0xc'),_0xfba22e,_0x9623('0xd'),JSON[_0x9623('0xe')](_0x2861cf));if(_0x2861cf[_0x9623('0xf')]){if(_0x2861cf['error'][_0x9623('0x10')]===0x1f4){logger[_0x9623('0xf')](_0x9623('0xa'),_0xfba22e,_0x2861cf['error']['message']);return _0x1918b8(_0x2861cf[_0x9623('0xf')]['message']);}logger[_0x9623('0xf')](_0x9623('0xa'),_0xfba22e,_0x2861cf['error']['message']);return _0x3aa61e(_0x2861cf[_0x9623('0xf')][_0x9623('0x11')]);}else{logger[_0x9623('0x9')]('ZendeskAccount,\x20%s,\x20%s',_0xfba22e,'request\x20sent');_0x3aa61e(_0x2861cf['result']['message']);}})[_0x9623('0x12')](function(_0x45996c){logger[_0x9623('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0xfba22e,_0x45996c);_0x1918b8(_0x45996c);});});}exports[_0x9623('0x13')]=function(_0x2a5ce1){var _0x2ffed2=this;return new Promise(function(_0x28f551,_0x26eba9){return db[_0x9623('0x14')]['findAll']({'raw':_0x2a5ce1[_0x9623('0x15')]?_0x2a5ce1[_0x9623('0x15')][_0x9623('0x16')]===undefined?!![]:![]:!![],'where':_0x2a5ce1[_0x9623('0x15')]?_0x2a5ce1[_0x9623('0x15')][_0x9623('0x17')]||null:null,'attributes':_0x2a5ce1[_0x9623('0x15')]?_0x2a5ce1[_0x9623('0x15')][_0x9623('0x18')]||null:null,'limit':_0x2a5ce1[_0x9623('0x15')]?_0x2a5ce1[_0x9623('0x15')][_0x9623('0x19')]||null:null,'include':_0x2a5ce1[_0x9623('0x15')]?_0x2a5ce1[_0x9623('0x15')][_0x9623('0x1a')]?_['map'](_0x2a5ce1[_0x9623('0x15')]['include'],function(_0xdb40f0){return{'model':db[_0xdb40f0[_0x9623('0x1b')]],'as':_0xdb40f0['as'],'attributes':_0xdb40f0[_0x9623('0x18')],'include':_0xdb40f0[_0x9623('0x1a')]?_[_0x9623('0x1c')](_0xdb40f0[_0x9623('0x1a')],function(_0x3d8bad){return{'model':db[_0x3d8bad[_0x9623('0x1b')]],'as':_0x3d8bad['as'],'attributes':_0x3d8bad[_0x9623('0x18')],'include':_0x3d8bad[_0x9623('0x1a')]?_[_0x9623('0x1c')](_0x3d8bad[_0x9623('0x1a')],function(_0x4c081f){return{'model':db[_0x4c081f[_0x9623('0x1b')]],'as':_0x4c081f['as'],'attributes':_0x4c081f[_0x9623('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x330b9e){logger[_0x9623('0x9')]('GetZendeskAccount',_0x2a5ce1);logger[_0x9623('0xb')](_0x9623('0x13'),_0x2a5ce1,JSON[_0x9623('0xe')](_0x330b9e));_0x28f551(_0x330b9e);})[_0x9623('0x12')](function(_0x5124f5){logger[_0x9623('0xf')](_0x9623('0x13'),_0x5124f5[_0x9623('0x11')],_0x2a5ce1);_0x26eba9(_0x2ffed2[_0x9623('0xf')](0x1f4,_0x5124f5['message']));});});};exports[_0x9623('0x1d')]=function(_0x480774){var _0x505e2d=this;return new Promise(function(_0xfd4336,_0x9e5069){return db['ZendeskAccount'][_0x9623('0x1e')]({'raw':_0x480774[_0x9623('0x15')]?_0x480774[_0x9623('0x15')][_0x9623('0x16')]===undefined?!![]:![]:!![],'where':_0x480774['options']?_0x480774[_0x9623('0x15')]['where']||null:null,'attributes':_0x480774[_0x9623('0x15')]?_0x480774[_0x9623('0x15')][_0x9623('0x18')]||null:null,'include':_0x480774['options']?_0x480774[_0x9623('0x15')]['include']?_[_0x9623('0x1c')](_0x480774[_0x9623('0x15')][_0x9623('0x1a')],function(_0x134f65){return{'model':db[_0x134f65[_0x9623('0x1b')]],'as':_0x134f65['as'],'attributes':_0x134f65[_0x9623('0x18')],'include':_0x134f65[_0x9623('0x1a')]?_[_0x9623('0x1c')](_0x134f65[_0x9623('0x1a')],function(_0x418b37){return{'model':db[_0x418b37[_0x9623('0x1b')]],'as':_0x418b37['as'],'attributes':_0x418b37[_0x9623('0x18')],'include':_0x418b37['include']?_[_0x9623('0x1c')](_0x418b37[_0x9623('0x1a')],function(_0x362917){return{'model':db[_0x362917[_0x9623('0x1b')]],'as':_0x362917['as'],'attributes':_0x362917[_0x9623('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9623('0x8')](function(_0x29a34c){logger[_0x9623('0x9')]('ShowZendeskAccount',_0x480774);logger['debug'](_0x9623('0x1d'),_0x480774,JSON[_0x9623('0xe')](_0x29a34c));_0xfd4336(_0x29a34c);})[_0x9623('0x12')](function(_0x300e37){logger[_0x9623('0xf')](_0x9623('0x1d'),_0x300e37['message'],_0x480774);_0x9e5069(_0x505e2d[_0x9623('0xf')](0x1f4,_0x300e37[_0x9623('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 76fd740..aa49842 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 _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','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'];(function(_0x2ae90f,_0x1d6904){var _0x18ff2a=function(_0x3e75f5){while(--_0x3e75f5){_0x2ae90f['push'](_0x2ae90f['shift']());}};_0x18ff2a(++_0x1d6904);}(_0x5eb8,0xb0));var _0x85eb=function(_0x29d87d,_0x23dc31){_0x29d87d=_0x29d87d-0x0;var _0x1fd84b=_0x5eb8[_0x29d87d];return _0x1fd84b;};'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['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x137aa6,_0xc9ad62){var _0x24cb82=function(_0x278fcd){while(--_0x278fcd){_0x137aa6['push'](_0x137aa6['shift']());}};_0x24cb82(++_0xc9ad62);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xcb91[_0x1abeb2];return _0x48da20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index c8a4f37..922cc22 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 _0xb818=['exports'];(function(_0x3d3183,_0xb8dde0){var _0xdf094c=function(_0x2c4c47){while(--_0x2c4c47){_0x3d3183['push'](_0x3d3183['shift']());}};_0xdf094c(++_0xb8dde0);}(_0xb818,0x16e));var _0x8b81=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb818[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0x8b81('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4717=['sequelize','exports','STRING'];(function(_0x480957,_0x2632b7){var _0x5101d3=function(_0xca6835){while(--_0xca6835){_0x480957['push'](_0x480957['shift']());}};_0x5101d3(++_0x2632b7);}(_0x4717,0x114));var _0x7471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4717[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7471('0x0'));module[_0x7471('0x1')]={'name':{'type':Sequelize[_0x7471('0x2')]},'description':{'type':Sequelize[_0x7471('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 9301406..8f55667 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 _0x2beb=['name','send','index','map','ZendeskConfiguration','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','keys','find','create','body','params','destroy','getFields','findOne','ZendeskField','rawAttributes','length','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','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','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','error'];(function(_0x2ced83,_0x53754d){var _0x472ad1=function(_0x2460de){while(--_0x2460de){_0x2ced83['push'](_0x2ced83['shift']());}};_0x472ad1(++_0x53754d);}(_0x2beb,0x7e));var _0xb2be=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x2beb[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xb2be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2be('0x1'));var jsonpatch=require(_0xb2be('0x2'));var rp=require('request-promise');var moment=require(_0xb2be('0x3'));var BPromise=require(_0xb2be('0x4'));var Mustache=require(_0xb2be('0x5'));var util=require('util');var path=require(_0xb2be('0x6'));var sox=require(_0xb2be('0x7'));var csv=require('to-csv');var ejs=require(_0xb2be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2be('0x9'));var squel=require(_0xb2be('0xa'));var crypto=require(_0xb2be('0xb'));var jsforce=require(_0xb2be('0xc'));var deskjs=require(_0xb2be('0xd'));var toCsv=require(_0xb2be('0xe'));var querystring=require(_0xb2be('0xf'));var Papa=require(_0xb2be('0x10'));var Redis=require(_0xb2be('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb2be('0x12'));var as=require(_0xb2be('0x13'));var hardwareService=require(_0xb2be('0x14'));var logger=require(_0xb2be('0x15'))(_0xb2be('0x16'));var utils=require(_0xb2be('0x17'));var config=require(_0xb2be('0x18'));var licenseUtil=require(_0xb2be('0x19'));var db=require(_0xb2be('0x1a'))['db'];function respondWithStatusCode(_0xaa8668,_0x37d1ec){_0x37d1ec=_0x37d1ec||0xcc;return function(_0x1d0570){if(_0x1d0570){return _0xaa8668['sendStatus'](_0x37d1ec);}return _0xaa8668[_0xb2be('0x1b')](_0x37d1ec)[_0xb2be('0x1c')]();};}function respondWithResult(_0x1f5167,_0x182b48){_0x182b48=_0x182b48||0xc8;return function(_0xc43fc3){if(_0xc43fc3){return _0x1f5167[_0xb2be('0x1b')](_0x182b48)[_0xb2be('0x1d')](_0xc43fc3);}};}function respondWithFilteredResult(_0x2c2840,_0x2a3f5f){return function(_0x2e5695){if(_0x2e5695){var _0xa5feac=typeof _0x2a3f5f[_0xb2be('0x1e')]===_0xb2be('0x1f')&&typeof _0x2a3f5f[_0xb2be('0x20')]===_0xb2be('0x1f');var _0x2a9372=_0x2e5695['count'];var _0x229d38=_0xa5feac?0x0:_0x2a3f5f[_0xb2be('0x1e')];var _0x440ddb=_0xa5feac?_0x2e5695['count']:_0x2a3f5f[_0xb2be('0x1e')]+_0x2a3f5f['limit'];var _0x195b64;if(_0x440ddb>=_0x2a9372){_0x440ddb=_0x2a9372;_0x195b64=0xc8;}else{_0x195b64=0xce;}_0x2c2840[_0xb2be('0x1b')](_0x195b64);return _0x2c2840[_0xb2be('0x21')](_0xb2be('0x22'),_0x229d38+'-'+_0x440ddb+'/'+_0x2a9372)[_0xb2be('0x1d')](_0x2e5695);}return null;};}function patchUpdates(_0x2a4411){return function(_0x165981){try{jsonpatch[_0xb2be('0x23')](_0x165981,_0x2a4411,!![]);}catch(_0x34f775){return BPromise[_0xb2be('0x24')](_0x34f775);}return _0x165981['save']();};}function saveUpdates(_0x34d761,_0x49486a){return function(_0x22ad40){if(_0x22ad40){return _0x22ad40[_0xb2be('0x25')](_0x34d761)[_0xb2be('0x26')](function(_0x26c495){return _0x26c495;});}return null;};}function removeEntity(_0x6f3cfe,_0x53e599){return function(_0x3d5ca3){if(_0x3d5ca3){return _0x3d5ca3['destroy']()[_0xb2be('0x26')](function(){_0x6f3cfe['status'](0xcc)[_0xb2be('0x1c')]();});}};}function handleEntityNotFound(_0x5b063c,_0x480761){return function(_0x262def){if(!_0x262def){_0x5b063c['sendStatus'](0x194);}return _0x262def;};}function handleError(_0x19f946,_0xe717a4){_0xe717a4=_0xe717a4||0x1f4;return function(_0x148cc0){logger[_0xb2be('0x27')](_0x148cc0['stack']);if(_0x148cc0[_0xb2be('0x28')]){delete _0x148cc0[_0xb2be('0x28')];}_0x19f946[_0xb2be('0x1b')](_0xe717a4)[_0xb2be('0x29')](_0x148cc0);};}exports[_0xb2be('0x2a')]=function(_0x5198ce,_0x30702a){var _0x18bf3b={},_0x3341a0={},_0x17917e={'count':0x0,'rows':[]};var _0x157aae=_[_0xb2be('0x2b')](db[_0xb2be('0x2c')]['rawAttributes'],function(_0x15422e){return{'name':_0x15422e[_0xb2be('0x2d')],'type':_0x15422e[_0xb2be('0x2e')][_0xb2be('0x2f')]};});_0x3341a0['model']=_[_0xb2be('0x2b')](_0x157aae,_0xb2be('0x28'));_0x3341a0[_0xb2be('0x30')]=_['keys'](_0x5198ce[_0xb2be('0x30')]);_0x3341a0[_0xb2be('0x31')]=_[_0xb2be('0x32')](_0x3341a0[_0xb2be('0x33')],_0x3341a0[_0xb2be('0x30')]);_0x18bf3b[_0xb2be('0x34')]=_[_0xb2be('0x32')](_0x3341a0[_0xb2be('0x33')],qs[_0xb2be('0x35')](_0x5198ce[_0xb2be('0x30')][_0xb2be('0x35')]));_0x18bf3b[_0xb2be('0x34')]=_0x18bf3b['attributes']['length']?_0x18bf3b[_0xb2be('0x34')]:_0x3341a0['model'];if(!_0x5198ce[_0xb2be('0x30')][_0xb2be('0x36')](_0xb2be('0x37'))){_0x18bf3b['limit']=qs[_0xb2be('0x20')](_0x5198ce[_0xb2be('0x30')][_0xb2be('0x20')]);_0x18bf3b[_0xb2be('0x1e')]=qs['offset'](_0x5198ce[_0xb2be('0x30')][_0xb2be('0x1e')]);}_0x18bf3b[_0xb2be('0x38')]=qs[_0xb2be('0x39')](_0x5198ce[_0xb2be('0x30')]['sort']);_0x18bf3b[_0xb2be('0x3a')]=qs[_0xb2be('0x31')](_[_0xb2be('0x3b')](_0x5198ce[_0xb2be('0x30')],_0x3341a0[_0xb2be('0x31')]),_0x157aae);if(_0x5198ce[_0xb2be('0x30')][_0xb2be('0x3c')]){_0x18bf3b[_0xb2be('0x3a')]=_['merge'](_0x18bf3b[_0xb2be('0x3a')],{'$or':_[_0xb2be('0x2b')](_0x157aae,function(_0x675c39){if(_0x675c39[_0xb2be('0x2e')]!=='VIRTUAL'){var _0x462cb3={};_0x462cb3[_0x675c39[_0xb2be('0x28')]]={'$like':'%'+_0x5198ce['query'][_0xb2be('0x3c')]+'%'};return _0x462cb3;}})});}_0x18bf3b=_[_0xb2be('0x3d')]({},_0x18bf3b,_0x5198ce[_0xb2be('0x3e')]);var _0x12ef1d={'where':_0x18bf3b[_0xb2be('0x3a')]};return db['ZendeskConfiguration']['count'](_0x12ef1d)[_0xb2be('0x26')](function(_0x5c258e){_0x17917e['count']=_0x5c258e;if(_0x5198ce['query'][_0xb2be('0x3f')]){_0x18bf3b['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x18bf3b);})[_0xb2be('0x26')](function(_0x4cfb8f){_0x17917e[_0xb2be('0x40')]=_0x4cfb8f;return _0x17917e;})['then'](respondWithFilteredResult(_0x30702a,_0x18bf3b))[_0xb2be('0x41')](handleError(_0x30702a,null));};exports[_0xb2be('0x42')]=function(_0x2f0a39,_0x9977e1){var _0x281a5d={'raw':![],'where':{'id':_0x2f0a39['params']['id']}},_0x3b9567={};_0x3b9567[_0xb2be('0x33')]=_[_0xb2be('0x43')](db[_0xb2be('0x2c')]['rawAttributes']);_0x3b9567[_0xb2be('0x30')]=_[_0xb2be('0x43')](_0x2f0a39[_0xb2be('0x30')]);_0x3b9567[_0xb2be('0x31')]=_[_0xb2be('0x32')](_0x3b9567[_0xb2be('0x33')],_0x3b9567['query']);_0x281a5d['attributes']=_['intersection'](_0x3b9567[_0xb2be('0x33')],qs[_0xb2be('0x35')](_0x2f0a39[_0xb2be('0x30')][_0xb2be('0x35')]));_0x281a5d[_0xb2be('0x34')]=_0x281a5d['attributes']['length']?_0x281a5d[_0xb2be('0x34')]:_0x3b9567[_0xb2be('0x33')];if(_0x2f0a39[_0xb2be('0x30')]['includeAll']){_0x281a5d['include']=[{'all':!![]}];}_0x281a5d=_['merge']({},_0x281a5d,_0x2f0a39[_0xb2be('0x3e')]);return db['ZendeskConfiguration'][_0xb2be('0x44')](_0x281a5d)[_0xb2be('0x26')](handleEntityNotFound(_0x9977e1,null))[_0xb2be('0x26')](respondWithResult(_0x9977e1,null))[_0xb2be('0x41')](handleError(_0x9977e1,null));};exports[_0xb2be('0x45')]=function(_0x5eaff8,_0x5c1aff){return db['ZendeskConfiguration']['create'](_0x5eaff8[_0xb2be('0x46')],{})[_0xb2be('0x26')](respondWithResult(_0x5c1aff,0xc9))[_0xb2be('0x41')](handleError(_0x5c1aff,null));};exports[_0xb2be('0x25')]=function(_0x503378,_0x35c225){if(_0x503378[_0xb2be('0x46')]['id']){delete _0x503378[_0xb2be('0x46')]['id'];}return db['ZendeskConfiguration'][_0xb2be('0x44')]({'where':{'id':_0x503378[_0xb2be('0x47')]['id']}})[_0xb2be('0x26')](handleEntityNotFound(_0x35c225,null))[_0xb2be('0x26')](saveUpdates(_0x503378[_0xb2be('0x46')],null))[_0xb2be('0x26')](respondWithResult(_0x35c225,null))[_0xb2be('0x41')](handleError(_0x35c225,null));};exports[_0xb2be('0x48')]=function(_0x3dbdb9,_0x4811e5){return db[_0xb2be('0x2c')][_0xb2be('0x44')]({'where':{'id':_0x3dbdb9[_0xb2be('0x47')]['id']}})[_0xb2be('0x26')](handleEntityNotFound(_0x4811e5,null))[_0xb2be('0x26')](removeEntity(_0x4811e5,null))['catch'](handleError(_0x4811e5,null));};exports[_0xb2be('0x49')]=function(_0x434eb3,_0x56e5bd,_0xc414a9){var _0x55fa4e={};var _0x31ec2c={};var _0x2ce25d;var _0x2471f2;return db[_0xb2be('0x2c')][_0xb2be('0x4a')]({'where':{'id':_0x434eb3[_0xb2be('0x47')]['id']}})[_0xb2be('0x26')](handleEntityNotFound(_0x56e5bd,null))[_0xb2be('0x26')](function(_0x1e1771){if(_0x1e1771){_0x2ce25d=_0x1e1771;_0x31ec2c[_0xb2be('0x33')]=_['keys'](db[_0xb2be('0x4b')][_0xb2be('0x4c')]);_0x31ec2c[_0xb2be('0x30')]=_[_0xb2be('0x43')](_0x434eb3['query']);_0x31ec2c[_0xb2be('0x31')]=_[_0xb2be('0x32')](_0x31ec2c['model'],_0x31ec2c[_0xb2be('0x30')]);_0x55fa4e[_0xb2be('0x34')]=_[_0xb2be('0x32')](_0x31ec2c[_0xb2be('0x33')],qs[_0xb2be('0x35')](_0x434eb3[_0xb2be('0x30')]['fields']));_0x55fa4e['attributes']=_0x55fa4e['attributes'][_0xb2be('0x4d')]?_0x55fa4e[_0xb2be('0x34')]:_0x31ec2c['model'];_0x55fa4e['order']=qs[_0xb2be('0x39')](_0x434eb3[_0xb2be('0x30')][_0xb2be('0x39')]);_0x55fa4e[_0xb2be('0x3a')]=qs[_0xb2be('0x31')](_[_0xb2be('0x3b')](_0x434eb3['query'],_0x31ec2c[_0xb2be('0x31')]));if(_0x434eb3[_0xb2be('0x30')][_0xb2be('0x3c')]){_0x55fa4e['where']=_['merge'](_0x55fa4e['where'],{'$or':_['map'](_0x55fa4e[_0xb2be('0x34')],function(_0x57a941){var _0x2c8b84={};_0x2c8b84[_0x57a941]={'$like':'%'+_0x434eb3[_0xb2be('0x30')][_0xb2be('0x3c')]+'%'};return _0x2c8b84;})});}_0x55fa4e=_['merge']({},_0x55fa4e,_0x434eb3[_0xb2be('0x3e')]);return _0x2ce25d[_0xb2be('0x49')](_0x55fa4e);}})[_0xb2be('0x26')](function(_0x536331){if(_0x536331){_0x2471f2=_0x536331['length'];if(!_0x434eb3[_0xb2be('0x30')][_0xb2be('0x36')](_0xb2be('0x37'))){_0x55fa4e[_0xb2be('0x20')]=qs[_0xb2be('0x20')](_0x434eb3['query'][_0xb2be('0x20')]);_0x55fa4e['offset']=qs[_0xb2be('0x1e')](_0x434eb3[_0xb2be('0x30')]['offset']);}return _0x2ce25d[_0xb2be('0x49')](_0x55fa4e);}})['then'](function(_0x47d2a1){if(_0x47d2a1){return _0x47d2a1?{'count':_0x2471f2,'rows':_0x47d2a1}:null;}})['then'](respondWithResult(_0x56e5bd,null))[_0xb2be('0x41')](handleError(_0x56e5bd,null));};exports[_0xb2be('0x4e')]=function(_0xa477fb,_0x4ac020,_0x5fab1c){var _0x3de5c9={};var _0x1b16ab={};var _0x941c8d;var _0x5aeb42;return db[_0xb2be('0x2c')][_0xb2be('0x4a')]({'where':{'id':_0xa477fb[_0xb2be('0x47')]['id']}})[_0xb2be('0x26')](handleEntityNotFound(_0x4ac020,null))[_0xb2be('0x26')](function(_0x439847){if(_0x439847){_0x941c8d=_0x439847;_0x1b16ab[_0xb2be('0x33')]=_['keys'](db[_0xb2be('0x4b')][_0xb2be('0x4c')]);_0x1b16ab[_0xb2be('0x30')]=_[_0xb2be('0x43')](_0xa477fb[_0xb2be('0x30')]);_0x1b16ab[_0xb2be('0x31')]=_[_0xb2be('0x32')](_0x1b16ab['model'],_0x1b16ab[_0xb2be('0x30')]);_0x3de5c9[_0xb2be('0x34')]=_[_0xb2be('0x32')](_0x1b16ab[_0xb2be('0x33')],qs[_0xb2be('0x35')](_0xa477fb[_0xb2be('0x30')][_0xb2be('0x35')]));_0x3de5c9[_0xb2be('0x34')]=_0x3de5c9[_0xb2be('0x34')][_0xb2be('0x4d')]?_0x3de5c9[_0xb2be('0x34')]:_0x1b16ab['model'];_0x3de5c9[_0xb2be('0x38')]=qs[_0xb2be('0x39')](_0xa477fb[_0xb2be('0x30')][_0xb2be('0x39')]);_0x3de5c9[_0xb2be('0x3a')]=qs['filters'](_[_0xb2be('0x3b')](_0xa477fb[_0xb2be('0x30')],_0x1b16ab['filters']));if(_0xa477fb[_0xb2be('0x30')]['filter']){_0x3de5c9[_0xb2be('0x3a')]=_[_0xb2be('0x3d')](_0x3de5c9[_0xb2be('0x3a')],{'$or':_[_0xb2be('0x2b')](_0x3de5c9['attributes'],function(_0x3c73d6){var _0x5b5b27={};_0x5b5b27[_0x3c73d6]={'$like':'%'+_0xa477fb['query'][_0xb2be('0x3c')]+'%'};return _0x5b5b27;})});}_0x3de5c9=_[_0xb2be('0x3d')]({},_0x3de5c9,_0xa477fb['options']);return _0x941c8d[_0xb2be('0x4e')](_0x3de5c9);}})[_0xb2be('0x26')](function(_0x25f2a4){if(_0x25f2a4){_0x5aeb42=_0x25f2a4[_0xb2be('0x4d')];if(!_0xa477fb[_0xb2be('0x30')][_0xb2be('0x36')]('nolimit')){_0x3de5c9[_0xb2be('0x20')]=qs[_0xb2be('0x20')](_0xa477fb['query'][_0xb2be('0x20')]);_0x3de5c9[_0xb2be('0x1e')]=qs[_0xb2be('0x1e')](_0xa477fb['query'][_0xb2be('0x1e')]);}return _0x941c8d[_0xb2be('0x4e')](_0x3de5c9);}})[_0xb2be('0x26')](function(_0x1ada82){if(_0x1ada82){return _0x1ada82?{'count':_0x5aeb42,'rows':_0x1ada82}:null;}})[_0xb2be('0x26')](respondWithResult(_0x4ac020,null))['catch'](handleError(_0x4ac020,null));};exports[_0xb2be('0x4f')]=function(_0x29905c,_0x49b358,_0x186321){var _0x203548={};var _0xccbb51={};var _0x366c82;var _0xe6fea6;return db[_0xb2be('0x2c')]['findOne']({'where':{'id':_0x29905c[_0xb2be('0x47')]['id']}})['then'](handleEntityNotFound(_0x49b358,null))['then'](function(_0x4ea6ea){if(_0x4ea6ea){_0x366c82=_0x4ea6ea;_0xccbb51[_0xb2be('0x33')]=_[_0xb2be('0x43')](db[_0xb2be('0x4b')][_0xb2be('0x4c')]);_0xccbb51['query']=_['keys'](_0x29905c[_0xb2be('0x30')]);_0xccbb51[_0xb2be('0x31')]=_[_0xb2be('0x32')](_0xccbb51[_0xb2be('0x33')],_0xccbb51[_0xb2be('0x30')]);_0x203548['attributes']=_['intersection'](_0xccbb51[_0xb2be('0x33')],qs[_0xb2be('0x35')](_0x29905c[_0xb2be('0x30')][_0xb2be('0x35')]));_0x203548[_0xb2be('0x34')]=_0x203548[_0xb2be('0x34')]['length']?_0x203548[_0xb2be('0x34')]:_0xccbb51[_0xb2be('0x33')];_0x203548[_0xb2be('0x38')]=qs[_0xb2be('0x39')](_0x29905c[_0xb2be('0x30')][_0xb2be('0x39')]);_0x203548[_0xb2be('0x3a')]=qs[_0xb2be('0x31')](_[_0xb2be('0x3b')](_0x29905c['query'],_0xccbb51[_0xb2be('0x31')]));if(_0x29905c[_0xb2be('0x30')]['filter']){_0x203548[_0xb2be('0x3a')]=_[_0xb2be('0x3d')](_0x203548[_0xb2be('0x3a')],{'$or':_[_0xb2be('0x2b')](_0x203548[_0xb2be('0x34')],function(_0x162d95){var _0x25b742={};_0x25b742[_0x162d95]={'$like':'%'+_0x29905c[_0xb2be('0x30')][_0xb2be('0x3c')]+'%'};return _0x25b742;})});}_0x203548=_[_0xb2be('0x3d')]({},_0x203548,_0x29905c[_0xb2be('0x3e')]);return _0x366c82['getDescriptions'](_0x203548);}})[_0xb2be('0x26')](function(_0x36cc3a){if(_0x36cc3a){_0xe6fea6=_0x36cc3a['length'];if(!_0x29905c[_0xb2be('0x30')][_0xb2be('0x36')](_0xb2be('0x37'))){_0x203548[_0xb2be('0x20')]=qs[_0xb2be('0x20')](_0x29905c[_0xb2be('0x30')][_0xb2be('0x20')]);_0x203548[_0xb2be('0x1e')]=qs[_0xb2be('0x1e')](_0x29905c[_0xb2be('0x30')][_0xb2be('0x1e')]);}return _0x366c82[_0xb2be('0x4f')](_0x203548);}})[_0xb2be('0x26')](function(_0x48ac81){if(_0x48ac81){return _0x48ac81?{'count':_0xe6fea6,'rows':_0x48ac81}:null;}})[_0xb2be('0x26')](respondWithResult(_0x49b358,null))['catch'](handleError(_0x49b358,null));};exports[_0xb2be('0x50')]=function(_0x5b5137,_0x1ef33f,_0x250c6c){var _0x3c100c={};var _0x57ca2a={};var _0x124ed6;var _0x430509;return db[_0xb2be('0x2c')][_0xb2be('0x4a')]({'where':{'id':_0x5b5137[_0xb2be('0x47')]['id']}})[_0xb2be('0x26')](handleEntityNotFound(_0x1ef33f,null))[_0xb2be('0x26')](function(_0x9d5ef3){if(_0x9d5ef3){_0x124ed6=_0x9d5ef3;_0x57ca2a[_0xb2be('0x33')]=_[_0xb2be('0x43')](db['Tag']['rawAttributes']);_0x57ca2a['query']=_[_0xb2be('0x43')](_0x5b5137['query']);_0x57ca2a[_0xb2be('0x31')]=_[_0xb2be('0x32')](_0x57ca2a[_0xb2be('0x33')],_0x57ca2a[_0xb2be('0x30')]);_0x3c100c[_0xb2be('0x34')]=_[_0xb2be('0x32')](_0x57ca2a[_0xb2be('0x33')],qs[_0xb2be('0x35')](_0x5b5137['query'][_0xb2be('0x35')]));_0x3c100c[_0xb2be('0x34')]=_0x3c100c[_0xb2be('0x34')][_0xb2be('0x4d')]?_0x3c100c[_0xb2be('0x34')]:_0x57ca2a[_0xb2be('0x33')];_0x3c100c[_0xb2be('0x38')]=qs[_0xb2be('0x39')](_0x5b5137[_0xb2be('0x30')][_0xb2be('0x39')]);_0x3c100c[_0xb2be('0x3a')]=qs[_0xb2be('0x31')](_[_0xb2be('0x3b')](_0x5b5137[_0xb2be('0x30')],_0x57ca2a[_0xb2be('0x31')]));if(_0x5b5137[_0xb2be('0x30')][_0xb2be('0x3c')]){_0x3c100c[_0xb2be('0x3a')]=_[_0xb2be('0x3d')](_0x3c100c[_0xb2be('0x3a')],{'$or':_[_0xb2be('0x2b')](_0x3c100c[_0xb2be('0x34')],function(_0x4e97a0){var _0x38dcef={};_0x38dcef[_0x4e97a0]={'$like':'%'+_0x5b5137[_0xb2be('0x30')][_0xb2be('0x3c')]+'%'};return _0x38dcef;})});}_0x3c100c=_[_0xb2be('0x3d')]({},_0x3c100c,_0x5b5137[_0xb2be('0x3e')]);return _0x124ed6[_0xb2be('0x50')](_0x3c100c);}})[_0xb2be('0x26')](function(_0x39b6ff){if(_0x39b6ff){_0x430509=_0x39b6ff[_0xb2be('0x4d')];if(!_0x5b5137[_0xb2be('0x30')]['hasOwnProperty'](_0xb2be('0x37'))){_0x3c100c[_0xb2be('0x20')]=qs['limit'](_0x5b5137[_0xb2be('0x30')][_0xb2be('0x20')]);_0x3c100c[_0xb2be('0x1e')]=qs[_0xb2be('0x1e')](_0x5b5137[_0xb2be('0x30')][_0xb2be('0x1e')]);}return _0x124ed6[_0xb2be('0x50')](_0x3c100c);}})[_0xb2be('0x26')](function(_0x3adcea){if(_0x3adcea){return _0x3adcea?{'count':_0x430509,'rows':_0x3adcea}:null;}})[_0xb2be('0x26')](respondWithResult(_0x1ef33f,null))[_0xb2be('0x41')](handleError(_0x1ef33f,null));};exports[_0xb2be('0x51')]=function(_0x375e13,_0x3f37ae,_0x109267){if(_0x375e13[_0xb2be('0x46')]['id']){delete _0x375e13[_0xb2be('0x46')]['id'];}return db[_0xb2be('0x2c')][_0xb2be('0x4a')]({'where':{'id':_0x375e13[_0xb2be('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f37ae,null))[_0xb2be('0x26')](function(_0x11ef21){if(_0x11ef21){return _0x11ef21['setTags'](_0x375e13[_0xb2be('0x46')][_0xb2be('0x52')]||[]);}return null;})[_0xb2be('0x26')](respondWithResult(_0x3f37ae,null))[_0xb2be('0x41')](handleError(_0x3f37ae,null));}; \ No newline at end of file +var _0x8eb5=['key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','ZendeskConfiguration','findAll','rows','catch','show','params','include','create','body','update','find','getFields','findOne','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x33c135,_0x452929){var _0x2fd7f9=function(_0x38fe9c){while(--_0x38fe9c){_0x33c135['push'](_0x33c135['shift']());}};_0x2fd7f9(++_0x452929);}(_0x8eb5,0x1de));var _0x58eb=function(_0x4e2cbe,_0x14adf9){_0x4e2cbe=_0x4e2cbe-0x0;var _0x5ca7ea=_0x8eb5[_0x4e2cbe];return _0x5ca7ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58eb('0x0'));var zipdir=require(_0x58eb('0x1'));var jsonpatch=require(_0x58eb('0x2'));var rp=require(_0x58eb('0x3'));var moment=require(_0x58eb('0x4'));var BPromise=require(_0x58eb('0x5'));var Mustache=require(_0x58eb('0x6'));var util=require(_0x58eb('0x7'));var path=require(_0x58eb('0x8'));var sox=require('sox');var csv=require(_0x58eb('0x9'));var ejs=require(_0x58eb('0xa'));var fs=require('fs');var fs_extra=require(_0x58eb('0xb'));var _=require(_0x58eb('0xc'));var squel=require('squel');var crypto=require(_0x58eb('0xd'));var jsforce=require(_0x58eb('0xe'));var deskjs=require(_0x58eb('0xf'));var toCsv=require(_0x58eb('0x9'));var querystring=require(_0x58eb('0x10'));var Papa=require(_0x58eb('0x11'));var Redis=require(_0x58eb('0x12'));var authService=require(_0x58eb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x58eb('0x14'));var hardwareService=require(_0x58eb('0x15'));var logger=require(_0x58eb('0x16'))(_0x58eb('0x17'));var utils=require(_0x58eb('0x18'));var config=require(_0x58eb('0x19'));var licenseUtil=require(_0x58eb('0x1a'));var db=require(_0x58eb('0x1b'))['db'];function respondWithStatusCode(_0x438b01,_0x2d9cf4){_0x2d9cf4=_0x2d9cf4||0xcc;return function(_0x558505){if(_0x558505){return _0x438b01[_0x58eb('0x1c')](_0x2d9cf4);}return _0x438b01[_0x58eb('0x1d')](_0x2d9cf4)['end']();};}function respondWithResult(_0x525ae3,_0x355ca8){_0x355ca8=_0x355ca8||0xc8;return function(_0x1ac77e){if(_0x1ac77e){return _0x525ae3[_0x58eb('0x1d')](_0x355ca8)[_0x58eb('0x1e')](_0x1ac77e);}};}function respondWithFilteredResult(_0xadd588,_0x44ba37){return function(_0x317bc1){if(_0x317bc1){var _0x1bfaac=typeof _0x44ba37[_0x58eb('0x1f')]===_0x58eb('0x20')&&typeof _0x44ba37[_0x58eb('0x21')]===_0x58eb('0x20');var _0x17e5f6=_0x317bc1['count'];var _0x1118ed=_0x1bfaac?0x0:_0x44ba37['offset'];var _0x587c41=_0x1bfaac?_0x317bc1[_0x58eb('0x22')]:_0x44ba37[_0x58eb('0x1f')]+_0x44ba37[_0x58eb('0x21')];var _0x43b6e8;if(_0x587c41>=_0x17e5f6){_0x587c41=_0x17e5f6;_0x43b6e8=0xc8;}else{_0x43b6e8=0xce;}_0xadd588[_0x58eb('0x1d')](_0x43b6e8);return _0xadd588[_0x58eb('0x23')](_0x58eb('0x24'),_0x1118ed+'-'+_0x587c41+'/'+_0x17e5f6)[_0x58eb('0x1e')](_0x317bc1);}return null;};}function patchUpdates(_0x24758e){return function(_0xd9a487){try{jsonpatch[_0x58eb('0x25')](_0xd9a487,_0x24758e,!![]);}catch(_0x5cf345){return BPromise[_0x58eb('0x26')](_0x5cf345);}return _0xd9a487[_0x58eb('0x27')]();};}function saveUpdates(_0x227791,_0x29bbd4){return function(_0x5b3780){if(_0x5b3780){return _0x5b3780['update'](_0x227791)[_0x58eb('0x28')](function(_0x2277a5){return _0x2277a5;});}return null;};}function removeEntity(_0x2ad627,_0x400b50){return function(_0x130688){if(_0x130688){return _0x130688['destroy']()[_0x58eb('0x28')](function(){_0x2ad627[_0x58eb('0x1d')](0xcc)[_0x58eb('0x29')]();});}};}function handleEntityNotFound(_0x3bfc6d,_0x312fd2){return function(_0x54fa96){if(!_0x54fa96){_0x3bfc6d[_0x58eb('0x1c')](0x194);}return _0x54fa96;};}function handleError(_0x2ef4c6,_0x4393a6){_0x4393a6=_0x4393a6||0x1f4;return function(_0x2f435e){logger[_0x58eb('0x2a')](_0x2f435e[_0x58eb('0x2b')]);if(_0x2f435e[_0x58eb('0x2c')]){delete _0x2f435e['name'];}_0x2ef4c6['status'](_0x4393a6)[_0x58eb('0x2d')](_0x2f435e);};}exports[_0x58eb('0x2e')]=function(_0x146589,_0x5c65fd){var _0x4df434={},_0x2b3d7c={},_0x4d68f8={'count':0x0,'rows':[]};var _0x881721=_[_0x58eb('0x2f')](db['ZendeskConfiguration'][_0x58eb('0x30')],function(_0x8a7420){return{'name':_0x8a7420[_0x58eb('0x31')],'type':_0x8a7420['type'][_0x58eb('0x32')]};});_0x2b3d7c['model']=_[_0x58eb('0x2f')](_0x881721,_0x58eb('0x2c'));_0x2b3d7c[_0x58eb('0x33')]=_[_0x58eb('0x34')](_0x146589[_0x58eb('0x33')]);_0x2b3d7c[_0x58eb('0x35')]=_[_0x58eb('0x36')](_0x2b3d7c[_0x58eb('0x37')],_0x2b3d7c[_0x58eb('0x33')]);_0x4df434[_0x58eb('0x38')]=_[_0x58eb('0x36')](_0x2b3d7c['model'],qs[_0x58eb('0x39')](_0x146589[_0x58eb('0x33')][_0x58eb('0x39')]));_0x4df434[_0x58eb('0x38')]=_0x4df434['attributes'][_0x58eb('0x3a')]?_0x4df434[_0x58eb('0x38')]:_0x2b3d7c['model'];if(!_0x146589['query']['hasOwnProperty'](_0x58eb('0x3b'))){_0x4df434['limit']=qs['limit'](_0x146589[_0x58eb('0x33')]['limit']);_0x4df434['offset']=qs[_0x58eb('0x1f')](_0x146589[_0x58eb('0x33')][_0x58eb('0x1f')]);}_0x4df434[_0x58eb('0x3c')]=qs[_0x58eb('0x3d')](_0x146589['query'][_0x58eb('0x3d')]);_0x4df434['where']=qs[_0x58eb('0x35')](_[_0x58eb('0x3e')](_0x146589['query'],_0x2b3d7c['filters']),_0x881721);if(_0x146589[_0x58eb('0x33')][_0x58eb('0x3f')]){_0x4df434['where']=_[_0x58eb('0x40')](_0x4df434[_0x58eb('0x41')],{'$or':_[_0x58eb('0x2f')](_0x881721,function(_0x4aeba4){if(_0x4aeba4['type']!=='VIRTUAL'){var _0x130005={};_0x130005[_0x4aeba4[_0x58eb('0x2c')]]={'$like':'%'+_0x146589[_0x58eb('0x33')][_0x58eb('0x3f')]+'%'};return _0x130005;}})});}_0x4df434=_[_0x58eb('0x40')]({},_0x4df434,_0x146589[_0x58eb('0x42')]);var _0x4ada96={'where':_0x4df434[_0x58eb('0x41')]};return db['ZendeskConfiguration'][_0x58eb('0x22')](_0x4ada96)['then'](function(_0x54a156){_0x4d68f8[_0x58eb('0x22')]=_0x54a156;if(_0x146589[_0x58eb('0x33')][_0x58eb('0x43')]){_0x4df434['include']=[{'all':!![]}];}return db[_0x58eb('0x44')][_0x58eb('0x45')](_0x4df434);})[_0x58eb('0x28')](function(_0x5c1094){_0x4d68f8[_0x58eb('0x46')]=_0x5c1094;return _0x4d68f8;})[_0x58eb('0x28')](respondWithFilteredResult(_0x5c65fd,_0x4df434))[_0x58eb('0x47')](handleError(_0x5c65fd,null));};exports[_0x58eb('0x48')]=function(_0x181fef,_0x540edf){var _0x15fafb={'raw':![],'where':{'id':_0x181fef[_0x58eb('0x49')]['id']}},_0x522ab8={};_0x522ab8[_0x58eb('0x37')]=_[_0x58eb('0x34')](db[_0x58eb('0x44')]['rawAttributes']);_0x522ab8[_0x58eb('0x33')]=_['keys'](_0x181fef[_0x58eb('0x33')]);_0x522ab8[_0x58eb('0x35')]=_[_0x58eb('0x36')](_0x522ab8[_0x58eb('0x37')],_0x522ab8[_0x58eb('0x33')]);_0x15fafb['attributes']=_['intersection'](_0x522ab8[_0x58eb('0x37')],qs[_0x58eb('0x39')](_0x181fef['query'][_0x58eb('0x39')]));_0x15fafb[_0x58eb('0x38')]=_0x15fafb[_0x58eb('0x38')][_0x58eb('0x3a')]?_0x15fafb[_0x58eb('0x38')]:_0x522ab8[_0x58eb('0x37')];if(_0x181fef[_0x58eb('0x33')][_0x58eb('0x43')]){_0x15fafb[_0x58eb('0x4a')]=[{'all':!![]}];}_0x15fafb=_[_0x58eb('0x40')]({},_0x15fafb,_0x181fef[_0x58eb('0x42')]);return db[_0x58eb('0x44')]['find'](_0x15fafb)[_0x58eb('0x28')](handleEntityNotFound(_0x540edf,null))[_0x58eb('0x28')](respondWithResult(_0x540edf,null))['catch'](handleError(_0x540edf,null));};exports['create']=function(_0x48a88e,_0x258f00){return db['ZendeskConfiguration'][_0x58eb('0x4b')](_0x48a88e[_0x58eb('0x4c')],{})[_0x58eb('0x28')](respondWithResult(_0x258f00,0xc9))['catch'](handleError(_0x258f00,null));};exports[_0x58eb('0x4d')]=function(_0x1c8cb1,_0x54c3f9){if(_0x1c8cb1[_0x58eb('0x4c')]['id']){delete _0x1c8cb1[_0x58eb('0x4c')]['id'];}return db[_0x58eb('0x44')][_0x58eb('0x4e')]({'where':{'id':_0x1c8cb1['params']['id']}})[_0x58eb('0x28')](handleEntityNotFound(_0x54c3f9,null))['then'](saveUpdates(_0x1c8cb1['body'],null))[_0x58eb('0x28')](respondWithResult(_0x54c3f9,null))[_0x58eb('0x47')](handleError(_0x54c3f9,null));};exports['destroy']=function(_0x369b6b,_0x3b072e){return db[_0x58eb('0x44')][_0x58eb('0x4e')]({'where':{'id':_0x369b6b['params']['id']}})[_0x58eb('0x28')](handleEntityNotFound(_0x3b072e,null))['then'](removeEntity(_0x3b072e,null))['catch'](handleError(_0x3b072e,null));};exports[_0x58eb('0x4f')]=function(_0x452c94,_0x299ed9,_0x260976){var _0x3234c2={};var _0x14cbed={};var _0x20c321;var _0x132115;return db[_0x58eb('0x44')][_0x58eb('0x50')]({'where':{'id':_0x452c94['params']['id']}})[_0x58eb('0x28')](handleEntityNotFound(_0x299ed9,null))[_0x58eb('0x28')](function(_0x42306c){if(_0x42306c){_0x20c321=_0x42306c;_0x14cbed[_0x58eb('0x37')]=_[_0x58eb('0x34')](db['ZendeskField'][_0x58eb('0x30')]);_0x14cbed[_0x58eb('0x33')]=_[_0x58eb('0x34')](_0x452c94[_0x58eb('0x33')]);_0x14cbed['filters']=_[_0x58eb('0x36')](_0x14cbed['model'],_0x14cbed[_0x58eb('0x33')]);_0x3234c2[_0x58eb('0x38')]=_[_0x58eb('0x36')](_0x14cbed[_0x58eb('0x37')],qs[_0x58eb('0x39')](_0x452c94['query'][_0x58eb('0x39')]));_0x3234c2[_0x58eb('0x38')]=_0x3234c2['attributes'][_0x58eb('0x3a')]?_0x3234c2['attributes']:_0x14cbed[_0x58eb('0x37')];_0x3234c2['order']=qs[_0x58eb('0x3d')](_0x452c94['query']['sort']);_0x3234c2[_0x58eb('0x41')]=qs[_0x58eb('0x35')](_[_0x58eb('0x3e')](_0x452c94[_0x58eb('0x33')],_0x14cbed[_0x58eb('0x35')]));if(_0x452c94['query'][_0x58eb('0x3f')]){_0x3234c2[_0x58eb('0x41')]=_[_0x58eb('0x40')](_0x3234c2[_0x58eb('0x41')],{'$or':_[_0x58eb('0x2f')](_0x3234c2[_0x58eb('0x38')],function(_0x479ede){var _0x54233f={};_0x54233f[_0x479ede]={'$like':'%'+_0x452c94[_0x58eb('0x33')][_0x58eb('0x3f')]+'%'};return _0x54233f;})});}_0x3234c2=_['merge']({},_0x3234c2,_0x452c94[_0x58eb('0x42')]);return _0x20c321[_0x58eb('0x4f')](_0x3234c2);}})['then'](function(_0x3755b2){if(_0x3755b2){_0x132115=_0x3755b2['length'];if(!_0x452c94[_0x58eb('0x33')][_0x58eb('0x51')](_0x58eb('0x3b'))){_0x3234c2[_0x58eb('0x21')]=qs[_0x58eb('0x21')](_0x452c94[_0x58eb('0x33')]['limit']);_0x3234c2[_0x58eb('0x1f')]=qs['offset'](_0x452c94[_0x58eb('0x33')][_0x58eb('0x1f')]);}return _0x20c321['getFields'](_0x3234c2);}})['then'](function(_0x7d6125){if(_0x7d6125){return _0x7d6125?{'count':_0x132115,'rows':_0x7d6125}:null;}})[_0x58eb('0x28')](respondWithResult(_0x299ed9,null))[_0x58eb('0x47')](handleError(_0x299ed9,null));};exports[_0x58eb('0x52')]=function(_0x50a14e,_0x6fe04a,_0x3eb477){var _0x3b9159={};var _0x22b071={};var _0xbc1671;var _0x1b3714;return db[_0x58eb('0x44')][_0x58eb('0x50')]({'where':{'id':_0x50a14e[_0x58eb('0x49')]['id']}})[_0x58eb('0x28')](handleEntityNotFound(_0x6fe04a,null))[_0x58eb('0x28')](function(_0x314cac){if(_0x314cac){_0xbc1671=_0x314cac;_0x22b071[_0x58eb('0x37')]=_[_0x58eb('0x34')](db[_0x58eb('0x53')][_0x58eb('0x30')]);_0x22b071[_0x58eb('0x33')]=_[_0x58eb('0x34')](_0x50a14e[_0x58eb('0x33')]);_0x22b071[_0x58eb('0x35')]=_[_0x58eb('0x36')](_0x22b071[_0x58eb('0x37')],_0x22b071['query']);_0x3b9159[_0x58eb('0x38')]=_[_0x58eb('0x36')](_0x22b071['model'],qs[_0x58eb('0x39')](_0x50a14e[_0x58eb('0x33')][_0x58eb('0x39')]));_0x3b9159[_0x58eb('0x38')]=_0x3b9159[_0x58eb('0x38')][_0x58eb('0x3a')]?_0x3b9159['attributes']:_0x22b071['model'];_0x3b9159[_0x58eb('0x3c')]=qs[_0x58eb('0x3d')](_0x50a14e[_0x58eb('0x33')][_0x58eb('0x3d')]);_0x3b9159[_0x58eb('0x41')]=qs[_0x58eb('0x35')](_[_0x58eb('0x3e')](_0x50a14e[_0x58eb('0x33')],_0x22b071[_0x58eb('0x35')]));if(_0x50a14e[_0x58eb('0x33')]['filter']){_0x3b9159[_0x58eb('0x41')]=_[_0x58eb('0x40')](_0x3b9159['where'],{'$or':_[_0x58eb('0x2f')](_0x3b9159['attributes'],function(_0x2c9f97){var _0x47fcc3={};_0x47fcc3[_0x2c9f97]={'$like':'%'+_0x50a14e[_0x58eb('0x33')][_0x58eb('0x3f')]+'%'};return _0x47fcc3;})});}_0x3b9159=_[_0x58eb('0x40')]({},_0x3b9159,_0x50a14e[_0x58eb('0x42')]);return _0xbc1671[_0x58eb('0x52')](_0x3b9159);}})['then'](function(_0xa287ac){if(_0xa287ac){_0x1b3714=_0xa287ac['length'];if(!_0x50a14e['query']['hasOwnProperty'](_0x58eb('0x3b'))){_0x3b9159[_0x58eb('0x21')]=qs[_0x58eb('0x21')](_0x50a14e[_0x58eb('0x33')][_0x58eb('0x21')]);_0x3b9159[_0x58eb('0x1f')]=qs['offset'](_0x50a14e[_0x58eb('0x33')]['offset']);}return _0xbc1671['getSubjects'](_0x3b9159);}})[_0x58eb('0x28')](function(_0x887c74){if(_0x887c74){return _0x887c74?{'count':_0x1b3714,'rows':_0x887c74}:null;}})['then'](respondWithResult(_0x6fe04a,null))['catch'](handleError(_0x6fe04a,null));};exports[_0x58eb('0x54')]=function(_0x3ead58,_0x8bd04a,_0x2506cb){var _0x119fbd={};var _0x254c8b={};var _0x111bb6;var _0x44b9d9;return db[_0x58eb('0x44')][_0x58eb('0x50')]({'where':{'id':_0x3ead58[_0x58eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x8bd04a,null))[_0x58eb('0x28')](function(_0x5dcb1c){if(_0x5dcb1c){_0x111bb6=_0x5dcb1c;_0x254c8b[_0x58eb('0x37')]=_[_0x58eb('0x34')](db[_0x58eb('0x53')][_0x58eb('0x30')]);_0x254c8b[_0x58eb('0x33')]=_['keys'](_0x3ead58[_0x58eb('0x33')]);_0x254c8b[_0x58eb('0x35')]=_['intersection'](_0x254c8b[_0x58eb('0x37')],_0x254c8b['query']);_0x119fbd[_0x58eb('0x38')]=_[_0x58eb('0x36')](_0x254c8b[_0x58eb('0x37')],qs[_0x58eb('0x39')](_0x3ead58[_0x58eb('0x33')]['fields']));_0x119fbd[_0x58eb('0x38')]=_0x119fbd['attributes'][_0x58eb('0x3a')]?_0x119fbd[_0x58eb('0x38')]:_0x254c8b[_0x58eb('0x37')];_0x119fbd['order']=qs['sort'](_0x3ead58[_0x58eb('0x33')][_0x58eb('0x3d')]);_0x119fbd['where']=qs[_0x58eb('0x35')](_[_0x58eb('0x3e')](_0x3ead58['query'],_0x254c8b['filters']));if(_0x3ead58[_0x58eb('0x33')][_0x58eb('0x3f')]){_0x119fbd[_0x58eb('0x41')]=_[_0x58eb('0x40')](_0x119fbd[_0x58eb('0x41')],{'$or':_['map'](_0x119fbd[_0x58eb('0x38')],function(_0x93d1bf){var _0x8cbd47={};_0x8cbd47[_0x93d1bf]={'$like':'%'+_0x3ead58[_0x58eb('0x33')][_0x58eb('0x3f')]+'%'};return _0x8cbd47;})});}_0x119fbd=_[_0x58eb('0x40')]({},_0x119fbd,_0x3ead58['options']);return _0x111bb6['getDescriptions'](_0x119fbd);}})[_0x58eb('0x28')](function(_0xde1322){if(_0xde1322){_0x44b9d9=_0xde1322[_0x58eb('0x3a')];if(!_0x3ead58['query'][_0x58eb('0x51')]('nolimit')){_0x119fbd['limit']=qs[_0x58eb('0x21')](_0x3ead58[_0x58eb('0x33')]['limit']);_0x119fbd[_0x58eb('0x1f')]=qs[_0x58eb('0x1f')](_0x3ead58['query'][_0x58eb('0x1f')]);}return _0x111bb6['getDescriptions'](_0x119fbd);}})['then'](function(_0x426207){if(_0x426207){return _0x426207?{'count':_0x44b9d9,'rows':_0x426207}:null;}})[_0x58eb('0x28')](respondWithResult(_0x8bd04a,null))['catch'](handleError(_0x8bd04a,null));};exports[_0x58eb('0x55')]=function(_0x151d2f,_0x1d2208,_0x454ce0){var _0x159249={};var _0x15b63f={};var _0x38fb71;var _0x5484c7;return db[_0x58eb('0x44')]['findOne']({'where':{'id':_0x151d2f[_0x58eb('0x49')]['id']}})[_0x58eb('0x28')](handleEntityNotFound(_0x1d2208,null))['then'](function(_0x28c1fc){if(_0x28c1fc){_0x38fb71=_0x28c1fc;_0x15b63f[_0x58eb('0x37')]=_[_0x58eb('0x34')](db[_0x58eb('0x56')][_0x58eb('0x30')]);_0x15b63f[_0x58eb('0x33')]=_[_0x58eb('0x34')](_0x151d2f[_0x58eb('0x33')]);_0x15b63f['filters']=_[_0x58eb('0x36')](_0x15b63f[_0x58eb('0x37')],_0x15b63f[_0x58eb('0x33')]);_0x159249[_0x58eb('0x38')]=_[_0x58eb('0x36')](_0x15b63f['model'],qs[_0x58eb('0x39')](_0x151d2f['query'][_0x58eb('0x39')]));_0x159249[_0x58eb('0x38')]=_0x159249['attributes'][_0x58eb('0x3a')]?_0x159249[_0x58eb('0x38')]:_0x15b63f['model'];_0x159249['order']=qs[_0x58eb('0x3d')](_0x151d2f['query'][_0x58eb('0x3d')]);_0x159249[_0x58eb('0x41')]=qs['filters'](_[_0x58eb('0x3e')](_0x151d2f[_0x58eb('0x33')],_0x15b63f[_0x58eb('0x35')]));if(_0x151d2f[_0x58eb('0x33')][_0x58eb('0x3f')]){_0x159249[_0x58eb('0x41')]=_[_0x58eb('0x40')](_0x159249[_0x58eb('0x41')],{'$or':_[_0x58eb('0x2f')](_0x159249['attributes'],function(_0x2bba7e){var _0x9cf31c={};_0x9cf31c[_0x2bba7e]={'$like':'%'+_0x151d2f[_0x58eb('0x33')][_0x58eb('0x3f')]+'%'};return _0x9cf31c;})});}_0x159249=_[_0x58eb('0x40')]({},_0x159249,_0x151d2f[_0x58eb('0x42')]);return _0x38fb71['getTags'](_0x159249);}})[_0x58eb('0x28')](function(_0x63cb37){if(_0x63cb37){_0x5484c7=_0x63cb37[_0x58eb('0x3a')];if(!_0x151d2f[_0x58eb('0x33')][_0x58eb('0x51')](_0x58eb('0x3b'))){_0x159249[_0x58eb('0x21')]=qs[_0x58eb('0x21')](_0x151d2f['query'][_0x58eb('0x21')]);_0x159249[_0x58eb('0x1f')]=qs[_0x58eb('0x1f')](_0x151d2f[_0x58eb('0x33')][_0x58eb('0x1f')]);}return _0x38fb71['getTags'](_0x159249);}})[_0x58eb('0x28')](function(_0x288229){if(_0x288229){return _0x288229?{'count':_0x5484c7,'rows':_0x288229}:null;}})['then'](respondWithResult(_0x1d2208,null))[_0x58eb('0x47')](handleError(_0x1d2208,null));};exports['setTags']=function(_0x2a0586,_0x6cf288,_0xd167cf){if(_0x2a0586['body']['id']){delete _0x2a0586[_0x58eb('0x4c')]['id'];}return db[_0x58eb('0x44')][_0x58eb('0x50')]({'where':{'id':_0x2a0586['params']['id']}})['then'](handleEntityNotFound(_0x6cf288,null))[_0x58eb('0x28')](function(_0x4941bb){if(_0x4941bb){return _0x4941bb[_0x58eb('0x57')](_0x2a0586['body']['ids']||[]);}return null;})[_0x58eb('0x28')](respondWithResult(_0x6cf288,null))[_0x58eb('0x47')](handleError(_0x6cf288,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 2138201..a8c6ab3 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 _0x6e6c=['moment','path','../../config/environment','exports','define','ZendeskConfiguration','lodash','util','api'];(function(_0x411cae,_0x2f5e91){var _0x5d1417=function(_0x47f203){while(--_0x47f203){_0x411cae['push'](_0x411cae['shift']());}};_0x5d1417(++_0x2f5e91);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe820=['exports','define','ZendeskConfiguration','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x555161,_0x2cd1ed){var _0x4919e9=function(_0x23226b){while(--_0x23226b){_0x555161['push'](_0x555161['shift']());}};_0x4919e9(++_0x2cd1ed);}(_0xe820,0xd2));var _0x0e82=function(_0x3f761c,_0x2f7971){_0x3f761c=_0x3f761c-0x0;var _0xb05859=_0xe820[_0x3f761c];return _0xb05859;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var logger=require(_0x0e82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0e82('0x2'));var rp=require(_0x0e82('0x3'));var fs=require('fs');var path=require(_0x0e82('0x4'));var rimraf=require('rimraf');var config=require(_0x0e82('0x5'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x0e82('0x6')]=function(_0x105e3c,_0x69e27f){return _0x105e3c[_0x0e82('0x7')](_0x0e82('0x8'),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 d0fbfea..658f145 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 _0x87d9=['request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87d9,0xe8));var _0x987d=function(_0x29e2ba,_0x1b171f){_0x29e2ba=_0x29e2ba-0x0;var _0x5c5920=_0x87d9[_0x29e2ba];return _0x5c5920;};'use strict';var _=require(_0x987d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x987d('0x1'));var rs=require(_0x987d('0x2'));var fs=require('fs');var Redis=require(_0x987d('0x3'));var db=require(_0x987d('0x4'))['db'];var utils=require(_0x987d('0x5'));var logger=require(_0x987d('0x6'))(_0x987d('0x7'));var config=require('../../config/environment');var jayson=require(_0x987d('0x8'));var client=jayson['client'][_0x987d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27def1,_0x2894e7,_0xb123ed){return new BPromise(function(_0x22f689,_0x4ed6c5){return client[_0x987d('0xa')](_0x27def1,_0xb123ed)['then'](function(_0x4a7d08){logger[_0x987d('0xb')](_0x987d('0xc'),_0x2894e7,_0x987d('0xd'));logger[_0x987d('0xe')](_0x987d('0xf'),_0x2894e7,_0x987d('0xd'),JSON[_0x987d('0x10')](_0x4a7d08));if(_0x4a7d08['error']){if(_0x4a7d08[_0x987d('0x11')][_0x987d('0x12')]===0x1f4){logger[_0x987d('0x11')](_0x987d('0xc'),_0x2894e7,_0x4a7d08['error'][_0x987d('0x13')]);return _0x4ed6c5(_0x4a7d08[_0x987d('0x11')][_0x987d('0x13')]);}logger[_0x987d('0x11')](_0x987d('0xc'),_0x2894e7,_0x4a7d08[_0x987d('0x11')][_0x987d('0x13')]);return _0x22f689(_0x4a7d08[_0x987d('0x11')][_0x987d('0x13')]);}else{logger[_0x987d('0xb')](_0x987d('0xc'),_0x2894e7,_0x987d('0xd'));_0x22f689(_0x4a7d08[_0x987d('0x14')]['message']);}})[_0x987d('0x15')](function(_0x5e7756){logger[_0x987d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2894e7,_0x5e7756);_0x4ed6c5(_0x5e7756);});});} \ No newline at end of file +var _0x9732=['http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x104685,_0x131c93){var _0x1cfa74=function(_0x154a75){while(--_0x154a75){_0x104685['push'](_0x104685['shift']());}};_0x1cfa74(++_0x131c93);}(_0x9732,0xcd));var _0x2973=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x9732[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x2973('0x0'));var util=require(_0x2973('0x1'));var moment=require(_0x2973('0x2'));var BPromise=require(_0x2973('0x3'));var rs=require(_0x2973('0x4'));var fs=require('fs');var Redis=require(_0x2973('0x5'));var db=require(_0x2973('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2973('0x7'))('rpc');var config=require(_0x2973('0x8'));var jayson=require(_0x2973('0x9'));var client=jayson[_0x2973('0xa')][_0x2973('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1462d7,_0x1ae4c5,_0x3f74d6){return new BPromise(function(_0x141f0d,_0x5590bc){return client[_0x2973('0xc')](_0x1462d7,_0x3f74d6)[_0x2973('0xd')](function(_0x3fbfdc){logger['info'](_0x2973('0xe'),_0x1ae4c5,_0x2973('0xf'));logger[_0x2973('0x10')](_0x2973('0x11'),_0x1ae4c5,'request\x20sent',JSON[_0x2973('0x12')](_0x3fbfdc));if(_0x3fbfdc[_0x2973('0x13')]){if(_0x3fbfdc[_0x2973('0x13')][_0x2973('0x14')]===0x1f4){logger['error'](_0x2973('0xe'),_0x1ae4c5,_0x3fbfdc[_0x2973('0x13')]['message']);return _0x5590bc(_0x3fbfdc[_0x2973('0x13')][_0x2973('0x15')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1ae4c5,_0x3fbfdc[_0x2973('0x13')][_0x2973('0x15')]);return _0x141f0d(_0x3fbfdc[_0x2973('0x13')][_0x2973('0x15')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1ae4c5,_0x2973('0xf'));_0x141f0d(_0x3fbfdc[_0x2973('0x16')][_0x2973('0x15')]);}})[_0x2973('0x17')](function(_0x5ba83b){logger[_0x2973('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1ae4c5,_0x5ba83b);_0x5590bc(_0x5ba83b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f535b1a..3487d4c 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 _0x8285=['isAuthenticated','index','get','/:id','show','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0x2a8021,_0x4eb97c){var _0x131b0f=function(_0x2cc7dd){while(--_0x2cc7dd){_0x2a8021['push'](_0x2a8021['shift']());}};_0x131b0f(++_0x4eb97c);}(_0x8285,0x6e));var _0x5828=function(_0x4a0b92,_0x1dbd16){_0x4a0b92=_0x4a0b92-0x0;var _0x857610=_0x8285[_0x4a0b92];return _0x857610;};'use strict';var multer=require(_0x5828('0x0'));var util=require(_0x5828('0x1'));var path=require(_0x5828('0x2'));var timeout=require('connect-timeout');var express=require(_0x5828('0x3'));var router=express[_0x5828('0x4')]();var fs_extra=require(_0x5828('0x5'));var auth=require(_0x5828('0x6'));var interaction=require(_0x5828('0x7'));var config=require(_0x5828('0x8'));var controller=require(_0x5828('0x9'));router['get']('/',auth[_0x5828('0xa')](),controller[_0x5828('0xb')]);router[_0x5828('0xc')](_0x5828('0xd'),auth[_0x5828('0xa')](),controller[_0x5828('0xe')]);router['post']('/',auth[_0x5828('0xa')](),controller['create']);router[_0x5828('0xf')](_0x5828('0xd'),auth['isAuthenticated'](),controller[_0x5828('0x10')]);router[_0x5828('0x11')](_0x5828('0xd'),auth[_0x5828('0xa')](),controller[_0x5828('0x12')]);module[_0x5828('0x13')]=router; \ No newline at end of file +var _0xec22=['index','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x4cf8c4,_0x4e7dfc){var _0x2a6909=function(_0x4e180b){while(--_0x4e180b){_0x4cf8c4['push'](_0x4cf8c4['shift']());}};_0x2a6909(++_0x4e7dfc);}(_0xec22,0xf1));var _0x2ec2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xec22[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x2ec2('0x0'));var util=require(_0x2ec2('0x1'));var path=require(_0x2ec2('0x2'));var timeout=require(_0x2ec2('0x3'));var express=require('express');var router=express[_0x2ec2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ec2('0x5'));var interaction=require(_0x2ec2('0x6'));var config=require(_0x2ec2('0x7'));var controller=require(_0x2ec2('0x8'));router[_0x2ec2('0x9')]('/',auth[_0x2ec2('0xa')](),controller[_0x2ec2('0xb')]);router[_0x2ec2('0x9')]('/:id',auth[_0x2ec2('0xa')](),controller['show']);router['post']('/',auth[_0x2ec2('0xa')](),controller[_0x2ec2('0xc')]);router[_0x2ec2('0xd')]('/:id',auth[_0x2ec2('0xa')](),controller[_0x2ec2('0xe')]);router[_0x2ec2('0xf')](_0x2ec2('0x10'),auth[_0x2ec2('0xa')](),controller['destroy']);module[_0x2ec2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 7d5a07e..32ca9aa 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 _0x443b=['customVariable','picklist','string','STRING','ENUM','sequelize','exports','variable'];(function(_0xfa260b,_0xd2d0d){var _0x48fb84=function(_0x111f00){while(--_0x111f00){_0xfa260b['push'](_0xfa260b['shift']());}};_0x48fb84(++_0xd2d0d);}(_0x443b,0x155));var _0xb443=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x443b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb443('0x0'));module[_0xb443('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xb443('0x2'),_0xb443('0x3'),'keyValue',_0xb443('0x4')),'defaultValue':_0xb443('0x5')},'content':{'type':Sequelize[_0xb443('0x6')]},'key':{'type':Sequelize[_0xb443('0x6')]},'keyType':{'type':Sequelize[_0xb443('0x7')](_0xb443('0x5'),_0xb443('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xb443('0x6')]},'idField':{'type':Sequelize[_0xb443('0x6')]},'nameField':{'type':Sequelize[_0xb443('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb443('0x6')]}}; \ No newline at end of file +var _0xf837=['string','STRING','ENUM','BOOLEAN','sequelize','variable','customVariable','keyValue'];(function(_0x4853a2,_0xa7fdae){var _0x4d2600=function(_0x4cf3db){while(--_0x4cf3db){_0x4853a2['push'](_0x4853a2['shift']());}};_0x4d2600(++_0xa7fdae);}(_0xf837,0x1f4));var _0x7f83=function(_0x32569d,_0x58f9de){_0x32569d=_0x32569d-0x0;var _0x52dabf=_0xf837[_0x32569d];return _0x52dabf;};'use strict';var Sequelize=require(_0x7f83('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x7f83('0x1'),_0x7f83('0x2'),_0x7f83('0x3'),'picklist'),'defaultValue':_0x7f83('0x4')},'content':{'type':Sequelize[_0x7f83('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7f83('0x6')](_0x7f83('0x4'),_0x7f83('0x1'),_0x7f83('0x2'))},'keyContent':{'type':Sequelize[_0x7f83('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7f83('0x5')]},'customField':{'type':Sequelize[_0x7f83('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f83('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a5786a6..d095306 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 _0xccdd=['apply','reject','update','destroy','then','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count'];(function(_0x444f34,_0x194428){var _0x37128a=function(_0x750654){while(--_0x750654){_0x444f34['push'](_0x444f34['shift']());}};_0x37128a(++_0x194428);}(_0xccdd,0x71));var _0xdccd=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xccdd[_0x54edc9];return _0x2ae7a9;};'use strict';var emlformat=require(_0xdccd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdccd('0x1'));var jsonpatch=require(_0xdccd('0x2'));var rp=require(_0xdccd('0x3'));var moment=require(_0xdccd('0x4'));var BPromise=require(_0xdccd('0x5'));var Mustache=require(_0xdccd('0x6'));var util=require(_0xdccd('0x7'));var path=require(_0xdccd('0x8'));var sox=require(_0xdccd('0x9'));var csv=require(_0xdccd('0xa'));var ejs=require(_0xdccd('0xb'));var fs=require('fs');var fs_extra=require(_0xdccd('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdccd('0xd'));var jsforce=require(_0xdccd('0xe'));var deskjs=require(_0xdccd('0xf'));var toCsv=require(_0xdccd('0xa'));var querystring=require('querystring');var Papa=require(_0xdccd('0x10'));var Redis=require(_0xdccd('0x11'));var authService=require(_0xdccd('0x12'));var qs=require(_0xdccd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdccd('0x14'));var logger=require('../../config/logger')(_0xdccd('0x15'));var utils=require(_0xdccd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdccd('0x17'));var db=require(_0xdccd('0x18'))['db'];function respondWithStatusCode(_0x574ff4,_0x4f4bb1){_0x4f4bb1=_0x4f4bb1||0xcc;return function(_0x27b91b){if(_0x27b91b){return _0x574ff4[_0xdccd('0x19')](_0x4f4bb1);}return _0x574ff4['status'](_0x4f4bb1)[_0xdccd('0x1a')]();};}function respondWithResult(_0x1382c7,_0x3544f3){_0x3544f3=_0x3544f3||0xc8;return function(_0x45034c){if(_0x45034c){return _0x1382c7[_0xdccd('0x1b')](_0x3544f3)[_0xdccd('0x1c')](_0x45034c);}};}function respondWithFilteredResult(_0x18e006,_0x4f5bad){return function(_0x151510){if(_0x151510){var _0x4155d0=typeof _0x4f5bad['offset']===_0xdccd('0x1d')&&typeof _0x4f5bad[_0xdccd('0x1e')]==='undefined';var _0x3a7159=_0x151510['count'];var _0x396428=_0x4155d0?0x0:_0x4f5bad[_0xdccd('0x1f')];var _0x5685b9=_0x4155d0?_0x151510[_0xdccd('0x20')]:_0x4f5bad[_0xdccd('0x1f')]+_0x4f5bad['limit'];var _0x55a327;if(_0x5685b9>=_0x3a7159){_0x5685b9=_0x3a7159;_0x55a327=0xc8;}else{_0x55a327=0xce;}_0x18e006['status'](_0x55a327);return _0x18e006['set']('Content-Range',_0x396428+'-'+_0x5685b9+'/'+_0x3a7159)[_0xdccd('0x1c')](_0x151510);}return null;};}function patchUpdates(_0x108b3b){return function(_0x1fb666){try{jsonpatch[_0xdccd('0x21')](_0x1fb666,_0x108b3b,!![]);}catch(_0x58dc84){return BPromise[_0xdccd('0x22')](_0x58dc84);}return _0x1fb666['save']();};}function saveUpdates(_0x5b151b,_0x1737aa){return function(_0xabb77b){if(_0xabb77b){return _0xabb77b[_0xdccd('0x23')](_0x5b151b)['then'](function(_0x402645){return _0x402645;});}return null;};}function removeEntity(_0x286ce9,_0x2599c3){return function(_0x2dcdaa){if(_0x2dcdaa){return _0x2dcdaa[_0xdccd('0x24')]()[_0xdccd('0x25')](function(){_0x286ce9['status'](0xcc)[_0xdccd('0x1a')]();});}};}function handleEntityNotFound(_0x5a73d8,_0x49220d){return function(_0xe7c9a){if(!_0xe7c9a){_0x5a73d8[_0xdccd('0x19')](0x194);}return _0xe7c9a;};}function handleError(_0x158dac,_0x321a9d){_0x321a9d=_0x321a9d||0x1f4;return function(_0x5152bd){logger['error'](_0x5152bd[_0xdccd('0x26')]);if(_0x5152bd[_0xdccd('0x27')]){delete _0x5152bd['name'];}_0x158dac['status'](_0x321a9d)[_0xdccd('0x28')](_0x5152bd);};}exports['index']=function(_0x50d00f,_0x5aa740){var _0xb66d3={},_0x384d4a={},_0x49d065={'count':0x0,'rows':[]};var _0x2f10f2=_[_0xdccd('0x29')](db[_0xdccd('0x2a')][_0xdccd('0x2b')],function(_0x86ccb1){return{'name':_0x86ccb1[_0xdccd('0x2c')],'type':_0x86ccb1[_0xdccd('0x2d')][_0xdccd('0x2e')]};});_0x384d4a[_0xdccd('0x2f')]=_[_0xdccd('0x29')](_0x2f10f2,_0xdccd('0x27'));_0x384d4a[_0xdccd('0x30')]=_[_0xdccd('0x31')](_0x50d00f[_0xdccd('0x30')]);_0x384d4a['filters']=_[_0xdccd('0x32')](_0x384d4a[_0xdccd('0x2f')],_0x384d4a[_0xdccd('0x30')]);_0xb66d3[_0xdccd('0x33')]=_['intersection'](_0x384d4a[_0xdccd('0x2f')],qs[_0xdccd('0x34')](_0x50d00f[_0xdccd('0x30')][_0xdccd('0x34')]));_0xb66d3[_0xdccd('0x33')]=_0xb66d3[_0xdccd('0x33')][_0xdccd('0x35')]?_0xb66d3[_0xdccd('0x33')]:_0x384d4a[_0xdccd('0x2f')];if(!_0x50d00f[_0xdccd('0x30')][_0xdccd('0x36')](_0xdccd('0x37'))){_0xb66d3[_0xdccd('0x1e')]=qs[_0xdccd('0x1e')](_0x50d00f[_0xdccd('0x30')][_0xdccd('0x1e')]);_0xb66d3[_0xdccd('0x1f')]=qs[_0xdccd('0x1f')](_0x50d00f[_0xdccd('0x30')]['offset']);}_0xb66d3['order']=qs[_0xdccd('0x38')](_0x50d00f['query']['sort']);_0xb66d3[_0xdccd('0x39')]=qs[_0xdccd('0x3a')](_['pick'](_0x50d00f[_0xdccd('0x30')],_0x384d4a[_0xdccd('0x3a')]),_0x2f10f2);if(_0x50d00f[_0xdccd('0x30')][_0xdccd('0x3b')]){_0xb66d3[_0xdccd('0x39')]=_[_0xdccd('0x3c')](_0xb66d3['where'],{'$or':_[_0xdccd('0x29')](_0x2f10f2,function(_0x34001e){if(_0x34001e[_0xdccd('0x2d')]!==_0xdccd('0x3d')){var _0x5c0c0b={};_0x5c0c0b[_0x34001e['name']]={'$like':'%'+_0x50d00f[_0xdccd('0x30')][_0xdccd('0x3b')]+'%'};return _0x5c0c0b;}})});}_0xb66d3=_['merge']({},_0xb66d3,_0x50d00f[_0xdccd('0x3e')]);var _0x5273cb={'where':_0xb66d3[_0xdccd('0x39')]};return db['ZendeskField']['count'](_0x5273cb)['then'](function(_0x93f68d){_0x49d065['count']=_0x93f68d;if(_0x50d00f['query']['includeAll']){_0xb66d3[_0xdccd('0x3f')]=[{'all':!![]}];}return db[_0xdccd('0x2a')][_0xdccd('0x40')](_0xb66d3);})[_0xdccd('0x25')](function(_0x26cfe7){_0x49d065[_0xdccd('0x41')]=_0x26cfe7;return _0x49d065;})[_0xdccd('0x25')](respondWithFilteredResult(_0x5aa740,_0xb66d3))['catch'](handleError(_0x5aa740,null));};exports[_0xdccd('0x42')]=function(_0x23b917,_0x441a35){var _0x2220c2={'raw':!![],'where':{'id':_0x23b917[_0xdccd('0x43')]['id']}},_0x59d429={};_0x59d429[_0xdccd('0x2f')]=_[_0xdccd('0x31')](db[_0xdccd('0x2a')][_0xdccd('0x2b')]);_0x59d429[_0xdccd('0x30')]=_[_0xdccd('0x31')](_0x23b917[_0xdccd('0x30')]);_0x59d429[_0xdccd('0x3a')]=_[_0xdccd('0x32')](_0x59d429[_0xdccd('0x2f')],_0x59d429['query']);_0x2220c2[_0xdccd('0x33')]=_[_0xdccd('0x32')](_0x59d429[_0xdccd('0x2f')],qs[_0xdccd('0x34')](_0x23b917['query'][_0xdccd('0x34')]));_0x2220c2[_0xdccd('0x33')]=_0x2220c2[_0xdccd('0x33')][_0xdccd('0x35')]?_0x2220c2['attributes']:_0x59d429[_0xdccd('0x2f')];if(_0x23b917[_0xdccd('0x30')][_0xdccd('0x44')]){_0x2220c2['include']=[{'all':!![]}];}_0x2220c2=_[_0xdccd('0x3c')]({},_0x2220c2,_0x23b917[_0xdccd('0x3e')]);return db[_0xdccd('0x2a')][_0xdccd('0x45')](_0x2220c2)['then'](handleEntityNotFound(_0x441a35,null))[_0xdccd('0x25')](respondWithResult(_0x441a35,null))[_0xdccd('0x46')](handleError(_0x441a35,null));};exports[_0xdccd('0x47')]=function(_0x440c60,_0x3a85d6){return db[_0xdccd('0x2a')][_0xdccd('0x47')](_0x440c60[_0xdccd('0x48')],{})[_0xdccd('0x25')](respondWithResult(_0x3a85d6,0xc9))[_0xdccd('0x46')](handleError(_0x3a85d6,null));};exports[_0xdccd('0x23')]=function(_0x58e4e9,_0x32ad5a){if(_0x58e4e9[_0xdccd('0x48')]['id']){delete _0x58e4e9['body']['id'];}return db['ZendeskField'][_0xdccd('0x45')]({'where':{'id':_0x58e4e9[_0xdccd('0x43')]['id']}})[_0xdccd('0x25')](handleEntityNotFound(_0x32ad5a,null))[_0xdccd('0x25')](saveUpdates(_0x58e4e9[_0xdccd('0x48')],null))[_0xdccd('0x25')](respondWithResult(_0x32ad5a,null))[_0xdccd('0x46')](handleError(_0x32ad5a,null));};exports[_0xdccd('0x24')]=function(_0x2c39ed,_0x3cb134){return db[_0xdccd('0x2a')]['find']({'where':{'id':_0x2c39ed['params']['id']}})[_0xdccd('0x25')](handleEntityNotFound(_0x3cb134,null))[_0xdccd('0x25')](removeEntity(_0x3cb134,null))[_0xdccd('0x46')](handleError(_0x3cb134,null));}; \ No newline at end of file +var _0x61e6=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','include','catch','params','includeAll','options','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x16a599,_0x4e9cec){var _0x218dc=function(_0x4b7654){while(--_0x4b7654){_0x16a599['push'](_0x16a599['shift']());}};_0x218dc(++_0x4e9cec);}(_0x61e6,0x1a3));var _0x661e=function(_0x1aeeae,_0x185a30){_0x1aeeae=_0x1aeeae-0x0;var _0x40b0c7=_0x61e6[_0x1aeeae];return _0x40b0c7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x661e('0x0'));var jsonpatch=require(_0x661e('0x1'));var rp=require(_0x661e('0x2'));var moment=require(_0x661e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x661e('0x4'));var util=require(_0x661e('0x5'));var path=require(_0x661e('0x6'));var sox=require(_0x661e('0x7'));var csv=require(_0x661e('0x8'));var ejs=require(_0x661e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x661e('0xa'));var squel=require(_0x661e('0xb'));var crypto=require(_0x661e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x661e('0x8'));var querystring=require(_0x661e('0xd'));var Papa=require(_0x661e('0xe'));var Redis=require(_0x661e('0xf'));var authService=require(_0x661e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x661e('0x11'));var logger=require(_0x661e('0x12'))('api');var utils=require(_0x661e('0x13'));var config=require(_0x661e('0x14'));var licenseUtil=require(_0x661e('0x15'));var db=require(_0x661e('0x16'))['db'];function respondWithStatusCode(_0x2e4e9f,_0x43ac63){_0x43ac63=_0x43ac63||0xcc;return function(_0x51b32e){if(_0x51b32e){return _0x2e4e9f[_0x661e('0x17')](_0x43ac63);}return _0x2e4e9f[_0x661e('0x18')](_0x43ac63)['end']();};}function respondWithResult(_0x2c39ea,_0x376511){_0x376511=_0x376511||0xc8;return function(_0x3c3326){if(_0x3c3326){return _0x2c39ea[_0x661e('0x18')](_0x376511)[_0x661e('0x19')](_0x3c3326);}};}function respondWithFilteredResult(_0xe79a13,_0x852e1){return function(_0x3f2096){if(_0x3f2096){var _0x5a61f9=typeof _0x852e1['offset']==='undefined'&&typeof _0x852e1[_0x661e('0x1a')]===_0x661e('0x1b');var _0x360473=_0x3f2096['count'];var _0x50079a=_0x5a61f9?0x0:_0x852e1[_0x661e('0x1c')];var _0x2b0107=_0x5a61f9?_0x3f2096['count']:_0x852e1['offset']+_0x852e1[_0x661e('0x1a')];var _0x2836d5;if(_0x2b0107>=_0x360473){_0x2b0107=_0x360473;_0x2836d5=0xc8;}else{_0x2836d5=0xce;}_0xe79a13[_0x661e('0x18')](_0x2836d5);return _0xe79a13['set'](_0x661e('0x1d'),_0x50079a+'-'+_0x2b0107+'/'+_0x360473)[_0x661e('0x19')](_0x3f2096);}return null;};}function patchUpdates(_0x1b8fc7){return function(_0x2218aa){try{jsonpatch[_0x661e('0x1e')](_0x2218aa,_0x1b8fc7,!![]);}catch(_0x488281){return BPromise[_0x661e('0x1f')](_0x488281);}return _0x2218aa[_0x661e('0x20')]();};}function saveUpdates(_0x5df9ba,_0x5dda67){return function(_0x201fb1){if(_0x201fb1){return _0x201fb1[_0x661e('0x21')](_0x5df9ba)[_0x661e('0x22')](function(_0x360743){return _0x360743;});}return null;};}function removeEntity(_0x42fb11,_0x16fc53){return function(_0x284fdd){if(_0x284fdd){return _0x284fdd[_0x661e('0x23')]()[_0x661e('0x22')](function(){_0x42fb11[_0x661e('0x18')](0xcc)[_0x661e('0x24')]();});}};}function handleEntityNotFound(_0x4d717e,_0x3f9308){return function(_0x2d014a){if(!_0x2d014a){_0x4d717e[_0x661e('0x17')](0x194);}return _0x2d014a;};}function handleError(_0xb0c95b,_0x188f0a){_0x188f0a=_0x188f0a||0x1f4;return function(_0x5ece15){logger[_0x661e('0x25')](_0x5ece15[_0x661e('0x26')]);if(_0x5ece15[_0x661e('0x27')]){delete _0x5ece15[_0x661e('0x27')];}_0xb0c95b[_0x661e('0x18')](_0x188f0a)[_0x661e('0x28')](_0x5ece15);};}exports[_0x661e('0x29')]=function(_0xc410fe,_0xdebda0){var _0x2e18dd={},_0xb5da42={},_0x40f5df={'count':0x0,'rows':[]};var _0x3b75ef=_[_0x661e('0x2a')](db[_0x661e('0x2b')][_0x661e('0x2c')],function(_0x3c9b23){return{'name':_0x3c9b23['fieldName'],'type':_0x3c9b23[_0x661e('0x2d')][_0x661e('0x2e')]};});_0xb5da42['model']=_[_0x661e('0x2a')](_0x3b75ef,_0x661e('0x27'));_0xb5da42[_0x661e('0x2f')]=_[_0x661e('0x30')](_0xc410fe[_0x661e('0x2f')]);_0xb5da42[_0x661e('0x31')]=_[_0x661e('0x32')](_0xb5da42[_0x661e('0x33')],_0xb5da42['query']);_0x2e18dd[_0x661e('0x34')]=_[_0x661e('0x32')](_0xb5da42['model'],qs[_0x661e('0x35')](_0xc410fe[_0x661e('0x2f')][_0x661e('0x35')]));_0x2e18dd[_0x661e('0x34')]=_0x2e18dd[_0x661e('0x34')][_0x661e('0x36')]?_0x2e18dd[_0x661e('0x34')]:_0xb5da42['model'];if(!_0xc410fe[_0x661e('0x2f')][_0x661e('0x37')](_0x661e('0x38'))){_0x2e18dd[_0x661e('0x1a')]=qs['limit'](_0xc410fe['query'][_0x661e('0x1a')]);_0x2e18dd[_0x661e('0x1c')]=qs[_0x661e('0x1c')](_0xc410fe[_0x661e('0x2f')][_0x661e('0x1c')]);}_0x2e18dd[_0x661e('0x39')]=qs[_0x661e('0x3a')](_0xc410fe[_0x661e('0x2f')][_0x661e('0x3a')]);_0x2e18dd['where']=qs[_0x661e('0x31')](_[_0x661e('0x3b')](_0xc410fe[_0x661e('0x2f')],_0xb5da42[_0x661e('0x31')]),_0x3b75ef);if(_0xc410fe[_0x661e('0x2f')]['filter']){_0x2e18dd[_0x661e('0x3c')]=_[_0x661e('0x3d')](_0x2e18dd['where'],{'$or':_[_0x661e('0x2a')](_0x3b75ef,function(_0x28d7fa){if(_0x28d7fa[_0x661e('0x2d')]!==_0x661e('0x3e')){var _0x11aac8={};_0x11aac8[_0x28d7fa['name']]={'$like':'%'+_0xc410fe[_0x661e('0x2f')][_0x661e('0x3f')]+'%'};return _0x11aac8;}})});}_0x2e18dd=_[_0x661e('0x3d')]({},_0x2e18dd,_0xc410fe['options']);var _0x5551c5={'where':_0x2e18dd[_0x661e('0x3c')]};return db['ZendeskField'][_0x661e('0x40')](_0x5551c5)[_0x661e('0x22')](function(_0x27b03e){_0x40f5df[_0x661e('0x40')]=_0x27b03e;if(_0xc410fe[_0x661e('0x2f')]['includeAll']){_0x2e18dd[_0x661e('0x41')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x2e18dd);})[_0x661e('0x22')](function(_0x59e2d8){_0x40f5df['rows']=_0x59e2d8;return _0x40f5df;})[_0x661e('0x22')](respondWithFilteredResult(_0xdebda0,_0x2e18dd))[_0x661e('0x42')](handleError(_0xdebda0,null));};exports['show']=function(_0x3a8736,_0x18d34c){var _0x2beb28={'raw':!![],'where':{'id':_0x3a8736[_0x661e('0x43')]['id']}},_0x56a462={};_0x56a462['model']=_['keys'](db[_0x661e('0x2b')]['rawAttributes']);_0x56a462[_0x661e('0x2f')]=_[_0x661e('0x30')](_0x3a8736[_0x661e('0x2f')]);_0x56a462['filters']=_[_0x661e('0x32')](_0x56a462['model'],_0x56a462[_0x661e('0x2f')]);_0x2beb28[_0x661e('0x34')]=_['intersection'](_0x56a462[_0x661e('0x33')],qs[_0x661e('0x35')](_0x3a8736['query'][_0x661e('0x35')]));_0x2beb28[_0x661e('0x34')]=_0x2beb28[_0x661e('0x34')]['length']?_0x2beb28[_0x661e('0x34')]:_0x56a462[_0x661e('0x33')];if(_0x3a8736[_0x661e('0x2f')][_0x661e('0x44')]){_0x2beb28[_0x661e('0x41')]=[{'all':!![]}];}_0x2beb28=_['merge']({},_0x2beb28,_0x3a8736[_0x661e('0x45')]);return db['ZendeskField']['find'](_0x2beb28)[_0x661e('0x22')](handleEntityNotFound(_0x18d34c,null))['then'](respondWithResult(_0x18d34c,null))[_0x661e('0x42')](handleError(_0x18d34c,null));};exports[_0x661e('0x46')]=function(_0x693c20,_0x57e84f){return db[_0x661e('0x2b')][_0x661e('0x46')](_0x693c20['body'],{})[_0x661e('0x22')](respondWithResult(_0x57e84f,0xc9))[_0x661e('0x42')](handleError(_0x57e84f,null));};exports[_0x661e('0x21')]=function(_0x47412f,_0x39fccf){if(_0x47412f['body']['id']){delete _0x47412f[_0x661e('0x47')]['id'];}return db[_0x661e('0x2b')]['find']({'where':{'id':_0x47412f[_0x661e('0x43')]['id']}})[_0x661e('0x22')](handleEntityNotFound(_0x39fccf,null))[_0x661e('0x22')](saveUpdates(_0x47412f['body'],null))[_0x661e('0x22')](respondWithResult(_0x39fccf,null))['catch'](handleError(_0x39fccf,null));};exports[_0x661e('0x23')]=function(_0x404772,_0x2cc958){return db['ZendeskField']['find']({'where':{'id':_0x404772[_0x661e('0x43')]['id']}})[_0x661e('0x22')](handleEntityNotFound(_0x2cc958,null))[_0x661e('0x22')](removeEntity(_0x2cc958,null))['catch'](handleError(_0x2cc958,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index c9d8416..4c8dcac 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 _0xc866=['request-promise','path','rimraf','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40e589,_0x110352){var _0x4da09c=function(_0x323135){while(--_0x323135){_0x40e589['push'](_0x40e589['shift']());}};_0x4da09c(++_0x110352);}(_0xc866,0x9a));var _0x6c86=function(_0x2aacfc,_0x50b93f){_0x2aacfc=_0x2aacfc-0x0;var _0x14a1c1=_0xc866[_0x2aacfc];return _0x14a1c1;};'use strict';var _=require(_0x6c86('0x0'));var util=require(_0x6c86('0x1'));var logger=require(_0x6c86('0x2'))(_0x6c86('0x3'));var moment=require(_0x6c86('0x4'));var BPromise=require(_0x6c86('0x5'));var rp=require(_0x6c86('0x6'));var fs=require('fs');var path=require(_0x6c86('0x7'));var rimraf=require(_0x6c86('0x8'));var config=require('../../config/environment');var attributes=require(_0x6c86('0x9'));module['exports']=function(_0x15839d,_0x1a32ba){return _0x15839d[_0x6c86('0xa')](_0x6c86('0xb'),attributes,{'tableName':_0x6c86('0xc'),'paranoid':![],'indexes':[{'name':_0x6c86('0xd'),'fields':[_0x6c86('0xe'),_0x6c86('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70c9=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0xd00f1f,_0x25e249){var _0x409165=function(_0x240877){while(--_0x240877){_0xd00f1f['push'](_0xd00f1f['shift']());}};_0x409165(++_0x25e249);}(_0x70c9,0x148));var _0x970c=function(_0x289488,_0x22d744){_0x289488=_0x289488-0x0;var _0x16c2eb=_0x70c9[_0x289488];return _0x16c2eb;};'use strict';var _=require(_0x970c('0x0'));var util=require(_0x970c('0x1'));var logger=require(_0x970c('0x2'))(_0x970c('0x3'));var moment=require('moment');var BPromise=require(_0x970c('0x4'));var rp=require(_0x970c('0x5'));var fs=require('fs');var path=require(_0x970c('0x6'));var rimraf=require(_0x970c('0x7'));var config=require(_0x970c('0x8'));var attributes=require(_0x970c('0x9'));module[_0x970c('0xa')]=function(_0x38e5a8,_0x4c7c7d){return _0x38e5a8[_0x970c('0xb')](_0x970c('0xc'),attributes,{'tableName':_0x970c('0xd'),'paranoid':![],'indexes':[{'name':_0x970c('0xe'),'fields':[_0x970c('0xf'),_0x970c('0x10')],'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 14a6efd..135adc5 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 _0xc193=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x5afee9,_0x249af6){var _0x5c57bb=function(_0x4b6719){while(--_0x4b6719){_0x5afee9['push'](_0x5afee9['shift']());}};_0x5c57bb(++_0x249af6);}(_0xc193,0xda));var _0x3c19=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc193[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3c19('0x0'));var util=require(_0x3c19('0x1'));var moment=require(_0x3c19('0x2'));var BPromise=require(_0x3c19('0x3'));var rs=require(_0x3c19('0x4'));var fs=require('fs');var Redis=require(_0x3c19('0x5'));var db=require(_0x3c19('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c19('0x7'))(_0x3c19('0x8'));var config=require(_0x3c19('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c19('0xa')][_0x3c19('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8fdcc0,_0x5b61f0,_0x34efc8){return new BPromise(function(_0x3933a6,_0x55cc1b){return client[_0x3c19('0xc')](_0x8fdcc0,_0x34efc8)[_0x3c19('0xd')](function(_0x27f57b){logger['info'](_0x3c19('0xe'),_0x5b61f0,_0x3c19('0xf'));logger[_0x3c19('0x10')](_0x3c19('0x11'),_0x5b61f0,_0x3c19('0xf'),JSON[_0x3c19('0x12')](_0x27f57b));if(_0x27f57b[_0x3c19('0x13')]){if(_0x27f57b[_0x3c19('0x13')]['code']===0x1f4){logger['error'](_0x3c19('0xe'),_0x5b61f0,_0x27f57b[_0x3c19('0x13')][_0x3c19('0x14')]);return _0x55cc1b(_0x27f57b[_0x3c19('0x13')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x5b61f0,_0x27f57b[_0x3c19('0x13')][_0x3c19('0x14')]);return _0x3933a6(_0x27f57b['error'][_0x3c19('0x14')]);}else{logger[_0x3c19('0x15')](_0x3c19('0xe'),_0x5b61f0,_0x3c19('0xf'));_0x3933a6(_0x27f57b[_0x3c19('0x16')][_0x3c19('0x14')]);}})[_0x3c19('0x17')](function(_0x99a15){logger[_0x3c19('0x13')]('ZendeskField,\x20%s,\x20%s',_0x5b61f0,_0x99a15);_0x55cc1b(_0x99a15);});});} \ No newline at end of file +var _0xdc4c=['code','message','ZendeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x222f03,_0x2b95da){var _0x5061ab=function(_0x571512){while(--_0x571512){_0x222f03['push'](_0x222f03['shift']());}};_0x5061ab(++_0x2b95da);}(_0xdc4c,0x78));var _0xcdc4=function(_0x18ee48,_0x100a4b){_0x18ee48=_0x18ee48-0x0;var _0x5396d6=_0xdc4c[_0x18ee48];return _0x5396d6;};'use strict';var _=require(_0xcdc4('0x0'));var util=require(_0xcdc4('0x1'));var moment=require(_0xcdc4('0x2'));var BPromise=require(_0xcdc4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdc4('0x4'));var db=require(_0xcdc4('0x5'))['db'];var utils=require(_0xcdc4('0x6'));var logger=require('../../config/logger')(_0xcdc4('0x7'));var config=require(_0xcdc4('0x8'));var jayson=require(_0xcdc4('0x9'));var client=jayson['client'][_0xcdc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1222ce,_0x23c179,_0x353942){return new BPromise(function(_0x48ecba,_0x4851cd){return client[_0xcdc4('0xb')](_0x1222ce,_0x353942)[_0xcdc4('0xc')](function(_0x2e1ee4){logger[_0xcdc4('0xd')]('ZendeskField,\x20%s,\x20%s',_0x23c179,_0xcdc4('0xe'));logger[_0xcdc4('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x23c179,_0xcdc4('0xe'),JSON[_0xcdc4('0x10')](_0x2e1ee4));if(_0x2e1ee4[_0xcdc4('0x11')]){if(_0x2e1ee4['error'][_0xcdc4('0x12')]===0x1f4){logger[_0xcdc4('0x11')]('ZendeskField,\x20%s,\x20%s',_0x23c179,_0x2e1ee4[_0xcdc4('0x11')][_0xcdc4('0x13')]);return _0x4851cd(_0x2e1ee4['error'][_0xcdc4('0x13')]);}logger[_0xcdc4('0x11')](_0xcdc4('0x14'),_0x23c179,_0x2e1ee4['error'][_0xcdc4('0x13')]);return _0x48ecba(_0x2e1ee4[_0xcdc4('0x11')][_0xcdc4('0x13')]);}else{logger[_0xcdc4('0xd')](_0xcdc4('0x14'),_0x23c179,'request\x20sent');_0x48ecba(_0x2e1ee4[_0xcdc4('0x15')][_0xcdc4('0x13')]);}})[_0xcdc4('0x16')](function(_0x9b2925){logger[_0xcdc4('0x11')](_0xcdc4('0x14'),_0x23c179,_0x9b2925);_0x4851cd(_0x9b2925);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 10a1305..78dabe3 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 _0x22fc=['../../config/environment','./intZohoAccount.controller','get','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service'];(function(_0x74aa68,_0x3fd8d2){var _0x544e43=function(_0x13e141){while(--_0x13e141){_0x74aa68['push'](_0x74aa68['shift']());}};_0x544e43(++_0x3fd8d2);}(_0x22fc,0x80));var _0xc22f=function(_0x374351,_0x53d5e5){_0x374351=_0x374351-0x0;var _0x32fbfe=_0x22fc[_0x374351];return _0x32fbfe;};'use strict';var multer=require(_0xc22f('0x0'));var util=require(_0xc22f('0x1'));var path=require(_0xc22f('0x2'));var timeout=require(_0xc22f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc22f('0x4'));var config=require(_0xc22f('0x5'));var controller=require(_0xc22f('0x6'));router[_0xc22f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc22f('0x8'),auth[_0xc22f('0x9')](),controller['show']);router[_0xc22f('0x7')](_0xc22f('0xa'),auth[_0xc22f('0x9')](),controller['getConfigurations']);router['get'](_0xc22f('0xb'),auth[_0xc22f('0x9')](),controller[_0xc22f('0xc')]);router[_0xc22f('0xd')]('/',auth[_0xc22f('0x9')](),controller[_0xc22f('0xe')]);router[_0xc22f('0xd')](_0xc22f('0xa'),auth[_0xc22f('0x9')](),controller['addConfiguration']);router['put'](_0xc22f('0x8'),auth[_0xc22f('0x9')](),controller[_0xc22f('0xf')]);router[_0xc22f('0x10')](_0xc22f('0x8'),auth[_0xc22f('0x9')](),controller[_0xc22f('0x11')]);module[_0xc22f('0x12')]=router; \ No newline at end of file +var _0xf1a3=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x134c80,_0x554540){var _0x31e59d=function(_0x55c968){while(--_0x55c968){_0x134c80['push'](_0x134c80['shift']());}};_0x31e59d(++_0x554540);}(_0xf1a3,0x118));var _0x3f1a=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xf1a3[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require(_0x3f1a('0x0'));var util=require(_0x3f1a('0x1'));var path=require(_0x3f1a('0x2'));var timeout=require(_0x3f1a('0x3'));var express=require(_0x3f1a('0x4'));var router=express[_0x3f1a('0x5')]();var fs_extra=require(_0x3f1a('0x6'));var auth=require(_0x3f1a('0x7'));var interaction=require(_0x3f1a('0x8'));var config=require('../../config/environment');var controller=require(_0x3f1a('0x9'));router[_0x3f1a('0xa')]('/',auth[_0x3f1a('0xb')](),controller[_0x3f1a('0xc')]);router['get'](_0x3f1a('0xd'),auth[_0x3f1a('0xb')](),controller[_0x3f1a('0xe')]);router[_0x3f1a('0xa')](_0x3f1a('0xf'),auth[_0x3f1a('0xb')](),controller[_0x3f1a('0x10')]);router[_0x3f1a('0xa')](_0x3f1a('0x11'),auth['isAuthenticated'](),controller[_0x3f1a('0x12')]);router[_0x3f1a('0x13')]('/',auth['isAuthenticated'](),controller[_0x3f1a('0x14')]);router['post'](_0x3f1a('0xf'),auth[_0x3f1a('0xb')](),controller[_0x3f1a('0x15')]);router[_0x3f1a('0x16')](_0x3f1a('0xd'),auth[_0x3f1a('0xb')](),controller[_0x3f1a('0x17')]);router[_0x3f1a('0x18')](_0x3f1a('0xd'),auth[_0x3f1a('0xb')](),controller[_0x3f1a('0x19')]);module[_0x3f1a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d7f8734..af62598 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 _0x4ea3=['STRING','sequelize','exports'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x34ea('0x0'));module[_0x34ea('0x1')]={'name':{'type':Sequelize[_0x34ea('0x2')]},'description':{'type':Sequelize[_0x34ea('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x34ea('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x34ea('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x34ea('0x2')]}}; \ No newline at end of file +var _0x4ea3=['STRING','sequelize','exports'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x34ea('0x0'));module[_0x34ea('0x1')]={'name':{'type':Sequelize[_0x34ea('0x2')]},'description':{'type':Sequelize[_0x34ea('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x34ea('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x34ea('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x34ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index eecff5f..fc3de82 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 _0xfa2b=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getConfigurations','findOne','ZohoConfiguration','options','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','clientId','serverUrl','code','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','error','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x330a51,_0x42c33b){var _0x55aa63=function(_0x5ddc09){while(--_0x5ddc09){_0x330a51['push'](_0x330a51['shift']());}};_0x55aa63(++_0x42c33b);}(_0xfa2b,0xf3));var _0xbfa2=function(_0x258f19,_0x5cff7b){_0x258f19=_0x258f19-0x0;var _0x2b3af9=_0xfa2b[_0x258f19];return _0x2b3af9;};'use strict';var emlformat=require(_0xbfa2('0x0'));var rimraf=require(_0xbfa2('0x1'));var zipdir=require(_0xbfa2('0x2'));var jsonpatch=require(_0xbfa2('0x3'));var rp=require(_0xbfa2('0x4'));var moment=require(_0xbfa2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbfa2('0x6'));var util=require('util');var path=require(_0xbfa2('0x7'));var sox=require(_0xbfa2('0x8'));var csv=require(_0xbfa2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfa2('0xa'));var _=require(_0xbfa2('0xb'));var squel=require(_0xbfa2('0xc'));var crypto=require('crypto');var jsforce=require(_0xbfa2('0xd'));var deskjs=require(_0xbfa2('0xe'));var toCsv=require(_0xbfa2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbfa2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbfa2('0x10'));var as=require(_0xbfa2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfa2('0x12'))(_0xbfa2('0x13'));var utils=require(_0xbfa2('0x14'));var config=require(_0xbfa2('0x15'));var licenseUtil=require(_0xbfa2('0x16'));var db=require(_0xbfa2('0x17'))['db'];var integrations=require(_0xbfa2('0x18'));function respondWithStatusCode(_0x1b39d8,_0x15be30){_0x15be30=_0x15be30||0xcc;return function(_0xf6c978){if(_0xf6c978){return _0x1b39d8[_0xbfa2('0x19')](_0x15be30);}return _0x1b39d8[_0xbfa2('0x1a')](_0x15be30)[_0xbfa2('0x1b')]();};}function respondWithResult(_0xd4f691,_0x55b05c){_0x55b05c=_0x55b05c||0xc8;return function(_0x2bc0a5){if(_0x2bc0a5){return _0xd4f691['status'](_0x55b05c)[_0xbfa2('0x1c')](_0x2bc0a5);}};}function respondWithFilteredResult(_0x386dd5,_0x259b90){return function(_0x595a2e){if(_0x595a2e){var _0x2eda72=typeof _0x259b90['offset']==='undefined'&&typeof _0x259b90[_0xbfa2('0x1d')]===_0xbfa2('0x1e');var _0x15db28=_0x595a2e[_0xbfa2('0x1f')];var _0x7b41f7=_0x2eda72?0x0:_0x259b90['offset'];var _0x2c0506=_0x2eda72?_0x595a2e[_0xbfa2('0x1f')]:_0x259b90['offset']+_0x259b90[_0xbfa2('0x1d')];var _0x2e4c72;if(_0x2c0506>=_0x15db28){_0x2c0506=_0x15db28;_0x2e4c72=0xc8;}else{_0x2e4c72=0xce;}_0x386dd5[_0xbfa2('0x1a')](_0x2e4c72);return _0x386dd5[_0xbfa2('0x20')](_0xbfa2('0x21'),_0x7b41f7+'-'+_0x2c0506+'/'+_0x15db28)[_0xbfa2('0x1c')](_0x595a2e);}return null;};}function patchUpdates(_0x17dda3){return function(_0x71b7c3){try{jsonpatch[_0xbfa2('0x22')](_0x71b7c3,_0x17dda3,!![]);}catch(_0x10fb13){return BPromise['reject'](_0x10fb13);}return _0x71b7c3[_0xbfa2('0x23')]();};}function saveUpdates(_0x5b124b,_0x1a1fd7){return function(_0x5ef4b3){if(_0x5ef4b3){return _0x5ef4b3[_0xbfa2('0x24')](_0x5b124b)[_0xbfa2('0x25')](function(_0x4031d1){return _0x4031d1;});}return null;};}function removeEntity(_0x2cd1dd,_0x1c0a71){return function(_0x396bbe){if(_0x396bbe){return _0x396bbe[_0xbfa2('0x26')]()[_0xbfa2('0x25')](function(){_0x2cd1dd[_0xbfa2('0x1a')](0xcc)[_0xbfa2('0x1b')]();});}};}function handleEntityNotFound(_0x1e9d2a,_0x54eee2){return function(_0x17c97a){if(!_0x17c97a){_0x1e9d2a[_0xbfa2('0x19')](0x194);}return _0x17c97a;};}function handleError(_0x6ae2d2,_0x5a868c){_0x5a868c=_0x5a868c||0x1f4;return function(_0x191826){logger['error'](_0x191826[_0xbfa2('0x27')]);if(_0x191826[_0xbfa2('0x28')]){delete _0x191826[_0xbfa2('0x28')];}_0x6ae2d2[_0xbfa2('0x1a')](_0x5a868c)[_0xbfa2('0x29')](_0x191826);};}exports['index']=function(_0x788488,_0x54dfb8){var _0x27462a={},_0x26c643={},_0x163c44={'count':0x0,'rows':[]};var _0x20e9a6=_[_0xbfa2('0x2a')](db[_0xbfa2('0x2b')][_0xbfa2('0x2c')],function(_0x54c8a4){return{'name':_0x54c8a4[_0xbfa2('0x2d')],'type':_0x54c8a4[_0xbfa2('0x2e')]['key']};});_0x26c643['model']=_['map'](_0x20e9a6,_0xbfa2('0x28'));_0x26c643[_0xbfa2('0x2f')]=_[_0xbfa2('0x30')](_0x788488['query']);_0x26c643['filters']=_[_0xbfa2('0x31')](_0x26c643[_0xbfa2('0x32')],_0x26c643[_0xbfa2('0x2f')]);_0x27462a['attributes']=_['intersection'](_0x26c643[_0xbfa2('0x32')],qs['fields'](_0x788488[_0xbfa2('0x2f')][_0xbfa2('0x33')]));_0x27462a['attributes']=_0x27462a['attributes']['length']?_0x27462a[_0xbfa2('0x34')]:_0x26c643['model'];if(!_0x788488[_0xbfa2('0x2f')][_0xbfa2('0x35')](_0xbfa2('0x36'))){_0x27462a['limit']=qs[_0xbfa2('0x1d')](_0x788488[_0xbfa2('0x2f')][_0xbfa2('0x1d')]);_0x27462a[_0xbfa2('0x37')]=qs[_0xbfa2('0x37')](_0x788488[_0xbfa2('0x2f')][_0xbfa2('0x37')]);}_0x27462a[_0xbfa2('0x38')]=qs['sort'](_0x788488['query'][_0xbfa2('0x39')]);_0x27462a[_0xbfa2('0x3a')]=qs[_0xbfa2('0x3b')](_[_0xbfa2('0x3c')](_0x788488['query'],_0x26c643[_0xbfa2('0x3b')]),_0x20e9a6);if(_0x788488[_0xbfa2('0x2f')][_0xbfa2('0x3d')]){_0x27462a[_0xbfa2('0x3a')]=_['merge'](_0x27462a['where'],{'$or':_[_0xbfa2('0x2a')](_0x20e9a6,function(_0x2b185f){if(_0x2b185f['type']!==_0xbfa2('0x3e')){var _0x394ec4={};_0x394ec4[_0x2b185f[_0xbfa2('0x28')]]={'$like':'%'+_0x788488[_0xbfa2('0x2f')][_0xbfa2('0x3d')]+'%'};return _0x394ec4;}})});}_0x27462a=_[_0xbfa2('0x3f')]({},_0x27462a,_0x788488['options']);var _0x3f5ec7={'where':_0x27462a[_0xbfa2('0x3a')]};return db['ZohoAccount'][_0xbfa2('0x1f')](_0x3f5ec7)[_0xbfa2('0x25')](function(_0x189a1f){_0x163c44['count']=_0x189a1f;if(_0x788488['query'][_0xbfa2('0x40')]){_0x27462a[_0xbfa2('0x41')]=[{'all':!![]}];}return db[_0xbfa2('0x2b')][_0xbfa2('0x42')](_0x27462a);})[_0xbfa2('0x25')](function(_0x23f905){_0x163c44[_0xbfa2('0x43')]=_0x23f905;return _0x163c44;})[_0xbfa2('0x25')](respondWithFilteredResult(_0x54dfb8,_0x27462a))[_0xbfa2('0x44')](handleError(_0x54dfb8,null));};exports[_0xbfa2('0x45')]=function(_0x1cbf35,_0x317a54){var _0xdb2371={'raw':![],'where':{'id':_0x1cbf35[_0xbfa2('0x46')]['id']}},_0x4be8c3={};_0x4be8c3['model']=_[_0xbfa2('0x30')](db[_0xbfa2('0x2b')][_0xbfa2('0x2c')]);_0x4be8c3['query']=_[_0xbfa2('0x30')](_0x1cbf35[_0xbfa2('0x2f')]);_0x4be8c3[_0xbfa2('0x3b')]=_['intersection'](_0x4be8c3['model'],_0x4be8c3['query']);_0xdb2371['attributes']=_[_0xbfa2('0x31')](_0x4be8c3[_0xbfa2('0x32')],qs[_0xbfa2('0x33')](_0x1cbf35[_0xbfa2('0x2f')][_0xbfa2('0x33')]));_0xdb2371[_0xbfa2('0x34')]=_0xdb2371[_0xbfa2('0x34')][_0xbfa2('0x47')]?_0xdb2371['attributes']:_0x4be8c3[_0xbfa2('0x32')];if(_0x1cbf35[_0xbfa2('0x2f')][_0xbfa2('0x40')]){_0xdb2371[_0xbfa2('0x41')]=[{'all':!![]}];}_0xdb2371=_[_0xbfa2('0x3f')]({},_0xdb2371,_0x1cbf35['options']);return db['ZohoAccount']['find'](_0xdb2371)[_0xbfa2('0x25')](handleEntityNotFound(_0x317a54,null))['then'](respondWithResult(_0x317a54,null))[_0xbfa2('0x44')](handleError(_0x317a54,null));};exports[_0xbfa2('0x48')]=function(_0x3c44f2,_0x404b1e){return db[_0xbfa2('0x2b')][_0xbfa2('0x48')](_0x3c44f2['body'],{})[_0xbfa2('0x25')](respondWithResult(_0x404b1e,0xc9))['catch'](handleError(_0x404b1e,null));};exports['update']=function(_0x5edbbf,_0x3551f0){if(_0x5edbbf[_0xbfa2('0x49')]['id']){delete _0x5edbbf['body']['id'];}return db[_0xbfa2('0x2b')][_0xbfa2('0x4a')]({'where':{'id':_0x5edbbf[_0xbfa2('0x46')]['id']}})[_0xbfa2('0x25')](handleEntityNotFound(_0x3551f0,null))[_0xbfa2('0x25')](saveUpdates(_0x5edbbf['body'],null))[_0xbfa2('0x25')](respondWithResult(_0x3551f0,null))[_0xbfa2('0x44')](handleError(_0x3551f0,null));};exports[_0xbfa2('0x26')]=function(_0x44695e,_0xe25e9c){return db[_0xbfa2('0x2b')][_0xbfa2('0x4a')]({'where':{'id':_0x44695e[_0xbfa2('0x46')]['id']}})[_0xbfa2('0x25')](handleEntityNotFound(_0xe25e9c,null))[_0xbfa2('0x25')](removeEntity(_0xe25e9c,null))[_0xbfa2('0x44')](handleError(_0xe25e9c,null));};exports[_0xbfa2('0x4b')]=function(_0x2bacd1,_0x5e6238,_0x38a8cd){var _0x22481f={};var _0x3c4b31={};var _0x507904;var _0x277285;return db[_0xbfa2('0x2b')][_0xbfa2('0x4c')]({'where':{'id':_0x2bacd1[_0xbfa2('0x46')]['id']}})[_0xbfa2('0x25')](handleEntityNotFound(_0x5e6238,null))[_0xbfa2('0x25')](function(_0x25e761){if(_0x25e761){_0x507904=_0x25e761;_0x3c4b31[_0xbfa2('0x32')]=_[_0xbfa2('0x30')](db[_0xbfa2('0x4d')][_0xbfa2('0x2c')]);_0x3c4b31[_0xbfa2('0x2f')]=_[_0xbfa2('0x30')](_0x2bacd1[_0xbfa2('0x2f')]);_0x3c4b31[_0xbfa2('0x3b')]=_['intersection'](_0x3c4b31[_0xbfa2('0x32')],_0x3c4b31['query']);_0x22481f[_0xbfa2('0x34')]=_[_0xbfa2('0x31')](_0x3c4b31[_0xbfa2('0x32')],qs[_0xbfa2('0x33')](_0x2bacd1['query']['fields']));_0x22481f[_0xbfa2('0x34')]=_0x22481f[_0xbfa2('0x34')][_0xbfa2('0x47')]?_0x22481f[_0xbfa2('0x34')]:_0x3c4b31[_0xbfa2('0x32')];_0x22481f[_0xbfa2('0x38')]=qs[_0xbfa2('0x39')](_0x2bacd1[_0xbfa2('0x2f')]['sort']);_0x22481f[_0xbfa2('0x3a')]=qs['filters'](_[_0xbfa2('0x3c')](_0x2bacd1['query'],_0x3c4b31[_0xbfa2('0x3b')]));if(_0x2bacd1[_0xbfa2('0x2f')]['filter']){_0x22481f[_0xbfa2('0x3a')]=_[_0xbfa2('0x3f')](_0x22481f[_0xbfa2('0x3a')],{'$or':_[_0xbfa2('0x2a')](_0x22481f[_0xbfa2('0x34')],function(_0x1253d4){var _0xffa4ed={};_0xffa4ed[_0x1253d4]={'$like':'%'+_0x2bacd1['query']['filter']+'%'};return _0xffa4ed;})});}_0x22481f=_[_0xbfa2('0x3f')]({},_0x22481f,_0x2bacd1[_0xbfa2('0x4e')]);return _0x507904[_0xbfa2('0x4b')](_0x22481f);}})[_0xbfa2('0x25')](function(_0xdb68f1){if(_0xdb68f1){_0x277285=_0xdb68f1['length'];if(!_0x2bacd1[_0xbfa2('0x2f')][_0xbfa2('0x35')]('nolimit')){_0x22481f[_0xbfa2('0x1d')]=qs[_0xbfa2('0x1d')](_0x2bacd1['query'][_0xbfa2('0x1d')]);_0x22481f[_0xbfa2('0x37')]=qs[_0xbfa2('0x37')](_0x2bacd1['query']['offset']);}return _0x507904['getConfigurations'](_0x22481f);}})['then'](function(_0x1cfac4){if(_0x1cfac4){return _0x1cfac4?{'count':_0x277285,'rows':_0x1cfac4}:null;}})[_0xbfa2('0x25')](respondWithResult(_0x5e6238,null))['catch'](handleError(_0x5e6238,null));};exports[_0xbfa2('0x4f')]=function(_0x3dcc36,_0x351609,_0x5db259){if(_0x3dcc36[_0xbfa2('0x49')]['id']){delete _0x3dcc36[_0xbfa2('0x49')]['id'];}return db[_0xbfa2('0x2b')][_0xbfa2('0x4c')]({'where':{'id':_0x3dcc36[_0xbfa2('0x46')]['id']}})['then'](handleEntityNotFound(_0x351609,null))[_0xbfa2('0x25')](function(_0x31a323){if(_0x31a323){_0x3dcc36['body'][_0xbfa2('0x50')]=_0x31a323['id'];_0x3dcc36[_0xbfa2('0x49')][_0xbfa2('0x51')]=integrations[_0xbfa2('0x52')](_0x3dcc36['body'][_0xbfa2('0x53')],_0x3dcc36[_0xbfa2('0x49')][_0xbfa2('0x2e')]);_0x3dcc36[_0xbfa2('0x49')]['Descriptions']=integrations[_0xbfa2('0x54')](_0x3dcc36[_0xbfa2('0x49')][_0xbfa2('0x53')],_0x3dcc36[_0xbfa2('0x49')][_0xbfa2('0x2e')]);return db[_0xbfa2('0x4d')][_0xbfa2('0x48')](_0x3dcc36[_0xbfa2('0x49')],{'include':[{'model':db[_0xbfa2('0x55')],'as':_0xbfa2('0x51')},{'model':db[_0xbfa2('0x55')],'as':'Descriptions'}]});}return null;})[_0xbfa2('0x25')](respondWithResult(_0x351609,null))[_0xbfa2('0x44')](handleError(_0x351609,null));};function getAccessToken(_0xd23e46){return new Promise(function(_0x4d8563,_0x3cca7a){var _0x2e4e24;switch(_0xd23e46['zone']){case'US':_0x2e4e24=_0xbfa2('0x56');break;case'AU':_0x2e4e24='https://accounts.zoho.com.au';break;case'EU':_0x2e4e24=_0xbfa2('0x57');break;case'IN':_0x2e4e24=_0xbfa2('0x58');break;case'CN':_0x2e4e24=_0xbfa2('0x59');break;default:_0x2e4e24=_0xbfa2('0x57');break;}var _0x3168d6={'method':'POST','uri':_0x2e4e24+_0xbfa2('0x5a'),'qs':{'refresh_token':_0xd23e46[_0xbfa2('0x5b')],'client_id':_0xd23e46['clientId'],'client_secret':_0xd23e46[_0xbfa2('0x5c')],'grant_type':_0xbfa2('0x5d')},'json':!![]};return rp(_0x3168d6)[_0xbfa2('0x25')](function(_0x39349c){if(_0x39349c[_0xbfa2('0x5e')]){_0x4d8563(_0x39349c[_0xbfa2('0x5e')]);}else{_0x3cca7a(_0xbfa2('0x5f'));}})[_0xbfa2('0x44')](function(_0x566568){_0x3cca7a(_0x566568);});});}exports['getFields']=function(_0x2f06ba,_0x8e9d09,_0x14f9ac){var _0x432fbf,_0x46ddf1,_0x1c00df,_0x2ce8e7,_0x55f8fa;return db[_0xbfa2('0x2b')]['findOne']({'where':{'id':_0x2f06ba[_0xbfa2('0x46')]['id']},'attributes':['id',_0xbfa2('0x60'),_0xbfa2('0x61'),_0xbfa2('0x62'),_0xbfa2('0x5c'),_0xbfa2('0x63'),_0xbfa2('0x64'),_0xbfa2('0x5b')]})['then'](handleEntityNotFound(_0x8e9d09,null))[_0xbfa2('0x25')](function(_0xc7de30){_0x55f8fa=_0xc7de30;_0x432fbf=_0x55f8fa['host'];_0x46ddf1=_0x432fbf==='zoho.eu'?'eu':_0xbfa2('0x65');_0x1c00df=_0x55f8fa[_0xbfa2('0x63')];var _0x2a5123=_0x1c00df['slice'](-0x1);if(_0x2a5123==='/'||_0x2a5123==='\x5c'||_0x2a5123===':'){_0x1c00df=_0x1c00df[_0xbfa2('0x66')](0x0,_0x1c00df['lastIndexOf'](_0x2a5123));}if(!_0x55f8fa[_0xbfa2('0x5b')]){throw new Error(_0xbfa2('0x67'));}return getAccessToken(_0x55f8fa);})[_0xbfa2('0x25')](function(_0x11c180){if(_0x11c180){return rp({'method':_0xbfa2('0x68'),'uri':util[_0xbfa2('0x69')](_0xbfa2('0x6a'),_0x46ddf1),'qs':{'module':_0xbfa2('0x6b')},'headers':{'Authorization':_0xbfa2('0x6c')+_0x11c180},'json':!![]});}})[_0xbfa2('0x25')](function(_0x178ff1){if(_0x178ff1){if(_0x178ff1['response']&&_0x178ff1['response'][_0xbfa2('0x6d')]){throw new Error(_0x178ff1[_0xbfa2('0x6e')]['error'][_0xbfa2('0x6f')]);}var _0x1b78e6=[];var _0xc940ea=[];var _0x4ea4f0=['Owner',_0xbfa2('0x70'),_0xbfa2('0x71'),_0xbfa2('0x72'),_0xbfa2('0x73'),_0xbfa2('0x74'),_0xbfa2('0x75'),_0xbfa2('0x76')];_0xc940ea=_[_0xbfa2('0x77')](_0x178ff1['fields'],function(_0x5b5d39){return _0x4ea4f0[_0xbfa2('0x78')](_0x5b5d39[_0xbfa2('0x79')]);});for(var _0x4f17af=0x0;_0x4f17af<_0xc940ea[_0xbfa2('0x47')];_0x4f17af++){if(_0xc940ea[_0x4f17af][_0xbfa2('0x7a')]===![]){_0x1b78e6[_0xbfa2('0x7b')]({'id':_0xc940ea[_0x4f17af]['id'],'name':_0xc940ea[_0x4f17af]['display_label'],'custom':_0xc940ea[_0x4f17af][_0xbfa2('0x7c')],'options':_0xc940ea[_0x4f17af]['data_type']===_0xbfa2('0x7d')&&_0xc940ea[_0x4f17af][_0xbfa2('0x7e')][_0xbfa2('0x47')]>-0x1?_[_0xbfa2('0x2a')](_0xc940ea[_0x4f17af][_0xbfa2('0x7e')],function(_0x221674){return{'name':_0x221674,'value':_0x221674};}):[]});}}return{'count':_0x1b78e6[_0xbfa2('0x47')],'rows':_0x1b78e6};}else{return{'count':0x0,'rows':[]};}})[_0xbfa2('0x25')](respondWithResult(_0x8e9d09,null))[_0xbfa2('0x44')](function(_0x1f8a75){var _0x42b1a2=_0x2f06ba['query']['test']?0x1f4:_0x1f8a75['statusCode']||0x1f4;logger[_0xbfa2('0x6d')](_0xbfa2('0x7f'),_0xbfa2('0x80'),_0x42b1a2,JSON[_0xbfa2('0x81')](_0x1f8a75));delete _0x1f8a75[_0xbfa2('0x28')];if(_0x42b1a2===0x191){_0x42b1a2=0x190;}_0x8e9d09['status'](_0x42b1a2)[_0xbfa2('0x29')](_0x2f06ba[_0xbfa2('0x2f')][_0xbfa2('0x82')]?{'message':_0xbfa2('0x83'),'statusCode':_0x1f8a75[_0xbfa2('0x84')]}:_0x1f8a75);});}; \ No newline at end of file +var _0xafae=['api_name','system_mandatory','push','custom_field','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','set','apply','save','then','destroy','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','ZohoAccount','include','findAll','rows','catch','show','params','options','find','create','update','body','getConfigurations','findOne','ZohoConfiguration','rawAttributes','AccountId','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes'];(function(_0x484988,_0x4a080b){var _0x4af336=function(_0x523ea2){while(--_0x523ea2){_0x484988['push'](_0x484988['shift']());}};_0x4af336(++_0x4a080b);}(_0xafae,0x198));var _0xeafa=function(_0x2c460d,_0x59f200){_0x2c460d=_0x2c460d-0x0;var _0x4e3739=_0xafae[_0x2c460d];return _0x4e3739;};'use strict';var emlformat=require(_0xeafa('0x0'));var rimraf=require(_0xeafa('0x1'));var zipdir=require(_0xeafa('0x2'));var jsonpatch=require(_0xeafa('0x3'));var rp=require(_0xeafa('0x4'));var moment=require(_0xeafa('0x5'));var BPromise=require(_0xeafa('0x6'));var Mustache=require(_0xeafa('0x7'));var util=require(_0xeafa('0x8'));var path=require(_0xeafa('0x9'));var sox=require(_0xeafa('0xa'));var csv=require(_0xeafa('0xb'));var ejs=require(_0xeafa('0xc'));var fs=require('fs');var fs_extra=require(_0xeafa('0xd'));var _=require(_0xeafa('0xe'));var squel=require('squel');var crypto=require(_0xeafa('0xf'));var jsforce=require(_0xeafa('0x10'));var deskjs=require(_0xeafa('0x11'));var toCsv=require(_0xeafa('0xb'));var querystring=require(_0xeafa('0x12'));var Papa=require(_0xeafa('0x13'));var Redis=require(_0xeafa('0x14'));var authService=require(_0xeafa('0x15'));var qs=require(_0xeafa('0x16'));var as=require(_0xeafa('0x17'));var hardwareService=require(_0xeafa('0x18'));var logger=require(_0xeafa('0x19'))(_0xeafa('0x1a'));var utils=require(_0xeafa('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xeafa('0x1c'));var db=require(_0xeafa('0x1d'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5db7b6,_0x5ee2aa){_0x5ee2aa=_0x5ee2aa||0xcc;return function(_0x116f07){if(_0x116f07){return _0x5db7b6[_0xeafa('0x1e')](_0x5ee2aa);}return _0x5db7b6['status'](_0x5ee2aa)[_0xeafa('0x1f')]();};}function respondWithResult(_0x8d4f36,_0x600cd8){_0x600cd8=_0x600cd8||0xc8;return function(_0x50494e){if(_0x50494e){return _0x8d4f36[_0xeafa('0x20')](_0x600cd8)[_0xeafa('0x21')](_0x50494e);}};}function respondWithFilteredResult(_0x4a9a9b,_0x593a1f){return function(_0x5c132e){if(_0x5c132e){var _0x159e8f=typeof _0x593a1f['offset']===_0xeafa('0x22')&&typeof _0x593a1f['limit']===_0xeafa('0x22');var _0x3ee2ff=_0x5c132e['count'];var _0x13ee1c=_0x159e8f?0x0:_0x593a1f[_0xeafa('0x23')];var _0x4d5d83=_0x159e8f?_0x5c132e[_0xeafa('0x24')]:_0x593a1f[_0xeafa('0x23')]+_0x593a1f['limit'];var _0x582179;if(_0x4d5d83>=_0x3ee2ff){_0x4d5d83=_0x3ee2ff;_0x582179=0xc8;}else{_0x582179=0xce;}_0x4a9a9b['status'](_0x582179);return _0x4a9a9b[_0xeafa('0x25')]('Content-Range',_0x13ee1c+'-'+_0x4d5d83+'/'+_0x3ee2ff)[_0xeafa('0x21')](_0x5c132e);}return null;};}function patchUpdates(_0x5dcbe5){return function(_0x517d0d){try{jsonpatch[_0xeafa('0x26')](_0x517d0d,_0x5dcbe5,!![]);}catch(_0x273907){return BPromise['reject'](_0x273907);}return _0x517d0d[_0xeafa('0x27')]();};}function saveUpdates(_0x136792,_0x8eafb6){return function(_0x27841f){if(_0x27841f){return _0x27841f['update'](_0x136792)[_0xeafa('0x28')](function(_0xb3928a){return _0xb3928a;});}return null;};}function removeEntity(_0xd14958,_0x5a25ee){return function(_0x1a1a1c){if(_0x1a1a1c){return _0x1a1a1c[_0xeafa('0x29')]()['then'](function(){_0xd14958['status'](0xcc)[_0xeafa('0x1f')]();});}};}function handleEntityNotFound(_0x3500fe,_0xa814fe){return function(_0x20a3d8){if(!_0x20a3d8){_0x3500fe[_0xeafa('0x1e')](0x194);}return _0x20a3d8;};}function handleError(_0x41edb0,_0x1b7419){_0x1b7419=_0x1b7419||0x1f4;return function(_0xa5fc8d){logger['error'](_0xa5fc8d['stack']);if(_0xa5fc8d[_0xeafa('0x2a')]){delete _0xa5fc8d['name'];}_0x41edb0[_0xeafa('0x20')](_0x1b7419)[_0xeafa('0x2b')](_0xa5fc8d);};}exports[_0xeafa('0x2c')]=function(_0x1763f9,_0x22d6b6){var _0x3f3681={},_0x1f6ec1={},_0xc4842c={'count':0x0,'rows':[]};var _0xc139f5=_[_0xeafa('0x2d')](db['ZohoAccount']['rawAttributes'],function(_0x491ec1){return{'name':_0x491ec1[_0xeafa('0x2e')],'type':_0x491ec1[_0xeafa('0x2f')]['key']};});_0x1f6ec1[_0xeafa('0x30')]=_['map'](_0xc139f5,_0xeafa('0x2a'));_0x1f6ec1['query']=_[_0xeafa('0x31')](_0x1763f9[_0xeafa('0x32')]);_0x1f6ec1[_0xeafa('0x33')]=_['intersection'](_0x1f6ec1[_0xeafa('0x30')],_0x1f6ec1['query']);_0x3f3681['attributes']=_[_0xeafa('0x34')](_0x1f6ec1[_0xeafa('0x30')],qs[_0xeafa('0x35')](_0x1763f9[_0xeafa('0x32')][_0xeafa('0x35')]));_0x3f3681[_0xeafa('0x36')]=_0x3f3681[_0xeafa('0x36')][_0xeafa('0x37')]?_0x3f3681[_0xeafa('0x36')]:_0x1f6ec1['model'];if(!_0x1763f9['query'][_0xeafa('0x38')]('nolimit')){_0x3f3681[_0xeafa('0x39')]=qs['limit'](_0x1763f9[_0xeafa('0x32')][_0xeafa('0x39')]);_0x3f3681['offset']=qs['offset'](_0x1763f9[_0xeafa('0x32')][_0xeafa('0x23')]);}_0x3f3681[_0xeafa('0x3a')]=qs[_0xeafa('0x3b')](_0x1763f9[_0xeafa('0x32')][_0xeafa('0x3b')]);_0x3f3681[_0xeafa('0x3c')]=qs[_0xeafa('0x33')](_[_0xeafa('0x3d')](_0x1763f9[_0xeafa('0x32')],_0x1f6ec1['filters']),_0xc139f5);if(_0x1763f9[_0xeafa('0x32')][_0xeafa('0x3e')]){_0x3f3681[_0xeafa('0x3c')]=_[_0xeafa('0x3f')](_0x3f3681[_0xeafa('0x3c')],{'$or':_['map'](_0xc139f5,function(_0x237567){if(_0x237567['type']!=='VIRTUAL'){var _0x1bb30f={};_0x1bb30f[_0x237567[_0xeafa('0x2a')]]={'$like':'%'+_0x1763f9[_0xeafa('0x32')]['filter']+'%'};return _0x1bb30f;}})});}_0x3f3681=_[_0xeafa('0x3f')]({},_0x3f3681,_0x1763f9['options']);var _0x15ce8f={'where':_0x3f3681[_0xeafa('0x3c')]};return db[_0xeafa('0x40')][_0xeafa('0x24')](_0x15ce8f)[_0xeafa('0x28')](function(_0x5a9c82){_0xc4842c[_0xeafa('0x24')]=_0x5a9c82;if(_0x1763f9[_0xeafa('0x32')]['includeAll']){_0x3f3681[_0xeafa('0x41')]=[{'all':!![]}];}return db[_0xeafa('0x40')][_0xeafa('0x42')](_0x3f3681);})[_0xeafa('0x28')](function(_0x4d0cc4){_0xc4842c[_0xeafa('0x43')]=_0x4d0cc4;return _0xc4842c;})[_0xeafa('0x28')](respondWithFilteredResult(_0x22d6b6,_0x3f3681))[_0xeafa('0x44')](handleError(_0x22d6b6,null));};exports[_0xeafa('0x45')]=function(_0x288b68,_0x3816e2){var _0x240752={'raw':![],'where':{'id':_0x288b68[_0xeafa('0x46')]['id']}},_0x347e14={};_0x347e14[_0xeafa('0x30')]=_[_0xeafa('0x31')](db['ZohoAccount']['rawAttributes']);_0x347e14[_0xeafa('0x32')]=_[_0xeafa('0x31')](_0x288b68[_0xeafa('0x32')]);_0x347e14[_0xeafa('0x33')]=_[_0xeafa('0x34')](_0x347e14['model'],_0x347e14[_0xeafa('0x32')]);_0x240752[_0xeafa('0x36')]=_[_0xeafa('0x34')](_0x347e14[_0xeafa('0x30')],qs[_0xeafa('0x35')](_0x288b68[_0xeafa('0x32')]['fields']));_0x240752[_0xeafa('0x36')]=_0x240752['attributes'][_0xeafa('0x37')]?_0x240752['attributes']:_0x347e14[_0xeafa('0x30')];if(_0x288b68[_0xeafa('0x32')]['includeAll']){_0x240752[_0xeafa('0x41')]=[{'all':!![]}];}_0x240752=_[_0xeafa('0x3f')]({},_0x240752,_0x288b68[_0xeafa('0x47')]);return db['ZohoAccount'][_0xeafa('0x48')](_0x240752)['then'](handleEntityNotFound(_0x3816e2,null))[_0xeafa('0x28')](respondWithResult(_0x3816e2,null))[_0xeafa('0x44')](handleError(_0x3816e2,null));};exports[_0xeafa('0x49')]=function(_0x178a5f,_0x555a88){return db['ZohoAccount']['create'](_0x178a5f['body'],{})[_0xeafa('0x28')](respondWithResult(_0x555a88,0xc9))['catch'](handleError(_0x555a88,null));};exports[_0xeafa('0x4a')]=function(_0x32c5d5,_0x43d3ee){if(_0x32c5d5[_0xeafa('0x4b')]['id']){delete _0x32c5d5[_0xeafa('0x4b')]['id'];}return db['ZohoAccount'][_0xeafa('0x48')]({'where':{'id':_0x32c5d5[_0xeafa('0x46')]['id']}})[_0xeafa('0x28')](handleEntityNotFound(_0x43d3ee,null))[_0xeafa('0x28')](saveUpdates(_0x32c5d5[_0xeafa('0x4b')],null))[_0xeafa('0x28')](respondWithResult(_0x43d3ee,null))[_0xeafa('0x44')](handleError(_0x43d3ee,null));};exports['destroy']=function(_0x532705,_0x138c57){return db[_0xeafa('0x40')][_0xeafa('0x48')]({'where':{'id':_0x532705[_0xeafa('0x46')]['id']}})[_0xeafa('0x28')](handleEntityNotFound(_0x138c57,null))[_0xeafa('0x28')](removeEntity(_0x138c57,null))[_0xeafa('0x44')](handleError(_0x138c57,null));};exports[_0xeafa('0x4c')]=function(_0x5f12e1,_0x25beb1,_0x5614a1){var _0x4eed30={};var _0xd07beb={};var _0x2f8334;var _0x35dfbd;return db['ZohoAccount'][_0xeafa('0x4d')]({'where':{'id':_0x5f12e1['params']['id']}})['then'](handleEntityNotFound(_0x25beb1,null))[_0xeafa('0x28')](function(_0x2c8bba){if(_0x2c8bba){_0x2f8334=_0x2c8bba;_0xd07beb[_0xeafa('0x30')]=_[_0xeafa('0x31')](db[_0xeafa('0x4e')][_0xeafa('0x4f')]);_0xd07beb[_0xeafa('0x32')]=_[_0xeafa('0x31')](_0x5f12e1['query']);_0xd07beb[_0xeafa('0x33')]=_[_0xeafa('0x34')](_0xd07beb['model'],_0xd07beb['query']);_0x4eed30[_0xeafa('0x36')]=_['intersection'](_0xd07beb[_0xeafa('0x30')],qs[_0xeafa('0x35')](_0x5f12e1[_0xeafa('0x32')][_0xeafa('0x35')]));_0x4eed30['attributes']=_0x4eed30[_0xeafa('0x36')][_0xeafa('0x37')]?_0x4eed30[_0xeafa('0x36')]:_0xd07beb['model'];_0x4eed30[_0xeafa('0x3a')]=qs['sort'](_0x5f12e1[_0xeafa('0x32')][_0xeafa('0x3b')]);_0x4eed30['where']=qs[_0xeafa('0x33')](_['pick'](_0x5f12e1[_0xeafa('0x32')],_0xd07beb['filters']));if(_0x5f12e1[_0xeafa('0x32')][_0xeafa('0x3e')]){_0x4eed30[_0xeafa('0x3c')]=_[_0xeafa('0x3f')](_0x4eed30[_0xeafa('0x3c')],{'$or':_[_0xeafa('0x2d')](_0x4eed30[_0xeafa('0x36')],function(_0x194444){var _0x4cd72c={};_0x4cd72c[_0x194444]={'$like':'%'+_0x5f12e1[_0xeafa('0x32')]['filter']+'%'};return _0x4cd72c;})});}_0x4eed30=_[_0xeafa('0x3f')]({},_0x4eed30,_0x5f12e1[_0xeafa('0x47')]);return _0x2f8334[_0xeafa('0x4c')](_0x4eed30);}})[_0xeafa('0x28')](function(_0x35ec31){if(_0x35ec31){_0x35dfbd=_0x35ec31[_0xeafa('0x37')];if(!_0x5f12e1[_0xeafa('0x32')][_0xeafa('0x38')]('nolimit')){_0x4eed30[_0xeafa('0x39')]=qs[_0xeafa('0x39')](_0x5f12e1['query'][_0xeafa('0x39')]);_0x4eed30[_0xeafa('0x23')]=qs[_0xeafa('0x23')](_0x5f12e1['query'][_0xeafa('0x23')]);}return _0x2f8334[_0xeafa('0x4c')](_0x4eed30);}})[_0xeafa('0x28')](function(_0x22db4b){if(_0x22db4b){return _0x22db4b?{'count':_0x35dfbd,'rows':_0x22db4b}:null;}})[_0xeafa('0x28')](respondWithResult(_0x25beb1,null))[_0xeafa('0x44')](handleError(_0x25beb1,null));};exports['addConfiguration']=function(_0x54ed4c,_0x4b571f,_0x1c1806){if(_0x54ed4c[_0xeafa('0x4b')]['id']){delete _0x54ed4c[_0xeafa('0x4b')]['id'];}return db[_0xeafa('0x40')]['findOne']({'where':{'id':_0x54ed4c['params']['id']}})[_0xeafa('0x28')](handleEntityNotFound(_0x4b571f,null))['then'](function(_0x364dcc){if(_0x364dcc){_0x54ed4c[_0xeafa('0x4b')][_0xeafa('0x50')]=_0x364dcc['id'];_0x54ed4c[_0xeafa('0x4b')]['Subjects']=integrations['getSubjects'](_0x54ed4c[_0xeafa('0x4b')][_0xeafa('0x51')],_0x54ed4c[_0xeafa('0x4b')][_0xeafa('0x2f')]);_0x54ed4c[_0xeafa('0x4b')][_0xeafa('0x52')]=integrations[_0xeafa('0x53')](_0x54ed4c[_0xeafa('0x4b')][_0xeafa('0x51')],_0x54ed4c[_0xeafa('0x4b')][_0xeafa('0x2f')]);return db[_0xeafa('0x4e')][_0xeafa('0x49')](_0x54ed4c['body'],{'include':[{'model':db[_0xeafa('0x54')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xeafa('0x52')}]});}return null;})[_0xeafa('0x28')](respondWithResult(_0x4b571f,null))[_0xeafa('0x44')](handleError(_0x4b571f,null));};function getAccessToken(_0x5f240f){return new Promise(function(_0x21f6f5,_0x198904){var _0x51d457;switch(_0x5f240f[_0xeafa('0x55')]){case'US':_0x51d457='https://accounts.zoho.com';break;case'AU':_0x51d457=_0xeafa('0x56');break;case'EU':_0x51d457='https://accounts.zoho.eu';break;case'IN':_0x51d457=_0xeafa('0x57');break;case'CN':_0x51d457=_0xeafa('0x58');break;default:_0x51d457=_0xeafa('0x59');break;}var _0x11088e={'method':_0xeafa('0x5a'),'uri':_0x51d457+_0xeafa('0x5b'),'qs':{'refresh_token':_0x5f240f[_0xeafa('0x5c')],'client_id':_0x5f240f[_0xeafa('0x5d')],'client_secret':_0x5f240f['clientSecret'],'grant_type':_0xeafa('0x5e')},'json':!![]};return rp(_0x11088e)[_0xeafa('0x28')](function(_0x388937){if(_0x388937[_0xeafa('0x5f')]){_0x21f6f5(_0x388937[_0xeafa('0x5f')]);}else{_0x198904('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xeafa('0x44')](function(_0xf49b4f){_0x198904(_0xf49b4f);});});}exports['getFields']=function(_0x59c432,_0x217612,_0x397ef9){var _0x1909df,_0x22c7cf,_0x5af54b,_0x4101f3,_0x3af40a;return db[_0xeafa('0x40')]['findOne']({'where':{'id':_0x59c432[_0xeafa('0x46')]['id']},'attributes':['id',_0xeafa('0x60'),_0xeafa('0x55'),_0xeafa('0x5d'),'clientSecret',_0xeafa('0x61'),_0xeafa('0x62'),_0xeafa('0x5c')]})['then'](handleEntityNotFound(_0x217612,null))['then'](function(_0x3bc23e){_0x3af40a=_0x3bc23e;_0x1909df=_0x3af40a['host'];_0x22c7cf=_0x1909df==='zoho.eu'?'eu':_0xeafa('0x63');_0x5af54b=_0x3af40a[_0xeafa('0x61')];var _0xe0c757=_0x5af54b[_0xeafa('0x64')](-0x1);if(_0xe0c757==='/'||_0xe0c757==='\x5c'||_0xe0c757===':'){_0x5af54b=_0x5af54b[_0xeafa('0x65')](0x0,_0x5af54b[_0xeafa('0x66')](_0xe0c757));}if(!_0x3af40a[_0xeafa('0x5c')]){throw new Error(_0xeafa('0x67'));}return getAccessToken(_0x3af40a);})[_0xeafa('0x28')](function(_0x4ac7ed){if(_0x4ac7ed){return rp({'method':_0xeafa('0x68'),'uri':util[_0xeafa('0x69')](_0xeafa('0x6a'),_0x22c7cf),'qs':{'module':_0xeafa('0x6b')},'headers':{'Authorization':_0xeafa('0x6c')+_0x4ac7ed},'json':!![]});}})[_0xeafa('0x28')](function(_0x42252a){if(_0x42252a){if(_0x42252a[_0xeafa('0x6d')]&&_0x42252a['response'][_0xeafa('0x6e')]){throw new Error(_0x42252a[_0xeafa('0x6d')]['error']['message']);}var _0x578f28=[];var _0x4d1a84=[];var _0x1ed6cd=[_0xeafa('0x6f'),_0xeafa('0x70'),_0xeafa('0x71'),_0xeafa('0x72'),_0xeafa('0x73'),'Call_Result',_0xeafa('0x74'),_0xeafa('0x75')];_0x4d1a84=_[_0xeafa('0x76')](_0x42252a[_0xeafa('0x35')],function(_0x5bbb51){return _0x1ed6cd[_0xeafa('0x77')](_0x5bbb51[_0xeafa('0x78')]);});for(var _0x17700b=0x0;_0x17700b<_0x4d1a84[_0xeafa('0x37')];_0x17700b++){if(_0x4d1a84[_0x17700b][_0xeafa('0x79')]===![]){_0x578f28[_0xeafa('0x7a')]({'id':_0x4d1a84[_0x17700b]['id'],'name':_0x4d1a84[_0x17700b]['display_label'],'custom':_0x4d1a84[_0x17700b][_0xeafa('0x7b')],'options':_0x4d1a84[_0x17700b]['data_type']===_0xeafa('0x7c')&&_0x4d1a84[_0x17700b][_0xeafa('0x7d')][_0xeafa('0x37')]>-0x1?_[_0xeafa('0x2d')](_0x4d1a84[_0x17700b][_0xeafa('0x7d')],function(_0x345fd9){return{'name':_0x345fd9,'value':_0x345fd9};}):[]});}}return{'count':_0x578f28[_0xeafa('0x37')],'rows':_0x578f28};}else{return{'count':0x0,'rows':[]};}})[_0xeafa('0x28')](respondWithResult(_0x217612,null))[_0xeafa('0x44')](function(_0x21ec09){var _0x5c96d9=_0x59c432[_0xeafa('0x32')][_0xeafa('0x7e')]?0x1f4:_0x21ec09['statusCode']||0x1f4;logger['error'](_0xeafa('0x7f'),_0xeafa('0x80'),_0x5c96d9,JSON[_0xeafa('0x81')](_0x21ec09));delete _0x21ec09[_0xeafa('0x2a')];if(_0x5c96d9===0x191){_0x5c96d9=0x190;}_0x217612[_0xeafa('0x20')](_0x5c96d9)[_0xeafa('0x2b')](_0x59c432[_0xeafa('0x32')][_0xeafa('0x7e')]?{'message':_0xeafa('0x82'),'statusCode':_0x21ec09[_0xeafa('0x83')]}:_0x21ec09);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index cb8081a..c05f88b 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 _0xd9bf=['path','../../config/environment','../../components/integrations/configuration','define','zone','changed','serverUrl','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','authorization_code','clientId','application/x-www-form-urlencoded','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refresh_token','error','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x172df9,_0x239100){var _0x3d8603=function(_0x450a55){while(--_0x450a55){_0x172df9['push'](_0x172df9['shift']());}};_0x3d8603(++_0x239100);}(_0xd9bf,0x162));var _0xfd9b=function(_0x1fa2b3,_0x50ade4){_0x1fa2b3=_0x1fa2b3-0x0;var _0x4ed3c0=_0xd9bf[_0x1fa2b3];return _0x4ed3c0;};'use strict';var _=require(_0xfd9b('0x0'));var util=require(_0xfd9b('0x1'));var logger=require(_0xfd9b('0x2'))(_0xfd9b('0x3'));var moment=require('moment');var BPromise=require(_0xfd9b('0x4'));var rp=require(_0xfd9b('0x5'));var fs=require('fs');var path=require(_0xfd9b('0x6'));var rimraf=require('rimraf');var config=require(_0xfd9b('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xfd9b('0x8'));module['exports']=function(_0x29afe9,_0x2f2519){return _0x29afe9[_0xfd9b('0x9')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25da82,_0x11925d,_0x1a6dea){if(_0x25da82['changed'](_0xfd9b('0xa'))||_0x25da82[_0xfd9b('0xb')](_0xfd9b('0xc'))||_0x25da82[_0xfd9b('0xb')]('clientId')||_0x25da82['changed'](_0xfd9b('0xd'))||_0x25da82[_0xfd9b('0xb')](_0xfd9b('0xe'))||_0x25da82[_0xfd9b('0xb')](_0xfd9b('0xf'))){var _0x289dfc,_0x26a192;_0x289dfc=_0x25da82[_0xfd9b('0xc')];var _0x4a75e8=_0x289dfc['slice'](-0x1);if(_0x4a75e8==='/'||_0x4a75e8==='\x5c'||_0x4a75e8===':'){_0x289dfc=_0x289dfc[_0xfd9b('0x10')](0x0,_0x289dfc['lastIndexOf'](_0x4a75e8));}switch(_0x25da82[_0xfd9b('0xa')]){case'US':_0x26a192=_0xfd9b('0x11');break;case'AU':_0x26a192='https://accounts.zoho.com.au';break;case'IN':_0x26a192=_0xfd9b('0x12');break;case'CN':_0x26a192=_0xfd9b('0x13');break;default:_0x26a192='https://accounts.zoho.eu';break;}var _0x3f5401={'method':'POST','uri':_0x26a192+'/oauth/v2/token','form':{'grant_type':_0xfd9b('0x14'),'client_id':_0x25da82[_0xfd9b('0x15')],'client_secret':_0x25da82[_0xfd9b('0xd')],'redirect_uri':_0x25da82[_0xfd9b('0xc')],'code':_0x25da82[_0xfd9b('0xe')]},'headers':{'Content-Type':_0xfd9b('0x16')}};return rp(_0x3f5401)['then'](function(_0x44403c){var _0x2ef1a6=JSON[_0xfd9b('0x17')](_0x44403c);if(_0x2ef1a6['refresh_token']){_0x25da82[_0xfd9b('0x18')]=_0x2ef1a6['refresh_token'];logger[_0xfd9b('0x19')](util[_0xfd9b('0x1a')](_0xfd9b('0x1b'),_0x25da82['name'],_0x25da82['id']));}else{logger['error'](util[_0xfd9b('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x25da82[_0xfd9b('0x1c')],_0x25da82['id']),util[_0xfd9b('0x1d')](_0x2ef1a6,{'showHidden':![],'depth':null}));}return _0x1a6dea(null,_0x11925d);})[_0xfd9b('0x1e')](function(_0x244c9d){logger['error'](util[_0xfd9b('0x1a')](_0xfd9b('0x1f'),_0x25da82[_0xfd9b('0x1c')],_0x25da82['id']),util[_0xfd9b('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x1a6dea(_0x244c9d);});}else{return _0x1a6dea(null,_0x11925d);}},'beforeUpdate':function(_0x30531a,_0x11e81f,_0x3f34ac){if(_0x30531a[_0xfd9b('0xb')](_0xfd9b('0xa'))||_0x30531a[_0xfd9b('0xb')]('serverUrl')||_0x30531a[_0xfd9b('0xb')](_0xfd9b('0x15'))||_0x30531a['changed'](_0xfd9b('0xd'))||_0x30531a[_0xfd9b('0xb')](_0xfd9b('0xe'))||_0x30531a['changed'](_0xfd9b('0xf'))){var _0x5eda86,_0x56209c;_0x5eda86=_0x30531a[_0xfd9b('0xc')];var _0x3292ab=_0x5eda86[_0xfd9b('0x20')](-0x1);if(_0x3292ab==='/'||_0x3292ab==='\x5c'||_0x3292ab===':'){_0x5eda86=_0x5eda86[_0xfd9b('0x10')](0x0,_0x5eda86[_0xfd9b('0x21')](_0x3292ab));}switch(_0x30531a[_0xfd9b('0xa')]){case'US':_0x56209c=_0xfd9b('0x11');break;case'AU':_0x56209c=_0xfd9b('0x22');break;case'IN':_0x56209c=_0xfd9b('0x12');break;case'CN':_0x56209c=_0xfd9b('0x13');break;default:_0x56209c=_0xfd9b('0x23');break;}var _0x17c356={'method':_0xfd9b('0x24'),'uri':_0x56209c+_0xfd9b('0x25'),'form':{'grant_type':'authorization_code','client_id':_0x30531a[_0xfd9b('0x15')],'client_secret':_0x30531a[_0xfd9b('0xd')],'redirect_uri':_0x30531a['serverUrl'],'code':_0x30531a['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x17c356)['then'](function(_0x2da459){var _0x37171e=JSON[_0xfd9b('0x17')](_0x2da459);if(_0x37171e['refresh_token']){_0x30531a[_0xfd9b('0x18')]=_0x37171e[_0xfd9b('0x26')];logger[_0xfd9b('0x19')](util['format'](_0xfd9b('0x1b'),_0x30531a[_0xfd9b('0x1c')],_0x30531a['id']));}else{logger[_0xfd9b('0x27')](util[_0xfd9b('0x1a')](_0xfd9b('0x1f'),_0x30531a[_0xfd9b('0x1c')],_0x30531a['id']),util[_0xfd9b('0x1d')](_0x37171e,{'showHidden':![],'depth':null}));}return _0x3f34ac(null,_0x11e81f);})[_0xfd9b('0x1e')](function(_0x568ce3){logger[_0xfd9b('0x27')](util[_0xfd9b('0x1a')](_0xfd9b('0x1f'),_0x30531a['name'],_0x30531a['id']),util[_0xfd9b('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x3f34ac(_0x568ce3);});}else{return _0x3f34ac(null,_0x11e81f);}}}});}; \ No newline at end of file +var _0x5ffe=['inspect','catch','host','POST','/oauth/v2/token','refreshToken','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','int_zoho_accounts','changed','zone','serverUrl','clientId','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5ffe,0x1f2));var _0xe5ff=function(_0x269486,_0x2e69a1){_0x269486=_0x269486-0x0;var _0x42b038=_0x5ffe[_0x269486];return _0x42b038;};'use strict';var _=require(_0xe5ff('0x0'));var util=require(_0xe5ff('0x1'));var logger=require(_0xe5ff('0x2'))(_0xe5ff('0x3'));var moment=require(_0xe5ff('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5ff('0x5'));var rimraf=require(_0xe5ff('0x6'));var config=require(_0xe5ff('0x7'));var attributes=require(_0xe5ff('0x8'));var integrations=require(_0xe5ff('0x9'));module['exports']=function(_0x2e9992,_0xa1265d){return _0x2e9992['define']('ZohoAccount',attributes,{'tableName':_0xe5ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x18e786,_0x34931e,_0xa683c1){if(_0x18e786[_0xe5ff('0xb')](_0xe5ff('0xc'))||_0x18e786[_0xe5ff('0xb')](_0xe5ff('0xd'))||_0x18e786[_0xe5ff('0xb')](_0xe5ff('0xe'))||_0x18e786[_0xe5ff('0xb')]('clientSecret')||_0x18e786[_0xe5ff('0xb')](_0xe5ff('0xf'))||_0x18e786[_0xe5ff('0xb')]('host')){var _0x2ad268,_0x2ab574;_0x2ad268=_0x18e786[_0xe5ff('0xd')];var _0x1deec3=_0x2ad268[_0xe5ff('0x10')](-0x1);if(_0x1deec3==='/'||_0x1deec3==='\x5c'||_0x1deec3===':'){_0x2ad268=_0x2ad268[_0xe5ff('0x11')](0x0,_0x2ad268[_0xe5ff('0x12')](_0x1deec3));}switch(_0x18e786[_0xe5ff('0xc')]){case'US':_0x2ab574=_0xe5ff('0x13');break;case'AU':_0x2ab574=_0xe5ff('0x14');break;case'IN':_0x2ab574=_0xe5ff('0x15');break;case'CN':_0x2ab574=_0xe5ff('0x16');break;default:_0x2ab574='https://accounts.zoho.eu';break;}var _0x58bbf3={'method':'POST','uri':_0x2ab574+'/oauth/v2/token','form':{'grant_type':_0xe5ff('0x17'),'client_id':_0x18e786[_0xe5ff('0xe')],'client_secret':_0x18e786[_0xe5ff('0x18')],'redirect_uri':_0x18e786[_0xe5ff('0xd')],'code':_0x18e786['code']},'headers':{'Content-Type':_0xe5ff('0x19')}};return rp(_0x58bbf3)[_0xe5ff('0x1a')](function(_0x314089){var _0x26298d=JSON[_0xe5ff('0x1b')](_0x314089);if(_0x26298d[_0xe5ff('0x1c')]){_0x18e786['refreshToken']=_0x26298d[_0xe5ff('0x1c')];logger[_0xe5ff('0x1d')](util['format'](_0xe5ff('0x1e'),_0x18e786[_0xe5ff('0x1f')],_0x18e786['id']));}else{logger[_0xe5ff('0x20')](util[_0xe5ff('0x21')](_0xe5ff('0x22'),_0x18e786['name'],_0x18e786['id']),util[_0xe5ff('0x23')](_0x26298d,{'showHidden':![],'depth':null}));}return _0xa683c1(null,_0x34931e);})[_0xe5ff('0x24')](function(_0x5a4678){logger[_0xe5ff('0x20')](util[_0xe5ff('0x21')](_0xe5ff('0x22'),_0x18e786[_0xe5ff('0x1f')],_0x18e786['id']),util[_0xe5ff('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xa683c1(_0x5a4678);});}else{return _0xa683c1(null,_0x34931e);}},'beforeUpdate':function(_0x4131ad,_0x1c62b4,_0x10da0e){if(_0x4131ad[_0xe5ff('0xb')](_0xe5ff('0xc'))||_0x4131ad[_0xe5ff('0xb')](_0xe5ff('0xd'))||_0x4131ad[_0xe5ff('0xb')](_0xe5ff('0xe'))||_0x4131ad['changed'](_0xe5ff('0x18'))||_0x4131ad[_0xe5ff('0xb')](_0xe5ff('0xf'))||_0x4131ad[_0xe5ff('0xb')](_0xe5ff('0x25'))){var _0x164ab4,_0x46428a;_0x164ab4=_0x4131ad[_0xe5ff('0xd')];var _0xcea134=_0x164ab4[_0xe5ff('0x10')](-0x1);if(_0xcea134==='/'||_0xcea134==='\x5c'||_0xcea134===':'){_0x164ab4=_0x164ab4[_0xe5ff('0x11')](0x0,_0x164ab4[_0xe5ff('0x12')](_0xcea134));}switch(_0x4131ad[_0xe5ff('0xc')]){case'US':_0x46428a=_0xe5ff('0x13');break;case'AU':_0x46428a=_0xe5ff('0x14');break;case'IN':_0x46428a=_0xe5ff('0x15');break;case'CN':_0x46428a='https://accounts.zoho.com.cn';break;default:_0x46428a='https://accounts.zoho.eu';break;}var _0xacb604={'method':_0xe5ff('0x26'),'uri':_0x46428a+_0xe5ff('0x27'),'form':{'grant_type':_0xe5ff('0x17'),'client_id':_0x4131ad['clientId'],'client_secret':_0x4131ad[_0xe5ff('0x18')],'redirect_uri':_0x4131ad['serverUrl'],'code':_0x4131ad[_0xe5ff('0xf')]},'headers':{'Content-Type':_0xe5ff('0x19')}};return rp(_0xacb604)[_0xe5ff('0x1a')](function(_0x1e7614){var _0x49c91f=JSON[_0xe5ff('0x1b')](_0x1e7614);if(_0x49c91f['refresh_token']){_0x4131ad[_0xe5ff('0x28')]=_0x49c91f['refresh_token'];logger['info'](util[_0xe5ff('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4131ad[_0xe5ff('0x1f')],_0x4131ad['id']));}else{logger[_0xe5ff('0x20')](util[_0xe5ff('0x21')](_0xe5ff('0x22'),_0x4131ad[_0xe5ff('0x1f')],_0x4131ad['id']),util['inspect'](_0x49c91f,{'showHidden':![],'depth':null}));}return _0x10da0e(null,_0x1c62b4);})[_0xe5ff('0x24')](function(_0x5c7e8b){logger[_0xe5ff('0x20')](util[_0xe5ff('0x21')](_0xe5ff('0x22'),_0x4131ad[_0xe5ff('0x1f')],_0x4131ad['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x10da0e(_0x5c7e8b);});}else{return _0x10da0e(null,_0x1c62b4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 194a15f..8f37349 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 _0x6d11=['debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ZohoAccount','findAll','options','attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s'];(function(_0x2a43b9,_0x2aa7ea){var _0x3b6c90=function(_0x5be37f){while(--_0x5be37f){_0x2a43b9['push'](_0x2a43b9['shift']());}};_0x3b6c90(++_0x2aa7ea);}(_0x6d11,0xbf));var _0x16d1=function(_0x48b0c9,_0x3cb775){_0x48b0c9=_0x48b0c9-0x0;var _0x3df2f5=_0x6d11[_0x48b0c9];return _0x3df2f5;};'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});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['GetZohoAccount']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')]({'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'where':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')]['where']||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'limit':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x19')]||null:null,'include':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')]['include']?_[_0x16d1('0x1a')](_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x47cad4){return{'model':db[_0x47cad4[_0x16d1('0x1c')]],'as':_0x47cad4['as'],'attributes':_0x47cad4[_0x16d1('0x18')],'include':_0x47cad4[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x47cad4[_0x16d1('0x1b')],function(_0x335c24){return{'model':db[_0x335c24[_0x16d1('0x1c')]],'as':_0x335c24['as'],'attributes':_0x335c24[_0x16d1('0x18')],'include':_0x335c24[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x335c24[_0x16d1('0x1b')],function(_0x2b8403){return{'model':db[_0x2b8403['model']],'as':_0x2b8403['as'],'attributes':_0x2b8403[_0x16d1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x16d1('0xa')](function(_0x4257f1){logger['info'](_0x16d1('0x1d'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1d'),_0x46a25e,JSON[_0x16d1('0x10')](_0x4257f1));_0x1da1b8(_0x4257f1);})[_0x16d1('0x14')](function(_0x462e5b){logger[_0x16d1('0x11')]('GetZohoAccount',_0x462e5b[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x462e5b[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1e')]=function(_0x55c021){var _0x4b27f6=this;return new Promise(function(_0x2f16ee,_0x4ab3d4){return db[_0x16d1('0x15')][_0x16d1('0x1f')]({'raw':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x20')]===undefined?!![]:![]:!![],'where':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x21')]||null:null,'attributes':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'include':_0x55c021[_0x16d1('0x17')]?_0x55c021['options'][_0x16d1('0x1b')]?_['map'](_0x55c021[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x2b9126){return{'model':db[_0x2b9126[_0x16d1('0x1c')]],'as':_0x2b9126['as'],'attributes':_0x2b9126[_0x16d1('0x18')],'include':_0x2b9126[_0x16d1('0x1b')]?_['map'](_0x2b9126['include'],function(_0x58d72d){return{'model':db[_0x58d72d[_0x16d1('0x1c')]],'as':_0x58d72d['as'],'attributes':_0x58d72d[_0x16d1('0x18')],'include':_0x58d72d[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x58d72d['include'],function(_0x885454){return{'model':db[_0x885454[_0x16d1('0x1c')]],'as':_0x885454['as'],'attributes':_0x885454['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x508ed7){logger[_0x16d1('0xb')](_0x16d1('0x1e'),_0x55c021);logger[_0x16d1('0xd')]('ShowZohoAccount',_0x55c021,JSON[_0x16d1('0x10')](_0x508ed7));_0x2f16ee(_0x508ed7);})[_0x16d1('0x14')](function(_0x2928ad){logger[_0x16d1('0x11')](_0x16d1('0x1e'),_0x2928ad[_0x16d1('0x13')],_0x55c021);_0x4ab3d4(_0x4b27f6[_0x16d1('0x11')](0x1f4,_0x2928ad['message']));});});}; \ No newline at end of file +var _0x6000=['debug','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','ShowZohoAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4732e4,_0x5b0ab6){var _0x2ac1c3=function(_0x250288){while(--_0x250288){_0x4732e4['push'](_0x4732e4['shift']());}};_0x2ac1c3(++_0x5b0ab6);}(_0x6000,0x17c));var _0x0600=function(_0x3e4c31,_0x2f74db){_0x3e4c31=_0x3e4c31-0x0;var _0x455cf3=_0x6000[_0x3e4c31];return _0x455cf3;};'use strict';var _=require(_0x0600('0x0'));var util=require(_0x0600('0x1'));var moment=require(_0x0600('0x2'));var BPromise=require(_0x0600('0x3'));var rs=require(_0x0600('0x4'));var fs=require('fs');var Redis=require(_0x0600('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0600('0x6'));var logger=require(_0x0600('0x7'))('rpc');var config=require(_0x0600('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0600('0x9')][_0x0600('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89927a,_0x559495,_0x45e348){return new BPromise(function(_0x5730b2,_0x15b6d2){return client[_0x0600('0xb')](_0x89927a,_0x45e348)[_0x0600('0xc')](function(_0xacb924){logger[_0x0600('0xd')](_0x0600('0xe'),_0x559495,_0x0600('0xf'));logger[_0x0600('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x559495,_0x0600('0xf'),JSON[_0x0600('0x11')](_0xacb924));if(_0xacb924['error']){if(_0xacb924[_0x0600('0x12')][_0x0600('0x13')]===0x1f4){logger[_0x0600('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x559495,_0xacb924[_0x0600('0x12')]['message']);return _0x15b6d2(_0xacb924[_0x0600('0x12')][_0x0600('0x14')]);}logger[_0x0600('0x12')](_0x0600('0xe'),_0x559495,_0xacb924[_0x0600('0x12')]['message']);return _0x5730b2(_0xacb924[_0x0600('0x12')][_0x0600('0x14')]);}else{logger['info'](_0x0600('0xe'),_0x559495,_0x0600('0xf'));_0x5730b2(_0xacb924[_0x0600('0x15')][_0x0600('0x14')]);}})[_0x0600('0x16')](function(_0x31ced0){logger[_0x0600('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x559495,_0x31ced0);_0x15b6d2(_0x31ced0);});});}exports[_0x0600('0x17')]=function(_0x205998){var _0x25ade1=this;return new Promise(function(_0x571a0a,_0x251021){return db[_0x0600('0x18')][_0x0600('0x19')]({'raw':_0x205998[_0x0600('0x1a')]?_0x205998[_0x0600('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x205998[_0x0600('0x1a')]?_0x205998[_0x0600('0x1a')][_0x0600('0x1b')]||null:null,'attributes':_0x205998[_0x0600('0x1a')]?_0x205998['options'][_0x0600('0x1c')]||null:null,'limit':_0x205998[_0x0600('0x1a')]?_0x205998['options'][_0x0600('0x1d')]||null:null,'include':_0x205998['options']?_0x205998[_0x0600('0x1a')][_0x0600('0x1e')]?_[_0x0600('0x1f')](_0x205998['options'][_0x0600('0x1e')],function(_0x246f8c){return{'model':db[_0x246f8c['model']],'as':_0x246f8c['as'],'attributes':_0x246f8c[_0x0600('0x1c')],'include':_0x246f8c[_0x0600('0x1e')]?_['map'](_0x246f8c[_0x0600('0x1e')],function(_0x4c09fb){return{'model':db[_0x4c09fb[_0x0600('0x20')]],'as':_0x4c09fb['as'],'attributes':_0x4c09fb[_0x0600('0x1c')],'include':_0x4c09fb[_0x0600('0x1e')]?_[_0x0600('0x1f')](_0x4c09fb[_0x0600('0x1e')],function(_0x536b65){return{'model':db[_0x536b65[_0x0600('0x20')]],'as':_0x536b65['as'],'attributes':_0x536b65[_0x0600('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0600('0xc')](function(_0x5b9264){logger['info'](_0x0600('0x17'),_0x205998);logger['debug']('GetZohoAccount',_0x205998,JSON[_0x0600('0x11')](_0x5b9264));_0x571a0a(_0x5b9264);})[_0x0600('0x16')](function(_0x3b543b){logger['error'](_0x0600('0x17'),_0x3b543b[_0x0600('0x14')],_0x205998);_0x251021(_0x25ade1[_0x0600('0x12')](0x1f4,_0x3b543b[_0x0600('0x14')]));});});};exports[_0x0600('0x21')]=function(_0x657d6e){var _0x1f8ccb=this;return new Promise(function(_0x454bd4,_0x57241e){return db[_0x0600('0x18')][_0x0600('0x22')]({'raw':_0x657d6e[_0x0600('0x1a')]?_0x657d6e['options'][_0x0600('0x23')]===undefined?!![]:![]:!![],'where':_0x657d6e[_0x0600('0x1a')]?_0x657d6e['options'][_0x0600('0x1b')]||null:null,'attributes':_0x657d6e[_0x0600('0x1a')]?_0x657d6e[_0x0600('0x1a')][_0x0600('0x1c')]||null:null,'include':_0x657d6e[_0x0600('0x1a')]?_0x657d6e[_0x0600('0x1a')][_0x0600('0x1e')]?_['map'](_0x657d6e['options']['include'],function(_0x6f5533){return{'model':db[_0x6f5533[_0x0600('0x20')]],'as':_0x6f5533['as'],'attributes':_0x6f5533[_0x0600('0x1c')],'include':_0x6f5533[_0x0600('0x1e')]?_[_0x0600('0x1f')](_0x6f5533[_0x0600('0x1e')],function(_0x526d59){return{'model':db[_0x526d59[_0x0600('0x20')]],'as':_0x526d59['as'],'attributes':_0x526d59['attributes'],'include':_0x526d59[_0x0600('0x1e')]?_['map'](_0x526d59['include'],function(_0x43e05d){return{'model':db[_0x43e05d[_0x0600('0x20')]],'as':_0x43e05d['as'],'attributes':_0x43e05d[_0x0600('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0600('0xc')](function(_0x589e99){logger[_0x0600('0xd')](_0x0600('0x21'),_0x657d6e);logger[_0x0600('0x10')](_0x0600('0x21'),_0x657d6e,JSON[_0x0600('0x11')](_0x589e99));_0x454bd4(_0x589e99);})[_0x0600('0x16')](function(_0x3b3e5e){logger['error'](_0x0600('0x21'),_0x3b3e5e['message'],_0x657d6e);_0x57241e(_0x1f8ccb[_0x0600('0x12')](0x1f4,_0x3b3e5e[_0x0600('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 781877f..a2f4a89 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 _0xf37c=['/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','multer','path','express','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index'];(function(_0x2b7074,_0x50bf29){var _0x1fe9ca=function(_0x5b4bde){while(--_0x5b4bde){_0x2b7074['push'](_0x2b7074['shift']());}};_0x1fe9ca(++_0x50bf29);}(_0xf37c,0xdb));var _0xcf37=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xf37c[_0x184759];return _0xf26d5f;};'use strict';var multer=require(_0xcf37('0x0'));var util=require('util');var path=require(_0xcf37('0x1'));var timeout=require('connect-timeout');var express=require(_0xcf37('0x2'));var router=express[_0xcf37('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcf37('0x4'));var config=require(_0xcf37('0x5'));var controller=require(_0xcf37('0x6'));router[_0xcf37('0x7')]('/',auth['isAuthenticated'](),controller[_0xcf37('0x8')]);router[_0xcf37('0x7')](_0xcf37('0x9'),auth[_0xcf37('0xa')](),controller[_0xcf37('0xb')]);router[_0xcf37('0x7')](_0xcf37('0xc'),auth[_0xcf37('0xa')](),controller['getFields']);router['get'](_0xcf37('0xd'),auth[_0xcf37('0xa')](),controller[_0xcf37('0xe')]);router[_0xcf37('0x7')](_0xcf37('0xf'),auth[_0xcf37('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0xcf37('0xa')](),controller[_0xcf37('0x10')]);router[_0xcf37('0x11')]('/:id',auth[_0xcf37('0xa')](),controller['update']);router[_0xcf37('0x12')](_0xcf37('0x9'),auth[_0xcf37('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7ba8=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x7ba8,0x85));var _0x87ba=function(_0x4e9197,_0x29faeb){_0x4e9197=_0x4e9197-0x0;var _0xd2c647=_0x7ba8[_0x4e9197];return _0xd2c647;};'use strict';var multer=require(_0x87ba('0x0'));var util=require('util');var path=require(_0x87ba('0x1'));var timeout=require(_0x87ba('0x2'));var express=require('express');var router=express[_0x87ba('0x3')]();var fs_extra=require(_0x87ba('0x4'));var auth=require(_0x87ba('0x5'));var interaction=require(_0x87ba('0x6'));var config=require(_0x87ba('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x87ba('0x8')]('/',auth[_0x87ba('0x9')](),controller[_0x87ba('0xa')]);router[_0x87ba('0x8')]('/:id',auth[_0x87ba('0x9')](),controller['show']);router[_0x87ba('0x8')](_0x87ba('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x87ba('0x8')](_0x87ba('0xc'),auth['isAuthenticated'](),controller[_0x87ba('0xd')]);router['get'](_0x87ba('0xe'),auth[_0x87ba('0x9')](),controller[_0x87ba('0xf')]);router[_0x87ba('0x10')]('/',auth[_0x87ba('0x9')](),controller[_0x87ba('0x11')]);router[_0x87ba('0x12')](_0x87ba('0x13'),auth[_0x87ba('0x9')](),controller[_0x87ba('0x14')]);router[_0x87ba('0x15')]('/:id',auth[_0x87ba('0x9')](),controller[_0x87ba('0x16')]);module[_0x87ba('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 420ccae..af70d1e 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 _0x596e=['nothing','lead','sequelize','exports','STRING','ENUM','contact'];(function(_0x1199fd,_0x567027){var _0x117eab=function(_0x4e46a0){while(--_0x4e46a0){_0x1199fd['push'](_0x1199fd['shift']());}};_0x117eab(++_0x567027);}(_0x596e,0xb1));var _0xe596=function(_0x1f560d,_0x3aa81c){_0x1f560d=_0x1f560d-0x0;var _0x42757a=_0x596e[_0x1f560d];return _0x42757a;};'use strict';var Sequelize=require(_0xe596('0x0'));module[_0xe596('0x1')]={'name':{'type':Sequelize[_0xe596('0x2')]},'moduleCreate':{'type':Sequelize[_0xe596('0x3')]('lead',_0xe596('0x4'),_0xe596('0x5')),'defaultValue':_0xe596('0x6')},'moduleSearch':{'type':Sequelize[_0xe596('0x3')]('contact_lead',_0xe596('0x4'),_0xe596('0x6')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xe596('0x2')]}}; \ No newline at end of file +var _0xb453=['ENUM','lead','contact_lead','contact','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb453,0x1e8));var _0x3b45=function(_0x2f9c0d,_0x3d0eeb){_0x2f9c0d=_0x2f9c0d-0x0;var _0x5dfd48=_0xb453[_0x2f9c0d];return _0x5dfd48;};'use strict';var Sequelize=require(_0x3b45('0x0'));module[_0x3b45('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x3b45('0x2')](_0x3b45('0x3'),'contact','nothing'),'defaultValue':_0x3b45('0x3')},'moduleSearch':{'type':Sequelize[_0x3b45('0x2')](_0x3b45('0x4'),_0x3b45('0x5'),_0x3b45('0x3')),'defaultValue':_0x3b45('0x4')},'description':{'type':Sequelize[_0x3b45('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2b226bb..9c312d2 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 _0xd53c=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','ZohoConfiguration','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','ZohoField','pick','hasOwnProperty','getSubjects','order','getDescriptions','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xd53c,0x1cb));var _0xcd53=function(_0x248dea,_0x368df2){_0x248dea=_0x248dea-0x0;var _0x37c037=_0xd53c[_0x248dea];return _0x37c037;};'use strict';var emlformat=require(_0xcd53('0x0'));var rimraf=require(_0xcd53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd53('0x2'));var moment=require(_0xcd53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcd53('0x4'));var util=require(_0xcd53('0x5'));var path=require(_0xcd53('0x6'));var sox=require(_0xcd53('0x7'));var csv=require(_0xcd53('0x8'));var ejs=require(_0xcd53('0x9'));var fs=require('fs');var fs_extra=require(_0xcd53('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcd53('0xb'));var jsforce=require(_0xcd53('0xc'));var deskjs=require(_0xcd53('0xd'));var toCsv=require(_0xcd53('0x8'));var querystring=require(_0xcd53('0xe'));var Papa=require(_0xcd53('0xf'));var Redis=require('ioredis');var authService=require(_0xcd53('0x10'));var qs=require(_0xcd53('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd53('0x12'))(_0xcd53('0x13'));var utils=require(_0xcd53('0x14'));var config=require(_0xcd53('0x15'));var licenseUtil=require(_0xcd53('0x16'));var db=require(_0xcd53('0x17'))['db'];function respondWithStatusCode(_0x329c3f,_0x5d3649){_0x5d3649=_0x5d3649||0xcc;return function(_0x38e953){if(_0x38e953){return _0x329c3f['sendStatus'](_0x5d3649);}return _0x329c3f[_0xcd53('0x18')](_0x5d3649)[_0xcd53('0x19')]();};}function respondWithResult(_0x3456d6,_0x399b8c){_0x399b8c=_0x399b8c||0xc8;return function(_0x511a20){if(_0x511a20){return _0x3456d6[_0xcd53('0x18')](_0x399b8c)[_0xcd53('0x1a')](_0x511a20);}};}function respondWithFilteredResult(_0x246a7c,_0x30892e){return function(_0x3662e0){if(_0x3662e0){var _0x439a85=typeof _0x30892e[_0xcd53('0x1b')]===_0xcd53('0x1c')&&typeof _0x30892e[_0xcd53('0x1d')]===_0xcd53('0x1c');var _0x1983be=_0x3662e0[_0xcd53('0x1e')];var _0x5e38b8=_0x439a85?0x0:_0x30892e[_0xcd53('0x1b')];var _0x1c2f6c=_0x439a85?_0x3662e0[_0xcd53('0x1e')]:_0x30892e['offset']+_0x30892e['limit'];var _0x129a78;if(_0x1c2f6c>=_0x1983be){_0x1c2f6c=_0x1983be;_0x129a78=0xc8;}else{_0x129a78=0xce;}_0x246a7c[_0xcd53('0x18')](_0x129a78);return _0x246a7c[_0xcd53('0x1f')]('Content-Range',_0x5e38b8+'-'+_0x1c2f6c+'/'+_0x1983be)['json'](_0x3662e0);}return null;};}function patchUpdates(_0x2832ac){return function(_0x54890a){try{jsonpatch[_0xcd53('0x20')](_0x54890a,_0x2832ac,!![]);}catch(_0xc15c87){return BPromise[_0xcd53('0x21')](_0xc15c87);}return _0x54890a['save']();};}function saveUpdates(_0x4f54d2,_0x3ba8cc){return function(_0x472e02){if(_0x472e02){return _0x472e02[_0xcd53('0x22')](_0x4f54d2)[_0xcd53('0x23')](function(_0x371981){return _0x371981;});}return null;};}function removeEntity(_0x407ce5,_0x509471){return function(_0x1bf54c){if(_0x1bf54c){return _0x1bf54c[_0xcd53('0x24')]()[_0xcd53('0x23')](function(){_0x407ce5[_0xcd53('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d31d,_0x2b5ef6){return function(_0x32a1ae){if(!_0x32a1ae){_0x36d31d['sendStatus'](0x194);}return _0x32a1ae;};}function handleError(_0x1e7e90,_0x5178aa){_0x5178aa=_0x5178aa||0x1f4;return function(_0x3834cf){logger[_0xcd53('0x25')](_0x3834cf[_0xcd53('0x26')]);if(_0x3834cf[_0xcd53('0x27')]){delete _0x3834cf[_0xcd53('0x27')];}_0x1e7e90[_0xcd53('0x18')](_0x5178aa)['send'](_0x3834cf);};}exports[_0xcd53('0x28')]=function(_0x21e7bf,_0x58660c){var _0x29e42f={},_0x2efe51={},_0x505e3b={'count':0x0,'rows':[]};var _0x5d3beb=_[_0xcd53('0x29')](db['ZohoConfiguration'][_0xcd53('0x2a')],function(_0x566726){return{'name':_0x566726[_0xcd53('0x2b')],'type':_0x566726['type']['key']};});_0x2efe51[_0xcd53('0x2c')]=_[_0xcd53('0x29')](_0x5d3beb,'name');_0x2efe51['query']=_[_0xcd53('0x2d')](_0x21e7bf[_0xcd53('0x2e')]);_0x2efe51[_0xcd53('0x2f')]=_[_0xcd53('0x30')](_0x2efe51[_0xcd53('0x2c')],_0x2efe51['query']);_0x29e42f[_0xcd53('0x31')]=_[_0xcd53('0x30')](_0x2efe51[_0xcd53('0x2c')],qs[_0xcd53('0x32')](_0x21e7bf[_0xcd53('0x2e')][_0xcd53('0x32')]));_0x29e42f[_0xcd53('0x31')]=_0x29e42f[_0xcd53('0x31')][_0xcd53('0x33')]?_0x29e42f[_0xcd53('0x31')]:_0x2efe51[_0xcd53('0x2c')];if(!_0x21e7bf[_0xcd53('0x2e')]['hasOwnProperty'](_0xcd53('0x34'))){_0x29e42f['limit']=qs[_0xcd53('0x1d')](_0x21e7bf[_0xcd53('0x2e')][_0xcd53('0x1d')]);_0x29e42f[_0xcd53('0x1b')]=qs[_0xcd53('0x1b')](_0x21e7bf[_0xcd53('0x2e')][_0xcd53('0x1b')]);}_0x29e42f['order']=qs[_0xcd53('0x35')](_0x21e7bf[_0xcd53('0x2e')]['sort']);_0x29e42f[_0xcd53('0x36')]=qs[_0xcd53('0x2f')](_['pick'](_0x21e7bf[_0xcd53('0x2e')],_0x2efe51[_0xcd53('0x2f')]),_0x5d3beb);if(_0x21e7bf[_0xcd53('0x2e')][_0xcd53('0x37')]){_0x29e42f['where']=_[_0xcd53('0x38')](_0x29e42f[_0xcd53('0x36')],{'$or':_[_0xcd53('0x29')](_0x5d3beb,function(_0x5a6664){if(_0x5a6664[_0xcd53('0x39')]!==_0xcd53('0x3a')){var _0x5595e1={};_0x5595e1[_0x5a6664[_0xcd53('0x27')]]={'$like':'%'+_0x21e7bf[_0xcd53('0x2e')][_0xcd53('0x37')]+'%'};return _0x5595e1;}})});}_0x29e42f=_[_0xcd53('0x38')]({},_0x29e42f,_0x21e7bf[_0xcd53('0x3b')]);var _0xb6f2c7={'where':_0x29e42f['where']};return db[_0xcd53('0x3c')][_0xcd53('0x1e')](_0xb6f2c7)['then'](function(_0x4efe4c){_0x505e3b[_0xcd53('0x1e')]=_0x4efe4c;if(_0x21e7bf['query']['includeAll']){_0x29e42f[_0xcd53('0x3d')]=[{'all':!![]}];}return db[_0xcd53('0x3c')][_0xcd53('0x3e')](_0x29e42f);})[_0xcd53('0x23')](function(_0x18ac4d){_0x505e3b[_0xcd53('0x3f')]=_0x18ac4d;return _0x505e3b;})['then'](respondWithFilteredResult(_0x58660c,_0x29e42f))[_0xcd53('0x40')](handleError(_0x58660c,null));};exports[_0xcd53('0x41')]=function(_0x152d09,_0x21cd48){var _0xca9341={'raw':![],'where':{'id':_0x152d09[_0xcd53('0x42')]['id']}},_0x3fab86={};_0x3fab86['model']=_[_0xcd53('0x2d')](db['ZohoConfiguration'][_0xcd53('0x2a')]);_0x3fab86[_0xcd53('0x2e')]=_[_0xcd53('0x2d')](_0x152d09['query']);_0x3fab86[_0xcd53('0x2f')]=_['intersection'](_0x3fab86[_0xcd53('0x2c')],_0x3fab86[_0xcd53('0x2e')]);_0xca9341[_0xcd53('0x31')]=_['intersection'](_0x3fab86[_0xcd53('0x2c')],qs[_0xcd53('0x32')](_0x152d09['query'][_0xcd53('0x32')]));_0xca9341['attributes']=_0xca9341['attributes'][_0xcd53('0x33')]?_0xca9341[_0xcd53('0x31')]:_0x3fab86[_0xcd53('0x2c')];if(_0x152d09['query'][_0xcd53('0x43')]){_0xca9341[_0xcd53('0x3d')]=[{'all':!![]}];}_0xca9341=_[_0xcd53('0x38')]({},_0xca9341,_0x152d09['options']);return db[_0xcd53('0x3c')][_0xcd53('0x44')](_0xca9341)['then'](handleEntityNotFound(_0x21cd48,null))['then'](respondWithResult(_0x21cd48,null))['catch'](handleError(_0x21cd48,null));};exports[_0xcd53('0x45')]=function(_0x1368ae,_0x3b03a9){return db['ZohoConfiguration']['create'](_0x1368ae[_0xcd53('0x46')],{})[_0xcd53('0x23')](respondWithResult(_0x3b03a9,0xc9))[_0xcd53('0x40')](handleError(_0x3b03a9,null));};exports['update']=function(_0x400c59,_0x412b7f){if(_0x400c59[_0xcd53('0x46')]['id']){delete _0x400c59[_0xcd53('0x46')]['id'];}return db[_0xcd53('0x3c')][_0xcd53('0x44')]({'where':{'id':_0x400c59['params']['id']}})['then'](handleEntityNotFound(_0x412b7f,null))[_0xcd53('0x23')](saveUpdates(_0x400c59[_0xcd53('0x46')],null))[_0xcd53('0x23')](respondWithResult(_0x412b7f,null))[_0xcd53('0x40')](handleError(_0x412b7f,null));};exports['destroy']=function(_0x350eee,_0x70b502){return db[_0xcd53('0x3c')][_0xcd53('0x44')]({'where':{'id':_0x350eee[_0xcd53('0x42')]['id']}})[_0xcd53('0x23')](handleEntityNotFound(_0x70b502,null))[_0xcd53('0x23')](removeEntity(_0x70b502,null))[_0xcd53('0x40')](handleError(_0x70b502,null));};exports[_0xcd53('0x47')]=function(_0x114528,_0x4a68a7,_0x1c7238){var _0x7530ee={};var _0x5d40e1={};var _0x4bb525;var _0x550168;return db[_0xcd53('0x3c')][_0xcd53('0x48')]({'where':{'id':_0x114528['params']['id']}})[_0xcd53('0x23')](handleEntityNotFound(_0x4a68a7,null))[_0xcd53('0x23')](function(_0x459a1a){if(_0x459a1a){_0x4bb525=_0x459a1a;_0x5d40e1[_0xcd53('0x2c')]=_['keys'](db[_0xcd53('0x49')][_0xcd53('0x2a')]);_0x5d40e1[_0xcd53('0x2e')]=_['keys'](_0x114528['query']);_0x5d40e1[_0xcd53('0x2f')]=_[_0xcd53('0x30')](_0x5d40e1[_0xcd53('0x2c')],_0x5d40e1[_0xcd53('0x2e')]);_0x7530ee[_0xcd53('0x31')]=_[_0xcd53('0x30')](_0x5d40e1[_0xcd53('0x2c')],qs[_0xcd53('0x32')](_0x114528[_0xcd53('0x2e')][_0xcd53('0x32')]));_0x7530ee[_0xcd53('0x31')]=_0x7530ee[_0xcd53('0x31')]['length']?_0x7530ee['attributes']:_0x5d40e1[_0xcd53('0x2c')];_0x7530ee['order']=qs[_0xcd53('0x35')](_0x114528['query'][_0xcd53('0x35')]);_0x7530ee[_0xcd53('0x36')]=qs[_0xcd53('0x2f')](_[_0xcd53('0x4a')](_0x114528[_0xcd53('0x2e')],_0x5d40e1[_0xcd53('0x2f')]));if(_0x114528[_0xcd53('0x2e')][_0xcd53('0x37')]){_0x7530ee[_0xcd53('0x36')]=_[_0xcd53('0x38')](_0x7530ee[_0xcd53('0x36')],{'$or':_['map'](_0x7530ee[_0xcd53('0x31')],function(_0x4372c9){var _0x145457={};_0x145457[_0x4372c9]={'$like':'%'+_0x114528['query'][_0xcd53('0x37')]+'%'};return _0x145457;})});}_0x7530ee=_['merge']({},_0x7530ee,_0x114528[_0xcd53('0x3b')]);return _0x4bb525[_0xcd53('0x47')](_0x7530ee);}})[_0xcd53('0x23')](function(_0x1ae102){if(_0x1ae102){_0x550168=_0x1ae102['length'];if(!_0x114528['query'][_0xcd53('0x4b')]('nolimit')){_0x7530ee[_0xcd53('0x1d')]=qs[_0xcd53('0x1d')](_0x114528[_0xcd53('0x2e')][_0xcd53('0x1d')]);_0x7530ee[_0xcd53('0x1b')]=qs[_0xcd53('0x1b')](_0x114528[_0xcd53('0x2e')]['offset']);}return _0x4bb525['getFields'](_0x7530ee);}})['then'](function(_0x4e7d78){if(_0x4e7d78){return _0x4e7d78?{'count':_0x550168,'rows':_0x4e7d78}:null;}})[_0xcd53('0x23')](respondWithResult(_0x4a68a7,null))['catch'](handleError(_0x4a68a7,null));};exports[_0xcd53('0x4c')]=function(_0x14742d,_0x410472,_0x84c5a9){var _0x16c82f={};var _0x5506f1={};var _0x5f3d20;var _0x5d911d;return db[_0xcd53('0x3c')][_0xcd53('0x48')]({'where':{'id':_0x14742d[_0xcd53('0x42')]['id']}})[_0xcd53('0x23')](handleEntityNotFound(_0x410472,null))['then'](function(_0x5bd846){if(_0x5bd846){_0x5f3d20=_0x5bd846;_0x5506f1[_0xcd53('0x2c')]=_['keys'](db['ZohoField']['rawAttributes']);_0x5506f1[_0xcd53('0x2e')]=_[_0xcd53('0x2d')](_0x14742d[_0xcd53('0x2e')]);_0x5506f1['filters']=_[_0xcd53('0x30')](_0x5506f1[_0xcd53('0x2c')],_0x5506f1[_0xcd53('0x2e')]);_0x16c82f[_0xcd53('0x31')]=_[_0xcd53('0x30')](_0x5506f1['model'],qs[_0xcd53('0x32')](_0x14742d['query']['fields']));_0x16c82f[_0xcd53('0x31')]=_0x16c82f['attributes'][_0xcd53('0x33')]?_0x16c82f[_0xcd53('0x31')]:_0x5506f1[_0xcd53('0x2c')];_0x16c82f[_0xcd53('0x4d')]=qs[_0xcd53('0x35')](_0x14742d[_0xcd53('0x2e')][_0xcd53('0x35')]);_0x16c82f[_0xcd53('0x36')]=qs[_0xcd53('0x2f')](_[_0xcd53('0x4a')](_0x14742d[_0xcd53('0x2e')],_0x5506f1[_0xcd53('0x2f')]));if(_0x14742d[_0xcd53('0x2e')][_0xcd53('0x37')]){_0x16c82f[_0xcd53('0x36')]=_[_0xcd53('0x38')](_0x16c82f[_0xcd53('0x36')],{'$or':_[_0xcd53('0x29')](_0x16c82f['attributes'],function(_0x13c0e4){var _0x418ddb={};_0x418ddb[_0x13c0e4]={'$like':'%'+_0x14742d[_0xcd53('0x2e')][_0xcd53('0x37')]+'%'};return _0x418ddb;})});}_0x16c82f=_['merge']({},_0x16c82f,_0x14742d[_0xcd53('0x3b')]);return _0x5f3d20[_0xcd53('0x4c')](_0x16c82f);}})[_0xcd53('0x23')](function(_0x2a8c61){if(_0x2a8c61){_0x5d911d=_0x2a8c61[_0xcd53('0x33')];if(!_0x14742d['query'][_0xcd53('0x4b')](_0xcd53('0x34'))){_0x16c82f[_0xcd53('0x1d')]=qs[_0xcd53('0x1d')](_0x14742d[_0xcd53('0x2e')][_0xcd53('0x1d')]);_0x16c82f[_0xcd53('0x1b')]=qs[_0xcd53('0x1b')](_0x14742d[_0xcd53('0x2e')]['offset']);}return _0x5f3d20[_0xcd53('0x4c')](_0x16c82f);}})[_0xcd53('0x23')](function(_0x57222b){if(_0x57222b){return _0x57222b?{'count':_0x5d911d,'rows':_0x57222b}:null;}})[_0xcd53('0x23')](respondWithResult(_0x410472,null))[_0xcd53('0x40')](handleError(_0x410472,null));};exports[_0xcd53('0x4e')]=function(_0x62578f,_0x31d5be,_0x94a320){var _0x9545d1={};var _0x110b2d={};var _0x480ef8;var _0x5a292f;return db[_0xcd53('0x3c')]['findOne']({'where':{'id':_0x62578f[_0xcd53('0x42')]['id']}})[_0xcd53('0x23')](handleEntityNotFound(_0x31d5be,null))[_0xcd53('0x23')](function(_0x20268d){if(_0x20268d){_0x480ef8=_0x20268d;_0x110b2d['model']=_[_0xcd53('0x2d')](db[_0xcd53('0x49')][_0xcd53('0x2a')]);_0x110b2d['query']=_[_0xcd53('0x2d')](_0x62578f['query']);_0x110b2d[_0xcd53('0x2f')]=_['intersection'](_0x110b2d[_0xcd53('0x2c')],_0x110b2d[_0xcd53('0x2e')]);_0x9545d1[_0xcd53('0x31')]=_[_0xcd53('0x30')](_0x110b2d[_0xcd53('0x2c')],qs[_0xcd53('0x32')](_0x62578f[_0xcd53('0x2e')][_0xcd53('0x32')]));_0x9545d1['attributes']=_0x9545d1['attributes'][_0xcd53('0x33')]?_0x9545d1[_0xcd53('0x31')]:_0x110b2d[_0xcd53('0x2c')];_0x9545d1['order']=qs[_0xcd53('0x35')](_0x62578f[_0xcd53('0x2e')][_0xcd53('0x35')]);_0x9545d1[_0xcd53('0x36')]=qs[_0xcd53('0x2f')](_[_0xcd53('0x4a')](_0x62578f[_0xcd53('0x2e')],_0x110b2d[_0xcd53('0x2f')]));if(_0x62578f['query'][_0xcd53('0x37')]){_0x9545d1[_0xcd53('0x36')]=_[_0xcd53('0x38')](_0x9545d1['where'],{'$or':_[_0xcd53('0x29')](_0x9545d1[_0xcd53('0x31')],function(_0x44b747){var _0x3eadb9={};_0x3eadb9[_0x44b747]={'$like':'%'+_0x62578f[_0xcd53('0x2e')]['filter']+'%'};return _0x3eadb9;})});}_0x9545d1=_[_0xcd53('0x38')]({},_0x9545d1,_0x62578f[_0xcd53('0x3b')]);return _0x480ef8[_0xcd53('0x4e')](_0x9545d1);}})[_0xcd53('0x23')](function(_0x5febba){if(_0x5febba){_0x5a292f=_0x5febba[_0xcd53('0x33')];if(!_0x62578f[_0xcd53('0x2e')][_0xcd53('0x4b')](_0xcd53('0x34'))){_0x9545d1[_0xcd53('0x1d')]=qs[_0xcd53('0x1d')](_0x62578f['query'][_0xcd53('0x1d')]);_0x9545d1[_0xcd53('0x1b')]=qs['offset'](_0x62578f['query'][_0xcd53('0x1b')]);}return _0x480ef8[_0xcd53('0x4e')](_0x9545d1);}})[_0xcd53('0x23')](function(_0x372639){if(_0x372639){return _0x372639?{'count':_0x5a292f,'rows':_0x372639}:null;}})[_0xcd53('0x23')](respondWithResult(_0x31d5be,null))[_0xcd53('0x40')](handleError(_0x31d5be,null));}; \ No newline at end of file +var _0x7a2a=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','ZohoConfiguration','rawAttributes','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','create','body','find','params','ZohoField','getFields','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x9e5f7c,_0x5cb3f3){var _0x57a2a5=function(_0x4a4219){while(--_0x4a4219){_0x9e5f7c['push'](_0x9e5f7c['shift']());}};_0x57a2a5(++_0x5cb3f3);}(_0x7a2a,0x125));var _0xa7a2=function(_0x48f62c,_0x1cddb1){_0x48f62c=_0x48f62c-0x0;var _0x503c3b=_0x7a2a[_0x48f62c];return _0x503c3b;};'use strict';var emlformat=require(_0xa7a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa7a2('0x1'));var jsonpatch=require(_0xa7a2('0x2'));var rp=require(_0xa7a2('0x3'));var moment=require(_0xa7a2('0x4'));var BPromise=require(_0xa7a2('0x5'));var Mustache=require(_0xa7a2('0x6'));var util=require(_0xa7a2('0x7'));var path=require(_0xa7a2('0x8'));var sox=require('sox');var csv=require(_0xa7a2('0x9'));var ejs=require(_0xa7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7a2('0xb'));var squel=require('squel');var crypto=require(_0xa7a2('0xc'));var jsforce=require(_0xa7a2('0xd'));var deskjs=require(_0xa7a2('0xe'));var toCsv=require(_0xa7a2('0x9'));var querystring=require(_0xa7a2('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7a2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa7a2('0x11'));var as=require(_0xa7a2('0x12'));var hardwareService=require(_0xa7a2('0x13'));var logger=require('../../config/logger')(_0xa7a2('0x14'));var utils=require(_0xa7a2('0x15'));var config=require(_0xa7a2('0x16'));var licenseUtil=require(_0xa7a2('0x17'));var db=require(_0xa7a2('0x18'))['db'];function respondWithStatusCode(_0x20165b,_0x168ee3){_0x168ee3=_0x168ee3||0xcc;return function(_0xea8899){if(_0xea8899){return _0x20165b[_0xa7a2('0x19')](_0x168ee3);}return _0x20165b['status'](_0x168ee3)[_0xa7a2('0x1a')]();};}function respondWithResult(_0x1af301,_0xb38775){_0xb38775=_0xb38775||0xc8;return function(_0x209ee6){if(_0x209ee6){return _0x1af301[_0xa7a2('0x1b')](_0xb38775)['json'](_0x209ee6);}};}function respondWithFilteredResult(_0x5e686e,_0x59d640){return function(_0x2ddb0d){if(_0x2ddb0d){var _0x3294fb=typeof _0x59d640[_0xa7a2('0x1c')]==='undefined'&&typeof _0x59d640['limit']==='undefined';var _0x322172=_0x2ddb0d['count'];var _0x362fe6=_0x3294fb?0x0:_0x59d640['offset'];var _0x52dc36=_0x3294fb?_0x2ddb0d[_0xa7a2('0x1d')]:_0x59d640[_0xa7a2('0x1c')]+_0x59d640[_0xa7a2('0x1e')];var _0x239a3c;if(_0x52dc36>=_0x322172){_0x52dc36=_0x322172;_0x239a3c=0xc8;}else{_0x239a3c=0xce;}_0x5e686e['status'](_0x239a3c);return _0x5e686e[_0xa7a2('0x1f')](_0xa7a2('0x20'),_0x362fe6+'-'+_0x52dc36+'/'+_0x322172)[_0xa7a2('0x21')](_0x2ddb0d);}return null;};}function patchUpdates(_0xd079ed){return function(_0x112ff){try{jsonpatch[_0xa7a2('0x22')](_0x112ff,_0xd079ed,!![]);}catch(_0x2f34f2){return BPromise[_0xa7a2('0x23')](_0x2f34f2);}return _0x112ff['save']();};}function saveUpdates(_0x1031dc,_0x16692b){return function(_0x458192){if(_0x458192){return _0x458192[_0xa7a2('0x24')](_0x1031dc)[_0xa7a2('0x25')](function(_0x1ab23d){return _0x1ab23d;});}return null;};}function removeEntity(_0x1ced94,_0x314bb8){return function(_0x476f73){if(_0x476f73){return _0x476f73[_0xa7a2('0x26')]()[_0xa7a2('0x25')](function(){_0x1ced94[_0xa7a2('0x1b')](0xcc)[_0xa7a2('0x1a')]();});}};}function handleEntityNotFound(_0x34bb57,_0x12cd67){return function(_0x2a67ad){if(!_0x2a67ad){_0x34bb57[_0xa7a2('0x19')](0x194);}return _0x2a67ad;};}function handleError(_0x46b876,_0x260449){_0x260449=_0x260449||0x1f4;return function(_0x4d2e68){logger[_0xa7a2('0x27')](_0x4d2e68['stack']);if(_0x4d2e68['name']){delete _0x4d2e68[_0xa7a2('0x28')];}_0x46b876[_0xa7a2('0x1b')](_0x260449)[_0xa7a2('0x29')](_0x4d2e68);};}exports[_0xa7a2('0x2a')]=function(_0x12e086,_0x5bb1c1){var _0x13c7a0={},_0x49885b={},_0x1cb852={'count':0x0,'rows':[]};var _0x37473f=_['map'](db[_0xa7a2('0x2b')][_0xa7a2('0x2c')],function(_0x45b142){return{'name':_0x45b142['fieldName'],'type':_0x45b142[_0xa7a2('0x2d')][_0xa7a2('0x2e')]};});_0x49885b[_0xa7a2('0x2f')]=_[_0xa7a2('0x30')](_0x37473f,_0xa7a2('0x28'));_0x49885b['query']=_[_0xa7a2('0x31')](_0x12e086[_0xa7a2('0x32')]);_0x49885b[_0xa7a2('0x33')]=_['intersection'](_0x49885b[_0xa7a2('0x2f')],_0x49885b[_0xa7a2('0x32')]);_0x13c7a0[_0xa7a2('0x34')]=_[_0xa7a2('0x35')](_0x49885b['model'],qs[_0xa7a2('0x36')](_0x12e086[_0xa7a2('0x32')][_0xa7a2('0x36')]));_0x13c7a0[_0xa7a2('0x34')]=_0x13c7a0[_0xa7a2('0x34')][_0xa7a2('0x37')]?_0x13c7a0[_0xa7a2('0x34')]:_0x49885b[_0xa7a2('0x2f')];if(!_0x12e086['query'][_0xa7a2('0x38')](_0xa7a2('0x39'))){_0x13c7a0['limit']=qs['limit'](_0x12e086[_0xa7a2('0x32')]['limit']);_0x13c7a0['offset']=qs[_0xa7a2('0x1c')](_0x12e086[_0xa7a2('0x32')][_0xa7a2('0x1c')]);}_0x13c7a0[_0xa7a2('0x3a')]=qs[_0xa7a2('0x3b')](_0x12e086[_0xa7a2('0x32')][_0xa7a2('0x3b')]);_0x13c7a0['where']=qs[_0xa7a2('0x33')](_[_0xa7a2('0x3c')](_0x12e086[_0xa7a2('0x32')],_0x49885b['filters']),_0x37473f);if(_0x12e086[_0xa7a2('0x32')][_0xa7a2('0x3d')]){_0x13c7a0[_0xa7a2('0x3e')]=_[_0xa7a2('0x3f')](_0x13c7a0[_0xa7a2('0x3e')],{'$or':_[_0xa7a2('0x30')](_0x37473f,function(_0x56ab4e){if(_0x56ab4e[_0xa7a2('0x2d')]!==_0xa7a2('0x40')){var _0xc07a1d={};_0xc07a1d[_0x56ab4e[_0xa7a2('0x28')]]={'$like':'%'+_0x12e086[_0xa7a2('0x32')][_0xa7a2('0x3d')]+'%'};return _0xc07a1d;}})});}_0x13c7a0=_[_0xa7a2('0x3f')]({},_0x13c7a0,_0x12e086[_0xa7a2('0x41')]);var _0x33169f={'where':_0x13c7a0[_0xa7a2('0x3e')]};return db[_0xa7a2('0x2b')][_0xa7a2('0x1d')](_0x33169f)[_0xa7a2('0x25')](function(_0x59d40e){_0x1cb852['count']=_0x59d40e;if(_0x12e086['query']['includeAll']){_0x13c7a0[_0xa7a2('0x42')]=[{'all':!![]}];}return db[_0xa7a2('0x2b')]['findAll'](_0x13c7a0);})[_0xa7a2('0x25')](function(_0x241134){_0x1cb852[_0xa7a2('0x43')]=_0x241134;return _0x1cb852;})[_0xa7a2('0x25')](respondWithFilteredResult(_0x5bb1c1,_0x13c7a0))[_0xa7a2('0x44')](handleError(_0x5bb1c1,null));};exports['show']=function(_0x5a86e9,_0x15e455){var _0x4b541c={'raw':![],'where':{'id':_0x5a86e9['params']['id']}},_0x4aaf88={};_0x4aaf88[_0xa7a2('0x2f')]=_[_0xa7a2('0x31')](db[_0xa7a2('0x2b')][_0xa7a2('0x2c')]);_0x4aaf88[_0xa7a2('0x32')]=_[_0xa7a2('0x31')](_0x5a86e9['query']);_0x4aaf88['filters']=_[_0xa7a2('0x35')](_0x4aaf88['model'],_0x4aaf88[_0xa7a2('0x32')]);_0x4b541c[_0xa7a2('0x34')]=_[_0xa7a2('0x35')](_0x4aaf88[_0xa7a2('0x2f')],qs[_0xa7a2('0x36')](_0x5a86e9['query']['fields']));_0x4b541c['attributes']=_0x4b541c[_0xa7a2('0x34')][_0xa7a2('0x37')]?_0x4b541c['attributes']:_0x4aaf88[_0xa7a2('0x2f')];if(_0x5a86e9[_0xa7a2('0x32')]['includeAll']){_0x4b541c[_0xa7a2('0x42')]=[{'all':!![]}];}_0x4b541c=_['merge']({},_0x4b541c,_0x5a86e9[_0xa7a2('0x41')]);return db[_0xa7a2('0x2b')]['find'](_0x4b541c)[_0xa7a2('0x25')](handleEntityNotFound(_0x15e455,null))[_0xa7a2('0x25')](respondWithResult(_0x15e455,null))[_0xa7a2('0x44')](handleError(_0x15e455,null));};exports[_0xa7a2('0x45')]=function(_0x4899f4,_0x4746a7){return db[_0xa7a2('0x2b')][_0xa7a2('0x45')](_0x4899f4['body'],{})[_0xa7a2('0x25')](respondWithResult(_0x4746a7,0xc9))[_0xa7a2('0x44')](handleError(_0x4746a7,null));};exports[_0xa7a2('0x24')]=function(_0x2f05de,_0x3caf37){if(_0x2f05de[_0xa7a2('0x46')]['id']){delete _0x2f05de[_0xa7a2('0x46')]['id'];}return db[_0xa7a2('0x2b')][_0xa7a2('0x47')]({'where':{'id':_0x2f05de[_0xa7a2('0x48')]['id']}})['then'](handleEntityNotFound(_0x3caf37,null))[_0xa7a2('0x25')](saveUpdates(_0x2f05de['body'],null))[_0xa7a2('0x25')](respondWithResult(_0x3caf37,null))['catch'](handleError(_0x3caf37,null));};exports['destroy']=function(_0x127370,_0x26a253){return db[_0xa7a2('0x2b')]['find']({'where':{'id':_0x127370[_0xa7a2('0x48')]['id']}})[_0xa7a2('0x25')](handleEntityNotFound(_0x26a253,null))[_0xa7a2('0x25')](removeEntity(_0x26a253,null))[_0xa7a2('0x44')](handleError(_0x26a253,null));};exports['getFields']=function(_0x1f2df5,_0x9d84e8,_0x315cbc){var _0x1f18de={};var _0xbfd31b={};var _0x48a327;var _0x4672d6;return db[_0xa7a2('0x2b')]['findOne']({'where':{'id':_0x1f2df5['params']['id']}})[_0xa7a2('0x25')](handleEntityNotFound(_0x9d84e8,null))[_0xa7a2('0x25')](function(_0x2ea293){if(_0x2ea293){_0x48a327=_0x2ea293;_0xbfd31b[_0xa7a2('0x2f')]=_['keys'](db[_0xa7a2('0x49')][_0xa7a2('0x2c')]);_0xbfd31b[_0xa7a2('0x32')]=_[_0xa7a2('0x31')](_0x1f2df5['query']);_0xbfd31b[_0xa7a2('0x33')]=_[_0xa7a2('0x35')](_0xbfd31b[_0xa7a2('0x2f')],_0xbfd31b[_0xa7a2('0x32')]);_0x1f18de['attributes']=_[_0xa7a2('0x35')](_0xbfd31b['model'],qs[_0xa7a2('0x36')](_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x36')]));_0x1f18de[_0xa7a2('0x34')]=_0x1f18de[_0xa7a2('0x34')][_0xa7a2('0x37')]?_0x1f18de[_0xa7a2('0x34')]:_0xbfd31b[_0xa7a2('0x2f')];_0x1f18de[_0xa7a2('0x3a')]=qs[_0xa7a2('0x3b')](_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x3b')]);_0x1f18de[_0xa7a2('0x3e')]=qs[_0xa7a2('0x33')](_['pick'](_0x1f2df5[_0xa7a2('0x32')],_0xbfd31b[_0xa7a2('0x33')]));if(_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x3d')]){_0x1f18de[_0xa7a2('0x3e')]=_[_0xa7a2('0x3f')](_0x1f18de[_0xa7a2('0x3e')],{'$or':_[_0xa7a2('0x30')](_0x1f18de[_0xa7a2('0x34')],function(_0x1c931a){var _0x28a9e1={};_0x28a9e1[_0x1c931a]={'$like':'%'+_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x3d')]+'%'};return _0x28a9e1;})});}_0x1f18de=_[_0xa7a2('0x3f')]({},_0x1f18de,_0x1f2df5[_0xa7a2('0x41')]);return _0x48a327['getFields'](_0x1f18de);}})[_0xa7a2('0x25')](function(_0x1d0964){if(_0x1d0964){_0x4672d6=_0x1d0964['length'];if(!_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x38')]('nolimit')){_0x1f18de[_0xa7a2('0x1e')]=qs[_0xa7a2('0x1e')](_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x1e')]);_0x1f18de['offset']=qs[_0xa7a2('0x1c')](_0x1f2df5[_0xa7a2('0x32')][_0xa7a2('0x1c')]);}return _0x48a327[_0xa7a2('0x4a')](_0x1f18de);}})[_0xa7a2('0x25')](function(_0x500f8c){if(_0x500f8c){return _0x500f8c?{'count':_0x4672d6,'rows':_0x500f8c}:null;}})['then'](respondWithResult(_0x9d84e8,null))[_0xa7a2('0x44')](handleError(_0x9d84e8,null));};exports[_0xa7a2('0x4b')]=function(_0x556659,_0x167d01,_0x2c56d0){var _0x2a51a9={};var _0x2beeb6={};var _0x3c4c27;var _0x3a588a;return db[_0xa7a2('0x2b')][_0xa7a2('0x4c')]({'where':{'id':_0x556659['params']['id']}})[_0xa7a2('0x25')](handleEntityNotFound(_0x167d01,null))[_0xa7a2('0x25')](function(_0x4d930d){if(_0x4d930d){_0x3c4c27=_0x4d930d;_0x2beeb6[_0xa7a2('0x2f')]=_[_0xa7a2('0x31')](db[_0xa7a2('0x49')][_0xa7a2('0x2c')]);_0x2beeb6['query']=_[_0xa7a2('0x31')](_0x556659[_0xa7a2('0x32')]);_0x2beeb6[_0xa7a2('0x33')]=_[_0xa7a2('0x35')](_0x2beeb6[_0xa7a2('0x2f')],_0x2beeb6[_0xa7a2('0x32')]);_0x2a51a9[_0xa7a2('0x34')]=_[_0xa7a2('0x35')](_0x2beeb6['model'],qs['fields'](_0x556659['query'][_0xa7a2('0x36')]));_0x2a51a9[_0xa7a2('0x34')]=_0x2a51a9[_0xa7a2('0x34')][_0xa7a2('0x37')]?_0x2a51a9[_0xa7a2('0x34')]:_0x2beeb6[_0xa7a2('0x2f')];_0x2a51a9[_0xa7a2('0x3a')]=qs[_0xa7a2('0x3b')](_0x556659['query']['sort']);_0x2a51a9[_0xa7a2('0x3e')]=qs[_0xa7a2('0x33')](_[_0xa7a2('0x3c')](_0x556659[_0xa7a2('0x32')],_0x2beeb6[_0xa7a2('0x33')]));if(_0x556659['query'][_0xa7a2('0x3d')]){_0x2a51a9['where']=_[_0xa7a2('0x3f')](_0x2a51a9['where'],{'$or':_[_0xa7a2('0x30')](_0x2a51a9[_0xa7a2('0x34')],function(_0x563cc0){var _0x46ce5e={};_0x46ce5e[_0x563cc0]={'$like':'%'+_0x556659[_0xa7a2('0x32')]['filter']+'%'};return _0x46ce5e;})});}_0x2a51a9=_['merge']({},_0x2a51a9,_0x556659[_0xa7a2('0x41')]);return _0x3c4c27['getSubjects'](_0x2a51a9);}})[_0xa7a2('0x25')](function(_0x4ff0b2){if(_0x4ff0b2){_0x3a588a=_0x4ff0b2[_0xa7a2('0x37')];if(!_0x556659['query'][_0xa7a2('0x38')](_0xa7a2('0x39'))){_0x2a51a9[_0xa7a2('0x1e')]=qs[_0xa7a2('0x1e')](_0x556659[_0xa7a2('0x32')][_0xa7a2('0x1e')]);_0x2a51a9['offset']=qs[_0xa7a2('0x1c')](_0x556659[_0xa7a2('0x32')]['offset']);}return _0x3c4c27[_0xa7a2('0x4b')](_0x2a51a9);}})[_0xa7a2('0x25')](function(_0x264f3b){if(_0x264f3b){return _0x264f3b?{'count':_0x3a588a,'rows':_0x264f3b}:null;}})[_0xa7a2('0x25')](respondWithResult(_0x167d01,null))['catch'](handleError(_0x167d01,null));};exports[_0xa7a2('0x4d')]=function(_0x1dbcd5,_0x8003a7,_0x153ccd){var _0x2a7dd7={};var _0x5c702f={};var _0x106c2d;var _0x386d4e;return db[_0xa7a2('0x2b')][_0xa7a2('0x4c')]({'where':{'id':_0x1dbcd5['params']['id']}})['then'](handleEntityNotFound(_0x8003a7,null))['then'](function(_0x1bbcc9){if(_0x1bbcc9){_0x106c2d=_0x1bbcc9;_0x5c702f[_0xa7a2('0x2f')]=_[_0xa7a2('0x31')](db[_0xa7a2('0x49')][_0xa7a2('0x2c')]);_0x5c702f[_0xa7a2('0x32')]=_['keys'](_0x1dbcd5['query']);_0x5c702f['filters']=_[_0xa7a2('0x35')](_0x5c702f['model'],_0x5c702f['query']);_0x2a7dd7[_0xa7a2('0x34')]=_[_0xa7a2('0x35')](_0x5c702f[_0xa7a2('0x2f')],qs[_0xa7a2('0x36')](_0x1dbcd5[_0xa7a2('0x32')][_0xa7a2('0x36')]));_0x2a7dd7[_0xa7a2('0x34')]=_0x2a7dd7[_0xa7a2('0x34')][_0xa7a2('0x37')]?_0x2a7dd7[_0xa7a2('0x34')]:_0x5c702f[_0xa7a2('0x2f')];_0x2a7dd7[_0xa7a2('0x3a')]=qs[_0xa7a2('0x3b')](_0x1dbcd5[_0xa7a2('0x32')]['sort']);_0x2a7dd7[_0xa7a2('0x3e')]=qs[_0xa7a2('0x33')](_[_0xa7a2('0x3c')](_0x1dbcd5[_0xa7a2('0x32')],_0x5c702f[_0xa7a2('0x33')]));if(_0x1dbcd5[_0xa7a2('0x32')][_0xa7a2('0x3d')]){_0x2a7dd7[_0xa7a2('0x3e')]=_[_0xa7a2('0x3f')](_0x2a7dd7[_0xa7a2('0x3e')],{'$or':_[_0xa7a2('0x30')](_0x2a7dd7['attributes'],function(_0x11ce6d){var _0x38a07f={};_0x38a07f[_0x11ce6d]={'$like':'%'+_0x1dbcd5['query'][_0xa7a2('0x3d')]+'%'};return _0x38a07f;})});}_0x2a7dd7=_[_0xa7a2('0x3f')]({},_0x2a7dd7,_0x1dbcd5[_0xa7a2('0x41')]);return _0x106c2d[_0xa7a2('0x4d')](_0x2a7dd7);}})['then'](function(_0x1d2b63){if(_0x1d2b63){_0x386d4e=_0x1d2b63[_0xa7a2('0x37')];if(!_0x1dbcd5['query'][_0xa7a2('0x38')](_0xa7a2('0x39'))){_0x2a7dd7[_0xa7a2('0x1e')]=qs['limit'](_0x1dbcd5[_0xa7a2('0x32')]['limit']);_0x2a7dd7[_0xa7a2('0x1c')]=qs['offset'](_0x1dbcd5['query'][_0xa7a2('0x1c')]);}return _0x106c2d[_0xa7a2('0x4d')](_0x2a7dd7);}})[_0xa7a2('0x25')](function(_0x24c02e){if(_0x24c02e){return _0x24c02e?{'count':_0x386d4e,'rows':_0x24c02e}:null;}})[_0xa7a2('0x25')](respondWithResult(_0x8003a7,null))[_0xa7a2('0x44')](handleError(_0x8003a7,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 55084e0..75ddd45 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 _0x7819=['../../config/environment','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x3bbe3b,_0x45454f){var _0x4f2564=function(_0xb032fc){while(--_0xb032fc){_0x3bbe3b['push'](_0x3bbe3b['shift']());}};_0x4f2564(++_0x45454f);}(_0x7819,0x10c));var _0x9781=function(_0x178c3d,_0x32e94a){_0x178c3d=_0x178c3d-0x0;var _0x105b44=_0x7819[_0x178c3d];return _0x105b44;};'use strict';var _=require(_0x9781('0x0'));var util=require(_0x9781('0x1'));var logger=require('../../config/logger')(_0x9781('0x2'));var moment=require(_0x9781('0x3'));var BPromise=require('bluebird');var rp=require(_0x9781('0x4'));var fs=require('fs');var path=require(_0x9781('0x5'));var rimraf=require(_0x9781('0x6'));var config=require(_0x9781('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x20df49,_0x12690b){return _0x20df49[_0x9781('0x8')](_0x9781('0x9'),attributes,{'tableName':_0x9781('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98bc=['ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x24fef8,_0x470e9b){var _0x517938=function(_0x92f678){while(--_0x92f678){_0x24fef8['push'](_0x24fef8['shift']());}};_0x517938(++_0x470e9b);}(_0x98bc,0xd9));var _0xc98b=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x98bc[_0x179b53];return _0x38a146;};'use strict';var _=require(_0xc98b('0x0'));var util=require(_0xc98b('0x1'));var logger=require(_0xc98b('0x2'))(_0xc98b('0x3'));var moment=require(_0xc98b('0x4'));var BPromise=require(_0xc98b('0x5'));var rp=require(_0xc98b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc98b('0x7'));var attributes=require(_0xc98b('0x8'));module[_0xc98b('0x9')]=function(_0x497ee7,_0x164b5b){return _0x497ee7[_0xc98b('0xa')](_0xc98b('0xb'),attributes,{'tableName':'int_zoho_configurations','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 c9be818..5a18b07 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 _0x0e1a=['../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x0e1a,0x1c7));var _0xa0e1=function(_0x1e9862,_0x1a184e){_0x1e9862=_0x1e9862-0x0;var _0x5ab95e=_0x0e1a[_0x1e9862];return _0x5ab95e;};'use strict';var _=require(_0xa0e1('0x0'));var util=require(_0xa0e1('0x1'));var moment=require(_0xa0e1('0x2'));var BPromise=require(_0xa0e1('0x3'));var rs=require(_0xa0e1('0x4'));var fs=require('fs');var Redis=require(_0xa0e1('0x5'));var db=require(_0xa0e1('0x6'))['db'];var utils=require(_0xa0e1('0x7'));var logger=require('../../config/logger')(_0xa0e1('0x8'));var config=require('../../config/environment');var jayson=require(_0xa0e1('0x9'));var client=jayson['client'][_0xa0e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2728ce,_0x3d77d9,_0x514c65){return new BPromise(function(_0x4cffd4,_0x1af29b){return client[_0xa0e1('0xb')](_0x2728ce,_0x514c65)['then'](function(_0x274aae){logger[_0xa0e1('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3d77d9,_0xa0e1('0xd'));logger[_0xa0e1('0xe')](_0xa0e1('0xf'),_0x3d77d9,'request\x20sent',JSON[_0xa0e1('0x10')](_0x274aae));if(_0x274aae[_0xa0e1('0x11')]){if(_0x274aae[_0xa0e1('0x11')][_0xa0e1('0x12')]===0x1f4){logger[_0xa0e1('0x11')](_0xa0e1('0x13'),_0x3d77d9,_0x274aae['error'][_0xa0e1('0x14')]);return _0x1af29b(_0x274aae[_0xa0e1('0x11')][_0xa0e1('0x14')]);}logger[_0xa0e1('0x11')](_0xa0e1('0x13'),_0x3d77d9,_0x274aae[_0xa0e1('0x11')]['message']);return _0x4cffd4(_0x274aae[_0xa0e1('0x11')][_0xa0e1('0x14')]);}else{logger[_0xa0e1('0xc')](_0xa0e1('0x13'),_0x3d77d9,_0xa0e1('0xd'));_0x4cffd4(_0x274aae[_0xa0e1('0x15')][_0xa0e1('0x14')]);}})['catch'](function(_0x43ac56){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3d77d9,_0x43ac56);_0x1af29b(_0x43ac56);});});} \ No newline at end of file +var _0xea1d=['then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x65ead5,_0x5051a2){var _0x5dca2e=function(_0x3ab8c4){while(--_0x3ab8c4){_0x65ead5['push'](_0x65ead5['shift']());}};_0x5dca2e(++_0x5051a2);}(_0xea1d,0x14d));var _0xdea1=function(_0x406dcc,_0x5b8697){_0x406dcc=_0x406dcc-0x0;var _0x3567b1=_0xea1d[_0x406dcc];return _0x3567b1;};'use strict';var _=require(_0xdea1('0x0'));var util=require(_0xdea1('0x1'));var moment=require(_0xdea1('0x2'));var BPromise=require(_0xdea1('0x3'));var rs=require(_0xdea1('0x4'));var fs=require('fs');var Redis=require(_0xdea1('0x5'));var db=require(_0xdea1('0x6'))['db'];var utils=require(_0xdea1('0x7'));var logger=require(_0xdea1('0x8'))(_0xdea1('0x9'));var config=require(_0xdea1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xdea1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48fdde,_0x49957b,_0x188cd3){return new BPromise(function(_0x22a352,_0x1eb7ce){return client['request'](_0x48fdde,_0x188cd3)[_0xdea1('0xc')](function(_0x5f59a4){logger[_0xdea1('0xd')](_0xdea1('0xe'),_0x49957b,_0xdea1('0xf'));logger[_0xdea1('0x10')](_0xdea1('0x11'),_0x49957b,'request\x20sent',JSON[_0xdea1('0x12')](_0x5f59a4));if(_0x5f59a4[_0xdea1('0x13')]){if(_0x5f59a4[_0xdea1('0x13')]['code']===0x1f4){logger[_0xdea1('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x49957b,_0x5f59a4[_0xdea1('0x13')][_0xdea1('0x14')]);return _0x1eb7ce(_0x5f59a4['error']['message']);}logger[_0xdea1('0x13')](_0xdea1('0xe'),_0x49957b,_0x5f59a4[_0xdea1('0x13')][_0xdea1('0x14')]);return _0x22a352(_0x5f59a4[_0xdea1('0x13')]['message']);}else{logger[_0xdea1('0xd')](_0xdea1('0xe'),_0x49957b,'request\x20sent');_0x22a352(_0x5f59a4[_0xdea1('0x15')][_0xdea1('0x14')]);}})[_0xdea1('0x16')](function(_0x2041fa){logger['error'](_0xdea1('0xe'),_0x49957b,_0x2041fa);_0x1eb7ce(_0x2041fa);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0108bcd..f79b8d4 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 _0x1afb=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','post','create','update','delete'];(function(_0x452d35,_0x55ae82){var _0x14c71b=function(_0x56e209){while(--_0x56e209){_0x452d35['push'](_0x452d35['shift']());}};_0x14c71b(++_0x55ae82);}(_0x1afb,0x1e0));var _0xb1af=function(_0x549e0d,_0x23c01c){_0x549e0d=_0x549e0d-0x0;var _0x3c29cf=_0x1afb[_0x549e0d];return _0x3c29cf;};'use strict';var multer=require(_0xb1af('0x0'));var util=require(_0xb1af('0x1'));var path=require(_0xb1af('0x2'));var timeout=require(_0xb1af('0x3'));var express=require(_0xb1af('0x4'));var router=express[_0xb1af('0x5')]();var fs_extra=require(_0xb1af('0x6'));var auth=require(_0xb1af('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb1af('0x8'));var controller=require('./intZohoField.controller');router[_0xb1af('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb1af('0x9')](_0xb1af('0xa'),auth[_0xb1af('0xb')](),controller['show']);router[_0xb1af('0xc')]('/',auth[_0xb1af('0xb')](),controller[_0xb1af('0xd')]);router['put'](_0xb1af('0xa'),auth[_0xb1af('0xb')](),controller[_0xb1af('0xe')]);router[_0xb1af('0xf')](_0xb1af('0xa'),auth[_0xb1af('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x873d=['/:id','show','create','put','isAuthenticated','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index'];(function(_0x3d3601,_0x41c712){var _0x39be09=function(_0x544268){while(--_0x544268){_0x3d3601['push'](_0x3d3601['shift']());}};_0x39be09(++_0x41c712);}(_0x873d,0x1e4));var _0xd873=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x873d[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0xd873('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd873('0x1'));var express=require(_0xd873('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd873('0x3'));var interaction=require(_0xd873('0x4'));var config=require(_0xd873('0x5'));var controller=require(_0xd873('0x6'));router[_0xd873('0x7')]('/',auth['isAuthenticated'](),controller[_0xd873('0x8')]);router[_0xd873('0x7')](_0xd873('0x9'),auth['isAuthenticated'](),controller[_0xd873('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd873('0xb')]);router[_0xd873('0xc')](_0xd873('0x9'),auth[_0xd873('0xd')](),controller[_0xd873('0xe')]);router[_0xd873('0xf')]('/:id',auth[_0xd873('0xd')](),controller[_0xd873('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1327d0b..95da810 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 _0xe186=['STRING','BOOLEAN','sequelize','variable','customVariable','keyValue','picklist','string','ENUM'];(function(_0x3488cd,_0x4c1399){var _0x5cfa0c=function(_0x27d142){while(--_0x27d142){_0x3488cd['push'](_0x3488cd['shift']());}};_0x5cfa0c(++_0x4c1399);}(_0xe186,0x107));var _0x6e18=function(_0x87a977,_0x3a2d1e){_0x87a977=_0x87a977-0x0;var _0xa806eb=_0xe186[_0x87a977];return _0xa806eb;};'use strict';var Sequelize=require(_0x6e18('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x6e18('0x1'),_0x6e18('0x2'),_0x6e18('0x3'),_0x6e18('0x4')),'defaultValue':_0x6e18('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6e18('0x6')](_0x6e18('0x5'),_0x6e18('0x1'),_0x6e18('0x2'))},'keyContent':{'type':Sequelize[_0x6e18('0x7')]},'idField':{'type':Sequelize[_0x6e18('0x7')]},'nameField':{'type':Sequelize[_0x6e18('0x7')]},'customField':{'type':Sequelize[_0x6e18('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb059=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0xd5e472,_0x550823){var _0x50f49e=function(_0x55f5a6){while(--_0x55f5a6){_0xd5e472['push'](_0xd5e472['shift']());}};_0x50f49e(++_0x550823);}(_0xb059,0x195));var _0x9b05=function(_0x21e2e9,_0x44344f){_0x21e2e9=_0x21e2e9-0x0;var _0x18be69=_0xb059[_0x21e2e9];return _0x18be69;};'use strict';var Sequelize=require(_0x9b05('0x0'));module[_0x9b05('0x1')]={'type':{'type':Sequelize[_0x9b05('0x2')](_0x9b05('0x3'),_0x9b05('0x4'),_0x9b05('0x5'),'keyValue',_0x9b05('0x6')),'defaultValue':_0x9b05('0x3')},'content':{'type':Sequelize[_0x9b05('0x7')]},'key':{'type':Sequelize[_0x9b05('0x7')]},'keyType':{'type':Sequelize[_0x9b05('0x2')](_0x9b05('0x3'),'variable',_0x9b05('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9b05('0x7')]},'customField':{'type':Sequelize[_0x9b05('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b05('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 1e21f93..9a71379 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 _0xee08=['then','error','stack','name','send','index','map','ZohoField','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xee08,0x185));var _0x8ee0=function(_0x5b3e31,_0xf7fc56){_0x5b3e31=_0x5b3e31-0x0;var _0x40b0b6=_0xee08[_0x5b3e31];return _0x40b0b6;};'use strict';var emlformat=require(_0x8ee0('0x0'));var rimraf=require(_0x8ee0('0x1'));var zipdir=require(_0x8ee0('0x2'));var jsonpatch=require(_0x8ee0('0x3'));var rp=require(_0x8ee0('0x4'));var moment=require('moment');var BPromise=require(_0x8ee0('0x5'));var Mustache=require(_0x8ee0('0x6'));var util=require(_0x8ee0('0x7'));var path=require(_0x8ee0('0x8'));var sox=require(_0x8ee0('0x9'));var csv=require('to-csv');var ejs=require(_0x8ee0('0xa'));var fs=require('fs');var fs_extra=require(_0x8ee0('0xb'));var _=require(_0x8ee0('0xc'));var squel=require(_0x8ee0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ee0('0xe'));var Papa=require(_0x8ee0('0xf'));var Redis=require(_0x8ee0('0x10'));var authService=require(_0x8ee0('0x11'));var qs=require(_0x8ee0('0x12'));var as=require(_0x8ee0('0x13'));var hardwareService=require(_0x8ee0('0x14'));var logger=require(_0x8ee0('0x15'))(_0x8ee0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ee0('0x17'))['db'];function respondWithStatusCode(_0x5dce7e,_0xb26cfa){_0xb26cfa=_0xb26cfa||0xcc;return function(_0x438d7c){if(_0x438d7c){return _0x5dce7e[_0x8ee0('0x18')](_0xb26cfa);}return _0x5dce7e[_0x8ee0('0x19')](_0xb26cfa)[_0x8ee0('0x1a')]();};}function respondWithResult(_0x31afc5,_0x5bce0e){_0x5bce0e=_0x5bce0e||0xc8;return function(_0x3d9d5d){if(_0x3d9d5d){return _0x31afc5[_0x8ee0('0x19')](_0x5bce0e)['json'](_0x3d9d5d);}};}function respondWithFilteredResult(_0x3ba5c9,_0x27bc31){return function(_0xfa13c8){if(_0xfa13c8){var _0x669e45=typeof _0x27bc31[_0x8ee0('0x1b')]==='undefined'&&typeof _0x27bc31[_0x8ee0('0x1c')]===_0x8ee0('0x1d');var _0x46ee41=_0xfa13c8[_0x8ee0('0x1e')];var _0x2af438=_0x669e45?0x0:_0x27bc31[_0x8ee0('0x1b')];var _0x213e92=_0x669e45?_0xfa13c8[_0x8ee0('0x1e')]:_0x27bc31[_0x8ee0('0x1b')]+_0x27bc31[_0x8ee0('0x1c')];var _0x5e139d;if(_0x213e92>=_0x46ee41){_0x213e92=_0x46ee41;_0x5e139d=0xc8;}else{_0x5e139d=0xce;}_0x3ba5c9[_0x8ee0('0x19')](_0x5e139d);return _0x3ba5c9[_0x8ee0('0x1f')](_0x8ee0('0x20'),_0x2af438+'-'+_0x213e92+'/'+_0x46ee41)['json'](_0xfa13c8);}return null;};}function patchUpdates(_0x46e21a){return function(_0x2e77a0){try{jsonpatch[_0x8ee0('0x21')](_0x2e77a0,_0x46e21a,!![]);}catch(_0x3f4560){return BPromise[_0x8ee0('0x22')](_0x3f4560);}return _0x2e77a0[_0x8ee0('0x23')]();};}function saveUpdates(_0x5bdabb,_0x212c84){return function(_0x18340e){if(_0x18340e){return _0x18340e[_0x8ee0('0x24')](_0x5bdabb)[_0x8ee0('0x25')](function(_0x4ece4f){return _0x4ece4f;});}return null;};}function removeEntity(_0x4e5644,_0x4ac234){return function(_0x382513){if(_0x382513){return _0x382513['destroy']()['then'](function(){_0x4e5644[_0x8ee0('0x19')](0xcc)[_0x8ee0('0x1a')]();});}};}function handleEntityNotFound(_0x3de0fb,_0x3570b2){return function(_0x3a2926){if(!_0x3a2926){_0x3de0fb['sendStatus'](0x194);}return _0x3a2926;};}function handleError(_0x1bec7a,_0x5b8d5b){_0x5b8d5b=_0x5b8d5b||0x1f4;return function(_0x62875a){logger[_0x8ee0('0x26')](_0x62875a[_0x8ee0('0x27')]);if(_0x62875a['name']){delete _0x62875a[_0x8ee0('0x28')];}_0x1bec7a['status'](_0x5b8d5b)[_0x8ee0('0x29')](_0x62875a);};}exports[_0x8ee0('0x2a')]=function(_0x4d8021,_0x3db629){var _0x34ae92={},_0x34b714={},_0x34b02c={'count':0x0,'rows':[]};var _0x538bd7=_[_0x8ee0('0x2b')](db[_0x8ee0('0x2c')]['rawAttributes'],function(_0x5e6111){return{'name':_0x5e6111['fieldName'],'type':_0x5e6111[_0x8ee0('0x2d')]['key']};});_0x34b714[_0x8ee0('0x2e')]=_[_0x8ee0('0x2b')](_0x538bd7,_0x8ee0('0x28'));_0x34b714[_0x8ee0('0x2f')]=_[_0x8ee0('0x30')](_0x4d8021[_0x8ee0('0x2f')]);_0x34b714[_0x8ee0('0x31')]=_['intersection'](_0x34b714[_0x8ee0('0x2e')],_0x34b714[_0x8ee0('0x2f')]);_0x34ae92[_0x8ee0('0x32')]=_[_0x8ee0('0x33')](_0x34b714['model'],qs['fields'](_0x4d8021[_0x8ee0('0x2f')][_0x8ee0('0x34')]));_0x34ae92[_0x8ee0('0x32')]=_0x34ae92[_0x8ee0('0x32')][_0x8ee0('0x35')]?_0x34ae92[_0x8ee0('0x32')]:_0x34b714[_0x8ee0('0x2e')];if(!_0x4d8021[_0x8ee0('0x2f')][_0x8ee0('0x36')]('nolimit')){_0x34ae92[_0x8ee0('0x1c')]=qs['limit'](_0x4d8021[_0x8ee0('0x2f')][_0x8ee0('0x1c')]);_0x34ae92[_0x8ee0('0x1b')]=qs[_0x8ee0('0x1b')](_0x4d8021['query'][_0x8ee0('0x1b')]);}_0x34ae92['order']=qs[_0x8ee0('0x37')](_0x4d8021['query'][_0x8ee0('0x37')]);_0x34ae92[_0x8ee0('0x38')]=qs[_0x8ee0('0x31')](_['pick'](_0x4d8021[_0x8ee0('0x2f')],_0x34b714[_0x8ee0('0x31')]),_0x538bd7);if(_0x4d8021[_0x8ee0('0x2f')][_0x8ee0('0x39')]){_0x34ae92[_0x8ee0('0x38')]=_[_0x8ee0('0x3a')](_0x34ae92[_0x8ee0('0x38')],{'$or':_['map'](_0x538bd7,function(_0x29701f){if(_0x29701f['type']!==_0x8ee0('0x3b')){var _0x14439b={};_0x14439b[_0x29701f['name']]={'$like':'%'+_0x4d8021[_0x8ee0('0x2f')]['filter']+'%'};return _0x14439b;}})});}_0x34ae92=_['merge']({},_0x34ae92,_0x4d8021[_0x8ee0('0x3c')]);var _0x63323d={'where':_0x34ae92[_0x8ee0('0x38')]};return db[_0x8ee0('0x2c')][_0x8ee0('0x1e')](_0x63323d)['then'](function(_0x4c153c){_0x34b02c[_0x8ee0('0x1e')]=_0x4c153c;if(_0x4d8021['query'][_0x8ee0('0x3d')]){_0x34ae92[_0x8ee0('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x8ee0('0x3f')](_0x34ae92);})[_0x8ee0('0x25')](function(_0x5bb2c2){_0x34b02c[_0x8ee0('0x40')]=_0x5bb2c2;return _0x34b02c;})['then'](respondWithFilteredResult(_0x3db629,_0x34ae92))['catch'](handleError(_0x3db629,null));};exports[_0x8ee0('0x41')]=function(_0x973e6a,_0x4dd4e5){var _0x351341={'raw':!![],'where':{'id':_0x973e6a['params']['id']}},_0x1280ed={};_0x1280ed[_0x8ee0('0x2e')]=_[_0x8ee0('0x30')](db[_0x8ee0('0x2c')]['rawAttributes']);_0x1280ed['query']=_['keys'](_0x973e6a[_0x8ee0('0x2f')]);_0x1280ed['filters']=_['intersection'](_0x1280ed[_0x8ee0('0x2e')],_0x1280ed['query']);_0x351341[_0x8ee0('0x32')]=_[_0x8ee0('0x33')](_0x1280ed[_0x8ee0('0x2e')],qs[_0x8ee0('0x34')](_0x973e6a[_0x8ee0('0x2f')][_0x8ee0('0x34')]));_0x351341[_0x8ee0('0x32')]=_0x351341[_0x8ee0('0x32')][_0x8ee0('0x35')]?_0x351341['attributes']:_0x1280ed[_0x8ee0('0x2e')];if(_0x973e6a['query'][_0x8ee0('0x3d')]){_0x351341[_0x8ee0('0x3e')]=[{'all':!![]}];}_0x351341=_[_0x8ee0('0x3a')]({},_0x351341,_0x973e6a[_0x8ee0('0x3c')]);return db[_0x8ee0('0x2c')][_0x8ee0('0x42')](_0x351341)['then'](handleEntityNotFound(_0x4dd4e5,null))['then'](respondWithResult(_0x4dd4e5,null))[_0x8ee0('0x43')](handleError(_0x4dd4e5,null));};exports[_0x8ee0('0x44')]=function(_0x2e0d61,_0x54e509){return db[_0x8ee0('0x2c')][_0x8ee0('0x44')](_0x2e0d61[_0x8ee0('0x45')],{})[_0x8ee0('0x25')](respondWithResult(_0x54e509,0xc9))[_0x8ee0('0x43')](handleError(_0x54e509,null));};exports[_0x8ee0('0x24')]=function(_0x23efcb,_0x3b562e){if(_0x23efcb[_0x8ee0('0x45')]['id']){delete _0x23efcb[_0x8ee0('0x45')]['id'];}return db[_0x8ee0('0x2c')][_0x8ee0('0x42')]({'where':{'id':_0x23efcb['params']['id']}})[_0x8ee0('0x25')](handleEntityNotFound(_0x3b562e,null))[_0x8ee0('0x25')](saveUpdates(_0x23efcb['body'],null))[_0x8ee0('0x25')](respondWithResult(_0x3b562e,null))[_0x8ee0('0x43')](handleError(_0x3b562e,null));};exports[_0x8ee0('0x46')]=function(_0x565a62,_0x4aa5fa){return db['ZohoField'][_0x8ee0('0x42')]({'where':{'id':_0x565a62['params']['id']}})['then'](handleEntityNotFound(_0x4aa5fa,null))['then'](removeEntity(_0x4aa5fa,null))[_0x8ee0('0x43')](handleError(_0x4aa5fa,null));}; \ No newline at end of file +var _0xfccf=['index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','ZohoField','includeAll','include','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send'];(function(_0x2dc44d,_0x79148d){var _0x33a1e6=function(_0x4fab8d){while(--_0x4fab8d){_0x2dc44d['push'](_0x2dc44d['shift']());}};_0x33a1e6(++_0x79148d);}(_0xfccf,0x192));var _0xffcc=function(_0x5a9e9,_0x4a40ac){_0x5a9e9=_0x5a9e9-0x0;var _0x4a80de=_0xfccf[_0x5a9e9];return _0x4a80de;};'use strict';var emlformat=require(_0xffcc('0x0'));var rimraf=require(_0xffcc('0x1'));var zipdir=require(_0xffcc('0x2'));var jsonpatch=require(_0xffcc('0x3'));var rp=require('request-promise');var moment=require(_0xffcc('0x4'));var BPromise=require(_0xffcc('0x5'));var Mustache=require('mustache');var util=require(_0xffcc('0x6'));var path=require('path');var sox=require(_0xffcc('0x7'));var csv=require(_0xffcc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffcc('0x9'));var squel=require('squel');var crypto=require(_0xffcc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xffcc('0xb'));var toCsv=require(_0xffcc('0x8'));var querystring=require(_0xffcc('0xc'));var Papa=require(_0xffcc('0xd'));var Redis=require(_0xffcc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xffcc('0xf'));var as=require(_0xffcc('0x10'));var hardwareService=require(_0xffcc('0x11'));var logger=require(_0xffcc('0x12'))('api');var utils=require(_0xffcc('0x13'));var config=require(_0xffcc('0x14'));var licenseUtil=require(_0xffcc('0x15'));var db=require(_0xffcc('0x16'))['db'];function respondWithStatusCode(_0x258be7,_0xf56ce0){_0xf56ce0=_0xf56ce0||0xcc;return function(_0xc846a9){if(_0xc846a9){return _0x258be7['sendStatus'](_0xf56ce0);}return _0x258be7[_0xffcc('0x17')](_0xf56ce0)[_0xffcc('0x18')]();};}function respondWithResult(_0x5a73e1,_0x41f267){_0x41f267=_0x41f267||0xc8;return function(_0x4c345b){if(_0x4c345b){return _0x5a73e1[_0xffcc('0x17')](_0x41f267)[_0xffcc('0x19')](_0x4c345b);}};}function respondWithFilteredResult(_0x5de898,_0xb097c8){return function(_0x53b092){if(_0x53b092){var _0x3ac866=typeof _0xb097c8[_0xffcc('0x1a')]===_0xffcc('0x1b')&&typeof _0xb097c8[_0xffcc('0x1c')]===_0xffcc('0x1b');var _0x4f1922=_0x53b092[_0xffcc('0x1d')];var _0x53ced7=_0x3ac866?0x0:_0xb097c8[_0xffcc('0x1a')];var _0x1c8c0b=_0x3ac866?_0x53b092[_0xffcc('0x1d')]:_0xb097c8[_0xffcc('0x1a')]+_0xb097c8[_0xffcc('0x1c')];var _0x8b22f;if(_0x1c8c0b>=_0x4f1922){_0x1c8c0b=_0x4f1922;_0x8b22f=0xc8;}else{_0x8b22f=0xce;}_0x5de898['status'](_0x8b22f);return _0x5de898[_0xffcc('0x1e')](_0xffcc('0x1f'),_0x53ced7+'-'+_0x1c8c0b+'/'+_0x4f1922)[_0xffcc('0x19')](_0x53b092);}return null;};}function patchUpdates(_0x4f40cd){return function(_0x231f62){try{jsonpatch[_0xffcc('0x20')](_0x231f62,_0x4f40cd,!![]);}catch(_0x40d08c){return BPromise[_0xffcc('0x21')](_0x40d08c);}return _0x231f62[_0xffcc('0x22')]();};}function saveUpdates(_0x30e0bb,_0x4ca07e){return function(_0x272745){if(_0x272745){return _0x272745[_0xffcc('0x23')](_0x30e0bb)['then'](function(_0x3fecae){return _0x3fecae;});}return null;};}function removeEntity(_0x1fed02,_0x41b708){return function(_0x2230fb){if(_0x2230fb){return _0x2230fb['destroy']()[_0xffcc('0x24')](function(){_0x1fed02[_0xffcc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3976c1,_0x18053d){return function(_0x115c79){if(!_0x115c79){_0x3976c1[_0xffcc('0x25')](0x194);}return _0x115c79;};}function handleError(_0x4def46,_0x520072){_0x520072=_0x520072||0x1f4;return function(_0x1f3fcf){logger[_0xffcc('0x26')](_0x1f3fcf[_0xffcc('0x27')]);if(_0x1f3fcf[_0xffcc('0x28')]){delete _0x1f3fcf[_0xffcc('0x28')];}_0x4def46[_0xffcc('0x17')](_0x520072)[_0xffcc('0x29')](_0x1f3fcf);};}exports[_0xffcc('0x2a')]=function(_0xb02abc,_0x1b2832){var _0x560534={},_0x36c529={},_0x44e871={'count':0x0,'rows':[]};var _0x143da0=_[_0xffcc('0x2b')](db['ZohoField'][_0xffcc('0x2c')],function(_0x4157f5){return{'name':_0x4157f5[_0xffcc('0x2d')],'type':_0x4157f5[_0xffcc('0x2e')][_0xffcc('0x2f')]};});_0x36c529['model']=_[_0xffcc('0x2b')](_0x143da0,_0xffcc('0x28'));_0x36c529[_0xffcc('0x30')]=_['keys'](_0xb02abc[_0xffcc('0x30')]);_0x36c529['filters']=_[_0xffcc('0x31')](_0x36c529[_0xffcc('0x32')],_0x36c529[_0xffcc('0x30')]);_0x560534[_0xffcc('0x33')]=_['intersection'](_0x36c529[_0xffcc('0x32')],qs[_0xffcc('0x34')](_0xb02abc[_0xffcc('0x30')]['fields']));_0x560534[_0xffcc('0x33')]=_0x560534[_0xffcc('0x33')][_0xffcc('0x35')]?_0x560534[_0xffcc('0x33')]:_0x36c529['model'];if(!_0xb02abc[_0xffcc('0x30')][_0xffcc('0x36')]('nolimit')){_0x560534['limit']=qs[_0xffcc('0x1c')](_0xb02abc[_0xffcc('0x30')][_0xffcc('0x1c')]);_0x560534[_0xffcc('0x1a')]=qs[_0xffcc('0x1a')](_0xb02abc['query'][_0xffcc('0x1a')]);}_0x560534[_0xffcc('0x37')]=qs[_0xffcc('0x38')](_0xb02abc[_0xffcc('0x30')][_0xffcc('0x38')]);_0x560534['where']=qs[_0xffcc('0x39')](_[_0xffcc('0x3a')](_0xb02abc[_0xffcc('0x30')],_0x36c529[_0xffcc('0x39')]),_0x143da0);if(_0xb02abc[_0xffcc('0x30')][_0xffcc('0x3b')]){_0x560534[_0xffcc('0x3c')]=_[_0xffcc('0x3d')](_0x560534['where'],{'$or':_[_0xffcc('0x2b')](_0x143da0,function(_0x5c157f){if(_0x5c157f[_0xffcc('0x2e')]!=='VIRTUAL'){var _0x54e1ba={};_0x54e1ba[_0x5c157f[_0xffcc('0x28')]]={'$like':'%'+_0xb02abc['query'][_0xffcc('0x3b')]+'%'};return _0x54e1ba;}})});}_0x560534=_[_0xffcc('0x3d')]({},_0x560534,_0xb02abc[_0xffcc('0x3e')]);var _0x4aadbf={'where':_0x560534[_0xffcc('0x3c')]};return db[_0xffcc('0x3f')][_0xffcc('0x1d')](_0x4aadbf)[_0xffcc('0x24')](function(_0xf53fcb){_0x44e871[_0xffcc('0x1d')]=_0xf53fcb;if(_0xb02abc['query'][_0xffcc('0x40')]){_0x560534[_0xffcc('0x41')]=[{'all':!![]}];}return db[_0xffcc('0x3f')]['findAll'](_0x560534);})[_0xffcc('0x24')](function(_0x1b7f98){_0x44e871['rows']=_0x1b7f98;return _0x44e871;})['then'](respondWithFilteredResult(_0x1b2832,_0x560534))[_0xffcc('0x42')](handleError(_0x1b2832,null));};exports[_0xffcc('0x43')]=function(_0x1911cd,_0x4dbd51){var _0x74910f={'raw':!![],'where':{'id':_0x1911cd[_0xffcc('0x44')]['id']}},_0x1f89f6={};_0x1f89f6[_0xffcc('0x32')]=_[_0xffcc('0x45')](db['ZohoField'][_0xffcc('0x2c')]);_0x1f89f6[_0xffcc('0x30')]=_[_0xffcc('0x45')](_0x1911cd[_0xffcc('0x30')]);_0x1f89f6['filters']=_[_0xffcc('0x31')](_0x1f89f6[_0xffcc('0x32')],_0x1f89f6[_0xffcc('0x30')]);_0x74910f['attributes']=_[_0xffcc('0x31')](_0x1f89f6[_0xffcc('0x32')],qs['fields'](_0x1911cd['query'][_0xffcc('0x34')]));_0x74910f[_0xffcc('0x33')]=_0x74910f[_0xffcc('0x33')][_0xffcc('0x35')]?_0x74910f[_0xffcc('0x33')]:_0x1f89f6[_0xffcc('0x32')];if(_0x1911cd[_0xffcc('0x30')][_0xffcc('0x40')]){_0x74910f[_0xffcc('0x41')]=[{'all':!![]}];}_0x74910f=_[_0xffcc('0x3d')]({},_0x74910f,_0x1911cd['options']);return db[_0xffcc('0x3f')][_0xffcc('0x46')](_0x74910f)[_0xffcc('0x24')](handleEntityNotFound(_0x4dbd51,null))[_0xffcc('0x24')](respondWithResult(_0x4dbd51,null))[_0xffcc('0x42')](handleError(_0x4dbd51,null));};exports[_0xffcc('0x47')]=function(_0x56c73c,_0x4b16d3){return db['ZohoField'][_0xffcc('0x47')](_0x56c73c[_0xffcc('0x48')],{})[_0xffcc('0x24')](respondWithResult(_0x4b16d3,0xc9))[_0xffcc('0x42')](handleError(_0x4b16d3,null));};exports[_0xffcc('0x23')]=function(_0x5b70fd,_0x3c7515){if(_0x5b70fd[_0xffcc('0x48')]['id']){delete _0x5b70fd['body']['id'];}return db[_0xffcc('0x3f')][_0xffcc('0x46')]({'where':{'id':_0x5b70fd['params']['id']}})[_0xffcc('0x24')](handleEntityNotFound(_0x3c7515,null))[_0xffcc('0x24')](saveUpdates(_0x5b70fd[_0xffcc('0x48')],null))[_0xffcc('0x24')](respondWithResult(_0x3c7515,null))['catch'](handleError(_0x3c7515,null));};exports[_0xffcc('0x49')]=function(_0x598454,_0x59abe3){return db[_0xffcc('0x3f')][_0xffcc('0x46')]({'where':{'id':_0x598454[_0xffcc('0x44')]['id']}})[_0xffcc('0x24')](handleEntityNotFound(_0x59abe3,null))[_0xffcc('0x24')](removeEntity(_0x59abe3,null))[_0xffcc('0x42')](handleError(_0x59abe3,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index c662c51..e7ff238 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 _0x2542=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0x2542,0x169));var _0x2254=function(_0x23651c,_0x10a918){_0x23651c=_0x23651c-0x0;var _0x2b7bfd=_0x2542[_0x23651c];return _0x2b7bfd;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xe'),_0x2254('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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(_0x33ee55,_0x235c9e){var _0xef7a3d=function(_0x5dd646){while(--_0x5dd646){_0x33ee55['push'](_0x33ee55['shift']());}};_0xef7a3d(++_0x235c9e);}(_0x187d,0x93));var _0xd187=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x187d[_0x3899d1];return _0xeb4a7d;};'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 diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index fdb2180..50222e7 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 _0x2b06=['request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2b06,0xc8));var _0x62b0=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x2b06[_0x21a2b3];return _0x4651a7;};'use strict';var _=require(_0x62b0('0x0'));var util=require(_0x62b0('0x1'));var moment=require(_0x62b0('0x2'));var BPromise=require(_0x62b0('0x3'));var rs=require(_0x62b0('0x4'));var fs=require('fs');var Redis=require(_0x62b0('0x5'));var db=require(_0x62b0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x62b0('0x7'))('rpc');var config=require(_0x62b0('0x8'));var jayson=require(_0x62b0('0x9'));var client=jayson[_0x62b0('0xa')][_0x62b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ee48b,_0x471b02,_0x4ac54b){return new BPromise(function(_0x82a00a,_0x473ac0){return client[_0x62b0('0xc')](_0x5ee48b,_0x4ac54b)[_0x62b0('0xd')](function(_0x2c70cc){logger[_0x62b0('0xe')](_0x62b0('0xf'),_0x471b02,_0x62b0('0x10'));logger['debug'](_0x62b0('0x11'),_0x471b02,'request\x20sent',JSON[_0x62b0('0x12')](_0x2c70cc));if(_0x2c70cc[_0x62b0('0x13')]){if(_0x2c70cc[_0x62b0('0x13')][_0x62b0('0x14')]===0x1f4){logger[_0x62b0('0x13')]('ZohoField,\x20%s,\x20%s',_0x471b02,_0x2c70cc[_0x62b0('0x13')][_0x62b0('0x15')]);return _0x473ac0(_0x2c70cc['error'][_0x62b0('0x15')]);}logger[_0x62b0('0x13')](_0x62b0('0xf'),_0x471b02,_0x2c70cc[_0x62b0('0x13')][_0x62b0('0x15')]);return _0x82a00a(_0x2c70cc[_0x62b0('0x13')][_0x62b0('0x15')]);}else{logger[_0x62b0('0xe')]('ZohoField,\x20%s,\x20%s',_0x471b02,_0x62b0('0x10'));_0x82a00a(_0x2c70cc[_0x62b0('0x16')]['message']);}})[_0x62b0('0x17')](function(_0x481cbd){logger['error']('ZohoField,\x20%s,\x20%s',_0x471b02,_0x481cbd);_0x473ac0(_0x481cbd);});});} \ No newline at end of file +var _0x7258=['error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x59ee96,_0x2dd0b9){var _0xeadac6=function(_0x308811){while(--_0x308811){_0x59ee96['push'](_0x59ee96['shift']());}};_0xeadac6(++_0x2dd0b9);}(_0x7258,0xeb));var _0x8725=function(_0x32a8cf,_0x2b6785){_0x32a8cf=_0x32a8cf-0x0;var _0x1cfd03=_0x7258[_0x32a8cf];return _0x1cfd03;};'use strict';var _=require(_0x8725('0x0'));var util=require(_0x8725('0x1'));var moment=require(_0x8725('0x2'));var BPromise=require(_0x8725('0x3'));var rs=require(_0x8725('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8725('0x5'))['db'];var utils=require(_0x8725('0x6'));var logger=require(_0x8725('0x7'))('rpc');var config=require(_0x8725('0x8'));var jayson=require(_0x8725('0x9'));var client=jayson[_0x8725('0xa')][_0x8725('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32848f,_0x9bc5a7,_0x5b916b){return new BPromise(function(_0x169044,_0x3aa75c){return client[_0x8725('0xc')](_0x32848f,_0x5b916b)[_0x8725('0xd')](function(_0x1a6063){logger[_0x8725('0xe')]('ZohoField,\x20%s,\x20%s',_0x9bc5a7,_0x8725('0xf'));logger[_0x8725('0x10')](_0x8725('0x11'),_0x9bc5a7,_0x8725('0xf'),JSON['stringify'](_0x1a6063));if(_0x1a6063[_0x8725('0x12')]){if(_0x1a6063['error'][_0x8725('0x13')]===0x1f4){logger['error'](_0x8725('0x14'),_0x9bc5a7,_0x1a6063[_0x8725('0x12')]['message']);return _0x3aa75c(_0x1a6063[_0x8725('0x12')]['message']);}logger['error'](_0x8725('0x14'),_0x9bc5a7,_0x1a6063['error'][_0x8725('0x15')]);return _0x169044(_0x1a6063[_0x8725('0x12')][_0x8725('0x15')]);}else{logger[_0x8725('0xe')]('ZohoField,\x20%s,\x20%s',_0x9bc5a7,_0x8725('0xf'));_0x169044(_0x1a6063['result'][_0x8725('0x15')]);}})[_0x8725('0x16')](function(_0x49febc){logger['error'](_0x8725('0x14'),_0x9bc5a7,_0x49febc);_0x3aa75c(_0x49febc);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index cc24229..dcda465 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x34b052,_0x351bc0){var _0x1517e0=function(_0x8c7285){while(--_0x8c7285){_0x34b052['push'](_0x34b052['shift']());}};_0x1517e0(++_0x351bc0);}(_0x70e0,0x17b));var _0x070e=function(_0x1df078,_0x1db734){_0x1df078=_0x1df078-0x0;var _0x263a11=_0x70e0[_0x1df078];return _0x263a11;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x44135b,_0x282444){var _0x1aa4f5=function(_0x8bc71){while(--_0x8bc71){_0x44135b['push'](_0x44135b['shift']());}};_0x1aa4f5(++_0x282444);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7dbb772..e49fffc 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 _0x9400=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x5d79bf,_0x54ce0b){var _0x4d1060=function(_0x147bc1){while(--_0x147bc1){_0x5d79bf['push'](_0x5d79bf['shift']());}};_0x4d1060(++_0x54ce0b);}(_0x9400,0x12a));var _0x0940=function(_0x4ae6e3,_0x56882b){_0x4ae6e3=_0x4ae6e3-0x0;var _0xf8ab75=_0x9400[_0x4ae6e3];return _0xf8ab75;};'use strict';var Sequelize=require(_0x0940('0x0'));module[_0x0940('0x1')]={'name':{'type':Sequelize[_0x0940('0x2')],'allowNull':![],'unique':_0x0940('0x3')},'version':{'type':Sequelize[_0x0940('0x2')],'allowNull':![],'unique':_0x0940('0x3')},'main':{'type':Sequelize[_0x0940('0x2')],'defaultValue':_0x0940('0x4')},'filename':{'type':Sequelize[_0x0940('0x2')]},'path':{'type':Sequelize[_0x0940('0x2')]},'type':{'type':Sequelize[_0x0940('0x2')]},'size':{'type':Sequelize[_0x0940('0x5')]},'active':{'type':Sequelize[_0x0940('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x0940('0x2')]},'state':{'type':Sequelize[_0x0940('0x2')],'unique':_0x0940('0x7')},'description':{'type':Sequelize[_0x0940('0x2')]},'title':{'type':Sequelize[_0x0940('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x0940('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x2082=['BOOLEAN','state','STRING','unique_name_and_version','INTEGER'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x2082,0x8e));var _0x2208=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0x2082[_0x3815c2];return _0x271f88;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2208('0x0')],'allowNull':![],'unique':_0x2208('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2208('0x1')},'main':{'type':Sequelize[_0x2208('0x0')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x2208('0x0')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2208('0x0')]},'size':{'type':Sequelize[_0x2208('0x2')]},'active':{'type':Sequelize[_0x2208('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0x2208('0x0')]},'logo':{'type':Sequelize[_0x2208('0x0')]},'state':{'type':Sequelize[_0x2208('0x0')],'unique':_0x2208('0x4')},'description':{'type':Sequelize[_0x2208('0x0')]},'title':{'type':Sequelize[_0x2208('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x2208('0x0')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0eba440..ebec44f 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 _0xe3da=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x2a2808,_0x351560){var _0x2d2b2f=function(_0xc589bf){while(--_0xc589bf){_0x2a2808['push'](_0x2a2808['shift']());}};_0x2d2b2f(++_0x351560);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));}; \ No newline at end of file +var _0x1967=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Integration','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0x1967,0x173));var _0x7196=function(_0x18ef87,_0x5631e9){_0x18ef87=_0x18ef87-0x0;var _0x6aa89a=_0x1967[_0x18ef87];return _0x6aa89a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['Integration'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['create']=function(_0x29c7e8,_0x582884){return db['Integration'][_0x7196('0x49')](_0x29c7e8['body'],{})['then'](respondWithResult(_0x582884,0xc9))['catch'](handleError(_0x582884,null));};exports[_0x7196('0x26')]=function(_0x5052ee,_0x48e3b5){if(_0x5052ee[_0x7196('0x4a')]['id']){delete _0x5052ee[_0x7196('0x4a')]['id'];}return db[_0x7196('0x3e')][_0x7196('0x47')]({'where':{'id':_0x5052ee['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x48e3b5,null))['then'](saveUpdates(_0x5052ee[_0x7196('0x4a')],null))[_0x7196('0x27')](respondWithResult(_0x48e3b5,null))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x4b')]=function(_0x2fd056,_0x3fe092){return db['Integration'][_0x7196('0x47')]({'where':{'id':_0x2fd056['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x3fe092,null))[_0x7196('0x27')](removeEntity(_0x3fe092,null))[_0x7196('0x48')](handleError(_0x3fe092,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c2562d3..b6595c5 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 _0x54d7=['../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x54d7,0x179));var _0x754d=function(_0x33bc7f,_0x4c8387){_0x33bc7f=_0x33bc7f-0x0;var _0x3edf6e=_0x54d7[_0x33bc7f];return _0x3edf6e;};'use strict';var _=require(_0x754d('0x0'));var util=require(_0x754d('0x1'));var logger=require(_0x754d('0x2'))('api');var moment=require(_0x754d('0x3'));var BPromise=require('bluebird');var rp=require(_0x754d('0x4'));var fs=require('fs');var path=require(_0x754d('0x5'));var rimraf=require(_0x754d('0x6'));var config=require(_0x754d('0x7'));var attributes=require(_0x754d('0x8'));module[_0x754d('0x9')]=function(_0x63e553,_0x292e0b){return _0x63e553[_0x754d('0xa')](_0x754d('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3232=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','util'];(function(_0x5ac11c,_0x289e8b){var _0xe71fa6=function(_0x285a5e){while(--_0x285a5e){_0x5ac11c['push'](_0x5ac11c['shift']());}};_0xe71fa6(++_0x289e8b);}(_0x3232,0x136));var _0x2323=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3232[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x2323('0x0'));var util=require(_0x2323('0x1'));var logger=require(_0x2323('0x2'))(_0x2323('0x3'));var moment=require('moment');var BPromise=require(_0x2323('0x4'));var rp=require(_0x2323('0x5'));var fs=require('fs');var path=require(_0x2323('0x6'));var rimraf=require(_0x2323('0x7'));var config=require(_0x2323('0x8'));var attributes=require(_0x2323('0x9'));module[_0x2323('0xa')]=function(_0x1a6899,_0x2be965){return _0x1a6899[_0x2323('0xb')](_0x2323('0xc'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index a356f33..fd84e82 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 _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0xc54fb,_0x4a79f3){var _0x1773c0=function(_0x3e0560){while(--_0x3e0560){_0xc54fb['push'](_0xc54fb['shift']());}};_0x1773c0(++_0x4a79f3);}(_0x1a85,0x178));var _0x51a8=function(_0x17cded,_0xa51b6b){_0x17cded=_0x17cded-0x0;var _0x41b11f=_0x1a85[_0x17cded];return _0x41b11f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file +var _0x1967=['then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x1967,0x173));var _0x7196=function(_0x3f6732,_0x2d5c57){_0x3f6732=_0x3f6732-0x0;var _0x511b50=_0x1967[_0x3f6732];return _0x511b50;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 5db492e..9d695e5 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 _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x240ae3,_0x5c5c47){var _0x1d7590=function(_0x421298){while(--_0x421298){_0x240ae3['push'](_0x240ae3['shift']());}};_0x1d7590(++_0x5c5c47);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2d049b,_0x418b80){_0x2d049b=_0x2d049b-0x0;var _0x395e0b=_0xc2c7[_0x2d049b];return _0x395e0b;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file +var _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0xa2320e,_0x4b5dc1){var _0x25f019=function(_0x4b9baa){while(--_0x4b9baa){_0xa2320e['push'](_0xa2320e['shift']());}};_0x25f019(++_0x4b5dc1);}(_0xc2c7,0x134));var _0x7c2c=function(_0x5915bb,_0x24cb77){_0x5915bb=_0x5915bb-0x0;var _0x40d59d=_0xc2c7[_0x5915bb];return _0x40d59d;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 49f3400..76920a7 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 _0x6392=['RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x6392,0x85));var _0x2639=function(_0x59ef3d,_0x5c7aee){_0x59ef3d=_0x59ef3d-0x0;var _0x585558=_0x6392[_0x59ef3d];return _0x585558;};'use strict';var Sequelize=require(_0x2639('0x0'));module[_0x2639('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x2639('0x2')]},'exitStatus':{'type':Sequelize[_0x2639('0x2')]},'ticketId':{'type':Sequelize[_0x2639('0x2')]},'integrationId':{'type':Sequelize[_0x2639('0x3')]},'contacts':{'type':Sequelize[_0x2639('0x2')]},'uniqueid':{'type':Sequelize[_0x2639('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2639('0x2')]},'queue':{'type':Sequelize[_0x2639('0x2')]},'interface':{'type':Sequelize[_0x2639('0x2')]},'membername':{'type':Sequelize[_0x2639('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2639('0x4')]},'agentconnectAt':{'type':Sequelize[_0x2639('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2639('0x4')]},'talktime':{'type':Sequelize[_0x2639('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2639('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x2639('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x2639('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2639('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2639('0x2')]},'channelstate':{'type':Sequelize[_0x2639('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2639('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2639('0x2')]},'connectedlinename':{'type':Sequelize[_0x2639('0x2')]},'language':{'type':Sequelize[_0x2639('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2639('0x2')]},'exten':{'type':Sequelize[_0x2639('0x2')]},'priority':{'type':Sequelize[_0x2639('0x2')]},'destchannel':{'type':Sequelize[_0x2639('0x2')]},'destchannelstate':{'type':Sequelize[_0x2639('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2639('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2639('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x2639('0x2')]},'destlanguage':{'type':Sequelize[_0x2639('0x2')]},'destaccountcode':{'type':Sequelize[_0x2639('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x2639('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x2639('0x2')]},'messageId':{'type':Sequelize[_0x2639('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x2639('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x2639('0x2')]},'cc':{'type':Sequelize[_0x2639('0x2')]},'attachment':{'type':Sequelize[_0x2639('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x2639('0x7')](_0x2639('0x8'),_0x2639('0x9'),_0x2639('0xa'),'FAILED')},'url':{'type':Sequelize[_0x2639('0x2')]},'app':{'type':Sequelize[_0x2639('0x2')]},'appdata':{'type':Sequelize[_0x2639('0x2')]},'projectId':{'type':Sequelize[_0x2639('0x3')]}}; \ No newline at end of file +var _0xd424=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xd424,0x1c3));var _0x4d42=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xd424[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require('sequelize');module[_0x4d42('0x0')]={'integration':{'type':Sequelize[_0x4d42('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x4d42('0x1')]},'ticketId':{'type':Sequelize[_0x4d42('0x1')]},'integrationId':{'type':Sequelize[_0x4d42('0x2')]},'contacts':{'type':Sequelize[_0x4d42('0x1')]},'uniqueid':{'type':Sequelize[_0x4d42('0x1')]},'calleridnum':{'type':Sequelize[_0x4d42('0x1')]},'calleridname':{'type':Sequelize[_0x4d42('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4d42('0x1')]},'membername':{'type':Sequelize[_0x4d42('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4d42('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4d42('0x3')]},'holdtime':{'type':Sequelize[_0x4d42('0x2')]},'agentcomplete':{'type':Sequelize[_0x4d42('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x4d42('0x2')]},'agentacw':{'type':Sequelize[_0x4d42('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4d42('0x2')]},'reason':{'type':Sequelize[_0x4d42('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x4d42('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x4d42('0x1')]},'channel':{'type':Sequelize[_0x4d42('0x1')]},'channelstate':{'type':Sequelize[_0x4d42('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4d42('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4d42('0x1')]},'connectedlinename':{'type':Sequelize[_0x4d42('0x1')]},'language':{'type':Sequelize[_0x4d42('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4d42('0x1')]},'exten':{'type':Sequelize[_0x4d42('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4d42('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4d42('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4d42('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4d42('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4d42('0x1')]},'destlanguage':{'type':Sequelize[_0x4d42('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4d42('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x4d42('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x4d42('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4d42('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x4d42('0x5')]},'text':{'type':Sequelize[_0x4d42('0x5')]},'status':{'type':Sequelize[_0x4d42('0x6')](_0x4d42('0x7'),'SENDING',_0x4d42('0x8'),_0x4d42('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x4d42('0x1')]},'appdata':{'type':Sequelize[_0x4d42('0x1')]},'projectId':{'type':Sequelize[_0x4d42('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e2f897b..80077de 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 _0xf3ed=['offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','IntegrationReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3ed,0x1e2));var _0xdf3e=function(_0x2fd51d,_0x36e978){_0x2fd51d=_0x2fd51d-0x0;var _0x1f41d8=_0xf3ed[_0x2fd51d];return _0x1f41d8;};'use strict';var emlformat=require(_0xdf3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf3e('0x2'));var moment=require(_0xdf3e('0x3'));var BPromise=require(_0xdf3e('0x4'));var Mustache=require(_0xdf3e('0x5'));var util=require('util');var path=require(_0xdf3e('0x6'));var sox=require(_0xdf3e('0x7'));var csv=require(_0xdf3e('0x8'));var ejs=require(_0xdf3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf3e('0xa'));var squel=require('squel');var crypto=require(_0xdf3e('0xb'));var jsforce=require(_0xdf3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf3e('0xd'));var Papa=require(_0xdf3e('0xe'));var Redis=require(_0xdf3e('0xf'));var authService=require(_0xdf3e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdf3e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf3e('0x12'));var utils=require(_0xdf3e('0x13'));var config=require(_0xdf3e('0x14'));var licenseUtil=require(_0xdf3e('0x15'));var db=require(_0xdf3e('0x16'))['db'];function respondWithStatusCode(_0x1ac300,_0x41a8d9){_0x41a8d9=_0x41a8d9||0xcc;return function(_0xc6854f){if(_0xc6854f){return _0x1ac300['sendStatus'](_0x41a8d9);}return _0x1ac300[_0xdf3e('0x17')](_0x41a8d9)[_0xdf3e('0x18')]();};}function respondWithResult(_0x1a5369,_0x13df5c){_0x13df5c=_0x13df5c||0xc8;return function(_0x57c860){if(_0x57c860){return _0x1a5369['status'](_0x13df5c)[_0xdf3e('0x19')](_0x57c860);}};}function respondWithFilteredResult(_0x270a74,_0x7a31a5){return function(_0x1bb54b){if(_0x1bb54b){var _0xfdf676=typeof _0x7a31a5['offset']===_0xdf3e('0x1a')&&typeof _0x7a31a5[_0xdf3e('0x1b')]===_0xdf3e('0x1a');var _0x19c49c=_0x1bb54b[_0xdf3e('0x1c')];var _0x5549de=_0xfdf676?0x0:_0x7a31a5[_0xdf3e('0x1d')];var _0x16e24a=_0xfdf676?_0x1bb54b['count']:_0x7a31a5['offset']+_0x7a31a5['limit'];var _0x1bf274;if(_0x16e24a>=_0x19c49c){_0x16e24a=_0x19c49c;_0x1bf274=0xc8;}else{_0x1bf274=0xce;}_0x270a74[_0xdf3e('0x17')](_0x1bf274);return _0x270a74[_0xdf3e('0x1e')](_0xdf3e('0x1f'),_0x5549de+'-'+_0x16e24a+'/'+_0x19c49c)['json'](_0x1bb54b);}return null;};}function patchUpdates(_0x1f2fd5){return function(_0x5d5554){try{jsonpatch[_0xdf3e('0x20')](_0x5d5554,_0x1f2fd5,!![]);}catch(_0x567d2b){return BPromise[_0xdf3e('0x21')](_0x567d2b);}return _0x5d5554[_0xdf3e('0x22')]();};}function saveUpdates(_0x53b1cd,_0x29f7ef){return function(_0x377258){if(_0x377258){return _0x377258[_0xdf3e('0x23')](_0x53b1cd)['then'](function(_0x4d1318){return _0x4d1318;});}return null;};}function removeEntity(_0x3a19ee,_0x2eb05a){return function(_0x1ea8fa){if(_0x1ea8fa){return _0x1ea8fa[_0xdf3e('0x24')]()[_0xdf3e('0x25')](function(){_0x3a19ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2414e8,_0x5d3bd0){return function(_0x40fd41){if(!_0x40fd41){_0x2414e8[_0xdf3e('0x26')](0x194);}return _0x40fd41;};}function handleError(_0x5bb68e,_0x2d7604){_0x2d7604=_0x2d7604||0x1f4;return function(_0x57d2eb){logger[_0xdf3e('0x27')](_0x57d2eb[_0xdf3e('0x28')]);if(_0x57d2eb['name']){delete _0x57d2eb['name'];}_0x5bb68e[_0xdf3e('0x17')](_0x2d7604)['send'](_0x57d2eb);};}exports['index']=function(_0x11de75,_0x7cb70d){var _0x267656={},_0x1c5291={},_0x4cb254={'count':0x0,'rows':[]};var _0x15d309=_['map'](db[_0xdf3e('0x29')][_0xdf3e('0x2a')],function(_0x540361){return{'name':_0x540361[_0xdf3e('0x2b')],'type':_0x540361[_0xdf3e('0x2c')][_0xdf3e('0x2d')]};});_0x1c5291[_0xdf3e('0x2e')]=_['map'](_0x15d309,_0xdf3e('0x2f'));_0x1c5291[_0xdf3e('0x30')]=_[_0xdf3e('0x31')](_0x11de75[_0xdf3e('0x30')]);_0x1c5291['filters']=_[_0xdf3e('0x32')](_0x1c5291[_0xdf3e('0x2e')],_0x1c5291['query']);_0x267656[_0xdf3e('0x33')]=_[_0xdf3e('0x32')](_0x1c5291[_0xdf3e('0x2e')],qs[_0xdf3e('0x34')](_0x11de75[_0xdf3e('0x30')][_0xdf3e('0x34')]));_0x267656[_0xdf3e('0x33')]=_0x267656[_0xdf3e('0x33')]['length']?_0x267656[_0xdf3e('0x33')]:_0x1c5291[_0xdf3e('0x2e')];if(!_0x11de75[_0xdf3e('0x30')]['hasOwnProperty'](_0xdf3e('0x35'))){_0x267656[_0xdf3e('0x1b')]=qs['limit'](_0x11de75['query'][_0xdf3e('0x1b')]);_0x267656[_0xdf3e('0x1d')]=qs[_0xdf3e('0x1d')](_0x11de75[_0xdf3e('0x30')]['offset']);}_0x267656[_0xdf3e('0x36')]=qs[_0xdf3e('0x37')](_0x11de75[_0xdf3e('0x30')][_0xdf3e('0x37')]);_0x267656[_0xdf3e('0x38')]=qs[_0xdf3e('0x39')](_[_0xdf3e('0x3a')](_0x11de75[_0xdf3e('0x30')],_0x1c5291['filters']),_0x15d309);if(_0x11de75['query'][_0xdf3e('0x3b')]){_0x267656[_0xdf3e('0x38')]=_[_0xdf3e('0x3c')](_0x267656['where'],{'$or':_['map'](_0x15d309,function(_0x5d6903){if(_0x5d6903[_0xdf3e('0x2c')]!==_0xdf3e('0x3d')){var _0xcb4c6={};_0xcb4c6[_0x5d6903[_0xdf3e('0x2f')]]={'$like':'%'+_0x11de75[_0xdf3e('0x30')]['filter']+'%'};return _0xcb4c6;}})});}_0x267656=_[_0xdf3e('0x3c')]({},_0x267656,_0x11de75[_0xdf3e('0x3e')]);var _0x47f95a={'where':_0x267656[_0xdf3e('0x38')]};return db[_0xdf3e('0x29')]['count'](_0x47f95a)[_0xdf3e('0x25')](function(_0x3893d9){_0x4cb254[_0xdf3e('0x1c')]=_0x3893d9;if(_0x11de75[_0xdf3e('0x30')][_0xdf3e('0x3f')]){_0x267656['include']=[{'all':!![]}];}return db[_0xdf3e('0x29')][_0xdf3e('0x40')](_0x267656);})[_0xdf3e('0x25')](function(_0x4c5643){_0x4cb254[_0xdf3e('0x41')]=_0x4c5643;return _0x4cb254;})[_0xdf3e('0x25')](respondWithFilteredResult(_0x7cb70d,_0x267656))[_0xdf3e('0x42')](handleError(_0x7cb70d,null));};exports[_0xdf3e('0x43')]=function(_0x14a1ae,_0x268fb7){var _0x36da06={'raw':![],'where':{'id':_0x14a1ae[_0xdf3e('0x44')]['id']}},_0x3eeb1d={};_0x3eeb1d[_0xdf3e('0x2e')]=_['keys'](db[_0xdf3e('0x29')][_0xdf3e('0x2a')]);_0x3eeb1d[_0xdf3e('0x30')]=_[_0xdf3e('0x31')](_0x14a1ae[_0xdf3e('0x30')]);_0x3eeb1d[_0xdf3e('0x39')]=_[_0xdf3e('0x32')](_0x3eeb1d[_0xdf3e('0x2e')],_0x3eeb1d[_0xdf3e('0x30')]);_0x36da06[_0xdf3e('0x33')]=_['intersection'](_0x3eeb1d[_0xdf3e('0x2e')],qs[_0xdf3e('0x34')](_0x14a1ae[_0xdf3e('0x30')][_0xdf3e('0x34')]));_0x36da06['attributes']=_0x36da06[_0xdf3e('0x33')]['length']?_0x36da06[_0xdf3e('0x33')]:_0x3eeb1d[_0xdf3e('0x2e')];if(_0x14a1ae[_0xdf3e('0x30')][_0xdf3e('0x3f')]){_0x36da06['include']=[{'all':!![]}];}_0x36da06=_[_0xdf3e('0x3c')]({},_0x36da06,_0x14a1ae['options']);return db['IntegrationReport'][_0xdf3e('0x45')](_0x36da06)[_0xdf3e('0x25')](handleEntityNotFound(_0x268fb7,null))['then'](respondWithResult(_0x268fb7,null))[_0xdf3e('0x42')](handleError(_0x268fb7,null));};exports[_0xdf3e('0x46')]=function(_0x56d11b,_0x125c90){return db['IntegrationReport']['create'](_0x56d11b[_0xdf3e('0x47')],{})[_0xdf3e('0x25')](respondWithResult(_0x125c90,0xc9))['catch'](handleError(_0x125c90,null));};exports[_0xdf3e('0x23')]=function(_0x1d4372,_0x42b44b){if(_0x1d4372[_0xdf3e('0x47')]['id']){delete _0x1d4372[_0xdf3e('0x47')]['id'];}return db[_0xdf3e('0x29')][_0xdf3e('0x45')]({'where':{'id':_0x1d4372['params']['id']}})[_0xdf3e('0x25')](handleEntityNotFound(_0x42b44b,null))[_0xdf3e('0x25')](saveUpdates(_0x1d4372[_0xdf3e('0x47')],null))[_0xdf3e('0x25')](respondWithResult(_0x42b44b,null))['catch'](handleError(_0x42b44b,null));};exports[_0xdf3e('0x24')]=function(_0x4ee59b,_0x2c35d7){return db[_0xdf3e('0x29')][_0xdf3e('0x45')]({'where':{'id':_0x4ee59b[_0xdf3e('0x44')]['id']}})[_0xdf3e('0x25')](handleEntityNotFound(_0x2c35d7,null))[_0xdf3e('0x25')](removeEntity(_0x2c35d7,null))[_0xdf3e('0x42')](handleError(_0x2c35d7,null));};exports[_0xdf3e('0x48')]=function(_0x14bffc,_0x107c58){return db[_0xdf3e('0x29')][_0xdf3e('0x48')]()[_0xdf3e('0x25')](respondWithResult(_0x107c58,null))[_0xdf3e('0x42')](handleError(_0x107c58,null));}; \ No newline at end of file +var _0xcc86=['destroy','error','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','type','merge','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then'];(function(_0x5bf840,_0x9fc2ab){var _0x4f4355=function(_0x5bef49){while(--_0x5bef49){_0x5bf840['push'](_0x5bf840['shift']());}};_0x4f4355(++_0x9fc2ab);}(_0xcc86,0x183));var _0x6cc8=function(_0x1176b0,_0x3b83ef){_0x1176b0=_0x1176b0-0x0;var _0x322419=_0xcc86[_0x1176b0];return _0x322419;};'use strict';var emlformat=require(_0x6cc8('0x0'));var rimraf=require(_0x6cc8('0x1'));var zipdir=require(_0x6cc8('0x2'));var jsonpatch=require(_0x6cc8('0x3'));var rp=require(_0x6cc8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cc8('0x5'));var path=require('path');var sox=require(_0x6cc8('0x6'));var csv=require(_0x6cc8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cc8('0x8'));var _=require('lodash');var squel=require(_0x6cc8('0x9'));var crypto=require(_0x6cc8('0xa'));var jsforce=require(_0x6cc8('0xb'));var deskjs=require(_0x6cc8('0xc'));var toCsv=require(_0x6cc8('0x7'));var querystring=require(_0x6cc8('0xd'));var Papa=require(_0x6cc8('0xe'));var Redis=require('ioredis');var authService=require(_0x6cc8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cc8('0x10'));var logger=require(_0x6cc8('0x11'))('api');var utils=require(_0x6cc8('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6cc8('0x13'))['db'];function respondWithStatusCode(_0x494718,_0x34aed4){_0x34aed4=_0x34aed4||0xcc;return function(_0x2aeb05){if(_0x2aeb05){return _0x494718[_0x6cc8('0x14')](_0x34aed4);}return _0x494718['status'](_0x34aed4)[_0x6cc8('0x15')]();};}function respondWithResult(_0x4d6356,_0x22aec6){_0x22aec6=_0x22aec6||0xc8;return function(_0x57838a){if(_0x57838a){return _0x4d6356[_0x6cc8('0x16')](_0x22aec6)[_0x6cc8('0x17')](_0x57838a);}};}function respondWithFilteredResult(_0x5725e1,_0x2d669c){return function(_0x34a518){if(_0x34a518){var _0x48574d=typeof _0x2d669c[_0x6cc8('0x18')]===_0x6cc8('0x19')&&typeof _0x2d669c[_0x6cc8('0x1a')]===_0x6cc8('0x19');var _0x2aa7cd=_0x34a518[_0x6cc8('0x1b')];var _0xeca7c2=_0x48574d?0x0:_0x2d669c[_0x6cc8('0x18')];var _0x303c7f=_0x48574d?_0x34a518['count']:_0x2d669c[_0x6cc8('0x18')]+_0x2d669c[_0x6cc8('0x1a')];var _0x4fad1f;if(_0x303c7f>=_0x2aa7cd){_0x303c7f=_0x2aa7cd;_0x4fad1f=0xc8;}else{_0x4fad1f=0xce;}_0x5725e1[_0x6cc8('0x16')](_0x4fad1f);return _0x5725e1['set'](_0x6cc8('0x1c'),_0xeca7c2+'-'+_0x303c7f+'/'+_0x2aa7cd)[_0x6cc8('0x17')](_0x34a518);}return null;};}function patchUpdates(_0x16041e){return function(_0x591ea9){try{jsonpatch[_0x6cc8('0x1d')](_0x591ea9,_0x16041e,!![]);}catch(_0x4bb4a9){return BPromise['reject'](_0x4bb4a9);}return _0x591ea9[_0x6cc8('0x1e')]();};}function saveUpdates(_0x5d1e72,_0x122947){return function(_0x176de8){if(_0x176de8){return _0x176de8[_0x6cc8('0x1f')](_0x5d1e72)[_0x6cc8('0x20')](function(_0x447c79){return _0x447c79;});}return null;};}function removeEntity(_0x132f36,_0x25b9d7){return function(_0x56d0ac){if(_0x56d0ac){return _0x56d0ac[_0x6cc8('0x21')]()[_0x6cc8('0x20')](function(){_0x132f36[_0x6cc8('0x16')](0xcc)[_0x6cc8('0x15')]();});}};}function handleEntityNotFound(_0x437dee,_0x4d66de){return function(_0x149b79){if(!_0x149b79){_0x437dee['sendStatus'](0x194);}return _0x149b79;};}function handleError(_0x1cac52,_0x3f5f10){_0x3f5f10=_0x3f5f10||0x1f4;return function(_0x3f71e4){logger[_0x6cc8('0x22')](_0x3f71e4[_0x6cc8('0x23')]);if(_0x3f71e4[_0x6cc8('0x24')]){delete _0x3f71e4[_0x6cc8('0x24')];}_0x1cac52['status'](_0x3f5f10)[_0x6cc8('0x25')](_0x3f71e4);};}exports[_0x6cc8('0x26')]=function(_0x3c8fa7,_0xf68c89){var _0x142f5c={},_0x39011b={},_0x2b8148={'count':0x0,'rows':[]};var _0x2206a5=_[_0x6cc8('0x27')](db['IntegrationReport']['rawAttributes'],function(_0x19d15f){return{'name':_0x19d15f[_0x6cc8('0x28')],'type':_0x19d15f['type'][_0x6cc8('0x29')]};});_0x39011b['model']=_[_0x6cc8('0x27')](_0x2206a5,_0x6cc8('0x24'));_0x39011b[_0x6cc8('0x2a')]=_[_0x6cc8('0x2b')](_0x3c8fa7[_0x6cc8('0x2a')]);_0x39011b[_0x6cc8('0x2c')]=_[_0x6cc8('0x2d')](_0x39011b[_0x6cc8('0x2e')],_0x39011b['query']);_0x142f5c[_0x6cc8('0x2f')]=_[_0x6cc8('0x2d')](_0x39011b[_0x6cc8('0x2e')],qs[_0x6cc8('0x30')](_0x3c8fa7[_0x6cc8('0x2a')][_0x6cc8('0x30')]));_0x142f5c[_0x6cc8('0x2f')]=_0x142f5c[_0x6cc8('0x2f')][_0x6cc8('0x31')]?_0x142f5c[_0x6cc8('0x2f')]:_0x39011b[_0x6cc8('0x2e')];if(!_0x3c8fa7['query'][_0x6cc8('0x32')]('nolimit')){_0x142f5c[_0x6cc8('0x1a')]=qs[_0x6cc8('0x1a')](_0x3c8fa7[_0x6cc8('0x2a')][_0x6cc8('0x1a')]);_0x142f5c[_0x6cc8('0x18')]=qs[_0x6cc8('0x18')](_0x3c8fa7[_0x6cc8('0x2a')]['offset']);}_0x142f5c['order']=qs[_0x6cc8('0x33')](_0x3c8fa7[_0x6cc8('0x2a')]['sort']);_0x142f5c[_0x6cc8('0x34')]=qs['filters'](_[_0x6cc8('0x35')](_0x3c8fa7[_0x6cc8('0x2a')],_0x39011b['filters']),_0x2206a5);if(_0x3c8fa7[_0x6cc8('0x2a')]['filter']){_0x142f5c[_0x6cc8('0x34')]=_['merge'](_0x142f5c['where'],{'$or':_['map'](_0x2206a5,function(_0x4a7032){if(_0x4a7032[_0x6cc8('0x36')]!=='VIRTUAL'){var _0x4564aa={};_0x4564aa[_0x4a7032[_0x6cc8('0x24')]]={'$like':'%'+_0x3c8fa7[_0x6cc8('0x2a')]['filter']+'%'};return _0x4564aa;}})});}_0x142f5c=_[_0x6cc8('0x37')]({},_0x142f5c,_0x3c8fa7['options']);var _0x1ceeae={'where':_0x142f5c[_0x6cc8('0x34')]};return db[_0x6cc8('0x38')]['count'](_0x1ceeae)['then'](function(_0x28400a){_0x2b8148[_0x6cc8('0x1b')]=_0x28400a;if(_0x3c8fa7[_0x6cc8('0x2a')][_0x6cc8('0x39')]){_0x142f5c[_0x6cc8('0x3a')]=[{'all':!![]}];}return db[_0x6cc8('0x38')][_0x6cc8('0x3b')](_0x142f5c);})['then'](function(_0x52c61c){_0x2b8148[_0x6cc8('0x3c')]=_0x52c61c;return _0x2b8148;})['then'](respondWithFilteredResult(_0xf68c89,_0x142f5c))[_0x6cc8('0x3d')](handleError(_0xf68c89,null));};exports[_0x6cc8('0x3e')]=function(_0x5ecb7b,_0x4d747e){var _0x5dcd03={'raw':![],'where':{'id':_0x5ecb7b[_0x6cc8('0x3f')]['id']}},_0x40bc92={};_0x40bc92['model']=_[_0x6cc8('0x2b')](db[_0x6cc8('0x38')][_0x6cc8('0x40')]);_0x40bc92[_0x6cc8('0x2a')]=_['keys'](_0x5ecb7b['query']);_0x40bc92[_0x6cc8('0x2c')]=_['intersection'](_0x40bc92[_0x6cc8('0x2e')],_0x40bc92[_0x6cc8('0x2a')]);_0x5dcd03[_0x6cc8('0x2f')]=_[_0x6cc8('0x2d')](_0x40bc92[_0x6cc8('0x2e')],qs['fields'](_0x5ecb7b[_0x6cc8('0x2a')][_0x6cc8('0x30')]));_0x5dcd03['attributes']=_0x5dcd03['attributes'][_0x6cc8('0x31')]?_0x5dcd03[_0x6cc8('0x2f')]:_0x40bc92[_0x6cc8('0x2e')];if(_0x5ecb7b[_0x6cc8('0x2a')][_0x6cc8('0x39')]){_0x5dcd03[_0x6cc8('0x3a')]=[{'all':!![]}];}_0x5dcd03=_[_0x6cc8('0x37')]({},_0x5dcd03,_0x5ecb7b[_0x6cc8('0x41')]);return db['IntegrationReport'][_0x6cc8('0x42')](_0x5dcd03)['then'](handleEntityNotFound(_0x4d747e,null))['then'](respondWithResult(_0x4d747e,null))[_0x6cc8('0x3d')](handleError(_0x4d747e,null));};exports[_0x6cc8('0x43')]=function(_0x357fb1,_0x276ff9){return db['IntegrationReport'][_0x6cc8('0x43')](_0x357fb1[_0x6cc8('0x44')],{})[_0x6cc8('0x20')](respondWithResult(_0x276ff9,0xc9))[_0x6cc8('0x3d')](handleError(_0x276ff9,null));};exports[_0x6cc8('0x1f')]=function(_0x1a24ce,_0x3c8a0d){if(_0x1a24ce['body']['id']){delete _0x1a24ce[_0x6cc8('0x44')]['id'];}return db[_0x6cc8('0x38')][_0x6cc8('0x42')]({'where':{'id':_0x1a24ce[_0x6cc8('0x3f')]['id']}})[_0x6cc8('0x20')](handleEntityNotFound(_0x3c8a0d,null))[_0x6cc8('0x20')](saveUpdates(_0x1a24ce[_0x6cc8('0x44')],null))[_0x6cc8('0x20')](respondWithResult(_0x3c8a0d,null))['catch'](handleError(_0x3c8a0d,null));};exports[_0x6cc8('0x21')]=function(_0x26732f,_0x9a21c6){return db[_0x6cc8('0x38')][_0x6cc8('0x42')]({'where':{'id':_0x26732f[_0x6cc8('0x3f')]['id']}})[_0x6cc8('0x20')](handleEntityNotFound(_0x9a21c6,null))[_0x6cc8('0x20')](removeEntity(_0x9a21c6,null))[_0x6cc8('0x3d')](handleError(_0x9a21c6,null));};exports[_0x6cc8('0x45')]=function(_0x1bc003,_0x3d270c){return db['IntegrationReport'][_0x6cc8('0x45')]()[_0x6cc8('0x20')](respondWithResult(_0x3d270c,null))['catch'](handleError(_0x3d270c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e177663..971fdd4 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 _0x1dd2=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3fa3ed,_0x3b81eb){var _0x4f538b=function(_0x47f66c){while(--_0x47f66c){_0x3fa3ed['push'](_0x3fa3ed['shift']());}};_0x4f538b(++_0x3b81eb);}(_0x1dd2,0x6d));var _0x21dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x21dd('0x0'));var util=require(_0x21dd('0x1'));var logger=require(_0x21dd('0x2'))('api');var moment=require(_0x21dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x21dd('0x4'));var fs=require('fs');var path=require(_0x21dd('0x5'));var rimraf=require(_0x21dd('0x6'));var config=require(_0x21dd('0x7'));var attributes=require(_0x21dd('0x8'));module[_0x21dd('0x9')]=function(_0x3149ba,_0x329050){return _0x3149ba[_0x21dd('0xa')](_0x21dd('0xb'),attributes,{'tableName':_0x21dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58ee=['bluebird','request-promise','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x2b686b,_0x1b5039){var _0x58ed77=function(_0xbdd4bb){while(--_0xbdd4bb){_0x2b686b['push'](_0x2b686b['shift']());}};_0x58ed77(++_0x1b5039);}(_0x58ee,0xb1));var _0xe58e=function(_0xe41964,_0x4c4b8a){_0xe41964=_0xe41964-0x0;var _0x225b65=_0x58ee[_0xe41964];return _0x225b65;};'use strict';var _=require(_0xe58e('0x0'));var util=require(_0xe58e('0x1'));var logger=require(_0xe58e('0x2'))(_0xe58e('0x3'));var moment=require(_0xe58e('0x4'));var BPromise=require(_0xe58e('0x5'));var rp=require(_0xe58e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe58e('0x7'));var attributes=require(_0xe58e('0x8'));module[_0xe58e('0x9')]=function(_0x46ea83,_0x5ca1f4){return _0x46ea83[_0xe58e('0xa')](_0xe58e('0xb'),attributes,{'tableName':_0xe58e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 63ff4d1..e4bbe46 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(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1ab3cc,_0x523ad7){_0x1ab3cc=_0x1ab3cc-0x0;var _0x3bc639=_0xc2c7[_0x1ab3cc];return _0x3bc639;};'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 _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x59128c,_0x55e880){var _0x401fbf=function(_0x5ca7c9){while(--_0x5ca7c9){_0x59128c['push'](_0x59128c['shift']());}};_0x401fbf(++_0x55e880);}(_0xba34,0x119));var _0x4ba3=function(_0x3994b4,_0x3bf54f){_0x3994b4=_0x3994b4-0x0;var _0x25cefb=_0xba34[_0x3994b4];return _0x25cefb;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index f0a9120..e94aff4 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 _0x3f1c=['get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','update','delete','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated'];(function(_0x9ff51,_0x4c951f){var _0x31959b=function(_0x350371){while(--_0x350371){_0x9ff51['push'](_0x9ff51['shift']());}};_0x31959b(++_0x4c951f);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x532a08,_0x1079ab){_0x532a08=_0x532a08-0x0;var _0xd9c5ee=_0x3f1c[_0x532a08];return _0xd9c5ee;};'use strict';var multer=require(_0xc3f1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc3f1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc3f1('0x2'));var auth=require(_0xc3f1('0x3'));var interaction=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var controller=require(_0xc3f1('0x6'));router['get']('/',auth[_0xc3f1('0x7')](),controller['index']);router[_0xc3f1('0x8')](_0xc3f1('0x9'),auth[_0xc3f1('0x7')](),controller['show']);router['get'](_0xc3f1('0xa'),auth['isAuthenticated'](),controller[_0xc3f1('0xb')]);router[_0xc3f1('0xc')]('/',auth[_0xc3f1('0x7')](),controller[_0xc3f1('0xd')]);router['post'](_0xc3f1('0xa'),auth['isAuthenticated'](),controller[_0xc3f1('0xe')]);router['post'](_0xc3f1('0xf'),auth['isAuthenticated'](),controller['addIntervals']);router[_0xc3f1('0x10')](_0xc3f1('0x9'),auth[_0xc3f1('0x7')](),controller[_0xc3f1('0x11')]);router[_0xc3f1('0x12')](_0xc3f1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xc3f1('0x13')]=router; \ No newline at end of file +var _0xd8b1=['create','/:id/sub_intervals','addInterval','post','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated','show','get','getIntervals'];(function(_0x2017b0,_0x3e5fc5){var _0x6d489e=function(_0x61c1fd){while(--_0x61c1fd){_0x2017b0['push'](_0x2017b0['shift']());}};_0x6d489e(++_0x3e5fc5);}(_0xd8b1,0x105));var _0x1d8b=function(_0x2aeb7c,_0xcd5dde){_0x2aeb7c=_0x2aeb7c-0x0;var _0x845989=_0xd8b1[_0x2aeb7c];return _0x845989;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['post'](_0x1d8b('0xf'),auth['isAuthenticated'](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0x11')](_0x1d8b('0x12'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x13')]);router[_0x1d8b('0x14')]('/:id',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x15')]);router[_0x1d8b('0x16')](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x17')]);module[_0x1d8b('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index d72686a..76654b4 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 _0x40e1=['exports','STRING'];(function(_0x13fde9,_0x4b685d){var _0xbefcdc=function(_0x1a9bd4){while(--_0x1a9bd4){_0x13fde9['push'](_0x13fde9['shift']());}};_0xbefcdc(++_0x4b685d);}(_0x40e1,0x1b4));var _0x140e=function(_0x571edb,_0x5a648d){_0x571edb=_0x571edb-0x0;var _0x2a682e=_0x40e1[_0x571edb];return _0x2a682e;};'use strict';var Sequelize=require('sequelize');module[_0x140e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x140e('0x1')]},'interval':{'type':Sequelize[_0x140e('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x5a53=['exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5a53,0x17c));var _0x35a5=function(_0x1fb8c9,_0x5f1b30){_0x1fb8c9=_0x1fb8c9-0x0;var _0x9eec94=_0x5a53[_0x1fb8c9];return _0x9eec94;};'use strict';var Sequelize=require('sequelize');module[_0x35a5('0x0')]={'name':{'type':Sequelize[_0x35a5('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x35a5('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 257bc0f..11a5fa2 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 _0xf2db=['params','length','create','body','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','get','Intervals','UserProfileResource','destroy','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0xf2db,0x128));var _0xbf2d=function(_0x170f0c,_0x12a10e){_0x170f0c=_0x170f0c-0x0;var _0x52eba8=_0xf2db[_0x170f0c];return _0x52eba8;};'use strict';var emlformat=require(_0xbf2d('0x0'));var rimraf=require(_0xbf2d('0x1'));var zipdir=require(_0xbf2d('0x2'));var jsonpatch=require(_0xbf2d('0x3'));var rp=require(_0xbf2d('0x4'));var moment=require(_0xbf2d('0x5'));var BPromise=require(_0xbf2d('0x6'));var Mustache=require(_0xbf2d('0x7'));var util=require(_0xbf2d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xbf2d('0x9'));var ejs=require(_0xbf2d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf2d('0xb'));var squel=require(_0xbf2d('0xc'));var crypto=require(_0xbf2d('0xd'));var jsforce=require(_0xbf2d('0xe'));var deskjs=require(_0xbf2d('0xf'));var toCsv=require(_0xbf2d('0x9'));var querystring=require(_0xbf2d('0x10'));var Papa=require(_0xbf2d('0x11'));var Redis=require('ioredis');var authService=require(_0xbf2d('0x12'));var qs=require(_0xbf2d('0x13'));var as=require(_0xbf2d('0x14'));var hardwareService=require(_0xbf2d('0x15'));var logger=require(_0xbf2d('0x16'))(_0xbf2d('0x17'));var utils=require(_0xbf2d('0x18'));var config=require(_0xbf2d('0x19'));var licenseUtil=require(_0xbf2d('0x1a'));var db=require(_0xbf2d('0x1b'))['db'];var extensions=require(_0xbf2d('0x1c'));function respondWithStatusCode(_0x2a08a7,_0x497203){_0x497203=_0x497203||0xcc;return function(_0x3f806d){if(_0x3f806d){return _0x2a08a7[_0xbf2d('0x1d')](_0x497203);}return _0x2a08a7[_0xbf2d('0x1e')](_0x497203)[_0xbf2d('0x1f')]();};}function respondWithResult(_0x37da26,_0x2471c5){_0x2471c5=_0x2471c5||0xc8;return function(_0x1e2fb5){if(_0x1e2fb5){return _0x37da26[_0xbf2d('0x1e')](_0x2471c5)[_0xbf2d('0x20')](_0x1e2fb5);}};}function respondWithFilteredResult(_0xeb7cf2,_0x5bfd18){return function(_0x493d67){if(_0x493d67){var _0x4b7d64=typeof _0x5bfd18[_0xbf2d('0x21')]==='undefined'&&typeof _0x5bfd18['limit']===_0xbf2d('0x22');var _0x1ec67a=_0x493d67[_0xbf2d('0x23')];var _0x3adbf5=_0x4b7d64?0x0:_0x5bfd18[_0xbf2d('0x21')];var _0x3c6f10=_0x4b7d64?_0x493d67['count']:_0x5bfd18['offset']+_0x5bfd18[_0xbf2d('0x24')];var _0x17233a;if(_0x3c6f10>=_0x1ec67a){_0x3c6f10=_0x1ec67a;_0x17233a=0xc8;}else{_0x17233a=0xce;}_0xeb7cf2[_0xbf2d('0x1e')](_0x17233a);return _0xeb7cf2[_0xbf2d('0x25')]('Content-Range',_0x3adbf5+'-'+_0x3c6f10+'/'+_0x1ec67a)[_0xbf2d('0x20')](_0x493d67);}return null;};}function patchUpdates(_0x122709){return function(_0x59a863){try{jsonpatch[_0xbf2d('0x26')](_0x59a863,_0x122709,!![]);}catch(_0xf22f06){return BPromise['reject'](_0xf22f06);}return _0x59a863['save']();};}function saveUpdates(_0x386639,_0x56ade6){return function(_0x568070){if(_0x568070){return _0x568070[_0xbf2d('0x27')](_0x386639)['then'](function(_0x26e4e0){return _0x26e4e0;});}return null;};}function removeEntity(_0x16a275,_0x3211e1){return function(_0x1df1de){if(_0x1df1de){return _0x1df1de['destroy']()[_0xbf2d('0x28')](function(){var _0x53dad6=_0x1df1de[_0xbf2d('0x29')]({'plain':!![]});var _0x20be8f=_0xbf2d('0x2a');return db[_0xbf2d('0x2b')][_0xbf2d('0x2c')]({'where':{'type':_0x20be8f,'resourceId':_0x53dad6['id']}})['then'](function(){return _0x1df1de;});})[_0xbf2d('0x28')](function(){_0x16a275[_0xbf2d('0x1e')](0xcc)[_0xbf2d('0x1f')]();});}};}function handleEntityNotFound(_0x85d871,_0x5aaa1f){return function(_0x1535b2){if(!_0x1535b2){_0x85d871['sendStatus'](0x194);}return _0x1535b2;};}function handleError(_0x180f35,_0x23efea){_0x23efea=_0x23efea||0x1f4;return function(_0x1d30af){logger[_0xbf2d('0x2d')](_0x1d30af[_0xbf2d('0x2e')]);if(_0x1d30af[_0xbf2d('0x2f')]){delete _0x1d30af[_0xbf2d('0x2f')];}_0x180f35[_0xbf2d('0x1e')](_0x23efea)[_0xbf2d('0x30')](_0x1d30af);};}exports[_0xbf2d('0x31')]=function(_0x8d17b6,_0x51324e){var _0x44e16e={},_0x203f11={},_0x3ec09f={'count':0x0,'rows':[]};var _0x28d3f6=_[_0xbf2d('0x32')](db[_0xbf2d('0x33')][_0xbf2d('0x34')],function(_0x3d5d48){return{'name':_0x3d5d48[_0xbf2d('0x35')],'type':_0x3d5d48['type'][_0xbf2d('0x36')]};});_0x203f11[_0xbf2d('0x37')]=_[_0xbf2d('0x32')](_0x28d3f6,'name');_0x203f11[_0xbf2d('0x38')]=_[_0xbf2d('0x39')](_0x8d17b6[_0xbf2d('0x38')]);_0x203f11[_0xbf2d('0x3a')]=_[_0xbf2d('0x3b')](_0x203f11[_0xbf2d('0x37')],_0x203f11[_0xbf2d('0x38')]);_0x44e16e[_0xbf2d('0x3c')]=_[_0xbf2d('0x3b')](_0x203f11['model'],qs[_0xbf2d('0x3d')](_0x8d17b6[_0xbf2d('0x38')][_0xbf2d('0x3d')]));_0x44e16e[_0xbf2d('0x3c')]=_0x44e16e[_0xbf2d('0x3c')]['length']?_0x44e16e[_0xbf2d('0x3c')]:_0x203f11[_0xbf2d('0x37')];if(!_0x8d17b6[_0xbf2d('0x38')]['hasOwnProperty'](_0xbf2d('0x3e'))){_0x44e16e[_0xbf2d('0x24')]=qs[_0xbf2d('0x24')](_0x8d17b6[_0xbf2d('0x38')][_0xbf2d('0x24')]);_0x44e16e[_0xbf2d('0x21')]=qs[_0xbf2d('0x21')](_0x8d17b6[_0xbf2d('0x38')][_0xbf2d('0x21')]);}_0x44e16e[_0xbf2d('0x3f')]=qs[_0xbf2d('0x40')](_0x8d17b6[_0xbf2d('0x38')][_0xbf2d('0x40')]);_0x44e16e[_0xbf2d('0x41')]=qs[_0xbf2d('0x3a')](_['pick'](_0x8d17b6['query'],_0x203f11['filters']),_0x28d3f6);if(_0x8d17b6['query'][_0xbf2d('0x42')]){_0x44e16e[_0xbf2d('0x41')]=_[_0xbf2d('0x43')](_0x44e16e['where'],{'$or':_[_0xbf2d('0x32')](_0x28d3f6,function(_0x586b9d){if(_0x586b9d[_0xbf2d('0x44')]!==_0xbf2d('0x45')){var _0xb34d91={};_0xb34d91[_0x586b9d['name']]={'$like':'%'+_0x8d17b6[_0xbf2d('0x38')][_0xbf2d('0x42')]+'%'};return _0xb34d91;}})});}_0x44e16e=_[_0xbf2d('0x43')]({},_0x44e16e,_0x8d17b6[_0xbf2d('0x46')]);var _0x41a2fc={'where':_0x44e16e[_0xbf2d('0x41')]};return db[_0xbf2d('0x33')]['count'](_0x41a2fc)[_0xbf2d('0x28')](function(_0x2cb365){_0x3ec09f[_0xbf2d('0x23')]=_0x2cb365;if(_0x8d17b6['query'][_0xbf2d('0x47')]){_0x44e16e[_0xbf2d('0x48')]=[{'all':!![]}];}return db[_0xbf2d('0x33')]['findAll'](_0x44e16e);})[_0xbf2d('0x28')](function(_0x41e7e7){_0x3ec09f[_0xbf2d('0x49')]=_0x41e7e7;return _0x3ec09f;})[_0xbf2d('0x28')](respondWithFilteredResult(_0x51324e,_0x44e16e))[_0xbf2d('0x4a')](handleError(_0x51324e,null));};exports[_0xbf2d('0x4b')]=function(_0xa2b5dd,_0x3dc0ea){var _0x4dc01c={'raw':!![],'where':{'id':_0xa2b5dd[_0xbf2d('0x4c')]['id']}},_0x98269={};_0x98269[_0xbf2d('0x37')]=_[_0xbf2d('0x39')](db[_0xbf2d('0x33')][_0xbf2d('0x34')]);_0x98269[_0xbf2d('0x38')]=_[_0xbf2d('0x39')](_0xa2b5dd['query']);_0x98269[_0xbf2d('0x3a')]=_[_0xbf2d('0x3b')](_0x98269[_0xbf2d('0x37')],_0x98269[_0xbf2d('0x38')]);_0x4dc01c[_0xbf2d('0x3c')]=_[_0xbf2d('0x3b')](_0x98269[_0xbf2d('0x37')],qs[_0xbf2d('0x3d')](_0xa2b5dd[_0xbf2d('0x38')][_0xbf2d('0x3d')]));_0x4dc01c[_0xbf2d('0x3c')]=_0x4dc01c['attributes'][_0xbf2d('0x4d')]?_0x4dc01c[_0xbf2d('0x3c')]:_0x98269[_0xbf2d('0x37')];if(_0xa2b5dd[_0xbf2d('0x38')][_0xbf2d('0x47')]){_0x4dc01c['include']=[{'all':!![]}];}_0x4dc01c=_[_0xbf2d('0x43')]({},_0x4dc01c,_0xa2b5dd[_0xbf2d('0x46')]);return db[_0xbf2d('0x33')]['find'](_0x4dc01c)[_0xbf2d('0x28')](handleEntityNotFound(_0x3dc0ea,null))[_0xbf2d('0x28')](respondWithResult(_0x3dc0ea,null))[_0xbf2d('0x4a')](handleError(_0x3dc0ea,null));};exports['create']=function(_0x31ba68,_0x2ad275){return db[_0xbf2d('0x33')][_0xbf2d('0x4e')](_0x31ba68[_0xbf2d('0x4f')],{})['then'](function(_0x3dff51){var _0xaeb983=_0x31ba68['user'][_0xbf2d('0x29')]({'plain':!![]});if(!_0xaeb983)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaeb983['role']===_0xbf2d('0x50')){var _0x1bc31e=_0x3dff51[_0xbf2d('0x29')]({'plain':!![]});var _0x45df06='Intervals';return db[_0xbf2d('0x51')][_0xbf2d('0x52')]({'where':{'name':_0x45df06,'userProfileId':_0xaeb983['userProfileId']},'raw':!![]})[_0xbf2d('0x28')](function(_0xfb7437){if(_0xfb7437&&_0xfb7437['autoAssociation']===0x0){return db[_0xbf2d('0x2b')][_0xbf2d('0x4e')]({'name':_0x1bc31e[_0xbf2d('0x2f')],'resourceId':_0x1bc31e['id'],'type':_0xfb7437[_0xbf2d('0x2f')],'sectionId':_0xfb7437['id']},{})[_0xbf2d('0x28')](function(){return _0x3dff51;});}else{return _0x3dff51;}})[_0xbf2d('0x4a')](function(_0x350ff0){logger[_0xbf2d('0x2d')](_0xbf2d('0x53'),_0x350ff0);throw _0x350ff0;});}return _0x3dff51;})['then'](respondWithResult(_0x2ad275,0xc9))[_0xbf2d('0x4a')](handleError(_0x2ad275,null));};exports['update']=function(_0xb8e90c,_0x3747eb){if(_0xb8e90c['body']['id']){delete _0xb8e90c[_0xbf2d('0x4f')]['id'];}return db['Interval'][_0xbf2d('0x52')]({'where':{'id':_0xb8e90c[_0xbf2d('0x4c')]['id']}})[_0xbf2d('0x28')](handleEntityNotFound(_0x3747eb,null))[_0xbf2d('0x28')](saveUpdates(_0xb8e90c[_0xbf2d('0x4f')],null))['then'](respondWithResult(_0x3747eb,null))[_0xbf2d('0x4a')](handleError(_0x3747eb,null));};exports[_0xbf2d('0x2c')]=function(_0x11b073,_0x4191e4){return db[_0xbf2d('0x33')][_0xbf2d('0x52')]({'where':{'id':_0x11b073['params']['id']}})[_0xbf2d('0x28')](handleEntityNotFound(_0x4191e4,null))['then'](removeEntity(_0x4191e4,null))['catch'](handleError(_0x4191e4,null));};exports[_0xbf2d('0x54')]=function(_0x47c184,_0x57297c,_0x195211){if(_0x47c184[_0xbf2d('0x4f')]['id']){delete _0x47c184['body']['id'];}return db['Interval'][_0xbf2d('0x52')]({'where':{'id':_0x47c184['params']['id']}})[_0xbf2d('0x28')](handleEntityNotFound(_0x57297c,null))[_0xbf2d('0x28')](function(_0x1049d8){if(_0x1049d8){_0x47c184[_0xbf2d('0x4f')][_0xbf2d('0x55')]=_0x1049d8['id'];return db[_0xbf2d('0x33')][_0xbf2d('0x4e')](_0x47c184[_0xbf2d('0x4f')]);}})[_0xbf2d('0x28')](respondWithResult(_0x57297c,null))[_0xbf2d('0x4a')](handleError(_0x57297c,null));};exports[_0xbf2d('0x56')]=function(_0x15c2d7,_0x28a03b,_0x1a3935){var _0x32c6be={};var _0x5a0769={};var _0x4f051b;var _0xeadaf0;return db[_0xbf2d('0x33')][_0xbf2d('0x57')]({'where':{'id':_0x15c2d7[_0xbf2d('0x4c')]['id']}})[_0xbf2d('0x28')](handleEntityNotFound(_0x28a03b,null))[_0xbf2d('0x28')](function(_0x23b160){if(_0x23b160){_0x4f051b=_0x23b160;_0x5a0769[_0xbf2d('0x37')]=_[_0xbf2d('0x39')](db[_0xbf2d('0x33')][_0xbf2d('0x34')]);_0x5a0769[_0xbf2d('0x38')]=_[_0xbf2d('0x39')](_0x15c2d7['query']);_0x5a0769[_0xbf2d('0x3a')]=_['intersection'](_0x5a0769[_0xbf2d('0x37')],_0x5a0769[_0xbf2d('0x38')]);_0x32c6be['attributes']=_[_0xbf2d('0x3b')](_0x5a0769['model'],qs['fields'](_0x15c2d7[_0xbf2d('0x38')][_0xbf2d('0x3d')]));_0x32c6be[_0xbf2d('0x3c')]=_0x32c6be[_0xbf2d('0x3c')]['length']?_0x32c6be[_0xbf2d('0x3c')]:_0x5a0769[_0xbf2d('0x37')];_0x32c6be['order']=qs[_0xbf2d('0x40')](_0x15c2d7[_0xbf2d('0x38')][_0xbf2d('0x40')]);_0x32c6be['where']=qs[_0xbf2d('0x3a')](_['pick'](_0x15c2d7[_0xbf2d('0x38')],_0x5a0769[_0xbf2d('0x3a')]));if(_0x15c2d7[_0xbf2d('0x38')][_0xbf2d('0x42')]){_0x32c6be[_0xbf2d('0x41')]=_[_0xbf2d('0x43')](_0x32c6be['where'],{'$or':_[_0xbf2d('0x32')](_0x32c6be[_0xbf2d('0x3c')],function(_0x1cf7d5){var _0x3c8d6e={};_0x3c8d6e[_0x1cf7d5]={'$like':'%'+_0x15c2d7[_0xbf2d('0x38')][_0xbf2d('0x42')]+'%'};return _0x3c8d6e;})});}_0x32c6be=_['merge']({},_0x32c6be,_0x15c2d7[_0xbf2d('0x46')]);return _0x4f051b[_0xbf2d('0x56')](_0x32c6be);}})[_0xbf2d('0x28')](function(_0xf6f26d){if(_0xf6f26d){_0xeadaf0=_0xf6f26d[_0xbf2d('0x4d')];if(!_0x15c2d7[_0xbf2d('0x38')]['hasOwnProperty'](_0xbf2d('0x3e'))){_0x32c6be[_0xbf2d('0x24')]=qs[_0xbf2d('0x24')](_0x15c2d7[_0xbf2d('0x38')][_0xbf2d('0x24')]);_0x32c6be[_0xbf2d('0x21')]=qs['offset'](_0x15c2d7[_0xbf2d('0x38')][_0xbf2d('0x21')]);}return _0x4f051b[_0xbf2d('0x56')](_0x32c6be);}})[_0xbf2d('0x28')](function(_0x404f78){if(_0x404f78){return _0x404f78?{'count':_0xeadaf0,'rows':_0x404f78}:null;}})['then'](respondWithResult(_0x28a03b,null))[_0xbf2d('0x4a')](handleError(_0x28a03b,null));};exports[_0xbf2d('0x58')]=function(_0x8adec,_0x5833cb,_0x1fca77){return db[_0xbf2d('0x33')]['findOne']({'where':{'id':_0x8adec[_0xbf2d('0x4c')]['id']}})[_0xbf2d('0x28')](handleEntityNotFound(_0x5833cb,null))[_0xbf2d('0x28')](function(_0x5efc83){if(_0x5efc83){return db[_0xbf2d('0x59')][_0xbf2d('0x5a')](function(_0x335ab3){return db['Interval'][_0xbf2d('0x2c')]({'where':{'IntervalId':_0x8adec[_0xbf2d('0x4c')]['id']},'transaction':_0x335ab3})[_0xbf2d('0x28')](function(_0x124d5e){var _0x499f65=_[_0xbf2d('0x32')](_0x8adec['body'],function(_0x149d33){delete _0x149d33['id'];_0x149d33[_0xbf2d('0x55')]=_0x8adec[_0xbf2d('0x4c')]['id'];return _0x149d33;});return db[_0xbf2d('0x33')][_0xbf2d('0x5b')](_0x499f65,{'transaction':_0x335ab3});});})[_0xbf2d('0x28')](function(){return db[_0xbf2d('0x33')][_0xbf2d('0x5c')]({'where':{'IntervalId':_0x8adec[_0xbf2d('0x4c')]['id']}});});}})[_0xbf2d('0x28')](respondWithResult(_0x5833cb,null))[_0xbf2d('0x4a')](handleError(_0x5833cb,null));}; \ No newline at end of file +var _0xe967=['mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','Interval','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','model','nolimit','order','sort','pick','where','merge','filter','options','include','findAll','catch','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','transaction','bulkCreate','eml-format','fast-json-patch','request-promise','bluebird'];(function(_0x43eb0e,_0x30c7d1){var _0x15b674=function(_0x5d5ad6){while(--_0x5d5ad6){_0x43eb0e['push'](_0x43eb0e['shift']());}};_0x15b674(++_0x30c7d1);}(_0xe967,0x168));var _0x7e96=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0xe967[_0x163742];return _0x1152ac;};'use strict';var emlformat=require(_0x7e96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e96('0x1'));var rp=require(_0x7e96('0x2'));var moment=require('moment');var BPromise=require(_0x7e96('0x3'));var Mustache=require(_0x7e96('0x4'));var util=require('util');var path=require(_0x7e96('0x5'));var sox=require(_0x7e96('0x6'));var csv=require('to-csv');var ejs=require(_0x7e96('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e96('0x8'));var squel=require(_0x7e96('0x9'));var crypto=require(_0x7e96('0xa'));var jsforce=require(_0x7e96('0xb'));var deskjs=require(_0x7e96('0xc'));var toCsv=require(_0x7e96('0xd'));var querystring=require(_0x7e96('0xe'));var Papa=require(_0x7e96('0xf'));var Redis=require('ioredis');var authService=require(_0x7e96('0x10'));var qs=require(_0x7e96('0x11'));var as=require(_0x7e96('0x12'));var hardwareService=require(_0x7e96('0x13'));var logger=require('../../config/logger')(_0x7e96('0x14'));var utils=require(_0x7e96('0x15'));var config=require(_0x7e96('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e96('0x17'))['db'];var extensions=require(_0x7e96('0x18'));function respondWithStatusCode(_0x4c4531,_0x471516){_0x471516=_0x471516||0xcc;return function(_0x56ea44){if(_0x56ea44){return _0x4c4531[_0x7e96('0x19')](_0x471516);}return _0x4c4531[_0x7e96('0x1a')](_0x471516)[_0x7e96('0x1b')]();};}function respondWithResult(_0x6bf4e3,_0xa7645){_0xa7645=_0xa7645||0xc8;return function(_0x588828){if(_0x588828){return _0x6bf4e3[_0x7e96('0x1a')](_0xa7645)[_0x7e96('0x1c')](_0x588828);}};}function respondWithFilteredResult(_0x228689,_0x42cdb7){return function(_0x3a243a){if(_0x3a243a){var _0x3e4a05=typeof _0x42cdb7[_0x7e96('0x1d')]==='undefined'&&typeof _0x42cdb7['limit']===_0x7e96('0x1e');var _0xca93e5=_0x3a243a[_0x7e96('0x1f')];var _0x4819aa=_0x3e4a05?0x0:_0x42cdb7['offset'];var _0xfb8cd2=_0x3e4a05?_0x3a243a[_0x7e96('0x1f')]:_0x42cdb7[_0x7e96('0x1d')]+_0x42cdb7[_0x7e96('0x20')];var _0x239cf2;if(_0xfb8cd2>=_0xca93e5){_0xfb8cd2=_0xca93e5;_0x239cf2=0xc8;}else{_0x239cf2=0xce;}_0x228689[_0x7e96('0x1a')](_0x239cf2);return _0x228689[_0x7e96('0x21')](_0x7e96('0x22'),_0x4819aa+'-'+_0xfb8cd2+'/'+_0xca93e5)[_0x7e96('0x1c')](_0x3a243a);}return null;};}function patchUpdates(_0xa88eaf){return function(_0x584ccc){try{jsonpatch[_0x7e96('0x23')](_0x584ccc,_0xa88eaf,!![]);}catch(_0x3a2601){return BPromise[_0x7e96('0x24')](_0x3a2601);}return _0x584ccc[_0x7e96('0x25')]();};}function saveUpdates(_0x26e78e,_0x3ea8ca){return function(_0x3e9d18){if(_0x3e9d18){return _0x3e9d18[_0x7e96('0x26')](_0x26e78e)[_0x7e96('0x27')](function(_0x97b640){return _0x97b640;});}return null;};}function removeEntity(_0x1c5429,_0x2b9eb0){return function(_0x5af78c){if(_0x5af78c){return _0x5af78c[_0x7e96('0x28')]()[_0x7e96('0x27')](function(){var _0xdef4d0=_0x5af78c[_0x7e96('0x29')]({'plain':!![]});var _0x36dc7a='Intervals';return db[_0x7e96('0x2a')][_0x7e96('0x28')]({'where':{'type':_0x36dc7a,'resourceId':_0xdef4d0['id']}})[_0x7e96('0x27')](function(){return _0x5af78c;});})[_0x7e96('0x27')](function(){_0x1c5429['status'](0xcc)[_0x7e96('0x1b')]();});}};}function handleEntityNotFound(_0x391e5f,_0x40ea04){return function(_0x4565f2){if(!_0x4565f2){_0x391e5f[_0x7e96('0x19')](0x194);}return _0x4565f2;};}function handleError(_0x16faa0,_0x30c2d5){_0x30c2d5=_0x30c2d5||0x1f4;return function(_0x24bac5){logger[_0x7e96('0x2b')](_0x24bac5[_0x7e96('0x2c')]);if(_0x24bac5[_0x7e96('0x2d')]){delete _0x24bac5[_0x7e96('0x2d')];}_0x16faa0[_0x7e96('0x1a')](_0x30c2d5)['send'](_0x24bac5);};}exports[_0x7e96('0x2e')]=function(_0x57c5ca,_0x34fef4){var _0xa4bf06={},_0x554abc={},_0xe862d={'count':0x0,'rows':[]};var _0x180acf=_['map'](db[_0x7e96('0x2f')][_0x7e96('0x30')],function(_0x58f9d0){return{'name':_0x58f9d0[_0x7e96('0x31')],'type':_0x58f9d0[_0x7e96('0x32')][_0x7e96('0x33')]};});_0x554abc['model']=_[_0x7e96('0x34')](_0x180acf,'name');_0x554abc[_0x7e96('0x35')]=_[_0x7e96('0x36')](_0x57c5ca[_0x7e96('0x35')]);_0x554abc[_0x7e96('0x37')]=_[_0x7e96('0x38')](_0x554abc['model'],_0x554abc[_0x7e96('0x35')]);_0xa4bf06[_0x7e96('0x39')]=_[_0x7e96('0x38')](_0x554abc['model'],qs[_0x7e96('0x3a')](_0x57c5ca[_0x7e96('0x35')][_0x7e96('0x3a')]));_0xa4bf06[_0x7e96('0x39')]=_0xa4bf06[_0x7e96('0x39')]['length']?_0xa4bf06[_0x7e96('0x39')]:_0x554abc[_0x7e96('0x3b')];if(!_0x57c5ca[_0x7e96('0x35')]['hasOwnProperty'](_0x7e96('0x3c'))){_0xa4bf06[_0x7e96('0x20')]=qs['limit'](_0x57c5ca[_0x7e96('0x35')][_0x7e96('0x20')]);_0xa4bf06[_0x7e96('0x1d')]=qs[_0x7e96('0x1d')](_0x57c5ca[_0x7e96('0x35')]['offset']);}_0xa4bf06[_0x7e96('0x3d')]=qs[_0x7e96('0x3e')](_0x57c5ca[_0x7e96('0x35')][_0x7e96('0x3e')]);_0xa4bf06['where']=qs['filters'](_[_0x7e96('0x3f')](_0x57c5ca[_0x7e96('0x35')],_0x554abc[_0x7e96('0x37')]),_0x180acf);if(_0x57c5ca[_0x7e96('0x35')]['filter']){_0xa4bf06[_0x7e96('0x40')]=_[_0x7e96('0x41')](_0xa4bf06[_0x7e96('0x40')],{'$or':_[_0x7e96('0x34')](_0x180acf,function(_0x17d487){if(_0x17d487[_0x7e96('0x32')]!=='VIRTUAL'){var _0x44545f={};_0x44545f[_0x17d487[_0x7e96('0x2d')]]={'$like':'%'+_0x57c5ca['query'][_0x7e96('0x42')]+'%'};return _0x44545f;}})});}_0xa4bf06=_[_0x7e96('0x41')]({},_0xa4bf06,_0x57c5ca[_0x7e96('0x43')]);var _0x5bcdd0={'where':_0xa4bf06[_0x7e96('0x40')]};return db[_0x7e96('0x2f')][_0x7e96('0x1f')](_0x5bcdd0)[_0x7e96('0x27')](function(_0x17d671){_0xe862d['count']=_0x17d671;if(_0x57c5ca[_0x7e96('0x35')]['includeAll']){_0xa4bf06[_0x7e96('0x44')]=[{'all':!![]}];}return db[_0x7e96('0x2f')][_0x7e96('0x45')](_0xa4bf06);})['then'](function(_0x426144){_0xe862d['rows']=_0x426144;return _0xe862d;})[_0x7e96('0x27')](respondWithFilteredResult(_0x34fef4,_0xa4bf06))[_0x7e96('0x46')](handleError(_0x34fef4,null));};exports[_0x7e96('0x47')]=function(_0x224e2a,_0x59cff9){var _0x4f960f={'raw':!![],'where':{'id':_0x224e2a[_0x7e96('0x48')]['id']}},_0x2493fe={};_0x2493fe['model']=_['keys'](db[_0x7e96('0x2f')][_0x7e96('0x30')]);_0x2493fe['query']=_[_0x7e96('0x36')](_0x224e2a[_0x7e96('0x35')]);_0x2493fe[_0x7e96('0x37')]=_[_0x7e96('0x38')](_0x2493fe[_0x7e96('0x3b')],_0x2493fe['query']);_0x4f960f[_0x7e96('0x39')]=_[_0x7e96('0x38')](_0x2493fe[_0x7e96('0x3b')],qs[_0x7e96('0x3a')](_0x224e2a[_0x7e96('0x35')][_0x7e96('0x3a')]));_0x4f960f[_0x7e96('0x39')]=_0x4f960f[_0x7e96('0x39')][_0x7e96('0x49')]?_0x4f960f[_0x7e96('0x39')]:_0x2493fe[_0x7e96('0x3b')];if(_0x224e2a[_0x7e96('0x35')]['includeAll']){_0x4f960f[_0x7e96('0x44')]=[{'all':!![]}];}_0x4f960f=_['merge']({},_0x4f960f,_0x224e2a['options']);return db[_0x7e96('0x2f')][_0x7e96('0x4a')](_0x4f960f)[_0x7e96('0x27')](handleEntityNotFound(_0x59cff9,null))[_0x7e96('0x27')](respondWithResult(_0x59cff9,null))[_0x7e96('0x46')](handleError(_0x59cff9,null));};exports['create']=function(_0x5f1af6,_0x41b01c){return db[_0x7e96('0x2f')]['create'](_0x5f1af6[_0x7e96('0x4b')],{})[_0x7e96('0x27')](function(_0x3bc601){var _0x53fd34=_0x5f1af6[_0x7e96('0x4c')][_0x7e96('0x29')]({'plain':!![]});if(!_0x53fd34)throw new Error(_0x7e96('0x4d'));if(_0x53fd34[_0x7e96('0x4e')]===_0x7e96('0x4c')){var _0x36cd4b=_0x3bc601[_0x7e96('0x29')]({'plain':!![]});var _0x2a92e2='Intervals';return db[_0x7e96('0x4f')][_0x7e96('0x4a')]({'where':{'name':_0x2a92e2,'userProfileId':_0x53fd34['userProfileId']},'raw':!![]})[_0x7e96('0x27')](function(_0x1fdbeb){if(_0x1fdbeb&&_0x1fdbeb[_0x7e96('0x50')]===0x0){return db[_0x7e96('0x2a')][_0x7e96('0x51')]({'name':_0x36cd4b['name'],'resourceId':_0x36cd4b['id'],'type':_0x1fdbeb[_0x7e96('0x2d')],'sectionId':_0x1fdbeb['id']},{})[_0x7e96('0x27')](function(){return _0x3bc601;});}else{return _0x3bc601;}})[_0x7e96('0x46')](function(_0xabc9c7){logger[_0x7e96('0x2b')](_0x7e96('0x52'),_0xabc9c7);throw _0xabc9c7;});}return _0x3bc601;})[_0x7e96('0x27')](respondWithResult(_0x41b01c,0xc9))[_0x7e96('0x46')](handleError(_0x41b01c,null));};exports[_0x7e96('0x26')]=function(_0x2abc60,_0x39e680){if(_0x2abc60[_0x7e96('0x4b')]['id']){delete _0x2abc60['body']['id'];}return db[_0x7e96('0x2f')][_0x7e96('0x4a')]({'where':{'id':_0x2abc60['params']['id']}})[_0x7e96('0x27')](handleEntityNotFound(_0x39e680,null))[_0x7e96('0x27')](saveUpdates(_0x2abc60[_0x7e96('0x4b')],null))[_0x7e96('0x27')](respondWithResult(_0x39e680,null))[_0x7e96('0x46')](handleError(_0x39e680,null));};exports[_0x7e96('0x28')]=function(_0x575d11,_0x1790ae){return db[_0x7e96('0x2f')]['find']({'where':{'id':_0x575d11[_0x7e96('0x48')]['id']}})['then'](handleEntityNotFound(_0x1790ae,null))[_0x7e96('0x27')](removeEntity(_0x1790ae,null))[_0x7e96('0x46')](handleError(_0x1790ae,null));};exports[_0x7e96('0x53')]=function(_0x124d18,_0x3a8b76,_0x47d7e8){if(_0x124d18[_0x7e96('0x4b')]['id']){delete _0x124d18['body']['id'];}return db['Interval'][_0x7e96('0x4a')]({'where':{'id':_0x124d18[_0x7e96('0x48')]['id']}})[_0x7e96('0x27')](handleEntityNotFound(_0x3a8b76,null))[_0x7e96('0x27')](function(_0x1cdc02){if(_0x1cdc02){_0x124d18[_0x7e96('0x4b')][_0x7e96('0x54')]=_0x1cdc02['id'];return db['Interval'][_0x7e96('0x51')](_0x124d18['body']);}})[_0x7e96('0x27')](respondWithResult(_0x3a8b76,null))[_0x7e96('0x46')](handleError(_0x3a8b76,null));};exports[_0x7e96('0x55')]=function(_0x30132b,_0x1f13c5,_0x2d6e36){var _0x3e1789={};var _0x4e1113={};var _0x43ec0c;var _0x49cdb9;return db[_0x7e96('0x2f')][_0x7e96('0x56')]({'where':{'id':_0x30132b['params']['id']}})['then'](handleEntityNotFound(_0x1f13c5,null))[_0x7e96('0x27')](function(_0x45a874){if(_0x45a874){_0x43ec0c=_0x45a874;_0x4e1113[_0x7e96('0x3b')]=_[_0x7e96('0x36')](db[_0x7e96('0x2f')][_0x7e96('0x30')]);_0x4e1113[_0x7e96('0x35')]=_[_0x7e96('0x36')](_0x30132b[_0x7e96('0x35')]);_0x4e1113['filters']=_[_0x7e96('0x38')](_0x4e1113[_0x7e96('0x3b')],_0x4e1113[_0x7e96('0x35')]);_0x3e1789['attributes']=_[_0x7e96('0x38')](_0x4e1113[_0x7e96('0x3b')],qs[_0x7e96('0x3a')](_0x30132b[_0x7e96('0x35')][_0x7e96('0x3a')]));_0x3e1789['attributes']=_0x3e1789[_0x7e96('0x39')][_0x7e96('0x49')]?_0x3e1789[_0x7e96('0x39')]:_0x4e1113['model'];_0x3e1789[_0x7e96('0x3d')]=qs[_0x7e96('0x3e')](_0x30132b['query'][_0x7e96('0x3e')]);_0x3e1789[_0x7e96('0x40')]=qs[_0x7e96('0x37')](_[_0x7e96('0x3f')](_0x30132b[_0x7e96('0x35')],_0x4e1113['filters']));if(_0x30132b[_0x7e96('0x35')][_0x7e96('0x42')]){_0x3e1789[_0x7e96('0x40')]=_[_0x7e96('0x41')](_0x3e1789[_0x7e96('0x40')],{'$or':_[_0x7e96('0x34')](_0x3e1789[_0x7e96('0x39')],function(_0x5bec88){var _0x3bbc3c={};_0x3bbc3c[_0x5bec88]={'$like':'%'+_0x30132b[_0x7e96('0x35')][_0x7e96('0x42')]+'%'};return _0x3bbc3c;})});}_0x3e1789=_[_0x7e96('0x41')]({},_0x3e1789,_0x30132b['options']);return _0x43ec0c['getIntervals'](_0x3e1789);}})[_0x7e96('0x27')](function(_0x1a02e6){if(_0x1a02e6){_0x49cdb9=_0x1a02e6['length'];if(!_0x30132b[_0x7e96('0x35')][_0x7e96('0x57')](_0x7e96('0x3c'))){_0x3e1789[_0x7e96('0x20')]=qs[_0x7e96('0x20')](_0x30132b[_0x7e96('0x35')][_0x7e96('0x20')]);_0x3e1789[_0x7e96('0x1d')]=qs[_0x7e96('0x1d')](_0x30132b[_0x7e96('0x35')]['offset']);}return _0x43ec0c[_0x7e96('0x55')](_0x3e1789);}})[_0x7e96('0x27')](function(_0x335c8e){if(_0x335c8e){return _0x335c8e?{'count':_0x49cdb9,'rows':_0x335c8e}:null;}})[_0x7e96('0x27')](respondWithResult(_0x1f13c5,null))['catch'](handleError(_0x1f13c5,null));};exports[_0x7e96('0x58')]=function(_0x124679,_0x28da4d,_0x164cae){return db[_0x7e96('0x2f')]['findOne']({'where':{'id':_0x124679[_0x7e96('0x48')]['id']}})[_0x7e96('0x27')](handleEntityNotFound(_0x28da4d,null))[_0x7e96('0x27')](function(_0xa760cb){if(_0xa760cb){return db['sequelize'][_0x7e96('0x59')](function(_0x5dd478){return db['Interval'][_0x7e96('0x28')]({'where':{'IntervalId':_0x124679[_0x7e96('0x48')]['id']},'transaction':_0x5dd478})['then'](function(_0x4d73c5){var _0x243a03=_[_0x7e96('0x34')](_0x124679[_0x7e96('0x4b')],function(_0x47dd83){delete _0x47dd83['id'];_0x47dd83[_0x7e96('0x54')]=_0x124679['params']['id'];return _0x47dd83;});return db['Interval'][_0x7e96('0x5a')](_0x243a03,{'transaction':_0x5dd478});});})[_0x7e96('0x27')](function(){return db[_0x7e96('0x2f')]['findAll']({'where':{'IntervalId':_0x124679[_0x7e96('0x48')]['id']}});});}})[_0x7e96('0x27')](respondWithResult(_0x28da4d,null))['catch'](handleError(_0x28da4d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index f799e22..17eedb6 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 _0xf46a=['string','getIntervals','all','map','ifTime','then','reduce','./interval.attributes','../../utils/iftime','exports','define','rewrite','interval'];(function(_0xa1e9a4,_0x30d157){var _0x3a7070=function(_0x52156f){while(--_0x52156f){_0xa1e9a4['push'](_0xa1e9a4['shift']());}};_0x3a7070(++_0x30d157);}(_0xf46a,0xfe));var _0xaf46=function(_0x1c086a,_0x454ce9){_0x1c086a=_0x1c086a-0x0;var _0x82a639=_0xf46a[_0x1c086a];return _0x82a639;};'use strict';var attributes=require(_0xaf46('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xaf46('0x1'))['iftime'];module[_0xaf46('0x2')]=function(_0x5778a7){return _0x5778a7[_0xaf46('0x3')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f3277){extensions[_0xaf46('0x4')](_0x5778a7,_0x4f3277);},'afterBulkCreate':function(_0x591535,_0x48d885,_0x3dda84){_0x3dda84();extensions[_0xaf46('0x4')](_0x5778a7,_0x591535[0x0]);},'afterUpdate':function(_0x34b567){extensions['rewrite'](_0x5778a7,_0x34b567);},'afterDestroy':function(_0xce334e){extensions['rewrite'](_0x5778a7,_0xce334e);}},'instanceMethods':{'ifTime':function(_0x20251b=undefined,_0x5bff78=new Date()){if(typeof this[_0xaf46('0x5')]===_0xaf46('0x6')){return iftime(this[_0xaf46('0x5')],_0x20251b,_0x5bff78);}else{return this[_0xaf46('0x7')]()['then'](function(_0x44b5a3){return Promise[_0xaf46('0x8')](_0x44b5a3[_0xaf46('0x9')](function(_0x220b13){return _0x220b13[_0xaf46('0xa')](_0x20251b,_0x5bff78);}));})[_0xaf46('0xb')](function(_0x5ca538){return _0x5ca538[_0xaf46('0xc')](function(_0x395040,_0x46440e){return _0x395040||_0x46440e;},![]);});}}}});}; \ No newline at end of file +var _0x1ae3=['rewrite','string','interval','getIntervals','then','all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval'];(function(_0x342967,_0x176fd7){var _0x393b7e=function(_0x5409f4){while(--_0x5409f4){_0x342967['push'](_0x342967['shift']());}};_0x393b7e(++_0x176fd7);}(_0x1ae3,0x13c));var _0x31ae=function(_0x1972c3,_0x3c3ccf){_0x1972c3=_0x1972c3-0x0;var _0x4c5de1=_0x1ae3[_0x1972c3];return _0x4c5de1;};'use strict';var attributes=require(_0x31ae('0x0'));var extensions=require(_0x31ae('0x1'));var iftime=require(_0x31ae('0x2'))['iftime'];module[_0x31ae('0x3')]=function(_0x28b0d4){return _0x28b0d4[_0x31ae('0x4')](_0x31ae('0x5'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cbf12){extensions[_0x31ae('0x6')](_0x28b0d4,_0x5cbf12);},'afterBulkCreate':function(_0x4b4077,_0x56f620,_0x71be72){_0x71be72();extensions[_0x31ae('0x6')](_0x28b0d4,_0x4b4077[0x0]);},'afterUpdate':function(_0x377524){extensions[_0x31ae('0x6')](_0x28b0d4,_0x377524);},'afterDestroy':function(_0x14115f){extensions[_0x31ae('0x6')](_0x28b0d4,_0x14115f);}},'instanceMethods':{'ifTime':function(_0x4c21d6=undefined,_0x2b6aed=new Date()){if(typeof this['interval']===_0x31ae('0x7')){return iftime(this[_0x31ae('0x8')],_0x4c21d6,_0x2b6aed);}else{return this[_0x31ae('0x9')]()[_0x31ae('0xa')](function(_0xe95e3c){return Promise[_0x31ae('0xb')](_0xe95e3c['map'](function(_0x1b5da7){return _0x1b5da7[_0x31ae('0xc')](_0x4c21d6,_0x2b6aed);}));})['then'](function(_0x145a63){return _0x145a63[_0x31ae('0xd')](function(_0x22b97e,_0x3cec81){return _0x22b97e||_0x3cec81;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 5e46a3b..fcc04a4 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 _0x3f75=['../../mysqldb','../../utils/iftime','rpc','GetInterval','Interval','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','catch','error','message','find','ShowInterval','stringify','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','lodash','util'];(function(_0x5b8df6,_0x3afca6){var _0x234e78=function(_0x25fc14){while(--_0x25fc14){_0x5b8df6['push'](_0x5b8df6['shift']());}};_0x234e78(++_0x3afca6);}(_0x3f75,0x11d));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x53f7('0x0'));var util=require(_0x53f7('0x1'));var db=require(_0x53f7('0x2'))['db'];var iftime=require(_0x53f7('0x3'))['iftime'];var logger=require('../../config/logger')(_0x53f7('0x4'));exports[_0x53f7('0x5')]=function(_0x2933f7){var _0x12ce96=this;return new Promise(function(_0x2254cf,_0x4dc39c){return db[_0x53f7('0x6')][_0x53f7('0x7')]({'raw':_0x2933f7[_0x53f7('0x8')]?_0x2933f7[_0x53f7('0x8')][_0x53f7('0x9')]===undefined?!![]:![]:!![],'where':_0x2933f7[_0x53f7('0x8')]?_0x2933f7['options'][_0x53f7('0xa')]||null:null,'attributes':_0x2933f7[_0x53f7('0x8')]?_0x2933f7['options']['attributes']||null:null,'limit':_0x2933f7[_0x53f7('0x8')]?_0x2933f7[_0x53f7('0x8')][_0x53f7('0xb')]||null:null,'include':_0x2933f7['options']?_0x2933f7['options'][_0x53f7('0xc')]?_[_0x53f7('0xd')](_0x2933f7['options'][_0x53f7('0xc')],function(_0x48bd09){return{'model':db[_0x48bd09[_0x53f7('0xe')]],'as':_0x48bd09['as'],'attributes':_0x48bd09['attributes'],'include':_0x48bd09[_0x53f7('0xc')]?_[_0x53f7('0xd')](_0x48bd09[_0x53f7('0xc')],function(_0x397322){return{'model':db[_0x397322[_0x53f7('0xe')]],'as':_0x397322['as'],'attributes':_0x397322[_0x53f7('0xf')],'include':_0x397322[_0x53f7('0xc')]?_[_0x53f7('0xd')](_0x397322[_0x53f7('0xc')],function(_0x4782ef){return{'model':db[_0x4782ef['model']],'as':_0x4782ef['as'],'attributes':_0x4782ef[_0x53f7('0xf')]};}):[]};}):[]};}):[]:[]})[_0x53f7('0x10')](function(_0x5684cb){logger[_0x53f7('0x11')](_0x53f7('0x5'),_0x2933f7);logger[_0x53f7('0x12')](_0x53f7('0x5'),_0x2933f7,JSON['stringify'](_0x5684cb));_0x2254cf(_0x5684cb);})[_0x53f7('0x13')](function(_0x152a81){logger[_0x53f7('0x14')](_0x53f7('0x5'),_0x152a81['message'],_0x2933f7);_0x4dc39c(_0x12ce96[_0x53f7('0x14')](0x1f4,_0x152a81[_0x53f7('0x15')]));});});};exports['ShowInterval']=function(_0x2be5da){var _0x3e640c=this;return new Promise(function(_0x577bfb,_0x4eccf3){return db[_0x53f7('0x6')][_0x53f7('0x16')]({'raw':_0x2be5da[_0x53f7('0x8')]?_0x2be5da[_0x53f7('0x8')][_0x53f7('0x9')]===undefined?!![]:![]:!![],'where':_0x2be5da['options']?_0x2be5da[_0x53f7('0x8')][_0x53f7('0xa')]||null:null,'attributes':_0x2be5da[_0x53f7('0x8')]?_0x2be5da[_0x53f7('0x8')]['attributes']||null:null,'include':_0x2be5da[_0x53f7('0x8')]?_0x2be5da[_0x53f7('0x8')][_0x53f7('0xc')]?_[_0x53f7('0xd')](_0x2be5da['options']['include'],function(_0x46bcbe){return{'model':db[_0x46bcbe['model']],'as':_0x46bcbe['as'],'attributes':_0x46bcbe[_0x53f7('0xf')],'include':_0x46bcbe[_0x53f7('0xc')]?_[_0x53f7('0xd')](_0x46bcbe[_0x53f7('0xc')],function(_0x3f8672){return{'model':db[_0x3f8672[_0x53f7('0xe')]],'as':_0x3f8672['as'],'attributes':_0x3f8672['attributes'],'include':_0x3f8672[_0x53f7('0xc')]?_[_0x53f7('0xd')](_0x3f8672[_0x53f7('0xc')],function(_0x5b0503){return{'model':db[_0x5b0503['model']],'as':_0x5b0503['as'],'attributes':_0x5b0503[_0x53f7('0xf')]};}):[]};}):[]};}):[]:[]})[_0x53f7('0x10')](function(_0x559c3d){logger[_0x53f7('0x11')]('ShowInterval',_0x2be5da);logger[_0x53f7('0x12')](_0x53f7('0x17'),_0x2be5da,JSON[_0x53f7('0x18')](_0x559c3d));_0x577bfb(_0x559c3d);})[_0x53f7('0x13')](function(_0x18513b){logger['error'](_0x53f7('0x17'),_0x18513b[_0x53f7('0x15')],_0x2be5da);_0x4eccf3(_0x3e640c[_0x53f7('0x14')](0x1f4,_0x18513b[_0x53f7('0x15')]));});});};function checkArrayOfIntervals(_0x3e9e6a,_0x333420){var _0x4aab13=[];return db[_0x53f7('0x6')][_0x53f7('0x7')]({'where':{'id':_0x3e9e6a}})['then'](function(_0x3bf4f9){_0x4aab13=_0x3bf4f9;return Promise[_0x53f7('0x19')](_0x4aab13['map'](function(_0x274005){return _0x274005[_0x53f7('0x1a')](_0x333420);}));})['then'](function(_0x4b347d){var _0x544049=_0x4b347d['reduce'](function(_0x3145cb,_0x52735f){return _0x3145cb||_0x52735f;},![]);logger[_0x53f7('0x11')](util[_0x53f7('0x1b')](_0x53f7('0x1c'),_0x4aab13[_0x53f7('0xd')](function(_0x90ffdb){return _0x90ffdb[_0x53f7('0x1d')];})[_0x53f7('0x1e')](',\x20'),_0x4aab13[_0x53f7('0xd')](function(_0x4192ee){return _0x4192ee['id'];})[_0x53f7('0x1e')](',\x20')));return _0x544049;});}function checkSingleInterval(_0x3cc935,_0x534611){return db['Interval']['findById'](_0x3cc935)[_0x53f7('0x10')](function(_0x2e54fc){if(_0x2e54fc){logger[_0x53f7('0x11')](util['format'](_0x53f7('0x1f'),_0x2e54fc[_0x53f7('0x1d')],_0x2e54fc['id']));return _0x2e54fc[_0x53f7('0x1a')](_0x534611);}});}exports[_0x53f7('0x20')]=function(_0xe2310c){var _0x1933b2=_0xe2310c['intervalIds'];var _0x7ffec6=Array[_0x53f7('0x21')](_0xe2310c[_0x53f7('0x22')])?_0xe2310c[_0x53f7('0x22')]:typeof _0xe2310c[_0x53f7('0x22')]==='string'?[_0xe2310c[_0x53f7('0x22')]]:[];var _0x25d00f=_0xe2310c[_0x53f7('0x23')]||undefined;var _0xfdd405=![];if(_0x7ffec6[_0x53f7('0x24')]){logger[_0x53f7('0x11')](util[_0x53f7('0x1b')](_0x53f7('0x25'),_0x7ffec6['join'](';\x20')));}if(_0x25d00f){logger[_0x53f7('0x11')](util['format'](_0x53f7('0x26'),_0x25d00f));}logger[_0x53f7('0x12')](_0x53f7('0x27'),_0xfdd405);logger[_0x53f7('0x28')](_0x53f7('0x20'),_0xe2310c);return Promise['resolve']()[_0x53f7('0x10')](function(){if(Array[_0x53f7('0x21')](_0x1933b2)){return checkArrayOfIntervals(_0x1933b2,_0x25d00f);}else if(_0x1933b2){return checkSingleInterval(_0x1933b2,_0x25d00f);}})[_0x53f7('0x10')](function(_0x49bc2d){var _0x1912a8=_0x7ffec6['reduce'](function(_0x436c3f,_0xb7c41f){return _0x436c3f||iftime(_0xb7c41f,_0x25d00f);},![]);_0xfdd405=_0x49bc2d||_0x1912a8;return _0xfdd405;})[_0x53f7('0x13')](function(_0x1c3017){logger[_0x53f7('0x14')]('IntervalIftime',_0xe2310c,_0x1c3017);throw this[_0x53f7('0x14')](0x1f4,_0x1c3017[_0x53f7('0x15')]);});}; \ No newline at end of file +var _0x963e=['debug','catch','message','error','ShowInterval','Interval','find','stringify','all','ifTime','info','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','reduce','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','findAll','raw','options','attributes','include','map','model','then'];(function(_0x36ce12,_0x154d21){var _0x21b6fe=function(_0x34b421){while(--_0x34b421){_0x36ce12['push'](_0x36ce12['shift']());}};_0x21b6fe(++_0x154d21);}(_0x963e,0xc8));var _0xe963=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x963e[_0xdd827a];return _0x2f46f1;};'use strict';var _=require(_0xe963('0x0'));var util=require(_0xe963('0x1'));var db=require(_0xe963('0x2'))['db'];var iftime=require(_0xe963('0x3'))['iftime'];var logger=require(_0xe963('0x4'))(_0xe963('0x5'));exports[_0xe963('0x6')]=function(_0x5643b4){var _0x58b205=this;return new Promise(function(_0x42342c,_0x5248c5){return db['Interval'][_0xe963('0x7')]({'raw':_0x5643b4['options']?_0x5643b4['options'][_0xe963('0x8')]===undefined?!![]:![]:!![],'where':_0x5643b4[_0xe963('0x9')]?_0x5643b4['options']['where']||null:null,'attributes':_0x5643b4['options']?_0x5643b4['options'][_0xe963('0xa')]||null:null,'limit':_0x5643b4[_0xe963('0x9')]?_0x5643b4[_0xe963('0x9')]['limit']||null:null,'include':_0x5643b4['options']?_0x5643b4[_0xe963('0x9')][_0xe963('0xb')]?_[_0xe963('0xc')](_0x5643b4[_0xe963('0x9')][_0xe963('0xb')],function(_0x1a66dc){return{'model':db[_0x1a66dc[_0xe963('0xd')]],'as':_0x1a66dc['as'],'attributes':_0x1a66dc['attributes'],'include':_0x1a66dc[_0xe963('0xb')]?_[_0xe963('0xc')](_0x1a66dc[_0xe963('0xb')],function(_0xe0ee98){return{'model':db[_0xe0ee98[_0xe963('0xd')]],'as':_0xe0ee98['as'],'attributes':_0xe0ee98['attributes'],'include':_0xe0ee98[_0xe963('0xb')]?_['map'](_0xe0ee98['include'],function(_0x25fb86){return{'model':db[_0x25fb86[_0xe963('0xd')]],'as':_0x25fb86['as'],'attributes':_0x25fb86[_0xe963('0xa')]};}):[]};}):[]};}):[]:[]})[_0xe963('0xe')](function(_0x7cce04){logger['info'](_0xe963('0x6'),_0x5643b4);logger[_0xe963('0xf')](_0xe963('0x6'),_0x5643b4,JSON['stringify'](_0x7cce04));_0x42342c(_0x7cce04);})[_0xe963('0x10')](function(_0x3e3d89){logger['error'](_0xe963('0x6'),_0x3e3d89[_0xe963('0x11')],_0x5643b4);_0x5248c5(_0x58b205[_0xe963('0x12')](0x1f4,_0x3e3d89[_0xe963('0x11')]));});});};exports[_0xe963('0x13')]=function(_0x330e26){var _0x2820ce=this;return new Promise(function(_0x258e38,_0x5dcf8d){return db[_0xe963('0x14')][_0xe963('0x15')]({'raw':_0x330e26['options']?_0x330e26[_0xe963('0x9')][_0xe963('0x8')]===undefined?!![]:![]:!![],'where':_0x330e26[_0xe963('0x9')]?_0x330e26[_0xe963('0x9')]['where']||null:null,'attributes':_0x330e26[_0xe963('0x9')]?_0x330e26[_0xe963('0x9')][_0xe963('0xa')]||null:null,'include':_0x330e26['options']?_0x330e26[_0xe963('0x9')][_0xe963('0xb')]?_['map'](_0x330e26['options'][_0xe963('0xb')],function(_0x3b0338){return{'model':db[_0x3b0338['model']],'as':_0x3b0338['as'],'attributes':_0x3b0338[_0xe963('0xa')],'include':_0x3b0338[_0xe963('0xb')]?_[_0xe963('0xc')](_0x3b0338[_0xe963('0xb')],function(_0x1a3c2f){return{'model':db[_0x1a3c2f[_0xe963('0xd')]],'as':_0x1a3c2f['as'],'attributes':_0x1a3c2f[_0xe963('0xa')],'include':_0x1a3c2f['include']?_[_0xe963('0xc')](_0x1a3c2f[_0xe963('0xb')],function(_0x569a92){return{'model':db[_0x569a92[_0xe963('0xd')]],'as':_0x569a92['as'],'attributes':_0x569a92[_0xe963('0xa')]};}):[]};}):[]};}):[]:[]})[_0xe963('0xe')](function(_0x74e76b){logger['info'](_0xe963('0x13'),_0x330e26);logger[_0xe963('0xf')](_0xe963('0x13'),_0x330e26,JSON[_0xe963('0x16')](_0x74e76b));_0x258e38(_0x74e76b);})[_0xe963('0x10')](function(_0x1bed72){logger[_0xe963('0x12')](_0xe963('0x13'),_0x1bed72['message'],_0x330e26);_0x5dcf8d(_0x2820ce[_0xe963('0x12')](0x1f4,_0x1bed72[_0xe963('0x11')]));});});};function checkArrayOfIntervals(_0x2c8626,_0xe9441){var _0x39e107=[];return db['Interval'][_0xe963('0x7')]({'where':{'id':_0x2c8626}})[_0xe963('0xe')](function(_0x32d474){_0x39e107=_0x32d474;return Promise[_0xe963('0x17')](_0x39e107['map'](function(_0x4b25f9){return _0x4b25f9[_0xe963('0x18')](_0xe9441);}));})[_0xe963('0xe')](function(_0x1f0b5c){var _0x13a984=_0x1f0b5c['reduce'](function(_0x7cd005,_0x2edb14){return _0x7cd005||_0x2edb14;},![]);logger[_0xe963('0x19')](util[_0xe963('0x1a')](_0xe963('0x1b'),_0x39e107[_0xe963('0xc')](function(_0x37f116){return _0x37f116[_0xe963('0x1c')];})[_0xe963('0x1d')](',\x20'),_0x39e107[_0xe963('0xc')](function(_0x4dd462){return _0x4dd462['id'];})[_0xe963('0x1d')](',\x20')));return _0x13a984;});}function checkSingleInterval(_0x5074af,_0x5dfe07){return db['Interval'][_0xe963('0x1e')](_0x5074af)[_0xe963('0xe')](function(_0xe12b8b){if(_0xe12b8b){logger[_0xe963('0x19')](util[_0xe963('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0xe12b8b[_0xe963('0x1c')],_0xe12b8b['id']));return _0xe12b8b[_0xe963('0x18')](_0x5dfe07);}});}exports['IntervalIftime']=function(_0x286d32){var _0x43f0fa=_0x286d32[_0xe963('0x1f')];var _0x314bc0=Array['isArray'](_0x286d32[_0xe963('0x20')])?_0x286d32[_0xe963('0x20')]:typeof _0x286d32[_0xe963('0x20')]===_0xe963('0x21')?[_0x286d32[_0xe963('0x20')]]:[];var _0x16e902=_0x286d32[_0xe963('0x22')]||undefined;var _0x574a20=![];if(_0x314bc0[_0xe963('0x23')]){logger[_0xe963('0x19')](util[_0xe963('0x1a')](_0xe963('0x24'),_0x314bc0[_0xe963('0x1d')](';\x20')));}if(_0x16e902){logger[_0xe963('0x19')](util[_0xe963('0x1a')](_0xe963('0x25'),_0x16e902));}logger['debug'](_0xe963('0x26'),_0x574a20);logger[_0xe963('0x27')]('IntervalIftime',_0x286d32);return Promise[_0xe963('0x28')]()[_0xe963('0xe')](function(){if(Array[_0xe963('0x29')](_0x43f0fa)){return checkArrayOfIntervals(_0x43f0fa,_0x16e902);}else if(_0x43f0fa){return checkSingleInterval(_0x43f0fa,_0x16e902);}})['then'](function(_0x131b57){var _0x3c3d14=_0x314bc0[_0xe963('0x2a')](function(_0x303d75,_0x3efb93){return _0x303d75||iftime(_0x3efb93,_0x16e902);},![]);_0x574a20=_0x131b57||_0x3c3d14;return _0x574a20;})['catch'](function(_0x550749){logger[_0xe963('0x12')]('IntervalIftime',_0x286d32,_0x550749);throw this[_0xe963('0x12')](0x1f4,_0x550749['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index a3d4a1b..11e8470 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3dd35c,_0x43acac){_0x3dd35c=_0x3dd35c-0x0;var _0x4417eb=_0x5f2f[_0x3dd35c];return _0x4417eb;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x576fcf,_0x5a3eea){var _0x2dfbd3=function(_0x1944d4){while(--_0x1944d4){_0x576fcf['push'](_0x576fcf['shift']());}};_0x2dfbd3(++_0x5a3eea);}(_0x2032,0xd9));var _0x2203=function(_0x3f395c,_0x2dcc26){_0x3f395c=_0x3f395c-0x0;var _0xfe2611=_0x2032[_0x3f395c];return _0xfe2611;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index a639f8a..3bc82ab 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 _0xab98=['connection','remoteAddress','socket','body','bluebird','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','data','end','status','json','api.jira','openIssue','send','headers','x-forwarded-for'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xab98,0x19e));var _0x8ab9=function(_0x1cd916,_0x333f5c){_0x1cd916=_0x1cd916-0x0;var _0x1ff07a=_0xab98[_0x1cd916];return _0x1ff07a;};'use strict';var BPromise=require(_0x8ab9('0x0'));var https=require(_0x8ab9('0x1'));var logger=require(_0x8ab9('0x2'))('api');var USERNAME=_0x8ab9('0x3');var PASSWORD=_0x8ab9('0x4');function openIssue(_0x216a9b,_0x500d1e){var _0x33a23d={'fields':{'project':{'key':_0x216a9b['key']||_0x8ab9('0x5')},'summary':(_0x216a9b['summary']||'Report')+'\x20from\x20'+_0x216a9b['ip'],'description':_0x216a9b[_0x8ab9('0x6')]||JSON[_0x8ab9('0x7')](_0x216a9b),'issuetype':{'name':_0x216a9b[_0x8ab9('0x8')]||_0x8ab9('0x9')}}};_0x33a23d[_0x8ab9('0xa')][_0x8ab9('0xb')]=_0x216a9b[_0x8ab9('0xc')];_0x33a23d[_0x8ab9('0xa')][_0x8ab9('0xd')]=_0x216a9b['oldToken'];_0x33a23d[_0x8ab9('0xa')][_0x8ab9('0xe')]=_0x216a9b['newToken'];_0x33a23d[_0x8ab9('0xa')][_0x8ab9('0xf')]=_0x216a9b[_0x8ab9('0x10')];_0x33a23d[_0x8ab9('0xa')][_0x8ab9('0x11')]=_0x216a9b[_0x8ab9('0x12')];_0x33a23d['fields'][_0x8ab9('0x13')]=_0x216a9b['ip'];var _0x246dc9={'host':_0x8ab9('0x14'),'port':0x1bb,'path':_0x8ab9('0x15'),'method':_0x8ab9('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x8ab9('0x17'),'Authorization':_0x8ab9('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x8ab9('0x19')]('base64')}};var _0x3c5b7d=JSON['stringify'](_0x33a23d);var _0x39dee4=https[_0x8ab9('0x1a')](_0x246dc9,function(_0x437c6){_0x437c6[_0x8ab9('0x1b')]('utf8');var _0x3aaa6d='';_0x437c6['on'](_0x8ab9('0x1c'),function(_0x1cf240){_0x3aaa6d+=_0x1cf240;});_0x437c6['on'](_0x8ab9('0x1d'),function(){if(_0x500d1e){return _0x500d1e[_0x8ab9('0x1e')](_0x437c6['statusCode'])[_0x8ab9('0x1f')](JSON['parse'](_0x3aaa6d));}});});_0x39dee4['on']('error',function(_0x21dfd6){if(_0x500d1e){return _0x500d1e[_0x8ab9('0x1e')](0x1f4)[_0x8ab9('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x8ab9('0x20')}]});}});_0x39dee4['write'](_0x3c5b7d);_0x39dee4[_0x8ab9('0x1d')]();}exports[_0x8ab9('0x21')]=openIssue;exports[_0x8ab9('0x22')]=function(_0x3598d2,_0x245fcc){_0x3598d2['body']['ip']=_0x3598d2[_0x8ab9('0x23')][_0x8ab9('0x24')]||_0x3598d2[_0x8ab9('0x25')][_0x8ab9('0x26')]||_0x3598d2[_0x8ab9('0x27')][_0x8ab9('0x26')]||_0x3598d2[_0x8ab9('0x25')][_0x8ab9('0x27')][_0x8ab9('0x26')];return openIssue(_0x3598d2[_0x8ab9('0x28')],_0x245fcc);}; \ No newline at end of file +var _0x73e4=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','newToken','customfield_11503','customfield_11504','reason','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','3eAmWpBVP0'];(function(_0x5005ad,_0x2246b6){var _0x4bd986=function(_0x2cab60){while(--_0x2cab60){_0x5005ad['push'](_0x5005ad['shift']());}};_0x4bd986(++_0x2246b6);}(_0x73e4,0x1bd));var _0x473e=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0x73e4[_0x3b085];return _0x476a57;};'use strict';var BPromise=require(_0x473e('0x0'));var https=require(_0x473e('0x1'));var logger=require(_0x473e('0x2'))(_0x473e('0x3'));var USERNAME='support';var PASSWORD=_0x473e('0x4');function openIssue(_0x2f4a90,_0x536e75){var _0x4a4a95={'fields':{'project':{'key':_0x2f4a90[_0x473e('0x5')]||_0x473e('0x6')},'summary':(_0x2f4a90[_0x473e('0x7')]||_0x473e('0x8'))+_0x473e('0x9')+_0x2f4a90['ip'],'description':_0x2f4a90[_0x473e('0xa')]||JSON[_0x473e('0xb')](_0x2f4a90),'issuetype':{'name':_0x2f4a90[_0x473e('0xc')]||_0x473e('0xd')}}};_0x4a4a95[_0x473e('0xe')][_0x473e('0xf')]=_0x2f4a90[_0x473e('0x10')];_0x4a4a95['fields']['customfield_11501']=_0x2f4a90['oldToken'];_0x4a4a95[_0x473e('0xe')]['customfield_11502']=_0x2f4a90[_0x473e('0x11')];_0x4a4a95[_0x473e('0xe')][_0x473e('0x12')]=_0x2f4a90['name'];_0x4a4a95[_0x473e('0xe')][_0x473e('0x13')]=_0x2f4a90[_0x473e('0x14')];_0x4a4a95[_0x473e('0xe')]['customfield_10102']=_0x2f4a90['ip'];var _0x1cf1ba={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x473e('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x473e('0x16'),'Authorization':_0x473e('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x473e('0x18')](_0x473e('0x19'))}};var _0x394d8d=JSON['stringify'](_0x4a4a95);var _0x290250=https[_0x473e('0x1a')](_0x1cf1ba,function(_0x2e8805){_0x2e8805[_0x473e('0x1b')](_0x473e('0x1c'));var _0x59e364='';_0x2e8805['on'](_0x473e('0x1d'),function(_0x90735d){_0x59e364+=_0x90735d;});_0x2e8805['on'](_0x473e('0x1e'),function(){if(_0x536e75){return _0x536e75[_0x473e('0x1f')](_0x2e8805[_0x473e('0x20')])['json'](JSON[_0x473e('0x21')](_0x59e364));}});});_0x290250['on'](_0x473e('0x22'),function(_0xc1c425){if(_0x536e75){return _0x536e75[_0x473e('0x1f')](0x1f4)[_0x473e('0x23')]({'errors':[{'message':_0x473e('0x24'),'type':_0x473e('0x25')}]});}});_0x290250['write'](_0x394d8d);_0x290250[_0x473e('0x1e')]();}exports[_0x473e('0x26')]=openIssue;exports[_0x473e('0x27')]=function(_0x3f484d,_0x95f2b0){_0x3f484d['body']['ip']=_0x3f484d['headers'][_0x473e('0x28')]||_0x3f484d[_0x473e('0x29')][_0x473e('0x2a')]||_0x3f484d[_0x473e('0x2b')][_0x473e('0x2a')]||_0x3f484d[_0x473e('0x29')]['socket'][_0x473e('0x2a')];return openIssue(_0x3f484d[_0x473e('0x2c')],_0x95f2b0);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f46fcf8..a7c31c0 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 _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x3f363f,_0x999bb1){var _0x30e2fb=function(_0x2a2ead){while(--_0x2a2ead){_0x3f363f['push'](_0x3f363f['shift']());}};_0x30e2fb(++_0x999bb1);}(_0xf4eb,0xec));var _0xbf4e=function(_0x41ff5c,_0x356a2a){_0x41ff5c=_0x41ff5c-0x0;var _0x1ff26e=_0xf4eb[_0x41ff5c];return _0x1ff26e;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file +var _0xe14d=['isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x14a281,_0x4adfbe){var _0x4c9192=function(_0x2bae4f){while(--_0x2bae4f){_0x14a281['push'](_0x14a281['shift']());}};_0x4c9192(++_0x4adfbe);}(_0xe14d,0x1ee));var _0xde14=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xe14d[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/describe',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0xf')]('/',auth[_0xde14('0xa')](),controller['create']);router[_0xde14('0x10')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x11')]);router[_0xde14('0x12')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 28dab83..6a2c03a 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(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0x51c129,_0x4322a6){_0x51c129=_0x51c129-0x0;var _0x4cefae=_0x7a54[_0x51c129];return _0x4cefae;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x4568c5,_0x33a3dc){_0x4568c5=_0x4568c5-0x0;var _0x50b698=_0x7a54[_0x4568c5];return _0x50b698;};'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 1e708a5..fa8f9cd 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 _0x363e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3d0400,_0x1347ce){var _0x160d5c=function(_0x14a0cf){while(--_0x14a0cf){_0x3d0400['push'](_0x3d0400['shift']());}};_0x160d5c(++_0x1347ce);}(_0x363e,0x179));var _0xe363=function(_0x544824,_0x42c4fd){_0x544824=_0x544824-0x0;var _0x47c58f=_0x363e[_0x544824];return _0x47c58f;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['JscriptyAnswerReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));}; \ No newline at end of file +var _0x3bd7=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','params','create','update','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','to-csv'];(function(_0x1c3c8f,_0x56b144){var _0x581a1a=function(_0x516c52){while(--_0x516c52){_0x1c3c8f['push'](_0x1c3c8f['shift']());}};_0x581a1a(++_0x56b144);}(_0x3bd7,0x199));var _0x73bd=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x3bd7[_0x149a9b];return _0x2c2bf6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73bd('0x0'));var jsonpatch=require(_0x73bd('0x1'));var rp=require(_0x73bd('0x2'));var moment=require('moment');var BPromise=require(_0x73bd('0x3'));var Mustache=require(_0x73bd('0x4'));var util=require(_0x73bd('0x5'));var path=require('path');var sox=require(_0x73bd('0x6'));var csv=require('to-csv');var ejs=require(_0x73bd('0x7'));var fs=require('fs');var fs_extra=require(_0x73bd('0x8'));var _=require('lodash');var squel=require(_0x73bd('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x73bd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73bd('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x73bd('0xc'));var as=require(_0x73bd('0xd'));var hardwareService=require(_0x73bd('0xe'));var logger=require(_0x73bd('0xf'))(_0x73bd('0x10'));var utils=require(_0x73bd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x73bd('0x12'));var db=require(_0x73bd('0x13'))['db'];function respondWithStatusCode(_0x31c882,_0x41f324){_0x41f324=_0x41f324||0xcc;return function(_0x2a5dea){if(_0x2a5dea){return _0x31c882[_0x73bd('0x14')](_0x41f324);}return _0x31c882['status'](_0x41f324)[_0x73bd('0x15')]();};}function respondWithResult(_0x5c4bc8,_0x189007){_0x189007=_0x189007||0xc8;return function(_0x3eab86){if(_0x3eab86){return _0x5c4bc8[_0x73bd('0x16')](_0x189007)[_0x73bd('0x17')](_0x3eab86);}};}function respondWithFilteredResult(_0x3e628a,_0x5ea8db){return function(_0x41663e){if(_0x41663e){var _0xfdf66=typeof _0x5ea8db[_0x73bd('0x18')]===_0x73bd('0x19')&&typeof _0x5ea8db[_0x73bd('0x1a')]===_0x73bd('0x19');var _0x10e371=_0x41663e[_0x73bd('0x1b')];var _0x21787b=_0xfdf66?0x0:_0x5ea8db['offset'];var _0x1e559b=_0xfdf66?_0x41663e[_0x73bd('0x1b')]:_0x5ea8db[_0x73bd('0x18')]+_0x5ea8db[_0x73bd('0x1a')];var _0x1cb0e3;if(_0x1e559b>=_0x10e371){_0x1e559b=_0x10e371;_0x1cb0e3=0xc8;}else{_0x1cb0e3=0xce;}_0x3e628a[_0x73bd('0x16')](_0x1cb0e3);return _0x3e628a[_0x73bd('0x1c')](_0x73bd('0x1d'),_0x21787b+'-'+_0x1e559b+'/'+_0x10e371)[_0x73bd('0x17')](_0x41663e);}return null;};}function patchUpdates(_0x57d1ec){return function(_0x459965){try{jsonpatch[_0x73bd('0x1e')](_0x459965,_0x57d1ec,!![]);}catch(_0x292f8c){return BPromise['reject'](_0x292f8c);}return _0x459965['save']();};}function saveUpdates(_0x4f23e6,_0x10b388){return function(_0x269e84){if(_0x269e84){return _0x269e84['update'](_0x4f23e6)[_0x73bd('0x1f')](function(_0x22574c){return _0x22574c;});}return null;};}function removeEntity(_0x5b7bbb,_0x325cc1){return function(_0x1e22c5){if(_0x1e22c5){return _0x1e22c5[_0x73bd('0x20')]()[_0x73bd('0x1f')](function(){_0x5b7bbb[_0x73bd('0x16')](0xcc)[_0x73bd('0x15')]();});}};}function handleEntityNotFound(_0x2dd70b,_0x36f7e0){return function(_0x840215){if(!_0x840215){_0x2dd70b[_0x73bd('0x14')](0x194);}return _0x840215;};}function handleError(_0x473527,_0x388698){_0x388698=_0x388698||0x1f4;return function(_0x52e910){logger['error'](_0x52e910[_0x73bd('0x21')]);if(_0x52e910[_0x73bd('0x22')]){delete _0x52e910['name'];}_0x473527[_0x73bd('0x16')](_0x388698)[_0x73bd('0x23')](_0x52e910);};}exports[_0x73bd('0x24')]=function(_0x5ada8d,_0x5ae04e){var _0x2f38fe={},_0x3f15f8={},_0x315318={'count':0x0,'rows':[]};var _0x5be8d6=_[_0x73bd('0x25')](db['JscriptyAnswerReport'][_0x73bd('0x26')],function(_0x2701da){return{'name':_0x2701da['fieldName'],'type':_0x2701da['type'][_0x73bd('0x27')]};});_0x3f15f8[_0x73bd('0x28')]=_[_0x73bd('0x25')](_0x5be8d6,_0x73bd('0x22'));_0x3f15f8['query']=_[_0x73bd('0x29')](_0x5ada8d['query']);_0x3f15f8[_0x73bd('0x2a')]=_[_0x73bd('0x2b')](_0x3f15f8[_0x73bd('0x28')],_0x3f15f8[_0x73bd('0x2c')]);_0x2f38fe['attributes']=_[_0x73bd('0x2b')](_0x3f15f8[_0x73bd('0x28')],qs[_0x73bd('0x2d')](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x2d')]));_0x2f38fe[_0x73bd('0x2e')]=_0x2f38fe[_0x73bd('0x2e')][_0x73bd('0x2f')]?_0x2f38fe['attributes']:_0x3f15f8[_0x73bd('0x28')];if(!_0x5ada8d[_0x73bd('0x2c')]['hasOwnProperty'](_0x73bd('0x30'))){_0x2f38fe[_0x73bd('0x1a')]=qs['limit'](_0x5ada8d[_0x73bd('0x2c')]['limit']);_0x2f38fe[_0x73bd('0x18')]=qs['offset'](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x18')]);}_0x2f38fe[_0x73bd('0x31')]=qs[_0x73bd('0x32')](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x32')]);_0x2f38fe[_0x73bd('0x33')]=qs['filters'](_[_0x73bd('0x34')](_0x5ada8d[_0x73bd('0x2c')],_0x3f15f8['filters']),_0x5be8d6);if(_0x5ada8d[_0x73bd('0x2c')]['filter']){_0x2f38fe[_0x73bd('0x33')]=_[_0x73bd('0x35')](_0x2f38fe[_0x73bd('0x33')],{'$or':_[_0x73bd('0x25')](_0x5be8d6,function(_0x367597){if(_0x367597['type']!==_0x73bd('0x36')){var _0x2de851={};_0x2de851[_0x367597[_0x73bd('0x22')]]={'$like':'%'+_0x5ada8d['query'][_0x73bd('0x37')]+'%'};return _0x2de851;}})});}_0x2f38fe=_[_0x73bd('0x35')]({},_0x2f38fe,_0x5ada8d[_0x73bd('0x38')]);var _0x30e148={'where':_0x2f38fe[_0x73bd('0x33')]};return db[_0x73bd('0x39')][_0x73bd('0x1b')](_0x30e148)[_0x73bd('0x1f')](function(_0x519c3c){_0x315318[_0x73bd('0x1b')]=_0x519c3c;if(_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x3a')]){_0x2f38fe[_0x73bd('0x3b')]=[{'all':!![]}];}return db[_0x73bd('0x39')][_0x73bd('0x3c')](_0x2f38fe);})[_0x73bd('0x1f')](function(_0x48fed7){_0x315318[_0x73bd('0x3d')]=_0x48fed7;return _0x315318;})[_0x73bd('0x1f')](respondWithFilteredResult(_0x5ae04e,_0x2f38fe))[_0x73bd('0x3e')](handleError(_0x5ae04e,null));};exports[_0x73bd('0x3f')]=function(_0x532afd,_0x142532){var _0x234de7={'raw':!![],'where':{'id':_0x532afd[_0x73bd('0x40')]['id']}},_0xe91596={};_0xe91596[_0x73bd('0x28')]=_['keys'](db[_0x73bd('0x39')]['rawAttributes']);_0xe91596[_0x73bd('0x2c')]=_['keys'](_0x532afd[_0x73bd('0x2c')]);_0xe91596[_0x73bd('0x2a')]=_['intersection'](_0xe91596[_0x73bd('0x28')],_0xe91596[_0x73bd('0x2c')]);_0x234de7[_0x73bd('0x2e')]=_[_0x73bd('0x2b')](_0xe91596[_0x73bd('0x28')],qs['fields'](_0x532afd[_0x73bd('0x2c')][_0x73bd('0x2d')]));_0x234de7[_0x73bd('0x2e')]=_0x234de7[_0x73bd('0x2e')][_0x73bd('0x2f')]?_0x234de7[_0x73bd('0x2e')]:_0xe91596[_0x73bd('0x28')];if(_0x532afd[_0x73bd('0x2c')]['includeAll']){_0x234de7['include']=[{'all':!![]}];}_0x234de7=_[_0x73bd('0x35')]({},_0x234de7,_0x532afd[_0x73bd('0x38')]);return db[_0x73bd('0x39')]['find'](_0x234de7)[_0x73bd('0x1f')](handleEntityNotFound(_0x142532,null))['then'](respondWithResult(_0x142532,null))[_0x73bd('0x3e')](handleError(_0x142532,null));};exports[_0x73bd('0x41')]=function(_0x57df9e,_0x4905a4){return db['JscriptyAnswerReport'][_0x73bd('0x41')](_0x57df9e['body'],{})[_0x73bd('0x1f')](respondWithResult(_0x4905a4,0xc9))['catch'](handleError(_0x4905a4,null));};exports[_0x73bd('0x42')]=function(_0x1e2e28,_0x7b4baf){if(_0x1e2e28[_0x73bd('0x43')]['id']){delete _0x1e2e28['body']['id'];}return db[_0x73bd('0x39')][_0x73bd('0x44')]({'where':{'id':_0x1e2e28[_0x73bd('0x40')]['id']}})[_0x73bd('0x1f')](handleEntityNotFound(_0x7b4baf,null))[_0x73bd('0x1f')](saveUpdates(_0x1e2e28[_0x73bd('0x43')],null))[_0x73bd('0x1f')](respondWithResult(_0x7b4baf,null))[_0x73bd('0x3e')](handleError(_0x7b4baf,null));};exports['destroy']=function(_0x8b88f5,_0x47397d){return db['JscriptyAnswerReport'][_0x73bd('0x44')]({'where':{'id':_0x8b88f5[_0x73bd('0x40')]['id']}})[_0x73bd('0x1f')](handleEntityNotFound(_0x47397d,null))['then'](removeEntity(_0x47397d,null))[_0x73bd('0x3e')](handleError(_0x47397d,null));};exports[_0x73bd('0x45')]=function(_0x23b5ad,_0x2201c7){return db[_0x73bd('0x39')]['describe']()['then'](respondWithResult(_0x2201c7,null))['catch'](handleError(_0x2201c7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4bcb944..5eac26f 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 _0xd04e=['util','api','moment','bluebird','request-promise','rimraf','exports','define','JscriptyAnswerReport','lodash'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0xd04e,0x1f3));var _0xed04=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd04e[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xed04('0x0'));var util=require(_0xed04('0x1'));var logger=require('../../config/logger')(_0xed04('0x2'));var moment=require(_0xed04('0x3'));var BPromise=require(_0xed04('0x4'));var rp=require(_0xed04('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed04('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0xed04('0x7')]=function(_0x290efa,_0x451d54){return _0x290efa[_0xed04('0x8')](_0xed04('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2359=['../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x46d031,_0x5002fa){var _0x5262e2=function(_0x384c2a){while(--_0x384c2a){_0x46d031['push'](_0x46d031['shift']());}};_0x5262e2(++_0x5002fa);}(_0x2359,0x17e));var _0x9235=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2359[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x9235('0x0'));var util=require(_0x9235('0x1'));var logger=require(_0x9235('0x2'))(_0x9235('0x3'));var moment=require('moment');var BPromise=require(_0x9235('0x4'));var rp=require(_0x9235('0x5'));var fs=require('fs');var path=require(_0x9235('0x6'));var rimraf=require(_0x9235('0x7'));var config=require(_0x9235('0x8'));var attributes=require(_0x9235('0x9'));module[_0x9235('0xa')]=function(_0x5c38a3,_0x7fbf34){return _0x5c38a3['define'](_0x9235('0xb'),attributes,{'tableName':_0x9235('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index ec16a5d..89ab96a 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 _0x049c=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x96ab8f,_0x549a90){var _0x123b8a=function(_0x381f3f){while(--_0x381f3f){_0x96ab8f['push'](_0x96ab8f['shift']());}};_0x123b8a(++_0x549a90);}(_0x049c,0x7f));var _0xc049=function(_0x3c694f,_0x57c1f9){_0x3c694f=_0x3c694f-0x0;var _0x3fd06e=_0x049c[_0x3c694f];return _0x3fd06e;};'use strict';var _=require(_0xc049('0x0'));var util=require(_0xc049('0x1'));var moment=require('moment');var BPromise=require(_0xc049('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc049('0x3'));var db=require(_0xc049('0x4'))['db'];var utils=require(_0xc049('0x5'));var logger=require(_0xc049('0x6'))(_0xc049('0x7'));var config=require(_0xc049('0x8'));var jayson=require(_0xc049('0x9'));var client=jayson['client'][_0xc049('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xffa094,_0x59fa79,_0xe3d581){return new BPromise(function(_0x5799ad,_0x226e5b){return client[_0xc049('0xb')](_0xffa094,_0xe3d581)[_0xc049('0xc')](function(_0x5f33cb){logger[_0xc049('0xd')](_0xc049('0xe'),_0x59fa79,_0xc049('0xf'));logger['debug'](_0xc049('0x10'),_0x59fa79,_0xc049('0xf'),JSON['stringify'](_0x5f33cb));if(_0x5f33cb[_0xc049('0x11')]){if(_0x5f33cb[_0xc049('0x11')][_0xc049('0x12')]===0x1f4){logger[_0xc049('0x11')](_0xc049('0xe'),_0x59fa79,_0x5f33cb[_0xc049('0x11')][_0xc049('0x13')]);return _0x226e5b(_0x5f33cb[_0xc049('0x11')][_0xc049('0x13')]);}logger['error'](_0xc049('0xe'),_0x59fa79,_0x5f33cb[_0xc049('0x11')][_0xc049('0x13')]);return _0x5799ad(_0x5f33cb[_0xc049('0x11')][_0xc049('0x13')]);}else{logger[_0xc049('0xd')](_0xc049('0xe'),_0x59fa79,_0xc049('0xf'));_0x5799ad(_0x5f33cb[_0xc049('0x14')]['message']);}})['catch'](function(_0x4b5e39){logger['error'](_0xc049('0xe'),_0x59fa79,_0x4b5e39);_0x226e5b(_0x4b5e39);});});} \ No newline at end of file +var _0x5653=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x7ed191,_0x396eca){var _0x4e2be3=function(_0x833464){while(--_0x833464){_0x7ed191['push'](_0x7ed191['shift']());}};_0x4e2be3(++_0x396eca);}(_0x5653,0xe1));var _0x3565=function(_0x339bf1,_0x59cea5){_0x339bf1=_0x339bf1-0x0;var _0x40c07a=_0x5653[_0x339bf1];return _0x40c07a;};'use strict';var _=require(_0x3565('0x0'));var util=require(_0x3565('0x1'));var moment=require('moment');var BPromise=require(_0x3565('0x2'));var rs=require(_0x3565('0x3'));var fs=require('fs');var Redis=require(_0x3565('0x4'));var db=require(_0x3565('0x5'))['db'];var utils=require(_0x3565('0x6'));var logger=require(_0x3565('0x7'))(_0x3565('0x8'));var config=require(_0x3565('0x9'));var jayson=require(_0x3565('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x71db53,_0x1075f9,_0x30eec8){return new BPromise(function(_0x3d052e,_0x5ece2a){return client[_0x3565('0xb')](_0x71db53,_0x30eec8)['then'](function(_0x32a40d){logger[_0x3565('0xc')](_0x3565('0xd'),_0x1075f9,_0x3565('0xe'));logger[_0x3565('0xf')](_0x3565('0x10'),_0x1075f9,_0x3565('0xe'),JSON[_0x3565('0x11')](_0x32a40d));if(_0x32a40d['error']){if(_0x32a40d[_0x3565('0x12')][_0x3565('0x13')]===0x1f4){logger['error'](_0x3565('0xd'),_0x1075f9,_0x32a40d[_0x3565('0x12')][_0x3565('0x14')]);return _0x5ece2a(_0x32a40d[_0x3565('0x12')][_0x3565('0x14')]);}logger['error'](_0x3565('0xd'),_0x1075f9,_0x32a40d[_0x3565('0x12')][_0x3565('0x14')]);return _0x3d052e(_0x32a40d[_0x3565('0x12')][_0x3565('0x14')]);}else{logger[_0x3565('0xc')](_0x3565('0xd'),_0x1075f9,_0x3565('0xe'));_0x3d052e(_0x32a40d[_0x3565('0x15')][_0x3565('0x14')]);}})[_0x3565('0x16')](function(_0x1ece70){logger[_0x3565('0x12')](_0x3565('0xd'),_0x1075f9,_0x1ece70);_0x5ece2a(_0x1ece70);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 10a984b..fd6c1fe 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 _0xe83c=['./jscriptyProject.controller','isAuthenticated','index','get','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','clone','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2b877e,_0x5927c0){var _0x346651=function(_0x5bc87){while(--_0x5bc87){_0x2b877e['push'](_0x2b877e['shift']());}};_0x346651(++_0x5927c0);}(_0xe83c,0xaa));var _0xce83=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0xe83c[_0x2b9e8a];return _0x520e67;};'use strict';var multer=require(_0xce83('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xce83('0x1'));var express=require(_0xce83('0x2'));var router=express[_0xce83('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xce83('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce83('0x5'));var controller=require(_0xce83('0x6'));router['get']('/',auth[_0xce83('0x7')](),controller[_0xce83('0x8')]);router[_0xce83('0x9')](_0xce83('0xa'),auth[_0xce83('0x7')](),controller['show']);router['get'](_0xce83('0xb'),auth[_0xce83('0x7')](),controller[_0xce83('0xc')]);router[_0xce83('0x9')](_0xce83('0xd'),auth[_0xce83('0x7')](),controller[_0xce83('0xe')]);router[_0xce83('0x9')]('/:id/summary',auth[_0xce83('0x7')](),timeout(_0xce83('0xf')),controller[_0xce83('0x10')]);router[_0xce83('0x11')]('/',auth[_0xce83('0x7')](),controller['create']);router[_0xce83('0x11')]('/:id/clone',auth[_0xce83('0x7')](),controller[_0xce83('0x12')]);router['put'](_0xce83('0xa'),auth[_0xce83('0x7')](),controller[_0xce83('0x13')]);router['delete'](_0xce83('0xa'),auth[_0xce83('0x7')](),controller[_0xce83('0x14')]);module[_0xce83('0x15')]=router; \ No newline at end of file +var _0x387d=['/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0x387d,0x1e8));var _0xd387=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x387d[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xd387('0x0'));var util=require('util');var path=require(_0xd387('0x1'));var timeout=require(_0xd387('0x2'));var express=require(_0xd387('0x3'));var router=express[_0xd387('0x4')]();var fs_extra=require(_0xd387('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd387('0x6'));var config=require(_0xd387('0x7'));var controller=require('./jscriptyProject.controller');router[_0xd387('0x8')]('/',auth[_0xd387('0x9')](),controller['index']);router[_0xd387('0x8')](_0xd387('0xa'),auth[_0xd387('0x9')](),controller[_0xd387('0xb')]);router[_0xd387('0x8')]('/:id/sessions',auth[_0xd387('0x9')](),controller['getSessions']);router[_0xd387('0x8')](_0xd387('0xc'),auth[_0xd387('0x9')](),controller[_0xd387('0xd')]);router[_0xd387('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xd387('0xe')),controller[_0xd387('0xf')]);router[_0xd387('0x10')]('/',auth[_0xd387('0x9')](),controller[_0xd387('0x11')]);router[_0xd387('0x10')](_0xd387('0x12'),auth[_0xd387('0x9')](),controller[_0xd387('0x13')]);router['put']('/:id',auth[_0xd387('0x9')](),controller['update']);router['delete'](_0xd387('0xa'),auth[_0xd387('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index e9857ae..358f8d1 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 _0x64e0=['formData','description','BOOLEAN','lodash','util','exports','name','long','isObjectLike','setDataValue','stringify','isString'];(function(_0x19e38e,_0xb15cc7){var _0x14bec3=function(_0xd38dd3){while(--_0xd38dd3){_0x19e38e['push'](_0x19e38e['shift']());}};_0x14bec3(++_0xb15cc7);}(_0x64e0,0xff));var _0x064e=function(_0x189eab,_0x2d1178){_0x189eab=_0x189eab-0x0;var _0x4513dc=_0x64e0[_0x189eab];return _0x4513dc;};'use strict';var Sequelize=require('sequelize');var _=require(_0x064e('0x0'));var util=require(_0x064e('0x1'));module[_0x064e('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x064e('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x064e('0x4')),'set':function(_0x4df519){if(_[_0x064e('0x5')](_0x4df519)){this[_0x064e('0x6')]('formData',JSON[_0x064e('0x7')](_0x4df519));}else if(_[_0x064e('0x8')](_0x4df519)){this['setDataValue']('formData',_0x4df519);}else{this[_0x064e('0x6')](_0x064e('0x9'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x064e('0x3'))||'',this['getDataValue'](_0x064e('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x064e('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x064e('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0xc141=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','BOOLEAN','sequelize','lodash','exports','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0xf2b63b,_0x228b1c){var _0x45f36e=function(_0x8ebc1d){while(--_0x8ebc1d){_0xf2b63b['push'](_0xf2b63b['shift']());}};_0x45f36e(++_0x228b1c);}(_0xc141,0x1f0));var _0x1c14=function(_0x406bad,_0x1e4f1a){_0x406bad=_0x406bad-0x0;var _0x37c562=_0xc141[_0x406bad];return _0x37c562;};'use strict';var Sequelize=require(_0x1c14('0x0'));var _=require(_0x1c14('0x1'));var util=require('util');module[_0x1c14('0x2')]={'name':{'type':Sequelize[_0x1c14('0x3')],'unique':_0x1c14('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x1c14('0x5')),'set':function(_0x38ddbb){if(_[_0x1c14('0x6')](_0x38ddbb)){this[_0x1c14('0x7')](_0x1c14('0x8'),JSON[_0x1c14('0x9')](_0x38ddbb));}else if(_[_0x1c14('0xa')](_0x38ddbb)){this['setDataValue'](_0x1c14('0x8'),_0x38ddbb);}else{this[_0x1c14('0x7')](_0x1c14('0x8'),util['format'](_0x1c14('0xb'),this['getDataValue'](_0x1c14('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x1c14('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index c292f5b..6d476e0 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 _0xcf2f=['params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','omit','createdAt','updatedAt','autoAssociation','getSessions','findOne','nolimit','ProjectId','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Content-type','text/csv','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','Projects','UserProfileResource','destroy','end','sendStatus','stack','name','send','map','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','JscriptyProject','includeAll','rows','catch','show'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x50a516,_0x25788a){_0x50a516=_0x50a516-0x0;var _0x13b7db=_0xcf2f[_0x50a516];return _0x13b7db;};'use strict';var emlformat=require(_0xfcf2('0x0'));var rimraf=require(_0xfcf2('0x1'));var zipdir=require(_0xfcf2('0x2'));var jsonpatch=require(_0xfcf2('0x3'));var rp=require(_0xfcf2('0x4'));var moment=require('moment');var BPromise=require(_0xfcf2('0x5'));var Mustache=require(_0xfcf2('0x6'));var util=require(_0xfcf2('0x7'));var path=require(_0xfcf2('0x8'));var sox=require(_0xfcf2('0x9'));var csv=require(_0xfcf2('0xa'));var ejs=require(_0xfcf2('0xb'));var fs=require('fs');var fs_extra=require(_0xfcf2('0xc'));var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfcf2('0x18'))['db'];function respondWithStatusCode(_0x1ba610,_0x175ac9){_0x175ac9=_0x175ac9||0xcc;return function(_0x1be8cc){if(_0x1be8cc){return _0x1ba610['sendStatus'](_0x175ac9);}return _0x1ba610[_0xfcf2('0x19')](_0x175ac9)['end']();};}function respondWithResult(_0x5b414a,_0x5dc04b){_0x5dc04b=_0x5dc04b||0xc8;return function(_0xc87ff4){if(_0xc87ff4){return _0x5b414a['status'](_0x5dc04b)[_0xfcf2('0x1a')](_0xc87ff4);}};}function respondWithFilteredResult(_0x1febf8,_0x245f9a){return function(_0x21f7d1){if(_0x21f7d1){var _0x315b2f=typeof _0x245f9a[_0xfcf2('0x1b')]===_0xfcf2('0x1c')&&typeof _0x245f9a['limit']===_0xfcf2('0x1c');var _0x213125=_0x21f7d1[_0xfcf2('0x1d')];var _0x581d78=_0x315b2f?0x0:_0x245f9a[_0xfcf2('0x1b')];var _0x1b3c89=_0x315b2f?_0x21f7d1[_0xfcf2('0x1d')]:_0x245f9a[_0xfcf2('0x1b')]+_0x245f9a[_0xfcf2('0x1e')];var _0x53c406;if(_0x1b3c89>=_0x213125){_0x1b3c89=_0x213125;_0x53c406=0xc8;}else{_0x53c406=0xce;}_0x1febf8[_0xfcf2('0x19')](_0x53c406);return _0x1febf8[_0xfcf2('0x1f')]('Content-Range',_0x581d78+'-'+_0x1b3c89+'/'+_0x213125)[_0xfcf2('0x1a')](_0x21f7d1);}return null;};}function patchUpdates(_0x23c079){return function(_0x206738){try{jsonpatch[_0xfcf2('0x20')](_0x206738,_0x23c079,!![]);}catch(_0x51e0b7){return BPromise[_0xfcf2('0x21')](_0x51e0b7);}return _0x206738[_0xfcf2('0x22')]();};}function saveUpdates(_0x422c5a,_0x1eeebd){return function(_0x5afab5){if(_0x5afab5){return _0x5afab5[_0xfcf2('0x23')](_0x422c5a)[_0xfcf2('0x24')](function(_0x232f6f){return _0x232f6f;});}return null;};}function removeEntity(_0x584e76,_0x26641a){return function(_0x151aa8){if(_0x151aa8){return _0x151aa8['destroy']()[_0xfcf2('0x24')](function(){var _0xbc8722=_0x151aa8['get']({'plain':!![]});var _0x1e6f14=_0xfcf2('0x25');return db[_0xfcf2('0x26')][_0xfcf2('0x27')]({'where':{'type':_0x1e6f14,'resourceId':_0xbc8722['id']}})['then'](function(){return _0x151aa8;});})[_0xfcf2('0x24')](function(){_0x584e76[_0xfcf2('0x19')](0xcc)[_0xfcf2('0x28')]();});}};}function handleEntityNotFound(_0x3779ee,_0x17c994){return function(_0x2b1d60){if(!_0x2b1d60){_0x3779ee[_0xfcf2('0x29')](0x194);}return _0x2b1d60;};}function handleError(_0x1c8f38,_0x23c09c){_0x23c09c=_0x23c09c||0x1f4;return function(_0x56f839){logger['error'](_0x56f839[_0xfcf2('0x2a')]);if(_0x56f839[_0xfcf2('0x2b')]){delete _0x56f839[_0xfcf2('0x2b')];}_0x1c8f38['status'](_0x23c09c)[_0xfcf2('0x2c')](_0x56f839);};}exports['index']=function(_0x3ce9f8,_0x26651e){var _0x40c1ae={},_0x1a4485={},_0x313884={'count':0x0,'rows':[]};var _0x3760ad=_[_0xfcf2('0x2d')](db['JscriptyProject']['rawAttributes'],function(_0xfc3b86){return{'name':_0xfc3b86[_0xfcf2('0x2e')],'type':_0xfc3b86[_0xfcf2('0x2f')][_0xfcf2('0x30')]};});_0x1a4485['model']=_['map'](_0x3760ad,_0xfcf2('0x2b'));_0x1a4485['query']=_[_0xfcf2('0x31')](_0x3ce9f8[_0xfcf2('0x32')]);_0x1a4485['filters']=_[_0xfcf2('0x33')](_0x1a4485[_0xfcf2('0x34')],_0x1a4485[_0xfcf2('0x32')]);_0x40c1ae[_0xfcf2('0x35')]=_[_0xfcf2('0x33')](_0x1a4485[_0xfcf2('0x34')],qs[_0xfcf2('0x36')](_0x3ce9f8['query'][_0xfcf2('0x36')]));_0x40c1ae[_0xfcf2('0x35')]=_0x40c1ae['attributes'][_0xfcf2('0x37')]?_0x40c1ae[_0xfcf2('0x35')]:_0x1a4485['model'];if(!_0x3ce9f8[_0xfcf2('0x32')][_0xfcf2('0x38')]('nolimit')){_0x40c1ae[_0xfcf2('0x1e')]=qs[_0xfcf2('0x1e')](_0x3ce9f8[_0xfcf2('0x32')][_0xfcf2('0x1e')]);_0x40c1ae['offset']=qs[_0xfcf2('0x1b')](_0x3ce9f8[_0xfcf2('0x32')][_0xfcf2('0x1b')]);}_0x40c1ae[_0xfcf2('0x39')]=qs[_0xfcf2('0x3a')](_0x3ce9f8['query'][_0xfcf2('0x3a')]);_0x40c1ae[_0xfcf2('0x3b')]=qs[_0xfcf2('0x3c')](_[_0xfcf2('0x3d')](_0x3ce9f8[_0xfcf2('0x32')],_0x1a4485['filters']),_0x3760ad);if(_0x3ce9f8[_0xfcf2('0x32')]['filter']){_0x40c1ae[_0xfcf2('0x3b')]=_[_0xfcf2('0x3e')](_0x40c1ae[_0xfcf2('0x3b')],{'$or':_[_0xfcf2('0x2d')](_0x3760ad,function(_0x2fd2ef){if(_0x2fd2ef['type']!==_0xfcf2('0x3f')){var _0x341505={};_0x341505[_0x2fd2ef[_0xfcf2('0x2b')]]={'$like':'%'+_0x3ce9f8['query'][_0xfcf2('0x40')]+'%'};return _0x341505;}})});}_0x40c1ae=_[_0xfcf2('0x3e')]({},_0x40c1ae,_0x3ce9f8[_0xfcf2('0x41')]);var _0x320c19={'where':_0x40c1ae[_0xfcf2('0x3b')]};return db[_0xfcf2('0x42')]['count'](_0x320c19)['then'](function(_0x526c42){_0x313884[_0xfcf2('0x1d')]=_0x526c42;if(_0x3ce9f8[_0xfcf2('0x32')][_0xfcf2('0x43')]){_0x40c1ae['include']=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x40c1ae);})[_0xfcf2('0x24')](function(_0xab0747){_0x313884[_0xfcf2('0x44')]=_0xab0747;return _0x313884;})[_0xfcf2('0x24')](respondWithFilteredResult(_0x26651e,_0x40c1ae))[_0xfcf2('0x45')](handleError(_0x26651e,null));};exports[_0xfcf2('0x46')]=function(_0x2c8ba2,_0x16cc21){var _0x2b790b={'raw':![],'where':{'id':_0x2c8ba2[_0xfcf2('0x47')]['id']}},_0x467ecd={};_0x467ecd['model']=_['keys'](db[_0xfcf2('0x42')][_0xfcf2('0x48')]);_0x467ecd[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x2c8ba2[_0xfcf2('0x32')]);_0x467ecd[_0xfcf2('0x3c')]=_[_0xfcf2('0x33')](_0x467ecd[_0xfcf2('0x34')],_0x467ecd[_0xfcf2('0x32')]);_0x2b790b[_0xfcf2('0x35')]=_[_0xfcf2('0x33')](_0x467ecd[_0xfcf2('0x34')],qs[_0xfcf2('0x36')](_0x2c8ba2[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x2b790b[_0xfcf2('0x35')]=_0x2b790b[_0xfcf2('0x35')]['length']?_0x2b790b[_0xfcf2('0x35')]:_0x467ecd[_0xfcf2('0x34')];if(_0x2c8ba2['query'][_0xfcf2('0x43')]){_0x2b790b['include']=[{'all':!![]}];}_0x2b790b=_[_0xfcf2('0x3e')]({},_0x2b790b,_0x2c8ba2[_0xfcf2('0x41')]);return db[_0xfcf2('0x42')][_0xfcf2('0x49')](_0x2b790b)['then'](handleEntityNotFound(_0x16cc21,null))['then'](respondWithResult(_0x16cc21,null))['catch'](handleError(_0x16cc21,null));};exports[_0xfcf2('0x4a')]=function(_0x37d4bb,_0x20fcab){return db[_0xfcf2('0x42')]['create'](_0x37d4bb[_0xfcf2('0x4b')],{})[_0xfcf2('0x24')](function(_0x3b981c){var _0x548c6c=_0x37d4bb[_0xfcf2('0x4c')][_0xfcf2('0x4d')]({'plain':!![]});if(!_0x548c6c)throw new Error(_0xfcf2('0x4e'));if(_0x548c6c[_0xfcf2('0x4f')]===_0xfcf2('0x4c')){var _0x4af270=_0x3b981c[_0xfcf2('0x4d')]({'plain':!![]});var _0x1260a4=_0xfcf2('0x25');return db[_0xfcf2('0x50')][_0xfcf2('0x49')]({'where':{'name':_0x1260a4,'userProfileId':_0x548c6c[_0xfcf2('0x51')]},'raw':!![]})['then'](function(_0x5d162d){if(_0x5d162d&&_0x5d162d['autoAssociation']===0x0){return db[_0xfcf2('0x26')][_0xfcf2('0x4a')]({'name':_0x4af270['name'],'resourceId':_0x4af270['id'],'type':_0x5d162d['name'],'sectionId':_0x5d162d['id']},{})[_0xfcf2('0x24')](function(){return _0x3b981c;});}else{return _0x3b981c;}})[_0xfcf2('0x45')](function(_0x137a47){logger['error'](_0xfcf2('0x52'),_0x137a47);throw _0x137a47;});}return _0x3b981c;})[_0xfcf2('0x24')](respondWithResult(_0x20fcab,0xc9))['catch'](handleError(_0x20fcab,null));};exports['clone']=function(_0xfc4b7b,_0x51f636){var _0x222354={'where':{'id':_0xfc4b7b['params']['id']}},_0x418807={};_0x418807[_0xfcf2('0x34')]=_['keys'](db[_0xfcf2('0x42')]['rawAttributes']);_0x222354[_0xfcf2('0x35')]=_[_0xfcf2('0x33')](_0x418807[_0xfcf2('0x34')],qs['fields'](_0xfc4b7b[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x222354[_0xfcf2('0x35')]=_0x222354[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x222354[_0xfcf2('0x35')]:_0x418807[_0xfcf2('0x34')];if(_0xfc4b7b['query'][_0xfcf2('0x43')]){_0x222354[_0xfcf2('0x53')]=[{'all':!![]}];}_0x222354=_['merge']({},_0x222354,_0xfc4b7b[_0xfcf2('0x41')]);return db[_0xfcf2('0x42')][_0xfcf2('0x49')](_0x222354)[_0xfcf2('0x24')](handleEntityNotFound(_0x51f636,null))['then'](function(_0x157be7){if(_0x157be7){var _0x51dd1b=_0x157be7[_0xfcf2('0x4d')]({'plain':!![]});_0x51dd1b=qs[_0xfcf2('0x54')](_0x51dd1b,['id',_0xfcf2('0x55'),_0xfcf2('0x56')]);_0xfc4b7b[_0xfcf2('0x4b')]=_[_0xfcf2('0x54')](_0xfc4b7b[_0xfcf2('0x4b')],['id','createdAt',_0xfcf2('0x56')]);return db[_0xfcf2('0x42')]['create'](_[_0xfcf2('0x3e')](_0x51dd1b,_0xfc4b7b['body']),{'include':_0xfc4b7b['query'][_0xfcf2('0x43')]?[{'all':!![]}]:undefined})[_0xfcf2('0x24')](function(_0x98be70){var _0xfef0e9=_0xfc4b7b[_0xfcf2('0x4c')]['get']({'plain':!![]});if(!_0xfef0e9)throw new Error(_0xfcf2('0x4e'));if(_0xfef0e9[_0xfcf2('0x4f')]==='user'){var _0x10d8a4=_0x98be70[_0xfcf2('0x4d')]({'plain':!![]});var _0x5aa1f0=_0xfcf2('0x25');return db[_0xfcf2('0x50')][_0xfcf2('0x49')]({'where':{'name':_0x5aa1f0,'userProfileId':_0xfef0e9[_0xfcf2('0x51')]},'raw':!![]})[_0xfcf2('0x24')](function(_0x302852){if(_0x302852&&_0x302852[_0xfcf2('0x57')]===0x0){return db['UserProfileResource'][_0xfcf2('0x4a')]({'name':_0x10d8a4[_0xfcf2('0x2b')],'resourceId':_0x10d8a4['id'],'type':_0x302852['name'],'sectionId':_0x302852['id']},{})['then'](function(){return _0x98be70;});}else{return _0x98be70;}})['catch'](function(_0x25acf7){logger['error'](_0xfcf2('0x52'),_0x25acf7);throw _0x25acf7;});}return _0x98be70;});}})['then'](respondWithResult(_0x51f636,0xc9))[_0xfcf2('0x45')](handleError(_0x51f636,null));};exports[_0xfcf2('0x23')]=function(_0x48f654,_0x51891d){if(_0x48f654[_0xfcf2('0x4b')]['id']){delete _0x48f654[_0xfcf2('0x4b')]['id'];}return db[_0xfcf2('0x42')][_0xfcf2('0x49')]({'where':{'id':_0x48f654['params']['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x51891d,null))[_0xfcf2('0x24')](saveUpdates(_0x48f654[_0xfcf2('0x4b')],null))[_0xfcf2('0x24')](respondWithResult(_0x51891d,null))['catch'](handleError(_0x51891d,null));};exports['destroy']=function(_0x48a661,_0x4caaed){return db[_0xfcf2('0x42')][_0xfcf2('0x49')]({'where':{'id':_0x48a661['params']['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x4caaed,null))[_0xfcf2('0x24')](removeEntity(_0x4caaed,null))['catch'](handleError(_0x4caaed,null));};exports[_0xfcf2('0x58')]=function(_0x4a648d,_0x51e8bd,_0x325ccd){var _0x1af6a8={'raw':!![],'where':{}};var _0x419b47={};var _0x5c450c={'count':0x0,'rows':[]};return db[_0xfcf2('0x42')][_0xfcf2('0x59')]({'where':{'id':_0x4a648d['params']['id']}})['then'](handleEntityNotFound(_0x51e8bd,null))['then'](function(_0xfb83e7){if(_0xfb83e7){_0x419b47[_0xfcf2('0x34')]=_[_0xfcf2('0x31')](db['JscriptySessionReport'][_0xfcf2('0x48')]);_0x419b47[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x4a648d[_0xfcf2('0x32')]);_0x419b47[_0xfcf2('0x3c')]=_[_0xfcf2('0x33')](_0x419b47[_0xfcf2('0x34')],_0x419b47['query']);_0x1af6a8['attributes']=_['intersection'](_0x419b47['model'],qs[_0xfcf2('0x36')](_0x4a648d[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x1af6a8['attributes']=_0x1af6a8[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x1af6a8['attributes']:_0x419b47[_0xfcf2('0x34')];if(!_0x4a648d[_0xfcf2('0x32')][_0xfcf2('0x38')](_0xfcf2('0x5a'))){_0x1af6a8[_0xfcf2('0x1e')]=qs[_0xfcf2('0x1e')](_0x4a648d['query']['limit']);_0x1af6a8[_0xfcf2('0x1b')]=qs[_0xfcf2('0x1b')](_0x4a648d[_0xfcf2('0x32')]['offset']);}_0x1af6a8['order']=qs['sort'](_0x4a648d[_0xfcf2('0x32')][_0xfcf2('0x3a')]);_0x1af6a8['where']=qs['filters'](_[_0xfcf2('0x3d')](_0x4a648d[_0xfcf2('0x32')],_0x419b47['filters']));_0x1af6a8[_0xfcf2('0x3b')][_0xfcf2('0x5b')]=_0xfb83e7['id'];if(_0x4a648d['query'][_0xfcf2('0x40')]){_0x1af6a8[_0xfcf2('0x3b')]=_['merge'](_0x1af6a8['where'],{'$or':_[_0xfcf2('0x2d')](_0x1af6a8['attributes'],function(_0x33ec43){var _0x1d0a3b={};_0x1d0a3b[_0x33ec43]={'$like':'%'+_0x4a648d[_0xfcf2('0x32')][_0xfcf2('0x40')]+'%'};return _0x1d0a3b;})});}_0x1af6a8=_[_0xfcf2('0x3e')]({},_0x1af6a8,_0x4a648d[_0xfcf2('0x41')]);return db['JscriptySessionReport'][_0xfcf2('0x1d')]({'where':_0x1af6a8[_0xfcf2('0x3b')]})[_0xfcf2('0x24')](function(_0x298196){_0x5c450c[_0xfcf2('0x1d')]=_0x298196;if(_0x4a648d[_0xfcf2('0x32')]['includeAll']){_0x1af6a8[_0xfcf2('0x53')]=[{'all':!![]}];}return db[_0xfcf2('0x5c')][_0xfcf2('0x5d')](_0x1af6a8);})[_0xfcf2('0x24')](function(_0x5d9f97){_0x5c450c['rows']=_0x5d9f97;return _0x5c450c;});}})[_0xfcf2('0x24')](respondWithFilteredResult(_0x51e8bd,_0x1af6a8))[_0xfcf2('0x45')](handleError(_0x51e8bd,null));};exports[_0xfcf2('0x5e')]=function(_0x2b5908,_0x4eea62,_0x43211a){var _0x4e314a={'raw':!![],'where':{}};var _0x1ea2a6={};var _0x105198={'count':0x0,'rows':[]};return db[_0xfcf2('0x42')]['findOne']({'where':{'id':_0x2b5908['params']['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x4eea62,null))[_0xfcf2('0x24')](function(_0x26f450){if(_0x26f450){_0x1ea2a6[_0xfcf2('0x34')]=_['keys'](db[_0xfcf2('0x5f')]['rawAttributes']);_0x1ea2a6[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x2b5908[_0xfcf2('0x32')]);_0x1ea2a6['filters']=_['intersection'](_0x1ea2a6['model'],_0x1ea2a6['query']);_0x4e314a[_0xfcf2('0x35')]=_[_0xfcf2('0x33')](_0x1ea2a6['model'],qs['fields'](_0x2b5908[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x4e314a['attributes']=_0x4e314a[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x4e314a['attributes']:_0x1ea2a6[_0xfcf2('0x34')];if(!_0x2b5908[_0xfcf2('0x32')][_0xfcf2('0x38')](_0xfcf2('0x5a'))){_0x4e314a[_0xfcf2('0x1e')]=qs[_0xfcf2('0x1e')](_0x2b5908[_0xfcf2('0x32')][_0xfcf2('0x1e')]);_0x4e314a[_0xfcf2('0x1b')]=qs[_0xfcf2('0x1b')](_0x2b5908[_0xfcf2('0x32')][_0xfcf2('0x1b')]);}_0x4e314a[_0xfcf2('0x39')]=qs[_0xfcf2('0x3a')](_0x2b5908['query'][_0xfcf2('0x3a')]);_0x4e314a[_0xfcf2('0x3b')]=qs[_0xfcf2('0x3c')](_[_0xfcf2('0x3d')](_0x2b5908[_0xfcf2('0x32')],_0x1ea2a6[_0xfcf2('0x3c')]));_0x4e314a[_0xfcf2('0x3b')][_0xfcf2('0x5b')]=_0x26f450['id'];if(_0x2b5908[_0xfcf2('0x32')][_0xfcf2('0x40')]){_0x4e314a[_0xfcf2('0x3b')]=_[_0xfcf2('0x3e')](_0x4e314a[_0xfcf2('0x3b')],{'$or':_['map'](_0x4e314a[_0xfcf2('0x35')],function(_0x4f640c){var _0x2a93fb={};_0x2a93fb[_0x4f640c]={'$like':'%'+_0x2b5908[_0xfcf2('0x32')][_0xfcf2('0x40')]+'%'};return _0x2a93fb;})});}_0x4e314a=_[_0xfcf2('0x3e')]({},_0x4e314a,_0x2b5908[_0xfcf2('0x41')]);return db[_0xfcf2('0x5f')][_0xfcf2('0x1d')]({'where':_0x4e314a[_0xfcf2('0x3b')]})[_0xfcf2('0x24')](function(_0x382470){_0x105198[_0xfcf2('0x1d')]=_0x382470;if(_0x2b5908[_0xfcf2('0x32')]['includeAll']){_0x4e314a[_0xfcf2('0x53')]=[{'all':!![]}];}return db[_0xfcf2('0x5f')][_0xfcf2('0x5d')](_0x4e314a);})[_0xfcf2('0x24')](function(_0x2b2bbf){_0x105198[_0xfcf2('0x44')]=_0x2b2bbf;return _0x105198;});}})[_0xfcf2('0x24')](respondWithFilteredResult(_0x4eea62,_0x4e314a))['catch'](handleError(_0x4eea62,null));};function char(_0x192d7b){return _0xfcf2('0x60')===typeof _0x192d7b?String[_0xfcf2('0x61')][_0xfcf2('0x20')](null,arguments):_0x192d7b;}function needsEncapsulation(_0x3664b0){return!!_0x3664b0&&(_0x3664b0[_0xfcf2('0x62')]()[_0xfcf2('0x63')](char(0xd))>=0x0||_0x3664b0['toString']()[_0xfcf2('0x63')](char(0xa))>=0x0||_0x3664b0[_0xfcf2('0x62')]()[_0xfcf2('0x63')](char(0x2c))>=0x0||_0x3664b0[_0xfcf2('0x62')]()[_0xfcf2('0x63')](char(0x22))>=0x0);}function encapsulate(_0x2104e3){var _0x35a3f2=char(0x22),_0x48a3cb='\x5c'+char(0x22),_0x1061a7=_0x2104e3[_0xfcf2('0x62')]()[_0xfcf2('0x64')](new RegExp(_0x35a3f2,'g'),_0x48a3cb);return _0x35a3f2+_0x1061a7+_0x35a3f2;}exports['getSummary']=function(_0x1be3e0,_0x51a81d,_0x7c1bd1){var _0x2f5c59,_0x5195df;var _0x2dac3e={'where':{'ProjectId':_0x1be3e0[_0xfcf2('0x47')]['id']}};if(_0x1be3e0[_0xfcf2('0x32')][_0xfcf2('0x65')]){_0x2dac3e[_0xfcf2('0x3b')]['starttime']=JSON[_0xfcf2('0x66')](_0x1be3e0[_0xfcf2('0x32')]['startTime']);}return db[_0xfcf2('0x5c')][_0xfcf2('0x5d')](_0x2dac3e)[_0xfcf2('0x24')](handleEntityNotFound(_0x51a81d,null))['then'](function(_0x55b788){if(_0x55b788){_0x2f5c59=_0x55b788;return db[_0xfcf2('0x67')][_0xfcf2('0x5d')]({'where':{'SessionId':{'$in':_[_0xfcf2('0x2d')](_0x2f5c59,'id')},'ProjectId':_0x1be3e0[_0xfcf2('0x47')]['id']},'order':_0xfcf2('0x68')});}})['then'](handleEntityNotFound(_0x51a81d,null))['then'](function(_0x236356){if(_0x236356){_0x5195df=_0x236356;var _0x2e1b14={};for(var _0x253c55=0x0,_0x328a51=_0x5195df['length'];_0x253c55<_0x328a51;_0x253c55++){if(!_0x2e1b14[_0xfcf2('0x38')](_0x5195df[_0x253c55]['questionId'])){_0x2e1b14[_0x5195df[_0x253c55][_0xfcf2('0x69')]]=needsEncapsulation(_0x5195df[_0x253c55]['question'])?encapsulate(_0x5195df[_0x253c55][_0xfcf2('0x6a')]):_0x5195df[_0x253c55]['question'];}}var _0x4333ec=[],_0x4e22ed={};for(var _0xf0efbb=0x0,_0x9aeea5=_0x2f5c59['length'];_0xf0efbb<_0x9aeea5;_0xf0efbb++){_0x4e22ed={'ProjectId':_0x1be3e0[_0xfcf2('0x47')]['id'],'SessionId':_0x2f5c59[_0xf0efbb]['id'],'StartTime':moment(_0x2f5c59[_0xf0efbb][_0xfcf2('0x6b')])[_0xfcf2('0x6c')](_0xfcf2('0x6d'))};for(var _0x7e7358=0x0,_0x5eef78=_0x5195df['length'];_0x7e7358<_0x5eef78;_0x7e7358++){if(_0x5195df[_0x7e7358]['SessionId']==_0x2f5c59[_0xf0efbb]['id']&&_0x2e1b14[_0xfcf2('0x38')](_0x5195df[_0x7e7358][_0xfcf2('0x69')])){_0x4e22ed[_0x2e1b14[_0x5195df[_0x7e7358]['questionId']]]=_0x5195df[_0x7e7358][_0xfcf2('0x6e')];}}for(var _0x549c40 in _0x2e1b14){if(!_0x4e22ed['hasOwnProperty'](_0x2e1b14[_0x549c40])){_0x4e22ed[_0x2e1b14[_0x549c40]]=null;}}_0x4333ec['push'](_0x4e22ed);}return _0x4333ec;}})[_0xfcf2('0x24')](function(_0x23e7f4){if(!_[_0xfcf2('0x6f')](_0x23e7f4)){var _0x180e5d=toCsv(_0x23e7f4);var _0x205e86=Date[_0xfcf2('0x70')]();fs[_0xfcf2('0x71')](util[_0xfcf2('0x6c')](_0xfcf2('0x72'),_0x1be3e0[_0xfcf2('0x47')]['id'],_0x205e86),_0x180e5d);_0x51a81d[_0xfcf2('0x73')](_0xfcf2('0x74'),'attachment;\x20filename='+util[_0xfcf2('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x1be3e0[_0xfcf2('0x47')]['id'],_0x205e86));_0x51a81d[_0xfcf2('0x73')](_0xfcf2('0x75'),_0xfcf2('0x76'));return _0x51a81d['download'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1be3e0[_0xfcf2('0x47')]['id'],_0x205e86));}else{return _0x51a81d[_0xfcf2('0x29')](0xcc);}})['catch'](handleError(_0x51a81d,null));}; \ No newline at end of file +var _0x1b2a=['updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','Projects','UserProfileResource','stack','name','JscriptyProject','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','clone','omit','createdAt'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1b2a,0x18f));var _0xa1b2=function(_0x25e49d,_0x53a9c7){_0x25e49d=_0x25e49d-0x0;var _0x682bd1=_0x1b2a[_0x25e49d];return _0x682bd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1b2('0x1'));var rp=require(_0xa1b2('0x2'));var moment=require(_0xa1b2('0x3'));var BPromise=require(_0xa1b2('0x4'));var Mustache=require(_0xa1b2('0x5'));var util=require(_0xa1b2('0x6'));var path=require(_0xa1b2('0x7'));var sox=require(_0xa1b2('0x8'));var csv=require('to-csv');var ejs=require(_0xa1b2('0x9'));var fs=require('fs');var fs_extra=require(_0xa1b2('0xa'));var _=require(_0xa1b2('0xb'));var squel=require('squel');var crypto=require(_0xa1b2('0xc'));var jsforce=require(_0xa1b2('0xd'));var deskjs=require(_0xa1b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1b2('0xf'));var Papa=require(_0xa1b2('0x10'));var Redis=require(_0xa1b2('0x11'));var authService=require(_0xa1b2('0x12'));var qs=require(_0xa1b2('0x13'));var as=require(_0xa1b2('0x14'));var hardwareService=require(_0xa1b2('0x15'));var logger=require(_0xa1b2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xa1b2('0x17'));var licenseUtil=require(_0xa1b2('0x18'));var db=require(_0xa1b2('0x19'))['db'];function respondWithStatusCode(_0x2b598a,_0x418a7e){_0x418a7e=_0x418a7e||0xcc;return function(_0x571dff){if(_0x571dff){return _0x2b598a[_0xa1b2('0x1a')](_0x418a7e);}return _0x2b598a[_0xa1b2('0x1b')](_0x418a7e)[_0xa1b2('0x1c')]();};}function respondWithResult(_0x3f9519,_0xa4ceaa){_0xa4ceaa=_0xa4ceaa||0xc8;return function(_0x1bf506){if(_0x1bf506){return _0x3f9519['status'](_0xa4ceaa)[_0xa1b2('0x1d')](_0x1bf506);}};}function respondWithFilteredResult(_0x319829,_0x5c6a9e){return function(_0x375ba3){if(_0x375ba3){var _0x2f9a51=typeof _0x5c6a9e[_0xa1b2('0x1e')]===_0xa1b2('0x1f')&&typeof _0x5c6a9e[_0xa1b2('0x20')]===_0xa1b2('0x1f');var _0x5568d1=_0x375ba3['count'];var _0x550eb0=_0x2f9a51?0x0:_0x5c6a9e[_0xa1b2('0x1e')];var _0x1b7831=_0x2f9a51?_0x375ba3[_0xa1b2('0x21')]:_0x5c6a9e[_0xa1b2('0x1e')]+_0x5c6a9e[_0xa1b2('0x20')];var _0x166a52;if(_0x1b7831>=_0x5568d1){_0x1b7831=_0x5568d1;_0x166a52=0xc8;}else{_0x166a52=0xce;}_0x319829[_0xa1b2('0x1b')](_0x166a52);return _0x319829[_0xa1b2('0x22')](_0xa1b2('0x23'),_0x550eb0+'-'+_0x1b7831+'/'+_0x5568d1)[_0xa1b2('0x1d')](_0x375ba3);}return null;};}function patchUpdates(_0xafc9b9){return function(_0x2fd676){try{jsonpatch['apply'](_0x2fd676,_0xafc9b9,!![]);}catch(_0x344d7b){return BPromise[_0xa1b2('0x24')](_0x344d7b);}return _0x2fd676['save']();};}function saveUpdates(_0x3afd94,_0x47bdfd){return function(_0x26c9a4){if(_0x26c9a4){return _0x26c9a4[_0xa1b2('0x25')](_0x3afd94)['then'](function(_0x4fb5bb){return _0x4fb5bb;});}return null;};}function removeEntity(_0x257d88,_0x43bfba){return function(_0x8e95ea){if(_0x8e95ea){return _0x8e95ea['destroy']()[_0xa1b2('0x26')](function(){var _0x44239a=_0x8e95ea[_0xa1b2('0x27')]({'plain':!![]});var _0x59aff4=_0xa1b2('0x28');return db[_0xa1b2('0x29')]['destroy']({'where':{'type':_0x59aff4,'resourceId':_0x44239a['id']}})['then'](function(){return _0x8e95ea;});})[_0xa1b2('0x26')](function(){_0x257d88[_0xa1b2('0x1b')](0xcc)[_0xa1b2('0x1c')]();});}};}function handleEntityNotFound(_0x243909,_0x570632){return function(_0xd52b2c){if(!_0xd52b2c){_0x243909['sendStatus'](0x194);}return _0xd52b2c;};}function handleError(_0xca8c77,_0x113dad){_0x113dad=_0x113dad||0x1f4;return function(_0x59ead3){logger['error'](_0x59ead3[_0xa1b2('0x2a')]);if(_0x59ead3[_0xa1b2('0x2b')]){delete _0x59ead3[_0xa1b2('0x2b')];}_0xca8c77[_0xa1b2('0x1b')](_0x113dad)['send'](_0x59ead3);};}exports['index']=function(_0x5addde,_0x3aff6){var _0x45c0a3={},_0x142376={},_0x2ec977={'count':0x0,'rows':[]};var _0x4eb584=_['map'](db[_0xa1b2('0x2c')][_0xa1b2('0x2d')],function(_0x5499e7){return{'name':_0x5499e7[_0xa1b2('0x2e')],'type':_0x5499e7[_0xa1b2('0x2f')]['key']};});_0x142376[_0xa1b2('0x30')]=_[_0xa1b2('0x31')](_0x4eb584,_0xa1b2('0x2b'));_0x142376[_0xa1b2('0x32')]=_[_0xa1b2('0x33')](_0x5addde[_0xa1b2('0x32')]);_0x142376[_0xa1b2('0x34')]=_[_0xa1b2('0x35')](_0x142376[_0xa1b2('0x30')],_0x142376[_0xa1b2('0x32')]);_0x45c0a3[_0xa1b2('0x36')]=_['intersection'](_0x142376[_0xa1b2('0x30')],qs[_0xa1b2('0x37')](_0x5addde['query'][_0xa1b2('0x37')]));_0x45c0a3[_0xa1b2('0x36')]=_0x45c0a3['attributes'][_0xa1b2('0x38')]?_0x45c0a3[_0xa1b2('0x36')]:_0x142376[_0xa1b2('0x30')];if(!_0x5addde[_0xa1b2('0x32')][_0xa1b2('0x39')]('nolimit')){_0x45c0a3[_0xa1b2('0x20')]=qs[_0xa1b2('0x20')](_0x5addde[_0xa1b2('0x32')][_0xa1b2('0x20')]);_0x45c0a3[_0xa1b2('0x1e')]=qs['offset'](_0x5addde[_0xa1b2('0x32')][_0xa1b2('0x1e')]);}_0x45c0a3[_0xa1b2('0x3a')]=qs[_0xa1b2('0x3b')](_0x5addde[_0xa1b2('0x32')][_0xa1b2('0x3b')]);_0x45c0a3[_0xa1b2('0x3c')]=qs['filters'](_[_0xa1b2('0x3d')](_0x5addde['query'],_0x142376['filters']),_0x4eb584);if(_0x5addde[_0xa1b2('0x32')]['filter']){_0x45c0a3['where']=_[_0xa1b2('0x3e')](_0x45c0a3[_0xa1b2('0x3c')],{'$or':_[_0xa1b2('0x31')](_0x4eb584,function(_0xced50d){if(_0xced50d[_0xa1b2('0x2f')]!==_0xa1b2('0x3f')){var _0x3fe821={};_0x3fe821[_0xced50d[_0xa1b2('0x2b')]]={'$like':'%'+_0x5addde[_0xa1b2('0x32')][_0xa1b2('0x40')]+'%'};return _0x3fe821;}})});}_0x45c0a3=_[_0xa1b2('0x3e')]({},_0x45c0a3,_0x5addde[_0xa1b2('0x41')]);var _0x10df1a={'where':_0x45c0a3[_0xa1b2('0x3c')]};return db[_0xa1b2('0x2c')][_0xa1b2('0x21')](_0x10df1a)[_0xa1b2('0x26')](function(_0x1c9a3a){_0x2ec977[_0xa1b2('0x21')]=_0x1c9a3a;if(_0x5addde[_0xa1b2('0x32')][_0xa1b2('0x42')]){_0x45c0a3[_0xa1b2('0x43')]=[{'all':!![]}];}return db[_0xa1b2('0x2c')][_0xa1b2('0x44')](_0x45c0a3);})['then'](function(_0x1f645e){_0x2ec977[_0xa1b2('0x45')]=_0x1f645e;return _0x2ec977;})['then'](respondWithFilteredResult(_0x3aff6,_0x45c0a3))['catch'](handleError(_0x3aff6,null));};exports[_0xa1b2('0x46')]=function(_0x4894e0,_0x3f72ef){var _0x159b52={'raw':![],'where':{'id':_0x4894e0[_0xa1b2('0x47')]['id']}},_0x296103={};_0x296103[_0xa1b2('0x30')]=_[_0xa1b2('0x33')](db['JscriptyProject'][_0xa1b2('0x2d')]);_0x296103[_0xa1b2('0x32')]=_['keys'](_0x4894e0[_0xa1b2('0x32')]);_0x296103[_0xa1b2('0x34')]=_['intersection'](_0x296103[_0xa1b2('0x30')],_0x296103[_0xa1b2('0x32')]);_0x159b52[_0xa1b2('0x36')]=_['intersection'](_0x296103['model'],qs[_0xa1b2('0x37')](_0x4894e0['query'][_0xa1b2('0x37')]));_0x159b52['attributes']=_0x159b52[_0xa1b2('0x36')][_0xa1b2('0x38')]?_0x159b52['attributes']:_0x296103[_0xa1b2('0x30')];if(_0x4894e0[_0xa1b2('0x32')][_0xa1b2('0x42')]){_0x159b52['include']=[{'all':!![]}];}_0x159b52=_[_0xa1b2('0x3e')]({},_0x159b52,_0x4894e0[_0xa1b2('0x41')]);return db[_0xa1b2('0x2c')][_0xa1b2('0x48')](_0x159b52)[_0xa1b2('0x26')](handleEntityNotFound(_0x3f72ef,null))[_0xa1b2('0x26')](respondWithResult(_0x3f72ef,null))[_0xa1b2('0x49')](handleError(_0x3f72ef,null));};exports[_0xa1b2('0x4a')]=function(_0xd944e8,_0x281341){return db[_0xa1b2('0x2c')]['create'](_0xd944e8['body'],{})[_0xa1b2('0x26')](function(_0x249af3){var _0x501bb4=_0xd944e8[_0xa1b2('0x4b')][_0xa1b2('0x27')]({'plain':!![]});if(!_0x501bb4)throw new Error(_0xa1b2('0x4c'));if(_0x501bb4[_0xa1b2('0x4d')]==='user'){var _0x259efe=_0x249af3[_0xa1b2('0x27')]({'plain':!![]});var _0x511bc8=_0xa1b2('0x28');return db[_0xa1b2('0x4e')][_0xa1b2('0x48')]({'where':{'name':_0x511bc8,'userProfileId':_0x501bb4[_0xa1b2('0x4f')]},'raw':!![]})[_0xa1b2('0x26')](function(_0x2468c1){if(_0x2468c1&&_0x2468c1[_0xa1b2('0x50')]===0x0){return db[_0xa1b2('0x29')][_0xa1b2('0x4a')]({'name':_0x259efe[_0xa1b2('0x2b')],'resourceId':_0x259efe['id'],'type':_0x2468c1['name'],'sectionId':_0x2468c1['id']},{})[_0xa1b2('0x26')](function(){return _0x249af3;});}else{return _0x249af3;}})[_0xa1b2('0x49')](function(_0x14359c){logger[_0xa1b2('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14359c);throw _0x14359c;});}return _0x249af3;})['then'](respondWithResult(_0x281341,0xc9))[_0xa1b2('0x49')](handleError(_0x281341,null));};exports[_0xa1b2('0x52')]=function(_0x562cf2,_0x44352f){var _0x4e9293={'where':{'id':_0x562cf2['params']['id']}},_0x283801={};_0x283801[_0xa1b2('0x30')]=_[_0xa1b2('0x33')](db[_0xa1b2('0x2c')][_0xa1b2('0x2d')]);_0x4e9293['attributes']=_[_0xa1b2('0x35')](_0x283801[_0xa1b2('0x30')],qs[_0xa1b2('0x37')](_0x562cf2['query'][_0xa1b2('0x37')]));_0x4e9293[_0xa1b2('0x36')]=_0x4e9293[_0xa1b2('0x36')][_0xa1b2('0x38')]?_0x4e9293[_0xa1b2('0x36')]:_0x283801['model'];if(_0x562cf2['query']['includeAll']){_0x4e9293[_0xa1b2('0x43')]=[{'all':!![]}];}_0x4e9293=_[_0xa1b2('0x3e')]({},_0x4e9293,_0x562cf2['options']);return db[_0xa1b2('0x2c')][_0xa1b2('0x48')](_0x4e9293)[_0xa1b2('0x26')](handleEntityNotFound(_0x44352f,null))['then'](function(_0x25bd8b){if(_0x25bd8b){var _0x56a017=_0x25bd8b[_0xa1b2('0x27')]({'plain':!![]});_0x56a017=qs[_0xa1b2('0x53')](_0x56a017,['id',_0xa1b2('0x54'),_0xa1b2('0x55')]);_0x562cf2[_0xa1b2('0x56')]=_['omit'](_0x562cf2[_0xa1b2('0x56')],['id','createdAt',_0xa1b2('0x55')]);return db[_0xa1b2('0x2c')][_0xa1b2('0x4a')](_[_0xa1b2('0x3e')](_0x56a017,_0x562cf2[_0xa1b2('0x56')]),{'include':_0x562cf2[_0xa1b2('0x32')][_0xa1b2('0x42')]?[{'all':!![]}]:undefined})[_0xa1b2('0x26')](function(_0x4136bd){var _0x394d6e=_0x562cf2[_0xa1b2('0x4b')][_0xa1b2('0x27')]({'plain':!![]});if(!_0x394d6e)throw new Error(_0xa1b2('0x4c'));if(_0x394d6e[_0xa1b2('0x4d')]===_0xa1b2('0x4b')){var _0x2d2590=_0x4136bd[_0xa1b2('0x27')]({'plain':!![]});var _0x2d64f5=_0xa1b2('0x28');return db[_0xa1b2('0x4e')]['find']({'where':{'name':_0x2d64f5,'userProfileId':_0x394d6e[_0xa1b2('0x4f')]},'raw':!![]})[_0xa1b2('0x26')](function(_0x29e48a){if(_0x29e48a&&_0x29e48a[_0xa1b2('0x50')]===0x0){return db[_0xa1b2('0x29')][_0xa1b2('0x4a')]({'name':_0x2d2590['name'],'resourceId':_0x2d2590['id'],'type':_0x29e48a[_0xa1b2('0x2b')],'sectionId':_0x29e48a['id']},{})[_0xa1b2('0x26')](function(){return _0x4136bd;});}else{return _0x4136bd;}})['catch'](function(_0x3a2649){logger[_0xa1b2('0x51')](_0xa1b2('0x57'),_0x3a2649);throw _0x3a2649;});}return _0x4136bd;});}})[_0xa1b2('0x26')](respondWithResult(_0x44352f,0xc9))['catch'](handleError(_0x44352f,null));};exports[_0xa1b2('0x25')]=function(_0x9ac0f4,_0xa396d){if(_0x9ac0f4['body']['id']){delete _0x9ac0f4[_0xa1b2('0x56')]['id'];}return db[_0xa1b2('0x2c')][_0xa1b2('0x48')]({'where':{'id':_0x9ac0f4[_0xa1b2('0x47')]['id']}})[_0xa1b2('0x26')](handleEntityNotFound(_0xa396d,null))[_0xa1b2('0x26')](saveUpdates(_0x9ac0f4['body'],null))[_0xa1b2('0x26')](respondWithResult(_0xa396d,null))[_0xa1b2('0x49')](handleError(_0xa396d,null));};exports[_0xa1b2('0x58')]=function(_0x2e12d3,_0x1b2296){return db[_0xa1b2('0x2c')]['find']({'where':{'id':_0x2e12d3[_0xa1b2('0x47')]['id']}})[_0xa1b2('0x26')](handleEntityNotFound(_0x1b2296,null))[_0xa1b2('0x26')](removeEntity(_0x1b2296,null))[_0xa1b2('0x49')](handleError(_0x1b2296,null));};exports[_0xa1b2('0x59')]=function(_0x58473e,_0x202aab,_0x34a920){var _0x43e73b={'raw':!![],'where':{}};var _0x390727={};var _0x4e3d61={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xa1b2('0x5a')]({'where':{'id':_0x58473e[_0xa1b2('0x47')]['id']}})[_0xa1b2('0x26')](handleEntityNotFound(_0x202aab,null))[_0xa1b2('0x26')](function(_0x586842){if(_0x586842){_0x390727[_0xa1b2('0x30')]=_[_0xa1b2('0x33')](db[_0xa1b2('0x5b')][_0xa1b2('0x2d')]);_0x390727['query']=_[_0xa1b2('0x33')](_0x58473e[_0xa1b2('0x32')]);_0x390727['filters']=_[_0xa1b2('0x35')](_0x390727[_0xa1b2('0x30')],_0x390727[_0xa1b2('0x32')]);_0x43e73b[_0xa1b2('0x36')]=_[_0xa1b2('0x35')](_0x390727[_0xa1b2('0x30')],qs[_0xa1b2('0x37')](_0x58473e[_0xa1b2('0x32')]['fields']));_0x43e73b[_0xa1b2('0x36')]=_0x43e73b[_0xa1b2('0x36')][_0xa1b2('0x38')]?_0x43e73b[_0xa1b2('0x36')]:_0x390727['model'];if(!_0x58473e[_0xa1b2('0x32')][_0xa1b2('0x39')](_0xa1b2('0x5c'))){_0x43e73b[_0xa1b2('0x20')]=qs['limit'](_0x58473e[_0xa1b2('0x32')]['limit']);_0x43e73b[_0xa1b2('0x1e')]=qs['offset'](_0x58473e[_0xa1b2('0x32')][_0xa1b2('0x1e')]);}_0x43e73b[_0xa1b2('0x3a')]=qs[_0xa1b2('0x3b')](_0x58473e[_0xa1b2('0x32')][_0xa1b2('0x3b')]);_0x43e73b[_0xa1b2('0x3c')]=qs[_0xa1b2('0x34')](_[_0xa1b2('0x3d')](_0x58473e['query'],_0x390727[_0xa1b2('0x34')]));_0x43e73b['where'][_0xa1b2('0x5d')]=_0x586842['id'];if(_0x58473e[_0xa1b2('0x32')][_0xa1b2('0x40')]){_0x43e73b[_0xa1b2('0x3c')]=_[_0xa1b2('0x3e')](_0x43e73b[_0xa1b2('0x3c')],{'$or':_[_0xa1b2('0x31')](_0x43e73b[_0xa1b2('0x36')],function(_0x4cc48e){var _0x51cf9a={};_0x51cf9a[_0x4cc48e]={'$like':'%'+_0x58473e[_0xa1b2('0x32')]['filter']+'%'};return _0x51cf9a;})});}_0x43e73b=_['merge']({},_0x43e73b,_0x58473e[_0xa1b2('0x41')]);return db[_0xa1b2('0x5b')][_0xa1b2('0x21')]({'where':_0x43e73b['where']})[_0xa1b2('0x26')](function(_0x48f1ba){_0x4e3d61[_0xa1b2('0x21')]=_0x48f1ba;if(_0x58473e[_0xa1b2('0x32')][_0xa1b2('0x42')]){_0x43e73b[_0xa1b2('0x43')]=[{'all':!![]}];}return db[_0xa1b2('0x5b')][_0xa1b2('0x44')](_0x43e73b);})[_0xa1b2('0x26')](function(_0x31bbc9){_0x4e3d61[_0xa1b2('0x45')]=_0x31bbc9;return _0x4e3d61;});}})[_0xa1b2('0x26')](respondWithFilteredResult(_0x202aab,_0x43e73b))[_0xa1b2('0x49')](handleError(_0x202aab,null));};exports[_0xa1b2('0x5e')]=function(_0x4ac76e,_0x2adafa,_0x1d4f4a){var _0x5c679a={'raw':!![],'where':{}};var _0x94747e={};var _0xb0913f={'count':0x0,'rows':[]};return db[_0xa1b2('0x2c')][_0xa1b2('0x5a')]({'where':{'id':_0x4ac76e['params']['id']}})[_0xa1b2('0x26')](handleEntityNotFound(_0x2adafa,null))[_0xa1b2('0x26')](function(_0x114706){if(_0x114706){_0x94747e['model']=_[_0xa1b2('0x33')](db[_0xa1b2('0x5f')]['rawAttributes']);_0x94747e[_0xa1b2('0x32')]=_[_0xa1b2('0x33')](_0x4ac76e[_0xa1b2('0x32')]);_0x94747e['filters']=_[_0xa1b2('0x35')](_0x94747e['model'],_0x94747e[_0xa1b2('0x32')]);_0x5c679a[_0xa1b2('0x36')]=_[_0xa1b2('0x35')](_0x94747e['model'],qs[_0xa1b2('0x37')](_0x4ac76e['query']['fields']));_0x5c679a['attributes']=_0x5c679a['attributes'][_0xa1b2('0x38')]?_0x5c679a[_0xa1b2('0x36')]:_0x94747e['model'];if(!_0x4ac76e[_0xa1b2('0x32')][_0xa1b2('0x39')](_0xa1b2('0x5c'))){_0x5c679a[_0xa1b2('0x20')]=qs[_0xa1b2('0x20')](_0x4ac76e['query']['limit']);_0x5c679a['offset']=qs['offset'](_0x4ac76e[_0xa1b2('0x32')][_0xa1b2('0x1e')]);}_0x5c679a['order']=qs[_0xa1b2('0x3b')](_0x4ac76e[_0xa1b2('0x32')]['sort']);_0x5c679a['where']=qs[_0xa1b2('0x34')](_[_0xa1b2('0x3d')](_0x4ac76e['query'],_0x94747e[_0xa1b2('0x34')]));_0x5c679a[_0xa1b2('0x3c')]['ProjectId']=_0x114706['id'];if(_0x4ac76e['query']['filter']){_0x5c679a[_0xa1b2('0x3c')]=_[_0xa1b2('0x3e')](_0x5c679a[_0xa1b2('0x3c')],{'$or':_[_0xa1b2('0x31')](_0x5c679a[_0xa1b2('0x36')],function(_0x4e01a4){var _0x2ea47b={};_0x2ea47b[_0x4e01a4]={'$like':'%'+_0x4ac76e['query'][_0xa1b2('0x40')]+'%'};return _0x2ea47b;})});}_0x5c679a=_[_0xa1b2('0x3e')]({},_0x5c679a,_0x4ac76e[_0xa1b2('0x41')]);return db[_0xa1b2('0x5f')]['count']({'where':_0x5c679a[_0xa1b2('0x3c')]})[_0xa1b2('0x26')](function(_0x130347){_0xb0913f[_0xa1b2('0x21')]=_0x130347;if(_0x4ac76e[_0xa1b2('0x32')]['includeAll']){_0x5c679a[_0xa1b2('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa1b2('0x44')](_0x5c679a);})[_0xa1b2('0x26')](function(_0x50b20b){_0xb0913f[_0xa1b2('0x45')]=_0x50b20b;return _0xb0913f;});}})['then'](respondWithFilteredResult(_0x2adafa,_0x5c679a))[_0xa1b2('0x49')](handleError(_0x2adafa,null));};function char(_0x1e6e96){return _0xa1b2('0x60')===typeof _0x1e6e96?String['fromCharCode']['apply'](null,arguments):_0x1e6e96;}function needsEncapsulation(_0xa1f19e){return!!_0xa1f19e&&(_0xa1f19e[_0xa1b2('0x61')]()[_0xa1b2('0x62')](char(0xd))>=0x0||_0xa1f19e[_0xa1b2('0x61')]()[_0xa1b2('0x62')](char(0xa))>=0x0||_0xa1f19e[_0xa1b2('0x61')]()[_0xa1b2('0x62')](char(0x2c))>=0x0||_0xa1f19e[_0xa1b2('0x61')]()[_0xa1b2('0x62')](char(0x22))>=0x0);}function encapsulate(_0x2c81fe){var _0x108e16=char(0x22),_0x420512='\x5c'+char(0x22),_0x2239c1=_0x2c81fe[_0xa1b2('0x61')]()[_0xa1b2('0x63')](new RegExp(_0x108e16,'g'),_0x420512);return _0x108e16+_0x2239c1+_0x108e16;}exports[_0xa1b2('0x64')]=function(_0x4ea1b1,_0x481c4d,_0x4a6b3c){var _0x3742d3,_0x4543d4;var _0x1941db={'where':{'ProjectId':_0x4ea1b1['params']['id']}};if(_0x4ea1b1['query']['startTime']){_0x1941db[_0xa1b2('0x3c')][_0xa1b2('0x65')]=JSON['parse'](_0x4ea1b1[_0xa1b2('0x32')][_0xa1b2('0x66')]);}return db[_0xa1b2('0x5b')][_0xa1b2('0x44')](_0x1941db)[_0xa1b2('0x26')](handleEntityNotFound(_0x481c4d,null))[_0xa1b2('0x26')](function(_0x1be191){if(_0x1be191){_0x3742d3=_0x1be191;return db[_0xa1b2('0x67')][_0xa1b2('0x44')]({'where':{'SessionId':{'$in':_[_0xa1b2('0x31')](_0x3742d3,'id')},'ProjectId':_0x4ea1b1[_0xa1b2('0x47')]['id']},'order':_0xa1b2('0x68')});}})[_0xa1b2('0x26')](handleEntityNotFound(_0x481c4d,null))[_0xa1b2('0x26')](function(_0x33517d){if(_0x33517d){_0x4543d4=_0x33517d;var _0x1e3a6a={};for(var _0x4ec39b=0x0,_0x38b1fb=_0x4543d4[_0xa1b2('0x38')];_0x4ec39b<_0x38b1fb;_0x4ec39b++){if(!_0x1e3a6a[_0xa1b2('0x39')](_0x4543d4[_0x4ec39b]['questionId'])){_0x1e3a6a[_0x4543d4[_0x4ec39b][_0xa1b2('0x69')]]=needsEncapsulation(_0x4543d4[_0x4ec39b][_0xa1b2('0x6a')])?encapsulate(_0x4543d4[_0x4ec39b]['question']):_0x4543d4[_0x4ec39b][_0xa1b2('0x6a')];}}var _0xac0b3f=[],_0x5babfc={};for(var _0x372ea7=0x0,_0x45d8ad=_0x3742d3[_0xa1b2('0x38')];_0x372ea7<_0x45d8ad;_0x372ea7++){_0x5babfc={'ProjectId':_0x4ea1b1['params']['id'],'SessionId':_0x3742d3[_0x372ea7]['id'],'StartTime':moment(_0x3742d3[_0x372ea7]['starttime'])['format'](_0xa1b2('0x6b'))};for(var _0x5ae678=0x0,_0x516ca7=_0x4543d4['length'];_0x5ae678<_0x516ca7;_0x5ae678++){if(_0x4543d4[_0x5ae678][_0xa1b2('0x6c')]==_0x3742d3[_0x372ea7]['id']&&_0x1e3a6a[_0xa1b2('0x39')](_0x4543d4[_0x5ae678][_0xa1b2('0x69')])){_0x5babfc[_0x1e3a6a[_0x4543d4[_0x5ae678][_0xa1b2('0x69')]]]=_0x4543d4[_0x5ae678][_0xa1b2('0x6d')];}}for(var _0x3e2417 in _0x1e3a6a){if(!_0x5babfc['hasOwnProperty'](_0x1e3a6a[_0x3e2417])){_0x5babfc[_0x1e3a6a[_0x3e2417]]=null;}}_0xac0b3f['push'](_0x5babfc);}return _0xac0b3f;}})['then'](function(_0x7a55da){if(!_[_0xa1b2('0x6e')](_0x7a55da)){var _0x2af985=toCsv(_0x7a55da);var _0x13727d=Date[_0xa1b2('0x6f')]();fs[_0xa1b2('0x70')](util['format'](_0xa1b2('0x71'),_0x4ea1b1[_0xa1b2('0x47')]['id'],_0x13727d),_0x2af985);_0x481c4d[_0xa1b2('0x72')](_0xa1b2('0x73'),_0xa1b2('0x74')+util['format'](_0xa1b2('0x75'),_0x4ea1b1[_0xa1b2('0x47')]['id'],_0x13727d));_0x481c4d[_0xa1b2('0x72')](_0xa1b2('0x76'),_0xa1b2('0x77'));return _0x481c4d[_0xa1b2('0x78')](util['format'](_0xa1b2('0x71'),_0x4ea1b1[_0xa1b2('0x47')]['id'],_0x13727d));}else{return _0x481c4d['sendStatus'](0xcc);}})[_0xa1b2('0x49')](handleError(_0x481c4d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2a649d0..97ef40b 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 _0x30bc=['./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x11395c,_0x1ad157){var _0x444483=function(_0x3131ca){while(--_0x3131ca){_0x11395c['push'](_0x11395c['shift']());}};_0x444483(++_0x1ad157);}(_0x30bc,0x149));var _0xc30b=function(_0x3b2c8e,_0x53910b){_0x3b2c8e=_0x3b2c8e-0x0;var _0x3ebe3d=_0x30bc[_0x3b2c8e];return _0x3ebe3d;};'use strict';var _=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var logger=require(_0xc30b('0x2'))('api');var moment=require(_0xc30b('0x3'));var BPromise=require(_0xc30b('0x4'));var rp=require(_0xc30b('0x5'));var fs=require('fs');var path=require(_0xc30b('0x6'));var rimraf=require(_0xc30b('0x7'));var config=require(_0xc30b('0x8'));var attributes=require(_0xc30b('0x9'));module[_0xc30b('0xa')]=function(_0x45f736,_0x3bce32){return _0x45f736['define'](_0xc30b('0xb'),attributes,{'tableName':_0xc30b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83d3=['define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4f65a5,_0x1519d5){var _0x2b7c97=function(_0x2fd1ad){while(--_0x2fd1ad){_0x4f65a5['push'](_0x4f65a5['shift']());}};_0x2b7c97(++_0x1519d5);}(_0x83d3,0x17c));var _0x383d=function(_0x57a97a,_0x3672e9){_0x57a97a=_0x57a97a-0x0;var _0x12a961=_0x83d3[_0x57a97a];return _0x12a961;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var logger=require(_0x383d('0x2'))(_0x383d('0x3'));var moment=require(_0x383d('0x4'));var BPromise=require('bluebird');var rp=require(_0x383d('0x5'));var fs=require('fs');var path=require(_0x383d('0x6'));var rimraf=require(_0x383d('0x7'));var config=require(_0x383d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x383d('0x9')]=function(_0x4f3c10,_0x50eaff){return _0x4f3c10[_0x383d('0xa')](_0x383d('0xb'),attributes,{'tableName':_0x383d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 3a39038..357cf6a 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 _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0xbdb7[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2f0ed7,_0x2207f5){var _0x5bbea4=function(_0x224b71){while(--_0x224b71){_0x2f0ed7['push'](_0x2f0ed7['shift']());}};_0x5bbea4(++_0x2207f5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x112a3d,_0x54671d){_0x112a3d=_0x112a3d-0x0;var _0x138faa=_0xf4eb[_0x112a3d];return _0x138faa;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f28e3a9..276759f 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 _0x10d0=['/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','show','post','create'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x10d0,0xfb));var _0x010d=function(_0x6cee37,_0xe8d08c){_0x6cee37=_0x6cee37-0x0;var _0x249e69=_0x10d0[_0x6cee37];return _0x249e69;};'use strict';var multer=require(_0x010d('0x0'));var util=require(_0x010d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x010d('0x2')]();var fs_extra=require(_0x010d('0x3'));var auth=require(_0x010d('0x4'));var interaction=require(_0x010d('0x5'));var config=require(_0x010d('0x6'));var controller=require(_0x010d('0x7'));router[_0x010d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x010d('0x8')](_0x010d('0x9'),auth[_0x010d('0xa')](),controller[_0x010d('0xb')]);router[_0x010d('0x8')]('/:id',auth[_0x010d('0xa')](),controller[_0x010d('0xc')]);router[_0x010d('0xd')]('/',auth[_0x010d('0xa')](),controller[_0x010d('0xe')]);router['put'](_0x010d('0xf'),auth[_0x010d('0xa')](),controller[_0x010d('0x10')]);router['delete'](_0x010d('0xf'),auth[_0x010d('0xa')](),controller[_0x010d('0x11')]);module[_0x010d('0x12')]=router; \ No newline at end of file +var _0xbecf=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x5d3155,_0x3f33dc){var _0xf0c7da=function(_0x51b3dc){while(--_0x51b3dc){_0x5d3155['push'](_0x5d3155['shift']());}};_0xf0c7da(++_0x3f33dc);}(_0xbecf,0x1d6));var _0xfbec=function(_0x31879c,_0x5f0e3e){_0x31879c=_0x31879c-0x0;var _0x1064d7=_0xbecf[_0x31879c];return _0x1064d7;};'use strict';var multer=require('multer');var util=require(_0xfbec('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfbec('0x1'));var router=express[_0xfbec('0x2')]();var fs_extra=require(_0xfbec('0x3'));var auth=require(_0xfbec('0x4'));var interaction=require(_0xfbec('0x5'));var config=require(_0xfbec('0x6'));var controller=require(_0xfbec('0x7'));router[_0xfbec('0x8')]('/',auth[_0xfbec('0x9')](),controller[_0xfbec('0xa')]);router['get'](_0xfbec('0xb'),auth[_0xfbec('0x9')](),controller[_0xfbec('0xc')]);router['get'](_0xfbec('0xd'),auth[_0xfbec('0x9')](),controller[_0xfbec('0xe')]);router[_0xfbec('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfbec('0x10')](_0xfbec('0xd'),auth[_0xfbec('0x9')](),controller['update']);router['delete'](_0xfbec('0xd'),auth[_0xfbec('0x9')](),controller[_0xfbec('0x11')]);module[_0xfbec('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ddab298..f9c63f3 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(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0xd11d96,_0x29f3d7){_0xd11d96=_0xd11d96-0x0;var _0xfc4007=_0x7a54[_0xd11d96];return _0xfc4007;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x4126bb,_0x8d15fd){_0x4126bb=_0x4126bb-0x0;var _0x3511e5=_0x7a54[_0x4126bb];return _0x3511e5;};'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 1531516..c39da80 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 _0xe52f=['nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../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','apply','save','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe52f,0x197));var _0xfe52=function(_0x5e6bc3,_0x1daeff){_0x5e6bc3=_0x5e6bc3-0x0;var _0x462142=_0xe52f[_0x5e6bc3];return _0x462142;};'use strict';var emlformat=require(_0xfe52('0x0'));var rimraf=require(_0xfe52('0x1'));var zipdir=require(_0xfe52('0x2'));var jsonpatch=require(_0xfe52('0x3'));var rp=require('request-promise');var moment=require(_0xfe52('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfe52('0x5'));var sox=require(_0xfe52('0x6'));var csv=require(_0xfe52('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe52('0x8'));var _=require(_0xfe52('0x9'));var squel=require('squel');var crypto=require(_0xfe52('0xa'));var jsforce=require(_0xfe52('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfe52('0xc'));var Papa=require(_0xfe52('0xd'));var Redis=require('ioredis');var authService=require(_0xfe52('0xe'));var qs=require(_0xfe52('0xf'));var as=require(_0xfe52('0x10'));var hardwareService=require(_0xfe52('0x11'));var logger=require(_0xfe52('0x12'))(_0xfe52('0x13'));var utils=require(_0xfe52('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfe52('0x15'));var db=require(_0xfe52('0x16'))['db'];function respondWithStatusCode(_0x36b1b1,_0x146379){_0x146379=_0x146379||0xcc;return function(_0x24d694){if(_0x24d694){return _0x36b1b1[_0xfe52('0x17')](_0x146379);}return _0x36b1b1[_0xfe52('0x18')](_0x146379)[_0xfe52('0x19')]();};}function respondWithResult(_0x3da944,_0x348e14){_0x348e14=_0x348e14||0xc8;return function(_0x2e09c4){if(_0x2e09c4){return _0x3da944['status'](_0x348e14)[_0xfe52('0x1a')](_0x2e09c4);}};}function respondWithFilteredResult(_0x1af6c8,_0xfb505b){return function(_0x1cf278){if(_0x1cf278){var _0x172a45=typeof _0xfb505b[_0xfe52('0x1b')]===_0xfe52('0x1c')&&typeof _0xfb505b[_0xfe52('0x1d')]===_0xfe52('0x1c');var _0x13dfcf=_0x1cf278[_0xfe52('0x1e')];var _0x444de4=_0x172a45?0x0:_0xfb505b[_0xfe52('0x1b')];var _0x18fffa=_0x172a45?_0x1cf278[_0xfe52('0x1e')]:_0xfb505b['offset']+_0xfb505b['limit'];var _0x17eb24;if(_0x18fffa>=_0x13dfcf){_0x18fffa=_0x13dfcf;_0x17eb24=0xc8;}else{_0x17eb24=0xce;}_0x1af6c8[_0xfe52('0x18')](_0x17eb24);return _0x1af6c8[_0xfe52('0x1f')]('Content-Range',_0x444de4+'-'+_0x18fffa+'/'+_0x13dfcf)[_0xfe52('0x1a')](_0x1cf278);}return null;};}function patchUpdates(_0x5b383e){return function(_0x4db03e){try{jsonpatch[_0xfe52('0x20')](_0x4db03e,_0x5b383e,!![]);}catch(_0x2fc4f3){return BPromise['reject'](_0x2fc4f3);}return _0x4db03e[_0xfe52('0x21')]();};}function saveUpdates(_0x2f180f,_0x29d1fd){return function(_0x1d45df){if(_0x1d45df){return _0x1d45df['update'](_0x2f180f)[_0xfe52('0x22')](function(_0x13735d){return _0x13735d;});}return null;};}function removeEntity(_0x356bfb,_0x59be39){return function(_0x2901b5){if(_0x2901b5){return _0x2901b5[_0xfe52('0x23')]()[_0xfe52('0x22')](function(){_0x356bfb[_0xfe52('0x18')](0xcc)[_0xfe52('0x19')]();});}};}function handleEntityNotFound(_0xeb561d,_0x463515){return function(_0x22aaed){if(!_0x22aaed){_0xeb561d[_0xfe52('0x17')](0x194);}return _0x22aaed;};}function handleError(_0x311d7f,_0x40ba39){_0x40ba39=_0x40ba39||0x1f4;return function(_0x6c8131){logger[_0xfe52('0x24')](_0x6c8131[_0xfe52('0x25')]);if(_0x6c8131[_0xfe52('0x26')]){delete _0x6c8131['name'];}_0x311d7f[_0xfe52('0x18')](_0x40ba39)[_0xfe52('0x27')](_0x6c8131);};}exports[_0xfe52('0x28')]=function(_0x57a50e,_0xe12ab5){var _0x40f4e0={},_0x4fc3d4={},_0x444707={'count':0x0,'rows':[]};var _0x52b554=_[_0xfe52('0x29')](db[_0xfe52('0x2a')][_0xfe52('0x2b')],function(_0x109770){return{'name':_0x109770[_0xfe52('0x2c')],'type':_0x109770['type'][_0xfe52('0x2d')]};});_0x4fc3d4[_0xfe52('0x2e')]=_[_0xfe52('0x29')](_0x52b554,'name');_0x4fc3d4['query']=_[_0xfe52('0x2f')](_0x57a50e[_0xfe52('0x30')]);_0x4fc3d4[_0xfe52('0x31')]=_[_0xfe52('0x32')](_0x4fc3d4[_0xfe52('0x2e')],_0x4fc3d4['query']);_0x40f4e0[_0xfe52('0x33')]=_['intersection'](_0x4fc3d4[_0xfe52('0x2e')],qs[_0xfe52('0x34')](_0x57a50e['query'][_0xfe52('0x34')]));_0x40f4e0[_0xfe52('0x33')]=_0x40f4e0['attributes'][_0xfe52('0x35')]?_0x40f4e0[_0xfe52('0x33')]:_0x4fc3d4[_0xfe52('0x2e')];if(!_0x57a50e['query'][_0xfe52('0x36')](_0xfe52('0x37'))){_0x40f4e0[_0xfe52('0x1d')]=qs[_0xfe52('0x1d')](_0x57a50e['query'][_0xfe52('0x1d')]);_0x40f4e0['offset']=qs[_0xfe52('0x1b')](_0x57a50e[_0xfe52('0x30')][_0xfe52('0x1b')]);}_0x40f4e0[_0xfe52('0x38')]=qs[_0xfe52('0x39')](_0x57a50e['query']['sort']);_0x40f4e0[_0xfe52('0x3a')]=qs[_0xfe52('0x31')](_[_0xfe52('0x3b')](_0x57a50e[_0xfe52('0x30')],_0x4fc3d4[_0xfe52('0x31')]),_0x52b554);if(_0x57a50e[_0xfe52('0x30')][_0xfe52('0x3c')]){_0x40f4e0[_0xfe52('0x3a')]=_['merge'](_0x40f4e0[_0xfe52('0x3a')],{'$or':_[_0xfe52('0x29')](_0x52b554,function(_0x1c87fd){if(_0x1c87fd[_0xfe52('0x3d')]!==_0xfe52('0x3e')){var _0x4a9024={};_0x4a9024[_0x1c87fd[_0xfe52('0x26')]]={'$like':'%'+_0x57a50e[_0xfe52('0x30')]['filter']+'%'};return _0x4a9024;}})});}_0x40f4e0=_[_0xfe52('0x3f')]({},_0x40f4e0,_0x57a50e[_0xfe52('0x40')]);var _0x5b8a96={'where':_0x40f4e0['where']};return db[_0xfe52('0x2a')][_0xfe52('0x1e')](_0x5b8a96)[_0xfe52('0x22')](function(_0x403954){_0x444707[_0xfe52('0x1e')]=_0x403954;if(_0x57a50e['query'][_0xfe52('0x41')]){_0x40f4e0[_0xfe52('0x42')]=[{'all':!![]}];}return db[_0xfe52('0x2a')][_0xfe52('0x43')](_0x40f4e0);})[_0xfe52('0x22')](function(_0x557cb4){_0x444707[_0xfe52('0x44')]=_0x557cb4;return _0x444707;})['then'](respondWithFilteredResult(_0xe12ab5,_0x40f4e0))['catch'](handleError(_0xe12ab5,null));};exports[_0xfe52('0x45')]=function(_0xdbd288,_0x45232c){var _0x3589c7={'raw':!![],'where':{'id':_0xdbd288['params']['id']}},_0x2ad985={};_0x2ad985[_0xfe52('0x2e')]=_[_0xfe52('0x2f')](db[_0xfe52('0x2a')][_0xfe52('0x2b')]);_0x2ad985[_0xfe52('0x30')]=_[_0xfe52('0x2f')](_0xdbd288[_0xfe52('0x30')]);_0x2ad985[_0xfe52('0x31')]=_[_0xfe52('0x32')](_0x2ad985['model'],_0x2ad985[_0xfe52('0x30')]);_0x3589c7[_0xfe52('0x33')]=_['intersection'](_0x2ad985[_0xfe52('0x2e')],qs[_0xfe52('0x34')](_0xdbd288[_0xfe52('0x30')][_0xfe52('0x34')]));_0x3589c7[_0xfe52('0x33')]=_0x3589c7[_0xfe52('0x33')][_0xfe52('0x35')]?_0x3589c7[_0xfe52('0x33')]:_0x2ad985[_0xfe52('0x2e')];if(_0xdbd288['query'][_0xfe52('0x41')]){_0x3589c7[_0xfe52('0x42')]=[{'all':!![]}];}_0x3589c7=_[_0xfe52('0x3f')]({},_0x3589c7,_0xdbd288[_0xfe52('0x40')]);return db[_0xfe52('0x2a')][_0xfe52('0x46')](_0x3589c7)[_0xfe52('0x22')](handleEntityNotFound(_0x45232c,null))['then'](respondWithResult(_0x45232c,null))['catch'](handleError(_0x45232c,null));};exports[_0xfe52('0x47')]=function(_0xb0ffec,_0x25c8e0){return db[_0xfe52('0x2a')][_0xfe52('0x47')](_0xb0ffec[_0xfe52('0x48')],{})[_0xfe52('0x22')](respondWithResult(_0x25c8e0,0xc9))[_0xfe52('0x49')](handleError(_0x25c8e0,null));};exports[_0xfe52('0x4a')]=function(_0x394970,_0x48ff60){if(_0x394970[_0xfe52('0x48')]['id']){delete _0x394970[_0xfe52('0x48')]['id'];}return db[_0xfe52('0x2a')][_0xfe52('0x46')]({'where':{'id':_0x394970[_0xfe52('0x4b')]['id']}})[_0xfe52('0x22')](handleEntityNotFound(_0x48ff60,null))[_0xfe52('0x22')](saveUpdates(_0x394970['body'],null))[_0xfe52('0x22')](respondWithResult(_0x48ff60,null))[_0xfe52('0x49')](handleError(_0x48ff60,null));};exports['destroy']=function(_0x2b9f55,_0x2249a2){return db[_0xfe52('0x2a')]['find']({'where':{'id':_0x2b9f55['params']['id']}})[_0xfe52('0x22')](handleEntityNotFound(_0x2249a2,null))['then'](removeEntity(_0x2249a2,null))[_0xfe52('0x49')](handleError(_0x2249a2,null));};exports[_0xfe52('0x4c')]=function(_0x2a76f7,_0x11db98){return db[_0xfe52('0x2a')][_0xfe52('0x4c')]()[_0xfe52('0x22')](respondWithResult(_0x11db98,null))[_0xfe52('0x49')](handleError(_0x11db98,null));}; \ No newline at end of file +var _0x38e1=['hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length'];(function(_0x897041,_0x560c56){var _0x433426=function(_0x20e9ab){while(--_0x20e9ab){_0x897041['push'](_0x897041['shift']());}};_0x433426(++_0x560c56);}(_0x38e1,0xb0));var _0x138e=function(_0xf61dfd,_0x4682c9){_0xf61dfd=_0xf61dfd-0x0;var _0x1fcfb0=_0x38e1[_0xf61dfd];return _0x1fcfb0;};'use strict';var emlformat=require(_0x138e('0x0'));var rimraf=require(_0x138e('0x1'));var zipdir=require(_0x138e('0x2'));var jsonpatch=require(_0x138e('0x3'));var rp=require(_0x138e('0x4'));var moment=require(_0x138e('0x5'));var BPromise=require(_0x138e('0x6'));var Mustache=require(_0x138e('0x7'));var util=require(_0x138e('0x8'));var path=require(_0x138e('0x9'));var sox=require(_0x138e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x138e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x138e('0xc'));var jsforce=require(_0x138e('0xd'));var deskjs=require(_0x138e('0xe'));var toCsv=require(_0x138e('0xf'));var querystring=require('querystring');var Papa=require(_0x138e('0x10'));var Redis=require(_0x138e('0x11'));var authService=require(_0x138e('0x12'));var qs=require(_0x138e('0x13'));var as=require(_0x138e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x138e('0x15'))('api');var utils=require(_0x138e('0x16'));var config=require(_0x138e('0x17'));var licenseUtil=require(_0x138e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x98c150,_0x2f8bd5){_0x2f8bd5=_0x2f8bd5||0xcc;return function(_0x42991e){if(_0x42991e){return _0x98c150[_0x138e('0x19')](_0x2f8bd5);}return _0x98c150[_0x138e('0x1a')](_0x2f8bd5)['end']();};}function respondWithResult(_0x4caf4b,_0x1f7fdc){_0x1f7fdc=_0x1f7fdc||0xc8;return function(_0x13b904){if(_0x13b904){return _0x4caf4b['status'](_0x1f7fdc)[_0x138e('0x1b')](_0x13b904);}};}function respondWithFilteredResult(_0x3b4e5c,_0x2d27af){return function(_0xefdbff){if(_0xefdbff){var _0x5bd761=typeof _0x2d27af['offset']===_0x138e('0x1c')&&typeof _0x2d27af[_0x138e('0x1d')]===_0x138e('0x1c');var _0x1742c9=_0xefdbff[_0x138e('0x1e')];var _0x466d81=_0x5bd761?0x0:_0x2d27af['offset'];var _0x16dc96=_0x5bd761?_0xefdbff['count']:_0x2d27af[_0x138e('0x1f')]+_0x2d27af[_0x138e('0x1d')];var _0x3bd78c;if(_0x16dc96>=_0x1742c9){_0x16dc96=_0x1742c9;_0x3bd78c=0xc8;}else{_0x3bd78c=0xce;}_0x3b4e5c['status'](_0x3bd78c);return _0x3b4e5c[_0x138e('0x20')](_0x138e('0x21'),_0x466d81+'-'+_0x16dc96+'/'+_0x1742c9)[_0x138e('0x1b')](_0xefdbff);}return null;};}function patchUpdates(_0xb8bca){return function(_0x4e6a24){try{jsonpatch[_0x138e('0x22')](_0x4e6a24,_0xb8bca,!![]);}catch(_0x465efd){return BPromise[_0x138e('0x23')](_0x465efd);}return _0x4e6a24[_0x138e('0x24')]();};}function saveUpdates(_0x233ce5,_0xac94da){return function(_0x3ce5bd){if(_0x3ce5bd){return _0x3ce5bd[_0x138e('0x25')](_0x233ce5)[_0x138e('0x26')](function(_0x5ae52a){return _0x5ae52a;});}return null;};}function removeEntity(_0x46cea9,_0x4b6d78){return function(_0x2545d2){if(_0x2545d2){return _0x2545d2['destroy']()['then'](function(){_0x46cea9[_0x138e('0x1a')](0xcc)[_0x138e('0x27')]();});}};}function handleEntityNotFound(_0x2c19c7,_0x463ed2){return function(_0x299e72){if(!_0x299e72){_0x2c19c7[_0x138e('0x19')](0x194);}return _0x299e72;};}function handleError(_0x2c6959,_0x1134c7){_0x1134c7=_0x1134c7||0x1f4;return function(_0x379b8b){logger[_0x138e('0x28')](_0x379b8b['stack']);if(_0x379b8b[_0x138e('0x29')]){delete _0x379b8b[_0x138e('0x29')];}_0x2c6959['status'](_0x1134c7)['send'](_0x379b8b);};}exports[_0x138e('0x2a')]=function(_0x2ac761,_0x24c130){var _0x539bd4={},_0x1d865d={},_0x2590da={'count':0x0,'rows':[]};var _0x96d1fb=_[_0x138e('0x2b')](db[_0x138e('0x2c')][_0x138e('0x2d')],function(_0x4dcaa7){return{'name':_0x4dcaa7[_0x138e('0x2e')],'type':_0x4dcaa7[_0x138e('0x2f')][_0x138e('0x30')]};});_0x1d865d[_0x138e('0x31')]=_[_0x138e('0x2b')](_0x96d1fb,'name');_0x1d865d['query']=_['keys'](_0x2ac761[_0x138e('0x32')]);_0x1d865d['filters']=_[_0x138e('0x33')](_0x1d865d[_0x138e('0x31')],_0x1d865d[_0x138e('0x32')]);_0x539bd4[_0x138e('0x34')]=_['intersection'](_0x1d865d[_0x138e('0x31')],qs[_0x138e('0x35')](_0x2ac761[_0x138e('0x32')][_0x138e('0x35')]));_0x539bd4[_0x138e('0x34')]=_0x539bd4[_0x138e('0x34')][_0x138e('0x36')]?_0x539bd4[_0x138e('0x34')]:_0x1d865d[_0x138e('0x31')];if(!_0x2ac761[_0x138e('0x32')][_0x138e('0x37')]('nolimit')){_0x539bd4[_0x138e('0x1d')]=qs['limit'](_0x2ac761['query'][_0x138e('0x1d')]);_0x539bd4[_0x138e('0x1f')]=qs[_0x138e('0x1f')](_0x2ac761[_0x138e('0x32')][_0x138e('0x1f')]);}_0x539bd4[_0x138e('0x38')]=qs[_0x138e('0x39')](_0x2ac761[_0x138e('0x32')]['sort']);_0x539bd4[_0x138e('0x3a')]=qs[_0x138e('0x3b')](_[_0x138e('0x3c')](_0x2ac761[_0x138e('0x32')],_0x1d865d[_0x138e('0x3b')]),_0x96d1fb);if(_0x2ac761[_0x138e('0x32')][_0x138e('0x3d')]){_0x539bd4[_0x138e('0x3a')]=_[_0x138e('0x3e')](_0x539bd4['where'],{'$or':_[_0x138e('0x2b')](_0x96d1fb,function(_0x58c0d5){if(_0x58c0d5[_0x138e('0x2f')]!==_0x138e('0x3f')){var _0x242c19={};_0x242c19[_0x58c0d5[_0x138e('0x29')]]={'$like':'%'+_0x2ac761[_0x138e('0x32')][_0x138e('0x3d')]+'%'};return _0x242c19;}})});}_0x539bd4=_[_0x138e('0x3e')]({},_0x539bd4,_0x2ac761[_0x138e('0x40')]);var _0x267c8e={'where':_0x539bd4[_0x138e('0x3a')]};return db[_0x138e('0x2c')]['count'](_0x267c8e)[_0x138e('0x26')](function(_0x32952b){_0x2590da[_0x138e('0x1e')]=_0x32952b;if(_0x2ac761[_0x138e('0x32')][_0x138e('0x41')]){_0x539bd4[_0x138e('0x42')]=[{'all':!![]}];}return db[_0x138e('0x2c')][_0x138e('0x43')](_0x539bd4);})[_0x138e('0x26')](function(_0x603f08){_0x2590da[_0x138e('0x44')]=_0x603f08;return _0x2590da;})[_0x138e('0x26')](respondWithFilteredResult(_0x24c130,_0x539bd4))[_0x138e('0x45')](handleError(_0x24c130,null));};exports['show']=function(_0x1a6cce,_0x572960){var _0x4e3231={'raw':!![],'where':{'id':_0x1a6cce[_0x138e('0x46')]['id']}},_0x12d41d={};_0x12d41d['model']=_[_0x138e('0x47')](db[_0x138e('0x2c')][_0x138e('0x2d')]);_0x12d41d['query']=_[_0x138e('0x47')](_0x1a6cce['query']);_0x12d41d[_0x138e('0x3b')]=_[_0x138e('0x33')](_0x12d41d[_0x138e('0x31')],_0x12d41d['query']);_0x4e3231[_0x138e('0x34')]=_['intersection'](_0x12d41d[_0x138e('0x31')],qs['fields'](_0x1a6cce[_0x138e('0x32')][_0x138e('0x35')]));_0x4e3231[_0x138e('0x34')]=_0x4e3231[_0x138e('0x34')]['length']?_0x4e3231['attributes']:_0x12d41d[_0x138e('0x31')];if(_0x1a6cce[_0x138e('0x32')][_0x138e('0x41')]){_0x4e3231[_0x138e('0x42')]=[{'all':!![]}];}_0x4e3231=_[_0x138e('0x3e')]({},_0x4e3231,_0x1a6cce[_0x138e('0x40')]);return db[_0x138e('0x2c')][_0x138e('0x48')](_0x4e3231)[_0x138e('0x26')](handleEntityNotFound(_0x572960,null))['then'](respondWithResult(_0x572960,null))[_0x138e('0x45')](handleError(_0x572960,null));};exports[_0x138e('0x49')]=function(_0x4b4a0b,_0x42062b){return db[_0x138e('0x2c')][_0x138e('0x49')](_0x4b4a0b['body'],{})[_0x138e('0x26')](respondWithResult(_0x42062b,0xc9))['catch'](handleError(_0x42062b,null));};exports[_0x138e('0x25')]=function(_0x77198a,_0x8d15e9){if(_0x77198a[_0x138e('0x4a')]['id']){delete _0x77198a[_0x138e('0x4a')]['id'];}return db[_0x138e('0x2c')]['find']({'where':{'id':_0x77198a['params']['id']}})[_0x138e('0x26')](handleEntityNotFound(_0x8d15e9,null))[_0x138e('0x26')](saveUpdates(_0x77198a[_0x138e('0x4a')],null))['then'](respondWithResult(_0x8d15e9,null))[_0x138e('0x45')](handleError(_0x8d15e9,null));};exports[_0x138e('0x4b')]=function(_0x44a62b,_0x407844){return db['JscriptyQuestionReport'][_0x138e('0x48')]({'where':{'id':_0x44a62b[_0x138e('0x46')]['id']}})[_0x138e('0x26')](handleEntityNotFound(_0x407844,null))[_0x138e('0x26')](removeEntity(_0x407844,null))[_0x138e('0x45')](handleError(_0x407844,null));};exports['describe']=function(_0x390388,_0xe6047){return db[_0x138e('0x2c')][_0x138e('0x4c')]()['then'](respondWithResult(_0xe6047,null))[_0x138e('0x45')](handleError(_0xe6047,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a6bb258..4ce14e7 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 _0x6d90=['report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','JscriptyQuestionReport'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6d90,0x10f));var _0x06d9=function(_0xa3ec8e,_0x35f872){_0xa3ec8e=_0xa3ec8e-0x0;var _0x388a9c=_0x6d90[_0xa3ec8e];return _0x388a9c;};'use strict';var _=require(_0x06d9('0x0'));var util=require(_0x06d9('0x1'));var logger=require(_0x06d9('0x2'))(_0x06d9('0x3'));var moment=require(_0x06d9('0x4'));var BPromise=require(_0x06d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x06d9('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x06d9('0x7')]=function(_0x36e341,_0x29c3dc){return _0x36e341['define'](_0x06d9('0x8'),attributes,{'tableName':_0x06d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xede6=['JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xede6,0x9c));var _0x6ede=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xede6[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ede('0x0'))(_0x6ede('0x1'));var moment=require('moment');var BPromise=require(_0x6ede('0x2'));var rp=require(_0x6ede('0x3'));var fs=require('fs');var path=require(_0x6ede('0x4'));var rimraf=require('rimraf');var config=require(_0x6ede('0x5'));var attributes=require(_0x6ede('0x6'));module[_0x6ede('0x7')]=function(_0x2f0ba1,_0x1e3d3a){return _0x2f0ba1[_0x6ede('0x8')](_0x6ede('0x9'),attributes,{'tableName':_0x6ede('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index c375af8..3defef6 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 _0x8328=['stringify','error','code','message','info','result','lodash','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x8328,0x1da));var _0x8832=function(_0x13fd15,_0x554955){_0x13fd15=_0x13fd15-0x0;var _0x4f5554=_0x8328[_0x13fd15];return _0x4f5554;};'use strict';var _=require(_0x8832('0x0'));var util=require('util');var moment=require(_0x8832('0x1'));var BPromise=require(_0x8832('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8832('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x8832('0x4'));var jayson=require(_0x8832('0x5'));var client=jayson[_0x8832('0x6')][_0x8832('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa43461,_0x47f6ab,_0x2114f6){return new BPromise(function(_0x281c29,_0x1127ef){return client[_0x8832('0x8')](_0xa43461,_0x2114f6)[_0x8832('0x9')](function(_0x396d4e){logger['info'](_0x8832('0xa'),_0x47f6ab,'request\x20sent');logger[_0x8832('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x47f6ab,'request\x20sent',JSON[_0x8832('0xc')](_0x396d4e));if(_0x396d4e[_0x8832('0xd')]){if(_0x396d4e[_0x8832('0xd')][_0x8832('0xe')]===0x1f4){logger['error'](_0x8832('0xa'),_0x47f6ab,_0x396d4e[_0x8832('0xd')][_0x8832('0xf')]);return _0x1127ef(_0x396d4e[_0x8832('0xd')]['message']);}logger[_0x8832('0xd')](_0x8832('0xa'),_0x47f6ab,_0x396d4e[_0x8832('0xd')][_0x8832('0xf')]);return _0x281c29(_0x396d4e['error']['message']);}else{logger[_0x8832('0x10')](_0x8832('0xa'),_0x47f6ab,'request\x20sent');_0x281c29(_0x396d4e[_0x8832('0x11')][_0x8832('0xf')]);}})['catch'](function(_0x57b2da){logger[_0x8832('0xd')](_0x8832('0xa'),_0x47f6ab,_0x57b2da);_0x1127ef(_0x57b2da);});});} \ No newline at end of file +var _0x8ec7=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8ec7,0x18e));var _0x78ec=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x8ec7[_0x673722];return _0x21249c;};'use strict';var _=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var moment=require(_0x78ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x78ec('0x3'));var fs=require('fs');var Redis=require(_0x78ec('0x4'));var db=require(_0x78ec('0x5'))['db'];var utils=require(_0x78ec('0x6'));var logger=require(_0x78ec('0x7'))('rpc');var config=require(_0x78ec('0x8'));var jayson=require(_0x78ec('0x9'));var client=jayson[_0x78ec('0xa')][_0x78ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f354f,_0x298b83,_0x4ba5a7){return new BPromise(function(_0x4add9b,_0x288230){return client['request'](_0x2f354f,_0x4ba5a7)[_0x78ec('0xc')](function(_0x2847ff){logger[_0x78ec('0xd')](_0x78ec('0xe'),_0x298b83,'request\x20sent');logger[_0x78ec('0xf')](_0x78ec('0x10'),_0x298b83,_0x78ec('0x11'),JSON[_0x78ec('0x12')](_0x2847ff));if(_0x2847ff[_0x78ec('0x13')]){if(_0x2847ff['error'][_0x78ec('0x14')]===0x1f4){logger[_0x78ec('0x13')](_0x78ec('0xe'),_0x298b83,_0x2847ff[_0x78ec('0x13')]['message']);return _0x288230(_0x2847ff[_0x78ec('0x13')]['message']);}logger[_0x78ec('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x298b83,_0x2847ff['error'][_0x78ec('0x15')]);return _0x4add9b(_0x2847ff[_0x78ec('0x13')]['message']);}else{logger[_0x78ec('0xd')](_0x78ec('0xe'),_0x298b83,_0x78ec('0x11'));_0x4add9b(_0x2847ff['result']['message']);}})[_0x78ec('0x16')](function(_0x358467){logger[_0x78ec('0x13')](_0x78ec('0xe'),_0x298b83,_0x358467);_0x288230(_0x358467);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a8faecb..cbe7f81 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 _0xe7b4=['getQuestions','post','create','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0xe7b4,0xec));var _0x4e7b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe7b4[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x4e7b('0x0'));var util=require(_0x4e7b('0x1'));var path=require(_0x4e7b('0x2'));var timeout=require(_0x4e7b('0x3'));var express=require(_0x4e7b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4e7b('0x5'));var interaction=require(_0x4e7b('0x6'));var config=require(_0x4e7b('0x7'));var controller=require(_0x4e7b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e7b('0x9')]);router[_0x4e7b('0xa')](_0x4e7b('0xb'),auth[_0x4e7b('0xc')](),controller[_0x4e7b('0xd')]);router[_0x4e7b('0xa')](_0x4e7b('0xe'),auth[_0x4e7b('0xc')](),controller[_0x4e7b('0xf')]);router['get'](_0x4e7b('0x10'),auth[_0x4e7b('0xc')](),controller[_0x4e7b('0x11')]);router[_0x4e7b('0x12')]('/',auth[_0x4e7b('0xc')](),controller[_0x4e7b('0x13')]);router[_0x4e7b('0x14')](_0x4e7b('0xe'),auth[_0x4e7b('0xc')](),controller[_0x4e7b('0x15')]);router[_0x4e7b('0x16')](_0x4e7b('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4831=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','/:id','/:id/questions','getQuestions','post','create','put','destroy','exports','util','path','Router'];(function(_0x38ca01,_0x34c7de){var _0x86cd86=function(_0x199cac){while(--_0x199cac){_0x38ca01['push'](_0x38ca01['shift']());}};_0x86cd86(++_0x34c7de);}(_0x4831,0x166));var _0x1483=function(_0x35873a,_0x3ed5f4){_0x35873a=_0x35873a-0x0;var _0x85075d=_0x4831[_0x35873a];return _0x85075d;};'use strict';var multer=require('multer');var util=require(_0x1483('0x0'));var path=require(_0x1483('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1483('0x2')]();var fs_extra=require(_0x1483('0x3'));var auth=require(_0x1483('0x4'));var interaction=require(_0x1483('0x5'));var config=require(_0x1483('0x6'));var controller=require(_0x1483('0x7'));router[_0x1483('0x8')]('/',auth[_0x1483('0x9')](),controller['index']);router[_0x1483('0x8')](_0x1483('0xa'),auth[_0x1483('0x9')](),controller['describe']);router[_0x1483('0x8')](_0x1483('0xb'),auth[_0x1483('0x9')](),controller['show']);router[_0x1483('0x8')](_0x1483('0xc'),auth['isAuthenticated'](),controller[_0x1483('0xd')]);router[_0x1483('0xe')]('/',auth[_0x1483('0x9')](),controller[_0x1483('0xf')]);router[_0x1483('0x10')](_0x1483('0xb'),auth[_0x1483('0x9')](),controller['update']);router['delete'](_0x1483('0xb'),auth[_0x1483('0x9')](),controller[_0x1483('0x11')]);module[_0x1483('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d8e5260..14a642e 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 _0xf0de=['STRING','BOOLEAN','moment','DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x28a471,_0x80beab){var _0x59c413=function(_0x10426e){while(--_0x10426e){_0x28a471['push'](_0x28a471['shift']());}};_0x59c413(++_0x80beab);}(_0xf0de,0x7a));var _0xef0d=function(_0x1ba9ba,_0x5dbde0){_0x1ba9ba=_0x1ba9ba-0x0;var _0x5e363f=_0xf0de[_0x1ba9ba];return _0x5e363f;};'use strict';var moment=require(_0xef0d('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xef0d('0x1')],'set':function(_0x3c88fd){this['setDataValue'](_0xef0d('0x2'),_0x3c88fd);this[_0xef0d('0x3')](_0xef0d('0x4'),moment()['format'](_0xef0d('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xef0d('0x6')]},'projectname':{'type':Sequelize[_0xef0d('0x6')]},'queue':{'type':Sequelize[_0xef0d('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xef0d('0x6')]},'calleridnum':{'type':Sequelize[_0xef0d('0x6')]},'completed':{'type':Sequelize[_0xef0d('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xe07e=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','exports','DATE','setDataValue','starttime','format'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xe07e,0xa3));var _0xee07=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0xe07e[_0x3d8ca8];return _0x517e45;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xee07('0x0')]={'starttime':{'type':Sequelize[_0xee07('0x1')],'set':function(_0x2d6c90){this[_0xee07('0x2')](_0xee07('0x3'),_0x2d6c90);this[_0xee07('0x2')]('endtime',moment()[_0xee07('0x4')](_0xee07('0x5')));}},'endtime':{'type':Sequelize[_0xee07('0x1')]},'membername':{'type':Sequelize[_0xee07('0x6')]},'projectname':{'type':Sequelize[_0xee07('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xee07('0x6')]},'calleridnum':{'type':Sequelize[_0xee07('0x6')]},'completed':{'type':Sequelize[_0xee07('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 17a8f3e..1cf324b 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 _0xf07b=['destroy','end','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','find','catch','body','params','describe','getQuestions','findOne','nolimit','pick','includeAll','JscriptyQuestionReport','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','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf07b,0x113));var _0xbf07=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xf07b[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xbf07('0x0'));var rimraf=require(_0xbf07('0x1'));var zipdir=require(_0xbf07('0x2'));var jsonpatch=require(_0xbf07('0x3'));var rp=require(_0xbf07('0x4'));var moment=require(_0xbf07('0x5'));var BPromise=require(_0xbf07('0x6'));var Mustache=require(_0xbf07('0x7'));var util=require(_0xbf07('0x8'));var path=require(_0xbf07('0x9'));var sox=require(_0xbf07('0xa'));var csv=require(_0xbf07('0xb'));var ejs=require(_0xbf07('0xc'));var fs=require('fs');var fs_extra=require(_0xbf07('0xd'));var _=require('lodash');var squel=require(_0xbf07('0xe'));var crypto=require(_0xbf07('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf07('0xb'));var querystring=require(_0xbf07('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbf07('0x11'));var qs=require(_0xbf07('0x12'));var as=require(_0xbf07('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf07('0x14'));var utils=require(_0xbf07('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbf07('0x16'))['db'];function respondWithStatusCode(_0x59a5a1,_0x351d22){_0x351d22=_0x351d22||0xcc;return function(_0x2bd914){if(_0x2bd914){return _0x59a5a1[_0xbf07('0x17')](_0x351d22);}return _0x59a5a1[_0xbf07('0x18')](_0x351d22)['end']();};}function respondWithResult(_0x26c8eb,_0x5678ec){_0x5678ec=_0x5678ec||0xc8;return function(_0x29951c){if(_0x29951c){return _0x26c8eb[_0xbf07('0x18')](_0x5678ec)[_0xbf07('0x19')](_0x29951c);}};}function respondWithFilteredResult(_0xe07a80,_0x364ea4){return function(_0x447990){if(_0x447990){var _0x1ce9fb=typeof _0x364ea4[_0xbf07('0x1a')]===_0xbf07('0x1b')&&typeof _0x364ea4['limit']===_0xbf07('0x1b');var _0x9f3377=_0x447990[_0xbf07('0x1c')];var _0x32388f=_0x1ce9fb?0x0:_0x364ea4['offset'];var _0x1ac644=_0x1ce9fb?_0x447990['count']:_0x364ea4['offset']+_0x364ea4[_0xbf07('0x1d')];var _0x3ccabb;if(_0x1ac644>=_0x9f3377){_0x1ac644=_0x9f3377;_0x3ccabb=0xc8;}else{_0x3ccabb=0xce;}_0xe07a80['status'](_0x3ccabb);return _0xe07a80[_0xbf07('0x1e')](_0xbf07('0x1f'),_0x32388f+'-'+_0x1ac644+'/'+_0x9f3377)[_0xbf07('0x19')](_0x447990);}return null;};}function patchUpdates(_0x2fd5ca){return function(_0x386970){try{jsonpatch[_0xbf07('0x20')](_0x386970,_0x2fd5ca,!![]);}catch(_0x324882){return BPromise[_0xbf07('0x21')](_0x324882);}return _0x386970[_0xbf07('0x22')]();};}function saveUpdates(_0x1705e7,_0x23520e){return function(_0x43cdcf){if(_0x43cdcf){return _0x43cdcf[_0xbf07('0x23')](_0x1705e7)[_0xbf07('0x24')](function(_0x5880c9){return _0x5880c9;});}return null;};}function removeEntity(_0x3feb42,_0x24c3ee){return function(_0x35d9f8){if(_0x35d9f8){return _0x35d9f8[_0xbf07('0x25')]()[_0xbf07('0x24')](function(){_0x3feb42[_0xbf07('0x18')](0xcc)[_0xbf07('0x26')]();});}};}function handleEntityNotFound(_0xc90268,_0x21a92b){return function(_0x2a4206){if(!_0x2a4206){_0xc90268['sendStatus'](0x194);}return _0x2a4206;};}function handleError(_0x4c561e,_0x28eced){_0x28eced=_0x28eced||0x1f4;return function(_0x18f9d0){logger['error'](_0x18f9d0[_0xbf07('0x27')]);if(_0x18f9d0[_0xbf07('0x28')]){delete _0x18f9d0[_0xbf07('0x28')];}_0x4c561e[_0xbf07('0x18')](_0x28eced)[_0xbf07('0x29')](_0x18f9d0);};}exports[_0xbf07('0x2a')]=function(_0x29c3ec,_0x17d4b1){var _0x2d0b86={},_0x203782={},_0x2fea97={'count':0x0,'rows':[]};var _0x10aef3=_[_0xbf07('0x2b')](db[_0xbf07('0x2c')][_0xbf07('0x2d')],function(_0x2036d5){return{'name':_0x2036d5[_0xbf07('0x2e')],'type':_0x2036d5['type'][_0xbf07('0x2f')]};});_0x203782['model']=_[_0xbf07('0x2b')](_0x10aef3,_0xbf07('0x28'));_0x203782[_0xbf07('0x30')]=_[_0xbf07('0x31')](_0x29c3ec[_0xbf07('0x30')]);_0x203782[_0xbf07('0x32')]=_[_0xbf07('0x33')](_0x203782[_0xbf07('0x34')],_0x203782[_0xbf07('0x30')]);_0x2d0b86['attributes']=_[_0xbf07('0x33')](_0x203782[_0xbf07('0x34')],qs[_0xbf07('0x35')](_0x29c3ec[_0xbf07('0x30')]['fields']));_0x2d0b86[_0xbf07('0x36')]=_0x2d0b86[_0xbf07('0x36')][_0xbf07('0x37')]?_0x2d0b86['attributes']:_0x203782[_0xbf07('0x34')];if(!_0x29c3ec[_0xbf07('0x30')][_0xbf07('0x38')]('nolimit')){_0x2d0b86[_0xbf07('0x1d')]=qs[_0xbf07('0x1d')](_0x29c3ec['query'][_0xbf07('0x1d')]);_0x2d0b86[_0xbf07('0x1a')]=qs[_0xbf07('0x1a')](_0x29c3ec['query'][_0xbf07('0x1a')]);}_0x2d0b86[_0xbf07('0x39')]=qs[_0xbf07('0x3a')](_0x29c3ec['query']['sort']);_0x2d0b86[_0xbf07('0x3b')]=qs[_0xbf07('0x32')](_['pick'](_0x29c3ec[_0xbf07('0x30')],_0x203782[_0xbf07('0x32')]),_0x10aef3);if(_0x29c3ec[_0xbf07('0x30')][_0xbf07('0x3c')]){_0x2d0b86[_0xbf07('0x3b')]=_[_0xbf07('0x3d')](_0x2d0b86[_0xbf07('0x3b')],{'$or':_[_0xbf07('0x2b')](_0x10aef3,function(_0xfd60bf){if(_0xfd60bf['type']!==_0xbf07('0x3e')){var _0xfc2757={};_0xfc2757[_0xfd60bf[_0xbf07('0x28')]]={'$like':'%'+_0x29c3ec[_0xbf07('0x30')][_0xbf07('0x3c')]+'%'};return _0xfc2757;}})});}_0x2d0b86=_[_0xbf07('0x3d')]({},_0x2d0b86,_0x29c3ec[_0xbf07('0x3f')]);var _0x11138c={'where':_0x2d0b86['where']};return db['JscriptySessionReport'][_0xbf07('0x1c')](_0x11138c)[_0xbf07('0x24')](function(_0x2739bc){_0x2fea97[_0xbf07('0x1c')]=_0x2739bc;if(_0x29c3ec[_0xbf07('0x30')]['includeAll']){_0x2d0b86[_0xbf07('0x40')]=[{'all':!![]}];}return db[_0xbf07('0x2c')][_0xbf07('0x41')](_0x2d0b86);})['then'](function(_0x11a899){_0x2fea97[_0xbf07('0x42')]=_0x11a899;return _0x2fea97;})[_0xbf07('0x24')](respondWithFilteredResult(_0x17d4b1,_0x2d0b86))['catch'](handleError(_0x17d4b1,null));};exports['show']=function(_0x22eddf,_0x334718){var _0x3a99fc={'raw':!![],'where':{'id':_0x22eddf['params']['id']}},_0x175c30={};_0x175c30[_0xbf07('0x34')]=_[_0xbf07('0x31')](db['JscriptySessionReport'][_0xbf07('0x2d')]);_0x175c30['query']=_[_0xbf07('0x31')](_0x22eddf[_0xbf07('0x30')]);_0x175c30[_0xbf07('0x32')]=_[_0xbf07('0x33')](_0x175c30[_0xbf07('0x34')],_0x175c30[_0xbf07('0x30')]);_0x3a99fc['attributes']=_[_0xbf07('0x33')](_0x175c30[_0xbf07('0x34')],qs[_0xbf07('0x35')](_0x22eddf[_0xbf07('0x30')][_0xbf07('0x35')]));_0x3a99fc[_0xbf07('0x36')]=_0x3a99fc[_0xbf07('0x36')][_0xbf07('0x37')]?_0x3a99fc[_0xbf07('0x36')]:_0x175c30[_0xbf07('0x34')];if(_0x22eddf[_0xbf07('0x30')]['includeAll']){_0x3a99fc[_0xbf07('0x40')]=[{'all':!![]}];}_0x3a99fc=_['merge']({},_0x3a99fc,_0x22eddf[_0xbf07('0x3f')]);return db[_0xbf07('0x2c')][_0xbf07('0x43')](_0x3a99fc)[_0xbf07('0x24')](handleEntityNotFound(_0x334718,null))[_0xbf07('0x24')](respondWithResult(_0x334718,null))[_0xbf07('0x44')](handleError(_0x334718,null));};exports['create']=function(_0x26e038,_0x2fdcbe){return db[_0xbf07('0x2c')]['create'](_0x26e038['body'],{})[_0xbf07('0x24')](respondWithResult(_0x2fdcbe,0xc9))[_0xbf07('0x44')](handleError(_0x2fdcbe,null));};exports['update']=function(_0x2a2ab5,_0x4d65e3){if(_0x2a2ab5[_0xbf07('0x45')]['id']){delete _0x2a2ab5[_0xbf07('0x45')]['id'];}return db[_0xbf07('0x2c')][_0xbf07('0x43')]({'where':{'id':_0x2a2ab5['params']['id']}})[_0xbf07('0x24')](handleEntityNotFound(_0x4d65e3,null))[_0xbf07('0x24')](saveUpdates(_0x2a2ab5[_0xbf07('0x45')],null))[_0xbf07('0x24')](respondWithResult(_0x4d65e3,null))[_0xbf07('0x44')](handleError(_0x4d65e3,null));};exports[_0xbf07('0x25')]=function(_0x214c0c,_0x2e9725){return db['JscriptySessionReport']['find']({'where':{'id':_0x214c0c[_0xbf07('0x46')]['id']}})[_0xbf07('0x24')](handleEntityNotFound(_0x2e9725,null))[_0xbf07('0x24')](removeEntity(_0x2e9725,null))[_0xbf07('0x44')](handleError(_0x2e9725,null));};exports['describe']=function(_0x133226,_0x5003d1){return db['JscriptySessionReport'][_0xbf07('0x47')]()[_0xbf07('0x24')](respondWithResult(_0x5003d1,null))[_0xbf07('0x44')](handleError(_0x5003d1,null));};exports[_0xbf07('0x48')]=function(_0x4a1b51,_0x3bdb61,_0x34a85c){var _0x301a5e={'raw':!![],'where':{}};var _0x1e5982={};var _0x456c97={'count':0x0,'rows':[]};return db[_0xbf07('0x2c')][_0xbf07('0x49')]({'where':{'id':_0x4a1b51[_0xbf07('0x46')]['id']}})[_0xbf07('0x24')](handleEntityNotFound(_0x3bdb61,null))['then'](function(_0x3c05a2){if(_0x3c05a2){_0x1e5982['model']=_['keys'](db['JscriptyQuestionReport'][_0xbf07('0x2d')]);_0x1e5982[_0xbf07('0x30')]=_[_0xbf07('0x31')](_0x4a1b51[_0xbf07('0x30')]);_0x1e5982[_0xbf07('0x32')]=_[_0xbf07('0x33')](_0x1e5982['model'],_0x1e5982[_0xbf07('0x30')]);_0x301a5e['attributes']=_[_0xbf07('0x33')](_0x1e5982[_0xbf07('0x34')],qs[_0xbf07('0x35')](_0x4a1b51[_0xbf07('0x30')]['fields']));_0x301a5e['attributes']=_0x301a5e[_0xbf07('0x36')]['length']?_0x301a5e[_0xbf07('0x36')]:_0x1e5982[_0xbf07('0x34')];if(!_0x4a1b51['query']['hasOwnProperty'](_0xbf07('0x4a'))){_0x301a5e[_0xbf07('0x1d')]=qs[_0xbf07('0x1d')](_0x4a1b51['query'][_0xbf07('0x1d')]);_0x301a5e[_0xbf07('0x1a')]=qs['offset'](_0x4a1b51[_0xbf07('0x30')][_0xbf07('0x1a')]);}_0x301a5e[_0xbf07('0x39')]=qs[_0xbf07('0x3a')](_0x4a1b51[_0xbf07('0x30')][_0xbf07('0x3a')]);_0x301a5e[_0xbf07('0x3b')]=qs['filters'](_[_0xbf07('0x4b')](_0x4a1b51[_0xbf07('0x30')],_0x1e5982[_0xbf07('0x32')]));_0x301a5e[_0xbf07('0x3b')]['SessionId']=_0x3c05a2['id'];if(_0x4a1b51[_0xbf07('0x30')][_0xbf07('0x3c')]){_0x301a5e[_0xbf07('0x3b')]=_[_0xbf07('0x3d')](_0x301a5e[_0xbf07('0x3b')],{'$or':_[_0xbf07('0x2b')](_0x301a5e['attributes'],function(_0x183601){var _0x1a569e={};_0x1a569e[_0x183601]={'$like':'%'+_0x4a1b51[_0xbf07('0x30')][_0xbf07('0x3c')]+'%'};return _0x1a569e;})});}_0x301a5e=_[_0xbf07('0x3d')]({},_0x301a5e,_0x4a1b51['options']);return db['JscriptyQuestionReport'][_0xbf07('0x1c')]({'where':_0x301a5e[_0xbf07('0x3b')]})['then'](function(_0x2ade12){_0x456c97['count']=_0x2ade12;if(_0x4a1b51[_0xbf07('0x30')][_0xbf07('0x4c')]){_0x301a5e[_0xbf07('0x40')]=[{'all':!![]}];}return db[_0xbf07('0x4d')]['findAll'](_0x301a5e);})[_0xbf07('0x24')](function(_0x45cdeb){_0x456c97[_0xbf07('0x42')]=_0x45cdeb;return _0x456c97;});}})['then'](respondWithFilteredResult(_0x3bdb61,_0x301a5e))[_0xbf07('0x44')](handleError(_0x3bdb61,null));}; \ No newline at end of file +var _0x9a96=['desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','keys','find','create','body','catch','params','describe','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a96,0xdc));var _0x69a9=function(_0x13632d,_0x5519ab){_0x13632d=_0x13632d-0x0;var _0x53aafa=_0x9a96[_0x13632d];return _0x53aafa;};'use strict';var emlformat=require(_0x69a9('0x0'));var rimraf=require(_0x69a9('0x1'));var zipdir=require(_0x69a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x69a9('0x3'));var Mustache=require(_0x69a9('0x4'));var util=require(_0x69a9('0x5'));var path=require(_0x69a9('0x6'));var sox=require(_0x69a9('0x7'));var csv=require(_0x69a9('0x8'));var ejs=require(_0x69a9('0x9'));var fs=require('fs');var fs_extra=require(_0x69a9('0xa'));var _=require(_0x69a9('0xb'));var squel=require('squel');var crypto=require(_0x69a9('0xc'));var jsforce=require(_0x69a9('0xd'));var deskjs=require(_0x69a9('0xe'));var toCsv=require(_0x69a9('0x8'));var querystring=require(_0x69a9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69a9('0x10'));var as=require(_0x69a9('0x11'));var hardwareService=require(_0x69a9('0x12'));var logger=require(_0x69a9('0x13'))('api');var utils=require(_0x69a9('0x14'));var config=require(_0x69a9('0x15'));var licenseUtil=require(_0x69a9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5d2f,_0x5c0918){_0x5c0918=_0x5c0918||0xcc;return function(_0x110022){if(_0x110022){return _0x5e5d2f[_0x69a9('0x17')](_0x5c0918);}return _0x5e5d2f[_0x69a9('0x18')](_0x5c0918)[_0x69a9('0x19')]();};}function respondWithResult(_0x3ff2dc,_0x33ddb1){_0x33ddb1=_0x33ddb1||0xc8;return function(_0x13a4dd){if(_0x13a4dd){return _0x3ff2dc[_0x69a9('0x18')](_0x33ddb1)[_0x69a9('0x1a')](_0x13a4dd);}};}function respondWithFilteredResult(_0x3fbc35,_0x3f4324){return function(_0x579e71){if(_0x579e71){var _0x566933=typeof _0x3f4324['offset']===_0x69a9('0x1b')&&typeof _0x3f4324['limit']==='undefined';var _0x436ed4=_0x579e71[_0x69a9('0x1c')];var _0x51334e=_0x566933?0x0:_0x3f4324[_0x69a9('0x1d')];var _0x858e93=_0x566933?_0x579e71[_0x69a9('0x1c')]:_0x3f4324['offset']+_0x3f4324[_0x69a9('0x1e')];var _0x16ced2;if(_0x858e93>=_0x436ed4){_0x858e93=_0x436ed4;_0x16ced2=0xc8;}else{_0x16ced2=0xce;}_0x3fbc35[_0x69a9('0x18')](_0x16ced2);return _0x3fbc35['set'](_0x69a9('0x1f'),_0x51334e+'-'+_0x858e93+'/'+_0x436ed4)[_0x69a9('0x1a')](_0x579e71);}return null;};}function patchUpdates(_0x3f7ffb){return function(_0x3116a7){try{jsonpatch[_0x69a9('0x20')](_0x3116a7,_0x3f7ffb,!![]);}catch(_0x55f925){return BPromise[_0x69a9('0x21')](_0x55f925);}return _0x3116a7[_0x69a9('0x22')]();};}function saveUpdates(_0x52e94a,_0x8a83a8){return function(_0x42dc58){if(_0x42dc58){return _0x42dc58[_0x69a9('0x23')](_0x52e94a)[_0x69a9('0x24')](function(_0x583bd4){return _0x583bd4;});}return null;};}function removeEntity(_0x44a340,_0x4b0382){return function(_0x11d998){if(_0x11d998){return _0x11d998['destroy']()[_0x69a9('0x24')](function(){_0x44a340[_0x69a9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db318,_0x3384da){return function(_0x46bbe7){if(!_0x46bbe7){_0x3db318[_0x69a9('0x17')](0x194);}return _0x46bbe7;};}function handleError(_0x31c9bc,_0x210f12){_0x210f12=_0x210f12||0x1f4;return function(_0xee724c){logger[_0x69a9('0x25')](_0xee724c['stack']);if(_0xee724c[_0x69a9('0x26')]){delete _0xee724c[_0x69a9('0x26')];}_0x31c9bc['status'](_0x210f12)[_0x69a9('0x27')](_0xee724c);};}exports[_0x69a9('0x28')]=function(_0x215651,_0x3d4773){var _0x2b40c2={},_0x407718={},_0x57c0aa={'count':0x0,'rows':[]};var _0x429661=_[_0x69a9('0x29')](db[_0x69a9('0x2a')][_0x69a9('0x2b')],function(_0x3c5f4d){return{'name':_0x3c5f4d[_0x69a9('0x2c')],'type':_0x3c5f4d['type'][_0x69a9('0x2d')]};});_0x407718[_0x69a9('0x2e')]=_[_0x69a9('0x29')](_0x429661,'name');_0x407718[_0x69a9('0x2f')]=_['keys'](_0x215651[_0x69a9('0x2f')]);_0x407718[_0x69a9('0x30')]=_[_0x69a9('0x31')](_0x407718[_0x69a9('0x2e')],_0x407718['query']);_0x2b40c2['attributes']=_['intersection'](_0x407718[_0x69a9('0x2e')],qs[_0x69a9('0x32')](_0x215651[_0x69a9('0x2f')]['fields']));_0x2b40c2[_0x69a9('0x33')]=_0x2b40c2[_0x69a9('0x33')][_0x69a9('0x34')]?_0x2b40c2[_0x69a9('0x33')]:_0x407718[_0x69a9('0x2e')];if(!_0x215651['query']['hasOwnProperty'](_0x69a9('0x35'))){_0x2b40c2[_0x69a9('0x1e')]=qs[_0x69a9('0x1e')](_0x215651[_0x69a9('0x2f')][_0x69a9('0x1e')]);_0x2b40c2[_0x69a9('0x1d')]=qs['offset'](_0x215651['query'][_0x69a9('0x1d')]);}_0x2b40c2[_0x69a9('0x36')]=qs['sort'](_0x215651['query'][_0x69a9('0x37')]);_0x2b40c2[_0x69a9('0x38')]=qs[_0x69a9('0x30')](_[_0x69a9('0x39')](_0x215651[_0x69a9('0x2f')],_0x407718['filters']),_0x429661);if(_0x215651['query'][_0x69a9('0x3a')]){_0x2b40c2[_0x69a9('0x38')]=_[_0x69a9('0x3b')](_0x2b40c2[_0x69a9('0x38')],{'$or':_[_0x69a9('0x29')](_0x429661,function(_0x3eab2c){if(_0x3eab2c[_0x69a9('0x3c')]!=='VIRTUAL'){var _0x1ef539={};_0x1ef539[_0x3eab2c[_0x69a9('0x26')]]={'$like':'%'+_0x215651['query']['filter']+'%'};return _0x1ef539;}})});}_0x2b40c2=_[_0x69a9('0x3b')]({},_0x2b40c2,_0x215651[_0x69a9('0x3d')]);var _0x38d57c={'where':_0x2b40c2[_0x69a9('0x38')]};return db[_0x69a9('0x2a')][_0x69a9('0x1c')](_0x38d57c)[_0x69a9('0x24')](function(_0x2a8f34){_0x57c0aa[_0x69a9('0x1c')]=_0x2a8f34;if(_0x215651[_0x69a9('0x2f')][_0x69a9('0x3e')]){_0x2b40c2[_0x69a9('0x3f')]=[{'all':!![]}];}return db[_0x69a9('0x2a')][_0x69a9('0x40')](_0x2b40c2);})['then'](function(_0x4e3629){_0x57c0aa[_0x69a9('0x41')]=_0x4e3629;return _0x57c0aa;})['then'](respondWithFilteredResult(_0x3d4773,_0x2b40c2))['catch'](handleError(_0x3d4773,null));};exports[_0x69a9('0x42')]=function(_0x52c748,_0x2bf67e){var _0x411ece={'raw':!![],'where':{'id':_0x52c748['params']['id']}},_0xafb55f={};_0xafb55f[_0x69a9('0x2e')]=_['keys'](db[_0x69a9('0x2a')][_0x69a9('0x2b')]);_0xafb55f[_0x69a9('0x2f')]=_[_0x69a9('0x43')](_0x52c748[_0x69a9('0x2f')]);_0xafb55f[_0x69a9('0x30')]=_[_0x69a9('0x31')](_0xafb55f['model'],_0xafb55f[_0x69a9('0x2f')]);_0x411ece[_0x69a9('0x33')]=_['intersection'](_0xafb55f['model'],qs[_0x69a9('0x32')](_0x52c748['query'][_0x69a9('0x32')]));_0x411ece[_0x69a9('0x33')]=_0x411ece['attributes'][_0x69a9('0x34')]?_0x411ece[_0x69a9('0x33')]:_0xafb55f[_0x69a9('0x2e')];if(_0x52c748[_0x69a9('0x2f')][_0x69a9('0x3e')]){_0x411ece['include']=[{'all':!![]}];}_0x411ece=_[_0x69a9('0x3b')]({},_0x411ece,_0x52c748[_0x69a9('0x3d')]);return db[_0x69a9('0x2a')][_0x69a9('0x44')](_0x411ece)[_0x69a9('0x24')](handleEntityNotFound(_0x2bf67e,null))['then'](respondWithResult(_0x2bf67e,null))['catch'](handleError(_0x2bf67e,null));};exports[_0x69a9('0x45')]=function(_0x52d8a5,_0x401969){return db['JscriptySessionReport'][_0x69a9('0x45')](_0x52d8a5[_0x69a9('0x46')],{})[_0x69a9('0x24')](respondWithResult(_0x401969,0xc9))[_0x69a9('0x47')](handleError(_0x401969,null));};exports['update']=function(_0x29844f,_0x20c38a){if(_0x29844f[_0x69a9('0x46')]['id']){delete _0x29844f[_0x69a9('0x46')]['id'];}return db[_0x69a9('0x2a')]['find']({'where':{'id':_0x29844f[_0x69a9('0x48')]['id']}})[_0x69a9('0x24')](handleEntityNotFound(_0x20c38a,null))['then'](saveUpdates(_0x29844f[_0x69a9('0x46')],null))[_0x69a9('0x24')](respondWithResult(_0x20c38a,null))[_0x69a9('0x47')](handleError(_0x20c38a,null));};exports['destroy']=function(_0x9cba81,_0x2102b7){return db[_0x69a9('0x2a')][_0x69a9('0x44')]({'where':{'id':_0x9cba81['params']['id']}})[_0x69a9('0x24')](handleEntityNotFound(_0x2102b7,null))[_0x69a9('0x24')](removeEntity(_0x2102b7,null))['catch'](handleError(_0x2102b7,null));};exports[_0x69a9('0x49')]=function(_0x118972,_0x208977){return db[_0x69a9('0x2a')][_0x69a9('0x49')]()['then'](respondWithResult(_0x208977,null))[_0x69a9('0x47')](handleError(_0x208977,null));};exports['getQuestions']=function(_0x417ee7,_0x4fd753,_0x12b89b){var _0x43c12d={'raw':!![],'where':{}};var _0x560eab={};var _0x51ab27={'count':0x0,'rows':[]};return db[_0x69a9('0x2a')][_0x69a9('0x4a')]({'where':{'id':_0x417ee7[_0x69a9('0x48')]['id']}})[_0x69a9('0x24')](handleEntityNotFound(_0x4fd753,null))[_0x69a9('0x24')](function(_0x5dfa1e){if(_0x5dfa1e){_0x560eab[_0x69a9('0x2e')]=_[_0x69a9('0x43')](db['JscriptyQuestionReport']['rawAttributes']);_0x560eab[_0x69a9('0x2f')]=_['keys'](_0x417ee7[_0x69a9('0x2f')]);_0x560eab[_0x69a9('0x30')]=_['intersection'](_0x560eab[_0x69a9('0x2e')],_0x560eab[_0x69a9('0x2f')]);_0x43c12d['attributes']=_[_0x69a9('0x31')](_0x560eab[_0x69a9('0x2e')],qs['fields'](_0x417ee7[_0x69a9('0x2f')][_0x69a9('0x32')]));_0x43c12d[_0x69a9('0x33')]=_0x43c12d['attributes'][_0x69a9('0x34')]?_0x43c12d[_0x69a9('0x33')]:_0x560eab[_0x69a9('0x2e')];if(!_0x417ee7[_0x69a9('0x2f')][_0x69a9('0x4b')](_0x69a9('0x35'))){_0x43c12d[_0x69a9('0x1e')]=qs[_0x69a9('0x1e')](_0x417ee7[_0x69a9('0x2f')][_0x69a9('0x1e')]);_0x43c12d['offset']=qs['offset'](_0x417ee7[_0x69a9('0x2f')][_0x69a9('0x1d')]);}_0x43c12d[_0x69a9('0x36')]=qs[_0x69a9('0x37')](_0x417ee7[_0x69a9('0x2f')][_0x69a9('0x37')]);_0x43c12d[_0x69a9('0x38')]=qs[_0x69a9('0x30')](_[_0x69a9('0x39')](_0x417ee7[_0x69a9('0x2f')],_0x560eab[_0x69a9('0x30')]));_0x43c12d[_0x69a9('0x38')][_0x69a9('0x4c')]=_0x5dfa1e['id'];if(_0x417ee7[_0x69a9('0x2f')][_0x69a9('0x3a')]){_0x43c12d[_0x69a9('0x38')]=_[_0x69a9('0x3b')](_0x43c12d[_0x69a9('0x38')],{'$or':_[_0x69a9('0x29')](_0x43c12d[_0x69a9('0x33')],function(_0x20fb9d){var _0xdf72ba={};_0xdf72ba[_0x20fb9d]={'$like':'%'+_0x417ee7['query'][_0x69a9('0x3a')]+'%'};return _0xdf72ba;})});}_0x43c12d=_[_0x69a9('0x3b')]({},_0x43c12d,_0x417ee7[_0x69a9('0x3d')]);return db[_0x69a9('0x4d')][_0x69a9('0x1c')]({'where':_0x43c12d[_0x69a9('0x38')]})['then'](function(_0x272956){_0x51ab27[_0x69a9('0x1c')]=_0x272956;if(_0x417ee7[_0x69a9('0x2f')]['includeAll']){_0x43c12d[_0x69a9('0x3f')]=[{'all':!![]}];}return db[_0x69a9('0x4d')][_0x69a9('0x40')](_0x43c12d);})[_0x69a9('0x24')](function(_0x17b790){_0x51ab27[_0x69a9('0x41')]=_0x17b790;return _0x51ab27;});}})[_0x69a9('0x24')](respondWithFilteredResult(_0x4fd753,_0x43c12d))['catch'](handleError(_0x4fd753,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 566679d..8199bc6 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 _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x9a5a,0x194));var _0xa9a5=function(_0x21ce09,_0x3c3d50){_0x21ce09=_0x21ce09-0x0;var _0x3ef848=_0x9a5a[_0x21ce09];return _0x3ef848;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e1450,_0x44011f){var _0x256e6a=function(_0x47d4b9){while(--_0x47d4b9){_0x5e1450['push'](_0x5e1450['shift']());}};_0x256e6a(++_0x44011f);}(_0x4975,0x86));var _0x5497=function(_0xa5a649,_0x32e4a0){_0xa5a649=_0xa5a649-0x0;var _0x42064e=_0x4975[_0xa5a649];return _0x42064e;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 7206a2c..f143188 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 _0x6343=['message','result','catch','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4e2d9a,_0x46cc34){var _0x11540c=function(_0x11a401){while(--_0x11a401){_0x4e2d9a['push'](_0x4e2d9a['shift']());}};_0x11540c(++_0x46cc34);}(_0x6343,0x168));var _0x3634=function(_0x133dc8,_0x3a65fc){_0x133dc8=_0x133dc8-0x0;var _0x521ebe=_0x6343[_0x133dc8];return _0x521ebe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('JscriptySessionReport,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});} \ No newline at end of file +var _0x430c=['then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x430c,0x1a1));var _0xc430=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x430c[_0x382a62];return _0x490a25;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 361f6ac..f023793 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 _0xefc9=['isAuthenticated','update','/download_log_file','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','put'];(function(_0x100d21,_0x4f4d91){var _0x2db7a9=function(_0x12827d){while(--_0x12827d){_0x100d21['push'](_0x100d21['shift']());}};_0x2db7a9(++_0x4f4d91);}(_0xefc9,0x170));var _0x9efc=function(_0x586de5,_0x4a8cbc){_0x586de5=_0x586de5-0x0;var _0x3ed297=_0xefc9[_0x586de5];return _0x3ed297;};'use strict';var multer=require(_0x9efc('0x0'));var util=require(_0x9efc('0x1'));var path=require(_0x9efc('0x2'));var timeout=require(_0x9efc('0x3'));var express=require(_0x9efc('0x4'));var router=express[_0x9efc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9efc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x9efc('0x7')]('/',controller['index']);router[_0x9efc('0x8')]('/:id',auth[_0x9efc('0x9')](),controller[_0x9efc('0xa')]);router[_0x9efc('0x7')](_0x9efc('0xb'),auth[_0x9efc('0x9')](),controller['downloadLogFile']);module[_0x9efc('0xc')]=router; \ No newline at end of file +var _0xa227=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','isAuthenticated','update','/download_log_file','downloadLogFile','multer','path'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xa227,0x85));var _0x7a22=function(_0x249b66,_0x520179){_0x249b66=_0x249b66-0x0;var _0x225d9e=_0xa227[_0x249b66];return _0x225d9e;};'use strict';var multer=require(_0x7a22('0x0'));var util=require('util');var path=require(_0x7a22('0x1'));var timeout=require(_0x7a22('0x2'));var express=require('express');var router=express[_0x7a22('0x3')]();var fs_extra=require(_0x7a22('0x4'));var auth=require(_0x7a22('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a22('0x6'));var controller=require(_0x7a22('0x7'));router[_0x7a22('0x8')]('/',controller[_0x7a22('0x9')]);router[_0x7a22('0xa')]('/:id',auth[_0x7a22('0xb')](),controller[_0x7a22('0xc')]);router['get'](_0x7a22('0xd'),auth[_0x7a22('0xb')](),controller[_0x7a22('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 4352656..393504f 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 _0x2127=['sequelize','exports','TEXT','STRING'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x2127,0x14c));var _0x7212=function(_0x5b9fe4,_0xa8770d){_0x5b9fe4=_0x5b9fe4-0x0;var _0x259492=_0x2127[_0x5b9fe4];return _0x259492;};'use strict';var Sequelize=require(_0x7212('0x0'));module[_0x7212('0x1')]={'license':{'type':Sequelize[_0x7212('0x2')]},'data1':{'type':Sequelize[_0x7212('0x3')]},'data2':{'type':Sequelize[_0x7212('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x95bb=['exports','TEXT','STRING','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x95bb,0xf7));var _0xb95b=function(_0x234a28,_0x8014b1){_0x234a28=_0x234a28-0x0;var _0x4816a8=_0x95bb[_0x234a28];return _0x4816a8;};'use strict';var Sequelize=require(_0xb95b('0x0'));module[_0xb95b('0x1')]={'license':{'type':Sequelize[_0xb95b('0x2')]},'data1':{'type':Sequelize[_0xb95b('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index afb930c..d057533 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 _0x120f=['send','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','merge','getLicense','catch','body','find','params','get','checkLicense','key','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','name'];(function(_0x57abf7,_0x11bb02){var _0x1c7779=function(_0x387b0a){while(--_0x387b0a){_0x57abf7['push'](_0x57abf7['shift']());}};_0x1c7779(++_0x11bb02);}(_0x120f,0xac));var _0xf120=function(_0xa132f9,_0x32f20d){_0xa132f9=_0xa132f9-0x0;var _0x342190=_0x120f[_0xa132f9];return _0x342190;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf120('0x0'));var zipdir=require(_0xf120('0x1'));var jsonpatch=require(_0xf120('0x2'));var rp=require('request-promise');var moment=require(_0xf120('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf120('0x4'));var util=require(_0xf120('0x5'));var path=require(_0xf120('0x6'));var sox=require(_0xf120('0x7'));var csv=require(_0xf120('0x8'));var ejs=require(_0xf120('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf120('0xa'));var squel=require(_0xf120('0xb'));var crypto=require(_0xf120('0xc'));var jsforce=require(_0xf120('0xd'));var deskjs=require(_0xf120('0xe'));var toCsv=require(_0xf120('0x8'));var querystring=require(_0xf120('0xf'));var Papa=require(_0xf120('0x10'));var Redis=require(_0xf120('0x11'));var authService=require(_0xf120('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf120('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf120('0x14'))(_0xf120('0x15'));var utils=require('../../config/utils');var config=require(_0xf120('0x16'));var licenseUtil=require(_0xf120('0x17'));var db=require(_0xf120('0x18'))['db'];function respondWithStatusCode(_0xf1e2e6,_0xf11dbf){_0xf11dbf=_0xf11dbf||0xcc;return function(_0x1bb3c2){if(_0x1bb3c2){return _0xf1e2e6[_0xf120('0x19')](_0xf11dbf);}return _0xf1e2e6[_0xf120('0x1a')](_0xf11dbf)[_0xf120('0x1b')]();};}function respondWithResult(_0x7c3eda,_0x25bc87){_0x25bc87=_0x25bc87||0xc8;return function(_0x4f2508){if(_0x4f2508){return _0x7c3eda[_0xf120('0x1a')](_0x25bc87)[_0xf120('0x1c')](_0x4f2508);}};}function respondWithFilteredResult(_0xbd6f18,_0x351423){return function(_0x4fadfe){if(_0x4fadfe){var _0x223e67=typeof _0x351423[_0xf120('0x1d')]==='undefined'&&typeof _0x351423['limit']===_0xf120('0x1e');var _0x367360=_0x4fadfe['count'];var _0x2ef254=_0x223e67?0x0:_0x351423['offset'];var _0x3c9d1a=_0x223e67?_0x4fadfe[_0xf120('0x1f')]:_0x351423[_0xf120('0x1d')]+_0x351423[_0xf120('0x20')];var _0x966ae1;if(_0x3c9d1a>=_0x367360){_0x3c9d1a=_0x367360;_0x966ae1=0xc8;}else{_0x966ae1=0xce;}_0xbd6f18[_0xf120('0x1a')](_0x966ae1);return _0xbd6f18[_0xf120('0x21')](_0xf120('0x22'),_0x2ef254+'-'+_0x3c9d1a+'/'+_0x367360)[_0xf120('0x1c')](_0x4fadfe);}return null;};}function patchUpdates(_0x533ba0){return function(_0x2d2c9a){try{jsonpatch[_0xf120('0x23')](_0x2d2c9a,_0x533ba0,!![]);}catch(_0x4e49de){return BPromise['reject'](_0x4e49de);}return _0x2d2c9a[_0xf120('0x24')]();};}function saveUpdates(_0x5b1019,_0x38b4fa){return function(_0x539c39){if(_0x539c39){return _0x539c39[_0xf120('0x25')](_0x5b1019)[_0xf120('0x26')](function(_0x45dcc0){return _0x45dcc0;});}return null;};}function removeEntity(_0x557f9c,_0x4b1e07){return function(_0x4bced5){if(_0x4bced5){return _0x4bced5['destroy']()[_0xf120('0x26')](function(){_0x557f9c[_0xf120('0x1a')](0xcc)[_0xf120('0x1b')]();});}};}function handleEntityNotFound(_0x42cc4b,_0x2e31c7){return function(_0x85cea9){if(!_0x85cea9){_0x42cc4b[_0xf120('0x19')](0x194);}return _0x85cea9;};}function handleError(_0x14a0fd,_0x40cd99){_0x40cd99=_0x40cd99||0x1f4;return function(_0x176747){logger[_0xf120('0x27')](_0x176747['stack']);if(_0x176747[_0xf120('0x28')]){delete _0x176747[_0xf120('0x28')];}_0x14a0fd[_0xf120('0x1a')](_0x40cd99)[_0xf120('0x29')](_0x176747);};}var utilLicense=require(_0xf120('0x17'));exports['index']=function(_0x1c3dce,_0x2fab17){var _0x25e1de={'raw':!![],'where':{'id':0x1}},_0xf4abac={};_0xf4abac['model']=_['keys'](db['License'][_0xf120('0x2a')]);_0xf4abac[_0xf120('0x2b')]=_[_0xf120('0x2c')](_0x1c3dce['query']);_0xf4abac[_0xf120('0x2d')]=_[_0xf120('0x2e')](_0xf4abac[_0xf120('0x2f')],_0xf4abac['query']);_0x25e1de['attributes']=_[_0xf120('0x2e')](_0xf4abac[_0xf120('0x2f')],qs[_0xf120('0x30')](_0x1c3dce[_0xf120('0x2b')]['fields']));_0x25e1de[_0xf120('0x31')]=_0x25e1de[_0xf120('0x31')][_0xf120('0x32')]?_0x25e1de[_0xf120('0x31')]:_0xf4abac['model'];_0x25e1de=_[_0xf120('0x33')]({},_0x25e1de,_0x1c3dce['options']);return utilLicense[_0xf120('0x34')](_0x25e1de)[_0xf120('0x26')](respondWithResult(_0x2fab17,null))[_0xf120('0x35')](handleError(_0x2fab17,null));};exports[_0xf120('0x25')]=function(_0x4db992,_0x2af609){if(_0x4db992[_0xf120('0x36')]['id']){delete _0x4db992[_0xf120('0x36')]['id'];}return db['License'][_0xf120('0x37')]({'where':{'id':_0x4db992[_0xf120('0x38')]['id']}})['then'](handleEntityNotFound(_0x2af609,null))[_0xf120('0x26')](function(_0x28f428){var _0x4c3a3d=_0x28f428[_0xf120('0x39')]({'plain':!![]});return utilLicense[_0xf120('0x3a')](_0x4c3a3d,_0x4db992[_0xf120('0x36')][_0xf120('0x3b')]);})['then'](function(_0x10e4ee){if(!_0x10e4ee['demo']){return saveUpdates(_0x4db992[_0xf120('0x36')],null);}return _0x10e4ee;})[_0xf120('0x26')](respondWithResult(_0x2af609,null))[_0xf120('0x35')](handleError(_0x2af609,null));};exports['downloadLogFile']=function(_0x5868c4,_0x32dda5){var _0x5d6e5e=_0xf120('0x3c');var _0x2ec1e8=path[_0xf120('0x3d')](_0xf120('0x3e'),_0xf120('0x3f'),_0xf120('0x40'),_0x5d6e5e);_0x32dda5[_0xf120('0x41')](_0xf120('0x42'),_0xf120('0x43')+_0x5d6e5e);_0x32dda5[_0xf120('0x21')](_0xf120('0x44'),_0xf120('0x45'));_0x32dda5[_0xf120('0x46')](_0x2ec1e8);}; \ No newline at end of file +var _0xf174=['save','update','destroy','then','sendStatus','error','stack','name','send','index','model','keys','License','query','filters','attributes','intersection','length','merge','options','catch','body','find','params','key','demo','downloadLogFile','join','/var','log','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xf174,0x13e));var _0x4f17=function(_0x36fe2e,_0x209c3e){_0x36fe2e=_0x36fe2e-0x0;var _0x3368f6=_0xf174[_0x36fe2e];return _0x3368f6;};'use strict';var emlformat=require(_0x4f17('0x0'));var rimraf=require(_0x4f17('0x1'));var zipdir=require(_0x4f17('0x2'));var jsonpatch=require(_0x4f17('0x3'));var rp=require(_0x4f17('0x4'));var moment=require(_0x4f17('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4f17('0x6'));var util=require(_0x4f17('0x7'));var path=require('path');var sox=require(_0x4f17('0x8'));var csv=require(_0x4f17('0x9'));var ejs=require(_0x4f17('0xa'));var fs=require('fs');var fs_extra=require(_0x4f17('0xb'));var _=require(_0x4f17('0xc'));var squel=require(_0x4f17('0xd'));var crypto=require('crypto');var jsforce=require(_0x4f17('0xe'));var deskjs=require(_0x4f17('0xf'));var toCsv=require(_0x4f17('0x9'));var querystring=require(_0x4f17('0x10'));var Papa=require('papaparse');var Redis=require(_0x4f17('0x11'));var authService=require(_0x4f17('0x12'));var qs=require(_0x4f17('0x13'));var as=require(_0x4f17('0x14'));var hardwareService=require(_0x4f17('0x15'));var logger=require(_0x4f17('0x16'))(_0x4f17('0x17'));var utils=require(_0x4f17('0x18'));var config=require(_0x4f17('0x19'));var licenseUtil=require(_0x4f17('0x1a'));var db=require(_0x4f17('0x1b'))['db'];function respondWithStatusCode(_0x4384fc,_0x3df6aa){_0x3df6aa=_0x3df6aa||0xcc;return function(_0x4f5112){if(_0x4f5112){return _0x4384fc['sendStatus'](_0x3df6aa);}return _0x4384fc[_0x4f17('0x1c')](_0x3df6aa)[_0x4f17('0x1d')]();};}function respondWithResult(_0x260736,_0x3ae717){_0x3ae717=_0x3ae717||0xc8;return function(_0xde8d97){if(_0xde8d97){return _0x260736[_0x4f17('0x1c')](_0x3ae717)['json'](_0xde8d97);}};}function respondWithFilteredResult(_0x27c2f9,_0x1f7f89){return function(_0xba613d){if(_0xba613d){var _0x404db3=typeof _0x1f7f89[_0x4f17('0x1e')]===_0x4f17('0x1f')&&typeof _0x1f7f89[_0x4f17('0x20')]===_0x4f17('0x1f');var _0x3ebc32=_0xba613d[_0x4f17('0x21')];var _0x1d566c=_0x404db3?0x0:_0x1f7f89[_0x4f17('0x1e')];var _0x98ee41=_0x404db3?_0xba613d[_0x4f17('0x21')]:_0x1f7f89[_0x4f17('0x1e')]+_0x1f7f89['limit'];var _0x555c16;if(_0x98ee41>=_0x3ebc32){_0x98ee41=_0x3ebc32;_0x555c16=0xc8;}else{_0x555c16=0xce;}_0x27c2f9['status'](_0x555c16);return _0x27c2f9[_0x4f17('0x22')]('Content-Range',_0x1d566c+'-'+_0x98ee41+'/'+_0x3ebc32)[_0x4f17('0x23')](_0xba613d);}return null;};}function patchUpdates(_0x399b7f){return function(_0x2782c8){try{jsonpatch[_0x4f17('0x24')](_0x2782c8,_0x399b7f,!![]);}catch(_0x2c360a){return BPromise['reject'](_0x2c360a);}return _0x2782c8[_0x4f17('0x25')]();};}function saveUpdates(_0x5a84c0,_0x43fbd8){return function(_0x12091d){if(_0x12091d){return _0x12091d[_0x4f17('0x26')](_0x5a84c0)['then'](function(_0xcf0f02){return _0xcf0f02;});}return null;};}function removeEntity(_0x3d7afa,_0x1b879d){return function(_0x4949f0){if(_0x4949f0){return _0x4949f0[_0x4f17('0x27')]()[_0x4f17('0x28')](function(){_0x3d7afa[_0x4f17('0x1c')](0xcc)[_0x4f17('0x1d')]();});}};}function handleEntityNotFound(_0x19dce6,_0x1e4800){return function(_0x470ba5){if(!_0x470ba5){_0x19dce6[_0x4f17('0x29')](0x194);}return _0x470ba5;};}function handleError(_0x2f2e35,_0x288e89){_0x288e89=_0x288e89||0x1f4;return function(_0x3d0d77){logger[_0x4f17('0x2a')](_0x3d0d77[_0x4f17('0x2b')]);if(_0x3d0d77[_0x4f17('0x2c')]){delete _0x3d0d77[_0x4f17('0x2c')];}_0x2f2e35[_0x4f17('0x1c')](_0x288e89)[_0x4f17('0x2d')](_0x3d0d77);};}var utilLicense=require('../../config/license/util');exports[_0x4f17('0x2e')]=function(_0x355e33,_0x3f4ad0){var _0x2acb1f={'raw':!![],'where':{'id':0x1}},_0x41916c={};_0x41916c[_0x4f17('0x2f')]=_[_0x4f17('0x30')](db[_0x4f17('0x31')]['rawAttributes']);_0x41916c[_0x4f17('0x32')]=_[_0x4f17('0x30')](_0x355e33[_0x4f17('0x32')]);_0x41916c[_0x4f17('0x33')]=_['intersection'](_0x41916c[_0x4f17('0x2f')],_0x41916c[_0x4f17('0x32')]);_0x2acb1f[_0x4f17('0x34')]=_[_0x4f17('0x35')](_0x41916c[_0x4f17('0x2f')],qs['fields'](_0x355e33[_0x4f17('0x32')]['fields']));_0x2acb1f[_0x4f17('0x34')]=_0x2acb1f[_0x4f17('0x34')][_0x4f17('0x36')]?_0x2acb1f[_0x4f17('0x34')]:_0x41916c[_0x4f17('0x2f')];_0x2acb1f=_[_0x4f17('0x37')]({},_0x2acb1f,_0x355e33[_0x4f17('0x38')]);return utilLicense['getLicense'](_0x2acb1f)[_0x4f17('0x28')](respondWithResult(_0x3f4ad0,null))[_0x4f17('0x39')](handleError(_0x3f4ad0,null));};exports[_0x4f17('0x26')]=function(_0x4ab016,_0x5d5c5b){if(_0x4ab016[_0x4f17('0x3a')]['id']){delete _0x4ab016['body']['id'];}return db[_0x4f17('0x31')][_0x4f17('0x3b')]({'where':{'id':_0x4ab016[_0x4f17('0x3c')]['id']}})[_0x4f17('0x28')](handleEntityNotFound(_0x5d5c5b,null))[_0x4f17('0x28')](function(_0x9add8){var _0xf6e818=_0x9add8['get']({'plain':!![]});return utilLicense['checkLicense'](_0xf6e818,_0x4ab016['body'][_0x4f17('0x3d')]);})[_0x4f17('0x28')](function(_0x3fae59){if(!_0x3fae59[_0x4f17('0x3e')]){return saveUpdates(_0x4ab016[_0x4f17('0x3a')],null);}return _0x3fae59;})[_0x4f17('0x28')](respondWithResult(_0x5d5c5b,null))['catch'](handleError(_0x5d5c5b,null));};exports[_0x4f17('0x3f')]=function(_0x487346,_0xdd9346){var _0x598002='license-info.log';var _0x87c101=path[_0x4f17('0x40')](_0x4f17('0x41'),_0x4f17('0x42'),'xcally',_0x598002);_0xdd9346['setHeader'](_0x4f17('0x43'),_0x4f17('0x44')+_0x598002);_0xdd9346[_0x4f17('0x22')]('Content-Type',_0x4f17('0x45'));_0xdd9346[_0x4f17('0x46')](_0x87c101);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2abc1d8..bccedad 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 _0x0bf9=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','License','license','lodash'];(function(_0xb9e2bc,_0x1bb304){var _0x5cddae=function(_0x6a282e){while(--_0x6a282e){_0xb9e2bc['push'](_0xb9e2bc['shift']());}};_0x5cddae(++_0x1bb304);}(_0x0bf9,0xcb));var _0x90bf=function(_0x5dee1c,_0x1a1a19){_0x5dee1c=_0x5dee1c-0x0;var _0x3d7c37=_0x0bf9[_0x5dee1c];return _0x3d7c37;};'use strict';var _=require(_0x90bf('0x0'));var util=require(_0x90bf('0x1'));var logger=require(_0x90bf('0x2'))(_0x90bf('0x3'));var moment=require(_0x90bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x90bf('0x5'));var fs=require('fs');var path=require(_0x90bf('0x6'));var rimraf=require('rimraf');var config=require(_0x90bf('0x7'));var attributes=require('./license.attributes');module[_0x90bf('0x8')]=function(_0xefea01,_0x3a5b5f){return _0xefea01[_0x90bf('0x9')](_0x90bf('0xa'),attributes,{'tableName':_0x90bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa06e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','License','license','lodash','util'];(function(_0x2904b0,_0x31a596){var _0x196b62=function(_0x42a4b7){while(--_0x42a4b7){_0x2904b0['push'](_0x2904b0['shift']());}};_0x196b62(++_0x31a596);}(_0xa06e,0x106));var _0xea06=function(_0x22c600,_0x3867e0){_0x22c600=_0x22c600-0x0;var _0x201b22=_0xa06e[_0x22c600];return _0x201b22;};'use strict';var _=require(_0xea06('0x0'));var util=require(_0xea06('0x1'));var logger=require('../../config/logger')(_0xea06('0x2'));var moment=require(_0xea06('0x3'));var BPromise=require(_0xea06('0x4'));var rp=require(_0xea06('0x5'));var fs=require('fs');var path=require(_0xea06('0x6'));var rimraf=require(_0xea06('0x7'));var config=require(_0xea06('0x8'));var attributes=require('./license.attributes');module[_0xea06('0x9')]=function(_0x2c0b66,_0x3c5425){return _0x2c0b66['define'](_0xea06('0xa'),attributes,{'tableName':_0xea06('0xb'),'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 ab3d9f9..3bc0ec3 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 _0xd105=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','License,\x20%s,\x20%s','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd105,0x1e5));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d10('0x0'));var util=require('util');var moment=require(_0x5d10('0x1'));var BPromise=require(_0x5d10('0x2'));var rs=require(_0x5d10('0x3'));var fs=require('fs');var Redis=require(_0x5d10('0x4'));var db=require(_0x5d10('0x5'))['db'];var utils=require(_0x5d10('0x6'));var logger=require(_0x5d10('0x7'))(_0x5d10('0x8'));var config=require(_0x5d10('0x9'));var jayson=require(_0x5d10('0xa'));var client=jayson[_0x5d10('0xb')][_0x5d10('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x465a0a,_0x23d1ca,_0x30bf03){return new BPromise(function(_0x1294b5,_0x3de55b){return client['request'](_0x465a0a,_0x30bf03)[_0x5d10('0xd')](function(_0x3d9dde){logger['info']('License,\x20%s,\x20%s',_0x23d1ca,'request\x20sent');logger['debug'](_0x5d10('0xe'),_0x23d1ca,_0x5d10('0xf'),JSON[_0x5d10('0x10')](_0x3d9dde));if(_0x3d9dde[_0x5d10('0x11')]){if(_0x3d9dde[_0x5d10('0x11')]['code']===0x1f4){logger[_0x5d10('0x11')]('License,\x20%s,\x20%s',_0x23d1ca,_0x3d9dde[_0x5d10('0x11')][_0x5d10('0x12')]);return _0x3de55b(_0x3d9dde[_0x5d10('0x11')]['message']);}logger[_0x5d10('0x11')](_0x5d10('0x13'),_0x23d1ca,_0x3d9dde[_0x5d10('0x11')][_0x5d10('0x12')]);return _0x1294b5(_0x3d9dde['error']['message']);}else{logger[_0x5d10('0x14')](_0x5d10('0x13'),_0x23d1ca,_0x5d10('0xf'));_0x1294b5(_0x3d9dde[_0x5d10('0x15')][_0x5d10('0x12')]);}})[_0x5d10('0x16')](function(_0x435970){logger[_0x5d10('0x11')]('License,\x20%s,\x20%s',_0x23d1ca,_0x435970);_0x3de55b(_0x435970);});});} \ No newline at end of file +var _0x50fd=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x50fd,0x15c));var _0xd50f=function(_0x33dca4,_0x453b87){_0x33dca4=_0x33dca4-0x0;var _0x2e3c54=_0x50fd[_0x33dca4];return _0x2e3c54;};'use strict';var _=require(_0xd50f('0x0'));var util=require(_0xd50f('0x1'));var moment=require('moment');var BPromise=require(_0xd50f('0x2'));var rs=require(_0xd50f('0x3'));var fs=require('fs');var Redis=require(_0xd50f('0x4'));var db=require(_0xd50f('0x5'))['db'];var utils=require(_0xd50f('0x6'));var logger=require(_0xd50f('0x7'))(_0xd50f('0x8'));var config=require(_0xd50f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd50f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d205,_0x5001c8,_0x57ac7c){return new BPromise(function(_0x27d240,_0x2365a0){return client[_0xd50f('0xb')](_0x30d205,_0x57ac7c)['then'](function(_0x14a5fa){logger[_0xd50f('0xc')](_0xd50f('0xd'),_0x5001c8,_0xd50f('0xe'));logger[_0xd50f('0xf')](_0xd50f('0x10'),_0x5001c8,_0xd50f('0xe'),JSON[_0xd50f('0x11')](_0x14a5fa));if(_0x14a5fa[_0xd50f('0x12')]){if(_0x14a5fa['error'][_0xd50f('0x13')]===0x1f4){logger[_0xd50f('0x12')](_0xd50f('0xd'),_0x5001c8,_0x14a5fa[_0xd50f('0x12')]['message']);return _0x2365a0(_0x14a5fa[_0xd50f('0x12')][_0xd50f('0x14')]);}logger[_0xd50f('0x12')]('License,\x20%s,\x20%s',_0x5001c8,_0x14a5fa['error'][_0xd50f('0x14')]);return _0x27d240(_0x14a5fa[_0xd50f('0x12')][_0xd50f('0x14')]);}else{logger[_0xd50f('0xc')](_0xd50f('0xd'),_0x5001c8,_0xd50f('0xe'));_0x27d240(_0x14a5fa[_0xd50f('0x15')][_0xd50f('0x14')]);}})[_0xd50f('0x16')](function(_0x1a666c){logger[_0xd50f('0x12')](_0xd50f('0xd'),_0x5001c8,_0x1a666c);_0x2365a0(_0x1a666c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index a5c5a06..06d69ec 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 _0x74e4=['getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','/:id/canned_answers','addAnswer','post','create','/:id/in_servers','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions'];(function(_0x53051a,_0x872ffd){var _0x21e39d=function(_0x62e11a){while(--_0x62e11a){_0x53051a['push'](_0x53051a['shift']());}};_0x21e39d(++_0x872ffd);}(_0x74e4,0x19e));var _0x474e=function(_0x9e839a,_0x4e213b){_0x9e839a=_0x9e839a-0x0;var _0x5174f2=_0x74e4[_0x9e839a];return _0x5174f2;};'use strict';var multer=require(_0x474e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x474e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x474e('0x2'));var interaction=require(_0x474e('0x3'));var config=require(_0x474e('0x4'));var controller=require('./mailAccount.controller');router[_0x474e('0x5')]('/',auth[_0x474e('0x6')](),controller['index']);router[_0x474e('0x5')](_0x474e('0x7'),auth['isAuthenticated'](),controller[_0x474e('0x8')]);router[_0x474e('0x5')]('/:id',auth[_0x474e('0x6')](),controller[_0x474e('0x9')]);router[_0x474e('0x5')](_0x474e('0xa'),auth[_0x474e('0x6')](),controller['getDispositions']);router[_0x474e('0x5')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x474e('0xb')]);router[_0x474e('0x5')]('/:id/in_servers',auth[_0x474e('0x6')](),controller[_0x474e('0xc')]);router[_0x474e('0x5')](_0x474e('0xd'),auth[_0x474e('0x6')](),controller[_0x474e('0xe')]);router[_0x474e('0x5')](_0x474e('0xf'),auth[_0x474e('0x6')](),controller[_0x474e('0x10')]);router[_0x474e('0x5')](_0x474e('0x11'),auth[_0x474e('0x6')](),controller[_0x474e('0x12')]);router['get'](_0x474e('0x13'),auth[_0x474e('0x6')](),controller['getMessages']);router['get'](_0x474e('0x14'),auth[_0x474e('0x6')](),controller[_0x474e('0x15')]);router[_0x474e('0x5')](_0x474e('0x16'),auth[_0x474e('0x6')](),controller['getAgents']);router['post']('/:id/dispositions',auth[_0x474e('0x6')](),controller['addDisposition']);router['post'](_0x474e('0x17'),auth[_0x474e('0x6')](),controller[_0x474e('0x18')]);router[_0x474e('0x19')]('/',auth[_0x474e('0x6')](),controller[_0x474e('0x1a')]);router[_0x474e('0x19')](_0x474e('0x1b'),auth[_0x474e('0x6')](),controller[_0x474e('0x1c')]);router['post'](_0x474e('0xd'),auth[_0x474e('0x6')](),controller[_0x474e('0x1d')]);router[_0x474e('0x19')](_0x474e('0xf'),auth[_0x474e('0x6')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0x474e('0x6')](),controller[_0x474e('0x1e')]);router[_0x474e('0x19')](_0x474e('0x1f'),auth[_0x474e('0x6')](),controller[_0x474e('0x20')]);router[_0x474e('0x19')](_0x474e('0x16'),auth['isAuthenticated'](),controller[_0x474e('0x21')]);router[_0x474e('0x22')](_0x474e('0x23'),auth['isAuthenticated'](),controller[_0x474e('0x24')]);router[_0x474e('0x25')](_0x474e('0xa'),auth[_0x474e('0x6')](),controller[_0x474e('0x26')]);router[_0x474e('0x25')](_0x474e('0x17'),auth[_0x474e('0x6')](),controller[_0x474e('0x27')]);router[_0x474e('0x25')](_0x474e('0x1b'),auth['isAuthenticated'](),controller['removeImap']);router[_0x474e('0x25')](_0x474e('0xd'),auth[_0x474e('0x6')](),controller[_0x474e('0x28')]);router[_0x474e('0x25')]('/:id',auth['isAuthenticated'](),controller[_0x474e('0x29')]);router['delete'](_0x474e('0x16'),auth['isAuthenticated'](),controller[_0x474e('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x598b=['/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addSmtp','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions'];(function(_0x3575b8,_0x460cb3){var _0x100098=function(_0xf6cc0e){while(--_0xf6cc0e){_0x3575b8['push'](_0x3575b8['shift']());}};_0x100098(++_0x460cb3);}(_0x598b,0x126));var _0xb598=function(_0x626f86,_0x7619b5){_0x626f86=_0x626f86-0x0;var _0x418916=_0x598b[_0x626f86];return _0x418916;};'use strict';var multer=require('multer');var util=require(_0xb598('0x0'));var path=require(_0xb598('0x1'));var timeout=require(_0xb598('0x2'));var express=require(_0xb598('0x3'));var router=express[_0xb598('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb598('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb598('0x6'));var controller=require(_0xb598('0x7'));router[_0xb598('0x8')]('/',auth[_0xb598('0x9')](),controller[_0xb598('0xa')]);router[_0xb598('0x8')]('/describe',auth[_0xb598('0x9')](),controller['describe']);router[_0xb598('0x8')](_0xb598('0xb'),auth[_0xb598('0x9')](),controller['show']);router[_0xb598('0x8')](_0xb598('0xc'),auth[_0xb598('0x9')](),controller[_0xb598('0xd')]);router[_0xb598('0x8')]('/:id/canned_answers',auth[_0xb598('0x9')](),controller[_0xb598('0xe')]);router[_0xb598('0x8')](_0xb598('0xf'),auth['isAuthenticated'](),controller[_0xb598('0x10')]);router[_0xb598('0x8')](_0xb598('0x11'),auth[_0xb598('0x9')](),controller[_0xb598('0x12')]);router[_0xb598('0x8')](_0xb598('0x13'),auth['isAuthenticated'](),controller[_0xb598('0x14')]);router[_0xb598('0x8')](_0xb598('0x15'),auth['isAuthenticated'](),controller[_0xb598('0x16')]);router[_0xb598('0x8')](_0xb598('0x17'),auth[_0xb598('0x9')](),controller[_0xb598('0x18')]);router[_0xb598('0x8')]('/:id/verify',auth[_0xb598('0x9')](),controller[_0xb598('0x19')]);router[_0xb598('0x8')](_0xb598('0x1a'),auth[_0xb598('0x9')](),controller[_0xb598('0x1b')]);router[_0xb598('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb598('0x1d')]);router[_0xb598('0x1c')](_0xb598('0x1e'),auth[_0xb598('0x9')](),controller[_0xb598('0x1f')]);router[_0xb598('0x1c')]('/',auth[_0xb598('0x9')](),controller[_0xb598('0x20')]);router['post']('/:id/in_servers',auth[_0xb598('0x9')](),controller['addImap']);router['post']('/:id/out_servers',auth[_0xb598('0x9')](),controller[_0xb598('0x21')]);router[_0xb598('0x1c')](_0xb598('0x13'),auth[_0xb598('0x9')](),controller['addInteraction']);router['post'](_0xb598('0x15'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xb598('0x22'),auth[_0xb598('0x9')](),controller[_0xb598('0x23')]);router['post'](_0xb598('0x1a'),auth[_0xb598('0x9')](),controller[_0xb598('0x24')]);router['put'](_0xb598('0xb'),auth['isAuthenticated'](),controller[_0xb598('0x25')]);router[_0xb598('0x26')](_0xb598('0xc'),auth[_0xb598('0x9')](),controller[_0xb598('0x27')]);router[_0xb598('0x26')](_0xb598('0x1e'),auth['isAuthenticated'](),controller[_0xb598('0x28')]);router[_0xb598('0x26')]('/:id/in_servers',auth[_0xb598('0x9')](),controller[_0xb598('0x29')]);router[_0xb598('0x26')](_0xb598('0x11'),auth['isAuthenticated'](),controller[_0xb598('0x2a')]);router[_0xb598('0x26')](_0xb598('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xb598('0x1a'),auth[_0xb598('0x9')](),controller[_0xb598('0x2b')]);module[_0xb598('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 81b96da..1011f6c 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 _0xb582=['gmail','yahoo','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM'];(function(_0x5c8f03,_0xc20bcc){var _0xea2df4=function(_0x357c4c){while(--_0x357c4c){_0x5c8f03['push'](_0x5c8f03['shift']());}};_0xea2df4(++_0xc20bcc);}(_0xb582,0x8b));var _0x2b58=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb582[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require('sequelize');module[_0x2b58('0x0')]={'description':{'type':Sequelize[_0x2b58('0x1')]},'name':{'type':Sequelize[_0x2b58('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x2b58('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2b58('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2b58('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2b58('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x2b58('0x3')]},'markAsUnread':{'type':Sequelize[_0x2b58('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b58('0x4')},'fontSize':{'type':Sequelize[_0x2b58('0x5')](0x2)[_0x2b58('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2b58('0x3')],'defaultValue':function(){return _0x2b58('0x7');}},'notificationSound':{'type':Sequelize[_0x2b58('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2b58('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2b58('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b58('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2b58('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b58('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2b58('0x2')],'defaultValue':![],'comment':_0x2b58('0x8'),'set':function(_0x332869){if(!_0x332869)this[_0x2b58('0x9')](_0x2b58('0xa'),null);this[_0x2b58('0x9')](_0x2b58('0xb'),_0x332869);}},'provider':{'type':Sequelize[_0x2b58('0xc')](_0x2b58('0xd'),'hotmail',_0x2b58('0xe'),_0x2b58('0xf')),'defaultValue':null,'get':function(){var _0x1a3269=this[_0x2b58('0x10')](_0x2b58('0x11'));return _0x1a3269||'custom';},'set':function(_0x4b83d3){if(_0x4b83d3===_0x2b58('0x12')){_0x4b83d3=null;}return this['setDataValue'](_0x2b58('0x11'),_0x4b83d3);}}}; \ No newline at end of file +var _0x1fb2=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','gmail','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x230249,_0x27c009){var _0x4f6e0b=function(_0x50d266){while(--_0x50d266){_0x230249['push'](_0x230249['shift']());}};_0x4f6e0b(++_0x27c009);}(_0x1fb2,0x14d));var _0x21fb=function(_0x3d9c33,_0xf0c46d){_0x3d9c33=_0x3d9c33-0x0;var _0x5bbd81=_0x1fb2[_0x3d9c33];return _0x5bbd81;};'use strict';var Sequelize=require(_0x21fb('0x0'));module[_0x21fb('0x1')]={'description':{'type':Sequelize[_0x21fb('0x2')]},'name':{'type':Sequelize[_0x21fb('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x21fb('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x21fb('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x21fb('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x21fb('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x21fb('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x21fb('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x21fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x21fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x21fb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x21fb('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x21fb('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x21fb('0x3')],'defaultValue':![],'comment':_0x21fb('0x7'),'set':function(_0x3e36f0){if(!_0x3e36f0)this[_0x21fb('0x8')]('mandatoryDispositionPauseId',null);this[_0x21fb('0x8')]('mandatoryDisposition',_0x3e36f0);}},'provider':{'type':Sequelize['ENUM'](_0x21fb('0x9'),'hotmail','yahoo','outlook365'),'defaultValue':null,'get':function(){var _0x33c41c=this[_0x21fb('0xa')]('provider');return _0x33c41c||_0x21fb('0xb');},'set':function(_0x56c3bf){if(_0x56c3bf===_0x21fb('0xb')){_0x56c3bf=null;}return this['setDataValue'](_0x21fb('0xc'),_0x56c3bf);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 350a1ef..c1b279d 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 _0x4611=['../../config/logger','../../config/environment','redis','defaults','localhost','./mailAccount.socket','jayson/promise','client','http','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','destroy','get','MailAccounts','UserProfileResource','then','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','port','host','secure','service','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','MailServerIn','length','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','create','getDispositions','findOne','rawAttributes','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ListId','isNil','active','description','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','CmContact','Contacts','updatedAt','CloudProvider','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','attach','out','messageId','Interaction','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','userMailAccount:remove','emit','getAgents','moment','path','lodash','juice'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4611,0x17c));var _0x1461=function(_0xb4a4c2,_0x1632d6){_0xb4a4c2=_0xb4a4c2-0x0;var _0x1e2d40=_0x4611[_0xb4a4c2];return _0x1e2d40;};'use strict';var moment=require(_0x1461('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x1461('0x1'));var _=require(_0x1461('0x2'));var juice=require(_0x1461('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1461('0x4'))('api');var config=require(_0x1461('0x5'));var db=require('../../mysqldb')['db'];config[_0x1461('0x6')]=_[_0x1461('0x7')](config[_0x1461('0x6')],{'host':_0x1461('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1461('0x6')]));require(_0x1461('0x9'))['register'](socket);var jayson=require(_0x1461('0xa'));var client=jayson[_0x1461('0xb')][_0x1461('0xc')]({'port':0x232b});function respondWithRpcPromise(_0x561f57,_0x2efe42,_0x1fadf4,_0x4acbdd){return new BPromise(function(_0x3bcbf6,_0x2976e6){var _0x12151d=_0x4acbdd||client;return _0x12151d[_0x1461('0xd')](_0x561f57,_0x1fadf4)['then'](function(_0x3b5563){logger['info'](_0x1461('0xe'),_0x2efe42,_0x1461('0xf'));logger[_0x1461('0x10')](_0x1461('0x11'),_0x2efe42,_0x1461('0xf'),JSON['stringify'](_0x3b5563));if(_0x3b5563[_0x1461('0x12')]){if(_0x3b5563['error']['code']===0x1f4){logger[_0x1461('0x12')](_0x1461('0xe'),_0x2efe42,_0x3b5563['error'][_0x1461('0x13')]);return _0x2976e6(_0x3b5563[_0x1461('0x12')][_0x1461('0x13')]);}logger[_0x1461('0x12')](_0x1461('0xe'),_0x2efe42,_0x3b5563['error'][_0x1461('0x13')]);return _0x3bcbf6(_0x3b5563[_0x1461('0x12')][_0x1461('0x13')]);}else{logger['info'](_0x1461('0xe'),_0x2efe42,'request\x20sent');_0x3bcbf6(_0x3b5563[_0x1461('0x14')][_0x1461('0x13')]);}})['catch'](function(_0x144f24){logger[_0x1461('0x12')](_0x1461('0xe'),_0x2efe42,_0x144f24);_0x2976e6(_0x144f24);});});}function respondWithStatusCode(_0x4384af,_0x167585){_0x167585=_0x167585||0xcc;return function(_0x23cc2e){if(_0x23cc2e){return _0x4384af[_0x1461('0x15')](_0x167585);}return _0x4384af[_0x1461('0x16')](_0x167585)[_0x1461('0x17')]();};}function respondWithResult(_0x586b1b,_0x15b017){_0x15b017=_0x15b017||0xc8;return function(_0x41e65f){if(_0x41e65f){return _0x586b1b[_0x1461('0x16')](_0x15b017)['json'](_0x41e65f);}};}function respondWithFilteredResult(_0xae0f3b,_0x5ed140){return function(_0x52e038){if(_0x52e038){var _0x5050f6=typeof _0x5ed140[_0x1461('0x18')]==='undefined'&&typeof _0x5ed140['limit']===_0x1461('0x19');var _0xaa846d=_0x52e038[_0x1461('0x1a')];var _0x264087=_0x5050f6?0x0:_0x5ed140['offset'];var _0x3400f4=_0x5050f6?_0x52e038['count']:_0x5ed140[_0x1461('0x18')]+_0x5ed140[_0x1461('0x1b')];var _0x2be5c8;if(_0x3400f4>=_0xaa846d){_0x3400f4=_0xaa846d;_0x2be5c8=0xc8;}else{_0x2be5c8=0xce;}_0xae0f3b[_0x1461('0x16')](_0x2be5c8);return _0xae0f3b[_0x1461('0x1c')](_0x1461('0x1d'),_0x264087+'-'+_0x3400f4+'/'+_0xaa846d)[_0x1461('0x1e')](_0x52e038);}return null;};}function saveUpdates(_0x1e8dd8){return function(_0x4752c2){if(_0x4752c2){return _0x4752c2[_0x1461('0x1f')](_0x1e8dd8)['then'](function(_0xf850c2){return _0xf850c2;});}return null;};}function removeEntity(_0x3ad8ee){return function(_0x2328c6){if(_0x2328c6){return _0x2328c6[_0x1461('0x20')]()['then'](function(){var _0x33c285=_0x2328c6[_0x1461('0x21')]({'plain':!![]});var _0x47c544=_0x1461('0x22');return db[_0x1461('0x23')]['destroy']({'where':{'type':_0x47c544,'resourceId':_0x33c285['id']}})['then'](function(){return _0x2328c6;});})[_0x1461('0x24')](function(){_0x3ad8ee['status'](0xcc)[_0x1461('0x17')]();});}};}function handleEntityNotFound(_0x559121){return function(_0xbb003e){if(!_0xbb003e){_0x559121[_0x1461('0x15')](0x194);}return _0xbb003e;};}function handleError(_0x2b35f8,_0x5c8430){_0x5c8430=_0x5c8430||0x1f4;return function(_0x51dd9c){logger[_0x1461('0x12')](_0x51dd9c[_0x1461('0x25')]);if(_0x51dd9c[_0x1461('0x26')]){delete _0x51dd9c[_0x1461('0x26')];}_0x2b35f8[_0x1461('0x16')](_0x5c8430)['send'](_0x51dd9c);};}function getImapHost(_0x32064f){switch(_0x32064f){case _0x1461('0x27'):return _0x1461('0x28');case _0x1461('0x29'):return _0x1461('0x2a');case _0x1461('0x2b'):return _0x1461('0x2c');case _0x1461('0x2d'):return _0x1461('0x2e');}throw new Error(_0x1461('0x2f'),_0x32064f);}function getSmtpHost(_0x1ac3d9){switch(_0x1ac3d9){case _0x1461('0x27'):return _0x1461('0x30');case _0x1461('0x29'):return _0x1461('0x31');case _0x1461('0x2b'):return _0x1461('0x32');case _0x1461('0x2d'):return _0x1461('0x33');}throw new Error(_0x1461('0x2f'),_0x1ac3d9);}function getAuthenticationOptions(_0x5b5249,_0x34636f){var _0x39a248={};var _0x434934={};if(_0x5b5249){_0x39a248[_0x1461('0x34')]=_0x434934[_0x1461('0x34')]=_0x34636f[_0x1461('0x35')];_0x39a248[_0x1461('0x36')]=_0x434934['pass']=_0x34636f['password'];if(_0x34636f[_0x1461('0x37')]){_0x39a248[_0x1461('0x37')]=_0x434934[_0x1461('0x37')]=!![];_0x39a248[_0x1461('0x38')]=_0x434934['CloudProviderId']=_0x34636f[_0x1461('0x38')];_0x39a248[_0x1461('0x36')]=_0x434934[_0x1461('0x39')]=null;}else{_0x39a248['CloudProviderId']=_0x434934[_0x1461('0x38')]=null;}_0x39a248['host']=getImapHost(_0x5b5249);_0x39a248[_0x1461('0x3a')]=0x3e1;_0x434934[_0x1461('0x3b')]=getSmtpHost(_0x5b5249);_0x434934[_0x1461('0x3a')]=0x24b;_0x434934[_0x1461('0x3c')]=![];_0x39a248[_0x1461('0x3d')]=_0x434934[_0x1461('0x3d')]=null;}else{if(_0x34636f['authentication']){_0x39a248[_0x1461('0x34')]=_0x434934[_0x1461('0x34')]=_0x34636f[_0x1461('0x35')];_0x39a248[_0x1461('0x36')]=_0x434934[_0x1461('0x39')]=_0x34636f[_0x1461('0x36')];}else{_0x39a248['authentication']=_0x434934['authentication']=![];_0x39a248[_0x1461('0x34')]=_0x434934[_0x1461('0x34')]=null;_0x39a248['password']=_0x434934['pass']=null;}_0x39a248[_0x1461('0x3b')]=_0x34636f[_0x1461('0x3e')][_0x1461('0x3b')];_0x39a248['port']=_0x34636f['Imap'][_0x1461('0x3a')];_0x434934[_0x1461('0x3b')]=_0x34636f[_0x1461('0x3f')][_0x1461('0x3b')];_0x434934['port']=_0x34636f[_0x1461('0x3f')]['port'];}return{'Imap':_0x39a248,'Smtp':_0x434934};}exports[_0x1461('0x40')]=function(_0x5126cc,_0x350079){var _0x230fca={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x1461('0x41')],'as':_0x1461('0x3f')},{'model':db[_0x1461('0x42')],'as':_0x1461('0x43')}]},_0xf12933={},_0x220e26={'count':0x0,'rows':[]};var _0x5a932f=_[_0x1461('0x44')](db[_0x1461('0x45')]['rawAttributes'],function(_0x54a70f){return{'name':_0x54a70f[_0x1461('0x46')],'type':_0x54a70f[_0x1461('0x47')][_0x1461('0x48')]};});_0xf12933[_0x1461('0x49')]=_[_0x1461('0x44')](_0x5a932f,_0x1461('0x26'));_0xf12933[_0x1461('0x4a')]=_[_0x1461('0x4b')](_0x5126cc[_0x1461('0x4a')]);_0xf12933[_0x1461('0x4c')]=_[_0x1461('0x4d')](_0xf12933[_0x1461('0x49')],_0xf12933[_0x1461('0x4a')]);_0x230fca[_0x1461('0x4e')]=_['intersection'](_0xf12933[_0x1461('0x49')],qs[_0x1461('0x4f')](_0x5126cc[_0x1461('0x4a')][_0x1461('0x4f')]));_0x230fca['attributes']=_0x230fca[_0x1461('0x4e')]['length']?_0x230fca[_0x1461('0x4e')]:_0xf12933[_0x1461('0x49')];if(!_0x5126cc[_0x1461('0x4a')][_0x1461('0x50')](_0x1461('0x51'))){_0x230fca[_0x1461('0x1b')]=qs[_0x1461('0x1b')](_0x5126cc[_0x1461('0x4a')]['limit']);_0x230fca[_0x1461('0x18')]=qs[_0x1461('0x18')](_0x5126cc[_0x1461('0x4a')][_0x1461('0x18')]);}_0x230fca[_0x1461('0x52')]=qs[_0x1461('0x53')](_0x5126cc[_0x1461('0x4a')][_0x1461('0x53')]);_0x230fca[_0x1461('0x54')]=qs['filters'](_[_0x1461('0x55')](_0x5126cc[_0x1461('0x4a')],_0xf12933[_0x1461('0x4c')]),_0x5a932f);if(_0x5126cc[_0x1461('0x4a')][_0x1461('0x56')]){_0x230fca[_0x1461('0x54')]=_[_0x1461('0x57')](_0x230fca[_0x1461('0x54')],{'$or':_[_0x1461('0x44')](_0x5a932f,function(_0x4ea186){if(_0x4ea186[_0x1461('0x47')]!=='VIRTUAL'){var _0x9d134={};_0x9d134[_0x4ea186[_0x1461('0x26')]]={'$like':'%'+_0x5126cc[_0x1461('0x4a')][_0x1461('0x56')]+'%'};return _0x9d134;}})});}_0x230fca=_[_0x1461('0x57')]({},_0x230fca,_0x5126cc[_0x1461('0x58')]);var _0x5a1149={'where':_0x230fca['where']};return db['MailAccount'][_0x1461('0x1a')](_0x5a1149)['then'](function(_0xcee579){_0x220e26[_0x1461('0x1a')]=_0xcee579;if(_0x5126cc['query'][_0x1461('0x59')]){_0x230fca[_0x1461('0x5a')]=[{'all':!![]}];}return db[_0x1461('0x45')][_0x1461('0x5b')](_0x230fca);})[_0x1461('0x24')](function(_0x3a6cf5){_0x220e26[_0x1461('0x5c')]=_0x3a6cf5;return _0x220e26;})[_0x1461('0x24')](respondWithFilteredResult(_0x350079,_0x230fca))[_0x1461('0x5d')](handleError(_0x350079,null));};exports[_0x1461('0x5e')]=function(_0x42f96e,_0xb24e22){var _0x26cca2={'raw':![],'where':{'id':_0x42f96e['params']['id']},'include':[{'model':db[_0x1461('0x5f')],'as':_0x1461('0x3e')},{'model':db['MailServerOut'],'as':_0x1461('0x3f')},{'model':db['Pause'],'as':_0x1461('0x43')}]},_0x5dee9d={};_0x5dee9d[_0x1461('0x49')]=_['keys'](db[_0x1461('0x45')]['rawAttributes']);_0x5dee9d[_0x1461('0x4a')]=_[_0x1461('0x4b')](_0x42f96e[_0x1461('0x4a')]);_0x5dee9d['filters']=_[_0x1461('0x4d')](_0x5dee9d[_0x1461('0x49')],_0x5dee9d[_0x1461('0x4a')]);_0x26cca2[_0x1461('0x4e')]=_[_0x1461('0x4d')](_0x5dee9d['model'],qs['fields'](_0x42f96e['query'][_0x1461('0x4f')]));_0x26cca2[_0x1461('0x4e')]=_0x26cca2[_0x1461('0x4e')][_0x1461('0x60')]?_0x26cca2['attributes']:_0x5dee9d[_0x1461('0x49')];if(_0x42f96e[_0x1461('0x4a')][_0x1461('0x59')]){_0x26cca2[_0x1461('0x5a')]=[{'all':!![]}];}_0x26cca2=_[_0x1461('0x57')]({},_0x26cca2,_0x42f96e[_0x1461('0x58')]);return db['MailAccount'][_0x1461('0x61')](_0x26cca2)[_0x1461('0x24')](handleEntityNotFound(_0xb24e22,null))[_0x1461('0x24')](respondWithResult(_0xb24e22,null))['catch'](handleError(_0xb24e22,null));};exports[_0x1461('0x1f')]=function(_0x42a635,_0x2fcab0){if(_0x42a635[_0x1461('0x62')]['id']){delete _0x42a635[_0x1461('0x62')]['id'];}var _0x30b603=_0x42a635[_0x1461('0x62')][_0x1461('0x63')]===_0x1461('0x64')?null:_0x42a635[_0x1461('0x62')][_0x1461('0x63')];var _0xa2055e=_0x42a635[_0x1461('0x62')][_0x1461('0x3e')]||{};var _0x2089b4=_0x42a635['body'][_0x1461('0x3f')]||{};if(_0x30b603){_0xa2055e['host']=getImapHost(_0x30b603);_0xa2055e['port']=0x3e1;_0x2089b4[_0x1461('0x3b')]=getSmtpHost(_0x30b603);_0x2089b4['port']=0x24b;_0x2089b4['secure']=![];}if(_0x2089b4[_0x1461('0x37')]){_0x2089b4['secure']=![];}else{_0x2089b4[_0x1461('0x38')]=null;}if(!_0xa2055e[_0x1461('0x37')])_0xa2055e[_0x1461('0x38')]=null;_0x42a635[_0x1461('0x62')]['Imap']=_0xa2055e;_0x42a635[_0x1461('0x62')]['Smtp']=_0x2089b4;return db['MailAccount']['find']({'where':{'id':_0x42a635[_0x1461('0x65')]['id']},'include':[{'model':db[_0x1461('0x5f')],'as':_0x1461('0x3e')},{'model':db[_0x1461('0x41')],'as':_0x1461('0x3f')},{'model':db['Pause'],'as':_0x1461('0x43')}]})[_0x1461('0x24')](handleEntityNotFound(_0x2fcab0,null))['then'](function(_0xbf0785){if(!_0xbf0785)throw new Error(_0x1461('0x66'));if(_0xbf0785[_0x1461('0x3d')])delete _0x42a635[_0x1461('0x62')]['Imap'];return _0xbf0785;})[_0x1461('0x24')](saveUpdates(_0x42a635[_0x1461('0x62')],null))[_0x1461('0x24')](function(_0x541c43){if(!_0x42a635['body'][_0x1461('0x3e')])return _0x541c43;return db['MailServerIn'][_0x1461('0x1f')](_0x42a635[_0x1461('0x62')]['Imap'],{'where':{'MailAccountId':_0x541c43['id']}})[_0x1461('0x24')](function(){return _0x541c43;});})[_0x1461('0x24')](function(_0x2f8c6b){if(!_0x42a635[_0x1461('0x62')][_0x1461('0x3f')])return _0x2f8c6b;return db[_0x1461('0x41')]['update'](_0x42a635[_0x1461('0x62')][_0x1461('0x3f')],{'where':{'MailAccountId':_0x2f8c6b['id']}})['then'](function(){return _0x2f8c6b;});})['then'](respondWithResult(_0x2fcab0,null))[_0x1461('0x5d')](handleError(_0x2fcab0,null));};exports[_0x1461('0x67')]=function(_0x54188e,_0x5c274b){return db[_0x1461('0x45')][_0x1461('0x67')]()[_0x1461('0x24')](respondWithResult(_0x5c274b,null))['catch'](handleError(_0x5c274b,null));};exports[_0x1461('0x68')]=function(_0x522016,_0xa12771){if(_0x522016[_0x1461('0x62')]['id']){delete _0x522016['body']['id'];}return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x522016['params']['id']}})[_0x1461('0x24')](handleEntityNotFound(_0xa12771,null))['then'](function(_0x54c684){if(_0x54c684){_0x522016['body']['MailAccountId']=_0x54c684['id'];return db[_0x1461('0x69')][_0x1461('0x6a')](_0x522016[_0x1461('0x62')]);}})[_0x1461('0x24')](respondWithResult(_0xa12771,null))[_0x1461('0x5d')](handleError(_0xa12771,null));};exports[_0x1461('0x6b')]=function(_0x460f9e,_0x4b4f58){var _0x470034={'raw':![],'where':{}};var _0x52613={};var _0x246d56={'count':0x0,'rows':[]};return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0x460f9e[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x4b4f58,null))[_0x1461('0x24')](function(_0x59bdd1){if(_0x59bdd1){_0x52613[_0x1461('0x49')]=_['keys'](db['Disposition'][_0x1461('0x6d')]);_0x52613[_0x1461('0x4a')]=_[_0x1461('0x4b')](_0x460f9e[_0x1461('0x4a')]);_0x52613[_0x1461('0x4c')]=_[_0x1461('0x4d')](_0x52613['model'],_0x52613[_0x1461('0x4a')]);_0x470034[_0x1461('0x4e')]=_[_0x1461('0x4d')](_0x52613[_0x1461('0x49')],qs[_0x1461('0x4f')](_0x460f9e[_0x1461('0x4a')][_0x1461('0x4f')]));_0x470034[_0x1461('0x4e')]=_0x470034[_0x1461('0x4e')][_0x1461('0x60')]?_0x470034[_0x1461('0x4e')]:_0x52613[_0x1461('0x49')];if(!_0x460f9e['query'][_0x1461('0x50')]('nolimit')){_0x470034[_0x1461('0x1b')]=qs[_0x1461('0x1b')](_0x460f9e[_0x1461('0x4a')][_0x1461('0x1b')]);_0x470034['offset']=qs[_0x1461('0x18')](_0x460f9e[_0x1461('0x4a')]['offset']);}_0x470034[_0x1461('0x52')]=qs[_0x1461('0x53')](_0x460f9e[_0x1461('0x4a')][_0x1461('0x53')]);_0x470034[_0x1461('0x54')]=qs[_0x1461('0x4c')](_[_0x1461('0x55')](_0x460f9e[_0x1461('0x4a')],_0x52613[_0x1461('0x4c')]));_0x470034[_0x1461('0x54')][_0x1461('0x6e')]=_0x59bdd1['id'];if(_0x460f9e[_0x1461('0x4a')][_0x1461('0x56')]){_0x470034[_0x1461('0x54')]=_[_0x1461('0x57')](_0x470034[_0x1461('0x54')],{'$or':_[_0x1461('0x44')](_0x470034[_0x1461('0x4e')],function(_0x2ec1a4){var _0x224824={};_0x224824[_0x2ec1a4]={'$like':'%'+_0x460f9e[_0x1461('0x4a')][_0x1461('0x56')]+'%'};return _0x224824;})});}_0x470034=_[_0x1461('0x57')]({},_0x470034,_0x460f9e['options']);return db[_0x1461('0x69')][_0x1461('0x1a')]({'where':_0x470034[_0x1461('0x54')]})[_0x1461('0x24')](function(_0x108d84){_0x246d56[_0x1461('0x1a')]=_0x108d84;if(_0x460f9e[_0x1461('0x4a')][_0x1461('0x59')]){_0x470034[_0x1461('0x5a')]=[{'all':!![]}];}return db[_0x1461('0x69')][_0x1461('0x5b')](_0x470034);})[_0x1461('0x24')](function(_0x16f9de){_0x246d56[_0x1461('0x5c')]=_0x16f9de;return _0x246d56;});}})[_0x1461('0x24')](respondWithFilteredResult(_0x4b4f58,_0x470034))[_0x1461('0x5d')](handleError(_0x4b4f58,null));};exports[_0x1461('0x6f')]=function(_0x44c364,_0x1054d7){return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x44c364[_0x1461('0x65')]['id']}})['then'](handleEntityNotFound(_0x1054d7,null))[_0x1461('0x24')](function(_0x53e0d9){if(_0x53e0d9){return _0x53e0d9[_0x1461('0x6f')](_0x44c364[_0x1461('0x4a')][_0x1461('0x70')]);}})[_0x1461('0x24')](respondWithStatusCode(_0x1054d7,null))[_0x1461('0x5d')](handleError(_0x1054d7,null));};exports[_0x1461('0x71')]=function(_0x373e03,_0x5e2223){if(_0x373e03[_0x1461('0x62')]['id']){delete _0x373e03['body']['id'];}return db['MailAccount'][_0x1461('0x61')]({'where':{'id':_0x373e03[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x5e2223,null))['then'](function(_0x34e70d){if(_0x34e70d){_0x373e03[_0x1461('0x62')][_0x1461('0x6e')]=_0x34e70d['id'];return db[_0x1461('0x72')][_0x1461('0x6a')](_0x373e03[_0x1461('0x62')]);}})[_0x1461('0x24')](respondWithResult(_0x5e2223,null))['catch'](handleError(_0x5e2223,null));};exports[_0x1461('0x73')]=function(_0xe28a45,_0x3d098f){var _0x2a4b8a={'raw':![],'where':{}};var _0x1acc4d={};var _0x385d65={'count':0x0,'rows':[]};return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0xe28a45[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x3d098f,null))[_0x1461('0x24')](function(_0x1a9013){if(_0x1a9013){_0x1acc4d[_0x1461('0x49')]=_[_0x1461('0x4b')](db[_0x1461('0x72')][_0x1461('0x6d')]);_0x1acc4d['query']=_[_0x1461('0x4b')](_0xe28a45[_0x1461('0x4a')]);_0x1acc4d['filters']=_['intersection'](_0x1acc4d[_0x1461('0x49')],_0x1acc4d['query']);_0x2a4b8a['attributes']=_[_0x1461('0x4d')](_0x1acc4d[_0x1461('0x49')],qs['fields'](_0xe28a45[_0x1461('0x4a')][_0x1461('0x4f')]));_0x2a4b8a[_0x1461('0x4e')]=_0x2a4b8a[_0x1461('0x4e')]['length']?_0x2a4b8a[_0x1461('0x4e')]:_0x1acc4d[_0x1461('0x49')];if(!_0xe28a45[_0x1461('0x4a')][_0x1461('0x50')](_0x1461('0x51'))){_0x2a4b8a[_0x1461('0x1b')]=qs[_0x1461('0x1b')](_0xe28a45[_0x1461('0x4a')]['limit']);_0x2a4b8a[_0x1461('0x18')]=qs[_0x1461('0x18')](_0xe28a45[_0x1461('0x4a')][_0x1461('0x18')]);}_0x2a4b8a[_0x1461('0x52')]=qs[_0x1461('0x53')](_0xe28a45[_0x1461('0x4a')][_0x1461('0x53')]);_0x2a4b8a['where']=qs[_0x1461('0x4c')](_[_0x1461('0x55')](_0xe28a45[_0x1461('0x4a')],_0x1acc4d[_0x1461('0x4c')]));_0x2a4b8a[_0x1461('0x54')][_0x1461('0x6e')]=_0x1a9013['id'];if(_0xe28a45['query'][_0x1461('0x56')]){_0x2a4b8a[_0x1461('0x54')]=_[_0x1461('0x57')](_0x2a4b8a[_0x1461('0x54')],{'$or':_[_0x1461('0x44')](_0x2a4b8a[_0x1461('0x4e')],function(_0xff28b9){var _0xc1c7f0={};_0xc1c7f0[_0xff28b9]={'$like':'%'+_0xe28a45[_0x1461('0x4a')][_0x1461('0x56')]+'%'};return _0xc1c7f0;})});}_0x2a4b8a=_[_0x1461('0x57')]({},_0x2a4b8a,_0xe28a45[_0x1461('0x58')]);return db['CannedAnswer'][_0x1461('0x1a')]({'where':_0x2a4b8a['where']})['then'](function(_0x108fa5){_0x385d65['count']=_0x108fa5;if(_0xe28a45[_0x1461('0x4a')][_0x1461('0x59')]){_0x2a4b8a['include']=[{'all':!![]}];}return db[_0x1461('0x72')][_0x1461('0x5b')](_0x2a4b8a);})['then'](function(_0xe0e619){_0x385d65[_0x1461('0x5c')]=_0xe0e619;return _0x385d65;});}})['then'](respondWithFilteredResult(_0x3d098f,_0x2a4b8a))[_0x1461('0x5d')](handleError(_0x3d098f,null));};exports[_0x1461('0x74')]=function(_0x1efd4e,_0x2989c1){return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x1efd4e[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x2989c1,null))[_0x1461('0x24')](function(_0x2503db){if(_0x2503db){return _0x2503db[_0x1461('0x74')](_0x1efd4e[_0x1461('0x4a')][_0x1461('0x70')]);}})['then'](respondWithStatusCode(_0x2989c1,null))[_0x1461('0x5d')](handleError(_0x2989c1,null));};exports[_0x1461('0x6a')]=function(_0x2d5ce4,_0x310c74){var _0x2ebf3f={'name':_0x2d5ce4[_0x1461('0x62')]['name'],'key':_0x2d5ce4[_0x1461('0x62')][_0x1461('0x48')],'provider':_0x2d5ce4['body'][_0x1461('0x63')]===_0x1461('0x64')?null:_0x2d5ce4[_0x1461('0x62')][_0x1461('0x63')],'email':_0x2d5ce4[_0x1461('0x62')]['email'],'ListId':_0x2d5ce4[_0x1461('0x62')][_0x1461('0x75')],'active':!_[_0x1461('0x76')](_0x2d5ce4[_0x1461('0x62')][_0x1461('0x77')])?_0x2d5ce4[_0x1461('0x62')][_0x1461('0x77')]:!![],'description':_0x2d5ce4['body'][_0x1461('0x78')]||null};var _0x3fc215=getAuthenticationOptions(_0x2ebf3f[_0x1461('0x63')],_0x2d5ce4['body']);_0x2ebf3f[_0x1461('0x3e')]=_0x3fc215[_0x1461('0x3e')];_0x2ebf3f[_0x1461('0x3f')]=_0x3fc215[_0x1461('0x3f')];return db[_0x1461('0x45')][_0x1461('0x6a')](_0x2ebf3f,{'include':[{'model':db[_0x1461('0x41')],'as':_0x1461('0x3f')},{'model':db[_0x1461('0x5f')],'as':_0x1461('0x3e')}]})[_0x1461('0x24')](function(_0x4c38f1){var _0x2aef1e=_0x2d5ce4['user'][_0x1461('0x21')]({'plain':!![]});if(!_0x2aef1e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2aef1e[_0x1461('0x79')]==='user'){var _0xa0bcd8=_0x4c38f1[_0x1461('0x21')]({'plain':!![]});return db[_0x1461('0x7a')][_0x1461('0x61')]({'where':{'name':_0x1461('0x22'),'userProfileId':_0x2aef1e[_0x1461('0x7b')]},'raw':!![]})[_0x1461('0x24')](function(_0x1e7378){if(_0x1e7378&&_0x1e7378[_0x1461('0x7c')]===0x0){return db[_0x1461('0x23')]['create']({'name':_0xa0bcd8[_0x1461('0x26')],'resourceId':_0xa0bcd8['id'],'type':_0x1e7378['name'],'sectionId':_0x1e7378['id']},{})[_0x1461('0x24')](function(){return _0x4c38f1;});}else{return _0x4c38f1;}})['catch'](function(_0x43cd48){logger['error'](_0x1461('0x7d'),_0x43cd48);throw _0x43cd48;});}return _0x4c38f1;})[_0x1461('0x24')](respondWithResult(_0x310c74,0xc9))[_0x1461('0x5d')](handleError(_0x310c74,null));};exports['getImap']=function(_0x11bffc,_0x575dfa){return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0x11bffc['params']['id']}})['then'](handleEntityNotFound(_0x575dfa,null))['then'](function(_0x566cc9){if(_0x566cc9){return _0x566cc9[_0x1461('0x7e')]();}return null;})[_0x1461('0x24')](respondWithResult(_0x575dfa,null))[_0x1461('0x5d')](handleError(_0x575dfa,null));};exports[_0x1461('0x7f')]=function(_0x6d408b,_0x4b9fc6){if(_0x6d408b[_0x1461('0x62')]['id']){delete _0x6d408b[_0x1461('0x62')]['id'];}return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x6d408b[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x4b9fc6,null))[_0x1461('0x24')](function(_0x59e394){if(_0x59e394){_0x6d408b[_0x1461('0x62')][_0x1461('0x6e')]=_0x59e394['id'];return db[_0x1461('0x5f')][_0x1461('0x6a')](_0x6d408b[_0x1461('0x62')]);}})[_0x1461('0x24')](respondWithResult(_0x4b9fc6,null))['catch'](handleError(_0x4b9fc6,null));};exports[_0x1461('0x80')]=function(_0x26eedd,_0x46ff51){return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0x26eedd[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x46ff51,null))[_0x1461('0x24')](function(_0x1f2b25){if(_0x1f2b25){return _0x1f2b25['setImap'](null);}return null;})[_0x1461('0x24')](respondWithStatusCode(_0x46ff51,null))[_0x1461('0x5d')](handleError(_0x46ff51,null));};exports[_0x1461('0x81')]=function(_0x24fc0e,_0x3a9a55){return db[_0x1461('0x45')]['findOne']({'where':{'id':_0x24fc0e[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x3a9a55,null))['then'](function(_0x230350){if(_0x230350){return _0x230350['getSmtp']();}return null;})[_0x1461('0x24')](respondWithResult(_0x3a9a55,null))['catch'](handleError(_0x3a9a55,null));};exports[_0x1461('0x82')]=function(_0x6bdf2f,_0x204a9e){if(_0x6bdf2f[_0x1461('0x62')]['id']){delete _0x6bdf2f[_0x1461('0x62')]['id'];}return db['MailAccount'][_0x1461('0x61')]({'where':{'id':_0x6bdf2f['params']['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x204a9e,null))[_0x1461('0x24')](function(_0x2ffe3d){if(_0x2ffe3d){_0x6bdf2f['body'][_0x1461('0x6e')]=_0x2ffe3d['id'];return db[_0x1461('0x41')][_0x1461('0x6a')](_0x6bdf2f[_0x1461('0x62')]);}})['then'](respondWithResult(_0x204a9e,null))['catch'](handleError(_0x204a9e,null));};exports['removeSmtp']=function(_0x176479,_0x2cbb53){return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0x176479[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x2cbb53,null))[_0x1461('0x24')](function(_0x5f012b){if(_0x5f012b){return _0x5f012b[_0x1461('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x2cbb53,null))['catch'](handleError(_0x2cbb53,null));};exports[_0x1461('0x84')]=function(_0x59e356,_0x396553){return db[_0x1461('0x85')][_0x1461('0x61')]({'where':{'id':_0x59e356[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x396553,null))[_0x1461('0x24')](function(_0x121058){if(_0x121058){return _0x121058[_0x1461('0x84')](_0x59e356[_0x1461('0x62')][_0x1461('0x70')],_['omit'](_0x59e356[_0x1461('0x62')],[_0x1461('0x70'),'id'])||{});}})[_0x1461('0x24')](respondWithResult(_0x396553,null))[_0x1461('0x5d')](handleError(_0x396553,null));};exports[_0x1461('0x86')]=function(_0xb9f2ac,_0x1801c6){var _0x1b1809={'raw':![],'where':{}};var _0x3444c6={};var _0x2ff257={'count':0x0,'rows':[]};return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0xb9f2ac['params']['id']}})['then'](handleEntityNotFound(_0x1801c6,null))[_0x1461('0x24')](function(_0x49a6df){if(_0x49a6df){_0x3444c6['model']=_[_0x1461('0x4b')](db[_0x1461('0x85')][_0x1461('0x6d')]);_0x3444c6['query']=_[_0x1461('0x4b')](_0xb9f2ac[_0x1461('0x4a')]);_0x3444c6[_0x1461('0x4c')]=_[_0x1461('0x4d')](_0x3444c6['model'],_0x3444c6[_0x1461('0x4a')]);_0x1b1809[_0x1461('0x4e')]=_[_0x1461('0x4d')](_0x3444c6[_0x1461('0x49')],qs[_0x1461('0x4f')](_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x4f')]));_0x1b1809[_0x1461('0x4e')]=_0x1b1809['attributes'][_0x1461('0x60')]?_0x1b1809[_0x1461('0x4e')]:_0x3444c6[_0x1461('0x49')];if(!_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x50')]('nolimit')){_0x1b1809[_0x1461('0x1b')]=qs[_0x1461('0x1b')](_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x1b')]);_0x1b1809['offset']=qs[_0x1461('0x18')](_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x18')]);}_0x1b1809[_0x1461('0x52')]=qs['sort'](_0xb9f2ac['query'][_0x1461('0x53')]);_0x1b1809['where']=qs[_0x1461('0x4c')](_[_0x1461('0x55')](_0xb9f2ac[_0x1461('0x4a')],_0x3444c6[_0x1461('0x4c')]));_0x1b1809[_0x1461('0x54')]['MailAccountId']=_0x49a6df['id'];if(_0xb9f2ac['query']['filter']){_0x1b1809[_0x1461('0x54')]=_['merge'](_0x1b1809['where'],{'$or':_[_0x1461('0x44')](_0x1b1809[_0x1461('0x4e')],function(_0x3a9ad3){var _0x508b05={};_0x508b05[_0x3a9ad3]={'$like':'%'+_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x56')]+'%'};return _0x508b05;})});}_0x1b1809=_[_0x1461('0x57')]({},_0x1b1809,_0xb9f2ac[_0x1461('0x58')]);return db[_0x1461('0x85')][_0x1461('0x1a')]({'where':_0x1b1809[_0x1461('0x54')]})[_0x1461('0x24')](function(_0xb290ca){_0x2ff257[_0x1461('0x1a')]=_0xb290ca;if(_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x59')]){_0x1b1809['include']=[{'model':db['CmContact'],'as':_0x1461('0x87'),'required':![]},{'model':db[_0x1461('0x88')],'as':'Owner','attributes':[_0x1461('0x26'),_0x1461('0x89'),_0x1461('0x8a')],'required':![]},{'model':db['Tag'],'as':_0x1461('0x8b'),'attributes':['id','name',_0x1461('0x8c')],'where':_0xb9f2ac['query'][_0x1461('0x8d')]?{'id':_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x8d')]}:undefined,'required':_0xb9f2ac[_0x1461('0x4a')][_0x1461('0x8d')]?!![]:![]}];}return db[_0x1461('0x85')][_0x1461('0x5b')](_0x1b1809);})[_0x1461('0x24')](function(_0x315729){_0x2ff257[_0x1461('0x5c')]=_0x315729;return _0x2ff257;});}})[_0x1461('0x24')](respondWithFilteredResult(_0x1801c6,_0x1b1809))[_0x1461('0x5d')](handleError(_0x1801c6,null));};exports[_0x1461('0x8e')]=function addApplications(_0x4e96f9,_0x4a0846){var _0x188be8=_0x4e96f9[_0x1461('0x65')]['id'];var _0x1c06e9=_0x4e96f9[_0x1461('0x62')];var _0x312079=0xc8;var _0x149ead=null;return db[_0x1461('0x8f')][_0x1461('0x90')]({'isolationLevel':db[_0x1461('0x8f')]['Transaction'][_0x1461('0x91')]['READ_COMMITTED']},function(_0x3e2a1d){return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0x188be8},'transaction':_0x3e2a1d})['then'](function(_0x424187){if(_0x424187){return db[_0x1461('0x92')]['destroy']({'where':{'MailAccountId':_0x188be8},'transaction':_0x3e2a1d})[_0x1461('0x24')](function(){var _0xd63032=_['map'](_0x1c06e9,function(_0x41b2f5){_0x41b2f5['MailAccountId']=_0x188be8;return _0x41b2f5;});return db[_0x1461('0x92')][_0x1461('0x93')](_0xd63032,{'transaction':_0x3e2a1d});});}else{_0x312079=0x194;_0x149ead=[];}});})[_0x1461('0x24')](function(){if(_0x312079!==0x194){return db[_0x1461('0x92')][_0x1461('0x94')]({'where':{'MailAccountId':_0x188be8},'order':_0x1461('0x95')})[_0x1461('0x24')](function(_0x61140e){_0x149ead=_0x61140e;});}})[_0x1461('0x5d')](function(_0x103455){_0x312079=0x1f4;logger['error'](_0x103455[_0x1461('0x25')]);if(_0x103455['name']){delete _0x103455[_0x1461('0x26')];}_0x149ead=_0x103455;})[_0x1461('0x96')](function(){if(_0x149ead===null){_0x4a0846['sendStatus'](_0x312079);}else{if(_0x312079===0x1f4){_0x4a0846['status'](_0x312079)[_0x1461('0x97')](_0x149ead);}else{_0x4a0846['status'](_0x312079)[_0x1461('0x1e')](_0x149ead);}}});};exports[_0x1461('0x98')]=function(_0x16279d,_0x41be42){var _0x2efd7d={};var _0x51fd1a={};var _0x2b32cf;var _0x2e0470;return db[_0x1461('0x45')][_0x1461('0x6c')]({'where':{'id':_0x16279d[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x41be42,null))[_0x1461('0x24')](function(_0x4e8c19){if(_0x4e8c19){_0x2b32cf=_0x4e8c19;_0x51fd1a[_0x1461('0x49')]=_[_0x1461('0x4b')](db[_0x1461('0x92')][_0x1461('0x6d')]);_0x51fd1a[_0x1461('0x4a')]=_['keys'](_0x16279d[_0x1461('0x4a')]);_0x51fd1a[_0x1461('0x4c')]=_['intersection'](_0x51fd1a[_0x1461('0x49')],_0x51fd1a[_0x1461('0x4a')]);_0x2efd7d['attributes']=_[_0x1461('0x4d')](_0x51fd1a[_0x1461('0x49')],qs[_0x1461('0x4f')](_0x16279d[_0x1461('0x4a')][_0x1461('0x4f')]));_0x2efd7d[_0x1461('0x4e')]=_0x2efd7d[_0x1461('0x4e')][_0x1461('0x60')]?_0x2efd7d['attributes']:_0x51fd1a['model'];_0x2efd7d[_0x1461('0x52')]=qs[_0x1461('0x53')](_0x16279d['query'][_0x1461('0x53')]);_0x2efd7d[_0x1461('0x54')]=qs[_0x1461('0x4c')](_[_0x1461('0x55')](_0x16279d[_0x1461('0x4a')],_0x51fd1a['filters']));if(_0x16279d[_0x1461('0x4a')][_0x1461('0x56')]){_0x2efd7d['where']=_[_0x1461('0x57')](_0x2efd7d['where'],{'$or':_[_0x1461('0x44')](_0x2efd7d[_0x1461('0x4e')],function(_0x3985a4){var _0x42a495={};_0x42a495[_0x3985a4]={'$like':'%'+_0x16279d[_0x1461('0x4a')]['filter']+'%'};return _0x42a495;})});}_0x2efd7d=_[_0x1461('0x57')]({},_0x2efd7d,_0x16279d[_0x1461('0x58')]);return _0x2b32cf[_0x1461('0x98')](_0x2efd7d);}})['then'](function(_0x4d2cb0){if(_0x4d2cb0){_0x2e0470=_0x4d2cb0[_0x1461('0x60')];if(!_0x16279d[_0x1461('0x4a')][_0x1461('0x50')](_0x1461('0x51'))){_0x2efd7d['limit']=qs[_0x1461('0x1b')](_0x16279d['query']['limit']);_0x2efd7d[_0x1461('0x18')]=qs['offset'](_0x16279d['query'][_0x1461('0x18')]);}return _0x2b32cf['getApplications'](_0x2efd7d);}})[_0x1461('0x24')](function(_0x1e4f2f){if(_0x1e4f2f){return _0x1e4f2f?{'count':_0x2e0470,'rows':_0x1e4f2f}:null;}})['then'](respondWithResult(_0x41be42,null))[_0x1461('0x5d')](handleError(_0x41be42,null));};exports['getMessages']=function(_0x406ec3,_0x27d05e){var _0x5f5850={'raw':!![],'where':{}};var _0x487df1={};var _0x52a9d3={'count':0x0,'rows':[]};return db['MailAccount'][_0x1461('0x6c')]({'where':{'id':_0x406ec3[_0x1461('0x65')]['id']}})['then'](handleEntityNotFound(_0x27d05e,null))[_0x1461('0x24')](function(_0x1bbbea){if(_0x1bbbea){_0x487df1[_0x1461('0x49')]=_['keys'](db[_0x1461('0x99')][_0x1461('0x6d')]);_0x487df1[_0x1461('0x4a')]=_[_0x1461('0x4b')](_0x406ec3['query']);_0x487df1[_0x1461('0x4c')]=_[_0x1461('0x4d')](_0x487df1[_0x1461('0x49')],_0x487df1[_0x1461('0x4a')]);_0x5f5850['attributes']=_['intersection'](_0x487df1[_0x1461('0x49')],qs[_0x1461('0x4f')](_0x406ec3[_0x1461('0x4a')][_0x1461('0x4f')]));_0x5f5850[_0x1461('0x4e')]=_0x5f5850[_0x1461('0x4e')][_0x1461('0x60')]?_0x5f5850['attributes']:_0x487df1[_0x1461('0x49')];if(!_0x406ec3[_0x1461('0x4a')][_0x1461('0x50')]('nolimit')){_0x5f5850[_0x1461('0x1b')]=qs['limit'](_0x406ec3[_0x1461('0x4a')][_0x1461('0x1b')]);_0x5f5850[_0x1461('0x18')]=qs[_0x1461('0x18')](_0x406ec3[_0x1461('0x4a')][_0x1461('0x18')]);}_0x5f5850[_0x1461('0x52')]=qs[_0x1461('0x53')](_0x406ec3['query'][_0x1461('0x53')]);_0x5f5850['where']=qs[_0x1461('0x4c')](_[_0x1461('0x55')](_0x406ec3[_0x1461('0x4a')],_0x487df1['filters']));_0x5f5850[_0x1461('0x54')]['MailAccountId']=_0x1bbbea['id'];if(_0x406ec3['query'][_0x1461('0x56')]){_0x5f5850[_0x1461('0x54')]=_[_0x1461('0x57')](_0x5f5850['where'],{'$or':_['map'](_0x5f5850[_0x1461('0x4e')],function(_0x2e0d15){var _0x54b310={};_0x54b310[_0x2e0d15]={'$like':'%'+_0x406ec3[_0x1461('0x4a')][_0x1461('0x56')]+'%'};return _0x54b310;})});}if(_0x406ec3[_0x1461('0x4a')][_0x1461('0x9a')]){var _0x458b90=_0x406ec3['query'][_0x1461('0x9a')][_0x1461('0x9b')](',');var _0x8425c5={};_0x8425c5[_0x458b90[0x0]]={'$gte':moment(_0x458b90[0x1])[_0x1461('0x9c')](_0x1461('0x9d'))};_0x5f5850[_0x1461('0x54')]=_[_0x1461('0x57')](_0x5f5850['where'],_0x8425c5);}_0x5f5850=_[_0x1461('0x57')]({},_0x5f5850,_0x406ec3[_0x1461('0x58')]);return db[_0x1461('0x99')][_0x1461('0x1a')]({'where':_0x5f5850[_0x1461('0x54')]})['then'](function(_0x15e7d5){_0x52a9d3[_0x1461('0x1a')]=_0x15e7d5;if(_0x406ec3[_0x1461('0x4a')][_0x1461('0x59')]){_0x5f5850[_0x1461('0x5a')]=[{'all':!![]}];}return db[_0x1461('0x99')][_0x1461('0x5b')](_0x5f5850);})['then'](function(_0x5e17a4){if(_0x406ec3[_0x1461('0x4a')][_0x1461('0x9e')]===_0x1461('0x9f')){for(var _0xe9302d=0x0;_0xe9302d<_0x5e17a4['length'];_0xe9302d++){_0x5e17a4[_0xe9302d][_0x1461('0x62')]=juice(_0x5e17a4[_0xe9302d]['body']);}}_0x52a9d3[_0x1461('0x5c')]=_0x5e17a4;return _0x52a9d3;});}})[_0x1461('0x24')](respondWithFilteredResult(_0x27d05e,_0x5f5850))[_0x1461('0x5d')](handleError(_0x27d05e,null));};exports['send']=function(_0x26f971,_0x282944){var _0x4ca8ed,_0x26b71e={},_0x2bae4;if(_0x26f971['body']['to']){_0x2bae4=_0x26f971[_0x1461('0x62')]['to'][_0x1461('0x9b')](',')[0x0];}return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x26f971[_0x1461('0x65')]['id']},'include':[{'model':db[_0x1461('0xa0')],'as':'List','include':[{'model':db[_0x1461('0xa1')],'as':_0x1461('0xa2'),'where':{'email':_0x2bae4},'limit':0x1,'order':[[_0x1461('0xa3'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1461('0xa4'),'raw':!![]}]}]})[_0x1461('0x24')](handleEntityNotFound(_0x282944,null))[_0x1461('0x24')](function(_0x23c6b9){if(!_0x23c6b9)return;_0x4ca8ed=_0x23c6b9;if(!_0x23c6b9[_0x1461('0x3f')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x1461('0x76')](_0x26f971[_0x1461('0x62')][_0x1461('0xa5')])){_0x26f971[_0x1461('0x62')]['from']=util['format'](_0x1461('0xa6'),_0x23c6b9[_0x1461('0x26')],_0x23c6b9[_0x1461('0xa7')]||_0x23c6b9[_0x1461('0x3f')][_0x1461('0x34')]);}if(_0x26f971[_0x1461('0x62')][_0x1461('0xa8')]&&_0x26f971[_0x1461('0x62')]['attachments']['length']){for(var _0x54b424=0x0;_0x54b424<_0x26f971[_0x1461('0x62')][_0x1461('0xa8')][_0x1461('0x60')];_0x54b424+=0x1){_0x26f971[_0x1461('0x62')]['attachments'][_0x54b424]={'filename':_0x26f971[_0x1461('0x62')]['attachments'][_0x54b424][_0x1461('0x26')],'path':path[_0x1461('0xa9')](config[_0x1461('0xaa')],_0x1461('0xab'),_0x26f971[_0x1461('0x62')][_0x1461('0xa8')][_0x54b424]['basename'])};}}var _0x1ef280=_0x23c6b9[_0x1461('0xac')]();return respondWithRpcPromise(_0x1461('0xad'),_0x1461('0xae'),{'account':_0x1ef280,'message':_0x26f971[_0x1461('0x62')]});})['then'](function(_0x44a5f0){if(!_0x44a5f0)return;_0x26b71e=_0x44a5f0;if(!_0x4ca8ed[_0x1461('0xaf')])throw new Error(_0x1461('0xb0'));if(_0x4ca8ed['List'][_0x1461('0xa2')][_0x1461('0x60')])return _0x4ca8ed['List'][_0x1461('0xa2')][0x0];return db[_0x1461('0xa1')][_0x1461('0x6a')](_[_0x1461('0x7')](_0x26f971[_0x1461('0x62')],{'firstName':_0x26f971[_0x1461('0x62')]['to'],'email':_0x26f971[_0x1461('0x62')]['to'],'phone':_0x26f971[_0x1461('0x62')]['to'],'ListId':_0x4ca8ed[_0x1461('0x75')]}));})[_0x1461('0x24')](function(_0x5c1b75){if(!_0x5c1b75)return;var _0x246e91={'UserId':_0x26f971[_0x1461('0x34')]['id'],'ContactId':_0x5c1b75['id'],'MailAccountId':_0x4ca8ed['id'],'inReplyTo':_0x26b71e['messageId'],'to':_0x26f971[_0x1461('0x62')][_0x1461('0xa5')],'cc':_0x26f971[_0x1461('0x62')]['cc'],'subject':_0x26f971[_0x1461('0x62')]['subject'],'attach':_0x26f971[_0x1461('0x62')][_0x1461('0xb1')],'firstMsgDirection':_0x1461('0xb2'),'lastMsgAt':moment()[_0x1461('0x9c')](_0x1461('0x9d')),'lastMsgDirection':'out','Messages':[_[_0x1461('0x57')](_0x26f971[_0x1461('0x62')],{'messageId':_0x26b71e[_0x1461('0xb3')],'sentAt':moment()[_0x1461('0x9c')](_0x1461('0x9d')),'read':!![],'MailAccountId':_0x4ca8ed['id'],'UserId':_0x26f971['user']['id'],'ContactId':_0x5c1b75['id']})]};if(_0x26f971['body'][_0x1461('0xb4')]){_0x246e91=_[_0x1461('0x57')](_0x246e91,_0x26f971[_0x1461('0x62')][_0x1461('0xb4')]);}return db[_0x1461('0x85')][_0x1461('0x6a')](_0x246e91,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x1461('0x24')](respondWithResult(_0x282944,null))['catch'](handleError(_0x282944,null));};exports[_0x1461('0xb5')]=function(_0x23e04d,_0xa4e012){return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x23e04d[_0x1461('0x65')]['id']},'include':[{'model':db[_0x1461('0x41')],'as':_0x1461('0x3f'),'raw':!![],'include':[{'model':db[_0x1461('0xa4')],'as':_0x1461('0xa4'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0xa4e012,null))[_0x1461('0x24')](function(_0x49f24e){if(!_0x49f24e[_0x1461('0x3f')])return;var _0x4c1b29=_0x49f24e[_0x1461('0xac')]();return respondWithRpcPromise('VerifySmtp',_0x1461('0xb5'),{'account':_0x4c1b29});})[_0x1461('0x24')](respondWithResult(_0xa4e012,null))[_0x1461('0x5d')](handleError(_0xa4e012,null));};exports[_0x1461('0x20')]=function(_0x28d30b,_0xfee687){return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x28d30b[_0x1461('0x65')]['id']}})['then'](handleEntityNotFound(_0xfee687,null))[_0x1461('0x24')](function(_0x445cdb){if(_0x445cdb&&_0x445cdb[_0x1461('0x3d')]){throw new db[(_0x1461('0xb6'))]['ValidationError'](_0x1461('0xb7'));}return _0x445cdb;})['then'](removeEntity(_0xfee687,null))['catch'](handleError(_0xfee687,null));};exports[_0x1461('0xb8')]=function(_0x16587b,_0x44bc50){return db['MailAccount'][_0x1461('0x61')]({'where':{'id':_0x16587b[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x44bc50,null))[_0x1461('0x24')](function(_0x576cc9){if(_0x576cc9){return _0x576cc9['addAgents'](_0x16587b['body'][_0x1461('0x70')],_[_0x1461('0xb9')](_0x16587b[_0x1461('0x62')],[_0x1461('0x70'),'id'])||{})[_0x1461('0xba')](function(_0xeb84fc){for(var _0x3ffd47=0x0;_0x3ffd47<_0x16587b['body'][_0x1461('0x70')][_0x1461('0x60')];_0x3ffd47+=0x1){socket['emit'](_0x1461('0xbb'),{'UserId':Number(_0x16587b[_0x1461('0x62')][_0x1461('0x70')][_0x3ffd47]),'MailAccountId':Number(_0x16587b['params']['id'])});}return _0xeb84fc;});}})[_0x1461('0x24')](respondWithResult(_0x44bc50,null))[_0x1461('0x5d')](handleError(_0x44bc50,null));};exports['removeAgents']=function(_0x27d3e9,_0x45459d){return db[_0x1461('0x45')][_0x1461('0x61')]({'where':{'id':_0x27d3e9[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0x45459d,null))[_0x1461('0x24')](function(_0x43c75e){if(_0x43c75e){return _0x43c75e[_0x1461('0xbc')](_0x27d3e9[_0x1461('0x4a')][_0x1461('0x70')])[_0x1461('0x24')](function(){if(_['isArray'](_0x27d3e9['query'][_0x1461('0x70')])){for(var _0x579112=0x0;_0x579112<_0x27d3e9[_0x1461('0x4a')][_0x1461('0x70')][_0x1461('0x60')];_0x579112+=0x1){socket['emit'](_0x1461('0xbd'),{'UserId':Number(_0x27d3e9[_0x1461('0x4a')][_0x1461('0x70')][_0x579112]),'MailAccountId':Number(_0x27d3e9[_0x1461('0x65')]['id'])});}}else{socket[_0x1461('0xbe')](_0x1461('0xbd'),{'UserId':Number(_0x27d3e9['query'][_0x1461('0x70')]),'MailAccountId':Number(_0x27d3e9[_0x1461('0x65')]['id'])});}});}})[_0x1461('0x24')](respondWithStatusCode(_0x45459d,null))['catch'](handleError(_0x45459d,null));};exports[_0x1461('0xbf')]=function(_0x121939,_0xc6e5ef){var _0x442ad5={};var _0x2806c6={};var _0x127700;var _0x3aa274;return db['MailAccount']['findOne']({'where':{'id':_0x121939[_0x1461('0x65')]['id']}})[_0x1461('0x24')](handleEntityNotFound(_0xc6e5ef,null))[_0x1461('0x24')](function(_0x99b5c3){if(_0x99b5c3){_0x127700=_0x99b5c3;_0x2806c6[_0x1461('0x49')]=_[_0x1461('0x4b')](db[_0x1461('0x88')][_0x1461('0x6d')]);_0x2806c6[_0x1461('0x4a')]=_[_0x1461('0x4b')](_0x121939[_0x1461('0x4a')]);_0x2806c6[_0x1461('0x4c')]=_[_0x1461('0x4d')](_0x2806c6[_0x1461('0x49')],_0x2806c6['query']);_0x442ad5[_0x1461('0x4e')]=_[_0x1461('0x4d')](_0x2806c6[_0x1461('0x49')],qs[_0x1461('0x4f')](_0x121939[_0x1461('0x4a')][_0x1461('0x4f')]));_0x442ad5[_0x1461('0x4e')]=_0x442ad5[_0x1461('0x4e')][_0x1461('0x60')]?_0x442ad5[_0x1461('0x4e')]:_0x2806c6[_0x1461('0x49')];_0x442ad5[_0x1461('0x52')]=qs['sort'](_0x121939[_0x1461('0x4a')][_0x1461('0x53')]);_0x442ad5['where']=qs[_0x1461('0x4c')](_[_0x1461('0x55')](_0x121939['query'],_0x2806c6['filters']));if(_0x121939[_0x1461('0x4a')][_0x1461('0x56')]){_0x442ad5[_0x1461('0x54')]=_[_0x1461('0x57')](_0x442ad5[_0x1461('0x54')],{'$or':_[_0x1461('0x44')](_0x442ad5['attributes'],function(_0x54dfce){var _0x57a224={};_0x57a224[_0x54dfce]={'$like':'%'+_0x121939[_0x1461('0x4a')][_0x1461('0x56')]+'%'};return _0x57a224;})});}_0x442ad5=_[_0x1461('0x57')]({},_0x442ad5,_0x121939[_0x1461('0x58')]);return _0x127700[_0x1461('0xbf')](_0x442ad5);}})[_0x1461('0x24')](function(_0x41f15a){if(_0x41f15a){_0x3aa274=_0x41f15a['length'];if(!_0x121939[_0x1461('0x4a')][_0x1461('0x50')](_0x1461('0x51'))){_0x442ad5[_0x1461('0x1b')]=qs[_0x1461('0x1b')](_0x121939[_0x1461('0x4a')][_0x1461('0x1b')]);_0x442ad5[_0x1461('0x18')]=qs[_0x1461('0x18')](_0x121939['query'][_0x1461('0x18')]);}return _0x127700['getAgents'](_0x442ad5);}})[_0x1461('0x24')](function(_0x44df1b){if(_0x44df1b){return _0x44df1b?{'count':_0x3aa274,'rows':_0x44df1b}:null;}})[_0x1461('0x24')](respondWithResult(_0xc6e5ef,null))[_0x1461('0x5d')](handleError(_0xc6e5ef,null));}; \ No newline at end of file +var _0x5037=['fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','MailServerIn','keys','include','find','update','body','provider','custom','params','Mail\x20Account\x20not\x20found','describe','MailAccountId','create','getDispositions','findOne','nolimit','Disposition','removeDispositions','CannedAnswer','getAnswers','rawAttributes','removeAnswers','ids','email','active','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','List','Contacts','DESC','Smtp\x20configuration\x20not\x20found','isNil','from','format','attachments','join','root','basename','getSmtpOptions','SendMail','ListId','attach','out','messageId','Interaction','Messages','verifySmtp','CloudProvider','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','get','MailAccounts','destroy','name','send','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x5037,0x1f2));var _0x7503=function(_0x52ceea,_0x162a4e){_0x52ceea=_0x52ceea-0x0;var _0x21b2e8=_0x5037[_0x52ceea];return _0x21b2e8;};'use strict';var moment=require(_0x7503('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x7503('0x1'));var _=require(_0x7503('0x2'));var juice=require(_0x7503('0x3'));var Redis=require(_0x7503('0x4'));var qs=require(_0x7503('0x5'));var logger=require(_0x7503('0x6'))(_0x7503('0x7'));var config=require(_0x7503('0x8'));var db=require(_0x7503('0x9'))['db'];config['redis']=_[_0x7503('0xa')](config[_0x7503('0xb')],{'host':_0x7503('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7503('0xb')]));require(_0x7503('0xd'))[_0x7503('0xe')](socket);var jayson=require(_0x7503('0xf'));var client=jayson[_0x7503('0x10')][_0x7503('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x2f73e3,_0x4399b4,_0x50bb41,_0x4d62fa){return new BPromise(function(_0x1ae227,_0x48f933){var _0x370597=_0x4d62fa||client;return _0x370597[_0x7503('0x12')](_0x2f73e3,_0x50bb41)[_0x7503('0x13')](function(_0x37f5b4){logger['info'](_0x7503('0x14'),_0x4399b4,_0x7503('0x15'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x4399b4,'request\x20sent',JSON[_0x7503('0x16')](_0x37f5b4));if(_0x37f5b4[_0x7503('0x17')]){if(_0x37f5b4['error']['code']===0x1f4){logger[_0x7503('0x17')](_0x7503('0x14'),_0x4399b4,_0x37f5b4['error'][_0x7503('0x18')]);return _0x48f933(_0x37f5b4[_0x7503('0x17')][_0x7503('0x18')]);}logger['error'](_0x7503('0x14'),_0x4399b4,_0x37f5b4['error'][_0x7503('0x18')]);return _0x1ae227(_0x37f5b4['error']['message']);}else{logger['info'](_0x7503('0x14'),_0x4399b4,'request\x20sent');_0x1ae227(_0x37f5b4['result'][_0x7503('0x18')]);}})[_0x7503('0x19')](function(_0x3ba591){logger[_0x7503('0x17')](_0x7503('0x14'),_0x4399b4,_0x3ba591);_0x48f933(_0x3ba591);});});}function respondWithStatusCode(_0x52a459,_0x5d4608){_0x5d4608=_0x5d4608||0xcc;return function(_0x12f0be){if(_0x12f0be){return _0x52a459[_0x7503('0x1a')](_0x5d4608);}return _0x52a459[_0x7503('0x1b')](_0x5d4608)[_0x7503('0x1c')]();};}function respondWithResult(_0x4a0773,_0x372152){_0x372152=_0x372152||0xc8;return function(_0x5bda25){if(_0x5bda25){return _0x4a0773[_0x7503('0x1b')](_0x372152)[_0x7503('0x1d')](_0x5bda25);}};}function respondWithFilteredResult(_0x4ff030,_0x136865){return function(_0x19b6e8){if(_0x19b6e8){var _0x42bbc9=typeof _0x136865[_0x7503('0x1e')]===_0x7503('0x1f')&&typeof _0x136865[_0x7503('0x20')]==='undefined';var _0xc0f591=_0x19b6e8[_0x7503('0x21')];var _0x3c3385=_0x42bbc9?0x0:_0x136865['offset'];var _0x233c06=_0x42bbc9?_0x19b6e8[_0x7503('0x21')]:_0x136865['offset']+_0x136865[_0x7503('0x20')];var _0x434fb4;if(_0x233c06>=_0xc0f591){_0x233c06=_0xc0f591;_0x434fb4=0xc8;}else{_0x434fb4=0xce;}_0x4ff030[_0x7503('0x1b')](_0x434fb4);return _0x4ff030[_0x7503('0x22')](_0x7503('0x23'),_0x3c3385+'-'+_0x233c06+'/'+_0xc0f591)[_0x7503('0x1d')](_0x19b6e8);}return null;};}function saveUpdates(_0x4a5793){return function(_0x934f71){if(_0x934f71){return _0x934f71['update'](_0x4a5793)[_0x7503('0x13')](function(_0x34e904){return _0x34e904;});}return null;};}function removeEntity(_0x310082){return function(_0x31f2b9){if(_0x31f2b9){return _0x31f2b9['destroy']()[_0x7503('0x13')](function(){var _0x4da939=_0x31f2b9[_0x7503('0x24')]({'plain':!![]});var _0x396dbf=_0x7503('0x25');return db['UserProfileResource'][_0x7503('0x26')]({'where':{'type':_0x396dbf,'resourceId':_0x4da939['id']}})[_0x7503('0x13')](function(){return _0x31f2b9;});})[_0x7503('0x13')](function(){_0x310082[_0x7503('0x1b')](0xcc)[_0x7503('0x1c')]();});}};}function handleEntityNotFound(_0x299eae){return function(_0x15c39d){if(!_0x15c39d){_0x299eae['sendStatus'](0x194);}return _0x15c39d;};}function handleError(_0x1c88d5,_0xdc4046){_0xdc4046=_0xdc4046||0x1f4;return function(_0x180f0c){logger[_0x7503('0x17')](_0x180f0c['stack']);if(_0x180f0c[_0x7503('0x27')]){delete _0x180f0c['name'];}_0x1c88d5['status'](_0xdc4046)[_0x7503('0x28')](_0x180f0c);};}function getImapHost(_0x4eb94c){switch(_0x4eb94c){case _0x7503('0x29'):return _0x7503('0x2a');case'yahoo':return'imap.mail.yahoo.com';case _0x7503('0x2b'):return _0x7503('0x2c');case'outlook365':return _0x7503('0x2d');}throw new Error('Unknown\x20email\x20service\x20provider',_0x4eb94c);}function getSmtpHost(_0x1d09a2){switch(_0x1d09a2){case _0x7503('0x29'):return _0x7503('0x2e');case'yahoo':return _0x7503('0x2f');case _0x7503('0x2b'):return _0x7503('0x30');case'outlook365':return'smtp.office365.com';}throw new Error(_0x7503('0x31'),_0x1d09a2);}function getAuthenticationOptions(_0x38cc12,_0x158635){var _0x2d1c7a={};var _0x5d13e7={};if(_0x38cc12){_0x2d1c7a[_0x7503('0x32')]=_0x5d13e7['user']=_0x158635[_0x7503('0x33')];_0x2d1c7a[_0x7503('0x34')]=_0x5d13e7[_0x7503('0x35')]=_0x158635['password'];if(_0x158635[_0x7503('0x36')]){_0x2d1c7a['modernAuthentication']=_0x5d13e7[_0x7503('0x36')]=!![];_0x2d1c7a[_0x7503('0x37')]=_0x5d13e7['CloudProviderId']=_0x158635[_0x7503('0x37')];_0x2d1c7a[_0x7503('0x34')]=_0x5d13e7[_0x7503('0x35')]=null;}else{_0x2d1c7a[_0x7503('0x37')]=_0x5d13e7[_0x7503('0x37')]=null;}_0x2d1c7a['host']=getImapHost(_0x38cc12);_0x2d1c7a[_0x7503('0x38')]=0x3e1;_0x5d13e7[_0x7503('0x39')]=getSmtpHost(_0x38cc12);_0x5d13e7['port']=0x24b;_0x5d13e7[_0x7503('0x3a')]=![];_0x2d1c7a['service']=_0x5d13e7[_0x7503('0x3b')]=null;}else{if(_0x158635['authentication']){_0x2d1c7a[_0x7503('0x32')]=_0x5d13e7['user']=_0x158635['username'];_0x2d1c7a[_0x7503('0x34')]=_0x5d13e7[_0x7503('0x35')]=_0x158635[_0x7503('0x34')];}else{_0x2d1c7a[_0x7503('0x3c')]=_0x5d13e7[_0x7503('0x3c')]=![];_0x2d1c7a['user']=_0x5d13e7['user']=null;_0x2d1c7a[_0x7503('0x34')]=_0x5d13e7[_0x7503('0x35')]=null;}_0x2d1c7a['host']=_0x158635[_0x7503('0x3d')][_0x7503('0x39')];_0x2d1c7a[_0x7503('0x38')]=_0x158635[_0x7503('0x3d')][_0x7503('0x38')];_0x5d13e7[_0x7503('0x39')]=_0x158635[_0x7503('0x3e')]['host'];_0x5d13e7[_0x7503('0x38')]=_0x158635[_0x7503('0x3e')][_0x7503('0x38')];}return{'Imap':_0x2d1c7a,'Smtp':_0x5d13e7};}exports[_0x7503('0x3f')]=function(_0x20ef0e,_0x234234){var _0x5e3b5d={'include':[{'model':db['MailServerIn'],'as':_0x7503('0x3d')},{'model':db[_0x7503('0x40')],'as':'Smtp'},{'model':db[_0x7503('0x41')],'as':_0x7503('0x42')}]},_0x340365={},_0x537385={'count':0x0,'rows':[]};var _0x5b98af=_[_0x7503('0x43')](db[_0x7503('0x44')]['rawAttributes'],function(_0x32665e){return{'name':_0x32665e[_0x7503('0x45')],'type':_0x32665e['type'][_0x7503('0x46')]};});_0x340365[_0x7503('0x47')]=_[_0x7503('0x43')](_0x5b98af,_0x7503('0x27'));_0x340365[_0x7503('0x48')]=_['keys'](_0x20ef0e['query']);_0x340365[_0x7503('0x49')]=_['intersection'](_0x340365[_0x7503('0x47')],_0x340365['query']);_0x5e3b5d['attributes']=_[_0x7503('0x4a')](_0x340365[_0x7503('0x47')],qs[_0x7503('0x4b')](_0x20ef0e[_0x7503('0x48')][_0x7503('0x4b')]));_0x5e3b5d['attributes']=_0x5e3b5d['attributes'][_0x7503('0x4c')]?_0x5e3b5d[_0x7503('0x4d')]:_0x340365['model'];if(!_0x20ef0e[_0x7503('0x48')][_0x7503('0x4e')]('nolimit')){_0x5e3b5d[_0x7503('0x20')]=qs['limit'](_0x20ef0e[_0x7503('0x48')][_0x7503('0x20')]);_0x5e3b5d['offset']=qs[_0x7503('0x1e')](_0x20ef0e[_0x7503('0x48')][_0x7503('0x1e')]);}_0x5e3b5d[_0x7503('0x4f')]=qs['sort'](_0x20ef0e[_0x7503('0x48')][_0x7503('0x50')]);_0x5e3b5d['where']=qs[_0x7503('0x49')](_[_0x7503('0x51')](_0x20ef0e[_0x7503('0x48')],_0x340365[_0x7503('0x49')]),_0x5b98af);if(_0x20ef0e[_0x7503('0x48')][_0x7503('0x52')]){_0x5e3b5d[_0x7503('0x53')]=_[_0x7503('0x54')](_0x5e3b5d[_0x7503('0x53')],{'$or':_['map'](_0x5b98af,function(_0x81f22e){if(_0x81f22e[_0x7503('0x55')]!==_0x7503('0x56')){var _0x410c0b={};_0x410c0b[_0x81f22e[_0x7503('0x27')]]={'$like':'%'+_0x20ef0e['query'][_0x7503('0x52')]+'%'};return _0x410c0b;}})});}_0x5e3b5d=_['merge']({},_0x5e3b5d,_0x20ef0e[_0x7503('0x57')]);var _0x100a49={'where':_0x5e3b5d['where']};return db[_0x7503('0x44')]['count'](_0x100a49)['then'](function(_0x3f4025){_0x537385[_0x7503('0x21')]=_0x3f4025;if(_0x20ef0e[_0x7503('0x48')][_0x7503('0x58')]){_0x5e3b5d['include']=[{'all':!![]}];}return db[_0x7503('0x44')][_0x7503('0x59')](_0x5e3b5d);})['then'](function(_0x34a776){_0x537385[_0x7503('0x5a')]=_0x34a776;return _0x537385;})[_0x7503('0x13')](respondWithFilteredResult(_0x234234,_0x5e3b5d))[_0x7503('0x19')](handleError(_0x234234,null));};exports[_0x7503('0x5b')]=function(_0x5aba02,_0x2558c3){var _0x5cde0c={'raw':![],'where':{'id':_0x5aba02['params']['id']},'include':[{'model':db[_0x7503('0x5c')],'as':_0x7503('0x3d')},{'model':db['MailServerOut'],'as':_0x7503('0x3e')},{'model':db['Pause'],'as':_0x7503('0x42')}]},_0xfb54e0={};_0xfb54e0[_0x7503('0x47')]=_[_0x7503('0x5d')](db['MailAccount']['rawAttributes']);_0xfb54e0[_0x7503('0x48')]=_[_0x7503('0x5d')](_0x5aba02['query']);_0xfb54e0[_0x7503('0x49')]=_['intersection'](_0xfb54e0['model'],_0xfb54e0[_0x7503('0x48')]);_0x5cde0c['attributes']=_[_0x7503('0x4a')](_0xfb54e0[_0x7503('0x47')],qs[_0x7503('0x4b')](_0x5aba02[_0x7503('0x48')]['fields']));_0x5cde0c[_0x7503('0x4d')]=_0x5cde0c[_0x7503('0x4d')][_0x7503('0x4c')]?_0x5cde0c[_0x7503('0x4d')]:_0xfb54e0[_0x7503('0x47')];if(_0x5aba02[_0x7503('0x48')][_0x7503('0x58')]){_0x5cde0c[_0x7503('0x5e')]=[{'all':!![]}];}_0x5cde0c=_[_0x7503('0x54')]({},_0x5cde0c,_0x5aba02[_0x7503('0x57')]);return db['MailAccount'][_0x7503('0x5f')](_0x5cde0c)[_0x7503('0x13')](handleEntityNotFound(_0x2558c3,null))[_0x7503('0x13')](respondWithResult(_0x2558c3,null))['catch'](handleError(_0x2558c3,null));};exports[_0x7503('0x60')]=function(_0x357cb7,_0x3461fa){if(_0x357cb7[_0x7503('0x61')]['id']){delete _0x357cb7[_0x7503('0x61')]['id'];}var _0x22682d=_0x357cb7['body'][_0x7503('0x62')]===_0x7503('0x63')?null:_0x357cb7[_0x7503('0x61')][_0x7503('0x62')];var _0x29a243=_0x357cb7[_0x7503('0x61')][_0x7503('0x3d')]||{};var _0x35f60c=_0x357cb7[_0x7503('0x61')][_0x7503('0x3e')]||{};if(_0x22682d){_0x29a243[_0x7503('0x39')]=getImapHost(_0x22682d);_0x29a243['port']=0x3e1;_0x35f60c[_0x7503('0x39')]=getSmtpHost(_0x22682d);_0x35f60c[_0x7503('0x38')]=0x24b;_0x35f60c[_0x7503('0x3a')]=![];}if(_0x35f60c[_0x7503('0x36')]){_0x35f60c[_0x7503('0x3a')]=![];}else{_0x35f60c[_0x7503('0x37')]=null;}if(!_0x29a243[_0x7503('0x36')])_0x29a243[_0x7503('0x37')]=null;_0x357cb7[_0x7503('0x61')][_0x7503('0x3d')]=_0x29a243;_0x357cb7[_0x7503('0x61')]['Smtp']=_0x35f60c;return db['MailAccount'][_0x7503('0x5f')]({'where':{'id':_0x357cb7[_0x7503('0x64')]['id']},'include':[{'model':db[_0x7503('0x5c')],'as':_0x7503('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x7503('0x41')],'as':_0x7503('0x42')}]})[_0x7503('0x13')](handleEntityNotFound(_0x3461fa,null))[_0x7503('0x13')](function(_0x1ddb71){if(!_0x1ddb71)throw new Error(_0x7503('0x65'));if(_0x1ddb71[_0x7503('0x3b')])delete _0x357cb7['body'][_0x7503('0x3d')];return _0x1ddb71;})['then'](saveUpdates(_0x357cb7['body'],null))[_0x7503('0x13')](function(_0x56ef17){if(!_0x357cb7[_0x7503('0x61')]['Imap'])return _0x56ef17;return db[_0x7503('0x5c')][_0x7503('0x60')](_0x357cb7[_0x7503('0x61')][_0x7503('0x3d')],{'where':{'MailAccountId':_0x56ef17['id']}})[_0x7503('0x13')](function(){return _0x56ef17;});})[_0x7503('0x13')](function(_0x3d35a2){if(!_0x357cb7[_0x7503('0x61')][_0x7503('0x3e')])return _0x3d35a2;return db[_0x7503('0x40')]['update'](_0x357cb7[_0x7503('0x61')][_0x7503('0x3e')],{'where':{'MailAccountId':_0x3d35a2['id']}})['then'](function(){return _0x3d35a2;});})[_0x7503('0x13')](respondWithResult(_0x3461fa,null))[_0x7503('0x19')](handleError(_0x3461fa,null));};exports[_0x7503('0x66')]=function(_0x4a9598,_0x17d087){return db[_0x7503('0x44')][_0x7503('0x66')]()[_0x7503('0x13')](respondWithResult(_0x17d087,null))[_0x7503('0x19')](handleError(_0x17d087,null));};exports['addDisposition']=function(_0x3065b8,_0x20a062){if(_0x3065b8['body']['id']){delete _0x3065b8[_0x7503('0x61')]['id'];}return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x3065b8['params']['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x20a062,null))[_0x7503('0x13')](function(_0x452a31){if(_0x452a31){_0x3065b8[_0x7503('0x61')][_0x7503('0x67')]=_0x452a31['id'];return db['Disposition'][_0x7503('0x68')](_0x3065b8[_0x7503('0x61')]);}})[_0x7503('0x13')](respondWithResult(_0x20a062,null))['catch'](handleError(_0x20a062,null));};exports[_0x7503('0x69')]=function(_0x2eb531,_0x290d4c){var _0xf7f38f={'raw':![],'where':{}};var _0x37006a={};var _0x321cec={'count':0x0,'rows':[]};return db[_0x7503('0x44')][_0x7503('0x6a')]({'where':{'id':_0x2eb531[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x290d4c,null))['then'](function(_0x58d59d){if(_0x58d59d){_0x37006a[_0x7503('0x47')]=_[_0x7503('0x5d')](db['Disposition']['rawAttributes']);_0x37006a[_0x7503('0x48')]=_['keys'](_0x2eb531[_0x7503('0x48')]);_0x37006a['filters']=_[_0x7503('0x4a')](_0x37006a['model'],_0x37006a[_0x7503('0x48')]);_0xf7f38f['attributes']=_[_0x7503('0x4a')](_0x37006a[_0x7503('0x47')],qs[_0x7503('0x4b')](_0x2eb531[_0x7503('0x48')][_0x7503('0x4b')]));_0xf7f38f[_0x7503('0x4d')]=_0xf7f38f[_0x7503('0x4d')][_0x7503('0x4c')]?_0xf7f38f[_0x7503('0x4d')]:_0x37006a[_0x7503('0x47')];if(!_0x2eb531['query'][_0x7503('0x4e')](_0x7503('0x6b'))){_0xf7f38f[_0x7503('0x20')]=qs['limit'](_0x2eb531['query']['limit']);_0xf7f38f[_0x7503('0x1e')]=qs['offset'](_0x2eb531[_0x7503('0x48')]['offset']);}_0xf7f38f['order']=qs[_0x7503('0x50')](_0x2eb531['query']['sort']);_0xf7f38f[_0x7503('0x53')]=qs['filters'](_[_0x7503('0x51')](_0x2eb531[_0x7503('0x48')],_0x37006a[_0x7503('0x49')]));_0xf7f38f[_0x7503('0x53')][_0x7503('0x67')]=_0x58d59d['id'];if(_0x2eb531[_0x7503('0x48')][_0x7503('0x52')]){_0xf7f38f['where']=_[_0x7503('0x54')](_0xf7f38f[_0x7503('0x53')],{'$or':_['map'](_0xf7f38f[_0x7503('0x4d')],function(_0x1a26f2){var _0xc73812={};_0xc73812[_0x1a26f2]={'$like':'%'+_0x2eb531[_0x7503('0x48')][_0x7503('0x52')]+'%'};return _0xc73812;})});}_0xf7f38f=_[_0x7503('0x54')]({},_0xf7f38f,_0x2eb531['options']);return db[_0x7503('0x6c')][_0x7503('0x21')]({'where':_0xf7f38f[_0x7503('0x53')]})[_0x7503('0x13')](function(_0x217a52){_0x321cec['count']=_0x217a52;if(_0x2eb531[_0x7503('0x48')][_0x7503('0x58')]){_0xf7f38f['include']=[{'all':!![]}];}return db[_0x7503('0x6c')]['findAll'](_0xf7f38f);})['then'](function(_0x2fda85){_0x321cec[_0x7503('0x5a')]=_0x2fda85;return _0x321cec;});}})['then'](respondWithFilteredResult(_0x290d4c,_0xf7f38f))['catch'](handleError(_0x290d4c,null));};exports[_0x7503('0x6d')]=function(_0x327061,_0x2573e9){return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x327061[_0x7503('0x64')]['id']}})['then'](handleEntityNotFound(_0x2573e9,null))['then'](function(_0xb6de4c){if(_0xb6de4c){return _0xb6de4c[_0x7503('0x6d')](_0x327061[_0x7503('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x2573e9,null))['catch'](handleError(_0x2573e9,null));};exports['addAnswer']=function(_0x36f5ac,_0xe33e6b){if(_0x36f5ac[_0x7503('0x61')]['id']){delete _0x36f5ac[_0x7503('0x61')]['id'];}return db[_0x7503('0x44')]['find']({'where':{'id':_0x36f5ac[_0x7503('0x64')]['id']}})['then'](handleEntityNotFound(_0xe33e6b,null))[_0x7503('0x13')](function(_0xa9accb){if(_0xa9accb){_0x36f5ac[_0x7503('0x61')][_0x7503('0x67')]=_0xa9accb['id'];return db[_0x7503('0x6e')]['create'](_0x36f5ac[_0x7503('0x61')]);}})['then'](respondWithResult(_0xe33e6b,null))[_0x7503('0x19')](handleError(_0xe33e6b,null));};exports[_0x7503('0x6f')]=function(_0x406c0a,_0x29c825){var _0x1d65ea={'raw':![],'where':{}};var _0x1ad3ab={};var _0x1c3155={'count':0x0,'rows':[]};return db[_0x7503('0x44')]['findOne']({'where':{'id':_0x406c0a['params']['id']}})['then'](handleEntityNotFound(_0x29c825,null))[_0x7503('0x13')](function(_0x33c633){if(_0x33c633){_0x1ad3ab[_0x7503('0x47')]=_[_0x7503('0x5d')](db[_0x7503('0x6e')][_0x7503('0x70')]);_0x1ad3ab['query']=_[_0x7503('0x5d')](_0x406c0a[_0x7503('0x48')]);_0x1ad3ab['filters']=_[_0x7503('0x4a')](_0x1ad3ab[_0x7503('0x47')],_0x1ad3ab[_0x7503('0x48')]);_0x1d65ea[_0x7503('0x4d')]=_['intersection'](_0x1ad3ab[_0x7503('0x47')],qs[_0x7503('0x4b')](_0x406c0a[_0x7503('0x48')][_0x7503('0x4b')]));_0x1d65ea['attributes']=_0x1d65ea[_0x7503('0x4d')][_0x7503('0x4c')]?_0x1d65ea[_0x7503('0x4d')]:_0x1ad3ab[_0x7503('0x47')];if(!_0x406c0a[_0x7503('0x48')][_0x7503('0x4e')](_0x7503('0x6b'))){_0x1d65ea[_0x7503('0x20')]=qs[_0x7503('0x20')](_0x406c0a[_0x7503('0x48')][_0x7503('0x20')]);_0x1d65ea['offset']=qs['offset'](_0x406c0a[_0x7503('0x48')][_0x7503('0x1e')]);}_0x1d65ea['order']=qs[_0x7503('0x50')](_0x406c0a[_0x7503('0x48')][_0x7503('0x50')]);_0x1d65ea['where']=qs[_0x7503('0x49')](_['pick'](_0x406c0a['query'],_0x1ad3ab[_0x7503('0x49')]));_0x1d65ea['where']['MailAccountId']=_0x33c633['id'];if(_0x406c0a[_0x7503('0x48')]['filter']){_0x1d65ea[_0x7503('0x53')]=_[_0x7503('0x54')](_0x1d65ea['where'],{'$or':_[_0x7503('0x43')](_0x1d65ea[_0x7503('0x4d')],function(_0x1026a2){var _0x529868={};_0x529868[_0x1026a2]={'$like':'%'+_0x406c0a['query'][_0x7503('0x52')]+'%'};return _0x529868;})});}_0x1d65ea=_[_0x7503('0x54')]({},_0x1d65ea,_0x406c0a[_0x7503('0x57')]);return db[_0x7503('0x6e')]['count']({'where':_0x1d65ea[_0x7503('0x53')]})[_0x7503('0x13')](function(_0x3f7df6){_0x1c3155[_0x7503('0x21')]=_0x3f7df6;if(_0x406c0a[_0x7503('0x48')][_0x7503('0x58')]){_0x1d65ea[_0x7503('0x5e')]=[{'all':!![]}];}return db[_0x7503('0x6e')][_0x7503('0x59')](_0x1d65ea);})['then'](function(_0x2f5dca){_0x1c3155[_0x7503('0x5a')]=_0x2f5dca;return _0x1c3155;});}})[_0x7503('0x13')](respondWithFilteredResult(_0x29c825,_0x1d65ea))[_0x7503('0x19')](handleError(_0x29c825,null));};exports[_0x7503('0x71')]=function(_0x1fed38,_0x16dd93){return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x1fed38[_0x7503('0x64')]['id']}})['then'](handleEntityNotFound(_0x16dd93,null))[_0x7503('0x13')](function(_0x5875d7){if(_0x5875d7){return _0x5875d7[_0x7503('0x71')](_0x1fed38['query'][_0x7503('0x72')]);}})[_0x7503('0x13')](respondWithStatusCode(_0x16dd93,null))['catch'](handleError(_0x16dd93,null));};exports[_0x7503('0x68')]=function(_0x245812,_0x3a9e8a){var _0x2f768a={'name':_0x245812['body'][_0x7503('0x27')],'key':_0x245812[_0x7503('0x61')][_0x7503('0x46')],'provider':_0x245812[_0x7503('0x61')]['provider']===_0x7503('0x63')?null:_0x245812[_0x7503('0x61')][_0x7503('0x62')],'email':_0x245812[_0x7503('0x61')][_0x7503('0x73')],'ListId':_0x245812[_0x7503('0x61')]['ListId'],'active':!_['isNil'](_0x245812[_0x7503('0x61')]['active'])?_0x245812['body'][_0x7503('0x74')]:!![],'description':_0x245812[_0x7503('0x61')]['description']||null};var _0x4555c7=getAuthenticationOptions(_0x2f768a['provider'],_0x245812[_0x7503('0x61')]);_0x2f768a[_0x7503('0x3d')]=_0x4555c7['Imap'];_0x2f768a[_0x7503('0x3e')]=_0x4555c7[_0x7503('0x3e')];return db[_0x7503('0x44')]['create'](_0x2f768a,{'include':[{'model':db[_0x7503('0x40')],'as':_0x7503('0x3e')},{'model':db['MailServerIn'],'as':_0x7503('0x3d')}]})[_0x7503('0x13')](function(_0x14eec7){var _0x3b4a66=_0x245812[_0x7503('0x32')][_0x7503('0x24')]({'plain':!![]});if(!_0x3b4a66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b4a66[_0x7503('0x75')]===_0x7503('0x32')){var _0x2352d0=_0x14eec7[_0x7503('0x24')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x3b4a66[_0x7503('0x76')]},'raw':!![]})['then'](function(_0x2d014e){if(_0x2d014e&&_0x2d014e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2352d0[_0x7503('0x27')],'resourceId':_0x2352d0['id'],'type':_0x2d014e[_0x7503('0x27')],'sectionId':_0x2d014e['id']},{})[_0x7503('0x13')](function(){return _0x14eec7;});}else{return _0x14eec7;}})[_0x7503('0x19')](function(_0x32d0c3){logger[_0x7503('0x17')](_0x7503('0x77'),_0x32d0c3);throw _0x32d0c3;});}return _0x14eec7;})[_0x7503('0x13')](respondWithResult(_0x3a9e8a,0xc9))[_0x7503('0x19')](handleError(_0x3a9e8a,null));};exports[_0x7503('0x78')]=function(_0x258ba2,_0x523b3a){return db[_0x7503('0x44')]['findOne']({'where':{'id':_0x258ba2[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x523b3a,null))[_0x7503('0x13')](function(_0x941f1){if(_0x941f1){return _0x941f1['getImap']();}return null;})[_0x7503('0x13')](respondWithResult(_0x523b3a,null))[_0x7503('0x19')](handleError(_0x523b3a,null));};exports[_0x7503('0x79')]=function(_0x2f7acc,_0xdbd026){if(_0x2f7acc[_0x7503('0x61')]['id']){delete _0x2f7acc[_0x7503('0x61')]['id'];}return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x2f7acc[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0xdbd026,null))[_0x7503('0x13')](function(_0x265fc1){if(_0x265fc1){_0x2f7acc[_0x7503('0x61')][_0x7503('0x67')]=_0x265fc1['id'];return db[_0x7503('0x5c')][_0x7503('0x68')](_0x2f7acc['body']);}})['then'](respondWithResult(_0xdbd026,null))[_0x7503('0x19')](handleError(_0xdbd026,null));};exports[_0x7503('0x7a')]=function(_0x9067db,_0x5d3fe4){return db[_0x7503('0x44')][_0x7503('0x6a')]({'where':{'id':_0x9067db[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x5d3fe4,null))[_0x7503('0x13')](function(_0x55edc1){if(_0x55edc1){return _0x55edc1['setImap'](null);}return null;})[_0x7503('0x13')](respondWithStatusCode(_0x5d3fe4,null))[_0x7503('0x19')](handleError(_0x5d3fe4,null));};exports[_0x7503('0x7b')]=function(_0x586fe5,_0x21a05b){return db[_0x7503('0x44')][_0x7503('0x6a')]({'where':{'id':_0x586fe5[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x21a05b,null))['then'](function(_0x387e92){if(_0x387e92){return _0x387e92['getSmtp']();}return null;})['then'](respondWithResult(_0x21a05b,null))[_0x7503('0x19')](handleError(_0x21a05b,null));};exports[_0x7503('0x7c')]=function(_0x5a2165,_0x12747a){if(_0x5a2165[_0x7503('0x61')]['id']){delete _0x5a2165['body']['id'];}return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x5a2165[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x12747a,null))['then'](function(_0xd5efab){if(_0xd5efab){_0x5a2165['body'][_0x7503('0x67')]=_0xd5efab['id'];return db['MailServerOut'][_0x7503('0x68')](_0x5a2165['body']);}})[_0x7503('0x13')](respondWithResult(_0x12747a,null))['catch'](handleError(_0x12747a,null));};exports[_0x7503('0x7d')]=function(_0x3ec085,_0x139fca){return db[_0x7503('0x44')][_0x7503('0x6a')]({'where':{'id':_0x3ec085[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x139fca,null))['then'](function(_0x4e4efb){if(_0x4e4efb){return _0x4e4efb[_0x7503('0x7e')](null);}return null;})[_0x7503('0x13')](respondWithStatusCode(_0x139fca,null))['catch'](handleError(_0x139fca,null));};exports[_0x7503('0x7f')]=function(_0x41d623,_0x507073){return db[_0x7503('0x80')][_0x7503('0x5f')]({'where':{'id':_0x41d623[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x507073,null))[_0x7503('0x13')](function(_0x50ec2e){if(_0x50ec2e){return _0x50ec2e[_0x7503('0x7f')](_0x41d623[_0x7503('0x61')][_0x7503('0x72')],_['omit'](_0x41d623['body'],[_0x7503('0x72'),'id'])||{});}})[_0x7503('0x13')](respondWithResult(_0x507073,null))[_0x7503('0x19')](handleError(_0x507073,null));};exports['getInteractions']=function(_0x3bff2a,_0x4a44d8){var _0x2b9c11={'raw':![],'where':{}};var _0x244ef9={};var _0x1c0ed9={'count':0x0,'rows':[]};return db['MailAccount'][_0x7503('0x6a')]({'where':{'id':_0x3bff2a[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x4a44d8,null))[_0x7503('0x13')](function(_0x5d9a01){if(_0x5d9a01){_0x244ef9[_0x7503('0x47')]=_['keys'](db[_0x7503('0x80')][_0x7503('0x70')]);_0x244ef9[_0x7503('0x48')]=_[_0x7503('0x5d')](_0x3bff2a[_0x7503('0x48')]);_0x244ef9[_0x7503('0x49')]=_[_0x7503('0x4a')](_0x244ef9['model'],_0x244ef9[_0x7503('0x48')]);_0x2b9c11[_0x7503('0x4d')]=_[_0x7503('0x4a')](_0x244ef9['model'],qs[_0x7503('0x4b')](_0x3bff2a[_0x7503('0x48')][_0x7503('0x4b')]));_0x2b9c11[_0x7503('0x4d')]=_0x2b9c11[_0x7503('0x4d')][_0x7503('0x4c')]?_0x2b9c11['attributes']:_0x244ef9[_0x7503('0x47')];if(!_0x3bff2a[_0x7503('0x48')][_0x7503('0x4e')]('nolimit')){_0x2b9c11['limit']=qs[_0x7503('0x20')](_0x3bff2a[_0x7503('0x48')]['limit']);_0x2b9c11[_0x7503('0x1e')]=qs[_0x7503('0x1e')](_0x3bff2a[_0x7503('0x48')][_0x7503('0x1e')]);}_0x2b9c11[_0x7503('0x4f')]=qs[_0x7503('0x50')](_0x3bff2a[_0x7503('0x48')]['sort']);_0x2b9c11[_0x7503('0x53')]=qs['filters'](_[_0x7503('0x51')](_0x3bff2a['query'],_0x244ef9[_0x7503('0x49')]));_0x2b9c11[_0x7503('0x53')][_0x7503('0x67')]=_0x5d9a01['id'];if(_0x3bff2a[_0x7503('0x48')]['filter']){_0x2b9c11[_0x7503('0x53')]=_[_0x7503('0x54')](_0x2b9c11[_0x7503('0x53')],{'$or':_[_0x7503('0x43')](_0x2b9c11[_0x7503('0x4d')],function(_0x5b035f){var _0xafa446={};_0xafa446[_0x5b035f]={'$like':'%'+_0x3bff2a[_0x7503('0x48')]['filter']+'%'};return _0xafa446;})});}_0x2b9c11=_[_0x7503('0x54')]({},_0x2b9c11,_0x3bff2a['options']);return db[_0x7503('0x80')][_0x7503('0x21')]({'where':_0x2b9c11[_0x7503('0x53')]})[_0x7503('0x13')](function(_0x289e96){_0x1c0ed9['count']=_0x289e96;if(_0x3bff2a[_0x7503('0x48')][_0x7503('0x58')]){_0x2b9c11[_0x7503('0x5e')]=[{'model':db[_0x7503('0x81')],'as':_0x7503('0x82'),'required':![]},{'model':db[_0x7503('0x83')],'as':_0x7503('0x84'),'attributes':[_0x7503('0x27'),'fullname',_0x7503('0x85')],'required':![]},{'model':db[_0x7503('0x86')],'as':'Tags','attributes':['id',_0x7503('0x27'),_0x7503('0x87')],'where':_0x3bff2a[_0x7503('0x48')][_0x7503('0x88')]?{'id':_0x3bff2a[_0x7503('0x48')][_0x7503('0x88')]}:undefined,'required':_0x3bff2a[_0x7503('0x48')]['tag']?!![]:![]}];}return db[_0x7503('0x80')]['findAll'](_0x2b9c11);})[_0x7503('0x13')](function(_0xff71e){_0x1c0ed9[_0x7503('0x5a')]=_0xff71e;return _0x1c0ed9;});}})['then'](respondWithFilteredResult(_0x4a44d8,_0x2b9c11))['catch'](handleError(_0x4a44d8,null));};exports[_0x7503('0x89')]=function addApplications(_0x402819,_0x5ca31b){var _0x30c8d0=_0x402819[_0x7503('0x64')]['id'];var _0x38b9eb=_0x402819[_0x7503('0x61')];var _0x5be4a3=0xc8;var _0x5bb17e=null;return db[_0x7503('0x8a')][_0x7503('0x8b')]({'isolationLevel':db[_0x7503('0x8a')][_0x7503('0x8c')][_0x7503('0x8d')][_0x7503('0x8e')]},function(_0x402497){return db[_0x7503('0x44')]['findOne']({'where':{'id':_0x30c8d0},'transaction':_0x402497})[_0x7503('0x13')](function(_0xcc6685){if(_0xcc6685){return db[_0x7503('0x8f')][_0x7503('0x26')]({'where':{'MailAccountId':_0x30c8d0},'transaction':_0x402497})['then'](function(){var _0x897e9c=_[_0x7503('0x43')](_0x38b9eb,function(_0x3a55a9){_0x3a55a9[_0x7503('0x67')]=_0x30c8d0;return _0x3a55a9;});return db[_0x7503('0x8f')][_0x7503('0x90')](_0x897e9c,{'transaction':_0x402497});});}else{_0x5be4a3=0x194;_0x5bb17e=[];}});})[_0x7503('0x13')](function(){if(_0x5be4a3!==0x194){return db[_0x7503('0x8f')][_0x7503('0x91')]({'where':{'MailAccountId':_0x30c8d0},'order':_0x7503('0x92')})['then'](function(_0x3e7d25){_0x5bb17e=_0x3e7d25;});}})[_0x7503('0x19')](function(_0x427531){_0x5be4a3=0x1f4;logger['error'](_0x427531[_0x7503('0x93')]);if(_0x427531[_0x7503('0x27')]){delete _0x427531[_0x7503('0x27')];}_0x5bb17e=_0x427531;})[_0x7503('0x94')](function(){if(_0x5bb17e===null){_0x5ca31b[_0x7503('0x1a')](_0x5be4a3);}else{if(_0x5be4a3===0x1f4){_0x5ca31b['status'](_0x5be4a3)[_0x7503('0x28')](_0x5bb17e);}else{_0x5ca31b['status'](_0x5be4a3)['json'](_0x5bb17e);}}});};exports[_0x7503('0x95')]=function(_0x3dbec1,_0x277cd4){var _0x3de7b6={};var _0x44dec1={};var _0x441059;var _0x582139;return db['MailAccount'][_0x7503('0x6a')]({'where':{'id':_0x3dbec1[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x277cd4,null))[_0x7503('0x13')](function(_0x301930){if(_0x301930){_0x441059=_0x301930;_0x44dec1[_0x7503('0x47')]=_[_0x7503('0x5d')](db[_0x7503('0x8f')][_0x7503('0x70')]);_0x44dec1[_0x7503('0x48')]=_[_0x7503('0x5d')](_0x3dbec1[_0x7503('0x48')]);_0x44dec1['filters']=_[_0x7503('0x4a')](_0x44dec1[_0x7503('0x47')],_0x44dec1[_0x7503('0x48')]);_0x3de7b6[_0x7503('0x4d')]=_['intersection'](_0x44dec1[_0x7503('0x47')],qs[_0x7503('0x4b')](_0x3dbec1[_0x7503('0x48')][_0x7503('0x4b')]));_0x3de7b6[_0x7503('0x4d')]=_0x3de7b6[_0x7503('0x4d')][_0x7503('0x4c')]?_0x3de7b6[_0x7503('0x4d')]:_0x44dec1[_0x7503('0x47')];_0x3de7b6[_0x7503('0x4f')]=qs[_0x7503('0x50')](_0x3dbec1[_0x7503('0x48')]['sort']);_0x3de7b6[_0x7503('0x53')]=qs[_0x7503('0x49')](_[_0x7503('0x51')](_0x3dbec1[_0x7503('0x48')],_0x44dec1['filters']));if(_0x3dbec1[_0x7503('0x48')]['filter']){_0x3de7b6[_0x7503('0x53')]=_['merge'](_0x3de7b6[_0x7503('0x53')],{'$or':_[_0x7503('0x43')](_0x3de7b6[_0x7503('0x4d')],function(_0x41efd6){var _0x1495bc={};_0x1495bc[_0x41efd6]={'$like':'%'+_0x3dbec1[_0x7503('0x48')]['filter']+'%'};return _0x1495bc;})});}_0x3de7b6=_[_0x7503('0x54')]({},_0x3de7b6,_0x3dbec1[_0x7503('0x57')]);return _0x441059[_0x7503('0x95')](_0x3de7b6);}})[_0x7503('0x13')](function(_0x59c798){if(_0x59c798){_0x582139=_0x59c798[_0x7503('0x4c')];if(!_0x3dbec1['query'][_0x7503('0x4e')](_0x7503('0x6b'))){_0x3de7b6['limit']=qs[_0x7503('0x20')](_0x3dbec1[_0x7503('0x48')][_0x7503('0x20')]);_0x3de7b6['offset']=qs[_0x7503('0x1e')](_0x3dbec1[_0x7503('0x48')][_0x7503('0x1e')]);}return _0x441059[_0x7503('0x95')](_0x3de7b6);}})[_0x7503('0x13')](function(_0x246ab5){if(_0x246ab5){return _0x246ab5?{'count':_0x582139,'rows':_0x246ab5}:null;}})[_0x7503('0x13')](respondWithResult(_0x277cd4,null))[_0x7503('0x19')](handleError(_0x277cd4,null));};exports[_0x7503('0x96')]=function(_0x2e01c2,_0x386f2a){var _0x15b89c={'raw':!![],'where':{}};var _0xbca7cd={};var _0x2ea18d={'count':0x0,'rows':[]};return db[_0x7503('0x44')][_0x7503('0x6a')]({'where':{'id':_0x2e01c2[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x386f2a,null))[_0x7503('0x13')](function(_0x4ee8e6){if(_0x4ee8e6){_0xbca7cd['model']=_[_0x7503('0x5d')](db['MailMessage'][_0x7503('0x70')]);_0xbca7cd['query']=_[_0x7503('0x5d')](_0x2e01c2[_0x7503('0x48')]);_0xbca7cd['filters']=_[_0x7503('0x4a')](_0xbca7cd['model'],_0xbca7cd[_0x7503('0x48')]);_0x15b89c['attributes']=_['intersection'](_0xbca7cd['model'],qs[_0x7503('0x4b')](_0x2e01c2[_0x7503('0x48')][_0x7503('0x4b')]));_0x15b89c[_0x7503('0x4d')]=_0x15b89c[_0x7503('0x4d')][_0x7503('0x4c')]?_0x15b89c[_0x7503('0x4d')]:_0xbca7cd[_0x7503('0x47')];if(!_0x2e01c2[_0x7503('0x48')]['hasOwnProperty']('nolimit')){_0x15b89c[_0x7503('0x20')]=qs[_0x7503('0x20')](_0x2e01c2[_0x7503('0x48')][_0x7503('0x20')]);_0x15b89c[_0x7503('0x1e')]=qs[_0x7503('0x1e')](_0x2e01c2[_0x7503('0x48')][_0x7503('0x1e')]);}_0x15b89c['order']=qs[_0x7503('0x50')](_0x2e01c2['query']['sort']);_0x15b89c[_0x7503('0x53')]=qs[_0x7503('0x49')](_['pick'](_0x2e01c2[_0x7503('0x48')],_0xbca7cd[_0x7503('0x49')]));_0x15b89c['where'][_0x7503('0x67')]=_0x4ee8e6['id'];if(_0x2e01c2[_0x7503('0x48')][_0x7503('0x52')]){_0x15b89c['where']=_[_0x7503('0x54')](_0x15b89c[_0x7503('0x53')],{'$or':_[_0x7503('0x43')](_0x15b89c[_0x7503('0x4d')],function(_0x23c7da){var _0x47810c={};_0x47810c[_0x23c7da]={'$like':'%'+_0x2e01c2[_0x7503('0x48')]['filter']+'%'};return _0x47810c;})});}if(_0x2e01c2[_0x7503('0x48')][_0x7503('0x97')]){var _0x15a61e=_0x2e01c2[_0x7503('0x48')][_0x7503('0x97')]['split'](',');var _0x20ec78={};_0x20ec78[_0x15a61e[0x0]]={'$gte':moment(_0x15a61e[0x1])['format'](_0x7503('0x98'))};_0x15b89c[_0x7503('0x53')]=_[_0x7503('0x54')](_0x15b89c[_0x7503('0x53')],_0x20ec78);}_0x15b89c=_[_0x7503('0x54')]({},_0x15b89c,_0x2e01c2[_0x7503('0x57')]);return db['MailMessage'][_0x7503('0x21')]({'where':_0x15b89c[_0x7503('0x53')]})['then'](function(_0x4b3a31){_0x2ea18d[_0x7503('0x21')]=_0x4b3a31;if(_0x2e01c2['query'][_0x7503('0x58')]){_0x15b89c[_0x7503('0x5e')]=[{'all':!![]}];}return db[_0x7503('0x99')]['findAll'](_0x15b89c);})[_0x7503('0x13')](function(_0x15b5bd){if(_0x2e01c2['query'][_0x7503('0x9a')]===_0x7503('0x9b')){for(var _0x24df6e=0x0;_0x24df6e<_0x15b5bd[_0x7503('0x4c')];_0x24df6e++){_0x15b5bd[_0x24df6e][_0x7503('0x61')]=juice(_0x15b5bd[_0x24df6e][_0x7503('0x61')]);}}_0x2ea18d['rows']=_0x15b5bd;return _0x2ea18d;});}})['then'](respondWithFilteredResult(_0x386f2a,_0x15b89c))[_0x7503('0x19')](handleError(_0x386f2a,null));};exports[_0x7503('0x28')]=function(_0x1ecfef,_0x34e942){var _0x420700,_0x2c832b={},_0x2e0dcb;if(_0x1ecfef['body']['to']){_0x2e0dcb=_0x1ecfef['body']['to'][_0x7503('0x9c')](',')[0x0];}return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x1ecfef['params']['id']},'include':[{'model':db['CmList'],'as':_0x7503('0x9d'),'include':[{'model':db['CmContact'],'as':_0x7503('0x9e'),'where':{'email':_0x2e0dcb},'limit':0x1,'order':[['updatedAt',_0x7503('0x9f')]]}]},{'model':db['MailServerOut'],'as':_0x7503('0x3e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x34e942,null))[_0x7503('0x13')](function(_0x42a0c4){if(!_0x42a0c4)return;_0x420700=_0x42a0c4;if(!_0x42a0c4[_0x7503('0x3e')])throw new Error(_0x7503('0xa0'));if(_[_0x7503('0xa1')](_0x1ecfef[_0x7503('0x61')][_0x7503('0xa2')])){_0x1ecfef['body'][_0x7503('0xa2')]=util[_0x7503('0xa3')]('%s\x20<%s>',_0x42a0c4[_0x7503('0x27')],_0x42a0c4['email']||_0x42a0c4[_0x7503('0x3e')][_0x7503('0x32')]);}if(_0x1ecfef[_0x7503('0x61')][_0x7503('0xa4')]&&_0x1ecfef[_0x7503('0x61')][_0x7503('0xa4')][_0x7503('0x4c')]){for(var _0x3fa2b4=0x0;_0x3fa2b4<_0x1ecfef[_0x7503('0x61')][_0x7503('0xa4')][_0x7503('0x4c')];_0x3fa2b4+=0x1){_0x1ecfef['body'][_0x7503('0xa4')][_0x3fa2b4]={'filename':_0x1ecfef['body']['attachments'][_0x3fa2b4][_0x7503('0x27')],'path':path[_0x7503('0xa5')](config[_0x7503('0xa6')],'server/files/attachments',_0x1ecfef[_0x7503('0x61')][_0x7503('0xa4')][_0x3fa2b4][_0x7503('0xa7')])};}}var _0x5f1d58=_0x42a0c4[_0x7503('0xa8')]();return respondWithRpcPromise(_0x7503('0xa9'),'sendMail',{'account':_0x5f1d58,'message':_0x1ecfef['body']});})['then'](function(_0x47057c){if(!_0x47057c)return;_0x2c832b=_0x47057c;if(!_0x420700[_0x7503('0x9d')])throw new Error('List\x20not\x20found');if(_0x420700[_0x7503('0x9d')][_0x7503('0x9e')]['length'])return _0x420700['List'][_0x7503('0x9e')][0x0];return db['CmContact'][_0x7503('0x68')](_[_0x7503('0xa')](_0x1ecfef[_0x7503('0x61')],{'firstName':_0x1ecfef[_0x7503('0x61')]['to'],'email':_0x1ecfef['body']['to'],'phone':_0x1ecfef[_0x7503('0x61')]['to'],'ListId':_0x420700[_0x7503('0xaa')]}));})[_0x7503('0x13')](function(_0x358f23){if(!_0x358f23)return;var _0x400140={'UserId':_0x1ecfef[_0x7503('0x32')]['id'],'ContactId':_0x358f23['id'],'MailAccountId':_0x420700['id'],'inReplyTo':_0x2c832b['messageId'],'to':_0x1ecfef[_0x7503('0x61')][_0x7503('0xa2')],'cc':_0x1ecfef[_0x7503('0x61')]['cc'],'subject':_0x1ecfef[_0x7503('0x61')]['subject'],'attach':_0x1ecfef[_0x7503('0x61')][_0x7503('0xab')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x7503('0xa3')](_0x7503('0x98')),'lastMsgDirection':_0x7503('0xac'),'Messages':[_[_0x7503('0x54')](_0x1ecfef[_0x7503('0x61')],{'messageId':_0x2c832b[_0x7503('0xad')],'sentAt':moment()[_0x7503('0xa3')](_0x7503('0x98')),'read':!![],'MailAccountId':_0x420700['id'],'UserId':_0x1ecfef['user']['id'],'ContactId':_0x358f23['id']})]};if(_0x1ecfef[_0x7503('0x61')]['Interaction']){_0x400140=_[_0x7503('0x54')](_0x400140,_0x1ecfef[_0x7503('0x61')][_0x7503('0xae')]);}return db[_0x7503('0x80')][_0x7503('0x68')](_0x400140,{'include':[{'model':db[_0x7503('0x99')],'as':_0x7503('0xaf')}]});})[_0x7503('0x13')](respondWithResult(_0x34e942,null))['catch'](handleError(_0x34e942,null));};exports[_0x7503('0xb0')]=function(_0x2c257b,_0x56b764){return db['MailAccount']['find']({'where':{'id':_0x2c257b['params']['id']},'include':[{'model':db[_0x7503('0x40')],'as':_0x7503('0x3e'),'raw':!![],'include':[{'model':db[_0x7503('0xb1')],'as':_0x7503('0xb1'),'raw':!![]}]}]})[_0x7503('0x13')](handleEntityNotFound(_0x56b764,null))[_0x7503('0x13')](function(_0x250988){if(!_0x250988[_0x7503('0x3e')])return;var _0x26f104=_0x250988[_0x7503('0xa8')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x26f104});})[_0x7503('0x13')](respondWithResult(_0x56b764,null))['catch'](handleError(_0x56b764,null));};exports[_0x7503('0x26')]=function(_0x4854a9,_0x2a4949){return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0x4854a9[_0x7503('0x64')]['id']}})['then'](handleEntityNotFound(_0x2a4949,null))[_0x7503('0x13')](function(_0x2491f0){if(_0x2491f0&&_0x2491f0[_0x7503('0x3b')]){throw new db[(_0x7503('0xb2'))]['ValidationError'](_0x7503('0xb3'));}return _0x2491f0;})['then'](removeEntity(_0x2a4949,null))[_0x7503('0x19')](handleError(_0x2a4949,null));};exports[_0x7503('0xb4')]=function(_0xea5697,_0x320ca2){return db[_0x7503('0x44')][_0x7503('0x5f')]({'where':{'id':_0xea5697[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x320ca2,null))[_0x7503('0x13')](function(_0x5068c7){if(_0x5068c7){return _0x5068c7['addAgents'](_0xea5697[_0x7503('0x61')]['ids'],_[_0x7503('0xb5')](_0xea5697[_0x7503('0x61')],['ids','id'])||{})[_0x7503('0xb6')](function(_0x27dd13){for(var _0x3137bc=0x0;_0x3137bc<_0xea5697[_0x7503('0x61')][_0x7503('0x72')]['length'];_0x3137bc+=0x1){socket[_0x7503('0xb7')](_0x7503('0xb8'),{'UserId':Number(_0xea5697['body'][_0x7503('0x72')][_0x3137bc]),'MailAccountId':Number(_0xea5697['params']['id'])});}return _0x27dd13;});}})['then'](respondWithResult(_0x320ca2,null))[_0x7503('0x19')](handleError(_0x320ca2,null));};exports['removeAgents']=function(_0x2747bb,_0x1e098d){return db[_0x7503('0x44')]['find']({'where':{'id':_0x2747bb[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x1e098d,null))['then'](function(_0x3263d4){if(_0x3263d4){return _0x3263d4[_0x7503('0xb9')](_0x2747bb['query']['ids'])[_0x7503('0x13')](function(){if(_[_0x7503('0xba')](_0x2747bb[_0x7503('0x48')][_0x7503('0x72')])){for(var _0x46e010=0x0;_0x46e010<_0x2747bb[_0x7503('0x48')][_0x7503('0x72')]['length'];_0x46e010+=0x1){socket[_0x7503('0xb7')](_0x7503('0xbb'),{'UserId':Number(_0x2747bb[_0x7503('0x48')][_0x7503('0x72')][_0x46e010]),'MailAccountId':Number(_0x2747bb['params']['id'])});}}else{socket[_0x7503('0xb7')](_0x7503('0xbb'),{'UserId':Number(_0x2747bb[_0x7503('0x48')][_0x7503('0x72')]),'MailAccountId':Number(_0x2747bb[_0x7503('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x1e098d,null))[_0x7503('0x19')](handleError(_0x1e098d,null));};exports[_0x7503('0xbc')]=function(_0x4ea479,_0x5acb50){var _0x34735f={};var _0x21db86={};var _0x53327d;var _0x19842;return db[_0x7503('0x44')][_0x7503('0x6a')]({'where':{'id':_0x4ea479[_0x7503('0x64')]['id']}})[_0x7503('0x13')](handleEntityNotFound(_0x5acb50,null))[_0x7503('0x13')](function(_0x129e7b){if(_0x129e7b){_0x53327d=_0x129e7b;_0x21db86[_0x7503('0x47')]=_[_0x7503('0x5d')](db[_0x7503('0x83')]['rawAttributes']);_0x21db86['query']=_[_0x7503('0x5d')](_0x4ea479[_0x7503('0x48')]);_0x21db86[_0x7503('0x49')]=_[_0x7503('0x4a')](_0x21db86[_0x7503('0x47')],_0x21db86[_0x7503('0x48')]);_0x34735f[_0x7503('0x4d')]=_[_0x7503('0x4a')](_0x21db86[_0x7503('0x47')],qs[_0x7503('0x4b')](_0x4ea479[_0x7503('0x48')][_0x7503('0x4b')]));_0x34735f[_0x7503('0x4d')]=_0x34735f['attributes'][_0x7503('0x4c')]?_0x34735f[_0x7503('0x4d')]:_0x21db86[_0x7503('0x47')];_0x34735f[_0x7503('0x4f')]=qs['sort'](_0x4ea479[_0x7503('0x48')][_0x7503('0x50')]);_0x34735f[_0x7503('0x53')]=qs['filters'](_['pick'](_0x4ea479['query'],_0x21db86['filters']));if(_0x4ea479[_0x7503('0x48')][_0x7503('0x52')]){_0x34735f[_0x7503('0x53')]=_[_0x7503('0x54')](_0x34735f[_0x7503('0x53')],{'$or':_[_0x7503('0x43')](_0x34735f[_0x7503('0x4d')],function(_0x52e1b4){var _0x4450f8={};_0x4450f8[_0x52e1b4]={'$like':'%'+_0x4ea479[_0x7503('0x48')]['filter']+'%'};return _0x4450f8;})});}_0x34735f=_['merge']({},_0x34735f,_0x4ea479[_0x7503('0x57')]);return _0x53327d[_0x7503('0xbc')](_0x34735f);}})['then'](function(_0x2afd0c){if(_0x2afd0c){_0x19842=_0x2afd0c['length'];if(!_0x4ea479['query'][_0x7503('0x4e')](_0x7503('0x6b'))){_0x34735f[_0x7503('0x20')]=qs[_0x7503('0x20')](_0x4ea479[_0x7503('0x48')]['limit']);_0x34735f[_0x7503('0x1e')]=qs[_0x7503('0x1e')](_0x4ea479[_0x7503('0x48')][_0x7503('0x1e')]);}return _0x53327d[_0x7503('0xbc')](_0x34735f);}})['then'](function(_0x4c93ae){if(_0x4c93ae){return _0x4c93ae?{'count':_0x19842,'rows':_0x4c93ae}:null;}})[_0x7503('0x13')](respondWithResult(_0x5acb50,null))['catch'](handleError(_0x5acb50,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 85eb2fd..00eaeee 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 _0x444f=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x1986a0,_0x432db8){var _0x604b6c=function(_0x591622){while(--_0x591622){_0x1986a0['push'](_0x1986a0['shift']());}};_0x604b6c(++_0x432db8);}(_0x444f,0xb5));var _0xf444=function(_0x20be7e,_0x56db99){_0x20be7e=_0x20be7e-0x0;var _0x43728c=_0x444f[_0x20be7e];return _0x43728c;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xf444('0x0'))['db'][_0xf444('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf444('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf444('0x3')};function emitEvent(_0x3d14bc){return function(_0x1d62ab,_0x3ba0d1,_0xb376b0){MailAccountEvents[_0xf444('0x4')](_0x3d14bc+':'+_0x1d62ab['id'],_0x1d62ab);MailAccountEvents['emit'](_0x3d14bc,_0x1d62ab);_0xb376b0(null);};}for(var e in events){if(events[_0xf444('0x5')](e)){var event=events[e];MailAccount[_0xf444('0x6')](e,emitEvent(event));}}module[_0xf444('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xc0d7=['save','update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x1c89a2,_0x2a90a1){var _0x43d91e=function(_0x54239a){while(--_0x54239a){_0x1c89a2['push'](_0x1c89a2['shift']());}};_0x43d91e(++_0x2a90a1);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x2a71ac,_0xb665cb){_0x2a71ac=_0x2a71ac-0x0;var _0x5db373=_0xc0d7[_0x2a71ac];return _0x5db373;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7c0d('0x0')](0x0);var events={'afterCreate':_0x7c0d('0x1'),'afterUpdate':_0x7c0d('0x2'),'afterDestroy':_0x7c0d('0x3')};function emitEvent(_0x2c03ef){return function(_0x2e1cc8,_0xfbd3c8,_0x276b49){MailAccountEvents[_0x7c0d('0x4')](_0x2c03ef+':'+_0x2e1cc8['id'],_0x2e1cc8);MailAccountEvents['emit'](_0x2c03ef,_0x2e1cc8);_0x276b49(null);};}for(var e in events){if(events[_0x7c0d('0x5')](e)){var event=events[e];MailAccount[_0x7c0d('0x6')](e,emitEvent(event));}}module[_0x7c0d('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 52063ee..51aea29 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 _0xd2dc=['secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','pass','exports','define','MailAccount','provider','host','Smtp','port'];(function(_0x2888cf,_0x2489b5){var _0x34b76d=function(_0x86e5d5){while(--_0x86e5d5){_0x2888cf['push'](_0x2888cf['shift']());}};_0x34b76d(++_0x2489b5);}(_0xd2dc,0x116));var _0xcd2d=function(_0x3342,_0x27f679){_0x3342=_0x3342-0x0;var _0x1832b8=_0xd2dc[_0x3342];return _0x1832b8;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xcd2d('0x0')]=function(_0x348938){return _0x348938[_0xcd2d('0x1')](_0xcd2d('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x252534=this;var _0x129545={'id':_0x252534['id'],'tls':{'rejectUnauthorized':![]}};if(_0x252534[_0xcd2d('0x3')]!=='custom'){_0x129545['service']=_0x252534['provider'];}else{_0x129545[_0xcd2d('0x4')]=_0x252534[_0xcd2d('0x5')]['host'];_0x129545[_0xcd2d('0x6')]=_0x252534[_0xcd2d('0x5')][_0xcd2d('0x6')];_0x129545[_0xcd2d('0x7')]=_0x252534[_0xcd2d('0x5')][_0xcd2d('0x7')];}if(_0x252534[_0xcd2d('0x5')][_0xcd2d('0x8')]){if(_0x252534[_0xcd2d('0x5')][_0xcd2d('0x9')]){if(!_0x252534[_0xcd2d('0x5')][_0xcd2d('0xa')])throw new Error(_0xcd2d('0xb'));_0x129545[_0xcd2d('0xc')]={'type':'OAuth2','user':_0x252534[_0xcd2d('0x5')][_0xcd2d('0xd')],'accessToken':_0x252534['Smtp'][_0xcd2d('0xa')]['data5']};}else{_0x129545['auth']={'user':_0x252534[_0xcd2d('0x5')][_0xcd2d('0xd')],'pass':_0x252534['Smtp'][_0xcd2d('0xe')]};}}return _0x129545;}}});}; \ No newline at end of file +var _0xc27c=['port','secure','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','pass','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp'];(function(_0x3161f4,_0x8e7b45){var _0x1b2b59=function(_0x2adbfd){while(--_0x2adbfd){_0x3161f4['push'](_0x3161f4['shift']());}};_0x1b2b59(++_0x8e7b45);}(_0xc27c,0x158));var _0xcc27=function(_0x40a3c2,_0x577478){_0x40a3c2=_0x40a3c2-0x0;var _0x2a9372=_0xc27c[_0x40a3c2];return _0x2a9372;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x3c36a2){return _0x3c36a2[_0xcc27('0x0')](_0xcc27('0x1'),attributes,{'tableName':_0xcc27('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x92f49d=this;var _0x264eda={'id':_0x92f49d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x92f49d[_0xcc27('0x3')]!==_0xcc27('0x4')){_0x264eda[_0xcc27('0x5')]=_0x92f49d['provider'];}else{_0x264eda[_0xcc27('0x6')]=_0x92f49d[_0xcc27('0x7')][_0xcc27('0x6')];_0x264eda[_0xcc27('0x8')]=_0x92f49d[_0xcc27('0x7')][_0xcc27('0x8')];_0x264eda['secure']=_0x92f49d[_0xcc27('0x7')][_0xcc27('0x9')];}if(_0x92f49d[_0xcc27('0x7')]['authentication']){if(_0x92f49d[_0xcc27('0x7')][_0xcc27('0xa')]){if(!_0x92f49d[_0xcc27('0x7')]['CloudProvider'])throw new Error(_0xcc27('0xb'));_0x264eda[_0xcc27('0xc')]={'type':'OAuth2','user':_0x92f49d[_0xcc27('0x7')][_0xcc27('0xd')],'accessToken':_0x92f49d[_0xcc27('0x7')][_0xcc27('0xe')]['data5']};}else{_0x264eda[_0xcc27('0xc')]={'user':_0x92f49d['Smtp'][_0xcc27('0xd')],'pass':_0x92f49d[_0xcc27('0x7')][_0xcc27('0xf')]};}}return _0x264eda;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 677d7e5..cc04f53 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 _0x9505=['list','orderBy','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','attach','interaction','attachments','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','name','MailQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','result','catch','MailAccount','findAll','options','where','limit','include','map','model','attributes','GetMailAccount','ShowMailAccount','find','raw','smtp','setDataValue','smtpOptions','getSmtpOptions','body','mail','difference','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications'];(function(_0x215ea3,_0x24d78){var _0x542d1d=function(_0x35d6b3){while(--_0x35d6b3){_0x215ea3['push'](_0x215ea3['shift']());}};_0x542d1d(++_0x24d78);}(_0x9505,0x1e5));var _0x5950=function(_0x55a9ca,_0x46fa7a){_0x55a9ca=_0x55a9ca-0x0;var _0x388218=_0x9505[_0x55a9ca];return _0x388218;};'use strict';var _=require(_0x5950('0x0'));var moment=require(_0x5950('0x1'));var BPromise=require('bluebird');var rs=require(_0x5950('0x2'));var Redis=require(_0x5950('0x3'));var db=require(_0x5950('0x4'))['db'];var logger=require(_0x5950('0x5'))(_0x5950('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5950('0x7')][_0x5950('0x8')]({'port':0x232c});config[_0x5950('0x9')]=_[_0x5950('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5950('0xb'))(new Redis(config[_0x5950('0x9')]));require(_0x5950('0xc'))[_0x5950('0xd')](socket);function respondWithRpcPromise(_0x34c877,_0x1df039,_0x1148ef){return new BPromise(function(_0x213e3b,_0x1c8f39){return client['request'](_0x34c877,_0x1148ef)[_0x5950('0xe')](function(_0x477739){logger['info']('MailAccount,\x20%s,\x20%s',_0x1df039,_0x5950('0xf'));logger[_0x5950('0x10')](_0x5950('0x11'),_0x1df039,_0x5950('0xf'),JSON[_0x5950('0x12')](_0x477739));if(_0x477739[_0x5950('0x13')]){if(_0x477739[_0x5950('0x13')][_0x5950('0x14')]===0x1f4){logger[_0x5950('0x13')](_0x5950('0x15'),_0x1df039,_0x477739[_0x5950('0x13')][_0x5950('0x16')]);return _0x1c8f39(_0x477739[_0x5950('0x13')][_0x5950('0x16')]);}logger[_0x5950('0x13')](_0x5950('0x15'),_0x1df039,_0x477739[_0x5950('0x13')][_0x5950('0x16')]);return _0x213e3b(_0x477739[_0x5950('0x13')][_0x5950('0x16')]);}else{logger[_0x5950('0x17')]('MailAccount,\x20%s,\x20%s',_0x1df039,'request\x20sent');_0x213e3b(_0x477739[_0x5950('0x18')][_0x5950('0x16')]);}})[_0x5950('0x19')](function(_0x5a9530){logger[_0x5950('0x13')]('MailAccount,\x20%s,\x20%s',_0x1df039,_0x5a9530);_0x1c8f39(_0x5a9530);});});}exports['GetMailAccount']=function(_0x119f1f){var _0x2ada72=this;return new Promise(function(_0x1ad343,_0x5bd90e){return db[_0x5950('0x1a')][_0x5950('0x1b')]({'raw':_0x119f1f['options']?_0x119f1f['options']['raw']===undefined?!![]:![]:!![],'where':_0x119f1f['options']?_0x119f1f[_0x5950('0x1c')][_0x5950('0x1d')]||null:null,'attributes':_0x119f1f[_0x5950('0x1c')]?_0x119f1f[_0x5950('0x1c')]['attributes']||null:null,'limit':_0x119f1f[_0x5950('0x1c')]?_0x119f1f[_0x5950('0x1c')][_0x5950('0x1e')]||null:null,'include':_0x119f1f[_0x5950('0x1c')]?_0x119f1f[_0x5950('0x1c')][_0x5950('0x1f')]?_[_0x5950('0x20')](_0x119f1f['options']['include'],function(_0x1b2265){return{'model':db[_0x1b2265[_0x5950('0x21')]],'as':_0x1b2265['as'],'attributes':_0x1b2265[_0x5950('0x22')],'include':_0x1b2265[_0x5950('0x1f')]?_[_0x5950('0x20')](_0x1b2265['include'],function(_0x4a7b22){return{'model':db[_0x4a7b22['model']],'as':_0x4a7b22['as'],'attributes':_0x4a7b22[_0x5950('0x22')],'include':_0x4a7b22[_0x5950('0x1f')]?_[_0x5950('0x20')](_0x4a7b22[_0x5950('0x1f')],function(_0x3923dd){return{'model':db[_0x3923dd[_0x5950('0x21')]],'as':_0x3923dd['as'],'attributes':_0x3923dd[_0x5950('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5950('0xe')](function(_0x179b24){logger[_0x5950('0x17')](_0x5950('0x23'),_0x119f1f);logger[_0x5950('0x10')](_0x5950('0x23'),_0x119f1f,JSON[_0x5950('0x12')](_0x179b24));_0x1ad343(_0x179b24);})[_0x5950('0x19')](function(_0x24fd58){logger[_0x5950('0x13')](_0x5950('0x23'),_0x24fd58[_0x5950('0x16')],_0x119f1f);_0x5bd90e(_0x2ada72[_0x5950('0x13')](0x1f4,_0x24fd58[_0x5950('0x16')]));});});};exports[_0x5950('0x24')]=function(_0x32cbb1){var _0x3304ec=this;return new Promise(function(_0x26fafc,_0x46ba0c){return db[_0x5950('0x1a')][_0x5950('0x25')]({'raw':_0x32cbb1['options']?_0x32cbb1[_0x5950('0x1c')][_0x5950('0x26')]===undefined?!![]:![]:!![],'where':_0x32cbb1[_0x5950('0x1c')]?_0x32cbb1[_0x5950('0x1c')][_0x5950('0x1d')]||null:null,'attributes':_0x32cbb1['options']?_0x32cbb1['options'][_0x5950('0x22')]||null:null,'include':_0x32cbb1[_0x5950('0x1c')]?_0x32cbb1['options'][_0x5950('0x1f')]?_['map'](_0x32cbb1[_0x5950('0x1c')][_0x5950('0x1f')],function(_0x376d9f){return{'model':db[_0x376d9f['model']],'as':_0x376d9f['as'],'attributes':_0x376d9f[_0x5950('0x22')],'include':_0x376d9f['include']?_[_0x5950('0x20')](_0x376d9f[_0x5950('0x1f')],function(_0x858e48){return{'model':db[_0x858e48[_0x5950('0x21')]],'as':_0x858e48['as'],'attributes':_0x858e48['attributes'],'include':_0x858e48[_0x5950('0x1f')]?_[_0x5950('0x20')](_0x858e48[_0x5950('0x1f')],function(_0x4ad1e0){return{'model':db[_0x4ad1e0[_0x5950('0x21')]],'as':_0x4ad1e0['as'],'attributes':_0x4ad1e0[_0x5950('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55d1c7){if(_0x32cbb1['options'][_0x5950('0x27')]===!![])_0x55d1c7[_0x5950('0x28')](_0x5950('0x29'),_0x55d1c7[_0x5950('0x2a')]());logger[_0x5950('0x17')]('ShowMailAccount',_0x32cbb1);logger['debug']('ShowMailAccount',_0x32cbb1,JSON['stringify'](_0x55d1c7));_0x26fafc(_0x55d1c7);})[_0x5950('0x19')](function(_0x3f7185){logger[_0x5950('0x13')](_0x5950('0x24'),_0x3f7185['message'],_0x32cbb1);_0x46ba0c(_0x3304ec[_0x5950('0x13')](0x1f4,_0x3f7185[_0x5950('0x16')]));});});};exports['NotifyMailAccount']=function(_0x2e6f8a){var _0x2231bb=this;return new Promise(function(_0x537141,_0x2c4bf3){var _0x479a9={'body':_0x2e6f8a[_0x5950('0x2b')],'channel':_0x5950('0x2c')};var _0x48eba5=_[_0x5950('0x2d')](_['keys'](db[_0x5950('0x2e')][_0x5950('0x2f')]),['createdAt',_0x5950('0x30'),_0x5950('0x31'),_0x5950('0x32')]);var _0x2e9950=![];if(_0x2e6f8a['body']['id']){delete _0x2e6f8a[_0x5950('0x2b')]['id'];}if(_[_0x5950('0x33')](_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x34')])){return _0x2c4bf3(_0x2231bb['error'](0x1f4,_0x5950('0x35')));}if(_[_0x5950('0x33')](_0x2e6f8a[_0x5950('0x2b')]['body'])||_0x2e6f8a[_0x5950('0x2b')]['body']===''){return _0x2c4bf3(_0x2231bb[_0x5950('0x13')](0x1f4,_0x5950('0x36')));}if(_[_0x5950('0x33')](_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x37')])){return _0x2c4bf3(_0x2231bb[_0x5950('0x13')](0x1f4,_0x5950('0x38')+_0x48eba5));}if(!_['includes'](_0x48eba5,_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x37')])){return _0x2c4bf3(_0x2231bb[_0x5950('0x13')](0x1f4,_0x5950('0x39')+_0x48eba5));}var _0x32375={};_0x32375[_0x2e6f8a['body']['mapKey']]=_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x34')];return db[_0x5950('0x1a')]['find']({'where':{'id':_0x2e6f8a[_0x5950('0x3a')]['id']},'include':[{'model':db[_0x5950('0x3b')],'as':_0x5950('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x32375,'limit':0x1,'order':[['updatedAt',_0x5950('0x3d')]]}]},{'model':db[_0x5950('0x3e')],'as':_0x5950('0x3f')},{'model':db[_0x5950('0x40')],'as':_0x5950('0x41'),'include':[{'model':db[_0x5950('0x42')],'as':_0x5950('0x42')}]}]})[_0x5950('0xe')](function(_0x25d749){if(_0x25d749&&_0x25d749['List']){var _0x16737d=_0x25d749[_0x5950('0x43')]({'plain':!![]});_0x479a9[_0x5950('0x3a')]=_[_0x5950('0x44')](_0x16737d,[_0x5950('0x3f'),_0x5950('0x3c')]);_0x479a9[_0x5950('0x3a')][_0x5950('0x29')]=_0x25d749[_0x5950('0x2a')]();_0x479a9[_0x5950('0x45')]=_0x16737d['Applications'];_0x479a9[_0x5950('0x46')]=_0x16737d[_0x5950('0x3c')];_0x479a9[_0x5950('0x45')]=_[_0x5950('0x47')](_0x479a9['applications'],['priority'],[_0x5950('0x48')]);if(_0x479a9[_0x5950('0x3a')]&&_0x479a9['account'][_0x5950('0x49')]){_0x479a9[_0x5950('0x45')][_0x5950('0x4a')]({'id':0x0,'priority':_0x479a9[_0x5950('0x45')][_0x5950('0x4b')]+0x1,'app':_0x5950('0x4c'),'appdata':'autoclose','interval':_0x5950('0x4d')});}if(_0x479a9[_0x5950('0x3a')]['Applications']){delete _0x479a9[_0x5950('0x3a')][_0x5950('0x3f')];}if(_0x479a9[_0x5950('0x3a')]['List']){delete _0x479a9[_0x5950('0x3a')][_0x5950('0x3c')];}if(_0x16737d[_0x5950('0x3c')][_0x5950('0x4e')][_0x5950('0x4b')]){return _0x16737d[_0x5950('0x3c')][_0x5950('0x4e')][0x0];}var _0x2f824e=_[_0x5950('0xa')](_0x2e6f8a['body'],{'firstName':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x34')],'ListId':_0x16737d[_0x5950('0x32')]});_0x2f824e[_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x37')]]=_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x34')];return db['CmContact'][_0x5950('0x4f')](_0x2f824e);}else{throw new Error('List\x20not\x20found');}})[_0x5950('0xe')](function(_0x489f8c){_0x479a9[_0x5950('0x50')]=_0x489f8c;if(_0x489f8c){if(!_0x2e6f8a[_0x5950('0x2b')]['message'][_0x5950('0x51')]){_0x2e6f8a['body'][_0x5950('0x16')][_0x5950('0x51')]=rs['generate']()+'\x20'+_0x2e6f8a['body'][_0x5950('0x16')][_0x5950('0x34')];}var _0x13d10d={'ContactId':_0x489f8c['id'],'MailAccountId':_0x2e6f8a[_0x5950('0x3a')]['id'],'inReplyTo':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x51')],'to':_0x2e6f8a[_0x5950('0x2b')]['message']['from'],'cc':_0x2e6f8a[_0x5950('0x2b')]['message']['cc'],'subject':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x52')],'attach':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')]['attach'],'lastMsgAt':moment()[_0x5950('0x53')](_0x5950('0x54')),'lastMsgDirection':'in'};return db[_0x5950('0x55')]['find']({'where':{'closed':![],'MailAccountId':_0x2e6f8a['account']['id']},'include':[{'model':db[_0x5950('0x56')],'as':'Messages','attributes':[_0x5950('0x51')],'where':{'messageId':_0x2e6f8a[_0x5950('0x2b')]['message'][_0x5950('0x57')]}}]})[_0x5950('0xe')](function(_0x40d20d){if(_0x40d20d){return[_0x40d20d,![]];}return db[_0x5950('0x55')][_0x5950('0x4f')](_0x13d10d)[_0x5950('0xe')](function(_0x570003){return[_0x570003,!![]];});});}else{throw new Error(_0x5950('0x58'));}})[_0x5950('0x59')](function(_0x84770e,_0x4cddfb){if(_0x84770e){_0x2e9950=_0x4cddfb;if(!_0x4cddfb){return _0x84770e['update']({'inReplyTo':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x51')],'to':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x34')],'cc':_0x2e6f8a['body'][_0x5950('0x16')]['cc'],'subject':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x52')],'attach':_0x84770e['attach']?_0x84770e[_0x5950('0x5a')]:_0x2e6f8a[_0x5950('0x2b')]['message'][_0x5950('0x5a')],'substatus':null,'substatusAt':moment()['format'](_0x5950('0x54')),'lastMsgAt':moment()['format'](_0x5950('0x54')),'lastMsgDirection':'in'});}else{return _0x84770e;}}})[_0x5950('0xe')](function(_0x4d3edd){_0x479a9[_0x5950('0x5b')]=_0x4d3edd[_0x5950('0x43')]({'plain':!![]});_0x479a9[_0x5950('0x5b')]['created']=_0x2e9950;return db[_0x5950('0x56')][_0x5950('0x4f')]({'body':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x2b')],'MailAccountId':_0x2e6f8a[_0x5950('0x3a')]['id'],'MailInteractionId':_0x4d3edd['id'],'direction':'in','ContactId':_0x479a9[_0x5950('0x50')]['id'],'messageId':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')]['messageId'],'from':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x34')],'to':_0x2e6f8a[_0x5950('0x2b')]['message']['to'],'cc':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')]['cc'],'subject':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')]['subject'],'attach':_0x2e6f8a['body'][_0x5950('0x16')]['attach'],'Attachments':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x5c')],'originTo':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')]['originTo'],'originCc':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')]['originCc'],'bcc':_0x2e6f8a['body'][_0x5950('0x16')][_0x5950('0x5d')],'ChatWebsiteId':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x5e')]||null,'originChannel':_0x2e6f8a['body'][_0x5950('0x16')][_0x5950('0x5f')]||_0x5950('0x60'),'ChatOfflineMessageId':_0x2e6f8a[_0x5950('0x2b')][_0x5950('0x16')][_0x5950('0x61')]||null},{'include':[{'model':db[_0x5950('0x62')],'as':_0x5950('0x63')}]});})['then'](function(_0x4c60f7){_0x479a9[_0x5950('0x16')]=_0x4c60f7;if(!_0x479a9[_0x5950('0x5b')][_0x5950('0x64')]){return;}return db[_0x5950('0x65')][_0x5950('0x25')]({'attributes':['id','name'],'where':{'id':_0x479a9['interaction'][_0x5950('0x64')]}});})[_0x5950('0xe')](function(_0x59f9da){if(_0x59f9da){_0x479a9[_0x5950('0x45')][_0x5950('0x66')]({'id':0x0,'priority':0x0,'app':_0x5950('0x67'),'appdata':_0x59f9da[_0x5950('0x68')]+','+(_0x479a9[_0x5950('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':_0x5950('0x4d')});}if(!_0x479a9['interaction']['queueId']){return;}return db[_0x5950('0x69')][_0x5950('0x25')]({'attributes':['id',_0x5950('0x68')],'where':{'id':_0x479a9['interaction'][_0x5950('0x6a')]}});})[_0x5950('0xe')](function(_0x2663ab){if(_0x2663ab){_0x479a9['applications'][_0x5950('0x66')]({'id':0x0,'priority':0x1,'app':_0x5950('0x6b'),'appdata':_0x2663ab[_0x5950('0x68')]+','+(_0x479a9[_0x5950('0x3a')][_0x5950('0x6c')]||0x12c),'interval':_0x5950('0x4d')});}return respondWithRpcPromise(_0x5950('0x6d'),_0x5950('0x6e'),_0x479a9);})['then'](function(_0x3f3189){_0x537141(_0x3f3189);})['catch'](function(_0x406c04){_0x2c4bf3(_0x2231bb[_0x5950('0x13')](0x1f4,_0x406c04[_0x5950('0x16')]));});});}; \ No newline at end of file +var _0xd6d2=['request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes','include','model','map','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','CloudProvider','omit','applications','list','orderBy','asc','autoclose','push','close','length','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','attachments','originCc','bcc','originChannel','Email','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','MailQueue','queue','waitForTheAssignedQueue','startRouting','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info'];(function(_0xc3eb67,_0xfb68aa){var _0x19a0b8=function(_0x1c9dce){while(--_0x1c9dce){_0xc3eb67['push'](_0xc3eb67['shift']());}};_0x19a0b8(++_0xfb68aa);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x12cbc2,_0x333aeb){_0x12cbc2=_0x12cbc2-0x0;var _0x48d74a=_0xd6d2[_0x12cbc2];return _0x48d74a;};'use strict';var _=require(_0x2d6d('0x0'));var moment=require(_0x2d6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d6d('0x2'));var Redis=require(_0x2d6d('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x2d6d('0x4'))('rpc');var config=require(_0x2d6d('0x5'));var jayson=require(_0x2d6d('0x6'));var client=jayson[_0x2d6d('0x7')]['http']({'port':0x232c});config[_0x2d6d('0x8')]=_[_0x2d6d('0x9')](config[_0x2d6d('0x8')],{'host':_0x2d6d('0xa'),'port':0x18eb});var socket=require(_0x2d6d('0xb'))(new Redis(config[_0x2d6d('0x8')]));require(_0x2d6d('0xc'))[_0x2d6d('0xd')](socket);function respondWithRpcPromise(_0x8e4be8,_0x261959,_0x1a1f60){return new BPromise(function(_0x4bf440,_0x25fc41){return client[_0x2d6d('0xe')](_0x8e4be8,_0x1a1f60)[_0x2d6d('0xf')](function(_0x3cc2fa){logger[_0x2d6d('0x10')]('MailAccount,\x20%s,\x20%s',_0x261959,_0x2d6d('0x11'));logger[_0x2d6d('0x12')](_0x2d6d('0x13'),_0x261959,_0x2d6d('0x11'),JSON[_0x2d6d('0x14')](_0x3cc2fa));if(_0x3cc2fa['error']){if(_0x3cc2fa[_0x2d6d('0x15')][_0x2d6d('0x16')]===0x1f4){logger[_0x2d6d('0x15')](_0x2d6d('0x17'),_0x261959,_0x3cc2fa['error'][_0x2d6d('0x18')]);return _0x25fc41(_0x3cc2fa[_0x2d6d('0x15')]['message']);}logger['error'](_0x2d6d('0x17'),_0x261959,_0x3cc2fa[_0x2d6d('0x15')][_0x2d6d('0x18')]);return _0x4bf440(_0x3cc2fa['error'][_0x2d6d('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x261959,'request\x20sent');_0x4bf440(_0x3cc2fa[_0x2d6d('0x19')][_0x2d6d('0x18')]);}})[_0x2d6d('0x1a')](function(_0x3c527e){logger[_0x2d6d('0x15')](_0x2d6d('0x17'),_0x261959,_0x3c527e);_0x25fc41(_0x3c527e);});});}exports[_0x2d6d('0x1b')]=function(_0xa2c4a7){var _0x31b38b=this;return new Promise(function(_0x4898a7,_0x315d13){return db[_0x2d6d('0x1c')]['findAll']({'raw':_0xa2c4a7[_0x2d6d('0x1d')]?_0xa2c4a7[_0x2d6d('0x1d')][_0x2d6d('0x1e')]===undefined?!![]:![]:!![],'where':_0xa2c4a7[_0x2d6d('0x1d')]?_0xa2c4a7[_0x2d6d('0x1d')][_0x2d6d('0x1f')]||null:null,'attributes':_0xa2c4a7['options']?_0xa2c4a7[_0x2d6d('0x1d')][_0x2d6d('0x20')]||null:null,'limit':_0xa2c4a7[_0x2d6d('0x1d')]?_0xa2c4a7['options']['limit']||null:null,'include':_0xa2c4a7[_0x2d6d('0x1d')]?_0xa2c4a7['options']['include']?_['map'](_0xa2c4a7[_0x2d6d('0x1d')][_0x2d6d('0x21')],function(_0x3da83d){return{'model':db[_0x3da83d[_0x2d6d('0x22')]],'as':_0x3da83d['as'],'attributes':_0x3da83d[_0x2d6d('0x20')],'include':_0x3da83d['include']?_[_0x2d6d('0x23')](_0x3da83d[_0x2d6d('0x21')],function(_0x455e71){return{'model':db[_0x455e71[_0x2d6d('0x22')]],'as':_0x455e71['as'],'attributes':_0x455e71[_0x2d6d('0x20')],'include':_0x455e71[_0x2d6d('0x21')]?_[_0x2d6d('0x23')](_0x455e71[_0x2d6d('0x21')],function(_0x27b7d2){return{'model':db[_0x27b7d2['model']],'as':_0x27b7d2['as'],'attributes':_0x27b7d2[_0x2d6d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2d6d('0xf')](function(_0x2e7b32){logger[_0x2d6d('0x10')]('GetMailAccount',_0xa2c4a7);logger[_0x2d6d('0x12')]('GetMailAccount',_0xa2c4a7,JSON[_0x2d6d('0x14')](_0x2e7b32));_0x4898a7(_0x2e7b32);})['catch'](function(_0x58bfc7){logger[_0x2d6d('0x15')]('GetMailAccount',_0x58bfc7[_0x2d6d('0x18')],_0xa2c4a7);_0x315d13(_0x31b38b[_0x2d6d('0x15')](0x1f4,_0x58bfc7['message']));});});};exports[_0x2d6d('0x24')]=function(_0x4864a6){var _0xfbf3dc=this;return new Promise(function(_0x422153,_0xafd15a){return db[_0x2d6d('0x1c')][_0x2d6d('0x25')]({'raw':_0x4864a6[_0x2d6d('0x1d')]?_0x4864a6[_0x2d6d('0x1d')][_0x2d6d('0x1e')]===undefined?!![]:![]:!![],'where':_0x4864a6['options']?_0x4864a6[_0x2d6d('0x1d')][_0x2d6d('0x1f')]||null:null,'attributes':_0x4864a6['options']?_0x4864a6[_0x2d6d('0x1d')][_0x2d6d('0x20')]||null:null,'include':_0x4864a6[_0x2d6d('0x1d')]?_0x4864a6[_0x2d6d('0x1d')][_0x2d6d('0x21')]?_['map'](_0x4864a6['options']['include'],function(_0x625d2a){return{'model':db[_0x625d2a[_0x2d6d('0x22')]],'as':_0x625d2a['as'],'attributes':_0x625d2a[_0x2d6d('0x20')],'include':_0x625d2a['include']?_[_0x2d6d('0x23')](_0x625d2a[_0x2d6d('0x21')],function(_0x29dce0){return{'model':db[_0x29dce0[_0x2d6d('0x22')]],'as':_0x29dce0['as'],'attributes':_0x29dce0['attributes'],'include':_0x29dce0[_0x2d6d('0x21')]?_[_0x2d6d('0x23')](_0x29dce0[_0x2d6d('0x21')],function(_0x15f9af){return{'model':db[_0x15f9af[_0x2d6d('0x22')]],'as':_0x15f9af['as'],'attributes':_0x15f9af[_0x2d6d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2d6d('0xf')](function(_0x5b0674){if(_0x4864a6[_0x2d6d('0x1d')][_0x2d6d('0x26')]===!![])_0x5b0674[_0x2d6d('0x27')](_0x2d6d('0x28'),_0x5b0674[_0x2d6d('0x29')]());logger['info'](_0x2d6d('0x24'),_0x4864a6);logger[_0x2d6d('0x12')](_0x2d6d('0x24'),_0x4864a6,JSON[_0x2d6d('0x14')](_0x5b0674));_0x422153(_0x5b0674);})[_0x2d6d('0x1a')](function(_0x108f7c){logger[_0x2d6d('0x15')](_0x2d6d('0x24'),_0x108f7c[_0x2d6d('0x18')],_0x4864a6);_0xafd15a(_0xfbf3dc[_0x2d6d('0x15')](0x1f4,_0x108f7c[_0x2d6d('0x18')]));});});};exports[_0x2d6d('0x2a')]=function(_0x33c6b5){var _0x1dae0a=this;return new Promise(function(_0x34fc23,_0x11c737){var _0x452417={'body':_0x33c6b5['body'],'channel':_0x2d6d('0x2b')};var _0x97b688=_[_0x2d6d('0x2c')](_[_0x2d6d('0x2d')](db[_0x2d6d('0x2e')]['rawAttributes']),[_0x2d6d('0x2f'),_0x2d6d('0x30'),_0x2d6d('0x31'),_0x2d6d('0x32')]);var _0x543b4b=![];if(_0x33c6b5[_0x2d6d('0x33')]['id']){delete _0x33c6b5[_0x2d6d('0x33')]['id'];}if(_[_0x2d6d('0x34')](_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x35')])){return _0x11c737(_0x1dae0a['error'](0x1f4,_0x2d6d('0x36')));}if(_[_0x2d6d('0x34')](_0x33c6b5['body'][_0x2d6d('0x33')])||_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x33')]===''){return _0x11c737(_0x1dae0a['error'](0x1f4,_0x2d6d('0x37')));}if(_[_0x2d6d('0x34')](_0x33c6b5['body']['mapKey'])){return _0x11c737(_0x1dae0a['error'](0x1f4,_0x2d6d('0x38')+_0x97b688));}if(!_[_0x2d6d('0x39')](_0x97b688,_0x33c6b5['body'][_0x2d6d('0x3a')])){return _0x11c737(_0x1dae0a[_0x2d6d('0x15')](0x1f4,_0x2d6d('0x3b')+_0x97b688));}var _0x470fb5={};_0x470fb5[_0x33c6b5['body'][_0x2d6d('0x3a')]]=_0x33c6b5[_0x2d6d('0x33')]['from'];return db[_0x2d6d('0x1c')][_0x2d6d('0x25')]({'where':{'id':_0x33c6b5[_0x2d6d('0x3c')]['id']},'include':[{'model':db[_0x2d6d('0x3d')],'as':_0x2d6d('0x3e'),'include':[{'model':db[_0x2d6d('0x2e')],'as':_0x2d6d('0x3f'),'where':_0x470fb5,'limit':0x1,'order':[['updatedAt',_0x2d6d('0x40')]]}]},{'model':db[_0x2d6d('0x41')],'as':_0x2d6d('0x42')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x2d6d('0x43')],'as':_0x2d6d('0x43')}]}]})[_0x2d6d('0xf')](function(_0x4e5203){if(_0x4e5203&&_0x4e5203[_0x2d6d('0x3e')]){var _0xff0b07=_0x4e5203['get']({'plain':!![]});_0x452417[_0x2d6d('0x3c')]=_[_0x2d6d('0x44')](_0xff0b07,[_0x2d6d('0x42'),_0x2d6d('0x3e')]);_0x452417[_0x2d6d('0x3c')][_0x2d6d('0x28')]=_0x4e5203[_0x2d6d('0x29')]();_0x452417[_0x2d6d('0x45')]=_0xff0b07[_0x2d6d('0x42')];_0x452417[_0x2d6d('0x46')]=_0xff0b07['List'];_0x452417[_0x2d6d('0x45')]=_[_0x2d6d('0x47')](_0x452417[_0x2d6d('0x45')],['priority'],[_0x2d6d('0x48')]);if(_0x452417[_0x2d6d('0x3c')]&&_0x452417[_0x2d6d('0x3c')][_0x2d6d('0x49')]){_0x452417[_0x2d6d('0x45')][_0x2d6d('0x4a')]({'id':0x0,'priority':_0x452417[_0x2d6d('0x45')]['length']+0x1,'app':_0x2d6d('0x4b'),'appdata':_0x2d6d('0x49'),'interval':'*,*,*,*'});}if(_0x452417[_0x2d6d('0x3c')][_0x2d6d('0x42')]){delete _0x452417['account'][_0x2d6d('0x42')];}if(_0x452417[_0x2d6d('0x3c')]['List']){delete _0x452417[_0x2d6d('0x3c')][_0x2d6d('0x3e')];}if(_0xff0b07[_0x2d6d('0x3e')][_0x2d6d('0x3f')][_0x2d6d('0x4c')]){return _0xff0b07[_0x2d6d('0x3e')][_0x2d6d('0x3f')][0x0];}var _0x566bc4=_['defaults'](_0x33c6b5[_0x2d6d('0x33')],{'firstName':_0x33c6b5['body'][_0x2d6d('0x35')],'ListId':_0xff0b07[_0x2d6d('0x32')]});_0x566bc4[_0x33c6b5[_0x2d6d('0x33')]['mapKey']]=_0x33c6b5[_0x2d6d('0x33')]['from'];return db[_0x2d6d('0x2e')][_0x2d6d('0x4d')](_0x566bc4);}else{throw new Error(_0x2d6d('0x4e'));}})[_0x2d6d('0xf')](function(_0x30402e){_0x452417[_0x2d6d('0x4f')]=_0x30402e;if(_0x30402e){if(!_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['messageId']){_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x50')]=rs['generate']()+'\x20'+_0x33c6b5['body']['message'][_0x2d6d('0x35')];}var _0x4c1b4f={'ContactId':_0x30402e['id'],'MailAccountId':_0x33c6b5[_0x2d6d('0x3c')]['id'],'inReplyTo':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x50')],'to':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['from'],'cc':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['cc'],'subject':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x51')],'attach':_0x33c6b5[_0x2d6d('0x33')]['message'][_0x2d6d('0x52')],'lastMsgAt':moment()[_0x2d6d('0x53')](_0x2d6d('0x54')),'lastMsgDirection':'in'};return db[_0x2d6d('0x55')]['find']({'where':{'closed':![],'MailAccountId':_0x33c6b5[_0x2d6d('0x3c')]['id']},'include':[{'model':db[_0x2d6d('0x56')],'as':_0x2d6d('0x57'),'attributes':['messageId'],'where':{'messageId':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x58')]}}]})['then'](function(_0x3dd1d8){if(_0x3dd1d8){return[_0x3dd1d8,![]];}return db['MailInteraction'][_0x2d6d('0x4d')](_0x4c1b4f)[_0x2d6d('0xf')](function(_0x2183ba){return[_0x2183ba,!![]];});});}else{throw new Error(_0x2d6d('0x59'));}})[_0x2d6d('0x5a')](function(_0x179721,_0x3540ed){if(_0x179721){_0x543b4b=_0x3540ed;if(!_0x3540ed){return _0x179721[_0x2d6d('0x5b')]({'inReplyTo':_0x33c6b5['body'][_0x2d6d('0x18')][_0x2d6d('0x50')],'to':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x35')],'cc':_0x33c6b5['body'][_0x2d6d('0x18')]['cc'],'subject':_0x33c6b5['body'][_0x2d6d('0x18')][_0x2d6d('0x51')],'attach':_0x179721[_0x2d6d('0x52')]?_0x179721[_0x2d6d('0x52')]:_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x52')],'substatus':null,'substatusAt':moment()[_0x2d6d('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x2d6d('0x53')](_0x2d6d('0x54')),'lastMsgDirection':'in'});}else{return _0x179721;}}})[_0x2d6d('0xf')](function(_0x2ea00d){_0x452417[_0x2d6d('0x5c')]=_0x2ea00d['get']({'plain':!![]});_0x452417['interaction']['created']=_0x543b4b;return db[_0x2d6d('0x56')][_0x2d6d('0x4d')]({'body':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x33')],'MailAccountId':_0x33c6b5[_0x2d6d('0x3c')]['id'],'MailInteractionId':_0x2ea00d['id'],'direction':'in','ContactId':_0x452417[_0x2d6d('0x4f')]['id'],'messageId':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x50')],'from':_0x33c6b5['body'][_0x2d6d('0x18')]['from'],'to':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['to'],'cc':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['cc'],'subject':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['subject'],'attach':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['attach'],'Attachments':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x5d')],'originTo':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['originTo'],'originCc':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x5e')],'bcc':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x5f')],'ChatWebsiteId':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')]['ChatWebsiteId']||null,'originChannel':_0x33c6b5[_0x2d6d('0x33')][_0x2d6d('0x18')][_0x2d6d('0x60')]||_0x2d6d('0x61'),'ChatOfflineMessageId':_0x33c6b5['body'][_0x2d6d('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})['then'](function(_0x54b0e0){_0x452417[_0x2d6d('0x18')]=_0x54b0e0;if(!_0x452417[_0x2d6d('0x5c')][_0x2d6d('0x62')]){return;}return db[_0x2d6d('0x63')][_0x2d6d('0x25')]({'attributes':['id',_0x2d6d('0x64')],'where':{'id':_0x452417[_0x2d6d('0x5c')]['UserId']}});})[_0x2d6d('0xf')](function(_0x92da1c){if(_0x92da1c){_0x452417['applications'][_0x2d6d('0x65')]({'id':0x0,'priority':0x0,'app':_0x2d6d('0x66'),'appdata':_0x92da1c['name']+','+(_0x452417[_0x2d6d('0x3c')][_0x2d6d('0x67')]||0xa),'interval':_0x2d6d('0x68')});}if(!_0x452417['interaction'][_0x2d6d('0x69')]){return;}return db[_0x2d6d('0x6a')][_0x2d6d('0x25')]({'attributes':['id',_0x2d6d('0x64')],'where':{'id':_0x452417[_0x2d6d('0x5c')]['queueId']}});})[_0x2d6d('0xf')](function(_0x5de755){if(_0x5de755){_0x452417[_0x2d6d('0x45')][_0x2d6d('0x65')]({'id':0x0,'priority':0x1,'app':_0x2d6d('0x6b'),'appdata':_0x5de755['name']+','+(_0x452417['account'][_0x2d6d('0x6c')]||0x12c),'interval':_0x2d6d('0x68')});}return respondWithRpcPromise('Start',_0x2d6d('0x6d'),_0x452417);})[_0x2d6d('0xf')](function(_0x4952ac){_0x34fc23(_0x4952ac);})[_0x2d6d('0x1a')](function(_0x129d20){_0x11c737(_0x1dae0a[_0x2d6d('0x15')](0x1f4,_0x129d20[_0x2d6d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 7626961..75ccc49 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 _0x43d4=['register','length','mailAccount:','./mailAccount.events','save','remove','update','removeListener'];(function(_0x5ba74f,_0x200bf4){var _0x534d79=function(_0x50521a){while(--_0x50521a){_0x5ba74f['push'](_0x5ba74f['shift']());}};_0x534d79(++_0x200bf4);}(_0x43d4,0x173));var _0x443d=function(_0x5a034b,_0x8676e5){_0x5a034b=_0x5a034b-0x0;var _0x36093f=_0x43d4[_0x5a034b];return _0x36093f;};'use strict';var MailAccountEvents=require(_0x443d('0x0'));var events=[_0x443d('0x1'),_0x443d('0x2'),_0x443d('0x3')];function createListener(_0x3c3d5e,_0x5e9167){return function(_0x54e7f3){_0x5e9167['emit'](_0x3c3d5e,_0x54e7f3);};}function removeListener(_0x2e508e,_0x3269e1){return function(){MailAccountEvents[_0x443d('0x4')](_0x2e508e,_0x3269e1);};}exports[_0x443d('0x5')]=function(_0x4b3123){for(var _0x5df9e0=0x0,_0x244281=events[_0x443d('0x6')];_0x5df9e0<_0x244281;_0x5df9e0++){var _0x5aaba1=events[_0x5df9e0];var _0x5af238=createListener(_0x443d('0x7')+_0x5aaba1,_0x4b3123);MailAccountEvents['on'](_0x5aaba1,_0x5af238);}}; \ No newline at end of file +var _0x1631=['./mailAccount.events','save','emit','removeListener','register','length','mailAccount:'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1631,0x19d));var _0x1163=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x1631[_0x1d1779];return _0x2377e9;};'use strict';var MailAccountEvents=require(_0x1163('0x0'));var events=[_0x1163('0x1'),'remove','update'];function createListener(_0x118695,_0x1eceb7){return function(_0x1a074c){_0x1eceb7[_0x1163('0x2')](_0x118695,_0x1a074c);};}function removeListener(_0x1f1d85,_0xa47945){return function(){MailAccountEvents[_0x1163('0x3')](_0x1f1d85,_0xa47945);};}exports[_0x1163('0x4')]=function(_0x9397da){for(var _0x4febf6=0x0,_0x5a1e9e=events[_0x1163('0x5')];_0x4febf6<_0x5a1e9e;_0x4febf6++){var _0x53522f=events[_0x4febf6];var _0xc522cc=createListener(_0x1163('0x6')+_0x53522f,_0x9397da);MailAccountEvents['on'](_0x53522f,_0xc522cc);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 475e0cf..e9703a4 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 _0x22a4=['show','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated'];(function(_0x4c5f8a,_0x4375ec){var _0x26794c=function(_0xb2c09c){while(--_0xb2c09c){_0x4c5f8a['push'](_0x4c5f8a['shift']());}};_0x26794c(++_0x4375ec);}(_0x22a4,0xaa));var _0x422a=function(_0x6470a2,_0x3b5f44){_0x6470a2=_0x6470a2-0x0;var _0x24ac61=_0x22a4[_0x6470a2];return _0x24ac61;};'use strict';var multer=require('multer');var util=require(_0x422a('0x0'));var path=require(_0x422a('0x1'));var timeout=require('connect-timeout');var express=require(_0x422a('0x2'));var router=express[_0x422a('0x3')]();var fs_extra=require(_0x422a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x422a('0x5'));var controller=require(_0x422a('0x6'));router[_0x422a('0x7')](_0x422a('0x8'),auth[_0x422a('0x9')](),controller[_0x422a('0xa')]);router[_0x422a('0xb')](_0x422a('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x422a('0xc')](_0x422a('0x8'),auth[_0x422a('0x9')](),controller[_0x422a('0xd')]);module[_0x422a('0xe')]=router; \ No newline at end of file +var _0xf465=['../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2e6273,_0x147701){var _0x71ea99=function(_0x14d299){while(--_0x14d299){_0x2e6273['push'](_0x2e6273['shift']());}};_0x71ea99(++_0x147701);}(_0xf465,0x10a));var _0x5f46=function(_0x29fe99,_0x2a4bd8){_0x29fe99=_0x29fe99-0x0;var _0x1d6acf=_0xf465[_0x29fe99];return _0x1d6acf;};'use strict';var multer=require(_0x5f46('0x0'));var util=require(_0x5f46('0x1'));var path=require('path');var timeout=require(_0x5f46('0x2'));var express=require(_0x5f46('0x3'));var router=express[_0x5f46('0x4')]();var fs_extra=require(_0x5f46('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5f46('0x6'));var controller=require(_0x5f46('0x7'));router[_0x5f46('0x8')](_0x5f46('0x9'),auth[_0x5f46('0xa')](),controller['show']);router[_0x5f46('0xb')](_0x5f46('0x9'),auth[_0x5f46('0xa')](),controller[_0x5f46('0xc')]);router[_0x5f46('0xd')](_0x5f46('0x9'),auth[_0x5f46('0xa')](),controller[_0x5f46('0xe')]);module[_0x5f46('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 289cfe8..f99fbb8 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 _0x7481=['noop','sequelize','exports','INTEGER','STRING'];(function(_0x57d45b,_0x4651d5){var _0x4ceefb=function(_0x1cb65f){while(--_0x1cb65f){_0x57d45b['push'](_0x57d45b['shift']());}};_0x4ceefb(++_0x4651d5);}(_0x7481,0x155));var _0x1748=function(_0x5686a4,_0x137a28){_0x5686a4=_0x5686a4-0x0;var _0x9aa8c6=_0x7481[_0x5686a4];return _0x9aa8c6;};'use strict';var Sequelize=require(_0x1748('0x0'));module[_0x1748('0x1')]={'priority':{'type':Sequelize[_0x1748('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1748('0x3')],'allowNull':![],'defaultValue':_0x1748('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1748('0x3')]},'interval':{'type':Sequelize[_0x1748('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa556=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x5bf81f,_0xf3e669){var _0x51a14c=function(_0x48ca9e){while(--_0x48ca9e){_0x5bf81f['push'](_0x5bf81f['shift']());}};_0x51a14c(++_0xf3e669);}(_0xa556,0x1c5));var _0x6a55=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xa556[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0x6a55('0x0'));module[_0x6a55('0x1')]={'priority':{'type':Sequelize[_0x6a55('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6a55('0x3')],'defaultValue':_0x6a55('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c9202d8..27da646 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x416afb,_0x17bd86){var _0x152cf6=function(_0x34fb4b){while(--_0x34fb4b){_0x416afb['push'](_0x416afb['shift']());}};_0x152cf6(++_0x17bd86);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xe706,0xa3));var _0x6e70=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xe706[_0x4a82ac];return _0x58ee97;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index ca4cab0..aaa61b9 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 _0xe98d=['define','MailApplication','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3394a1,_0xbb2dcf){var _0x360342=function(_0x4e0f6c){while(--_0x4e0f6c){_0x3394a1['push'](_0x3394a1['shift']());}};_0x360342(++_0xbb2dcf);}(_0xe98d,0x121));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xde98('0x0'));var logger=require(_0xde98('0x1'))(_0xde98('0x2'));var moment=require(_0xde98('0x3'));var BPromise=require(_0xde98('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde98('0x5'));var rimraf=require(_0xde98('0x6'));var config=require(_0xde98('0x7'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x335ff1,_0xaddfd){return _0x335ff1[_0xde98('0x8')](_0xde98('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xde98('0xa')});}; \ No newline at end of file +var _0x9032=['utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication'];(function(_0x543cd6,_0xfb6a82){var _0xf2764d=function(_0x33b78b){while(--_0x33b78b){_0x543cd6['push'](_0x543cd6['shift']());}};_0xf2764d(++_0xfb6a82);}(_0x9032,0x115));var _0x2903=function(_0x5a3836,_0x4fd915){_0x5a3836=_0x5a3836-0x0;var _0x1bb8c3=_0x9032[_0x5a3836];return _0x1bb8c3;};'use strict';var _=require(_0x2903('0x0'));var util=require(_0x2903('0x1'));var logger=require('../../config/logger')(_0x2903('0x2'));var moment=require('moment');var BPromise=require(_0x2903('0x3'));var rp=require(_0x2903('0x4'));var fs=require('fs');var path=require(_0x2903('0x5'));var rimraf=require(_0x2903('0x6'));var config=require(_0x2903('0x7'));var attributes=require(_0x2903('0x8'));module['exports']=function(_0x53f7a5,_0x28c6c0){return _0x53f7a5[_0x2903('0x9')](_0x2903('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2903('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 8e8e9b3..ac8a557 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 _0xbfeb=['MailApplication','options','raw','where','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailApplication'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xbfeb,0x1aa));var _0xbbfe=function(_0x4f8087,_0x5d110f){_0x4f8087=_0x4f8087-0x0;var _0x285a86=_0xbfeb[_0x4f8087];return _0x285a86;};'use strict';var _=require(_0xbbfe('0x0'));var util=require(_0xbbfe('0x1'));var moment=require(_0xbbfe('0x2'));var BPromise=require(_0xbbfe('0x3'));var rs=require(_0xbbfe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbfe('0x5'))['db'];var utils=require(_0xbbfe('0x6'));var logger=require('../../config/logger')(_0xbbfe('0x7'));var config=require(_0xbbfe('0x8'));var jayson=require(_0xbbfe('0x9'));var client=jayson['client'][_0xbbfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c9893,_0x48327d,_0x5da322){return new BPromise(function(_0x511eb8,_0x54dfdc){return client[_0xbbfe('0xb')](_0x7c9893,_0x5da322)['then'](function(_0x2a5cc8){logger[_0xbbfe('0xc')](_0xbbfe('0xd'),_0x48327d,_0xbbfe('0xe'));logger[_0xbbfe('0xf')](_0xbbfe('0x10'),_0x48327d,_0xbbfe('0xe'),JSON[_0xbbfe('0x11')](_0x2a5cc8));if(_0x2a5cc8[_0xbbfe('0x12')]){if(_0x2a5cc8['error'][_0xbbfe('0x13')]===0x1f4){logger[_0xbbfe('0x12')]('MailApplication,\x20%s,\x20%s',_0x48327d,_0x2a5cc8[_0xbbfe('0x12')]['message']);return _0x54dfdc(_0x2a5cc8['error'][_0xbbfe('0x14')]);}logger[_0xbbfe('0x12')](_0xbbfe('0xd'),_0x48327d,_0x2a5cc8[_0xbbfe('0x12')][_0xbbfe('0x14')]);return _0x511eb8(_0x2a5cc8[_0xbbfe('0x12')][_0xbbfe('0x14')]);}else{logger[_0xbbfe('0xc')](_0xbbfe('0xd'),_0x48327d,_0xbbfe('0xe'));_0x511eb8(_0x2a5cc8['result']['message']);}})['catch'](function(_0x3f5f42){logger[_0xbbfe('0x12')]('MailApplication,\x20%s,\x20%s',_0x48327d,_0x3f5f42);_0x54dfdc(_0x3f5f42);});});}exports[_0xbbfe('0x15')]=function(_0x4b282f){var _0x47be7f=this;return new Promise(function(_0x5ad4bf,_0x544e8b){return db[_0xbbfe('0x16')]['update'](_0x4b282f['body'],{'raw':_0x4b282f['options']?_0x4b282f[_0xbbfe('0x17')][_0xbbfe('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b282f[_0xbbfe('0x17')]?_0x4b282f['options'][_0xbbfe('0x19')]||null:null,'attributes':_0x4b282f[_0xbbfe('0x17')]?_0x4b282f['options']['attributes']||null:null,'limit':_0x4b282f[_0xbbfe('0x17')]?_0x4b282f[_0xbbfe('0x17')][_0xbbfe('0x1a')]||null:null})['then'](function(_0x4ddff4){logger[_0xbbfe('0xc')]('UpdateMailApplication',_0x4b282f);logger[_0xbbfe('0xf')](_0xbbfe('0x15'),_0x4b282f,JSON['stringify'](_0x4ddff4));_0x5ad4bf(_0x4ddff4);})[_0xbbfe('0x1b')](function(_0x117ba2){logger['error']('UpdateMailApplication',_0x117ba2[_0xbbfe('0x14')],_0x4b282f);_0x544e8b(_0x47be7f[_0xbbfe('0x12')](0x1f4,_0x117ba2[_0xbbfe('0x14')]));});});}; \ No newline at end of file +var _0xb494=['update','options','raw','where','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb494,0x69));var _0x4b49=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xb494[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0x4b49('0x0'));var util=require(_0x4b49('0x1'));var moment=require(_0x4b49('0x2'));var BPromise=require(_0x4b49('0x3'));var rs=require(_0x4b49('0x4'));var fs=require('fs');var Redis=require(_0x4b49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b49('0x6'));var logger=require(_0x4b49('0x7'))(_0x4b49('0x8'));var config=require(_0x4b49('0x9'));var jayson=require(_0x4b49('0xa'));var client=jayson[_0x4b49('0xb')][_0x4b49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51a846,_0x1a2eb9,_0x306e34){return new BPromise(function(_0x3e3b9b,_0x218577){return client[_0x4b49('0xd')](_0x51a846,_0x306e34)[_0x4b49('0xe')](function(_0x2a9351){logger[_0x4b49('0xf')](_0x4b49('0x10'),_0x1a2eb9,_0x4b49('0x11'));logger[_0x4b49('0x12')](_0x4b49('0x13'),_0x1a2eb9,_0x4b49('0x11'),JSON[_0x4b49('0x14')](_0x2a9351));if(_0x2a9351[_0x4b49('0x15')]){if(_0x2a9351[_0x4b49('0x15')][_0x4b49('0x16')]===0x1f4){logger['error'](_0x4b49('0x10'),_0x1a2eb9,_0x2a9351[_0x4b49('0x15')][_0x4b49('0x17')]);return _0x218577(_0x2a9351[_0x4b49('0x15')][_0x4b49('0x17')]);}logger['error'](_0x4b49('0x10'),_0x1a2eb9,_0x2a9351[_0x4b49('0x15')][_0x4b49('0x17')]);return _0x3e3b9b(_0x2a9351[_0x4b49('0x15')][_0x4b49('0x17')]);}else{logger[_0x4b49('0xf')](_0x4b49('0x10'),_0x1a2eb9,_0x4b49('0x11'));_0x3e3b9b(_0x2a9351[_0x4b49('0x18')]['message']);}})['catch'](function(_0x3915b3){logger[_0x4b49('0x15')]('MailApplication,\x20%s,\x20%s',_0x1a2eb9,_0x3915b3);_0x218577(_0x3915b3);});});}exports[_0x4b49('0x19')]=function(_0x55f205){var _0x5a591a=this;return new Promise(function(_0xcdcc2,_0xc4025e){return db[_0x4b49('0x1a')][_0x4b49('0x1b')](_0x55f205['body'],{'raw':_0x55f205[_0x4b49('0x1c')]?_0x55f205['options'][_0x4b49('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f205[_0x4b49('0x1c')]?_0x55f205['options'][_0x4b49('0x1e')]||null:null,'attributes':_0x55f205[_0x4b49('0x1c')]?_0x55f205[_0x4b49('0x1c')]['attributes']||null:null,'limit':_0x55f205[_0x4b49('0x1c')]?_0x55f205['options'][_0x4b49('0x1f')]||null:null})['then'](function(_0x9c0c25){logger[_0x4b49('0xf')](_0x4b49('0x19'),_0x55f205);logger['debug'](_0x4b49('0x19'),_0x55f205,JSON[_0x4b49('0x14')](_0x9c0c25));_0xcdcc2(_0x9c0c25);})[_0x4b49('0x20')](function(_0x5d83b8){logger[_0x4b49('0x15')](_0x4b49('0x19'),_0x5d83b8[_0x4b49('0x17')],_0x55f205);_0xc4025e(_0x5a591a[_0x4b49('0x15')](0x1f4,_0x5d83b8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 947e6c9..1c996a9 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 _0x3bab=['/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','mail','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','/:id/tags','exports','express','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','describe'];(function(_0x5a052b,_0x2758f0){var _0x3a3bdb=function(_0x4170ba){while(--_0x4170ba){_0x5a052b['push'](_0x5a052b['shift']());}};_0x3a3bdb(++_0x2758f0);}(_0x3bab,0x1c4));var _0xb3ba=function(_0x1abc7a,_0x5d83c9){_0x1abc7a=_0x1abc7a-0x0;var _0x498347=_0x3bab[_0x1abc7a];return _0x498347;};'use strict';var express=require(_0xb3ba('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb3ba('0x1'));var controller=require(_0xb3ba('0x2'));router[_0xb3ba('0x3')]('/',auth['isAuthenticated'](),controller[_0xb3ba('0x4')]);router['get'](_0xb3ba('0x5'),auth['isAuthenticated'](),controller[_0xb3ba('0x6')]);router['get'](_0xb3ba('0x7'),auth[_0xb3ba('0x8')](),controller[_0xb3ba('0x9')]);router[_0xb3ba('0x3')](_0xb3ba('0xa'),auth[_0xb3ba('0x8')](),controller[_0xb3ba('0xb')]);router[_0xb3ba('0x3')](_0xb3ba('0xc'),auth[_0xb3ba('0x8')](),controller[_0xb3ba('0xd')]);router[_0xb3ba('0xe')]('/',auth[_0xb3ba('0x8')](),controller[_0xb3ba('0xf')]);router[_0xb3ba('0xe')]('/:id/messages',auth[_0xb3ba('0x8')](),controller[_0xb3ba('0x10')]);router[_0xb3ba('0xe')]('/:id/tags',auth[_0xb3ba('0x8')](),interaction[_0xb3ba('0x11')](_0xb3ba('0x12'),'mailinteraction:addtags'),controller[_0xb3ba('0x13')]);router[_0xb3ba('0x14')](_0xb3ba('0x7'),auth[_0xb3ba('0x8')](),interaction[_0xb3ba('0x11')]('mail',_0xb3ba('0x15')),controller[_0xb3ba('0x16')]);router[_0xb3ba('0x17')](_0xb3ba('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0xb3ba('0x12'),_0xb3ba('0x18')),controller['destroy']);router[_0xb3ba('0x17')](_0xb3ba('0x19'),auth['isAuthenticated'](),controller['removeTags']);module[_0xb3ba('0x1a')]=router; \ No newline at end of file +var _0x364b=['mailinteraction:addtags','put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','create','/:id/messages','/:id/tags','tracked','mail'];(function(_0x119c38,_0x167153){var _0x51abb8=function(_0x402dcf){while(--_0x402dcf){_0x119c38['push'](_0x119c38['shift']());}};_0x51abb8(++_0x167153);}(_0x364b,0x140));var _0xb364=function(_0x480843,_0x8121e6){_0x480843=_0x480843-0x0;var _0x1d5cd9=_0x364b[_0x480843];return _0x1d5cd9;};'use strict';var express=require(_0xb364('0x0'));var router=express[_0xb364('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xb364('0x2'));var controller=require(_0xb364('0x3'));router[_0xb364('0x4')]('/',auth[_0xb364('0x5')](),controller['index']);router[_0xb364('0x4')](_0xb364('0x6'),auth[_0xb364('0x5')](),controller[_0xb364('0x7')]);router[_0xb364('0x4')](_0xb364('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xb364('0x4')]('/:id/messages',auth[_0xb364('0x5')](),controller['getMessages']);router[_0xb364('0x4')](_0xb364('0x9'),auth[_0xb364('0x5')](),controller[_0xb364('0xa')]);router['post']('/',auth[_0xb364('0x5')](),controller[_0xb364('0xb')]);router['post'](_0xb364('0xc'),auth[_0xb364('0x5')](),controller['addMessage']);router['post'](_0xb364('0xd'),auth[_0xb364('0x5')](),interaction[_0xb364('0xe')](_0xb364('0xf'),_0xb364('0x10')),controller['addTags']);router[_0xb364('0x11')](_0xb364('0x8'),auth[_0xb364('0x5')](),interaction[_0xb364('0xe')](_0xb364('0xf'),'mailinteraction:update'),controller[_0xb364('0x12')]);router[_0xb364('0x13')]('/:id',auth['isAuthenticated'](),interaction[_0xb364('0xe')](_0xb364('0xf'),_0xb364('0x14')),controller[_0xb364('0x15')]);router[_0xb364('0x13')](_0xb364('0xd'),auth['isAuthenticated'](),controller[_0xb364('0x16')]);module[_0xb364('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a923640..5f61090 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 _0xb1f9=['out','INTEGER','sequelize','exports','BOOLEAN','STRING','TEXT','DATE','ENUM'];(function(_0x1f929d,_0x4fddf2){var _0x33ff30=function(_0x1f0ab5){while(--_0x1f0ab5){_0x1f929d['push'](_0x1f929d['shift']());}};_0x33ff30(++_0x4fddf2);}(_0xb1f9,0x158));var _0x9b1f=function(_0x90dc63,_0x54cfa9){_0x90dc63=_0x90dc63-0x0;var _0xf839e3=_0xb1f9[_0x90dc63];return _0xf839e3;};'use strict';var Sequelize=require(_0x9b1f('0x0'));var iconv=require('iconv');module[_0x9b1f('0x1')]={'closed':{'type':Sequelize[_0x9b1f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9b1f('0x3')]},'secondDisposition':{'type':Sequelize[_0x9b1f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9b1f('0x3')]},'inReplyTo':{'type':Sequelize[_0x9b1f('0x3')](0x1fe)},'to':{'type':Sequelize[_0x9b1f('0x3')]},'cc':{'type':Sequelize[_0x9b1f('0x4')]('long')},'subject':{'type':Sequelize[_0x9b1f('0x4')]()},'attach':{'type':Sequelize[_0x9b1f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9b1f('0x5')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9b1f('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x9b1f('0x6')]('in',_0x9b1f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9b1f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x9b1f('0x6')]('in',_0x9b1f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9b1f('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9b1f('0x8')]}}; \ No newline at end of file +var _0x6276=['iconv','BOOLEAN','STRING','TEXT','DATE','ENUM','out','INTEGER'];(function(_0x1b4a9e,_0x1833a7){var _0x43a962=function(_0x3fd02a){while(--_0x3fd02a){_0x1b4a9e['push'](_0x1b4a9e['shift']());}};_0x43a962(++_0x1833a7);}(_0x6276,0x1a0));var _0x6627=function(_0x44b2f7,_0xf30295){_0x44b2f7=_0x44b2f7-0x0;var _0x315bf1=_0x6276[_0x44b2f7];return _0x315bf1;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x6627('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6627('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6627('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6627('0x2')]},'note':{'type':Sequelize[_0x6627('0x2')]},'inReplyTo':{'type':Sequelize[_0x6627('0x2')](0x1fe)},'to':{'type':Sequelize[_0x6627('0x2')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x6627('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x6627('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6627('0x5')]('in',_0x6627('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6627('0x5')]('in',_0x6627('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6627('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 378681c..fe5565b 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 _0x8e3b=['lodash','juice','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','getOptions','findAll','mail','query','user','catch','show','params','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','MailInteraction','body','describe','MailMessage','addMessage','omit','ids','filters','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','rows','setTags','color','emit','removeTags','unix','toString','root','server','files','tmp','attachments','join','push','Attachment','Attachments','Messages','from','subject','get','mkdirSync','each','missing.recipient@your.company.com','decode','createdAt','bcc','headers','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path'];(function(_0x2577d9,_0x8f2f28){var _0x36fe58=function(_0xbba849){while(--_0xbba849){_0x2577d9['push'](_0x2577d9['shift']());}};_0x36fe58(++_0x8f2f28);}(_0x8e3b,0xdc));var _0xb8e3=function(_0x2f7892,_0x1c26c5){_0x2f7892=_0x2f7892-0x0;var _0x2f9e9c=_0x8e3b[_0x2f7892];return _0x2f9e9c;};'use strict';var emlformat=require(_0xb8e3('0x0'));var rimraf=require(_0xb8e3('0x1'));var zipdir=require(_0xb8e3('0x2'));var moment=require('moment');var BPromise=require(_0xb8e3('0x3'));var util=require(_0xb8e3('0x4'));var path=require(_0xb8e3('0x5'));var fs=require('fs');var _=require(_0xb8e3('0x6'));var juice=require(_0xb8e3('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xb8e3('0x8'));var logger=require(_0xb8e3('0x9'))(_0xb8e3('0xa'));var config=require('../../config/environment');var db=require(_0xb8e3('0xb'))['db'];var htmlEntities=require(_0xb8e3('0xc'));config[_0xb8e3('0xd')]=_['defaults'](config[_0xb8e3('0xd')],{'host':_0xb8e3('0xe'),'port':0x18eb});var socket=require(_0xb8e3('0xf'))(new Redis(config['redis']));require(_0xb8e3('0x10'))[_0xb8e3('0x11')](socket);function respondWithStatusCode(_0x32dda1,_0x119272){_0x119272=_0x119272||0xcc;return function(_0x4bb6d6){if(_0x4bb6d6){return _0x32dda1[_0xb8e3('0x12')](_0x119272);}return _0x32dda1[_0xb8e3('0x13')](_0x119272)[_0xb8e3('0x14')]();};}function respondWithResult(_0x228e65,_0xdc19a2){_0xdc19a2=_0xdc19a2||0xc8;return function(_0x1c0ef7){if(_0x1c0ef7){return _0x228e65[_0xb8e3('0x13')](_0xdc19a2)['json'](_0x1c0ef7);}};}function respondWithFilteredResult(_0x27e7f4,_0x121d03){return function(_0xa5211e){if(_0xa5211e){var _0x47d435=typeof _0x121d03['offset']===_0xb8e3('0x15')&&typeof _0x121d03[_0xb8e3('0x16')]===_0xb8e3('0x15');var _0x392c82=_0xa5211e[_0xb8e3('0x17')];var _0x165a17=_0x47d435?0x0:_0x121d03[_0xb8e3('0x18')];var _0x4886e9=_0x47d435?_0xa5211e[_0xb8e3('0x17')]:_0x121d03['offset']+_0x121d03['limit'];var _0x4f584b;if(_0x4886e9>=_0x392c82){_0x4886e9=_0x392c82;_0x4f584b=0xc8;}else{_0x4f584b=0xce;}_0x27e7f4[_0xb8e3('0x13')](_0x4f584b);return _0x27e7f4[_0xb8e3('0x19')](_0xb8e3('0x1a'),_0x165a17+'-'+_0x4886e9+'/'+_0x392c82)[_0xb8e3('0x1b')](_0xa5211e);}return null;};}function saveUpdates(_0x29bd85){return function(_0x47100c){if(_0x47100c){return _0x47100c[_0xb8e3('0x1c')](_0x29bd85)[_0xb8e3('0x1d')](function(_0x4cc7c0){return _0x4cc7c0;});}return null;};}function removeEntity(_0x5559c3){return function(_0x5527d7){if(_0x5527d7){return _0x5527d7[_0xb8e3('0x1e')]()[_0xb8e3('0x1d')](function(){_0x5559c3[_0xb8e3('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417f57){return function(_0x4d227d){if(!_0x4d227d){_0x417f57[_0xb8e3('0x12')](0x194);}return _0x4d227d;};}function handleError(_0x3c1092,_0x484723){_0x484723=_0x484723||0x1f4;return function(_0x4bccd8){logger[_0xb8e3('0x1f')](_0x4bccd8[_0xb8e3('0x20')]);if(_0x4bccd8['name']){delete _0x4bccd8[_0xb8e3('0x21')];}_0x3c1092[_0xb8e3('0x13')](_0x484723)['send'](_0x4bccd8);};}exports[_0xb8e3('0x22')]=function(_0x4a13fb,_0x43bbe0){var _0x18ccfd={};var _0x4afeb9=_[_0xb8e3('0x23')](db['MailInteraction'][_0xb8e3('0x24')],function(_0xe4b0c6){return{'name':_0xe4b0c6[_0xb8e3('0x25')],'type':_0xe4b0c6[_0xb8e3('0x26')]['key']};});_0x18ccfd=qs[_0xb8e3('0x27')](_0x4afeb9,_0x4a13fb);return interaction[_0xb8e3('0x28')](_0xb8e3('0x29'),_0x4a13fb[_0xb8e3('0x2a')],_0x4a13fb[_0xb8e3('0x2b')],_0x18ccfd,_0x4afeb9)[_0xb8e3('0x1d')](respondWithFilteredResult(_0x43bbe0,_0x18ccfd))[_0xb8e3('0x2c')](handleError(_0x43bbe0,null));};exports[_0xb8e3('0x2d')]=function(_0x158548,_0x244631){var _0x35cd7a={'raw':![],'where':{'id':_0x158548[_0xb8e3('0x2e')]['id']}},_0x5c986a={};_0x5c986a['model']=_['keys'](db['MailInteraction'][_0xb8e3('0x24')]);_0x5c986a[_0xb8e3('0x2a')]=_[_0xb8e3('0x2f')](_0x158548['query']);_0x5c986a['filters']=_[_0xb8e3('0x30')](_0x5c986a[_0xb8e3('0x31')],_0x5c986a[_0xb8e3('0x2a')]);_0x35cd7a[_0xb8e3('0x32')]=_[_0xb8e3('0x30')](_0x5c986a[_0xb8e3('0x31')],qs[_0xb8e3('0x33')](_0x158548[_0xb8e3('0x2a')][_0xb8e3('0x33')]));_0x35cd7a[_0xb8e3('0x32')]=_0x35cd7a[_0xb8e3('0x32')][_0xb8e3('0x34')]?_0x35cd7a[_0xb8e3('0x32')]:_0x5c986a[_0xb8e3('0x31')];if(_0x158548[_0xb8e3('0x2a')][_0xb8e3('0x35')]){_0x35cd7a[_0xb8e3('0x36')]=[{'all':!![]}];}_0x35cd7a=_[_0xb8e3('0x37')]({},_0x35cd7a,_0x158548[_0xb8e3('0x38')]);return db['MailInteraction'][_0xb8e3('0x39')](_0x35cd7a)[_0xb8e3('0x1d')](handleEntityNotFound(_0x244631,null))['then'](respondWithResult(_0x244631,null))['catch'](handleError(_0x244631,null));};exports[_0xb8e3('0x3a')]=function(_0x39aa75,_0x1c7c02){return db[_0xb8e3('0x3b')][_0xb8e3('0x3a')](_0x39aa75[_0xb8e3('0x3c')],{})[_0xb8e3('0x1d')](respondWithResult(_0x1c7c02,0xc9))[_0xb8e3('0x2c')](handleError(_0x1c7c02,null));};exports[_0xb8e3('0x1c')]=function(_0x452882,_0x105296){if(_0x452882[_0xb8e3('0x3c')]['id']){delete _0x452882[_0xb8e3('0x3c')]['id'];}return db[_0xb8e3('0x3b')][_0xb8e3('0x39')]({'where':{'id':_0x452882[_0xb8e3('0x2e')]['id']}})[_0xb8e3('0x1d')](handleEntityNotFound(_0x105296,null))[_0xb8e3('0x1d')](saveUpdates(_0x452882[_0xb8e3('0x3c')],null))[_0xb8e3('0x1d')](respondWithResult(_0x105296,null))[_0xb8e3('0x2c')](handleError(_0x105296,null));};exports[_0xb8e3('0x1e')]=function(_0x1f45f5,_0x1e09d2){return db[_0xb8e3('0x3b')][_0xb8e3('0x39')]({'where':{'id':_0x1f45f5['params']['id']}})[_0xb8e3('0x1d')](handleEntityNotFound(_0x1e09d2,null))['then'](removeEntity(_0x1e09d2,null))[_0xb8e3('0x2c')](handleError(_0x1e09d2,null));};exports['describe']=function(_0xce1c0f,_0x96012d){return db['MailInteraction'][_0xb8e3('0x3d')]()[_0xb8e3('0x1d')](respondWithResult(_0x96012d,null))[_0xb8e3('0x2c')](handleError(_0x96012d,null));};exports['addMessage']=function(_0x2b5d8d,_0x507c87){return db[_0xb8e3('0x3e')][_0xb8e3('0x39')]({'where':{'id':_0x2b5d8d[_0xb8e3('0x2e')]['id']}})[_0xb8e3('0x1d')](handleEntityNotFound(_0x507c87,null))[_0xb8e3('0x1d')](function(_0x349610){if(_0x349610){return _0x349610[_0xb8e3('0x3f')](_0x2b5d8d[_0xb8e3('0x3c')]['ids'],_[_0xb8e3('0x40')](_0x2b5d8d['body'],[_0xb8e3('0x41'),'id'])||{});}})[_0xb8e3('0x1d')](respondWithResult(_0x507c87,null))[_0xb8e3('0x2c')](handleError(_0x507c87,null));};exports['getMessages']=function(_0x2f50d7,_0x3aab39){var _0x43d8d6={'raw':![],'where':{}};var _0xbdf0={};var _0x4078f1={'count':0x0,'rows':[]};return db[_0xb8e3('0x3b')]['findOne']({'where':{'id':_0x2f50d7[_0xb8e3('0x2e')]['id']}})[_0xb8e3('0x1d')](handleEntityNotFound(_0x3aab39,null))[_0xb8e3('0x1d')](function(_0x103155){if(_0x103155){_0xbdf0[_0xb8e3('0x31')]=_[_0xb8e3('0x2f')](db[_0xb8e3('0x3e')][_0xb8e3('0x24')]);_0xbdf0[_0xb8e3('0x2a')]=_[_0xb8e3('0x2f')](_0x2f50d7[_0xb8e3('0x2a')]);_0xbdf0[_0xb8e3('0x42')]=_[_0xb8e3('0x30')](_0xbdf0[_0xb8e3('0x31')],_0xbdf0[_0xb8e3('0x2a')]);_0x43d8d6[_0xb8e3('0x32')]=_[_0xb8e3('0x30')](_0xbdf0[_0xb8e3('0x31')],qs[_0xb8e3('0x33')](_0x2f50d7['query'][_0xb8e3('0x33')]));_0x43d8d6[_0xb8e3('0x32')]=_0x43d8d6[_0xb8e3('0x32')][_0xb8e3('0x34')]?_0x43d8d6[_0xb8e3('0x32')]:_0xbdf0['model'];if(!_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x43')](_0xb8e3('0x44'))){_0x43d8d6[_0xb8e3('0x16')]=qs['limit'](_0x2f50d7['query'][_0xb8e3('0x16')]);_0x43d8d6[_0xb8e3('0x18')]=qs[_0xb8e3('0x18')](_0x2f50d7['query'][_0xb8e3('0x18')]);}_0x43d8d6[_0xb8e3('0x45')]=qs[_0xb8e3('0x46')](_0x2f50d7[_0xb8e3('0x2a')]['sort']);_0x43d8d6[_0xb8e3('0x47')]=qs[_0xb8e3('0x42')](_[_0xb8e3('0x48')](_0x2f50d7[_0xb8e3('0x2a')],_0xbdf0[_0xb8e3('0x42')]));_0x43d8d6['where'][_0xb8e3('0x49')]=_0x103155['id'];if(_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x4a')]){_0x43d8d6[_0xb8e3('0x47')]=_['merge'](_0x43d8d6['where'],{'$or':_[_0xb8e3('0x23')](_0x43d8d6['attributes'],function(_0x1ba7a3){var _0x131b57={};_0x131b57[_0x1ba7a3]={'$like':'%'+_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x4a')]+'%'};return _0x131b57;})});}if(_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x4b')]){var _0x1ea325=_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x4b')][_0xb8e3('0x4c')](',');var _0x3d344e={};_0x3d344e[_0x1ea325[0x0]]={'$gte':moment(_0x1ea325[0x1])[_0xb8e3('0x4d')](_0xb8e3('0x4e'))};_0x43d8d6['where']=_[_0xb8e3('0x37')](_0x43d8d6[_0xb8e3('0x47')],_0x3d344e);}_0x43d8d6=_[_0xb8e3('0x37')]({},_0x43d8d6,_0x2f50d7['options']);return db[_0xb8e3('0x3e')]['count']({'where':_0x43d8d6[_0xb8e3('0x47')]})['then'](function(_0x42d02f){_0x4078f1[_0xb8e3('0x17')]=_0x42d02f;if(_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x35')]){_0x43d8d6['include']=[{'all':!![]}];}return db[_0xb8e3('0x3e')][_0xb8e3('0x28')](_0x43d8d6);})[_0xb8e3('0x1d')](function(_0x1c1bd0){if(_0x2f50d7[_0xb8e3('0x2a')][_0xb8e3('0x4f')]==='true'){for(var _0x2acf3d=0x0;_0x2acf3d<_0x1c1bd0[_0xb8e3('0x34')];_0x2acf3d++){_0x1c1bd0[_0x2acf3d]['body']=juice(_0x1c1bd0[_0x2acf3d]['body']);}}_0x4078f1[_0xb8e3('0x50')]=_0x1c1bd0;return _0x4078f1;});}})['then'](respondWithFilteredResult(_0x3aab39,_0x43d8d6))[_0xb8e3('0x2c')](handleError(_0x3aab39,null));};exports['addTags']=function(_0x2bc890,_0x4ee9af){return db[_0xb8e3('0x3b')]['find']({'where':{'id':_0x2bc890[_0xb8e3('0x2e')]['id']}})[_0xb8e3('0x1d')](handleEntityNotFound(_0x4ee9af,null))[_0xb8e3('0x1d')](function(_0x34612e){if(_0x34612e){return _0x34612e[_0xb8e3('0x51')](_0x2bc890['body'][_0xb8e3('0x41')],_['omit'](_0x2bc890[_0xb8e3('0x3c')],[_0xb8e3('0x41'),'id'])||{})['spread'](function(){return db['Tag'][_0xb8e3('0x28')]({'attributes':['id',_0xb8e3('0x21'),_0xb8e3('0x52')],'where':{'id':_0x2bc890[_0xb8e3('0x3c')][_0xb8e3('0x41')]}});})[_0xb8e3('0x1d')](function(_0x3a8106){socket[_0xb8e3('0x53')]('mailInteractionTags:save',{'id':Number(_0x2bc890[_0xb8e3('0x2e')]['id']),'tags':_0x3a8106||[]});return{'id':Number(_0x2bc890[_0xb8e3('0x2e')]['id']),'tags':_0x3a8106||[]};});}})['then'](respondWithResult(_0x4ee9af,null))[_0xb8e3('0x2c')](handleError(_0x4ee9af,null));};exports[_0xb8e3('0x54')]=function(_0x43b498,_0xe4d9fd){return db[_0xb8e3('0x3b')]['find']({'where':{'id':_0x43b498[_0xb8e3('0x2e')]['id']}})[_0xb8e3('0x1d')](handleEntityNotFound(_0xe4d9fd,null))['then'](function(_0x4735e4){if(_0x4735e4){return _0x4735e4[_0xb8e3('0x54')](_0x43b498[_0xb8e3('0x2a')][_0xb8e3('0x41')]);}})[_0xb8e3('0x1d')](respondWithStatusCode(_0xe4d9fd,null))[_0xb8e3('0x2c')](handleError(_0xe4d9fd,null));};exports['download']=function(_0x14f6c8,_0x473f11){var _0x216ac0=moment()[_0xb8e3('0x55')]()[_0xb8e3('0x56')]();var _0x172663=path['join'](config[_0xb8e3('0x57')],_0xb8e3('0x58'),_0xb8e3('0x59'),_0xb8e3('0x5a'));var _0x262b12=path['join'](config['root'],_0xb8e3('0x58'),'files',_0xb8e3('0x5b'));var _0x326e4c=path[_0xb8e3('0x5c')](_0x172663,_0x216ac0);var _0x1ecfbf=util[_0xb8e3('0x4d')]('transcript-%d-%s.zip',_0x14f6c8['params']['id'],_0x216ac0);var _0x107630=path[_0xb8e3('0x5c')](_0x172663,_0x1ecfbf);var _0x4e27cb=[];if(_0x14f6c8['query'][_0xb8e3('0x5b')]){_0x4e27cb[_0xb8e3('0x5d')]({'model':db[_0xb8e3('0x5e')],'as':_0xb8e3('0x5f'),'raw':!![]});}var _0x57dfb3=[{'model':db[_0xb8e3('0x3e')],'as':_0xb8e3('0x60'),'attributes':['id',_0xb8e3('0x3c'),_0xb8e3('0x61'),'to','cc','bcc',_0xb8e3('0x62'),'createdAt'],'where':{'secret':![]},'order':qs[_0xb8e3('0x46')]('id'),'include':_0x4e27cb}];return db[_0xb8e3('0x3b')][_0xb8e3('0x39')]({'where':{'id':_0x14f6c8['params']['id']},'include':_0x57dfb3})[_0xb8e3('0x1d')](handleEntityNotFound(_0x473f11,null))['then'](function(_0x1f0686){if(_0x1f0686&&_0x1f0686[_0xb8e3('0x60')]){var _0x2760ea=_0x1f0686[_0xb8e3('0x63')]({'plain':!![]});fs[_0xb8e3('0x64')](_0x326e4c);return BPromise[_0xb8e3('0x65')](_0x2760ea[_0xb8e3('0x60')],function(_0x579ec3,_0x257e95){var _0x3be85a={'from':_0x579ec3[_0xb8e3('0x61')],'to':_0x579ec3['to']||_0xb8e3('0x66'),'subject':_0x579ec3['subject'],'html':htmlEntities[_0xb8e3('0x67')](_0x579ec3[_0xb8e3('0x3c')]),'headers':{'Date':moment(_0x579ec3[_0xb8e3('0x68')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x579ec3['cc']){_0x3be85a['headers']['Cc']=_0x579ec3['cc'];}if(_0x579ec3[_0xb8e3('0x69')]){_0x3be85a[_0xb8e3('0x6a')][_0xb8e3('0x6b')]=_0x579ec3[_0xb8e3('0x69')];}return new BPromise(function(_0x5488b7,_0x438312){if(_0x579ec3[_0xb8e3('0x5f')]){for(var _0x4642c4=0x0;_0x4642c4<_0x579ec3[_0xb8e3('0x5f')][_0xb8e3('0x34')];_0x4642c4++){var _0x305037=_0x579ec3[_0xb8e3('0x5f')][_0x4642c4];var _0xf1f4b5=path[_0xb8e3('0x5c')](_0x262b12,_0x305037[_0xb8e3('0x6c')]);if(fs[_0xb8e3('0x6d')](_0xf1f4b5)){_0x3be85a['attachments'][_0xb8e3('0x5d')]({'name':_0x305037['name'],'contentType':_0x305037[_0xb8e3('0x26')],'data':fs['readFileSync'](_0xf1f4b5)});}}}emlformat[_0xb8e3('0x6e')](_0x3be85a,function(_0x1f10d1,_0x473994){if(_0x1f10d1)return _0x438312(_0x1f10d1);fs['writeFileSync'](path[_0xb8e3('0x5c')](_0x326e4c,util[_0xb8e3('0x4d')](_0xb8e3('0x6f'),_0x257e95)),_0x473994);return _0x5488b7(_0x473994);});});})[_0xb8e3('0x1d')](function(){return new BPromise(function(_0x1c8b89,_0x1b2898){zipdir(_0x326e4c,{'saveTo':_0x107630},function(_0x2565f7,_0x1fb459){if(_0x2565f7)return _0x1b2898(_0x2565f7);return _0x1c8b89(_0x1fb459);});})[_0xb8e3('0x1d')](function(){return new BPromise(function(_0x5962a4,_0xc415c){rimraf(_0x326e4c,function(_0x5eb67b){if(_0x5eb67b)_0xc415c(_0x5eb67b);return _0x5962a4();});});})['then'](function(){return _0x473f11['download'](_0x107630,_0x1ecfbf,function(_0x4bcba3){if(!_0x4bcba3)fs[_0xb8e3('0x70')](_0x107630);});});});}else{return _0x473f11[_0xb8e3('0x12')](0xc8);}})['catch'](handleError(_0x473f11,null));}; \ No newline at end of file +var _0xf779=['keys','filters','attributes','intersection','fields','length','includeAll','include','merge','create','body','describe','addMessage','MailMessage','find','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','split','format','options','inlineCss','true','addTags','setTags','Tag','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','type','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','index','map','MailInteraction','rawAttributes','key','getOptions','findAll','mail','query','user','catch','show','params','model'];(function(_0xf2472b,_0x5ce664){var _0x97def6=function(_0x68cd03){while(--_0x68cd03){_0xf2472b['push'](_0xf2472b['shift']());}};_0x97def6(++_0x5ce664);}(_0xf779,0x19c));var _0x9f77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf779[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9f77('0x0'));var rimraf=require(_0x9f77('0x1'));var zipdir=require(_0x9f77('0x2'));var moment=require(_0x9f77('0x3'));var BPromise=require(_0x9f77('0x4'));var util=require(_0x9f77('0x5'));var path=require(_0x9f77('0x6'));var fs=require('fs');var _=require(_0x9f77('0x7'));var juice=require(_0x9f77('0x8'));var Redis=require(_0x9f77('0x9'));var interaction=require(_0x9f77('0xa'));var qs=require(_0x9f77('0xb'));var logger=require(_0x9f77('0xc'))(_0x9f77('0xd'));var config=require(_0x9f77('0xe'));var db=require(_0x9f77('0xf'))['db'];var htmlEntities=require(_0x9f77('0x10'));config[_0x9f77('0x11')]=_[_0x9f77('0x12')](config[_0x9f77('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f77('0x13'))(new Redis(config[_0x9f77('0x11')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1caf0a,_0x121ab7){_0x121ab7=_0x121ab7||0xcc;return function(_0x31a00f){if(_0x31a00f){return _0x1caf0a[_0x9f77('0x14')](_0x121ab7);}return _0x1caf0a[_0x9f77('0x15')](_0x121ab7)['end']();};}function respondWithResult(_0x4e3c7b,_0x16833f){_0x16833f=_0x16833f||0xc8;return function(_0x562b46){if(_0x562b46){return _0x4e3c7b[_0x9f77('0x15')](_0x16833f)[_0x9f77('0x16')](_0x562b46);}};}function respondWithFilteredResult(_0x30019d,_0x2634b2){return function(_0x2ac072){if(_0x2ac072){var _0x5da4d7=typeof _0x2634b2[_0x9f77('0x17')]===_0x9f77('0x18')&&typeof _0x2634b2['limit']===_0x9f77('0x18');var _0x592eeb=_0x2ac072[_0x9f77('0x19')];var _0x3b8520=_0x5da4d7?0x0:_0x2634b2['offset'];var _0x26c070=_0x5da4d7?_0x2ac072[_0x9f77('0x19')]:_0x2634b2['offset']+_0x2634b2[_0x9f77('0x1a')];var _0x2edbab;if(_0x26c070>=_0x592eeb){_0x26c070=_0x592eeb;_0x2edbab=0xc8;}else{_0x2edbab=0xce;}_0x30019d[_0x9f77('0x15')](_0x2edbab);return _0x30019d[_0x9f77('0x1b')](_0x9f77('0x1c'),_0x3b8520+'-'+_0x26c070+'/'+_0x592eeb)[_0x9f77('0x16')](_0x2ac072);}return null;};}function saveUpdates(_0x1d0b54){return function(_0x2570dc){if(_0x2570dc){return _0x2570dc[_0x9f77('0x1d')](_0x1d0b54)[_0x9f77('0x1e')](function(_0x2f9320){return _0x2f9320;});}return null;};}function removeEntity(_0x7d3878){return function(_0x585397){if(_0x585397){return _0x585397[_0x9f77('0x1f')]()[_0x9f77('0x1e')](function(){_0x7d3878['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d34a){return function(_0x2f3748){if(!_0x2f3748){_0x45d34a[_0x9f77('0x14')](0x194);}return _0x2f3748;};}function handleError(_0x473562,_0x5ca34f){_0x5ca34f=_0x5ca34f||0x1f4;return function(_0x2ec10e){logger['error'](_0x2ec10e[_0x9f77('0x20')]);if(_0x2ec10e[_0x9f77('0x21')]){delete _0x2ec10e[_0x9f77('0x21')];}_0x473562['status'](_0x5ca34f)['send'](_0x2ec10e);};}exports[_0x9f77('0x22')]=function(_0x244aaf,_0x83f124){var _0x17b2cc={};var _0x48aea2=_[_0x9f77('0x23')](db[_0x9f77('0x24')][_0x9f77('0x25')],function(_0x51104c){return{'name':_0x51104c['fieldName'],'type':_0x51104c['type'][_0x9f77('0x26')]};});_0x17b2cc=qs[_0x9f77('0x27')](_0x48aea2,_0x244aaf);return interaction[_0x9f77('0x28')](_0x9f77('0x29'),_0x244aaf[_0x9f77('0x2a')],_0x244aaf[_0x9f77('0x2b')],_0x17b2cc,_0x48aea2)[_0x9f77('0x1e')](respondWithFilteredResult(_0x83f124,_0x17b2cc))[_0x9f77('0x2c')](handleError(_0x83f124,null));};exports[_0x9f77('0x2d')]=function(_0x490151,_0x160362){var _0x4425e0={'raw':![],'where':{'id':_0x490151[_0x9f77('0x2e')]['id']}},_0x116759={};_0x116759[_0x9f77('0x2f')]=_[_0x9f77('0x30')](db[_0x9f77('0x24')]['rawAttributes']);_0x116759[_0x9f77('0x2a')]=_[_0x9f77('0x30')](_0x490151['query']);_0x116759[_0x9f77('0x31')]=_['intersection'](_0x116759['model'],_0x116759[_0x9f77('0x2a')]);_0x4425e0[_0x9f77('0x32')]=_[_0x9f77('0x33')](_0x116759[_0x9f77('0x2f')],qs[_0x9f77('0x34')](_0x490151[_0x9f77('0x2a')][_0x9f77('0x34')]));_0x4425e0[_0x9f77('0x32')]=_0x4425e0[_0x9f77('0x32')][_0x9f77('0x35')]?_0x4425e0['attributes']:_0x116759[_0x9f77('0x2f')];if(_0x490151[_0x9f77('0x2a')][_0x9f77('0x36')]){_0x4425e0[_0x9f77('0x37')]=[{'all':!![]}];}_0x4425e0=_[_0x9f77('0x38')]({},_0x4425e0,_0x490151['options']);return db[_0x9f77('0x24')]['find'](_0x4425e0)[_0x9f77('0x1e')](handleEntityNotFound(_0x160362,null))[_0x9f77('0x1e')](respondWithResult(_0x160362,null))[_0x9f77('0x2c')](handleError(_0x160362,null));};exports[_0x9f77('0x39')]=function(_0x25fd34,_0x14f666){return db[_0x9f77('0x24')][_0x9f77('0x39')](_0x25fd34[_0x9f77('0x3a')],{})[_0x9f77('0x1e')](respondWithResult(_0x14f666,0xc9))['catch'](handleError(_0x14f666,null));};exports[_0x9f77('0x1d')]=function(_0x375b86,_0x15f217){if(_0x375b86[_0x9f77('0x3a')]['id']){delete _0x375b86[_0x9f77('0x3a')]['id'];}return db[_0x9f77('0x24')]['find']({'where':{'id':_0x375b86[_0x9f77('0x2e')]['id']}})['then'](handleEntityNotFound(_0x15f217,null))['then'](saveUpdates(_0x375b86[_0x9f77('0x3a')],null))[_0x9f77('0x1e')](respondWithResult(_0x15f217,null))[_0x9f77('0x2c')](handleError(_0x15f217,null));};exports[_0x9f77('0x1f')]=function(_0x24d98d,_0x3c7066){return db[_0x9f77('0x24')]['find']({'where':{'id':_0x24d98d['params']['id']}})[_0x9f77('0x1e')](handleEntityNotFound(_0x3c7066,null))[_0x9f77('0x1e')](removeEntity(_0x3c7066,null))[_0x9f77('0x2c')](handleError(_0x3c7066,null));};exports['describe']=function(_0x411929,_0x302841){return db[_0x9f77('0x24')][_0x9f77('0x3b')]()[_0x9f77('0x1e')](respondWithResult(_0x302841,null))[_0x9f77('0x2c')](handleError(_0x302841,null));};exports[_0x9f77('0x3c')]=function(_0x3fc0fd,_0x366010){return db[_0x9f77('0x3d')][_0x9f77('0x3e')]({'where':{'id':_0x3fc0fd[_0x9f77('0x2e')]['id']}})[_0x9f77('0x1e')](handleEntityNotFound(_0x366010,null))[_0x9f77('0x1e')](function(_0x9e35fc){if(_0x9e35fc){return _0x9e35fc[_0x9f77('0x3c')](_0x3fc0fd[_0x9f77('0x3a')]['ids'],_[_0x9f77('0x3f')](_0x3fc0fd['body'],[_0x9f77('0x40'),'id'])||{});}})['then'](respondWithResult(_0x366010,null))['catch'](handleError(_0x366010,null));};exports[_0x9f77('0x41')]=function(_0x23ce23,_0x577550){var _0x3be847={'raw':![],'where':{}};var _0x517376={};var _0x194e51={'count':0x0,'rows':[]};return db[_0x9f77('0x24')][_0x9f77('0x42')]({'where':{'id':_0x23ce23[_0x9f77('0x2e')]['id']}})[_0x9f77('0x1e')](handleEntityNotFound(_0x577550,null))[_0x9f77('0x1e')](function(_0x178fdf){if(_0x178fdf){_0x517376[_0x9f77('0x2f')]=_[_0x9f77('0x30')](db[_0x9f77('0x3d')]['rawAttributes']);_0x517376[_0x9f77('0x2a')]=_['keys'](_0x23ce23['query']);_0x517376[_0x9f77('0x31')]=_['intersection'](_0x517376['model'],_0x517376['query']);_0x3be847[_0x9f77('0x32')]=_[_0x9f77('0x33')](_0x517376[_0x9f77('0x2f')],qs[_0x9f77('0x34')](_0x23ce23[_0x9f77('0x2a')]['fields']));_0x3be847[_0x9f77('0x32')]=_0x3be847[_0x9f77('0x32')][_0x9f77('0x35')]?_0x3be847[_0x9f77('0x32')]:_0x517376[_0x9f77('0x2f')];if(!_0x23ce23['query'][_0x9f77('0x43')](_0x9f77('0x44'))){_0x3be847[_0x9f77('0x1a')]=qs['limit'](_0x23ce23[_0x9f77('0x2a')][_0x9f77('0x1a')]);_0x3be847['offset']=qs[_0x9f77('0x17')](_0x23ce23[_0x9f77('0x2a')][_0x9f77('0x17')]);}_0x3be847[_0x9f77('0x45')]=qs[_0x9f77('0x46')](_0x23ce23[_0x9f77('0x2a')][_0x9f77('0x46')]);_0x3be847['where']=qs[_0x9f77('0x31')](_[_0x9f77('0x47')](_0x23ce23['query'],_0x517376[_0x9f77('0x31')]));_0x3be847[_0x9f77('0x48')]['MailInteractionId']=_0x178fdf['id'];if(_0x23ce23[_0x9f77('0x2a')][_0x9f77('0x49')]){_0x3be847['where']=_[_0x9f77('0x38')](_0x3be847[_0x9f77('0x48')],{'$or':_[_0x9f77('0x23')](_0x3be847[_0x9f77('0x32')],function(_0x4e1333){var _0x3865b4={};_0x3865b4[_0x4e1333]={'$like':'%'+_0x23ce23[_0x9f77('0x2a')]['filter']+'%'};return _0x3865b4;})});}if(_0x23ce23[_0x9f77('0x2a')][_0x9f77('0x4a')]){var _0x5d86f3=_0x23ce23[_0x9f77('0x2a')]['$gte'][_0x9f77('0x4b')](',');var _0x1d741d={};_0x1d741d[_0x5d86f3[0x0]]={'$gte':moment(_0x5d86f3[0x1])[_0x9f77('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3be847[_0x9f77('0x48')]=_['merge'](_0x3be847['where'],_0x1d741d);}_0x3be847=_[_0x9f77('0x38')]({},_0x3be847,_0x23ce23[_0x9f77('0x4d')]);return db[_0x9f77('0x3d')][_0x9f77('0x19')]({'where':_0x3be847['where']})['then'](function(_0x21b2f0){_0x194e51['count']=_0x21b2f0;if(_0x23ce23['query'][_0x9f77('0x36')]){_0x3be847['include']=[{'all':!![]}];}return db[_0x9f77('0x3d')]['findAll'](_0x3be847);})[_0x9f77('0x1e')](function(_0x2cbaff){if(_0x23ce23[_0x9f77('0x2a')][_0x9f77('0x4e')]===_0x9f77('0x4f')){for(var _0x227441=0x0;_0x227441<_0x2cbaff['length'];_0x227441++){_0x2cbaff[_0x227441]['body']=juice(_0x2cbaff[_0x227441][_0x9f77('0x3a')]);}}_0x194e51['rows']=_0x2cbaff;return _0x194e51;});}})[_0x9f77('0x1e')](respondWithFilteredResult(_0x577550,_0x3be847))['catch'](handleError(_0x577550,null));};exports[_0x9f77('0x50')]=function(_0x4e3c16,_0x27143a){return db['MailInteraction']['find']({'where':{'id':_0x4e3c16[_0x9f77('0x2e')]['id']}})['then'](handleEntityNotFound(_0x27143a,null))[_0x9f77('0x1e')](function(_0x4deeb8){if(_0x4deeb8){return _0x4deeb8[_0x9f77('0x51')](_0x4e3c16[_0x9f77('0x3a')][_0x9f77('0x40')],_[_0x9f77('0x3f')](_0x4e3c16['body'],[_0x9f77('0x40'),'id'])||{})['spread'](function(){return db[_0x9f77('0x52')][_0x9f77('0x28')]({'attributes':['id',_0x9f77('0x21'),'color'],'where':{'id':_0x4e3c16['body']['ids']}});})[_0x9f77('0x1e')](function(_0x4ad80d){socket[_0x9f77('0x53')](_0x9f77('0x54'),{'id':Number(_0x4e3c16[_0x9f77('0x2e')]['id']),'tags':_0x4ad80d||[]});return{'id':Number(_0x4e3c16[_0x9f77('0x2e')]['id']),'tags':_0x4ad80d||[]};});}})[_0x9f77('0x1e')](respondWithResult(_0x27143a,null))[_0x9f77('0x2c')](handleError(_0x27143a,null));};exports['removeTags']=function(_0x3133ce,_0x32015e){return db[_0x9f77('0x24')][_0x9f77('0x3e')]({'where':{'id':_0x3133ce[_0x9f77('0x2e')]['id']}})[_0x9f77('0x1e')](handleEntityNotFound(_0x32015e,null))['then'](function(_0x2d58bb){if(_0x2d58bb){return _0x2d58bb[_0x9f77('0x55')](_0x3133ce[_0x9f77('0x2a')][_0x9f77('0x40')]);}})[_0x9f77('0x1e')](respondWithStatusCode(_0x32015e,null))[_0x9f77('0x2c')](handleError(_0x32015e,null));};exports[_0x9f77('0x56')]=function(_0x3a192f,_0x182cd2){var _0x3a2977=moment()[_0x9f77('0x57')]()[_0x9f77('0x58')]();var _0x5d0044=path[_0x9f77('0x59')](config[_0x9f77('0x5a')],_0x9f77('0x5b'),_0x9f77('0x5c'),_0x9f77('0x5d'));var _0x534fb0=path[_0x9f77('0x59')](config[_0x9f77('0x5a')],_0x9f77('0x5b'),_0x9f77('0x5c'),_0x9f77('0x5e'));var _0x4cf1c1=path['join'](_0x5d0044,_0x3a2977);var _0x1f0d14=util['format']('transcript-%d-%s.zip',_0x3a192f[_0x9f77('0x2e')]['id'],_0x3a2977);var _0x467fbb=path[_0x9f77('0x59')](_0x5d0044,_0x1f0d14);var _0x4f3bbe=[];if(_0x3a192f['query'][_0x9f77('0x5e')]){_0x4f3bbe[_0x9f77('0x5f')]({'model':db[_0x9f77('0x60')],'as':_0x9f77('0x61'),'raw':!![]});}var _0x38137b=[{'model':db[_0x9f77('0x3d')],'as':_0x9f77('0x62'),'attributes':['id','body',_0x9f77('0x63'),'to','cc',_0x9f77('0x64'),_0x9f77('0x65'),_0x9f77('0x66')],'where':{'secret':![]},'order':qs[_0x9f77('0x46')]('id'),'include':_0x4f3bbe}];return db['MailInteraction'][_0x9f77('0x3e')]({'where':{'id':_0x3a192f[_0x9f77('0x2e')]['id']},'include':_0x38137b})['then'](handleEntityNotFound(_0x182cd2,null))[_0x9f77('0x1e')](function(_0x3b99e1){if(_0x3b99e1&&_0x3b99e1[_0x9f77('0x62')]){var _0x2b7bc5=_0x3b99e1[_0x9f77('0x67')]({'plain':!![]});fs['mkdirSync'](_0x4cf1c1);return BPromise[_0x9f77('0x68')](_0x2b7bc5[_0x9f77('0x62')],function(_0x52f1e2,_0x5f0fa4){var _0x3031f8={'from':_0x52f1e2[_0x9f77('0x63')],'to':_0x52f1e2['to']||'missing.recipient@your.company.com','subject':_0x52f1e2[_0x9f77('0x65')],'html':htmlEntities[_0x9f77('0x69')](_0x52f1e2[_0x9f77('0x3a')]),'headers':{'Date':moment(_0x52f1e2['createdAt'])[_0x9f77('0x4c')](_0x9f77('0x6a'))},'attachments':[]};if(_0x52f1e2['cc']){_0x3031f8[_0x9f77('0x6b')]['Cc']=_0x52f1e2['cc'];}if(_0x52f1e2['bcc']){_0x3031f8[_0x9f77('0x6b')][_0x9f77('0x6c')]=_0x52f1e2['bcc'];}return new BPromise(function(_0x46067b,_0xbbced1){if(_0x52f1e2[_0x9f77('0x61')]){for(var _0x47610=0x0;_0x47610<_0x52f1e2['Attachments'][_0x9f77('0x35')];_0x47610++){var _0x3c737b=_0x52f1e2[_0x9f77('0x61')][_0x47610];var _0x2c6116=path['join'](_0x534fb0,_0x3c737b[_0x9f77('0x6d')]);if(fs['existsSync'](_0x2c6116)){_0x3031f8['attachments'][_0x9f77('0x5f')]({'name':_0x3c737b[_0x9f77('0x21')],'contentType':_0x3c737b[_0x9f77('0x6e')],'data':fs[_0x9f77('0x6f')](_0x2c6116)});}}}emlformat['build'](_0x3031f8,function(_0x5900ab,_0x303995){if(_0x5900ab)return _0xbbced1(_0x5900ab);fs[_0x9f77('0x70')](path[_0x9f77('0x59')](_0x4cf1c1,util['format'](_0x9f77('0x71'),_0x5f0fa4)),_0x303995);return _0x46067b(_0x303995);});});})[_0x9f77('0x1e')](function(){return new BPromise(function(_0x5a3e39,_0x2e5117){zipdir(_0x4cf1c1,{'saveTo':_0x467fbb},function(_0x2061f5,_0x5de847){if(_0x2061f5)return _0x2e5117(_0x2061f5);return _0x5a3e39(_0x5de847);});})[_0x9f77('0x1e')](function(){return new BPromise(function(_0x55a4f5,_0x476820){rimraf(_0x4cf1c1,function(_0x18b6b6){if(_0x18b6b6)_0x476820(_0x18b6b6);return _0x55a4f5();});});})['then'](function(){return _0x182cd2[_0x9f77('0x56')](_0x467fbb,_0x1f0d14,function(_0x2650ff){if(!_0x2650ff)fs[_0x9f77('0x72')](_0x467fbb);});});});}else{return _0x182cd2['sendStatus'](0xc8);}})[_0x9f77('0x2c')](handleError(_0x182cd2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8a40e0a..2ccd653 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 _0x57bd=['../../mysqldb','MailInteraction','MailMessage','update','getUsers','then','setDataValue','Users','findAll','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x542549,_0xe44fb1){var _0x66d6df=function(_0x533e7e){while(--_0x533e7e){_0x542549['push'](_0x542549['shift']());}};_0x66d6df(++_0xe44fb1);}(_0x57bd,0x185));var _0xd57b=function(_0x504314,_0x45fd2a){_0x504314=_0x504314-0x0;var _0xf9f9c0=_0x57bd[_0x504314];return _0xf9f9c0;};'use strict';var EventEmitter=require(_0xd57b('0x0'));var MailInteraction=require(_0xd57b('0x1'))['db'][_0xd57b('0x2')];var MailMessage=require(_0xd57b('0x1'))['db'][_0xd57b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd57b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4593e0){return function(_0x233b4a,_0x46a309,_0xf92d25){_0x233b4a[_0xd57b('0x5')]({'attributes':['id'],'raw':!![]})[_0xd57b('0x6')](function(_0x5b7c8c){_0x233b4a[_0xd57b('0x7')](_0xd57b('0x8'),_0x5b7c8c['map'](function(_0x213bb5){return{'id':_0x213bb5['id']};}));return MailMessage[_0xd57b('0x9')]({'where':{'MailInteractionId':_0x233b4a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd57b('0x6')](function(_0x13335d){_0x233b4a['setDataValue']('unreadMessages',_0x13335d['length']);MailInteractionEvents[_0xd57b('0xa')](_0x4593e0+':'+_0x233b4a['id'],_0x233b4a);MailInteractionEvents[_0xd57b('0xa')](_0x4593e0,_0x233b4a);_0xf92d25(null);})[_0xd57b('0xb')](_0xf92d25(null));};}for(var e in events){if(events[_0xd57b('0xc')](e)){var event=events[e];MailInteraction[_0xd57b('0xd')](e,emitEvent(event));}}module[_0xd57b('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0xaa4b=['remove','getUsers','then','setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x37ee5f,_0x11fff5){var _0xdeb38d=function(_0x28436){while(--_0x28436){_0x37ee5f['push'](_0x37ee5f['shift']());}};_0xdeb38d(++_0x11fff5);}(_0xaa4b,0x188));var _0xbaa4=function(_0x1e9754,_0x3750bd){_0x1e9754=_0x1e9754-0x0;var _0x342910=_0xaa4b[_0x1e9754];return _0x342910;};'use strict';var EventEmitter=require(_0xbaa4('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xbaa4('0x1')];var MailMessage=require(_0xbaa4('0x2'))['db'][_0xbaa4('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbaa4('0x4')](0x0);var events={'afterCreate':_0xbaa4('0x5'),'afterUpdate':_0xbaa4('0x6'),'afterDestroy':_0xbaa4('0x7')};function emitEvent(_0x580a75){return function(_0x1c495b,_0x1133d4,_0x53afe3){_0x1c495b[_0xbaa4('0x8')]({'attributes':['id'],'raw':!![]})[_0xbaa4('0x9')](function(_0x580f8c){_0x1c495b[_0xbaa4('0xa')](_0xbaa4('0xb'),_0x580f8c['map'](function(_0x5c7302){return{'id':_0x5c7302['id']};}));return MailMessage[_0xbaa4('0xc')]({'where':{'MailInteractionId':_0x1c495b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4b7269){_0x1c495b['setDataValue']('unreadMessages',_0x4b7269[_0xbaa4('0xd')]);MailInteractionEvents[_0xbaa4('0xe')](_0x580a75+':'+_0x1c495b['id'],_0x1c495b);MailInteractionEvents['emit'](_0x580a75,_0x1c495b);_0x53afe3(null);})[_0xbaa4('0xf')](_0x53afe3(null));};}for(var e in events){if(events[_0xbaa4('0x10')](e)){var event=events[e];MailInteraction[_0xbaa4('0x11')](e,emitEvent(event));}}module[_0xbaa4('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 1890edb..399b4f6 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 _0x8abe=['YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','MailMessage','update','catch','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','closed'];(function(_0x265da3,_0x51c58c){var _0x43842f=function(_0x47ada9){while(--_0x47ada9){_0x265da3['push'](_0x265da3['shift']());}};_0x43842f(++_0x51c58c);}(_0x8abe,0x80));var _0xe8ab=function(_0xbd0ebe,_0x2c0cc3){_0xbd0ebe=_0xbd0ebe-0x0;var _0x32342c=_0x8abe[_0xbd0ebe];return _0x32342c;};'use strict';var _=require('lodash');var util=require(_0xe8ab('0x0'));var logger=require('../../config/logger')(_0xe8ab('0x1'));var moment=require(_0xe8ab('0x2'));var BPromise=require(_0xe8ab('0x3'));var rp=require(_0xe8ab('0x4'));var fs=require('fs');var path=require(_0xe8ab('0x5'));var rimraf=require('rimraf');var config=require(_0xe8ab('0x6'));var attributes=require('./mailInteraction.attributes');module[_0xe8ab('0x7')]=function(_0x3bf3f6,_0x54a572){return _0x3bf3f6[_0xe8ab('0x8')](_0xe8ab('0x9'),attributes,{'tableName':_0xe8ab('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xe8ab('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x549a2e,_0x4371e1,_0x5df535){if(_0x549a2e[_0xe8ab('0xc')]){_0x549a2e[_0xe8ab('0xd')]=moment()[_0xe8ab('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x549a2e[_0xe8ab('0xf')]){_0x549a2e['closedAt']=moment()[_0xe8ab('0xe')](_0xe8ab('0x10'));}_0x5df535(null,_0x4371e1);},'beforeUpdate':function(_0x4360da,_0xa73d6d,_0x424db6){if(_0x4360da[_0xe8ab('0x11')](_0xe8ab('0xc'))){_0x4360da['substatusAt']=_0x4360da[_0xe8ab('0xc')]?moment()[_0xe8ab('0xe')](_0xe8ab('0x10')):null;}if(_0x4360da['changed']('closed')){_0x4360da[_0xe8ab('0x12')]=moment()[_0xe8ab('0xe')](_0xe8ab('0x10'));_0x4360da[_0xe8ab('0xc')]=null;_0x4360da['substatusAt']=null;}_0x424db6(null,_0x4360da);},'afterUpdate':function(_0x9a01c5,_0xf638ec,_0x3491cc){var _0x4665cb=_0x3bf3f6[_0xe8ab('0x13')];var _0x3ffba9=_0x9a01c5[_0xe8ab('0x14')]({'plain':!![]});if(_0x3ffba9[_0xe8ab('0xf')]){return _0x4665cb[_0xe8ab('0x15')][_0xe8ab('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x3ffba9['id']}})['then'](function(){_0x3491cc();})[_0xe8ab('0x17')](function(_0x2ab9c1){_0x3491cc(_0x2ab9c1);});}else{_0x3491cc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7990=['mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','path','rimraf','./mailInteraction.attributes','define'];(function(_0x164597,_0x162cf8){var _0x4c6a2c=function(_0xa9e0af){while(--_0xa9e0af){_0x164597['push'](_0x164597['shift']());}};_0x4c6a2c(++_0x162cf8);}(_0x7990,0xfb));var _0x0799=function(_0x12fbde,_0x3d448c){_0x12fbde=_0x12fbde-0x0;var _0x698ffa=_0x7990[_0x12fbde];return _0x698ffa;};'use strict';var _=require(_0x0799('0x0'));var util=require(_0x0799('0x1'));var logger=require(_0x0799('0x2'))(_0x0799('0x3'));var moment=require(_0x0799('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0799('0x5'));var rimraf=require(_0x0799('0x6'));var config=require('../../config/environment');var attributes=require(_0x0799('0x7'));module['exports']=function(_0x4d6506,_0x16f9a7){return _0x4d6506[_0x0799('0x8')]('MailInteraction',attributes,{'tableName':_0x0799('0x9'),'paranoid':![],'indexes':[{'name':_0x0799('0xa'),'fields':['subject','to'],'type':_0x0799('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3cf0be,_0x437ac7,_0x5a3f2e){if(_0x3cf0be['substatus']){_0x3cf0be[_0x0799('0xc')]=moment()[_0x0799('0xd')](_0x0799('0xe'));}if(_0x3cf0be[_0x0799('0xf')]){_0x3cf0be[_0x0799('0x10')]=moment()[_0x0799('0xd')](_0x0799('0xe'));}_0x5a3f2e(null,_0x437ac7);},'beforeUpdate':function(_0x36b14d,_0x4dfcd6,_0x4d36f4){if(_0x36b14d['changed'](_0x0799('0x11'))){_0x36b14d[_0x0799('0xc')]=_0x36b14d[_0x0799('0x11')]?moment()[_0x0799('0xd')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x36b14d[_0x0799('0x12')](_0x0799('0xf'))){_0x36b14d[_0x0799('0x10')]=moment()[_0x0799('0xd')](_0x0799('0xe'));_0x36b14d[_0x0799('0x11')]=null;_0x36b14d[_0x0799('0xc')]=null;}_0x4d36f4(null,_0x36b14d);},'afterUpdate':function(_0x4ad551,_0xe98311,_0x9decf6){var _0x1eeb97=_0x4d6506[_0x0799('0x13')];var _0x4eb93e=_0x4ad551[_0x0799('0x14')]({'plain':!![]});if(_0x4eb93e[_0x0799('0xf')]){return _0x1eeb97[_0x0799('0x15')][_0x0799('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x4eb93e['id']}})[_0x0799('0x17')](function(){_0x9decf6();})[_0x0799('0x18')](function(_0x4b32ff){_0x9decf6(_0x4b32ff);});}else{_0x9decf6();}}},'charset':_0x0799('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 45bd355..c1fca35 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 _0x1203=['UpdateMailInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','body','options','raw','where','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1203,0x8c));var _0x3120=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1203[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3120('0x0'));var util=require(_0x3120('0x1'));var moment=require(_0x3120('0x2'));var BPromise=require(_0x3120('0x3'));var rs=require(_0x3120('0x4'));var fs=require('fs');var Redis=require(_0x3120('0x5'));var db=require(_0x3120('0x6'))['db'];var utils=require(_0x3120('0x7'));var logger=require(_0x3120('0x8'))(_0x3120('0x9'));var config=require(_0x3120('0xa'));var jayson=require(_0x3120('0xb'));var client=jayson[_0x3120('0xc')][_0x3120('0xd')]({'port':0x232a});config[_0x3120('0xe')]=_[_0x3120('0xf')](config['redis'],{'host':_0x3120('0x10'),'port':0x18eb});var socket=require(_0x3120('0x11'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x6ee01b,_0x39f834,_0x5b2ae3){return new BPromise(function(_0x1493fd,_0x5d0ba8){return client[_0x3120('0x12')](_0x6ee01b,_0x5b2ae3)[_0x3120('0x13')](function(_0x492cda){logger[_0x3120('0x14')](_0x3120('0x15'),_0x39f834,'request\x20sent');logger['debug'](_0x3120('0x16'),_0x39f834,_0x3120('0x17'),JSON[_0x3120('0x18')](_0x492cda));if(_0x492cda[_0x3120('0x19')]){if(_0x492cda[_0x3120('0x19')][_0x3120('0x1a')]===0x1f4){logger[_0x3120('0x19')]('MailInteraction,\x20%s,\x20%s',_0x39f834,_0x492cda[_0x3120('0x19')][_0x3120('0x1b')]);return _0x5d0ba8(_0x492cda[_0x3120('0x19')][_0x3120('0x1b')]);}logger[_0x3120('0x19')](_0x3120('0x15'),_0x39f834,_0x492cda[_0x3120('0x19')]['message']);return _0x1493fd(_0x492cda[_0x3120('0x19')]['message']);}else{logger[_0x3120('0x14')](_0x3120('0x15'),_0x39f834,_0x3120('0x17'));_0x1493fd(_0x492cda[_0x3120('0x1c')][_0x3120('0x1b')]);}})[_0x3120('0x1d')](function(_0x50429){logger['error'](_0x3120('0x15'),_0x39f834,_0x50429);_0x5d0ba8(_0x50429);});});}exports['UpdateMailInteraction']=function(_0x3b7e31){var _0x41d73f=this;return new Promise(function(_0x3bc524,_0x5bfd37){return db[_0x3120('0x1e')]['update'](_0x3b7e31[_0x3120('0x1f')],{'raw':_0x3b7e31[_0x3120('0x20')]?_0x3b7e31['options'][_0x3120('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b7e31[_0x3120('0x20')]?_0x3b7e31[_0x3120('0x20')][_0x3120('0x22')]||null:null,'attributes':_0x3b7e31['options']?_0x3b7e31[_0x3120('0x20')]['attributes']||null:null,'limit':_0x3b7e31[_0x3120('0x20')]?_0x3b7e31[_0x3120('0x20')][_0x3120('0x23')]||null:null})['then'](function(_0x5454f2){logger[_0x3120('0x14')](_0x3120('0x24'),_0x3b7e31);logger['debug'](_0x3120('0x24'),_0x3b7e31,JSON[_0x3120('0x18')](_0x5454f2));_0x3bc524(_0x5454f2);})[_0x3120('0x1d')](function(_0x4bc011){logger[_0x3120('0x19')](_0x3120('0x24'),_0x4bc011[_0x3120('0x1b')],_0x3b7e31);_0x5bfd37(_0x41d73f[_0x3120('0x19')](0x1f4,_0x4bc011['message']));});});};exports['AddTagsToMailInteraction']=function(_0x5b3050){return new Promise(function(_0x17c138,_0x5444ec){return db[_0x3120('0x1e')][_0x3120('0x25')]({'where':_0x5b3050[_0x3120('0x20')]?_0x5b3050[_0x3120('0x20')][_0x3120('0x22')]||null:null})[_0x3120('0x13')](function(_0x4f2bc6){if(_0x4f2bc6){return _0x4f2bc6[_0x3120('0x26')](_0x5b3050[_0x3120('0x1f')][_0x3120('0x27')],_[_0x3120('0x28')](_0x5b3050[_0x3120('0x1f')],[_0x3120('0x27'),'id'])||{});}})[_0x3120('0x29')](function(_0x19ade0){logger['info']('AddTags',_0x5b3050);logger[_0x3120('0x2a')](_0x3120('0x2b'),_0x5b3050,JSON[_0x3120('0x18')](_0x19ade0));_0x17c138(_0x19ade0);})[_0x3120('0x1d')](function(_0x41ba6f){logger[_0x3120('0x19')]('AddTags',_0x41ba6f[_0x3120('0x1b')],_0x5b3050);_0x5444ec(_this[_0x3120('0x19')](0x1f4,_0x41ba6f[_0x3120('0x1b')]));});});}; \ No newline at end of file +var _0x1bb0=['./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','catch','AddTagsToMailInteraction','find','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter'];(function(_0x12d5a5,_0x440b27){var _0x34efef=function(_0x190fbf){while(--_0x190fbf){_0x12d5a5['push'](_0x12d5a5['shift']());}};_0x34efef(++_0x440b27);}(_0x1bb0,0xc9));var _0x01bb=function(_0x519f11,_0x429aee){_0x519f11=_0x519f11-0x0;var _0x464e4d=_0x1bb0[_0x519f11];return _0x464e4d;};'use strict';var _=require(_0x01bb('0x0'));var util=require('util');var moment=require(_0x01bb('0x1'));var BPromise=require(_0x01bb('0x2'));var rs=require(_0x01bb('0x3'));var fs=require('fs');var Redis=require(_0x01bb('0x4'));var db=require(_0x01bb('0x5'))['db'];var utils=require(_0x01bb('0x6'));var logger=require(_0x01bb('0x7'))(_0x01bb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x01bb('0x9')][_0x01bb('0xa')]({'port':0x232a});config[_0x01bb('0xb')]=_[_0x01bb('0xc')](config[_0x01bb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x01bb('0xd'))(new Redis(config['redis']));require(_0x01bb('0xe'))[_0x01bb('0xf')](socket);function respondWithRpcPromise(_0x38e371,_0x5e6252,_0x4cf991){return new BPromise(function(_0x40dca3,_0x159c6b){return client[_0x01bb('0x10')](_0x38e371,_0x4cf991)[_0x01bb('0x11')](function(_0x5ab6eb){logger[_0x01bb('0x12')](_0x01bb('0x13'),_0x5e6252,_0x01bb('0x14'));logger[_0x01bb('0x15')](_0x01bb('0x16'),_0x5e6252,_0x01bb('0x14'),JSON[_0x01bb('0x17')](_0x5ab6eb));if(_0x5ab6eb[_0x01bb('0x18')]){if(_0x5ab6eb[_0x01bb('0x18')][_0x01bb('0x19')]===0x1f4){logger[_0x01bb('0x18')](_0x01bb('0x13'),_0x5e6252,_0x5ab6eb[_0x01bb('0x18')][_0x01bb('0x1a')]);return _0x159c6b(_0x5ab6eb['error']['message']);}logger[_0x01bb('0x18')]('MailInteraction,\x20%s,\x20%s',_0x5e6252,_0x5ab6eb[_0x01bb('0x18')][_0x01bb('0x1a')]);return _0x40dca3(_0x5ab6eb[_0x01bb('0x18')][_0x01bb('0x1a')]);}else{logger[_0x01bb('0x12')](_0x01bb('0x13'),_0x5e6252,'request\x20sent');_0x40dca3(_0x5ab6eb[_0x01bb('0x1b')][_0x01bb('0x1a')]);}})['catch'](function(_0x38a681){logger[_0x01bb('0x18')](_0x01bb('0x13'),_0x5e6252,_0x38a681);_0x159c6b(_0x38a681);});});}exports[_0x01bb('0x1c')]=function(_0x306c16){var _0x427387=this;return new Promise(function(_0x543120,_0x3be9be){return db[_0x01bb('0x1d')][_0x01bb('0x1e')](_0x306c16[_0x01bb('0x1f')],{'raw':_0x306c16[_0x01bb('0x20')]?_0x306c16['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306c16['options']?_0x306c16['options'][_0x01bb('0x21')]||null:null,'attributes':_0x306c16['options']?_0x306c16[_0x01bb('0x20')][_0x01bb('0x22')]||null:null,'limit':_0x306c16[_0x01bb('0x20')]?_0x306c16['options'][_0x01bb('0x23')]||null:null})[_0x01bb('0x11')](function(_0x544f98){logger['info'](_0x01bb('0x1c'),_0x306c16);logger[_0x01bb('0x15')]('UpdateMailInteraction',_0x306c16,JSON[_0x01bb('0x17')](_0x544f98));_0x543120(_0x544f98);})[_0x01bb('0x24')](function(_0x347af4){logger[_0x01bb('0x18')]('UpdateMailInteraction',_0x347af4['message'],_0x306c16);_0x3be9be(_0x427387[_0x01bb('0x18')](0x1f4,_0x347af4[_0x01bb('0x1a')]));});});};exports[_0x01bb('0x25')]=function(_0x17f7a1){return new Promise(function(_0x19fdd1,_0x51921a){return db[_0x01bb('0x1d')][_0x01bb('0x26')]({'where':_0x17f7a1[_0x01bb('0x20')]?_0x17f7a1[_0x01bb('0x20')][_0x01bb('0x21')]||null:null})['then'](function(_0x4f76d1){if(_0x4f76d1){return _0x4f76d1['addTags'](_0x17f7a1[_0x01bb('0x1f')][_0x01bb('0x27')],_[_0x01bb('0x28')](_0x17f7a1['body'],[_0x01bb('0x27'),'id'])||{});}})[_0x01bb('0x29')](function(_0x434dc5){logger[_0x01bb('0x12')](_0x01bb('0x2a'),_0x17f7a1);logger[_0x01bb('0x15')](_0x01bb('0x2a'),_0x17f7a1,JSON[_0x01bb('0x17')](_0x434dc5));_0x19fdd1(_0x434dc5);})[_0x01bb('0x24')](function(_0x3a4169){logger['error']('AddTags',_0x3a4169[_0x01bb('0x1a')],_0x17f7a1);_0x51921a(_this[_0x01bb('0x18')](0x1f4,_0x3a4169[_0x01bb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 1aa498b..bb3241b 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 _0x41b3=['mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener','register'];(function(_0xaeb17a,_0x176827){var _0x205ada=function(_0x2e62fb){while(--_0x2e62fb){_0xaeb17a['push'](_0xaeb17a['shift']());}};_0x205ada(++_0x176827);}(_0x41b3,0x120));var _0x341b=function(_0x53a10e,_0x3bf42a){_0x53a10e=_0x53a10e-0x0;var _0x43626a=_0x41b3[_0x53a10e];return _0x43626a;};'use strict';var MailInteractionEvents=require(_0x341b('0x0'));var events=['save',_0x341b('0x1'),_0x341b('0x2')];function createListener(_0x3a9e3b,_0x4f0616){return function(_0x5dc072){_0x4f0616[_0x341b('0x3')](_0x3a9e3b,_0x5dc072);};}function removeListener(_0x4f17cc,_0x343d8a){return function(){MailInteractionEvents[_0x341b('0x4')](_0x4f17cc,_0x343d8a);};}exports[_0x341b('0x5')]=function(_0x3d221e){for(var _0x461f33=0x0,_0x1118c2=events['length'];_0x461f33<_0x1118c2;_0x461f33++){var _0x4a886b=events[_0x461f33];var _0x527596=createListener(_0x341b('0x6')+_0x4a886b,_0x3d221e);MailInteractionEvents['on'](_0x4a886b,_0x527596);}}; \ No newline at end of file +var _0xb7f4=['./mailInteraction.events','remove','update','emit','length'];(function(_0x41be01,_0x39a398){var _0x34677c=function(_0x215e7c){while(--_0x215e7c){_0x41be01['push'](_0x41be01['shift']());}};_0x34677c(++_0x39a398);}(_0xb7f4,0x181));var _0x4b7f=function(_0x52b2dc,_0x532f7e){_0x52b2dc=_0x52b2dc-0x0;var _0x2d82b5=_0xb7f4[_0x52b2dc];return _0x2d82b5;};'use strict';var MailInteractionEvents=require(_0x4b7f('0x0'));var events=['save',_0x4b7f('0x1'),_0x4b7f('0x2')];function createListener(_0x8e506d,_0x48f40b){return function(_0x427037){_0x48f40b[_0x4b7f('0x3')](_0x8e506d,_0x427037);};}function removeListener(_0xfa8a39,_0x18ac1d){return function(){MailInteractionEvents['removeListener'](_0xfa8a39,_0x18ac1d);};}exports['register']=function(_0x33697c){for(var _0x5dcb72=0x0,_0x303e35=events[_0x4b7f('0x4')];_0x5dcb72<_0x303e35;_0x5dcb72++){var _0x45ca9e=events[_0x5dcb72];var _0x54b313=createListener('mailInteraction:'+_0x45ca9e,_0x33697c);MailInteractionEvents['on'](_0x45ca9e,_0x54b313);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index d196f8d..6b8ebe0 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6363=['describe','exports','express','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe','isAuthenticated'];(function(_0x23ef1f,_0x127dd2){var _0x234192=function(_0x2d83da){while(--_0x2d83da){_0x23ef1f['push'](_0x23ef1f['shift']());}};_0x234192(++_0x127dd2);}(_0x6363,0x13a));var _0x3636=function(_0x18bb47,_0x5b04db){_0x18bb47=_0x18bb47-0x0;var _0x3a5548=_0x6363[_0x18bb47];return _0x3a5548;};'use strict';var express=require(_0x3636('0x0'));var router=express['Router']();var auth=require(_0x3636('0x1'));var controller=require(_0x3636('0x2'));router[_0x3636('0x3')](_0x3636('0x4'),auth[_0x3636('0x5')](),controller[_0x3636('0x6')]);module[_0x3636('0x7')]=router; \ No newline at end of file +var _0x0183=['/describe','isAuthenticated','describe','exports','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x0183,0x1e1));var _0x3018=function(_0x4c4b2f,_0x3aeef6){_0x4c4b2f=_0x4c4b2f-0x0;var _0x4cc593=_0x0183[_0x4c4b2f];return _0x4cc593;};'use strict';var express=require(_0x3018('0x0'));var router=express[_0x3018('0x1')]();var auth=require(_0x3018('0x2'));var controller=require(_0x3018('0x3'));router[_0x3018('0x4')](_0x3018('0x5'),auth[_0x3018('0x6')](),controller[_0x3018('0x7')]);module[_0x3018('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index bb2b130..5e0989f 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x1b9f85,_0x3226bd){var _0x1b4e77=function(_0x115594){while(--_0x115594){_0x1b9f85['push'](_0x1b9f85['shift']());}};_0x1b4e77(++_0x3226bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x4256eb,_0x3e88c5){var _0x37dec0=function(_0x5b08c1){while(--_0x5b08c1){_0x4256eb['push'](_0x4256eb['shift']());}};_0x37dec0(++_0x3e88c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 2791c89..c7377a4 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f42=['exports','INTEGER','sequelize'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x0f42,0x1e5));var _0x20f4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0f42[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x20f4('0x0'));module[_0x20f4('0x1')]={'MailInteractionId':{'type':Sequelize[_0x20f4('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x20f4('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x5687=['exports','INTEGER'];(function(_0x3ae63b,_0x5c25cc){var _0x1d83d5=function(_0xfcd66b){while(--_0xfcd66b){_0x3ae63b['push'](_0x3ae63b['shift']());}};_0x1d83d5(++_0x5c25cc);}(_0x5687,0x6a));var _0x7568=function(_0x2b9757,_0x3bbf51){_0x2b9757=_0x2b9757-0x0;var _0x1422c9=_0x5687[_0x2b9757];return _0x1422c9;};'use strict';var Sequelize=require('sequelize');module[_0x7568('0x0')]={'MailInteractionId':{'type':Sequelize[_0x7568('0x1')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x7568('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 8748538..ef803f9 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac14=['./mailInteractionHasTag','define','mail_interaction_has_tags'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xac14,0x1f2));var _0x4ac1=function(_0x5f3225,_0x5c2fae){_0x5f3225=_0x5f3225-0x0;var _0x17d2a7=_0xac14[_0x5f3225];return _0x17d2a7;};'use strict';var attributes=require(_0x4ac1('0x0'));module['exports']=function(_0x1ef26c){return _0x1ef26c[_0x4ac1('0x1')]('MailInteractionHasTag',attributes,{'tableName':_0x4ac1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2def=['mail_interaction_has_tags','./mailInteractionHasTag','exports','define','MailInteractionHasTag'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x2def,0xa6));var _0xf2de=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2def[_0x6c993a];return _0x27f547;};'use strict';var attributes=require(_0xf2de('0x0'));module[_0xf2de('0x1')]=function(_0x5542e0){return _0x5542e0[_0xf2de('0x2')](_0xf2de('0x3'),attributes,{'tableName':_0xf2de('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0fce719..84c4b66 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 _0x19ea=['/:id/reject','reject','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','tracked','mail','create','put','update','/:id/accept','accept'];(function(_0x4719a8,_0x10052c){var _0x12f2e1=function(_0x484124){while(--_0x484124){_0x4719a8['push'](_0x4719a8['shift']());}};_0x12f2e1(++_0x10052c);}(_0x19ea,0xfe));var _0xa19e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x19ea[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xa19e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa19e('0x1'));var express=require('express');var router=express[_0xa19e('0x2')]();var fs_extra=require(_0xa19e('0x3'));var auth=require(_0xa19e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa19e('0x5'));router[_0xa19e('0x6')]('/',auth[_0xa19e('0x7')](),controller[_0xa19e('0x8')]);router[_0xa19e('0x6')](_0xa19e('0x9'),auth[_0xa19e('0x7')](),controller[_0xa19e('0xa')]);router[_0xa19e('0x6')](_0xa19e('0xb'),auth[_0xa19e('0x7')](),controller['show']);router[_0xa19e('0x6')](_0xa19e('0xc'),auth[_0xa19e('0x7')](),controller[_0xa19e('0xd')]);router['post']('/',auth[_0xa19e('0x7')](),interaction[_0xa19e('0xe')](_0xa19e('0xf'),'mailmessage:create'),controller[_0xa19e('0x10')]);router[_0xa19e('0x11')](_0xa19e('0xb'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x12')]);router['put'](_0xa19e('0x13'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x14')]);router[_0xa19e('0x11')](_0xa19e('0x15'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x16')]);router[_0xa19e('0x17')](_0xa19e('0xb'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9993=['update','/:id/accept','accept','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put'];(function(_0x5a3ece,_0x5a5745){var _0x1e8f40=function(_0x5a5b3a){while(--_0x5a5b3a){_0x5a3ece['push'](_0x5a3ece['shift']());}};_0x1e8f40(++_0x5a5745);}(_0x9993,0x109));var _0x3999=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x9993[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0x3999('0x0'));var util=require('util');var path=require(_0x3999('0x1'));var timeout=require(_0x3999('0x2'));var express=require(_0x3999('0x3'));var router=express['Router']();var fs_extra=require(_0x3999('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3999('0x5'));var config=require(_0x3999('0x6'));var controller=require(_0x3999('0x7'));router['get']('/',auth[_0x3999('0x8')](),controller[_0x3999('0x9')]);router['get'](_0x3999('0xa'),auth[_0x3999('0x8')](),controller['describe']);router[_0x3999('0xb')](_0x3999('0xc'),auth['isAuthenticated'](),controller[_0x3999('0xd')]);router['get'](_0x3999('0xe'),auth[_0x3999('0x8')](),controller['download']);router[_0x3999('0xf')]('/',auth[_0x3999('0x8')](),interaction[_0x3999('0x10')](_0x3999('0x11'),_0x3999('0x12')),controller[_0x3999('0x13')]);router[_0x3999('0x14')]('/:id',auth[_0x3999('0x8')](),controller[_0x3999('0x15')]);router['put'](_0x3999('0x16'),auth[_0x3999('0x8')](),controller[_0x3999('0x17')]);router[_0x3999('0x14')]('/:id/reject',auth[_0x3999('0x8')](),controller['reject']);router[_0x3999('0x18')]('/:id',auth[_0x3999('0x8')](),controller['destroy']);module[_0x3999('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 50c065a..fc6d7ba 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 _0x8e6f=['lodash','exports','TEXT','medium','BOOLEAN','STRING','long','INTEGER','Email','Chat'];(function(_0x31b520,_0x94c392){var _0xac3109=function(_0x2f7976){while(--_0x2f7976){_0x31b520['push'](_0x31b520['shift']());}};_0xac3109(++_0x94c392);}(_0x8e6f,0x1cc));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf8e6('0x0'));module[_0xf8e6('0x1')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf8e6('0x2')](_0xf8e6('0x3'))},'read':{'type':Sequelize[_0xf8e6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf8e6('0x5')](0x1fe)},'from':{'type':Sequelize[_0xf8e6('0x5')]},'to':{'type':Sequelize[_0xf8e6('0x2')](_0xf8e6('0x6'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0xf8e6('0x2')](_0xf8e6('0x6'))},'subject':{'type':Sequelize[_0xf8e6('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xf8e6('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf8e6('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xf8e6('0x2')](_0xf8e6('0x6'))},'originCc':{'type':Sequelize[_0xf8e6('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0xf8e6('0x8'),_0xf8e6('0x9')),'defaultValue':_0xf8e6('0x8'),'allowNull':![]}}; \ No newline at end of file +var _0x8719=['out','STRING','DATE','INTEGER','BOOLEAN','Chat','Email','sequelize','exports','TEXT','long','medium','ENUM'];(function(_0x2b9c4a,_0x5f5a37){var _0x52cd31=function(_0x4c7063){while(--_0x4c7063){_0x2b9c4a['push'](_0x2b9c4a['shift']());}};_0x52cd31(++_0x5f5a37);}(_0x8719,0xe4));var _0x9871=function(_0x4b77cc,_0xd14aaf){_0x4b77cc=_0x4b77cc-0x0;var _0xbb10bd=_0x8719[_0x4b77cc];return _0xbb10bd;};'use strict';var Sequelize=require(_0x9871('0x0'));var _=require('lodash');module[_0x9871('0x1')]={'body':{'type':Sequelize[_0x9871('0x2')](_0x9871('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x9871('0x2')](_0x9871('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9871('0x5')]('in',_0x9871('0x6')),'defaultValue':_0x9871('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9871('0x7')](0x1fe)},'from':{'type':Sequelize[_0x9871('0x7')]},'to':{'type':Sequelize[_0x9871('0x2')]('long')},'cc':{'type':Sequelize[_0x9871('0x2')]('long')},'bcc':{'type':Sequelize[_0x9871('0x2')](_0x9871('0x3'))},'subject':{'type':Sequelize[_0x9871('0x2')]},'sentAt':{'type':Sequelize[_0x9871('0x8')]},'attach':{'type':Sequelize[_0x9871('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9871('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x9871('0x2')]('long')},'originCc':{'type':Sequelize[_0x9871('0x2')](_0x9871('0x3'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0x9871('0xb')),'defaultValue':_0x9871('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 33c4d99..66056d5 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 _0x6011=['model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','show','params','fields','update','body','find','describe','create','direction','out','split','MailAccount','MailAccountId','List','CmContact','Contacts','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','format','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','fromString','download','unix','toString','server','files','from','createdAt','Attachment','Attachments','subject','decode','Bcc','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','redis','defaults','localhost','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key'];(function(_0x522937,_0x220b6a){var _0x28e136=function(_0x277202){while(--_0x277202){_0x522937['push'](_0x522937['shift']());}};_0x28e136(++_0x220b6a);}(_0x6011,0x100));var _0x1601=function(_0x165117,_0x50288a){_0x165117=_0x165117-0x0;var _0x3fe394=_0x6011[_0x165117];return _0x3fe394;};'use strict';var emlformat=require(_0x1601('0x0'));var moment=require(_0x1601('0x1'));var BPromise=require('bluebird');var util=require(_0x1601('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x1601('0x3'));var Redis=require(_0x1601('0x4'));var htmlToText=require(_0x1601('0x5'));var qs=require(_0x1601('0x6'));var logger=require(_0x1601('0x7'))('api');var interaction_log=require(_0x1601('0x7'))(_0x1601('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1601('0x9')]=_[_0x1601('0xa')](config[_0x1601('0x9')],{'host':_0x1601('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1601('0x9')]));var htmlEntities=require(_0x1601('0xc'));require('./mailMessage.socket')[_0x1601('0xd')](socket);var jayson=require(_0x1601('0xe'));var client=jayson[_0x1601('0xf')][_0x1601('0x10')]({'port':0x232c});var client9003=jayson[_0x1601('0xf')][_0x1601('0x10')]({'port':0x232b});var client9002=jayson[_0x1601('0xf')][_0x1601('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x15d074,_0x58a4bf,_0x517755,_0x12727e){return new BPromise(function(_0x108cd2,_0x3dd619){var _0x25a782=_0x12727e||client;return _0x25a782[_0x1601('0x11')](_0x15d074,_0x517755)[_0x1601('0x12')](function(_0x552dfa){logger[_0x1601('0x13')](_0x1601('0x14'),_0x58a4bf,_0x1601('0x15'));logger[_0x1601('0x16')](_0x1601('0x17'),_0x58a4bf,_0x1601('0x15'),JSON[_0x1601('0x18')](_0x552dfa));if(_0x552dfa[_0x1601('0x19')]){if(_0x552dfa[_0x1601('0x19')][_0x1601('0x1a')]===0x1f4){logger[_0x1601('0x19')](_0x1601('0x14'),_0x58a4bf,_0x552dfa[_0x1601('0x19')][_0x1601('0x1b')]);return _0x3dd619(_0x552dfa[_0x1601('0x19')]['message']);}logger[_0x1601('0x19')](_0x1601('0x14'),_0x58a4bf,_0x552dfa[_0x1601('0x19')]['message']);return _0x108cd2(_0x552dfa[_0x1601('0x19')][_0x1601('0x1b')]);}else{logger[_0x1601('0x13')]('MailMessage,\x20%s,\x20%s',_0x58a4bf,_0x1601('0x15'));_0x108cd2(_0x552dfa[_0x1601('0x1c')][_0x1601('0x1b')]);}})[_0x1601('0x1d')](function(_0x2fc150){logger[_0x1601('0x19')]('MailMessage,\x20%s,\x20%s',_0x58a4bf,_0x2fc150);_0x3dd619(_0x2fc150);});});}function respondWithResult(_0x22d540,_0x37bed5){_0x37bed5=_0x37bed5||0xc8;return function(_0x47c67f){if(_0x47c67f){return _0x22d540[_0x1601('0x1e')](_0x37bed5)[_0x1601('0x1f')](_0x47c67f);}};}function respondWithFilteredResult(_0x58e7f0,_0x4f09bb){return function(_0x5c8dfd){if(_0x5c8dfd){var _0x1a1c38=typeof _0x4f09bb['offset']===_0x1601('0x20')&&typeof _0x4f09bb[_0x1601('0x21')]===_0x1601('0x20');var _0x352920=_0x5c8dfd[_0x1601('0x22')];var _0x2d8648=_0x1a1c38?0x0:_0x4f09bb['offset'];var _0xdc7085=_0x1a1c38?_0x5c8dfd[_0x1601('0x22')]:_0x4f09bb[_0x1601('0x23')]+_0x4f09bb['limit'];var _0x24d548;if(_0xdc7085>=_0x352920){_0xdc7085=_0x352920;_0x24d548=0xc8;}else{_0x24d548=0xce;}_0x58e7f0[_0x1601('0x1e')](_0x24d548);return _0x58e7f0[_0x1601('0x24')](_0x1601('0x25'),_0x2d8648+'-'+_0xdc7085+'/'+_0x352920)['json'](_0x5c8dfd);}return null;};}function saveUpdates(_0x445070){return function(_0x39a774){if(_0x39a774){return _0x39a774['update'](_0x445070)[_0x1601('0x12')](function(_0xa3995c){return _0xa3995c;});}return null;};}function removeEntity(_0x179984){return function(_0x5f783){if(_0x5f783){return _0x5f783['destroy']()[_0x1601('0x12')](function(){_0x179984[_0x1601('0x1e')](0xcc)[_0x1601('0x26')]();});}};}function handleEntityNotFound(_0x351837){return function(_0x516bc5){if(!_0x516bc5){_0x351837[_0x1601('0x27')](0x194);}return _0x516bc5;};}function handleError(_0x89b2f4,_0x49f8ab){_0x49f8ab=_0x49f8ab||0x1f4;return function(_0x1d7ab3){logger['error'](_0x1d7ab3[_0x1601('0x28')]);if(_0x1d7ab3[_0x1601('0x29')]){delete _0x1d7ab3['name'];}_0x89b2f4[_0x1601('0x1e')](_0x49f8ab)[_0x1601('0x2a')](_0x1d7ab3);};}exports[_0x1601('0x2b')]=function(_0x1d1e9e,_0x136566){var _0x138893={},_0x4ac5ca={},_0x425fc3={'count':0x0,'rows':[]};var _0x2836ed=_[_0x1601('0x2c')](db[_0x1601('0x2d')][_0x1601('0x2e')],function(_0x5147b1){return{'name':_0x5147b1[_0x1601('0x2f')],'type':_0x5147b1[_0x1601('0x30')][_0x1601('0x31')]};});_0x4ac5ca[_0x1601('0x32')]=_['map'](_0x2836ed,'name');_0x4ac5ca[_0x1601('0x33')]=_[_0x1601('0x34')](_0x1d1e9e[_0x1601('0x33')]);_0x4ac5ca[_0x1601('0x35')]=_[_0x1601('0x36')](_0x4ac5ca['model'],_0x4ac5ca[_0x1601('0x33')]);_0x138893[_0x1601('0x37')]=_[_0x1601('0x36')](_0x4ac5ca[_0x1601('0x32')],qs['fields'](_0x1d1e9e[_0x1601('0x33')]['fields']));_0x138893[_0x1601('0x37')]=_0x138893['attributes'][_0x1601('0x38')]?_0x138893[_0x1601('0x37')]:_0x4ac5ca[_0x1601('0x32')];if(!_0x1d1e9e[_0x1601('0x33')][_0x1601('0x39')](_0x1601('0x3a'))){_0x138893[_0x1601('0x21')]=qs[_0x1601('0x21')](_0x1d1e9e['query'][_0x1601('0x21')]);_0x138893[_0x1601('0x23')]=qs['offset'](_0x1d1e9e[_0x1601('0x33')][_0x1601('0x23')]);}_0x138893[_0x1601('0x3b')]=qs[_0x1601('0x3c')](_0x1d1e9e[_0x1601('0x33')]['sort']);_0x138893['where']=qs['filters'](_['pick'](_0x1d1e9e[_0x1601('0x33')],_0x4ac5ca[_0x1601('0x35')]),_0x2836ed);if(_0x1d1e9e['query'][_0x1601('0x3d')]){_0x138893['where']=_[_0x1601('0x3e')](_0x138893['where'],{'$or':_[_0x1601('0x2c')](_0x2836ed,function(_0x4bc9a0){if(_0x4bc9a0['type']!==_0x1601('0x3f')){var _0x412b7a={};_0x412b7a[_0x4bc9a0[_0x1601('0x29')]]={'$like':'%'+_0x1d1e9e[_0x1601('0x33')]['filter']+'%'};return _0x412b7a;}})});}_0x138893=_['merge']({},_0x138893,_0x1d1e9e[_0x1601('0x40')]);var _0x319008={'where':_0x138893[_0x1601('0x41')]};return db['MailMessage'][_0x1601('0x22')](_0x319008)[_0x1601('0x12')](function(_0x1b3920){_0x425fc3[_0x1601('0x22')]=_0x1b3920;if(_0x1d1e9e['query'][_0x1601('0x42')]){_0x138893[_0x1601('0x43')]=[{'all':!![]}];}return db[_0x1601('0x2d')][_0x1601('0x44')](_0x138893);})[_0x1601('0x12')](function(_0x5e0966){_0x425fc3['rows']=_0x5e0966;return _0x425fc3;})[_0x1601('0x12')](respondWithFilteredResult(_0x136566,_0x138893))['catch'](handleError(_0x136566,null));};exports[_0x1601('0x45')]=function(_0x403653,_0x4b8925){var _0x102518={'raw':!![],'where':{'id':_0x403653[_0x1601('0x46')]['id']}},_0x555132={};_0x555132[_0x1601('0x32')]=_[_0x1601('0x34')](db[_0x1601('0x2d')][_0x1601('0x2e')]);_0x555132['query']=_['keys'](_0x403653[_0x1601('0x33')]);_0x555132[_0x1601('0x35')]=_['intersection'](_0x555132['model'],_0x555132['query']);_0x102518['attributes']=_[_0x1601('0x36')](_0x555132[_0x1601('0x32')],qs[_0x1601('0x47')](_0x403653['query'][_0x1601('0x47')]));_0x102518[_0x1601('0x37')]=_0x102518[_0x1601('0x37')][_0x1601('0x38')]?_0x102518[_0x1601('0x37')]:_0x555132[_0x1601('0x32')];if(_0x403653['query'][_0x1601('0x42')]){_0x102518[_0x1601('0x43')]=[{'all':!![]}];}_0x102518=_[_0x1601('0x3e')]({},_0x102518,_0x403653[_0x1601('0x40')]);return db['MailMessage']['find'](_0x102518)[_0x1601('0x12')](handleEntityNotFound(_0x4b8925,null))[_0x1601('0x12')](respondWithResult(_0x4b8925,null))[_0x1601('0x1d')](handleError(_0x4b8925,null));};exports[_0x1601('0x48')]=function(_0x152926,_0x236576){if(_0x152926[_0x1601('0x49')]['id']){delete _0x152926[_0x1601('0x49')]['id'];}return db[_0x1601('0x2d')][_0x1601('0x4a')]({'where':{'id':_0x152926[_0x1601('0x46')]['id']}})[_0x1601('0x12')](handleEntityNotFound(_0x236576,null))['then'](saveUpdates(_0x152926['body'],null))[_0x1601('0x12')](respondWithResult(_0x236576,null))[_0x1601('0x1d')](handleError(_0x236576,null));};exports['destroy']=function(_0x356103,_0x2ab269){return db[_0x1601('0x2d')][_0x1601('0x4a')]({'where':{'id':_0x356103[_0x1601('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ab269,null))[_0x1601('0x12')](removeEntity(_0x2ab269,null))[_0x1601('0x1d')](handleError(_0x2ab269,null));};exports[_0x1601('0x4b')]=function(_0x26c771,_0x2e2dc7){return db[_0x1601('0x2d')][_0x1601('0x4b')]()['then'](respondWithResult(_0x2e2dc7,null))['catch'](handleError(_0x2e2dc7,null));};exports[_0x1601('0x4c')]=function(_0x359bc6,_0x2205a1){return db[_0x1601('0x2d')]['create'](_0x359bc6[_0x1601('0x49')])['then'](function(_0x10a3c2){if(_0x10a3c2){if(_0x10a3c2[_0x1601('0x4d')]===_0x1601('0x4e')&&!_0x10a3c2['secret']){var _0x5ba4a4,_0x5a28ca,_0x5f279f;if(_0x359bc6[_0x1601('0x49')]['to']){_0x5a28ca=_0x359bc6['body']['to'][_0x1601('0x4f')](',')[0x0];}return db[_0x1601('0x50')]['findOne']({'where':{'id':_0x10a3c2[_0x1601('0x51')]},'include':[{'model':db['CmList'],'as':_0x1601('0x52'),'include':[{'model':db[_0x1601('0x53')],'as':_0x1601('0x54'),'where':{'email':_0x5a28ca},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1601('0x55')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1601('0x56')],'as':'CloudProvider','raw':!![]}]}]})[_0x1601('0x12')](function(_0x10c22f){_0x5ba4a4=_0x10c22f;if(!_0x5ba4a4||!_0x5ba4a4[_0x1601('0x57')])return;var _0x286c84=_0x5ba4a4[_0x1601('0x58')]();if(_0x359bc6['body'][_0x1601('0x59')]&&_0x359bc6[_0x1601('0x49')][_0x1601('0x59')][_0x1601('0x38')]){for(var _0x5cee46=0x0;_0x5cee46<_0x359bc6[_0x1601('0x49')][_0x1601('0x59')][_0x1601('0x38')];_0x5cee46+=0x1){_0x359bc6['body'][_0x1601('0x59')][_0x5cee46]={'filename':_0x359bc6[_0x1601('0x49')]['attachments'][_0x5cee46][_0x1601('0x29')],'path':path[_0x1601('0x5a')](config[_0x1601('0x5b')],_0x1601('0x5c'),_0x359bc6[_0x1601('0x49')][_0x1601('0x59')][_0x5cee46][_0x1601('0x5d')])};}}_0x5f279f={'account':_0x286c84,'message':_0x359bc6['body']};return;})[_0x1601('0x12')](function(){if(_0x5ba4a4[_0x1601('0x52')]){if(_0x5ba4a4['List'][_0x1601('0x54')]['length']){return _0x5ba4a4['List'][_0x1601('0x54')][0x0];}else{return db['CmContact']['create'](_[_0x1601('0xa')](_0x359bc6[_0x1601('0x49')],{'firstName':_0x359bc6['body']['to'],'email':_0x359bc6[_0x1601('0x49')]['to'],'phone':_0x359bc6[_0x1601('0x49')]['to'],'ListId':_0x5ba4a4[_0x1601('0x5e')]}));}}else{throw new Error(_0x1601('0x5f'));}})['then'](function(){if(_0x5f279f){return respondWithRpcPromise(_0x1601('0x60'),_0x1601('0x61'),_0x5f279f,client9003)['then'](function(_0x34c2bb){return _0x10a3c2[_0x1601('0x48')]({'read':!![],'messageId':_0x34c2bb[_0x1601('0x62')],'sentAt':moment()['format'](_0x1601('0x63'))});})[_0x1601('0x1d')](function(_0x5235ca){logger[_0x1601('0x19')]('%s',JSON[_0x1601('0x18')](_0x5235ca));return _0x10a3c2;});}return _0x10a3c2;});}return _0x10a3c2;}})['then'](respondWithResult(_0x2205a1,0xc9))[_0x1601('0x1d')](handleError(_0x2205a1,null));};exports['accept']=function(_0x3aac21,_0x5f4b1a){var _0x4bd413={'agent':{},'channel':_0x1601('0x64')};if(_0x3aac21[_0x1601('0x49')]['id']){delete _0x3aac21[_0x1601('0x49')]['id'];}_0x3aac21[_0x1601('0x49')][_0x1601('0x65')]=!![];_0x3aac21['body'][_0x1601('0x66')]=moment()[_0x1601('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x3aac21[_0x1601('0x49')][_0x1601('0x68')]=_0x3aac21[_0x1601('0x49')]['UserId']||_0x3aac21[_0x1601('0x69')]['id'];_0x4bd413[_0x1601('0x6a')]['id']=_0x3aac21['body'][_0x1601('0x68')];return db['MailMessage']['find']({'where':{'id':_0x3aac21[_0x1601('0x46')]['id'],'UserId':null}})[_0x1601('0x12')](handleEntityNotFound(_0x5f4b1a,null))[_0x1601('0x12')](saveUpdates(_0x3aac21['body'],null))[_0x1601('0x12')](function(_0x2c889e){if(_0x2c889e){_0x4bd413[_0x1601('0x1b')]=_0x2c889e[_0x1601('0x6b')]({'plain':!![]});return db[_0x1601('0x6c')][_0x1601('0x4a')]({'where':{'id':_0x2c889e[_0x1601('0x6d')]}});}return null;})[_0x1601('0x12')](handleEntityNotFound(_0x5f4b1a,null))[_0x1601('0x12')](function(_0x23671a){if(_0x23671a){return _0x23671a[_0x1601('0x48')]({'UserId':_0x3aac21[_0x1601('0x49')][_0x1601('0x68')],'read1stAt':_['isNil'](_0x23671a[_0x1601('0x6e')])?moment()[_0x1601('0x67')](_0x1601('0x63')):undefined});}return null;})[_0x1601('0x12')](function(_0x5ee1ba){if(_0x5ee1ba){_0x4bd413[_0x1601('0x6f')]=_0x5ee1ba[_0x1601('0x6b')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3aac21[_0x1601('0x69')]['id'],_0x3aac21[_0x1601('0x69')]['name'],_0x3aac21[_0x1601('0x69')][_0x1601('0x70')],_0x4bd413[_0x1601('0x6f')]['id'],_0x3aac21['body']?JSON[_0x1601('0x18')](_0x3aac21[_0x1601('0x49')]):_0x1601('0x71'));return respondWithRpcPromise(_0x1601('0x72'),_0x1601('0x73'),_0x4bd413);}return null;})[_0x1601('0x12')](function(_0x4b88f4){var _0x276aca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b88f4[_0x1601('0x1b')]['ContactId'];return db[_0x1601('0x74')][_0x1601('0x33')](_0x276aca,{'type':db[_0x1601('0x75')]['QueryTypes'][_0x1601('0x76')],'raw':!![]})[_0x1601('0x12')](function(_0x281017){return _0x281017;});})[_0x1601('0x12')](function(_0x5b3f9e){if(_0x5b3f9e){_0x4bd413[_0x1601('0x1b')]['contact']=_0x5b3f9e[0x0];if(!_0x3aac21[_0x1601('0x49')][_0x1601('0x68')])return;return db[_0x1601('0x77')][_0x1601('0x4a')]({'where':{'id':_0x3aac21['body'][_0x1601('0x68')],'role':_0x1601('0x6a')},'attributes':['id',_0x1601('0x29'),_0x1601('0x78'),_0x1601('0x79'),_0x1601('0x7a')],'raw':!![]});}return null;})['then'](function(_0x320a6a){if(!_0x320a6a)return null;_0x4bd413[_0x1601('0x1b')][_0x1601('0x6a')]=_0x320a6a;return _0x4bd413;})['then'](function(_0x5512e5){if(_0x5512e5){if(_0x3aac21[_0x1601('0x49')]['manual']){_0x4bd413[_0x1601('0x1b')][_0x1601('0x7b')]=util[_0x1601('0x67')](_0x1601('0x7c'),_0x3aac21[_0x1601('0x69')][_0x1601('0x29')]);_0x4bd413['message'][_0x1601('0x7d')]=_0x4bd413[_0x1601('0x7d')];_0x4bd413[_0x1601('0x1b')][_0x1601('0x7e')]=_0x4bd413['channel'];_0x4bd413['message'][_0x1601('0x7f')]=_0x1601('0x80');_0x4bd413['message']['body']=htmlToText['fromString'](_0x4bd413[_0x1601('0x1b')][_0x1601('0x49')]);return respondWithRpcPromise(_0x1601('0x81'),_0x1601('0x81'),{'event':'acceptmessage','message':_0x4bd413['message']},client9002)['then'](function(){return _0x4bd413;});}return _0x4bd413;}return null;})['then'](respondWithResult(_0x5f4b1a,null))[_0x1601('0x1d')](handleError(_0x5f4b1a,null));};exports[_0x1601('0x82')]=function(_0x27fd22,_0x599916){var _0x49ac90={'agent':{},'channel':_0x1601('0x64')};if(_0x27fd22['body']['id']){delete _0x27fd22['body']['id'];}_0x27fd22[_0x1601('0x49')]['UserId']=_0x27fd22[_0x1601('0x49')][_0x1601('0x68')]||_0x27fd22[_0x1601('0x69')]['id'];_0x49ac90[_0x1601('0x6a')]['id']=_0x27fd22[_0x1601('0x49')][_0x1601('0x68')];return db[_0x1601('0x2d')]['find']({'where':{'id':_0x27fd22['params']['id'],'UserId':null}})[_0x1601('0x12')](handleEntityNotFound(_0x599916,null))[_0x1601('0x12')](function(_0x33bf15){if(_0x33bf15){_0x49ac90['message']=_0x33bf15['get']({'plain':!![]});return db[_0x1601('0x6c')][_0x1601('0x4a')]({'where':{'id':_0x33bf15['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x599916,null))[_0x1601('0x12')](function(_0x37db03){if(_0x37db03){_0x49ac90[_0x1601('0x6f')]=_0x37db03[_0x1601('0x6b')]({'plain':!![]});interaction_log[_0x1601('0x13')](_0x1601('0x83'),_0x27fd22['user']['id'],_0x27fd22[_0x1601('0x69')]['name'],_0x27fd22[_0x1601('0x69')]['role'],_0x49ac90['interaction']['id'],_0x27fd22[_0x1601('0x49')]?JSON[_0x1601('0x18')](_0x27fd22['body']):_0x1601('0x71'));return respondWithRpcPromise(_0x1601('0x84'),'rejectMessage',_0x49ac90);}return null;})['then'](function(_0x5123d6){var _0x154ff1=_0x1601('0x85')+_0x5123d6['message']['ContactId'];return db[_0x1601('0x74')][_0x1601('0x33')](_0x154ff1,{'type':db['Sequelize'][_0x1601('0x86')][_0x1601('0x76')],'raw':!![]})[_0x1601('0x12')](function(_0x39b072){return _0x39b072;});})[_0x1601('0x12')](function(_0x3f877e){if(_0x3f877e){_0x49ac90['message']['contact']=_0x3f877e[0x0];if(!_0x27fd22['body']['UserId'])return;return db[_0x1601('0x77')][_0x1601('0x4a')]({'where':{'id':_0x27fd22[_0x1601('0x49')][_0x1601('0x68')],'role':_0x1601('0x6a')},'attributes':['id',_0x1601('0x29'),_0x1601('0x78'),'email',_0x1601('0x7a')],'raw':!![]});}return null;})[_0x1601('0x12')](function(_0x5888e3){if(!_0x5888e3)return null;_0x49ac90[_0x1601('0x1b')][_0x1601('0x6a')]=_0x5888e3;return _0x49ac90;})[_0x1601('0x12')](function(_0x5cb4c0){if(_0x5cb4c0){_0x5cb4c0['message']['interface']=util[_0x1601('0x67')](_0x1601('0x7c'),_0x27fd22[_0x1601('0x69')][_0x1601('0x29')]);_0x5cb4c0['message'][_0x1601('0x7d')]=_0x49ac90[_0x1601('0x7d')];_0x5cb4c0[_0x1601('0x1b')][_0x1601('0x7e')]=_0x49ac90[_0x1601('0x7d')];_0x5cb4c0[_0x1601('0x1b')][_0x1601('0x7f')]='reject';_0x5cb4c0[_0x1601('0x1b')][_0x1601('0x49')]=htmlToText[_0x1601('0x87')](_0x49ac90[_0x1601('0x1b')][_0x1601('0x49')]);respondWithRpcPromise(_0x1601('0x81'),_0x1601('0x81'),{'event':'rejectmessage','message':_0x5cb4c0[_0x1601('0x1b')]},client9002);return _0x49ac90;}return null;})[_0x1601('0x12')](respondWithResult(_0x599916,null))[_0x1601('0x1d')](handleError(_0x599916,null));};exports[_0x1601('0x88')]=function(_0x22890a,_0x5e1914){var _0x2b36d3=moment()[_0x1601('0x89')]()[_0x1601('0x8a')]();var _0x35040a=path[_0x1601('0x5a')](config[_0x1601('0x5b')],'server','files','tmp');var _0x427d9a=path[_0x1601('0x5a')](config[_0x1601('0x5b')],_0x1601('0x8b'),_0x1601('0x8c'),_0x1601('0x59'));var _0x3c8b37=util['format']('message-%s.eml',_0x2b36d3);return db[_0x1601('0x2d')][_0x1601('0x4a')]({'where':{'id':_0x22890a[_0x1601('0x46')]['id']},'attributes':['id',_0x1601('0x49'),_0x1601('0x8d'),'to','cc','bcc','subject',_0x1601('0x8e')],'include':_0x22890a[_0x1601('0x33')]['attachments']?[{'model':db[_0x1601('0x8f')],'as':_0x1601('0x90')}]:undefined})[_0x1601('0x12')](handleEntityNotFound(_0x5e1914,null))[_0x1601('0x12')](function(_0x32643e){if(_0x32643e){var _0xca1b97=_0x32643e;var _0x5e08ce={'from':_0xca1b97['from'],'to':_0xca1b97['to'],'subject':_0xca1b97[_0x1601('0x91')],'html':htmlEntities[_0x1601('0x92')](_0xca1b97['body']),'headers':{'Date':moment(_0xca1b97[_0x1601('0x8e')])[_0x1601('0x67')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x32643e['cc']){_0x5e08ce['headers']['Cc']=_0x32643e['cc'];}if(_0x32643e['bcc']){_0x5e08ce['headers'][_0x1601('0x93')]=_0x32643e['bcc'];}return new BPromise(function(_0x2de30d,_0x49cfbe){if(_0x32643e[_0x1601('0x90')]){for(var _0x36aeff=0x0;_0x36aeff<_0x32643e[_0x1601('0x90')][_0x1601('0x38')];_0x36aeff++){var _0x5137d4=_0x32643e[_0x1601('0x90')][_0x36aeff];var _0x29b705=path[_0x1601('0x5a')](_0x427d9a,_0x5137d4[_0x1601('0x5d')]);if(fs['existsSync'](_0x29b705)){_0x5e08ce[_0x1601('0x59')][_0x1601('0x94')]({'name':_0x5137d4['name'],'contentType':_0x5137d4['type'],'data':fs[_0x1601('0x95')](_0x29b705)});}}}emlformat[_0x1601('0x96')](_0x5e08ce,function(_0x220241,_0x4e379f){if(_0x220241)return _0x49cfbe(_0x220241);fs[_0x1601('0x97')](path[_0x1601('0x5a')](_0x35040a,_0x3c8b37),_0x4e379f);return _0x2de30d(_0x4e379f);});});}})['then'](function(_0x5e42ea){if(_0x5e42ea){return _0x5e1914[_0x1601('0x88')](path[_0x1601('0x5a')](_0x35040a,_0x3c8b37),_0x3c8b37,function(_0xb92387){if(!_0xb92387)fs[_0x1601('0x98')](path[_0x1601('0x5a')](_0x35040a,_0x3c8b37));});}})[_0x1601('0x1d')](handleError(_0x5e1914,null));}; \ No newline at end of file +var _0x0c5d=['manual','interface','channel','motionChannel','event','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','fromString','rejectmessage','unix','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','build','writeFileSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','status','offset','undefined','count','limit','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','body','describe','create','direction','out','secret','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','isNil','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal'];(function(_0x495e1c,_0x5435bd){var _0x121934=function(_0x19dc6f){while(--_0x19dc6f){_0x495e1c['push'](_0x495e1c['shift']());}};_0x121934(++_0x5435bd);}(_0x0c5d,0xbb));var _0xd0c5=function(_0x5a7670,_0x175f76){_0x5a7670=_0x5a7670-0x0;var _0x34cc4c=_0x0c5d[_0x5a7670];return _0x34cc4c;};'use strict';var emlformat=require(_0xd0c5('0x0'));var moment=require(_0xd0c5('0x1'));var BPromise=require(_0xd0c5('0x2'));var util=require(_0xd0c5('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xd0c5('0x4'));var Redis=require(_0xd0c5('0x5'));var htmlToText=require(_0xd0c5('0x6'));var qs=require(_0xd0c5('0x7'));var logger=require('../../config/logger')(_0xd0c5('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xd0c5('0x9'));var db=require(_0xd0c5('0xa'))['db'];config[_0xd0c5('0xb')]=_[_0xd0c5('0xc')](config[_0xd0c5('0xb')],{'host':_0xd0c5('0xd'),'port':0x18eb});var socket=require(_0xd0c5('0xe'))(new Redis(config[_0xd0c5('0xb')]));var htmlEntities=require(_0xd0c5('0xf'));require(_0xd0c5('0x10'))['register'](socket);var jayson=require(_0xd0c5('0x11'));var client=jayson[_0xd0c5('0x12')][_0xd0c5('0x13')]({'port':0x232c});var client9003=jayson[_0xd0c5('0x12')][_0xd0c5('0x13')]({'port':0x232b});var client9002=jayson['client'][_0xd0c5('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x16d0ca,_0x4495e7,_0x2db448,_0x179835){return new BPromise(function(_0x37fa9f,_0x828fb0){var _0x54f882=_0x179835||client;return _0x54f882[_0xd0c5('0x14')](_0x16d0ca,_0x2db448)[_0xd0c5('0x15')](function(_0x129224){logger['info']('MailMessage,\x20%s,\x20%s',_0x4495e7,'request\x20sent');logger[_0xd0c5('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4495e7,_0xd0c5('0x17'),JSON[_0xd0c5('0x18')](_0x129224));if(_0x129224[_0xd0c5('0x19')]){if(_0x129224[_0xd0c5('0x19')][_0xd0c5('0x1a')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x4495e7,_0x129224[_0xd0c5('0x19')]['message']);return _0x828fb0(_0x129224[_0xd0c5('0x19')]['message']);}logger['error'](_0xd0c5('0x1b'),_0x4495e7,_0x129224['error'][_0xd0c5('0x1c')]);return _0x37fa9f(_0x129224['error'][_0xd0c5('0x1c')]);}else{logger[_0xd0c5('0x1d')]('MailMessage,\x20%s,\x20%s',_0x4495e7,'request\x20sent');_0x37fa9f(_0x129224[_0xd0c5('0x1e')][_0xd0c5('0x1c')]);}})['catch'](function(_0x31d441){logger[_0xd0c5('0x19')](_0xd0c5('0x1b'),_0x4495e7,_0x31d441);_0x828fb0(_0x31d441);});});}function respondWithResult(_0x7f5dc6,_0x830d58){_0x830d58=_0x830d58||0xc8;return function(_0x2ef32d){if(_0x2ef32d){return _0x7f5dc6[_0xd0c5('0x1f')](_0x830d58)['json'](_0x2ef32d);}};}function respondWithFilteredResult(_0xffc7f7,_0x35a0a5){return function(_0x2303ae){if(_0x2303ae){var _0x5e2bd2=typeof _0x35a0a5[_0xd0c5('0x20')]===_0xd0c5('0x21')&&typeof _0x35a0a5['limit']==='undefined';var _0x24286d=_0x2303ae['count'];var _0x3306a1=_0x5e2bd2?0x0:_0x35a0a5['offset'];var _0xfc2bd3=_0x5e2bd2?_0x2303ae[_0xd0c5('0x22')]:_0x35a0a5[_0xd0c5('0x20')]+_0x35a0a5[_0xd0c5('0x23')];var _0x3fa276;if(_0xfc2bd3>=_0x24286d){_0xfc2bd3=_0x24286d;_0x3fa276=0xc8;}else{_0x3fa276=0xce;}_0xffc7f7[_0xd0c5('0x1f')](_0x3fa276);return _0xffc7f7['set'](_0xd0c5('0x24'),_0x3306a1+'-'+_0xfc2bd3+'/'+_0x24286d)[_0xd0c5('0x25')](_0x2303ae);}return null;};}function saveUpdates(_0x8a08ca){return function(_0x36a948){if(_0x36a948){return _0x36a948[_0xd0c5('0x26')](_0x8a08ca)['then'](function(_0x2e5f95){return _0x2e5f95;});}return null;};}function removeEntity(_0x14aa73){return function(_0xe45491){if(_0xe45491){return _0xe45491[_0xd0c5('0x27')]()[_0xd0c5('0x15')](function(){_0x14aa73['status'](0xcc)[_0xd0c5('0x28')]();});}};}function handleEntityNotFound(_0x47da12){return function(_0x19bf8a){if(!_0x19bf8a){_0x47da12[_0xd0c5('0x29')](0x194);}return _0x19bf8a;};}function handleError(_0x228331,_0x4982e5){_0x4982e5=_0x4982e5||0x1f4;return function(_0x6e3523){logger[_0xd0c5('0x19')](_0x6e3523[_0xd0c5('0x2a')]);if(_0x6e3523[_0xd0c5('0x2b')]){delete _0x6e3523[_0xd0c5('0x2b')];}_0x228331[_0xd0c5('0x1f')](_0x4982e5)[_0xd0c5('0x2c')](_0x6e3523);};}exports[_0xd0c5('0x2d')]=function(_0x2b0a43,_0x475c6b){var _0x4ab5d3={},_0x594ebe={},_0x1c8d7b={'count':0x0,'rows':[]};var _0x1d17d9=_[_0xd0c5('0x2e')](db[_0xd0c5('0x2f')]['rawAttributes'],function(_0x5c3e08){return{'name':_0x5c3e08[_0xd0c5('0x30')],'type':_0x5c3e08['type'][_0xd0c5('0x31')]};});_0x594ebe[_0xd0c5('0x32')]=_[_0xd0c5('0x2e')](_0x1d17d9,'name');_0x594ebe[_0xd0c5('0x33')]=_['keys'](_0x2b0a43['query']);_0x594ebe[_0xd0c5('0x34')]=_['intersection'](_0x594ebe['model'],_0x594ebe[_0xd0c5('0x33')]);_0x4ab5d3[_0xd0c5('0x35')]=_[_0xd0c5('0x36')](_0x594ebe[_0xd0c5('0x32')],qs[_0xd0c5('0x37')](_0x2b0a43[_0xd0c5('0x33')][_0xd0c5('0x37')]));_0x4ab5d3[_0xd0c5('0x35')]=_0x4ab5d3['attributes'][_0xd0c5('0x38')]?_0x4ab5d3['attributes']:_0x594ebe[_0xd0c5('0x32')];if(!_0x2b0a43[_0xd0c5('0x33')][_0xd0c5('0x39')](_0xd0c5('0x3a'))){_0x4ab5d3['limit']=qs['limit'](_0x2b0a43[_0xd0c5('0x33')][_0xd0c5('0x23')]);_0x4ab5d3[_0xd0c5('0x20')]=qs['offset'](_0x2b0a43[_0xd0c5('0x33')]['offset']);}_0x4ab5d3[_0xd0c5('0x3b')]=qs['sort'](_0x2b0a43['query'][_0xd0c5('0x3c')]);_0x4ab5d3['where']=qs[_0xd0c5('0x34')](_[_0xd0c5('0x3d')](_0x2b0a43[_0xd0c5('0x33')],_0x594ebe[_0xd0c5('0x34')]),_0x1d17d9);if(_0x2b0a43[_0xd0c5('0x33')][_0xd0c5('0x3e')]){_0x4ab5d3[_0xd0c5('0x3f')]=_[_0xd0c5('0x40')](_0x4ab5d3[_0xd0c5('0x3f')],{'$or':_[_0xd0c5('0x2e')](_0x1d17d9,function(_0x2ab5af){if(_0x2ab5af[_0xd0c5('0x41')]!==_0xd0c5('0x42')){var _0x1fbb51={};_0x1fbb51[_0x2ab5af[_0xd0c5('0x2b')]]={'$like':'%'+_0x2b0a43[_0xd0c5('0x33')][_0xd0c5('0x3e')]+'%'};return _0x1fbb51;}})});}_0x4ab5d3=_[_0xd0c5('0x40')]({},_0x4ab5d3,_0x2b0a43[_0xd0c5('0x43')]);var _0x29bf39={'where':_0x4ab5d3[_0xd0c5('0x3f')]};return db[_0xd0c5('0x2f')]['count'](_0x29bf39)[_0xd0c5('0x15')](function(_0x5872ff){_0x1c8d7b[_0xd0c5('0x22')]=_0x5872ff;if(_0x2b0a43[_0xd0c5('0x33')]['includeAll']){_0x4ab5d3[_0xd0c5('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0xd0c5('0x45')](_0x4ab5d3);})[_0xd0c5('0x15')](function(_0x239baf){_0x1c8d7b[_0xd0c5('0x46')]=_0x239baf;return _0x1c8d7b;})[_0xd0c5('0x15')](respondWithFilteredResult(_0x475c6b,_0x4ab5d3))[_0xd0c5('0x47')](handleError(_0x475c6b,null));};exports[_0xd0c5('0x48')]=function(_0x47d2e9,_0x4af670){var _0x23db1a={'raw':!![],'where':{'id':_0x47d2e9[_0xd0c5('0x49')]['id']}},_0x46c194={};_0x46c194[_0xd0c5('0x32')]=_['keys'](db['MailMessage'][_0xd0c5('0x4a')]);_0x46c194[_0xd0c5('0x33')]=_[_0xd0c5('0x4b')](_0x47d2e9[_0xd0c5('0x33')]);_0x46c194[_0xd0c5('0x34')]=_[_0xd0c5('0x36')](_0x46c194['model'],_0x46c194[_0xd0c5('0x33')]);_0x23db1a[_0xd0c5('0x35')]=_['intersection'](_0x46c194[_0xd0c5('0x32')],qs[_0xd0c5('0x37')](_0x47d2e9[_0xd0c5('0x33')][_0xd0c5('0x37')]));_0x23db1a[_0xd0c5('0x35')]=_0x23db1a[_0xd0c5('0x35')][_0xd0c5('0x38')]?_0x23db1a[_0xd0c5('0x35')]:_0x46c194[_0xd0c5('0x32')];if(_0x47d2e9[_0xd0c5('0x33')][_0xd0c5('0x4c')]){_0x23db1a[_0xd0c5('0x44')]=[{'all':!![]}];}_0x23db1a=_[_0xd0c5('0x40')]({},_0x23db1a,_0x47d2e9[_0xd0c5('0x43')]);return db[_0xd0c5('0x2f')][_0xd0c5('0x4d')](_0x23db1a)[_0xd0c5('0x15')](handleEntityNotFound(_0x4af670,null))[_0xd0c5('0x15')](respondWithResult(_0x4af670,null))[_0xd0c5('0x47')](handleError(_0x4af670,null));};exports[_0xd0c5('0x26')]=function(_0x338007,_0x515870){if(_0x338007[_0xd0c5('0x4e')]['id']){delete _0x338007[_0xd0c5('0x4e')]['id'];}return db['MailMessage'][_0xd0c5('0x4d')]({'where':{'id':_0x338007[_0xd0c5('0x49')]['id']}})[_0xd0c5('0x15')](handleEntityNotFound(_0x515870,null))[_0xd0c5('0x15')](saveUpdates(_0x338007['body'],null))['then'](respondWithResult(_0x515870,null))['catch'](handleError(_0x515870,null));};exports[_0xd0c5('0x27')]=function(_0x78578e,_0x260f7a){return db[_0xd0c5('0x2f')][_0xd0c5('0x4d')]({'where':{'id':_0x78578e[_0xd0c5('0x49')]['id']}})[_0xd0c5('0x15')](handleEntityNotFound(_0x260f7a,null))[_0xd0c5('0x15')](removeEntity(_0x260f7a,null))[_0xd0c5('0x47')](handleError(_0x260f7a,null));};exports[_0xd0c5('0x4f')]=function(_0x2dbb7b,_0x4d204d){return db[_0xd0c5('0x2f')]['describe']()['then'](respondWithResult(_0x4d204d,null))[_0xd0c5('0x47')](handleError(_0x4d204d,null));};exports[_0xd0c5('0x50')]=function(_0x135d8f,_0x353e62){return db[_0xd0c5('0x2f')][_0xd0c5('0x50')](_0x135d8f[_0xd0c5('0x4e')])[_0xd0c5('0x15')](function(_0x51e81d){if(_0x51e81d){if(_0x51e81d[_0xd0c5('0x51')]===_0xd0c5('0x52')&&!_0x51e81d[_0xd0c5('0x53')]){var _0x1df5a0,_0x3ffc99,_0x25dcd2;if(_0x135d8f['body']['to']){_0x3ffc99=_0x135d8f[_0xd0c5('0x4e')]['to']['split'](',')[0x0];}return db[_0xd0c5('0x54')]['findOne']({'where':{'id':_0x51e81d[_0xd0c5('0x55')]},'include':[{'model':db[_0xd0c5('0x56')],'as':_0xd0c5('0x57'),'include':[{'model':db[_0xd0c5('0x58')],'as':_0xd0c5('0x59'),'where':{'email':_0x3ffc99},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':_0xd0c5('0x5a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xd0c5('0x15')](function(_0x1d55d2){_0x1df5a0=_0x1d55d2;if(!_0x1df5a0||!_0x1df5a0['Smtp'])return;var _0x2ae79b=_0x1df5a0[_0xd0c5('0x5b')]();if(_0x135d8f[_0xd0c5('0x4e')]['attachments']&&_0x135d8f['body'][_0xd0c5('0x5c')]['length']){for(var _0x4b87bf=0x0;_0x4b87bf<_0x135d8f[_0xd0c5('0x4e')][_0xd0c5('0x5c')]['length'];_0x4b87bf+=0x1){_0x135d8f[_0xd0c5('0x4e')][_0xd0c5('0x5c')][_0x4b87bf]={'filename':_0x135d8f[_0xd0c5('0x4e')][_0xd0c5('0x5c')][_0x4b87bf]['name'],'path':path[_0xd0c5('0x5d')](config[_0xd0c5('0x5e')],_0xd0c5('0x5f'),_0x135d8f[_0xd0c5('0x4e')][_0xd0c5('0x5c')][_0x4b87bf][_0xd0c5('0x60')])};}}_0x25dcd2={'account':_0x2ae79b,'message':_0x135d8f[_0xd0c5('0x4e')]};return;})['then'](function(){if(_0x1df5a0[_0xd0c5('0x57')]){if(_0x1df5a0[_0xd0c5('0x57')][_0xd0c5('0x59')]['length']){return _0x1df5a0[_0xd0c5('0x57')][_0xd0c5('0x59')][0x0];}else{return db[_0xd0c5('0x58')][_0xd0c5('0x50')](_[_0xd0c5('0xc')](_0x135d8f[_0xd0c5('0x4e')],{'firstName':_0x135d8f[_0xd0c5('0x4e')]['to'],'email':_0x135d8f[_0xd0c5('0x4e')]['to'],'phone':_0x135d8f[_0xd0c5('0x4e')]['to'],'ListId':_0x1df5a0[_0xd0c5('0x61')]}));}}else{throw new Error(_0xd0c5('0x62'));}})[_0xd0c5('0x15')](function(){if(_0x25dcd2){return respondWithRpcPromise(_0xd0c5('0x63'),_0xd0c5('0x64'),_0x25dcd2,client9003)['then'](function(_0x542510){return _0x51e81d[_0xd0c5('0x26')]({'read':!![],'messageId':_0x542510['messageId'],'sentAt':moment()[_0xd0c5('0x65')](_0xd0c5('0x66'))});})[_0xd0c5('0x47')](function(_0x1054af){logger[_0xd0c5('0x19')]('%s',JSON['stringify'](_0x1054af));return _0x51e81d;});}return _0x51e81d;});}return _0x51e81d;}})[_0xd0c5('0x15')](respondWithResult(_0x353e62,0xc9))[_0xd0c5('0x47')](handleError(_0x353e62,null));};exports[_0xd0c5('0x67')]=function(_0x174f5c,_0x4bf330){var _0x5ef330={'agent':{},'channel':_0xd0c5('0x68')};if(_0x174f5c['body']['id']){delete _0x174f5c[_0xd0c5('0x4e')]['id'];}_0x174f5c[_0xd0c5('0x4e')][_0xd0c5('0x69')]=!![];_0x174f5c[_0xd0c5('0x4e')][_0xd0c5('0x6a')]=moment()['format'](_0xd0c5('0x66'));_0x174f5c[_0xd0c5('0x4e')]['UserId']=_0x174f5c['body'][_0xd0c5('0x6b')]||_0x174f5c[_0xd0c5('0x6c')]['id'];_0x5ef330[_0xd0c5('0x6d')]['id']=_0x174f5c[_0xd0c5('0x4e')][_0xd0c5('0x6b')];return db[_0xd0c5('0x2f')][_0xd0c5('0x4d')]({'where':{'id':_0x174f5c[_0xd0c5('0x49')]['id'],'UserId':null}})[_0xd0c5('0x15')](handleEntityNotFound(_0x4bf330,null))['then'](saveUpdates(_0x174f5c['body'],null))[_0xd0c5('0x15')](function(_0x5c2b9e){if(_0x5c2b9e){_0x5ef330[_0xd0c5('0x1c')]=_0x5c2b9e[_0xd0c5('0x6e')]({'plain':!![]});return db[_0xd0c5('0x6f')]['find']({'where':{'id':_0x5c2b9e['MailInteractionId']}});}return null;})[_0xd0c5('0x15')](handleEntityNotFound(_0x4bf330,null))[_0xd0c5('0x15')](function(_0x52984f){if(_0x52984f){return _0x52984f[_0xd0c5('0x26')]({'UserId':_0x174f5c[_0xd0c5('0x4e')][_0xd0c5('0x6b')],'read1stAt':_[_0xd0c5('0x70')](_0x52984f['read1stAt'])?moment()[_0xd0c5('0x65')](_0xd0c5('0x66')):undefined});}return null;})['then'](function(_0x2b478c){if(_0x2b478c){_0x5ef330['interaction']=_0x2b478c['get']({'plain':!![]});interaction_log['info'](_0xd0c5('0x71'),_0x174f5c[_0xd0c5('0x6c')]['id'],_0x174f5c[_0xd0c5('0x6c')][_0xd0c5('0x2b')],_0x174f5c[_0xd0c5('0x6c')][_0xd0c5('0x72')],_0x5ef330[_0xd0c5('0x73')]['id'],_0x174f5c['body']?JSON[_0xd0c5('0x18')](_0x174f5c['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5ef330);}return null;})['then'](function(_0x6c6296){var _0x567761=_0xd0c5('0x74')+_0x6c6296[_0xd0c5('0x1c')]['ContactId'];return db[_0xd0c5('0x75')][_0xd0c5('0x33')](_0x567761,{'type':db[_0xd0c5('0x76')][_0xd0c5('0x77')][_0xd0c5('0x78')],'raw':!![]})[_0xd0c5('0x15')](function(_0x3690f4){return _0x3690f4;});})[_0xd0c5('0x15')](function(_0x5406cb){if(_0x5406cb){_0x5ef330[_0xd0c5('0x1c')][_0xd0c5('0x79')]=_0x5406cb[0x0];if(!_0x174f5c[_0xd0c5('0x4e')][_0xd0c5('0x6b')])return;return db[_0xd0c5('0x7a')][_0xd0c5('0x4d')]({'where':{'id':_0x174f5c[_0xd0c5('0x4e')][_0xd0c5('0x6b')],'role':_0xd0c5('0x6d')},'attributes':['id',_0xd0c5('0x2b'),_0xd0c5('0x7b'),'email',_0xd0c5('0x7c')],'raw':!![]});}return null;})['then'](function(_0x887679){if(!_0x887679)return null;_0x5ef330[_0xd0c5('0x1c')][_0xd0c5('0x6d')]=_0x887679;return _0x5ef330;})[_0xd0c5('0x15')](function(_0x3551d8){if(_0x3551d8){if(_0x174f5c['body'][_0xd0c5('0x7d')]){_0x5ef330[_0xd0c5('0x1c')][_0xd0c5('0x7e')]=util[_0xd0c5('0x65')]('SIP/%s',_0x174f5c[_0xd0c5('0x6c')]['name']);_0x5ef330[_0xd0c5('0x1c')][_0xd0c5('0x7f')]=_0x5ef330[_0xd0c5('0x7f')];_0x5ef330[_0xd0c5('0x1c')][_0xd0c5('0x80')]=_0x5ef330['channel'];_0x5ef330[_0xd0c5('0x1c')][_0xd0c5('0x81')]=_0xd0c5('0x67');_0x5ef330['message'][_0xd0c5('0x4e')]=htmlToText['fromString'](_0x5ef330['message']['body']);return respondWithRpcPromise(_0xd0c5('0x82'),'EventManager',{'event':'acceptmessage','message':_0x5ef330[_0xd0c5('0x1c')]},client9002)[_0xd0c5('0x15')](function(){return _0x5ef330;});}return _0x5ef330;}return null;})[_0xd0c5('0x15')](respondWithResult(_0x4bf330,null))['catch'](handleError(_0x4bf330,null));};exports[_0xd0c5('0x83')]=function(_0x25827f,_0x3024fa){var _0x1d62e0={'agent':{},'channel':_0xd0c5('0x68')};if(_0x25827f[_0xd0c5('0x4e')]['id']){delete _0x25827f[_0xd0c5('0x4e')]['id'];}_0x25827f[_0xd0c5('0x4e')]['UserId']=_0x25827f[_0xd0c5('0x4e')][_0xd0c5('0x6b')]||_0x25827f[_0xd0c5('0x6c')]['id'];_0x1d62e0[_0xd0c5('0x6d')]['id']=_0x25827f[_0xd0c5('0x4e')][_0xd0c5('0x6b')];return db[_0xd0c5('0x2f')]['find']({'where':{'id':_0x25827f[_0xd0c5('0x49')]['id'],'UserId':null}})[_0xd0c5('0x15')](handleEntityNotFound(_0x3024fa,null))[_0xd0c5('0x15')](function(_0xb06732){if(_0xb06732){_0x1d62e0[_0xd0c5('0x1c')]=_0xb06732[_0xd0c5('0x6e')]({'plain':!![]});return db[_0xd0c5('0x6f')][_0xd0c5('0x4d')]({'where':{'id':_0xb06732['MailInteractionId']}});}return null;})[_0xd0c5('0x15')](handleEntityNotFound(_0x3024fa,null))['then'](function(_0x22da50){if(_0x22da50){_0x1d62e0['interaction']=_0x22da50[_0xd0c5('0x6e')]({'plain':!![]});interaction_log[_0xd0c5('0x1d')](_0xd0c5('0x84'),_0x25827f['user']['id'],_0x25827f[_0xd0c5('0x6c')][_0xd0c5('0x2b')],_0x25827f[_0xd0c5('0x6c')][_0xd0c5('0x72')],_0x1d62e0['interaction']['id'],_0x25827f[_0xd0c5('0x4e')]?JSON[_0xd0c5('0x18')](_0x25827f[_0xd0c5('0x4e')]):_0xd0c5('0x85'));return respondWithRpcPromise(_0xd0c5('0x86'),_0xd0c5('0x87'),_0x1d62e0);}return null;})[_0xd0c5('0x15')](function(_0x563f72){var _0x3af716=_0xd0c5('0x74')+_0x563f72[_0xd0c5('0x1c')]['ContactId'];return db[_0xd0c5('0x75')]['query'](_0x3af716,{'type':db[_0xd0c5('0x76')][_0xd0c5('0x77')][_0xd0c5('0x78')],'raw':!![]})['then'](function(_0x4bfb33){return _0x4bfb33;});})[_0xd0c5('0x15')](function(_0x47727c){if(_0x47727c){_0x1d62e0[_0xd0c5('0x1c')][_0xd0c5('0x79')]=_0x47727c[0x0];if(!_0x25827f['body']['UserId'])return;return db[_0xd0c5('0x7a')][_0xd0c5('0x4d')]({'where':{'id':_0x25827f[_0xd0c5('0x4e')][_0xd0c5('0x6b')],'role':_0xd0c5('0x6d')},'attributes':['id','name','fullname','email',_0xd0c5('0x7c')],'raw':!![]});}return null;})[_0xd0c5('0x15')](function(_0x2dcc3a){if(!_0x2dcc3a)return null;_0x1d62e0[_0xd0c5('0x1c')]['agent']=_0x2dcc3a;return _0x1d62e0;})[_0xd0c5('0x15')](function(_0x2603eb){if(_0x2603eb){_0x2603eb[_0xd0c5('0x1c')][_0xd0c5('0x7e')]=util['format'](_0xd0c5('0x88'),_0x25827f[_0xd0c5('0x6c')]['name']);_0x2603eb[_0xd0c5('0x1c')][_0xd0c5('0x7f')]=_0x1d62e0[_0xd0c5('0x7f')];_0x2603eb[_0xd0c5('0x1c')]['motionChannel']=_0x1d62e0[_0xd0c5('0x7f')];_0x2603eb[_0xd0c5('0x1c')]['event']='reject';_0x2603eb[_0xd0c5('0x1c')][_0xd0c5('0x4e')]=htmlToText[_0xd0c5('0x89')](_0x1d62e0[_0xd0c5('0x1c')][_0xd0c5('0x4e')]);respondWithRpcPromise(_0xd0c5('0x82'),'EventManager',{'event':_0xd0c5('0x8a'),'message':_0x2603eb[_0xd0c5('0x1c')]},client9002);return _0x1d62e0;}return null;})[_0xd0c5('0x15')](respondWithResult(_0x3024fa,null))[_0xd0c5('0x47')](handleError(_0x3024fa,null));};exports['download']=function(_0x2ab688,_0x50b7c9){var _0x4b8223=moment()[_0xd0c5('0x8b')]()['toString']();var _0x52df01=path[_0xd0c5('0x5d')](config[_0xd0c5('0x5e')],_0xd0c5('0x8c'),_0xd0c5('0x8d'),_0xd0c5('0x8e'));var _0x3bf7f8=path[_0xd0c5('0x5d')](config[_0xd0c5('0x5e')],_0xd0c5('0x8c'),_0xd0c5('0x8d'),'attachments');var _0x27964d=util[_0xd0c5('0x65')](_0xd0c5('0x8f'),_0x4b8223);return db[_0xd0c5('0x2f')][_0xd0c5('0x4d')]({'where':{'id':_0x2ab688[_0xd0c5('0x49')]['id']},'attributes':['id',_0xd0c5('0x4e'),_0xd0c5('0x90'),'to','cc',_0xd0c5('0x91'),_0xd0c5('0x92'),_0xd0c5('0x93')],'include':_0x2ab688['query']['attachments']?[{'model':db[_0xd0c5('0x94')],'as':_0xd0c5('0x95')}]:undefined})[_0xd0c5('0x15')](handleEntityNotFound(_0x50b7c9,null))[_0xd0c5('0x15')](function(_0x369971){if(_0x369971){var _0x1d6c7c=_0x369971;var _0x42b2d4={'from':_0x1d6c7c[_0xd0c5('0x90')],'to':_0x1d6c7c['to'],'subject':_0x1d6c7c[_0xd0c5('0x92')],'html':htmlEntities[_0xd0c5('0x96')](_0x1d6c7c[_0xd0c5('0x4e')]),'headers':{'Date':moment(_0x1d6c7c[_0xd0c5('0x93')])['format'](_0xd0c5('0x97'))},'attachments':[]};if(_0x369971['cc']){_0x42b2d4[_0xd0c5('0x98')]['Cc']=_0x369971['cc'];}if(_0x369971[_0xd0c5('0x91')]){_0x42b2d4[_0xd0c5('0x98')][_0xd0c5('0x99')]=_0x369971[_0xd0c5('0x91')];}return new BPromise(function(_0x267f70,_0x54316b){if(_0x369971[_0xd0c5('0x95')]){for(var _0x1c2132=0x0;_0x1c2132<_0x369971['Attachments'][_0xd0c5('0x38')];_0x1c2132++){var _0x37cb01=_0x369971[_0xd0c5('0x95')][_0x1c2132];var _0x5b847c=path['join'](_0x3bf7f8,_0x37cb01[_0xd0c5('0x60')]);if(fs['existsSync'](_0x5b847c)){_0x42b2d4['attachments']['push']({'name':_0x37cb01[_0xd0c5('0x2b')],'contentType':_0x37cb01[_0xd0c5('0x41')],'data':fs['readFileSync'](_0x5b847c)});}}}emlformat[_0xd0c5('0x9a')](_0x42b2d4,function(_0x9f2248,_0x386404){if(_0x9f2248)return _0x54316b(_0x9f2248);fs[_0xd0c5('0x9b')](path[_0xd0c5('0x5d')](_0x52df01,_0x27964d),_0x386404);return _0x267f70(_0x386404);});});}})[_0xd0c5('0x15')](function(_0x3f3790){if(_0x3f3790){return _0x50b7c9['download'](path[_0xd0c5('0x5d')](_0x52df01,_0x27964d),_0x27964d,function(_0x19e937){if(!_0x19e937)fs['unlinkSync'](path[_0xd0c5('0x5d')](_0x52df01,_0x27964d));});}})['catch'](handleError(_0x50b7c9,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 478a96d..5ee49ba 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 _0xb087=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb'];(function(_0x48b76e,_0x462a62){var _0x14c94e=function(_0xc44ae5){while(--_0xc44ae5){_0x48b76e['push'](_0x48b76e['shift']());}};_0x14c94e(++_0x462a62);}(_0xb087,0x156));var _0x7b08=function(_0x299697,_0x4731bd){_0x299697=_0x299697-0x0;var _0x52a1fa=_0xb087[_0x299697];return _0x52a1fa;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x7b08('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7b08('0x1')](0x0);var events={'afterCreate':_0x7b08('0x2'),'afterUpdate':_0x7b08('0x3'),'afterDestroy':'remove'};function emitEvent(_0x43844e){return function(_0x2bdb52,_0x1e21e7,_0x5656d1){MailMessageEvents[_0x7b08('0x4')](_0x43844e+':'+_0x2bdb52['id'],_0x2bdb52);MailMessageEvents[_0x7b08('0x4')](_0x43844e,_0x2bdb52);_0x5656d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x7b08('0x5')](e,emitEvent(event));}}module[_0x7b08('0x6')]=MailMessageEvents; \ No newline at end of file +var _0xa2b9=['../../mysqldb','MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0xa2b9,0x1a3));var _0x9a2b=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0xa2b9[_0x3df3c6];return _0x254c43;};'use strict';var EventEmitter=require(_0x9a2b('0x0'));var MailMessage=require(_0x9a2b('0x1'))['db'][_0x9a2b('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9a2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a2b('0x4'),'afterDestroy':_0x9a2b('0x5')};function emitEvent(_0x42bc0a){return function(_0x580ed4,_0x543ef2,_0x1b4f6d){MailMessageEvents[_0x9a2b('0x6')](_0x42bc0a+':'+_0x580ed4['id'],_0x580ed4);MailMessageEvents[_0x9a2b('0x6')](_0x42bc0a,_0x580ed4);_0x1b4f6d(null);};}for(var e in events){if(events[_0x9a2b('0x7')](e)){var event=events[e];MailMessage[_0x9a2b('0x8')](e,emitEvent(event));}}module[_0x9a2b('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index d100c47..f5c4c79 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 _0xa27e=['util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','messageId','plainBody','subject','FULLTEXT','body','fromString','direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','error','utf8mb4','lodash'];(function(_0x2e58da,_0x1ec89e){var _0x3eb7e1=function(_0x3e786b){while(--_0x3e786b){_0x2e58da['push'](_0x2e58da['shift']());}};_0x3eb7e1(++_0x1ec89e);}(_0xa27e,0x1cf));var _0xea27=function(_0x5441e9,_0x372a79){_0x5441e9=_0x5441e9-0x0;var _0x3f15b5=_0xa27e[_0x5441e9];return _0x3f15b5;};'use strict';var _=require(_0xea27('0x0'));var util=require(_0xea27('0x1'));var logger=require(_0xea27('0x2'))(_0xea27('0x3'));var moment=require(_0xea27('0x4'));var BPromise=require(_0xea27('0x5'));var rp=require(_0xea27('0x6'));var htmlToText=require(_0xea27('0x7'));var fs=require('fs');var path=require(_0xea27('0x8'));var rimraf=require(_0xea27('0x9'));var config=require(_0xea27('0xa'));var attributes=require(_0xea27('0xb'));module[_0xea27('0xc')]=function(_0x118197,_0x4d8371){return _0x118197['define'](_0xea27('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xea27('0xe'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xea27('0xf'),_0xea27('0x10')],'type':_0xea27('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16b6d1,_0x3227ae,_0x229b61){if(_0x16b6d1[_0xea27('0x12')]){_0x16b6d1['plainBody']=htmlToText[_0xea27('0x13')](_0x16b6d1[_0xea27('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x229b61(null,_0x3227ae);},'afterCreate':function(_0x1b13f2,_0x2ad190,_0x13782b){var _0x289a34=_0x118197['models'];var _0x2bd711=_0x1b13f2['get']({'plain':!![]});if(_0x2bd711[_0xea27('0x14')]['toLowerCase']()==='in'||_0x2bd711['direction'][_0xea27('0x15')]()===_0xea27('0x16')&&!_0x2bd711[_0xea27('0x17')]&&!_[_0xea27('0x18')](_0x2bd711['UserId'])){_0x289a34[_0xea27('0x19')]['findOne']({'where':{'id':_0x2bd711[_0xea27('0x1a')]}})['then'](function(_0x259e43){if(_0x259e43){_0x259e43['update']({'lastMsgAt':_0x2bd711['createdAt'],'lastMsgDirection':_0x2bd711[_0xea27('0x14')]['toLowerCase']()});}})['catch'](function(_0x54fefb){console[_0xea27('0x1b')](_0x54fefb);});}_0x13782b();}},'charset':_0xea27('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf270=['path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','fromString','models','get','toLowerCase','out','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','direction','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text'];(function(_0x463f6b,_0x1b0d55){var _0x751f95=function(_0x40dcc4){while(--_0x40dcc4){_0x463f6b['push'](_0x463f6b['shift']());}};_0x751f95(++_0x1b0d55);}(_0xf270,0xcb));var _0x0f27=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0xf270[_0x2a6d45];return _0x295253;};'use strict';var _=require(_0x0f27('0x0'));var util=require(_0x0f27('0x1'));var logger=require(_0x0f27('0x2'))('api');var moment=require(_0x0f27('0x3'));var BPromise=require(_0x0f27('0x4'));var rp=require(_0x0f27('0x5'));var htmlToText=require(_0x0f27('0x6'));var fs=require('fs');var path=require(_0x0f27('0x7'));var rimraf=require(_0x0f27('0x8'));var config=require(_0x0f27('0x9'));var attributes=require(_0x0f27('0xa'));module[_0x0f27('0xb')]=function(_0x2f7bff,_0x1ce43b){return _0x2f7bff[_0x0f27('0xc')](_0x0f27('0xd'),attributes,{'tableName':_0x0f27('0xe'),'paranoid':![],'indexes':[{'name':_0x0f27('0xf'),'fields':['messageId']},{'name':_0x0f27('0x10'),'fields':[_0x0f27('0x11'),'subject'],'type':_0x0f27('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x324cf6,_0x3d56da,_0x142eec){if(_0x324cf6['body']){_0x324cf6[_0x0f27('0x11')]=htmlToText[_0x0f27('0x13')](_0x324cf6['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x142eec(null,_0x3d56da);},'afterCreate':function(_0x5b1e5a,_0x5d57c7,_0x1882cb){var _0x55db3c=_0x2f7bff[_0x0f27('0x14')];var _0x39eb12=_0x5b1e5a[_0x0f27('0x15')]({'plain':!![]});if(_0x39eb12['direction'][_0x0f27('0x16')]()==='in'||_0x39eb12['direction'][_0x0f27('0x16')]()===_0x0f27('0x17')&&!_0x39eb12['secret']&&!_[_0x0f27('0x18')](_0x39eb12[_0x0f27('0x19')])){_0x55db3c['MailInteraction'][_0x0f27('0x1a')]({'where':{'id':_0x39eb12[_0x0f27('0x1b')]}})[_0x0f27('0x1c')](function(_0x26e042){if(_0x26e042){_0x26e042[_0x0f27('0x1d')]({'lastMsgAt':_0x39eb12[_0x0f27('0x1e')],'lastMsgDirection':_0x39eb12[_0x0f27('0x1f')][_0x0f27('0x16')]()});}})[_0x0f27('0x20')](function(_0x334e11){console['error'](_0x334e11);});}_0x1882cb();}},'charset':_0x0f27('0x21'),'collate':_0x0f27('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index d25c978..d2cfe29 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateMailMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x33aaf2,_0x4c396d){var _0x4bcf51=function(_0x1c2cea){while(--_0x1c2cea){_0x33aaf2['push'](_0x33aaf2['shift']());}};_0x4bcf51(++_0x4c396d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3b2be5,_0x9c01ae){_0x3b2be5=_0x3b2be5-0x0;var _0x14cd8=_0x5eb8[_0x3b2be5];return _0x14cd8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./mailMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateMailMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['MailMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateMailMessage',_0x24cf28);logger['debug']('CreateMailMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0x1eba=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x1eba[_0x5e6bec];return _0x5dc5cf;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});config[_0xa1eb('0xc')]=_[_0xa1eb('0xd')](config[_0xa1eb('0xc')],{'host':_0xa1eb('0xe'),'port':0x18eb});var socket=require(_0xa1eb('0xf'))(new Redis(config['redis']));require(_0xa1eb('0x10'))['register'](socket);function respondWithRpcPromise(_0x219802,_0x54cdad,_0x3f53ff){return new BPromise(function(_0x5d7101,_0x41a7bc){return client['request'](_0x219802,_0x3f53ff)[_0xa1eb('0x11')](function(_0x325d13){logger[_0xa1eb('0x12')]('MailMessage,\x20%s,\x20%s',_0x54cdad,_0xa1eb('0x13'));logger[_0xa1eb('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x54cdad,_0xa1eb('0x13'),JSON['stringify'](_0x325d13));if(_0x325d13['error']){if(_0x325d13[_0xa1eb('0x15')]['code']===0x1f4){logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x325d13[_0xa1eb('0x15')][_0xa1eb('0x17')]);return _0x41a7bc(_0x325d13[_0xa1eb('0x15')][_0xa1eb('0x17')]);}logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x325d13[_0xa1eb('0x15')]['message']);return _0x5d7101(_0x325d13[_0xa1eb('0x15')]['message']);}else{logger[_0xa1eb('0x12')](_0xa1eb('0x16'),_0x54cdad,_0xa1eb('0x13'));_0x5d7101(_0x325d13[_0xa1eb('0x18')]['message']);}})[_0xa1eb('0x19')](function(_0x22cd44){logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x22cd44);_0x41a7bc(_0x22cd44);});});}exports[_0xa1eb('0x1a')]=function(_0x3b8607){var _0x2143e6=this;return new Promise(function(_0x166f7f,_0x4fc14a){return db[_0xa1eb('0x1b')]['create'](_0x3b8607[_0xa1eb('0x1c')],{'raw':_0x3b8607[_0xa1eb('0x1d')]?_0x3b8607[_0xa1eb('0x1d')][_0xa1eb('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x539634){logger[_0xa1eb('0x12')](_0xa1eb('0x1a'),_0x3b8607);logger['debug'](_0xa1eb('0x1a'),_0x3b8607,JSON[_0xa1eb('0x1f')](_0x539634));_0x166f7f(_0x539634);})[_0xa1eb('0x19')](function(_0xa6b20c){logger[_0xa1eb('0x15')](_0xa1eb('0x1a'),_0xa6b20c[_0xa1eb('0x17')],_0x3b8607);_0x4fc14a(_0x2143e6[_0xa1eb('0x15')](0x1f4,_0xa6b20c[_0xa1eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8a5e6ee..8c0bd0b 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 _0x0751=['update','emit','removeListener','register','./mailMessage.events','save','remove'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x0751,0xd6));var _0x1075=function(_0x283006,_0x54f88d){_0x283006=_0x283006-0x0;var _0x162518=_0x0751[_0x283006];return _0x162518;};'use strict';var MailMessageEvents=require(_0x1075('0x0'));var events=[_0x1075('0x1'),_0x1075('0x2'),_0x1075('0x3')];function createListener(_0x5ba0ae,_0x42781e){return function(_0xd4a405){_0x42781e[_0x1075('0x4')](_0x5ba0ae,_0xd4a405);};}function removeListener(_0x63e36b,_0x5d57f3){return function(){MailMessageEvents[_0x1075('0x5')](_0x63e36b,_0x5d57f3);};}exports[_0x1075('0x6')]=function(_0x326346){for(var _0x57e76a=0x0,_0x2c5597=events['length'];_0x57e76a<_0x2c5597;_0x57e76a++){var _0x1a0733=events[_0x57e76a];var _0xd4f952=createListener('mailMessage:'+_0x1a0733,_0x326346);MailMessageEvents['on'](_0x1a0733,_0xd4f952);}}; \ No newline at end of file +var _0xb379=['emit','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0x1566d9,_0x2f1c84){var _0x4e2d88=function(_0x4840ee){while(--_0x4840ee){_0x1566d9['push'](_0x1566d9['shift']());}};_0x4e2d88(++_0x2f1c84);}(_0xb379,0x16b));var _0x9b37=function(_0x1bedd2,_0x53bc08){_0x1bedd2=_0x1bedd2-0x0;var _0x5bee62=_0xb379[_0x1bedd2];return _0x5bee62;};'use strict';var MailMessageEvents=require(_0x9b37('0x0'));var events=['save',_0x9b37('0x1'),_0x9b37('0x2')];function createListener(_0x1bda6a,_0x580282){return function(_0x44b762){_0x580282[_0x9b37('0x3')](_0x1bda6a,_0x44b762);};}function removeListener(_0x2f4618,_0x89fd51){return function(){MailMessageEvents['removeListener'](_0x2f4618,_0x89fd51);};}exports['register']=function(_0x344fb5){for(var _0x371d38=0x0,_0x170765=events[_0x9b37('0x4')];_0x371d38<_0x170765;_0x371d38++){var _0x2fba29=events[_0x371d38];var _0x46b93b=createListener(_0x9b37('0x5')+_0x2fba29,_0x344fb5);MailMessageEvents['on'](_0x2fba29,_0x46b93b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index bff8334..9f1f284 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 _0x2eaa=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','getTeams','/:id/users','create','/:id/teams','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0x3d990d,_0x5312ac){var _0xd94d77=function(_0x2717e4){while(--_0x2717e4){_0x3d990d['push'](_0x3d990d['shift']());}};_0xd94d77(++_0x5312ac);}(_0x2eaa,0x151));var _0xa2ea=function(_0x4c30cd,_0x212d21){_0x4c30cd=_0x4c30cd-0x0;var _0x4574e5=_0x2eaa[_0x4c30cd];return _0x4574e5;};'use strict';var multer=require(_0xa2ea('0x0'));var util=require(_0xa2ea('0x1'));var path=require(_0xa2ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xa2ea('0x3'));var router=express['Router']();var fs_extra=require(_0xa2ea('0x4'));var auth=require(_0xa2ea('0x5'));var interaction=require(_0xa2ea('0x6'));var config=require(_0xa2ea('0x7'));var controller=require(_0xa2ea('0x8'));router[_0xa2ea('0x9')]('/',auth['isAuthenticated'](),controller[_0xa2ea('0xa')]);router[_0xa2ea('0x9')]('/describe',auth[_0xa2ea('0xb')](),controller[_0xa2ea('0xc')]);router[_0xa2ea('0x9')]('/:id',auth[_0xa2ea('0xb')](),controller[_0xa2ea('0xd')]);router['get'](_0xa2ea('0xe'),auth[_0xa2ea('0xb')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xa2ea('0xb')](),controller[_0xa2ea('0xf')]);router['get'](_0xa2ea('0x10'),auth[_0xa2ea('0xb')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xa2ea('0x11')]);router['post'](_0xa2ea('0x12'),auth[_0xa2ea('0xb')](),controller[_0xa2ea('0x13')]);router['post'](_0xa2ea('0x10'),auth[_0xa2ea('0xb')](),controller[_0xa2ea('0x14')]);router['put'](_0xa2ea('0x15'),auth[_0xa2ea('0xb')](),controller[_0xa2ea('0x16')]);router[_0xa2ea('0x17')](_0xa2ea('0x15'),auth[_0xa2ea('0xb')](),controller[_0xa2ea('0x18')]);router[_0xa2ea('0x17')](_0xa2ea('0x12'),auth[_0xa2ea('0xb')](),controller[_0xa2ea('0x19')]);router[_0xa2ea('0x17')](_0xa2ea('0x10'),auth[_0xa2ea('0xb')](),controller[_0xa2ea('0x1a')]);module[_0xa2ea('0x1b')]=router; \ No newline at end of file +var _0x92d0=['post','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x259c04,_0x3539aa){var _0x36e2ad=function(_0x2445ab){while(--_0x2445ab){_0x259c04['push'](_0x259c04['shift']());}};_0x36e2ad(++_0x3539aa);}(_0x92d0,0x19d));var _0x092d=function(_0xe8b420,_0x1a892d){_0xe8b420=_0xe8b420-0x0;var _0x50f7b7=_0x92d0[_0xe8b420];return _0x50f7b7;};'use strict';var multer=require(_0x092d('0x0'));var util=require(_0x092d('0x1'));var path=require('path');var timeout=require(_0x092d('0x2'));var express=require(_0x092d('0x3'));var router=express[_0x092d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x092d('0x5'));var config=require(_0x092d('0x6'));var controller=require(_0x092d('0x7'));router[_0x092d('0x8')]('/',auth[_0x092d('0x9')](),controller[_0x092d('0xa')]);router[_0x092d('0x8')](_0x092d('0xb'),auth[_0x092d('0x9')](),controller[_0x092d('0xc')]);router[_0x092d('0x8')](_0x092d('0xd'),auth['isAuthenticated'](),controller[_0x092d('0xe')]);router[_0x092d('0x8')](_0x092d('0xf'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x092d('0x10'),auth[_0x092d('0x9')](),controller[_0x092d('0x11')]);router[_0x092d('0x8')](_0x092d('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0x092d('0x13')]('/',auth[_0x092d('0x9')](),controller['create']);router['post'](_0x092d('0x10'),auth[_0x092d('0x9')](),controller['addTeams']);router[_0x092d('0x13')](_0x092d('0x12'),auth[_0x092d('0x9')](),controller[_0x092d('0x14')]);router[_0x092d('0x15')](_0x092d('0xd'),auth[_0x092d('0x9')](),controller[_0x092d('0x16')]);router[_0x092d('0x17')](_0x092d('0xd'),auth['isAuthenticated'](),controller[_0x092d('0x18')]);router[_0x092d('0x17')](_0x092d('0x10'),auth[_0x092d('0x9')](),controller[_0x092d('0x19')]);router[_0x092d('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x092d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 16cef2e..e6772f3 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 _0xb276=['STRING','name','INTEGER','ENUM'];(function(_0x3cd2c0,_0x26bfff){var _0x50f5d6=function(_0x50f3f1){while(--_0x50f3f1){_0x3cd2c0['push'](_0x3cd2c0['shift']());}};_0x50f5d6(++_0x26bfff);}(_0xb276,0x1cc));var _0x6b27=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0xb276[_0x5bfa44];return _0x43815f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6b27('0x0')],'unique':_0x6b27('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6b27('0x0')]},'timeout':{'type':Sequelize[_0x6b27('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6b27('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0xb831=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x4a6741,_0x5113be){var _0x138c39=function(_0xf37d9a){while(--_0xf37d9a){_0x4a6741['push'](_0x4a6741['shift']());}};_0x138c39(++_0x5113be);}(_0xb831,0x159));var _0x1b83=function(_0x3d414a,_0x34fa18){_0x3d414a=_0x3d414a-0x0;var _0x1d4abc=_0xb831[_0x3d414a];return _0x1d4abc;};'use strict';var Sequelize=require(_0x1b83('0x0'));module[_0x1b83('0x1')]={'name':{'type':Sequelize[_0x1b83('0x2')],'unique':_0x1b83('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1b83('0x2')]},'timeout':{'type':Sequelize[_0x1b83('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b83('0x5')](_0x1b83('0x6'),_0x1b83('0x7'),_0x1b83('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8768d23..753849d 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 _0xa914=['getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','MailQueues','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','show','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','user','get','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','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','MailQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','mailPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','sequelize','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray'];(function(_0xf62e6c,_0x160938){var _0x14234f=function(_0x16fe1d){while(--_0x16fe1d){_0xf62e6c['push'](_0xf62e6c['shift']());}};_0x14234f(++_0x160938);}(_0xa914,0x184));var _0x4a91=function(_0x323fff,_0x38f93e){_0x323fff=_0x323fff-0x0;var _0x326de5=_0xa914[_0x323fff];return _0x326de5;};'use strict';var BPromise=require(_0x4a91('0x0'));var util=require(_0x4a91('0x1'));var _=require(_0x4a91('0x2'));var squel=require(_0x4a91('0x3'));var Redis=require(_0x4a91('0x4'));var qs=require(_0x4a91('0x5'));var logger=require(_0x4a91('0x6'))(_0x4a91('0x7'));var config=require(_0x4a91('0x8'));var db=require(_0x4a91('0x9'))['db'];config[_0x4a91('0xa')]=_[_0x4a91('0xb')](config[_0x4a91('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a91('0xa')]));require(_0x4a91('0xc'))[_0x4a91('0xd')](socket);function respondWithStatusCode(_0x606c79,_0x2c1222){_0x2c1222=_0x2c1222||0xcc;return function(_0x40f3a8){if(_0x40f3a8){return _0x606c79[_0x4a91('0xe')](_0x2c1222);}return _0x606c79[_0x4a91('0xf')](_0x2c1222)[_0x4a91('0x10')]();};}function respondWithResult(_0x542685,_0x37f216){_0x37f216=_0x37f216||0xc8;return function(_0x2550c7){if(_0x2550c7){return _0x542685[_0x4a91('0xf')](_0x37f216)[_0x4a91('0x11')](_0x2550c7);}};}function respondWithFilteredResult(_0x2e63f8,_0x2fa771){return function(_0x18ea44){if(_0x18ea44){var _0x575405=typeof _0x2fa771['offset']===_0x4a91('0x12')&&typeof _0x2fa771[_0x4a91('0x13')]===_0x4a91('0x12');var _0x3ad98d=_0x18ea44[_0x4a91('0x14')];var _0x1c2c57=_0x575405?0x0:_0x2fa771['offset'];var _0x1c86ce=_0x575405?_0x18ea44[_0x4a91('0x14')]:_0x2fa771[_0x4a91('0x15')]+_0x2fa771[_0x4a91('0x13')];var _0x2d2b0f;if(_0x1c86ce>=_0x3ad98d){_0x1c86ce=_0x3ad98d;_0x2d2b0f=0xc8;}else{_0x2d2b0f=0xce;}_0x2e63f8['status'](_0x2d2b0f);return _0x2e63f8[_0x4a91('0x16')](_0x4a91('0x17'),_0x1c2c57+'-'+_0x1c86ce+'/'+_0x3ad98d)[_0x4a91('0x11')](_0x18ea44);}return null;};}function saveUpdates(_0x2bc9ca){return function(_0x5da8d9){if(_0x5da8d9){return _0x5da8d9[_0x4a91('0x18')](_0x2bc9ca)[_0x4a91('0x19')](function(_0x4d6360){return _0x4d6360;});}return null;};}function removeEntity(_0x33a467){return function(_0x4b1acf){if(_0x4b1acf){return _0x4b1acf['destroy']()[_0x4a91('0x19')](function(){var _0x573183=_0x4b1acf['get']({'plain':!![]});var _0x32d3e5=_0x4a91('0x1a');return db['UserProfileResource'][_0x4a91('0x1b')]({'where':{'type':_0x32d3e5,'resourceId':_0x573183['id']}})[_0x4a91('0x19')](function(){return _0x4b1acf;});})['then'](function(){_0x33a467[_0x4a91('0xf')](0xcc)[_0x4a91('0x10')]();});}};}function handleEntityNotFound(_0x19b9d6){return function(_0x4cbc46){if(!_0x4cbc46){_0x19b9d6[_0x4a91('0xe')](0x194);}return _0x4cbc46;};}function handleError(_0x62f1ab,_0x431da5){_0x431da5=_0x431da5||0x1f4;return function(_0x45efc0){logger[_0x4a91('0x1c')](_0x45efc0[_0x4a91('0x1d')]);if(_0x45efc0[_0x4a91('0x1e')]){delete _0x45efc0[_0x4a91('0x1e')];}_0x62f1ab[_0x4a91('0xf')](_0x431da5)[_0x4a91('0x1f')](_0x45efc0);};}exports[_0x4a91('0x20')]=function(_0x5054a1,_0x2151dc){var _0xb1d2c7={};var _0x1509b5={'count':0x0,'rows':[]};var _0xdbe7ae=_[_0x4a91('0x21')](db[_0x4a91('0x22')][_0x4a91('0x23')],function(_0x5628bb){return{'name':_0x5628bb[_0x4a91('0x24')],'type':_0x5628bb[_0x4a91('0x25')][_0x4a91('0x26')]};});_0xb1d2c7=qs[_0x4a91('0x27')](_0xdbe7ae,_0x5054a1);var _0x59f49d={'where':_0xb1d2c7[_0x4a91('0x28')]};return db[_0x4a91('0x22')][_0x4a91('0x14')](_0x59f49d)['then'](function(_0x4722b3){_0x1509b5['count']=_0x4722b3;_0xb1d2c7[_0x4a91('0x29')]=qs[_0x4a91('0x29')](_0x5054a1[_0x4a91('0x2a')]);return db[_0x4a91('0x22')][_0x4a91('0x2b')](_0xb1d2c7);})[_0x4a91('0x19')](function(_0x560a25){_0x1509b5[_0x4a91('0x2c')]=_0x560a25;return _0x1509b5;})[_0x4a91('0x19')](respondWithFilteredResult(_0x2151dc,_0xb1d2c7))['catch'](handleError(_0x2151dc,null));};exports[_0x4a91('0x2d')]=function(_0x437ab1,_0x17af88){var _0x2e9a6={'raw':!![],'where':{'id':_0x437ab1['params']['id']}},_0x8f26d9={};_0x8f26d9[_0x4a91('0x2e')]=_[_0x4a91('0x2f')](db[_0x4a91('0x22')][_0x4a91('0x23')]);_0x8f26d9[_0x4a91('0x2a')]=_['keys'](_0x437ab1['query']);_0x8f26d9[_0x4a91('0x30')]=_[_0x4a91('0x31')](_0x8f26d9[_0x4a91('0x2e')],_0x8f26d9[_0x4a91('0x2a')]);_0x2e9a6['attributes']=_[_0x4a91('0x31')](_0x8f26d9['model'],qs['fields'](_0x437ab1[_0x4a91('0x2a')][_0x4a91('0x32')]));_0x2e9a6[_0x4a91('0x33')]=_0x2e9a6[_0x4a91('0x33')][_0x4a91('0x34')]?_0x2e9a6['attributes']:_0x8f26d9[_0x4a91('0x2e')];if(_0x437ab1['query'][_0x4a91('0x35')]){_0x2e9a6[_0x4a91('0x29')]=[{'all':!![]}];}_0x2e9a6=_[_0x4a91('0x36')]({},_0x2e9a6,_0x437ab1[_0x4a91('0x37')]);return db[_0x4a91('0x22')][_0x4a91('0x38')](_0x2e9a6)[_0x4a91('0x19')](handleEntityNotFound(_0x17af88,null))[_0x4a91('0x19')](respondWithResult(_0x17af88,null))[_0x4a91('0x39')](handleError(_0x17af88,null));};exports[_0x4a91('0x3a')]=function(_0x52d832,_0x1596e8){return db['MailQueue'][_0x4a91('0x3a')](_0x52d832['body'],{})[_0x4a91('0x19')](function(_0x554f4c){var _0x2b2254=_0x52d832[_0x4a91('0x3b')][_0x4a91('0x3c')]({'plain':!![]});if(!_0x2b2254)throw new Error(_0x4a91('0x3d'));if(_0x2b2254[_0x4a91('0x3e')]===_0x4a91('0x3b')){var _0x1e6dd2=_0x554f4c[_0x4a91('0x3c')]({'plain':!![]});var _0x364739='MailQueues';return db[_0x4a91('0x3f')][_0x4a91('0x38')]({'where':{'name':_0x364739,'userProfileId':_0x2b2254[_0x4a91('0x40')]},'raw':!![]})[_0x4a91('0x19')](function(_0x3c74ce){if(_0x3c74ce&&_0x3c74ce[_0x4a91('0x41')]===0x0){return db['UserProfileResource'][_0x4a91('0x3a')]({'name':_0x1e6dd2['name'],'resourceId':_0x1e6dd2['id'],'type':_0x3c74ce[_0x4a91('0x1e')],'sectionId':_0x3c74ce['id']},{})['then'](function(){return _0x554f4c;});}else{return _0x554f4c;}})['catch'](function(_0x514ee4){logger[_0x4a91('0x1c')](_0x4a91('0x42'),_0x514ee4);throw _0x514ee4;});}return _0x554f4c;})['then'](respondWithResult(_0x1596e8,0xc9))[_0x4a91('0x39')](handleError(_0x1596e8,null));};exports[_0x4a91('0x18')]=function(_0x53be28,_0x4f8d4e){if(_0x53be28[_0x4a91('0x43')]['id']){delete _0x53be28[_0x4a91('0x43')]['id'];}return db[_0x4a91('0x22')][_0x4a91('0x38')]({'where':{'id':_0x53be28[_0x4a91('0x44')]['id']}})[_0x4a91('0x19')](handleEntityNotFound(_0x4f8d4e,null))[_0x4a91('0x19')](saveUpdates(_0x53be28[_0x4a91('0x43')],null))['then'](respondWithResult(_0x4f8d4e,null))[_0x4a91('0x39')](handleError(_0x4f8d4e,null));};exports[_0x4a91('0x1b')]=function(_0x26416b,_0xae7290){return db[_0x4a91('0x22')][_0x4a91('0x38')]({'where':{'id':_0x26416b[_0x4a91('0x44')]['id']}})['then'](handleEntityNotFound(_0xae7290,null))[_0x4a91('0x19')](removeEntity(_0xae7290,null))[_0x4a91('0x39')](handleError(_0xae7290,null));};exports['describe']=function(_0x128518,_0x577091){return db[_0x4a91('0x22')][_0x4a91('0x45')]()['then'](respondWithResult(_0x577091,null))[_0x4a91('0x39')](handleError(_0x577091,null));};exports[_0x4a91('0x46')]=function(_0x4db3cb,_0x388787){var _0x5d2750={'raw':!![],'where':{}},_0x3e6d22={},_0x29ea6d;return db[_0x4a91('0x22')][_0x4a91('0x47')]({'where':{'id':_0x4db3cb[_0x4a91('0x44')]['id']}})[_0x4a91('0x19')](handleEntityNotFound(_0x388787,null))[_0x4a91('0x19')](function(_0x468a78){if(_0x468a78){_0x29ea6d=_0x468a78['get']({'plain':!![]});_0x3e6d22[_0x4a91('0x2e')]=_[_0x4a91('0x2f')](db[_0x4a91('0x48')][_0x4a91('0x23')]);_0x3e6d22['query']=_[_0x4a91('0x2f')](_0x4db3cb[_0x4a91('0x2a')]);_0x3e6d22[_0x4a91('0x30')]=_[_0x4a91('0x31')](_0x3e6d22[_0x4a91('0x2e')],_0x3e6d22[_0x4a91('0x2a')]);_0x5d2750[_0x4a91('0x33')]=_[_0x4a91('0x31')](_0x3e6d22[_0x4a91('0x2e')],qs[_0x4a91('0x32')](_0x4db3cb[_0x4a91('0x2a')][_0x4a91('0x32')]));_0x5d2750[_0x4a91('0x33')]=_0x5d2750[_0x4a91('0x33')][_0x4a91('0x34')]?_0x5d2750[_0x4a91('0x33')]:_0x3e6d22[_0x4a91('0x2e')];if(!_0x4db3cb[_0x4a91('0x2a')][_0x4a91('0x49')](_0x4a91('0x4a'))){_0x5d2750[_0x4a91('0x13')]=qs[_0x4a91('0x13')](_0x4db3cb['query'][_0x4a91('0x13')]);_0x5d2750[_0x4a91('0x15')]=qs[_0x4a91('0x15')](_0x4db3cb['query']['offset']);}_0x5d2750[_0x4a91('0x4b')]=qs['sort'](_0x4db3cb[_0x4a91('0x2a')][_0x4a91('0x4c')]);_0x5d2750[_0x4a91('0x28')]=qs[_0x4a91('0x30')](_[_0x4a91('0x4d')](_0x4db3cb[_0x4a91('0x2a')],_0x3e6d22['filters']));_0x5d2750['where'][_0x4a91('0x4e')]=_0x468a78['id'];if(_0x4db3cb[_0x4a91('0x2a')][_0x4a91('0x4f')]){_0x5d2750[_0x4a91('0x28')]=_[_0x4a91('0x36')](_0x5d2750['where'],{'$or':_[_0x4a91('0x21')](_0x5d2750['attributes'],function(_0x29f681){var _0x51c6e2={};_0x51c6e2[_0x29f681]={'$like':'%'+_0x4db3cb[_0x4a91('0x2a')][_0x4a91('0x4f')]+'%'};return _0x51c6e2;})});}_0x5d2750=_[_0x4a91('0x36')]({},_0x5d2750,_0x4db3cb[_0x4a91('0x37')]);return db[_0x4a91('0x48')]['findAll'](_0x5d2750);}})[_0x4a91('0x19')](function(_0xf3345c){if(_0xf3345c){return db[_0x4a91('0x50')][_0x4a91('0x51')]({'where':{'id':_[_0x4a91('0x21')](_0xf3345c,_0x4a91('0x52')),'role':_0x4a91('0x53')},'attributes':['id',_0x4a91('0x1e'),'mailPause',_0x4a91('0x54'),_0x4a91('0x55')]});}})[_0x4a91('0x19')](function(_0x33a506){if(_0x33a506){return{'count':_0x33a506[_0x4a91('0x14')],'rows':_[_0x4a91('0x21')](_0x33a506[_0x4a91('0x2c')],function(_0x4c6c50){return{'membername':_0x4c6c50['name'],'UserId':_0x4c6c50['id'],'queue_name':_0x29ea6d[_0x4a91('0x1e')],'MailQueueId':_0x29ea6d['id'],'interface':util[_0x4a91('0x56')]('%s/%s',_0x4a91('0x57'),_0x4c6c50[_0x4a91('0x1e')]),'penalty':0x0,'paused':_0x4c6c50[_0x4a91('0x58')],'createdAt':_0x4c6c50[_0x4a91('0x55')],'updatedAt':_0x4c6c50[_0x4a91('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4a91('0x19')](respondWithFilteredResult(_0x388787,_0x5d2750))['catch'](handleError(_0x388787,null));};exports[_0x4a91('0x59')]=function(_0x2a099c,_0x1f1380){var _0x2a97e6={};var _0x4806b9={};var _0x410d1d;var _0x2d7eb0;return db['MailQueue'][_0x4a91('0x47')]({'where':{'id':_0x2a099c['params']['id']}})[_0x4a91('0x19')](handleEntityNotFound(_0x1f1380,null))['then'](function(_0x1fe6f1){if(_0x1fe6f1){_0x410d1d=_0x1fe6f1;_0x4806b9[_0x4a91('0x2e')]=_[_0x4a91('0x2f')](db[_0x4a91('0x5a')]['rawAttributes']);_0x4806b9[_0x4a91('0x2a')]=_[_0x4a91('0x2f')](_0x2a099c[_0x4a91('0x2a')]);_0x4806b9['filters']=_['intersection'](_0x4806b9['model'],_0x4806b9[_0x4a91('0x2a')]);_0x2a97e6['attributes']=_[_0x4a91('0x31')](_0x4806b9['model'],qs['fields'](_0x2a099c[_0x4a91('0x2a')][_0x4a91('0x32')]));_0x2a97e6[_0x4a91('0x33')]=_0x2a97e6[_0x4a91('0x33')]['length']?_0x2a97e6['attributes']:_0x4806b9[_0x4a91('0x2e')];_0x2a97e6['order']=qs[_0x4a91('0x4c')](_0x2a099c[_0x4a91('0x2a')]['sort']);_0x2a97e6[_0x4a91('0x28')]=qs[_0x4a91('0x30')](_['pick'](_0x2a099c['query'],_0x4806b9['filters']));if(_0x2a099c[_0x4a91('0x2a')][_0x4a91('0x4f')]){_0x2a97e6[_0x4a91('0x28')]=_[_0x4a91('0x36')](_0x2a97e6[_0x4a91('0x28')],{'$or':_[_0x4a91('0x21')](_0x2a97e6['attributes'],function(_0x4b00bf){var _0x378c2d={};_0x378c2d[_0x4b00bf]={'$like':'%'+_0x2a099c[_0x4a91('0x2a')][_0x4a91('0x4f')]+'%'};return _0x378c2d;})});}_0x2a97e6=_[_0x4a91('0x36')]({},_0x2a97e6,_0x2a099c[_0x4a91('0x37')]);return _0x410d1d[_0x4a91('0x59')](_0x2a97e6);}})['then'](function(_0x4b8e02){if(_0x4b8e02){_0x2d7eb0=_0x4b8e02[_0x4a91('0x34')];if(!_0x2a099c['query']['hasOwnProperty'](_0x4a91('0x4a'))){_0x2a97e6[_0x4a91('0x13')]=qs[_0x4a91('0x13')](_0x2a099c[_0x4a91('0x2a')][_0x4a91('0x13')]);_0x2a97e6['offset']=qs['offset'](_0x2a099c['query'][_0x4a91('0x15')]);}return _0x410d1d[_0x4a91('0x59')](_0x2a97e6);}})[_0x4a91('0x19')](function(_0xaab249){if(_0xaab249){return _0xaab249?{'count':_0x2d7eb0,'rows':_0xaab249}:null;}})[_0x4a91('0x19')](respondWithResult(_0x1f1380,null))[_0x4a91('0x39')](handleError(_0x1f1380,null));};exports[_0x4a91('0x5b')]=function(_0x3519d4,_0x46a37c){var _0x1113dd=_0x3519d4[_0x4a91('0x43')][_0x4a91('0x5c')];return db['Team'][_0x4a91('0x2b')]({'where':{'id':_0x1113dd},'attributes':['id'],'include':[{'model':db[_0x4a91('0x50')],'as':_0x4a91('0x5d'),'attributes':['id',_0x4a91('0x1e'),'online',_0x4a91('0x5e'),_0x4a91('0x5f')],'raw':!![]}]})[_0x4a91('0x19')](function(_0x5ac702){if(_0x5ac702){var _0x5122f6=_['flatMap'](_0x5ac702,function(_0x74b436){var _0x20ee8d=_0x74b436[_0x4a91('0x3c')]({'plain':!![]});return _0x20ee8d[_0x4a91('0x5d')];});return db['MailQueue']['find']({'where':{'id':_0x3519d4[_0x4a91('0x44')]['id']}})[_0x4a91('0x19')](function(_0x33a39e){return db[_0x4a91('0x60')]['transaction'](function(_0x2301fb){return _0x33a39e[_0x4a91('0x5b')](_0x1113dd,{'transaction':_0x2301fb})['then'](function(){return BPromise[_0x4a91('0x61')](_0x5122f6,function(_0x1ee542){return db['UserMailQueue'][_0x4a91('0x62')]({'where':{'UserId':_0x1ee542['id'],'MailQueueId':_0x3519d4[_0x4a91('0x44')]['id']},'transaction':_0x2301fb});});})[_0x4a91('0x19')](function(){_0x5122f6[_0x4a91('0x63')](function(_0x2910df){socket['emit']('userMailQueue:save',{'UserId':_0x2910df['id'],'MailQueueId':_0x33a39e['id']});});});});});}})['then'](respondWithStatusCode(_0x46a37c,null))[_0x4a91('0x39')](handleError(_0x46a37c,null));};exports[_0x4a91('0x64')]=function(_0x5b2072,_0x16c07d){return db['Team'][_0x4a91('0x2b')]({'where':{'id':_0x5b2072[_0x4a91('0x2a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4a91('0x50')],'as':_0x4a91('0x5d'),'attributes':['id'],'raw':!![]}]})[_0x4a91('0x19')](handleEntityNotFound(_0x16c07d,null))[_0x4a91('0x19')](function(_0x6b91a0){var _0x3a7be1=_[_0x4a91('0x21')](_0x6b91a0,'id');var _0x11150e=[];var _0x620098=[];var _0x31bf9e=squel[_0x4a91('0x65')]();_0x31bf9e[_0x4a91('0x66')](_0x4a91('0x67'))['from'](_0x4a91('0x68'),'tq')[_0x4a91('0x69')]('user_has_teams','ut',_0x4a91('0x6a'))[_0x4a91('0x28')](_0x4a91('0x6b'),_0x5b2072['params']['id']);for(var _0x1a47bd=0x0;_0x1a47bd<_0x6b91a0[_0x4a91('0x34')];_0x1a47bd+=0x1){let _0x56bf5f=_0x6b91a0[_0x1a47bd];for(var _0x153869=0x0;_0x153869<_0x56bf5f[_0x4a91('0x5d')]['length'];_0x153869+=0x1){let _0x3667c7=_0x56bf5f[_0x4a91('0x5d')][_0x153869];var _0x3f4f27=_0x31bf9e[_0x4a91('0x6c')]();_0x3f4f27[_0x4a91('0x28')](_0x4a91('0x6d'),_0x3667c7['id']);_0x620098[_0x4a91('0x6e')](db['sequelize'][_0x4a91('0x2a')](_0x3f4f27[_0x4a91('0x6f')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x4a91('0x19')](function(_0x255fcb){if(_0x255fcb[_0x4a91('0x34')]===0x1){return _0x3667c7['id'];}else{var _0x301bde=_[_0x4a91('0x70')](_[_0x4a91('0x21')](_0x255fcb,_0x4a91('0x71')),function(_0x257bdd){return _['includes'](_0x3a7be1,_0x257bdd);});if(_0x301bde){return _0x3667c7['id'];}}}));}}return BPromise[_0x4a91('0x72')](_0x620098)[_0x4a91('0x19')](function(_0x3653ff){_0x11150e=_(_0x11150e)[_0x4a91('0x73')](_0x3653ff)[_0x4a91('0x74')]()[_0x4a91('0x75')]();return db[_0x4a91('0x22')][_0x4a91('0x38')]({'where':{'id':_0x5b2072[_0x4a91('0x44')]['id']}})[_0x4a91('0x19')](function(_0x5a0ef0){return db[_0x4a91('0x60')][_0x4a91('0x76')](function(_0x528327){return _0x5a0ef0['removeTeams'](_0x5b2072[_0x4a91('0x2a')]['ids'],{'transaction':_0x528327})[_0x4a91('0x19')](function(){if(!_[_0x4a91('0x77')](_0x11150e)){return _0x5a0ef0[_0x4a91('0x78')](_0x11150e,{'transaction':_0x528327});}})['then'](function(){_0x11150e[_0x4a91('0x63')](function(_0x56a3c5){socket[_0x4a91('0x79')](_0x4a91('0x7a'),{'UserId':_0x56a3c5,'MailQueueId':_0x5a0ef0['id']});});});});});});})[_0x4a91('0x19')](respondWithStatusCode(_0x16c07d,null))[_0x4a91('0x39')](handleError(_0x16c07d,null));};exports[_0x4a91('0x7b')]=function(_0x92ec78,_0x583315){return db[_0x4a91('0x22')][_0x4a91('0x38')]({'where':{'id':_0x92ec78[_0x4a91('0x44')]['id']}})[_0x4a91('0x19')](handleEntityNotFound(_0x583315,null))[_0x4a91('0x19')](function(_0xa64322){if(_0xa64322){return _0xa64322[_0x4a91('0x7b')](_0x92ec78[_0x4a91('0x43')]['ids'],_[_0x4a91('0x7c')](_0x92ec78[_0x4a91('0x43')],[_0x4a91('0x5c'),'id'])||{})[_0x4a91('0x7d')](function(_0x5a0a03){for(var _0x5ecded=0x0;_0x5ecded<_0x92ec78[_0x4a91('0x43')][_0x4a91('0x5c')][_0x4a91('0x34')];_0x5ecded+=0x1){socket['emit'](_0x4a91('0x7e'),{'UserId':Number(_0x92ec78[_0x4a91('0x43')][_0x4a91('0x5c')][_0x5ecded]),'MailQueueId':Number(_0x92ec78[_0x4a91('0x44')]['id'])});}return _0x5a0a03;});}})[_0x4a91('0x19')](respondWithResult(_0x583315,null))[_0x4a91('0x39')](handleError(_0x583315,null));};exports[_0x4a91('0x78')]=function(_0x526d24,_0x5b08b4){return db[_0x4a91('0x22')][_0x4a91('0x38')]({'where':{'id':_0x526d24[_0x4a91('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b08b4,null))[_0x4a91('0x19')](function(_0x46c287){if(_0x46c287){return _0x46c287[_0x4a91('0x78')](_0x526d24[_0x4a91('0x2a')][_0x4a91('0x5c')])[_0x4a91('0x19')](function(){if(_[_0x4a91('0x7f')](_0x526d24[_0x4a91('0x2a')][_0x4a91('0x5c')])){for(var _0x3e1403=0x0;_0x3e1403<_0x526d24[_0x4a91('0x2a')]['ids'][_0x4a91('0x34')];_0x3e1403+=0x1){socket['emit'](_0x4a91('0x7a'),{'UserId':Number(_0x526d24[_0x4a91('0x2a')]['ids'][_0x3e1403]),'MailQueueId':Number(_0x526d24[_0x4a91('0x44')]['id'])});}}else{socket[_0x4a91('0x79')](_0x4a91('0x7a'),{'UserId':Number(_0x526d24[_0x4a91('0x2a')][_0x4a91('0x5c')]),'MailQueueId':Number(_0x526d24[_0x4a91('0x44')]['id'])});}});}})[_0x4a91('0x19')](respondWithStatusCode(_0x5b08b4,null))[_0x4a91('0x39')](handleError(_0x5b08b4,null));};exports[_0x4a91('0x80')]=function(_0x37c2e8,_0x46859c){var _0x247b56={};var _0xd7d1c7={};var _0x109d38;var _0x493791;return db['MailQueue'][_0x4a91('0x47')]({'where':{'id':_0x37c2e8[_0x4a91('0x44')]['id']}})[_0x4a91('0x19')](handleEntityNotFound(_0x46859c,null))[_0x4a91('0x19')](function(_0x20bd4a){if(_0x20bd4a){_0x109d38=_0x20bd4a;_0xd7d1c7[_0x4a91('0x2e')]=_['keys'](db[_0x4a91('0x50')][_0x4a91('0x23')]);_0xd7d1c7[_0x4a91('0x2a')]=_['keys'](_0x37c2e8[_0x4a91('0x2a')]);_0xd7d1c7[_0x4a91('0x30')]=_[_0x4a91('0x31')](_0xd7d1c7[_0x4a91('0x2e')],_0xd7d1c7['query']);_0x247b56['attributes']=_[_0x4a91('0x31')](_0xd7d1c7['model'],qs[_0x4a91('0x32')](_0x37c2e8['query'][_0x4a91('0x32')]));_0x247b56['attributes']=_0x247b56['attributes']['length']?_0x247b56[_0x4a91('0x33')]:_0xd7d1c7[_0x4a91('0x2e')];_0x247b56['order']=qs[_0x4a91('0x4c')](_0x37c2e8['query']['sort']);_0x247b56[_0x4a91('0x28')]=qs[_0x4a91('0x30')](_[_0x4a91('0x4d')](_0x37c2e8[_0x4a91('0x2a')],_0xd7d1c7[_0x4a91('0x30')]));if(_0x37c2e8[_0x4a91('0x2a')][_0x4a91('0x4f')]){_0x247b56[_0x4a91('0x28')]=_[_0x4a91('0x36')](_0x247b56['where'],{'$or':_['map'](_0x247b56[_0x4a91('0x33')],function(_0x357ca9){var _0x21f40c={};_0x21f40c[_0x357ca9]={'$like':'%'+_0x37c2e8[_0x4a91('0x2a')][_0x4a91('0x4f')]+'%'};return _0x21f40c;})});}_0x247b56=_[_0x4a91('0x36')]({},_0x247b56,_0x37c2e8[_0x4a91('0x37')]);return _0x109d38[_0x4a91('0x80')](_0x247b56);}})[_0x4a91('0x19')](function(_0x496df3){if(_0x496df3){_0x493791=_0x496df3[_0x4a91('0x34')];if(!_0x37c2e8[_0x4a91('0x2a')][_0x4a91('0x49')]('nolimit')){_0x247b56['limit']=qs[_0x4a91('0x13')](_0x37c2e8[_0x4a91('0x2a')]['limit']);_0x247b56[_0x4a91('0x15')]=qs[_0x4a91('0x15')](_0x37c2e8[_0x4a91('0x2a')][_0x4a91('0x15')]);}return _0x109d38[_0x4a91('0x80')](_0x247b56);}})[_0x4a91('0x19')](function(_0xdb420a){if(_0xdb420a){return _0xdb420a?{'count':_0x493791,'rows':_0xdb420a}:null;}})[_0x4a91('0x19')](respondWithResult(_0x46859c,null))['catch'](handleError(_0x46859c,null));}; \ No newline at end of file +var _0x54d2=['type','key','getOptions','where','MailQueue','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','nolimit','limit','sort','pick','MailQueueId','merge','filter','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','findOne','Team','getTeams','hasOwnProperty','ids','Agents','voicePause','interface','sequelize','each','findOrCreate','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','spread','isArray','getAgents','order','bluebird','util','lodash','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./mailQueue.socket','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','then','destroy','MailQueues','error','stack','name','send','map','rawAttributes','fieldName'];(function(_0x4e8d06,_0xe6367b){var _0x3cae4a=function(_0x1b76fd){while(--_0x1b76fd){_0x4e8d06['push'](_0x4e8d06['shift']());}};_0x3cae4a(++_0xe6367b);}(_0x54d2,0x1ca));var _0x254d=function(_0xc79e5a,_0x17c9f5){_0xc79e5a=_0xc79e5a-0x0;var _0x506af5=_0x54d2[_0xc79e5a];return _0x506af5;};'use strict';var BPromise=require(_0x254d('0x0'));var util=require(_0x254d('0x1'));var _=require(_0x254d('0x2'));var squel=require(_0x254d('0x3'));var Redis=require('ioredis');var qs=require(_0x254d('0x4'));var logger=require('../../config/logger')(_0x254d('0x5'));var config=require(_0x254d('0x6'));var db=require(_0x254d('0x7'))['db'];config[_0x254d('0x8')]=_['defaults'](config[_0x254d('0x8')],{'host':_0x254d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x254d('0xa'))['register'](socket);function respondWithStatusCode(_0x3fcb48,_0x5e3534){_0x5e3534=_0x5e3534||0xcc;return function(_0x52182c){if(_0x52182c){return _0x3fcb48[_0x254d('0xb')](_0x5e3534);}return _0x3fcb48[_0x254d('0xc')](_0x5e3534)[_0x254d('0xd')]();};}function respondWithResult(_0x569213,_0x312d5d){_0x312d5d=_0x312d5d||0xc8;return function(_0x217736){if(_0x217736){return _0x569213[_0x254d('0xc')](_0x312d5d)[_0x254d('0xe')](_0x217736);}};}function respondWithFilteredResult(_0x25c125,_0x2530a0){return function(_0x49cca3){if(_0x49cca3){var _0x2a4d0c=typeof _0x2530a0['offset']===_0x254d('0xf')&&typeof _0x2530a0['limit']===_0x254d('0xf');var _0x11b9cb=_0x49cca3['count'];var _0x33caef=_0x2a4d0c?0x0:_0x2530a0[_0x254d('0x10')];var _0x1dc1aa=_0x2a4d0c?_0x49cca3[_0x254d('0x11')]:_0x2530a0[_0x254d('0x10')]+_0x2530a0['limit'];var _0x34afa6;if(_0x1dc1aa>=_0x11b9cb){_0x1dc1aa=_0x11b9cb;_0x34afa6=0xc8;}else{_0x34afa6=0xce;}_0x25c125[_0x254d('0xc')](_0x34afa6);return _0x25c125[_0x254d('0x12')](_0x254d('0x13'),_0x33caef+'-'+_0x1dc1aa+'/'+_0x11b9cb)[_0x254d('0xe')](_0x49cca3);}return null;};}function saveUpdates(_0x15838e){return function(_0x2e59a8){if(_0x2e59a8){return _0x2e59a8['update'](_0x15838e)[_0x254d('0x14')](function(_0x40d344){return _0x40d344;});}return null;};}function removeEntity(_0x5b5fb0){return function(_0x4664f8){if(_0x4664f8){return _0x4664f8[_0x254d('0x15')]()[_0x254d('0x14')](function(){var _0x2a094d=_0x4664f8['get']({'plain':!![]});var _0x3f2551=_0x254d('0x16');return db['UserProfileResource'][_0x254d('0x15')]({'where':{'type':_0x3f2551,'resourceId':_0x2a094d['id']}})['then'](function(){return _0x4664f8;});})[_0x254d('0x14')](function(){_0x5b5fb0[_0x254d('0xc')](0xcc)[_0x254d('0xd')]();});}};}function handleEntityNotFound(_0x96efb1){return function(_0x26735b){if(!_0x26735b){_0x96efb1[_0x254d('0xb')](0x194);}return _0x26735b;};}function handleError(_0x52edeb,_0x1140ae){_0x1140ae=_0x1140ae||0x1f4;return function(_0x3ab642){logger[_0x254d('0x17')](_0x3ab642[_0x254d('0x18')]);if(_0x3ab642[_0x254d('0x19')]){delete _0x3ab642[_0x254d('0x19')];}_0x52edeb['status'](_0x1140ae)[_0x254d('0x1a')](_0x3ab642);};}exports['index']=function(_0x1c0c88,_0x1f5bb4){var _0x546f7f={};var _0x56ad50={'count':0x0,'rows':[]};var _0x449acd=_[_0x254d('0x1b')](db['MailQueue'][_0x254d('0x1c')],function(_0x168a3d){return{'name':_0x168a3d[_0x254d('0x1d')],'type':_0x168a3d[_0x254d('0x1e')][_0x254d('0x1f')]};});_0x546f7f=qs[_0x254d('0x20')](_0x449acd,_0x1c0c88);var _0x4e2a08={'where':_0x546f7f[_0x254d('0x21')]};return db[_0x254d('0x22')][_0x254d('0x11')](_0x4e2a08)[_0x254d('0x14')](function(_0x2af3ea){_0x56ad50['count']=_0x2af3ea;_0x546f7f['include']=qs[_0x254d('0x23')](_0x1c0c88[_0x254d('0x24')]);return db['MailQueue'][_0x254d('0x25')](_0x546f7f);})['then'](function(_0x4d6fdb){_0x56ad50[_0x254d('0x26')]=_0x4d6fdb;return _0x56ad50;})[_0x254d('0x14')](respondWithFilteredResult(_0x1f5bb4,_0x546f7f))[_0x254d('0x27')](handleError(_0x1f5bb4,null));};exports[_0x254d('0x28')]=function(_0x56ecf4,_0x2b42de){var _0x32a93f={'raw':!![],'where':{'id':_0x56ecf4[_0x254d('0x29')]['id']}},_0xf9b910={};_0xf9b910[_0x254d('0x2a')]=_[_0x254d('0x2b')](db[_0x254d('0x22')][_0x254d('0x1c')]);_0xf9b910[_0x254d('0x24')]=_['keys'](_0x56ecf4[_0x254d('0x24')]);_0xf9b910[_0x254d('0x2c')]=_[_0x254d('0x2d')](_0xf9b910['model'],_0xf9b910[_0x254d('0x24')]);_0x32a93f[_0x254d('0x2e')]=_[_0x254d('0x2d')](_0xf9b910['model'],qs[_0x254d('0x2f')](_0x56ecf4['query'][_0x254d('0x2f')]));_0x32a93f[_0x254d('0x2e')]=_0x32a93f[_0x254d('0x2e')][_0x254d('0x30')]?_0x32a93f['attributes']:_0xf9b910[_0x254d('0x2a')];if(_0x56ecf4[_0x254d('0x24')]['includeAll']){_0x32a93f[_0x254d('0x23')]=[{'all':!![]}];}_0x32a93f=_['merge']({},_0x32a93f,_0x56ecf4[_0x254d('0x31')]);return db[_0x254d('0x22')][_0x254d('0x32')](_0x32a93f)[_0x254d('0x14')](handleEntityNotFound(_0x2b42de,null))[_0x254d('0x14')](respondWithResult(_0x2b42de,null))[_0x254d('0x27')](handleError(_0x2b42de,null));};exports[_0x254d('0x33')]=function(_0x2badcd,_0x5ba2b8){return db['MailQueue'][_0x254d('0x33')](_0x2badcd[_0x254d('0x34')],{})[_0x254d('0x14')](function(_0x47314c){var _0x259afc=_0x2badcd[_0x254d('0x35')][_0x254d('0x36')]({'plain':!![]});if(!_0x259afc)throw new Error(_0x254d('0x37'));if(_0x259afc[_0x254d('0x38')]==='user'){var _0x1d741d=_0x47314c[_0x254d('0x36')]({'plain':!![]});var _0x5eb9bc=_0x254d('0x16');return db[_0x254d('0x39')][_0x254d('0x32')]({'where':{'name':_0x5eb9bc,'userProfileId':_0x259afc['userProfileId']},'raw':!![]})[_0x254d('0x14')](function(_0x5629e5){if(_0x5629e5&&_0x5629e5[_0x254d('0x3a')]===0x0){return db[_0x254d('0x3b')][_0x254d('0x33')]({'name':_0x1d741d[_0x254d('0x19')],'resourceId':_0x1d741d['id'],'type':_0x5629e5[_0x254d('0x19')],'sectionId':_0x5629e5['id']},{})[_0x254d('0x14')](function(){return _0x47314c;});}else{return _0x47314c;}})[_0x254d('0x27')](function(_0x633032){logger['error'](_0x254d('0x3c'),_0x633032);throw _0x633032;});}return _0x47314c;})[_0x254d('0x14')](respondWithResult(_0x5ba2b8,0xc9))[_0x254d('0x27')](handleError(_0x5ba2b8,null));};exports['update']=function(_0x288849,_0x328a2b){if(_0x288849['body']['id']){delete _0x288849[_0x254d('0x34')]['id'];}return db[_0x254d('0x22')][_0x254d('0x32')]({'where':{'id':_0x288849['params']['id']}})[_0x254d('0x14')](handleEntityNotFound(_0x328a2b,null))[_0x254d('0x14')](saveUpdates(_0x288849['body'],null))[_0x254d('0x14')](respondWithResult(_0x328a2b,null))[_0x254d('0x27')](handleError(_0x328a2b,null));};exports[_0x254d('0x15')]=function(_0x18f975,_0x216333){return db['MailQueue']['find']({'where':{'id':_0x18f975[_0x254d('0x29')]['id']}})[_0x254d('0x14')](handleEntityNotFound(_0x216333,null))['then'](removeEntity(_0x216333,null))[_0x254d('0x27')](handleError(_0x216333,null));};exports[_0x254d('0x3d')]=function(_0x33f369,_0xc42a3d){return db['MailQueue'][_0x254d('0x3d')]()[_0x254d('0x14')](respondWithResult(_0xc42a3d,null))[_0x254d('0x27')](handleError(_0xc42a3d,null));};exports[_0x254d('0x3e')]=function(_0x4c103c,_0x2ad15e){var _0x3fd2ec={'raw':!![],'where':{}},_0x33998a={},_0x908e5e;return db['MailQueue']['findOne']({'where':{'id':_0x4c103c[_0x254d('0x29')]['id']}})[_0x254d('0x14')](handleEntityNotFound(_0x2ad15e,null))[_0x254d('0x14')](function(_0x260509){if(_0x260509){_0x908e5e=_0x260509[_0x254d('0x36')]({'plain':!![]});_0x33998a['model']=_[_0x254d('0x2b')](db[_0x254d('0x3f')]['rawAttributes']);_0x33998a[_0x254d('0x24')]=_['keys'](_0x4c103c[_0x254d('0x24')]);_0x33998a['filters']=_['intersection'](_0x33998a[_0x254d('0x2a')],_0x33998a[_0x254d('0x24')]);_0x3fd2ec[_0x254d('0x2e')]=_[_0x254d('0x2d')](_0x33998a[_0x254d('0x2a')],qs[_0x254d('0x2f')](_0x4c103c[_0x254d('0x24')][_0x254d('0x2f')]));_0x3fd2ec[_0x254d('0x2e')]=_0x3fd2ec[_0x254d('0x2e')]['length']?_0x3fd2ec['attributes']:_0x33998a[_0x254d('0x2a')];if(!_0x4c103c[_0x254d('0x24')]['hasOwnProperty'](_0x254d('0x40'))){_0x3fd2ec[_0x254d('0x41')]=qs[_0x254d('0x41')](_0x4c103c[_0x254d('0x24')][_0x254d('0x41')]);_0x3fd2ec[_0x254d('0x10')]=qs['offset'](_0x4c103c['query']['offset']);}_0x3fd2ec['order']=qs[_0x254d('0x42')](_0x4c103c[_0x254d('0x24')][_0x254d('0x42')]);_0x3fd2ec[_0x254d('0x21')]=qs['filters'](_[_0x254d('0x43')](_0x4c103c[_0x254d('0x24')],_0x33998a['filters']));_0x3fd2ec[_0x254d('0x21')][_0x254d('0x44')]=_0x260509['id'];if(_0x4c103c[_0x254d('0x24')]['filter']){_0x3fd2ec[_0x254d('0x21')]=_[_0x254d('0x45')](_0x3fd2ec[_0x254d('0x21')],{'$or':_['map'](_0x3fd2ec[_0x254d('0x2e')],function(_0x145d11){var _0x22a604={};_0x22a604[_0x145d11]={'$like':'%'+_0x4c103c[_0x254d('0x24')][_0x254d('0x46')]+'%'};return _0x22a604;})});}_0x3fd2ec=_[_0x254d('0x45')]({},_0x3fd2ec,_0x4c103c['options']);return db['UserMailQueue']['findAll'](_0x3fd2ec);}})[_0x254d('0x14')](function(_0x37a088){if(_0x37a088){return db[_0x254d('0x47')][_0x254d('0x48')]({'where':{'id':_[_0x254d('0x1b')](_0x37a088,_0x254d('0x49')),'role':_0x254d('0x4a')},'attributes':['id',_0x254d('0x19'),_0x254d('0x4b'),_0x254d('0x4c'),_0x254d('0x4d')]});}})['then'](function(_0xcf0f3a){if(_0xcf0f3a){return{'count':_0xcf0f3a[_0x254d('0x11')],'rows':_[_0x254d('0x1b')](_0xcf0f3a[_0x254d('0x26')],function(_0x1c551b){return{'membername':_0x1c551b['name'],'UserId':_0x1c551b['id'],'queue_name':_0x908e5e[_0x254d('0x19')],'MailQueueId':_0x908e5e['id'],'interface':util[_0x254d('0x4e')]('%s/%s','SIP',_0x1c551b[_0x254d('0x19')]),'penalty':0x0,'paused':_0x1c551b[_0x254d('0x4b')],'createdAt':_0x1c551b[_0x254d('0x4d')],'updatedAt':_0x1c551b[_0x254d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x254d('0x14')](respondWithFilteredResult(_0x2ad15e,_0x3fd2ec))[_0x254d('0x27')](handleError(_0x2ad15e,null));};exports['getTeams']=function(_0x2e7880,_0x56320e){var _0x410835={};var _0x3cba31={};var _0x5457e8;var _0x10836d;return db[_0x254d('0x22')][_0x254d('0x4f')]({'where':{'id':_0x2e7880['params']['id']}})[_0x254d('0x14')](handleEntityNotFound(_0x56320e,null))['then'](function(_0x237278){if(_0x237278){_0x5457e8=_0x237278;_0x3cba31[_0x254d('0x2a')]=_['keys'](db[_0x254d('0x50')][_0x254d('0x1c')]);_0x3cba31[_0x254d('0x24')]=_['keys'](_0x2e7880[_0x254d('0x24')]);_0x3cba31[_0x254d('0x2c')]=_['intersection'](_0x3cba31[_0x254d('0x2a')],_0x3cba31[_0x254d('0x24')]);_0x410835[_0x254d('0x2e')]=_[_0x254d('0x2d')](_0x3cba31['model'],qs['fields'](_0x2e7880['query'][_0x254d('0x2f')]));_0x410835['attributes']=_0x410835[_0x254d('0x2e')][_0x254d('0x30')]?_0x410835['attributes']:_0x3cba31[_0x254d('0x2a')];_0x410835['order']=qs[_0x254d('0x42')](_0x2e7880[_0x254d('0x24')][_0x254d('0x42')]);_0x410835[_0x254d('0x21')]=qs['filters'](_[_0x254d('0x43')](_0x2e7880[_0x254d('0x24')],_0x3cba31[_0x254d('0x2c')]));if(_0x2e7880[_0x254d('0x24')][_0x254d('0x46')]){_0x410835['where']=_[_0x254d('0x45')](_0x410835[_0x254d('0x21')],{'$or':_[_0x254d('0x1b')](_0x410835[_0x254d('0x2e')],function(_0x4a040d){var _0x1734fc={};_0x1734fc[_0x4a040d]={'$like':'%'+_0x2e7880['query']['filter']+'%'};return _0x1734fc;})});}_0x410835=_[_0x254d('0x45')]({},_0x410835,_0x2e7880[_0x254d('0x31')]);return _0x5457e8[_0x254d('0x51')](_0x410835);}})[_0x254d('0x14')](function(_0x43764d){if(_0x43764d){_0x10836d=_0x43764d['length'];if(!_0x2e7880[_0x254d('0x24')][_0x254d('0x52')]('nolimit')){_0x410835['limit']=qs[_0x254d('0x41')](_0x2e7880[_0x254d('0x24')][_0x254d('0x41')]);_0x410835[_0x254d('0x10')]=qs[_0x254d('0x10')](_0x2e7880[_0x254d('0x24')][_0x254d('0x10')]);}return _0x5457e8[_0x254d('0x51')](_0x410835);}})[_0x254d('0x14')](function(_0x333997){if(_0x333997){return _0x333997?{'count':_0x10836d,'rows':_0x333997}:null;}})[_0x254d('0x14')](respondWithResult(_0x56320e,null))[_0x254d('0x27')](handleError(_0x56320e,null));};exports['addTeams']=function(_0x39a6e3,_0x3945f9){var _0x236de9=_0x39a6e3[_0x254d('0x34')][_0x254d('0x53')];return db['Team'][_0x254d('0x25')]({'where':{'id':_0x236de9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x254d('0x54'),'attributes':['id',_0x254d('0x19'),'online',_0x254d('0x55'),_0x254d('0x56')],'raw':!![]}]})[_0x254d('0x14')](function(_0x3155ba){if(_0x3155ba){var _0x9f2bd2=_['flatMap'](_0x3155ba,function(_0x5ae311){var _0x51fd7b=_0x5ae311[_0x254d('0x36')]({'plain':!![]});return _0x51fd7b[_0x254d('0x54')];});return db[_0x254d('0x22')][_0x254d('0x32')]({'where':{'id':_0x39a6e3['params']['id']}})['then'](function(_0x296ebd){return db[_0x254d('0x57')]['transaction'](function(_0x27b7f1){return _0x296ebd['addTeams'](_0x236de9,{'transaction':_0x27b7f1})['then'](function(){return BPromise[_0x254d('0x58')](_0x9f2bd2,function(_0x47838f){return db[_0x254d('0x3f')][_0x254d('0x59')]({'where':{'UserId':_0x47838f['id'],'MailQueueId':_0x39a6e3[_0x254d('0x29')]['id']},'transaction':_0x27b7f1});});})[_0x254d('0x14')](function(){_0x9f2bd2['forEach'](function(_0x343e86){socket['emit'](_0x254d('0x5a'),{'UserId':_0x343e86['id'],'MailQueueId':_0x296ebd['id']});});});});});}})[_0x254d('0x14')](respondWithStatusCode(_0x3945f9,null))[_0x254d('0x27')](handleError(_0x3945f9,null));};exports[_0x254d('0x5b')]=function(_0x2705a5,_0x3ec098){return db[_0x254d('0x50')][_0x254d('0x25')]({'where':{'id':_0x2705a5[_0x254d('0x24')][_0x254d('0x53')]},'attributes':['id'],'include':[{'model':db[_0x254d('0x47')],'as':_0x254d('0x54'),'attributes':['id'],'raw':!![]}]})[_0x254d('0x14')](handleEntityNotFound(_0x3ec098,null))['then'](function(_0x5580cf){var _0x36572c=_[_0x254d('0x1b')](_0x5580cf,'id');var _0x2bb729=[];var _0x4672fb=[];var _0x3d6727=squel[_0x254d('0x5c')]();_0x3d6727[_0x254d('0x5d')](_0x254d('0x5e'))[_0x254d('0x5f')](_0x254d('0x60'),'tq')[_0x254d('0x61')](_0x254d('0x62'),'ut',_0x254d('0x63'))[_0x254d('0x21')](_0x254d('0x64'),_0x2705a5[_0x254d('0x29')]['id']);for(var _0x20a624=0x0;_0x20a624<_0x5580cf[_0x254d('0x30')];_0x20a624+=0x1){let _0x5a7ace=_0x5580cf[_0x20a624];for(var _0x40e631=0x0;_0x40e631<_0x5a7ace['Agents'][_0x254d('0x30')];_0x40e631+=0x1){let _0x1981e5=_0x5a7ace[_0x254d('0x54')][_0x40e631];var _0x269567=_0x3d6727[_0x254d('0x65')]();_0x269567[_0x254d('0x21')](_0x254d('0x66'),_0x1981e5['id']);_0x4672fb['push'](db[_0x254d('0x57')][_0x254d('0x24')](_0x269567[_0x254d('0x67')](),{'type':db[_0x254d('0x57')][_0x254d('0x68')][_0x254d('0x69')]})[_0x254d('0x14')](function(_0x2175a6){if(_0x2175a6[_0x254d('0x30')]===0x1){return _0x1981e5['id'];}else{var _0x3f08bb=_[_0x254d('0x6a')](_[_0x254d('0x1b')](_0x2175a6,_0x254d('0x6b')),function(_0x1fdd7b){return _[_0x254d('0x6c')](_0x36572c,_0x1fdd7b);});if(_0x3f08bb){return _0x1981e5['id'];}}}));}}return BPromise[_0x254d('0x6d')](_0x4672fb)[_0x254d('0x14')](function(_0x2dd95f){_0x2bb729=_(_0x2bb729)[_0x254d('0x6e')](_0x2dd95f)['compact']()[_0x254d('0x6f')]();return db[_0x254d('0x22')]['find']({'where':{'id':_0x2705a5[_0x254d('0x29')]['id']}})[_0x254d('0x14')](function(_0x4995fc){return db[_0x254d('0x57')][_0x254d('0x70')](function(_0x20e436){return _0x4995fc[_0x254d('0x5b')](_0x2705a5['query'][_0x254d('0x53')],{'transaction':_0x20e436})[_0x254d('0x14')](function(){if(!_[_0x254d('0x71')](_0x2bb729)){return _0x4995fc[_0x254d('0x72')](_0x2bb729,{'transaction':_0x20e436});}})[_0x254d('0x14')](function(){_0x2bb729[_0x254d('0x73')](function(_0x194f9e){socket[_0x254d('0x74')](_0x254d('0x75'),{'UserId':_0x194f9e,'MailQueueId':_0x4995fc['id']});});});});});});})[_0x254d('0x14')](respondWithStatusCode(_0x3ec098,null))[_0x254d('0x27')](handleError(_0x3ec098,null));};exports['addAgents']=function(_0x269e39,_0x216e5b){return db[_0x254d('0x22')][_0x254d('0x32')]({'where':{'id':_0x269e39[_0x254d('0x29')]['id']}})[_0x254d('0x14')](handleEntityNotFound(_0x216e5b,null))[_0x254d('0x14')](function(_0x5206ee){if(_0x5206ee){return _0x5206ee['addAgents'](_0x269e39['body'][_0x254d('0x53')],_['omit'](_0x269e39[_0x254d('0x34')],[_0x254d('0x53'),'id'])||{})[_0x254d('0x76')](function(_0x41354f){for(var _0x2c0f4a=0x0;_0x2c0f4a<_0x269e39['body'][_0x254d('0x53')]['length'];_0x2c0f4a+=0x1){socket[_0x254d('0x74')]('userMailQueue:save',{'UserId':Number(_0x269e39[_0x254d('0x34')][_0x254d('0x53')][_0x2c0f4a]),'MailQueueId':Number(_0x269e39[_0x254d('0x29')]['id'])});}return _0x41354f;});}})['then'](respondWithResult(_0x216e5b,null))[_0x254d('0x27')](handleError(_0x216e5b,null));};exports[_0x254d('0x72')]=function(_0x34937d,_0x4c5221){return db[_0x254d('0x22')][_0x254d('0x32')]({'where':{'id':_0x34937d[_0x254d('0x29')]['id']}})[_0x254d('0x14')](handleEntityNotFound(_0x4c5221,null))[_0x254d('0x14')](function(_0x56e216){if(_0x56e216){return _0x56e216[_0x254d('0x72')](_0x34937d[_0x254d('0x24')][_0x254d('0x53')])[_0x254d('0x14')](function(){if(_[_0x254d('0x77')](_0x34937d[_0x254d('0x24')][_0x254d('0x53')])){for(var _0x59adf4=0x0;_0x59adf4<_0x34937d[_0x254d('0x24')][_0x254d('0x53')][_0x254d('0x30')];_0x59adf4+=0x1){socket['emit'](_0x254d('0x75'),{'UserId':Number(_0x34937d['query']['ids'][_0x59adf4]),'MailQueueId':Number(_0x34937d[_0x254d('0x29')]['id'])});}}else{socket[_0x254d('0x74')](_0x254d('0x75'),{'UserId':Number(_0x34937d[_0x254d('0x24')][_0x254d('0x53')]),'MailQueueId':Number(_0x34937d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4c5221,null))[_0x254d('0x27')](handleError(_0x4c5221,null));};exports[_0x254d('0x78')]=function(_0x5b0b4c,_0x15ef14){var _0x59a936={};var _0x2bddfe={};var _0x3cdf84;var _0xd7922;return db[_0x254d('0x22')]['findOne']({'where':{'id':_0x5b0b4c[_0x254d('0x29')]['id']}})['then'](handleEntityNotFound(_0x15ef14,null))[_0x254d('0x14')](function(_0x51754c){if(_0x51754c){_0x3cdf84=_0x51754c;_0x2bddfe[_0x254d('0x2a')]=_[_0x254d('0x2b')](db['User']['rawAttributes']);_0x2bddfe[_0x254d('0x24')]=_[_0x254d('0x2b')](_0x5b0b4c[_0x254d('0x24')]);_0x2bddfe[_0x254d('0x2c')]=_[_0x254d('0x2d')](_0x2bddfe['model'],_0x2bddfe[_0x254d('0x24')]);_0x59a936[_0x254d('0x2e')]=_['intersection'](_0x2bddfe[_0x254d('0x2a')],qs[_0x254d('0x2f')](_0x5b0b4c[_0x254d('0x24')]['fields']));_0x59a936[_0x254d('0x2e')]=_0x59a936[_0x254d('0x2e')][_0x254d('0x30')]?_0x59a936[_0x254d('0x2e')]:_0x2bddfe[_0x254d('0x2a')];_0x59a936[_0x254d('0x79')]=qs[_0x254d('0x42')](_0x5b0b4c[_0x254d('0x24')][_0x254d('0x42')]);_0x59a936['where']=qs['filters'](_['pick'](_0x5b0b4c[_0x254d('0x24')],_0x2bddfe[_0x254d('0x2c')]));if(_0x5b0b4c['query'][_0x254d('0x46')]){_0x59a936['where']=_[_0x254d('0x45')](_0x59a936[_0x254d('0x21')],{'$or':_[_0x254d('0x1b')](_0x59a936[_0x254d('0x2e')],function(_0x337897){var _0x5c2785={};_0x5c2785[_0x337897]={'$like':'%'+_0x5b0b4c[_0x254d('0x24')][_0x254d('0x46')]+'%'};return _0x5c2785;})});}_0x59a936=_['merge']({},_0x59a936,_0x5b0b4c['options']);return _0x3cdf84[_0x254d('0x78')](_0x59a936);}})['then'](function(_0x293cb0){if(_0x293cb0){_0xd7922=_0x293cb0[_0x254d('0x30')];if(!_0x5b0b4c[_0x254d('0x24')][_0x254d('0x52')]('nolimit')){_0x59a936['limit']=qs['limit'](_0x5b0b4c[_0x254d('0x24')]['limit']);_0x59a936[_0x254d('0x10')]=qs[_0x254d('0x10')](_0x5b0b4c['query']['offset']);}return _0x3cdf84[_0x254d('0x78')](_0x59a936);}})[_0x254d('0x14')](function(_0x597784){if(_0x597784){return _0x597784?{'count':_0xd7922,'rows':_0x597784}:null;}})[_0x254d('0x14')](respondWithResult(_0x15ef14,null))[_0x254d('0x27')](handleError(_0x15ef14,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 14bb815..0dc58aa 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 _0xca5c=['events','../../mysqldb','MailQueue','setMaxListeners','update','emit','exports'];(function(_0x1d4907,_0x1533a8){var _0x5661c3=function(_0x3a4f2d){while(--_0x3a4f2d){_0x1d4907['push'](_0x1d4907['shift']());}};_0x5661c3(++_0x1533a8);}(_0xca5c,0xa1));var _0xcca5=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xca5c[_0x4b12ae];return _0x16957b;};'use strict';var EventEmitter=require(_0xcca5('0x0'));var MailQueue=require(_0xcca5('0x1'))['db'][_0xcca5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcca5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcca5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3fef92){return function(_0xf9b05f,_0x23586b,_0x168ada){MailQueueEvents['emit'](_0x3fef92+':'+_0xf9b05f['id'],_0xf9b05f);MailQueueEvents[_0xcca5('0x5')](_0x3fef92,_0xf9b05f);_0x168ada(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xcca5('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x3d05=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x1fd450,_0x42cbf6){var _0x4cb0a5=function(_0x1384d4){while(--_0x1384d4){_0x1fd450['push'](_0x1fd450['shift']());}};_0x4cb0a5(++_0x42cbf6);}(_0x3d05,0x1a0));var _0x53d0=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0x3d05[_0x3071ab];return _0x2f458c;};'use strict';var EventEmitter=require(_0x53d0('0x0'));var MailQueue=require(_0x53d0('0x1'))['db'][_0x53d0('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x53d0('0x3')](0x0);var events={'afterCreate':_0x53d0('0x4'),'afterUpdate':'update','afterDestroy':_0x53d0('0x5')};function emitEvent(_0x2b0d41){return function(_0x3af595,_0x3e8068,_0x10efc8){MailQueueEvents[_0x53d0('0x6')](_0x2b0d41+':'+_0x3af595['id'],_0x3af595);MailQueueEvents[_0x53d0('0x6')](_0x2b0d41,_0x3af595);_0x10efc8(null);};}for(var e in events){if(events[_0x53d0('0x7')](e)){var event=events[e];MailQueue[_0x53d0('0x8')](e,emitEvent(event));}}module[_0x53d0('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 7d6954e..bfea60d 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 _0xaf3d=['exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x2e6889,_0x3a5db6){var _0x52abdb=function(_0x5b4d03){while(--_0x5b4d03){_0x2e6889['push'](_0x2e6889['shift']());}};_0x52abdb(++_0x3a5db6);}(_0xaf3d,0x17a));var _0xdaf3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaf3d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdaf3('0x0'));var util=require(_0xdaf3('0x1'));var logger=require(_0xdaf3('0x2'))('api');var moment=require(_0xdaf3('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaf3('0x4'));var fs=require('fs');var path=require(_0xdaf3('0x5'));var rimraf=require('rimraf');var config=require(_0xdaf3('0x6'));var attributes=require('./mailQueue.attributes');module[_0xdaf3('0x7')]=function(_0xae7597,_0x4d1891){return _0xae7597[_0xdaf3('0x8')](_0xdaf3('0x9'),attributes,{'tableName':_0xdaf3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfefe=['request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','util','../../config/logger','api','bluebird'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xfefe,0x114));var _0xefef=function(_0x3d953a,_0x36356a){_0x3d953a=_0x3d953a-0x0;var _0x39d930=_0xfefe[_0x3d953a];return _0x39d930;};'use strict';var _=require('lodash');var util=require(_0xefef('0x0'));var logger=require(_0xefef('0x1'))(_0xefef('0x2'));var moment=require('moment');var BPromise=require(_0xefef('0x3'));var rp=require(_0xefef('0x4'));var fs=require('fs');var path=require(_0xefef('0x5'));var rimraf=require('rimraf');var config=require(_0xefef('0x6'));var attributes=require(_0xefef('0x7'));module[_0xefef('0x8')]=function(_0x29bd3f,_0x1b06a3){return _0x29bd3f[_0xefef('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 7f1c6c7..fcf0e43 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 _0x9063=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','register','then','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','where','limit','include','map','model','attributes','debug','stringify','find','raw','info','ShowMailQueue','lodash','util'];(function(_0x1dc69e,_0x23200c){var _0x111aa5=function(_0xee4cd4){while(--_0xee4cd4){_0x1dc69e['push'](_0x1dc69e['shift']());}};_0x111aa5(++_0x23200c);}(_0x9063,0x1a2));var _0x3906=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x9063[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x3906('0x0'));var util=require(_0x3906('0x1'));var moment=require(_0x3906('0x2'));var BPromise=require(_0x3906('0x3'));var rs=require(_0x3906('0x4'));var fs=require('fs');var Redis=require(_0x3906('0x5'));var db=require(_0x3906('0x6'))['db'];var utils=require(_0x3906('0x7'));var logger=require('../../config/logger')(_0x3906('0x8'));var config=require(_0x3906('0x9'));var jayson=require(_0x3906('0xa'));var client=jayson[_0x3906('0xb')][_0x3906('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x3906('0xd'),'port':0x18eb});var socket=require(_0x3906('0xe'))(new Redis(config[_0x3906('0xf')]));require('./mailQueue.socket')[_0x3906('0x10')](socket);function respondWithRpcPromise(_0x469456,_0x4f4b46,_0x3c8f45){return new BPromise(function(_0x3218bb,_0x347610){return client['request'](_0x469456,_0x3c8f45)[_0x3906('0x11')](function(_0x3c956c){logger['info'](_0x3906('0x12'),_0x4f4b46,'request\x20sent');logger['debug'](_0x3906('0x13'),_0x4f4b46,_0x3906('0x14'),JSON['stringify'](_0x3c956c));if(_0x3c956c['error']){if(_0x3c956c[_0x3906('0x15')][_0x3906('0x16')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4f4b46,_0x3c956c[_0x3906('0x15')][_0x3906('0x17')]);return _0x347610(_0x3c956c[_0x3906('0x15')][_0x3906('0x17')]);}logger[_0x3906('0x15')](_0x3906('0x12'),_0x4f4b46,_0x3c956c[_0x3906('0x15')][_0x3906('0x17')]);return _0x3218bb(_0x3c956c[_0x3906('0x15')][_0x3906('0x17')]);}else{logger['info'](_0x3906('0x12'),_0x4f4b46,'request\x20sent');_0x3218bb(_0x3c956c[_0x3906('0x18')][_0x3906('0x17')]);}})[_0x3906('0x19')](function(_0x32f655){logger['error'](_0x3906('0x12'),_0x4f4b46,_0x32f655);_0x347610(_0x32f655);});});}exports[_0x3906('0x1a')]=function(_0x2f9d5a){var _0x2160df=this;return new Promise(function(_0x29d6d9,_0x553333){return db[_0x3906('0x1b')][_0x3906('0x1c')]({'raw':_0x2f9d5a[_0x3906('0x1d')]?_0x2f9d5a[_0x3906('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f9d5a[_0x3906('0x1d')]?_0x2f9d5a[_0x3906('0x1d')][_0x3906('0x1e')]||null:null,'attributes':_0x2f9d5a[_0x3906('0x1d')]?_0x2f9d5a['options']['attributes']||null:null,'limit':_0x2f9d5a[_0x3906('0x1d')]?_0x2f9d5a[_0x3906('0x1d')][_0x3906('0x1f')]||null:null,'include':_0x2f9d5a[_0x3906('0x1d')]?_0x2f9d5a['options'][_0x3906('0x20')]?_[_0x3906('0x21')](_0x2f9d5a['options']['include'],function(_0x229b3e){return{'model':db[_0x229b3e[_0x3906('0x22')]],'as':_0x229b3e['as'],'attributes':_0x229b3e[_0x3906('0x23')],'include':_0x229b3e['include']?_[_0x3906('0x21')](_0x229b3e[_0x3906('0x20')],function(_0x118827){return{'model':db[_0x118827[_0x3906('0x22')]],'as':_0x118827['as'],'attributes':_0x118827['attributes'],'include':_0x118827[_0x3906('0x20')]?_['map'](_0x118827[_0x3906('0x20')],function(_0x59d276){return{'model':db[_0x59d276['model']],'as':_0x59d276['as'],'attributes':_0x59d276[_0x3906('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3906('0x11')](function(_0x129ead){logger['info']('GetMailQueue',_0x2f9d5a);logger[_0x3906('0x24')](_0x3906('0x1a'),_0x2f9d5a,JSON[_0x3906('0x25')](_0x129ead));_0x29d6d9(_0x129ead);})[_0x3906('0x19')](function(_0x2e266a){logger[_0x3906('0x15')]('GetMailQueue',_0x2e266a[_0x3906('0x17')],_0x2f9d5a);_0x553333(_0x2160df[_0x3906('0x15')](0x1f4,_0x2e266a['message']));});});};exports['ShowMailQueue']=function(_0x191e30){var _0x566f1d=this;return new Promise(function(_0x409e21,_0x66b9f3){return db['MailQueue'][_0x3906('0x26')]({'raw':_0x191e30[_0x3906('0x1d')]?_0x191e30[_0x3906('0x1d')][_0x3906('0x27')]===undefined?!![]:![]:!![],'where':_0x191e30[_0x3906('0x1d')]?_0x191e30[_0x3906('0x1d')][_0x3906('0x1e')]||null:null,'attributes':_0x191e30[_0x3906('0x1d')]?_0x191e30[_0x3906('0x1d')][_0x3906('0x23')]||null:null,'include':_0x191e30['options']?_0x191e30[_0x3906('0x1d')][_0x3906('0x20')]?_[_0x3906('0x21')](_0x191e30[_0x3906('0x1d')]['include'],function(_0x20f157){return{'model':db[_0x20f157[_0x3906('0x22')]],'as':_0x20f157['as'],'attributes':_0x20f157[_0x3906('0x23')],'include':_0x20f157[_0x3906('0x20')]?_[_0x3906('0x21')](_0x20f157[_0x3906('0x20')],function(_0x17fc05){return{'model':db[_0x17fc05[_0x3906('0x22')]],'as':_0x17fc05['as'],'attributes':_0x17fc05[_0x3906('0x23')],'include':_0x17fc05[_0x3906('0x20')]?_[_0x3906('0x21')](_0x17fc05[_0x3906('0x20')],function(_0x2889e0){return{'model':db[_0x2889e0[_0x3906('0x22')]],'as':_0x2889e0['as'],'attributes':_0x2889e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15f028){logger[_0x3906('0x28')]('ShowMailQueue',_0x191e30);logger[_0x3906('0x24')](_0x3906('0x29'),_0x191e30,JSON['stringify'](_0x15f028));_0x409e21(_0x15f028);})[_0x3906('0x19')](function(_0x18ea42){logger[_0x3906('0x15')]('ShowMailQueue',_0x18ea42[_0x3906('0x17')],_0x191e30);_0x66b9f3(_0x566f1d['error'](0x1f4,_0x18ea42[_0x3906('0x17')]));});});}; \ No newline at end of file +var _0x6610=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','raw','attributes','include','map','model','GetMailQueue','ShowMailQueue','find','where','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x1ba00f,_0x127886){var _0x5238bf=function(_0x55efc8){while(--_0x55efc8){_0x1ba00f['push'](_0x1ba00f['shift']());}};_0x5238bf(++_0x127886);}(_0x6610,0x152));var _0x0661=function(_0x482f78,_0x2031a6){_0x482f78=_0x482f78-0x0;var _0xba9913=_0x6610[_0x482f78];return _0xba9913;};'use strict';var _=require(_0x0661('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0661('0x1'));var fs=require('fs');var Redis=require(_0x0661('0x2'));var db=require(_0x0661('0x3'))['db'];var utils=require(_0x0661('0x4'));var logger=require(_0x0661('0x5'))(_0x0661('0x6'));var config=require(_0x0661('0x7'));var jayson=require(_0x0661('0x8'));var client=jayson['client'][_0x0661('0x9')]({'port':0x232a});config['redis']=_[_0x0661('0xa')](config[_0x0661('0xb')],{'host':_0x0661('0xc'),'port':0x18eb});var socket=require(_0x0661('0xd'))(new Redis(config[_0x0661('0xb')]));require(_0x0661('0xe'))[_0x0661('0xf')](socket);function respondWithRpcPromise(_0x2ecd0d,_0xc3bd64,_0x4f6224){return new BPromise(function(_0x5737cd,_0x5b69be){return client[_0x0661('0x10')](_0x2ecd0d,_0x4f6224)[_0x0661('0x11')](function(_0x572e01){logger[_0x0661('0x12')](_0x0661('0x13'),_0xc3bd64,_0x0661('0x14'));logger[_0x0661('0x15')](_0x0661('0x16'),_0xc3bd64,_0x0661('0x14'),JSON[_0x0661('0x17')](_0x572e01));if(_0x572e01['error']){if(_0x572e01[_0x0661('0x18')][_0x0661('0x19')]===0x1f4){logger[_0x0661('0x18')]('MailQueue,\x20%s,\x20%s',_0xc3bd64,_0x572e01['error'][_0x0661('0x1a')]);return _0x5b69be(_0x572e01[_0x0661('0x18')][_0x0661('0x1a')]);}logger['error'](_0x0661('0x13'),_0xc3bd64,_0x572e01[_0x0661('0x18')][_0x0661('0x1a')]);return _0x5737cd(_0x572e01[_0x0661('0x18')][_0x0661('0x1a')]);}else{logger[_0x0661('0x12')](_0x0661('0x13'),_0xc3bd64,'request\x20sent');_0x5737cd(_0x572e01['result'][_0x0661('0x1a')]);}})[_0x0661('0x1b')](function(_0x278d5a){logger[_0x0661('0x18')](_0x0661('0x13'),_0xc3bd64,_0x278d5a);_0x5b69be(_0x278d5a);});});}exports['GetMailQueue']=function(_0x4c04e5){var _0x8a5a6b=this;return new Promise(function(_0x359038,_0x49f81d){return db['MailQueue']['findAll']({'raw':_0x4c04e5[_0x0661('0x1c')]?_0x4c04e5[_0x0661('0x1c')][_0x0661('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c04e5['options']?_0x4c04e5[_0x0661('0x1c')]['where']||null:null,'attributes':_0x4c04e5[_0x0661('0x1c')]?_0x4c04e5[_0x0661('0x1c')][_0x0661('0x1e')]||null:null,'limit':_0x4c04e5[_0x0661('0x1c')]?_0x4c04e5['options']['limit']||null:null,'include':_0x4c04e5[_0x0661('0x1c')]?_0x4c04e5[_0x0661('0x1c')][_0x0661('0x1f')]?_[_0x0661('0x20')](_0x4c04e5[_0x0661('0x1c')][_0x0661('0x1f')],function(_0x5d7e10){return{'model':db[_0x5d7e10['model']],'as':_0x5d7e10['as'],'attributes':_0x5d7e10[_0x0661('0x1e')],'include':_0x5d7e10[_0x0661('0x1f')]?_[_0x0661('0x20')](_0x5d7e10[_0x0661('0x1f')],function(_0x1cf9d0){return{'model':db[_0x1cf9d0[_0x0661('0x21')]],'as':_0x1cf9d0['as'],'attributes':_0x1cf9d0[_0x0661('0x1e')],'include':_0x1cf9d0[_0x0661('0x1f')]?_['map'](_0x1cf9d0['include'],function(_0x31f28a){return{'model':db[_0x31f28a[_0x0661('0x21')]],'as':_0x31f28a['as'],'attributes':_0x31f28a[_0x0661('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0661('0x11')](function(_0x4dea45){logger['info'](_0x0661('0x22'),_0x4c04e5);logger['debug'](_0x0661('0x22'),_0x4c04e5,JSON[_0x0661('0x17')](_0x4dea45));_0x359038(_0x4dea45);})[_0x0661('0x1b')](function(_0x2e3a17){logger['error'](_0x0661('0x22'),_0x2e3a17['message'],_0x4c04e5);_0x49f81d(_0x8a5a6b['error'](0x1f4,_0x2e3a17['message']));});});};exports[_0x0661('0x23')]=function(_0x3b77f4){var _0x851bc2=this;return new Promise(function(_0x9e0d22,_0x10c55e){return db['MailQueue'][_0x0661('0x24')]({'raw':_0x3b77f4[_0x0661('0x1c')]?_0x3b77f4[_0x0661('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3b77f4[_0x0661('0x1c')]?_0x3b77f4[_0x0661('0x1c')][_0x0661('0x25')]||null:null,'attributes':_0x3b77f4[_0x0661('0x1c')]?_0x3b77f4['options'][_0x0661('0x1e')]||null:null,'include':_0x3b77f4[_0x0661('0x1c')]?_0x3b77f4['options'][_0x0661('0x1f')]?_[_0x0661('0x20')](_0x3b77f4[_0x0661('0x1c')]['include'],function(_0x1845d9){return{'model':db[_0x1845d9[_0x0661('0x21')]],'as':_0x1845d9['as'],'attributes':_0x1845d9['attributes'],'include':_0x1845d9['include']?_[_0x0661('0x20')](_0x1845d9['include'],function(_0x2834dc){return{'model':db[_0x2834dc[_0x0661('0x21')]],'as':_0x2834dc['as'],'attributes':_0x2834dc[_0x0661('0x1e')],'include':_0x2834dc[_0x0661('0x1f')]?_[_0x0661('0x20')](_0x2834dc['include'],function(_0x2ad5a3){return{'model':db[_0x2ad5a3[_0x0661('0x21')]],'as':_0x2ad5a3['as'],'attributes':_0x2ad5a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x0661('0x11')](function(_0x2116b1){logger['info'](_0x0661('0x23'),_0x3b77f4);logger[_0x0661('0x15')](_0x0661('0x23'),_0x3b77f4,JSON['stringify'](_0x2116b1));_0x9e0d22(_0x2116b1);})['catch'](function(_0x342a42){logger[_0x0661('0x18')](_0x0661('0x23'),_0x342a42[_0x0661('0x1a')],_0x3b77f4);_0x10c55e(_0x851bc2[_0x0661('0x18')](0x1f4,_0x342a42[_0x0661('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 8550960..a7ab9fe 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 _0xda16=['mailQueue:','./mailQueue.events','save','remove','update','emit','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda16,0x1cf));var _0x6da1=function(_0x10acb2,_0x3ca870){_0x10acb2=_0x10acb2-0x0;var _0x186379=_0xda16[_0x10acb2];return _0x186379;};'use strict';var MailQueueEvents=require(_0x6da1('0x0'));var events=[_0x6da1('0x1'),_0x6da1('0x2'),_0x6da1('0x3')];function createListener(_0x57ebf1,_0x57b998){return function(_0x598230){_0x57b998[_0x6da1('0x4')](_0x57ebf1,_0x598230);};}function removeListener(_0x191b77,_0xbff301){return function(){MailQueueEvents['removeListener'](_0x191b77,_0xbff301);};}exports[_0x6da1('0x5')]=function(_0xf0ed70){for(var _0x41561a=0x0,_0x41de73=events['length'];_0x41561a<_0x41de73;_0x41561a++){var _0x33067b=events[_0x41561a];var _0x56e12a=createListener(_0x6da1('0x6')+_0x33067b,_0xf0ed70);MailQueueEvents['on'](_0x33067b,_0x56e12a);}}; \ No newline at end of file +var _0x8f3b=['register','length','mailQueue:','./mailQueue.events','remove'];(function(_0x4c0122,_0x250c3a){var _0x4a680b=function(_0x77afb){while(--_0x77afb){_0x4c0122['push'](_0x4c0122['shift']());}};_0x4a680b(++_0x250c3a);}(_0x8f3b,0x1d9));var _0xb8f3=function(_0x4271a4,_0x51588d){_0x4271a4=_0x4271a4-0x0;var _0x35a8b1=_0x8f3b[_0x4271a4];return _0x35a8b1;};'use strict';var MailQueueEvents=require(_0xb8f3('0x0'));var events=['save',_0xb8f3('0x1'),'update'];function createListener(_0x41d4ed,_0x22ae77){return function(_0x54e80b){_0x22ae77['emit'](_0x41d4ed,_0x54e80b);};}function removeListener(_0x3ec52a,_0x1837fc){return function(){MailQueueEvents['removeListener'](_0x3ec52a,_0x1837fc);};}exports[_0xb8f3('0x2')]=function(_0x566d29){for(var _0x3c4250=0x0,_0x4cb9e8=events[_0xb8f3('0x3')];_0x3c4250<_0x4cb9e8;_0x3c4250++){var _0x581845=events[_0x3c4250];var _0x2f375f=createListener(_0xb8f3('0x4')+_0x581845,_0x566d29);MailQueueEvents['on'](_0x581845,_0x2f375f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a4dc541..1fb00a4 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 _0x3410=['/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailQueueReport.controller','get','index'];(function(_0x530a58,_0x141d0a){var _0x46efd4=function(_0x5b699a){while(--_0x5b699a){_0x530a58['push'](_0x530a58['shift']());}};_0x46efd4(++_0x141d0a);}(_0x3410,0x170));var _0x0341=function(_0xaec913,_0x57e156){_0xaec913=_0xaec913-0x0;var _0x3e5c96=_0x3410[_0xaec913];return _0x3e5c96;};'use strict';var multer=require(_0x0341('0x0'));var util=require(_0x0341('0x1'));var path=require('path');var timeout=require(_0x0341('0x2'));var express=require(_0x0341('0x3'));var router=express[_0x0341('0x4')]();var fs_extra=require(_0x0341('0x5'));var auth=require(_0x0341('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0341('0x7'));router[_0x0341('0x8')]('/',auth['isAuthenticated'](),controller[_0x0341('0x9')]);router[_0x0341('0x8')](_0x0341('0xa'),auth[_0x0341('0xb')](),controller[_0x0341('0xc')]);router[_0x0341('0x8')](_0x0341('0xd'),auth['isAuthenticated'](),controller[_0x0341('0xe')]);router[_0x0341('0xf')]('/',auth[_0x0341('0xb')](),controller['create']);router[_0x0341('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0341('0x11')]);router[_0x0341('0x12')](_0x0341('0xd'),auth[_0x0341('0xb')](),controller[_0x0341('0x13')]);module[_0x0341('0x14')]=router; \ No newline at end of file +var _0x70ba=['./mailQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0x70ba,0x99));var _0xa70b=function(_0x4813f8,_0x1f9246){_0x4813f8=_0x4813f8-0x0;var _0x24d0d4=_0x70ba[_0x4813f8];return _0x24d0d4;};'use strict';var multer=require('multer');var util=require(_0xa70b('0x0'));var path=require(_0xa70b('0x1'));var timeout=require('connect-timeout');var express=require(_0xa70b('0x2'));var router=express['Router']();var fs_extra=require(_0xa70b('0x3'));var auth=require(_0xa70b('0x4'));var interaction=require(_0xa70b('0x5'));var config=require(_0xa70b('0x6'));var controller=require(_0xa70b('0x7'));router[_0xa70b('0x8')]('/',auth[_0xa70b('0x9')](),controller[_0xa70b('0xa')]);router[_0xa70b('0x8')]('/describe',auth[_0xa70b('0x9')](),controller[_0xa70b('0xb')]);router['get'](_0xa70b('0xc'),auth[_0xa70b('0x9')](),controller[_0xa70b('0xd')]);router[_0xa70b('0xe')]('/',auth['isAuthenticated'](),controller[_0xa70b('0xf')]);router[_0xa70b('0x10')]('/:id',auth[_0xa70b('0x9')](),controller[_0xa70b('0x11')]);router[_0xa70b('0x12')](_0xa70b('0xc'),auth[_0xa70b('0x9')](),controller['destroy']);module[_0xa70b('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 9effdf9..4453d1e 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 _0x435a=['DATE'];(function(_0x2bab5e,_0x2a99e9){var _0x4bd5e1=function(_0x4ffa13){while(--_0x4ffa13){_0x2bab5e['push'](_0x2bab5e['shift']());}};_0x4bd5e1(++_0x2a99e9);}(_0x435a,0x13b));var _0xa435=function(_0x148202,_0x132b6a){_0x148202=_0x148202-0x0;var _0x1b15ad=_0x435a[_0x148202];return _0x1b15ad;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa435('0x0')]},'leaveAt':{'type':Sequelize[_0xa435('0x0')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd335=['DATE','STRING'];(function(_0x5e8f40,_0x304a72){var _0x22d56c=function(_0x26fe41){while(--_0x26fe41){_0x5e8f40['push'](_0x5e8f40['shift']());}};_0x22d56c(++_0x304a72);}(_0xd335,0x1b5));var _0x5d33=function(_0xa23267,_0x1a3e79){_0xa23267=_0xa23267-0x0;var _0x4cf912=_0xd335[_0xa23267];return _0x4cf912;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5d33('0x0')]},'joinAt':{'type':Sequelize[_0x5d33('0x1')]},'leaveAt':{'type':Sequelize[_0x5d33('0x1')]},'acceptAt':{'type':Sequelize[_0x5d33('0x1')]},'exitAt':{'type':Sequelize[_0x5d33('0x1')]},'reason':{'type':Sequelize[_0x5d33('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 344c3c6..df8912c 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 _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','MailQueueReport','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x354ee7,_0x2bb5d0){var _0x30d882=function(_0x11b2d3){while(--_0x11b2d3){_0x354ee7['push'](_0x354ee7['shift']());}};_0x30d882(++_0x2bb5d0);}(_0xd117,0x182));var _0x7d11=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xd117[_0x11a220];return _0x20d8fe;};'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['MailQueueReport'][_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 _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x2ce171,_0x5a2303){var _0x54a006=function(_0x2ad6e7){while(--_0x2ad6e7){_0x2ce171['push'](_0x2ce171['shift']());}};_0x54a006(++_0x5a2303);}(_0x0295,0x1f0));var _0x5029=function(_0x4e029f,_0x177074){_0x4e029f=_0x4e029f-0x0;var _0x135b7e=_0x0295[_0x4e029f];return _0x135b7e;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['MailQueueReport'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['MailQueueReport'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index a2c1f18..28da185 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 _0x8431=['path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8431,0x1a7));var _0x1843=function(_0x20c0ba,_0x1342b9){_0x20c0ba=_0x20c0ba-0x0;var _0x128eee=_0x8431[_0x20c0ba];return _0x128eee;};'use strict';var _=require(_0x1843('0x0'));var util=require(_0x1843('0x1'));var logger=require(_0x1843('0x2'))(_0x1843('0x3'));var moment=require(_0x1843('0x4'));var BPromise=require(_0x1843('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1843('0x6'));var rimraf=require(_0x1843('0x7'));var config=require('../../config/environment');var attributes=require(_0x1843('0x8'));module[_0x1843('0x9')]=function(_0x23da12,_0x55be2d){return _0x23da12[_0x1843('0xa')](_0x1843('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1843('0xc'),'fields':[_0x1843('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x13d6=['define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x54ed7d,_0x2c8b33){var _0x41c1de=function(_0x107965){while(--_0x107965){_0x54ed7d['push'](_0x54ed7d['shift']());}};_0x41c1de(++_0x2c8b33);}(_0x13d6,0x196));var _0x613d=function(_0x360d26,_0x700e92){_0x360d26=_0x360d26-0x0;var _0x180eef=_0x13d6[_0x360d26];return _0x180eef;};'use strict';var _=require(_0x613d('0x0'));var util=require(_0x613d('0x1'));var logger=require(_0x613d('0x2'))(_0x613d('0x3'));var moment=require(_0x613d('0x4'));var BPromise=require(_0x613d('0x5'));var rp=require(_0x613d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x613d('0x7'));var attributes=require(_0x613d('0x8'));module[_0x613d('0x9')]=function(_0x299b43,_0xc03cd1){return _0x299b43[_0x613d('0xa')](_0x613d('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x613d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index c796dbb..7169aef 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x583001,_0x22ea15){var _0x2ec632=function(_0x1009c6){while(--_0x1009c6){_0x583001['push'](_0x583001['shift']());}};_0x2ec632(++_0x22ea15);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b621f,_0x315e52){var _0x53b3a8=function(_0x21e34a){while(--_0x21e34a){_0x3b621f['push'](_0x3b621f['shift']());}};_0x53b3a8(++_0x315e52);}(_0x326f,0xd1));var _0xf326=function(_0x482010,_0x29bdff){_0x482010=_0x482010-0x0;var _0x18b18f=_0x326f[_0x482010];return _0x18b18f;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 540c2f0..97c1678 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1c7f4f,_0x3607fb){var _0x43d09c=function(_0x3f63fd){while(--_0x3f63fd){_0x1c7f4f['push'](_0x1c7f4f['shift']());}};_0x43d09c(++_0x3607fb);}(_0x70e0,0x17b));var _0x070e=function(_0x294481,_0x16bfd8){_0x294481=_0x294481-0x0;var _0x167ecd=_0x70e0[_0x294481];return _0x167ecd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x15db7e,_0x1333e4){var _0x3ef26d=function(_0x40a448){while(--_0x40a448){_0x15db7e['push'](_0x15db7e['shift']());}};_0x3ef26d(++_0x1333e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0c8998a..9bbebcf 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 _0xad59=['INTEGER','exports','BOOLEAN','STRING','INBOX'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xad59,0x178));var _0x9ad5=function(_0x2425fc,_0x1a7fcf){_0x2425fc=_0x2425fc-0x0;var _0x3635d6=_0xad59[_0x2425fc];return _0x3635d6;};'use strict';var Sequelize=require('sequelize');module[_0x9ad5('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x9ad5('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9ad5('0x2')]},'password':{'type':Sequelize[_0x9ad5('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x9ad5('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9ad5('0x2')],'defaultValue':_0x9ad5('0x3')},'connTimeout':{'type':Sequelize[_0x9ad5('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9ad5('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9ad5('0x2')]},'modernAuthentication':{'type':Sequelize[_0x9ad5('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x71a8=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x32b734,_0x368370){var _0x456d3a=function(_0x50760e){while(--_0x50760e){_0x32b734['push'](_0x32b734['shift']());}};_0x456d3a(++_0x368370);}(_0x71a8,0x79));var _0x871a=function(_0x9b07ed,_0x3f7a62){_0x9b07ed=_0x9b07ed-0x0;var _0x46be68=_0x71a8[_0x9b07ed];return _0x46be68;};'use strict';var Sequelize=require('sequelize');module[_0x871a('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x871a('0x1')]},'authentication':{'type':Sequelize[_0x871a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x871a('0x3')]},'tls':{'type':Sequelize[_0x871a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x871a('0x1')],'defaultValue':_0x871a('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x871a('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5a758cb..745044f 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 _0x1782=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5c25e4,_0x16d106){var _0x1796ba=function(_0x2d69ba){while(--_0x2d69ba){_0x5c25e4['push'](_0x5c25e4['shift']());}};_0x1796ba(++_0x16d106);}(_0x1782,0x13a));var _0x2178=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x1782[_0x3fb9dd];return _0x20136a;};'use strict';var _=require(_0x2178('0x0'));var util=require(_0x2178('0x1'));var logger=require(_0x2178('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2178('0x3'));var rp=require(_0x2178('0x4'));var fs=require('fs');var path=require(_0x2178('0x5'));var rimraf=require(_0x2178('0x6'));var config=require(_0x2178('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x2178('0x8')]=function(_0x548164,_0x53471d){return _0x548164[_0x2178('0x9')](_0x2178('0xa'),attributes,{'tableName':_0x2178('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd134=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_servers_in','util'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xd134,0x1cd));var _0x4d13=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xd134[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0x4d13('0x0'));var logger=require(_0x4d13('0x1'))(_0x4d13('0x2'));var moment=require(_0x4d13('0x3'));var BPromise=require(_0x4d13('0x4'));var rp=require(_0x4d13('0x5'));var fs=require('fs');var path=require(_0x4d13('0x6'));var rimraf=require('rimraf');var config=require(_0x4d13('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x4d13('0x8')]=function(_0x3598b8,_0x3158b5){return _0x3598b8[_0x4d13('0x9')]('MailServerIn',attributes,{'tableName':_0x4d13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index ce2a9e9..74a3187 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 _0x8e99=['findAll','options','attributes','limit','map','include','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn'];(function(_0x24bfa8,_0x12a681){var _0x54507d=function(_0x1dc4ee){while(--_0x1dc4ee){_0x24bfa8['push'](_0x24bfa8['shift']());}};_0x54507d(++_0x12a681);}(_0x8e99,0x167));var _0x98e9=function(_0x4ced95,_0x344d6c){_0x4ced95=_0x4ced95-0x0;var _0x2f6ffd=_0x8e99[_0x4ced95];return _0x2f6ffd;};'use strict';var _=require(_0x98e9('0x0'));var util=require(_0x98e9('0x1'));var moment=require(_0x98e9('0x2'));var BPromise=require('bluebird');var rs=require(_0x98e9('0x3'));var fs=require('fs');var Redis=require(_0x98e9('0x4'));var db=require(_0x98e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x98e9('0x6'))(_0x98e9('0x7'));var config=require(_0x98e9('0x8'));var jayson=require(_0x98e9('0x9'));var client=jayson[_0x98e9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa9cc92,_0x5b470f,_0x36e8a5){return new BPromise(function(_0x3ae944,_0x4da16d){return client[_0x98e9('0xb')](_0xa9cc92,_0x36e8a5)[_0x98e9('0xc')](function(_0x17ad1c){logger[_0x98e9('0xd')](_0x98e9('0xe'),_0x5b470f,_0x98e9('0xf'));logger[_0x98e9('0x10')](_0x98e9('0x11'),_0x5b470f,'request\x20sent',JSON[_0x98e9('0x12')](_0x17ad1c));if(_0x17ad1c['error']){if(_0x17ad1c[_0x98e9('0x13')][_0x98e9('0x14')]===0x1f4){logger[_0x98e9('0x13')](_0x98e9('0xe'),_0x5b470f,_0x17ad1c['error']['message']);return _0x4da16d(_0x17ad1c[_0x98e9('0x13')][_0x98e9('0x15')]);}logger[_0x98e9('0x13')](_0x98e9('0xe'),_0x5b470f,_0x17ad1c[_0x98e9('0x13')]['message']);return _0x3ae944(_0x17ad1c['error'][_0x98e9('0x15')]);}else{logger['info'](_0x98e9('0xe'),_0x5b470f,'request\x20sent');_0x3ae944(_0x17ad1c[_0x98e9('0x16')][_0x98e9('0x15')]);}})[_0x98e9('0x17')](function(_0x5a5f2b){logger[_0x98e9('0x13')](_0x98e9('0xe'),_0x5b470f,_0x5a5f2b);_0x4da16d(_0x5a5f2b);});});}exports[_0x98e9('0x18')]=function(_0x388edb){var _0x10fcc0=this;return new Promise(function(_0xafe490,_0x2feaac){return db['MailServerIn'][_0x98e9('0x19')]({'raw':_0x388edb[_0x98e9('0x1a')]?_0x388edb[_0x98e9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x388edb[_0x98e9('0x1a')]?_0x388edb[_0x98e9('0x1a')]['where']||null:null,'attributes':_0x388edb[_0x98e9('0x1a')]?_0x388edb[_0x98e9('0x1a')][_0x98e9('0x1b')]||null:null,'limit':_0x388edb[_0x98e9('0x1a')]?_0x388edb[_0x98e9('0x1a')][_0x98e9('0x1c')]||null:null,'include':_0x388edb[_0x98e9('0x1a')]?_0x388edb['options']['include']?_[_0x98e9('0x1d')](_0x388edb[_0x98e9('0x1a')][_0x98e9('0x1e')],function(_0x13f1e0){return{'model':db[_0x13f1e0[_0x98e9('0x1f')]],'as':_0x13f1e0['as'],'attributes':_0x13f1e0['attributes'],'include':_0x13f1e0[_0x98e9('0x1e')]?_[_0x98e9('0x1d')](_0x13f1e0['include'],function(_0xa170d3){return{'model':db[_0xa170d3[_0x98e9('0x1f')]],'as':_0xa170d3['as'],'attributes':_0xa170d3['attributes'],'include':_0xa170d3[_0x98e9('0x1e')]?_[_0x98e9('0x1d')](_0xa170d3[_0x98e9('0x1e')],function(_0x4df381){return{'model':db[_0x4df381[_0x98e9('0x1f')]],'as':_0x4df381['as'],'attributes':_0x4df381[_0x98e9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x98e9('0xc')](function(_0x16a77e){logger[_0x98e9('0xd')](_0x98e9('0x18'),_0x388edb);logger[_0x98e9('0x10')](_0x98e9('0x18'),_0x388edb,JSON['stringify'](_0x16a77e));_0xafe490(_0x16a77e);})[_0x98e9('0x17')](function(_0xd787f2){logger['error']('GetMailServerIn',_0xd787f2[_0x98e9('0x15')],_0x388edb);_0x2feaac(_0x10fcc0[_0x98e9('0x13')](0x1f4,_0xd787f2[_0x98e9('0x15')]));});});}; \ No newline at end of file +var _0x1b73=['options','raw','attributes','limit','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x1b73,0x1d5));var _0x31b7=function(_0x15bc3d,_0x467832){_0x15bc3d=_0x15bc3d-0x0;var _0x1f1fbc=_0x1b73[_0x15bc3d];return _0x1f1fbc;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('MailServerIn,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('MailServerIn,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});}exports[_0x31b7('0x17')]=function(_0x5f3245){var _0x223f9f=this;return new Promise(function(_0x437eba,_0x1dc28c){return db[_0x31b7('0x18')][_0x31b7('0x19')]({'raw':_0x5f3245['options']?_0x5f3245[_0x31b7('0x1a')][_0x31b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f3245[_0x31b7('0x1a')]?_0x5f3245[_0x31b7('0x1a')]['where']||null:null,'attributes':_0x5f3245[_0x31b7('0x1a')]?_0x5f3245[_0x31b7('0x1a')][_0x31b7('0x1c')]||null:null,'limit':_0x5f3245[_0x31b7('0x1a')]?_0x5f3245['options'][_0x31b7('0x1d')]||null:null,'include':_0x5f3245[_0x31b7('0x1a')]?_0x5f3245[_0x31b7('0x1a')][_0x31b7('0x1e')]?_[_0x31b7('0x1f')](_0x5f3245[_0x31b7('0x1a')][_0x31b7('0x1e')],function(_0x20e5b0){return{'model':db[_0x20e5b0[_0x31b7('0x20')]],'as':_0x20e5b0['as'],'attributes':_0x20e5b0['attributes'],'include':_0x20e5b0[_0x31b7('0x1e')]?_[_0x31b7('0x1f')](_0x20e5b0[_0x31b7('0x1e')],function(_0x2c993b){return{'model':db[_0x2c993b['model']],'as':_0x2c993b['as'],'attributes':_0x2c993b[_0x31b7('0x1c')],'include':_0x2c993b['include']?_[_0x31b7('0x1f')](_0x2c993b[_0x31b7('0x1e')],function(_0x14b63f){return{'model':db[_0x14b63f[_0x31b7('0x20')]],'as':_0x14b63f['as'],'attributes':_0x14b63f[_0x31b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x31b7('0xb')](function(_0x21ab03){logger[_0x31b7('0x14')]('GetMailServerIn',_0x5f3245);logger['debug']('GetMailServerIn',_0x5f3245,JSON[_0x31b7('0x10')](_0x21ab03));_0x437eba(_0x21ab03);})[_0x31b7('0x16')](function(_0x2a7c54){logger['error'](_0x31b7('0x17'),_0x2a7c54[_0x31b7('0x13')],_0x5f3245);_0x1dc28c(_0x223f9f[_0x31b7('0x11')](0x1f4,_0x2a7c54[_0x31b7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 80d7085..4203793 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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x551e94,_0x453eac){_0x551e94=_0x551e94-0x0;var _0x5882b3=_0x7a54[_0x551e94];return _0x5882b3;};'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(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 5deebe4..5e54560 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 _0x3de3=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x45d4b9,_0x1594d2){var _0xbd805a=function(_0x22cf77){while(--_0x22cf77){_0x45d4b9['push'](_0x45d4b9['shift']());}};_0xbd805a(++_0x1594d2);}(_0x3de3,0x1ce));var _0x33de=function(_0x29e458,_0x321bd6){_0x29e458=_0x29e458-0x0;var _0x1a4a9d=_0x3de3[_0x29e458];return _0x1a4a9d;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'description':{'type':Sequelize[_0x33de('0x1')]},'host':{'type':Sequelize[_0x33de('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x33de('0x1')]},'port':{'type':Sequelize[_0x33de('0x2')]},'secure':{'type':Sequelize[_0x33de('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x33de('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x33de('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5eb8=['INTEGER','BOOLEAN','STRING'];(function(_0x432d9a,_0x31d51c){var _0x1bc16a=function(_0xcdce93){while(--_0xcdce93){_0x432d9a['push'](_0x432d9a['shift']());}};_0x1bc16a(++_0x31d51c);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0x5eb8[_0x2f8a7c];return _0x257e01;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x85eb('0x0')]},'host':{'type':Sequelize[_0x85eb('0x0')]},'user':{'type':Sequelize[_0x85eb('0x0')]},'pass':{'type':Sequelize[_0x85eb('0x0')]},'port':{'type':Sequelize[_0x85eb('0x1')]},'secure':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x85eb('0x0')]},'authentication':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 9cebd30..5eb662e 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 _0xadf6=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','MailServerOut','includeAll','findAll','rows','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xadf6,0x17b));var _0x6adf=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xadf6[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0x6adf('0x0'));var rimraf=require(_0x6adf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6adf('0x2'));var rp=require(_0x6adf('0x3'));var moment=require('moment');var BPromise=require(_0x6adf('0x4'));var Mustache=require(_0x6adf('0x5'));var util=require(_0x6adf('0x6'));var path=require(_0x6adf('0x7'));var sox=require('sox');var csv=require(_0x6adf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6adf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6adf('0xa'));var deskjs=require(_0x6adf('0xb'));var toCsv=require(_0x6adf('0x8'));var querystring=require(_0x6adf('0xc'));var Papa=require(_0x6adf('0xd'));var Redis=require('ioredis');var authService=require(_0x6adf('0xe'));var qs=require(_0x6adf('0xf'));var as=require(_0x6adf('0x10'));var hardwareService=require(_0x6adf('0x11'));var logger=require(_0x6adf('0x12'))('api');var utils=require(_0x6adf('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6adf('0x14'))['db'];function respondWithStatusCode(_0xd77d14,_0x454a28){_0x454a28=_0x454a28||0xcc;return function(_0x354469){if(_0x354469){return _0xd77d14[_0x6adf('0x15')](_0x454a28);}return _0xd77d14[_0x6adf('0x16')](_0x454a28)[_0x6adf('0x17')]();};}function respondWithResult(_0x2f20b9,_0x2dfe36){_0x2dfe36=_0x2dfe36||0xc8;return function(_0x2e907c){if(_0x2e907c){return _0x2f20b9[_0x6adf('0x16')](_0x2dfe36)[_0x6adf('0x18')](_0x2e907c);}};}function respondWithFilteredResult(_0x3a0c5c,_0x47f902){return function(_0x50ab72){if(_0x50ab72){var _0x4adec9=typeof _0x47f902[_0x6adf('0x19')]===_0x6adf('0x1a')&&typeof _0x47f902['limit']===_0x6adf('0x1a');var _0x53877d=_0x50ab72[_0x6adf('0x1b')];var _0xf4c888=_0x4adec9?0x0:_0x47f902[_0x6adf('0x19')];var _0x3ff54b=_0x4adec9?_0x50ab72[_0x6adf('0x1b')]:_0x47f902[_0x6adf('0x19')]+_0x47f902[_0x6adf('0x1c')];var _0x329f72;if(_0x3ff54b>=_0x53877d){_0x3ff54b=_0x53877d;_0x329f72=0xc8;}else{_0x329f72=0xce;}_0x3a0c5c[_0x6adf('0x16')](_0x329f72);return _0x3a0c5c[_0x6adf('0x1d')](_0x6adf('0x1e'),_0xf4c888+'-'+_0x3ff54b+'/'+_0x53877d)[_0x6adf('0x18')](_0x50ab72);}return null;};}function patchUpdates(_0x3d5797){return function(_0x29aa2e){try{jsonpatch['apply'](_0x29aa2e,_0x3d5797,!![]);}catch(_0x7f9533){return BPromise[_0x6adf('0x1f')](_0x7f9533);}return _0x29aa2e[_0x6adf('0x20')]();};}function saveUpdates(_0x18b3eb,_0x10f270){return function(_0x568012){if(_0x568012){return _0x568012[_0x6adf('0x21')](_0x18b3eb)[_0x6adf('0x22')](function(_0x13483c){return _0x13483c;});}return null;};}function removeEntity(_0x35c4cf,_0x402778){return function(_0x1020f7){if(_0x1020f7){return _0x1020f7[_0x6adf('0x23')]()[_0x6adf('0x22')](function(){_0x35c4cf[_0x6adf('0x16')](0xcc)[_0x6adf('0x17')]();});}};}function handleEntityNotFound(_0x38403e,_0x32ffd2){return function(_0x3731c5){if(!_0x3731c5){_0x38403e['sendStatus'](0x194);}return _0x3731c5;};}function handleError(_0x51e6e5,_0x189fa8){_0x189fa8=_0x189fa8||0x1f4;return function(_0x132428){logger[_0x6adf('0x24')](_0x132428[_0x6adf('0x25')]);if(_0x132428[_0x6adf('0x26')]){delete _0x132428[_0x6adf('0x26')];}_0x51e6e5[_0x6adf('0x16')](_0x189fa8)['send'](_0x132428);};}exports[_0x6adf('0x27')]=function(_0x461242,_0x2f2cfa){var _0x251b55={},_0x3cb697={},_0x2ee795={'count':0x0,'rows':[]};var _0x29bc6b=_[_0x6adf('0x28')](db['MailServerOut'][_0x6adf('0x29')],function(_0x57f7f6){return{'name':_0x57f7f6[_0x6adf('0x2a')],'type':_0x57f7f6[_0x6adf('0x2b')]['key']};});_0x3cb697[_0x6adf('0x2c')]=_[_0x6adf('0x28')](_0x29bc6b,_0x6adf('0x26'));_0x3cb697[_0x6adf('0x2d')]=_['keys'](_0x461242['query']);_0x3cb697[_0x6adf('0x2e')]=_[_0x6adf('0x2f')](_0x3cb697[_0x6adf('0x2c')],_0x3cb697[_0x6adf('0x2d')]);_0x251b55[_0x6adf('0x30')]=_['intersection'](_0x3cb697['model'],qs[_0x6adf('0x31')](_0x461242[_0x6adf('0x2d')]['fields']));_0x251b55['attributes']=_0x251b55['attributes'][_0x6adf('0x32')]?_0x251b55[_0x6adf('0x30')]:_0x3cb697['model'];if(!_0x461242[_0x6adf('0x2d')][_0x6adf('0x33')](_0x6adf('0x34'))){_0x251b55['limit']=qs['limit'](_0x461242[_0x6adf('0x2d')][_0x6adf('0x1c')]);_0x251b55[_0x6adf('0x19')]=qs['offset'](_0x461242[_0x6adf('0x2d')][_0x6adf('0x19')]);}_0x251b55['order']=qs[_0x6adf('0x35')](_0x461242[_0x6adf('0x2d')][_0x6adf('0x35')]);_0x251b55['where']=qs[_0x6adf('0x2e')](_[_0x6adf('0x36')](_0x461242[_0x6adf('0x2d')],_0x3cb697[_0x6adf('0x2e')]),_0x29bc6b);if(_0x461242[_0x6adf('0x2d')][_0x6adf('0x37')]){_0x251b55[_0x6adf('0x38')]=_['merge'](_0x251b55['where'],{'$or':_[_0x6adf('0x28')](_0x29bc6b,function(_0x260904){if(_0x260904[_0x6adf('0x2b')]!=='VIRTUAL'){var _0x3a6ad5={};_0x3a6ad5[_0x260904[_0x6adf('0x26')]]={'$like':'%'+_0x461242['query']['filter']+'%'};return _0x3a6ad5;}})});}_0x251b55=_[_0x6adf('0x39')]({},_0x251b55,_0x461242[_0x6adf('0x3a')]);var _0x2cd29c={'where':_0x251b55[_0x6adf('0x38')]};return db[_0x6adf('0x3b')][_0x6adf('0x1b')](_0x2cd29c)[_0x6adf('0x22')](function(_0x182570){_0x2ee795[_0x6adf('0x1b')]=_0x182570;if(_0x461242['query'][_0x6adf('0x3c')]){_0x251b55['include']=[{'all':!![]}];}return db[_0x6adf('0x3b')][_0x6adf('0x3d')](_0x251b55);})['then'](function(_0x50b7f0){_0x2ee795[_0x6adf('0x3e')]=_0x50b7f0;return _0x2ee795;})[_0x6adf('0x22')](respondWithFilteredResult(_0x2f2cfa,_0x251b55))['catch'](handleError(_0x2f2cfa,null));};exports['show']=function(_0x4cd733,_0x2405ce){var _0x4cb005={'raw':!![],'where':{'id':_0x4cd733[_0x6adf('0x3f')]['id']}},_0x403ae7={};_0x403ae7[_0x6adf('0x2c')]=_['keys'](db[_0x6adf('0x3b')]['rawAttributes']);_0x403ae7[_0x6adf('0x2d')]=_['keys'](_0x4cd733['query']);_0x403ae7[_0x6adf('0x2e')]=_['intersection'](_0x403ae7[_0x6adf('0x2c')],_0x403ae7[_0x6adf('0x2d')]);_0x4cb005[_0x6adf('0x30')]=_[_0x6adf('0x2f')](_0x403ae7['model'],qs[_0x6adf('0x31')](_0x4cd733[_0x6adf('0x2d')][_0x6adf('0x31')]));_0x4cb005[_0x6adf('0x30')]=_0x4cb005[_0x6adf('0x30')]['length']?_0x4cb005['attributes']:_0x403ae7['model'];if(_0x4cd733[_0x6adf('0x2d')]['includeAll']){_0x4cb005[_0x6adf('0x40')]=[{'all':!![]}];}_0x4cb005=_[_0x6adf('0x39')]({},_0x4cb005,_0x4cd733[_0x6adf('0x3a')]);return db[_0x6adf('0x3b')][_0x6adf('0x41')](_0x4cb005)[_0x6adf('0x22')](handleEntityNotFound(_0x2405ce,null))['then'](respondWithResult(_0x2405ce,null))['catch'](handleError(_0x2405ce,null));};exports[_0x6adf('0x42')]=function(_0x24fc2f,_0x4005b5){return db['MailServerOut'][_0x6adf('0x42')](_0x24fc2f[_0x6adf('0x43')],{})[_0x6adf('0x22')](respondWithResult(_0x4005b5,0xc9))['catch'](handleError(_0x4005b5,null));};exports['update']=function(_0xb42f30,_0x536800){if(_0xb42f30[_0x6adf('0x43')]['id']){delete _0xb42f30[_0x6adf('0x43')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0xb42f30[_0x6adf('0x3f')]['id']}})['then'](handleEntityNotFound(_0x536800,null))['then'](saveUpdates(_0xb42f30[_0x6adf('0x43')],null))['then'](respondWithResult(_0x536800,null))['catch'](handleError(_0x536800,null));};exports['destroy']=function(_0x5895f2,_0x45b1d6){return db[_0x6adf('0x3b')][_0x6adf('0x41')]({'where':{'id':_0x5895f2[_0x6adf('0x3f')]['id']}})[_0x6adf('0x22')](handleEntityNotFound(_0x45b1d6,null))[_0x6adf('0x22')](removeEntity(_0x45b1d6,null))['catch'](handleError(_0x45b1d6,null));}; \ No newline at end of file +var _0x6496=['type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','length','include','find','create','catch','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','name','send','index','map','MailServerOut','rawAttributes','fieldName'];(function(_0x39ecaa,_0x3e4866){var _0x2eb7a5=function(_0x410f0c){while(--_0x410f0c){_0x39ecaa['push'](_0x39ecaa['shift']());}};_0x2eb7a5(++_0x3e4866);}(_0x6496,0x140));var _0x6649=function(_0x2c2244,_0x197be1){_0x2c2244=_0x2c2244-0x0;var _0x1e3b27=_0x6496[_0x2c2244];return _0x1e3b27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6649('0x0'));var zipdir=require(_0x6649('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6649('0x2'));var moment=require(_0x6649('0x3'));var BPromise=require(_0x6649('0x4'));var Mustache=require(_0x6649('0x5'));var util=require('util');var path=require(_0x6649('0x6'));var sox=require(_0x6649('0x7'));var csv=require(_0x6649('0x8'));var ejs=require(_0x6649('0x9'));var fs=require('fs');var fs_extra=require(_0x6649('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6649('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6649('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6649('0xd'));var Redis=require(_0x6649('0xe'));var authService=require(_0x6649('0xf'));var qs=require(_0x6649('0x10'));var as=require(_0x6649('0x11'));var hardwareService=require(_0x6649('0x12'));var logger=require(_0x6649('0x13'))('api');var utils=require(_0x6649('0x14'));var config=require(_0x6649('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6649('0x16'))['db'];function respondWithStatusCode(_0x2e11b4,_0x164ca0){_0x164ca0=_0x164ca0||0xcc;return function(_0x339ccd){if(_0x339ccd){return _0x2e11b4['sendStatus'](_0x164ca0);}return _0x2e11b4[_0x6649('0x17')](_0x164ca0)[_0x6649('0x18')]();};}function respondWithResult(_0x11b361,_0x3e8ea0){_0x3e8ea0=_0x3e8ea0||0xc8;return function(_0xee71df){if(_0xee71df){return _0x11b361[_0x6649('0x17')](_0x3e8ea0)[_0x6649('0x19')](_0xee71df);}};}function respondWithFilteredResult(_0x15f0e4,_0xa629c2){return function(_0x9fcc6d){if(_0x9fcc6d){var _0x57e408=typeof _0xa629c2[_0x6649('0x1a')]===_0x6649('0x1b')&&typeof _0xa629c2[_0x6649('0x1c')]===_0x6649('0x1b');var _0x13a063=_0x9fcc6d[_0x6649('0x1d')];var _0x5f43c0=_0x57e408?0x0:_0xa629c2['offset'];var _0xa224da=_0x57e408?_0x9fcc6d['count']:_0xa629c2[_0x6649('0x1a')]+_0xa629c2[_0x6649('0x1c')];var _0x1c4d43;if(_0xa224da>=_0x13a063){_0xa224da=_0x13a063;_0x1c4d43=0xc8;}else{_0x1c4d43=0xce;}_0x15f0e4[_0x6649('0x17')](_0x1c4d43);return _0x15f0e4[_0x6649('0x1e')](_0x6649('0x1f'),_0x5f43c0+'-'+_0xa224da+'/'+_0x13a063)[_0x6649('0x19')](_0x9fcc6d);}return null;};}function patchUpdates(_0x405478){return function(_0x2e11af){try{jsonpatch[_0x6649('0x20')](_0x2e11af,_0x405478,!![]);}catch(_0x342a9d){return BPromise['reject'](_0x342a9d);}return _0x2e11af['save']();};}function saveUpdates(_0x239c04,_0x605bf){return function(_0x679ce1){if(_0x679ce1){return _0x679ce1[_0x6649('0x21')](_0x239c04)['then'](function(_0xbf8c5d){return _0xbf8c5d;});}return null;};}function removeEntity(_0x192926,_0x522deb){return function(_0x468096){if(_0x468096){return _0x468096[_0x6649('0x22')]()[_0x6649('0x23')](function(){_0x192926[_0x6649('0x17')](0xcc)[_0x6649('0x18')]();});}};}function handleEntityNotFound(_0x34d471,_0x3feb73){return function(_0x446f0c){if(!_0x446f0c){_0x34d471[_0x6649('0x24')](0x194);}return _0x446f0c;};}function handleError(_0x193303,_0x4e9f43){_0x4e9f43=_0x4e9f43||0x1f4;return function(_0x5b655e){logger[_0x6649('0x25')](_0x5b655e['stack']);if(_0x5b655e['name']){delete _0x5b655e[_0x6649('0x26')];}_0x193303['status'](_0x4e9f43)[_0x6649('0x27')](_0x5b655e);};}exports[_0x6649('0x28')]=function(_0x237513,_0x56430a){var _0x324069={},_0x21ea2c={},_0xa5181a={'count':0x0,'rows':[]};var _0x17b104=_[_0x6649('0x29')](db[_0x6649('0x2a')][_0x6649('0x2b')],function(_0x4d01dc){return{'name':_0x4d01dc[_0x6649('0x2c')],'type':_0x4d01dc[_0x6649('0x2d')][_0x6649('0x2e')]};});_0x21ea2c[_0x6649('0x2f')]=_[_0x6649('0x29')](_0x17b104,_0x6649('0x26'));_0x21ea2c[_0x6649('0x30')]=_[_0x6649('0x31')](_0x237513[_0x6649('0x30')]);_0x21ea2c[_0x6649('0x32')]=_[_0x6649('0x33')](_0x21ea2c[_0x6649('0x2f')],_0x21ea2c[_0x6649('0x30')]);_0x324069[_0x6649('0x34')]=_['intersection'](_0x21ea2c[_0x6649('0x2f')],qs[_0x6649('0x35')](_0x237513['query']['fields']));_0x324069[_0x6649('0x34')]=_0x324069[_0x6649('0x34')]['length']?_0x324069['attributes']:_0x21ea2c[_0x6649('0x2f')];if(!_0x237513[_0x6649('0x30')][_0x6649('0x36')](_0x6649('0x37'))){_0x324069[_0x6649('0x1c')]=qs['limit'](_0x237513[_0x6649('0x30')]['limit']);_0x324069['offset']=qs[_0x6649('0x1a')](_0x237513[_0x6649('0x30')][_0x6649('0x1a')]);}_0x324069[_0x6649('0x38')]=qs[_0x6649('0x39')](_0x237513['query'][_0x6649('0x39')]);_0x324069[_0x6649('0x3a')]=qs[_0x6649('0x32')](_[_0x6649('0x3b')](_0x237513[_0x6649('0x30')],_0x21ea2c['filters']),_0x17b104);if(_0x237513[_0x6649('0x30')]['filter']){_0x324069[_0x6649('0x3a')]=_[_0x6649('0x3c')](_0x324069[_0x6649('0x3a')],{'$or':_['map'](_0x17b104,function(_0x132c80){if(_0x132c80[_0x6649('0x2d')]!==_0x6649('0x3d')){var _0x5e2a4c={};_0x5e2a4c[_0x132c80[_0x6649('0x26')]]={'$like':'%'+_0x237513[_0x6649('0x30')][_0x6649('0x3e')]+'%'};return _0x5e2a4c;}})});}_0x324069=_['merge']({},_0x324069,_0x237513[_0x6649('0x3f')]);var _0x4d4628={'where':_0x324069[_0x6649('0x3a')]};return db[_0x6649('0x2a')][_0x6649('0x1d')](_0x4d4628)[_0x6649('0x23')](function(_0x588d43){_0xa5181a[_0x6649('0x1d')]=_0x588d43;if(_0x237513['query'][_0x6649('0x40')]){_0x324069['include']=[{'all':!![]}];}return db['MailServerOut'][_0x6649('0x41')](_0x324069);})[_0x6649('0x23')](function(_0x129c36){_0xa5181a[_0x6649('0x42')]=_0x129c36;return _0xa5181a;})[_0x6649('0x23')](respondWithFilteredResult(_0x56430a,_0x324069))['catch'](handleError(_0x56430a,null));};exports['show']=function(_0x2ba5c6,_0x5f5858){var _0x110d7f={'raw':!![],'where':{'id':_0x2ba5c6['params']['id']}},_0x3141ff={};_0x3141ff['model']=_[_0x6649('0x31')](db[_0x6649('0x2a')]['rawAttributes']);_0x3141ff['query']=_['keys'](_0x2ba5c6[_0x6649('0x30')]);_0x3141ff[_0x6649('0x32')]=_['intersection'](_0x3141ff['model'],_0x3141ff[_0x6649('0x30')]);_0x110d7f[_0x6649('0x34')]=_[_0x6649('0x33')](_0x3141ff['model'],qs[_0x6649('0x35')](_0x2ba5c6[_0x6649('0x30')]['fields']));_0x110d7f[_0x6649('0x34')]=_0x110d7f[_0x6649('0x34')][_0x6649('0x43')]?_0x110d7f[_0x6649('0x34')]:_0x3141ff['model'];if(_0x2ba5c6[_0x6649('0x30')][_0x6649('0x40')]){_0x110d7f[_0x6649('0x44')]=[{'all':!![]}];}_0x110d7f=_[_0x6649('0x3c')]({},_0x110d7f,_0x2ba5c6[_0x6649('0x3f')]);return db['MailServerOut'][_0x6649('0x45')](_0x110d7f)[_0x6649('0x23')](handleEntityNotFound(_0x5f5858,null))[_0x6649('0x23')](respondWithResult(_0x5f5858,null))['catch'](handleError(_0x5f5858,null));};exports[_0x6649('0x46')]=function(_0x58db67,_0x227614){return db['MailServerOut'][_0x6649('0x46')](_0x58db67['body'],{})['then'](respondWithResult(_0x227614,0xc9))[_0x6649('0x47')](handleError(_0x227614,null));};exports['update']=function(_0x20775a,_0xe1f228){if(_0x20775a[_0x6649('0x48')]['id']){delete _0x20775a['body']['id'];}return db['MailServerOut'][_0x6649('0x45')]({'where':{'id':_0x20775a['params']['id']}})[_0x6649('0x23')](handleEntityNotFound(_0xe1f228,null))['then'](saveUpdates(_0x20775a[_0x6649('0x48')],null))[_0x6649('0x23')](respondWithResult(_0xe1f228,null))[_0x6649('0x47')](handleError(_0xe1f228,null));};exports['destroy']=function(_0x3dc8e5,_0x1a07aa){return db[_0x6649('0x2a')]['find']({'where':{'id':_0x3dc8e5['params']['id']}})['then'](handleEntityNotFound(_0x1a07aa,null))[_0x6649('0x23')](removeEntity(_0x1a07aa,null))[_0x6649('0x47')](handleError(_0x1a07aa,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1fdadaf..01bd330 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 _0x9d94=['mail_servers_out','lodash','moment','request-promise','path','../../config/environment','exports'];(function(_0x5e8460,_0x2003b5){var _0x3d50fd=function(_0x4c499f){while(--_0x4c499f){_0x5e8460['push'](_0x5e8460['shift']());}};_0x3d50fd(++_0x2003b5);}(_0x9d94,0x16d));var _0x49d9=function(_0xba4285,_0x359800){_0xba4285=_0xba4285-0x0;var _0x42513f=_0x9d94[_0xba4285];return _0x42513f;};'use strict';var _=require(_0x49d9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x49d9('0x1'));var BPromise=require('bluebird');var rp=require(_0x49d9('0x2'));var fs=require('fs');var path=require(_0x49d9('0x3'));var rimraf=require('rimraf');var config=require(_0x49d9('0x4'));var attributes=require('./mailServerOut.attributes');module[_0x49d9('0x5')]=function(_0xf9d07,_0x1fd76a){return _0xf9d07['define']('MailServerOut',attributes,{'tableName':_0x49d9('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec68=['define','MailServerOut','mail_servers_out','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x2ff136,_0x192d39){var _0x37c25b=function(_0x4777c4){while(--_0x4777c4){_0x2ff136['push'](_0x2ff136['shift']());}};_0x37c25b(++_0x192d39);}(_0xec68,0x12e));var _0x8ec6=function(_0x3351b0,_0x1c7931){_0x3351b0=_0x3351b0-0x0;var _0x3e1cba=_0xec68[_0x3351b0];return _0x3e1cba;};'use strict';var _=require(_0x8ec6('0x0'));var util=require('util');var logger=require(_0x8ec6('0x1'))('api');var moment=require(_0x8ec6('0x2'));var BPromise=require(_0x8ec6('0x3'));var rp=require(_0x8ec6('0x4'));var fs=require('fs');var path=require(_0x8ec6('0x5'));var rimraf=require(_0x8ec6('0x6'));var config=require(_0x8ec6('0x7'));var attributes=require(_0x8ec6('0x8'));module[_0x8ec6('0x9')]=function(_0x4fbcf3,_0x2e3d28){return _0x4fbcf3[_0x8ec6('0xa')](_0x8ec6('0xb'),attributes,{'tableName':_0x8ec6('0xc'),'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 9cbaa2c..3448a6f 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3fd9d8,_0x9a1892){var _0x181131=function(_0x5a0d16){while(--_0x5a0d16){_0x3fd9d8['push'](_0x3fd9d8['shift']());}};_0x181131(++_0x9a1892);}(_0x2ef3,0xba));var _0x32ef=function(_0x49d457,_0xcb129){_0x49d457=_0x49d457-0x0;var _0x4ef765=_0x2ef3[_0x49d457];return _0x4ef765;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\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(_0x5c9a46,_0x5ae24f){_0x5c9a46=_0x5c9a46-0x0;var _0x5f856b=_0x7a54[_0x5c9a46];return _0x5f856b;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e1bab20..d2e86f9 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 _0xf315=['post','create','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf315,0x1b9));var _0x5f31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf315[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5f31('0x0'));var util=require(_0x5f31('0x1'));var path=require(_0x5f31('0x2'));var timeout=require(_0x5f31('0x3'));var express=require(_0x5f31('0x4'));var router=express['Router']();var fs_extra=require(_0x5f31('0x5'));var auth=require(_0x5f31('0x6'));var interaction=require(_0x5f31('0x7'));var config=require(_0x5f31('0x8'));var controller=require('./mailSubstatus.controller');router[_0x5f31('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5f31('0x9')](_0x5f31('0xa'),auth['isAuthenticated'](),controller[_0x5f31('0xb')]);router[_0x5f31('0x9')](_0x5f31('0xc'),auth[_0x5f31('0xd')](),controller[_0x5f31('0xe')]);router[_0x5f31('0xf')]('/',auth[_0x5f31('0xd')](),controller[_0x5f31('0x10')]);router['put'](_0x5f31('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5f31('0xc'),auth[_0x5f31('0xd')](),controller[_0x5f31('0x11')]);module[_0x5f31('0x12')]=router; \ No newline at end of file +var _0x6909=['/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0x4a45cc,_0x362c8e){var _0x1c10e8=function(_0x44bf03){while(--_0x44bf03){_0x4a45cc['push'](_0x4a45cc['shift']());}};_0x1c10e8(++_0x362c8e);}(_0x6909,0x193));var _0x9690=function(_0x1fdf2e,_0x91dce2){_0x1fdf2e=_0x1fdf2e-0x0;var _0x14dc7a=_0x6909[_0x1fdf2e];return _0x14dc7a;};'use strict';var multer=require(_0x9690('0x0'));var util=require('util');var path=require(_0x9690('0x1'));var timeout=require(_0x9690('0x2'));var express=require('express');var router=express[_0x9690('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9690('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9690('0x5'));var controller=require(_0x9690('0x6'));router[_0x9690('0x7')]('/',auth[_0x9690('0x8')](),controller[_0x9690('0x9')]);router[_0x9690('0x7')](_0x9690('0xa'),auth[_0x9690('0x8')](),controller['describe']);router['get'](_0x9690('0xb'),auth[_0x9690('0x8')](),controller[_0x9690('0xc')]);router[_0x9690('0xd')]('/',auth[_0x9690('0x8')](),controller[_0x9690('0xe')]);router[_0x9690('0xf')](_0x9690('0xb'),auth[_0x9690('0x8')](),controller[_0x9690('0x10')]);router['delete'](_0x9690('0xb'),auth[_0x9690('0x8')](),controller[_0x9690('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 7cd716c..a211a6a 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 _0xcf98=['exports','STRING','name'];(function(_0x5a097c,_0x28506f){var _0x51b539=function(_0xd64448){while(--_0xd64448){_0x5a097c['push'](_0x5a097c['shift']());}};_0x51b539(++_0x28506f);}(_0xcf98,0x8d));var _0x8cf9=function(_0x13f4d3,_0x64f7f6){_0x13f4d3=_0x13f4d3-0x0;var _0x19729a=_0xcf98[_0x13f4d3];return _0x19729a;};'use strict';var Sequelize=require('sequelize');module[_0x8cf9('0x0')]={'name':{'type':Sequelize[_0x8cf9('0x1')],'unique':_0x8cf9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8cf9('0x1')]}}; \ No newline at end of file +var _0xd046=['exports','STRING','name'];(function(_0x1d9187,_0x494ad6){var _0x25d4b0=function(_0x59a1a1){while(--_0x59a1a1){_0x1d9187['push'](_0x1d9187['shift']());}};_0x25d4b0(++_0x494ad6);}(_0xd046,0x129));var _0x6d04=function(_0x1988ae,_0x45564e){_0x1988ae=_0x1988ae-0x0;var _0x2d2cce=_0xd046[_0x1988ae];return _0x2d2cce;};'use strict';var Sequelize=require('sequelize');module[_0x6d04('0x0')]={'name':{'type':Sequelize[_0x6d04('0x1')],'unique':_0x6d04('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 55c4e9a..05c5f78 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 _0xb70d=['include','findAll','catch','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','json','undefined','count','limit','set','Content-Range','reject','save','update','then','end','sendStatus','error','stack','name','send','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x56a3e2,_0x202071){var _0x29b3d6=function(_0xb0c933){while(--_0xb0c933){_0x56a3e2['push'](_0x56a3e2['shift']());}};_0x29b3d6(++_0x202071);}(_0xb70d,0x176));var _0xdb70=function(_0x506198,_0x262c2e){_0x506198=_0x506198-0x0;var _0x3af787=_0xb70d[_0x506198];return _0x3af787;};'use strict';var emlformat=require(_0xdb70('0x0'));var rimraf=require(_0xdb70('0x1'));var zipdir=require(_0xdb70('0x2'));var jsonpatch=require(_0xdb70('0x3'));var rp=require(_0xdb70('0x4'));var moment=require(_0xdb70('0x5'));var BPromise=require(_0xdb70('0x6'));var Mustache=require('mustache');var util=require(_0xdb70('0x7'));var path=require('path');var sox=require(_0xdb70('0x8'));var csv=require(_0xdb70('0x9'));var ejs=require(_0xdb70('0xa'));var fs=require('fs');var fs_extra=require(_0xdb70('0xb'));var _=require(_0xdb70('0xc'));var squel=require(_0xdb70('0xd'));var crypto=require(_0xdb70('0xe'));var jsforce=require(_0xdb70('0xf'));var deskjs=require(_0xdb70('0x10'));var toCsv=require(_0xdb70('0x9'));var querystring=require(_0xdb70('0x11'));var Papa=require('papaparse');var Redis=require(_0xdb70('0x12'));var authService=require(_0xdb70('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdb70('0x14'));var hardwareService=require(_0xdb70('0x15'));var logger=require(_0xdb70('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb70('0x17'))['db'];function respondWithStatusCode(_0x4f01e2,_0x5c234b){_0x5c234b=_0x5c234b||0xcc;return function(_0x66c977){if(_0x66c977){return _0x4f01e2['sendStatus'](_0x5c234b);}return _0x4f01e2[_0xdb70('0x18')](_0x5c234b)['end']();};}function respondWithResult(_0x255ba9,_0x398519){_0x398519=_0x398519||0xc8;return function(_0x1eb8f0){if(_0x1eb8f0){return _0x255ba9[_0xdb70('0x18')](_0x398519)[_0xdb70('0x19')](_0x1eb8f0);}};}function respondWithFilteredResult(_0x26980c,_0x94c7a1){return function(_0x3997ee){if(_0x3997ee){var _0x1090f9=typeof _0x94c7a1['offset']==='undefined'&&typeof _0x94c7a1['limit']===_0xdb70('0x1a');var _0x49bd24=_0x3997ee[_0xdb70('0x1b')];var _0x728233=_0x1090f9?0x0:_0x94c7a1['offset'];var _0x5a433e=_0x1090f9?_0x3997ee[_0xdb70('0x1b')]:_0x94c7a1['offset']+_0x94c7a1[_0xdb70('0x1c')];var _0x408bbc;if(_0x5a433e>=_0x49bd24){_0x5a433e=_0x49bd24;_0x408bbc=0xc8;}else{_0x408bbc=0xce;}_0x26980c['status'](_0x408bbc);return _0x26980c[_0xdb70('0x1d')](_0xdb70('0x1e'),_0x728233+'-'+_0x5a433e+'/'+_0x49bd24)['json'](_0x3997ee);}return null;};}function patchUpdates(_0x1f3af1){return function(_0x4a6ac9){try{jsonpatch['apply'](_0x4a6ac9,_0x1f3af1,!![]);}catch(_0x4833ca){return BPromise[_0xdb70('0x1f')](_0x4833ca);}return _0x4a6ac9[_0xdb70('0x20')]();};}function saveUpdates(_0x3dd816,_0xbd800c){return function(_0xee722){if(_0xee722){return _0xee722[_0xdb70('0x21')](_0x3dd816)[_0xdb70('0x22')](function(_0x39eb83){return _0x39eb83;});}return null;};}function removeEntity(_0x5ba922,_0x3d5cc3){return function(_0x91f58){if(_0x91f58){return _0x91f58['destroy']()['then'](function(){_0x5ba922[_0xdb70('0x18')](0xcc)[_0xdb70('0x23')]();});}};}function handleEntityNotFound(_0x423853,_0x4fa567){return function(_0x5d107e){if(!_0x5d107e){_0x423853[_0xdb70('0x24')](0x194);}return _0x5d107e;};}function handleError(_0x3fa32c,_0x30350e){_0x30350e=_0x30350e||0x1f4;return function(_0xa1a837){logger[_0xdb70('0x25')](_0xa1a837[_0xdb70('0x26')]);if(_0xa1a837['name']){delete _0xa1a837[_0xdb70('0x27')];}_0x3fa32c[_0xdb70('0x18')](_0x30350e)[_0xdb70('0x28')](_0xa1a837);};}exports['index']=function(_0x24d480,_0xa4eca1){var _0x4f49af={},_0x4a4011={},_0x3bc2c5={'count':0x0,'rows':[]};var _0x627c75=_[_0xdb70('0x29')](db[_0xdb70('0x2a')][_0xdb70('0x2b')],function(_0x33790f){return{'name':_0x33790f['fieldName'],'type':_0x33790f[_0xdb70('0x2c')][_0xdb70('0x2d')]};});_0x4a4011[_0xdb70('0x2e')]=_[_0xdb70('0x29')](_0x627c75,'name');_0x4a4011[_0xdb70('0x2f')]=_[_0xdb70('0x30')](_0x24d480[_0xdb70('0x2f')]);_0x4a4011[_0xdb70('0x31')]=_[_0xdb70('0x32')](_0x4a4011['model'],_0x4a4011['query']);_0x4f49af[_0xdb70('0x33')]=_[_0xdb70('0x32')](_0x4a4011['model'],qs[_0xdb70('0x34')](_0x24d480['query'][_0xdb70('0x34')]));_0x4f49af['attributes']=_0x4f49af[_0xdb70('0x33')][_0xdb70('0x35')]?_0x4f49af[_0xdb70('0x33')]:_0x4a4011['model'];if(!_0x24d480[_0xdb70('0x2f')]['hasOwnProperty'](_0xdb70('0x36'))){_0x4f49af[_0xdb70('0x1c')]=qs[_0xdb70('0x1c')](_0x24d480[_0xdb70('0x2f')][_0xdb70('0x1c')]);_0x4f49af[_0xdb70('0x37')]=qs[_0xdb70('0x37')](_0x24d480[_0xdb70('0x2f')][_0xdb70('0x37')]);}_0x4f49af[_0xdb70('0x38')]=qs[_0xdb70('0x39')](_0x24d480[_0xdb70('0x2f')]['sort']);_0x4f49af[_0xdb70('0x3a')]=qs['filters'](_['pick'](_0x24d480['query'],_0x4a4011[_0xdb70('0x31')]),_0x627c75);if(_0x24d480[_0xdb70('0x2f')][_0xdb70('0x3b')]){_0x4f49af[_0xdb70('0x3a')]=_[_0xdb70('0x3c')](_0x4f49af[_0xdb70('0x3a')],{'$or':_['map'](_0x627c75,function(_0x4abb6f){if(_0x4abb6f[_0xdb70('0x2c')]!==_0xdb70('0x3d')){var _0x4de937={};_0x4de937[_0x4abb6f[_0xdb70('0x27')]]={'$like':'%'+_0x24d480[_0xdb70('0x2f')]['filter']+'%'};return _0x4de937;}})});}_0x4f49af=_['merge']({},_0x4f49af,_0x24d480[_0xdb70('0x3e')]);var _0x442e13={'where':_0x4f49af[_0xdb70('0x3a')]};return db[_0xdb70('0x2a')][_0xdb70('0x1b')](_0x442e13)[_0xdb70('0x22')](function(_0x50d106){_0x3bc2c5[_0xdb70('0x1b')]=_0x50d106;if(_0x24d480['query'][_0xdb70('0x3f')]){_0x4f49af[_0xdb70('0x40')]=[{'all':!![]}];}return db[_0xdb70('0x2a')][_0xdb70('0x41')](_0x4f49af);})[_0xdb70('0x22')](function(_0x344fe4){_0x3bc2c5['rows']=_0x344fe4;return _0x3bc2c5;})[_0xdb70('0x22')](respondWithFilteredResult(_0xa4eca1,_0x4f49af))[_0xdb70('0x42')](handleError(_0xa4eca1,null));};exports['show']=function(_0x19f4b0,_0x5f3ab7){var _0x391786={'raw':!![],'where':{'id':_0x19f4b0['params']['id']}},_0x568624={};_0x568624[_0xdb70('0x2e')]=_[_0xdb70('0x30')](db[_0xdb70('0x2a')][_0xdb70('0x2b')]);_0x568624[_0xdb70('0x2f')]=_['keys'](_0x19f4b0[_0xdb70('0x2f')]);_0x568624[_0xdb70('0x31')]=_[_0xdb70('0x32')](_0x568624[_0xdb70('0x2e')],_0x568624['query']);_0x391786[_0xdb70('0x33')]=_[_0xdb70('0x32')](_0x568624[_0xdb70('0x2e')],qs[_0xdb70('0x34')](_0x19f4b0[_0xdb70('0x2f')][_0xdb70('0x34')]));_0x391786[_0xdb70('0x33')]=_0x391786[_0xdb70('0x33')][_0xdb70('0x35')]?_0x391786[_0xdb70('0x33')]:_0x568624['model'];if(_0x19f4b0[_0xdb70('0x2f')][_0xdb70('0x3f')]){_0x391786[_0xdb70('0x40')]=[{'all':!![]}];}_0x391786=_[_0xdb70('0x3c')]({},_0x391786,_0x19f4b0['options']);return db['MailSubstatus'][_0xdb70('0x43')](_0x391786)[_0xdb70('0x22')](handleEntityNotFound(_0x5f3ab7,null))['then'](respondWithResult(_0x5f3ab7,null))[_0xdb70('0x42')](handleError(_0x5f3ab7,null));};exports[_0xdb70('0x44')]=function(_0x9b5344,_0x595887){return db[_0xdb70('0x2a')][_0xdb70('0x44')](_0x9b5344['body'],{})[_0xdb70('0x22')](respondWithResult(_0x595887,0xc9))['catch'](handleError(_0x595887,null));};exports[_0xdb70('0x21')]=function(_0x3fcaa2,_0x24143f){if(_0x3fcaa2[_0xdb70('0x45')]['id']){delete _0x3fcaa2['body']['id'];}return db[_0xdb70('0x2a')][_0xdb70('0x43')]({'where':{'id':_0x3fcaa2[_0xdb70('0x46')]['id']}})['then'](handleEntityNotFound(_0x24143f,null))[_0xdb70('0x22')](saveUpdates(_0x3fcaa2[_0xdb70('0x45')],null))[_0xdb70('0x22')](respondWithResult(_0x24143f,null))[_0xdb70('0x42')](handleError(_0x24143f,null));};exports[_0xdb70('0x47')]=function(_0x41f092,_0x2871a7){return db[_0xdb70('0x2a')][_0xdb70('0x43')]({'where':{'id':_0x41f092[_0xdb70('0x46')]['id']}})[_0xdb70('0x22')](handleEntityNotFound(_0x2871a7,null))['then'](removeEntity(_0x2871a7,null))['catch'](handleError(_0x2871a7,null));};exports[_0xdb70('0x48')]=function(_0x594686,_0x66b14c){return db['MailSubstatus'][_0xdb70('0x48')]()[_0xdb70('0x22')](respondWithResult(_0x66b14c,null))[_0xdb70('0x42')](handleError(_0x66b14c,null));}; \ No newline at end of file +var _0xd370=['update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','MailSubstatus','includeAll','include','rows','show','params','length','find','catch','create'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd370,0x127));var _0x0d37=function(_0x39a6ca,_0x10c9f0){_0x39a6ca=_0x39a6ca-0x0;var _0x752c2f=_0xd370[_0x39a6ca];return _0x752c2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d37('0x0'));var zipdir=require(_0x0d37('0x1'));var jsonpatch=require(_0x0d37('0x2'));var rp=require(_0x0d37('0x3'));var moment=require('moment');var BPromise=require(_0x0d37('0x4'));var Mustache=require(_0x0d37('0x5'));var util=require(_0x0d37('0x6'));var path=require(_0x0d37('0x7'));var sox=require('sox');var csv=require(_0x0d37('0x8'));var ejs=require(_0x0d37('0x9'));var fs=require('fs');var fs_extra=require(_0x0d37('0xa'));var _=require(_0x0d37('0xb'));var squel=require('squel');var crypto=require(_0x0d37('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0d37('0xd'));var Papa=require(_0x0d37('0xe'));var Redis=require(_0x0d37('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0d37('0x10'));var hardwareService=require(_0x0d37('0x11'));var logger=require('../../config/logger')(_0x0d37('0x12'));var utils=require(_0x0d37('0x13'));var config=require(_0x0d37('0x14'));var licenseUtil=require(_0x0d37('0x15'));var db=require(_0x0d37('0x16'))['db'];function respondWithStatusCode(_0x189216,_0x392dc4){_0x392dc4=_0x392dc4||0xcc;return function(_0x3b29b4){if(_0x3b29b4){return _0x189216[_0x0d37('0x17')](_0x392dc4);}return _0x189216[_0x0d37('0x18')](_0x392dc4)[_0x0d37('0x19')]();};}function respondWithResult(_0x34eb42,_0x3d8b5a){_0x3d8b5a=_0x3d8b5a||0xc8;return function(_0x2739e9){if(_0x2739e9){return _0x34eb42[_0x0d37('0x18')](_0x3d8b5a)['json'](_0x2739e9);}};}function respondWithFilteredResult(_0x1c6448,_0x32e227){return function(_0x3e56e4){if(_0x3e56e4){var _0x153c25=typeof _0x32e227[_0x0d37('0x1a')]===_0x0d37('0x1b')&&typeof _0x32e227[_0x0d37('0x1c')]==='undefined';var _0xd1ca2b=_0x3e56e4[_0x0d37('0x1d')];var _0x105b4c=_0x153c25?0x0:_0x32e227[_0x0d37('0x1a')];var _0x1392a7=_0x153c25?_0x3e56e4[_0x0d37('0x1d')]:_0x32e227['offset']+_0x32e227[_0x0d37('0x1c')];var _0x17b44b;if(_0x1392a7>=_0xd1ca2b){_0x1392a7=_0xd1ca2b;_0x17b44b=0xc8;}else{_0x17b44b=0xce;}_0x1c6448[_0x0d37('0x18')](_0x17b44b);return _0x1c6448[_0x0d37('0x1e')](_0x0d37('0x1f'),_0x105b4c+'-'+_0x1392a7+'/'+_0xd1ca2b)[_0x0d37('0x20')](_0x3e56e4);}return null;};}function patchUpdates(_0x5cdeb0){return function(_0x46f4f6){try{jsonpatch[_0x0d37('0x21')](_0x46f4f6,_0x5cdeb0,!![]);}catch(_0x3f72d1){return BPromise['reject'](_0x3f72d1);}return _0x46f4f6['save']();};}function saveUpdates(_0x12d5cd,_0xd845ea){return function(_0x4fb31b){if(_0x4fb31b){return _0x4fb31b['update'](_0x12d5cd)[_0x0d37('0x22')](function(_0x5dd4f3){return _0x5dd4f3;});}return null;};}function removeEntity(_0x27c6c1,_0x324cc7){return function(_0xd2757b){if(_0xd2757b){return _0xd2757b[_0x0d37('0x23')]()[_0x0d37('0x22')](function(){_0x27c6c1[_0x0d37('0x18')](0xcc)[_0x0d37('0x19')]();});}};}function handleEntityNotFound(_0x58bb86,_0xc9b561){return function(_0x34f224){if(!_0x34f224){_0x58bb86[_0x0d37('0x17')](0x194);}return _0x34f224;};}function handleError(_0x5716ef,_0x2e7987){_0x2e7987=_0x2e7987||0x1f4;return function(_0x357c6b){logger['error'](_0x357c6b[_0x0d37('0x24')]);if(_0x357c6b['name']){delete _0x357c6b[_0x0d37('0x25')];}_0x5716ef['status'](_0x2e7987)[_0x0d37('0x26')](_0x357c6b);};}exports[_0x0d37('0x27')]=function(_0x1e0c62,_0x2307e6){var _0x4227cd={},_0x48f78a={},_0x394825={'count':0x0,'rows':[]};var _0x150bef=_[_0x0d37('0x28')](db['MailSubstatus'][_0x0d37('0x29')],function(_0x49d4ac){return{'name':_0x49d4ac[_0x0d37('0x2a')],'type':_0x49d4ac[_0x0d37('0x2b')][_0x0d37('0x2c')]};});_0x48f78a[_0x0d37('0x2d')]=_['map'](_0x150bef,_0x0d37('0x25'));_0x48f78a['query']=_[_0x0d37('0x2e')](_0x1e0c62[_0x0d37('0x2f')]);_0x48f78a[_0x0d37('0x30')]=_[_0x0d37('0x31')](_0x48f78a[_0x0d37('0x2d')],_0x48f78a[_0x0d37('0x2f')]);_0x4227cd[_0x0d37('0x32')]=_[_0x0d37('0x31')](_0x48f78a[_0x0d37('0x2d')],qs[_0x0d37('0x33')](_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x33')]));_0x4227cd[_0x0d37('0x32')]=_0x4227cd[_0x0d37('0x32')]['length']?_0x4227cd[_0x0d37('0x32')]:_0x48f78a['model'];if(!_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x34')]('nolimit')){_0x4227cd[_0x0d37('0x1c')]=qs[_0x0d37('0x1c')](_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x1c')]);_0x4227cd[_0x0d37('0x1a')]=qs[_0x0d37('0x1a')](_0x1e0c62[_0x0d37('0x2f')]['offset']);}_0x4227cd[_0x0d37('0x35')]=qs[_0x0d37('0x36')](_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x36')]);_0x4227cd[_0x0d37('0x37')]=qs[_0x0d37('0x30')](_['pick'](_0x1e0c62[_0x0d37('0x2f')],_0x48f78a[_0x0d37('0x30')]),_0x150bef);if(_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x38')]){_0x4227cd['where']=_[_0x0d37('0x39')](_0x4227cd['where'],{'$or':_[_0x0d37('0x28')](_0x150bef,function(_0x4d3b15){if(_0x4d3b15[_0x0d37('0x2b')]!==_0x0d37('0x3a')){var _0x490873={};_0x490873[_0x4d3b15['name']]={'$like':'%'+_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x38')]+'%'};return _0x490873;}})});}_0x4227cd=_[_0x0d37('0x39')]({},_0x4227cd,_0x1e0c62[_0x0d37('0x3b')]);var _0x4b087c={'where':_0x4227cd[_0x0d37('0x37')]};return db[_0x0d37('0x3c')][_0x0d37('0x1d')](_0x4b087c)[_0x0d37('0x22')](function(_0x5cab9d){_0x394825['count']=_0x5cab9d;if(_0x1e0c62[_0x0d37('0x2f')][_0x0d37('0x3d')]){_0x4227cd[_0x0d37('0x3e')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x4227cd);})[_0x0d37('0x22')](function(_0x1aacd9){_0x394825[_0x0d37('0x3f')]=_0x1aacd9;return _0x394825;})['then'](respondWithFilteredResult(_0x2307e6,_0x4227cd))['catch'](handleError(_0x2307e6,null));};exports[_0x0d37('0x40')]=function(_0x2578b7,_0x10deb7){var _0x5dee39={'raw':!![],'where':{'id':_0x2578b7[_0x0d37('0x41')]['id']}},_0x429f4d={};_0x429f4d['model']=_['keys'](db[_0x0d37('0x3c')][_0x0d37('0x29')]);_0x429f4d['query']=_['keys'](_0x2578b7[_0x0d37('0x2f')]);_0x429f4d[_0x0d37('0x30')]=_[_0x0d37('0x31')](_0x429f4d['model'],_0x429f4d[_0x0d37('0x2f')]);_0x5dee39['attributes']=_[_0x0d37('0x31')](_0x429f4d[_0x0d37('0x2d')],qs['fields'](_0x2578b7['query'][_0x0d37('0x33')]));_0x5dee39['attributes']=_0x5dee39['attributes'][_0x0d37('0x42')]?_0x5dee39[_0x0d37('0x32')]:_0x429f4d[_0x0d37('0x2d')];if(_0x2578b7[_0x0d37('0x2f')][_0x0d37('0x3d')]){_0x5dee39[_0x0d37('0x3e')]=[{'all':!![]}];}_0x5dee39=_[_0x0d37('0x39')]({},_0x5dee39,_0x2578b7['options']);return db['MailSubstatus'][_0x0d37('0x43')](_0x5dee39)[_0x0d37('0x22')](handleEntityNotFound(_0x10deb7,null))['then'](respondWithResult(_0x10deb7,null))[_0x0d37('0x44')](handleError(_0x10deb7,null));};exports[_0x0d37('0x45')]=function(_0x32faf6,_0x1d2489){return db[_0x0d37('0x3c')][_0x0d37('0x45')](_0x32faf6['body'],{})[_0x0d37('0x22')](respondWithResult(_0x1d2489,0xc9))[_0x0d37('0x44')](handleError(_0x1d2489,null));};exports[_0x0d37('0x46')]=function(_0x55510f,_0x45b667){if(_0x55510f[_0x0d37('0x47')]['id']){delete _0x55510f[_0x0d37('0x47')]['id'];}return db['MailSubstatus'][_0x0d37('0x43')]({'where':{'id':_0x55510f[_0x0d37('0x41')]['id']}})['then'](handleEntityNotFound(_0x45b667,null))[_0x0d37('0x22')](saveUpdates(_0x55510f[_0x0d37('0x47')],null))[_0x0d37('0x22')](respondWithResult(_0x45b667,null))['catch'](handleError(_0x45b667,null));};exports[_0x0d37('0x23')]=function(_0x161b56,_0x1731c9){return db['MailSubstatus'][_0x0d37('0x43')]({'where':{'id':_0x161b56[_0x0d37('0x41')]['id']}})[_0x0d37('0x22')](handleEntityNotFound(_0x1731c9,null))[_0x0d37('0x22')](removeEntity(_0x1731c9,null))['catch'](handleError(_0x1731c9,null));};exports[_0x0d37('0x48')]=function(_0xbce8db,_0x1452c2){return db[_0x0d37('0x3c')][_0x0d37('0x48')]()[_0x0d37('0x22')](respondWithResult(_0x1452c2,null))['catch'](handleError(_0x1452c2,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 3455e88..7efa3ca 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 _0x2ad9=['hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0x2ad9,0x108));var _0x92ad=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2ad9[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x92ad('0x0'));var MailSubstatus=require(_0x92ad('0x1'))['db'][_0x92ad('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x92ad('0x3')](0x0);var events={'afterUpdate':_0x92ad('0x4')};function emitEvent(_0x5aba9a){return function(_0x13c7de,_0x4391c2,_0x3c83a1){MailSubstatusEvents[_0x92ad('0x5')](_0x5aba9a+':'+_0x13c7de['id'],_0x13c7de);MailSubstatusEvents['emit'](_0x5aba9a,_0x13c7de);_0x3c83a1(null);};}for(var e in events){if(events[_0x92ad('0x6')](e)){var event=events[e];MailSubstatus[_0x92ad('0x7')](e,emitEvent(event));}}module[_0x92ad('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x9745=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus'];(function(_0x433bf8,_0x323382){var _0x5c8da9=function(_0x50367e){while(--_0x50367e){_0x433bf8['push'](_0x433bf8['shift']());}};_0x5c8da9(++_0x323382);}(_0x9745,0x12f));var _0x5974=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x9745[_0x2555d0];return _0x3bb486;};'use strict';var EventEmitter=require(_0x5974('0x0'));var MailSubstatus=require(_0x5974('0x1'))['db'][_0x5974('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5974('0x3')](0x0);var events={'afterUpdate':_0x5974('0x4')};function emitEvent(_0x139442){return function(_0x38d4b2,_0x156572,_0x227d9c){MailSubstatusEvents[_0x5974('0x5')](_0x139442+':'+_0x38d4b2['id'],_0x38d4b2);MailSubstatusEvents[_0x5974('0x5')](_0x139442,_0x38d4b2);_0x227d9c(null);};}for(var e in events){if(events[_0x5974('0x6')](e)){var event=events[e];MailSubstatus[_0x5974('0x7')](e,emitEvent(event));}}module[_0x5974('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 dcde41c..04bffb4 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 _0x07a6=['catch','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','name'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x07a6,0xbf));var _0x607a=function(_0x88804a,_0x1f5f63){_0x88804a=_0x88804a-0x0;var _0x49ac73=_0x07a6[_0x88804a];return _0x49ac73;};'use strict';var attributes=require(_0x607a('0x0'));module[_0x607a('0x1')]=function(_0x16692c){var _0x47f529=_0x16692c['models'];return _0x16692c[_0x607a('0x2')](_0x607a('0x3'),attributes,{'tableName':_0x607a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x53cfeb,_0x26523e,_0x4987a2){return _0x47f529[_0x607a('0x5')][_0x607a('0x6')]({'value':_0x53cfeb['name']},{'where':{'field':_0x607a('0x7'),'value':_0x53cfeb['_previousDataValues'][_0x607a('0x8')]}})['then'](function(){_0x4987a2();})[_0x607a('0x9')](function(_0x3d46fd){_0x4987a2(_0x3d46fd);});}}});}; \ No newline at end of file +var _0x8c25=['define','update','name','then','exports','models'];(function(_0x2f03c9,_0x2753de){var _0x5bb6e0=function(_0x332e55){while(--_0x332e55){_0x2f03c9['push'](_0x2f03c9['shift']());}};_0x5bb6e0(++_0x2753de);}(_0x8c25,0xe2));var _0x58c2=function(_0x580884,_0x50f90f){_0x580884=_0x580884-0x0;var _0x45a618=_0x8c25[_0x580884];return _0x45a618;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x58c2('0x0')]=function(_0x4ececc){var _0x245c6f=_0x4ececc[_0x58c2('0x1')];return _0x4ececc[_0x58c2('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x42cae6,_0xa7d84d,_0x2af6b8){return _0x245c6f['Condition'][_0x58c2('0x3')]({'value':_0x42cae6[_0x58c2('0x4')]},{'where':{'field':'mailSubstatus','value':_0x42cae6['_previousDataValues'][_0x58c2('0x4')]}})[_0x58c2('0x5')](function(){_0x2af6b8();})['catch'](function(_0x42916a){_0x2af6b8(_0x42916a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 3c79f24..1a2c0e9 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 _0xa5f4=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','code','error','MailSubstatus,\x20%s,\x20%s','message'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa5f4,0xd4));var _0x4a5f=function(_0x198799,_0x5e65e9){_0x198799=_0x198799-0x0;var _0x54ba3e=_0xa5f4[_0x198799];return _0x54ba3e;};'use strict';var _=require(_0x4a5f('0x0'));var util=require('util');var moment=require(_0x4a5f('0x1'));var BPromise=require(_0x4a5f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a5f('0x3'))['db'];var utils=require(_0x4a5f('0x4'));var logger=require(_0x4a5f('0x5'))(_0x4a5f('0x6'));var config=require(_0x4a5f('0x7'));var jayson=require(_0x4a5f('0x8'));var client=jayson[_0x4a5f('0x9')][_0x4a5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53554c,_0x23e2e3,_0x4c1816){return new BPromise(function(_0x35ab74,_0x5c6bbb){return client[_0x4a5f('0xb')](_0x53554c,_0x4c1816)['then'](function(_0x30b9c5){logger[_0x4a5f('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x23e2e3,'request\x20sent');logger[_0x4a5f('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x23e2e3,_0x4a5f('0xe'),JSON['stringify'](_0x30b9c5));if(_0x30b9c5['error']){if(_0x30b9c5['error'][_0x4a5f('0xf')]===0x1f4){logger[_0x4a5f('0x10')](_0x4a5f('0x11'),_0x23e2e3,_0x30b9c5[_0x4a5f('0x10')]['message']);return _0x5c6bbb(_0x30b9c5[_0x4a5f('0x10')][_0x4a5f('0x12')]);}logger[_0x4a5f('0x10')](_0x4a5f('0x11'),_0x23e2e3,_0x30b9c5[_0x4a5f('0x10')][_0x4a5f('0x12')]);return _0x35ab74(_0x30b9c5[_0x4a5f('0x10')][_0x4a5f('0x12')]);}else{logger['info'](_0x4a5f('0x11'),_0x23e2e3,_0x4a5f('0xe'));_0x35ab74(_0x30b9c5[_0x4a5f('0x13')][_0x4a5f('0x12')]);}})[_0x4a5f('0x14')](function(_0x57a65e){logger[_0x4a5f('0x10')](_0x4a5f('0x11'),_0x23e2e3,_0x57a65e);_0x5c6bbb(_0x57a65e);});});} \ No newline at end of file +var _0x8b97=['http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x436f5f,_0x6d9f98){var _0x2b3b4d=function(_0x415d9d){while(--_0x415d9d){_0x436f5f['push'](_0x436f5f['shift']());}};_0x2b3b4d(++_0x6d9f98);}(_0x8b97,0x1d9));var _0x78b9=function(_0x4862d0,_0x47606e){_0x4862d0=_0x4862d0-0x0;var _0x1bd229=_0x8b97[_0x4862d0];return _0x1bd229;};'use strict';var _=require(_0x78b9('0x0'));var util=require('util');var moment=require(_0x78b9('0x1'));var BPromise=require(_0x78b9('0x2'));var rs=require(_0x78b9('0x3'));var fs=require('fs');var Redis=require(_0x78b9('0x4'));var db=require(_0x78b9('0x5'))['db'];var utils=require(_0x78b9('0x6'));var logger=require('../../config/logger')(_0x78b9('0x7'));var config=require(_0x78b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x78b9('0x9')][_0x78b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b59e4,_0x2fed3b,_0x226007){return new BPromise(function(_0x1fc7e,_0x1500f6){return client[_0x78b9('0xb')](_0x4b59e4,_0x226007)[_0x78b9('0xc')](function(_0x14afde){logger[_0x78b9('0xd')](_0x78b9('0xe'),_0x2fed3b,_0x78b9('0xf'));logger[_0x78b9('0x10')](_0x78b9('0x11'),_0x2fed3b,_0x78b9('0xf'),JSON['stringify'](_0x14afde));if(_0x14afde[_0x78b9('0x12')]){if(_0x14afde[_0x78b9('0x12')][_0x78b9('0x13')]===0x1f4){logger['error'](_0x78b9('0xe'),_0x2fed3b,_0x14afde[_0x78b9('0x12')][_0x78b9('0x14')]);return _0x1500f6(_0x14afde[_0x78b9('0x12')][_0x78b9('0x14')]);}logger[_0x78b9('0x12')](_0x78b9('0xe'),_0x2fed3b,_0x14afde[_0x78b9('0x12')][_0x78b9('0x14')]);return _0x1fc7e(_0x14afde[_0x78b9('0x12')][_0x78b9('0x14')]);}else{logger[_0x78b9('0xd')](_0x78b9('0xe'),_0x2fed3b,_0x78b9('0xf'));_0x1fc7e(_0x14afde[_0x78b9('0x15')][_0x78b9('0x14')]);}})[_0x78b9('0x16')](function(_0xa3ca52){logger[_0x78b9('0x12')](_0x78b9('0xe'),_0x2fed3b,_0xa3ca52);_0x1500f6(_0xa3ca52);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9f26f5c..dafaf41 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 _0x0110=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','get','/:id','show','create','delete','destroy','exports','multer','util','path'];(function(_0xe7082a,_0xd0d68f){var _0x92f6a8=function(_0x214ad7){while(--_0x214ad7){_0xe7082a['push'](_0xe7082a['shift']());}};_0x92f6a8(++_0xd0d68f);}(_0x0110,0x9f));var _0x0011=function(_0x236d39,_0x2fd1db){_0x236d39=_0x236d39-0x0;var _0x302fb4=_0x0110[_0x236d39];return _0x302fb4;};'use strict';var multer=require(_0x0011('0x0'));var util=require(_0x0011('0x1'));var path=require(_0x0011('0x2'));var timeout=require(_0x0011('0x3'));var express=require(_0x0011('0x4'));var router=express['Router']();var fs_extra=require(_0x0011('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0011('0x6'));var config=require(_0x0011('0x7'));var controller=require('./mailTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0011('0x8')]);router['get']('/describe',auth[_0x0011('0x9')](),controller[_0x0011('0xa')]);router[_0x0011('0xb')](_0x0011('0xc'),auth[_0x0011('0x9')](),controller[_0x0011('0xd')]);router['post']('/',auth[_0x0011('0x9')](),controller[_0x0011('0xe')]);router['put'](_0x0011('0xc'),auth[_0x0011('0x9')](),controller['update']);router[_0x0011('0xf')](_0x0011('0xc'),auth['isAuthenticated'](),controller[_0x0011('0x10')]);module[_0x0011('0x11')]=router; \ No newline at end of file +var _0x32d8=['update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x463f8d,_0x4c33ef){var _0x23c1dc=function(_0x5de27d){while(--_0x5de27d){_0x463f8d['push'](_0x463f8d['shift']());}};_0x23c1dc(++_0x4c33ef);}(_0x32d8,0xca));var _0x832d=function(_0x6d91a,_0x3c06dc){_0x6d91a=_0x6d91a-0x0;var _0x405faf=_0x32d8[_0x6d91a];return _0x405faf;};'use strict';var multer=require('multer');var util=require(_0x832d('0x0'));var path=require(_0x832d('0x1'));var timeout=require(_0x832d('0x2'));var express=require('express');var router=express[_0x832d('0x3')]();var fs_extra=require(_0x832d('0x4'));var auth=require(_0x832d('0x5'));var interaction=require(_0x832d('0x6'));var config=require('../../config/environment');var controller=require(_0x832d('0x7'));router[_0x832d('0x8')]('/',auth[_0x832d('0x9')](),controller[_0x832d('0xa')]);router[_0x832d('0x8')](_0x832d('0xb'),auth[_0x832d('0x9')](),controller[_0x832d('0xc')]);router[_0x832d('0x8')](_0x832d('0xd'),auth[_0x832d('0x9')](),controller[_0x832d('0xe')]);router[_0x832d('0xf')]('/',auth[_0x832d('0x9')](),controller[_0x832d('0x10')]);router[_0x832d('0x11')](_0x832d('0xd'),auth[_0x832d('0x9')](),controller[_0x832d('0x12')]);router[_0x832d('0x13')]('/:id',auth[_0x832d('0x9')](),controller[_0x832d('0x14')]);module[_0x832d('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 9f0a1d0..d2fc028 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1b126a,_0x354ce0){var _0x1da353=function(_0xc5b173){while(--_0xc5b173){_0x1b126a['push'](_0x1b126a['shift']());}};_0x1da353(++_0x354ce0);}(_0x54ef,0x112));var _0xf54e=function(_0x47c197,_0x2c478f){_0x47c197=_0x47c197-0x0;var _0x490148=_0x54ef[_0x47c197];return _0x490148;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3015e3,_0x344757){var _0x102c35=function(_0x3c44f6){while(--_0x3c44f6){_0x3015e3['push'](_0x3015e3['shift']());}};_0x102c35(++_0x344757);}(_0xf4eb,0xec));var _0xbf4e=function(_0x6a57f2,_0x2b51da){_0x6a57f2=_0x6a57f2-0x0;var _0x7bacd8=_0xf4eb[_0x6a57f2];return _0x7bacd8;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 67f65d9..03b3ce8 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 _0x5731=['end','json','offset','undefined','count','Content-Range','apply','reject','save','destroy','then','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','update','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x5731,0x153));var _0x1573=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5731[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x1573('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1573('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1573('0x2'));var moment=require(_0x1573('0x3'));var BPromise=require(_0x1573('0x4'));var Mustache=require(_0x1573('0x5'));var util=require(_0x1573('0x6'));var path=require(_0x1573('0x7'));var sox=require(_0x1573('0x8'));var csv=require(_0x1573('0x9'));var ejs=require(_0x1573('0xa'));var fs=require('fs');var fs_extra=require(_0x1573('0xb'));var _=require(_0x1573('0xc'));var squel=require(_0x1573('0xd'));var crypto=require(_0x1573('0xe'));var jsforce=require(_0x1573('0xf'));var deskjs=require(_0x1573('0x10'));var toCsv=require(_0x1573('0x9'));var querystring=require('querystring');var Papa=require(_0x1573('0x11'));var Redis=require(_0x1573('0x12'));var authService=require(_0x1573('0x13'));var qs=require(_0x1573('0x14'));var as=require(_0x1573('0x15'));var hardwareService=require(_0x1573('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1573('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5905a0,_0x10e24e){_0x10e24e=_0x10e24e||0xcc;return function(_0x32f956){if(_0x32f956){return _0x5905a0[_0x1573('0x18')](_0x10e24e);}return _0x5905a0[_0x1573('0x19')](_0x10e24e)[_0x1573('0x1a')]();};}function respondWithResult(_0x56eff9,_0x5246a6){_0x5246a6=_0x5246a6||0xc8;return function(_0x47834a){if(_0x47834a){return _0x56eff9[_0x1573('0x19')](_0x5246a6)[_0x1573('0x1b')](_0x47834a);}};}function respondWithFilteredResult(_0x4e99ec,_0x5d8aa5){return function(_0x105dc2){if(_0x105dc2){var _0x21b2bc=typeof _0x5d8aa5[_0x1573('0x1c')]===_0x1573('0x1d')&&typeof _0x5d8aa5['limit']===_0x1573('0x1d');var _0x864b0b=_0x105dc2[_0x1573('0x1e')];var _0x2d5738=_0x21b2bc?0x0:_0x5d8aa5['offset'];var _0x59a5b8=_0x21b2bc?_0x105dc2[_0x1573('0x1e')]:_0x5d8aa5['offset']+_0x5d8aa5['limit'];var _0x56d7b1;if(_0x59a5b8>=_0x864b0b){_0x59a5b8=_0x864b0b;_0x56d7b1=0xc8;}else{_0x56d7b1=0xce;}_0x4e99ec[_0x1573('0x19')](_0x56d7b1);return _0x4e99ec['set'](_0x1573('0x1f'),_0x2d5738+'-'+_0x59a5b8+'/'+_0x864b0b)[_0x1573('0x1b')](_0x105dc2);}return null;};}function patchUpdates(_0x13e1fb){return function(_0x2b0097){try{jsonpatch[_0x1573('0x20')](_0x2b0097,_0x13e1fb,!![]);}catch(_0x388ecb){return BPromise[_0x1573('0x21')](_0x388ecb);}return _0x2b0097[_0x1573('0x22')]();};}function saveUpdates(_0x2ed76a,_0x1356c9){return function(_0xbce0eb){if(_0xbce0eb){return _0xbce0eb['update'](_0x2ed76a)['then'](function(_0x286e3e){return _0x286e3e;});}return null;};}function removeEntity(_0x2d55da,_0x2c1f7d){return function(_0x504a3f){if(_0x504a3f){return _0x504a3f[_0x1573('0x23')]()[_0x1573('0x24')](function(){_0x2d55da['status'](0xcc)[_0x1573('0x1a')]();});}};}function handleEntityNotFound(_0x377487,_0x4b8fd9){return function(_0x53767a){if(!_0x53767a){_0x377487[_0x1573('0x18')](0x194);}return _0x53767a;};}function handleError(_0x508aa4,_0x153a9f){_0x153a9f=_0x153a9f||0x1f4;return function(_0x4d496e){logger['error'](_0x4d496e[_0x1573('0x25')]);if(_0x4d496e[_0x1573('0x26')]){delete _0x4d496e[_0x1573('0x26')];}_0x508aa4['status'](_0x153a9f)['send'](_0x4d496e);};}exports[_0x1573('0x27')]=function(_0x5d8ec1,_0x1c6767){var _0x38ec6c={},_0xc91012={},_0x27035a={'count':0x0,'rows':[]};var _0x1f4832=_[_0x1573('0x28')](db[_0x1573('0x29')][_0x1573('0x2a')],function(_0xab6a0){return{'name':_0xab6a0[_0x1573('0x2b')],'type':_0xab6a0[_0x1573('0x2c')][_0x1573('0x2d')]};});_0xc91012[_0x1573('0x2e')]=_[_0x1573('0x28')](_0x1f4832,_0x1573('0x26'));_0xc91012['query']=_['keys'](_0x5d8ec1[_0x1573('0x2f')]);_0xc91012['filters']=_[_0x1573('0x30')](_0xc91012['model'],_0xc91012[_0x1573('0x2f')]);_0x38ec6c[_0x1573('0x31')]=_['intersection'](_0xc91012[_0x1573('0x2e')],qs['fields'](_0x5d8ec1[_0x1573('0x2f')][_0x1573('0x32')]));_0x38ec6c[_0x1573('0x31')]=_0x38ec6c[_0x1573('0x31')]['length']?_0x38ec6c[_0x1573('0x31')]:_0xc91012[_0x1573('0x2e')];if(!_0x5d8ec1[_0x1573('0x2f')]['hasOwnProperty'](_0x1573('0x33'))){_0x38ec6c[_0x1573('0x34')]=qs[_0x1573('0x34')](_0x5d8ec1[_0x1573('0x2f')][_0x1573('0x34')]);_0x38ec6c[_0x1573('0x1c')]=qs[_0x1573('0x1c')](_0x5d8ec1[_0x1573('0x2f')][_0x1573('0x1c')]);}_0x38ec6c[_0x1573('0x35')]=qs[_0x1573('0x36')](_0x5d8ec1[_0x1573('0x2f')]['sort']);_0x38ec6c[_0x1573('0x37')]=qs[_0x1573('0x38')](_['pick'](_0x5d8ec1[_0x1573('0x2f')],_0xc91012[_0x1573('0x38')]),_0x1f4832);if(_0x5d8ec1[_0x1573('0x2f')][_0x1573('0x39')]){_0x38ec6c[_0x1573('0x37')]=_[_0x1573('0x3a')](_0x38ec6c['where'],{'$or':_[_0x1573('0x28')](_0x1f4832,function(_0xe54a01){if(_0xe54a01['type']!=='VIRTUAL'){var _0x16f47f={};_0x16f47f[_0xe54a01[_0x1573('0x26')]]={'$like':'%'+_0x5d8ec1[_0x1573('0x2f')][_0x1573('0x39')]+'%'};return _0x16f47f;}})});}_0x38ec6c=_['merge']({},_0x38ec6c,_0x5d8ec1[_0x1573('0x3b')]);var _0x23d9de={'where':_0x38ec6c[_0x1573('0x37')]};return db[_0x1573('0x29')][_0x1573('0x1e')](_0x23d9de)[_0x1573('0x24')](function(_0x5f0885){_0x27035a[_0x1573('0x1e')]=_0x5f0885;if(_0x5d8ec1[_0x1573('0x2f')]['includeAll']){_0x38ec6c[_0x1573('0x3c')]=[{'all':!![]}];}return db[_0x1573('0x29')][_0x1573('0x3d')](_0x38ec6c);})[_0x1573('0x24')](function(_0x192bae){_0x27035a[_0x1573('0x3e')]=_0x192bae;return _0x27035a;})[_0x1573('0x24')](respondWithFilteredResult(_0x1c6767,_0x38ec6c))[_0x1573('0x3f')](handleError(_0x1c6767,null));};exports[_0x1573('0x40')]=function(_0x36ff02,_0x2ff8c2){var _0x48f75d={'raw':!![],'where':{'id':_0x36ff02['params']['id']}},_0x5698c3={};_0x5698c3[_0x1573('0x2e')]=_[_0x1573('0x41')](db['MailTransferReport']['rawAttributes']);_0x5698c3[_0x1573('0x2f')]=_[_0x1573('0x41')](_0x36ff02[_0x1573('0x2f')]);_0x5698c3[_0x1573('0x38')]=_[_0x1573('0x30')](_0x5698c3[_0x1573('0x2e')],_0x5698c3[_0x1573('0x2f')]);_0x48f75d[_0x1573('0x31')]=_[_0x1573('0x30')](_0x5698c3[_0x1573('0x2e')],qs[_0x1573('0x32')](_0x36ff02[_0x1573('0x2f')][_0x1573('0x32')]));_0x48f75d[_0x1573('0x31')]=_0x48f75d[_0x1573('0x31')][_0x1573('0x42')]?_0x48f75d[_0x1573('0x31')]:_0x5698c3[_0x1573('0x2e')];if(_0x36ff02[_0x1573('0x2f')][_0x1573('0x43')]){_0x48f75d[_0x1573('0x3c')]=[{'all':!![]}];}_0x48f75d=_[_0x1573('0x3a')]({},_0x48f75d,_0x36ff02['options']);return db[_0x1573('0x29')][_0x1573('0x44')](_0x48f75d)[_0x1573('0x24')](handleEntityNotFound(_0x2ff8c2,null))['then'](respondWithResult(_0x2ff8c2,null))[_0x1573('0x3f')](handleError(_0x2ff8c2,null));};exports[_0x1573('0x45')]=function(_0x80cee3,_0x6ae70){return db['MailTransferReport'][_0x1573('0x45')](_0x80cee3[_0x1573('0x46')],{})[_0x1573('0x24')](respondWithResult(_0x6ae70,0xc9))[_0x1573('0x3f')](handleError(_0x6ae70,null));};exports[_0x1573('0x47')]=function(_0x2591b7,_0x53b04f){if(_0x2591b7[_0x1573('0x46')]['id']){delete _0x2591b7[_0x1573('0x46')]['id'];}return db['MailTransferReport'][_0x1573('0x44')]({'where':{'id':_0x2591b7['params']['id']}})[_0x1573('0x24')](handleEntityNotFound(_0x53b04f,null))[_0x1573('0x24')](saveUpdates(_0x2591b7['body'],null))[_0x1573('0x24')](respondWithResult(_0x53b04f,null))[_0x1573('0x3f')](handleError(_0x53b04f,null));};exports[_0x1573('0x23')]=function(_0x4cb08b,_0xb356a7){return db[_0x1573('0x29')][_0x1573('0x44')]({'where':{'id':_0x4cb08b[_0x1573('0x48')]['id']}})[_0x1573('0x24')](handleEntityNotFound(_0xb356a7,null))[_0x1573('0x24')](removeEntity(_0xb356a7,null))[_0x1573('0x3f')](handleError(_0xb356a7,null));};exports['describe']=function(_0x42c886,_0x321974){return db[_0x1573('0x29')]['describe']()[_0x1573('0x24')](respondWithResult(_0x321974,null))[_0x1573('0x3f')](handleError(_0x321974,null));}; \ No newline at end of file +var _0x46a4=['model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','filters','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','key'];(function(_0x2a2370,_0x375a9b){var _0x1c94c1=function(_0x3b8891){while(--_0x3b8891){_0x2a2370['push'](_0x2a2370['shift']());}};_0x1c94c1(++_0x375a9b);}(_0x46a4,0x1d9));var _0x446a=function(_0x7e9efa,_0x2c8ae2){_0x7e9efa=_0x7e9efa-0x0;var _0x1df16d=_0x46a4[_0x7e9efa];return _0x1df16d;};'use strict';var emlformat=require(_0x446a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x446a('0x1'));var jsonpatch=require(_0x446a('0x2'));var rp=require('request-promise');var moment=require(_0x446a('0x3'));var BPromise=require(_0x446a('0x4'));var Mustache=require(_0x446a('0x5'));var util=require(_0x446a('0x6'));var path=require(_0x446a('0x7'));var sox=require(_0x446a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x446a('0x9'));var _=require(_0x446a('0xa'));var squel=require(_0x446a('0xb'));var crypto=require('crypto');var jsforce=require(_0x446a('0xc'));var deskjs=require(_0x446a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x446a('0xe'));var Papa=require(_0x446a('0xf'));var Redis=require(_0x446a('0x10'));var authService=require(_0x446a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x446a('0x12'));var hardwareService=require(_0x446a('0x13'));var logger=require(_0x446a('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x446a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24d30b,_0x5a1be3){_0x5a1be3=_0x5a1be3||0xcc;return function(_0x47011c){if(_0x47011c){return _0x24d30b[_0x446a('0x16')](_0x5a1be3);}return _0x24d30b[_0x446a('0x17')](_0x5a1be3)[_0x446a('0x18')]();};}function respondWithResult(_0x3671a1,_0x3451e7){_0x3451e7=_0x3451e7||0xc8;return function(_0x1133b1){if(_0x1133b1){return _0x3671a1[_0x446a('0x17')](_0x3451e7)['json'](_0x1133b1);}};}function respondWithFilteredResult(_0xdbc179,_0x12de25){return function(_0x50a5f3){if(_0x50a5f3){var _0x36ca60=typeof _0x12de25[_0x446a('0x19')]===_0x446a('0x1a')&&typeof _0x12de25['limit']===_0x446a('0x1a');var _0x39c21d=_0x50a5f3[_0x446a('0x1b')];var _0x194701=_0x36ca60?0x0:_0x12de25[_0x446a('0x19')];var _0x3c0537=_0x36ca60?_0x50a5f3[_0x446a('0x1b')]:_0x12de25[_0x446a('0x19')]+_0x12de25[_0x446a('0x1c')];var _0x5cf517;if(_0x3c0537>=_0x39c21d){_0x3c0537=_0x39c21d;_0x5cf517=0xc8;}else{_0x5cf517=0xce;}_0xdbc179['status'](_0x5cf517);return _0xdbc179[_0x446a('0x1d')](_0x446a('0x1e'),_0x194701+'-'+_0x3c0537+'/'+_0x39c21d)[_0x446a('0x1f')](_0x50a5f3);}return null;};}function patchUpdates(_0x679b17){return function(_0xf7906a){try{jsonpatch[_0x446a('0x20')](_0xf7906a,_0x679b17,!![]);}catch(_0x13e8c6){return BPromise[_0x446a('0x21')](_0x13e8c6);}return _0xf7906a['save']();};}function saveUpdates(_0x4911e7,_0x150f71){return function(_0x11a05e){if(_0x11a05e){return _0x11a05e[_0x446a('0x22')](_0x4911e7)[_0x446a('0x23')](function(_0x18d124){return _0x18d124;});}return null;};}function removeEntity(_0x30ed37,_0x542ebf){return function(_0x3ebe5b){if(_0x3ebe5b){return _0x3ebe5b[_0x446a('0x24')]()[_0x446a('0x23')](function(){_0x30ed37[_0x446a('0x17')](0xcc)[_0x446a('0x18')]();});}};}function handleEntityNotFound(_0x2cb983,_0x422f52){return function(_0x5d92d8){if(!_0x5d92d8){_0x2cb983[_0x446a('0x16')](0x194);}return _0x5d92d8;};}function handleError(_0x5e75eb,_0x516c7d){_0x516c7d=_0x516c7d||0x1f4;return function(_0x1ed9f8){logger[_0x446a('0x25')](_0x1ed9f8[_0x446a('0x26')]);if(_0x1ed9f8[_0x446a('0x27')]){delete _0x1ed9f8[_0x446a('0x27')];}_0x5e75eb[_0x446a('0x17')](_0x516c7d)[_0x446a('0x28')](_0x1ed9f8);};}exports[_0x446a('0x29')]=function(_0x38edf1,_0x1e0dd4){var _0x541627={},_0x56856f={},_0x4bbf8e={'count':0x0,'rows':[]};var _0x59465a=_[_0x446a('0x2a')](db[_0x446a('0x2b')]['rawAttributes'],function(_0x348d20){return{'name':_0x348d20['fieldName'],'type':_0x348d20['type'][_0x446a('0x2c')]};});_0x56856f[_0x446a('0x2d')]=_[_0x446a('0x2a')](_0x59465a,_0x446a('0x27'));_0x56856f[_0x446a('0x2e')]=_[_0x446a('0x2f')](_0x38edf1['query']);_0x56856f['filters']=_[_0x446a('0x30')](_0x56856f['model'],_0x56856f[_0x446a('0x2e')]);_0x541627['attributes']=_[_0x446a('0x30')](_0x56856f[_0x446a('0x2d')],qs[_0x446a('0x31')](_0x38edf1['query'][_0x446a('0x31')]));_0x541627[_0x446a('0x32')]=_0x541627[_0x446a('0x32')][_0x446a('0x33')]?_0x541627['attributes']:_0x56856f['model'];if(!_0x38edf1[_0x446a('0x2e')]['hasOwnProperty'](_0x446a('0x34'))){_0x541627[_0x446a('0x1c')]=qs[_0x446a('0x1c')](_0x38edf1['query']['limit']);_0x541627[_0x446a('0x19')]=qs[_0x446a('0x19')](_0x38edf1['query'][_0x446a('0x19')]);}_0x541627[_0x446a('0x35')]=qs['sort'](_0x38edf1[_0x446a('0x2e')][_0x446a('0x36')]);_0x541627['where']=qs['filters'](_[_0x446a('0x37')](_0x38edf1[_0x446a('0x2e')],_0x56856f['filters']),_0x59465a);if(_0x38edf1[_0x446a('0x2e')]['filter']){_0x541627[_0x446a('0x38')]=_[_0x446a('0x39')](_0x541627[_0x446a('0x38')],{'$or':_[_0x446a('0x2a')](_0x59465a,function(_0x539263){if(_0x539263[_0x446a('0x3a')]!==_0x446a('0x3b')){var _0x2c484e={};_0x2c484e[_0x539263[_0x446a('0x27')]]={'$like':'%'+_0x38edf1[_0x446a('0x2e')][_0x446a('0x3c')]+'%'};return _0x2c484e;}})});}_0x541627=_[_0x446a('0x39')]({},_0x541627,_0x38edf1[_0x446a('0x3d')]);var _0x295968={'where':_0x541627[_0x446a('0x38')]};return db[_0x446a('0x2b')]['count'](_0x295968)[_0x446a('0x23')](function(_0x4aa177){_0x4bbf8e['count']=_0x4aa177;if(_0x38edf1[_0x446a('0x2e')][_0x446a('0x3e')]){_0x541627[_0x446a('0x3f')]=[{'all':!![]}];}return db[_0x446a('0x2b')]['findAll'](_0x541627);})['then'](function(_0x134363){_0x4bbf8e[_0x446a('0x40')]=_0x134363;return _0x4bbf8e;})[_0x446a('0x23')](respondWithFilteredResult(_0x1e0dd4,_0x541627))['catch'](handleError(_0x1e0dd4,null));};exports[_0x446a('0x41')]=function(_0x2d8c99,_0x33d3d4){var _0x18080a={'raw':!![],'where':{'id':_0x2d8c99[_0x446a('0x42')]['id']}},_0x3481b5={};_0x3481b5[_0x446a('0x2d')]=_[_0x446a('0x2f')](db[_0x446a('0x2b')][_0x446a('0x43')]);_0x3481b5[_0x446a('0x2e')]=_[_0x446a('0x2f')](_0x2d8c99['query']);_0x3481b5[_0x446a('0x44')]=_[_0x446a('0x30')](_0x3481b5[_0x446a('0x2d')],_0x3481b5[_0x446a('0x2e')]);_0x18080a[_0x446a('0x32')]=_['intersection'](_0x3481b5['model'],qs[_0x446a('0x31')](_0x2d8c99[_0x446a('0x2e')][_0x446a('0x31')]));_0x18080a[_0x446a('0x32')]=_0x18080a[_0x446a('0x32')][_0x446a('0x33')]?_0x18080a['attributes']:_0x3481b5[_0x446a('0x2d')];if(_0x2d8c99['query'][_0x446a('0x3e')]){_0x18080a[_0x446a('0x3f')]=[{'all':!![]}];}_0x18080a=_['merge']({},_0x18080a,_0x2d8c99[_0x446a('0x3d')]);return db[_0x446a('0x2b')][_0x446a('0x45')](_0x18080a)[_0x446a('0x23')](handleEntityNotFound(_0x33d3d4,null))[_0x446a('0x23')](respondWithResult(_0x33d3d4,null))[_0x446a('0x46')](handleError(_0x33d3d4,null));};exports['create']=function(_0x2eb06f,_0x51393c){return db[_0x446a('0x2b')][_0x446a('0x47')](_0x2eb06f[_0x446a('0x48')],{})[_0x446a('0x23')](respondWithResult(_0x51393c,0xc9))[_0x446a('0x46')](handleError(_0x51393c,null));};exports[_0x446a('0x22')]=function(_0x39fca2,_0x50a40e){if(_0x39fca2['body']['id']){delete _0x39fca2[_0x446a('0x48')]['id'];}return db['MailTransferReport'][_0x446a('0x45')]({'where':{'id':_0x39fca2[_0x446a('0x42')]['id']}})[_0x446a('0x23')](handleEntityNotFound(_0x50a40e,null))[_0x446a('0x23')](saveUpdates(_0x39fca2[_0x446a('0x48')],null))[_0x446a('0x23')](respondWithResult(_0x50a40e,null))[_0x446a('0x46')](handleError(_0x50a40e,null));};exports[_0x446a('0x24')]=function(_0x5dd50e,_0x4b459a){return db[_0x446a('0x2b')]['find']({'where':{'id':_0x5dd50e[_0x446a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b459a,null))[_0x446a('0x23')](removeEntity(_0x4b459a,null))['catch'](handleError(_0x4b459a,null));};exports[_0x446a('0x49')]=function(_0x1080d6,_0x15c9c7){return db[_0x446a('0x2b')][_0x446a('0x49')]()[_0x446a('0x23')](respondWithResult(_0x15c9c7,null))[_0x446a('0x46')](handleError(_0x15c9c7,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index a7125c5..e53485e 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 _0x6753=['../../config/environment','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x6753,0xa1));var _0x3675=function(_0x2485b2,_0x550a58){_0x2485b2=_0x2485b2-0x0;var _0x50b36f=_0x6753[_0x2485b2];return _0x50b36f;};'use strict';var _=require(_0x3675('0x0'));var util=require(_0x3675('0x1'));var logger=require(_0x3675('0x2'))(_0x3675('0x3'));var moment=require('moment');var BPromise=require(_0x3675('0x4'));var rp=require(_0x3675('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3675('0x6'));var config=require(_0x3675('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x4e4e73,_0x396a35){return _0x4e4e73[_0x3675('0x8')](_0x3675('0x9'),attributes,{'tableName':_0x3675('0xa'),'paranoid':![],'indexes':[{'name':_0x3675('0xb'),'fields':[_0x3675('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e69=['MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x4098df,_0x155f52){var _0x21d017=function(_0xe660ef){while(--_0xe660ef){_0x4098df['push'](_0x4098df['shift']());}};_0x21d017(++_0x155f52);}(_0x1e69,0x85));var _0x91e6=function(_0x3e4ccf,_0x263017){_0x3e4ccf=_0x3e4ccf-0x0;var _0x25d931=_0x1e69[_0x3e4ccf];return _0x25d931;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var logger=require(_0x91e6('0x1'))(_0x91e6('0x2'));var moment=require(_0x91e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e6('0x4'));var rimraf=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var attributes=require(_0x91e6('0x7'));module[_0x91e6('0x8')]=function(_0x42fe90,_0x4091b8){return _0x42fe90[_0x91e6('0x9')](_0x91e6('0xa'),attributes,{'tableName':_0x91e6('0xb'),'paranoid':![],'indexes':[{'name':_0x91e6('0xc'),'fields':[_0x91e6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index a4f4125..b24f435 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 _0xa102=['rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a1448,_0x6e5dc2){var _0xea7f1b=function(_0x4d16a7){while(--_0x4d16a7){_0x3a1448['push'](_0x3a1448['shift']());}};_0xea7f1b(++_0x6e5dc2);}(_0xa102,0x130));var _0x2a10=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xa102[_0xd511d];return _0x3f148e;};'use strict';var _=require(_0x2a10('0x0'));var util=require(_0x2a10('0x1'));var moment=require('moment');var BPromise=require(_0x2a10('0x2'));var rs=require(_0x2a10('0x3'));var fs=require('fs');var Redis=require(_0x2a10('0x4'));var db=require(_0x2a10('0x5'))['db'];var utils=require(_0x2a10('0x6'));var logger=require(_0x2a10('0x7'))(_0x2a10('0x8'));var config=require(_0x2a10('0x9'));var jayson=require(_0x2a10('0xa'));var client=jayson[_0x2a10('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x523874,_0x39aaa2,_0x493b6b){return new BPromise(function(_0x3d0ba2,_0x499ec9){return client[_0x2a10('0xc')](_0x523874,_0x493b6b)[_0x2a10('0xd')](function(_0x3ada2f){logger[_0x2a10('0xe')](_0x2a10('0xf'),_0x39aaa2,_0x2a10('0x10'));logger[_0x2a10('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x39aaa2,_0x2a10('0x10'),JSON[_0x2a10('0x12')](_0x3ada2f));if(_0x3ada2f[_0x2a10('0x13')]){if(_0x3ada2f[_0x2a10('0x13')][_0x2a10('0x14')]===0x1f4){logger[_0x2a10('0x13')](_0x2a10('0xf'),_0x39aaa2,_0x3ada2f[_0x2a10('0x13')]['message']);return _0x499ec9(_0x3ada2f[_0x2a10('0x13')][_0x2a10('0x15')]);}logger[_0x2a10('0x13')](_0x2a10('0xf'),_0x39aaa2,_0x3ada2f['error'][_0x2a10('0x15')]);return _0x3d0ba2(_0x3ada2f[_0x2a10('0x13')][_0x2a10('0x15')]);}else{logger[_0x2a10('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x39aaa2,_0x2a10('0x10'));_0x3d0ba2(_0x3ada2f[_0x2a10('0x16')][_0x2a10('0x15')]);}})[_0x2a10('0x17')](function(_0x59b20b){logger[_0x2a10('0x13')](_0x2a10('0xf'),_0x39aaa2,_0x59b20b);_0x499ec9(_0x59b20b);});});} \ No newline at end of file +var _0x5f1e=['code','message','info','catch','lodash','util','bluebird','../../config/logger','rpc','jayson/promise','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x178fa2,_0x161ba8){var _0x205420=function(_0x285a97){while(--_0x285a97){_0x178fa2['push'](_0x178fa2['shift']());}};_0x205420(++_0x161ba8);}(_0x5f1e,0xf4));var _0xe5f1=function(_0x568eaa,_0x4b6646){_0x568eaa=_0x568eaa-0x0;var _0x113d64=_0x5f1e[_0x568eaa];return _0x113d64;};'use strict';var _=require(_0xe5f1('0x0'));var util=require(_0xe5f1('0x1'));var moment=require('moment');var BPromise=require(_0xe5f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe5f1('0x3'))(_0xe5f1('0x4'));var config=require('../../config/environment');var jayson=require(_0xe5f1('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10b5ab,_0x180c47,_0x1918bc){return new BPromise(function(_0x275128,_0x46ac60){return client[_0xe5f1('0x6')](_0x10b5ab,_0x1918bc)[_0xe5f1('0x7')](function(_0x33f3a3){logger['info'](_0xe5f1('0x8'),_0x180c47,_0xe5f1('0x9'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x180c47,_0xe5f1('0x9'),JSON[_0xe5f1('0xa')](_0x33f3a3));if(_0x33f3a3[_0xe5f1('0xb')]){if(_0x33f3a3['error'][_0xe5f1('0xc')]===0x1f4){logger[_0xe5f1('0xb')](_0xe5f1('0x8'),_0x180c47,_0x33f3a3[_0xe5f1('0xb')]['message']);return _0x46ac60(_0x33f3a3['error']['message']);}logger['error'](_0xe5f1('0x8'),_0x180c47,_0x33f3a3['error'][_0xe5f1('0xd')]);return _0x275128(_0x33f3a3[_0xe5f1('0xb')][_0xe5f1('0xd')]);}else{logger[_0xe5f1('0xe')](_0xe5f1('0x8'),_0x180c47,_0xe5f1('0x9'));_0x275128(_0x33f3a3['result']['message']);}})[_0xe5f1('0xf')](function(_0x3fe3c9){logger[_0xe5f1('0xb')](_0xe5f1('0x8'),_0x180c47,_0x3fe3c9);_0x46ac60(_0x3fe3c9);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b50920e..6c75b75 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 _0x3d9a=['show','post','create','put','update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d9a,0x182));var _0xa3d9=function(_0x31ea9d,_0xfef49f){_0x31ea9d=_0x31ea9d-0x0;var _0x149fa5=_0x3d9a[_0x31ea9d];return _0x149fa5;};'use strict';var multer=require(_0xa3d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa3d9('0x1'));var express=require(_0xa3d9('0x2'));var router=express[_0xa3d9('0x3')]();var fs_extra=require(_0xa3d9('0x4'));var auth=require(_0xa3d9('0x5'));var interaction=require(_0xa3d9('0x6'));var config=require(_0xa3d9('0x7'));var controller=require(_0xa3d9('0x8'));router[_0xa3d9('0x9')]('/',auth['isAuthenticated'](),controller[_0xa3d9('0xa')]);router[_0xa3d9('0x9')]('/describe',auth[_0xa3d9('0xb')](),controller[_0xa3d9('0xc')]);router[_0xa3d9('0x9')](_0xa3d9('0xd'),auth[_0xa3d9('0xb')](),controller[_0xa3d9('0xe')]);router[_0xa3d9('0xf')]('/',auth[_0xa3d9('0xb')](),controller[_0xa3d9('0x10')]);router[_0xa3d9('0x11')](_0xa3d9('0xd'),auth[_0xa3d9('0xb')](),controller[_0xa3d9('0x12')]);router[_0xa3d9('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb968=['get','isAuthenticated','index','/describe','describe','/:id','create','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','./memberReport.controller'];(function(_0x18dc1d,_0xe74faf){var _0x5adf2e=function(_0x5db71c){while(--_0x5db71c){_0x18dc1d['push'](_0x18dc1d['shift']());}};_0x5adf2e(++_0xe74faf);}(_0xb968,0x82));var _0x8b96=function(_0x99a98,_0x4163aa){_0x99a98=_0x99a98-0x0;var _0x1593dc=_0xb968[_0x99a98];return _0x1593dc;};'use strict';var multer=require(_0x8b96('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8b96('0x1'));var express=require('express');var router=express[_0x8b96('0x2')]();var fs_extra=require(_0x8b96('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8b96('0x4'));var config=require('../../config/environment');var controller=require(_0x8b96('0x5'));router[_0x8b96('0x6')]('/',auth[_0x8b96('0x7')](),controller[_0x8b96('0x8')]);router[_0x8b96('0x6')](_0x8b96('0x9'),auth[_0x8b96('0x7')](),controller[_0x8b96('0xa')]);router[_0x8b96('0x6')](_0x8b96('0xb'),auth[_0x8b96('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8b96('0xc')]);router['put'](_0x8b96('0xb'),auth[_0x8b96('0x7')](),controller[_0x8b96('0xd')]);router[_0x8b96('0xe')]('/:id',auth[_0x8b96('0x7')](),controller[_0x8b96('0xf')]);module[_0x8b96('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f854d14..9de2481 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 _0x70c8=['talk:[queue]','exports','STRING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70c8,0xa9));var _0x870c=function(_0x39b11e,_0x5f515d){_0x39b11e=_0x39b11e-0x0;var _0x565d50=_0x70c8[_0x39b11e];return _0x565d50;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x870c('0x0')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x870c('0x1')]},'interface':{'type':Sequelize[_0x870c('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x870c('0x2')]},'enterAt':{'type':Sequelize[_0x870c('0x3')]},'exitAt':{'type':Sequelize[_0x870c('0x3')],'set':function(_0x3e27fa){var _0x18c445=moment(_0x3e27fa);var _0x47752e=moment(this[_0x870c('0x4')](_0x870c('0x5')));var _0x1df099=_0x18c445[_0x870c('0x6')](_0x47752e,_0x870c('0x7'));this[_0x870c('0x8')]('exitAt',_0x3e27fa);this[_0x870c('0x8')](_0x870c('0x9'),_0x1df099>=0x0?_0x1df099:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x870c('0xa')},'data2':{'type':Sequelize[_0x870c('0x1')],'comment':_0x870c('0xb')},'data3':{'type':Sequelize[_0x870c('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x870c('0x1')],'comment':_0x870c('0xc')},'data5':{'type':Sequelize[_0x870c('0x1')],'comment':_0x870c('0xd')},'role':{'type':Sequelize[_0x870c('0x1')]},'internal':{'type':Sequelize[_0x870c('0x2')]},'uniqueid':{'type':Sequelize[_0x870c('0x1')]}}; \ No newline at end of file +var _0xff1a=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds'];(function(_0x47b79a,_0x1680c9){var _0x4be089=function(_0x15f496){while(--_0x15f496){_0x47b79a['push'](_0x47b79a['shift']());}};_0x4be089(++_0x1680c9);}(_0xff1a,0x7e));var _0xaff1=function(_0x44a411,_0x13df97){_0x44a411=_0x44a411-0x0;var _0x421796=_0xff1a[_0x44a411];return _0x421796;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaff1('0x0'));module['exports']={'channel':{'type':Sequelize[_0xaff1('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xaff1('0x2'),'comment':_0xaff1('0x3')},'duration':{'type':Sequelize[_0xaff1('0x4')]},'enterAt':{'type':Sequelize[_0xaff1('0x5')]},'exitAt':{'type':Sequelize[_0xaff1('0x5')],'set':function(_0x5b5ebc){var _0x382309=moment(_0x5b5ebc);var _0x4d52bf=moment(this[_0xaff1('0x6')](_0xaff1('0x7')));var _0x55052f=_0x382309[_0xaff1('0x8')](_0x4d52bf,_0xaff1('0x9'));this[_0xaff1('0xa')]('exitAt',_0x5b5ebc);this[_0xaff1('0xa')](_0xaff1('0xb'),_0x55052f>=0x0?_0x55052f:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xaff1('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0xaff1('0xd')},'data3':{'type':Sequelize[_0xaff1('0x1')],'comment':_0xaff1('0xe')},'data4':{'type':Sequelize[_0xaff1('0x1')],'comment':_0xaff1('0xf')},'data5':{'type':Sequelize[_0xaff1('0x1')],'comment':_0xaff1('0x10')},'role':{'type':Sequelize[_0xaff1('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xaff1('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f592ff5..338bd72 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x13cab7,_0x541a78){var _0x2ad137=function(_0x4a7e6b){while(--_0x4a7e6b){_0x13cab7['push'](_0x13cab7['shift']());}};_0x2ad137(++_0x541a78);}(_0x3e74,0x175));var _0x43e7=function(_0x5b064a,_0x130128){_0x5b064a=_0x5b064a-0x0;var _0x461042=_0x3e74[_0x5b064a];return _0x461042;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x34e8,0x12c));var _0x834e=function(_0x3824ab,_0x698334){_0x3824ab=_0x3824ab-0x0;var _0xa4cc86=_0x34e8[_0x3824ab];return _0xa4cc86;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index dd6ab52..dba138f 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 _0x1e06=['exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','request-promise','path','./memberReport.attributes'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0x1e06,0x1c9));var _0x61e0=function(_0x22a86a,_0x1a6a3c){_0x22a86a=_0x22a86a-0x0;var _0x29ab2c=_0x1e06[_0x22a86a];return _0x29ab2c;};'use strict';var _=require(_0x61e0('0x0'));var util=require(_0x61e0('0x1'));var logger=require(_0x61e0('0x2'))(_0x61e0('0x3'));var moment=require(_0x61e0('0x4'));var BPromise=require('bluebird');var rp=require(_0x61e0('0x5'));var fs=require('fs');var path=require(_0x61e0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x61e0('0x7'));module[_0x61e0('0x8')]=function(_0x5c27d4,_0x491ee5){return _0x5c27d4[_0x61e0('0x9')](_0x61e0('0xa'),attributes,{'tableName':_0x61e0('0xb'),'paranoid':![],'indexes':[{'name':_0x61e0('0xc'),'fields':[_0x61e0('0xd'),_0x61e0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1d3=['rimraf','../../config/environment','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xe1d3,0x159));var _0x3e1d=function(_0x3c1560,_0x47d6e9){_0x3c1560=_0x3c1560-0x0;var _0x3611e8=_0xe1d3[_0x3c1560];return _0x3611e8;};'use strict';var _=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var logger=require(_0x3e1d('0x2'))(_0x3e1d('0x3'));var moment=require(_0x3e1d('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e1d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e1d('0x6'));var config=require(_0x3e1d('0x7'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x4594cf,_0x44d676){return _0x4594cf[_0x3e1d('0x8')](_0x3e1d('0x9'),attributes,{'tableName':_0x3e1d('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x3e1d('0xb'),_0x3e1d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 416d429..17d9b09 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 _0x5e17=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MemberReport,\x20%s,\x20%s','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','../../mysqldb'];(function(_0xb4e111,_0x2f0c81){var _0xb661a8=function(_0x599dcb){while(--_0x599dcb){_0xb4e111['push'](_0xb4e111['shift']());}};_0xb661a8(++_0x2f0c81);}(_0x5e17,0x17a));var _0x75e1=function(_0x231cc5,_0x5bc97e){_0x231cc5=_0x231cc5-0x0;var _0x2c3702=_0x5e17[_0x231cc5];return _0x2c3702;};'use strict';var _=require(_0x75e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75e1('0x1'))['db'];var utils=require(_0x75e1('0x2'));var logger=require(_0x75e1('0x3'))(_0x75e1('0x4'));var config=require(_0x75e1('0x5'));var jayson=require(_0x75e1('0x6'));var client=jayson[_0x75e1('0x7')][_0x75e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb1af59,_0x36e724,_0x689ac3){return new BPromise(function(_0x1eecde,_0x23fab8){return client[_0x75e1('0x9')](_0xb1af59,_0x689ac3)[_0x75e1('0xa')](function(_0x57e230){logger[_0x75e1('0xb')]('MemberReport,\x20%s,\x20%s',_0x36e724,'request\x20sent');logger[_0x75e1('0xc')](_0x75e1('0xd'),_0x36e724,_0x75e1('0xe'),JSON[_0x75e1('0xf')](_0x57e230));if(_0x57e230[_0x75e1('0x10')]){if(_0x57e230[_0x75e1('0x10')][_0x75e1('0x11')]===0x1f4){logger[_0x75e1('0x10')]('MemberReport,\x20%s,\x20%s',_0x36e724,_0x57e230[_0x75e1('0x10')][_0x75e1('0x12')]);return _0x23fab8(_0x57e230[_0x75e1('0x10')]['message']);}logger[_0x75e1('0x10')](_0x75e1('0x13'),_0x36e724,_0x57e230[_0x75e1('0x10')][_0x75e1('0x12')]);return _0x1eecde(_0x57e230['error'][_0x75e1('0x12')]);}else{logger[_0x75e1('0xb')](_0x75e1('0x13'),_0x36e724,_0x75e1('0xe'));_0x1eecde(_0x57e230[_0x75e1('0x14')][_0x75e1('0x12')]);}})[_0x75e1('0x15')](function(_0x56c741){logger[_0x75e1('0x10')](_0x75e1('0x13'),_0x36e724,_0x56c741);_0x23fab8(_0x56c741);});});}exports[_0x75e1('0x16')]=function(_0x5ac788){var _0x12a4d9=this;return new Promise(function(_0x1168e0,_0x499a75){return db[_0x75e1('0x17')][_0x75e1('0x18')]({'raw':_0x5ac788[_0x75e1('0x19')]?_0x5ac788['options'][_0x75e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ac788[_0x75e1('0x19')]?_0x5ac788[_0x75e1('0x19')][_0x75e1('0x1b')]||null:null,'attributes':_0x5ac788[_0x75e1('0x19')]?_0x5ac788['options'][_0x75e1('0x1c')]||null:null,'limit':_0x5ac788['options']?_0x5ac788[_0x75e1('0x19')][_0x75e1('0x1d')]||null:null,'include':_0x5ac788[_0x75e1('0x19')]?_0x5ac788['options']['include']?_[_0x75e1('0x1e')](_0x5ac788[_0x75e1('0x19')][_0x75e1('0x1f')],function(_0x2a6547){return{'model':db[_0x2a6547[_0x75e1('0x20')]],'as':_0x2a6547['as'],'attributes':_0x2a6547[_0x75e1('0x1c')],'include':_0x2a6547[_0x75e1('0x1f')]?_['map'](_0x2a6547[_0x75e1('0x1f')],function(_0x23c9d0){return{'model':db[_0x23c9d0[_0x75e1('0x20')]],'as':_0x23c9d0['as'],'attributes':_0x23c9d0[_0x75e1('0x1c')],'include':_0x23c9d0[_0x75e1('0x1f')]?_[_0x75e1('0x1e')](_0x23c9d0[_0x75e1('0x1f')],function(_0x471624){return{'model':db[_0x471624[_0x75e1('0x20')]],'as':_0x471624['as'],'attributes':_0x471624['attributes']};}):[]};}):[]};}):[]:[]})[_0x75e1('0xa')](function(_0x262a55){logger[_0x75e1('0xb')]('GetMemberReport',_0x5ac788);logger[_0x75e1('0xc')]('GetMemberReport',_0x5ac788,JSON['stringify'](_0x262a55));_0x1168e0(_0x262a55);})[_0x75e1('0x15')](function(_0x39064b){logger[_0x75e1('0x10')](_0x75e1('0x16'),_0x39064b[_0x75e1('0x12')],_0x5ac788);_0x499a75(_0x12a4d9['error'](0x1f4,_0x39064b[_0x75e1('0x12')]));});});};exports[_0x75e1('0x21')]=function(_0x142530){var _0x5e30f1=this;return new Promise(function(_0x257a91,_0x4055f9){return db['MemberReport'][_0x75e1('0x22')](_0x142530[_0x75e1('0x23')],{'raw':_0x142530[_0x75e1('0x19')]?_0x142530[_0x75e1('0x19')][_0x75e1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x44bb90){logger[_0x75e1('0xb')]('CreateMemberReport',_0x142530);logger[_0x75e1('0xc')](_0x75e1('0x21'),_0x142530,JSON[_0x75e1('0xf')](_0x44bb90));_0x257a91(_0x44bb90);})[_0x75e1('0x15')](function(_0x340307){logger[_0x75e1('0x10')]('CreateMemberReport',_0x340307[_0x75e1('0x12')],_0x142530);_0x4055f9(_0x5e30f1['error'](0x1f4,_0x340307['message']));});});};exports[_0x75e1('0x24')]=function(_0x2eff8a){var _0xb5b393=this;return new Promise(function(_0x33229d,_0x3682e5){return db[_0x75e1('0x17')][_0x75e1('0x25')](_0x2eff8a[_0x75e1('0x23')],{'raw':_0x2eff8a[_0x75e1('0x19')]?_0x2eff8a[_0x75e1('0x19')][_0x75e1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eff8a[_0x75e1('0x19')]?_0x2eff8a[_0x75e1('0x19')]['where']||null:null,'attributes':_0x2eff8a[_0x75e1('0x19')]?_0x2eff8a[_0x75e1('0x19')][_0x75e1('0x1c')]||null:null,'limit':_0x2eff8a[_0x75e1('0x19')]?_0x2eff8a[_0x75e1('0x19')][_0x75e1('0x1d')]||null:null})['then'](function(_0x2cbdf1){logger[_0x75e1('0xb')](_0x75e1('0x24'),_0x2eff8a);logger[_0x75e1('0xc')](_0x75e1('0x24'),_0x2eff8a,JSON[_0x75e1('0xf')](_0x2cbdf1));_0x33229d(_0x2cbdf1);})['catch'](function(_0xd47d99){logger[_0x75e1('0x10')]('UpdateMemberReport',_0xd47d99[_0x75e1('0x12')],_0x2eff8a);_0x3682e5(_0xb5b393[_0x75e1('0x10')](0x1f4,_0xd47d99['message']));});});}; \ No newline at end of file +var _0xad78=['GetMemberReport','findAll','options','raw','limit','include','map','model','attributes','CreateMemberReport','MemberReport','create','body','debug','UpdateMemberReport','update','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x27fa72,_0x2aa603){var _0x5a9f57=function(_0x136c15){while(--_0x136c15){_0x27fa72['push'](_0x27fa72['shift']());}};_0x5a9f57(++_0x2aa603);}(_0xad78,0x149));var _0x8ad7=function(_0x314ddc,_0x33a202){_0x314ddc=_0x314ddc-0x0;var _0x4bff9d=_0xad78[_0x314ddc];return _0x4bff9d;};'use strict';var _=require(_0x8ad7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ad7('0x1'));var rs=require(_0x8ad7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ad7('0x3'))['db'];var utils=require(_0x8ad7('0x4'));var logger=require(_0x8ad7('0x5'))(_0x8ad7('0x6'));var config=require(_0x8ad7('0x7'));var jayson=require(_0x8ad7('0x8'));var client=jayson[_0x8ad7('0x9')][_0x8ad7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415e9c,_0x3daa2d,_0x49aeb1){return new BPromise(function(_0x4822d3,_0x336b3a){return client[_0x8ad7('0xb')](_0x415e9c,_0x49aeb1)[_0x8ad7('0xc')](function(_0x152b82){logger[_0x8ad7('0xd')](_0x8ad7('0xe'),_0x3daa2d,_0x8ad7('0xf'));logger['debug'](_0x8ad7('0x10'),_0x3daa2d,_0x8ad7('0xf'),JSON[_0x8ad7('0x11')](_0x152b82));if(_0x152b82['error']){if(_0x152b82[_0x8ad7('0x12')][_0x8ad7('0x13')]===0x1f4){logger[_0x8ad7('0x12')](_0x8ad7('0xe'),_0x3daa2d,_0x152b82[_0x8ad7('0x12')][_0x8ad7('0x14')]);return _0x336b3a(_0x152b82[_0x8ad7('0x12')][_0x8ad7('0x14')]);}logger[_0x8ad7('0x12')](_0x8ad7('0xe'),_0x3daa2d,_0x152b82[_0x8ad7('0x12')]['message']);return _0x4822d3(_0x152b82['error'][_0x8ad7('0x14')]);}else{logger['info'](_0x8ad7('0xe'),_0x3daa2d,_0x8ad7('0xf'));_0x4822d3(_0x152b82['result']['message']);}})[_0x8ad7('0x15')](function(_0x1607c9){logger[_0x8ad7('0x12')](_0x8ad7('0xe'),_0x3daa2d,_0x1607c9);_0x336b3a(_0x1607c9);});});}exports[_0x8ad7('0x16')]=function(_0x2bccd7){var _0x937333=this;return new Promise(function(_0x4aaef9,_0x557642){return db['MemberReport'][_0x8ad7('0x17')]({'raw':_0x2bccd7['options']?_0x2bccd7[_0x8ad7('0x18')][_0x8ad7('0x19')]===undefined?!![]:![]:!![],'where':_0x2bccd7[_0x8ad7('0x18')]?_0x2bccd7['options']['where']||null:null,'attributes':_0x2bccd7['options']?_0x2bccd7[_0x8ad7('0x18')]['attributes']||null:null,'limit':_0x2bccd7['options']?_0x2bccd7[_0x8ad7('0x18')][_0x8ad7('0x1a')]||null:null,'include':_0x2bccd7[_0x8ad7('0x18')]?_0x2bccd7['options'][_0x8ad7('0x1b')]?_[_0x8ad7('0x1c')](_0x2bccd7[_0x8ad7('0x18')][_0x8ad7('0x1b')],function(_0xd580fd){return{'model':db[_0xd580fd[_0x8ad7('0x1d')]],'as':_0xd580fd['as'],'attributes':_0xd580fd['attributes'],'include':_0xd580fd[_0x8ad7('0x1b')]?_[_0x8ad7('0x1c')](_0xd580fd['include'],function(_0xa79077){return{'model':db[_0xa79077[_0x8ad7('0x1d')]],'as':_0xa79077['as'],'attributes':_0xa79077[_0x8ad7('0x1e')],'include':_0xa79077[_0x8ad7('0x1b')]?_[_0x8ad7('0x1c')](_0xa79077[_0x8ad7('0x1b')],function(_0x1dbca4){return{'model':db[_0x1dbca4['model']],'as':_0x1dbca4['as'],'attributes':_0x1dbca4['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ad7('0xc')](function(_0x5253c0){logger[_0x8ad7('0xd')](_0x8ad7('0x16'),_0x2bccd7);logger['debug'](_0x8ad7('0x16'),_0x2bccd7,JSON[_0x8ad7('0x11')](_0x5253c0));_0x4aaef9(_0x5253c0);})[_0x8ad7('0x15')](function(_0x4f419f){logger[_0x8ad7('0x12')]('GetMemberReport',_0x4f419f['message'],_0x2bccd7);_0x557642(_0x937333['error'](0x1f4,_0x4f419f[_0x8ad7('0x14')]));});});};exports[_0x8ad7('0x1f')]=function(_0x123b6c){var _0x38f101=this;return new Promise(function(_0x3fd891,_0x234cda){return db[_0x8ad7('0x20')][_0x8ad7('0x21')](_0x123b6c[_0x8ad7('0x22')],{'raw':_0x123b6c[_0x8ad7('0x18')]?_0x123b6c['options'][_0x8ad7('0x19')]===undefined?!![]:![]:!![]})[_0x8ad7('0xc')](function(_0x10ff0e){logger['info'](_0x8ad7('0x1f'),_0x123b6c);logger[_0x8ad7('0x23')](_0x8ad7('0x1f'),_0x123b6c,JSON[_0x8ad7('0x11')](_0x10ff0e));_0x3fd891(_0x10ff0e);})[_0x8ad7('0x15')](function(_0x1531a2){logger['error'](_0x8ad7('0x1f'),_0x1531a2['message'],_0x123b6c);_0x234cda(_0x38f101[_0x8ad7('0x12')](0x1f4,_0x1531a2[_0x8ad7('0x14')]));});});};exports[_0x8ad7('0x24')]=function(_0x651189){var _0x4cdaaf=this;return new Promise(function(_0x48b089,_0x389115){return db[_0x8ad7('0x20')][_0x8ad7('0x25')](_0x651189['body'],{'raw':_0x651189[_0x8ad7('0x18')]?_0x651189[_0x8ad7('0x18')][_0x8ad7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x651189[_0x8ad7('0x18')]?_0x651189[_0x8ad7('0x18')][_0x8ad7('0x26')]||null:null,'attributes':_0x651189['options']?_0x651189[_0x8ad7('0x18')]['attributes']||null:null,'limit':_0x651189['options']?_0x651189[_0x8ad7('0x18')]['limit']||null:null})[_0x8ad7('0xc')](function(_0xd013ab){logger[_0x8ad7('0xd')]('UpdateMemberReport',_0x651189);logger[_0x8ad7('0x23')](_0x8ad7('0x24'),_0x651189,JSON[_0x8ad7('0x11')](_0xd013ab));_0x48b089(_0xd013ab);})[_0x8ad7('0x15')](function(_0x3115eb){logger[_0x8ad7('0x12')](_0x8ad7('0x24'),_0x3115eb['message'],_0x651189);_0x389115(_0x4cdaaf[_0x8ad7('0x12')](0x1f4,_0x3115eb[_0x8ad7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index a6cd93e..7e9f438 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 _0x7553=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x7553,0x1c3));var _0x3755=function(_0x33eca6,_0x891651){_0x33eca6=_0x33eca6-0x0;var _0x1ada39=_0x7553[_0x33eca6];return _0x1ada39;};'use strict';var multer=require(_0x3755('0x0'));var util=require(_0x3755('0x1'));var path=require('path');var timeout=require(_0x3755('0x2'));var express=require(_0x3755('0x3'));var router=express[_0x3755('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3755('0x5'));var interaction=require(_0x3755('0x6'));var config=require(_0x3755('0x7'));var controller=require(_0x3755('0x8'));router[_0x3755('0x9')]('/',controller['index']);module[_0x3755('0xa')]=router; \ No newline at end of file +var _0x703b=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x494659,_0x1b8e75){var _0x36a11d=function(_0x1b4e77){while(--_0x1b4e77){_0x494659['push'](_0x494659['shift']());}};_0x36a11d(++_0x1b8e75);}(_0x703b,0x1e2));var _0xb703=function(_0x5972a8,_0x12cc8a){_0x5972a8=_0x5972a8-0x0;var _0x4469b8=_0x703b[_0x5972a8];return _0x4469b8;};'use strict';var multer=require(_0xb703('0x0'));var util=require(_0xb703('0x1'));var path=require(_0xb703('0x2'));var timeout=require(_0xb703('0x3'));var express=require(_0xb703('0x4'));var router=express['Router']();var fs_extra=require(_0xb703('0x5'));var auth=require(_0xb703('0x6'));var interaction=require(_0xb703('0x7'));var config=require(_0xb703('0x8'));var controller=require(_0xb703('0x9'));router[_0xb703('0xa')]('/',controller[_0xb703('0xb')]);module[_0xb703('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 461f3ff..002f59a 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 _0x517d=['sequelize','exports'];(function(_0x197fe4,_0x31e2bc){var _0x4e68a1=function(_0xae0b9e){while(--_0xae0b9e){_0x197fe4['push'](_0x197fe4['shift']());}};_0x4e68a1(++_0x31e2bc);}(_0x517d,0x196));var _0xd517=function(_0x4b6990,_0x383876){_0x4b6990=_0x4b6990-0x0;var _0x2765c3=_0x517d[_0x4b6990];return _0x2765c3;};'use strict';var Sequelize=require(_0xd517('0x0'));module[_0xd517('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0x7c9d=['version','STRING'];(function(_0x3494b7,_0x138a6f){var _0xd739c7=function(_0x3c2106){while(--_0x3c2106){_0x3494b7['push'](_0x3494b7['shift']());}};_0xd739c7(++_0x138a6f);}(_0x7c9d,0x15f));var _0xd7c9=function(_0x215f4b,_0x365b4c){_0x215f4b=_0x215f4b-0x0;var _0x76f04=_0x7c9d[_0x215f4b];return _0x76f04;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xd7c9('0x0')],'unique':_0xd7c9('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 4be4cb9..d3685cf 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 _0x1156=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','sendStatus','error','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Migration','includeAll','include','findAll','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1156,0x181));var _0x6115=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1156[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x6115('0x0'));var rimraf=require(_0x6115('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6115('0x2'));var rp=require('request-promise');var moment=require(_0x6115('0x3'));var BPromise=require(_0x6115('0x4'));var Mustache=require('mustache');var util=require(_0x6115('0x5'));var path=require('path');var sox=require(_0x6115('0x6'));var csv=require(_0x6115('0x7'));var ejs=require(_0x6115('0x8'));var fs=require('fs');var fs_extra=require(_0x6115('0x9'));var _=require(_0x6115('0xa'));var squel=require(_0x6115('0xb'));var crypto=require(_0x6115('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6115('0xd'));var toCsv=require(_0x6115('0x7'));var querystring=require(_0x6115('0xe'));var Papa=require(_0x6115('0xf'));var Redis=require(_0x6115('0x10'));var authService=require(_0x6115('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6115('0x12'));var hardwareService=require(_0x6115('0x13'));var logger=require('../../config/logger')(_0x6115('0x14'));var utils=require(_0x6115('0x15'));var config=require(_0x6115('0x16'));var licenseUtil=require(_0x6115('0x17'));var db=require(_0x6115('0x18'))['db'];function respondWithStatusCode(_0x2a1034,_0xf274e7){_0xf274e7=_0xf274e7||0xcc;return function(_0x2ac742){if(_0x2ac742){return _0x2a1034['sendStatus'](_0xf274e7);}return _0x2a1034['status'](_0xf274e7)[_0x6115('0x19')]();};}function respondWithResult(_0x5e95af,_0x4b98db){_0x4b98db=_0x4b98db||0xc8;return function(_0x4abb46){if(_0x4abb46){return _0x5e95af[_0x6115('0x1a')](_0x4b98db)[_0x6115('0x1b')](_0x4abb46);}};}function respondWithFilteredResult(_0x9b9b01,_0x585edc){return function(_0x26b237){if(_0x26b237){var _0x878f6=typeof _0x585edc[_0x6115('0x1c')]===_0x6115('0x1d')&&typeof _0x585edc[_0x6115('0x1e')]==='undefined';var _0x5e4400=_0x26b237[_0x6115('0x1f')];var _0x50d768=_0x878f6?0x0:_0x585edc[_0x6115('0x1c')];var _0x4624b6=_0x878f6?_0x26b237['count']:_0x585edc[_0x6115('0x1c')]+_0x585edc[_0x6115('0x1e')];var _0x1581cd;if(_0x4624b6>=_0x5e4400){_0x4624b6=_0x5e4400;_0x1581cd=0xc8;}else{_0x1581cd=0xce;}_0x9b9b01[_0x6115('0x1a')](_0x1581cd);return _0x9b9b01[_0x6115('0x20')](_0x6115('0x21'),_0x50d768+'-'+_0x4624b6+'/'+_0x5e4400)[_0x6115('0x1b')](_0x26b237);}return null;};}function patchUpdates(_0x1e8869){return function(_0x4b1fa4){try{jsonpatch[_0x6115('0x22')](_0x4b1fa4,_0x1e8869,!![]);}catch(_0x2e9c15){return BPromise['reject'](_0x2e9c15);}return _0x4b1fa4['save']();};}function saveUpdates(_0x44e968,_0x4a654f){return function(_0x129db5){if(_0x129db5){return _0x129db5[_0x6115('0x23')](_0x44e968)[_0x6115('0x24')](function(_0x35da55){return _0x35da55;});}return null;};}function removeEntity(_0x34beed,_0x8080f){return function(_0xccecba){if(_0xccecba){return _0xccecba['destroy']()[_0x6115('0x24')](function(){_0x34beed[_0x6115('0x1a')](0xcc)[_0x6115('0x19')]();});}};}function handleEntityNotFound(_0x44658e,_0x36f681){return function(_0x506ec3){if(!_0x506ec3){_0x44658e[_0x6115('0x25')](0x194);}return _0x506ec3;};}function handleError(_0x348a55,_0x3f361b){_0x3f361b=_0x3f361b||0x1f4;return function(_0x4a9c29){logger[_0x6115('0x26')](_0x4a9c29['stack']);if(_0x4a9c29[_0x6115('0x27')]){delete _0x4a9c29[_0x6115('0x27')];}_0x348a55[_0x6115('0x1a')](_0x3f361b)['send'](_0x4a9c29);};}exports[_0x6115('0x28')]=function(_0x31611c,_0x1b95c3){var _0x498464={},_0x3670b9={},_0x3e825f={'count':0x0,'rows':[]};var _0x14422d=_[_0x6115('0x29')](db['Migration']['rawAttributes'],function(_0x1ad1cf){return{'name':_0x1ad1cf[_0x6115('0x2a')],'type':_0x1ad1cf[_0x6115('0x2b')][_0x6115('0x2c')]};});_0x3670b9[_0x6115('0x2d')]=_[_0x6115('0x29')](_0x14422d,_0x6115('0x27'));_0x3670b9[_0x6115('0x2e')]=_[_0x6115('0x2f')](_0x31611c['query']);_0x3670b9[_0x6115('0x30')]=_[_0x6115('0x31')](_0x3670b9['model'],_0x3670b9[_0x6115('0x2e')]);_0x498464[_0x6115('0x32')]=_[_0x6115('0x31')](_0x3670b9[_0x6115('0x2d')],qs[_0x6115('0x33')](_0x31611c[_0x6115('0x2e')][_0x6115('0x33')]));_0x498464['attributes']=_0x498464[_0x6115('0x32')]['length']?_0x498464[_0x6115('0x32')]:_0x3670b9[_0x6115('0x2d')];if(!_0x31611c[_0x6115('0x2e')]['hasOwnProperty'](_0x6115('0x34'))){_0x498464[_0x6115('0x1e')]=qs[_0x6115('0x1e')](_0x31611c[_0x6115('0x2e')][_0x6115('0x1e')]);_0x498464[_0x6115('0x1c')]=qs['offset'](_0x31611c['query']['offset']);}_0x498464[_0x6115('0x35')]=qs[_0x6115('0x36')](_0x31611c['query'][_0x6115('0x36')]);_0x498464['where']=qs[_0x6115('0x30')](_[_0x6115('0x37')](_0x31611c['query'],_0x3670b9[_0x6115('0x30')]),_0x14422d);if(_0x31611c[_0x6115('0x2e')][_0x6115('0x38')]){_0x498464[_0x6115('0x39')]=_[_0x6115('0x3a')](_0x498464[_0x6115('0x39')],{'$or':_[_0x6115('0x29')](_0x14422d,function(_0xc5bed){if(_0xc5bed[_0x6115('0x2b')]!==_0x6115('0x3b')){var _0x296d76={};_0x296d76[_0xc5bed[_0x6115('0x27')]]={'$like':'%'+_0x31611c[_0x6115('0x2e')][_0x6115('0x38')]+'%'};return _0x296d76;}})});}_0x498464=_['merge']({},_0x498464,_0x31611c[_0x6115('0x3c')]);var _0x2412ab={'where':_0x498464[_0x6115('0x39')]};return db[_0x6115('0x3d')]['count'](_0x2412ab)['then'](function(_0xb3b242){_0x3e825f[_0x6115('0x1f')]=_0xb3b242;if(_0x31611c[_0x6115('0x2e')][_0x6115('0x3e')]){_0x498464[_0x6115('0x3f')]=[{'all':!![]}];}return db[_0x6115('0x3d')][_0x6115('0x40')](_0x498464);})[_0x6115('0x24')](function(_0x269625){_0x3e825f['rows']=_0x269625;return _0x3e825f;})[_0x6115('0x24')](respondWithFilteredResult(_0x1b95c3,_0x498464))[_0x6115('0x41')](handleError(_0x1b95c3,null));}; \ No newline at end of file +var _0x085d=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Migration','include','findAll','catch','eml-format','fast-json-patch','util','path','sox','to-csv'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x085d,0x84));var _0xd085=function(_0x40aaa4,_0x3b22f4){_0x40aaa4=_0x40aaa4-0x0;var _0x4e21e5=_0x085d[_0x40aaa4];return _0x4e21e5;};'use strict';var emlformat=require(_0xd085('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd085('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd085('0x2'));var path=require(_0xd085('0x3'));var sox=require(_0xd085('0x4'));var csv=require(_0xd085('0x5'));var ejs=require(_0xd085('0x6'));var fs=require('fs');var fs_extra=require(_0xd085('0x7'));var _=require(_0xd085('0x8'));var squel=require(_0xd085('0x9'));var crypto=require(_0xd085('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd085('0xb'));var toCsv=require(_0xd085('0x5'));var querystring=require(_0xd085('0xc'));var Papa=require(_0xd085('0xd'));var Redis=require(_0xd085('0xe'));var authService=require(_0xd085('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd085('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd085('0x11'));var config=require(_0xd085('0x12'));var licenseUtil=require(_0xd085('0x13'));var db=require(_0xd085('0x14'))['db'];function respondWithStatusCode(_0x49f9e9,_0x4d7eda){_0x4d7eda=_0x4d7eda||0xcc;return function(_0x323a7d){if(_0x323a7d){return _0x49f9e9[_0xd085('0x15')](_0x4d7eda);}return _0x49f9e9[_0xd085('0x16')](_0x4d7eda)['end']();};}function respondWithResult(_0x32c05c,_0x5e2e77){_0x5e2e77=_0x5e2e77||0xc8;return function(_0x32b6b9){if(_0x32b6b9){return _0x32c05c['status'](_0x5e2e77)[_0xd085('0x17')](_0x32b6b9);}};}function respondWithFilteredResult(_0x2a2fb9,_0x5d7ec3){return function(_0x57241f){if(_0x57241f){var _0x987b9c=typeof _0x5d7ec3[_0xd085('0x18')]===_0xd085('0x19')&&typeof _0x5d7ec3[_0xd085('0x1a')]===_0xd085('0x19');var _0x287eb4=_0x57241f[_0xd085('0x1b')];var _0x3a0102=_0x987b9c?0x0:_0x5d7ec3['offset'];var _0x4c4d04=_0x987b9c?_0x57241f[_0xd085('0x1b')]:_0x5d7ec3[_0xd085('0x18')]+_0x5d7ec3[_0xd085('0x1a')];var _0x2fb041;if(_0x4c4d04>=_0x287eb4){_0x4c4d04=_0x287eb4;_0x2fb041=0xc8;}else{_0x2fb041=0xce;}_0x2a2fb9[_0xd085('0x16')](_0x2fb041);return _0x2a2fb9[_0xd085('0x1c')](_0xd085('0x1d'),_0x3a0102+'-'+_0x4c4d04+'/'+_0x287eb4)[_0xd085('0x17')](_0x57241f);}return null;};}function patchUpdates(_0x227787){return function(_0xcdaa00){try{jsonpatch[_0xd085('0x1e')](_0xcdaa00,_0x227787,!![]);}catch(_0x4d4af4){return BPromise[_0xd085('0x1f')](_0x4d4af4);}return _0xcdaa00[_0xd085('0x20')]();};}function saveUpdates(_0x14f6e0,_0x1002d9){return function(_0x4fd019){if(_0x4fd019){return _0x4fd019[_0xd085('0x21')](_0x14f6e0)[_0xd085('0x22')](function(_0x489ed8){return _0x489ed8;});}return null;};}function removeEntity(_0x3f88ef,_0xe6be2c){return function(_0x3775b7){if(_0x3775b7){return _0x3775b7[_0xd085('0x23')]()[_0xd085('0x22')](function(){_0x3f88ef[_0xd085('0x16')](0xcc)[_0xd085('0x24')]();});}};}function handleEntityNotFound(_0xd8a9f7,_0xbd4517){return function(_0x3d6fbb){if(!_0x3d6fbb){_0xd8a9f7['sendStatus'](0x194);}return _0x3d6fbb;};}function handleError(_0x3808af,_0x436121){_0x436121=_0x436121||0x1f4;return function(_0x391abb){logger[_0xd085('0x25')](_0x391abb[_0xd085('0x26')]);if(_0x391abb['name']){delete _0x391abb[_0xd085('0x27')];}_0x3808af['status'](_0x436121)[_0xd085('0x28')](_0x391abb);};}exports[_0xd085('0x29')]=function(_0x2b0a67,_0x22fb17){var _0x5582a0={},_0x5f53b4={},_0x5a8113={'count':0x0,'rows':[]};var _0x20810c=_[_0xd085('0x2a')](db['Migration'][_0xd085('0x2b')],function(_0x3bf2a1){return{'name':_0x3bf2a1[_0xd085('0x2c')],'type':_0x3bf2a1[_0xd085('0x2d')][_0xd085('0x2e')]};});_0x5f53b4[_0xd085('0x2f')]=_['map'](_0x20810c,_0xd085('0x27'));_0x5f53b4['query']=_[_0xd085('0x30')](_0x2b0a67['query']);_0x5f53b4['filters']=_['intersection'](_0x5f53b4[_0xd085('0x2f')],_0x5f53b4[_0xd085('0x31')]);_0x5582a0[_0xd085('0x32')]=_[_0xd085('0x33')](_0x5f53b4['model'],qs[_0xd085('0x34')](_0x2b0a67[_0xd085('0x31')]['fields']));_0x5582a0[_0xd085('0x32')]=_0x5582a0[_0xd085('0x32')][_0xd085('0x35')]?_0x5582a0[_0xd085('0x32')]:_0x5f53b4[_0xd085('0x2f')];if(!_0x2b0a67['query'][_0xd085('0x36')](_0xd085('0x37'))){_0x5582a0[_0xd085('0x1a')]=qs['limit'](_0x2b0a67[_0xd085('0x31')][_0xd085('0x1a')]);_0x5582a0['offset']=qs[_0xd085('0x18')](_0x2b0a67['query']['offset']);}_0x5582a0[_0xd085('0x38')]=qs[_0xd085('0x39')](_0x2b0a67[_0xd085('0x31')][_0xd085('0x39')]);_0x5582a0[_0xd085('0x3a')]=qs[_0xd085('0x3b')](_[_0xd085('0x3c')](_0x2b0a67['query'],_0x5f53b4['filters']),_0x20810c);if(_0x2b0a67[_0xd085('0x31')][_0xd085('0x3d')]){_0x5582a0[_0xd085('0x3a')]=_[_0xd085('0x3e')](_0x5582a0[_0xd085('0x3a')],{'$or':_['map'](_0x20810c,function(_0x10e63a){if(_0x10e63a[_0xd085('0x2d')]!==_0xd085('0x3f')){var _0x4e5ddb={};_0x4e5ddb[_0x10e63a[_0xd085('0x27')]]={'$like':'%'+_0x2b0a67[_0xd085('0x31')][_0xd085('0x3d')]+'%'};return _0x4e5ddb;}})});}_0x5582a0=_[_0xd085('0x3e')]({},_0x5582a0,_0x2b0a67[_0xd085('0x40')]);var _0x2fb2fd={'where':_0x5582a0[_0xd085('0x3a')]};return db[_0xd085('0x41')][_0xd085('0x1b')](_0x2fb2fd)[_0xd085('0x22')](function(_0x5ecb09){_0x5a8113['count']=_0x5ecb09;if(_0x2b0a67[_0xd085('0x31')]['includeAll']){_0x5582a0[_0xd085('0x42')]=[{'all':!![]}];}return db[_0xd085('0x41')][_0xd085('0x43')](_0x5582a0);})['then'](function(_0x25e77b){_0x5a8113['rows']=_0x25e77b;return _0x5a8113;})[_0xd085('0x22')](respondWithFilteredResult(_0x22fb17,_0x5582a0))[_0xd085('0x44')](handleError(_0x22fb17,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ce926b7..3465ef1 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 _0x23b1=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','define','migrations'];(function(_0x5030d7,_0x2c5905){var _0x55e693=function(_0x422a59){while(--_0x422a59){_0x5030d7['push'](_0x5030d7['shift']());}};_0x55e693(++_0x2c5905);}(_0x23b1,0x7e));var _0x123b=function(_0x5cbba0,_0x4f455b){_0x5cbba0=_0x5cbba0-0x0;var _0xa3a9d5=_0x23b1[_0x5cbba0];return _0xa3a9d5;};'use strict';var _=require(_0x123b('0x0'));var util=require(_0x123b('0x1'));var logger=require(_0x123b('0x2'))(_0x123b('0x3'));var moment=require(_0x123b('0x4'));var BPromise=require(_0x123b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x123b('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x35c223,_0x4dd34c){return _0x35c223[_0x123b('0x7')]('Migration',attributes,{'tableName':_0x123b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeed4=['../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','moment','request-promise','path'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xeed4,0x1c2));var _0x4eed=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0xeed4[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x4eed('0x0'));var util=require(_0x4eed('0x1'));var logger=require('../../config/logger')(_0x4eed('0x2'));var moment=require(_0x4eed('0x3'));var BPromise=require('bluebird');var rp=require(_0x4eed('0x4'));var fs=require('fs');var path=require(_0x4eed('0x5'));var rimraf=require('rimraf');var config=require(_0x4eed('0x6'));var attributes=require(_0x4eed('0x7'));module[_0x4eed('0x8')]=function(_0xb05d28,_0x47aad6){return _0xb05d28[_0x4eed('0x9')](_0x4eed('0xa'),attributes,{'tableName':_0x4eed('0xb'),'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 1aee054..f9c6472 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 _0x502a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x502a,0xd8));var _0xa502=function(_0x162591,_0x512866){_0x162591=_0x162591-0x0;var _0x540d7f=_0x502a[_0x162591];return _0x540d7f;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var moment=require('moment');var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa502('0x4'));var logger=require('../../config/logger')(_0xa502('0x5'));var config=require(_0xa502('0x6'));var jayson=require(_0xa502('0x7'));var client=jayson[_0xa502('0x8')][_0xa502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489407,_0x329022,_0x29fb03){return new BPromise(function(_0x4d30f2,_0x4e4e5d){return client[_0xa502('0xa')](_0x489407,_0x29fb03)[_0xa502('0xb')](function(_0x5251fa){logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));logger['debug'](_0xa502('0xf'),_0x329022,_0xa502('0xe'),JSON[_0xa502('0x10')](_0x5251fa));if(_0x5251fa['error']){if(_0x5251fa[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error'](_0xa502('0xd'),_0x329022,_0x5251fa[_0xa502('0x11')]['message']);return _0x4e4e5d(_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')]('Migration,\x20%s,\x20%s',_0x329022,_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);return _0x4d30f2(_0x5251fa[_0xa502('0x11')]['message']);}else{logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));_0x4d30f2(_0x5251fa[_0xa502('0x14')][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x3107a0){logger[_0xa502('0x11')](_0xa502('0xd'),_0x329022,_0x3107a0);_0x4e4e5d(_0x3107a0);});});} \ No newline at end of file +var _0xf290=['message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf290,0xde));var _0x0f29=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xf290[_0x3cec8c];return _0x38032e;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('Migration,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index a0427b5..2a25002 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 _0x161c=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x12b83d,_0x4bcec7){var _0x1fd39d=function(_0x449185){while(--_0x449185){_0x12b83d['push'](_0x12b83d['shift']());}};_0x1fd39d(++_0x4bcec7);}(_0x161c,0xb7));var _0xc161=function(_0x37eca2,_0x5e5fc8){_0x37eca2=_0x37eca2-0x0;var _0x2e79f7=_0x161c[_0x37eca2];return _0x2e79f7;};'use strict';var multer=require('multer');var util=require(_0xc161('0x0'));var path=require('path');var timeout=require(_0xc161('0x1'));var express=require('express');var router=express[_0xc161('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc161('0x3'));var interaction=require(_0xc161('0x4'));var config=require(_0xc161('0x5'));var controller=require(_0xc161('0x6'));router[_0xc161('0x7')]('/',auth[_0xc161('0x8')](),controller[_0xc161('0x9')]);router[_0xc161('0x7')](_0xc161('0xa'),auth[_0xc161('0x8')](),controller[_0xc161('0xb')]);router[_0xc161('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc161('0xd')](_0xc161('0xa'),auth[_0xc161('0x8')](),controller['update']);router[_0xc161('0xe')](_0xc161('0xa'),auth['isAuthenticated'](),controller[_0xc161('0xf')]);module[_0xc161('0x10')]=router; \ No newline at end of file +var _0xb091=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./network.controller','isAuthenticated','index','get','show','post','create','put'];(function(_0x2b81db,_0xe9c3cb){var _0x1e0f1d=function(_0x63f3b2){while(--_0x63f3b2){_0x2b81db['push'](_0x2b81db['shift']());}};_0x1e0f1d(++_0xe9c3cb);}(_0xb091,0x16e));var _0x1b09=function(_0x2629ef,_0x2b1fa2){_0x2629ef=_0x2629ef-0x0;var _0x31d034=_0xb091[_0x2629ef];return _0x31d034;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var fs_extra=require(_0x1b09('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b09('0x5'));var controller=require(_0x1b09('0x6'));router['get']('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x8')]);router[_0x1b09('0x9')]('/:id',auth[_0x1b09('0x7')](),controller[_0x1b09('0xa')]);router[_0x1b09('0xb')]('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0xc')]);router[_0x1b09('0xd')](_0x1b09('0xe'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xf')]);router[_0x1b09('0x10')](_0x1b09('0xe'),auth['isAuthenticated'](),controller[_0x1b09('0x11')]);module[_0x1b09('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 317f479..bc4e5af 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 _0xa779=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x35d7c5,_0x5e5e22){var _0x9cabb5=function(_0x43311f){while(--_0x43311f){_0x35d7c5['push'](_0x35d7c5['shift']());}};_0x9cabb5(++_0x5e5e22);}(_0xa779,0x117));var _0x9a77=function(_0x3def2f,_0x23a8c3){_0x3def2f=_0x3def2f-0x0;var _0x738987=_0xa779[_0x3def2f];return _0x738987;};'use strict';var Sequelize=require(_0x9a77('0x0'));module[_0x9a77('0x1')]={'type':{'type':Sequelize[_0x9a77('0x2')](_0x9a77('0x3'),_0x9a77('0x4'),_0x9a77('0x5'),'turn')},'value':{'type':Sequelize[_0x9a77('0x6')]},'username':{'type':Sequelize[_0x9a77('0x6')]},'password':{'type':Sequelize[_0x9a77('0x6')]}}; \ No newline at end of file +var _0xb13d=['externip','stun','STRING','exports','ENUM','localnet'];(function(_0xb0b922,_0x183826){var _0x5dc41e=function(_0x461183){while(--_0x461183){_0xb0b922['push'](_0xb0b922['shift']());}};_0x5dc41e(++_0x183826);}(_0xb13d,0x1b3));var _0xdb13=function(_0x1a11aa,_0x5cdd4e){_0x1a11aa=_0x1a11aa-0x0;var _0x534709=_0xb13d[_0x1a11aa];return _0x534709;};'use strict';var Sequelize=require('sequelize');module[_0xdb13('0x0')]={'type':{'type':Sequelize[_0xdb13('0x1')](_0xdb13('0x2'),_0xdb13('0x3'),_0xdb13('0x4'),'turn')},'value':{'type':Sequelize[_0xdb13('0x5')]},'username':{'type':Sequelize[_0xdb13('0x5')]},'password':{'type':Sequelize[_0xdb13('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 67f92c6..a39b8d1 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 _0xc58d=['set','json','update','destroy','then','end','sendStatus','name','send','map','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','Network','include','catch','show','keys','length','find','body','findAll','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','params','chan_sip.so','path','lodash','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','code','error','message','offset','undefined','limit','count','status'];(function(_0x5addfd,_0x1f3e0a){var _0x2d6c02=function(_0x7a746b){while(--_0x7a746b){_0x5addfd['push'](_0x5addfd['shift']());}};_0x2d6c02(++_0x1f3e0a);}(_0xc58d,0x11f));var _0xdc58=function(_0x1acd4b,_0x430aa5){_0x1acd4b=_0x1acd4b-0x0;var _0x1f609d=_0xc58d[_0x1acd4b];return _0x1f609d;};'use strict';var util=require('util');var path=require(_0xdc58('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdc58('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xdc58('0x2')][_0xdc58('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x580e01,_0x300dab,_0x3ba91e,_0x1b6100){return new Promise(function(_0x7ea4e0,_0x13a769){var _0x59b3b3=_0x1b6100||client;return _0x59b3b3[_0xdc58('0x4')](_0x580e01,_0x3ba91e)['then'](function(_0x368570){logger[_0xdc58('0x5')](_0xdc58('0x6'),_0x300dab,_0xdc58('0x7'));logger[_0xdc58('0x8')]('Network,\x20%s,\x20%s,\x20%s',_0x300dab,_0xdc58('0x7'),JSON['stringify'](_0x368570));if(_0x368570['error']){if(_0x368570['error'][_0xdc58('0x9')]===0x1f4){logger[_0xdc58('0xa')]('Network,\x20%s,\x20%s',_0x300dab,_0x368570[_0xdc58('0xa')][_0xdc58('0xb')]);return _0x13a769(_0x368570[_0xdc58('0xa')]['message']);}logger['error'](_0xdc58('0x6'),_0x300dab,_0x368570['error'][_0xdc58('0xb')]);return _0x7ea4e0(_0x368570[_0xdc58('0xa')][_0xdc58('0xb')]);}else{logger[_0xdc58('0x5')](_0xdc58('0x6'),_0x300dab,_0xdc58('0x7'));_0x7ea4e0(_0x368570['result'][_0xdc58('0xb')]);}})['catch'](function(_0x2c19d7){logger['error'](_0xdc58('0x6'),_0x300dab,_0x2c19d7);_0x13a769(_0x2c19d7);});});}function respondWithResult(_0x318003,_0x26b31d){_0x26b31d=_0x26b31d||0xc8;return function(_0x434078){if(_0x434078){return _0x318003['status'](_0x26b31d)['json'](_0x434078);}};}function respondWithFilteredResult(_0x94aeff,_0x145a09){return function(_0x3fe76b){if(_0x3fe76b){var _0xbda388=typeof _0x145a09[_0xdc58('0xc')]===_0xdc58('0xd')&&typeof _0x145a09[_0xdc58('0xe')]===_0xdc58('0xd');var _0x394c78=_0x3fe76b[_0xdc58('0xf')];var _0x4a9b2d=_0xbda388?0x0:_0x145a09['offset'];var _0x563345=_0xbda388?_0x3fe76b[_0xdc58('0xf')]:_0x145a09[_0xdc58('0xc')]+_0x145a09[_0xdc58('0xe')];var _0x4c30de;if(_0x563345>=_0x394c78){_0x563345=_0x394c78;_0x4c30de=0xc8;}else{_0x4c30de=0xce;}_0x94aeff[_0xdc58('0x10')](_0x4c30de);return _0x94aeff[_0xdc58('0x11')]('Content-Range',_0x4a9b2d+'-'+_0x563345+'/'+_0x394c78)[_0xdc58('0x12')](_0x3fe76b);}return null;};}function saveUpdates(_0x683d7c){return function(_0x3ae9c4){if(_0x3ae9c4){return _0x3ae9c4[_0xdc58('0x13')](_0x683d7c)['then'](function(_0x14a0c2){return _0x14a0c2;});}return null;};}function removeEntity(_0x218a94){return function(_0x117fc7){if(_0x117fc7){return _0x117fc7[_0xdc58('0x14')]()[_0xdc58('0x15')](function(){_0x218a94[_0xdc58('0x10')](0xcc)[_0xdc58('0x16')]();});}};}function handleEntityNotFound(_0x19cc52){return function(_0x433d3e){if(!_0x433d3e){_0x19cc52[_0xdc58('0x17')](0x194);}return _0x433d3e;};}function handleError(_0x464cb9,_0x5137c8){_0x5137c8=_0x5137c8||0x1f4;return function(_0x7ae326){logger['error'](_0x7ae326['stack']);if(_0x7ae326[_0xdc58('0x18')]){delete _0x7ae326[_0xdc58('0x18')];}_0x464cb9[_0xdc58('0x10')](_0x5137c8)[_0xdc58('0x19')](_0x7ae326);};}exports['index']=function(_0x2417e6,_0x1638bf){var _0x27ccb0={},_0x348591={},_0x3895fe={'count':0x0,'rows':[]};var _0x39a0c1=_[_0xdc58('0x1a')](db['Network']['rawAttributes'],function(_0x4691a9){return{'name':_0x4691a9[_0xdc58('0x1b')],'type':_0x4691a9['type'][_0xdc58('0x1c')]};});_0x348591[_0xdc58('0x1d')]=_['map'](_0x39a0c1,_0xdc58('0x18'));_0x348591['query']=_['keys'](_0x2417e6[_0xdc58('0x1e')]);_0x348591[_0xdc58('0x1f')]=_['intersection'](_0x348591[_0xdc58('0x1d')],_0x348591[_0xdc58('0x1e')]);_0x27ccb0[_0xdc58('0x20')]=_[_0xdc58('0x21')](_0x348591['model'],qs['fields'](_0x2417e6[_0xdc58('0x1e')][_0xdc58('0x22')]));_0x27ccb0[_0xdc58('0x20')]=_0x27ccb0[_0xdc58('0x20')]['length']?_0x27ccb0['attributes']:_0x348591[_0xdc58('0x1d')];if(!_0x2417e6[_0xdc58('0x1e')][_0xdc58('0x23')](_0xdc58('0x24'))){_0x27ccb0[_0xdc58('0xe')]=qs[_0xdc58('0xe')](_0x2417e6['query'][_0xdc58('0xe')]);_0x27ccb0['offset']=qs[_0xdc58('0xc')](_0x2417e6[_0xdc58('0x1e')]['offset']);}_0x27ccb0[_0xdc58('0x25')]=qs['sort'](_0x2417e6[_0xdc58('0x1e')]['sort']);_0x27ccb0[_0xdc58('0x26')]=qs['filters'](_[_0xdc58('0x27')](_0x2417e6[_0xdc58('0x1e')],_0x348591[_0xdc58('0x1f')]),_0x39a0c1);if(_0x2417e6[_0xdc58('0x1e')]['filter']){_0x27ccb0[_0xdc58('0x26')]=_[_0xdc58('0x28')](_0x27ccb0['where'],{'$or':_[_0xdc58('0x1a')](_0x39a0c1,function(_0x14abfa){if(_0x14abfa[_0xdc58('0x29')]!==_0xdc58('0x2a')){var _0x2ff841={};_0x2ff841[_0x14abfa[_0xdc58('0x18')]]={'$like':'%'+_0x2417e6['query'][_0xdc58('0x2b')]+'%'};return _0x2ff841;}})});}_0x27ccb0=_[_0xdc58('0x28')]({},_0x27ccb0,_0x2417e6[_0xdc58('0x2c')]);var _0x3e6c63={'where':_0x27ccb0[_0xdc58('0x26')]};return db[_0xdc58('0x2d')][_0xdc58('0xf')](_0x3e6c63)['then'](function(_0x562190){_0x3895fe[_0xdc58('0xf')]=_0x562190;if(_0x2417e6[_0xdc58('0x1e')]['includeAll']){_0x27ccb0[_0xdc58('0x2e')]=[{'all':!![]}];}return db[_0xdc58('0x2d')]['findAll'](_0x27ccb0);})[_0xdc58('0x15')](function(_0x2ae70b){_0x3895fe['rows']=_0x2ae70b;return _0x3895fe;})[_0xdc58('0x15')](respondWithFilteredResult(_0x1638bf,_0x27ccb0))[_0xdc58('0x2f')](handleError(_0x1638bf,null));};exports[_0xdc58('0x30')]=function(_0x58f978,_0x4c5de3){var _0x3d8ad3={'raw':!![],'where':{'id':_0x58f978['params']['id']}},_0x4d3658={};_0x4d3658[_0xdc58('0x1d')]=_[_0xdc58('0x31')](db['Network']['rawAttributes']);_0x4d3658[_0xdc58('0x1e')]=_[_0xdc58('0x31')](_0x58f978['query']);_0x4d3658['filters']=_[_0xdc58('0x21')](_0x4d3658[_0xdc58('0x1d')],_0x4d3658['query']);_0x3d8ad3[_0xdc58('0x20')]=_[_0xdc58('0x21')](_0x4d3658['model'],qs[_0xdc58('0x22')](_0x58f978['query'][_0xdc58('0x22')]));_0x3d8ad3[_0xdc58('0x20')]=_0x3d8ad3[_0xdc58('0x20')][_0xdc58('0x32')]?_0x3d8ad3[_0xdc58('0x20')]:_0x4d3658[_0xdc58('0x1d')];if(_0x58f978[_0xdc58('0x1e')]['includeAll']){_0x3d8ad3[_0xdc58('0x2e')]=[{'all':!![]}];}_0x3d8ad3=_['merge']({},_0x3d8ad3,_0x58f978[_0xdc58('0x2c')]);return db['Network'][_0xdc58('0x33')](_0x3d8ad3)[_0xdc58('0x15')](handleEntityNotFound(_0x4c5de3,null))[_0xdc58('0x15')](respondWithResult(_0x4c5de3,null))[_0xdc58('0x2f')](handleError(_0x4c5de3,null));};exports['create']=function(_0x46d119,_0x493539){var _0x57d17c;return db['Network']['create'](_0x46d119[_0xdc58('0x34')],{'raw':!![]})[_0xdc58('0x15')](function(_0x3f1ac2){_0x57d17c=_0x3f1ac2;return db[_0xdc58('0x2d')][_0xdc58('0x35')]({'where':{'type':_0x46d119[_0xdc58('0x34')][_0xdc58('0x29')]},'raw':!![]});})[_0xdc58('0x15')](function(_0xc1c866){if(_0x57d17c[_0xdc58('0x29')][_0xdc58('0x36')]()==_0xdc58('0x37')){var _0x51e095=fs[_0xdc58('0x38')](path['join'](config[_0xdc58('0x39')],_0xdc58('0x3a')),_0xdc58('0x3b'));var _0x127edc=ejs['render'](_0x51e095,{'networks':_0xc1c866||[]});fs[_0xdc58('0x3c')](_0xdc58('0x3d'),_0x127edc);return respondWithRpcPromise(_0xdc58('0x3e'),_0xdc58('0x3f'),{'module':_0xdc58('0x40')});}else if(_0x57d17c[_0xdc58('0x29')]['toUpperCase']()==_0xdc58('0x41')){var _0x4202a3=fs[_0xdc58('0x38')](path[_0xdc58('0x42')](config[_0xdc58('0x39')],_0xdc58('0x43')),_0xdc58('0x3b'));var _0x353a78=ejs[_0xdc58('0x44')](_0x4202a3,{'networks':_0xc1c866||[]});fs['writeFileSync'](_0xdc58('0x45'),_0x353a78);return respondWithRpcPromise(_0xdc58('0x3e'),_0xdc58('0x3f'),{'module':_0xdc58('0x40')});}else{var _0x2375bc=fs[_0xdc58('0x38')](path[_0xdc58('0x42')](config[_0xdc58('0x39')],_0xdc58('0x46')),_0xdc58('0x3b'));var _0x12f26a=ejs[_0xdc58('0x44')](_0x2375bc,{'networks':_0xc1c866||[]});fs['writeFileSync'](util[_0xdc58('0x47')](_0xdc58('0x48'),_0x46d119['body']['type'][_0xdc58('0x49')]()),_0x12f26a);return respondWithRpcPromise(_0xdc58('0x3e'),_0xdc58('0x3f'),{'module':'chan_sip.so'});}})[_0xdc58('0x15')](function(){return _0x57d17c;})['then'](respondWithResult(_0x493539,0xc9))[_0xdc58('0x2f')](handleError(_0x493539,null));};exports[_0xdc58('0x13')]=function(_0x1a9a14,_0x37dddd){var _0x2c28fe;return db[_0xdc58('0x2d')][_0xdc58('0x33')]({'where':{'id':_0x1a9a14[_0xdc58('0x4a')]['id']}})[_0xdc58('0x15')](handleEntityNotFound(_0x37dddd,null))[_0xdc58('0x15')](saveUpdates(_0x1a9a14['body'],null))[_0xdc58('0x15')](function(_0x19c304){if(_0x19c304){_0x2c28fe=_0x19c304;return db[_0xdc58('0x2d')][_0xdc58('0x35')]({'where':{'type':_0x2c28fe[_0xdc58('0x29')]},'raw':!![]});}return null;})['then'](function(_0x2397af){if(_0x2c28fe['type']['toUpperCase']()==_0xdc58('0x37')){var _0x5ee4a1=fs['readFileSync'](path[_0xdc58('0x42')](config[_0xdc58('0x39')],'server/files/templates/stun_multiple.ejs'),_0xdc58('0x3b'));var _0x44f14c=ejs[_0xdc58('0x44')](_0x5ee4a1,{'networks':_0x2397af||[]});fs[_0xdc58('0x3c')](_0xdc58('0x3d'),_0x44f14c);return respondWithRpcPromise('Reload',_0xdc58('0x13'),{'module':_0xdc58('0x40')});}else if(_0x2c28fe[_0xdc58('0x29')][_0xdc58('0x36')]()==_0xdc58('0x41')){var _0xec499c=fs[_0xdc58('0x38')](path[_0xdc58('0x42')](config[_0xdc58('0x39')],_0xdc58('0x43')),_0xdc58('0x3b'));var _0x15445b=ejs[_0xdc58('0x44')](_0xec499c,{'networks':_0x2397af||[]});fs[_0xdc58('0x3c')](_0xdc58('0x45'),_0x15445b);return respondWithRpcPromise(_0xdc58('0x3e'),_0xdc58('0x13'),{'module':_0xdc58('0x40')});}else{var _0x60c104=fs['readFileSync'](path[_0xdc58('0x42')](config['root'],_0xdc58('0x46')),'utf8');var _0x272564=ejs['render'](_0x60c104,{'networks':_0x2397af||[]});fs[_0xdc58('0x3c')](util['format'](_0xdc58('0x48'),_0x1a9a14['body'][_0xdc58('0x29')][_0xdc58('0x49')]()),_0x272564);return respondWithRpcPromise(_0xdc58('0x3e'),'update',{'module':_0xdc58('0x4b')});}})[_0xdc58('0x15')](function(_0x903c78){if(_0x903c78){return _0x2c28fe;}return null;})[_0xdc58('0x15')](respondWithResult(_0x37dddd,null))[_0xdc58('0x2f')](handleError(_0x37dddd,null));};exports['destroy']=function(_0x262e9f,_0x31cb0a){var _0x1b9a99;return db[_0xdc58('0x2d')][_0xdc58('0x33')]({'where':{'id':_0x262e9f['params']['id']}})['then'](function(_0x23fff2){_0x1b9a99=_0x23fff2;return _0x23fff2;})[_0xdc58('0x15')](handleEntityNotFound(_0x31cb0a,null))[_0xdc58('0x15')](removeEntity(_0x31cb0a,null))[_0xdc58('0x15')](function(){if(_0x1b9a99){return db[_0xdc58('0x2d')]['findAll']({'where':{'type':_0x1b9a99[_0xdc58('0x29')]},'raw':!![]});}})[_0xdc58('0x15')](function(_0x3c4f62){if(_0x1b9a99[_0xdc58('0x29')][_0xdc58('0x36')]()==_0xdc58('0x37')){var _0x58bb47=fs[_0xdc58('0x38')](path[_0xdc58('0x42')](config[_0xdc58('0x39')],_0xdc58('0x3a')),_0xdc58('0x3b'));var _0x41fb35=ejs[_0xdc58('0x44')](_0x58bb47,{'networks':_0x3c4f62||[]});fs['writeFileSync'](_0xdc58('0x3d'),_0x41fb35);return respondWithRpcPromise(_0xdc58('0x3e'),_0xdc58('0x14'),{'module':_0xdc58('0x40')});}else if(_0x1b9a99[_0xdc58('0x29')][_0xdc58('0x36')]()==_0xdc58('0x41')){var _0x21f6ac=fs['readFileSync'](path[_0xdc58('0x42')](config[_0xdc58('0x39')],_0xdc58('0x43')),'utf8');var _0x46cc45=ejs[_0xdc58('0x44')](_0x21f6ac,{'networks':_0x3c4f62||[]});fs[_0xdc58('0x3c')]('/etc/asterisk/turn_xcally.conf',_0x46cc45);return respondWithRpcPromise(_0xdc58('0x3e'),'destroy',{'module':_0xdc58('0x40')});}else{var _0x232d87=fs[_0xdc58('0x38')](path['join'](config['root'],_0xdc58('0x46')),_0xdc58('0x3b'));var _0x212436=ejs[_0xdc58('0x44')](_0x232d87,{'networks':_0x3c4f62||[]});fs[_0xdc58('0x3c')](util['format'](_0xdc58('0x48'),_0x1b9a99[_0xdc58('0x29')][_0xdc58('0x49')]()),_0x212436);return respondWithRpcPromise(_0xdc58('0x3e'),_0xdc58('0x14'),{'module':_0xdc58('0x4b')});}})[_0xdc58('0x2f')](handleError(_0x31cb0a,null));}; \ No newline at end of file +var _0xa208=['writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','STUN','toLowerCase','chan_sip.so','path','ejs','lodash','../../config/logger','api','../../config/environment','../../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','info','result','catch','json','offset','undefined','count','limit','status','set','update','destroy','end','sendStatus','name','index','map','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Network','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render'];(function(_0x32b5da,_0x45d994){var _0x1304ab=function(_0x30b6e6){while(--_0x30b6e6){_0x32b5da['push'](_0x32b5da['shift']());}};_0x1304ab(++_0x45d994);}(_0xa208,0x112));var _0x8a20=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa208[_0x47e7cb];return _0x2a8874;};'use strict';var util=require('util');var path=require(_0x8a20('0x0'));var ejs=require(_0x8a20('0x1'));var fs=require('fs');var _=require(_0x8a20('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x8a20('0x3'))(_0x8a20('0x4'));var config=require(_0x8a20('0x5'));var db=require(_0x8a20('0x6'))['db'];var jayson=require(_0x8a20('0x7'));var client=jayson[_0x8a20('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8c15,_0x5ca863,_0x1e9f62,_0x37112c){return new Promise(function(_0x5826f6,_0x2d6f6b){var _0xcf0e38=_0x37112c||client;return _0xcf0e38[_0x8a20('0x9')](_0x1a8c15,_0x1e9f62)[_0x8a20('0xa')](function(_0x3ce62e){logger['info'](_0x8a20('0xb'),_0x5ca863,_0x8a20('0xc'));logger[_0x8a20('0xd')](_0x8a20('0xe'),_0x5ca863,_0x8a20('0xc'),JSON[_0x8a20('0xf')](_0x3ce62e));if(_0x3ce62e[_0x8a20('0x10')]){if(_0x3ce62e[_0x8a20('0x10')][_0x8a20('0x11')]===0x1f4){logger[_0x8a20('0x10')](_0x8a20('0xb'),_0x5ca863,_0x3ce62e[_0x8a20('0x10')][_0x8a20('0x12')]);return _0x2d6f6b(_0x3ce62e[_0x8a20('0x10')][_0x8a20('0x12')]);}logger[_0x8a20('0x10')](_0x8a20('0xb'),_0x5ca863,_0x3ce62e[_0x8a20('0x10')][_0x8a20('0x12')]);return _0x5826f6(_0x3ce62e[_0x8a20('0x10')][_0x8a20('0x12')]);}else{logger[_0x8a20('0x13')](_0x8a20('0xb'),_0x5ca863,'request\x20sent');_0x5826f6(_0x3ce62e[_0x8a20('0x14')]['message']);}})[_0x8a20('0x15')](function(_0x22250e){logger[_0x8a20('0x10')](_0x8a20('0xb'),_0x5ca863,_0x22250e);_0x2d6f6b(_0x22250e);});});}function respondWithResult(_0x45ccad,_0x5aeccf){_0x5aeccf=_0x5aeccf||0xc8;return function(_0x90be46){if(_0x90be46){return _0x45ccad['status'](_0x5aeccf)[_0x8a20('0x16')](_0x90be46);}};}function respondWithFilteredResult(_0x5e7887,_0x43fb4e){return function(_0x3ca9ed){if(_0x3ca9ed){var _0x3374f7=typeof _0x43fb4e[_0x8a20('0x17')]===_0x8a20('0x18')&&typeof _0x43fb4e['limit']==='undefined';var _0x2e2e15=_0x3ca9ed[_0x8a20('0x19')];var _0x425948=_0x3374f7?0x0:_0x43fb4e[_0x8a20('0x17')];var _0x138617=_0x3374f7?_0x3ca9ed[_0x8a20('0x19')]:_0x43fb4e[_0x8a20('0x17')]+_0x43fb4e[_0x8a20('0x1a')];var _0x362cc1;if(_0x138617>=_0x2e2e15){_0x138617=_0x2e2e15;_0x362cc1=0xc8;}else{_0x362cc1=0xce;}_0x5e7887[_0x8a20('0x1b')](_0x362cc1);return _0x5e7887[_0x8a20('0x1c')]('Content-Range',_0x425948+'-'+_0x138617+'/'+_0x2e2e15)[_0x8a20('0x16')](_0x3ca9ed);}return null;};}function saveUpdates(_0x5059be){return function(_0x56c2be){if(_0x56c2be){return _0x56c2be[_0x8a20('0x1d')](_0x5059be)[_0x8a20('0xa')](function(_0x37cc9e){return _0x37cc9e;});}return null;};}function removeEntity(_0x5d9ec6){return function(_0x52b103){if(_0x52b103){return _0x52b103[_0x8a20('0x1e')]()[_0x8a20('0xa')](function(){_0x5d9ec6[_0x8a20('0x1b')](0xcc)[_0x8a20('0x1f')]();});}};}function handleEntityNotFound(_0x15a590){return function(_0x5acb91){if(!_0x5acb91){_0x15a590[_0x8a20('0x20')](0x194);}return _0x5acb91;};}function handleError(_0x39d47f,_0x15b7a4){_0x15b7a4=_0x15b7a4||0x1f4;return function(_0x1e8170){logger['error'](_0x1e8170['stack']);if(_0x1e8170[_0x8a20('0x21')]){delete _0x1e8170[_0x8a20('0x21')];}_0x39d47f[_0x8a20('0x1b')](_0x15b7a4)['send'](_0x1e8170);};}exports[_0x8a20('0x22')]=function(_0x39ba53,_0x210766){var _0x30d1d7={},_0x588c24={},_0x28d32e={'count':0x0,'rows':[]};var _0xf2a919=_[_0x8a20('0x23')](db['Network']['rawAttributes'],function(_0x1ad8d){return{'name':_0x1ad8d[_0x8a20('0x24')],'type':_0x1ad8d[_0x8a20('0x25')][_0x8a20('0x26')]};});_0x588c24[_0x8a20('0x27')]=_[_0x8a20('0x23')](_0xf2a919,_0x8a20('0x21'));_0x588c24['query']=_[_0x8a20('0x28')](_0x39ba53['query']);_0x588c24[_0x8a20('0x29')]=_['intersection'](_0x588c24[_0x8a20('0x27')],_0x588c24[_0x8a20('0x2a')]);_0x30d1d7[_0x8a20('0x2b')]=_[_0x8a20('0x2c')](_0x588c24['model'],qs['fields'](_0x39ba53['query'][_0x8a20('0x2d')]));_0x30d1d7[_0x8a20('0x2b')]=_0x30d1d7['attributes'][_0x8a20('0x2e')]?_0x30d1d7['attributes']:_0x588c24[_0x8a20('0x27')];if(!_0x39ba53[_0x8a20('0x2a')][_0x8a20('0x2f')](_0x8a20('0x30'))){_0x30d1d7[_0x8a20('0x1a')]=qs[_0x8a20('0x1a')](_0x39ba53[_0x8a20('0x2a')][_0x8a20('0x1a')]);_0x30d1d7[_0x8a20('0x17')]=qs[_0x8a20('0x17')](_0x39ba53[_0x8a20('0x2a')][_0x8a20('0x17')]);}_0x30d1d7[_0x8a20('0x31')]=qs[_0x8a20('0x32')](_0x39ba53[_0x8a20('0x2a')][_0x8a20('0x32')]);_0x30d1d7[_0x8a20('0x33')]=qs[_0x8a20('0x29')](_[_0x8a20('0x34')](_0x39ba53['query'],_0x588c24[_0x8a20('0x29')]),_0xf2a919);if(_0x39ba53[_0x8a20('0x2a')][_0x8a20('0x35')]){_0x30d1d7[_0x8a20('0x33')]=_['merge'](_0x30d1d7[_0x8a20('0x33')],{'$or':_[_0x8a20('0x23')](_0xf2a919,function(_0x582364){if(_0x582364['type']!==_0x8a20('0x36')){var _0x38009d={};_0x38009d[_0x582364['name']]={'$like':'%'+_0x39ba53[_0x8a20('0x2a')]['filter']+'%'};return _0x38009d;}})});}_0x30d1d7=_[_0x8a20('0x37')]({},_0x30d1d7,_0x39ba53[_0x8a20('0x38')]);var _0x588c9d={'where':_0x30d1d7[_0x8a20('0x33')]};return db[_0x8a20('0x39')][_0x8a20('0x19')](_0x588c9d)[_0x8a20('0xa')](function(_0x396257){_0x28d32e[_0x8a20('0x19')]=_0x396257;if(_0x39ba53['query'][_0x8a20('0x3a')]){_0x30d1d7[_0x8a20('0x3b')]=[{'all':!![]}];}return db[_0x8a20('0x39')][_0x8a20('0x3c')](_0x30d1d7);})[_0x8a20('0xa')](function(_0x26acab){_0x28d32e[_0x8a20('0x3d')]=_0x26acab;return _0x28d32e;})[_0x8a20('0xa')](respondWithFilteredResult(_0x210766,_0x30d1d7))[_0x8a20('0x15')](handleError(_0x210766,null));};exports[_0x8a20('0x3e')]=function(_0x57e95f,_0x33af60){var _0x413e5a={'raw':!![],'where':{'id':_0x57e95f[_0x8a20('0x3f')]['id']}},_0x103bc5={};_0x103bc5['model']=_[_0x8a20('0x28')](db['Network'][_0x8a20('0x40')]);_0x103bc5[_0x8a20('0x2a')]=_[_0x8a20('0x28')](_0x57e95f[_0x8a20('0x2a')]);_0x103bc5[_0x8a20('0x29')]=_['intersection'](_0x103bc5[_0x8a20('0x27')],_0x103bc5[_0x8a20('0x2a')]);_0x413e5a['attributes']=_['intersection'](_0x103bc5[_0x8a20('0x27')],qs['fields'](_0x57e95f[_0x8a20('0x2a')]['fields']));_0x413e5a[_0x8a20('0x2b')]=_0x413e5a[_0x8a20('0x2b')][_0x8a20('0x2e')]?_0x413e5a[_0x8a20('0x2b')]:_0x103bc5[_0x8a20('0x27')];if(_0x57e95f[_0x8a20('0x2a')][_0x8a20('0x3a')]){_0x413e5a[_0x8a20('0x3b')]=[{'all':!![]}];}_0x413e5a=_[_0x8a20('0x37')]({},_0x413e5a,_0x57e95f[_0x8a20('0x38')]);return db[_0x8a20('0x39')][_0x8a20('0x41')](_0x413e5a)[_0x8a20('0xa')](handleEntityNotFound(_0x33af60,null))[_0x8a20('0xa')](respondWithResult(_0x33af60,null))[_0x8a20('0x15')](handleError(_0x33af60,null));};exports[_0x8a20('0x42')]=function(_0xd2b2e6,_0x121076){var _0x45dc82;return db[_0x8a20('0x39')][_0x8a20('0x42')](_0xd2b2e6[_0x8a20('0x43')],{'raw':!![]})[_0x8a20('0xa')](function(_0x3f35c1){_0x45dc82=_0x3f35c1;return db[_0x8a20('0x39')]['findAll']({'where':{'type':_0xd2b2e6[_0x8a20('0x43')]['type']},'raw':!![]});})[_0x8a20('0xa')](function(_0x33fe43){if(_0x45dc82[_0x8a20('0x25')][_0x8a20('0x44')]()=='STUN'){var _0x21b650=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config[_0x8a20('0x47')],_0x8a20('0x48')),'utf8');var _0x253c39=ejs[_0x8a20('0x49')](_0x21b650,{'networks':_0x33fe43||[]});fs[_0x8a20('0x4a')](_0x8a20('0x4b'),_0x253c39);return respondWithRpcPromise(_0x8a20('0x4c'),_0x8a20('0x42'),{'module':_0x8a20('0x4d')});}else if(_0x45dc82[_0x8a20('0x25')]['toUpperCase']()==_0x8a20('0x4e')){var _0x5650b9=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config['root'],_0x8a20('0x4f')),_0x8a20('0x50'));var _0x1e189d=ejs['render'](_0x5650b9,{'networks':_0x33fe43||[]});fs[_0x8a20('0x4a')](_0x8a20('0x51'),_0x1e189d);return respondWithRpcPromise(_0x8a20('0x4c'),_0x8a20('0x42'),{'module':_0x8a20('0x4d')});}else{var _0x54aafc=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config['root'],_0x8a20('0x52')),_0x8a20('0x50'));var _0x532c87=ejs[_0x8a20('0x49')](_0x54aafc,{'networks':_0x33fe43||[]});fs['writeFileSync'](util['format'](_0x8a20('0x53'),_0xd2b2e6['body']['type']['toLowerCase']()),_0x532c87);return respondWithRpcPromise('Reload',_0x8a20('0x42'),{'module':'chan_sip.so'});}})[_0x8a20('0xa')](function(){return _0x45dc82;})[_0x8a20('0xa')](respondWithResult(_0x121076,0xc9))[_0x8a20('0x15')](handleError(_0x121076,null));};exports[_0x8a20('0x1d')]=function(_0x496793,_0x3dc728){var _0x30d6a0;return db[_0x8a20('0x39')][_0x8a20('0x41')]({'where':{'id':_0x496793['params']['id']}})['then'](handleEntityNotFound(_0x3dc728,null))[_0x8a20('0xa')](saveUpdates(_0x496793['body'],null))[_0x8a20('0xa')](function(_0x5db9a3){if(_0x5db9a3){_0x30d6a0=_0x5db9a3;return db[_0x8a20('0x39')]['findAll']({'where':{'type':_0x30d6a0[_0x8a20('0x25')]},'raw':!![]});}return null;})[_0x8a20('0xa')](function(_0x26b415){if(_0x30d6a0[_0x8a20('0x25')][_0x8a20('0x44')]()==_0x8a20('0x54')){var _0xe94789=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config[_0x8a20('0x47')],'server/files/templates/stun_multiple.ejs'),_0x8a20('0x50'));var _0x230c7d=ejs['render'](_0xe94789,{'networks':_0x26b415||[]});fs[_0x8a20('0x4a')](_0x8a20('0x4b'),_0x230c7d);return respondWithRpcPromise(_0x8a20('0x4c'),'update',{'module':_0x8a20('0x4d')});}else if(_0x30d6a0[_0x8a20('0x25')][_0x8a20('0x44')]()=='TURN'){var _0x4aa83d=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config[_0x8a20('0x47')],_0x8a20('0x4f')),'utf8');var _0x5f2ba5=ejs['render'](_0x4aa83d,{'networks':_0x26b415||[]});fs['writeFileSync'](_0x8a20('0x51'),_0x5f2ba5);return respondWithRpcPromise(_0x8a20('0x4c'),_0x8a20('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x4e398d=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config[_0x8a20('0x47')],'server/files/templates/network.ejs'),_0x8a20('0x50'));var _0x258bd4=ejs[_0x8a20('0x49')](_0x4e398d,{'networks':_0x26b415||[]});fs[_0x8a20('0x4a')](util['format'](_0x8a20('0x53'),_0x496793[_0x8a20('0x43')][_0x8a20('0x25')][_0x8a20('0x55')]()),_0x258bd4);return respondWithRpcPromise('Reload','update',{'module':_0x8a20('0x56')});}})[_0x8a20('0xa')](function(_0x422891){if(_0x422891){return _0x30d6a0;}return null;})[_0x8a20('0xa')](respondWithResult(_0x3dc728,null))[_0x8a20('0x15')](handleError(_0x3dc728,null));};exports['destroy']=function(_0x3bc901,_0x386924){var _0x35d3b6;return db[_0x8a20('0x39')][_0x8a20('0x41')]({'where':{'id':_0x3bc901[_0x8a20('0x3f')]['id']}})['then'](function(_0x252966){_0x35d3b6=_0x252966;return _0x252966;})[_0x8a20('0xa')](handleEntityNotFound(_0x386924,null))[_0x8a20('0xa')](removeEntity(_0x386924,null))[_0x8a20('0xa')](function(){if(_0x35d3b6){return db['Network'][_0x8a20('0x3c')]({'where':{'type':_0x35d3b6[_0x8a20('0x25')]},'raw':!![]});}})[_0x8a20('0xa')](function(_0x1a37fb){if(_0x35d3b6[_0x8a20('0x25')]['toUpperCase']()==_0x8a20('0x54')){var _0x21e183=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config[_0x8a20('0x47')],_0x8a20('0x48')),'utf8');var _0x1c4fb1=ejs[_0x8a20('0x49')](_0x21e183,{'networks':_0x1a37fb||[]});fs[_0x8a20('0x4a')](_0x8a20('0x4b'),_0x1c4fb1);return respondWithRpcPromise(_0x8a20('0x4c'),_0x8a20('0x1e'),{'module':_0x8a20('0x4d')});}else if(_0x35d3b6['type'][_0x8a20('0x44')]()==_0x8a20('0x4e')){var _0x40e1fa=fs['readFileSync'](path[_0x8a20('0x46')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x8a20('0x50'));var _0x4f24c2=ejs[_0x8a20('0x49')](_0x40e1fa,{'networks':_0x1a37fb||[]});fs['writeFileSync'](_0x8a20('0x51'),_0x4f24c2);return respondWithRpcPromise('Reload',_0x8a20('0x1e'),{'module':_0x8a20('0x4d')});}else{var _0x19a1e5=fs[_0x8a20('0x45')](path[_0x8a20('0x46')](config['root'],_0x8a20('0x52')),_0x8a20('0x50'));var _0x40314c=ejs[_0x8a20('0x49')](_0x19a1e5,{'networks':_0x1a37fb||[]});fs[_0x8a20('0x4a')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x35d3b6[_0x8a20('0x25')][_0x8a20('0x55')]()),_0x40314c);return respondWithRpcPromise('Reload',_0x8a20('0x1e'),{'module':_0x8a20('0x56')});}})['catch'](handleError(_0x386924,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 0b7fcd9..fc40d75 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 _0x2547=['rimraf','./network.attributes','exports','Network','network','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4d52c8,_0x510e8b){var _0x44e6df=function(_0x28763f){while(--_0x28763f){_0x4d52c8['push'](_0x4d52c8['shift']());}};_0x44e6df(++_0x510e8b);}(_0x2547,0x1cd));var _0x7254=function(_0x3554b1,_0x4a2e0f){_0x3554b1=_0x3554b1-0x0;var _0x2711f9=_0x2547[_0x3554b1];return _0x2711f9;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff3=['network','util','api','bluebird','request-promise','path','rimraf','./network.attributes','exports','define'];(function(_0xb785b8,_0x78ae16){var _0x19626f=function(_0x3ca322){while(--_0x3ca322){_0xb785b8['push'](_0xb785b8['shift']());}};_0x19626f(++_0x78ae16);}(_0x5ff3,0x17d));var _0x35ff=function(_0x297900,_0x4a2683){_0x297900=_0x297900-0x0;var _0x3b88b3=_0x5ff3[_0x297900];return _0x3b88b3;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('Network',attributes,{'tableName':_0x35ff('0x9'),'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 98be25b..dfe753e 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x36b3ba,_0x3d6619){_0x36b3ba=_0x36b3ba-0x0;var _0x421c17=_0x7a54[_0x36b3ba];return _0x421c17;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4f661b,_0x4b32da){_0x4f661b=_0x4f661b-0x0;var _0x545670=_0x7a54[_0x4f661b];return _0x545670;};'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 8369c87..bf343ed 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 _0x3a6d=['getInteractions','/:id/users','post','create','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','removeDispositions','removeAnswers','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x3a6d,0x143));var _0xd3a6=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3a6d[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/describe',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0x9')](_0xd3a6('0xf'),auth[_0xd3a6('0xa')](),controller['getDispositions']);router[_0xd3a6('0x9')](_0xd3a6('0x10'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x11')]);router[_0xd3a6('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xd3a6('0x9')](_0xd3a6('0x12'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x13')]);router[_0xd3a6('0x9')](_0xd3a6('0x14'),auth[_0xd3a6('0xa')](),controller['getAgents']);router[_0xd3a6('0x15')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x16')]);router['post'](_0xd3a6('0xf'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x17')]);router['post'](_0xd3a6('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xd3a6('0x15')](_0xd3a6('0x18'),controller[_0xd3a6('0x19')]);router[_0xd3a6('0x15')](_0xd3a6('0x1a'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x1b')]);router['post'](_0xd3a6('0x14'),auth['isAuthenticated'](),controller[_0xd3a6('0x1c')]);router[_0xd3a6('0x15')](_0xd3a6('0x1d'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x1e')]);router[_0xd3a6('0x1f')]('/:id',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xd3a6('0xf'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x21')]);router['delete'](_0xd3a6('0x10'),auth['isAuthenticated'](),controller[_0xd3a6('0x22')]);router[_0xd3a6('0x23')](_0xd3a6('0x14'),auth['isAuthenticated'](),controller[_0xd3a6('0x24')]);module[_0xd3a6('0x25')]=router; \ No newline at end of file +var _0x7d25=['connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','create','post','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path'];(function(_0x11d488,_0xeca1c0){var _0x13a366=function(_0x145f1c){while(--_0x145f1c){_0x11d488['push'](_0x11d488['shift']());}};_0x13a366(++_0xeca1c0);}(_0x7d25,0x8a));var _0x57d2=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x7d25[_0x4e9d3c];return _0x2d0825;};'use strict';var multer=require('multer');var util=require(_0x57d2('0x0'));var path=require(_0x57d2('0x1'));var timeout=require(_0x57d2('0x2'));var express=require(_0x57d2('0x3'));var router=express[_0x57d2('0x4')]();var fs_extra=require(_0x57d2('0x5'));var auth=require(_0x57d2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x57d2('0x7')](),controller['index']);router[_0x57d2('0x8')](_0x57d2('0x9'),auth[_0x57d2('0x7')](),controller['describe']);router['get'](_0x57d2('0xa'),auth['isAuthenticated'](),controller[_0x57d2('0xb')]);router[_0x57d2('0x8')](_0x57d2('0xc'),auth['isAuthenticated'](),controller[_0x57d2('0xd')]);router[_0x57d2('0x8')](_0x57d2('0xe'),auth[_0x57d2('0x7')](),controller[_0x57d2('0xf')]);router[_0x57d2('0x8')](_0x57d2('0x10'),auth[_0x57d2('0x7')](),controller[_0x57d2('0x11')]);router[_0x57d2('0x8')](_0x57d2('0x12'),auth[_0x57d2('0x7')](),controller[_0x57d2('0x13')]);router[_0x57d2('0x8')](_0x57d2('0x14'),auth[_0x57d2('0x7')](),controller['getAgents']);router['post']('/',auth[_0x57d2('0x7')](),controller[_0x57d2('0x15')]);router['post'](_0x57d2('0xc'),auth[_0x57d2('0x7')](),controller['addDisposition']);router[_0x57d2('0x16')]('/:id/canned_answers',auth[_0x57d2('0x7')](),controller['addAnswer']);router[_0x57d2('0x16')](_0x57d2('0x17'),controller[_0x57d2('0x18')]);router['post']('/:id/applications',auth[_0x57d2('0x7')](),controller[_0x57d2('0x19')]);router[_0x57d2('0x16')](_0x57d2('0x14'),auth['isAuthenticated'](),controller[_0x57d2('0x1a')]);router[_0x57d2('0x16')]('/:id/send',auth['isAuthenticated'](),controller[_0x57d2('0x1b')]);router[_0x57d2('0x1c')](_0x57d2('0xa'),auth[_0x57d2('0x7')](),controller[_0x57d2('0x1d')]);router[_0x57d2('0x1e')](_0x57d2('0xa'),auth[_0x57d2('0x7')](),controller[_0x57d2('0x1f')]);router[_0x57d2('0x1e')](_0x57d2('0xc'),auth[_0x57d2('0x7')](),controller[_0x57d2('0x20')]);router[_0x57d2('0x1e')]('/:id/canned_answers',auth[_0x57d2('0x7')](),controller[_0x57d2('0x21')]);router[_0x57d2('0x1e')](_0x57d2('0x14'),auth[_0x57d2('0x7')](),controller['removeAgents']);module[_0x57d2('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 305fcdc..a4dde33 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 _0x4b72=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x220a90,_0x453891){var _0x28bf8d=function(_0xd1b677){while(--_0xd1b677){_0x220a90['push'](_0x220a90['shift']());}};_0x28bf8d(++_0x453891);}(_0x4b72,0xbc));var _0x24b7=function(_0x33f63e,_0x1c059d){_0x33f63e=_0x33f63e-0x0;var _0x539bcd=_0x4b72[_0x33f63e];return _0x539bcd;};'use strict';var Sequelize=require(_0x24b7('0x0'));var rs=require(_0x24b7('0x1'));module['exports']={'name':{'type':Sequelize[_0x24b7('0x2')],'unique':_0x24b7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x24b7('0x2')]},'token':{'type':Sequelize[_0x24b7('0x2')],'defaultValue':function(){return rs[_0x24b7('0x4')]();}},'replyUri':{'type':Sequelize[_0x24b7('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x24b7('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x24b7('0x5')],'defaultValue':function(){return _0x24b7('0x6');}},'notificationSound':{'type':Sequelize[_0x24b7('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x24b7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x24b7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x24b7('0x2')]},'queueTransfer':{'type':Sequelize[_0x24b7('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x24b7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x24b7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x24b7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x24b7('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x24b7('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x24b7('0x7')],'defaultValue':![],'comment':_0x24b7('0xa'),'set':function(_0x65300e){if(!_0x65300e)this[_0x24b7('0xb')]('mandatoryDispositionPauseId',null);this[_0x24b7('0xb')](_0x24b7('0xc'),_0x65300e);}}}; \ No newline at end of file +var _0xab6e=['name','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x5dc4b3,_0x618af){var _0x4c56e2=function(_0x28f0d3){while(--_0x28f0d3){_0x5dc4b3['push'](_0x5dc4b3['shift']());}};_0x4c56e2(++_0x618af);}(_0xab6e,0x189));var _0xeab6=function(_0xe59cff,_0x1a7dbe){_0xe59cff=_0xe59cff-0x0;var _0x26e8c1=_0xab6e[_0xe59cff];return _0x26e8c1;};'use strict';var Sequelize=require(_0xeab6('0x0'));var rs=require(_0xeab6('0x1'));module['exports']={'name':{'type':Sequelize[_0xeab6('0x2')],'unique':_0xeab6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xeab6('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xeab6('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xeab6('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xeab6('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xeab6('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeab6('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xeab6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xeab6('0x2')]},'queueTransfer':{'type':Sequelize[_0xeab6('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeab6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeab6('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xeab6('0x6')],'defaultValue':![],'comment':_0xeab6('0x8'),'set':function(_0xee1e8d){if(!_0xee1e8d)this[_0xeab6('0x9')](_0xeab6('0xa'),null);this[_0xeab6('0x9')](_0xeab6('0xb'),_0xee1e8d);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8693e9c..ba04563 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 _0x2f74=['intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','filters','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','body','find','params','describe','OpenchannelAccountId','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','OpenchannelApplication','account','applications','list','priority','asc','Applications','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','push','close','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','send','Contacts','user','out','dataValues','Messages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','OpenchannelAccounts','stack','name','Pause','OpenchannelAccount','rawAttributes','type','model','map','keys','query'];(function(_0x9a9d33,_0x3db629){var _0x1996fd=function(_0x448b53){while(--_0x448b53){_0x9a9d33['push'](_0x9a9d33['shift']());}};_0x1996fd(++_0x3db629);}(_0x2f74,0x7b));var _0x42f7=function(_0xb93836,_0x2e7941){_0xb93836=_0xb93836-0x0;var _0x2b3e5b=_0x2f74[_0xb93836];return _0x2b3e5b;};'use strict';var emlformat=require(_0x42f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x42f7('0x1'));var jsonpatch=require(_0x42f7('0x2'));var rp=require(_0x42f7('0x3'));var moment=require(_0x42f7('0x4'));var BPromise=require(_0x42f7('0x5'));var Mustache=require(_0x42f7('0x6'));var util=require(_0x42f7('0x7'));var path=require(_0x42f7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42f7('0x9'));var _=require(_0x42f7('0xa'));var squel=require(_0x42f7('0xb'));var crypto=require(_0x42f7('0xc'));var jsforce=require(_0x42f7('0xd'));var deskjs=require(_0x42f7('0xe'));var toCsv=require(_0x42f7('0xf'));var querystring=require(_0x42f7('0x10'));var Papa=require('papaparse');var Redis=require(_0x42f7('0x11'));var authService=require(_0x42f7('0x12'));var qs=require(_0x42f7('0x13'));var as=require(_0x42f7('0x14'));var hardwareService=require(_0x42f7('0x15'));var logger=require(_0x42f7('0x16'))('api');var utils=require(_0x42f7('0x17'));var config=require(_0x42f7('0x18'));var licenseUtil=require(_0x42f7('0x19'));var db=require(_0x42f7('0x1a'))['db'];config[_0x42f7('0x1b')]=_[_0x42f7('0x1c')](config[_0x42f7('0x1b')],{'host':_0x42f7('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x42f7('0x1e'))[_0x42f7('0x1f')](socket);var jayson=require(_0x42f7('0x20'));var client=jayson[_0x42f7('0x21')][_0x42f7('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x42f7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4d7944,_0x3e7fd8,_0x225a6b,_0x16d842){return new BPromise(function(_0x19eff3,_0x423876){var _0xa1bb54=_0x16d842||client;return _0xa1bb54[_0x42f7('0x23')](_0x4d7944,_0x225a6b)['then'](function(_0x3fc38d){logger[_0x42f7('0x24')](_0x42f7('0x25'),_0x3e7fd8,_0x42f7('0x26'));logger[_0x42f7('0x27')](_0x42f7('0x28'),_0x3e7fd8,'request\x20sent',JSON[_0x42f7('0x29')](_0x3fc38d));if(_0x3fc38d['error']){if(_0x3fc38d[_0x42f7('0x2a')]['code']===0x1f4){logger[_0x42f7('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e7fd8,_0x3fc38d['error']['message']);return _0x423876(_0x3fc38d[_0x42f7('0x2a')][_0x42f7('0x2b')]);}logger[_0x42f7('0x2a')](_0x42f7('0x25'),_0x3e7fd8,_0x3fc38d[_0x42f7('0x2a')][_0x42f7('0x2b')]);return _0x19eff3(_0x3fc38d[_0x42f7('0x2a')][_0x42f7('0x2b')]);}else{logger[_0x42f7('0x24')](_0x42f7('0x25'),_0x3e7fd8,_0x42f7('0x26'));_0x19eff3(_0x3fc38d[_0x42f7('0x2c')][_0x42f7('0x2b')]);}})[_0x42f7('0x2d')](function(_0x553531){logger['error'](_0x42f7('0x25'),_0x3e7fd8,_0x553531);_0x423876(_0x553531);});});}function respondWithStatusCode(_0x35f941,_0x445e03){_0x445e03=_0x445e03||0xcc;return function(_0x3bb6bc){if(_0x3bb6bc){return _0x35f941[_0x42f7('0x2e')](_0x445e03);}return _0x35f941[_0x42f7('0x2f')](_0x445e03)[_0x42f7('0x30')]();};}function respondWithResult(_0x64859,_0xe53027){_0xe53027=_0xe53027||0xc8;return function(_0x1118ab){if(_0x1118ab){return _0x64859['status'](_0xe53027)['json'](_0x1118ab);}};}function respondWithFilteredResult(_0x4022dd,_0x1b0977){return function(_0x1c4dc9){if(_0x1c4dc9){var _0x4d7137=typeof _0x1b0977[_0x42f7('0x31')]===_0x42f7('0x32')&&typeof _0x1b0977['limit']==='undefined';var _0x36e6d4=_0x1c4dc9[_0x42f7('0x33')];var _0x210054=_0x4d7137?0x0:_0x1b0977[_0x42f7('0x31')];var _0x1e245c=_0x4d7137?_0x1c4dc9[_0x42f7('0x33')]:_0x1b0977[_0x42f7('0x31')]+_0x1b0977[_0x42f7('0x34')];var _0x3322d2;if(_0x1e245c>=_0x36e6d4){_0x1e245c=_0x36e6d4;_0x3322d2=0xc8;}else{_0x3322d2=0xce;}_0x4022dd['status'](_0x3322d2);return _0x4022dd[_0x42f7('0x35')](_0x42f7('0x36'),_0x210054+'-'+_0x1e245c+'/'+_0x36e6d4)[_0x42f7('0x37')](_0x1c4dc9);}return null;};}function patchUpdates(_0xd26ccf){return function(_0x1ac7e0){try{jsonpatch['apply'](_0x1ac7e0,_0xd26ccf,!![]);}catch(_0x27db26){return BPromise[_0x42f7('0x38')](_0x27db26);}return _0x1ac7e0[_0x42f7('0x39')]();};}function saveUpdates(_0x310872,_0x505310){return function(_0x3ef7a8){if(_0x3ef7a8){return _0x3ef7a8['update'](_0x310872)[_0x42f7('0x3a')](function(_0x2bb14b){return _0x2bb14b;});}return null;};}function removeEntity(_0xec377d,_0x27518d){return function(_0x14cae3){if(_0x14cae3){return _0x14cae3[_0x42f7('0x3b')]()[_0x42f7('0x3a')](function(){var _0x4e506f=_0x14cae3['get']({'plain':!![]});var _0x2ce93f=_0x42f7('0x3c');return db['UserProfileResource'][_0x42f7('0x3b')]({'where':{'type':_0x2ce93f,'resourceId':_0x4e506f['id']}})['then'](function(){return _0x14cae3;});})[_0x42f7('0x3a')](function(){_0xec377d[_0x42f7('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb1cf,_0x48b79e){return function(_0x43a108){if(!_0x43a108){_0x4bb1cf['sendStatus'](0x194);}return _0x43a108;};}function handleError(_0xc3a6a1,_0x19d067){_0x19d067=_0x19d067||0x1f4;return function(_0x44ec4b){logger[_0x42f7('0x2a')](_0x44ec4b[_0x42f7('0x3d')]);if(_0x44ec4b['name']){delete _0x44ec4b[_0x42f7('0x3e')];}_0xc3a6a1[_0x42f7('0x2f')](_0x19d067)['send'](_0x44ec4b);};}exports['index']=function(_0x151c80,_0x164553){var _0x33bf56={'include':[{'model':db[_0x42f7('0x3f')],'as':'mandatoryDispositionPause'}]},_0x2204a1={},_0xaa39b4={'count':0x0,'rows':[]};var _0x3037f8=_['map'](db[_0x42f7('0x40')][_0x42f7('0x41')],function(_0x21bca2){return{'name':_0x21bca2['fieldName'],'type':_0x21bca2[_0x42f7('0x42')]['key']};});_0x2204a1[_0x42f7('0x43')]=_[_0x42f7('0x44')](_0x3037f8,_0x42f7('0x3e'));_0x2204a1['query']=_[_0x42f7('0x45')](_0x151c80[_0x42f7('0x46')]);_0x2204a1['filters']=_[_0x42f7('0x47')](_0x2204a1['model'],_0x2204a1[_0x42f7('0x46')]);_0x33bf56['attributes']=_[_0x42f7('0x47')](_0x2204a1[_0x42f7('0x43')],qs['fields'](_0x151c80[_0x42f7('0x46')][_0x42f7('0x48')]));_0x33bf56['attributes']=_0x33bf56[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x33bf56[_0x42f7('0x49')]:_0x2204a1[_0x42f7('0x43')];if(!_0x151c80[_0x42f7('0x46')]['hasOwnProperty'](_0x42f7('0x4b'))){_0x33bf56['limit']=qs[_0x42f7('0x34')](_0x151c80[_0x42f7('0x46')][_0x42f7('0x34')]);_0x33bf56[_0x42f7('0x31')]=qs['offset'](_0x151c80[_0x42f7('0x46')][_0x42f7('0x31')]);}_0x33bf56[_0x42f7('0x4c')]=qs[_0x42f7('0x4d')](_0x151c80[_0x42f7('0x46')][_0x42f7('0x4d')]);_0x33bf56['where']=qs['filters'](_[_0x42f7('0x4e')](_0x151c80[_0x42f7('0x46')],_0x2204a1['filters']),_0x3037f8);if(_0x151c80[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x33bf56[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0x33bf56[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x3037f8,function(_0x30e81f){if(_0x30e81f[_0x42f7('0x42')]!==_0x42f7('0x52')){var _0x5334fe={};_0x5334fe[_0x30e81f[_0x42f7('0x3e')]]={'$like':'%'+_0x151c80[_0x42f7('0x46')][_0x42f7('0x4f')]+'%'};return _0x5334fe;}})});}_0x33bf56=_[_0x42f7('0x51')]({},_0x33bf56,_0x151c80[_0x42f7('0x53')]);var _0x211cba={'where':_0x33bf56[_0x42f7('0x50')]};return db[_0x42f7('0x40')]['count'](_0x211cba)[_0x42f7('0x3a')](function(_0x20da5f){_0xaa39b4[_0x42f7('0x33')]=_0x20da5f;if(_0x151c80[_0x42f7('0x46')][_0x42f7('0x54')]){_0x33bf56[_0x42f7('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x42f7('0x56')](_0x33bf56);})[_0x42f7('0x3a')](function(_0x4e61a9){_0xaa39b4[_0x42f7('0x57')]=_0x4e61a9;return _0xaa39b4;})['then'](respondWithFilteredResult(_0x164553,_0x33bf56))[_0x42f7('0x2d')](handleError(_0x164553,null));};exports[_0x42f7('0x58')]=function(_0x1a3e1f,_0x5df782){var _0x27f709={'raw':![],'where':{'id':_0x1a3e1f['params']['id']},'include':[{'model':db[_0x42f7('0x3f')],'as':_0x42f7('0x59')}]},_0x291605={};_0x291605[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x40')][_0x42f7('0x41')]);_0x291605[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x1a3e1f[_0x42f7('0x46')]);_0x291605[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x291605[_0x42f7('0x43')],_0x291605[_0x42f7('0x46')]);_0x27f709['attributes']=_[_0x42f7('0x47')](_0x291605['model'],qs[_0x42f7('0x48')](_0x1a3e1f[_0x42f7('0x46')][_0x42f7('0x48')]));_0x27f709[_0x42f7('0x49')]=_0x27f709[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x27f709[_0x42f7('0x49')]:_0x291605[_0x42f7('0x43')];if(_0x1a3e1f['query'][_0x42f7('0x54')]){_0x27f709[_0x42f7('0x55')]=[{'all':!![]}];}_0x27f709=_['merge']({},_0x27f709,_0x1a3e1f['options']);return db[_0x42f7('0x40')]['find'](_0x27f709)['then'](handleEntityNotFound(_0x5df782,null))[_0x42f7('0x3a')](respondWithResult(_0x5df782,null))[_0x42f7('0x2d')](handleError(_0x5df782,null));};exports['create']=function(_0x4c7a0e,_0x3c9828){return db['OpenchannelAccount'][_0x42f7('0x5b')](_0x4c7a0e['body'],{})['then'](function(_0x460c69){var _0x3230e9=_0x4c7a0e['user']['get']({'plain':!![]});if(!_0x3230e9)throw new Error(_0x42f7('0x5c'));if(_0x3230e9[_0x42f7('0x5d')]==='user'){var _0x475ab0=_0x460c69[_0x42f7('0x5e')]({'plain':!![]});var _0x329152=_0x42f7('0x3c');return db[_0x42f7('0x5f')]['find']({'where':{'name':_0x329152,'userProfileId':_0x3230e9[_0x42f7('0x60')]},'raw':!![]})['then'](function(_0x3b28d5){if(_0x3b28d5&&_0x3b28d5[_0x42f7('0x61')]===0x0){return db[_0x42f7('0x62')][_0x42f7('0x5b')]({'name':_0x475ab0[_0x42f7('0x3e')],'resourceId':_0x475ab0['id'],'type':_0x3b28d5[_0x42f7('0x3e')],'sectionId':_0x3b28d5['id']},{})[_0x42f7('0x3a')](function(){return _0x460c69;});}else{return _0x460c69;}})['catch'](function(_0x419be3){logger[_0x42f7('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x419be3);throw _0x419be3;});}return _0x460c69;})[_0x42f7('0x3a')](respondWithResult(_0x3c9828,0xc9))[_0x42f7('0x2d')](handleError(_0x3c9828,null));};exports[_0x42f7('0x63')]=function(_0x264a49,_0x49e9b3){if(_0x264a49[_0x42f7('0x64')]['id']){delete _0x264a49['body']['id'];}return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0x264a49['params']['id']},'include':[{'model':db[_0x42f7('0x3f')],'as':_0x42f7('0x59')}]})[_0x42f7('0x3a')](handleEntityNotFound(_0x49e9b3,null))[_0x42f7('0x3a')](saveUpdates(_0x264a49[_0x42f7('0x64')],null))[_0x42f7('0x3a')](respondWithResult(_0x49e9b3,null))[_0x42f7('0x2d')](handleError(_0x49e9b3,null));};exports['destroy']=function(_0x13d5be,_0x998bb2){return db[_0x42f7('0x40')]['find']({'where':{'id':_0x13d5be[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0x998bb2,null))[_0x42f7('0x3a')](removeEntity(_0x998bb2,null))['catch'](handleError(_0x998bb2,null));};exports['describe']=function(_0x4a9786,_0x2fd4bd){return db['OpenchannelAccount'][_0x42f7('0x67')]()[_0x42f7('0x3a')](respondWithResult(_0x2fd4bd,null))['catch'](handleError(_0x2fd4bd,null));};exports['addDisposition']=function(_0x1baaba,_0x53d9fd,_0x114c8b){if(_0x1baaba['body']['id']){delete _0x1baaba[_0x42f7('0x64')]['id'];}return db['OpenchannelAccount'][_0x42f7('0x65')]({'where':{'id':_0x1baaba[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x53d9fd,null))[_0x42f7('0x3a')](function(_0x406720){if(_0x406720){_0x1baaba[_0x42f7('0x64')][_0x42f7('0x68')]=_0x406720['id'];return db['Disposition'][_0x42f7('0x5b')](_0x1baaba[_0x42f7('0x64')]);}})[_0x42f7('0x3a')](respondWithResult(_0x53d9fd,null))[_0x42f7('0x2d')](handleError(_0x53d9fd,null));};exports['getDispositions']=function(_0x2ac4b8,_0xc2ca02,_0x3c98a3){var _0x5dadd6={'raw':![],'where':{}};var _0x285fa8={};var _0x328033={'count':0x0,'rows':[]};return db[_0x42f7('0x40')]['findOne']({'where':{'id':_0x2ac4b8[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0xc2ca02,null))[_0x42f7('0x3a')](function(_0x390f27){if(_0x390f27){_0x285fa8[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x69')][_0x42f7('0x41')]);_0x285fa8[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x2ac4b8[_0x42f7('0x46')]);_0x285fa8['filters']=_['intersection'](_0x285fa8[_0x42f7('0x43')],_0x285fa8[_0x42f7('0x46')]);_0x5dadd6['attributes']=_[_0x42f7('0x47')](_0x285fa8['model'],qs[_0x42f7('0x48')](_0x2ac4b8['query'][_0x42f7('0x48')]));_0x5dadd6[_0x42f7('0x49')]=_0x5dadd6['attributes']['length']?_0x5dadd6['attributes']:_0x285fa8[_0x42f7('0x43')];if(!_0x2ac4b8['query'][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x5dadd6[_0x42f7('0x34')]=qs[_0x42f7('0x34')](_0x2ac4b8[_0x42f7('0x46')][_0x42f7('0x34')]);_0x5dadd6[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x2ac4b8['query'][_0x42f7('0x31')]);}_0x5dadd6[_0x42f7('0x4c')]=qs[_0x42f7('0x4d')](_0x2ac4b8[_0x42f7('0x46')]['sort']);_0x5dadd6[_0x42f7('0x50')]=qs[_0x42f7('0x5a')](_['pick'](_0x2ac4b8[_0x42f7('0x46')],_0x285fa8[_0x42f7('0x5a')]));_0x5dadd6[_0x42f7('0x50')]['OpenchannelAccountId']=_0x390f27['id'];if(_0x2ac4b8[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x5dadd6[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0x5dadd6[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x5dadd6[_0x42f7('0x49')],function(_0x3e3b1e){var _0x28c543={};_0x28c543[_0x3e3b1e]={'$like':'%'+_0x2ac4b8['query'][_0x42f7('0x4f')]+'%'};return _0x28c543;})});}_0x5dadd6=_['merge']({},_0x5dadd6,_0x2ac4b8[_0x42f7('0x53')]);return db[_0x42f7('0x69')][_0x42f7('0x33')]({'where':_0x5dadd6[_0x42f7('0x50')]})[_0x42f7('0x3a')](function(_0x17c556){_0x328033[_0x42f7('0x33')]=_0x17c556;if(_0x2ac4b8[_0x42f7('0x46')][_0x42f7('0x54')]){_0x5dadd6['include']=[{'all':!![]}];}return db[_0x42f7('0x69')][_0x42f7('0x56')](_0x5dadd6);})[_0x42f7('0x3a')](function(_0x3b43f7){_0x328033[_0x42f7('0x57')]=_0x3b43f7;return _0x328033;});}})['then'](respondWithFilteredResult(_0xc2ca02,_0x5dadd6))[_0x42f7('0x2d')](handleError(_0xc2ca02,null));};exports[_0x42f7('0x6b')]=function(_0x2f0beb,_0x786c4c,_0x5c81d6){return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0x2f0beb[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x786c4c,null))[_0x42f7('0x3a')](function(_0x57b632){if(_0x57b632){return _0x57b632[_0x42f7('0x6b')](_0x2f0beb[_0x42f7('0x46')][_0x42f7('0x6c')]);}})[_0x42f7('0x3a')](respondWithStatusCode(_0x786c4c,null))[_0x42f7('0x2d')](handleError(_0x786c4c,null));};exports[_0x42f7('0x6d')]=function(_0x2566a7,_0x2ad980,_0x697c8a){if(_0x2566a7['body']['id']){delete _0x2566a7[_0x42f7('0x64')]['id'];}return db['OpenchannelAccount'][_0x42f7('0x65')]({'where':{'id':_0x2566a7[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x2ad980,null))[_0x42f7('0x3a')](function(_0x163925){if(_0x163925){_0x2566a7[_0x42f7('0x64')][_0x42f7('0x68')]=_0x163925['id'];return db[_0x42f7('0x6e')][_0x42f7('0x5b')](_0x2566a7[_0x42f7('0x64')]);}})[_0x42f7('0x3a')](respondWithResult(_0x2ad980,null))[_0x42f7('0x2d')](handleError(_0x2ad980,null));};exports[_0x42f7('0x6f')]=function(_0x3d0676,_0x170e25,_0x3f30f8){var _0x548834={'raw':![],'where':{}};var _0x4e8408={};var _0x115903={'count':0x0,'rows':[]};return db[_0x42f7('0x40')][_0x42f7('0x70')]({'where':{'id':_0x3d0676[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0x170e25,null))['then'](function(_0x2264d5){if(_0x2264d5){_0x4e8408[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x6e')]['rawAttributes']);_0x4e8408[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x3d0676[_0x42f7('0x46')]);_0x4e8408['filters']=_['intersection'](_0x4e8408[_0x42f7('0x43')],_0x4e8408[_0x42f7('0x46')]);_0x548834[_0x42f7('0x49')]=_['intersection'](_0x4e8408[_0x42f7('0x43')],qs['fields'](_0x3d0676['query'][_0x42f7('0x48')]));_0x548834[_0x42f7('0x49')]=_0x548834['attributes']['length']?_0x548834['attributes']:_0x4e8408['model'];if(!_0x3d0676[_0x42f7('0x46')][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x548834['limit']=qs[_0x42f7('0x34')](_0x3d0676[_0x42f7('0x46')]['limit']);_0x548834[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x3d0676[_0x42f7('0x46')][_0x42f7('0x31')]);}_0x548834['order']=qs[_0x42f7('0x4d')](_0x3d0676[_0x42f7('0x46')]['sort']);_0x548834[_0x42f7('0x50')]=qs[_0x42f7('0x5a')](_[_0x42f7('0x4e')](_0x3d0676[_0x42f7('0x46')],_0x4e8408['filters']));_0x548834['where'][_0x42f7('0x68')]=_0x2264d5['id'];if(_0x3d0676[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x548834[_0x42f7('0x50')]=_['merge'](_0x548834[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x548834[_0x42f7('0x49')],function(_0x4ab205){var _0x594f4f={};_0x594f4f[_0x4ab205]={'$like':'%'+_0x3d0676[_0x42f7('0x46')][_0x42f7('0x4f')]+'%'};return _0x594f4f;})});}_0x548834=_['merge']({},_0x548834,_0x3d0676[_0x42f7('0x53')]);return db['CannedAnswer'][_0x42f7('0x33')]({'where':_0x548834[_0x42f7('0x50')]})['then'](function(_0x2cf17d){_0x115903[_0x42f7('0x33')]=_0x2cf17d;if(_0x3d0676[_0x42f7('0x46')]['includeAll']){_0x548834[_0x42f7('0x55')]=[{'all':!![]}];}return db[_0x42f7('0x6e')][_0x42f7('0x56')](_0x548834);})[_0x42f7('0x3a')](function(_0x27d8a1){_0x115903['rows']=_0x27d8a1;return _0x115903;});}})[_0x42f7('0x3a')](respondWithFilteredResult(_0x170e25,_0x548834))[_0x42f7('0x2d')](handleError(_0x170e25,null));};exports['removeAnswers']=function(_0xf5758d,_0x4e3ac8,_0x3e4c88){return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0xf5758d[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x4e3ac8,null))[_0x42f7('0x3a')](function(_0xeed92a){if(_0xeed92a){return _0xeed92a['removeAnswers'](_0xf5758d[_0x42f7('0x46')][_0x42f7('0x6c')]);}})[_0x42f7('0x3a')](respondWithStatusCode(_0x4e3ac8,null))[_0x42f7('0x2d')](handleError(_0x4e3ac8,null));};exports[_0x42f7('0x71')]=function(_0x2b8ea2,_0x3a3144,_0x407421){var _0x1475e9={'body':_0x2b8ea2['body'],'channel':_0x42f7('0x72')};var _0x59546e=[];var _0x56c1c5=[];var _0x518ab8={};var _0x197947=![];return db[_0x42f7('0x73')][_0x42f7('0x67')]()['then'](function(_0x206367){if(!_0x206367){throw new db[(_0x42f7('0x74'))]['ValidationError'](_0x42f7('0x75'));}_0x59546e=_['difference'](_['keys'](_0x206367),[_0x42f7('0x76'),'updatedAt']);_0x56c1c5=_[_0x42f7('0x77')](_[_0x42f7('0x45')](_0x206367),[_0x42f7('0x76'),_0x42f7('0x78'),_0x42f7('0x79'),_0x42f7('0x7a')]);if(_0x2b8ea2['body']['id']){delete _0x2b8ea2['body']['id'];}if(_[_0x42f7('0x7b')](_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7c')])){throw new db['Sequelize'][(_0x42f7('0x7d'))]('from\x20is\x20mandatory');}if(_[_0x42f7('0x7b')](_0x2b8ea2['body'][_0x42f7('0x64')])||_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x64')]===''){throw new db['Sequelize'][(_0x42f7('0x7d'))](_0x42f7('0x7e'));}if(_[_0x42f7('0x7b')](_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7f')])){throw new db[(_0x42f7('0x74'))][(_0x42f7('0x7d'))](_0x42f7('0x80')+_0x56c1c5);}if(!_[_0x42f7('0x81')](_0x56c1c5,_0x2b8ea2['body'][_0x42f7('0x7f')])){throw new db[(_0x42f7('0x74'))][(_0x42f7('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x56c1c5);}_0x518ab8[_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7f')]]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7c')];})[_0x42f7('0x3a')](function(){return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0x2b8ea2[_0x42f7('0x66')]['id']},'include':[{'model':db[_0x42f7('0x82')],'as':_0x42f7('0x83'),'include':[{'model':db[_0x42f7('0x73')],'as':'Contacts','where':_0x518ab8,'limit':0x1,'order':[[_0x42f7('0x78'),_0x42f7('0x84')]]}]},{'model':db[_0x42f7('0x85')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x3a3144,null))[_0x42f7('0x3a')](function(_0x4426e1){if(_0x4426e1&&_0x4426e1[_0x42f7('0x83')]){_0x1475e9[_0x42f7('0x86')]=_0x4426e1;_0x1475e9[_0x42f7('0x87')]=_0x4426e1['Applications'];_0x1475e9[_0x42f7('0x88')]=_0x4426e1[_0x42f7('0x83')];_0x1475e9[_0x42f7('0x87')]=_['orderBy'](_0x1475e9[_0x42f7('0x87')],[_0x42f7('0x89')],[_0x42f7('0x8a')]);if(_0x1475e9[_0x42f7('0x86')][_0x42f7('0x8b')]){delete _0x1475e9[_0x42f7('0x86')][_0x42f7('0x8b')];}if(_0x1475e9['account'][_0x42f7('0x83')]&&_0x1475e9[_0x42f7('0x86')][_0x42f7('0x83')]['Contacts'][_0x42f7('0x4a')]){return _0x1475e9[_0x42f7('0x86')]['List']['Contacts'][0x0];}var _0x534dcd=_[_0x42f7('0x1c')](_0x2b8ea2['body'],{'firstName':_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7c')],'ListId':_0x4426e1[_0x42f7('0x7a')]});_0x534dcd[_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7f')]]=_0x2b8ea2['body']['from'];return db[_0x42f7('0x73')][_0x42f7('0x5b')](_0x534dcd,{'fields':_0x59546e,'raw':!![]});}})[_0x42f7('0x3a')](handleEntityNotFound(_0x3a3144,null))['then'](function(_0x4b8360){_0x1475e9['contact']=_0x4b8360;if(_0x4b8360){var _0x1fd945={'ContactId':_0x4b8360['id'],'OpenchannelAccountId':_0x2b8ea2[_0x42f7('0x66')]['id'],'from':(_0x4b8360[_0x42f7('0x8c')]||'')+'\x20'+(_0x4b8360[_0x42f7('0x8d')]||'')};var _0x4339fc={'OpenchannelAccountId':_0x2b8ea2['params']['id'],'closed':![]};if(_0x2b8ea2[_0x42f7('0x64')]['threadId']){_0x4339fc[_0x42f7('0x8e')]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x8e')];return db['OpenchannelInteraction'][_0x42f7('0x65')]({'where':_0x4339fc})[_0x42f7('0x3a')](function(_0x202980){if(_0x202980){return[_0x202980,![]];}_0x1fd945[_0x42f7('0x8e')]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x8e')];_0x1fd945[_0x42f7('0x8f')]=_0x2b8ea2[_0x42f7('0x64')]['externalUrl'];return db[_0x42f7('0x90')]['create'](_0x1fd945)[_0x42f7('0x3a')](function(_0x1500d3){return[_0x1500d3,!![]];});});}else{_0x4339fc[_0x42f7('0x8e')]=null;}_0x4339fc[_0x42f7('0x91')]=_0x4b8360['id'];return db['OpenchannelInteraction']['find']({'where':_0x4339fc})[_0x42f7('0x3a')](function(_0xa13d6b){if(_0xa13d6b){return[_0xa13d6b,![]];}return db[_0x42f7('0x90')][_0x42f7('0x5b')](_0x1fd945)[_0x42f7('0x3a')](function(_0x3b3ca7){return[_0x3b3ca7,!![]];});});}})[_0x42f7('0x92')](function(_0xf033eb,_0x53c0f9){if(_0xf033eb){_0x197947=_0x53c0f9;if(!_0x53c0f9){var _0x2a5d2c={'from':(_0x1475e9[_0x42f7('0x93')][_0x42f7('0x8c')]||'')+'\x20'+(_0x1475e9['contact']['lastName']||'')};if(_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x8e')]&&_0x2b8ea2['body'][_0x42f7('0x94')]&&_0x2b8ea2[_0x42f7('0x64')]['threadId']!=_0x2b8ea2['body'][_0x42f7('0x94')]){_0x2a5d2c[_0x42f7('0x8e')]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x94')];}return _0xf033eb[_0x42f7('0x63')](_0x2a5d2c);}else{return _0xf033eb;}}})[_0x42f7('0x3a')](function(_0x41ab2f){_0x1475e9[_0x42f7('0x95')]=_0x41ab2f[_0x42f7('0x5e')]({'plain':!![]});_0x1475e9[_0x42f7('0x95')][_0x42f7('0x96')]=_0x197947;if(_0x1475e9[_0x42f7('0x95')][_0x42f7('0x96')]){if(_0x1475e9['account']['autoclose']){_0x1475e9[_0x42f7('0x87')][_0x42f7('0x97')]({'id':0x0,'priority':_0x1475e9[_0x42f7('0x87')]['length']+0x1,'app':_0x42f7('0x98'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x42f7('0x99')][_0x42f7('0x5b')]({'body':_0x2b8ea2[_0x42f7('0x64')]['body'],'OpenchannelAccountId':_0x2b8ea2[_0x42f7('0x66')]['id'],'OpenchannelInteractionId':_0x41ab2f['id'],'direction':'in','ContactId':_0x1475e9[_0x42f7('0x93')]['id'],'AttachmentId':_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x9a')]});})[_0x42f7('0x3a')](function(_0x2e8fa1){_0x1475e9[_0x42f7('0x2b')]=_0x2e8fa1;if(!_0x1475e9[_0x42f7('0x95')][_0x42f7('0x9b')])return;return db[_0x42f7('0x9c')][_0x42f7('0x65')]({'attributes':['id',_0x42f7('0x3e')],'where':{'id':_0x1475e9[_0x42f7('0x95')][_0x42f7('0x9b')]}});})[_0x42f7('0x3a')](function(_0x3332ef){if(_0x3332ef){_0x1475e9[_0x42f7('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x42f7('0x9d'),'appdata':_0x3332ef[_0x42f7('0x3e')]+','+(_0x1475e9[_0x42f7('0x86')][_0x42f7('0x9e')]||0xa),'interval':'*,*,*,*'});}if(!_0x1475e9['interaction']['queueId'])return;return db[_0x42f7('0x9f')][_0x42f7('0x65')]({'attributes':['id','name'],'where':{'id':_0x1475e9[_0x42f7('0x95')][_0x42f7('0xa0')]}});})[_0x42f7('0x3a')](function(_0x2c3c7c){if(_0x2c3c7c){_0x1475e9[_0x42f7('0x87')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2c3c7c[_0x42f7('0x3e')]+','+(_0x1475e9['account'][_0x42f7('0xa1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x42f7('0xa2'),_0x42f7('0xa3'),_0x1475e9);})[_0x42f7('0x3a')](function(_0x171de4){respondWithRpcPromise('EventManager',_0x42f7('0xa4'),{'event':_0x42f7('0x71'),'message':_0x171de4},client9002);return _0x171de4;})[_0x42f7('0x3a')](respondWithResult(_0x3a3144,null))[_0x42f7('0x2d')](handleError(_0x3a3144,null));};exports[_0x42f7('0xa5')]=function(_0x56f5cd,_0x3cb9bc){var _0x32c99d=_0x56f5cd[_0x42f7('0x66')]['id'];var _0x5eeeb4=_0x56f5cd['body'];var _0x5498be=0xc8;var _0x5b31c4=null;return db[_0x42f7('0xa6')][_0x42f7('0xa7')]({'isolationLevel':db[_0x42f7('0xa6')][_0x42f7('0xa8')][_0x42f7('0xa9')][_0x42f7('0xaa')]},function(_0x16ec39){return db[_0x42f7('0x40')]['findOne']({'where':{'id':_0x32c99d},'transaction':_0x16ec39})[_0x42f7('0x3a')](function(_0x1d35c1){if(_0x1d35c1){return db[_0x42f7('0x85')][_0x42f7('0x3b')]({'where':{'OpenchannelAccountId':_0x32c99d},'transaction':_0x16ec39})['then'](function(){var _0x22037c=_['map'](_0x5eeeb4,function(_0x25490b){_0x25490b[_0x42f7('0x68')]=_0x32c99d;return _0x25490b;});return db['OpenchannelApplication'][_0x42f7('0xab')](_0x22037c,{'transaction':_0x16ec39});});}else{_0x5498be=0x194;_0x5b31c4=[];}});})[_0x42f7('0x3a')](function(){if(_0x5498be!==0x194){return db[_0x42f7('0x85')][_0x42f7('0xac')]({'where':{'OpenchannelAccountId':_0x32c99d},'order':_0x42f7('0x89')})[_0x42f7('0x3a')](function(_0x559155){_0x5b31c4=_0x559155;});}})[_0x42f7('0x2d')](function(_0x3eb494){_0x5498be=0x1f4;logger[_0x42f7('0x2a')](_0x3eb494['stack']);if(_0x3eb494[_0x42f7('0x3e')]){delete _0x3eb494[_0x42f7('0x3e')];}_0x5b31c4=_0x3eb494;})['finally'](function(){if(_0x5b31c4===null){_0x3cb9bc[_0x42f7('0x2e')](_0x5498be);}else{if(_0x5498be===0x1f4){_0x3cb9bc['status'](_0x5498be)['send'](_0x5b31c4);}else{_0x3cb9bc['status'](_0x5498be)[_0x42f7('0x37')](_0x5b31c4);}}});};exports['getApplications']=function(_0x309431,_0x54e689,_0x1d2d7d){var _0x58451a={};var _0x474053={};var _0x2a1b51;var _0x4858a6;return db[_0x42f7('0x40')][_0x42f7('0x70')]({'where':{'id':_0x309431[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x54e689,null))[_0x42f7('0x3a')](function(_0x57fd76){if(_0x57fd76){_0x2a1b51=_0x57fd76;_0x474053[_0x42f7('0x43')]=_[_0x42f7('0x45')](db['OpenchannelApplication'][_0x42f7('0x41')]);_0x474053['query']=_[_0x42f7('0x45')](_0x309431['query']);_0x474053[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x474053[_0x42f7('0x43')],_0x474053['query']);_0x58451a[_0x42f7('0x49')]=_[_0x42f7('0x47')](_0x474053[_0x42f7('0x43')],qs['fields'](_0x309431['query'][_0x42f7('0x48')]));_0x58451a['attributes']=_0x58451a[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x58451a[_0x42f7('0x49')]:_0x474053[_0x42f7('0x43')];_0x58451a['order']=qs['sort'](_0x309431['query'][_0x42f7('0x4d')]);_0x58451a[_0x42f7('0x50')]=qs[_0x42f7('0x5a')](_[_0x42f7('0x4e')](_0x309431[_0x42f7('0x46')],_0x474053[_0x42f7('0x5a')]));if(_0x309431[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x58451a[_0x42f7('0x50')]=_['merge'](_0x58451a['where'],{'$or':_[_0x42f7('0x44')](_0x58451a['attributes'],function(_0x3eb636){var _0x37bad3={};_0x37bad3[_0x3eb636]={'$like':'%'+_0x309431[_0x42f7('0x46')]['filter']+'%'};return _0x37bad3;})});}_0x58451a=_[_0x42f7('0x51')]({},_0x58451a,_0x309431[_0x42f7('0x53')]);return _0x2a1b51[_0x42f7('0xad')](_0x58451a);}})[_0x42f7('0x3a')](function(_0x5bd44d){if(_0x5bd44d){_0x4858a6=_0x5bd44d[_0x42f7('0x4a')];if(!_0x309431[_0x42f7('0x46')][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x58451a[_0x42f7('0x34')]=qs[_0x42f7('0x34')](_0x309431[_0x42f7('0x46')][_0x42f7('0x34')]);_0x58451a[_0x42f7('0x31')]=qs['offset'](_0x309431[_0x42f7('0x46')]['offset']);}return _0x2a1b51[_0x42f7('0xad')](_0x58451a);}})[_0x42f7('0x3a')](function(_0x4dd19b){if(_0x4dd19b){return _0x4dd19b?{'count':_0x4858a6,'rows':_0x4dd19b}:null;}})[_0x42f7('0x3a')](respondWithResult(_0x54e689,null))[_0x42f7('0x2d')](handleError(_0x54e689,null));};exports[_0x42f7('0xae')]=function(_0x579c46,_0x357183,_0xed6746){var _0xfdf09c={'raw':![],'where':{}};var _0x175d1c={};var _0x4f0c5c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x42f7('0x70')]({'where':{'id':_0x579c46[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x357183,null))[_0x42f7('0x3a')](function(_0x3c203d){if(_0x3c203d){_0x175d1c[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x90')][_0x42f7('0x41')]);_0x175d1c[_0x42f7('0x46')]=_['keys'](_0x579c46[_0x42f7('0x46')]);_0x175d1c[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x175d1c[_0x42f7('0x43')],_0x175d1c[_0x42f7('0x46')]);_0xfdf09c[_0x42f7('0x49')]=_[_0x42f7('0x47')](_0x175d1c[_0x42f7('0x43')],qs[_0x42f7('0x48')](_0x579c46[_0x42f7('0x46')][_0x42f7('0x48')]));_0xfdf09c[_0x42f7('0x49')]=_0xfdf09c[_0x42f7('0x49')][_0x42f7('0x4a')]?_0xfdf09c[_0x42f7('0x49')]:_0x175d1c[_0x42f7('0x43')];if(!_0x579c46[_0x42f7('0x46')][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0xfdf09c['limit']=qs[_0x42f7('0x34')](_0x579c46[_0x42f7('0x46')][_0x42f7('0x34')]);_0xfdf09c[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x579c46[_0x42f7('0x46')][_0x42f7('0x31')]);}_0xfdf09c['order']=qs[_0x42f7('0x4d')](_0x579c46[_0x42f7('0x46')]['sort']);_0xfdf09c['where']=qs[_0x42f7('0x5a')](_['pick'](_0x579c46[_0x42f7('0x46')],_0x175d1c['filters']));_0xfdf09c[_0x42f7('0x50')][_0x42f7('0x68')]=_0x3c203d['id'];if(_0x579c46[_0x42f7('0x46')][_0x42f7('0x4f')]){_0xfdf09c[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0xfdf09c[_0x42f7('0x50')],{'$or':_['map'](_0xfdf09c['attributes'],function(_0x117ee4){var _0x2198a2={};_0x2198a2[_0x117ee4]={'$like':'%'+_0x579c46[_0x42f7('0x46')][_0x42f7('0x4f')]+'%'};return _0x2198a2;})});}_0xfdf09c=_['merge']({},_0xfdf09c,_0x579c46[_0x42f7('0x53')]);return db[_0x42f7('0x90')]['count']({'where':_0xfdf09c[_0x42f7('0x50')]})[_0x42f7('0x3a')](function(_0x43c310){_0x4f0c5c[_0x42f7('0x33')]=_0x43c310;if(_0x579c46[_0x42f7('0x46')][_0x42f7('0x54')]){_0xfdf09c[_0x42f7('0x55')]=[{'model':db['CmContact'],'as':_0x42f7('0xaf'),'required':![]},{'model':db[_0x42f7('0x9c')],'as':_0x42f7('0xb0'),'attributes':[_0x42f7('0x3e'),_0x42f7('0xb1'),_0x42f7('0xb2')],'required':![]},{'model':db[_0x42f7('0xb3')],'as':_0x42f7('0xb4'),'attributes':['id',_0x42f7('0x3e'),_0x42f7('0xb5')],'where':_0x579c46[_0x42f7('0x46')]['tag']?{'id':_0x579c46[_0x42f7('0x46')][_0x42f7('0xb6')]}:undefined,'required':_0x579c46[_0x42f7('0x46')][_0x42f7('0xb6')]?!![]:![]}];}return db[_0x42f7('0x90')]['findAll'](_0xfdf09c);})[_0x42f7('0x3a')](function(_0x85c766){_0x4f0c5c[_0x42f7('0x57')]=_0x85c766;return _0x4f0c5c;});}})[_0x42f7('0x3a')](respondWithFilteredResult(_0x357183,_0xfdf09c))[_0x42f7('0x2d')](handleError(_0x357183,null));};exports['addAgents']=function(_0x4de73c,_0x4e919d,_0x4c5f76){return db['OpenchannelAccount']['find']({'where':{'id':_0x4de73c[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0x4e919d,null))[_0x42f7('0x3a')](function(_0x2f3d0c){if(_0x2f3d0c){return _0x2f3d0c['addAgents'](_0x4de73c[_0x42f7('0x64')][_0x42f7('0x6c')],_[_0x42f7('0xb7')](_0x4de73c[_0x42f7('0x64')],[_0x42f7('0x6c'),'id'])||{})[_0x42f7('0x92')](function(_0x1b7063){for(var _0x526b64=0x0;_0x526b64<_0x4de73c['body'][_0x42f7('0x6c')][_0x42f7('0x4a')];_0x526b64+=0x1){socket[_0x42f7('0xb8')]('userOpenchannelAccount:save',{'UserId':Number(_0x4de73c[_0x42f7('0x64')][_0x42f7('0x6c')][_0x526b64]),'OpenchannelAccountId':Number(_0x4de73c['params']['id'])});}return _0x1b7063;});}})[_0x42f7('0x3a')](respondWithResult(_0x4e919d,null))[_0x42f7('0x2d')](handleError(_0x4e919d,null));};exports[_0x42f7('0xb9')]=function(_0x4426da,_0x2880eb,_0x22d8e9){return db['OpenchannelAccount']['find']({'where':{'id':_0x4426da[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x2880eb,null))[_0x42f7('0x3a')](function(_0x2c5605){if(_0x2c5605){return _0x2c5605[_0x42f7('0xb9')](_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')])['then'](function(){if(_[_0x42f7('0xba')](_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')])){for(var _0x4964e5=0x0;_0x4964e5<_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')][_0x42f7('0x4a')];_0x4964e5+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4426da['query'][_0x42f7('0x6c')][_0x4964e5]),'OpenchannelAccountId':Number(_0x4426da[_0x42f7('0x66')]['id'])});}}else{socket['emit'](_0x42f7('0xbb'),{'UserId':Number(_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')]),'OpenchannelAccountId':Number(_0x4426da[_0x42f7('0x66')]['id'])});}});}})[_0x42f7('0x3a')](respondWithStatusCode(_0x2880eb,null))[_0x42f7('0x2d')](handleError(_0x2880eb,null));};exports['getAgents']=function(_0x407f27,_0x42ebf1,_0xfb9ee1){var _0x29ca7c={};var _0x464292={};var _0x42bb71;var _0x183813;return db[_0x42f7('0x40')][_0x42f7('0x70')]({'where':{'id':_0x407f27[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x42ebf1,null))[_0x42f7('0x3a')](function(_0x39baab){if(_0x39baab){_0x42bb71=_0x39baab;_0x464292[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x9c')]['rawAttributes']);_0x464292[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x407f27[_0x42f7('0x46')]);_0x464292[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x464292[_0x42f7('0x43')],_0x464292[_0x42f7('0x46')]);_0x29ca7c['attributes']=_[_0x42f7('0x47')](_0x464292[_0x42f7('0x43')],qs['fields'](_0x407f27[_0x42f7('0x46')][_0x42f7('0x48')]));_0x29ca7c[_0x42f7('0x49')]=_0x29ca7c[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x29ca7c[_0x42f7('0x49')]:_0x464292['model'];_0x29ca7c[_0x42f7('0x4c')]=qs[_0x42f7('0x4d')](_0x407f27[_0x42f7('0x46')][_0x42f7('0x4d')]);_0x29ca7c[_0x42f7('0x50')]=qs['filters'](_[_0x42f7('0x4e')](_0x407f27['query'],_0x464292[_0x42f7('0x5a')]));if(_0x407f27[_0x42f7('0x46')]['filter']){_0x29ca7c[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0x29ca7c[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x29ca7c[_0x42f7('0x49')],function(_0x5ba5bd){var _0x5316c6={};_0x5316c6[_0x5ba5bd]={'$like':'%'+_0x407f27[_0x42f7('0x46')]['filter']+'%'};return _0x5316c6;})});}_0x29ca7c=_[_0x42f7('0x51')]({},_0x29ca7c,_0x407f27[_0x42f7('0x53')]);return _0x42bb71['getAgents'](_0x29ca7c);}})['then'](function(_0x24949f){if(_0x24949f){_0x183813=_0x24949f['length'];if(!_0x407f27['query'][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x29ca7c[_0x42f7('0x34')]=qs[_0x42f7('0x34')](_0x407f27['query']['limit']);_0x29ca7c[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x407f27['query'][_0x42f7('0x31')]);}return _0x42bb71['getAgents'](_0x29ca7c);}})['then'](function(_0x540ccc){if(_0x540ccc){return _0x540ccc?{'count':_0x183813,'rows':_0x540ccc}:null;}})[_0x42f7('0x3a')](respondWithResult(_0x42ebf1,null))[_0x42f7('0x2d')](handleError(_0x42ebf1,null));};exports[_0x42f7('0xbc')]=function(_0x3a7a99,_0x1a7e0c,_0x1a4a4c){var _0x5c24df,_0x3a316a,_0x280989;if(_['isNil'](_0x3a7a99[_0x42f7('0x64')][_0x42f7('0x64')])||_0x3a7a99['body']['body']===''){throw new db['Sequelize'][(_0x42f7('0x7d'))](_0x42f7('0x7e'));}if(_['isNil'](_0x3a7a99['body']['to'])){}_0x5c24df=_0x3a7a99[_0x42f7('0x64')]['to'];return db['OpenchannelAccount'][_0x42f7('0x70')]({'where':{'id':_0x3a7a99['params']['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x1a7e0c,null))[_0x42f7('0x3a')](function(_0xf9a55e){if(_0xf9a55e){return db[_0x42f7('0x40')]['find']({'where':{'id':_0xf9a55e['id']},'include':[{'model':db[_0x42f7('0x82')],'as':_0x42f7('0x83'),'include':[{'model':db[_0x42f7('0x73')],'as':_0x42f7('0xbd'),'where':{[_0xf9a55e['mapKey']]:_0x5c24df},'limit':0x1,'order':[[_0x42f7('0x78'),_0x42f7('0x84')]]}]}]})['then'](handleEntityNotFound(_0x1a7e0c,null))['then'](function(_0x1d80d4){if(_0x1d80d4&&_0x1d80d4[_0x42f7('0x83')]){_0x3a316a=_0x1d80d4[_0x42f7('0x5e')]({'plain':!![]});if(_0x3a316a[_0x42f7('0x83')]&&_0x3a316a[_0x42f7('0x83')][_0x42f7('0xbd')][_0x42f7('0x4a')]){return _0x3a316a[_0x42f7('0x83')][_0x42f7('0xbd')][0x0];}return db[_0x42f7('0x73')][_0x42f7('0x5b')](_['defaults'](_0x3a7a99[_0x42f7('0x64')],{'firstName':_0x5c24df,[_0x1d80d4[_0x42f7('0x7f')]]:_0x5c24df,'phone':_0x5c24df,'ListId':_0x3a316a['ListId']}));}})[_0x42f7('0x3a')](handleEntityNotFound(_0x1a7e0c,null))[_0x42f7('0x3a')](function(_0x763032){if(_0x763032){_0x280989=_0x763032;return db[_0x42f7('0x90')][_0x42f7('0x65')]({'where':{'ContactId':_0x280989['id'],'closed':![],'OpenchannelAccountId':_0x3a316a['id']}})[_0x42f7('0x3a')](function(_0x2ded65){if(_0x2ded65){return[_0x2ded65,![]];}return db[_0x42f7('0x90')][_0x42f7('0x5b')]({'UserId':_0x3a7a99[_0x42f7('0xbe')]['id'],'ContactId':_0x280989['id'],'OpenchannelAccountId':_0x3a316a['id'],'lastMsgDirection':_0x42f7('0xbf'),'firstMsgDirection':_0x42f7('0xbf'),'Messages':[_[_0x42f7('0x51')](_0x3a7a99[_0x42f7('0x64')],{'read':![],'body':_0x3a7a99['body']['body'],'OpenchannelAccountId':_0x3a316a['id'],'UserId':_0x3a7a99[_0x42f7('0xbe')]['id'],'ContactId':_0x280989['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0x13aac2){return[_0x13aac2,!![]];});});}})[_0x42f7('0x92')](function(_0x183b4d,_0x12923f){if(_0x12923f){return _0x183b4d;}return db[_0x42f7('0x99')][_0x42f7('0x5b')](_[_0x42f7('0x51')](_0x3a7a99[_0x42f7('0x64')],{'read':![],'body':_0x3a7a99['body'][_0x42f7('0x64')],'OpenchannelAccountId':_0x3a316a['id'],'OpenchannelInteractionId':_0x183b4d['id'],'UserId':_0x3a7a99['user']['id'],'ContactId':_0x280989['id']}))[_0x42f7('0x3a')](function(_0x3f3405){_0x183b4d[_0x42f7('0xc0')][_0x42f7('0xc1')]=[];_0x183b4d[_0x42f7('0xc0')][_0x42f7('0xc1')][_0x42f7('0x97')](_0x3f3405[_0x42f7('0xc0')]);return _0x183b4d;});});}})['then'](respondWithResult(_0x1a7e0c,null))[_0x42f7('0x2d')](handleError(_0x1a7e0c,null));}; \ No newline at end of file +var _0xa151=['attributes','length','hasOwnProperty','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','nolimit','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','close','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','findAndCountAll','finally','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','Messages','dataValues','push','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','model','query','keys','filters','intersection','fields'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xa151,0x13d));var _0x1a15=function(_0x565bc6,_0xf2a735){_0x565bc6=_0x565bc6-0x0;var _0x2dfd07=_0xa151[_0x565bc6];return _0x2dfd07;};'use strict';var emlformat=require(_0x1a15('0x0'));var rimraf=require(_0x1a15('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a15('0x2'));var rp=require(_0x1a15('0x3'));var moment=require(_0x1a15('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a15('0x5'));var util=require(_0x1a15('0x6'));var path=require(_0x1a15('0x7'));var sox=require('sox');var csv=require(_0x1a15('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a15('0x9'));var _=require(_0x1a15('0xa'));var squel=require(_0x1a15('0xb'));var crypto=require(_0x1a15('0xc'));var jsforce=require(_0x1a15('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a15('0x8'));var querystring=require(_0x1a15('0xe'));var Papa=require(_0x1a15('0xf'));var Redis=require('ioredis');var authService=require(_0x1a15('0x10'));var qs=require(_0x1a15('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a15('0x12'));var logger=require(_0x1a15('0x13'))('api');var utils=require(_0x1a15('0x14'));var config=require(_0x1a15('0x15'));var licenseUtil=require(_0x1a15('0x16'));var db=require(_0x1a15('0x17'))['db'];config['redis']=_[_0x1a15('0x18')](config[_0x1a15('0x19')],{'host':_0x1a15('0x1a'),'port':0x18eb});var socket=require(_0x1a15('0x1b'))(new Redis(config[_0x1a15('0x19')]));require('./openchannelAccount.socket')[_0x1a15('0x1c')](socket);var jayson=require(_0x1a15('0x1d'));var client=jayson[_0x1a15('0x1e')][_0x1a15('0x1f')]({'port':0x232c});var client9002=jayson[_0x1a15('0x1e')][_0x1a15('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3cebb9,_0x373451,_0x424823,_0x2891b2){return new BPromise(function(_0x12c5c3,_0x4bd5b3){var _0x2add26=_0x2891b2||client;return _0x2add26['request'](_0x3cebb9,_0x424823)[_0x1a15('0x20')](function(_0x1cfaef){logger[_0x1a15('0x21')](_0x1a15('0x22'),_0x373451,_0x1a15('0x23'));logger[_0x1a15('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x373451,'request\x20sent',JSON['stringify'](_0x1cfaef));if(_0x1cfaef[_0x1a15('0x25')]){if(_0x1cfaef[_0x1a15('0x25')]['code']===0x1f4){logger[_0x1a15('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x373451,_0x1cfaef[_0x1a15('0x25')][_0x1a15('0x26')]);return _0x4bd5b3(_0x1cfaef[_0x1a15('0x25')]['message']);}logger['error'](_0x1a15('0x22'),_0x373451,_0x1cfaef[_0x1a15('0x25')][_0x1a15('0x26')]);return _0x12c5c3(_0x1cfaef[_0x1a15('0x25')][_0x1a15('0x26')]);}else{logger[_0x1a15('0x21')](_0x1a15('0x22'),_0x373451,_0x1a15('0x23'));_0x12c5c3(_0x1cfaef[_0x1a15('0x27')][_0x1a15('0x26')]);}})['catch'](function(_0x25e673){logger[_0x1a15('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x373451,_0x25e673);_0x4bd5b3(_0x25e673);});});}function respondWithStatusCode(_0x3734e9,_0x40d534){_0x40d534=_0x40d534||0xcc;return function(_0x51433a){if(_0x51433a){return _0x3734e9[_0x1a15('0x28')](_0x40d534);}return _0x3734e9[_0x1a15('0x29')](_0x40d534)['end']();};}function respondWithResult(_0x2a789f,_0x305626){_0x305626=_0x305626||0xc8;return function(_0x166e7f){if(_0x166e7f){return _0x2a789f[_0x1a15('0x29')](_0x305626)['json'](_0x166e7f);}};}function respondWithFilteredResult(_0x353ea5,_0x1acaaa){return function(_0x5d2244){if(_0x5d2244){var _0x51583b=typeof _0x1acaaa['offset']===_0x1a15('0x2a')&&typeof _0x1acaaa[_0x1a15('0x2b')]===_0x1a15('0x2a');var _0x265411=_0x5d2244[_0x1a15('0x2c')];var _0x4a8d3e=_0x51583b?0x0:_0x1acaaa['offset'];var _0x22945f=_0x51583b?_0x5d2244['count']:_0x1acaaa[_0x1a15('0x2d')]+_0x1acaaa[_0x1a15('0x2b')];var _0x487ad3;if(_0x22945f>=_0x265411){_0x22945f=_0x265411;_0x487ad3=0xc8;}else{_0x487ad3=0xce;}_0x353ea5[_0x1a15('0x29')](_0x487ad3);return _0x353ea5[_0x1a15('0x2e')]('Content-Range',_0x4a8d3e+'-'+_0x22945f+'/'+_0x265411)[_0x1a15('0x2f')](_0x5d2244);}return null;};}function patchUpdates(_0xff6a11){return function(_0x15bed9){try{jsonpatch[_0x1a15('0x30')](_0x15bed9,_0xff6a11,!![]);}catch(_0x2c4766){return BPromise[_0x1a15('0x31')](_0x2c4766);}return _0x15bed9[_0x1a15('0x32')]();};}function saveUpdates(_0xe9831e,_0x3a6f90){return function(_0x104e9c){if(_0x104e9c){return _0x104e9c[_0x1a15('0x33')](_0xe9831e)[_0x1a15('0x20')](function(_0x16a2ee){return _0x16a2ee;});}return null;};}function removeEntity(_0x31c11d,_0xdd10a6){return function(_0x26f64b){if(_0x26f64b){return _0x26f64b[_0x1a15('0x34')]()[_0x1a15('0x20')](function(){var _0x53239e=_0x26f64b[_0x1a15('0x35')]({'plain':!![]});var _0x4497fa='OpenchannelAccounts';return db[_0x1a15('0x36')][_0x1a15('0x34')]({'where':{'type':_0x4497fa,'resourceId':_0x53239e['id']}})['then'](function(){return _0x26f64b;});})[_0x1a15('0x20')](function(){_0x31c11d[_0x1a15('0x29')](0xcc)[_0x1a15('0x37')]();});}};}function handleEntityNotFound(_0x408cfb,_0x2cad43){return function(_0x3d8f34){if(!_0x3d8f34){_0x408cfb[_0x1a15('0x28')](0x194);}return _0x3d8f34;};}function handleError(_0x9f2a71,_0x41a75c){_0x41a75c=_0x41a75c||0x1f4;return function(_0x13d68f){logger[_0x1a15('0x25')](_0x13d68f[_0x1a15('0x38')]);if(_0x13d68f[_0x1a15('0x39')]){delete _0x13d68f[_0x1a15('0x39')];}_0x9f2a71[_0x1a15('0x29')](_0x41a75c)[_0x1a15('0x3a')](_0x13d68f);};}exports[_0x1a15('0x3b')]=function(_0x52707a,_0x1612c2){var _0x26fe11={'include':[{'model':db[_0x1a15('0x3c')],'as':_0x1a15('0x3d')}]},_0x58d150={},_0x4030ed={'count':0x0,'rows':[]};var _0x400510=_[_0x1a15('0x3e')](db[_0x1a15('0x3f')]['rawAttributes'],function(_0x894a48){return{'name':_0x894a48[_0x1a15('0x40')],'type':_0x894a48['type']['key']};});_0x58d150[_0x1a15('0x41')]=_[_0x1a15('0x3e')](_0x400510,_0x1a15('0x39'));_0x58d150[_0x1a15('0x42')]=_[_0x1a15('0x43')](_0x52707a['query']);_0x58d150[_0x1a15('0x44')]=_[_0x1a15('0x45')](_0x58d150['model'],_0x58d150[_0x1a15('0x42')]);_0x26fe11['attributes']=_['intersection'](_0x58d150[_0x1a15('0x41')],qs[_0x1a15('0x46')](_0x52707a['query'][_0x1a15('0x46')]));_0x26fe11[_0x1a15('0x47')]=_0x26fe11[_0x1a15('0x47')][_0x1a15('0x48')]?_0x26fe11[_0x1a15('0x47')]:_0x58d150[_0x1a15('0x41')];if(!_0x52707a[_0x1a15('0x42')][_0x1a15('0x49')]('nolimit')){_0x26fe11[_0x1a15('0x2b')]=qs[_0x1a15('0x2b')](_0x52707a[_0x1a15('0x42')]['limit']);_0x26fe11[_0x1a15('0x2d')]=qs[_0x1a15('0x2d')](_0x52707a[_0x1a15('0x42')][_0x1a15('0x2d')]);}_0x26fe11['order']=qs[_0x1a15('0x4a')](_0x52707a[_0x1a15('0x42')][_0x1a15('0x4a')]);_0x26fe11['where']=qs[_0x1a15('0x44')](_['pick'](_0x52707a[_0x1a15('0x42')],_0x58d150[_0x1a15('0x44')]),_0x400510);if(_0x52707a[_0x1a15('0x42')][_0x1a15('0x4b')]){_0x26fe11[_0x1a15('0x4c')]=_[_0x1a15('0x4d')](_0x26fe11['where'],{'$or':_['map'](_0x400510,function(_0x29b37f){if(_0x29b37f[_0x1a15('0x4e')]!==_0x1a15('0x4f')){var _0x5e43ba={};_0x5e43ba[_0x29b37f['name']]={'$like':'%'+_0x52707a[_0x1a15('0x42')][_0x1a15('0x4b')]+'%'};return _0x5e43ba;}})});}_0x26fe11=_[_0x1a15('0x4d')]({},_0x26fe11,_0x52707a['options']);var _0x2e7634={'where':_0x26fe11[_0x1a15('0x4c')]};return db[_0x1a15('0x3f')]['count'](_0x2e7634)[_0x1a15('0x20')](function(_0xf2b73a){_0x4030ed[_0x1a15('0x2c')]=_0xf2b73a;if(_0x52707a[_0x1a15('0x42')][_0x1a15('0x50')]){_0x26fe11[_0x1a15('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x1a15('0x52')](_0x26fe11);})[_0x1a15('0x20')](function(_0x4fe5f1){_0x4030ed[_0x1a15('0x53')]=_0x4fe5f1;return _0x4030ed;})[_0x1a15('0x20')](respondWithFilteredResult(_0x1612c2,_0x26fe11))['catch'](handleError(_0x1612c2,null));};exports[_0x1a15('0x54')]=function(_0x1b2ce2,_0x2db3c1){var _0x26f205={'raw':![],'where':{'id':_0x1b2ce2[_0x1a15('0x55')]['id']},'include':[{'model':db[_0x1a15('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1788fb={};_0x1788fb[_0x1a15('0x41')]=_[_0x1a15('0x43')](db[_0x1a15('0x3f')][_0x1a15('0x56')]);_0x1788fb['query']=_[_0x1a15('0x43')](_0x1b2ce2[_0x1a15('0x42')]);_0x1788fb[_0x1a15('0x44')]=_[_0x1a15('0x45')](_0x1788fb[_0x1a15('0x41')],_0x1788fb[_0x1a15('0x42')]);_0x26f205['attributes']=_['intersection'](_0x1788fb['model'],qs[_0x1a15('0x46')](_0x1b2ce2[_0x1a15('0x42')]['fields']));_0x26f205[_0x1a15('0x47')]=_0x26f205[_0x1a15('0x47')][_0x1a15('0x48')]?_0x26f205[_0x1a15('0x47')]:_0x1788fb[_0x1a15('0x41')];if(_0x1b2ce2[_0x1a15('0x42')][_0x1a15('0x50')]){_0x26f205[_0x1a15('0x51')]=[{'all':!![]}];}_0x26f205=_[_0x1a15('0x4d')]({},_0x26f205,_0x1b2ce2[_0x1a15('0x57')]);return db[_0x1a15('0x3f')][_0x1a15('0x58')](_0x26f205)[_0x1a15('0x20')](handleEntityNotFound(_0x2db3c1,null))[_0x1a15('0x20')](respondWithResult(_0x2db3c1,null))['catch'](handleError(_0x2db3c1,null));};exports[_0x1a15('0x59')]=function(_0xe8a772,_0x1fdfc7){return db['OpenchannelAccount'][_0x1a15('0x59')](_0xe8a772[_0x1a15('0x5a')],{})[_0x1a15('0x20')](function(_0x230c8a){var _0x201b21=_0xe8a772[_0x1a15('0x5b')][_0x1a15('0x35')]({'plain':!![]});if(!_0x201b21)throw new Error(_0x1a15('0x5c'));if(_0x201b21[_0x1a15('0x5d')]===_0x1a15('0x5b')){var _0x3e9c80=_0x230c8a['get']({'plain':!![]});var _0x316176=_0x1a15('0x5e');return db[_0x1a15('0x5f')][_0x1a15('0x58')]({'where':{'name':_0x316176,'userProfileId':_0x201b21[_0x1a15('0x60')]},'raw':!![]})[_0x1a15('0x20')](function(_0x2d3a82){if(_0x2d3a82&&_0x2d3a82[_0x1a15('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e9c80[_0x1a15('0x39')],'resourceId':_0x3e9c80['id'],'type':_0x2d3a82['name'],'sectionId':_0x2d3a82['id']},{})[_0x1a15('0x20')](function(){return _0x230c8a;});}else{return _0x230c8a;}})[_0x1a15('0x62')](function(_0x91b7fe){logger['error'](_0x1a15('0x63'),_0x91b7fe);throw _0x91b7fe;});}return _0x230c8a;})[_0x1a15('0x20')](respondWithResult(_0x1fdfc7,0xc9))[_0x1a15('0x62')](handleError(_0x1fdfc7,null));};exports['update']=function(_0x442b3d,_0x3be508){if(_0x442b3d[_0x1a15('0x5a')]['id']){delete _0x442b3d['body']['id'];}return db[_0x1a15('0x3f')][_0x1a15('0x58')]({'where':{'id':_0x442b3d[_0x1a15('0x55')]['id']},'include':[{'model':db[_0x1a15('0x3c')],'as':_0x1a15('0x3d')}]})['then'](handleEntityNotFound(_0x3be508,null))['then'](saveUpdates(_0x442b3d[_0x1a15('0x5a')],null))[_0x1a15('0x20')](respondWithResult(_0x3be508,null))[_0x1a15('0x62')](handleError(_0x3be508,null));};exports['destroy']=function(_0x32faca,_0x2bda5f){return db[_0x1a15('0x3f')][_0x1a15('0x58')]({'where':{'id':_0x32faca[_0x1a15('0x55')]['id']}})['then'](handleEntityNotFound(_0x2bda5f,null))[_0x1a15('0x20')](removeEntity(_0x2bda5f,null))['catch'](handleError(_0x2bda5f,null));};exports[_0x1a15('0x64')]=function(_0x51c980,_0x2e8589){return db[_0x1a15('0x3f')][_0x1a15('0x64')]()['then'](respondWithResult(_0x2e8589,null))[_0x1a15('0x62')](handleError(_0x2e8589,null));};exports[_0x1a15('0x65')]=function(_0x3f82e3,_0x1188e0,_0xae1d5f){if(_0x3f82e3[_0x1a15('0x5a')]['id']){delete _0x3f82e3[_0x1a15('0x5a')]['id'];}return db['OpenchannelAccount'][_0x1a15('0x58')]({'where':{'id':_0x3f82e3[_0x1a15('0x55')]['id']}})['then'](handleEntityNotFound(_0x1188e0,null))['then'](function(_0x3ea8dc){if(_0x3ea8dc){_0x3f82e3[_0x1a15('0x5a')][_0x1a15('0x66')]=_0x3ea8dc['id'];return db[_0x1a15('0x67')][_0x1a15('0x59')](_0x3f82e3[_0x1a15('0x5a')]);}})[_0x1a15('0x20')](respondWithResult(_0x1188e0,null))['catch'](handleError(_0x1188e0,null));};exports[_0x1a15('0x68')]=function(_0x33af94,_0x12b799,_0x32b93d){var _0x119a3b={'raw':![],'where':{}};var _0x507aba={};var _0x5ece2b={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x33af94[_0x1a15('0x55')]['id']}})['then'](handleEntityNotFound(_0x12b799,null))['then'](function(_0x1bdd02){if(_0x1bdd02){_0x507aba[_0x1a15('0x41')]=_[_0x1a15('0x43')](db['Disposition']['rawAttributes']);_0x507aba[_0x1a15('0x42')]=_[_0x1a15('0x43')](_0x33af94['query']);_0x507aba['filters']=_[_0x1a15('0x45')](_0x507aba['model'],_0x507aba[_0x1a15('0x42')]);_0x119a3b[_0x1a15('0x47')]=_[_0x1a15('0x45')](_0x507aba['model'],qs[_0x1a15('0x46')](_0x33af94[_0x1a15('0x42')][_0x1a15('0x46')]));_0x119a3b[_0x1a15('0x47')]=_0x119a3b[_0x1a15('0x47')][_0x1a15('0x48')]?_0x119a3b[_0x1a15('0x47')]:_0x507aba['model'];if(!_0x33af94[_0x1a15('0x42')][_0x1a15('0x49')](_0x1a15('0x69'))){_0x119a3b[_0x1a15('0x2b')]=qs[_0x1a15('0x2b')](_0x33af94[_0x1a15('0x42')][_0x1a15('0x2b')]);_0x119a3b[_0x1a15('0x2d')]=qs[_0x1a15('0x2d')](_0x33af94['query'][_0x1a15('0x2d')]);}_0x119a3b[_0x1a15('0x6a')]=qs[_0x1a15('0x4a')](_0x33af94[_0x1a15('0x42')][_0x1a15('0x4a')]);_0x119a3b[_0x1a15('0x4c')]=qs['filters'](_[_0x1a15('0x6b')](_0x33af94[_0x1a15('0x42')],_0x507aba[_0x1a15('0x44')]));_0x119a3b[_0x1a15('0x4c')]['OpenchannelAccountId']=_0x1bdd02['id'];if(_0x33af94[_0x1a15('0x42')][_0x1a15('0x4b')]){_0x119a3b[_0x1a15('0x4c')]=_[_0x1a15('0x4d')](_0x119a3b['where'],{'$or':_[_0x1a15('0x3e')](_0x119a3b[_0x1a15('0x47')],function(_0x3c2de2){var _0x48f892={};_0x48f892[_0x3c2de2]={'$like':'%'+_0x33af94[_0x1a15('0x42')][_0x1a15('0x4b')]+'%'};return _0x48f892;})});}_0x119a3b=_[_0x1a15('0x4d')]({},_0x119a3b,_0x33af94[_0x1a15('0x57')]);return db['Disposition']['count']({'where':_0x119a3b['where']})[_0x1a15('0x20')](function(_0x50eb0c){_0x5ece2b[_0x1a15('0x2c')]=_0x50eb0c;if(_0x33af94[_0x1a15('0x42')][_0x1a15('0x50')]){_0x119a3b[_0x1a15('0x51')]=[{'all':!![]}];}return db[_0x1a15('0x67')][_0x1a15('0x52')](_0x119a3b);})[_0x1a15('0x20')](function(_0x35193f){_0x5ece2b['rows']=_0x35193f;return _0x5ece2b;});}})['then'](respondWithFilteredResult(_0x12b799,_0x119a3b))['catch'](handleError(_0x12b799,null));};exports['removeDispositions']=function(_0x1e827e,_0x50466c,_0x3eb91d){return db[_0x1a15('0x3f')]['find']({'where':{'id':_0x1e827e[_0x1a15('0x55')]['id']}})['then'](handleEntityNotFound(_0x50466c,null))[_0x1a15('0x20')](function(_0x1c7737){if(_0x1c7737){return _0x1c7737[_0x1a15('0x6c')](_0x1e827e[_0x1a15('0x42')][_0x1a15('0x6d')]);}})[_0x1a15('0x20')](respondWithStatusCode(_0x50466c,null))[_0x1a15('0x62')](handleError(_0x50466c,null));};exports[_0x1a15('0x6e')]=function(_0x4daabc,_0x19434c,_0x41233d){if(_0x4daabc[_0x1a15('0x5a')]['id']){delete _0x4daabc[_0x1a15('0x5a')]['id'];}return db[_0x1a15('0x3f')]['find']({'where':{'id':_0x4daabc['params']['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x19434c,null))['then'](function(_0xa65aca){if(_0xa65aca){_0x4daabc['body'][_0x1a15('0x66')]=_0xa65aca['id'];return db[_0x1a15('0x6f')]['create'](_0x4daabc[_0x1a15('0x5a')]);}})[_0x1a15('0x20')](respondWithResult(_0x19434c,null))[_0x1a15('0x62')](handleError(_0x19434c,null));};exports['getAnswers']=function(_0x23276d,_0x180bc7,_0xf0ffc8){var _0x420886={'raw':![],'where':{}};var _0x58d173={};var _0x37472b={'count':0x0,'rows':[]};return db[_0x1a15('0x3f')]['findOne']({'where':{'id':_0x23276d['params']['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x180bc7,null))[_0x1a15('0x20')](function(_0x563515){if(_0x563515){_0x58d173['model']=_[_0x1a15('0x43')](db['CannedAnswer']['rawAttributes']);_0x58d173[_0x1a15('0x42')]=_[_0x1a15('0x43')](_0x23276d[_0x1a15('0x42')]);_0x58d173[_0x1a15('0x44')]=_[_0x1a15('0x45')](_0x58d173['model'],_0x58d173[_0x1a15('0x42')]);_0x420886[_0x1a15('0x47')]=_[_0x1a15('0x45')](_0x58d173[_0x1a15('0x41')],qs['fields'](_0x23276d[_0x1a15('0x42')][_0x1a15('0x46')]));_0x420886['attributes']=_0x420886[_0x1a15('0x47')][_0x1a15('0x48')]?_0x420886[_0x1a15('0x47')]:_0x58d173['model'];if(!_0x23276d[_0x1a15('0x42')][_0x1a15('0x49')](_0x1a15('0x69'))){_0x420886['limit']=qs[_0x1a15('0x2b')](_0x23276d['query'][_0x1a15('0x2b')]);_0x420886[_0x1a15('0x2d')]=qs[_0x1a15('0x2d')](_0x23276d[_0x1a15('0x42')]['offset']);}_0x420886['order']=qs[_0x1a15('0x4a')](_0x23276d[_0x1a15('0x42')][_0x1a15('0x4a')]);_0x420886['where']=qs[_0x1a15('0x44')](_['pick'](_0x23276d[_0x1a15('0x42')],_0x58d173[_0x1a15('0x44')]));_0x420886[_0x1a15('0x4c')][_0x1a15('0x66')]=_0x563515['id'];if(_0x23276d['query'][_0x1a15('0x4b')]){_0x420886[_0x1a15('0x4c')]=_[_0x1a15('0x4d')](_0x420886[_0x1a15('0x4c')],{'$or':_[_0x1a15('0x3e')](_0x420886[_0x1a15('0x47')],function(_0x1b5be1){var _0x4157bd={};_0x4157bd[_0x1b5be1]={'$like':'%'+_0x23276d[_0x1a15('0x42')][_0x1a15('0x4b')]+'%'};return _0x4157bd;})});}_0x420886=_[_0x1a15('0x4d')]({},_0x420886,_0x23276d['options']);return db[_0x1a15('0x6f')][_0x1a15('0x2c')]({'where':_0x420886[_0x1a15('0x4c')]})['then'](function(_0x300ee3){_0x37472b[_0x1a15('0x2c')]=_0x300ee3;if(_0x23276d['query'][_0x1a15('0x50')]){_0x420886['include']=[{'all':!![]}];}return db[_0x1a15('0x6f')][_0x1a15('0x52')](_0x420886);})[_0x1a15('0x20')](function(_0x2b1141){_0x37472b[_0x1a15('0x53')]=_0x2b1141;return _0x37472b;});}})['then'](respondWithFilteredResult(_0x180bc7,_0x420886))[_0x1a15('0x62')](handleError(_0x180bc7,null));};exports[_0x1a15('0x70')]=function(_0x3c461f,_0x10d041,_0x29bcf3){return db[_0x1a15('0x3f')][_0x1a15('0x58')]({'where':{'id':_0x3c461f['params']['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x10d041,null))[_0x1a15('0x20')](function(_0x2fa807){if(_0x2fa807){return _0x2fa807[_0x1a15('0x70')](_0x3c461f[_0x1a15('0x42')][_0x1a15('0x6d')]);}})[_0x1a15('0x20')](respondWithStatusCode(_0x10d041,null))[_0x1a15('0x62')](handleError(_0x10d041,null));};exports[_0x1a15('0x71')]=function(_0x20cc76,_0x5d3d05,_0x800388){var _0x2550d8={'body':_0x20cc76['body'],'channel':_0x1a15('0x72')};var _0x8ec42d=[];var _0x279102=[];var _0x256cf3={};var _0x36da52=![];return db[_0x1a15('0x73')][_0x1a15('0x64')]()[_0x1a15('0x20')](function(_0x104389){if(!_0x104389){throw new db[(_0x1a15('0x74'))][(_0x1a15('0x75'))]('no\x20available\x20attributes');}_0x8ec42d=_[_0x1a15('0x76')](_['keys'](_0x104389),['createdAt',_0x1a15('0x77')]);_0x279102=_[_0x1a15('0x76')](_[_0x1a15('0x43')](_0x104389),[_0x1a15('0x78'),_0x1a15('0x77'),_0x1a15('0x79'),_0x1a15('0x7a')]);if(_0x20cc76['body']['id']){delete _0x20cc76[_0x1a15('0x5a')]['id'];}if(_[_0x1a15('0x7b')](_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x7c')])){throw new db[(_0x1a15('0x74'))][(_0x1a15('0x75'))]('from\x20is\x20mandatory');}if(_[_0x1a15('0x7b')](_0x20cc76['body'][_0x1a15('0x5a')])||_0x20cc76['body']['body']===''){throw new db['Sequelize'][(_0x1a15('0x75'))](_0x1a15('0x7d'));}if(_[_0x1a15('0x7b')](_0x20cc76['body'][_0x1a15('0x7e')])){throw new db[(_0x1a15('0x74'))][(_0x1a15('0x75'))](_0x1a15('0x7f')+_0x279102);}if(!_[_0x1a15('0x80')](_0x279102,_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x7e')])){throw new db[(_0x1a15('0x74'))][(_0x1a15('0x75'))](_0x1a15('0x81')+_0x279102);}_0x256cf3[_0x20cc76[_0x1a15('0x5a')]['mapKey']]=_0x20cc76['body'][_0x1a15('0x7c')];})['then'](function(){return db[_0x1a15('0x3f')][_0x1a15('0x58')]({'where':{'id':_0x20cc76[_0x1a15('0x55')]['id']},'include':[{'model':db[_0x1a15('0x82')],'as':_0x1a15('0x83'),'include':[{'model':db['CmContact'],'as':_0x1a15('0x84'),'where':_0x256cf3,'limit':0x1,'order':[[_0x1a15('0x77'),_0x1a15('0x85')]]}]},{'model':db[_0x1a15('0x86')],'as':_0x1a15('0x87')}]});})[_0x1a15('0x20')](handleEntityNotFound(_0x5d3d05,null))[_0x1a15('0x20')](function(_0x5b0ccc){if(_0x5b0ccc&&_0x5b0ccc['List']){_0x2550d8[_0x1a15('0x88')]=_0x5b0ccc;_0x2550d8[_0x1a15('0x89')]=_0x5b0ccc[_0x1a15('0x87')];_0x2550d8[_0x1a15('0x8a')]=_0x5b0ccc[_0x1a15('0x83')];_0x2550d8[_0x1a15('0x89')]=_[_0x1a15('0x8b')](_0x2550d8[_0x1a15('0x89')],[_0x1a15('0x8c')],[_0x1a15('0x8d')]);if(_0x2550d8[_0x1a15('0x88')][_0x1a15('0x87')]){delete _0x2550d8['account'][_0x1a15('0x87')];}if(_0x2550d8[_0x1a15('0x88')]['List']&&_0x2550d8[_0x1a15('0x88')][_0x1a15('0x83')][_0x1a15('0x84')][_0x1a15('0x48')]){return _0x2550d8[_0x1a15('0x88')][_0x1a15('0x83')][_0x1a15('0x84')][0x0];}var _0x3cec04=_[_0x1a15('0x18')](_0x20cc76['body'],{'firstName':_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x7c')],'ListId':_0x5b0ccc[_0x1a15('0x7a')]});_0x3cec04[_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x7e')]]=_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x7c')];return db[_0x1a15('0x73')][_0x1a15('0x59')](_0x3cec04,{'fields':_0x8ec42d,'raw':!![]});}})[_0x1a15('0x20')](handleEntityNotFound(_0x5d3d05,null))['then'](function(_0x45764f){_0x2550d8[_0x1a15('0x8e')]=_0x45764f;if(_0x45764f){var _0x5f07a1={'ContactId':_0x45764f['id'],'OpenchannelAccountId':_0x20cc76[_0x1a15('0x55')]['id'],'from':(_0x45764f[_0x1a15('0x8f')]||'')+'\x20'+(_0x45764f[_0x1a15('0x90')]||'')};var _0x2453fb={'OpenchannelAccountId':_0x20cc76['params']['id'],'closed':![]};if(_0x20cc76['body'][_0x1a15('0x91')]){_0x2453fb[_0x1a15('0x91')]=_0x20cc76['body']['threadId'];return db[_0x1a15('0x92')][_0x1a15('0x58')]({'where':_0x2453fb})[_0x1a15('0x20')](function(_0x1c0922){if(_0x1c0922){return[_0x1c0922,![]];}_0x5f07a1[_0x1a15('0x91')]=_0x20cc76['body'][_0x1a15('0x91')];_0x5f07a1[_0x1a15('0x93')]=_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x93')];return db['OpenchannelInteraction'][_0x1a15('0x59')](_0x5f07a1)[_0x1a15('0x20')](function(_0x55a000){return[_0x55a000,!![]];});});}else{_0x2453fb[_0x1a15('0x91')]=null;}_0x2453fb[_0x1a15('0x94')]=_0x45764f['id'];return db[_0x1a15('0x92')]['find']({'where':_0x2453fb})[_0x1a15('0x20')](function(_0x1db514){if(_0x1db514){return[_0x1db514,![]];}return db['OpenchannelInteraction'][_0x1a15('0x59')](_0x5f07a1)[_0x1a15('0x20')](function(_0x182908){return[_0x182908,!![]];});});}})['spread'](function(_0x2b8227,_0x4b0975){if(_0x2b8227){_0x36da52=_0x4b0975;if(!_0x4b0975){var _0x241bb1={'from':(_0x2550d8[_0x1a15('0x8e')][_0x1a15('0x8f')]||'')+'\x20'+(_0x2550d8[_0x1a15('0x8e')][_0x1a15('0x90')]||'')};if(_0x20cc76['body'][_0x1a15('0x91')]&&_0x20cc76[_0x1a15('0x5a')]['messageId']&&_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x91')]!=_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x95')]){_0x241bb1['threadId']=_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x95')];}return _0x2b8227['update'](_0x241bb1);}else{return _0x2b8227;}}})[_0x1a15('0x20')](function(_0x10716f){_0x2550d8[_0x1a15('0x96')]=_0x10716f[_0x1a15('0x35')]({'plain':!![]});_0x2550d8['interaction'][_0x1a15('0x97')]=_0x36da52;if(_0x2550d8[_0x1a15('0x96')]['created']){if(_0x2550d8['account']['autoclose']){_0x2550d8[_0x1a15('0x89')]['push']({'id':0x0,'priority':_0x2550d8[_0x1a15('0x89')][_0x1a15('0x48')]+0x1,'app':_0x1a15('0x98'),'appdata':'unmanaged','interval':_0x1a15('0x99')});}}return db['OpenchannelMessage'][_0x1a15('0x59')]({'body':_0x20cc76[_0x1a15('0x5a')][_0x1a15('0x5a')],'OpenchannelAccountId':_0x20cc76[_0x1a15('0x55')]['id'],'OpenchannelInteractionId':_0x10716f['id'],'direction':'in','ContactId':_0x2550d8['contact']['id'],'AttachmentId':_0x20cc76[_0x1a15('0x5a')]['AttachmentId']});})[_0x1a15('0x20')](function(_0x1e2be3){_0x2550d8[_0x1a15('0x26')]=_0x1e2be3;if(!_0x2550d8[_0x1a15('0x96')][_0x1a15('0x9a')])return;return db[_0x1a15('0x9b')][_0x1a15('0x58')]({'attributes':['id',_0x1a15('0x39')],'where':{'id':_0x2550d8[_0x1a15('0x96')][_0x1a15('0x9a')]}});})[_0x1a15('0x20')](function(_0x575857){if(_0x575857){_0x2550d8['applications'][_0x1a15('0x9c')]({'id':0x0,'priority':0x0,'app':_0x1a15('0x9d'),'appdata':_0x575857[_0x1a15('0x39')]+','+(_0x2550d8[_0x1a15('0x88')][_0x1a15('0x9e')]||0xa),'interval':_0x1a15('0x99')});}if(!_0x2550d8[_0x1a15('0x96')][_0x1a15('0x9f')])return;return db['OpenchannelQueue'][_0x1a15('0x58')]({'attributes':['id',_0x1a15('0x39')],'where':{'id':_0x2550d8[_0x1a15('0x96')][_0x1a15('0x9f')]}});})['then'](function(_0x451af9){if(_0x451af9){_0x2550d8[_0x1a15('0x89')][_0x1a15('0x9c')]({'id':0x0,'priority':0x1,'app':_0x1a15('0xa0'),'appdata':_0x451af9['name']+','+(_0x2550d8[_0x1a15('0x88')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1a15('0xa1'),_0x1a15('0xa2'),_0x2550d8);})[_0x1a15('0x20')](function(_0x11fadc){respondWithRpcPromise(_0x1a15('0xa3'),_0x1a15('0xa3'),{'event':_0x1a15('0x71'),'message':_0x11fadc},client9002);return _0x11fadc;})[_0x1a15('0x20')](respondWithResult(_0x5d3d05,null))[_0x1a15('0x62')](handleError(_0x5d3d05,null));};exports[_0x1a15('0xa4')]=function(_0x337568,_0xe312bb){var _0x131238=_0x337568[_0x1a15('0x55')]['id'];var _0x6dc1e1=_0x337568[_0x1a15('0x5a')];var _0x1de5c9=0xc8;var _0x251d1e=null;return db[_0x1a15('0xa5')][_0x1a15('0xa6')]({'isolationLevel':db[_0x1a15('0xa5')]['Transaction'][_0x1a15('0xa7')][_0x1a15('0xa8')]},function(_0x2b9365){return db[_0x1a15('0x3f')][_0x1a15('0xa9')]({'where':{'id':_0x131238},'transaction':_0x2b9365})[_0x1a15('0x20')](function(_0x220f1b){if(_0x220f1b){return db[_0x1a15('0x86')][_0x1a15('0x34')]({'where':{'OpenchannelAccountId':_0x131238},'transaction':_0x2b9365})[_0x1a15('0x20')](function(){var _0x413bca=_[_0x1a15('0x3e')](_0x6dc1e1,function(_0x3c00b3){_0x3c00b3['OpenchannelAccountId']=_0x131238;return _0x3c00b3;});return db['OpenchannelApplication']['bulkCreate'](_0x413bca,{'transaction':_0x2b9365});});}else{_0x1de5c9=0x194;_0x251d1e=[];}});})[_0x1a15('0x20')](function(){if(_0x1de5c9!==0x194){return db['OpenchannelApplication'][_0x1a15('0xaa')]({'where':{'OpenchannelAccountId':_0x131238},'order':_0x1a15('0x8c')})[_0x1a15('0x20')](function(_0x26f372){_0x251d1e=_0x26f372;});}})[_0x1a15('0x62')](function(_0x39a19f){_0x1de5c9=0x1f4;logger['error'](_0x39a19f[_0x1a15('0x38')]);if(_0x39a19f[_0x1a15('0x39')]){delete _0x39a19f[_0x1a15('0x39')];}_0x251d1e=_0x39a19f;})[_0x1a15('0xab')](function(){if(_0x251d1e===null){_0xe312bb[_0x1a15('0x28')](_0x1de5c9);}else{if(_0x1de5c9===0x1f4){_0xe312bb['status'](_0x1de5c9)[_0x1a15('0x3a')](_0x251d1e);}else{_0xe312bb[_0x1a15('0x29')](_0x1de5c9)[_0x1a15('0x2f')](_0x251d1e);}}});};exports[_0x1a15('0xac')]=function(_0xa607d5,_0x2d3127,_0x128b04){var _0x16bfc4={};var _0x28cf92={};var _0x5e7cc6;var _0x4976f7;return db[_0x1a15('0x3f')]['findOne']({'where':{'id':_0xa607d5[_0x1a15('0x55')]['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x2d3127,null))[_0x1a15('0x20')](function(_0x919251){if(_0x919251){_0x5e7cc6=_0x919251;_0x28cf92['model']=_[_0x1a15('0x43')](db['OpenchannelApplication']['rawAttributes']);_0x28cf92[_0x1a15('0x42')]=_[_0x1a15('0x43')](_0xa607d5['query']);_0x28cf92[_0x1a15('0x44')]=_[_0x1a15('0x45')](_0x28cf92[_0x1a15('0x41')],_0x28cf92['query']);_0x16bfc4[_0x1a15('0x47')]=_[_0x1a15('0x45')](_0x28cf92[_0x1a15('0x41')],qs[_0x1a15('0x46')](_0xa607d5['query'][_0x1a15('0x46')]));_0x16bfc4[_0x1a15('0x47')]=_0x16bfc4[_0x1a15('0x47')][_0x1a15('0x48')]?_0x16bfc4[_0x1a15('0x47')]:_0x28cf92['model'];_0x16bfc4[_0x1a15('0x6a')]=qs[_0x1a15('0x4a')](_0xa607d5[_0x1a15('0x42')][_0x1a15('0x4a')]);_0x16bfc4['where']=qs[_0x1a15('0x44')](_[_0x1a15('0x6b')](_0xa607d5[_0x1a15('0x42')],_0x28cf92[_0x1a15('0x44')]));if(_0xa607d5[_0x1a15('0x42')][_0x1a15('0x4b')]){_0x16bfc4[_0x1a15('0x4c')]=_[_0x1a15('0x4d')](_0x16bfc4['where'],{'$or':_[_0x1a15('0x3e')](_0x16bfc4[_0x1a15('0x47')],function(_0x4c785f){var _0x326ba2={};_0x326ba2[_0x4c785f]={'$like':'%'+_0xa607d5[_0x1a15('0x42')][_0x1a15('0x4b')]+'%'};return _0x326ba2;})});}_0x16bfc4=_['merge']({},_0x16bfc4,_0xa607d5[_0x1a15('0x57')]);return _0x5e7cc6['getApplications'](_0x16bfc4);}})[_0x1a15('0x20')](function(_0x57e195){if(_0x57e195){_0x4976f7=_0x57e195['length'];if(!_0xa607d5['query']['hasOwnProperty'](_0x1a15('0x69'))){_0x16bfc4[_0x1a15('0x2b')]=qs[_0x1a15('0x2b')](_0xa607d5[_0x1a15('0x42')]['limit']);_0x16bfc4[_0x1a15('0x2d')]=qs['offset'](_0xa607d5[_0x1a15('0x42')]['offset']);}return _0x5e7cc6[_0x1a15('0xac')](_0x16bfc4);}})[_0x1a15('0x20')](function(_0x3367df){if(_0x3367df){return _0x3367df?{'count':_0x4976f7,'rows':_0x3367df}:null;}})[_0x1a15('0x20')](respondWithResult(_0x2d3127,null))['catch'](handleError(_0x2d3127,null));};exports['getInteractions']=function(_0x10fb5b,_0x47b7e5,_0x98a53b){var _0xd6081b={'raw':![],'where':{}};var _0x4c8853={};var _0x2fe412={'count':0x0,'rows':[]};return db[_0x1a15('0x3f')]['findOne']({'where':{'id':_0x10fb5b[_0x1a15('0x55')]['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x47b7e5,null))['then'](function(_0x1a6437){if(_0x1a6437){_0x4c8853[_0x1a15('0x41')]=_[_0x1a15('0x43')](db[_0x1a15('0x92')][_0x1a15('0x56')]);_0x4c8853[_0x1a15('0x42')]=_[_0x1a15('0x43')](_0x10fb5b[_0x1a15('0x42')]);_0x4c8853[_0x1a15('0x44')]=_[_0x1a15('0x45')](_0x4c8853['model'],_0x4c8853['query']);_0xd6081b[_0x1a15('0x47')]=_[_0x1a15('0x45')](_0x4c8853['model'],qs['fields'](_0x10fb5b[_0x1a15('0x42')][_0x1a15('0x46')]));_0xd6081b[_0x1a15('0x47')]=_0xd6081b[_0x1a15('0x47')]['length']?_0xd6081b[_0x1a15('0x47')]:_0x4c8853[_0x1a15('0x41')];if(!_0x10fb5b[_0x1a15('0x42')]['hasOwnProperty'](_0x1a15('0x69'))){_0xd6081b[_0x1a15('0x2b')]=qs[_0x1a15('0x2b')](_0x10fb5b[_0x1a15('0x42')][_0x1a15('0x2b')]);_0xd6081b[_0x1a15('0x2d')]=qs[_0x1a15('0x2d')](_0x10fb5b[_0x1a15('0x42')][_0x1a15('0x2d')]);}_0xd6081b[_0x1a15('0x6a')]=qs['sort'](_0x10fb5b['query']['sort']);_0xd6081b[_0x1a15('0x4c')]=qs[_0x1a15('0x44')](_[_0x1a15('0x6b')](_0x10fb5b[_0x1a15('0x42')],_0x4c8853['filters']));_0xd6081b[_0x1a15('0x4c')]['OpenchannelAccountId']=_0x1a6437['id'];if(_0x10fb5b[_0x1a15('0x42')][_0x1a15('0x4b')]){_0xd6081b[_0x1a15('0x4c')]=_[_0x1a15('0x4d')](_0xd6081b[_0x1a15('0x4c')],{'$or':_[_0x1a15('0x3e')](_0xd6081b[_0x1a15('0x47')],function(_0x49af39){var _0x55dc10={};_0x55dc10[_0x49af39]={'$like':'%'+_0x10fb5b[_0x1a15('0x42')][_0x1a15('0x4b')]+'%'};return _0x55dc10;})});}_0xd6081b=_['merge']({},_0xd6081b,_0x10fb5b[_0x1a15('0x57')]);return db[_0x1a15('0x92')][_0x1a15('0x2c')]({'where':_0xd6081b[_0x1a15('0x4c')]})[_0x1a15('0x20')](function(_0x105ae7){_0x2fe412['count']=_0x105ae7;if(_0x10fb5b[_0x1a15('0x42')][_0x1a15('0x50')]){_0xd6081b['include']=[{'model':db['CmContact'],'as':_0x1a15('0xad'),'required':![]},{'model':db[_0x1a15('0x9b')],'as':_0x1a15('0xae'),'attributes':[_0x1a15('0x39'),_0x1a15('0xaf'),_0x1a15('0xb0')],'required':![]},{'model':db[_0x1a15('0xb1')],'as':_0x1a15('0xb2'),'attributes':['id',_0x1a15('0x39'),_0x1a15('0xb3')],'where':_0x10fb5b['query'][_0x1a15('0xb4')]?{'id':_0x10fb5b['query'][_0x1a15('0xb4')]}:undefined,'required':_0x10fb5b[_0x1a15('0x42')]['tag']?!![]:![]}];}return db[_0x1a15('0x92')][_0x1a15('0x52')](_0xd6081b);})[_0x1a15('0x20')](function(_0x44434d){_0x2fe412[_0x1a15('0x53')]=_0x44434d;return _0x2fe412;});}})[_0x1a15('0x20')](respondWithFilteredResult(_0x47b7e5,_0xd6081b))[_0x1a15('0x62')](handleError(_0x47b7e5,null));};exports[_0x1a15('0xb5')]=function(_0x8999ef,_0x5a219f,_0x56a9d3){return db[_0x1a15('0x3f')][_0x1a15('0x58')]({'where':{'id':_0x8999ef[_0x1a15('0x55')]['id']}})['then'](handleEntityNotFound(_0x5a219f,null))[_0x1a15('0x20')](function(_0x302734){if(_0x302734){return _0x302734[_0x1a15('0xb5')](_0x8999ef[_0x1a15('0x5a')][_0x1a15('0x6d')],_[_0x1a15('0xb6')](_0x8999ef[_0x1a15('0x5a')],[_0x1a15('0x6d'),'id'])||{})[_0x1a15('0xb7')](function(_0x5ac37b){for(var _0x446c28=0x0;_0x446c28<_0x8999ef['body'][_0x1a15('0x6d')][_0x1a15('0x48')];_0x446c28+=0x1){socket[_0x1a15('0xb8')](_0x1a15('0xb9'),{'UserId':Number(_0x8999ef[_0x1a15('0x5a')][_0x1a15('0x6d')][_0x446c28]),'OpenchannelAccountId':Number(_0x8999ef[_0x1a15('0x55')]['id'])});}return _0x5ac37b;});}})['then'](respondWithResult(_0x5a219f,null))[_0x1a15('0x62')](handleError(_0x5a219f,null));};exports[_0x1a15('0xba')]=function(_0x166520,_0x15071d,_0x4ad108){return db[_0x1a15('0x3f')][_0x1a15('0x58')]({'where':{'id':_0x166520[_0x1a15('0x55')]['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x15071d,null))[_0x1a15('0x20')](function(_0x4098ef){if(_0x4098ef){return _0x4098ef[_0x1a15('0xba')](_0x166520[_0x1a15('0x42')][_0x1a15('0x6d')])[_0x1a15('0x20')](function(){if(_[_0x1a15('0xbb')](_0x166520[_0x1a15('0x42')]['ids'])){for(var _0x254fe7=0x0;_0x254fe7<_0x166520[_0x1a15('0x42')]['ids']['length'];_0x254fe7+=0x1){socket[_0x1a15('0xb8')](_0x1a15('0xbc'),{'UserId':Number(_0x166520['query'][_0x1a15('0x6d')][_0x254fe7]),'OpenchannelAccountId':Number(_0x166520[_0x1a15('0x55')]['id'])});}}else{socket[_0x1a15('0xb8')](_0x1a15('0xbc'),{'UserId':Number(_0x166520[_0x1a15('0x42')]['ids']),'OpenchannelAccountId':Number(_0x166520[_0x1a15('0x55')]['id'])});}});}})[_0x1a15('0x20')](respondWithStatusCode(_0x15071d,null))['catch'](handleError(_0x15071d,null));};exports[_0x1a15('0xbd')]=function(_0x506e76,_0x335d9c,_0x4477fe){var _0x33237b={};var _0x49e9d0={};var _0x165a37;var _0x54b211;return db[_0x1a15('0x3f')][_0x1a15('0xa9')]({'where':{'id':_0x506e76[_0x1a15('0x55')]['id']}})['then'](handleEntityNotFound(_0x335d9c,null))['then'](function(_0x263108){if(_0x263108){_0x165a37=_0x263108;_0x49e9d0[_0x1a15('0x41')]=_['keys'](db[_0x1a15('0x9b')][_0x1a15('0x56')]);_0x49e9d0[_0x1a15('0x42')]=_['keys'](_0x506e76[_0x1a15('0x42')]);_0x49e9d0[_0x1a15('0x44')]=_[_0x1a15('0x45')](_0x49e9d0[_0x1a15('0x41')],_0x49e9d0[_0x1a15('0x42')]);_0x33237b[_0x1a15('0x47')]=_['intersection'](_0x49e9d0[_0x1a15('0x41')],qs[_0x1a15('0x46')](_0x506e76[_0x1a15('0x42')][_0x1a15('0x46')]));_0x33237b['attributes']=_0x33237b[_0x1a15('0x47')][_0x1a15('0x48')]?_0x33237b[_0x1a15('0x47')]:_0x49e9d0[_0x1a15('0x41')];_0x33237b['order']=qs[_0x1a15('0x4a')](_0x506e76[_0x1a15('0x42')][_0x1a15('0x4a')]);_0x33237b[_0x1a15('0x4c')]=qs[_0x1a15('0x44')](_[_0x1a15('0x6b')](_0x506e76['query'],_0x49e9d0['filters']));if(_0x506e76[_0x1a15('0x42')][_0x1a15('0x4b')]){_0x33237b[_0x1a15('0x4c')]=_['merge'](_0x33237b[_0x1a15('0x4c')],{'$or':_['map'](_0x33237b[_0x1a15('0x47')],function(_0x349f6f){var _0xcd2392={};_0xcd2392[_0x349f6f]={'$like':'%'+_0x506e76['query'][_0x1a15('0x4b')]+'%'};return _0xcd2392;})});}_0x33237b=_[_0x1a15('0x4d')]({},_0x33237b,_0x506e76[_0x1a15('0x57')]);return _0x165a37[_0x1a15('0xbd')](_0x33237b);}})[_0x1a15('0x20')](function(_0x34fad4){if(_0x34fad4){_0x54b211=_0x34fad4['length'];if(!_0x506e76[_0x1a15('0x42')][_0x1a15('0x49')]('nolimit')){_0x33237b['limit']=qs[_0x1a15('0x2b')](_0x506e76[_0x1a15('0x42')][_0x1a15('0x2b')]);_0x33237b['offset']=qs[_0x1a15('0x2d')](_0x506e76[_0x1a15('0x42')][_0x1a15('0x2d')]);}return _0x165a37[_0x1a15('0xbd')](_0x33237b);}})[_0x1a15('0x20')](function(_0x29effc){if(_0x29effc){return _0x29effc?{'count':_0x54b211,'rows':_0x29effc}:null;}})[_0x1a15('0x20')](respondWithResult(_0x335d9c,null))[_0x1a15('0x62')](handleError(_0x335d9c,null));};exports[_0x1a15('0x3a')]=function(_0x951d16,_0x319eff,_0x30a4a4){var _0x2866a5,_0x651e96,_0x5ed1b0;if(_[_0x1a15('0x7b')](_0x951d16['body'][_0x1a15('0x5a')])||_0x951d16[_0x1a15('0x5a')][_0x1a15('0x5a')]===''){throw new db[(_0x1a15('0x74'))][(_0x1a15('0x75'))](_0x1a15('0x7d'));}if(_['isNil'](_0x951d16[_0x1a15('0x5a')]['to'])){}_0x2866a5=_0x951d16[_0x1a15('0x5a')]['to'];return db[_0x1a15('0x3f')][_0x1a15('0xa9')]({'where':{'id':_0x951d16['params']['id']}})[_0x1a15('0x20')](handleEntityNotFound(_0x319eff,null))[_0x1a15('0x20')](function(_0x51baa5){if(_0x51baa5){return db[_0x1a15('0x3f')]['find']({'where':{'id':_0x51baa5['id']},'include':[{'model':db[_0x1a15('0x82')],'as':_0x1a15('0x83'),'include':[{'model':db['CmContact'],'as':_0x1a15('0x84'),'where':{[_0x51baa5[_0x1a15('0x7e')]]:_0x2866a5},'limit':0x1,'order':[[_0x1a15('0x77'),_0x1a15('0x85')]]}]}]})[_0x1a15('0x20')](handleEntityNotFound(_0x319eff,null))[_0x1a15('0x20')](function(_0x39fd2f){if(_0x39fd2f&&_0x39fd2f[_0x1a15('0x83')]){_0x651e96=_0x39fd2f[_0x1a15('0x35')]({'plain':!![]});if(_0x651e96[_0x1a15('0x83')]&&_0x651e96[_0x1a15('0x83')][_0x1a15('0x84')][_0x1a15('0x48')]){return _0x651e96[_0x1a15('0x83')]['Contacts'][0x0];}return db[_0x1a15('0x73')][_0x1a15('0x59')](_[_0x1a15('0x18')](_0x951d16[_0x1a15('0x5a')],{'firstName':_0x2866a5,[_0x39fd2f['mapKey']]:_0x2866a5,'phone':_0x2866a5,'ListId':_0x651e96[_0x1a15('0x7a')]}));}})['then'](handleEntityNotFound(_0x319eff,null))[_0x1a15('0x20')](function(_0x20cd6c){if(_0x20cd6c){_0x5ed1b0=_0x20cd6c;return db['OpenchannelInteraction'][_0x1a15('0x58')]({'where':{'ContactId':_0x5ed1b0['id'],'closed':![],'OpenchannelAccountId':_0x651e96['id']}})[_0x1a15('0x20')](function(_0x407ff3){if(_0x407ff3){return[_0x407ff3,![]];}return db[_0x1a15('0x92')]['create']({'UserId':_0x951d16[_0x1a15('0x5b')]['id'],'ContactId':_0x5ed1b0['id'],'OpenchannelAccountId':_0x651e96['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_['merge'](_0x951d16[_0x1a15('0x5a')],{'read':![],'body':_0x951d16['body'][_0x1a15('0x5a')],'OpenchannelAccountId':_0x651e96['id'],'UserId':_0x951d16['user']['id'],'ContactId':_0x5ed1b0['id']})]},{'include':[{'model':db[_0x1a15('0xbe')],'as':_0x1a15('0xbf')}]})['then'](function(_0x1735fa){return[_0x1735fa,!![]];});});}})[_0x1a15('0xb7')](function(_0x4eb0c8,_0x4b3ab0){if(_0x4b3ab0){return _0x4eb0c8;}return db[_0x1a15('0xbe')][_0x1a15('0x59')](_[_0x1a15('0x4d')](_0x951d16[_0x1a15('0x5a')],{'read':![],'body':_0x951d16[_0x1a15('0x5a')][_0x1a15('0x5a')],'OpenchannelAccountId':_0x651e96['id'],'OpenchannelInteractionId':_0x4eb0c8['id'],'UserId':_0x951d16[_0x1a15('0x5b')]['id'],'ContactId':_0x5ed1b0['id']}))[_0x1a15('0x20')](function(_0x1ca23f){_0x4eb0c8[_0x1a15('0xc0')]['Messages']=[];_0x4eb0c8['dataValues'][_0x1a15('0xbf')][_0x1a15('0xc1')](_0x1ca23f[_0x1a15('0xc0')]);return _0x4eb0c8;});});}})[_0x1a15('0x20')](respondWithResult(_0x319eff,null))[_0x1a15('0x62')](handleError(_0x319eff,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c483dc1..65d8bb3 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 _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x0bb5,0x148));var _0x50bb=function(_0x36a0e4,_0xf4701e){_0x36a0e4=_0x36a0e4-0x0;var _0x592b63=_0x0bb5[_0x36a0e4];return _0x592b63;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x0bb5,0x148));var _0x50bb=function(_0x349503,_0x501140){_0x349503=_0x349503-0x0;var _0x1f5890=_0x0bb5[_0x349503];return _0x1f5890;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 36e027e..1e6393a 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(_0x133a41,_0x24b082){var _0x2f9691=function(_0x1a78a2){while(--_0x1a78a2){_0x133a41['push'](_0x133a41['shift']());}};_0x2f9691(++_0x24b082);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x4aa64a,_0x42e726){var _0x29badc=function(_0x2529cf){while(--_0x2529cf){_0x4aa64a['push'](_0x4aa64a['shift']());}};_0x29badc(++_0x42e726);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 3ebf5cd..c385f77 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 _0x235a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x235a,0x1ef));var _0xa235=function(_0x3ba6fa,_0x1a017c){_0x3ba6fa=_0x3ba6fa-0x0;var _0x286c65=_0x235a[_0x3ba6fa];return _0x286c65;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var moment=require(_0xa235('0x2'));var BPromise=require('bluebird');var rs=require(_0xa235('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa235('0x4'))['db'];var utils=require(_0xa235('0x5'));var logger=require(_0xa235('0x6'))(_0xa235('0x7'));var config=require(_0xa235('0x8'));var jayson=require(_0xa235('0x9'));var client=jayson[_0xa235('0xa')][_0xa235('0xb')]({'port':0x232a});config['redis']=_[_0xa235('0xc')](config[_0xa235('0xd')],{'host':_0xa235('0xe'),'port':0x18eb});var socket=require(_0xa235('0xf'))(new Redis(config['redis']));require(_0xa235('0x10'))['register'](socket);function respondWithRpcPromise(_0x560eb1,_0x10bb4f,_0x504b60){return new BPromise(function(_0xbde1c7,_0x535bb9){return client['request'](_0x560eb1,_0x504b60)['then'](function(_0x464a85){logger[_0xa235('0x11')](_0xa235('0x12'),_0x10bb4f,_0xa235('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x10bb4f,'request\x20sent',JSON[_0xa235('0x14')](_0x464a85));if(_0x464a85[_0xa235('0x15')]){if(_0x464a85[_0xa235('0x15')][_0xa235('0x16')]===0x1f4){logger[_0xa235('0x15')](_0xa235('0x12'),_0x10bb4f,_0x464a85[_0xa235('0x15')][_0xa235('0x17')]);return _0x535bb9(_0x464a85[_0xa235('0x15')]['message']);}logger[_0xa235('0x15')](_0xa235('0x12'),_0x10bb4f,_0x464a85[_0xa235('0x15')][_0xa235('0x17')]);return _0xbde1c7(_0x464a85[_0xa235('0x15')][_0xa235('0x17')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x10bb4f,_0xa235('0x13'));_0xbde1c7(_0x464a85[_0xa235('0x18')][_0xa235('0x17')]);}})['catch'](function(_0x40b4a9){logger[_0xa235('0x15')](_0xa235('0x12'),_0x10bb4f,_0x40b4a9);_0x535bb9(_0x40b4a9);});});} \ No newline at end of file +var _0xd139=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','register','request','then','request\x20sent'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0xd139,0x14e));var _0x9d13=function(_0x314d99,_0xb8c0df){_0x314d99=_0x314d99-0x0;var _0x31d8c4=_0xd139[_0x314d99];return _0x31d8c4;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});config['redis']=_[_0x9d13('0xb')](config['redis'],{'host':_0x9d13('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x9d13('0xd')](socket);function respondWithRpcPromise(_0xba5caa,_0x41eef2,_0x51ac36){return new BPromise(function(_0x135232,_0x5aa0c8){return client[_0x9d13('0xe')](_0xba5caa,_0x51ac36)[_0x9d13('0xf')](function(_0x43a3cc){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x41eef2,_0x9d13('0x10'));logger[_0x9d13('0x11')](_0x9d13('0x12'),_0x41eef2,_0x9d13('0x10'),JSON[_0x9d13('0x13')](_0x43a3cc));if(_0x43a3cc['error']){if(_0x43a3cc['error'][_0x9d13('0x14')]===0x1f4){logger[_0x9d13('0x15')](_0x9d13('0x16'),_0x41eef2,_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);return _0x5aa0c8(_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);}logger['error'](_0x9d13('0x16'),_0x41eef2,_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);return _0x135232(_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);}else{logger[_0x9d13('0x18')](_0x9d13('0x16'),_0x41eef2,_0x9d13('0x10'));_0x135232(_0x43a3cc[_0x9d13('0x19')][_0x9d13('0x17')]);}})[_0x9d13('0x1a')](function(_0x38acaf){logger[_0x9d13('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x41eef2,_0x38acaf);_0x5aa0c8(_0x38acaf);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 18cccb5..13d98ee 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 _0xb469=['./openchannelAccount.events','save','remove','update','register'];(function(_0xcfbfc5,_0x286d8e){var _0xfe7d0a=function(_0x134568){while(--_0x134568){_0xcfbfc5['push'](_0xcfbfc5['shift']());}};_0xfe7d0a(++_0x286d8e);}(_0xb469,0x13b));var _0x9b46=function(_0x41ca16,_0x49a057){_0x41ca16=_0x41ca16-0x0;var _0x205138=_0xb469[_0x41ca16];return _0x205138;};'use strict';var OpenchannelAccountEvents=require(_0x9b46('0x0'));var events=[_0x9b46('0x1'),_0x9b46('0x2'),_0x9b46('0x3')];function createListener(_0x1a41e8,_0x895347){return function(_0x9212ae){_0x895347['emit'](_0x1a41e8,_0x9212ae);};}function removeListener(_0x31f853,_0x45322f){return function(){OpenchannelAccountEvents['removeListener'](_0x31f853,_0x45322f);};}exports[_0x9b46('0x4')]=function(_0x405d1c){for(var _0x50b49e=0x0,_0x1b2dd3=events['length'];_0x50b49e<_0x1b2dd3;_0x50b49e++){var _0x4c1ed9=events[_0x50b49e];var _0x34c0de=createListener('openchannelAccount:'+_0x4c1ed9,_0x405d1c);OpenchannelAccountEvents['on'](_0x4c1ed9,_0x34c0de);}}; \ No newline at end of file +var _0x6c6f=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x40b5c9,_0x27967a){var _0x274fd7=function(_0x3c3478){while(--_0x3c3478){_0x40b5c9['push'](_0x40b5c9['shift']());}};_0x274fd7(++_0x27967a);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x575b69,_0x5aafe6){_0x575b69=_0x575b69-0x0;var _0x49c613=_0x6c6f[_0x575b69];return _0x49c613;};'use strict';var OpenchannelAccountEvents=require(_0xf6c6('0x0'));var events=[_0xf6c6('0x1'),_0xf6c6('0x2'),_0xf6c6('0x3')];function createListener(_0x2f571d,_0x3c8fc3){return function(_0x332916){_0x3c8fc3[_0xf6c6('0x4')](_0x2f571d,_0x332916);};}function removeListener(_0x36fcd2,_0xa1183){return function(){OpenchannelAccountEvents[_0xf6c6('0x5')](_0x36fcd2,_0xa1183);};}exports['register']=function(_0x3b4e7b){for(var _0x4f8e34=0x0,_0x4c27f8=events[_0xf6c6('0x6')];_0x4f8e34<_0x4c27f8;_0x4f8e34++){var _0x5b34df=events[_0x4f8e34];var _0x308c42=createListener(_0xf6c6('0x7')+_0x5b34df,_0x3b4e7b);OpenchannelAccountEvents['on'](_0x5b34df,_0x308c42);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e008202..7386e45 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 _0x94a5=['show','post','create','put','destroy','exports','path','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x94a5,0x166));var _0x594a=function(_0x3ddba3,_0x11bb39){_0x3ddba3=_0x3ddba3-0x0;var _0x4adb62=_0x94a5[_0x3ddba3];return _0x4adb62;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x594a('0x0'));var timeout=require('connect-timeout');var express=require(_0x594a('0x1'));var router=express['Router']();var fs_extra=require(_0x594a('0x2'));var auth=require(_0x594a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x594a('0x4'));var controller=require(_0x594a('0x5'));router[_0x594a('0x6')]('/',auth[_0x594a('0x7')](),controller[_0x594a('0x8')]);router[_0x594a('0x6')](_0x594a('0x9'),auth[_0x594a('0x7')](),controller[_0x594a('0xa')]);router[_0x594a('0xb')]('/',auth[_0x594a('0x7')](),controller[_0x594a('0xc')]);router[_0x594a('0xd')](_0x594a('0x9'),auth[_0x594a('0x7')](),controller['update']);router['delete']('/:id',auth[_0x594a('0x7')](),controller[_0x594a('0xe')]);module[_0x594a('0xf')]=router; \ No newline at end of file +var _0x1a4d=['isAuthenticated','put','update','delete','/:id','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','index'];(function(_0x5a4ce5,_0x3bd5ec){var _0x138680=function(_0x3211de){while(--_0x3211de){_0x5a4ce5['push'](_0x5a4ce5['shift']());}};_0x138680(++_0x3bd5ec);}(_0x1a4d,0x137));var _0xd1a4=function(_0x161a4c,_0x59039e){_0x161a4c=_0x161a4c-0x0;var _0x5d5770=_0x1a4d[_0x161a4c];return _0x5d5770;};'use strict';var multer=require(_0xd1a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd1a4('0x1'));var express=require('express');var router=express[_0xd1a4('0x2')]();var fs_extra=require(_0xd1a4('0x3'));var auth=require(_0xd1a4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd1a4('0x5'));var controller=require(_0xd1a4('0x6'));router[_0xd1a4('0x7')]('/',auth['isAuthenticated'](),controller[_0xd1a4('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd1a4('0x9')](),controller['create']);router[_0xd1a4('0xa')]('/:id',auth[_0xd1a4('0x9')](),controller[_0xd1a4('0xb')]);router[_0xd1a4('0xc')](_0xd1a4('0xd'),auth[_0xd1a4('0x9')](),controller[_0xd1a4('0xe')]);module[_0xd1a4('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 389f99a..109a042 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 _0x11ac=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x3bbca7,_0xfd6f0){var _0xf16da4=function(_0x2de0a2){while(--_0x2de0a2){_0x3bbca7['push'](_0x3bbca7['shift']());}};_0xf16da4(++_0xfd6f0);}(_0x11ac,0x6a));var _0xc11a=function(_0xa5729b,_0x3fc571){_0xa5729b=_0xa5729b-0x0;var _0x2e1135=_0x11ac[_0xa5729b];return _0x2e1135;};'use strict';var Sequelize=require(_0xc11a('0x0'));module[_0xc11a('0x1')]={'priority':{'type':Sequelize[_0xc11a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc11a('0x3')],'allowNull':![],'defaultValue':_0xc11a('0x4')},'appdata':{'type':Sequelize[_0xc11a('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x97f9=['sequelize','exports','INTEGER','STRING'];(function(_0x3c8f26,_0x453699){var _0x5a4dd7=function(_0xd5c4b9){while(--_0xd5c4b9){_0x3c8f26['push'](_0x3c8f26['shift']());}};_0x5a4dd7(++_0x453699);}(_0x97f9,0x1d8));var _0x997f=function(_0x33765c,_0x3f81ac){_0x33765c=_0x33765c-0x0;var _0x2c10ad=_0x97f9[_0x33765c];return _0x2c10ad;};'use strict';var Sequelize=require(_0x997f('0x0'));module[_0x997f('0x1')]={'priority':{'type':Sequelize[_0x997f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x997f('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x997f('0x3')]},'interval':{'type':Sequelize[_0x997f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 359d673..d14ee9b 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 _0x4518=['stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x4f2a73,_0x1da17d){var _0x4f1466=function(_0x21f84b){while(--_0x21f84b){_0x4f2a73['push'](_0x4f2a73['shift']());}};_0x4f1466(++_0x1da17d);}(_0x4518,0x6b));var _0x8451=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x4518[_0x2074db];return _0x27324c;};'use strict';var emlformat=require(_0x8451('0x0'));var rimraf=require(_0x8451('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8451('0x2'));var rp=require(_0x8451('0x3'));var moment=require(_0x8451('0x4'));var BPromise=require(_0x8451('0x5'));var Mustache=require(_0x8451('0x6'));var util=require('util');var path=require(_0x8451('0x7'));var sox=require('sox');var csv=require(_0x8451('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8451('0x9'));var crypto=require('crypto');var jsforce=require(_0x8451('0xa'));var deskjs=require(_0x8451('0xb'));var toCsv=require(_0x8451('0x8'));var querystring=require(_0x8451('0xc'));var Papa=require(_0x8451('0xd'));var Redis=require(_0x8451('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8451('0xf'))(_0x8451('0x10'));var utils=require(_0x8451('0x11'));var config=require(_0x8451('0x12'));var licenseUtil=require(_0x8451('0x13'));var db=require(_0x8451('0x14'))['db'];function respondWithStatusCode(_0x3a2048,_0x30ca95){_0x30ca95=_0x30ca95||0xcc;return function(_0x49b959){if(_0x49b959){return _0x3a2048['sendStatus'](_0x30ca95);}return _0x3a2048[_0x8451('0x15')](_0x30ca95)[_0x8451('0x16')]();};}function respondWithResult(_0x23bb44,_0x4508ef){_0x4508ef=_0x4508ef||0xc8;return function(_0x1109db){if(_0x1109db){return _0x23bb44[_0x8451('0x15')](_0x4508ef)[_0x8451('0x17')](_0x1109db);}};}function respondWithFilteredResult(_0x4dbe8e,_0x184cb5){return function(_0x5451f5){if(_0x5451f5){var _0x59eb66=typeof _0x184cb5['offset']===_0x8451('0x18')&&typeof _0x184cb5[_0x8451('0x19')]===_0x8451('0x18');var _0x234923=_0x5451f5['count'];var _0x1c6811=_0x59eb66?0x0:_0x184cb5['offset'];var _0x17ce14=_0x59eb66?_0x5451f5['count']:_0x184cb5['offset']+_0x184cb5[_0x8451('0x19')];var _0x422ac8;if(_0x17ce14>=_0x234923){_0x17ce14=_0x234923;_0x422ac8=0xc8;}else{_0x422ac8=0xce;}_0x4dbe8e['status'](_0x422ac8);return _0x4dbe8e[_0x8451('0x1a')](_0x8451('0x1b'),_0x1c6811+'-'+_0x17ce14+'/'+_0x234923)['json'](_0x5451f5);}return null;};}function patchUpdates(_0x1f4758){return function(_0x597105){try{jsonpatch[_0x8451('0x1c')](_0x597105,_0x1f4758,!![]);}catch(_0x220ba6){return BPromise[_0x8451('0x1d')](_0x220ba6);}return _0x597105['save']();};}function saveUpdates(_0x4ac30f,_0x4cbbd0){return function(_0x166099){if(_0x166099){return _0x166099[_0x8451('0x1e')](_0x4ac30f)[_0x8451('0x1f')](function(_0xba4449){return _0xba4449;});}return null;};}function removeEntity(_0x386c82,_0x573f23){return function(_0x2b3516){if(_0x2b3516){return _0x2b3516[_0x8451('0x20')]()[_0x8451('0x1f')](function(){_0x386c82[_0x8451('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a366,_0x139a39){return function(_0xe20706){if(!_0xe20706){_0x39a366[_0x8451('0x21')](0x194);}return _0xe20706;};}function handleError(_0x12a8f4,_0x5ec030){_0x5ec030=_0x5ec030||0x1f4;return function(_0x22836f){logger[_0x8451('0x22')](_0x22836f[_0x8451('0x23')]);if(_0x22836f[_0x8451('0x24')]){delete _0x22836f[_0x8451('0x24')];}_0x12a8f4[_0x8451('0x15')](_0x5ec030)[_0x8451('0x25')](_0x22836f);};}exports[_0x8451('0x26')]=function(_0x44671e,_0x28e79f){var _0x459897={},_0x5cce03={},_0x503cbd={'count':0x0,'rows':[]};var _0x58fdd0=_[_0x8451('0x27')](db[_0x8451('0x28')][_0x8451('0x29')],function(_0x2c786e){return{'name':_0x2c786e[_0x8451('0x2a')],'type':_0x2c786e[_0x8451('0x2b')]['key']};});_0x5cce03[_0x8451('0x2c')]=_['map'](_0x58fdd0,'name');_0x5cce03[_0x8451('0x2d')]=_[_0x8451('0x2e')](_0x44671e['query']);_0x5cce03[_0x8451('0x2f')]=_[_0x8451('0x30')](_0x5cce03['model'],_0x5cce03['query']);_0x459897[_0x8451('0x31')]=_[_0x8451('0x30')](_0x5cce03[_0x8451('0x2c')],qs['fields'](_0x44671e['query'][_0x8451('0x32')]));_0x459897[_0x8451('0x31')]=_0x459897['attributes']['length']?_0x459897['attributes']:_0x5cce03[_0x8451('0x2c')];if(!_0x44671e['query'][_0x8451('0x33')](_0x8451('0x34'))){_0x459897['limit']=qs[_0x8451('0x19')](_0x44671e[_0x8451('0x2d')][_0x8451('0x19')]);_0x459897['offset']=qs[_0x8451('0x35')](_0x44671e[_0x8451('0x2d')][_0x8451('0x35')]);}_0x459897[_0x8451('0x36')]=qs[_0x8451('0x37')](_0x44671e['query'][_0x8451('0x37')]);_0x459897[_0x8451('0x38')]=qs[_0x8451('0x2f')](_[_0x8451('0x39')](_0x44671e['query'],_0x5cce03[_0x8451('0x2f')]),_0x58fdd0);if(_0x44671e[_0x8451('0x2d')][_0x8451('0x3a')]){_0x459897['where']=_[_0x8451('0x3b')](_0x459897['where'],{'$or':_[_0x8451('0x27')](_0x58fdd0,function(_0x2991d1){if(_0x2991d1[_0x8451('0x2b')]!=='VIRTUAL'){var _0x3aed1c={};_0x3aed1c[_0x2991d1[_0x8451('0x24')]]={'$like':'%'+_0x44671e[_0x8451('0x2d')][_0x8451('0x3a')]+'%'};return _0x3aed1c;}})});}_0x459897=_['merge']({},_0x459897,_0x44671e[_0x8451('0x3c')]);var _0x20f23b={'where':_0x459897['where']};return db[_0x8451('0x28')]['count'](_0x20f23b)['then'](function(_0x31c677){_0x503cbd[_0x8451('0x3d')]=_0x31c677;if(_0x44671e[_0x8451('0x2d')]['includeAll']){_0x459897[_0x8451('0x3e')]=[{'all':!![]}];}return db[_0x8451('0x28')][_0x8451('0x3f')](_0x459897);})[_0x8451('0x1f')](function(_0x2b3b11){_0x503cbd[_0x8451('0x40')]=_0x2b3b11;return _0x503cbd;})['then'](respondWithFilteredResult(_0x28e79f,_0x459897))[_0x8451('0x41')](handleError(_0x28e79f,null));};exports['show']=function(_0x45af2b,_0x28d8e6){var _0x19af0f={'raw':!![],'where':{'id':_0x45af2b[_0x8451('0x42')]['id']}},_0x303b95={};_0x303b95['model']=_['keys'](db[_0x8451('0x28')][_0x8451('0x29')]);_0x303b95[_0x8451('0x2d')]=_[_0x8451('0x2e')](_0x45af2b[_0x8451('0x2d')]);_0x303b95[_0x8451('0x2f')]=_[_0x8451('0x30')](_0x303b95[_0x8451('0x2c')],_0x303b95[_0x8451('0x2d')]);_0x19af0f[_0x8451('0x31')]=_[_0x8451('0x30')](_0x303b95[_0x8451('0x2c')],qs[_0x8451('0x32')](_0x45af2b[_0x8451('0x2d')]['fields']));_0x19af0f['attributes']=_0x19af0f[_0x8451('0x31')][_0x8451('0x43')]?_0x19af0f[_0x8451('0x31')]:_0x303b95[_0x8451('0x2c')];if(_0x45af2b[_0x8451('0x2d')]['includeAll']){_0x19af0f[_0x8451('0x3e')]=[{'all':!![]}];}_0x19af0f=_['merge']({},_0x19af0f,_0x45af2b[_0x8451('0x3c')]);return db[_0x8451('0x28')][_0x8451('0x44')](_0x19af0f)[_0x8451('0x1f')](handleEntityNotFound(_0x28d8e6,null))[_0x8451('0x1f')](respondWithResult(_0x28d8e6,null))['catch'](handleError(_0x28d8e6,null));};exports[_0x8451('0x45')]=function(_0x100fbe,_0x2629e7){return db[_0x8451('0x28')][_0x8451('0x45')](_0x100fbe[_0x8451('0x46')],{})[_0x8451('0x1f')](respondWithResult(_0x2629e7,0xc9))[_0x8451('0x41')](handleError(_0x2629e7,null));};exports[_0x8451('0x1e')]=function(_0x38c5f5,_0x41c56a){if(_0x38c5f5[_0x8451('0x46')]['id']){delete _0x38c5f5[_0x8451('0x46')]['id'];}return db[_0x8451('0x28')][_0x8451('0x44')]({'where':{'id':_0x38c5f5[_0x8451('0x42')]['id']}})[_0x8451('0x1f')](handleEntityNotFound(_0x41c56a,null))[_0x8451('0x1f')](saveUpdates(_0x38c5f5[_0x8451('0x46')],null))[_0x8451('0x1f')](respondWithResult(_0x41c56a,null))[_0x8451('0x41')](handleError(_0x41c56a,null));};exports[_0x8451('0x20')]=function(_0x54838d,_0x2ead74){return db[_0x8451('0x28')]['find']({'where':{'id':_0x54838d[_0x8451('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ead74,null))[_0x8451('0x1f')](removeEntity(_0x2ead74,null))[_0x8451('0x41')](handleError(_0x2ead74,null));}; \ No newline at end of file +var _0x381b=['map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x8bab57,_0x3c21a0){var _0x305a68=function(_0x5b565a){while(--_0x5b565a){_0x8bab57['push'](_0x8bab57['shift']());}};_0x305a68(++_0x3c21a0);}(_0x381b,0xfe));var _0xb381=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0x381b[_0x1ac6e5];return _0x5877dc;};'use strict';var emlformat=require(_0xb381('0x0'));var rimraf=require(_0xb381('0x1'));var zipdir=require(_0xb381('0x2'));var jsonpatch=require(_0xb381('0x3'));var rp=require(_0xb381('0x4'));var moment=require(_0xb381('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb381('0x6'));var util=require(_0xb381('0x7'));var path=require(_0xb381('0x8'));var sox=require('sox');var csv=require(_0xb381('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb381('0xa'));var _=require(_0xb381('0xb'));var squel=require(_0xb381('0xc'));var crypto=require(_0xb381('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb381('0xe'));var toCsv=require(_0xb381('0x9'));var querystring=require(_0xb381('0xf'));var Papa=require(_0xb381('0x10'));var Redis=require(_0xb381('0x11'));var authService=require(_0xb381('0x12'));var qs=require(_0xb381('0x13'));var as=require(_0xb381('0x14'));var hardwareService=require(_0xb381('0x15'));var logger=require('../../config/logger')(_0xb381('0x16'));var utils=require(_0xb381('0x17'));var config=require(_0xb381('0x18'));var licenseUtil=require(_0xb381('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c7bbb,_0x39b79d){_0x39b79d=_0x39b79d||0xcc;return function(_0x551896){if(_0x551896){return _0x2c7bbb['sendStatus'](_0x39b79d);}return _0x2c7bbb[_0xb381('0x1a')](_0x39b79d)[_0xb381('0x1b')]();};}function respondWithResult(_0x517f17,_0x587e6d){_0x587e6d=_0x587e6d||0xc8;return function(_0x144806){if(_0x144806){return _0x517f17[_0xb381('0x1a')](_0x587e6d)[_0xb381('0x1c')](_0x144806);}};}function respondWithFilteredResult(_0x2600d1,_0x129ddd){return function(_0x3a906b){if(_0x3a906b){var _0x13ef66=typeof _0x129ddd[_0xb381('0x1d')]==='undefined'&&typeof _0x129ddd[_0xb381('0x1e')]===_0xb381('0x1f');var _0x296d9e=_0x3a906b[_0xb381('0x20')];var _0x449b7b=_0x13ef66?0x0:_0x129ddd[_0xb381('0x1d')];var _0x2fd159=_0x13ef66?_0x3a906b[_0xb381('0x20')]:_0x129ddd[_0xb381('0x1d')]+_0x129ddd[_0xb381('0x1e')];var _0x1d2c5f;if(_0x2fd159>=_0x296d9e){_0x2fd159=_0x296d9e;_0x1d2c5f=0xc8;}else{_0x1d2c5f=0xce;}_0x2600d1[_0xb381('0x1a')](_0x1d2c5f);return _0x2600d1[_0xb381('0x21')](_0xb381('0x22'),_0x449b7b+'-'+_0x2fd159+'/'+_0x296d9e)[_0xb381('0x1c')](_0x3a906b);}return null;};}function patchUpdates(_0x11a531){return function(_0x295671){try{jsonpatch[_0xb381('0x23')](_0x295671,_0x11a531,!![]);}catch(_0x3fa7b4){return BPromise[_0xb381('0x24')](_0x3fa7b4);}return _0x295671['save']();};}function saveUpdates(_0x57a0aa,_0x3b39cc){return function(_0x5e140a){if(_0x5e140a){return _0x5e140a[_0xb381('0x25')](_0x57a0aa)[_0xb381('0x26')](function(_0x5a8042){return _0x5a8042;});}return null;};}function removeEntity(_0x2ada22,_0x5f1bbc){return function(_0x6688d2){if(_0x6688d2){return _0x6688d2[_0xb381('0x27')]()[_0xb381('0x26')](function(){_0x2ada22[_0xb381('0x1a')](0xcc)[_0xb381('0x1b')]();});}};}function handleEntityNotFound(_0x1216a9,_0x24d4af){return function(_0x2f7551){if(!_0x2f7551){_0x1216a9[_0xb381('0x28')](0x194);}return _0x2f7551;};}function handleError(_0x5cb456,_0x410a12){_0x410a12=_0x410a12||0x1f4;return function(_0x6f6da2){logger[_0xb381('0x29')](_0x6f6da2[_0xb381('0x2a')]);if(_0x6f6da2['name']){delete _0x6f6da2[_0xb381('0x2b')];}_0x5cb456[_0xb381('0x1a')](_0x410a12)[_0xb381('0x2c')](_0x6f6da2);};}exports[_0xb381('0x2d')]=function(_0x11b17e,_0x5dbf6f){var _0x1b697c={},_0x117c03={},_0x2bd6ea={'count':0x0,'rows':[]};var _0x577912=_[_0xb381('0x2e')](db[_0xb381('0x2f')][_0xb381('0x30')],function(_0x56bf15){return{'name':_0x56bf15[_0xb381('0x31')],'type':_0x56bf15[_0xb381('0x32')]['key']};});_0x117c03[_0xb381('0x33')]=_[_0xb381('0x2e')](_0x577912,_0xb381('0x2b'));_0x117c03[_0xb381('0x34')]=_[_0xb381('0x35')](_0x11b17e[_0xb381('0x34')]);_0x117c03[_0xb381('0x36')]=_[_0xb381('0x37')](_0x117c03[_0xb381('0x33')],_0x117c03['query']);_0x1b697c[_0xb381('0x38')]=_[_0xb381('0x37')](_0x117c03[_0xb381('0x33')],qs[_0xb381('0x39')](_0x11b17e[_0xb381('0x34')][_0xb381('0x39')]));_0x1b697c[_0xb381('0x38')]=_0x1b697c['attributes'][_0xb381('0x3a')]?_0x1b697c[_0xb381('0x38')]:_0x117c03['model'];if(!_0x11b17e['query'][_0xb381('0x3b')]('nolimit')){_0x1b697c[_0xb381('0x1e')]=qs[_0xb381('0x1e')](_0x11b17e['query'][_0xb381('0x1e')]);_0x1b697c['offset']=qs[_0xb381('0x1d')](_0x11b17e['query'][_0xb381('0x1d')]);}_0x1b697c[_0xb381('0x3c')]=qs['sort'](_0x11b17e[_0xb381('0x34')][_0xb381('0x3d')]);_0x1b697c[_0xb381('0x3e')]=qs['filters'](_['pick'](_0x11b17e[_0xb381('0x34')],_0x117c03[_0xb381('0x36')]),_0x577912);if(_0x11b17e['query'][_0xb381('0x3f')]){_0x1b697c[_0xb381('0x3e')]=_[_0xb381('0x40')](_0x1b697c['where'],{'$or':_[_0xb381('0x2e')](_0x577912,function(_0x539b1d){if(_0x539b1d[_0xb381('0x32')]!==_0xb381('0x41')){var _0xf43b20={};_0xf43b20[_0x539b1d[_0xb381('0x2b')]]={'$like':'%'+_0x11b17e[_0xb381('0x34')][_0xb381('0x3f')]+'%'};return _0xf43b20;}})});}_0x1b697c=_[_0xb381('0x40')]({},_0x1b697c,_0x11b17e[_0xb381('0x42')]);var _0x58527f={'where':_0x1b697c['where']};return db['OpenchannelApplication'][_0xb381('0x20')](_0x58527f)[_0xb381('0x26')](function(_0x24a82f){_0x2bd6ea[_0xb381('0x20')]=_0x24a82f;if(_0x11b17e[_0xb381('0x34')]['includeAll']){_0x1b697c[_0xb381('0x43')]=[{'all':!![]}];}return db[_0xb381('0x2f')]['findAll'](_0x1b697c);})[_0xb381('0x26')](function(_0x164230){_0x2bd6ea[_0xb381('0x44')]=_0x164230;return _0x2bd6ea;})[_0xb381('0x26')](respondWithFilteredResult(_0x5dbf6f,_0x1b697c))[_0xb381('0x45')](handleError(_0x5dbf6f,null));};exports[_0xb381('0x46')]=function(_0x3c3c72,_0x139b70){var _0x358cba={'raw':!![],'where':{'id':_0x3c3c72[_0xb381('0x47')]['id']}},_0x9fbcaf={};_0x9fbcaf[_0xb381('0x33')]=_['keys'](db['OpenchannelApplication'][_0xb381('0x30')]);_0x9fbcaf[_0xb381('0x34')]=_[_0xb381('0x35')](_0x3c3c72[_0xb381('0x34')]);_0x9fbcaf[_0xb381('0x36')]=_[_0xb381('0x37')](_0x9fbcaf['model'],_0x9fbcaf['query']);_0x358cba[_0xb381('0x38')]=_[_0xb381('0x37')](_0x9fbcaf[_0xb381('0x33')],qs[_0xb381('0x39')](_0x3c3c72[_0xb381('0x34')][_0xb381('0x39')]));_0x358cba[_0xb381('0x38')]=_0x358cba[_0xb381('0x38')][_0xb381('0x3a')]?_0x358cba['attributes']:_0x9fbcaf[_0xb381('0x33')];if(_0x3c3c72['query']['includeAll']){_0x358cba[_0xb381('0x43')]=[{'all':!![]}];}_0x358cba=_[_0xb381('0x40')]({},_0x358cba,_0x3c3c72[_0xb381('0x42')]);return db['OpenchannelApplication'][_0xb381('0x48')](_0x358cba)[_0xb381('0x26')](handleEntityNotFound(_0x139b70,null))[_0xb381('0x26')](respondWithResult(_0x139b70,null))[_0xb381('0x45')](handleError(_0x139b70,null));};exports['create']=function(_0x17bcef,_0x2fea78){return db[_0xb381('0x2f')][_0xb381('0x49')](_0x17bcef[_0xb381('0x4a')],{})[_0xb381('0x26')](respondWithResult(_0x2fea78,0xc9))[_0xb381('0x45')](handleError(_0x2fea78,null));};exports[_0xb381('0x25')]=function(_0x7867b9,_0x46df13){if(_0x7867b9[_0xb381('0x4a')]['id']){delete _0x7867b9[_0xb381('0x4a')]['id'];}return db[_0xb381('0x2f')][_0xb381('0x48')]({'where':{'id':_0x7867b9[_0xb381('0x47')]['id']}})[_0xb381('0x26')](handleEntityNotFound(_0x46df13,null))[_0xb381('0x26')](saveUpdates(_0x7867b9[_0xb381('0x4a')],null))[_0xb381('0x26')](respondWithResult(_0x46df13,null))[_0xb381('0x45')](handleError(_0x46df13,null));};exports[_0xb381('0x27')]=function(_0x510ae2,_0x322f6f){return db[_0xb381('0x2f')]['find']({'where':{'id':_0x510ae2[_0xb381('0x47')]['id']}})[_0xb381('0x26')](handleEntityNotFound(_0x322f6f,null))['then'](removeEntity(_0x322f6f,null))[_0xb381('0x45')](handleError(_0x322f6f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e42f5d3..b99910a 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 _0xd0c9=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise'];(function(_0xc0b152,_0x23f202){var _0x4f0053=function(_0x1681b1){while(--_0x1681b1){_0xc0b152['push'](_0xc0b152['shift']());}};_0x4f0053(++_0x23f202);}(_0xd0c9,0xaf));var _0x9d0c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd0c9[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x9d0c('0x0'));var logger=require('../../config/logger')(_0x9d0c('0x1'));var moment=require(_0x9d0c('0x2'));var BPromise=require(_0x9d0c('0x3'));var rp=require(_0x9d0c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d0c('0x5'));var attributes=require(_0x9d0c('0x6'));module[_0x9d0c('0x7')]=function(_0x2a6953,_0x39aa1d){return _0x2a6953[_0x9d0c('0x8')](_0x9d0c('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d0c('0xa'),'collate':_0x9d0c('0xb')});}; \ No newline at end of file +var _0x76e5=['request-promise','path','rimraf','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x4ceed6,_0x3515d1){var _0x558643=function(_0x1748b8){while(--_0x1748b8){_0x4ceed6['push'](_0x4ceed6['shift']());}};_0x558643(++_0x3515d1);}(_0x76e5,0xbe));var _0x576e=function(_0x433355,_0x4d498d){_0x433355=_0x433355-0x0;var _0x42ed3c=_0x76e5[_0x433355];return _0x42ed3c;};'use strict';var _=require(_0x576e('0x0'));var util=require(_0x576e('0x1'));var logger=require(_0x576e('0x2'))(_0x576e('0x3'));var moment=require(_0x576e('0x4'));var BPromise=require('bluebird');var rp=require(_0x576e('0x5'));var fs=require('fs');var path=require(_0x576e('0x6'));var rimraf=require(_0x576e('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x576e('0x8')]=function(_0x5c119a,_0x5921c6){return _0x5c119a[_0x576e('0x9')](_0x576e('0xa'),attributes,{'tableName':_0x576e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x576e('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 d2a7f06..7536843 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 _0xbe41=['request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbe41,0x18b));var _0x1be4=function(_0x592bdd,_0xb45fbb){_0x592bdd=_0x592bdd-0x0;var _0x2b445c=_0xbe41[_0x592bdd];return _0x2b445c;};'use strict';var _=require(_0x1be4('0x0'));var util=require(_0x1be4('0x1'));var moment=require(_0x1be4('0x2'));var BPromise=require(_0x1be4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1be4('0x4'));var db=require(_0x1be4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1be4('0x6'))(_0x1be4('0x7'));var config=require('../../config/environment');var jayson=require(_0x1be4('0x8'));var client=jayson[_0x1be4('0x9')][_0x1be4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ae176,_0x48fb42,_0x7bea64){return new BPromise(function(_0xab533b,_0x1089fc){return client[_0x1be4('0xb')](_0x2ae176,_0x7bea64)[_0x1be4('0xc')](function(_0x1fde0d){logger[_0x1be4('0xd')](_0x1be4('0xe'),_0x48fb42,_0x1be4('0xf'));logger[_0x1be4('0x10')](_0x1be4('0x11'),_0x48fb42,_0x1be4('0xf'),JSON[_0x1be4('0x12')](_0x1fde0d));if(_0x1fde0d[_0x1be4('0x13')]){if(_0x1fde0d[_0x1be4('0x13')]['code']===0x1f4){logger[_0x1be4('0x13')](_0x1be4('0xe'),_0x48fb42,_0x1fde0d[_0x1be4('0x13')]['message']);return _0x1089fc(_0x1fde0d[_0x1be4('0x13')][_0x1be4('0x14')]);}logger[_0x1be4('0x13')](_0x1be4('0xe'),_0x48fb42,_0x1fde0d[_0x1be4('0x13')]['message']);return _0xab533b(_0x1fde0d[_0x1be4('0x13')][_0x1be4('0x14')]);}else{logger[_0x1be4('0xd')](_0x1be4('0xe'),_0x48fb42,_0x1be4('0xf'));_0xab533b(_0x1fde0d['result'][_0x1be4('0x14')]);}})[_0x1be4('0x15')](function(_0x4d7918){logger[_0x1be4('0x13')](_0x1be4('0xe'),_0x48fb42,_0x4d7918);_0x1089fc(_0x4d7918);});});}exports[_0x1be4('0x16')]=function(_0x2ecef1){var _0x2bd539=this;return new Promise(function(_0x401481,_0x2536fe){return db[_0x1be4('0x17')][_0x1be4('0x18')](_0x2ecef1['body'],{'raw':_0x2ecef1['options']?_0x2ecef1[_0x1be4('0x19')][_0x1be4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ecef1[_0x1be4('0x19')]?_0x2ecef1[_0x1be4('0x19')][_0x1be4('0x1b')]||null:null,'attributes':_0x2ecef1[_0x1be4('0x19')]?_0x2ecef1['options']['attributes']||null:null,'limit':_0x2ecef1[_0x1be4('0x19')]?_0x2ecef1[_0x1be4('0x19')][_0x1be4('0x1c')]||null:null})[_0x1be4('0xc')](function(_0x35b539){logger[_0x1be4('0xd')]('UpdateOpenchannelApplication',_0x2ecef1);logger[_0x1be4('0x10')](_0x1be4('0x16'),_0x2ecef1,JSON[_0x1be4('0x12')](_0x35b539));_0x401481(_0x35b539);})[_0x1be4('0x15')](function(_0x3cffd5){logger[_0x1be4('0x13')](_0x1be4('0x16'),_0x3cffd5[_0x1be4('0x14')],_0x2ecef1);_0x2536fe(_0x2bd539[_0x1be4('0x13')](0x1f4,_0x3cffd5[_0x1be4('0x14')]));});});}; \ No newline at end of file +var _0x8bf7=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','update','body','options','raw','attributes','limit','info','UpdateOpenchannelApplication','lodash'];(function(_0x407c91,_0xe6caf9){var _0x4261e5=function(_0x55a410){while(--_0x55a410){_0x407c91['push'](_0x407c91['shift']());}};_0x4261e5(++_0xe6caf9);}(_0x8bf7,0x1c1));var _0x78bf=function(_0x150442,_0x1784fd){_0x150442=_0x150442-0x0;var _0x3d6fa1=_0x8bf7[_0x150442];return _0x3d6fa1;};'use strict';var _=require(_0x78bf('0x0'));var util=require('util');var moment=require(_0x78bf('0x1'));var BPromise=require('bluebird');var rs=require(_0x78bf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78bf('0x3'))['db'];var utils=require(_0x78bf('0x4'));var logger=require(_0x78bf('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78bf('0x6'));var client=jayson[_0x78bf('0x7')][_0x78bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d4118,_0x33ece6,_0x30ca15){return new BPromise(function(_0x56c3cb,_0x172ee7){return client[_0x78bf('0x9')](_0x5d4118,_0x30ca15)[_0x78bf('0xa')](function(_0x81ab24){logger['info'](_0x78bf('0xb'),_0x33ece6,_0x78bf('0xc'));logger[_0x78bf('0xd')](_0x78bf('0xe'),_0x33ece6,_0x78bf('0xc'),JSON[_0x78bf('0xf')](_0x81ab24));if(_0x81ab24[_0x78bf('0x10')]){if(_0x81ab24[_0x78bf('0x10')][_0x78bf('0x11')]===0x1f4){logger[_0x78bf('0x10')](_0x78bf('0xb'),_0x33ece6,_0x81ab24[_0x78bf('0x10')][_0x78bf('0x12')]);return _0x172ee7(_0x81ab24[_0x78bf('0x10')][_0x78bf('0x12')]);}logger['error'](_0x78bf('0xb'),_0x33ece6,_0x81ab24[_0x78bf('0x10')]['message']);return _0x56c3cb(_0x81ab24[_0x78bf('0x10')][_0x78bf('0x12')]);}else{logger['info'](_0x78bf('0xb'),_0x33ece6,_0x78bf('0xc'));_0x56c3cb(_0x81ab24[_0x78bf('0x13')][_0x78bf('0x12')]);}})[_0x78bf('0x14')](function(_0x38f3d6){logger[_0x78bf('0x10')](_0x78bf('0xb'),_0x33ece6,_0x38f3d6);_0x172ee7(_0x38f3d6);});});}exports['UpdateOpenchannelApplication']=function(_0x875825){var _0xb9ce5b=this;return new Promise(function(_0x414346,_0x24a00e){return db[_0x78bf('0x15')][_0x78bf('0x16')](_0x875825[_0x78bf('0x17')],{'raw':_0x875825['options']?_0x875825[_0x78bf('0x18')][_0x78bf('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x875825[_0x78bf('0x18')]?_0x875825['options']['where']||null:null,'attributes':_0x875825[_0x78bf('0x18')]?_0x875825[_0x78bf('0x18')][_0x78bf('0x1a')]||null:null,'limit':_0x875825[_0x78bf('0x18')]?_0x875825[_0x78bf('0x18')][_0x78bf('0x1b')]||null:null})['then'](function(_0x544ff1){logger[_0x78bf('0x1c')](_0x78bf('0x1d'),_0x875825);logger[_0x78bf('0xd')]('UpdateOpenchannelApplication',_0x875825,JSON[_0x78bf('0xf')](_0x544ff1));_0x414346(_0x544ff1);})[_0x78bf('0x14')](function(_0x38e418){logger['error'](_0x78bf('0x1d'),_0x38e418['message'],_0x875825);_0x24a00e(_0xb9ce5b[_0x78bf('0x10')](0x1f4,_0x38e418['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index a711bda..c7f38ea 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 _0x1678=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','delete','openchannelinteraction:destroy','exports','util','path','fs-extra'];(function(_0x5162a7,_0x43f3b3){var _0x3a9fa1=function(_0x1a8534){while(--_0x1a8534){_0x5162a7['push'](_0x5162a7['shift']());}};_0x3a9fa1(++_0x43f3b3);}(_0x1678,0xf0));var _0x8167=function(_0x464519,_0x164486){_0x464519=_0x464519-0x0;var _0x5b6208=_0x1678[_0x464519];return _0x5b6208;};'use strict';var multer=require('multer');var util=require(_0x8167('0x0'));var path=require(_0x8167('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8167('0x2'));var auth=require(_0x8167('0x3'));var interaction=require(_0x8167('0x4'));var config=require(_0x8167('0x5'));var controller=require(_0x8167('0x6'));router[_0x8167('0x7')]('/',auth[_0x8167('0x8')](),controller[_0x8167('0x9')]);router['get'](_0x8167('0xa'),auth['isAuthenticated'](),controller[_0x8167('0xb')]);router['get'](_0x8167('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x8167('0x8')](),controller[_0x8167('0xd')]);router[_0x8167('0x7')](_0x8167('0xe'),auth[_0x8167('0x8')](),controller['download']);router[_0x8167('0xf')]('/',auth[_0x8167('0x8')](),controller[_0x8167('0x10')]);router[_0x8167('0xf')]('/:id/messages',auth[_0x8167('0x8')](),controller[_0x8167('0x11')]);router[_0x8167('0xf')](_0x8167('0x12'),auth['isAuthenticated'](),interaction['tracked'](_0x8167('0x13'),_0x8167('0x14')),controller[_0x8167('0x15')]);router[_0x8167('0x16')](_0x8167('0xc'),auth[_0x8167('0x8')](),interaction[_0x8167('0x17')](_0x8167('0x13'),'openchannelinteraction:update'),controller['update']);router[_0x8167('0x18')](_0x8167('0xc'),auth[_0x8167('0x8')](),interaction[_0x8167('0x17')](_0x8167('0x13'),_0x8167('0x19')),controller['destroy']);router[_0x8167('0x18')]('/:id/tags',auth[_0x8167('0x8')](),controller['removeTags']);module[_0x8167('0x1a')]=router; \ No newline at end of file +var _0xdae3=['addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags'];(function(_0x3d77e4,_0x1c44e7){var _0xe937=function(_0x521769){while(--_0x521769){_0x3d77e4['push'](_0x3d77e4['shift']());}};_0xe937(++_0x1c44e7);}(_0xdae3,0x101));var _0x3dae=function(_0x3144f5,_0x41242a){_0x3144f5=_0x3144f5-0x0;var _0x40641f=_0xdae3[_0x3144f5];return _0x40641f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3dae('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3dae('0x1'));var auth=require(_0x3dae('0x2'));var interaction=require(_0x3dae('0x3'));var config=require(_0x3dae('0x4'));var controller=require(_0x3dae('0x5'));router[_0x3dae('0x6')]('/',auth[_0x3dae('0x7')](),controller[_0x3dae('0x8')]);router[_0x3dae('0x6')]('/describe',auth[_0x3dae('0x7')](),controller[_0x3dae('0x9')]);router[_0x3dae('0x6')](_0x3dae('0xa'),auth[_0x3dae('0x7')](),controller[_0x3dae('0xb')]);router[_0x3dae('0x6')](_0x3dae('0xc'),auth['isAuthenticated'](),controller[_0x3dae('0xd')]);router['get'](_0x3dae('0xe'),auth[_0x3dae('0x7')](),controller[_0x3dae('0xf')]);router[_0x3dae('0x10')]('/',auth['isAuthenticated'](),controller[_0x3dae('0x11')]);router[_0x3dae('0x10')]('/:id/messages',auth[_0x3dae('0x7')](),controller[_0x3dae('0x12')]);router['post']('/:id/tags',auth[_0x3dae('0x7')](),interaction[_0x3dae('0x13')](_0x3dae('0x14'),_0x3dae('0x15')),controller[_0x3dae('0x16')]);router[_0x3dae('0x17')]('/:id',auth[_0x3dae('0x7')](),interaction[_0x3dae('0x13')](_0x3dae('0x14'),_0x3dae('0x18')),controller[_0x3dae('0x19')]);router['delete'](_0x3dae('0xa'),auth[_0x3dae('0x7')](),interaction[_0x3dae('0x13')](_0x3dae('0x14'),_0x3dae('0x1a')),controller[_0x3dae('0x1b')]);router[_0x3dae('0x1c')](_0x3dae('0x1d'),auth[_0x3dae('0x7')](),controller[_0x3dae('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index d7ee753..5cabe10 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 _0x62b7=['INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x19300d,_0x195e5b){var _0x3dab8f=function(_0x164619){while(--_0x164619){_0x19300d['push'](_0x19300d['shift']());}};_0x3dab8f(++_0x195e5b);}(_0x62b7,0x179));var _0x762b=function(_0x288688,_0x615a19){_0x288688=_0x288688-0x0;var _0x3e0df8=_0x62b7[_0x288688];return _0x3e0df8;};'use strict';var Sequelize=require(_0x762b('0x0'));module[_0x762b('0x1')]={'closed':{'type':Sequelize[_0x762b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x762b('0x3')]},'disposition':{'type':Sequelize[_0x762b('0x4')]},'secondDisposition':{'type':Sequelize[_0x762b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x762b('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x762b('0x4')]},'externalUrl':{'type':Sequelize[_0x762b('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x762b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x762b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x762b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x762b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x762b('0x7')]}}; \ No newline at end of file +var _0x586b=['STRING','ENUM','out','BOOLEAN','DATE'];(function(_0x1fd154,_0x273e7e){var _0x4a6413=function(_0x4d9d64){while(--_0x4d9d64){_0x1fd154['push'](_0x1fd154['shift']());}};_0x4a6413(++_0x273e7e);}(_0x586b,0x1bb));var _0xb586=function(_0x25cb0d,_0x2f5a44){_0x25cb0d=_0x25cb0d-0x0;var _0x246af0=_0x586b[_0x25cb0d];return _0x246af0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xb586('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb586('0x1')]},'disposition':{'type':Sequelize[_0xb586('0x2')]},'secondDisposition':{'type':Sequelize[_0xb586('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb586('0x2')]},'note':{'type':Sequelize[_0xb586('0x2')]},'read1stAt':{'type':Sequelize[_0xb586('0x1')]},'threadId':{'type':Sequelize[_0xb586('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb586('0x3')]('in',_0xb586('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xb586('0x3')]('in',_0xb586('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb586('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xb586('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0ec16b9..de489d3 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 _0x6ef1=['error','sendStatus','zip-dir','moment','util','path','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','findAll','openchannel','show','query','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','format','rows','addTags','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','createdAt','direction','read','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','Public','Messages','basename','existsSync','createReadStream','createWriteStream','out','System','firstName','secret','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML'];(function(_0x1aaa00,_0x245138){var _0x4be822=function(_0x249c61){while(--_0x249c61){_0x1aaa00['push'](_0x1aaa00['shift']());}};_0x4be822(++_0x245138);}(_0x6ef1,0x106));var _0x16ef=function(_0x28466d,_0x35504b){_0x28466d=_0x28466d-0x0;var _0xd0a76e=_0x6ef1[_0x28466d];return _0xd0a76e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x16ef('0x0'));var moment=require(_0x16ef('0x1'));var util=require(_0x16ef('0x2'));var path=require(_0x16ef('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x16ef('0x4'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x16ef('0x5'));var logger=require(_0x16ef('0x6'))(_0x16ef('0x7'));var config=require(_0x16ef('0x8'));var db=require(_0x16ef('0x9'))['db'];config['redis']=_[_0x16ef('0xa')](config[_0x16ef('0xb')],{'host':_0x16ef('0xc'),'port':0x18eb});var socket=require(_0x16ef('0xd'))(new Redis(config[_0x16ef('0xb')]));require(_0x16ef('0xe'))[_0x16ef('0xf')](socket);function respondWithStatusCode(_0x5848a7,_0x39a34a){_0x39a34a=_0x39a34a||0xcc;return function(_0x56d1b9){if(_0x56d1b9){return _0x5848a7['sendStatus'](_0x39a34a);}return _0x5848a7[_0x16ef('0x10')](_0x39a34a)['end']();};}function respondWithResult(_0x53e934,_0x1a3a0a){_0x1a3a0a=_0x1a3a0a||0xc8;return function(_0x1fa28b){if(_0x1fa28b){return _0x53e934[_0x16ef('0x10')](_0x1a3a0a)[_0x16ef('0x11')](_0x1fa28b);}};}function respondWithFilteredResult(_0x2e860f,_0x50cd27){return function(_0x45a53f){if(_0x45a53f){var _0x37d947=typeof _0x50cd27['offset']===_0x16ef('0x12')&&typeof _0x50cd27['limit']===_0x16ef('0x12');var _0x5761c2=_0x45a53f[_0x16ef('0x13')];var _0xee2bbe=_0x37d947?0x0:_0x50cd27['offset'];var _0x2e529d=_0x37d947?_0x45a53f[_0x16ef('0x13')]:_0x50cd27[_0x16ef('0x14')]+_0x50cd27[_0x16ef('0x15')];var _0x40fe73;if(_0x2e529d>=_0x5761c2){_0x2e529d=_0x5761c2;_0x40fe73=0xc8;}else{_0x40fe73=0xce;}_0x2e860f[_0x16ef('0x10')](_0x40fe73);return _0x2e860f[_0x16ef('0x16')](_0x16ef('0x17'),_0xee2bbe+'-'+_0x2e529d+'/'+_0x5761c2)[_0x16ef('0x11')](_0x45a53f);}return null;};}function saveUpdates(_0x43aa83){return function(_0x15613d){if(_0x15613d){return _0x15613d[_0x16ef('0x18')](_0x43aa83)[_0x16ef('0x19')](function(_0x2147e7){return _0x2147e7;});}return null;};}function removeEntity(_0x5d9e29){return function(_0x361305){if(_0x361305){return _0x361305[_0x16ef('0x1a')]()[_0x16ef('0x19')](function(){_0x5d9e29['status'](0xcc)[_0x16ef('0x1b')]();});}};}function handleEntityNotFound(_0x175b51){return function(_0x1c989b){if(!_0x1c989b){_0x175b51['sendStatus'](0x194);}return _0x1c989b;};}function handleError(_0x257c00,_0x25b0b9){_0x25b0b9=_0x25b0b9||0x1f4;return function(_0x5962d7){logger['error'](_0x5962d7[_0x16ef('0x1c')]);if(_0x5962d7[_0x16ef('0x1d')]){delete _0x5962d7[_0x16ef('0x1d')];}_0x257c00[_0x16ef('0x10')](_0x25b0b9)[_0x16ef('0x1e')](_0x5962d7);};}exports[_0x16ef('0x1f')]=function(_0x19d4a3,_0x579cf7){var _0x10cdc4={};var _0x4c4e82=_[_0x16ef('0x20')](db[_0x16ef('0x21')][_0x16ef('0x22')],function(_0x137c05){return{'name':_0x137c05['fieldName'],'type':_0x137c05['type']['key']};});_0x10cdc4=qs['getOptions'](_0x4c4e82,_0x19d4a3);return interaction[_0x16ef('0x23')](_0x16ef('0x24'),_0x19d4a3['query'],_0x19d4a3['user'],_0x10cdc4,_0x4c4e82)[_0x16ef('0x19')](respondWithFilteredResult(_0x579cf7,_0x10cdc4))['catch'](handleError(_0x579cf7,null));};exports[_0x16ef('0x25')]=function(_0x3a51a0,_0x341c71){var _0x455cbb={};if(_0x3a51a0[_0x16ef('0x26')]['type']&&_0x3a51a0[_0x16ef('0x26')][_0x16ef('0x27')]===_0x16ef('0x28')){_0x455cbb[_0x16ef('0x28')]=_0x3a51a0['params']['id'];}else{_0x455cbb['id']=_0x3a51a0[_0x16ef('0x29')]['id'];}var _0x4e7a33={'raw':![],'where':_0x455cbb},_0x1736cf={};_0x1736cf[_0x16ef('0x2a')]=_[_0x16ef('0x2b')](db[_0x16ef('0x21')][_0x16ef('0x22')]);_0x1736cf['query']=_[_0x16ef('0x2b')](_0x3a51a0[_0x16ef('0x26')]);_0x1736cf[_0x16ef('0x2c')]=_[_0x16ef('0x2d')](_0x1736cf[_0x16ef('0x2a')],_0x1736cf[_0x16ef('0x26')]);_0x4e7a33[_0x16ef('0x2e')]=_[_0x16ef('0x2d')](_0x1736cf[_0x16ef('0x2a')],qs['fields'](_0x3a51a0[_0x16ef('0x26')][_0x16ef('0x2f')]));_0x4e7a33[_0x16ef('0x2e')]=_0x4e7a33[_0x16ef('0x2e')][_0x16ef('0x30')]?_0x4e7a33['attributes']:_0x1736cf[_0x16ef('0x2a')];if(_0x3a51a0[_0x16ef('0x26')][_0x16ef('0x31')]){_0x4e7a33[_0x16ef('0x32')]=[{'all':!![]}];}_0x4e7a33=_[_0x16ef('0x33')]({},_0x4e7a33,_0x3a51a0[_0x16ef('0x34')]);return db[_0x16ef('0x21')][_0x16ef('0x35')](_0x4e7a33)[_0x16ef('0x19')](handleEntityNotFound(_0x341c71,null))[_0x16ef('0x19')](respondWithResult(_0x341c71,null))[_0x16ef('0x36')](handleError(_0x341c71,null));};exports['create']=function(_0x554ad5,_0x281c3c){return db[_0x16ef('0x21')][_0x16ef('0x37')](_0x554ad5['body'],{})[_0x16ef('0x19')](respondWithResult(_0x281c3c,0xc9))[_0x16ef('0x36')](handleError(_0x281c3c,null));};exports[_0x16ef('0x18')]=function(_0x5bea6d,_0x835591){if(_0x5bea6d['body']['id']){delete _0x5bea6d[_0x16ef('0x38')]['id'];}return db['OpenchannelInteraction'][_0x16ef('0x35')]({'where':{'id':_0x5bea6d['params']['id']}})['then'](handleEntityNotFound(_0x835591,null))[_0x16ef('0x19')](saveUpdates(_0x5bea6d[_0x16ef('0x38')],null))[_0x16ef('0x19')](respondWithResult(_0x835591,null))[_0x16ef('0x36')](handleError(_0x835591,null));};exports[_0x16ef('0x1a')]=function(_0xf91c20,_0x36694f){return db[_0x16ef('0x21')]['find']({'where':{'id':_0xf91c20[_0x16ef('0x29')]['id']}})[_0x16ef('0x19')](handleEntityNotFound(_0x36694f,null))[_0x16ef('0x19')](removeEntity(_0x36694f,null))['catch'](handleError(_0x36694f,null));};exports[_0x16ef('0x39')]=function(_0x3a6cc5,_0xc8471f){return db[_0x16ef('0x21')][_0x16ef('0x39')]()['then'](respondWithResult(_0xc8471f,null))[_0x16ef('0x36')](handleError(_0xc8471f,null));};exports[_0x16ef('0x3a')]=function(_0x53d68d,_0x4dbd17){return db['OpenchannelMessage']['find']({'where':{'id':_0x53d68d[_0x16ef('0x29')]['id']}})[_0x16ef('0x19')](handleEntityNotFound(_0x4dbd17,null))[_0x16ef('0x19')](function(_0x247ab9){if(_0x247ab9){return _0x247ab9[_0x16ef('0x3a')](_0x53d68d[_0x16ef('0x38')][_0x16ef('0x3b')],_['omit'](_0x53d68d[_0x16ef('0x38')],[_0x16ef('0x3b'),'id'])||{});}})[_0x16ef('0x19')](respondWithResult(_0x4dbd17,null))[_0x16ef('0x36')](handleError(_0x4dbd17,null));};exports[_0x16ef('0x3c')]=function(_0x18e66e,_0x4ab84d){var _0x53d00d={'raw':![],'where':{}};var _0x12fab0={};var _0x4dd75f={'count':0x0,'rows':[]};return db[_0x16ef('0x21')][_0x16ef('0x3d')]({'where':{'id':_0x18e66e[_0x16ef('0x29')]['id']}})[_0x16ef('0x19')](handleEntityNotFound(_0x4ab84d,null))[_0x16ef('0x19')](function(_0xbaa62c){if(_0xbaa62c){_0x12fab0[_0x16ef('0x2a')]=_[_0x16ef('0x2b')](db[_0x16ef('0x3e')][_0x16ef('0x22')]);_0x12fab0[_0x16ef('0x26')]=_[_0x16ef('0x2b')](_0x18e66e[_0x16ef('0x26')]);_0x12fab0['filters']=_[_0x16ef('0x2d')](_0x12fab0['model'],_0x12fab0[_0x16ef('0x26')]);_0x53d00d['attributes']=_['intersection'](_0x12fab0[_0x16ef('0x2a')],qs[_0x16ef('0x2f')](_0x18e66e[_0x16ef('0x26')][_0x16ef('0x2f')]));_0x53d00d['attributes']=_0x53d00d[_0x16ef('0x2e')][_0x16ef('0x30')]?_0x53d00d[_0x16ef('0x2e')]:_0x12fab0['model'];if(!_0x18e66e[_0x16ef('0x26')][_0x16ef('0x3f')](_0x16ef('0x40'))){_0x53d00d[_0x16ef('0x15')]=qs[_0x16ef('0x15')](_0x18e66e[_0x16ef('0x26')]['limit']);_0x53d00d['offset']=qs[_0x16ef('0x14')](_0x18e66e[_0x16ef('0x26')]['offset']);}_0x53d00d[_0x16ef('0x41')]=qs[_0x16ef('0x42')](_0x18e66e[_0x16ef('0x26')][_0x16ef('0x42')]);_0x53d00d[_0x16ef('0x43')]=qs['filters'](_[_0x16ef('0x44')](_0x18e66e[_0x16ef('0x26')],_0x12fab0[_0x16ef('0x2c')]));_0x53d00d[_0x16ef('0x43')]['OpenchannelInteractionId']=_0xbaa62c['id'];if(_0x18e66e['query'][_0x16ef('0x45')]){_0x53d00d['where']=_[_0x16ef('0x33')](_0x53d00d[_0x16ef('0x43')],{'$or':_[_0x16ef('0x20')](_0x53d00d[_0x16ef('0x2e')],function(_0x1fe3e1){var _0x253af5={};_0x253af5[_0x1fe3e1]={'$like':'%'+_0x18e66e[_0x16ef('0x26')][_0x16ef('0x45')]+'%'};return _0x253af5;})});}if(_0x18e66e[_0x16ef('0x26')][_0x16ef('0x46')]){var _0x4f17c8=_0x18e66e[_0x16ef('0x26')][_0x16ef('0x46')]['split'](',');var _0x512511={};_0x512511[_0x4f17c8[0x0]]={'$gte':moment(_0x4f17c8[0x1])[_0x16ef('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x53d00d[_0x16ef('0x43')]=_[_0x16ef('0x33')](_0x53d00d[_0x16ef('0x43')],_0x512511);}_0x53d00d=_['merge']({},_0x53d00d,_0x18e66e[_0x16ef('0x34')]);return db['OpenchannelMessage'][_0x16ef('0x13')]({'where':_0x53d00d[_0x16ef('0x43')]})[_0x16ef('0x19')](function(_0x24b7f9){_0x4dd75f['count']=_0x24b7f9;if(_0x18e66e[_0x16ef('0x26')][_0x16ef('0x31')]){_0x53d00d[_0x16ef('0x32')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x16ef('0x23')](_0x53d00d);})[_0x16ef('0x19')](function(_0x519cfa){_0x4dd75f[_0x16ef('0x48')]=_0x519cfa;return _0x4dd75f;});}})[_0x16ef('0x19')](respondWithFilteredResult(_0x4ab84d,_0x53d00d))[_0x16ef('0x36')](handleError(_0x4ab84d,null));};exports[_0x16ef('0x49')]=function(_0x5678a3,_0x4fb5a4){return db[_0x16ef('0x21')][_0x16ef('0x35')]({'where':{'id':_0x5678a3[_0x16ef('0x29')]['id']}})[_0x16ef('0x19')](handleEntityNotFound(_0x4fb5a4,null))[_0x16ef('0x19')](function(_0x1799fd){if(_0x1799fd){return _0x1799fd[_0x16ef('0x4a')](_0x5678a3[_0x16ef('0x38')][_0x16ef('0x3b')],_[_0x16ef('0x4b')](_0x5678a3[_0x16ef('0x38')],[_0x16ef('0x3b'),'id'])||{})[_0x16ef('0x4c')](function(){return db[_0x16ef('0x4d')][_0x16ef('0x23')]({'attributes':['id','name',_0x16ef('0x4e')],'where':{'id':_0x5678a3['body'][_0x16ef('0x3b')]}});})[_0x16ef('0x19')](function(_0x250949){socket[_0x16ef('0x4f')](_0x16ef('0x50'),{'id':Number(_0x5678a3[_0x16ef('0x29')]['id']),'tags':_0x250949||[]});return{'id':Number(_0x5678a3[_0x16ef('0x29')]['id']),'tags':_0x250949||[]};});}})[_0x16ef('0x19')](respondWithResult(_0x4fb5a4,null))[_0x16ef('0x36')](handleError(_0x4fb5a4,null));};exports[_0x16ef('0x51')]=function(_0x12b10a,_0x5a5824){return db[_0x16ef('0x21')][_0x16ef('0x35')]({'where':{'id':_0x12b10a[_0x16ef('0x29')]['id']}})['then'](handleEntityNotFound(_0x5a5824,null))[_0x16ef('0x19')](function(_0x2ca976){if(_0x2ca976){return _0x2ca976['removeTags'](_0x12b10a[_0x16ef('0x26')][_0x16ef('0x3b')]);}})['then'](respondWithStatusCode(_0x5a5824,null))[_0x16ef('0x36')](handleError(_0x5a5824,null));};exports[_0x16ef('0x52')]=function(_0x15524e,_0x52c67a){var _0x4a231d=moment()[_0x16ef('0x53')]()[_0x16ef('0x54')]();var _0x36c2ac=path['join'](config[_0x16ef('0x55')],'server',_0x16ef('0x56'),_0x16ef('0x57'));var _0x1a7125=path[_0x16ef('0x58')](config[_0x16ef('0x55')],_0x16ef('0x59'),'files',_0x16ef('0x5a'));var _0x1483c7=path[_0x16ef('0x58')](_0x36c2ac,_0x4a231d);var _0x1cb396=util[_0x16ef('0x47')](_0x16ef('0x5b'),_0x15524e[_0x16ef('0x29')]['id'],_0x4a231d);var _0x45e6c6=path[_0x16ef('0x58')](_0x36c2ac,_0x1cb396);var _0x5c75a6=[];_0x5c75a6[_0x16ef('0x5c')]({'model':db[_0x16ef('0x5d')],'as':_0x16ef('0x5d'),'attributes':['id',_0x16ef('0x5e')],'raw':!![]});_0x5c75a6[_0x16ef('0x5c')]({'model':db[_0x16ef('0x5f')],'as':_0x16ef('0x60'),'attributes':['id','firstName',_0x16ef('0x61')],'raw':!![]});if(_0x15524e['query'][_0x16ef('0x5a')]){_0x5c75a6[_0x16ef('0x5c')]({'model':db[_0x16ef('0x62')],'as':'Attachment','raw':!![]});}var _0xf6bdba=[{'model':db[_0x16ef('0x3e')],'as':'Messages','attributes':['id','body',_0x16ef('0x63'),_0x16ef('0x64'),'secret',_0x16ef('0x65')],'include':_0x5c75a6}];_0xf6bdba['push']({'model':db[_0x16ef('0x66')],'as':'Account','attributes':['id',_0x16ef('0x1d')]});_0xf6bdba[_0x16ef('0x5c')]({'model':db[_0x16ef('0x5d')],'as':_0x16ef('0x67'),'attributes':['id',_0x16ef('0x5e')]});return db[_0x16ef('0x21')][_0x16ef('0x35')]({'where':{'id':_0x15524e['params']['id']},'include':_0xf6bdba})['then'](handleEntityNotFound(_0x52c67a,null))[_0x16ef('0x19')](function(_0x37bddc){if(_0x37bddc){var _0x41f57a=_0x37bddc['get']({'plain':!![]});fs[_0x16ef('0x68')](_0x1483c7);var _0x23c4d4={'channel':_0x16ef('0x69'),'account':_0x41f57a[_0x16ef('0x6a')][_0x16ef('0x1d')],'agent':_0x41f57a[_0x16ef('0x67')]?_0x41f57a[_0x16ef('0x67')][_0x16ef('0x5e')]:_0x16ef('0x6b'),'createdAt':moment(_0x41f57a['createdAt'])[_0x16ef('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x16ef('0x54')](),'closedAt':_0x41f57a[_0x16ef('0x6c')]?moment(_0x41f57a[_0x16ef('0x6d')])[_0x16ef('0x47')](_0x16ef('0x6e'))[_0x16ef('0x54')]():'','disposition':_0x41f57a[_0x16ef('0x6f')],'visibility':_0x41f57a['threadId']?_0x16ef('0x70'):'Private','messages':_(_0x41f57a[_0x16ef('0x71')])[_0x16ef('0x45')]({'secret':![]})[_0x16ef('0x20')](function(_0x538544){if(_0x538544[_0x16ef('0x62')]){var _0x5032ee=path[_0x16ef('0x58')](_0x1a7125,_0x538544[_0x16ef('0x62')][_0x16ef('0x72')]);if(fs[_0x16ef('0x73')](_0x5032ee)){fs[_0x16ef('0x74')](_0x5032ee)['pipe'](fs[_0x16ef('0x75')](path[_0x16ef('0x58')](_0x1483c7,_0x538544[_0x16ef('0x62')][_0x16ef('0x72')])));}}return{'date':moment(_0x538544['createdAt'])['format'](_0x16ef('0x6e'))[_0x16ef('0x54')](),'sender':_0x538544['direction']===_0x16ef('0x76')?_0x538544[_0x16ef('0x5d')]?_0x538544[_0x16ef('0x5d')][_0x16ef('0x5e')]:_0x16ef('0x77'):_0x538544[_0x16ef('0x60')][_0x16ef('0x78')]+(_0x538544[_0x16ef('0x60')][_0x16ef('0x61')]?'\x20'+_0x538544[_0x16ef('0x60')]['lastName']:''),'body':_0x538544[_0x16ef('0x62')]?_0x538544['Attachment'][_0x16ef('0x72')]:_0x538544[_0x16ef('0x38')],'direction':_0x538544[_0x16ef('0x64')]===_0x16ef('0x76')?'A':'C','secret':_0x538544[_0x16ef('0x79')],'read':_0x538544[_0x16ef('0x65')],'attachment':_0x538544[_0x16ef('0x62')]};})[_0x16ef('0x7a')]()};return ejs[_0x16ef('0x7b')](path[_0x16ef('0x58')](config[_0x16ef('0x55')],_0x16ef('0x59'),'views',_0x16ef('0x7c')),{'interaction':_0x23c4d4})[_0x16ef('0x19')](function(_0x5bf026){var _0x1d195b=path['join'](_0x1483c7,_0x16ef('0x7d')+_0x41f57a['id']+'-'+_0x4a231d+_0x16ef('0x7e'));var _0x16f902={'path':_0x1d195b,'channel':_0x16ef('0x69'),'interactionId':_0x41f57a['id']};return pdf[_0x16ef('0x7f')](_0x5bf026,_0x16f902);})[_0x16ef('0x19')](function(){return new Promise(function(_0x2cc002,_0x43514f){zipdir(_0x1483c7,{'saveTo':_0x45e6c6},function(_0x3bd844,_0x360302){if(_0x3bd844)return _0x43514f(_0x3bd844);return _0x2cc002(_0x360302);});})['then'](function(){return new Promise(function(_0x2b5889,_0x32598f){rimraf(_0x1483c7,function(_0x59fd58){if(_0x59fd58)_0x32598f(_0x59fd58);return _0x2b5889();});});})[_0x16ef('0x19')](function(){return _0x52c67a[_0x16ef('0x52')](_0x45e6c6,_0x1cb396,function(_0x3a596f){if(_0x3a596f){logger[_0x16ef('0x80')]('Unable\x20to\x20delete\x20zip\x20file',_0x3a596f);}else{fs['unlinkSync'](_0x45e6c6);}});});});}else{return _0x52c67a[_0x16ef('0x81')](0xc8);}})[_0x16ef('0x36')](handleError(_0x52c67a,null));}; \ No newline at end of file +var _0x7d80=['omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','files','join','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','read','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','closedAt','threadId','Private','Messages','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','ejs','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','openchannel','user','show','query','from','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags'];(function(_0x535dff,_0x1118a0){var _0x49771b=function(_0x4e7276){while(--_0x4e7276){_0x535dff['push'](_0x535dff['shift']());}};_0x49771b(++_0x1118a0);}(_0x7d80,0xba));var _0x07d8=function(_0x558718,_0x169d9e){_0x558718=_0x558718-0x0;var _0x180d10=_0x7d80[_0x558718];return _0x180d10;};'use strict';var rimraf=require(_0x07d8('0x0'));var zipdir=require(_0x07d8('0x1'));var moment=require(_0x07d8('0x2'));var util=require(_0x07d8('0x3'));var path=require(_0x07d8('0x4'));var ejs=require(_0x07d8('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x07d8('0x6'));var pdf=require(_0x07d8('0x7'));var logger=require(_0x07d8('0x8'))(_0x07d8('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x07d8('0xa')]=_['defaults'](config[_0x07d8('0xa')],{'host':_0x07d8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x07d8('0xa')]));require(_0x07d8('0xc'))[_0x07d8('0xd')](socket);function respondWithStatusCode(_0x2a9dde,_0x18f1a4){_0x18f1a4=_0x18f1a4||0xcc;return function(_0x3c8b99){if(_0x3c8b99){return _0x2a9dde[_0x07d8('0xe')](_0x18f1a4);}return _0x2a9dde[_0x07d8('0xf')](_0x18f1a4)[_0x07d8('0x10')]();};}function respondWithResult(_0x372577,_0x4d1d31){_0x4d1d31=_0x4d1d31||0xc8;return function(_0x191130){if(_0x191130){return _0x372577['status'](_0x4d1d31)[_0x07d8('0x11')](_0x191130);}};}function respondWithFilteredResult(_0x7de838,_0x36d4a6){return function(_0x501637){if(_0x501637){var _0x4f4092=typeof _0x36d4a6[_0x07d8('0x12')]===_0x07d8('0x13')&&typeof _0x36d4a6[_0x07d8('0x14')]==='undefined';var _0x598900=_0x501637[_0x07d8('0x15')];var _0x3e4612=_0x4f4092?0x0:_0x36d4a6[_0x07d8('0x12')];var _0x48242f=_0x4f4092?_0x501637[_0x07d8('0x15')]:_0x36d4a6['offset']+_0x36d4a6[_0x07d8('0x14')];var _0x5be7cd;if(_0x48242f>=_0x598900){_0x48242f=_0x598900;_0x5be7cd=0xc8;}else{_0x5be7cd=0xce;}_0x7de838['status'](_0x5be7cd);return _0x7de838[_0x07d8('0x16')](_0x07d8('0x17'),_0x3e4612+'-'+_0x48242f+'/'+_0x598900)[_0x07d8('0x11')](_0x501637);}return null;};}function saveUpdates(_0x4a2505){return function(_0xfaab03){if(_0xfaab03){return _0xfaab03[_0x07d8('0x18')](_0x4a2505)[_0x07d8('0x19')](function(_0x19135a){return _0x19135a;});}return null;};}function removeEntity(_0x35209d){return function(_0x48f29a){if(_0x48f29a){return _0x48f29a['destroy']()[_0x07d8('0x19')](function(){_0x35209d[_0x07d8('0xf')](0xcc)[_0x07d8('0x10')]();});}};}function handleEntityNotFound(_0x327bb9){return function(_0x3c6aa8){if(!_0x3c6aa8){_0x327bb9[_0x07d8('0xe')](0x194);}return _0x3c6aa8;};}function handleError(_0x5ced13,_0x4d1f8e){_0x4d1f8e=_0x4d1f8e||0x1f4;return function(_0x3c5e61){logger[_0x07d8('0x1a')](_0x3c5e61[_0x07d8('0x1b')]);if(_0x3c5e61['name']){delete _0x3c5e61[_0x07d8('0x1c')];}_0x5ced13['status'](_0x4d1f8e)[_0x07d8('0x1d')](_0x3c5e61);};}exports[_0x07d8('0x1e')]=function(_0x511ed7,_0x5375f8){var _0x23098d={};var _0x152100=_[_0x07d8('0x1f')](db[_0x07d8('0x20')][_0x07d8('0x21')],function(_0x2674b9){return{'name':_0x2674b9[_0x07d8('0x22')],'type':_0x2674b9[_0x07d8('0x23')]['key']};});_0x23098d=qs['getOptions'](_0x152100,_0x511ed7);return interaction['findAll'](_0x07d8('0x24'),_0x511ed7['query'],_0x511ed7[_0x07d8('0x25')],_0x23098d,_0x152100)[_0x07d8('0x19')](respondWithFilteredResult(_0x5375f8,_0x23098d))['catch'](handleError(_0x5375f8,null));};exports[_0x07d8('0x26')]=function(_0x4501ec,_0x1f09d2){var _0x398e8a={};if(_0x4501ec['query'][_0x07d8('0x23')]&&_0x4501ec[_0x07d8('0x27')][_0x07d8('0x23')]===_0x07d8('0x28')){_0x398e8a[_0x07d8('0x28')]=_0x4501ec[_0x07d8('0x29')]['id'];}else{_0x398e8a['id']=_0x4501ec[_0x07d8('0x29')]['id'];}var _0x56b03c={'raw':![],'where':_0x398e8a},_0x5bb7b9={};_0x5bb7b9[_0x07d8('0x2a')]=_[_0x07d8('0x2b')](db['OpenchannelInteraction']['rawAttributes']);_0x5bb7b9[_0x07d8('0x27')]=_['keys'](_0x4501ec[_0x07d8('0x27')]);_0x5bb7b9[_0x07d8('0x2c')]=_[_0x07d8('0x2d')](_0x5bb7b9['model'],_0x5bb7b9[_0x07d8('0x27')]);_0x56b03c[_0x07d8('0x2e')]=_[_0x07d8('0x2d')](_0x5bb7b9[_0x07d8('0x2a')],qs['fields'](_0x4501ec[_0x07d8('0x27')][_0x07d8('0x2f')]));_0x56b03c[_0x07d8('0x2e')]=_0x56b03c[_0x07d8('0x2e')]['length']?_0x56b03c[_0x07d8('0x2e')]:_0x5bb7b9[_0x07d8('0x2a')];if(_0x4501ec[_0x07d8('0x27')][_0x07d8('0x30')]){_0x56b03c[_0x07d8('0x31')]=[{'all':!![]}];}_0x56b03c=_[_0x07d8('0x32')]({},_0x56b03c,_0x4501ec[_0x07d8('0x33')]);return db[_0x07d8('0x20')][_0x07d8('0x34')](_0x56b03c)[_0x07d8('0x19')](handleEntityNotFound(_0x1f09d2,null))[_0x07d8('0x19')](respondWithResult(_0x1f09d2,null))[_0x07d8('0x35')](handleError(_0x1f09d2,null));};exports[_0x07d8('0x36')]=function(_0x368da8,_0x119573){return db[_0x07d8('0x20')][_0x07d8('0x36')](_0x368da8[_0x07d8('0x37')],{})[_0x07d8('0x19')](respondWithResult(_0x119573,0xc9))['catch'](handleError(_0x119573,null));};exports[_0x07d8('0x18')]=function(_0x19e43d,_0x506f41){if(_0x19e43d['body']['id']){delete _0x19e43d[_0x07d8('0x37')]['id'];}return db[_0x07d8('0x20')][_0x07d8('0x34')]({'where':{'id':_0x19e43d[_0x07d8('0x29')]['id']}})[_0x07d8('0x19')](handleEntityNotFound(_0x506f41,null))[_0x07d8('0x19')](saveUpdates(_0x19e43d['body'],null))['then'](respondWithResult(_0x506f41,null))[_0x07d8('0x35')](handleError(_0x506f41,null));};exports[_0x07d8('0x38')]=function(_0x1c604a,_0x989f00){return db['OpenchannelInteraction'][_0x07d8('0x34')]({'where':{'id':_0x1c604a[_0x07d8('0x29')]['id']}})[_0x07d8('0x19')](handleEntityNotFound(_0x989f00,null))[_0x07d8('0x19')](removeEntity(_0x989f00,null))['catch'](handleError(_0x989f00,null));};exports[_0x07d8('0x39')]=function(_0x41db3c,_0x3775de){return db[_0x07d8('0x20')][_0x07d8('0x39')]()['then'](respondWithResult(_0x3775de,null))[_0x07d8('0x35')](handleError(_0x3775de,null));};exports[_0x07d8('0x3a')]=function(_0x2823d3,_0x5b6762){return db[_0x07d8('0x3b')]['find']({'where':{'id':_0x2823d3[_0x07d8('0x29')]['id']}})['then'](handleEntityNotFound(_0x5b6762,null))[_0x07d8('0x19')](function(_0x29632b){if(_0x29632b){return _0x29632b[_0x07d8('0x3a')](_0x2823d3['body'][_0x07d8('0x3c')],_['omit'](_0x2823d3[_0x07d8('0x37')],[_0x07d8('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x5b6762,null))['catch'](handleError(_0x5b6762,null));};exports[_0x07d8('0x3d')]=function(_0x1c9bbb,_0x38631d){var _0x3d8493={'raw':![],'where':{}};var _0x4a0ab3={};var _0x1aa0c6={'count':0x0,'rows':[]};return db[_0x07d8('0x20')][_0x07d8('0x3e')]({'where':{'id':_0x1c9bbb[_0x07d8('0x29')]['id']}})[_0x07d8('0x19')](handleEntityNotFound(_0x38631d,null))['then'](function(_0x2e416a){if(_0x2e416a){_0x4a0ab3[_0x07d8('0x2a')]=_['keys'](db[_0x07d8('0x3b')][_0x07d8('0x21')]);_0x4a0ab3[_0x07d8('0x27')]=_['keys'](_0x1c9bbb['query']);_0x4a0ab3[_0x07d8('0x2c')]=_[_0x07d8('0x2d')](_0x4a0ab3['model'],_0x4a0ab3['query']);_0x3d8493[_0x07d8('0x2e')]=_['intersection'](_0x4a0ab3[_0x07d8('0x2a')],qs[_0x07d8('0x2f')](_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x2f')]));_0x3d8493[_0x07d8('0x2e')]=_0x3d8493['attributes'][_0x07d8('0x3f')]?_0x3d8493[_0x07d8('0x2e')]:_0x4a0ab3[_0x07d8('0x2a')];if(!_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x40')](_0x07d8('0x41'))){_0x3d8493[_0x07d8('0x14')]=qs[_0x07d8('0x14')](_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x14')]);_0x3d8493[_0x07d8('0x12')]=qs[_0x07d8('0x12')](_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x12')]);}_0x3d8493[_0x07d8('0x42')]=qs[_0x07d8('0x43')](_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x43')]);_0x3d8493[_0x07d8('0x44')]=qs[_0x07d8('0x2c')](_['pick'](_0x1c9bbb['query'],_0x4a0ab3['filters']));_0x3d8493[_0x07d8('0x44')][_0x07d8('0x45')]=_0x2e416a['id'];if(_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x46')]){_0x3d8493['where']=_['merge'](_0x3d8493[_0x07d8('0x44')],{'$or':_[_0x07d8('0x1f')](_0x3d8493[_0x07d8('0x2e')],function(_0x5cca9c){var _0x728952={};_0x728952[_0x5cca9c]={'$like':'%'+_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x46')]+'%'};return _0x728952;})});}if(_0x1c9bbb['query'][_0x07d8('0x47')]){var _0x2bd9ff=_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x47')]['split'](',');var _0xc555b3={};_0xc555b3[_0x2bd9ff[0x0]]={'$gte':moment(_0x2bd9ff[0x1])[_0x07d8('0x48')](_0x07d8('0x49'))};_0x3d8493[_0x07d8('0x44')]=_[_0x07d8('0x32')](_0x3d8493[_0x07d8('0x44')],_0xc555b3);}_0x3d8493=_[_0x07d8('0x32')]({},_0x3d8493,_0x1c9bbb['options']);return db[_0x07d8('0x3b')][_0x07d8('0x15')]({'where':_0x3d8493['where']})[_0x07d8('0x19')](function(_0x5d438d){_0x1aa0c6['count']=_0x5d438d;if(_0x1c9bbb[_0x07d8('0x27')][_0x07d8('0x30')]){_0x3d8493[_0x07d8('0x31')]=[{'all':!![]}];}return db[_0x07d8('0x3b')][_0x07d8('0x4a')](_0x3d8493);})[_0x07d8('0x19')](function(_0x15870e){_0x1aa0c6[_0x07d8('0x4b')]=_0x15870e;return _0x1aa0c6;});}})[_0x07d8('0x19')](respondWithFilteredResult(_0x38631d,_0x3d8493))[_0x07d8('0x35')](handleError(_0x38631d,null));};exports[_0x07d8('0x4c')]=function(_0x2b6e94,_0x3fe93f){return db['OpenchannelInteraction'][_0x07d8('0x34')]({'where':{'id':_0x2b6e94['params']['id']}})[_0x07d8('0x19')](handleEntityNotFound(_0x3fe93f,null))[_0x07d8('0x19')](function(_0x5647c2){if(_0x5647c2){return _0x5647c2[_0x07d8('0x4d')](_0x2b6e94[_0x07d8('0x37')][_0x07d8('0x3c')],_[_0x07d8('0x4e')](_0x2b6e94[_0x07d8('0x37')],[_0x07d8('0x3c'),'id'])||{})[_0x07d8('0x4f')](function(){return db[_0x07d8('0x50')][_0x07d8('0x4a')]({'attributes':['id',_0x07d8('0x1c'),_0x07d8('0x51')],'where':{'id':_0x2b6e94[_0x07d8('0x37')][_0x07d8('0x3c')]}});})[_0x07d8('0x19')](function(_0x5c2588){socket[_0x07d8('0x52')](_0x07d8('0x53'),{'id':Number(_0x2b6e94[_0x07d8('0x29')]['id']),'tags':_0x5c2588||[]});return{'id':Number(_0x2b6e94[_0x07d8('0x29')]['id']),'tags':_0x5c2588||[]};});}})[_0x07d8('0x19')](respondWithResult(_0x3fe93f,null))['catch'](handleError(_0x3fe93f,null));};exports[_0x07d8('0x54')]=function(_0x4999a7,_0x381534){return db[_0x07d8('0x20')]['find']({'where':{'id':_0x4999a7[_0x07d8('0x29')]['id']}})['then'](handleEntityNotFound(_0x381534,null))[_0x07d8('0x19')](function(_0x4e39df){if(_0x4e39df){return _0x4e39df[_0x07d8('0x54')](_0x4999a7[_0x07d8('0x27')]['ids']);}})['then'](respondWithStatusCode(_0x381534,null))[_0x07d8('0x35')](handleError(_0x381534,null));};exports[_0x07d8('0x55')]=function(_0x5cde12,_0x223df7){var _0x4c23f6=moment()[_0x07d8('0x56')]()[_0x07d8('0x57')]();var _0x2b75fd=path['join'](config[_0x07d8('0x58')],_0x07d8('0x59'),_0x07d8('0x5a'),'tmp');var _0x35321b=path[_0x07d8('0x5b')](config['root'],_0x07d8('0x59'),_0x07d8('0x5a'),_0x07d8('0x5c'));var _0x1cd9b4=path['join'](_0x2b75fd,_0x4c23f6);var _0x4b5b08=util[_0x07d8('0x48')](_0x07d8('0x5d'),_0x5cde12[_0x07d8('0x29')]['id'],_0x4c23f6);var _0x4ca96c=path['join'](_0x2b75fd,_0x4b5b08);var _0x4fb254=[];_0x4fb254[_0x07d8('0x5e')]({'model':db[_0x07d8('0x5f')],'as':'User','attributes':['id',_0x07d8('0x60')],'raw':!![]});_0x4fb254[_0x07d8('0x5e')]({'model':db[_0x07d8('0x61')],'as':_0x07d8('0x62'),'attributes':['id',_0x07d8('0x63'),_0x07d8('0x64')],'raw':!![]});if(_0x5cde12[_0x07d8('0x27')]['attachments']){_0x4fb254['push']({'model':db[_0x07d8('0x65')],'as':_0x07d8('0x65'),'raw':!![]});}var _0x55101f=[{'model':db[_0x07d8('0x3b')],'as':'Messages','attributes':['id','body',_0x07d8('0x66'),_0x07d8('0x67'),_0x07d8('0x68'),_0x07d8('0x69')],'include':_0x4fb254}];_0x55101f[_0x07d8('0x5e')]({'model':db[_0x07d8('0x6a')],'as':'Account','attributes':['id',_0x07d8('0x1c')]});_0x55101f[_0x07d8('0x5e')]({'model':db[_0x07d8('0x5f')],'as':_0x07d8('0x6b'),'attributes':['id',_0x07d8('0x60')]});return db['OpenchannelInteraction'][_0x07d8('0x34')]({'where':{'id':_0x5cde12['params']['id']},'include':_0x55101f})['then'](handleEntityNotFound(_0x223df7,null))[_0x07d8('0x19')](function(_0x37ec00){if(_0x37ec00){var _0x4c753f=_0x37ec00[_0x07d8('0x6c')]({'plain':!![]});fs[_0x07d8('0x6d')](_0x1cd9b4);var _0x53d268={'channel':_0x07d8('0x6e'),'account':_0x4c753f[_0x07d8('0x6f')]['name'],'agent':_0x4c753f[_0x07d8('0x6b')]?_0x4c753f[_0x07d8('0x6b')]['fullname']:_0x07d8('0x70'),'createdAt':moment(_0x4c753f['createdAt'])[_0x07d8('0x48')](_0x07d8('0x49'))[_0x07d8('0x57')](),'closedAt':_0x4c753f['closed']?moment(_0x4c753f[_0x07d8('0x71')])[_0x07d8('0x48')](_0x07d8('0x49'))[_0x07d8('0x57')]():'','disposition':_0x4c753f['disposition'],'visibility':_0x4c753f[_0x07d8('0x72')]?'Public':_0x07d8('0x73'),'messages':_(_0x4c753f[_0x07d8('0x74')])[_0x07d8('0x46')]({'secret':![]})[_0x07d8('0x1f')](function(_0x49422f){if(_0x49422f[_0x07d8('0x65')]){var _0x4afb18=path[_0x07d8('0x5b')](_0x35321b,_0x49422f[_0x07d8('0x65')]['basename']);if(fs[_0x07d8('0x75')](_0x4afb18)){fs[_0x07d8('0x76')](_0x4afb18)[_0x07d8('0x77')](fs[_0x07d8('0x78')](path[_0x07d8('0x5b')](_0x1cd9b4,_0x49422f[_0x07d8('0x65')][_0x07d8('0x79')])));}}return{'date':moment(_0x49422f[_0x07d8('0x66')])['format'](_0x07d8('0x49'))[_0x07d8('0x57')](),'sender':_0x49422f[_0x07d8('0x67')]===_0x07d8('0x7a')?_0x49422f[_0x07d8('0x5f')]?_0x49422f[_0x07d8('0x5f')][_0x07d8('0x60')]:_0x07d8('0x7b'):_0x49422f['Contact'][_0x07d8('0x63')]+(_0x49422f['Contact'][_0x07d8('0x64')]?'\x20'+_0x49422f['Contact'][_0x07d8('0x64')]:''),'body':_0x49422f[_0x07d8('0x65')]?_0x49422f['Attachment']['basename']:_0x49422f[_0x07d8('0x37')],'direction':_0x49422f[_0x07d8('0x67')]===_0x07d8('0x7a')?'A':'C','secret':_0x49422f[_0x07d8('0x68')],'read':_0x49422f[_0x07d8('0x69')],'attachment':_0x49422f[_0x07d8('0x65')]};})[_0x07d8('0x7c')]()};return ejs[_0x07d8('0x7d')](path[_0x07d8('0x5b')](config[_0x07d8('0x58')],_0x07d8('0x59'),_0x07d8('0x7e'),_0x07d8('0x7f')),{'interaction':_0x53d268})[_0x07d8('0x19')](function(_0x31b3dd){var _0xecdc61=path[_0x07d8('0x5b')](_0x1cd9b4,_0x07d8('0x80')+_0x4c753f['id']+'-'+_0x4c23f6+_0x07d8('0x81'));var _0x68b5ea={'path':_0xecdc61,'channel':_0x07d8('0x6e'),'interactionId':_0x4c753f['id']};return pdf[_0x07d8('0x82')](_0x31b3dd,_0x68b5ea);})[_0x07d8('0x19')](function(){return new Promise(function(_0xa371c6,_0xa322fe){zipdir(_0x1cd9b4,{'saveTo':_0x4ca96c},function(_0x12cbbc,_0x2acf5e){if(_0x12cbbc)return _0xa322fe(_0x12cbbc);return _0xa371c6(_0x2acf5e);});})[_0x07d8('0x19')](function(){return new Promise(function(_0x585b2a,_0x2e1f0e){rimraf(_0x1cd9b4,function(_0x53b708){if(_0x53b708)_0x2e1f0e(_0x53b708);return _0x585b2a();});});})[_0x07d8('0x19')](function(){return _0x223df7['download'](_0x4ca96c,_0x4b5b08,function(_0x46ab07){if(_0x46ab07){logger[_0x07d8('0x1a')](_0x07d8('0x83'),_0x46ab07);}else{fs['unlinkSync'](_0x4ca96c);}});});});}else{return _0x223df7[_0x07d8('0xe')](0xc8);}})[_0x07d8('0x35')](handleError(_0x223df7,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2490dad..e3d7efd 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 _0xc5a2=['map','findAll','unreadMessages','emit','hook','events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x1c4f25,_0x4f7d64){var _0x5b559f=function(_0x338203){while(--_0x338203){_0x1c4f25['push'](_0x1c4f25['shift']());}};_0x5b559f(++_0x4f7d64);}(_0xc5a2,0x195));var _0x2c5a=function(_0x5df6a5,_0x3b610e){_0x5df6a5=_0x5df6a5-0x0;var _0x13c870=_0xc5a2[_0x5df6a5];return _0x13c870;};'use strict';var EventEmitter=require(_0x2c5a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x2c5a('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x2c5a('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2c5a('0x3')](0x0);var events={'afterCreate':_0x2c5a('0x4'),'afterUpdate':_0x2c5a('0x5'),'afterDestroy':_0x2c5a('0x6')};function emitEvent(_0x205602){return function(_0x50cfbd,_0x3a45cd,_0x5a5e13){_0x50cfbd[_0x2c5a('0x7')]({'attributes':['id'],'raw':!![]})[_0x2c5a('0x8')](function(_0x3a6724){_0x50cfbd[_0x2c5a('0x9')](_0x2c5a('0xa'),_0x3a6724[_0x2c5a('0xb')](function(_0x27cd0e){return{'id':_0x27cd0e['id']};}));return OpenchannelMessage[_0x2c5a('0xc')]({'where':{'OpenchannelInteractionId':_0x50cfbd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2c5a('0x8')](function(_0x2ba50d){_0x50cfbd[_0x2c5a('0x9')](_0x2c5a('0xd'),_0x2ba50d['length']);OpenchannelInteractionEvents[_0x2c5a('0xe')](_0x205602+':'+_0x50cfbd['id'],_0x50cfbd);OpenchannelInteractionEvents['emit'](_0x205602,_0x50cfbd);_0x5a5e13(null);})['catch'](_0x5a5e13(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x2c5a('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x935f=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users'];(function(_0x2f9fab,_0x3cf9dd){var _0x282ffa=function(_0x30b9c5){while(--_0x30b9c5){_0x2f9fab['push'](_0x2f9fab['shift']());}};_0x282ffa(++_0x3cf9dd);}(_0x935f,0x1aa));var _0xf935=function(_0x1ae7c8,_0x4ea6a4){_0x1ae7c8=_0x1ae7c8-0x0;var _0x2327a0=_0x935f[_0x1ae7c8];return _0x2327a0;};'use strict';var EventEmitter=require(_0xf935('0x0'));var OpenchannelInteraction=require(_0xf935('0x1'))['db'][_0xf935('0x2')];var OpenchannelMessage=require(_0xf935('0x1'))['db'][_0xf935('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf935('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf935('0x5'),'afterDestroy':_0xf935('0x6')};function emitEvent(_0x5037dd){return function(_0x5899f1,_0x2a6274,_0x534868){_0x5899f1[_0xf935('0x7')]({'attributes':['id'],'raw':!![]})[_0xf935('0x8')](function(_0x38da89){_0x5899f1[_0xf935('0x9')](_0xf935('0xa'),_0x38da89[_0xf935('0xb')](function(_0x3e4b57){return{'id':_0x3e4b57['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x5899f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf935('0x8')](function(_0x528304){_0x5899f1[_0xf935('0x9')](_0xf935('0xc'),_0x528304[_0xf935('0xd')]);OpenchannelInteractionEvents[_0xf935('0xe')](_0x5037dd+':'+_0x5899f1['id'],_0x5899f1);OpenchannelInteractionEvents[_0xf935('0xe')](_0x5037dd,_0x5899f1);_0x534868(null);})[_0xf935('0xf')](_0x534868(null));};}for(var e in events){if(events[_0xf935('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xf935('0x11')](e,emitEvent(event));}}module[_0xf935('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 00cdf1a..882535f 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 _0x079c=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x079c,0x1e4));var _0xc079=function(_0x4a0d77,_0x29bbc6){_0x4a0d77=_0x4a0d77-0x0;var _0x3f3f94=_0x079c[_0x4a0d77];return _0x3f3f94;};'use strict';var _=require(_0xc079('0x0'));var util=require('util');var logger=require(_0xc079('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc079('0x2'));var fs=require('fs');var path=require(_0xc079('0x3'));var rimraf=require(_0xc079('0x4'));var config=require(_0xc079('0x5'));var attributes=require(_0xc079('0x6'));module[_0xc079('0x7')]=function(_0x1ef8aa,_0x352656){return _0x1ef8aa[_0xc079('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0xc079('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc079('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x24cfe2,_0x13fc5e,_0x2c658a){if(_0x24cfe2[_0xc079('0xb')](_0xc079('0xc'))){_0x24cfe2[_0xc079('0xd')]=moment()['format'](_0xc079('0xe'));}_0x2c658a(null,_0x24cfe2);}}});}; \ No newline at end of file +var _0x50dc=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','format','util'];(function(_0x2deb15,_0x102a17){var _0x1abb33=function(_0x1a1a10){while(--_0x1a1a10){_0x2deb15['push'](_0x2deb15['shift']());}};_0x1abb33(++_0x102a17);}(_0x50dc,0x1a3));var _0xc50d=function(_0x2069ca,_0x572dd1){_0x2069ca=_0x2069ca-0x0;var _0x28cd79=_0x50dc[_0x2069ca];return _0x28cd79;};'use strict';var _=require('lodash');var util=require(_0xc50d('0x0'));var logger=require(_0xc50d('0x1'))('api');var moment=require(_0xc50d('0x2'));var BPromise=require(_0xc50d('0x3'));var rp=require(_0xc50d('0x4'));var fs=require('fs');var path=require(_0xc50d('0x5'));var rimraf=require(_0xc50d('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xc50d('0x7')]=function(_0x1417f9,_0x1272bf){return _0x1417f9[_0xc50d('0x8')](_0xc50d('0x9'),attributes,{'tableName':_0xc50d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc50d('0xb'),'hooks':{'beforeUpdate':function(_0x5bd371,_0x2d2da4,_0x3b892d){if(_0x5bd371[_0xc50d('0xc')]('closed')){_0x5bd371['closedAt']=moment()[_0xc50d('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3b892d(null,_0x5bd371);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 5e64a9b..112c998 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 _0x47e6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','catch','lodash','util'];(function(_0x11fd35,_0x259295){var _0x3792de=function(_0x5c099c){while(--_0x5c099c){_0x11fd35['push'](_0x11fd35['shift']());}};_0x3792de(++_0x259295);}(_0x47e6,0x12b));var _0x647e=function(_0x3065f4,_0x34fd37){_0x3065f4=_0x3065f4-0x0;var _0x37c638=_0x47e6[_0x3065f4];return _0x37c638;};'use strict';var _=require(_0x647e('0x0'));var util=require(_0x647e('0x1'));var moment=require('moment');var BPromise=require(_0x647e('0x2'));var rs=require(_0x647e('0x3'));var fs=require('fs');var Redis=require(_0x647e('0x4'));var db=require(_0x647e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x647e('0x6'))(_0x647e('0x7'));var config=require('../../config/environment');var jayson=require(_0x647e('0x8'));var client=jayson[_0x647e('0x9')][_0x647e('0xa')]({'port':0x232a});config[_0x647e('0xb')]=_[_0x647e('0xc')](config[_0x647e('0xb')],{'host':_0x647e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x647e('0xb')]));require(_0x647e('0xe'))[_0x647e('0xf')](socket);function respondWithRpcPromise(_0x28fa07,_0xa1e331,_0x8a23c9){return new BPromise(function(_0x301f7d,_0x39890f){return client[_0x647e('0x10')](_0x28fa07,_0x8a23c9)[_0x647e('0x11')](function(_0x2e4da1){logger[_0x647e('0x12')](_0x647e('0x13'),_0xa1e331,_0x647e('0x14'));logger[_0x647e('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xa1e331,_0x647e('0x14'),JSON[_0x647e('0x16')](_0x2e4da1));if(_0x2e4da1['error']){if(_0x2e4da1[_0x647e('0x17')][_0x647e('0x18')]===0x1f4){logger[_0x647e('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0xa1e331,_0x2e4da1['error'][_0x647e('0x19')]);return _0x39890f(_0x2e4da1['error'][_0x647e('0x19')]);}logger[_0x647e('0x17')](_0x647e('0x13'),_0xa1e331,_0x2e4da1[_0x647e('0x17')][_0x647e('0x19')]);return _0x301f7d(_0x2e4da1[_0x647e('0x17')][_0x647e('0x19')]);}else{logger[_0x647e('0x12')](_0x647e('0x13'),_0xa1e331,_0x647e('0x14'));_0x301f7d(_0x2e4da1[_0x647e('0x1a')][_0x647e('0x19')]);}})['catch'](function(_0x147701){logger[_0x647e('0x17')](_0x647e('0x13'),_0xa1e331,_0x147701);_0x39890f(_0x147701);});});}exports[_0x647e('0x1b')]=function(_0x4a2a07){var _0x5226d6=this;return new Promise(function(_0x4058c6,_0xed462d){return db[_0x647e('0x1c')][_0x647e('0x1d')](_0x4a2a07[_0x647e('0x1e')],{'raw':_0x4a2a07[_0x647e('0x1f')]?_0x4a2a07[_0x647e('0x1f')][_0x647e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2a07[_0x647e('0x1f')]?_0x4a2a07[_0x647e('0x1f')][_0x647e('0x21')]||null:null,'attributes':_0x4a2a07['options']?_0x4a2a07['options'][_0x647e('0x22')]||null:null,'limit':_0x4a2a07[_0x647e('0x1f')]?_0x4a2a07[_0x647e('0x1f')][_0x647e('0x23')]||null:null})[_0x647e('0x11')](function(_0x1ecce3){logger[_0x647e('0x12')](_0x647e('0x1b'),_0x4a2a07);logger[_0x647e('0x15')]('UpdateOpenchannelInteraction',_0x4a2a07,JSON[_0x647e('0x16')](_0x1ecce3));_0x4058c6(_0x1ecce3);})['catch'](function(_0x54c7b6){logger[_0x647e('0x17')](_0x647e('0x1b'),_0x54c7b6[_0x647e('0x19')],_0x4a2a07);_0xed462d(_0x5226d6[_0x647e('0x17')](0x1f4,_0x54c7b6[_0x647e('0x19')]));});});};exports[_0x647e('0x24')]=function(_0xd89192){return new Promise(function(_0x55dee3,_0x5f5174){return db[_0x647e('0x1c')][_0x647e('0x25')]({'where':_0xd89192['options']?_0xd89192[_0x647e('0x1f')][_0x647e('0x21')]||null:null})[_0x647e('0x11')](function(_0x276189){if(_0x276189){return _0x276189['addTags'](_0xd89192[_0x647e('0x1e')][_0x647e('0x26')],_[_0x647e('0x27')](_0xd89192['body'],[_0x647e('0x26'),'id'])||{});}})[_0x647e('0x28')](function(_0x5022b6){logger['info'](_0x647e('0x29'),_0xd89192);logger[_0x647e('0x15')](_0x647e('0x29'),_0xd89192,JSON[_0x647e('0x16')](_0x5022b6));_0x55dee3(_0x5022b6);})[_0x647e('0x2a')](function(_0x55aa17){logger['error'](_0x647e('0x29'),_0x55aa17[_0x647e('0x19')],_0xd89192);_0x5f5174(_this[_0x647e('0x17')](0x1f4,_0x55aa17[_0x647e('0x19')]));});});}; \ No newline at end of file +var _0x93e0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./openchannelInteraction.socket','register','request','then','debug','request\x20sent','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash'];(function(_0x7d41d2,_0x35af8e){var _0x55b4ff=function(_0x3a2719){while(--_0x3a2719){_0x7d41d2['push'](_0x7d41d2['shift']());}};_0x55b4ff(++_0x35af8e);}(_0x93e0,0x1d8));var _0x093e=function(_0x1022d2,_0x38457b){_0x1022d2=_0x1022d2-0x0;var _0x5a84c4=_0x93e0[_0x1022d2];return _0x5a84c4;};'use strict';var _=require(_0x093e('0x0'));var util=require(_0x093e('0x1'));var moment=require(_0x093e('0x2'));var BPromise=require(_0x093e('0x3'));var rs=require(_0x093e('0x4'));var fs=require('fs');var Redis=require(_0x093e('0x5'));var db=require(_0x093e('0x6'))['db'];var utils=require(_0x093e('0x7'));var logger=require(_0x093e('0x8'))(_0x093e('0x9'));var config=require(_0x093e('0xa'));var jayson=require(_0x093e('0xb'));var client=jayson[_0x093e('0xc')]['http']({'port':0x232a});config[_0x093e('0xd')]=_['defaults'](config[_0x093e('0xd')],{'host':_0x093e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x093e('0xd')]));require(_0x093e('0xf'))[_0x093e('0x10')](socket);function respondWithRpcPromise(_0x5530a5,_0x4d39ff,_0x4dabc5){return new BPromise(function(_0x4fdac2,_0x35b439){return client[_0x093e('0x11')](_0x5530a5,_0x4dabc5)[_0x093e('0x12')](function(_0x2187a5){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x4d39ff,'request\x20sent');logger[_0x093e('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x4d39ff,_0x093e('0x14'),JSON['stringify'](_0x2187a5));if(_0x2187a5[_0x093e('0x15')]){if(_0x2187a5[_0x093e('0x15')][_0x093e('0x16')]===0x1f4){logger[_0x093e('0x15')](_0x093e('0x17'),_0x4d39ff,_0x2187a5[_0x093e('0x15')]['message']);return _0x35b439(_0x2187a5[_0x093e('0x15')][_0x093e('0x18')]);}logger[_0x093e('0x15')](_0x093e('0x17'),_0x4d39ff,_0x2187a5[_0x093e('0x15')][_0x093e('0x18')]);return _0x4fdac2(_0x2187a5['error'][_0x093e('0x18')]);}else{logger[_0x093e('0x19')](_0x093e('0x17'),_0x4d39ff,_0x093e('0x14'));_0x4fdac2(_0x2187a5['result'][_0x093e('0x18')]);}})[_0x093e('0x1a')](function(_0x22f9d6){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4d39ff,_0x22f9d6);_0x35b439(_0x22f9d6);});});}exports[_0x093e('0x1b')]=function(_0x6d6a9e){var _0x5d0bc6=this;return new Promise(function(_0x2159ec,_0x230c73){return db['OpenchannelInteraction'][_0x093e('0x1c')](_0x6d6a9e[_0x093e('0x1d')],{'raw':_0x6d6a9e['options']?_0x6d6a9e[_0x093e('0x1e')][_0x093e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6d6a9e[_0x093e('0x1e')]?_0x6d6a9e[_0x093e('0x1e')][_0x093e('0x20')]||null:null,'attributes':_0x6d6a9e[_0x093e('0x1e')]?_0x6d6a9e[_0x093e('0x1e')][_0x093e('0x21')]||null:null,'limit':_0x6d6a9e[_0x093e('0x1e')]?_0x6d6a9e[_0x093e('0x1e')][_0x093e('0x22')]||null:null})[_0x093e('0x12')](function(_0x3c6108){logger['info'](_0x093e('0x1b'),_0x6d6a9e);logger[_0x093e('0x13')](_0x093e('0x1b'),_0x6d6a9e,JSON[_0x093e('0x23')](_0x3c6108));_0x2159ec(_0x3c6108);})[_0x093e('0x1a')](function(_0x57ec09){logger[_0x093e('0x15')]('UpdateOpenchannelInteraction',_0x57ec09[_0x093e('0x18')],_0x6d6a9e);_0x230c73(_0x5d0bc6['error'](0x1f4,_0x57ec09['message']));});});};exports[_0x093e('0x24')]=function(_0x2ec302){return new Promise(function(_0x5a8b14,_0x1727b7){return db[_0x093e('0x25')][_0x093e('0x26')]({'where':_0x2ec302['options']?_0x2ec302['options'][_0x093e('0x20')]||null:null})[_0x093e('0x12')](function(_0x262f34){if(_0x262f34){return _0x262f34[_0x093e('0x27')](_0x2ec302[_0x093e('0x1d')][_0x093e('0x28')],_['omit'](_0x2ec302[_0x093e('0x1d')],[_0x093e('0x28'),'id'])||{});}})[_0x093e('0x29')](function(_0x4808ac){logger[_0x093e('0x19')](_0x093e('0x2a'),_0x2ec302);logger[_0x093e('0x13')](_0x093e('0x2a'),_0x2ec302,JSON['stringify'](_0x4808ac));_0x5a8b14(_0x4808ac);})[_0x093e('0x1a')](function(_0x135893){logger['error'](_0x093e('0x2a'),_0x135893[_0x093e('0x18')],_0x2ec302);_0x1727b7(_this[_0x093e('0x15')](0x1f4,_0x135893[_0x093e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e054408..356ba3e 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 _0x1a7c=['./openchannelInteraction.events','save','update','emit','removeListener','register'];(function(_0x271633,_0x1ac2b3){var _0x5ab434=function(_0x53e541){while(--_0x53e541){_0x271633['push'](_0x271633['shift']());}};_0x5ab434(++_0x1ac2b3);}(_0x1a7c,0x16e));var _0xc1a7=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x1a7c[_0x131585];return _0x1fcca2;};'use strict';var OpenchannelInteractionEvents=require(_0xc1a7('0x0'));var events=[_0xc1a7('0x1'),'remove',_0xc1a7('0x2')];function createListener(_0x5df51e,_0x50545b){return function(_0xd36b27){_0x50545b[_0xc1a7('0x3')](_0x5df51e,_0xd36b27);};}function removeListener(_0x2bd28f,_0x5310e3){return function(){OpenchannelInteractionEvents[_0xc1a7('0x4')](_0x2bd28f,_0x5310e3);};}exports[_0xc1a7('0x5')]=function(_0x463316){for(var _0xcd5714=0x0,_0x15c574=events['length'];_0xcd5714<_0x15c574;_0xcd5714++){var _0x13f4e7=events[_0xcd5714];var _0x4b7983=createListener('openchannelInteraction:'+_0x13f4e7,_0x463316);OpenchannelInteractionEvents['on'](_0x13f4e7,_0x4b7983);}}; \ No newline at end of file +var _0x81f0=['openchannelInteraction:','save','update','removeListener','register'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x81f0,0x65));var _0x081f=function(_0x4bc905,_0x59b9dc){_0x4bc905=_0x4bc905-0x0;var _0x35261f=_0x81f0[_0x4bc905];return _0x35261f;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x081f('0x0'),'remove',_0x081f('0x1')];function createListener(_0x452466,_0x1220fa){return function(_0x4d9b5d){_0x1220fa['emit'](_0x452466,_0x4d9b5d);};}function removeListener(_0x8a47be,_0xe26f53){return function(){OpenchannelInteractionEvents[_0x081f('0x2')](_0x8a47be,_0xe26f53);};}exports[_0x081f('0x3')]=function(_0x3304e7){for(var _0x49d554=0x0,_0x47dfab=events['length'];_0x49d554<_0x47dfab;_0x49d554++){var _0x5de20e=events[_0x49d554];var _0x8c5681=createListener(_0x081f('0x4')+_0x5de20e,_0x3304e7);OpenchannelInteractionEvents['on'](_0x5de20e,_0x8c5681);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 48c227c..56d2006 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x163b81,_0x4abb60){var _0x4c206e=function(_0x26a795){while(--_0x26a795){_0x163b81['push'](_0x163b81['shift']());}};_0x4c206e(++_0x4abb60);}(_0xe706,0xa3));var _0x6e70=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0xe706[_0x1cc961];return _0x471d86;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x1e1f17,_0x4bd574){var _0x465b52=function(_0x46accd){while(--_0x46accd){_0x1e1f17['push'](_0x1e1f17['shift']());}};_0x465b52(++_0x4bd574);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xcb91[_0x51020b];return _0x371e47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 5948db3..b8c8be0 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 _0x17a7=['STRING','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x17a7,0xc2));var _0x717a=function(_0x567654,_0x301b0c){_0x567654=_0x567654-0x0;var _0x58fef5=_0x17a7[_0x567654];return _0x58fef5;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x717a('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x717a('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x717a('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x717a('0x2')]('in','out'),'defaultValue':_0x717a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x717a('0x4')]},'providerResponse':{'type':Sequelize[_0x717a('0x5')]}}; \ No newline at end of file +var _0x97e7=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x97e7,0x1a1));var _0x797e=function(_0x2d7b3d,_0x1c13f8){_0x2d7b3d=_0x2d7b3d-0x0;var _0x4f7d89=_0x97e7[_0x2d7b3d];return _0x4f7d89;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'body':{'type':Sequelize[_0x797e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x797e('0x4')]('in',_0x797e('0x5')),'defaultValue':_0x797e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x797e('0x6')]},'providerName':{'type':Sequelize[_0x797e('0x7')]},'providerResponse':{'type':Sequelize[_0x797e('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7c677a6..6feeda7 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 _0x6f69=['email','EventManager','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','params','includeAll','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','get','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','internal','SIP/%s','channel','motionChannel','event','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6f69,0x8d));var _0x96f6=function(_0x65d83e,_0x2609e0){_0x65d83e=_0x65d83e-0x0;var _0x1a2e19=_0x6f69[_0x65d83e];return _0x1a2e19;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96f6('0x1'));var jsonpatch=require(_0x96f6('0x2'));var rp=require(_0x96f6('0x3'));var moment=require(_0x96f6('0x4'));var BPromise=require(_0x96f6('0x5'));var Mustache=require(_0x96f6('0x6'));var util=require(_0x96f6('0x7'));var path=require(_0x96f6('0x8'));var sox=require(_0x96f6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f6('0xa'));var _=require(_0x96f6('0xb'));var squel=require('squel');var crypto=require(_0x96f6('0xc'));var jsforce=require(_0x96f6('0xd'));var deskjs=require(_0x96f6('0xe'));var toCsv=require(_0x96f6('0xf'));var querystring=require(_0x96f6('0x10'));var Papa=require(_0x96f6('0x11'));var Redis=require(_0x96f6('0x12'));var authService=require(_0x96f6('0x13'));var qs=require(_0x96f6('0x14'));var as=require(_0x96f6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96f6('0x16'))('api');var utils=require(_0x96f6('0x17'));var config=require(_0x96f6('0x18'));var licenseUtil=require(_0x96f6('0x19'));var db=require(_0x96f6('0x1a'))['db'];config[_0x96f6('0x1b')]=_[_0x96f6('0x1c')](config[_0x96f6('0x1b')],{'host':_0x96f6('0x1d'),'port':0x18eb});var socket=require(_0x96f6('0x1e'))(new Redis(config['redis']));require(_0x96f6('0x1f'))[_0x96f6('0x20')](socket);var jayson=require(_0x96f6('0x21'));var client=jayson[_0x96f6('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0x96f6('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1bc3cd,_0x14e542,_0x35bda2,_0x1c6b8a){return new BPromise(function(_0x546b1c,_0x4d5ad7){var _0x49ce30=_0x1c6b8a||client;return _0x49ce30[_0x96f6('0x24')](_0x1bc3cd,_0x35bda2)[_0x96f6('0x25')](function(_0x383507){logger['info'](_0x96f6('0x26'),_0x14e542,_0x96f6('0x27'));logger[_0x96f6('0x28')](_0x96f6('0x29'),_0x14e542,_0x96f6('0x27'),JSON[_0x96f6('0x2a')](_0x383507));if(_0x383507['error']){if(_0x383507['error'][_0x96f6('0x2b')]===0x1f4){logger[_0x96f6('0x2c')](_0x96f6('0x26'),_0x14e542,_0x383507[_0x96f6('0x2c')][_0x96f6('0x2d')]);return _0x4d5ad7(_0x383507['error'][_0x96f6('0x2d')]);}logger[_0x96f6('0x2c')](_0x96f6('0x26'),_0x14e542,_0x383507[_0x96f6('0x2c')][_0x96f6('0x2d')]);return _0x546b1c(_0x383507[_0x96f6('0x2c')][_0x96f6('0x2d')]);}else{logger['info'](_0x96f6('0x26'),_0x14e542,'request\x20sent');_0x546b1c(_0x383507[_0x96f6('0x2e')][_0x96f6('0x2d')]);}})[_0x96f6('0x2f')](function(_0x52cc66){logger['error'](_0x96f6('0x26'),_0x14e542,_0x52cc66);_0x4d5ad7(_0x52cc66);});});}function respondWithStatusCode(_0x40a146,_0x48afbb){_0x48afbb=_0x48afbb||0xcc;return function(_0x42f930){if(_0x42f930){return _0x40a146['sendStatus'](_0x48afbb);}return _0x40a146[_0x96f6('0x30')](_0x48afbb)[_0x96f6('0x31')]();};}function respondWithResult(_0x2a48ac,_0x53c03c){_0x53c03c=_0x53c03c||0xc8;return function(_0x3c9c91){if(_0x3c9c91){return _0x2a48ac[_0x96f6('0x30')](_0x53c03c)[_0x96f6('0x32')](_0x3c9c91);}};}function respondWithFilteredResult(_0x3bb8d3,_0x42fef2){return function(_0x475da1){if(_0x475da1){var _0x2b780b=typeof _0x42fef2[_0x96f6('0x33')]===_0x96f6('0x34')&&typeof _0x42fef2['limit']==='undefined';var _0x3f87b1=_0x475da1['count'];var _0x51d3b4=_0x2b780b?0x0:_0x42fef2['offset'];var _0x2da4cf=_0x2b780b?_0x475da1[_0x96f6('0x35')]:_0x42fef2[_0x96f6('0x33')]+_0x42fef2['limit'];var _0x135ce2;if(_0x2da4cf>=_0x3f87b1){_0x2da4cf=_0x3f87b1;_0x135ce2=0xc8;}else{_0x135ce2=0xce;}_0x3bb8d3[_0x96f6('0x30')](_0x135ce2);return _0x3bb8d3[_0x96f6('0x36')](_0x96f6('0x37'),_0x51d3b4+'-'+_0x2da4cf+'/'+_0x3f87b1)[_0x96f6('0x32')](_0x475da1);}return null;};}function patchUpdates(_0x5579a1){return function(_0x72e291){try{jsonpatch[_0x96f6('0x38')](_0x72e291,_0x5579a1,!![]);}catch(_0x345fd1){return BPromise[_0x96f6('0x39')](_0x345fd1);}return _0x72e291[_0x96f6('0x3a')]();};}function saveUpdates(_0x4b602b,_0x906a2b){return function(_0x5d05ff){if(_0x5d05ff){return _0x5d05ff[_0x96f6('0x3b')](_0x4b602b)[_0x96f6('0x25')](function(_0x2c064f){return _0x2c064f;});}return null;};}function removeEntity(_0x346ede,_0x45c7b6){return function(_0x597d87){if(_0x597d87){return _0x597d87['destroy']()[_0x96f6('0x25')](function(){_0x346ede[_0x96f6('0x30')](0xcc)[_0x96f6('0x31')]();});}};}function handleEntityNotFound(_0x13a5c0,_0x2e70fe){return function(_0x4af55c){if(!_0x4af55c){_0x13a5c0[_0x96f6('0x3c')](0x194);}return _0x4af55c;};}function handleError(_0x9c92d2,_0x203471){_0x203471=_0x203471||0x1f4;return function(_0x5a8dc0){logger['error'](_0x5a8dc0[_0x96f6('0x3d')]);if(_0x5a8dc0[_0x96f6('0x3e')]){delete _0x5a8dc0['name'];}_0x9c92d2[_0x96f6('0x30')](_0x203471)[_0x96f6('0x3f')](_0x5a8dc0);};}exports[_0x96f6('0x40')]=function(_0x47cd6b,_0x2c8377){var _0x4fa761={},_0x3b7fb6={},_0x2af6c3={'count':0x0,'rows':[]};var _0x3b78cc=_[_0x96f6('0x41')](db[_0x96f6('0x42')][_0x96f6('0x43')],function(_0xd091df){return{'name':_0xd091df[_0x96f6('0x44')],'type':_0xd091df['type'][_0x96f6('0x45')]};});_0x3b7fb6[_0x96f6('0x46')]=_[_0x96f6('0x41')](_0x3b78cc,_0x96f6('0x3e'));_0x3b7fb6[_0x96f6('0x47')]=_[_0x96f6('0x48')](_0x47cd6b[_0x96f6('0x47')]);_0x3b7fb6[_0x96f6('0x49')]=_[_0x96f6('0x4a')](_0x3b7fb6[_0x96f6('0x46')],_0x3b7fb6['query']);_0x4fa761[_0x96f6('0x4b')]=_[_0x96f6('0x4a')](_0x3b7fb6['model'],qs['fields'](_0x47cd6b[_0x96f6('0x47')][_0x96f6('0x4c')]));_0x4fa761[_0x96f6('0x4b')]=_0x4fa761[_0x96f6('0x4b')][_0x96f6('0x4d')]?_0x4fa761['attributes']:_0x3b7fb6[_0x96f6('0x46')];if(!_0x47cd6b[_0x96f6('0x47')][_0x96f6('0x4e')]('nolimit')){_0x4fa761[_0x96f6('0x4f')]=qs['limit'](_0x47cd6b['query'][_0x96f6('0x4f')]);_0x4fa761[_0x96f6('0x33')]=qs['offset'](_0x47cd6b['query'][_0x96f6('0x33')]);}_0x4fa761['order']=qs[_0x96f6('0x50')](_0x47cd6b[_0x96f6('0x47')][_0x96f6('0x50')]);_0x4fa761[_0x96f6('0x51')]=qs['filters'](_[_0x96f6('0x52')](_0x47cd6b[_0x96f6('0x47')],_0x3b7fb6[_0x96f6('0x49')]),_0x3b78cc);if(_0x47cd6b[_0x96f6('0x47')][_0x96f6('0x53')]){_0x4fa761[_0x96f6('0x51')]=_[_0x96f6('0x54')](_0x4fa761[_0x96f6('0x51')],{'$or':_[_0x96f6('0x41')](_0x3b78cc,function(_0x1ec060){if(_0x1ec060[_0x96f6('0x55')]!=='VIRTUAL'){var _0x16871a={};_0x16871a[_0x1ec060['name']]={'$like':'%'+_0x47cd6b[_0x96f6('0x47')][_0x96f6('0x53')]+'%'};return _0x16871a;}})});}_0x4fa761=_[_0x96f6('0x54')]({},_0x4fa761,_0x47cd6b[_0x96f6('0x56')]);var _0x151261={'where':_0x4fa761['where']};return db[_0x96f6('0x42')]['count'](_0x151261)['then'](function(_0x568d64){_0x2af6c3['count']=_0x568d64;if(_0x47cd6b['query']['includeAll']){_0x4fa761[_0x96f6('0x57')]=[{'all':!![]}];}return db[_0x96f6('0x42')][_0x96f6('0x58')](_0x4fa761);})[_0x96f6('0x25')](function(_0x7f0326){_0x2af6c3[_0x96f6('0x59')]=_0x7f0326;return _0x2af6c3;})[_0x96f6('0x25')](respondWithFilteredResult(_0x2c8377,_0x4fa761))[_0x96f6('0x2f')](handleError(_0x2c8377,null));};exports[_0x96f6('0x5a')]=function(_0xcf9c26,_0x617cb2){var _0x31fddd={'raw':!![],'where':{'id':_0xcf9c26[_0x96f6('0x5b')]['id']}},_0x36433d={};_0x36433d[_0x96f6('0x46')]=_[_0x96f6('0x48')](db[_0x96f6('0x42')]['rawAttributes']);_0x36433d[_0x96f6('0x47')]=_['keys'](_0xcf9c26[_0x96f6('0x47')]);_0x36433d[_0x96f6('0x49')]=_['intersection'](_0x36433d[_0x96f6('0x46')],_0x36433d[_0x96f6('0x47')]);_0x31fddd['attributes']=_[_0x96f6('0x4a')](_0x36433d[_0x96f6('0x46')],qs[_0x96f6('0x4c')](_0xcf9c26[_0x96f6('0x47')]['fields']));_0x31fddd['attributes']=_0x31fddd[_0x96f6('0x4b')][_0x96f6('0x4d')]?_0x31fddd['attributes']:_0x36433d[_0x96f6('0x46')];if(_0xcf9c26[_0x96f6('0x47')][_0x96f6('0x5c')]){_0x31fddd[_0x96f6('0x57')]=[{'all':!![]}];}_0x31fddd=_[_0x96f6('0x54')]({},_0x31fddd,_0xcf9c26[_0x96f6('0x56')]);return db['OpenchannelMessage'][_0x96f6('0x5d')](_0x31fddd)['then'](handleEntityNotFound(_0x617cb2,null))[_0x96f6('0x25')](respondWithResult(_0x617cb2,null))[_0x96f6('0x2f')](handleError(_0x617cb2,null));};exports[_0x96f6('0x5e')]=function(_0x2b1b27,_0x30be18){return db[_0x96f6('0x42')]['create'](_0x2b1b27[_0x96f6('0x5f')],{})[_0x96f6('0x25')](respondWithResult(_0x30be18,0xc9))[_0x96f6('0x2f')](handleError(_0x30be18,null));};exports[_0x96f6('0x3b')]=function(_0x36c02c,_0x3fc198){if(_0x36c02c[_0x96f6('0x5f')]['id']){delete _0x36c02c['body']['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x36c02c['params']['id']}})[_0x96f6('0x25')](handleEntityNotFound(_0x3fc198,null))[_0x96f6('0x25')](saveUpdates(_0x36c02c[_0x96f6('0x5f')],null))[_0x96f6('0x25')](respondWithResult(_0x3fc198,null))[_0x96f6('0x2f')](handleError(_0x3fc198,null));};exports[_0x96f6('0x60')]=function(_0xae500e,_0x4ff67e){return db[_0x96f6('0x42')]['find']({'where':{'id':_0xae500e[_0x96f6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4ff67e,null))[_0x96f6('0x25')](removeEntity(_0x4ff67e,null))['catch'](handleError(_0x4ff67e,null));};exports[_0x96f6('0x61')]=function(_0x26f06e,_0x25d412){return db['OpenchannelMessage'][_0x96f6('0x61')]()[_0x96f6('0x25')](respondWithResult(_0x25d412,null))[_0x96f6('0x2f')](handleError(_0x25d412,null));};var interaction_log=require(_0x96f6('0x16'))(_0x96f6('0x62'));exports[_0x96f6('0x63')]=function(_0x40c162,_0x3a3a76,_0x6f2a92){var _0x15b9a6={'agent':{},'channel':_0x96f6('0x64')};if(_0x40c162['body']['id']){delete _0x40c162[_0x96f6('0x5f')]['id'];}_0x40c162[_0x96f6('0x5f')][_0x96f6('0x65')]=!![];_0x40c162[_0x96f6('0x5f')][_0x96f6('0x66')]=moment()[_0x96f6('0x67')](_0x96f6('0x68'));_0x40c162[_0x96f6('0x5f')][_0x96f6('0x69')]=_0x40c162[_0x96f6('0x5f')][_0x96f6('0x69')]||_0x40c162[_0x96f6('0x6a')]['id'];_0x15b9a6[_0x96f6('0x6b')]['id']=_0x40c162[_0x96f6('0x5f')]['UserId'];return db[_0x96f6('0x42')]['find']({'where':{'id':_0x40c162[_0x96f6('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a3a76,null))['then'](saveUpdates(_0x40c162['body'],null))['then'](function(_0x210eeb){if(_0x210eeb){_0x15b9a6[_0x96f6('0x2d')]=_0x210eeb['get']({'plain':!![]});return db[_0x96f6('0x6c')][_0x96f6('0x5d')]({'where':{'id':_0x210eeb[_0x96f6('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x3a3a76,null))[_0x96f6('0x25')](function(_0x27cf4b){if(_0x27cf4b){return _0x27cf4b[_0x96f6('0x3b')]({'UserId':_0x40c162[_0x96f6('0x5f')][_0x96f6('0x69')],'read1stAt':_['isNil'](_0x27cf4b[_0x96f6('0x6e')])?moment()[_0x96f6('0x67')](_0x96f6('0x68')):undefined});}return null;})['then'](function(_0x3917a0){if(_0x3917a0){_0x15b9a6[_0x96f6('0x6f')]=_0x3917a0[_0x96f6('0x70')]({'plain':!![]});interaction_log[_0x96f6('0x71')](_0x96f6('0x72'),_0x40c162[_0x96f6('0x6a')]['id'],_0x40c162[_0x96f6('0x6a')][_0x96f6('0x3e')],_0x40c162['user'][_0x96f6('0x73')],_0x15b9a6[_0x96f6('0x6f')]['id'],_0x40c162[_0x96f6('0x5f')]?JSON[_0x96f6('0x2a')](_0x40c162[_0x96f6('0x5f')]):_0x96f6('0x74'));return respondWithRpcPromise(_0x96f6('0x75'),'acceptMessage',_0x15b9a6);}return null;})[_0x96f6('0x25')](function(_0x4548db){var _0x5d9fa7=_0x96f6('0x76')+_0x4548db[_0x96f6('0x2d')][_0x96f6('0x77')];return db['sequelize']['query'](_0x5d9fa7,{'type':db[_0x96f6('0x78')]['QueryTypes'][_0x96f6('0x79')],'raw':!![]})['then'](function(_0x1af7cd){return _0x1af7cd;});})[_0x96f6('0x25')](function(_0x5a38d1){if(_0x5a38d1){_0x15b9a6[_0x96f6('0x2d')][_0x96f6('0x7a')]=_0x5a38d1[0x0];if(!_0x40c162[_0x96f6('0x5f')][_0x96f6('0x69')])return;return db[_0x96f6('0x7b')]['find']({'where':{'id':_0x40c162[_0x96f6('0x5f')]['UserId'],'role':'agent'},'attributes':['id','name',_0x96f6('0x7c'),'email',_0x96f6('0x7d')],'raw':!![]});}return null;})['then'](function(_0x46fefe){if(!_0x46fefe)return null;_0x15b9a6[_0x96f6('0x2d')][_0x96f6('0x6b')]=_0x46fefe;return _0x15b9a6;})['then'](function(_0x268e2a){if(_0x268e2a){if(_0x40c162[_0x96f6('0x5f')]['manual']){_0x15b9a6['message']['interface']=util[_0x96f6('0x67')](_0x96f6('0x7e'),_0x40c162['user']['name']);_0x15b9a6[_0x96f6('0x2d')][_0x96f6('0x7f')]=_0x15b9a6['channel'];_0x15b9a6['message'][_0x96f6('0x80')]=_0x15b9a6[_0x96f6('0x7f')];_0x15b9a6[_0x96f6('0x2d')][_0x96f6('0x81')]=_0x96f6('0x63');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x96f6('0x82'),'message':_0x15b9a6[_0x96f6('0x2d')]},client9002)['then'](function(){return _0x15b9a6;});}return _0x15b9a6;}return null;})[_0x96f6('0x25')](respondWithResult(_0x3a3a76,null))[_0x96f6('0x2f')](handleError(_0x3a3a76,null));};var interaction_log=require('../../config/logger')(_0x96f6('0x62'));exports[_0x96f6('0x39')]=function(_0xf19ca3,_0x2f48ff,_0x32411e){var _0x1f37cd={'agent':{},'channel':_0x96f6('0x64')};if(_0xf19ca3[_0x96f6('0x5f')]['id']){delete _0xf19ca3['body']['id'];}_0xf19ca3['body']['UserId']=_0xf19ca3[_0x96f6('0x5f')][_0x96f6('0x69')]||_0xf19ca3['user']['id'];_0x1f37cd[_0x96f6('0x6b')]['id']=_0xf19ca3[_0x96f6('0x5f')]['UserId'];return db['OpenchannelMessage'][_0x96f6('0x5d')]({'where':{'id':_0xf19ca3[_0x96f6('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f48ff,null))[_0x96f6('0x25')](function(_0x3371be){if(_0x3371be){_0x1f37cd['message']=_0x3371be['get']({'plain':!![]});return db[_0x96f6('0x6c')][_0x96f6('0x5d')]({'where':{'id':_0x3371be[_0x96f6('0x6d')]}});}return null;})[_0x96f6('0x25')](handleEntityNotFound(_0x2f48ff,null))['then'](function(_0x57a565){if(_0x57a565){_0x1f37cd['interaction']=_0x57a565[_0x96f6('0x70')]({'plain':!![]});interaction_log['info'](_0x96f6('0x83'),_0xf19ca3[_0x96f6('0x6a')]['id'],_0xf19ca3['user']['name'],_0xf19ca3[_0x96f6('0x6a')][_0x96f6('0x73')],_0x1f37cd['interaction']['id'],_0xf19ca3[_0x96f6('0x5f')]?JSON[_0x96f6('0x2a')](_0xf19ca3[_0x96f6('0x5f')]):_0x96f6('0x74'));return respondWithRpcPromise(_0x96f6('0x84'),_0x96f6('0x85'),_0x1f37cd);}return null;})[_0x96f6('0x25')](function(_0x37e61e){var _0x5a100c=_0x96f6('0x76')+_0x37e61e[_0x96f6('0x2d')][_0x96f6('0x77')];return db['sequelize'][_0x96f6('0x47')](_0x5a100c,{'type':db['Sequelize'][_0x96f6('0x86')][_0x96f6('0x79')],'raw':!![]})['then'](function(_0x42b552){return _0x42b552;});})[_0x96f6('0x25')](function(_0x3f9fb2){if(_0x3f9fb2){_0x1f37cd[_0x96f6('0x2d')][_0x96f6('0x7a')]=_0x3f9fb2[0x0];if(!_0xf19ca3[_0x96f6('0x5f')][_0x96f6('0x69')])return;return db[_0x96f6('0x7b')]['find']({'where':{'id':_0xf19ca3[_0x96f6('0x5f')]['UserId'],'role':_0x96f6('0x6b')},'attributes':['id',_0x96f6('0x3e'),_0x96f6('0x7c'),_0x96f6('0x87'),_0x96f6('0x7d')],'raw':!![]});}return null;})[_0x96f6('0x25')](function(_0x1b76e8){if(!_0x1b76e8)return null;_0x1f37cd[_0x96f6('0x2d')][_0x96f6('0x6b')]=_0x1b76e8;return _0x1f37cd;})[_0x96f6('0x25')](function(_0xaade2b){if(_0xaade2b){_0xaade2b[_0x96f6('0x2d')]['interface']=util[_0x96f6('0x67')](_0x96f6('0x7e'),_0xf19ca3['user'][_0x96f6('0x3e')]);_0xaade2b['message'][_0x96f6('0x7f')]=_0x1f37cd['channel'];_0xaade2b[_0x96f6('0x2d')][_0x96f6('0x80')]=_0x1f37cd['channel'];_0xaade2b['message'][_0x96f6('0x81')]='reject';respondWithRpcPromise(_0x96f6('0x88'),'EventManager',{'event':_0x96f6('0x89'),'message':_0xaade2b[_0x96f6('0x2d')]},client9002);return _0x1f37cd;}return null;})[_0x96f6('0x25')](respondWithResult(_0x2f48ff,null))[_0x96f6('0x2f')](handleError(_0x2f48ff,null));}; \ No newline at end of file +var _0x8a03=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','destroy','then','stack','name','send','index','OpenchannelMessage','rawAttributes','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','update','describe','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','openchannel-interactions','reject','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','fullname','motionChannel','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8a03,0xf0));var _0x38a0=function(_0x295de7,_0x158885){_0x295de7=_0x295de7-0x0;var _0x5f38d4=_0x8a03[_0x295de7];return _0x5f38d4;};'use strict';var emlformat=require(_0x38a0('0x0'));var rimraf=require(_0x38a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38a0('0x2'));var moment=require(_0x38a0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38a0('0x4'));var util=require(_0x38a0('0x5'));var path=require(_0x38a0('0x6'));var sox=require('sox');var csv=require(_0x38a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38a0('0x8'));var squel=require(_0x38a0('0x9'));var crypto=require(_0x38a0('0xa'));var jsforce=require(_0x38a0('0xb'));var deskjs=require(_0x38a0('0xc'));var toCsv=require(_0x38a0('0x7'));var querystring=require('querystring');var Papa=require(_0x38a0('0xd'));var Redis=require(_0x38a0('0xe'));var authService=require(_0x38a0('0xf'));var qs=require(_0x38a0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38a0('0x11'));var logger=require(_0x38a0('0x12'))(_0x38a0('0x13'));var utils=require('../../config/utils');var config=require(_0x38a0('0x14'));var licenseUtil=require(_0x38a0('0x15'));var db=require(_0x38a0('0x16'))['db'];config[_0x38a0('0x17')]=_[_0x38a0('0x18')](config['redis'],{'host':_0x38a0('0x19'),'port':0x18eb});var socket=require(_0x38a0('0x1a'))(new Redis(config[_0x38a0('0x17')]));require(_0x38a0('0x1b'))[_0x38a0('0x1c')](socket);var jayson=require(_0x38a0('0x1d'));var client=jayson[_0x38a0('0x1e')][_0x38a0('0x1f')]({'port':0x232c});var client9002=jayson[_0x38a0('0x1e')][_0x38a0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x495016,_0x57d0cb,_0x58df5d,_0x581d6d){return new BPromise(function(_0x523b73,_0xcc956b){var _0x443f8f=_0x581d6d||client;return _0x443f8f['request'](_0x495016,_0x58df5d)['then'](function(_0x149be1){logger[_0x38a0('0x20')](_0x38a0('0x21'),_0x57d0cb,_0x38a0('0x22'));logger[_0x38a0('0x23')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x57d0cb,_0x38a0('0x22'),JSON[_0x38a0('0x24')](_0x149be1));if(_0x149be1[_0x38a0('0x25')]){if(_0x149be1['error'][_0x38a0('0x26')]===0x1f4){logger[_0x38a0('0x25')](_0x38a0('0x21'),_0x57d0cb,_0x149be1[_0x38a0('0x25')][_0x38a0('0x27')]);return _0xcc956b(_0x149be1[_0x38a0('0x25')][_0x38a0('0x27')]);}logger[_0x38a0('0x25')](_0x38a0('0x21'),_0x57d0cb,_0x149be1[_0x38a0('0x25')][_0x38a0('0x27')]);return _0x523b73(_0x149be1[_0x38a0('0x25')][_0x38a0('0x27')]);}else{logger['info'](_0x38a0('0x21'),_0x57d0cb,_0x38a0('0x22'));_0x523b73(_0x149be1['result']['message']);}})['catch'](function(_0x2d1a5f){logger[_0x38a0('0x25')](_0x38a0('0x21'),_0x57d0cb,_0x2d1a5f);_0xcc956b(_0x2d1a5f);});});}function respondWithStatusCode(_0x560c6c,_0xd66083){_0xd66083=_0xd66083||0xcc;return function(_0x28dfb5){if(_0x28dfb5){return _0x560c6c[_0x38a0('0x28')](_0xd66083);}return _0x560c6c[_0x38a0('0x29')](_0xd66083)[_0x38a0('0x2a')]();};}function respondWithResult(_0x21b95e,_0x3b1068){_0x3b1068=_0x3b1068||0xc8;return function(_0x1fea51){if(_0x1fea51){return _0x21b95e['status'](_0x3b1068)['json'](_0x1fea51);}};}function respondWithFilteredResult(_0x3e7429,_0x3ae5fd){return function(_0x937801){if(_0x937801){var _0x8ff3a3=typeof _0x3ae5fd['offset']===_0x38a0('0x2b')&&typeof _0x3ae5fd[_0x38a0('0x2c')]===_0x38a0('0x2b');var _0x5c9be5=_0x937801[_0x38a0('0x2d')];var _0x222f4e=_0x8ff3a3?0x0:_0x3ae5fd[_0x38a0('0x2e')];var _0x395336=_0x8ff3a3?_0x937801[_0x38a0('0x2d')]:_0x3ae5fd[_0x38a0('0x2e')]+_0x3ae5fd['limit'];var _0xc408ef;if(_0x395336>=_0x5c9be5){_0x395336=_0x5c9be5;_0xc408ef=0xc8;}else{_0xc408ef=0xce;}_0x3e7429['status'](_0xc408ef);return _0x3e7429['set'](_0x38a0('0x2f'),_0x222f4e+'-'+_0x395336+'/'+_0x5c9be5)[_0x38a0('0x30')](_0x937801);}return null;};}function patchUpdates(_0x2ad91d){return function(_0x1fc10e){try{jsonpatch[_0x38a0('0x31')](_0x1fc10e,_0x2ad91d,!![]);}catch(_0x3a289c){return BPromise['reject'](_0x3a289c);}return _0x1fc10e[_0x38a0('0x32')]();};}function saveUpdates(_0x3bb0b4,_0x4def53){return function(_0x535b6a){if(_0x535b6a){return _0x535b6a['update'](_0x3bb0b4)['then'](function(_0x37f621){return _0x37f621;});}return null;};}function removeEntity(_0x17f0f3,_0x128718){return function(_0x2058e9){if(_0x2058e9){return _0x2058e9[_0x38a0('0x33')]()[_0x38a0('0x34')](function(){_0x17f0f3[_0x38a0('0x29')](0xcc)[_0x38a0('0x2a')]();});}};}function handleEntityNotFound(_0x299f71,_0x5b9869){return function(_0xd5a300){if(!_0xd5a300){_0x299f71[_0x38a0('0x28')](0x194);}return _0xd5a300;};}function handleError(_0x39cfc0,_0x44b504){_0x44b504=_0x44b504||0x1f4;return function(_0x14df89){logger[_0x38a0('0x25')](_0x14df89[_0x38a0('0x35')]);if(_0x14df89[_0x38a0('0x36')]){delete _0x14df89['name'];}_0x39cfc0[_0x38a0('0x29')](_0x44b504)[_0x38a0('0x37')](_0x14df89);};}exports[_0x38a0('0x38')]=function(_0x4912e9,_0xe3b4af){var _0x1e5749={},_0x3d9ce3={},_0x2716c2={'count':0x0,'rows':[]};var _0x306807=_['map'](db[_0x38a0('0x39')][_0x38a0('0x3a')],function(_0xf118d3){return{'name':_0xf118d3['fieldName'],'type':_0xf118d3[_0x38a0('0x3b')][_0x38a0('0x3c')]};});_0x3d9ce3[_0x38a0('0x3d')]=_[_0x38a0('0x3e')](_0x306807,_0x38a0('0x36'));_0x3d9ce3['query']=_[_0x38a0('0x3f')](_0x4912e9[_0x38a0('0x40')]);_0x3d9ce3[_0x38a0('0x41')]=_['intersection'](_0x3d9ce3['model'],_0x3d9ce3[_0x38a0('0x40')]);_0x1e5749[_0x38a0('0x42')]=_['intersection'](_0x3d9ce3[_0x38a0('0x3d')],qs[_0x38a0('0x43')](_0x4912e9['query'][_0x38a0('0x43')]));_0x1e5749['attributes']=_0x1e5749[_0x38a0('0x42')][_0x38a0('0x44')]?_0x1e5749[_0x38a0('0x42')]:_0x3d9ce3[_0x38a0('0x3d')];if(!_0x4912e9['query'][_0x38a0('0x45')]('nolimit')){_0x1e5749[_0x38a0('0x2c')]=qs[_0x38a0('0x2c')](_0x4912e9[_0x38a0('0x40')]['limit']);_0x1e5749['offset']=qs[_0x38a0('0x2e')](_0x4912e9[_0x38a0('0x40')][_0x38a0('0x2e')]);}_0x1e5749[_0x38a0('0x46')]=qs[_0x38a0('0x47')](_0x4912e9[_0x38a0('0x40')][_0x38a0('0x47')]);_0x1e5749[_0x38a0('0x48')]=qs[_0x38a0('0x41')](_[_0x38a0('0x49')](_0x4912e9[_0x38a0('0x40')],_0x3d9ce3[_0x38a0('0x41')]),_0x306807);if(_0x4912e9[_0x38a0('0x40')][_0x38a0('0x4a')]){_0x1e5749[_0x38a0('0x48')]=_[_0x38a0('0x4b')](_0x1e5749[_0x38a0('0x48')],{'$or':_[_0x38a0('0x3e')](_0x306807,function(_0x740557){if(_0x740557['type']!==_0x38a0('0x4c')){var _0x426488={};_0x426488[_0x740557['name']]={'$like':'%'+_0x4912e9[_0x38a0('0x40')]['filter']+'%'};return _0x426488;}})});}_0x1e5749=_[_0x38a0('0x4b')]({},_0x1e5749,_0x4912e9[_0x38a0('0x4d')]);var _0x488814={'where':_0x1e5749[_0x38a0('0x48')]};return db['OpenchannelMessage']['count'](_0x488814)[_0x38a0('0x34')](function(_0x4a3c59){_0x2716c2[_0x38a0('0x2d')]=_0x4a3c59;if(_0x4912e9[_0x38a0('0x40')][_0x38a0('0x4e')]){_0x1e5749[_0x38a0('0x4f')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x38a0('0x50')](_0x1e5749);})[_0x38a0('0x34')](function(_0x5935a3){_0x2716c2['rows']=_0x5935a3;return _0x2716c2;})['then'](respondWithFilteredResult(_0xe3b4af,_0x1e5749))[_0x38a0('0x51')](handleError(_0xe3b4af,null));};exports[_0x38a0('0x52')]=function(_0x63fae4,_0x525bf3){var _0x3eb770={'raw':!![],'where':{'id':_0x63fae4[_0x38a0('0x53')]['id']}},_0x198e6c={};_0x198e6c[_0x38a0('0x3d')]=_[_0x38a0('0x3f')](db['OpenchannelMessage'][_0x38a0('0x3a')]);_0x198e6c[_0x38a0('0x40')]=_[_0x38a0('0x3f')](_0x63fae4['query']);_0x198e6c['filters']=_['intersection'](_0x198e6c['model'],_0x198e6c[_0x38a0('0x40')]);_0x3eb770[_0x38a0('0x42')]=_[_0x38a0('0x54')](_0x198e6c[_0x38a0('0x3d')],qs[_0x38a0('0x43')](_0x63fae4[_0x38a0('0x40')][_0x38a0('0x43')]));_0x3eb770[_0x38a0('0x42')]=_0x3eb770[_0x38a0('0x42')]['length']?_0x3eb770['attributes']:_0x198e6c[_0x38a0('0x3d')];if(_0x63fae4['query']['includeAll']){_0x3eb770['include']=[{'all':!![]}];}_0x3eb770=_['merge']({},_0x3eb770,_0x63fae4[_0x38a0('0x4d')]);return db[_0x38a0('0x39')][_0x38a0('0x55')](_0x3eb770)[_0x38a0('0x34')](handleEntityNotFound(_0x525bf3,null))['then'](respondWithResult(_0x525bf3,null))[_0x38a0('0x51')](handleError(_0x525bf3,null));};exports[_0x38a0('0x56')]=function(_0x275baa,_0x32bda){return db[_0x38a0('0x39')][_0x38a0('0x56')](_0x275baa[_0x38a0('0x57')],{})[_0x38a0('0x34')](respondWithResult(_0x32bda,0xc9))['catch'](handleError(_0x32bda,null));};exports[_0x38a0('0x58')]=function(_0x1e9628,_0x211b17){if(_0x1e9628[_0x38a0('0x57')]['id']){delete _0x1e9628[_0x38a0('0x57')]['id'];}return db[_0x38a0('0x39')][_0x38a0('0x55')]({'where':{'id':_0x1e9628['params']['id']}})[_0x38a0('0x34')](handleEntityNotFound(_0x211b17,null))[_0x38a0('0x34')](saveUpdates(_0x1e9628[_0x38a0('0x57')],null))['then'](respondWithResult(_0x211b17,null))[_0x38a0('0x51')](handleError(_0x211b17,null));};exports[_0x38a0('0x33')]=function(_0x35e680,_0x170fec){return db[_0x38a0('0x39')][_0x38a0('0x55')]({'where':{'id':_0x35e680[_0x38a0('0x53')]['id']}})['then'](handleEntityNotFound(_0x170fec,null))[_0x38a0('0x34')](removeEntity(_0x170fec,null))[_0x38a0('0x51')](handleError(_0x170fec,null));};exports[_0x38a0('0x59')]=function(_0x2dad93,_0x4b5f48){return db[_0x38a0('0x39')][_0x38a0('0x59')]()[_0x38a0('0x34')](respondWithResult(_0x4b5f48,null))[_0x38a0('0x51')](handleError(_0x4b5f48,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['accept']=function(_0x4d7cb8,_0xc627d4,_0x335d98){var _0x2d275b={'agent':{},'channel':'openchannel'};if(_0x4d7cb8[_0x38a0('0x57')]['id']){delete _0x4d7cb8['body']['id'];}_0x4d7cb8['body'][_0x38a0('0x5a')]=!![];_0x4d7cb8[_0x38a0('0x57')]['readAt']=moment()[_0x38a0('0x5b')](_0x38a0('0x5c'));_0x4d7cb8[_0x38a0('0x57')][_0x38a0('0x5d')]=_0x4d7cb8[_0x38a0('0x57')][_0x38a0('0x5d')]||_0x4d7cb8[_0x38a0('0x5e')]['id'];_0x2d275b[_0x38a0('0x5f')]['id']=_0x4d7cb8['body'][_0x38a0('0x5d')];return db['OpenchannelMessage'][_0x38a0('0x55')]({'where':{'id':_0x4d7cb8[_0x38a0('0x53')]['id'],'UserId':null}})[_0x38a0('0x34')](handleEntityNotFound(_0xc627d4,null))[_0x38a0('0x34')](saveUpdates(_0x4d7cb8[_0x38a0('0x57')],null))[_0x38a0('0x34')](function(_0x484079){if(_0x484079){_0x2d275b['message']=_0x484079[_0x38a0('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x38a0('0x55')]({'where':{'id':_0x484079[_0x38a0('0x61')]}});}return null;})[_0x38a0('0x34')](handleEntityNotFound(_0xc627d4,null))[_0x38a0('0x34')](function(_0x7761f4){if(_0x7761f4){return _0x7761f4[_0x38a0('0x58')]({'UserId':_0x4d7cb8[_0x38a0('0x57')]['UserId'],'read1stAt':_[_0x38a0('0x62')](_0x7761f4[_0x38a0('0x63')])?moment()[_0x38a0('0x5b')](_0x38a0('0x5c')):undefined});}return null;})['then'](function(_0x488585){if(_0x488585){_0x2d275b[_0x38a0('0x64')]=_0x488585[_0x38a0('0x60')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d7cb8[_0x38a0('0x5e')]['id'],_0x4d7cb8[_0x38a0('0x5e')][_0x38a0('0x36')],_0x4d7cb8[_0x38a0('0x5e')][_0x38a0('0x65')],_0x2d275b[_0x38a0('0x64')]['id'],_0x4d7cb8[_0x38a0('0x57')]?JSON[_0x38a0('0x24')](_0x4d7cb8[_0x38a0('0x57')]):_0x38a0('0x66'));return respondWithRpcPromise(_0x38a0('0x67'),'acceptMessage',_0x2d275b);}return null;})[_0x38a0('0x34')](function(_0x313b13){var _0xdb8963='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x313b13['message'][_0x38a0('0x68')];return db[_0x38a0('0x69')]['query'](_0xdb8963,{'type':db[_0x38a0('0x6a')][_0x38a0('0x6b')][_0x38a0('0x6c')],'raw':!![]})['then'](function(_0x5d9292){return _0x5d9292;});})[_0x38a0('0x34')](function(_0x10aa18){if(_0x10aa18){_0x2d275b['message'][_0x38a0('0x6d')]=_0x10aa18[0x0];if(!_0x4d7cb8['body'][_0x38a0('0x5d')])return;return db['User']['find']({'where':{'id':_0x4d7cb8[_0x38a0('0x57')][_0x38a0('0x5d')],'role':_0x38a0('0x5f')},'attributes':['id',_0x38a0('0x36'),'fullname',_0x38a0('0x6e'),_0x38a0('0x6f')],'raw':!![]});}return null;})['then'](function(_0x8b06b0){if(!_0x8b06b0)return null;_0x2d275b['message']['agent']=_0x8b06b0;return _0x2d275b;})[_0x38a0('0x34')](function(_0x261ed1){if(_0x261ed1){if(_0x4d7cb8[_0x38a0('0x57')]['manual']){_0x2d275b['message'][_0x38a0('0x70')]=util[_0x38a0('0x5b')](_0x38a0('0x71'),_0x4d7cb8['user'][_0x38a0('0x36')]);_0x2d275b[_0x38a0('0x27')][_0x38a0('0x72')]=_0x2d275b[_0x38a0('0x72')];_0x2d275b[_0x38a0('0x27')]['motionChannel']=_0x2d275b[_0x38a0('0x72')];_0x2d275b[_0x38a0('0x27')][_0x38a0('0x73')]=_0x38a0('0x74');return respondWithRpcPromise(_0x38a0('0x75'),_0x38a0('0x75'),{'event':_0x38a0('0x76'),'message':_0x2d275b[_0x38a0('0x27')]},client9002)[_0x38a0('0x34')](function(){return _0x2d275b;});}return _0x2d275b;}return null;})[_0x38a0('0x34')](respondWithResult(_0xc627d4,null))[_0x38a0('0x51')](handleError(_0xc627d4,null));};var interaction_log=require(_0x38a0('0x12'))(_0x38a0('0x77'));exports[_0x38a0('0x78')]=function(_0x1f08f0,_0x1ba85e,_0x2a0624){var _0x51771c={'agent':{},'channel':_0x38a0('0x79')};if(_0x1f08f0['body']['id']){delete _0x1f08f0[_0x38a0('0x57')]['id'];}_0x1f08f0[_0x38a0('0x57')]['UserId']=_0x1f08f0[_0x38a0('0x57')][_0x38a0('0x5d')]||_0x1f08f0[_0x38a0('0x5e')]['id'];_0x51771c[_0x38a0('0x5f')]['id']=_0x1f08f0['body'][_0x38a0('0x5d')];return db[_0x38a0('0x39')][_0x38a0('0x55')]({'where':{'id':_0x1f08f0['params']['id'],'UserId':null}})[_0x38a0('0x34')](handleEntityNotFound(_0x1ba85e,null))['then'](function(_0xfe39e4){if(_0xfe39e4){_0x51771c[_0x38a0('0x27')]=_0xfe39e4[_0x38a0('0x60')]({'plain':!![]});return db[_0x38a0('0x7a')][_0x38a0('0x55')]({'where':{'id':_0xfe39e4['OpenchannelInteractionId']}});}return null;})[_0x38a0('0x34')](handleEntityNotFound(_0x1ba85e,null))['then'](function(_0x3efd58){if(_0x3efd58){_0x51771c[_0x38a0('0x64')]=_0x3efd58['get']({'plain':!![]});interaction_log[_0x38a0('0x20')](_0x38a0('0x7b'),_0x1f08f0[_0x38a0('0x5e')]['id'],_0x1f08f0['user']['name'],_0x1f08f0[_0x38a0('0x5e')]['role'],_0x51771c[_0x38a0('0x64')]['id'],_0x1f08f0[_0x38a0('0x57')]?JSON[_0x38a0('0x24')](_0x1f08f0[_0x38a0('0x57')]):'null');return respondWithRpcPromise(_0x38a0('0x7c'),_0x38a0('0x7d'),_0x51771c);}return null;})[_0x38a0('0x34')](function(_0x2cec03){var _0x181dab='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cec03[_0x38a0('0x27')]['ContactId'];return db[_0x38a0('0x69')]['query'](_0x181dab,{'type':db['Sequelize'][_0x38a0('0x6b')][_0x38a0('0x6c')],'raw':!![]})[_0x38a0('0x34')](function(_0x579842){return _0x579842;});})['then'](function(_0x14860f){if(_0x14860f){_0x51771c[_0x38a0('0x27')][_0x38a0('0x6d')]=_0x14860f[0x0];if(!_0x1f08f0[_0x38a0('0x57')][_0x38a0('0x5d')])return;return db[_0x38a0('0x7e')][_0x38a0('0x55')]({'where':{'id':_0x1f08f0[_0x38a0('0x57')]['UserId'],'role':_0x38a0('0x5f')},'attributes':['id',_0x38a0('0x36'),_0x38a0('0x7f'),_0x38a0('0x6e'),_0x38a0('0x6f')],'raw':!![]});}return null;})[_0x38a0('0x34')](function(_0x5c1625){if(!_0x5c1625)return null;_0x51771c[_0x38a0('0x27')]['agent']=_0x5c1625;return _0x51771c;})[_0x38a0('0x34')](function(_0x1af95f){if(_0x1af95f){_0x1af95f[_0x38a0('0x27')]['interface']=util[_0x38a0('0x5b')]('SIP/%s',_0x1f08f0[_0x38a0('0x5e')][_0x38a0('0x36')]);_0x1af95f['message']['channel']=_0x51771c[_0x38a0('0x72')];_0x1af95f[_0x38a0('0x27')][_0x38a0('0x80')]=_0x51771c[_0x38a0('0x72')];_0x1af95f[_0x38a0('0x27')][_0x38a0('0x73')]='reject';respondWithRpcPromise(_0x38a0('0x75'),'EventManager',{'event':'rejectmessage','message':_0x1af95f['message']},client9002);return _0x51771c;}return null;})['then'](respondWithResult(_0x1ba85e,null))['catch'](handleError(_0x1ba85e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 94594ec..0cc636d 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 _0x80db=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xefe90,_0x5a0c90){var _0x3ee871=function(_0x2b38d0){while(--_0x2b38d0){_0xefe90['push'](_0xefe90['shift']());}};_0x3ee871(++_0x5a0c90);}(_0x80db,0x1a2));var _0xb80d=function(_0x4e2991,_0x31a663){_0x4e2991=_0x4e2991-0x0;var _0xc08156=_0x80db[_0x4e2991];return _0xc08156;};'use strict';var EventEmitter=require(_0xb80d('0x0'));var OpenchannelMessage=require(_0xb80d('0x1'))['db'][_0xb80d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb80d('0x3')](0x0);var events={'afterCreate':_0xb80d('0x4'),'afterUpdate':_0xb80d('0x5'),'afterDestroy':_0xb80d('0x6')};function emitEvent(_0x4339ff){return function(_0x467b87,_0x1bc407,_0x2ee6bf){OpenchannelMessageEvents[_0xb80d('0x7')](_0x4339ff+':'+_0x467b87['id'],_0x467b87);OpenchannelMessageEvents[_0xb80d('0x7')](_0x4339ff,_0x467b87);_0x2ee6bf(null);};}for(var e in events){if(events[_0xb80d('0x8')](e)){var event=events[e];OpenchannelMessage[_0xb80d('0x9')](e,emitEvent(event));}}module[_0xb80d('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0fc3=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x51f58b,_0x2c3031){var _0x5d1f21=function(_0x384b1d){while(--_0x384b1d){_0x51f58b['push'](_0x51f58b['shift']());}};_0x5d1f21(++_0x2c3031);}(_0x0fc3,0x1ec));var _0x30fc=function(_0x91df6,_0x49a2ea){_0x91df6=_0x91df6-0x0;var _0x557117=_0x0fc3[_0x91df6];return _0x557117;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x30fc('0x0'))['db'][_0x30fc('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x30fc('0x2')](0x0);var events={'afterCreate':_0x30fc('0x3'),'afterUpdate':_0x30fc('0x4'),'afterDestroy':_0x30fc('0x5')};function emitEvent(_0x59e3ce){return function(_0x5934fe,_0x4e2626,_0x10cd70){OpenchannelMessageEvents[_0x30fc('0x6')](_0x59e3ce+':'+_0x5934fe['id'],_0x5934fe);OpenchannelMessageEvents['emit'](_0x59e3ce,_0x5934fe);_0x10cd70(null);};}for(var e in events){if(events[_0x30fc('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x30fc('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index b1d46bb..a337c81 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 _0x1bf2=['api','moment','request-promise','rimraf','../../config/environment','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','lodash','util','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1bf2,0xfc));var _0x21bf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x1bf2[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x21bf('0x0'));var util=require(_0x21bf('0x1'));var logger=require(_0x21bf('0x2'))(_0x21bf('0x3'));var moment=require(_0x21bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x21bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21bf('0x6'));var config=require(_0x21bf('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x21bf('0x8')]=function(_0x29f85f,_0x1da115){return _0x29f85f['define'](_0x21bf('0x9'),attributes,{'tableName':_0x21bf('0xa'),'paranoid':![],'indexes':[{'name':_0x21bf('0xb'),'fields':[_0x21bf('0xc')],'type':_0x21bf('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x546fbb,_0x3d6790,_0x39b498){var _0x1fec34=_0x29f85f[_0x21bf('0xe')];var _0x1eb5bd=_0x546fbb[_0x21bf('0xf')]({'plain':!![]});if(_0x1eb5bd[_0x21bf('0x10')][_0x21bf('0x11')]()==='in'||_0x1eb5bd[_0x21bf('0x10')][_0x21bf('0x11')]()===_0x21bf('0x12')&&!_0x1eb5bd[_0x21bf('0x13')]&&!_[_0x21bf('0x14')](_0x1eb5bd[_0x21bf('0x15')])){_0x1fec34[_0x21bf('0x16')][_0x21bf('0x17')]({'where':{'id':_0x1eb5bd['OpenchannelInteractionId']}})[_0x21bf('0x18')](function(_0x349c61){if(_0x349c61){_0x349c61[_0x21bf('0x19')]({'lastMsgAt':_0x1eb5bd[_0x21bf('0x1a')],'lastMsgDirection':_0x1eb5bd['direction']['toLowerCase']()});}})[_0x21bf('0x1b')](function(_0x5e86dd){console[_0x21bf('0x1c')](_0x5e86dd);});}if(_0x1eb5bd[_0x21bf('0x10')]===_0x21bf('0x12')&&!_0x1eb5bd['secret']){var _0x13cda8;_0x1fec34[_0x21bf('0x1d')][_0x21bf('0x1e')]()[_0x21bf('0x18')](function(_0x3c5485){return _0x1fec34['OpenchannelAccount'][_0x21bf('0x1f')]({'where':{'id':_0x1eb5bd[_0x21bf('0x20')]},'include':[{'model':_0x1fec34[_0x21bf('0x16')],'as':_0x21bf('0x21'),'where':{'id':_0x1eb5bd[_0x21bf('0x22')]},'limit':0x1,'include':[{'model':_0x1fec34[_0x21bf('0x1d')],'as':_0x21bf('0x23'),'attributes':_[_0x21bf('0x24')](_0x3c5485)}]}]});})['then'](function(_0x28ca7f){_0x13cda8=_0x28ca7f[_0x21bf('0xf')]({'plain':!![]});if(_0x13cda8&&_0x13cda8[_0x21bf('0x25')]){logger[_0x21bf('0x26')](_0x21bf('0x27'),_0x21bf('0x28'),util[_0x21bf('0x29')](_0x21bf('0x2a'),_0x1eb5bd['id'],_0x13cda8[_0x21bf('0x25')]));if(_0x13cda8[_0x21bf('0x21')]&&_0x13cda8[_0x21bf('0x21')]['length']){_0x1eb5bd['Interaction']=_[_0x21bf('0x2b')](_0x13cda8['Interactions'][0x0],'Contact');_0x1eb5bd[_0x21bf('0x23')]=_0x13cda8['Interactions'][0x0]['Contact'];}var _0x3d6790={'method':_0x21bf('0x2c'),'uri':encodeURI(_0x13cda8[_0x21bf('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d6790['method']){case'GET':_0x3d6790['qs']=_0x1eb5bd;break;case'POST':_0x3d6790['body']=_0x1eb5bd;break;}return rp(_0x3d6790)[_0x21bf('0x18')](function(_0x55eb3e){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x21bf('0x28'),util['format'](_0x21bf('0x2d'),_0x1eb5bd['id'],_0x13cda8[_0x21bf('0x25')]));if(_0x55eb3e[_0x21bf('0xc')][_0x21bf('0x2e')]&&_0x55eb3e['body']['threadId']!=_0x1eb5bd[_0x21bf('0x2f')][_0x21bf('0x2e')]){return _0x1fec34[_0x21bf('0x16')]['update']({'threadId':_0x55eb3e[_0x21bf('0xc')]['threadId']},{'where':{'id':_0x1eb5bd['Interaction']['id']}});}else{return;}})[_0x21bf('0x18')](function(){return _0x546fbb[_0x21bf('0x19')]({'read':!![]});})[_0x21bf('0x1b')](function(_0x13f462){logger[_0x21bf('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x21bf('0x28'),util[_0x21bf('0x30')](_0x13f462,{'showHidden':![],'depth':null}));_0x39b498();});}else{_0x39b498();}})[_0x21bf('0x31')](function(){_0x39b498();});}else{_0x39b498();}}},'charset':_0x21bf('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x047d=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','then','OpenchannelAccount','find','Interactions','Contact','keys','get','replyUri','info','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','method','GET','POST','body','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally'];(function(_0xbbb751,_0x5b1c39){var _0x9f12a1=function(_0x10e118){while(--_0x10e118){_0xbbb751['push'](_0xbbb751['shift']());}};_0x9f12a1(++_0x5b1c39);}(_0x047d,0xce));var _0xd047=function(_0x315897,_0x4d2a8f){_0x315897=_0x315897-0x0;var _0x4cff77=_0x047d[_0x315897];return _0x4cff77;};'use strict';var _=require(_0xd047('0x0'));var util=require(_0xd047('0x1'));var logger=require(_0xd047('0x2'))(_0xd047('0x3'));var moment=require(_0xd047('0x4'));var BPromise=require(_0xd047('0x5'));var rp=require(_0xd047('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd047('0x7'));var attributes=require(_0xd047('0x8'));module['exports']=function(_0x392b47,_0x48fada){return _0x392b47['define'](_0xd047('0x9'),attributes,{'tableName':_0xd047('0xa'),'paranoid':![],'indexes':[{'name':_0xd047('0xb'),'fields':['body'],'type':_0xd047('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7b2550,_0x29d93a,_0x25f77b){var _0x5edb39=_0x392b47[_0xd047('0xd')];var _0x179403=_0x7b2550['get']({'plain':!![]});if(_0x179403[_0xd047('0xe')][_0xd047('0xf')]()==='in'||_0x179403['direction'][_0xd047('0xf')]()==='out'&&!_0x179403[_0xd047('0x10')]&&!_[_0xd047('0x11')](_0x179403[_0xd047('0x12')])){_0x5edb39[_0xd047('0x13')][_0xd047('0x14')]({'where':{'id':_0x179403[_0xd047('0x15')]}})['then'](function(_0x19f991){if(_0x19f991){_0x19f991[_0xd047('0x16')]({'lastMsgAt':_0x179403[_0xd047('0x17')],'lastMsgDirection':_0x179403[_0xd047('0xe')][_0xd047('0xf')]()});}})[_0xd047('0x18')](function(_0x4a14f7){console[_0xd047('0x19')](_0x4a14f7);});}if(_0x179403['direction']==='out'&&!_0x179403[_0xd047('0x10')]){var _0x1e239f;_0x5edb39[_0xd047('0x1a')]['describe']()[_0xd047('0x1b')](function(_0xb9454e){return _0x5edb39[_0xd047('0x1c')][_0xd047('0x1d')]({'where':{'id':_0x179403['OpenchannelAccountId']},'include':[{'model':_0x5edb39[_0xd047('0x13')],'as':_0xd047('0x1e'),'where':{'id':_0x179403[_0xd047('0x15')]},'limit':0x1,'include':[{'model':_0x5edb39[_0xd047('0x1a')],'as':_0xd047('0x1f'),'attributes':_[_0xd047('0x20')](_0xb9454e)}]}]});})[_0xd047('0x1b')](function(_0x2d32f3){_0x1e239f=_0x2d32f3[_0xd047('0x21')]({'plain':!![]});if(_0x1e239f&&_0x1e239f[_0xd047('0x22')]){logger[_0xd047('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xd047('0x24'),_0x179403['id'],_0x1e239f[_0xd047('0x22')]));if(_0x1e239f[_0xd047('0x1e')]&&_0x1e239f[_0xd047('0x1e')][_0xd047('0x25')]){_0x179403['Interaction']=_[_0xd047('0x26')](_0x1e239f[_0xd047('0x1e')][0x0],_0xd047('0x1f'));_0x179403[_0xd047('0x1f')]=_0x1e239f['Interactions'][0x0][_0xd047('0x1f')];}var _0x29d93a={'method':'POST','uri':encodeURI(_0x1e239f[_0xd047('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x29d93a[_0xd047('0x27')]){case _0xd047('0x28'):_0x29d93a['qs']=_0x179403;break;case _0xd047('0x29'):_0x29d93a[_0xd047('0x2a')]=_0x179403;break;}return rp(_0x29d93a)[_0xd047('0x1b')](function(_0x26a313){logger['info'](_0xd047('0x2b'),_0xd047('0x2c'),util['format'](_0xd047('0x2d'),_0x179403['id'],_0x1e239f['replyUri']));if(_0x26a313['body'][_0xd047('0x2e')]&&_0x26a313[_0xd047('0x2a')][_0xd047('0x2e')]!=_0x179403[_0xd047('0x2f')][_0xd047('0x2e')]){return _0x5edb39['OpenchannelInteraction'][_0xd047('0x16')]({'threadId':_0x26a313['body']['threadId']},{'where':{'id':_0x179403[_0xd047('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x7b2550['update']({'read':!![]});})['catch'](function(_0x59f012){logger['error'](_0xd047('0x2b'),_0xd047('0x2c'),util['inspect'](_0x59f012,{'showHidden':![],'depth':null}));_0x25f77b();});}else{_0x25f77b();}})[_0xd047('0x30')](function(){_0x25f77b();});}else{_0x25f77b();}}},'charset':_0xd047('0x31'),'collate':_0xd047('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 95a2e89..056c84f 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x452399,_0x8f3198){var _0x24c705=function(_0x20636e){while(--_0x20636e){_0x452399['push'](_0x452399['shift']());}};_0x24c705(++_0x8f3198);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +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(_0x30d154,_0x4daf72){var _0x499a89=function(_0x1c278f){while(--_0x1c278f){_0x30d154['push'](_0x30d154['shift']());}};_0x499a89(++_0x4daf72);}(_0x7a54,0x106));var _0x47a5=function(_0xf001fb,_0x2ba22b){_0xf001fb=_0xf001fb-0x0;var _0x55cd07=_0x7a54[_0xf001fb];return _0x55cd07;};'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 44a4c3c..41694ba 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 _0xc1ea=['register','openchannelMessage:','./openchannelMessage.events','save','remove','update','removeListener'];(function(_0x37fcd0,_0x141d80){var _0x3869d4=function(_0x52c5a3){while(--_0x52c5a3){_0x37fcd0['push'](_0x37fcd0['shift']());}};_0x3869d4(++_0x141d80);}(_0xc1ea,0x13d));var _0xac1e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc1ea[_0x40a045];return _0x1a687c;};'use strict';var OpenchannelMessageEvents=require(_0xac1e('0x0'));var events=[_0xac1e('0x1'),_0xac1e('0x2'),_0xac1e('0x3')];function createListener(_0x467e12,_0x599698){return function(_0x49f8b5){_0x599698['emit'](_0x467e12,_0x49f8b5);};}function removeListener(_0xeaeb64,_0x275ff2){return function(){OpenchannelMessageEvents[_0xac1e('0x4')](_0xeaeb64,_0x275ff2);};}exports[_0xac1e('0x5')]=function(_0x482abe){for(var _0x244ed6=0x0,_0x46a341=events['length'];_0x244ed6<_0x46a341;_0x244ed6++){var _0x333e11=events[_0x244ed6];var _0x31f1dc=createListener(_0xac1e('0x6')+_0x333e11,_0x482abe);OpenchannelMessageEvents['on'](_0x333e11,_0x31f1dc);}}; \ No newline at end of file +var _0x4fb4=['openchannelMessage:','save','remove','update','removeListener','register','length'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0x4fb4,0x190));var _0x44fb=function(_0x52530b,_0x12f05a){_0x52530b=_0x52530b-0x0;var _0x25028a=_0x4fb4[_0x52530b];return _0x25028a;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x44fb('0x0'),_0x44fb('0x1'),_0x44fb('0x2')];function createListener(_0x29a2fe,_0x24e38d){return function(_0x42dbbb){_0x24e38d['emit'](_0x29a2fe,_0x42dbbb);};}function removeListener(_0xec6dce,_0x953327){return function(){OpenchannelMessageEvents[_0x44fb('0x3')](_0xec6dce,_0x953327);};}exports[_0x44fb('0x4')]=function(_0x375d33){for(var _0x173e70=0x0,_0x464af5=events[_0x44fb('0x5')];_0x173e70<_0x464af5;_0x173e70++){var _0x59aa6d=events[_0x173e70];var _0x87f716=createListener(_0x44fb('0x6')+_0x59aa6d,_0x375d33);OpenchannelMessageEvents['on'](_0x59aa6d,_0x87f716);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 30bc87b..46ece17 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 _0xfd5c=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','update','destroy','delete','removeTeams','removeAgents','exports','multer','path','express','fs-extra'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0xfd5c,0x1ac));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcfd5('0x0'));var util=require('util');var path=require(_0xcfd5('0x1'));var timeout=require('connect-timeout');var express=require(_0xcfd5('0x2'));var router=express['Router']();var fs_extra=require(_0xcfd5('0x3'));var auth=require(_0xcfd5('0x4'));var interaction=require(_0xcfd5('0x5'));var config=require(_0xcfd5('0x6'));var controller=require('./openchannelQueue.controller');router[_0xcfd5('0x7')]('/',auth[_0xcfd5('0x8')](),controller[_0xcfd5('0x9')]);router[_0xcfd5('0x7')](_0xcfd5('0xa'),auth[_0xcfd5('0x8')](),controller[_0xcfd5('0xb')]);router[_0xcfd5('0x7')](_0xcfd5('0xc'),auth['isAuthenticated'](),controller[_0xcfd5('0xd')]);router[_0xcfd5('0x7')](_0xcfd5('0xe'),auth[_0xcfd5('0x8')](),controller['getMembers']);router['get'](_0xcfd5('0xf'),auth[_0xcfd5('0x8')](),controller['getTeams']);router['get'](_0xcfd5('0x10'),auth[_0xcfd5('0x8')](),controller[_0xcfd5('0x11')]);router['post']('/',auth[_0xcfd5('0x8')](),controller[_0xcfd5('0x12')]);router[_0xcfd5('0x13')](_0xcfd5('0xf'),auth[_0xcfd5('0x8')](),controller[_0xcfd5('0x14')]);router['post'](_0xcfd5('0x10'),auth[_0xcfd5('0x8')](),controller['addAgents']);router['put'](_0xcfd5('0xc'),auth[_0xcfd5('0x8')](),controller[_0xcfd5('0x15')]);router['delete'](_0xcfd5('0xc'),auth['isAuthenticated'](),controller[_0xcfd5('0x16')]);router[_0xcfd5('0x17')](_0xcfd5('0xf'),auth[_0xcfd5('0x8')](),controller[_0xcfd5('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xcfd5('0x19')]);module[_0xcfd5('0x1a')]=router; \ No newline at end of file +var _0xd8ab=['removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id/teams','getTeams','post','/:id/users','put','/:id','update','delete','removeTeams'];(function(_0x2560bd,_0x7abc6a){var _0x5887b9=function(_0x5eae70){while(--_0x5eae70){_0x2560bd['push'](_0x2560bd['shift']());}};_0x5887b9(++_0x7abc6a);}(_0xd8ab,0x6b));var _0xbd8a=function(_0x58c968,_0xfe572){_0x58c968=_0x58c968-0x0;var _0xa2f815=_0xd8ab[_0x58c968];return _0xa2f815;};'use strict';var multer=require(_0xbd8a('0x0'));var util=require(_0xbd8a('0x1'));var path=require(_0xbd8a('0x2'));var timeout=require(_0xbd8a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd8a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbd8a('0x5'));var config=require(_0xbd8a('0x6'));var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbd8a('0x7')](_0xbd8a('0x8'),auth[_0xbd8a('0x9')](),controller['describe']);router[_0xbd8a('0x7')]('/:id',auth[_0xbd8a('0x9')](),controller['show']);router[_0xbd8a('0x7')]('/:id/members',auth[_0xbd8a('0x9')](),controller['getMembers']);router[_0xbd8a('0x7')](_0xbd8a('0xa'),auth[_0xbd8a('0x9')](),controller[_0xbd8a('0xb')]);router[_0xbd8a('0x7')]('/:id/users',auth[_0xbd8a('0x9')](),controller['getAgents']);router[_0xbd8a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd8a('0xc')](_0xbd8a('0xa'),auth[_0xbd8a('0x9')](),controller['addTeams']);router[_0xbd8a('0xc')](_0xbd8a('0xd'),auth['isAuthenticated'](),controller['addAgents']);router[_0xbd8a('0xe')](_0xbd8a('0xf'),auth['isAuthenticated'](),controller[_0xbd8a('0x10')]);router[_0xbd8a('0x11')](_0xbd8a('0xf'),auth[_0xbd8a('0x9')](),controller['destroy']);router['delete'](_0xbd8a('0xa'),auth[_0xbd8a('0x9')](),controller[_0xbd8a('0x12')]);router[_0xbd8a('0x11')](_0xbd8a('0xd'),auth[_0xbd8a('0x9')](),controller[_0xbd8a('0x13')]);module[_0xbd8a('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index d8a7745..216a6fb 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 _0x6f59=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x6f59,0xe1));var _0x96f5=function(_0x200dd4,_0x42fc56){_0x200dd4=_0x200dd4-0x0;var _0x3a771f=_0x6f59[_0x200dd4];return _0x3a771f;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'name':{'type':Sequelize[_0x96f5('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x96f5('0x2')]},'timeout':{'type':Sequelize[_0x96f5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x96f5('0x4')](_0x96f5('0x5'),'beepall',_0x96f5('0x6'))}}; \ No newline at end of file +var _0x0978=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0x0978,0x109));var _0x8097=function(_0x4375c9,_0x41ff07){_0x4375c9=_0x4375c9-0x0;var _0x3343cb=_0x0978[_0x4375c9];return _0x3343cb;};'use strict';var Sequelize=require(_0x8097('0x0'));module['exports']={'name':{'type':Sequelize[_0x8097('0x1')],'unique':_0x8097('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8097('0x1')]},'timeout':{'type':Sequelize[_0x8097('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8097('0x4')](_0x8097('0x5'),_0x8097('0x6'),_0x8097('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index fbf4e7f..0fb045a 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 _0x1465=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','map','OpenchannelQueue','key','getOptions','include','query','rows','params','model','rawAttributes','keys','filters','intersection','fields','attributes','includeAll','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','order','where','pick','OpenchannelQueueId','filter','merge','findAll','UserId','openchannelPause','createdAt','format','SIP','updatedAt','getTeams','Team','sort','addTeams','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userOpenchannelQueue:save','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join'];(function(_0x1d275b,_0x22d108){var _0x1cc50a=function(_0x19000f){while(--_0x19000f){_0x1d275b['push'](_0x1d275b['shift']());}};_0x1cc50a(++_0x22d108);}(_0x1465,0x178));var _0x5146=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x1465[_0x344adc];return _0x4014b2;};'use strict';var BPromise=require(_0x5146('0x0'));var util=require(_0x5146('0x1'));var _=require(_0x5146('0x2'));var squel=require(_0x5146('0x3'));var Redis=require(_0x5146('0x4'));var qs=require(_0x5146('0x5'));var logger=require(_0x5146('0x6'))(_0x5146('0x7'));var config=require(_0x5146('0x8'));var db=require(_0x5146('0x9'))['db'];config[_0x5146('0xa')]=_['defaults'](config[_0x5146('0xa')],{'host':_0x5146('0xb'),'port':0x18eb});var socket=require(_0x5146('0xc'))(new Redis(config[_0x5146('0xa')]));require(_0x5146('0xd'))[_0x5146('0xe')](socket);function respondWithStatusCode(_0x415877,_0x25a120){_0x25a120=_0x25a120||0xcc;return function(_0x2fbbaa){if(_0x2fbbaa){return _0x415877[_0x5146('0xf')](_0x25a120);}return _0x415877[_0x5146('0x10')](_0x25a120)[_0x5146('0x11')]();};}function respondWithResult(_0x1820a8,_0x5b1f49){_0x5b1f49=_0x5b1f49||0xc8;return function(_0x1cfe0e){if(_0x1cfe0e){return _0x1820a8[_0x5146('0x10')](_0x5b1f49)[_0x5146('0x12')](_0x1cfe0e);}};}function respondWithFilteredResult(_0xf550a1,_0x5f4deb){return function(_0x4a4870){if(_0x4a4870){var _0x2c6d80=typeof _0x5f4deb['offset']===_0x5146('0x13')&&typeof _0x5f4deb['limit']===_0x5146('0x13');var _0x165fef=_0x4a4870[_0x5146('0x14')];var _0x2680b2=_0x2c6d80?0x0:_0x5f4deb[_0x5146('0x15')];var _0x3e2677=_0x2c6d80?_0x4a4870['count']:_0x5f4deb[_0x5146('0x15')]+_0x5f4deb[_0x5146('0x16')];var _0x13ec7d;if(_0x3e2677>=_0x165fef){_0x3e2677=_0x165fef;_0x13ec7d=0xc8;}else{_0x13ec7d=0xce;}_0xf550a1[_0x5146('0x10')](_0x13ec7d);return _0xf550a1[_0x5146('0x17')](_0x5146('0x18'),_0x2680b2+'-'+_0x3e2677+'/'+_0x165fef)[_0x5146('0x12')](_0x4a4870);}return null;};}function saveUpdates(_0x290370){return function(_0x1f20f2){if(_0x1f20f2){return _0x1f20f2['update'](_0x290370)[_0x5146('0x19')](function(_0x5ba581){return _0x5ba581;});}return null;};}function removeEntity(_0x514d07){return function(_0x4abb43){if(_0x4abb43){return _0x4abb43[_0x5146('0x1a')]()['then'](function(){var _0x575a79=_0x4abb43[_0x5146('0x1b')]({'plain':!![]});var _0x523df2=_0x5146('0x1c');return db[_0x5146('0x1d')][_0x5146('0x1a')]({'where':{'type':_0x523df2,'resourceId':_0x575a79['id']}})['then'](function(){return _0x4abb43;});})['then'](function(){_0x514d07[_0x5146('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49c093){return function(_0x5ecb6b){if(!_0x5ecb6b){_0x49c093[_0x5146('0xf')](0x194);}return _0x5ecb6b;};}function handleError(_0x2c60b1,_0x280238){_0x280238=_0x280238||0x1f4;return function(_0x5dc073){logger[_0x5146('0x1e')](_0x5dc073['stack']);if(_0x5dc073['name']){delete _0x5dc073[_0x5146('0x1f')];}_0x2c60b1[_0x5146('0x10')](_0x280238)['send'](_0x5dc073);};}exports['index']=function(_0xc0329a,_0x6a2749){var _0x2d3c33={};var _0x3c4e00={'count':0x0,'rows':[]};var _0x1f3c4e=_[_0x5146('0x20')](db[_0x5146('0x21')]['rawAttributes'],function(_0x3ab6e4){return{'name':_0x3ab6e4['fieldName'],'type':_0x3ab6e4['type'][_0x5146('0x22')]};});_0x2d3c33=qs[_0x5146('0x23')](_0x1f3c4e,_0xc0329a);var _0x441072={'where':_0x2d3c33['where']};return db[_0x5146('0x21')][_0x5146('0x14')](_0x441072)[_0x5146('0x19')](function(_0x1739b9){_0x3c4e00[_0x5146('0x14')]=_0x1739b9;_0x2d3c33[_0x5146('0x24')]=qs[_0x5146('0x24')](_0xc0329a[_0x5146('0x25')]);return db[_0x5146('0x21')]['findAll'](_0x2d3c33);})[_0x5146('0x19')](function(_0x2fa4da){_0x3c4e00[_0x5146('0x26')]=_0x2fa4da;return _0x3c4e00;})[_0x5146('0x19')](respondWithFilteredResult(_0x6a2749,_0x2d3c33))['catch'](handleError(_0x6a2749,null));};exports['show']=function(_0x5c5d9e,_0x5c617f){var _0x99a977={'raw':!![],'where':{'id':_0x5c5d9e[_0x5146('0x27')]['id']}},_0x3f59d7={};_0x3f59d7[_0x5146('0x28')]=_['keys'](db[_0x5146('0x21')][_0x5146('0x29')]);_0x3f59d7[_0x5146('0x25')]=_[_0x5146('0x2a')](_0x5c5d9e[_0x5146('0x25')]);_0x3f59d7[_0x5146('0x2b')]=_['intersection'](_0x3f59d7[_0x5146('0x28')],_0x3f59d7[_0x5146('0x25')]);_0x99a977['attributes']=_[_0x5146('0x2c')](_0x3f59d7[_0x5146('0x28')],qs[_0x5146('0x2d')](_0x5c5d9e[_0x5146('0x25')]['fields']));_0x99a977[_0x5146('0x2e')]=_0x99a977['attributes']['length']?_0x99a977['attributes']:_0x3f59d7[_0x5146('0x28')];if(_0x5c5d9e[_0x5146('0x25')][_0x5146('0x2f')]){_0x99a977[_0x5146('0x24')]=[{'all':!![]}];}_0x99a977=_['merge']({},_0x99a977,_0x5c5d9e[_0x5146('0x30')]);return db[_0x5146('0x21')][_0x5146('0x31')](_0x99a977)[_0x5146('0x19')](handleEntityNotFound(_0x5c617f,null))[_0x5146('0x19')](respondWithResult(_0x5c617f,null))[_0x5146('0x32')](handleError(_0x5c617f,null));};exports[_0x5146('0x33')]=function(_0x3653a9,_0x486178){return db['OpenchannelQueue'][_0x5146('0x33')](_0x3653a9['body'],{})[_0x5146('0x19')](function(_0x35dfb5){var _0x53e0aa=_0x3653a9[_0x5146('0x34')][_0x5146('0x1b')]({'plain':!![]});if(!_0x53e0aa)throw new Error(_0x5146('0x35'));if(_0x53e0aa['role']===_0x5146('0x34')){var _0x9c086f=_0x35dfb5[_0x5146('0x1b')]({'plain':!![]});var _0x29bcc7=_0x5146('0x1c');return db[_0x5146('0x36')][_0x5146('0x31')]({'where':{'name':_0x29bcc7,'userProfileId':_0x53e0aa[_0x5146('0x37')]},'raw':!![]})[_0x5146('0x19')](function(_0x3e25ce){if(_0x3e25ce&&_0x3e25ce[_0x5146('0x38')]===0x0){return db['UserProfileResource']['create']({'name':_0x9c086f[_0x5146('0x1f')],'resourceId':_0x9c086f['id'],'type':_0x3e25ce['name'],'sectionId':_0x3e25ce['id']},{})[_0x5146('0x19')](function(){return _0x35dfb5;});}else{return _0x35dfb5;}})[_0x5146('0x32')](function(_0x805f84){logger[_0x5146('0x1e')](_0x5146('0x39'),_0x805f84);throw _0x805f84;});}return _0x35dfb5;})[_0x5146('0x19')](respondWithResult(_0x486178,0xc9))[_0x5146('0x32')](handleError(_0x486178,null));};exports['update']=function(_0x3b20cd,_0x2bb9e5){if(_0x3b20cd[_0x5146('0x3a')]['id']){delete _0x3b20cd['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x3b20cd[_0x5146('0x27')]['id']}})[_0x5146('0x19')](handleEntityNotFound(_0x2bb9e5,null))[_0x5146('0x19')](saveUpdates(_0x3b20cd['body'],null))[_0x5146('0x19')](respondWithResult(_0x2bb9e5,null))[_0x5146('0x32')](handleError(_0x2bb9e5,null));};exports['destroy']=function(_0xc1f6b6,_0x41df59){return db[_0x5146('0x21')][_0x5146('0x31')]({'where':{'id':_0xc1f6b6['params']['id']}})[_0x5146('0x19')](handleEntityNotFound(_0x41df59,null))[_0x5146('0x19')](removeEntity(_0x41df59,null))[_0x5146('0x32')](handleError(_0x41df59,null));};exports[_0x5146('0x3b')]=function(_0x308941,_0x379093){return db['OpenchannelQueue'][_0x5146('0x3b')]()[_0x5146('0x19')](respondWithResult(_0x379093,null))[_0x5146('0x32')](handleError(_0x379093,null));};exports[_0x5146('0x3c')]=function(_0x4b5b6a,_0x2944c7){var _0x3ba303={'raw':!![],'where':{}},_0x583499={},_0x36ee0f;return db['OpenchannelQueue'][_0x5146('0x3d')]({'where':{'id':_0x4b5b6a[_0x5146('0x27')]['id']}})['then'](handleEntityNotFound(_0x2944c7,null))[_0x5146('0x19')](function(_0x8e09b2){if(_0x8e09b2){_0x36ee0f=_0x8e09b2[_0x5146('0x1b')]({'plain':!![]});_0x583499[_0x5146('0x28')]=_[_0x5146('0x2a')](db[_0x5146('0x3e')][_0x5146('0x29')]);_0x583499[_0x5146('0x25')]=_['keys'](_0x4b5b6a[_0x5146('0x25')]);_0x583499['filters']=_[_0x5146('0x2c')](_0x583499[_0x5146('0x28')],_0x583499['query']);_0x3ba303['attributes']=_[_0x5146('0x2c')](_0x583499[_0x5146('0x28')],qs[_0x5146('0x2d')](_0x4b5b6a[_0x5146('0x25')][_0x5146('0x2d')]));_0x3ba303['attributes']=_0x3ba303[_0x5146('0x2e')][_0x5146('0x3f')]?_0x3ba303['attributes']:_0x583499[_0x5146('0x28')];if(!_0x4b5b6a[_0x5146('0x25')][_0x5146('0x40')](_0x5146('0x41'))){_0x3ba303[_0x5146('0x16')]=qs[_0x5146('0x16')](_0x4b5b6a[_0x5146('0x25')][_0x5146('0x16')]);_0x3ba303[_0x5146('0x15')]=qs[_0x5146('0x15')](_0x4b5b6a['query'][_0x5146('0x15')]);}_0x3ba303[_0x5146('0x42')]=qs['sort'](_0x4b5b6a[_0x5146('0x25')]['sort']);_0x3ba303[_0x5146('0x43')]=qs[_0x5146('0x2b')](_[_0x5146('0x44')](_0x4b5b6a[_0x5146('0x25')],_0x583499[_0x5146('0x2b')]));_0x3ba303[_0x5146('0x43')][_0x5146('0x45')]=_0x8e09b2['id'];if(_0x4b5b6a['query'][_0x5146('0x46')]){_0x3ba303['where']=_[_0x5146('0x47')](_0x3ba303['where'],{'$or':_['map'](_0x3ba303[_0x5146('0x2e')],function(_0x1ab9f2){var _0x191993={};_0x191993[_0x1ab9f2]={'$like':'%'+_0x4b5b6a[_0x5146('0x25')]['filter']+'%'};return _0x191993;})});}_0x3ba303=_['merge']({},_0x3ba303,_0x4b5b6a[_0x5146('0x30')]);return db['UserOpenchannelQueue'][_0x5146('0x48')](_0x3ba303);}})[_0x5146('0x19')](function(_0x991914){if(_0x991914){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x991914,_0x5146('0x49')),'role':'agent'},'attributes':['id',_0x5146('0x1f'),_0x5146('0x4a'),'updatedAt',_0x5146('0x4b')]});}})[_0x5146('0x19')](function(_0x7b83b5){if(_0x7b83b5){return{'count':_0x7b83b5[_0x5146('0x14')],'rows':_[_0x5146('0x20')](_0x7b83b5['rows'],function(_0x3b70e9){return{'membername':_0x3b70e9['name'],'UserId':_0x3b70e9['id'],'queue_name':_0x36ee0f['name'],'OpenchannelQueueId':_0x36ee0f['id'],'interface':util[_0x5146('0x4c')]('%s/%s',_0x5146('0x4d'),_0x3b70e9[_0x5146('0x1f')]),'penalty':0x0,'paused':_0x3b70e9['openchannelPause'],'createdAt':_0x3b70e9[_0x5146('0x4b')],'updatedAt':_0x3b70e9[_0x5146('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5146('0x19')](respondWithFilteredResult(_0x2944c7,_0x3ba303))['catch'](handleError(_0x2944c7,null));};exports[_0x5146('0x4f')]=function(_0x20a86c,_0x4e3d52){var _0x35e4ff={};var _0x450189={};var _0x290645;var _0x17b485;return db[_0x5146('0x21')][_0x5146('0x3d')]({'where':{'id':_0x20a86c[_0x5146('0x27')]['id']}})['then'](handleEntityNotFound(_0x4e3d52,null))['then'](function(_0x1e6ff8){if(_0x1e6ff8){_0x290645=_0x1e6ff8;_0x450189['model']=_[_0x5146('0x2a')](db[_0x5146('0x50')][_0x5146('0x29')]);_0x450189[_0x5146('0x25')]=_['keys'](_0x20a86c[_0x5146('0x25')]);_0x450189[_0x5146('0x2b')]=_['intersection'](_0x450189[_0x5146('0x28')],_0x450189[_0x5146('0x25')]);_0x35e4ff[_0x5146('0x2e')]=_[_0x5146('0x2c')](_0x450189['model'],qs[_0x5146('0x2d')](_0x20a86c[_0x5146('0x25')][_0x5146('0x2d')]));_0x35e4ff[_0x5146('0x2e')]=_0x35e4ff[_0x5146('0x2e')][_0x5146('0x3f')]?_0x35e4ff[_0x5146('0x2e')]:_0x450189[_0x5146('0x28')];_0x35e4ff[_0x5146('0x42')]=qs[_0x5146('0x51')](_0x20a86c[_0x5146('0x25')][_0x5146('0x51')]);_0x35e4ff[_0x5146('0x43')]=qs[_0x5146('0x2b')](_[_0x5146('0x44')](_0x20a86c[_0x5146('0x25')],_0x450189['filters']));if(_0x20a86c['query'][_0x5146('0x46')]){_0x35e4ff[_0x5146('0x43')]=_['merge'](_0x35e4ff['where'],{'$or':_[_0x5146('0x20')](_0x35e4ff[_0x5146('0x2e')],function(_0x487cbf){var _0x36d6e8={};_0x36d6e8[_0x487cbf]={'$like':'%'+_0x20a86c[_0x5146('0x25')][_0x5146('0x46')]+'%'};return _0x36d6e8;})});}_0x35e4ff=_['merge']({},_0x35e4ff,_0x20a86c[_0x5146('0x30')]);return _0x290645['getTeams'](_0x35e4ff);}})[_0x5146('0x19')](function(_0x240b72){if(_0x240b72){_0x17b485=_0x240b72[_0x5146('0x3f')];if(!_0x20a86c['query'][_0x5146('0x40')](_0x5146('0x41'))){_0x35e4ff[_0x5146('0x16')]=qs[_0x5146('0x16')](_0x20a86c[_0x5146('0x25')][_0x5146('0x16')]);_0x35e4ff[_0x5146('0x15')]=qs[_0x5146('0x15')](_0x20a86c[_0x5146('0x25')][_0x5146('0x15')]);}return _0x290645['getTeams'](_0x35e4ff);}})[_0x5146('0x19')](function(_0x28bd45){if(_0x28bd45){return _0x28bd45?{'count':_0x17b485,'rows':_0x28bd45}:null;}})[_0x5146('0x19')](respondWithResult(_0x4e3d52,null))[_0x5146('0x32')](handleError(_0x4e3d52,null));};exports[_0x5146('0x52')]=function(_0x24ea37,_0x265f2f){var _0x3f3588=_0x24ea37[_0x5146('0x3a')]['ids'];return db[_0x5146('0x50')][_0x5146('0x48')]({'where':{'id':_0x3f3588},'attributes':['id'],'include':[{'model':db[_0x5146('0x53')],'as':_0x5146('0x54'),'attributes':['id','name','online',_0x5146('0x55'),_0x5146('0x56')],'raw':!![]}]})['then'](function(_0x4ae18e){if(_0x4ae18e){var _0x350025=_[_0x5146('0x57')](_0x4ae18e,function(_0x159364){var _0x6054b9=_0x159364[_0x5146('0x1b')]({'plain':!![]});return _0x6054b9[_0x5146('0x54')];});return db[_0x5146('0x21')][_0x5146('0x31')]({'where':{'id':_0x24ea37[_0x5146('0x27')]['id']}})[_0x5146('0x19')](function(_0x5269e1){return db[_0x5146('0x58')][_0x5146('0x59')](function(_0x2e3dc4){return _0x5269e1['addTeams'](_0x3f3588,{'transaction':_0x2e3dc4})[_0x5146('0x19')](function(){return BPromise[_0x5146('0x5a')](_0x350025,function(_0x233a97){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x233a97['id'],'OpenchannelQueueId':_0x24ea37[_0x5146('0x27')]['id']},'transaction':_0x2e3dc4});});})[_0x5146('0x19')](function(){_0x350025[_0x5146('0x5b')](function(_0x324c56){socket['emit'](_0x5146('0x5c'),{'UserId':_0x324c56['id'],'OpenchannelQueueId':_0x5269e1['id']});});});});});}})[_0x5146('0x19')](respondWithStatusCode(_0x265f2f,null))[_0x5146('0x32')](handleError(_0x265f2f,null));};exports['removeTeams']=function(_0x137b47,_0x32cbb6){return db['Team']['findAll']({'where':{'id':_0x137b47[_0x5146('0x25')][_0x5146('0x5d')]},'attributes':['id'],'include':[{'model':db[_0x5146('0x53')],'as':_0x5146('0x54'),'attributes':['id'],'raw':!![]}]})[_0x5146('0x19')](handleEntityNotFound(_0x32cbb6,null))[_0x5146('0x19')](function(_0x365b08){var _0x117a89=_[_0x5146('0x20')](_0x365b08,'id');var _0x42f560=[];var _0x9a6d84=[];var _0x1cc3ee=squel[_0x5146('0x5e')]();_0x1cc3ee[_0x5146('0x5f')](_0x5146('0x60'))[_0x5146('0x61')](_0x5146('0x62'),'tq')[_0x5146('0x63')](_0x5146('0x64'),'ut',_0x5146('0x65'))['where'](_0x5146('0x66'),_0x137b47[_0x5146('0x27')]['id']);for(var _0x4ba0b7=0x0;_0x4ba0b7<_0x365b08['length'];_0x4ba0b7+=0x1){let _0x185efc=_0x365b08[_0x4ba0b7];for(var _0x17f610=0x0;_0x17f610<_0x185efc['Agents'][_0x5146('0x3f')];_0x17f610+=0x1){let _0x4b58d3=_0x185efc[_0x5146('0x54')][_0x17f610];var _0x3334b7=_0x1cc3ee[_0x5146('0x67')]();_0x3334b7[_0x5146('0x43')]('ut.UserId\x20=\x20?',_0x4b58d3['id']);_0x9a6d84['push'](db[_0x5146('0x58')][_0x5146('0x25')](_0x3334b7[_0x5146('0x68')](),{'type':db[_0x5146('0x58')][_0x5146('0x69')][_0x5146('0x6a')]})[_0x5146('0x19')](function(_0x44312d){if(_0x44312d['length']===0x1){return _0x4b58d3['id'];}else{var _0x463441=_['every'](_['map'](_0x44312d,_0x5146('0x6b')),function(_0x450566){return _['includes'](_0x117a89,_0x450566);});if(_0x463441){return _0x4b58d3['id'];}}}));}}return BPromise[_0x5146('0x6c')](_0x9a6d84)[_0x5146('0x19')](function(_0x3fffa1){_0x42f560=_(_0x42f560)['union'](_0x3fffa1)[_0x5146('0x6d')]()[_0x5146('0x6e')]();return db['OpenchannelQueue'][_0x5146('0x31')]({'where':{'id':_0x137b47[_0x5146('0x27')]['id']}})['then'](function(_0x43e20f){return db[_0x5146('0x58')][_0x5146('0x59')](function(_0x2dd24d){return _0x43e20f['removeTeams'](_0x137b47[_0x5146('0x25')][_0x5146('0x5d')],{'transaction':_0x2dd24d})[_0x5146('0x19')](function(){if(!_[_0x5146('0x6f')](_0x42f560)){return _0x43e20f[_0x5146('0x70')](_0x42f560,{'transaction':_0x2dd24d});}})[_0x5146('0x19')](function(){_0x42f560[_0x5146('0x5b')](function(_0x586a94){socket[_0x5146('0x71')](_0x5146('0x72'),{'UserId':_0x586a94,'OpenchannelQueueId':_0x43e20f['id']});});});});});});})[_0x5146('0x19')](respondWithStatusCode(_0x32cbb6,null))['catch'](handleError(_0x32cbb6,null));};exports[_0x5146('0x73')]=function(_0x5ea12f,_0x340fec){return db[_0x5146('0x21')][_0x5146('0x31')]({'where':{'id':_0x5ea12f[_0x5146('0x27')]['id']}})[_0x5146('0x19')](handleEntityNotFound(_0x340fec,null))['then'](function(_0x42ce66){if(_0x42ce66){return _0x42ce66[_0x5146('0x73')](_0x5ea12f[_0x5146('0x3a')][_0x5146('0x5d')],_[_0x5146('0x74')](_0x5ea12f[_0x5146('0x3a')],['ids','id'])||{})['spread'](function(_0x68f2d1){for(var _0x4b60ca=0x0;_0x4b60ca<_0x5ea12f[_0x5146('0x3a')][_0x5146('0x5d')][_0x5146('0x3f')];_0x4b60ca+=0x1){socket[_0x5146('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x5ea12f[_0x5146('0x3a')]['ids'][_0x4b60ca]),'OpenchannelQueueId':Number(_0x5ea12f['params']['id'])});}return _0x68f2d1;});}})[_0x5146('0x19')](respondWithResult(_0x340fec,null))[_0x5146('0x32')](handleError(_0x340fec,null));};exports[_0x5146('0x70')]=function(_0x112622,_0x7371c3){return db[_0x5146('0x21')][_0x5146('0x31')]({'where':{'id':_0x112622[_0x5146('0x27')]['id']}})[_0x5146('0x19')](handleEntityNotFound(_0x7371c3,null))['then'](function(_0x2c15dc){if(_0x2c15dc){return _0x2c15dc[_0x5146('0x70')](_0x112622[_0x5146('0x25')][_0x5146('0x5d')])[_0x5146('0x19')](function(){if(_[_0x5146('0x75')](_0x112622[_0x5146('0x25')][_0x5146('0x5d')])){for(var _0x6d124b=0x0;_0x6d124b<_0x112622['query'][_0x5146('0x5d')]['length'];_0x6d124b+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x112622[_0x5146('0x25')]['ids'][_0x6d124b]),'OpenchannelQueueId':Number(_0x112622[_0x5146('0x27')]['id'])});}}else{socket[_0x5146('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x112622[_0x5146('0x25')]['ids']),'OpenchannelQueueId':Number(_0x112622[_0x5146('0x27')]['id'])});}});}})[_0x5146('0x19')](respondWithStatusCode(_0x7371c3,null))['catch'](handleError(_0x7371c3,null));};exports[_0x5146('0x76')]=function(_0x27951d,_0xbf2b){var _0x463983={};var _0x2453d7={};var _0x46ee73;var _0x249db8;return db[_0x5146('0x21')][_0x5146('0x3d')]({'where':{'id':_0x27951d['params']['id']}})[_0x5146('0x19')](handleEntityNotFound(_0xbf2b,null))[_0x5146('0x19')](function(_0x781d9a){if(_0x781d9a){_0x46ee73=_0x781d9a;_0x2453d7['model']=_[_0x5146('0x2a')](db[_0x5146('0x53')][_0x5146('0x29')]);_0x2453d7['query']=_[_0x5146('0x2a')](_0x27951d[_0x5146('0x25')]);_0x2453d7[_0x5146('0x2b')]=_[_0x5146('0x2c')](_0x2453d7[_0x5146('0x28')],_0x2453d7[_0x5146('0x25')]);_0x463983[_0x5146('0x2e')]=_[_0x5146('0x2c')](_0x2453d7[_0x5146('0x28')],qs[_0x5146('0x2d')](_0x27951d['query'][_0x5146('0x2d')]));_0x463983['attributes']=_0x463983['attributes'][_0x5146('0x3f')]?_0x463983[_0x5146('0x2e')]:_0x2453d7[_0x5146('0x28')];_0x463983['order']=qs[_0x5146('0x51')](_0x27951d[_0x5146('0x25')][_0x5146('0x51')]);_0x463983['where']=qs[_0x5146('0x2b')](_[_0x5146('0x44')](_0x27951d['query'],_0x2453d7[_0x5146('0x2b')]));if(_0x27951d[_0x5146('0x25')][_0x5146('0x46')]){_0x463983[_0x5146('0x43')]=_[_0x5146('0x47')](_0x463983[_0x5146('0x43')],{'$or':_[_0x5146('0x20')](_0x463983[_0x5146('0x2e')],function(_0x3374f0){var _0x21ac87={};_0x21ac87[_0x3374f0]={'$like':'%'+_0x27951d['query'][_0x5146('0x46')]+'%'};return _0x21ac87;})});}_0x463983=_[_0x5146('0x47')]({},_0x463983,_0x27951d[_0x5146('0x30')]);return _0x46ee73[_0x5146('0x76')](_0x463983);}})[_0x5146('0x19')](function(_0x4ab93a){if(_0x4ab93a){_0x249db8=_0x4ab93a[_0x5146('0x3f')];if(!_0x27951d[_0x5146('0x25')][_0x5146('0x40')](_0x5146('0x41'))){_0x463983[_0x5146('0x16')]=qs[_0x5146('0x16')](_0x27951d[_0x5146('0x25')][_0x5146('0x16')]);_0x463983[_0x5146('0x15')]=qs[_0x5146('0x15')](_0x27951d[_0x5146('0x25')]['offset']);}return _0x46ee73[_0x5146('0x76')](_0x463983);}})['then'](function(_0x448363){if(_0x448363){return _0x448363?{'count':_0x249db8,'rows':_0x448363}:null;}})[_0x5146('0x19')](respondWithResult(_0xbf2b,null))['catch'](handleError(_0xbf2b,null));}; \ No newline at end of file +var _0xee73=['%s/%s','createdAt','getTeams','Team','nolimit','ids','User','Agents','voicePause','flatMap','sequelize','transaction','addTeams','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','addAgents','omit','spread','emit','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','update','then','get','OpenchannelQueues','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','OpenchannelQueue','include','query','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','describe','findOne','UserOpenchannelQueue','hasOwnProperty','order','sort','where','pick','OpenchannelQueueId','filter','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format'];(function(_0x296523,_0x3844cc){var _0x2219ec=function(_0x294984){while(--_0x294984){_0x296523['push'](_0x296523['shift']());}};_0x2219ec(++_0x3844cc);}(_0xee73,0x17f));var _0x3ee7=function(_0x21cda3,_0x17b90a){_0x21cda3=_0x21cda3-0x0;var _0x558dc3=_0xee73[_0x21cda3];return _0x558dc3;};'use strict';var BPromise=require(_0x3ee7('0x0'));var util=require(_0x3ee7('0x1'));var _=require(_0x3ee7('0x2'));var squel=require(_0x3ee7('0x3'));var Redis=require(_0x3ee7('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x3ee7('0x5'))('api');var config=require(_0x3ee7('0x6'));var db=require('../../mysqldb')['db'];config[_0x3ee7('0x7')]=_[_0x3ee7('0x8')](config[_0x3ee7('0x7')],{'host':_0x3ee7('0x9'),'port':0x18eb});var socket=require(_0x3ee7('0xa'))(new Redis(config['redis']));require(_0x3ee7('0xb'))[_0x3ee7('0xc')](socket);function respondWithStatusCode(_0x4a5e83,_0x1647d8){_0x1647d8=_0x1647d8||0xcc;return function(_0xaa6226){if(_0xaa6226){return _0x4a5e83[_0x3ee7('0xd')](_0x1647d8);}return _0x4a5e83['status'](_0x1647d8)['end']();};}function respondWithResult(_0x226d87,_0x20c68f){_0x20c68f=_0x20c68f||0xc8;return function(_0x49e790){if(_0x49e790){return _0x226d87[_0x3ee7('0xe')](_0x20c68f)[_0x3ee7('0xf')](_0x49e790);}};}function respondWithFilteredResult(_0x7537f1,_0x50eb07){return function(_0x5d98cc){if(_0x5d98cc){var _0x47685f=typeof _0x50eb07[_0x3ee7('0x10')]===_0x3ee7('0x11')&&typeof _0x50eb07[_0x3ee7('0x12')]===_0x3ee7('0x11');var _0x413ace=_0x5d98cc[_0x3ee7('0x13')];var _0x47a67c=_0x47685f?0x0:_0x50eb07['offset'];var _0x2cc3e2=_0x47685f?_0x5d98cc[_0x3ee7('0x13')]:_0x50eb07[_0x3ee7('0x10')]+_0x50eb07[_0x3ee7('0x12')];var _0x19db77;if(_0x2cc3e2>=_0x413ace){_0x2cc3e2=_0x413ace;_0x19db77=0xc8;}else{_0x19db77=0xce;}_0x7537f1[_0x3ee7('0xe')](_0x19db77);return _0x7537f1['set']('Content-Range',_0x47a67c+'-'+_0x2cc3e2+'/'+_0x413ace)[_0x3ee7('0xf')](_0x5d98cc);}return null;};}function saveUpdates(_0x27c2d9){return function(_0x43ab10){if(_0x43ab10){return _0x43ab10[_0x3ee7('0x14')](_0x27c2d9)[_0x3ee7('0x15')](function(_0x1994d6){return _0x1994d6;});}return null;};}function removeEntity(_0x1dd50b){return function(_0x3c5b78){if(_0x3c5b78){return _0x3c5b78['destroy']()['then'](function(){var _0x4fb161=_0x3c5b78[_0x3ee7('0x16')]({'plain':!![]});var _0x251e40=_0x3ee7('0x17');return db['UserProfileResource'][_0x3ee7('0x18')]({'where':{'type':_0x251e40,'resourceId':_0x4fb161['id']}})[_0x3ee7('0x15')](function(){return _0x3c5b78;});})[_0x3ee7('0x15')](function(){_0x1dd50b[_0x3ee7('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4d07){return function(_0x5cb87a){if(!_0x5cb87a){_0x4b4d07[_0x3ee7('0xd')](0x194);}return _0x5cb87a;};}function handleError(_0x344bd8,_0x34e632){_0x34e632=_0x34e632||0x1f4;return function(_0x557533){logger[_0x3ee7('0x19')](_0x557533[_0x3ee7('0x1a')]);if(_0x557533['name']){delete _0x557533['name'];}_0x344bd8[_0x3ee7('0xe')](_0x34e632)['send'](_0x557533);};}exports[_0x3ee7('0x1b')]=function(_0x406caf,_0x12d1a9){var _0x51c6cd={};var _0x3a196d={'count':0x0,'rows':[]};var _0x3a08cf=_[_0x3ee7('0x1c')](db['OpenchannelQueue'][_0x3ee7('0x1d')],function(_0x29be69){return{'name':_0x29be69[_0x3ee7('0x1e')],'type':_0x29be69[_0x3ee7('0x1f')][_0x3ee7('0x20')]};});_0x51c6cd=qs['getOptions'](_0x3a08cf,_0x406caf);var _0x161e52={'where':_0x51c6cd['where']};return db[_0x3ee7('0x21')][_0x3ee7('0x13')](_0x161e52)[_0x3ee7('0x15')](function(_0x478775){_0x3a196d[_0x3ee7('0x13')]=_0x478775;_0x51c6cd[_0x3ee7('0x22')]=qs[_0x3ee7('0x22')](_0x406caf[_0x3ee7('0x23')]);return db['OpenchannelQueue']['findAll'](_0x51c6cd);})[_0x3ee7('0x15')](function(_0x5bbf4f){_0x3a196d['rows']=_0x5bbf4f;return _0x3a196d;})[_0x3ee7('0x15')](respondWithFilteredResult(_0x12d1a9,_0x51c6cd))['catch'](handleError(_0x12d1a9,null));};exports[_0x3ee7('0x24')]=function(_0x264fea,_0x39eada){var _0x517e7e={'raw':!![],'where':{'id':_0x264fea[_0x3ee7('0x25')]['id']}},_0x1e8ee1={};_0x1e8ee1[_0x3ee7('0x26')]=_['keys'](db[_0x3ee7('0x21')][_0x3ee7('0x1d')]);_0x1e8ee1[_0x3ee7('0x23')]=_[_0x3ee7('0x27')](_0x264fea[_0x3ee7('0x23')]);_0x1e8ee1[_0x3ee7('0x28')]=_[_0x3ee7('0x29')](_0x1e8ee1['model'],_0x1e8ee1[_0x3ee7('0x23')]);_0x517e7e['attributes']=_[_0x3ee7('0x29')](_0x1e8ee1[_0x3ee7('0x26')],qs[_0x3ee7('0x2a')](_0x264fea[_0x3ee7('0x23')][_0x3ee7('0x2a')]));_0x517e7e[_0x3ee7('0x2b')]=_0x517e7e[_0x3ee7('0x2b')][_0x3ee7('0x2c')]?_0x517e7e[_0x3ee7('0x2b')]:_0x1e8ee1['model'];if(_0x264fea[_0x3ee7('0x23')][_0x3ee7('0x2d')]){_0x517e7e['include']=[{'all':!![]}];}_0x517e7e=_[_0x3ee7('0x2e')]({},_0x517e7e,_0x264fea[_0x3ee7('0x2f')]);return db[_0x3ee7('0x21')][_0x3ee7('0x30')](_0x517e7e)[_0x3ee7('0x15')](handleEntityNotFound(_0x39eada,null))['then'](respondWithResult(_0x39eada,null))[_0x3ee7('0x31')](handleError(_0x39eada,null));};exports[_0x3ee7('0x32')]=function(_0x3f8989,_0x1ab4d6){return db[_0x3ee7('0x21')][_0x3ee7('0x32')](_0x3f8989[_0x3ee7('0x33')],{})[_0x3ee7('0x15')](function(_0x2c2ef5){var _0x1a3ca4=_0x3f8989[_0x3ee7('0x34')][_0x3ee7('0x16')]({'plain':!![]});if(!_0x1a3ca4)throw new Error(_0x3ee7('0x35'));if(_0x1a3ca4['role']===_0x3ee7('0x34')){var _0x3e1057=_0x2c2ef5[_0x3ee7('0x16')]({'plain':!![]});var _0x483dcc=_0x3ee7('0x17');return db[_0x3ee7('0x36')][_0x3ee7('0x30')]({'where':{'name':_0x483dcc,'userProfileId':_0x1a3ca4[_0x3ee7('0x37')]},'raw':!![]})['then'](function(_0x14a3e6){if(_0x14a3e6&&_0x14a3e6[_0x3ee7('0x38')]===0x0){return db[_0x3ee7('0x39')][_0x3ee7('0x32')]({'name':_0x3e1057['name'],'resourceId':_0x3e1057['id'],'type':_0x14a3e6[_0x3ee7('0x3a')],'sectionId':_0x14a3e6['id']},{})['then'](function(){return _0x2c2ef5;});}else{return _0x2c2ef5;}})[_0x3ee7('0x31')](function(_0x3b806c){logger[_0x3ee7('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b806c);throw _0x3b806c;});}return _0x2c2ef5;})[_0x3ee7('0x15')](respondWithResult(_0x1ab4d6,0xc9))['catch'](handleError(_0x1ab4d6,null));};exports['update']=function(_0xd9c57,_0xf948de){if(_0xd9c57[_0x3ee7('0x33')]['id']){delete _0xd9c57['body']['id'];}return db['OpenchannelQueue'][_0x3ee7('0x30')]({'where':{'id':_0xd9c57[_0x3ee7('0x25')]['id']}})[_0x3ee7('0x15')](handleEntityNotFound(_0xf948de,null))[_0x3ee7('0x15')](saveUpdates(_0xd9c57['body'],null))['then'](respondWithResult(_0xf948de,null))['catch'](handleError(_0xf948de,null));};exports[_0x3ee7('0x18')]=function(_0xc667a6,_0x1d9b98){return db[_0x3ee7('0x21')][_0x3ee7('0x30')]({'where':{'id':_0xc667a6['params']['id']}})[_0x3ee7('0x15')](handleEntityNotFound(_0x1d9b98,null))['then'](removeEntity(_0x1d9b98,null))[_0x3ee7('0x31')](handleError(_0x1d9b98,null));};exports[_0x3ee7('0x3b')]=function(_0x218a86,_0x4a5a11){return db['OpenchannelQueue'][_0x3ee7('0x3b')]()[_0x3ee7('0x15')](respondWithResult(_0x4a5a11,null))[_0x3ee7('0x31')](handleError(_0x4a5a11,null));};exports['getMembers']=function(_0x250aa8,_0x43be20){var _0x5107be={'raw':!![],'where':{}},_0x37d22e={},_0x3320f7;return db[_0x3ee7('0x21')][_0x3ee7('0x3c')]({'where':{'id':_0x250aa8[_0x3ee7('0x25')]['id']}})[_0x3ee7('0x15')](handleEntityNotFound(_0x43be20,null))[_0x3ee7('0x15')](function(_0x2a3764){if(_0x2a3764){_0x3320f7=_0x2a3764[_0x3ee7('0x16')]({'plain':!![]});_0x37d22e[_0x3ee7('0x26')]=_[_0x3ee7('0x27')](db[_0x3ee7('0x3d')][_0x3ee7('0x1d')]);_0x37d22e[_0x3ee7('0x23')]=_['keys'](_0x250aa8['query']);_0x37d22e[_0x3ee7('0x28')]=_['intersection'](_0x37d22e[_0x3ee7('0x26')],_0x37d22e['query']);_0x5107be[_0x3ee7('0x2b')]=_[_0x3ee7('0x29')](_0x37d22e[_0x3ee7('0x26')],qs[_0x3ee7('0x2a')](_0x250aa8[_0x3ee7('0x23')][_0x3ee7('0x2a')]));_0x5107be[_0x3ee7('0x2b')]=_0x5107be['attributes'][_0x3ee7('0x2c')]?_0x5107be['attributes']:_0x37d22e[_0x3ee7('0x26')];if(!_0x250aa8[_0x3ee7('0x23')][_0x3ee7('0x3e')]('nolimit')){_0x5107be[_0x3ee7('0x12')]=qs[_0x3ee7('0x12')](_0x250aa8[_0x3ee7('0x23')][_0x3ee7('0x12')]);_0x5107be[_0x3ee7('0x10')]=qs[_0x3ee7('0x10')](_0x250aa8[_0x3ee7('0x23')][_0x3ee7('0x10')]);}_0x5107be[_0x3ee7('0x3f')]=qs[_0x3ee7('0x40')](_0x250aa8['query'][_0x3ee7('0x40')]);_0x5107be[_0x3ee7('0x41')]=qs['filters'](_[_0x3ee7('0x42')](_0x250aa8[_0x3ee7('0x23')],_0x37d22e[_0x3ee7('0x28')]));_0x5107be[_0x3ee7('0x41')][_0x3ee7('0x43')]=_0x2a3764['id'];if(_0x250aa8[_0x3ee7('0x23')]['filter']){_0x5107be[_0x3ee7('0x41')]=_[_0x3ee7('0x2e')](_0x5107be[_0x3ee7('0x41')],{'$or':_['map'](_0x5107be[_0x3ee7('0x2b')],function(_0x48402c){var _0x2ed720={};_0x2ed720[_0x48402c]={'$like':'%'+_0x250aa8['query'][_0x3ee7('0x44')]+'%'};return _0x2ed720;})});}_0x5107be=_['merge']({},_0x5107be,_0x250aa8[_0x3ee7('0x2f')]);return db[_0x3ee7('0x3d')][_0x3ee7('0x45')](_0x5107be);}})[_0x3ee7('0x15')](function(_0x27486c){if(_0x27486c){return db['User'][_0x3ee7('0x46')]({'where':{'id':_[_0x3ee7('0x1c')](_0x27486c,_0x3ee7('0x47')),'role':_0x3ee7('0x48')},'attributes':['id',_0x3ee7('0x3a'),_0x3ee7('0x49'),_0x3ee7('0x4a'),'createdAt']});}})[_0x3ee7('0x15')](function(_0x503db2){if(_0x503db2){return{'count':_0x503db2[_0x3ee7('0x13')],'rows':_[_0x3ee7('0x1c')](_0x503db2[_0x3ee7('0x4b')],function(_0x36f6d4){return{'membername':_0x36f6d4[_0x3ee7('0x3a')],'UserId':_0x36f6d4['id'],'queue_name':_0x3320f7[_0x3ee7('0x3a')],'OpenchannelQueueId':_0x3320f7['id'],'interface':util[_0x3ee7('0x4c')](_0x3ee7('0x4d'),'SIP',_0x36f6d4[_0x3ee7('0x3a')]),'penalty':0x0,'paused':_0x36f6d4[_0x3ee7('0x49')],'createdAt':_0x36f6d4[_0x3ee7('0x4e')],'updatedAt':_0x36f6d4[_0x3ee7('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ee7('0x15')](respondWithFilteredResult(_0x43be20,_0x5107be))['catch'](handleError(_0x43be20,null));};exports[_0x3ee7('0x4f')]=function(_0x133fa8,_0x24f6fd){var _0x36df41={};var _0x2cce78={};var _0x2a27c5;var _0x4f2864;return db[_0x3ee7('0x21')]['findOne']({'where':{'id':_0x133fa8[_0x3ee7('0x25')]['id']}})[_0x3ee7('0x15')](handleEntityNotFound(_0x24f6fd,null))[_0x3ee7('0x15')](function(_0x14d9a2){if(_0x14d9a2){_0x2a27c5=_0x14d9a2;_0x2cce78['model']=_[_0x3ee7('0x27')](db[_0x3ee7('0x50')]['rawAttributes']);_0x2cce78[_0x3ee7('0x23')]=_['keys'](_0x133fa8[_0x3ee7('0x23')]);_0x2cce78[_0x3ee7('0x28')]=_[_0x3ee7('0x29')](_0x2cce78[_0x3ee7('0x26')],_0x2cce78[_0x3ee7('0x23')]);_0x36df41[_0x3ee7('0x2b')]=_['intersection'](_0x2cce78[_0x3ee7('0x26')],qs[_0x3ee7('0x2a')](_0x133fa8[_0x3ee7('0x23')]['fields']));_0x36df41[_0x3ee7('0x2b')]=_0x36df41['attributes'][_0x3ee7('0x2c')]?_0x36df41[_0x3ee7('0x2b')]:_0x2cce78['model'];_0x36df41[_0x3ee7('0x3f')]=qs[_0x3ee7('0x40')](_0x133fa8[_0x3ee7('0x23')][_0x3ee7('0x40')]);_0x36df41[_0x3ee7('0x41')]=qs[_0x3ee7('0x28')](_[_0x3ee7('0x42')](_0x133fa8['query'],_0x2cce78['filters']));if(_0x133fa8[_0x3ee7('0x23')]['filter']){_0x36df41[_0x3ee7('0x41')]=_['merge'](_0x36df41[_0x3ee7('0x41')],{'$or':_[_0x3ee7('0x1c')](_0x36df41[_0x3ee7('0x2b')],function(_0x16a0b9){var _0x9d2e30={};_0x9d2e30[_0x16a0b9]={'$like':'%'+_0x133fa8[_0x3ee7('0x23')]['filter']+'%'};return _0x9d2e30;})});}_0x36df41=_['merge']({},_0x36df41,_0x133fa8[_0x3ee7('0x2f')]);return _0x2a27c5['getTeams'](_0x36df41);}})[_0x3ee7('0x15')](function(_0x3073c6){if(_0x3073c6){_0x4f2864=_0x3073c6[_0x3ee7('0x2c')];if(!_0x133fa8[_0x3ee7('0x23')][_0x3ee7('0x3e')](_0x3ee7('0x51'))){_0x36df41[_0x3ee7('0x12')]=qs[_0x3ee7('0x12')](_0x133fa8[_0x3ee7('0x23')][_0x3ee7('0x12')]);_0x36df41[_0x3ee7('0x10')]=qs['offset'](_0x133fa8[_0x3ee7('0x23')][_0x3ee7('0x10')]);}return _0x2a27c5[_0x3ee7('0x4f')](_0x36df41);}})['then'](function(_0x33e40c){if(_0x33e40c){return _0x33e40c?{'count':_0x4f2864,'rows':_0x33e40c}:null;}})['then'](respondWithResult(_0x24f6fd,null))[_0x3ee7('0x31')](handleError(_0x24f6fd,null));};exports['addTeams']=function(_0x440632,_0x40bf2e){var _0x5ce234=_0x440632['body'][_0x3ee7('0x52')];return db['Team'][_0x3ee7('0x45')]({'where':{'id':_0x5ce234},'attributes':['id'],'include':[{'model':db[_0x3ee7('0x53')],'as':_0x3ee7('0x54'),'attributes':['id',_0x3ee7('0x3a'),'online',_0x3ee7('0x55'),'interface'],'raw':!![]}]})[_0x3ee7('0x15')](function(_0xdcdb6d){if(_0xdcdb6d){var _0x411f19=_[_0x3ee7('0x56')](_0xdcdb6d,function(_0x37e46a){var _0x4ecb34=_0x37e46a['get']({'plain':!![]});return _0x4ecb34[_0x3ee7('0x54')];});return db[_0x3ee7('0x21')][_0x3ee7('0x30')]({'where':{'id':_0x440632[_0x3ee7('0x25')]['id']}})['then'](function(_0x482097){return db[_0x3ee7('0x57')][_0x3ee7('0x58')](function(_0x2ca635){return _0x482097[_0x3ee7('0x59')](_0x5ce234,{'transaction':_0x2ca635})[_0x3ee7('0x15')](function(){return BPromise['each'](_0x411f19,function(_0xb91e8c){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0xb91e8c['id'],'OpenchannelQueueId':_0x440632['params']['id']},'transaction':_0x2ca635});});})[_0x3ee7('0x15')](function(){_0x411f19['forEach'](function(_0x5083c8){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x5083c8['id'],'OpenchannelQueueId':_0x482097['id']});});});});});}})['then'](respondWithStatusCode(_0x40bf2e,null))[_0x3ee7('0x31')](handleError(_0x40bf2e,null));};exports[_0x3ee7('0x5a')]=function(_0x342c8a,_0x55fb2e){return db['Team'][_0x3ee7('0x45')]({'where':{'id':_0x342c8a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3ee7('0x53')],'as':_0x3ee7('0x54'),'attributes':['id'],'raw':!![]}]})[_0x3ee7('0x15')](handleEntityNotFound(_0x55fb2e,null))['then'](function(_0x3ba697){var _0x10f243=_[_0x3ee7('0x1c')](_0x3ba697,'id');var _0x7cf99f=[];var _0x20bc00=[];var _0x3925be=squel[_0x3ee7('0x5b')]();_0x3925be[_0x3ee7('0x5c')](_0x3ee7('0x5d'))[_0x3ee7('0x5e')]('team_has_openchannel_queues','tq')[_0x3ee7('0x5f')](_0x3ee7('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3ee7('0x61'),_0x342c8a[_0x3ee7('0x25')]['id']);for(var _0x4d265a=0x0;_0x4d265a<_0x3ba697[_0x3ee7('0x2c')];_0x4d265a+=0x1){let _0x111eae=_0x3ba697[_0x4d265a];for(var _0x2abf63=0x0;_0x2abf63<_0x111eae[_0x3ee7('0x54')][_0x3ee7('0x2c')];_0x2abf63+=0x1){let _0x1984d2=_0x111eae[_0x3ee7('0x54')][_0x2abf63];var _0x1f38e4=_0x3925be[_0x3ee7('0x62')]();_0x1f38e4[_0x3ee7('0x41')]('ut.UserId\x20=\x20?',_0x1984d2['id']);_0x20bc00[_0x3ee7('0x63')](db[_0x3ee7('0x57')][_0x3ee7('0x23')](_0x1f38e4['toString'](),{'type':db[_0x3ee7('0x57')][_0x3ee7('0x64')][_0x3ee7('0x65')]})[_0x3ee7('0x15')](function(_0x5910fe){if(_0x5910fe[_0x3ee7('0x2c')]===0x1){return _0x1984d2['id'];}else{var _0x413f55=_[_0x3ee7('0x66')](_[_0x3ee7('0x1c')](_0x5910fe,_0x3ee7('0x67')),function(_0x51630f){return _[_0x3ee7('0x68')](_0x10f243,_0x51630f);});if(_0x413f55){return _0x1984d2['id'];}}}));}}return BPromise['all'](_0x20bc00)[_0x3ee7('0x15')](function(_0x5175db){_0x7cf99f=_(_0x7cf99f)[_0x3ee7('0x69')](_0x5175db)[_0x3ee7('0x6a')]()[_0x3ee7('0x6b')]();return db[_0x3ee7('0x21')][_0x3ee7('0x30')]({'where':{'id':_0x342c8a[_0x3ee7('0x25')]['id']}})[_0x3ee7('0x15')](function(_0x54f206){return db[_0x3ee7('0x57')][_0x3ee7('0x58')](function(_0x2ee995){return _0x54f206['removeTeams'](_0x342c8a[_0x3ee7('0x23')][_0x3ee7('0x52')],{'transaction':_0x2ee995})[_0x3ee7('0x15')](function(){if(!_['isEmpty'](_0x7cf99f)){return _0x54f206[_0x3ee7('0x6c')](_0x7cf99f,{'transaction':_0x2ee995});}})[_0x3ee7('0x15')](function(){_0x7cf99f['forEach'](function(_0x317a1f){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x317a1f,'OpenchannelQueueId':_0x54f206['id']});});});});});});})['then'](respondWithStatusCode(_0x55fb2e,null))[_0x3ee7('0x31')](handleError(_0x55fb2e,null));};exports[_0x3ee7('0x6d')]=function(_0x2943bf,_0x203016){return db[_0x3ee7('0x21')][_0x3ee7('0x30')]({'where':{'id':_0x2943bf['params']['id']}})[_0x3ee7('0x15')](handleEntityNotFound(_0x203016,null))['then'](function(_0x4e708c){if(_0x4e708c){return _0x4e708c[_0x3ee7('0x6d')](_0x2943bf['body'][_0x3ee7('0x52')],_[_0x3ee7('0x6e')](_0x2943bf[_0x3ee7('0x33')],[_0x3ee7('0x52'),'id'])||{})[_0x3ee7('0x6f')](function(_0x1617db){for(var _0x33127e=0x0;_0x33127e<_0x2943bf['body'][_0x3ee7('0x52')][_0x3ee7('0x2c')];_0x33127e+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x2943bf[_0x3ee7('0x33')][_0x3ee7('0x52')][_0x33127e]),'OpenchannelQueueId':Number(_0x2943bf[_0x3ee7('0x25')]['id'])});}return _0x1617db;});}})[_0x3ee7('0x15')](respondWithResult(_0x203016,null))['catch'](handleError(_0x203016,null));};exports[_0x3ee7('0x6c')]=function(_0x2eddc5,_0x1ed5e6){return db['OpenchannelQueue'][_0x3ee7('0x30')]({'where':{'id':_0x2eddc5['params']['id']}})['then'](handleEntityNotFound(_0x1ed5e6,null))[_0x3ee7('0x15')](function(_0x4cc07d){if(_0x4cc07d){return _0x4cc07d[_0x3ee7('0x6c')](_0x2eddc5['query'][_0x3ee7('0x52')])[_0x3ee7('0x15')](function(){if(_['isArray'](_0x2eddc5['query'][_0x3ee7('0x52')])){for(var _0x4a9982=0x0;_0x4a9982<_0x2eddc5['query']['ids']['length'];_0x4a9982+=0x1){socket[_0x3ee7('0x70')](_0x3ee7('0x71'),{'UserId':Number(_0x2eddc5['query'][_0x3ee7('0x52')][_0x4a9982]),'OpenchannelQueueId':Number(_0x2eddc5[_0x3ee7('0x25')]['id'])});}}else{socket[_0x3ee7('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2eddc5['query'][_0x3ee7('0x52')]),'OpenchannelQueueId':Number(_0x2eddc5[_0x3ee7('0x25')]['id'])});}});}})[_0x3ee7('0x15')](respondWithStatusCode(_0x1ed5e6,null))[_0x3ee7('0x31')](handleError(_0x1ed5e6,null));};exports[_0x3ee7('0x72')]=function(_0x56ddac,_0x24657d){var _0x7aaaca={};var _0x3b9957={};var _0x2ea776;var _0x2cf89a;return db['OpenchannelQueue'][_0x3ee7('0x3c')]({'where':{'id':_0x56ddac[_0x3ee7('0x25')]['id']}})[_0x3ee7('0x15')](handleEntityNotFound(_0x24657d,null))[_0x3ee7('0x15')](function(_0x3f3b69){if(_0x3f3b69){_0x2ea776=_0x3f3b69;_0x3b9957['model']=_[_0x3ee7('0x27')](db[_0x3ee7('0x53')][_0x3ee7('0x1d')]);_0x3b9957['query']=_[_0x3ee7('0x27')](_0x56ddac[_0x3ee7('0x23')]);_0x3b9957[_0x3ee7('0x28')]=_[_0x3ee7('0x29')](_0x3b9957['model'],_0x3b9957[_0x3ee7('0x23')]);_0x7aaaca['attributes']=_[_0x3ee7('0x29')](_0x3b9957[_0x3ee7('0x26')],qs[_0x3ee7('0x2a')](_0x56ddac['query']['fields']));_0x7aaaca[_0x3ee7('0x2b')]=_0x7aaaca[_0x3ee7('0x2b')]['length']?_0x7aaaca[_0x3ee7('0x2b')]:_0x3b9957['model'];_0x7aaaca['order']=qs[_0x3ee7('0x40')](_0x56ddac[_0x3ee7('0x23')][_0x3ee7('0x40')]);_0x7aaaca[_0x3ee7('0x41')]=qs[_0x3ee7('0x28')](_[_0x3ee7('0x42')](_0x56ddac['query'],_0x3b9957[_0x3ee7('0x28')]));if(_0x56ddac[_0x3ee7('0x23')]['filter']){_0x7aaaca[_0x3ee7('0x41')]=_['merge'](_0x7aaaca[_0x3ee7('0x41')],{'$or':_[_0x3ee7('0x1c')](_0x7aaaca[_0x3ee7('0x2b')],function(_0x4c6f3f){var _0x56b518={};_0x56b518[_0x4c6f3f]={'$like':'%'+_0x56ddac[_0x3ee7('0x23')]['filter']+'%'};return _0x56b518;})});}_0x7aaaca=_['merge']({},_0x7aaaca,_0x56ddac['options']);return _0x2ea776[_0x3ee7('0x72')](_0x7aaaca);}})[_0x3ee7('0x15')](function(_0x4909a5){if(_0x4909a5){_0x2cf89a=_0x4909a5['length'];if(!_0x56ddac[_0x3ee7('0x23')]['hasOwnProperty'](_0x3ee7('0x51'))){_0x7aaaca[_0x3ee7('0x12')]=qs[_0x3ee7('0x12')](_0x56ddac[_0x3ee7('0x23')][_0x3ee7('0x12')]);_0x7aaaca[_0x3ee7('0x10')]=qs[_0x3ee7('0x10')](_0x56ddac[_0x3ee7('0x23')][_0x3ee7('0x10')]);}return _0x2ea776[_0x3ee7('0x72')](_0x7aaaca);}})[_0x3ee7('0x15')](function(_0x2570a8){if(_0x2570a8){return _0x2570a8?{'count':_0x2cf89a,'rows':_0x2570a8}:null;}})['then'](respondWithResult(_0x24657d,null))[_0x3ee7('0x31')](handleError(_0x24657d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b3c1659..83e10b8 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 _0x3ce9=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','update'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x3ce9,0x195));var _0x93ce=function(_0x25ff33,_0x52f855){_0x25ff33=_0x25ff33-0x0;var _0x28344b=_0x3ce9[_0x25ff33];return _0x28344b;};'use strict';var EventEmitter=require(_0x93ce('0x0'));var OpenchannelQueue=require(_0x93ce('0x1'))['db'][_0x93ce('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x93ce('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x93ce('0x4'),'afterDestroy':_0x93ce('0x5')};function emitEvent(_0x5c30bf){return function(_0x295e8c,_0x36b524,_0x51da69){OpenchannelQueueEvents[_0x93ce('0x6')](_0x5c30bf+':'+_0x295e8c['id'],_0x295e8c);OpenchannelQueueEvents[_0x93ce('0x6')](_0x5c30bf,_0x295e8c);_0x51da69(null);};}for(var e in events){if(events[_0x93ce('0x7')](e)){var event=events[e];OpenchannelQueue[_0x93ce('0x8')](e,emitEvent(event));}}module[_0x93ce('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xb08a=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x3319f6,_0x2cbaac){var _0x1dcba6=function(_0x54a395){while(--_0x54a395){_0x3319f6['push'](_0x3319f6['shift']());}};_0x1dcba6(++_0x2cbaac);}(_0xb08a,0x1c9));var _0xab08=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0xb08a[_0x35b195];return _0x2433bf;};'use strict';var EventEmitter=require(_0xab08('0x0'));var OpenchannelQueue=require(_0xab08('0x1'))['db'][_0xab08('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xab08('0x3')](0x0);var events={'afterCreate':_0xab08('0x4'),'afterUpdate':_0xab08('0x5'),'afterDestroy':_0xab08('0x6')};function emitEvent(_0x1bc286){return function(_0x3b8922,_0x432e6c,_0x456645){OpenchannelQueueEvents[_0xab08('0x7')](_0x1bc286+':'+_0x3b8922['id'],_0x3b8922);OpenchannelQueueEvents[_0xab08('0x7')](_0x1bc286,_0x3b8922);_0x456645(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xab08('0x8')](e,emitEvent(event));}}module[_0xab08('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 7258460..3e39f88 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 _0x39fd=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39fd,0x6a));var _0xd39f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39fd[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var logger=require(_0xd39f('0x2'))('api');var moment=require(_0xd39f('0x3'));var BPromise=require(_0xd39f('0x4'));var rp=require(_0xd39f('0x5'));var fs=require('fs');var path=require(_0xd39f('0x6'));var rimraf=require(_0xd39f('0x7'));var config=require(_0xd39f('0x8'));var attributes=require(_0xd39f('0x9'));module[_0xd39f('0xa')]=function(_0x20f951,_0x379dca){return _0x20f951[_0xd39f('0xb')](_0xd39f('0xc'),attributes,{'tableName':_0xd39f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc7e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','api'];(function(_0x132658,_0x18ef9e){var _0x236171=function(_0x3fffa4){while(--_0x3fffa4){_0x132658['push'](_0x132658['shift']());}};_0x236171(++_0x18ef9e);}(_0xdc7e,0x1cc));var _0xedc7=function(_0x569096,_0x5e91d9){_0x569096=_0x569096-0x0;var _0x318812=_0xdc7e[_0x569096];return _0x318812;};'use strict';var _=require(_0xedc7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xedc7('0x1'));var moment=require(_0xedc7('0x2'));var BPromise=require(_0xedc7('0x3'));var rp=require(_0xedc7('0x4'));var fs=require('fs');var path=require(_0xedc7('0x5'));var rimraf=require(_0xedc7('0x6'));var config=require(_0xedc7('0x7'));var attributes=require(_0xedc7('0x8'));module['exports']=function(_0x4e24cd,_0x24705a){return _0x4e24cd[_0xedc7('0x9')](_0xedc7('0xa'),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 d855044..1b2a208 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 _0xdf1b=['result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','OpenchannelQueue','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x133a43,_0x57f306){var _0x154673=function(_0x3ba1e4){while(--_0x3ba1e4){_0x133a43['push'](_0x133a43['shift']());}};_0x154673(++_0x57f306);}(_0xdf1b,0xdc));var _0xbdf1=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xdf1b[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require('lodash');var util=require(_0xbdf1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbdf1('0x1'));var fs=require('fs');var Redis=require(_0xbdf1('0x2'));var db=require(_0xbdf1('0x3'))['db'];var utils=require(_0xbdf1('0x4'));var logger=require(_0xbdf1('0x5'))(_0xbdf1('0x6'));var config=require(_0xbdf1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbdf1('0x8')][_0xbdf1('0x9')]({'port':0x232a});config[_0xbdf1('0xa')]=_[_0xbdf1('0xb')](config[_0xbdf1('0xa')],{'host':_0xbdf1('0xc'),'port':0x18eb});var socket=require(_0xbdf1('0xd'))(new Redis(config[_0xbdf1('0xa')]));require(_0xbdf1('0xe'))[_0xbdf1('0xf')](socket);function respondWithRpcPromise(_0x3d60e1,_0x2081d6,_0x599d48){return new BPromise(function(_0x25b5a8,_0x55b9a6){return client[_0xbdf1('0x10')](_0x3d60e1,_0x599d48)[_0xbdf1('0x11')](function(_0x3f9428){logger[_0xbdf1('0x12')](_0xbdf1('0x13'),_0x2081d6,_0xbdf1('0x14'));logger[_0xbdf1('0x15')](_0xbdf1('0x16'),_0x2081d6,'request\x20sent',JSON[_0xbdf1('0x17')](_0x3f9428));if(_0x3f9428[_0xbdf1('0x18')]){if(_0x3f9428[_0xbdf1('0x18')]['code']===0x1f4){logger[_0xbdf1('0x18')](_0xbdf1('0x13'),_0x2081d6,_0x3f9428[_0xbdf1('0x18')][_0xbdf1('0x19')]);return _0x55b9a6(_0x3f9428[_0xbdf1('0x18')][_0xbdf1('0x19')]);}logger[_0xbdf1('0x18')](_0xbdf1('0x13'),_0x2081d6,_0x3f9428['error'][_0xbdf1('0x19')]);return _0x25b5a8(_0x3f9428[_0xbdf1('0x18')][_0xbdf1('0x19')]);}else{logger[_0xbdf1('0x12')](_0xbdf1('0x13'),_0x2081d6,_0xbdf1('0x14'));_0x25b5a8(_0x3f9428[_0xbdf1('0x1a')][_0xbdf1('0x19')]);}})[_0xbdf1('0x1b')](function(_0x3f0ed2){logger[_0xbdf1('0x18')](_0xbdf1('0x13'),_0x2081d6,_0x3f0ed2);_0x55b9a6(_0x3f0ed2);});});}exports[_0xbdf1('0x1c')]=function(_0x27524c){var _0x436da4=this;return new Promise(function(_0xb9f14b,_0x5a3f76){return db['OpenchannelQueue'][_0xbdf1('0x1d')]({'raw':_0x27524c['options']?_0x27524c[_0xbdf1('0x1e')][_0xbdf1('0x1f')]===undefined?!![]:![]:!![],'where':_0x27524c[_0xbdf1('0x1e')]?_0x27524c['options'][_0xbdf1('0x20')]||null:null,'attributes':_0x27524c['options']?_0x27524c['options'][_0xbdf1('0x21')]||null:null,'limit':_0x27524c['options']?_0x27524c[_0xbdf1('0x1e')][_0xbdf1('0x22')]||null:null,'include':_0x27524c[_0xbdf1('0x1e')]?_0x27524c[_0xbdf1('0x1e')][_0xbdf1('0x23')]?_[_0xbdf1('0x24')](_0x27524c[_0xbdf1('0x1e')][_0xbdf1('0x23')],function(_0x1a1808){return{'model':db[_0x1a1808[_0xbdf1('0x25')]],'as':_0x1a1808['as'],'attributes':_0x1a1808[_0xbdf1('0x21')],'include':_0x1a1808[_0xbdf1('0x23')]?_[_0xbdf1('0x24')](_0x1a1808[_0xbdf1('0x23')],function(_0x4aa032){return{'model':db[_0x4aa032[_0xbdf1('0x25')]],'as':_0x4aa032['as'],'attributes':_0x4aa032[_0xbdf1('0x21')],'include':_0x4aa032[_0xbdf1('0x23')]?_[_0xbdf1('0x24')](_0x4aa032[_0xbdf1('0x23')],function(_0x54946a){return{'model':db[_0x54946a['model']],'as':_0x54946a['as'],'attributes':_0x54946a[_0xbdf1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbdf1('0x11')](function(_0x4d6c78){logger[_0xbdf1('0x12')]('GetOpenchannelQueue',_0x27524c);logger[_0xbdf1('0x15')]('GetOpenchannelQueue',_0x27524c,JSON[_0xbdf1('0x17')](_0x4d6c78));_0xb9f14b(_0x4d6c78);})[_0xbdf1('0x1b')](function(_0x2aeb97){logger[_0xbdf1('0x18')](_0xbdf1('0x1c'),_0x2aeb97[_0xbdf1('0x19')],_0x27524c);_0x5a3f76(_0x436da4[_0xbdf1('0x18')](0x1f4,_0x2aeb97[_0xbdf1('0x19')]));});});};exports[_0xbdf1('0x26')]=function(_0x4e3abb){var _0x4ea5e5=this;return new Promise(function(_0x3eac32,_0x27dac7){return db[_0xbdf1('0x27')][_0xbdf1('0x28')]({'raw':_0x4e3abb[_0xbdf1('0x1e')]?_0x4e3abb[_0xbdf1('0x1e')][_0xbdf1('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e3abb['options']?_0x4e3abb[_0xbdf1('0x1e')]['where']||null:null,'attributes':_0x4e3abb[_0xbdf1('0x1e')]?_0x4e3abb['options'][_0xbdf1('0x21')]||null:null,'include':_0x4e3abb['options']?_0x4e3abb['options']['include']?_['map'](_0x4e3abb['options'][_0xbdf1('0x23')],function(_0x16f0c5){return{'model':db[_0x16f0c5[_0xbdf1('0x25')]],'as':_0x16f0c5['as'],'attributes':_0x16f0c5[_0xbdf1('0x21')],'include':_0x16f0c5[_0xbdf1('0x23')]?_[_0xbdf1('0x24')](_0x16f0c5[_0xbdf1('0x23')],function(_0x24a112){return{'model':db[_0x24a112[_0xbdf1('0x25')]],'as':_0x24a112['as'],'attributes':_0x24a112['attributes'],'include':_0x24a112[_0xbdf1('0x23')]?_[_0xbdf1('0x24')](_0x24a112['include'],function(_0x330337){return{'model':db[_0x330337[_0xbdf1('0x25')]],'as':_0x330337['as'],'attributes':_0x330337['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdf1('0x11')](function(_0x236070){logger['info'](_0xbdf1('0x26'),_0x4e3abb);logger['debug'](_0xbdf1('0x26'),_0x4e3abb,JSON['stringify'](_0x236070));_0x3eac32(_0x236070);})[_0xbdf1('0x1b')](function(_0x3a27dd){logger[_0xbdf1('0x18')]('ShowOpenchannelQueue',_0x3a27dd['message'],_0x4e3abb);_0x27dac7(_0x4ea5e5['error'](0x1f4,_0x3a27dd[_0xbdf1('0x19')]));});});}; \ No newline at end of file +var _0xf6ee=['where','attributes','limit','map','model','include','info','ShowOpenchannelQueue','OpenchannelQueue','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','findAll','options'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xf6ee,0xd4));var _0xef6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6ee[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef6e('0x0'));var util=require(_0xef6e('0x1'));var moment=require(_0xef6e('0x2'));var BPromise=require(_0xef6e('0x3'));var rs=require(_0xef6e('0x4'));var fs=require('fs');var Redis=require(_0xef6e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xef6e('0x6'));var logger=require('../../config/logger')(_0xef6e('0x7'));var config=require(_0xef6e('0x8'));var jayson=require(_0xef6e('0x9'));var client=jayson['client'][_0xef6e('0xa')]({'port':0x232a});config[_0xef6e('0xb')]=_[_0xef6e('0xc')](config[_0xef6e('0xb')],{'host':_0xef6e('0xd'),'port':0x18eb});var socket=require(_0xef6e('0xe'))(new Redis(config['redis']));require(_0xef6e('0xf'))['register'](socket);function respondWithRpcPromise(_0x5686db,_0x354785,_0x291009){return new BPromise(function(_0x118b27,_0x5695ad){return client[_0xef6e('0x10')](_0x5686db,_0x291009)['then'](function(_0x566b0d){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x354785,_0xef6e('0x11'));logger[_0xef6e('0x12')](_0xef6e('0x13'),_0x354785,_0xef6e('0x11'),JSON[_0xef6e('0x14')](_0x566b0d));if(_0x566b0d[_0xef6e('0x15')]){if(_0x566b0d[_0xef6e('0x15')]['code']===0x1f4){logger['error'](_0xef6e('0x16'),_0x354785,_0x566b0d[_0xef6e('0x15')][_0xef6e('0x17')]);return _0x5695ad(_0x566b0d[_0xef6e('0x15')]['message']);}logger[_0xef6e('0x15')](_0xef6e('0x16'),_0x354785,_0x566b0d[_0xef6e('0x15')][_0xef6e('0x17')]);return _0x118b27(_0x566b0d['error'][_0xef6e('0x17')]);}else{logger['info'](_0xef6e('0x16'),_0x354785,_0xef6e('0x11'));_0x118b27(_0x566b0d[_0xef6e('0x18')]['message']);}})['catch'](function(_0x341e10){logger['error'](_0xef6e('0x16'),_0x354785,_0x341e10);_0x5695ad(_0x341e10);});});}exports[_0xef6e('0x19')]=function(_0x48a10c){var _0x1f20e1=this;return new Promise(function(_0x2db8de,_0x350aa1){return db['OpenchannelQueue'][_0xef6e('0x1a')]({'raw':_0x48a10c[_0xef6e('0x1b')]?_0x48a10c[_0xef6e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x48a10c[_0xef6e('0x1b')]?_0x48a10c['options'][_0xef6e('0x1c')]||null:null,'attributes':_0x48a10c['options']?_0x48a10c['options'][_0xef6e('0x1d')]||null:null,'limit':_0x48a10c[_0xef6e('0x1b')]?_0x48a10c[_0xef6e('0x1b')][_0xef6e('0x1e')]||null:null,'include':_0x48a10c[_0xef6e('0x1b')]?_0x48a10c['options']['include']?_[_0xef6e('0x1f')](_0x48a10c['options']['include'],function(_0x51e15f){return{'model':db[_0x51e15f[_0xef6e('0x20')]],'as':_0x51e15f['as'],'attributes':_0x51e15f['attributes'],'include':_0x51e15f[_0xef6e('0x21')]?_['map'](_0x51e15f['include'],function(_0x4d9fec){return{'model':db[_0x4d9fec[_0xef6e('0x20')]],'as':_0x4d9fec['as'],'attributes':_0x4d9fec[_0xef6e('0x1d')],'include':_0x4d9fec[_0xef6e('0x21')]?_[_0xef6e('0x1f')](_0x4d9fec[_0xef6e('0x21')],function(_0x255ab1){return{'model':db[_0x255ab1['model']],'as':_0x255ab1['as'],'attributes':_0x255ab1[_0xef6e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20540d){logger[_0xef6e('0x22')](_0xef6e('0x19'),_0x48a10c);logger[_0xef6e('0x12')](_0xef6e('0x19'),_0x48a10c,JSON[_0xef6e('0x14')](_0x20540d));_0x2db8de(_0x20540d);})['catch'](function(_0x33bd68){logger[_0xef6e('0x15')](_0xef6e('0x19'),_0x33bd68[_0xef6e('0x17')],_0x48a10c);_0x350aa1(_0x1f20e1[_0xef6e('0x15')](0x1f4,_0x33bd68[_0xef6e('0x17')]));});});};exports[_0xef6e('0x23')]=function(_0x575e91){var _0x151b99=this;return new Promise(function(_0x3810a0,_0x533a48){return db[_0xef6e('0x24')]['find']({'raw':_0x575e91[_0xef6e('0x1b')]?_0x575e91[_0xef6e('0x1b')][_0xef6e('0x25')]===undefined?!![]:![]:!![],'where':_0x575e91['options']?_0x575e91[_0xef6e('0x1b')][_0xef6e('0x1c')]||null:null,'attributes':_0x575e91[_0xef6e('0x1b')]?_0x575e91[_0xef6e('0x1b')][_0xef6e('0x1d')]||null:null,'include':_0x575e91['options']?_0x575e91[_0xef6e('0x1b')]['include']?_['map'](_0x575e91[_0xef6e('0x1b')]['include'],function(_0x4154ce){return{'model':db[_0x4154ce[_0xef6e('0x20')]],'as':_0x4154ce['as'],'attributes':_0x4154ce[_0xef6e('0x1d')],'include':_0x4154ce['include']?_[_0xef6e('0x1f')](_0x4154ce['include'],function(_0x528ae4){return{'model':db[_0x528ae4[_0xef6e('0x20')]],'as':_0x528ae4['as'],'attributes':_0x528ae4[_0xef6e('0x1d')],'include':_0x528ae4[_0xef6e('0x21')]?_[_0xef6e('0x1f')](_0x528ae4[_0xef6e('0x21')],function(_0x459028){return{'model':db[_0x459028[_0xef6e('0x20')]],'as':_0x459028['as'],'attributes':_0x459028[_0xef6e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef6e('0x26')](function(_0x102aac){logger[_0xef6e('0x22')]('ShowOpenchannelQueue',_0x575e91);logger[_0xef6e('0x12')]('ShowOpenchannelQueue',_0x575e91,JSON[_0xef6e('0x14')](_0x102aac));_0x3810a0(_0x102aac);})[_0xef6e('0x27')](function(_0x4e7073){logger['error']('ShowOpenchannelQueue',_0x4e7073[_0xef6e('0x17')],_0x575e91);_0x533a48(_0x151b99['error'](0x1f4,_0x4e7073[_0xef6e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4432823..f194638 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 _0x0c8b=['save','remove','emit','removeListener','./openchannelQueue.events'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0c8b,0x17b));var _0xb0c8=function(_0x4744b1,_0x1f53ed){_0x4744b1=_0x4744b1-0x0;var _0xa1e07=_0x0c8b[_0x4744b1];return _0xa1e07;};'use strict';var OpenchannelQueueEvents=require(_0xb0c8('0x0'));var events=[_0xb0c8('0x1'),_0xb0c8('0x2'),'update'];function createListener(_0x1c7d93,_0x355620){return function(_0x256415){_0x355620[_0xb0c8('0x3')](_0x1c7d93,_0x256415);};}function removeListener(_0x31edba,_0x398b0d){return function(){OpenchannelQueueEvents[_0xb0c8('0x4')](_0x31edba,_0x398b0d);};}exports['register']=function(_0x4226cf){for(var _0x4b9c43=0x0,_0x1eee38=events['length'];_0x4b9c43<_0x1eee38;_0x4b9c43++){var _0x26314e=events[_0x4b9c43];var _0x45bbc4=createListener('openchannelQueue:'+_0x26314e,_0x4226cf);OpenchannelQueueEvents['on'](_0x26314e,_0x45bbc4);}}; \ No newline at end of file +var _0xd7ed=['emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xd7ed,0x101));var _0xdd7e=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xd7ed[_0x31a371];return _0x2a5bd6;};'use strict';var OpenchannelQueueEvents=require(_0xdd7e('0x0'));var events=[_0xdd7e('0x1'),_0xdd7e('0x2'),_0xdd7e('0x3')];function createListener(_0x446884,_0x16d9aa){return function(_0x197385){_0x16d9aa[_0xdd7e('0x4')](_0x446884,_0x197385);};}function removeListener(_0x249bba,_0x324610){return function(){OpenchannelQueueEvents[_0xdd7e('0x5')](_0x249bba,_0x324610);};}exports[_0xdd7e('0x6')]=function(_0x4841ca){for(var _0x3591e9=0x0,_0x527846=events[_0xdd7e('0x7')];_0x3591e9<_0x527846;_0x3591e9++){var _0x3b2351=events[_0x3591e9];var _0x3814a8=createListener(_0xdd7e('0x8')+_0x3b2351,_0x4841ca);OpenchannelQueueEvents['on'](_0x3b2351,_0x3814a8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 4f2a5bc..9f5fcb3 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 _0xaf61=['./openchannelQueueReport.controller','isAuthenticated','index','/describe','/:id','show','create','put','update','multer','path','connect-timeout','Router','../../config/environment'];(function(_0x4d2157,_0x201cf1){var _0x172f80=function(_0x587167){while(--_0x587167){_0x4d2157['push'](_0x4d2157['shift']());}};_0x172f80(++_0x201cf1);}(_0xaf61,0x191));var _0x1af6=function(_0x2daca9,_0x22819e){_0x2daca9=_0x2daca9-0x0;var _0x1b1a1f=_0xaf61[_0x2daca9];return _0x1b1a1f;};'use strict';var multer=require(_0x1af6('0x0'));var util=require('util');var path=require(_0x1af6('0x1'));var timeout=require(_0x1af6('0x2'));var express=require('express');var router=express[_0x1af6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1af6('0x4'));var controller=require(_0x1af6('0x5'));router['get']('/',auth[_0x1af6('0x6')](),controller[_0x1af6('0x7')]);router['get'](_0x1af6('0x8'),auth[_0x1af6('0x6')](),controller['describe']);router['get'](_0x1af6('0x9'),auth[_0x1af6('0x6')](),controller[_0x1af6('0xa')]);router['post']('/',auth[_0x1af6('0x6')](),controller[_0x1af6('0xb')]);router[_0x1af6('0xc')](_0x1af6('0x9'),auth[_0x1af6('0x6')](),controller[_0x1af6('0xd')]);router['delete'](_0x1af6('0x9'),auth[_0x1af6('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3f53=['create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x500708,_0x2aeb20){var _0x4635ae=function(_0x1cbf4d){while(--_0x1cbf4d){_0x500708['push'](_0x500708['shift']());}};_0x4635ae(++_0x2aeb20);}(_0x3f53,0xcc));var _0x33f5=function(_0x9d7a86,_0x29528c){_0x9d7a86=_0x9d7a86-0x0;var _0x33ccb8=_0x3f53[_0x9d7a86];return _0x33ccb8;};'use strict';var multer=require(_0x33f5('0x0'));var util=require(_0x33f5('0x1'));var path=require(_0x33f5('0x2'));var timeout=require(_0x33f5('0x3'));var express=require(_0x33f5('0x4'));var router=express[_0x33f5('0x5')]();var fs_extra=require(_0x33f5('0x6'));var auth=require(_0x33f5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x33f5('0x8'));var controller=require(_0x33f5('0x9'));router[_0x33f5('0xa')]('/',auth[_0x33f5('0xb')](),controller[_0x33f5('0xc')]);router[_0x33f5('0xa')]('/describe',auth[_0x33f5('0xb')](),controller[_0x33f5('0xd')]);router['get']('/:id',auth[_0x33f5('0xb')](),controller[_0x33f5('0xe')]);router[_0x33f5('0xf')]('/',auth[_0x33f5('0xb')](),controller[_0x33f5('0x10')]);router[_0x33f5('0x11')](_0x33f5('0x12'),auth[_0x33f5('0xb')](),controller['update']);router[_0x33f5('0x13')](_0x33f5('0x12'),auth['isAuthenticated'](),controller[_0x33f5('0x14')]);module[_0x33f5('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 dd5e886..0350dc5 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 _0x28cf=['moment','sequelize','exports','STRING','DATE'];(function(_0xbaa0c3,_0x475ac1){var _0x5c3a05=function(_0xbb3aa1){while(--_0xbb3aa1){_0xbaa0c3['push'](_0xbaa0c3['shift']());}};_0x5c3a05(++_0x475ac1);}(_0x28cf,0x113));var _0xf28c=function(_0x5ecc4d,_0x192051){_0x5ecc4d=_0x5ecc4d-0x0;var _0x5412f3=_0x28cf[_0x5ecc4d];return _0x5412f3;};'use strict';var moment=require(_0xf28c('0x0'));var Sequelize=require(_0xf28c('0x1'));module[_0xf28c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf28c('0x3')]},'joinAt':{'type':Sequelize[_0xf28c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf28c('0x4')]},'reason':{'type':Sequelize[_0xf28c('0x3')]}}; \ No newline at end of file +var _0x0666=['exports','STRING','DATE','moment','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0666,0x1ca));var _0x6066=function(_0xf64500,_0x410815){_0xf64500=_0xf64500-0x0;var _0x58a6e0=_0x0666[_0xf64500];return _0x58a6e0;};'use strict';var moment=require(_0x6066('0x0'));var Sequelize=require(_0x6066('0x1'));module[_0x6066('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6066('0x3')]},'joinAt':{'type':Sequelize[_0x6066('0x4')]},'leaveAt':{'type':Sequelize[_0x6066('0x4')]},'acceptAt':{'type':Sequelize[_0x6066('0x4')]},'exitAt':{'type':Sequelize[_0x6066('0x4')]},'reason':{'type':Sequelize[_0x6066('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 86ae13c..e8fffe2 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 _0x11a8=['send','OpenchannelQueueReport','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','findAll','rows','catch','show','params','keys','length','includeAll','include','options','find','create','body','destroy','describe','eml-format','rimraf','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','stack','name'];(function(_0x5af81e,_0x3a0d0b){var _0x198f7c=function(_0x39269c){while(--_0x39269c){_0x5af81e['push'](_0x5af81e['shift']());}};_0x198f7c(++_0x3a0d0b);}(_0x11a8,0x18f));var _0x811a=function(_0x31c71c,_0x463e90){_0x31c71c=_0x31c71c-0x0;var _0xbfe6d5=_0x11a8[_0x31c71c];return _0xbfe6d5;};'use strict';var emlformat=require(_0x811a('0x0'));var rimraf=require(_0x811a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x811a('0x2'));var BPromise=require(_0x811a('0x3'));var Mustache=require('mustache');var util=require(_0x811a('0x4'));var path=require('path');var sox=require(_0x811a('0x5'));var csv=require(_0x811a('0x6'));var ejs=require(_0x811a('0x7'));var fs=require('fs');var fs_extra=require(_0x811a('0x8'));var _=require(_0x811a('0x9'));var squel=require(_0x811a('0xa'));var crypto=require(_0x811a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x811a('0xc'));var toCsv=require(_0x811a('0x6'));var querystring=require('querystring');var Papa=require(_0x811a('0xd'));var Redis=require(_0x811a('0xe'));var authService=require(_0x811a('0xf'));var qs=require(_0x811a('0x10'));var as=require(_0x811a('0x11'));var hardwareService=require(_0x811a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x811a('0x13'));var config=require(_0x811a('0x14'));var licenseUtil=require(_0x811a('0x15'));var db=require(_0x811a('0x16'))['db'];function respondWithStatusCode(_0x1308c8,_0x2d7e66){_0x2d7e66=_0x2d7e66||0xcc;return function(_0x5e912b){if(_0x5e912b){return _0x1308c8[_0x811a('0x17')](_0x2d7e66);}return _0x1308c8[_0x811a('0x18')](_0x2d7e66)[_0x811a('0x19')]();};}function respondWithResult(_0x90d53d,_0x42cc7c){_0x42cc7c=_0x42cc7c||0xc8;return function(_0x4a4557){if(_0x4a4557){return _0x90d53d[_0x811a('0x18')](_0x42cc7c)[_0x811a('0x1a')](_0x4a4557);}};}function respondWithFilteredResult(_0x591e88,_0x1226e7){return function(_0x342ccf){if(_0x342ccf){var _0x1db930=typeof _0x1226e7['offset']===_0x811a('0x1b')&&typeof _0x1226e7[_0x811a('0x1c')]==='undefined';var _0x3647fd=_0x342ccf[_0x811a('0x1d')];var _0x18ab32=_0x1db930?0x0:_0x1226e7[_0x811a('0x1e')];var _0x5a9410=_0x1db930?_0x342ccf[_0x811a('0x1d')]:_0x1226e7[_0x811a('0x1e')]+_0x1226e7[_0x811a('0x1c')];var _0x5c5b19;if(_0x5a9410>=_0x3647fd){_0x5a9410=_0x3647fd;_0x5c5b19=0xc8;}else{_0x5c5b19=0xce;}_0x591e88[_0x811a('0x18')](_0x5c5b19);return _0x591e88[_0x811a('0x1f')](_0x811a('0x20'),_0x18ab32+'-'+_0x5a9410+'/'+_0x3647fd)[_0x811a('0x1a')](_0x342ccf);}return null;};}function patchUpdates(_0x226717){return function(_0x351d45){try{jsonpatch[_0x811a('0x21')](_0x351d45,_0x226717,!![]);}catch(_0x260140){return BPromise[_0x811a('0x22')](_0x260140);}return _0x351d45['save']();};}function saveUpdates(_0x5e55da,_0x4543e9){return function(_0x19667d){if(_0x19667d){return _0x19667d[_0x811a('0x23')](_0x5e55da)[_0x811a('0x24')](function(_0x462578){return _0x462578;});}return null;};}function removeEntity(_0x8bd099,_0x8349d6){return function(_0x3b1796){if(_0x3b1796){return _0x3b1796['destroy']()[_0x811a('0x24')](function(){_0x8bd099['status'](0xcc)[_0x811a('0x19')]();});}};}function handleEntityNotFound(_0x6d917,_0x589f18){return function(_0xb4dc6b){if(!_0xb4dc6b){_0x6d917['sendStatus'](0x194);}return _0xb4dc6b;};}function handleError(_0xcd60fb,_0x336f68){_0x336f68=_0x336f68||0x1f4;return function(_0x2cc64b){logger['error'](_0x2cc64b[_0x811a('0x25')]);if(_0x2cc64b[_0x811a('0x26')]){delete _0x2cc64b[_0x811a('0x26')];}_0xcd60fb['status'](_0x336f68)[_0x811a('0x27')](_0x2cc64b);};}exports['index']=function(_0x5bb742,_0x37ae39){var _0x4f599b={},_0x3995c7={},_0x455754={'count':0x0,'rows':[]};var _0x5d95f8=_['map'](db[_0x811a('0x28')][_0x811a('0x29')],function(_0x313589){return{'name':_0x313589['fieldName'],'type':_0x313589['type'][_0x811a('0x2a')]};});_0x3995c7[_0x811a('0x2b')]=_[_0x811a('0x2c')](_0x5d95f8,_0x811a('0x26'));_0x3995c7[_0x811a('0x2d')]=_['keys'](_0x5bb742['query']);_0x3995c7[_0x811a('0x2e')]=_[_0x811a('0x2f')](_0x3995c7[_0x811a('0x2b')],_0x3995c7[_0x811a('0x2d')]);_0x4f599b[_0x811a('0x30')]=_[_0x811a('0x2f')](_0x3995c7[_0x811a('0x2b')],qs[_0x811a('0x31')](_0x5bb742[_0x811a('0x2d')][_0x811a('0x31')]));_0x4f599b[_0x811a('0x30')]=_0x4f599b[_0x811a('0x30')]['length']?_0x4f599b[_0x811a('0x30')]:_0x3995c7[_0x811a('0x2b')];if(!_0x5bb742[_0x811a('0x2d')]['hasOwnProperty'](_0x811a('0x32'))){_0x4f599b['limit']=qs[_0x811a('0x1c')](_0x5bb742[_0x811a('0x2d')][_0x811a('0x1c')]);_0x4f599b[_0x811a('0x1e')]=qs[_0x811a('0x1e')](_0x5bb742[_0x811a('0x2d')]['offset']);}_0x4f599b[_0x811a('0x33')]=qs[_0x811a('0x34')](_0x5bb742[_0x811a('0x2d')][_0x811a('0x34')]);_0x4f599b['where']=qs[_0x811a('0x2e')](_[_0x811a('0x35')](_0x5bb742[_0x811a('0x2d')],_0x3995c7[_0x811a('0x2e')]),_0x5d95f8);if(_0x5bb742[_0x811a('0x2d')][_0x811a('0x36')]){_0x4f599b[_0x811a('0x37')]=_[_0x811a('0x38')](_0x4f599b['where'],{'$or':_[_0x811a('0x2c')](_0x5d95f8,function(_0x567517){if(_0x567517[_0x811a('0x39')]!=='VIRTUAL'){var _0x54b4fb={};_0x54b4fb[_0x567517[_0x811a('0x26')]]={'$like':'%'+_0x5bb742[_0x811a('0x2d')]['filter']+'%'};return _0x54b4fb;}})});}_0x4f599b=_['merge']({},_0x4f599b,_0x5bb742['options']);var _0x36dfe6={'where':_0x4f599b[_0x811a('0x37')]};return db['OpenchannelQueueReport'][_0x811a('0x1d')](_0x36dfe6)[_0x811a('0x24')](function(_0x1045ae){_0x455754[_0x811a('0x1d')]=_0x1045ae;if(_0x5bb742[_0x811a('0x2d')]['includeAll']){_0x4f599b['include']=[{'all':!![]}];}return db[_0x811a('0x28')][_0x811a('0x3a')](_0x4f599b);})[_0x811a('0x24')](function(_0x579b5){_0x455754[_0x811a('0x3b')]=_0x579b5;return _0x455754;})['then'](respondWithFilteredResult(_0x37ae39,_0x4f599b))[_0x811a('0x3c')](handleError(_0x37ae39,null));};exports[_0x811a('0x3d')]=function(_0x415daf,_0x405233){var _0x2d6373={'raw':!![],'where':{'id':_0x415daf[_0x811a('0x3e')]['id']}},_0x25603e={};_0x25603e[_0x811a('0x2b')]=_[_0x811a('0x3f')](db[_0x811a('0x28')][_0x811a('0x29')]);_0x25603e[_0x811a('0x2d')]=_[_0x811a('0x3f')](_0x415daf[_0x811a('0x2d')]);_0x25603e[_0x811a('0x2e')]=_[_0x811a('0x2f')](_0x25603e[_0x811a('0x2b')],_0x25603e[_0x811a('0x2d')]);_0x2d6373[_0x811a('0x30')]=_[_0x811a('0x2f')](_0x25603e[_0x811a('0x2b')],qs[_0x811a('0x31')](_0x415daf[_0x811a('0x2d')]['fields']));_0x2d6373[_0x811a('0x30')]=_0x2d6373[_0x811a('0x30')][_0x811a('0x40')]?_0x2d6373[_0x811a('0x30')]:_0x25603e['model'];if(_0x415daf[_0x811a('0x2d')][_0x811a('0x41')]){_0x2d6373[_0x811a('0x42')]=[{'all':!![]}];}_0x2d6373=_['merge']({},_0x2d6373,_0x415daf[_0x811a('0x43')]);return db[_0x811a('0x28')][_0x811a('0x44')](_0x2d6373)[_0x811a('0x24')](handleEntityNotFound(_0x405233,null))[_0x811a('0x24')](respondWithResult(_0x405233,null))['catch'](handleError(_0x405233,null));};exports[_0x811a('0x45')]=function(_0x3f53ae,_0x26561c){return db[_0x811a('0x28')][_0x811a('0x45')](_0x3f53ae[_0x811a('0x46')],{})[_0x811a('0x24')](respondWithResult(_0x26561c,0xc9))[_0x811a('0x3c')](handleError(_0x26561c,null));};exports['update']=function(_0x117cd5,_0x401492){if(_0x117cd5[_0x811a('0x46')]['id']){delete _0x117cd5['body']['id'];}return db[_0x811a('0x28')]['find']({'where':{'id':_0x117cd5[_0x811a('0x3e')]['id']}})[_0x811a('0x24')](handleEntityNotFound(_0x401492,null))[_0x811a('0x24')](saveUpdates(_0x117cd5[_0x811a('0x46')],null))[_0x811a('0x24')](respondWithResult(_0x401492,null))[_0x811a('0x3c')](handleError(_0x401492,null));};exports[_0x811a('0x47')]=function(_0x20fe48,_0x52a8ef){return db[_0x811a('0x28')][_0x811a('0x44')]({'where':{'id':_0x20fe48[_0x811a('0x3e')]['id']}})[_0x811a('0x24')](handleEntityNotFound(_0x52a8ef,null))['then'](removeEntity(_0x52a8ef,null))[_0x811a('0x3c')](handleError(_0x52a8ef,null));};exports[_0x811a('0x48')]=function(_0x5974ba,_0x381f4f){return db[_0x811a('0x28')]['describe']()[_0x811a('0x24')](respondWithResult(_0x381f4f,null))[_0x811a('0x3c')](handleError(_0x381f4f,null));}; \ No newline at end of file +var _0x3aa0=['stack','name','send','index','map','OpenchannelQueueReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','params','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','end','error'];(function(_0x2fc526,_0x257a9c){var _0x5cae3b=function(_0x2148f3){while(--_0x2148f3){_0x2fc526['push'](_0x2fc526['shift']());}};_0x5cae3b(++_0x257a9c);}(_0x3aa0,0x72));var _0x03aa=function(_0x194453,_0x163000){_0x194453=_0x194453-0x0;var _0x4903a0=_0x3aa0[_0x194453];return _0x4903a0;};'use strict';var emlformat=require(_0x03aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03aa('0x1'));var jsonpatch=require(_0x03aa('0x2'));var rp=require(_0x03aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x03aa('0x4'));var util=require('util');var path=require('path');var sox=require(_0x03aa('0x5'));var csv=require(_0x03aa('0x6'));var ejs=require(_0x03aa('0x7'));var fs=require('fs');var fs_extra=require(_0x03aa('0x8'));var _=require(_0x03aa('0x9'));var squel=require(_0x03aa('0xa'));var crypto=require('crypto');var jsforce=require(_0x03aa('0xb'));var deskjs=require(_0x03aa('0xc'));var toCsv=require(_0x03aa('0x6'));var querystring=require(_0x03aa('0xd'));var Papa=require(_0x03aa('0xe'));var Redis=require(_0x03aa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03aa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03aa('0x11'));var logger=require(_0x03aa('0x12'))('api');var utils=require(_0x03aa('0x13'));var config=require(_0x03aa('0x14'));var licenseUtil=require(_0x03aa('0x15'));var db=require(_0x03aa('0x16'))['db'];function respondWithStatusCode(_0x41c752,_0x3bdde8){_0x3bdde8=_0x3bdde8||0xcc;return function(_0x4c91da){if(_0x4c91da){return _0x41c752[_0x03aa('0x17')](_0x3bdde8);}return _0x41c752[_0x03aa('0x18')](_0x3bdde8)['end']();};}function respondWithResult(_0x3d9d37,_0x1381e4){_0x1381e4=_0x1381e4||0xc8;return function(_0x37e12a){if(_0x37e12a){return _0x3d9d37[_0x03aa('0x18')](_0x1381e4)['json'](_0x37e12a);}};}function respondWithFilteredResult(_0x4c234d,_0x4c6cba){return function(_0x257d3f){if(_0x257d3f){var _0x598575=typeof _0x4c6cba[_0x03aa('0x19')]===_0x03aa('0x1a')&&typeof _0x4c6cba[_0x03aa('0x1b')]===_0x03aa('0x1a');var _0x236990=_0x257d3f['count'];var _0x1b111f=_0x598575?0x0:_0x4c6cba[_0x03aa('0x19')];var _0x57854a=_0x598575?_0x257d3f['count']:_0x4c6cba[_0x03aa('0x19')]+_0x4c6cba['limit'];var _0x455f48;if(_0x57854a>=_0x236990){_0x57854a=_0x236990;_0x455f48=0xc8;}else{_0x455f48=0xce;}_0x4c234d[_0x03aa('0x18')](_0x455f48);return _0x4c234d['set'](_0x03aa('0x1c'),_0x1b111f+'-'+_0x57854a+'/'+_0x236990)[_0x03aa('0x1d')](_0x257d3f);}return null;};}function patchUpdates(_0x331163){return function(_0x4e91da){try{jsonpatch[_0x03aa('0x1e')](_0x4e91da,_0x331163,!![]);}catch(_0x32c501){return BPromise[_0x03aa('0x1f')](_0x32c501);}return _0x4e91da[_0x03aa('0x20')]();};}function saveUpdates(_0x4284d6,_0x1ed6b1){return function(_0x317ea4){if(_0x317ea4){return _0x317ea4[_0x03aa('0x21')](_0x4284d6)[_0x03aa('0x22')](function(_0x4700b5){return _0x4700b5;});}return null;};}function removeEntity(_0x5e9a00,_0x1636e9){return function(_0x1efc3c){if(_0x1efc3c){return _0x1efc3c[_0x03aa('0x23')]()[_0x03aa('0x22')](function(){_0x5e9a00[_0x03aa('0x18')](0xcc)[_0x03aa('0x24')]();});}};}function handleEntityNotFound(_0x55d34b,_0x7fba17){return function(_0x481f22){if(!_0x481f22){_0x55d34b[_0x03aa('0x17')](0x194);}return _0x481f22;};}function handleError(_0x240c55,_0x5d45d1){_0x5d45d1=_0x5d45d1||0x1f4;return function(_0x4e93a4){logger[_0x03aa('0x25')](_0x4e93a4[_0x03aa('0x26')]);if(_0x4e93a4[_0x03aa('0x27')]){delete _0x4e93a4[_0x03aa('0x27')];}_0x240c55[_0x03aa('0x18')](_0x5d45d1)[_0x03aa('0x28')](_0x4e93a4);};}exports[_0x03aa('0x29')]=function(_0x4d8687,_0x26f3b9){var _0x549345={},_0x1475f5={},_0x47c1ef={'count':0x0,'rows':[]};var _0x2f544a=_[_0x03aa('0x2a')](db[_0x03aa('0x2b')]['rawAttributes'],function(_0x391523){return{'name':_0x391523[_0x03aa('0x2c')],'type':_0x391523['type'][_0x03aa('0x2d')]};});_0x1475f5[_0x03aa('0x2e')]=_['map'](_0x2f544a,_0x03aa('0x27'));_0x1475f5[_0x03aa('0x2f')]=_[_0x03aa('0x30')](_0x4d8687[_0x03aa('0x2f')]);_0x1475f5['filters']=_[_0x03aa('0x31')](_0x1475f5[_0x03aa('0x2e')],_0x1475f5[_0x03aa('0x2f')]);_0x549345[_0x03aa('0x32')]=_[_0x03aa('0x31')](_0x1475f5[_0x03aa('0x2e')],qs[_0x03aa('0x33')](_0x4d8687['query'][_0x03aa('0x33')]));_0x549345['attributes']=_0x549345[_0x03aa('0x32')][_0x03aa('0x34')]?_0x549345[_0x03aa('0x32')]:_0x1475f5[_0x03aa('0x2e')];if(!_0x4d8687[_0x03aa('0x2f')][_0x03aa('0x35')](_0x03aa('0x36'))){_0x549345[_0x03aa('0x1b')]=qs[_0x03aa('0x1b')](_0x4d8687['query']['limit']);_0x549345['offset']=qs[_0x03aa('0x19')](_0x4d8687['query'][_0x03aa('0x19')]);}_0x549345['order']=qs[_0x03aa('0x37')](_0x4d8687[_0x03aa('0x2f')]['sort']);_0x549345[_0x03aa('0x38')]=qs[_0x03aa('0x39')](_[_0x03aa('0x3a')](_0x4d8687[_0x03aa('0x2f')],_0x1475f5[_0x03aa('0x39')]),_0x2f544a);if(_0x4d8687[_0x03aa('0x2f')][_0x03aa('0x3b')]){_0x549345['where']=_[_0x03aa('0x3c')](_0x549345['where'],{'$or':_[_0x03aa('0x2a')](_0x2f544a,function(_0x548fa0){if(_0x548fa0[_0x03aa('0x3d')]!==_0x03aa('0x3e')){var _0x986b20={};_0x986b20[_0x548fa0[_0x03aa('0x27')]]={'$like':'%'+_0x4d8687[_0x03aa('0x2f')]['filter']+'%'};return _0x986b20;}})});}_0x549345=_[_0x03aa('0x3c')]({},_0x549345,_0x4d8687[_0x03aa('0x3f')]);var _0x55c7d6={'where':_0x549345[_0x03aa('0x38')]};return db[_0x03aa('0x2b')][_0x03aa('0x40')](_0x55c7d6)[_0x03aa('0x22')](function(_0x1f7c36){_0x47c1ef[_0x03aa('0x40')]=_0x1f7c36;if(_0x4d8687[_0x03aa('0x2f')]['includeAll']){_0x549345[_0x03aa('0x41')]=[{'all':!![]}];}return db[_0x03aa('0x2b')][_0x03aa('0x42')](_0x549345);})[_0x03aa('0x22')](function(_0x33f50f){_0x47c1ef[_0x03aa('0x43')]=_0x33f50f;return _0x47c1ef;})[_0x03aa('0x22')](respondWithFilteredResult(_0x26f3b9,_0x549345))['catch'](handleError(_0x26f3b9,null));};exports['show']=function(_0x33f062,_0x388021){var _0x978623={'raw':!![],'where':{'id':_0x33f062[_0x03aa('0x44')]['id']}},_0x1bcf55={};_0x1bcf55[_0x03aa('0x2e')]=_[_0x03aa('0x30')](db[_0x03aa('0x2b')][_0x03aa('0x45')]);_0x1bcf55[_0x03aa('0x2f')]=_['keys'](_0x33f062[_0x03aa('0x2f')]);_0x1bcf55['filters']=_[_0x03aa('0x31')](_0x1bcf55['model'],_0x1bcf55[_0x03aa('0x2f')]);_0x978623[_0x03aa('0x32')]=_[_0x03aa('0x31')](_0x1bcf55['model'],qs[_0x03aa('0x33')](_0x33f062[_0x03aa('0x2f')]['fields']));_0x978623['attributes']=_0x978623['attributes'][_0x03aa('0x34')]?_0x978623[_0x03aa('0x32')]:_0x1bcf55[_0x03aa('0x2e')];if(_0x33f062[_0x03aa('0x2f')][_0x03aa('0x46')]){_0x978623[_0x03aa('0x41')]=[{'all':!![]}];}_0x978623=_[_0x03aa('0x3c')]({},_0x978623,_0x33f062[_0x03aa('0x3f')]);return db[_0x03aa('0x2b')][_0x03aa('0x47')](_0x978623)[_0x03aa('0x22')](handleEntityNotFound(_0x388021,null))[_0x03aa('0x22')](respondWithResult(_0x388021,null))[_0x03aa('0x48')](handleError(_0x388021,null));};exports['create']=function(_0x455337,_0x9debd7){return db['OpenchannelQueueReport'][_0x03aa('0x49')](_0x455337['body'],{})['then'](respondWithResult(_0x9debd7,0xc9))[_0x03aa('0x48')](handleError(_0x9debd7,null));};exports['update']=function(_0x4a8e7f,_0x50658a){if(_0x4a8e7f[_0x03aa('0x4a')]['id']){delete _0x4a8e7f[_0x03aa('0x4a')]['id'];}return db[_0x03aa('0x2b')]['find']({'where':{'id':_0x4a8e7f['params']['id']}})['then'](handleEntityNotFound(_0x50658a,null))[_0x03aa('0x22')](saveUpdates(_0x4a8e7f[_0x03aa('0x4a')],null))[_0x03aa('0x22')](respondWithResult(_0x50658a,null))[_0x03aa('0x48')](handleError(_0x50658a,null));};exports[_0x03aa('0x23')]=function(_0x517ca1,_0x313e0a){return db[_0x03aa('0x2b')][_0x03aa('0x47')]({'where':{'id':_0x517ca1[_0x03aa('0x44')]['id']}})['then'](handleEntityNotFound(_0x313e0a,null))[_0x03aa('0x22')](removeEntity(_0x313e0a,null))['catch'](handleError(_0x313e0a,null));};exports[_0x03aa('0x4b')]=function(_0x1adaed,_0x3029c6){return db[_0x03aa('0x2b')][_0x03aa('0x4b')]()['then'](respondWithResult(_0x3029c6,null))[_0x03aa('0x48')](handleError(_0x3029c6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 12c9104..1a3b60c 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x13421a,_0x45211){var _0x280fad=function(_0x29808e){while(--_0x29808e){_0x13421a['push'](_0x13421a['shift']());}};_0x280fad(++_0x45211);}(_0x1261,0x144));var _0x1126=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x1261[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x4be13d,_0x58dd32){var _0x4d4279=function(_0x592aa5){while(--_0x592aa5){_0x4be13d['push'](_0x4be13d['shift']());}};_0x4d4279(++_0x58dd32);}(_0xe14b,0x93));var _0xbe14=function(_0x560a9c,_0x454970){_0x560a9c=_0x560a9c-0x0;var _0x47b4d2=_0xe14b[_0x560a9c];return _0x47b4d2;};'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 b9e1c06..81832d6 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 _0xaebd=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelQueueReport,\x20%s,\x20%s','catch','CreateOpenchannelQueueReport','create','options','raw','debug','OpenchannelQueueReport','update','body','limit','UpdateOpenchannelQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x39c4c9,_0x520f1f){var _0x2f846a=function(_0x31da04){while(--_0x31da04){_0x39c4c9['push'](_0x39c4c9['shift']());}};_0x2f846a(++_0x520f1f);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x3be0ac,_0x2c598d){_0x3be0ac=_0x3be0ac-0x0;var _0x1aed8c=_0xaebd[_0x3be0ac];return _0x1aed8c;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea090,_0x3f7ba1,_0x52c717){return new BPromise(function(_0x550bd9,_0x1b9d37){return client[_0xdaeb('0xb')](_0x3ea090,_0x52c717)[_0xdaeb('0xc')](function(_0x5e0ae9){logger[_0xdaeb('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3f7ba1,_0xdaeb('0xe'));logger['debug'](_0xdaeb('0xf'),_0x3f7ba1,'request\x20sent',JSON[_0xdaeb('0x10')](_0x5e0ae9));if(_0x5e0ae9[_0xdaeb('0x11')]){if(_0x5e0ae9['error']['code']===0x1f4){logger[_0xdaeb('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);return _0x1b9d37(_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);}logger[_0xdaeb('0x11')](_0xdaeb('0x13'),_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')]['message']);return _0x550bd9(_0x5e0ae9['error'][_0xdaeb('0x12')]);}else{logger[_0xdaeb('0xd')](_0xdaeb('0x13'),_0x3f7ba1,_0xdaeb('0xe'));_0x550bd9(_0x5e0ae9['result']['message']);}})[_0xdaeb('0x14')](function(_0x4dd803){logger['error'](_0xdaeb('0x13'),_0x3f7ba1,_0x4dd803);_0x1b9d37(_0x4dd803);});});}exports[_0xdaeb('0x15')]=function(_0x1b5243){var _0x1fe84e=this;return new Promise(function(_0x2d8f11,_0x36f9ac){return db['OpenchannelQueueReport'][_0xdaeb('0x16')](_0x1b5243['body'],{'raw':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4e97e0){logger[_0xdaeb('0xd')](_0xdaeb('0x15'),_0x1b5243);logger[_0xdaeb('0x19')](_0xdaeb('0x15'),_0x1b5243,JSON[_0xdaeb('0x10')](_0x4e97e0));_0x2d8f11(_0x4e97e0);})['catch'](function(_0x597bb7){logger[_0xdaeb('0x11')](_0xdaeb('0x15'),_0x597bb7[_0xdaeb('0x12')],_0x1b5243);_0x36f9ac(_0x1fe84e[_0xdaeb('0x11')](0x1f4,_0x597bb7[_0xdaeb('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x254c3b){var _0x4dc25f=this;return new Promise(function(_0x130c35,_0x398616){return db[_0xdaeb('0x1a')][_0xdaeb('0x1b')](_0x254c3b[_0xdaeb('0x1c')],{'raw':_0x254c3b['options']?_0x254c3b[_0xdaeb('0x17')][_0xdaeb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x254c3b[_0xdaeb('0x17')]?_0x254c3b['options']['where']||null:null,'attributes':_0x254c3b[_0xdaeb('0x17')]?_0x254c3b['options']['attributes']||null:null,'limit':_0x254c3b[_0xdaeb('0x17')]?_0x254c3b[_0xdaeb('0x17')][_0xdaeb('0x1d')]||null:null})['then'](function(_0x5e6f97){logger[_0xdaeb('0xd')](_0xdaeb('0x1e'),_0x254c3b);logger[_0xdaeb('0x19')]('UpdateOpenchannelQueueReport',_0x254c3b,JSON[_0xdaeb('0x10')](_0x5e6f97));_0x130c35(_0x5e6f97);})['catch'](function(_0x4da82d){logger[_0xdaeb('0x11')](_0xdaeb('0x1e'),_0x4da82d[_0xdaeb('0x12')],_0x254c3b);_0x398616(_0x4dc25f[_0xdaeb('0x11')](0x1f4,_0x4da82d[_0xdaeb('0x12')]));});});}; \ No newline at end of file +var _0x1c7c=['raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x2f2601,_0x10b8be){var _0x3c6e6=function(_0x12a171){while(--_0x12a171){_0x2f2601['push'](_0x2f2601['shift']());}};_0x3c6e6(++_0x10b8be);}(_0x1c7c,0x164));var _0xc1c7=function(_0x21b0d5,_0x52eb6f){_0x21b0d5=_0x21b0d5-0x0;var _0x5ad467=_0x1c7c[_0x21b0d5];return _0x5ad467;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')](_0xb42702[_0xc1c7('0x1b')],{'raw':_0xb42702[_0xc1c7('0x1c')]?_0xb42702['options'][_0xc1c7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5e7e4a){logger[_0xc1c7('0xe')]('CreateOpenchannelQueueReport',_0xb42702);logger['debug'](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x5e7e4a));_0x2e93e5(_0x5e7e4a);})[_0xc1c7('0x17')](function(_0x4c6b34){logger[_0xc1c7('0x13')](_0xc1c7('0x18'),_0x4c6b34[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x4c6b34[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x1e')]=function(_0x3180fd){var _0x120168=this;return new Promise(function(_0x22b654,_0x1540c1){return db[_0xc1c7('0x19')][_0xc1c7('0x1f')](_0x3180fd[_0xc1c7('0x1b')],{'raw':_0x3180fd[_0xc1c7('0x1c')]?_0x3180fd[_0xc1c7('0x1c')][_0xc1c7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3180fd['options']?_0x3180fd[_0xc1c7('0x1c')][_0xc1c7('0x20')]||null:null,'attributes':_0x3180fd['options']?_0x3180fd['options'][_0xc1c7('0x21')]||null:null,'limit':_0x3180fd['options']?_0x3180fd['options'][_0xc1c7('0x22')]||null:null})[_0xc1c7('0xd')](function(_0x46d045){logger[_0xc1c7('0xe')](_0xc1c7('0x1e'),_0x3180fd);logger['debug']('UpdateOpenchannelQueueReport',_0x3180fd,JSON[_0xc1c7('0x12')](_0x46d045));_0x22b654(_0x46d045);})[_0xc1c7('0x17')](function(_0x9a0ab3){logger[_0xc1c7('0x13')](_0xc1c7('0x1e'),_0x9a0ab3['message'],_0x3180fd);_0x1540c1(_0x120168['error'](0x1f4,_0x9a0ab3[_0xc1c7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 58e103b..454ebe1 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 _0xb6a6=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','post','create','put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3f59f5,_0x395302){var _0x4a2343=function(_0x44a6f7){while(--_0x44a6f7){_0x3f59f5['push'](_0x3f59f5['shift']());}};_0x4a2343(++_0x395302);}(_0xb6a6,0x1db));var _0x6b6a=function(_0x5710fd,_0x232ba9){_0x5710fd=_0x5710fd-0x0;var _0x8355f=_0xb6a6[_0x5710fd];return _0x8355f;};'use strict';var multer=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var path=require(_0x6b6a('0x2'));var timeout=require(_0x6b6a('0x3'));var express=require(_0x6b6a('0x4'));var router=express[_0x6b6a('0x5')]();var fs_extra=require(_0x6b6a('0x6'));var auth=require(_0x6b6a('0x7'));var interaction=require(_0x6b6a('0x8'));var config=require(_0x6b6a('0x9'));var controller=require(_0x6b6a('0xa'));router[_0x6b6a('0xb')]('/',auth[_0x6b6a('0xc')](),controller[_0x6b6a('0xd')]);router[_0x6b6a('0xb')](_0x6b6a('0xe'),auth[_0x6b6a('0xc')](),controller['describe']);router['get']('/:id',auth[_0x6b6a('0xc')](),controller['show']);router[_0x6b6a('0xf')]('/',auth[_0x6b6a('0xc')](),controller[_0x6b6a('0x10')]);router[_0x6b6a('0x11')]('/:id',auth[_0x6b6a('0xc')](),controller['update']);router[_0x6b6a('0x12')](_0x6b6a('0x13'),auth['isAuthenticated'](),controller[_0x6b6a('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbbcf=['./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1c5e4a,_0x1ecf5f){var _0x3b336c=function(_0x32c696){while(--_0x32c696){_0x1c5e4a['push'](_0x1c5e4a['shift']());}};_0x3b336c(++_0x1ecf5f);}(_0xbbcf,0x71));var _0xfbbc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xbbcf[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0xfbbc('0x0'));var path=require(_0xfbbc('0x1'));var timeout=require(_0xfbbc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfbbc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfbbc('0x4'));var config=require(_0xfbbc('0x5'));var controller=require(_0xfbbc('0x6'));router[_0xfbbc('0x7')]('/',auth['isAuthenticated'](),controller[_0xfbbc('0x8')]);router[_0xfbbc('0x7')](_0xfbbc('0x9'),auth[_0xfbbc('0xa')](),controller['describe']);router[_0xfbbc('0x7')]('/:id',auth[_0xfbbc('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfbbc('0xb')]('/:id',auth[_0xfbbc('0xa')](),controller[_0xfbbc('0xc')]);router[_0xfbbc('0xd')](_0xfbbc('0xe'),auth[_0xfbbc('0xa')](),controller[_0xfbbc('0xf')]);module[_0xfbbc('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 73d6406..0bb1bcd 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xd50b7f,_0x53c16c){var _0x380972=function(_0x4865d8){while(--_0x4865d8){_0xd50b7f['push'](_0xd50b7f['shift']());}};_0x380972(++_0x53c16c);}(_0x008c,0x188));var _0xc008=function(_0x3235a7,_0x24cb3b){_0x3235a7=_0x3235a7-0x0;var _0x56d0b5=_0x008c[_0x3235a7];return _0x56d0b5;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xb833f6,_0x472175){var _0x3e98a5=function(_0x735659){while(--_0x735659){_0xb833f6['push'](_0xb833f6['shift']());}};_0x3e98a5(++_0x472175);}(_0x70e0,0x17b));var _0x070e=function(_0x49de10,_0x891ecd){_0x49de10=_0x49de10-0x0;var _0x55f9f5=_0x70e0[_0x49de10];return _0x55f9f5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index b8ac3d7..becef2e 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 _0xf9f5=['save','error','name','send','map','OpenchannelTransferReport','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','count','set','json','apply','reject'];(function(_0x3790b4,_0x3752e4){var _0x3b5084=function(_0x46873a){while(--_0x46873a){_0x3790b4['push'](_0x3790b4['shift']());}};_0x3b5084(++_0x3752e4);}(_0xf9f5,0x173));var _0x5f9f=function(_0x34e192,_0x36bff6){_0x34e192=_0x34e192-0x0;var _0x4f52e4=_0xf9f5[_0x34e192];return _0x4f52e4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f9f('0x0'));var jsonpatch=require(_0x5f9f('0x1'));var rp=require(_0x5f9f('0x2'));var moment=require(_0x5f9f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5f9f('0x4'));var util=require(_0x5f9f('0x5'));var path=require(_0x5f9f('0x6'));var sox=require(_0x5f9f('0x7'));var csv=require(_0x5f9f('0x8'));var ejs=require(_0x5f9f('0x9'));var fs=require('fs');var fs_extra=require(_0x5f9f('0xa'));var _=require('lodash');var squel=require(_0x5f9f('0xb'));var crypto=require(_0x5f9f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f9f('0x8'));var querystring=require(_0x5f9f('0xd'));var Papa=require(_0x5f9f('0xe'));var Redis=require(_0x5f9f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f9f('0x10'));var hardwareService=require(_0x5f9f('0x11'));var logger=require(_0x5f9f('0x12'))('api');var utils=require(_0x5f9f('0x13'));var config=require(_0x5f9f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9f('0x15'))['db'];function respondWithStatusCode(_0x3125bb,_0x5e7cb7){_0x5e7cb7=_0x5e7cb7||0xcc;return function(_0x264b28){if(_0x264b28){return _0x3125bb['sendStatus'](_0x5e7cb7);}return _0x3125bb[_0x5f9f('0x16')](_0x5e7cb7)[_0x5f9f('0x17')]();};}function respondWithResult(_0x3662eb,_0x17878a){_0x17878a=_0x17878a||0xc8;return function(_0x25b577){if(_0x25b577){return _0x3662eb[_0x5f9f('0x16')](_0x17878a)['json'](_0x25b577);}};}function respondWithFilteredResult(_0x29e134,_0x1dbe9d){return function(_0x371372){if(_0x371372){var _0x170259=typeof _0x1dbe9d[_0x5f9f('0x18')]==='undefined'&&typeof _0x1dbe9d[_0x5f9f('0x19')]==='undefined';var _0x375301=_0x371372[_0x5f9f('0x1a')];var _0x429f19=_0x170259?0x0:_0x1dbe9d['offset'];var _0x564013=_0x170259?_0x371372[_0x5f9f('0x1a')]:_0x1dbe9d[_0x5f9f('0x18')]+_0x1dbe9d[_0x5f9f('0x19')];var _0x4dad03;if(_0x564013>=_0x375301){_0x564013=_0x375301;_0x4dad03=0xc8;}else{_0x4dad03=0xce;}_0x29e134['status'](_0x4dad03);return _0x29e134[_0x5f9f('0x1b')]('Content-Range',_0x429f19+'-'+_0x564013+'/'+_0x375301)[_0x5f9f('0x1c')](_0x371372);}return null;};}function patchUpdates(_0x534011){return function(_0x44e9b6){try{jsonpatch[_0x5f9f('0x1d')](_0x44e9b6,_0x534011,!![]);}catch(_0x338f63){return BPromise[_0x5f9f('0x1e')](_0x338f63);}return _0x44e9b6[_0x5f9f('0x1f')]();};}function saveUpdates(_0x348782,_0x47d5ce){return function(_0x2628f1){if(_0x2628f1){return _0x2628f1['update'](_0x348782)['then'](function(_0x1e546c){return _0x1e546c;});}return null;};}function removeEntity(_0x1f8750,_0x3b9c5d){return function(_0xc4c5c){if(_0xc4c5c){return _0xc4c5c['destroy']()['then'](function(){_0x1f8750[_0x5f9f('0x16')](0xcc)[_0x5f9f('0x17')]();});}};}function handleEntityNotFound(_0x13d33c,_0x93420c){return function(_0xc1e449){if(!_0xc1e449){_0x13d33c['sendStatus'](0x194);}return _0xc1e449;};}function handleError(_0x3f35d7,_0x99283d){_0x99283d=_0x99283d||0x1f4;return function(_0x482807){logger[_0x5f9f('0x20')](_0x482807['stack']);if(_0x482807[_0x5f9f('0x21')]){delete _0x482807[_0x5f9f('0x21')];}_0x3f35d7[_0x5f9f('0x16')](_0x99283d)[_0x5f9f('0x22')](_0x482807);};}exports['index']=function(_0x36d249,_0xb0d97a){var _0x55f5a6={},_0x1bf4d9={},_0x2ec5ba={'count':0x0,'rows':[]};var _0x320add=_[_0x5f9f('0x23')](db[_0x5f9f('0x24')]['rawAttributes'],function(_0x413259){return{'name':_0x413259[_0x5f9f('0x25')],'type':_0x413259['type']['key']};});_0x1bf4d9['model']=_[_0x5f9f('0x23')](_0x320add,_0x5f9f('0x21'));_0x1bf4d9['query']=_[_0x5f9f('0x26')](_0x36d249[_0x5f9f('0x27')]);_0x1bf4d9[_0x5f9f('0x28')]=_[_0x5f9f('0x29')](_0x1bf4d9[_0x5f9f('0x2a')],_0x1bf4d9[_0x5f9f('0x27')]);_0x55f5a6[_0x5f9f('0x2b')]=_[_0x5f9f('0x29')](_0x1bf4d9[_0x5f9f('0x2a')],qs[_0x5f9f('0x2c')](_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x2c')]));_0x55f5a6[_0x5f9f('0x2b')]=_0x55f5a6[_0x5f9f('0x2b')][_0x5f9f('0x2d')]?_0x55f5a6[_0x5f9f('0x2b')]:_0x1bf4d9[_0x5f9f('0x2a')];if(!_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x2e')]('nolimit')){_0x55f5a6[_0x5f9f('0x19')]=qs[_0x5f9f('0x19')](_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x19')]);_0x55f5a6[_0x5f9f('0x18')]=qs[_0x5f9f('0x18')](_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x18')]);}_0x55f5a6['order']=qs[_0x5f9f('0x2f')](_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x2f')]);_0x55f5a6[_0x5f9f('0x30')]=qs[_0x5f9f('0x28')](_['pick'](_0x36d249[_0x5f9f('0x27')],_0x1bf4d9[_0x5f9f('0x28')]),_0x320add);if(_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x31')]){_0x55f5a6['where']=_[_0x5f9f('0x32')](_0x55f5a6[_0x5f9f('0x30')],{'$or':_[_0x5f9f('0x23')](_0x320add,function(_0x4992e4){if(_0x4992e4[_0x5f9f('0x33')]!=='VIRTUAL'){var _0x31006a={};_0x31006a[_0x4992e4[_0x5f9f('0x21')]]={'$like':'%'+_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x31')]+'%'};return _0x31006a;}})});}_0x55f5a6=_[_0x5f9f('0x32')]({},_0x55f5a6,_0x36d249[_0x5f9f('0x34')]);var _0x2ba142={'where':_0x55f5a6[_0x5f9f('0x30')]};return db[_0x5f9f('0x24')]['count'](_0x2ba142)[_0x5f9f('0x35')](function(_0x3cb18e){_0x2ec5ba[_0x5f9f('0x1a')]=_0x3cb18e;if(_0x36d249[_0x5f9f('0x27')][_0x5f9f('0x36')]){_0x55f5a6[_0x5f9f('0x37')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x5f9f('0x38')](_0x55f5a6);})[_0x5f9f('0x35')](function(_0x130c84){_0x2ec5ba[_0x5f9f('0x39')]=_0x130c84;return _0x2ec5ba;})[_0x5f9f('0x35')](respondWithFilteredResult(_0xb0d97a,_0x55f5a6))[_0x5f9f('0x3a')](handleError(_0xb0d97a,null));};exports[_0x5f9f('0x3b')]=function(_0x56c7de,_0x191f32){var _0x4d03a2={'raw':!![],'where':{'id':_0x56c7de[_0x5f9f('0x3c')]['id']}},_0x6c892e={};_0x6c892e[_0x5f9f('0x2a')]=_[_0x5f9f('0x26')](db['OpenchannelTransferReport'][_0x5f9f('0x3d')]);_0x6c892e['query']=_[_0x5f9f('0x26')](_0x56c7de[_0x5f9f('0x27')]);_0x6c892e[_0x5f9f('0x28')]=_[_0x5f9f('0x29')](_0x6c892e['model'],_0x6c892e[_0x5f9f('0x27')]);_0x4d03a2[_0x5f9f('0x2b')]=_[_0x5f9f('0x29')](_0x6c892e['model'],qs['fields'](_0x56c7de['query'][_0x5f9f('0x2c')]));_0x4d03a2[_0x5f9f('0x2b')]=_0x4d03a2['attributes']['length']?_0x4d03a2[_0x5f9f('0x2b')]:_0x6c892e[_0x5f9f('0x2a')];if(_0x56c7de['query'][_0x5f9f('0x36')]){_0x4d03a2[_0x5f9f('0x37')]=[{'all':!![]}];}_0x4d03a2=_['merge']({},_0x4d03a2,_0x56c7de[_0x5f9f('0x34')]);return db[_0x5f9f('0x24')]['find'](_0x4d03a2)[_0x5f9f('0x35')](handleEntityNotFound(_0x191f32,null))[_0x5f9f('0x35')](respondWithResult(_0x191f32,null))[_0x5f9f('0x3a')](handleError(_0x191f32,null));};exports[_0x5f9f('0x3e')]=function(_0x251146,_0x8d29d7){return db[_0x5f9f('0x24')][_0x5f9f('0x3e')](_0x251146[_0x5f9f('0x3f')],{})[_0x5f9f('0x35')](respondWithResult(_0x8d29d7,0xc9))[_0x5f9f('0x3a')](handleError(_0x8d29d7,null));};exports[_0x5f9f('0x40')]=function(_0x3cfd1d,_0x1a2989){if(_0x3cfd1d['body']['id']){delete _0x3cfd1d[_0x5f9f('0x3f')]['id'];}return db[_0x5f9f('0x24')][_0x5f9f('0x41')]({'where':{'id':_0x3cfd1d[_0x5f9f('0x3c')]['id']}})[_0x5f9f('0x35')](handleEntityNotFound(_0x1a2989,null))['then'](saveUpdates(_0x3cfd1d[_0x5f9f('0x3f')],null))[_0x5f9f('0x35')](respondWithResult(_0x1a2989,null))[_0x5f9f('0x3a')](handleError(_0x1a2989,null));};exports['destroy']=function(_0x167641,_0x568783){return db['OpenchannelTransferReport'][_0x5f9f('0x41')]({'where':{'id':_0x167641['params']['id']}})['then'](handleEntityNotFound(_0x568783,null))['then'](removeEntity(_0x568783,null))[_0x5f9f('0x3a')](handleError(_0x568783,null));};exports[_0x5f9f('0x42')]=function(_0x445d58,_0x3c8af5){return db[_0x5f9f('0x24')]['describe']()[_0x5f9f('0x35')](respondWithResult(_0x3c8af5,null))['catch'](handleError(_0x3c8af5,null));}; \ No newline at end of file +var _0x44ed=['params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','include','rows','show','keys','options','find','catch','create','body'];(function(_0x3739ab,_0xb7ad04){var _0x558cec=function(_0x320ed9){while(--_0x320ed9){_0x3739ab['push'](_0x3739ab['shift']());}};_0x558cec(++_0xb7ad04);}(_0x44ed,0x183));var _0xd44e=function(_0x46848e,_0xe1b792){_0x46848e=_0x46848e-0x0;var _0x3fcfcb=_0x44ed[_0x46848e];return _0x3fcfcb;};'use strict';var emlformat=require(_0xd44e('0x0'));var rimraf=require(_0xd44e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd44e('0x2'));var rp=require(_0xd44e('0x3'));var moment=require(_0xd44e('0x4'));var BPromise=require(_0xd44e('0x5'));var Mustache=require('mustache');var util=require(_0xd44e('0x6'));var path=require(_0xd44e('0x7'));var sox=require(_0xd44e('0x8'));var csv=require(_0xd44e('0x9'));var ejs=require(_0xd44e('0xa'));var fs=require('fs');var fs_extra=require(_0xd44e('0xb'));var _=require(_0xd44e('0xc'));var squel=require(_0xd44e('0xd'));var crypto=require(_0xd44e('0xe'));var jsforce=require(_0xd44e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd44e('0x9'));var querystring=require('querystring');var Papa=require(_0xd44e('0x10'));var Redis=require('ioredis');var authService=require(_0xd44e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd44e('0x12'));var hardwareService=require(_0xd44e('0x13'));var logger=require(_0xd44e('0x14'))(_0xd44e('0x15'));var utils=require('../../config/utils');var config=require(_0xd44e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd44e('0x17'))['db'];function respondWithStatusCode(_0x1dc98f,_0x4c781b){_0x4c781b=_0x4c781b||0xcc;return function(_0x5a3ff7){if(_0x5a3ff7){return _0x1dc98f['sendStatus'](_0x4c781b);}return _0x1dc98f['status'](_0x4c781b)[_0xd44e('0x18')]();};}function respondWithResult(_0x31324f,_0x535fee){_0x535fee=_0x535fee||0xc8;return function(_0x2fafbb){if(_0x2fafbb){return _0x31324f[_0xd44e('0x19')](_0x535fee)[_0xd44e('0x1a')](_0x2fafbb);}};}function respondWithFilteredResult(_0xf1b708,_0x4fc83e){return function(_0x1b7bc9){if(_0x1b7bc9){var _0x1b1aaf=typeof _0x4fc83e[_0xd44e('0x1b')]===_0xd44e('0x1c')&&typeof _0x4fc83e[_0xd44e('0x1d')]==='undefined';var _0x2efa79=_0x1b7bc9[_0xd44e('0x1e')];var _0x5ab81=_0x1b1aaf?0x0:_0x4fc83e[_0xd44e('0x1b')];var _0x2db393=_0x1b1aaf?_0x1b7bc9['count']:_0x4fc83e[_0xd44e('0x1b')]+_0x4fc83e[_0xd44e('0x1d')];var _0x25eaf3;if(_0x2db393>=_0x2efa79){_0x2db393=_0x2efa79;_0x25eaf3=0xc8;}else{_0x25eaf3=0xce;}_0xf1b708[_0xd44e('0x19')](_0x25eaf3);return _0xf1b708[_0xd44e('0x1f')](_0xd44e('0x20'),_0x5ab81+'-'+_0x2db393+'/'+_0x2efa79)[_0xd44e('0x1a')](_0x1b7bc9);}return null;};}function patchUpdates(_0xbc4b01){return function(_0x642dc8){try{jsonpatch[_0xd44e('0x21')](_0x642dc8,_0xbc4b01,!![]);}catch(_0x40b3e3){return BPromise[_0xd44e('0x22')](_0x40b3e3);}return _0x642dc8[_0xd44e('0x23')]();};}function saveUpdates(_0x2b8b8a,_0x36dc6a){return function(_0x13c5f3){if(_0x13c5f3){return _0x13c5f3[_0xd44e('0x24')](_0x2b8b8a)[_0xd44e('0x25')](function(_0x2fac4e){return _0x2fac4e;});}return null;};}function removeEntity(_0x4db773,_0x334944){return function(_0x89fbf1){if(_0x89fbf1){return _0x89fbf1[_0xd44e('0x26')]()[_0xd44e('0x25')](function(){_0x4db773[_0xd44e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45dec8,_0x26eaa2){return function(_0x5bc1ee){if(!_0x5bc1ee){_0x45dec8[_0xd44e('0x27')](0x194);}return _0x5bc1ee;};}function handleError(_0x4259ef,_0x25f6b3){_0x25f6b3=_0x25f6b3||0x1f4;return function(_0x491968){logger['error'](_0x491968[_0xd44e('0x28')]);if(_0x491968[_0xd44e('0x29')]){delete _0x491968[_0xd44e('0x29')];}_0x4259ef[_0xd44e('0x19')](_0x25f6b3)[_0xd44e('0x2a')](_0x491968);};}exports[_0xd44e('0x2b')]=function(_0x2d18be,_0x1c3672){var _0x1ad02f={},_0x5b8249={},_0x1fcf44={'count':0x0,'rows':[]};var _0x3ee335=_['map'](db[_0xd44e('0x2c')][_0xd44e('0x2d')],function(_0x584711){return{'name':_0x584711[_0xd44e('0x2e')],'type':_0x584711[_0xd44e('0x2f')][_0xd44e('0x30')]};});_0x5b8249['model']=_[_0xd44e('0x31')](_0x3ee335,'name');_0x5b8249[_0xd44e('0x32')]=_['keys'](_0x2d18be['query']);_0x5b8249[_0xd44e('0x33')]=_[_0xd44e('0x34')](_0x5b8249[_0xd44e('0x35')],_0x5b8249[_0xd44e('0x32')]);_0x1ad02f[_0xd44e('0x36')]=_['intersection'](_0x5b8249[_0xd44e('0x35')],qs['fields'](_0x2d18be[_0xd44e('0x32')][_0xd44e('0x37')]));_0x1ad02f[_0xd44e('0x36')]=_0x1ad02f[_0xd44e('0x36')][_0xd44e('0x38')]?_0x1ad02f[_0xd44e('0x36')]:_0x5b8249[_0xd44e('0x35')];if(!_0x2d18be['query'][_0xd44e('0x39')](_0xd44e('0x3a'))){_0x1ad02f[_0xd44e('0x1d')]=qs[_0xd44e('0x1d')](_0x2d18be[_0xd44e('0x32')][_0xd44e('0x1d')]);_0x1ad02f[_0xd44e('0x1b')]=qs[_0xd44e('0x1b')](_0x2d18be[_0xd44e('0x32')][_0xd44e('0x1b')]);}_0x1ad02f[_0xd44e('0x3b')]=qs[_0xd44e('0x3c')](_0x2d18be[_0xd44e('0x32')][_0xd44e('0x3c')]);_0x1ad02f['where']=qs[_0xd44e('0x33')](_['pick'](_0x2d18be[_0xd44e('0x32')],_0x5b8249[_0xd44e('0x33')]),_0x3ee335);if(_0x2d18be[_0xd44e('0x32')][_0xd44e('0x3d')]){_0x1ad02f['where']=_['merge'](_0x1ad02f[_0xd44e('0x3e')],{'$or':_['map'](_0x3ee335,function(_0x39936c){if(_0x39936c[_0xd44e('0x2f')]!==_0xd44e('0x3f')){var _0x14e3b9={};_0x14e3b9[_0x39936c[_0xd44e('0x29')]]={'$like':'%'+_0x2d18be['query'][_0xd44e('0x3d')]+'%'};return _0x14e3b9;}})});}_0x1ad02f=_[_0xd44e('0x40')]({},_0x1ad02f,_0x2d18be['options']);var _0x6827e5={'where':_0x1ad02f[_0xd44e('0x3e')]};return db['OpenchannelTransferReport'][_0xd44e('0x1e')](_0x6827e5)[_0xd44e('0x25')](function(_0x57c07f){_0x1fcf44[_0xd44e('0x1e')]=_0x57c07f;if(_0x2d18be['query'][_0xd44e('0x41')]){_0x1ad02f[_0xd44e('0x42')]=[{'all':!![]}];}return db[_0xd44e('0x2c')]['findAll'](_0x1ad02f);})['then'](function(_0x2874cc){_0x1fcf44[_0xd44e('0x43')]=_0x2874cc;return _0x1fcf44;})['then'](respondWithFilteredResult(_0x1c3672,_0x1ad02f))['catch'](handleError(_0x1c3672,null));};exports[_0xd44e('0x44')]=function(_0x2c255c,_0x335d73){var _0x26ffb1={'raw':!![],'where':{'id':_0x2c255c['params']['id']}},_0x432320={};_0x432320[_0xd44e('0x35')]=_['keys'](db[_0xd44e('0x2c')][_0xd44e('0x2d')]);_0x432320[_0xd44e('0x32')]=_[_0xd44e('0x45')](_0x2c255c['query']);_0x432320[_0xd44e('0x33')]=_[_0xd44e('0x34')](_0x432320[_0xd44e('0x35')],_0x432320['query']);_0x26ffb1['attributes']=_[_0xd44e('0x34')](_0x432320[_0xd44e('0x35')],qs[_0xd44e('0x37')](_0x2c255c[_0xd44e('0x32')][_0xd44e('0x37')]));_0x26ffb1['attributes']=_0x26ffb1[_0xd44e('0x36')]['length']?_0x26ffb1[_0xd44e('0x36')]:_0x432320[_0xd44e('0x35')];if(_0x2c255c[_0xd44e('0x32')][_0xd44e('0x41')]){_0x26ffb1[_0xd44e('0x42')]=[{'all':!![]}];}_0x26ffb1=_['merge']({},_0x26ffb1,_0x2c255c[_0xd44e('0x46')]);return db['OpenchannelTransferReport'][_0xd44e('0x47')](_0x26ffb1)['then'](handleEntityNotFound(_0x335d73,null))[_0xd44e('0x25')](respondWithResult(_0x335d73,null))[_0xd44e('0x48')](handleError(_0x335d73,null));};exports[_0xd44e('0x49')]=function(_0x3aa5dc,_0x467df0){return db[_0xd44e('0x2c')][_0xd44e('0x49')](_0x3aa5dc[_0xd44e('0x4a')],{})[_0xd44e('0x25')](respondWithResult(_0x467df0,0xc9))[_0xd44e('0x48')](handleError(_0x467df0,null));};exports[_0xd44e('0x24')]=function(_0x5adf5c,_0xede200){if(_0x5adf5c['body']['id']){delete _0x5adf5c[_0xd44e('0x4a')]['id'];}return db['OpenchannelTransferReport'][_0xd44e('0x47')]({'where':{'id':_0x5adf5c['params']['id']}})[_0xd44e('0x25')](handleEntityNotFound(_0xede200,null))[_0xd44e('0x25')](saveUpdates(_0x5adf5c['body'],null))[_0xd44e('0x25')](respondWithResult(_0xede200,null))[_0xd44e('0x48')](handleError(_0xede200,null));};exports['destroy']=function(_0x5b94b2,_0x53cca1){return db[_0xd44e('0x2c')][_0xd44e('0x47')]({'where':{'id':_0x5b94b2[_0xd44e('0x4b')]['id']}})[_0xd44e('0x25')](handleEntityNotFound(_0x53cca1,null))['then'](removeEntity(_0x53cca1,null))[_0xd44e('0x48')](handleError(_0x53cca1,null));};exports[_0xd44e('0x4c')]=function(_0x10fc8e,_0x2c650c){return db[_0xd44e('0x2c')][_0xd44e('0x4c')]()['then'](respondWithResult(_0x2c650c,null))['catch'](handleError(_0x2c650c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index cef919b..7ed3eb3 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 _0x8de3=['request-promise','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x1a216d,_0x4be127){var _0x1854a6=function(_0x323414){while(--_0x323414){_0x1a216d['push'](_0x1a216d['shift']());}};_0x1854a6(++_0x4be127);}(_0x8de3,0x8b));var _0x38de=function(_0x5a427c,_0x1c7b6f){_0x5a427c=_0x5a427c-0x0;var _0xc17e0d=_0x8de3[_0x5a427c];return _0xc17e0d;};'use strict';var _=require(_0x38de('0x0'));var util=require(_0x38de('0x1'));var logger=require('../../config/logger')(_0x38de('0x2'));var moment=require(_0x38de('0x3'));var BPromise=require(_0x38de('0x4'));var rp=require(_0x38de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x38de('0x6'));var attributes=require(_0x38de('0x7'));module['exports']=function(_0x2b7d9d,_0x2f27f9){return _0x2b7d9d[_0x38de('0x8')](_0x38de('0x9'),attributes,{'tableName':_0x38de('0xa'),'paranoid':![],'indexes':[{'name':_0x38de('0xb'),'fields':[_0x38de('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['request-promise','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x112a6b,_0xafb4a2){var _0x28426d=function(_0x2b6e55){while(--_0x2b6e55){_0x112a6b['push'](_0x112a6b['shift']());}};_0x28426d(++_0xafb4a2);}(_0x430c,0x19b));var _0xc430=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x430c[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0xc430('0x0'));var util=require(_0xc430('0x1'));var logger=require(_0xc430('0x2'))('api');var moment=require(_0xc430('0x3'));var BPromise=require(_0xc430('0x4'));var rp=require(_0xc430('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc430('0x6'));var config=require(_0xc430('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0xc430('0x8')]=function(_0x4c2c6e,_0x4e9aab){return _0x4c2c6e[_0xc430('0x9')](_0xc430('0xa'),attributes,{'tableName':_0xc430('0xb'),'paranoid':![],'indexes':[{'name':_0xc430('0xc'),'fields':[_0xc430('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index eedb970..d723c38 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 _0xfd7b=['OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xfd7b[_0x365be9];return _0x185c12;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));var BPromise=require(_0xbfd7('0x2'));var rs=require(_0xbfd7('0x3'));var fs=require('fs');var Redis=require(_0xbfd7('0x4'));var db=require(_0xbfd7('0x5'))['db'];var utils=require(_0xbfd7('0x6'));var logger=require(_0xbfd7('0x7'))(_0xbfd7('0x8'));var config=require(_0xbfd7('0x9'));var jayson=require(_0xbfd7('0xa'));var client=jayson[_0xbfd7('0xb')][_0xbfd7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f3067,_0x38b1ef,_0x48f2aa){return new BPromise(function(_0x33dab1,_0x5cee3d){return client[_0xbfd7('0xd')](_0x5f3067,_0x48f2aa)[_0xbfd7('0xe')](function(_0x5a3d78){logger[_0xbfd7('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x38b1ef,_0xbfd7('0x10'));logger[_0xbfd7('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x38b1ef,'request\x20sent',JSON[_0xbfd7('0x12')](_0x5a3d78));if(_0x5a3d78[_0xbfd7('0x13')]){if(_0x5a3d78[_0xbfd7('0x13')][_0xbfd7('0x14')]===0x1f4){logger[_0xbfd7('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x38b1ef,_0x5a3d78[_0xbfd7('0x13')]['message']);return _0x5cee3d(_0x5a3d78[_0xbfd7('0x13')]['message']);}logger['error'](_0xbfd7('0x15'),_0x38b1ef,_0x5a3d78[_0xbfd7('0x13')][_0xbfd7('0x16')]);return _0x33dab1(_0x5a3d78[_0xbfd7('0x13')]['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x38b1ef,_0xbfd7('0x10'));_0x33dab1(_0x5a3d78[_0xbfd7('0x17')][_0xbfd7('0x16')]);}})[_0xbfd7('0x18')](function(_0x30c721){logger[_0xbfd7('0x13')](_0xbfd7('0x15'),_0x38b1ef,_0x30c721);_0x5cee3d(_0x30c721);});});} \ No newline at end of file +var _0xe7de=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf406b3,_0x4f188f){var _0x14728b=function(_0x23efb9){while(--_0x23efb9){_0xf406b3['push'](_0xf406b3['shift']());}};_0x14728b(++_0x4f188f);}(_0xe7de,0x165));var _0xee7d=function(_0x535f62,_0x282cfc){_0x535f62=_0x535f62-0x0;var _0x3f50d9=_0xe7de[_0x535f62];return _0x3f50d9;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var moment=require(_0xee7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7d('0x3'));var db=require(_0xee7d('0x4'))['db'];var utils=require(_0xee7d('0x5'));var logger=require(_0xee7d('0x6'))(_0xee7d('0x7'));var config=require(_0xee7d('0x8'));var jayson=require(_0xee7d('0x9'));var client=jayson[_0xee7d('0xa')][_0xee7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28d5b6,_0xe926ab,_0x2e172d){return new BPromise(function(_0x1c0584,_0x941d94){return client['request'](_0x28d5b6,_0x2e172d)[_0xee7d('0xc')](function(_0x32c4fa){logger[_0xee7d('0xd')](_0xee7d('0xe'),_0xe926ab,_0xee7d('0xf'));logger[_0xee7d('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0xe926ab,_0xee7d('0xf'),JSON['stringify'](_0x32c4fa));if(_0x32c4fa[_0xee7d('0x11')]){if(_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x12')]===0x1f4){logger[_0xee7d('0x11')](_0xee7d('0xe'),_0xe926ab,_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x13')]);return _0x941d94(_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x13')]);}logger[_0xee7d('0x11')](_0xee7d('0xe'),_0xe926ab,_0x32c4fa['error']['message']);return _0x1c0584(_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x13')]);}else{logger[_0xee7d('0xd')](_0xee7d('0xe'),_0xe926ab,_0xee7d('0xf'));_0x1c0584(_0x32c4fa[_0xee7d('0x14')]['message']);}})[_0xee7d('0x15')](function(_0x2bcd81){logger[_0xee7d('0x11')](_0xee7d('0xe'),_0xe926ab,_0x2bcd81);_0x941d94(_0x2bcd81);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index bd99c10..002c2f8 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 _0x646d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','post','create','put','/:id','multer','util','connect-timeout','express'];(function(_0x97385e,_0x17e853){var _0x5d337e=function(_0x356c96){while(--_0x356c96){_0x97385e['push'](_0x97385e['shift']());}};_0x5d337e(++_0x17e853);}(_0x646d,0x173));var _0xd646=function(_0x58cff5,_0x2e49ed){_0x58cff5=_0x58cff5-0x0;var _0x38f532=_0x646d[_0x58cff5];return _0x38f532;};'use strict';var multer=require(_0xd646('0x0'));var util=require(_0xd646('0x1'));var path=require('path');var timeout=require(_0xd646('0x2'));var express=require(_0xd646('0x3'));var router=express[_0xd646('0x4')]();var fs_extra=require(_0xd646('0x5'));var auth=require(_0xd646('0x6'));var interaction=require(_0xd646('0x7'));var config=require('../../config/environment');var controller=require(_0xd646('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd646('0x9')]('/:id',auth[_0xd646('0xa')](),controller['show']);router[_0xd646('0xb')]('/',auth[_0xd646('0xa')](),controller[_0xd646('0xc')]);router[_0xd646('0xd')]('/:id',auth[_0xd646('0xa')](),controller['update']);router['delete'](_0xd646('0xe'),auth[_0xd646('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf17b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x29f7d1,_0x96db7){var _0x1499a1=function(_0x231806){while(--_0x231806){_0x29f7d1['push'](_0x29f7d1['shift']());}};_0x1499a1(++_0x96db7);}(_0xf17b,0x13e));var _0xbf17=function(_0x3fa403,_0x937d81){_0x3fa403=_0x3fa403-0x0;var _0x446525=_0xf17b[_0x3fa403];return _0x446525;};'use strict';var multer=require(_0xbf17('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbf17('0x1'));var express=require(_0xbf17('0x2'));var router=express['Router']();var fs_extra=require(_0xbf17('0x3'));var auth=require(_0xbf17('0x4'));var interaction=require(_0xbf17('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xbf17('0x6')]('/',auth[_0xbf17('0x7')](),controller[_0xbf17('0x8')]);router[_0xbf17('0x6')](_0xbf17('0x9'),auth[_0xbf17('0x7')](),controller['show']);router[_0xbf17('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf17('0xb')]('/:id',auth[_0xbf17('0x7')](),controller[_0xbf17('0xc')]);router[_0xbf17('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf17('0xe')]);module[_0xbf17('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index df8231e..d66324c 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 _0x021d=['STRING','exports','name'];(function(_0x3629d,_0x45e728){var _0x1c8b66=function(_0x145002){while(--_0x145002){_0x3629d['push'](_0x3629d['shift']());}};_0x1c8b66(++_0x45e728);}(_0x021d,0x1e1));var _0xd021=function(_0x1fd5f5,_0x36b4ec){_0x1fd5f5=_0x1fd5f5-0x0;var _0x3f2e69=_0x021d[_0x1fd5f5];return _0x3f2e69;};'use strict';var Sequelize=require('sequelize');module[_0xd021('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd021('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xd021('0x2')]}}; \ No newline at end of file +var _0xf77a=['STRING','name','exports'];(function(_0x13df9f,_0x1d2f33){var _0x20d0f5=function(_0x526796){while(--_0x526796){_0x13df9f['push'](_0x13df9f['shift']());}};_0x20d0f5(++_0x1d2f33);}(_0xf77a,0x15e));var _0xaf77=function(_0x2c99ad,_0x2c45b8){_0x2c99ad=_0x2c99ad-0x0;var _0x2af7f5=_0xf77a[_0x2c99ad];return _0x2af7f5;};'use strict';var Sequelize=require('sequelize');module[_0xaf77('0x0')]={'name':{'type':Sequelize[_0xaf77('0x1')],'unique':_0xaf77('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xaf77('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 42764bb..a425b7f 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 _0x6885=['autoAssociation','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','userProfileId'];(function(_0x2db5a9,_0x3cbefa){var _0x3e2e77=function(_0x34dcf2){while(--_0x34dcf2){_0x2db5a9['push'](_0x2db5a9['shift']());}};_0x3e2e77(++_0x3cbefa);}(_0x6885,0xf6));var _0x5688=function(_0x37003f,_0x3d51b3){_0x37003f=_0x37003f-0x0;var _0x4945ca=_0x6885[_0x37003f];return _0x4945ca;};'use strict';var emlformat=require(_0x5688('0x0'));var rimraf=require(_0x5688('0x1'));var zipdir=require(_0x5688('0x2'));var jsonpatch=require(_0x5688('0x3'));var rp=require('request-promise');var moment=require(_0x5688('0x4'));var BPromise=require(_0x5688('0x5'));var Mustache=require(_0x5688('0x6'));var util=require(_0x5688('0x7'));var path=require('path');var sox=require(_0x5688('0x8'));var csv=require(_0x5688('0x9'));var ejs=require(_0x5688('0xa'));var fs=require('fs');var fs_extra=require(_0x5688('0xb'));var _=require(_0x5688('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5688('0xd'));var toCsv=require(_0x5688('0x9'));var querystring=require(_0x5688('0xe'));var Papa=require(_0x5688('0xf'));var Redis=require(_0x5688('0x10'));var authService=require(_0x5688('0x11'));var qs=require(_0x5688('0x12'));var as=require(_0x5688('0x13'));var hardwareService=require(_0x5688('0x14'));var logger=require(_0x5688('0x15'))(_0x5688('0x16'));var utils=require('../../config/utils');var config=require(_0x5688('0x17'));var licenseUtil=require(_0x5688('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x134dbe,_0x1a3198){_0x1a3198=_0x1a3198||0xcc;return function(_0x3a917e){if(_0x3a917e){return _0x134dbe[_0x5688('0x19')](_0x1a3198);}return _0x134dbe[_0x5688('0x1a')](_0x1a3198)[_0x5688('0x1b')]();};}function respondWithResult(_0x5ca59f,_0x6fcaea){_0x6fcaea=_0x6fcaea||0xc8;return function(_0x2cbb14){if(_0x2cbb14){return _0x5ca59f[_0x5688('0x1a')](_0x6fcaea)['json'](_0x2cbb14);}};}function respondWithFilteredResult(_0x323a5f,_0x430fad){return function(_0x31e738){if(_0x31e738){var _0x5416b4=typeof _0x430fad[_0x5688('0x1c')]===_0x5688('0x1d')&&typeof _0x430fad[_0x5688('0x1e')]===_0x5688('0x1d');var _0x5b8702=_0x31e738[_0x5688('0x1f')];var _0x165c00=_0x5416b4?0x0:_0x430fad['offset'];var _0x154329=_0x5416b4?_0x31e738['count']:_0x430fad[_0x5688('0x1c')]+_0x430fad['limit'];var _0x4fe8a6;if(_0x154329>=_0x5b8702){_0x154329=_0x5b8702;_0x4fe8a6=0xc8;}else{_0x4fe8a6=0xce;}_0x323a5f[_0x5688('0x1a')](_0x4fe8a6);return _0x323a5f['set']('Content-Range',_0x165c00+'-'+_0x154329+'/'+_0x5b8702)[_0x5688('0x20')](_0x31e738);}return null;};}function patchUpdates(_0x5331a2){return function(_0x107e2b){try{jsonpatch[_0x5688('0x21')](_0x107e2b,_0x5331a2,!![]);}catch(_0x4957d8){return BPromise[_0x5688('0x22')](_0x4957d8);}return _0x107e2b[_0x5688('0x23')]();};}function saveUpdates(_0x347b55,_0x4bb871){return function(_0x276f45){if(_0x276f45){return _0x276f45['update'](_0x347b55)[_0x5688('0x24')](function(_0x31b068){return _0x31b068;});}return null;};}function removeEntity(_0x293e37,_0x55a80d){return function(_0x2ca313){if(_0x2ca313){return _0x2ca313['destroy']()[_0x5688('0x24')](function(){var _0x6426d=_0x2ca313[_0x5688('0x25')]({'plain':!![]});var _0x3ffc53='Pauses';return db[_0x5688('0x26')][_0x5688('0x27')]({'where':{'type':_0x3ffc53,'resourceId':_0x6426d['id']}})[_0x5688('0x24')](function(){return _0x2ca313;});})['then'](function(){_0x293e37['status'](0xcc)[_0x5688('0x1b')]();});}};}function handleEntityNotFound(_0x4ed219,_0x42e90e){return function(_0x52bed3){if(!_0x52bed3){_0x4ed219[_0x5688('0x19')](0x194);}return _0x52bed3;};}function handleError(_0x38690b,_0x12144c){_0x12144c=_0x12144c||0x1f4;return function(_0x1597dc){logger[_0x5688('0x28')](_0x1597dc[_0x5688('0x29')]);if(_0x1597dc[_0x5688('0x2a')]){delete _0x1597dc[_0x5688('0x2a')];}_0x38690b[_0x5688('0x1a')](_0x12144c)['send'](_0x1597dc);};}exports[_0x5688('0x2b')]=function(_0x59b390,_0x4eff51){var _0xad6f1c={},_0x10fb1a={},_0x4dfe81={'count':0x0,'rows':[]};var _0x27e389=_[_0x5688('0x2c')](db[_0x5688('0x2d')][_0x5688('0x2e')],function(_0x184493){return{'name':_0x184493[_0x5688('0x2f')],'type':_0x184493[_0x5688('0x30')]['key']};});_0x10fb1a[_0x5688('0x31')]=_[_0x5688('0x2c')](_0x27e389,_0x5688('0x2a'));_0x10fb1a[_0x5688('0x32')]=_['keys'](_0x59b390[_0x5688('0x32')]);_0x10fb1a[_0x5688('0x33')]=_[_0x5688('0x34')](_0x10fb1a[_0x5688('0x31')],_0x10fb1a[_0x5688('0x32')]);_0xad6f1c[_0x5688('0x35')]=_['intersection'](_0x10fb1a['model'],qs[_0x5688('0x36')](_0x59b390['query'][_0x5688('0x36')]));_0xad6f1c[_0x5688('0x35')]=_0xad6f1c['attributes'][_0x5688('0x37')]?_0xad6f1c['attributes']:_0x10fb1a[_0x5688('0x31')];if(!_0x59b390[_0x5688('0x32')][_0x5688('0x38')](_0x5688('0x39'))){_0xad6f1c[_0x5688('0x1e')]=qs['limit'](_0x59b390[_0x5688('0x32')]['limit']);_0xad6f1c[_0x5688('0x1c')]=qs[_0x5688('0x1c')](_0x59b390['query'][_0x5688('0x1c')]);}_0xad6f1c['order']=qs[_0x5688('0x3a')](_0x59b390[_0x5688('0x32')]['sort']);_0xad6f1c[_0x5688('0x3b')]=qs[_0x5688('0x33')](_[_0x5688('0x3c')](_0x59b390[_0x5688('0x32')],_0x10fb1a[_0x5688('0x33')]),_0x27e389);if(_0x59b390[_0x5688('0x32')][_0x5688('0x3d')]){_0xad6f1c[_0x5688('0x3b')]=_[_0x5688('0x3e')](_0xad6f1c[_0x5688('0x3b')],{'$or':_['map'](_0x27e389,function(_0x273261){if(_0x273261[_0x5688('0x30')]!=='VIRTUAL'){var _0x41e549={};_0x41e549[_0x273261[_0x5688('0x2a')]]={'$like':'%'+_0x59b390[_0x5688('0x32')][_0x5688('0x3d')]+'%'};return _0x41e549;}})});}_0xad6f1c=_[_0x5688('0x3e')]({},_0xad6f1c,_0x59b390[_0x5688('0x3f')]);var _0x5acce9={'where':_0xad6f1c[_0x5688('0x3b')]};return db[_0x5688('0x2d')]['count'](_0x5acce9)[_0x5688('0x24')](function(_0x59e40e){_0x4dfe81['count']=_0x59e40e;if(_0x59b390[_0x5688('0x32')][_0x5688('0x40')]){_0xad6f1c[_0x5688('0x41')]=[{'all':!![]}];}return db[_0x5688('0x2d')][_0x5688('0x42')](_0xad6f1c);})[_0x5688('0x24')](function(_0x300000){_0x4dfe81[_0x5688('0x43')]=_0x300000;return _0x4dfe81;})[_0x5688('0x24')](respondWithFilteredResult(_0x4eff51,_0xad6f1c))['catch'](handleError(_0x4eff51,null));};exports[_0x5688('0x44')]=function(_0xf2924f,_0x11b44c){var _0x4c5234={'raw':!![],'where':{'id':_0xf2924f['params']['id']}},_0x3be3a6={};_0x3be3a6[_0x5688('0x31')]=_[_0x5688('0x45')](db[_0x5688('0x2d')][_0x5688('0x2e')]);_0x3be3a6['query']=_[_0x5688('0x45')](_0xf2924f[_0x5688('0x32')]);_0x3be3a6['filters']=_['intersection'](_0x3be3a6['model'],_0x3be3a6[_0x5688('0x32')]);_0x4c5234[_0x5688('0x35')]=_['intersection'](_0x3be3a6[_0x5688('0x31')],qs['fields'](_0xf2924f[_0x5688('0x32')][_0x5688('0x36')]));_0x4c5234[_0x5688('0x35')]=_0x4c5234[_0x5688('0x35')][_0x5688('0x37')]?_0x4c5234['attributes']:_0x3be3a6[_0x5688('0x31')];if(_0xf2924f[_0x5688('0x32')][_0x5688('0x40')]){_0x4c5234['include']=[{'all':!![]}];}_0x4c5234=_[_0x5688('0x3e')]({},_0x4c5234,_0xf2924f[_0x5688('0x3f')]);return db[_0x5688('0x2d')][_0x5688('0x46')](_0x4c5234)['then'](handleEntityNotFound(_0x11b44c,null))[_0x5688('0x24')](respondWithResult(_0x11b44c,null))['catch'](handleError(_0x11b44c,null));};exports[_0x5688('0x47')]=function(_0x4f8d31,_0x9d2e19){return db[_0x5688('0x2d')]['create'](_0x4f8d31[_0x5688('0x48')],{})[_0x5688('0x24')](function(_0x3df192){var _0xe072c7=_0x4f8d31[_0x5688('0x49')][_0x5688('0x25')]({'plain':!![]});if(!_0xe072c7)throw new Error(_0x5688('0x4a'));if(_0xe072c7[_0x5688('0x4b')]===_0x5688('0x49')){var _0x21bdc7=_0x3df192['get']({'plain':!![]});var _0x12242b=_0x5688('0x4c');return db['UserProfileSection'][_0x5688('0x46')]({'where':{'name':_0x12242b,'userProfileId':_0xe072c7[_0x5688('0x4d')]},'raw':!![]})[_0x5688('0x24')](function(_0xda43eb){if(_0xda43eb&&_0xda43eb[_0x5688('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x21bdc7[_0x5688('0x2a')],'resourceId':_0x21bdc7['id'],'type':_0xda43eb[_0x5688('0x2a')],'sectionId':_0xda43eb['id']},{})[_0x5688('0x24')](function(){return _0x3df192;});}else{return _0x3df192;}})[_0x5688('0x4f')](function(_0x9dd14e){logger[_0x5688('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9dd14e);throw _0x9dd14e;});}return _0x3df192;})[_0x5688('0x24')](respondWithResult(_0x9d2e19,0xc9))[_0x5688('0x4f')](handleError(_0x9d2e19,null));};exports[_0x5688('0x50')]=function(_0x4fb199,_0x360850){if(_0x4fb199[_0x5688('0x48')]['id']){delete _0x4fb199[_0x5688('0x48')]['id'];}return db['Pause'][_0x5688('0x46')]({'where':{'id':_0x4fb199['params']['id']}})['then'](handleEntityNotFound(_0x360850,null))[_0x5688('0x24')](saveUpdates(_0x4fb199[_0x5688('0x48')],null))[_0x5688('0x24')](respondWithResult(_0x360850,null))[_0x5688('0x4f')](handleError(_0x360850,null));};exports[_0x5688('0x27')]=function(_0x7dfd15,_0x1dd2a7){return db['Pause'][_0x5688('0x46')]({'where':{'id':_0x7dfd15['params']['id']}})[_0x5688('0x24')](handleEntityNotFound(_0x1dd2a7,null))[_0x5688('0x24')](removeEntity(_0x1dd2a7,null))[_0x5688('0x4f')](handleError(_0x1dd2a7,null));}; \ No newline at end of file +var _0xf90d=['then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','reject','save','update'];(function(_0x377f94,_0x19c35e){var _0x264ad8=function(_0x1d7ce7){while(--_0x1d7ce7){_0x377f94['push'](_0x377f94['shift']());}};_0x264ad8(++_0x19c35e);}(_0xf90d,0xd5));var _0xdf90=function(_0x2ba7f3,_0xaf853){_0x2ba7f3=_0x2ba7f3-0x0;var _0x43a57f=_0xf90d[_0x2ba7f3];return _0x43a57f;};'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(_0xdf90('0x0'));var moment=require('moment');var BPromise=require(_0xdf90('0x1'));var Mustache=require(_0xdf90('0x2'));var util=require(_0xdf90('0x3'));var path=require(_0xdf90('0x4'));var sox=require(_0xdf90('0x5'));var csv=require(_0xdf90('0x6'));var ejs=require(_0xdf90('0x7'));var fs=require('fs');var fs_extra=require(_0xdf90('0x8'));var _=require(_0xdf90('0x9'));var squel=require(_0xdf90('0xa'));var crypto=require(_0xdf90('0xb'));var jsforce=require(_0xdf90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdf90('0x6'));var querystring=require(_0xdf90('0xd'));var Papa=require(_0xdf90('0xe'));var Redis=require(_0xdf90('0xf'));var authService=require(_0xdf90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdf90('0x11'));var hardwareService=require(_0xdf90('0x12'));var logger=require(_0xdf90('0x13'))(_0xdf90('0x14'));var utils=require(_0xdf90('0x15'));var config=require(_0xdf90('0x16'));var licenseUtil=require(_0xdf90('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc9a721,_0x542c8f){_0x542c8f=_0x542c8f||0xcc;return function(_0x1b3553){if(_0x1b3553){return _0xc9a721[_0xdf90('0x18')](_0x542c8f);}return _0xc9a721['status'](_0x542c8f)[_0xdf90('0x19')]();};}function respondWithResult(_0x32828f,_0x32bccb){_0x32bccb=_0x32bccb||0xc8;return function(_0x29593b){if(_0x29593b){return _0x32828f[_0xdf90('0x1a')](_0x32bccb)['json'](_0x29593b);}};}function respondWithFilteredResult(_0x5ced29,_0x181ed0){return function(_0x4ca42a){if(_0x4ca42a){var _0x477c4e=typeof _0x181ed0[_0xdf90('0x1b')]===_0xdf90('0x1c')&&typeof _0x181ed0[_0xdf90('0x1d')]===_0xdf90('0x1c');var _0x213e1b=_0x4ca42a['count'];var _0x565c64=_0x477c4e?0x0:_0x181ed0[_0xdf90('0x1b')];var _0x1acebd=_0x477c4e?_0x4ca42a['count']:_0x181ed0[_0xdf90('0x1b')]+_0x181ed0[_0xdf90('0x1d')];var _0x13f9b3;if(_0x1acebd>=_0x213e1b){_0x1acebd=_0x213e1b;_0x13f9b3=0xc8;}else{_0x13f9b3=0xce;}_0x5ced29[_0xdf90('0x1a')](_0x13f9b3);return _0x5ced29[_0xdf90('0x1e')](_0xdf90('0x1f'),_0x565c64+'-'+_0x1acebd+'/'+_0x213e1b)[_0xdf90('0x20')](_0x4ca42a);}return null;};}function patchUpdates(_0x408ccd){return function(_0x1dbb71){try{jsonpatch['apply'](_0x1dbb71,_0x408ccd,!![]);}catch(_0x11205a){return BPromise[_0xdf90('0x21')](_0x11205a);}return _0x1dbb71[_0xdf90('0x22')]();};}function saveUpdates(_0xcaadd5,_0xe8eff5){return function(_0x65b30){if(_0x65b30){return _0x65b30[_0xdf90('0x23')](_0xcaadd5)[_0xdf90('0x24')](function(_0x212370){return _0x212370;});}return null;};}function removeEntity(_0x410d24,_0xac4249){return function(_0x1b9210){if(_0x1b9210){return _0x1b9210[_0xdf90('0x25')]()[_0xdf90('0x24')](function(){var _0x2e42eb=_0x1b9210[_0xdf90('0x26')]({'plain':!![]});var _0x26ead1=_0xdf90('0x27');return db[_0xdf90('0x28')][_0xdf90('0x25')]({'where':{'type':_0x26ead1,'resourceId':_0x2e42eb['id']}})[_0xdf90('0x24')](function(){return _0x1b9210;});})[_0xdf90('0x24')](function(){_0x410d24[_0xdf90('0x1a')](0xcc)[_0xdf90('0x19')]();});}};}function handleEntityNotFound(_0x40885b,_0x34f7bd){return function(_0x549f64){if(!_0x549f64){_0x40885b[_0xdf90('0x18')](0x194);}return _0x549f64;};}function handleError(_0x5a0eba,_0x3fe2ca){_0x3fe2ca=_0x3fe2ca||0x1f4;return function(_0x2816ce){logger[_0xdf90('0x29')](_0x2816ce[_0xdf90('0x2a')]);if(_0x2816ce['name']){delete _0x2816ce[_0xdf90('0x2b')];}_0x5a0eba[_0xdf90('0x1a')](_0x3fe2ca)[_0xdf90('0x2c')](_0x2816ce);};}exports[_0xdf90('0x2d')]=function(_0x151213,_0x37afd1){var _0x40b843={},_0x19e899={},_0x46c8a0={'count':0x0,'rows':[]};var _0x51d7c6=_[_0xdf90('0x2e')](db[_0xdf90('0x2f')][_0xdf90('0x30')],function(_0x35304a){return{'name':_0x35304a['fieldName'],'type':_0x35304a[_0xdf90('0x31')][_0xdf90('0x32')]};});_0x19e899[_0xdf90('0x33')]=_[_0xdf90('0x2e')](_0x51d7c6,_0xdf90('0x2b'));_0x19e899[_0xdf90('0x34')]=_[_0xdf90('0x35')](_0x151213[_0xdf90('0x34')]);_0x19e899[_0xdf90('0x36')]=_[_0xdf90('0x37')](_0x19e899[_0xdf90('0x33')],_0x19e899[_0xdf90('0x34')]);_0x40b843['attributes']=_['intersection'](_0x19e899[_0xdf90('0x33')],qs[_0xdf90('0x38')](_0x151213[_0xdf90('0x34')][_0xdf90('0x38')]));_0x40b843[_0xdf90('0x39')]=_0x40b843['attributes'][_0xdf90('0x3a')]?_0x40b843[_0xdf90('0x39')]:_0x19e899['model'];if(!_0x151213[_0xdf90('0x34')]['hasOwnProperty'](_0xdf90('0x3b'))){_0x40b843[_0xdf90('0x1d')]=qs['limit'](_0x151213[_0xdf90('0x34')][_0xdf90('0x1d')]);_0x40b843[_0xdf90('0x1b')]=qs[_0xdf90('0x1b')](_0x151213[_0xdf90('0x34')][_0xdf90('0x1b')]);}_0x40b843[_0xdf90('0x3c')]=qs[_0xdf90('0x3d')](_0x151213['query'][_0xdf90('0x3d')]);_0x40b843[_0xdf90('0x3e')]=qs[_0xdf90('0x36')](_[_0xdf90('0x3f')](_0x151213[_0xdf90('0x34')],_0x19e899[_0xdf90('0x36')]),_0x51d7c6);if(_0x151213['query'][_0xdf90('0x40')]){_0x40b843[_0xdf90('0x3e')]=_[_0xdf90('0x41')](_0x40b843[_0xdf90('0x3e')],{'$or':_[_0xdf90('0x2e')](_0x51d7c6,function(_0x4da663){if(_0x4da663[_0xdf90('0x31')]!==_0xdf90('0x42')){var _0x2226ab={};_0x2226ab[_0x4da663[_0xdf90('0x2b')]]={'$like':'%'+_0x151213[_0xdf90('0x34')]['filter']+'%'};return _0x2226ab;}})});}_0x40b843=_[_0xdf90('0x41')]({},_0x40b843,_0x151213['options']);var _0x276ac4={'where':_0x40b843[_0xdf90('0x3e')]};return db[_0xdf90('0x2f')][_0xdf90('0x43')](_0x276ac4)[_0xdf90('0x24')](function(_0x1a186c){_0x46c8a0[_0xdf90('0x43')]=_0x1a186c;if(_0x151213[_0xdf90('0x34')][_0xdf90('0x44')]){_0x40b843[_0xdf90('0x45')]=[{'all':!![]}];}return db['Pause'][_0xdf90('0x46')](_0x40b843);})[_0xdf90('0x24')](function(_0x378f53){_0x46c8a0[_0xdf90('0x47')]=_0x378f53;return _0x46c8a0;})[_0xdf90('0x24')](respondWithFilteredResult(_0x37afd1,_0x40b843))[_0xdf90('0x48')](handleError(_0x37afd1,null));};exports[_0xdf90('0x49')]=function(_0x5291f4,_0x58c7a1){var _0x5d20c0={'raw':!![],'where':{'id':_0x5291f4[_0xdf90('0x4a')]['id']}},_0x5e45d1={};_0x5e45d1[_0xdf90('0x33')]=_[_0xdf90('0x35')](db[_0xdf90('0x2f')][_0xdf90('0x30')]);_0x5e45d1[_0xdf90('0x34')]=_[_0xdf90('0x35')](_0x5291f4[_0xdf90('0x34')]);_0x5e45d1[_0xdf90('0x36')]=_[_0xdf90('0x37')](_0x5e45d1[_0xdf90('0x33')],_0x5e45d1[_0xdf90('0x34')]);_0x5d20c0[_0xdf90('0x39')]=_['intersection'](_0x5e45d1[_0xdf90('0x33')],qs['fields'](_0x5291f4[_0xdf90('0x34')]['fields']));_0x5d20c0[_0xdf90('0x39')]=_0x5d20c0[_0xdf90('0x39')][_0xdf90('0x3a')]?_0x5d20c0[_0xdf90('0x39')]:_0x5e45d1[_0xdf90('0x33')];if(_0x5291f4[_0xdf90('0x34')][_0xdf90('0x44')]){_0x5d20c0[_0xdf90('0x45')]=[{'all':!![]}];}_0x5d20c0=_['merge']({},_0x5d20c0,_0x5291f4[_0xdf90('0x4b')]);return db[_0xdf90('0x2f')][_0xdf90('0x4c')](_0x5d20c0)[_0xdf90('0x24')](handleEntityNotFound(_0x58c7a1,null))[_0xdf90('0x24')](respondWithResult(_0x58c7a1,null))['catch'](handleError(_0x58c7a1,null));};exports[_0xdf90('0x4d')]=function(_0x574217,_0xff3090){return db[_0xdf90('0x2f')][_0xdf90('0x4d')](_0x574217[_0xdf90('0x4e')],{})[_0xdf90('0x24')](function(_0x403ca9){var _0x40a3ad=_0x574217[_0xdf90('0x4f')][_0xdf90('0x26')]({'plain':!![]});if(!_0x40a3ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a3ad[_0xdf90('0x50')]===_0xdf90('0x4f')){var _0x1a16ec=_0x403ca9[_0xdf90('0x26')]({'plain':!![]});var _0x18e0fd=_0xdf90('0x27');return db['UserProfileSection'][_0xdf90('0x4c')]({'where':{'name':_0x18e0fd,'userProfileId':_0x40a3ad['userProfileId']},'raw':!![]})[_0xdf90('0x24')](function(_0x25bc95){if(_0x25bc95&&_0x25bc95[_0xdf90('0x51')]===0x0){return db['UserProfileResource'][_0xdf90('0x4d')]({'name':_0x1a16ec[_0xdf90('0x2b')],'resourceId':_0x1a16ec['id'],'type':_0x25bc95[_0xdf90('0x2b')],'sectionId':_0x25bc95['id']},{})['then'](function(){return _0x403ca9;});}else{return _0x403ca9;}})[_0xdf90('0x48')](function(_0x32f12a){logger[_0xdf90('0x29')](_0xdf90('0x52'),_0x32f12a);throw _0x32f12a;});}return _0x403ca9;})[_0xdf90('0x24')](respondWithResult(_0xff3090,0xc9))[_0xdf90('0x48')](handleError(_0xff3090,null));};exports[_0xdf90('0x23')]=function(_0x120b44,_0x2392e1){if(_0x120b44[_0xdf90('0x4e')]['id']){delete _0x120b44[_0xdf90('0x4e')]['id'];}return db[_0xdf90('0x2f')][_0xdf90('0x4c')]({'where':{'id':_0x120b44['params']['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x2392e1,null))['then'](saveUpdates(_0x120b44[_0xdf90('0x4e')],null))['then'](respondWithResult(_0x2392e1,null))[_0xdf90('0x48')](handleError(_0x2392e1,null));};exports['destroy']=function(_0x701d3d,_0x1ec033){return db['Pause']['find']({'where':{'id':_0x701d3d[_0xdf90('0x4a')]['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x1ec033,null))['then'](removeEntity(_0x1ec033,null))['catch'](handleError(_0x1ec033,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 16e7fa7..28b5721 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./pause.attributes','exports','define','tools_pauses','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x55ca,0x126));var _0xa55c=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0x55ca[_0x13e724];return _0x334a44;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Pause',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x518020,_0xa81a23){var _0x3ea8ac=function(_0x547a71){while(--_0x547a71){_0x518020['push'](_0x518020['shift']());}};_0x3ea8ac(++_0xa81a23);}(_0xe14b,0x93));var _0xbe14=function(_0x41fccd,_0xf2588d){_0x41fccd=_0x41fccd-0x0;var _0x3d9bba=_0xe14b[_0x41fccd];return _0x3d9bba;};'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/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 2247a6e..a306f49 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x568bd4,_0x17cfd8){var _0x3def0e=function(_0x3b76b9){while(--_0x3b76b9){_0x568bd4['push'](_0x568bd4['shift']());}};_0x3def0e(++_0x17cfd8);}(_0xb10b,0x12a));var _0xbb10=function(_0x561195,_0x1f9dec){_0x561195=_0x561195-0x0;var _0x5c87c3=_0xb10b[_0x561195];return _0x5c87c3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x302e2a,_0x308bfb){var _0x3c5353=function(_0x5eb606){while(--_0x5eb606){_0x302e2a['push'](_0x302e2a['shift']());}};_0x3c5353(++_0x308bfb);}(_0x7a54,0x106));var _0x47a5=function(_0x59d90a,_0x3254a2){_0x59d90a=_0x59d90a-0x0;var _0x23f6ef=_0x7a54[_0x59d90a];return _0x23f6ef;};'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 f18e8ba..fb545fb 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 _0x4b84=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/webhook','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','upload','webhookPost','/:id','isAuthenticated','delete'];(function(_0x818500,_0xe7620c){var _0x342023=function(_0x17c939){while(--_0x17c939){_0x818500['push'](_0x818500['shift']());}};_0x342023(++_0xe7620c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0x4b84[_0x3a3b9e];return _0x148103;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),controller['webhookGet']);router[_0x44b8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0x8')](_0x44b8('0xa'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);var upload=multer({'storage':multer[_0x44b8('0xc')]({'destination':function(_0x4315f6,_0x9b6048,_0x24dd10){_0x24dd10(null,path[_0x44b8('0xd')](config[_0x44b8('0xe')],'server/files/plugins'));},'filename':function(_0x147529,_0x4301a6,_0x4bcc43){_0x4301a6[_0x44b8('0xf')]=_0x4301a6['originalname'][_0x44b8('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bcc43(null,util[_0x44b8('0x11')]('%s-%s%s',path[_0x44b8('0x12')](_0x4301a6['originalname'],path['extname'](_0x4301a6[_0x44b8('0xf')])),Date[_0x44b8('0x13')](),path[_0x44b8('0x14')](_0x4301a6[_0x44b8('0xf')])));}})});router['post']('/',upload['single']('file'),controller[_0x44b8('0x15')]);router['post'](_0x44b8('0x7'),controller[_0x44b8('0x16')]);router['put'](_0x44b8('0x17'),auth[_0x44b8('0x18')](),controller['update']);router[_0x44b8('0x19')](_0x44b8('0x17'),auth['isAuthenticated'](),controller[_0x44b8('0x19')]);module[_0x44b8('0x1a')]=router; \ No newline at end of file +var _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0x38c27e,_0x5982ba){var _0xc6a7f2=function(_0x7e5327){while(--_0x7e5327){_0x38c27e['push'](_0x38c27e['shift']());}};_0xc6a7f2(++_0x5982ba);}(_0x5c12,0x188));var _0x25c1=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0x5c12[_0x304b67];return _0x493afb;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3b418f0..b906989 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 _0x7fb4=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','ENUM','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','script','TEXT'];(function(_0x4d2092,_0x6b0ecb){var _0x1a1ff9=function(_0x2c546a){while(--_0x2c546a){_0x4d2092['push'](_0x4d2092['shift']());}};_0x1a1ff9(++_0x6b0ecb);}(_0x7fb4,0x1aa));var _0x47fb=function(_0x5264f0,_0x1781e5){_0x5264f0=_0x5264f0-0x0;var _0x148d2d=_0x7fb4[_0x5264f0];return _0x148d2d;};'use strict';var Sequelize=require(_0x47fb('0x0'));module['exports']={'name':{'type':Sequelize[_0x47fb('0x1')]},'type':{'type':Sequelize['ENUM']('html',_0x47fb('0x2'))},'description':{'type':Sequelize[_0x47fb('0x3')]},'version':{'type':Sequelize[_0x47fb('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0x47fb('0x4')},'active':{'type':Sequelize[_0x47fb('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x47fb('0x6')]('adminOnly','agentOnly',_0x47fb('0x7'),_0x47fb('0x8')),'defaultValue':_0x47fb('0x7'),'comment':_0x47fb('0x9')},'icon':{'type':Sequelize[_0x47fb('0x1')]},'adminUrl':{'type':Sequelize[_0x47fb('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x47fb('0x1')]},'scriptPath':{'type':Sequelize[_0x47fb('0x1')]}}; \ No newline at end of file +var _0xb462=['BOOLEAN','ENUM','adminOnly','agentOnly','always','never','STRING','sequelize','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x2cae28,_0x5c213b){var _0x28a7d6=function(_0x471946){while(--_0x471946){_0x2cae28['push'](_0x2cae28['shift']());}};_0x28a7d6(++_0x5c213b);}(_0xb462,0x187));var _0x2b46=function(_0x37cbfe,_0x3c898f){_0x37cbfe=_0x37cbfe-0x0;var _0x20c2a9=_0xb462[_0x37cbfe];return _0x20c2a9;};'use strict';var Sequelize=require(_0x2b46('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x2b46('0x1'),_0x2b46('0x2'))},'description':{'type':Sequelize[_0x2b46('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x2b46('0x4')},'active':{'type':Sequelize[_0x2b46('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x2b46('0x6')](_0x2b46('0x7'),_0x2b46('0x8'),_0x2b46('0x9'),_0x2b46('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x2b46('0xb')]},'agentUrl':{'type':Sequelize[_0x2b46('0xb')]},'scriptName':{'type':Sequelize[_0x2b46('0xb')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 88a1cd8..7ca2a20 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 _0x1f8c=['options','include','findAll','rows','catch','params','download','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0x1f8c,0x10f));var _0xc1f8=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x1f8c[_0x45313f];return _0x402910;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1f8('0x0'));var zipdir=require(_0xc1f8('0x1'));var jsonpatch=require(_0xc1f8('0x2'));var rp=require(_0xc1f8('0x3'));var moment=require(_0xc1f8('0x4'));var BPromise=require(_0xc1f8('0x5'));var Mustache=require(_0xc1f8('0x6'));var util=require(_0xc1f8('0x7'));var path=require(_0xc1f8('0x8'));var sox=require(_0xc1f8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1f8('0xa'));var _=require(_0xc1f8('0xb'));var squel=require('squel');var crypto=require(_0xc1f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc1f8('0xd'));var toCsv=require(_0xc1f8('0xe'));var querystring=require(_0xc1f8('0xf'));var Papa=require(_0xc1f8('0x10'));var extract=require(_0xc1f8('0x11'));var rimraf=require(_0xc1f8('0x0'));var archiver=require(_0xc1f8('0x12'));var Redis=require(_0xc1f8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc1f8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1f8('0x15'));var logger=require(_0xc1f8('0x16'))(_0xc1f8('0x17'));var utils=require(_0xc1f8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc1f8('0x19'));var db=require(_0xc1f8('0x1a'))['db'];config[_0xc1f8('0x1b')]=_[_0xc1f8('0x1c')](config[_0xc1f8('0x1b')],{'host':_0xc1f8('0x1d'),'port':0x18eb});var socket=require(_0xc1f8('0x1e'))(new Redis(config[_0xc1f8('0x1b')]));require('./plugin.socket')[_0xc1f8('0x1f')](socket);function respondWithStatusCode(_0x3907a1,_0x29905){_0x29905=_0x29905||0xcc;return function(_0x3ceada){if(_0x3ceada){return _0x3907a1[_0xc1f8('0x20')](_0x29905);}return _0x3907a1[_0xc1f8('0x21')](_0x29905)[_0xc1f8('0x22')]();};}function respondWithResult(_0x3f4f43,_0xaabaa8){_0xaabaa8=_0xaabaa8||0xc8;return function(_0x41a232){if(_0x41a232){return _0x3f4f43['status'](_0xaabaa8)['json'](_0x41a232);}};}function respondWithFilteredResult(_0x5d1c5d,_0x30b896){return function(_0x46c095){if(_0x46c095){var _0x114fa5=typeof _0x30b896[_0xc1f8('0x23')]==='undefined'&&typeof _0x30b896['limit']===_0xc1f8('0x24');var _0x189237=_0x46c095[_0xc1f8('0x25')];var _0x53e1fb=_0x114fa5?0x0:_0x30b896[_0xc1f8('0x23')];var _0x1968c3=_0x114fa5?_0x46c095['count']:_0x30b896['offset']+_0x30b896['limit'];var _0x4b67dc;if(_0x1968c3>=_0x189237){_0x1968c3=_0x189237;_0x4b67dc=0xc8;}else{_0x4b67dc=0xce;}_0x5d1c5d[_0xc1f8('0x21')](_0x4b67dc);return _0x5d1c5d[_0xc1f8('0x26')](_0xc1f8('0x27'),_0x53e1fb+'-'+_0x1968c3+'/'+_0x189237)[_0xc1f8('0x28')](_0x46c095);}return null;};}function patchUpdates(_0x533612){return function(_0x520e06){try{jsonpatch[_0xc1f8('0x29')](_0x520e06,_0x533612,!![]);}catch(_0x2cd3b3){return BPromise[_0xc1f8('0x2a')](_0x2cd3b3);}return _0x520e06[_0xc1f8('0x2b')]();};}function saveUpdates(_0x74365f,_0x29e6cc){return function(_0x4001dc){if(_0x4001dc){return _0x4001dc[_0xc1f8('0x2c')](_0x74365f)[_0xc1f8('0x2d')](function(_0x43548e){return _0x43548e;});}return null;};}function removeEntity(_0x257557,_0xbdc081){return function(_0x2b9d77){if(_0x2b9d77){return _0x2b9d77[_0xc1f8('0x2e')]()[_0xc1f8('0x2d')](function(){var _0x4cbf14=_0x2b9d77[_0xc1f8('0x2f')]({'plain':!![]});var _0x182081=_0xc1f8('0x30');return db[_0xc1f8('0x31')][_0xc1f8('0x2e')]({'where':{'type':_0x182081,'resourceId':_0x4cbf14['id']}})[_0xc1f8('0x2d')](function(){return _0x2b9d77;});})[_0xc1f8('0x2d')](function(){_0x257557[_0xc1f8('0x21')](0xcc)[_0xc1f8('0x22')]();});}};}function handleEntityNotFound(_0x449191,_0x324c6f){return function(_0x59c9fc){if(!_0x59c9fc){_0x449191['sendStatus'](0x194);}return _0x59c9fc;};}function handleError(_0x12c729,_0x2c0114){_0x2c0114=_0x2c0114||0x1f4;return function(_0x13f121){logger['error'](_0x13f121['stack']);if(_0x13f121[_0xc1f8('0x32')]){delete _0x13f121[_0xc1f8('0x32')];}_0x12c729[_0xc1f8('0x21')](_0x2c0114)['send'](_0x13f121);};}exports[_0xc1f8('0x33')]=function(_0x575433,_0x9d68c0){var _0x343130={},_0x1e74a5={},_0x5a4f32={'count':0x0,'rows':[]};var _0x171caf=_[_0xc1f8('0x34')](db[_0xc1f8('0x35')][_0xc1f8('0x36')],function(_0x135558){return{'name':_0x135558[_0xc1f8('0x37')],'type':_0x135558[_0xc1f8('0x38')][_0xc1f8('0x39')]};});_0x1e74a5[_0xc1f8('0x3a')]=_['map'](_0x171caf,_0xc1f8('0x32'));_0x1e74a5['query']=_[_0xc1f8('0x3b')](_0x575433[_0xc1f8('0x3c')]);_0x1e74a5[_0xc1f8('0x3d')]=_[_0xc1f8('0x3e')](_0x1e74a5['model'],_0x1e74a5[_0xc1f8('0x3c')]);_0x343130[_0xc1f8('0x3f')]=_[_0xc1f8('0x3e')](_0x1e74a5[_0xc1f8('0x3a')],qs[_0xc1f8('0x40')](_0x575433['query'][_0xc1f8('0x40')]));_0x343130[_0xc1f8('0x3f')]=_0x343130[_0xc1f8('0x3f')][_0xc1f8('0x41')]?_0x343130[_0xc1f8('0x3f')]:_0x1e74a5[_0xc1f8('0x3a')];if(!_0x575433['query'][_0xc1f8('0x42')](_0xc1f8('0x43'))){_0x343130[_0xc1f8('0x44')]=qs[_0xc1f8('0x44')](_0x575433[_0xc1f8('0x3c')][_0xc1f8('0x44')]);_0x343130[_0xc1f8('0x23')]=qs['offset'](_0x575433[_0xc1f8('0x3c')][_0xc1f8('0x23')]);}_0x343130['order']=qs[_0xc1f8('0x45')](_0x575433[_0xc1f8('0x3c')]['sort']);_0x343130[_0xc1f8('0x46')]=qs['filters'](_[_0xc1f8('0x47')](_0x575433[_0xc1f8('0x3c')],_0x1e74a5['filters']),_0x171caf);if(_0x575433[_0xc1f8('0x3c')][_0xc1f8('0x48')]){_0x343130[_0xc1f8('0x46')]=_[_0xc1f8('0x49')](_0x343130[_0xc1f8('0x46')],{'$or':_[_0xc1f8('0x34')](_0x171caf,function(_0x388153){if(_0x388153[_0xc1f8('0x38')]!==_0xc1f8('0x4a')){var _0x141318={};_0x141318[_0x388153[_0xc1f8('0x32')]]={'$like':'%'+_0x575433['query'][_0xc1f8('0x48')]+'%'};return _0x141318;}})});}_0x343130=_[_0xc1f8('0x49')]({},_0x343130,_0x575433[_0xc1f8('0x4b')]);var _0x96b6cd={'where':_0x343130[_0xc1f8('0x46')]};return db[_0xc1f8('0x35')]['count'](_0x96b6cd)[_0xc1f8('0x2d')](function(_0x556299){_0x5a4f32[_0xc1f8('0x25')]=_0x556299;if(_0x575433[_0xc1f8('0x3c')]['includeAll']){_0x343130[_0xc1f8('0x4c')]=[{'all':!![]}];}return db[_0xc1f8('0x35')][_0xc1f8('0x4d')](_0x343130);})['then'](function(_0x41f37e){_0x5a4f32[_0xc1f8('0x4e')]=_0x41f37e;return _0x5a4f32;})['then'](respondWithFilteredResult(_0x9d68c0,_0x343130))[_0xc1f8('0x4f')](handleError(_0x9d68c0,null));};exports['show']=function(_0x537dfc,_0x305e43){var _0x150c14={'raw':!![],'where':{'id':_0x537dfc[_0xc1f8('0x50')]['id']}},_0x1474e5={};_0x1474e5[_0xc1f8('0x3a')]=_['keys'](db['Plugin'][_0xc1f8('0x36')]);_0x1474e5[_0xc1f8('0x3c')]=_[_0xc1f8('0x3b')](_0x537dfc[_0xc1f8('0x3c')]);_0x1474e5[_0xc1f8('0x3d')]=_[_0xc1f8('0x3e')](_0x1474e5['model'],_0x1474e5['query']);_0x150c14[_0xc1f8('0x3f')]=_[_0xc1f8('0x3e')](_0x1474e5[_0xc1f8('0x3a')],qs[_0xc1f8('0x40')](_0x537dfc[_0xc1f8('0x3c')]['fields']));_0x150c14[_0xc1f8('0x3f')]=_0x150c14[_0xc1f8('0x3f')][_0xc1f8('0x41')]?_0x150c14['attributes']:_0x1474e5[_0xc1f8('0x3a')];if(_0x537dfc[_0xc1f8('0x3c')]['includeAll']){_0x150c14[_0xc1f8('0x4c')]=[{'all':!![]}];}_0x150c14=_[_0xc1f8('0x49')]({},_0x150c14,_0x537dfc[_0xc1f8('0x4b')]);return db[_0xc1f8('0x35')]['find'](_0x150c14)[_0xc1f8('0x2d')](handleEntityNotFound(_0x305e43,null))[_0xc1f8('0x2d')](respondWithResult(_0x305e43,null))[_0xc1f8('0x4f')](handleError(_0x305e43,null));};exports[_0xc1f8('0x51')]=function(_0x40163a,_0x4dde79,_0x34f87f){return db[_0xc1f8('0x35')][_0xc1f8('0x52')]({'where':{'id':_0x40163a[_0xc1f8('0x50')]['id']},'attributes':['name',_0xc1f8('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x4dde79,null))[_0xc1f8('0x2d')](function(_0x3471e3){if(_0x3471e3){var _0x43c96a=path[_0xc1f8('0x53')](config['root'],_0xc1f8('0x54'),util[_0xc1f8('0x55')](_0xc1f8('0x56'),path[_0xc1f8('0x57')](_0x3471e3[_0xc1f8('0x8')])));var _0x5d8a5e=fs[_0xc1f8('0x58')](_0x43c96a);var _0x42e6ee=archiver(_0xc1f8('0x59'),{'zlib':{'level':0x9}});_0x42e6ee['on'](_0xc1f8('0x5a'),function(_0x2ef036){if(_0x2ef036[_0xc1f8('0x5b')]===_0xc1f8('0x5c')){logger[_0xc1f8('0x5d')](_0x2ef036);}else{throw new db[(_0xc1f8('0x5e'))]['Error'](_0xc1f8('0x5f'));}});_0x42e6ee['on'](_0xc1f8('0x5d'),function(_0x3a456a){throw new db['Sequelize'][(_0xc1f8('0x60'))](_0xc1f8('0x5f'));});_0x42e6ee['pipe'](_0x5d8a5e);_0x42e6ee[_0xc1f8('0x61')](_0xc1f8('0x62'),{'cwd':path[_0xc1f8('0x53')](config['root'],_0xc1f8('0x54'),path['dirname'](_0x3471e3[_0xc1f8('0x8')])),'ignore':[path[_0xc1f8('0x53')](path[_0xc1f8('0x57')](_0x3471e3[_0xc1f8('0x8')]),'node_modules/**/*'),path[_0xc1f8('0x53')](path['basename'](_0x3471e3[_0xc1f8('0x8')]),'attachments/**/*')],'nodir':!![]})[_0xc1f8('0x63')]();_0x5d8a5e['on'](_0xc1f8('0x64'),function(){if(!fs['existsSync'](_0x43c96a)){throw new db[(_0xc1f8('0x5e'))]['Error'](_0xc1f8('0x65'));}return _0x4dde79['download'](_0x43c96a,util['format'](_0xc1f8('0x56'),path['basename'](_0x3471e3[_0xc1f8('0x8')])),function(_0x47a4db){if(_0x47a4db){throw new db[(_0xc1f8('0x5e'))][(_0xc1f8('0x60'))](_0xc1f8('0x66'));}fs[_0xc1f8('0x67')](_0x43c96a);logger[_0xc1f8('0x68')](_0xc1f8('0x69'));logger[_0xc1f8('0x68')](_0xc1f8('0x6a'));});});}return null;})[_0xc1f8('0x4f')](handleError(_0x4dde79,null));};exports[_0xc1f8('0x6b')]=function(_0x1d8a11,_0x470036,_0x1915ca){var _0x1fa3f2=path[_0xc1f8('0x57')](_0x1d8a11[_0xc1f8('0x6c')][_0xc1f8('0x6d')],path[_0xc1f8('0x6e')](_0x1d8a11[_0xc1f8('0x6c')][_0xc1f8('0x6d')]));var _0x528766=path[_0xc1f8('0x53')](config[_0xc1f8('0x6f')],_0xc1f8('0x54'),_0x1d8a11['file'][_0xc1f8('0x6d')]);var _0x27e7eb=path[_0xc1f8('0x53')](config[_0xc1f8('0x6f')],'server/files/plugins',_0x1fa3f2);logger[_0xc1f8('0x68')](_0xc1f8('0x70'),_0x528766);logger[_0xc1f8('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x27e7eb);try{fs[_0xc1f8('0x71')](_0x528766,parseInt(_0xc1f8('0x72'),0x8));extract(_0x528766,{'dir':_0x27e7eb},function(_0x42fff4){if(_0x42fff4){logger[_0xc1f8('0x5d')](_0x42fff4);handleError(_0x42fff4,!![]);};var _0x4cd8b7=fs[_0xc1f8('0x73')](_0x27e7eb);if(_0x4cd8b7['length']>0x1){removeReferences(_0x528766,_0x27e7eb);logger[_0xc1f8('0x5d')](_0xc1f8('0x74'));return _0x1915ca(new Error('Invalid\x20plugin\x20structure'));}var _0x12ff07=fs[_0xc1f8('0x75')](path['join'](_0x27e7eb,_0x4cd8b7[0x0]));if(_0x12ff07['isFile']()){removeReferences(_0x528766,_0x27e7eb);logger['error'](_0xc1f8('0x74'));return _0x1915ca(new Error(_0xc1f8('0x74')));}if(_0x12ff07[_0xc1f8('0x76')]()){var _0x1f2003=fs[_0xc1f8('0x73')](path[_0xc1f8('0x53')](_0x27e7eb,_0x4cd8b7[0x0]));if(_0x1f2003['length']===0x0){removeReferences(_0x528766,_0x27e7eb);logger[_0xc1f8('0x5d')](_0xc1f8('0x74'));return _0x1915ca(new Error(_0xc1f8('0x74')));}var _0x5e5061=_0x1f2003[_0xc1f8('0x77')](function(_0x3670af){return _0x3670af===_0xc1f8('0x78');});if(!_0x5e5061){return _0x1915ca(new Error(_0xc1f8('0x79')));}var _0xdd6a05=fs[_0xc1f8('0x7a')](path[_0xc1f8('0x53')](_0x27e7eb,_0x4cd8b7[0x0],_0xc1f8('0x78')));var _0x32e62f=JSON[_0xc1f8('0x7b')](_0xdd6a05);if('undefined'==typeof _0x32e62f[_0xc1f8('0x32')]){return _0x1915ca(new Error(_0xc1f8('0x7c')));}if(_0xc1f8('0x24')==typeof _0x32e62f[_0xc1f8('0x38')]){return _0x1915ca(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x32e62f[_0xc1f8('0x7d')]){return _0x1915ca(new Error(_0xc1f8('0x7e')));}if('undefined'==typeof _0x32e62f[_0xc1f8('0x7f')]){return _0x1915ca(new Error(_0xc1f8('0x80')));}if(_0x32e62f[_0xc1f8('0x38')]===_0xc1f8('0x81')){if('undefined'==typeof _0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x82')]){return _0x1915ca(new Error(_0xc1f8('0x83')));}if(_0xc1f8('0x24')==typeof _0x32e62f[_0xc1f8('0x7f')]['views']['admin']&&_0xc1f8('0x24')==typeof _0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x82')][_0xc1f8('0x84')]){return _0x1915ca(new Error(_0xc1f8('0x85')));}}else if(_0x32e62f['type']===_0xc1f8('0x86')){if(_0xc1f8('0x24')==typeof _0x32e62f['parameters'][_0xc1f8('0x87')]){return _0x1915ca(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xc1f8('0x24')==typeof _0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x88')]){return _0x1915ca(new Error(_0xc1f8('0x89')));}}else{return _0x1915ca(new Error(_0xc1f8('0x8a')));}var _0x105bd7=_0x32e62f[_0xc1f8('0x32')];var _0x1780f7=_0x32e62f[_0xc1f8('0x8b')];var _0x12fa7e=_0x32e62f['type'];var _0x2224f4=_0x32e62f[_0xc1f8('0x8c')]?_0x32e62f[_0xc1f8('0x8c')]:_0xc1f8('0x8d');var _0x479443=_0x32e62f[_0xc1f8('0x8e')]?_0x32e62f[_0xc1f8('0x8e')]:_0xc1f8('0x8f');var _0x1b5597='';var _0x1600e3='';var _0x5b056d='';var _0x47694c='';var _0x6babd9=_0x32e62f[_0xc1f8('0x7d')];if(_0x12fa7e===_0xc1f8('0x81')){if(_0xc1f8('0x24')!=typeof _0x32e62f['parameters'][_0xc1f8('0x82')][_0xc1f8('0x90')]){var _0x3669c7=_0x32e62f['parameters'][_0xc1f8('0x82')][_0xc1f8('0x90')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3669c7)){_0x1b5597=path[_0xc1f8('0x53')](_0xc1f8('0x91'),_0x1fa3f2,_0x4cd8b7[0x0],_0x3669c7);}else{_0x1b5597=_0x3669c7;}}else{logger[_0xc1f8('0x68')](_0xc1f8('0x92'));}if(_0xc1f8('0x24')!=typeof _0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x82')][_0xc1f8('0x84')]){var _0x3f9c24=_0x32e62f[_0xc1f8('0x7f')]['views'][_0xc1f8('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xc1f8('0x93')](_0x3f9c24)){_0x1600e3=path[_0xc1f8('0x53')](_0xc1f8('0x91'),_0x1fa3f2,_0x4cd8b7[0x0],_0x3f9c24);}else{_0x1600e3=_0x3f9c24;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x12fa7e===_0xc1f8('0x86')){_0x5b056d=_0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x87')];_0x47694c=_0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x88')];if(_0xc1f8('0x24')!=typeof _0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x82')]){if(_0xc1f8('0x24')!=typeof _0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x82')][_0xc1f8('0x90')]){var _0x3669c7=_0x32e62f[_0xc1f8('0x7f')]['views'][_0xc1f8('0x90')];if(!/^(f|ht)tps?:\/\//i[_0xc1f8('0x93')](_0x3669c7)){_0x1b5597=path[_0xc1f8('0x53')](_0xc1f8('0x91'),_0x1fa3f2,_0x4cd8b7[0x0],_0x3669c7);}else{_0x1b5597=_0x3669c7;}}if('undefined'!=typeof _0x32e62f[_0xc1f8('0x7f')]['views'][_0xc1f8('0x84')]){var _0x3f9c24=_0x32e62f[_0xc1f8('0x7f')][_0xc1f8('0x82')][_0xc1f8('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xc1f8('0x93')](_0x3f9c24)){_0x1600e3=path[_0xc1f8('0x53')](_0xc1f8('0x91'),_0x1fa3f2,_0x4cd8b7[0x0],_0x3f9c24);}else{_0x1600e3=_0x3f9c24;}}}}var _0x56fd13={'name':_0x105bd7,'description':_0x1780f7,'path':path[_0xc1f8('0x53')](_0x1fa3f2,_0x4cd8b7[0x0]),'type':_0x12fa7e,'sidebar':_0x2224f4,'icon':_0x479443,'adminUrl':_0x1b5597,'agentUrl':_0x1600e3,'scriptName':_0x5b056d,'scriptPath':_0x47694c,'version':_0x6babd9};removeReferences(_0x528766,null);return db['Plugin']['create'](_0x56fd13)[_0xc1f8('0x2d')](function(_0x139f01){var _0x27823c={'role':_0x1d8a11[_0xc1f8('0x94')][_0xc1f8('0x95')],'userProfileId':_0x1d8a11['body'][_0xc1f8('0x96')]};if(!_0x27823c)throw new Error(_0xc1f8('0x97'));if(_0x27823c['role']==='user'){var _0x5988ed=_0x139f01[_0xc1f8('0x2f')]({'plain':!![]});return db[_0xc1f8('0x98')][_0xc1f8('0x52')]({'where':{'name':_0xc1f8('0x30'),'userProfileId':_0x27823c[_0xc1f8('0x96')]},'raw':!![]})[_0xc1f8('0x2d')](function(_0x574b0b){if(_0x574b0b&&_0x574b0b[_0xc1f8('0x99')]===0x0){return db[_0xc1f8('0x31')][_0xc1f8('0x9a')]({'name':_0x5988ed[_0xc1f8('0x32')],'resourceId':_0x5988ed['id'],'type':_0x574b0b[_0xc1f8('0x32')],'sectionId':_0x574b0b['id']},{})[_0xc1f8('0x2d')](function(){return _0x139f01;});}else{return _0x139f01;}})['catch'](function(_0x217ac8){logger[_0xc1f8('0x5d')](_0xc1f8('0x9b'),_0x217ac8);throw _0x217ac8;});}return _0x139f01;})[_0xc1f8('0x2d')](respondWithResult(_0x470036,null))[_0xc1f8('0x4f')](handleError(_0x470036,null));}});}catch(_0x4443fc){_0x470036[_0xc1f8('0x21')](0x1f4)['send'](_0x4443fc);}};function removeReferences(_0x2a9506,_0x227a9c){try{if(_0x2a9506){fs[_0xc1f8('0x67')](_0x2a9506);logger[_0xc1f8('0x68')](_0xc1f8('0x9c'));}if(_0x227a9c){rimraf(_0x227a9c,function(){});logger[_0xc1f8('0x68')](_0xc1f8('0x9d'));}}catch(_0x20592d){logger[_0xc1f8('0x5d')](_0x20592d);}}exports[_0xc1f8('0x2c')]=function(_0x4d1676,_0x265951,_0x4db0ff){return db[_0xc1f8('0x35')][_0xc1f8('0x52')]({'where':{'id':_0x4d1676[_0xc1f8('0x50')]['id']}})['then'](handleEntityNotFound(_0x265951,null))[_0xc1f8('0x2d')](saveUpdates(_0x4d1676['body'],null))[_0xc1f8('0x2d')](respondWithResult(_0x265951,null))[_0xc1f8('0x4f')](handleError(_0x265951,null));};exports['delete']=function(_0x48f834,_0x478cdf,_0x299f84){return db['Plugin'][_0xc1f8('0x52')]({'where':{'id':_0x48f834[_0xc1f8('0x50')]['id']}})[_0xc1f8('0x2d')](function(_0xa8a203){if(_0xa8a203){return _0xa8a203[_0xc1f8('0x2e')]();}})['then'](function(_0x1ccd58){rimraf(path[_0xc1f8('0x53')](config[_0xc1f8('0x6f')],_0xc1f8('0x54'),path[_0xc1f8('0x9e')](_0x1ccd58['path'])),function(){});return _0x1ccd58;})['then'](handleEntityNotFound(_0x478cdf,null))[_0xc1f8('0x2d')](respondWithStatusCode(_0x478cdf,null))['catch'](handleError(_0x478cdf,null));};exports['webhookGet']=function(_0xa26132,_0x4b0c40,_0xb91637){return BPromise[_0xc1f8('0x9f')]()[_0xc1f8('0x2d')](function(){if(!_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0x8')]){throw new Error(_0xc1f8('0xa0'));}if(!_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x42fa2a=_0xa26132[_0xc1f8('0x3c')]['hostname']?_0xa26132['query'][_0xc1f8('0xa2')]+':'+_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0xa1')]:_0xc1f8('0xa3')+_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0xa1')];var _0x12bafd=_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0x28')]?_0xa26132['query'][_0xc1f8('0x28')]:!![];var _0x45a407=_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0xa4')]?_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0xa4')]:null;var _0x2e8740={'method':_0xa26132[_0xc1f8('0xa5')],'uri':util[_0xc1f8('0x55')](_0xc1f8('0xa6'),_0x42fa2a,_0xa26132['query'][_0xc1f8('0x8')]),'json':_0x12bafd,'resolveWithFullResponse':!![],'encoding':_0x45a407,'qs':_0xa26132['query']};if(_0xa26132[_0xc1f8('0xa7')]){_0x2e8740[_0xc1f8('0xa7')]=_0xa26132[_0xc1f8('0xa7')];if(_0x2e8740[_0xc1f8('0xa7')][_0xc1f8('0xa8')]){delete _0x2e8740[_0xc1f8('0xa7')][_0xc1f8('0xa8')];}}if(_0x2e8740[_0xc1f8('0xa7')][_0xc1f8('0xa9')]){delete _0x2e8740[_0xc1f8('0xa7')]['content-type'];}return rp(_0x2e8740);})[_0xc1f8('0x2d')](function(_0x559a92){if(_0x559a92){_0x4b0c40['set'](_0x559a92['headers']);logger[_0xc1f8('0x68')](_0x559a92[_0xc1f8('0x94')]);if(_[_0xc1f8('0xaa')](_0xa26132[_0xc1f8('0x3c')][_0xc1f8('0x8')],'download')&&_0x559a92[_0xc1f8('0xab')]==0x1f4){return _0x4b0c40[_0xc1f8('0x20')](_0x559a92[_0xc1f8('0xab')]);}else{return _0x4b0c40['status'](_0x559a92[_0xc1f8('0xab')])[_0xc1f8('0xac')](_0x559a92[_0xc1f8('0x94')]);}}else{return _0x4b0c40[_0xc1f8('0x20')](0xc8);}})[_0xc1f8('0x4f')](handleError(_0x4b0c40,null));};exports['webhookPost']=function(_0x793fec,_0x4f8565,_0x4a932e){return BPromise['resolve']()[_0xc1f8('0x2d')](function(){if(!_0x793fec['query'][_0xc1f8('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x793fec[_0xc1f8('0x3c')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x326c55=_0x793fec['query'][_0xc1f8('0xa2')]?_0x793fec['query'][_0xc1f8('0xa2')]+':'+_0x793fec['query'][_0xc1f8('0xa1')]:'http://localhost:'+_0x793fec[_0xc1f8('0x3c')][_0xc1f8('0xa1')];var _0xc10222=_0x793fec['query'][_0xc1f8('0x28')]?_0x793fec[_0xc1f8('0x3c')]['json']:!![];var _0x20edbb=_0x793fec[_0xc1f8('0x3c')][_0xc1f8('0xa4')]?_0x793fec[_0xc1f8('0x3c')]['encoding']:null;var _0x55ce5b={'method':_0x793fec[_0xc1f8('0xa5')],'uri':util['format']('%s%s',_0x326c55,_0x793fec[_0xc1f8('0x3c')]['path']),'json':_0xc10222,'resolveWithFullResponse':!![],'encoding':_0x20edbb,'body':_0x793fec[_0xc1f8('0x94')]};if(_0x793fec[_0xc1f8('0xa7')]){_0x55ce5b['headers']=_0x793fec[_0xc1f8('0xa7')];if(_0x55ce5b['headers'][_0xc1f8('0xa8')]){delete _0x55ce5b[_0xc1f8('0xa7')][_0xc1f8('0xa8')];}}if(_0x55ce5b['headers']['content-type']){delete _0x55ce5b[_0xc1f8('0xa7')]['content-type'];}return rp(_0x55ce5b);})[_0xc1f8('0x2d')](function(_0xd87957){if(_0xd87957){_0x4f8565['set'](_0xd87957[_0xc1f8('0xa7')]);logger[_0xc1f8('0x68')](_0xd87957[_0xc1f8('0x94')]);return _0x4f8565[_0xc1f8('0x21')](_0xd87957[_0xc1f8('0xab')])[_0xc1f8('0xac')](_0xd87957[_0xc1f8('0x94')]);}else{return _0x4f8565[_0xc1f8('0x20')](0xc8);}})[_0xc1f8('0x4f')](handleError(_0x4f8565,null));}; \ No newline at end of file +var _0x4cfb=['then','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','filter','options','count','includeAll','Plugin','findAll','rows','catch','show','params','intersection','include','find','download','join','root','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','format','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','server/files/plugins','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','json','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x4cfb,0x1c5));var _0xb4cf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4cfb[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4cf('0x0'));var zipdir=require(_0xb4cf('0x1'));var jsonpatch=require(_0xb4cf('0x2'));var rp=require(_0xb4cf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb4cf('0x4'));var sox=require(_0xb4cf('0x5'));var csv=require(_0xb4cf('0x6'));var ejs=require(_0xb4cf('0x7'));var fs=require('fs');var fs_extra=require(_0xb4cf('0x8'));var _=require(_0xb4cf('0x9'));var squel=require('squel');var crypto=require(_0xb4cf('0xa'));var jsforce=require(_0xb4cf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb4cf('0x6'));var querystring=require('querystring');var Papa=require(_0xb4cf('0xc'));var extract=require(_0xb4cf('0xd'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xb4cf('0xe'));var authService=require(_0xb4cf('0xf'));var qs=require(_0xb4cf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4cf('0x11'));var logger=require(_0xb4cf('0x12'))('api');var utils=require(_0xb4cf('0x13'));var config=require(_0xb4cf('0x14'));var licenseUtil=require(_0xb4cf('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb4cf('0x16')](config[_0xb4cf('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4cf('0x18'))(new Redis(config['redis']));require(_0xb4cf('0x19'))[_0xb4cf('0x1a')](socket);function respondWithStatusCode(_0x5138a6,_0x3b2bf0){_0x3b2bf0=_0x3b2bf0||0xcc;return function(_0xaf6fa5){if(_0xaf6fa5){return _0x5138a6[_0xb4cf('0x1b')](_0x3b2bf0);}return _0x5138a6['status'](_0x3b2bf0)['end']();};}function respondWithResult(_0x46653f,_0x3375c3){_0x3375c3=_0x3375c3||0xc8;return function(_0x4a78dc){if(_0x4a78dc){return _0x46653f[_0xb4cf('0x1c')](_0x3375c3)['json'](_0x4a78dc);}};}function respondWithFilteredResult(_0x1b579e,_0x8a5a38){return function(_0x280be6){if(_0x280be6){var _0x260907=typeof _0x8a5a38[_0xb4cf('0x1d')]===_0xb4cf('0x1e')&&typeof _0x8a5a38[_0xb4cf('0x1f')]===_0xb4cf('0x1e');var _0xa6494b=_0x280be6['count'];var _0x4aa357=_0x260907?0x0:_0x8a5a38['offset'];var _0x34ac88=_0x260907?_0x280be6['count']:_0x8a5a38[_0xb4cf('0x1d')]+_0x8a5a38[_0xb4cf('0x1f')];var _0x485472;if(_0x34ac88>=_0xa6494b){_0x34ac88=_0xa6494b;_0x485472=0xc8;}else{_0x485472=0xce;}_0x1b579e[_0xb4cf('0x1c')](_0x485472);return _0x1b579e[_0xb4cf('0x20')](_0xb4cf('0x21'),_0x4aa357+'-'+_0x34ac88+'/'+_0xa6494b)['json'](_0x280be6);}return null;};}function patchUpdates(_0xcea52c){return function(_0x4b03fb){try{jsonpatch[_0xb4cf('0x22')](_0x4b03fb,_0xcea52c,!![]);}catch(_0x5ca9b3){return BPromise[_0xb4cf('0x23')](_0x5ca9b3);}return _0x4b03fb[_0xb4cf('0x24')]();};}function saveUpdates(_0x3e4093,_0x5c0afd){return function(_0x2ab903){if(_0x2ab903){return _0x2ab903[_0xb4cf('0x25')](_0x3e4093)['then'](function(_0x465f1f){return _0x465f1f;});}return null;};}function removeEntity(_0x7d57f3,_0x72ec68){return function(_0x23ce65){if(_0x23ce65){return _0x23ce65[_0xb4cf('0x26')]()[_0xb4cf('0x27')](function(){var _0x381a6e=_0x23ce65[_0xb4cf('0x28')]({'plain':!![]});var _0x4877ad='Plugins';return db[_0xb4cf('0x29')][_0xb4cf('0x26')]({'where':{'type':_0x4877ad,'resourceId':_0x381a6e['id']}})['then'](function(){return _0x23ce65;});})[_0xb4cf('0x27')](function(){_0x7d57f3[_0xb4cf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x490ef6,_0x206004){return function(_0x40b9eb){if(!_0x40b9eb){_0x490ef6['sendStatus'](0x194);}return _0x40b9eb;};}function handleError(_0x41ee1d,_0x526bb2){_0x526bb2=_0x526bb2||0x1f4;return function(_0x1b388a){logger[_0xb4cf('0x2a')](_0x1b388a[_0xb4cf('0x2b')]);if(_0x1b388a[_0xb4cf('0x2c')]){delete _0x1b388a['name'];}_0x41ee1d[_0xb4cf('0x1c')](_0x526bb2)['send'](_0x1b388a);};}exports[_0xb4cf('0x2d')]=function(_0x20f9c4,_0x44994f){var _0x246e1c={},_0x4665ef={},_0x3a1d81={'count':0x0,'rows':[]};var _0x1cc15f=_[_0xb4cf('0x2e')](db['Plugin'][_0xb4cf('0x2f')],function(_0x145e3e){return{'name':_0x145e3e[_0xb4cf('0x30')],'type':_0x145e3e[_0xb4cf('0x31')][_0xb4cf('0x32')]};});_0x4665ef[_0xb4cf('0x33')]=_[_0xb4cf('0x2e')](_0x1cc15f,_0xb4cf('0x2c'));_0x4665ef[_0xb4cf('0x34')]=_[_0xb4cf('0x35')](_0x20f9c4[_0xb4cf('0x34')]);_0x4665ef['filters']=_['intersection'](_0x4665ef[_0xb4cf('0x33')],_0x4665ef[_0xb4cf('0x34')]);_0x246e1c[_0xb4cf('0x36')]=_['intersection'](_0x4665ef['model'],qs[_0xb4cf('0x37')](_0x20f9c4['query'][_0xb4cf('0x37')]));_0x246e1c[_0xb4cf('0x36')]=_0x246e1c[_0xb4cf('0x36')][_0xb4cf('0x38')]?_0x246e1c[_0xb4cf('0x36')]:_0x4665ef[_0xb4cf('0x33')];if(!_0x20f9c4[_0xb4cf('0x34')][_0xb4cf('0x39')]('nolimit')){_0x246e1c[_0xb4cf('0x1f')]=qs['limit'](_0x20f9c4['query']['limit']);_0x246e1c[_0xb4cf('0x1d')]=qs[_0xb4cf('0x1d')](_0x20f9c4[_0xb4cf('0x34')][_0xb4cf('0x1d')]);}_0x246e1c[_0xb4cf('0x3a')]=qs[_0xb4cf('0x3b')](_0x20f9c4[_0xb4cf('0x34')][_0xb4cf('0x3b')]);_0x246e1c[_0xb4cf('0x3c')]=qs['filters'](_[_0xb4cf('0x3d')](_0x20f9c4[_0xb4cf('0x34')],_0x4665ef[_0xb4cf('0x3e')]),_0x1cc15f);if(_0x20f9c4[_0xb4cf('0x34')]['filter']){_0x246e1c[_0xb4cf('0x3c')]=_[_0xb4cf('0x3f')](_0x246e1c['where'],{'$or':_[_0xb4cf('0x2e')](_0x1cc15f,function(_0x2cc5d7){if(_0x2cc5d7[_0xb4cf('0x31')]!=='VIRTUAL'){var _0xa89d7b={};_0xa89d7b[_0x2cc5d7[_0xb4cf('0x2c')]]={'$like':'%'+_0x20f9c4[_0xb4cf('0x34')][_0xb4cf('0x40')]+'%'};return _0xa89d7b;}})});}_0x246e1c=_['merge']({},_0x246e1c,_0x20f9c4[_0xb4cf('0x41')]);var _0x919899={'where':_0x246e1c['where']};return db['Plugin'][_0xb4cf('0x42')](_0x919899)[_0xb4cf('0x27')](function(_0x356d6a){_0x3a1d81['count']=_0x356d6a;if(_0x20f9c4[_0xb4cf('0x34')][_0xb4cf('0x43')]){_0x246e1c['include']=[{'all':!![]}];}return db[_0xb4cf('0x44')][_0xb4cf('0x45')](_0x246e1c);})['then'](function(_0x1a311d){_0x3a1d81[_0xb4cf('0x46')]=_0x1a311d;return _0x3a1d81;})['then'](respondWithFilteredResult(_0x44994f,_0x246e1c))[_0xb4cf('0x47')](handleError(_0x44994f,null));};exports[_0xb4cf('0x48')]=function(_0xc67365,_0x56fdd3){var _0x282f79={'raw':!![],'where':{'id':_0xc67365[_0xb4cf('0x49')]['id']}},_0x2998af={};_0x2998af[_0xb4cf('0x33')]=_[_0xb4cf('0x35')](db[_0xb4cf('0x44')]['rawAttributes']);_0x2998af['query']=_[_0xb4cf('0x35')](_0xc67365[_0xb4cf('0x34')]);_0x2998af[_0xb4cf('0x3e')]=_[_0xb4cf('0x4a')](_0x2998af[_0xb4cf('0x33')],_0x2998af['query']);_0x282f79['attributes']=_[_0xb4cf('0x4a')](_0x2998af[_0xb4cf('0x33')],qs['fields'](_0xc67365[_0xb4cf('0x34')][_0xb4cf('0x37')]));_0x282f79[_0xb4cf('0x36')]=_0x282f79['attributes'][_0xb4cf('0x38')]?_0x282f79[_0xb4cf('0x36')]:_0x2998af[_0xb4cf('0x33')];if(_0xc67365[_0xb4cf('0x34')]['includeAll']){_0x282f79[_0xb4cf('0x4b')]=[{'all':!![]}];}_0x282f79=_[_0xb4cf('0x3f')]({},_0x282f79,_0xc67365[_0xb4cf('0x41')]);return db['Plugin'][_0xb4cf('0x4c')](_0x282f79)[_0xb4cf('0x27')](handleEntityNotFound(_0x56fdd3,null))[_0xb4cf('0x27')](respondWithResult(_0x56fdd3,null))[_0xb4cf('0x47')](handleError(_0x56fdd3,null));};exports[_0xb4cf('0x4d')]=function(_0x2e5662,_0xd2e08c,_0x3b8886){return db[_0xb4cf('0x44')][_0xb4cf('0x4c')]({'where':{'id':_0x2e5662[_0xb4cf('0x49')]['id']},'attributes':[_0xb4cf('0x2c'),_0xb4cf('0x4')],'raw':!![]})[_0xb4cf('0x27')](handleEntityNotFound(_0xd2e08c,null))['then'](function(_0x56e9f0){if(_0x56e9f0){var _0x1da5ff=path[_0xb4cf('0x4e')](config[_0xb4cf('0x4f')],'server/files/plugins',util['format'](_0xb4cf('0x50'),path[_0xb4cf('0x51')](_0x56e9f0[_0xb4cf('0x4')])));var _0x1e84f7=fs[_0xb4cf('0x52')](_0x1da5ff);var _0x442c1a=archiver('zip',{'zlib':{'level':0x9}});_0x442c1a['on'](_0xb4cf('0x53'),function(_0x325ecf){if(_0x325ecf[_0xb4cf('0x54')]===_0xb4cf('0x55')){logger[_0xb4cf('0x2a')](_0x325ecf);}else{throw new db[(_0xb4cf('0x56'))][(_0xb4cf('0x57'))](_0xb4cf('0x58'));}});_0x442c1a['on'](_0xb4cf('0x2a'),function(_0x40891d){throw new db[(_0xb4cf('0x56'))][(_0xb4cf('0x57'))](_0xb4cf('0x58'));});_0x442c1a['pipe'](_0x1e84f7);_0x442c1a[_0xb4cf('0x59')](_0xb4cf('0x5a'),{'cwd':path['join'](config[_0xb4cf('0x4f')],'server/files/plugins',path['dirname'](_0x56e9f0[_0xb4cf('0x4')])),'ignore':[path[_0xb4cf('0x4e')](path[_0xb4cf('0x51')](_0x56e9f0['path']),_0xb4cf('0x5b')),path[_0xb4cf('0x4e')](path[_0xb4cf('0x51')](_0x56e9f0['path']),_0xb4cf('0x5c'))],'nodir':!![]})[_0xb4cf('0x5d')]();_0x1e84f7['on'](_0xb4cf('0x5e'),function(){if(!fs['existsSync'](_0x1da5ff)){throw new db[(_0xb4cf('0x56'))]['Error']('Plugin\x20not\x20found');}return _0xd2e08c['download'](_0x1da5ff,util[_0xb4cf('0x5f')](_0xb4cf('0x50'),path[_0xb4cf('0x51')](_0x56e9f0[_0xb4cf('0x4')])),function(_0x36e978){if(_0x36e978){throw new db['Sequelize'][(_0xb4cf('0x57'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb4cf('0x60')](_0x1da5ff);logger['info'](_0xb4cf('0x61'));logger['info'](_0xb4cf('0x62'));});});}return null;})[_0xb4cf('0x47')](handleError(_0xd2e08c,null));};exports[_0xb4cf('0x63')]=function(_0x75e011,_0x507ed3,_0x3e1973){var _0x4e42a1=path[_0xb4cf('0x51')](_0x75e011[_0xb4cf('0x64')][_0xb4cf('0x65')],path[_0xb4cf('0x66')](_0x75e011['file'][_0xb4cf('0x65')]));var _0x58f331=path['join'](config[_0xb4cf('0x4f')],'server/files/plugins',_0x75e011['file']['filename']);var _0x28e0b9=path[_0xb4cf('0x4e')](config[_0xb4cf('0x4f')],_0xb4cf('0x67'),_0x4e42a1);logger[_0xb4cf('0x68')](_0xb4cf('0x69'),_0x58f331);logger[_0xb4cf('0x68')](_0xb4cf('0x6a'),_0x28e0b9);try{fs[_0xb4cf('0x6b')](_0x58f331,parseInt(_0xb4cf('0x6c'),0x8));extract(_0x58f331,{'dir':_0x28e0b9},function(_0x2d05d6){if(_0x2d05d6){logger[_0xb4cf('0x2a')](_0x2d05d6);handleError(_0x2d05d6,!![]);};var _0x34366b=fs[_0xb4cf('0x6d')](_0x28e0b9);if(_0x34366b[_0xb4cf('0x38')]>0x1){removeReferences(_0x58f331,_0x28e0b9);logger[_0xb4cf('0x2a')](_0xb4cf('0x6e'));return _0x3e1973(new Error(_0xb4cf('0x6e')));}var _0x4f1d99=fs[_0xb4cf('0x6f')](path[_0xb4cf('0x4e')](_0x28e0b9,_0x34366b[0x0]));if(_0x4f1d99['isFile']()){removeReferences(_0x58f331,_0x28e0b9);logger[_0xb4cf('0x2a')](_0xb4cf('0x6e'));return _0x3e1973(new Error(_0xb4cf('0x6e')));}if(_0x4f1d99['isDirectory']()){var _0x5ab10d=fs[_0xb4cf('0x6d')](path['join'](_0x28e0b9,_0x34366b[0x0]));if(_0x5ab10d[_0xb4cf('0x38')]===0x0){removeReferences(_0x58f331,_0x28e0b9);logger['error'](_0xb4cf('0x6e'));return _0x3e1973(new Error(_0xb4cf('0x6e')));}var _0x441dee=_0x5ab10d[_0xb4cf('0x70')](function(_0x3d2844){return _0x3d2844==='manifest.json';});if(!_0x441dee){return _0x3e1973(new Error(_0xb4cf('0x71')));}var _0x1df010=fs[_0xb4cf('0x72')](path[_0xb4cf('0x4e')](_0x28e0b9,_0x34366b[0x0],_0xb4cf('0x73')));var _0x3aad79=JSON['parse'](_0x1df010);if(_0xb4cf('0x1e')==typeof _0x3aad79['name']){return _0x3e1973(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xb4cf('0x1e')==typeof _0x3aad79[_0xb4cf('0x31')]){return _0x3e1973(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xb4cf('0x1e')==typeof _0x3aad79['version']){return _0x3e1973(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xb4cf('0x1e')==typeof _0x3aad79['parameters']){return _0x3e1973(new Error(_0xb4cf('0x74')));}if(_0x3aad79[_0xb4cf('0x31')]===_0xb4cf('0x75')){if(_0xb4cf('0x1e')==typeof _0x3aad79[_0xb4cf('0x76')]['views']){return _0x3e1973(new Error(_0xb4cf('0x77')));}if(_0xb4cf('0x1e')==typeof _0x3aad79['parameters'][_0xb4cf('0x78')][_0xb4cf('0x79')]&&'undefined'==typeof _0x3aad79[_0xb4cf('0x76')][_0xb4cf('0x78')]['agent']){return _0x3e1973(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3aad79[_0xb4cf('0x31')]===_0xb4cf('0x7a')){if(_0xb4cf('0x1e')==typeof _0x3aad79['parameters'][_0xb4cf('0x7b')]){return _0x3e1973(new Error(_0xb4cf('0x7c')));}if(_0xb4cf('0x1e')==typeof _0x3aad79['parameters'][_0xb4cf('0x7d')]){return _0x3e1973(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3e1973(new Error(_0xb4cf('0x7e')));}var _0x19cc2c=_0x3aad79[_0xb4cf('0x2c')];var _0x35c07a=_0x3aad79[_0xb4cf('0x7f')];var _0x1fd690=_0x3aad79[_0xb4cf('0x31')];var _0x1dd85d=_0x3aad79['sidebar']?_0x3aad79[_0xb4cf('0x80')]:_0xb4cf('0x81');var _0x9c3b5f=_0x3aad79[_0xb4cf('0x82')]?_0x3aad79[_0xb4cf('0x82')]:_0xb4cf('0x83');var _0x542985='';var _0x4812ab='';var _0x1174db='';var _0x2f334f='';var _0x45c0a0=_0x3aad79['version'];if(_0x1fd690===_0xb4cf('0x75')){if('undefined'!=typeof _0x3aad79[_0xb4cf('0x76')]['views'][_0xb4cf('0x79')]){var _0x5d975d=_0x3aad79['parameters'][_0xb4cf('0x78')][_0xb4cf('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xb4cf('0x84')](_0x5d975d)){_0x542985=path[_0xb4cf('0x4e')]('plugins',_0x4e42a1,_0x34366b[0x0],_0x5d975d);}else{_0x542985=_0x5d975d;}}else{logger[_0xb4cf('0x68')](_0xb4cf('0x85'));}if('undefined'!=typeof _0x3aad79[_0xb4cf('0x76')][_0xb4cf('0x78')][_0xb4cf('0x86')]){var _0x1168c2=_0x3aad79['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1168c2)){_0x4812ab=path[_0xb4cf('0x4e')](_0xb4cf('0x87'),_0x4e42a1,_0x34366b[0x0],_0x1168c2);}else{_0x4812ab=_0x1168c2;}}else{logger[_0xb4cf('0x68')](_0xb4cf('0x88'));}}else if(_0x1fd690===_0xb4cf('0x7a')){_0x1174db=_0x3aad79['parameters'][_0xb4cf('0x7b')];_0x2f334f=_0x3aad79[_0xb4cf('0x76')][_0xb4cf('0x7d')];if(_0xb4cf('0x1e')!=typeof _0x3aad79[_0xb4cf('0x76')][_0xb4cf('0x78')]){if(_0xb4cf('0x1e')!=typeof _0x3aad79[_0xb4cf('0x76')]['views'][_0xb4cf('0x79')]){var _0x5d975d=_0x3aad79['parameters'][_0xb4cf('0x78')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5d975d)){_0x542985=path[_0xb4cf('0x4e')]('plugins',_0x4e42a1,_0x34366b[0x0],_0x5d975d);}else{_0x542985=_0x5d975d;}}if(_0xb4cf('0x1e')!=typeof _0x3aad79[_0xb4cf('0x76')][_0xb4cf('0x78')][_0xb4cf('0x86')]){var _0x1168c2=_0x3aad79[_0xb4cf('0x76')][_0xb4cf('0x78')][_0xb4cf('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xb4cf('0x84')](_0x1168c2)){_0x4812ab=path[_0xb4cf('0x4e')](_0xb4cf('0x87'),_0x4e42a1,_0x34366b[0x0],_0x1168c2);}else{_0x4812ab=_0x1168c2;}}}}var _0x2becb8={'name':_0x19cc2c,'description':_0x35c07a,'path':path['join'](_0x4e42a1,_0x34366b[0x0]),'type':_0x1fd690,'sidebar':_0x1dd85d,'icon':_0x9c3b5f,'adminUrl':_0x542985,'agentUrl':_0x4812ab,'scriptName':_0x1174db,'scriptPath':_0x2f334f,'version':_0x45c0a0};removeReferences(_0x58f331,null);return db[_0xb4cf('0x44')][_0xb4cf('0x89')](_0x2becb8)[_0xb4cf('0x27')](function(_0x51f421){var _0x52bc84={'role':_0x75e011[_0xb4cf('0x8a')][_0xb4cf('0x8b')],'userProfileId':_0x75e011[_0xb4cf('0x8a')][_0xb4cf('0x8c')]};if(!_0x52bc84)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52bc84[_0xb4cf('0x8b')]===_0xb4cf('0x8d')){var _0x15e7b2=_0x51f421[_0xb4cf('0x28')]({'plain':!![]});return db[_0xb4cf('0x8e')][_0xb4cf('0x4c')]({'where':{'name':'Plugins','userProfileId':_0x52bc84[_0xb4cf('0x8c')]},'raw':!![]})['then'](function(_0xbdb8d){if(_0xbdb8d&&_0xbdb8d['autoAssociation']===0x0){return db[_0xb4cf('0x29')][_0xb4cf('0x89')]({'name':_0x15e7b2[_0xb4cf('0x2c')],'resourceId':_0x15e7b2['id'],'type':_0xbdb8d[_0xb4cf('0x2c')],'sectionId':_0xbdb8d['id']},{})[_0xb4cf('0x27')](function(){return _0x51f421;});}else{return _0x51f421;}})[_0xb4cf('0x47')](function(_0x2dc1cc){logger['error'](_0xb4cf('0x8f'),_0x2dc1cc);throw _0x2dc1cc;});}return _0x51f421;})['then'](respondWithResult(_0x507ed3,null))[_0xb4cf('0x47')](handleError(_0x507ed3,null));}});}catch(_0x44cb6c){_0x507ed3[_0xb4cf('0x1c')](0x1f4)[_0xb4cf('0x90')](_0x44cb6c);}};function removeReferences(_0x3ea8dc,_0x2dc603){try{if(_0x3ea8dc){fs['unlinkSync'](_0x3ea8dc);logger[_0xb4cf('0x68')](_0xb4cf('0x91'));}if(_0x2dc603){rimraf(_0x2dc603,function(){});logger['info'](_0xb4cf('0x92'));}}catch(_0x5bc637){logger[_0xb4cf('0x2a')](_0x5bc637);}}exports[_0xb4cf('0x25')]=function(_0x51982e,_0x1e62fa,_0xef831d){return db[_0xb4cf('0x44')][_0xb4cf('0x4c')]({'where':{'id':_0x51982e[_0xb4cf('0x49')]['id']}})[_0xb4cf('0x27')](handleEntityNotFound(_0x1e62fa,null))['then'](saveUpdates(_0x51982e[_0xb4cf('0x8a')],null))[_0xb4cf('0x27')](respondWithResult(_0x1e62fa,null))['catch'](handleError(_0x1e62fa,null));};exports[_0xb4cf('0x93')]=function(_0x56d275,_0x3469a8,_0x542564){return db['Plugin'][_0xb4cf('0x4c')]({'where':{'id':_0x56d275[_0xb4cf('0x49')]['id']}})[_0xb4cf('0x27')](function(_0x403b34){if(_0x403b34){return _0x403b34['destroy']();}})[_0xb4cf('0x27')](function(_0x10ac5a){rimraf(path[_0xb4cf('0x4e')](config[_0xb4cf('0x4f')],_0xb4cf('0x67'),path[_0xb4cf('0x94')](_0x10ac5a[_0xb4cf('0x4')])),function(){});return _0x10ac5a;})[_0xb4cf('0x27')](handleEntityNotFound(_0x3469a8,null))[_0xb4cf('0x27')](respondWithStatusCode(_0x3469a8,null))['catch'](handleError(_0x3469a8,null));};exports['webhookGet']=function(_0x1f3f63,_0x5411b2,_0x151e4b){return BPromise[_0xb4cf('0x95')]()[_0xb4cf('0x27')](function(){if(!_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x4')]){throw new Error(_0xb4cf('0x96'));}if(!_0x1f3f63[_0xb4cf('0x34')]['port']){throw new Error(_0xb4cf('0x97'));}var _0x5f9fc4=_0x1f3f63['query'][_0xb4cf('0x98')]?_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x98')]+':'+_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x99')]:'http://localhost:'+_0x1f3f63['query']['port'];var _0xd9a3d4=_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x9a')]?_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x9a')]:!![];var _0x5521f6=_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x9b')]?_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x9b')]:null;var _0xff7e5c={'method':_0x1f3f63[_0xb4cf('0x9c')],'uri':util[_0xb4cf('0x5f')]('%s%s',_0x5f9fc4,_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x4')]),'json':_0xd9a3d4,'resolveWithFullResponse':!![],'encoding':_0x5521f6,'qs':_0x1f3f63['query']};if(_0x1f3f63[_0xb4cf('0x9d')]){_0xff7e5c[_0xb4cf('0x9d')]=_0x1f3f63[_0xb4cf('0x9d')];if(_0xff7e5c['headers'][_0xb4cf('0x9e')]){delete _0xff7e5c[_0xb4cf('0x9d')][_0xb4cf('0x9e')];}}if(_0xff7e5c[_0xb4cf('0x9d')][_0xb4cf('0x9f')]){delete _0xff7e5c[_0xb4cf('0x9d')][_0xb4cf('0x9f')];}return rp(_0xff7e5c);})[_0xb4cf('0x27')](function(_0x34aa17){if(_0x34aa17){_0x5411b2[_0xb4cf('0x20')](_0x34aa17[_0xb4cf('0x9d')]);logger[_0xb4cf('0x68')](_0x34aa17[_0xb4cf('0x8a')]);if(_[_0xb4cf('0xa0')](_0x1f3f63[_0xb4cf('0x34')][_0xb4cf('0x4')],'download')&&_0x34aa17['statusCode']==0x1f4){return _0x5411b2['sendStatus'](_0x34aa17['statusCode']);}else{return _0x5411b2[_0xb4cf('0x1c')](_0x34aa17[_0xb4cf('0xa1')])[_0xb4cf('0x90')](_0x34aa17[_0xb4cf('0x8a')]);}}else{return _0x5411b2['sendStatus'](0xc8);}})[_0xb4cf('0x47')](handleError(_0x5411b2,null));};exports[_0xb4cf('0xa2')]=function(_0x193d31,_0x25e6b6,_0x24324b){return BPromise[_0xb4cf('0x95')]()[_0xb4cf('0x27')](function(){if(!_0x193d31[_0xb4cf('0x34')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x193d31[_0xb4cf('0x34')]['port']){throw new Error(_0xb4cf('0x97'));}var _0x2bfe15=_0x193d31['query'][_0xb4cf('0x98')]?_0x193d31[_0xb4cf('0x34')]['hostname']+':'+_0x193d31['query'][_0xb4cf('0x99')]:_0xb4cf('0xa3')+_0x193d31['query'][_0xb4cf('0x99')];var _0x17d0cc=_0x193d31[_0xb4cf('0x34')][_0xb4cf('0x9a')]?_0x193d31[_0xb4cf('0x34')][_0xb4cf('0x9a')]:!![];var _0x101c21=_0x193d31['query'][_0xb4cf('0x9b')]?_0x193d31[_0xb4cf('0x34')]['encoding']:null;var _0x20bdc9={'method':_0x193d31[_0xb4cf('0x9c')],'uri':util[_0xb4cf('0x5f')]('%s%s',_0x2bfe15,_0x193d31[_0xb4cf('0x34')][_0xb4cf('0x4')]),'json':_0x17d0cc,'resolveWithFullResponse':!![],'encoding':_0x101c21,'body':_0x193d31[_0xb4cf('0x8a')]};if(_0x193d31['headers']){_0x20bdc9[_0xb4cf('0x9d')]=_0x193d31[_0xb4cf('0x9d')];if(_0x20bdc9['headers']['content-length']){delete _0x20bdc9[_0xb4cf('0x9d')][_0xb4cf('0x9e')];}}if(_0x20bdc9[_0xb4cf('0x9d')][_0xb4cf('0x9f')]){delete _0x20bdc9[_0xb4cf('0x9d')][_0xb4cf('0x9f')];}return rp(_0x20bdc9);})[_0xb4cf('0x27')](function(_0x22b7e9){if(_0x22b7e9){_0x25e6b6[_0xb4cf('0x20')](_0x22b7e9[_0xb4cf('0x9d')]);logger[_0xb4cf('0x68')](_0x22b7e9[_0xb4cf('0x8a')]);return _0x25e6b6[_0xb4cf('0x1c')](_0x22b7e9['statusCode'])[_0xb4cf('0x90')](_0x22b7e9[_0xb4cf('0x8a')]);}else{return _0x25e6b6[_0xb4cf('0x1b')](0xc8);}})[_0xb4cf('0x47')](handleError(_0x25e6b6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a8cc289..8bc6b2a 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 _0x64f5=['remove','emit','hasOwnProperty','exports','events','save'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x64f5,0x17e));var _0x564f=function(_0x36747d,_0x476bd5){_0x36747d=_0x36747d-0x0;var _0x2c38ef=_0x64f5[_0x36747d];return _0x2c38ef;};'use strict';var EventEmitter=require(_0x564f('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x564f('0x1'),'afterUpdate':'update','afterDestroy':_0x564f('0x2')};function emitEvent(_0x1594b5){return function(_0x59c424,_0x2607d6,_0x23328d){PluginEvents[_0x564f('0x3')](_0x1594b5+':'+_0x59c424['id'],_0x59c424);PluginEvents[_0x564f('0x3')](_0x1594b5,_0x59c424);_0x23328d(null);};}for(var e in events){if(events[_0x564f('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x564f('0x5')]=PluginEvents; \ No newline at end of file +var _0xadf0=['save','update','remove','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x494414,_0x9cfb0b){var _0x2c0cbe=function(_0x28655b){while(--_0x28655b){_0x494414['push'](_0x494414['shift']());}};_0x2c0cbe(++_0x9cfb0b);}(_0xadf0,0x12d));var _0x0adf=function(_0x4e4664,_0x301244){_0x4e4664=_0x4e4664-0x0;var _0x59372a=_0xadf0[_0x4e4664];return _0x59372a;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x0adf('0x0'))['db'][_0x0adf('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0adf('0x2')](0x0);var events={'afterCreate':_0x0adf('0x3'),'afterUpdate':_0x0adf('0x4'),'afterDestroy':_0x0adf('0x5')};function emitEvent(_0x911855){return function(_0x4b4b16,_0xb48987,_0x567ca2){PluginEvents['emit'](_0x911855+':'+_0x4b4b16['id'],_0x4b4b16);PluginEvents['emit'](_0x911855,_0x4b4b16);_0x567ca2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x0adf('0x6')](e,emitEvent(event));}}module[_0x0adf('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8aa3492..3e3b9f7 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 _0x2538=['request-promise','path','rimraf','../../config/environment','define','Plugin','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x285484,_0x93cd92){var _0xa29d5b=function(_0x362512){while(--_0x362512){_0x285484['push'](_0x285484['shift']());}};_0xa29d5b(++_0x93cd92);}(_0x2538,0x19e));var _0x8253=function(_0x38e5ee,_0x3cd0cb){_0x38e5ee=_0x38e5ee-0x0;var _0x85812d=_0x2538[_0x38e5ee];return _0x85812d;};'use strict';var _=require(_0x8253('0x0'));var util=require(_0x8253('0x1'));var logger=require(_0x8253('0x2'))(_0x8253('0x3'));var moment=require(_0x8253('0x4'));var BPromise=require(_0x8253('0x5'));var rp=require(_0x8253('0x6'));var fs=require('fs');var path=require(_0x8253('0x7'));var rimraf=require(_0x8253('0x8'));var config=require(_0x8253('0x9'));var attributes=require('./plugin.attributes');module['exports']=function(_0x3f92d9,_0x5e4ff8){return _0x3f92d9[_0x8253('0xa')](_0x8253('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45dc=['./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xcc24e8,_0x230fe5){var _0x279917=function(_0x5838ad){while(--_0x5838ad){_0xcc24e8['push'](_0xcc24e8['shift']());}};_0x279917(++_0x230fe5);}(_0x45dc,0x139));var _0xc45d=function(_0x1c8eca,_0x4a069d){_0x1c8eca=_0x1c8eca-0x0;var _0x349d81=_0x45dc[_0x1c8eca];return _0x349d81;};'use strict';var _=require('lodash');var util=require(_0xc45d('0x0'));var logger=require(_0xc45d('0x1'))(_0xc45d('0x2'));var moment=require(_0xc45d('0x3'));var BPromise=require(_0xc45d('0x4'));var rp=require(_0xc45d('0x5'));var fs=require('fs');var path=require(_0xc45d('0x6'));var rimraf=require(_0xc45d('0x7'));var config=require(_0xc45d('0x8'));var attributes=require(_0xc45d('0x9'));module[_0xc45d('0xa')]=function(_0x2c8383,_0x352dc2){return _0x2c8383[_0xc45d('0xb')](_0xc45d('0xc'),attributes,{'tableName':_0xc45d('0xd'),'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 86ecbfc..e05c8e3 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 _0x8054=['Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x8054,0x141));var _0x4805=function(_0x31e1c0,_0x480224){_0x31e1c0=_0x31e1c0-0x0;var _0x3aece6=_0x8054[_0x31e1c0];return _0x3aece6;};'use strict';var _=require(_0x4805('0x0'));var util=require(_0x4805('0x1'));var moment=require(_0x4805('0x2'));var BPromise=require(_0x4805('0x3'));var rs=require(_0x4805('0x4'));var fs=require('fs');var Redis=require(_0x4805('0x5'));var db=require(_0x4805('0x6'))['db'];var utils=require(_0x4805('0x7'));var logger=require(_0x4805('0x8'))(_0x4805('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4805('0xa')]({'port':0x232a});config[_0x4805('0xb')]=_['defaults'](config['redis'],{'host':_0x4805('0xc'),'port':0x18eb});var socket=require(_0x4805('0xd'))(new Redis(config[_0x4805('0xb')]));require(_0x4805('0xe'))[_0x4805('0xf')](socket);function respondWithRpcPromise(_0x22c392,_0x58c5a4,_0x12d00f){return new BPromise(function(_0x1ef36f,_0x7d9332){return client[_0x4805('0x10')](_0x22c392,_0x12d00f)[_0x4805('0x11')](function(_0x5c475b){logger[_0x4805('0x12')](_0x4805('0x13'),_0x58c5a4,_0x4805('0x14'));logger[_0x4805('0x15')](_0x4805('0x16'),_0x58c5a4,_0x4805('0x14'),JSON[_0x4805('0x17')](_0x5c475b));if(_0x5c475b['error']){if(_0x5c475b[_0x4805('0x18')][_0x4805('0x19')]===0x1f4){logger['error'](_0x4805('0x13'),_0x58c5a4,_0x5c475b['error']['message']);return _0x7d9332(_0x5c475b[_0x4805('0x18')]['message']);}logger['error'](_0x4805('0x13'),_0x58c5a4,_0x5c475b[_0x4805('0x18')]['message']);return _0x1ef36f(_0x5c475b[_0x4805('0x18')][_0x4805('0x1a')]);}else{logger[_0x4805('0x12')](_0x4805('0x13'),_0x58c5a4,_0x4805('0x14'));_0x1ef36f(_0x5c475b[_0x4805('0x1b')]['message']);}})[_0x4805('0x1c')](function(_0x260daf){logger[_0x4805('0x18')]('Plugin,\x20%s,\x20%s',_0x58c5a4,_0x260daf);_0x7d9332(_0x260daf);});});}exports[_0x4805('0x1d')]=function(_0x903fb){var _0x16571a=this;return new Promise(function(_0x4309e5,_0x33709b){return db[_0x4805('0x1e')][_0x4805('0x1f')](_0x903fb['body'],{'raw':_0x903fb['options']?_0x903fb[_0x4805('0x20')][_0x4805('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x39220b){logger['info']('CreatePlugin',_0x903fb);logger[_0x4805('0x15')](_0x4805('0x1d'),_0x903fb,JSON[_0x4805('0x17')](_0x39220b));_0x4309e5(_0x39220b);})['catch'](function(_0x52de54){logger[_0x4805('0x18')](_0x4805('0x1d'),_0x52de54[_0x4805('0x1a')],_0x903fb);_0x33709b(_0x16571a['error'](0x1f4,_0x52de54[_0x4805('0x1a')]));});});}; \ No newline at end of file +var _0xf756=['CreatePlugin','Plugin','body','options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','defaults','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','catch'];(function(_0x3714a0,_0x3775e4){var _0x430d52=function(_0xc846cb){while(--_0xc846cb){_0x3714a0['push'](_0x3714a0['shift']());}};_0x430d52(++_0x3775e4);}(_0xf756,0x18e));var _0x6f75=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf756[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x6f75('0x0'));var util=require(_0x6f75('0x1'));var moment=require(_0x6f75('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f75('0x3'));var db=require(_0x6f75('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f75('0x5'));var config=require('../../config/environment');var jayson=require(_0x6f75('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x6f75('0x7')](config[_0x6f75('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f75('0x9'))(new Redis(config[_0x6f75('0x8')]));require('./plugin.socket')[_0x6f75('0xa')](socket);function respondWithRpcPromise(_0x56a2d3,_0x71459b,_0x1bbbae){return new BPromise(function(_0x41be99,_0x92976a){return client[_0x6f75('0xb')](_0x56a2d3,_0x1bbbae)[_0x6f75('0xc')](function(_0x4dd946){logger[_0x6f75('0xd')]('Plugin,\x20%s,\x20%s',_0x71459b,_0x6f75('0xe'));logger[_0x6f75('0xf')](_0x6f75('0x10'),_0x71459b,_0x6f75('0xe'),JSON['stringify'](_0x4dd946));if(_0x4dd946[_0x6f75('0x11')]){if(_0x4dd946[_0x6f75('0x11')][_0x6f75('0x12')]===0x1f4){logger[_0x6f75('0x11')](_0x6f75('0x13'),_0x71459b,_0x4dd946[_0x6f75('0x11')][_0x6f75('0x14')]);return _0x92976a(_0x4dd946[_0x6f75('0x11')][_0x6f75('0x14')]);}logger[_0x6f75('0x11')]('Plugin,\x20%s,\x20%s',_0x71459b,_0x4dd946[_0x6f75('0x11')][_0x6f75('0x14')]);return _0x41be99(_0x4dd946['error'][_0x6f75('0x14')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x71459b,'request\x20sent');_0x41be99(_0x4dd946['result'][_0x6f75('0x14')]);}})[_0x6f75('0x15')](function(_0x203cfd){logger[_0x6f75('0x11')]('Plugin,\x20%s,\x20%s',_0x71459b,_0x203cfd);_0x92976a(_0x203cfd);});});}exports[_0x6f75('0x16')]=function(_0x4bc551){var _0xa58f38=this;return new Promise(function(_0x459443,_0x54b905){return db[_0x6f75('0x17')]['create'](_0x4bc551[_0x6f75('0x18')],{'raw':_0x4bc551[_0x6f75('0x19')]?_0x4bc551[_0x6f75('0x19')][_0x6f75('0x1a')]===undefined?!![]:![]:!![]})[_0x6f75('0xc')](function(_0x58a24b){logger[_0x6f75('0xd')](_0x6f75('0x16'),_0x4bc551);logger[_0x6f75('0xf')](_0x6f75('0x16'),_0x4bc551,JSON[_0x6f75('0x1b')](_0x58a24b));_0x459443(_0x58a24b);})[_0x6f75('0x15')](function(_0x28170e){logger[_0x6f75('0x11')](_0x6f75('0x16'),_0x28170e[_0x6f75('0x14')],_0x4bc551);_0x54b905(_0xa58f38['error'](0x1f4,_0x28170e[_0x6f75('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3fa9bb3..0989369 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 _0xa581=['removeListener','register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x1d14f4,_0x3cb1bf){var _0x2f1d49=function(_0x5d7ab8){while(--_0x5d7ab8){_0x1d14f4['push'](_0x1d14f4['shift']());}};_0x2f1d49(++_0x3cb1bf);}(_0xa581,0x9b));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0x1a58('0x0'));var events=[_0x1a58('0x1'),_0x1a58('0x2'),_0x1a58('0x3')];function createListener(_0x57f7f3,_0x1387eb){return function(_0x2ca560){_0x1387eb[_0x1a58('0x4')](_0x57f7f3,_0x2ca560);};}function removeListener(_0x54dc57,_0xfaa125){return function(){PluginEvents[_0x1a58('0x5')](_0x54dc57,_0xfaa125);};}exports[_0x1a58('0x6')]=function(_0x5add8d){for(var _0x28cfe9=0x0,_0xc9b9=events['length'];_0x28cfe9<_0xc9b9;_0x28cfe9++){var _0x5bb462=events[_0x28cfe9];var _0x245e9d=createListener(_0x1a58('0x7')+_0x5bb462,_0x5add8d);PluginEvents['on'](_0x5bb462,_0x245e9d);}}; \ No newline at end of file +var _0xf116=['update','removeListener','length','./plugin.events','remove'];(function(_0x1532cc,_0x30e3f0){var _0x3926ff=function(_0x13ca62){while(--_0x13ca62){_0x1532cc['push'](_0x1532cc['shift']());}};_0x3926ff(++_0x30e3f0);}(_0xf116,0xad));var _0x6f11=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xf116[_0x2de0a7];return _0x429437;};'use strict';var PluginEvents=require(_0x6f11('0x0'));var events=['save',_0x6f11('0x1'),_0x6f11('0x2')];function createListener(_0x58a31d,_0x4e7b7e){return function(_0x286b07){_0x4e7b7e['emit'](_0x58a31d,_0x286b07);};}function removeListener(_0x1c8b7d,_0x2c67b2){return function(){PluginEvents[_0x6f11('0x3')](_0x1c8b7d,_0x2c67b2);};}exports['register']=function(_0x193868){for(var _0x4b8d30=0x0,_0x219140=events[_0x6f11('0x4')];_0x4b8d30<_0x219140;_0x4b8d30++){var _0xae831b=events[_0x4b8d30];var _0x557eb6=createListener('plugin:'+_0xae831b,_0x193868);PluginEvents['on'](_0xae831b,_0x557eb6);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d26441b..4935e97 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(_0x379e8f,_0x308f31){var _0x187241=function(_0x293539){while(--_0x293539){_0x379e8f['push'](_0x379e8f['shift']());}};_0x187241(++_0x308f31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x4229c6,_0x17b7a3){var _0x43f0ed=function(_0x504b52){while(--_0x504b52){_0x4229c6['push'](_0x4229c6['shift']());}};_0x43f0ed(++_0x17b7a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 7cb0268..d1bbd09 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 _0xd2ea=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','index','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path'];(function(_0x5210f9,_0x3f5281){var _0x4d4154=function(_0x1c5619){while(--_0x1c5619){_0x5210f9['push'](_0x5210f9['shift']());}};_0x4d4154(++_0x3f5281);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4ada64,_0x30cda){_0x4ada64=_0x4ada64-0x0;var _0x4ae6d3=_0xd2ea[_0x4ada64];return _0x4ae6d3;};'use strict';var _=require(_0xad2e('0x0'));var pm2=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var path=require(_0xad2e('0x4'));var exec=require('child_process')[_0xad2e('0x5')];var BPromise=require(_0xad2e('0x6'));function handleEntityNotFound(_0xcba7cb,_0x3e0741){return function(_0x2afdc4){if(!_0x2afdc4){_0xcba7cb[_0xad2e('0x7')](0x194);;}return _0x2afdc4;};}function respondWithResult(_0x29e97f,_0x592e8b){_0x592e8b=_0x592e8b||0xc8;return function(_0x3b5170){if(_0x3b5170){return _0x29e97f[_0xad2e('0x8')](_0x592e8b)[_0xad2e('0x9')](_0x3b5170);}return null;};}function handleError(_0x5710ac,_0x1e0e9e){_0x1e0e9e=_0x1e0e9e||0x1f4;return function(_0x19bb0d){logger['error'](_0x19bb0d[_0xad2e('0xa')]);if(_0x19bb0d['name']){delete _0x19bb0d[_0xad2e('0xb')];}_0x5710ac[_0xad2e('0x8')](_0x1e0e9e)[_0xad2e('0xc')](_0x19bb0d);};}function execChildProcess(){return new BPromise(function(_0x24c5da,_0x489f25){exec(_0xad2e('0xd'),function(_0x5707a5,_0x42d2ac,_0x347559){logger[_0xad2e('0xe')](_0x42d2ac);logger[_0xad2e('0xe')](_0x347559);if(_0x5707a5){logger['error'](_0x5707a5);return _0x489f25(_0x5707a5);}return _0x24c5da(_0x42d2ac);});});}exports[_0xad2e('0xf')]=function(_0x59201f,_0x1a91ce){return pm2['list']()['then'](function(_0x4a812b){if(_0x4a812b){var _0x5c96a7=_[_0xad2e('0x10')](_0x4a812b,function(_0x282780){return _0x282780[_0xad2e('0xb')]===_0xad2e('0x11')||_0x282780[_0xad2e('0xb')]===_0xad2e('0x12');});return{'rows':_0x5c96a7,'count':_0x5c96a7[_0xad2e('0x13')]};}return null;})[_0xad2e('0x14')](respondWithResult(_0x1a91ce,null))[_0xad2e('0x15')](handleError(_0x1a91ce,null));};exports[_0xad2e('0x16')]=function(_0x2af208,_0x39c5e4){return pm2[_0xad2e('0x17')](_0x2af208[_0xad2e('0x18')]['id'])[_0xad2e('0x14')](respondWithResult(_0x39c5e4,null))['then'](handleEntityNotFound(_0x39c5e4,null))[_0xad2e('0x15')](handleError(_0x39c5e4,null));};exports[_0xad2e('0x19')]=function(_0x489585,_0x50eb1a){if(_0x489585['body']['name']&&_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]){var _0x5549db=path[_0xad2e('0x1c')](__dirname,_0xad2e('0x1d'),_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]);var _0x23c0b6=process[_0xad2e('0x1e')]();process[_0xad2e('0x1f')](path[_0xad2e('0x20')](_0x5549db));return execChildProcess()[_0xad2e('0x14')](function(_0xd907a9){process[_0xad2e('0x1f')](_0x23c0b6);return pm2[_0xad2e('0x21')]({'name':_0x489585[_0xad2e('0x1a')]['name'],'script':_0x5549db});})[_0xad2e('0x14')](function(_0x2e8887){pm2[_0xad2e('0x22')]();return _0x2e8887[0x0];})[_0xad2e('0x14')](respondWithResult(_0x50eb1a,0xc9))[_0xad2e('0x15')](handleError(_0x50eb1a,null));}else{return _0x50eb1a[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x23')});}};exports[_0xad2e('0x24')]=function(_0x50d446,_0x356a19){if(_0x50d446['body']['id']){delete _0x50d446[_0xad2e('0x1a')]['id'];}var _0x28ef72={'online':_0xad2e('0x25'),'stopped':_0xad2e('0x26')};if(_0x28ef72[_0xad2e('0x27')](_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')])){return pm2[_0x28ef72[_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')]]](_0x50d446[_0xad2e('0x18')]['id'])['then'](respondWithResult(_0x356a19,0xc8))[_0xad2e('0x15')](handleError(_0x356a19,null));}else{return _0x356a19[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x28')});}};exports[_0xad2e('0x29')]=function(_0x9b4a23,_0x409f58){if(_0x9b4a23[_0xad2e('0x1a')]['id']){delete _0x9b4a23[_0xad2e('0x1a')]['id'];}if(_0x9b4a23[_0xad2e('0x18')]['id']){return pm2[_0xad2e('0x2a')](_0x9b4a23['params']['id'])[_0xad2e('0x14')](function(_0x55e1dc){pm2[_0xad2e('0x22')]();return _0x55e1dc[0x0];})[_0xad2e('0x14')](respondWithResult(_0x409f58,null))[_0xad2e('0x15')](handleError(_0x409f58,null));}else{return _0x409f58[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x36a224,_0x23bb6a){var _0x509df2=function(_0x14d39a){while(--_0x14d39a){_0x36a224['push'](_0x36a224['shift']());}};_0x509df2(++_0x23bb6a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x89c831,_0x2ee1ce){_0x89c831=_0x89c831-0x0;var _0x97fcbf=_0xee5b[_0x89c831];return _0x97fcbf;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 89a18b0..c1a8a02 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 _0x6332=['isAuthenticated','getAgents','get','/queues','getQueues','exports','express','Router','/agents'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x6332,0x10b));var _0x2633=function(_0x13d43f,_0x29533b){_0x13d43f=_0x13d43f-0x0;var _0x776929=_0x6332[_0x13d43f];return _0x776929;};'use strict';var express=require(_0x2633('0x0'));var router=express[_0x2633('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0x2633('0x2'),auth[_0x2633('0x3')](),controller[_0x2633('0x4')]);router[_0x2633('0x5')](_0x2633('0x6'),auth[_0x2633('0x3')](),controller[_0x2633('0x7')]);module[_0x2633('0x8')]=router; \ No newline at end of file +var _0xe090=['/agents','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe090,0x8c));var _0x0e09=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xe090[_0x7e2eb0];return _0xd92de4;};'use strict';var express=require(_0x0e09('0x0'));var router=express[_0x0e09('0x1')]();var auth=require(_0x0e09('0x2'));var controller=require('./realtime.controller');router[_0x0e09('0x3')](_0x0e09('0x4'),auth[_0x0e09('0x5')](),controller['getAgents']);router[_0x0e09('0x3')]('/queues',auth[_0x0e09('0x5')](),controller[_0x0e09('0x6')]);module[_0x0e09('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 7d6390b..81bf692 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 _0xf77b=['userProfileId','online','extraQueryConditions','UserProfile','getResources','User','findAndCountAll','rows','map','find','getAgentStatus','voice','voiceStatus','talking','Status','pause','pick','catch','getQueues','resolve','startCase','Queue','name','outbound','dialMethod','getOptions','QueueCampaigns','Queues','filter','assign','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','rawAttributes','fieldName','type','role','push','sequelize','literal','forEach','Pause','where','user'];(function(_0x623028,_0x5c3eb7){var _0x5ca7c6=function(_0x3f36cb){while(--_0x3f36cb){_0x623028['push'](_0x623028['shift']());}};_0x5ca7c6(++_0x5c3eb7);}(_0xf77b,0x174));var _0xbf77=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xf77b[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0xbf77('0x0'));var util=require(_0xbf77('0x1'));var rta=require(_0xbf77('0x2'));var rtq=require(_0xbf77('0x3'));var qs=require('../../components/parsers/qs');var utils=require(_0xbf77('0x4'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xbf77('0x5'))[_0xbf77('0x6')];var APIHandleError=require('../../errors/api')[_0xbf77('0x7')];function respondWithFilteredResult(_0x3202b3,_0x10fe64){return function(_0x508def){if(_0x508def){var _0x52e4e0=typeof _0x10fe64[_0xbf77('0x8')]===_0xbf77('0x9')&&typeof _0x10fe64[_0xbf77('0xa')]===_0xbf77('0x9');var _0x45114d=_0x508def[_0xbf77('0xb')];var _0x37852f=_0x52e4e0?0x0:_0x10fe64[_0xbf77('0x8')];var _0x5b6d77=_0x52e4e0?_0x508def['count']:_0x10fe64[_0xbf77('0x8')]+_0x10fe64[_0xbf77('0xa')];var _0x16890f;if(_0x5b6d77>=_0x45114d){_0x5b6d77=_0x45114d;_0x16890f=0xc8;}else{_0x16890f=0xce;}_0x3202b3[_0xbf77('0xc')](_0x16890f);return _0x3202b3[_0xbf77('0xd')](_0xbf77('0xe'),_0x37852f+'-'+_0x5b6d77+'/'+_0x45114d)[_0xbf77('0xf')](_0x508def);}return null;};}exports[_0xbf77('0x10')]=function(_0x5db5ba,_0x304a1a){var _0x4f0662={'count':0x0,'rows':[]};var _0x30f3d3={};var _0xd2c4a3;var _0x5a328f=utils[_0xbf77('0x11')]();var _0x183ce0;var _0x17bf40;var _0x35f6f3=_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x13')];var _0x2b418c=_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x14')];var _0x2ff344=_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x15')];var _0x18d08f=_0x2b418c==='pause'||_0x2b418c===_0xbf77('0x16')?!![]:![];var _0x26c336=[];var _0x3bfcc0;var _0x4a9ad7;Promise['resolve']()[_0xbf77('0x17')](function(){if(_0x5db5ba[_0xbf77('0x12')]['channel']){if(!utils[_0xbf77('0x18')](_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x19')])){throw new APIBadRequestError(util[_0xbf77('0x1a')](_0xbf77('0x1b'),_0x5db5ba['query']['channel']));}_0xd2c4a3=_0x5db5ba[_0xbf77('0x12')]['channel'][_0xbf77('0x1c')]();}if(!_0x5db5ba[_0xbf77('0x12')]['sort']||!_0x5db5ba['query'][_0xbf77('0x1d')][_0xbf77('0x1e')](_0xbf77('0x1f'))){_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x1d')]=rta[_0xbf77('0x20')](_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x1d')]);return;}var _0x23f101=rta[_0xbf77('0x21')](_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x1d')]);_0x5db5ba['query'][_0xbf77('0x1d')]=_0x23f101[_0xbf77('0x22')][_0xbf77('0x23')](',');_0x3bfcc0=_0x23f101[_0xbf77('0x24')];})[_0xbf77('0x17')](function(){if(!_0x35f6f3){return[];}return rta[_0xbf77('0x25')](_0x35f6f3,_0xd2c4a3);})[_0xbf77('0x17')](function(_0x1f0dd2){_0x26c336=_0x1f0dd2;return rta[_0xbf77('0x26')]();})['then'](function(_0x34733d){_0x17bf40=_0x34733d['rows'];if((!_0x2b418c||_0x18d08f)&&!_0x3bfcc0){return _0x26c336;}if(_0x3bfcc0&&!_0x2b418c){return rta[_0xbf77('0x27')](_0x17bf40,_0x26c336,_0x3bfcc0);}else{return rta[_0xbf77('0x28')](_0x17bf40,_0x26c336,_0x2b418c);}})[_0xbf77('0x17')](function(_0x2df0b5){_0x26c336=_0x2df0b5;var _0x408a6b=![];if(_0x26c336[_0xbf77('0x29')]===0x0){if(_0x35f6f3||_0x2b418c){_0x408a6b=!![];}if(_0x18d08f){_0x408a6b=![];}}if(_0x408a6b){return _0x4f0662;}var _0x4d1203=_['map'](db['User'][_0xbf77('0x2a')],function(_0x3404a3){return{'name':_0x3404a3[_0xbf77('0x2b')],'type':_0x3404a3[_0xbf77('0x2c')]['key']};});_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x2d')]='agent';_0x30f3d3=qs['getOptions'](_0x4d1203,_0x5db5ba);_0x30f3d3['raw']=!![];var _0x365555=[];if(_0x26c336[_0xbf77('0x29')]>0x0){_0x365555[_0xbf77('0x2e')]({'id':{'$in':_0x26c336}});if(_0x3bfcc0&&!_0x2b418c){_0x4a9ad7=[db[_0xbf77('0x2f')][_0xbf77('0x30')]('FIELD(id,'+_0x26c336+')')];_0x30f3d3[_0xbf77('0x24')]=_0x4a9ad7;}}if(_0x18d08f){_0x5a328f[_0xbf77('0x31')](function(_0x551dc0){var _0x80fc5a=!![];if(_0x2b418c===_0xbf77('0x16')&&_0xd2c4a3!==_0x551dc0){_0x80fc5a=![];}_0x365555[_0xbf77('0x2e')]({[_0x551dc0+_0xbf77('0x32')]:_0x80fc5a});});if(_0x2ff344){_0x365555['push']({'pauseType':_0x2ff344});}}else if(_0x2b418c){_0x5a328f['forEach'](function(_0x15e3b8){_0x365555[_0xbf77('0x2e')]({[_0x15e3b8+'Pause']:![]});});}_0x30f3d3[_0xbf77('0x33')]=_['merge'](_0x30f3d3[_0xbf77('0x33')],{'$and':_0x365555});if(_0x5db5ba[_0xbf77('0x34')][_0xbf77('0x2d')]===_0xbf77('0x34')){var _0x149d75={'params':{'id':_0x5db5ba[_0xbf77('0x34')][_0xbf77('0x35')]},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x26c336,'customSorting':_0x4a9ad7}};if(_0x5db5ba[_0xbf77('0x12')][_0xbf77('0x36')]){_0x149d75[_0xbf77('0x12')]['online']=!![];}if(_0x18d08f){_0x149d75[_0xbf77('0x12')][_0xbf77('0x37')]=_0x365555;}_0x149d75['query']=Object['assign'](_0x149d75[_0xbf77('0x12')],_0x5db5ba['query']);return db[_0xbf77('0x38')][_0xbf77('0x39')](_0x149d75);}return db[_0xbf77('0x3a')][_0xbf77('0x3b')](_0x30f3d3);})['then'](function(_0x24313c){_0x4f0662[_0xbf77('0xb')]=_0x24313c['count'];_0x183ce0=_0x24313c[_0xbf77('0x3c')];return _0x183ce0[_0xbf77('0x3d')](function(_0x29af4e){var _0x5ee344=_[_0xbf77('0x3e')](_0x17bf40,['id',_0x29af4e['id']]);if(_0x5ee344){var _0x5a872c=rta['filterAgentAttributes'](_0x5ee344);_['merge'](_0x29af4e,_0x5a872c);}_0x29af4e[_0xbf77('0x1f')]=rta[_0xbf77('0x3f')](_0x29af4e);if(_0x29af4e[_0xbf77('0x1f')][_0xbf77('0x1e')]('pause')){_0x5a328f[_0xbf77('0x31')](function(_0x224aef){if(_0x29af4e[_0x224aef+_0xbf77('0x32')]){if(_0x224aef===_0xbf77('0x40')){if(_0x29af4e[_0xbf77('0x41')]!==_0xbf77('0x42')){_0x29af4e[_0xbf77('0x41')]='pause';}}else{_0x29af4e[_0x224aef+_0xbf77('0x43')]=_0xbf77('0x44');}}});}return _0x29af4e;});})[_0xbf77('0x17')](function(_0x4d5087){if(!_0x3bfcc0||_0x4a9ad7){return _0x4d5087;}return rta['sortAgentsByStatus'](_0x4d5087,_0x3bfcc0);})['then'](function(_0x575f10){var _0x4d1c1f=rta['getRealtimeAgentsQueryFields']();_0x4f0662[_0xbf77('0x3c')]=_0x575f10['map'](function(_0xe1df79){return _[_0xbf77('0x45')](_0xe1df79,_0x4d1c1f);});return _0x4f0662;})[_0xbf77('0x17')](respondWithFilteredResult(_0x304a1a,_0x30f3d3))[_0xbf77('0x46')](APIHandleError(_0x304a1a));};exports[_0xbf77('0x47')]=function(_0x4ce7d4,_0x41d1a4){var _0x80925={'count':0x0,'rows':[]};var _0x1d3327={};var _0x37ce98;var _0x77a439;var _0x22dc4c;Promise[_0xbf77('0x48')]()[_0xbf77('0x17')](function(){if(_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x19')]){if(!utils[_0xbf77('0x18')](_0x4ce7d4['query'][_0xbf77('0x19')])){throw new APIBadRequestError(util[_0xbf77('0x1a')](_0xbf77('0x1b'),_0x4ce7d4['query'][_0xbf77('0x19')]));}_0x37ce98=_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x19')]['toLowerCase']();}var _0x2edacd=_[_0xbf77('0x49')](_0x37ce98)+_0xbf77('0x4a');var _0x1bbbc0=_[_0xbf77('0x3d')](db[_0x2edacd][_0xbf77('0x2a')],function(_0x25e868){return{'name':_0x25e868['fieldName'],'type':_0x25e868[_0xbf77('0x2c')]['key']};});if(!_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x22')]){var _0x1a091e=['id',_0xbf77('0x4b')];if(_0x37ce98===_0xbf77('0x40')){_0x1a091e[_0xbf77('0x2e')]('type');if(_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x2c')]===_0xbf77('0x4c')){_0x1a091e[_0xbf77('0x2e')](['dialActive',_0xbf77('0x4d')]);}}_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x22')]=_0x1a091e['join'](',');}_0x1d3327=qs[_0xbf77('0x4e')](_0x1bbbc0,_0x4ce7d4);if(_0x4ce7d4[_0xbf77('0x34')][_0xbf77('0x2d')]===_0xbf77('0x34')){var _0x477431={'params':{'id':_0x4ce7d4[_0xbf77('0x34')][_0xbf77('0x35')]},'query':{'section':_0x37ce98==='voice'&&_0x4ce7d4[_0xbf77('0x12')]['type']===_0xbf77('0x4c')?_0xbf77('0x4f'):_[_0xbf77('0x49')](_0x37ce98)+_0xbf77('0x50'),'type':_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x2c')],'nolimit':!![],'sort':_0xbf77('0x4b'),'filter':_0x4ce7d4[_0xbf77('0x12')][_0xbf77('0x51')]}};_0x477431[_0xbf77('0x12')]=Object[_0xbf77('0x52')](_0x477431[_0xbf77('0x12')],_0x4ce7d4['query']);delete _0x477431[_0xbf77('0x12')]['id'];return db[_0xbf77('0x38')][_0xbf77('0x39')](_0x477431);}return db[_0x2edacd][_0xbf77('0x3b')](_0x1d3327);})['then'](function(_0x1fb05e){_0x80925[_0xbf77('0xb')]=_0x1fb05e[_0xbf77('0xb')];_0x77a439=_0x1fb05e[_0xbf77('0x3c')];return rtq[_0xbf77('0x53')](_0x4ce7d4,_0x37ce98);})[_0xbf77('0x17')](function(_0x5373bf){_0x22dc4c=_0x5373bf['rows'];return rtq[_0xbf77('0x54')](_0x77a439,_0x22dc4c,_0x37ce98,_0x4ce7d4['query'][_0xbf77('0x2c')]);})['then'](function(_0x16f6a8){_0x80925[_0xbf77('0x3c')]=_0x16f6a8;return _0x80925;})[_0xbf77('0x17')](respondWithFilteredResult(_0x41d1a4,_0x1d3327))[_0xbf77('0x46')](APIHandleError(_0x41d1a4));}; \ No newline at end of file +var _0x1fa7=['Queue','rawAttributes','fieldName','key','name','outbound','dialActive','dialMethod','QueueCampaigns','startCase','Queues','filter','assign','getResources','getRealtimeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','getAgents','query','globalStatusFilter','*pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','then','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','type','agent','getOptions','raw','push','literal','forEach','Pause','where','merge','user','role','userProfileId','Agents','online','UserProfile','findAndCountAll','find','filterAgentAttributes','getAgentStatus','pause','voice','voiceStatus','talking','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x1fa7,0x163));var _0x71fa=function(_0x4dadee,_0x47c2bc){_0x4dadee=_0x4dadee-0x0;var _0xc35e87=_0x1fa7[_0x4dadee];return _0xc35e87;};'use strict';var _=require(_0x71fa('0x0'));var util=require(_0x71fa('0x1'));var rta=require(_0x71fa('0x2'));var rtq=require(_0x71fa('0x3'));var qs=require(_0x71fa('0x4'));var utils=require(_0x71fa('0x5'));var db=require(_0x71fa('0x6'))['db'];var APIBadRequestError=require(_0x71fa('0x7'))[_0x71fa('0x8')];var APIHandleError=require(_0x71fa('0x7'))[_0x71fa('0x9')];function respondWithFilteredResult(_0x49922c,_0x12ccb1){return function(_0x2109af){if(_0x2109af){var _0x11cff9=typeof _0x12ccb1[_0x71fa('0xa')]===_0x71fa('0xb')&&typeof _0x12ccb1['limit']===_0x71fa('0xb');var _0x2eb921=_0x2109af[_0x71fa('0xc')];var _0x43e165=_0x11cff9?0x0:_0x12ccb1[_0x71fa('0xa')];var _0x182dcd=_0x11cff9?_0x2109af[_0x71fa('0xc')]:_0x12ccb1[_0x71fa('0xa')]+_0x12ccb1[_0x71fa('0xd')];var _0x1e2902;if(_0x182dcd>=_0x2eb921){_0x182dcd=_0x2eb921;_0x1e2902=0xc8;}else{_0x1e2902=0xce;}_0x49922c[_0x71fa('0xe')](_0x1e2902);return _0x49922c[_0x71fa('0xf')]('Content-Range',_0x43e165+'-'+_0x182dcd+'/'+_0x2eb921)['json'](_0x2109af);}return null;};}exports[_0x71fa('0x10')]=function(_0x4d2f67,_0x302732){var _0x3d865f={'count':0x0,'rows':[]};var _0x175591={};var _0x3b3fcf;var _0x4ed44a=utils['getChannels']();var _0x1cba5a;var _0x8f7be8;var _0x1f99ff=_0x4d2f67[_0x71fa('0x11')]['globalQueueFilter'];var _0x12c213=_0x4d2f67['query'][_0x71fa('0x12')];var _0x537b5f=_0x4d2f67[_0x71fa('0x11')]['pauseTypeFilter'];var _0x2b86d0=_0x12c213==='pause'||_0x12c213===_0x71fa('0x13')?!![]:![];var _0x2ab36a=[];var _0x204709;var _0x4a6afd;Promise[_0x71fa('0x14')]()['then'](function(){if(_0x4d2f67[_0x71fa('0x11')][_0x71fa('0x15')]){if(!utils[_0x71fa('0x16')](_0x4d2f67['query'][_0x71fa('0x15')])){throw new APIBadRequestError(util[_0x71fa('0x17')](_0x71fa('0x18'),_0x4d2f67['query'][_0x71fa('0x15')]));}_0x3b3fcf=_0x4d2f67[_0x71fa('0x11')][_0x71fa('0x15')][_0x71fa('0x19')]();}if(!_0x4d2f67[_0x71fa('0x11')]['sort']||!_0x4d2f67['query'][_0x71fa('0x1a')][_0x71fa('0x1b')](_0x71fa('0x1c'))){_0x4d2f67[_0x71fa('0x11')][_0x71fa('0x1a')]=rta['validateSortParameter'](_0x4d2f67['query'][_0x71fa('0x1a')]);return;}var _0x3ecb8e=rta[_0x71fa('0x1d')](_0x4d2f67[_0x71fa('0x11')][_0x71fa('0x1a')]);_0x4d2f67[_0x71fa('0x11')][_0x71fa('0x1a')]=_0x3ecb8e[_0x71fa('0x1e')][_0x71fa('0x1f')](',');_0x204709=_0x3ecb8e[_0x71fa('0x20')];})[_0x71fa('0x21')](function(){if(!_0x1f99ff){return[];}return rta[_0x71fa('0x22')](_0x1f99ff,_0x3b3fcf);})[_0x71fa('0x21')](function(_0x362890){_0x2ab36a=_0x362890;return rta[_0x71fa('0x23')]();})['then'](function(_0x27662d){_0x8f7be8=_0x27662d[_0x71fa('0x24')];if((!_0x12c213||_0x2b86d0)&&!_0x204709){return _0x2ab36a;}if(_0x204709&&!_0x12c213){return rta[_0x71fa('0x25')](_0x8f7be8,_0x2ab36a,_0x204709);}else{return rta[_0x71fa('0x26')](_0x8f7be8,_0x2ab36a,_0x12c213);}})[_0x71fa('0x21')](function(_0x7439a9){_0x2ab36a=_0x7439a9;var _0x20e9a4=![];if(_0x2ab36a['length']===0x0){if(_0x1f99ff||_0x12c213){_0x20e9a4=!![];}if(_0x2b86d0){_0x20e9a4=![];}}if(_0x20e9a4){return _0x3d865f;}var _0x19e68f=_[_0x71fa('0x27')](db[_0x71fa('0x28')]['rawAttributes'],function(_0x55e6a1){return{'name':_0x55e6a1['fieldName'],'type':_0x55e6a1[_0x71fa('0x29')]['key']};});_0x4d2f67['query']['role']=_0x71fa('0x2a');_0x175591=qs[_0x71fa('0x2b')](_0x19e68f,_0x4d2f67);_0x175591[_0x71fa('0x2c')]=!![];var _0x28de65=[];if(_0x2ab36a['length']>0x0){_0x28de65[_0x71fa('0x2d')]({'id':{'$in':_0x2ab36a}});if(_0x204709&&!_0x12c213){_0x4a6afd=[db['sequelize'][_0x71fa('0x2e')]('FIELD(id,'+_0x2ab36a+')')];_0x175591['order']=_0x4a6afd;}}if(_0x2b86d0){_0x4ed44a[_0x71fa('0x2f')](function(_0x598782){var _0x4e4103=!![];if(_0x12c213==='*pause'&&_0x3b3fcf!==_0x598782){_0x4e4103=![];}_0x28de65[_0x71fa('0x2d')]({[_0x598782+_0x71fa('0x30')]:_0x4e4103});});if(_0x537b5f){_0x28de65['push']({'pauseType':_0x537b5f});}}else if(_0x12c213){_0x4ed44a[_0x71fa('0x2f')](function(_0x3930a7){_0x28de65['push']({[_0x3930a7+_0x71fa('0x30')]:![]});});}_0x175591[_0x71fa('0x31')]=_[_0x71fa('0x32')](_0x175591[_0x71fa('0x31')],{'$and':_0x28de65});if(_0x4d2f67[_0x71fa('0x33')][_0x71fa('0x34')]===_0x71fa('0x33')){var _0x37130c={'params':{'id':_0x4d2f67[_0x71fa('0x33')][_0x71fa('0x35')]},'query':{'section':_0x71fa('0x36'),'role':_0x71fa('0x2a'),'raw':!![],'ids':_0x2ab36a,'customSorting':_0x4a6afd}};if(_0x4d2f67['query']['online']){_0x37130c['query'][_0x71fa('0x37')]=!![];}if(_0x2b86d0){_0x37130c[_0x71fa('0x11')]['extraQueryConditions']=_0x28de65;}_0x37130c[_0x71fa('0x11')]=Object['assign'](_0x37130c[_0x71fa('0x11')],_0x4d2f67[_0x71fa('0x11')]);return db[_0x71fa('0x38')]['getResources'](_0x37130c);}return db[_0x71fa('0x28')][_0x71fa('0x39')](_0x175591);})['then'](function(_0x523349){_0x3d865f[_0x71fa('0xc')]=_0x523349[_0x71fa('0xc')];_0x1cba5a=_0x523349['rows'];return _0x1cba5a[_0x71fa('0x27')](function(_0x5b5621){var _0x20673b=_[_0x71fa('0x3a')](_0x8f7be8,['id',_0x5b5621['id']]);if(_0x20673b){var _0x158073=rta[_0x71fa('0x3b')](_0x20673b);_['merge'](_0x5b5621,_0x158073);}_0x5b5621[_0x71fa('0x1c')]=rta[_0x71fa('0x3c')](_0x5b5621);if(_0x5b5621['globalStatus'][_0x71fa('0x1b')](_0x71fa('0x3d'))){_0x4ed44a[_0x71fa('0x2f')](function(_0x2aaae0){if(_0x5b5621[_0x2aaae0+_0x71fa('0x30')]){if(_0x2aaae0===_0x71fa('0x3e')){if(_0x5b5621[_0x71fa('0x3f')]!==_0x71fa('0x40')){_0x5b5621[_0x71fa('0x3f')]=_0x71fa('0x3d');}}else{_0x5b5621[_0x2aaae0+'Status']=_0x71fa('0x3d');}}});}return _0x5b5621;});})[_0x71fa('0x21')](function(_0x2f0de4){if(!_0x204709||_0x4a6afd){return _0x2f0de4;}return rta[_0x71fa('0x41')](_0x2f0de4,_0x204709);})[_0x71fa('0x21')](function(_0x15bf50){var _0x443ce2=rta[_0x71fa('0x42')]();_0x3d865f[_0x71fa('0x24')]=_0x15bf50[_0x71fa('0x27')](function(_0x246808){return _[_0x71fa('0x43')](_0x246808,_0x443ce2);});return _0x3d865f;})[_0x71fa('0x21')](respondWithFilteredResult(_0x302732,_0x175591))[_0x71fa('0x44')](APIHandleError(_0x302732));};exports[_0x71fa('0x45')]=function(_0x3f080b,_0x4bccf4){var _0x13e835={'count':0x0,'rows':[]};var _0x5656d9={};var _0x7841e7;var _0x167b57;var _0x4d3221;Promise[_0x71fa('0x14')]()['then'](function(){if(_0x3f080b['query'][_0x71fa('0x15')]){if(!utils[_0x71fa('0x16')](_0x3f080b[_0x71fa('0x11')][_0x71fa('0x15')])){throw new APIBadRequestError(util[_0x71fa('0x17')](_0x71fa('0x18'),_0x3f080b['query'][_0x71fa('0x15')]));}_0x7841e7=_0x3f080b['query'][_0x71fa('0x15')][_0x71fa('0x19')]();}var _0x5a7585=_['startCase'](_0x7841e7)+_0x71fa('0x46');var _0x407b4b=_['map'](db[_0x5a7585][_0x71fa('0x47')],function(_0x544209){return{'name':_0x544209[_0x71fa('0x48')],'type':_0x544209['type'][_0x71fa('0x49')]};});if(!_0x3f080b['query']['fields']){var _0x51544e=['id',_0x71fa('0x4a')];if(_0x7841e7===_0x71fa('0x3e')){_0x51544e[_0x71fa('0x2d')](_0x71fa('0x29'));if(_0x3f080b['query'][_0x71fa('0x29')]===_0x71fa('0x4b')){_0x51544e['push']([_0x71fa('0x4c'),_0x71fa('0x4d')]);}}_0x3f080b[_0x71fa('0x11')][_0x71fa('0x1e')]=_0x51544e[_0x71fa('0x1f')](',');}_0x5656d9=qs[_0x71fa('0x2b')](_0x407b4b,_0x3f080b);if(_0x3f080b[_0x71fa('0x33')][_0x71fa('0x34')]===_0x71fa('0x33')){var _0x38de3f={'params':{'id':_0x3f080b['user'][_0x71fa('0x35')]},'query':{'section':_0x7841e7===_0x71fa('0x3e')&&_0x3f080b[_0x71fa('0x11')][_0x71fa('0x29')]===_0x71fa('0x4b')?_0x71fa('0x4e'):_[_0x71fa('0x4f')](_0x7841e7)+_0x71fa('0x50'),'type':_0x3f080b['query'][_0x71fa('0x29')],'nolimit':!![],'sort':_0x71fa('0x4a'),'filter':_0x3f080b[_0x71fa('0x11')][_0x71fa('0x51')]}};_0x38de3f[_0x71fa('0x11')]=Object[_0x71fa('0x52')](_0x38de3f['query'],_0x3f080b[_0x71fa('0x11')]);delete _0x38de3f[_0x71fa('0x11')]['id'];return db[_0x71fa('0x38')][_0x71fa('0x53')](_0x38de3f);}return db[_0x5a7585][_0x71fa('0x39')](_0x5656d9);})['then'](function(_0x2a8d92){_0x13e835[_0x71fa('0xc')]=_0x2a8d92[_0x71fa('0xc')];_0x167b57=_0x2a8d92[_0x71fa('0x24')];return rtq[_0x71fa('0x54')](_0x3f080b,_0x7841e7);})[_0x71fa('0x21')](function(_0x17f5ca){_0x4d3221=_0x17f5ca[_0x71fa('0x24')];return rtq['initializeQueues'](_0x167b57,_0x4d3221,_0x7841e7,_0x3f080b[_0x71fa('0x11')][_0x71fa('0x29')]);})['then'](function(_0x26a269){_0x13e835[_0x71fa('0x24')]=_0x26a269;return _0x13e835;})[_0x71fa('0x21')](respondWithFilteredResult(_0x4bccf4,_0x5656d9))['catch'](APIHandleError(_0x4bccf4));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index c675975..80b9f77 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x524e23,_0x1e2aa7){var _0x231413=function(_0x22ac35){while(--_0x22ac35){_0x524e23['push'](_0x524e23['shift']());}};_0x231413(++_0x1e2aa7);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'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(_0x2ff9e6,_0x5c62a8){var _0x14b8f6=function(_0x5b6a9e){while(--_0x5b6a9e){_0x2ff9e6['push'](_0x2ff9e6['shift']());}};_0x14b8f6(++_0x5c62a8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0xcb91[_0x13187a];return _0x65b85f;};'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 0c66eed..8f03771 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb9=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x89ef7c,_0xce0be5){var _0x3f7ba7=function(_0x341475){while(--_0x341475){_0x89ef7c['push'](_0x89ef7c['shift']());}};_0x3f7ba7(++_0xce0be5);}(_0xafb9,0x68));var _0x9afb=function(_0x91379f,_0x538118){_0x91379f=_0x91379f-0x0;var _0x4c70b0=_0xafb9[_0x91379f];return _0x4c70b0;};'use strict';var Sequelize=require(_0x9afb('0x0'));module[_0x9afb('0x1')]={'state':{'type':Sequelize[_0x9afb('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9afb('0x3')]},'scheduledat':{'type':Sequelize[_0x9afb('0x4')]},'uniqueid':{'type':Sequelize[_0x9afb('0x3')]},'starttime':{'type':Sequelize[_0x9afb('0x4')]},'responsetime':{'type':Sequelize[_0x9afb('0x4')]},'ringtime':{'type':Sequelize[_0x9afb('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9afb('0x3')]}}; \ No newline at end of file +var _0x398a=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x4b85dd,_0x2aa0d4){var _0x2f3d99=function(_0x372b14){while(--_0x372b14){_0x4b85dd['push'](_0x4b85dd['shift']());}};_0x2f3d99(++_0x2aa0d4);}(_0x398a,0x11a));var _0xa398=function(_0x5bc2b5,_0x39f3b0){_0x5bc2b5=_0x5bc2b5-0x0;var _0x218898=_0x398a[_0x5bc2b5];return _0x218898;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'state':{'type':Sequelize[_0xa398('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa398('0x3')]},'scheduledat':{'type':Sequelize[_0xa398('0x4')]},'uniqueid':{'type':Sequelize[_0xa398('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa398('0x3')]},'campaigntype':{'type':Sequelize[_0xa398('0x3')]},'membername':{'type':Sequelize[_0xa398('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index bd0dc0c..5ed283e 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 _0xb3c9=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0xb3c9,0x1f1));var _0x9b3c=function(_0x49ce6a,_0x5f3fe3){_0x49ce6a=_0x49ce6a-0x0;var _0x340949=_0xb3c9[_0x49ce6a];return _0x340949;};'use strict';var _=require(_0x9b3c('0x0'));var util=require(_0x9b3c('0x1'));var logger=require(_0x9b3c('0x2'))(_0x9b3c('0x3'));var moment=require('moment');var BPromise=require(_0x9b3c('0x4'));var rp=require(_0x9b3c('0x5'));var fs=require('fs');var path=require(_0x9b3c('0x6'));var rimraf=require(_0x9b3c('0x7'));var config=require(_0x9b3c('0x8'));var attributes=require(_0x9b3c('0x9'));module[_0x9b3c('0xa')]=function(_0x37c678,_0x41787b){return _0x37c678['define'](_0x9b3c('0xb'),attributes,{'tableName':_0x9b3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a4=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xc6a4,0x14c));var _0x4c6a=function(_0x5dfb16,_0x25d139){_0x5dfb16=_0x5dfb16-0x0;var _0x4750a8=_0xc6a4[_0x5dfb16];return _0x4750a8;};'use strict';var _=require(_0x4c6a('0x0'));var util=require(_0x4c6a('0x1'));var logger=require(_0x4c6a('0x2'))(_0x4c6a('0x3'));var moment=require(_0x4c6a('0x4'));var BPromise=require(_0x4c6a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4c6a('0x6'));var config=require(_0x4c6a('0x7'));var attributes=require(_0x4c6a('0x8'));module[_0x4c6a('0x9')]=function(_0x2ece16,_0x3dbcaf){return _0x2ece16[_0x4c6a('0xa')](_0x4c6a('0xb'),attributes,{'tableName':_0x4c6a('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 17264f2..9b281a3 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 _0x7421=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x418082,_0x22f950){var _0x3a57b5=function(_0x508822){while(--_0x508822){_0x418082['push'](_0x418082['shift']());}};_0x3a57b5(++_0x22f950);}(_0x7421,0x8c));var _0x1742=function(_0x52a188,_0x56b9c5){_0x52a188=_0x52a188-0x0;var _0x265843=_0x7421[_0x52a188];return _0x265843;};'use strict';var _=require(_0x1742('0x0'));var util=require(_0x1742('0x1'));var moment=require(_0x1742('0x2'));var BPromise=require(_0x1742('0x3'));var rs=require(_0x1742('0x4'));var fs=require('fs');var Redis=require(_0x1742('0x5'));var db=require(_0x1742('0x6'))['db'];var utils=require(_0x1742('0x7'));var logger=require(_0x1742('0x8'))(_0x1742('0x9'));var config=require(_0x1742('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1742('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5998b0,_0x2b4293,_0x3453d0){return new BPromise(function(_0x2208fe,_0x5a8439){return client[_0x1742('0xc')](_0x5998b0,_0x3453d0)['then'](function(_0x2dd55e){logger['info'](_0x1742('0xd'),_0x2b4293,_0x1742('0xe'));logger[_0x1742('0xf')](_0x1742('0x10'),_0x2b4293,'request\x20sent',JSON['stringify'](_0x2dd55e));if(_0x2dd55e[_0x1742('0x11')]){if(_0x2dd55e[_0x1742('0x11')][_0x1742('0x12')]===0x1f4){logger[_0x1742('0x11')](_0x1742('0xd'),_0x2b4293,_0x2dd55e[_0x1742('0x11')][_0x1742('0x13')]);return _0x5a8439(_0x2dd55e[_0x1742('0x11')][_0x1742('0x13')]);}logger[_0x1742('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x2b4293,_0x2dd55e['error'][_0x1742('0x13')]);return _0x2208fe(_0x2dd55e[_0x1742('0x11')][_0x1742('0x13')]);}else{logger[_0x1742('0x14')](_0x1742('0xd'),_0x2b4293,_0x1742('0xe'));_0x2208fe(_0x2dd55e[_0x1742('0x15')]['message']);}})[_0x1742('0x16')](function(_0x27483a){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2b4293,_0x27483a);_0x5a8439(_0x27483a);});});}exports[_0x1742('0x17')]=function(_0x49bbdb){var _0x42830c=this;return new Promise(function(_0x4b5716,_0x208aab){return db[_0x1742('0x18')][_0x1742('0x19')](_0x49bbdb['body'],{'raw':_0x49bbdb[_0x1742('0x1a')]?_0x49bbdb[_0x1742('0x1a')][_0x1742('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x12e771){logger[_0x1742('0x14')](_0x1742('0x17'),_0x49bbdb);logger[_0x1742('0xf')](_0x1742('0x17'),_0x49bbdb,JSON[_0x1742('0x1c')](_0x12e771));_0x4b5716(_0x12e771);})[_0x1742('0x16')](function(_0x386f7b){logger['error'](_0x1742('0x17'),_0x386f7b['message'],_0x49bbdb);_0x208aab(_0x42830c['error'](0x1f4,_0x386f7b['message']));});});}; \ No newline at end of file +var _0x78b9=['http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ReportAgentPreview','body','raw','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x78b9,0x123));var _0x978b=function(_0x5ba141,_0x3a34ec){_0x5ba141=_0x5ba141-0x0;var _0x410354=_0x78b9[_0x5ba141];return _0x410354;};'use strict';var _=require(_0x978b('0x0'));var util=require('util');var moment=require(_0x978b('0x1'));var BPromise=require(_0x978b('0x2'));var rs=require(_0x978b('0x3'));var fs=require('fs');var Redis=require(_0x978b('0x4'));var db=require(_0x978b('0x5'))['db'];var utils=require(_0x978b('0x6'));var logger=require(_0x978b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x978b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ab7e0,_0x36db22,_0x3704ef){return new BPromise(function(_0x1d115d,_0x541212){return client['request'](_0x2ab7e0,_0x3704ef)[_0x978b('0x9')](function(_0x29b4ab){logger[_0x978b('0xa')](_0x978b('0xb'),_0x36db22,_0x978b('0xc'));logger[_0x978b('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x36db22,_0x978b('0xc'),JSON[_0x978b('0xe')](_0x29b4ab));if(_0x29b4ab[_0x978b('0xf')]){if(_0x29b4ab[_0x978b('0xf')]['code']===0x1f4){logger[_0x978b('0xf')](_0x978b('0xb'),_0x36db22,_0x29b4ab[_0x978b('0xf')]['message']);return _0x541212(_0x29b4ab[_0x978b('0xf')][_0x978b('0x10')]);}logger[_0x978b('0xf')](_0x978b('0xb'),_0x36db22,_0x29b4ab[_0x978b('0xf')][_0x978b('0x10')]);return _0x1d115d(_0x29b4ab[_0x978b('0xf')][_0x978b('0x10')]);}else{logger['info'](_0x978b('0xb'),_0x36db22,_0x978b('0xc'));_0x1d115d(_0x29b4ab[_0x978b('0x11')][_0x978b('0x10')]);}})[_0x978b('0x12')](function(_0x3b9a34){logger[_0x978b('0xf')](_0x978b('0xb'),_0x36db22,_0x3b9a34);_0x541212(_0x3b9a34);});});}exports['CreateReportAgentPreview']=function(_0x17641a){var _0x394b2c=this;return new Promise(function(_0xbe000e,_0x1b0a22){return db[_0x978b('0x13')]['create'](_0x17641a[_0x978b('0x14')],{'raw':_0x17641a['options']?_0x17641a['options'][_0x978b('0x15')]===undefined?!![]:![]:!![]})[_0x978b('0x9')](function(_0x317970){logger[_0x978b('0xa')](_0x978b('0x16'),_0x17641a);logger[_0x978b('0xd')](_0x978b('0x16'),_0x17641a,JSON[_0x978b('0xe')](_0x317970));_0xbe000e(_0x317970);})[_0x978b('0x12')](function(_0x36af6b){logger[_0x978b('0xf')]('CreateReportAgentPreview',_0x36af6b['message'],_0x17641a);_0x1b0a22(_0x394b2c[_0x978b('0xf')](0x1f4,_0x36af6b[_0x978b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 81e1502..0f543be 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 _0x7a14=['/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','chat','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','multer','express','Router','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel'];(function(_0x3ae99a,_0x1209a9){var _0x12b5f6=function(_0x43c9d1){while(--_0x43c9d1){_0x3ae99a['push'](_0x3ae99a['shift']());}};_0x12b5f6(++_0x1209a9);}(_0x7a14,0x18e));var _0x47a1=function(_0x32fcf2,_0x446129){_0x32fcf2=_0x32fcf2-0x0;var _0x53d767=_0x7a14[_0x32fcf2];return _0x53d767;};'use strict';var multer=require(_0x47a1('0x0'));var util=require('util');var path=require('path');var express=require(_0x47a1('0x1'));var router=express[_0x47a1('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0x47a1('0x3'));router[_0x47a1('0x4')]('/voice/channels',auth[_0x47a1('0x5')](),controller['voiceChannels']);router[_0x47a1('0x4')](_0x47a1('0x6'),auth['isAuthenticated'](),controller[_0x47a1('0x7')]);router[_0x47a1('0x4')](_0x47a1('0x8'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x9')]);router[_0x47a1('0x4')](_0x47a1('0xa'),auth['isAuthenticated'](),controller['voiceQueues']);router['get'](_0x47a1('0xb'),auth[_0x47a1('0x5')](),controller[_0x47a1('0xc')]);router[_0x47a1('0x4')](_0x47a1('0xd'),auth['isAuthenticated'](),controller[_0x47a1('0xe')]);router[_0x47a1('0x4')](_0x47a1('0xf'),auth[_0x47a1('0x5')](),controller['mailAccounts']);router['get'](_0x47a1('0x10'),auth[_0x47a1('0x5')](),controller['openchannelQueues']);router['get'](_0x47a1('0x11'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x12')]);router[_0x47a1('0x4')](_0x47a1('0x13'),auth[_0x47a1('0x5')](),controller['whatsappQueues']);router[_0x47a1('0x4')](_0x47a1('0x14'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x15')]);router[_0x47a1('0x4')](_0x47a1('0x16'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x17')]);router[_0x47a1('0x4')](_0x47a1('0x18'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x19')]);router[_0x47a1('0x4')](_0x47a1('0x1a'),auth['isAuthenticated'](),controller[_0x47a1('0x1b')]);router[_0x47a1('0x4')](_0x47a1('0x1c'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x1d')]);router[_0x47a1('0x4')](_0x47a1('0x1e'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x1f')]);router[_0x47a1('0x4')]('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router['put'](_0x47a1('0x20'),auth['isAuthenticated'](),controller[_0x47a1('0x21')]);router[_0x47a1('0x4')]('/outbound',auth[_0x47a1('0x5')](),controller['outbound']);router['get'](_0x47a1('0x22'),auth[_0x47a1('0x5')](),controller['outboundChannels']);router[_0x47a1('0x4')](_0x47a1('0x23'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x24')]);router['put'](_0x47a1('0x25'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x47a1('0x4')](_0x47a1('0x26'),auth[_0x47a1('0x5')](),controller['telephones']);router[_0x47a1('0x4')](_0x47a1('0x27'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x28')]);router[_0x47a1('0x4')](_0x47a1('0x29'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x2a')]);router[_0x47a1('0x4')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x47a1('0x2b')]);router[_0x47a1('0x4')](_0x47a1('0x2c'),auth[_0x47a1('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x47a1('0x4')](_0x47a1('0x2d'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x2e')]);router[_0x47a1('0x4')](_0x47a1('0x2f'),auth[_0x47a1('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0x47a1('0x4')](_0x47a1('0x30'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x31')]);router[_0x47a1('0x4')]('/sms/queues/waitinginteractions',auth[_0x47a1('0x5')](),controller[_0x47a1('0x32')]);router['get'](_0x47a1('0x33'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x34')]);router[_0x47a1('0x4')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x47a1('0x35')]);router[_0x47a1('0x36')](_0x47a1('0x37'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x38')]('mail'));router[_0x47a1('0x4')]('/mail/queues/:id',auth[_0x47a1('0x5')](),controller['showMailQueues']);router[_0x47a1('0x36')]('/chat/queues/:id/notify',auth[_0x47a1('0x5')](),controller[_0x47a1('0x38')](_0x47a1('0x39')));router[_0x47a1('0x4')]('/chat/queues/:id',auth[_0x47a1('0x5')](),controller['showChatQueues']);router[_0x47a1('0x36')](_0x47a1('0x3a'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x38')](_0x47a1('0x3b')));router[_0x47a1('0x4')]('/fax/queues/:id',auth[_0x47a1('0x5')](),controller['showFaxQueues']);router[_0x47a1('0x36')](_0x47a1('0x3c'),auth['isAuthenticated'](),controller[_0x47a1('0x38')](_0x47a1('0x3d')));router[_0x47a1('0x4')]('/openchannel/queues/:id',auth[_0x47a1('0x5')](),controller[_0x47a1('0x3e')]);router[_0x47a1('0x36')](_0x47a1('0x3f'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x38')](_0x47a1('0x40')));router[_0x47a1('0x36')](_0x47a1('0x41'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x38')]('whatsapp'));router[_0x47a1('0x4')](_0x47a1('0x42'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x43')]);router[_0x47a1('0x4')](_0x47a1('0x44'),auth[_0x47a1('0x5')](),controller[_0x47a1('0x45')]);router['post'](_0x47a1('0x46'),auth['isAuthenticated'](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0x4740=['/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','fax','/fax/queues/:id','showFaxQueues','post','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','express','Router','../../components/auth/service','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions'];(function(_0x3f8997,_0xe9e4d1){var _0x3274e0=function(_0xb2732c){while(--_0xb2732c){_0x3f8997['push'](_0x3f8997['shift']());}};_0x3274e0(++_0xe9e4d1);}(_0x4740,0x107));var _0x0474=function(_0x5ea5e2,_0x1dde7a){_0x5ea5e2=_0x5ea5e2-0x0;var _0x14ea4f=_0x4740[_0x5ea5e2];return _0x14ea4f;};'use strict';var multer=require(_0x0474('0x0'));var util=require(_0x0474('0x1'));var path=require('path');var express=require(_0x0474('0x2'));var router=express[_0x0474('0x3')]();var auth=require(_0x0474('0x4'));var controller=require('./rpc.controller');router[_0x0474('0x5')](_0x0474('0x6'),auth['isAuthenticated'](),controller[_0x0474('0x7')]);router[_0x0474('0x5')](_0x0474('0x8'),auth[_0x0474('0x9')](),controller[_0x0474('0xa')]);router['get'](_0x0474('0xb'),auth['isAuthenticated'](),controller[_0x0474('0xc')]);router[_0x0474('0x5')](_0x0474('0xd'),auth[_0x0474('0x9')](),controller[_0x0474('0xe')]);router[_0x0474('0x5')]('/chat/queues',auth[_0x0474('0x9')](),controller[_0x0474('0xf')]);router[_0x0474('0x5')](_0x0474('0x10'),auth[_0x0474('0x9')](),controller['mailQueues']);router[_0x0474('0x5')]('/mail/accounts',auth[_0x0474('0x9')](),controller[_0x0474('0x11')]);router[_0x0474('0x5')](_0x0474('0x12'),auth[_0x0474('0x9')](),controller['openchannelQueues']);router['get'](_0x0474('0x13'),auth[_0x0474('0x9')](),controller[_0x0474('0x14')]);router[_0x0474('0x5')](_0x0474('0x15'),auth[_0x0474('0x9')](),controller['whatsappQueues']);router['get'](_0x0474('0x16'),auth[_0x0474('0x9')](),controller[_0x0474('0x17')]);router[_0x0474('0x5')](_0x0474('0x18'),auth['isAuthenticated'](),controller[_0x0474('0x19')]);router[_0x0474('0x5')](_0x0474('0x1a'),auth[_0x0474('0x9')](),controller[_0x0474('0x1b')]);router[_0x0474('0x5')](_0x0474('0x1c'),auth[_0x0474('0x9')](),controller[_0x0474('0x1d')]);router[_0x0474('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x0474('0x9')](),controller[_0x0474('0x1e')]);router[_0x0474('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x0474('0x9')](),controller[_0x0474('0x1f')]);router[_0x0474('0x5')](_0x0474('0x20'),auth[_0x0474('0x9')](),controller[_0x0474('0x21')]);router['put'](_0x0474('0x20'),auth[_0x0474('0x9')](),controller[_0x0474('0x22')]);router[_0x0474('0x5')]('/outbound',auth[_0x0474('0x9')](),controller[_0x0474('0x23')]);router[_0x0474('0x5')](_0x0474('0x24'),auth[_0x0474('0x9')](),controller[_0x0474('0x25')]);router[_0x0474('0x5')](_0x0474('0x26'),auth[_0x0474('0x9')](),controller['agents']);router[_0x0474('0x27')](_0x0474('0x28'),auth['isAuthenticated'](),controller[_0x0474('0x29')]);router['get'](_0x0474('0x2a'),auth[_0x0474('0x9')](),controller[_0x0474('0x2b')]);router[_0x0474('0x5')]('/trunks',auth[_0x0474('0x9')](),controller['trunks']);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x0474('0x2c')]);router['get']('/fax/accounts',auth[_0x0474('0x9')](),controller[_0x0474('0x2d')]);router[_0x0474('0x5')](_0x0474('0x2e'),auth[_0x0474('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0x0474('0x5')](_0x0474('0x2f'),auth[_0x0474('0x9')](),controller[_0x0474('0x30')]);router['get'](_0x0474('0x31'),auth[_0x0474('0x9')](),controller[_0x0474('0x32')]);router['get'](_0x0474('0x33'),auth[_0x0474('0x9')](),controller[_0x0474('0x34')]);router[_0x0474('0x5')](_0x0474('0x35'),auth[_0x0474('0x9')](),controller[_0x0474('0x36')]);router[_0x0474('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x0474('0x9')](),controller[_0x0474('0x37')]);router[_0x0474('0x5')](_0x0474('0x38'),auth[_0x0474('0x9')](),controller[_0x0474('0x39')]);router['post'](_0x0474('0x3a'),auth[_0x0474('0x9')](),controller[_0x0474('0x3b')](_0x0474('0x3c')));router['get'](_0x0474('0x3d'),auth[_0x0474('0x9')](),controller[_0x0474('0x3e')]);router['post']('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0474('0x3b')]('chat'));router['get']('/chat/queues/:id',auth[_0x0474('0x9')](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0474('0x3b')](_0x0474('0x3f')));router[_0x0474('0x5')](_0x0474('0x40'),auth[_0x0474('0x9')](),controller[_0x0474('0x41')]);router[_0x0474('0x42')]('/openchannel/queues/:id/notify',auth[_0x0474('0x9')](),controller['queueNotify']('openchannel'));router[_0x0474('0x5')](_0x0474('0x43'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x0474('0x42')](_0x0474('0x44'),auth[_0x0474('0x9')](),controller[_0x0474('0x3b')](_0x0474('0x45')));router[_0x0474('0x42')](_0x0474('0x46'),auth[_0x0474('0x9')](),controller[_0x0474('0x3b')](_0x0474('0x47')));router[_0x0474('0x5')](_0x0474('0x48'),auth[_0x0474('0x9')](),controller[_0x0474('0x49')]);router[_0x0474('0x5')](_0x0474('0x4a'),auth[_0x0474('0x9')](),controller[_0x0474('0x4b')]);router['post'](_0x0474('0x4c'),auth[_0x0474('0x9')](),controller[_0x0474('0x4d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index e97d76c..9e01c32 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 _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x29853b,_0x3274d6){var _0xc53e58=function(_0x2673c2){while(--_0x2673c2){_0x29853b['push'](_0x29853b['shift']());}};_0xc53e58(++_0x3274d6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file +var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x12a414,_0x1c9903){var _0x2adb33=function(_0x28f7d8){while(--_0x28f7d8){_0x12a414['push'](_0x12a414['shift']());}};_0x2adb33(++_0x1c9903);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b7e51ef..00931b7 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 _0x96a2=['show','create','exports','util','path','connect-timeout','express','Router','get','isAuthenticated','index','/:id'];(function(_0x28528a,_0x46e834){var _0x44a930=function(_0x59bfab){while(--_0x59bfab){_0x28528a['push'](_0x28528a['shift']());}};_0x44a930(++_0x46e834);}(_0x96a2,0x19b));var _0x296a=function(_0x5f2027,_0x4ecd50){_0x5f2027=_0x5f2027-0x0;var _0x2e0c21=_0x96a2[_0x5f2027];return _0x2e0c21;};'use strict';var multer=require('multer');var util=require(_0x296a('0x0'));var path=require(_0x296a('0x1'));var timeout=require(_0x296a('0x2'));var express=require(_0x296a('0x3'));var router=express[_0x296a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x296a('0x5')]('/',auth[_0x296a('0x6')](),controller[_0x296a('0x7')]);router['get'](_0x296a('0x8'),auth[_0x296a('0x6')](),controller[_0x296a('0x9')]);router[_0x296a('0x5')]('/:id/run',auth[_0x296a('0x6')](),controller['run']);router['post']('/',auth[_0x296a('0x6')](),controller[_0x296a('0xa')]);router['put'](_0x296a('0x8'),auth[_0x296a('0x6')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x296a('0xb')]=router; \ No newline at end of file +var _0xfa43=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id/run','isAuthenticated','run','post','put','/:id','update','delete','destroy','exports'];(function(_0x7ded15,_0x3b29b3){var _0x51e5f5=function(_0x31d23a){while(--_0x31d23a){_0x7ded15['push'](_0x7ded15['shift']());}};_0x51e5f5(++_0x3b29b3);}(_0xfa43,0x108));var _0x3fa4=function(_0x478aef,_0x7066a3){_0x478aef=_0x478aef-0x0;var _0x5e9ef6=_0xfa43[_0x478aef];return _0x5e9ef6;};'use strict';var multer=require(_0x3fa4('0x0'));var util=require(_0x3fa4('0x1'));var path=require(_0x3fa4('0x2'));var timeout=require(_0x3fa4('0x3'));var express=require(_0x3fa4('0x4'));var router=express[_0x3fa4('0x5')]();var fs_extra=require(_0x3fa4('0x6'));var auth=require(_0x3fa4('0x7'));var interaction=require(_0x3fa4('0x8'));var config=require(_0x3fa4('0x9'));var controller=require(_0x3fa4('0xa'));router[_0x3fa4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3fa4('0xb')](_0x3fa4('0xc'),auth[_0x3fa4('0xd')](),controller[_0x3fa4('0xe')]);router[_0x3fa4('0xf')]('/',auth[_0x3fa4('0xd')](),controller['create']);router[_0x3fa4('0x10')](_0x3fa4('0x11'),auth[_0x3fa4('0xd')](),controller[_0x3fa4('0x12')]);router[_0x3fa4('0x13')](_0x3fa4('0x11'),auth[_0x3fa4('0xd')](),controller[_0x3fa4('0x14')]);module[_0x3fa4('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 047d337..d762a66 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 _0xc352=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','days','hours','pdf','xlsx','csv','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x3a564c,_0x10c090){var _0x5387b9=function(_0x56a3f5){while(--_0x56a3f5){_0x3a564c['push'](_0x3a564c['shift']());}};_0x5387b9(++_0x10c090);}(_0xc352,0xad));var _0x2c35=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xc352[_0x4c9380];return _0x49a523;};'use strict';var Sequelize=require(_0x2c35('0x0'));module[_0x2c35('0x1')]={'name':{'type':Sequelize[_0x2c35('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2c35('0x2')]},'active':{'type':Sequelize[_0x2c35('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2c35('0x2')],'allowNull':![],'defaultValue':_0x2c35('0x4')},'startAt':{'type':Sequelize[_0x2c35('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2c35('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2c35('0x6')]('years',_0x2c35('0x7'),'months','weeks',_0x2c35('0x8'),_0x2c35('0x9'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM']('csv',_0x2c35('0xa'),_0x2c35('0xb')),'allowNull':![],'defaultValue':_0x2c35('0xc')},'type':{'type':Sequelize[_0x2c35('0x6')](_0x2c35('0xd'),_0x2c35('0xe')),'allowNull':![],'defaultValue':_0x2c35('0xd')},'sendMail':{'type':Sequelize[_0x2c35('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x2c35('0xf')]},'bcc':{'type':Sequelize[_0x2c35('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x2c35('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3f7e=['minutes','csv','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','years','months','weeks','days'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f7e,0x66));var _0xe3f7=function(_0x7202e6,_0x3445b4){_0x7202e6=_0x7202e6-0x0;var _0x338e25=_0x3f7e[_0x7202e6];return _0x338e25;};'use strict';var Sequelize=require(_0xe3f7('0x0'));module[_0xe3f7('0x1')]={'name':{'type':Sequelize[_0xe3f7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe3f7('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe3f7('0x2')],'allowNull':![],'defaultValue':_0xe3f7('0x3')},'startAt':{'type':Sequelize[_0xe3f7('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe3f7('0x5')](_0xe3f7('0x6'),'quarters',_0xe3f7('0x7'),_0xe3f7('0x8'),_0xe3f7('0x9'),'hours',_0xe3f7('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xe3f7('0x5')](_0xe3f7('0xb'),'pdf',_0xe3f7('0xc')),'allowNull':![],'defaultValue':_0xe3f7('0xb')},'type':{'type':Sequelize[_0xe3f7('0x5')](_0xe3f7('0xd'),'default'),'allowNull':![],'defaultValue':_0xe3f7('0xd')},'sendMail':{'type':Sequelize[_0xe3f7('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0xe3f7('0x2')]},'cc':{'type':Sequelize[_0xe3f7('0xf')]},'bcc':{'type':Sequelize[_0xe3f7('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xe3f7('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 016c1c2..998c94b 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 _0xa13e=['util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','create','name','error','../../config/schedule','run','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x2f91b8,_0x86a258){var _0x2a7dd3=function(_0x263627){while(--_0x263627){_0x2f91b8['push'](_0x2f91b8['shift']());}};_0x2a7dd3(++_0x86a258);}(_0xa13e,0x14e));var _0xea13=function(_0x61f1b5,_0x9e6041){_0x61f1b5=_0x61f1b5-0x0;var _0xb34b33=_0xa13e[_0x61f1b5];return _0xb34b33;};'use strict';var emlformat=require(_0xea13('0x0'));var rimraf=require(_0xea13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea13('0x2'));var rp=require(_0xea13('0x3'));var moment=require(_0xea13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea13('0x5'));var util=require(_0xea13('0x6'));var path=require('path');var sox=require(_0xea13('0x7'));var csv=require(_0xea13('0x8'));var ejs=require(_0xea13('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea13('0xa'));var crypto=require(_0xea13('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xea13('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea13('0xd'));var Redis=require('ioredis');var authService=require(_0xea13('0xe'));var qs=require(_0xea13('0xf'));var as=require(_0xea13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea13('0x11'))(_0xea13('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xea13('0x13'))['db'];function respondWithStatusCode(_0x132cfc,_0xb7cd5){_0xb7cd5=_0xb7cd5||0xcc;return function(_0x31a3aa){if(_0x31a3aa){return _0x132cfc[_0xea13('0x14')](_0xb7cd5);}return _0x132cfc['status'](_0xb7cd5)[_0xea13('0x15')]();};}function respondWithResult(_0xe81402,_0x4363bd){_0x4363bd=_0x4363bd||0xc8;return function(_0x145720){if(_0x145720){return _0xe81402[_0xea13('0x16')](_0x4363bd)[_0xea13('0x17')](_0x145720);}};}function respondWithFilteredResult(_0x13e786,_0x4da6c7){return function(_0x1c519f){if(_0x1c519f){var _0x1b1add=typeof _0x4da6c7[_0xea13('0x18')]===_0xea13('0x19')&&typeof _0x4da6c7[_0xea13('0x1a')]===_0xea13('0x19');var _0x48b1cb=_0x1c519f['count'];var _0x42a0c5=_0x1b1add?0x0:_0x4da6c7['offset'];var _0x337fd7=_0x1b1add?_0x1c519f[_0xea13('0x1b')]:_0x4da6c7[_0xea13('0x18')]+_0x4da6c7[_0xea13('0x1a')];var _0x1ee8ba;if(_0x337fd7>=_0x48b1cb){_0x337fd7=_0x48b1cb;_0x1ee8ba=0xc8;}else{_0x1ee8ba=0xce;}_0x13e786[_0xea13('0x16')](_0x1ee8ba);return _0x13e786[_0xea13('0x1c')](_0xea13('0x1d'),_0x42a0c5+'-'+_0x337fd7+'/'+_0x48b1cb)['json'](_0x1c519f);}return null;};}function patchUpdates(_0x249c05){return function(_0x4cb241){try{jsonpatch[_0xea13('0x1e')](_0x4cb241,_0x249c05,!![]);}catch(_0x2ab713){return BPromise[_0xea13('0x1f')](_0x2ab713);}return _0x4cb241[_0xea13('0x20')]();};}function saveUpdates(_0xa22780,_0x533e88){return function(_0x4fbc7e){if(_0x4fbc7e){return _0x4fbc7e[_0xea13('0x21')](_0xa22780)[_0xea13('0x22')](function(_0x2bad90){return _0x2bad90;});}return null;};}function removeEntity(_0x481922,_0x243e3f){return function(_0x464daa){if(_0x464daa){return _0x464daa[_0xea13('0x23')]()[_0xea13('0x22')](function(){var _0x155a0e=_0x464daa[_0xea13('0x24')]({'plain':!![]});var _0x2213b9='Scheduler';return db[_0xea13('0x25')]['destroy']({'where':{'type':_0x2213b9,'resourceId':_0x155a0e['id']}})[_0xea13('0x22')](function(){return _0x464daa;});})[_0xea13('0x22')](function(){_0x481922[_0xea13('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x462af7,_0x53ec01){return function(_0x1301aa){if(!_0x1301aa){_0x462af7[_0xea13('0x14')](0x194);}return _0x1301aa;};}function handleError(_0x19bd85,_0x2da78f){_0x2da78f=_0x2da78f||0x1f4;return function(_0x520d05){logger['error'](_0x520d05[_0xea13('0x26')]);if(_0x520d05['name']){delete _0x520d05['name'];}_0x19bd85[_0xea13('0x16')](_0x2da78f)[_0xea13('0x27')](_0x520d05);};}exports[_0xea13('0x28')]=function(_0xf3e2b2,_0x222eb1){var _0x1367e9={},_0x11b792={},_0x3430ec={'count':0x0,'rows':[]};var _0xae22fa=_[_0xea13('0x29')](db[_0xea13('0x2a')][_0xea13('0x2b')],function(_0x5a230f){return{'name':_0x5a230f[_0xea13('0x2c')],'type':_0x5a230f[_0xea13('0x2d')][_0xea13('0x2e')]};});_0x11b792[_0xea13('0x2f')]=_[_0xea13('0x29')](_0xae22fa,'name');_0x11b792[_0xea13('0x30')]=_['keys'](_0xf3e2b2[_0xea13('0x30')]);_0x11b792[_0xea13('0x31')]=_[_0xea13('0x32')](_0x11b792[_0xea13('0x2f')],_0x11b792[_0xea13('0x30')]);_0x1367e9['attributes']=_[_0xea13('0x32')](_0x11b792[_0xea13('0x2f')],qs[_0xea13('0x33')](_0xf3e2b2[_0xea13('0x30')][_0xea13('0x33')]));_0x1367e9[_0xea13('0x34')]=_0x1367e9['attributes'][_0xea13('0x35')]?_0x1367e9['attributes']:_0x11b792[_0xea13('0x2f')];if(!_0xf3e2b2[_0xea13('0x30')][_0xea13('0x36')](_0xea13('0x37'))){_0x1367e9[_0xea13('0x1a')]=qs[_0xea13('0x1a')](_0xf3e2b2[_0xea13('0x30')][_0xea13('0x1a')]);_0x1367e9[_0xea13('0x18')]=qs[_0xea13('0x18')](_0xf3e2b2[_0xea13('0x30')][_0xea13('0x18')]);}_0x1367e9[_0xea13('0x38')]=qs['sort'](_0xf3e2b2[_0xea13('0x30')][_0xea13('0x39')]);_0x1367e9[_0xea13('0x3a')]=qs[_0xea13('0x31')](_[_0xea13('0x3b')](_0xf3e2b2['query'],_0x11b792[_0xea13('0x31')]),_0xae22fa);if(_0xf3e2b2['query'][_0xea13('0x3c')]){_0x1367e9[_0xea13('0x3a')]=_[_0xea13('0x3d')](_0x1367e9[_0xea13('0x3a')],{'$or':_['map'](_0xae22fa,function(_0x3fb072){if(_0x3fb072['type']!==_0xea13('0x3e')){var _0x4b2294={};_0x4b2294[_0x3fb072['name']]={'$like':'%'+_0xf3e2b2[_0xea13('0x30')][_0xea13('0x3c')]+'%'};return _0x4b2294;}})});}_0x1367e9=_[_0xea13('0x3d')]({},_0x1367e9,_0xf3e2b2[_0xea13('0x3f')]);var _0x4440af={'where':_0x1367e9[_0xea13('0x3a')]};return db[_0xea13('0x2a')][_0xea13('0x1b')](_0x4440af)[_0xea13('0x22')](function(_0x591d43){_0x3430ec[_0xea13('0x1b')]=_0x591d43;if(_0xf3e2b2[_0xea13('0x30')][_0xea13('0x40')]){_0x1367e9[_0xea13('0x41')]=[{'all':!![]}];}return db[_0xea13('0x2a')][_0xea13('0x42')](_0x1367e9);})[_0xea13('0x22')](function(_0x59ebfb){_0x3430ec[_0xea13('0x43')]=_0x59ebfb;return _0x3430ec;})[_0xea13('0x22')](respondWithFilteredResult(_0x222eb1,_0x1367e9))[_0xea13('0x44')](handleError(_0x222eb1,null));};exports['show']=function(_0xf60171,_0x2007ac){var _0x5038ff={'raw':![],'where':{'id':_0xf60171[_0xea13('0x45')]['id']}},_0x254fc0={};_0x254fc0['model']=_[_0xea13('0x46')](db[_0xea13('0x2a')][_0xea13('0x2b')]);_0x254fc0[_0xea13('0x30')]=_['keys'](_0xf60171[_0xea13('0x30')]);_0x254fc0[_0xea13('0x31')]=_[_0xea13('0x32')](_0x254fc0[_0xea13('0x2f')],_0x254fc0[_0xea13('0x30')]);_0x5038ff['attributes']=_['intersection'](_0x254fc0[_0xea13('0x2f')],qs[_0xea13('0x33')](_0xf60171[_0xea13('0x30')][_0xea13('0x33')]));_0x5038ff[_0xea13('0x34')]=_0x5038ff[_0xea13('0x34')]['length']?_0x5038ff[_0xea13('0x34')]:_0x254fc0['model'];if(_0xf60171['query'][_0xea13('0x40')]){_0x5038ff[_0xea13('0x41')]=[{'all':!![]}];}_0x5038ff=_[_0xea13('0x3d')]({},_0x5038ff,_0xf60171[_0xea13('0x3f')]);return db[_0xea13('0x2a')][_0xea13('0x47')](_0x5038ff)[_0xea13('0x22')](handleEntityNotFound(_0x2007ac,null))[_0xea13('0x22')](respondWithResult(_0x2007ac,null))['catch'](handleError(_0x2007ac,null));};exports['create']=function(_0x3ca675,_0x4165b1){return db['Schedule']['create'](_0x3ca675[_0xea13('0x48')],{})[_0xea13('0x22')](function(_0xd9bd61){var _0x6c85af=_0x3ca675[_0xea13('0x49')][_0xea13('0x24')]({'plain':!![]});if(!_0x6c85af)throw new Error(_0xea13('0x4a'));if(_0x6c85af[_0xea13('0x4b')]===_0xea13('0x49')){var _0x1dbef5=_0xd9bd61[_0xea13('0x24')]({'plain':!![]});var _0x440e23=_0xea13('0x4c');return db[_0xea13('0x4d')][_0xea13('0x47')]({'where':{'name':_0x440e23,'userProfileId':_0x6c85af[_0xea13('0x4e')]},'raw':!![]})[_0xea13('0x22')](function(_0x35d013){if(_0x35d013&&_0x35d013[_0xea13('0x4f')]===0x0){return db[_0xea13('0x25')][_0xea13('0x50')]({'name':_0x1dbef5[_0xea13('0x51')],'resourceId':_0x1dbef5['id'],'type':_0x35d013[_0xea13('0x51')],'sectionId':_0x35d013['id']},{})['then'](function(){return _0xd9bd61;});}else{return _0xd9bd61;}})[_0xea13('0x44')](function(_0x2d7ba9){logger[_0xea13('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d7ba9);throw _0x2d7ba9;});}return _0xd9bd61;})[_0xea13('0x22')](respondWithResult(_0x4165b1,0xc9))[_0xea13('0x44')](handleError(_0x4165b1,null));};exports[_0xea13('0x21')]=function(_0x4cca98,_0x287628){if(_0x4cca98[_0xea13('0x48')]['id']){delete _0x4cca98[_0xea13('0x48')]['id'];}return db[_0xea13('0x2a')][_0xea13('0x47')]({'where':{'id':_0x4cca98[_0xea13('0x45')]['id']}})[_0xea13('0x22')](handleEntityNotFound(_0x287628,null))[_0xea13('0x22')](saveUpdates(_0x4cca98[_0xea13('0x48')],null))[_0xea13('0x22')](respondWithResult(_0x287628,null))[_0xea13('0x44')](handleError(_0x287628,null));};exports[_0xea13('0x23')]=function(_0x269140,_0xa5f304){return db[_0xea13('0x2a')][_0xea13('0x47')]({'where':{'id':_0x269140[_0xea13('0x45')]['id']}})[_0xea13('0x22')](handleEntityNotFound(_0xa5f304,null))[_0xea13('0x22')](removeEntity(_0xa5f304,null))[_0xea13('0x44')](handleError(_0xa5f304,null));};exports['run']=function(_0x106154,_0x228501,_0xf0c62e){var _0x22c02a=require(_0xea13('0x53'));return db[_0xea13('0x2a')][_0xea13('0x47')]({'where':{'id':_0x106154[_0xea13('0x45')]['id']},'raw':!![]})[_0xea13('0x22')](handleEntityNotFound(_0x228501,null))[_0xea13('0x22')](function(){_0x22c02a[_0xea13('0x54')](_0x106154[_0xea13('0x45')]['id']);})['then'](respondWithStatusCode(_0x228501,null))[_0xea13('0x44')](handleError(_0x228501,null));}; \ No newline at end of file +var _0x02cf=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','Scheduler','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Schedule','catch','show','include','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','../../config/schedule','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x460926,_0x4ed794){var _0x172605=function(_0x42b35f){while(--_0x42b35f){_0x460926['push'](_0x460926['shift']());}};_0x172605(++_0x4ed794);}(_0x02cf,0x135));var _0xf02c=function(_0x1eac5b,_0x44cdc5){_0x1eac5b=_0x1eac5b-0x0;var _0x40b4d6=_0x02cf[_0x1eac5b];return _0x40b4d6;};'use strict';var emlformat=require(_0xf02c('0x0'));var rimraf=require(_0xf02c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf02c('0x2'));var rp=require('request-promise');var moment=require(_0xf02c('0x3'));var BPromise=require(_0xf02c('0x4'));var Mustache=require(_0xf02c('0x5'));var util=require('util');var path=require(_0xf02c('0x6'));var sox=require(_0xf02c('0x7'));var csv=require('to-csv');var ejs=require(_0xf02c('0x8'));var fs=require('fs');var fs_extra=require(_0xf02c('0x9'));var _=require(_0xf02c('0xa'));var squel=require(_0xf02c('0xb'));var crypto=require('crypto');var jsforce=require(_0xf02c('0xc'));var deskjs=require(_0xf02c('0xd'));var toCsv=require(_0xf02c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf02c('0xf'));var authService=require(_0xf02c('0x10'));var qs=require(_0xf02c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf02c('0x12'));var logger=require(_0xf02c('0x13'))(_0xf02c('0x14'));var utils=require(_0xf02c('0x15'));var config=require(_0xf02c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf02c('0x17'))['db'];function respondWithStatusCode(_0x152a59,_0x89710a){_0x89710a=_0x89710a||0xcc;return function(_0x122237){if(_0x122237){return _0x152a59[_0xf02c('0x18')](_0x89710a);}return _0x152a59[_0xf02c('0x19')](_0x89710a)[_0xf02c('0x1a')]();};}function respondWithResult(_0x1817bc,_0x8a5d21){_0x8a5d21=_0x8a5d21||0xc8;return function(_0x2986fc){if(_0x2986fc){return _0x1817bc[_0xf02c('0x19')](_0x8a5d21)[_0xf02c('0x1b')](_0x2986fc);}};}function respondWithFilteredResult(_0x49244a,_0x19fc74){return function(_0x5390d7){if(_0x5390d7){var _0x5566c4=typeof _0x19fc74[_0xf02c('0x1c')]===_0xf02c('0x1d')&&typeof _0x19fc74[_0xf02c('0x1e')]===_0xf02c('0x1d');var _0x394b38=_0x5390d7[_0xf02c('0x1f')];var _0x87c797=_0x5566c4?0x0:_0x19fc74[_0xf02c('0x1c')];var _0x348109=_0x5566c4?_0x5390d7[_0xf02c('0x1f')]:_0x19fc74['offset']+_0x19fc74[_0xf02c('0x1e')];var _0x3aa86a;if(_0x348109>=_0x394b38){_0x348109=_0x394b38;_0x3aa86a=0xc8;}else{_0x3aa86a=0xce;}_0x49244a[_0xf02c('0x19')](_0x3aa86a);return _0x49244a[_0xf02c('0x20')]('Content-Range',_0x87c797+'-'+_0x348109+'/'+_0x394b38)[_0xf02c('0x1b')](_0x5390d7);}return null;};}function patchUpdates(_0x4c8dd8){return function(_0x4ac38d){try{jsonpatch[_0xf02c('0x21')](_0x4ac38d,_0x4c8dd8,!![]);}catch(_0x5c679e){return BPromise[_0xf02c('0x22')](_0x5c679e);}return _0x4ac38d[_0xf02c('0x23')]();};}function saveUpdates(_0x1dc1c3,_0x2c7581){return function(_0x51d8a9){if(_0x51d8a9){return _0x51d8a9['update'](_0x1dc1c3)[_0xf02c('0x24')](function(_0x4231c8){return _0x4231c8;});}return null;};}function removeEntity(_0x20a005,_0xee3373){return function(_0x2dd1ee){if(_0x2dd1ee){return _0x2dd1ee[_0xf02c('0x25')]()['then'](function(){var _0x3bbfd3=_0x2dd1ee['get']({'plain':!![]});var _0x595524=_0xf02c('0x26');return db[_0xf02c('0x27')][_0xf02c('0x25')]({'where':{'type':_0x595524,'resourceId':_0x3bbfd3['id']}})[_0xf02c('0x24')](function(){return _0x2dd1ee;});})['then'](function(){_0x20a005['status'](0xcc)[_0xf02c('0x1a')]();});}};}function handleEntityNotFound(_0x48c5b9,_0x2e74d2){return function(_0x50546d){if(!_0x50546d){_0x48c5b9[_0xf02c('0x18')](0x194);}return _0x50546d;};}function handleError(_0x526699,_0x366e3){_0x366e3=_0x366e3||0x1f4;return function(_0x22c799){logger[_0xf02c('0x28')](_0x22c799[_0xf02c('0x29')]);if(_0x22c799[_0xf02c('0x2a')]){delete _0x22c799[_0xf02c('0x2a')];}_0x526699[_0xf02c('0x19')](_0x366e3)['send'](_0x22c799);};}exports[_0xf02c('0x2b')]=function(_0x114bea,_0x5e3173){var _0x26a485={},_0x3cb823={},_0xb555d6={'count':0x0,'rows':[]};var _0x50b5b0=_[_0xf02c('0x2c')](db['Schedule'][_0xf02c('0x2d')],function(_0x2227cc){return{'name':_0x2227cc[_0xf02c('0x2e')],'type':_0x2227cc[_0xf02c('0x2f')][_0xf02c('0x30')]};});_0x3cb823[_0xf02c('0x31')]=_[_0xf02c('0x2c')](_0x50b5b0,_0xf02c('0x2a'));_0x3cb823[_0xf02c('0x32')]=_[_0xf02c('0x33')](_0x114bea['query']);_0x3cb823[_0xf02c('0x34')]=_[_0xf02c('0x35')](_0x3cb823['model'],_0x3cb823[_0xf02c('0x32')]);_0x26a485[_0xf02c('0x36')]=_[_0xf02c('0x35')](_0x3cb823[_0xf02c('0x31')],qs[_0xf02c('0x37')](_0x114bea[_0xf02c('0x32')][_0xf02c('0x37')]));_0x26a485[_0xf02c('0x36')]=_0x26a485[_0xf02c('0x36')]['length']?_0x26a485[_0xf02c('0x36')]:_0x3cb823[_0xf02c('0x31')];if(!_0x114bea[_0xf02c('0x32')][_0xf02c('0x38')](_0xf02c('0x39'))){_0x26a485['limit']=qs[_0xf02c('0x1e')](_0x114bea[_0xf02c('0x32')]['limit']);_0x26a485[_0xf02c('0x1c')]=qs[_0xf02c('0x1c')](_0x114bea[_0xf02c('0x32')][_0xf02c('0x1c')]);}_0x26a485[_0xf02c('0x3a')]=qs[_0xf02c('0x3b')](_0x114bea[_0xf02c('0x32')]['sort']);_0x26a485[_0xf02c('0x3c')]=qs[_0xf02c('0x34')](_[_0xf02c('0x3d')](_0x114bea[_0xf02c('0x32')],_0x3cb823[_0xf02c('0x34')]),_0x50b5b0);if(_0x114bea['query']['filter']){_0x26a485['where']=_[_0xf02c('0x3e')](_0x26a485['where'],{'$or':_[_0xf02c('0x2c')](_0x50b5b0,function(_0x606dca){if(_0x606dca[_0xf02c('0x2f')]!==_0xf02c('0x3f')){var _0x38e79d={};_0x38e79d[_0x606dca[_0xf02c('0x2a')]]={'$like':'%'+_0x114bea[_0xf02c('0x32')]['filter']+'%'};return _0x38e79d;}})});}_0x26a485=_[_0xf02c('0x3e')]({},_0x26a485,_0x114bea[_0xf02c('0x40')]);var _0x58a35e={'where':_0x26a485[_0xf02c('0x3c')]};return db[_0xf02c('0x41')][_0xf02c('0x1f')](_0x58a35e)['then'](function(_0x3a1263){_0xb555d6[_0xf02c('0x1f')]=_0x3a1263;if(_0x114bea['query']['includeAll']){_0x26a485['include']=[{'all':!![]}];}return db[_0xf02c('0x41')]['findAll'](_0x26a485);})[_0xf02c('0x24')](function(_0x195dc4){_0xb555d6['rows']=_0x195dc4;return _0xb555d6;})[_0xf02c('0x24')](respondWithFilteredResult(_0x5e3173,_0x26a485))[_0xf02c('0x42')](handleError(_0x5e3173,null));};exports[_0xf02c('0x43')]=function(_0x2163f0,_0x13aa6e){var _0x4fab94={'raw':![],'where':{'id':_0x2163f0['params']['id']}},_0x1b131a={};_0x1b131a['model']=_[_0xf02c('0x33')](db['Schedule'][_0xf02c('0x2d')]);_0x1b131a['query']=_[_0xf02c('0x33')](_0x2163f0[_0xf02c('0x32')]);_0x1b131a[_0xf02c('0x34')]=_['intersection'](_0x1b131a['model'],_0x1b131a[_0xf02c('0x32')]);_0x4fab94[_0xf02c('0x36')]=_[_0xf02c('0x35')](_0x1b131a[_0xf02c('0x31')],qs[_0xf02c('0x37')](_0x2163f0['query'][_0xf02c('0x37')]));_0x4fab94[_0xf02c('0x36')]=_0x4fab94['attributes']['length']?_0x4fab94[_0xf02c('0x36')]:_0x1b131a['model'];if(_0x2163f0[_0xf02c('0x32')]['includeAll']){_0x4fab94[_0xf02c('0x44')]=[{'all':!![]}];}_0x4fab94=_[_0xf02c('0x3e')]({},_0x4fab94,_0x2163f0[_0xf02c('0x40')]);return db[_0xf02c('0x41')][_0xf02c('0x45')](_0x4fab94)[_0xf02c('0x24')](handleEntityNotFound(_0x13aa6e,null))[_0xf02c('0x24')](respondWithResult(_0x13aa6e,null))['catch'](handleError(_0x13aa6e,null));};exports[_0xf02c('0x46')]=function(_0x1b78dd,_0x339748){return db[_0xf02c('0x41')][_0xf02c('0x46')](_0x1b78dd[_0xf02c('0x47')],{})[_0xf02c('0x24')](function(_0x281759){var _0x451656=_0x1b78dd['user'][_0xf02c('0x48')]({'plain':!![]});if(!_0x451656)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x451656[_0xf02c('0x49')]===_0xf02c('0x4a')){var _0x1c1796=_0x281759[_0xf02c('0x48')]({'plain':!![]});var _0x408770='Scheduler';return db[_0xf02c('0x4b')][_0xf02c('0x45')]({'where':{'name':_0x408770,'userProfileId':_0x451656[_0xf02c('0x4c')]},'raw':!![]})[_0xf02c('0x24')](function(_0x42042e){if(_0x42042e&&_0x42042e[_0xf02c('0x4d')]===0x0){return db[_0xf02c('0x27')][_0xf02c('0x46')]({'name':_0x1c1796[_0xf02c('0x2a')],'resourceId':_0x1c1796['id'],'type':_0x42042e[_0xf02c('0x2a')],'sectionId':_0x42042e['id']},{})[_0xf02c('0x24')](function(){return _0x281759;});}else{return _0x281759;}})[_0xf02c('0x42')](function(_0x7781c4){logger[_0xf02c('0x28')](_0xf02c('0x4e'),_0x7781c4);throw _0x7781c4;});}return _0x281759;})[_0xf02c('0x24')](respondWithResult(_0x339748,0xc9))[_0xf02c('0x42')](handleError(_0x339748,null));};exports['update']=function(_0x297052,_0x3fa122){if(_0x297052[_0xf02c('0x47')]['id']){delete _0x297052['body']['id'];}return db[_0xf02c('0x41')][_0xf02c('0x45')]({'where':{'id':_0x297052['params']['id']}})[_0xf02c('0x24')](handleEntityNotFound(_0x3fa122,null))[_0xf02c('0x24')](saveUpdates(_0x297052['body'],null))['then'](respondWithResult(_0x3fa122,null))[_0xf02c('0x42')](handleError(_0x3fa122,null));};exports['destroy']=function(_0x461a54,_0x25f02d){return db[_0xf02c('0x41')][_0xf02c('0x45')]({'where':{'id':_0x461a54[_0xf02c('0x4f')]['id']}})[_0xf02c('0x24')](handleEntityNotFound(_0x25f02d,null))[_0xf02c('0x24')](removeEntity(_0x25f02d,null))[_0xf02c('0x42')](handleError(_0x25f02d,null));};exports['run']=function(_0x5a7370,_0x157ed3,_0x327a87){var _0x3a27ab=require(_0xf02c('0x50'));return db[_0xf02c('0x41')][_0xf02c('0x45')]({'where':{'id':_0x5a7370[_0xf02c('0x4f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x157ed3,null))[_0xf02c('0x24')](function(){_0x3a27ab['run'](_0x5a7370[_0xf02c('0x4f')]['id']);})[_0xf02c('0x24')](respondWithStatusCode(_0x157ed3,null))[_0xf02c('0x42')](handleError(_0x157ed3,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 59eb04d..c3ef72c 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 _0x5e23=['../../config/environment','exports','define','Schedule','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x5e23,0x122));var _0x35e2=function(_0x262b9a,_0x32e45e){_0x262b9a=_0x262b9a-0x0;var _0x192352=_0x5e23[_0x262b9a];return _0x192352;};'use strict';var _=require(_0x35e2('0x0'));var util=require('util');var logger=require(_0x35e2('0x1'))('api');var moment=require(_0x35e2('0x2'));var BPromise=require(_0x35e2('0x3'));var rp=require(_0x35e2('0x4'));var fs=require('fs');var path=require(_0x35e2('0x5'));var rimraf=require(_0x35e2('0x6'));var config=require(_0x35e2('0x7'));var attributes=require('./schedule.attributes');module[_0x35e2('0x8')]=function(_0x3a2449,_0x119571){return _0x3a2449[_0x35e2('0x9')](_0x35e2('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a89=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9a89,0x13a));var _0x99a8=function(_0x3b7b57,_0x18ca91){_0x3b7b57=_0x3b7b57-0x0;var _0x2845ec=_0x9a89[_0x3b7b57];return _0x2845ec;};'use strict';var _=require(_0x99a8('0x0'));var util=require('util');var logger=require(_0x99a8('0x1'))(_0x99a8('0x2'));var moment=require('moment');var BPromise=require(_0x99a8('0x3'));var rp=require(_0x99a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x99a8('0x5'));var attributes=require(_0x99a8('0x6'));module[_0x99a8('0x7')]=function(_0x5a216d,_0x223645){return _0x5a216d[_0x99a8('0x8')](_0x99a8('0x9'),attributes,{'tableName':_0x99a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 7c67cbd..d61084f 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 _0xe9ec=['error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c7692,_0x2c8c7f){var _0x4572df=function(_0xb61b72){while(--_0xb61b72){_0x1c7692['push'](_0x1c7692['shift']());}};_0x4572df(++_0x2c8c7f);}(_0xe9ec,0xbd));var _0xce9e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe9ec[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xce9e('0x0'));var moment=require(_0xce9e('0x1'));var BPromise=require(_0xce9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce9e('0x3'))['db'];var utils=require(_0xce9e('0x4'));var logger=require(_0xce9e('0x5'))(_0xce9e('0x6'));var config=require(_0xce9e('0x7'));var jayson=require(_0xce9e('0x8'));var client=jayson[_0xce9e('0x9')][_0xce9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c810,_0x251751,_0x31f6fe){return new BPromise(function(_0x22e9a8,_0x256f51){return client[_0xce9e('0xb')](_0x39c810,_0x31f6fe)[_0xce9e('0xc')](function(_0x1a7a1b){logger[_0xce9e('0xd')](_0xce9e('0xe'),_0x251751,_0xce9e('0xf'));logger['debug'](_0xce9e('0x10'),_0x251751,_0xce9e('0xf'),JSON[_0xce9e('0x11')](_0x1a7a1b));if(_0x1a7a1b[_0xce9e('0x12')]){if(_0x1a7a1b[_0xce9e('0x12')][_0xce9e('0x13')]===0x1f4){logger[_0xce9e('0x12')](_0xce9e('0xe'),_0x251751,_0x1a7a1b[_0xce9e('0x12')]['message']);return _0x256f51(_0x1a7a1b[_0xce9e('0x12')]['message']);}logger[_0xce9e('0x12')](_0xce9e('0xe'),_0x251751,_0x1a7a1b['error'][_0xce9e('0x14')]);return _0x22e9a8(_0x1a7a1b[_0xce9e('0x12')][_0xce9e('0x14')]);}else{logger[_0xce9e('0xd')]('Schedule,\x20%s,\x20%s',_0x251751,_0xce9e('0xf'));_0x22e9a8(_0x1a7a1b[_0xce9e('0x15')][_0xce9e('0x14')]);}})[_0xce9e('0x16')](function(_0xbdb866){logger['error']('Schedule,\x20%s,\x20%s',_0x251751,_0xbdb866);_0x256f51(_0xbdb866);});});} \ No newline at end of file +var _0x716b=['info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x267e08,_0x1fe1ff){var _0x499a6e=function(_0x58ac51){while(--_0x58ac51){_0x267e08['push'](_0x267e08['shift']());}};_0x499a6e(++_0x1fe1ff);}(_0x716b,0x1ac));var _0xb716=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x716b[_0x45c981];return _0x4f62c8;};'use strict';var _=require(_0xb716('0x0'));var util=require(_0xb716('0x1'));var moment=require('moment');var BPromise=require(_0xb716('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb716('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb716('0x4'));var logger=require(_0xb716('0x5'))(_0xb716('0x6'));var config=require(_0xb716('0x7'));var jayson=require(_0xb716('0x8'));var client=jayson[_0xb716('0x9')][_0xb716('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27d47b,_0x5b5c6a,_0x4a40fe){return new BPromise(function(_0x105939,_0x3f4b3b){return client['request'](_0x27d47b,_0x4a40fe)[_0xb716('0xb')](function(_0x3da7df){logger[_0xb716('0xc')](_0xb716('0xd'),_0x5b5c6a,_0xb716('0xe'));logger[_0xb716('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5b5c6a,_0xb716('0xe'),JSON[_0xb716('0x10')](_0x3da7df));if(_0x3da7df[_0xb716('0x11')]){if(_0x3da7df['error'][_0xb716('0x12')]===0x1f4){logger['error'](_0xb716('0xd'),_0x5b5c6a,_0x3da7df[_0xb716('0x11')][_0xb716('0x13')]);return _0x3f4b3b(_0x3da7df[_0xb716('0x11')][_0xb716('0x13')]);}logger[_0xb716('0x11')](_0xb716('0xd'),_0x5b5c6a,_0x3da7df[_0xb716('0x11')][_0xb716('0x13')]);return _0x105939(_0x3da7df[_0xb716('0x11')][_0xb716('0x13')]);}else{logger[_0xb716('0xc')](_0xb716('0xd'),_0x5b5c6a,_0xb716('0xe'));_0x105939(_0x3da7df[_0xb716('0x14')][_0xb716('0x13')]);}})[_0xb716('0x15')](function(_0x845fa1){logger[_0xb716('0x11')](_0xb716('0xd'),_0x5b5c6a,_0x845fa1);_0x3f4b3b(_0x845fa1);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f43dd29..0970067 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 _0x0261=['/describe','describe','/:id','get','/:id/download','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated'];(function(_0x56b878,_0x4be9aa){var _0x32b9ec=function(_0x1511ea){while(--_0x1511ea){_0x56b878['push'](_0x56b878['shift']());}};_0x32b9ec(++_0x4be9aa);}(_0x0261,0xd1));var _0x1026=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0x0261[_0xb77dfe];return _0x5e4f5d;};'use strict';var multer=require(_0x1026('0x0'));var util=require(_0x1026('0x1'));var path=require('path');var timeout=require(_0x1026('0x2'));var express=require(_0x1026('0x3'));var router=express[_0x1026('0x4')]();var fs_extra=require(_0x1026('0x5'));var auth=require(_0x1026('0x6'));var interaction=require(_0x1026('0x7'));var config=require(_0x1026('0x8'));var controller=require(_0x1026('0x9'));router['get']('/',auth[_0x1026('0xa')](),controller['index']);router['get'](_0x1026('0xb'),auth[_0x1026('0xa')](),controller[_0x1026('0xc')]);router['get'](_0x1026('0xd'),auth[_0x1026('0xa')](),controller['show']);router[_0x1026('0xe')](_0x1026('0xf'),auth[_0x1026('0xa')](),controller['download']);router[_0x1026('0x10')]('/',auth[_0x1026('0xa')](),controller['create']);router[_0x1026('0x11')](_0x1026('0xd'),auth[_0x1026('0xa')](),controller[_0x1026('0x12')]);router[_0x1026('0x13')](_0x1026('0xd'),auth[_0x1026('0xa')](),controller[_0x1026('0x14')]);module[_0x1026('0x15')]=router; \ No newline at end of file +var _0xcc92=['destroy','util','path','express','Router','fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id/download','create','put','update','delete','/:id'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xcc92,0x1d5));var _0x2cc9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcc92[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x2cc9('0x0'));var path=require(_0x2cc9('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cc9('0x2'));var router=express[_0x2cc9('0x3')]();var fs_extra=require(_0x2cc9('0x4'));var auth=require(_0x2cc9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x2cc9('0x6')]('/',auth['isAuthenticated'](),controller[_0x2cc9('0x7')]);router[_0x2cc9('0x6')](_0x2cc9('0x8'),auth[_0x2cc9('0x9')](),controller[_0x2cc9('0xa')]);router[_0x2cc9('0x6')]('/:id',auth[_0x2cc9('0x9')](),controller['show']);router[_0x2cc9('0x6')](_0x2cc9('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x2cc9('0x9')](),controller[_0x2cc9('0xc')]);router[_0x2cc9('0xd')]('/:id',auth[_0x2cc9('0x9')](),controller[_0x2cc9('0xe')]);router[_0x2cc9('0xf')](_0x2cc9('0x10'),auth[_0x2cc9('0x9')](),controller[_0x2cc9('0x11')]);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 b293e14..7641d7f 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 _0xbbdd=['DATE','getDataValue','closedAt','format','updatedAt','moment','../../config/environment','exports','extname','STRING','replace','setDataValue','value','INTEGER','startedAt','subtract','duration','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x44249e,_0x5a0e0c){var _0x333e30=function(_0x248dd7){while(--_0x248dd7){_0x44249e['push'](_0x44249e['shift']());}};_0x333e30(++_0x5a0e0c);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xbbdd[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdbbd('0x0'));var path=require('path');var config=require(_0xdbbd('0x1'));module[_0xdbbd('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0xdbbd('0x3')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0xdbbd('0x4')]},'channel':{'type':Sequelize[_0xdbbd('0x4')]},'value':{'type':Sequelize[_0xdbbd('0x4')],'set':function(_0x44beae){var _0x59b866=_0x44beae[_0xdbbd('0x5')](/\\/g,'/');this[_0xdbbd('0x6')](_0xdbbd('0x7'),_0x59b866);}},'rating':{'type':Sequelize[_0xdbbd('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdbbd('0x8')],'set':function(_0x38198c){this[_0xdbbd('0x6')](_0xdbbd('0x9'),moment()[_0xdbbd('0xa')](_0x38198c,'ms'));this[_0xdbbd('0x6')]('closedAt',moment());this[_0xdbbd('0x6')](_0xdbbd('0xb'),_0x38198c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))['format'](_0xdbbd('0xc'))[_0xdbbd('0xd')]();}},'closedAt':{'type':Sequelize[_0xdbbd('0xe')],'get':function(){return moment(this[_0xdbbd('0xf')](_0xdbbd('0x10')))[_0xdbbd('0x11')](_0xdbbd('0xc'))['toString']();}},'createdAt':{'type':Sequelize[_0xdbbd('0xe')],'get':function(){return moment(this[_0xdbbd('0xf')]('createdAt'))[_0xdbbd('0x11')](_0xdbbd('0xc'))[_0xdbbd('0xd')]();}},'updatedAt':{'type':Sequelize[_0xdbbd('0xe')],'get':function(){return moment(this['getDataValue'](_0xdbbd('0x12')))[_0xdbbd('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xdbbd('0xd')]();}}}; \ No newline at end of file +var _0x4e2e=['../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','moment','path'];(function(_0x4f296b,_0x243fb6){var _0x2d94c1=function(_0xe49665){while(--_0xe49665){_0x4f296b['push'](_0x4f296b['shift']());}};_0x2d94c1(++_0x243fb6);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x114d4f,_0x1cb4ef){_0x114d4f=_0x114d4f-0x0;var _0x4a7429=_0x4e2e[_0x114d4f];return _0x4a7429;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe4e2('0x0'));var path=require(_0xe4e2('0x1'));var config=require(_0xe4e2('0x2'));module[_0xe4e2('0x3')]={'format':{'type':Sequelize[_0xe4e2('0x4')],'get':function(){return this[_0xe4e2('0x5')]('value')?path[_0xe4e2('0x6')](this[_0xe4e2('0x5')](_0xe4e2('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xe4e2('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe4e2('0x8')],'set':function(_0x36b1c6){var _0x1c4e64=_0x36b1c6[_0xe4e2('0x9')](/\\/g,'/');this[_0xe4e2('0xa')](_0xe4e2('0x7'),_0x1c4e64);}},'rating':{'type':Sequelize[_0xe4e2('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe4e2('0xb')],'set':function(_0x4912da){this[_0xe4e2('0xa')](_0xe4e2('0xc'),moment()[_0xe4e2('0xd')](_0x4912da,'ms'));this['setDataValue'](_0xe4e2('0xe'),moment());this[_0xe4e2('0xa')](_0xe4e2('0xf'),_0x4912da);}},'startedAt':{'type':Sequelize[_0xe4e2('0x10')],'get':function(){return moment(this[_0xe4e2('0x5')]('startedAt'))[_0xe4e2('0x11')](_0xe4e2('0x12'))[_0xe4e2('0x13')]();}},'closedAt':{'type':Sequelize[_0xe4e2('0x10')],'get':function(){return moment(this['getDataValue'](_0xe4e2('0xe')))[_0xe4e2('0x11')](_0xe4e2('0x12'))[_0xe4e2('0x13')]();}},'createdAt':{'type':Sequelize[_0xe4e2('0x10')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xe4e2('0x11')](_0xe4e2('0x12'))[_0xe4e2('0x13')]();}},'updatedAt':{'type':Sequelize[_0xe4e2('0x10')],'get':function(){return moment(this[_0xe4e2('0x5')]('updatedAt'))[_0xe4e2('0x11')](_0xe4e2('0x12'))[_0xe4e2('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 55cbf43..f0a5c23 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','order','where','filters','filter','merge','options','include','findAll','rows','catch','show','create','body','duration','createdAt','closedAt','value','find','params','describe','download','uniqueid','join','%s.cypher','existsSync','root','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','destroy','Entity\x20not\x20found'];(function(_0x9fd9a,_0x4f4b1e){var _0x1d66f2=function(_0x10fa7c){while(--_0x10fa7c){_0x9fd9a['push'](_0x9fd9a['shift']());}};_0x1d66f2(++_0x4f4b1e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x311c42,_0x12b97b){_0x311c42=_0x311c42-0x0;var _0x38eda0=_0xe5b3[_0x311c42];return _0x38eda0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x31')](_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29')),[_0x3e5b('0x32')]);_0x10d2ed['query']=_[_0x3e5b('0x33')](_0x1f6473['query']);_0x10d2ed['filters']=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],_0x10d2ed['query']);_0x475b39[_0x3e5b('0x35')]=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x475b39[_0x3e5b('0x35')]=_0x475b39[_0x3e5b('0x35')][_0x3e5b('0x38')]?_0x475b39[_0x3e5b('0x35')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x37')]['hasOwnProperty'](_0x3e5b('0x39'))){_0x475b39[_0x3e5b('0x1e')]=qs['limit'](_0x1f6473['query'][_0x3e5b('0x1e')]);_0x475b39['offset']=qs[_0x3e5b('0x20')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x3a')]=qs['sort'](_0x1f6473[_0x3e5b('0x37')]['sort']);_0x475b39[_0x3e5b('0x3b')]=qs['filters'](_['pick'](_0x1f6473['query'],_0x10d2ed[_0x3e5b('0x3c')]),_0x307091);if(_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x3d')]){_0x475b39[_0x3e5b('0x3b')]=_[_0x3e5b('0x3e')](_0x475b39[_0x3e5b('0x3b')],{'$or':_['map'](_0x307091,function(_0x5d0c59){if(_0x5d0c59['type']!=='VIRTUAL'){var _0x5f0271={};_0x5f0271[_0x5d0c59['name']]={'$like':'%'+_0x1f6473['query'][_0x3e5b('0x3d')]+'%'};return _0x5f0271;}})});}_0x475b39=_[_0x3e5b('0x3e')]({},_0x475b39,_0x1f6473[_0x3e5b('0x3f')]);var _0x1aafd5={'where':_0x475b39[_0x3e5b('0x3b')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x1aafd5)[_0x3e5b('0x27')](function(_0x222d0f){_0x3cfaf6[_0x3e5b('0x1f')]=_0x222d0f;if(_0x1f6473[_0x3e5b('0x37')]['includeAll']){_0x475b39[_0x3e5b('0x40')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')][_0x3e5b('0x41')](_0x475b39);})[_0x3e5b('0x27')](function(_0xa262e0){_0x3cfaf6[_0x3e5b('0x42')]=_0xa262e0;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x43')](handleError(_0x1296ec,null));};exports[_0x3e5b('0x44')]=function(_0x39da3f,_0x13c8d5){var _0x559056={'raw':![],'where':{'id':_0x39da3f['params']['id']}},_0x598ab4={};_0x598ab4['model']=_[_0x3e5b('0x33')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x598ab4[_0x3e5b('0x37')]=_[_0x3e5b('0x33')](_0x39da3f[_0x3e5b('0x37')]);_0x598ab4[_0x3e5b('0x3c')]=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],_0x598ab4[_0x3e5b('0x37')]);_0x559056['attributes']=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x39da3f[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x559056['attributes']=_0x559056['attributes']['length']?_0x559056[_0x3e5b('0x35')]:_0x598ab4[_0x3e5b('0x30')];if(_0x39da3f[_0x3e5b('0x37')]['includeAll']){_0x559056['include']=[{'all':!![]}];}_0x559056=_[_0x3e5b('0x3e')]({},_0x559056,_0x39da3f[_0x3e5b('0x3f')]);return db[_0x3e5b('0x2c')]['find'](_0x559056)['then'](handleEntityNotFound(_0x13c8d5,null))[_0x3e5b('0x27')](respondWithResult(_0x13c8d5,null))['catch'](handleError(_0x13c8d5,null));};exports[_0x3e5b('0x45')]=function(_0x3379a1,_0x3f5835){return db[_0x3e5b('0x2c')][_0x3e5b('0x45')](_0x3379a1[_0x3e5b('0x46')],{})[_0x3e5b('0x27')](respondWithResult(_0x3f5835,0xc9))[_0x3e5b('0x43')](handleError(_0x3f5835,null));};exports[_0x3e5b('0x26')]=function(_0x4a2ae1,_0x223185){if(_0x4a2ae1['body']['id']){delete _0x4a2ae1[_0x3e5b('0x46')]['id'];}delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x47')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x48')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x49')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x4a')];return db[_0x3e5b('0x2c')][_0x3e5b('0x4b')]({'where':{'id':_0x4a2ae1[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x223185,null))['then'](saveUpdates(_0x4a2ae1[_0x3e5b('0x46')],null))[_0x3e5b('0x27')](respondWithResult(_0x223185,null))[_0x3e5b('0x43')](handleError(_0x223185,null));};exports[_0x3e5b('0x4d')]=function(_0x16c9f9,_0x2cecd3){return db['ScreenRecording'][_0x3e5b('0x4d')]()[_0x3e5b('0x27')](respondWithResult(_0x2cecd3,null))[_0x3e5b('0x43')](handleError(_0x2cecd3,null));};exports[_0x3e5b('0x4e')]=function(_0x3f8646,_0x449d0f,_0x216600){var _0x437430=require('../../components/encryptor');var _0x1e6403=![];var _0x5e702f={};if(_0x3f8646['query'][_0x3e5b('0x2e')]&&_0x3f8646['query'][_0x3e5b('0x2e')]===_0x3e5b('0x4f')){_0x5e702f[_0x3e5b('0x4f')]=_0x3f8646[_0x3e5b('0x4c')]['id'];}else{_0x5e702f['id']=_0x3f8646['params']['id'];}return db['ScreenRecording']['find']({'where':_0x5e702f,'attributes':['id','value'],'raw':!![]})[_0x3e5b('0x27')](handleEntityNotFound(_0x449d0f,null))[_0x3e5b('0x27')](function(_0x1ea02a){if(_0x1ea02a){var _0x4149c8=path[_0x3e5b('0x50')](config['root'],'server/files/screen_recordings',_0x1ea02a[_0x3e5b('0x4a')]);var _0x1b0b32=util[_0x3e5b('0x32')](_0x3e5b('0x51'),_0x4149c8);if(fs[_0x3e5b('0x52')](_0x1b0b32)){_0x1e6403=!![];return _0x437430['decryptFile'](_0x1b0b32,_0x4149c8,config['secrets']['recording'])['then'](function(){return _0x1ea02a;});}return _0x1ea02a;}})[_0x3e5b('0x27')](function(_0x3e3115){if(_0x3e3115){var _0x3088d4=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x3e3115[_0x3e5b('0x4a')]);if(!fs[_0x3e5b('0x52')](_0x3088d4)){throw new db['Sequelize'][(_0x3e5b('0x55'))](_0x3e5b('0x56'));}if(_0x3e3115[_0x3e5b('0x57')]){return _0x449d0f[_0x3e5b('0x4e')](_0x3088d4,_0x3e3115[_0x3e5b('0x57')]+path['extname'](_0x3088d4),function(){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}else{return _0x449d0f['download'](_0x3088d4,function(_0x45ca16){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}}})['catch'](function(_0x4a7d8e){if(_0x4a7d8e['message']===_0x3e5b('0x56')){_0x449d0f['status'](0x194)[_0x3e5b('0x59')](_0x3e5b('0x5a'));}else{return handleError(_0x449d0f,null);}});};exports[_0x3e5b('0x5b')]=function(_0x40197c,_0x14f187){return db['ScreenRecording']['find']({'where':{'id':_0x40197c[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](function(_0x3f7f71){if(_['isNil'](_0x3f7f71)){throw new ReferenceError(_0x3e5b('0x5c'));}return _0x3f7f71;})[_0x3e5b('0x27')](function(_0x32a42f){var _0x1c9526=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x32a42f[_0x3e5b('0x4a')]);logger[_0x3e5b('0x5d')](_0x3e5b('0x5e'),_0x1c9526);if(!_[_0x3e5b('0x5f')](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger[_0x3e5b('0x5d')](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs[_0x3e5b('0x62')](_0x1c9526);}_0x1c9526=_0x1c9526+_0x3e5b('0x63');if(!_['isNil'](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger['info'](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs['unlinkSync'](_0x1c9526);}return _0x32a42f;})['then'](function(_0x4f67d1){if(!_0x4f67d1)throw new InternalError();return _0x4f67d1[_0x3e5b('0x5b')]();})[_0x3e5b('0x27')](function(){_0x14f187['status'](0xcc)[_0x3e5b('0x1a')]();})[_0x3e5b('0x43')](handleError(_0x14f187,null));}; \ No newline at end of file +var _0x98a8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','join','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x54031f,_0x16624d){var _0x368669=function(_0x1eb0b5){while(--_0x1eb0b5){_0x54031f['push'](_0x54031f['shift']());}};_0x368669(++_0x16624d);}(_0x98a8,0x12c));var _0x898a=function(_0x1118ac,_0x24949a){_0x1118ac=_0x1118ac-0x0;var _0x924f2f=_0x98a8[_0x1118ac];return _0x924f2f;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x1426e3,_0x5b7719){return function(_0x20bde0){if(!_0x20bde0){_0x1426e3['sendStatus'](0x194);}return _0x20bde0;};}function handleError(_0x513c6b,_0x53ddb2){_0x53ddb2=_0x53ddb2||0x1f4;return function(_0x3678be){logger[_0x898a('0x25')](_0x3678be[_0x898a('0x26')]);if(_0x3678be[_0x898a('0x27')]){delete _0x3678be[_0x898a('0x27')];}_0x513c6b[_0x898a('0x1a')](_0x53ddb2)[_0x898a('0x28')](_0x3678be);};}exports[_0x898a('0x29')]=function(_0xd31922,_0x58149d){var _0x4b3e68={},_0x47f1ed={},_0xe9c33d={'count':0x0,'rows':[]};var _0x62fe93=_[_0x898a('0x2a')](db[_0x898a('0x2b')][_0x898a('0x2c')],function(_0x560000){return{'name':_0x560000[_0x898a('0x2d')],'type':_0x560000[_0x898a('0x2e')][_0x898a('0x2f')]};});_0x47f1ed[_0x898a('0x30')]=_[_0x898a('0x31')](_[_0x898a('0x2a')](_0x62fe93,'name'),[_0x898a('0x32')]);_0x47f1ed[_0x898a('0x33')]=_[_0x898a('0x34')](_0xd31922[_0x898a('0x33')]);_0x47f1ed[_0x898a('0x35')]=_['intersection'](_0x47f1ed['model'],_0x47f1ed[_0x898a('0x33')]);_0x4b3e68[_0x898a('0x36')]=_[_0x898a('0x37')](_0x47f1ed['model'],qs[_0x898a('0x38')](_0xd31922[_0x898a('0x33')][_0x898a('0x38')]));_0x4b3e68[_0x898a('0x36')]=_0x4b3e68[_0x898a('0x36')][_0x898a('0x39')]?_0x4b3e68[_0x898a('0x36')]:_0x47f1ed[_0x898a('0x30')];if(!_0xd31922['query'][_0x898a('0x3a')]('nolimit')){_0x4b3e68['limit']=qs[_0x898a('0x3b')](_0xd31922['query'][_0x898a('0x3b')]);_0x4b3e68['offset']=qs[_0x898a('0x1e')](_0xd31922['query'][_0x898a('0x1e')]);}_0x4b3e68[_0x898a('0x3c')]=qs[_0x898a('0x3d')](_0xd31922['query']['sort']);_0x4b3e68['where']=qs[_0x898a('0x35')](_[_0x898a('0x3e')](_0xd31922['query'],_0x47f1ed[_0x898a('0x35')]),_0x62fe93);if(_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]){_0x4b3e68[_0x898a('0x40')]=_['merge'](_0x4b3e68['where'],{'$or':_[_0x898a('0x2a')](_0x62fe93,function(_0x454c8c){if(_0x454c8c['type']!=='VIRTUAL'){var _0x168f92={};_0x168f92[_0x454c8c[_0x898a('0x27')]]={'$like':'%'+_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]+'%'};return _0x168f92;}})});}_0x4b3e68=_['merge']({},_0x4b3e68,_0xd31922[_0x898a('0x41')]);var _0x369c02={'where':_0x4b3e68['where']};return db['ScreenRecording']['count'](_0x369c02)[_0x898a('0x23')](function(_0x477a9d){_0xe9c33d[_0x898a('0x1d')]=_0x477a9d;if(_0xd31922[_0x898a('0x33')][_0x898a('0x42')]){_0x4b3e68[_0x898a('0x43')]=[{'all':!![]}];}return db[_0x898a('0x2b')][_0x898a('0x44')](_0x4b3e68);})[_0x898a('0x23')](function(_0x235fcf){_0xe9c33d[_0x898a('0x45')]=_0x235fcf;return _0xe9c33d;})[_0x898a('0x23')](respondWithFilteredResult(_0x58149d,_0x4b3e68))[_0x898a('0x46')](handleError(_0x58149d,null));};exports[_0x898a('0x47')]=function(_0x21f307,_0x4c8628){var _0x26ad34={'raw':![],'where':{'id':_0x21f307[_0x898a('0x48')]['id']}},_0x11c437={};_0x11c437['model']=_[_0x898a('0x34')](db[_0x898a('0x2b')][_0x898a('0x2c')]);_0x11c437[_0x898a('0x33')]=_[_0x898a('0x34')](_0x21f307[_0x898a('0x33')]);_0x11c437[_0x898a('0x35')]=_[_0x898a('0x37')](_0x11c437['model'],_0x11c437[_0x898a('0x33')]);_0x26ad34[_0x898a('0x36')]=_[_0x898a('0x37')](_0x11c437[_0x898a('0x30')],qs['fields'](_0x21f307[_0x898a('0x33')][_0x898a('0x38')]));_0x26ad34['attributes']=_0x26ad34[_0x898a('0x36')]['length']?_0x26ad34[_0x898a('0x36')]:_0x11c437['model'];if(_0x21f307['query'][_0x898a('0x42')]){_0x26ad34['include']=[{'all':!![]}];}_0x26ad34=_[_0x898a('0x49')]({},_0x26ad34,_0x21f307[_0x898a('0x41')]);return db['ScreenRecording'][_0x898a('0x4a')](_0x26ad34)[_0x898a('0x23')](handleEntityNotFound(_0x4c8628,null))['then'](respondWithResult(_0x4c8628,null))[_0x898a('0x46')](handleError(_0x4c8628,null));};exports[_0x898a('0x4b')]=function(_0x11a0a3,_0x118240){return db['ScreenRecording'][_0x898a('0x4b')](_0x11a0a3[_0x898a('0x4c')],{})['then'](respondWithResult(_0x118240,0xc9))[_0x898a('0x46')](handleError(_0x118240,null));};exports[_0x898a('0x22')]=function(_0x4ab441,_0x28525b){if(_0x4ab441['body']['id']){delete _0x4ab441[_0x898a('0x4c')]['id'];}delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4d')];delete _0x4ab441['body'][_0x898a('0x4e')];delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4f')];delete _0x4ab441[_0x898a('0x4c')]['value'];return db[_0x898a('0x2b')]['find']({'where':{'id':_0x4ab441[_0x898a('0x48')]['id']}})[_0x898a('0x23')](handleEntityNotFound(_0x28525b,null))[_0x898a('0x23')](saveUpdates(_0x4ab441['body'],null))[_0x898a('0x23')](respondWithResult(_0x28525b,null))[_0x898a('0x46')](handleError(_0x28525b,null));};exports[_0x898a('0x50')]=function(_0x5d325a,_0x52f8c6){return db[_0x898a('0x2b')][_0x898a('0x50')]()[_0x898a('0x23')](respondWithResult(_0x52f8c6,null))[_0x898a('0x46')](handleError(_0x52f8c6,null));};exports[_0x898a('0x51')]=function(_0x36b63a,_0x369f33,_0x6c0f07){var _0x289167=require(_0x898a('0x52'));var _0x2382a9=![];var _0x5e9329={};if(_0x36b63a[_0x898a('0x33')][_0x898a('0x2e')]&&_0x36b63a['query'][_0x898a('0x2e')]==='uniqueid'){_0x5e9329['uniqueid']=_0x36b63a[_0x898a('0x48')]['id'];}else{_0x5e9329['id']=_0x36b63a[_0x898a('0x48')]['id'];}return db[_0x898a('0x2b')]['find']({'where':_0x5e9329,'attributes':['id','value'],'raw':!![]})[_0x898a('0x23')](handleEntityNotFound(_0x369f33,null))[_0x898a('0x23')](function(_0x515725){if(_0x515725){var _0xaa96f7=path[_0x898a('0x53')](config['root'],_0x898a('0x54'),_0x515725[_0x898a('0x55')]);var _0x3122cc=util['format'](_0x898a('0x56'),_0xaa96f7);if(fs[_0x898a('0x57')](_0x3122cc)){_0x2382a9=!![];return _0x289167[_0x898a('0x58')](_0x3122cc,_0xaa96f7,config[_0x898a('0x59')][_0x898a('0x5a')])[_0x898a('0x23')](function(){return _0x515725;});}return _0x515725;}})['then'](function(_0x22a08a){if(_0x22a08a){var _0x4df5f0=path[_0x898a('0x53')](config[_0x898a('0x5b')],_0x898a('0x54'),_0x22a08a[_0x898a('0x55')]);if(!fs[_0x898a('0x57')](_0x4df5f0)){throw new db[(_0x898a('0x5c'))][(_0x898a('0x5d'))](_0x898a('0x5e'));}if(_0x22a08a[_0x898a('0x5f')]){return _0x369f33['download'](_0x4df5f0,_0x22a08a[_0x898a('0x5f')]+path[_0x898a('0x60')](_0x4df5f0),function(){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}else{return _0x369f33[_0x898a('0x51')](_0x4df5f0,function(_0x219976){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}}})[_0x898a('0x46')](function(_0x68fd81){if(_0x68fd81[_0x898a('0x62')]===_0x898a('0x5e')){_0x369f33[_0x898a('0x1a')](0x194)[_0x898a('0x28')](_0x898a('0x63'));}else{return handleError(_0x369f33,null);}});};exports[_0x898a('0x24')]=function(_0x22f9ba,_0x5f42ae){return db[_0x898a('0x2b')][_0x898a('0x4a')]({'where':{'id':_0x22f9ba['params']['id']}})[_0x898a('0x23')](function(_0x4583a1){if(_['isNil'](_0x4583a1)){throw new ReferenceError(_0x898a('0x64'));}return _0x4583a1;})[_0x898a('0x23')](function(_0x21f0f8){var _0x1f3f5b=path['join'](config[_0x898a('0x5b')],_0x898a('0x54'),_0x21f0f8[_0x898a('0x55')]);logger[_0x898a('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f3f5b);if(!_[_0x898a('0x66')](_0x21f0f8[_0x898a('0x55')])&&fs['existsSync'](_0x1f3f5b)){logger[_0x898a('0x65')](_0x898a('0x67')+_0x1f3f5b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x898a('0x68')](_0x1f3f5b);}_0x1f3f5b=_0x1f3f5b+'.cypher';if(!_[_0x898a('0x66')](_0x21f0f8['value'])&&fs['existsSync'](_0x1f3f5b)){logger['info'](_0x898a('0x67')+_0x1f3f5b+_0x898a('0x69'));fs[_0x898a('0x68')](_0x1f3f5b);}return _0x21f0f8;})[_0x898a('0x23')](function(_0x5e0535){if(!_0x5e0535)throw new InternalError();return _0x5e0535['destroy']();})[_0x898a('0x23')](function(){_0x5f42ae[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();})[_0x898a('0x46')](handleError(_0x5f42ae,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index d2cf969..b218557 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 _0x90ca=['../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','rimraf'];(function(_0x5ec7f0,_0x311b7d){var _0x3619f1=function(_0x201ddd){while(--_0x201ddd){_0x5ec7f0['push'](_0x5ec7f0['shift']());}};_0x3619f1(++_0x311b7d);}(_0x90ca,0x1f2));var _0xa90c=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x90ca[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0xa90c('0x0'));var util=require(_0xa90c('0x1'));var logger=require('../../config/logger')(_0xa90c('0x2'));var moment=require(_0xa90c('0x3'));var BPromise=require(_0xa90c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa90c('0x5'));var config=require(_0xa90c('0x6'));var attributes=require(_0xa90c('0x7'));module[_0xa90c('0x8')]=function(_0x188491,_0x52c03d){return _0x188491['define'](_0xa90c('0x9'),attributes,{'tableName':_0xa90c('0xa'),'paranoid':![],'indexes':[{'name':_0xa90c('0xb'),'fields':[_0xa90c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccb4=['request-promise','path','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment'];(function(_0x41fe28,_0x5dfbad){var _0x190689=function(_0x35b203){while(--_0x35b203){_0x41fe28['push'](_0x41fe28['shift']());}};_0x190689(++_0x5dfbad);}(_0xccb4,0x13f));var _0x4ccb=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xccb4[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x4ccb('0x0'));var util=require(_0x4ccb('0x1'));var logger=require(_0x4ccb('0x2'))(_0x4ccb('0x3'));var moment=require(_0x4ccb('0x4'));var BPromise=require('bluebird');var rp=require(_0x4ccb('0x5'));var fs=require('fs');var path=require(_0x4ccb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ccb('0x7'));module[_0x4ccb('0x8')]=function(_0x2c1d24,_0x12061e){return _0x2c1d24[_0x4ccb('0x9')](_0x4ccb('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x4ccb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 75bf83e..a174711 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 _0x0ea7=['rpc','../../config/environment','client','request','then','info','request\x20sent','debug','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x0ea7,0x173));var _0x70ea=function(_0x83d5a9,_0x400d42){_0x83d5a9=_0x83d5a9-0x0;var _0x508e7d=_0x0ea7[_0x83d5a9];return _0x508e7d;};'use strict';var _=require(_0x70ea('0x0'));var util=require(_0x70ea('0x1'));var moment=require(_0x70ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x70ea('0x3'));var fs=require('fs');var Redis=require(_0x70ea('0x4'));var db=require(_0x70ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x70ea('0x6'))(_0x70ea('0x7'));var config=require(_0x70ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x70ea('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23d382,_0x1d3b23,_0x7fcee0){return new BPromise(function(_0x455639,_0x586a84){return client[_0x70ea('0xa')](_0x23d382,_0x7fcee0)[_0x70ea('0xb')](function(_0xdbdac1){logger[_0x70ea('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x1d3b23,_0x70ea('0xd'));logger[_0x70ea('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1d3b23,_0x70ea('0xd'),JSON['stringify'](_0xdbdac1));if(_0xdbdac1['error']){if(_0xdbdac1[_0x70ea('0xf')][_0x70ea('0x10')]===0x1f4){logger[_0x70ea('0xf')](_0x70ea('0x11'),_0x1d3b23,_0xdbdac1[_0x70ea('0xf')][_0x70ea('0x12')]);return _0x586a84(_0xdbdac1[_0x70ea('0xf')][_0x70ea('0x12')]);}logger[_0x70ea('0xf')](_0x70ea('0x11'),_0x1d3b23,_0xdbdac1['error'][_0x70ea('0x12')]);return _0x455639(_0xdbdac1[_0x70ea('0xf')][_0x70ea('0x12')]);}else{logger[_0x70ea('0xc')](_0x70ea('0x11'),_0x1d3b23,_0x70ea('0xd'));_0x455639(_0xdbdac1[_0x70ea('0x13')][_0x70ea('0x12')]);}})[_0x70ea('0x14')](function(_0x45620b){logger[_0x70ea('0xf')](_0x70ea('0x11'),_0x1d3b23,_0x45620b);_0x586a84(_0x45620b);});});} \ No newline at end of file +var _0x261c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','moment'];(function(_0x5ddf96,_0x317a40){var _0x7bce24=function(_0x1e01c4){while(--_0x1e01c4){_0x5ddf96['push'](_0x5ddf96['shift']());}};_0x7bce24(++_0x317a40);}(_0x261c,0x1f3));var _0xc261=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0x261c[_0x152449];return _0x5b58b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc261('0x0'));var BPromise=require(_0xc261('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc261('0x2'));var db=require(_0xc261('0x3'))['db'];var utils=require(_0xc261('0x4'));var logger=require(_0xc261('0x5'))('rpc');var config=require(_0xc261('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed579,_0x26dbe8,_0x414fe3){return new BPromise(function(_0x16aa87,_0x569a2c){return client[_0xc261('0x7')](_0x4ed579,_0x414fe3)[_0xc261('0x8')](function(_0x558980){logger[_0xc261('0x9')]('ScreenRecording,\x20%s,\x20%s',_0x26dbe8,_0xc261('0xa'));logger[_0xc261('0xb')](_0xc261('0xc'),_0x26dbe8,'request\x20sent',JSON[_0xc261('0xd')](_0x558980));if(_0x558980[_0xc261('0xe')]){if(_0x558980[_0xc261('0xe')][_0xc261('0xf')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x26dbe8,_0x558980[_0xc261('0xe')][_0xc261('0x10')]);return _0x569a2c(_0x558980[_0xc261('0xe')][_0xc261('0x10')]);}logger[_0xc261('0xe')](_0xc261('0x11'),_0x26dbe8,_0x558980[_0xc261('0xe')][_0xc261('0x10')]);return _0x16aa87(_0x558980[_0xc261('0xe')][_0xc261('0x10')]);}else{logger['info'](_0xc261('0x11'),_0x26dbe8,'request\x20sent');_0x16aa87(_0x558980[_0xc261('0x12')]['message']);}})[_0xc261('0x13')](function(_0x4982b3){logger[_0xc261('0xe')](_0xc261('0x11'),_0x26dbe8,_0x4982b3);_0x569a2c(_0x4982b3);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 58be895..bef4ca2 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 _0x5f38=['logo','extname','originalname','post','single','file','addLogo','root','logologin','/:id/logo_login','addLogoLogin','preferred','/:id/preferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x5f38,0x1cb));var _0x85f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f38[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x85f3('0x0'));var util=require('util');var path=require(_0x85f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x85f3('0x2'));var router=express[_0x85f3('0x3')]();var fs_extra=require(_0x85f3('0x4'));var auth=require(_0x85f3('0x5'));var interaction=require(_0x85f3('0x6'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x85f3('0x7')]('/',auth[_0x85f3('0x8')](),controller[_0x85f3('0x9')]);router[_0x85f3('0x7')](_0x85f3('0xa'),controller[_0x85f3('0xb')]);router[_0x85f3('0x7')](_0x85f3('0xc'),controller[_0x85f3('0xd')]);router[_0x85f3('0x7')](_0x85f3('0xe'),controller[_0x85f3('0xf')]);router['get']('/:id/logo_login',controller[_0x85f3('0x10')]);router[_0x85f3('0x7')](_0x85f3('0x11'),controller[_0x85f3('0x12')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x85f3('0x7')]('/:id/favicon',controller[_0x85f3('0x13')]);var upload=multer({'storage':multer[_0x85f3('0x14')]({'destination':function(_0x5dd6bf,_0x4897d6,_0x5f5330){_0x5f5330(null,path[_0x85f3('0x15')](config['root'],_0x85f3('0x16')));},'filename':function(_0xd8393d,_0x4d8302,_0x2f7b71){_0x2f7b71(null,util[_0x85f3('0x17')](_0x85f3('0x18'),_0x85f3('0x19'),path[_0x85f3('0x1a')](_0x4d8302[_0x85f3('0x1b')])));}})});router[_0x85f3('0x1c')]('/:id/logo',upload[_0x85f3('0x1d')](_0x85f3('0x1e')),controller[_0x85f3('0x1f')]);var upload=multer({'storage':multer[_0x85f3('0x14')]({'destination':function(_0x624838,_0x1f6062,_0x1523e6){_0x1523e6(null,path[_0x85f3('0x15')](config[_0x85f3('0x20')],'server/files/images/logos/'));},'filename':function(_0x39af17,_0x5e5cfe,_0x59b2dc){_0x59b2dc(null,util[_0x85f3('0x17')](_0x85f3('0x18'),_0x85f3('0x21'),path[_0x85f3('0x1a')](_0x5e5cfe[_0x85f3('0x1b')])));}})});router[_0x85f3('0x1c')](_0x85f3('0x22'),upload[_0x85f3('0x1d')](_0x85f3('0x1e')),controller[_0x85f3('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x423c9d,_0x297d11,_0x34b00e){_0x34b00e(null,path[_0x85f3('0x15')](config[_0x85f3('0x20')],'server/files/images/logos/'));},'filename':function(_0x311c20,_0x432903,_0x422be0){_0x422be0(null,util[_0x85f3('0x17')]('%s%s',_0x85f3('0x24'),path['extname'](_0x432903[_0x85f3('0x1b')])));}})});router[_0x85f3('0x1c')](_0x85f3('0x25'),upload[_0x85f3('0x1d')](_0x85f3('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer[_0x85f3('0x14')]({'destination':function(_0x2fc196,_0x2794aa,_0x2455b0){_0x2455b0(null,path[_0x85f3('0x15')](config[_0x85f3('0x20')],_0x85f3('0x16')));},'filename':function(_0x1b0aa2,_0x270576,_0x5b0c1d){_0x5b0c1d(null,util[_0x85f3('0x17')](_0x85f3('0x18'),_0x85f3('0x26'),path[_0x85f3('0x1a')](_0x270576[_0x85f3('0x1b')])));}})});router[_0x85f3('0x1c')](_0x85f3('0x27'),upload['single'](_0x85f3('0x1e')),controller[_0x85f3('0x28')]);router[_0x85f3('0x29')](_0x85f3('0xc'),auth[_0x85f3('0x8')](),controller[_0x85f3('0x2a')]);module[_0x85f3('0x2b')]=router; \ No newline at end of file +var _0x9218=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','addLogo','diskStorage','post','addLogoLogin','root','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer'];(function(_0x444555,_0x5bb963){var _0x1db9d4=function(_0xfeecc){while(--_0xfeecc){_0x444555['push'](_0x444555['shift']());}};_0x1db9d4(++_0x5bb963);}(_0x9218,0x18b));var _0x8921=function(_0x59322e,_0x2a8e89){_0x59322e=_0x59322e-0x0;var _0x55a2f8=_0x9218[_0x59322e];return _0x55a2f8;};'use strict';var multer=require(_0x8921('0x0'));var util=require('util');var path=require(_0x8921('0x1'));var timeout=require(_0x8921('0x2'));var express=require(_0x8921('0x3'));var router=express['Router']();var fs_extra=require(_0x8921('0x4'));var auth=require(_0x8921('0x5'));var interaction=require(_0x8921('0x6'));var config=require(_0x8921('0x7'));var controller=require('./setting.controller');router[_0x8921('0x8')]('/',auth[_0x8921('0x9')](),controller['index']);router[_0x8921('0x8')](_0x8921('0xa'),controller[_0x8921('0xb')]);router['get'](_0x8921('0xc'),controller[_0x8921('0xd')]);router[_0x8921('0x8')](_0x8921('0xe'),controller[_0x8921('0xf')]);router['get'](_0x8921('0x10'),controller['getLogoLogin']);router['get'](_0x8921('0x11'),controller[_0x8921('0x12')]);router[_0x8921('0x8')]('/:id/preferred',controller[_0x8921('0x13')]);router['get'](_0x8921('0x14'),controller[_0x8921('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18193e,_0x1f2959,_0x401c08){_0x401c08(null,path[_0x8921('0x16')](config['root'],_0x8921('0x17')));},'filename':function(_0x1fb45e,_0x33f401,_0x7b6892){_0x7b6892(null,util[_0x8921('0x18')](_0x8921('0x19'),_0x8921('0x1a'),path[_0x8921('0x1b')](_0x33f401[_0x8921('0x1c')])));}})});router['post'](_0x8921('0xe'),upload[_0x8921('0x1d')](_0x8921('0x1e')),controller[_0x8921('0x1f')]);var upload=multer({'storage':multer[_0x8921('0x20')]({'destination':function(_0x258405,_0x481243,_0x123d7d){_0x123d7d(null,path['join'](config['root'],_0x8921('0x17')));},'filename':function(_0x374fab,_0x8112a5,_0x90c8f6){_0x90c8f6(null,util[_0x8921('0x18')](_0x8921('0x19'),'logologin',path[_0x8921('0x1b')](_0x8112a5[_0x8921('0x1c')])));}})});router[_0x8921('0x21')](_0x8921('0x10'),upload[_0x8921('0x1d')](_0x8921('0x1e')),controller[_0x8921('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x413772,_0x3c5568,_0x218861){_0x218861(null,path['join'](config[_0x8921('0x23')],_0x8921('0x17')));},'filename':function(_0x43d79b,_0x311fd4,_0x5c1a04){_0x5c1a04(null,util[_0x8921('0x18')](_0x8921('0x19'),_0x8921('0x24'),path['extname'](_0x311fd4[_0x8921('0x1c')])));}})});router[_0x8921('0x21')](_0x8921('0x25'),upload['single']('file'),controller[_0x8921('0x26')]);var upload=multer({'storage':multer[_0x8921('0x20')]({'destination':function(_0x3f0815,_0x5d6143,_0x5e9236){_0x5e9236(null,path[_0x8921('0x16')](config[_0x8921('0x23')],'server/files/images/logos/'));},'filename':function(_0x2962f2,_0x1ebde0,_0x4562cf){_0x4562cf(null,util[_0x8921('0x18')](_0x8921('0x19'),_0x8921('0x27'),path[_0x8921('0x1b')](_0x1ebde0[_0x8921('0x1c')])));}})});router[_0x8921('0x21')](_0x8921('0x14'),upload['single'](_0x8921('0x1e')),controller[_0x8921('0x28')]);router[_0x8921('0x29')]('/:id',auth[_0x8921('0x9')](),controller[_0x8921('0x2a')]);module[_0x8921('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 45ed878..8eacf37 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 _0xb654=['sequelize','exports','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x5f515d,_0x405531){var _0x3751de=function(_0xd85c55){while(--_0xd85c55){_0x5f515d['push'](_0x5f515d['shift']());}};_0x3751de(++_0x405531);}(_0xb654,0xab));var _0x4b65=function(_0x1e7fb8,_0x5d4001){_0x1e7fb8=_0x1e7fb8-0x0;var _0xc8e860=_0xb654[_0x1e7fb8];return _0xc8e860;};'use strict';var Sequelize=require(_0x4b65('0x0'));module[_0x4b65('0x1')]={'min_internal':{'type':Sequelize[_0x4b65('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4b65('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4b65('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4b65('0x3')],'defaultValue':_0x4b65('0x4')},'logo':{'type':Sequelize[_0x4b65('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x4b65('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x4b65('0x3')]},'turnusername':{'type':Sequelize[_0x4b65('0x3')]},'turnpassword':{'type':Sequelize[_0x4b65('0x3')]},'pageTitle':{'type':Sequelize[_0x4b65('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4b65('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x4b65('0x6')},'enableEmailPreview':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4b65('0x3')],'defaultValue':_0x4b65('0x7')},'chatTimeout':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4b65('0x3')]},'defaultPreferred':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4b65('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4b65('0x3')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x4b65('0x2')]},'transcribeRegion':{'type':Sequelize[_0x4b65('0x3')]},'sentiment':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x4b65('0x2')]},'sentimentRegion':{'type':Sequelize[_0x4b65('0x3')]},'language':{'type':Sequelize[_0x4b65('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x4b65('0x2')](0x2)[_0x4b65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x4b65('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x4b65('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x4b65('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x4b65('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xf5ef=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted'];(function(_0x518e48,_0x2e5dc6){var _0x5d2de4=function(_0x42516a){while(--_0x42516a){_0x518e48['push'](_0x518e48['shift']());}};_0x5d2de4(++_0x2e5dc6);}(_0xf5ef,0x127));var _0xff5e=function(_0x52fa19,_0x270379){_0x52fa19=_0x52fa19-0x0;var _0x1395cf=_0xf5ef[_0x52fa19];return _0x1395cf;};'use strict';var Sequelize=require(_0xff5e('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xff5e('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xff5e('0x2')](0xb),'unique':_0xff5e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xff5e('0x4')},'logo':{'type':Sequelize[_0xff5e('0x5')]},'defaultLogo':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xff5e('0x5')]},'turnaddr':{'type':Sequelize[_0xff5e('0x5')]},'turnusername':{'type':Sequelize[_0xff5e('0x5')]},'turnpassword':{'type':Sequelize[_0xff5e('0x5')]},'pageTitle':{'type':Sequelize[_0xff5e('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xff5e('0x7')},'enableEmailPreview':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xff5e('0x5')],'defaultValue':_0xff5e('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xff5e('0x5')]},'defaultPreferred':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xff5e('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xff5e('0x5')]},'defaultFavicon':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xff5e('0x2')]},'transcribeRegion':{'type':Sequelize[_0xff5e('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xff5e('0x2')]},'sentimentRegion':{'type':Sequelize[_0xff5e('0x5')]},'language':{'type':Sequelize[_0xff5e('0x5')]},'bucket':{'type':Sequelize[_0xff5e('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xff5e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xff5e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xff5e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0xff5e('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xff5e('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xff5e('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index de84ea8..af74d81 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 _0xc827=['apply','reject','save','update','destroy','index','fieldName','key','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','Setting','findAll','rows','params','rawAttributes','find','body','addLogo','file','filename','loginLogo','../../config/license/util','getLogo','logo','preferred','defaultLogo','defaultLoginLogo','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','download','server/files/images/logos','favicon','defaultPreferred','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','getLicense','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','send','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Setting,\x20%s,\x20%s','info','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x7816ac,_0x372d82){var _0x531068=function(_0x18525a){while(--_0x18525a){_0x7816ac['push'](_0x7816ac['shift']());}};_0x531068(++_0x372d82);}(_0xc827,0x149));var _0x7c82=function(_0x494e31,_0x299915){_0x494e31=_0x494e31-0x0;var _0x4dd0bd=_0xc827[_0x494e31];return _0x4dd0bd;};'use strict';var emlformat=require(_0x7c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c82('0x2'));var moment=require('moment');var BPromise=require(_0x7c82('0x3'));var Mustache=require(_0x7c82('0x4'));var util=require(_0x7c82('0x5'));var path=require(_0x7c82('0x6'));var sox=require(_0x7c82('0x7'));var csv=require(_0x7c82('0x8'));var ejs=require(_0x7c82('0x9'));var fs=require('fs');var fs_extra=require(_0x7c82('0xa'));var _=require(_0x7c82('0xb'));var squel=require(_0x7c82('0xc'));var crypto=require(_0x7c82('0xd'));var jsforce=require(_0x7c82('0xe'));var deskjs=require(_0x7c82('0xf'));var toCsv=require(_0x7c82('0x8'));var querystring=require(_0x7c82('0x10'));var Papa=require(_0x7c82('0x11'));var Redis=require(_0x7c82('0x12'));var authService=require(_0x7c82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7c82('0x14'));var hardwareService=require(_0x7c82('0x15'));var logger=require('../../config/logger')(_0x7c82('0x16'));var utils=require(_0x7c82('0x17'));var config=require(_0x7c82('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c82('0x19'))['db'];var jayson=require(_0x7c82('0x1a'));var client=jayson[_0x7c82('0x1b')][_0x7c82('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x64e681,_0x3ec0d3,_0x1416aa,_0x3247e9){return new BPromise(function(_0x296a6e,_0x21bd3a){var _0x402955=_0x3247e9||client;return _0x402955[_0x7c82('0x1d')](_0x64e681,_0x1416aa)[_0x7c82('0x1e')](function(_0x15f75c){logger['info']('Setting,\x20%s,\x20%s',_0x3ec0d3,'request\x20sent');logger[_0x7c82('0x1f')](_0x7c82('0x20'),_0x3ec0d3,_0x7c82('0x21'),JSON[_0x7c82('0x22')](_0x15f75c));if(_0x15f75c[_0x7c82('0x23')]){if(_0x15f75c['error'][_0x7c82('0x24')]===0x1f4){logger[_0x7c82('0x23')]('Setting,\x20%s,\x20%s',_0x3ec0d3,_0x15f75c[_0x7c82('0x23')][_0x7c82('0x25')]);return _0x21bd3a(_0x15f75c['error']['message']);}logger[_0x7c82('0x23')](_0x7c82('0x26'),_0x3ec0d3,_0x15f75c[_0x7c82('0x23')][_0x7c82('0x25')]);return _0x296a6e(_0x15f75c[_0x7c82('0x23')]['message']);}else{logger[_0x7c82('0x27')](_0x7c82('0x26'),_0x3ec0d3,_0x7c82('0x21'));_0x296a6e(_0x15f75c[_0x7c82('0x28')][_0x7c82('0x25')]);}})[_0x7c82('0x29')](function(_0x4c1ad9){logger[_0x7c82('0x23')](_0x7c82('0x26'),_0x3ec0d3,_0x4c1ad9);_0x21bd3a(_0x4c1ad9);});});}function respondWithStatusCode(_0x936172,_0x45d07e){_0x45d07e=_0x45d07e||0xcc;return function(_0x7e99fd){if(_0x7e99fd){return _0x936172[_0x7c82('0x2a')](_0x45d07e);}return _0x936172['status'](_0x45d07e)[_0x7c82('0x2b')]();};}function respondWithResult(_0x18b25a,_0xeae995){_0xeae995=_0xeae995||0xc8;return function(_0x53452a){if(_0x53452a){return _0x18b25a[_0x7c82('0x2c')](_0xeae995)[_0x7c82('0x2d')](_0x53452a);}};}function respondWithFilteredResult(_0x477693,_0x411226){return function(_0x30aae9){if(_0x30aae9){var _0x3bb1f6=typeof _0x411226['offset']===_0x7c82('0x2e')&&typeof _0x411226[_0x7c82('0x2f')]===_0x7c82('0x2e');var _0x11606f=_0x30aae9['count'];var _0x311c22=_0x3bb1f6?0x0:_0x411226[_0x7c82('0x30')];var _0x1d0838=_0x3bb1f6?_0x30aae9[_0x7c82('0x31')]:_0x411226[_0x7c82('0x30')]+_0x411226[_0x7c82('0x2f')];var _0x45c8b9;if(_0x1d0838>=_0x11606f){_0x1d0838=_0x11606f;_0x45c8b9=0xc8;}else{_0x45c8b9=0xce;}_0x477693[_0x7c82('0x2c')](_0x45c8b9);return _0x477693[_0x7c82('0x32')](_0x7c82('0x33'),_0x311c22+'-'+_0x1d0838+'/'+_0x11606f)[_0x7c82('0x2d')](_0x30aae9);}return null;};}function patchUpdates(_0x4303d5){return function(_0x2a7da0){try{jsonpatch[_0x7c82('0x34')](_0x2a7da0,_0x4303d5,!![]);}catch(_0xb53e38){return BPromise[_0x7c82('0x35')](_0xb53e38);}return _0x2a7da0[_0x7c82('0x36')]();};}function saveUpdates(_0x3b0593,_0x194dae){return function(_0x4b8489){if(_0x4b8489){return _0x4b8489[_0x7c82('0x37')](_0x3b0593)[_0x7c82('0x1e')](function(_0xe56376){return _0xe56376;});}return null;};}function removeEntity(_0x3bef43,_0x3e8d16){return function(_0x11de31){if(_0x11de31){return _0x11de31[_0x7c82('0x38')]()[_0x7c82('0x1e')](function(){_0x3bef43['status'](0xcc)[_0x7c82('0x2b')]();});}};}function handleEntityNotFound(_0x9ded3a,_0x5be05d){return function(_0x172ee7){if(!_0x172ee7){_0x9ded3a[_0x7c82('0x2a')](0x194);}return _0x172ee7;};}function handleError(_0x16bdcd,_0x287553){_0x287553=_0x287553||0x1f4;return function(_0x148a62){logger['error'](_0x148a62['stack']);if(_0x148a62['name']){delete _0x148a62['name'];}_0x16bdcd[_0x7c82('0x2c')](_0x287553)['send'](_0x148a62);};}exports[_0x7c82('0x39')]=function(_0x56bb4a,_0x5c96e0){var _0x84874a={},_0x559e9d={},_0x3c1a26={'count':0x0,'rows':[]};var _0x291239=_['map'](db['Setting']['rawAttributes'],function(_0x2626ac){return{'name':_0x2626ac[_0x7c82('0x3a')],'type':_0x2626ac['type'][_0x7c82('0x3b')]};});_0x559e9d[_0x7c82('0x3c')]=_[_0x7c82('0x3d')](_0x291239,_0x7c82('0x3e'));_0x559e9d['query']=_[_0x7c82('0x3f')](_0x56bb4a[_0x7c82('0x40')]);_0x559e9d['filters']=_[_0x7c82('0x41')](_0x559e9d[_0x7c82('0x3c')],_0x559e9d[_0x7c82('0x40')]);_0x84874a[_0x7c82('0x42')]=_[_0x7c82('0x41')](_0x559e9d[_0x7c82('0x3c')],qs[_0x7c82('0x43')](_0x56bb4a[_0x7c82('0x40')][_0x7c82('0x43')]));_0x84874a[_0x7c82('0x42')]=_0x84874a[_0x7c82('0x42')][_0x7c82('0x44')]?_0x84874a['attributes']:_0x559e9d[_0x7c82('0x3c')];if(!_0x56bb4a['query'][_0x7c82('0x45')]('nolimit')){_0x84874a['limit']=qs[_0x7c82('0x2f')](_0x56bb4a[_0x7c82('0x40')][_0x7c82('0x2f')]);_0x84874a['offset']=qs[_0x7c82('0x30')](_0x56bb4a[_0x7c82('0x40')][_0x7c82('0x30')]);}_0x84874a[_0x7c82('0x46')]=qs[_0x7c82('0x47')](_0x56bb4a['query'][_0x7c82('0x47')]);_0x84874a[_0x7c82('0x48')]=qs[_0x7c82('0x49')](_[_0x7c82('0x4a')](_0x56bb4a[_0x7c82('0x40')],_0x559e9d[_0x7c82('0x49')]),_0x291239);if(_0x56bb4a[_0x7c82('0x40')][_0x7c82('0x4b')]){_0x84874a[_0x7c82('0x48')]=_['merge'](_0x84874a[_0x7c82('0x48')],{'$or':_[_0x7c82('0x3d')](_0x291239,function(_0x32835d){if(_0x32835d[_0x7c82('0x4c')]!==_0x7c82('0x4d')){var _0x1de969={};_0x1de969[_0x32835d[_0x7c82('0x3e')]]={'$like':'%'+_0x56bb4a[_0x7c82('0x40')]['filter']+'%'};return _0x1de969;}})});}_0x84874a=_[_0x7c82('0x4e')]({},_0x84874a,_0x56bb4a[_0x7c82('0x4f')]);var _0x353ba4={'where':_0x84874a[_0x7c82('0x48')]};return db['Setting'][_0x7c82('0x31')](_0x353ba4)[_0x7c82('0x1e')](function(_0x4c11a5){_0x3c1a26[_0x7c82('0x31')]=_0x4c11a5;if(_0x56bb4a[_0x7c82('0x40')]['includeAll']){_0x84874a[_0x7c82('0x50')]=[{'all':!![]}];}return db[_0x7c82('0x51')][_0x7c82('0x52')](_0x84874a);})['then'](function(_0x3afa05){_0x3c1a26[_0x7c82('0x53')]=_0x3afa05;return _0x3c1a26;})[_0x7c82('0x1e')](respondWithFilteredResult(_0x5c96e0,_0x84874a))[_0x7c82('0x29')](handleError(_0x5c96e0,null));};exports['show']=function(_0x4e6d8c,_0x49d9a1){var _0x2aa703={'raw':![],'where':{'id':_0x4e6d8c[_0x7c82('0x54')]['id']}},_0x72a484={};_0x72a484[_0x7c82('0x3c')]=_[_0x7c82('0x3f')](db[_0x7c82('0x51')][_0x7c82('0x55')]);_0x72a484[_0x7c82('0x40')]=_[_0x7c82('0x3f')](_0x4e6d8c['query']);_0x72a484[_0x7c82('0x49')]=_[_0x7c82('0x41')](_0x72a484['model'],_0x72a484[_0x7c82('0x40')]);_0x2aa703[_0x7c82('0x42')]=_[_0x7c82('0x41')](_0x72a484[_0x7c82('0x3c')],qs['fields'](_0x4e6d8c[_0x7c82('0x40')][_0x7c82('0x43')]));_0x2aa703[_0x7c82('0x42')]=_0x2aa703[_0x7c82('0x42')][_0x7c82('0x44')]?_0x2aa703[_0x7c82('0x42')]:_0x72a484['model'];if(_0x4e6d8c[_0x7c82('0x40')]['includeAll']){_0x2aa703[_0x7c82('0x50')]=[{'all':!![]}];}_0x2aa703=_[_0x7c82('0x4e')]({},_0x2aa703,_0x4e6d8c[_0x7c82('0x4f')]);return db[_0x7c82('0x51')][_0x7c82('0x56')](_0x2aa703)['then'](handleEntityNotFound(_0x49d9a1,null))[_0x7c82('0x1e')](respondWithResult(_0x49d9a1,null))['catch'](handleError(_0x49d9a1,null));};exports[_0x7c82('0x37')]=function(_0x4fbdf8,_0xadc885){if(_0x4fbdf8[_0x7c82('0x57')]['id']){delete _0x4fbdf8[_0x7c82('0x57')]['id'];}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x4fbdf8[_0x7c82('0x54')]['id']}})[_0x7c82('0x1e')](handleEntityNotFound(_0xadc885,null))['then'](saveUpdates(_0x4fbdf8[_0x7c82('0x57')],null))[_0x7c82('0x1e')](respondWithResult(_0xadc885,null))['catch'](handleError(_0xadc885,null));};exports[_0x7c82('0x58')]=function(_0x934986,_0x2a0138,_0x5ea1eb){if(_0x934986['file']&&_0x934986[_0x7c82('0x59')][_0x7c82('0x5a')]){_0x934986[_0x7c82('0x57')]['logo']=_0x934986['file'][_0x7c82('0x5a')];}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x934986[_0x7c82('0x54')]['id']}})[_0x7c82('0x1e')](handleEntityNotFound(_0x2a0138,null))[_0x7c82('0x1e')](saveUpdates(_0x934986['body'],null))[_0x7c82('0x1e')](respondWithResult(_0x2a0138,null))['catch'](handleError(_0x2a0138,null));};exports['addLogoLogin']=function(_0x266a12,_0x25be8c,_0x4a429e){if(_0x266a12[_0x7c82('0x59')]&&_0x266a12[_0x7c82('0x59')][_0x7c82('0x5a')]){_0x266a12[_0x7c82('0x57')][_0x7c82('0x5b')]=_0x266a12['file'][_0x7c82('0x5a')];}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x266a12[_0x7c82('0x54')]['id']}})[_0x7c82('0x1e')](handleEntityNotFound(_0x25be8c,null))[_0x7c82('0x1e')](saveUpdates(_0x266a12[_0x7c82('0x57')],null))['then'](respondWithResult(_0x25be8c,null))[_0x7c82('0x29')](handleError(_0x25be8c,null));};var utilLicense=require(_0x7c82('0x5c'));exports[_0x7c82('0x5d')]=function(_0x54eeca,_0x101c33,_0x381f05){var _0x13297a='server/files/images/logos';var _0x253ee6={'custom':![]};return utilLicense['getLicense']()[_0x7c82('0x1e')](function(_0x2cb403){if(_0x2cb403){_0x253ee6=_0x2cb403;}return db['Setting']['find']({'where':{'id':_0x54eeca['params']['id']},'attributes':[_0x7c82('0x5e'),_0x7c82('0x5b'),_0x7c82('0x5f'),'favicon',_0x7c82('0x60'),_0x7c82('0x61'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x7c82('0x1e')](handleEntityNotFound(_0x101c33,null))[_0x7c82('0x1e')](function(_0x21a337){if(_0x21a337){var _0x47c23=_0x21a337[_0x7c82('0x5e')]&&fs['existsSync'](path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x13297a,_[_0x7c82('0x64')](_0x21a337[_0x7c82('0x5e')])))?path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x13297a,_[_0x7c82('0x64')](_0x21a337[_0x7c82('0x5e')])):path['join'](config[_0x7c82('0x63')],_0x13297a,_['toLower'](_0x7c82('0x65')));var _0x5acb2d=_0x7c82('0x66')+_[_0x7c82('0x67')]('logo');if(_0x21a337[_0x5acb2d]||!_0x253ee6[_0x7c82('0x68')]){_0x47c23=path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x13297a,_[_0x7c82('0x64')]('default_logo.svg'));}if(!fs[_0x7c82('0x69')](_0x47c23)){throw new db[(_0x7c82('0x6a'))][(_0x7c82('0x6b'))](_['upperFirst'](_0x7c82('0x5e'))+'\x20not\x20found');}return _0x101c33[_0x7c82('0x6c')](_0x47c23);}})[_0x7c82('0x29')](handleError(_0x101c33,null));};var utilLicense=require(_0x7c82('0x5c'));exports['getLogoLogin']=function(_0xd434e,_0x36901e,_0x4b19fc){var _0x4df34f=_0x7c82('0x6d');var _0x2c2cb6={'custom':![]};return utilLicense['getLicense']()[_0x7c82('0x1e')](function(_0x6ff712){if(_0x6ff712){_0x2c2cb6=_0x6ff712;}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0xd434e[_0x7c82('0x54')]['id']},'attributes':[_0x7c82('0x5e'),'loginLogo',_0x7c82('0x5f'),_0x7c82('0x6e'),_0x7c82('0x60'),_0x7c82('0x61'),_0x7c82('0x6f'),_0x7c82('0x70')],'raw':!![]});})[_0x7c82('0x1e')](handleEntityNotFound(_0x36901e,null))[_0x7c82('0x1e')](function(_0x59068c){if(_0x59068c){var _0xb0eda4=_0x59068c['loginLogo']&&fs[_0x7c82('0x69')](path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x4df34f,_['toLower'](_0x59068c[_0x7c82('0x5b')])))?path[_0x7c82('0x62')](config['root'],_0x4df34f,_['toLower'](_0x59068c[_0x7c82('0x5b')])):path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x4df34f,_[_0x7c82('0x64')](_0x7c82('0x71')));var _0x25e0bb='default'+_[_0x7c82('0x67')](_0x7c82('0x5b'));if(_0x59068c[_0x25e0bb]||!_0x2c2cb6[_0x7c82('0x68')]){_0xb0eda4=path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x4df34f,_['toLower'](_0x7c82('0x71')));}if(!fs[_0x7c82('0x69')](_0xb0eda4)){throw new db[(_0x7c82('0x6a'))]['ValidationError'](_['upperFirst'](_0x7c82('0x5b'))+'\x20not\x20found');}return _0x36901e['download'](_0xb0eda4);}})['catch'](handleError(_0x36901e,null));};exports[_0x7c82('0x72')]=function(_0x12317d,_0x33bc62){return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x12317d[_0x7c82('0x54')]['id']},'attributes':[_0x7c82('0x73')]})[_0x7c82('0x1e')](respondWithResult(_0x33bc62,null))[_0x7c82('0x29')](handleError(_0x33bc62,null));};exports[_0x7c82('0x74')]=function(_0x3e0f75,_0x32b77b,_0x1684d9){if(_0x3e0f75[_0x7c82('0x59')]&&_0x3e0f75[_0x7c82('0x59')][_0x7c82('0x5a')]){_0x3e0f75[_0x7c82('0x57')][_0x7c82('0x5f')]=_0x3e0f75[_0x7c82('0x59')]['filename'];}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x3e0f75[_0x7c82('0x54')]['id']}})[_0x7c82('0x1e')](handleEntityNotFound(_0x32b77b,null))[_0x7c82('0x1e')](saveUpdates(_0x3e0f75[_0x7c82('0x57')],null))[_0x7c82('0x1e')](respondWithResult(_0x32b77b,null))[_0x7c82('0x29')](handleError(_0x32b77b,null));};var utilLicense=require(_0x7c82('0x5c'));exports[_0x7c82('0x75')]=function(_0x263ce7,_0x2d822e,_0x111a66){var _0x20f2e7=_0x7c82('0x6d');var _0x2b821e={'custom':![]};return utilLicense[_0x7c82('0x76')]()[_0x7c82('0x1e')](function(_0x5e320b){if(_0x5e320b){_0x2b821e=_0x5e320b;}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x263ce7[_0x7c82('0x54')]['id']},'attributes':['logo',_0x7c82('0x5b'),_0x7c82('0x5f'),_0x7c82('0x6e'),_0x7c82('0x60'),_0x7c82('0x61'),'defaultPreferred',_0x7c82('0x70')],'raw':!![]});})[_0x7c82('0x1e')](handleEntityNotFound(_0x2d822e,null))[_0x7c82('0x1e')](function(_0x111701){if(_0x111701){var _0x541805=_0x111701[_0x7c82('0x5f')]&&fs[_0x7c82('0x69')](path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x20f2e7,_[_0x7c82('0x64')](_0x111701[_0x7c82('0x5f')])))?path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x20f2e7,_[_0x7c82('0x64')](_0x111701[_0x7c82('0x5f')])):path['join'](config['root'],_0x20f2e7,_['toLower']('default_preferred.png'));var _0x229bc3='default'+_[_0x7c82('0x67')](_0x7c82('0x5f'));if(_0x111701[_0x229bc3]||!_0x2b821e[_0x7c82('0x68')]||!_0x2b821e[_0x7c82('0x5f')]){_0x541805=path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x20f2e7,_[_0x7c82('0x64')]('default_preferred.png'));}if(!fs[_0x7c82('0x69')](_0x541805)){throw new db[(_0x7c82('0x6a'))][(_0x7c82('0x6b'))](_['upperFirst'](_0x7c82('0x5f'))+_0x7c82('0x77'));}return _0x2d822e[_0x7c82('0x6c')](_0x541805);}})[_0x7c82('0x29')](handleError(_0x2d822e,null));};exports[_0x7c82('0x78')]=function(_0x1840ec,_0x4bfa93,_0x1f57b9){if(_0x1840ec['file']&&_0x1840ec['file'][_0x7c82('0x5a')]){_0x1840ec['body'][_0x7c82('0x6e')]=_0x1840ec['file'][_0x7c82('0x5a')];}return db['Setting'][_0x7c82('0x56')]({'where':{'id':_0x1840ec[_0x7c82('0x54')]['id']}})[_0x7c82('0x1e')](handleEntityNotFound(_0x4bfa93,null))[_0x7c82('0x1e')](saveUpdates(_0x1840ec[_0x7c82('0x57')],null))[_0x7c82('0x1e')](respondWithResult(_0x4bfa93,null))['catch'](handleError(_0x4bfa93,null));};var utilLicense=require(_0x7c82('0x5c'));exports[_0x7c82('0x79')]=function(_0x1b80e3,_0x3c2f45,_0x26faee){var _0x2a939f=_0x7c82('0x6d');var _0xd43593={'custom':![]};return utilLicense[_0x7c82('0x76')]()['then'](function(_0x3d003a){if(_0x3d003a){_0xd43593=_0x3d003a;}return db[_0x7c82('0x51')][_0x7c82('0x56')]({'where':{'id':_0x1b80e3['params']['id']},'attributes':[_0x7c82('0x5e'),_0x7c82('0x5b'),'preferred',_0x7c82('0x6e'),_0x7c82('0x60'),_0x7c82('0x61'),_0x7c82('0x6f'),_0x7c82('0x70')],'raw':!![]});})[_0x7c82('0x1e')](handleEntityNotFound(_0x3c2f45,null))[_0x7c82('0x1e')](function(_0xc6059){if(_0xc6059){var _0x82bc15=_0xc6059[_0x7c82('0x6e')]&&fs[_0x7c82('0x69')](path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x2a939f,_[_0x7c82('0x64')](_0xc6059['favicon'])))?path['join'](config[_0x7c82('0x63')],_0x2a939f,_[_0x7c82('0x64')](_0xc6059[_0x7c82('0x6e')])):path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x2a939f,_[_0x7c82('0x64')](_0x7c82('0x7a')));var _0x4edac9=_0x7c82('0x66')+_[_0x7c82('0x67')](_0x7c82('0x6e'));if(_0xc6059[_0x4edac9]||!_0xd43593['custom']){_0x82bc15=path[_0x7c82('0x62')](config[_0x7c82('0x63')],_0x2a939f,_[_0x7c82('0x64')](_0x7c82('0x7a')));}if(!fs[_0x7c82('0x69')](_0x82bc15)){throw new db[(_0x7c82('0x6a'))]['ValidationError'](_[_0x7c82('0x67')](_0x7c82('0x6e'))+_0x7c82('0x77'));}return _0x3c2f45['download'](_0x82bc15);}})[_0x7c82('0x29')](handleError(_0x3c2f45,null));};exports['getDate']=function(_0x3cd409,_0x6bbf30){var _0x473450={'offset':moment()[_0x7c82('0x7b')]()};_0x473450[_0x7c82('0x7c')]=moment()[_0x7c82('0x7b')](_0x473450[_0x7c82('0x30')])[_0x7c82('0x7d')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x6bbf30[_0x7c82('0x2c')](0xc8)[_0x7c82('0x7e')](_0x473450);}; \ No newline at end of file +var _0xbe27=['type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','body','addLogo','file','logo','filename','addLogoLogin','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','toLower','join','root','upperFirst','custom','default_logo.svg','Sequelize','server/files/images/logos','loginLogo','default_loginLogo.svg','existsSync','\x20not\x20found','download','securePassword','getPreferred','defaultPreferred','default_preferred.png','default','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','then','info','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','Setting','fieldName'];(function(_0x4b7b4f,_0x2084d9){var _0x2f3d1a=function(_0x439689){while(--_0x439689){_0x4b7b4f['push'](_0x4b7b4f['shift']());}};_0x2f3d1a(++_0x2084d9);}(_0xbe27,0x12d));var _0x7be2=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbe27[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7be2('0x0'));var zipdir=require(_0x7be2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7be2('0x2'));var moment=require(_0x7be2('0x3'));var BPromise=require(_0x7be2('0x4'));var Mustache=require(_0x7be2('0x5'));var util=require(_0x7be2('0x6'));var path=require(_0x7be2('0x7'));var sox=require(_0x7be2('0x8'));var csv=require('to-csv');var ejs=require(_0x7be2('0x9'));var fs=require('fs');var fs_extra=require(_0x7be2('0xa'));var _=require(_0x7be2('0xb'));var squel=require('squel');var crypto=require(_0x7be2('0xc'));var jsforce=require(_0x7be2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7be2('0xe'));var querystring=require(_0x7be2('0xf'));var Papa=require(_0x7be2('0x10'));var Redis=require(_0x7be2('0x11'));var authService=require(_0x7be2('0x12'));var qs=require(_0x7be2('0x13'));var as=require(_0x7be2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7be2('0x15'));var config=require(_0x7be2('0x16'));var licenseUtil=require(_0x7be2('0x17'));var db=require(_0x7be2('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7be2('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x196e5a,_0x3070f9,_0x2687c7,_0x319478){return new BPromise(function(_0x108d2e,_0x370895){var _0x1f1572=_0x319478||client;return _0x1f1572['request'](_0x196e5a,_0x2687c7)[_0x7be2('0x1a')](function(_0xc40584){logger[_0x7be2('0x1b')]('Setting,\x20%s,\x20%s',_0x3070f9,_0x7be2('0x1c'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x3070f9,_0x7be2('0x1c'),JSON[_0x7be2('0x1d')](_0xc40584));if(_0xc40584[_0x7be2('0x1e')]){if(_0xc40584[_0x7be2('0x1e')]['code']===0x1f4){logger[_0x7be2('0x1e')](_0x7be2('0x1f'),_0x3070f9,_0xc40584['error'][_0x7be2('0x20')]);return _0x370895(_0xc40584[_0x7be2('0x1e')][_0x7be2('0x20')]);}logger[_0x7be2('0x1e')]('Setting,\x20%s,\x20%s',_0x3070f9,_0xc40584[_0x7be2('0x1e')][_0x7be2('0x20')]);return _0x108d2e(_0xc40584[_0x7be2('0x1e')][_0x7be2('0x20')]);}else{logger[_0x7be2('0x1b')](_0x7be2('0x1f'),_0x3070f9,_0x7be2('0x1c'));_0x108d2e(_0xc40584[_0x7be2('0x21')][_0x7be2('0x20')]);}})[_0x7be2('0x22')](function(_0x130e28){logger[_0x7be2('0x1e')](_0x7be2('0x1f'),_0x3070f9,_0x130e28);_0x370895(_0x130e28);});});}function respondWithStatusCode(_0x1feeb4,_0x2a2eae){_0x2a2eae=_0x2a2eae||0xcc;return function(_0x4350f0){if(_0x4350f0){return _0x1feeb4[_0x7be2('0x23')](_0x2a2eae);}return _0x1feeb4[_0x7be2('0x24')](_0x2a2eae)[_0x7be2('0x25')]();};}function respondWithResult(_0x19a68e,_0x5d2bf5){_0x5d2bf5=_0x5d2bf5||0xc8;return function(_0x1dcb4b){if(_0x1dcb4b){return _0x19a68e[_0x7be2('0x24')](_0x5d2bf5)[_0x7be2('0x26')](_0x1dcb4b);}};}function respondWithFilteredResult(_0x117d04,_0x5641c5){return function(_0x484aee){if(_0x484aee){var _0x34225b=typeof _0x5641c5['offset']===_0x7be2('0x27')&&typeof _0x5641c5[_0x7be2('0x28')]===_0x7be2('0x27');var _0x553512=_0x484aee[_0x7be2('0x29')];var _0x2e2b59=_0x34225b?0x0:_0x5641c5[_0x7be2('0x2a')];var _0x34f497=_0x34225b?_0x484aee[_0x7be2('0x29')]:_0x5641c5[_0x7be2('0x2a')]+_0x5641c5['limit'];var _0x3bd283;if(_0x34f497>=_0x553512){_0x34f497=_0x553512;_0x3bd283=0xc8;}else{_0x3bd283=0xce;}_0x117d04['status'](_0x3bd283);return _0x117d04[_0x7be2('0x2b')](_0x7be2('0x2c'),_0x2e2b59+'-'+_0x34f497+'/'+_0x553512)[_0x7be2('0x26')](_0x484aee);}return null;};}function patchUpdates(_0x5ded7f){return function(_0x1cb25b){try{jsonpatch[_0x7be2('0x2d')](_0x1cb25b,_0x5ded7f,!![]);}catch(_0x1e80b7){return BPromise[_0x7be2('0x2e')](_0x1e80b7);}return _0x1cb25b['save']();};}function saveUpdates(_0x478d56,_0x541312){return function(_0xe3362a){if(_0xe3362a){return _0xe3362a[_0x7be2('0x2f')](_0x478d56)[_0x7be2('0x1a')](function(_0x5b5b5a){return _0x5b5b5a;});}return null;};}function removeEntity(_0x263b80,_0x55ae8c){return function(_0x2e213d){if(_0x2e213d){return _0x2e213d[_0x7be2('0x30')]()[_0x7be2('0x1a')](function(){_0x263b80[_0x7be2('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ae63,_0x4b76bd){return function(_0x33a47c){if(!_0x33a47c){_0x55ae63['sendStatus'](0x194);}return _0x33a47c;};}function handleError(_0x1d8143,_0x2aafb1){_0x2aafb1=_0x2aafb1||0x1f4;return function(_0x26fb89){logger[_0x7be2('0x1e')](_0x26fb89[_0x7be2('0x31')]);if(_0x26fb89[_0x7be2('0x32')]){delete _0x26fb89[_0x7be2('0x32')];}_0x1d8143['status'](_0x2aafb1)[_0x7be2('0x33')](_0x26fb89);};}exports[_0x7be2('0x34')]=function(_0x29f723,_0x541437){var _0x16cf40={},_0x1ede19={},_0x50f9c3={'count':0x0,'rows':[]};var _0x30e67f=_[_0x7be2('0x35')](db[_0x7be2('0x36')]['rawAttributes'],function(_0x10f59e){return{'name':_0x10f59e[_0x7be2('0x37')],'type':_0x10f59e[_0x7be2('0x38')][_0x7be2('0x39')]};});_0x1ede19[_0x7be2('0x3a')]=_[_0x7be2('0x35')](_0x30e67f,'name');_0x1ede19[_0x7be2('0x3b')]=_[_0x7be2('0x3c')](_0x29f723[_0x7be2('0x3b')]);_0x1ede19[_0x7be2('0x3d')]=_[_0x7be2('0x3e')](_0x1ede19[_0x7be2('0x3a')],_0x1ede19[_0x7be2('0x3b')]);_0x16cf40[_0x7be2('0x3f')]=_['intersection'](_0x1ede19[_0x7be2('0x3a')],qs['fields'](_0x29f723['query'][_0x7be2('0x40')]));_0x16cf40[_0x7be2('0x3f')]=_0x16cf40[_0x7be2('0x3f')][_0x7be2('0x41')]?_0x16cf40[_0x7be2('0x3f')]:_0x1ede19[_0x7be2('0x3a')];if(!_0x29f723[_0x7be2('0x3b')]['hasOwnProperty'](_0x7be2('0x42'))){_0x16cf40[_0x7be2('0x28')]=qs['limit'](_0x29f723[_0x7be2('0x3b')][_0x7be2('0x28')]);_0x16cf40[_0x7be2('0x2a')]=qs[_0x7be2('0x2a')](_0x29f723['query'][_0x7be2('0x2a')]);}_0x16cf40[_0x7be2('0x43')]=qs[_0x7be2('0x44')](_0x29f723[_0x7be2('0x3b')][_0x7be2('0x44')]);_0x16cf40[_0x7be2('0x45')]=qs[_0x7be2('0x3d')](_[_0x7be2('0x46')](_0x29f723[_0x7be2('0x3b')],_0x1ede19[_0x7be2('0x3d')]),_0x30e67f);if(_0x29f723['query'][_0x7be2('0x47')]){_0x16cf40[_0x7be2('0x45')]=_[_0x7be2('0x48')](_0x16cf40[_0x7be2('0x45')],{'$or':_['map'](_0x30e67f,function(_0x404e77){if(_0x404e77[_0x7be2('0x38')]!==_0x7be2('0x49')){var _0x4a27a6={};_0x4a27a6[_0x404e77[_0x7be2('0x32')]]={'$like':'%'+_0x29f723['query'][_0x7be2('0x47')]+'%'};return _0x4a27a6;}})});}_0x16cf40=_[_0x7be2('0x48')]({},_0x16cf40,_0x29f723[_0x7be2('0x4a')]);var _0x1a1f8c={'where':_0x16cf40[_0x7be2('0x45')]};return db[_0x7be2('0x36')]['count'](_0x1a1f8c)[_0x7be2('0x1a')](function(_0x57f267){_0x50f9c3[_0x7be2('0x29')]=_0x57f267;if(_0x29f723[_0x7be2('0x3b')][_0x7be2('0x4b')]){_0x16cf40['include']=[{'all':!![]}];}return db[_0x7be2('0x36')][_0x7be2('0x4c')](_0x16cf40);})[_0x7be2('0x1a')](function(_0x47ce95){_0x50f9c3[_0x7be2('0x4d')]=_0x47ce95;return _0x50f9c3;})[_0x7be2('0x1a')](respondWithFilteredResult(_0x541437,_0x16cf40))['catch'](handleError(_0x541437,null));};exports[_0x7be2('0x4e')]=function(_0x47f6f5,_0x532dcb){var _0x44b905={'raw':![],'where':{'id':_0x47f6f5[_0x7be2('0x4f')]['id']}},_0x3166ca={};_0x3166ca[_0x7be2('0x3a')]=_[_0x7be2('0x3c')](db[_0x7be2('0x36')]['rawAttributes']);_0x3166ca['query']=_[_0x7be2('0x3c')](_0x47f6f5[_0x7be2('0x3b')]);_0x3166ca[_0x7be2('0x3d')]=_[_0x7be2('0x3e')](_0x3166ca[_0x7be2('0x3a')],_0x3166ca['query']);_0x44b905[_0x7be2('0x3f')]=_[_0x7be2('0x3e')](_0x3166ca[_0x7be2('0x3a')],qs[_0x7be2('0x40')](_0x47f6f5[_0x7be2('0x3b')]['fields']));_0x44b905[_0x7be2('0x3f')]=_0x44b905[_0x7be2('0x3f')]['length']?_0x44b905['attributes']:_0x3166ca[_0x7be2('0x3a')];if(_0x47f6f5[_0x7be2('0x3b')]['includeAll']){_0x44b905[_0x7be2('0x50')]=[{'all':!![]}];}_0x44b905=_[_0x7be2('0x48')]({},_0x44b905,_0x47f6f5['options']);return db['Setting'][_0x7be2('0x51')](_0x44b905)[_0x7be2('0x1a')](handleEntityNotFound(_0x532dcb,null))[_0x7be2('0x1a')](respondWithResult(_0x532dcb,null))[_0x7be2('0x22')](handleError(_0x532dcb,null));};exports[_0x7be2('0x2f')]=function(_0x2921da,_0x16677a){if(_0x2921da['body']['id']){delete _0x2921da[_0x7be2('0x52')]['id'];}return db[_0x7be2('0x36')][_0x7be2('0x51')]({'where':{'id':_0x2921da[_0x7be2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x16677a,null))['then'](saveUpdates(_0x2921da['body'],null))['then'](respondWithResult(_0x16677a,null))['catch'](handleError(_0x16677a,null));};exports[_0x7be2('0x53')]=function(_0x5b2edf,_0xf4d2b,_0x26a4c7){if(_0x5b2edf[_0x7be2('0x54')]&&_0x5b2edf[_0x7be2('0x54')]['filename']){_0x5b2edf[_0x7be2('0x52')][_0x7be2('0x55')]=_0x5b2edf['file'][_0x7be2('0x56')];}return db[_0x7be2('0x36')][_0x7be2('0x51')]({'where':{'id':_0x5b2edf[_0x7be2('0x4f')]['id']}})[_0x7be2('0x1a')](handleEntityNotFound(_0xf4d2b,null))[_0x7be2('0x1a')](saveUpdates(_0x5b2edf[_0x7be2('0x52')],null))[_0x7be2('0x1a')](respondWithResult(_0xf4d2b,null))[_0x7be2('0x22')](handleError(_0xf4d2b,null));};exports[_0x7be2('0x57')]=function(_0x582f68,_0x1c4381,_0x306d42){if(_0x582f68[_0x7be2('0x54')]&&_0x582f68[_0x7be2('0x54')][_0x7be2('0x56')]){_0x582f68['body']['loginLogo']=_0x582f68[_0x7be2('0x54')][_0x7be2('0x56')];}return db[_0x7be2('0x36')][_0x7be2('0x51')]({'where':{'id':_0x582f68['params']['id']}})[_0x7be2('0x1a')](handleEntityNotFound(_0x1c4381,null))['then'](saveUpdates(_0x582f68['body'],null))[_0x7be2('0x1a')](respondWithResult(_0x1c4381,null))[_0x7be2('0x22')](handleError(_0x1c4381,null));};var utilLicense=require(_0x7be2('0x17'));exports['getLogo']=function(_0x451ac2,_0x59e49c,_0xa03702){var _0xa46aad='server/files/images/logos';var _0x4a6163={'custom':![]};return utilLicense[_0x7be2('0x58')]()[_0x7be2('0x1a')](function(_0x12e713){if(_0x12e713){_0x4a6163=_0x12e713;}return db[_0x7be2('0x36')][_0x7be2('0x51')]({'where':{'id':_0x451ac2['params']['id']},'attributes':[_0x7be2('0x55'),'loginLogo',_0x7be2('0x59'),_0x7be2('0x5a'),_0x7be2('0x5b'),_0x7be2('0x5c'),'defaultPreferred',_0x7be2('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x59e49c,null))[_0x7be2('0x1a')](function(_0x3d4bf0){if(_0x3d4bf0){var _0xb78dc9=_0x3d4bf0[_0x7be2('0x55')]&&fs['existsSync'](path['join'](config['root'],_0xa46aad,_[_0x7be2('0x5e')](_0x3d4bf0[_0x7be2('0x55')])))?path['join'](config['root'],_0xa46aad,_[_0x7be2('0x5e')](_0x3d4bf0['logo'])):path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0xa46aad,_['toLower']('default_logo.svg'));var _0x63ca20='default'+_[_0x7be2('0x61')]('logo');if(_0x3d4bf0[_0x63ca20]||!_0x4a6163[_0x7be2('0x62')]){_0xb78dc9=path[_0x7be2('0x5f')](config['root'],_0xa46aad,_[_0x7be2('0x5e')](_0x7be2('0x63')));}if(!fs['existsSync'](_0xb78dc9)){throw new db[(_0x7be2('0x64'))]['ValidationError'](_[_0x7be2('0x61')](_0x7be2('0x55'))+'\x20not\x20found');}return _0x59e49c['download'](_0xb78dc9);}})[_0x7be2('0x22')](handleError(_0x59e49c,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x115bf5,_0x4fff00,_0xd66ce){var _0x2f15f8=_0x7be2('0x65');var _0x2b0cff={'custom':![]};return utilLicense[_0x7be2('0x58')]()[_0x7be2('0x1a')](function(_0x443ca4){if(_0x443ca4){_0x2b0cff=_0x443ca4;}return db[_0x7be2('0x36')]['find']({'where':{'id':_0x115bf5[_0x7be2('0x4f')]['id']},'attributes':[_0x7be2('0x55'),_0x7be2('0x66'),_0x7be2('0x59'),_0x7be2('0x5a'),_0x7be2('0x5b'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x7be2('0x1a')](handleEntityNotFound(_0x4fff00,null))[_0x7be2('0x1a')](function(_0xc179d8){if(_0xc179d8){var _0x276751=_0xc179d8[_0x7be2('0x66')]&&fs['existsSync'](path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0x2f15f8,_['toLower'](_0xc179d8['loginLogo'])))?path[_0x7be2('0x5f')](config['root'],_0x2f15f8,_[_0x7be2('0x5e')](_0xc179d8[_0x7be2('0x66')])):path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0x2f15f8,_['toLower'](_0x7be2('0x67')));var _0x3a23a5='default'+_[_0x7be2('0x61')](_0x7be2('0x66'));if(_0xc179d8[_0x3a23a5]||!_0x2b0cff[_0x7be2('0x62')]){_0x276751=path['join'](config['root'],_0x2f15f8,_[_0x7be2('0x5e')](_0x7be2('0x67')));}if(!fs[_0x7be2('0x68')](_0x276751)){throw new db[(_0x7be2('0x64'))]['ValidationError'](_[_0x7be2('0x61')](_0x7be2('0x66'))+_0x7be2('0x69'));}return _0x4fff00[_0x7be2('0x6a')](_0x276751);}})['catch'](handleError(_0x4fff00,null));};exports['gdpr']=function(_0x8b329e,_0x5df980){return db[_0x7be2('0x36')][_0x7be2('0x51')]({'where':{'id':_0x8b329e[_0x7be2('0x4f')]['id']},'attributes':[_0x7be2('0x6b')]})['then'](respondWithResult(_0x5df980,null))[_0x7be2('0x22')](handleError(_0x5df980,null));};exports['addPreferred']=function(_0x178874,_0x52cb2b,_0x37002a){if(_0x178874[_0x7be2('0x54')]&&_0x178874[_0x7be2('0x54')][_0x7be2('0x56')]){_0x178874[_0x7be2('0x52')]['preferred']=_0x178874[_0x7be2('0x54')][_0x7be2('0x56')];}return db[_0x7be2('0x36')]['find']({'where':{'id':_0x178874['params']['id']}})[_0x7be2('0x1a')](handleEntityNotFound(_0x52cb2b,null))[_0x7be2('0x1a')](saveUpdates(_0x178874[_0x7be2('0x52')],null))['then'](respondWithResult(_0x52cb2b,null))['catch'](handleError(_0x52cb2b,null));};var utilLicense=require(_0x7be2('0x17'));exports[_0x7be2('0x6c')]=function(_0x3c3f84,_0x44786a,_0x7854dd){var _0xf41cb9=_0x7be2('0x65');var _0x11e391={'custom':![]};return utilLicense[_0x7be2('0x58')]()[_0x7be2('0x1a')](function(_0x3d5141){if(_0x3d5141){_0x11e391=_0x3d5141;}return db[_0x7be2('0x36')][_0x7be2('0x51')]({'where':{'id':_0x3c3f84[_0x7be2('0x4f')]['id']},'attributes':[_0x7be2('0x55'),_0x7be2('0x66'),_0x7be2('0x59'),_0x7be2('0x5a'),'defaultLogo','defaultLoginLogo',_0x7be2('0x6d'),_0x7be2('0x5d')],'raw':!![]});})[_0x7be2('0x1a')](handleEntityNotFound(_0x44786a,null))[_0x7be2('0x1a')](function(_0xb4ef22){if(_0xb4ef22){var _0x22ead5=_0xb4ef22[_0x7be2('0x59')]&&fs[_0x7be2('0x68')](path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0xf41cb9,_['toLower'](_0xb4ef22[_0x7be2('0x59')])))?path['join'](config[_0x7be2('0x60')],_0xf41cb9,_['toLower'](_0xb4ef22['preferred'])):path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0xf41cb9,_['toLower'](_0x7be2('0x6e')));var _0x24cc97=_0x7be2('0x6f')+_[_0x7be2('0x61')](_0x7be2('0x59'));if(_0xb4ef22[_0x24cc97]||!_0x11e391[_0x7be2('0x62')]||!_0x11e391['preferred']){_0x22ead5=path[_0x7be2('0x5f')](config['root'],_0xf41cb9,_[_0x7be2('0x5e')](_0x7be2('0x6e')));}if(!fs[_0x7be2('0x68')](_0x22ead5)){throw new db['Sequelize']['ValidationError'](_[_0x7be2('0x61')](_0x7be2('0x59'))+_0x7be2('0x69'));}return _0x44786a[_0x7be2('0x6a')](_0x22ead5);}})['catch'](handleError(_0x44786a,null));};exports[_0x7be2('0x70')]=function(_0x18a8a5,_0x224b8a,_0x45ea83){if(_0x18a8a5[_0x7be2('0x54')]&&_0x18a8a5[_0x7be2('0x54')][_0x7be2('0x56')]){_0x18a8a5['body'][_0x7be2('0x5a')]=_0x18a8a5[_0x7be2('0x54')][_0x7be2('0x56')];}return db['Setting'][_0x7be2('0x51')]({'where':{'id':_0x18a8a5[_0x7be2('0x4f')]['id']}})[_0x7be2('0x1a')](handleEntityNotFound(_0x224b8a,null))['then'](saveUpdates(_0x18a8a5[_0x7be2('0x52')],null))[_0x7be2('0x1a')](respondWithResult(_0x224b8a,null))[_0x7be2('0x22')](handleError(_0x224b8a,null));};var utilLicense=require(_0x7be2('0x17'));exports[_0x7be2('0x71')]=function(_0x393607,_0x35191b,_0x34f83c){var _0x450ad7=_0x7be2('0x65');var _0x4a6b98={'custom':![]};return utilLicense[_0x7be2('0x58')]()['then'](function(_0x80f88d){if(_0x80f88d){_0x4a6b98=_0x80f88d;}return db['Setting'][_0x7be2('0x51')]({'where':{'id':_0x393607['params']['id']},'attributes':[_0x7be2('0x55'),_0x7be2('0x66'),'preferred',_0x7be2('0x5a'),_0x7be2('0x5b'),_0x7be2('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x7be2('0x1a')](handleEntityNotFound(_0x35191b,null))[_0x7be2('0x1a')](function(_0x4c7f5b){if(_0x4c7f5b){var _0x1385ed=_0x4c7f5b[_0x7be2('0x5a')]&&fs[_0x7be2('0x68')](path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0x450ad7,_[_0x7be2('0x5e')](_0x4c7f5b[_0x7be2('0x5a')])))?path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0x450ad7,_[_0x7be2('0x5e')](_0x4c7f5b[_0x7be2('0x5a')])):path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0x450ad7,_['toLower'](_0x7be2('0x72')));var _0x42ccba='default'+_[_0x7be2('0x61')](_0x7be2('0x5a'));if(_0x4c7f5b[_0x42ccba]||!_0x4a6b98[_0x7be2('0x62')]){_0x1385ed=path[_0x7be2('0x5f')](config[_0x7be2('0x60')],_0x450ad7,_[_0x7be2('0x5e')]('default_favicon.ico'));}if(!fs[_0x7be2('0x68')](_0x1385ed)){throw new db[(_0x7be2('0x64'))]['ValidationError'](_[_0x7be2('0x61')](_0x7be2('0x5a'))+'\x20not\x20found');}return _0x35191b[_0x7be2('0x6a')](_0x1385ed);}})[_0x7be2('0x22')](handleError(_0x35191b,null));};exports[_0x7be2('0x73')]=function(_0x55c362,_0x319597){var _0x5387f6={'offset':moment()[_0x7be2('0x74')]()};_0x5387f6[_0x7be2('0x75')]=moment()[_0x7be2('0x74')](_0x5387f6['offset'])[_0x7be2('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x319597[_0x7be2('0x24')](0xc8)['send'](_0x5387f6);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 494a1fa..f41f614 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x21ab6f,_0x1cee2b){var _0x2ffdbc=function(_0x18a4d1){while(--_0x18a4d1){_0x21ab6f['push'](_0x21ab6f['shift']());}};_0x2ffdbc(++_0x1cee2b);}(_0x34e8,0x12c));var _0x834e=function(_0x3c3f9e,_0x392128){_0x3c3f9e=_0x3c3f9e-0x0;var _0x3c6949=_0x34e8[_0x3c3f9e];return _0x3c6949;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x8cb724,_0x5e78d5){var _0x348d6f=function(_0x7b70ea){while(--_0x7b70ea){_0x8cb724['push'](_0x8cb724['shift']());}};_0x348d6f(++_0x5e78d5);}(_0x008c,0x188));var _0xc008=function(_0x48f683,_0xec583){_0x48f683=_0x48f683-0x0;var _0x13acce=_0x008c[_0x48f683];return _0x13acce;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index eba798b..93384f0 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 _0x4843=['attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','info','Setting,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','ShowSetting','Setting','find','options','raw','where'];(function(_0x379c8f,_0x227ad5){var _0x21689a=function(_0x4d3724){while(--_0x4d3724){_0x379c8f['push'](_0x379c8f['shift']());}};_0x21689a(++_0x227ad5);}(_0x4843,0xd6));var _0x3484=function(_0x5fd00b,_0x136f04){_0x5fd00b=_0x5fd00b-0x0;var _0x141f3c=_0x4843[_0x5fd00b];return _0x141f3c;};'use strict';var _=require(_0x3484('0x0'));var util=require(_0x3484('0x1'));var moment=require(_0x3484('0x2'));var BPromise=require(_0x3484('0x3'));var rs=require(_0x3484('0x4'));var fs=require('fs');var Redis=require(_0x3484('0x5'));var db=require(_0x3484('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3484('0x7'))(_0x3484('0x8'));var config=require('../../config/environment');var jayson=require(_0x3484('0x9'));var client=jayson[_0x3484('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5868bd,_0x5e714e,_0x2d4a61){return new BPromise(function(_0x3561fc,_0x194643){return client['request'](_0x5868bd,_0x2d4a61)['then'](function(_0x454eb3){logger[_0x3484('0xb')](_0x3484('0xc'),_0x5e714e,'request\x20sent');logger[_0x3484('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x5e714e,'request\x20sent',JSON[_0x3484('0xe')](_0x454eb3));if(_0x454eb3[_0x3484('0xf')]){if(_0x454eb3[_0x3484('0xf')]['code']===0x1f4){logger[_0x3484('0xf')](_0x3484('0xc'),_0x5e714e,_0x454eb3[_0x3484('0xf')]['message']);return _0x194643(_0x454eb3[_0x3484('0xf')][_0x3484('0x10')]);}logger[_0x3484('0xf')](_0x3484('0xc'),_0x5e714e,_0x454eb3['error'][_0x3484('0x10')]);return _0x3561fc(_0x454eb3['error'][_0x3484('0x10')]);}else{logger[_0x3484('0xb')]('Setting,\x20%s,\x20%s',_0x5e714e,_0x3484('0x11'));_0x3561fc(_0x454eb3[_0x3484('0x12')][_0x3484('0x10')]);}})[_0x3484('0x13')](function(_0x2e4751){logger[_0x3484('0xf')](_0x3484('0xc'),_0x5e714e,_0x2e4751);_0x194643(_0x2e4751);});});}exports[_0x3484('0x14')]=function(_0x3e2040){var _0x1a25c6=this;return new Promise(function(_0x1a6441,_0x4100b7){return db[_0x3484('0x15')][_0x3484('0x16')]({'raw':_0x3e2040[_0x3484('0x17')]?_0x3e2040['options'][_0x3484('0x18')]===undefined?!![]:![]:!![],'where':_0x3e2040[_0x3484('0x17')]?_0x3e2040[_0x3484('0x17')][_0x3484('0x19')]||null:null,'attributes':_0x3e2040[_0x3484('0x17')]?_0x3e2040[_0x3484('0x17')][_0x3484('0x1a')]||null:null,'include':_0x3e2040[_0x3484('0x17')]?_0x3e2040[_0x3484('0x17')][_0x3484('0x1b')]?_[_0x3484('0x1c')](_0x3e2040[_0x3484('0x17')][_0x3484('0x1b')],function(_0x697dde){return{'model':db[_0x697dde[_0x3484('0x1d')]],'as':_0x697dde['as'],'attributes':_0x697dde[_0x3484('0x1a')],'include':_0x697dde[_0x3484('0x1b')]?_['map'](_0x697dde[_0x3484('0x1b')],function(_0x447ffd){return{'model':db[_0x447ffd[_0x3484('0x1d')]],'as':_0x447ffd['as'],'attributes':_0x447ffd[_0x3484('0x1a')],'include':_0x447ffd[_0x3484('0x1b')]?_[_0x3484('0x1c')](_0x447ffd[_0x3484('0x1b')],function(_0x2112c8){return{'model':db[_0x2112c8[_0x3484('0x1d')]],'as':_0x2112c8['as'],'attributes':_0x2112c8[_0x3484('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cb42a){logger[_0x3484('0xb')](_0x3484('0x14'),_0x3e2040);logger[_0x3484('0xd')](_0x3484('0x14'),_0x3e2040,JSON['stringify'](_0x4cb42a));_0x1a6441(_0x4cb42a);})[_0x3484('0x13')](function(_0x48df4b){logger[_0x3484('0xf')](_0x3484('0x14'),_0x48df4b['message'],_0x3e2040);_0x4100b7(_0x1a25c6[_0x3484('0xf')](0x1f4,_0x48df4b[_0x3484('0x10')]));});});}; \ No newline at end of file +var _0x0311=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','lodash','util'];(function(_0x1fe4f0,_0x45ad60){var _0x55fdea=function(_0x5ded20){while(--_0x5ded20){_0x1fe4f0['push'](_0x1fe4f0['shift']());}};_0x55fdea(++_0x45ad60);}(_0x0311,0x127));var _0x1031=function(_0x3d8171,_0x586c81){_0x3d8171=_0x3d8171-0x0;var _0x18e1ad=_0x0311[_0x3d8171];return _0x18e1ad;};'use strict';var _=require(_0x1031('0x0'));var util=require(_0x1031('0x1'));var moment=require(_0x1031('0x2'));var BPromise=require(_0x1031('0x3'));var rs=require(_0x1031('0x4'));var fs=require('fs');var Redis=require(_0x1031('0x5'));var db=require(_0x1031('0x6'))['db'];var utils=require(_0x1031('0x7'));var logger=require(_0x1031('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1031('0x9'));var client=jayson[_0x1031('0xa')][_0x1031('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d628d,_0x40945e,_0x4fed32){return new BPromise(function(_0x429fda,_0xab4a08){return client[_0x1031('0xc')](_0x4d628d,_0x4fed32)[_0x1031('0xd')](function(_0x820c2e){logger[_0x1031('0xe')](_0x1031('0xf'),_0x40945e,_0x1031('0x10'));logger['debug'](_0x1031('0x11'),_0x40945e,'request\x20sent',JSON[_0x1031('0x12')](_0x820c2e));if(_0x820c2e['error']){if(_0x820c2e[_0x1031('0x13')][_0x1031('0x14')]===0x1f4){logger[_0x1031('0x13')]('Setting,\x20%s,\x20%s',_0x40945e,_0x820c2e[_0x1031('0x13')][_0x1031('0x15')]);return _0xab4a08(_0x820c2e[_0x1031('0x13')][_0x1031('0x15')]);}logger[_0x1031('0x13')]('Setting,\x20%s,\x20%s',_0x40945e,_0x820c2e[_0x1031('0x13')][_0x1031('0x15')]);return _0x429fda(_0x820c2e['error'][_0x1031('0x15')]);}else{logger[_0x1031('0xe')](_0x1031('0xf'),_0x40945e,_0x1031('0x10'));_0x429fda(_0x820c2e['result'][_0x1031('0x15')]);}})[_0x1031('0x16')](function(_0x422d13){logger['error'](_0x1031('0xf'),_0x40945e,_0x422d13);_0xab4a08(_0x422d13);});});}exports[_0x1031('0x17')]=function(_0x457ae8){var _0x2121c6=this;return new Promise(function(_0x25b9a,_0x17b3d2){return db[_0x1031('0x18')][_0x1031('0x19')]({'raw':_0x457ae8[_0x1031('0x1a')]?_0x457ae8[_0x1031('0x1a')][_0x1031('0x1b')]===undefined?!![]:![]:!![],'where':_0x457ae8['options']?_0x457ae8[_0x1031('0x1a')][_0x1031('0x1c')]||null:null,'attributes':_0x457ae8[_0x1031('0x1a')]?_0x457ae8[_0x1031('0x1a')][_0x1031('0x1d')]||null:null,'include':_0x457ae8[_0x1031('0x1a')]?_0x457ae8[_0x1031('0x1a')]['include']?_['map'](_0x457ae8[_0x1031('0x1a')][_0x1031('0x1e')],function(_0x1ac0e2){return{'model':db[_0x1ac0e2[_0x1031('0x1f')]],'as':_0x1ac0e2['as'],'attributes':_0x1ac0e2[_0x1031('0x1d')],'include':_0x1ac0e2[_0x1031('0x1e')]?_[_0x1031('0x20')](_0x1ac0e2[_0x1031('0x1e')],function(_0x125c58){return{'model':db[_0x125c58[_0x1031('0x1f')]],'as':_0x125c58['as'],'attributes':_0x125c58[_0x1031('0x1d')],'include':_0x125c58['include']?_[_0x1031('0x20')](_0x125c58[_0x1031('0x1e')],function(_0x152ff6){return{'model':db[_0x152ff6['model']],'as':_0x152ff6['as'],'attributes':_0x152ff6[_0x1031('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1031('0xd')](function(_0x12dbce){logger[_0x1031('0xe')](_0x1031('0x17'),_0x457ae8);logger['debug'](_0x1031('0x17'),_0x457ae8,JSON[_0x1031('0x12')](_0x12dbce));_0x25b9a(_0x12dbce);})[_0x1031('0x16')](function(_0xd980fc){logger[_0x1031('0x13')](_0x1031('0x17'),_0xd980fc[_0x1031('0x15')],_0x457ae8);_0x17b3d2(_0x2121c6['error'](0x1f4,_0xd980fc[_0x1031('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 536aa34..4e1312c 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x53dfbe,_0x38ac78){var _0x4f7d2b=function(_0x110708){while(--_0x110708){_0x53dfbe['push'](_0x53dfbe['shift']());}};_0x4f7d2b(++_0x38ac78);}(_0x7a54,0x106));var _0x47a5=function(_0x4009b3,_0xad2794){_0x4009b3=_0x4009b3-0x0;var _0x86f878=_0x7a54[_0x4009b3];return _0x86f878;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x387862,_0x3c5c4e){var _0x16d405=function(_0x113b00){while(--_0x113b00){_0x387862['push'](_0x387862['shift']());}};_0x16d405(++_0x3c5c4e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 68a6cfb..e1177d4 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 _0x2d54=['TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','csc','intelepeer','BOOLEAN'];(function(_0x58319a,_0x145060){var _0x4cf654=function(_0x314238){while(--_0x314238){_0x58319a['push'](_0x58319a['shift']());}};_0x4cf654(++_0x145060);}(_0x2d54,0x133));var _0x42d5=function(_0x585276,_0x553f5a){_0x585276=_0x585276-0x0;var _0x4a7181=_0x2d54[_0x585276];return _0x4a7181;};'use strict';var Sequelize=require(_0x42d5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x42d5('0x1')],'unique':_0x42d5('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x42d5('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x42d5('0x1')],'defaultValue':function(){return rs[_0x42d5('0x3')]();}},'phone':{'type':Sequelize[_0x42d5('0x1')]},'type':{'type':Sequelize[_0x42d5('0x4')](_0x42d5('0x5'),_0x42d5('0x6'),_0x42d5('0x7'),_0x42d5('0x8'),'plivo',_0x42d5('0x9'),'bandwidth',_0x42d5('0xa'),'infobip',_0x42d5('0xb'))},'accountSid':{'type':Sequelize[_0x42d5('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x42d5('0x1')]},'smsMethod':{'type':Sequelize[_0x42d5('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x42d5('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x42d5('0x1')]},'applicationId':{'type':Sequelize[_0x42d5('0x1')]},'accountId':{'type':Sequelize[_0x42d5('0x1')]},'senderString':{'type':Sequelize[_0x42d5('0x1')]},'deliveryReport':{'type':Sequelize[_0x42d5('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x42d5('0x1')]},'notificationTemplate':{'type':Sequelize[_0x42d5('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x42d5('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x42d5('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x42d5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x42d5('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x42d5('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x42d5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x42d5('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x42d5('0xe')],'comment':_0x42d5('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x42d5('0xc')],'defaultValue':![],'comment':_0x42d5('0x10'),'set':function(_0x632ea7){if(!_0x632ea7)this[_0x42d5('0x11')](_0x42d5('0x12'),null);this[_0x42d5('0x11')](_0x42d5('0x13'),_0x632ea7);}}}; \ No newline at end of file +var _0x0f1c=['bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo'];(function(_0x48be93,_0x4dd760){var _0x5d2d9a=function(_0x1ef85d){while(--_0x1ef85d){_0x48be93['push'](_0x48be93['shift']());}};_0x5d2d9a(++_0x4dd760);}(_0x0f1c,0x1bd));var _0xc0f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc0f1('0x0'));module[_0xc0f1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc0f1('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc0f1('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc0f1('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xc0f1('0x3')],'defaultValue':function(){return rs[_0xc0f1('0x4')]();}},'phone':{'type':Sequelize[_0xc0f1('0x3')]},'type':{'type':Sequelize[_0xc0f1('0x5')](_0xc0f1('0x6'),_0xc0f1('0x7'),_0xc0f1('0x8'),_0xc0f1('0x9'),_0xc0f1('0xa'),'clickatell',_0xc0f1('0xb'),_0xc0f1('0xc'),_0xc0f1('0xd'),_0xc0f1('0xe'))},'accountSid':{'type':Sequelize[_0xc0f1('0x3')]},'authId':{'type':Sequelize[_0xc0f1('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xc0f1('0x3')]},'password':{'type':Sequelize[_0xc0f1('0x3')]},'apiKey':{'type':Sequelize[_0xc0f1('0x3')]},'applicationId':{'type':Sequelize[_0xc0f1('0x3')]},'accountId':{'type':Sequelize[_0xc0f1('0x3')]},'senderString':{'type':Sequelize[_0xc0f1('0x3')]},'deliveryReport':{'type':Sequelize[_0xc0f1('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xc0f1('0x10')],'defaultValue':function(){return _0xc0f1('0x11');}},'notificationSound':{'type':Sequelize[_0xc0f1('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc0f1('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc0f1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc0f1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc0f1('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc0f1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc0f1('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc0f1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0f1('0x12')],'comment':_0xc0f1('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xc0f1('0xf')],'defaultValue':![],'comment':_0xc0f1('0x14'),'set':function(_0x57bb9a){if(!_0x57bb9a)this[_0xc0f1('0x15')](_0xc0f1('0x16'),null);this[_0xc0f1('0x15')](_0xc0f1('0x17'),_0x57bb9a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 3561113..ca904fe 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 _0x301a=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','SmsAccount','count','include','findAll','rows','show','params','Pause','rawAttributes','includeAll','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','order','pick','ids','CannedAnswer','getAnswers','nolimit','notify','sms','SmsApplication','Applications','account','orderBy','asc','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','Body','messageId','MessageSid','sender','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','send','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','Contact','User','Owner','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','update','error_code','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x32a326,_0x56585f){var _0x53d06f=function(_0x1ae9f1){while(--_0x1ae9f1){_0x32a326['push'](_0x32a326['shift']());}};_0x53d06f(++_0x56585f);}(_0x301a,0xe4));var _0xa301=function(_0x5d9973,_0x4494ac){_0x5d9973=_0x5d9973-0x0;var _0x322484=_0x301a[_0x5d9973];return _0x322484;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa301('0x0'));var zipdir=require(_0xa301('0x1'));var jsonpatch=require(_0xa301('0x2'));var rp=require(_0xa301('0x3'));var moment=require(_0xa301('0x4'));var BPromise=require(_0xa301('0x5'));var Mustache=require('mustache');var util=require(_0xa301('0x6'));var path=require(_0xa301('0x7'));var sox=require(_0xa301('0x8'));var csv=require('to-csv');var ejs=require(_0xa301('0x9'));var fs=require('fs');var fs_extra=require(_0xa301('0xa'));var _=require(_0xa301('0xb'));var squel=require(_0xa301('0xc'));var crypto=require(_0xa301('0xd'));var jsforce=require(_0xa301('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa301('0xf'));var querystring=require('querystring');var Papa=require(_0xa301('0x10'));var Redis=require(_0xa301('0x11'));var authService=require(_0xa301('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa301('0x13'));var logger=require('../../config/logger')(_0xa301('0x14'));var utils=require('../../config/utils');var config=require(_0xa301('0x15'));var licenseUtil=require(_0xa301('0x16'));var db=require(_0xa301('0x17'))['db'];config['redis']=_[_0xa301('0x18')](config['redis'],{'host':_0xa301('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0xa301('0x1a')](socket);var jayson=require(_0xa301('0x1b'));var client=jayson['client'][_0xa301('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5de748,_0x39a818,_0x4db200,_0x3565e8){return new BPromise(function(_0x73b4bf,_0x1b5d99){var _0x594dd1=_0x3565e8||client;return _0x594dd1[_0xa301('0x1d')](_0x5de748,_0x4db200)[_0xa301('0x1e')](function(_0x10283c){logger[_0xa301('0x1f')](_0xa301('0x20'),_0x39a818,_0xa301('0x21'));logger[_0xa301('0x22')](_0xa301('0x23'),_0x39a818,_0xa301('0x21'),JSON[_0xa301('0x24')](_0x10283c));if(_0x10283c[_0xa301('0x25')]){if(_0x10283c['error'][_0xa301('0x26')]===0x1f4){logger['error'](_0xa301('0x20'),_0x39a818,_0x10283c[_0xa301('0x25')][_0xa301('0x27')]);return _0x1b5d99(_0x10283c['error'][_0xa301('0x27')]);}logger[_0xa301('0x25')](_0xa301('0x20'),_0x39a818,_0x10283c['error']['message']);return _0x73b4bf(_0x10283c[_0xa301('0x25')][_0xa301('0x27')]);}else{logger[_0xa301('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x39a818,_0xa301('0x21'));_0x73b4bf(_0x10283c[_0xa301('0x28')][_0xa301('0x27')]);}})[_0xa301('0x29')](function(_0x4764ad){logger[_0xa301('0x25')](_0xa301('0x20'),_0x39a818,_0x4764ad);_0x1b5d99(_0x4764ad);});});}function respondWithStatusCode(_0x42241d,_0x59d25f){_0x59d25f=_0x59d25f||0xcc;return function(_0x5ea84f){if(_0x5ea84f){return _0x42241d[_0xa301('0x2a')](_0x59d25f);}return _0x42241d[_0xa301('0x2b')](_0x59d25f)[_0xa301('0x2c')]();};}function respondWithResult(_0x483c8c,_0x40ff0d){_0x40ff0d=_0x40ff0d||0xc8;return function(_0x523b5b){if(_0x523b5b){return _0x483c8c[_0xa301('0x2b')](_0x40ff0d)[_0xa301('0x2d')](_0x523b5b);}};}function respondWithFilteredResult(_0x16d6ec,_0x1d8685){return function(_0x51f2bb){if(_0x51f2bb){var _0x1430fb=typeof _0x1d8685[_0xa301('0x2e')]===_0xa301('0x2f')&&typeof _0x1d8685[_0xa301('0x30')]===_0xa301('0x2f');var _0x54e15c=_0x51f2bb['count'];var _0x493b7e=_0x1430fb?0x0:_0x1d8685[_0xa301('0x2e')];var _0x19f920=_0x1430fb?_0x51f2bb['count']:_0x1d8685['offset']+_0x1d8685[_0xa301('0x30')];var _0x1ef0cb;if(_0x19f920>=_0x54e15c){_0x19f920=_0x54e15c;_0x1ef0cb=0xc8;}else{_0x1ef0cb=0xce;}_0x16d6ec[_0xa301('0x2b')](_0x1ef0cb);return _0x16d6ec['set']('Content-Range',_0x493b7e+'-'+_0x19f920+'/'+_0x54e15c)[_0xa301('0x2d')](_0x51f2bb);}return null;};}function patchUpdates(_0x264be7){return function(_0x49f9ce){try{jsonpatch[_0xa301('0x31')](_0x49f9ce,_0x264be7,!![]);}catch(_0x310d77){return BPromise[_0xa301('0x32')](_0x310d77);}return _0x49f9ce[_0xa301('0x33')]();};}function saveUpdates(_0x3b4ece,_0x4f857c){return function(_0x50e73c){if(_0x50e73c){return _0x50e73c['update'](_0x3b4ece)[_0xa301('0x1e')](function(_0x54144a){return _0x54144a;});}return null;};}function removeEntity(_0x1e453b,_0x188cd1){return function(_0x5b5fb7){if(_0x5b5fb7){return _0x5b5fb7[_0xa301('0x34')]()['then'](function(){var _0x2dd951=_0x5b5fb7[_0xa301('0x35')]({'plain':!![]});var _0x96a16f=_0xa301('0x36');return db[_0xa301('0x37')][_0xa301('0x34')]({'where':{'type':_0x96a16f,'resourceId':_0x2dd951['id']}})[_0xa301('0x1e')](function(){return _0x5b5fb7;});})[_0xa301('0x1e')](function(){_0x1e453b['status'](0xcc)[_0xa301('0x2c')]();});}};}function handleEntityNotFound(_0x1bc4ec,_0x4b25fb){return function(_0x46d901){if(!_0x46d901){_0x1bc4ec[_0xa301('0x2a')](0x194);}return _0x46d901;};}function handleError(_0x43d40b,_0xc2114c){_0xc2114c=_0xc2114c||0x1f4;return function(_0x16f1d3){logger[_0xa301('0x25')](_0x16f1d3[_0xa301('0x38')]);if(_0x16f1d3[_0xa301('0x39')]){delete _0x16f1d3['name'];}_0x43d40b[_0xa301('0x2b')](_0xc2114c)['send'](_0x16f1d3);};}exports[_0xa301('0x3a')]=function(_0x1ff6cb,_0x5b0b68){var _0x8cd220={'include':[{'model':db['Pause'],'as':_0xa301('0x3b')}]},_0x26bbcd={},_0x24c52f={'count':0x0,'rows':[]};var _0x29d870=_[_0xa301('0x3c')](db['SmsAccount']['rawAttributes'],function(_0x32fa93){return{'name':_0x32fa93[_0xa301('0x3d')],'type':_0x32fa93[_0xa301('0x3e')][_0xa301('0x3f')]};});_0x26bbcd[_0xa301('0x40')]=_[_0xa301('0x3c')](_0x29d870,_0xa301('0x39'));_0x26bbcd[_0xa301('0x41')]=_[_0xa301('0x42')](_0x1ff6cb[_0xa301('0x41')]);_0x26bbcd[_0xa301('0x43')]=_[_0xa301('0x44')](_0x26bbcd['model'],_0x26bbcd[_0xa301('0x41')]);_0x8cd220[_0xa301('0x45')]=_['intersection'](_0x26bbcd[_0xa301('0x40')],qs[_0xa301('0x46')](_0x1ff6cb['query']['fields']));_0x8cd220[_0xa301('0x45')]=_0x8cd220[_0xa301('0x45')][_0xa301('0x47')]?_0x8cd220[_0xa301('0x45')]:_0x26bbcd[_0xa301('0x40')];if(!_0x1ff6cb[_0xa301('0x41')][_0xa301('0x48')]('nolimit')){_0x8cd220[_0xa301('0x30')]=qs[_0xa301('0x30')](_0x1ff6cb[_0xa301('0x41')]['limit']);_0x8cd220[_0xa301('0x2e')]=qs['offset'](_0x1ff6cb[_0xa301('0x41')][_0xa301('0x2e')]);}_0x8cd220['order']=qs[_0xa301('0x49')](_0x1ff6cb['query'][_0xa301('0x49')]);_0x8cd220[_0xa301('0x4a')]=qs[_0xa301('0x43')](_['pick'](_0x1ff6cb[_0xa301('0x41')],_0x26bbcd[_0xa301('0x43')]),_0x29d870);if(_0x1ff6cb[_0xa301('0x41')][_0xa301('0x4b')]){_0x8cd220[_0xa301('0x4a')]=_[_0xa301('0x4c')](_0x8cd220[_0xa301('0x4a')],{'$or':_[_0xa301('0x3c')](_0x29d870,function(_0x20689e){if(_0x20689e[_0xa301('0x3e')]!=='VIRTUAL'){var _0x3e0b16={};_0x3e0b16[_0x20689e['name']]={'$like':'%'+_0x1ff6cb[_0xa301('0x41')]['filter']+'%'};return _0x3e0b16;}})});}_0x8cd220=_[_0xa301('0x4c')]({},_0x8cd220,_0x1ff6cb[_0xa301('0x4d')]);var _0x3adc01={'where':_0x8cd220[_0xa301('0x4a')]};return db[_0xa301('0x4e')][_0xa301('0x4f')](_0x3adc01)[_0xa301('0x1e')](function(_0x1e7471){_0x24c52f[_0xa301('0x4f')]=_0x1e7471;if(_0x1ff6cb['query']['includeAll']){_0x8cd220[_0xa301('0x50')]=[{'all':!![]}];}return db['SmsAccount'][_0xa301('0x51')](_0x8cd220);})[_0xa301('0x1e')](function(_0x3e4b51){_0x24c52f[_0xa301('0x52')]=_0x3e4b51;return _0x24c52f;})[_0xa301('0x1e')](respondWithFilteredResult(_0x5b0b68,_0x8cd220))['catch'](handleError(_0x5b0b68,null));};exports[_0xa301('0x53')]=function(_0x306fd4,_0x56765e){var _0x2faf9d={'raw':![],'where':{'id':_0x306fd4[_0xa301('0x54')]['id']},'include':[{'model':db[_0xa301('0x55')],'as':_0xa301('0x3b')}]},_0x492182={};_0x492182[_0xa301('0x40')]=_[_0xa301('0x42')](db[_0xa301('0x4e')][_0xa301('0x56')]);_0x492182[_0xa301('0x41')]=_[_0xa301('0x42')](_0x306fd4[_0xa301('0x41')]);_0x492182[_0xa301('0x43')]=_[_0xa301('0x44')](_0x492182[_0xa301('0x40')],_0x492182['query']);_0x2faf9d['attributes']=_[_0xa301('0x44')](_0x492182[_0xa301('0x40')],qs[_0xa301('0x46')](_0x306fd4['query']['fields']));_0x2faf9d[_0xa301('0x45')]=_0x2faf9d[_0xa301('0x45')][_0xa301('0x47')]?_0x2faf9d['attributes']:_0x492182[_0xa301('0x40')];if(_0x306fd4['query'][_0xa301('0x57')]){_0x2faf9d[_0xa301('0x50')]=[{'all':!![]}];}_0x2faf9d=_['merge']({},_0x2faf9d,_0x306fd4[_0xa301('0x4d')]);return db[_0xa301('0x4e')][_0xa301('0x58')](_0x2faf9d)['then'](handleEntityNotFound(_0x56765e,null))[_0xa301('0x1e')](respondWithResult(_0x56765e,null))['catch'](handleError(_0x56765e,null));};exports[_0xa301('0x59')]=function(_0x2d82e1,_0x22b863){return db[_0xa301('0x4e')][_0xa301('0x59')](_0x2d82e1[_0xa301('0x5a')],{})[_0xa301('0x1e')](function(_0x2658ce){var _0x2bc00d=_0x2d82e1[_0xa301('0x5b')][_0xa301('0x35')]({'plain':!![]});if(!_0x2bc00d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bc00d[_0xa301('0x5c')]==='user'){var _0x473800=_0x2658ce['get']({'plain':!![]});var _0x42c448='SmsAccounts';return db['UserProfileSection'][_0xa301('0x58')]({'where':{'name':_0x42c448,'userProfileId':_0x2bc00d[_0xa301('0x5d')]},'raw':!![]})['then'](function(_0x298422){if(_0x298422&&_0x298422[_0xa301('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x473800['name'],'resourceId':_0x473800['id'],'type':_0x298422[_0xa301('0x39')],'sectionId':_0x298422['id']},{})[_0xa301('0x1e')](function(){return _0x2658ce;});}else{return _0x2658ce;}})[_0xa301('0x29')](function(_0x1d1510){logger['error'](_0xa301('0x5f'),_0x1d1510);throw _0x1d1510;});}return _0x2658ce;})[_0xa301('0x1e')](respondWithResult(_0x22b863,0xc9))[_0xa301('0x29')](handleError(_0x22b863,null));};exports['update']=function(_0x511b48,_0x466d5d){if(_0x511b48[_0xa301('0x5a')]['id']){delete _0x511b48[_0xa301('0x5a')]['id'];}return db['SmsAccount'][_0xa301('0x58')]({'where':{'id':_0x511b48[_0xa301('0x54')]['id']},'include':[{'model':db[_0xa301('0x55')],'as':_0xa301('0x3b')}]})['then'](handleEntityNotFound(_0x466d5d,null))[_0xa301('0x1e')](saveUpdates(_0x511b48[_0xa301('0x5a')],null))[_0xa301('0x1e')](respondWithResult(_0x466d5d,null))[_0xa301('0x29')](handleError(_0x466d5d,null));};exports['destroy']=function(_0x5b2069,_0x1ada97){return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x5b2069[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x1ada97,null))['then'](removeEntity(_0x1ada97,null))[_0xa301('0x29')](handleError(_0x1ada97,null));};exports['describe']=function(_0x2e8ed5,_0x54900a){return db[_0xa301('0x4e')]['describe']()[_0xa301('0x1e')](respondWithResult(_0x54900a,null))[_0xa301('0x29')](handleError(_0x54900a,null));};exports[_0xa301('0x60')]=function(_0x4bccad,_0x4e0a8e,_0x3acba4){if(_0x4bccad[_0xa301('0x5a')]['id']){delete _0x4bccad[_0xa301('0x5a')]['id'];}return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x4bccad[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x4e0a8e,null))[_0xa301('0x1e')](function(_0x538083){if(_0x538083){_0x4bccad[_0xa301('0x5a')][_0xa301('0x61')]=_0x538083['id'];return db[_0xa301('0x62')][_0xa301('0x59')](_0x4bccad['body']);}})[_0xa301('0x1e')](respondWithResult(_0x4e0a8e,null))[_0xa301('0x29')](handleError(_0x4e0a8e,null));};exports[_0xa301('0x63')]=function(_0x13abf6,_0x5b569a,_0x531a1b){var _0x29cc7b={'raw':![],'where':{}};var _0x4c8fa5={};var _0x27b398={'count':0x0,'rows':[]};return db[_0xa301('0x4e')][_0xa301('0x64')]({'where':{'id':_0x13abf6[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x5b569a,null))[_0xa301('0x1e')](function(_0x8978fc){if(_0x8978fc){_0x4c8fa5[_0xa301('0x40')]=_[_0xa301('0x42')](db[_0xa301('0x62')]['rawAttributes']);_0x4c8fa5[_0xa301('0x41')]=_[_0xa301('0x42')](_0x13abf6['query']);_0x4c8fa5[_0xa301('0x43')]=_[_0xa301('0x44')](_0x4c8fa5['model'],_0x4c8fa5[_0xa301('0x41')]);_0x29cc7b[_0xa301('0x45')]=_['intersection'](_0x4c8fa5[_0xa301('0x40')],qs['fields'](_0x13abf6['query'][_0xa301('0x46')]));_0x29cc7b['attributes']=_0x29cc7b[_0xa301('0x45')][_0xa301('0x47')]?_0x29cc7b[_0xa301('0x45')]:_0x4c8fa5[_0xa301('0x40')];if(!_0x13abf6['query']['hasOwnProperty']('nolimit')){_0x29cc7b['limit']=qs[_0xa301('0x30')](_0x13abf6['query'][_0xa301('0x30')]);_0x29cc7b[_0xa301('0x2e')]=qs[_0xa301('0x2e')](_0x13abf6[_0xa301('0x41')][_0xa301('0x2e')]);}_0x29cc7b[_0xa301('0x65')]=qs['sort'](_0x13abf6[_0xa301('0x41')][_0xa301('0x49')]);_0x29cc7b[_0xa301('0x4a')]=qs[_0xa301('0x43')](_[_0xa301('0x66')](_0x13abf6[_0xa301('0x41')],_0x4c8fa5[_0xa301('0x43')]));_0x29cc7b[_0xa301('0x4a')]['SmsAccountId']=_0x8978fc['id'];if(_0x13abf6[_0xa301('0x41')]['filter']){_0x29cc7b[_0xa301('0x4a')]=_[_0xa301('0x4c')](_0x29cc7b['where'],{'$or':_[_0xa301('0x3c')](_0x29cc7b[_0xa301('0x45')],function(_0xc51c9c){var _0x231133={};_0x231133[_0xc51c9c]={'$like':'%'+_0x13abf6[_0xa301('0x41')][_0xa301('0x4b')]+'%'};return _0x231133;})});}_0x29cc7b=_[_0xa301('0x4c')]({},_0x29cc7b,_0x13abf6['options']);return db['Disposition']['count']({'where':_0x29cc7b['where']})[_0xa301('0x1e')](function(_0x5a34b6){_0x27b398[_0xa301('0x4f')]=_0x5a34b6;if(_0x13abf6['query'][_0xa301('0x57')]){_0x29cc7b[_0xa301('0x50')]=[{'all':!![]}];}return db[_0xa301('0x62')][_0xa301('0x51')](_0x29cc7b);})[_0xa301('0x1e')](function(_0x250d73){_0x27b398['rows']=_0x250d73;return _0x27b398;});}})[_0xa301('0x1e')](respondWithFilteredResult(_0x5b569a,_0x29cc7b))['catch'](handleError(_0x5b569a,null));};exports['removeDispositions']=function(_0x4d0da1,_0x599eb0,_0x2ccc21){return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x4d0da1['params']['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x599eb0,null))[_0xa301('0x1e')](function(_0x381339){if(_0x381339){return _0x381339['removeDispositions'](_0x4d0da1['query'][_0xa301('0x67')]);}})['then'](respondWithStatusCode(_0x599eb0,null))[_0xa301('0x29')](handleError(_0x599eb0,null));};exports['addAnswer']=function(_0x5727d8,_0x70aeaa,_0x384452){if(_0x5727d8[_0xa301('0x5a')]['id']){delete _0x5727d8['body']['id'];}return db[_0xa301('0x4e')]['find']({'where':{'id':_0x5727d8[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x70aeaa,null))[_0xa301('0x1e')](function(_0x544a31){if(_0x544a31){_0x5727d8[_0xa301('0x5a')][_0xa301('0x61')]=_0x544a31['id'];return db[_0xa301('0x68')][_0xa301('0x59')](_0x5727d8[_0xa301('0x5a')]);}})['then'](respondWithResult(_0x70aeaa,null))['catch'](handleError(_0x70aeaa,null));};exports[_0xa301('0x69')]=function(_0x1654c8,_0x2d7512,_0x288fac){var _0xccafbb={'raw':![],'where':{}};var _0x3c6446={};var _0x2433b0={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa301('0x64')]({'where':{'id':_0x1654c8[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x2d7512,null))['then'](function(_0x3a7b2e){if(_0x3a7b2e){_0x3c6446['model']=_['keys'](db[_0xa301('0x68')][_0xa301('0x56')]);_0x3c6446[_0xa301('0x41')]=_[_0xa301('0x42')](_0x1654c8['query']);_0x3c6446['filters']=_['intersection'](_0x3c6446[_0xa301('0x40')],_0x3c6446[_0xa301('0x41')]);_0xccafbb[_0xa301('0x45')]=_[_0xa301('0x44')](_0x3c6446[_0xa301('0x40')],qs['fields'](_0x1654c8[_0xa301('0x41')][_0xa301('0x46')]));_0xccafbb['attributes']=_0xccafbb['attributes']['length']?_0xccafbb[_0xa301('0x45')]:_0x3c6446['model'];if(!_0x1654c8[_0xa301('0x41')][_0xa301('0x48')](_0xa301('0x6a'))){_0xccafbb['limit']=qs[_0xa301('0x30')](_0x1654c8[_0xa301('0x41')]['limit']);_0xccafbb[_0xa301('0x2e')]=qs[_0xa301('0x2e')](_0x1654c8['query']['offset']);}_0xccafbb['order']=qs[_0xa301('0x49')](_0x1654c8[_0xa301('0x41')]['sort']);_0xccafbb['where']=qs[_0xa301('0x43')](_['pick'](_0x1654c8[_0xa301('0x41')],_0x3c6446[_0xa301('0x43')]));_0xccafbb['where'][_0xa301('0x61')]=_0x3a7b2e['id'];if(_0x1654c8[_0xa301('0x41')][_0xa301('0x4b')]){_0xccafbb[_0xa301('0x4a')]=_[_0xa301('0x4c')](_0xccafbb['where'],{'$or':_[_0xa301('0x3c')](_0xccafbb[_0xa301('0x45')],function(_0x52ba1c){var _0x2b48ea={};_0x2b48ea[_0x52ba1c]={'$like':'%'+_0x1654c8['query'][_0xa301('0x4b')]+'%'};return _0x2b48ea;})});}_0xccafbb=_[_0xa301('0x4c')]({},_0xccafbb,_0x1654c8['options']);return db[_0xa301('0x68')][_0xa301('0x4f')]({'where':_0xccafbb[_0xa301('0x4a')]})[_0xa301('0x1e')](function(_0x11ad67){_0x2433b0['count']=_0x11ad67;if(_0x1654c8[_0xa301('0x41')][_0xa301('0x57')]){_0xccafbb[_0xa301('0x50')]=[{'all':!![]}];}return db[_0xa301('0x68')][_0xa301('0x51')](_0xccafbb);})[_0xa301('0x1e')](function(_0x2337b4){_0x2433b0[_0xa301('0x52')]=_0x2337b4;return _0x2433b0;});}})[_0xa301('0x1e')](respondWithFilteredResult(_0x2d7512,_0xccafbb))[_0xa301('0x29')](handleError(_0x2d7512,null));};exports['removeAnswers']=function(_0x3eed40,_0x1d2c02,_0x26ab17){return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x3eed40['params']['id']}})['then'](handleEntityNotFound(_0x1d2c02,null))['then'](function(_0x163ce5){if(_0x163ce5){return _0x163ce5['removeAnswers'](_0x3eed40[_0xa301('0x41')][_0xa301('0x67')]);}})[_0xa301('0x1e')](respondWithStatusCode(_0x1d2c02,null))['catch'](handleError(_0x1d2c02,null));};exports[_0xa301('0x6b')]=function(_0x5e5163,_0x2b5160,_0xbc8b1d){var _0x2c41bb={'channel':_0xa301('0x6c')};var _0x5e9bf7=[];var _0x21e240=[];var _0x5b73e1={};return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x5e5163[_0xa301('0x54')]['id']},'include':[{'model':db[_0xa301('0x6d')],'as':_0xa301('0x6e')}]})['then'](handleEntityNotFound(_0x2b5160,null))[_0xa301('0x1e')](function(_0x3c0357){_0x2c41bb[_0xa301('0x6f')]=_0x3c0357;_0x2c41bb['applications']=_[_0xa301('0x70')](_0x3c0357[_0xa301('0x6e')],['priority'],[_0xa301('0x71')]);if(_0x2c41bb[_0xa301('0x6f')][_0xa301('0x6e')]){delete _0x2c41bb[_0xa301('0x6f')]['Applications'];}return db[_0xa301('0x72')][_0xa301('0x73')]();})[_0xa301('0x1e')](function(_0x55d147){if(!_0x55d147){throw new db[(_0xa301('0x74'))]['ValidationError'](_0xa301('0x75'));}_0x5e9bf7=_[_0xa301('0x76')](_[_0xa301('0x42')](_0x55d147),['createdAt',_0xa301('0x77')]);_0x21e240=_[_0xa301('0x76')](_['keys'](_0x55d147),[_0xa301('0x78'),_0xa301('0x77'),_0xa301('0x79'),_0xa301('0x7a')]);_0x2c41bb[_0xa301('0x5a')]={'mapKey':'mobile'};if(_0x2c41bb[_0xa301('0x6f')][_0xa301('0x3e')]){switch(_0x2c41bb[_0xa301('0x6f')][_0xa301('0x3e')]){case _0xa301('0x7b'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]=_0x5e5163[_0xa301('0x5a')]['From'];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x7d')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7e')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x7f')];break;case'skebby':_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]='+'+_0x5e5163['body'][_0xa301('0x80')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')]['text'];break;case _0xa301('0x81'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x7c')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')]['message'];break;case _0xa301('0x82'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x7c')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x5a')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7e')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x83')];break;case _0xa301('0x84'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]=_0x5e5163['body'][_0xa301('0x85')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163['body'][_0xa301('0x86')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7e')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x87')];break;case _0xa301('0x88'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]='+'+_0x5e5163['body'][_0xa301('0x89')][0x0]['from'];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x89')][0x0][_0xa301('0x8a')];_0x2c41bb['body']['messageId']=_0x5e5163['body']['results'][0x0][_0xa301('0x7e')];break;case _0xa301('0x8b'):_0x2c41bb[_0xa301('0x5a')]['from']=_0x5e5163[_0xa301('0x5a')][_0xa301('0x8c')];_0x2c41bb[_0xa301('0x5a')]['body']=_0x5e5163['body'][_0xa301('0x8d')]['message'];break;case _0xa301('0x8e'):_0x2c41bb['body'][_0xa301('0x7c')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x8f')];_0x2c41bb['body'][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x8a')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7e')]=_0x5e5163['body'][_0xa301('0x90')];break;case _0xa301('0x91'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7e')]=_0x5e5163[_0xa301('0x5a')][0x0][_0xa301('0x27')]['id'];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]=_0x5e5163[_0xa301('0x5a')][0x0]['message']['from'];_0x2c41bb['body'][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')][0x0]['message']['text'];break;case _0xa301('0x92'):_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')]=_0x5e5163[_0xa301('0x5a')]['from'];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x5a')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x27')];_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7e')]=_0x5e5163[_0xa301('0x5a')][_0xa301('0x93')];break;}}if(_0x2c41bb[_0xa301('0x5a')]['id']){delete _0x2c41bb[_0xa301('0x5a')]['id'];}if(_['isNil'](_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')])){throw new db[(_0xa301('0x74'))][(_0xa301('0x94'))]('from\x20is\x20mandatory');}if(_[_0xa301('0x95')](_0x2c41bb[_0xa301('0x5a')]['body'])||_0x2c41bb[_0xa301('0x5a')]['body']===''){throw new db[(_0xa301('0x74'))]['ValidationError'](_0xa301('0x96'));}if(_[_0xa301('0x95')](_0x2c41bb[_0xa301('0x5a')][_0xa301('0x97')])){throw new db['Sequelize'][(_0xa301('0x94'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x21e240);}if(!_[_0xa301('0x98')](_0x21e240,_0x2c41bb[_0xa301('0x5a')][_0xa301('0x97')])){throw new db[(_0xa301('0x74'))]['ValidationError'](_0xa301('0x99')+_0x21e240);}_0x5b73e1[_0x2c41bb['body'][_0xa301('0x97')]]=_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')];return db[_0xa301('0x9a')][_0xa301('0x58')]({'where':{'id':_0x2c41bb['account']['ListId']},'include':[{'model':db[_0xa301('0x72')],'as':'Contacts','where':_0x5b73e1,'limit':0x1,'order':[[_0xa301('0x77'),_0xa301('0x9b')]]}]});})[_0xa301('0x1e')](handleEntityNotFound(_0x2b5160,null))[_0xa301('0x1e')](function(_0x21a2be){if(_0x21a2be){_0x2c41bb[_0xa301('0x9c')]=_[_0xa301('0x9d')](_0x21a2be,[_0xa301('0x9e')]);if(_0x21a2be['Contacts'][_0xa301('0x47')]){return _0x21a2be[_0xa301('0x9e')][0x0];}var _0x445304=_['defaults'](_0x2c41bb[_0xa301('0x5a')],{'firstName':_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')],'ListId':_0x21a2be['id']});_0x445304[_0x2c41bb[_0xa301('0x5a')]['mapKey']]=_0x2c41bb[_0xa301('0x5a')][_0xa301('0x7c')];return db[_0xa301('0x72')][_0xa301('0x59')](_0x445304,{'fields':_0x5e9bf7,'raw':!![]});}})[_0xa301('0x1e')](handleEntityNotFound(_0x2b5160,null))['then'](function(_0x2bb7fa){if(_0x2bb7fa){_0x2c41bb[_0xa301('0x9f')]=_0x2bb7fa;var _0xa4f711={'ContactId':_0x2bb7fa['id'],'phone':_0x2c41bb[_0xa301('0x5a')]['from'],'SmsAccountId':_0x5e5163[_0xa301('0x54')]['id']};var _0x3a6d9b={'ContactId':_0x2bb7fa['id'],'SmsAccountId':_0x5e5163[_0xa301('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0xa301('0x58')]({'where':_0x3a6d9b})[_0xa301('0x1e')](function(_0x33b806){if(_0x33b806){return[_0x33b806,![]];}return db[_0xa301('0xa0')][_0xa301('0x59')](_0xa4f711)[_0xa301('0x1e')](function(_0x16b7f5){return[_0x16b7f5,!![]];});});}})[_0xa301('0xa1')](function(_0x54fceb,_0x5044ec){_0x2c41bb['interaction']=_0x54fceb['get']({'plain':!![]});_0x2c41bb[_0xa301('0xa2')][_0xa301('0xa3')]=![];if(_0x5044ec){if(_0x2c41bb['account'][_0xa301('0xa4')]){_0x2c41bb[_0xa301('0xa5')]['push']({'id':0x0,'priority':_0x2c41bb[_0xa301('0xa5')]['length']+0x1,'app':_0xa301('0xa6'),'appdata':_0xa301('0xa7'),'interval':'*,*,*,*'});}_0x2c41bb[_0xa301('0xa2')]['created']=!![];}return db[_0xa301('0xa8')]['create']({'phone':_0x2c41bb[_0xa301('0x5a')]['from'],'messageId':_0x2c41bb[_0xa301('0x5a')]['messageId'],'body':_0x2c41bb['body'][_0xa301('0x5a')],'SmsAccountId':_0x5e5163['params']['id'],'SmsInteractionId':_0x54fceb['id'],'direction':'in','ContactId':_0x54fceb[_0xa301('0xa9')],'AttachmentId':_0x2c41bb[_0xa301('0x5a')][_0xa301('0xaa')]});})[_0xa301('0x1e')](function(_0x1c5ec6){_0x2c41bb[_0xa301('0x27')]=_0x1c5ec6;if(!_0x2c41bb[_0xa301('0xa2')]['UserId'])return;return db['User'][_0xa301('0x58')]({'attributes':['id',_0xa301('0x39')],'where':{'id':_0x2c41bb[_0xa301('0xa2')]['UserId']}});})[_0xa301('0x1e')](function(_0xfca7c3){if(_0xfca7c3){_0x2c41bb[_0xa301('0xa5')][_0xa301('0xab')]({'id':0x0,'priority':0x0,'app':_0xa301('0xac'),'appdata':_0xfca7c3[_0xa301('0x39')]+','+(_0x2c41bb[_0xa301('0x6f')][_0xa301('0xad')]||0xa),'interval':'*,*,*,*'});}if(!_0x2c41bb[_0xa301('0xa2')][_0xa301('0xae')])return;return db[_0xa301('0xaf')][_0xa301('0x58')]({'attributes':['id',_0xa301('0x39')],'where':{'id':_0x2c41bb['interaction'][_0xa301('0xae')]}});})['then'](function(_0x2c0b00){if(_0x2c0b00){_0x2c41bb['applications'][_0xa301('0xab')]({'id':0x0,'priority':0x1,'app':_0xa301('0xb0'),'appdata':_0x2c0b00[_0xa301('0x39')]+','+(_0x2c41bb[_0xa301('0x6f')][_0xa301('0xb1')]||0x12c),'interval':_0xa301('0xb2')});}return respondWithRpcPromise(_0xa301('0xb3'),_0xa301('0xb4'),_0x2c41bb);})[_0xa301('0x1e')](function(_0x53b9e2){if(_0x53b9e2){var _0x27fd7b=0xc8;var _0x190929=_0xa301('0xb5');logger[_0xa301('0x1f')](_0xa301('0x23'),_0x190929,_0x27fd7b,_0xa301('0xb6'));logger['debug'](_0xa301('0xb7'),_0x190929,_0x27fd7b,_0xa301('0xb6'),JSON[_0xa301('0x24')](_0x53b9e2));if(_0x2c41bb[_0xa301('0x6f')]['type']==='twilio'){return _0x2b5160[_0xa301('0x2b')](_0x27fd7b)[_0xa301('0xb8')](_0xa301('0xb9'),'text/xml')[_0xa301('0xba')](_0xa301('0xbb'));}else{return _0x2b5160[_0xa301('0x2b')](_0x27fd7b)[_0xa301('0x2d')](_0x53b9e2);}}})[_0xa301('0x29')](handleError(_0x2b5160,null));};exports[_0xa301('0xbc')]=function(_0x2d6035,_0x271676){var _0x21e688=_0x2d6035[_0xa301('0x54')]['id'];var _0x2b37bd=_0x2d6035[_0xa301('0x5a')];var _0x50db4f=0xc8;var _0x4e7121=null;return db['sequelize'][_0xa301('0xbd')]({'isolationLevel':db[_0xa301('0xbe')][_0xa301('0xbf')][_0xa301('0xc0')]['READ_COMMITTED']},function(_0x4dbe87){return db[_0xa301('0x4e')]['findOne']({'where':{'id':_0x21e688},'transaction':_0x4dbe87})[_0xa301('0x1e')](function(_0xa01848){if(_0xa01848){return db[_0xa301('0x6d')][_0xa301('0x34')]({'where':{'SmsAccountId':_0x21e688},'transaction':_0x4dbe87})[_0xa301('0x1e')](function(){var _0x579426=_['map'](_0x2b37bd,function(_0x2c81f7){_0x2c81f7[_0xa301('0x61')]=_0x21e688;return _0x2c81f7;});return db[_0xa301('0x6d')][_0xa301('0xc1')](_0x579426,{'transaction':_0x4dbe87});});}else{_0x50db4f=0x194;_0x4e7121=[];}});})[_0xa301('0x1e')](function(){if(_0x50db4f!==0x194){return db[_0xa301('0x6d')][_0xa301('0xc2')]({'where':{'SmsAccountId':_0x21e688},'order':'priority'})[_0xa301('0x1e')](function(_0x52256d){_0x4e7121=_0x52256d;});}})[_0xa301('0x29')](function(_0x2fd50a){_0x50db4f=0x1f4;logger['error'](_0x2fd50a[_0xa301('0x38')]);if(_0x2fd50a['name']){delete _0x2fd50a[_0xa301('0x39')];}_0x4e7121=_0x2fd50a;})[_0xa301('0xc3')](function(){if(_0x4e7121===null){_0x271676[_0xa301('0x2a')](_0x50db4f);}else{if(_0x50db4f===0x1f4){_0x271676[_0xa301('0x2b')](_0x50db4f)['send'](_0x4e7121);}else{_0x271676['status'](_0x50db4f)[_0xa301('0x2d')](_0x4e7121);}}});};exports[_0xa301('0xc4')]=function(_0x2cdc9a,_0x55bef6,_0x1dfe1a){var _0x3590a5={};var _0x55ea5f={};var _0x230dfc;var _0x52596f;return db['SmsAccount']['findOne']({'where':{'id':_0x2cdc9a[_0xa301('0x54')]['id']}})['then'](handleEntityNotFound(_0x55bef6,null))[_0xa301('0x1e')](function(_0x4784cc){if(_0x4784cc){_0x230dfc=_0x4784cc;_0x55ea5f[_0xa301('0x40')]=_[_0xa301('0x42')](db[_0xa301('0x6d')][_0xa301('0x56')]);_0x55ea5f[_0xa301('0x41')]=_['keys'](_0x2cdc9a[_0xa301('0x41')]);_0x55ea5f[_0xa301('0x43')]=_[_0xa301('0x44')](_0x55ea5f[_0xa301('0x40')],_0x55ea5f['query']);_0x3590a5[_0xa301('0x45')]=_['intersection'](_0x55ea5f[_0xa301('0x40')],qs['fields'](_0x2cdc9a[_0xa301('0x41')][_0xa301('0x46')]));_0x3590a5[_0xa301('0x45')]=_0x3590a5[_0xa301('0x45')][_0xa301('0x47')]?_0x3590a5['attributes']:_0x55ea5f[_0xa301('0x40')];_0x3590a5['order']=qs[_0xa301('0x49')](_0x2cdc9a[_0xa301('0x41')][_0xa301('0x49')]);_0x3590a5[_0xa301('0x4a')]=qs['filters'](_[_0xa301('0x66')](_0x2cdc9a['query'],_0x55ea5f[_0xa301('0x43')]));if(_0x2cdc9a[_0xa301('0x41')]['filter']){_0x3590a5[_0xa301('0x4a')]=_[_0xa301('0x4c')](_0x3590a5[_0xa301('0x4a')],{'$or':_[_0xa301('0x3c')](_0x3590a5[_0xa301('0x45')],function(_0x2c42b4){var _0x4f0f65={};_0x4f0f65[_0x2c42b4]={'$like':'%'+_0x2cdc9a[_0xa301('0x41')]['filter']+'%'};return _0x4f0f65;})});}_0x3590a5=_[_0xa301('0x4c')]({},_0x3590a5,_0x2cdc9a[_0xa301('0x4d')]);return _0x230dfc[_0xa301('0xc4')](_0x3590a5);}})[_0xa301('0x1e')](function(_0x57e0f3){if(_0x57e0f3){_0x52596f=_0x57e0f3['length'];if(!_0x2cdc9a[_0xa301('0x41')][_0xa301('0x48')](_0xa301('0x6a'))){_0x3590a5[_0xa301('0x30')]=qs[_0xa301('0x30')](_0x2cdc9a[_0xa301('0x41')][_0xa301('0x30')]);_0x3590a5[_0xa301('0x2e')]=qs[_0xa301('0x2e')](_0x2cdc9a[_0xa301('0x41')][_0xa301('0x2e')]);}return _0x230dfc[_0xa301('0xc4')](_0x3590a5);}})[_0xa301('0x1e')](function(_0x203e6b){if(_0x203e6b){return _0x203e6b?{'count':_0x52596f,'rows':_0x203e6b}:null;}})[_0xa301('0x1e')](respondWithResult(_0x55bef6,null))['catch'](handleError(_0x55bef6,null));};exports['getInteractions']=function(_0x275808,_0x40d5e0,_0xf4c15c){var _0x3597ff={'raw':![],'where':{}};var _0x213abc={};var _0x5a266b={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x275808[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x40d5e0,null))[_0xa301('0x1e')](function(_0x5ebfb3){if(_0x5ebfb3){_0x213abc[_0xa301('0x40')]=_[_0xa301('0x42')](db['SmsInteraction']['rawAttributes']);_0x213abc['query']=_['keys'](_0x275808[_0xa301('0x41')]);_0x213abc[_0xa301('0x43')]=_[_0xa301('0x44')](_0x213abc[_0xa301('0x40')],_0x213abc[_0xa301('0x41')]);_0x3597ff[_0xa301('0x45')]=_['intersection'](_0x213abc[_0xa301('0x40')],qs[_0xa301('0x46')](_0x275808['query'][_0xa301('0x46')]));_0x3597ff[_0xa301('0x45')]=_0x3597ff['attributes'][_0xa301('0x47')]?_0x3597ff[_0xa301('0x45')]:_0x213abc['model'];if(!_0x275808[_0xa301('0x41')]['hasOwnProperty']('nolimit')){_0x3597ff[_0xa301('0x30')]=qs[_0xa301('0x30')](_0x275808['query']['limit']);_0x3597ff[_0xa301('0x2e')]=qs[_0xa301('0x2e')](_0x275808[_0xa301('0x41')]['offset']);}_0x3597ff[_0xa301('0x65')]=qs[_0xa301('0x49')](_0x275808[_0xa301('0x41')][_0xa301('0x49')]);_0x3597ff[_0xa301('0x4a')]=qs[_0xa301('0x43')](_[_0xa301('0x66')](_0x275808[_0xa301('0x41')],_0x213abc[_0xa301('0x43')]));_0x3597ff[_0xa301('0x4a')][_0xa301('0x61')]=_0x5ebfb3['id'];if(_0x275808['query'][_0xa301('0x4b')]){_0x3597ff['where']=_['merge'](_0x3597ff['where'],{'$or':_['map'](_0x3597ff[_0xa301('0x45')],function(_0x3443f9){var _0x26d719={};_0x26d719[_0x3443f9]={'$like':'%'+_0x275808[_0xa301('0x41')][_0xa301('0x4b')]+'%'};return _0x26d719;})});}_0x3597ff=_[_0xa301('0x4c')]({},_0x3597ff,_0x275808['options']);return db['SmsInteraction'][_0xa301('0x4f')]({'where':_0x3597ff['where']})[_0xa301('0x1e')](function(_0x23908e){_0x5a266b['count']=_0x23908e;if(_0x275808['query'][_0xa301('0x57')]){_0x3597ff[_0xa301('0x50')]=[{'model':db[_0xa301('0x72')],'as':_0xa301('0xc5'),'required':![]},{'model':db[_0xa301('0xc6')],'as':_0xa301('0xc7'),'attributes':[_0xa301('0x39'),'fullname',_0xa301('0xc8')],'required':![]},{'model':db[_0xa301('0xc9')],'as':'Tags','attributes':['id',_0xa301('0x39'),_0xa301('0xca')],'where':_0x275808[_0xa301('0x41')][_0xa301('0xcb')]?{'id':_0x275808[_0xa301('0x41')][_0xa301('0xcb')]}:undefined,'required':_0x275808[_0xa301('0x41')][_0xa301('0xcb')]?!![]:![]}];}return db[_0xa301('0xa0')]['findAll'](_0x3597ff);})[_0xa301('0x1e')](function(_0x4d6253){_0x5a266b[_0xa301('0x52')]=_0x4d6253;return _0x5a266b;});}})[_0xa301('0x1e')](respondWithFilteredResult(_0x40d5e0,_0x3597ff))[_0xa301('0x29')](handleError(_0x40d5e0,null));};exports[_0xa301('0xba')]=function(_0x516f36,_0x3cecea,_0x2f41a7){var _0x444968,_0x369ab7,_0x29a664;if(_[_0xa301('0x95')](_0x516f36[_0xa301('0x5a')][_0xa301('0x5a')])||_0x516f36[_0xa301('0x5a')]['body']===''){throw new db[(_0xa301('0x74'))][(_0xa301('0x94'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x516f36[_0xa301('0x5a')]['to'])){throw new db[(_0xa301('0x74'))][(_0xa301('0x94'))](_0xa301('0xcc'));}_0x444968=_0x516f36[_0xa301('0x5a')]['to'];return db[_0xa301('0x4e')]['find']({'where':{'id':_0x516f36[_0xa301('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xa301('0xcd'),'include':[{'model':db[_0xa301('0x72')],'as':'Contacts','where':{'mobile':_0x444968},'limit':0x1,'order':[['updatedAt',_0xa301('0x9b')]]}]}]})[_0xa301('0x1e')](handleEntityNotFound(_0x3cecea,null))[_0xa301('0x1e')](function(_0x25d780){if(_0x25d780&&_0x25d780['List']){_0x369ab7=_0x25d780[_0xa301('0x35')]({'plain':!![]});if(_0x369ab7[_0xa301('0xcd')]&&_0x369ab7[_0xa301('0xcd')][_0xa301('0x9e')][_0xa301('0x47')]){return _0x369ab7[_0xa301('0xcd')][_0xa301('0x9e')][0x0];}return db[_0xa301('0x72')][_0xa301('0x59')](_[_0xa301('0x18')](_0x516f36[_0xa301('0x5a')],{'firstName':_0x444968,'mobile':_0x444968,'phone':_0x444968,'ListId':_0x369ab7[_0xa301('0x7a')]}));}})[_0xa301('0x1e')](handleEntityNotFound(_0x3cecea,null))['then'](function(_0x4b30df){if(_0x4b30df){_0x29a664=_0x4b30df;return db[_0xa301('0xa0')][_0xa301('0x58')]({'where':{'ContactId':_0x29a664['id'],'closed':![],'SmsAccountId':_0x369ab7['id']}})['then'](function(_0x41e74e){if(_0x41e74e){return[_0x41e74e,![]];}return db[_0xa301('0xa0')][_0xa301('0x59')]({'UserId':_0x516f36[_0xa301('0x5b')]['id'],'ContactId':_0x29a664['id'],'SmsAccountId':_0x369ab7['id'],'phone':_0x444968,'firstMsgDirection':_0xa301('0xce'),'Messages':[_[_0xa301('0x4c')](_0x516f36[_0xa301('0x5a')],{'read':![],'body':_0x516f36[_0xa301('0x5a')]['body'],'phone':_0x444968,'SmsAccountId':_0x369ab7['id'],'UserId':_0x516f36[_0xa301('0x5b')]['id'],'ContactId':_0x29a664['id']})]},{'include':[{'model':db[_0xa301('0xa8')],'as':_0xa301('0xcf')}]})[_0xa301('0x1e')](function(_0x5f8ae2){return[_0x5f8ae2,!![]];});});}})[_0xa301('0xa1')](function(_0x23aef3,_0x2237ff){if(_0x2237ff){return _0x23aef3;}return db['SmsMessage'][_0xa301('0x59')](_['merge'](_0x516f36[_0xa301('0x5a')],{'read':![],'body':_0x516f36[_0xa301('0x5a')][_0xa301('0x5a')],'phone':_0x444968,'SmsAccountId':_0x369ab7['id'],'SmsInteractionId':_0x23aef3['id'],'UserId':_0x516f36[_0xa301('0x5b')]['id'],'ContactId':_0x29a664['id']}))[_0xa301('0x1e')](function(_0x2dd2a2){_0x23aef3[_0xa301('0xd0')][_0xa301('0xcf')]=[];_0x23aef3[_0xa301('0xd0')][_0xa301('0xcf')][_0xa301('0xd1')](_0x2dd2a2['dataValues']);return _0x23aef3;});})[_0xa301('0x1e')](respondWithResult(_0x3cecea,null))[_0xa301('0x29')](handleError(_0x3cecea,null));};exports[_0xa301('0x2b')]=function(_0x2092e5,_0x32582e,_0x4dc2cc){if(_0x2092e5['body']['id']){delete _0x2092e5[_0xa301('0x5a')]['id'];}var _0x1edb6b,_0x374343,_0x446ae1;return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x2092e5[_0xa301('0x54')]['id']}})['then'](handleEntityNotFound(_0x32582e,null))[_0xa301('0x1e')](function(_0x1dcca1){if(_0x1dcca1){_0x446ae1=_0x1dcca1;logger[_0xa301('0x22')](_0xa301('0x23'),_0xa301('0x2b'),_0xa301('0xd2'),_0x1dcca1['type'],util[_0xa301('0xd3')](_0x2092e5['body'],{'showHidden':![],'depth':null}));switch(_0x1dcca1[_0xa301('0x3e')]){case _0xa301('0xd4'):if(_0x2092e5['body'][_0xa301('0xd5')]&&_0x2092e5[_0xa301('0x5a')][_0xa301('0x2b')]){_0x374343=_0x2092e5[_0xa301('0x5a')][_0xa301('0x2b')];return db['SmsMessage'][_0xa301('0x58')]({'where':{'messageId':_0x2092e5[_0xa301('0x5a')][_0xa301('0xd5')]}});}break;case _0xa301('0x81'):if(_0x2092e5['body'][_0xa301('0xd6')]&&_0x2092e5['body'][_0xa301('0xd7')]){_0x374343=_0x2092e5[_0xa301('0x5a')][_0xa301('0xd7')];return db[_0xa301('0xa8')][_0xa301('0x58')]({'where':{'messageId':_0x2092e5[_0xa301('0x5a')][_0xa301('0xd6')]}});}break;case _0xa301('0x82'):if(_0x2092e5['body'][_0xa301('0x83')]&&_0x2092e5[_0xa301('0x5a')][_0xa301('0xd8')]){_0x374343=_0x2092e5[_0xa301('0x5a')][_0xa301('0xd8')];return db[_0xa301('0xa8')][_0xa301('0x58')]({'where':{'messageId':_0x2092e5[_0xa301('0x5a')]['message_id']}});}break;case _0xa301('0x88'):var _0x382096=_0x2092e5[_0xa301('0x5a')][_0xa301('0x89')][0x0];if(_0x382096['messageId']&&_0x382096[_0xa301('0x2b')][_0xa301('0xd9')]===_0xa301('0xda')){_0x374343=_0x382096[_0xa301('0x2b')][_0xa301('0xd9')];return db[_0xa301('0xa8')]['find']({'where':{'messageId':_0x382096['messageId']}});}break;case _0xa301('0x8e'):if(_0x2092e5[_0xa301('0x5a')][_0xa301('0x7e')]&&_0x2092e5[_0xa301('0x5a')][_0xa301('0x2b')]){_0x374343=_0x2092e5[_0xa301('0x5a')][_0xa301('0x2b')];return db[_0xa301('0xa8')][_0xa301('0x58')]({'where':{'messageId':_0x2092e5[_0xa301('0x5a')][_0xa301('0x7e')]}});}break;case _0xa301('0x91'):if(_0x2092e5['body'][0x0][_0xa301('0x27')]['id']){_0x374343=_0x2092e5[_0xa301('0x5a')][0x0][_0xa301('0x3e')];return db[_0xa301('0xa8')][_0xa301('0x58')]({'where':{'messageId':_0x2092e5[_0xa301('0x5a')][0x0][_0xa301('0x27')]['id']}});}break;case _0xa301('0x92'):if(_0x2092e5['body'][_0xa301('0xdb')]&&_0x2092e5[_0xa301('0x5a')][_0xa301('0x2b')]){_0x374343=_0x2092e5[_0xa301('0x5a')][_0xa301('0x2b')];return db['SmsMessage'][_0xa301('0x58')]({'where':{'messageId':_0x2092e5['body'][_0xa301('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x32582e,null))[_0xa301('0x1e')](function(_0x55b55f){if(_0x55b55f){_0x1edb6b=_0x55b55f;switch(_0x446ae1[_0xa301('0x3e')]){case _0xa301('0xd4'):if(_0x374343===_0xa301('0xda')){return _0x1edb6b[_0xa301('0xdc')]({'read':!![]});}else{logger[_0xa301('0x25')](_0xa301('0x23'),'status','skebby',util[_0xa301('0xd3')](_0x2092e5[_0xa301('0x5a')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x374343==='1'){return _0x1edb6b[_0xa301('0xdc')]({'read':!![]});}else{logger[_0xa301('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa301('0xd4'),util[_0xa301('0xd3')](_0x2092e5[_0xa301('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa301('0x82'):if(!_0x2092e5['body'][_0xa301('0xdd')]&&_0x374343>=0xc8&&_0x374343<=0xce){return _0x1edb6b['update']({'read':!![]});}else{logger[_0xa301('0x25')](_0xa301('0x23'),'status',_0xa301('0x82'),util[_0xa301('0xd3')](_0x2092e5[_0xa301('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa301('0x88'):var _0x3af8a6=_0x2092e5['body']['results'][0x0];if(_0x3af8a6[_0xa301('0x2b')]['groupName']===_0xa301('0xda')){return _0x1edb6b[_0xa301('0xdc')]({'read':!![]});}else{logger[_0xa301('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa301('0x88'),util['inspect'](_0x2092e5[_0xa301('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa301('0x8e'):if(_0x374343==_0xa301('0xde')||_0x374343=='RECEIVED_BY_RECIPIENT'){return _0x1edb6b[_0xa301('0xdc')]({'read':!![]});}else{logger[_0xa301('0x25')](_0xa301('0x23'),_0xa301('0x2b'),_0xa301('0x8e'),util['inspect'](_0x2092e5['body'],{'showHidden':![],'depth':null}));}break;case _0xa301('0x91'):if(_0x374343==_0xa301('0xdf')){return _0x1edb6b[_0xa301('0xdc')]({'read':!![]});}else{logger[_0xa301('0x25')](_0xa301('0x23'),_0xa301('0x2b'),'bandwidth',util[_0xa301('0xd3')](_0x2092e5[_0xa301('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa301('0x92'):if(_0x374343==='DELIVRD'||_0x374343===_0xa301('0xe0')){return _0x1edb6b['update']({'read':!![]});}else{logger['error'](_0xa301('0x23'),'status','intelepeer',util['inspect'](_0x2092e5[_0xa301('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x1edb6b;}})[_0xa301('0x1e')](respondWithResult(_0x32582e,null))[_0xa301('0x29')](handleError(_0x32582e,null));};exports[_0xa301('0xe1')]=function(_0x1cc2b0,_0xbda4c1,_0x371006){var _0x10a743,_0x403e80,_0x4731c3;return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x1cc2b0[_0xa301('0x54')]['id']}})['then'](handleEntityNotFound(_0xbda4c1,null))[_0xa301('0x1e')](function(_0x1973a6){if(_0x1973a6){_0x4731c3=_0x1973a6;logger[_0xa301('0x22')](_0xa301('0x23'),_0xa301('0x2b'),_0xa301('0xd2'),_0x1973a6[_0xa301('0x3e')],util[_0xa301('0xd3')](_0x1cc2b0[_0xa301('0x41')],{'showHidden':![],'depth':null}));switch(_0x1973a6[_0xa301('0x3e')]){case _0xa301('0x8b'):if(_0x1cc2b0['query'][_0xa301('0xe2')]&&_0x1cc2b0[_0xa301('0x41')][_0xa301('0xe3')]){_0x403e80=_0x1cc2b0[_0xa301('0x41')][_0xa301('0xe3')];return db['SmsMessage'][_0xa301('0x58')]({'where':{'messageId':_0x1cc2b0[_0xa301('0x41')][_0xa301('0xe2')]}});}break;}}})['then'](handleEntityNotFound(_0xbda4c1,null))[_0xa301('0x1e')](function(_0x31caae){if(_0x31caae){_0x10a743=_0x31caae;switch(_0x4731c3[_0xa301('0x3e')]){case _0xa301('0x8b'):if(_0x403e80==='2'||_0x403e80==='6'){return _0x10a743[_0xa301('0xdc')]({'read':!![]});}else{logger[_0xa301('0x25')](_0xa301('0x23'),_0xa301('0x2b'),_0xa301('0x8b'),util[_0xa301('0xd3')](_0x1cc2b0[_0xa301('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x10a743;}})[_0xa301('0x1e')](respondWithResult(_0xbda4c1,null))[_0xa301('0x29')](handleError(_0xbda4c1,null));};exports[_0xa301('0xe4')]=function(_0x143346,_0x47e918,_0x208416){return db['SmsAccount'][_0xa301('0x58')]({'where':{'id':_0x143346[_0xa301('0x54')]['id']}})['then'](handleEntityNotFound(_0x47e918,null))[_0xa301('0x1e')](function(_0x5776ae){if(_0x5776ae){return _0x5776ae[_0xa301('0xe4')](_0x143346[_0xa301('0x5a')][_0xa301('0x67')],_[_0xa301('0x9d')](_0x143346[_0xa301('0x5a')],[_0xa301('0x67'),'id'])||{})['spread'](function(_0x30b0c0){for(var _0x32857a=0x0;_0x32857a<_0x143346[_0xa301('0x5a')][_0xa301('0x67')][_0xa301('0x47')];_0x32857a+=0x1){socket[_0xa301('0xe5')](_0xa301('0xe6'),{'UserId':Number(_0x143346[_0xa301('0x5a')][_0xa301('0x67')][_0x32857a]),'SmsAccountId':Number(_0x143346[_0xa301('0x54')]['id'])});}return _0x30b0c0;});}})[_0xa301('0x1e')](respondWithResult(_0x47e918,null))[_0xa301('0x29')](handleError(_0x47e918,null));};exports[_0xa301('0xe7')]=function(_0x3fd7e5,_0x5800cf,_0x4ac0cd){return db[_0xa301('0x4e')][_0xa301('0x58')]({'where':{'id':_0x3fd7e5[_0xa301('0x54')]['id']}})[_0xa301('0x1e')](handleEntityNotFound(_0x5800cf,null))['then'](function(_0x3737fd){if(_0x3737fd){return _0x3737fd[_0xa301('0xe7')](_0x3fd7e5[_0xa301('0x41')][_0xa301('0x67')])['then'](function(){if(_[_0xa301('0xe8')](_0x3fd7e5[_0xa301('0x41')]['ids'])){for(var _0x5301b2=0x0;_0x5301b2<_0x3fd7e5[_0xa301('0x41')][_0xa301('0x67')][_0xa301('0x47')];_0x5301b2+=0x1){socket[_0xa301('0xe5')]('userSmsAccount:remove',{'UserId':Number(_0x3fd7e5[_0xa301('0x41')]['ids'][_0x5301b2]),'SmsAccountId':Number(_0x3fd7e5[_0xa301('0x54')]['id'])});}}else{socket[_0xa301('0xe5')](_0xa301('0xe9'),{'UserId':Number(_0x3fd7e5[_0xa301('0x41')][_0xa301('0x67')]),'SmsAccountId':Number(_0x3fd7e5['params']['id'])});}});}})[_0xa301('0x1e')](respondWithStatusCode(_0x5800cf,null))[_0xa301('0x29')](handleError(_0x5800cf,null));};exports[_0xa301('0xea')]=function(_0x2c199d,_0xb7d824,_0x12eef5){var _0x818d44={};var _0x29d94b={};var _0x217b6b;var _0x51b8ca;return db[_0xa301('0x4e')][_0xa301('0x64')]({'where':{'id':_0x2c199d['params']['id']}})['then'](handleEntityNotFound(_0xb7d824,null))['then'](function(_0x2f71ab){if(_0x2f71ab){_0x217b6b=_0x2f71ab;_0x29d94b[_0xa301('0x40')]=_[_0xa301('0x42')](db[_0xa301('0xc6')][_0xa301('0x56')]);_0x29d94b[_0xa301('0x41')]=_[_0xa301('0x42')](_0x2c199d[_0xa301('0x41')]);_0x29d94b[_0xa301('0x43')]=_[_0xa301('0x44')](_0x29d94b['model'],_0x29d94b[_0xa301('0x41')]);_0x818d44['attributes']=_[_0xa301('0x44')](_0x29d94b[_0xa301('0x40')],qs[_0xa301('0x46')](_0x2c199d[_0xa301('0x41')][_0xa301('0x46')]));_0x818d44['attributes']=_0x818d44[_0xa301('0x45')][_0xa301('0x47')]?_0x818d44[_0xa301('0x45')]:_0x29d94b['model'];_0x818d44[_0xa301('0x65')]=qs[_0xa301('0x49')](_0x2c199d[_0xa301('0x41')]['sort']);_0x818d44[_0xa301('0x4a')]=qs[_0xa301('0x43')](_['pick'](_0x2c199d[_0xa301('0x41')],_0x29d94b['filters']));if(_0x2c199d[_0xa301('0x41')]['filter']){_0x818d44[_0xa301('0x4a')]=_['merge'](_0x818d44[_0xa301('0x4a')],{'$or':_[_0xa301('0x3c')](_0x818d44[_0xa301('0x45')],function(_0x579a4f){var _0x10dbc9={};_0x10dbc9[_0x579a4f]={'$like':'%'+_0x2c199d[_0xa301('0x41')]['filter']+'%'};return _0x10dbc9;})});}_0x818d44=_[_0xa301('0x4c')]({},_0x818d44,_0x2c199d['options']);return _0x217b6b['getAgents'](_0x818d44);}})['then'](function(_0x4668ef){if(_0x4668ef){_0x51b8ca=_0x4668ef[_0xa301('0x47')];if(!_0x2c199d[_0xa301('0x41')]['hasOwnProperty']('nolimit')){_0x818d44[_0xa301('0x30')]=qs[_0xa301('0x30')](_0x2c199d['query'][_0xa301('0x30')]);_0x818d44['offset']=qs[_0xa301('0x2e')](_0x2c199d[_0xa301('0x41')][_0xa301('0x2e')]);}return _0x217b6b[_0xa301('0xea')](_0x818d44);}})[_0xa301('0x1e')](function(_0x2bec2a){if(_0x2bec2a){return _0x2bec2a?{'count':_0x51b8ca,'rows':_0x2bec2a}:null;}})[_0xa301('0x1e')](respondWithResult(_0xb7d824,null))[_0xa301('0x29')](handleError(_0xb7d824,null));}; \ No newline at end of file +var _0x3a3a=['SmsApplication','account','orderBy','Applications','priority','asc','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','bandwidth','refid','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','omit','Contacts','CmContact','SmsInteraction','spread','interaction','created','autoclose','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','applications','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','waitForTheAssignedQueue','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','Content-Type','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','SmsAccount','includeAll','findAll','rows','show','keys','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','body','describe','addDisposition','SmsAccountId','getDispositions','findOne','order','include','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','notify'];(function(_0x38d644,_0x4f3058){var _0x23c0e8=function(_0x5e8ada){while(--_0x5e8ada){_0x38d644['push'](_0x38d644['shift']());}};_0x23c0e8(++_0x4f3058);}(_0x3a3a,0x166));var _0xa3a3=function(_0x4852f9,_0x4cc1fa){_0x4852f9=_0x4852f9-0x0;var _0x2daaf6=_0x3a3a[_0x4852f9];return _0x2daaf6;};'use strict';var emlformat=require(_0xa3a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3a3('0x1'));var jsonpatch=require(_0xa3a3('0x2'));var rp=require(_0xa3a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3a3('0x4'));var util=require(_0xa3a3('0x5'));var path=require(_0xa3a3('0x6'));var sox=require(_0xa3a3('0x7'));var csv=require(_0xa3a3('0x8'));var ejs=require(_0xa3a3('0x9'));var fs=require('fs');var fs_extra=require(_0xa3a3('0xa'));var _=require(_0xa3a3('0xb'));var squel=require(_0xa3a3('0xc'));var crypto=require(_0xa3a3('0xd'));var jsforce=require(_0xa3a3('0xe'));var deskjs=require(_0xa3a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa3a3('0x10'));var Papa=require(_0xa3a3('0x11'));var Redis=require(_0xa3a3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa3a3('0x13'));var as=require(_0xa3a3('0x14'));var hardwareService=require(_0xa3a3('0x15'));var logger=require(_0xa3a3('0x16'))(_0xa3a3('0x17'));var utils=require(_0xa3a3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa3a3('0x19'));var db=require(_0xa3a3('0x1a'))['db'];config['redis']=_[_0xa3a3('0x1b')](config['redis'],{'host':_0xa3a3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xa3a3('0x1d'));var client=jayson[_0xa3a3('0x1e')][_0xa3a3('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x151fb0,_0x566e4a,_0x145406,_0x4bf3e2){return new BPromise(function(_0x15fa80,_0x5a5b29){var _0x1d999b=_0x4bf3e2||client;return _0x1d999b[_0xa3a3('0x20')](_0x151fb0,_0x145406)['then'](function(_0x274368){logger[_0xa3a3('0x21')](_0xa3a3('0x22'),_0x566e4a,_0xa3a3('0x23'));logger[_0xa3a3('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x566e4a,'request\x20sent',JSON['stringify'](_0x274368));if(_0x274368[_0xa3a3('0x25')]){if(_0x274368[_0xa3a3('0x25')][_0xa3a3('0x26')]===0x1f4){logger[_0xa3a3('0x25')](_0xa3a3('0x22'),_0x566e4a,_0x274368[_0xa3a3('0x25')][_0xa3a3('0x27')]);return _0x5a5b29(_0x274368[_0xa3a3('0x25')][_0xa3a3('0x27')]);}logger['error'](_0xa3a3('0x22'),_0x566e4a,_0x274368[_0xa3a3('0x25')][_0xa3a3('0x27')]);return _0x15fa80(_0x274368[_0xa3a3('0x25')][_0xa3a3('0x27')]);}else{logger[_0xa3a3('0x21')](_0xa3a3('0x22'),_0x566e4a,_0xa3a3('0x23'));_0x15fa80(_0x274368[_0xa3a3('0x28')]['message']);}})[_0xa3a3('0x29')](function(_0x449919){logger['error'](_0xa3a3('0x22'),_0x566e4a,_0x449919);_0x5a5b29(_0x449919);});});}function respondWithStatusCode(_0x289e31,_0x426eb1){_0x426eb1=_0x426eb1||0xcc;return function(_0x3ace9d){if(_0x3ace9d){return _0x289e31[_0xa3a3('0x2a')](_0x426eb1);}return _0x289e31[_0xa3a3('0x2b')](_0x426eb1)[_0xa3a3('0x2c')]();};}function respondWithResult(_0x53479e,_0xa08808){_0xa08808=_0xa08808||0xc8;return function(_0x13d952){if(_0x13d952){return _0x53479e[_0xa3a3('0x2b')](_0xa08808)[_0xa3a3('0x2d')](_0x13d952);}};}function respondWithFilteredResult(_0x1ab54e,_0x308cae){return function(_0xf8ff77){if(_0xf8ff77){var _0x47faca=typeof _0x308cae[_0xa3a3('0x2e')]===_0xa3a3('0x2f')&&typeof _0x308cae[_0xa3a3('0x30')]===_0xa3a3('0x2f');var _0xe36407=_0xf8ff77[_0xa3a3('0x31')];var _0x498eca=_0x47faca?0x0:_0x308cae[_0xa3a3('0x2e')];var _0x3952e3=_0x47faca?_0xf8ff77[_0xa3a3('0x31')]:_0x308cae['offset']+_0x308cae[_0xa3a3('0x30')];var _0x3c5fb1;if(_0x3952e3>=_0xe36407){_0x3952e3=_0xe36407;_0x3c5fb1=0xc8;}else{_0x3c5fb1=0xce;}_0x1ab54e[_0xa3a3('0x2b')](_0x3c5fb1);return _0x1ab54e['set'](_0xa3a3('0x32'),_0x498eca+'-'+_0x3952e3+'/'+_0xe36407)['json'](_0xf8ff77);}return null;};}function patchUpdates(_0x1fb224){return function(_0x2d16e6){try{jsonpatch[_0xa3a3('0x33')](_0x2d16e6,_0x1fb224,!![]);}catch(_0x19bb19){return BPromise[_0xa3a3('0x34')](_0x19bb19);}return _0x2d16e6['save']();};}function saveUpdates(_0x11ea64,_0x1f6057){return function(_0x501369){if(_0x501369){return _0x501369['update'](_0x11ea64)[_0xa3a3('0x35')](function(_0x178eb4){return _0x178eb4;});}return null;};}function removeEntity(_0x3b8fc9,_0x577e8f){return function(_0x36cf93){if(_0x36cf93){return _0x36cf93[_0xa3a3('0x36')]()['then'](function(){var _0xc31339=_0x36cf93['get']({'plain':!![]});var _0x2cb998=_0xa3a3('0x37');return db[_0xa3a3('0x38')][_0xa3a3('0x36')]({'where':{'type':_0x2cb998,'resourceId':_0xc31339['id']}})[_0xa3a3('0x35')](function(){return _0x36cf93;});})[_0xa3a3('0x35')](function(){_0x3b8fc9[_0xa3a3('0x2b')](0xcc)[_0xa3a3('0x2c')]();});}};}function handleEntityNotFound(_0x8d4d36,_0x20c822){return function(_0x12e1fa){if(!_0x12e1fa){_0x8d4d36[_0xa3a3('0x2a')](0x194);}return _0x12e1fa;};}function handleError(_0x1a75ab,_0x5934f7){_0x5934f7=_0x5934f7||0x1f4;return function(_0x5e5ce6){logger['error'](_0x5e5ce6[_0xa3a3('0x39')]);if(_0x5e5ce6[_0xa3a3('0x3a')]){delete _0x5e5ce6[_0xa3a3('0x3a')];}_0x1a75ab[_0xa3a3('0x2b')](_0x5934f7)[_0xa3a3('0x3b')](_0x5e5ce6);};}exports['index']=function(_0x228c3d,_0x3a389b){var _0x8204e6={'include':[{'model':db[_0xa3a3('0x3c')],'as':_0xa3a3('0x3d')}]},_0x88117d={},_0x10c128={'count':0x0,'rows':[]};var _0x21090a=_[_0xa3a3('0x3e')](db['SmsAccount'][_0xa3a3('0x3f')],function(_0x4e01b0){return{'name':_0x4e01b0['fieldName'],'type':_0x4e01b0[_0xa3a3('0x40')][_0xa3a3('0x41')]};});_0x88117d[_0xa3a3('0x42')]=_[_0xa3a3('0x3e')](_0x21090a,'name');_0x88117d['query']=_['keys'](_0x228c3d[_0xa3a3('0x43')]);_0x88117d[_0xa3a3('0x44')]=_[_0xa3a3('0x45')](_0x88117d['model'],_0x88117d[_0xa3a3('0x43')]);_0x8204e6[_0xa3a3('0x46')]=_[_0xa3a3('0x45')](_0x88117d[_0xa3a3('0x42')],qs['fields'](_0x228c3d[_0xa3a3('0x43')]['fields']));_0x8204e6[_0xa3a3('0x46')]=_0x8204e6[_0xa3a3('0x46')][_0xa3a3('0x47')]?_0x8204e6['attributes']:_0x88117d[_0xa3a3('0x42')];if(!_0x228c3d['query'][_0xa3a3('0x48')](_0xa3a3('0x49'))){_0x8204e6[_0xa3a3('0x30')]=qs[_0xa3a3('0x30')](_0x228c3d[_0xa3a3('0x43')][_0xa3a3('0x30')]);_0x8204e6[_0xa3a3('0x2e')]=qs[_0xa3a3('0x2e')](_0x228c3d['query'][_0xa3a3('0x2e')]);}_0x8204e6['order']=qs[_0xa3a3('0x4a')](_0x228c3d['query'][_0xa3a3('0x4a')]);_0x8204e6[_0xa3a3('0x4b')]=qs[_0xa3a3('0x44')](_['pick'](_0x228c3d['query'],_0x88117d[_0xa3a3('0x44')]),_0x21090a);if(_0x228c3d[_0xa3a3('0x43')][_0xa3a3('0x4c')]){_0x8204e6[_0xa3a3('0x4b')]=_[_0xa3a3('0x4d')](_0x8204e6[_0xa3a3('0x4b')],{'$or':_[_0xa3a3('0x3e')](_0x21090a,function(_0x28da40){if(_0x28da40['type']!==_0xa3a3('0x4e')){var _0xb0e4e6={};_0xb0e4e6[_0x28da40[_0xa3a3('0x3a')]]={'$like':'%'+_0x228c3d[_0xa3a3('0x43')][_0xa3a3('0x4c')]+'%'};return _0xb0e4e6;}})});}_0x8204e6=_[_0xa3a3('0x4d')]({},_0x8204e6,_0x228c3d[_0xa3a3('0x4f')]);var _0x11c72b={'where':_0x8204e6[_0xa3a3('0x4b')]};return db[_0xa3a3('0x50')][_0xa3a3('0x31')](_0x11c72b)[_0xa3a3('0x35')](function(_0x5a3152){_0x10c128[_0xa3a3('0x31')]=_0x5a3152;if(_0x228c3d['query'][_0xa3a3('0x51')]){_0x8204e6['include']=[{'all':!![]}];}return db[_0xa3a3('0x50')][_0xa3a3('0x52')](_0x8204e6);})[_0xa3a3('0x35')](function(_0x1fda30){_0x10c128[_0xa3a3('0x53')]=_0x1fda30;return _0x10c128;})['then'](respondWithFilteredResult(_0x3a389b,_0x8204e6))[_0xa3a3('0x29')](handleError(_0x3a389b,null));};exports[_0xa3a3('0x54')]=function(_0x379567,_0x2a8404){var _0x54bb0b={'raw':![],'where':{'id':_0x379567['params']['id']},'include':[{'model':db[_0xa3a3('0x3c')],'as':'mandatoryDispositionPause'}]},_0x258d1c={};_0x258d1c[_0xa3a3('0x42')]=_[_0xa3a3('0x55')](db[_0xa3a3('0x50')][_0xa3a3('0x3f')]);_0x258d1c[_0xa3a3('0x43')]=_[_0xa3a3('0x55')](_0x379567[_0xa3a3('0x43')]);_0x258d1c['filters']=_['intersection'](_0x258d1c[_0xa3a3('0x42')],_0x258d1c['query']);_0x54bb0b[_0xa3a3('0x46')]=_[_0xa3a3('0x45')](_0x258d1c[_0xa3a3('0x42')],qs[_0xa3a3('0x56')](_0x379567[_0xa3a3('0x43')][_0xa3a3('0x56')]));_0x54bb0b[_0xa3a3('0x46')]=_0x54bb0b[_0xa3a3('0x46')][_0xa3a3('0x47')]?_0x54bb0b['attributes']:_0x258d1c[_0xa3a3('0x42')];if(_0x379567[_0xa3a3('0x43')][_0xa3a3('0x51')]){_0x54bb0b['include']=[{'all':!![]}];}_0x54bb0b=_['merge']({},_0x54bb0b,_0x379567['options']);return db[_0xa3a3('0x50')][_0xa3a3('0x57')](_0x54bb0b)[_0xa3a3('0x35')](handleEntityNotFound(_0x2a8404,null))[_0xa3a3('0x35')](respondWithResult(_0x2a8404,null))[_0xa3a3('0x29')](handleError(_0x2a8404,null));};exports[_0xa3a3('0x58')]=function(_0x28b239,_0x30ffc5){return db[_0xa3a3('0x50')][_0xa3a3('0x58')](_0x28b239['body'],{})[_0xa3a3('0x35')](function(_0x4fe016){var _0x15f1d0=_0x28b239[_0xa3a3('0x59')][_0xa3a3('0x5a')]({'plain':!![]});if(!_0x15f1d0)throw new Error(_0xa3a3('0x5b'));if(_0x15f1d0['role']===_0xa3a3('0x59')){var _0x5db6c7=_0x4fe016[_0xa3a3('0x5a')]({'plain':!![]});var _0x15677e=_0xa3a3('0x37');return db['UserProfileSection']['find']({'where':{'name':_0x15677e,'userProfileId':_0x15f1d0[_0xa3a3('0x5c')]},'raw':!![]})[_0xa3a3('0x35')](function(_0x2d190c){if(_0x2d190c&&_0x2d190c[_0xa3a3('0x5d')]===0x0){return db[_0xa3a3('0x38')][_0xa3a3('0x58')]({'name':_0x5db6c7[_0xa3a3('0x3a')],'resourceId':_0x5db6c7['id'],'type':_0x2d190c['name'],'sectionId':_0x2d190c['id']},{})[_0xa3a3('0x35')](function(){return _0x4fe016;});}else{return _0x4fe016;}})[_0xa3a3('0x29')](function(_0x5a290f){logger[_0xa3a3('0x25')](_0xa3a3('0x5e'),_0x5a290f);throw _0x5a290f;});}return _0x4fe016;})[_0xa3a3('0x35')](respondWithResult(_0x30ffc5,0xc9))['catch'](handleError(_0x30ffc5,null));};exports[_0xa3a3('0x5f')]=function(_0x289317,_0x4c577f){if(_0x289317['body']['id']){delete _0x289317['body']['id'];}return db[_0xa3a3('0x50')]['find']({'where':{'id':_0x289317[_0xa3a3('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xa3a3('0x3d')}]})['then'](handleEntityNotFound(_0x4c577f,null))['then'](saveUpdates(_0x289317[_0xa3a3('0x61')],null))['then'](respondWithResult(_0x4c577f,null))[_0xa3a3('0x29')](handleError(_0x4c577f,null));};exports[_0xa3a3('0x36')]=function(_0x14908e,_0x3f5407){return db[_0xa3a3('0x50')][_0xa3a3('0x57')]({'where':{'id':_0x14908e[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x3f5407,null))[_0xa3a3('0x35')](removeEntity(_0x3f5407,null))[_0xa3a3('0x29')](handleError(_0x3f5407,null));};exports[_0xa3a3('0x62')]=function(_0xe177c,_0x1ad3bb){return db[_0xa3a3('0x50')][_0xa3a3('0x62')]()[_0xa3a3('0x35')](respondWithResult(_0x1ad3bb,null))[_0xa3a3('0x29')](handleError(_0x1ad3bb,null));};exports[_0xa3a3('0x63')]=function(_0x2aa895,_0x6b3928,_0x4b87bf){if(_0x2aa895[_0xa3a3('0x61')]['id']){delete _0x2aa895[_0xa3a3('0x61')]['id'];}return db[_0xa3a3('0x50')][_0xa3a3('0x57')]({'where':{'id':_0x2aa895[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x6b3928,null))['then'](function(_0x5a9c29){if(_0x5a9c29){_0x2aa895[_0xa3a3('0x61')][_0xa3a3('0x64')]=_0x5a9c29['id'];return db['Disposition'][_0xa3a3('0x58')](_0x2aa895['body']);}})[_0xa3a3('0x35')](respondWithResult(_0x6b3928,null))['catch'](handleError(_0x6b3928,null));};exports[_0xa3a3('0x65')]=function(_0x2cc534,_0x3e7e0d,_0x4c7b30){var _0x1b7e02={'raw':![],'where':{}};var _0x1eb853={};var _0x27cc44={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa3a3('0x66')]({'where':{'id':_0x2cc534[_0xa3a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x3e7e0d,null))[_0xa3a3('0x35')](function(_0x4ec164){if(_0x4ec164){_0x1eb853[_0xa3a3('0x42')]=_['keys'](db['Disposition'][_0xa3a3('0x3f')]);_0x1eb853['query']=_[_0xa3a3('0x55')](_0x2cc534['query']);_0x1eb853['filters']=_[_0xa3a3('0x45')](_0x1eb853['model'],_0x1eb853['query']);_0x1b7e02[_0xa3a3('0x46')]=_[_0xa3a3('0x45')](_0x1eb853[_0xa3a3('0x42')],qs['fields'](_0x2cc534[_0xa3a3('0x43')][_0xa3a3('0x56')]));_0x1b7e02[_0xa3a3('0x46')]=_0x1b7e02[_0xa3a3('0x46')][_0xa3a3('0x47')]?_0x1b7e02[_0xa3a3('0x46')]:_0x1eb853[_0xa3a3('0x42')];if(!_0x2cc534['query'][_0xa3a3('0x48')](_0xa3a3('0x49'))){_0x1b7e02[_0xa3a3('0x30')]=qs[_0xa3a3('0x30')](_0x2cc534[_0xa3a3('0x43')]['limit']);_0x1b7e02[_0xa3a3('0x2e')]=qs['offset'](_0x2cc534[_0xa3a3('0x43')]['offset']);}_0x1b7e02[_0xa3a3('0x67')]=qs[_0xa3a3('0x4a')](_0x2cc534[_0xa3a3('0x43')]['sort']);_0x1b7e02['where']=qs[_0xa3a3('0x44')](_['pick'](_0x2cc534['query'],_0x1eb853[_0xa3a3('0x44')]));_0x1b7e02[_0xa3a3('0x4b')][_0xa3a3('0x64')]=_0x4ec164['id'];if(_0x2cc534['query'][_0xa3a3('0x4c')]){_0x1b7e02[_0xa3a3('0x4b')]=_[_0xa3a3('0x4d')](_0x1b7e02[_0xa3a3('0x4b')],{'$or':_[_0xa3a3('0x3e')](_0x1b7e02[_0xa3a3('0x46')],function(_0x21419b){var _0x3f5cb7={};_0x3f5cb7[_0x21419b]={'$like':'%'+_0x2cc534[_0xa3a3('0x43')][_0xa3a3('0x4c')]+'%'};return _0x3f5cb7;})});}_0x1b7e02=_[_0xa3a3('0x4d')]({},_0x1b7e02,_0x2cc534[_0xa3a3('0x4f')]);return db['Disposition'][_0xa3a3('0x31')]({'where':_0x1b7e02[_0xa3a3('0x4b')]})[_0xa3a3('0x35')](function(_0x1f3bf7){_0x27cc44[_0xa3a3('0x31')]=_0x1f3bf7;if(_0x2cc534[_0xa3a3('0x43')]['includeAll']){_0x1b7e02[_0xa3a3('0x68')]=[{'all':!![]}];}return db[_0xa3a3('0x69')][_0xa3a3('0x52')](_0x1b7e02);})[_0xa3a3('0x35')](function(_0x48bbeb){_0x27cc44[_0xa3a3('0x53')]=_0x48bbeb;return _0x27cc44;});}})[_0xa3a3('0x35')](respondWithFilteredResult(_0x3e7e0d,_0x1b7e02))[_0xa3a3('0x29')](handleError(_0x3e7e0d,null));};exports[_0xa3a3('0x6a')]=function(_0x231e41,_0x3b7fd2,_0x32faa6){return db[_0xa3a3('0x50')][_0xa3a3('0x57')]({'where':{'id':_0x231e41[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x3b7fd2,null))[_0xa3a3('0x35')](function(_0x4ad2c9){if(_0x4ad2c9){return _0x4ad2c9['removeDispositions'](_0x231e41['query'][_0xa3a3('0x6b')]);}})['then'](respondWithStatusCode(_0x3b7fd2,null))[_0xa3a3('0x29')](handleError(_0x3b7fd2,null));};exports[_0xa3a3('0x6c')]=function(_0x3e5e6e,_0x5c9f73,_0x536873){if(_0x3e5e6e[_0xa3a3('0x61')]['id']){delete _0x3e5e6e[_0xa3a3('0x61')]['id'];}return db[_0xa3a3('0x50')][_0xa3a3('0x57')]({'where':{'id':_0x3e5e6e[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x5c9f73,null))['then'](function(_0x4c614d){if(_0x4c614d){_0x3e5e6e[_0xa3a3('0x61')][_0xa3a3('0x64')]=_0x4c614d['id'];return db[_0xa3a3('0x6d')]['create'](_0x3e5e6e[_0xa3a3('0x61')]);}})[_0xa3a3('0x35')](respondWithResult(_0x5c9f73,null))[_0xa3a3('0x29')](handleError(_0x5c9f73,null));};exports[_0xa3a3('0x6e')]=function(_0x958e63,_0xeb9485,_0x1d24e8){var _0xb9a085={'raw':![],'where':{}};var _0x2c58ea={};var _0xe76545={'count':0x0,'rows':[]};return db[_0xa3a3('0x50')][_0xa3a3('0x66')]({'where':{'id':_0x958e63['params']['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0xeb9485,null))[_0xa3a3('0x35')](function(_0x1d502c){if(_0x1d502c){_0x2c58ea['model']=_[_0xa3a3('0x55')](db[_0xa3a3('0x6d')]['rawAttributes']);_0x2c58ea['query']=_[_0xa3a3('0x55')](_0x958e63[_0xa3a3('0x43')]);_0x2c58ea[_0xa3a3('0x44')]=_[_0xa3a3('0x45')](_0x2c58ea[_0xa3a3('0x42')],_0x2c58ea['query']);_0xb9a085[_0xa3a3('0x46')]=_[_0xa3a3('0x45')](_0x2c58ea['model'],qs[_0xa3a3('0x56')](_0x958e63[_0xa3a3('0x43')][_0xa3a3('0x56')]));_0xb9a085['attributes']=_0xb9a085[_0xa3a3('0x46')][_0xa3a3('0x47')]?_0xb9a085[_0xa3a3('0x46')]:_0x2c58ea['model'];if(!_0x958e63['query']['hasOwnProperty'](_0xa3a3('0x49'))){_0xb9a085['limit']=qs[_0xa3a3('0x30')](_0x958e63[_0xa3a3('0x43')][_0xa3a3('0x30')]);_0xb9a085[_0xa3a3('0x2e')]=qs[_0xa3a3('0x2e')](_0x958e63[_0xa3a3('0x43')][_0xa3a3('0x2e')]);}_0xb9a085[_0xa3a3('0x67')]=qs[_0xa3a3('0x4a')](_0x958e63['query'][_0xa3a3('0x4a')]);_0xb9a085['where']=qs['filters'](_[_0xa3a3('0x6f')](_0x958e63[_0xa3a3('0x43')],_0x2c58ea[_0xa3a3('0x44')]));_0xb9a085[_0xa3a3('0x4b')][_0xa3a3('0x64')]=_0x1d502c['id'];if(_0x958e63['query']['filter']){_0xb9a085[_0xa3a3('0x4b')]=_['merge'](_0xb9a085[_0xa3a3('0x4b')],{'$or':_[_0xa3a3('0x3e')](_0xb9a085[_0xa3a3('0x46')],function(_0x475264){var _0xa33389={};_0xa33389[_0x475264]={'$like':'%'+_0x958e63[_0xa3a3('0x43')][_0xa3a3('0x4c')]+'%'};return _0xa33389;})});}_0xb9a085=_[_0xa3a3('0x4d')]({},_0xb9a085,_0x958e63[_0xa3a3('0x4f')]);return db[_0xa3a3('0x6d')][_0xa3a3('0x31')]({'where':_0xb9a085['where']})[_0xa3a3('0x35')](function(_0x23f49c){_0xe76545['count']=_0x23f49c;if(_0x958e63['query'][_0xa3a3('0x51')]){_0xb9a085['include']=[{'all':!![]}];}return db[_0xa3a3('0x6d')][_0xa3a3('0x52')](_0xb9a085);})['then'](function(_0xd5e180){_0xe76545[_0xa3a3('0x53')]=_0xd5e180;return _0xe76545;});}})[_0xa3a3('0x35')](respondWithFilteredResult(_0xeb9485,_0xb9a085))[_0xa3a3('0x29')](handleError(_0xeb9485,null));};exports[_0xa3a3('0x70')]=function(_0x293d09,_0x4b21ea,_0x32b329){return db['SmsAccount']['find']({'where':{'id':_0x293d09[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x4b21ea,null))['then'](function(_0x476578){if(_0x476578){return _0x476578[_0xa3a3('0x70')](_0x293d09[_0xa3a3('0x43')]['ids']);}})[_0xa3a3('0x35')](respondWithStatusCode(_0x4b21ea,null))[_0xa3a3('0x29')](handleError(_0x4b21ea,null));};exports[_0xa3a3('0x71')]=function(_0x170528,_0x496515,_0x2c7e44){var _0x22f73f={'channel':'sms'};var _0x3080a5=[];var _0x186d45=[];var _0x42acbd={};return db[_0xa3a3('0x50')][_0xa3a3('0x57')]({'where':{'id':_0x170528[_0xa3a3('0x60')]['id']},'include':[{'model':db[_0xa3a3('0x72')],'as':'Applications'}]})[_0xa3a3('0x35')](handleEntityNotFound(_0x496515,null))[_0xa3a3('0x35')](function(_0x26d5b9){_0x22f73f[_0xa3a3('0x73')]=_0x26d5b9;_0x22f73f['applications']=_[_0xa3a3('0x74')](_0x26d5b9[_0xa3a3('0x75')],[_0xa3a3('0x76')],[_0xa3a3('0x77')]);if(_0x22f73f['account'][_0xa3a3('0x75')]){delete _0x22f73f['account'][_0xa3a3('0x75')];}return db['CmContact'][_0xa3a3('0x62')]();})[_0xa3a3('0x35')](function(_0x21fdd6){if(!_0x21fdd6){throw new db[(_0xa3a3('0x78'))][(_0xa3a3('0x79'))]('no\x20available\x20attributes');}_0x3080a5=_[_0xa3a3('0x7a')](_[_0xa3a3('0x55')](_0x21fdd6),['createdAt',_0xa3a3('0x7b')]);_0x186d45=_[_0xa3a3('0x7a')](_[_0xa3a3('0x55')](_0x21fdd6),[_0xa3a3('0x7c'),_0xa3a3('0x7b'),_0xa3a3('0x7d'),_0xa3a3('0x7e')]);_0x22f73f['body']={'mapKey':_0xa3a3('0x7f')};if(_0x22f73f[_0xa3a3('0x73')][_0xa3a3('0x40')]){switch(_0x22f73f[_0xa3a3('0x73')][_0xa3a3('0x40')]){case _0xa3a3('0x80'):_0x22f73f[_0xa3a3('0x61')]['from']=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x81')];_0x22f73f['body'][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x82')];_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x83')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x84')];break;case'skebby':_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')]='+'+_0x170528['body'][_0xa3a3('0x86')];_0x22f73f['body']['body']=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x87')];break;case _0xa3a3('0x88'):_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')]=_0x170528['body']['from'];_0x22f73f['body'][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x27')];break;case _0xa3a3('0x89'):_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x85')];_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x61')];_0x22f73f['body'][_0xa3a3('0x83')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x8a')];break;case _0xa3a3('0x8b'):_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x81')];_0x22f73f[_0xa3a3('0x61')]['body']=_0x170528['body'][_0xa3a3('0x8c')];_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x83')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x8d')];break;case _0xa3a3('0x8e'):_0x22f73f['body'][_0xa3a3('0x85')]='+'+_0x170528[_0xa3a3('0x61')][_0xa3a3('0x8f')][0x0][_0xa3a3('0x85')];_0x22f73f['body'][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x8f')][0x0][_0xa3a3('0x87')];_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x83')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x8f')][0x0]['messageId'];break;case _0xa3a3('0x90'):_0x22f73f['body'][_0xa3a3('0x85')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x91')];_0x22f73f['body'][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')]['segmentedMessage']['message'];break;case _0xa3a3('0x92'):_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x93')];_0x22f73f['body'][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x87')];_0x22f73f[_0xa3a3('0x61')]['messageId']=_0x170528['body']['replyMessageId'];break;case _0xa3a3('0x94'):_0x22f73f['body'][_0xa3a3('0x83')]=_0x170528[_0xa3a3('0x61')][0x0][_0xa3a3('0x27')]['id'];_0x22f73f[_0xa3a3('0x61')]['from']=_0x170528['body'][0x0]['message'][_0xa3a3('0x85')];_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x61')]=_0x170528['body'][0x0][_0xa3a3('0x27')][_0xa3a3('0x87')];break;case'intelepeer':_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')]=_0x170528['body'][_0xa3a3('0x85')];_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x61')]=_0x170528[_0xa3a3('0x61')]['message'];_0x22f73f[_0xa3a3('0x61')]['messageId']=_0x170528[_0xa3a3('0x61')][_0xa3a3('0x95')];break;}}if(_0x22f73f[_0xa3a3('0x61')]['id']){delete _0x22f73f[_0xa3a3('0x61')]['id'];}if(_['isNil'](_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')])){throw new db[(_0xa3a3('0x78'))][(_0xa3a3('0x79'))](_0xa3a3('0x96'));}if(_[_0xa3a3('0x97')](_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x61')])||_0x22f73f[_0xa3a3('0x61')]['body']===''){throw new db[(_0xa3a3('0x78'))][(_0xa3a3('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa3a3('0x97')](_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x98')])){throw new db['Sequelize'][(_0xa3a3('0x79'))](_0xa3a3('0x99')+_0x186d45);}if(!_[_0xa3a3('0x9a')](_0x186d45,_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x98')])){throw new db[(_0xa3a3('0x78'))][(_0xa3a3('0x79'))](_0xa3a3('0x9b')+_0x186d45);}_0x42acbd[_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x98')]]=_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')];return db['CmList'][_0xa3a3('0x57')]({'where':{'id':_0x22f73f[_0xa3a3('0x73')][_0xa3a3('0x7e')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x42acbd,'limit':0x1,'order':[[_0xa3a3('0x7b'),_0xa3a3('0x9c')]]}]});})[_0xa3a3('0x35')](handleEntityNotFound(_0x496515,null))[_0xa3a3('0x35')](function(_0x45aadf){if(_0x45aadf){_0x22f73f['list']=_[_0xa3a3('0x9d')](_0x45aadf,[_0xa3a3('0x9e')]);if(_0x45aadf[_0xa3a3('0x9e')][_0xa3a3('0x47')]){return _0x45aadf[_0xa3a3('0x9e')][0x0];}var _0x22eecd=_[_0xa3a3('0x1b')](_0x22f73f[_0xa3a3('0x61')],{'firstName':_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')],'ListId':_0x45aadf['id']});_0x22eecd[_0x22f73f[_0xa3a3('0x61')]['mapKey']]=_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x85')];return db[_0xa3a3('0x9f')]['create'](_0x22eecd,{'fields':_0x3080a5,'raw':!![]});}})[_0xa3a3('0x35')](handleEntityNotFound(_0x496515,null))[_0xa3a3('0x35')](function(_0x435aea){if(_0x435aea){_0x22f73f['contact']=_0x435aea;var _0x4c78c2={'ContactId':_0x435aea['id'],'phone':_0x22f73f['body'][_0xa3a3('0x85')],'SmsAccountId':_0x170528[_0xa3a3('0x60')]['id']};var _0xf44c2c={'ContactId':_0x435aea['id'],'SmsAccountId':_0x170528[_0xa3a3('0x60')]['id'],'closed':![]};return db[_0xa3a3('0xa0')][_0xa3a3('0x57')]({'where':_0xf44c2c})[_0xa3a3('0x35')](function(_0x27c02f){if(_0x27c02f){return[_0x27c02f,![]];}return db[_0xa3a3('0xa0')][_0xa3a3('0x58')](_0x4c78c2)[_0xa3a3('0x35')](function(_0x4133e2){return[_0x4133e2,!![]];});});}})[_0xa3a3('0xa1')](function(_0x18eff4,_0x51b023){_0x22f73f[_0xa3a3('0xa2')]=_0x18eff4[_0xa3a3('0x5a')]({'plain':!![]});_0x22f73f[_0xa3a3('0xa2')][_0xa3a3('0xa3')]=![];if(_0x51b023){if(_0x22f73f[_0xa3a3('0x73')][_0xa3a3('0xa4')]){_0x22f73f['applications']['push']({'id':0x0,'priority':_0x22f73f['applications'][_0xa3a3('0x47')]+0x1,'app':_0xa3a3('0xa5'),'appdata':'unmanaged','interval':_0xa3a3('0xa6')});}_0x22f73f['interaction']['created']=!![];}return db[_0xa3a3('0xa7')]['create']({'phone':_0x22f73f[_0xa3a3('0x61')]['from'],'messageId':_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x83')],'body':_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0x61')],'SmsAccountId':_0x170528['params']['id'],'SmsInteractionId':_0x18eff4['id'],'direction':'in','ContactId':_0x18eff4[_0xa3a3('0xa8')],'AttachmentId':_0x22f73f[_0xa3a3('0x61')][_0xa3a3('0xa9')]});})[_0xa3a3('0x35')](function(_0x2f0d91){_0x22f73f[_0xa3a3('0x27')]=_0x2f0d91;if(!_0x22f73f[_0xa3a3('0xa2')][_0xa3a3('0xaa')])return;return db[_0xa3a3('0xab')]['find']({'attributes':['id',_0xa3a3('0x3a')],'where':{'id':_0x22f73f[_0xa3a3('0xa2')]['UserId']}});})[_0xa3a3('0x35')](function(_0x3bd651){if(_0x3bd651){_0x22f73f[_0xa3a3('0xac')][_0xa3a3('0xad')]({'id':0x0,'priority':0x0,'app':_0xa3a3('0xae'),'appdata':_0x3bd651[_0xa3a3('0x3a')]+','+(_0x22f73f['account'][_0xa3a3('0xaf')]||0xa),'interval':'*,*,*,*'});}if(!_0x22f73f[_0xa3a3('0xa2')][_0xa3a3('0xb0')])return;return db[_0xa3a3('0xb1')][_0xa3a3('0x57')]({'attributes':['id',_0xa3a3('0x3a')],'where':{'id':_0x22f73f['interaction'][_0xa3a3('0xb0')]}});})[_0xa3a3('0x35')](function(_0x36844e){if(_0x36844e){_0x22f73f['applications']['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x36844e[_0xa3a3('0x3a')]+','+(_0x22f73f[_0xa3a3('0x73')][_0xa3a3('0xb2')]||0x12c),'interval':_0xa3a3('0xa6')});}return respondWithRpcPromise('Start',_0xa3a3('0xb3'),_0x22f73f);})[_0xa3a3('0x35')](function(_0x5b6641){if(_0x5b6641){var _0x4ef069=0xc8;var _0x36ddfd='receiveMessage';logger[_0xa3a3('0x21')](_0xa3a3('0xb4'),_0x36ddfd,_0x4ef069,_0xa3a3('0xb5'));logger[_0xa3a3('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x36ddfd,_0x4ef069,_0xa3a3('0xb5'),JSON[_0xa3a3('0xb6')](_0x5b6641));if(_0x22f73f[_0xa3a3('0x73')][_0xa3a3('0x40')]==='twilio'){return _0x496515['status'](_0x4ef069)[_0xa3a3('0xb7')](_0xa3a3('0xb8'),'text/xml')[_0xa3a3('0x3b')](_0xa3a3('0xb9'));}else{return _0x496515[_0xa3a3('0x2b')](_0x4ef069)[_0xa3a3('0x2d')](_0x5b6641);}}})['catch'](handleError(_0x496515,null));};exports[_0xa3a3('0xba')]=function(_0x49c462,_0x48c776){var _0x57edfc=_0x49c462[_0xa3a3('0x60')]['id'];var _0x1aba6f=_0x49c462[_0xa3a3('0x61')];var _0x4d1295=0xc8;var _0x41c13f=null;return db[_0xa3a3('0xbb')][_0xa3a3('0xbc')]({'isolationLevel':db['sequelize']['Transaction'][_0xa3a3('0xbd')][_0xa3a3('0xbe')]},function(_0x730d26){return db['SmsAccount'][_0xa3a3('0x66')]({'where':{'id':_0x57edfc},'transaction':_0x730d26})[_0xa3a3('0x35')](function(_0x72c1ca){if(_0x72c1ca){return db['SmsApplication'][_0xa3a3('0x36')]({'where':{'SmsAccountId':_0x57edfc},'transaction':_0x730d26})['then'](function(){var _0x5da2b0=_[_0xa3a3('0x3e')](_0x1aba6f,function(_0x47669b){_0x47669b[_0xa3a3('0x64')]=_0x57edfc;return _0x47669b;});return db['SmsApplication'][_0xa3a3('0xbf')](_0x5da2b0,{'transaction':_0x730d26});});}else{_0x4d1295=0x194;_0x41c13f=[];}});})[_0xa3a3('0x35')](function(){if(_0x4d1295!==0x194){return db[_0xa3a3('0x72')][_0xa3a3('0xc0')]({'where':{'SmsAccountId':_0x57edfc},'order':_0xa3a3('0x76')})[_0xa3a3('0x35')](function(_0x298a7b){_0x41c13f=_0x298a7b;});}})[_0xa3a3('0x29')](function(_0x406ffd){_0x4d1295=0x1f4;logger[_0xa3a3('0x25')](_0x406ffd['stack']);if(_0x406ffd['name']){delete _0x406ffd[_0xa3a3('0x3a')];}_0x41c13f=_0x406ffd;})[_0xa3a3('0xc1')](function(){if(_0x41c13f===null){_0x48c776[_0xa3a3('0x2a')](_0x4d1295);}else{if(_0x4d1295===0x1f4){_0x48c776[_0xa3a3('0x2b')](_0x4d1295)[_0xa3a3('0x3b')](_0x41c13f);}else{_0x48c776[_0xa3a3('0x2b')](_0x4d1295)[_0xa3a3('0x2d')](_0x41c13f);}}});};exports[_0xa3a3('0xc2')]=function(_0x24c5b7,_0x5615bb,_0x5ab75e){var _0x211946={};var _0x8e758={};var _0x264eb5;var _0xfc52f3;return db[_0xa3a3('0x50')][_0xa3a3('0x66')]({'where':{'id':_0x24c5b7[_0xa3a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x5615bb,null))[_0xa3a3('0x35')](function(_0x5402ca){if(_0x5402ca){_0x264eb5=_0x5402ca;_0x8e758['model']=_[_0xa3a3('0x55')](db[_0xa3a3('0x72')]['rawAttributes']);_0x8e758[_0xa3a3('0x43')]=_[_0xa3a3('0x55')](_0x24c5b7[_0xa3a3('0x43')]);_0x8e758[_0xa3a3('0x44')]=_['intersection'](_0x8e758[_0xa3a3('0x42')],_0x8e758['query']);_0x211946[_0xa3a3('0x46')]=_[_0xa3a3('0x45')](_0x8e758[_0xa3a3('0x42')],qs[_0xa3a3('0x56')](_0x24c5b7[_0xa3a3('0x43')]['fields']));_0x211946['attributes']=_0x211946['attributes'][_0xa3a3('0x47')]?_0x211946['attributes']:_0x8e758[_0xa3a3('0x42')];_0x211946[_0xa3a3('0x67')]=qs['sort'](_0x24c5b7[_0xa3a3('0x43')]['sort']);_0x211946[_0xa3a3('0x4b')]=qs[_0xa3a3('0x44')](_[_0xa3a3('0x6f')](_0x24c5b7[_0xa3a3('0x43')],_0x8e758[_0xa3a3('0x44')]));if(_0x24c5b7[_0xa3a3('0x43')][_0xa3a3('0x4c')]){_0x211946['where']=_[_0xa3a3('0x4d')](_0x211946[_0xa3a3('0x4b')],{'$or':_[_0xa3a3('0x3e')](_0x211946[_0xa3a3('0x46')],function(_0x932a7){var _0x555532={};_0x555532[_0x932a7]={'$like':'%'+_0x24c5b7['query']['filter']+'%'};return _0x555532;})});}_0x211946=_['merge']({},_0x211946,_0x24c5b7['options']);return _0x264eb5[_0xa3a3('0xc2')](_0x211946);}})['then'](function(_0x38d012){if(_0x38d012){_0xfc52f3=_0x38d012['length'];if(!_0x24c5b7[_0xa3a3('0x43')][_0xa3a3('0x48')](_0xa3a3('0x49'))){_0x211946[_0xa3a3('0x30')]=qs[_0xa3a3('0x30')](_0x24c5b7[_0xa3a3('0x43')][_0xa3a3('0x30')]);_0x211946[_0xa3a3('0x2e')]=qs[_0xa3a3('0x2e')](_0x24c5b7[_0xa3a3('0x43')][_0xa3a3('0x2e')]);}return _0x264eb5[_0xa3a3('0xc2')](_0x211946);}})['then'](function(_0x3d072a){if(_0x3d072a){return _0x3d072a?{'count':_0xfc52f3,'rows':_0x3d072a}:null;}})['then'](respondWithResult(_0x5615bb,null))[_0xa3a3('0x29')](handleError(_0x5615bb,null));};exports[_0xa3a3('0xc3')]=function(_0x539b8a,_0x7af6ef,_0x3bcf9d){var _0x499b71={'raw':![],'where':{}};var _0x207337={};var _0xda9a88={'count':0x0,'rows':[]};return db[_0xa3a3('0x50')]['findOne']({'where':{'id':_0x539b8a['params']['id']}})['then'](handleEntityNotFound(_0x7af6ef,null))[_0xa3a3('0x35')](function(_0x1736ec){if(_0x1736ec){_0x207337[_0xa3a3('0x42')]=_[_0xa3a3('0x55')](db[_0xa3a3('0xa0')][_0xa3a3('0x3f')]);_0x207337[_0xa3a3('0x43')]=_[_0xa3a3('0x55')](_0x539b8a['query']);_0x207337['filters']=_[_0xa3a3('0x45')](_0x207337[_0xa3a3('0x42')],_0x207337[_0xa3a3('0x43')]);_0x499b71['attributes']=_[_0xa3a3('0x45')](_0x207337['model'],qs[_0xa3a3('0x56')](_0x539b8a['query'][_0xa3a3('0x56')]));_0x499b71[_0xa3a3('0x46')]=_0x499b71[_0xa3a3('0x46')][_0xa3a3('0x47')]?_0x499b71['attributes']:_0x207337[_0xa3a3('0x42')];if(!_0x539b8a['query']['hasOwnProperty'](_0xa3a3('0x49'))){_0x499b71[_0xa3a3('0x30')]=qs['limit'](_0x539b8a['query'][_0xa3a3('0x30')]);_0x499b71['offset']=qs['offset'](_0x539b8a['query']['offset']);}_0x499b71[_0xa3a3('0x67')]=qs['sort'](_0x539b8a['query'][_0xa3a3('0x4a')]);_0x499b71[_0xa3a3('0x4b')]=qs[_0xa3a3('0x44')](_['pick'](_0x539b8a[_0xa3a3('0x43')],_0x207337[_0xa3a3('0x44')]));_0x499b71[_0xa3a3('0x4b')][_0xa3a3('0x64')]=_0x1736ec['id'];if(_0x539b8a[_0xa3a3('0x43')][_0xa3a3('0x4c')]){_0x499b71['where']=_[_0xa3a3('0x4d')](_0x499b71[_0xa3a3('0x4b')],{'$or':_[_0xa3a3('0x3e')](_0x499b71['attributes'],function(_0x1ecf06){var _0x2d79e5={};_0x2d79e5[_0x1ecf06]={'$like':'%'+_0x539b8a[_0xa3a3('0x43')][_0xa3a3('0x4c')]+'%'};return _0x2d79e5;})});}_0x499b71=_[_0xa3a3('0x4d')]({},_0x499b71,_0x539b8a[_0xa3a3('0x4f')]);return db[_0xa3a3('0xa0')][_0xa3a3('0x31')]({'where':_0x499b71['where']})[_0xa3a3('0x35')](function(_0x123bfd){_0xda9a88[_0xa3a3('0x31')]=_0x123bfd;if(_0x539b8a['query'][_0xa3a3('0x51')]){_0x499b71[_0xa3a3('0x68')]=[{'model':db[_0xa3a3('0x9f')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xa3a3('0xc4'),'attributes':[_0xa3a3('0x3a'),_0xa3a3('0xc5'),_0xa3a3('0xc6')],'required':![]},{'model':db['Tag'],'as':_0xa3a3('0xc7'),'attributes':['id',_0xa3a3('0x3a'),_0xa3a3('0xc8')],'where':_0x539b8a[_0xa3a3('0x43')][_0xa3a3('0xc9')]?{'id':_0x539b8a['query'][_0xa3a3('0xc9')]}:undefined,'required':_0x539b8a[_0xa3a3('0x43')][_0xa3a3('0xc9')]?!![]:![]}];}return db[_0xa3a3('0xa0')][_0xa3a3('0x52')](_0x499b71);})['then'](function(_0x4b5cad){_0xda9a88[_0xa3a3('0x53')]=_0x4b5cad;return _0xda9a88;});}})[_0xa3a3('0x35')](respondWithFilteredResult(_0x7af6ef,_0x499b71))['catch'](handleError(_0x7af6ef,null));};exports['send']=function(_0x3d572b,_0x1b39db,_0x97660a){var _0x2115c8,_0xe29502,_0x4fe91a;if(_['isNil'](_0x3d572b[_0xa3a3('0x61')][_0xa3a3('0x61')])||_0x3d572b['body'][_0xa3a3('0x61')]===''){throw new db[(_0xa3a3('0x78'))][(_0xa3a3('0x79'))](_0xa3a3('0xca'));}if(_[_0xa3a3('0x97')](_0x3d572b['body']['to'])){throw new db[(_0xa3a3('0x78'))]['ValidationError'](_0xa3a3('0xcb'));}_0x2115c8=_0x3d572b[_0xa3a3('0x61')]['to'];return db['SmsAccount'][_0xa3a3('0x57')]({'where':{'id':_0x3d572b[_0xa3a3('0x60')]['id']},'include':[{'model':db[_0xa3a3('0xcc')],'as':_0xa3a3('0xcd'),'include':[{'model':db[_0xa3a3('0x9f')],'as':_0xa3a3('0x9e'),'where':{'mobile':_0x2115c8},'limit':0x1,'order':[[_0xa3a3('0x7b'),_0xa3a3('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x1b39db,null))[_0xa3a3('0x35')](function(_0x2ec793){if(_0x2ec793&&_0x2ec793[_0xa3a3('0xcd')]){_0xe29502=_0x2ec793['get']({'plain':!![]});if(_0xe29502[_0xa3a3('0xcd')]&&_0xe29502[_0xa3a3('0xcd')]['Contacts']['length']){return _0xe29502[_0xa3a3('0xcd')]['Contacts'][0x0];}return db[_0xa3a3('0x9f')][_0xa3a3('0x58')](_[_0xa3a3('0x1b')](_0x3d572b[_0xa3a3('0x61')],{'firstName':_0x2115c8,'mobile':_0x2115c8,'phone':_0x2115c8,'ListId':_0xe29502[_0xa3a3('0x7e')]}));}})[_0xa3a3('0x35')](handleEntityNotFound(_0x1b39db,null))['then'](function(_0x4878ac){if(_0x4878ac){_0x4fe91a=_0x4878ac;return db['SmsInteraction'][_0xa3a3('0x57')]({'where':{'ContactId':_0x4fe91a['id'],'closed':![],'SmsAccountId':_0xe29502['id']}})[_0xa3a3('0x35')](function(_0x143068){if(_0x143068){return[_0x143068,![]];}return db[_0xa3a3('0xa0')][_0xa3a3('0x58')]({'UserId':_0x3d572b[_0xa3a3('0x59')]['id'],'ContactId':_0x4fe91a['id'],'SmsAccountId':_0xe29502['id'],'phone':_0x2115c8,'firstMsgDirection':_0xa3a3('0xce'),'Messages':[_[_0xa3a3('0x4d')](_0x3d572b[_0xa3a3('0x61')],{'read':![],'body':_0x3d572b[_0xa3a3('0x61')][_0xa3a3('0x61')],'phone':_0x2115c8,'SmsAccountId':_0xe29502['id'],'UserId':_0x3d572b['user']['id'],'ContactId':_0x4fe91a['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xa3a3('0x35')](function(_0x44b209){return[_0x44b209,!![]];});});}})[_0xa3a3('0xa1')](function(_0x215406,_0x574dbe){if(_0x574dbe){return _0x215406;}return db[_0xa3a3('0xa7')][_0xa3a3('0x58')](_['merge'](_0x3d572b[_0xa3a3('0x61')],{'read':![],'body':_0x3d572b['body'][_0xa3a3('0x61')],'phone':_0x2115c8,'SmsAccountId':_0xe29502['id'],'SmsInteractionId':_0x215406['id'],'UserId':_0x3d572b[_0xa3a3('0x59')]['id'],'ContactId':_0x4fe91a['id']}))[_0xa3a3('0x35')](function(_0x3d76eb){_0x215406['dataValues'][_0xa3a3('0xcf')]=[];_0x215406[_0xa3a3('0xd0')][_0xa3a3('0xcf')][_0xa3a3('0xd1')](_0x3d76eb[_0xa3a3('0xd0')]);return _0x215406;});})['then'](respondWithResult(_0x1b39db,null))[_0xa3a3('0x29')](handleError(_0x1b39db,null));};exports['status']=function(_0x9fec65,_0x492874,_0x4b0301){if(_0x9fec65[_0xa3a3('0x61')]['id']){delete _0x9fec65[_0xa3a3('0x61')]['id'];}var _0x1de008,_0x3377be,_0x303ffd;return db['SmsAccount'][_0xa3a3('0x57')]({'where':{'id':_0x9fec65[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x492874,null))[_0xa3a3('0x35')](function(_0x40c1de){if(_0x40c1de){_0x303ffd=_0x40c1de;logger[_0xa3a3('0x24')](_0xa3a3('0xb4'),_0xa3a3('0x2b'),_0xa3a3('0xd2'),_0x40c1de[_0xa3a3('0x40')],util[_0xa3a3('0xd3')](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));switch(_0x40c1de['type']){case _0xa3a3('0xd4'):if(_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd5')]&&_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x2b')]){_0x3377be=_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x2b')];return db[_0xa3a3('0xa7')][_0xa3a3('0x57')]({'where':{'messageId':_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd5')]}});}break;case'connectel':if(_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd6')]&&_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd7')]){_0x3377be=_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd7')];return db['SmsMessage'][_0xa3a3('0x57')]({'where':{'messageId':_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd6')]}});}break;case _0xa3a3('0x89'):if(_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x8a')]&&_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd8')]){_0x3377be=_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0xd8')];return db[_0xa3a3('0xa7')]['find']({'where':{'messageId':_0x9fec65['body'][_0xa3a3('0x8a')]}});}break;case'infobip':var _0x87e99a=_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x8f')][0x0];if(_0x87e99a['messageId']&&_0x87e99a[_0xa3a3('0x2b')][_0xa3a3('0xd9')]===_0xa3a3('0xda')){_0x3377be=_0x87e99a[_0xa3a3('0x2b')][_0xa3a3('0xd9')];return db[_0xa3a3('0xa7')][_0xa3a3('0x57')]({'where':{'messageId':_0x87e99a['messageId']}});}break;case _0xa3a3('0x92'):if(_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x83')]&&_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x2b')]){_0x3377be=_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x2b')];return db['SmsMessage'][_0xa3a3('0x57')]({'where':{'messageId':_0x9fec65[_0xa3a3('0x61')][_0xa3a3('0x83')]}});}break;case _0xa3a3('0x94'):if(_0x9fec65[_0xa3a3('0x61')][0x0][_0xa3a3('0x27')]['id']){_0x3377be=_0x9fec65[_0xa3a3('0x61')][0x0]['type'];return db[_0xa3a3('0xa7')][_0xa3a3('0x57')]({'where':{'messageId':_0x9fec65[_0xa3a3('0x61')][0x0][_0xa3a3('0x27')]['id']}});}break;case _0xa3a3('0xdb'):if(_0x9fec65['body'][_0xa3a3('0xdc')]&&_0x9fec65['body'][_0xa3a3('0x2b')]){_0x3377be=_0x9fec65['body']['status'];return db[_0xa3a3('0xa7')][_0xa3a3('0x57')]({'where':{'messageId':_0x9fec65['body'][_0xa3a3('0xdc')]}});}break;}}})[_0xa3a3('0x35')](handleEntityNotFound(_0x492874,null))[_0xa3a3('0x35')](function(_0x3893ea){if(_0x3893ea){_0x1de008=_0x3893ea;switch(_0x303ffd[_0xa3a3('0x40')]){case _0xa3a3('0xd4'):if(_0x3377be===_0xa3a3('0xda')){return _0x1de008['update']({'read':!![]});}else{logger[_0xa3a3('0x25')](_0xa3a3('0xb4'),'status','skebby',util[_0xa3a3('0xd3')](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));}break;case _0xa3a3('0x88'):if(_0x3377be==='1'){return _0x1de008[_0xa3a3('0x5f')]({'read':!![]});}else{logger[_0xa3a3('0x25')](_0xa3a3('0xb4'),_0xa3a3('0x2b'),'skebby',util[_0xa3a3('0xd3')](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x9fec65[_0xa3a3('0x61')]['error_code']&&_0x3377be>=0xc8&&_0x3377be<=0xce){return _0x1de008[_0xa3a3('0x5f')]({'read':!![]});}else{logger[_0xa3a3('0x25')](_0xa3a3('0xb4'),_0xa3a3('0x2b'),_0xa3a3('0x89'),util[_0xa3a3('0xd3')](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));}break;case _0xa3a3('0x8e'):var _0x4df7dd=_0x9fec65['body']['results'][0x0];if(_0x4df7dd[_0xa3a3('0x2b')][_0xa3a3('0xd9')]===_0xa3a3('0xda')){return _0x1de008[_0xa3a3('0x5f')]({'read':!![]});}else{logger[_0xa3a3('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa3a3('0x2b'),_0xa3a3('0x8e'),util[_0xa3a3('0xd3')](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));}break;case _0xa3a3('0x92'):if(_0x3377be==_0xa3a3('0xdd')||_0x3377be==_0xa3a3('0xde')){return _0x1de008[_0xa3a3('0x5f')]({'read':!![]});}else{logger[_0xa3a3('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa3a3('0x2b'),_0xa3a3('0x92'),util['inspect'](_0x9fec65['body'],{'showHidden':![],'depth':null}));}break;case _0xa3a3('0x94'):if(_0x3377be==_0xa3a3('0xdf')){return _0x1de008[_0xa3a3('0x5f')]({'read':!![]});}else{logger[_0xa3a3('0x25')](_0xa3a3('0xb4'),_0xa3a3('0x2b'),_0xa3a3('0x94'),util['inspect'](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));}break;case _0xa3a3('0xdb'):if(_0x3377be===_0xa3a3('0xe0')||_0x3377be===_0xa3a3('0xe1')){return _0x1de008[_0xa3a3('0x5f')]({'read':!![]});}else{logger['error'](_0xa3a3('0xb4'),_0xa3a3('0x2b'),_0xa3a3('0xdb'),util[_0xa3a3('0xd3')](_0x9fec65[_0xa3a3('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x1de008;}})[_0xa3a3('0x35')](respondWithResult(_0x492874,null))[_0xa3a3('0x29')](handleError(_0x492874,null));};exports[_0xa3a3('0xe2')]=function(_0x377f7c,_0x30163a,_0x366802){var _0x487377,_0x2ce6dc,_0x40ef49;return db[_0xa3a3('0x50')]['find']({'where':{'id':_0x377f7c['params']['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x30163a,null))[_0xa3a3('0x35')](function(_0x1a9874){if(_0x1a9874){_0x40ef49=_0x1a9874;logger[_0xa3a3('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x1a9874[_0xa3a3('0x40')],util[_0xa3a3('0xd3')](_0x377f7c[_0xa3a3('0x43')],{'showHidden':![],'depth':null}));switch(_0x1a9874['type']){case'csc':if(_0x377f7c[_0xa3a3('0x43')][_0xa3a3('0xe3')]&&_0x377f7c[_0xa3a3('0x43')][_0xa3a3('0xe4')]){_0x2ce6dc=_0x377f7c[_0xa3a3('0x43')][_0xa3a3('0xe4')];return db[_0xa3a3('0xa7')][_0xa3a3('0x57')]({'where':{'messageId':_0x377f7c[_0xa3a3('0x43')][_0xa3a3('0xe3')]}});}break;}}})[_0xa3a3('0x35')](handleEntityNotFound(_0x30163a,null))['then'](function(_0x2cfc95){if(_0x2cfc95){_0x487377=_0x2cfc95;switch(_0x40ef49[_0xa3a3('0x40')]){case'csc':if(_0x2ce6dc==='2'||_0x2ce6dc==='6'){return _0x487377[_0xa3a3('0x5f')]({'read':!![]});}else{logger[_0xa3a3('0x25')](_0xa3a3('0xb4'),'status','csc',util[_0xa3a3('0xd3')](_0x377f7c[_0xa3a3('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x487377;}})[_0xa3a3('0x35')](respondWithResult(_0x30163a,null))[_0xa3a3('0x29')](handleError(_0x30163a,null));};exports[_0xa3a3('0xe5')]=function(_0x21ab61,_0x19c600,_0x2c5085){return db[_0xa3a3('0x50')][_0xa3a3('0x57')]({'where':{'id':_0x21ab61[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x19c600,null))[_0xa3a3('0x35')](function(_0x45b325){if(_0x45b325){return _0x45b325[_0xa3a3('0xe5')](_0x21ab61[_0xa3a3('0x61')]['ids'],_['omit'](_0x21ab61['body'],[_0xa3a3('0x6b'),'id'])||{})['spread'](function(_0x39474e){for(var _0x1c69bf=0x0;_0x1c69bf<_0x21ab61[_0xa3a3('0x61')][_0xa3a3('0x6b')][_0xa3a3('0x47')];_0x1c69bf+=0x1){socket[_0xa3a3('0xe6')](_0xa3a3('0xe7'),{'UserId':Number(_0x21ab61[_0xa3a3('0x61')][_0xa3a3('0x6b')][_0x1c69bf]),'SmsAccountId':Number(_0x21ab61[_0xa3a3('0x60')]['id'])});}return _0x39474e;});}})[_0xa3a3('0x35')](respondWithResult(_0x19c600,null))[_0xa3a3('0x29')](handleError(_0x19c600,null));};exports[_0xa3a3('0xe8')]=function(_0x2b13b2,_0x468a69,_0x64d5ee){return db['SmsAccount']['find']({'where':{'id':_0x2b13b2[_0xa3a3('0x60')]['id']}})[_0xa3a3('0x35')](handleEntityNotFound(_0x468a69,null))[_0xa3a3('0x35')](function(_0x2178d4){if(_0x2178d4){return _0x2178d4[_0xa3a3('0xe8')](_0x2b13b2[_0xa3a3('0x43')][_0xa3a3('0x6b')])['then'](function(){if(_[_0xa3a3('0xe9')](_0x2b13b2[_0xa3a3('0x43')][_0xa3a3('0x6b')])){for(var _0x1e3b2d=0x0;_0x1e3b2d<_0x2b13b2[_0xa3a3('0x43')][_0xa3a3('0x6b')][_0xa3a3('0x47')];_0x1e3b2d+=0x1){socket[_0xa3a3('0xe6')](_0xa3a3('0xea'),{'UserId':Number(_0x2b13b2[_0xa3a3('0x43')][_0xa3a3('0x6b')][_0x1e3b2d]),'SmsAccountId':Number(_0x2b13b2[_0xa3a3('0x60')]['id'])});}}else{socket[_0xa3a3('0xe6')](_0xa3a3('0xea'),{'UserId':Number(_0x2b13b2[_0xa3a3('0x43')]['ids']),'SmsAccountId':Number(_0x2b13b2[_0xa3a3('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x468a69,null))[_0xa3a3('0x29')](handleError(_0x468a69,null));};exports[_0xa3a3('0xeb')]=function(_0x50480b,_0x16e702,_0x9fcf93){var _0x61d3b7={};var _0x3c199d={};var _0x44449f;var _0x17da21;return db[_0xa3a3('0x50')]['findOne']({'where':{'id':_0x50480b[_0xa3a3('0x60')]['id']}})['then'](handleEntityNotFound(_0x16e702,null))[_0xa3a3('0x35')](function(_0x224e47){if(_0x224e47){_0x44449f=_0x224e47;_0x3c199d[_0xa3a3('0x42')]=_[_0xa3a3('0x55')](db[_0xa3a3('0xab')]['rawAttributes']);_0x3c199d['query']=_[_0xa3a3('0x55')](_0x50480b[_0xa3a3('0x43')]);_0x3c199d[_0xa3a3('0x44')]=_[_0xa3a3('0x45')](_0x3c199d[_0xa3a3('0x42')],_0x3c199d[_0xa3a3('0x43')]);_0x61d3b7[_0xa3a3('0x46')]=_['intersection'](_0x3c199d[_0xa3a3('0x42')],qs['fields'](_0x50480b[_0xa3a3('0x43')][_0xa3a3('0x56')]));_0x61d3b7['attributes']=_0x61d3b7[_0xa3a3('0x46')][_0xa3a3('0x47')]?_0x61d3b7['attributes']:_0x3c199d[_0xa3a3('0x42')];_0x61d3b7['order']=qs['sort'](_0x50480b[_0xa3a3('0x43')]['sort']);_0x61d3b7[_0xa3a3('0x4b')]=qs[_0xa3a3('0x44')](_[_0xa3a3('0x6f')](_0x50480b['query'],_0x3c199d['filters']));if(_0x50480b[_0xa3a3('0x43')][_0xa3a3('0x4c')]){_0x61d3b7[_0xa3a3('0x4b')]=_[_0xa3a3('0x4d')](_0x61d3b7['where'],{'$or':_[_0xa3a3('0x3e')](_0x61d3b7[_0xa3a3('0x46')],function(_0x320a52){var _0x1df4ee={};_0x1df4ee[_0x320a52]={'$like':'%'+_0x50480b[_0xa3a3('0x43')][_0xa3a3('0x4c')]+'%'};return _0x1df4ee;})});}_0x61d3b7=_[_0xa3a3('0x4d')]({},_0x61d3b7,_0x50480b[_0xa3a3('0x4f')]);return _0x44449f[_0xa3a3('0xeb')](_0x61d3b7);}})[_0xa3a3('0x35')](function(_0x55d1af){if(_0x55d1af){_0x17da21=_0x55d1af[_0xa3a3('0x47')];if(!_0x50480b['query'][_0xa3a3('0x48')](_0xa3a3('0x49'))){_0x61d3b7[_0xa3a3('0x30')]=qs[_0xa3a3('0x30')](_0x50480b[_0xa3a3('0x43')]['limit']);_0x61d3b7[_0xa3a3('0x2e')]=qs[_0xa3a3('0x2e')](_0x50480b[_0xa3a3('0x43')]['offset']);}return _0x44449f[_0xa3a3('0xeb')](_0x61d3b7);}})[_0xa3a3('0x35')](function(_0xfd04a4){if(_0xfd04a4){return _0xfd04a4?{'count':_0x17da21,'rows':_0xfd04a4}:null;}})[_0xa3a3('0x35')](respondWithResult(_0x16e702,null))[_0xa3a3('0x29')](handleError(_0x16e702,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ba68682..099af89 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 _0xe306=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x5a8315,_0x156a41){var _0x42952d=function(_0x3da8ae){while(--_0x3da8ae){_0x5a8315['push'](_0x5a8315['shift']());}};_0x42952d(++_0x156a41);}(_0xe306,0x169));var _0x6e30=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xe306[_0x34bc30];return _0x5706de;};'use strict';var EventEmitter=require(_0x6e30('0x0'));var SmsAccount=require(_0x6e30('0x1'))['db'][_0x6e30('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6e30('0x3')](0x0);var events={'afterCreate':_0x6e30('0x4'),'afterUpdate':_0x6e30('0x5'),'afterDestroy':_0x6e30('0x6')};function emitEvent(_0x9a0c8d){return function(_0x531c68,_0x2380fc,_0x5554cf){SmsAccountEvents['emit'](_0x9a0c8d+':'+_0x531c68['id'],_0x531c68);SmsAccountEvents['emit'](_0x9a0c8d,_0x531c68);_0x5554cf(null);};}for(var e in events){if(events[_0x6e30('0x7')](e)){var event=events[e];SmsAccount[_0x6e30('0x8')](e,emitEvent(event));}}module[_0x6e30('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x9de3=['hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x4f1afe,_0x29a790){var _0x552767=function(_0x89caf1){while(--_0x89caf1){_0x4f1afe['push'](_0x4f1afe['shift']());}};_0x552767(++_0x29a790);}(_0x9de3,0x1b4));var _0x39de=function(_0x345985,_0x110e1c){_0x345985=_0x345985-0x0;var _0x293a9c=_0x9de3[_0x345985];return _0x293a9c;};'use strict';var EventEmitter=require(_0x39de('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x39de('0x1')](0x0);var events={'afterCreate':_0x39de('0x2'),'afterUpdate':_0x39de('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21e1f1){return function(_0x4b22a9,_0x2e9ad7,_0x1d4031){SmsAccountEvents[_0x39de('0x4')](_0x21e1f1+':'+_0x4b22a9['id'],_0x4b22a9);SmsAccountEvents[_0x39de('0x4')](_0x21e1f1,_0x4b22a9);_0x1d4031(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x39de('0x5')](e,emitEvent(event));}}module[_0x39de('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 9a5da4a..479f250 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 _0x94e6=['moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','define','SmsAccount','lodash','../../config/logger','api'];(function(_0x458f49,_0x1a1af1){var _0x36e8c9=function(_0x1273cb){while(--_0x1273cb){_0x458f49['push'](_0x458f49['shift']());}};_0x36e8c9(++_0x1a1af1);}(_0x94e6,0x194));var _0x694e=function(_0x3a0687,_0x58591a){_0x3a0687=_0x3a0687-0x0;var _0x3a1f2c=_0x94e6[_0x3a0687];return _0x3a1f2c;};'use strict';var _=require(_0x694e('0x0'));var util=require('util');var logger=require(_0x694e('0x1'))(_0x694e('0x2'));var moment=require(_0x694e('0x3'));var BPromise=require(_0x694e('0x4'));var rp=require(_0x694e('0x5'));var fs=require('fs');var path=require(_0x694e('0x6'));var rimraf=require('rimraf');var config=require(_0x694e('0x7'));var attributes=require(_0x694e('0x8'));module['exports']=function(_0x59abaf,_0x43238f){return _0x59abaf[_0x694e('0x9')](_0x694e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3670=['sms_accounts','util','api','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3670,0xe8));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0367('0x0'));var logger=require('../../config/logger')(_0x0367('0x1'));var moment=require('moment');var BPromise=require(_0x0367('0x2'));var rp=require(_0x0367('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0367('0x4'));var config=require(_0x0367('0x5'));var attributes=require(_0x0367('0x6'));module[_0x0367('0x7')]=function(_0x5dfc11,_0x37efc9){return _0x5dfc11[_0x0367('0x8')](_0x0367('0x9'),attributes,{'tableName':_0x0367('0xa'),'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 9071c28..cf46f5a 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 _0x3414=['attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','info','request\x20sent','result','message','catch','ShowSmsAccount','find','options','where'];(function(_0xa8f16,_0x39c95c){var _0x2ac96b=function(_0xe25313){while(--_0xe25313){_0xa8f16['push'](_0xa8f16['shift']());}};_0x2ac96b(++_0x39c95c);}(_0x3414,0x13f));var _0x4341=function(_0x4951db,_0x392e26){_0x4951db=_0x4951db-0x0;var _0x2ade73=_0x3414[_0x4951db];return _0x2ade73;};'use strict';var _=require(_0x4341('0x0'));var util=require(_0x4341('0x1'));var moment=require('moment');var BPromise=require(_0x4341('0x2'));var rs=require(_0x4341('0x3'));var fs=require('fs');var Redis=require(_0x4341('0x4'));var db=require(_0x4341('0x5'))['db'];var utils=require(_0x4341('0x6'));var logger=require(_0x4341('0x7'))('rpc');var config=require(_0x4341('0x8'));var jayson=require(_0x4341('0x9'));var client=jayson[_0x4341('0xa')][_0x4341('0xb')]({'port':0x232a});config[_0x4341('0xc')]=_[_0x4341('0xd')](config['redis'],{'host':_0x4341('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4341('0xc')]));require(_0x4341('0xf'))[_0x4341('0x10')](socket);function respondWithRpcPromise(_0x1c27ac,_0x179fb2,_0x3b253a){return new BPromise(function(_0x2deadc,_0x429f4d){return client[_0x4341('0x11')](_0x1c27ac,_0x3b253a)['then'](function(_0x4393fa){logger['info'](_0x4341('0x12'),_0x179fb2,'request\x20sent');logger['debug'](_0x4341('0x13'),_0x179fb2,'request\x20sent',JSON[_0x4341('0x14')](_0x4393fa));if(_0x4393fa[_0x4341('0x15')]){if(_0x4393fa[_0x4341('0x15')]['code']===0x1f4){logger['error'](_0x4341('0x12'),_0x179fb2,_0x4393fa[_0x4341('0x15')]['message']);return _0x429f4d(_0x4393fa[_0x4341('0x15')]['message']);}logger[_0x4341('0x15')]('SmsAccount,\x20%s,\x20%s',_0x179fb2,_0x4393fa[_0x4341('0x15')]['message']);return _0x2deadc(_0x4393fa[_0x4341('0x15')]['message']);}else{logger[_0x4341('0x16')](_0x4341('0x12'),_0x179fb2,_0x4341('0x17'));_0x2deadc(_0x4393fa[_0x4341('0x18')][_0x4341('0x19')]);}})[_0x4341('0x1a')](function(_0x4d886c){logger[_0x4341('0x15')](_0x4341('0x12'),_0x179fb2,_0x4d886c);_0x429f4d(_0x4d886c);});});}exports[_0x4341('0x1b')]=function(_0x42e7f5){var _0x3dd15c=this;return new Promise(function(_0x1e30fb,_0x410a3a){return db['SmsAccount'][_0x4341('0x1c')]({'raw':_0x42e7f5[_0x4341('0x1d')]?_0x42e7f5[_0x4341('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x42e7f5[_0x4341('0x1d')]?_0x42e7f5['options'][_0x4341('0x1e')]||null:null,'attributes':_0x42e7f5[_0x4341('0x1d')]?_0x42e7f5[_0x4341('0x1d')][_0x4341('0x1f')]||null:null,'include':_0x42e7f5[_0x4341('0x1d')]?_0x42e7f5[_0x4341('0x1d')]['include']?_['map'](_0x42e7f5[_0x4341('0x1d')][_0x4341('0x20')],function(_0x131587){return{'model':db[_0x131587['model']],'as':_0x131587['as'],'attributes':_0x131587[_0x4341('0x1f')],'include':_0x131587['include']?_[_0x4341('0x21')](_0x131587[_0x4341('0x20')],function(_0x5e8a7d){return{'model':db[_0x5e8a7d[_0x4341('0x22')]],'as':_0x5e8a7d['as'],'attributes':_0x5e8a7d['attributes'],'include':_0x5e8a7d['include']?_[_0x4341('0x21')](_0x5e8a7d[_0x4341('0x20')],function(_0x3afdf8){return{'model':db[_0x3afdf8[_0x4341('0x22')]],'as':_0x3afdf8['as'],'attributes':_0x3afdf8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26fd3c){logger['info']('ShowSmsAccount',_0x42e7f5);logger['debug'](_0x4341('0x1b'),_0x42e7f5,JSON[_0x4341('0x14')](_0x26fd3c));_0x1e30fb(_0x26fd3c);})[_0x4341('0x1a')](function(_0x15f41d){logger[_0x4341('0x15')](_0x4341('0x1b'),_0x15f41d[_0x4341('0x19')],_0x42e7f5);_0x410a3a(_0x3dd15c['error'](0x1f4,_0x15f41d['message']));});});}; \ No newline at end of file +var _0x9c30=['message','catch','ShowSmsAccount','SmsAccount','options','raw','where','include','map','model','attributes','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./smsAccount.socket','register','request','info','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s'];(function(_0x21e499,_0x2808bf){var _0x89fcf3=function(_0x555007){while(--_0x555007){_0x21e499['push'](_0x21e499['shift']());}};_0x89fcf3(++_0x2808bf);}(_0x9c30,0x72));var _0x09c3=function(_0x3e012d,_0x1e3d7c){_0x3e012d=_0x3e012d-0x0;var _0x4d817a=_0x9c30[_0x3e012d];return _0x4d817a;};'use strict';var _=require(_0x09c3('0x0'));var util=require(_0x09c3('0x1'));var moment=require('moment');var BPromise=require(_0x09c3('0x2'));var rs=require(_0x09c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09c3('0x4'))['db'];var utils=require(_0x09c3('0x5'));var logger=require(_0x09c3('0x6'))(_0x09c3('0x7'));var config=require(_0x09c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x09c3('0x9')]['http']({'port':0x232a});config[_0x09c3('0xa')]=_[_0x09c3('0xb')](config['redis'],{'host':_0x09c3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x09c3('0xd'))[_0x09c3('0xe')](socket);function respondWithRpcPromise(_0x13b4a5,_0x307d7e,_0x4aa394){return new BPromise(function(_0x40da28,_0x163e3b){return client[_0x09c3('0xf')](_0x13b4a5,_0x4aa394)['then'](function(_0x8b4360){logger[_0x09c3('0x10')]('SmsAccount,\x20%s,\x20%s',_0x307d7e,_0x09c3('0x11'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x307d7e,_0x09c3('0x11'),JSON[_0x09c3('0x12')](_0x8b4360));if(_0x8b4360[_0x09c3('0x13')]){if(_0x8b4360[_0x09c3('0x13')][_0x09c3('0x14')]===0x1f4){logger[_0x09c3('0x13')](_0x09c3('0x15'),_0x307d7e,_0x8b4360[_0x09c3('0x13')][_0x09c3('0x16')]);return _0x163e3b(_0x8b4360[_0x09c3('0x13')][_0x09c3('0x16')]);}logger[_0x09c3('0x13')](_0x09c3('0x15'),_0x307d7e,_0x8b4360[_0x09c3('0x13')]['message']);return _0x40da28(_0x8b4360[_0x09c3('0x13')]['message']);}else{logger[_0x09c3('0x10')](_0x09c3('0x15'),_0x307d7e,_0x09c3('0x11'));_0x40da28(_0x8b4360['result']['message']);}})[_0x09c3('0x17')](function(_0x2e86a1){logger[_0x09c3('0x13')](_0x09c3('0x15'),_0x307d7e,_0x2e86a1);_0x163e3b(_0x2e86a1);});});}exports[_0x09c3('0x18')]=function(_0x25c5d5){var _0x42c98f=this;return new Promise(function(_0x4319c7,_0x4e0a14){return db[_0x09c3('0x19')]['find']({'raw':_0x25c5d5[_0x09c3('0x1a')]?_0x25c5d5['options'][_0x09c3('0x1b')]===undefined?!![]:![]:!![],'where':_0x25c5d5['options']?_0x25c5d5[_0x09c3('0x1a')][_0x09c3('0x1c')]||null:null,'attributes':_0x25c5d5[_0x09c3('0x1a')]?_0x25c5d5[_0x09c3('0x1a')]['attributes']||null:null,'include':_0x25c5d5[_0x09c3('0x1a')]?_0x25c5d5[_0x09c3('0x1a')][_0x09c3('0x1d')]?_[_0x09c3('0x1e')](_0x25c5d5[_0x09c3('0x1a')][_0x09c3('0x1d')],function(_0x349594){return{'model':db[_0x349594[_0x09c3('0x1f')]],'as':_0x349594['as'],'attributes':_0x349594[_0x09c3('0x20')],'include':_0x349594[_0x09c3('0x1d')]?_[_0x09c3('0x1e')](_0x349594[_0x09c3('0x1d')],function(_0x11e781){return{'model':db[_0x11e781[_0x09c3('0x1f')]],'as':_0x11e781['as'],'attributes':_0x11e781[_0x09c3('0x20')],'include':_0x11e781[_0x09c3('0x1d')]?_[_0x09c3('0x1e')](_0x11e781[_0x09c3('0x1d')],function(_0x4f350b){return{'model':db[_0x4f350b[_0x09c3('0x1f')]],'as':_0x4f350b['as'],'attributes':_0x4f350b[_0x09c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43ac10){logger['info'](_0x09c3('0x18'),_0x25c5d5);logger[_0x09c3('0x21')](_0x09c3('0x18'),_0x25c5d5,JSON[_0x09c3('0x12')](_0x43ac10));_0x4319c7(_0x43ac10);})[_0x09c3('0x17')](function(_0x591bf1){logger['error']('ShowSmsAccount',_0x591bf1[_0x09c3('0x16')],_0x25c5d5);_0x4e0a14(_0x42c98f[_0x09c3('0x13')](0x1f4,_0x591bf1[_0x09c3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 6251421..3cae97e 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 de84349..eff2904 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x5e9817,_0xa29439){var _0x25b437=function(_0x46851b){while(--_0x46851b){_0x5e9817['push'](_0x5e9817['shift']());}};_0x25b437(++_0xa29439);}(_0x3e74,0x175));var _0x43e7=function(_0x2f4750,_0x1d81fc){_0x2f4750=_0x2f4750-0x0;var _0x31ce12=_0x3e74[_0x2f4750];return _0x31ce12;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5065a5,_0x4e44d5){var _0x512ea2=function(_0x368bc6){while(--_0x368bc6){_0x5065a5['push'](_0x5065a5['shift']());}};_0x512ea2(++_0x4e44d5);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1d1ac36..54e8e7e 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 _0x6179=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0x2d9581,_0x305541){var _0x5ed42f=function(_0x5ae878){while(--_0x5ae878){_0x2d9581['push'](_0x2d9581['shift']());}};_0x5ed42f(++_0x305541);}(_0x6179,0x154));var _0x9617=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x6179[_0x264545];return _0x114d10;};'use strict';var Sequelize=require(_0x9617('0x0'));module[_0x9617('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9617('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9617('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9617('0x2')],'defaultValue':_0x9617('0x4')}}; \ No newline at end of file +var _0x3c6f=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x3c6f,0x134));var _0xf3c6=function(_0x405bf0,_0x39c267){_0x405bf0=_0x405bf0-0x0;var _0x425404=_0x3c6f[_0x405bf0];return _0x425404;};'use strict';var Sequelize=require(_0xf3c6('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf3c6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf3c6('0x2')],'allowNull':![],'defaultValue':_0xf3c6('0x3')},'appdata':{'type':Sequelize[_0xf3c6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf3c6('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 1b6a530..ee3188e 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 _0xdc7f=['catch','find','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','SmsApplication','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','filters','create','body'];(function(_0x3a3d20,_0x244316){var _0x33bc94=function(_0x215ba9){while(--_0x215ba9){_0x3a3d20['push'](_0x3a3d20['shift']());}};_0x33bc94(++_0x244316);}(_0xdc7f,0x122));var _0xfdc7=function(_0x170b20,_0x49fc52){_0x170b20=_0x170b20-0x0;var _0xbe0395=_0xdc7f[_0x170b20];return _0xbe0395;};'use strict';var emlformat=require(_0xfdc7('0x0'));var rimraf=require(_0xfdc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdc7('0x2'));var rp=require(_0xfdc7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfdc7('0x4'));var path=require('path');var sox=require(_0xfdc7('0x5'));var csv=require(_0xfdc7('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdc7('0x7'));var _=require(_0xfdc7('0x8'));var squel=require('squel');var crypto=require(_0xfdc7('0x9'));var jsforce=require(_0xfdc7('0xa'));var deskjs=require(_0xfdc7('0xb'));var toCsv=require(_0xfdc7('0x6'));var querystring=require(_0xfdc7('0xc'));var Papa=require(_0xfdc7('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfdc7('0xe'));var as=require(_0xfdc7('0xf'));var hardwareService=require(_0xfdc7('0x10'));var logger=require(_0xfdc7('0x11'))(_0xfdc7('0x12'));var utils=require(_0xfdc7('0x13'));var config=require(_0xfdc7('0x14'));var licenseUtil=require(_0xfdc7('0x15'));var db=require(_0xfdc7('0x16'))['db'];function respondWithStatusCode(_0x2d7c08,_0x2a2042){_0x2a2042=_0x2a2042||0xcc;return function(_0x5a0b89){if(_0x5a0b89){return _0x2d7c08['sendStatus'](_0x2a2042);}return _0x2d7c08[_0xfdc7('0x17')](_0x2a2042)[_0xfdc7('0x18')]();};}function respondWithResult(_0x1f7c90,_0x47ca2f){_0x47ca2f=_0x47ca2f||0xc8;return function(_0x23fff3){if(_0x23fff3){return _0x1f7c90[_0xfdc7('0x17')](_0x47ca2f)[_0xfdc7('0x19')](_0x23fff3);}};}function respondWithFilteredResult(_0x42522f,_0x2ee352){return function(_0x2aaeb4){if(_0x2aaeb4){var _0x5dea86=typeof _0x2ee352[_0xfdc7('0x1a')]===_0xfdc7('0x1b')&&typeof _0x2ee352[_0xfdc7('0x1c')]===_0xfdc7('0x1b');var _0x5ae286=_0x2aaeb4['count'];var _0x59641b=_0x5dea86?0x0:_0x2ee352[_0xfdc7('0x1a')];var _0x2c8ad7=_0x5dea86?_0x2aaeb4['count']:_0x2ee352[_0xfdc7('0x1a')]+_0x2ee352[_0xfdc7('0x1c')];var _0x583572;if(_0x2c8ad7>=_0x5ae286){_0x2c8ad7=_0x5ae286;_0x583572=0xc8;}else{_0x583572=0xce;}_0x42522f['status'](_0x583572);return _0x42522f[_0xfdc7('0x1d')]('Content-Range',_0x59641b+'-'+_0x2c8ad7+'/'+_0x5ae286)['json'](_0x2aaeb4);}return null;};}function patchUpdates(_0x1a8caa){return function(_0x538e35){try{jsonpatch[_0xfdc7('0x1e')](_0x538e35,_0x1a8caa,!![]);}catch(_0x151f81){return BPromise['reject'](_0x151f81);}return _0x538e35[_0xfdc7('0x1f')]();};}function saveUpdates(_0x495c26,_0x47a9e3){return function(_0x3f772c){if(_0x3f772c){return _0x3f772c[_0xfdc7('0x20')](_0x495c26)[_0xfdc7('0x21')](function(_0x4e5b88){return _0x4e5b88;});}return null;};}function removeEntity(_0x5f0ba1,_0x49cf96){return function(_0x5cb7e4){if(_0x5cb7e4){return _0x5cb7e4[_0xfdc7('0x22')]()[_0xfdc7('0x21')](function(){_0x5f0ba1['status'](0xcc)[_0xfdc7('0x18')]();});}};}function handleEntityNotFound(_0x214d33,_0x540e99){return function(_0x18c5bf){if(!_0x18c5bf){_0x214d33[_0xfdc7('0x23')](0x194);}return _0x18c5bf;};}function handleError(_0x20ba96,_0x828dbe){_0x828dbe=_0x828dbe||0x1f4;return function(_0x262131){logger['error'](_0x262131[_0xfdc7('0x24')]);if(_0x262131[_0xfdc7('0x25')]){delete _0x262131[_0xfdc7('0x25')];}_0x20ba96['status'](_0x828dbe)[_0xfdc7('0x26')](_0x262131);};}exports[_0xfdc7('0x27')]=function(_0x5976cc,_0x2b0563){var _0x29a28d={},_0x2c102f={},_0x33131d={'count':0x0,'rows':[]};var _0xbaa26a=_['map'](db[_0xfdc7('0x28')][_0xfdc7('0x29')],function(_0x3b2497){return{'name':_0x3b2497[_0xfdc7('0x2a')],'type':_0x3b2497['type'][_0xfdc7('0x2b')]};});_0x2c102f[_0xfdc7('0x2c')]=_[_0xfdc7('0x2d')](_0xbaa26a,'name');_0x2c102f[_0xfdc7('0x2e')]=_[_0xfdc7('0x2f')](_0x5976cc['query']);_0x2c102f['filters']=_[_0xfdc7('0x30')](_0x2c102f[_0xfdc7('0x2c')],_0x2c102f[_0xfdc7('0x2e')]);_0x29a28d[_0xfdc7('0x31')]=_[_0xfdc7('0x30')](_0x2c102f[_0xfdc7('0x2c')],qs[_0xfdc7('0x32')](_0x5976cc[_0xfdc7('0x2e')][_0xfdc7('0x32')]));_0x29a28d[_0xfdc7('0x31')]=_0x29a28d[_0xfdc7('0x31')][_0xfdc7('0x33')]?_0x29a28d[_0xfdc7('0x31')]:_0x2c102f[_0xfdc7('0x2c')];if(!_0x5976cc['query'][_0xfdc7('0x34')](_0xfdc7('0x35'))){_0x29a28d[_0xfdc7('0x1c')]=qs['limit'](_0x5976cc[_0xfdc7('0x2e')][_0xfdc7('0x1c')]);_0x29a28d['offset']=qs[_0xfdc7('0x1a')](_0x5976cc[_0xfdc7('0x2e')]['offset']);}_0x29a28d[_0xfdc7('0x36')]=qs['sort'](_0x5976cc[_0xfdc7('0x2e')][_0xfdc7('0x37')]);_0x29a28d[_0xfdc7('0x38')]=qs['filters'](_[_0xfdc7('0x39')](_0x5976cc[_0xfdc7('0x2e')],_0x2c102f['filters']),_0xbaa26a);if(_0x5976cc['query']['filter']){_0x29a28d[_0xfdc7('0x38')]=_[_0xfdc7('0x3a')](_0x29a28d[_0xfdc7('0x38')],{'$or':_[_0xfdc7('0x2d')](_0xbaa26a,function(_0x289e06){if(_0x289e06['type']!==_0xfdc7('0x3b')){var _0x186671={};_0x186671[_0x289e06[_0xfdc7('0x25')]]={'$like':'%'+_0x5976cc[_0xfdc7('0x2e')]['filter']+'%'};return _0x186671;}})});}_0x29a28d=_[_0xfdc7('0x3a')]({},_0x29a28d,_0x5976cc[_0xfdc7('0x3c')]);var _0x2077c5={'where':_0x29a28d[_0xfdc7('0x38')]};return db[_0xfdc7('0x28')][_0xfdc7('0x3d')](_0x2077c5)[_0xfdc7('0x21')](function(_0x22530a){_0x33131d[_0xfdc7('0x3d')]=_0x22530a;if(_0x5976cc[_0xfdc7('0x2e')][_0xfdc7('0x3e')]){_0x29a28d[_0xfdc7('0x3f')]=[{'all':!![]}];}return db[_0xfdc7('0x28')][_0xfdc7('0x40')](_0x29a28d);})[_0xfdc7('0x21')](function(_0x214486){_0x33131d['rows']=_0x214486;return _0x33131d;})[_0xfdc7('0x21')](respondWithFilteredResult(_0x2b0563,_0x29a28d))['catch'](handleError(_0x2b0563,null));};exports[_0xfdc7('0x41')]=function(_0x501859,_0x283440){var _0x5cde9e={'raw':!![],'where':{'id':_0x501859[_0xfdc7('0x42')]['id']}},_0x2f6188={};_0x2f6188[_0xfdc7('0x2c')]=_['keys'](db['SmsApplication'][_0xfdc7('0x29')]);_0x2f6188[_0xfdc7('0x2e')]=_[_0xfdc7('0x2f')](_0x501859['query']);_0x2f6188[_0xfdc7('0x43')]=_[_0xfdc7('0x30')](_0x2f6188[_0xfdc7('0x2c')],_0x2f6188['query']);_0x5cde9e['attributes']=_[_0xfdc7('0x30')](_0x2f6188['model'],qs[_0xfdc7('0x32')](_0x501859[_0xfdc7('0x2e')][_0xfdc7('0x32')]));_0x5cde9e[_0xfdc7('0x31')]=_0x5cde9e[_0xfdc7('0x31')][_0xfdc7('0x33')]?_0x5cde9e['attributes']:_0x2f6188[_0xfdc7('0x2c')];if(_0x501859[_0xfdc7('0x2e')][_0xfdc7('0x3e')]){_0x5cde9e[_0xfdc7('0x3f')]=[{'all':!![]}];}_0x5cde9e=_[_0xfdc7('0x3a')]({},_0x5cde9e,_0x501859[_0xfdc7('0x3c')]);return db['SmsApplication']['find'](_0x5cde9e)['then'](handleEntityNotFound(_0x283440,null))[_0xfdc7('0x21')](respondWithResult(_0x283440,null))['catch'](handleError(_0x283440,null));};exports['create']=function(_0x18aa91,_0x1b8e87){return db[_0xfdc7('0x28')][_0xfdc7('0x44')](_0x18aa91[_0xfdc7('0x45')],{})['then'](respondWithResult(_0x1b8e87,0xc9))[_0xfdc7('0x46')](handleError(_0x1b8e87,null));};exports[_0xfdc7('0x20')]=function(_0x2d30b4,_0x15a569){if(_0x2d30b4[_0xfdc7('0x45')]['id']){delete _0x2d30b4[_0xfdc7('0x45')]['id'];}return db[_0xfdc7('0x28')][_0xfdc7('0x47')]({'where':{'id':_0x2d30b4[_0xfdc7('0x42')]['id']}})['then'](handleEntityNotFound(_0x15a569,null))[_0xfdc7('0x21')](saveUpdates(_0x2d30b4['body'],null))[_0xfdc7('0x21')](respondWithResult(_0x15a569,null))['catch'](handleError(_0x15a569,null));};exports[_0xfdc7('0x22')]=function(_0x8b1303,_0x947916){return db[_0xfdc7('0x28')][_0xfdc7('0x47')]({'where':{'id':_0x8b1303[_0xfdc7('0x42')]['id']}})[_0xfdc7('0x21')](handleEntityNotFound(_0x947916,null))['then'](removeEntity(_0x947916,null))[_0xfdc7('0x46')](handleError(_0x947916,null));}; \ No newline at end of file +var _0x7597=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x487e23,_0x13f518){var _0x34504c=function(_0x1d2f7b){while(--_0x1d2f7b){_0x487e23['push'](_0x487e23['shift']());}};_0x34504c(++_0x13f518);}(_0x7597,0x80));var _0x7759=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7597[_0x25e7cb];return _0x375d92;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7759('0x0'));var jsonpatch=require(_0x7759('0x1'));var rp=require(_0x7759('0x2'));var moment=require(_0x7759('0x3'));var BPromise=require(_0x7759('0x4'));var Mustache=require('mustache');var util=require(_0x7759('0x5'));var path=require(_0x7759('0x6'));var sox=require(_0x7759('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7759('0x8'));var _=require(_0x7759('0x9'));var squel=require('squel');var crypto=require(_0x7759('0xa'));var jsforce=require(_0x7759('0xb'));var deskjs=require(_0x7759('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7759('0xd'));var Redis=require(_0x7759('0xe'));var authService=require(_0x7759('0xf'));var qs=require(_0x7759('0x10'));var as=require(_0x7759('0x11'));var hardwareService=require(_0x7759('0x12'));var logger=require('../../config/logger')(_0x7759('0x13'));var utils=require(_0x7759('0x14'));var config=require(_0x7759('0x15'));var licenseUtil=require(_0x7759('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x409a2b,_0x4ec4ec){_0x4ec4ec=_0x4ec4ec||0xcc;return function(_0x328cab){if(_0x328cab){return _0x409a2b[_0x7759('0x17')](_0x4ec4ec);}return _0x409a2b['status'](_0x4ec4ec)['end']();};}function respondWithResult(_0xad8d7c,_0x545bbc){_0x545bbc=_0x545bbc||0xc8;return function(_0x4519c4){if(_0x4519c4){return _0xad8d7c[_0x7759('0x18')](_0x545bbc)['json'](_0x4519c4);}};}function respondWithFilteredResult(_0x4c2a82,_0x39c86d){return function(_0x168320){if(_0x168320){var _0x12adea=typeof _0x39c86d[_0x7759('0x19')]===_0x7759('0x1a')&&typeof _0x39c86d[_0x7759('0x1b')]===_0x7759('0x1a');var _0x253b89=_0x168320[_0x7759('0x1c')];var _0x4a5a27=_0x12adea?0x0:_0x39c86d[_0x7759('0x19')];var _0x4c54c8=_0x12adea?_0x168320[_0x7759('0x1c')]:_0x39c86d[_0x7759('0x19')]+_0x39c86d['limit'];var _0xf1519b;if(_0x4c54c8>=_0x253b89){_0x4c54c8=_0x253b89;_0xf1519b=0xc8;}else{_0xf1519b=0xce;}_0x4c2a82[_0x7759('0x18')](_0xf1519b);return _0x4c2a82[_0x7759('0x1d')]('Content-Range',_0x4a5a27+'-'+_0x4c54c8+'/'+_0x253b89)[_0x7759('0x1e')](_0x168320);}return null;};}function patchUpdates(_0x2d28a){return function(_0x5d6cc4){try{jsonpatch[_0x7759('0x1f')](_0x5d6cc4,_0x2d28a,!![]);}catch(_0x25a344){return BPromise[_0x7759('0x20')](_0x25a344);}return _0x5d6cc4[_0x7759('0x21')]();};}function saveUpdates(_0x566b53,_0x20aa25){return function(_0x2e5cbe){if(_0x2e5cbe){return _0x2e5cbe['update'](_0x566b53)[_0x7759('0x22')](function(_0x19a705){return _0x19a705;});}return null;};}function removeEntity(_0x2c9df4,_0x451c11){return function(_0x10d464){if(_0x10d464){return _0x10d464[_0x7759('0x23')]()['then'](function(){_0x2c9df4[_0x7759('0x18')](0xcc)[_0x7759('0x24')]();});}};}function handleEntityNotFound(_0x1d7567,_0x261e72){return function(_0x5ecf6e){if(!_0x5ecf6e){_0x1d7567[_0x7759('0x17')](0x194);}return _0x5ecf6e;};}function handleError(_0x411f8b,_0xfc14d5){_0xfc14d5=_0xfc14d5||0x1f4;return function(_0x4bf25a){logger[_0x7759('0x25')](_0x4bf25a[_0x7759('0x26')]);if(_0x4bf25a[_0x7759('0x27')]){delete _0x4bf25a[_0x7759('0x27')];}_0x411f8b[_0x7759('0x18')](_0xfc14d5)[_0x7759('0x28')](_0x4bf25a);};}exports[_0x7759('0x29')]=function(_0x1d1ae6,_0xd8233e){var _0x518ca7={},_0x61d748={},_0x55b25d={'count':0x0,'rows':[]};var _0x10f411=_[_0x7759('0x2a')](db[_0x7759('0x2b')][_0x7759('0x2c')],function(_0x1fbb2a){return{'name':_0x1fbb2a[_0x7759('0x2d')],'type':_0x1fbb2a['type'][_0x7759('0x2e')]};});_0x61d748[_0x7759('0x2f')]=_['map'](_0x10f411,_0x7759('0x27'));_0x61d748[_0x7759('0x30')]=_[_0x7759('0x31')](_0x1d1ae6['query']);_0x61d748[_0x7759('0x32')]=_[_0x7759('0x33')](_0x61d748[_0x7759('0x2f')],_0x61d748[_0x7759('0x30')]);_0x518ca7[_0x7759('0x34')]=_[_0x7759('0x33')](_0x61d748[_0x7759('0x2f')],qs[_0x7759('0x35')](_0x1d1ae6['query'][_0x7759('0x35')]));_0x518ca7[_0x7759('0x34')]=_0x518ca7[_0x7759('0x34')]['length']?_0x518ca7[_0x7759('0x34')]:_0x61d748[_0x7759('0x2f')];if(!_0x1d1ae6[_0x7759('0x30')][_0x7759('0x36')](_0x7759('0x37'))){_0x518ca7['limit']=qs[_0x7759('0x1b')](_0x1d1ae6[_0x7759('0x30')][_0x7759('0x1b')]);_0x518ca7['offset']=qs[_0x7759('0x19')](_0x1d1ae6[_0x7759('0x30')][_0x7759('0x19')]);}_0x518ca7[_0x7759('0x38')]=qs[_0x7759('0x39')](_0x1d1ae6[_0x7759('0x30')][_0x7759('0x39')]);_0x518ca7[_0x7759('0x3a')]=qs['filters'](_['pick'](_0x1d1ae6[_0x7759('0x30')],_0x61d748['filters']),_0x10f411);if(_0x1d1ae6[_0x7759('0x30')][_0x7759('0x3b')]){_0x518ca7[_0x7759('0x3a')]=_[_0x7759('0x3c')](_0x518ca7[_0x7759('0x3a')],{'$or':_['map'](_0x10f411,function(_0x4e8695){if(_0x4e8695[_0x7759('0x3d')]!==_0x7759('0x3e')){var _0x3b325c={};_0x3b325c[_0x4e8695['name']]={'$like':'%'+_0x1d1ae6['query'][_0x7759('0x3b')]+'%'};return _0x3b325c;}})});}_0x518ca7=_[_0x7759('0x3c')]({},_0x518ca7,_0x1d1ae6[_0x7759('0x3f')]);var _0x19dabf={'where':_0x518ca7[_0x7759('0x3a')]};return db[_0x7759('0x2b')][_0x7759('0x1c')](_0x19dabf)[_0x7759('0x22')](function(_0x545334){_0x55b25d['count']=_0x545334;if(_0x1d1ae6[_0x7759('0x30')][_0x7759('0x40')]){_0x518ca7[_0x7759('0x41')]=[{'all':!![]}];}return db[_0x7759('0x2b')][_0x7759('0x42')](_0x518ca7);})[_0x7759('0x22')](function(_0x107dd3){_0x55b25d['rows']=_0x107dd3;return _0x55b25d;})[_0x7759('0x22')](respondWithFilteredResult(_0xd8233e,_0x518ca7))[_0x7759('0x43')](handleError(_0xd8233e,null));};exports[_0x7759('0x44')]=function(_0x2accbe,_0x62d771){var _0x4f301f={'raw':!![],'where':{'id':_0x2accbe[_0x7759('0x45')]['id']}},_0x1f4d9e={};_0x1f4d9e[_0x7759('0x2f')]=_['keys'](db[_0x7759('0x2b')][_0x7759('0x2c')]);_0x1f4d9e[_0x7759('0x30')]=_[_0x7759('0x31')](_0x2accbe['query']);_0x1f4d9e[_0x7759('0x32')]=_['intersection'](_0x1f4d9e['model'],_0x1f4d9e[_0x7759('0x30')]);_0x4f301f[_0x7759('0x34')]=_[_0x7759('0x33')](_0x1f4d9e['model'],qs['fields'](_0x2accbe[_0x7759('0x30')][_0x7759('0x35')]));_0x4f301f[_0x7759('0x34')]=_0x4f301f[_0x7759('0x34')][_0x7759('0x46')]?_0x4f301f[_0x7759('0x34')]:_0x1f4d9e[_0x7759('0x2f')];if(_0x2accbe[_0x7759('0x30')][_0x7759('0x40')]){_0x4f301f['include']=[{'all':!![]}];}_0x4f301f=_[_0x7759('0x3c')]({},_0x4f301f,_0x2accbe[_0x7759('0x3f')]);return db[_0x7759('0x2b')][_0x7759('0x47')](_0x4f301f)[_0x7759('0x22')](handleEntityNotFound(_0x62d771,null))[_0x7759('0x22')](respondWithResult(_0x62d771,null))[_0x7759('0x43')](handleError(_0x62d771,null));};exports[_0x7759('0x48')]=function(_0x10b50b,_0x2443ee){return db[_0x7759('0x2b')][_0x7759('0x48')](_0x10b50b[_0x7759('0x49')],{})[_0x7759('0x22')](respondWithResult(_0x2443ee,0xc9))[_0x7759('0x43')](handleError(_0x2443ee,null));};exports['update']=function(_0x257693,_0x2173a2){if(_0x257693['body']['id']){delete _0x257693[_0x7759('0x49')]['id'];}return db[_0x7759('0x2b')][_0x7759('0x47')]({'where':{'id':_0x257693['params']['id']}})['then'](handleEntityNotFound(_0x2173a2,null))['then'](saveUpdates(_0x257693['body'],null))[_0x7759('0x22')](respondWithResult(_0x2173a2,null))['catch'](handleError(_0x2173a2,null));};exports[_0x7759('0x23')]=function(_0x360a0d,_0x22bce6){return db['SmsApplication'][_0x7759('0x47')]({'where':{'id':_0x360a0d[_0x7759('0x45')]['id']}})[_0x7759('0x22')](handleEntityNotFound(_0x22bce6,null))['then'](removeEntity(_0x22bce6,null))[_0x7759('0x43')](handleError(_0x22bce6,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 65d0a31..f0f06a8 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 _0x18fe=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash'];(function(_0x310daf,_0x5a8b0b){var _0x557df5=function(_0x30fa99){while(--_0x30fa99){_0x310daf['push'](_0x310daf['shift']());}};_0x557df5(++_0x5a8b0b);}(_0x18fe,0x13a));var _0xe18f=function(_0xb7da3a,_0x457c8a){_0xb7da3a=_0xb7da3a-0x0;var _0xbe5362=_0x18fe[_0xb7da3a];return _0xbe5362;};'use strict';var _=require(_0xe18f('0x0'));var util=require(_0xe18f('0x1'));var logger=require(_0xe18f('0x2'))(_0xe18f('0x3'));var moment=require(_0xe18f('0x4'));var BPromise=require(_0xe18f('0x5'));var rp=require(_0xe18f('0x6'));var fs=require('fs');var path=require(_0xe18f('0x7'));var rimraf=require(_0xe18f('0x8'));var config=require('../../config/environment');var attributes=require(_0xe18f('0x9'));module[_0xe18f('0xa')]=function(_0x5ba26c,_0x227062){return _0x5ba26c[_0xe18f('0xb')](_0xe18f('0xc'),attributes,{'tableName':_0xe18f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe18f('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xba62=['exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x3e50e3,_0x3b42d1){var _0x4cc11d=function(_0x28ce7d){while(--_0x28ce7d){_0x3e50e3['push'](_0x3e50e3['shift']());}};_0x4cc11d(++_0x3b42d1);}(_0xba62,0x12b));var _0x2ba6=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xba62[_0x1f71d8];return _0x10b045;};'use strict';var _=require(_0x2ba6('0x0'));var util=require(_0x2ba6('0x1'));var logger=require('../../config/logger')(_0x2ba6('0x2'));var moment=require('moment');var BPromise=require(_0x2ba6('0x3'));var rp=require(_0x2ba6('0x4'));var fs=require('fs');var path=require(_0x2ba6('0x5'));var rimraf=require(_0x2ba6('0x6'));var config=require(_0x2ba6('0x7'));var attributes=require(_0x2ba6('0x8'));module[_0x2ba6('0x9')]=function(_0x8fa936,_0x4d7ec7){return _0x8fa936[_0x2ba6('0xa')]('SmsApplication',attributes,{'tableName':_0x2ba6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2ba6('0xc'),'collate':_0x2ba6('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 8762e7b..a6d8bd6 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 _0x8952=['SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x12bc0d,_0x1e40ca){var _0x18cf40=function(_0x7517e4){while(--_0x7517e4){_0x12bc0d['push'](_0x12bc0d['shift']());}};_0x18cf40(++_0x1e40ca);}(_0x8952,0x17e));var _0x2895=function(_0x5e2110,_0x289e7e){_0x5e2110=_0x5e2110-0x0;var _0x396efd=_0x8952[_0x5e2110];return _0x396efd;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('SmsApplication,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file +var _0xd08d=['http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x117b43,_0x583a8c){var _0x567469=function(_0x125a90){while(--_0x125a90){_0x117b43['push'](_0x117b43['shift']());}};_0x567469(++_0x583a8c);}(_0xd08d,0x81));var _0xdd08=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xd08d[_0x3207aa];return _0x51758f;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13999f,_0x28d59c,_0x147a23){return new BPromise(function(_0x54a5a3,_0x15416b){return client[_0xdd08('0xa')](_0x13999f,_0x147a23)[_0xdd08('0xb')](function(_0x51ce97){logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));logger[_0xdd08('0xf')](_0xdd08('0x10'),_0x28d59c,_0xdd08('0xe'),JSON[_0xdd08('0x11')](_0x51ce97));if(_0x51ce97[_0xdd08('0x12')]){if(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x13')]===0x1f4){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97['error'][_0xdd08('0x14')]);return _0x15416b(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);return _0x54a5a3(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}else{logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));_0x54a5a3(_0x51ce97[_0xdd08('0x15')][_0xdd08('0x14')]);}})[_0xdd08('0x16')](function(_0x278f5e){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x278f5e);_0x15416b(_0x278f5e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index fd04ee8..c781d34 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 _0x6e6c=['create','addMessage','tracked','sms','smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x237637,_0x44f4e2){var _0x331127=function(_0x33c23d){while(--_0x33c23d){_0x237637['push'](_0x237637['shift']());}};_0x331127(++_0x44f4e2);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./smsInteraction.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id',auth[_0xc6e6('0x7')](),controller['show']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0x6')](_0xc6e6('0xc'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xd')]);router[_0xc6e6('0xe')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xf')]);router['post'](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x10')]);router[_0xc6e6('0xe')]('/:id/tags',auth[_0xc6e6('0x7')](),interaction[_0xc6e6('0x11')](_0xc6e6('0x12'),_0xc6e6('0x13')),controller[_0xc6e6('0x14')]);router['put'](_0xc6e6('0x15'),auth[_0xc6e6('0x7')](),interaction['tracked'](_0xc6e6('0x12'),_0xc6e6('0x16')),controller[_0xc6e6('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0xc6e6('0x11')]('sms',_0xc6e6('0x18')),controller[_0xc6e6('0x19')]);router[_0xc6e6('0x1a')](_0xc6e6('0x1b'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x1c')]);module[_0xc6e6('0x1d')]=router; \ No newline at end of file +var _0x80ed=['delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update'];(function(_0x37aed4,_0x254b7d){var _0x1ec4f3=function(_0x2fcefc){while(--_0x2fcefc){_0x37aed4['push'](_0x37aed4['shift']());}};_0x1ec4f3(++_0x254b7d);}(_0x80ed,0x11c));var _0xd80e=function(_0x13d306,_0x4333fc){_0x13d306=_0x13d306-0x0;var _0x3bf445=_0x80ed[_0x13d306];return _0x3bf445;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./smsInteraction.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getMessages']);router[_0xd80e('0x8')](_0xd80e('0x10'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x12')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x12')](_0xd80e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x16')),controller[_0xd80e('0x17')]);router['put'](_0xd80e('0xd'),auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x18')),controller[_0xd80e('0x19')]);router[_0xd80e('0x1a')](_0xd80e('0xd'),auth['isAuthenticated'](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x1b')),controller[_0xd80e('0x1c')]);router['delete'](_0xd80e('0x1d'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 925b7a5..d97447b 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 _0x419f=['DATE','STRING','ENUM','out','INTEGER','sequelize','moment','exports','BOOLEAN'];(function(_0xb6332d,_0x11c531){var _0x799da9=function(_0x1e5308){while(--_0x1e5308){_0xb6332d['push'](_0xb6332d['shift']());}};_0x799da9(++_0x11c531);}(_0x419f,0x176));var _0xf419=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x419f[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xf419('0x0'));var moment=require(_0xf419('0x1'));module[_0xf419('0x2')]={'closed':{'type':Sequelize[_0xf419('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf419('0x4')]},'disposition':{'type':Sequelize[_0xf419('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf419('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf419('0x5')]},'read1stAt':{'type':Sequelize[_0xf419('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf419('0x6')]('in',_0xf419('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf419('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf419('0x6')]('in',_0xf419('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf419('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf419('0x8')]}}; \ No newline at end of file +var _0x9c9b=['STRING','out','ENUM','INTEGER','moment','exports','BOOLEAN','DATE'];(function(_0x5e822d,_0x19b2b3){var _0x7ad508=function(_0x474038){while(--_0x474038){_0x5e822d['push'](_0x5e822d['shift']());}};_0x7ad508(++_0x19b2b3);}(_0x9c9b,0x194));var _0xb9c9=function(_0x4e1d70,_0xaf1df8){_0x4e1d70=_0x4e1d70-0x0;var _0x427db1=_0x9c9b[_0x4e1d70];return _0x427db1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb9c9('0x0'));module[_0xb9c9('0x1')]={'closed':{'type':Sequelize[_0xb9c9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb9c9('0x3')]},'disposition':{'type':Sequelize[_0xb9c9('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb9c9('0x4')]},'note':{'type':Sequelize[_0xb9c9('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb9c9('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb9c9('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb9c9('0x6')]('in',_0xb9c9('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb9c9('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb9c9('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index dfc35b0..b61d44f 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 _0xc384=['../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','name','send','index','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','attributes','intersection','fields','length','include','merge','options','find','create','body','describe','ids','getMessages','findOne','SmsMessage','hasOwnProperty','order','sort','where','pick','SmsInteractionId','map','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','omit','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','toString','join','server','files','format','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','fullname','closed','closedAt','disposition','Messages','out','System','value','renderFile','root','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf'];(function(_0x225f1d,_0xc911b0){var _0x59828d=function(_0x1b515d){while(--_0x1b515d){_0x225f1d['push'](_0x225f1d['shift']());}};_0x59828d(++_0xc911b0);}(_0xc384,0x6f));var _0x4c38=function(_0x533676,_0x2be01c){_0x533676=_0x533676-0x0;var _0x32f7bd=_0xc384[_0x533676];return _0x32f7bd;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4c38('0x0'));var moment=require(_0x4c38('0x1'));var BPromise=require(_0x4c38('0x2'));var util=require(_0x4c38('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4c38('0x4'));var Redis=require(_0x4c38('0x5'));var interaction=require(_0x4c38('0x6'));var qs=require(_0x4c38('0x7'));var pdf=require(_0x4c38('0x8'));var logger=require(_0x4c38('0x9'))(_0x4c38('0xa'));var config=require(_0x4c38('0xb'));var db=require(_0x4c38('0xc'))['db'];config['redis']=_[_0x4c38('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c38('0xe'))(new Redis(config[_0x4c38('0xf')]));require('./smsInteraction.socket')[_0x4c38('0x10')](socket);function respondWithStatusCode(_0x17bbfb,_0x3c1546){_0x3c1546=_0x3c1546||0xcc;return function(_0x4ace0a){if(_0x4ace0a){return _0x17bbfb[_0x4c38('0x11')](_0x3c1546);}return _0x17bbfb['status'](_0x3c1546)[_0x4c38('0x12')]();};}function respondWithResult(_0x5699fa,_0x580c0b){_0x580c0b=_0x580c0b||0xc8;return function(_0x1ac231){if(_0x1ac231){return _0x5699fa[_0x4c38('0x13')](_0x580c0b)[_0x4c38('0x14')](_0x1ac231);}};}function respondWithFilteredResult(_0x490859,_0x5488ad){return function(_0x7c2a44){if(_0x7c2a44){var _0x4d3943=typeof _0x5488ad[_0x4c38('0x15')]===_0x4c38('0x16')&&typeof _0x5488ad[_0x4c38('0x17')]===_0x4c38('0x16');var _0x573c02=_0x7c2a44[_0x4c38('0x18')];var _0x1c76a1=_0x4d3943?0x0:_0x5488ad[_0x4c38('0x15')];var _0x354a36=_0x4d3943?_0x7c2a44[_0x4c38('0x18')]:_0x5488ad[_0x4c38('0x15')]+_0x5488ad[_0x4c38('0x17')];var _0x24dfc1;if(_0x354a36>=_0x573c02){_0x354a36=_0x573c02;_0x24dfc1=0xc8;}else{_0x24dfc1=0xce;}_0x490859[_0x4c38('0x13')](_0x24dfc1);return _0x490859['set'](_0x4c38('0x19'),_0x1c76a1+'-'+_0x354a36+'/'+_0x573c02)['json'](_0x7c2a44);}return null;};}function saveUpdates(_0x332e93){return function(_0x3b0830){if(_0x3b0830){return _0x3b0830[_0x4c38('0x1a')](_0x332e93)['then'](function(_0x318f6d){return _0x318f6d;});}return null;};}function removeEntity(_0x21874d){return function(_0x57dfad){if(_0x57dfad){return _0x57dfad[_0x4c38('0x1b')]()[_0x4c38('0x1c')](function(){_0x21874d[_0x4c38('0x13')](0xcc)[_0x4c38('0x12')]();});}};}function handleEntityNotFound(_0x3d41c5){return function(_0x4300df){if(!_0x4300df){_0x3d41c5['sendStatus'](0x194);}return _0x4300df;};}function handleError(_0x271cc6,_0x1f4954){_0x1f4954=_0x1f4954||0x1f4;return function(_0x59fc84){logger['error'](_0x59fc84['stack']);if(_0x59fc84[_0x4c38('0x1d')]){delete _0x59fc84[_0x4c38('0x1d')];}_0x271cc6[_0x4c38('0x13')](_0x1f4954)[_0x4c38('0x1e')](_0x59fc84);};}exports[_0x4c38('0x1f')]=function(_0x12eae3,_0x2a91a8){var _0x307083={};var _0x14caef=_['map'](db[_0x4c38('0x20')]['rawAttributes'],function(_0x477f4a){return{'name':_0x477f4a[_0x4c38('0x21')],'type':_0x477f4a[_0x4c38('0x22')][_0x4c38('0x23')]};});_0x307083=qs[_0x4c38('0x24')](_0x14caef,_0x12eae3);return interaction[_0x4c38('0x25')](_0x4c38('0x26'),_0x12eae3[_0x4c38('0x27')],_0x12eae3[_0x4c38('0x28')],_0x307083,_0x14caef)[_0x4c38('0x1c')](respondWithFilteredResult(_0x2a91a8,_0x307083))[_0x4c38('0x29')](handleError(_0x2a91a8,null));};exports[_0x4c38('0x2a')]=function(_0xf4a5cc,_0x496f9a){var _0x5a5162={'raw':![],'where':{'id':_0xf4a5cc[_0x4c38('0x2b')]['id']}},_0x3492bc={};_0x3492bc[_0x4c38('0x2c')]=_[_0x4c38('0x2d')](db['SmsInteraction']['rawAttributes']);_0x3492bc[_0x4c38('0x27')]=_[_0x4c38('0x2d')](_0xf4a5cc[_0x4c38('0x27')]);_0x3492bc[_0x4c38('0x2e')]=_['intersection'](_0x3492bc[_0x4c38('0x2c')],_0x3492bc[_0x4c38('0x27')]);_0x5a5162[_0x4c38('0x2f')]=_[_0x4c38('0x30')](_0x3492bc['model'],qs['fields'](_0xf4a5cc[_0x4c38('0x27')][_0x4c38('0x31')]));_0x5a5162[_0x4c38('0x2f')]=_0x5a5162[_0x4c38('0x2f')][_0x4c38('0x32')]?_0x5a5162['attributes']:_0x3492bc[_0x4c38('0x2c')];if(_0xf4a5cc[_0x4c38('0x27')]['includeAll']){_0x5a5162[_0x4c38('0x33')]=[{'all':!![]}];}_0x5a5162=_[_0x4c38('0x34')]({},_0x5a5162,_0xf4a5cc[_0x4c38('0x35')]);return db[_0x4c38('0x20')][_0x4c38('0x36')](_0x5a5162)[_0x4c38('0x1c')](handleEntityNotFound(_0x496f9a,null))[_0x4c38('0x1c')](respondWithResult(_0x496f9a,null))[_0x4c38('0x29')](handleError(_0x496f9a,null));};exports[_0x4c38('0x37')]=function(_0x1d7dc3,_0x49ad42){return db['SmsInteraction']['create'](_0x1d7dc3['body'],{})['then'](respondWithResult(_0x49ad42,0xc9))[_0x4c38('0x29')](handleError(_0x49ad42,null));};exports[_0x4c38('0x1a')]=function(_0x3290c0,_0x160273){if(_0x3290c0['body']['id']){delete _0x3290c0[_0x4c38('0x38')]['id'];}return db[_0x4c38('0x20')][_0x4c38('0x36')]({'where':{'id':_0x3290c0[_0x4c38('0x2b')]['id']}})[_0x4c38('0x1c')](handleEntityNotFound(_0x160273,null))[_0x4c38('0x1c')](saveUpdates(_0x3290c0[_0x4c38('0x38')],null))[_0x4c38('0x1c')](respondWithResult(_0x160273,null))[_0x4c38('0x29')](handleError(_0x160273,null));};exports[_0x4c38('0x1b')]=function(_0x4086aa,_0x5b7ad6){return db[_0x4c38('0x20')]['find']({'where':{'id':_0x4086aa[_0x4c38('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5b7ad6,null))[_0x4c38('0x1c')](removeEntity(_0x5b7ad6,null))['catch'](handleError(_0x5b7ad6,null));};exports[_0x4c38('0x39')]=function(_0x26eeeb,_0x2ef43b){return db[_0x4c38('0x20')][_0x4c38('0x39')]()[_0x4c38('0x1c')](respondWithResult(_0x2ef43b,null))['catch'](handleError(_0x2ef43b,null));};exports['addMessage']=function(_0xbce40a,_0x1a9ab9){return db['SmsMessage']['find']({'where':{'id':_0xbce40a[_0x4c38('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1a9ab9,null))[_0x4c38('0x1c')](function(_0x2d76d5){if(_0x2d76d5){return _0x2d76d5['addMessage'](_0xbce40a[_0x4c38('0x38')]['ids'],_['omit'](_0xbce40a[_0x4c38('0x38')],[_0x4c38('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x1a9ab9,null))[_0x4c38('0x29')](handleError(_0x1a9ab9,null));};exports[_0x4c38('0x3b')]=function(_0x22de5b,_0x24a5d7){var _0x3cf498={'raw':![],'where':{}};var _0xca5418={};var _0x3d9d85={'count':0x0,'rows':[]};return db[_0x4c38('0x20')][_0x4c38('0x3c')]({'where':{'id':_0x22de5b[_0x4c38('0x2b')]['id']}})[_0x4c38('0x1c')](handleEntityNotFound(_0x24a5d7,null))[_0x4c38('0x1c')](function(_0x4fa940){if(_0x4fa940){_0xca5418[_0x4c38('0x2c')]=_[_0x4c38('0x2d')](db[_0x4c38('0x3d')]['rawAttributes']);_0xca5418['query']=_['keys'](_0x22de5b[_0x4c38('0x27')]);_0xca5418[_0x4c38('0x2e')]=_[_0x4c38('0x30')](_0xca5418['model'],_0xca5418[_0x4c38('0x27')]);_0x3cf498['attributes']=_[_0x4c38('0x30')](_0xca5418[_0x4c38('0x2c')],qs[_0x4c38('0x31')](_0x22de5b[_0x4c38('0x27')][_0x4c38('0x31')]));_0x3cf498[_0x4c38('0x2f')]=_0x3cf498[_0x4c38('0x2f')][_0x4c38('0x32')]?_0x3cf498[_0x4c38('0x2f')]:_0xca5418[_0x4c38('0x2c')];if(!_0x22de5b[_0x4c38('0x27')][_0x4c38('0x3e')]('nolimit')){_0x3cf498[_0x4c38('0x17')]=qs[_0x4c38('0x17')](_0x22de5b[_0x4c38('0x27')][_0x4c38('0x17')]);_0x3cf498[_0x4c38('0x15')]=qs[_0x4c38('0x15')](_0x22de5b[_0x4c38('0x27')]['offset']);}_0x3cf498[_0x4c38('0x3f')]=qs[_0x4c38('0x40')](_0x22de5b[_0x4c38('0x27')][_0x4c38('0x40')]);_0x3cf498[_0x4c38('0x41')]=qs[_0x4c38('0x2e')](_[_0x4c38('0x42')](_0x22de5b[_0x4c38('0x27')],_0xca5418[_0x4c38('0x2e')]));_0x3cf498[_0x4c38('0x41')][_0x4c38('0x43')]=_0x4fa940['id'];if(_0x22de5b[_0x4c38('0x27')]['filter']){_0x3cf498[_0x4c38('0x41')]=_[_0x4c38('0x34')](_0x3cf498[_0x4c38('0x41')],{'$or':_[_0x4c38('0x44')](_0x3cf498[_0x4c38('0x2f')],function(_0x5b711d){var _0x17459e={};_0x17459e[_0x5b711d]={'$like':'%'+_0x22de5b[_0x4c38('0x27')][_0x4c38('0x45')]+'%'};return _0x17459e;})});}if(_0x22de5b[_0x4c38('0x27')]['$gte']){var _0x2a9c29=_0x22de5b[_0x4c38('0x27')][_0x4c38('0x46')]['split'](',');var _0x544056={};_0x544056[_0x2a9c29[0x0]]={'$gte':moment(_0x2a9c29[0x1])['format'](_0x4c38('0x47'))};_0x3cf498[_0x4c38('0x41')]=_[_0x4c38('0x34')](_0x3cf498[_0x4c38('0x41')],_0x544056);}_0x3cf498=_[_0x4c38('0x34')]({},_0x3cf498,_0x22de5b[_0x4c38('0x35')]);return db[_0x4c38('0x3d')][_0x4c38('0x18')]({'where':_0x3cf498[_0x4c38('0x41')]})[_0x4c38('0x1c')](function(_0x266eb6){_0x3d9d85[_0x4c38('0x18')]=_0x266eb6;if(_0x22de5b['query'][_0x4c38('0x48')]){_0x3cf498['include']=[{'all':!![]}];}return db['SmsMessage'][_0x4c38('0x25')](_0x3cf498);})[_0x4c38('0x1c')](function(_0x31902b){_0x3d9d85[_0x4c38('0x49')]=_0x31902b;return _0x3d9d85;});}})[_0x4c38('0x1c')](respondWithFilteredResult(_0x24a5d7,_0x3cf498))[_0x4c38('0x29')](handleError(_0x24a5d7,null));};exports[_0x4c38('0x4a')]=function(_0x41e0dc,_0xbc7fbc){return db['SmsInteraction'][_0x4c38('0x36')]({'where':{'id':_0x41e0dc[_0x4c38('0x2b')]['id']}})[_0x4c38('0x1c')](handleEntityNotFound(_0xbc7fbc,null))['then'](function(_0x42a6a1){if(_0x42a6a1){return _0x42a6a1['setTags'](_0x41e0dc[_0x4c38('0x38')][_0x4c38('0x3a')],_[_0x4c38('0x4b')](_0x41e0dc['body'],[_0x4c38('0x3a'),'id'])||{})[_0x4c38('0x4c')](function(){return db[_0x4c38('0x4d')][_0x4c38('0x25')]({'attributes':['id',_0x4c38('0x1d'),_0x4c38('0x4e')],'where':{'id':_0x41e0dc[_0x4c38('0x38')]['ids']}});})[_0x4c38('0x1c')](function(_0x4a7955){socket[_0x4c38('0x4f')](_0x4c38('0x50'),{'id':Number(_0x41e0dc['params']['id']),'tags':_0x4a7955||[]});return{'id':Number(_0x41e0dc['params']['id']),'tags':_0x4a7955||[]};});}})[_0x4c38('0x1c')](respondWithResult(_0xbc7fbc,null))[_0x4c38('0x29')](handleError(_0xbc7fbc,null));};exports[_0x4c38('0x51')]=function(_0x3d524d,_0x5d539c){return db[_0x4c38('0x20')][_0x4c38('0x36')]({'where':{'id':_0x3d524d['params']['id']}})[_0x4c38('0x1c')](handleEntityNotFound(_0x5d539c,null))[_0x4c38('0x1c')](function(_0x2df5c2){if(_0x2df5c2){return _0x2df5c2['removeTags'](_0x3d524d['query'][_0x4c38('0x3a')]);}})[_0x4c38('0x1c')](respondWithStatusCode(_0x5d539c,null))[_0x4c38('0x29')](handleError(_0x5d539c,null));};exports[_0x4c38('0x52')]=function(_0xe9890c,_0x59d66f){var _0x399aa6=moment()['unix']()[_0x4c38('0x53')]();var _0x55aea7=path[_0x4c38('0x54')](config['root'],_0x4c38('0x55'),_0x4c38('0x56'),'tmp');var _0x19968a=path['join'](_0x55aea7,_0x399aa6);var _0x40f355=util[_0x4c38('0x57')](_0x4c38('0x58'),_0xe9890c[_0x4c38('0x2b')]['id'],_0x399aa6);var _0xe32460=path['join'](_0x55aea7,_0x40f355);var _0x5b848a=[];_0x5b848a[_0x4c38('0x59')]({'model':db[_0x4c38('0x5a')],'as':_0x4c38('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x5b848a[_0x4c38('0x59')]({'model':db[_0x4c38('0x5b')],'as':_0x4c38('0x5c'),'attributes':['id',_0x4c38('0x5d'),_0x4c38('0x5e')],'raw':!![]});var _0x55b8d6=[{'model':db[_0x4c38('0x3d')],'as':'Messages','attributes':['id',_0x4c38('0x38'),_0x4c38('0x5f'),_0x4c38('0x60'),_0x4c38('0x61'),_0x4c38('0x62')],'include':_0x5b848a}];_0x55b8d6[_0x4c38('0x59')]({'model':db[_0x4c38('0x63')],'as':_0x4c38('0x64'),'attributes':['id',_0x4c38('0x1d')]});_0x55b8d6[_0x4c38('0x59')]({'model':db['User'],'as':_0x4c38('0x65'),'attributes':['id','fullname']});return db['SmsInteraction']['find']({'where':{'id':_0xe9890c[_0x4c38('0x2b')]['id']},'include':_0x55b8d6})[_0x4c38('0x1c')](handleEntityNotFound(_0x59d66f,null))[_0x4c38('0x1c')](function(_0xce124){if(_0xce124){var _0x964bd5=_0xce124[_0x4c38('0x66')]({'plain':!![]});fs[_0x4c38('0x67')](_0x19968a);var _0x123d28={'channel':'Sms','account':_0x964bd5[_0x4c38('0x64')][_0x4c38('0x1d')],'agent':_0x964bd5[_0x4c38('0x65')]?_0x964bd5[_0x4c38('0x65')][_0x4c38('0x68')]:'N.A.','createdAt':moment(_0x964bd5['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4c38('0x53')](),'closedAt':_0x964bd5[_0x4c38('0x69')]?moment(_0x964bd5[_0x4c38('0x6a')])[_0x4c38('0x57')](_0x4c38('0x47'))['toString']():'','disposition':_0x964bd5[_0x4c38('0x6b')],'messages':_(_0x964bd5[_0x4c38('0x6c')])[_0x4c38('0x45')]({'secret':![]})[_0x4c38('0x44')](function(_0x4d132a){return{'date':moment(_0x4d132a[_0x4c38('0x5f')])[_0x4c38('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4c38('0x53')](),'sender':_0x4d132a[_0x4c38('0x60')]===_0x4c38('0x6d')?_0x4d132a[_0x4c38('0x5a')]?_0x4d132a[_0x4c38('0x5a')][_0x4c38('0x68')]:_0x4c38('0x6e'):_0x4d132a['Contact'][_0x4c38('0x5d')]+(_0x4d132a[_0x4c38('0x5c')][_0x4c38('0x5e')]?'\x20'+_0x4d132a[_0x4c38('0x5c')][_0x4c38('0x5e')]:''),'body':_0x4d132a[_0x4c38('0x38')],'direction':_0x4d132a[_0x4c38('0x60')]===_0x4c38('0x6d')?'A':'C','secret':_0x4d132a[_0x4c38('0x61')],'read':_0x4d132a['read']};})[_0x4c38('0x6f')]()};return ejs[_0x4c38('0x70')](path[_0x4c38('0x54')](config[_0x4c38('0x71')],_0x4c38('0x55'),'views',_0x4c38('0x72')),{'interaction':_0x123d28})[_0x4c38('0x1c')](function(_0x534736){var _0x2e6493=path[_0x4c38('0x54')](_0x19968a,_0x4c38('0x73')+_0x964bd5['id']+'-'+_0x399aa6+_0x4c38('0x74'));var _0x5de887={'path':_0x2e6493,'channel':'Sms','interactionId':_0x964bd5['id']};return pdf[_0x4c38('0x75')](_0x534736,_0x5de887);})[_0x4c38('0x1c')](function(){return new BPromise(function(_0x4e4e37,_0xb70d0){zipdir(_0x19968a,{'saveTo':_0xe32460},function(_0x45a47f,_0x13a634){if(_0x45a47f)return _0xb70d0(_0x45a47f);return _0x4e4e37(_0x13a634);});})[_0x4c38('0x1c')](function(){return new BPromise(function(_0x44ebae,_0x12b4d4){rimraf(_0x19968a,function(_0x2b3366){if(_0x2b3366)_0x12b4d4(_0x2b3366);return _0x44ebae();});});})[_0x4c38('0x1c')](function(){return _0x59d66f[_0x4c38('0x52')](_0xe32460,_0x40f355,function(_0x5dd39d){if(_0x5dd39d){console['log'](_0x4c38('0x76'),_0x5dd39d);}else{fs[_0x4c38('0x77')](_0xe32460);}});});});}else{return _0x59d66f[_0x4c38('0x11')](0xc8);}})['catch'](handleError(_0x59d66f,null));}; \ No newline at end of file +var _0x2d66=['fullname','push','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','YYYY-MM-DD\x20HH:mm:ss','out','System','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','update','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','findAll','query','user','catch','show','model','keys','SmsInteraction','filters','attributes','fields','length','includeAll','merge','options','find','create','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','split','format','include','rows','addTags','spread','Tag','color','emit','removeTags','download','unix','toString','server','tmp','join','transcript-%d-%s.zip','User'];(function(_0x4abb45,_0x3a597e){var _0x3cb80f=function(_0x11f500){while(--_0x11f500){_0x4abb45['push'](_0x4abb45['shift']());}};_0x3cb80f(++_0x3a597e);}(_0x2d66,0x18c));var _0x62d6=function(_0x1b7f95,_0x4bdec0){_0x1b7f95=_0x1b7f95-0x0;var _0x2b5559=_0x2d66[_0x1b7f95];return _0x2b5559;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x62d6('0x0'));var moment=require(_0x62d6('0x1'));var BPromise=require(_0x62d6('0x2'));var util=require('util');var path=require(_0x62d6('0x3'));var ejs=require(_0x62d6('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x62d6('0x5'));var interaction=require(_0x62d6('0x6'));var qs=require(_0x62d6('0x7'));var pdf=require(_0x62d6('0x8'));var logger=require('../../config/logger')(_0x62d6('0x9'));var config=require('../../config/environment');var db=require(_0x62d6('0xa'))['db'];config[_0x62d6('0xb')]=_[_0x62d6('0xc')](config[_0x62d6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x62d6('0xd'))(new Redis(config[_0x62d6('0xb')]));require(_0x62d6('0xe'))[_0x62d6('0xf')](socket);function respondWithStatusCode(_0x1a3560,_0x25899b){_0x25899b=_0x25899b||0xcc;return function(_0x445ae0){if(_0x445ae0){return _0x1a3560[_0x62d6('0x10')](_0x25899b);}return _0x1a3560[_0x62d6('0x11')](_0x25899b)['end']();};}function respondWithResult(_0x18853a,_0xcb677){_0xcb677=_0xcb677||0xc8;return function(_0x39f1be){if(_0x39f1be){return _0x18853a[_0x62d6('0x11')](_0xcb677)[_0x62d6('0x12')](_0x39f1be);}};}function respondWithFilteredResult(_0x316684,_0xb0aea4){return function(_0x54923a){if(_0x54923a){var _0x383ad4=typeof _0xb0aea4[_0x62d6('0x13')]===_0x62d6('0x14')&&typeof _0xb0aea4['limit']===_0x62d6('0x14');var _0x2e02f1=_0x54923a[_0x62d6('0x15')];var _0x309ccb=_0x383ad4?0x0:_0xb0aea4[_0x62d6('0x13')];var _0x1af65a=_0x383ad4?_0x54923a[_0x62d6('0x15')]:_0xb0aea4[_0x62d6('0x13')]+_0xb0aea4['limit'];var _0x27de2f;if(_0x1af65a>=_0x2e02f1){_0x1af65a=_0x2e02f1;_0x27de2f=0xc8;}else{_0x27de2f=0xce;}_0x316684[_0x62d6('0x11')](_0x27de2f);return _0x316684[_0x62d6('0x16')]('Content-Range',_0x309ccb+'-'+_0x1af65a+'/'+_0x2e02f1)[_0x62d6('0x12')](_0x54923a);}return null;};}function saveUpdates(_0x53c804){return function(_0x32da07){if(_0x32da07){return _0x32da07[_0x62d6('0x17')](_0x53c804)[_0x62d6('0x18')](function(_0x4c3f4f){return _0x4c3f4f;});}return null;};}function removeEntity(_0x34fd47){return function(_0x3442fe){if(_0x3442fe){return _0x3442fe[_0x62d6('0x19')]()['then'](function(){_0x34fd47[_0x62d6('0x11')](0xcc)[_0x62d6('0x1a')]();});}};}function handleEntityNotFound(_0x11147d){return function(_0x59b0bd){if(!_0x59b0bd){_0x11147d[_0x62d6('0x10')](0x194);}return _0x59b0bd;};}function handleError(_0x6d1678,_0x287aa5){_0x287aa5=_0x287aa5||0x1f4;return function(_0x25897a){logger[_0x62d6('0x1b')](_0x25897a['stack']);if(_0x25897a[_0x62d6('0x1c')]){delete _0x25897a[_0x62d6('0x1c')];}_0x6d1678[_0x62d6('0x11')](_0x287aa5)[_0x62d6('0x1d')](_0x25897a);};}exports[_0x62d6('0x1e')]=function(_0x1c2460,_0x3e1e10){var _0x3eb850={};var _0x108b8c=_['map'](db['SmsInteraction'][_0x62d6('0x1f')],function(_0x222df9){return{'name':_0x222df9[_0x62d6('0x20')],'type':_0x222df9[_0x62d6('0x21')]['key']};});_0x3eb850=qs['getOptions'](_0x108b8c,_0x1c2460);return interaction[_0x62d6('0x22')]('sms',_0x1c2460[_0x62d6('0x23')],_0x1c2460[_0x62d6('0x24')],_0x3eb850,_0x108b8c)[_0x62d6('0x18')](respondWithFilteredResult(_0x3e1e10,_0x3eb850))[_0x62d6('0x25')](handleError(_0x3e1e10,null));};exports[_0x62d6('0x26')]=function(_0x2609e8,_0x3329ad){var _0x2704e4={'raw':![],'where':{'id':_0x2609e8['params']['id']}},_0x516f6d={};_0x516f6d[_0x62d6('0x27')]=_[_0x62d6('0x28')](db[_0x62d6('0x29')][_0x62d6('0x1f')]);_0x516f6d['query']=_[_0x62d6('0x28')](_0x2609e8['query']);_0x516f6d[_0x62d6('0x2a')]=_['intersection'](_0x516f6d['model'],_0x516f6d['query']);_0x2704e4[_0x62d6('0x2b')]=_['intersection'](_0x516f6d[_0x62d6('0x27')],qs['fields'](_0x2609e8[_0x62d6('0x23')][_0x62d6('0x2c')]));_0x2704e4['attributes']=_0x2704e4['attributes'][_0x62d6('0x2d')]?_0x2704e4[_0x62d6('0x2b')]:_0x516f6d[_0x62d6('0x27')];if(_0x2609e8[_0x62d6('0x23')][_0x62d6('0x2e')]){_0x2704e4['include']=[{'all':!![]}];}_0x2704e4=_[_0x62d6('0x2f')]({},_0x2704e4,_0x2609e8[_0x62d6('0x30')]);return db[_0x62d6('0x29')][_0x62d6('0x31')](_0x2704e4)[_0x62d6('0x18')](handleEntityNotFound(_0x3329ad,null))[_0x62d6('0x18')](respondWithResult(_0x3329ad,null))['catch'](handleError(_0x3329ad,null));};exports[_0x62d6('0x32')]=function(_0x259f5f,_0x276769){return db[_0x62d6('0x29')]['create'](_0x259f5f[_0x62d6('0x33')],{})['then'](respondWithResult(_0x276769,0xc9))[_0x62d6('0x25')](handleError(_0x276769,null));};exports['update']=function(_0x3fb6d6,_0x2f9f02){if(_0x3fb6d6[_0x62d6('0x33')]['id']){delete _0x3fb6d6[_0x62d6('0x33')]['id'];}return db[_0x62d6('0x29')][_0x62d6('0x31')]({'where':{'id':_0x3fb6d6[_0x62d6('0x34')]['id']}})['then'](handleEntityNotFound(_0x2f9f02,null))[_0x62d6('0x18')](saveUpdates(_0x3fb6d6[_0x62d6('0x33')],null))[_0x62d6('0x18')](respondWithResult(_0x2f9f02,null))[_0x62d6('0x25')](handleError(_0x2f9f02,null));};exports[_0x62d6('0x19')]=function(_0x3281ee,_0x488f21){return db[_0x62d6('0x29')][_0x62d6('0x31')]({'where':{'id':_0x3281ee[_0x62d6('0x34')]['id']}})[_0x62d6('0x18')](handleEntityNotFound(_0x488f21,null))[_0x62d6('0x18')](removeEntity(_0x488f21,null))[_0x62d6('0x25')](handleError(_0x488f21,null));};exports[_0x62d6('0x35')]=function(_0x49b5c1,_0x2d062c){return db[_0x62d6('0x29')][_0x62d6('0x35')]()[_0x62d6('0x18')](respondWithResult(_0x2d062c,null))[_0x62d6('0x25')](handleError(_0x2d062c,null));};exports[_0x62d6('0x36')]=function(_0x1c17a5,_0x467dd3){return db[_0x62d6('0x37')][_0x62d6('0x31')]({'where':{'id':_0x1c17a5[_0x62d6('0x34')]['id']}})[_0x62d6('0x18')](handleEntityNotFound(_0x467dd3,null))[_0x62d6('0x18')](function(_0x2db263){if(_0x2db263){return _0x2db263[_0x62d6('0x36')](_0x1c17a5[_0x62d6('0x33')][_0x62d6('0x38')],_[_0x62d6('0x39')](_0x1c17a5[_0x62d6('0x33')],[_0x62d6('0x38'),'id'])||{});}})['then'](respondWithResult(_0x467dd3,null))['catch'](handleError(_0x467dd3,null));};exports[_0x62d6('0x3a')]=function(_0x55e14b,_0x1f7279){var _0x478fd9={'raw':![],'where':{}};var _0xc8eac8={};var _0x4e74a3={'count':0x0,'rows':[]};return db[_0x62d6('0x29')][_0x62d6('0x3b')]({'where':{'id':_0x55e14b['params']['id']}})[_0x62d6('0x18')](handleEntityNotFound(_0x1f7279,null))[_0x62d6('0x18')](function(_0x2e9e29){if(_0x2e9e29){_0xc8eac8['model']=_['keys'](db[_0x62d6('0x37')]['rawAttributes']);_0xc8eac8[_0x62d6('0x23')]=_['keys'](_0x55e14b['query']);_0xc8eac8[_0x62d6('0x2a')]=_['intersection'](_0xc8eac8[_0x62d6('0x27')],_0xc8eac8['query']);_0x478fd9[_0x62d6('0x2b')]=_[_0x62d6('0x3c')](_0xc8eac8[_0x62d6('0x27')],qs[_0x62d6('0x2c')](_0x55e14b['query'][_0x62d6('0x2c')]));_0x478fd9[_0x62d6('0x2b')]=_0x478fd9[_0x62d6('0x2b')][_0x62d6('0x2d')]?_0x478fd9[_0x62d6('0x2b')]:_0xc8eac8['model'];if(!_0x55e14b[_0x62d6('0x23')][_0x62d6('0x3d')](_0x62d6('0x3e'))){_0x478fd9[_0x62d6('0x3f')]=qs['limit'](_0x55e14b['query']['limit']);_0x478fd9[_0x62d6('0x13')]=qs[_0x62d6('0x13')](_0x55e14b['query'][_0x62d6('0x13')]);}_0x478fd9[_0x62d6('0x40')]=qs[_0x62d6('0x41')](_0x55e14b[_0x62d6('0x23')][_0x62d6('0x41')]);_0x478fd9[_0x62d6('0x42')]=qs[_0x62d6('0x2a')](_[_0x62d6('0x43')](_0x55e14b[_0x62d6('0x23')],_0xc8eac8[_0x62d6('0x2a')]));_0x478fd9[_0x62d6('0x42')]['SmsInteractionId']=_0x2e9e29['id'];if(_0x55e14b['query'][_0x62d6('0x44')]){_0x478fd9[_0x62d6('0x42')]=_[_0x62d6('0x2f')](_0x478fd9[_0x62d6('0x42')],{'$or':_[_0x62d6('0x45')](_0x478fd9['attributes'],function(_0xb2d6a1){var _0x298add={};_0x298add[_0xb2d6a1]={'$like':'%'+_0x55e14b[_0x62d6('0x23')][_0x62d6('0x44')]+'%'};return _0x298add;})});}if(_0x55e14b[_0x62d6('0x23')]['$gte']){var _0x656fe8=_0x55e14b[_0x62d6('0x23')]['$gte'][_0x62d6('0x46')](',');var _0x1c3d3b={};_0x1c3d3b[_0x656fe8[0x0]]={'$gte':moment(_0x656fe8[0x1])[_0x62d6('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x478fd9[_0x62d6('0x42')]=_[_0x62d6('0x2f')](_0x478fd9['where'],_0x1c3d3b);}_0x478fd9=_['merge']({},_0x478fd9,_0x55e14b[_0x62d6('0x30')]);return db['SmsMessage'][_0x62d6('0x15')]({'where':_0x478fd9['where']})[_0x62d6('0x18')](function(_0xd75c46){_0x4e74a3[_0x62d6('0x15')]=_0xd75c46;if(_0x55e14b[_0x62d6('0x23')]['includeAll']){_0x478fd9[_0x62d6('0x48')]=[{'all':!![]}];}return db[_0x62d6('0x37')][_0x62d6('0x22')](_0x478fd9);})[_0x62d6('0x18')](function(_0x142b65){_0x4e74a3[_0x62d6('0x49')]=_0x142b65;return _0x4e74a3;});}})[_0x62d6('0x18')](respondWithFilteredResult(_0x1f7279,_0x478fd9))[_0x62d6('0x25')](handleError(_0x1f7279,null));};exports[_0x62d6('0x4a')]=function(_0x3279d8,_0x5d7fa8){return db[_0x62d6('0x29')][_0x62d6('0x31')]({'where':{'id':_0x3279d8['params']['id']}})[_0x62d6('0x18')](handleEntityNotFound(_0x5d7fa8,null))['then'](function(_0x41fc92){if(_0x41fc92){return _0x41fc92['setTags'](_0x3279d8[_0x62d6('0x33')]['ids'],_[_0x62d6('0x39')](_0x3279d8['body'],[_0x62d6('0x38'),'id'])||{})[_0x62d6('0x4b')](function(){return db[_0x62d6('0x4c')][_0x62d6('0x22')]({'attributes':['id','name',_0x62d6('0x4d')],'where':{'id':_0x3279d8[_0x62d6('0x33')][_0x62d6('0x38')]}});})[_0x62d6('0x18')](function(_0x283186){socket[_0x62d6('0x4e')]('smsInteractionTags:save',{'id':Number(_0x3279d8[_0x62d6('0x34')]['id']),'tags':_0x283186||[]});return{'id':Number(_0x3279d8[_0x62d6('0x34')]['id']),'tags':_0x283186||[]};});}})['then'](respondWithResult(_0x5d7fa8,null))[_0x62d6('0x25')](handleError(_0x5d7fa8,null));};exports[_0x62d6('0x4f')]=function(_0x25f971,_0x281adf){return db['SmsInteraction'][_0x62d6('0x31')]({'where':{'id':_0x25f971['params']['id']}})[_0x62d6('0x18')](handleEntityNotFound(_0x281adf,null))[_0x62d6('0x18')](function(_0x129425){if(_0x129425){return _0x129425[_0x62d6('0x4f')](_0x25f971[_0x62d6('0x23')][_0x62d6('0x38')]);}})['then'](respondWithStatusCode(_0x281adf,null))[_0x62d6('0x25')](handleError(_0x281adf,null));};exports[_0x62d6('0x50')]=function(_0x482531,_0x1e38f8){var _0x161177=moment()[_0x62d6('0x51')]()[_0x62d6('0x52')]();var _0x3a8838=path['join'](config['root'],_0x62d6('0x53'),'files',_0x62d6('0x54'));var _0x5b0075=path[_0x62d6('0x55')](_0x3a8838,_0x161177);var _0x5a29d8=util[_0x62d6('0x47')](_0x62d6('0x56'),_0x482531[_0x62d6('0x34')]['id'],_0x161177);var _0x37718c=path[_0x62d6('0x55')](_0x3a8838,_0x5a29d8);var _0x20f5c2=[];_0x20f5c2['push']({'model':db['User'],'as':_0x62d6('0x57'),'attributes':['id',_0x62d6('0x58')],'raw':!![]});_0x20f5c2[_0x62d6('0x59')]({'model':db['CmContact'],'as':_0x62d6('0x5a'),'attributes':['id',_0x62d6('0x5b'),_0x62d6('0x5c')],'raw':!![]});var _0x4913a9=[{'model':db[_0x62d6('0x37')],'as':_0x62d6('0x5d'),'attributes':['id',_0x62d6('0x33'),_0x62d6('0x5e'),_0x62d6('0x5f'),_0x62d6('0x60'),_0x62d6('0x61')],'include':_0x20f5c2}];_0x4913a9[_0x62d6('0x59')]({'model':db['SmsAccount'],'as':_0x62d6('0x62'),'attributes':['id','name']});_0x4913a9[_0x62d6('0x59')]({'model':db[_0x62d6('0x57')],'as':_0x62d6('0x63'),'attributes':['id',_0x62d6('0x58')]});return db[_0x62d6('0x29')][_0x62d6('0x31')]({'where':{'id':_0x482531[_0x62d6('0x34')]['id']},'include':_0x4913a9})[_0x62d6('0x18')](handleEntityNotFound(_0x1e38f8,null))[_0x62d6('0x18')](function(_0x2874bd){if(_0x2874bd){var _0x34037a=_0x2874bd[_0x62d6('0x64')]({'plain':!![]});fs[_0x62d6('0x65')](_0x5b0075);var _0x41ea73={'channel':'Sms','account':_0x34037a['Account'][_0x62d6('0x1c')],'agent':_0x34037a['Owner']?_0x34037a[_0x62d6('0x63')][_0x62d6('0x58')]:_0x62d6('0x66'),'createdAt':moment(_0x34037a['createdAt'])[_0x62d6('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x62d6('0x52')](),'closedAt':_0x34037a[_0x62d6('0x67')]?moment(_0x34037a[_0x62d6('0x68')])[_0x62d6('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x62d6('0x52')]():'','disposition':_0x34037a[_0x62d6('0x69')],'messages':_(_0x34037a['Messages'])[_0x62d6('0x44')]({'secret':![]})[_0x62d6('0x45')](function(_0x4cce57){return{'date':moment(_0x4cce57[_0x62d6('0x5e')])[_0x62d6('0x47')](_0x62d6('0x6a'))['toString'](),'sender':_0x4cce57[_0x62d6('0x5f')]===_0x62d6('0x6b')?_0x4cce57[_0x62d6('0x57')]?_0x4cce57['User']['fullname']:_0x62d6('0x6c'):_0x4cce57['Contact']['firstName']+(_0x4cce57[_0x62d6('0x5a')][_0x62d6('0x5c')]?'\x20'+_0x4cce57['Contact'][_0x62d6('0x5c')]:''),'body':_0x4cce57[_0x62d6('0x33')],'direction':_0x4cce57['direction']===_0x62d6('0x6b')?'A':'C','secret':_0x4cce57['secret'],'read':_0x4cce57[_0x62d6('0x61')]};})[_0x62d6('0x6d')]()};return ejs[_0x62d6('0x6e')](path[_0x62d6('0x55')](config[_0x62d6('0x6f')],_0x62d6('0x53'),_0x62d6('0x70'),_0x62d6('0x71')),{'interaction':_0x41ea73})[_0x62d6('0x18')](function(_0x103ead){var _0x2aea67=path[_0x62d6('0x55')](_0x5b0075,_0x62d6('0x72')+_0x34037a['id']+'-'+_0x161177+_0x62d6('0x73'));var _0x115168={'path':_0x2aea67,'channel':_0x62d6('0x74'),'interactionId':_0x34037a['id']};return pdf[_0x62d6('0x75')](_0x103ead,_0x115168);})[_0x62d6('0x18')](function(){return new BPromise(function(_0x9175a3,_0x10d137){zipdir(_0x5b0075,{'saveTo':_0x37718c},function(_0x2cbe40,_0x4de257){if(_0x2cbe40)return _0x10d137(_0x2cbe40);return _0x9175a3(_0x4de257);});})[_0x62d6('0x18')](function(){return new BPromise(function(_0x4b1f80,_0x2f8d42){rimraf(_0x5b0075,function(_0x314d92){if(_0x314d92)_0x2f8d42(_0x314d92);return _0x4b1f80();});});})['then'](function(){return _0x1e38f8[_0x62d6('0x50')](_0x37718c,_0x5a29d8,function(_0x199731){if(_0x199731){console[_0x62d6('0x76')](_0x62d6('0x77'),_0x199731);}else{fs[_0x62d6('0x78')](_0x37718c);}});});});}else{return _0x1e38f8['sendStatus'](0xc8);}})[_0x62d6('0x25')](handleError(_0x1e38f8,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5fa9877..c67a755 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 _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0xf147af,_0x495f47){var _0x528f10=function(_0x20167b){while(--_0x20167b){_0xf147af['push'](_0xf147af['shift']());}};_0x528f10(++_0x495f47);}(_0x3266,0x6a));var _0x6326=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x3266[_0x2d34d6];return _0x1d3d12;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x32f4=['remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x29e31b,_0x451c85){var _0x17fb74=function(_0x4d98f0){while(--_0x4d98f0){_0x29e31b['push'](_0x29e31b['shift']());}};_0x17fb74(++_0x451c85);}(_0x32f4,0x154));var _0x432f=function(_0x519d31,_0x442b7b){_0x519d31=_0x519d31-0x0;var _0x4bf6d1=_0x32f4[_0x519d31];return _0x4bf6d1;};'use strict';var EventEmitter=require(_0x432f('0x0'));var SmsInteraction=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var SmsMessage=require(_0x432f('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x432f('0x3')](0x0);var events={'afterCreate':_0x432f('0x4'),'afterUpdate':'update','afterDestroy':_0x432f('0x5')};function emitEvent(_0x1eabac){return function(_0x344a29,_0x355b02,_0x2f5f03){_0x344a29['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f66fd){_0x344a29[_0x432f('0x6')]('Users',_0x2f66fd[_0x432f('0x7')](function(_0x5aaf1a){return{'id':_0x5aaf1a['id']};}));return SmsMessage[_0x432f('0x8')]({'where':{'SmsInteractionId':_0x344a29['id'],'direction':'in','read':![]},'raw':!![]});})[_0x432f('0x9')](function(_0x3a0d4b){_0x344a29[_0x432f('0x6')](_0x432f('0xa'),_0x3a0d4b['length']);SmsInteractionEvents[_0x432f('0xb')](_0x1eabac+':'+_0x344a29['id'],_0x344a29);SmsInteractionEvents['emit'](_0x1eabac,_0x344a29);_0x2f5f03(null);})[_0x432f('0xc')](_0x2f5f03(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x432f('0xd')](e,emitEvent(event));}}module[_0x432f('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 2c3b5be..6437741 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 _0x5afb=['define','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports'];(function(_0xe3f9c3,_0x12473b){var _0x5aa9ac=function(_0x208fc0){while(--_0x208fc0){_0xe3f9c3['push'](_0xe3f9c3['shift']());}};_0x5aa9ac(++_0x12473b);}(_0x5afb,0x65));var _0xb5af=function(_0x3890f8,_0x1b39df){_0x3890f8=_0x3890f8-0x0;var _0x40713e=_0x5afb[_0x3890f8];return _0x40713e;};'use strict';var _=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var logger=require(_0xb5af('0x2'))(_0xb5af('0x3'));var moment=require(_0xb5af('0x4'));var BPromise=require(_0xb5af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5af('0x6'));var rimraf=require(_0xb5af('0x7'));var config=require(_0xb5af('0x8'));var attributes=require(_0xb5af('0x9'));module[_0xb5af('0xa')]=function(_0x43bb3e,_0x3d6bae){return _0x43bb3e[_0xb5af('0xb')]('SmsInteraction',attributes,{'tableName':_0xb5af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x403322,_0x263198,_0xe37d55){if(_0x403322[_0xb5af('0xd')]('closed')){_0x403322['closedAt']=moment()[_0xb5af('0xe')](_0xb5af('0xf'));}_0xe37d55(null,_0x403322);}}});}; \ No newline at end of file +var _0xf620=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x5aef5a,_0x3ad0db){var _0xcff0b4=function(_0x414da0){while(--_0x414da0){_0x5aef5a['push'](_0x5aef5a['shift']());}};_0xcff0b4(++_0x3ad0db);}(_0xf620,0x99));var _0x0f62=function(_0x2bc801,_0x2377a8){_0x2bc801=_0x2bc801-0x0;var _0x5effbe=_0xf620[_0x2bc801];return _0x5effbe;};'use strict';var _=require(_0x0f62('0x0'));var util=require(_0x0f62('0x1'));var logger=require(_0x0f62('0x2'))(_0x0f62('0x3'));var moment=require(_0x0f62('0x4'));var BPromise=require(_0x0f62('0x5'));var rp=require(_0x0f62('0x6'));var fs=require('fs');var path=require(_0x0f62('0x7'));var rimraf=require('rimraf');var config=require(_0x0f62('0x8'));var attributes=require(_0x0f62('0x9'));module['exports']=function(_0x57b14e,_0x452cbb){return _0x57b14e[_0x0f62('0xa')](_0x0f62('0xb'),attributes,{'tableName':_0x0f62('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43e281,_0x48a8bb,_0x210667){if(_0x43e281[_0x0f62('0xd')](_0x0f62('0xe'))){_0x43e281[_0x0f62('0xf')]=moment()[_0x0f62('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x210667(null,_0x43e281);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 3899d24..03aa752 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 _0x5f63=['catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','then','debug','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5f63,0x16e));var _0x35f6=function(_0x29eb84,_0x19e031){_0x29eb84=_0x29eb84-0x0;var _0x84067f=_0x5f63[_0x29eb84];return _0x84067f;};'use strict';var _=require('lodash');var util=require(_0x35f6('0x0'));var moment=require('moment');var BPromise=require(_0x35f6('0x1'));var rs=require(_0x35f6('0x2'));var fs=require('fs');var Redis=require(_0x35f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35f6('0x4'))(_0x35f6('0x5'));var config=require(_0x35f6('0x6'));var jayson=require(_0x35f6('0x7'));var client=jayson[_0x35f6('0x8')]['http']({'port':0x232a});config[_0x35f6('0x9')]=_[_0x35f6('0xa')](config['redis'],{'host':_0x35f6('0xb'),'port':0x18eb});var socket=require(_0x35f6('0xc'))(new Redis(config[_0x35f6('0x9')]));require(_0x35f6('0xd'))[_0x35f6('0xe')](socket);function respondWithRpcPromise(_0x357424,_0x1f01cf,_0x3bbe54){return new BPromise(function(_0x2f91bb,_0x5f5224){return client[_0x35f6('0xf')](_0x357424,_0x3bbe54)['then'](function(_0x2f01b1){logger[_0x35f6('0x10')](_0x35f6('0x11'),_0x1f01cf,'request\x20sent');logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x1f01cf,_0x35f6('0x12'),JSON[_0x35f6('0x13')](_0x2f01b1));if(_0x2f01b1[_0x35f6('0x14')]){if(_0x2f01b1[_0x35f6('0x14')][_0x35f6('0x15')]===0x1f4){logger[_0x35f6('0x14')](_0x35f6('0x11'),_0x1f01cf,_0x2f01b1[_0x35f6('0x14')][_0x35f6('0x16')]);return _0x5f5224(_0x2f01b1[_0x35f6('0x14')][_0x35f6('0x16')]);}logger[_0x35f6('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x1f01cf,_0x2f01b1['error'][_0x35f6('0x16')]);return _0x2f91bb(_0x2f01b1[_0x35f6('0x14')][_0x35f6('0x16')]);}else{logger[_0x35f6('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x1f01cf,'request\x20sent');_0x2f91bb(_0x2f01b1[_0x35f6('0x17')][_0x35f6('0x16')]);}})[_0x35f6('0x18')](function(_0x50283b){logger[_0x35f6('0x14')](_0x35f6('0x11'),_0x1f01cf,_0x50283b);_0x5f5224(_0x50283b);});});}exports[_0x35f6('0x19')]=function(_0x383f16){var _0x2f4278=this;return new Promise(function(_0x4712fc,_0x5a7e35){return db[_0x35f6('0x1a')]['update'](_0x383f16[_0x35f6('0x1b')],{'raw':_0x383f16[_0x35f6('0x1c')]?_0x383f16[_0x35f6('0x1c')][_0x35f6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x383f16['options']?_0x383f16[_0x35f6('0x1c')]['where']||null:null,'attributes':_0x383f16[_0x35f6('0x1c')]?_0x383f16[_0x35f6('0x1c')][_0x35f6('0x1e')]||null:null,'limit':_0x383f16[_0x35f6('0x1c')]?_0x383f16[_0x35f6('0x1c')]['limit']||null:null})[_0x35f6('0x1f')](function(_0xb97875){logger['info'](_0x35f6('0x19'),_0x383f16);logger[_0x35f6('0x20')](_0x35f6('0x19'),_0x383f16,JSON['stringify'](_0xb97875));_0x4712fc(_0xb97875);})[_0x35f6('0x18')](function(_0x413f4d){logger[_0x35f6('0x14')]('UpdateSmsInteraction',_0x413f4d[_0x35f6('0x16')],_0x383f16);_0x5a7e35(_0x2f4278[_0x35f6('0x14')](0x1f4,_0x413f4d['message']));});});};exports[_0x35f6('0x21')]=function(_0x29da0c){return new Promise(function(_0x786c1d,_0x38efd7){return db['SmsInteraction'][_0x35f6('0x22')]({'where':_0x29da0c[_0x35f6('0x1c')]?_0x29da0c[_0x35f6('0x1c')]['where']||null:null})['then'](function(_0x13f358){if(_0x13f358){return _0x13f358['addTags'](_0x29da0c[_0x35f6('0x1b')][_0x35f6('0x23')],_[_0x35f6('0x24')](_0x29da0c[_0x35f6('0x1b')],[_0x35f6('0x23'),'id'])||{});}})[_0x35f6('0x25')](function(_0x5c3394){logger[_0x35f6('0x10')](_0x35f6('0x26'),_0x29da0c);logger[_0x35f6('0x20')](_0x35f6('0x26'),_0x29da0c,JSON[_0x35f6('0x13')](_0x5c3394));_0x786c1d(_0x5c3394);})[_0x35f6('0x18')](function(_0x11d14d){logger[_0x35f6('0x14')](_0x35f6('0x26'),_0x11d14d[_0x35f6('0x16')],_0x29da0c);_0x38efd7(_this[_0x35f6('0x14')](0x1f4,_0x11d14d[_0x35f6('0x16')]));});});}; \ No newline at end of file +var _0xd5a8=['where','attributes','limit','then','debug','AddTagsToSmsInteraction','find','addTags','omit','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateSmsInteraction','SmsInteraction','body','options','raw'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd5a8,0x129));var _0x8d5a=function(_0x337c46,_0x49993f){_0x337c46=_0x337c46-0x0;var _0x48827c=_0xd5a8[_0x337c46];return _0x48827c;};'use strict';var _=require(_0x8d5a('0x0'));var util=require(_0x8d5a('0x1'));var moment=require(_0x8d5a('0x2'));var BPromise=require(_0x8d5a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d5a('0x4'))['db'];var utils=require(_0x8d5a('0x5'));var logger=require(_0x8d5a('0x6'))(_0x8d5a('0x7'));var config=require(_0x8d5a('0x8'));var jayson=require(_0x8d5a('0x9'));var client=jayson[_0x8d5a('0xa')][_0x8d5a('0xb')]({'port':0x232a});config['redis']=_[_0x8d5a('0xc')](config['redis'],{'host':_0x8d5a('0xd'),'port':0x18eb});var socket=require(_0x8d5a('0xe'))(new Redis(config[_0x8d5a('0xf')]));require(_0x8d5a('0x10'))['register'](socket);function respondWithRpcPromise(_0x21eead,_0x27d676,_0x3c33c7){return new BPromise(function(_0x26c073,_0xa49d28){return client[_0x8d5a('0x11')](_0x21eead,_0x3c33c7)['then'](function(_0xb775b2){logger['info'](_0x8d5a('0x12'),_0x27d676,_0x8d5a('0x13'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x27d676,_0x8d5a('0x13'),JSON[_0x8d5a('0x14')](_0xb775b2));if(_0xb775b2[_0x8d5a('0x15')]){if(_0xb775b2[_0x8d5a('0x15')][_0x8d5a('0x16')]===0x1f4){logger[_0x8d5a('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x27d676,_0xb775b2['error'][_0x8d5a('0x17')]);return _0xa49d28(_0xb775b2[_0x8d5a('0x15')][_0x8d5a('0x17')]);}logger[_0x8d5a('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x27d676,_0xb775b2[_0x8d5a('0x15')]['message']);return _0x26c073(_0xb775b2[_0x8d5a('0x15')][_0x8d5a('0x17')]);}else{logger[_0x8d5a('0x18')](_0x8d5a('0x12'),_0x27d676,_0x8d5a('0x13'));_0x26c073(_0xb775b2[_0x8d5a('0x19')]['message']);}})['catch'](function(_0x132767){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x27d676,_0x132767);_0xa49d28(_0x132767);});});}exports[_0x8d5a('0x1a')]=function(_0x533853){var _0x5181fa=this;return new Promise(function(_0x3dcd8c,_0x4c0a59){return db[_0x8d5a('0x1b')]['update'](_0x533853[_0x8d5a('0x1c')],{'raw':_0x533853[_0x8d5a('0x1d')]?_0x533853['options'][_0x8d5a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533853['options']?_0x533853[_0x8d5a('0x1d')][_0x8d5a('0x1f')]||null:null,'attributes':_0x533853[_0x8d5a('0x1d')]?_0x533853[_0x8d5a('0x1d')][_0x8d5a('0x20')]||null:null,'limit':_0x533853[_0x8d5a('0x1d')]?_0x533853['options'][_0x8d5a('0x21')]||null:null})[_0x8d5a('0x22')](function(_0x12198b){logger[_0x8d5a('0x18')](_0x8d5a('0x1a'),_0x533853);logger[_0x8d5a('0x23')](_0x8d5a('0x1a'),_0x533853,JSON[_0x8d5a('0x14')](_0x12198b));_0x3dcd8c(_0x12198b);})['catch'](function(_0x5d64ca){logger[_0x8d5a('0x15')]('UpdateSmsInteraction',_0x5d64ca[_0x8d5a('0x17')],_0x533853);_0x4c0a59(_0x5181fa[_0x8d5a('0x15')](0x1f4,_0x5d64ca['message']));});});};exports[_0x8d5a('0x24')]=function(_0xee3040){return new Promise(function(_0x3fea07,_0x4fd03c){return db[_0x8d5a('0x1b')][_0x8d5a('0x25')]({'where':_0xee3040[_0x8d5a('0x1d')]?_0xee3040['options'][_0x8d5a('0x1f')]||null:null})[_0x8d5a('0x22')](function(_0x1cf166){if(_0x1cf166){return _0x1cf166[_0x8d5a('0x26')](_0xee3040[_0x8d5a('0x1c')]['ids'],_[_0x8d5a('0x27')](_0xee3040[_0x8d5a('0x1c')],['ids','id'])||{});}})['spread'](function(_0x45f604){logger[_0x8d5a('0x18')]('AddTags',_0xee3040);logger[_0x8d5a('0x23')](_0x8d5a('0x28'),_0xee3040,JSON[_0x8d5a('0x14')](_0x45f604));_0x3fea07(_0x45f604);})['catch'](function(_0xb7cdd7){logger['error'](_0x8d5a('0x28'),_0xb7cdd7['message'],_0xee3040);_0x4fd03c(_this['error'](0x1f4,_0xb7cdd7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d9e79ce..1986951 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 _0x3abf=['length','remove','emit','register'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3abf,0x169));var _0xf3ab=function(_0x53a259,_0x5407df){_0x53a259=_0x53a259-0x0;var _0x22d804=_0x3abf[_0x53a259];return _0x22d804;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xf3ab('0x0'),'update'];function createListener(_0x380e18,_0x411648){return function(_0xf2991d){_0x411648[_0xf3ab('0x1')](_0x380e18,_0xf2991d);};}function removeListener(_0x3fea26,_0x532e74){return function(){SmsInteractionEvents['removeListener'](_0x3fea26,_0x532e74);};}exports[_0xf3ab('0x2')]=function(_0x5d790b){for(var _0x1018ee=0x0,_0x551ca0=events[_0xf3ab('0x3')];_0x1018ee<_0x551ca0;_0x1018ee++){var _0x20f84d=events[_0x1018ee];var _0x490a70=createListener('smsInteraction:'+_0x20f84d,_0x5d790b);SmsInteractionEvents['on'](_0x20f84d,_0x490a70);}}; \ No newline at end of file +var _0x3862=['removeListener','register','length','./smsInteraction.events','save'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x3862,0x120));var _0x2386=function(_0x279ab1,_0x527374){_0x279ab1=_0x279ab1-0x0;var _0x8ba87c=_0x3862[_0x279ab1];return _0x8ba87c;};'use strict';var SmsInteractionEvents=require(_0x2386('0x0'));var events=[_0x2386('0x1'),'remove','update'];function createListener(_0x5208ea,_0x2df6ea){return function(_0x2414a6){_0x2df6ea['emit'](_0x5208ea,_0x2414a6);};}function removeListener(_0xce13b8,_0x3b6c34){return function(){SmsInteractionEvents[_0x2386('0x2')](_0xce13b8,_0x3b6c34);};}exports[_0x2386('0x3')]=function(_0x55246a){for(var _0x4fce75=0x0,_0x2bbc88=events[_0x2386('0x4')];_0x4fce75<_0x2bbc88;_0x4fce75++){var _0x5dfa7b=events[_0x4fce75];var _0x2bd5bc=createListener('smsInteraction:'+_0x5dfa7b,_0x55246a);SmsInteractionEvents['on'](_0x5dfa7b,_0x2bd5bc);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index a175126..4851fa9 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 _0xd795=['tracked','smsmessage:create','create','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','fs-extra','../../components/interaction/service','isAuthenticated','/describe','get','/:id','show','post'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0xd795,0x155));var _0x5d79=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xd795[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require(_0x5d79('0x0'));var path=require(_0x5d79('0x1'));var timeout=require(_0x5d79('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5d79('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5d79('0x4'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0x5d79('0x5')](),controller['index']);router['get'](_0x5d79('0x6'),auth[_0x5d79('0x5')](),controller['describe']);router[_0x5d79('0x7')](_0x5d79('0x8'),auth['isAuthenticated'](),controller[_0x5d79('0x9')]);router[_0x5d79('0xa')]('/',auth[_0x5d79('0x5')](),interaction[_0x5d79('0xb')]('sms',_0x5d79('0xc')),controller[_0x5d79('0xd')]);router['post']('/:id/status',controller[_0x5d79('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5d79('0xf')](_0x5d79('0x10'),auth[_0x5d79('0x5')](),controller[_0x5d79('0x11')]);router[_0x5d79('0xf')](_0x5d79('0x12'),auth[_0x5d79('0x5')](),controller[_0x5d79('0x13')]);router[_0x5d79('0x14')](_0x5d79('0x8'),auth[_0x5d79('0x5')](),controller[_0x5d79('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8322=['show','tracked','create','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id'];(function(_0x2aa82b,_0x453a73){var _0x36035b=function(_0x3e14a9){while(--_0x3e14a9){_0x2aa82b['push'](_0x2aa82b['shift']());}};_0x36035b(++_0x453a73);}(_0x8322,0x186));var _0x2832=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x8322[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var path=require(_0x2832('0x2'));var timeout=require(_0x2832('0x3'));var express=require(_0x2832('0x4'));var router=express[_0x2832('0x5')]();var fs_extra=require(_0x2832('0x6'));var auth=require(_0x2832('0x7'));var interaction=require(_0x2832('0x8'));var config=require(_0x2832('0x9'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x2832('0xa')](),controller[_0x2832('0xb')]);router[_0x2832('0xc')](_0x2832('0xd'),auth[_0x2832('0xa')](),controller['describe']);router[_0x2832('0xc')](_0x2832('0xe'),auth[_0x2832('0xa')](),controller[_0x2832('0xf')]);router['post']('/',auth[_0x2832('0xa')](),interaction[_0x2832('0x10')]('sms','smsmessage:create'),controller[_0x2832('0x11')]);router['post']('/:id/status',controller[_0x2832('0x12')]);router[_0x2832('0x13')](_0x2832('0xe'),auth[_0x2832('0xa')](),controller['update']);router[_0x2832('0x13')](_0x2832('0x14'),auth['isAuthenticated'](),controller[_0x2832('0x15')]);router[_0x2832('0x13')](_0x2832('0x16'),auth[_0x2832('0xa')](),controller[_0x2832('0x17')]);router[_0x2832('0x18')](_0x2832('0xe'),auth['isAuthenticated'](),controller[_0x2832('0x19')]);module[_0x2832('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index b293661..f911971 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 _0xac4f=['STRING','DATE','sequelize','TEXT','BOOLEAN','out'];(function(_0x395461,_0x7f289d){var _0x1c9b70=function(_0x453459){while(--_0x453459){_0x395461['push'](_0x395461['shift']());}};_0x1c9b70(++_0x7f289d);}(_0xac4f,0x122));var _0xfac4=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0xac4f[_0x483d8b];return _0x6500f1;};'use strict';var Sequelize=require(_0xfac4('0x0'));module['exports']={'body':{'type':Sequelize[_0xfac4('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfac4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xfac4('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfac4('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xfac4('0x5')]},'secret':{'type':Sequelize[_0xfac4('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfac4('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x95d0=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','exports','medium'];(function(_0x468248,_0x20609d){var _0x29bdbc=function(_0xea9fe6){while(--_0xea9fe6){_0x468248['push'](_0x468248['shift']());}};_0x29bdbc(++_0x20609d);}(_0x95d0,0x1d1));var _0x095d=function(_0x143853,_0x5e442e){_0x143853=_0x143853-0x0;var _0x4bde10=_0x95d0[_0x143853];return _0x4bde10;};'use strict';var Sequelize=require(_0x095d('0x0'));module[_0x095d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x095d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x095d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x095d('0x4')]('in',_0x095d('0x5')),'defaultValue':_0x095d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x095d('0x6')]},'readAt':{'type':Sequelize[_0x095d('0x7')]},'secret':{'type':Sequelize[_0x095d('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x095d('0x6')]},'providerResponse':{'type':Sequelize[_0x095d('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8e8fd3e..84da68f 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 _0x66fa=['delivered','results','infobip','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','interaction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','email','reject','rejectmessage','SmsAccount','type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0x66fa,0x117));var _0xa66f=function(_0x499036,_0x2e2822){_0x499036=_0x499036-0x0;var _0x1b18f4=_0x66fa[_0x499036];return _0x1b18f4;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];config[_0xa66f('0x15')]=_[_0xa66f('0x16')](config[_0xa66f('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa66f('0x15')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x17')][_0xa66f('0x18')]({'port':0x232c});var client9002=jayson[_0xa66f('0x17')][_0xa66f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xd348f9,_0x567d4f,_0x5510dc,_0x19b5ac){return new BPromise(function(_0x32d338,_0x295acf){var _0x403f4d=_0x19b5ac||client;return _0x403f4d['request'](_0xd348f9,_0x5510dc)[_0xa66f('0x19')](function(_0x55b59d){logger['info'](_0xa66f('0x1a'),_0x567d4f,_0xa66f('0x1b'));logger[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x567d4f,_0xa66f('0x1b'),JSON[_0xa66f('0x1e')](_0x55b59d));if(_0x55b59d[_0xa66f('0x1f')]){if(_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x20')]===0x1f4){logger[_0xa66f('0x1f')](_0xa66f('0x1a'),_0x567d4f,_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);return _0x295acf(_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);}logger['error'](_0xa66f('0x1a'),_0x567d4f,_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);return _0x32d338(_0x55b59d[_0xa66f('0x1f')]['message']);}else{logger[_0xa66f('0x22')](_0xa66f('0x1a'),_0x567d4f,_0xa66f('0x1b'));_0x32d338(_0x55b59d[_0xa66f('0x23')]['message']);}})['catch'](function(_0xed98b9){logger['error'](_0xa66f('0x1a'),_0x567d4f,_0xed98b9);_0x295acf(_0xed98b9);});});}function respondWithStatusCode(_0xc661f2,_0x384164){_0x384164=_0x384164||0xcc;return function(_0x57da7f){if(_0x57da7f){return _0xc661f2[_0xa66f('0x24')](_0x384164);}return _0xc661f2[_0xa66f('0x25')](_0x384164)[_0xa66f('0x26')]();};}function respondWithResult(_0x238eb2,_0x17c103){_0x17c103=_0x17c103||0xc8;return function(_0x236046){if(_0x236046){return _0x238eb2[_0xa66f('0x25')](_0x17c103)[_0xa66f('0x27')](_0x236046);}};}function respondWithFilteredResult(_0x20ee67,_0x117d03){return function(_0x45f71c){if(_0x45f71c){var _0x63650b=typeof _0x117d03[_0xa66f('0x28')]===_0xa66f('0x29')&&typeof _0x117d03['limit']==='undefined';var _0x38daac=_0x45f71c[_0xa66f('0x2a')];var _0x55f309=_0x63650b?0x0:_0x117d03[_0xa66f('0x28')];var _0x2de5f3=_0x63650b?_0x45f71c['count']:_0x117d03[_0xa66f('0x28')]+_0x117d03[_0xa66f('0x2b')];var _0x9d78d5;if(_0x2de5f3>=_0x38daac){_0x2de5f3=_0x38daac;_0x9d78d5=0xc8;}else{_0x9d78d5=0xce;}_0x20ee67[_0xa66f('0x25')](_0x9d78d5);return _0x20ee67[_0xa66f('0x2c')]('Content-Range',_0x55f309+'-'+_0x2de5f3+'/'+_0x38daac)[_0xa66f('0x27')](_0x45f71c);}return null;};}function patchUpdates(_0x4fcdc1){return function(_0x306b35){try{jsonpatch[_0xa66f('0x2d')](_0x306b35,_0x4fcdc1,!![]);}catch(_0x2e4dc8){return BPromise['reject'](_0x2e4dc8);}return _0x306b35[_0xa66f('0x2e')]();};}function saveUpdates(_0xadc17d,_0x4f1668){return function(_0x1a5d4a){if(_0x1a5d4a){return _0x1a5d4a[_0xa66f('0x2f')](_0xadc17d)[_0xa66f('0x19')](function(_0x3e7ac5){return _0x3e7ac5;});}return null;};}function removeEntity(_0x10a782,_0x2452d2){return function(_0x25c74c){if(_0x25c74c){return _0x25c74c[_0xa66f('0x30')]()[_0xa66f('0x19')](function(){_0x10a782[_0xa66f('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17984d,_0x5bf736){return function(_0x1c7eda){if(!_0x1c7eda){_0x17984d[_0xa66f('0x24')](0x194);}return _0x1c7eda;};}function handleError(_0x9c7756,_0x3b9261){_0x3b9261=_0x3b9261||0x1f4;return function(_0x3722d3){logger[_0xa66f('0x1f')](_0x3722d3[_0xa66f('0x31')]);if(_0x3722d3[_0xa66f('0x32')]){delete _0x3722d3['name'];}_0x9c7756[_0xa66f('0x25')](_0x3b9261)['send'](_0x3722d3);};}exports[_0xa66f('0x33')]=function(_0x45eeb8,_0x2ed1fb){var _0x47b21a={},_0x4d60f9={},_0x1b9174={'count':0x0,'rows':[]};var _0x4214db=_[_0xa66f('0x34')](db[_0xa66f('0x35')][_0xa66f('0x36')],function(_0x581dca){return{'name':_0x581dca['fieldName'],'type':_0x581dca['type'][_0xa66f('0x37')]};});_0x4d60f9['model']=_['map'](_0x4214db,'name');_0x4d60f9[_0xa66f('0x38')]=_['keys'](_0x45eeb8[_0xa66f('0x38')]);_0x4d60f9[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x4d60f9[_0xa66f('0x3b')],_0x4d60f9[_0xa66f('0x38')]);_0x47b21a[_0xa66f('0x3c')]=_[_0xa66f('0x3a')](_0x4d60f9[_0xa66f('0x3b')],qs[_0xa66f('0x3d')](_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x3d')]));_0x47b21a[_0xa66f('0x3c')]=_0x47b21a[_0xa66f('0x3c')][_0xa66f('0x3e')]?_0x47b21a['attributes']:_0x4d60f9[_0xa66f('0x3b')];if(!_0x45eeb8[_0xa66f('0x38')]['hasOwnProperty'](_0xa66f('0x3f'))){_0x47b21a['limit']=qs[_0xa66f('0x2b')](_0x45eeb8[_0xa66f('0x38')]['limit']);_0x47b21a[_0xa66f('0x28')]=qs[_0xa66f('0x28')](_0x45eeb8[_0xa66f('0x38')]['offset']);}_0x47b21a[_0xa66f('0x40')]=qs['sort'](_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x41')]);_0x47b21a[_0xa66f('0x42')]=qs[_0xa66f('0x39')](_[_0xa66f('0x43')](_0x45eeb8[_0xa66f('0x38')],_0x4d60f9[_0xa66f('0x39')]),_0x4214db);if(_0x45eeb8['query'][_0xa66f('0x44')]){_0x47b21a[_0xa66f('0x42')]=_[_0xa66f('0x45')](_0x47b21a[_0xa66f('0x42')],{'$or':_[_0xa66f('0x34')](_0x4214db,function(_0x50a5ac){if(_0x50a5ac['type']!==_0xa66f('0x46')){var _0x356b7c={};_0x356b7c[_0x50a5ac[_0xa66f('0x32')]]={'$like':'%'+_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x44')]+'%'};return _0x356b7c;}})});}_0x47b21a=_[_0xa66f('0x45')]({},_0x47b21a,_0x45eeb8['options']);var _0x18f1b5={'where':_0x47b21a[_0xa66f('0x42')]};return db[_0xa66f('0x35')]['count'](_0x18f1b5)['then'](function(_0x4568f7){_0x1b9174[_0xa66f('0x2a')]=_0x4568f7;if(_0x45eeb8[_0xa66f('0x38')]['includeAll']){_0x47b21a['include']=[{'all':!![]}];}return db['SmsMessage'][_0xa66f('0x47')](_0x47b21a);})[_0xa66f('0x19')](function(_0x40d3b6){_0x1b9174[_0xa66f('0x48')]=_0x40d3b6;return _0x1b9174;})[_0xa66f('0x19')](respondWithFilteredResult(_0x2ed1fb,_0x47b21a))[_0xa66f('0x49')](handleError(_0x2ed1fb,null));};exports[_0xa66f('0x4a')]=function(_0x15de06,_0x56758a){var _0x1a299c={'raw':!![],'where':{'id':_0x15de06[_0xa66f('0x4b')]['id']}},_0x962415={};_0x962415[_0xa66f('0x3b')]=_[_0xa66f('0x4c')](db[_0xa66f('0x35')]['rawAttributes']);_0x962415[_0xa66f('0x38')]=_[_0xa66f('0x4c')](_0x15de06[_0xa66f('0x38')]);_0x962415[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x962415['model'],_0x962415[_0xa66f('0x38')]);_0x1a299c['attributes']=_[_0xa66f('0x3a')](_0x962415['model'],qs['fields'](_0x15de06[_0xa66f('0x38')][_0xa66f('0x3d')]));_0x1a299c[_0xa66f('0x3c')]=_0x1a299c[_0xa66f('0x3c')][_0xa66f('0x3e')]?_0x1a299c[_0xa66f('0x3c')]:_0x962415['model'];if(_0x15de06[_0xa66f('0x38')][_0xa66f('0x4d')]){_0x1a299c[_0xa66f('0x4e')]=[{'all':!![]}];}_0x1a299c=_[_0xa66f('0x45')]({},_0x1a299c,_0x15de06['options']);return db[_0xa66f('0x35')]['find'](_0x1a299c)[_0xa66f('0x19')](handleEntityNotFound(_0x56758a,null))[_0xa66f('0x19')](respondWithResult(_0x56758a,null))[_0xa66f('0x49')](handleError(_0x56758a,null));};exports[_0xa66f('0x4f')]=function(_0x167015,_0x3a201f){return db[_0xa66f('0x35')]['create'](_0x167015[_0xa66f('0x50')],{})[_0xa66f('0x19')](respondWithResult(_0x3a201f,0xc9))[_0xa66f('0x49')](handleError(_0x3a201f,null));};exports[_0xa66f('0x2f')]=function(_0x38decb,_0x45989a){if(_0x38decb[_0xa66f('0x50')]['id']){delete _0x38decb[_0xa66f('0x50')]['id'];}return db[_0xa66f('0x35')]['find']({'where':{'id':_0x38decb['params']['id']}})[_0xa66f('0x19')](handleEntityNotFound(_0x45989a,null))[_0xa66f('0x19')](saveUpdates(_0x38decb[_0xa66f('0x50')],null))[_0xa66f('0x19')](respondWithResult(_0x45989a,null))[_0xa66f('0x49')](handleError(_0x45989a,null));};exports[_0xa66f('0x30')]=function(_0x8bea2b,_0x4b10cf){return db[_0xa66f('0x35')][_0xa66f('0x51')]({'where':{'id':_0x8bea2b[_0xa66f('0x4b')]['id']}})[_0xa66f('0x19')](handleEntityNotFound(_0x4b10cf,null))['then'](removeEntity(_0x4b10cf,null))[_0xa66f('0x49')](handleError(_0x4b10cf,null));};exports[_0xa66f('0x52')]=function(_0x19ff30,_0x3bf85a){return db[_0xa66f('0x35')][_0xa66f('0x52')]()['then'](respondWithResult(_0x3bf85a,null))['catch'](handleError(_0x3bf85a,null));};var interaction_log=require(_0xa66f('0x12'))(_0xa66f('0x53'));exports[_0xa66f('0x54')]=function(_0x52edb3,_0x442dd1,_0x39fb04){var _0x310d87={'agent':{},'channel':_0xa66f('0x55')};if(_0x52edb3[_0xa66f('0x50')]['id']){delete _0x52edb3[_0xa66f('0x50')]['id'];}_0x52edb3[_0xa66f('0x50')][_0xa66f('0x56')]=!![];_0x52edb3[_0xa66f('0x50')]['readAt']=moment()[_0xa66f('0x57')](_0xa66f('0x58'));_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')]=_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')]||_0x52edb3[_0xa66f('0x5a')]['id'];_0x310d87[_0xa66f('0x5b')]['id']=_0x52edb3['body']['UserId'];return db[_0xa66f('0x35')][_0xa66f('0x51')]({'where':{'id':_0x52edb3[_0xa66f('0x4b')]['id'],'UserId':null}})[_0xa66f('0x19')](handleEntityNotFound(_0x442dd1,null))[_0xa66f('0x19')](saveUpdates(_0x52edb3['body'],null))[_0xa66f('0x19')](function(_0x4c2b68){if(_0x4c2b68){_0x310d87[_0xa66f('0x21')]=_0x4c2b68[_0xa66f('0x5c')]({'plain':!![]});return db[_0xa66f('0x5d')][_0xa66f('0x51')]({'where':{'id':_0x4c2b68['SmsInteractionId']}});}return null;})[_0xa66f('0x19')](handleEntityNotFound(_0x442dd1,null))[_0xa66f('0x19')](function(_0x31c11b){if(_0x31c11b){return _0x31c11b[_0xa66f('0x2f')]({'UserId':_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')],'read1stAt':_[_0xa66f('0x5e')](_0x31c11b[_0xa66f('0x5f')])?moment()[_0xa66f('0x57')](_0xa66f('0x58')):undefined});}return null;})[_0xa66f('0x19')](function(_0x3eb1f5){if(_0x3eb1f5){_0x310d87['interaction']=_0x3eb1f5[_0xa66f('0x5c')]({'plain':!![]});interaction_log[_0xa66f('0x22')](_0xa66f('0x60'),_0x52edb3[_0xa66f('0x5a')]['id'],_0x52edb3[_0xa66f('0x5a')][_0xa66f('0x32')],_0x52edb3[_0xa66f('0x5a')][_0xa66f('0x61')],_0x310d87['interaction']['id'],_0x52edb3[_0xa66f('0x50')]?JSON[_0xa66f('0x1e')](_0x52edb3[_0xa66f('0x50')]):_0xa66f('0x62'));return respondWithRpcPromise(_0xa66f('0x63'),_0xa66f('0x64'),_0x310d87);}return null;})[_0xa66f('0x19')](function(_0x1f14d1){var _0x4b5785='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f14d1[_0xa66f('0x21')][_0xa66f('0x65')];return db[_0xa66f('0x66')]['query'](_0x4b5785,{'type':db['Sequelize'][_0xa66f('0x67')][_0xa66f('0x68')],'raw':!![]})[_0xa66f('0x19')](function(_0x340dba){return _0x340dba;});})['then'](function(_0x43be19){if(_0x43be19){_0x310d87[_0xa66f('0x21')][_0xa66f('0x69')]=_0x43be19[0x0];if(!_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')])return;return db[_0xa66f('0x6a')][_0xa66f('0x51')]({'where':{'id':_0x52edb3[_0xa66f('0x50')]['UserId'],'role':_0xa66f('0x5b')},'attributes':['id',_0xa66f('0x32'),'fullname','email',_0xa66f('0x6b')],'raw':!![]});}return null;})[_0xa66f('0x19')](function(_0x4ee8e7){if(!_0x4ee8e7)return null;_0x310d87[_0xa66f('0x21')]['agent']=_0x4ee8e7;return _0x310d87;})[_0xa66f('0x19')](function(_0x558380){if(_0x558380){if(_0x52edb3['body']['manual']){_0x310d87[_0xa66f('0x21')][_0xa66f('0x6c')]=util[_0xa66f('0x57')](_0xa66f('0x6d'),_0x52edb3[_0xa66f('0x5a')][_0xa66f('0x32')]);_0x310d87[_0xa66f('0x21')][_0xa66f('0x6e')]=_0x310d87[_0xa66f('0x6e')];_0x310d87[_0xa66f('0x21')][_0xa66f('0x6f')]=_0x310d87[_0xa66f('0x6e')];_0x310d87[_0xa66f('0x21')][_0xa66f('0x70')]=_0xa66f('0x54');return respondWithRpcPromise(_0xa66f('0x71'),'EventManager',{'event':_0xa66f('0x72'),'message':_0x310d87['message']},client9002)[_0xa66f('0x19')](function(){return _0x310d87;});}return _0x310d87;}return null;})['then'](respondWithResult(_0x442dd1,null))[_0xa66f('0x49')](handleError(_0x442dd1,null));};var interaction_log=require(_0xa66f('0x12'))(_0xa66f('0x53'));exports['reject']=function(_0x4ea501,_0x1a1d63,_0x30bbee){var _0x38b869={'agent':{},'channel':_0xa66f('0x55')};if(_0x4ea501[_0xa66f('0x50')]['id']){delete _0x4ea501[_0xa66f('0x50')]['id'];}_0x4ea501[_0xa66f('0x50')]['UserId']=_0x4ea501[_0xa66f('0x50')][_0xa66f('0x59')]||_0x4ea501[_0xa66f('0x5a')]['id'];_0x38b869[_0xa66f('0x5b')]['id']=_0x4ea501[_0xa66f('0x50')][_0xa66f('0x59')];return db[_0xa66f('0x35')][_0xa66f('0x51')]({'where':{'id':_0x4ea501[_0xa66f('0x4b')]['id'],'UserId':null}})[_0xa66f('0x19')](handleEntityNotFound(_0x1a1d63,null))[_0xa66f('0x19')](function(_0x9c7e02){if(_0x9c7e02){_0x38b869[_0xa66f('0x21')]=_0x9c7e02['get']({'plain':!![]});return db[_0xa66f('0x5d')][_0xa66f('0x51')]({'where':{'id':_0x9c7e02[_0xa66f('0x73')]}});}return null;})[_0xa66f('0x19')](handleEntityNotFound(_0x1a1d63,null))[_0xa66f('0x19')](function(_0x31db5c){if(_0x31db5c){_0x38b869[_0xa66f('0x74')]=_0x31db5c[_0xa66f('0x5c')]({'plain':!![]});interaction_log[_0xa66f('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ea501[_0xa66f('0x5a')]['id'],_0x4ea501['user'][_0xa66f('0x32')],_0x4ea501['user'][_0xa66f('0x61')],_0x38b869['interaction']['id'],_0x4ea501[_0xa66f('0x50')]?JSON['stringify'](_0x4ea501[_0xa66f('0x50')]):_0xa66f('0x62'));return respondWithRpcPromise(_0xa66f('0x75'),_0xa66f('0x76'),_0x38b869);}return null;})[_0xa66f('0x19')](function(_0x4539ab){var _0x4d7bae=_0xa66f('0x77')+_0x4539ab[_0xa66f('0x21')][_0xa66f('0x65')];return db['sequelize'][_0xa66f('0x38')](_0x4d7bae,{'type':db[_0xa66f('0x78')]['QueryTypes'][_0xa66f('0x68')],'raw':!![]})[_0xa66f('0x19')](function(_0x5ee6d5){return _0x5ee6d5;});})['then'](function(_0x125bf4){if(_0x125bf4){_0x38b869[_0xa66f('0x21')][_0xa66f('0x69')]=_0x125bf4[0x0];if(!_0x4ea501[_0xa66f('0x50')][_0xa66f('0x59')])return;return db['User'][_0xa66f('0x51')]({'where':{'id':_0x4ea501[_0xa66f('0x50')]['UserId'],'role':_0xa66f('0x5b')},'attributes':['id',_0xa66f('0x32'),'fullname',_0xa66f('0x79'),_0xa66f('0x6b')],'raw':!![]});}return null;})[_0xa66f('0x19')](function(_0x3a30ba){if(!_0x3a30ba)return null;_0x38b869[_0xa66f('0x21')]['agent']=_0x3a30ba;return _0x38b869;})[_0xa66f('0x19')](function(_0x247b26){if(_0x247b26){_0x247b26[_0xa66f('0x21')][_0xa66f('0x6c')]=util[_0xa66f('0x57')](_0xa66f('0x6d'),_0x4ea501['user'][_0xa66f('0x32')]);_0x247b26[_0xa66f('0x21')][_0xa66f('0x6e')]=_0x38b869[_0xa66f('0x6e')];_0x247b26[_0xa66f('0x21')][_0xa66f('0x6f')]=_0x38b869[_0xa66f('0x6e')];_0x247b26['message']['event']=_0xa66f('0x7a');respondWithRpcPromise('EventManager',_0xa66f('0x71'),{'event':_0xa66f('0x7b'),'message':_0x247b26['message']},client9002);return _0x38b869;}return null;})[_0xa66f('0x19')](respondWithResult(_0x1a1d63,null))[_0xa66f('0x49')](handleError(_0x1a1d63,null));};exports[_0xa66f('0x25')]=function(_0x598586,_0x4a2409,_0xfe65cc){if(_0x598586['body']['id']){delete _0x598586[_0xa66f('0x50')]['id'];}var _0x275957;return db[_0xa66f('0x35')]['find']({'where':{'id':_0x598586[_0xa66f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a2409,null))[_0xa66f('0x19')](function(_0xfdb067){if(_0xfdb067){_0x275957=_0xfdb067;return db[_0xa66f('0x7c')][_0xa66f('0x51')]({'where':{'id':_0xfdb067['SmsAccountId']}});}})[_0xa66f('0x19')](handleEntityNotFound(_0x4a2409,null))[_0xa66f('0x19')](function(_0x30e351){if(_0x30e351){logger[_0xa66f('0x1c')](_0xa66f('0x1d'),_0xa66f('0x25'),'received\x20delivery\x20report\x20from',_0x30e351[_0xa66f('0x7d')],util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));switch(_0x30e351[_0xa66f('0x7d')]){case _0xa66f('0x7f'):if(_0x598586['body']['MessageSid']&&_0x598586[_0xa66f('0x50')][_0xa66f('0x80')]===_0x275957[_0xa66f('0x81')]){return _0x275957[_0xa66f('0x2f')]({'read':!![]});}else{logger[_0xa66f('0x1f')](_0xa66f('0x82'),_0xa66f('0x25'),_0xa66f('0x7f'),util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));}break;case _0xa66f('0x83'):if(_0x598586[_0xa66f('0x50')]['MessageUUID']&&_0x598586[_0xa66f('0x50')][_0xa66f('0x84')]===_0x275957['messageId']&&_[_0xa66f('0x85')]([_0xa66f('0x86'),_0xa66f('0x87')],_0x598586['body']['Status'])>=0x0){return _0x275957[_0xa66f('0x2f')]({'read':!![]});}else{logger['error'](_0xa66f('0x82'),_0xa66f('0x25'),'plivio',util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xa568ed=_0x598586[_0xa66f('0x50')][_0xa66f('0x88')][0x0];if(_0xa568ed[_0xa66f('0x25')]['groupName']==='DELIVERED'){return _0x275957[_0xa66f('0x2f')]({'read':!![]});}else{logger[_0xa66f('0x1f')](_0xa66f('0x82'),_0xa66f('0x25'),_0xa66f('0x89'),util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x275957;}})[_0xa66f('0x19')](respondWithResult(_0x4a2409,null))[_0xa66f('0x49')](handleError(_0x4a2409,null));}; \ No newline at end of file +var _0x9f89=['interface','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','groupName','DELIVERED','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','undefined','count','offset','limit','status','Content-Range','apply','reject','save','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsMessage','findAll','rows','show','params','keys','length','find','create','body','update','describe','sms-interactions','accept','sms','read','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize'];(function(_0x3452eb,_0x44035e){var _0x4244fd=function(_0x48564b){while(--_0x48564b){_0x3452eb['push'](_0x3452eb['shift']());}};_0x4244fd(++_0x44035e);}(_0x9f89,0x13d));var _0x99f8=function(_0x2c5f00,_0x3558ec){_0x2c5f00=_0x2c5f00-0x0;var _0x36ddd4=_0x9f89[_0x2c5f00];return _0x36ddd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99f8('0x1'));var rp=require(_0x99f8('0x2'));var moment=require(_0x99f8('0x3'));var BPromise=require(_0x99f8('0x4'));var Mustache=require(_0x99f8('0x5'));var util=require('util');var path=require(_0x99f8('0x6'));var sox=require(_0x99f8('0x7'));var csv=require(_0x99f8('0x8'));var ejs=require(_0x99f8('0x9'));var fs=require('fs');var fs_extra=require(_0x99f8('0xa'));var _=require(_0x99f8('0xb'));var squel=require(_0x99f8('0xc'));var crypto=require('crypto');var jsforce=require(_0x99f8('0xd'));var deskjs=require(_0x99f8('0xe'));var toCsv=require(_0x99f8('0x8'));var querystring=require(_0x99f8('0xf'));var Papa=require('papaparse');var Redis=require(_0x99f8('0x10'));var authService=require(_0x99f8('0x11'));var qs=require(_0x99f8('0x12'));var as=require(_0x99f8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99f8('0x14'))(_0x99f8('0x15'));var utils=require(_0x99f8('0x16'));var config=require(_0x99f8('0x17'));var licenseUtil=require(_0x99f8('0x18'));var db=require(_0x99f8('0x19'))['db'];config[_0x99f8('0x1a')]=_[_0x99f8('0x1b')](config[_0x99f8('0x1a')],{'host':_0x99f8('0x1c'),'port':0x18eb});var socket=require(_0x99f8('0x1d'))(new Redis(config['redis']));require(_0x99f8('0x1e'))[_0x99f8('0x1f')](socket);var jayson=require(_0x99f8('0x20'));var client=jayson[_0x99f8('0x21')][_0x99f8('0x22')]({'port':0x232c});var client9002=jayson[_0x99f8('0x21')][_0x99f8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x25a8a4,_0x29750c,_0x1efc83,_0x3b1579){return new BPromise(function(_0x4841cc,_0x40ef78){var _0xcf7ade=_0x3b1579||client;return _0xcf7ade['request'](_0x25a8a4,_0x1efc83)[_0x99f8('0x23')](function(_0xa7f114){logger['info']('SmsMessage,\x20%s,\x20%s',_0x29750c,_0x99f8('0x24'));logger[_0x99f8('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x29750c,_0x99f8('0x24'),JSON[_0x99f8('0x26')](_0xa7f114));if(_0xa7f114[_0x99f8('0x27')]){if(_0xa7f114[_0x99f8('0x27')]['code']===0x1f4){logger[_0x99f8('0x27')](_0x99f8('0x28'),_0x29750c,_0xa7f114['error'][_0x99f8('0x29')]);return _0x40ef78(_0xa7f114[_0x99f8('0x27')][_0x99f8('0x29')]);}logger[_0x99f8('0x27')](_0x99f8('0x28'),_0x29750c,_0xa7f114[_0x99f8('0x27')][_0x99f8('0x29')]);return _0x4841cc(_0xa7f114[_0x99f8('0x27')][_0x99f8('0x29')]);}else{logger[_0x99f8('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x29750c,_0x99f8('0x24'));_0x4841cc(_0xa7f114[_0x99f8('0x2b')][_0x99f8('0x29')]);}})[_0x99f8('0x2c')](function(_0x52f4ae){logger[_0x99f8('0x27')](_0x99f8('0x28'),_0x29750c,_0x52f4ae);_0x40ef78(_0x52f4ae);});});}function respondWithStatusCode(_0x151e04,_0x1a15ff){_0x1a15ff=_0x1a15ff||0xcc;return function(_0x262337){if(_0x262337){return _0x151e04[_0x99f8('0x2d')](_0x1a15ff);}return _0x151e04['status'](_0x1a15ff)[_0x99f8('0x2e')]();};}function respondWithResult(_0x45509e,_0x591979){_0x591979=_0x591979||0xc8;return function(_0x548602){if(_0x548602){return _0x45509e['status'](_0x591979)['json'](_0x548602);}};}function respondWithFilteredResult(_0x55343e,_0x3599e5){return function(_0x3545e9){if(_0x3545e9){var _0x8c35ff=typeof _0x3599e5['offset']==='undefined'&&typeof _0x3599e5['limit']===_0x99f8('0x2f');var _0x16b350=_0x3545e9[_0x99f8('0x30')];var _0x3668e2=_0x8c35ff?0x0:_0x3599e5[_0x99f8('0x31')];var _0x2e7032=_0x8c35ff?_0x3545e9[_0x99f8('0x30')]:_0x3599e5[_0x99f8('0x31')]+_0x3599e5[_0x99f8('0x32')];var _0x1a446c;if(_0x2e7032>=_0x16b350){_0x2e7032=_0x16b350;_0x1a446c=0xc8;}else{_0x1a446c=0xce;}_0x55343e[_0x99f8('0x33')](_0x1a446c);return _0x55343e['set'](_0x99f8('0x34'),_0x3668e2+'-'+_0x2e7032+'/'+_0x16b350)['json'](_0x3545e9);}return null;};}function patchUpdates(_0x15f507){return function(_0x4e0f7f){try{jsonpatch[_0x99f8('0x35')](_0x4e0f7f,_0x15f507,!![]);}catch(_0x9362e2){return BPromise[_0x99f8('0x36')](_0x9362e2);}return _0x4e0f7f[_0x99f8('0x37')]();};}function saveUpdates(_0x121930,_0x2fbff0){return function(_0xd2187d){if(_0xd2187d){return _0xd2187d['update'](_0x121930)[_0x99f8('0x23')](function(_0x9ba832){return _0x9ba832;});}return null;};}function removeEntity(_0x40060f,_0x1b4c72){return function(_0x3daef3){if(_0x3daef3){return _0x3daef3[_0x99f8('0x38')]()['then'](function(){_0x40060f['status'](0xcc)[_0x99f8('0x2e')]();});}};}function handleEntityNotFound(_0xf36408,_0x44f871){return function(_0x54a9b2){if(!_0x54a9b2){_0xf36408[_0x99f8('0x2d')](0x194);}return _0x54a9b2;};}function handleError(_0x539886,_0x5a8616){_0x5a8616=_0x5a8616||0x1f4;return function(_0x421c0c){logger[_0x99f8('0x27')](_0x421c0c[_0x99f8('0x39')]);if(_0x421c0c['name']){delete _0x421c0c[_0x99f8('0x3a')];}_0x539886['status'](_0x5a8616)['send'](_0x421c0c);};}exports['index']=function(_0x112d46,_0x55d679){var _0x1393b6={},_0xae8e98={},_0x1bac46={'count':0x0,'rows':[]};var _0x53c2f9=_[_0x99f8('0x3b')](db['SmsMessage'][_0x99f8('0x3c')],function(_0x2a10e0){return{'name':_0x2a10e0[_0x99f8('0x3d')],'type':_0x2a10e0[_0x99f8('0x3e')][_0x99f8('0x3f')]};});_0xae8e98[_0x99f8('0x40')]=_[_0x99f8('0x3b')](_0x53c2f9,_0x99f8('0x3a'));_0xae8e98[_0x99f8('0x41')]=_['keys'](_0x112d46[_0x99f8('0x41')]);_0xae8e98[_0x99f8('0x42')]=_[_0x99f8('0x43')](_0xae8e98['model'],_0xae8e98[_0x99f8('0x41')]);_0x1393b6[_0x99f8('0x44')]=_['intersection'](_0xae8e98['model'],qs[_0x99f8('0x45')](_0x112d46[_0x99f8('0x41')][_0x99f8('0x45')]));_0x1393b6['attributes']=_0x1393b6['attributes']['length']?_0x1393b6[_0x99f8('0x44')]:_0xae8e98[_0x99f8('0x40')];if(!_0x112d46['query'][_0x99f8('0x46')](_0x99f8('0x47'))){_0x1393b6[_0x99f8('0x32')]=qs['limit'](_0x112d46['query'][_0x99f8('0x32')]);_0x1393b6[_0x99f8('0x31')]=qs[_0x99f8('0x31')](_0x112d46[_0x99f8('0x41')]['offset']);}_0x1393b6['order']=qs[_0x99f8('0x48')](_0x112d46['query'][_0x99f8('0x48')]);_0x1393b6[_0x99f8('0x49')]=qs[_0x99f8('0x42')](_[_0x99f8('0x4a')](_0x112d46[_0x99f8('0x41')],_0xae8e98['filters']),_0x53c2f9);if(_0x112d46[_0x99f8('0x41')][_0x99f8('0x4b')]){_0x1393b6[_0x99f8('0x49')]=_[_0x99f8('0x4c')](_0x1393b6[_0x99f8('0x49')],{'$or':_[_0x99f8('0x3b')](_0x53c2f9,function(_0x394434){if(_0x394434[_0x99f8('0x3e')]!==_0x99f8('0x4d')){var _0x889c0b={};_0x889c0b[_0x394434[_0x99f8('0x3a')]]={'$like':'%'+_0x112d46['query'][_0x99f8('0x4b')]+'%'};return _0x889c0b;}})});}_0x1393b6=_[_0x99f8('0x4c')]({},_0x1393b6,_0x112d46[_0x99f8('0x4e')]);var _0x17ff4f={'where':_0x1393b6['where']};return db['SmsMessage'][_0x99f8('0x30')](_0x17ff4f)[_0x99f8('0x23')](function(_0x2f899a){_0x1bac46['count']=_0x2f899a;if(_0x112d46[_0x99f8('0x41')][_0x99f8('0x4f')]){_0x1393b6[_0x99f8('0x50')]=[{'all':!![]}];}return db[_0x99f8('0x51')][_0x99f8('0x52')](_0x1393b6);})[_0x99f8('0x23')](function(_0x2a0f27){_0x1bac46[_0x99f8('0x53')]=_0x2a0f27;return _0x1bac46;})[_0x99f8('0x23')](respondWithFilteredResult(_0x55d679,_0x1393b6))[_0x99f8('0x2c')](handleError(_0x55d679,null));};exports[_0x99f8('0x54')]=function(_0x198089,_0x184e1f){var _0x1c2170={'raw':!![],'where':{'id':_0x198089[_0x99f8('0x55')]['id']}},_0x4d43de={};_0x4d43de[_0x99f8('0x40')]=_[_0x99f8('0x56')](db[_0x99f8('0x51')][_0x99f8('0x3c')]);_0x4d43de[_0x99f8('0x41')]=_[_0x99f8('0x56')](_0x198089['query']);_0x4d43de[_0x99f8('0x42')]=_[_0x99f8('0x43')](_0x4d43de[_0x99f8('0x40')],_0x4d43de[_0x99f8('0x41')]);_0x1c2170[_0x99f8('0x44')]=_[_0x99f8('0x43')](_0x4d43de[_0x99f8('0x40')],qs[_0x99f8('0x45')](_0x198089[_0x99f8('0x41')][_0x99f8('0x45')]));_0x1c2170[_0x99f8('0x44')]=_0x1c2170[_0x99f8('0x44')][_0x99f8('0x57')]?_0x1c2170[_0x99f8('0x44')]:_0x4d43de['model'];if(_0x198089[_0x99f8('0x41')]['includeAll']){_0x1c2170[_0x99f8('0x50')]=[{'all':!![]}];}_0x1c2170=_[_0x99f8('0x4c')]({},_0x1c2170,_0x198089[_0x99f8('0x4e')]);return db[_0x99f8('0x51')][_0x99f8('0x58')](_0x1c2170)[_0x99f8('0x23')](handleEntityNotFound(_0x184e1f,null))[_0x99f8('0x23')](respondWithResult(_0x184e1f,null))[_0x99f8('0x2c')](handleError(_0x184e1f,null));};exports[_0x99f8('0x59')]=function(_0x4807ac,_0xf5dd11){return db[_0x99f8('0x51')]['create'](_0x4807ac[_0x99f8('0x5a')],{})['then'](respondWithResult(_0xf5dd11,0xc9))[_0x99f8('0x2c')](handleError(_0xf5dd11,null));};exports[_0x99f8('0x5b')]=function(_0x427679,_0x172390){if(_0x427679['body']['id']){delete _0x427679[_0x99f8('0x5a')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x427679[_0x99f8('0x55')]['id']}})['then'](handleEntityNotFound(_0x172390,null))[_0x99f8('0x23')](saveUpdates(_0x427679[_0x99f8('0x5a')],null))[_0x99f8('0x23')](respondWithResult(_0x172390,null))[_0x99f8('0x2c')](handleError(_0x172390,null));};exports[_0x99f8('0x38')]=function(_0x2558f0,_0x5e3d25){return db[_0x99f8('0x51')][_0x99f8('0x58')]({'where':{'id':_0x2558f0[_0x99f8('0x55')]['id']}})[_0x99f8('0x23')](handleEntityNotFound(_0x5e3d25,null))[_0x99f8('0x23')](removeEntity(_0x5e3d25,null))[_0x99f8('0x2c')](handleError(_0x5e3d25,null));};exports['describe']=function(_0x42f9dc,_0x3b4ccd){return db[_0x99f8('0x51')][_0x99f8('0x5c')]()[_0x99f8('0x23')](respondWithResult(_0x3b4ccd,null))[_0x99f8('0x2c')](handleError(_0x3b4ccd,null));};var interaction_log=require('../../config/logger')(_0x99f8('0x5d'));exports[_0x99f8('0x5e')]=function(_0x4796ce,_0x6966b,_0x362628){var _0x51f9e0={'agent':{},'channel':_0x99f8('0x5f')};if(_0x4796ce[_0x99f8('0x5a')]['id']){delete _0x4796ce[_0x99f8('0x5a')]['id'];}_0x4796ce[_0x99f8('0x5a')][_0x99f8('0x60')]=!![];_0x4796ce['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4796ce['body'][_0x99f8('0x61')]=_0x4796ce[_0x99f8('0x5a')][_0x99f8('0x61')]||_0x4796ce[_0x99f8('0x62')]['id'];_0x51f9e0[_0x99f8('0x63')]['id']=_0x4796ce['body'][_0x99f8('0x61')];return db[_0x99f8('0x51')]['find']({'where':{'id':_0x4796ce[_0x99f8('0x55')]['id'],'UserId':null}})[_0x99f8('0x23')](handleEntityNotFound(_0x6966b,null))[_0x99f8('0x23')](saveUpdates(_0x4796ce[_0x99f8('0x5a')],null))[_0x99f8('0x23')](function(_0x58fc93){if(_0x58fc93){_0x51f9e0[_0x99f8('0x29')]=_0x58fc93[_0x99f8('0x64')]({'plain':!![]});return db[_0x99f8('0x65')][_0x99f8('0x58')]({'where':{'id':_0x58fc93[_0x99f8('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x6966b,null))[_0x99f8('0x23')](function(_0x2b09ab){if(_0x2b09ab){return _0x2b09ab[_0x99f8('0x5b')]({'UserId':_0x4796ce[_0x99f8('0x5a')][_0x99f8('0x61')],'read1stAt':_[_0x99f8('0x67')](_0x2b09ab[_0x99f8('0x68')])?moment()[_0x99f8('0x69')](_0x99f8('0x6a')):undefined});}return null;})[_0x99f8('0x23')](function(_0x574b4d){if(_0x574b4d){_0x51f9e0['interaction']=_0x574b4d['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4796ce[_0x99f8('0x62')]['id'],_0x4796ce[_0x99f8('0x62')]['name'],_0x4796ce[_0x99f8('0x62')][_0x99f8('0x6b')],_0x51f9e0['interaction']['id'],_0x4796ce[_0x99f8('0x5a')]?JSON['stringify'](_0x4796ce[_0x99f8('0x5a')]):_0x99f8('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x99f8('0x6d'),_0x51f9e0);}return null;})[_0x99f8('0x23')](function(_0x499b37){var _0x24001f=_0x99f8('0x6e')+_0x499b37['message'][_0x99f8('0x6f')];return db['sequelize'][_0x99f8('0x41')](_0x24001f,{'type':db['Sequelize'][_0x99f8('0x70')][_0x99f8('0x71')],'raw':!![]})['then'](function(_0x4989a3){return _0x4989a3;});})[_0x99f8('0x23')](function(_0x3a811b){if(_0x3a811b){_0x51f9e0[_0x99f8('0x29')][_0x99f8('0x72')]=_0x3a811b[0x0];if(!_0x4796ce[_0x99f8('0x5a')][_0x99f8('0x61')])return;return db['User'][_0x99f8('0x58')]({'where':{'id':_0x4796ce['body'][_0x99f8('0x61')],'role':_0x99f8('0x63')},'attributes':['id',_0x99f8('0x3a'),_0x99f8('0x73'),_0x99f8('0x74'),_0x99f8('0x75')],'raw':!![]});}return null;})[_0x99f8('0x23')](function(_0x8a34ca){if(!_0x8a34ca)return null;_0x51f9e0[_0x99f8('0x29')]['agent']=_0x8a34ca;return _0x51f9e0;})['then'](function(_0x29a40b){if(_0x29a40b){if(_0x4796ce[_0x99f8('0x5a')][_0x99f8('0x76')]){_0x51f9e0[_0x99f8('0x29')]['interface']=util['format'](_0x99f8('0x77'),_0x4796ce[_0x99f8('0x62')][_0x99f8('0x3a')]);_0x51f9e0[_0x99f8('0x29')]['channel']=_0x51f9e0['channel'];_0x51f9e0[_0x99f8('0x29')][_0x99f8('0x78')]=_0x51f9e0[_0x99f8('0x79')];_0x51f9e0[_0x99f8('0x29')][_0x99f8('0x7a')]='accept';return respondWithRpcPromise(_0x99f8('0x7b'),_0x99f8('0x7b'),{'event':_0x99f8('0x7c'),'message':_0x51f9e0['message']},client9002)[_0x99f8('0x23')](function(){return _0x51f9e0;});}return _0x51f9e0;}return null;})[_0x99f8('0x23')](respondWithResult(_0x6966b,null))['catch'](handleError(_0x6966b,null));};var interaction_log=require(_0x99f8('0x14'))(_0x99f8('0x5d'));exports[_0x99f8('0x36')]=function(_0x3e7dd1,_0x30f28c,_0x2d37a2){var _0x238362={'agent':{},'channel':_0x99f8('0x5f')};if(_0x3e7dd1['body']['id']){delete _0x3e7dd1[_0x99f8('0x5a')]['id'];}_0x3e7dd1[_0x99f8('0x5a')][_0x99f8('0x61')]=_0x3e7dd1[_0x99f8('0x5a')][_0x99f8('0x61')]||_0x3e7dd1[_0x99f8('0x62')]['id'];_0x238362[_0x99f8('0x63')]['id']=_0x3e7dd1[_0x99f8('0x5a')][_0x99f8('0x61')];return db[_0x99f8('0x51')][_0x99f8('0x58')]({'where':{'id':_0x3e7dd1[_0x99f8('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30f28c,null))[_0x99f8('0x23')](function(_0x107673){if(_0x107673){_0x238362[_0x99f8('0x29')]=_0x107673[_0x99f8('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x99f8('0x58')]({'where':{'id':_0x107673[_0x99f8('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x30f28c,null))['then'](function(_0x46b208){if(_0x46b208){_0x238362[_0x99f8('0x7d')]=_0x46b208[_0x99f8('0x64')]({'plain':!![]});interaction_log[_0x99f8('0x2a')](_0x99f8('0x7e'),_0x3e7dd1['user']['id'],_0x3e7dd1[_0x99f8('0x62')][_0x99f8('0x3a')],_0x3e7dd1[_0x99f8('0x62')][_0x99f8('0x6b')],_0x238362[_0x99f8('0x7d')]['id'],_0x3e7dd1['body']?JSON[_0x99f8('0x26')](_0x3e7dd1[_0x99f8('0x5a')]):'null');return respondWithRpcPromise(_0x99f8('0x7f'),'rejectMessage',_0x238362);}return null;})[_0x99f8('0x23')](function(_0x2dc185){var _0xc616f3=_0x99f8('0x6e')+_0x2dc185[_0x99f8('0x29')][_0x99f8('0x6f')];return db[_0x99f8('0x80')][_0x99f8('0x41')](_0xc616f3,{'type':db[_0x99f8('0x81')]['QueryTypes'][_0x99f8('0x71')],'raw':!![]})[_0x99f8('0x23')](function(_0x470c09){return _0x470c09;});})[_0x99f8('0x23')](function(_0x4bef96){if(_0x4bef96){_0x238362['message']['contact']=_0x4bef96[0x0];if(!_0x3e7dd1[_0x99f8('0x5a')][_0x99f8('0x61')])return;return db['User'][_0x99f8('0x58')]({'where':{'id':_0x3e7dd1[_0x99f8('0x5a')]['UserId'],'role':_0x99f8('0x63')},'attributes':['id',_0x99f8('0x3a'),_0x99f8('0x73'),_0x99f8('0x74'),_0x99f8('0x75')],'raw':!![]});}return null;})['then'](function(_0xbf1b14){if(!_0xbf1b14)return null;_0x238362[_0x99f8('0x29')][_0x99f8('0x63')]=_0xbf1b14;return _0x238362;})[_0x99f8('0x23')](function(_0x48bdec){if(_0x48bdec){_0x48bdec['message'][_0x99f8('0x82')]=util[_0x99f8('0x69')]('SIP/%s',_0x3e7dd1[_0x99f8('0x62')][_0x99f8('0x3a')]);_0x48bdec['message'][_0x99f8('0x79')]=_0x238362[_0x99f8('0x79')];_0x48bdec[_0x99f8('0x29')][_0x99f8('0x78')]=_0x238362[_0x99f8('0x79')];_0x48bdec[_0x99f8('0x29')][_0x99f8('0x7a')]=_0x99f8('0x36');respondWithRpcPromise(_0x99f8('0x7b'),_0x99f8('0x7b'),{'event':_0x99f8('0x83'),'message':_0x48bdec[_0x99f8('0x29')]},client9002);return _0x238362;}return null;})[_0x99f8('0x23')](respondWithResult(_0x30f28c,null))[_0x99f8('0x2c')](handleError(_0x30f28c,null));};exports[_0x99f8('0x33')]=function(_0x3a13a2,_0x3580e3,_0x27c8bc){if(_0x3a13a2[_0x99f8('0x5a')]['id']){delete _0x3a13a2[_0x99f8('0x5a')]['id'];}var _0x42b7a7;return db['SmsMessage'][_0x99f8('0x58')]({'where':{'id':_0x3a13a2[_0x99f8('0x55')]['id']}})[_0x99f8('0x23')](handleEntityNotFound(_0x3580e3,null))[_0x99f8('0x23')](function(_0x528576){if(_0x528576){_0x42b7a7=_0x528576;return db['SmsAccount'][_0x99f8('0x58')]({'where':{'id':_0x528576[_0x99f8('0x84')]}});}})[_0x99f8('0x23')](handleEntityNotFound(_0x3580e3,null))['then'](function(_0x45cc12){if(_0x45cc12){logger['debug'](_0x99f8('0x85'),_0x99f8('0x33'),_0x99f8('0x86'),_0x45cc12[_0x99f8('0x3e')],util[_0x99f8('0x87')](_0x3a13a2[_0x99f8('0x5a')],{'showHidden':![],'depth':null}));switch(_0x45cc12[_0x99f8('0x3e')]){case'twilio':if(_0x3a13a2[_0x99f8('0x5a')][_0x99f8('0x88')]&&_0x3a13a2['body'][_0x99f8('0x88')]===_0x42b7a7[_0x99f8('0x89')]){return _0x42b7a7[_0x99f8('0x5b')]({'read':!![]});}else{logger[_0x99f8('0x27')](_0x99f8('0x8a'),_0x99f8('0x33'),_0x99f8('0x8b'),util['inspect'](_0x3a13a2[_0x99f8('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x99f8('0x8c'):if(_0x3a13a2['body'][_0x99f8('0x8d')]&&_0x3a13a2['body']['MessageUUID']===_0x42b7a7[_0x99f8('0x89')]&&_[_0x99f8('0x8e')](['sent',_0x99f8('0x8f')],_0x3a13a2[_0x99f8('0x5a')][_0x99f8('0x90')])>=0x0){return _0x42b7a7[_0x99f8('0x5b')]({'read':!![]});}else{logger['error'](_0x99f8('0x8a'),_0x99f8('0x33'),_0x99f8('0x91'),util[_0x99f8('0x87')](_0x3a13a2[_0x99f8('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x99f8('0x92'):var _0x110443=_0x3a13a2[_0x99f8('0x5a')]['results'][0x0];if(_0x110443[_0x99f8('0x33')][_0x99f8('0x93')]===_0x99f8('0x94')){return _0x42b7a7['update']({'read':!![]});}else{logger[_0x99f8('0x27')](_0x99f8('0x8a'),_0x99f8('0x33'),'infobip',util[_0x99f8('0x87')](_0x3a13a2[_0x99f8('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x42b7a7;}})[_0x99f8('0x23')](respondWithResult(_0x3580e3,null))[_0x99f8('0x2c')](handleError(_0x3580e3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index dabdd22..16d9a6d 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 _0xbb3a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove'];(function(_0x3a570f,_0x3c6617){var _0x2134d8=function(_0x3d4ee5){while(--_0x3d4ee5){_0x3a570f['push'](_0x3a570f['shift']());}};_0x2134d8(++_0x3c6617);}(_0xbb3a,0xd6));var _0xabb3=function(_0x2a4b69,_0x1af3a9){_0x2a4b69=_0x2a4b69-0x0;var _0x177c03=_0xbb3a[_0x2a4b69];return _0x177c03;};'use strict';var EventEmitter=require(_0xabb3('0x0'));var SmsMessage=require(_0xabb3('0x1'))['db'][_0xabb3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xabb3('0x3')](0x0);var events={'afterCreate':_0xabb3('0x4'),'afterUpdate':'update','afterDestroy':_0xabb3('0x5')};function emitEvent(_0x59ef0f){return function(_0x19bd19,_0xdcd09e,_0xfe3488){SmsMessageEvents[_0xabb3('0x6')](_0x59ef0f+':'+_0x19bd19['id'],_0x19bd19);SmsMessageEvents[_0xabb3('0x6')](_0x59ef0f,_0x19bd19);_0xfe3488(null);};}for(var e in events){if(events[_0xabb3('0x7')](e)){var event=events[e];SmsMessage[_0xabb3('0x8')](e,emitEvent(event));}}module[_0xabb3('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x6f94=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x6f94,0x1cb));var _0x46f9=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6f94[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require(_0x46f9('0x0'));var SmsMessage=require(_0x46f9('0x1'))['db'][_0x46f9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28732a){return function(_0x1f8385,_0x52e085,_0xe53dd8){SmsMessageEvents[_0x46f9('0x3')](_0x28732a+':'+_0x1f8385['id'],_0x1f8385);SmsMessageEvents[_0x46f9('0x3')](_0x28732a,_0x1f8385);_0xe53dd8(null);};}for(var e in events){if(events[_0x46f9('0x4')](e)){var event=events[e];SmsMessage[_0x46f9('0x5')](e,emitEvent(event));}}module[_0x46f9('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 777ca20..a5e8b54 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 _0x245c=['smsMethod','login?username=','password','split','sms','POST','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','md5','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','Token\x20not\x20received','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x245c,0x142));var _0xc245=function(_0x425ca7,_0x2ebd94){_0x425ca7=_0x425ca7-0x0;var _0x541d92=_0x245c[_0x425ca7];return _0x541d92;};'use strict';var _=require(_0xc245('0x0'));var util=require('util');var logger=require(_0xc245('0x1'))(_0xc245('0x2'));var moment=require(_0xc245('0x3'));var BPromise=require(_0xc245('0x4'));var rp=require(_0xc245('0x5'));var fs=require('fs');var path=require(_0xc245('0x6'));var rimraf=require(_0xc245('0x7'));var config=require(_0xc245('0x8'));var attributes=require(_0xc245('0x9'));module[_0xc245('0xa')]=function(_0x39309b,_0x405bae){return _0x39309b[_0xc245('0xb')]('SmsMessage',attributes,{'tableName':_0xc245('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc245('0xd')]},{'name':_0xc245('0xe'),'fields':[_0xc245('0xf')],'type':_0xc245('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3703ee,_0x55e229,_0x127edb){var _0x444bf6=_0x39309b[_0xc245('0x11')];var _0x45e80f=_0x3703ee[_0xc245('0x12')]({'plain':!![]});if(_0x45e80f['direction'][_0xc245('0x13')]()==='in'||_0x45e80f[_0xc245('0x14')][_0xc245('0x13')]()===_0xc245('0x15')&&!_0x45e80f[_0xc245('0x16')]&&!_[_0xc245('0x17')](_0x45e80f[_0xc245('0x18')])&&!_[_0xc245('0x17')](_0x45e80f[_0xc245('0x19')])){_0x444bf6[_0xc245('0x1a')][_0xc245('0x1b')]({'where':{'id':_0x45e80f[_0xc245('0x19')]}})['then'](function(_0x3b8cdb){if(_0x3b8cdb){_0x3b8cdb[_0xc245('0x1c')]({'lastMsgAt':_0x45e80f[_0xc245('0x1d')],'lastMsgDirection':_0x45e80f[_0xc245('0x14')]['toLowerCase']()});}})[_0xc245('0x1e')](function(_0x47eb70){console[_0xc245('0x1f')](_0x47eb70);});}if(_0x45e80f[_0xc245('0x14')]==='out'&&!_0x45e80f[_0xc245('0x16')]){var _0xc3e66b;_0x444bf6[_0xc245('0x20')][_0xc245('0x21')]({'where':{'id':_0x45e80f[_0xc245('0x22')]},'raw':!![]})[_0xc245('0x23')](function(_0x1d0786){_0xc3e66b=_0x1d0786;if(_0xc3e66b&&_0xc3e66b['type']){switch(_0xc3e66b['type']){case _0xc245('0x24'):var _0x7c2776=require('twilio');if(_0xc3e66b[_0xc245('0x25')]&&_0xc3e66b[_0xc245('0x26')]&&_0xc3e66b[_0xc245('0x27')]){var _0xb7e0ac=new _0x7c2776(_0xc3e66b[_0xc245('0x25')],_0xc3e66b[_0xc245('0x26')]);_0xb7e0ac[_0xc245('0x28')][_0xc245('0x29')]({'body':_0x45e80f[_0xc245('0xf')],'to':_0x45e80f[_0xc245('0x27')],'from':_0xc3e66b[_0xc245('0x27')],'statusCallback':_0xc3e66b[_0xc245('0x2a')]+_0xc245('0x2b')+_0x45e80f['id']+_0xc245('0x2c')+_0xc3e66b[_0xc245('0x2d')]})[_0xc245('0x23')](function(_0x3e9f1e){if(_0x3e9f1e[_0xc245('0x2e')]){return _0x3703ee['update']({'messageId':_0x3e9f1e['sid']});}})[_0xc245('0x1e')](function(_0x41bbbb){logger[_0xc245('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc245('0x2f'),_0xc245('0x24'),util[_0xc245('0x30')](_0x41bbbb,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')](_0xc245('0x31'),'afterCreate',_0xc245('0x24'),_0xc245('0x32'));}break;case _0xc245('0x33'):var _0x59c70f='https://api.skebby.it/API/v1.0/REST/';if(_0xc3e66b[_0xc245('0x34')]&&_0xc3e66b['password']){var _0x13a5f1={'recipient':[_0x45e80f['phone']],'message':_0x45e80f[_0xc245('0xf')],'message_type':_0xc3e66b['smsMethod']};if(_0xc3e66b[_0xc245('0x35')]&&_0xc3e66b[_0xc245('0x35')]!=='SI'){_0x13a5f1['sender']=_0xc3e66b[_0xc245('0x27')];}var _0x208f8c={'url':_0x59c70f+_0xc245('0x36')+_0xc3e66b[_0xc245('0x34')]+'&password='+_0xc3e66b[_0xc245('0x37')],'method':'GET'};rp(_0x208f8c)[_0xc245('0x23')](function(_0x29d8e1){var _0x42f06a=_0x29d8e1[_0xc245('0x38')](';');var _0x4782d7={'user_key':_0x42f06a[0x0],'session_key':_0x42f06a[0x1]};_0x208f8c={'url':_0x59c70f+_0xc245('0x39'),'method':_0xc245('0x3a'),'headers':{'user_key':_0x4782d7['user_key'],'Session_key':_0x4782d7['session_key']},'json':!![],'body':_0x13a5f1};return rp(_0x208f8c);})[_0xc245('0x23')](function(_0x6c6055){if(_0x6c6055['total_sent']>=0x1){var _0xcd10a0={'messageId':_0x6c6055[_0xc245('0x3b')]};if(_0xc3e66b['smsMethod']!=='GP'||!_0xc3e66b[_0xc245('0x3c')]){_0xcd10a0[_0xc245('0x3d')]=!![];}return _0x3703ee[_0xc245('0x1c')](_0xcd10a0);}else{return logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),'skebby',util[_0xc245('0x30')](_0x6c6055,{'showHidden':![],'depth':null}));}})[_0xc245('0x1e')](function(_0x1aa9ac){return logger['error'](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x33'),util[_0xc245('0x30')](_0x1aa9ac,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xc245('0x3e'):if(_0xc3e66b[_0xc245('0x26')]){var _0x58290a={'recipient':_0x45e80f[_0xc245('0x27')],'message':_0x45e80f['body'],'sender':_0xc3e66b[_0xc245('0x3f')]||_0xc3e66b[_0xc245('0x27')],'authorization':_0xc3e66b[_0xc245('0x26')]};var _0x55e229={'method':_0xc245('0x3a'),'uri':_0xc245('0x40'),'body':_0x58290a,'json':!![]};rp(_0x55e229)[_0xc245('0x23')](function(_0x20e38e){var _0x443851={'messageId':_0x20e38e[_0xc245('0x41')]};if(!_0xc3e66b[_0xc245('0x3c')]){_0x443851[_0xc245('0x3d')]=!![];}return _0x3703ee[_0xc245('0x1c')](_0x443851);})[_0xc245('0x1e')](function(_0x439886){logger[_0xc245('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc245('0x2f'),_0xc245('0x3e'),util[_0xc245('0x30')](_0x439886,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc245('0x31'),_0xc245('0x2f'),'connectel',_0xc245('0x42'));}break;case _0xc245('0x43'):if(_0xc3e66b[_0xc245('0x34')]&&_0xc3e66b[_0xc245('0x37')]){var _0x58290a={'messages':[{'source':_0xc245('0x44'),'to':_0x45e80f[_0xc245('0x27')],'body':_0x45e80f['body'],'from':_0xc3e66b[_0xc245('0x3f')]||_0xc3e66b['phone']}]};var _0x2f6c07=util[_0xc245('0x45')](_0xc245('0x46'),_0xc3e66b[_0xc245('0x34')],_0xc3e66b['password']);var _0x55e229={'method':_0xc245('0x3a'),'uri':_0xc245('0x47'),'body':_0x58290a,'headers':{'Authorization':util['format'](_0xc245('0x48'),new Buffer(_0x2f6c07)['toString'](_0xc245('0x49')))},'json':!![]};rp(_0x55e229)[_0xc245('0x23')](function(_0x35179e){if(_0x35179e[_0xc245('0x4a')]>=0xc8&&_0x35179e['http_code']<=0xce){if(_0x35179e[_0xc245('0x4b')]&&_0x35179e[_0xc245('0x4b')][_0xc245('0x4c')]>0x0){var _0x1457ea=_[_0xc245('0x4d')](_0x35179e[_0xc245('0x4b')][_0xc245('0x28')]);var _0xd332ac={'messageId':_0x1457ea[_0xc245('0x4e')]};if(!_0xc3e66b[_0xc245('0x3c')]){_0xd332ac[_0xc245('0x3d')]=!![];}return _0x3703ee[_0xc245('0x1c')](_0xd332ac);}else{logger[_0xc245('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc245('0x2f'),'clickSend',util[_0xc245('0x30')](_0x35179e,{'showHidden':![],'depth':null}));}}else{logger[_0xc245('0x1f')](_0xc245('0x31'),'afterCreate',_0xc245('0x4f'),util[_0xc245('0x30')](_0x35179e,{'showHidden':![],'depth':null}));}})[_0xc245('0x1e')](function(_0x6320a3){logger['error'](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x4f'),util['inspect'](_0x6320a3,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x4f'),_0xc245('0x50'));}break;case _0xc245('0x51'):if(_0xc3e66b[_0xc245('0x52')]&&_0xc3e66b[_0xc245('0x26')]){var _0x58290a={'dst':_0x45e80f[_0xc245('0x27')],'text':_0x45e80f[_0xc245('0xf')],'src':_0xc3e66b[_0xc245('0x3f')]||_0xc3e66b[_0xc245('0x27')],'url':_0xc3e66b[_0xc245('0x2a')]+'/api/sms/messages/'+_0x45e80f['id']+_0xc245('0x2c')+_0xc3e66b[_0xc245('0x2d')]};var _0x2f6c07=util['format'](_0xc245('0x46'),_0xc3e66b[_0xc245('0x52')],_0xc3e66b[_0xc245('0x26')]);var _0x55e229={'method':_0xc245('0x3a'),'uri':util[_0xc245('0x45')](_0xc245('0x53'),_0xc3e66b[_0xc245('0x52')]),'body':_0x58290a,'headers':{'Authorization':util[_0xc245('0x45')]('Basic\x20%s',new Buffer(_0x2f6c07)['toString'](_0xc245('0x49')))},'json':!![]};rp(_0x55e229)[_0xc245('0x23')](function(_0x4e732d){var _0x23bca5={'messageId':_0x4e732d['message_uuid'][0x0]};return _0x3703ee['update'](_0x23bca5);})['catch'](function(_0x54ec42){logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x51'),util[_0xc245('0x30')](_0x54ec42,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc245('0x2f'),_0xc245('0x51'),_0xc245('0x54'));}break;case _0xc245('0x55'):if(_0xc3e66b[_0xc245('0x34')]&&_0xc3e66b['password']){if(_0xc3e66b['baseUrl']){var _0x406f91={'method':'POST','uri':_0xc3e66b[_0xc245('0x56')]+_0xc245('0x57'),'body':{'username':_0xc3e66b[_0xc245('0x34')],'password':_0xc3e66b[_0xc245('0x37')]},'json':!![]};return rp(_0x406f91)[_0xc245('0x23')](function(_0x257897){var _0x56aea4={'method':'POST','uri':_0xc3e66b[_0xc245('0x56')]+_0xc245('0x58'),'body':{'messages':[{'from':_0xc3e66b['phone'],'destinations':[{'to':_0x45e80f['phone']}],'text':_0x45e80f['body'],'notifyUrl':_0xc3e66b[_0xc245('0x2a')]+_0xc245('0x2b')+_0x45e80f['id']+_0xc245('0x2c')+_0xc3e66b['token'],'notifyContentType':'application/json','callbackData':_0xc3e66b[_0xc245('0x27')]+';'+_0x45e80f[_0xc245('0xf')]}]},'headers':{'Authorization':_0xc245('0x59')+_0x257897[_0xc245('0x2d')]},'json':!![]};return rp(_0x56aea4)['then'](function(_0x5aff90){if(_0x5aff90[_0xc245('0x28')]){var _0x27586c={'messageId':_0x5aff90[_0xc245('0x28')][0x0][_0xc245('0xd')]};if(!_0xc3e66b[_0xc245('0x3c')]){_0x27586c[_0xc245('0x3d')]=!![];}return _0x3703ee[_0xc245('0x1c')](_0x27586c);}else{return logger['error'](_0xc245('0x31'),'afterCreate',_0xc245('0x55'),util[_0xc245('0x30')](_0x5aff90,{'showHidden':![],'depth':null}));}});})[_0xc245('0x1e')](function(_0x3ecb2a){return logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x55'),util[_0xc245('0x30')](_0x3ecb2a,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),'infobip',_0xc245('0x5a'));}}else{logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x55'),_0xc245('0x50'));}break;case _0xc245('0x5b'):var _0x16a604=require(_0xc245('0x5c'));if(_0xc3e66b[_0xc245('0x5d')]){var _0xb5e323={};_0xb5e323[_0xc245('0x5e')]=_0xc3e66b[_0xc245('0x34')];_0xb5e323[_0xc245('0x27')]=_0x45e80f[_0xc245('0x27')];_0xb5e323['sender']=_0xc3e66b[_0xc245('0x27')];_0xb5e323[_0xc245('0x5f')]=_0x45e80f['body'];_0xb5e323[_0xc245('0x60')]=+new Date();var _0x3b4f17='';var _0x43f000='';var _0x453e5f=Object['keys'](_0xb5e323);_0x453e5f[_0xc245('0x61')]();for(var _0x17d295=0x0;_0x17d295<_0x453e5f[_0xc245('0x62')];_0x17d295++){if(_0x3b4f17!=''){_0x3b4f17+='&';}_0x3b4f17+=_0x453e5f[_0x17d295]+'='+encodeURIComponent(_0xb5e323[_0x453e5f[_0x17d295]]);_0x43f000+=_0xb5e323[_0x453e5f[_0x17d295]];}_0x43f000+=_0xc3e66b[_0xc245('0x5d')];_0x43f000=_0x16a604[_0xc245('0x63')](_0xc245('0x64'))[_0xc245('0x1c')](_0x43f000)[_0xc245('0x65')](_0xc245('0x66'));if(_0x3b4f17!==''){_0x3b4f17+='&';}_0x3b4f17+='signature='+_0x43f000;var _0x208f8c={'method':'GET','uri':_0xc3e66b['baseUrl']+_0xc245('0x67')+_0x3b4f17,'json':!![]};return rp(_0x208f8c)[_0xc245('0x23')](function(_0x3e3e14){var _0x358620=Object['keys'](_0x3e3e14);if(_0x3e3e14[_0x358620[0x0]][_0xc245('0x1f')]&&parseInt(_0x3e3e14[_0x358620[0x0]][_0xc245('0x1f')])===0x0){var _0x4d9a2b={'messageId':_0x3e3e14[_0x358620[0x0]][_0xc245('0x68')]};if(!_0xc3e66b[_0xc245('0x3c')]){_0x4d9a2b[_0xc245('0x3d')]=!![];}return _0x3703ee[_0xc245('0x1c')](_0x4d9a2b);}else{return logger[_0xc245('0x1f')](_0xc245('0x31'),'afterCreate',_0xc245('0x5b'),util[_0xc245('0x30')](_0x3e3e14['error'],{'showHidden':![],'depth':null}));}})[_0xc245('0x1e')](function(_0x17cfff){return logger[_0xc245('0x1f')](_0xc245('0x31'),'afterCreate',_0xc245('0x5b'),util[_0xc245('0x30')](_0x17cfff,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x5b'),_0xc245('0x69'));}break;case _0xc245('0x6a'):if(_0xc3e66b['apiKey']){var _0x5432d1={'method':_0xc245('0x3a'),'uri':_0xc245('0x6b'),'headers':{'Authorization':_0xc3e66b[_0xc245('0x5d')]},'body':{'content':_0x45e80f['body'],'to':[_0x45e80f['phone']],'from':_0xc3e66b[_0xc245('0x27')],'binary':![],'clientMessageId':_0xc245('0x6c'),'charset':_0xc245('0x6d')},'json':!![]};rp(_0x5432d1)[_0xc245('0x23')](function(_0x177dac){if(!_0x177dac[_0xc245('0x1f')]){var _0x2b95d0={'messageId':_0x177dac[_0xc245('0x28')][0x0][_0xc245('0x6e')]};if(!_0xc3e66b[_0xc245('0x3c')]){_0x2b95d0[_0xc245('0x3d')]=!![];}return _0x3703ee[_0xc245('0x1c')](_0x2b95d0);}else{return logger[_0xc245('0x1f')](_0xc245('0x31'),'afterCreate',_0xc245('0x6a'),util['inspect'](_0x177dac['error'],{'showHidden':![],'depth':null}));}})[_0xc245('0x1e')](function(_0x6ded20){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc245('0x2f'),_0xc245('0x6a'),util['inspect'](_0x6ded20,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x6a'),_0xc245('0x69'));}break;case'bandwidth':if(_0xc3e66b[_0xc245('0x34')]&&_0xc3e66b[_0xc245('0x37')]){var _0x2f6c07=util[_0xc245('0x45')]('%s:%s',_0xc3e66b[_0xc245('0x34')],_0xc3e66b[_0xc245('0x37')]);var _0x55e229={'method':_0xc245('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0xc3e66b['accountId']+_0xc245('0x6f'),'body':{'to':[_0x45e80f['phone']],'text':_0x45e80f['body'],'from':_0xc3e66b[_0xc245('0x27')],'applicationId':_0xc3e66b[_0xc245('0x70')]},'headers':{'Authorization':util[_0xc245('0x45')]('Basic\x20%s',new Buffer(_0x2f6c07)['toString'](_0xc245('0x49')))},'json':!![]};rp(_0x55e229)[_0xc245('0x23')](function(_0x2269bb){if(_0x2269bb['id']){var _0x498814={'messageId':_0x2269bb['id']};return _0x3703ee[_0xc245('0x1c')](_0x498814);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc245('0x71'),util['inspect'](_0x2269bb,{'showHidden':![],'depth':null}));}})[_0xc245('0x1e')](function(_0x3c9f62){logger['error'](_0xc245('0x31'),'afterCreate',_0xc245('0x71'),util['inspect'](_0x3c9f62,{'showHidden':![],'depth':null}));});}else{logger[_0xc245('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc245('0x2f'),_0xc245('0x71'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc245('0x72'):if(_0xc3e66b['apiKey']){var _0x48dcb5={};var _0x208f8c={'method':_0xc245('0x3a'),'uri':_0xc245('0x73'),'headers':{'Authorization':_0xc245('0x74')+_0xc3e66b[_0xc245('0x5d')],'Content-Type':'application/json'},'body':{'from':_0xc3e66b[_0xc245('0x27')],'to':_0x45e80f['phone'],'text':_0x45e80f['body']},'json':!![]};return rp(_0x208f8c)['then'](function(_0x34574c){if(_0x34574c[_0xc245('0x75')]==0xca){_0x48dcb5[_0xc245('0x76')]=_0x34574c;var _0x2293cd={'method':_0xc245('0x3a'),'uri':_0xc245('0x77'),'headers':{'Authorization':'Bearer\x20'+_0xc3e66b['apiKey'],'Content-Type':_0xc245('0x78')},'body':{'refid':_0x48dcb5[_0xc245('0x76')][_0xc245('0x79')]},'json':!![]};return rp(_0x2293cd)[_0xc245('0x23')](function(_0x2c94cc){_0x48dcb5['status']=_0x2c94cc;var _0xf2c409={'messageId':_0x48dcb5[_0xc245('0x76')]['refid'],'read':!![]};return _0x3703ee[_0xc245('0x1c')](_0xf2c409);});}else{return logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x72'),util[_0xc245('0x30')](_0x34574c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x19d9bb){return logger['error'](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x72'),util[_0xc245('0x30')](_0x19d9bb,{'showHidden':![],'depth':null}));});}else{return logger[_0xc245('0x1f')](_0xc245('0x31'),_0xc245('0x2f'),_0xc245('0x72'),_0xc245('0x7a'));}break;}}})[_0xc245('0x7b')](function(){_0x127edb();});}else{_0x127edb();}}},'charset':_0xc245('0x7c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3430=['https://api.skebby.it/API/v1.0/REST/','smsMethod','login?username=','&password=','password','sms','POST','user_key','internal_order_id','read','skebby','inspect','Missing\x20parameters:\x20username,\x20password','senderString','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','queued_count','head','messages','message_id','clickSend','plivo','authId','/status?token=','format','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','username','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','login','text','timestamp','sort','length','createHash','hex','GET','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','update','createdAt','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','body','remote','/api/sms/messages/','token','then','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken'];(function(_0x537671,_0x2aedfc){var _0x3e0899=function(_0x292b3e){while(--_0x292b3e){_0x537671['push'](_0x537671['shift']());}};_0x3e0899(++_0x2aedfc);}(_0x3430,0xc8));var _0x0343=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x3430[_0x4b91c4];return _0x25cb80;};'use strict';var _=require('lodash');var util=require(_0x0343('0x0'));var logger=require(_0x0343('0x1'))(_0x0343('0x2'));var moment=require(_0x0343('0x3'));var BPromise=require(_0x0343('0x4'));var rp=require(_0x0343('0x5'));var fs=require('fs');var path=require(_0x0343('0x6'));var rimraf=require('rimraf');var config=require(_0x0343('0x7'));var attributes=require(_0x0343('0x8'));module[_0x0343('0x9')]=function(_0x194de9,_0x1fcc90){return _0x194de9[_0x0343('0xa')](_0x0343('0xb'),attributes,{'tableName':_0x0343('0xc'),'paranoid':![],'indexes':[{'name':_0x0343('0xd'),'fields':['messageId']},{'name':_0x0343('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b8886,_0x322a07,_0x5d7f36){var _0x4d948d=_0x194de9[_0x0343('0xf')];var _0x582b1f=_0x1b8886['get']({'plain':!![]});if(_0x582b1f[_0x0343('0x10')][_0x0343('0x11')]()==='in'||_0x582b1f[_0x0343('0x10')]['toLowerCase']()===_0x0343('0x12')&&!_0x582b1f[_0x0343('0x13')]&&!_[_0x0343('0x14')](_0x582b1f[_0x0343('0x15')])&&!_[_0x0343('0x14')](_0x582b1f['SmsInteractionId'])){_0x4d948d['SmsInteraction'][_0x0343('0x16')]({'where':{'id':_0x582b1f[_0x0343('0x17')]}})['then'](function(_0x504cb1){if(_0x504cb1){_0x504cb1[_0x0343('0x18')]({'lastMsgAt':_0x582b1f[_0x0343('0x19')],'lastMsgDirection':_0x582b1f[_0x0343('0x10')][_0x0343('0x11')]()});}})['catch'](function(_0x511a82){console[_0x0343('0x1a')](_0x511a82);});}if(_0x582b1f[_0x0343('0x10')]==='out'&&!_0x582b1f[_0x0343('0x13')]){var _0x396c2e;_0x4d948d[_0x0343('0x1b')][_0x0343('0x1c')]({'where':{'id':_0x582b1f[_0x0343('0x1d')]},'raw':!![]})['then'](function(_0x3f22a5){_0x396c2e=_0x3f22a5;if(_0x396c2e&&_0x396c2e[_0x0343('0x1e')]){switch(_0x396c2e['type']){case _0x0343('0x1f'):var _0x5d8cbf=require(_0x0343('0x1f'));if(_0x396c2e[_0x0343('0x20')]&&_0x396c2e[_0x0343('0x21')]&&_0x396c2e[_0x0343('0x22')]){var _0x5adf2b=new _0x5d8cbf(_0x396c2e[_0x0343('0x20')],_0x396c2e[_0x0343('0x21')]);_0x5adf2b['messages'][_0x0343('0x23')]({'body':_0x582b1f[_0x0343('0x24')],'to':_0x582b1f[_0x0343('0x22')],'from':_0x396c2e[_0x0343('0x22')],'statusCallback':_0x396c2e[_0x0343('0x25')]+_0x0343('0x26')+_0x582b1f['id']+'/status?token='+_0x396c2e[_0x0343('0x27')]})[_0x0343('0x28')](function(_0x43d340){if(_0x43d340[_0x0343('0x29')]){return _0x1b8886[_0x0343('0x18')]({'messageId':_0x43d340[_0x0343('0x29')]});}})[_0x0343('0x2a')](function(_0x45c5a4){logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x1f'),util['inspect'](_0x45c5a4,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x0343('0x2d'));}break;case'skebby':var _0x52aad8=_0x0343('0x2e');if(_0x396c2e['username']&&_0x396c2e['password']){var _0x467a3d={'recipient':[_0x582b1f[_0x0343('0x22')]],'message':_0x582b1f[_0x0343('0x24')],'message_type':_0x396c2e[_0x0343('0x2f')]};if(_0x396c2e[_0x0343('0x2f')]&&_0x396c2e['smsMethod']!=='SI'){_0x467a3d['sender']=_0x396c2e['phone'];}var _0x413fd0={'url':_0x52aad8+_0x0343('0x30')+_0x396c2e['username']+_0x0343('0x31')+_0x396c2e[_0x0343('0x32')],'method':'GET'};rp(_0x413fd0)[_0x0343('0x28')](function(_0x5a1ca2){var _0x2dd548=_0x5a1ca2['split'](';');var _0x399973={'user_key':_0x2dd548[0x0],'session_key':_0x2dd548[0x1]};_0x413fd0={'url':_0x52aad8+_0x0343('0x33'),'method':_0x0343('0x34'),'headers':{'user_key':_0x399973[_0x0343('0x35')],'Session_key':_0x399973['session_key']},'json':!![],'body':_0x467a3d};return rp(_0x413fd0);})[_0x0343('0x28')](function(_0x3a3b5c){if(_0x3a3b5c['total_sent']>=0x1){var _0x3a87b0={'messageId':_0x3a3b5c[_0x0343('0x36')]};if(_0x396c2e[_0x0343('0x2f')]!=='GP'||!_0x396c2e['deliveryReport']){_0x3a87b0[_0x0343('0x37')]=!![];}return _0x1b8886['update'](_0x3a87b0);}else{return logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x38'),util[_0x0343('0x39')](_0x3a3b5c,{'showHidden':![],'depth':null}));}})[_0x0343('0x2a')](function(_0x33218a){return logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x38'),util[_0x0343('0x39')](_0x33218a,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x38'),_0x0343('0x3a'));}break;case'connectel':if(_0x396c2e[_0x0343('0x21')]){var _0x5a00eb={'recipient':_0x582b1f['phone'],'message':_0x582b1f['body'],'sender':_0x396c2e[_0x0343('0x3b')]||_0x396c2e[_0x0343('0x22')],'authorization':_0x396c2e[_0x0343('0x21')]};var _0x322a07={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x5a00eb,'json':!![]};rp(_0x322a07)[_0x0343('0x28')](function(_0x31a5eb){var _0x44cc22={'messageId':_0x31a5eb['requestid']};if(!_0x396c2e[_0x0343('0x3c')]){_0x44cc22[_0x0343('0x37')]=!![];}return _0x1b8886[_0x0343('0x18')](_0x44cc22);})['catch'](function(_0x42390f){logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x3d'),util[_0x0343('0x39')](_0x42390f,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x3d'),_0x0343('0x3e'));}break;case _0x0343('0x3f'):if(_0x396c2e['username']&&_0x396c2e['password']){var _0x5a00eb={'messages':[{'source':_0x0343('0x40'),'to':_0x582b1f[_0x0343('0x22')],'body':_0x582b1f[_0x0343('0x24')],'from':_0x396c2e[_0x0343('0x3b')]||_0x396c2e['phone']}]};var _0x2fd1a8=util['format'](_0x0343('0x41'),_0x396c2e['username'],_0x396c2e[_0x0343('0x32')]);var _0x322a07={'method':_0x0343('0x34'),'uri':_0x0343('0x42'),'body':_0x5a00eb,'headers':{'Authorization':util['format'](_0x0343('0x43'),new Buffer(_0x2fd1a8)[_0x0343('0x44')](_0x0343('0x45')))},'json':!![]};rp(_0x322a07)['then'](function(_0xa99e8f){if(_0xa99e8f['http_code']>=0xc8&&_0xa99e8f[_0x0343('0x46')]<=0xce){if(_0xa99e8f['data']&&_0xa99e8f['data'][_0x0343('0x47')]>0x0){var _0x3af895=_[_0x0343('0x48')](_0xa99e8f['data'][_0x0343('0x49')]);var _0x149bc1={'messageId':_0x3af895[_0x0343('0x4a')]};if(!_0x396c2e[_0x0343('0x3c')]){_0x149bc1[_0x0343('0x37')]=!![];}return _0x1b8886[_0x0343('0x18')](_0x149bc1);}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),'clickSend',util[_0x0343('0x39')](_0xa99e8f,{'showHidden':![],'depth':null}));}}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),'afterCreate','clickSend',util[_0x0343('0x39')](_0xa99e8f,{'showHidden':![],'depth':null}));}})[_0x0343('0x2a')](function(_0x39b6aa){logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x4b'),util[_0x0343('0x39')](_0x39b6aa,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x4b'),_0x0343('0x3a'));}break;case _0x0343('0x4c'):if(_0x396c2e[_0x0343('0x4d')]&&_0x396c2e[_0x0343('0x21')]){var _0x5a00eb={'dst':_0x582b1f['phone'],'text':_0x582b1f[_0x0343('0x24')],'src':_0x396c2e['senderString']||_0x396c2e[_0x0343('0x22')],'url':_0x396c2e[_0x0343('0x25')]+_0x0343('0x26')+_0x582b1f['id']+_0x0343('0x4e')+_0x396c2e[_0x0343('0x27')]};var _0x2fd1a8=util[_0x0343('0x4f')]('%s:%s',_0x396c2e[_0x0343('0x4d')],_0x396c2e[_0x0343('0x21')]);var _0x322a07={'method':_0x0343('0x34'),'uri':util[_0x0343('0x4f')]('https://api.plivo.com/v1/Account/%s/Message/',_0x396c2e[_0x0343('0x4d')]),'body':_0x5a00eb,'headers':{'Authorization':util[_0x0343('0x4f')]('Basic\x20%s',new Buffer(_0x2fd1a8)[_0x0343('0x44')](_0x0343('0x45')))},'json':!![]};rp(_0x322a07)['then'](function(_0x23da67){var _0x1cbf2c={'messageId':_0x23da67[_0x0343('0x50')][0x0]};return _0x1b8886[_0x0343('0x18')](_0x1cbf2c);})['catch'](function(_0x153f95){logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x4c'),util[_0x0343('0x39')](_0x153f95,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x4c'),_0x0343('0x51'));}break;case _0x0343('0x52'):if(_0x396c2e['username']&&_0x396c2e[_0x0343('0x32')]){if(_0x396c2e[_0x0343('0x53')]){var _0x55e270={'method':_0x0343('0x34'),'uri':_0x396c2e[_0x0343('0x53')]+_0x0343('0x54'),'body':{'username':_0x396c2e[_0x0343('0x55')],'password':_0x396c2e['password']},'json':!![]};return rp(_0x55e270)[_0x0343('0x28')](function(_0x133600){var _0x5c89f7={'method':'POST','uri':_0x396c2e[_0x0343('0x53')]+_0x0343('0x56'),'body':{'messages':[{'from':_0x396c2e[_0x0343('0x22')],'destinations':[{'to':_0x582b1f[_0x0343('0x22')]}],'text':_0x582b1f[_0x0343('0x24')],'notifyUrl':_0x396c2e[_0x0343('0x25')]+_0x0343('0x26')+_0x582b1f['id']+_0x0343('0x4e')+_0x396c2e[_0x0343('0x27')],'notifyContentType':_0x0343('0x57'),'callbackData':_0x396c2e[_0x0343('0x22')]+';'+_0x582b1f['body']}]},'headers':{'Authorization':_0x0343('0x58')+_0x133600[_0x0343('0x27')]},'json':!![]};return rp(_0x5c89f7)['then'](function(_0x54ac0a){if(_0x54ac0a['messages']){var _0x1d5a54={'messageId':_0x54ac0a[_0x0343('0x49')][0x0]['messageId']};if(!_0x396c2e[_0x0343('0x3c')]){_0x1d5a54[_0x0343('0x37')]=!![];}return _0x1b8886[_0x0343('0x18')](_0x1d5a54);}else{return logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),'infobip',util[_0x0343('0x39')](_0x54ac0a,{'showHidden':![],'depth':null}));}});})[_0x0343('0x2a')](function(_0x9c0d79){return logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x52'),util[_0x0343('0x39')](_0x9c0d79,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x52'),_0x0343('0x59'));}}else{logger[_0x0343('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0343('0x2c'),_0x0343('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0343('0x5a'):var _0x54f652=require('crypto');if(_0x396c2e['apiKey']){var _0x3ce9b7={};_0x3ce9b7[_0x0343('0x5b')]=_0x396c2e[_0x0343('0x55')];_0x3ce9b7['phone']=_0x582b1f[_0x0343('0x22')];_0x3ce9b7['sender']=_0x396c2e[_0x0343('0x22')];_0x3ce9b7[_0x0343('0x5c')]=_0x582b1f[_0x0343('0x24')];_0x3ce9b7[_0x0343('0x5d')]=+new Date();var _0x1c9cd5='';var _0x5312c5='';var _0x2da6f4=Object['keys'](_0x3ce9b7);_0x2da6f4[_0x0343('0x5e')]();for(var _0x22f9c9=0x0;_0x22f9c9<_0x2da6f4[_0x0343('0x5f')];_0x22f9c9++){if(_0x1c9cd5!=''){_0x1c9cd5+='&';}_0x1c9cd5+=_0x2da6f4[_0x22f9c9]+'='+encodeURIComponent(_0x3ce9b7[_0x2da6f4[_0x22f9c9]]);_0x5312c5+=_0x3ce9b7[_0x2da6f4[_0x22f9c9]];}_0x5312c5+=_0x396c2e['apiKey'];_0x5312c5=_0x54f652[_0x0343('0x60')]('md5')['update'](_0x5312c5)['digest'](_0x0343('0x61'));if(_0x1c9cd5!==''){_0x1c9cd5+='&';}_0x1c9cd5+='signature='+_0x5312c5;var _0x413fd0={'method':_0x0343('0x62'),'uri':_0x396c2e[_0x0343('0x53')]+_0x0343('0x63')+_0x1c9cd5,'json':!![]};return rp(_0x413fd0)[_0x0343('0x28')](function(_0x5c9d1e){var _0x262baf=Object[_0x0343('0x64')](_0x5c9d1e);if(_0x5c9d1e[_0x262baf[0x0]]['error']&&parseInt(_0x5c9d1e[_0x262baf[0x0]][_0x0343('0x1a')])===0x0){var _0x4ec233={'messageId':_0x5c9d1e[_0x262baf[0x0]]['id_sms']};if(!_0x396c2e[_0x0343('0x3c')]){_0x4ec233[_0x0343('0x37')]=!![];}return _0x1b8886[_0x0343('0x18')](_0x4ec233);}else{return logger['error'](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x5a'),util[_0x0343('0x39')](_0x5c9d1e['error'],{'showHidden':![],'depth':null}));}})[_0x0343('0x2a')](function(_0x3f1c0f){return logger[_0x0343('0x1a')](_0x0343('0x2b'),'afterCreate',_0x0343('0x5a'),util[_0x0343('0x39')](_0x3f1c0f,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),'csc',_0x0343('0x65'));}break;case'clickatell':if(_0x396c2e['apiKey']){var _0x1f7d12={'method':_0x0343('0x34'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x396c2e[_0x0343('0x66')]},'body':{'content':_0x582b1f[_0x0343('0x24')],'to':[_0x582b1f[_0x0343('0x22')]],'from':_0x396c2e[_0x0343('0x22')],'binary':![],'clientMessageId':_0x0343('0x67'),'charset':_0x0343('0x68')},'json':!![]};rp(_0x1f7d12)['then'](function(_0x13ea85){if(!_0x13ea85[_0x0343('0x1a')]){var _0x49952f={'messageId':_0x13ea85[_0x0343('0x49')][0x0][_0x0343('0x69')]};if(!_0x396c2e[_0x0343('0x3c')]){_0x49952f[_0x0343('0x37')]=!![];}return _0x1b8886[_0x0343('0x18')](_0x49952f);}else{return logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x6a'),util['inspect'](_0x13ea85[_0x0343('0x1a')],{'showHidden':![],'depth':null}));}})[_0x0343('0x2a')](function(_0x31da9d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0343('0x2c'),_0x0343('0x6a'),util[_0x0343('0x39')](_0x31da9d,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x6a'),_0x0343('0x65'));}break;case _0x0343('0x6b'):if(_0x396c2e[_0x0343('0x55')]&&_0x396c2e[_0x0343('0x32')]){var _0x2fd1a8=util[_0x0343('0x4f')]('%s:%s',_0x396c2e[_0x0343('0x55')],_0x396c2e['password']);var _0x322a07={'method':_0x0343('0x34'),'uri':_0x0343('0x6c')+_0x396c2e[_0x0343('0x6d')]+_0x0343('0x6e'),'body':{'to':[_0x582b1f[_0x0343('0x22')]],'text':_0x582b1f[_0x0343('0x24')],'from':_0x396c2e['phone'],'applicationId':_0x396c2e['applicationId']},'headers':{'Authorization':util['format'](_0x0343('0x43'),new Buffer(_0x2fd1a8)[_0x0343('0x44')](_0x0343('0x45')))},'json':!![]};rp(_0x322a07)['then'](function(_0x3d3f73){if(_0x3d3f73['id']){var _0x25b70c={'messageId':_0x3d3f73['id']};return _0x1b8886[_0x0343('0x18')](_0x25b70c);}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x6b'),util[_0x0343('0x39')](_0x3d3f73,{'showHidden':![],'depth':null}));}})[_0x0343('0x2a')](function(_0x24bc56){logger['error'](_0x0343('0x2b'),'afterCreate','bandwidth',util[_0x0343('0x39')](_0x24bc56,{'showHidden':![],'depth':null}));});}else{logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0x0343('0x6f'):if(_0x396c2e[_0x0343('0x66')]){var _0x123f9a={};var _0x413fd0={'method':_0x0343('0x34'),'uri':_0x0343('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x396c2e[_0x0343('0x66')],'Content-Type':'application/json'},'body':{'from':_0x396c2e[_0x0343('0x22')],'to':_0x582b1f[_0x0343('0x22')],'text':_0x582b1f[_0x0343('0x24')]},'json':!![]};return rp(_0x413fd0)['then'](function(_0x14810b){if(_0x14810b[_0x0343('0x71')]==0xca){_0x123f9a[_0x0343('0x72')]=_0x14810b;var _0x4d839f={'method':'POST','uri':_0x0343('0x73'),'headers':{'Authorization':_0x0343('0x74')+_0x396c2e['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x123f9a[_0x0343('0x72')]['refid']},'json':!![]};return rp(_0x4d839f)[_0x0343('0x28')](function(_0x3ea487){_0x123f9a[_0x0343('0x75')]=_0x3ea487;var _0x3b991b={'messageId':_0x123f9a[_0x0343('0x72')][_0x0343('0x76')],'read':!![]};return _0x1b8886[_0x0343('0x18')](_0x3b991b);});}else{return logger[_0x0343('0x1a')](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x6f'),util[_0x0343('0x39')](_0x14810b,{'showHidden':![],'depth':null}));}})[_0x0343('0x2a')](function(_0x201d63){return logger['error'](_0x0343('0x2b'),_0x0343('0x2c'),_0x0343('0x6f'),util[_0x0343('0x39')](_0x201d63,{'showHidden':![],'depth':null}));});}else{return logger[_0x0343('0x1a')](_0x0343('0x2b'),'afterCreate',_0x0343('0x6f'),_0x0343('0x77'));}break;}}})[_0x0343('0x78')](function(){_0x5d7f36();});}else{_0x5d7f36();}}},'charset':_0x0343('0x79'),'collate':_0x0343('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 12ba401..5da6fad 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 _0x05cd=['error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a5261,_0x4aa41c){var _0x13b4fb=function(_0x1c8897){while(--_0x1c8897){_0x4a5261['push'](_0x4a5261['shift']());}};_0x13b4fb(++_0x4aa41c);}(_0x05cd,0x133));var _0xd05c=function(_0x27b7a3,_0x5d6585){_0x27b7a3=_0x27b7a3-0x0;var _0x4a0578=_0x05cd[_0x27b7a3];return _0x4a0578;};'use strict';var _=require('lodash');var util=require(_0xd05c('0x0'));var moment=require(_0xd05c('0x1'));var BPromise=require(_0xd05c('0x2'));var rs=require(_0xd05c('0x3'));var fs=require('fs');var Redis=require(_0xd05c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd05c('0x5'));var logger=require(_0xd05c('0x6'))(_0xd05c('0x7'));var config=require(_0xd05c('0x8'));var jayson=require(_0xd05c('0x9'));var client=jayson[_0xd05c('0xa')][_0xd05c('0xb')]({'port':0x232a});config['redis']=_[_0xd05c('0xc')](config['redis'],{'host':_0xd05c('0xd'),'port':0x18eb});var socket=require(_0xd05c('0xe'))(new Redis(config[_0xd05c('0xf')]));require(_0xd05c('0x10'))[_0xd05c('0x11')](socket);function respondWithRpcPromise(_0x1ee970,_0x441f6b,_0x40cfd){return new BPromise(function(_0x29f079,_0x55dabb){return client[_0xd05c('0x12')](_0x1ee970,_0x40cfd)[_0xd05c('0x13')](function(_0x1b0c9a){logger[_0xd05c('0x14')](_0xd05c('0x15'),_0x441f6b,_0xd05c('0x16'));logger[_0xd05c('0x17')](_0xd05c('0x18'),_0x441f6b,_0xd05c('0x16'),JSON[_0xd05c('0x19')](_0x1b0c9a));if(_0x1b0c9a[_0xd05c('0x1a')]){if(_0x1b0c9a[_0xd05c('0x1a')][_0xd05c('0x1b')]===0x1f4){logger[_0xd05c('0x1a')](_0xd05c('0x15'),_0x441f6b,_0x1b0c9a['error'][_0xd05c('0x1c')]);return _0x55dabb(_0x1b0c9a[_0xd05c('0x1a')][_0xd05c('0x1c')]);}logger[_0xd05c('0x1a')](_0xd05c('0x15'),_0x441f6b,_0x1b0c9a[_0xd05c('0x1a')][_0xd05c('0x1c')]);return _0x29f079(_0x1b0c9a[_0xd05c('0x1a')][_0xd05c('0x1c')]);}else{logger[_0xd05c('0x14')](_0xd05c('0x15'),_0x441f6b,_0xd05c('0x16'));_0x29f079(_0x1b0c9a[_0xd05c('0x1d')][_0xd05c('0x1c')]);}})[_0xd05c('0x1e')](function(_0x3c91ab){logger[_0xd05c('0x1a')](_0xd05c('0x15'),_0x441f6b,_0x3c91ab);_0x55dabb(_0x3c91ab);});});}exports['CreateSmsMessage']=function(_0x53d26e){var _0x5c152e=this;return new Promise(function(_0x42119b,_0x1fc899){return db[_0xd05c('0x1f')][_0xd05c('0x20')](_0x53d26e[_0xd05c('0x21')],{'raw':_0x53d26e['options']?_0x53d26e[_0xd05c('0x22')][_0xd05c('0x23')]===undefined?!![]:![]:!![]})[_0xd05c('0x13')](function(_0x2263c4){logger[_0xd05c('0x14')](_0xd05c('0x24'),_0x53d26e);logger['debug'](_0xd05c('0x24'),_0x53d26e,JSON[_0xd05c('0x19')](_0x2263c4));_0x42119b(_0x2263c4);})['catch'](function(_0xe29a89){logger[_0xd05c('0x1a')](_0xd05c('0x24'),_0xe29a89['message'],_0x53d26e);_0x1fc899(_0x5c152e['error'](0x1f4,_0xe29a89['message']));});});}; \ No newline at end of file +var _0x3ad1=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','lodash','moment','bluebird'];(function(_0x539e0d,_0x19780b){var _0x3539ff=function(_0xc4643){while(--_0xc4643){_0x539e0d['push'](_0x539e0d['shift']());}};_0x3539ff(++_0x19780b);}(_0x3ad1,0x165));var _0x13ad=function(_0x4ccf67,_0x2e4050){_0x4ccf67=_0x4ccf67-0x0;var _0x5a7d8b=_0x3ad1[_0x4ccf67];return _0x5a7d8b;};'use strict';var _=require(_0x13ad('0x0'));var util=require('util');var moment=require(_0x13ad('0x1'));var BPromise=require(_0x13ad('0x2'));var rs=require(_0x13ad('0x3'));var fs=require('fs');var Redis=require(_0x13ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x13ad('0x5'));var logger=require(_0x13ad('0x6'))(_0x13ad('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x13ad('0x8')][_0x13ad('0x9')]({'port':0x232a});config[_0x13ad('0xa')]=_[_0x13ad('0xb')](config[_0x13ad('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13ad('0xa')]));require(_0x13ad('0xc'))['register'](socket);function respondWithRpcPromise(_0x12aacb,_0x27775b,_0x26a8d5){return new BPromise(function(_0x850361,_0x413d70){return client['request'](_0x12aacb,_0x26a8d5)[_0x13ad('0xd')](function(_0x49c6bb){logger[_0x13ad('0xe')](_0x13ad('0xf'),_0x27775b,_0x13ad('0x10'));logger[_0x13ad('0x11')](_0x13ad('0x12'),_0x27775b,_0x13ad('0x10'),JSON['stringify'](_0x49c6bb));if(_0x49c6bb[_0x13ad('0x13')]){if(_0x49c6bb[_0x13ad('0x13')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x27775b,_0x49c6bb['error'][_0x13ad('0x14')]);return _0x413d70(_0x49c6bb[_0x13ad('0x13')][_0x13ad('0x14')]);}logger['error'](_0x13ad('0xf'),_0x27775b,_0x49c6bb[_0x13ad('0x13')][_0x13ad('0x14')]);return _0x850361(_0x49c6bb[_0x13ad('0x13')][_0x13ad('0x14')]);}else{logger[_0x13ad('0xe')](_0x13ad('0xf'),_0x27775b,'request\x20sent');_0x850361(_0x49c6bb[_0x13ad('0x15')][_0x13ad('0x14')]);}})[_0x13ad('0x16')](function(_0x2ee07f){logger['error'](_0x13ad('0xf'),_0x27775b,_0x2ee07f);_0x413d70(_0x2ee07f);});});}exports[_0x13ad('0x17')]=function(_0x8fcfcd){var _0xa80320=this;return new Promise(function(_0x3dd4fb,_0x452961){return db[_0x13ad('0x18')][_0x13ad('0x19')](_0x8fcfcd[_0x13ad('0x1a')],{'raw':_0x8fcfcd[_0x13ad('0x1b')]?_0x8fcfcd['options'][_0x13ad('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x36537f){logger[_0x13ad('0xe')](_0x13ad('0x17'),_0x8fcfcd);logger[_0x13ad('0x11')](_0x13ad('0x17'),_0x8fcfcd,JSON[_0x13ad('0x1d')](_0x36537f));_0x3dd4fb(_0x36537f);})[_0x13ad('0x16')](function(_0x5c2e34){logger[_0x13ad('0x13')](_0x13ad('0x17'),_0x5c2e34['message'],_0x8fcfcd);_0x452961(_0xa80320['error'](0x1f4,_0x5c2e34['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 789fc27..f401bd8 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 _0x3552=['update','emit','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x3552,0x17e));var _0x2355=function(_0x50c177,_0x464fcf){_0x50c177=_0x50c177-0x0;var _0x35f483=_0x3552[_0x50c177];return _0x35f483;};'use strict';var SmsMessageEvents=require(_0x2355('0x0'));var events=[_0x2355('0x1'),_0x2355('0x2'),_0x2355('0x3')];function createListener(_0x29f476,_0x2a017b){return function(_0x1cecd3){_0x2a017b[_0x2355('0x4')](_0x29f476,_0x1cecd3);};}function removeListener(_0x5f00b1,_0x454bc8){return function(){SmsMessageEvents['removeListener'](_0x5f00b1,_0x454bc8);};}exports['register']=function(_0x18aca5){for(var _0x2be3a5=0x0,_0x40b840=events[_0x2355('0x5')];_0x2be3a5<_0x40b840;_0x2be3a5++){var _0x49e60e=events[_0x2be3a5];var _0x51f7b7=createListener(_0x2355('0x6')+_0x49e60e,_0x18aca5);SmsMessageEvents['on'](_0x49e60e,_0x51f7b7);}}; \ No newline at end of file +var _0xdda0=['remove','removeListener','register','length','smsMessage:','save'];(function(_0x2a5252,_0x1dedb4){var _0x46f869=function(_0x2a3183){while(--_0x2a3183){_0x2a5252['push'](_0x2a5252['shift']());}};_0x46f869(++_0x1dedb4);}(_0xdda0,0x1bb));var _0x0dda=function(_0x7b7951,_0x4ee615){_0x7b7951=_0x7b7951-0x0;var _0x2e4176=_0xdda0[_0x7b7951];return _0x2e4176;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x0dda('0x0'),_0x0dda('0x1'),'update'];function createListener(_0x52979,_0x3d988c){return function(_0x281b9b){_0x3d988c['emit'](_0x52979,_0x281b9b);};}function removeListener(_0x3eca32,_0x479738){return function(){SmsMessageEvents[_0x0dda('0x2')](_0x3eca32,_0x479738);};}exports[_0x0dda('0x3')]=function(_0x28ed11){for(var _0x8fc387=0x0,_0x21164a=events[_0x0dda('0x4')];_0x8fc387<_0x21164a;_0x8fc387++){var _0x3aff13=events[_0x8fc387];var _0x357967=createListener(_0x0dda('0x5')+_0x3aff13,_0x28ed11);SmsMessageEvents['on'](_0x3aff13,_0x357967);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 2436326..434ba6a 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 _0xee68=['../../components/interaction/service','./smsQueue.controller','isAuthenticated','get','/:id/members','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x185454,_0x3ea3eb){var _0x247434=function(_0x323e9d){while(--_0x323e9d){_0x185454['push'](_0x185454['shift']());}};_0x247434(++_0x3ea3eb);}(_0xee68,0x13c));var _0x8ee6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xee68[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x8ee6('0x0'));var util=require(_0x8ee6('0x1'));var path=require(_0x8ee6('0x2'));var timeout=require(_0x8ee6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ee6('0x4'));var auth=require(_0x8ee6('0x5'));var interaction=require(_0x8ee6('0x6'));var config=require('../../config/environment');var controller=require(_0x8ee6('0x7'));router['get']('/',auth[_0x8ee6('0x8')](),controller['index']);router[_0x8ee6('0x9')]('/describe',auth[_0x8ee6('0x8')](),controller['describe']);router[_0x8ee6('0x9')]('/:id',auth[_0x8ee6('0x8')](),controller['show']);router[_0x8ee6('0x9')](_0x8ee6('0xa'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth[_0x8ee6('0x8')](),controller['getTeams']);router[_0x8ee6('0x9')](_0x8ee6('0xb'),auth[_0x8ee6('0x8')](),controller[_0x8ee6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8ee6('0xd')]);router[_0x8ee6('0xe')](_0x8ee6('0xf'),auth[_0x8ee6('0x8')](),controller[_0x8ee6('0x10')]);router['post'](_0x8ee6('0xb'),auth[_0x8ee6('0x8')](),controller[_0x8ee6('0x11')]);router[_0x8ee6('0x12')]('/:id',auth[_0x8ee6('0x8')](),controller[_0x8ee6('0x13')]);router[_0x8ee6('0x14')]('/:id',auth[_0x8ee6('0x8')](),controller['destroy']);router[_0x8ee6('0x14')](_0x8ee6('0xf'),auth[_0x8ee6('0x8')](),controller[_0x8ee6('0x15')]);router[_0x8ee6('0x14')]('/:id/users',auth[_0x8ee6('0x8')](),controller[_0x8ee6('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf181=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','removeAgents','multer','util','path','Router'];(function(_0x44ab83,_0x599e2a){var _0xf71c1b=function(_0x23771d){while(--_0x23771d){_0x44ab83['push'](_0x44ab83['shift']());}};_0xf71c1b(++_0x599e2a);}(_0xf181,0x6c));var _0x1f18=function(_0x27097a,_0x1b7f8b){_0x27097a=_0x27097a-0x0;var _0x26378b=_0xf181[_0x27097a];return _0x26378b;};'use strict';var multer=require(_0x1f18('0x0'));var util=require(_0x1f18('0x1'));var path=require(_0x1f18('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f18('0x3')]();var fs_extra=require(_0x1f18('0x4'));var auth=require(_0x1f18('0x5'));var interaction=require(_0x1f18('0x6'));var config=require(_0x1f18('0x7'));var controller=require('./smsQueue.controller');router[_0x1f18('0x8')]('/',auth[_0x1f18('0x9')](),controller['index']);router[_0x1f18('0x8')](_0x1f18('0xa'),auth['isAuthenticated'](),controller[_0x1f18('0xb')]);router[_0x1f18('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1f18('0xc')]);router[_0x1f18('0x8')](_0x1f18('0xd'),auth['isAuthenticated'](),controller[_0x1f18('0xe')]);router[_0x1f18('0x8')](_0x1f18('0xf'),auth[_0x1f18('0x9')](),controller[_0x1f18('0x10')]);router['get'](_0x1f18('0x11'),auth[_0x1f18('0x9')](),controller[_0x1f18('0x12')]);router[_0x1f18('0x13')]('/',auth['isAuthenticated'](),controller[_0x1f18('0x14')]);router[_0x1f18('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1f18('0x15')]);router['post']('/:id/users',auth[_0x1f18('0x9')](),controller[_0x1f18('0x16')]);router[_0x1f18('0x17')](_0x1f18('0x18'),auth[_0x1f18('0x9')](),controller[_0x1f18('0x19')]);router[_0x1f18('0x1a')]('/:id',auth[_0x1f18('0x9')](),controller['destroy']);router[_0x1f18('0x1a')](_0x1f18('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x1f18('0x1a')](_0x1f18('0x11'),auth[_0x1f18('0x9')](),controller[_0x1f18('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7c5f72e..b120afc 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 _0xcd06=['sequelize','STRING','name','INTEGER','beepall','roundrobin'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xcd06,0x126));var _0x6cd0=function(_0x1f1e6e,_0x275dee){_0x1f1e6e=_0x1f1e6e-0x0;var _0xcd45ff=_0xcd06[_0x1f1e6e];return _0xcd45ff;};'use strict';var Sequelize=require(_0x6cd0('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cd0('0x1')],'unique':_0x6cd0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6cd0('0x1')]},'timeout':{'type':Sequelize[_0x6cd0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x6cd0('0x4'),_0x6cd0('0x5'))}}; \ No newline at end of file +var _0x7ebc=['exports','STRING','ENUM','beepall','sequelize'];(function(_0x372ca0,_0x5d47e9){var _0x189a65=function(_0x1ecec8){while(--_0x1ecec8){_0x372ca0['push'](_0x372ca0['shift']());}};_0x189a65(++_0x5d47e9);}(_0x7ebc,0x77));var _0xc7eb=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x7ebc[_0x344a3f];return _0x264712;};'use strict';var Sequelize=require(_0xc7eb('0x0'));module[_0xc7eb('0x1')]={'name':{'type':Sequelize[_0xc7eb('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc7eb('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc7eb('0x3')]('rrmemory',_0xc7eb('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 1a16538..a4faf0a 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x443521,_0x257810){var _0x3cc731=function(_0xfa7847){while(--_0xfa7847){_0x443521['push'](_0x443521['shift']());}};_0x3cc731(++_0x257810);}(_0xdb28,0x106));var _0x8db2=function(_0x18e635,_0x3b3746){_0x18e635=_0x18e635-0x0;var _0x5af5d0=_0xdb28[_0x18e635];return _0x5af5d0;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x328bba,_0x247889){var _0x268826=function(_0x5bb0da){while(--_0x5bb0da){_0x328bba['push'](_0x328bba['shift']());}};_0x268826(++_0x247889);}(_0xdb28,0x106));var _0x8db2=function(_0x17b29f,_0x66909b){_0x17b29f=_0x17b29f-0x0;var _0x598fec=_0xdb28[_0x17b29f];return _0x598fec;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index cfafe78..6bdbb08 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 _0x72bc=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','SmsQueue'];(function(_0xbc7cc1,_0x485627){var _0x39e910=function(_0x4eb23b){while(--_0x4eb23b){_0xbc7cc1['push'](_0xbc7cc1['shift']());}};_0x39e910(++_0x485627);}(_0x72bc,0x1d6));var _0xc72b=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x72bc[_0x4fde08];return _0x12e725;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xc72b('0x0'))['db'][_0xc72b('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc72b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc72b('0x3'),'afterDestroy':_0xc72b('0x4')};function emitEvent(_0x20165a){return function(_0x15e2bf,_0x33003a,_0x942ea6){SmsQueueEvents['emit'](_0x20165a+':'+_0x15e2bf['id'],_0x15e2bf);SmsQueueEvents[_0xc72b('0x5')](_0x20165a,_0x15e2bf);_0x942ea6(null);};}for(var e in events){if(events[_0xc72b('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xc72b('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x11df=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x57ef29,_0x3d303a){var _0x9998f6=function(_0x1fd310){while(--_0x1fd310){_0x57ef29['push'](_0x57ef29['shift']());}};_0x9998f6(++_0x3d303a);}(_0x11df,0x1df));var _0xf11d=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x11df[_0xb0f7c3];return _0x28ea68;};'use strict';var EventEmitter=require(_0xf11d('0x0'));var SmsQueue=require(_0xf11d('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf11d('0x2')](0x0);var events={'afterCreate':_0xf11d('0x3'),'afterUpdate':'update','afterDestroy':_0xf11d('0x4')};function emitEvent(_0x22aaa8){return function(_0x8ebd23,_0xad5fa7,_0x493168){SmsQueueEvents[_0xf11d('0x5')](_0x22aaa8+':'+_0x8ebd23['id'],_0x8ebd23);SmsQueueEvents[_0xf11d('0x5')](_0x22aaa8,_0x8ebd23);_0x493168(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xf11d('0x6')](e,emitEvent(event));}}module[_0xf11d('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 9e2202e..ea934ef 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 _0x0396=['moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','api'];(function(_0x511d80,_0x1eb60e){var _0x1b9019=function(_0x2e3009){while(--_0x2e3009){_0x511d80['push'](_0x511d80['shift']());}};_0x1b9019(++_0x1eb60e);}(_0x0396,0x141));var _0x6039=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0396[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x6039('0x0'));var util=require(_0x6039('0x1'));var logger=require('../../config/logger')(_0x6039('0x2'));var moment=require(_0x6039('0x3'));var BPromise=require(_0x6039('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6039('0x5'));var rimraf=require(_0x6039('0x6'));var config=require(_0x6039('0x7'));var attributes=require(_0x6039('0x8'));module[_0x6039('0x9')]=function(_0x1ada02,_0x5e3cb7){return _0x1ada02[_0x6039('0xa')](_0x6039('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e6c=['../../config/logger','moment','request-promise','path','define','SmsQueue','sms_queues'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x7e6c,0xe7));var _0xc7e6=function(_0x11bc0f,_0x373666){_0x11bc0f=_0x11bc0f-0x0;var _0x3ab0d1=_0x7e6c[_0x11bc0f];return _0x3ab0d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc7e6('0x0'))('api');var moment=require(_0xc7e6('0x1'));var BPromise=require('bluebird');var rp=require(_0xc7e6('0x2'));var fs=require('fs');var path=require(_0xc7e6('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module['exports']=function(_0xa80c5c,_0x548972){return _0xa80c5c[_0xc7e6('0x4')](_0xc7e6('0x5'),attributes,{'tableName':_0xc7e6('0x6'),'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 281c9c2..393b5d6 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 _0xf7fe=['SmsQueue','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSmsQueue','findAll','options','raw','limit','map','include','attributes','model','ShowSmsQueue'];(function(_0x479131,_0x2828f4){var _0x28e996=function(_0xc3890d){while(--_0xc3890d){_0x479131['push'](_0x479131['shift']());}};_0x28e996(++_0x2828f4);}(_0xf7fe,0xa2));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef7f('0x0'));var util=require(_0xef7f('0x1'));var moment=require(_0xef7f('0x2'));var BPromise=require('bluebird');var rs=require(_0xef7f('0x3'));var fs=require('fs');var Redis=require(_0xef7f('0x4'));var db=require(_0xef7f('0x5'))['db'];var utils=require(_0xef7f('0x6'));var logger=require('../../config/logger')(_0xef7f('0x7'));var config=require(_0xef7f('0x8'));var jayson=require(_0xef7f('0x9'));var client=jayson[_0xef7f('0xa')][_0xef7f('0xb')]({'port':0x232a});config['redis']=_[_0xef7f('0xc')](config[_0xef7f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xef7f('0xe'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xef7f('0xf')](socket);function respondWithRpcPromise(_0xf93476,_0x25464f,_0x395dea){return new BPromise(function(_0xe548b4,_0x5f1e88){return client['request'](_0xf93476,_0x395dea)[_0xef7f('0x10')](function(_0x1c2a98){logger['info'](_0xef7f('0x11'),_0x25464f,'request\x20sent');logger[_0xef7f('0x12')](_0xef7f('0x13'),_0x25464f,_0xef7f('0x14'),JSON[_0xef7f('0x15')](_0x1c2a98));if(_0x1c2a98[_0xef7f('0x16')]){if(_0x1c2a98[_0xef7f('0x16')][_0xef7f('0x17')]===0x1f4){logger[_0xef7f('0x16')](_0xef7f('0x11'),_0x25464f,_0x1c2a98['error'][_0xef7f('0x18')]);return _0x5f1e88(_0x1c2a98[_0xef7f('0x16')][_0xef7f('0x18')]);}logger[_0xef7f('0x16')]('SmsQueue,\x20%s,\x20%s',_0x25464f,_0x1c2a98[_0xef7f('0x16')][_0xef7f('0x18')]);return _0xe548b4(_0x1c2a98['error'][_0xef7f('0x18')]);}else{logger[_0xef7f('0x19')](_0xef7f('0x11'),_0x25464f,_0xef7f('0x14'));_0xe548b4(_0x1c2a98[_0xef7f('0x1a')]['message']);}})[_0xef7f('0x1b')](function(_0x138cce){logger['error'](_0xef7f('0x11'),_0x25464f,_0x138cce);_0x5f1e88(_0x138cce);});});}exports[_0xef7f('0x1c')]=function(_0x51cca8){var _0x367681=this;return new Promise(function(_0x4765b5,_0xff68c){return db['SmsQueue'][_0xef7f('0x1d')]({'raw':_0x51cca8[_0xef7f('0x1e')]?_0x51cca8['options'][_0xef7f('0x1f')]===undefined?!![]:![]:!![],'where':_0x51cca8[_0xef7f('0x1e')]?_0x51cca8['options']['where']||null:null,'attributes':_0x51cca8[_0xef7f('0x1e')]?_0x51cca8[_0xef7f('0x1e')]['attributes']||null:null,'limit':_0x51cca8['options']?_0x51cca8[_0xef7f('0x1e')][_0xef7f('0x20')]||null:null,'include':_0x51cca8[_0xef7f('0x1e')]?_0x51cca8['options']['include']?_[_0xef7f('0x21')](_0x51cca8['options'][_0xef7f('0x22')],function(_0x5aa10a){return{'model':db[_0x5aa10a['model']],'as':_0x5aa10a['as'],'attributes':_0x5aa10a[_0xef7f('0x23')],'include':_0x5aa10a[_0xef7f('0x22')]?_['map'](_0x5aa10a[_0xef7f('0x22')],function(_0x809313){return{'model':db[_0x809313['model']],'as':_0x809313['as'],'attributes':_0x809313['attributes'],'include':_0x809313['include']?_[_0xef7f('0x21')](_0x809313[_0xef7f('0x22')],function(_0xd785cd){return{'model':db[_0xd785cd[_0xef7f('0x24')]],'as':_0xd785cd['as'],'attributes':_0xd785cd[_0xef7f('0x23')]};}):[]};}):[]};}):[]:[]})[_0xef7f('0x10')](function(_0x56680d){logger['info'](_0xef7f('0x1c'),_0x51cca8);logger['debug'](_0xef7f('0x1c'),_0x51cca8,JSON[_0xef7f('0x15')](_0x56680d));_0x4765b5(_0x56680d);})[_0xef7f('0x1b')](function(_0x943cda){logger['error'](_0xef7f('0x1c'),_0x943cda['message'],_0x51cca8);_0xff68c(_0x367681[_0xef7f('0x16')](0x1f4,_0x943cda[_0xef7f('0x18')]));});});};exports[_0xef7f('0x25')]=function(_0x47577f){var _0x20ec0f=this;return new Promise(function(_0x5953da,_0x54b058){return db[_0xef7f('0x26')]['find']({'raw':_0x47577f[_0xef7f('0x1e')]?_0x47577f[_0xef7f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x47577f['options']?_0x47577f[_0xef7f('0x1e')][_0xef7f('0x27')]||null:null,'attributes':_0x47577f['options']?_0x47577f[_0xef7f('0x1e')][_0xef7f('0x23')]||null:null,'include':_0x47577f[_0xef7f('0x1e')]?_0x47577f['options'][_0xef7f('0x22')]?_[_0xef7f('0x21')](_0x47577f[_0xef7f('0x1e')]['include'],function(_0x180a24){return{'model':db[_0x180a24['model']],'as':_0x180a24['as'],'attributes':_0x180a24[_0xef7f('0x23')],'include':_0x180a24[_0xef7f('0x22')]?_[_0xef7f('0x21')](_0x180a24[_0xef7f('0x22')],function(_0x227965){return{'model':db[_0x227965[_0xef7f('0x24')]],'as':_0x227965['as'],'attributes':_0x227965[_0xef7f('0x23')],'include':_0x227965[_0xef7f('0x22')]?_[_0xef7f('0x21')](_0x227965[_0xef7f('0x22')],function(_0x3a3063){return{'model':db[_0x3a3063[_0xef7f('0x24')]],'as':_0x3a3063['as'],'attributes':_0x3a3063[_0xef7f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a9943){logger[_0xef7f('0x19')](_0xef7f('0x25'),_0x47577f);logger['debug'](_0xef7f('0x25'),_0x47577f,JSON['stringify'](_0x4a9943));_0x5953da(_0x4a9943);})[_0xef7f('0x1b')](function(_0x39f8ea){logger[_0xef7f('0x16')]('ShowSmsQueue',_0x39f8ea[_0xef7f('0x18')],_0x47577f);_0x54b058(_0x20ec0f[_0xef7f('0x16')](0x1f4,_0x39f8ea['message']));});});}; \ No newline at end of file +var _0xf0f4=['register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','model','map','attributes','ShowSmsQueue','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x53d71c,_0x1a3859){var _0x555efb=function(_0x32ef67){while(--_0x32ef67){_0x53d71c['push'](_0x53d71c['shift']());}};_0x555efb(++_0x1a3859);}(_0xf0f4,0x1a0));var _0x4f0f=function(_0x26e5bc,_0x3a49aa){_0x26e5bc=_0x26e5bc-0x0;var _0x285b01=_0xf0f4[_0x26e5bc];return _0x285b01;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var moment=require(_0x4f0f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f0f('0x2'));var db=require(_0x4f0f('0x3'))['db'];var utils=require(_0x4f0f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4f0f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4f0f('0x6')][_0x4f0f('0x7')]({'port':0x232a});config[_0x4f0f('0x8')]=_[_0x4f0f('0x9')](config[_0x4f0f('0x8')],{'host':_0x4f0f('0xa'),'port':0x18eb});var socket=require(_0x4f0f('0xb'))(new Redis(config[_0x4f0f('0x8')]));require(_0x4f0f('0xc'))[_0x4f0f('0xd')](socket);function respondWithRpcPromise(_0x2b735a,_0x1d173c,_0x320b18){return new BPromise(function(_0x1ab7ec,_0x4bdb53){return client[_0x4f0f('0xe')](_0x2b735a,_0x320b18)[_0x4f0f('0xf')](function(_0x3aecbc){logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x1d173c,_0x4f0f('0x12'));logger[_0x4f0f('0x13')](_0x4f0f('0x14'),_0x1d173c,_0x4f0f('0x12'),JSON[_0x4f0f('0x15')](_0x3aecbc));if(_0x3aecbc[_0x4f0f('0x16')]){if(_0x3aecbc['error'][_0x4f0f('0x17')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x1d173c,_0x3aecbc[_0x4f0f('0x16')][_0x4f0f('0x18')]);return _0x4bdb53(_0x3aecbc[_0x4f0f('0x16')][_0x4f0f('0x18')]);}logger['error'](_0x4f0f('0x11'),_0x1d173c,_0x3aecbc['error'][_0x4f0f('0x18')]);return _0x1ab7ec(_0x3aecbc[_0x4f0f('0x16')][_0x4f0f('0x18')]);}else{logger['info'](_0x4f0f('0x11'),_0x1d173c,'request\x20sent');_0x1ab7ec(_0x3aecbc['result']['message']);}})[_0x4f0f('0x19')](function(_0x3516f2){logger[_0x4f0f('0x16')]('SmsQueue,\x20%s,\x20%s',_0x1d173c,_0x3516f2);_0x4bdb53(_0x3516f2);});});}exports[_0x4f0f('0x1a')]=function(_0x3219bf){var _0x2ba095=this;return new Promise(function(_0x5929b5,_0x9aae4e){return db[_0x4f0f('0x1b')][_0x4f0f('0x1c')]({'raw':_0x3219bf[_0x4f0f('0x1d')]?_0x3219bf['options'][_0x4f0f('0x1e')]===undefined?!![]:![]:!![],'where':_0x3219bf[_0x4f0f('0x1d')]?_0x3219bf[_0x4f0f('0x1d')][_0x4f0f('0x1f')]||null:null,'attributes':_0x3219bf[_0x4f0f('0x1d')]?_0x3219bf['options']['attributes']||null:null,'limit':_0x3219bf[_0x4f0f('0x1d')]?_0x3219bf[_0x4f0f('0x1d')][_0x4f0f('0x20')]||null:null,'include':_0x3219bf['options']?_0x3219bf[_0x4f0f('0x1d')][_0x4f0f('0x21')]?_['map'](_0x3219bf[_0x4f0f('0x1d')][_0x4f0f('0x21')],function(_0x1eee66){return{'model':db[_0x1eee66[_0x4f0f('0x22')]],'as':_0x1eee66['as'],'attributes':_0x1eee66['attributes'],'include':_0x1eee66[_0x4f0f('0x21')]?_[_0x4f0f('0x23')](_0x1eee66['include'],function(_0x4c61e6){return{'model':db[_0x4c61e6[_0x4f0f('0x22')]],'as':_0x4c61e6['as'],'attributes':_0x4c61e6[_0x4f0f('0x24')],'include':_0x4c61e6[_0x4f0f('0x21')]?_[_0x4f0f('0x23')](_0x4c61e6[_0x4f0f('0x21')],function(_0x4ace30){return{'model':db[_0x4ace30[_0x4f0f('0x22')]],'as':_0x4ace30['as'],'attributes':_0x4ace30[_0x4f0f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4f0f('0xf')](function(_0x1ad873){logger['info'](_0x4f0f('0x1a'),_0x3219bf);logger[_0x4f0f('0x13')](_0x4f0f('0x1a'),_0x3219bf,JSON[_0x4f0f('0x15')](_0x1ad873));_0x5929b5(_0x1ad873);})[_0x4f0f('0x19')](function(_0x47b2e7){logger[_0x4f0f('0x16')](_0x4f0f('0x1a'),_0x47b2e7[_0x4f0f('0x18')],_0x3219bf);_0x9aae4e(_0x2ba095[_0x4f0f('0x16')](0x1f4,_0x47b2e7[_0x4f0f('0x18')]));});});};exports[_0x4f0f('0x25')]=function(_0x529496){var _0x2b5d17=this;return new Promise(function(_0x115cd5,_0x5b83d4){return db['SmsQueue'][_0x4f0f('0x26')]({'raw':_0x529496[_0x4f0f('0x1d')]?_0x529496['options'][_0x4f0f('0x1e')]===undefined?!![]:![]:!![],'where':_0x529496[_0x4f0f('0x1d')]?_0x529496[_0x4f0f('0x1d')][_0x4f0f('0x1f')]||null:null,'attributes':_0x529496[_0x4f0f('0x1d')]?_0x529496['options'][_0x4f0f('0x24')]||null:null,'include':_0x529496[_0x4f0f('0x1d')]?_0x529496[_0x4f0f('0x1d')][_0x4f0f('0x21')]?_[_0x4f0f('0x23')](_0x529496[_0x4f0f('0x1d')]['include'],function(_0xd91ecf){return{'model':db[_0xd91ecf[_0x4f0f('0x22')]],'as':_0xd91ecf['as'],'attributes':_0xd91ecf[_0x4f0f('0x24')],'include':_0xd91ecf[_0x4f0f('0x21')]?_['map'](_0xd91ecf[_0x4f0f('0x21')],function(_0x3c00c8){return{'model':db[_0x3c00c8[_0x4f0f('0x22')]],'as':_0x3c00c8['as'],'attributes':_0x3c00c8[_0x4f0f('0x24')],'include':_0x3c00c8[_0x4f0f('0x21')]?_['map'](_0x3c00c8[_0x4f0f('0x21')],function(_0x401984){return{'model':db[_0x401984[_0x4f0f('0x22')]],'as':_0x401984['as'],'attributes':_0x401984[_0x4f0f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4f0f('0xf')](function(_0x26c005){logger[_0x4f0f('0x10')](_0x4f0f('0x25'),_0x529496);logger[_0x4f0f('0x13')](_0x4f0f('0x25'),_0x529496,JSON['stringify'](_0x26c005));_0x115cd5(_0x26c005);})[_0x4f0f('0x19')](function(_0x21f8a1){logger['error'](_0x4f0f('0x25'),_0x21f8a1[_0x4f0f('0x18')],_0x529496);_0x5b83d4(_0x2b5d17[_0x4f0f('0x16')](0x1f4,_0x21f8a1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5723144..4b0cff0 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 _0x3f28=['./smsQueue.events','save','emit','register'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0x3f28,0x1a0));var _0x83f2=function(_0x2aaf0c,_0x120301){_0x2aaf0c=_0x2aaf0c-0x0;var _0x2ccbed=_0x3f28[_0x2aaf0c];return _0x2ccbed;};'use strict';var SmsQueueEvents=require(_0x83f2('0x0'));var events=[_0x83f2('0x1'),'remove','update'];function createListener(_0x54d3eb,_0x4a4c36){return function(_0x2f22d9){_0x4a4c36[_0x83f2('0x2')](_0x54d3eb,_0x2f22d9);};}function removeListener(_0x2c98ba,_0x18bff9){return function(){SmsQueueEvents['removeListener'](_0x2c98ba,_0x18bff9);};}exports[_0x83f2('0x3')]=function(_0x3b55a3){for(var _0x4bec54=0x0,_0x2db4c5=events['length'];_0x4bec54<_0x2db4c5;_0x4bec54++){var _0x2c883f=events[_0x4bec54];var _0x52acf2=createListener('smsQueue:'+_0x2c883f,_0x3b55a3);SmsQueueEvents['on'](_0x2c883f,_0x52acf2);}}; \ No newline at end of file +var _0x23b0=['length','save','update','removeListener','register'];(function(_0x29ffd9,_0x24deee){var _0xa6b8be=function(_0x43b0b3){while(--_0x43b0b3){_0x29ffd9['push'](_0x29ffd9['shift']());}};_0xa6b8be(++_0x24deee);}(_0x23b0,0x6f));var _0x023b=function(_0x1d589c,_0x559feb){_0x1d589c=_0x1d589c-0x0;var _0x2fa7da=_0x23b0[_0x1d589c];return _0x2fa7da;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x023b('0x0'),'remove',_0x023b('0x1')];function createListener(_0x4c2b64,_0x1c867f){return function(_0x50ae61){_0x1c867f['emit'](_0x4c2b64,_0x50ae61);};}function removeListener(_0x42ab0e,_0x137c7f){return function(){SmsQueueEvents[_0x023b('0x2')](_0x42ab0e,_0x137c7f);};}exports[_0x023b('0x3')]=function(_0xbd8608){for(var _0x551da8=0x0,_0x451f97=events[_0x023b('0x4')];_0x551da8<_0x451f97;_0x551da8++){var _0x1d469a=events[_0x551da8];var _0x28a740=createListener('smsQueue:'+_0x1d469a,_0xbd8608);SmsQueueEvents['on'](_0x1d469a,_0x28a740);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f93e5b2..c220b4c 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 _0x5ce1=['update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','/:id','isAuthenticated','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ce1,0xd4));var _0x15ce=function(_0x326038,_0x7bdb1b){_0x326038=_0x326038-0x0;var _0x4b744a=_0x5ce1[_0x326038];return _0x4b744a;};'use strict';var multer=require('multer');var util=require(_0x15ce('0x0'));var path=require(_0x15ce('0x1'));var timeout=require(_0x15ce('0x2'));var express=require('express');var router=express[_0x15ce('0x3')]();var fs_extra=require(_0x15ce('0x4'));var auth=require(_0x15ce('0x5'));var interaction=require(_0x15ce('0x6'));var config=require(_0x15ce('0x7'));var controller=require(_0x15ce('0x8'));router[_0x15ce('0x9')]('/',auth['isAuthenticated'](),controller[_0x15ce('0xa')]);router[_0x15ce('0x9')](_0x15ce('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x15ce('0x9')](_0x15ce('0xc'),auth[_0x15ce('0xd')](),controller['show']);router[_0x15ce('0xe')]('/',auth[_0x15ce('0xd')](),controller[_0x15ce('0xf')]);router['put'](_0x15ce('0xc'),auth['isAuthenticated'](),controller[_0x15ce('0x10')]);router[_0x15ce('0x11')](_0x15ce('0xc'),auth[_0x15ce('0xd')](),controller['destroy']);module[_0x15ce('0x12')]=router; \ No newline at end of file +var _0xb8ba=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','describe','/:id','post','isAuthenticated','create','put','update','delete','destroy','multer'];(function(_0xa4984b,_0x5ef7d8){var _0x2b0224=function(_0x40bcb1){while(--_0x40bcb1){_0xa4984b['push'](_0xa4984b['shift']());}};_0x2b0224(++_0x5ef7d8);}(_0xb8ba,0x6d));var _0xab8b=function(_0x5a8cd6,_0x10e986){_0x5a8cd6=_0x5a8cd6-0x0;var _0x465cca=_0xb8ba[_0x5a8cd6];return _0x465cca;};'use strict';var multer=require(_0xab8b('0x0'));var util=require(_0xab8b('0x1'));var path=require(_0xab8b('0x2'));var timeout=require('connect-timeout');var express=require(_0xab8b('0x3'));var router=express[_0xab8b('0x4')]();var fs_extra=require(_0xab8b('0x5'));var auth=require(_0xab8b('0x6'));var interaction=require(_0xab8b('0x7'));var config=require(_0xab8b('0x8'));var controller=require(_0xab8b('0x9'));router[_0xab8b('0xa')]('/',auth['isAuthenticated'](),controller[_0xab8b('0xb')]);router['get'](_0xab8b('0xc'),auth['isAuthenticated'](),controller[_0xab8b('0xd')]);router[_0xab8b('0xa')](_0xab8b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xab8b('0xf')]('/',auth[_0xab8b('0x10')](),controller[_0xab8b('0x11')]);router[_0xab8b('0x12')](_0xab8b('0xe'),auth[_0xab8b('0x10')](),controller[_0xab8b('0x13')]);router[_0xab8b('0x14')](_0xab8b('0xe'),auth[_0xab8b('0x10')](),controller[_0xab8b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 53ba372..a08f870 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 _0x9843=['STRING','DATE','moment'];(function(_0x4e6ceb,_0x5498e8){var _0xcc0679=function(_0x4c7799){while(--_0x4c7799){_0x4e6ceb['push'](_0x4e6ceb['shift']());}};_0xcc0679(++_0x5498e8);}(_0x9843,0xaa));var _0x3984=function(_0x3db1f7,_0x2beb9b){_0x3db1f7=_0x3db1f7-0x0;var _0x5016ed=_0x9843[_0x3db1f7];return _0x5016ed;};'use strict';var moment=require(_0x3984('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3984('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3984('0x2')]},'acceptAt':{'type':Sequelize[_0x3984('0x2')]},'exitAt':{'type':Sequelize[_0x3984('0x2')]},'reason':{'type':Sequelize[_0x3984('0x1')]}}; \ No newline at end of file +var _0x58fa=['moment','exports','STRING','DATE'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x58fa,0x134));var _0xa58f=function(_0xecc140,_0x1f04d2){_0xecc140=_0xecc140-0x0;var _0x357f24=_0x58fa[_0xecc140];return _0x357f24;};'use strict';var moment=require(_0xa58f('0x0'));var Sequelize=require('sequelize');module[_0xa58f('0x1')]={'uniqueid':{'type':Sequelize[_0xa58f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa58f('0x2')]},'joinAt':{'type':Sequelize[_0xa58f('0x3')]},'leaveAt':{'type':Sequelize[_0xa58f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b29caff..db7f6df 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 _0x786d=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','SmsQueueReport','includeAll','include','rows','catch','options','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','stack','name','send','index','map','rawAttributes'];(function(_0x242c29,_0x168f0a){var _0x3f4d1c=function(_0x87d119){while(--_0x87d119){_0x242c29['push'](_0x242c29['shift']());}};_0x3f4d1c(++_0x168f0a);}(_0x786d,0x147));var _0xd786=function(_0x50adca,_0x44f675){_0x50adca=_0x50adca-0x0;var _0x5643d3=_0x786d[_0x50adca];return _0x5643d3;};'use strict';var emlformat=require(_0xd786('0x0'));var rimraf=require(_0xd786('0x1'));var zipdir=require(_0xd786('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd786('0x3'));var moment=require('moment');var BPromise=require(_0xd786('0x4'));var Mustache=require('mustache');var util=require(_0xd786('0x5'));var path=require(_0xd786('0x6'));var sox=require(_0xd786('0x7'));var csv=require(_0xd786('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd786('0x9'));var _=require(_0xd786('0xa'));var squel=require(_0xd786('0xb'));var crypto=require(_0xd786('0xc'));var jsforce=require(_0xd786('0xd'));var deskjs=require(_0xd786('0xe'));var toCsv=require(_0xd786('0x8'));var querystring=require(_0xd786('0xf'));var Papa=require(_0xd786('0x10'));var Redis=require('ioredis');var authService=require(_0xd786('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd786('0x12'));var hardwareService=require(_0xd786('0x13'));var logger=require(_0xd786('0x14'))(_0xd786('0x15'));var utils=require('../../config/utils');var config=require(_0xd786('0x16'));var licenseUtil=require(_0xd786('0x17'));var db=require(_0xd786('0x18'))['db'];function respondWithStatusCode(_0x40ea9c,_0x5b8b56){_0x5b8b56=_0x5b8b56||0xcc;return function(_0x3a6365){if(_0x3a6365){return _0x40ea9c[_0xd786('0x19')](_0x5b8b56);}return _0x40ea9c[_0xd786('0x1a')](_0x5b8b56)['end']();};}function respondWithResult(_0x1d7f91,_0x224afc){_0x224afc=_0x224afc||0xc8;return function(_0x5703c6){if(_0x5703c6){return _0x1d7f91['status'](_0x224afc)[_0xd786('0x1b')](_0x5703c6);}};}function respondWithFilteredResult(_0x21f756,_0x2543c0){return function(_0x2c46ac){if(_0x2c46ac){var _0x444aa8=typeof _0x2543c0[_0xd786('0x1c')]===_0xd786('0x1d')&&typeof _0x2543c0[_0xd786('0x1e')]===_0xd786('0x1d');var _0x444bec=_0x2c46ac[_0xd786('0x1f')];var _0x5f3b30=_0x444aa8?0x0:_0x2543c0['offset'];var _0x4e24a1=_0x444aa8?_0x2c46ac[_0xd786('0x1f')]:_0x2543c0[_0xd786('0x1c')]+_0x2543c0[_0xd786('0x1e')];var _0x2bce36;if(_0x4e24a1>=_0x444bec){_0x4e24a1=_0x444bec;_0x2bce36=0xc8;}else{_0x2bce36=0xce;}_0x21f756[_0xd786('0x1a')](_0x2bce36);return _0x21f756[_0xd786('0x20')](_0xd786('0x21'),_0x5f3b30+'-'+_0x4e24a1+'/'+_0x444bec)[_0xd786('0x1b')](_0x2c46ac);}return null;};}function patchUpdates(_0x5e18fb){return function(_0x195ad3){try{jsonpatch['apply'](_0x195ad3,_0x5e18fb,!![]);}catch(_0x202282){return BPromise['reject'](_0x202282);}return _0x195ad3['save']();};}function saveUpdates(_0x366901,_0x3ddb21){return function(_0x8276f9){if(_0x8276f9){return _0x8276f9[_0xd786('0x22')](_0x366901)[_0xd786('0x23')](function(_0x568abb){return _0x568abb;});}return null;};}function removeEntity(_0x5bde4d,_0x15d179){return function(_0x4f704b){if(_0x4f704b){return _0x4f704b['destroy']()[_0xd786('0x23')](function(){_0x5bde4d['status'](0xcc)[_0xd786('0x24')]();});}};}function handleEntityNotFound(_0x17b553,_0x54cd94){return function(_0x593dae){if(!_0x593dae){_0x17b553[_0xd786('0x19')](0x194);}return _0x593dae;};}function handleError(_0x196b6f,_0x2e1c1e){_0x2e1c1e=_0x2e1c1e||0x1f4;return function(_0x1c1bdc){logger['error'](_0x1c1bdc[_0xd786('0x25')]);if(_0x1c1bdc[_0xd786('0x26')]){delete _0x1c1bdc['name'];}_0x196b6f[_0xd786('0x1a')](_0x2e1c1e)[_0xd786('0x27')](_0x1c1bdc);};}exports[_0xd786('0x28')]=function(_0x2bd3be,_0x1945c3){var _0xf9cba5={},_0x8809ee={},_0x45c383={'count':0x0,'rows':[]};var _0x4e6657=_[_0xd786('0x29')](db['SmsQueueReport'][_0xd786('0x2a')],function(_0x55586a){return{'name':_0x55586a[_0xd786('0x2b')],'type':_0x55586a['type'][_0xd786('0x2c')]};});_0x8809ee[_0xd786('0x2d')]=_[_0xd786('0x29')](_0x4e6657,_0xd786('0x26'));_0x8809ee[_0xd786('0x2e')]=_[_0xd786('0x2f')](_0x2bd3be['query']);_0x8809ee[_0xd786('0x30')]=_[_0xd786('0x31')](_0x8809ee['model'],_0x8809ee[_0xd786('0x2e')]);_0xf9cba5[_0xd786('0x32')]=_[_0xd786('0x31')](_0x8809ee['model'],qs[_0xd786('0x33')](_0x2bd3be[_0xd786('0x2e')]['fields']));_0xf9cba5[_0xd786('0x32')]=_0xf9cba5[_0xd786('0x32')][_0xd786('0x34')]?_0xf9cba5[_0xd786('0x32')]:_0x8809ee[_0xd786('0x2d')];if(!_0x2bd3be[_0xd786('0x2e')][_0xd786('0x35')](_0xd786('0x36'))){_0xf9cba5[_0xd786('0x1e')]=qs[_0xd786('0x1e')](_0x2bd3be[_0xd786('0x2e')][_0xd786('0x1e')]);_0xf9cba5[_0xd786('0x1c')]=qs[_0xd786('0x1c')](_0x2bd3be[_0xd786('0x2e')][_0xd786('0x1c')]);}_0xf9cba5[_0xd786('0x37')]=qs[_0xd786('0x38')](_0x2bd3be[_0xd786('0x2e')][_0xd786('0x38')]);_0xf9cba5[_0xd786('0x39')]=qs[_0xd786('0x30')](_[_0xd786('0x3a')](_0x2bd3be[_0xd786('0x2e')],_0x8809ee[_0xd786('0x30')]),_0x4e6657);if(_0x2bd3be[_0xd786('0x2e')][_0xd786('0x3b')]){_0xf9cba5[_0xd786('0x39')]=_[_0xd786('0x3c')](_0xf9cba5[_0xd786('0x39')],{'$or':_[_0xd786('0x29')](_0x4e6657,function(_0x130c01){if(_0x130c01[_0xd786('0x3d')]!=='VIRTUAL'){var _0x5a1c6a={};_0x5a1c6a[_0x130c01[_0xd786('0x26')]]={'$like':'%'+_0x2bd3be[_0xd786('0x2e')][_0xd786('0x3b')]+'%'};return _0x5a1c6a;}})});}_0xf9cba5=_['merge']({},_0xf9cba5,_0x2bd3be['options']);var _0x3cfc5d={'where':_0xf9cba5[_0xd786('0x39')]};return db[_0xd786('0x3e')]['count'](_0x3cfc5d)[_0xd786('0x23')](function(_0x53774d){_0x45c383['count']=_0x53774d;if(_0x2bd3be[_0xd786('0x2e')][_0xd786('0x3f')]){_0xf9cba5[_0xd786('0x40')]=[{'all':!![]}];}return db[_0xd786('0x3e')]['findAll'](_0xf9cba5);})[_0xd786('0x23')](function(_0x2c800c){_0x45c383[_0xd786('0x41')]=_0x2c800c;return _0x45c383;})[_0xd786('0x23')](respondWithFilteredResult(_0x1945c3,_0xf9cba5))[_0xd786('0x42')](handleError(_0x1945c3,null));};exports['show']=function(_0x301cac,_0x9fa911){var _0x2f1692={'raw':!![],'where':{'id':_0x301cac['params']['id']}},_0x4bb291={};_0x4bb291['model']=_['keys'](db[_0xd786('0x3e')][_0xd786('0x2a')]);_0x4bb291[_0xd786('0x2e')]=_[_0xd786('0x2f')](_0x301cac[_0xd786('0x2e')]);_0x4bb291['filters']=_['intersection'](_0x4bb291[_0xd786('0x2d')],_0x4bb291[_0xd786('0x2e')]);_0x2f1692[_0xd786('0x32')]=_[_0xd786('0x31')](_0x4bb291['model'],qs[_0xd786('0x33')](_0x301cac[_0xd786('0x2e')]['fields']));_0x2f1692['attributes']=_0x2f1692['attributes']['length']?_0x2f1692[_0xd786('0x32')]:_0x4bb291[_0xd786('0x2d')];if(_0x301cac['query'][_0xd786('0x3f')]){_0x2f1692['include']=[{'all':!![]}];}_0x2f1692=_[_0xd786('0x3c')]({},_0x2f1692,_0x301cac[_0xd786('0x43')]);return db[_0xd786('0x3e')][_0xd786('0x44')](_0x2f1692)[_0xd786('0x23')](handleEntityNotFound(_0x9fa911,null))['then'](respondWithResult(_0x9fa911,null))[_0xd786('0x42')](handleError(_0x9fa911,null));};exports['create']=function(_0xb549a9,_0x925e64){return db[_0xd786('0x3e')][_0xd786('0x45')](_0xb549a9[_0xd786('0x46')],{})['then'](respondWithResult(_0x925e64,0xc9))['catch'](handleError(_0x925e64,null));};exports['update']=function(_0xa73c0,_0x4fe5a6){if(_0xa73c0[_0xd786('0x46')]['id']){delete _0xa73c0[_0xd786('0x46')]['id'];}return db[_0xd786('0x3e')][_0xd786('0x44')]({'where':{'id':_0xa73c0[_0xd786('0x47')]['id']}})[_0xd786('0x23')](handleEntityNotFound(_0x4fe5a6,null))[_0xd786('0x23')](saveUpdates(_0xa73c0['body'],null))[_0xd786('0x23')](respondWithResult(_0x4fe5a6,null))[_0xd786('0x42')](handleError(_0x4fe5a6,null));};exports[_0xd786('0x48')]=function(_0x21111f,_0x242ebe){return db['SmsQueueReport'][_0xd786('0x44')]({'where':{'id':_0x21111f[_0xd786('0x47')]['id']}})[_0xd786('0x23')](handleEntityNotFound(_0x242ebe,null))[_0xd786('0x23')](removeEntity(_0x242ebe,null))['catch'](handleError(_0x242ebe,null));};exports[_0xd786('0x49')]=function(_0x4c0dce,_0x1c5be3){return db[_0xd786('0x3e')]['describe']()[_0xd786('0x23')](respondWithResult(_0x1c5be3,null))['catch'](handleError(_0x1c5be3,null));}; \ No newline at end of file +var _0x6ba5=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','SmsQueueReport','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x6ba5,0x8b));var _0x56ba=function(_0x358f87,_0x5a4d20){_0x358f87=_0x358f87-0x0;var _0x4b2fdb=_0x6ba5[_0x358f87];return _0x4b2fdb;};'use strict';var emlformat=require(_0x56ba('0x0'));var rimraf=require(_0x56ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56ba('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56ba('0x3'));var util=require(_0x56ba('0x4'));var path=require('path');var sox=require(_0x56ba('0x5'));var csv=require(_0x56ba('0x6'));var ejs=require(_0x56ba('0x7'));var fs=require('fs');var fs_extra=require(_0x56ba('0x8'));var _=require('lodash');var squel=require(_0x56ba('0x9'));var crypto=require(_0x56ba('0xa'));var jsforce=require(_0x56ba('0xb'));var deskjs=require(_0x56ba('0xc'));var toCsv=require(_0x56ba('0x6'));var querystring=require(_0x56ba('0xd'));var Papa=require(_0x56ba('0xe'));var Redis=require(_0x56ba('0xf'));var authService=require(_0x56ba('0x10'));var qs=require(_0x56ba('0x11'));var as=require(_0x56ba('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x56ba('0x13'));var utils=require(_0x56ba('0x14'));var config=require(_0x56ba('0x15'));var licenseUtil=require(_0x56ba('0x16'));var db=require(_0x56ba('0x17'))['db'];function respondWithStatusCode(_0x3747a7,_0x1d786b){_0x1d786b=_0x1d786b||0xcc;return function(_0x161e7e){if(_0x161e7e){return _0x3747a7[_0x56ba('0x18')](_0x1d786b);}return _0x3747a7[_0x56ba('0x19')](_0x1d786b)[_0x56ba('0x1a')]();};}function respondWithResult(_0x1b8d3e,_0x20c4ce){_0x20c4ce=_0x20c4ce||0xc8;return function(_0x153ee8){if(_0x153ee8){return _0x1b8d3e[_0x56ba('0x19')](_0x20c4ce)[_0x56ba('0x1b')](_0x153ee8);}};}function respondWithFilteredResult(_0x143590,_0x3d42c0){return function(_0x273882){if(_0x273882){var _0x2fefaa=typeof _0x3d42c0[_0x56ba('0x1c')]==='undefined'&&typeof _0x3d42c0[_0x56ba('0x1d')]===_0x56ba('0x1e');var _0x433207=_0x273882[_0x56ba('0x1f')];var _0xb77cc6=_0x2fefaa?0x0:_0x3d42c0[_0x56ba('0x1c')];var _0xb5d244=_0x2fefaa?_0x273882['count']:_0x3d42c0[_0x56ba('0x1c')]+_0x3d42c0[_0x56ba('0x1d')];var _0x57a3b1;if(_0xb5d244>=_0x433207){_0xb5d244=_0x433207;_0x57a3b1=0xc8;}else{_0x57a3b1=0xce;}_0x143590[_0x56ba('0x19')](_0x57a3b1);return _0x143590[_0x56ba('0x20')]('Content-Range',_0xb77cc6+'-'+_0xb5d244+'/'+_0x433207)[_0x56ba('0x1b')](_0x273882);}return null;};}function patchUpdates(_0x5d06a4){return function(_0x2f598d){try{jsonpatch[_0x56ba('0x21')](_0x2f598d,_0x5d06a4,!![]);}catch(_0x141f0b){return BPromise['reject'](_0x141f0b);}return _0x2f598d[_0x56ba('0x22')]();};}function saveUpdates(_0x3f94e0,_0x530783){return function(_0x23bd40){if(_0x23bd40){return _0x23bd40['update'](_0x3f94e0)[_0x56ba('0x23')](function(_0x425bda){return _0x425bda;});}return null;};}function removeEntity(_0x25e14d,_0x35415e){return function(_0xd17f99){if(_0xd17f99){return _0xd17f99[_0x56ba('0x24')]()['then'](function(){_0x25e14d[_0x56ba('0x19')](0xcc)[_0x56ba('0x1a')]();});}};}function handleEntityNotFound(_0x3f9d0f,_0x1b0adb){return function(_0x1d0d60){if(!_0x1d0d60){_0x3f9d0f[_0x56ba('0x18')](0x194);}return _0x1d0d60;};}function handleError(_0x50e8e6,_0x5ed036){_0x5ed036=_0x5ed036||0x1f4;return function(_0x1c1aed){logger[_0x56ba('0x25')](_0x1c1aed['stack']);if(_0x1c1aed[_0x56ba('0x26')]){delete _0x1c1aed['name'];}_0x50e8e6['status'](_0x5ed036)[_0x56ba('0x27')](_0x1c1aed);};}exports[_0x56ba('0x28')]=function(_0x733700,_0x581935){var _0x187550={},_0x403530={},_0x4b7a6e={'count':0x0,'rows':[]};var _0x45787d=_[_0x56ba('0x29')](db['SmsQueueReport'][_0x56ba('0x2a')],function(_0x1ec772){return{'name':_0x1ec772[_0x56ba('0x2b')],'type':_0x1ec772['type'][_0x56ba('0x2c')]};});_0x403530[_0x56ba('0x2d')]=_[_0x56ba('0x29')](_0x45787d,_0x56ba('0x26'));_0x403530[_0x56ba('0x2e')]=_[_0x56ba('0x2f')](_0x733700[_0x56ba('0x2e')]);_0x403530['filters']=_['intersection'](_0x403530['model'],_0x403530[_0x56ba('0x2e')]);_0x187550[_0x56ba('0x30')]=_[_0x56ba('0x31')](_0x403530['model'],qs[_0x56ba('0x32')](_0x733700[_0x56ba('0x2e')][_0x56ba('0x32')]));_0x187550[_0x56ba('0x30')]=_0x187550[_0x56ba('0x30')]['length']?_0x187550['attributes']:_0x403530[_0x56ba('0x2d')];if(!_0x733700[_0x56ba('0x2e')][_0x56ba('0x33')](_0x56ba('0x34'))){_0x187550[_0x56ba('0x1d')]=qs[_0x56ba('0x1d')](_0x733700[_0x56ba('0x2e')]['limit']);_0x187550[_0x56ba('0x1c')]=qs[_0x56ba('0x1c')](_0x733700[_0x56ba('0x2e')][_0x56ba('0x1c')]);}_0x187550[_0x56ba('0x35')]=qs[_0x56ba('0x36')](_0x733700[_0x56ba('0x2e')][_0x56ba('0x36')]);_0x187550[_0x56ba('0x37')]=qs[_0x56ba('0x38')](_[_0x56ba('0x39')](_0x733700[_0x56ba('0x2e')],_0x403530[_0x56ba('0x38')]),_0x45787d);if(_0x733700['query'][_0x56ba('0x3a')]){_0x187550[_0x56ba('0x37')]=_[_0x56ba('0x3b')](_0x187550[_0x56ba('0x37')],{'$or':_[_0x56ba('0x29')](_0x45787d,function(_0x1245c6){if(_0x1245c6[_0x56ba('0x3c')]!=='VIRTUAL'){var _0x48a29e={};_0x48a29e[_0x1245c6[_0x56ba('0x26')]]={'$like':'%'+_0x733700[_0x56ba('0x2e')][_0x56ba('0x3a')]+'%'};return _0x48a29e;}})});}_0x187550=_[_0x56ba('0x3b')]({},_0x187550,_0x733700[_0x56ba('0x3d')]);var _0x247372={'where':_0x187550['where']};return db[_0x56ba('0x3e')][_0x56ba('0x1f')](_0x247372)[_0x56ba('0x23')](function(_0x2301a3){_0x4b7a6e[_0x56ba('0x1f')]=_0x2301a3;if(_0x733700[_0x56ba('0x2e')][_0x56ba('0x3f')]){_0x187550[_0x56ba('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x56ba('0x41')](_0x187550);})[_0x56ba('0x23')](function(_0x2e9763){_0x4b7a6e[_0x56ba('0x42')]=_0x2e9763;return _0x4b7a6e;})['then'](respondWithFilteredResult(_0x581935,_0x187550))['catch'](handleError(_0x581935,null));};exports[_0x56ba('0x43')]=function(_0x8d7c7b,_0x4c2340){var _0x11b71a={'raw':!![],'where':{'id':_0x8d7c7b[_0x56ba('0x44')]['id']}},_0x2306c8={};_0x2306c8[_0x56ba('0x2d')]=_[_0x56ba('0x2f')](db['SmsQueueReport']['rawAttributes']);_0x2306c8[_0x56ba('0x2e')]=_['keys'](_0x8d7c7b[_0x56ba('0x2e')]);_0x2306c8['filters']=_[_0x56ba('0x31')](_0x2306c8[_0x56ba('0x2d')],_0x2306c8['query']);_0x11b71a[_0x56ba('0x30')]=_['intersection'](_0x2306c8[_0x56ba('0x2d')],qs[_0x56ba('0x32')](_0x8d7c7b[_0x56ba('0x2e')][_0x56ba('0x32')]));_0x11b71a[_0x56ba('0x30')]=_0x11b71a['attributes']['length']?_0x11b71a[_0x56ba('0x30')]:_0x2306c8[_0x56ba('0x2d')];if(_0x8d7c7b[_0x56ba('0x2e')][_0x56ba('0x3f')]){_0x11b71a[_0x56ba('0x40')]=[{'all':!![]}];}_0x11b71a=_[_0x56ba('0x3b')]({},_0x11b71a,_0x8d7c7b['options']);return db[_0x56ba('0x3e')]['find'](_0x11b71a)[_0x56ba('0x23')](handleEntityNotFound(_0x4c2340,null))[_0x56ba('0x23')](respondWithResult(_0x4c2340,null))[_0x56ba('0x45')](handleError(_0x4c2340,null));};exports[_0x56ba('0x46')]=function(_0x17f933,_0x2c181d){return db['SmsQueueReport']['create'](_0x17f933[_0x56ba('0x47')],{})[_0x56ba('0x23')](respondWithResult(_0x2c181d,0xc9))[_0x56ba('0x45')](handleError(_0x2c181d,null));};exports[_0x56ba('0x48')]=function(_0xab6d78,_0x17c862){if(_0xab6d78[_0x56ba('0x47')]['id']){delete _0xab6d78[_0x56ba('0x47')]['id'];}return db['SmsQueueReport'][_0x56ba('0x49')]({'where':{'id':_0xab6d78[_0x56ba('0x44')]['id']}})[_0x56ba('0x23')](handleEntityNotFound(_0x17c862,null))[_0x56ba('0x23')](saveUpdates(_0xab6d78[_0x56ba('0x47')],null))['then'](respondWithResult(_0x17c862,null))[_0x56ba('0x45')](handleError(_0x17c862,null));};exports[_0x56ba('0x24')]=function(_0x1b678f,_0x2547e8){return db['SmsQueueReport'][_0x56ba('0x49')]({'where':{'id':_0x1b678f[_0x56ba('0x44')]['id']}})[_0x56ba('0x23')](handleEntityNotFound(_0x2547e8,null))[_0x56ba('0x23')](removeEntity(_0x2547e8,null))[_0x56ba('0x45')](handleError(_0x2547e8,null));};exports['describe']=function(_0x1c7c59,_0x2bb70a){return db[_0x56ba('0x3e')][_0x56ba('0x4a')]()[_0x56ba('0x23')](respondWithResult(_0x2bb70a,null))['catch'](handleError(_0x2bb70a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 97d085c..1de9b35 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2034a7,_0x48c070){var _0x161a42=function(_0x540a0d){while(--_0x540a0d){_0x2034a7['push'](_0x2034a7['shift']());}};_0x161a42(++_0x48c070);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x230a9e,_0xc5b57f){var _0x58a554=function(_0x17fe75){while(--_0x17fe75){_0x230a9e['push'](_0x230a9e['shift']());}};_0x58a554(++_0xc5b57f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 91100e7..1128d3d 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 _0xbc8b=['rpc','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','update','where','attributes','limit','UpdateSmsQueueReport','moment','bluebird','ioredis','../../config/logger'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xbc8b,0x146));var _0xbbc8=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xbc8b[_0x3e6b2f];return _0x323215;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbbc8('0x0'));var BPromise=require(_0xbbc8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbc8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbc8('0x3'))(_0xbbc8('0x4'));var config=require('../../config/environment');var jayson=require(_0xbbc8('0x5'));var client=jayson[_0xbbc8('0x6')][_0xbbc8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x234936,_0x21a4c0,_0x568cf4){return new BPromise(function(_0x1a1684,_0x4be163){return client['request'](_0x234936,_0x568cf4)[_0xbbc8('0x8')](function(_0x890736){logger[_0xbbc8('0x9')](_0xbbc8('0xa'),_0x21a4c0,'request\x20sent');logger[_0xbbc8('0xb')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x21a4c0,_0xbbc8('0xc'),JSON[_0xbbc8('0xd')](_0x890736));if(_0x890736[_0xbbc8('0xe')]){if(_0x890736[_0xbbc8('0xe')][_0xbbc8('0xf')]===0x1f4){logger[_0xbbc8('0xe')](_0xbbc8('0xa'),_0x21a4c0,_0x890736[_0xbbc8('0xe')][_0xbbc8('0x10')]);return _0x4be163(_0x890736[_0xbbc8('0xe')]['message']);}logger[_0xbbc8('0xe')](_0xbbc8('0xa'),_0x21a4c0,_0x890736[_0xbbc8('0xe')][_0xbbc8('0x10')]);return _0x1a1684(_0x890736[_0xbbc8('0xe')][_0xbbc8('0x10')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x21a4c0,_0xbbc8('0xc'));_0x1a1684(_0x890736[_0xbbc8('0x11')][_0xbbc8('0x10')]);}})['catch'](function(_0x109be6){logger[_0xbbc8('0xe')](_0xbbc8('0xa'),_0x21a4c0,_0x109be6);_0x4be163(_0x109be6);});});}exports[_0xbbc8('0x12')]=function(_0x2e0981){var _0x5c9756=this;return new Promise(function(_0x49613f,_0x292f5e){return db[_0xbbc8('0x13')][_0xbbc8('0x14')](_0x2e0981[_0xbbc8('0x15')],{'raw':_0x2e0981[_0xbbc8('0x16')]?_0x2e0981['options'][_0xbbc8('0x17')]===undefined?!![]:![]:!![]})[_0xbbc8('0x8')](function(_0x43329a){logger[_0xbbc8('0x9')]('CreateSmsQueueReport',_0x2e0981);logger[_0xbbc8('0xb')](_0xbbc8('0x12'),_0x2e0981,JSON['stringify'](_0x43329a));_0x49613f(_0x43329a);})[_0xbbc8('0x18')](function(_0xf01312){logger[_0xbbc8('0xe')]('CreateSmsQueueReport',_0xf01312['message'],_0x2e0981);_0x292f5e(_0x5c9756['error'](0x1f4,_0xf01312[_0xbbc8('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x308e8a){var _0x32498a=this;return new Promise(function(_0x18198a,_0x1cd1d8){return db[_0xbbc8('0x13')][_0xbbc8('0x19')](_0x308e8a[_0xbbc8('0x15')],{'raw':_0x308e8a[_0xbbc8('0x16')]?_0x308e8a[_0xbbc8('0x16')][_0xbbc8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x308e8a[_0xbbc8('0x16')]?_0x308e8a[_0xbbc8('0x16')][_0xbbc8('0x1a')]||null:null,'attributes':_0x308e8a[_0xbbc8('0x16')]?_0x308e8a[_0xbbc8('0x16')][_0xbbc8('0x1b')]||null:null,'limit':_0x308e8a['options']?_0x308e8a['options'][_0xbbc8('0x1c')]||null:null})[_0xbbc8('0x8')](function(_0x3648ae){logger[_0xbbc8('0x9')](_0xbbc8('0x1d'),_0x308e8a);logger[_0xbbc8('0xb')](_0xbbc8('0x1d'),_0x308e8a,JSON['stringify'](_0x3648ae));_0x18198a(_0x3648ae);})['catch'](function(_0x503808){logger[_0xbbc8('0xe')](_0xbbc8('0x1d'),_0x503808['message'],_0x308e8a);_0x1cd1d8(_0x32498a[_0xbbc8('0xe')](0x1f4,_0x503808[_0xbbc8('0x10')]));});});}; \ No newline at end of file +var _0x0231=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','UpdateSmsQueueReport','update','lodash','util'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x0231,0xee));var _0x1023=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0231[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x1023('0x0'));var util=require(_0x1023('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1023('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1023('0x3'))['db'];var utils=require(_0x1023('0x4'));var logger=require(_0x1023('0x5'))(_0x1023('0x6'));var config=require(_0x1023('0x7'));var jayson=require(_0x1023('0x8'));var client=jayson[_0x1023('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58a096,_0x413d07,_0x5904b0){return new BPromise(function(_0x255d79,_0x23ac48){return client[_0x1023('0xa')](_0x58a096,_0x5904b0)[_0x1023('0xb')](function(_0x9a3492){logger[_0x1023('0xc')](_0x1023('0xd'),_0x413d07,_0x1023('0xe'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x413d07,'request\x20sent',JSON[_0x1023('0xf')](_0x9a3492));if(_0x9a3492['error']){if(_0x9a3492[_0x1023('0x10')][_0x1023('0x11')]===0x1f4){logger[_0x1023('0x10')](_0x1023('0xd'),_0x413d07,_0x9a3492[_0x1023('0x10')][_0x1023('0x12')]);return _0x23ac48(_0x9a3492['error'][_0x1023('0x12')]);}logger[_0x1023('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x413d07,_0x9a3492[_0x1023('0x10')]['message']);return _0x255d79(_0x9a3492[_0x1023('0x10')][_0x1023('0x12')]);}else{logger[_0x1023('0xc')](_0x1023('0xd'),_0x413d07,_0x1023('0xe'));_0x255d79(_0x9a3492[_0x1023('0x13')][_0x1023('0x12')]);}})[_0x1023('0x14')](function(_0x3e3a31){logger['error'](_0x1023('0xd'),_0x413d07,_0x3e3a31);_0x23ac48(_0x3e3a31);});});}exports[_0x1023('0x15')]=function(_0x2b5ad1){var _0x500718=this;return new Promise(function(_0x1a20a6,_0x4a1434){return db[_0x1023('0x16')][_0x1023('0x17')](_0x2b5ad1[_0x1023('0x18')],{'raw':_0x2b5ad1[_0x1023('0x19')]?_0x2b5ad1['options'][_0x1023('0x1a')]===undefined?!![]:![]:!![]})[_0x1023('0xb')](function(_0x3de9c2){logger[_0x1023('0xc')](_0x1023('0x15'),_0x2b5ad1);logger[_0x1023('0x1b')](_0x1023('0x15'),_0x2b5ad1,JSON['stringify'](_0x3de9c2));_0x1a20a6(_0x3de9c2);})[_0x1023('0x14')](function(_0x14c60a){logger[_0x1023('0x10')](_0x1023('0x15'),_0x14c60a[_0x1023('0x12')],_0x2b5ad1);_0x4a1434(_0x500718[_0x1023('0x10')](0x1f4,_0x14c60a[_0x1023('0x12')]));});});};exports[_0x1023('0x1c')]=function(_0x517f2d){var _0x4700a8=this;return new Promise(function(_0x261355,_0x211001){return db[_0x1023('0x16')][_0x1023('0x1d')](_0x517f2d[_0x1023('0x18')],{'raw':_0x517f2d['options']?_0x517f2d['options'][_0x1023('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517f2d[_0x1023('0x19')]?_0x517f2d[_0x1023('0x19')]['where']||null:null,'attributes':_0x517f2d[_0x1023('0x19')]?_0x517f2d[_0x1023('0x19')]['attributes']||null:null,'limit':_0x517f2d[_0x1023('0x19')]?_0x517f2d['options']['limit']||null:null})[_0x1023('0xb')](function(_0x5171ed){logger[_0x1023('0xc')](_0x1023('0x1c'),_0x517f2d);logger[_0x1023('0x1b')](_0x1023('0x1c'),_0x517f2d,JSON['stringify'](_0x5171ed));_0x261355(_0x5171ed);})[_0x1023('0x14')](function(_0x598c58){logger['error'](_0x1023('0x1c'),_0x598c58[_0x1023('0x12')],_0x517f2d);_0x211001(_0x4700a8['error'](0x1f4,_0x598c58[_0x1023('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index c9b9010..b1129e8 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 _0x6c7b=['./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x29acef,_0x3fa99b){_0x29acef=_0x29acef-0x0;var _0x66385d=_0x6c7b[_0x29acef];return _0x66385d;};'use strict';var multer=require(_0xb6c7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6c7('0x1'));var router=express['Router']();var fs_extra=require(_0xb6c7('0x2'));var auth=require(_0xb6c7('0x3'));var interaction=require(_0xb6c7('0x4'));var config=require('../../config/environment');var controller=require(_0xb6c7('0x5'));router[_0xb6c7('0x6')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x8')]);router[_0xb6c7('0x6')]('/describe',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x9')]);router[_0xb6c7('0x6')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xb')]);router[_0xb6c7('0xc')]('/',auth[_0xb6c7('0x7')](),controller['create']);router['put'](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xd')]);router[_0xb6c7('0xe')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcb81=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xcb81,0x154));var _0x1cb8=function(_0x5bf420,_0x2d068d){_0x5bf420=_0x5bf420-0x0;var _0x1c5255=_0xcb81[_0x5bf420];return _0x1c5255;};'use strict';var multer=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var path=require('path');var timeout=require(_0x1cb8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cb8('0x3'));var interaction=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var controller=require(_0x1cb8('0x6'));router[_0x1cb8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0x8')]);router[_0x1cb8('0x7')]('/describe',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xa')]);router[_0x1cb8('0x7')]('/:id',auth[_0x1cb8('0x9')](),controller['show']);router['post']('/',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xb')]);router[_0x1cb8('0xc')](_0x1cb8('0xd'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xe')]);router[_0x1cb8('0xf')](_0x1cb8('0xd'),auth['isAuthenticated'](),controller[_0x1cb8('0x10')]);module[_0x1cb8('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6433669..ed7ba85 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3c201b,_0x477025){var _0x556eab=function(_0xd855c3){while(--_0xd855c3){_0x3c201b['push'](_0x3c201b['shift']());}};_0x556eab(++_0x477025);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x44b839,_0x3318ad){var _0x4a2eba=function(_0xb97c53){while(--_0xb97c53){_0x44b839['push'](_0x44b839['shift']());}};_0x4a2eba(++_0x3318ad);}(_0xedd9,0xfc));var _0x9edd=function(_0x32e33b,_0x3d54a0){_0x32e33b=_0x32e33b-0x0;var _0xd7612b=_0xedd9[_0x32e33b];return _0xd7612b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index b405e81..1127ae4 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 _0xf6e0=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes'];(function(_0x296307,_0x2df893){var _0x399df8=function(_0x12830a){while(--_0x12830a){_0x296307['push'](_0x296307['shift']());}};_0x399df8(++_0x2df893);}(_0xf6e0,0x152));var _0x0f6e=function(_0x2fdf4b,_0x2de9f3){_0x2fdf4b=_0x2fdf4b-0x0;var _0x3bbc5c=_0xf6e0[_0x2fdf4b];return _0x3bbc5c;};'use strict';var emlformat=require(_0x0f6e('0x0'));var rimraf=require(_0x0f6e('0x1'));var zipdir=require(_0x0f6e('0x2'));var jsonpatch=require(_0x0f6e('0x3'));var rp=require('request-promise');var moment=require(_0x0f6e('0x4'));var BPromise=require(_0x0f6e('0x5'));var Mustache=require(_0x0f6e('0x6'));var util=require(_0x0f6e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0f6e('0x8'));var fs=require('fs');var fs_extra=require(_0x0f6e('0x9'));var _=require(_0x0f6e('0xa'));var squel=require(_0x0f6e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f6e('0xc'));var toCsv=require(_0x0f6e('0xd'));var querystring=require(_0x0f6e('0xe'));var Papa=require(_0x0f6e('0xf'));var Redis=require(_0x0f6e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0f6e('0x11'));var as=require(_0x0f6e('0x12'));var hardwareService=require(_0x0f6e('0x13'));var logger=require(_0x0f6e('0x14'))(_0x0f6e('0x15'));var utils=require('../../config/utils');var config=require(_0x0f6e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f6e('0x17'))['db'];function respondWithStatusCode(_0x14a3c0,_0x358469){_0x358469=_0x358469||0xcc;return function(_0x10a41a){if(_0x10a41a){return _0x14a3c0['sendStatus'](_0x358469);}return _0x14a3c0[_0x0f6e('0x18')](_0x358469)[_0x0f6e('0x19')]();};}function respondWithResult(_0x2b8373,_0x1163ff){_0x1163ff=_0x1163ff||0xc8;return function(_0x58b175){if(_0x58b175){return _0x2b8373[_0x0f6e('0x18')](_0x1163ff)[_0x0f6e('0x1a')](_0x58b175);}};}function respondWithFilteredResult(_0x3f90a0,_0x414155){return function(_0x6d3c8a){if(_0x6d3c8a){var _0x2ad22b=typeof _0x414155[_0x0f6e('0x1b')]===_0x0f6e('0x1c')&&typeof _0x414155[_0x0f6e('0x1d')]===_0x0f6e('0x1c');var _0x3d8ae7=_0x6d3c8a['count'];var _0x3bf6dc=_0x2ad22b?0x0:_0x414155[_0x0f6e('0x1b')];var _0x342ef4=_0x2ad22b?_0x6d3c8a[_0x0f6e('0x1e')]:_0x414155['offset']+_0x414155['limit'];var _0x509fda;if(_0x342ef4>=_0x3d8ae7){_0x342ef4=_0x3d8ae7;_0x509fda=0xc8;}else{_0x509fda=0xce;}_0x3f90a0[_0x0f6e('0x18')](_0x509fda);return _0x3f90a0[_0x0f6e('0x1f')](_0x0f6e('0x20'),_0x3bf6dc+'-'+_0x342ef4+'/'+_0x3d8ae7)['json'](_0x6d3c8a);}return null;};}function patchUpdates(_0x51e4cc){return function(_0x10d72f){try{jsonpatch[_0x0f6e('0x21')](_0x10d72f,_0x51e4cc,!![]);}catch(_0x43f19f){return BPromise[_0x0f6e('0x22')](_0x43f19f);}return _0x10d72f[_0x0f6e('0x23')]();};}function saveUpdates(_0x15bc6d,_0x51666c){return function(_0x5a8b2f){if(_0x5a8b2f){return _0x5a8b2f[_0x0f6e('0x24')](_0x15bc6d)['then'](function(_0x2b19cd){return _0x2b19cd;});}return null;};}function removeEntity(_0x437f29,_0x35d222){return function(_0x45c988){if(_0x45c988){return _0x45c988['destroy']()[_0x0f6e('0x25')](function(){_0x437f29[_0x0f6e('0x18')](0xcc)[_0x0f6e('0x19')]();});}};}function handleEntityNotFound(_0x1a038f,_0x2b5f7d){return function(_0x5dd4f5){if(!_0x5dd4f5){_0x1a038f[_0x0f6e('0x26')](0x194);}return _0x5dd4f5;};}function handleError(_0x4fa4f7,_0x113cd9){_0x113cd9=_0x113cd9||0x1f4;return function(_0x36ec0f){logger[_0x0f6e('0x27')](_0x36ec0f[_0x0f6e('0x28')]);if(_0x36ec0f[_0x0f6e('0x29')]){delete _0x36ec0f[_0x0f6e('0x29')];}_0x4fa4f7['status'](_0x113cd9)[_0x0f6e('0x2a')](_0x36ec0f);};}exports[_0x0f6e('0x2b')]=function(_0x2a8fb6,_0x3a4a5f){var _0x2f043a={},_0x453b84={},_0x3776bf={'count':0x0,'rows':[]};var _0x24d8c5=_[_0x0f6e('0x2c')](db[_0x0f6e('0x2d')][_0x0f6e('0x2e')],function(_0x26799c){return{'name':_0x26799c[_0x0f6e('0x2f')],'type':_0x26799c[_0x0f6e('0x30')][_0x0f6e('0x31')]};});_0x453b84[_0x0f6e('0x32')]=_[_0x0f6e('0x2c')](_0x24d8c5,_0x0f6e('0x29'));_0x453b84[_0x0f6e('0x33')]=_[_0x0f6e('0x34')](_0x2a8fb6[_0x0f6e('0x33')]);_0x453b84[_0x0f6e('0x35')]=_['intersection'](_0x453b84['model'],_0x453b84[_0x0f6e('0x33')]);_0x2f043a['attributes']=_[_0x0f6e('0x36')](_0x453b84[_0x0f6e('0x32')],qs['fields'](_0x2a8fb6['query'][_0x0f6e('0x37')]));_0x2f043a['attributes']=_0x2f043a[_0x0f6e('0x38')][_0x0f6e('0x39')]?_0x2f043a[_0x0f6e('0x38')]:_0x453b84[_0x0f6e('0x32')];if(!_0x2a8fb6[_0x0f6e('0x33')]['hasOwnProperty']('nolimit')){_0x2f043a[_0x0f6e('0x1d')]=qs[_0x0f6e('0x1d')](_0x2a8fb6['query'][_0x0f6e('0x1d')]);_0x2f043a[_0x0f6e('0x1b')]=qs[_0x0f6e('0x1b')](_0x2a8fb6['query'][_0x0f6e('0x1b')]);}_0x2f043a['order']=qs[_0x0f6e('0x3a')](_0x2a8fb6[_0x0f6e('0x33')][_0x0f6e('0x3a')]);_0x2f043a['where']=qs['filters'](_[_0x0f6e('0x3b')](_0x2a8fb6[_0x0f6e('0x33')],_0x453b84[_0x0f6e('0x35')]),_0x24d8c5);if(_0x2a8fb6[_0x0f6e('0x33')][_0x0f6e('0x3c')]){_0x2f043a[_0x0f6e('0x3d')]=_[_0x0f6e('0x3e')](_0x2f043a[_0x0f6e('0x3d')],{'$or':_['map'](_0x24d8c5,function(_0x181a5f){if(_0x181a5f[_0x0f6e('0x30')]!==_0x0f6e('0x3f')){var _0x2acd54={};_0x2acd54[_0x181a5f[_0x0f6e('0x29')]]={'$like':'%'+_0x2a8fb6[_0x0f6e('0x33')][_0x0f6e('0x3c')]+'%'};return _0x2acd54;}})});}_0x2f043a=_[_0x0f6e('0x3e')]({},_0x2f043a,_0x2a8fb6[_0x0f6e('0x40')]);var _0x445b29={'where':_0x2f043a[_0x0f6e('0x3d')]};return db[_0x0f6e('0x2d')]['count'](_0x445b29)['then'](function(_0x414725){_0x3776bf[_0x0f6e('0x1e')]=_0x414725;if(_0x2a8fb6[_0x0f6e('0x33')][_0x0f6e('0x41')]){_0x2f043a['include']=[{'all':!![]}];}return db[_0x0f6e('0x2d')][_0x0f6e('0x42')](_0x2f043a);})[_0x0f6e('0x25')](function(_0x39723b){_0x3776bf[_0x0f6e('0x43')]=_0x39723b;return _0x3776bf;})[_0x0f6e('0x25')](respondWithFilteredResult(_0x3a4a5f,_0x2f043a))[_0x0f6e('0x44')](handleError(_0x3a4a5f,null));};exports[_0x0f6e('0x45')]=function(_0x45ff03,_0xb543cf){var _0x520aae={'raw':!![],'where':{'id':_0x45ff03[_0x0f6e('0x46')]['id']}},_0x1d809a={};_0x1d809a[_0x0f6e('0x32')]=_['keys'](db['SmsTransferReport'][_0x0f6e('0x2e')]);_0x1d809a['query']=_['keys'](_0x45ff03[_0x0f6e('0x33')]);_0x1d809a[_0x0f6e('0x35')]=_[_0x0f6e('0x36')](_0x1d809a[_0x0f6e('0x32')],_0x1d809a[_0x0f6e('0x33')]);_0x520aae['attributes']=_['intersection'](_0x1d809a[_0x0f6e('0x32')],qs[_0x0f6e('0x37')](_0x45ff03[_0x0f6e('0x33')]['fields']));_0x520aae['attributes']=_0x520aae[_0x0f6e('0x38')]['length']?_0x520aae[_0x0f6e('0x38')]:_0x1d809a[_0x0f6e('0x32')];if(_0x45ff03[_0x0f6e('0x33')][_0x0f6e('0x41')]){_0x520aae[_0x0f6e('0x47')]=[{'all':!![]}];}_0x520aae=_[_0x0f6e('0x3e')]({},_0x520aae,_0x45ff03['options']);return db[_0x0f6e('0x2d')][_0x0f6e('0x48')](_0x520aae)[_0x0f6e('0x25')](handleEntityNotFound(_0xb543cf,null))[_0x0f6e('0x25')](respondWithResult(_0xb543cf,null))[_0x0f6e('0x44')](handleError(_0xb543cf,null));};exports[_0x0f6e('0x49')]=function(_0x205073,_0x15b7b6){return db[_0x0f6e('0x2d')][_0x0f6e('0x49')](_0x205073[_0x0f6e('0x4a')],{})[_0x0f6e('0x25')](respondWithResult(_0x15b7b6,0xc9))[_0x0f6e('0x44')](handleError(_0x15b7b6,null));};exports[_0x0f6e('0x24')]=function(_0x541da7,_0x585469){if(_0x541da7['body']['id']){delete _0x541da7[_0x0f6e('0x4a')]['id'];}return db[_0x0f6e('0x2d')][_0x0f6e('0x48')]({'where':{'id':_0x541da7[_0x0f6e('0x46')]['id']}})[_0x0f6e('0x25')](handleEntityNotFound(_0x585469,null))[_0x0f6e('0x25')](saveUpdates(_0x541da7['body'],null))[_0x0f6e('0x25')](respondWithResult(_0x585469,null))[_0x0f6e('0x44')](handleError(_0x585469,null));};exports[_0x0f6e('0x4b')]=function(_0x5295aa,_0x18c6a9){return db[_0x0f6e('0x2d')]['find']({'where':{'id':_0x5295aa[_0x0f6e('0x46')]['id']}})[_0x0f6e('0x25')](handleEntityNotFound(_0x18c6a9,null))[_0x0f6e('0x25')](removeEntity(_0x18c6a9,null))[_0x0f6e('0x44')](handleError(_0x18c6a9,null));};exports['describe']=function(_0x9f12e3,_0x47e176){return db[_0x0f6e('0x2d')][_0x0f6e('0x4c')]()[_0x0f6e('0x25')](respondWithResult(_0x47e176,null))['catch'](handleError(_0x47e176,null));}; \ No newline at end of file +var _0xa2fa=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','SmsTransferReport','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x22e1ea,_0x2c0422){var _0x51264e=function(_0x34d5c0){while(--_0x34d5c0){_0x22e1ea['push'](_0x22e1ea['shift']());}};_0x51264e(++_0x2c0422);}(_0xa2fa,0x95));var _0xaa2f=function(_0x409186,_0x4b8b73){_0x409186=_0x409186-0x0;var _0x3deb43=_0xa2fa[_0x409186];return _0x3deb43;};'use strict';var emlformat=require(_0xaa2f('0x0'));var rimraf=require(_0xaa2f('0x1'));var zipdir=require(_0xaa2f('0x2'));var jsonpatch=require(_0xaa2f('0x3'));var rp=require(_0xaa2f('0x4'));var moment=require('moment');var BPromise=require(_0xaa2f('0x5'));var Mustache=require(_0xaa2f('0x6'));var util=require(_0xaa2f('0x7'));var path=require(_0xaa2f('0x8'));var sox=require(_0xaa2f('0x9'));var csv=require(_0xaa2f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa2f('0xb'));var _=require(_0xaa2f('0xc'));var squel=require('squel');var crypto=require(_0xaa2f('0xd'));var jsforce=require(_0xaa2f('0xe'));var deskjs=require(_0xaa2f('0xf'));var toCsv=require(_0xaa2f('0xa'));var querystring=require(_0xaa2f('0x10'));var Papa=require(_0xaa2f('0x11'));var Redis=require(_0xaa2f('0x12'));var authService=require(_0xaa2f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaa2f('0x14'));var hardwareService=require(_0xaa2f('0x15'));var logger=require(_0xaa2f('0x16'))(_0xaa2f('0x17'));var utils=require(_0xaa2f('0x18'));var config=require(_0xaa2f('0x19'));var licenseUtil=require(_0xaa2f('0x1a'));var db=require(_0xaa2f('0x1b'))['db'];function respondWithStatusCode(_0x24c9da,_0x2edd43){_0x2edd43=_0x2edd43||0xcc;return function(_0x3743a3){if(_0x3743a3){return _0x24c9da[_0xaa2f('0x1c')](_0x2edd43);}return _0x24c9da['status'](_0x2edd43)[_0xaa2f('0x1d')]();};}function respondWithResult(_0x126d37,_0x9a0e59){_0x9a0e59=_0x9a0e59||0xc8;return function(_0x4a78e4){if(_0x4a78e4){return _0x126d37[_0xaa2f('0x1e')](_0x9a0e59)[_0xaa2f('0x1f')](_0x4a78e4);}};}function respondWithFilteredResult(_0x4cb69,_0x405f0e){return function(_0x5cb8e8){if(_0x5cb8e8){var _0x18a9c5=typeof _0x405f0e[_0xaa2f('0x20')]===_0xaa2f('0x21')&&typeof _0x405f0e['limit']===_0xaa2f('0x21');var _0x52af56=_0x5cb8e8[_0xaa2f('0x22')];var _0x171762=_0x18a9c5?0x0:_0x405f0e[_0xaa2f('0x20')];var _0x32448f=_0x18a9c5?_0x5cb8e8[_0xaa2f('0x22')]:_0x405f0e[_0xaa2f('0x20')]+_0x405f0e[_0xaa2f('0x23')];var _0x2636dd;if(_0x32448f>=_0x52af56){_0x32448f=_0x52af56;_0x2636dd=0xc8;}else{_0x2636dd=0xce;}_0x4cb69[_0xaa2f('0x1e')](_0x2636dd);return _0x4cb69[_0xaa2f('0x24')](_0xaa2f('0x25'),_0x171762+'-'+_0x32448f+'/'+_0x52af56)[_0xaa2f('0x1f')](_0x5cb8e8);}return null;};}function patchUpdates(_0x57cb7b){return function(_0x331c78){try{jsonpatch[_0xaa2f('0x26')](_0x331c78,_0x57cb7b,!![]);}catch(_0x186a6e){return BPromise[_0xaa2f('0x27')](_0x186a6e);}return _0x331c78['save']();};}function saveUpdates(_0x1e7cf4,_0x459dc8){return function(_0x4ab436){if(_0x4ab436){return _0x4ab436[_0xaa2f('0x28')](_0x1e7cf4)[_0xaa2f('0x29')](function(_0x32c95c){return _0x32c95c;});}return null;};}function removeEntity(_0x1a084a,_0x1979ac){return function(_0x14bbac){if(_0x14bbac){return _0x14bbac[_0xaa2f('0x2a')]()[_0xaa2f('0x29')](function(){_0x1a084a[_0xaa2f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fc45,_0x537947){return function(_0x267be6){if(!_0x267be6){_0x39fc45['sendStatus'](0x194);}return _0x267be6;};}function handleError(_0x1bff96,_0x1f8132){_0x1f8132=_0x1f8132||0x1f4;return function(_0x4e1315){logger[_0xaa2f('0x2b')](_0x4e1315[_0xaa2f('0x2c')]);if(_0x4e1315['name']){delete _0x4e1315[_0xaa2f('0x2d')];}_0x1bff96['status'](_0x1f8132)[_0xaa2f('0x2e')](_0x4e1315);};}exports['index']=function(_0x2f478d,_0x546ff3){var _0x47956d={},_0x25476d={},_0x42cafb={'count':0x0,'rows':[]};var _0x46d800=_[_0xaa2f('0x2f')](db['SmsTransferReport'][_0xaa2f('0x30')],function(_0x32878d){return{'name':_0x32878d['fieldName'],'type':_0x32878d[_0xaa2f('0x31')]['key']};});_0x25476d[_0xaa2f('0x32')]=_[_0xaa2f('0x2f')](_0x46d800,'name');_0x25476d[_0xaa2f('0x33')]=_['keys'](_0x2f478d[_0xaa2f('0x33')]);_0x25476d['filters']=_['intersection'](_0x25476d[_0xaa2f('0x32')],_0x25476d[_0xaa2f('0x33')]);_0x47956d[_0xaa2f('0x34')]=_[_0xaa2f('0x35')](_0x25476d['model'],qs[_0xaa2f('0x36')](_0x2f478d[_0xaa2f('0x33')][_0xaa2f('0x36')]));_0x47956d[_0xaa2f('0x34')]=_0x47956d[_0xaa2f('0x34')][_0xaa2f('0x37')]?_0x47956d[_0xaa2f('0x34')]:_0x25476d[_0xaa2f('0x32')];if(!_0x2f478d[_0xaa2f('0x33')][_0xaa2f('0x38')](_0xaa2f('0x39'))){_0x47956d[_0xaa2f('0x23')]=qs[_0xaa2f('0x23')](_0x2f478d['query']['limit']);_0x47956d[_0xaa2f('0x20')]=qs[_0xaa2f('0x20')](_0x2f478d[_0xaa2f('0x33')]['offset']);}_0x47956d['order']=qs[_0xaa2f('0x3a')](_0x2f478d[_0xaa2f('0x33')][_0xaa2f('0x3a')]);_0x47956d[_0xaa2f('0x3b')]=qs[_0xaa2f('0x3c')](_[_0xaa2f('0x3d')](_0x2f478d[_0xaa2f('0x33')],_0x25476d[_0xaa2f('0x3c')]),_0x46d800);if(_0x2f478d[_0xaa2f('0x33')][_0xaa2f('0x3e')]){_0x47956d[_0xaa2f('0x3b')]=_['merge'](_0x47956d[_0xaa2f('0x3b')],{'$or':_[_0xaa2f('0x2f')](_0x46d800,function(_0x367f2e){if(_0x367f2e[_0xaa2f('0x31')]!==_0xaa2f('0x3f')){var _0x225605={};_0x225605[_0x367f2e[_0xaa2f('0x2d')]]={'$like':'%'+_0x2f478d[_0xaa2f('0x33')][_0xaa2f('0x3e')]+'%'};return _0x225605;}})});}_0x47956d=_[_0xaa2f('0x40')]({},_0x47956d,_0x2f478d[_0xaa2f('0x41')]);var _0x5270f3={'where':_0x47956d[_0xaa2f('0x3b')]};return db[_0xaa2f('0x42')][_0xaa2f('0x22')](_0x5270f3)[_0xaa2f('0x29')](function(_0x43c608){_0x42cafb[_0xaa2f('0x22')]=_0x43c608;if(_0x2f478d[_0xaa2f('0x33')]['includeAll']){_0x47956d[_0xaa2f('0x43')]=[{'all':!![]}];}return db[_0xaa2f('0x42')][_0xaa2f('0x44')](_0x47956d);})['then'](function(_0x1a6a80){_0x42cafb['rows']=_0x1a6a80;return _0x42cafb;})[_0xaa2f('0x29')](respondWithFilteredResult(_0x546ff3,_0x47956d))[_0xaa2f('0x45')](handleError(_0x546ff3,null));};exports[_0xaa2f('0x46')]=function(_0x358def,_0x4dd7d3){var _0x3a060c={'raw':!![],'where':{'id':_0x358def[_0xaa2f('0x47')]['id']}},_0x15646a={};_0x15646a[_0xaa2f('0x32')]=_['keys'](db[_0xaa2f('0x42')]['rawAttributes']);_0x15646a[_0xaa2f('0x33')]=_[_0xaa2f('0x48')](_0x358def['query']);_0x15646a[_0xaa2f('0x3c')]=_[_0xaa2f('0x35')](_0x15646a[_0xaa2f('0x32')],_0x15646a['query']);_0x3a060c[_0xaa2f('0x34')]=_[_0xaa2f('0x35')](_0x15646a['model'],qs[_0xaa2f('0x36')](_0x358def[_0xaa2f('0x33')][_0xaa2f('0x36')]));_0x3a060c[_0xaa2f('0x34')]=_0x3a060c[_0xaa2f('0x34')][_0xaa2f('0x37')]?_0x3a060c[_0xaa2f('0x34')]:_0x15646a[_0xaa2f('0x32')];if(_0x358def[_0xaa2f('0x33')]['includeAll']){_0x3a060c['include']=[{'all':!![]}];}_0x3a060c=_[_0xaa2f('0x40')]({},_0x3a060c,_0x358def[_0xaa2f('0x41')]);return db[_0xaa2f('0x42')][_0xaa2f('0x49')](_0x3a060c)['then'](handleEntityNotFound(_0x4dd7d3,null))[_0xaa2f('0x29')](respondWithResult(_0x4dd7d3,null))[_0xaa2f('0x45')](handleError(_0x4dd7d3,null));};exports[_0xaa2f('0x4a')]=function(_0xf8f6f9,_0x48a32d){return db['SmsTransferReport']['create'](_0xf8f6f9[_0xaa2f('0x4b')],{})[_0xaa2f('0x29')](respondWithResult(_0x48a32d,0xc9))[_0xaa2f('0x45')](handleError(_0x48a32d,null));};exports['update']=function(_0xbe260e,_0x512ccd){if(_0xbe260e[_0xaa2f('0x4b')]['id']){delete _0xbe260e[_0xaa2f('0x4b')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0xbe260e[_0xaa2f('0x47')]['id']}})[_0xaa2f('0x29')](handleEntityNotFound(_0x512ccd,null))['then'](saveUpdates(_0xbe260e[_0xaa2f('0x4b')],null))['then'](respondWithResult(_0x512ccd,null))[_0xaa2f('0x45')](handleError(_0x512ccd,null));};exports[_0xaa2f('0x2a')]=function(_0x5c01c1,_0x3d45b8){return db[_0xaa2f('0x42')][_0xaa2f('0x49')]({'where':{'id':_0x5c01c1['params']['id']}})[_0xaa2f('0x29')](handleEntityNotFound(_0x3d45b8,null))['then'](removeEntity(_0x3d45b8,null))['catch'](handleError(_0x3d45b8,null));};exports[_0xaa2f('0x4c')]=function(_0x200d4b,_0x11649e){return db['SmsTransferReport'][_0xaa2f('0x4c')]()['then'](respondWithResult(_0x11649e,null))['catch'](handleError(_0x11649e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 9155618..3d5905c 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 _0x0c74=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x0c74,0x1cd));var _0x40c7=function(_0x511c1f,_0x4cf980){_0x511c1f=_0x511c1f-0x0;var _0x28a239=_0x0c74[_0x511c1f];return _0x28a239;};'use strict';var _=require('lodash');var util=require(_0x40c7('0x0'));var logger=require(_0x40c7('0x1'))(_0x40c7('0x2'));var moment=require(_0x40c7('0x3'));var BPromise=require(_0x40c7('0x4'));var rp=require(_0x40c7('0x5'));var fs=require('fs');var path=require(_0x40c7('0x6'));var rimraf=require('rimraf');var config=require(_0x40c7('0x7'));var attributes=require(_0x40c7('0x8'));module[_0x40c7('0x9')]=function(_0x435ca0,_0x4d7ffb){return _0x435ca0[_0x40c7('0xa')](_0x40c7('0xb'),attributes,{'tableName':_0x40c7('0xc'),'paranoid':![],'indexes':[{'name':_0x40c7('0xd'),'fields':[_0x40c7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6782=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','report_sms_transfer'];(function(_0x52bd65,_0x160646){var _0x13fd57=function(_0xe84392){while(--_0xe84392){_0x52bd65['push'](_0x52bd65['shift']());}};_0x13fd57(++_0x160646);}(_0x6782,0xdd));var _0x2678=function(_0x116142,_0x5c61df){_0x116142=_0x116142-0x0;var _0x22c343=_0x6782[_0x116142];return _0x22c343;};'use strict';var _=require(_0x2678('0x0'));var util=require('util');var logger=require(_0x2678('0x1'))(_0x2678('0x2'));var moment=require('moment');var BPromise=require(_0x2678('0x3'));var rp=require(_0x2678('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2678('0x5'));var attributes=require(_0x2678('0x6'));module[_0x2678('0x7')]=function(_0x51e828,_0x5f2b1e){return _0x51e828['define']('SmsTransferReport',attributes,{'tableName':_0x2678('0x8'),'paranoid':![],'indexes':[{'name':_0x2678('0x9'),'fields':[_0x2678('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 56df17b..ecea76d 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 _0x27bf=['rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x27bf,0x117));var _0xf27b=function(_0x2ddc3e,_0x54abc9){_0x2ddc3e=_0x2ddc3e-0x0;var _0xbeb360=_0x27bf[_0x2ddc3e];return _0xbeb360;};'use strict';var _=require(_0xf27b('0x0'));var util=require(_0xf27b('0x1'));var moment=require(_0xf27b('0x2'));var BPromise=require(_0xf27b('0x3'));var rs=require(_0xf27b('0x4'));var fs=require('fs');var Redis=require(_0xf27b('0x5'));var db=require(_0xf27b('0x6'))['db'];var utils=require(_0xf27b('0x7'));var logger=require(_0xf27b('0x8'))(_0xf27b('0x9'));var config=require(_0xf27b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf27b('0xb')][_0xf27b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2476ab,_0x32391c,_0x1fdc28){return new BPromise(function(_0x36d178,_0x4df7c0){return client[_0xf27b('0xd')](_0x2476ab,_0x1fdc28)[_0xf27b('0xe')](function(_0x969a6f){logger[_0xf27b('0xf')](_0xf27b('0x10'),_0x32391c,_0xf27b('0x11'));logger[_0xf27b('0x12')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x32391c,'request\x20sent',JSON['stringify'](_0x969a6f));if(_0x969a6f[_0xf27b('0x13')]){if(_0x969a6f['error'][_0xf27b('0x14')]===0x1f4){logger[_0xf27b('0x13')](_0xf27b('0x10'),_0x32391c,_0x969a6f[_0xf27b('0x13')]['message']);return _0x4df7c0(_0x969a6f[_0xf27b('0x13')][_0xf27b('0x15')]);}logger[_0xf27b('0x13')](_0xf27b('0x10'),_0x32391c,_0x969a6f['error'][_0xf27b('0x15')]);return _0x36d178(_0x969a6f[_0xf27b('0x13')]['message']);}else{logger['info'](_0xf27b('0x10'),_0x32391c,'request\x20sent');_0x36d178(_0x969a6f[_0xf27b('0x16')][_0xf27b('0x15')]);}})[_0xf27b('0x17')](function(_0x5305d9){logger[_0xf27b('0x13')](_0xf27b('0x10'),_0x32391c,_0x5305d9);_0x4df7c0(_0x5305d9);});});} \ No newline at end of file +var _0x4f5d=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4f5d[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var moment=require(_0xd4f5('0x2'));var BPromise=require(_0xd4f5('0x3'));var rs=require(_0xd4f5('0x4'));var fs=require('fs');var Redis=require(_0xd4f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4f5('0x6'));var logger=require(_0xd4f5('0x7'))(_0xd4f5('0x8'));var config=require(_0xd4f5('0x9'));var jayson=require(_0xd4f5('0xa'));var client=jayson[_0xd4f5('0xb')][_0xd4f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ab294,_0x150de6,_0x1d2d72){return new BPromise(function(_0xee2bc,_0x2690e8){return client[_0xd4f5('0xd')](_0x3ab294,_0x1d2d72)['then'](function(_0x4424cb){logger[_0xd4f5('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x150de6,_0xd4f5('0xf'));logger[_0xd4f5('0x10')](_0xd4f5('0x11'),_0x150de6,_0xd4f5('0xf'),JSON[_0xd4f5('0x12')](_0x4424cb));if(_0x4424cb[_0xd4f5('0x13')]){if(_0x4424cb[_0xd4f5('0x13')][_0xd4f5('0x14')]===0x1f4){logger[_0xd4f5('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x150de6,_0x4424cb[_0xd4f5('0x13')][_0xd4f5('0x15')]);return _0x2690e8(_0x4424cb['error'][_0xd4f5('0x15')]);}logger[_0xd4f5('0x13')](_0xd4f5('0x16'),_0x150de6,_0x4424cb['error'][_0xd4f5('0x15')]);return _0xee2bc(_0x4424cb[_0xd4f5('0x13')][_0xd4f5('0x15')]);}else{logger[_0xd4f5('0xe')](_0xd4f5('0x16'),_0x150de6,_0xd4f5('0xf'));_0xee2bc(_0x4424cb[_0xd4f5('0x17')][_0xd4f5('0x15')]);}})['catch'](function(_0x452e46){logger['error'](_0xd4f5('0x16'),_0x150de6,_0x452e46);_0x2690e8(_0x452e46);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 15248c4..82339a4 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 _0x76e2=['format','extname','now','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace'];(function(_0x559348,_0xfb672){var _0x50d030=function(_0x37d8cd){while(--_0x37d8cd){_0x559348['push'](_0x559348['shift']());}};_0x50d030(++_0xfb672);}(_0x76e2,0x66));var _0x276e=function(_0x148661,_0x257a45){_0x148661=_0x148661-0x0;var _0x247538=_0x76e2[_0x148661];return _0x247538;};'use strict';var multer=require(_0x276e('0x0'));var util=require(_0x276e('0x1'));var path=require(_0x276e('0x2'));var timeout=require(_0x276e('0x3'));var express=require(_0x276e('0x4'));var router=express[_0x276e('0x5')]();var fs_extra=require(_0x276e('0x6'));var auth=require(_0x276e('0x7'));var interaction=require(_0x276e('0x8'));var config=require(_0x276e('0x9'));var controller=require('./sound.controller');router[_0x276e('0xa')]('/',auth[_0x276e('0xb')](),controller[_0x276e('0xc')]);router['get'](_0x276e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x276e('0xa')](_0x276e('0xe'),auth['isAuthenticated'](),controller[_0x276e('0xf')]);var upload=multer({'storage':multer[_0x276e('0x10')]({'destination':function(_0x3c91cd,_0x347955,_0x29303d){_0x29303d(null,path[_0x276e('0x11')](config[_0x276e('0x12')],_0x276e('0x13')));},'filename':function(_0x143f49,_0x52501f,_0x2653ef){_0x52501f[_0x276e('0x14')]=_0x52501f[_0x276e('0x14')][_0x276e('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2653ef(null,util[_0x276e('0x16')]('%s-%s%s',path['basename'](_0x52501f['originalname'],path[_0x276e('0x17')](_0x52501f[_0x276e('0x14')])),Date[_0x276e('0x18')](),path['extname'](_0x52501f[_0x276e('0x14')])));}})});router['post']('/',upload['single'](_0x276e('0x19')),controller[_0x276e('0x1a')]);router[_0x276e('0x1b')](_0x276e('0xd'),auth[_0x276e('0xb')](),controller[_0x276e('0x1c')]);router[_0x276e('0x1d')](_0x276e('0xd'),auth[_0x276e('0xb')](),controller['delete']);module[_0x276e('0x1e')]=router; \ No newline at end of file +var _0xf576=['replace','%s-%s%s','now','extname','post','single','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','index','get','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0x18427e,_0x358c0e){var _0x236816=function(_0x50576c){while(--_0x50576c){_0x18427e['push'](_0x18427e['shift']());}};_0x236816(++_0x358c0e);}(_0xf576,0x1eb));var _0x6f57=function(_0x1a031e,_0x6b2faf){_0x1a031e=_0x1a031e-0x0;var _0x278a53=_0xf576[_0x1a031e];return _0x278a53;};'use strict';var multer=require(_0x6f57('0x0'));var util=require(_0x6f57('0x1'));var path=require(_0x6f57('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f57('0x3'));var router=express[_0x6f57('0x4')]();var fs_extra=require(_0x6f57('0x5'));var auth=require(_0x6f57('0x6'));var interaction=require(_0x6f57('0x7'));var config=require('../../config/environment');var controller=require(_0x6f57('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f57('0x9')]);router[_0x6f57('0xa')](_0x6f57('0xb'),auth['isAuthenticated'](),controller[_0x6f57('0xc')]);router['get'](_0x6f57('0xd'),auth[_0x6f57('0xe')](),controller[_0x6f57('0xf')]);var upload=multer({'storage':multer[_0x6f57('0x10')]({'destination':function(_0x110371,_0x520ef0,_0x38d75b){_0x38d75b(null,path[_0x6f57('0x11')](config[_0x6f57('0x12')],_0x6f57('0x13')));},'filename':function(_0x237b96,_0x2d2cbe,_0x53a69a){_0x2d2cbe[_0x6f57('0x14')]=_0x2d2cbe['originalname'][_0x6f57('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53a69a(null,util['format'](_0x6f57('0x16'),path['basename'](_0x2d2cbe[_0x6f57('0x14')],path['extname'](_0x2d2cbe[_0x6f57('0x14')])),Date[_0x6f57('0x17')](),path[_0x6f57('0x18')](_0x2d2cbe['originalname'])));}})});router[_0x6f57('0x19')]('/',upload[_0x6f57('0x1a')]('file'),controller[_0x6f57('0x1b')]);router[_0x6f57('0x1c')](_0x6f57('0xb'),auth['isAuthenticated'](),controller[_0x6f57('0x1d')]);router[_0x6f57('0x1e')](_0x6f57('0xb'),auth['isAuthenticated'](),controller[_0x6f57('0x1e')]);module[_0x6f57('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 958fd3a..987b4cf 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 _0x46ba=['INTEGER','exports','STRING','name','FLOAT','BIGINT'];(function(_0x408a5e,_0x715fad){var _0x38ff17=function(_0x9d194){while(--_0x9d194){_0x408a5e['push'](_0x408a5e['shift']());}};_0x38ff17(++_0x715fad);}(_0x46ba,0x12d));var _0xa46b=function(_0x3416ff,_0x2ce5c0){_0x3416ff=_0x3416ff-0x0;var _0x2689ba=_0x46ba[_0x3416ff];return _0x2689ba;};'use strict';var Sequelize=require('sequelize');module[_0xa46b('0x0')]={'name':{'type':Sequelize[_0xa46b('0x1')],'unique':_0xa46b('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa46b('0x1')]},'display_name':{'type':Sequelize[_0xa46b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xa46b('0x1')]},'original_format':{'type':Sequelize[_0xa46b('0x1')]},'original_duration':{'type':Sequelize[_0xa46b('0x3')]},'original_sampleCount':{'type':Sequelize[_0xa46b('0x4')]},'original_channelCount':{'type':Sequelize[_0xa46b('0x5')]},'original_bitRate':{'type':Sequelize[_0xa46b('0x4')]},'original_sampleRate':{'type':Sequelize[_0xa46b('0x5')]},'converted_format':{'type':Sequelize[_0xa46b('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xa46b('0x5')]},'converted_bitRate':{'type':Sequelize[_0xa46b('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xa46b('0x5')]}}; \ No newline at end of file +var _0xf4cb=['FLOAT','INTEGER','BIGINT','exports','STRING','name'];(function(_0x137236,_0x18e769){var _0x6ca3f8=function(_0x253505){while(--_0x253505){_0x137236['push'](_0x137236['shift']());}};_0x6ca3f8(++_0x18e769);}(_0xf4cb,0x1c5));var _0xbf4c=function(_0x4cae56,_0x461026){_0x4cae56=_0x4cae56-0x0;var _0x721d5c=_0xf4cb[_0x4cae56];return _0x721d5c;};'use strict';var Sequelize=require('sequelize');module[_0xbf4c('0x0')]={'name':{'type':Sequelize[_0xbf4c('0x1')],'unique':_0xbf4c('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xbf4c('0x1')]},'display_name':{'type':Sequelize[_0xbf4c('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xbf4c('0x1')]},'original_format':{'type':Sequelize[_0xbf4c('0x1')]},'original_duration':{'type':Sequelize[_0xbf4c('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xbf4c('0x4')]},'original_bitRate':{'type':Sequelize[_0xbf4c('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xbf4c('0x1')]},'converted_duration':{'type':Sequelize[_0xbf4c('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xbf4c('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xbf4c('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 602fb77..a5e3fab 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 _0xbf31=['map','Sound','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','params','rawAttributes','options','find','catch','download','save_name','converted_format','existsSync','root','ValidationError','Sound\x20not\x20found','join','server/files/sounds/converted','format','%s.%s','file','originalname','extname','basename','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','user','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','description','delete','original_format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','Sounds','then','error','stack','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbf31,0x1c7));var _0x1bf3=function(_0x4d9c38,_0x3aca87){_0x4d9c38=_0x4d9c38-0x0;var _0x5b2978=_0xbf31[_0x4d9c38];return _0x5b2978;};'use strict';var emlformat=require(_0x1bf3('0x0'));var rimraf=require(_0x1bf3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bf3('0x2'));var rp=require(_0x1bf3('0x3'));var moment=require('moment');var BPromise=require(_0x1bf3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1bf3('0x5'));var sox=require(_0x1bf3('0x6'));var csv=require(_0x1bf3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bf3('0x8'));var _=require('lodash');var squel=require(_0x1bf3('0x9'));var crypto=require(_0x1bf3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1bf3('0xb'));var toCsv=require(_0x1bf3('0x7'));var querystring=require(_0x1bf3('0xc'));var Papa=require(_0x1bf3('0xd'));var Redis=require(_0x1bf3('0xe'));var authService=require(_0x1bf3('0xf'));var qs=require(_0x1bf3('0x10'));var as=require(_0x1bf3('0x11'));var hardwareService=require(_0x1bf3('0x12'));var logger=require(_0x1bf3('0x13'))('api');var utils=require(_0x1bf3('0x14'));var config=require(_0x1bf3('0x15'));var licenseUtil=require(_0x1bf3('0x16'));var db=require(_0x1bf3('0x17'))['db'];function respondWithStatusCode(_0x1eeecf,_0x37916a){_0x37916a=_0x37916a||0xcc;return function(_0x1e4f98){if(_0x1e4f98){return _0x1eeecf[_0x1bf3('0x18')](_0x37916a);}return _0x1eeecf[_0x1bf3('0x19')](_0x37916a)[_0x1bf3('0x1a')]();};}function respondWithResult(_0x5bb2f5,_0x3f87fd){_0x3f87fd=_0x3f87fd||0xc8;return function(_0x297aa7){if(_0x297aa7){return _0x5bb2f5[_0x1bf3('0x19')](_0x3f87fd)[_0x1bf3('0x1b')](_0x297aa7);}};}function respondWithFilteredResult(_0x4786f8,_0x3d6484){return function(_0x3a14bd){if(_0x3a14bd){var _0x422363=typeof _0x3d6484[_0x1bf3('0x1c')]===_0x1bf3('0x1d')&&typeof _0x3d6484['limit']===_0x1bf3('0x1d');var _0x521a42=_0x3a14bd[_0x1bf3('0x1e')];var _0x27b89a=_0x422363?0x0:_0x3d6484[_0x1bf3('0x1c')];var _0x388b1e=_0x422363?_0x3a14bd[_0x1bf3('0x1e')]:_0x3d6484[_0x1bf3('0x1c')]+_0x3d6484[_0x1bf3('0x1f')];var _0x459fe2;if(_0x388b1e>=_0x521a42){_0x388b1e=_0x521a42;_0x459fe2=0xc8;}else{_0x459fe2=0xce;}_0x4786f8[_0x1bf3('0x19')](_0x459fe2);return _0x4786f8['set'](_0x1bf3('0x20'),_0x27b89a+'-'+_0x388b1e+'/'+_0x521a42)[_0x1bf3('0x1b')](_0x3a14bd);}return null;};}function patchUpdates(_0x3a3294){return function(_0x161f9a){try{jsonpatch[_0x1bf3('0x21')](_0x161f9a,_0x3a3294,!![]);}catch(_0x3d0cf4){return BPromise['reject'](_0x3d0cf4);}return _0x161f9a['save']();};}function saveUpdates(_0xfc874d,_0x17bb50){return function(_0x445865){if(_0x445865){return _0x445865[_0x1bf3('0x22')](_0xfc874d)['then'](function(_0x27f322){return _0x27f322;});}return null;};}function removeEntity(_0x569b2c,_0x386725){return function(_0x14081e){if(_0x14081e){return _0x14081e[_0x1bf3('0x23')]()['then'](function(){var _0x3c4b2e=_0x14081e['get']({'plain':!![]});var _0x5ea381=_0x1bf3('0x24');return db['UserProfileResource'][_0x1bf3('0x23')]({'where':{'type':_0x5ea381,'resourceId':_0x3c4b2e['id']}})['then'](function(){return _0x14081e;});})[_0x1bf3('0x25')](function(){_0x569b2c[_0x1bf3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b7a95,_0x1da8f0){return function(_0x50f336){if(!_0x50f336){_0x2b7a95[_0x1bf3('0x18')](0x194);}return _0x50f336;};}function handleError(_0x4f4000,_0x383da7){_0x383da7=_0x383da7||0x1f4;return function(_0x2305af){logger[_0x1bf3('0x26')](_0x2305af[_0x1bf3('0x27')]);if(_0x2305af['name']){delete _0x2305af[_0x1bf3('0x28')];}_0x4f4000['status'](_0x383da7)['send'](_0x2305af);};}exports['index']=function(_0x5adeae,_0x3f9a6e){var _0x59bef9={},_0x221689={},_0xdbc528={'count':0x0,'rows':[]};var _0x2d4a92=_[_0x1bf3('0x29')](db[_0x1bf3('0x2a')]['rawAttributes'],function(_0x55a4e1){return{'name':_0x55a4e1[_0x1bf3('0x2b')],'type':_0x55a4e1[_0x1bf3('0x2c')][_0x1bf3('0x2d')]};});_0x221689[_0x1bf3('0x2e')]=_[_0x1bf3('0x29')](_0x2d4a92,'name');_0x221689[_0x1bf3('0x2f')]=_[_0x1bf3('0x30')](_0x5adeae[_0x1bf3('0x2f')]);_0x221689[_0x1bf3('0x31')]=_[_0x1bf3('0x32')](_0x221689['model'],_0x221689[_0x1bf3('0x2f')]);_0x59bef9[_0x1bf3('0x33')]=_[_0x1bf3('0x32')](_0x221689[_0x1bf3('0x2e')],qs[_0x1bf3('0x34')](_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x34')]));_0x59bef9['attributes']=_0x59bef9[_0x1bf3('0x33')]['length']?_0x59bef9['attributes']:_0x221689[_0x1bf3('0x2e')];if(!_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x35')](_0x1bf3('0x36'))){_0x59bef9[_0x1bf3('0x1f')]=qs[_0x1bf3('0x1f')](_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x1f')]);_0x59bef9[_0x1bf3('0x1c')]=qs['offset'](_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x1c')]);}_0x59bef9[_0x1bf3('0x37')]=qs['sort'](_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x38')]);_0x59bef9[_0x1bf3('0x39')]=qs[_0x1bf3('0x31')](_[_0x1bf3('0x3a')](_0x5adeae['query'],_0x221689[_0x1bf3('0x31')]),_0x2d4a92);if(_0x5adeae['query']['filter']){_0x59bef9[_0x1bf3('0x39')]=_[_0x1bf3('0x3b')](_0x59bef9['where'],{'$or':_['map'](_0x2d4a92,function(_0xd2ec4d){if(_0xd2ec4d['type']!==_0x1bf3('0x3c')){var _0x3032cc={};_0x3032cc[_0xd2ec4d[_0x1bf3('0x28')]]={'$like':'%'+_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x3d')]+'%'};return _0x3032cc;}})});}_0x59bef9=_['merge']({},_0x59bef9,_0x5adeae['options']);var _0x5922aa={'where':_0x59bef9[_0x1bf3('0x39')]};return db[_0x1bf3('0x2a')]['count'](_0x5922aa)['then'](function(_0x204d20){_0xdbc528[_0x1bf3('0x1e')]=_0x204d20;if(_0x5adeae[_0x1bf3('0x2f')][_0x1bf3('0x3e')]){_0x59bef9[_0x1bf3('0x3f')]=[{'all':!![]}];}return db[_0x1bf3('0x2a')]['findAll'](_0x59bef9);})[_0x1bf3('0x25')](function(_0x2f236e){_0xdbc528[_0x1bf3('0x40')]=_0x2f236e;return _0xdbc528;})[_0x1bf3('0x25')](respondWithFilteredResult(_0x3f9a6e,_0x59bef9))['catch'](handleError(_0x3f9a6e,null));};exports['show']=function(_0x9e7afe,_0x15c9c7){var _0x35b835={'raw':!![],'where':{'id':_0x9e7afe[_0x1bf3('0x41')]['id']}},_0x5276db={};_0x5276db[_0x1bf3('0x2e')]=_[_0x1bf3('0x30')](db[_0x1bf3('0x2a')][_0x1bf3('0x42')]);_0x5276db[_0x1bf3('0x2f')]=_['keys'](_0x9e7afe[_0x1bf3('0x2f')]);_0x5276db[_0x1bf3('0x31')]=_[_0x1bf3('0x32')](_0x5276db['model'],_0x5276db['query']);_0x35b835[_0x1bf3('0x33')]=_[_0x1bf3('0x32')](_0x5276db[_0x1bf3('0x2e')],qs[_0x1bf3('0x34')](_0x9e7afe['query'][_0x1bf3('0x34')]));_0x35b835[_0x1bf3('0x33')]=_0x35b835['attributes']['length']?_0x35b835[_0x1bf3('0x33')]:_0x5276db[_0x1bf3('0x2e')];if(_0x9e7afe['query']['includeAll']){_0x35b835[_0x1bf3('0x3f')]=[{'all':!![]}];}_0x35b835=_['merge']({},_0x35b835,_0x9e7afe[_0x1bf3('0x43')]);return db[_0x1bf3('0x2a')][_0x1bf3('0x44')](_0x35b835)[_0x1bf3('0x25')](handleEntityNotFound(_0x15c9c7,null))[_0x1bf3('0x25')](respondWithResult(_0x15c9c7,null))[_0x1bf3('0x45')](handleError(_0x15c9c7,null));};exports[_0x1bf3('0x46')]=function(_0x499255,_0x14ded8,_0x43756e){return db['Sound'][_0x1bf3('0x44')]({'where':{'id':_0x499255[_0x1bf3('0x41')]['id']},'attributes':['name',_0x1bf3('0x47'),_0x1bf3('0x48')],'raw':!![]})[_0x1bf3('0x25')](handleEntityNotFound(_0x14ded8,null))[_0x1bf3('0x25')](function(_0x24feff){if(_0x24feff){if(!fs[_0x1bf3('0x49')](path['join'](config[_0x1bf3('0x4a')],'server/files/sounds/converted',_0x24feff[_0x1bf3('0x47')]+'.'+_0x24feff['converted_format']))){throw new db['Sequelize'][(_0x1bf3('0x4b'))](_0x1bf3('0x4c'));}return _0x14ded8[_0x1bf3('0x46')](path[_0x1bf3('0x4d')](config[_0x1bf3('0x4a')],_0x1bf3('0x4e'),util[_0x1bf3('0x4f')](_0x1bf3('0x50'),_0x24feff[_0x1bf3('0x47')],_0x24feff[_0x1bf3('0x48')])),util[_0x1bf3('0x4f')](_0x1bf3('0x50'),_0x24feff[_0x1bf3('0x28')],_0x24feff[_0x1bf3('0x48')]));}return null;})[_0x1bf3('0x45')](handleError(_0x14ded8,null));};exports['create']=function(_0x569704,_0x3d8017,_0x472601){var _0x13aea8={'name':path['basename'](_0x569704[_0x1bf3('0x51')][_0x1bf3('0x52')],path[_0x1bf3('0x53')](_0x569704[_0x1bf3('0x51')]['originalname'])),'save_name':path[_0x1bf3('0x54')](_0x569704[_0x1bf3('0x51')]['filename'],path[_0x1bf3('0x53')](_0x569704[_0x1bf3('0x51')][_0x1bf3('0x55')])),'original_format':path[_0x1bf3('0x53')](_0x569704[_0x1bf3('0x51')][_0x1bf3('0x52')])['substring'](0x1),'converted_format':_0x1bf3('0x56')};var _0x194696=path['join'](config['root'],_0x1bf3('0x57'),_0x569704[_0x1bf3('0x51')][_0x1bf3('0x55')]);var _0x3fc426=path[_0x1bf3('0x4d')](config[_0x1bf3('0x4a')],'server/files/sounds/converted',util[_0x1bf3('0x4f')](_0x1bf3('0x50'),path[_0x1bf3('0x54')](_0x569704[_0x1bf3('0x51')]['filename'],path[_0x1bf3('0x53')](_0x569704[_0x1bf3('0x51')][_0x1bf3('0x55')])),_0x13aea8[_0x1bf3('0x48')]));logger[_0x1bf3('0x58')](_0x1bf3('0x59'),_0x194696);logger['info'](_0x1bf3('0x5a'),_0x3fc426);try{fs[_0x1bf3('0x5b')](_0x194696,parseInt(_0x1bf3('0x5c'),0x8));var _0xc5886a=sox[_0x1bf3('0x5d')](_0x194696,_0x3fc426,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xc5886a['on']('error',function(_0x113500){fs[_0x1bf3('0x5e')](_0x194696);_0x3d8017[_0x1bf3('0x19')](0x1f4)['send'](_0x113500);});_0xc5886a['on'](_0x1bf3('0x5f'),function(_0x2e2722){_0x13aea8['original_duration']=isNaN(_0x2e2722[_0x1bf3('0x60')])?null:_0x2e2722['duration']*0x3e8;_0x13aea8['original_sampleCount']=isNaN(_0x2e2722[_0x1bf3('0x61')])?null:_0x2e2722[_0x1bf3('0x61')];_0x13aea8[_0x1bf3('0x62')]=isNaN(_0x2e2722[_0x1bf3('0x63')])?null:_0x2e2722['channelCount'];_0x13aea8[_0x1bf3('0x64')]=isNaN(_0x2e2722[_0x1bf3('0x65')])?null:_0x2e2722[_0x1bf3('0x65')];_0x13aea8[_0x1bf3('0x66')]=isNaN(_0x2e2722[_0x1bf3('0x67')])?null:_0x2e2722['sampleRate'];});_0xc5886a['on'](_0x1bf3('0x68'),function(_0x729fa0){_0x13aea8[_0x1bf3('0x69')]=isNaN(_0x729fa0['duration'])?null:_0x729fa0[_0x1bf3('0x60')]*0x3e8;_0x13aea8[_0x1bf3('0x6a')]=isNaN(_0x729fa0[_0x1bf3('0x61')])?null:_0x729fa0[_0x1bf3('0x61')];_0x13aea8[_0x1bf3('0x6b')]=isNaN(_0x729fa0['channelCount'])?null:_0x729fa0[_0x1bf3('0x63')];_0x13aea8[_0x1bf3('0x6c')]=isNaN(_0x729fa0[_0x1bf3('0x65')])?null:_0x729fa0[_0x1bf3('0x65')];_0x13aea8[_0x1bf3('0x6d')]=isNaN(_0x729fa0['sampleRate'])?null:_0x729fa0[_0x1bf3('0x67')];});_0xc5886a['on'](_0x1bf3('0x1a'),function(){fs['chmodSync'](_0x3fc426,parseInt(_0x1bf3('0x5c'),0x8));return db['Sound'][_0x1bf3('0x6e')](_0x13aea8)[_0x1bf3('0x25')](function(_0x3a5c84){var _0x250d74={'role':_0x569704[_0x1bf3('0x6f')][_0x1bf3('0x70')],'userProfileId':_0x569704['body'][_0x1bf3('0x71')]};if(!_0x250d74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x250d74['role']===_0x1bf3('0x72')){var _0x143eea=_0x3a5c84[_0x1bf3('0x73')]({'plain':!![]});return db[_0x1bf3('0x74')][_0x1bf3('0x44')]({'where':{'name':_0x1bf3('0x24'),'userProfileId':_0x250d74[_0x1bf3('0x71')]},'raw':!![]})[_0x1bf3('0x25')](function(_0x4602f4){if(_0x4602f4&&_0x4602f4['autoAssociation']===0x0){return db[_0x1bf3('0x75')]['create']({'name':_0x143eea[_0x1bf3('0x28')],'resourceId':_0x143eea['id'],'type':_0x4602f4[_0x1bf3('0x28')],'sectionId':_0x4602f4['id']},{})[_0x1bf3('0x25')](function(){return _0x3a5c84;});}else{return _0x3a5c84;}})['catch'](function(_0x3e5da4){logger[_0x1bf3('0x26')](_0x1bf3('0x76'),_0x3e5da4);throw _0x3e5da4;});}return _0x3a5c84;})[_0x1bf3('0x25')](respondWithResult(_0x3d8017,null))[_0x1bf3('0x45')](handleError(_0x3d8017,null));});_0xc5886a[_0x1bf3('0x77')]();}catch(_0x5cc56c){_0x3d8017[_0x1bf3('0x19')](0x1f4)[_0x1bf3('0x78')](_0x5cc56c);}};exports['update']=function(_0x7ecc5f,_0x1c2413,_0x2e0966){return db['Sound'][_0x1bf3('0x44')]({'where':{'id':_0x7ecc5f[_0x1bf3('0x41')]['id']}})[_0x1bf3('0x25')](handleEntityNotFound(_0x1c2413,null))['then'](saveUpdates(_['pick'](_0x7ecc5f[_0x1bf3('0x6f')],[_0x1bf3('0x28'),_0x1bf3('0x79')]),null))[_0x1bf3('0x25')](respondWithResult(_0x1c2413,null))[_0x1bf3('0x45')](handleError(_0x1c2413,null));};exports[_0x1bf3('0x7a')]=function(_0x48e8b5,_0x2de094,_0x565296){return db[_0x1bf3('0x2a')][_0x1bf3('0x44')]({'where':{'id':_0x48e8b5[_0x1bf3('0x41')]['id']}})[_0x1bf3('0x25')](function(_0x1cf5b7){if(_0x1cf5b7){return _0x1cf5b7[_0x1bf3('0x23')]();}})[_0x1bf3('0x25')](function(_0x5811d5){var _0x34d1e5=path[_0x1bf3('0x4d')](config[_0x1bf3('0x4a')],'server/files/sounds/original',util[_0x1bf3('0x4f')]('%s.%s',_0x5811d5['save_name'],_0x5811d5[_0x1bf3('0x7b')]));var _0x588659=path[_0x1bf3('0x4d')](config[_0x1bf3('0x4a')],_0x1bf3('0x4e'),util['format']('%s.%s',_0x5811d5[_0x1bf3('0x47')],_0x5811d5[_0x1bf3('0x48')]));fs[_0x1bf3('0x5e')](_0x34d1e5);fs[_0x1bf3('0x5e')](_0x588659);return _0x5811d5;})['then'](function(_0xf9f692){if(_0xf9f692){return _0x2de094[_0x1bf3('0x19')](0xcc)[_0x1bf3('0x1a')]();}})[_0x1bf3('0x25')](handleEntityNotFound(_0x2de094,null))['catch'](handleError(_0x2de094,null));}; \ No newline at end of file +var _0x24b8=['body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','Sound','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','download','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','0777'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x24b8,0x112));var _0x824b=function(_0x3e7844,_0x2c04ae){_0x3e7844=_0x3e7844-0x0;var _0x46ec0a=_0x24b8[_0x3e7844];return _0x46ec0a;};'use strict';var emlformat=require(_0x824b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x824b('0x1'));var jsonpatch=require(_0x824b('0x2'));var rp=require(_0x824b('0x3'));var moment=require(_0x824b('0x4'));var BPromise=require(_0x824b('0x5'));var Mustache=require(_0x824b('0x6'));var util=require(_0x824b('0x7'));var path=require(_0x824b('0x8'));var sox=require(_0x824b('0x9'));var csv=require(_0x824b('0xa'));var ejs=require(_0x824b('0xb'));var fs=require('fs');var fs_extra=require(_0x824b('0xc'));var _=require(_0x824b('0xd'));var squel=require(_0x824b('0xe'));var crypto=require(_0x824b('0xf'));var jsforce=require(_0x824b('0x10'));var deskjs=require(_0x824b('0x11'));var toCsv=require(_0x824b('0xa'));var querystring=require(_0x824b('0x12'));var Papa=require(_0x824b('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x824b('0x14'));var as=require(_0x824b('0x15'));var hardwareService=require(_0x824b('0x16'));var logger=require('../../config/logger')(_0x824b('0x17'));var utils=require(_0x824b('0x18'));var config=require(_0x824b('0x19'));var licenseUtil=require(_0x824b('0x1a'));var db=require(_0x824b('0x1b'))['db'];function respondWithStatusCode(_0x3f5808,_0x41ba32){_0x41ba32=_0x41ba32||0xcc;return function(_0x507d8d){if(_0x507d8d){return _0x3f5808['sendStatus'](_0x41ba32);}return _0x3f5808[_0x824b('0x1c')](_0x41ba32)[_0x824b('0x1d')]();};}function respondWithResult(_0x3d6839,_0x22f3b7){_0x22f3b7=_0x22f3b7||0xc8;return function(_0x38f26a){if(_0x38f26a){return _0x3d6839['status'](_0x22f3b7)[_0x824b('0x1e')](_0x38f26a);}};}function respondWithFilteredResult(_0x5f441c,_0x42f4b1){return function(_0x1757a6){if(_0x1757a6){var _0xff7fbc=typeof _0x42f4b1[_0x824b('0x1f')]==='undefined'&&typeof _0x42f4b1[_0x824b('0x20')]===_0x824b('0x21');var _0x382406=_0x1757a6[_0x824b('0x22')];var _0x47b124=_0xff7fbc?0x0:_0x42f4b1[_0x824b('0x1f')];var _0x17a41b=_0xff7fbc?_0x1757a6[_0x824b('0x22')]:_0x42f4b1[_0x824b('0x1f')]+_0x42f4b1[_0x824b('0x20')];var _0x16940b;if(_0x17a41b>=_0x382406){_0x17a41b=_0x382406;_0x16940b=0xc8;}else{_0x16940b=0xce;}_0x5f441c[_0x824b('0x1c')](_0x16940b);return _0x5f441c[_0x824b('0x23')](_0x824b('0x24'),_0x47b124+'-'+_0x17a41b+'/'+_0x382406)[_0x824b('0x1e')](_0x1757a6);}return null;};}function patchUpdates(_0x19c62f){return function(_0x38ed50){try{jsonpatch[_0x824b('0x25')](_0x38ed50,_0x19c62f,!![]);}catch(_0x5f4340){return BPromise[_0x824b('0x26')](_0x5f4340);}return _0x38ed50['save']();};}function saveUpdates(_0xaf637b,_0x2a140b){return function(_0x1b99a7){if(_0x1b99a7){return _0x1b99a7[_0x824b('0x27')](_0xaf637b)[_0x824b('0x28')](function(_0x314f18){return _0x314f18;});}return null;};}function removeEntity(_0x1aca94,_0x44cdc9){return function(_0x5943db){if(_0x5943db){return _0x5943db[_0x824b('0x29')]()['then'](function(){var _0x18a7fb=_0x5943db['get']({'plain':!![]});var _0x3f6bf4=_0x824b('0x2a');return db[_0x824b('0x2b')][_0x824b('0x29')]({'where':{'type':_0x3f6bf4,'resourceId':_0x18a7fb['id']}})[_0x824b('0x28')](function(){return _0x5943db;});})[_0x824b('0x28')](function(){_0x1aca94[_0x824b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x485d80,_0x284401){return function(_0x16f9e6){if(!_0x16f9e6){_0x485d80['sendStatus'](0x194);}return _0x16f9e6;};}function handleError(_0x46eda9,_0x52359f){_0x52359f=_0x52359f||0x1f4;return function(_0x382e83){logger[_0x824b('0x2c')](_0x382e83[_0x824b('0x2d')]);if(_0x382e83['name']){delete _0x382e83[_0x824b('0x2e')];}_0x46eda9[_0x824b('0x1c')](_0x52359f)[_0x824b('0x2f')](_0x382e83);};}exports[_0x824b('0x30')]=function(_0x501188,_0x42f899){var _0x2255e8={},_0x5c20a5={},_0x3fc2ec={'count':0x0,'rows':[]};var _0x2e3feb=_['map'](db[_0x824b('0x31')]['rawAttributes'],function(_0x21075d){return{'name':_0x21075d[_0x824b('0x32')],'type':_0x21075d['type'][_0x824b('0x33')]};});_0x5c20a5[_0x824b('0x34')]=_['map'](_0x2e3feb,_0x824b('0x2e'));_0x5c20a5[_0x824b('0x35')]=_[_0x824b('0x36')](_0x501188[_0x824b('0x35')]);_0x5c20a5[_0x824b('0x37')]=_[_0x824b('0x38')](_0x5c20a5['model'],_0x5c20a5[_0x824b('0x35')]);_0x2255e8[_0x824b('0x39')]=_['intersection'](_0x5c20a5['model'],qs[_0x824b('0x3a')](_0x501188[_0x824b('0x35')][_0x824b('0x3a')]));_0x2255e8[_0x824b('0x39')]=_0x2255e8[_0x824b('0x39')][_0x824b('0x3b')]?_0x2255e8[_0x824b('0x39')]:_0x5c20a5[_0x824b('0x34')];if(!_0x501188[_0x824b('0x35')]['hasOwnProperty'](_0x824b('0x3c'))){_0x2255e8[_0x824b('0x20')]=qs[_0x824b('0x20')](_0x501188[_0x824b('0x35')][_0x824b('0x20')]);_0x2255e8[_0x824b('0x1f')]=qs[_0x824b('0x1f')](_0x501188[_0x824b('0x35')][_0x824b('0x1f')]);}_0x2255e8['order']=qs[_0x824b('0x3d')](_0x501188[_0x824b('0x35')][_0x824b('0x3d')]);_0x2255e8[_0x824b('0x3e')]=qs[_0x824b('0x37')](_[_0x824b('0x3f')](_0x501188[_0x824b('0x35')],_0x5c20a5[_0x824b('0x37')]),_0x2e3feb);if(_0x501188[_0x824b('0x35')][_0x824b('0x40')]){_0x2255e8[_0x824b('0x3e')]=_[_0x824b('0x41')](_0x2255e8['where'],{'$or':_[_0x824b('0x42')](_0x2e3feb,function(_0x7b4b6f){if(_0x7b4b6f[_0x824b('0x43')]!==_0x824b('0x44')){var _0x4d6ed5={};_0x4d6ed5[_0x7b4b6f[_0x824b('0x2e')]]={'$like':'%'+_0x501188[_0x824b('0x35')][_0x824b('0x40')]+'%'};return _0x4d6ed5;}})});}_0x2255e8=_[_0x824b('0x41')]({},_0x2255e8,_0x501188[_0x824b('0x45')]);var _0x20f148={'where':_0x2255e8[_0x824b('0x3e')]};return db[_0x824b('0x31')]['count'](_0x20f148)['then'](function(_0x227f9c){_0x3fc2ec['count']=_0x227f9c;if(_0x501188[_0x824b('0x35')]['includeAll']){_0x2255e8[_0x824b('0x46')]=[{'all':!![]}];}return db[_0x824b('0x31')][_0x824b('0x47')](_0x2255e8);})[_0x824b('0x28')](function(_0x296e8a){_0x3fc2ec[_0x824b('0x48')]=_0x296e8a;return _0x3fc2ec;})[_0x824b('0x28')](respondWithFilteredResult(_0x42f899,_0x2255e8))[_0x824b('0x49')](handleError(_0x42f899,null));};exports[_0x824b('0x4a')]=function(_0x2fc8b7,_0x125fb3){var _0x33965b={'raw':!![],'where':{'id':_0x2fc8b7['params']['id']}},_0x271a42={};_0x271a42[_0x824b('0x34')]=_[_0x824b('0x36')](db[_0x824b('0x31')]['rawAttributes']);_0x271a42[_0x824b('0x35')]=_['keys'](_0x2fc8b7[_0x824b('0x35')]);_0x271a42['filters']=_['intersection'](_0x271a42[_0x824b('0x34')],_0x271a42[_0x824b('0x35')]);_0x33965b['attributes']=_[_0x824b('0x38')](_0x271a42[_0x824b('0x34')],qs[_0x824b('0x3a')](_0x2fc8b7[_0x824b('0x35')][_0x824b('0x3a')]));_0x33965b[_0x824b('0x39')]=_0x33965b[_0x824b('0x39')]['length']?_0x33965b[_0x824b('0x39')]:_0x271a42[_0x824b('0x34')];if(_0x2fc8b7[_0x824b('0x35')][_0x824b('0x4b')]){_0x33965b[_0x824b('0x46')]=[{'all':!![]}];}_0x33965b=_[_0x824b('0x41')]({},_0x33965b,_0x2fc8b7[_0x824b('0x45')]);return db[_0x824b('0x31')][_0x824b('0x4c')](_0x33965b)[_0x824b('0x28')](handleEntityNotFound(_0x125fb3,null))[_0x824b('0x28')](respondWithResult(_0x125fb3,null))[_0x824b('0x49')](handleError(_0x125fb3,null));};exports[_0x824b('0x4d')]=function(_0x25f059,_0x2a97a3,_0x346259){return db[_0x824b('0x31')]['find']({'where':{'id':_0x25f059[_0x824b('0x4e')]['id']},'attributes':['name',_0x824b('0x4f'),_0x824b('0x50')],'raw':!![]})[_0x824b('0x28')](handleEntityNotFound(_0x2a97a3,null))[_0x824b('0x28')](function(_0x3b9fc2){if(_0x3b9fc2){if(!fs[_0x824b('0x51')](path[_0x824b('0x52')](config['root'],_0x824b('0x53'),_0x3b9fc2[_0x824b('0x4f')]+'.'+_0x3b9fc2[_0x824b('0x50')]))){throw new db[(_0x824b('0x54'))][(_0x824b('0x55'))](_0x824b('0x56'));}return _0x2a97a3[_0x824b('0x4d')](path['join'](config[_0x824b('0x57')],'server/files/sounds/converted',util[_0x824b('0x58')](_0x824b('0x59'),_0x3b9fc2[_0x824b('0x4f')],_0x3b9fc2[_0x824b('0x50')])),util[_0x824b('0x58')](_0x824b('0x59'),_0x3b9fc2[_0x824b('0x2e')],_0x3b9fc2['converted_format']));}return null;})['catch'](handleError(_0x2a97a3,null));};exports[_0x824b('0x5a')]=function(_0x2092f4,_0x582131,_0xb53052){var _0x1828b5={'name':path[_0x824b('0x5b')](_0x2092f4[_0x824b('0x5c')][_0x824b('0x5d')],path[_0x824b('0x5e')](_0x2092f4['file'][_0x824b('0x5d')])),'save_name':path[_0x824b('0x5b')](_0x2092f4[_0x824b('0x5c')][_0x824b('0x5f')],path[_0x824b('0x5e')](_0x2092f4[_0x824b('0x5c')]['filename'])),'original_format':path[_0x824b('0x5e')](_0x2092f4[_0x824b('0x5c')]['originalname'])[_0x824b('0x60')](0x1),'converted_format':'wav'};var _0x471017=path[_0x824b('0x52')](config[_0x824b('0x57')],_0x824b('0x61'),_0x2092f4[_0x824b('0x5c')][_0x824b('0x5f')]);var _0x28d0e2=path['join'](config[_0x824b('0x57')],_0x824b('0x53'),util[_0x824b('0x58')](_0x824b('0x59'),path[_0x824b('0x5b')](_0x2092f4[_0x824b('0x5c')][_0x824b('0x5f')],path[_0x824b('0x5e')](_0x2092f4['file'][_0x824b('0x5f')])),_0x1828b5[_0x824b('0x50')]));logger[_0x824b('0x62')](_0x824b('0x63'),_0x471017);logger['info'](_0x824b('0x64'),_0x28d0e2);try{fs[_0x824b('0x65')](_0x471017,parseInt('0777',0x8));var _0x53c293=sox[_0x824b('0x66')](_0x471017,_0x28d0e2,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53c293['on'](_0x824b('0x2c'),function(_0x494d2a){fs[_0x824b('0x67')](_0x471017);_0x582131['status'](0x1f4)[_0x824b('0x2f')](_0x494d2a);});_0x53c293['on'](_0x824b('0x68'),function(_0x3ed6fa){_0x1828b5[_0x824b('0x69')]=isNaN(_0x3ed6fa[_0x824b('0x6a')])?null:_0x3ed6fa['duration']*0x3e8;_0x1828b5[_0x824b('0x6b')]=isNaN(_0x3ed6fa[_0x824b('0x6c')])?null:_0x3ed6fa[_0x824b('0x6c')];_0x1828b5[_0x824b('0x6d')]=isNaN(_0x3ed6fa[_0x824b('0x6e')])?null:_0x3ed6fa['channelCount'];_0x1828b5[_0x824b('0x6f')]=isNaN(_0x3ed6fa[_0x824b('0x70')])?null:_0x3ed6fa[_0x824b('0x70')];_0x1828b5['original_sampleRate']=isNaN(_0x3ed6fa[_0x824b('0x71')])?null:_0x3ed6fa[_0x824b('0x71')];});_0x53c293['on']('dest',function(_0x5ea6a8){_0x1828b5[_0x824b('0x72')]=isNaN(_0x5ea6a8['duration'])?null:_0x5ea6a8['duration']*0x3e8;_0x1828b5[_0x824b('0x73')]=isNaN(_0x5ea6a8['sampleCount'])?null:_0x5ea6a8[_0x824b('0x6c')];_0x1828b5[_0x824b('0x74')]=isNaN(_0x5ea6a8[_0x824b('0x6e')])?null:_0x5ea6a8[_0x824b('0x6e')];_0x1828b5['converted_bitRate']=isNaN(_0x5ea6a8['bitRate'])?null:_0x5ea6a8[_0x824b('0x70')];_0x1828b5[_0x824b('0x75')]=isNaN(_0x5ea6a8[_0x824b('0x71')])?null:_0x5ea6a8[_0x824b('0x71')];});_0x53c293['on'](_0x824b('0x1d'),function(){fs[_0x824b('0x65')](_0x28d0e2,parseInt(_0x824b('0x76'),0x8));return db[_0x824b('0x31')]['create'](_0x1828b5)[_0x824b('0x28')](function(_0x2d0634){var _0x2519d0={'role':_0x2092f4[_0x824b('0x77')][_0x824b('0x78')],'userProfileId':_0x2092f4[_0x824b('0x77')][_0x824b('0x79')]};if(!_0x2519d0)throw new Error(_0x824b('0x7a'));if(_0x2519d0[_0x824b('0x78')]===_0x824b('0x7b')){var _0x3fd38f=_0x2d0634[_0x824b('0x7c')]({'plain':!![]});return db['UserProfileSection'][_0x824b('0x4c')]({'where':{'name':_0x824b('0x2a'),'userProfileId':_0x2519d0[_0x824b('0x79')]},'raw':!![]})[_0x824b('0x28')](function(_0x302a23){if(_0x302a23&&_0x302a23[_0x824b('0x7d')]===0x0){return db[_0x824b('0x2b')][_0x824b('0x5a')]({'name':_0x3fd38f[_0x824b('0x2e')],'resourceId':_0x3fd38f['id'],'type':_0x302a23[_0x824b('0x2e')],'sectionId':_0x302a23['id']},{})['then'](function(){return _0x2d0634;});}else{return _0x2d0634;}})[_0x824b('0x49')](function(_0x3a5297){logger[_0x824b('0x2c')](_0x824b('0x7e'),_0x3a5297);throw _0x3a5297;});}return _0x2d0634;})[_0x824b('0x28')](respondWithResult(_0x582131,null))[_0x824b('0x49')](handleError(_0x582131,null));});_0x53c293[_0x824b('0x7f')]();}catch(_0x3af43a){_0x582131[_0x824b('0x1c')](0x1f4)[_0x824b('0x2f')](_0x3af43a);}};exports[_0x824b('0x27')]=function(_0xea867f,_0x3e231e,_0x74482e){return db[_0x824b('0x31')][_0x824b('0x4c')]({'where':{'id':_0xea867f[_0x824b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e231e,null))[_0x824b('0x28')](saveUpdates(_[_0x824b('0x3f')](_0xea867f['body'],['name',_0x824b('0x80')]),null))['then'](respondWithResult(_0x3e231e,null))[_0x824b('0x49')](handleError(_0x3e231e,null));};exports[_0x824b('0x81')]=function(_0x43ff5a,_0x413743,_0x2e29f6){return db['Sound'][_0x824b('0x4c')]({'where':{'id':_0x43ff5a[_0x824b('0x4e')]['id']}})[_0x824b('0x28')](function(_0x31a788){if(_0x31a788){return _0x31a788['destroy']();}})['then'](function(_0x74781c){var _0x1f62dd=path[_0x824b('0x52')](config['root'],_0x824b('0x61'),util[_0x824b('0x58')](_0x824b('0x59'),_0x74781c[_0x824b('0x4f')],_0x74781c[_0x824b('0x82')]));var _0x5ef1f8=path[_0x824b('0x52')](config[_0x824b('0x57')],_0x824b('0x53'),util[_0x824b('0x58')](_0x824b('0x59'),_0x74781c[_0x824b('0x4f')],_0x74781c[_0x824b('0x50')]));fs['unlinkSync'](_0x1f62dd);fs[_0x824b('0x67')](_0x5ef1f8);return _0x74781c;})[_0x824b('0x28')](function(_0x257861){if(_0x257861){return _0x413743[_0x824b('0x1c')](0xcc)[_0x824b('0x1d')]();}})[_0x824b('0x28')](handleEntityNotFound(_0x413743,null))[_0x824b('0x49')](handleError(_0x413743,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f06a950..5b9e7f6 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 _0x3bcd=['../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','api','bluebird','request-promise','path'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x3bcd,0x192));var _0xd3bc=function(_0x287234,_0x4b9e28){_0x287234=_0x287234-0x0;var _0x4bfc27=_0x3bcd[_0x287234];return _0x4bfc27;};'use strict';var _=require(_0xd3bc('0x0'));var util=require(_0xd3bc('0x1'));var logger=require('../../config/logger')(_0xd3bc('0x2'));var moment=require('moment');var BPromise=require(_0xd3bc('0x3'));var rp=require(_0xd3bc('0x4'));var fs=require('fs');var path=require(_0xd3bc('0x5'));var rimraf=require('rimraf');var config=require(_0xd3bc('0x6'));var attributes=require(_0xd3bc('0x7'));module[_0xd3bc('0x8')]=function(_0x19c1b7,_0x4e0e0b){return _0x19c1b7[_0xd3bc('0x9')](_0xd3bc('0xa'),attributes,{'tableName':_0xd3bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8920=['request-promise','path','../../config/environment','./sound.attributes','Sound','tools_sounds','../../config/logger','api','moment'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x8920,0xc3));var _0x0892=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8920[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0892('0x0'))(_0x0892('0x1'));var moment=require(_0x0892('0x2'));var BPromise=require('bluebird');var rp=require(_0x0892('0x3'));var fs=require('fs');var path=require(_0x0892('0x4'));var rimraf=require('rimraf');var config=require(_0x0892('0x5'));var attributes=require(_0x0892('0x6'));module['exports']=function(_0x2268d8,_0x404bef){return _0x2268d8['define'](_0x0892('0x7'),attributes,{'tableName':_0x0892('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 990a8e4..6d40199 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 _0x300d=['debug','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','ShowSound','Sound','options','raw','attributes','include','map','model'];(function(_0x2dce24,_0x56c113){var _0x45f466=function(_0x146bb6){while(--_0x146bb6){_0x2dce24['push'](_0x2dce24['shift']());}};_0x45f466(++_0x56c113);}(_0x300d,0x65));var _0xd300=function(_0x260395,_0x292523){_0x260395=_0x260395-0x0;var _0x5723b8=_0x300d[_0x260395];return _0x5723b8;};'use strict';var _=require(_0xd300('0x0'));var util=require(_0xd300('0x1'));var moment=require(_0xd300('0x2'));var BPromise=require(_0xd300('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd300('0x4'))['db'];var utils=require(_0xd300('0x5'));var logger=require(_0xd300('0x6'))(_0xd300('0x7'));var config=require(_0xd300('0x8'));var jayson=require(_0xd300('0x9'));var client=jayson[_0xd300('0xa')][_0xd300('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cf8fd,_0xef59e0,_0x19a4da){return new BPromise(function(_0x4f69c,_0x5da170){return client[_0xd300('0xc')](_0x5cf8fd,_0x19a4da)[_0xd300('0xd')](function(_0x21124d){logger[_0xd300('0xe')](_0xd300('0xf'),_0xef59e0,'request\x20sent');logger['debug'](_0xd300('0x10'),_0xef59e0,'request\x20sent',JSON[_0xd300('0x11')](_0x21124d));if(_0x21124d[_0xd300('0x12')]){if(_0x21124d[_0xd300('0x12')][_0xd300('0x13')]===0x1f4){logger[_0xd300('0x12')](_0xd300('0xf'),_0xef59e0,_0x21124d[_0xd300('0x12')][_0xd300('0x14')]);return _0x5da170(_0x21124d['error'][_0xd300('0x14')]);}logger['error'](_0xd300('0xf'),_0xef59e0,_0x21124d[_0xd300('0x12')]['message']);return _0x4f69c(_0x21124d[_0xd300('0x12')][_0xd300('0x14')]);}else{logger[_0xd300('0xe')]('Sound,\x20%s,\x20%s',_0xef59e0,_0xd300('0x15'));_0x4f69c(_0x21124d[_0xd300('0x16')][_0xd300('0x14')]);}})['catch'](function(_0xdc70b){logger[_0xd300('0x12')](_0xd300('0xf'),_0xef59e0,_0xdc70b);_0x5da170(_0xdc70b);});});}exports[_0xd300('0x17')]=function(_0x1230af){var _0x120f37=this;return new Promise(function(_0x4afc64,_0x504bc2){return db[_0xd300('0x18')]['find']({'raw':_0x1230af[_0xd300('0x19')]?_0x1230af['options'][_0xd300('0x1a')]===undefined?!![]:![]:!![],'where':_0x1230af[_0xd300('0x19')]?_0x1230af[_0xd300('0x19')]['where']||null:null,'attributes':_0x1230af[_0xd300('0x19')]?_0x1230af[_0xd300('0x19')][_0xd300('0x1b')]||null:null,'include':_0x1230af[_0xd300('0x19')]?_0x1230af['options'][_0xd300('0x1c')]?_[_0xd300('0x1d')](_0x1230af['options'][_0xd300('0x1c')],function(_0x37e0f4){return{'model':db[_0x37e0f4[_0xd300('0x1e')]],'as':_0x37e0f4['as'],'attributes':_0x37e0f4[_0xd300('0x1b')],'include':_0x37e0f4[_0xd300('0x1c')]?_[_0xd300('0x1d')](_0x37e0f4[_0xd300('0x1c')],function(_0x3bc8ec){return{'model':db[_0x3bc8ec[_0xd300('0x1e')]],'as':_0x3bc8ec['as'],'attributes':_0x3bc8ec[_0xd300('0x1b')],'include':_0x3bc8ec[_0xd300('0x1c')]?_['map'](_0x3bc8ec[_0xd300('0x1c')],function(_0x32b89d){return{'model':db[_0x32b89d[_0xd300('0x1e')]],'as':_0x32b89d['as'],'attributes':_0x32b89d[_0xd300('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd300('0xd')](function(_0x4f94d2){logger[_0xd300('0xe')](_0xd300('0x17'),_0x1230af);logger[_0xd300('0x1f')](_0xd300('0x17'),_0x1230af,JSON[_0xd300('0x11')](_0x4f94d2));_0x4afc64(_0x4f94d2);})[_0xd300('0x20')](function(_0x9a5840){logger[_0xd300('0x12')](_0xd300('0x17'),_0x9a5840['message'],_0x1230af);_0x504bc2(_0x120f37[_0xd300('0x12')](0x1f4,_0x9a5840[_0xd300('0x14')]));});});}; \ No newline at end of file +var _0x6964=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','ShowSound','find','options','where','attributes','include','model','map','info','catch','util'];(function(_0x439fa6,_0x573272){var _0x3d0b75=function(_0x2f38b6){while(--_0x2f38b6){_0x439fa6['push'](_0x439fa6['shift']());}};_0x3d0b75(++_0x573272);}(_0x6964,0xd1));var _0x4696=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x6964[_0x3b2244];return _0x2dcc14;};'use strict';var _=require('lodash');var util=require(_0x4696('0x0'));var moment=require(_0x4696('0x1'));var BPromise=require(_0x4696('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4696('0x3'));var db=require(_0x4696('0x4'))['db'];var utils=require(_0x4696('0x5'));var logger=require(_0x4696('0x6'))(_0x4696('0x7'));var config=require(_0x4696('0x8'));var jayson=require(_0x4696('0x9'));var client=jayson['client'][_0x4696('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b4cd6,_0x2bfcd1,_0xcd92d1){return new BPromise(function(_0xf1033d,_0xa1a037){return client[_0x4696('0xb')](_0x4b4cd6,_0xcd92d1)[_0x4696('0xc')](function(_0x318c8f){logger['info'](_0x4696('0xd'),_0x2bfcd1,_0x4696('0xe'));logger[_0x4696('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x2bfcd1,_0x4696('0xe'),JSON[_0x4696('0x10')](_0x318c8f));if(_0x318c8f[_0x4696('0x11')]){if(_0x318c8f[_0x4696('0x11')]['code']===0x1f4){logger[_0x4696('0x11')]('Sound,\x20%s,\x20%s',_0x2bfcd1,_0x318c8f[_0x4696('0x11')]['message']);return _0xa1a037(_0x318c8f[_0x4696('0x11')][_0x4696('0x12')]);}logger[_0x4696('0x11')](_0x4696('0xd'),_0x2bfcd1,_0x318c8f[_0x4696('0x11')][_0x4696('0x12')]);return _0xf1033d(_0x318c8f[_0x4696('0x11')][_0x4696('0x12')]);}else{logger['info'](_0x4696('0xd'),_0x2bfcd1,_0x4696('0xe'));_0xf1033d(_0x318c8f[_0x4696('0x13')]['message']);}})['catch'](function(_0x7ed5b3){logger[_0x4696('0x11')](_0x4696('0xd'),_0x2bfcd1,_0x7ed5b3);_0xa1a037(_0x7ed5b3);});});}exports[_0x4696('0x14')]=function(_0x570182){var _0x7cf498=this;return new Promise(function(_0x4c22ae,_0x3f561c){return db['Sound'][_0x4696('0x15')]({'raw':_0x570182[_0x4696('0x16')]?_0x570182['options']['raw']===undefined?!![]:![]:!![],'where':_0x570182['options']?_0x570182[_0x4696('0x16')][_0x4696('0x17')]||null:null,'attributes':_0x570182[_0x4696('0x16')]?_0x570182[_0x4696('0x16')][_0x4696('0x18')]||null:null,'include':_0x570182[_0x4696('0x16')]?_0x570182[_0x4696('0x16')][_0x4696('0x19')]?_['map'](_0x570182['options'][_0x4696('0x19')],function(_0xd976ce){return{'model':db[_0xd976ce['model']],'as':_0xd976ce['as'],'attributes':_0xd976ce[_0x4696('0x18')],'include':_0xd976ce[_0x4696('0x19')]?_['map'](_0xd976ce[_0x4696('0x19')],function(_0x1c54ab){return{'model':db[_0x1c54ab[_0x4696('0x1a')]],'as':_0x1c54ab['as'],'attributes':_0x1c54ab[_0x4696('0x18')],'include':_0x1c54ab['include']?_[_0x4696('0x1b')](_0x1c54ab[_0x4696('0x19')],function(_0x464c45){return{'model':db[_0x464c45[_0x4696('0x1a')]],'as':_0x464c45['as'],'attributes':_0x464c45['attributes']};}):[]};}):[]};}):[]:[]})[_0x4696('0xc')](function(_0x3e2f83){logger[_0x4696('0x1c')](_0x4696('0x14'),_0x570182);logger[_0x4696('0xf')](_0x4696('0x14'),_0x570182,JSON[_0x4696('0x10')](_0x3e2f83));_0x4c22ae(_0x3e2f83);})[_0x4696('0x1d')](function(_0x36aff5){logger[_0x4696('0x11')](_0x4696('0x14'),_0x36aff5[_0x4696('0x12')],_0x570182);_0x3f561c(_0x7cf498[_0x4696('0x11')](0x1f4,_0x36aff5[_0x4696('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 344bf2d..33c0c1c 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(_0x113a7e,_0x161e82){var _0x44f32c=function(_0x4f1b30){while(--_0x4f1b30){_0x113a7e['push'](_0x113a7e['shift']());}};_0x44f32c(++_0x161e82);}(_0xb10b,0x12a));var _0xbb10=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xb10b[_0x422905];return _0x33dc6c;};'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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x6595a7,_0x1be709){var _0x22bb82=function(_0x1219e0){while(--_0x1219e0){_0x6595a7['push'](_0x6595a7['shift']());}};_0x22bb82(++_0x1be709);}(_0x2032,0xd9));var _0x2203=function(_0x54e7fd,_0x3ab212){_0x54e7fd=_0x54e7fd-0x0;var _0x2b587a=_0x2032[_0x54e7fd];return _0x2b587a;};'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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('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 351190f..21cb847 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 _0xc45e=['STRING','TEXT','out'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xc45e,0x93));var _0xec45=function(_0x9154ee,_0x5f2a85){_0x9154ee=_0x9154ee-0x0;var _0x24c414=_0xc45e[_0x9154ee];return _0x24c414;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xec45('0x0')]},'body':{'type':Sequelize[_0xec45('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xec45('0x2')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xec45('0x1')]}}; \ No newline at end of file +var _0xf3c5=['TEXT','ENUM','out','sequelize','STRING'];(function(_0x1f3591,_0x1270e9){var _0x3ffcd8=function(_0x1898ac){while(--_0x1898ac){_0x1f3591['push'](_0x1f3591['shift']());}};_0x3ffcd8(++_0x1270e9);}(_0xf3c5,0x10c));var _0x5f3c=function(_0x503a0c,_0xbc78c5){_0x503a0c=_0x503a0c-0x0;var _0x3b2e83=_0xf3c5[_0x503a0c];return _0x3b2e83;};'use strict';var Sequelize=require(_0x5f3c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5f3c('0x1')]},'body':{'type':Sequelize[_0x5f3c('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x5f3c('0x3')]('in',_0x5f3c('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x5f3c('0x1')]},'providerResponse':{'type':Sequelize[_0x5f3c('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 51c742a..df3de05 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 _0xf99a=['filter','options','where','catch','show','keys','includeAll','include','create','body','destroy','find','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','SquareMessage','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','merge','VIRTUAL'];(function(_0x30c63a,_0x218845){var _0x1f4e05=function(_0x3de015){while(--_0x3de015){_0x30c63a['push'](_0x30c63a['shift']());}};_0x1f4e05(++_0x218845);}(_0xf99a,0x166));var _0xaf99=function(_0x26a655,_0x466715){_0x26a655=_0x26a655-0x0;var _0x40e27e=_0xf99a[_0x26a655];return _0x40e27e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf99('0x0'));var jsonpatch=require(_0xaf99('0x1'));var rp=require('request-promise');var moment=require(_0xaf99('0x2'));var BPromise=require(_0xaf99('0x3'));var Mustache=require(_0xaf99('0x4'));var util=require(_0xaf99('0x5'));var path=require(_0xaf99('0x6'));var sox=require('sox');var csv=require(_0xaf99('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf99('0x8'));var _=require(_0xaf99('0x9'));var squel=require(_0xaf99('0xa'));var crypto=require(_0xaf99('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaf99('0xc'));var toCsv=require(_0xaf99('0x7'));var querystring=require(_0xaf99('0xd'));var Papa=require(_0xaf99('0xe'));var Redis=require('ioredis');var authService=require(_0xaf99('0xf'));var qs=require(_0xaf99('0x10'));var as=require(_0xaf99('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaf99('0x12'));var utils=require(_0xaf99('0x13'));var config=require(_0xaf99('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf99('0x15'))['db'];function respondWithStatusCode(_0x3edd06,_0x1eebaa){_0x1eebaa=_0x1eebaa||0xcc;return function(_0x511d1b){if(_0x511d1b){return _0x3edd06[_0xaf99('0x16')](_0x1eebaa);}return _0x3edd06[_0xaf99('0x17')](_0x1eebaa)[_0xaf99('0x18')]();};}function respondWithResult(_0x26ed70,_0x31280d){_0x31280d=_0x31280d||0xc8;return function(_0x154b00){if(_0x154b00){return _0x26ed70[_0xaf99('0x17')](_0x31280d)['json'](_0x154b00);}};}function respondWithFilteredResult(_0x531bb8,_0x5c23ab){return function(_0x39cfd8){if(_0x39cfd8){var _0x2b9171=typeof _0x5c23ab[_0xaf99('0x19')]===_0xaf99('0x1a')&&typeof _0x5c23ab['limit']===_0xaf99('0x1a');var _0x1fe34a=_0x39cfd8[_0xaf99('0x1b')];var _0x1a1e71=_0x2b9171?0x0:_0x5c23ab[_0xaf99('0x19')];var _0x1b34a4=_0x2b9171?_0x39cfd8[_0xaf99('0x1b')]:_0x5c23ab[_0xaf99('0x19')]+_0x5c23ab[_0xaf99('0x1c')];var _0x579812;if(_0x1b34a4>=_0x1fe34a){_0x1b34a4=_0x1fe34a;_0x579812=0xc8;}else{_0x579812=0xce;}_0x531bb8[_0xaf99('0x17')](_0x579812);return _0x531bb8[_0xaf99('0x1d')](_0xaf99('0x1e'),_0x1a1e71+'-'+_0x1b34a4+'/'+_0x1fe34a)[_0xaf99('0x1f')](_0x39cfd8);}return null;};}function patchUpdates(_0x36cfda){return function(_0xc8cf7d){try{jsonpatch[_0xaf99('0x20')](_0xc8cf7d,_0x36cfda,!![]);}catch(_0x51a183){return BPromise[_0xaf99('0x21')](_0x51a183);}return _0xc8cf7d[_0xaf99('0x22')]();};}function saveUpdates(_0x4fd25b,_0x3d19e7){return function(_0x4831b2){if(_0x4831b2){return _0x4831b2[_0xaf99('0x23')](_0x4fd25b)[_0xaf99('0x24')](function(_0x8b664e){return _0x8b664e;});}return null;};}function removeEntity(_0x3f92e3,_0x247ea4){return function(_0x22c63c){if(_0x22c63c){return _0x22c63c['destroy']()[_0xaf99('0x24')](function(){_0x3f92e3[_0xaf99('0x17')](0xcc)[_0xaf99('0x18')]();});}};}function handleEntityNotFound(_0x238224,_0x32e053){return function(_0x358564){if(!_0x358564){_0x238224[_0xaf99('0x16')](0x194);}return _0x358564;};}function handleError(_0xf6fe07,_0x852cf1){_0x852cf1=_0x852cf1||0x1f4;return function(_0x205e34){logger[_0xaf99('0x25')](_0x205e34['stack']);if(_0x205e34[_0xaf99('0x26')]){delete _0x205e34['name'];}_0xf6fe07[_0xaf99('0x17')](_0x852cf1)[_0xaf99('0x27')](_0x205e34);};}exports['index']=function(_0x25c79c,_0x2112dd){var _0x57548c={},_0x4f65ee={},_0xb32560={'count':0x0,'rows':[]};var _0x34c8b7=_[_0xaf99('0x28')](db[_0xaf99('0x29')][_0xaf99('0x2a')],function(_0x39a97c){return{'name':_0x39a97c[_0xaf99('0x2b')],'type':_0x39a97c['type']['key']};});_0x4f65ee[_0xaf99('0x2c')]=_[_0xaf99('0x28')](_0x34c8b7,_0xaf99('0x26'));_0x4f65ee[_0xaf99('0x2d')]=_['keys'](_0x25c79c['query']);_0x4f65ee['filters']=_[_0xaf99('0x2e')](_0x4f65ee[_0xaf99('0x2c')],_0x4f65ee[_0xaf99('0x2d')]);_0x57548c[_0xaf99('0x2f')]=_[_0xaf99('0x2e')](_0x4f65ee[_0xaf99('0x2c')],qs[_0xaf99('0x30')](_0x25c79c[_0xaf99('0x2d')][_0xaf99('0x30')]));_0x57548c[_0xaf99('0x2f')]=_0x57548c[_0xaf99('0x2f')][_0xaf99('0x31')]?_0x57548c['attributes']:_0x4f65ee['model'];if(!_0x25c79c['query'][_0xaf99('0x32')]('nolimit')){_0x57548c[_0xaf99('0x1c')]=qs[_0xaf99('0x1c')](_0x25c79c[_0xaf99('0x2d')]['limit']);_0x57548c[_0xaf99('0x19')]=qs[_0xaf99('0x19')](_0x25c79c[_0xaf99('0x2d')]['offset']);}_0x57548c['order']=qs[_0xaf99('0x33')](_0x25c79c['query'][_0xaf99('0x33')]);_0x57548c['where']=qs[_0xaf99('0x34')](_[_0xaf99('0x35')](_0x25c79c[_0xaf99('0x2d')],_0x4f65ee[_0xaf99('0x34')]),_0x34c8b7);if(_0x25c79c[_0xaf99('0x2d')]['filter']){_0x57548c['where']=_[_0xaf99('0x36')](_0x57548c['where'],{'$or':_[_0xaf99('0x28')](_0x34c8b7,function(_0x38881d){if(_0x38881d['type']!==_0xaf99('0x37')){var _0x44f52b={};_0x44f52b[_0x38881d['name']]={'$like':'%'+_0x25c79c[_0xaf99('0x2d')][_0xaf99('0x38')]+'%'};return _0x44f52b;}})});}_0x57548c=_[_0xaf99('0x36')]({},_0x57548c,_0x25c79c[_0xaf99('0x39')]);var _0xdc6049={'where':_0x57548c[_0xaf99('0x3a')]};return db[_0xaf99('0x29')][_0xaf99('0x1b')](_0xdc6049)[_0xaf99('0x24')](function(_0x217851){_0xb32560[_0xaf99('0x1b')]=_0x217851;if(_0x25c79c['query']['includeAll']){_0x57548c['include']=[{'all':!![]}];}return db[_0xaf99('0x29')]['findAll'](_0x57548c);})[_0xaf99('0x24')](function(_0x3b2449){_0xb32560['rows']=_0x3b2449;return _0xb32560;})['then'](respondWithFilteredResult(_0x2112dd,_0x57548c))[_0xaf99('0x3b')](handleError(_0x2112dd,null));};exports[_0xaf99('0x3c')]=function(_0x599a7e,_0x7ff42b){var _0x275236={'raw':!![],'where':{'id':_0x599a7e['params']['id']}},_0xc4db59={};_0xc4db59[_0xaf99('0x2c')]=_[_0xaf99('0x3d')](db[_0xaf99('0x29')]['rawAttributes']);_0xc4db59[_0xaf99('0x2d')]=_[_0xaf99('0x3d')](_0x599a7e[_0xaf99('0x2d')]);_0xc4db59[_0xaf99('0x34')]=_[_0xaf99('0x2e')](_0xc4db59['model'],_0xc4db59[_0xaf99('0x2d')]);_0x275236['attributes']=_[_0xaf99('0x2e')](_0xc4db59[_0xaf99('0x2c')],qs['fields'](_0x599a7e['query'][_0xaf99('0x30')]));_0x275236[_0xaf99('0x2f')]=_0x275236[_0xaf99('0x2f')][_0xaf99('0x31')]?_0x275236[_0xaf99('0x2f')]:_0xc4db59[_0xaf99('0x2c')];if(_0x599a7e[_0xaf99('0x2d')][_0xaf99('0x3e')]){_0x275236[_0xaf99('0x3f')]=[{'all':!![]}];}_0x275236=_[_0xaf99('0x36')]({},_0x275236,_0x599a7e[_0xaf99('0x39')]);return db[_0xaf99('0x29')]['find'](_0x275236)[_0xaf99('0x24')](handleEntityNotFound(_0x7ff42b,null))[_0xaf99('0x24')](respondWithResult(_0x7ff42b,null))[_0xaf99('0x3b')](handleError(_0x7ff42b,null));};exports[_0xaf99('0x40')]=function(_0x56e8ce,_0x4d8bb8){return db[_0xaf99('0x29')][_0xaf99('0x40')](_0x56e8ce[_0xaf99('0x41')],{})[_0xaf99('0x24')](respondWithResult(_0x4d8bb8,0xc9))[_0xaf99('0x3b')](handleError(_0x4d8bb8,null));};exports[_0xaf99('0x23')]=function(_0x356a34,_0x16df18){if(_0x356a34[_0xaf99('0x41')]['id']){delete _0x356a34[_0xaf99('0x41')]['id'];}return db[_0xaf99('0x29')]['find']({'where':{'id':_0x356a34['params']['id']}})[_0xaf99('0x24')](handleEntityNotFound(_0x16df18,null))[_0xaf99('0x24')](saveUpdates(_0x356a34[_0xaf99('0x41')],null))[_0xaf99('0x24')](respondWithResult(_0x16df18,null))[_0xaf99('0x3b')](handleError(_0x16df18,null));};exports[_0xaf99('0x42')]=function(_0xa10985,_0x2450a7){return db[_0xaf99('0x29')][_0xaf99('0x43')]({'where':{'id':_0xa10985[_0xaf99('0x44')]['id']}})['then'](handleEntityNotFound(_0x2450a7,null))[_0xaf99('0x24')](removeEntity(_0x2450a7,null))[_0xaf99('0x3b')](handleError(_0x2450a7,null));}; \ No newline at end of file +var _0x056b=['send','SquareMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x056b,0xb6));var _0xb056=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x056b[_0x12a2a6];return _0x1754ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];function respondWithStatusCode(_0x5d8306,_0x49c5ec){_0x49c5ec=_0x49c5ec||0xcc;return function(_0xf3e80f){if(_0xf3e80f){return _0x5d8306[_0xb056('0x1b')](_0x49c5ec);}return _0x5d8306['status'](_0x49c5ec)[_0xb056('0x1c')]();};}function respondWithResult(_0x34611b,_0xf1c2e9){_0xf1c2e9=_0xf1c2e9||0xc8;return function(_0x1197e5){if(_0x1197e5){return _0x34611b[_0xb056('0x1d')](_0xf1c2e9)[_0xb056('0x1e')](_0x1197e5);}};}function respondWithFilteredResult(_0x179e49,_0x4b838e){return function(_0x162146){if(_0x162146){var _0x43565e=typeof _0x4b838e[_0xb056('0x1f')]===_0xb056('0x20')&&typeof _0x4b838e['limit']===_0xb056('0x20');var _0x4e501a=_0x162146[_0xb056('0x21')];var _0x311eb9=_0x43565e?0x0:_0x4b838e['offset'];var _0x29c77e=_0x43565e?_0x162146['count']:_0x4b838e[_0xb056('0x1f')]+_0x4b838e[_0xb056('0x22')];var _0x5e4bd9;if(_0x29c77e>=_0x4e501a){_0x29c77e=_0x4e501a;_0x5e4bd9=0xc8;}else{_0x5e4bd9=0xce;}_0x179e49[_0xb056('0x1d')](_0x5e4bd9);return _0x179e49['set'](_0xb056('0x23'),_0x311eb9+'-'+_0x29c77e+'/'+_0x4e501a)[_0xb056('0x1e')](_0x162146);}return null;};}function patchUpdates(_0x457b54){return function(_0x33dd35){try{jsonpatch['apply'](_0x33dd35,_0x457b54,!![]);}catch(_0x1db585){return BPromise['reject'](_0x1db585);}return _0x33dd35[_0xb056('0x24')]();};}function saveUpdates(_0x5dea90,_0x324ce6){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xb056('0x25')](_0x5dea90)[_0xb056('0x26')](function(_0x36e539){return _0x36e539;});}return null;};}function removeEntity(_0x4bb6c0,_0x4e66c3){return function(_0x1016da){if(_0x1016da){return _0x1016da[_0xb056('0x27')]()[_0xb056('0x26')](function(){_0x4bb6c0[_0xb056('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a14f,_0x10b9b3){return function(_0x5c39db){if(!_0x5c39db){_0x44a14f[_0xb056('0x1b')](0x194);}return _0x5c39db;};}function handleError(_0x265782,_0x2ae873){_0x2ae873=_0x2ae873||0x1f4;return function(_0x1d2c66){logger[_0xb056('0x28')](_0x1d2c66[_0xb056('0x29')]);if(_0x1d2c66[_0xb056('0x2a')]){delete _0x1d2c66[_0xb056('0x2a')];}_0x265782['status'](_0x2ae873)[_0xb056('0x2b')](_0x1d2c66);};}exports['index']=function(_0x3d83d3,_0x9c6f4a){var _0x294874={},_0x488185={},_0xd53267={'count':0x0,'rows':[]};var _0x264569=_['map'](db[_0xb056('0x2c')][_0xb056('0x2d')],function(_0x329eaa){return{'name':_0x329eaa[_0xb056('0x2e')],'type':_0x329eaa[_0xb056('0x2f')]['key']};});_0x488185[_0xb056('0x30')]=_[_0xb056('0x31')](_0x264569,_0xb056('0x2a'));_0x488185[_0xb056('0x32')]=_[_0xb056('0x33')](_0x3d83d3['query']);_0x488185[_0xb056('0x34')]=_[_0xb056('0x35')](_0x488185[_0xb056('0x30')],_0x488185[_0xb056('0x32')]);_0x294874[_0xb056('0x36')]=_[_0xb056('0x35')](_0x488185[_0xb056('0x30')],qs[_0xb056('0x37')](_0x3d83d3['query'][_0xb056('0x37')]));_0x294874['attributes']=_0x294874[_0xb056('0x36')]['length']?_0x294874['attributes']:_0x488185[_0xb056('0x30')];if(!_0x3d83d3[_0xb056('0x32')][_0xb056('0x38')](_0xb056('0x39'))){_0x294874[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x3d83d3[_0xb056('0x32')]['limit']);_0x294874[_0xb056('0x1f')]=qs[_0xb056('0x1f')](_0x3d83d3['query']['offset']);}_0x294874[_0xb056('0x3a')]=qs[_0xb056('0x3b')](_0x3d83d3[_0xb056('0x32')]['sort']);_0x294874[_0xb056('0x3c')]=qs[_0xb056('0x34')](_[_0xb056('0x3d')](_0x3d83d3[_0xb056('0x32')],_0x488185[_0xb056('0x34')]),_0x264569);if(_0x3d83d3[_0xb056('0x32')][_0xb056('0x3e')]){_0x294874[_0xb056('0x3c')]=_[_0xb056('0x3f')](_0x294874[_0xb056('0x3c')],{'$or':_[_0xb056('0x31')](_0x264569,function(_0x1afc7f){if(_0x1afc7f['type']!==_0xb056('0x40')){var _0x4acc94={};_0x4acc94[_0x1afc7f[_0xb056('0x2a')]]={'$like':'%'+_0x3d83d3[_0xb056('0x32')][_0xb056('0x3e')]+'%'};return _0x4acc94;}})});}_0x294874=_[_0xb056('0x3f')]({},_0x294874,_0x3d83d3[_0xb056('0x41')]);var _0x661784={'where':_0x294874[_0xb056('0x3c')]};return db[_0xb056('0x2c')]['count'](_0x661784)[_0xb056('0x26')](function(_0x21a34b){_0xd53267[_0xb056('0x21')]=_0x21a34b;if(_0x3d83d3[_0xb056('0x32')][_0xb056('0x42')]){_0x294874['include']=[{'all':!![]}];}return db[_0xb056('0x2c')][_0xb056('0x43')](_0x294874);})[_0xb056('0x26')](function(_0x216f72){_0xd53267[_0xb056('0x44')]=_0x216f72;return _0xd53267;})[_0xb056('0x26')](respondWithFilteredResult(_0x9c6f4a,_0x294874))['catch'](handleError(_0x9c6f4a,null));};exports[_0xb056('0x45')]=function(_0x5040f6,_0x3bcc3d){var _0xc729f3={'raw':!![],'where':{'id':_0x5040f6[_0xb056('0x46')]['id']}},_0x21d98e={};_0x21d98e[_0xb056('0x30')]=_[_0xb056('0x33')](db[_0xb056('0x2c')][_0xb056('0x2d')]);_0x21d98e[_0xb056('0x32')]=_[_0xb056('0x33')](_0x5040f6['query']);_0x21d98e[_0xb056('0x34')]=_[_0xb056('0x35')](_0x21d98e[_0xb056('0x30')],_0x21d98e['query']);_0xc729f3[_0xb056('0x36')]=_[_0xb056('0x35')](_0x21d98e['model'],qs['fields'](_0x5040f6[_0xb056('0x32')][_0xb056('0x37')]));_0xc729f3[_0xb056('0x36')]=_0xc729f3[_0xb056('0x36')]['length']?_0xc729f3['attributes']:_0x21d98e['model'];if(_0x5040f6['query']['includeAll']){_0xc729f3['include']=[{'all':!![]}];}_0xc729f3=_[_0xb056('0x3f')]({},_0xc729f3,_0x5040f6['options']);return db[_0xb056('0x2c')][_0xb056('0x47')](_0xc729f3)[_0xb056('0x26')](handleEntityNotFound(_0x3bcc3d,null))[_0xb056('0x26')](respondWithResult(_0x3bcc3d,null))[_0xb056('0x48')](handleError(_0x3bcc3d,null));};exports[_0xb056('0x49')]=function(_0x45b4aa,_0x1d3f86){return db['SquareMessage'][_0xb056('0x49')](_0x45b4aa[_0xb056('0x4a')],{})['then'](respondWithResult(_0x1d3f86,0xc9))[_0xb056('0x48')](handleError(_0x1d3f86,null));};exports[_0xb056('0x25')]=function(_0xe40439,_0x2f2d22){if(_0xe40439[_0xb056('0x4a')]['id']){delete _0xe40439[_0xb056('0x4a')]['id'];}return db['SquareMessage'][_0xb056('0x47')]({'where':{'id':_0xe40439['params']['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x2f2d22,null))[_0xb056('0x26')](saveUpdates(_0xe40439[_0xb056('0x4a')],null))[_0xb056('0x26')](respondWithResult(_0x2f2d22,null))[_0xb056('0x48')](handleError(_0x2f2d22,null));};exports[_0xb056('0x27')]=function(_0x2b6733,_0x25bb16){return db['SquareMessage'][_0xb056('0x47')]({'where':{'id':_0x2b6733[_0xb056('0x46')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x25bb16,null))[_0xb056('0x26')](removeEntity(_0x25bb16,null))[_0xb056('0x48')](handleError(_0x25bb16,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d7ccdf7..58b1ccb 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 _0x6e6a=['bluebird','request-promise','rimraf','exports','SquareMessage','square_messages','../../config/logger','api','moment'];(function(_0x42c77e,_0x5c0fd5){var _0x58baaf=function(_0x1b72a9){while(--_0x1b72a9){_0x42c77e['push'](_0x42c77e['shift']());}};_0x58baaf(++_0x5c0fd5);}(_0x6e6a,0xf0));var _0xa6e6=function(_0xb3adf5,_0x3c6a97){_0xb3adf5=_0xb3adf5-0x0;var _0x15b27e=_0x6e6a[_0xb3adf5];return _0x15b27e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6e6('0x0'))(_0xa6e6('0x1'));var moment=require(_0xa6e6('0x2'));var BPromise=require(_0xa6e6('0x3'));var rp=require(_0xa6e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6e6('0x5'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xa6e6('0x6')]=function(_0x2def17,_0x2e3c21){return _0x2def17['define'](_0xa6e6('0x7'),attributes,{'tableName':_0xa6e6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9468=['square_messages','request-promise','path','./squareMessage.attributes','SquareMessage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9468,0x11e));var _0x8946=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x9468[_0x571a17];return _0x3ef337;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8946('0x0'));var fs=require('fs');var path=require(_0x8946('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8946('0x2'));module['exports']=function(_0xfc014c,_0x1d350c){return _0xfc014c['define'](_0x8946('0x3'),attributes,{'tableName':_0x8946('0x4'),'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 f8c5958..a069b7a 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 _0xfa09=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','debug','stringify','lodash'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0xfa09,0xad));var _0x9fa0=function(_0x41bba8,_0x21f469){_0x41bba8=_0x41bba8-0x0;var _0x58d0e7=_0xfa09[_0x41bba8];return _0x58d0e7;};'use strict';var _=require(_0x9fa0('0x0'));var util=require(_0x9fa0('0x1'));var moment=require('moment');var BPromise=require(_0x9fa0('0x2'));var rs=require(_0x9fa0('0x3'));var fs=require('fs');var Redis=require(_0x9fa0('0x4'));var db=require(_0x9fa0('0x5'))['db'];var utils=require(_0x9fa0('0x6'));var logger=require(_0x9fa0('0x7'))(_0x9fa0('0x8'));var config=require(_0x9fa0('0x9'));var jayson=require(_0x9fa0('0xa'));var client=jayson[_0x9fa0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x522caa,_0xca837b,_0x52d218){return new BPromise(function(_0x2fcebd,_0x588c0f){return client['request'](_0x522caa,_0x52d218)[_0x9fa0('0xc')](function(_0xd9db79){logger[_0x9fa0('0xd')](_0x9fa0('0xe'),_0xca837b,_0x9fa0('0xf'));logger['debug'](_0x9fa0('0x10'),_0xca837b,'request\x20sent',JSON['stringify'](_0xd9db79));if(_0xd9db79[_0x9fa0('0x11')]){if(_0xd9db79[_0x9fa0('0x11')][_0x9fa0('0x12')]===0x1f4){logger[_0x9fa0('0x11')](_0x9fa0('0xe'),_0xca837b,_0xd9db79[_0x9fa0('0x11')][_0x9fa0('0x13')]);return _0x588c0f(_0xd9db79[_0x9fa0('0x11')][_0x9fa0('0x13')]);}logger[_0x9fa0('0x11')]('SquareMessage,\x20%s,\x20%s',_0xca837b,_0xd9db79[_0x9fa0('0x11')][_0x9fa0('0x13')]);return _0x2fcebd(_0xd9db79['error'][_0x9fa0('0x13')]);}else{logger['info'](_0x9fa0('0xe'),_0xca837b,_0x9fa0('0xf'));_0x2fcebd(_0xd9db79[_0x9fa0('0x14')]['message']);}})[_0x9fa0('0x15')](function(_0x456678){logger['error']('SquareMessage,\x20%s,\x20%s',_0xca837b,_0x456678);_0x588c0f(_0x456678);});});}exports[_0x9fa0('0x16')]=function(_0x2b1974){var _0x5b27a6=this;return new Promise(function(_0xece98f,_0x292adc){return db['SquareMessage'][_0x9fa0('0x17')](_0x2b1974[_0x9fa0('0x18')],{'raw':_0x2b1974[_0x9fa0('0x19')]?_0x2b1974['options'][_0x9fa0('0x1a')]===undefined?!![]:![]:!![]})[_0x9fa0('0xc')](function(_0x14253a){logger['info'](_0x9fa0('0x16'),_0x2b1974);logger[_0x9fa0('0x1b')]('CreateSquareMessage',_0x2b1974,JSON[_0x9fa0('0x1c')](_0x14253a));_0xece98f(_0x14253a);})[_0x9fa0('0x15')](function(_0x29abe8){logger['error']('CreateSquareMessage',_0x29abe8['message'],_0x2b1974);_0x292adc(_0x5b27a6[_0x9fa0('0x11')](0x1f4,_0x29abe8[_0x9fa0('0x13')]));});});}; \ No newline at end of file +var _0x06de=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','info','result','catch','SquareMessage','body','options','raw','CreateSquareMessage','debug'];(function(_0x41ef02,_0x101e1a){var _0x5e6995=function(_0x124fdd){while(--_0x124fdd){_0x41ef02['push'](_0x41ef02['shift']());}};_0x5e6995(++_0x101e1a);}(_0x06de,0x138));var _0xe06d=function(_0x4eda22,_0x3d2db4){_0x4eda22=_0x4eda22-0x0;var _0x4a5706=_0x06de[_0x4eda22];return _0x4a5706;};'use strict';var _=require(_0xe06d('0x0'));var util=require(_0xe06d('0x1'));var moment=require(_0xe06d('0x2'));var BPromise=require(_0xe06d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe06d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe06d('0x5'));var logger=require(_0xe06d('0x6'))(_0xe06d('0x7'));var config=require('../../config/environment');var jayson=require(_0xe06d('0x8'));var client=jayson[_0xe06d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x300001,_0x23d836,_0x310937){return new BPromise(function(_0x420f40,_0x149b6a){return client['request'](_0x300001,_0x310937)[_0xe06d('0xa')](function(_0x102ba8){logger['info']('SquareMessage,\x20%s,\x20%s',_0x23d836,_0xe06d('0xb'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x23d836,_0xe06d('0xb'),JSON[_0xe06d('0xc')](_0x102ba8));if(_0x102ba8['error']){if(_0x102ba8[_0xe06d('0xd')][_0xe06d('0xe')]===0x1f4){logger[_0xe06d('0xd')]('SquareMessage,\x20%s,\x20%s',_0x23d836,_0x102ba8[_0xe06d('0xd')][_0xe06d('0xf')]);return _0x149b6a(_0x102ba8[_0xe06d('0xd')][_0xe06d('0xf')]);}logger[_0xe06d('0xd')](_0xe06d('0x10'),_0x23d836,_0x102ba8[_0xe06d('0xd')][_0xe06d('0xf')]);return _0x420f40(_0x102ba8[_0xe06d('0xd')]['message']);}else{logger[_0xe06d('0x11')](_0xe06d('0x10'),_0x23d836,'request\x20sent');_0x420f40(_0x102ba8[_0xe06d('0x12')]['message']);}})[_0xe06d('0x13')](function(_0x443dab){logger[_0xe06d('0xd')](_0xe06d('0x10'),_0x23d836,_0x443dab);_0x149b6a(_0x443dab);});});}exports['CreateSquareMessage']=function(_0x1cf578){var _0x6d2f73=this;return new Promise(function(_0x7a73eb,_0x39bacf){return db[_0xe06d('0x14')]['create'](_0x1cf578[_0xe06d('0x15')],{'raw':_0x1cf578[_0xe06d('0x16')]?_0x1cf578[_0xe06d('0x16')][_0xe06d('0x17')]===undefined?!![]:![]:!![]})[_0xe06d('0xa')](function(_0x1659a6){logger['info'](_0xe06d('0x18'),_0x1cf578);logger[_0xe06d('0x19')](_0xe06d('0x18'),_0x1cf578,JSON[_0xe06d('0xc')](_0x1659a6));_0x7a73eb(_0x1659a6);})[_0xe06d('0x13')](function(_0x27f368){logger[_0xe06d('0xd')](_0xe06d('0x18'),_0x27f368[_0xe06d('0xf')],_0x1cf578);_0x39bacf(_0x6d2f73[_0xe06d('0xd')](0x1f4,_0x27f368[_0xe06d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e033835..c8fc2e6 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 _0xeb52=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','isAuthenticated','15s','test','create','put','update','delete','destroy','multer'];(function(_0x31f23f,_0x421862){var _0x572b25=function(_0x41c5ca){while(--_0x41c5ca){_0x31f23f['push'](_0x31f23f['shift']());}};_0x572b25(++_0x421862);}(_0xeb52,0x1e2));var _0x2eb5=function(_0x227775,_0x34a8d3){_0x227775=_0x227775-0x0;var _0x576577=_0xeb52[_0x227775];return _0x576577;};'use strict';var multer=require(_0x2eb5('0x0'));var util=require(_0x2eb5('0x1'));var path=require('path');var timeout=require(_0x2eb5('0x2'));var express=require(_0x2eb5('0x3'));var router=express[_0x2eb5('0x4')]();var fs_extra=require(_0x2eb5('0x5'));var auth=require(_0x2eb5('0x6'));var interaction=require(_0x2eb5('0x7'));var config=require(_0x2eb5('0x8'));var controller=require(_0x2eb5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2eb5('0xa')]);router[_0x2eb5('0xb')](_0x2eb5('0xc'),auth[_0x2eb5('0xd')](),controller['show']);router[_0x2eb5('0xb')]('/:id/test',auth[_0x2eb5('0xd')](),timeout(_0x2eb5('0xe')),controller[_0x2eb5('0xf')]);router['post']('/',auth[_0x2eb5('0xd')](),controller[_0x2eb5('0x10')]);router[_0x2eb5('0x11')](_0x2eb5('0xc'),auth[_0x2eb5('0xd')](),controller[_0x2eb5('0x12')]);router[_0x2eb5('0x13')](_0x2eb5('0xc'),auth['isAuthenticated'](),controller[_0x2eb5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8753=['put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/test','15s','test'];(function(_0x42db5e,_0x415c1f){var _0x3b2d18=function(_0x47b7e3){while(--_0x47b7e3){_0x42db5e['push'](_0x42db5e['shift']());}};_0x3b2d18(++_0x415c1f);}(_0x8753,0x181));var _0x3875=function(_0xf943f3,_0x3a80aa){_0xf943f3=_0xf943f3-0x0;var _0x357159=_0x8753[_0xf943f3];return _0x357159;};'use strict';var multer=require(_0x3875('0x0'));var util=require(_0x3875('0x1'));var path=require('path');var timeout=require(_0x3875('0x2'));var express=require('express');var router=express[_0x3875('0x3')]();var fs_extra=require(_0x3875('0x4'));var auth=require(_0x3875('0x5'));var interaction=require(_0x3875('0x6'));var config=require(_0x3875('0x7'));var controller=require('./squareOdbc.controller');router[_0x3875('0x8')]('/',auth[_0x3875('0x9')](),controller['index']);router['get'](_0x3875('0xa'),auth[_0x3875('0x9')](),controller[_0x3875('0xb')]);router['get'](_0x3875('0xc'),auth['isAuthenticated'](),timeout(_0x3875('0xd')),controller[_0x3875('0xe')]);router['post']('/',auth[_0x3875('0x9')](),controller['create']);router[_0x3875('0xf')](_0x3875('0xa'),auth[_0x3875('0x9')](),controller[_0x3875('0x10')]);router[_0x3875('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3875('0x12')]);module[_0x3875('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 ae9dd73..98f67b2 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 _0x93d3=['sequelize','exports','STRING','name'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x93d3,0x104));var _0x393d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x93d3[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x393d('0x0'));module[_0x393d('0x1')]={'name':{'type':Sequelize[_0x393d('0x2')],'unique':_0x393d('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3f56=['exports','STRING','name','sequelize'];(function(_0x2e185c,_0x271bdc){var _0x484a36=function(_0xad8633){while(--_0xad8633){_0x2e185c['push'](_0x2e185c['shift']());}};_0x484a36(++_0x271bdc);}(_0x3f56,0x8b));var _0x63f5=function(_0x1add35,_0x237f1c){_0x1add35=_0x1add35-0x0;var _0x422ba7=_0x3f56[_0x1add35];return _0x422ba7;};'use strict';var Sequelize=require(_0x63f5('0x0'));module[_0x63f5('0x1')]={'name':{'type':Sequelize[_0x63f5('0x2')],'unique':_0x63f5('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x63f5('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 db89951..f4c329c 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 _0xe0ff=['nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','params','options','find','create','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','get','ODBC','destroy','error','stack','name','map','SquareOdbc','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty'];(function(_0x513f45,_0x21d195){var _0x78190a=function(_0x5a2fcb){while(--_0x5a2fcb){_0x513f45['push'](_0x513f45['shift']());}};_0x78190a(++_0x21d195);}(_0xe0ff,0x1c8));var _0xfe0f=function(_0x36a9e9,_0xc53bc6){_0x36a9e9=_0x36a9e9-0x0;var _0x4ac1c0=_0xe0ff[_0x36a9e9];return _0x4ac1c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe0f('0x0'));var zipdir=require(_0xfe0f('0x1'));var jsonpatch=require(_0xfe0f('0x2'));var rp=require(_0xfe0f('0x3'));var moment=require(_0xfe0f('0x4'));var BPromise=require(_0xfe0f('0x5'));var Mustache=require(_0xfe0f('0x6'));var util=require('util');var path=require(_0xfe0f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfe0f('0x8'));var fs=require('fs');var fs_extra=require(_0xfe0f('0x9'));var _=require(_0xfe0f('0xa'));var squel=require(_0xfe0f('0xb'));var crypto=require(_0xfe0f('0xc'));var jsforce=require(_0xfe0f('0xd'));var deskjs=require(_0xfe0f('0xe'));var toCsv=require(_0xfe0f('0xf'));var querystring=require(_0xfe0f('0x10'));var Papa=require('papaparse');var Redis=require(_0xfe0f('0x11'));var authService=require(_0xfe0f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfe0f('0x13'));var hardwareService=require(_0xfe0f('0x14'));var logger=require(_0xfe0f('0x15'))(_0xfe0f('0x16'));var utils=require(_0xfe0f('0x17'));var config=require(_0xfe0f('0x18'));var licenseUtil=require(_0xfe0f('0x19'));var db=require(_0xfe0f('0x1a'))['db'];function respondWithStatusCode(_0x3e5e4a,_0xe00571){_0xe00571=_0xe00571||0xcc;return function(_0x2d504e){if(_0x2d504e){return _0x3e5e4a[_0xfe0f('0x1b')](_0xe00571);}return _0x3e5e4a[_0xfe0f('0x1c')](_0xe00571)[_0xfe0f('0x1d')]();};}function respondWithResult(_0x37c3aa,_0x656a5f){_0x656a5f=_0x656a5f||0xc8;return function(_0x5895e5){if(_0x5895e5){return _0x37c3aa['status'](_0x656a5f)[_0xfe0f('0x1e')](_0x5895e5);}};}function respondWithFilteredResult(_0x38a8ca,_0x1e0bca){return function(_0x5a70a8){if(_0x5a70a8){var _0x775e1e=typeof _0x1e0bca[_0xfe0f('0x1f')]===_0xfe0f('0x20')&&typeof _0x1e0bca[_0xfe0f('0x21')]==='undefined';var _0x516d4f=_0x5a70a8[_0xfe0f('0x22')];var _0x50d5f8=_0x775e1e?0x0:_0x1e0bca[_0xfe0f('0x1f')];var _0x1872cf=_0x775e1e?_0x5a70a8[_0xfe0f('0x22')]:_0x1e0bca[_0xfe0f('0x1f')]+_0x1e0bca[_0xfe0f('0x21')];var _0xb7dc56;if(_0x1872cf>=_0x516d4f){_0x1872cf=_0x516d4f;_0xb7dc56=0xc8;}else{_0xb7dc56=0xce;}_0x38a8ca['status'](_0xb7dc56);return _0x38a8ca[_0xfe0f('0x23')]('Content-Range',_0x50d5f8+'-'+_0x1872cf+'/'+_0x516d4f)['json'](_0x5a70a8);}return null;};}function patchUpdates(_0x590666){return function(_0x2d3c09){try{jsonpatch['apply'](_0x2d3c09,_0x590666,!![]);}catch(_0x1a80d1){return BPromise[_0xfe0f('0x24')](_0x1a80d1);}return _0x2d3c09[_0xfe0f('0x25')]();};}function saveUpdates(_0x3a7c99,_0x191855){return function(_0x505678){if(_0x505678){return _0x505678[_0xfe0f('0x26')](_0x3a7c99)['then'](function(_0x1b8a7e){return _0x1b8a7e;});}return null;};}function removeEntity(_0x5495e4,_0x28e9cb){return function(_0x3f1e27){if(_0x3f1e27){return _0x3f1e27['destroy']()[_0xfe0f('0x27')](function(){var _0x2b160c=_0x3f1e27[_0xfe0f('0x28')]({'plain':!![]});var _0xe9eb93=_0xfe0f('0x29');return db['UserProfileResource'][_0xfe0f('0x2a')]({'where':{'type':_0xe9eb93,'resourceId':_0x2b160c['id']}})[_0xfe0f('0x27')](function(){return _0x3f1e27;});})[_0xfe0f('0x27')](function(){_0x5495e4[_0xfe0f('0x1c')](0xcc)[_0xfe0f('0x1d')]();});}};}function handleEntityNotFound(_0x269614,_0x5c0401){return function(_0x1a81fc){if(!_0x1a81fc){_0x269614['sendStatus'](0x194);}return _0x1a81fc;};}function handleError(_0x55527b,_0x3cc64b){_0x3cc64b=_0x3cc64b||0x1f4;return function(_0x573a6c){logger[_0xfe0f('0x2b')](_0x573a6c[_0xfe0f('0x2c')]);if(_0x573a6c[_0xfe0f('0x2d')]){delete _0x573a6c[_0xfe0f('0x2d')];}_0x55527b[_0xfe0f('0x1c')](_0x3cc64b)['send'](_0x573a6c);};}exports['index']=function(_0x2902d6,_0x2de5f8){var _0x14af17={},_0x2ff8d6={},_0x4193ab={'count':0x0,'rows':[]};var _0x2a3b33=_[_0xfe0f('0x2e')](db[_0xfe0f('0x2f')][_0xfe0f('0x30')],function(_0x426405){return{'name':_0x426405[_0xfe0f('0x31')],'type':_0x426405[_0xfe0f('0x32')]['key']};});_0x2ff8d6['model']=_[_0xfe0f('0x2e')](_0x2a3b33,_0xfe0f('0x2d'));_0x2ff8d6[_0xfe0f('0x33')]=_[_0xfe0f('0x34')](_0x2902d6['query']);_0x2ff8d6[_0xfe0f('0x35')]=_['intersection'](_0x2ff8d6['model'],_0x2ff8d6[_0xfe0f('0x33')]);_0x14af17[_0xfe0f('0x36')]=_[_0xfe0f('0x37')](_0x2ff8d6[_0xfe0f('0x38')],qs[_0xfe0f('0x39')](_0x2902d6[_0xfe0f('0x33')]['fields']));_0x14af17['attributes']=_0x14af17[_0xfe0f('0x36')][_0xfe0f('0x3a')]?_0x14af17[_0xfe0f('0x36')]:_0x2ff8d6['model'];if(!_0x2902d6['query'][_0xfe0f('0x3b')](_0xfe0f('0x3c'))){_0x14af17['limit']=qs[_0xfe0f('0x21')](_0x2902d6['query']['limit']);_0x14af17[_0xfe0f('0x1f')]=qs['offset'](_0x2902d6[_0xfe0f('0x33')][_0xfe0f('0x1f')]);}_0x14af17[_0xfe0f('0x3d')]=qs[_0xfe0f('0x3e')](_0x2902d6[_0xfe0f('0x33')]['sort']);_0x14af17['where']=qs[_0xfe0f('0x35')](_[_0xfe0f('0x3f')](_0x2902d6[_0xfe0f('0x33')],_0x2ff8d6[_0xfe0f('0x35')]),_0x2a3b33);if(_0x2902d6[_0xfe0f('0x33')][_0xfe0f('0x40')]){_0x14af17[_0xfe0f('0x41')]=_['merge'](_0x14af17[_0xfe0f('0x41')],{'$or':_[_0xfe0f('0x2e')](_0x2a3b33,function(_0x5dc671){if(_0x5dc671['type']!==_0xfe0f('0x42')){var _0x310b97={};_0x310b97[_0x5dc671[_0xfe0f('0x2d')]]={'$like':'%'+_0x2902d6['query']['filter']+'%'};return _0x310b97;}})});}_0x14af17=_[_0xfe0f('0x43')]({},_0x14af17,_0x2902d6['options']);var _0x465da1={'where':_0x14af17[_0xfe0f('0x41')]};return db[_0xfe0f('0x2f')][_0xfe0f('0x22')](_0x465da1)[_0xfe0f('0x27')](function(_0x41d262){_0x4193ab['count']=_0x41d262;if(_0x2902d6['query']['includeAll']){_0x14af17[_0xfe0f('0x44')]=[{'all':!![]}];}return db[_0xfe0f('0x2f')][_0xfe0f('0x45')](_0x14af17);})[_0xfe0f('0x27')](function(_0x343bef){_0x4193ab[_0xfe0f('0x46')]=_0x343bef;return _0x4193ab;})['then'](respondWithFilteredResult(_0x2de5f8,_0x14af17))[_0xfe0f('0x47')](handleError(_0x2de5f8,null));};exports['show']=function(_0x1dd41b,_0x27d680){var _0x4abd57={'raw':!![],'where':{'id':_0x1dd41b[_0xfe0f('0x48')]['id']}},_0x277a5f={};_0x277a5f[_0xfe0f('0x38')]=_['keys'](db[_0xfe0f('0x2f')]['rawAttributes']);_0x277a5f[_0xfe0f('0x33')]=_[_0xfe0f('0x34')](_0x1dd41b[_0xfe0f('0x33')]);_0x277a5f['filters']=_['intersection'](_0x277a5f['model'],_0x277a5f['query']);_0x4abd57[_0xfe0f('0x36')]=_['intersection'](_0x277a5f[_0xfe0f('0x38')],qs[_0xfe0f('0x39')](_0x1dd41b[_0xfe0f('0x33')][_0xfe0f('0x39')]));_0x4abd57['attributes']=_0x4abd57[_0xfe0f('0x36')][_0xfe0f('0x3a')]?_0x4abd57['attributes']:_0x277a5f[_0xfe0f('0x38')];if(_0x1dd41b['query']['includeAll']){_0x4abd57[_0xfe0f('0x44')]=[{'all':!![]}];}_0x4abd57=_['merge']({},_0x4abd57,_0x1dd41b[_0xfe0f('0x49')]);return db[_0xfe0f('0x2f')][_0xfe0f('0x4a')](_0x4abd57)['then'](handleEntityNotFound(_0x27d680,null))[_0xfe0f('0x27')](respondWithResult(_0x27d680,null))[_0xfe0f('0x47')](handleError(_0x27d680,null));};exports[_0xfe0f('0x4b')]=function(_0x18021c,_0x555ed2){return db[_0xfe0f('0x2f')][_0xfe0f('0x4b')](_0x18021c['body'],{})[_0xfe0f('0x27')](function(_0x50befb){var _0x4271a9=_0x18021c['user'][_0xfe0f('0x28')]({'plain':!![]});if(!_0x4271a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4271a9[_0xfe0f('0x4c')]===_0xfe0f('0x4d')){var _0x478f4b=_0x50befb[_0xfe0f('0x28')]({'plain':!![]});var _0x3b3c04=_0xfe0f('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x3b3c04,'userProfileId':_0x4271a9['userProfileId']},'raw':!![]})[_0xfe0f('0x27')](function(_0x8fd88a){if(_0x8fd88a&&_0x8fd88a['autoAssociation']===0x0){return db[_0xfe0f('0x4e')][_0xfe0f('0x4b')]({'name':_0x478f4b[_0xfe0f('0x2d')],'resourceId':_0x478f4b['id'],'type':_0x8fd88a['name'],'sectionId':_0x8fd88a['id']},{})[_0xfe0f('0x27')](function(){return _0x50befb;});}else{return _0x50befb;}})[_0xfe0f('0x47')](function(_0x21b29c){logger['error'](_0xfe0f('0x4f'),_0x21b29c);throw _0x21b29c;});}return _0x50befb;})['then'](respondWithResult(_0x555ed2,0xc9))[_0xfe0f('0x47')](handleError(_0x555ed2,null));};exports[_0xfe0f('0x26')]=function(_0x48feef,_0x437975){if(_0x48feef[_0xfe0f('0x50')]['id']){delete _0x48feef[_0xfe0f('0x50')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x48feef[_0xfe0f('0x48')]['id']}})[_0xfe0f('0x27')](handleEntityNotFound(_0x437975,null))[_0xfe0f('0x27')](saveUpdates(_0x48feef[_0xfe0f('0x50')],null))[_0xfe0f('0x27')](respondWithResult(_0x437975,null))[_0xfe0f('0x47')](handleError(_0x437975,null));};exports[_0xfe0f('0x2a')]=function(_0x123180,_0x359ef1){return db[_0xfe0f('0x2f')][_0xfe0f('0x4a')]({'where':{'id':_0x123180[_0xfe0f('0x48')]['id']}})[_0xfe0f('0x27')](handleEntityNotFound(_0x359ef1,null))[_0xfe0f('0x27')](removeEntity(_0x359ef1,null))[_0xfe0f('0x47')](handleError(_0x359ef1,null));};exports[_0xfe0f('0x51')]=function(_0x41e3ea,_0x4aa4fe,_0x76eb95){var _0x3720fd;return db[_0xfe0f('0x2f')][_0xfe0f('0x4a')]({'where':{'id':_0x41e3ea[_0xfe0f('0x48')]['id']},'attributes':['id',_0xfe0f('0x52')]})[_0xfe0f('0x27')](handleEntityNotFound(_0x4aa4fe,null))[_0xfe0f('0x27')](function(_0x382407){if(_0x382407){var _0x434bff=require(_0xfe0f('0x53'))();_0x434bff[_0xfe0f('0x54')](_0x382407[_0xfe0f('0x52')]);_0x434bff[_0xfe0f('0x55')]();return _0x382407;}})[_0xfe0f('0x27')](respondWithResult(_0x4aa4fe,null))[_0xfe0f('0x47')](handleError(_0x4aa4fe,null));}; \ No newline at end of file +var _0x6520=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareOdbc','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x8ea2d1,_0x373583){var _0x4cb6db=function(_0x1e802b){while(--_0x1e802b){_0x8ea2d1['push'](_0x8ea2d1['shift']());}};_0x4cb6db(++_0x373583);}(_0x6520,0x9a));var _0x0652=function(_0x110248,_0xa01b11){_0x110248=_0x110248-0x0;var _0x2220ee=_0x6520[_0x110248];return _0x2220ee;};'use strict';var emlformat=require(_0x0652('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0652('0x1'));var rp=require(_0x0652('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0652('0x3'));var util=require(_0x0652('0x4'));var path=require(_0x0652('0x5'));var sox=require(_0x0652('0x6'));var csv=require(_0x0652('0x7'));var ejs=require(_0x0652('0x8'));var fs=require('fs');var fs_extra=require(_0x0652('0x9'));var _=require(_0x0652('0xa'));var squel=require(_0x0652('0xb'));var crypto=require(_0x0652('0xc'));var jsforce=require(_0x0652('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0652('0x7'));var querystring=require(_0x0652('0xe'));var Papa=require(_0x0652('0xf'));var Redis=require('ioredis');var authService=require(_0x0652('0x10'));var qs=require(_0x0652('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0652('0x12'));var logger=require('../../config/logger')(_0x0652('0x13'));var utils=require(_0x0652('0x14'));var config=require(_0x0652('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0652('0x16'))['db'];function respondWithStatusCode(_0x521b6b,_0x571d62){_0x571d62=_0x571d62||0xcc;return function(_0x17bc76){if(_0x17bc76){return _0x521b6b['sendStatus'](_0x571d62);}return _0x521b6b[_0x0652('0x17')](_0x571d62)['end']();};}function respondWithResult(_0x264257,_0x46f357){_0x46f357=_0x46f357||0xc8;return function(_0x63e7f1){if(_0x63e7f1){return _0x264257[_0x0652('0x17')](_0x46f357)[_0x0652('0x18')](_0x63e7f1);}};}function respondWithFilteredResult(_0x3eff4e,_0x5cc041){return function(_0x11925c){if(_0x11925c){var _0x2dcc6f=typeof _0x5cc041[_0x0652('0x19')]===_0x0652('0x1a')&&typeof _0x5cc041['limit']===_0x0652('0x1a');var _0x4d83a5=_0x11925c['count'];var _0x40024c=_0x2dcc6f?0x0:_0x5cc041[_0x0652('0x19')];var _0x95abc2=_0x2dcc6f?_0x11925c['count']:_0x5cc041[_0x0652('0x19')]+_0x5cc041[_0x0652('0x1b')];var _0x4f82cc;if(_0x95abc2>=_0x4d83a5){_0x95abc2=_0x4d83a5;_0x4f82cc=0xc8;}else{_0x4f82cc=0xce;}_0x3eff4e[_0x0652('0x17')](_0x4f82cc);return _0x3eff4e[_0x0652('0x1c')](_0x0652('0x1d'),_0x40024c+'-'+_0x95abc2+'/'+_0x4d83a5)[_0x0652('0x18')](_0x11925c);}return null;};}function patchUpdates(_0x6aceff){return function(_0x2252d0){try{jsonpatch[_0x0652('0x1e')](_0x2252d0,_0x6aceff,!![]);}catch(_0x5e97f2){return BPromise[_0x0652('0x1f')](_0x5e97f2);}return _0x2252d0[_0x0652('0x20')]();};}function saveUpdates(_0x226b47,_0xd12b36){return function(_0x342c25){if(_0x342c25){return _0x342c25[_0x0652('0x21')](_0x226b47)[_0x0652('0x22')](function(_0x5056c5){return _0x5056c5;});}return null;};}function removeEntity(_0x434e74,_0xd98224){return function(_0x125953){if(_0x125953){return _0x125953[_0x0652('0x23')]()[_0x0652('0x22')](function(){var _0x219a67=_0x125953[_0x0652('0x24')]({'plain':!![]});var _0x476a4e=_0x0652('0x25');return db[_0x0652('0x26')]['destroy']({'where':{'type':_0x476a4e,'resourceId':_0x219a67['id']}})[_0x0652('0x22')](function(){return _0x125953;});})[_0x0652('0x22')](function(){_0x434e74[_0x0652('0x17')](0xcc)[_0x0652('0x27')]();});}};}function handleEntityNotFound(_0x7ac74f,_0x494f98){return function(_0xb7ea4d){if(!_0xb7ea4d){_0x7ac74f[_0x0652('0x28')](0x194);}return _0xb7ea4d;};}function handleError(_0x367ede,_0x111124){_0x111124=_0x111124||0x1f4;return function(_0x4d113d){logger[_0x0652('0x29')](_0x4d113d['stack']);if(_0x4d113d['name']){delete _0x4d113d[_0x0652('0x2a')];}_0x367ede['status'](_0x111124)[_0x0652('0x2b')](_0x4d113d);};}exports[_0x0652('0x2c')]=function(_0x17eccb,_0x43f042){var _0x1d2e42={},_0x19b994={},_0x3adc4e={'count':0x0,'rows':[]};var _0x45ac47=_[_0x0652('0x2d')](db['SquareOdbc'][_0x0652('0x2e')],function(_0x5cf371){return{'name':_0x5cf371[_0x0652('0x2f')],'type':_0x5cf371['type'][_0x0652('0x30')]};});_0x19b994[_0x0652('0x31')]=_['map'](_0x45ac47,_0x0652('0x2a'));_0x19b994['query']=_[_0x0652('0x32')](_0x17eccb['query']);_0x19b994[_0x0652('0x33')]=_[_0x0652('0x34')](_0x19b994['model'],_0x19b994[_0x0652('0x35')]);_0x1d2e42[_0x0652('0x36')]=_[_0x0652('0x34')](_0x19b994[_0x0652('0x31')],qs[_0x0652('0x37')](_0x17eccb[_0x0652('0x35')][_0x0652('0x37')]));_0x1d2e42[_0x0652('0x36')]=_0x1d2e42[_0x0652('0x36')][_0x0652('0x38')]?_0x1d2e42['attributes']:_0x19b994['model'];if(!_0x17eccb[_0x0652('0x35')][_0x0652('0x39')](_0x0652('0x3a'))){_0x1d2e42[_0x0652('0x1b')]=qs[_0x0652('0x1b')](_0x17eccb[_0x0652('0x35')]['limit']);_0x1d2e42[_0x0652('0x19')]=qs[_0x0652('0x19')](_0x17eccb[_0x0652('0x35')][_0x0652('0x19')]);}_0x1d2e42['order']=qs[_0x0652('0x3b')](_0x17eccb[_0x0652('0x35')][_0x0652('0x3b')]);_0x1d2e42[_0x0652('0x3c')]=qs[_0x0652('0x33')](_[_0x0652('0x3d')](_0x17eccb[_0x0652('0x35')],_0x19b994[_0x0652('0x33')]),_0x45ac47);if(_0x17eccb[_0x0652('0x35')][_0x0652('0x3e')]){_0x1d2e42[_0x0652('0x3c')]=_[_0x0652('0x3f')](_0x1d2e42[_0x0652('0x3c')],{'$or':_[_0x0652('0x2d')](_0x45ac47,function(_0xb8c927){if(_0xb8c927[_0x0652('0x40')]!==_0x0652('0x41')){var _0x12d2af={};_0x12d2af[_0xb8c927[_0x0652('0x2a')]]={'$like':'%'+_0x17eccb['query'][_0x0652('0x3e')]+'%'};return _0x12d2af;}})});}_0x1d2e42=_[_0x0652('0x3f')]({},_0x1d2e42,_0x17eccb[_0x0652('0x42')]);var _0x38cae6={'where':_0x1d2e42['where']};return db[_0x0652('0x43')]['count'](_0x38cae6)[_0x0652('0x22')](function(_0x43b80b){_0x3adc4e[_0x0652('0x44')]=_0x43b80b;if(_0x17eccb[_0x0652('0x35')][_0x0652('0x45')]){_0x1d2e42[_0x0652('0x46')]=[{'all':!![]}];}return db['SquareOdbc'][_0x0652('0x47')](_0x1d2e42);})[_0x0652('0x22')](function(_0x323c58){_0x3adc4e[_0x0652('0x48')]=_0x323c58;return _0x3adc4e;})[_0x0652('0x22')](respondWithFilteredResult(_0x43f042,_0x1d2e42))[_0x0652('0x49')](handleError(_0x43f042,null));};exports[_0x0652('0x4a')]=function(_0x576a2e,_0x40e5ed){var _0x59ad55={'raw':!![],'where':{'id':_0x576a2e[_0x0652('0x4b')]['id']}},_0x98dba4={};_0x98dba4[_0x0652('0x31')]=_['keys'](db['SquareOdbc'][_0x0652('0x2e')]);_0x98dba4[_0x0652('0x35')]=_['keys'](_0x576a2e['query']);_0x98dba4[_0x0652('0x33')]=_[_0x0652('0x34')](_0x98dba4['model'],_0x98dba4[_0x0652('0x35')]);_0x59ad55[_0x0652('0x36')]=_[_0x0652('0x34')](_0x98dba4[_0x0652('0x31')],qs[_0x0652('0x37')](_0x576a2e[_0x0652('0x35')][_0x0652('0x37')]));_0x59ad55[_0x0652('0x36')]=_0x59ad55[_0x0652('0x36')][_0x0652('0x38')]?_0x59ad55[_0x0652('0x36')]:_0x98dba4[_0x0652('0x31')];if(_0x576a2e[_0x0652('0x35')][_0x0652('0x45')]){_0x59ad55[_0x0652('0x46')]=[{'all':!![]}];}_0x59ad55=_[_0x0652('0x3f')]({},_0x59ad55,_0x576a2e[_0x0652('0x42')]);return db[_0x0652('0x43')][_0x0652('0x4c')](_0x59ad55)['then'](handleEntityNotFound(_0x40e5ed,null))[_0x0652('0x22')](respondWithResult(_0x40e5ed,null))[_0x0652('0x49')](handleError(_0x40e5ed,null));};exports[_0x0652('0x4d')]=function(_0x2170da,_0xa4a402){return db[_0x0652('0x43')][_0x0652('0x4d')](_0x2170da[_0x0652('0x4e')],{})[_0x0652('0x22')](function(_0x407dc2){var _0x9108eb=_0x2170da[_0x0652('0x4f')]['get']({'plain':!![]});if(!_0x9108eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9108eb['role']===_0x0652('0x4f')){var _0x24ba41=_0x407dc2[_0x0652('0x24')]({'plain':!![]});var _0x444252=_0x0652('0x25');return db[_0x0652('0x50')]['find']({'where':{'name':_0x444252,'userProfileId':_0x9108eb[_0x0652('0x51')]},'raw':!![]})['then'](function(_0x1b6155){if(_0x1b6155&&_0x1b6155[_0x0652('0x52')]===0x0){return db[_0x0652('0x26')][_0x0652('0x4d')]({'name':_0x24ba41[_0x0652('0x2a')],'resourceId':_0x24ba41['id'],'type':_0x1b6155['name'],'sectionId':_0x1b6155['id']},{})[_0x0652('0x22')](function(){return _0x407dc2;});}else{return _0x407dc2;}})['catch'](function(_0x5a28a1){logger[_0x0652('0x29')](_0x0652('0x53'),_0x5a28a1);throw _0x5a28a1;});}return _0x407dc2;})['then'](respondWithResult(_0xa4a402,0xc9))[_0x0652('0x49')](handleError(_0xa4a402,null));};exports[_0x0652('0x21')]=function(_0x418fd3,_0x18f682){if(_0x418fd3[_0x0652('0x4e')]['id']){delete _0x418fd3['body']['id'];}return db[_0x0652('0x43')]['find']({'where':{'id':_0x418fd3[_0x0652('0x4b')]['id']}})[_0x0652('0x22')](handleEntityNotFound(_0x18f682,null))[_0x0652('0x22')](saveUpdates(_0x418fd3[_0x0652('0x4e')],null))['then'](respondWithResult(_0x18f682,null))[_0x0652('0x49')](handleError(_0x18f682,null));};exports[_0x0652('0x23')]=function(_0x216a65,_0x2693da){return db[_0x0652('0x43')][_0x0652('0x4c')]({'where':{'id':_0x216a65['params']['id']}})[_0x0652('0x22')](handleEntityNotFound(_0x2693da,null))[_0x0652('0x22')](removeEntity(_0x2693da,null))[_0x0652('0x49')](handleError(_0x2693da,null));};exports['test']=function(_0x3a68e6,_0x41b413,_0x18391e){var _0x409525;return db[_0x0652('0x43')][_0x0652('0x4c')]({'where':{'id':_0x3a68e6[_0x0652('0x4b')]['id']},'attributes':['id',_0x0652('0x54')]})[_0x0652('0x22')](handleEntityNotFound(_0x41b413,null))['then'](function(_0x204c4a){if(_0x204c4a){var _0x14587d=require(_0x0652('0x55'))();_0x14587d['openSync'](_0x204c4a[_0x0652('0x54')]);_0x14587d['closeSync']();return _0x204c4a;}})[_0x0652('0x22')](respondWithResult(_0x41b413,null))['catch'](handleError(_0x41b413,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 26e1a13..dd82f89 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 _0x45a4=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','SquareOdbc'];(function(_0xed7c70,_0x1e59ce){var _0x971ddb=function(_0x52f83e){while(--_0x52f83e){_0xed7c70['push'](_0xed7c70['shift']());}};_0x971ddb(++_0x1e59ce);}(_0x45a4,0xf3));var _0x445a=function(_0x2465f4,_0x250223){_0x2465f4=_0x2465f4-0x0;var _0x2c326d=_0x45a4[_0x2465f4];return _0x2c326d;};'use strict';var _=require(_0x445a('0x0'));var util=require(_0x445a('0x1'));var logger=require('../../config/logger')(_0x445a('0x2'));var moment=require(_0x445a('0x3'));var BPromise=require(_0x445a('0x4'));var rp=require(_0x445a('0x5'));var fs=require('fs');var path=require(_0x445a('0x6'));var rimraf=require('rimraf');var config=require(_0x445a('0x7'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x500e8e,_0x3d3626){return _0x500e8e['define'](_0x445a('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9642=['bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','api','moment'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x9642,0xbf));var _0x2964=function(_0x36e56a,_0x23c0bd){_0x36e56a=_0x36e56a-0x0;var _0x4ee3c5=_0x9642[_0x36e56a];return _0x4ee3c5;};'use strict';var _=require(_0x2964('0x0'));var util=require(_0x2964('0x1'));var logger=require('../../config/logger')(_0x2964('0x2'));var moment=require(_0x2964('0x3'));var BPromise=require(_0x2964('0x4'));var rp=require(_0x2964('0x5'));var fs=require('fs');var path=require(_0x2964('0x6'));var rimraf=require(_0x2964('0x7'));var config=require(_0x2964('0x8'));var attributes=require(_0x2964('0x9'));module[_0x2964('0xa')]=function(_0x2171f8,_0x544450){return _0x2171f8[_0x2964('0xb')](_0x2964('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 50f243e..04d9c16 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 _0x59b5=['ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x59b5,0x9f));var _0x559b=function(_0x305f96,_0x17dc65){_0x305f96=_0x305f96-0x0;var _0x4ca5ee=_0x59b5[_0x305f96];return _0x4ca5ee;};'use strict';var _=require(_0x559b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x559b('0x1'));var rs=require(_0x559b('0x2'));var fs=require('fs');var Redis=require(_0x559b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x559b('0x4'))(_0x559b('0x5'));var config=require(_0x559b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x559b('0x7')][_0x559b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc68f98,_0x36449a,_0xd10f21){return new BPromise(function(_0x5232f4,_0x157545){return client[_0x559b('0x9')](_0xc68f98,_0xd10f21)[_0x559b('0xa')](function(_0x5b5c25){logger[_0x559b('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x36449a,_0x559b('0xc'));logger[_0x559b('0xd')](_0x559b('0xe'),_0x36449a,_0x559b('0xc'),JSON[_0x559b('0xf')](_0x5b5c25));if(_0x5b5c25[_0x559b('0x10')]){if(_0x5b5c25[_0x559b('0x10')]['code']===0x1f4){logger[_0x559b('0x10')](_0x559b('0x11'),_0x36449a,_0x5b5c25[_0x559b('0x10')][_0x559b('0x12')]);return _0x157545(_0x5b5c25[_0x559b('0x10')]['message']);}logger[_0x559b('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x36449a,_0x5b5c25[_0x559b('0x10')]['message']);return _0x5232f4(_0x5b5c25['error'][_0x559b('0x12')]);}else{logger[_0x559b('0xb')](_0x559b('0x11'),_0x36449a,_0x559b('0xc'));_0x5232f4(_0x5b5c25[_0x559b('0x13')][_0x559b('0x12')]);}})[_0x559b('0x14')](function(_0x4e099f){logger[_0x559b('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x36449a,_0x4e099f);_0x157545(_0x4e099f);});});}exports[_0x559b('0x15')]=function(_0xd907c){var _0x169858=this;return new Promise(function(_0x1dc1a0,_0x4ca9f0){return db[_0x559b('0x16')]['find']({'raw':_0xd907c[_0x559b('0x17')]?_0xd907c[_0x559b('0x17')][_0x559b('0x18')]===undefined?!![]:![]:!![],'where':_0xd907c[_0x559b('0x17')]?_0xd907c[_0x559b('0x17')][_0x559b('0x19')]||null:null,'attributes':_0xd907c['options']?_0xd907c[_0x559b('0x17')][_0x559b('0x1a')]||null:null,'include':_0xd907c[_0x559b('0x17')]?_0xd907c['options'][_0x559b('0x1b')]?_[_0x559b('0x1c')](_0xd907c[_0x559b('0x17')][_0x559b('0x1b')],function(_0x3eb5fc){return{'model':db[_0x3eb5fc[_0x559b('0x1d')]],'as':_0x3eb5fc['as'],'attributes':_0x3eb5fc[_0x559b('0x1a')],'include':_0x3eb5fc[_0x559b('0x1b')]?_[_0x559b('0x1c')](_0x3eb5fc[_0x559b('0x1b')],function(_0x7c4fec){return{'model':db[_0x7c4fec[_0x559b('0x1d')]],'as':_0x7c4fec['as'],'attributes':_0x7c4fec['attributes'],'include':_0x7c4fec[_0x559b('0x1b')]?_[_0x559b('0x1c')](_0x7c4fec[_0x559b('0x1b')],function(_0x447dea){return{'model':db[_0x447dea[_0x559b('0x1d')]],'as':_0x447dea['as'],'attributes':_0x447dea[_0x559b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x559b('0xa')](function(_0x4d3778){logger[_0x559b('0xb')]('ShowSquareOdbc',_0xd907c);logger['debug'](_0x559b('0x15'),_0xd907c,JSON[_0x559b('0xf')](_0x4d3778));_0x1dc1a0(_0x4d3778);})['catch'](function(_0x634682){logger[_0x559b('0x10')](_0x559b('0x15'),_0x634682[_0x559b('0x12')],_0xd907c);_0x4ca9f0(_0x169858['error'](0x1f4,_0x634682[_0x559b('0x12')]));});});}; \ No newline at end of file +var _0x0acc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','attributes','model','moment','bluebird','randomstring'];(function(_0xacbfa5,_0xfe352){var _0x5a8a3d=function(_0x28d101){while(--_0x28d101){_0xacbfa5['push'](_0xacbfa5['shift']());}};_0x5a8a3d(++_0xfe352);}(_0x0acc,0x81));var _0xc0ac=function(_0x42c903,_0x5c81bc){_0x42c903=_0x42c903-0x0;var _0xcfd717=_0x0acc[_0x42c903];return _0xcfd717;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc0ac('0x0'));var BPromise=require(_0xc0ac('0x1'));var rs=require(_0xc0ac('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc0ac('0x3'));var logger=require(_0xc0ac('0x4'))(_0xc0ac('0x5'));var config=require(_0xc0ac('0x6'));var jayson=require(_0xc0ac('0x7'));var client=jayson[_0xc0ac('0x8')][_0xc0ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x359d8d,_0x293e07,_0x56247a){return new BPromise(function(_0x3bfa75,_0x2fba84){return client[_0xc0ac('0xa')](_0x359d8d,_0x56247a)[_0xc0ac('0xb')](function(_0x51db23){logger[_0xc0ac('0xc')](_0xc0ac('0xd'),_0x293e07,_0xc0ac('0xe'));logger[_0xc0ac('0xf')](_0xc0ac('0x10'),_0x293e07,_0xc0ac('0xe'),JSON[_0xc0ac('0x11')](_0x51db23));if(_0x51db23[_0xc0ac('0x12')]){if(_0x51db23[_0xc0ac('0x12')][_0xc0ac('0x13')]===0x1f4){logger[_0xc0ac('0x12')](_0xc0ac('0xd'),_0x293e07,_0x51db23['error']['message']);return _0x2fba84(_0x51db23[_0xc0ac('0x12')][_0xc0ac('0x14')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x293e07,_0x51db23[_0xc0ac('0x12')][_0xc0ac('0x14')]);return _0x3bfa75(_0x51db23[_0xc0ac('0x12')][_0xc0ac('0x14')]);}else{logger[_0xc0ac('0xc')](_0xc0ac('0xd'),_0x293e07,_0xc0ac('0xe'));_0x3bfa75(_0x51db23[_0xc0ac('0x15')][_0xc0ac('0x14')]);}})[_0xc0ac('0x16')](function(_0x2c8080){logger[_0xc0ac('0x12')](_0xc0ac('0xd'),_0x293e07,_0x2c8080);_0x2fba84(_0x2c8080);});});}exports[_0xc0ac('0x17')]=function(_0x419e49){var _0x36c26a=this;return new Promise(function(_0x390f95,_0x32d387){return db[_0xc0ac('0x18')][_0xc0ac('0x19')]({'raw':_0x419e49[_0xc0ac('0x1a')]?_0x419e49[_0xc0ac('0x1a')][_0xc0ac('0x1b')]===undefined?!![]:![]:!![],'where':_0x419e49[_0xc0ac('0x1a')]?_0x419e49[_0xc0ac('0x1a')][_0xc0ac('0x1c')]||null:null,'attributes':_0x419e49[_0xc0ac('0x1a')]?_0x419e49['options']['attributes']||null:null,'include':_0x419e49[_0xc0ac('0x1a')]?_0x419e49[_0xc0ac('0x1a')][_0xc0ac('0x1d')]?_[_0xc0ac('0x1e')](_0x419e49[_0xc0ac('0x1a')]['include'],function(_0xb2b993){return{'model':db[_0xb2b993['model']],'as':_0xb2b993['as'],'attributes':_0xb2b993[_0xc0ac('0x1f')],'include':_0xb2b993[_0xc0ac('0x1d')]?_[_0xc0ac('0x1e')](_0xb2b993[_0xc0ac('0x1d')],function(_0x3e3d5a){return{'model':db[_0x3e3d5a[_0xc0ac('0x20')]],'as':_0x3e3d5a['as'],'attributes':_0x3e3d5a[_0xc0ac('0x1f')],'include':_0x3e3d5a['include']?_[_0xc0ac('0x1e')](_0x3e3d5a[_0xc0ac('0x1d')],function(_0x425086){return{'model':db[_0x425086[_0xc0ac('0x20')]],'as':_0x425086['as'],'attributes':_0x425086[_0xc0ac('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0ac('0xb')](function(_0x42d72e){logger[_0xc0ac('0xc')](_0xc0ac('0x17'),_0x419e49);logger[_0xc0ac('0xf')]('ShowSquareOdbc',_0x419e49,JSON[_0xc0ac('0x11')](_0x42d72e));_0x390f95(_0x42d72e);})[_0xc0ac('0x16')](function(_0x3fb763){logger[_0xc0ac('0x12')](_0xc0ac('0x17'),_0x3fb763[_0xc0ac('0x14')],_0x419e49);_0x32d387(_0x36c26a[_0xc0ac('0x12')](0x1f4,_0x3fb763[_0xc0ac('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 38e3036..fc8f3ce 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 _0x5484=['index','/:id','show','isAuthenticated','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5484,0x1a0));var _0x4548=function(_0x42f143,_0x344195){_0x42f143=_0x42f143-0x0;var _0x2c0c30=_0x5484[_0x42f143];return _0x2c0c30;};'use strict';var multer=require(_0x4548('0x0'));var util=require(_0x4548('0x1'));var path=require(_0x4548('0x2'));var timeout=require(_0x4548('0x3'));var express=require(_0x4548('0x4'));var router=express[_0x4548('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4548('0x6'));var interaction=require(_0x4548('0x7'));var config=require('../../config/environment');var controller=require(_0x4548('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4548('0x9')]);router['get'](_0x4548('0xa'),auth['isAuthenticated'](),controller[_0x4548('0xb')]);router['post']('/',auth[_0x4548('0xc')](),controller[_0x4548('0xd')]);router[_0x4548('0xe')](_0x4548('0xa'),auth[_0x4548('0xc')](),controller[_0x4548('0xf')]);router['delete'](_0x4548('0xa'),auth['isAuthenticated'](),controller[_0x4548('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2fa2=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','update','delete','destroy','exports'];(function(_0x293215,_0x4079b4){var _0x1100be=function(_0x19108d){while(--_0x19108d){_0x293215['push'](_0x293215['shift']());}};_0x1100be(++_0x4079b4);}(_0x2fa2,0x77));var _0x22fa=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x2fa2[_0x2cd1fb];return _0x48fd2b;};'use strict';var multer=require(_0x22fa('0x0'));var util=require(_0x22fa('0x1'));var path=require(_0x22fa('0x2'));var timeout=require(_0x22fa('0x3'));var express=require(_0x22fa('0x4'));var router=express['Router']();var fs_extra=require(_0x22fa('0x5'));var auth=require(_0x22fa('0x6'));var interaction=require(_0x22fa('0x7'));var config=require(_0x22fa('0x8'));var controller=require('./squareProject.controller');router[_0x22fa('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x22fa('0xa'),auth[_0x22fa('0xb')](),controller['show']);router[_0x22fa('0xc')]('/',auth[_0x22fa('0xb')](),controller['create']);router['put'](_0x22fa('0xa'),auth[_0x22fa('0xb')](),controller[_0x22fa('0xd')]);router[_0x22fa('0xe')](_0x22fa('0xa'),auth[_0x22fa('0xb')](),controller[_0x22fa('0xf')]);module[_0x22fa('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9906788..ea4ea97 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 _0x858c=['BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','STRING','TEXT'];(function(_0x4ad734,_0x2c4f94){var _0xb8b812=function(_0x41a438){while(--_0x41a438){_0x4ad734['push'](_0x4ad734['shift']());}};_0xb8b812(++_0x2c4f94);}(_0x858c,0x17e));var _0xc858=function(_0x2cbca6,_0x261d37){_0x2cbca6=_0x2cbca6-0x0;var _0x2be35e=_0x858c[_0x2cbca6];return _0x2be35e;};'use strict';var Sequelize=require(_0xc858('0x0'));module['exports']={'name':{'type':Sequelize[_0xc858('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xc858('0x2')]},'preproduction':{'type':Sequelize[_0xc858('0x3')]('long'),'get':function(){if(this[_0xc858('0x4')]('preproduction')){return this['getDataValue'](_0xc858('0x5'))[_0xc858('0x6')](_0xc858('0x7'));}}},'production':{'type':Sequelize[_0xc858('0x3')](_0xc858('0x8')),'get':function(){if(this[_0xc858('0x4')](_0xc858('0x9'))){return this[_0xc858('0x4')](_0xc858('0x9'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xc858('0xa')]},'publishedAt':{'type':Sequelize[_0xc858('0xa')]}}; \ No newline at end of file +var _0x40bd=['preproduction','utf8','production','DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue'];(function(_0x323fce,_0x410404){var _0x529771=function(_0x2e0d80){while(--_0x2e0d80){_0x323fce['push'](_0x323fce['shift']());}};_0x529771(++_0x410404);}(_0x40bd,0x1d2));var _0xd40b=function(_0x38a88c,_0x249b05){_0x38a88c=_0x38a88c-0x0;var _0x37e1a9=_0x40bd[_0x38a88c];return _0x37e1a9;};'use strict';var Sequelize=require(_0xd40b('0x0'));module[_0xd40b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd40b('0x2')]},'notes':{'type':Sequelize[_0xd40b('0x3')]},'preproduction':{'type':Sequelize[_0xd40b('0x4')](_0xd40b('0x5')),'get':function(){if(this[_0xd40b('0x6')](_0xd40b('0x7'))){return this[_0xd40b('0x6')](_0xd40b('0x7'))['toString'](_0xd40b('0x8'));}}},'production':{'type':Sequelize[_0xd40b('0x4')](_0xd40b('0x5')),'get':function(){if(this['getDataValue'](_0xd40b('0x9'))){return this['getDataValue'](_0xd40b('0x9'))['toString'](_0xd40b('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd40b('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index af6a05b..b789168 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 _0xa9c6=['get','SquareProjects','UserProfileResource','publish','stringify','end','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','agi','lodash','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','json','offset','undefined','count','limit','Content-Range','then','destroy'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xa9c6,0x7b));var _0x6a9c=function(_0x15f306,_0x4b7328){_0x15f306=_0x15f306-0x0;var _0x2138bb=_0xa9c6[_0x15f306];return _0x2138bb;};'use strict';var _=require(_0x6a9c('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x6a9c('0x1'))(_0x6a9c('0x2'));var config=require('../../config/environment');var db=require(_0x6a9c('0x3'))['db'];config['redis']=_[_0x6a9c('0x4')](config[_0x6a9c('0x5')],{'host':_0x6a9c('0x6'),'port':0x18eb});var socket=require(_0x6a9c('0x7'))(new Redis(config[_0x6a9c('0x5')]));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x143762,_0x2dba05){_0x2dba05=_0x2dba05||0xc8;return function(_0x1b543a){if(_0x1b543a){return _0x143762[_0x6a9c('0x8')](_0x2dba05)[_0x6a9c('0x9')](_0x1b543a);}};}function respondWithFilteredResult(_0x20869f,_0x31cc27){return function(_0x27567c){if(_0x27567c){var _0x3f318b=typeof _0x31cc27[_0x6a9c('0xa')]===_0x6a9c('0xb')&&typeof _0x31cc27['limit']===_0x6a9c('0xb');var _0x9b18b9=_0x27567c[_0x6a9c('0xc')];var _0x305ee1=_0x3f318b?0x0:_0x31cc27[_0x6a9c('0xa')];var _0x240cd6=_0x3f318b?_0x27567c[_0x6a9c('0xc')]:_0x31cc27[_0x6a9c('0xa')]+_0x31cc27[_0x6a9c('0xd')];var _0x88c1e4;if(_0x240cd6>=_0x9b18b9){_0x240cd6=_0x9b18b9;_0x88c1e4=0xc8;}else{_0x88c1e4=0xce;}_0x20869f[_0x6a9c('0x8')](_0x88c1e4);return _0x20869f['set'](_0x6a9c('0xe'),_0x305ee1+'-'+_0x240cd6+'/'+_0x9b18b9)[_0x6a9c('0x9')](_0x27567c);}return null;};}function saveUpdates(_0x5539d0){return function(_0x1ab323){if(_0x1ab323){return _0x1ab323['update'](_0x5539d0)[_0x6a9c('0xf')](function(_0x9b336a){return _0x9b336a;});}return null;};}function removeEntity(_0x1f5714){return function(_0x1fa05e){if(_0x1fa05e){return _0x1fa05e[_0x6a9c('0x10')]()[_0x6a9c('0xf')](function(){var _0x569e26=_0x1fa05e[_0x6a9c('0x11')]({'plain':!![]});var _0x4fb569=_0x6a9c('0x12');return db[_0x6a9c('0x13')][_0x6a9c('0x10')]({'where':{'type':_0x4fb569,'resourceId':_0x569e26['id']}})['then'](function(){return _0x1fa05e;});})['then'](function(){var _0x2e9bf7=new Redis(config[_0x6a9c('0x5')]);_0x2e9bf7[_0x6a9c('0x14')]('agi',JSON[_0x6a9c('0x15')]({'id':_0x1fa05e['id'],'deleted':!![]}));})['then'](function(){_0x1f5714[_0x6a9c('0x8')](0xcc)[_0x6a9c('0x16')]();});}};}function handleEntityNotFound(_0x2e6b){return function(_0x33be54){if(!_0x33be54){_0x2e6b['sendStatus'](0x194);}return _0x33be54;};}function handleError(_0x2cabe2,_0x2f7f44){_0x2f7f44=_0x2f7f44||0x1f4;return function(_0x48b651){logger[_0x6a9c('0x17')](_0x48b651[_0x6a9c('0x18')]);if(_0x48b651[_0x6a9c('0x19')]){delete _0x48b651['name'];}_0x2cabe2['status'](_0x2f7f44)[_0x6a9c('0x1a')](_0x48b651);};}exports[_0x6a9c('0x1b')]=function(_0x4886de,_0x4643ed){var _0x3863ba={},_0x1d4483={},_0x4b6f30={'count':0x0,'rows':[]};var _0x2117ad=_[_0x6a9c('0x1c')](db[_0x6a9c('0x1d')][_0x6a9c('0x1e')],function(_0x1eaea3){return{'name':_0x1eaea3[_0x6a9c('0x1f')],'type':_0x1eaea3[_0x6a9c('0x20')]['key']};});_0x1d4483[_0x6a9c('0x21')]=_[_0x6a9c('0x1c')](_0x2117ad,_0x6a9c('0x19'));_0x1d4483[_0x6a9c('0x22')]=_[_0x6a9c('0x23')](_0x4886de[_0x6a9c('0x22')]);_0x1d4483[_0x6a9c('0x24')]=_[_0x6a9c('0x25')](_0x1d4483[_0x6a9c('0x21')],_0x1d4483[_0x6a9c('0x22')]);_0x3863ba[_0x6a9c('0x26')]=_[_0x6a9c('0x25')](_0x1d4483[_0x6a9c('0x21')],qs[_0x6a9c('0x27')](_0x4886de[_0x6a9c('0x22')][_0x6a9c('0x27')]));_0x3863ba[_0x6a9c('0x26')]=_0x3863ba[_0x6a9c('0x26')][_0x6a9c('0x28')]?_0x3863ba[_0x6a9c('0x26')]:_0x1d4483[_0x6a9c('0x21')];if(!_0x4886de[_0x6a9c('0x22')][_0x6a9c('0x29')](_0x6a9c('0x2a'))){_0x3863ba[_0x6a9c('0xd')]=qs[_0x6a9c('0xd')](_0x4886de[_0x6a9c('0x22')][_0x6a9c('0xd')]);_0x3863ba[_0x6a9c('0xa')]=qs[_0x6a9c('0xa')](_0x4886de[_0x6a9c('0x22')]['offset']);}_0x3863ba[_0x6a9c('0x2b')]=qs[_0x6a9c('0x2c')](_0x4886de[_0x6a9c('0x22')]['sort']);_0x3863ba[_0x6a9c('0x2d')]=qs['filters'](_[_0x6a9c('0x2e')](_0x4886de[_0x6a9c('0x22')],_0x1d4483[_0x6a9c('0x24')]),_0x2117ad);if(_0x4886de[_0x6a9c('0x22')][_0x6a9c('0x2f')]){_0x3863ba[_0x6a9c('0x2d')]=_[_0x6a9c('0x30')](_0x3863ba[_0x6a9c('0x2d')],{'$or':_[_0x6a9c('0x1c')](_0x2117ad,function(_0x56a31e){if(_0x56a31e[_0x6a9c('0x20')]!==_0x6a9c('0x31')){var _0x5e1791={};_0x5e1791[_0x56a31e[_0x6a9c('0x19')]]={'$like':'%'+_0x4886de['query'][_0x6a9c('0x2f')]+'%'};return _0x5e1791;}})});}_0x3863ba=_[_0x6a9c('0x30')]({},_0x3863ba,_0x4886de[_0x6a9c('0x32')]);var _0x34314a={'where':_0x3863ba[_0x6a9c('0x2d')]};return db[_0x6a9c('0x1d')][_0x6a9c('0xc')](_0x34314a)['then'](function(_0x49a635){_0x4b6f30['count']=_0x49a635;if(_0x4886de[_0x6a9c('0x22')][_0x6a9c('0x33')]){_0x3863ba['include']=[{'all':!![]}];}return db[_0x6a9c('0x1d')][_0x6a9c('0x34')](_0x3863ba);})[_0x6a9c('0xf')](function(_0x462ab4){_0x4b6f30[_0x6a9c('0x35')]=_0x462ab4;return _0x4b6f30;})[_0x6a9c('0xf')](respondWithFilteredResult(_0x4643ed,_0x3863ba))[_0x6a9c('0x36')](handleError(_0x4643ed,null));};exports[_0x6a9c('0x37')]=function(_0x3a9783,_0x291c8e){var _0x390559={'raw':![],'where':{'id':_0x3a9783[_0x6a9c('0x38')]['id']}},_0x374b1d={};_0x374b1d[_0x6a9c('0x21')]=_[_0x6a9c('0x23')](db['SquareProject']['rawAttributes']);_0x374b1d[_0x6a9c('0x22')]=_[_0x6a9c('0x23')](_0x3a9783['query']);_0x374b1d[_0x6a9c('0x24')]=_[_0x6a9c('0x25')](_0x374b1d['model'],_0x374b1d['query']);_0x390559[_0x6a9c('0x26')]=_[_0x6a9c('0x25')](_0x374b1d[_0x6a9c('0x21')],qs[_0x6a9c('0x27')](_0x3a9783[_0x6a9c('0x22')][_0x6a9c('0x27')]));_0x390559[_0x6a9c('0x26')]=_0x390559[_0x6a9c('0x26')][_0x6a9c('0x28')]?_0x390559['attributes']:_0x374b1d[_0x6a9c('0x21')];if(_0x3a9783[_0x6a9c('0x22')][_0x6a9c('0x33')]){_0x390559[_0x6a9c('0x39')]=[{'all':!![]}];}_0x390559=_[_0x6a9c('0x30')]({},_0x390559,_0x3a9783[_0x6a9c('0x32')]);return db[_0x6a9c('0x1d')][_0x6a9c('0x3a')](_0x390559)['then'](handleEntityNotFound(_0x291c8e,null))[_0x6a9c('0xf')](respondWithResult(_0x291c8e,null))[_0x6a9c('0x36')](handleError(_0x291c8e,null));};exports['create']=function(_0x21f20f,_0x37768d){return db[_0x6a9c('0x1d')][_0x6a9c('0x3b')](_0x21f20f[_0x6a9c('0x3c')],{})[_0x6a9c('0xf')](function(_0x59246b){var _0xb1b9da=_0x21f20f[_0x6a9c('0x3d')][_0x6a9c('0x11')]({'plain':!![]});if(!_0xb1b9da)throw new Error(_0x6a9c('0x3e'));if(_0xb1b9da[_0x6a9c('0x3f')]==='user'){var _0x233376=_0x59246b[_0x6a9c('0x11')]({'plain':!![]});var _0x47f78e='SquareProjects';return db[_0x6a9c('0x40')][_0x6a9c('0x3a')]({'where':{'name':_0x47f78e,'userProfileId':_0xb1b9da[_0x6a9c('0x41')]},'raw':!![]})[_0x6a9c('0xf')](function(_0x4fbc3c){if(_0x4fbc3c&&_0x4fbc3c[_0x6a9c('0x42')]===0x0){return db['UserProfileResource']['create']({'name':_0x233376[_0x6a9c('0x19')],'resourceId':_0x233376['id'],'type':_0x4fbc3c[_0x6a9c('0x19')],'sectionId':_0x4fbc3c['id']},{})[_0x6a9c('0xf')](function(){return _0x59246b;});}else{return _0x59246b;}})['catch'](function(_0x551d1d){logger[_0x6a9c('0x17')](_0x6a9c('0x43'),_0x551d1d);throw _0x551d1d;});}return _0x59246b;})[_0x6a9c('0xf')](respondWithResult(_0x37768d,0xc9))[_0x6a9c('0x36')](handleError(_0x37768d,null));};exports[_0x6a9c('0x44')]=function(_0x39f3e0,_0x362dc6){if(_0x39f3e0[_0x6a9c('0x3c')]['id']){delete _0x39f3e0[_0x6a9c('0x3c')]['id'];}return db[_0x6a9c('0x1d')][_0x6a9c('0x3a')]({'where':{'id':_0x39f3e0[_0x6a9c('0x38')]['id']}})[_0x6a9c('0xf')](handleEntityNotFound(_0x362dc6,null))[_0x6a9c('0xf')](saveUpdates(_0x39f3e0[_0x6a9c('0x3c')],null))[_0x6a9c('0xf')](function(_0x1f9011){if(!_0x1f9011)return;var _0x442659=_0x1f9011[_0x6a9c('0x11')]({'plain':!![]});return _0x442659;})[_0x6a9c('0xf')](function(_0x262fd6){var _0x3e8c05=new Redis(config['redis']);_0x3e8c05['publish'](_0x6a9c('0x45'),JSON[_0x6a9c('0x15')](_[_0x6a9c('0x2e')](_0x262fd6,['id','name','production'])));return _0x262fd6;})[_0x6a9c('0xf')](respondWithResult(_0x362dc6,null))['catch'](handleError(_0x362dc6,null));};exports[_0x6a9c('0x10')]=function(_0x32f1fc,_0x429de2){return db[_0x6a9c('0x1d')]['find']({'where':{'id':_0x32f1fc['params']['id']}})['then'](handleEntityNotFound(_0x429de2,null))['then'](removeEntity(_0x429de2,null))[_0x6a9c('0x36')](handleError(_0x429de2,null));}; \ No newline at end of file +var _0x0eff=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','rows','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','userProfileId','autoAssociation','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','UserProfileResource','publish','agi','stringify','sendStatus','error','name','index','SquareProject','rawAttributes','fieldName','type','key','model','map','query','filters','intersection'];(function(_0x4257cf,_0x3cd364){var _0x5394a3=function(_0x3ae4da){while(--_0x3ae4da){_0x4257cf['push'](_0x4257cf['shift']());}};_0x5394a3(++_0x3cd364);}(_0x0eff,0xe5));var _0xf0ef=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x0eff[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0xf0ef('0x0'));var Redis=require(_0xf0ef('0x1'));var qs=require(_0xf0ef('0x2'));var logger=require(_0xf0ef('0x3'))(_0xf0ef('0x4'));var config=require(_0xf0ef('0x5'));var db=require(_0xf0ef('0x6'))['db'];config[_0xf0ef('0x7')]=_['defaults'](config[_0xf0ef('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xf0ef('0x8'))(new Redis(config[_0xf0ef('0x7')]));require('./squareProject.socket')[_0xf0ef('0x9')](socket);function respondWithResult(_0x44c9a7,_0x5b6237){_0x5b6237=_0x5b6237||0xc8;return function(_0x27efa7){if(_0x27efa7){return _0x44c9a7[_0xf0ef('0xa')](_0x5b6237)['json'](_0x27efa7);}};}function respondWithFilteredResult(_0x44bda7,_0x1dfd6d){return function(_0x106b97){if(_0x106b97){var _0x4ddbd8=typeof _0x1dfd6d[_0xf0ef('0xb')]===_0xf0ef('0xc')&&typeof _0x1dfd6d[_0xf0ef('0xd')]===_0xf0ef('0xc');var _0x4cae86=_0x106b97[_0xf0ef('0xe')];var _0xdd2b5d=_0x4ddbd8?0x0:_0x1dfd6d[_0xf0ef('0xb')];var _0x4c6381=_0x4ddbd8?_0x106b97['count']:_0x1dfd6d[_0xf0ef('0xb')]+_0x1dfd6d[_0xf0ef('0xd')];var _0x4bb101;if(_0x4c6381>=_0x4cae86){_0x4c6381=_0x4cae86;_0x4bb101=0xc8;}else{_0x4bb101=0xce;}_0x44bda7[_0xf0ef('0xa')](_0x4bb101);return _0x44bda7['set'](_0xf0ef('0xf'),_0xdd2b5d+'-'+_0x4c6381+'/'+_0x4cae86)[_0xf0ef('0x10')](_0x106b97);}return null;};}function saveUpdates(_0x3a7533){return function(_0x3ca17e){if(_0x3ca17e){return _0x3ca17e[_0xf0ef('0x11')](_0x3a7533)[_0xf0ef('0x12')](function(_0x54a2ea){return _0x54a2ea;});}return null;};}function removeEntity(_0x521bc6){return function(_0x1df04b){if(_0x1df04b){return _0x1df04b[_0xf0ef('0x13')]()[_0xf0ef('0x12')](function(){var _0x5c5a4b=_0x1df04b[_0xf0ef('0x14')]({'plain':!![]});var _0x89c390='SquareProjects';return db[_0xf0ef('0x15')]['destroy']({'where':{'type':_0x89c390,'resourceId':_0x5c5a4b['id']}})['then'](function(){return _0x1df04b;});})[_0xf0ef('0x12')](function(){var _0x2a2a31=new Redis(config[_0xf0ef('0x7')]);_0x2a2a31[_0xf0ef('0x16')](_0xf0ef('0x17'),JSON[_0xf0ef('0x18')]({'id':_0x1df04b['id'],'deleted':!![]}));})['then'](function(){_0x521bc6[_0xf0ef('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0e22){return function(_0x2cd8eb){if(!_0x2cd8eb){_0x4e0e22[_0xf0ef('0x19')](0x194);}return _0x2cd8eb;};}function handleError(_0x1c0a3a,_0xbaa458){_0xbaa458=_0xbaa458||0x1f4;return function(_0x2f1616){logger[_0xf0ef('0x1a')](_0x2f1616['stack']);if(_0x2f1616[_0xf0ef('0x1b')]){delete _0x2f1616[_0xf0ef('0x1b')];}_0x1c0a3a['status'](_0xbaa458)['send'](_0x2f1616);};}exports[_0xf0ef('0x1c')]=function(_0x3f1738,_0x119bb9){var _0x82449c={},_0x4cbcaf={},_0x2b34ae={'count':0x0,'rows':[]};var _0x3929b1=_['map'](db[_0xf0ef('0x1d')][_0xf0ef('0x1e')],function(_0x1c85bb){return{'name':_0x1c85bb[_0xf0ef('0x1f')],'type':_0x1c85bb[_0xf0ef('0x20')][_0xf0ef('0x21')]};});_0x4cbcaf[_0xf0ef('0x22')]=_[_0xf0ef('0x23')](_0x3929b1,_0xf0ef('0x1b'));_0x4cbcaf[_0xf0ef('0x24')]=_['keys'](_0x3f1738['query']);_0x4cbcaf[_0xf0ef('0x25')]=_[_0xf0ef('0x26')](_0x4cbcaf[_0xf0ef('0x22')],_0x4cbcaf[_0xf0ef('0x24')]);_0x82449c[_0xf0ef('0x27')]=_[_0xf0ef('0x26')](_0x4cbcaf[_0xf0ef('0x22')],qs[_0xf0ef('0x28')](_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0x28')]));_0x82449c[_0xf0ef('0x27')]=_0x82449c[_0xf0ef('0x27')][_0xf0ef('0x29')]?_0x82449c[_0xf0ef('0x27')]:_0x4cbcaf['model'];if(!_0x3f1738['query'][_0xf0ef('0x2a')](_0xf0ef('0x2b'))){_0x82449c[_0xf0ef('0xd')]=qs[_0xf0ef('0xd')](_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0xd')]);_0x82449c['offset']=qs['offset'](_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0xb')]);}_0x82449c[_0xf0ef('0x2c')]=qs['sort'](_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0x2d')]);_0x82449c['where']=qs[_0xf0ef('0x25')](_['pick'](_0x3f1738[_0xf0ef('0x24')],_0x4cbcaf[_0xf0ef('0x25')]),_0x3929b1);if(_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0x2e')]){_0x82449c[_0xf0ef('0x2f')]=_[_0xf0ef('0x30')](_0x82449c['where'],{'$or':_['map'](_0x3929b1,function(_0x4c2bbd){if(_0x4c2bbd[_0xf0ef('0x20')]!=='VIRTUAL'){var _0x25fd37={};_0x25fd37[_0x4c2bbd[_0xf0ef('0x1b')]]={'$like':'%'+_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0x2e')]+'%'};return _0x25fd37;}})});}_0x82449c=_[_0xf0ef('0x30')]({},_0x82449c,_0x3f1738[_0xf0ef('0x31')]);var _0x48f596={'where':_0x82449c[_0xf0ef('0x2f')]};return db[_0xf0ef('0x1d')][_0xf0ef('0xe')](_0x48f596)['then'](function(_0x422f00){_0x2b34ae[_0xf0ef('0xe')]=_0x422f00;if(_0x3f1738[_0xf0ef('0x24')][_0xf0ef('0x32')]){_0x82449c['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x82449c);})[_0xf0ef('0x12')](function(_0x3a9675){_0x2b34ae[_0xf0ef('0x33')]=_0x3a9675;return _0x2b34ae;})[_0xf0ef('0x12')](respondWithFilteredResult(_0x119bb9,_0x82449c))[_0xf0ef('0x34')](handleError(_0x119bb9,null));};exports[_0xf0ef('0x35')]=function(_0x48969b,_0x78cb2b){var _0x5d1af={'raw':![],'where':{'id':_0x48969b[_0xf0ef('0x36')]['id']}},_0x34b542={};_0x34b542[_0xf0ef('0x22')]=_[_0xf0ef('0x37')](db['SquareProject'][_0xf0ef('0x1e')]);_0x34b542[_0xf0ef('0x24')]=_['keys'](_0x48969b[_0xf0ef('0x24')]);_0x34b542[_0xf0ef('0x25')]=_[_0xf0ef('0x26')](_0x34b542['model'],_0x34b542['query']);_0x5d1af['attributes']=_[_0xf0ef('0x26')](_0x34b542['model'],qs[_0xf0ef('0x28')](_0x48969b[_0xf0ef('0x24')][_0xf0ef('0x28')]));_0x5d1af[_0xf0ef('0x27')]=_0x5d1af[_0xf0ef('0x27')][_0xf0ef('0x29')]?_0x5d1af[_0xf0ef('0x27')]:_0x34b542[_0xf0ef('0x22')];if(_0x48969b[_0xf0ef('0x24')][_0xf0ef('0x32')]){_0x5d1af[_0xf0ef('0x38')]=[{'all':!![]}];}_0x5d1af=_[_0xf0ef('0x30')]({},_0x5d1af,_0x48969b[_0xf0ef('0x31')]);return db[_0xf0ef('0x1d')][_0xf0ef('0x39')](_0x5d1af)[_0xf0ef('0x12')](handleEntityNotFound(_0x78cb2b,null))[_0xf0ef('0x12')](respondWithResult(_0x78cb2b,null))[_0xf0ef('0x34')](handleError(_0x78cb2b,null));};exports[_0xf0ef('0x3a')]=function(_0x1741e9,_0x3d9dc8){return db['SquareProject'][_0xf0ef('0x3a')](_0x1741e9[_0xf0ef('0x3b')],{})[_0xf0ef('0x12')](function(_0x464279){var _0x41b3d2=_0x1741e9[_0xf0ef('0x3c')][_0xf0ef('0x14')]({'plain':!![]});if(!_0x41b3d2)throw new Error(_0xf0ef('0x3d'));if(_0x41b3d2[_0xf0ef('0x3e')]==='user'){var _0xfe0001=_0x464279[_0xf0ef('0x14')]({'plain':!![]});var _0x39ce00=_0xf0ef('0x3f');return db['UserProfileSection'][_0xf0ef('0x39')]({'where':{'name':_0x39ce00,'userProfileId':_0x41b3d2[_0xf0ef('0x40')]},'raw':!![]})['then'](function(_0x4a45fd){if(_0x4a45fd&&_0x4a45fd[_0xf0ef('0x41')]===0x0){return db[_0xf0ef('0x15')][_0xf0ef('0x3a')]({'name':_0xfe0001[_0xf0ef('0x1b')],'resourceId':_0xfe0001['id'],'type':_0x4a45fd[_0xf0ef('0x1b')],'sectionId':_0x4a45fd['id']},{})['then'](function(){return _0x464279;});}else{return _0x464279;}})[_0xf0ef('0x34')](function(_0x20b5e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20b5e5);throw _0x20b5e5;});}return _0x464279;})[_0xf0ef('0x12')](respondWithResult(_0x3d9dc8,0xc9))['catch'](handleError(_0x3d9dc8,null));};exports[_0xf0ef('0x11')]=function(_0x31feaa,_0x171975){if(_0x31feaa[_0xf0ef('0x3b')]['id']){delete _0x31feaa[_0xf0ef('0x3b')]['id'];}return db['SquareProject'][_0xf0ef('0x39')]({'where':{'id':_0x31feaa[_0xf0ef('0x36')]['id']}})['then'](handleEntityNotFound(_0x171975,null))[_0xf0ef('0x12')](saveUpdates(_0x31feaa[_0xf0ef('0x3b')],null))[_0xf0ef('0x12')](function(_0xb6a336){if(!_0xb6a336)return;var _0xf2e64f=_0xb6a336['get']({'plain':!![]});return _0xf2e64f;})[_0xf0ef('0x12')](function(_0x23f90f){var _0x1e19f0=new Redis(config[_0xf0ef('0x7')]);_0x1e19f0[_0xf0ef('0x16')]('agi',JSON[_0xf0ef('0x18')](_['pick'](_0x23f90f,['id',_0xf0ef('0x1b'),_0xf0ef('0x42')])));return _0x23f90f;})[_0xf0ef('0x12')](respondWithResult(_0x171975,null))['catch'](handleError(_0x171975,null));};exports[_0xf0ef('0x13')]=function(_0x37764b,_0x4138bb){return db[_0xf0ef('0x1d')][_0xf0ef('0x39')]({'where':{'id':_0x37764b[_0xf0ef('0x36')]['id']}})['then'](handleEntityNotFound(_0x4138bb,null))[_0xf0ef('0x12')](removeEntity(_0x4138bb,null))[_0xf0ef('0x34')](handleError(_0x4138bb,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 2edb4b8..9ce4b48 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 _0x16f3=['update','emit','hasOwnProperty','hook','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x14a3cf,_0xae014f){var _0x5bcffb=function(_0x45fdad){while(--_0x45fdad){_0x14a3cf['push'](_0x14a3cf['shift']());}};_0x5bcffb(++_0xae014f);}(_0x16f3,0x11c));var _0x316f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16f3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x316f('0x0'))['db'][_0x316f('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x316f('0x2')](0x0);var events={'afterCreate':_0x316f('0x3'),'afterUpdate':_0x316f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53e0a8){return function(_0x3fc53a,_0x79d090,_0x2ab352){SquareProjectEvents['emit'](_0x53e0a8+':'+_0x3fc53a['id'],_0x3fc53a);SquareProjectEvents[_0x316f('0x5')](_0x53e0a8,_0x3fc53a);_0x2ab352(null);};}for(var e in events){if(events[_0x316f('0x6')](e)){var event=events[e];SquareProject[_0x316f('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xf54a=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xf54a,0x129));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xaf54('0x0'));var SquareProject=require(_0xaf54('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xaf54('0x2')](0x0);var events={'afterCreate':_0xaf54('0x3'),'afterUpdate':_0xaf54('0x4'),'afterDestroy':_0xaf54('0x5')};function emitEvent(_0x240ba5){return function(_0x23989c,_0x225b31,_0x33bbb9){SquareProjectEvents[_0xaf54('0x6')](_0x240ba5+':'+_0x23989c['id'],_0x23989c);SquareProjectEvents[_0xaf54('0x6')](_0x240ba5,_0x23989c);_0x33bbb9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xaf54('0x7')](e,emitEvent(event));}}module[_0xaf54('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4526e5b..7e1d1dc 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 _0x6c66=['../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x134ce6,_0x420433){var _0x3e52a1=function(_0x4bff88){while(--_0x4bff88){_0x134ce6['push'](_0x134ce6['shift']());}};_0x3e52a1(++_0x420433);}(_0x6c66,0x175));var _0x66c6=function(_0xd04b83,_0x456f09){_0xd04b83=_0xd04b83-0x0;var _0x44b162=_0x6c66[_0xd04b83];return _0x44b162;};'use strict';var _=require(_0x66c6('0x0'));var util=require(_0x66c6('0x1'));var logger=require(_0x66c6('0x2'))(_0x66c6('0x3'));var moment=require(_0x66c6('0x4'));var BPromise=require(_0x66c6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c6('0x6'));var config=require(_0x66c6('0x7'));var attributes=require('./squareProject.attributes');module[_0x66c6('0x8')]=function(_0x159a52,_0x2caf27){return _0x159a52[_0x66c6('0x9')](_0x66c6('0xa'),attributes,{'tableName':_0x66c6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eddf8,_0x262f7c,_0x39821e){if(_0x5eddf8[_0x66c6('0xc')](_0x66c6('0xd'))){_0x5eddf8[_0x66c6('0xe')]=moment()[_0x66c6('0xf')](_0x66c6('0x10'));}if(_0x5eddf8[_0x66c6('0xc')](_0x66c6('0x11'))){_0x5eddf8[_0x66c6('0x12')]=moment()[_0x66c6('0xf')](_0x66c6('0x10'));}_0x39821e(null,_0x5eddf8);}}});}; \ No newline at end of file +var _0xebfe=['./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xebfe,0x15e));var _0xeebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebfe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeebf('0x0'));var util=require(_0xeebf('0x1'));var logger=require(_0xeebf('0x2'))(_0xeebf('0x3'));var moment=require('moment');var BPromise=require(_0xeebf('0x4'));var rp=require(_0xeebf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeebf('0x6'));var config=require('../../config/environment');var attributes=require(_0xeebf('0x7'));module['exports']=function(_0x228c03,_0x5ae677){return _0x228c03[_0xeebf('0x8')](_0xeebf('0x9'),attributes,{'tableName':_0xeebf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55e6a4,_0x3eabb6,_0x94c206){if(_0x55e6a4[_0xeebf('0xb')](_0xeebf('0xc'))){_0x55e6a4[_0xeebf('0xd')]=moment()[_0xeebf('0xe')](_0xeebf('0xf'));}if(_0x55e6a4[_0xeebf('0xb')]('production')){_0x55e6a4[_0xeebf('0x10')]=moment()[_0xeebf('0xe')](_0xeebf('0xf'));}_0x94c206(null,_0x55e6a4);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 664c0c2..1e44f63 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 _0xb903=['redis','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','options','raw','where','attributes','limit','include','map','model','info','error','ShowSquareProject','SquareProject','find','then','debug','stringify','message','lodash','ioredis','../../mysqldb','rpc'];(function(_0x4c3bff,_0x670a24){var _0x4ff8f2=function(_0x1865c3){while(--_0x1865c3){_0x4c3bff['push'](_0x4c3bff['shift']());}};_0x4ff8f2(++_0x670a24);}(_0xb903,0x1c7));var _0x3b90=function(_0x57f528,_0x50c9a6){_0x57f528=_0x57f528-0x0;var _0x2f5fd9=_0xb903[_0x57f528];return _0x2f5fd9;};'use strict';var _=require(_0x3b90('0x0'));var Redis=require(_0x3b90('0x1'));var db=require(_0x3b90('0x2'))['db'];var logger=require('../../config/logger')(_0x3b90('0x3'));var config=require('../../config/environment');config[_0x3b90('0x4')]=_['defaults'](config[_0x3b90('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b90('0x5'))(new Redis(config['redis']));require(_0x3b90('0x6'))[_0x3b90('0x7')](socket);exports[_0x3b90('0x8')]=function(_0x282e47){var _0x4e3af8=this;return new Promise(function(_0x25a6c6,_0xa7556b){return db['SquareProject'][_0x3b90('0x9')]({'raw':_0x282e47[_0x3b90('0xa')]?_0x282e47[_0x3b90('0xa')][_0x3b90('0xb')]===undefined?!![]:![]:!![],'where':_0x282e47['options']?_0x282e47[_0x3b90('0xa')][_0x3b90('0xc')]||null:null,'attributes':_0x282e47[_0x3b90('0xa')]?_0x282e47[_0x3b90('0xa')][_0x3b90('0xd')]||null:null,'limit':_0x282e47[_0x3b90('0xa')]?_0x282e47[_0x3b90('0xa')][_0x3b90('0xe')]||null:null,'include':_0x282e47[_0x3b90('0xa')]?_0x282e47[_0x3b90('0xa')][_0x3b90('0xf')]?_['map'](_0x282e47['options'][_0x3b90('0xf')],function(_0x1f6a8b){return{'model':db[_0x1f6a8b['model']],'as':_0x1f6a8b['as'],'attributes':_0x1f6a8b[_0x3b90('0xd')],'include':_0x1f6a8b[_0x3b90('0xf')]?_[_0x3b90('0x10')](_0x1f6a8b[_0x3b90('0xf')],function(_0x2a2bca){return{'model':db[_0x2a2bca[_0x3b90('0x11')]],'as':_0x2a2bca['as'],'attributes':_0x2a2bca[_0x3b90('0xd')],'include':_0x2a2bca[_0x3b90('0xf')]?_['map'](_0x2a2bca[_0x3b90('0xf')],function(_0x59024b){return{'model':db[_0x59024b[_0x3b90('0x11')]],'as':_0x59024b['as'],'attributes':_0x59024b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b1b56){logger[_0x3b90('0x12')]('GetSquareProjects',_0x282e47);logger['debug'](_0x3b90('0x8'),_0x282e47,JSON['stringify'](_0x5b1b56));_0x25a6c6(_0x5b1b56);})['catch'](function(_0x2060dd){logger['error'](_0x3b90('0x8'),_0x2060dd['message'],_0x282e47);_0xa7556b(_0x4e3af8[_0x3b90('0x13')](0x1f4,_0x2060dd['message']));});});};exports[_0x3b90('0x14')]=function(_0x441521){var _0x154a2d=this;return new Promise(function(_0x27cd29,_0x565d9f){return db[_0x3b90('0x15')][_0x3b90('0x16')]({'raw':_0x441521[_0x3b90('0xa')]?_0x441521['options']['raw']===undefined?!![]:![]:!![],'where':_0x441521[_0x3b90('0xa')]?_0x441521[_0x3b90('0xa')]['where']||null:null,'attributes':_0x441521[_0x3b90('0xa')]?_0x441521['options'][_0x3b90('0xd')]||null:null,'include':_0x441521[_0x3b90('0xa')]?_0x441521[_0x3b90('0xa')][_0x3b90('0xf')]?_[_0x3b90('0x10')](_0x441521[_0x3b90('0xa')][_0x3b90('0xf')],function(_0xc1d28b){return{'model':db[_0xc1d28b['model']],'as':_0xc1d28b['as'],'attributes':_0xc1d28b[_0x3b90('0xd')],'include':_0xc1d28b[_0x3b90('0xf')]?_['map'](_0xc1d28b['include'],function(_0x357c1a){return{'model':db[_0x357c1a[_0x3b90('0x11')]],'as':_0x357c1a['as'],'attributes':_0x357c1a[_0x3b90('0xd')],'include':_0x357c1a[_0x3b90('0xf')]?_[_0x3b90('0x10')](_0x357c1a[_0x3b90('0xf')],function(_0x3e8c01){return{'model':db[_0x3e8c01['model']],'as':_0x3e8c01['as'],'attributes':_0x3e8c01['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b90('0x17')](function(_0x2f19a8){logger[_0x3b90('0x12')](_0x3b90('0x14'),_0x441521);logger[_0x3b90('0x18')](_0x3b90('0x14'),_0x441521,JSON[_0x3b90('0x19')](_0x2f19a8));_0x27cd29(_0x2f19a8);})['catch'](function(_0x46bbc1){logger[_0x3b90('0x13')]('ShowSquareProject',_0x46bbc1['message'],_0x441521);_0x565d9f(_0x154a2d[_0x3b90('0x13')](0x1f4,_0x46bbc1[_0x3b90('0x1a')]));});});}; \ No newline at end of file +var _0x1dd8=['SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','catch','message','error','ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','GetSquareProjects'];(function(_0x269269,_0x33b06b){var _0x581190=function(_0x26fb5d){while(--_0x26fb5d){_0x269269['push'](_0x269269['shift']());}};_0x581190(++_0x33b06b);}(_0x1dd8,0x1f3));var _0x81dd=function(_0xe1f858,_0xb86c44){_0xe1f858=_0xe1f858-0x0;var _0x367af6=_0x1dd8[_0xe1f858];return _0x367af6;};'use strict';var _=require(_0x81dd('0x0'));var Redis=require(_0x81dd('0x1'));var db=require(_0x81dd('0x2'))['db'];var logger=require(_0x81dd('0x3'))(_0x81dd('0x4'));var config=require(_0x81dd('0x5'));config[_0x81dd('0x6')]=_[_0x81dd('0x7')](config['redis'],{'host':_0x81dd('0x8'),'port':0x18eb});var socket=require(_0x81dd('0x9'))(new Redis(config[_0x81dd('0x6')]));require('./squareProject.socket')['register'](socket);exports[_0x81dd('0xa')]=function(_0x4e7573){var _0x10e124=this;return new Promise(function(_0x16e2bf,_0x5dd1f2){return db[_0x81dd('0xb')][_0x81dd('0xc')]({'raw':_0x4e7573['options']?_0x4e7573[_0x81dd('0xd')][_0x81dd('0xe')]===undefined?!![]:![]:!![],'where':_0x4e7573[_0x81dd('0xd')]?_0x4e7573[_0x81dd('0xd')][_0x81dd('0xf')]||null:null,'attributes':_0x4e7573[_0x81dd('0xd')]?_0x4e7573[_0x81dd('0xd')][_0x81dd('0x10')]||null:null,'limit':_0x4e7573[_0x81dd('0xd')]?_0x4e7573['options'][_0x81dd('0x11')]||null:null,'include':_0x4e7573[_0x81dd('0xd')]?_0x4e7573['options']['include']?_[_0x81dd('0x12')](_0x4e7573['options'][_0x81dd('0x13')],function(_0x174efe){return{'model':db[_0x174efe['model']],'as':_0x174efe['as'],'attributes':_0x174efe[_0x81dd('0x10')],'include':_0x174efe[_0x81dd('0x13')]?_[_0x81dd('0x12')](_0x174efe[_0x81dd('0x13')],function(_0x28d3e5){return{'model':db[_0x28d3e5[_0x81dd('0x14')]],'as':_0x28d3e5['as'],'attributes':_0x28d3e5[_0x81dd('0x10')],'include':_0x28d3e5[_0x81dd('0x13')]?_[_0x81dd('0x12')](_0x28d3e5[_0x81dd('0x13')],function(_0x54c904){return{'model':db[_0x54c904[_0x81dd('0x14')]],'as':_0x54c904['as'],'attributes':_0x54c904['attributes']};}):[]};}):[]};}):[]:[]})[_0x81dd('0x15')](function(_0x20c383){logger[_0x81dd('0x16')](_0x81dd('0xa'),_0x4e7573);logger[_0x81dd('0x17')](_0x81dd('0xa'),_0x4e7573,JSON[_0x81dd('0x18')](_0x20c383));_0x16e2bf(_0x20c383);})[_0x81dd('0x19')](function(_0x133e7e){logger['error'](_0x81dd('0xa'),_0x133e7e[_0x81dd('0x1a')],_0x4e7573);_0x5dd1f2(_0x10e124[_0x81dd('0x1b')](0x1f4,_0x133e7e[_0x81dd('0x1a')]));});});};exports[_0x81dd('0x1c')]=function(_0x284292){var _0x7ca555=this;return new Promise(function(_0x3a95fb,_0x4929ae){return db[_0x81dd('0xb')][_0x81dd('0x1d')]({'raw':_0x284292[_0x81dd('0xd')]?_0x284292['options'][_0x81dd('0xe')]===undefined?!![]:![]:!![],'where':_0x284292[_0x81dd('0xd')]?_0x284292[_0x81dd('0xd')][_0x81dd('0xf')]||null:null,'attributes':_0x284292[_0x81dd('0xd')]?_0x284292['options'][_0x81dd('0x10')]||null:null,'include':_0x284292[_0x81dd('0xd')]?_0x284292['options']['include']?_[_0x81dd('0x12')](_0x284292['options'][_0x81dd('0x13')],function(_0x16b7d2){return{'model':db[_0x16b7d2[_0x81dd('0x14')]],'as':_0x16b7d2['as'],'attributes':_0x16b7d2['attributes'],'include':_0x16b7d2[_0x81dd('0x13')]?_[_0x81dd('0x12')](_0x16b7d2[_0x81dd('0x13')],function(_0x51e36f){return{'model':db[_0x51e36f[_0x81dd('0x14')]],'as':_0x51e36f['as'],'attributes':_0x51e36f[_0x81dd('0x10')],'include':_0x51e36f[_0x81dd('0x13')]?_[_0x81dd('0x12')](_0x51e36f['include'],function(_0x50df39){return{'model':db[_0x50df39['model']],'as':_0x50df39['as'],'attributes':_0x50df39[_0x81dd('0x10')]};}):[]};}):[]};}):[]:[]})[_0x81dd('0x15')](function(_0x63be1b){logger['info'](_0x81dd('0x1c'),_0x284292);logger['debug'](_0x81dd('0x1c'),_0x284292,JSON[_0x81dd('0x18')](_0x63be1b));_0x3a95fb(_0x63be1b);})[_0x81dd('0x19')](function(_0x278489){logger[_0x81dd('0x1b')](_0x81dd('0x1c'),_0x278489[_0x81dd('0x1a')],_0x284292);_0x4929ae(_0x7ca555[_0x81dd('0x1b')](0x1f4,_0x278489[_0x81dd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 84b8ab9..e7aefa4 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 _0x9e88=['squareProject:','./squareProject.events','remove','update','emit','removeListener','register','length'];(function(_0x47bbf5,_0x147480){var _0x15a0b8=function(_0xe84468){while(--_0xe84468){_0x47bbf5['push'](_0x47bbf5['shift']());}};_0x15a0b8(++_0x147480);}(_0x9e88,0x1d9));var _0x89e8=function(_0x38c65b,_0x5a6a7a){_0x38c65b=_0x38c65b-0x0;var _0xa4f985=_0x9e88[_0x38c65b];return _0xa4f985;};'use strict';var SquareProjectEvents=require(_0x89e8('0x0'));var events=['save',_0x89e8('0x1'),_0x89e8('0x2')];function createListener(_0x389ec3,_0xaed26f){return function(_0x5a0c52){_0xaed26f[_0x89e8('0x3')](_0x389ec3,_0x5a0c52);};}function removeListener(_0x371ec7,_0x41aacd){return function(){SquareProjectEvents[_0x89e8('0x4')](_0x371ec7,_0x41aacd);};}exports[_0x89e8('0x5')]=function(_0x22a02b){for(var _0x5ad301=0x0,_0xfe3157=events[_0x89e8('0x6')];_0x5ad301<_0xfe3157;_0x5ad301++){var _0x2bc5ed=events[_0x5ad301];var _0x1dd1b5=createListener(_0x89e8('0x7')+_0x2bc5ed,_0x22a02b);SquareProjectEvents['on'](_0x2bc5ed,_0x1dd1b5);}}; \ No newline at end of file +var _0xb51c=['remove','emit','removeListener','register','./squareProject.events','save'];(function(_0x176231,_0x2097bc){var _0x18c45d=function(_0x21c517){while(--_0x21c517){_0x176231['push'](_0x176231['shift']());}};_0x18c45d(++_0x2097bc);}(_0xb51c,0x124));var _0xcb51=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xb51c[_0x12d033];return _0x3b4e80;};'use strict';var SquareProjectEvents=require(_0xcb51('0x0'));var events=[_0xcb51('0x1'),_0xcb51('0x2'),'update'];function createListener(_0x33a309,_0x2c6fa2){return function(_0x156702){_0x2c6fa2[_0xcb51('0x3')](_0x33a309,_0x156702);};}function removeListener(_0x21a9bb,_0x5ccc59){return function(){SquareProjectEvents[_0xcb51('0x4')](_0x21a9bb,_0x5ccc59);};}exports[_0xcb51('0x5')]=function(_0x21eddd){for(var _0x53c8d4=0x0,_0x1a4e37=events['length'];_0x53c8d4<_0x1a4e37;_0x53c8d4++){var _0x5f58f6=events[_0x53c8d4];var _0x59cb86=createListener('squareProject:'+_0x5f58f6,_0x21eddd);SquareProjectEvents['on'](_0x5f58f6,_0x59cb86);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index d700820..8d88c19 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 _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x43bc4b,_0x1a1938){var _0x4700bd=function(_0x230ecb){while(--_0x230ecb){_0x43bc4b['push'](_0x43bc4b['shift']());}};_0x4700bd(++_0x1a1938);}(_0xf494,0x1c6));var _0x4f49=function(_0x5e0448,_0x3db6f2){_0x5e0448=_0x5e0448-0x0;var _0xdec316=_0xf494[_0x5e0448];return _0xdec316;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x2d03a4,_0x7d77c3){var _0x122c0c=function(_0x5791ad){while(--_0x5791ad){_0x2d03a4['push'](_0x2d03a4['shift']());}};_0x122c0c(++_0x7d77c3);}(_0x7a54,0x106));var _0x47a5=function(_0x3a3a50,_0x56f66e){_0x3a3a50=_0x3a3a50-0x0;var _0x274bd=_0x7a54[_0x3a3a50];return _0x274bd;};'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('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 9d35a6f..7ae3282 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 _0x9c5a=['getDataValue','savePath','lastIndexOf','sequelize','exports','STRING','VIRTUAL'];(function(_0x49db5c,_0x2b4f98){var _0x5bed3f=function(_0x3b2916){while(--_0x3b2916){_0x49db5c['push'](_0x49db5c['shift']());}};_0x5bed3f(++_0x2b4f98);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x12e703,_0x4dbfa5){_0x12e703=_0x12e703-0x0;var _0xd8e44e=_0x9c5a[_0x12e703];return _0xd8e44e;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa9c5('0x2')]},'calleridname':{'type':Sequelize[_0xa9c5('0x2')]},'context':{'type':Sequelize[_0xa9c5('0x2')]},'extension':{'type':Sequelize[_0xa9c5('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa9c5('0x2')]},'dnid':{'type':Sequelize[_0xa9c5('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xa9c5('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xa9c5('0x2')]},'format':{'type':Sequelize[_0xa9c5('0x3')],'get':function(){var _0x4cb597='';var _0x4b6db6=this[_0xa9c5('0x4')](_0xa9c5('0x5'));if(_0x4b6db6){_0x4cb597=_0x4b6db6['substring'](_0x4b6db6[_0xa9c5('0x6')]('.'));}return _0x4cb597;}}}; \ No newline at end of file +var _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0x5dd1c7,_0x4660f2){var _0x474128=function(_0x5594e8){while(--_0x5594e8){_0x5dd1c7['push'](_0x5dd1c7['shift']());}};_0x474128(++_0x4660f2);}(_0xae24,0x182));var _0x4ae2=function(_0x22b1d3,_0x513b2a){_0x22b1d3=_0x22b1d3-0x0;var _0x10b162=_0xae24[_0x22b1d3];return _0x10b162;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4ae2('0x1')]},'context':{'type':Sequelize[_0x4ae2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ae2('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4ae2('0x1')]},'saveName':{'type':Sequelize[_0x4ae2('0x1')]},'filename':{'type':Sequelize[_0x4ae2('0x1')]},'savePath':{'type':Sequelize[_0x4ae2('0x1')]},'format':{'type':Sequelize[_0x4ae2('0x2')],'get':function(){var _0x307247='';var _0x4f2e84=this['getDataValue'](_0x4ae2('0x3'));if(_0x4f2e84){_0x307247=_0x4f2e84['substring'](_0x4f2e84['lastIndexOf']('.'));}return _0x307247;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a89b119..4d8005d 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 _0xb8e6=['error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','update','download','../../components/encryptor','uniqueid','find','filename','savePath','%s.cypher','existsSync','decryptFile','recording','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','end'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb8e6,0x9c));var _0x6b8e=function(_0x112d78,_0x12563a){_0x112d78=_0x112d78-0x0;var _0xf7c8c2=_0xb8e6[_0x112d78];return _0xf7c8c2;};'use strict';var emlformat=require(_0x6b8e('0x0'));var rimraf=require(_0x6b8e('0x1'));var zipdir=require(_0x6b8e('0x2'));var jsonpatch=require(_0x6b8e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b8e('0x4'));var Mustache=require(_0x6b8e('0x5'));var util=require(_0x6b8e('0x6'));var path=require('path');var sox=require(_0x6b8e('0x7'));var csv=require('to-csv');var ejs=require(_0x6b8e('0x8'));var fs=require('fs');var fs_extra=require(_0x6b8e('0x9'));var _=require('lodash');var squel=require(_0x6b8e('0xa'));var crypto=require(_0x6b8e('0xb'));var jsforce=require(_0x6b8e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b8e('0xd'));var querystring=require('querystring');var Papa=require(_0x6b8e('0xe'));var Redis=require(_0x6b8e('0xf'));var authService=require(_0x6b8e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6b8e('0x11'));var hardwareService=require(_0x6b8e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6b8e('0x13'));var config=require(_0x6b8e('0x14'));var licenseUtil=require(_0x6b8e('0x15'));var db=require(_0x6b8e('0x16'))['db'];function respondWithStatusCode(_0x18da8d,_0x4155a8){_0x4155a8=_0x4155a8||0xcc;return function(_0xb880e9){if(_0xb880e9){return _0x18da8d[_0x6b8e('0x17')](_0x4155a8);}return _0x18da8d[_0x6b8e('0x18')](_0x4155a8)['end']();};}function respondWithResult(_0x267a9a,_0x3535b0){_0x3535b0=_0x3535b0||0xc8;return function(_0x34d053){if(_0x34d053){return _0x267a9a[_0x6b8e('0x18')](_0x3535b0)[_0x6b8e('0x19')](_0x34d053);}};}function respondWithFilteredResult(_0x583622,_0x43810b){return function(_0xbec5a7){if(_0xbec5a7){var _0x1b4482=typeof _0x43810b[_0x6b8e('0x1a')]==='undefined'&&typeof _0x43810b[_0x6b8e('0x1b')]===_0x6b8e('0x1c');var _0x135748=_0xbec5a7[_0x6b8e('0x1d')];var _0x1befee=_0x1b4482?0x0:_0x43810b[_0x6b8e('0x1a')];var _0x35778a=_0x1b4482?_0xbec5a7[_0x6b8e('0x1d')]:_0x43810b['offset']+_0x43810b[_0x6b8e('0x1b')];var _0xc8a9d4;if(_0x35778a>=_0x135748){_0x35778a=_0x135748;_0xc8a9d4=0xc8;}else{_0xc8a9d4=0xce;}_0x583622[_0x6b8e('0x18')](_0xc8a9d4);return _0x583622[_0x6b8e('0x1e')](_0x6b8e('0x1f'),_0x1befee+'-'+_0x35778a+'/'+_0x135748)[_0x6b8e('0x19')](_0xbec5a7);}return null;};}function patchUpdates(_0x1bc95d){return function(_0x2c61ee){try{jsonpatch[_0x6b8e('0x20')](_0x2c61ee,_0x1bc95d,!![]);}catch(_0x4b74c1){return BPromise[_0x6b8e('0x21')](_0x4b74c1);}return _0x2c61ee['save']();};}function saveUpdates(_0x363026,_0x5aa974){return function(_0x2903b4){if(_0x2903b4){return _0x2903b4['update'](_0x363026)['then'](function(_0x2ad14e){return _0x2ad14e;});}return null;};}function removeEntity(_0x2b868b,_0x59e1f6){return function(_0x52cd43){if(_0x52cd43){return _0x52cd43[_0x6b8e('0x22')]()['then'](function(){_0x2b868b['status'](0xcc)[_0x6b8e('0x23')]();});}};}function handleEntityNotFound(_0x57b414,_0x50b9c3){return function(_0x228bd4){if(!_0x228bd4){_0x57b414['sendStatus'](0x194);}return _0x228bd4;};}function handleError(_0xabb60a,_0x556692){_0x556692=_0x556692||0x1f4;return function(_0x302525){logger[_0x6b8e('0x24')](_0x302525[_0x6b8e('0x25')]);if(_0x302525[_0x6b8e('0x26')]){delete _0x302525[_0x6b8e('0x26')];}_0xabb60a[_0x6b8e('0x18')](_0x556692)[_0x6b8e('0x27')](_0x302525);};}exports[_0x6b8e('0x28')]=function(_0xd1ff36,_0x52e2d2){var _0x5b43cf={},_0x4f926f={},_0x5835c9={'count':0x0,'rows':[]};var _0x2c4888=_[_0x6b8e('0x29')](db[_0x6b8e('0x2a')][_0x6b8e('0x2b')],function(_0x87b4b2){return{'name':_0x87b4b2[_0x6b8e('0x2c')],'type':_0x87b4b2['type'][_0x6b8e('0x2d')]};});_0x4f926f[_0x6b8e('0x2e')]=_['map'](_0x2c4888,_0x6b8e('0x26'));_0x4f926f[_0x6b8e('0x2f')]=_[_0x6b8e('0x30')](_0xd1ff36[_0x6b8e('0x2f')]);_0x4f926f[_0x6b8e('0x31')]=_['intersection'](_0x4f926f[_0x6b8e('0x2e')],_0x4f926f[_0x6b8e('0x2f')]);_0x5b43cf['attributes']=_[_0x6b8e('0x32')](_0x4f926f[_0x6b8e('0x2e')],qs['fields'](_0xd1ff36[_0x6b8e('0x2f')][_0x6b8e('0x33')]));_0x5b43cf[_0x6b8e('0x34')]=_0x5b43cf[_0x6b8e('0x34')][_0x6b8e('0x35')]?_0x5b43cf[_0x6b8e('0x34')]:_0x4f926f[_0x6b8e('0x2e')];if(!_0xd1ff36[_0x6b8e('0x2f')][_0x6b8e('0x36')](_0x6b8e('0x37'))){_0x5b43cf['limit']=qs[_0x6b8e('0x1b')](_0xd1ff36['query']['limit']);_0x5b43cf[_0x6b8e('0x1a')]=qs['offset'](_0xd1ff36[_0x6b8e('0x2f')][_0x6b8e('0x1a')]);}_0x5b43cf[_0x6b8e('0x38')]=qs[_0x6b8e('0x39')](_0xd1ff36[_0x6b8e('0x2f')][_0x6b8e('0x39')]);_0x5b43cf['where']=qs['filters'](_[_0x6b8e('0x3a')](_0xd1ff36['query'],_0x4f926f['filters']),_0x2c4888);if(_0xd1ff36[_0x6b8e('0x2f')][_0x6b8e('0x3b')]){_0x5b43cf[_0x6b8e('0x3c')]=_[_0x6b8e('0x3d')](_0x5b43cf['where'],{'$or':_[_0x6b8e('0x29')](_0x2c4888,function(_0x428a1c){if(_0x428a1c[_0x6b8e('0x3e')]!=='VIRTUAL'){var _0x35bef1={};_0x35bef1[_0x428a1c[_0x6b8e('0x26')]]={'$like':'%'+_0xd1ff36[_0x6b8e('0x2f')]['filter']+'%'};return _0x35bef1;}})});}_0x5b43cf=_['merge']({},_0x5b43cf,_0xd1ff36[_0x6b8e('0x3f')]);var _0x2ba56d={'where':_0x5b43cf[_0x6b8e('0x3c')]};return db[_0x6b8e('0x2a')][_0x6b8e('0x1d')](_0x2ba56d)[_0x6b8e('0x40')](function(_0x3b2e9f){_0x5835c9[_0x6b8e('0x1d')]=_0x3b2e9f;if(_0xd1ff36[_0x6b8e('0x2f')][_0x6b8e('0x41')]){_0x5b43cf[_0x6b8e('0x42')]=[{'all':!![]}];}return db[_0x6b8e('0x2a')][_0x6b8e('0x43')](_0x5b43cf);})[_0x6b8e('0x40')](function(_0x314dbe){_0x5835c9[_0x6b8e('0x44')]=_0x314dbe;return _0x5835c9;})[_0x6b8e('0x40')](respondWithFilteredResult(_0x52e2d2,_0x5b43cf))[_0x6b8e('0x45')](handleError(_0x52e2d2,null));};exports[_0x6b8e('0x46')]=function(_0x496562,_0x2b08a4){var _0x276c62={'raw':!![],'where':{'id':_0x496562[_0x6b8e('0x47')]['id']}},_0xf3d664={};_0xf3d664[_0x6b8e('0x2e')]=_['keys'](db[_0x6b8e('0x2a')][_0x6b8e('0x2b')]);_0xf3d664[_0x6b8e('0x2f')]=_[_0x6b8e('0x30')](_0x496562[_0x6b8e('0x2f')]);_0xf3d664['filters']=_['intersection'](_0xf3d664[_0x6b8e('0x2e')],_0xf3d664[_0x6b8e('0x2f')]);_0x276c62['attributes']=_[_0x6b8e('0x32')](_0xf3d664[_0x6b8e('0x2e')],qs[_0x6b8e('0x33')](_0x496562[_0x6b8e('0x2f')][_0x6b8e('0x33')]));_0x276c62[_0x6b8e('0x34')]=_0x276c62['attributes'][_0x6b8e('0x35')]?_0x276c62[_0x6b8e('0x34')]:_0xf3d664[_0x6b8e('0x2e')];if(_0x496562[_0x6b8e('0x2f')][_0x6b8e('0x41')]){_0x276c62[_0x6b8e('0x42')]=[{'all':!![]}];}_0x276c62=_[_0x6b8e('0x3d')]({},_0x276c62,_0x496562[_0x6b8e('0x3f')]);return db[_0x6b8e('0x2a')]['find'](_0x276c62)[_0x6b8e('0x40')](handleEntityNotFound(_0x2b08a4,null))[_0x6b8e('0x40')](respondWithResult(_0x2b08a4,null))[_0x6b8e('0x45')](handleError(_0x2b08a4,null));};exports[_0x6b8e('0x48')]=function(_0x33bc78,_0x50de6b){return db[_0x6b8e('0x2a')][_0x6b8e('0x48')](_0x33bc78[_0x6b8e('0x49')],{})[_0x6b8e('0x40')](respondWithResult(_0x50de6b,0xc9))[_0x6b8e('0x45')](handleError(_0x50de6b,null));};exports[_0x6b8e('0x4a')]=function(_0x2d7aa1,_0x5ec80a){if(_0x2d7aa1[_0x6b8e('0x49')]['id']){delete _0x2d7aa1['body']['id'];}return db[_0x6b8e('0x2a')]['find']({'where':{'id':_0x2d7aa1[_0x6b8e('0x47')]['id']}})[_0x6b8e('0x40')](handleEntityNotFound(_0x5ec80a,null))[_0x6b8e('0x40')](saveUpdates(_0x2d7aa1[_0x6b8e('0x49')],null))['then'](respondWithResult(_0x5ec80a,null))['catch'](handleError(_0x5ec80a,null));};exports[_0x6b8e('0x4b')]=function(_0x46fa4b,_0x47930b,_0x152aee){var _0x3fe94c=require(_0x6b8e('0x4c'));var _0x2bdef7=![];var _0x7e9213={};if(_0x46fa4b[_0x6b8e('0x2f')][_0x6b8e('0x3e')]&&_0x46fa4b[_0x6b8e('0x2f')][_0x6b8e('0x3e')]==='uniqueid'){_0x7e9213[_0x6b8e('0x4d')]=_0x46fa4b[_0x6b8e('0x47')]['id'];}else{_0x7e9213['id']=_0x46fa4b[_0x6b8e('0x47')]['id'];}return db['SquareRecording'][_0x6b8e('0x4e')]({'where':_0x7e9213,'attributes':['id','savePath',_0x6b8e('0x4f')],'raw':!![]})[_0x6b8e('0x40')](handleEntityNotFound(_0x47930b,null))[_0x6b8e('0x40')](function(_0x34128e){if(_0x34128e){var _0x580596=_0x34128e[_0x6b8e('0x50')];var _0x4a35f6=util['format'](_0x6b8e('0x51'),_0x580596);if(fs[_0x6b8e('0x52')](_0x4a35f6)){_0x2bdef7=!![];return _0x3fe94c[_0x6b8e('0x53')](_0x4a35f6,_0x580596,config['secrets'][_0x6b8e('0x54')])[_0x6b8e('0x40')](function(){return _0x34128e;});}return _0x34128e;}})['then'](function(_0x505600){if(_0x505600){var _0x16ad76=_0x505600[_0x6b8e('0x50')];if(!fs['existsSync'](_0x16ad76)){throw new db['Sequelize']['ValidationError'](_0x6b8e('0x55'));}if(_0x505600['filename']){return _0x47930b['download'](_0x16ad76,_0x505600['filename']+path[_0x6b8e('0x56')](_0x16ad76),function(){if(_0x2bdef7){fs['unlink'](_0x16ad76);}});}else{return _0x47930b['download'](_0x16ad76,function(_0x327c53){if(_0x2bdef7){fs[_0x6b8e('0x57')](_0x16ad76);}});}}})['catch'](function(_0x5b8f5d){if(_0x5b8f5d[_0x6b8e('0x58')]===_0x6b8e('0x55')){_0x47930b[_0x6b8e('0x18')](0x194)[_0x6b8e('0x27')]('Not\x20found');}else{return handleError(_0x47930b,null);}});};exports[_0x6b8e('0x22')]=function(_0x1cf738,_0x478a8a){return db['SquareRecording'][_0x6b8e('0x4e')]({'where':{'id':_0x1cf738[_0x6b8e('0x47')]['id']}})[_0x6b8e('0x40')](function(_0x28fb80){if(_[_0x6b8e('0x59')](_0x28fb80)){throw new ReferenceError(_0x6b8e('0x5a'));}return _0x28fb80;})[_0x6b8e('0x40')](function(_0x1e0652){var _0x22fc1f=_0x1e0652[_0x6b8e('0x50')];logger[_0x6b8e('0x5b')]('cancellazione\x20fisica\x20documento\x20%s',_0x22fc1f);if(!_[_0x6b8e('0x59')](_0x1e0652[_0x6b8e('0x50')])&&fs['existsSync'](_0x22fc1f)){logger[_0x6b8e('0x5b')]('File:\x20\x22'+_0x22fc1f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6b8e('0x5c')](_0x22fc1f);}_0x22fc1f=_0x22fc1f+_0x6b8e('0x5d');if(!_[_0x6b8e('0x59')](_0x1e0652[_0x6b8e('0x50')])&&fs[_0x6b8e('0x52')](_0x22fc1f)){logger[_0x6b8e('0x5b')](_0x6b8e('0x5e')+_0x22fc1f+_0x6b8e('0x5f'));fs[_0x6b8e('0x5c')](_0x22fc1f);}return _0x1e0652;})[_0x6b8e('0x40')](function(_0x45686a){if(!_0x45686a)throw new InternalError();return _0x45686a[_0x6b8e('0x22')]();})['then'](function(){_0x478a8a[_0x6b8e('0x18')](0xcc)[_0x6b8e('0x23')]();})[_0x6b8e('0x45')](handleError(_0x478a8a,null));}; \ No newline at end of file +var _0x1352=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','show','params','fields','includeAll','find','catch','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','secrets','recording','existsSync','extname','unlink','download','message','SquareRecording\x20not\x20found','Not\x20found','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis'];(function(_0xfe8a00,_0xc826b4){var _0x980e11=function(_0x205f56){while(--_0x205f56){_0xfe8a00['push'](_0xfe8a00['shift']());}};_0x980e11(++_0xc826b4);}(_0x1352,0x114));var _0x2135=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1352[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x2135('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2135('0x1'));var rp=require(_0x2135('0x2'));var moment=require(_0x2135('0x3'));var BPromise=require(_0x2135('0x4'));var Mustache=require(_0x2135('0x5'));var util=require(_0x2135('0x6'));var path=require(_0x2135('0x7'));var sox=require('sox');var csv=require(_0x2135('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2135('0x9'));var _=require(_0x2135('0xa'));var squel=require(_0x2135('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2135('0x8'));var querystring=require(_0x2135('0xc'));var Papa=require(_0x2135('0xd'));var Redis=require(_0x2135('0xe'));var authService=require(_0x2135('0xf'));var qs=require(_0x2135('0x10'));var as=require(_0x2135('0x11'));var hardwareService=require(_0x2135('0x12'));var logger=require('../../config/logger')(_0x2135('0x13'));var utils=require(_0x2135('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2135('0x15'));var db=require(_0x2135('0x16'))['db'];function respondWithStatusCode(_0x33adda,_0x6f6fbc){_0x6f6fbc=_0x6f6fbc||0xcc;return function(_0x4d43a7){if(_0x4d43a7){return _0x33adda[_0x2135('0x17')](_0x6f6fbc);}return _0x33adda[_0x2135('0x18')](_0x6f6fbc)[_0x2135('0x19')]();};}function respondWithResult(_0x3775ef,_0x4e89ba){_0x4e89ba=_0x4e89ba||0xc8;return function(_0x5771dd){if(_0x5771dd){return _0x3775ef[_0x2135('0x18')](_0x4e89ba)[_0x2135('0x1a')](_0x5771dd);}};}function respondWithFilteredResult(_0x4dbdbc,_0x3810d2){return function(_0x39ecfc){if(_0x39ecfc){var _0x56bf4e=typeof _0x3810d2[_0x2135('0x1b')]===_0x2135('0x1c')&&typeof _0x3810d2[_0x2135('0x1d')]===_0x2135('0x1c');var _0x218d90=_0x39ecfc[_0x2135('0x1e')];var _0x591e12=_0x56bf4e?0x0:_0x3810d2[_0x2135('0x1b')];var _0x5dd5ee=_0x56bf4e?_0x39ecfc[_0x2135('0x1e')]:_0x3810d2[_0x2135('0x1b')]+_0x3810d2[_0x2135('0x1d')];var _0x1fc7ce;if(_0x5dd5ee>=_0x218d90){_0x5dd5ee=_0x218d90;_0x1fc7ce=0xc8;}else{_0x1fc7ce=0xce;}_0x4dbdbc[_0x2135('0x18')](_0x1fc7ce);return _0x4dbdbc[_0x2135('0x1f')](_0x2135('0x20'),_0x591e12+'-'+_0x5dd5ee+'/'+_0x218d90)['json'](_0x39ecfc);}return null;};}function patchUpdates(_0x54eb3d){return function(_0x158047){try{jsonpatch['apply'](_0x158047,_0x54eb3d,!![]);}catch(_0x4bfeb5){return BPromise[_0x2135('0x21')](_0x4bfeb5);}return _0x158047[_0x2135('0x22')]();};}function saveUpdates(_0x3378e7,_0x4d3f33){return function(_0x3013c8){if(_0x3013c8){return _0x3013c8[_0x2135('0x23')](_0x3378e7)[_0x2135('0x24')](function(_0x1f6d42){return _0x1f6d42;});}return null;};}function removeEntity(_0x4a895a,_0x24cc14){return function(_0x4ac6fc){if(_0x4ac6fc){return _0x4ac6fc['destroy']()['then'](function(){_0x4a895a[_0x2135('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14ae2d,_0x58e2fc){return function(_0x441a54){if(!_0x441a54){_0x14ae2d[_0x2135('0x17')](0x194);}return _0x441a54;};}function handleError(_0x459255,_0x2f6fdf){_0x2f6fdf=_0x2f6fdf||0x1f4;return function(_0x24c654){logger['error'](_0x24c654['stack']);if(_0x24c654[_0x2135('0x25')]){delete _0x24c654[_0x2135('0x25')];}_0x459255[_0x2135('0x18')](_0x2f6fdf)[_0x2135('0x26')](_0x24c654);};}exports[_0x2135('0x27')]=function(_0x3c7e54,_0x220ce8){var _0x284e2b={},_0x302032={},_0x3a3e68={'count':0x0,'rows':[]};var _0x5f09a1=_[_0x2135('0x28')](db[_0x2135('0x29')][_0x2135('0x2a')],function(_0x100523){return{'name':_0x100523[_0x2135('0x2b')],'type':_0x100523[_0x2135('0x2c')][_0x2135('0x2d')]};});_0x302032['model']=_['map'](_0x5f09a1,_0x2135('0x25'));_0x302032[_0x2135('0x2e')]=_[_0x2135('0x2f')](_0x3c7e54['query']);_0x302032['filters']=_[_0x2135('0x30')](_0x302032[_0x2135('0x31')],_0x302032[_0x2135('0x2e')]);_0x284e2b['attributes']=_[_0x2135('0x30')](_0x302032[_0x2135('0x31')],qs['fields'](_0x3c7e54[_0x2135('0x2e')]['fields']));_0x284e2b[_0x2135('0x32')]=_0x284e2b[_0x2135('0x32')][_0x2135('0x33')]?_0x284e2b[_0x2135('0x32')]:_0x302032['model'];if(!_0x3c7e54[_0x2135('0x2e')][_0x2135('0x34')](_0x2135('0x35'))){_0x284e2b[_0x2135('0x1d')]=qs[_0x2135('0x1d')](_0x3c7e54[_0x2135('0x2e')][_0x2135('0x1d')]);_0x284e2b['offset']=qs['offset'](_0x3c7e54['query'][_0x2135('0x1b')]);}_0x284e2b[_0x2135('0x36')]=qs[_0x2135('0x37')](_0x3c7e54['query'][_0x2135('0x37')]);_0x284e2b['where']=qs[_0x2135('0x38')](_[_0x2135('0x39')](_0x3c7e54[_0x2135('0x2e')],_0x302032[_0x2135('0x38')]),_0x5f09a1);if(_0x3c7e54['query']['filter']){_0x284e2b['where']=_[_0x2135('0x3a')](_0x284e2b[_0x2135('0x3b')],{'$or':_[_0x2135('0x28')](_0x5f09a1,function(_0x83471d){if(_0x83471d[_0x2135('0x2c')]!==_0x2135('0x3c')){var _0xa1379c={};_0xa1379c[_0x83471d[_0x2135('0x25')]]={'$like':'%'+_0x3c7e54[_0x2135('0x2e')][_0x2135('0x3d')]+'%'};return _0xa1379c;}})});}_0x284e2b=_['merge']({},_0x284e2b,_0x3c7e54[_0x2135('0x3e')]);var _0x43632a={'where':_0x284e2b[_0x2135('0x3b')]};return db['SquareRecording'][_0x2135('0x1e')](_0x43632a)[_0x2135('0x24')](function(_0x5aa586){_0x3a3e68[_0x2135('0x1e')]=_0x5aa586;if(_0x3c7e54[_0x2135('0x2e')]['includeAll']){_0x284e2b[_0x2135('0x3f')]=[{'all':!![]}];}return db['SquareRecording'][_0x2135('0x40')](_0x284e2b);})[_0x2135('0x24')](function(_0x3cc306){_0x3a3e68[_0x2135('0x41')]=_0x3cc306;return _0x3a3e68;})[_0x2135('0x24')](respondWithFilteredResult(_0x220ce8,_0x284e2b))['catch'](handleError(_0x220ce8,null));};exports[_0x2135('0x42')]=function(_0x238ec8,_0x4e414d){var _0x1ee18a={'raw':!![],'where':{'id':_0x238ec8[_0x2135('0x43')]['id']}},_0x311921={};_0x311921[_0x2135('0x31')]=_[_0x2135('0x2f')](db[_0x2135('0x29')][_0x2135('0x2a')]);_0x311921[_0x2135('0x2e')]=_[_0x2135('0x2f')](_0x238ec8[_0x2135('0x2e')]);_0x311921[_0x2135('0x38')]=_['intersection'](_0x311921[_0x2135('0x31')],_0x311921[_0x2135('0x2e')]);_0x1ee18a[_0x2135('0x32')]=_[_0x2135('0x30')](_0x311921[_0x2135('0x31')],qs['fields'](_0x238ec8[_0x2135('0x2e')][_0x2135('0x44')]));_0x1ee18a['attributes']=_0x1ee18a[_0x2135('0x32')][_0x2135('0x33')]?_0x1ee18a['attributes']:_0x311921['model'];if(_0x238ec8[_0x2135('0x2e')][_0x2135('0x45')]){_0x1ee18a[_0x2135('0x3f')]=[{'all':!![]}];}_0x1ee18a=_[_0x2135('0x3a')]({},_0x1ee18a,_0x238ec8[_0x2135('0x3e')]);return db['SquareRecording'][_0x2135('0x46')](_0x1ee18a)[_0x2135('0x24')](handleEntityNotFound(_0x4e414d,null))['then'](respondWithResult(_0x4e414d,null))[_0x2135('0x47')](handleError(_0x4e414d,null));};exports[_0x2135('0x48')]=function(_0x287c40,_0x5d014c){return db[_0x2135('0x29')]['create'](_0x287c40[_0x2135('0x49')],{})[_0x2135('0x24')](respondWithResult(_0x5d014c,0xc9))['catch'](handleError(_0x5d014c,null));};exports[_0x2135('0x23')]=function(_0x1f6cf0,_0x9a66b3){if(_0x1f6cf0[_0x2135('0x49')]['id']){delete _0x1f6cf0[_0x2135('0x49')]['id'];}return db[_0x2135('0x29')][_0x2135('0x46')]({'where':{'id':_0x1f6cf0['params']['id']}})[_0x2135('0x24')](handleEntityNotFound(_0x9a66b3,null))[_0x2135('0x24')](saveUpdates(_0x1f6cf0['body'],null))['then'](respondWithResult(_0x9a66b3,null))[_0x2135('0x47')](handleError(_0x9a66b3,null));};exports['download']=function(_0x424bda,_0x17182f,_0x5e8850){var _0x7d7dca=require(_0x2135('0x4a'));var _0x2aaf12=![];var _0x2e982d={};if(_0x424bda[_0x2135('0x2e')]['type']&&_0x424bda[_0x2135('0x2e')]['type']===_0x2135('0x4b')){_0x2e982d[_0x2135('0x4b')]=_0x424bda['params']['id'];}else{_0x2e982d['id']=_0x424bda['params']['id'];}return db[_0x2135('0x29')][_0x2135('0x46')]({'where':_0x2e982d,'attributes':['id',_0x2135('0x4c'),_0x2135('0x4d')],'raw':!![]})[_0x2135('0x24')](handleEntityNotFound(_0x17182f,null))[_0x2135('0x24')](function(_0x273210){if(_0x273210){var _0x24c396=_0x273210[_0x2135('0x4c')];var _0x44476a=util[_0x2135('0x4e')](_0x2135('0x4f'),_0x24c396);if(fs['existsSync'](_0x44476a)){_0x2aaf12=!![];return _0x7d7dca['decryptFile'](_0x44476a,_0x24c396,config[_0x2135('0x50')][_0x2135('0x51')])['then'](function(){return _0x273210;});}return _0x273210;}})[_0x2135('0x24')](function(_0x5358ac){if(_0x5358ac){var _0x3f695a=_0x5358ac['savePath'];if(!fs[_0x2135('0x52')](_0x3f695a)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x5358ac['filename']){return _0x17182f['download'](_0x3f695a,_0x5358ac[_0x2135('0x4d')]+path[_0x2135('0x53')](_0x3f695a),function(){if(_0x2aaf12){fs[_0x2135('0x54')](_0x3f695a);}});}else{return _0x17182f[_0x2135('0x55')](_0x3f695a,function(_0x4c44b6){if(_0x2aaf12){fs[_0x2135('0x54')](_0x3f695a);}});}}})[_0x2135('0x47')](function(_0xc371e){if(_0xc371e[_0x2135('0x56')]===_0x2135('0x57')){_0x17182f[_0x2135('0x18')](0x194)['send'](_0x2135('0x58'));}else{return handleError(_0x17182f,null);}});};exports[_0x2135('0x59')]=function(_0x5b31a7,_0x3f87cd){return db[_0x2135('0x29')][_0x2135('0x46')]({'where':{'id':_0x5b31a7['params']['id']}})['then'](function(_0x5da5b2){if(_['isNil'](_0x5da5b2)){throw new ReferenceError(_0x2135('0x5a'));}return _0x5da5b2;})[_0x2135('0x24')](function(_0x3b757d){var _0x420f21=_0x3b757d['savePath'];logger['info'](_0x2135('0x5b'),_0x420f21);if(!_['isNil'](_0x3b757d[_0x2135('0x4c')])&&fs[_0x2135('0x52')](_0x420f21)){logger['info'](_0x2135('0x5c')+_0x420f21+_0x2135('0x5d'));fs['unlinkSync'](_0x420f21);}_0x420f21=_0x420f21+_0x2135('0x5e');if(!_[_0x2135('0x5f')](_0x3b757d[_0x2135('0x4c')])&&fs['existsSync'](_0x420f21)){logger['info'](_0x2135('0x5c')+_0x420f21+_0x2135('0x5d'));fs[_0x2135('0x60')](_0x420f21);}return _0x3b757d;})[_0x2135('0x24')](function(_0x32ddf2){if(!_0x32ddf2)throw new InternalError();return _0x32ddf2[_0x2135('0x59')]();})['then'](function(){_0x3f87cd['status'](0xcc)[_0x2135('0x19')]();})[_0x2135('0x47')](handleError(_0x3f87cd,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 11671f9..eb96ee3 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 _0x073d=['square_recordings','util','../../config/logger','api','bluebird','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x2155a4,_0x496665){var _0x50099c=function(_0x54aaef){while(--_0x54aaef){_0x2155a4['push'](_0x2155a4['shift']());}};_0x50099c(++_0x496665);}(_0x073d,0xd2));var _0xd073=function(_0x4e7fbe,_0x585460){_0x4e7fbe=_0x4e7fbe-0x0;var _0x2e2277=_0x073d[_0x4e7fbe];return _0x2e2277;};'use strict';var _=require('lodash');var util=require(_0xd073('0x0'));var logger=require(_0xd073('0x1'))(_0xd073('0x2'));var moment=require('moment');var BPromise=require(_0xd073('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd073('0x4'));var rimraf=require(_0xd073('0x5'));var config=require('../../config/environment');var attributes=require(_0xd073('0x6'));module[_0xd073('0x7')]=function(_0x1799b8,_0x1fdaeb){return _0x1799b8[_0xd073('0x8')](_0xd073('0x9'),attributes,{'tableName':_0xd073('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0170=['SquareRecording','square_recordings','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x0170,0x1d6));var _0x0017=function(_0x474827,_0x1927ee){_0x474827=_0x474827-0x0;var _0x499ff5=_0x0170[_0x474827];return _0x499ff5;};'use strict';var _=require(_0x0017('0x0'));var util=require(_0x0017('0x1'));var logger=require('../../config/logger')(_0x0017('0x2'));var moment=require(_0x0017('0x3'));var BPromise=require(_0x0017('0x4'));var rp=require(_0x0017('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0017('0x6'));var config=require(_0x0017('0x7'));var attributes=require(_0x0017('0x8'));module[_0x0017('0x9')]=function(_0x2eaf66,_0x321f6e){return _0x2eaf66[_0x0017('0xa')](_0x0017('0xb'),attributes,{'tableName':_0x0017('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 7f4c48d..bbc6839 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 _0xd77e=['debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','SquareRecording,\x20%s,\x20%s','message','info','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','then'];(function(_0x11de5a,_0xc10c6c){var _0x217f88=function(_0x11c3fa){while(--_0x11c3fa){_0x11de5a['push'](_0x11de5a['shift']());}};_0x217f88(++_0xc10c6c);}(_0xd77e,0x151));var _0xed77=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd77e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed77('0x0'));var BPromise=require(_0xed77('0x1'));var rs=require(_0xed77('0x2'));var fs=require('fs');var Redis=require(_0xed77('0x3'));var db=require(_0xed77('0x4'))['db'];var utils=require(_0xed77('0x5'));var logger=require(_0xed77('0x6'))(_0xed77('0x7'));var config=require(_0xed77('0x8'));var jayson=require(_0xed77('0x9'));var client=jayson[_0xed77('0xa')][_0xed77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ca1fe,_0x4386f7,_0x47142d){return new BPromise(function(_0x119b66,_0x387de7){return client[_0xed77('0xc')](_0x4ca1fe,_0x47142d)['then'](function(_0x25aef4){logger['info']('SquareRecording,\x20%s,\x20%s',_0x4386f7,'request\x20sent');logger['debug'](_0xed77('0xd'),_0x4386f7,_0xed77('0xe'),JSON['stringify'](_0x25aef4));if(_0x25aef4[_0xed77('0xf')]){if(_0x25aef4[_0xed77('0xf')]['code']===0x1f4){logger[_0xed77('0xf')](_0xed77('0x10'),_0x4386f7,_0x25aef4[_0xed77('0xf')]['message']);return _0x387de7(_0x25aef4['error']['message']);}logger[_0xed77('0xf')](_0xed77('0x10'),_0x4386f7,_0x25aef4[_0xed77('0xf')][_0xed77('0x11')]);return _0x119b66(_0x25aef4[_0xed77('0xf')][_0xed77('0x11')]);}else{logger[_0xed77('0x12')](_0xed77('0x10'),_0x4386f7,_0xed77('0xe'));_0x119b66(_0x25aef4[_0xed77('0x13')][_0xed77('0x11')]);}})[_0xed77('0x14')](function(_0x37e6d3){logger[_0xed77('0xf')](_0xed77('0x10'),_0x4386f7,_0x37e6d3);_0x387de7(_0x37e6d3);});});}exports[_0xed77('0x15')]=function(_0x3bfead){var _0x52753f=this;return new Promise(function(_0x1585e0,_0x4b2063){return db[_0xed77('0x16')]['create'](_0x3bfead[_0xed77('0x17')],{'raw':_0x3bfead[_0xed77('0x18')]?_0x3bfead[_0xed77('0x18')][_0xed77('0x19')]===undefined?!![]:![]:!![]})[_0xed77('0x1a')](function(_0x51411e){logger[_0xed77('0x12')](_0xed77('0x15'),_0x3bfead);logger[_0xed77('0x1b')](_0xed77('0x15'),_0x3bfead,JSON['stringify'](_0x51411e));_0x1585e0(_0x51411e);})[_0xed77('0x14')](function(_0x1075b1){logger[_0xed77('0xf')]('CreateSquareRecording',_0x1075b1['message'],_0x3bfead);_0x4b2063(_0x52753f[_0xed77('0xf')](0x1f4,_0x1075b1[_0xed77('0x11')]));});});}; \ No newline at end of file +var _0x30c9=['request\x20sent','stringify','error','message','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x30c9,0x106));var _0x930c=function(_0x1fc2bb,_0xea9465){_0x1fc2bb=_0x1fc2bb-0x0;var _0x15e3fe=_0x30c9[_0x1fc2bb];return _0x15e3fe;};'use strict';var _=require(_0x930c('0x0'));var util=require('util');var moment=require(_0x930c('0x1'));var BPromise=require(_0x930c('0x2'));var rs=require(_0x930c('0x3'));var fs=require('fs');var Redis=require(_0x930c('0x4'));var db=require(_0x930c('0x5'))['db'];var utils=require(_0x930c('0x6'));var logger=require(_0x930c('0x7'))(_0x930c('0x8'));var config=require(_0x930c('0x9'));var jayson=require(_0x930c('0xa'));var client=jayson[_0x930c('0xb')][_0x930c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11b4ca,_0x474895,_0x400ac2){return new BPromise(function(_0x4307f2,_0x14ee74){return client['request'](_0x11b4ca,_0x400ac2)[_0x930c('0xd')](function(_0x428276){logger[_0x930c('0xe')](_0x930c('0xf'),_0x474895,'request\x20sent');logger[_0x930c('0x10')](_0x930c('0x11'),_0x474895,_0x930c('0x12'),JSON[_0x930c('0x13')](_0x428276));if(_0x428276['error']){if(_0x428276['error']['code']===0x1f4){logger[_0x930c('0x14')](_0x930c('0xf'),_0x474895,_0x428276['error'][_0x930c('0x15')]);return _0x14ee74(_0x428276[_0x930c('0x14')][_0x930c('0x15')]);}logger[_0x930c('0x14')]('SquareRecording,\x20%s,\x20%s',_0x474895,_0x428276['error'][_0x930c('0x15')]);return _0x4307f2(_0x428276[_0x930c('0x14')][_0x930c('0x15')]);}else{logger[_0x930c('0xe')](_0x930c('0xf'),_0x474895,_0x930c('0x12'));_0x4307f2(_0x428276['result'][_0x930c('0x15')]);}})[_0x930c('0x16')](function(_0x3bd4f7){logger[_0x930c('0x14')](_0x930c('0xf'),_0x474895,_0x3bd4f7);_0x14ee74(_0x3bd4f7);});});}exports[_0x930c('0x17')]=function(_0x5ebb19){var _0x3a4545=this;return new Promise(function(_0x293bfd,_0x134cef){return db[_0x930c('0x18')]['create'](_0x5ebb19[_0x930c('0x19')],{'raw':_0x5ebb19[_0x930c('0x1a')]?_0x5ebb19[_0x930c('0x1a')][_0x930c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4e65dd){logger[_0x930c('0xe')](_0x930c('0x17'),_0x5ebb19);logger[_0x930c('0x10')]('CreateSquareRecording',_0x5ebb19,JSON[_0x930c('0x13')](_0x4e65dd));_0x293bfd(_0x4e65dd);})[_0x930c('0x16')](function(_0x6cbcd8){logger[_0x930c('0x14')](_0x930c('0x17'),_0x6cbcd8['message'],_0x5ebb19);_0x134cef(_0x3a4545['error'](0x1f4,_0x6cbcd8[_0x930c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 7464a36..148afd9 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(_0x3937ff,_0x5e939c){var _0x249d90=function(_0xc8a6a1){while(--_0xc8a6a1){_0x3937ff['push'](_0x3937ff['shift']());}};_0x249d90(++_0x5e939c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index f587f7f..59f50a4 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 _0x138e=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x421676,_0x56f8fa){var _0x4b5d3d=function(_0x326749){while(--_0x326749){_0x421676['push'](_0x421676['shift']());}};_0x4b5d3d(++_0x56f8fa);}(_0x138e,0x109));var _0xe138=function(_0x337bbd,_0x5f2fa5){_0x337bbd=_0x337bbd-0x0;var _0x4b4767=_0x138e[_0x337bbd];return _0x4b4767;};'use strict';var Sequelize=require(_0xe138('0x0'));module[_0xe138('0x1')]={'network':{'type':Sequelize[_0xe138('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xe138('0x2')]},'channel':{'type':Sequelize[_0xe138('0x2')]},'language':{'type':Sequelize[_0xe138('0x2')]},'type':{'type':Sequelize[_0xe138('0x2')]},'uniqueid':{'type':Sequelize[_0xe138('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe138('0x2')]},'calleridname':{'type':Sequelize[_0xe138('0x2')]},'callingpres':{'type':Sequelize[_0xe138('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xe138('0x2')]},'callingtns':{'type':Sequelize[_0xe138('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xe138('0x2')]},'context':{'type':Sequelize[_0xe138('0x2')]},'extension':{'type':Sequelize[_0xe138('0x2')]},'priority':{'type':Sequelize[_0xe138('0x2')]},'enhanced':{'type':Sequelize[_0xe138('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xe138('0x2')]},'project_name':{'type':Sequelize[_0xe138('0x2')]},'joinAt':{'type':Sequelize[_0xe138('0x3')]},'leaveAt':{'type':Sequelize[_0xe138('0x3')]},'bot':{'type':Sequelize[_0xe138('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf326=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x158c15,_0x250fb4){var _0x28e24c=function(_0x421ff3){while(--_0x421ff3){_0x158c15['push'](_0x158c15['shift']());}};_0x28e24c(++_0x250fb4);}(_0xf326,0xfd));var _0x6f32=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xf326[_0x4e697a];return _0x88850c;};'use strict';var Sequelize=require(_0x6f32('0x0'));module['exports']={'network':{'type':Sequelize[_0x6f32('0x1')]},'network_script':{'type':Sequelize[_0x6f32('0x1')]},'request':{'type':Sequelize[_0x6f32('0x1')]},'channel':{'type':Sequelize[_0x6f32('0x1')]},'language':{'type':Sequelize[_0x6f32('0x1')]},'type':{'type':Sequelize[_0x6f32('0x1')]},'uniqueid':{'type':Sequelize[_0x6f32('0x1')]},'version':{'type':Sequelize[_0x6f32('0x1')]},'callerid':{'type':Sequelize[_0x6f32('0x1')]},'calleridname':{'type':Sequelize[_0x6f32('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x6f32('0x1')]},'callingtns':{'type':Sequelize[_0x6f32('0x1')]},'dnid':{'type':Sequelize[_0x6f32('0x1')]},'rdnis':{'type':Sequelize[_0x6f32('0x1')]},'context':{'type':Sequelize[_0x6f32('0x1')]},'extension':{'type':Sequelize[_0x6f32('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x6f32('0x1')]},'accountcode':{'type':Sequelize[_0x6f32('0x1')]},'threadid':{'type':Sequelize[_0x6f32('0x1')]},'project_name':{'type':Sequelize[_0x6f32('0x1')]},'joinAt':{'type':Sequelize[_0x6f32('0x2')]},'leaveAt':{'type':Sequelize[_0x6f32('0x2')]},'bot':{'type':Sequelize[_0x6f32('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 ee7eb1c..5cd7a40 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 _0x08a5=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','name','send','index','SquareReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','options','include','findAll','catch','show','params','model','length','includeAll','create','update','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x1e68ef,_0xbbdc1f){var _0xf5cc5a=function(_0x506e05){while(--_0x506e05){_0x1e68ef['push'](_0x1e68ef['shift']());}};_0xf5cc5a(++_0xbbdc1f);}(_0x08a5,0x19b));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x508a('0x0'));var rimraf=require(_0x508a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x508a('0x2'));var rp=require('request-promise');var moment=require(_0x508a('0x3'));var BPromise=require(_0x508a('0x4'));var Mustache=require('mustache');var util=require(_0x508a('0x5'));var path=require(_0x508a('0x6'));var sox=require('sox');var csv=require(_0x508a('0x7'));var ejs=require(_0x508a('0x8'));var fs=require('fs');var fs_extra=require(_0x508a('0x9'));var _=require(_0x508a('0xa'));var squel=require(_0x508a('0xb'));var crypto=require(_0x508a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x508a('0x7'));var querystring=require(_0x508a('0xd'));var Papa=require(_0x508a('0xe'));var Redis=require(_0x508a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x508a('0x10'));var as=require(_0x508a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x508a('0x12'));var utils=require(_0x508a('0x13'));var config=require(_0x508a('0x14'));var licenseUtil=require(_0x508a('0x15'));var db=require(_0x508a('0x16'))['db'];function respondWithStatusCode(_0x49c6d4,_0x577e9d){_0x577e9d=_0x577e9d||0xcc;return function(_0x4bfb56){if(_0x4bfb56){return _0x49c6d4[_0x508a('0x17')](_0x577e9d);}return _0x49c6d4[_0x508a('0x18')](_0x577e9d)[_0x508a('0x19')]();};}function respondWithResult(_0x4e2567,_0x1d1213){_0x1d1213=_0x1d1213||0xc8;return function(_0x40ae40){if(_0x40ae40){return _0x4e2567[_0x508a('0x18')](_0x1d1213)[_0x508a('0x1a')](_0x40ae40);}};}function respondWithFilteredResult(_0x1be416,_0x4c4d32){return function(_0x5bdeff){if(_0x5bdeff){var _0x241c89=typeof _0x4c4d32[_0x508a('0x1b')]===_0x508a('0x1c')&&typeof _0x4c4d32['limit']===_0x508a('0x1c');var _0x480246=_0x5bdeff[_0x508a('0x1d')];var _0x3aac7d=_0x241c89?0x0:_0x4c4d32[_0x508a('0x1b')];var _0x304b25=_0x241c89?_0x5bdeff['count']:_0x4c4d32[_0x508a('0x1b')]+_0x4c4d32[_0x508a('0x1e')];var _0x640cad;if(_0x304b25>=_0x480246){_0x304b25=_0x480246;_0x640cad=0xc8;}else{_0x640cad=0xce;}_0x1be416[_0x508a('0x18')](_0x640cad);return _0x1be416[_0x508a('0x1f')](_0x508a('0x20'),_0x3aac7d+'-'+_0x304b25+'/'+_0x480246)['json'](_0x5bdeff);}return null;};}function patchUpdates(_0x15afa2){return function(_0x4f6db1){try{jsonpatch[_0x508a('0x21')](_0x4f6db1,_0x15afa2,!![]);}catch(_0x10bdd9){return BPromise['reject'](_0x10bdd9);}return _0x4f6db1[_0x508a('0x22')]();};}function saveUpdates(_0x54e9c5,_0x47afc0){return function(_0xf397f1){if(_0xf397f1){return _0xf397f1['update'](_0x54e9c5)[_0x508a('0x23')](function(_0xeff9b9){return _0xeff9b9;});}return null;};}function removeEntity(_0x573a72,_0x4f2fd7){return function(_0x4a1cbe){if(_0x4a1cbe){return _0x4a1cbe[_0x508a('0x24')]()['then'](function(){_0x573a72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x304b1d,_0x12807e){return function(_0x45e2ed){if(!_0x45e2ed){_0x304b1d[_0x508a('0x17')](0x194);}return _0x45e2ed;};}function handleError(_0x57eb02,_0x5d7585){_0x5d7585=_0x5d7585||0x1f4;return function(_0x5cf3dd){logger['error'](_0x5cf3dd['stack']);if(_0x5cf3dd[_0x508a('0x25')]){delete _0x5cf3dd[_0x508a('0x25')];}_0x57eb02[_0x508a('0x18')](_0x5d7585)[_0x508a('0x26')](_0x5cf3dd);};}exports[_0x508a('0x27')]=function(_0xf73c6b,_0x266955){var _0x2c088d={},_0x81a4b3={},_0x5d036c={'count':0x0,'rows':[]};var _0x1662a3=_['map'](db[_0x508a('0x28')][_0x508a('0x29')],function(_0x149b04){return{'name':_0x149b04[_0x508a('0x2a')],'type':_0x149b04[_0x508a('0x2b')][_0x508a('0x2c')]};});_0x81a4b3['model']=_[_0x508a('0x2d')](_0x1662a3,_0x508a('0x25'));_0x81a4b3['query']=_[_0x508a('0x2e')](_0xf73c6b[_0x508a('0x2f')]);_0x81a4b3[_0x508a('0x30')]=_[_0x508a('0x31')](_0x81a4b3['model'],_0x81a4b3['query']);_0x2c088d[_0x508a('0x32')]=_[_0x508a('0x31')](_0x81a4b3['model'],qs[_0x508a('0x33')](_0xf73c6b[_0x508a('0x2f')][_0x508a('0x33')]));_0x2c088d[_0x508a('0x32')]=_0x2c088d[_0x508a('0x32')]['length']?_0x2c088d['attributes']:_0x81a4b3['model'];if(!_0xf73c6b[_0x508a('0x2f')]['hasOwnProperty'](_0x508a('0x34'))){_0x2c088d[_0x508a('0x1e')]=qs['limit'](_0xf73c6b[_0x508a('0x2f')]['limit']);_0x2c088d[_0x508a('0x1b')]=qs[_0x508a('0x1b')](_0xf73c6b['query']['offset']);}_0x2c088d['order']=qs[_0x508a('0x35')](_0xf73c6b[_0x508a('0x2f')][_0x508a('0x35')]);_0x2c088d[_0x508a('0x36')]=qs[_0x508a('0x30')](_[_0x508a('0x37')](_0xf73c6b[_0x508a('0x2f')],_0x81a4b3[_0x508a('0x30')]),_0x1662a3);if(_0xf73c6b[_0x508a('0x2f')]['filter']){_0x2c088d[_0x508a('0x36')]=_[_0x508a('0x38')](_0x2c088d[_0x508a('0x36')],{'$or':_[_0x508a('0x2d')](_0x1662a3,function(_0x35fb5a){if(_0x35fb5a['type']!=='VIRTUAL'){var _0x2521e8={};_0x2521e8[_0x35fb5a[_0x508a('0x25')]]={'$like':'%'+_0xf73c6b[_0x508a('0x2f')]['filter']+'%'};return _0x2521e8;}})});}_0x2c088d=_[_0x508a('0x38')]({},_0x2c088d,_0xf73c6b[_0x508a('0x39')]);var _0x5b5a1f={'where':_0x2c088d['where']};return db[_0x508a('0x28')][_0x508a('0x1d')](_0x5b5a1f)['then'](function(_0x5ca2af){_0x5d036c[_0x508a('0x1d')]=_0x5ca2af;if(_0xf73c6b[_0x508a('0x2f')]['includeAll']){_0x2c088d[_0x508a('0x3a')]=[{'all':!![]}];}return db[_0x508a('0x28')][_0x508a('0x3b')](_0x2c088d);})[_0x508a('0x23')](function(_0x1dbba1){_0x5d036c['rows']=_0x1dbba1;return _0x5d036c;})['then'](respondWithFilteredResult(_0x266955,_0x2c088d))[_0x508a('0x3c')](handleError(_0x266955,null));};exports[_0x508a('0x3d')]=function(_0x253852,_0x5db285){var _0x2f2068={'raw':!![],'where':{'id':_0x253852[_0x508a('0x3e')]['id']}},_0x3ef702={};_0x3ef702[_0x508a('0x3f')]=_['keys'](db['SquareReport'][_0x508a('0x29')]);_0x3ef702[_0x508a('0x2f')]=_['keys'](_0x253852[_0x508a('0x2f')]);_0x3ef702['filters']=_[_0x508a('0x31')](_0x3ef702[_0x508a('0x3f')],_0x3ef702[_0x508a('0x2f')]);_0x2f2068['attributes']=_[_0x508a('0x31')](_0x3ef702[_0x508a('0x3f')],qs[_0x508a('0x33')](_0x253852[_0x508a('0x2f')][_0x508a('0x33')]));_0x2f2068['attributes']=_0x2f2068[_0x508a('0x32')][_0x508a('0x40')]?_0x2f2068['attributes']:_0x3ef702[_0x508a('0x3f')];if(_0x253852['query'][_0x508a('0x41')]){_0x2f2068[_0x508a('0x3a')]=[{'all':!![]}];}_0x2f2068=_[_0x508a('0x38')]({},_0x2f2068,_0x253852[_0x508a('0x39')]);return db['SquareReport']['find'](_0x2f2068)['then'](handleEntityNotFound(_0x5db285,null))['then'](respondWithResult(_0x5db285,null))['catch'](handleError(_0x5db285,null));};exports['create']=function(_0x19ed3c,_0x4dd4a6){return db['SquareReport'][_0x508a('0x42')](_0x19ed3c['body'],{})[_0x508a('0x23')](respondWithResult(_0x4dd4a6,0xc9))[_0x508a('0x3c')](handleError(_0x4dd4a6,null));};exports[_0x508a('0x43')]=function(_0x19c78a,_0x283009){if(_0x19c78a['body']['id']){delete _0x19c78a[_0x508a('0x44')]['id'];}return db[_0x508a('0x28')][_0x508a('0x45')]({'where':{'id':_0x19c78a['params']['id']}})[_0x508a('0x23')](handleEntityNotFound(_0x283009,null))['then'](saveUpdates(_0x19c78a['body'],null))[_0x508a('0x23')](respondWithResult(_0x283009,null))[_0x508a('0x3c')](handleError(_0x283009,null));};exports[_0x508a('0x24')]=function(_0x405364,_0x29e019){return db[_0x508a('0x28')][_0x508a('0x45')]({'where':{'id':_0x405364[_0x508a('0x3e')]['id']}})[_0x508a('0x23')](handleEntityNotFound(_0x29e019,null))['then'](removeEntity(_0x29e019,null))[_0x508a('0x3c')](handleError(_0x29e019,null));};exports[_0x508a('0x46')]=function(_0x33b786,_0x4cae44){return db[_0x508a('0x28')][_0x508a('0x46')]()[_0x508a('0x23')](respondWithResult(_0x4cae44,null))[_0x508a('0x3c')](handleError(_0x4cae44,null));}; \ No newline at end of file +var _0x2d7e=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','end','sendStatus','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2d7e,0x19a));var _0xe2d7=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x2d7e[_0x87b0ff];return _0x3bc0b2;};'use strict';var emlformat=require(_0xe2d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2d7('0x1'));var jsonpatch=require(_0xe2d7('0x2'));var rp=require('request-promise');var moment=require(_0xe2d7('0x3'));var BPromise=require(_0xe2d7('0x4'));var Mustache=require('mustache');var util=require(_0xe2d7('0x5'));var path=require(_0xe2d7('0x6'));var sox=require(_0xe2d7('0x7'));var csv=require(_0xe2d7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2d7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe2d7('0xa'));var jsforce=require(_0xe2d7('0xb'));var deskjs=require(_0xe2d7('0xc'));var toCsv=require(_0xe2d7('0x8'));var querystring=require(_0xe2d7('0xd'));var Papa=require(_0xe2d7('0xe'));var Redis=require(_0xe2d7('0xf'));var authService=require(_0xe2d7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2d7('0x11'));var logger=require(_0xe2d7('0x12'))(_0xe2d7('0x13'));var utils=require('../../config/utils');var config=require(_0xe2d7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2d7('0x15'))['db'];function respondWithStatusCode(_0x2af50c,_0x29be11){_0x29be11=_0x29be11||0xcc;return function(_0x3f08fc){if(_0x3f08fc){return _0x2af50c['sendStatus'](_0x29be11);}return _0x2af50c[_0xe2d7('0x16')](_0x29be11)['end']();};}function respondWithResult(_0x4acdac,_0x39f1da){_0x39f1da=_0x39f1da||0xc8;return function(_0x314719){if(_0x314719){return _0x4acdac[_0xe2d7('0x16')](_0x39f1da)[_0xe2d7('0x17')](_0x314719);}};}function respondWithFilteredResult(_0x50d5c0,_0x4cb0e1){return function(_0x3d5083){if(_0x3d5083){var _0x4d354f=typeof _0x4cb0e1[_0xe2d7('0x18')]===_0xe2d7('0x19')&&typeof _0x4cb0e1['limit']===_0xe2d7('0x19');var _0x496916=_0x3d5083[_0xe2d7('0x1a')];var _0x5bd3cc=_0x4d354f?0x0:_0x4cb0e1['offset'];var _0x190474=_0x4d354f?_0x3d5083['count']:_0x4cb0e1[_0xe2d7('0x18')]+_0x4cb0e1[_0xe2d7('0x1b')];var _0x35aad3;if(_0x190474>=_0x496916){_0x190474=_0x496916;_0x35aad3=0xc8;}else{_0x35aad3=0xce;}_0x50d5c0['status'](_0x35aad3);return _0x50d5c0[_0xe2d7('0x1c')]('Content-Range',_0x5bd3cc+'-'+_0x190474+'/'+_0x496916)['json'](_0x3d5083);}return null;};}function patchUpdates(_0x486532){return function(_0x3250fa){try{jsonpatch[_0xe2d7('0x1d')](_0x3250fa,_0x486532,!![]);}catch(_0x783de0){return BPromise[_0xe2d7('0x1e')](_0x783de0);}return _0x3250fa[_0xe2d7('0x1f')]();};}function saveUpdates(_0x18ba94,_0x21e89b){return function(_0x3de00e){if(_0x3de00e){return _0x3de00e[_0xe2d7('0x20')](_0x18ba94)[_0xe2d7('0x21')](function(_0x5c131e){return _0x5c131e;});}return null;};}function removeEntity(_0x48fc62,_0x30ef39){return function(_0x32a81d){if(_0x32a81d){return _0x32a81d['destroy']()[_0xe2d7('0x21')](function(){_0x48fc62[_0xe2d7('0x16')](0xcc)[_0xe2d7('0x22')]();});}};}function handleEntityNotFound(_0x3e9ba4,_0x485e65){return function(_0x3278dd){if(!_0x3278dd){_0x3e9ba4[_0xe2d7('0x23')](0x194);}return _0x3278dd;};}function handleError(_0x3df486,_0xd99a28){_0xd99a28=_0xd99a28||0x1f4;return function(_0x28c565){logger['error'](_0x28c565[_0xe2d7('0x24')]);if(_0x28c565['name']){delete _0x28c565[_0xe2d7('0x25')];}_0x3df486[_0xe2d7('0x16')](_0xd99a28)['send'](_0x28c565);};}exports[_0xe2d7('0x26')]=function(_0x359a33,_0x39391a){var _0x5d7a63={},_0x10a62f={},_0x157fa7={'count':0x0,'rows':[]};var _0x4e5960=_[_0xe2d7('0x27')](db[_0xe2d7('0x28')][_0xe2d7('0x29')],function(_0x96c595){return{'name':_0x96c595[_0xe2d7('0x2a')],'type':_0x96c595[_0xe2d7('0x2b')]['key']};});_0x10a62f[_0xe2d7('0x2c')]=_[_0xe2d7('0x27')](_0x4e5960,_0xe2d7('0x25'));_0x10a62f[_0xe2d7('0x2d')]=_[_0xe2d7('0x2e')](_0x359a33[_0xe2d7('0x2d')]);_0x10a62f['filters']=_['intersection'](_0x10a62f[_0xe2d7('0x2c')],_0x10a62f[_0xe2d7('0x2d')]);_0x5d7a63['attributes']=_[_0xe2d7('0x2f')](_0x10a62f['model'],qs[_0xe2d7('0x30')](_0x359a33['query'][_0xe2d7('0x30')]));_0x5d7a63['attributes']=_0x5d7a63[_0xe2d7('0x31')]['length']?_0x5d7a63[_0xe2d7('0x31')]:_0x10a62f[_0xe2d7('0x2c')];if(!_0x359a33['query']['hasOwnProperty'](_0xe2d7('0x32'))){_0x5d7a63[_0xe2d7('0x1b')]=qs[_0xe2d7('0x1b')](_0x359a33[_0xe2d7('0x2d')][_0xe2d7('0x1b')]);_0x5d7a63[_0xe2d7('0x18')]=qs[_0xe2d7('0x18')](_0x359a33['query'][_0xe2d7('0x18')]);}_0x5d7a63[_0xe2d7('0x33')]=qs['sort'](_0x359a33[_0xe2d7('0x2d')][_0xe2d7('0x34')]);_0x5d7a63[_0xe2d7('0x35')]=qs[_0xe2d7('0x36')](_[_0xe2d7('0x37')](_0x359a33[_0xe2d7('0x2d')],_0x10a62f[_0xe2d7('0x36')]),_0x4e5960);if(_0x359a33['query']['filter']){_0x5d7a63['where']=_[_0xe2d7('0x38')](_0x5d7a63[_0xe2d7('0x35')],{'$or':_[_0xe2d7('0x27')](_0x4e5960,function(_0x2282d1){if(_0x2282d1[_0xe2d7('0x2b')]!==_0xe2d7('0x39')){var _0x33d547={};_0x33d547[_0x2282d1[_0xe2d7('0x25')]]={'$like':'%'+_0x359a33[_0xe2d7('0x2d')]['filter']+'%'};return _0x33d547;}})});}_0x5d7a63=_['merge']({},_0x5d7a63,_0x359a33[_0xe2d7('0x3a')]);var _0x1656b0={'where':_0x5d7a63[_0xe2d7('0x35')]};return db[_0xe2d7('0x28')][_0xe2d7('0x1a')](_0x1656b0)[_0xe2d7('0x21')](function(_0x34f388){_0x157fa7[_0xe2d7('0x1a')]=_0x34f388;if(_0x359a33[_0xe2d7('0x2d')][_0xe2d7('0x3b')]){_0x5d7a63[_0xe2d7('0x3c')]=[{'all':!![]}];}return db[_0xe2d7('0x28')][_0xe2d7('0x3d')](_0x5d7a63);})[_0xe2d7('0x21')](function(_0x124561){_0x157fa7['rows']=_0x124561;return _0x157fa7;})['then'](respondWithFilteredResult(_0x39391a,_0x5d7a63))[_0xe2d7('0x3e')](handleError(_0x39391a,null));};exports[_0xe2d7('0x3f')]=function(_0x2a8d3e,_0xf6b10a){var _0x57f02a={'raw':!![],'where':{'id':_0x2a8d3e[_0xe2d7('0x40')]['id']}},_0x3f015d={};_0x3f015d[_0xe2d7('0x2c')]=_[_0xe2d7('0x2e')](db[_0xe2d7('0x28')][_0xe2d7('0x29')]);_0x3f015d[_0xe2d7('0x2d')]=_[_0xe2d7('0x2e')](_0x2a8d3e[_0xe2d7('0x2d')]);_0x3f015d[_0xe2d7('0x36')]=_[_0xe2d7('0x2f')](_0x3f015d[_0xe2d7('0x2c')],_0x3f015d['query']);_0x57f02a[_0xe2d7('0x31')]=_['intersection'](_0x3f015d[_0xe2d7('0x2c')],qs['fields'](_0x2a8d3e[_0xe2d7('0x2d')][_0xe2d7('0x30')]));_0x57f02a[_0xe2d7('0x31')]=_0x57f02a[_0xe2d7('0x31')][_0xe2d7('0x41')]?_0x57f02a[_0xe2d7('0x31')]:_0x3f015d['model'];if(_0x2a8d3e['query']['includeAll']){_0x57f02a[_0xe2d7('0x3c')]=[{'all':!![]}];}_0x57f02a=_['merge']({},_0x57f02a,_0x2a8d3e[_0xe2d7('0x3a')]);return db[_0xe2d7('0x28')][_0xe2d7('0x42')](_0x57f02a)['then'](handleEntityNotFound(_0xf6b10a,null))[_0xe2d7('0x21')](respondWithResult(_0xf6b10a,null))[_0xe2d7('0x3e')](handleError(_0xf6b10a,null));};exports[_0xe2d7('0x43')]=function(_0x243123,_0x3d8c3d){return db[_0xe2d7('0x28')][_0xe2d7('0x43')](_0x243123[_0xe2d7('0x44')],{})[_0xe2d7('0x21')](respondWithResult(_0x3d8c3d,0xc9))[_0xe2d7('0x3e')](handleError(_0x3d8c3d,null));};exports[_0xe2d7('0x20')]=function(_0x166b0f,_0x43f076){if(_0x166b0f[_0xe2d7('0x44')]['id']){delete _0x166b0f[_0xe2d7('0x44')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x166b0f[_0xe2d7('0x40')]['id']}})[_0xe2d7('0x21')](handleEntityNotFound(_0x43f076,null))[_0xe2d7('0x21')](saveUpdates(_0x166b0f[_0xe2d7('0x44')],null))[_0xe2d7('0x21')](respondWithResult(_0x43f076,null))[_0xe2d7('0x3e')](handleError(_0x43f076,null));};exports[_0xe2d7('0x45')]=function(_0x10ad92,_0x3d8cc8){return db[_0xe2d7('0x28')][_0xe2d7('0x42')]({'where':{'id':_0x10ad92['params']['id']}})[_0xe2d7('0x21')](handleEntityNotFound(_0x3d8cc8,null))[_0xe2d7('0x21')](removeEntity(_0x3d8cc8,null))[_0xe2d7('0x3e')](handleError(_0x3d8cc8,null));};exports[_0xe2d7('0x46')]=function(_0x57cd15,_0x32923d){return db[_0xe2d7('0x28')][_0xe2d7('0x46')]()[_0xe2d7('0x21')](respondWithResult(_0x32923d,null))[_0xe2d7('0x3e')](handleError(_0x32923d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b13641d..2cfbf02 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 _0x3087=['exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','../../config/logger','api','moment','request-promise','path','rimraf','./squareReport.attributes'];(function(_0x244f5d,_0x3c98c6){var _0x1a3886=function(_0x2bf049){while(--_0x2bf049){_0x244f5d['push'](_0x244f5d['shift']());}};_0x1a3886(++_0x3c98c6);}(_0x3087,0x85));var _0x7308=function(_0x96d9b7,_0x219fcd){_0x96d9b7=_0x96d9b7-0x0;var _0x50d66c=_0x3087[_0x96d9b7];return _0x50d66c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7308('0x0'))(_0x7308('0x1'));var moment=require(_0x7308('0x2'));var BPromise=require('bluebird');var rp=require(_0x7308('0x3'));var fs=require('fs');var path=require(_0x7308('0x4'));var rimraf=require(_0x7308('0x5'));var config=require('../../config/environment');var attributes=require(_0x7308('0x6'));module[_0x7308('0x7')]=function(_0x49395b,_0x56b077){return _0x49395b[_0x7308('0x8')]('SquareReport',attributes,{'tableName':_0x7308('0x9'),'paranoid':![],'indexes':[{'name':_0x7308('0xa'),'fields':[_0x7308('0xb'),_0x7308('0xc')]},{'name':_0x7308('0xd'),'fields':[_0x7308('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf520=['uid_pname','project_name','leaveAt','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x4d9f75,_0x57518f){var _0x572f73=function(_0x2580eb){while(--_0x2580eb){_0x4d9f75['push'](_0x4d9f75['shift']());}};_0x572f73(++_0x57518f);}(_0xf520,0x7b));var _0x0f52=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf520[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x0f52('0x0'));var util=require('util');var logger=require(_0x0f52('0x1'))(_0x0f52('0x2'));var moment=require('moment');var BPromise=require(_0x0f52('0x3'));var rp=require(_0x0f52('0x4'));var fs=require('fs');var path=require(_0x0f52('0x5'));var rimraf=require(_0x0f52('0x6'));var config=require(_0x0f52('0x7'));var attributes=require(_0x0f52('0x8'));module[_0x0f52('0x9')]=function(_0x180902,_0x253a0e){return _0x180902[_0x0f52('0xa')](_0x0f52('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x0f52('0xc'),'fields':['uniqueid',_0x0f52('0xd')]},{'name':_0x0f52('0xe'),'fields':[_0x0f52('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 1bc6408..5156a9a 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 _0xb208=['update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb208,0x1c3));var _0x8b20=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb208[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x8b20('0x0'));var util=require(_0x8b20('0x1'));var moment=require('moment');var BPromise=require(_0x8b20('0x2'));var rs=require(_0x8b20('0x3'));var fs=require('fs');var Redis=require(_0x8b20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b20('0x5'));var logger=require(_0x8b20('0x6'))(_0x8b20('0x7'));var config=require(_0x8b20('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b20('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557d72,_0x132a54,_0x2c5174){return new BPromise(function(_0x5584de,_0x1b2aab){return client[_0x8b20('0xa')](_0x557d72,_0x2c5174)[_0x8b20('0xb')](function(_0x6f3d1a){logger[_0x8b20('0xc')](_0x8b20('0xd'),_0x132a54,_0x8b20('0xe'));logger[_0x8b20('0xf')](_0x8b20('0x10'),_0x132a54,'request\x20sent',JSON['stringify'](_0x6f3d1a));if(_0x6f3d1a[_0x8b20('0x11')]){if(_0x6f3d1a['error'][_0x8b20('0x12')]===0x1f4){logger[_0x8b20('0x11')](_0x8b20('0xd'),_0x132a54,_0x6f3d1a[_0x8b20('0x11')]['message']);return _0x1b2aab(_0x6f3d1a[_0x8b20('0x11')][_0x8b20('0x13')]);}logger[_0x8b20('0x11')](_0x8b20('0xd'),_0x132a54,_0x6f3d1a[_0x8b20('0x11')]['message']);return _0x5584de(_0x6f3d1a[_0x8b20('0x11')][_0x8b20('0x13')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x132a54,'request\x20sent');_0x5584de(_0x6f3d1a[_0x8b20('0x14')]['message']);}})[_0x8b20('0x15')](function(_0x99edd6){logger[_0x8b20('0x11')](_0x8b20('0xd'),_0x132a54,_0x99edd6);_0x1b2aab(_0x99edd6);});});}exports['CreateSquareReport']=function(_0x2c270d){var _0x84bbf3=this;return new Promise(function(_0x1e9da1,_0x735851){return db[_0x8b20('0x16')][_0x8b20('0x17')](_0x2c270d[_0x8b20('0x18')],{'raw':_0x2c270d[_0x8b20('0x19')]?_0x2c270d['options'][_0x8b20('0x1a')]===undefined?!![]:![]:!![]})[_0x8b20('0xb')](function(_0x30444a){logger[_0x8b20('0xc')](_0x8b20('0x1b'),_0x2c270d);logger[_0x8b20('0xf')](_0x8b20('0x1b'),_0x2c270d,JSON['stringify'](_0x30444a));_0x1e9da1(_0x30444a);})['catch'](function(_0x228f54){logger['error'](_0x8b20('0x1b'),_0x228f54[_0x8b20('0x13')],_0x2c270d);_0x735851(_0x84bbf3[_0x8b20('0x11')](0x1f4,_0x228f54[_0x8b20('0x13')]));});});};exports[_0x8b20('0x1c')]=function(_0x1e8363){var _0x137213=this;return new Promise(function(_0x2ffa12,_0x392a95){return db['SquareReport'][_0x8b20('0x1d')](_0x1e8363[_0x8b20('0x18')],{'raw':_0x1e8363[_0x8b20('0x19')]?_0x1e8363[_0x8b20('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8363[_0x8b20('0x19')]?_0x1e8363[_0x8b20('0x19')][_0x8b20('0x1e')]||null:null,'attributes':_0x1e8363[_0x8b20('0x19')]?_0x1e8363[_0x8b20('0x19')]['attributes']||null:null,'limit':_0x1e8363[_0x8b20('0x19')]?_0x1e8363['options'][_0x8b20('0x1f')]||null:null})[_0x8b20('0xb')](function(_0x2e6bec){logger[_0x8b20('0xc')](_0x8b20('0x1c'),_0x1e8363);logger[_0x8b20('0xf')](_0x8b20('0x1c'),_0x1e8363,JSON['stringify'](_0x2e6bec));_0x2ffa12(_0x2e6bec);})[_0x8b20('0x15')](function(_0x2d00d6){logger[_0x8b20('0x11')](_0x8b20('0x1c'),_0x2d00d6[_0x8b20('0x13')],_0x1e8363);_0x392a95(_0x137213[_0x8b20('0x11')](0x1f4,_0x2d00d6['message']));});});}; \ No newline at end of file +var _0xbb17=['raw','CreateSquareReport','catch','UpdateSquareReport','update','body','where','attributes','lodash','util','bluebird','../../mysqldb','../../config/environment','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','SquareReport','create','options'];(function(_0x5331bf,_0x41d2d6){var _0x211cbe=function(_0x2094e5){while(--_0x2094e5){_0x5331bf['push'](_0x5331bf['shift']());}};_0x211cbe(++_0x41d2d6);}(_0xbb17,0x131));var _0x7bb1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbb17[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x7bb1('0x0'));var util=require(_0x7bb1('0x1'));var moment=require('moment');var BPromise=require(_0x7bb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bb1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7bb1('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bb1('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x204e28,_0x445274,_0x58cb1f){return new BPromise(function(_0x115fe7,_0x5ce1c9){return client[_0x7bb1('0x6')](_0x204e28,_0x58cb1f)[_0x7bb1('0x7')](function(_0x37a24f){logger[_0x7bb1('0x8')](_0x7bb1('0x9'),_0x445274,_0x7bb1('0xa'));logger[_0x7bb1('0xb')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x445274,_0x7bb1('0xa'),JSON[_0x7bb1('0xc')](_0x37a24f));if(_0x37a24f['error']){if(_0x37a24f['error']['code']===0x1f4){logger[_0x7bb1('0xd')](_0x7bb1('0x9'),_0x445274,_0x37a24f[_0x7bb1('0xd')]['message']);return _0x5ce1c9(_0x37a24f[_0x7bb1('0xd')][_0x7bb1('0xe')]);}logger[_0x7bb1('0xd')](_0x7bb1('0x9'),_0x445274,_0x37a24f[_0x7bb1('0xd')][_0x7bb1('0xe')]);return _0x115fe7(_0x37a24f[_0x7bb1('0xd')]['message']);}else{logger[_0x7bb1('0x8')](_0x7bb1('0x9'),_0x445274,_0x7bb1('0xa'));_0x115fe7(_0x37a24f[_0x7bb1('0xf')][_0x7bb1('0xe')]);}})['catch'](function(_0x3e988b){logger[_0x7bb1('0xd')](_0x7bb1('0x9'),_0x445274,_0x3e988b);_0x5ce1c9(_0x3e988b);});});}exports['CreateSquareReport']=function(_0x56053e){var _0x1a58f6=this;return new Promise(function(_0x32a097,_0x5960d1){return db[_0x7bb1('0x10')][_0x7bb1('0x11')](_0x56053e['body'],{'raw':_0x56053e[_0x7bb1('0x12')]?_0x56053e['options'][_0x7bb1('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x3d3e84){logger['info'](_0x7bb1('0x14'),_0x56053e);logger[_0x7bb1('0xb')](_0x7bb1('0x14'),_0x56053e,JSON['stringify'](_0x3d3e84));_0x32a097(_0x3d3e84);})[_0x7bb1('0x15')](function(_0x209784){logger['error']('CreateSquareReport',_0x209784[_0x7bb1('0xe')],_0x56053e);_0x5960d1(_0x1a58f6[_0x7bb1('0xd')](0x1f4,_0x209784[_0x7bb1('0xe')]));});});};exports[_0x7bb1('0x16')]=function(_0x521be2){var _0x346fa0=this;return new Promise(function(_0x4461e0,_0xa7125b){return db['SquareReport'][_0x7bb1('0x17')](_0x521be2[_0x7bb1('0x18')],{'raw':_0x521be2['options']?_0x521be2['options'][_0x7bb1('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x521be2['options']?_0x521be2['options'][_0x7bb1('0x19')]||null:null,'attributes':_0x521be2[_0x7bb1('0x12')]?_0x521be2['options'][_0x7bb1('0x1a')]||null:null,'limit':_0x521be2[_0x7bb1('0x12')]?_0x521be2['options']['limit']||null:null})[_0x7bb1('0x7')](function(_0x41c3ca){logger['info'](_0x7bb1('0x16'),_0x521be2);logger[_0x7bb1('0xb')]('UpdateSquareReport',_0x521be2,JSON[_0x7bb1('0xc')](_0x41c3ca));_0x4461e0(_0x41c3ca);})[_0x7bb1('0x15')](function(_0x5048a3){logger[_0x7bb1('0xd')](_0x7bb1('0x16'),_0x5048a3[_0x7bb1('0xe')],_0x521be2);_0xa7125b(_0x346fa0['error'](0x1f4,_0x5048a3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4f08fc6..522f674 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 _0x4926=['index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0xb40c1d,_0x51c83a){var _0x4e74dc=function(_0x114588){while(--_0x114588){_0xb40c1d['push'](_0xb40c1d['shift']());}};_0x4e74dc(++_0x51c83a);}(_0x4926,0x15f));var _0x6492=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x4926[_0x211fef];return _0x5447bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6492('0x0'));var timeout=require(_0x6492('0x1'));var express=require('express');var router=express[_0x6492('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6492('0x3'));var interaction=require(_0x6492('0x4'));var config=require(_0x6492('0x5'));var controller=require(_0x6492('0x6'));router[_0x6492('0x7')]('/',auth[_0x6492('0x8')](),controller[_0x6492('0x9')]);router['get'](_0x6492('0xa'),auth[_0x6492('0x8')](),controller['describe']);router[_0x6492('0x7')](_0x6492('0xb'),auth[_0x6492('0x8')](),controller[_0x6492('0xc')]);router[_0x6492('0xd')]('/',auth['isAuthenticated'](),controller[_0x6492('0xe')]);router[_0x6492('0xf')]('/:id',auth[_0x6492('0x8')](),controller[_0x6492('0x10')]);router[_0x6492('0x11')](_0x6492('0xb'),auth[_0x6492('0x8')](),controller[_0x6492('0x12')]);module[_0x6492('0x13')]=router; \ No newline at end of file +var _0xdf34=['fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','multer','path','express','Router'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0xdf34,0x1f4));var _0x4df3=function(_0x3f1912,_0x3241c2){_0x3f1912=_0x3f1912-0x0;var _0x1fc9c6=_0xdf34[_0x3f1912];return _0x1fc9c6;};'use strict';var multer=require(_0x4df3('0x0'));var util=require('util');var path=require(_0x4df3('0x1'));var timeout=require('connect-timeout');var express=require(_0x4df3('0x2'));var router=express[_0x4df3('0x3')]();var fs_extra=require(_0x4df3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4df3('0x5'));var config=require(_0x4df3('0x6'));var controller=require(_0x4df3('0x7'));router[_0x4df3('0x8')]('/',auth['isAuthenticated'](),controller[_0x4df3('0x9')]);router[_0x4df3('0x8')](_0x4df3('0xa'),auth[_0x4df3('0xb')](),controller[_0x4df3('0xc')]);router[_0x4df3('0x8')](_0x4df3('0xd'),auth[_0x4df3('0xb')](),controller[_0x4df3('0xe')]);router['post']('/',auth[_0x4df3('0xb')](),controller[_0x4df3('0xf')]);router[_0x4df3('0x10')]('/:id',auth[_0x4df3('0xb')](),controller['update']);router[_0x4df3('0x11')]('/:id',auth[_0x4df3('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8d08e27..b19a857 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 _0xf91d=['TEXT','sequelize','exports','STRING'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0xf91d,0x155));var _0xdf91=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf91d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xdf91('0x0'));module[_0xdf91('0x1')]={'uniqueid':{'type':Sequelize[_0xdf91('0x2')]},'node':{'type':Sequelize[_0xdf91('0x2')]},'application':{'type':Sequelize[_0xdf91('0x2')]},'data':{'type':Sequelize[_0xdf91('0x3')]},'project_name':{'type':Sequelize[_0xdf91('0x2')]},'callerid':{'type':Sequelize[_0xdf91('0x2')]}}; \ No newline at end of file +var _0x8149=['STRING','TEXT','sequelize','exports'];(function(_0x26e5f8,_0x1c066){var _0x1f0c29=function(_0x1e03c1){while(--_0x1e03c1){_0x26e5f8['push'](_0x26e5f8['shift']());}};_0x1f0c29(++_0x1c066);}(_0x8149,0xe6));var _0x9814=function(_0x5c55d7,_0x9a1232){_0x5c55d7=_0x5c55d7-0x0;var _0x5e1f44=_0x8149[_0x5c55d7];return _0x5e1f44;};'use strict';var Sequelize=require(_0x9814('0x0'));module[_0x9814('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x9814('0x2')]},'application':{'type':Sequelize[_0x9814('0x2')]},'data':{'type':Sequelize[_0x9814('0x3')]},'project_name':{'type':Sequelize[_0x9814('0x2')]},'callerid':{'type':Sequelize[_0x9814('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8c888bf..f29a344 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 _0x4c91=['reject','save','update','then','error','stack','name','send','index','SquareDetailsReport','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x4c91,0x75));var _0x14c9=function(_0x37c6f5,_0x310c55){_0x37c6f5=_0x37c6f5-0x0;var _0x1380a9=_0x4c91[_0x37c6f5];return _0x1380a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14c9('0x0'));var jsonpatch=require(_0x14c9('0x1'));var rp=require(_0x14c9('0x2'));var moment=require(_0x14c9('0x3'));var BPromise=require(_0x14c9('0x4'));var Mustache=require(_0x14c9('0x5'));var util=require('util');var path=require(_0x14c9('0x6'));var sox=require('sox');var csv=require(_0x14c9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x14c9('0x8'));var _=require(_0x14c9('0x9'));var squel=require(_0x14c9('0xa'));var crypto=require(_0x14c9('0xb'));var jsforce=require(_0x14c9('0xc'));var deskjs=require(_0x14c9('0xd'));var toCsv=require(_0x14c9('0x7'));var querystring=require(_0x14c9('0xe'));var Papa=require(_0x14c9('0xf'));var Redis=require(_0x14c9('0x10'));var authService=require(_0x14c9('0x11'));var qs=require(_0x14c9('0x12'));var as=require(_0x14c9('0x13'));var hardwareService=require(_0x14c9('0x14'));var logger=require(_0x14c9('0x15'))(_0x14c9('0x16'));var utils=require('../../config/utils');var config=require(_0x14c9('0x17'));var licenseUtil=require(_0x14c9('0x18'));var db=require(_0x14c9('0x19'))['db'];function respondWithStatusCode(_0x5bdce8,_0x56b299){_0x56b299=_0x56b299||0xcc;return function(_0x521e7a){if(_0x521e7a){return _0x5bdce8[_0x14c9('0x1a')](_0x56b299);}return _0x5bdce8[_0x14c9('0x1b')](_0x56b299)[_0x14c9('0x1c')]();};}function respondWithResult(_0xc952cb,_0x424ac7){_0x424ac7=_0x424ac7||0xc8;return function(_0x4c9e01){if(_0x4c9e01){return _0xc952cb[_0x14c9('0x1b')](_0x424ac7)[_0x14c9('0x1d')](_0x4c9e01);}};}function respondWithFilteredResult(_0x25b82c,_0x18ac4b){return function(_0x29af83){if(_0x29af83){var _0x4b3a24=typeof _0x18ac4b['offset']===_0x14c9('0x1e')&&typeof _0x18ac4b[_0x14c9('0x1f')]===_0x14c9('0x1e');var _0x2a9f5c=_0x29af83[_0x14c9('0x20')];var _0x2dd759=_0x4b3a24?0x0:_0x18ac4b[_0x14c9('0x21')];var _0x560ea3=_0x4b3a24?_0x29af83[_0x14c9('0x20')]:_0x18ac4b['offset']+_0x18ac4b[_0x14c9('0x1f')];var _0x3dc546;if(_0x560ea3>=_0x2a9f5c){_0x560ea3=_0x2a9f5c;_0x3dc546=0xc8;}else{_0x3dc546=0xce;}_0x25b82c[_0x14c9('0x1b')](_0x3dc546);return _0x25b82c[_0x14c9('0x22')](_0x14c9('0x23'),_0x2dd759+'-'+_0x560ea3+'/'+_0x2a9f5c)[_0x14c9('0x1d')](_0x29af83);}return null;};}function patchUpdates(_0x1329e9){return function(_0x6bd103){try{jsonpatch[_0x14c9('0x24')](_0x6bd103,_0x1329e9,!![]);}catch(_0x2b5a3d){return BPromise[_0x14c9('0x25')](_0x2b5a3d);}return _0x6bd103[_0x14c9('0x26')]();};}function saveUpdates(_0x24fac9,_0x46f9db){return function(_0x4c24b8){if(_0x4c24b8){return _0x4c24b8[_0x14c9('0x27')](_0x24fac9)[_0x14c9('0x28')](function(_0x5c2134){return _0x5c2134;});}return null;};}function removeEntity(_0x472b98,_0x57493b){return function(_0x6418d9){if(_0x6418d9){return _0x6418d9['destroy']()[_0x14c9('0x28')](function(){_0x472b98[_0x14c9('0x1b')](0xcc)[_0x14c9('0x1c')]();});}};}function handleEntityNotFound(_0x25c3f2,_0x3602df){return function(_0x5a19e2){if(!_0x5a19e2){_0x25c3f2['sendStatus'](0x194);}return _0x5a19e2;};}function handleError(_0x3bf366,_0x4ab895){_0x4ab895=_0x4ab895||0x1f4;return function(_0xa5701e){logger[_0x14c9('0x29')](_0xa5701e[_0x14c9('0x2a')]);if(_0xa5701e[_0x14c9('0x2b')]){delete _0xa5701e['name'];}_0x3bf366[_0x14c9('0x1b')](_0x4ab895)[_0x14c9('0x2c')](_0xa5701e);};}exports[_0x14c9('0x2d')]=function(_0x223474,_0x2988a3){var _0x33a574={},_0x133a3f={},_0x5b2397={'count':0x0,'rows':[]};var _0x8423f=_['map'](db[_0x14c9('0x2e')]['rawAttributes'],function(_0x31d7ce){return{'name':_0x31d7ce[_0x14c9('0x2f')],'type':_0x31d7ce[_0x14c9('0x30')]['key']};});_0x133a3f[_0x14c9('0x31')]=_[_0x14c9('0x32')](_0x8423f,_0x14c9('0x2b'));_0x133a3f['query']=_[_0x14c9('0x33')](_0x223474[_0x14c9('0x34')]);_0x133a3f[_0x14c9('0x35')]=_[_0x14c9('0x36')](_0x133a3f[_0x14c9('0x31')],_0x133a3f[_0x14c9('0x34')]);_0x33a574['attributes']=_['intersection'](_0x133a3f[_0x14c9('0x31')],qs[_0x14c9('0x37')](_0x223474[_0x14c9('0x34')][_0x14c9('0x37')]));_0x33a574['attributes']=_0x33a574[_0x14c9('0x38')][_0x14c9('0x39')]?_0x33a574[_0x14c9('0x38')]:_0x133a3f['model'];if(!_0x223474[_0x14c9('0x34')]['hasOwnProperty'](_0x14c9('0x3a'))){_0x33a574[_0x14c9('0x1f')]=qs[_0x14c9('0x1f')](_0x223474[_0x14c9('0x34')]['limit']);_0x33a574[_0x14c9('0x21')]=qs['offset'](_0x223474['query'][_0x14c9('0x21')]);}_0x33a574[_0x14c9('0x3b')]=qs[_0x14c9('0x3c')](_0x223474[_0x14c9('0x34')][_0x14c9('0x3c')]);_0x33a574['where']=qs[_0x14c9('0x35')](_[_0x14c9('0x3d')](_0x223474[_0x14c9('0x34')],_0x133a3f[_0x14c9('0x35')]),_0x8423f);if(_0x223474[_0x14c9('0x34')][_0x14c9('0x3e')]){_0x33a574['where']=_['merge'](_0x33a574['where'],{'$or':_['map'](_0x8423f,function(_0x5805bb){if(_0x5805bb[_0x14c9('0x30')]!==_0x14c9('0x3f')){var _0xb56c0f={};_0xb56c0f[_0x5805bb[_0x14c9('0x2b')]]={'$like':'%'+_0x223474[_0x14c9('0x34')]['filter']+'%'};return _0xb56c0f;}})});}_0x33a574=_[_0x14c9('0x40')]({},_0x33a574,_0x223474[_0x14c9('0x41')]);var _0x38c3d9={'where':_0x33a574[_0x14c9('0x42')]};return db[_0x14c9('0x2e')][_0x14c9('0x20')](_0x38c3d9)[_0x14c9('0x28')](function(_0x2b3e76){_0x5b2397[_0x14c9('0x20')]=_0x2b3e76;if(_0x223474[_0x14c9('0x34')][_0x14c9('0x43')]){_0x33a574[_0x14c9('0x44')]=[{'all':!![]}];}return db[_0x14c9('0x2e')][_0x14c9('0x45')](_0x33a574);})['then'](function(_0x2b66a9){_0x5b2397[_0x14c9('0x46')]=_0x2b66a9;return _0x5b2397;})[_0x14c9('0x28')](respondWithFilteredResult(_0x2988a3,_0x33a574))[_0x14c9('0x47')](handleError(_0x2988a3,null));};exports['show']=function(_0x67e2c1,_0x222a3b){var _0x5c1ee7={'raw':!![],'where':{'id':_0x67e2c1[_0x14c9('0x48')]['id']}},_0x47457a={};_0x47457a[_0x14c9('0x31')]=_[_0x14c9('0x33')](db['SquareDetailsReport'][_0x14c9('0x49')]);_0x47457a['query']=_[_0x14c9('0x33')](_0x67e2c1[_0x14c9('0x34')]);_0x47457a[_0x14c9('0x35')]=_[_0x14c9('0x36')](_0x47457a[_0x14c9('0x31')],_0x47457a[_0x14c9('0x34')]);_0x5c1ee7['attributes']=_[_0x14c9('0x36')](_0x47457a['model'],qs[_0x14c9('0x37')](_0x67e2c1[_0x14c9('0x34')][_0x14c9('0x37')]));_0x5c1ee7[_0x14c9('0x38')]=_0x5c1ee7['attributes'][_0x14c9('0x39')]?_0x5c1ee7[_0x14c9('0x38')]:_0x47457a['model'];if(_0x67e2c1[_0x14c9('0x34')][_0x14c9('0x43')]){_0x5c1ee7[_0x14c9('0x44')]=[{'all':!![]}];}_0x5c1ee7=_[_0x14c9('0x40')]({},_0x5c1ee7,_0x67e2c1[_0x14c9('0x41')]);return db[_0x14c9('0x2e')][_0x14c9('0x4a')](_0x5c1ee7)[_0x14c9('0x28')](handleEntityNotFound(_0x222a3b,null))[_0x14c9('0x28')](respondWithResult(_0x222a3b,null))[_0x14c9('0x47')](handleError(_0x222a3b,null));};exports['create']=function(_0x33bc17,_0x214710){return db['SquareDetailsReport']['create'](_0x33bc17['body'],{})[_0x14c9('0x28')](respondWithResult(_0x214710,0xc9))[_0x14c9('0x47')](handleError(_0x214710,null));};exports[_0x14c9('0x27')]=function(_0x15456e,_0x3c7277){if(_0x15456e['body']['id']){delete _0x15456e[_0x14c9('0x4b')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x15456e[_0x14c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c7277,null))[_0x14c9('0x28')](saveUpdates(_0x15456e[_0x14c9('0x4b')],null))[_0x14c9('0x28')](respondWithResult(_0x3c7277,null))[_0x14c9('0x47')](handleError(_0x3c7277,null));};exports[_0x14c9('0x4c')]=function(_0x4b4c32,_0x353388){return db['SquareDetailsReport']['find']({'where':{'id':_0x4b4c32['params']['id']}})[_0x14c9('0x28')](handleEntityNotFound(_0x353388,null))[_0x14c9('0x28')](removeEntity(_0x353388,null))[_0x14c9('0x47')](handleError(_0x353388,null));};exports['describe']=function(_0x28470d,_0x26da2f){return db[_0x14c9('0x2e')]['describe']()[_0x14c9('0x28')](respondWithResult(_0x26da2f,null))[_0x14c9('0x47')](handleError(_0x26da2f,null));}; \ No newline at end of file +var _0xa6b8=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','create','body','find','params','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','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','../../mysqldb','status','end','offset','limit','undefined','count'];(function(_0x1c39b9,_0x18874b){var _0x195a78=function(_0x410649){while(--_0x410649){_0x1c39b9['push'](_0x1c39b9['shift']());}};_0x195a78(++_0x18874b);}(_0xa6b8,0x115));var _0x8a6b=function(_0x4fbf59,_0x3b946e){_0x4fbf59=_0x4fbf59-0x0;var _0x5601ff=_0xa6b8[_0x4fbf59];return _0x5601ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a6b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a6b('0x2'));var Mustache=require(_0x8a6b('0x3'));var util=require(_0x8a6b('0x4'));var path=require(_0x8a6b('0x5'));var sox=require(_0x8a6b('0x6'));var csv=require(_0x8a6b('0x7'));var ejs=require(_0x8a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x8a6b('0x9'));var _=require(_0x8a6b('0xa'));var squel=require(_0x8a6b('0xb'));var crypto=require(_0x8a6b('0xc'));var jsforce=require(_0x8a6b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8a6b('0x7'));var querystring=require(_0x8a6b('0xe'));var Papa=require(_0x8a6b('0xf'));var Redis=require(_0x8a6b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a6b('0x11'));var hardwareService=require(_0x8a6b('0x12'));var logger=require(_0x8a6b('0x13'))(_0x8a6b('0x14'));var utils=require(_0x8a6b('0x15'));var config=require(_0x8a6b('0x16'));var licenseUtil=require(_0x8a6b('0x17'));var db=require(_0x8a6b('0x18'))['db'];function respondWithStatusCode(_0xa1ebae,_0xa975fe){_0xa975fe=_0xa975fe||0xcc;return function(_0x48dca2){if(_0x48dca2){return _0xa1ebae['sendStatus'](_0xa975fe);}return _0xa1ebae[_0x8a6b('0x19')](_0xa975fe)[_0x8a6b('0x1a')]();};}function respondWithResult(_0x2204a8,_0xde2f96){_0xde2f96=_0xde2f96||0xc8;return function(_0x2b3dc1){if(_0x2b3dc1){return _0x2204a8[_0x8a6b('0x19')](_0xde2f96)['json'](_0x2b3dc1);}};}function respondWithFilteredResult(_0x1fec54,_0x46bdef){return function(_0x58f2e9){if(_0x58f2e9){var _0x4c922e=typeof _0x46bdef[_0x8a6b('0x1b')]==='undefined'&&typeof _0x46bdef[_0x8a6b('0x1c')]===_0x8a6b('0x1d');var _0x2e1758=_0x58f2e9[_0x8a6b('0x1e')];var _0x472d19=_0x4c922e?0x0:_0x46bdef[_0x8a6b('0x1b')];var _0x29821a=_0x4c922e?_0x58f2e9[_0x8a6b('0x1e')]:_0x46bdef[_0x8a6b('0x1b')]+_0x46bdef[_0x8a6b('0x1c')];var _0x31802e;if(_0x29821a>=_0x2e1758){_0x29821a=_0x2e1758;_0x31802e=0xc8;}else{_0x31802e=0xce;}_0x1fec54[_0x8a6b('0x19')](_0x31802e);return _0x1fec54[_0x8a6b('0x1f')](_0x8a6b('0x20'),_0x472d19+'-'+_0x29821a+'/'+_0x2e1758)['json'](_0x58f2e9);}return null;};}function patchUpdates(_0x284e7d){return function(_0x5ba7af){try{jsonpatch['apply'](_0x5ba7af,_0x284e7d,!![]);}catch(_0x4ef150){return BPromise[_0x8a6b('0x21')](_0x4ef150);}return _0x5ba7af[_0x8a6b('0x22')]();};}function saveUpdates(_0x10c1c3,_0x376e48){return function(_0x52d825){if(_0x52d825){return _0x52d825[_0x8a6b('0x23')](_0x10c1c3)[_0x8a6b('0x24')](function(_0x5ae18c){return _0x5ae18c;});}return null;};}function removeEntity(_0x30dc68,_0x2f6098){return function(_0x2fd805){if(_0x2fd805){return _0x2fd805[_0x8a6b('0x25')]()['then'](function(){_0x30dc68[_0x8a6b('0x19')](0xcc)[_0x8a6b('0x1a')]();});}};}function handleEntityNotFound(_0x2a8f16,_0xe560cf){return function(_0x514f49){if(!_0x514f49){_0x2a8f16['sendStatus'](0x194);}return _0x514f49;};}function handleError(_0x25bfcd,_0x4391cc){_0x4391cc=_0x4391cc||0x1f4;return function(_0x25b956){logger[_0x8a6b('0x26')](_0x25b956[_0x8a6b('0x27')]);if(_0x25b956[_0x8a6b('0x28')]){delete _0x25b956[_0x8a6b('0x28')];}_0x25bfcd[_0x8a6b('0x19')](_0x4391cc)[_0x8a6b('0x29')](_0x25b956);};}exports[_0x8a6b('0x2a')]=function(_0x5b02ee,_0x1d9d7b){var _0x3c21eb={},_0x10d480={},_0x3727cb={'count':0x0,'rows':[]};var _0x1b99cd=_['map'](db[_0x8a6b('0x2b')][_0x8a6b('0x2c')],function(_0x317bef){return{'name':_0x317bef[_0x8a6b('0x2d')],'type':_0x317bef['type'][_0x8a6b('0x2e')]};});_0x10d480[_0x8a6b('0x2f')]=_[_0x8a6b('0x30')](_0x1b99cd,'name');_0x10d480[_0x8a6b('0x31')]=_['keys'](_0x5b02ee['query']);_0x10d480[_0x8a6b('0x32')]=_[_0x8a6b('0x33')](_0x10d480['model'],_0x10d480['query']);_0x3c21eb[_0x8a6b('0x34')]=_['intersection'](_0x10d480[_0x8a6b('0x2f')],qs[_0x8a6b('0x35')](_0x5b02ee['query'][_0x8a6b('0x35')]));_0x3c21eb['attributes']=_0x3c21eb[_0x8a6b('0x34')]['length']?_0x3c21eb[_0x8a6b('0x34')]:_0x10d480[_0x8a6b('0x2f')];if(!_0x5b02ee['query'][_0x8a6b('0x36')](_0x8a6b('0x37'))){_0x3c21eb[_0x8a6b('0x1c')]=qs[_0x8a6b('0x1c')](_0x5b02ee[_0x8a6b('0x31')][_0x8a6b('0x1c')]);_0x3c21eb[_0x8a6b('0x1b')]=qs[_0x8a6b('0x1b')](_0x5b02ee[_0x8a6b('0x31')][_0x8a6b('0x1b')]);}_0x3c21eb[_0x8a6b('0x38')]=qs[_0x8a6b('0x39')](_0x5b02ee[_0x8a6b('0x31')][_0x8a6b('0x39')]);_0x3c21eb[_0x8a6b('0x3a')]=qs[_0x8a6b('0x32')](_[_0x8a6b('0x3b')](_0x5b02ee[_0x8a6b('0x31')],_0x10d480[_0x8a6b('0x32')]),_0x1b99cd);if(_0x5b02ee[_0x8a6b('0x31')][_0x8a6b('0x3c')]){_0x3c21eb[_0x8a6b('0x3a')]=_[_0x8a6b('0x3d')](_0x3c21eb[_0x8a6b('0x3a')],{'$or':_[_0x8a6b('0x30')](_0x1b99cd,function(_0x2c6057){if(_0x2c6057[_0x8a6b('0x3e')]!==_0x8a6b('0x3f')){var _0x5b0504={};_0x5b0504[_0x2c6057[_0x8a6b('0x28')]]={'$like':'%'+_0x5b02ee['query'][_0x8a6b('0x3c')]+'%'};return _0x5b0504;}})});}_0x3c21eb=_['merge']({},_0x3c21eb,_0x5b02ee[_0x8a6b('0x40')]);var _0x4c8cbe={'where':_0x3c21eb[_0x8a6b('0x3a')]};return db[_0x8a6b('0x2b')][_0x8a6b('0x1e')](_0x4c8cbe)['then'](function(_0x336f68){_0x3727cb[_0x8a6b('0x1e')]=_0x336f68;if(_0x5b02ee[_0x8a6b('0x31')]['includeAll']){_0x3c21eb[_0x8a6b('0x41')]=[{'all':!![]}];}return db[_0x8a6b('0x2b')][_0x8a6b('0x42')](_0x3c21eb);})[_0x8a6b('0x24')](function(_0x13f3b4){_0x3727cb[_0x8a6b('0x43')]=_0x13f3b4;return _0x3727cb;})[_0x8a6b('0x24')](respondWithFilteredResult(_0x1d9d7b,_0x3c21eb))[_0x8a6b('0x44')](handleError(_0x1d9d7b,null));};exports[_0x8a6b('0x45')]=function(_0x4f1933,_0x22d2b5){var _0xe9cc4d={'raw':!![],'where':{'id':_0x4f1933['params']['id']}},_0x329cee={};_0x329cee[_0x8a6b('0x2f')]=_[_0x8a6b('0x46')](db[_0x8a6b('0x2b')]['rawAttributes']);_0x329cee[_0x8a6b('0x31')]=_[_0x8a6b('0x46')](_0x4f1933['query']);_0x329cee[_0x8a6b('0x32')]=_['intersection'](_0x329cee['model'],_0x329cee['query']);_0xe9cc4d[_0x8a6b('0x34')]=_[_0x8a6b('0x33')](_0x329cee[_0x8a6b('0x2f')],qs[_0x8a6b('0x35')](_0x4f1933[_0x8a6b('0x31')][_0x8a6b('0x35')]));_0xe9cc4d['attributes']=_0xe9cc4d[_0x8a6b('0x34')]['length']?_0xe9cc4d['attributes']:_0x329cee[_0x8a6b('0x2f')];if(_0x4f1933[_0x8a6b('0x31')][_0x8a6b('0x47')]){_0xe9cc4d[_0x8a6b('0x41')]=[{'all':!![]}];}_0xe9cc4d=_[_0x8a6b('0x3d')]({},_0xe9cc4d,_0x4f1933[_0x8a6b('0x40')]);return db[_0x8a6b('0x2b')]['find'](_0xe9cc4d)[_0x8a6b('0x24')](handleEntityNotFound(_0x22d2b5,null))[_0x8a6b('0x24')](respondWithResult(_0x22d2b5,null))[_0x8a6b('0x44')](handleError(_0x22d2b5,null));};exports[_0x8a6b('0x48')]=function(_0x63dd25,_0x4d93f3){return db['SquareDetailsReport'][_0x8a6b('0x48')](_0x63dd25[_0x8a6b('0x49')],{})[_0x8a6b('0x24')](respondWithResult(_0x4d93f3,0xc9))[_0x8a6b('0x44')](handleError(_0x4d93f3,null));};exports[_0x8a6b('0x23')]=function(_0x10d9d3,_0x417eb1){if(_0x10d9d3[_0x8a6b('0x49')]['id']){delete _0x10d9d3[_0x8a6b('0x49')]['id'];}return db['SquareDetailsReport'][_0x8a6b('0x4a')]({'where':{'id':_0x10d9d3[_0x8a6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x417eb1,null))[_0x8a6b('0x24')](saveUpdates(_0x10d9d3[_0x8a6b('0x49')],null))[_0x8a6b('0x24')](respondWithResult(_0x417eb1,null))[_0x8a6b('0x44')](handleError(_0x417eb1,null));};exports['destroy']=function(_0x5f1b34,_0x507655){return db[_0x8a6b('0x2b')]['find']({'where':{'id':_0x5f1b34[_0x8a6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x507655,null))[_0x8a6b('0x24')](removeEntity(_0x507655,null))[_0x8a6b('0x44')](handleError(_0x507655,null));};exports[_0x8a6b('0x4c')]=function(_0x40577f,_0x2e589d){return db[_0x8a6b('0x2b')]['describe']()[_0x8a6b('0x24')](respondWithResult(_0x2e589d,null))[_0x8a6b('0x44')](handleError(_0x2e589d,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1cb51e4..bbd4798 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 _0x4864=['define','SquareDetailsReport','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0xe9f7fd,_0x431edd){var _0x3d22d9=function(_0x3a1d3d){while(--_0x3a1d3d){_0xe9f7fd['push'](_0xe9f7fd['shift']());}};_0x3d22d9(++_0x431edd);}(_0x4864,0x66));var _0x4486=function(_0x68fd87,_0x17f037){_0x68fd87=_0x68fd87-0x0;var _0x559470=_0x4864[_0x68fd87];return _0x559470;};'use strict';var _=require('lodash');var util=require(_0x4486('0x0'));var logger=require(_0x4486('0x1'))(_0x4486('0x2'));var moment=require(_0x4486('0x3'));var BPromise=require(_0x4486('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4486('0x5'));var config=require(_0x4486('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x4486('0x7')]=function(_0x35f009,_0x5dc32a){return _0x35f009[_0x4486('0x8')](_0x4486('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54de=['exports','define','SquareDetailsReport','report_square_details','lodash','api','moment','bluebird','request-promise','path','./squareReportDetail.attributes'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x54de,0x164));var _0xe54d=function(_0x431826,_0x551c10){_0x431826=_0x431826-0x0;var _0x16c630=_0x54de[_0x431826];return _0x16c630;};'use strict';var _=require(_0xe54d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe54d('0x1'));var moment=require(_0xe54d('0x2'));var BPromise=require(_0xe54d('0x3'));var rp=require(_0xe54d('0x4'));var fs=require('fs');var path=require(_0xe54d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe54d('0x6'));module[_0xe54d('0x7')]=function(_0x4b34b7,_0x4df121){return _0x4b34b7[_0xe54d('0x8')](_0xe54d('0x9'),attributes,{'tableName':_0xe54d('0xa'),'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 67672eb..eca41ff 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 _0xd070=['code','message','result','catch','create','options','CreateSquareDetailsReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1968b1,_0x58467d){var _0x447458=function(_0x4497c6){while(--_0x4497c6){_0x1968b1['push'](_0x1968b1['shift']());}};_0x447458(++_0x58467d);}(_0xd070,0x8e));var _0x0d07=function(_0x1a3cac,_0x696add){_0x1a3cac=_0x1a3cac-0x0;var _0x309e96=_0xd070[_0x1a3cac];return _0x309e96;};'use strict';var _=require(_0x0d07('0x0'));var util=require('util');var moment=require(_0x0d07('0x1'));var BPromise=require(_0x0d07('0x2'));var rs=require(_0x0d07('0x3'));var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require(_0x0d07('0x7'))(_0x0d07('0x8'));var config=require(_0x0d07('0x9'));var jayson=require(_0x0d07('0xa'));var client=jayson[_0x0d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d75a,_0x5a4366,_0x20fd56){return new BPromise(function(_0x8c16d8,_0x1f989e){return client[_0x0d07('0xc')](_0x13d75a,_0x20fd56)[_0x0d07('0xd')](function(_0xc5b04d){logger[_0x0d07('0xe')](_0x0d07('0xf'),_0x5a4366,_0x0d07('0x10'));logger[_0x0d07('0x11')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5a4366,'request\x20sent',JSON[_0x0d07('0x12')](_0xc5b04d));if(_0xc5b04d[_0x0d07('0x13')]){if(_0xc5b04d['error'][_0x0d07('0x14')]===0x1f4){logger['error'](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')]['message']);return _0x1f989e(_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);}logger[_0x0d07('0x13')](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);return _0x8c16d8(_0xc5b04d['error'][_0x0d07('0x15')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x5a4366,_0x0d07('0x10'));_0x8c16d8(_0xc5b04d[_0x0d07('0x16')][_0x0d07('0x15')]);}})[_0x0d07('0x17')](function(_0x220203){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5a4366,_0x220203);_0x1f989e(_0x220203);});});}exports['CreateSquareDetailsReport']=function(_0x187df2){var _0x312015=this;return new Promise(function(_0x52cb4b,_0x410ad2){return db['SquareDetailsReport'][_0x0d07('0x18')](_0x187df2['body'],{'raw':_0x187df2['options']?_0x187df2[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d07('0xd')](function(_0x54790f){logger[_0x0d07('0xe')]('CreateSquareDetailsReport',_0x187df2);logger['debug'](_0x0d07('0x1a'),_0x187df2,JSON[_0x0d07('0x12')](_0x54790f));_0x52cb4b(_0x54790f);})[_0x0d07('0x17')](function(_0x57e997){logger[_0x0d07('0x13')]('CreateSquareDetailsReport',_0x57e997['message'],_0x187df2);_0x410ad2(_0x312015[_0x0d07('0x13')](0x1f4,_0x57e997[_0x0d07('0x15')]));});});}; \ No newline at end of file +var _0x1280=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','SquareDetailsReport','create','options','CreateSquareDetailsReport','lodash','moment','bluebird'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x1280,0xac));var _0x0128=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x1280[_0x54bac5];return _0xc15971;};'use strict';var _=require(_0x0128('0x0'));var util=require('util');var moment=require(_0x0128('0x1'));var BPromise=require(_0x0128('0x2'));var rs=require(_0x0128('0x3'));var fs=require('fs');var Redis=require(_0x0128('0x4'));var db=require(_0x0128('0x5'))['db'];var utils=require(_0x0128('0x6'));var logger=require('../../config/logger')(_0x0128('0x7'));var config=require(_0x0128('0x8'));var jayson=require(_0x0128('0x9'));var client=jayson[_0x0128('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e74fe,_0x1d647f,_0x134abd){return new BPromise(function(_0x2b8b86,_0x43a105){return client['request'](_0x4e74fe,_0x134abd)[_0x0128('0xb')](function(_0x2fa9cb){logger['info'](_0x0128('0xc'),_0x1d647f,_0x0128('0xd'));logger[_0x0128('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1d647f,'request\x20sent',JSON[_0x0128('0xf')](_0x2fa9cb));if(_0x2fa9cb[_0x0128('0x10')]){if(_0x2fa9cb[_0x0128('0x10')]['code']===0x1f4){logger[_0x0128('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x1d647f,_0x2fa9cb[_0x0128('0x10')]['message']);return _0x43a105(_0x2fa9cb[_0x0128('0x10')]['message']);}logger[_0x0128('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x1d647f,_0x2fa9cb[_0x0128('0x10')][_0x0128('0x11')]);return _0x2b8b86(_0x2fa9cb[_0x0128('0x10')][_0x0128('0x11')]);}else{logger[_0x0128('0x12')](_0x0128('0xc'),_0x1d647f,'request\x20sent');_0x2b8b86(_0x2fa9cb[_0x0128('0x13')][_0x0128('0x11')]);}})[_0x0128('0x14')](function(_0x16a4b7){logger[_0x0128('0x10')](_0x0128('0xc'),_0x1d647f,_0x16a4b7);_0x43a105(_0x16a4b7);});});}exports['CreateSquareDetailsReport']=function(_0x2524b1){var _0x18a955=this;return new Promise(function(_0x1a5818,_0x431b13){return db[_0x0128('0x15')][_0x0128('0x16')](_0x2524b1['body'],{'raw':_0x2524b1[_0x0128('0x17')]?_0x2524b1[_0x0128('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c000a){logger[_0x0128('0x12')](_0x0128('0x18'),_0x2524b1);logger[_0x0128('0xe')](_0x0128('0x18'),_0x2524b1,JSON[_0x0128('0xf')](_0x2c000a));_0x1a5818(_0x2c000a);})[_0x0128('0x14')](function(_0x167c33){logger['error']('CreateSquareDetailsReport',_0x167c33[_0x0128('0x11')],_0x2524b1);_0x431b13(_0x18a955['error'](0x1f4,_0x167c33[_0x0128('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c09469e..bcc753e 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 _0x8600=['/process/:pid/kill','killProcess','exports','../../components/auth/service','./system.controller','isAuthenticated','index'];(function(_0x4de900,_0x3bf8c2){var _0x449d9f=function(_0x15326a){while(--_0x15326a){_0x4de900['push'](_0x4de900['shift']());}};_0x449d9f(++_0x3bf8c2);}(_0x8600,0xab));var _0x0860=function(_0x3e9030,_0x16c384){_0x3e9030=_0x3e9030-0x0;var _0x526b49=_0x8600[_0x3e9030];return _0x526b49;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x0860('0x0'));var controller=require(_0x0860('0x1'));router['get']('/',auth[_0x0860('0x2')](),controller[_0x0860('0x3')]);router['get'](_0x0860('0x4'),auth[_0x0860('0x2')](),controller[_0x0860('0x5')]);module[_0x0860('0x6')]=router; \ No newline at end of file +var _0xdacd=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','exports'];(function(_0x3d9b8c,_0x1accd9){var _0x5afdbc=function(_0x4ac82c){while(--_0x4ac82c){_0x3d9b8c['push'](_0x3d9b8c['shift']());}};_0x5afdbc(++_0x1accd9);}(_0xdacd,0x173));var _0xddac=function(_0x20d29f,_0x406dca){_0x20d29f=_0x20d29f-0x0;var _0x3e19d7=_0xdacd[_0x20d29f];return _0x3e19d7;};'use strict';var express=require(_0xddac('0x0'));var router=express[_0xddac('0x1')]();var auth=require(_0xddac('0x2'));var controller=require(_0xddac('0x3'));router[_0xddac('0x4')]('/',auth[_0xddac('0x5')](),controller['index']);router['get']('/process/:pid/kill',auth[_0xddac('0x5')](),controller['killProcess']);module[_0xddac('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 7625899..d69f8bb 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 _0xe4df=['systeminformation','child_process','exec','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json','catch','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x829690,_0x5dbf1d){var _0x431a54=function(_0x13c6d8){while(--_0x13c6d8){_0x829690['push'](_0x829690['shift']());}};_0x431a54(++_0x5dbf1d);}(_0xe4df,0xfc));var _0xfe4d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe4df[_0x1facfa];return _0x9ec701;};'use strict';var info=require(_0xfe4d('0x0'));var exec=require(_0xfe4d('0x1'))[_0xfe4d('0x2')];var logger=require('../../config/logger')('api');var util=require(_0xfe4d('0x3'));var BPromise=require(_0xfe4d('0x4'));var _=require(_0xfe4d('0x5'));function handleError(_0xc73f2b,_0x1b8431,_0x541e34){_0x1b8431=_0x1b8431||0x1f4;return function(_0x360fcc){logger[_0xfe4d('0x6')](_0xfe4d('0x7'),_0x541e34,_0x1b8431,util[_0xfe4d('0x8')](_0x360fcc,{'showHidden':![],'depth':null}));delete _0x360fcc[_0xfe4d('0x9')];_0xc73f2b[_0xfe4d('0xa')](_0x1b8431)[_0xfe4d('0xb')](_0x360fcc);};}exports[_0xfe4d('0xc')]=function(_0xcbd8a4,_0x32791f){return info[_0xfe4d('0xd')]()['then'](function(_0x5be10c){return _0x32791f[_0xfe4d('0xa')](0xc8)[_0xfe4d('0xe')](_0x5be10c);})[_0xfe4d('0xf')](function(_0x8f332e){return _0x32791f[_0xfe4d('0xa')](0x1f4)[_0xfe4d('0xe')](_0x8f332e);});};exports[_0xfe4d('0x10')]=function(_0x433264,_0x296e90){var _0x38d7b1=['components/import/cm'];return new BPromise(function(_0x2841b3,_0x1cc845){return exec(util['format'](_0xfe4d('0x11'),_0x433264[_0xfe4d('0x12')][_0xfe4d('0x13')]),function(_0x5a0107,_0x2bc8de,_0x515bd1){if(_0x5a0107){return _0x1cc845(_0x5a0107);}return _0x2841b3(_0x2bc8de);});})[_0xfe4d('0x14')](function(_0x298a7c){var _0x54b90d=![];var _0x51a38b=_0x298a7c['split'](/\n/);for(var _0x57ba0f=0x0,_0x2febcd=_0x38d7b1[_0xfe4d('0x15')];_0x57ba0f<_0x2febcd,_0x54b90d===![];_0x57ba0f+=0x1){if(_0x298a7c[_0xfe4d('0x16')](_0x38d7b1[_0x57ba0f])>=0x0){_0x54b90d=!![];}}if(!_0x54b90d){throw new Error(util[_0xfe4d('0x17')](_0xfe4d('0x18'),_0x433264[_0xfe4d('0x12')]['pid']));}process[_0xfe4d('0x19')](_0x433264['params'][_0xfe4d('0x13')],_0xfe4d('0x1a'));return _0x296e90['status'](0xc8)[_0xfe4d('0xe')]({'message':util[_0xfe4d('0x17')](_0xfe4d('0x1b'),_0x433264['params']['pid'])});})[_0xfe4d('0xf')](handleError(_0x296e90,null,_0xfe4d('0x10')));}; \ No newline at end of file +var _0xab85=['exec','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','catch','components/import/cm','format','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','killProcess','systeminformation','child_process'];(function(_0x2ec344,_0x46c158){var _0x19cfda=function(_0x3ccdd5){while(--_0x3ccdd5){_0x2ec344['push'](_0x2ec344['shift']());}};_0x19cfda(++_0x46c158);}(_0xab85,0x15d));var _0x5ab8=function(_0xb297dc,_0x39aebc){_0xb297dc=_0xb297dc-0x0;var _0x3fb2a7=_0xab85[_0xb297dc];return _0x3fb2a7;};'use strict';var info=require(_0x5ab8('0x0'));var exec=require(_0x5ab8('0x1'))[_0x5ab8('0x2')];var logger=require(_0x5ab8('0x3'))(_0x5ab8('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x5ab8('0x5'));function handleError(_0x1275e4,_0x3e08a4,_0x5c3ea2){_0x3e08a4=_0x3e08a4||0x1f4;return function(_0x506a66){logger[_0x5ab8('0x6')](_0x5ab8('0x7'),_0x5c3ea2,_0x3e08a4,util[_0x5ab8('0x8')](_0x506a66,{'showHidden':![],'depth':null}));delete _0x506a66['name'];_0x1275e4[_0x5ab8('0x9')](_0x3e08a4)[_0x5ab8('0xa')](_0x506a66);};}exports[_0x5ab8('0xb')]=function(_0x66b8c,_0x252b75){return info[_0x5ab8('0xc')]()[_0x5ab8('0xd')](function(_0x207dbb){return _0x252b75[_0x5ab8('0x9')](0xc8)[_0x5ab8('0xe')](_0x207dbb);})[_0x5ab8('0xf')](function(_0x3cd951){return _0x252b75['status'](0x1f4)[_0x5ab8('0xe')](_0x3cd951);});};exports['killProcess']=function(_0x322c9c,_0x37285d){var _0x1c31ae=[_0x5ab8('0x10')];return new BPromise(function(_0x1858f8,_0x4120d2){return exec(util[_0x5ab8('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x322c9c[_0x5ab8('0x12')][_0x5ab8('0x13')]),function(_0x3d94da,_0x517a00,_0x1737c3){if(_0x3d94da){return _0x4120d2(_0x3d94da);}return _0x1858f8(_0x517a00);});})[_0x5ab8('0xd')](function(_0xbed1f6){var _0x1150e1=![];var _0x174a03=_0xbed1f6[_0x5ab8('0x14')](/\n/);for(var _0x2ed799=0x0,_0x441c10=_0x1c31ae[_0x5ab8('0x15')];_0x2ed799<_0x441c10,_0x1150e1===![];_0x2ed799+=0x1){if(_0xbed1f6[_0x5ab8('0x16')](_0x1c31ae[_0x2ed799])>=0x0){_0x1150e1=!![];}}if(!_0x1150e1){throw new Error(util[_0x5ab8('0x11')](_0x5ab8('0x17'),_0x322c9c[_0x5ab8('0x12')][_0x5ab8('0x13')]));}process[_0x5ab8('0x18')](_0x322c9c[_0x5ab8('0x12')][_0x5ab8('0x13')],_0x5ab8('0x19'));return _0x37285d[_0x5ab8('0x9')](0xc8)[_0x5ab8('0xe')]({'message':util[_0x5ab8('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x322c9c[_0x5ab8('0x12')][_0x5ab8('0x13')])});})[_0x5ab8('0xf')](handleError(_0x37285d,null,_0x5ab8('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index af6fde2..b27c869 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 _0x0e85=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./tag.controller','get','isAuthenticated','index'];(function(_0x5ecc63,_0x110d0d){var _0x56e65f=function(_0x138202){while(--_0x138202){_0x5ecc63['push'](_0x5ecc63['shift']());}};_0x56e65f(++_0x110d0d);}(_0x0e85,0x7c));var _0x50e8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e85[_0x4565bf];return _0x5610ba;};'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 _0xb43b=['../../components/interaction/service','../../config/environment','./tag.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x544c44,_0x12a2b9){var _0x95e2bb=function(_0x13af62){while(--_0x13af62){_0x544c44['push'](_0x544c44['shift']());}};_0x95e2bb(++_0x12a2b9);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2bf8f5,_0x33a3d2){_0x2bf8f5=_0x2bf8f5-0x0;var _0xbdadd4=_0xb43b[_0x2bf8f5];return _0xbdadd4;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0x10')]('/',auth['isAuthenticated'](),controller[_0xbb43('0x11')]);router[_0xbb43('0x12')](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x13')]);router[_0xbb43('0x14')]('/:id',auth[_0xbb43('0xb')](),controller[_0xbb43('0x15')]);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 bec49f9..26ebb63 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x236c=['#0091EA','sequelize','STRING','name'];(function(_0x279841,_0x35b3c2){var _0x10b7dd=function(_0x3ab681){while(--_0x3ab681){_0x279841['push'](_0x279841['shift']());}};_0x10b7dd(++_0x35b3c2);}(_0x236c,0x155));var _0xc236=function(_0xf10433,_0x1892d8){_0xf10433=_0xf10433-0x0;var _0xf0a6bb=_0x236c[_0xf10433];return _0xf0a6bb;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'name':{'type':Sequelize[_0xc236('0x1')],'unique':_0xc236('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc236('0x1')],'defaultValue':_0xc236('0x3')},'description':{'type':Sequelize[_0xc236('0x1')]}}; \ No newline at end of file +var _0x082b=['name','#0091EA','sequelize','exports','STRING'];(function(_0x4d88b1,_0x13fa4e){var _0x47061e=function(_0x4fd1c2){while(--_0x4fd1c2){_0x4d88b1['push'](_0x4d88b1['shift']());}};_0x47061e(++_0x13fa4e);}(_0x082b,0x1ec));var _0xb082=function(_0x39b812,_0xd23bca){_0x39b812=_0x39b812-0x0;var _0x3e33de=_0x082b[_0x39b812];return _0x3e33de;};'use strict';var Sequelize=require(_0xb082('0x0'));module[_0xb082('0x1')]={'name':{'type':Sequelize[_0xb082('0x2')],'unique':_0xb082('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xb082('0x4')},'description':{'type':Sequelize[_0xb082('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7774220..524e19e 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 _0xca72=['model','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','rows','show','params','includeAll','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Tags','UserProfileResource','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes'];(function(_0x2a5755,_0x17f587){var _0x1700da=function(_0x40c908){while(--_0x40c908){_0x2a5755['push'](_0x2a5755['shift']());}};_0x1700da(++_0x17f587);}(_0xca72,0x1bf));var _0x2ca7=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xca72[_0x43b584];return _0x48f27b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ca7('0x0'));var zipdir=require(_0x2ca7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ca7('0x2'));var moment=require('moment');var BPromise=require(_0x2ca7('0x3'));var Mustache=require(_0x2ca7('0x4'));var util=require(_0x2ca7('0x5'));var path=require(_0x2ca7('0x6'));var sox=require('sox');var csv=require(_0x2ca7('0x7'));var ejs=require(_0x2ca7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ca7('0x9'));var squel=require(_0x2ca7('0xa'));var crypto=require('crypto');var jsforce=require(_0x2ca7('0xb'));var deskjs=require(_0x2ca7('0xc'));var toCsv=require(_0x2ca7('0x7'));var querystring=require(_0x2ca7('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ca7('0xe'));var authService=require(_0x2ca7('0xf'));var qs=require(_0x2ca7('0x10'));var as=require(_0x2ca7('0x11'));var hardwareService=require(_0x2ca7('0x12'));var logger=require(_0x2ca7('0x13'))(_0x2ca7('0x14'));var utils=require(_0x2ca7('0x15'));var config=require(_0x2ca7('0x16'));var licenseUtil=require(_0x2ca7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ca2d3,_0x4c39df){_0x4c39df=_0x4c39df||0xcc;return function(_0x1131d9){if(_0x1131d9){return _0x2ca2d3[_0x2ca7('0x18')](_0x4c39df);}return _0x2ca2d3[_0x2ca7('0x19')](_0x4c39df)[_0x2ca7('0x1a')]();};}function respondWithResult(_0x53e1be,_0x18ebcc){_0x18ebcc=_0x18ebcc||0xc8;return function(_0x545c5e){if(_0x545c5e){return _0x53e1be[_0x2ca7('0x19')](_0x18ebcc)[_0x2ca7('0x1b')](_0x545c5e);}};}function respondWithFilteredResult(_0x9ff647,_0x2362f4){return function(_0x296f92){if(_0x296f92){var _0x409ef5=typeof _0x2362f4[_0x2ca7('0x1c')]===_0x2ca7('0x1d')&&typeof _0x2362f4[_0x2ca7('0x1e')]===_0x2ca7('0x1d');var _0x4d9a07=_0x296f92[_0x2ca7('0x1f')];var _0x26a4c8=_0x409ef5?0x0:_0x2362f4[_0x2ca7('0x1c')];var _0x2665af=_0x409ef5?_0x296f92[_0x2ca7('0x1f')]:_0x2362f4[_0x2ca7('0x1c')]+_0x2362f4[_0x2ca7('0x1e')];var _0x310ecd;if(_0x2665af>=_0x4d9a07){_0x2665af=_0x4d9a07;_0x310ecd=0xc8;}else{_0x310ecd=0xce;}_0x9ff647[_0x2ca7('0x19')](_0x310ecd);return _0x9ff647[_0x2ca7('0x20')](_0x2ca7('0x21'),_0x26a4c8+'-'+_0x2665af+'/'+_0x4d9a07)[_0x2ca7('0x1b')](_0x296f92);}return null;};}function patchUpdates(_0x798f81){return function(_0x1d4965){try{jsonpatch[_0x2ca7('0x22')](_0x1d4965,_0x798f81,!![]);}catch(_0x517a65){return BPromise[_0x2ca7('0x23')](_0x517a65);}return _0x1d4965[_0x2ca7('0x24')]();};}function saveUpdates(_0x1a1217,_0x3c8961){return function(_0x3a0c9d){if(_0x3a0c9d){return _0x3a0c9d[_0x2ca7('0x25')](_0x1a1217)['then'](function(_0x2ff281){return _0x2ff281;});}return null;};}function removeEntity(_0x469732,_0x28ba3a){return function(_0x17ad56){if(_0x17ad56){return _0x17ad56[_0x2ca7('0x26')]()[_0x2ca7('0x27')](function(){var _0x4d1a0f=_0x17ad56[_0x2ca7('0x28')]({'plain':!![]});var _0x11b68f=_0x2ca7('0x29');return db[_0x2ca7('0x2a')]['destroy']({'where':{'type':_0x11b68f,'resourceId':_0x4d1a0f['id']}})[_0x2ca7('0x27')](function(){return _0x17ad56;});})[_0x2ca7('0x27')](function(){_0x469732[_0x2ca7('0x19')](0xcc)[_0x2ca7('0x1a')]();});}};}function handleEntityNotFound(_0x5ca1b5,_0x49634b){return function(_0x53b998){if(!_0x53b998){_0x5ca1b5['sendStatus'](0x194);}return _0x53b998;};}function handleError(_0x79e3c3,_0x553ede){_0x553ede=_0x553ede||0x1f4;return function(_0x353e92){logger[_0x2ca7('0x2b')](_0x353e92[_0x2ca7('0x2c')]);if(_0x353e92['name']){delete _0x353e92[_0x2ca7('0x2d')];}_0x79e3c3[_0x2ca7('0x19')](_0x553ede)['send'](_0x353e92);};}exports[_0x2ca7('0x2e')]=function(_0x1b5e72,_0x2eae2f){var _0x1fa9fe={},_0x9d1824={},_0x69a7fd={'count':0x0,'rows':[]};var _0x5611c5=_[_0x2ca7('0x2f')](db[_0x2ca7('0x30')][_0x2ca7('0x31')],function(_0x4c95bd){return{'name':_0x4c95bd[_0x2ca7('0x32')],'type':_0x4c95bd[_0x2ca7('0x33')]['key']};});_0x9d1824['model']=_[_0x2ca7('0x2f')](_0x5611c5,_0x2ca7('0x2d'));_0x9d1824['query']=_[_0x2ca7('0x34')](_0x1b5e72[_0x2ca7('0x35')]);_0x9d1824[_0x2ca7('0x36')]=_[_0x2ca7('0x37')](_0x9d1824['model'],_0x9d1824['query']);_0x1fa9fe[_0x2ca7('0x38')]=_[_0x2ca7('0x37')](_0x9d1824[_0x2ca7('0x39')],qs[_0x2ca7('0x3a')](_0x1b5e72[_0x2ca7('0x35')]['fields']));_0x1fa9fe[_0x2ca7('0x38')]=_0x1fa9fe['attributes'][_0x2ca7('0x3b')]?_0x1fa9fe[_0x2ca7('0x38')]:_0x9d1824[_0x2ca7('0x39')];if(!_0x1b5e72[_0x2ca7('0x35')][_0x2ca7('0x3c')]('nolimit')){_0x1fa9fe[_0x2ca7('0x1e')]=qs[_0x2ca7('0x1e')](_0x1b5e72[_0x2ca7('0x35')][_0x2ca7('0x1e')]);_0x1fa9fe[_0x2ca7('0x1c')]=qs[_0x2ca7('0x1c')](_0x1b5e72['query']['offset']);}_0x1fa9fe[_0x2ca7('0x3d')]=qs['sort'](_0x1b5e72['query'][_0x2ca7('0x3e')]);_0x1fa9fe[_0x2ca7('0x3f')]=qs[_0x2ca7('0x36')](_['pick'](_0x1b5e72[_0x2ca7('0x35')],_0x9d1824['filters']),_0x5611c5);if(_0x1b5e72[_0x2ca7('0x35')][_0x2ca7('0x40')]){_0x1fa9fe['where']=_[_0x2ca7('0x41')](_0x1fa9fe[_0x2ca7('0x3f')],{'$or':_[_0x2ca7('0x2f')](_0x5611c5,function(_0x413ddd){if(_0x413ddd['type']!==_0x2ca7('0x42')){var _0x442783={};_0x442783[_0x413ddd[_0x2ca7('0x2d')]]={'$like':'%'+_0x1b5e72[_0x2ca7('0x35')][_0x2ca7('0x40')]+'%'};return _0x442783;}})});}_0x1fa9fe=_['merge']({},_0x1fa9fe,_0x1b5e72['options']);var _0x47fb84={'where':_0x1fa9fe[_0x2ca7('0x3f')]};return db[_0x2ca7('0x30')][_0x2ca7('0x1f')](_0x47fb84)['then'](function(_0x249ab6){_0x69a7fd['count']=_0x249ab6;if(_0x1b5e72[_0x2ca7('0x35')]['includeAll']){_0x1fa9fe['include']=[{'all':!![]}];}return db[_0x2ca7('0x30')]['findAll'](_0x1fa9fe);})[_0x2ca7('0x27')](function(_0x53a88e){_0x69a7fd[_0x2ca7('0x43')]=_0x53a88e;return _0x69a7fd;})[_0x2ca7('0x27')](respondWithFilteredResult(_0x2eae2f,_0x1fa9fe))['catch'](handleError(_0x2eae2f,null));};exports[_0x2ca7('0x44')]=function(_0x36a342,_0x2193d7){var _0x20c0e4={'raw':!![],'where':{'id':_0x36a342[_0x2ca7('0x45')]['id']}},_0x5f0309={};_0x5f0309[_0x2ca7('0x39')]=_[_0x2ca7('0x34')](db[_0x2ca7('0x30')]['rawAttributes']);_0x5f0309['query']=_[_0x2ca7('0x34')](_0x36a342[_0x2ca7('0x35')]);_0x5f0309['filters']=_[_0x2ca7('0x37')](_0x5f0309[_0x2ca7('0x39')],_0x5f0309['query']);_0x20c0e4[_0x2ca7('0x38')]=_[_0x2ca7('0x37')](_0x5f0309['model'],qs['fields'](_0x36a342[_0x2ca7('0x35')][_0x2ca7('0x3a')]));_0x20c0e4[_0x2ca7('0x38')]=_0x20c0e4['attributes']['length']?_0x20c0e4['attributes']:_0x5f0309[_0x2ca7('0x39')];if(_0x36a342[_0x2ca7('0x35')][_0x2ca7('0x46')]){_0x20c0e4[_0x2ca7('0x47')]=[{'all':!![]}];}_0x20c0e4=_[_0x2ca7('0x41')]({},_0x20c0e4,_0x36a342[_0x2ca7('0x48')]);return db[_0x2ca7('0x30')][_0x2ca7('0x49')](_0x20c0e4)[_0x2ca7('0x27')](handleEntityNotFound(_0x2193d7,null))['then'](respondWithResult(_0x2193d7,null))[_0x2ca7('0x4a')](handleError(_0x2193d7,null));};exports[_0x2ca7('0x4b')]=function(_0x2bf39f,_0x5d290f){return db[_0x2ca7('0x30')][_0x2ca7('0x4b')](_0x2bf39f[_0x2ca7('0x4c')],{})[_0x2ca7('0x27')](function(_0x55f9dc){var _0x22a4c1=_0x2bf39f[_0x2ca7('0x4d')][_0x2ca7('0x28')]({'plain':!![]});if(!_0x22a4c1)throw new Error(_0x2ca7('0x4e'));if(_0x22a4c1[_0x2ca7('0x4f')]===_0x2ca7('0x4d')){var _0x1171a9=_0x55f9dc[_0x2ca7('0x28')]({'plain':!![]});var _0x39086b=_0x2ca7('0x29');return db['UserProfileSection'][_0x2ca7('0x49')]({'where':{'name':_0x39086b,'userProfileId':_0x22a4c1[_0x2ca7('0x50')]},'raw':!![]})[_0x2ca7('0x27')](function(_0x29ebfb){if(_0x29ebfb&&_0x29ebfb[_0x2ca7('0x51')]===0x0){return db[_0x2ca7('0x2a')][_0x2ca7('0x4b')]({'name':_0x1171a9['name'],'resourceId':_0x1171a9['id'],'type':_0x29ebfb[_0x2ca7('0x2d')],'sectionId':_0x29ebfb['id']},{})['then'](function(){return _0x55f9dc;});}else{return _0x55f9dc;}})['catch'](function(_0x5e9569){logger[_0x2ca7('0x2b')](_0x2ca7('0x52'),_0x5e9569);throw _0x5e9569;});}return _0x55f9dc;})[_0x2ca7('0x27')](respondWithResult(_0x5d290f,0xc9))[_0x2ca7('0x4a')](handleError(_0x5d290f,null));};exports[_0x2ca7('0x25')]=function(_0x2bb539,_0x35268b){if(_0x2bb539[_0x2ca7('0x4c')]['id']){delete _0x2bb539[_0x2ca7('0x4c')]['id'];}return db['Tag'][_0x2ca7('0x49')]({'where':{'id':_0x2bb539[_0x2ca7('0x45')]['id']}})[_0x2ca7('0x27')](handleEntityNotFound(_0x35268b,null))[_0x2ca7('0x27')](saveUpdates(_0x2bb539[_0x2ca7('0x4c')],null))[_0x2ca7('0x27')](respondWithResult(_0x35268b,null))[_0x2ca7('0x4a')](handleError(_0x35268b,null));};exports['destroy']=function(_0x18df46,_0x4fd3c1){return db[_0x2ca7('0x30')]['find']({'where':{'id':_0x18df46[_0x2ca7('0x45')]['id']}})[_0x2ca7('0x27')](handleEntityNotFound(_0x4fd3c1,null))[_0x2ca7('0x27')](removeEntity(_0x4fd3c1,null))[_0x2ca7('0x4a')](handleError(_0x4fd3c1,null));};exports[_0x2ca7('0x53')]=function(_0xa3db33,_0x4e1ba2){return db[_0x2ca7('0x30')][_0x2ca7('0x53')]()[_0x2ca7('0x27')](respondWithResult(_0x4e1ba2,null))['catch'](handleError(_0x4e1ba2,null));}; \ No newline at end of file +var _0xb7b5=['length','hasOwnProperty','nolimit','order','where','pick','filters','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x3486d5,_0x7c19f3){var _0x4d5c6e=function(_0x4fe38c){while(--_0x4fe38c){_0x3486d5['push'](_0x3486d5['shift']());}};_0x4d5c6e(++_0x7c19f3);}(_0xb7b5,0x75));var _0x5b7b=function(_0x464b1c,_0x38fa45){_0x464b1c=_0x464b1c-0x0;var _0x4187c3=_0xb7b5[_0x464b1c];return _0x4187c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b7b('0x0'));var zipdir=require(_0x5b7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b7b('0x2'));var moment=require(_0x5b7b('0x3'));var BPromise=require(_0x5b7b('0x4'));var Mustache=require(_0x5b7b('0x5'));var util=require(_0x5b7b('0x6'));var path=require(_0x5b7b('0x7'));var sox=require(_0x5b7b('0x8'));var csv=require('to-csv');var ejs=require(_0x5b7b('0x9'));var fs=require('fs');var fs_extra=require(_0x5b7b('0xa'));var _=require(_0x5b7b('0xb'));var squel=require(_0x5b7b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b7b('0xd'));var toCsv=require(_0x5b7b('0xe'));var querystring=require(_0x5b7b('0xf'));var Papa=require(_0x5b7b('0x10'));var Redis=require(_0x5b7b('0x11'));var authService=require(_0x5b7b('0x12'));var qs=require(_0x5b7b('0x13'));var as=require(_0x5b7b('0x14'));var hardwareService=require(_0x5b7b('0x15'));var logger=require(_0x5b7b('0x16'))(_0x5b7b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b7b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28bae3,_0x9c64b0){_0x9c64b0=_0x9c64b0||0xcc;return function(_0x1f93b4){if(_0x1f93b4){return _0x28bae3['sendStatus'](_0x9c64b0);}return _0x28bae3[_0x5b7b('0x19')](_0x9c64b0)[_0x5b7b('0x1a')]();};}function respondWithResult(_0x298503,_0x28eaf4){_0x28eaf4=_0x28eaf4||0xc8;return function(_0x17f9a2){if(_0x17f9a2){return _0x298503[_0x5b7b('0x19')](_0x28eaf4)[_0x5b7b('0x1b')](_0x17f9a2);}};}function respondWithFilteredResult(_0x26af3b,_0x4b7575){return function(_0x1d9072){if(_0x1d9072){var _0x1d1e46=typeof _0x4b7575[_0x5b7b('0x1c')]===_0x5b7b('0x1d')&&typeof _0x4b7575[_0x5b7b('0x1e')]===_0x5b7b('0x1d');var _0x5e3280=_0x1d9072['count'];var _0x1f098a=_0x1d1e46?0x0:_0x4b7575[_0x5b7b('0x1c')];var _0x299220=_0x1d1e46?_0x1d9072['count']:_0x4b7575[_0x5b7b('0x1c')]+_0x4b7575['limit'];var _0x49000a;if(_0x299220>=_0x5e3280){_0x299220=_0x5e3280;_0x49000a=0xc8;}else{_0x49000a=0xce;}_0x26af3b[_0x5b7b('0x19')](_0x49000a);return _0x26af3b[_0x5b7b('0x1f')]('Content-Range',_0x1f098a+'-'+_0x299220+'/'+_0x5e3280)[_0x5b7b('0x1b')](_0x1d9072);}return null;};}function patchUpdates(_0x12f8cd){return function(_0x555e4e){try{jsonpatch[_0x5b7b('0x20')](_0x555e4e,_0x12f8cd,!![]);}catch(_0x5233b9){return BPromise[_0x5b7b('0x21')](_0x5233b9);}return _0x555e4e[_0x5b7b('0x22')]();};}function saveUpdates(_0x205388,_0x4db367){return function(_0xfad05){if(_0xfad05){return _0xfad05[_0x5b7b('0x23')](_0x205388)[_0x5b7b('0x24')](function(_0x432223){return _0x432223;});}return null;};}function removeEntity(_0x5a8fad,_0x18c61c){return function(_0x126fe6){if(_0x126fe6){return _0x126fe6[_0x5b7b('0x25')]()[_0x5b7b('0x24')](function(){var _0x3cea02=_0x126fe6['get']({'plain':!![]});var _0x5a4b3a=_0x5b7b('0x26');return db[_0x5b7b('0x27')][_0x5b7b('0x25')]({'where':{'type':_0x5a4b3a,'resourceId':_0x3cea02['id']}})['then'](function(){return _0x126fe6;});})[_0x5b7b('0x24')](function(){_0x5a8fad[_0x5b7b('0x19')](0xcc)[_0x5b7b('0x1a')]();});}};}function handleEntityNotFound(_0x1dda05,_0x38698f){return function(_0x4eae75){if(!_0x4eae75){_0x1dda05['sendStatus'](0x194);}return _0x4eae75;};}function handleError(_0x325d94,_0x49d8fc){_0x49d8fc=_0x49d8fc||0x1f4;return function(_0x5f346d){logger[_0x5b7b('0x28')](_0x5f346d[_0x5b7b('0x29')]);if(_0x5f346d[_0x5b7b('0x2a')]){delete _0x5f346d[_0x5b7b('0x2a')];}_0x325d94['status'](_0x49d8fc)[_0x5b7b('0x2b')](_0x5f346d);};}exports[_0x5b7b('0x2c')]=function(_0x38c4d0,_0x42b4db){var _0x30dbd7={},_0x4d20be={},_0x47e8a0={'count':0x0,'rows':[]};var _0x31eb45=_[_0x5b7b('0x2d')](db[_0x5b7b('0x2e')][_0x5b7b('0x2f')],function(_0xe22b58){return{'name':_0xe22b58[_0x5b7b('0x30')],'type':_0xe22b58[_0x5b7b('0x31')][_0x5b7b('0x32')]};});_0x4d20be[_0x5b7b('0x33')]=_[_0x5b7b('0x2d')](_0x31eb45,'name');_0x4d20be[_0x5b7b('0x34')]=_[_0x5b7b('0x35')](_0x38c4d0[_0x5b7b('0x34')]);_0x4d20be['filters']=_[_0x5b7b('0x36')](_0x4d20be[_0x5b7b('0x33')],_0x4d20be[_0x5b7b('0x34')]);_0x30dbd7[_0x5b7b('0x37')]=_[_0x5b7b('0x36')](_0x4d20be[_0x5b7b('0x33')],qs['fields'](_0x38c4d0[_0x5b7b('0x34')][_0x5b7b('0x38')]));_0x30dbd7[_0x5b7b('0x37')]=_0x30dbd7[_0x5b7b('0x37')][_0x5b7b('0x39')]?_0x30dbd7[_0x5b7b('0x37')]:_0x4d20be['model'];if(!_0x38c4d0[_0x5b7b('0x34')][_0x5b7b('0x3a')](_0x5b7b('0x3b'))){_0x30dbd7[_0x5b7b('0x1e')]=qs['limit'](_0x38c4d0['query'][_0x5b7b('0x1e')]);_0x30dbd7[_0x5b7b('0x1c')]=qs[_0x5b7b('0x1c')](_0x38c4d0[_0x5b7b('0x34')][_0x5b7b('0x1c')]);}_0x30dbd7[_0x5b7b('0x3c')]=qs['sort'](_0x38c4d0[_0x5b7b('0x34')]['sort']);_0x30dbd7[_0x5b7b('0x3d')]=qs['filters'](_[_0x5b7b('0x3e')](_0x38c4d0['query'],_0x4d20be[_0x5b7b('0x3f')]),_0x31eb45);if(_0x38c4d0[_0x5b7b('0x34')]['filter']){_0x30dbd7[_0x5b7b('0x3d')]=_[_0x5b7b('0x40')](_0x30dbd7['where'],{'$or':_['map'](_0x31eb45,function(_0x3aff25){if(_0x3aff25[_0x5b7b('0x31')]!==_0x5b7b('0x41')){var _0xd3d78b={};_0xd3d78b[_0x3aff25[_0x5b7b('0x2a')]]={'$like':'%'+_0x38c4d0[_0x5b7b('0x34')][_0x5b7b('0x42')]+'%'};return _0xd3d78b;}})});}_0x30dbd7=_[_0x5b7b('0x40')]({},_0x30dbd7,_0x38c4d0[_0x5b7b('0x43')]);var _0xa89042={'where':_0x30dbd7[_0x5b7b('0x3d')]};return db[_0x5b7b('0x2e')][_0x5b7b('0x44')](_0xa89042)['then'](function(_0x5e2903){_0x47e8a0[_0x5b7b('0x44')]=_0x5e2903;if(_0x38c4d0[_0x5b7b('0x34')]['includeAll']){_0x30dbd7[_0x5b7b('0x45')]=[{'all':!![]}];}return db['Tag'][_0x5b7b('0x46')](_0x30dbd7);})[_0x5b7b('0x24')](function(_0x53aef9){_0x47e8a0[_0x5b7b('0x47')]=_0x53aef9;return _0x47e8a0;})['then'](respondWithFilteredResult(_0x42b4db,_0x30dbd7))[_0x5b7b('0x48')](handleError(_0x42b4db,null));};exports[_0x5b7b('0x49')]=function(_0x2ee7a6,_0x45540c){var _0x21d150={'raw':!![],'where':{'id':_0x2ee7a6[_0x5b7b('0x4a')]['id']}},_0x27170a={};_0x27170a[_0x5b7b('0x33')]=_[_0x5b7b('0x35')](db['Tag']['rawAttributes']);_0x27170a['query']=_[_0x5b7b('0x35')](_0x2ee7a6[_0x5b7b('0x34')]);_0x27170a[_0x5b7b('0x3f')]=_[_0x5b7b('0x36')](_0x27170a[_0x5b7b('0x33')],_0x27170a['query']);_0x21d150['attributes']=_['intersection'](_0x27170a['model'],qs[_0x5b7b('0x38')](_0x2ee7a6['query']['fields']));_0x21d150['attributes']=_0x21d150[_0x5b7b('0x37')][_0x5b7b('0x39')]?_0x21d150[_0x5b7b('0x37')]:_0x27170a['model'];if(_0x2ee7a6[_0x5b7b('0x34')][_0x5b7b('0x4b')]){_0x21d150[_0x5b7b('0x45')]=[{'all':!![]}];}_0x21d150=_[_0x5b7b('0x40')]({},_0x21d150,_0x2ee7a6[_0x5b7b('0x43')]);return db[_0x5b7b('0x2e')][_0x5b7b('0x4c')](_0x21d150)[_0x5b7b('0x24')](handleEntityNotFound(_0x45540c,null))['then'](respondWithResult(_0x45540c,null))[_0x5b7b('0x48')](handleError(_0x45540c,null));};exports[_0x5b7b('0x4d')]=function(_0x159e29,_0x30bf01){return db[_0x5b7b('0x2e')][_0x5b7b('0x4d')](_0x159e29[_0x5b7b('0x4e')],{})[_0x5b7b('0x24')](function(_0x4ac50b){var _0x5c9950=_0x159e29['user'][_0x5b7b('0x4f')]({'plain':!![]});if(!_0x5c9950)throw new Error(_0x5b7b('0x50'));if(_0x5c9950['role']===_0x5b7b('0x51')){var _0x4d64e2=_0x4ac50b[_0x5b7b('0x4f')]({'plain':!![]});var _0x59e53f='Tags';return db[_0x5b7b('0x52')][_0x5b7b('0x4c')]({'where':{'name':_0x59e53f,'userProfileId':_0x5c9950[_0x5b7b('0x53')]},'raw':!![]})[_0x5b7b('0x24')](function(_0x520053){if(_0x520053&&_0x520053[_0x5b7b('0x54')]===0x0){return db[_0x5b7b('0x27')][_0x5b7b('0x4d')]({'name':_0x4d64e2[_0x5b7b('0x2a')],'resourceId':_0x4d64e2['id'],'type':_0x520053[_0x5b7b('0x2a')],'sectionId':_0x520053['id']},{})['then'](function(){return _0x4ac50b;});}else{return _0x4ac50b;}})[_0x5b7b('0x48')](function(_0x143fe8){logger[_0x5b7b('0x28')](_0x5b7b('0x55'),_0x143fe8);throw _0x143fe8;});}return _0x4ac50b;})[_0x5b7b('0x24')](respondWithResult(_0x30bf01,0xc9))['catch'](handleError(_0x30bf01,null));};exports[_0x5b7b('0x23')]=function(_0x48ee11,_0x1cd6fa){if(_0x48ee11[_0x5b7b('0x4e')]['id']){delete _0x48ee11[_0x5b7b('0x4e')]['id'];}return db[_0x5b7b('0x2e')]['find']({'where':{'id':_0x48ee11['params']['id']}})[_0x5b7b('0x24')](handleEntityNotFound(_0x1cd6fa,null))[_0x5b7b('0x24')](saveUpdates(_0x48ee11['body'],null))[_0x5b7b('0x24')](respondWithResult(_0x1cd6fa,null))['catch'](handleError(_0x1cd6fa,null));};exports[_0x5b7b('0x25')]=function(_0x5b85ac,_0x3048ef){return db['Tag'][_0x5b7b('0x4c')]({'where':{'id':_0x5b85ac[_0x5b7b('0x4a')]['id']}})[_0x5b7b('0x24')](handleEntityNotFound(_0x3048ef,null))[_0x5b7b('0x24')](removeEntity(_0x3048ef,null))[_0x5b7b('0x48')](handleError(_0x3048ef,null));};exports['describe']=function(_0x455cbe,_0x1e36c2){return db[_0x5b7b('0x2e')][_0x5b7b('0x56')]()[_0x5b7b('0x24')](respondWithResult(_0x1e36c2,null))[_0x5b7b('0x48')](handleError(_0x1e36c2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 9d9ee8a..717f6c5 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 _0x9b40=['define','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x5c2b64,_0x12a6e7){var _0x584eb6=function(_0x4d1018){while(--_0x4d1018){_0x5c2b64['push'](_0x5c2b64['shift']());}};_0x584eb6(++_0x12a6e7);}(_0x9b40,0xf6));var _0x09b4=function(_0x2b0327,_0x1b16c0){_0x2b0327=_0x2b0327-0x0;var _0x2a2f2c=_0x9b40[_0x2b0327];return _0x2a2f2c;};'use strict';var _=require('lodash');var util=require(_0x09b4('0x0'));var logger=require('../../config/logger')(_0x09b4('0x1'));var moment=require(_0x09b4('0x2'));var BPromise=require(_0x09b4('0x3'));var rp=require(_0x09b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x09b4('0x5'));var attributes=require('./tag.attributes');module['exports']=function(_0x20e14b,_0x535359){return _0x20e14b[_0x09b4('0x6')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d57=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_tags','util','api'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x2d57,0x17a));var _0x72d5=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x2d57[_0x282a1f];return _0x296ea7;};'use strict';var _=require('lodash');var util=require(_0x72d5('0x0'));var logger=require('../../config/logger')(_0x72d5('0x1'));var moment=require(_0x72d5('0x2'));var BPromise=require(_0x72d5('0x3'));var rp=require(_0x72d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72d5('0x5'));var config=require(_0x72d5('0x6'));var attributes=require('./tag.attributes');module[_0x72d5('0x7')]=function(_0x10ffe7,_0x40680f){return _0x10ffe7[_0x72d5('0x8')]('Tag',attributes,{'tableName':_0x72d5('0x9'),'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 4291ca3..79b4cc9 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','Tag,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x53a02b,_0x5540cf){var _0x549e87=function(_0x26eed7){while(--_0x26eed7){_0x53a02b['push'](_0x53a02b['shift']());}};_0x549e87(++_0x5540cf);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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']('Tag,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('Tag,\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')]('Tag,\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')]('Tag,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5577,0x1b4));var _0x7557=function(_0x58521c,_0xe5b828){_0x58521c=_0x58521c-0x0;var _0x14d891=_0x5577[_0x58521c];return _0x14d891;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('Tag,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('Tag,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 9d174e1..c45e2cc 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(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 b564950..1d30fd4 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 _0xd8b0=['exports','sequelize'];(function(_0xe4326d,_0x25784d){var _0xd1ff82=function(_0x4908ad){while(--_0x4908ad){_0xe4326d['push'](_0xe4326d['shift']());}};_0xd1ff82(++_0x25784d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 e10f781..b910ffd 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 _0x1228=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','Team','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','catch','show','params','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','userProfileId','autoAssociation','UserProfileResource','error','body','destroy','sequelize','QueryTypes','SELECT','Sequelize','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','Queue','capitalize','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Mail','Fax','Openchannel','transaction','through','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','penalty','all','TeamVoicePrefix','upsert','spread','removeAgents','isArray','Chat','Whatsapp','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x8e5815,_0x2892a0){var _0x28396b=function(_0x4179c8){while(--_0x4179c8){_0x8e5815['push'](_0x8e5815['shift']());}};_0x28396b(++_0x2892a0);}(_0x1228,0x8f));var _0x8122=function(_0x2af627,_0x33d47f){_0x2af627=_0x2af627-0x0;var _0x14eda9=_0x1228[_0x2af627];return _0x14eda9;};'use strict';var emlformat=require(_0x8122('0x0'));var rimraf=require(_0x8122('0x1'));var zipdir=require(_0x8122('0x2'));var jsonpatch=require(_0x8122('0x3'));var rp=require('request-promise');var moment=require(_0x8122('0x4'));var BPromise=require(_0x8122('0x5'));var Mustache=require(_0x8122('0x6'));var util=require(_0x8122('0x7'));var path=require(_0x8122('0x8'));var sox=require(_0x8122('0x9'));var csv=require(_0x8122('0xa'));var ejs=require(_0x8122('0xb'));var fs=require('fs');var fs_extra=require(_0x8122('0xc'));var _=require(_0x8122('0xd'));var squel=require('squel');var crypto=require(_0x8122('0xe'));var jsforce=require(_0x8122('0xf'));var deskjs=require(_0x8122('0x10'));var toCsv=require(_0x8122('0xa'));var querystring=require(_0x8122('0x11'));var Papa=require('papaparse');var Redis=require(_0x8122('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8122('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8122('0x14'));var utils=require(_0x8122('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8122('0x16'));var db=require(_0x8122('0x17'))['db'];config['redis']=_[_0x8122('0x18')](config[_0x8122('0x19')],{'host':_0x8122('0x1a'),'port':0x18eb});var socket=require(_0x8122('0x1b'))(new Redis(config[_0x8122('0x19')]));require(_0x8122('0x1c'))['register'](socket);function respondWithStatusCode(_0x3f8f5f,_0x4c7ffc){_0x4c7ffc=_0x4c7ffc||0xcc;return function(_0x2ad03a){if(_0x2ad03a){return _0x3f8f5f[_0x8122('0x1d')](_0x4c7ffc);}return _0x3f8f5f[_0x8122('0x1e')](_0x4c7ffc)[_0x8122('0x1f')]();};}function respondWithResult(_0x380b59,_0x36ec6f){_0x36ec6f=_0x36ec6f||0xc8;return function(_0x48b31c){if(_0x48b31c){return _0x380b59[_0x8122('0x1e')](_0x36ec6f)[_0x8122('0x20')](_0x48b31c);}};}function respondWithFilteredResult(_0x1f4739,_0xa85552){return function(_0x26514d){if(_0x26514d){var _0x4c0d59=typeof _0xa85552[_0x8122('0x21')]===_0x8122('0x22')&&typeof _0xa85552['limit']==='undefined';var _0x597162=_0x26514d[_0x8122('0x23')];var _0x133197=_0x4c0d59?0x0:_0xa85552[_0x8122('0x21')];var _0x2ad105=_0x4c0d59?_0x26514d[_0x8122('0x23')]:_0xa85552[_0x8122('0x21')]+_0xa85552[_0x8122('0x24')];var _0x3d7563;if(_0x2ad105>=_0x597162){_0x2ad105=_0x597162;_0x3d7563=0xc8;}else{_0x3d7563=0xce;}_0x1f4739[_0x8122('0x1e')](_0x3d7563);return _0x1f4739[_0x8122('0x25')](_0x8122('0x26'),_0x133197+'-'+_0x2ad105+'/'+_0x597162)[_0x8122('0x20')](_0x26514d);}return null;};}function patchUpdates(_0xb4acb5){return function(_0xde1d02){try{jsonpatch[_0x8122('0x27')](_0xde1d02,_0xb4acb5,!![]);}catch(_0xcb9904){return BPromise[_0x8122('0x28')](_0xcb9904);}return _0xde1d02[_0x8122('0x29')]();};}function saveUpdates(_0x109843,_0x314288){return function(_0x1998b9){if(_0x1998b9){return _0x1998b9[_0x8122('0x2a')](_0x109843)[_0x8122('0x2b')](function(_0x16b612){return _0x16b612;});}return null;};}function handleEntityNotFound(_0xc283ec,_0x329bc8){return function(_0x23274a){if(!_0x23274a){_0xc283ec[_0x8122('0x1d')](0x194);}return _0x23274a;};}function handleError(_0x148827,_0x180ac9){_0x180ac9=_0x180ac9||0x1f4;return function(_0x44827c){logger['error'](_0x44827c[_0x8122('0x2c')]);if(_0x44827c[_0x8122('0x2d')]){delete _0x44827c[_0x8122('0x2d')];}_0x148827[_0x8122('0x1e')](_0x180ac9)[_0x8122('0x2e')](_0x44827c);};}exports[_0x8122('0x2f')]=function(_0x3e589c,_0x4020f3){var _0x43bf14={},_0x1399b9={},_0x499c43={'count':0x0,'rows':[]};var _0x4b4daa=_[_0x8122('0x30')](db[_0x8122('0x31')][_0x8122('0x32')],function(_0xfe4fc2){return{'name':_0xfe4fc2['fieldName'],'type':_0xfe4fc2[_0x8122('0x33')]['key']};});_0x1399b9[_0x8122('0x34')]=_[_0x8122('0x30')](_0x4b4daa,'name');_0x1399b9[_0x8122('0x35')]=_[_0x8122('0x36')](_0x3e589c[_0x8122('0x35')]);_0x1399b9[_0x8122('0x37')]=_[_0x8122('0x38')](_0x1399b9['model'],_0x1399b9[_0x8122('0x35')]);_0x43bf14['attributes']=_[_0x8122('0x38')](_0x1399b9[_0x8122('0x34')],qs[_0x8122('0x39')](_0x3e589c[_0x8122('0x35')][_0x8122('0x39')]));_0x43bf14[_0x8122('0x3a')]=_0x43bf14[_0x8122('0x3a')][_0x8122('0x3b')]?_0x43bf14[_0x8122('0x3a')]:_0x1399b9['model'];if(!_0x3e589c[_0x8122('0x35')]['hasOwnProperty'](_0x8122('0x3c'))){_0x43bf14[_0x8122('0x24')]=qs['limit'](_0x3e589c['query'][_0x8122('0x24')]);_0x43bf14[_0x8122('0x21')]=qs[_0x8122('0x21')](_0x3e589c[_0x8122('0x35')][_0x8122('0x21')]);}_0x43bf14[_0x8122('0x3d')]=qs[_0x8122('0x3e')](_0x3e589c[_0x8122('0x35')][_0x8122('0x3e')]);_0x43bf14[_0x8122('0x3f')]=qs[_0x8122('0x37')](_[_0x8122('0x40')](_0x3e589c[_0x8122('0x35')],_0x1399b9[_0x8122('0x37')]),_0x4b4daa);if(_0x3e589c[_0x8122('0x35')]['filter']){_0x43bf14[_0x8122('0x3f')]=_[_0x8122('0x41')](_0x43bf14[_0x8122('0x3f')],{'$or':_[_0x8122('0x30')](_0x4b4daa,function(_0x11a0d6){if(_0x11a0d6[_0x8122('0x33')]!==_0x8122('0x42')){var _0x144138={};_0x144138[_0x11a0d6[_0x8122('0x2d')]]={'$like':'%'+_0x3e589c[_0x8122('0x35')][_0x8122('0x43')]+'%'};return _0x144138;}})});}_0x43bf14=_[_0x8122('0x41')]({},_0x43bf14,_0x3e589c['options']);var _0x5159a5={'where':_0x43bf14[_0x8122('0x3f')]};return db['Team'][_0x8122('0x23')](_0x5159a5)[_0x8122('0x2b')](function(_0x329af8){_0x499c43['count']=_0x329af8;if(_0x3e589c[_0x8122('0x35')][_0x8122('0x44')]){_0x43bf14['include']=[{'all':!![]}];}return db[_0x8122('0x31')]['findAll'](_0x43bf14);})['then'](function(_0x49972e){_0x499c43['rows']=_0x49972e;return _0x499c43;})[_0x8122('0x2b')](respondWithFilteredResult(_0x4020f3,_0x43bf14))[_0x8122('0x45')](handleError(_0x4020f3,null));};exports[_0x8122('0x46')]=function(_0x52b1bc,_0xcf016){var _0x547840={'raw':![],'where':{'id':_0x52b1bc[_0x8122('0x47')]['id']}},_0x404619={};_0x404619[_0x8122('0x34')]=_[_0x8122('0x36')](db['Team'][_0x8122('0x32')]);_0x404619[_0x8122('0x35')]=_[_0x8122('0x36')](_0x52b1bc[_0x8122('0x35')]);_0x404619[_0x8122('0x37')]=_['intersection'](_0x404619['model'],_0x404619['query']);_0x547840[_0x8122('0x3a')]=_[_0x8122('0x38')](_0x404619[_0x8122('0x34')],qs[_0x8122('0x39')](_0x52b1bc[_0x8122('0x35')][_0x8122('0x39')]));_0x547840[_0x8122('0x3a')]=_0x547840['attributes']['length']?_0x547840[_0x8122('0x3a')]:_0x404619['model'];if(_0x52b1bc[_0x8122('0x35')][_0x8122('0x44')]){_0x547840[_0x8122('0x48')]=[{'all':!![]}];}_0x547840=_['merge']({},_0x547840,_0x52b1bc[_0x8122('0x49')]);return db['Team'][_0x8122('0x4a')](_0x547840)[_0x8122('0x2b')](handleEntityNotFound(_0xcf016,null))['then'](respondWithResult(_0xcf016,null))[_0x8122('0x45')](handleError(_0xcf016,null));};exports[_0x8122('0x4b')]=function(_0x29463f,_0x2dcf63){return db['Team'][_0x8122('0x4b')](_0x29463f['body'],{})[_0x8122('0x2b')](function(_0x169f74){var _0x3d3e83=_0x29463f['user']['get']({'plain':!![]});if(!_0x3d3e83)throw new Error(_0x8122('0x4c'));if(_0x3d3e83['role']===_0x8122('0x4d')){var _0x1950df=_0x169f74[_0x8122('0x4e')]({'plain':!![]});var _0x48a210='Teams';return db['UserProfileSection'][_0x8122('0x4a')]({'where':{'name':_0x48a210,'userProfileId':_0x3d3e83[_0x8122('0x4f')]},'raw':!![]})[_0x8122('0x2b')](function(_0x278419){if(_0x278419&&_0x278419[_0x8122('0x50')]===0x0){return db[_0x8122('0x51')][_0x8122('0x4b')]({'name':_0x1950df[_0x8122('0x2d')],'resourceId':_0x1950df['id'],'type':_0x278419[_0x8122('0x2d')],'sectionId':_0x278419['id']},{})['then'](function(){return _0x169f74;});}else{return _0x169f74;}})[_0x8122('0x45')](function(_0x40e676){logger[_0x8122('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40e676);throw _0x40e676;});}return _0x169f74;})[_0x8122('0x2b')](respondWithResult(_0x2dcf63,0xc9))[_0x8122('0x45')](handleError(_0x2dcf63,null));};exports[_0x8122('0x2a')]=function(_0x3ef6b4,_0x8c115c){if(_0x3ef6b4[_0x8122('0x53')]['id']){delete _0x3ef6b4[_0x8122('0x53')]['id'];}return db[_0x8122('0x31')][_0x8122('0x4a')]({'where':{'id':_0x3ef6b4[_0x8122('0x47')]['id']}})[_0x8122('0x2b')](handleEntityNotFound(_0x8c115c,null))[_0x8122('0x2b')](saveUpdates(_0x3ef6b4['body'],null))[_0x8122('0x2b')](respondWithResult(_0x8c115c,null))[_0x8122('0x45')](handleError(_0x8c115c,null));};exports[_0x8122('0x54')]=function(_0x152f39,_0x500d9f){var _0x53dc6c=_0x152f39[_0x8122('0x47')]['id'];var _0xf0ae79=[];return db[_0x8122('0x55')]['transaction'](function(_0x3e60ed){var _0x126eb8='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x53dc6c;return db[_0x8122('0x55')][_0x8122('0x35')](_0x126eb8,{'type':db['Sequelize'][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed})['then'](function(_0x532163){_0xf0ae79=_[_0x8122('0x30')](_0x532163,function(_0x4ee3e3){return Number(_0x4ee3e3['UserId']);});})[_0x8122('0x2b')](function(){var _0x17cd59='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x53dc6c;return db['sequelize'][_0x8122('0x35')](_0x17cd59,{'type':db[_0x8122('0x58')][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(_0xba0118){var _0x572623=_[_0x8122('0x30')](_0xba0118,function(_0x513704){return Number(_0x513704[_0x8122('0x59')]);});return db['UserVoiceQueue'][_0x8122('0x54')]({'where':{'UserId':{'$in':_0xf0ae79},'VoiceQueueId':{'$in':_0x572623}},'transaction':_0x3e60ed});})['then'](function(){var _0x3361a=_0x8122('0x5a')+_0x53dc6c;return db['sequelize'][_0x8122('0x35')](_0x3361a,{'type':db[_0x8122('0x58')]['QueryTypes'][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(_0x425017){var _0x2d0a1=_[_0x8122('0x30')](_0x425017,function(_0x443259){return Number(_0x443259['MailQueueId']);});return db[_0x8122('0x5b')][_0x8122('0x54')]({'where':{'UserId':{'$in':_0xf0ae79},'MailQueueId':{'$in':_0x2d0a1}},'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(){var _0xb56359='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x53dc6c;return db['sequelize'][_0x8122('0x35')](_0xb56359,{'type':db['Sequelize'][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(_0x74a030){var _0x2d070a=_[_0x8122('0x30')](_0x74a030,function(_0x21027d){return Number(_0x21027d[_0x8122('0x5c')]);});return db['UserSmsQueue'][_0x8122('0x54')]({'where':{'UserId':{'$in':_0xf0ae79},'SmsQueueId':{'$in':_0x2d070a}},'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(){var _0xf258fc=_0x8122('0x5d')+_0x53dc6c;return db[_0x8122('0x55')][_0x8122('0x35')](_0xf258fc,{'type':db[_0x8122('0x58')][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(_0x25499f){var _0x5e4dd7=_[_0x8122('0x30')](_0x25499f,function(_0x5048c2){return Number(_0x5048c2[_0x8122('0x5e')]);});return db[_0x8122('0x5f')][_0x8122('0x54')]({'where':{'UserId':{'$in':_0xf0ae79},'ChatQueueId':{'$in':_0x5e4dd7}},'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(){var _0x53344e='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x53dc6c;return db[_0x8122('0x55')][_0x8122('0x35')](_0x53344e,{'type':db[_0x8122('0x58')][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(_0x3bf650){var _0x598413=_[_0x8122('0x30')](_0x3bf650,function(_0x3689ff){return Number(_0x3689ff[_0x8122('0x60')]);});return db[_0x8122('0x61')][_0x8122('0x54')]({'where':{'UserId':{'$in':_0xf0ae79},'FaxQueueId':{'$in':_0x598413}},'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(){var _0x2093f5=_0x8122('0x62')+_0x53dc6c;return db[_0x8122('0x55')][_0x8122('0x35')](_0x2093f5,{'type':db['Sequelize'][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})['then'](function(_0x3f739b){var _0x5e5536=_[_0x8122('0x30')](_0x3f739b,function(_0x133c2e){return Number(_0x133c2e['OpenchannelQueueId']);});return db[_0x8122('0x63')]['destroy']({'where':{'UserId':{'$in':_0xf0ae79},'OpenchannelQueueId':{'$in':_0x5e5536}},'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(){var _0x3b1ae6=_0x8122('0x64')+_0x53dc6c;return db['sequelize'][_0x8122('0x35')](_0x3b1ae6,{'type':db[_0x8122('0x58')][_0x8122('0x56')][_0x8122('0x57')],'raw':!![],'transaction':_0x3e60ed});})['then'](function(_0x4f4912){var _0x271a81=_[_0x8122('0x30')](_0x4f4912,function(_0x52ec12){return Number(_0x52ec12['WhatsappQueueId']);});return db[_0x8122('0x65')][_0x8122('0x54')]({'where':{'UserId':{'$in':_0xf0ae79},'WhatsappQueueId':{'$in':_0x271a81}},'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(){return db['TeamVoicePrefix'][_0x8122('0x4a')]({'where':{'TeamId':_0x53dc6c}});})[_0x8122('0x2b')](function(_0x124e91){if(_0x124e91===null){return;}return db[_0x8122('0x66')]['destroy']({'where':{'UserId':{'$in':_0xf0ae79},'VoicePrefixId':_0x124e91[_0x8122('0x67')]},'transaction':_0x3e60ed});})['then'](function(){return db['Team'][_0x8122('0x54')]({'where':{'id':_0x53dc6c},'cascade':!![],'transaction':_0x3e60ed});})[_0x8122('0x2b')](function(_0x39deb5){if(_0x39deb5===0x0){_0x500d9f[_0x8122('0x1d')](0x194);}else{return db[_0x8122('0x51')]['destroy']({'where':{'type':_0x8122('0x68'),'resourceId':_0x53dc6c},'cascade':!![],'transaction':_0x3e60ed})[_0x8122('0x2b')](function(){_0x500d9f['status'](0xcc)[_0x8122('0x1f')]();});}})[_0x8122('0x45')](function(_0x1f735b){_0x500d9f[_0x8122('0x1e')](0x1f4)['send'](_0x1f735b);});});};exports[_0x8122('0x69')]=function(_0x35862f,_0x44248d,_0x551f41){return db[_0x8122('0x31')][_0x8122('0x6a')]({'where':{'id':_0x35862f['params']['id']}})[_0x8122('0x2b')](handleEntityNotFound(_0x44248d,null))['then'](function(_0x2d19f3){if(!_0x35862f[_0x8122('0x35')][_0x8122('0x6b')]||!utils[_0x8122('0x6c')](_0x35862f[_0x8122('0x35')][_0x8122('0x6b')])){throw new db['Sequelize'][(_0x8122('0x6d'))](_0x8122('0x6e'));}var _0x234fa1={};var _0x349c07={};_0x349c07['model']=_[_0x8122('0x36')](db[_['capitalize'](_0x35862f[_0x8122('0x35')]['channel']['toLowerCase']())+_0x8122('0x6f')][_0x8122('0x32')]);_0x349c07['query']=_[_0x8122('0x36')](_0x35862f[_0x8122('0x35')]);_0x349c07[_0x8122('0x37')]=_[_0x8122('0x38')](_0x349c07[_0x8122('0x34')],_0x349c07[_0x8122('0x35')]);_0x234fa1[_0x8122('0x3a')]=_[_0x8122('0x38')](_0x349c07[_0x8122('0x34')],qs[_0x8122('0x39')](_0x35862f['query'][_0x8122('0x39')]));_0x234fa1[_0x8122('0x3a')]=_0x234fa1[_0x8122('0x3a')][_0x8122('0x3b')]?_0x234fa1[_0x8122('0x3a')]:_0x349c07[_0x8122('0x34')];_0x234fa1[_0x8122('0x24')]=qs[_0x8122('0x24')](_0x35862f[_0x8122('0x35')][_0x8122('0x24')]);_0x234fa1[_0x8122('0x21')]=qs[_0x8122('0x21')](_0x35862f[_0x8122('0x35')][_0x8122('0x21')]);_0x234fa1['order']=qs[_0x8122('0x3e')](_0x35862f['query'][_0x8122('0x3e')]);_0x234fa1[_0x8122('0x3f')]=qs['filters'](_['pick'](_0x35862f[_0x8122('0x35')],_0x349c07[_0x8122('0x37')]));_0x234fa1=_[_0x8122('0x41')]({},_0x234fa1,_0x35862f[_0x8122('0x49')]);return _0x2d19f3['get'+_[_0x8122('0x70')](_0x35862f[_0x8122('0x35')]['channel'][_0x8122('0x71')]())+_0x8122('0x72')](_0x234fa1);})[_0x8122('0x2b')](respondWithResult(_0x44248d,null))['catch'](handleError(_0x44248d,null));};exports[_0x8122('0x73')]=function(_0x32eab5,_0x22a224,_0xb214){return db[_0x8122('0x31')][_0x8122('0x6a')]({'where':{'id':_0x32eab5[_0x8122('0x47')]['id']}})['then'](function(_0x336ac8){if(_0x336ac8){if(!_0x32eab5[_0x8122('0x53')][_0x8122('0x6b')]||!utils[_0x8122('0x6c')](_0x32eab5['body'][_0x8122('0x6b')])){throw new db['Sequelize'][(_0x8122('0x6d'))](_0x8122('0x6e'));}return _0x336ac8[_0x8122('0x74')+_['capitalize'](_0x32eab5[_0x8122('0x53')][_0x8122('0x6b')]['toLowerCase']())+'Queues'](_0x32eab5[_0x8122('0x53')][_0x8122('0x75')]);}return null;})[_0x8122('0x2b')](handleEntityNotFound(_0x22a224,null))[_0x8122('0x2b')](respondWithStatusCode(_0x22a224,null))['catch'](handleError(_0x22a224,null));};exports[_0x8122('0x76')]=function(_0x19f751,_0x4b67a9,_0x4f5e1d){return db['Team'][_0x8122('0x6a')]({'where':{'id':_0x19f751['params']['id']}})[_0x8122('0x2b')](function(_0x54687c){if(_0x54687c){if(!_0x19f751['query'][_0x8122('0x6b')]||!utils[_0x8122('0x6c')](_0x19f751[_0x8122('0x35')][_0x8122('0x6b')])){throw new db[(_0x8122('0x58'))]['ValidationError'](_0x8122('0x6e'));}return _0x54687c[_0x8122('0x77')+_[_0x8122('0x70')](_0x19f751[_0x8122('0x35')]['channel'][_0x8122('0x71')]())+_0x8122('0x72')](_0x19f751[_0x8122('0x35')][_0x8122('0x75')]);}return null;})[_0x8122('0x2b')](handleEntityNotFound(_0x4b67a9,null))[_0x8122('0x2b')](respondWithStatusCode(_0x4b67a9,null))[_0x8122('0x45')](handleError(_0x4b67a9,null));};exports[_0x8122('0x78')]=function(_0x162c0a,_0x3ecdcf){var _0x4e8d54=_['isArray'](_0x162c0a[_0x8122('0x53')][_0x8122('0x75')])?_0x162c0a[_0x8122('0x53')][_0x8122('0x75')]:[_0x162c0a[_0x8122('0x53')]['ids']];var _0x486334=_0x162c0a[_0x8122('0x47')]['id'];return db[_0x8122('0x31')][_0x8122('0x4a')]({'where':{'id':_0x486334}})[_0x8122('0x2b')](handleEntityNotFound(_0x3ecdcf,null))[_0x8122('0x2b')](function(_0x159774){if(_0x159774){var _0x33876f=[_0x8122('0x79'),'Chat',_0x8122('0x7a'),'Sms',_0x8122('0x7b'),_0x8122('0x7c'),'Whatsapp'];return db[_0x8122('0x55')][_0x8122('0x7d')](function(_0x3d3bb2){var _0x2a30f9=_[_0x8122('0x30')](_0x33876f,function(_0x80e4ba){var _0x513a54={'attributes':['id',_0x8122('0x2d')]};if(_0x80e4ba===_0x8122('0x79')){_0x513a54[_0x8122('0x7e')]={'attributes':['penalty']};}return _0x159774['get'+_0x80e4ba+_0x8122('0x72')](_0x513a54)['then'](function(_0x593594){var _0x19940d=_[_0x8122('0x30')](_0x593594,function(_0x4d9196){var _0x4a2a80=_['map'](_0x4e8d54,function(_0x3f4cb2){var _0x58996c={'where':{'UserId':_0x3f4cb2,[_0x80e4ba+_0x8122('0x7f')]:_0x4d9196['id']},'transaction':_0x3d3bb2};if(_0x80e4ba==='Voice'){_0x58996c[_0x8122('0x18')]={'penalty':_0x4d9196[_0x8122('0x80')]['penalty']};}return db[_0x8122('0x81')+_0x80e4ba+_0x8122('0x6f')][_0x8122('0x82')](_0x58996c)[_0x8122('0x2b')](function(){socket[_0x8122('0x83')](_0x8122('0x4d')+_0x80e4ba+_0x8122('0x84'),{'UserId':_0x3f4cb2,[_0x80e4ba+'QueueId']:_0x4d9196['id']});if(_0x80e4ba!=='Voice'){return;}return db['User'][_0x8122('0x85')]({'where':{'id':_0x4e8d54,'online':0x1},'attributes':['id',_0x8122('0x2d'),_0x8122('0x86'),_0x8122('0x87'),_0x8122('0x88')],'raw':!![]})[_0x8122('0x2b')](function(_0x49d77c){var _0xbec7f5=_[_0x8122('0x30')](_0x49d77c,function(_0x2765d8){return db[_0x8122('0x89')]['upsert']({'membername':_0x2765d8[_0x8122('0x2d')],'UserId':_0x2765d8['id'],'queue_name':_0x4d9196[_0x8122('0x2d')],'VoiceQueueId':_0x4d9196['id'],'interface':_[_0x8122('0x8a')](_0x2765d8['interface'])?util[_0x8122('0x8b')](_0x8122('0x8c'),_0x2765d8[_0x8122('0x2d')]):_0x2765d8[_0x8122('0x88')],'paused':_0x2765d8[_0x8122('0x87')]||![],'penalty':_0x4d9196[_0x8122('0x80')][_0x8122('0x8d')]},{'transaction':_0x3d3bb2});});return Promise['all'](_0xbec7f5);});});});return Promise[_0x8122('0x8e')](_0x4a2a80);});return Promise[_0x8122('0x8e')](_0x19940d);})[_0x8122('0x2b')](function(){return db[_0x8122('0x8f')][_0x8122('0x6a')]({'where':{'teamId':_0x486334}})[_0x8122('0x2b')](function(_0x26c88f){if(_0x26c88f){var _0x3205bb=_[_0x8122('0x30')](_0x4e8d54,function(_0x402b9e){db[_0x8122('0x66')][_0x8122('0x90')]({'UserId':_0x402b9e,'VoicePrefixId':_0x26c88f[_0x8122('0x67')]});});return Promise[_0x8122('0x8e')](_0x3205bb);}});});});return Promise[_0x8122('0x8e')](_0x2a30f9)['then'](function(){return _0x159774['addAgents'](_0x4e8d54,{'transaction':_0x3d3bb2})[_0x8122('0x91')](function(_0x1b9cbf){return _0x1b9cbf;});});});}})[_0x8122('0x2b')](respondWithResult(_0x3ecdcf,null))[_0x8122('0x45')](handleError(_0x3ecdcf,null));};exports[_0x8122('0x92')]=function(_0x3f74a2,_0x374cf5){var _0x3749c9=_[_0x8122('0x93')](_0x3f74a2[_0x8122('0x35')]['ids'])?_0x3f74a2[_0x8122('0x35')][_0x8122('0x75')]:[_0x3f74a2[_0x8122('0x35')][_0x8122('0x75')]];var _0x458de5=_0x3f74a2[_0x8122('0x47')]['id'];return db[_0x8122('0x31')][_0x8122('0x4a')]({'where':{'id':_0x458de5}})['then'](handleEntityNotFound(_0x374cf5,null))['then'](function(_0x2f7be3){if(_0x2f7be3){var _0x5e517b=[_0x8122('0x79'),_0x8122('0x94'),_0x8122('0x7a'),'Sms',_0x8122('0x7b'),_0x8122('0x7c'),_0x8122('0x95')];return db['sequelize'][_0x8122('0x7d')](function(_0x457a1b){var _0x45fbfc=_[_0x8122('0x30')](_0x5e517b,function(_0x28a1cf){var _0x5e0b71={'attributes':['id',_0x8122('0x2d')]};return _0x2f7be3[_0x8122('0x4e')+_0x28a1cf+_0x8122('0x72')](_0x5e0b71)[_0x8122('0x2b')](function(_0x524a24){var _0x1bb1b3=_[_0x8122('0x30')](_0x524a24,function(_0x3e8a98){return _0x3e8a98[_0x8122('0x92')](_0x3749c9,{'transaction':_0x457a1b})[_0x8122('0x2b')](function(){var _0xe3f04=_[_0x8122('0x30')](_0x3749c9,function(_0x3bbfca){socket[_0x8122('0x83')]('user'+_0x28a1cf+_0x8122('0x96'),{'UserId':Number(_0x3bbfca),[_0x28a1cf+_0x8122('0x7f')]:_0x3e8a98['id']});if(_0x28a1cf!=='Voice'){return;}return db[_0x8122('0x89')][_0x8122('0x54')]({'where':{'VoiceQueueId':_0x3e8a98['id'],'UserId':_0x3bbfca},'transaction':_0x457a1b});});return Promise[_0x8122('0x8e')](_0xe3f04);});});return Promise[_0x8122('0x8e')](_0x1bb1b3);});});return Promise[_0x8122('0x8e')](_0x45fbfc)[_0x8122('0x2b')](function(){return _0x2f7be3[_0x8122('0x92')](_0x3749c9,{'transaction':_0x457a1b});})[_0x8122('0x2b')](function(){return db['TeamVoicePrefix'][_0x8122('0x6a')]({'where':{'teamId':_0x458de5}})[_0x8122('0x2b')](function(_0x3f85ea){if(_0x3f85ea){var _0x3bde77=_[_0x8122('0x30')](_0x3749c9,function(_0x55c1eb){db[_0x8122('0x66')][_0x8122('0x54')]({'where':{'UserId':_0x55c1eb,'VoicePrefixId':_0x3f85ea[_0x8122('0x67')]}});});return Promise[_0x8122('0x8e')](_0x3bde77);}});});});}})[_0x8122('0x2b')](respondWithStatusCode(_0x374cf5,null))['catch'](handleError(_0x374cf5,null));};exports[_0x8122('0x97')]=function(_0x212a29,_0x4145b0,_0x47a6f6){var _0x30046d={};var _0x444d8b={};var _0x41ae29;var _0x361411;return db[_0x8122('0x31')][_0x8122('0x6a')]({'where':{'id':_0x212a29[_0x8122('0x47')]['id']}})[_0x8122('0x2b')](handleEntityNotFound(_0x4145b0,null))['then'](function(_0x11ef5f){if(_0x11ef5f){_0x41ae29=_0x11ef5f;_0x444d8b[_0x8122('0x34')]=_['keys'](db[_0x8122('0x81')][_0x8122('0x32')]);_0x444d8b[_0x8122('0x35')]=_[_0x8122('0x36')](_0x212a29['query']);_0x444d8b['filters']=_['intersection'](_0x444d8b['model'],_0x444d8b[_0x8122('0x35')]);_0x30046d[_0x8122('0x3a')]=_[_0x8122('0x38')](_0x444d8b[_0x8122('0x34')],qs['fields'](_0x212a29[_0x8122('0x35')][_0x8122('0x39')]));_0x30046d[_0x8122('0x3a')]=_0x30046d[_0x8122('0x3a')]['length']?_0x30046d[_0x8122('0x3a')]:_0x444d8b[_0x8122('0x34')];_0x30046d[_0x8122('0x3d')]=qs[_0x8122('0x3e')](_0x212a29[_0x8122('0x35')][_0x8122('0x3e')]);_0x30046d[_0x8122('0x3f')]=qs[_0x8122('0x37')](_[_0x8122('0x40')](_0x212a29['query'],_0x444d8b[_0x8122('0x37')]));if(_0x212a29['query'][_0x8122('0x43')]){_0x30046d[_0x8122('0x3f')]=_[_0x8122('0x41')](_0x30046d[_0x8122('0x3f')],{'$or':_['map'](_0x30046d[_0x8122('0x3a')],function(_0xbd27c6){var _0x172f29={};_0x172f29[_0xbd27c6]={'$like':'%'+_0x212a29[_0x8122('0x35')][_0x8122('0x43')]+'%'};return _0x172f29;})});}_0x30046d=_[_0x8122('0x41')]({},_0x30046d,_0x212a29[_0x8122('0x49')]);return _0x41ae29[_0x8122('0x97')](_0x30046d);}})['then'](function(_0x4a6ab6){if(_0x4a6ab6){_0x361411=_0x4a6ab6['length'];if(!_0x212a29[_0x8122('0x35')][_0x8122('0x98')](_0x8122('0x3c'))){_0x30046d[_0x8122('0x24')]=qs[_0x8122('0x24')](_0x212a29[_0x8122('0x35')][_0x8122('0x24')]);_0x30046d[_0x8122('0x21')]=qs['offset'](_0x212a29[_0x8122('0x35')][_0x8122('0x21')]);}return _0x41ae29[_0x8122('0x97')](_0x30046d);}})['then'](function(_0xcbe2b4){if(_0xcbe2b4){return _0xcbe2b4?{'count':_0x361411,'rows':_0xcbe2b4}:null;}})[_0x8122('0x2b')](respondWithResult(_0x4145b0,null))[_0x8122('0x45')](handleError(_0x4145b0,null));}; \ No newline at end of file +var _0xc908=['transaction','Voice','through','QueueId','penalty','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','Chat','Mail','Queue:remove','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','Team','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','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','UserVoicePrefix','VoicePrefixId','end','send','getQueues','findOne','isValidChannel','channel','Unknown\x20channel','capitalize','Queue','pick','get','Queues','addQueues','ValidationError','add','toLowerCase','removeQueues','remove','addAgents','isArray','ids','Sms','Fax','Openchannel','Whatsapp'];(function(_0x426816,_0x2bb14d){var _0xa07c0b=function(_0x382cc6){while(--_0x382cc6){_0x426816['push'](_0x426816['shift']());}};_0xa07c0b(++_0x2bb14d);}(_0xc908,0x159));var _0x8c90=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0xc908[_0x467cb0];return _0x2153f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c90('0x0'));var zipdir=require(_0x8c90('0x1'));var jsonpatch=require(_0x8c90('0x2'));var rp=require(_0x8c90('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8c90('0x4'));var util=require(_0x8c90('0x5'));var path=require(_0x8c90('0x6'));var sox=require('sox');var csv=require(_0x8c90('0x7'));var ejs=require(_0x8c90('0x8'));var fs=require('fs');var fs_extra=require(_0x8c90('0x9'));var _=require(_0x8c90('0xa'));var squel=require(_0x8c90('0xb'));var crypto=require(_0x8c90('0xc'));var jsforce=require(_0x8c90('0xd'));var deskjs=require(_0x8c90('0xe'));var toCsv=require(_0x8c90('0x7'));var querystring=require(_0x8c90('0xf'));var Papa=require(_0x8c90('0x10'));var Redis=require('ioredis');var authService=require(_0x8c90('0x11'));var qs=require(_0x8c90('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c90('0x13'));var logger=require('../../config/logger')(_0x8c90('0x14'));var utils=require('../../config/utils');var config=require(_0x8c90('0x15'));var licenseUtil=require(_0x8c90('0x16'));var db=require(_0x8c90('0x17'))['db'];config[_0x8c90('0x18')]=_[_0x8c90('0x19')](config[_0x8c90('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c90('0x1a'))(new Redis(config[_0x8c90('0x18')]));require(_0x8c90('0x1b'))[_0x8c90('0x1c')](socket);function respondWithStatusCode(_0x45243c,_0x3af84e){_0x3af84e=_0x3af84e||0xcc;return function(_0x20e184){if(_0x20e184){return _0x45243c['sendStatus'](_0x3af84e);}return _0x45243c[_0x8c90('0x1d')](_0x3af84e)['end']();};}function respondWithResult(_0x4dcec8,_0x53a5a4){_0x53a5a4=_0x53a5a4||0xc8;return function(_0x45bb5f){if(_0x45bb5f){return _0x4dcec8[_0x8c90('0x1d')](_0x53a5a4)[_0x8c90('0x1e')](_0x45bb5f);}};}function respondWithFilteredResult(_0x4e0731,_0x42f722){return function(_0x309be5){if(_0x309be5){var _0x3ab316=typeof _0x42f722[_0x8c90('0x1f')]===_0x8c90('0x20')&&typeof _0x42f722[_0x8c90('0x21')]==='undefined';var _0x185136=_0x309be5[_0x8c90('0x22')];var _0x13ef24=_0x3ab316?0x0:_0x42f722[_0x8c90('0x1f')];var _0x42a21d=_0x3ab316?_0x309be5[_0x8c90('0x22')]:_0x42f722[_0x8c90('0x1f')]+_0x42f722[_0x8c90('0x21')];var _0x1ffe46;if(_0x42a21d>=_0x185136){_0x42a21d=_0x185136;_0x1ffe46=0xc8;}else{_0x1ffe46=0xce;}_0x4e0731[_0x8c90('0x1d')](_0x1ffe46);return _0x4e0731[_0x8c90('0x23')](_0x8c90('0x24'),_0x13ef24+'-'+_0x42a21d+'/'+_0x185136)[_0x8c90('0x1e')](_0x309be5);}return null;};}function patchUpdates(_0x18a044){return function(_0x499153){try{jsonpatch[_0x8c90('0x25')](_0x499153,_0x18a044,!![]);}catch(_0x12b46b){return BPromise[_0x8c90('0x26')](_0x12b46b);}return _0x499153[_0x8c90('0x27')]();};}function saveUpdates(_0x11dd86,_0x112846){return function(_0x400b21){if(_0x400b21){return _0x400b21[_0x8c90('0x28')](_0x11dd86)[_0x8c90('0x29')](function(_0x1651fe){return _0x1651fe;});}return null;};}function handleEntityNotFound(_0x2b4fcf,_0x2ed9b0){return function(_0x3be13e){if(!_0x3be13e){_0x2b4fcf[_0x8c90('0x2a')](0x194);}return _0x3be13e;};}function handleError(_0x2271af,_0x268fd4){_0x268fd4=_0x268fd4||0x1f4;return function(_0x34b6b3){logger[_0x8c90('0x2b')](_0x34b6b3[_0x8c90('0x2c')]);if(_0x34b6b3['name']){delete _0x34b6b3[_0x8c90('0x2d')];}_0x2271af[_0x8c90('0x1d')](_0x268fd4)['send'](_0x34b6b3);};}exports[_0x8c90('0x2e')]=function(_0x1ba758,_0x1a7e4f){var _0x25a09f={},_0x1ad029={},_0x4efe3f={'count':0x0,'rows':[]};var _0x254f2c=_['map'](db[_0x8c90('0x2f')][_0x8c90('0x30')],function(_0x4fc38c){return{'name':_0x4fc38c['fieldName'],'type':_0x4fc38c['type'][_0x8c90('0x31')]};});_0x1ad029[_0x8c90('0x32')]=_[_0x8c90('0x33')](_0x254f2c,_0x8c90('0x2d'));_0x1ad029[_0x8c90('0x34')]=_[_0x8c90('0x35')](_0x1ba758[_0x8c90('0x34')]);_0x1ad029[_0x8c90('0x36')]=_[_0x8c90('0x37')](_0x1ad029[_0x8c90('0x32')],_0x1ad029[_0x8c90('0x34')]);_0x25a09f['attributes']=_[_0x8c90('0x37')](_0x1ad029[_0x8c90('0x32')],qs[_0x8c90('0x38')](_0x1ba758[_0x8c90('0x34')][_0x8c90('0x38')]));_0x25a09f['attributes']=_0x25a09f[_0x8c90('0x39')][_0x8c90('0x3a')]?_0x25a09f['attributes']:_0x1ad029[_0x8c90('0x32')];if(!_0x1ba758[_0x8c90('0x34')][_0x8c90('0x3b')]('nolimit')){_0x25a09f['limit']=qs['limit'](_0x1ba758[_0x8c90('0x34')]['limit']);_0x25a09f['offset']=qs['offset'](_0x1ba758[_0x8c90('0x34')][_0x8c90('0x1f')]);}_0x25a09f[_0x8c90('0x3c')]=qs['sort'](_0x1ba758['query'][_0x8c90('0x3d')]);_0x25a09f[_0x8c90('0x3e')]=qs['filters'](_['pick'](_0x1ba758[_0x8c90('0x34')],_0x1ad029[_0x8c90('0x36')]),_0x254f2c);if(_0x1ba758['query'][_0x8c90('0x3f')]){_0x25a09f[_0x8c90('0x3e')]=_['merge'](_0x25a09f['where'],{'$or':_['map'](_0x254f2c,function(_0xa71674){if(_0xa71674[_0x8c90('0x40')]!==_0x8c90('0x41')){var _0x548708={};_0x548708[_0xa71674[_0x8c90('0x2d')]]={'$like':'%'+_0x1ba758[_0x8c90('0x34')][_0x8c90('0x3f')]+'%'};return _0x548708;}})});}_0x25a09f=_[_0x8c90('0x42')]({},_0x25a09f,_0x1ba758[_0x8c90('0x43')]);var _0x2652c4={'where':_0x25a09f[_0x8c90('0x3e')]};return db[_0x8c90('0x2f')][_0x8c90('0x22')](_0x2652c4)[_0x8c90('0x29')](function(_0x3a9fcf){_0x4efe3f[_0x8c90('0x22')]=_0x3a9fcf;if(_0x1ba758[_0x8c90('0x34')][_0x8c90('0x44')]){_0x25a09f[_0x8c90('0x45')]=[{'all':!![]}];}return db['Team'][_0x8c90('0x46')](_0x25a09f);})[_0x8c90('0x29')](function(_0x19fb0a){_0x4efe3f['rows']=_0x19fb0a;return _0x4efe3f;})[_0x8c90('0x29')](respondWithFilteredResult(_0x1a7e4f,_0x25a09f))[_0x8c90('0x47')](handleError(_0x1a7e4f,null));};exports[_0x8c90('0x48')]=function(_0x429882,_0x76d7bf){var _0x202c36={'raw':![],'where':{'id':_0x429882[_0x8c90('0x49')]['id']}},_0x34c8c8={};_0x34c8c8[_0x8c90('0x32')]=_[_0x8c90('0x35')](db[_0x8c90('0x2f')][_0x8c90('0x30')]);_0x34c8c8[_0x8c90('0x34')]=_[_0x8c90('0x35')](_0x429882[_0x8c90('0x34')]);_0x34c8c8[_0x8c90('0x36')]=_[_0x8c90('0x37')](_0x34c8c8[_0x8c90('0x32')],_0x34c8c8[_0x8c90('0x34')]);_0x202c36[_0x8c90('0x39')]=_[_0x8c90('0x37')](_0x34c8c8[_0x8c90('0x32')],qs[_0x8c90('0x38')](_0x429882[_0x8c90('0x34')][_0x8c90('0x38')]));_0x202c36['attributes']=_0x202c36[_0x8c90('0x39')][_0x8c90('0x3a')]?_0x202c36['attributes']:_0x34c8c8[_0x8c90('0x32')];if(_0x429882[_0x8c90('0x34')][_0x8c90('0x44')]){_0x202c36[_0x8c90('0x45')]=[{'all':!![]}];}_0x202c36=_[_0x8c90('0x42')]({},_0x202c36,_0x429882[_0x8c90('0x43')]);return db[_0x8c90('0x2f')]['find'](_0x202c36)[_0x8c90('0x29')](handleEntityNotFound(_0x76d7bf,null))[_0x8c90('0x29')](respondWithResult(_0x76d7bf,null))[_0x8c90('0x47')](handleError(_0x76d7bf,null));};exports[_0x8c90('0x4a')]=function(_0x24bbb9,_0x381168){return db[_0x8c90('0x2f')]['create'](_0x24bbb9[_0x8c90('0x4b')],{})[_0x8c90('0x29')](function(_0x57b03e){var _0x4df57c=_0x24bbb9['user']['get']({'plain':!![]});if(!_0x4df57c)throw new Error(_0x8c90('0x4c'));if(_0x4df57c[_0x8c90('0x4d')]===_0x8c90('0x4e')){var _0x43b7c2=_0x57b03e['get']({'plain':!![]});var _0x5cd7be=_0x8c90('0x4f');return db['UserProfileSection'][_0x8c90('0x50')]({'where':{'name':_0x5cd7be,'userProfileId':_0x4df57c['userProfileId']},'raw':!![]})[_0x8c90('0x29')](function(_0x29a341){if(_0x29a341&&_0x29a341[_0x8c90('0x51')]===0x0){return db[_0x8c90('0x52')][_0x8c90('0x4a')]({'name':_0x43b7c2[_0x8c90('0x2d')],'resourceId':_0x43b7c2['id'],'type':_0x29a341[_0x8c90('0x2d')],'sectionId':_0x29a341['id']},{})['then'](function(){return _0x57b03e;});}else{return _0x57b03e;}})[_0x8c90('0x47')](function(_0x480625){logger[_0x8c90('0x2b')](_0x8c90('0x53'),_0x480625);throw _0x480625;});}return _0x57b03e;})[_0x8c90('0x29')](respondWithResult(_0x381168,0xc9))['catch'](handleError(_0x381168,null));};exports[_0x8c90('0x28')]=function(_0x349ee8,_0x52c52c){if(_0x349ee8['body']['id']){delete _0x349ee8[_0x8c90('0x4b')]['id'];}return db[_0x8c90('0x2f')][_0x8c90('0x50')]({'where':{'id':_0x349ee8[_0x8c90('0x49')]['id']}})['then'](handleEntityNotFound(_0x52c52c,null))['then'](saveUpdates(_0x349ee8['body'],null))['then'](respondWithResult(_0x52c52c,null))[_0x8c90('0x47')](handleError(_0x52c52c,null));};exports[_0x8c90('0x54')]=function(_0x4a0cfa,_0x51bed0){var _0x413db3=_0x4a0cfa[_0x8c90('0x49')]['id'];var _0x11db42=[];return db[_0x8c90('0x55')]['transaction'](function(_0x57640a){var _0xf4a6e1=_0x8c90('0x56')+_0x413db3;return db[_0x8c90('0x55')][_0x8c90('0x34')](_0xf4a6e1,{'type':db[_0x8c90('0x57')]['QueryTypes'][_0x8c90('0x58')],'raw':!![],'transaction':_0x57640a})[_0x8c90('0x29')](function(_0x2e6a4e){_0x11db42=_[_0x8c90('0x33')](_0x2e6a4e,function(_0x529036){return Number(_0x529036[_0x8c90('0x59')]);});})[_0x8c90('0x29')](function(){var _0x16eb2a=_0x8c90('0x5a')+_0x413db3;return db[_0x8c90('0x55')][_0x8c90('0x34')](_0x16eb2a,{'type':db[_0x8c90('0x57')][_0x8c90('0x5b')][_0x8c90('0x58')],'raw':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x2ee362){var _0x3dae78=_[_0x8c90('0x33')](_0x2ee362,function(_0x54693a){return Number(_0x54693a[_0x8c90('0x5c')]);});return db[_0x8c90('0x5d')][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'VoiceQueueId':{'$in':_0x3dae78}},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){var _0x152d74=_0x8c90('0x5e')+_0x413db3;return db[_0x8c90('0x55')][_0x8c90('0x34')](_0x152d74,{'type':db[_0x8c90('0x57')][_0x8c90('0x5b')][_0x8c90('0x58')],'raw':!![],'transaction':_0x57640a});})['then'](function(_0x17bb27){var _0x20a06b=_[_0x8c90('0x33')](_0x17bb27,function(_0x1af402){return Number(_0x1af402[_0x8c90('0x5f')]);});return db['UserMailQueue'][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'MailQueueId':{'$in':_0x20a06b}},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){var _0x1fd626=_0x8c90('0x60')+_0x413db3;return db[_0x8c90('0x55')]['query'](_0x1fd626,{'type':db[_0x8c90('0x57')][_0x8c90('0x5b')][_0x8c90('0x58')],'raw':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x4fa689){var _0x240269=_[_0x8c90('0x33')](_0x4fa689,function(_0x2be646){return Number(_0x2be646[_0x8c90('0x61')]);});return db['UserSmsQueue'][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'SmsQueueId':{'$in':_0x240269}},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){var _0x39b85d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x413db3;return db[_0x8c90('0x55')][_0x8c90('0x34')](_0x39b85d,{'type':db[_0x8c90('0x57')][_0x8c90('0x5b')]['SELECT'],'raw':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x523ee6){var _0x2a0f07=_['map'](_0x523ee6,function(_0x3e821c){return Number(_0x3e821c[_0x8c90('0x62')]);});return db['UserChatQueue'][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'ChatQueueId':{'$in':_0x2a0f07}},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){var _0x22311a=_0x8c90('0x63')+_0x413db3;return db['sequelize']['query'](_0x22311a,{'type':db[_0x8c90('0x57')][_0x8c90('0x5b')][_0x8c90('0x58')],'raw':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x3eb268){var _0xe64a05=_[_0x8c90('0x33')](_0x3eb268,function(_0x42b4e5){return Number(_0x42b4e5[_0x8c90('0x64')]);});return db[_0x8c90('0x65')][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'FaxQueueId':{'$in':_0xe64a05}},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){var _0x1aa843=_0x8c90('0x66')+_0x413db3;return db[_0x8c90('0x55')][_0x8c90('0x34')](_0x1aa843,{'type':db[_0x8c90('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x541da8){var _0x5b4c63=_[_0x8c90('0x33')](_0x541da8,function(_0x2b63c7){return Number(_0x2b63c7[_0x8c90('0x67')]);});return db[_0x8c90('0x68')][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'OpenchannelQueueId':{'$in':_0x5b4c63}},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){var _0x5d4f57='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x413db3;return db[_0x8c90('0x55')]['query'](_0x5d4f57,{'type':db[_0x8c90('0x57')][_0x8c90('0x5b')]['SELECT'],'raw':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x170d0a){var _0x385dd7=_[_0x8c90('0x33')](_0x170d0a,function(_0x52d722){return Number(_0x52d722[_0x8c90('0x69')]);});return db[_0x8c90('0x6a')][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'WhatsappQueueId':{'$in':_0x385dd7}},'transaction':_0x57640a});})['then'](function(){return db[_0x8c90('0x6b')][_0x8c90('0x50')]({'where':{'TeamId':_0x413db3}});})[_0x8c90('0x29')](function(_0x49d62d){if(_0x49d62d===null){return;}return db[_0x8c90('0x6c')][_0x8c90('0x54')]({'where':{'UserId':{'$in':_0x11db42},'VoicePrefixId':_0x49d62d[_0x8c90('0x6d')]},'transaction':_0x57640a});})[_0x8c90('0x29')](function(){return db['Team'][_0x8c90('0x54')]({'where':{'id':_0x413db3},'cascade':!![],'transaction':_0x57640a});})[_0x8c90('0x29')](function(_0x3eddfc){if(_0x3eddfc===0x0){_0x51bed0[_0x8c90('0x2a')](0x194);}else{return db[_0x8c90('0x52')]['destroy']({'where':{'type':_0x8c90('0x4f'),'resourceId':_0x413db3},'cascade':!![],'transaction':_0x57640a})[_0x8c90('0x29')](function(){_0x51bed0[_0x8c90('0x1d')](0xcc)[_0x8c90('0x6e')]();});}})[_0x8c90('0x47')](function(_0x1bba79){_0x51bed0[_0x8c90('0x1d')](0x1f4)[_0x8c90('0x6f')](_0x1bba79);});});};exports[_0x8c90('0x70')]=function(_0x4404f0,_0x564760,_0x3c7cf1){return db[_0x8c90('0x2f')][_0x8c90('0x71')]({'where':{'id':_0x4404f0[_0x8c90('0x49')]['id']}})[_0x8c90('0x29')](handleEntityNotFound(_0x564760,null))[_0x8c90('0x29')](function(_0x2b1c74){if(!_0x4404f0[_0x8c90('0x34')]['channel']||!utils[_0x8c90('0x72')](_0x4404f0[_0x8c90('0x34')][_0x8c90('0x73')])){throw new db['Sequelize']['ValidationError'](_0x8c90('0x74'));}var _0x4a4ffa={};var _0x25b740={};_0x25b740[_0x8c90('0x32')]=_[_0x8c90('0x35')](db[_[_0x8c90('0x75')](_0x4404f0[_0x8c90('0x34')][_0x8c90('0x73')]['toLowerCase']())+_0x8c90('0x76')][_0x8c90('0x30')]);_0x25b740[_0x8c90('0x34')]=_[_0x8c90('0x35')](_0x4404f0[_0x8c90('0x34')]);_0x25b740[_0x8c90('0x36')]=_[_0x8c90('0x37')](_0x25b740[_0x8c90('0x32')],_0x25b740[_0x8c90('0x34')]);_0x4a4ffa['attributes']=_[_0x8c90('0x37')](_0x25b740[_0x8c90('0x32')],qs[_0x8c90('0x38')](_0x4404f0[_0x8c90('0x34')][_0x8c90('0x38')]));_0x4a4ffa[_0x8c90('0x39')]=_0x4a4ffa[_0x8c90('0x39')][_0x8c90('0x3a')]?_0x4a4ffa[_0x8c90('0x39')]:_0x25b740[_0x8c90('0x32')];_0x4a4ffa[_0x8c90('0x21')]=qs['limit'](_0x4404f0[_0x8c90('0x34')][_0x8c90('0x21')]);_0x4a4ffa['offset']=qs[_0x8c90('0x1f')](_0x4404f0[_0x8c90('0x34')][_0x8c90('0x1f')]);_0x4a4ffa[_0x8c90('0x3c')]=qs[_0x8c90('0x3d')](_0x4404f0[_0x8c90('0x34')][_0x8c90('0x3d')]);_0x4a4ffa[_0x8c90('0x3e')]=qs[_0x8c90('0x36')](_[_0x8c90('0x77')](_0x4404f0[_0x8c90('0x34')],_0x25b740[_0x8c90('0x36')]));_0x4a4ffa=_[_0x8c90('0x42')]({},_0x4a4ffa,_0x4404f0[_0x8c90('0x43')]);return _0x2b1c74[_0x8c90('0x78')+_[_0x8c90('0x75')](_0x4404f0['query'][_0x8c90('0x73')]['toLowerCase']())+_0x8c90('0x79')](_0x4a4ffa);})[_0x8c90('0x29')](respondWithResult(_0x564760,null))[_0x8c90('0x47')](handleError(_0x564760,null));};exports[_0x8c90('0x7a')]=function(_0x468880,_0x94b638,_0x4536ad){return db[_0x8c90('0x2f')]['findOne']({'where':{'id':_0x468880[_0x8c90('0x49')]['id']}})['then'](function(_0x17ac18){if(_0x17ac18){if(!_0x468880[_0x8c90('0x4b')][_0x8c90('0x73')]||!utils[_0x8c90('0x72')](_0x468880[_0x8c90('0x4b')]['channel'])){throw new db[(_0x8c90('0x57'))][(_0x8c90('0x7b'))](_0x8c90('0x74'));}return _0x17ac18[_0x8c90('0x7c')+_[_0x8c90('0x75')](_0x468880[_0x8c90('0x4b')][_0x8c90('0x73')][_0x8c90('0x7d')]())+_0x8c90('0x79')](_0x468880['body']['ids']);}return null;})[_0x8c90('0x29')](handleEntityNotFound(_0x94b638,null))[_0x8c90('0x29')](respondWithStatusCode(_0x94b638,null))[_0x8c90('0x47')](handleError(_0x94b638,null));};exports[_0x8c90('0x7e')]=function(_0x126f47,_0xee412d,_0xc185ea){return db['Team']['findOne']({'where':{'id':_0x126f47['params']['id']}})[_0x8c90('0x29')](function(_0x482f8c){if(_0x482f8c){if(!_0x126f47['query'][_0x8c90('0x73')]||!utils[_0x8c90('0x72')](_0x126f47['query'][_0x8c90('0x73')])){throw new db['Sequelize'][(_0x8c90('0x7b'))](_0x8c90('0x74'));}return _0x482f8c[_0x8c90('0x7f')+_['capitalize'](_0x126f47['query'][_0x8c90('0x73')][_0x8c90('0x7d')]())+_0x8c90('0x79')](_0x126f47[_0x8c90('0x34')]['ids']);}return null;})[_0x8c90('0x29')](handleEntityNotFound(_0xee412d,null))[_0x8c90('0x29')](respondWithStatusCode(_0xee412d,null))[_0x8c90('0x47')](handleError(_0xee412d,null));};exports[_0x8c90('0x80')]=function(_0x31fd7c,_0x46a5ef){var _0x54705f=_[_0x8c90('0x81')](_0x31fd7c[_0x8c90('0x4b')][_0x8c90('0x82')])?_0x31fd7c[_0x8c90('0x4b')]['ids']:[_0x31fd7c['body']['ids']];var _0x1a9e66=_0x31fd7c[_0x8c90('0x49')]['id'];return db['Team'][_0x8c90('0x50')]({'where':{'id':_0x1a9e66}})[_0x8c90('0x29')](handleEntityNotFound(_0x46a5ef,null))[_0x8c90('0x29')](function(_0x40507c){if(_0x40507c){var _0x204695=['Voice','Chat','Mail',_0x8c90('0x83'),_0x8c90('0x84'),_0x8c90('0x85'),_0x8c90('0x86')];return db[_0x8c90('0x55')][_0x8c90('0x87')](function(_0x5d8ac7){var _0x18e4cd=_['map'](_0x204695,function(_0x4a846d){var _0x4942f8={'attributes':['id','name']};if(_0x4a846d===_0x8c90('0x88')){_0x4942f8[_0x8c90('0x89')]={'attributes':['penalty']};}return _0x40507c[_0x8c90('0x78')+_0x4a846d+_0x8c90('0x79')](_0x4942f8)[_0x8c90('0x29')](function(_0xef018e){var _0x23ea48=_[_0x8c90('0x33')](_0xef018e,function(_0x397f57){var _0x43068c=_['map'](_0x54705f,function(_0x412b04){var _0x26cf13={'where':{'UserId':_0x412b04,[_0x4a846d+_0x8c90('0x8a')]:_0x397f57['id']},'transaction':_0x5d8ac7};if(_0x4a846d===_0x8c90('0x88')){_0x26cf13[_0x8c90('0x19')]={'penalty':_0x397f57['TeamVoiceQueue'][_0x8c90('0x8b')]};}return db[_0x8c90('0x8c')+_0x4a846d+_0x8c90('0x76')]['findOrCreate'](_0x26cf13)[_0x8c90('0x29')](function(){socket[_0x8c90('0x8d')](_0x8c90('0x4e')+_0x4a846d+_0x8c90('0x8e'),{'UserId':_0x412b04,[_0x4a846d+_0x8c90('0x8a')]:_0x397f57['id']});if(_0x4a846d!=='Voice'){return;}return db[_0x8c90('0x8c')][_0x8c90('0x46')]({'where':{'id':_0x54705f,'online':0x1},'attributes':['id',_0x8c90('0x2d'),_0x8c90('0x8f'),_0x8c90('0x90'),_0x8c90('0x91')],'raw':!![]})[_0x8c90('0x29')](function(_0x384f4e){var _0x5e972b=_[_0x8c90('0x33')](_0x384f4e,function(_0x3ea5e7){return db[_0x8c90('0x92')][_0x8c90('0x93')]({'membername':_0x3ea5e7[_0x8c90('0x2d')],'UserId':_0x3ea5e7['id'],'queue_name':_0x397f57['name'],'VoiceQueueId':_0x397f57['id'],'interface':_[_0x8c90('0x94')](_0x3ea5e7[_0x8c90('0x91')])?util[_0x8c90('0x95')](_0x8c90('0x96'),_0x3ea5e7['name']):_0x3ea5e7[_0x8c90('0x91')],'paused':_0x3ea5e7[_0x8c90('0x90')]||![],'penalty':_0x397f57[_0x8c90('0x97')]['penalty']},{'transaction':_0x5d8ac7});});return Promise[_0x8c90('0x98')](_0x5e972b);});});});return Promise[_0x8c90('0x98')](_0x43068c);});return Promise[_0x8c90('0x98')](_0x23ea48);})[_0x8c90('0x29')](function(){return db[_0x8c90('0x6b')][_0x8c90('0x71')]({'where':{'teamId':_0x1a9e66}})[_0x8c90('0x29')](function(_0x50e26f){if(_0x50e26f){var _0x5de4fc=_[_0x8c90('0x33')](_0x54705f,function(_0x4c7a31){db[_0x8c90('0x6c')]['upsert']({'UserId':_0x4c7a31,'VoicePrefixId':_0x50e26f[_0x8c90('0x6d')]});});return Promise[_0x8c90('0x98')](_0x5de4fc);}});});});return Promise[_0x8c90('0x98')](_0x18e4cd)['then'](function(){return _0x40507c[_0x8c90('0x80')](_0x54705f,{'transaction':_0x5d8ac7})[_0x8c90('0x99')](function(_0x390667){return _0x390667;});});});}})[_0x8c90('0x29')](respondWithResult(_0x46a5ef,null))[_0x8c90('0x47')](handleError(_0x46a5ef,null));};exports[_0x8c90('0x9a')]=function(_0x1f21df,_0x46345f){var _0x29b5ec=_['isArray'](_0x1f21df['query'][_0x8c90('0x82')])?_0x1f21df[_0x8c90('0x34')][_0x8c90('0x82')]:[_0x1f21df[_0x8c90('0x34')][_0x8c90('0x82')]];var _0x188f5a=_0x1f21df[_0x8c90('0x49')]['id'];return db[_0x8c90('0x2f')]['find']({'where':{'id':_0x188f5a}})['then'](handleEntityNotFound(_0x46345f,null))['then'](function(_0x2aa7ac){if(_0x2aa7ac){var _0x22e412=[_0x8c90('0x88'),_0x8c90('0x9b'),_0x8c90('0x9c'),_0x8c90('0x83'),'Fax',_0x8c90('0x85'),_0x8c90('0x86')];return db[_0x8c90('0x55')]['transaction'](function(_0x1c7961){var _0x32a993=_['map'](_0x22e412,function(_0x414ad2){var _0x56bb92={'attributes':['id',_0x8c90('0x2d')]};return _0x2aa7ac[_0x8c90('0x78')+_0x414ad2+_0x8c90('0x79')](_0x56bb92)[_0x8c90('0x29')](function(_0x4d5b02){var _0x187bd5=_[_0x8c90('0x33')](_0x4d5b02,function(_0x16813d){return _0x16813d[_0x8c90('0x9a')](_0x29b5ec,{'transaction':_0x1c7961})[_0x8c90('0x29')](function(){var _0x4121c7=_[_0x8c90('0x33')](_0x29b5ec,function(_0x15590d){socket[_0x8c90('0x8d')](_0x8c90('0x4e')+_0x414ad2+_0x8c90('0x9d'),{'UserId':Number(_0x15590d),[_0x414ad2+'QueueId']:_0x16813d['id']});if(_0x414ad2!==_0x8c90('0x88')){return;}return db[_0x8c90('0x92')]['destroy']({'where':{'VoiceQueueId':_0x16813d['id'],'UserId':_0x15590d},'transaction':_0x1c7961});});return Promise['all'](_0x4121c7);});});return Promise['all'](_0x187bd5);});});return Promise[_0x8c90('0x98')](_0x32a993)['then'](function(){return _0x2aa7ac['removeAgents'](_0x29b5ec,{'transaction':_0x1c7961});})['then'](function(){return db[_0x8c90('0x6b')]['findOne']({'where':{'teamId':_0x188f5a}})[_0x8c90('0x29')](function(_0x121094){if(_0x121094){var _0x44af8a=_[_0x8c90('0x33')](_0x29b5ec,function(_0xa28e3b){db[_0x8c90('0x6c')][_0x8c90('0x54')]({'where':{'UserId':_0xa28e3b,'VoicePrefixId':_0x121094[_0x8c90('0x6d')]}});});return Promise[_0x8c90('0x98')](_0x44af8a);}});});});}})[_0x8c90('0x29')](respondWithStatusCode(_0x46345f,null))[_0x8c90('0x47')](handleError(_0x46345f,null));};exports[_0x8c90('0x9e')]=function(_0x40f3f1,_0x58b709,_0x2fdd3c){var _0x4c0ab0={};var _0x431d6e={};var _0x58eb08;var _0x263fd2;return db[_0x8c90('0x2f')][_0x8c90('0x71')]({'where':{'id':_0x40f3f1[_0x8c90('0x49')]['id']}})[_0x8c90('0x29')](handleEntityNotFound(_0x58b709,null))[_0x8c90('0x29')](function(_0x5b50c7){if(_0x5b50c7){_0x58eb08=_0x5b50c7;_0x431d6e[_0x8c90('0x32')]=_['keys'](db[_0x8c90('0x8c')][_0x8c90('0x30')]);_0x431d6e[_0x8c90('0x34')]=_[_0x8c90('0x35')](_0x40f3f1[_0x8c90('0x34')]);_0x431d6e[_0x8c90('0x36')]=_[_0x8c90('0x37')](_0x431d6e[_0x8c90('0x32')],_0x431d6e['query']);_0x4c0ab0[_0x8c90('0x39')]=_[_0x8c90('0x37')](_0x431d6e[_0x8c90('0x32')],qs[_0x8c90('0x38')](_0x40f3f1['query'][_0x8c90('0x38')]));_0x4c0ab0['attributes']=_0x4c0ab0['attributes'][_0x8c90('0x3a')]?_0x4c0ab0[_0x8c90('0x39')]:_0x431d6e[_0x8c90('0x32')];_0x4c0ab0[_0x8c90('0x3c')]=qs['sort'](_0x40f3f1['query'][_0x8c90('0x3d')]);_0x4c0ab0['where']=qs['filters'](_[_0x8c90('0x77')](_0x40f3f1['query'],_0x431d6e[_0x8c90('0x36')]));if(_0x40f3f1['query'][_0x8c90('0x3f')]){_0x4c0ab0[_0x8c90('0x3e')]=_[_0x8c90('0x42')](_0x4c0ab0[_0x8c90('0x3e')],{'$or':_['map'](_0x4c0ab0['attributes'],function(_0x549128){var _0x5056d1={};_0x5056d1[_0x549128]={'$like':'%'+_0x40f3f1[_0x8c90('0x34')][_0x8c90('0x3f')]+'%'};return _0x5056d1;})});}_0x4c0ab0=_['merge']({},_0x4c0ab0,_0x40f3f1[_0x8c90('0x43')]);return _0x58eb08['getAgents'](_0x4c0ab0);}})[_0x8c90('0x29')](function(_0x384693){if(_0x384693){_0x263fd2=_0x384693[_0x8c90('0x3a')];if(!_0x40f3f1[_0x8c90('0x34')][_0x8c90('0x3b')](_0x8c90('0x9f'))){_0x4c0ab0[_0x8c90('0x21')]=qs[_0x8c90('0x21')](_0x40f3f1['query'][_0x8c90('0x21')]);_0x4c0ab0['offset']=qs[_0x8c90('0x1f')](_0x40f3f1[_0x8c90('0x34')]['offset']);}return _0x58eb08[_0x8c90('0x9e')](_0x4c0ab0);}})['then'](function(_0x48d247){if(_0x48d247){return _0x48d247?{'count':_0x263fd2,'rows':_0x48d247}:null;}})[_0x8c90('0x29')](respondWithResult(_0x58b709,null))[_0x8c90('0x47')](handleError(_0x58b709,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f919d2c..8c72bbb 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 _0x9f26=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xfaa413,_0x520ca5){var _0x29bad0=function(_0x27d01a){while(--_0x27d01a){_0xfaa413['push'](_0xfaa413['shift']());}};_0x29bad0(++_0x520ca5);}(_0x9f26,0x152));var _0x69f2=function(_0x5c285b,_0x337003){_0x5c285b=_0x5c285b-0x0;var _0x4a4ada=_0x9f26[_0x5c285b];return _0x4a4ada;};'use strict';var EventEmitter=require(_0x69f2('0x0'));var Team=require(_0x69f2('0x1'))['db'][_0x69f2('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x69f2('0x3')](0x0);var events={'afterCreate':_0x69f2('0x4'),'afterUpdate':_0x69f2('0x5'),'afterDestroy':_0x69f2('0x6')};function emitEvent(_0x2e7f98){return function(_0x15a52e,_0x338364,_0x456494){TeamEvents[_0x69f2('0x7')](_0x2e7f98+':'+_0x15a52e['id'],_0x15a52e);TeamEvents[_0x69f2('0x7')](_0x2e7f98,_0x15a52e);_0x456494(null);};}for(var e in events){if(events[_0x69f2('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x69f2('0x9')]=TeamEvents; \ No newline at end of file +var _0xe4fe=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x538f63,_0x5e0b8c){var _0x2a25c9=function(_0x3f7a05){while(--_0x3f7a05){_0x538f63['push'](_0x538f63['shift']());}};_0x2a25c9(++_0x5e0b8c);}(_0xe4fe,0xc8));var _0xee4f=function(_0x10b2d5,_0x5a7743){_0x10b2d5=_0x10b2d5-0x0;var _0x14b8d1=_0xe4fe[_0x10b2d5];return _0x14b8d1;};'use strict';var EventEmitter=require(_0xee4f('0x0'));var Team=require(_0xee4f('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xee4f('0x2')](0x0);var events={'afterCreate':_0xee4f('0x3'),'afterUpdate':_0xee4f('0x4'),'afterDestroy':_0xee4f('0x5')};function emitEvent(_0x5b430f){return function(_0x30d09b,_0x39e62f,_0x451737){TeamEvents[_0xee4f('0x6')](_0x5b430f+':'+_0x30d09b['id'],_0x30d09b);TeamEvents[_0xee4f('0x6')](_0x5b430f,_0x30d09b);_0x451737(null);};}for(var e in events){if(events[_0xee4f('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index e81eba5..b6505ab 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 _0x297d=['Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','get','Queues','then','map','channel','catch','exports','define','Team','teams'];(function(_0x51885b,_0x310685){var _0x4efee6=function(_0x4d435c){while(--_0x4d435c){_0x51885b['push'](_0x51885b['shift']());}};_0x4efee6(++_0x310685);}(_0x297d,0x1c1));var _0xd297=function(_0x130942,_0x11f3c5){_0x130942=_0x130942-0x0;var _0x16204e=_0x297d[_0x130942];return _0x16204e;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x10cb8f,_0x40773a){var _0x3061c9=_0xd297('0x0')+_0x40773a+_0xd297('0x1');return _0x10cb8f[_0x3061c9]()[_0xd297('0x2')](function(_0x5efabf){return _[_0xd297('0x3')](_0x5efabf,function(_0x488462){_0x488462['setDataValue'](_0xd297('0x4'),_0x40773a);return _0x488462;});})[_0xd297('0x5')](function(_0x4e6267){throw _0x4e6267;});}module[_0xd297('0x6')]=function(_0x583503){return _0x583503[_0xd297('0x7')](_0xd297('0x8'),attributes,{'tableName':_0xd297('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5c659b=this;var _0x282648=['Chat','Fax',_0xd297('0xa'),_0xd297('0xb'),_0xd297('0xc'),_0xd297('0xd'),_0xd297('0xe')];return Promise[_0xd297('0xf')]()[_0xd297('0x2')](function(){var _0x2fbbb7=_[_0xd297('0x3')](_0x282648,function(_0x40c2dd){return getQueuesByChannel(_0x5c659b,_0x40c2dd);});return Promise[_0xd297('0x10')](_0x2fbbb7);})[_0xd297('0x5')](function(_0x1135f2){throw _0x1135f2;});}}});}; \ No newline at end of file +var _0x82dc=['Openchannel','Whatsapp','then','lodash','./team.attributes','Queues','map','setDataValue','channel','catch','exports','define','Team','teams','Fax','Mail'];(function(_0x5e5946,_0x4cb576){var _0x1bc554=function(_0x556f6c){while(--_0x556f6c){_0x5e5946['push'](_0x5e5946['shift']());}};_0x1bc554(++_0x4cb576);}(_0x82dc,0x143));var _0xc82d=function(_0xbb9f6e,_0x1c433b){_0xbb9f6e=_0xbb9f6e-0x0;var _0x202e8c=_0x82dc[_0xbb9f6e];return _0x202e8c;};'use strict';var _=require(_0xc82d('0x0'));var attributes=require(_0xc82d('0x1'));function getQueuesByChannel(_0x3c3d18,_0x8aca22){var _0x20ab03='get'+_0x8aca22+_0xc82d('0x2');return _0x3c3d18[_0x20ab03]()['then'](function(_0x3c0b79){return _[_0xc82d('0x3')](_0x3c0b79,function(_0x4cfefc){_0x4cfefc[_0xc82d('0x4')](_0xc82d('0x5'),_0x8aca22);return _0x4cfefc;});})[_0xc82d('0x6')](function(_0x5585ae){throw _0x5585ae;});}module[_0xc82d('0x7')]=function(_0x527e6e){return _0x527e6e[_0xc82d('0x8')](_0xc82d('0x9'),attributes,{'tableName':_0xc82d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x48c467=this;var _0x297b92=['Chat',_0xc82d('0xb'),_0xc82d('0xc'),_0xc82d('0xd'),'Sms','Voice',_0xc82d('0xe')];return Promise['resolve']()[_0xc82d('0xf')](function(){var _0x86243b=_['map'](_0x297b92,function(_0x31746b){return getQueuesByChannel(_0x48c467,_0x31746b);});return Promise['all'](_0x86243b);})[_0xc82d('0x6')](function(_0x397d85){throw _0x397d85;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 197bf4f..bea5c23 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 _0x58ed=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x446066,_0x31e68f){var _0x45c96f=function(_0x4f4c7f){while(--_0x4f4c7f){_0x446066['push'](_0x446066['shift']());}};_0x45c96f(++_0x31e68f);}(_0x58ed,0xed));var _0xd58e=function(_0x3670fb,_0x2bc44b){_0x3670fb=_0x3670fb-0x0;var _0x4772ba=_0x58ed[_0x3670fb];return _0x4772ba;};'use strict';var _=require(_0xd58e('0x0'));var util=require(_0xd58e('0x1'));var moment=require(_0xd58e('0x2'));var BPromise=require(_0xd58e('0x3'));var rs=require(_0xd58e('0x4'));var fs=require('fs');var Redis=require(_0xd58e('0x5'));var db=require(_0xd58e('0x6'))['db'];var utils=require(_0xd58e('0x7'));var logger=require(_0xd58e('0x8'))(_0xd58e('0x9'));var config=require(_0xd58e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd58e('0xb')][_0xd58e('0xc')]({'port':0x232a});config[_0xd58e('0xd')]=_['defaults'](config[_0xd58e('0xd')],{'host':_0xd58e('0xe'),'port':0x18eb});var socket=require(_0xd58e('0xf'))(new Redis(config[_0xd58e('0xd')]));require(_0xd58e('0x10'))[_0xd58e('0x11')](socket);function respondWithRpcPromise(_0x491258,_0x22026f,_0x253a58){return new BPromise(function(_0x418c7a,_0x3a56d8){return client[_0xd58e('0x12')](_0x491258,_0x253a58)['then'](function(_0x5d348e){logger[_0xd58e('0x13')](_0xd58e('0x14'),_0x22026f,_0xd58e('0x15'));logger[_0xd58e('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x22026f,'request\x20sent',JSON['stringify'](_0x5d348e));if(_0x5d348e[_0xd58e('0x17')]){if(_0x5d348e[_0xd58e('0x17')]['code']===0x1f4){logger['error'](_0xd58e('0x14'),_0x22026f,_0x5d348e[_0xd58e('0x17')][_0xd58e('0x18')]);return _0x3a56d8(_0x5d348e[_0xd58e('0x17')]['message']);}logger[_0xd58e('0x17')]('Team,\x20%s,\x20%s',_0x22026f,_0x5d348e[_0xd58e('0x17')][_0xd58e('0x18')]);return _0x418c7a(_0x5d348e[_0xd58e('0x17')][_0xd58e('0x18')]);}else{logger[_0xd58e('0x13')](_0xd58e('0x14'),_0x22026f,_0xd58e('0x15'));_0x418c7a(_0x5d348e[_0xd58e('0x19')]['message']);}})[_0xd58e('0x1a')](function(_0x48ea17){logger[_0xd58e('0x17')](_0xd58e('0x14'),_0x22026f,_0x48ea17);_0x3a56d8(_0x48ea17);});});} \ No newline at end of file +var _0xa280=['defaults','socket.io-emitter','./team.socket','register','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','Team,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xa280,0xb1));var _0x0a28=function(_0x19f354,_0x2ed951){_0x19f354=_0x19f354-0x0;var _0x202051=_0xa280[_0x19f354];return _0x202051;};'use strict';var _=require('lodash');var util=require(_0x0a28('0x0'));var moment=require(_0x0a28('0x1'));var BPromise=require(_0x0a28('0x2'));var rs=require(_0x0a28('0x3'));var fs=require('fs');var Redis=require(_0x0a28('0x4'));var db=require(_0x0a28('0x5'))['db'];var utils=require(_0x0a28('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a28('0x7'));var jayson=require(_0x0a28('0x8'));var client=jayson[_0x0a28('0x9')][_0x0a28('0xa')]({'port':0x232a});config[_0x0a28('0xb')]=_[_0x0a28('0xc')](config[_0x0a28('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a28('0xd'))(new Redis(config[_0x0a28('0xb')]));require(_0x0a28('0xe'))[_0x0a28('0xf')](socket);function respondWithRpcPromise(_0xe8eb10,_0x1cb870,_0x28ed89){return new BPromise(function(_0x395500,_0x3316a8){return client['request'](_0xe8eb10,_0x28ed89)[_0x0a28('0x10')](function(_0x1b973f){logger['info']('Team,\x20%s,\x20%s',_0x1cb870,_0x0a28('0x11'));logger[_0x0a28('0x12')](_0x0a28('0x13'),_0x1cb870,_0x0a28('0x11'),JSON[_0x0a28('0x14')](_0x1b973f));if(_0x1b973f[_0x0a28('0x15')]){if(_0x1b973f[_0x0a28('0x15')]['code']===0x1f4){logger[_0x0a28('0x15')](_0x0a28('0x16'),_0x1cb870,_0x1b973f[_0x0a28('0x15')][_0x0a28('0x17')]);return _0x3316a8(_0x1b973f['error'][_0x0a28('0x17')]);}logger[_0x0a28('0x15')](_0x0a28('0x16'),_0x1cb870,_0x1b973f[_0x0a28('0x15')][_0x0a28('0x17')]);return _0x395500(_0x1b973f[_0x0a28('0x15')][_0x0a28('0x17')]);}else{logger[_0x0a28('0x18')]('Team,\x20%s,\x20%s',_0x1cb870,_0x0a28('0x11'));_0x395500(_0x1b973f[_0x0a28('0x19')][_0x0a28('0x17')]);}})[_0x0a28('0x1a')](function(_0x3a8259){logger[_0x0a28('0x15')](_0x0a28('0x16'),_0x1cb870,_0x3a8259);_0x3316a8(_0x3a8259);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 05bae92..0703883 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 _0x18a6=['emit','register','length','team:','remove','update'];(function(_0x58b22e,_0x4102af){var _0x5e2f1b=function(_0x24adcc){while(--_0x24adcc){_0x58b22e['push'](_0x58b22e['shift']());}};_0x5e2f1b(++_0x4102af);}(_0x18a6,0x190));var _0x618a=function(_0x5479f9,_0x2cd28a){_0x5479f9=_0x5479f9-0x0;var _0x3ed301=_0x18a6[_0x5479f9];return _0x3ed301;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x618a('0x0'),_0x618a('0x1')];function createListener(_0x408b6d,_0x5ae080){return function(_0x4a94a5){_0x5ae080[_0x618a('0x2')](_0x408b6d,_0x4a94a5);};}function removeListener(_0x288005,_0xfeed68){return function(){TeamEvents['removeListener'](_0x288005,_0xfeed68);};}exports[_0x618a('0x3')]=function(_0x12e5bd){for(var _0x10ad50=0x0,_0x1e1f92=events[_0x618a('0x4')];_0x10ad50<_0x1e1f92;_0x10ad50++){var _0x4c93b4=events[_0x10ad50];var _0x50fb46=createListener(_0x618a('0x5')+_0x4c93b4,_0x12e5bd);TeamEvents['on'](_0x4c93b4,_0x50fb46);}}; \ No newline at end of file +var _0x3da7=['update','emit','removeListener','register','./team.events','remove'];(function(_0x2b3478,_0x58afd7){var _0x1c106f=function(_0x4f12a1){while(--_0x4f12a1){_0x2b3478['push'](_0x2b3478['shift']());}};_0x1c106f(++_0x58afd7);}(_0x3da7,0xe2));var _0x73da=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x3da7[_0x14fad0];return _0x5c665f;};'use strict';var TeamEvents=require(_0x73da('0x0'));var events=['save',_0x73da('0x1'),_0x73da('0x2')];function createListener(_0x283e1a,_0x30f351){return function(_0x106c50){_0x30f351[_0x73da('0x3')](_0x283e1a,_0x106c50);};}function removeListener(_0x52305b,_0x134ca0){return function(){TeamEvents[_0x73da('0x4')](_0x52305b,_0x134ca0);};}exports[_0x73da('0x5')]=function(_0xbb84d6){for(var _0x1f61af=0x0,_0x4fbd4e=events['length'];_0x1f61af<_0x4fbd4e;_0x1f61af++){var _0x365116=events[_0x1f61af];var _0x27f198=createListener('team:'+_0x365116,_0xbb84d6);TeamEvents['on'](_0x365116,_0x27f198);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 8d60e85..d79e3a8 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 _0x710e=['sequelize','INTEGER'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x710e,0xb6));var _0xe710=function(_0xce34af,_0x3ed1cf){_0xce34af=_0xce34af-0x0;var _0xe3371=_0x710e[_0xce34af];return _0xe3371;};'use strict';var Sequelize=require(_0xe710('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xe710('0x1')]}}; \ No newline at end of file +var _0x149c=['INTEGER','sequelize'];(function(_0x472ee7,_0x302242){var _0x6aa3f3=function(_0x43beda){while(--_0x43beda){_0x472ee7['push'](_0x472ee7['shift']());}};_0x6aa3f3(++_0x302242);}(_0x149c,0x143));var _0xc149=function(_0x31aeaa,_0x4d83cb){_0x31aeaa=_0x31aeaa-0x0;var _0x22c946=_0x149c[_0x31aeaa];return _0x22c946;};'use strict';var Sequelize=require(_0xc149('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xc149('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xc149('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 330d27a..ec9d79a 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 _0x4c71=['util','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x486660,_0x228736){var _0x42381e=function(_0x2ca109){while(--_0x2ca109){_0x486660['push'](_0x486660['shift']());}};_0x42381e(++_0x228736);}(_0x4c71,0x12b));var _0x14c7=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x4c71[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var logger=require('../../config/logger')(_0x14c7('0x2'));var moment=require(_0x14c7('0x3'));var BPromise=require(_0x14c7('0x4'));var rp=require(_0x14c7('0x5'));var fs=require('fs');var path=require(_0x14c7('0x6'));var rimraf=require('rimraf');var config=require(_0x14c7('0x7'));var attributes=require(_0x14c7('0x8'));module[_0x14c7('0x9')]=function(_0x3c6929,_0x5b50b6){return _0x3c6929['define'](_0x14c7('0xa'),attributes,{'tableName':_0x14c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x854f=['../../config/logger','api','moment','bluebird','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x183b98,_0x35aa6d){var _0x40751c=function(_0x1a43df){while(--_0x1a43df){_0x183b98['push'](_0x183b98['shift']());}};_0x40751c(++_0x35aa6d);}(_0x854f,0xc1));var _0xf854=function(_0x6abd2f,_0x3ba94e){_0x6abd2f=_0x6abd2f-0x0;var _0x44cc7f=_0x854f[_0x6abd2f];return _0x44cc7f;};'use strict';var _=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var logger=require(_0xf854('0x2'))(_0xf854('0x3'));var moment=require(_0xf854('0x4'));var BPromise=require(_0xf854('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf854('0x6'));var rimraf=require('rimraf');var config=require(_0xf854('0x7'));var attributes=require(_0xf854('0x8'));module[_0xf854('0x9')]=function(_0x1f5ec4,_0x4b1ca8){return _0x1f5ec4[_0xf854('0xa')](_0xf854('0xb'),attributes,{'tableName':_0xf854('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index df09257..c362cb3 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x59acea,_0x1de2de){var _0x50a9fe=function(_0x1031cc){while(--_0x1031cc){_0x59acea['push'](_0x59acea['shift']());}};_0x50a9fe(++_0x1de2de);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xcb91[_0x2df724];return _0x1b2504;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x10875b,_0x1ecbdf){var _0x227adf=function(_0xe416b4){while(--_0xe416b4){_0x10875b['push'](_0x10875b['shift']());}};_0x227adf(++_0x1ecbdf);}(_0x70e0,0x17b));var _0x070e=function(_0x4f9aa0,_0x93f23b){_0x4f9aa0=_0x4f9aa0-0x0;var _0x23df84=_0x70e0[_0x4f9aa0];return _0x23df84;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 064f914..e4f7719 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 _0x32f6=['INTEGER'];(function(_0x417e0a,_0x446db8){var _0x223dab=function(_0x56978c){while(--_0x56978c){_0x417e0a['push'](_0x417e0a['shift']());}};_0x223dab(++_0x446db8);}(_0x32f6,0xbd));var _0x632f=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x32f6[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x632f('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2fb2=['sequelize'];(function(_0x490d13,_0x2047fb){var _0x4ec996=function(_0x59ade8){while(--_0x59ade8){_0x490d13['push'](_0x490d13['shift']());}};_0x4ec996(++_0x2047fb);}(_0x2fb2,0x19c));var _0x22fb=function(_0x365dc7,_0x893fc5){_0x365dc7=_0x365dc7-0x0;var _0x952ba1=_0x2fb2[_0x365dc7];return _0x952ba1;};'use strict';var Sequelize=require(_0x22fb('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 9ecab7c..64da6af 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 _0x81bd=['../../config/environment','./teamVoiceQueue.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3cd51b,_0x2967f8){var _0x3db403=function(_0x86056c){while(--_0x86056c){_0x3cd51b['push'](_0x3cd51b['shift']());}};_0x3db403(++_0x2967f8);}(_0x81bd,0x7c));var _0xd81b=function(_0x37bf43,_0x5b2339){_0x37bf43=_0x37bf43-0x0;var _0x4101c5=_0x81bd[_0x37bf43];return _0x4101c5;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x668b=['team_has_voice_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0x668b,0x140));var _0xb668=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0x668b[_0x4bfe08];return _0x1f9125;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1a89193..9c2e250 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 _0xd458=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x24045e,_0x3c1540){var _0x5da302=function(_0x30c3c3){while(--_0x30c3c3){_0x24045e['push'](_0x24045e['shift']());}};_0x5da302(++_0x3c1540);}(_0xd458,0x1b9));var _0x8d45=function(_0x2eb3c9,_0x16e31b){_0x2eb3c9=_0x2eb3c9-0x0;var _0x138ff7=_0xd458[_0x2eb3c9];return _0x138ff7;};'use strict';var _=require(_0x8d45('0x0'));var util=require(_0x8d45('0x1'));var moment=require(_0x8d45('0x2'));var BPromise=require(_0x8d45('0x3'));var rs=require(_0x8d45('0x4'));var fs=require('fs');var Redis=require(_0x8d45('0x5'));var db=require(_0x8d45('0x6'))['db'];var utils=require(_0x8d45('0x7'));var logger=require(_0x8d45('0x8'))(_0x8d45('0x9'));var config=require('../../config/environment');var jayson=require(_0x8d45('0xa'));var client=jayson[_0x8d45('0xb')][_0x8d45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fd970,_0x5380eb,_0x397264){return new BPromise(function(_0x209e2e,_0x880e7b){return client['request'](_0x4fd970,_0x397264)[_0x8d45('0xd')](function(_0x2bd67c){logger[_0x8d45('0xe')](_0x8d45('0xf'),_0x5380eb,_0x8d45('0x10'));logger[_0x8d45('0x11')](_0x8d45('0x12'),_0x5380eb,_0x8d45('0x10'),JSON[_0x8d45('0x13')](_0x2bd67c));if(_0x2bd67c[_0x8d45('0x14')]){if(_0x2bd67c[_0x8d45('0x14')][_0x8d45('0x15')]===0x1f4){logger[_0x8d45('0x14')](_0x8d45('0xf'),_0x5380eb,_0x2bd67c[_0x8d45('0x14')][_0x8d45('0x16')]);return _0x880e7b(_0x2bd67c[_0x8d45('0x14')]['message']);}logger[_0x8d45('0x14')](_0x8d45('0xf'),_0x5380eb,_0x2bd67c[_0x8d45('0x14')][_0x8d45('0x16')]);return _0x209e2e(_0x2bd67c['error'][_0x8d45('0x16')]);}else{logger[_0x8d45('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5380eb,_0x8d45('0x10'));_0x209e2e(_0x2bd67c['result']['message']);}})[_0x8d45('0x17')](function(_0x470277){logger[_0x8d45('0x14')](_0x8d45('0xf'),_0x5380eb,_0x470277);_0x880e7b(_0x470277);});});} \ No newline at end of file +var _0x4fef=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x679672,_0x54a629){var _0x2a79d8=function(_0x46db3a){while(--_0x46db3a){_0x679672['push'](_0x679672['shift']());}};_0x2a79d8(++_0x54a629);}(_0x4fef,0x10f));var _0xf4fe=function(_0x4d542c,_0xc9ae50){_0x4d542c=_0x4d542c-0x0;var _0x2db108=_0x4fef[_0x4d542c];return _0x2db108;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var moment=require('moment');var BPromise=require(_0xf4fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4fe('0x3'));var db=require(_0xf4fe('0x4'))['db'];var utils=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var jayson=require(_0xf4fe('0x9'));var client=jayson[_0xf4fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363096,_0x3e844d,_0x4805b0){return new BPromise(function(_0x23b761,_0x1e858f){return client[_0xf4fe('0xb')](_0x363096,_0x4805b0)[_0xf4fe('0xc')](function(_0xdec534){logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,_0xf4fe('0xf'));logger['debug'](_0xf4fe('0x10'),_0x3e844d,'request\x20sent',JSON[_0xf4fe('0x11')](_0xdec534));if(_0xdec534[_0xf4fe('0x12')]){if(_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x13')]===0x1f4){logger[_0xf4fe('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x1e858f(_0xdec534[_0xf4fe('0x12')]['message']);}logger[_0xf4fe('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x23b761(_0xdec534[_0xf4fe('0x12')]['message']);}else{logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,'request\x20sent');_0x23b761(_0xdec534[_0xf4fe('0x15')][_0xf4fe('0x14')]);}})[_0xf4fe('0x16')](function(_0x565dc6){logger['error'](_0xf4fe('0xe'),_0x3e844d,_0x565dc6);_0x1e858f(_0x565dc6);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d1e169a..e9238a7 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 _0x6c45=['index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x38ab6d,_0x279eb9){var _0x282ebd=function(_0x25d222){while(--_0x25d222){_0x38ab6d['push'](_0x38ab6d['shift']());}};_0x282ebd(++_0x279eb9);}(_0x6c45,0xb1));var _0x56c4=function(_0x2748f4,_0x4baa81){_0x2748f4=_0x2748f4-0x0;var _0x57da83=_0x6c45[_0x2748f4];return _0x57da83;};'use strict';var multer=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var path=require('path');var timeout=require(_0x56c4('0x2'));var express=require(_0x56c4('0x3'));var router=express[_0x56c4('0x4')]();var fs_extra=require(_0x56c4('0x5'));var auth=require(_0x56c4('0x6'));var interaction=require(_0x56c4('0x7'));var config=require(_0x56c4('0x8'));var controller=require(_0x56c4('0x9'));router[_0x56c4('0xa')]('/',auth[_0x56c4('0xb')](),controller[_0x56c4('0xc')]);router[_0x56c4('0xa')](_0x56c4('0xd'),auth[_0x56c4('0xb')](),controller[_0x56c4('0xe')]);router[_0x56c4('0xf')]('/',auth[_0x56c4('0xb')](),controller[_0x56c4('0x10')]);router[_0x56c4('0x11')](_0x56c4('0xd'),auth['isAuthenticated'](),controller[_0x56c4('0x12')]);router[_0x56c4('0x13')](_0x56c4('0xd'),auth[_0x56c4('0xb')](),controller['destroy']);module[_0x56c4('0x14')]=router; \ No newline at end of file +var _0xd7d5=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./template.controller','get'];(function(_0x339f21,_0x1191c6){var _0x2e43d4=function(_0x4d2d53){while(--_0x4d2d53){_0x339f21['push'](_0x339f21['shift']());}};_0x2e43d4(++_0x1191c6);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x2e9438,_0x10d146){_0x2e9438=_0x2e9438-0x0;var _0x4ac872=_0xd7d5[_0x2e9438];return _0x4ac872;};'use strict';var multer=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var path=require(_0x5d7d('0x2'));var timeout=require(_0x5d7d('0x3'));var express=require(_0x5d7d('0x4'));var router=express[_0x5d7d('0x5')]();var fs_extra=require(_0x5d7d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5d7d('0x7'));var config=require('../../config/environment');var controller=require(_0x5d7d('0x8'));router[_0x5d7d('0x9')]('/',auth[_0x5d7d('0xa')](),controller[_0x5d7d('0xb')]);router[_0x5d7d('0x9')](_0x5d7d('0xc'),auth[_0x5d7d('0xa')](),controller[_0x5d7d('0xd')]);router[_0x5d7d('0xe')]('/',auth[_0x5d7d('0xa')](),controller['create']);router[_0x5d7d('0xf')](_0x5d7d('0xc'),auth[_0x5d7d('0xa')](),controller[_0x5d7d('0x10')]);router[_0x5d7d('0x11')](_0x5d7d('0xc'),auth[_0x5d7d('0xa')](),controller[_0x5d7d('0x12')]);module[_0x5d7d('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 a9b132c..1e760a8 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 _0x6f5e=['STRING','TEXT','sequelize','exports'];(function(_0x1f788d,_0x3acaea){var _0x4ffb91=function(_0x58b8f3){while(--_0x58b8f3){_0x1f788d['push'](_0x1f788d['shift']());}};_0x4ffb91(++_0x3acaea);}(_0x6f5e,0x10a));var _0xe6f5=function(_0x489d76,_0x353674){_0x489d76=_0x489d76-0x0;var _0x2f8fb2=_0x6f5e[_0x489d76];return _0x2f8fb2;};'use strict';var Sequelize=require(_0xe6f5('0x0'));module[_0xe6f5('0x1')]={'name':{'type':Sequelize[_0xe6f5('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xe6f5('0x3')]}}; \ No newline at end of file +var _0xf1dd=['sequelize','STRING','TEXT'];(function(_0x18a511,_0x2babed){var _0x1250ff=function(_0x2efedf){while(--_0x2efedf){_0x18a511['push'](_0x18a511['shift']());}};_0x1250ff(++_0x2babed);}(_0xf1dd,0x147));var _0xdf1d=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xf1dd[_0x184759];return _0xf26d5f;};'use strict';var Sequelize=require(_0xdf1d('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf1d('0x1')]},'description':{'type':Sequelize[_0xdf1d('0x1')]},'html':{'type':Sequelize[_0xdf1d('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 8e9dbf9..85de906 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 _0xbc1f=['update','then','get','Templates','UserProfileResource','sendStatus','name','index','Template','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','user','role','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','apply','reject','save'];(function(_0x1a60e6,_0x25e6a6){var _0x5c802e=function(_0x55bfc5){while(--_0x55bfc5){_0x1a60e6['push'](_0x1a60e6['shift']());}};_0x5c802e(++_0x25e6a6);}(_0xbc1f,0x104));var _0xfbc1=function(_0x2ddd02,_0x5d2742){_0x2ddd02=_0x2ddd02-0x0;var _0x3bd763=_0xbc1f[_0x2ddd02];return _0x3bd763;};'use strict';var emlformat=require(_0xfbc1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfbc1('0x1'));var jsonpatch=require(_0xfbc1('0x2'));var rp=require(_0xfbc1('0x3'));var moment=require(_0xfbc1('0x4'));var BPromise=require(_0xfbc1('0x5'));var Mustache=require(_0xfbc1('0x6'));var util=require('util');var path=require(_0xfbc1('0x7'));var sox=require('sox');var csv=require(_0xfbc1('0x8'));var ejs=require(_0xfbc1('0x9'));var fs=require('fs');var fs_extra=require(_0xfbc1('0xa'));var _=require(_0xfbc1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfbc1('0xc'));var deskjs=require(_0xfbc1('0xd'));var toCsv=require(_0xfbc1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfbc1('0xe'));var authService=require(_0xfbc1('0xf'));var qs=require(_0xfbc1('0x10'));var as=require(_0xfbc1('0x11'));var hardwareService=require(_0xfbc1('0x12'));var logger=require(_0xfbc1('0x13'))(_0xfbc1('0x14'));var utils=require(_0xfbc1('0x15'));var config=require(_0xfbc1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51b9d9,_0x456bbf){_0x456bbf=_0x456bbf||0xcc;return function(_0x20d986){if(_0x20d986){return _0x51b9d9['sendStatus'](_0x456bbf);}return _0x51b9d9['status'](_0x456bbf)['end']();};}function respondWithResult(_0x4efed1,_0x2da168){_0x2da168=_0x2da168||0xc8;return function(_0x7b5394){if(_0x7b5394){return _0x4efed1[_0xfbc1('0x17')](_0x2da168)[_0xfbc1('0x18')](_0x7b5394);}};}function respondWithFilteredResult(_0x124369,_0x5c0aad){return function(_0x4be2c8){if(_0x4be2c8){var _0x4ad694=typeof _0x5c0aad[_0xfbc1('0x19')]===_0xfbc1('0x1a')&&typeof _0x5c0aad[_0xfbc1('0x1b')]===_0xfbc1('0x1a');var _0x5b49fd=_0x4be2c8['count'];var _0x3eee06=_0x4ad694?0x0:_0x5c0aad[_0xfbc1('0x19')];var _0x1c30d3=_0x4ad694?_0x4be2c8[_0xfbc1('0x1c')]:_0x5c0aad[_0xfbc1('0x19')]+_0x5c0aad['limit'];var _0x59ac95;if(_0x1c30d3>=_0x5b49fd){_0x1c30d3=_0x5b49fd;_0x59ac95=0xc8;}else{_0x59ac95=0xce;}_0x124369[_0xfbc1('0x17')](_0x59ac95);return _0x124369['set']('Content-Range',_0x3eee06+'-'+_0x1c30d3+'/'+_0x5b49fd)[_0xfbc1('0x18')](_0x4be2c8);}return null;};}function patchUpdates(_0x3a3fbb){return function(_0x1a8de1){try{jsonpatch[_0xfbc1('0x1d')](_0x1a8de1,_0x3a3fbb,!![]);}catch(_0x4f62a7){return BPromise[_0xfbc1('0x1e')](_0x4f62a7);}return _0x1a8de1[_0xfbc1('0x1f')]();};}function saveUpdates(_0x35fdc6,_0x2dff1c){return function(_0x755f2f){if(_0x755f2f){return _0x755f2f[_0xfbc1('0x20')](_0x35fdc6)[_0xfbc1('0x21')](function(_0x3052e1){return _0x3052e1;});}return null;};}function removeEntity(_0x5cf502,_0x5cd5ee){return function(_0xe9f63a){if(_0xe9f63a){return _0xe9f63a['destroy']()['then'](function(){var _0x254b5f=_0xe9f63a[_0xfbc1('0x22')]({'plain':!![]});var _0x24904a=_0xfbc1('0x23');return db[_0xfbc1('0x24')]['destroy']({'where':{'type':_0x24904a,'resourceId':_0x254b5f['id']}})[_0xfbc1('0x21')](function(){return _0xe9f63a;});})[_0xfbc1('0x21')](function(){_0x5cf502['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x352ef9,_0x43f6ec){return function(_0x5832c7){if(!_0x5832c7){_0x352ef9[_0xfbc1('0x25')](0x194);}return _0x5832c7;};}function handleError(_0x1d81d3,_0xc0276b){_0xc0276b=_0xc0276b||0x1f4;return function(_0x53308a){logger['error'](_0x53308a['stack']);if(_0x53308a[_0xfbc1('0x26')]){delete _0x53308a[_0xfbc1('0x26')];}_0x1d81d3['status'](_0xc0276b)['send'](_0x53308a);};}exports[_0xfbc1('0x27')]=function(_0x14757e,_0x1418e7){var _0x49aa77={},_0x2a48af={},_0x203a26={'count':0x0,'rows':[]};var _0x3d2f86=_['map'](db[_0xfbc1('0x28')][_0xfbc1('0x29')],function(_0x11aad0){return{'name':_0x11aad0['fieldName'],'type':_0x11aad0['type'][_0xfbc1('0x2a')]};});_0x2a48af[_0xfbc1('0x2b')]=_[_0xfbc1('0x2c')](_0x3d2f86,_0xfbc1('0x26'));_0x2a48af[_0xfbc1('0x2d')]=_[_0xfbc1('0x2e')](_0x14757e[_0xfbc1('0x2d')]);_0x2a48af[_0xfbc1('0x2f')]=_[_0xfbc1('0x30')](_0x2a48af['model'],_0x2a48af['query']);_0x49aa77[_0xfbc1('0x31')]=_[_0xfbc1('0x30')](_0x2a48af[_0xfbc1('0x2b')],qs[_0xfbc1('0x32')](_0x14757e[_0xfbc1('0x2d')][_0xfbc1('0x32')]));_0x49aa77['attributes']=_0x49aa77[_0xfbc1('0x31')][_0xfbc1('0x33')]?_0x49aa77[_0xfbc1('0x31')]:_0x2a48af['model'];if(!_0x14757e['query'][_0xfbc1('0x34')](_0xfbc1('0x35'))){_0x49aa77[_0xfbc1('0x1b')]=qs[_0xfbc1('0x1b')](_0x14757e[_0xfbc1('0x2d')][_0xfbc1('0x1b')]);_0x49aa77[_0xfbc1('0x19')]=qs['offset'](_0x14757e['query'][_0xfbc1('0x19')]);}_0x49aa77[_0xfbc1('0x36')]=qs[_0xfbc1('0x37')](_0x14757e['query'][_0xfbc1('0x37')]);_0x49aa77[_0xfbc1('0x38')]=qs[_0xfbc1('0x2f')](_[_0xfbc1('0x39')](_0x14757e['query'],_0x2a48af[_0xfbc1('0x2f')]),_0x3d2f86);if(_0x14757e[_0xfbc1('0x2d')][_0xfbc1('0x3a')]){_0x49aa77[_0xfbc1('0x38')]=_[_0xfbc1('0x3b')](_0x49aa77[_0xfbc1('0x38')],{'$or':_['map'](_0x3d2f86,function(_0x4fe7bb){if(_0x4fe7bb[_0xfbc1('0x3c')]!==_0xfbc1('0x3d')){var _0x3b696a={};_0x3b696a[_0x4fe7bb[_0xfbc1('0x26')]]={'$like':'%'+_0x14757e[_0xfbc1('0x2d')]['filter']+'%'};return _0x3b696a;}})});}_0x49aa77=_['merge']({},_0x49aa77,_0x14757e['options']);var _0x5a7338={'where':_0x49aa77[_0xfbc1('0x38')]};return db['Template'][_0xfbc1('0x1c')](_0x5a7338)[_0xfbc1('0x21')](function(_0x300aa9){_0x203a26[_0xfbc1('0x1c')]=_0x300aa9;if(_0x14757e[_0xfbc1('0x2d')][_0xfbc1('0x3e')]){_0x49aa77[_0xfbc1('0x3f')]=[{'all':!![]}];}return db[_0xfbc1('0x28')][_0xfbc1('0x40')](_0x49aa77);})[_0xfbc1('0x21')](function(_0x748ae5){_0x203a26['rows']=_0x748ae5;return _0x203a26;})[_0xfbc1('0x21')](respondWithFilteredResult(_0x1418e7,_0x49aa77))[_0xfbc1('0x41')](handleError(_0x1418e7,null));};exports[_0xfbc1('0x42')]=function(_0x354c90,_0x2543ad){var _0x568c2f={'raw':!![],'where':{'id':_0x354c90[_0xfbc1('0x43')]['id']}},_0x256159={};_0x256159['model']=_[_0xfbc1('0x2e')](db['Template'][_0xfbc1('0x29')]);_0x256159[_0xfbc1('0x2d')]=_[_0xfbc1('0x2e')](_0x354c90[_0xfbc1('0x2d')]);_0x256159[_0xfbc1('0x2f')]=_['intersection'](_0x256159[_0xfbc1('0x2b')],_0x256159[_0xfbc1('0x2d')]);_0x568c2f['attributes']=_[_0xfbc1('0x30')](_0x256159['model'],qs[_0xfbc1('0x32')](_0x354c90['query'][_0xfbc1('0x32')]));_0x568c2f[_0xfbc1('0x31')]=_0x568c2f[_0xfbc1('0x31')][_0xfbc1('0x33')]?_0x568c2f[_0xfbc1('0x31')]:_0x256159[_0xfbc1('0x2b')];if(_0x354c90[_0xfbc1('0x2d')][_0xfbc1('0x3e')]){_0x568c2f[_0xfbc1('0x3f')]=[{'all':!![]}];}_0x568c2f=_[_0xfbc1('0x3b')]({},_0x568c2f,_0x354c90['options']);return db[_0xfbc1('0x28')][_0xfbc1('0x44')](_0x568c2f)[_0xfbc1('0x21')](handleEntityNotFound(_0x2543ad,null))[_0xfbc1('0x21')](respondWithResult(_0x2543ad,null))[_0xfbc1('0x41')](handleError(_0x2543ad,null));};exports['create']=function(_0x298d9e,_0x144da9){return db[_0xfbc1('0x28')][_0xfbc1('0x45')](_0x298d9e[_0xfbc1('0x46')],{})[_0xfbc1('0x21')](function(_0x1c7e5e){var _0x2a9155=_0x298d9e[_0xfbc1('0x47')]['get']({'plain':!![]});if(!_0x2a9155)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a9155[_0xfbc1('0x48')]==='user'){var _0x38997b=_0x1c7e5e['get']({'plain':!![]});var _0x52452a=_0xfbc1('0x23');return db['UserProfileSection'][_0xfbc1('0x44')]({'where':{'name':_0x52452a,'userProfileId':_0x2a9155['userProfileId']},'raw':!![]})[_0xfbc1('0x21')](function(_0x356d7b){if(_0x356d7b&&_0x356d7b['autoAssociation']===0x0){return db[_0xfbc1('0x24')]['create']({'name':_0x38997b[_0xfbc1('0x26')],'resourceId':_0x38997b['id'],'type':_0x356d7b[_0xfbc1('0x26')],'sectionId':_0x356d7b['id']},{})['then'](function(){return _0x1c7e5e;});}else{return _0x1c7e5e;}})['catch'](function(_0x3941a6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3941a6);throw _0x3941a6;});}return _0x1c7e5e;})[_0xfbc1('0x21')](respondWithResult(_0x144da9,0xc9))[_0xfbc1('0x41')](handleError(_0x144da9,null));};exports['update']=function(_0x566b1c,_0x31cd68){if(_0x566b1c[_0xfbc1('0x46')]['id']){delete _0x566b1c['body']['id'];}return db[_0xfbc1('0x28')]['find']({'where':{'id':_0x566b1c['params']['id']}})['then'](handleEntityNotFound(_0x31cd68,null))[_0xfbc1('0x21')](saveUpdates(_0x566b1c[_0xfbc1('0x46')],null))[_0xfbc1('0x21')](respondWithResult(_0x31cd68,null))[_0xfbc1('0x41')](handleError(_0x31cd68,null));};exports['destroy']=function(_0x3e1a44,_0x44a567){return db['Template'][_0xfbc1('0x44')]({'where':{'id':_0x3e1a44[_0xfbc1('0x43')]['id']}})[_0xfbc1('0x21')](handleEntityNotFound(_0x44a567,null))[_0xfbc1('0x21')](removeEntity(_0x44a567,null))[_0xfbc1('0x41')](handleError(_0x44a567,null));}; \ No newline at end of file +var _0x6291=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','name','send','index','Template','fieldName','type','key','map','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','params','keys','rawAttributes','length','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x45d612,_0x40cdb7){var _0x47ecd3=function(_0x986c20){while(--_0x986c20){_0x45d612['push'](_0x45d612['shift']());}};_0x47ecd3(++_0x40cdb7);}(_0x6291,0x1ea));var _0x1629=function(_0xa1de8d,_0x1399a8){_0xa1de8d=_0xa1de8d-0x0;var _0x478b44=_0x6291[_0xa1de8d];return _0x478b44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1629('0x0'));var zipdir=require(_0x1629('0x1'));var jsonpatch=require(_0x1629('0x2'));var rp=require('request-promise');var moment=require(_0x1629('0x3'));var BPromise=require(_0x1629('0x4'));var Mustache=require(_0x1629('0x5'));var util=require(_0x1629('0x6'));var path=require(_0x1629('0x7'));var sox=require(_0x1629('0x8'));var csv=require(_0x1629('0x9'));var ejs=require(_0x1629('0xa'));var fs=require('fs');var fs_extra=require(_0x1629('0xb'));var _=require(_0x1629('0xc'));var squel=require('squel');var crypto=require(_0x1629('0xd'));var jsforce=require(_0x1629('0xe'));var deskjs=require(_0x1629('0xf'));var toCsv=require(_0x1629('0x9'));var querystring=require('querystring');var Papa=require(_0x1629('0x10'));var Redis=require(_0x1629('0x11'));var authService=require(_0x1629('0x12'));var qs=require(_0x1629('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1629('0x14'));var utils=require(_0x1629('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1629('0x16'));var db=require(_0x1629('0x17'))['db'];function respondWithStatusCode(_0x588582,_0x2f8918){_0x2f8918=_0x2f8918||0xcc;return function(_0x3d057e){if(_0x3d057e){return _0x588582[_0x1629('0x18')](_0x2f8918);}return _0x588582[_0x1629('0x19')](_0x2f8918)[_0x1629('0x1a')]();};}function respondWithResult(_0x4d1eb4,_0x53754a){_0x53754a=_0x53754a||0xc8;return function(_0x1bd478){if(_0x1bd478){return _0x4d1eb4[_0x1629('0x19')](_0x53754a)[_0x1629('0x1b')](_0x1bd478);}};}function respondWithFilteredResult(_0x4fc8da,_0x2474f8){return function(_0x2a36e1){if(_0x2a36e1){var _0x11cc29=typeof _0x2474f8[_0x1629('0x1c')]===_0x1629('0x1d')&&typeof _0x2474f8[_0x1629('0x1e')]===_0x1629('0x1d');var _0x225b6d=_0x2a36e1[_0x1629('0x1f')];var _0x3742ad=_0x11cc29?0x0:_0x2474f8[_0x1629('0x1c')];var _0x338586=_0x11cc29?_0x2a36e1[_0x1629('0x1f')]:_0x2474f8[_0x1629('0x1c')]+_0x2474f8['limit'];var _0x70af2c;if(_0x338586>=_0x225b6d){_0x338586=_0x225b6d;_0x70af2c=0xc8;}else{_0x70af2c=0xce;}_0x4fc8da[_0x1629('0x19')](_0x70af2c);return _0x4fc8da[_0x1629('0x20')](_0x1629('0x21'),_0x3742ad+'-'+_0x338586+'/'+_0x225b6d)[_0x1629('0x1b')](_0x2a36e1);}return null;};}function patchUpdates(_0x42f4e2){return function(_0x1a1018){try{jsonpatch[_0x1629('0x22')](_0x1a1018,_0x42f4e2,!![]);}catch(_0x339ebd){return BPromise[_0x1629('0x23')](_0x339ebd);}return _0x1a1018[_0x1629('0x24')]();};}function saveUpdates(_0x201a9b,_0x805c16){return function(_0xdb12bb){if(_0xdb12bb){return _0xdb12bb[_0x1629('0x25')](_0x201a9b)['then'](function(_0x5e773f){return _0x5e773f;});}return null;};}function removeEntity(_0x3622be,_0xc2795){return function(_0x31719f){if(_0x31719f){return _0x31719f[_0x1629('0x26')]()[_0x1629('0x27')](function(){var _0x3bd957=_0x31719f[_0x1629('0x28')]({'plain':!![]});var _0x145245=_0x1629('0x29');return db[_0x1629('0x2a')][_0x1629('0x26')]({'where':{'type':_0x145245,'resourceId':_0x3bd957['id']}})[_0x1629('0x27')](function(){return _0x31719f;});})['then'](function(){_0x3622be[_0x1629('0x19')](0xcc)[_0x1629('0x1a')]();});}};}function handleEntityNotFound(_0x1fc9eb,_0x47fd0b){return function(_0x275aa1){if(!_0x275aa1){_0x1fc9eb['sendStatus'](0x194);}return _0x275aa1;};}function handleError(_0x2fbc74,_0x1a6e69){_0x1a6e69=_0x1a6e69||0x1f4;return function(_0x2113b5){logger[_0x1629('0x2b')](_0x2113b5['stack']);if(_0x2113b5[_0x1629('0x2c')]){delete _0x2113b5[_0x1629('0x2c')];}_0x2fbc74[_0x1629('0x19')](_0x1a6e69)[_0x1629('0x2d')](_0x2113b5);};}exports[_0x1629('0x2e')]=function(_0x5afe1e,_0x1fc31b){var _0x6dd9ad={},_0x5b08cc={},_0x287ac3={'count':0x0,'rows':[]};var _0x109b3c=_['map'](db[_0x1629('0x2f')]['rawAttributes'],function(_0x12fb05){return{'name':_0x12fb05[_0x1629('0x30')],'type':_0x12fb05[_0x1629('0x31')][_0x1629('0x32')]};});_0x5b08cc['model']=_[_0x1629('0x33')](_0x109b3c,'name');_0x5b08cc['query']=_['keys'](_0x5afe1e[_0x1629('0x34')]);_0x5b08cc['filters']=_['intersection'](_0x5b08cc[_0x1629('0x35')],_0x5b08cc['query']);_0x6dd9ad[_0x1629('0x36')]=_[_0x1629('0x37')](_0x5b08cc[_0x1629('0x35')],qs[_0x1629('0x38')](_0x5afe1e[_0x1629('0x34')]['fields']));_0x6dd9ad[_0x1629('0x36')]=_0x6dd9ad[_0x1629('0x36')]['length']?_0x6dd9ad[_0x1629('0x36')]:_0x5b08cc[_0x1629('0x35')];if(!_0x5afe1e[_0x1629('0x34')][_0x1629('0x39')](_0x1629('0x3a'))){_0x6dd9ad[_0x1629('0x1e')]=qs[_0x1629('0x1e')](_0x5afe1e[_0x1629('0x34')][_0x1629('0x1e')]);_0x6dd9ad[_0x1629('0x1c')]=qs[_0x1629('0x1c')](_0x5afe1e[_0x1629('0x34')][_0x1629('0x1c')]);}_0x6dd9ad[_0x1629('0x3b')]=qs[_0x1629('0x3c')](_0x5afe1e[_0x1629('0x34')]['sort']);_0x6dd9ad['where']=qs[_0x1629('0x3d')](_[_0x1629('0x3e')](_0x5afe1e[_0x1629('0x34')],_0x5b08cc[_0x1629('0x3d')]),_0x109b3c);if(_0x5afe1e[_0x1629('0x34')][_0x1629('0x3f')]){_0x6dd9ad[_0x1629('0x40')]=_['merge'](_0x6dd9ad[_0x1629('0x40')],{'$or':_[_0x1629('0x33')](_0x109b3c,function(_0x571684){if(_0x571684[_0x1629('0x31')]!==_0x1629('0x41')){var _0x27de57={};_0x27de57[_0x571684[_0x1629('0x2c')]]={'$like':'%'+_0x5afe1e[_0x1629('0x34')][_0x1629('0x3f')]+'%'};return _0x27de57;}})});}_0x6dd9ad=_[_0x1629('0x42')]({},_0x6dd9ad,_0x5afe1e[_0x1629('0x43')]);var _0xa6d670={'where':_0x6dd9ad[_0x1629('0x40')]};return db[_0x1629('0x2f')][_0x1629('0x1f')](_0xa6d670)['then'](function(_0x24e0e5){_0x287ac3[_0x1629('0x1f')]=_0x24e0e5;if(_0x5afe1e[_0x1629('0x34')][_0x1629('0x44')]){_0x6dd9ad[_0x1629('0x45')]=[{'all':!![]}];}return db[_0x1629('0x2f')]['findAll'](_0x6dd9ad);})[_0x1629('0x27')](function(_0x41f88c){_0x287ac3[_0x1629('0x46')]=_0x41f88c;return _0x287ac3;})['then'](respondWithFilteredResult(_0x1fc31b,_0x6dd9ad))[_0x1629('0x47')](handleError(_0x1fc31b,null));};exports['show']=function(_0xce0379,_0xacd403){var _0x74b63={'raw':!![],'where':{'id':_0xce0379[_0x1629('0x48')]['id']}},_0x513122={};_0x513122[_0x1629('0x35')]=_[_0x1629('0x49')](db['Template'][_0x1629('0x4a')]);_0x513122[_0x1629('0x34')]=_[_0x1629('0x49')](_0xce0379[_0x1629('0x34')]);_0x513122['filters']=_[_0x1629('0x37')](_0x513122[_0x1629('0x35')],_0x513122[_0x1629('0x34')]);_0x74b63[_0x1629('0x36')]=_['intersection'](_0x513122[_0x1629('0x35')],qs[_0x1629('0x38')](_0xce0379['query'][_0x1629('0x38')]));_0x74b63[_0x1629('0x36')]=_0x74b63[_0x1629('0x36')][_0x1629('0x4b')]?_0x74b63[_0x1629('0x36')]:_0x513122[_0x1629('0x35')];if(_0xce0379[_0x1629('0x34')][_0x1629('0x44')]){_0x74b63[_0x1629('0x45')]=[{'all':!![]}];}_0x74b63=_['merge']({},_0x74b63,_0xce0379['options']);return db['Template'][_0x1629('0x4c')](_0x74b63)[_0x1629('0x27')](handleEntityNotFound(_0xacd403,null))[_0x1629('0x27')](respondWithResult(_0xacd403,null))[_0x1629('0x47')](handleError(_0xacd403,null));};exports[_0x1629('0x4d')]=function(_0x3b3f4e,_0x3ff27d){return db[_0x1629('0x2f')][_0x1629('0x4d')](_0x3b3f4e[_0x1629('0x4e')],{})['then'](function(_0xf20c63){var _0x147aab=_0x3b3f4e[_0x1629('0x4f')][_0x1629('0x28')]({'plain':!![]});if(!_0x147aab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x147aab['role']===_0x1629('0x4f')){var _0x2cd491=_0xf20c63[_0x1629('0x28')]({'plain':!![]});var _0x16c789=_0x1629('0x29');return db[_0x1629('0x50')]['find']({'where':{'name':_0x16c789,'userProfileId':_0x147aab['userProfileId']},'raw':!![]})[_0x1629('0x27')](function(_0x2c3fb5){if(_0x2c3fb5&&_0x2c3fb5[_0x1629('0x51')]===0x0){return db[_0x1629('0x2a')]['create']({'name':_0x2cd491[_0x1629('0x2c')],'resourceId':_0x2cd491['id'],'type':_0x2c3fb5[_0x1629('0x2c')],'sectionId':_0x2c3fb5['id']},{})[_0x1629('0x27')](function(){return _0xf20c63;});}else{return _0xf20c63;}})[_0x1629('0x47')](function(_0x3bf422){logger['error'](_0x1629('0x52'),_0x3bf422);throw _0x3bf422;});}return _0xf20c63;})[_0x1629('0x27')](respondWithResult(_0x3ff27d,0xc9))[_0x1629('0x47')](handleError(_0x3ff27d,null));};exports[_0x1629('0x25')]=function(_0x5bb3a4,_0x5e6e6c){if(_0x5bb3a4[_0x1629('0x4e')]['id']){delete _0x5bb3a4['body']['id'];}return db[_0x1629('0x2f')]['find']({'where':{'id':_0x5bb3a4[_0x1629('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e6e6c,null))['then'](saveUpdates(_0x5bb3a4[_0x1629('0x4e')],null))['then'](respondWithResult(_0x5e6e6c,null))[_0x1629('0x47')](handleError(_0x5e6e6c,null));};exports[_0x1629('0x26')]=function(_0x85af51,_0x1922d8){return db[_0x1629('0x2f')]['find']({'where':{'id':_0x85af51[_0x1629('0x48')]['id']}})['then'](handleEntityNotFound(_0x1922d8,null))['then'](removeEntity(_0x1922d8,null))['catch'](handleError(_0x1922d8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 8fbe6e6..a0bad21 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 _0x486b=['api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x486b,0x183));var _0xb486=function(_0x4d4bea,_0x36231c){_0x4d4bea=_0x4d4bea-0x0;var _0x5d523b=_0x486b[_0x4d4bea];return _0x5d523b;};'use strict';var _=require(_0xb486('0x0'));var util=require(_0xb486('0x1'));var logger=require(_0xb486('0x2'))(_0xb486('0x3'));var moment=require(_0xb486('0x4'));var BPromise=require(_0xb486('0x5'));var rp=require(_0xb486('0x6'));var fs=require('fs');var path=require(_0xb486('0x7'));var rimraf=require('rimraf');var config=require(_0xb486('0x8'));var attributes=require(_0xb486('0x9'));module[_0xb486('0xa')]=function(_0x36c769,_0x3e8c97){return _0x36c769[_0xb486('0xb')]('Template',attributes,{'tableName':_0xb486('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1729=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','moment'];(function(_0x5b3417,_0x367bdc){var _0x59f10a=function(_0x1c3ee9){while(--_0x1c3ee9){_0x5b3417['push'](_0x5b3417['shift']());}};_0x59f10a(++_0x367bdc);}(_0x1729,0x19c));var _0x9172=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x1729[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x9172('0x0'));var util=require(_0x9172('0x1'));var logger=require(_0x9172('0x2'))('api');var moment=require(_0x9172('0x3'));var BPromise=require('bluebird');var rp=require(_0x9172('0x4'));var fs=require('fs');var path=require(_0x9172('0x5'));var rimraf=require(_0x9172('0x6'));var config=require(_0x9172('0x7'));var attributes=require(_0x9172('0x8'));module[_0x9172('0x9')]=function(_0x195400,_0x3638ae){return _0x195400[_0x9172('0xa')](_0x9172('0xb'),attributes,{'tableName':_0x9172('0xc'),'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 3dde28c..8919df1 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 _0x5926=['request\x20sent','debug','stringify','error','message','result','catch','GetTemplate','findAll','options','raw','where','limit','include','map','attributes','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s'];(function(_0x491a40,_0x19aa6e){var _0x1c3e17=function(_0x579739){while(--_0x579739){_0x491a40['push'](_0x491a40['shift']());}};_0x1c3e17(++_0x19aa6e);}(_0x5926,0xdb));var _0x6592=function(_0x4053b5,_0x3bf833){_0x4053b5=_0x4053b5-0x0;var _0x13f224=_0x5926[_0x4053b5];return _0x13f224;};'use strict';var _=require(_0x6592('0x0'));var util=require(_0x6592('0x1'));var moment=require(_0x6592('0x2'));var BPromise=require('bluebird');var rs=require(_0x6592('0x3'));var fs=require('fs');var Redis=require(_0x6592('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6592('0x5'));var config=require(_0x6592('0x6'));var jayson=require(_0x6592('0x7'));var client=jayson[_0x6592('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bb90a,_0x4b0365,_0x359176){return new BPromise(function(_0x363253,_0x44005d){return client[_0x6592('0x9')](_0x1bb90a,_0x359176)[_0x6592('0xa')](function(_0x5328a8){logger[_0x6592('0xb')](_0x6592('0xc'),_0x4b0365,_0x6592('0xd'));logger[_0x6592('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x4b0365,_0x6592('0xd'),JSON[_0x6592('0xf')](_0x5328a8));if(_0x5328a8['error']){if(_0x5328a8[_0x6592('0x10')]['code']===0x1f4){logger['error'](_0x6592('0xc'),_0x4b0365,_0x5328a8[_0x6592('0x10')][_0x6592('0x11')]);return _0x44005d(_0x5328a8[_0x6592('0x10')][_0x6592('0x11')]);}logger[_0x6592('0x10')](_0x6592('0xc'),_0x4b0365,_0x5328a8[_0x6592('0x10')][_0x6592('0x11')]);return _0x363253(_0x5328a8[_0x6592('0x10')][_0x6592('0x11')]);}else{logger[_0x6592('0xb')](_0x6592('0xc'),_0x4b0365,'request\x20sent');_0x363253(_0x5328a8[_0x6592('0x12')][_0x6592('0x11')]);}})[_0x6592('0x13')](function(_0x35ae11){logger[_0x6592('0x10')](_0x6592('0xc'),_0x4b0365,_0x35ae11);_0x44005d(_0x35ae11);});});}exports[_0x6592('0x14')]=function(_0x2b0029){var _0x3d3b96=this;return new Promise(function(_0x5e742c,_0x591f03){return db['Template'][_0x6592('0x15')]({'raw':_0x2b0029[_0x6592('0x16')]?_0x2b0029[_0x6592('0x16')][_0x6592('0x17')]===undefined?!![]:![]:!![],'where':_0x2b0029['options']?_0x2b0029[_0x6592('0x16')][_0x6592('0x18')]||null:null,'attributes':_0x2b0029['options']?_0x2b0029[_0x6592('0x16')]['attributes']||null:null,'limit':_0x2b0029[_0x6592('0x16')]?_0x2b0029['options'][_0x6592('0x19')]||null:null,'include':_0x2b0029[_0x6592('0x16')]?_0x2b0029[_0x6592('0x16')][_0x6592('0x1a')]?_[_0x6592('0x1b')](_0x2b0029[_0x6592('0x16')][_0x6592('0x1a')],function(_0x1849b7){return{'model':db[_0x1849b7['model']],'as':_0x1849b7['as'],'attributes':_0x1849b7[_0x6592('0x1c')],'include':_0x1849b7[_0x6592('0x1a')]?_[_0x6592('0x1b')](_0x1849b7[_0x6592('0x1a')],function(_0x29758c){return{'model':db[_0x29758c['model']],'as':_0x29758c['as'],'attributes':_0x29758c[_0x6592('0x1c')],'include':_0x29758c['include']?_[_0x6592('0x1b')](_0x29758c[_0x6592('0x1a')],function(_0x1c1122){return{'model':db[_0x1c1122['model']],'as':_0x1c1122['as'],'attributes':_0x1c1122[_0x6592('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6592('0xa')](function(_0x3f611f){logger['info'](_0x6592('0x14'),_0x2b0029);logger[_0x6592('0xe')](_0x6592('0x14'),_0x2b0029,JSON[_0x6592('0xf')](_0x3f611f));_0x5e742c(_0x3f611f);})['catch'](function(_0x38aef4){logger[_0x6592('0x10')](_0x6592('0x14'),_0x38aef4[_0x6592('0x11')],_0x2b0029);_0x591f03(_0x3d3b96[_0x6592('0x10')](0x1f4,_0x38aef4[_0x6592('0x11')]));});});}; \ No newline at end of file +var _0x590c=['attributes','GetTemplate','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Template,\x20%s,\x20%s','result','catch','Template','findAll','options','raw','where','include','map','model'];(function(_0x4ab2b7,_0x112aa2){var _0x3a0a36=function(_0x1f7917){while(--_0x1f7917){_0x4ab2b7['push'](_0x4ab2b7['shift']());}};_0x3a0a36(++_0x112aa2);}(_0x590c,0x12b));var _0xc590=function(_0x3e844c,_0x188bc2){_0x3e844c=_0x3e844c-0x0;var _0x4e7c8a=_0x590c[_0x3e844c];return _0x4e7c8a;};'use strict';var _=require(_0xc590('0x0'));var util=require(_0xc590('0x1'));var moment=require(_0xc590('0x2'));var BPromise=require(_0xc590('0x3'));var rs=require(_0xc590('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc590('0x5'))(_0xc590('0x6'));var config=require(_0xc590('0x7'));var jayson=require(_0xc590('0x8'));var client=jayson['client'][_0xc590('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8d7d,_0x183930,_0x3a02c0){return new BPromise(function(_0x3e447a,_0x563da9){return client[_0xc590('0xa')](_0x1d8d7d,_0x3a02c0)[_0xc590('0xb')](function(_0x58bba6){logger[_0xc590('0xc')]('Template,\x20%s,\x20%s',_0x183930,_0xc590('0xd'));logger[_0xc590('0xe')](_0xc590('0xf'),_0x183930,_0xc590('0xd'),JSON[_0xc590('0x10')](_0x58bba6));if(_0x58bba6[_0xc590('0x11')]){if(_0x58bba6[_0xc590('0x11')][_0xc590('0x12')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x183930,_0x58bba6[_0xc590('0x11')]['message']);return _0x563da9(_0x58bba6['error'][_0xc590('0x13')]);}logger[_0xc590('0x11')](_0xc590('0x14'),_0x183930,_0x58bba6[_0xc590('0x11')][_0xc590('0x13')]);return _0x3e447a(_0x58bba6[_0xc590('0x11')][_0xc590('0x13')]);}else{logger['info'](_0xc590('0x14'),_0x183930,_0xc590('0xd'));_0x3e447a(_0x58bba6[_0xc590('0x15')][_0xc590('0x13')]);}})[_0xc590('0x16')](function(_0x28012e){logger[_0xc590('0x11')](_0xc590('0x14'),_0x183930,_0x28012e);_0x563da9(_0x28012e);});});}exports['GetTemplate']=function(_0x483c1a){var _0x1cfc18=this;return new Promise(function(_0x260aae,_0x231926){return db[_0xc590('0x17')][_0xc590('0x18')]({'raw':_0x483c1a[_0xc590('0x19')]?_0x483c1a[_0xc590('0x19')][_0xc590('0x1a')]===undefined?!![]:![]:!![],'where':_0x483c1a[_0xc590('0x19')]?_0x483c1a[_0xc590('0x19')][_0xc590('0x1b')]||null:null,'attributes':_0x483c1a[_0xc590('0x19')]?_0x483c1a[_0xc590('0x19')]['attributes']||null:null,'limit':_0x483c1a[_0xc590('0x19')]?_0x483c1a[_0xc590('0x19')]['limit']||null:null,'include':_0x483c1a[_0xc590('0x19')]?_0x483c1a[_0xc590('0x19')][_0xc590('0x1c')]?_[_0xc590('0x1d')](_0x483c1a['options']['include'],function(_0x2c1f04){return{'model':db[_0x2c1f04[_0xc590('0x1e')]],'as':_0x2c1f04['as'],'attributes':_0x2c1f04['attributes'],'include':_0x2c1f04[_0xc590('0x1c')]?_['map'](_0x2c1f04['include'],function(_0x115b05){return{'model':db[_0x115b05[_0xc590('0x1e')]],'as':_0x115b05['as'],'attributes':_0x115b05['attributes'],'include':_0x115b05[_0xc590('0x1c')]?_[_0xc590('0x1d')](_0x115b05[_0xc590('0x1c')],function(_0x3d1250){return{'model':db[_0x3d1250['model']],'as':_0x3d1250['as'],'attributes':_0x3d1250[_0xc590('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4676d0){logger[_0xc590('0xc')]('GetTemplate',_0x483c1a);logger[_0xc590('0xe')](_0xc590('0x20'),_0x483c1a,JSON['stringify'](_0x4676d0));_0x260aae(_0x4676d0);})['catch'](function(_0x47cc73){logger[_0xc590('0x11')](_0xc590('0x20'),_0x47cc73['message'],_0x483c1a);_0x231926(_0x1cfc18['error'](0x1f4,_0x47cc73['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9f52f97..b86860c 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 _0x1f93=['getAllConditions','/:id/any_conditions','getActions','post','/:id/actions','addAction','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/all_conditions'];(function(_0x5a40a1,_0x55728c){var _0x5342f3=function(_0x4b72c7){while(--_0x4b72c7){_0x5a40a1['push'](_0x5a40a1['shift']());}};_0x5342f3(++_0x55728c);}(_0x1f93,0x112));var _0x31f9=function(_0x192596,_0x2abfc4){_0x192596=_0x192596-0x0;var _0x35ea89=_0x1f93[_0x192596];return _0x35ea89;};'use strict';var multer=require(_0x31f9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x31f9('0x1'));var express=require(_0x31f9('0x2'));var router=express[_0x31f9('0x3')]();var fs_extra=require(_0x31f9('0x4'));var auth=require(_0x31f9('0x5'));var interaction=require(_0x31f9('0x6'));var config=require(_0x31f9('0x7'));var controller=require('./trigger.controller');router['get']('/',auth[_0x31f9('0x8')](),controller[_0x31f9('0x9')]);router[_0x31f9('0xa')](_0x31f9('0xb'),auth[_0x31f9('0x8')](),controller[_0x31f9('0xc')]);router[_0x31f9('0xa')](_0x31f9('0xd'),auth[_0x31f9('0x8')](),controller[_0x31f9('0xe')]);router[_0x31f9('0xa')](_0x31f9('0xf'),auth[_0x31f9('0x8')](),controller['getAnyConditions']);router[_0x31f9('0xa')]('/:id/actions',auth[_0x31f9('0x8')](),controller[_0x31f9('0x10')]);router['post']('/',auth[_0x31f9('0x8')](),controller['create']);router[_0x31f9('0x11')](_0x31f9('0xd'),auth[_0x31f9('0x8')](),controller['addAllCondition']);router[_0x31f9('0x11')](_0x31f9('0xf'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x31f9('0x11')](_0x31f9('0x12'),auth[_0x31f9('0x8')](),controller[_0x31f9('0x13')]);router[_0x31f9('0x14')](_0x31f9('0xb'),auth[_0x31f9('0x8')](),controller['update']);router[_0x31f9('0x15')](_0x31f9('0xb'),auth[_0x31f9('0x8')](),controller[_0x31f9('0x16')]);module[_0x31f9('0x17')]=router; \ No newline at end of file +var _0x864e=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','addAllCondition','addAction','/:id'];(function(_0x56dac3,_0x430d00){var _0x25ba16=function(_0x2b622a){while(--_0x2b622a){_0x56dac3['push'](_0x56dac3['shift']());}};_0x25ba16(++_0x430d00);}(_0x864e,0x13b));var _0xe864=function(_0x6d85b2,_0x3f5f50){_0x6d85b2=_0x6d85b2-0x0;var _0xf8984e=_0x864e[_0x6d85b2];return _0xf8984e;};'use strict';var multer=require(_0xe864('0x0'));var util=require('util');var path=require(_0xe864('0x1'));var timeout=require(_0xe864('0x2'));var express=require('express');var router=express[_0xe864('0x3')]();var fs_extra=require(_0xe864('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe864('0x5'));var config=require(_0xe864('0x6'));var controller=require(_0xe864('0x7'));router[_0xe864('0x8')]('/',auth[_0xe864('0x9')](),controller[_0xe864('0xa')]);router[_0xe864('0x8')]('/:id',auth[_0xe864('0x9')](),controller[_0xe864('0xb')]);router[_0xe864('0x8')](_0xe864('0xc'),auth[_0xe864('0x9')](),controller[_0xe864('0xd')]);router[_0xe864('0x8')](_0xe864('0xe'),auth['isAuthenticated'](),controller[_0xe864('0xf')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xe864('0x10')]);router[_0xe864('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe864('0x11')]('/:id/all_conditions',auth[_0xe864('0x9')](),controller[_0xe864('0x12')]);router[_0xe864('0x11')](_0xe864('0xe'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xe864('0x11')]('/:id/actions',auth[_0xe864('0x9')](),controller[_0xe864('0x13')]);router['put'](_0xe864('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xe864('0x15')]('/:id',auth[_0xe864('0x9')](),controller[_0xe864('0x16')]);module[_0xe864('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b6abbee..ea04950 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 _0x4b5c=['sequelize','exports','STRING','BOOLEAN'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0x4b5c,0xb8));var _0xc4b5=function(_0xe49ec3,_0x57a4e6){_0xe49ec3=_0xe49ec3-0x0;var _0x18bde1=_0x4b5c[_0xe49ec3];return _0x18bde1;};'use strict';var Sequelize=require(_0xc4b5('0x0'));module[_0xc4b5('0x1')]={'name':{'type':Sequelize[_0xc4b5('0x2')]},'channel':{'type':Sequelize[_0xc4b5('0x2')]},'description':{'type':Sequelize[_0xc4b5('0x2')]},'status':{'type':Sequelize[_0xc4b5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb33c=['BOOLEAN','exports','STRING'];(function(_0x2a72f9,_0x267597){var _0x1f84f1=function(_0x4be278){while(--_0x4be278){_0x2a72f9['push'](_0x2a72f9['shift']());}};_0x1f84f1(++_0x267597);}(_0xb33c,0xbe));var _0xcb33=function(_0x343a14,_0x381a2a){_0x343a14=_0x343a14-0x0;var _0x5477da=_0xb33c[_0x343a14];return _0x5477da;};'use strict';var Sequelize=require('sequelize');module[_0xcb33('0x0')]={'name':{'type':Sequelize[_0xcb33('0x1')]},'channel':{'type':Sequelize[_0xcb33('0x1')]},'description':{'type':Sequelize[_0xcb33('0x1')]},'status':{'type':Sequelize[_0xcb33('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 f97bdc6..aaf21aa 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 _0xf7b3=['moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','count','limit','set','json','apply','reject','save','update','get','UserProfileResource','destroy','then','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','Trigger','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5cc4de,_0x2df335){var _0x1bf255=function(_0x479413){while(--_0x479413){_0x5cc4de['push'](_0x5cc4de['shift']());}};_0x1bf255(++_0x2df335);}(_0xf7b3,0x16b));var _0x3f7b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf7b3[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0x3f7b('0x0'));var rimraf=require(_0x3f7b('0x1'));var zipdir=require(_0x3f7b('0x2'));var jsonpatch=require(_0x3f7b('0x3'));var rp=require(_0x3f7b('0x4'));var moment=require(_0x3f7b('0x5'));var BPromise=require(_0x3f7b('0x6'));var Mustache=require(_0x3f7b('0x7'));var util=require(_0x3f7b('0x8'));var path=require(_0x3f7b('0x9'));var sox=require(_0x3f7b('0xa'));var csv=require('to-csv');var ejs=require(_0x3f7b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f7b('0xc'));var squel=require(_0x3f7b('0xd'));var crypto=require(_0x3f7b('0xe'));var jsforce=require(_0x3f7b('0xf'));var deskjs=require(_0x3f7b('0x10'));var toCsv=require(_0x3f7b('0x11'));var querystring=require('querystring');var Papa=require(_0x3f7b('0x12'));var Redis=require(_0x3f7b('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f7b('0x14'));var logger=require(_0x3f7b('0x15'))('api');var utils=require(_0x3f7b('0x16'));var config=require(_0x3f7b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f7b('0x18'))['db'];function respondWithStatusCode(_0x2da63b,_0x28a2be){_0x28a2be=_0x28a2be||0xcc;return function(_0x5003a5){if(_0x5003a5){return _0x2da63b['sendStatus'](_0x28a2be);}return _0x2da63b['status'](_0x28a2be)['end']();};}function respondWithResult(_0x56b72a,_0x378009){_0x378009=_0x378009||0xc8;return function(_0x25aadb){if(_0x25aadb){return _0x56b72a[_0x3f7b('0x19')](_0x378009)['json'](_0x25aadb);}};}function respondWithFilteredResult(_0x5bdea9,_0x2a349b){return function(_0x2f328f){if(_0x2f328f){var _0x10e1bb=typeof _0x2a349b[_0x3f7b('0x1a')]===_0x3f7b('0x1b')&&typeof _0x2a349b['limit']===_0x3f7b('0x1b');var _0x540553=_0x2f328f[_0x3f7b('0x1c')];var _0x47914c=_0x10e1bb?0x0:_0x2a349b[_0x3f7b('0x1a')];var _0x45b653=_0x10e1bb?_0x2f328f['count']:_0x2a349b['offset']+_0x2a349b[_0x3f7b('0x1d')];var _0x3928e0;if(_0x45b653>=_0x540553){_0x45b653=_0x540553;_0x3928e0=0xc8;}else{_0x3928e0=0xce;}_0x5bdea9['status'](_0x3928e0);return _0x5bdea9[_0x3f7b('0x1e')]('Content-Range',_0x47914c+'-'+_0x45b653+'/'+_0x540553)[_0x3f7b('0x1f')](_0x2f328f);}return null;};}function patchUpdates(_0x554024){return function(_0x4c1ace){try{jsonpatch[_0x3f7b('0x20')](_0x4c1ace,_0x554024,!![]);}catch(_0x4f8bfb){return BPromise[_0x3f7b('0x21')](_0x4f8bfb);}return _0x4c1ace[_0x3f7b('0x22')]();};}function saveUpdates(_0x570b37,_0x49592d){return function(_0xcde9d8){if(_0xcde9d8){return _0xcde9d8[_0x3f7b('0x23')](_0x570b37)['then'](function(_0x44eedd){return _0x44eedd;});}return null;};}function removeEntity(_0x1d2f8d,_0x44e6f1){return function(_0x535eca){if(_0x535eca){return _0x535eca['destroy']()['then'](function(){var _0xa097a5=_0x535eca[_0x3f7b('0x24')]({'plain':!![]});var _0xeffc73='Triggers';return db[_0x3f7b('0x25')][_0x3f7b('0x26')]({'where':{'type':_0xeffc73,'resourceId':_0xa097a5['id']}})[_0x3f7b('0x27')](function(){return _0x535eca;});})[_0x3f7b('0x27')](function(){_0x1d2f8d['status'](0xcc)[_0x3f7b('0x28')]();});}};}function handleEntityNotFound(_0x150201,_0x4f698c){return function(_0x1b0873){if(!_0x1b0873){_0x150201['sendStatus'](0x194);}return _0x1b0873;};}function handleError(_0x468944,_0x1c17b5){_0x1c17b5=_0x1c17b5||0x1f4;return function(_0x5682b1){logger[_0x3f7b('0x29')](_0x5682b1[_0x3f7b('0x2a')]);if(_0x5682b1[_0x3f7b('0x2b')]){delete _0x5682b1[_0x3f7b('0x2b')];}_0x468944['status'](_0x1c17b5)['send'](_0x5682b1);};}exports['index']=function(_0x2b739d,_0x50cd33){var _0x3e8e82={},_0x5dd609={},_0x29baad={'count':0x0,'rows':[]};var _0x2e42e=_[_0x3f7b('0x2c')](db['Trigger'][_0x3f7b('0x2d')],function(_0x2c01ba){return{'name':_0x2c01ba[_0x3f7b('0x2e')],'type':_0x2c01ba[_0x3f7b('0x2f')][_0x3f7b('0x30')]};});_0x5dd609[_0x3f7b('0x31')]=_[_0x3f7b('0x2c')](_0x2e42e,_0x3f7b('0x2b'));_0x5dd609[_0x3f7b('0x32')]=_[_0x3f7b('0x33')](_0x2b739d[_0x3f7b('0x32')]);_0x5dd609[_0x3f7b('0x34')]=_[_0x3f7b('0x35')](_0x5dd609[_0x3f7b('0x31')],_0x5dd609[_0x3f7b('0x32')]);_0x3e8e82[_0x3f7b('0x36')]=_[_0x3f7b('0x35')](_0x5dd609['model'],qs[_0x3f7b('0x37')](_0x2b739d[_0x3f7b('0x32')][_0x3f7b('0x37')]));_0x3e8e82['attributes']=_0x3e8e82[_0x3f7b('0x36')][_0x3f7b('0x38')]?_0x3e8e82['attributes']:_0x5dd609[_0x3f7b('0x31')];if(!_0x2b739d[_0x3f7b('0x32')][_0x3f7b('0x39')]('nolimit')){_0x3e8e82[_0x3f7b('0x1d')]=qs[_0x3f7b('0x1d')](_0x2b739d[_0x3f7b('0x32')][_0x3f7b('0x1d')]);_0x3e8e82[_0x3f7b('0x1a')]=qs[_0x3f7b('0x1a')](_0x2b739d[_0x3f7b('0x32')]['offset']);}_0x3e8e82[_0x3f7b('0x3a')]=qs['sort'](_0x2b739d['query'][_0x3f7b('0x3b')]);_0x3e8e82['where']=qs[_0x3f7b('0x34')](_[_0x3f7b('0x3c')](_0x2b739d[_0x3f7b('0x32')],_0x5dd609[_0x3f7b('0x34')]),_0x2e42e);if(_0x2b739d['query'][_0x3f7b('0x3d')]){_0x3e8e82[_0x3f7b('0x3e')]=_[_0x3f7b('0x3f')](_0x3e8e82[_0x3f7b('0x3e')],{'$or':_[_0x3f7b('0x2c')](_0x2e42e,function(_0x4b9c09){if(_0x4b9c09['type']!=='VIRTUAL'){var _0x12ad0c={};_0x12ad0c[_0x4b9c09[_0x3f7b('0x2b')]]={'$like':'%'+_0x2b739d[_0x3f7b('0x32')][_0x3f7b('0x3d')]+'%'};return _0x12ad0c;}})});}_0x3e8e82=_[_0x3f7b('0x3f')]({},_0x3e8e82,_0x2b739d[_0x3f7b('0x40')]);var _0x5bbd94={'where':_0x3e8e82[_0x3f7b('0x3e')]};return db[_0x3f7b('0x41')][_0x3f7b('0x1c')](_0x5bbd94)[_0x3f7b('0x27')](function(_0x5c4fa9){_0x29baad[_0x3f7b('0x1c')]=_0x5c4fa9;if(_0x2b739d[_0x3f7b('0x32')][_0x3f7b('0x42')]){_0x3e8e82[_0x3f7b('0x43')]=[{'all':!![]}];}return db[_0x3f7b('0x41')]['findAll'](_0x3e8e82);})['then'](function(_0x1c6697){_0x29baad['rows']=_0x1c6697;return _0x29baad;})[_0x3f7b('0x27')](respondWithFilteredResult(_0x50cd33,_0x3e8e82))[_0x3f7b('0x44')](handleError(_0x50cd33,null));};exports[_0x3f7b('0x45')]=function(_0x5f3c62,_0x1263df){var _0x1246fc={'raw':![],'where':{'id':_0x5f3c62[_0x3f7b('0x46')]['id']}},_0x8f6af6={};_0x8f6af6['model']=_[_0x3f7b('0x33')](db[_0x3f7b('0x41')][_0x3f7b('0x2d')]);_0x8f6af6[_0x3f7b('0x32')]=_[_0x3f7b('0x33')](_0x5f3c62[_0x3f7b('0x32')]);_0x8f6af6[_0x3f7b('0x34')]=_[_0x3f7b('0x35')](_0x8f6af6[_0x3f7b('0x31')],_0x8f6af6[_0x3f7b('0x32')]);_0x1246fc[_0x3f7b('0x36')]=_['intersection'](_0x8f6af6[_0x3f7b('0x31')],qs[_0x3f7b('0x37')](_0x5f3c62['query'][_0x3f7b('0x37')]));_0x1246fc['attributes']=_0x1246fc[_0x3f7b('0x36')][_0x3f7b('0x38')]?_0x1246fc['attributes']:_0x8f6af6['model'];if(_0x5f3c62[_0x3f7b('0x32')][_0x3f7b('0x42')]){_0x1246fc['include']=[{'all':!![]}];}_0x1246fc=_['merge']({},_0x1246fc,_0x5f3c62[_0x3f7b('0x40')]);return db['Trigger'][_0x3f7b('0x47')](_0x1246fc)[_0x3f7b('0x27')](handleEntityNotFound(_0x1263df,null))['then'](respondWithResult(_0x1263df,null))[_0x3f7b('0x44')](handleError(_0x1263df,null));};exports[_0x3f7b('0x48')]=function(_0x4d18f0,_0xbdfe52){return db[_0x3f7b('0x41')][_0x3f7b('0x48')](_0x4d18f0[_0x3f7b('0x49')],{})[_0x3f7b('0x27')](function(_0x24ff58){var _0x2d9269=_0x4d18f0[_0x3f7b('0x4a')][_0x3f7b('0x24')]({'plain':!![]});if(!_0x2d9269)throw new Error(_0x3f7b('0x4b'));if(_0x2d9269[_0x3f7b('0x4c')]===_0x3f7b('0x4a')){var _0x322a0e=_0x24ff58['get']({'plain':!![]});var _0x305ebf=_0x3f7b('0x4d');return db['UserProfileSection'][_0x3f7b('0x47')]({'where':{'name':_0x305ebf,'userProfileId':_0x2d9269[_0x3f7b('0x4e')]},'raw':!![]})[_0x3f7b('0x27')](function(_0x975f83){if(_0x975f83&&_0x975f83[_0x3f7b('0x4f')]===0x0){return db[_0x3f7b('0x25')]['create']({'name':_0x322a0e[_0x3f7b('0x2b')],'resourceId':_0x322a0e['id'],'type':_0x975f83[_0x3f7b('0x2b')],'sectionId':_0x975f83['id']},{})[_0x3f7b('0x27')](function(){return _0x24ff58;});}else{return _0x24ff58;}})[_0x3f7b('0x44')](function(_0xa7070){logger['error'](_0x3f7b('0x50'),_0xa7070);throw _0xa7070;});}return _0x24ff58;})['then'](respondWithResult(_0xbdfe52,0xc9))[_0x3f7b('0x44')](handleError(_0xbdfe52,null));};exports[_0x3f7b('0x23')]=function(_0x51cbe8,_0x3c78c8){if(_0x51cbe8['body']['id']){delete _0x51cbe8[_0x3f7b('0x49')]['id'];}return db[_0x3f7b('0x41')][_0x3f7b('0x47')]({'where':{'id':_0x51cbe8[_0x3f7b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c78c8,null))[_0x3f7b('0x27')](saveUpdates(_0x51cbe8[_0x3f7b('0x49')],null))['then'](respondWithResult(_0x3c78c8,null))['catch'](handleError(_0x3c78c8,null));};exports[_0x3f7b('0x26')]=function(_0x5753de,_0x56911c){return db[_0x3f7b('0x41')]['find']({'where':{'id':_0x5753de['params']['id']}})['then'](handleEntityNotFound(_0x56911c,null))[_0x3f7b('0x27')](removeEntity(_0x56911c,null))['catch'](handleError(_0x56911c,null));};exports[_0x3f7b('0x51')]=function(_0x4475b4,_0x34bc0e,_0x274750){if(_0x4475b4[_0x3f7b('0x49')]['id']){delete _0x4475b4[_0x3f7b('0x49')]['id'];}return db['Trigger'][_0x3f7b('0x47')]({'where':{'id':_0x4475b4[_0x3f7b('0x46')]['id']}})[_0x3f7b('0x27')](handleEntityNotFound(_0x34bc0e,null))[_0x3f7b('0x27')](function(_0x43bace){if(_0x43bace){_0x4475b4[_0x3f7b('0x49')]['TriggerAllId']=_0x43bace['id'];return db[_0x3f7b('0x52')][_0x3f7b('0x48')](_0x4475b4['body']);}})[_0x3f7b('0x27')](respondWithResult(_0x34bc0e,null))[_0x3f7b('0x44')](handleError(_0x34bc0e,null));};exports[_0x3f7b('0x53')]=function(_0x136400,_0x2688c8,_0x52a403){if(_0x136400[_0x3f7b('0x49')]['id']){delete _0x136400['body']['id'];}return db[_0x3f7b('0x41')][_0x3f7b('0x47')]({'where':{'id':_0x136400[_0x3f7b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2688c8,null))[_0x3f7b('0x27')](function(_0x12509c){if(_0x12509c){_0x136400[_0x3f7b('0x49')]['TriggerAnyId']=_0x12509c['id'];return db[_0x3f7b('0x52')]['create'](_0x136400[_0x3f7b('0x49')]);}})['then'](respondWithResult(_0x2688c8,null))[_0x3f7b('0x44')](handleError(_0x2688c8,null));};exports[_0x3f7b('0x54')]=function(_0x35f72d,_0x2616fe,_0x4773e3){var _0x53b29a={};var _0x1e7d95={};var _0x422ef3;var _0x45bf24;return db[_0x3f7b('0x41')][_0x3f7b('0x55')]({'where':{'id':_0x35f72d[_0x3f7b('0x46')]['id']}})[_0x3f7b('0x27')](handleEntityNotFound(_0x2616fe,null))[_0x3f7b('0x27')](function(_0x546c5a){if(_0x546c5a){_0x422ef3=_0x546c5a;_0x1e7d95['model']=_['keys'](db['Condition'][_0x3f7b('0x2d')]);_0x1e7d95[_0x3f7b('0x32')]=_[_0x3f7b('0x33')](_0x35f72d[_0x3f7b('0x32')]);_0x1e7d95['filters']=_[_0x3f7b('0x35')](_0x1e7d95[_0x3f7b('0x31')],_0x1e7d95[_0x3f7b('0x32')]);_0x53b29a[_0x3f7b('0x36')]=_[_0x3f7b('0x35')](_0x1e7d95['model'],qs['fields'](_0x35f72d[_0x3f7b('0x32')][_0x3f7b('0x37')]));_0x53b29a['attributes']=_0x53b29a[_0x3f7b('0x36')][_0x3f7b('0x38')]?_0x53b29a[_0x3f7b('0x36')]:_0x1e7d95[_0x3f7b('0x31')];_0x53b29a[_0x3f7b('0x3a')]=qs['sort'](_0x35f72d[_0x3f7b('0x32')][_0x3f7b('0x3b')]);_0x53b29a[_0x3f7b('0x3e')]=qs['filters'](_['pick'](_0x35f72d['query'],_0x1e7d95['filters']));if(_0x35f72d[_0x3f7b('0x32')]['filter']){_0x53b29a[_0x3f7b('0x3e')]=_[_0x3f7b('0x3f')](_0x53b29a[_0x3f7b('0x3e')],{'$or':_[_0x3f7b('0x2c')](_0x53b29a['attributes'],function(_0x2da14d){var _0x28eb4b={};_0x28eb4b[_0x2da14d]={'$like':'%'+_0x35f72d[_0x3f7b('0x32')][_0x3f7b('0x3d')]+'%'};return _0x28eb4b;})});}_0x53b29a=_[_0x3f7b('0x3f')]({},_0x53b29a,_0x35f72d['options']);return _0x422ef3[_0x3f7b('0x54')](_0x53b29a);}})[_0x3f7b('0x27')](function(_0x504375){if(_0x504375){_0x45bf24=_0x504375[_0x3f7b('0x38')];if(!_0x35f72d[_0x3f7b('0x32')]['hasOwnProperty'](_0x3f7b('0x56'))){_0x53b29a[_0x3f7b('0x1d')]=qs['limit'](_0x35f72d[_0x3f7b('0x32')][_0x3f7b('0x1d')]);_0x53b29a[_0x3f7b('0x1a')]=qs[_0x3f7b('0x1a')](_0x35f72d[_0x3f7b('0x32')]['offset']);}return _0x422ef3[_0x3f7b('0x54')](_0x53b29a);}})[_0x3f7b('0x27')](function(_0x92ea21){if(_0x92ea21){return _0x92ea21?{'count':_0x45bf24,'rows':_0x92ea21}:null;}})[_0x3f7b('0x27')](respondWithResult(_0x2616fe,null))[_0x3f7b('0x44')](handleError(_0x2616fe,null));};exports['getAnyConditions']=function(_0x547d0e,_0x3b3053,_0x5043b0){var _0x36494a={};var _0x5ade65={};var _0x29bbc5;var _0x2ce4f5;return db['Trigger'][_0x3f7b('0x55')]({'where':{'id':_0x547d0e[_0x3f7b('0x46')]['id']}})[_0x3f7b('0x27')](handleEntityNotFound(_0x3b3053,null))[_0x3f7b('0x27')](function(_0x498d90){if(_0x498d90){_0x29bbc5=_0x498d90;_0x5ade65['model']=_['keys'](db[_0x3f7b('0x52')][_0x3f7b('0x2d')]);_0x5ade65['query']=_[_0x3f7b('0x33')](_0x547d0e[_0x3f7b('0x32')]);_0x5ade65[_0x3f7b('0x34')]=_[_0x3f7b('0x35')](_0x5ade65[_0x3f7b('0x31')],_0x5ade65[_0x3f7b('0x32')]);_0x36494a[_0x3f7b('0x36')]=_['intersection'](_0x5ade65[_0x3f7b('0x31')],qs[_0x3f7b('0x37')](_0x547d0e[_0x3f7b('0x32')]['fields']));_0x36494a[_0x3f7b('0x36')]=_0x36494a[_0x3f7b('0x36')]['length']?_0x36494a[_0x3f7b('0x36')]:_0x5ade65[_0x3f7b('0x31')];_0x36494a[_0x3f7b('0x3a')]=qs[_0x3f7b('0x3b')](_0x547d0e[_0x3f7b('0x32')][_0x3f7b('0x3b')]);_0x36494a[_0x3f7b('0x3e')]=qs[_0x3f7b('0x34')](_[_0x3f7b('0x3c')](_0x547d0e[_0x3f7b('0x32')],_0x5ade65['filters']));if(_0x547d0e[_0x3f7b('0x32')][_0x3f7b('0x3d')]){_0x36494a['where']=_[_0x3f7b('0x3f')](_0x36494a[_0x3f7b('0x3e')],{'$or':_[_0x3f7b('0x2c')](_0x36494a[_0x3f7b('0x36')],function(_0x16c860){var _0x25db27={};_0x25db27[_0x16c860]={'$like':'%'+_0x547d0e[_0x3f7b('0x32')][_0x3f7b('0x3d')]+'%'};return _0x25db27;})});}_0x36494a=_[_0x3f7b('0x3f')]({},_0x36494a,_0x547d0e['options']);return _0x29bbc5[_0x3f7b('0x57')](_0x36494a);}})['then'](function(_0x18a05d){if(_0x18a05d){_0x2ce4f5=_0x18a05d[_0x3f7b('0x38')];if(!_0x547d0e[_0x3f7b('0x32')][_0x3f7b('0x39')](_0x3f7b('0x56'))){_0x36494a[_0x3f7b('0x1d')]=qs[_0x3f7b('0x1d')](_0x547d0e['query'][_0x3f7b('0x1d')]);_0x36494a['offset']=qs[_0x3f7b('0x1a')](_0x547d0e['query'][_0x3f7b('0x1a')]);}return _0x29bbc5[_0x3f7b('0x57')](_0x36494a);}})['then'](function(_0x58b829){if(_0x58b829){return _0x58b829?{'count':_0x2ce4f5,'rows':_0x58b829}:null;}})[_0x3f7b('0x27')](respondWithResult(_0x3b3053,null))[_0x3f7b('0x44')](handleError(_0x3b3053,null));};exports[_0x3f7b('0x58')]=function(_0x57d365,_0x2a0967,_0x50c01c){if(_0x57d365[_0x3f7b('0x49')]['id']){delete _0x57d365[_0x3f7b('0x49')]['id'];}return db[_0x3f7b('0x41')][_0x3f7b('0x47')]({'where':{'id':_0x57d365[_0x3f7b('0x46')]['id']}})[_0x3f7b('0x27')](handleEntityNotFound(_0x2a0967,null))['then'](function(_0x117917){if(_0x117917){_0x57d365['body'][_0x3f7b('0x59')]=_0x117917['id'];return db[_0x3f7b('0x5a')][_0x3f7b('0x48')](_0x57d365[_0x3f7b('0x49')]);}})['then'](respondWithResult(_0x2a0967,null))[_0x3f7b('0x44')](handleError(_0x2a0967,null));};exports[_0x3f7b('0x5b')]=function(_0x39a807,_0x4ebdee,_0xc7fc02){var _0x178083={};var _0x4d417a={};var _0x17b2e1;var _0x16d753;return db['Trigger'][_0x3f7b('0x55')]({'where':{'id':_0x39a807[_0x3f7b('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ebdee,null))[_0x3f7b('0x27')](function(_0x2921d9){if(_0x2921d9){_0x17b2e1=_0x2921d9;_0x4d417a[_0x3f7b('0x31')]=_['keys'](db[_0x3f7b('0x5a')][_0x3f7b('0x2d')]);_0x4d417a['query']=_[_0x3f7b('0x33')](_0x39a807[_0x3f7b('0x32')]);_0x4d417a[_0x3f7b('0x34')]=_[_0x3f7b('0x35')](_0x4d417a[_0x3f7b('0x31')],_0x4d417a[_0x3f7b('0x32')]);_0x178083[_0x3f7b('0x36')]=_['intersection'](_0x4d417a[_0x3f7b('0x31')],qs[_0x3f7b('0x37')](_0x39a807[_0x3f7b('0x32')][_0x3f7b('0x37')]));_0x178083[_0x3f7b('0x36')]=_0x178083[_0x3f7b('0x36')][_0x3f7b('0x38')]?_0x178083[_0x3f7b('0x36')]:_0x4d417a['model'];_0x178083[_0x3f7b('0x3a')]=qs[_0x3f7b('0x3b')](_0x39a807[_0x3f7b('0x32')][_0x3f7b('0x3b')]);_0x178083['where']=qs[_0x3f7b('0x34')](_[_0x3f7b('0x3c')](_0x39a807[_0x3f7b('0x32')],_0x4d417a[_0x3f7b('0x34')]));if(_0x39a807[_0x3f7b('0x32')]['filter']){_0x178083[_0x3f7b('0x3e')]=_[_0x3f7b('0x3f')](_0x178083['where'],{'$or':_[_0x3f7b('0x2c')](_0x178083[_0x3f7b('0x36')],function(_0x5386f6){var _0x4d353c={};_0x4d353c[_0x5386f6]={'$like':'%'+_0x39a807['query'][_0x3f7b('0x3d')]+'%'};return _0x4d353c;})});}_0x178083=_[_0x3f7b('0x3f')]({},_0x178083,_0x39a807['options']);return _0x17b2e1[_0x3f7b('0x5b')](_0x178083);}})[_0x3f7b('0x27')](function(_0x5c6dcd){if(_0x5c6dcd){_0x16d753=_0x5c6dcd[_0x3f7b('0x38')];if(!_0x39a807[_0x3f7b('0x32')]['hasOwnProperty'](_0x3f7b('0x56'))){_0x178083[_0x3f7b('0x1d')]=qs[_0x3f7b('0x1d')](_0x39a807[_0x3f7b('0x32')]['limit']);_0x178083[_0x3f7b('0x1a')]=qs[_0x3f7b('0x1a')](_0x39a807[_0x3f7b('0x32')]['offset']);}return _0x17b2e1[_0x3f7b('0x5b')](_0x178083);}})[_0x3f7b('0x27')](function(_0x2dc9e1){if(_0x2dc9e1){return _0x2dc9e1?{'count':_0x16d753,'rows':_0x2dc9e1}:null;}})[_0x3f7b('0x27')](respondWithResult(_0x4ebdee,null))[_0x3f7b('0x44')](handleError(_0x4ebdee,null));}; \ No newline at end of file +var _0xe14b=['nolimit','order','sort','where','filter','options','Trigger','includeAll','include','findAll','catch','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','pick','getAllConditions','getAnyConditions','findOne','merge','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty'];(function(_0x20abe0,_0x1dad87){var _0x38ac96=function(_0xdcd9f8){while(--_0xdcd9f8){_0x20abe0['push'](_0x20abe0['shift']());}};_0x38ac96(++_0x1dad87);}(_0xe14b,0x1a9));var _0xbe14=function(_0x300381,_0x7b94c){_0x300381=_0x300381-0x0;var _0x5da040=_0xe14b[_0x300381];return _0x5da040;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe14('0x1'));var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require(_0xbe14('0x4'));var BPromise=require(_0xbe14('0x5'));var Mustache=require(_0xbe14('0x6'));var util=require(_0xbe14('0x7'));var path=require('path');var sox=require(_0xbe14('0x8'));var csv=require(_0xbe14('0x9'));var ejs=require(_0xbe14('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe14('0xb'));var squel=require(_0xbe14('0xc'));var crypto=require(_0xbe14('0xd'));var jsforce=require(_0xbe14('0xe'));var deskjs=require(_0xbe14('0xf'));var toCsv=require(_0xbe14('0x9'));var querystring=require(_0xbe14('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe14('0x11'));var authService=require(_0xbe14('0x12'));var qs=require(_0xbe14('0x13'));var as=require(_0xbe14('0x14'));var hardwareService=require(_0xbe14('0x15'));var logger=require(_0xbe14('0x16'))(_0xbe14('0x17'));var utils=require('../../config/utils');var config=require(_0xbe14('0x18'));var licenseUtil=require(_0xbe14('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13937b,_0x4a7d2d){_0x4a7d2d=_0x4a7d2d||0xcc;return function(_0x3f31b6){if(_0x3f31b6){return _0x13937b[_0xbe14('0x1a')](_0x4a7d2d);}return _0x13937b[_0xbe14('0x1b')](_0x4a7d2d)[_0xbe14('0x1c')]();};}function respondWithResult(_0x159c19,_0x651caf){_0x651caf=_0x651caf||0xc8;return function(_0x37565e){if(_0x37565e){return _0x159c19[_0xbe14('0x1b')](_0x651caf)[_0xbe14('0x1d')](_0x37565e);}};}function respondWithFilteredResult(_0x1fbdaa,_0x5a932c){return function(_0x3b9b80){if(_0x3b9b80){var _0x589c3e=typeof _0x5a932c[_0xbe14('0x1e')]==='undefined'&&typeof _0x5a932c[_0xbe14('0x1f')]===_0xbe14('0x20');var _0x25b97a=_0x3b9b80['count'];var _0x30f4e3=_0x589c3e?0x0:_0x5a932c['offset'];var _0x1145dc=_0x589c3e?_0x3b9b80[_0xbe14('0x21')]:_0x5a932c['offset']+_0x5a932c[_0xbe14('0x1f')];var _0xa770f5;if(_0x1145dc>=_0x25b97a){_0x1145dc=_0x25b97a;_0xa770f5=0xc8;}else{_0xa770f5=0xce;}_0x1fbdaa[_0xbe14('0x1b')](_0xa770f5);return _0x1fbdaa[_0xbe14('0x22')]('Content-Range',_0x30f4e3+'-'+_0x1145dc+'/'+_0x25b97a)[_0xbe14('0x1d')](_0x3b9b80);}return null;};}function patchUpdates(_0x5fd842){return function(_0x452b47){try{jsonpatch[_0xbe14('0x23')](_0x452b47,_0x5fd842,!![]);}catch(_0x2c79ef){return BPromise[_0xbe14('0x24')](_0x2c79ef);}return _0x452b47[_0xbe14('0x25')]();};}function saveUpdates(_0x244021,_0x266bf0){return function(_0x289d8e){if(_0x289d8e){return _0x289d8e[_0xbe14('0x26')](_0x244021)[_0xbe14('0x27')](function(_0x1b16a4){return _0x1b16a4;});}return null;};}function removeEntity(_0x184724,_0x521ad9){return function(_0x536fb5){if(_0x536fb5){return _0x536fb5[_0xbe14('0x28')]()[_0xbe14('0x27')](function(){var _0x39e95e=_0x536fb5['get']({'plain':!![]});var _0x4e20a7='Triggers';return db[_0xbe14('0x29')][_0xbe14('0x28')]({'where':{'type':_0x4e20a7,'resourceId':_0x39e95e['id']}})[_0xbe14('0x27')](function(){return _0x536fb5;});})['then'](function(){_0x184724[_0xbe14('0x1b')](0xcc)[_0xbe14('0x1c')]();});}};}function handleEntityNotFound(_0x381547,_0x5aeb6f){return function(_0x5a51e1){if(!_0x5a51e1){_0x381547[_0xbe14('0x1a')](0x194);}return _0x5a51e1;};}function handleError(_0x1b3b96,_0x110bac){_0x110bac=_0x110bac||0x1f4;return function(_0x49aebe){logger[_0xbe14('0x2a')](_0x49aebe[_0xbe14('0x2b')]);if(_0x49aebe[_0xbe14('0x2c')]){delete _0x49aebe[_0xbe14('0x2c')];}_0x1b3b96['status'](_0x110bac)[_0xbe14('0x2d')](_0x49aebe);};}exports[_0xbe14('0x2e')]=function(_0x20436c,_0x5496ee){var _0x275a81={},_0xe05681={},_0x59eb6a={'count':0x0,'rows':[]};var _0x5a27f3=_[_0xbe14('0x2f')](db['Trigger'][_0xbe14('0x30')],function(_0x1709bc){return{'name':_0x1709bc[_0xbe14('0x31')],'type':_0x1709bc[_0xbe14('0x32')][_0xbe14('0x33')]};});_0xe05681[_0xbe14('0x34')]=_[_0xbe14('0x2f')](_0x5a27f3,'name');_0xe05681[_0xbe14('0x35')]=_[_0xbe14('0x36')](_0x20436c[_0xbe14('0x35')]);_0xe05681[_0xbe14('0x37')]=_['intersection'](_0xe05681[_0xbe14('0x34')],_0xe05681[_0xbe14('0x35')]);_0x275a81[_0xbe14('0x38')]=_[_0xbe14('0x39')](_0xe05681['model'],qs['fields'](_0x20436c[_0xbe14('0x35')]['fields']));_0x275a81['attributes']=_0x275a81[_0xbe14('0x38')][_0xbe14('0x3a')]?_0x275a81['attributes']:_0xe05681[_0xbe14('0x34')];if(!_0x20436c['query'][_0xbe14('0x3b')](_0xbe14('0x3c'))){_0x275a81[_0xbe14('0x1f')]=qs[_0xbe14('0x1f')](_0x20436c[_0xbe14('0x35')][_0xbe14('0x1f')]);_0x275a81[_0xbe14('0x1e')]=qs[_0xbe14('0x1e')](_0x20436c[_0xbe14('0x35')][_0xbe14('0x1e')]);}_0x275a81[_0xbe14('0x3d')]=qs['sort'](_0x20436c[_0xbe14('0x35')][_0xbe14('0x3e')]);_0x275a81[_0xbe14('0x3f')]=qs[_0xbe14('0x37')](_['pick'](_0x20436c[_0xbe14('0x35')],_0xe05681[_0xbe14('0x37')]),_0x5a27f3);if(_0x20436c['query'][_0xbe14('0x40')]){_0x275a81['where']=_['merge'](_0x275a81[_0xbe14('0x3f')],{'$or':_['map'](_0x5a27f3,function(_0x8076e9){if(_0x8076e9['type']!=='VIRTUAL'){var _0xa49b9={};_0xa49b9[_0x8076e9[_0xbe14('0x2c')]]={'$like':'%'+_0x20436c[_0xbe14('0x35')][_0xbe14('0x40')]+'%'};return _0xa49b9;}})});}_0x275a81=_['merge']({},_0x275a81,_0x20436c[_0xbe14('0x41')]);var _0x484681={'where':_0x275a81[_0xbe14('0x3f')]};return db[_0xbe14('0x42')][_0xbe14('0x21')](_0x484681)[_0xbe14('0x27')](function(_0x5c7fd0){_0x59eb6a[_0xbe14('0x21')]=_0x5c7fd0;if(_0x20436c[_0xbe14('0x35')][_0xbe14('0x43')]){_0x275a81[_0xbe14('0x44')]=[{'all':!![]}];}return db[_0xbe14('0x42')][_0xbe14('0x45')](_0x275a81);})[_0xbe14('0x27')](function(_0x14b28b){_0x59eb6a['rows']=_0x14b28b;return _0x59eb6a;})['then'](respondWithFilteredResult(_0x5496ee,_0x275a81))[_0xbe14('0x46')](handleError(_0x5496ee,null));};exports['show']=function(_0x6d3381,_0x323c57){var _0x9014fe={'raw':![],'where':{'id':_0x6d3381['params']['id']}},_0x13d151={};_0x13d151[_0xbe14('0x34')]=_[_0xbe14('0x36')](db[_0xbe14('0x42')][_0xbe14('0x30')]);_0x13d151[_0xbe14('0x35')]=_[_0xbe14('0x36')](_0x6d3381[_0xbe14('0x35')]);_0x13d151[_0xbe14('0x37')]=_[_0xbe14('0x39')](_0x13d151[_0xbe14('0x34')],_0x13d151[_0xbe14('0x35')]);_0x9014fe[_0xbe14('0x38')]=_[_0xbe14('0x39')](_0x13d151[_0xbe14('0x34')],qs[_0xbe14('0x47')](_0x6d3381['query']['fields']));_0x9014fe[_0xbe14('0x38')]=_0x9014fe[_0xbe14('0x38')][_0xbe14('0x3a')]?_0x9014fe[_0xbe14('0x38')]:_0x13d151[_0xbe14('0x34')];if(_0x6d3381['query'][_0xbe14('0x43')]){_0x9014fe[_0xbe14('0x44')]=[{'all':!![]}];}_0x9014fe=_['merge']({},_0x9014fe,_0x6d3381[_0xbe14('0x41')]);return db['Trigger'][_0xbe14('0x48')](_0x9014fe)[_0xbe14('0x27')](handleEntityNotFound(_0x323c57,null))['then'](respondWithResult(_0x323c57,null))[_0xbe14('0x46')](handleError(_0x323c57,null));};exports[_0xbe14('0x49')]=function(_0x1244ab,_0x3b0661){return db[_0xbe14('0x42')][_0xbe14('0x49')](_0x1244ab[_0xbe14('0x4a')],{})[_0xbe14('0x27')](function(_0x1d8b99){var _0xa97b0=_0x1244ab[_0xbe14('0x4b')][_0xbe14('0x4c')]({'plain':!![]});if(!_0xa97b0)throw new Error(_0xbe14('0x4d'));if(_0xa97b0[_0xbe14('0x4e')]===_0xbe14('0x4b')){var _0x1df807=_0x1d8b99[_0xbe14('0x4c')]({'plain':!![]});var _0x2bc552=_0xbe14('0x4f');return db[_0xbe14('0x50')][_0xbe14('0x48')]({'where':{'name':_0x2bc552,'userProfileId':_0xa97b0[_0xbe14('0x51')]},'raw':!![]})[_0xbe14('0x27')](function(_0x4d0fad){if(_0x4d0fad&&_0x4d0fad['autoAssociation']===0x0){return db[_0xbe14('0x29')][_0xbe14('0x49')]({'name':_0x1df807[_0xbe14('0x2c')],'resourceId':_0x1df807['id'],'type':_0x4d0fad[_0xbe14('0x2c')],'sectionId':_0x4d0fad['id']},{})[_0xbe14('0x27')](function(){return _0x1d8b99;});}else{return _0x1d8b99;}})[_0xbe14('0x46')](function(_0x314451){logger[_0xbe14('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x314451);throw _0x314451;});}return _0x1d8b99;})['then'](respondWithResult(_0x3b0661,0xc9))['catch'](handleError(_0x3b0661,null));};exports['update']=function(_0x537b11,_0x17457b){if(_0x537b11[_0xbe14('0x4a')]['id']){delete _0x537b11[_0xbe14('0x4a')]['id'];}return db['Trigger']['find']({'where':{'id':_0x537b11['params']['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x17457b,null))[_0xbe14('0x27')](saveUpdates(_0x537b11[_0xbe14('0x4a')],null))['then'](respondWithResult(_0x17457b,null))[_0xbe14('0x46')](handleError(_0x17457b,null));};exports['destroy']=function(_0x196fd9,_0x26b453){return db[_0xbe14('0x42')][_0xbe14('0x48')]({'where':{'id':_0x196fd9[_0xbe14('0x52')]['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x26b453,null))['then'](removeEntity(_0x26b453,null))['catch'](handleError(_0x26b453,null));};exports[_0xbe14('0x53')]=function(_0x2679e3,_0x5e63a6,_0x150f7b){if(_0x2679e3['body']['id']){delete _0x2679e3['body']['id'];}return db[_0xbe14('0x42')][_0xbe14('0x48')]({'where':{'id':_0x2679e3['params']['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x5e63a6,null))['then'](function(_0x28b378){if(_0x28b378){_0x2679e3['body'][_0xbe14('0x54')]=_0x28b378['id'];return db[_0xbe14('0x55')][_0xbe14('0x49')](_0x2679e3[_0xbe14('0x4a')]);}})[_0xbe14('0x27')](respondWithResult(_0x5e63a6,null))['catch'](handleError(_0x5e63a6,null));};exports[_0xbe14('0x56')]=function(_0xd06722,_0x35578f,_0x5192f8){if(_0xd06722[_0xbe14('0x4a')]['id']){delete _0xd06722[_0xbe14('0x4a')]['id'];}return db[_0xbe14('0x42')][_0xbe14('0x48')]({'where':{'id':_0xd06722[_0xbe14('0x52')]['id']}})['then'](handleEntityNotFound(_0x35578f,null))[_0xbe14('0x27')](function(_0x58f364){if(_0x58f364){_0xd06722[_0xbe14('0x4a')][_0xbe14('0x57')]=_0x58f364['id'];return db[_0xbe14('0x55')][_0xbe14('0x49')](_0xd06722[_0xbe14('0x4a')]);}})[_0xbe14('0x27')](respondWithResult(_0x35578f,null))[_0xbe14('0x46')](handleError(_0x35578f,null));};exports['getAllConditions']=function(_0xdac48f,_0x5eac6e,_0x85a7c){var _0x1fdbb7={};var _0x3e8751={};var _0x5cbb41;var _0xb77967;return db[_0xbe14('0x42')]['findOne']({'where':{'id':_0xdac48f[_0xbe14('0x52')]['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x5eac6e,null))['then'](function(_0x3e6d38){if(_0x3e6d38){_0x5cbb41=_0x3e6d38;_0x3e8751[_0xbe14('0x34')]=_['keys'](db[_0xbe14('0x55')][_0xbe14('0x30')]);_0x3e8751[_0xbe14('0x35')]=_['keys'](_0xdac48f[_0xbe14('0x35')]);_0x3e8751['filters']=_[_0xbe14('0x39')](_0x3e8751[_0xbe14('0x34')],_0x3e8751[_0xbe14('0x35')]);_0x1fdbb7[_0xbe14('0x38')]=_[_0xbe14('0x39')](_0x3e8751[_0xbe14('0x34')],qs[_0xbe14('0x47')](_0xdac48f[_0xbe14('0x35')][_0xbe14('0x47')]));_0x1fdbb7[_0xbe14('0x38')]=_0x1fdbb7[_0xbe14('0x38')]['length']?_0x1fdbb7[_0xbe14('0x38')]:_0x3e8751['model'];_0x1fdbb7['order']=qs['sort'](_0xdac48f[_0xbe14('0x35')][_0xbe14('0x3e')]);_0x1fdbb7[_0xbe14('0x3f')]=qs[_0xbe14('0x37')](_[_0xbe14('0x58')](_0xdac48f[_0xbe14('0x35')],_0x3e8751['filters']));if(_0xdac48f[_0xbe14('0x35')]['filter']){_0x1fdbb7[_0xbe14('0x3f')]=_['merge'](_0x1fdbb7['where'],{'$or':_[_0xbe14('0x2f')](_0x1fdbb7[_0xbe14('0x38')],function(_0x41db57){var _0x5bb264={};_0x5bb264[_0x41db57]={'$like':'%'+_0xdac48f[_0xbe14('0x35')][_0xbe14('0x40')]+'%'};return _0x5bb264;})});}_0x1fdbb7=_['merge']({},_0x1fdbb7,_0xdac48f[_0xbe14('0x41')]);return _0x5cbb41[_0xbe14('0x59')](_0x1fdbb7);}})[_0xbe14('0x27')](function(_0x1c2da4){if(_0x1c2da4){_0xb77967=_0x1c2da4[_0xbe14('0x3a')];if(!_0xdac48f['query'][_0xbe14('0x3b')]('nolimit')){_0x1fdbb7['limit']=qs[_0xbe14('0x1f')](_0xdac48f[_0xbe14('0x35')]['limit']);_0x1fdbb7[_0xbe14('0x1e')]=qs[_0xbe14('0x1e')](_0xdac48f[_0xbe14('0x35')][_0xbe14('0x1e')]);}return _0x5cbb41['getAllConditions'](_0x1fdbb7);}})[_0xbe14('0x27')](function(_0x168f3b){if(_0x168f3b){return _0x168f3b?{'count':_0xb77967,'rows':_0x168f3b}:null;}})[_0xbe14('0x27')](respondWithResult(_0x5eac6e,null))[_0xbe14('0x46')](handleError(_0x5eac6e,null));};exports[_0xbe14('0x5a')]=function(_0x94a514,_0x3611e0,_0x49103b){var _0x44d8d8={};var _0x41d9d3={};var _0x5bbe06;var _0x2581ae;return db[_0xbe14('0x42')][_0xbe14('0x5b')]({'where':{'id':_0x94a514[_0xbe14('0x52')]['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x3611e0,null))[_0xbe14('0x27')](function(_0x43d2fc){if(_0x43d2fc){_0x5bbe06=_0x43d2fc;_0x41d9d3[_0xbe14('0x34')]=_[_0xbe14('0x36')](db['Condition']['rawAttributes']);_0x41d9d3[_0xbe14('0x35')]=_[_0xbe14('0x36')](_0x94a514['query']);_0x41d9d3[_0xbe14('0x37')]=_[_0xbe14('0x39')](_0x41d9d3[_0xbe14('0x34')],_0x41d9d3[_0xbe14('0x35')]);_0x44d8d8[_0xbe14('0x38')]=_[_0xbe14('0x39')](_0x41d9d3['model'],qs[_0xbe14('0x47')](_0x94a514['query']['fields']));_0x44d8d8[_0xbe14('0x38')]=_0x44d8d8[_0xbe14('0x38')][_0xbe14('0x3a')]?_0x44d8d8[_0xbe14('0x38')]:_0x41d9d3[_0xbe14('0x34')];_0x44d8d8[_0xbe14('0x3d')]=qs[_0xbe14('0x3e')](_0x94a514[_0xbe14('0x35')][_0xbe14('0x3e')]);_0x44d8d8[_0xbe14('0x3f')]=qs['filters'](_[_0xbe14('0x58')](_0x94a514['query'],_0x41d9d3['filters']));if(_0x94a514[_0xbe14('0x35')]['filter']){_0x44d8d8[_0xbe14('0x3f')]=_[_0xbe14('0x5c')](_0x44d8d8['where'],{'$or':_[_0xbe14('0x2f')](_0x44d8d8[_0xbe14('0x38')],function(_0x40321b){var _0x3f7662={};_0x3f7662[_0x40321b]={'$like':'%'+_0x94a514[_0xbe14('0x35')][_0xbe14('0x40')]+'%'};return _0x3f7662;})});}_0x44d8d8=_[_0xbe14('0x5c')]({},_0x44d8d8,_0x94a514[_0xbe14('0x41')]);return _0x5bbe06[_0xbe14('0x5a')](_0x44d8d8);}})['then'](function(_0x42dc60){if(_0x42dc60){_0x2581ae=_0x42dc60[_0xbe14('0x3a')];if(!_0x94a514[_0xbe14('0x35')]['hasOwnProperty'](_0xbe14('0x3c'))){_0x44d8d8[_0xbe14('0x1f')]=qs['limit'](_0x94a514[_0xbe14('0x35')][_0xbe14('0x1f')]);_0x44d8d8[_0xbe14('0x1e')]=qs[_0xbe14('0x1e')](_0x94a514[_0xbe14('0x35')][_0xbe14('0x1e')]);}return _0x5bbe06['getAnyConditions'](_0x44d8d8);}})[_0xbe14('0x27')](function(_0x5baee2){if(_0x5baee2){return _0x5baee2?{'count':_0x2581ae,'rows':_0x5baee2}:null;}})[_0xbe14('0x27')](respondWithResult(_0x3611e0,null))['catch'](handleError(_0x3611e0,null));};exports[_0xbe14('0x5d')]=function(_0x46c85a,_0x2a724a,_0xb35841){if(_0x46c85a[_0xbe14('0x4a')]['id']){delete _0x46c85a['body']['id'];}return db[_0xbe14('0x42')][_0xbe14('0x48')]({'where':{'id':_0x46c85a[_0xbe14('0x52')]['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x2a724a,null))[_0xbe14('0x27')](function(_0x4dbc34){if(_0x4dbc34){_0x46c85a[_0xbe14('0x4a')][_0xbe14('0x5e')]=_0x4dbc34['id'];return db[_0xbe14('0x5f')][_0xbe14('0x49')](_0x46c85a[_0xbe14('0x4a')]);}})[_0xbe14('0x27')](respondWithResult(_0x2a724a,null))[_0xbe14('0x46')](handleError(_0x2a724a,null));};exports[_0xbe14('0x60')]=function(_0x19123a,_0x8e6966,_0x247580){var _0x354181={};var _0x555cb5={};var _0xeb2627;var _0x71d97b;return db[_0xbe14('0x42')][_0xbe14('0x5b')]({'where':{'id':_0x19123a['params']['id']}})[_0xbe14('0x27')](handleEntityNotFound(_0x8e6966,null))[_0xbe14('0x27')](function(_0x25b745){if(_0x25b745){_0xeb2627=_0x25b745;_0x555cb5[_0xbe14('0x34')]=_[_0xbe14('0x36')](db[_0xbe14('0x5f')]['rawAttributes']);_0x555cb5[_0xbe14('0x35')]=_[_0xbe14('0x36')](_0x19123a['query']);_0x555cb5[_0xbe14('0x37')]=_[_0xbe14('0x39')](_0x555cb5['model'],_0x555cb5['query']);_0x354181['attributes']=_['intersection'](_0x555cb5[_0xbe14('0x34')],qs[_0xbe14('0x47')](_0x19123a[_0xbe14('0x35')][_0xbe14('0x47')]));_0x354181[_0xbe14('0x38')]=_0x354181[_0xbe14('0x38')][_0xbe14('0x3a')]?_0x354181[_0xbe14('0x38')]:_0x555cb5['model'];_0x354181[_0xbe14('0x3d')]=qs[_0xbe14('0x3e')](_0x19123a[_0xbe14('0x35')]['sort']);_0x354181[_0xbe14('0x3f')]=qs[_0xbe14('0x37')](_['pick'](_0x19123a['query'],_0x555cb5['filters']));if(_0x19123a[_0xbe14('0x35')][_0xbe14('0x40')]){_0x354181[_0xbe14('0x3f')]=_['merge'](_0x354181['where'],{'$or':_[_0xbe14('0x2f')](_0x354181['attributes'],function(_0x1a69c6){var _0x51e6e7={};_0x51e6e7[_0x1a69c6]={'$like':'%'+_0x19123a[_0xbe14('0x35')]['filter']+'%'};return _0x51e6e7;})});}_0x354181=_['merge']({},_0x354181,_0x19123a[_0xbe14('0x41')]);return _0xeb2627[_0xbe14('0x60')](_0x354181);}})[_0xbe14('0x27')](function(_0x6d95b3){if(_0x6d95b3){_0x71d97b=_0x6d95b3[_0xbe14('0x3a')];if(!_0x19123a[_0xbe14('0x35')][_0xbe14('0x3b')](_0xbe14('0x3c'))){_0x354181[_0xbe14('0x1f')]=qs[_0xbe14('0x1f')](_0x19123a[_0xbe14('0x35')][_0xbe14('0x1f')]);_0x354181[_0xbe14('0x1e')]=qs['offset'](_0x19123a[_0xbe14('0x35')][_0xbe14('0x1e')]);}return _0xeb2627['getActions'](_0x354181);}})['then'](function(_0xb54ce3){if(_0xb54ce3){return _0xb54ce3?{'count':_0x71d97b,'rows':_0xb54ce3}:null;}})[_0xbe14('0x27')](respondWithResult(_0x8e6966,null))[_0xbe14('0x46')](handleError(_0x8e6966,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index e3217f0..a5cd7e5 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 _0x34e8=['tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger'];(function(_0xeb17cf,_0xe6ee30){var _0x1d3ca4=function(_0x4fd66d){while(--_0x4fd66d){_0xeb17cf['push'](_0xeb17cf['shift']());}};_0x1d3ca4(++_0xe6ee30);}(_0x34e8,0x12c));var _0x834e=function(_0x129293,_0x23b393){_0x129293=_0x129293-0x0;var _0x259be4=_0x34e8[_0x129293];return _0x259be4;};'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 _0x6737=['../../config/environment','./trigger.attributes','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1a3ebb,_0xac2d4f){var _0x16bb10=function(_0xdf8713){while(--_0xdf8713){_0x1a3ebb['push'](_0x1a3ebb['shift']());}};_0x16bb10(++_0xac2d4f);}(_0x6737,0xe2));var _0x7673=function(_0xa36ad,_0x4ff2b6){_0xa36ad=_0xa36ad-0x0;var _0x388b44=_0x6737[_0xa36ad];return _0x388b44;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var logger=require(_0x7673('0x1'))('api');var moment=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var rp=require(_0x7673('0x4'));var fs=require('fs');var path=require(_0x7673('0x5'));var rimraf=require('rimraf');var config=require(_0x7673('0x6'));var attributes=require(_0x7673('0x7'));module['exports']=function(_0x2f5edc,_0x15230f){return _0x2f5edc['define']('Trigger',attributes,{'tableName':'tools_triggers','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 ac465ac..5abfaae 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 _0xb2d9=['options','raw','attributes','limit','map','include','model','GetTrigger','stringify','ShowTrigger','find','where','then','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','message','Trigger,\x20%s,\x20%s','result','catch','Trigger','findAll'];(function(_0x55ac7f,_0x4a1704){var _0x1655be=function(_0x1c3b50){while(--_0x1c3b50){_0x55ac7f['push'](_0x55ac7f['shift']());}};_0x1655be(++_0x4a1704);}(_0xb2d9,0x1a6));var _0x9b2d=function(_0x522fb0,_0x38b2ff){_0x522fb0=_0x522fb0-0x0;var _0xa92879=_0xb2d9[_0x522fb0];return _0xa92879;};'use strict';var _=require(_0x9b2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b2d('0x1'));var rs=require(_0x9b2d('0x2'));var fs=require('fs');var Redis=require(_0x9b2d('0x3'));var db=require(_0x9b2d('0x4'))['db'];var utils=require(_0x9b2d('0x5'));var logger=require('../../config/logger')(_0x9b2d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9b2d('0x7')][_0x9b2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24eaf5,_0x36752e,_0x46cbcb){return new BPromise(function(_0x17ac5f,_0x51edaa){return client[_0x9b2d('0x9')](_0x24eaf5,_0x46cbcb)['then'](function(_0x11beb8){logger[_0x9b2d('0xa')]('Trigger,\x20%s,\x20%s',_0x36752e,_0x9b2d('0xb'));logger['debug'](_0x9b2d('0xc'),_0x36752e,_0x9b2d('0xb'),JSON['stringify'](_0x11beb8));if(_0x11beb8[_0x9b2d('0xd')]){if(_0x11beb8[_0x9b2d('0xd')]['code']===0x1f4){logger[_0x9b2d('0xd')]('Trigger,\x20%s,\x20%s',_0x36752e,_0x11beb8['error'][_0x9b2d('0xe')]);return _0x51edaa(_0x11beb8[_0x9b2d('0xd')][_0x9b2d('0xe')]);}logger[_0x9b2d('0xd')](_0x9b2d('0xf'),_0x36752e,_0x11beb8[_0x9b2d('0xd')]['message']);return _0x17ac5f(_0x11beb8[_0x9b2d('0xd')][_0x9b2d('0xe')]);}else{logger[_0x9b2d('0xa')](_0x9b2d('0xf'),_0x36752e,_0x9b2d('0xb'));_0x17ac5f(_0x11beb8[_0x9b2d('0x10')]['message']);}})[_0x9b2d('0x11')](function(_0x422944){logger[_0x9b2d('0xd')](_0x9b2d('0xf'),_0x36752e,_0x422944);_0x51edaa(_0x422944);});});}exports['GetTrigger']=function(_0x562498){var _0x40e10f=this;return new Promise(function(_0x1ca19d,_0x5a7518){return db[_0x9b2d('0x12')][_0x9b2d('0x13')]({'raw':_0x562498[_0x9b2d('0x14')]?_0x562498[_0x9b2d('0x14')][_0x9b2d('0x15')]===undefined?!![]:![]:!![],'where':_0x562498[_0x9b2d('0x14')]?_0x562498[_0x9b2d('0x14')]['where']||null:null,'attributes':_0x562498[_0x9b2d('0x14')]?_0x562498[_0x9b2d('0x14')][_0x9b2d('0x16')]||null:null,'limit':_0x562498[_0x9b2d('0x14')]?_0x562498[_0x9b2d('0x14')][_0x9b2d('0x17')]||null:null,'include':_0x562498[_0x9b2d('0x14')]?_0x562498[_0x9b2d('0x14')]['include']?_[_0x9b2d('0x18')](_0x562498[_0x9b2d('0x14')][_0x9b2d('0x19')],function(_0x461ab5){return{'model':db[_0x461ab5[_0x9b2d('0x1a')]],'as':_0x461ab5['as'],'attributes':_0x461ab5[_0x9b2d('0x16')],'include':_0x461ab5[_0x9b2d('0x19')]?_[_0x9b2d('0x18')](_0x461ab5[_0x9b2d('0x19')],function(_0x2ed636){return{'model':db[_0x2ed636['model']],'as':_0x2ed636['as'],'attributes':_0x2ed636['attributes'],'include':_0x2ed636[_0x9b2d('0x19')]?_[_0x9b2d('0x18')](_0x2ed636['include'],function(_0x445ba6){return{'model':db[_0x445ba6[_0x9b2d('0x1a')]],'as':_0x445ba6['as'],'attributes':_0x445ba6[_0x9b2d('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d9c30){logger[_0x9b2d('0xa')](_0x9b2d('0x1b'),_0x562498);logger['debug']('GetTrigger',_0x562498,JSON[_0x9b2d('0x1c')](_0x2d9c30));_0x1ca19d(_0x2d9c30);})[_0x9b2d('0x11')](function(_0x4defaf){logger[_0x9b2d('0xd')](_0x9b2d('0x1b'),_0x4defaf['message'],_0x562498);_0x5a7518(_0x40e10f[_0x9b2d('0xd')](0x1f4,_0x4defaf['message']));});});};exports[_0x9b2d('0x1d')]=function(_0x5e3a17){var _0x13e199=this;return new Promise(function(_0x38ac46,_0x4eb0ab){return db[_0x9b2d('0x12')][_0x9b2d('0x1e')]({'raw':_0x5e3a17[_0x9b2d('0x14')]?_0x5e3a17[_0x9b2d('0x14')][_0x9b2d('0x15')]===undefined?!![]:![]:!![],'where':_0x5e3a17['options']?_0x5e3a17[_0x9b2d('0x14')][_0x9b2d('0x1f')]||null:null,'attributes':_0x5e3a17[_0x9b2d('0x14')]?_0x5e3a17['options']['attributes']||null:null,'include':_0x5e3a17[_0x9b2d('0x14')]?_0x5e3a17['options'][_0x9b2d('0x19')]?_[_0x9b2d('0x18')](_0x5e3a17[_0x9b2d('0x14')][_0x9b2d('0x19')],function(_0x837c5a){return{'model':db[_0x837c5a[_0x9b2d('0x1a')]],'as':_0x837c5a['as'],'attributes':_0x837c5a[_0x9b2d('0x16')],'include':_0x837c5a[_0x9b2d('0x19')]?_['map'](_0x837c5a[_0x9b2d('0x19')],function(_0x11612e){return{'model':db[_0x11612e[_0x9b2d('0x1a')]],'as':_0x11612e['as'],'attributes':_0x11612e['attributes'],'include':_0x11612e[_0x9b2d('0x19')]?_['map'](_0x11612e['include'],function(_0x3f6bfe){return{'model':db[_0x3f6bfe[_0x9b2d('0x1a')]],'as':_0x3f6bfe['as'],'attributes':_0x3f6bfe[_0x9b2d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9b2d('0x20')](function(_0x5d2fa1){logger[_0x9b2d('0xa')](_0x9b2d('0x1d'),_0x5e3a17);logger[_0x9b2d('0x21')]('ShowTrigger',_0x5e3a17,JSON[_0x9b2d('0x1c')](_0x5d2fa1));_0x38ac46(_0x5d2fa1);})[_0x9b2d('0x11')](function(_0x51c051){logger[_0x9b2d('0xd')](_0x9b2d('0x1d'),_0x51c051['message'],_0x5e3a17);_0x4eb0ab(_0x13e199['error'](0x1f4,_0x51c051['message']));});});}; \ No newline at end of file +var _0xd958=['map','model','then','GetTrigger','catch','ShowTrigger','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Trigger','findAll','options','raw','attributes','limit','include'];(function(_0x5bcb00,_0x72f609){var _0x496ad1=function(_0x4a01c1){while(--_0x4a01c1){_0x5bcb00['push'](_0x5bcb00['shift']());}};_0x496ad1(++_0x72f609);}(_0xd958,0x1aa));var _0x8d95=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xd958[_0x346737];return _0x1ade2e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8d95('0x0'));var BPromise=require(_0x8d95('0x1'));var rs=require(_0x8d95('0x2'));var fs=require('fs');var Redis=require(_0x8d95('0x3'));var db=require(_0x8d95('0x4'))['db'];var utils=require(_0x8d95('0x5'));var logger=require(_0x8d95('0x6'))(_0x8d95('0x7'));var config=require(_0x8d95('0x8'));var jayson=require(_0x8d95('0x9'));var client=jayson[_0x8d95('0xa')][_0x8d95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x105ffb,_0x2f2801,_0x46b8ac){return new BPromise(function(_0x1a950d,_0x5cf88e){return client[_0x8d95('0xc')](_0x105ffb,_0x46b8ac)['then'](function(_0x3ac6c2){logger[_0x8d95('0xd')](_0x8d95('0xe'),_0x2f2801,_0x8d95('0xf'));logger[_0x8d95('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x2f2801,'request\x20sent',JSON[_0x8d95('0x11')](_0x3ac6c2));if(_0x3ac6c2[_0x8d95('0x12')]){if(_0x3ac6c2[_0x8d95('0x12')][_0x8d95('0x13')]===0x1f4){logger[_0x8d95('0x12')](_0x8d95('0xe'),_0x2f2801,_0x3ac6c2[_0x8d95('0x12')]['message']);return _0x5cf88e(_0x3ac6c2[_0x8d95('0x12')][_0x8d95('0x14')]);}logger[_0x8d95('0x12')]('Trigger,\x20%s,\x20%s',_0x2f2801,_0x3ac6c2[_0x8d95('0x12')][_0x8d95('0x14')]);return _0x1a950d(_0x3ac6c2['error'][_0x8d95('0x14')]);}else{logger['info'](_0x8d95('0xe'),_0x2f2801,_0x8d95('0xf'));_0x1a950d(_0x3ac6c2[_0x8d95('0x15')][_0x8d95('0x14')]);}})['catch'](function(_0x351d1d){logger[_0x8d95('0x12')](_0x8d95('0xe'),_0x2f2801,_0x351d1d);_0x5cf88e(_0x351d1d);});});}exports['GetTrigger']=function(_0x47a179){var _0x45262c=this;return new Promise(function(_0x136c1b,_0x2b7c6f){return db[_0x8d95('0x16')][_0x8d95('0x17')]({'raw':_0x47a179[_0x8d95('0x18')]?_0x47a179[_0x8d95('0x18')][_0x8d95('0x19')]===undefined?!![]:![]:!![],'where':_0x47a179[_0x8d95('0x18')]?_0x47a179[_0x8d95('0x18')]['where']||null:null,'attributes':_0x47a179['options']?_0x47a179[_0x8d95('0x18')][_0x8d95('0x1a')]||null:null,'limit':_0x47a179['options']?_0x47a179['options'][_0x8d95('0x1b')]||null:null,'include':_0x47a179['options']?_0x47a179[_0x8d95('0x18')][_0x8d95('0x1c')]?_[_0x8d95('0x1d')](_0x47a179['options']['include'],function(_0x312e07){return{'model':db[_0x312e07[_0x8d95('0x1e')]],'as':_0x312e07['as'],'attributes':_0x312e07['attributes'],'include':_0x312e07[_0x8d95('0x1c')]?_[_0x8d95('0x1d')](_0x312e07[_0x8d95('0x1c')],function(_0x24fa9e){return{'model':db[_0x24fa9e[_0x8d95('0x1e')]],'as':_0x24fa9e['as'],'attributes':_0x24fa9e[_0x8d95('0x1a')],'include':_0x24fa9e[_0x8d95('0x1c')]?_[_0x8d95('0x1d')](_0x24fa9e[_0x8d95('0x1c')],function(_0x4dc0c7){return{'model':db[_0x4dc0c7[_0x8d95('0x1e')]],'as':_0x4dc0c7['as'],'attributes':_0x4dc0c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d95('0x1f')](function(_0x744699){logger['info']('GetTrigger',_0x47a179);logger[_0x8d95('0x10')](_0x8d95('0x20'),_0x47a179,JSON[_0x8d95('0x11')](_0x744699));_0x136c1b(_0x744699);})[_0x8d95('0x21')](function(_0x3bdae6){logger[_0x8d95('0x12')]('GetTrigger',_0x3bdae6['message'],_0x47a179);_0x2b7c6f(_0x45262c['error'](0x1f4,_0x3bdae6[_0x8d95('0x14')]));});});};exports[_0x8d95('0x22')]=function(_0x58d580){var _0x1bb7a0=this;return new Promise(function(_0x31839b,_0x2d4876){return db[_0x8d95('0x16')]['find']({'raw':_0x58d580[_0x8d95('0x18')]?_0x58d580['options']['raw']===undefined?!![]:![]:!![],'where':_0x58d580[_0x8d95('0x18')]?_0x58d580['options']['where']||null:null,'attributes':_0x58d580[_0x8d95('0x18')]?_0x58d580[_0x8d95('0x18')]['attributes']||null:null,'include':_0x58d580['options']?_0x58d580[_0x8d95('0x18')][_0x8d95('0x1c')]?_[_0x8d95('0x1d')](_0x58d580['options'][_0x8d95('0x1c')],function(_0xc5b2d5){return{'model':db[_0xc5b2d5[_0x8d95('0x1e')]],'as':_0xc5b2d5['as'],'attributes':_0xc5b2d5['attributes'],'include':_0xc5b2d5[_0x8d95('0x1c')]?_['map'](_0xc5b2d5[_0x8d95('0x1c')],function(_0x4b415a){return{'model':db[_0x4b415a[_0x8d95('0x1e')]],'as':_0x4b415a['as'],'attributes':_0x4b415a[_0x8d95('0x1a')],'include':_0x4b415a['include']?_[_0x8d95('0x1d')](_0x4b415a[_0x8d95('0x1c')],function(_0x42b9e0){return{'model':db[_0x42b9e0[_0x8d95('0x1e')]],'as':_0x42b9e0['as'],'attributes':_0x42b9e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d95('0x1f')](function(_0x56eb07){logger[_0x8d95('0xd')]('ShowTrigger',_0x58d580);logger[_0x8d95('0x10')](_0x8d95('0x22'),_0x58d580,JSON[_0x8d95('0x11')](_0x56eb07));_0x31839b(_0x56eb07);})[_0x8d95('0x21')](function(_0x140ddc){logger[_0x8d95('0x12')](_0x8d95('0x22'),_0x140ddc[_0x8d95('0x14')],_0x58d580);_0x2d4876(_0x1bb7a0[_0x8d95('0x12')](0x1f4,_0x140ddc[_0x8d95('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 9cc11d7..d252da7 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 _0xea4b=['Router','../../components/auth/service','./trunk.controller','index','/:id','isAuthenticated','show','post','/:id/clone','put','update','destroy','exports','connect-timeout','express'];(function(_0x3db8d8,_0x13756b){var _0x26e5ae=function(_0x1fcfa2){while(--_0x1fcfa2){_0x3db8d8['push'](_0x3db8d8['shift']());}};_0x26e5ae(++_0x13756b);}(_0xea4b,0x184));var _0xbea4=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xea4b[_0x4687df];return _0x32eaef;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbea4('0x0'));var express=require(_0xbea4('0x1'));var router=express[_0xbea4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbea4('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbea4('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xbea4('0x5')]);router['get'](_0xbea4('0x6'),auth[_0xbea4('0x7')](),controller[_0xbea4('0x8')]);router[_0xbea4('0x9')](_0xbea4('0xa'),auth[_0xbea4('0x7')](),controller['clone']);router['post']('/',auth[_0xbea4('0x7')](),controller['create']);router[_0xbea4('0xb')](_0xbea4('0x6'),auth['isAuthenticated'](),controller[_0xbea4('0xc')]);router['delete'](_0xbea4('0x6'),auth[_0xbea4('0x7')](),controller[_0xbea4('0xd')]);module[_0xbea4('0xe')]=router; \ No newline at end of file +var _0x0445=['Router','fs-extra','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x22b62d,_0x42576d){var _0x40866e=function(_0x5ead97){while(--_0x5ead97){_0x22b62d['push'](_0x22b62d['shift']());}};_0x40866e(++_0x42576d);}(_0x0445,0xc2));var _0x5044=function(_0x43fda2,_0x1c5662){_0x43fda2=_0x43fda2-0x0;var _0xa492a2=_0x0445[_0x43fda2];return _0xa492a2;};'use strict';var multer=require(_0x5044('0x0'));var util=require(_0x5044('0x1'));var path=require(_0x5044('0x2'));var timeout=require(_0x5044('0x3'));var express=require('express');var router=express[_0x5044('0x4')]();var fs_extra=require(_0x5044('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5044('0x6'));var controller=require(_0x5044('0x7'));router[_0x5044('0x8')]('/',auth['isAuthenticated'](),controller[_0x5044('0x9')]);router[_0x5044('0x8')](_0x5044('0xa'),auth[_0x5044('0xb')](),controller[_0x5044('0xc')]);router[_0x5044('0xd')](_0x5044('0xe'),auth[_0x5044('0xb')](),controller[_0x5044('0xf')]);router[_0x5044('0xd')]('/',auth[_0x5044('0xb')](),controller[_0x5044('0x10')]);router[_0x5044('0x11')](_0x5044('0xa'),auth[_0x5044('0xb')](),controller[_0x5044('0x12')]);router[_0x5044('0x13')](_0x5044('0xa'),auth[_0x5044('0xb')](),controller[_0x5044('0x14')]);module[_0x5044('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index b4d35ca..630141f 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 _0xe9d8=['inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uas','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','sequelize','exports','STRING','name','user','peer','from-voip-provider','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','info'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe9d8,0x111));var _0x8e9d=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xe9d8[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x8e9d('0x0'));module[_0x8e9d('0x1')]={'name':{'type':Sequelize[_0x8e9d('0x2')],'allowNull':![],'unique':_0x8e9d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x8e9d('0x4'),_0x8e9d('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8e9d('0x6')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x8e9d('0x7'),_0x8e9d('0x8'),_0x8e9d('0x9'),'PROHIB_PASSED_SCREEN',_0x8e9d('0xa'),_0x8e9d('0xb'))},'deny':{'type':Sequelize[_0x8e9d('0x2')]},'permit':{'type':Sequelize[_0x8e9d('0x2')]},'secret':{'type':Sequelize[_0x8e9d('0x2')]},'md5secret':{'type':Sequelize[_0x8e9d('0x2')]},'remotesecret':{'type':Sequelize[_0x8e9d('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x8e9d('0xc'),'set':function(_0xd74a2e){this[_0x8e9d('0xd')](_0x8e9d('0xe'),_0xd74a2e?_0xd74a2e[_0x8e9d('0xf')](','):null);},'get':function(){return this[_0x8e9d('0x10')]('transport')?this[_0x8e9d('0x10')](_0x8e9d('0xe'))[_0x8e9d('0x11')](','):null;},'comment':_0x8e9d('0x12')},'dtmfmode':{'type':Sequelize[_0x8e9d('0x13')]('rfc2833',_0x8e9d('0x14'),'shortinfo',_0x8e9d('0x15'),_0x8e9d('0x16')),'defaultValue':_0x8e9d('0x17')},'directmedia':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no',_0x8e9d('0x19'),_0x8e9d('0x1a'),_0x8e9d('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8e9d('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x8e9d('0x2')],'defaultValue':_0x8e9d('0x1c'),'set':function(_0x53ace2){this[_0x8e9d('0xd')](_0x8e9d('0x1d'),_0x53ace2?_0x53ace2[_0x8e9d('0xf')](','):null);},'get':function(){return this[_0x8e9d('0x10')](_0x8e9d('0x1d'))?this[_0x8e9d('0x10')](_0x8e9d('0x1d'))[_0x8e9d('0x11')](','):null;},'comment':_0x8e9d('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x8e9d('0x2')]},'pickupgroup':{'type':Sequelize[_0x8e9d('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x8e9d('0x2')]},'language':{'type':Sequelize[_0x8e9d('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8e9d('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8e9d('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x8e9d('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xf41494){this[_0x8e9d('0xd')](_0x8e9d('0x1f'),_0xf41494?_0xf41494[_0x8e9d('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8e9d('0x10')](_0x8e9d('0x1f'))?this['getDataValue'](_0x8e9d('0x1f'))[_0x8e9d('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'insecure':{'type':Sequelize[_0x8e9d('0x2')],'defaultValue':_0x8e9d('0x20'),'set':function(_0x4aade0){this[_0x8e9d('0xd')](_0x8e9d('0x21'),_0x4aade0?_0x4aade0[_0x8e9d('0xf')](','):null);},'get':function(){return this[_0x8e9d('0x10')](_0x8e9d('0x21'))?this[_0x8e9d('0x10')](_0x8e9d('0x21'))[_0x8e9d('0x11')](','):null;},'comment':_0x8e9d('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x8e9d('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8e9d('0x13')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8e9d('0x13')]('yes','no',_0x8e9d('0x23'))},'promiscredir':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x8e9d('0x25')},'amaflags':{'type':Sequelize[_0x8e9d('0x2')]},'callcounter':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no'),'defaultValue':_0x8e9d('0x18')},'busylevel':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x8e9d('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x8e9d('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no',_0x8e9d('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x8e9d('0x2')]},'session_timers':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x27'),_0x8e9d('0x28'),'originate')},'session_expires':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x8e9d('0x29')),'defaultValue':_0x8e9d('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x8e9d('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x8e9d('0x2')]},'fromuser':{'type':Sequelize[_0x8e9d('0x2')]},'port':{'type':Sequelize[_0x8e9d('0x24')](0x5)},'qualify':{'type':Sequelize[_0x8e9d('0x13')]('yes','no'),'defaultValue':_0x8e9d('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x8e9d('0x2')]},'rtptimeout':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8e9d('0x2')]},'callbackextension':{'type':Sequelize[_0x8e9d('0x2')]},'timert1':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'timerb':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x8e9d('0x2')]},'contactdeny':{'type':Sequelize[_0x8e9d('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x8e9d('0x2')]},'use_q850_reason':{'type':Sequelize[_0x8e9d('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8e9d('0x13')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x8e9d('0x13')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no',_0x8e9d('0x2a'),_0x8e9d('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x8e9d('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8e9d('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x8e9d('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x8e9d('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x8e9d('0x2c'),_0x8e9d('0x2d'),_0x8e9d('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8e9d('0x2')]},'usereqphone':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x8e9d('0x2')]},'call_limit':{'type':Sequelize[_0x8e9d('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x8e9d('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no')},'vmexten':{'type':Sequelize[_0x8e9d('0x2')]},'mohinterpret':{'type':Sequelize[_0x8e9d('0x2')]},'mohsuggest':{'type':Sequelize[_0x8e9d('0x2')]},'parkinglot':{'type':Sequelize[_0x8e9d('0x2')]},'description':{'type':Sequelize[_0x8e9d('0x2')]},'host':{'type':Sequelize[_0x8e9d('0x2')],'defaultValue':_0x8e9d('0x2f')},'canreinvite':{'type':Sequelize[_0x8e9d('0x13')](_0x8e9d('0x18'),'no','nonat',_0x8e9d('0x1a'),_0x8e9d('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8e9d('0x2')]},'otherFields':{'type':Sequelize[_0x8e9d('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8e9d('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x4a94=['inband','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','always','refuse','originate','pai','fingerprint','certificate','active','passive','dynamic','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo'];(function(_0x15abea,_0x8609f5){var _0x32028a=function(_0x5cd589){while(--_0x5cd589){_0x15abea['push'](_0x15abea['shift']());}};_0x32028a(++_0x8609f5);}(_0x4a94,0xde));var _0x44a9=function(_0x4f48a6,_0x3b0514){_0x4f48a6=_0x4f48a6-0x0;var _0x2fb6a5=_0x4a94[_0x4f48a6];return _0x2fb6a5;};'use strict';var Sequelize=require(_0x44a9('0x0'));module[_0x44a9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x44a9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x4'),'user',_0x44a9('0x5')),'allowNull':![],'defaultValue':_0x44a9('0x4')},'context':{'type':Sequelize[_0x44a9('0x6')],'allowNull':![],'defaultValue':_0x44a9('0x7')},'callingpres':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x8'),_0x44a9('0x9'),_0x44a9('0xa'),_0x44a9('0xb'),_0x44a9('0xc'),_0x44a9('0xd'),_0x44a9('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0x44a9('0x6')]},'permit':{'type':Sequelize[_0x44a9('0x6')]},'secret':{'type':Sequelize[_0x44a9('0x6')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x44a9('0x6')]},'transport':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':_0x44a9('0xf'),'set':function(_0x3e9c88){this['setDataValue']('transport',_0x3e9c88?_0x3e9c88['join'](','):null);},'get':function(){return this[_0x44a9('0x10')](_0x44a9('0x11'))?this['getDataValue']('transport')[_0x44a9('0x12')](','):null;},'comment':_0x44a9('0x13')},'dtmfmode':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x14'),_0x44a9('0x15'),_0x44a9('0x16'),_0x44a9('0x17'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no',_0x44a9('0x19'),_0x44a9('0x1a'),_0x44a9('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44a9('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x44a9('0x6')]},'nat':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':_0x44a9('0x1c'),'set':function(_0x2da156){this[_0x44a9('0x1d')](_0x44a9('0x1e'),_0x2da156?_0x2da156[_0x44a9('0x1f')](','):null);},'get':function(){return this[_0x44a9('0x10')]('nat')?this[_0x44a9('0x10')](_0x44a9('0x1e'))[_0x44a9('0x12')](','):null;},'comment':_0x44a9('0x20')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x44a9('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x44a9('0x6')]},'language':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x44a9('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':_0x44a9('0x21')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x27f026){this[_0x44a9('0x1d')](_0x44a9('0x22'),_0x27f026?_0x27f026[_0x44a9('0x1f')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x44a9('0x10')]('allow')?this[_0x44a9('0x10')](_0x44a9('0x22'))[_0x44a9('0x12')](';'):null;},'comment':_0x44a9('0x23')},'autoframing':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'insecure':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':'port,invite','set':function(_0x283497){this[_0x44a9('0x1d')](_0x44a9('0x24'),_0x283497?_0x283497[_0x44a9('0x1f')](','):null);},'get':function(){return this[_0x44a9('0x10')]('insecure')?this[_0x44a9('0x10')](_0x44a9('0x24'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x44a9('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x44a9('0x18'),'no',_0x44a9('0x25'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'accountcode':{'type':Sequelize[_0x44a9('0x26')](0xb)},'setvar':{'type':Sequelize[_0x44a9('0x6')]},'callerid':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x44a9('0x6')]},'callcounter':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no'),'defaultValue':_0x44a9('0x18')},'busylevel':{'type':Sequelize[_0x44a9('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x44a9('0x6')]},'videosupport':{'type':Sequelize[_0x44a9('0x3')]('yes','no',_0x44a9('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'mailbox':{'type':Sequelize[_0x44a9('0x6')]},'session_timers':{'type':Sequelize[_0x44a9('0x3')]('accept',_0x44a9('0x28'),_0x44a9('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x44a9('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x44a9('0x3')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x44a9('0x6')]},'regexten':{'type':Sequelize[_0x44a9('0x6')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x44a9('0x6')]},'port':{'type':Sequelize[_0x44a9('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x44a9('0x18'),'no'),'defaultValue':_0x44a9('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x44a9('0x6')]},'rtptimeout':{'type':Sequelize[_0x44a9('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x44a9('0x3')]('yes','no',_0x44a9('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x44a9('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x44a9('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x44a9('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x44a9('0x6')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x44a9('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x44a9('0x6')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x44a9('0x26')](0xb)},'encryption':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x44a9('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'icesupport':{'type':Sequelize[_0x44a9('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x44a9('0x3')]('yes','no',_0x44a9('0x2b'),_0x44a9('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x44a9('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x44a9('0x6')]},'dtlscipher':{'type':Sequelize[_0x44a9('0x6')]},'dtlscafile':{'type':Sequelize[_0x44a9('0x6')]},'dtlscapath':{'type':Sequelize[_0x44a9('0x6')]},'dtlssetup':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x2d'),_0x44a9('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x44a9('0x6')]},'recordofffeature':{'type':Sequelize[_0x44a9('0x6')]},'call_limit':{'type':Sequelize[_0x44a9('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x44a9('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no')},'vmexten':{'type':Sequelize[_0x44a9('0x6')]},'mohinterpret':{'type':Sequelize[_0x44a9('0x6')]},'mohsuggest':{'type':Sequelize[_0x44a9('0x6')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44a9('0x6')]},'host':{'type':Sequelize[_0x44a9('0x6')],'defaultValue':_0x44a9('0x2f')},'canreinvite':{'type':Sequelize[_0x44a9('0x3')](_0x44a9('0x18'),'no',_0x44a9('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x44a9('0x6')]},'active':{'type':Sequelize[_0x44a9('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x44a9('0x6')],'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 37ed781..4179162 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x8a3e47,_0x54bfb9){var _0xcab3f2=function(_0x1d7180){while(--_0x1d7180){_0x8a3e47['push'](_0x8a3e47['shift']());}};_0xcab3f2(++_0x54bfb9);}(_0xe14d,0x1ee));var _0xde14=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe14d[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0xf76d16,_0x109fe3){var _0x281d97=function(_0x109e35){while(--_0x109e35){_0xf76d16['push'](_0xf76d16['shift']());}};_0x281d97(++_0x109fe3);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2f2c66,_0x2f8db1){_0x2f2c66=_0x2f2c66-0x0;var _0x3a66cf=_0xd6d6[_0x2f2c66];return _0x3a66cf;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index eef3d87..1dd2776 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 _0xb84b=['tools_trunks','util','../../config/logger','api','moment','bluebird','path','rimraf','./trunk.attributes','exports','define'];(function(_0x359399,_0x5bb679){var _0x562e3a=function(_0x41e6bd){while(--_0x41e6bd){_0x359399['push'](_0x359399['shift']());}};_0x562e3a(++_0x5bb679);}(_0xb84b,0x16c));var _0xbb84=function(_0x55ecdb,_0x52e77c){_0x55ecdb=_0x55ecdb-0x0;var _0x196713=_0xb84b[_0x55ecdb];return _0x196713;};'use strict';var _=require('lodash');var util=require(_0xbb84('0x0'));var logger=require(_0xbb84('0x1'))(_0xbb84('0x2'));var moment=require(_0xbb84('0x3'));var BPromise=require(_0xbb84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb84('0x5'));var rimraf=require(_0xbb84('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb84('0x7'));module[_0xbb84('0x8')]=function(_0x5823c6,_0x35726a){return _0x5823c6[_0xbb84('0x9')]('Trunk',attributes,{'tableName':_0xbb84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x584c=['./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x10bb45,_0xa57a18){var _0x4f1846=function(_0x319b89){while(--_0x319b89){_0x10bb45['push'](_0x10bb45['shift']());}};_0x4f1846(++_0xa57a18);}(_0x584c,0x185));var _0xc584=function(_0x264e7f,_0x4b8f91){_0x264e7f=_0x264e7f-0x0;var _0x173e6e=_0x584c[_0x264e7f];return _0x173e6e;};'use strict';var _=require(_0xc584('0x0'));var util=require(_0xc584('0x1'));var logger=require('../../config/logger')(_0xc584('0x2'));var moment=require(_0xc584('0x3'));var BPromise=require(_0xc584('0x4'));var rp=require(_0xc584('0x5'));var fs=require('fs');var path=require(_0xc584('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc584('0x7'));module[_0xc584('0x8')]=function(_0x1dc890,_0x4fb620){return _0x1dc890[_0xc584('0x9')](_0xc584('0xa'),attributes,{'tableName':_0xc584('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 3fb653a..37424d0 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 _0x4d69=['moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x4d69,0x82));var _0x94d6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x4d69[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x94d6('0x0'));var util=require(_0x94d6('0x1'));var moment=require(_0x94d6('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(_0x94d6('0x3'));var logger=require(_0x94d6('0x4'))(_0x94d6('0x5'));var config=require('../../config/environment');var jayson=require(_0x94d6('0x6'));var client=jayson[_0x94d6('0x7')][_0x94d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dad55,_0x5971c7,_0x4c9ad5){return new BPromise(function(_0x548fb2,_0x21c3e5){return client[_0x94d6('0x9')](_0x5dad55,_0x4c9ad5)[_0x94d6('0xa')](function(_0x4d8b07){logger[_0x94d6('0xb')]('Trunk,\x20%s,\x20%s',_0x5971c7,'request\x20sent');logger[_0x94d6('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5971c7,_0x94d6('0xd'),JSON[_0x94d6('0xe')](_0x4d8b07));if(_0x4d8b07[_0x94d6('0xf')]){if(_0x4d8b07[_0x94d6('0xf')]['code']===0x1f4){logger['error'](_0x94d6('0x10'),_0x5971c7,_0x4d8b07[_0x94d6('0xf')]['message']);return _0x21c3e5(_0x4d8b07['error']['message']);}logger['error'](_0x94d6('0x10'),_0x5971c7,_0x4d8b07[_0x94d6('0xf')]['message']);return _0x548fb2(_0x4d8b07[_0x94d6('0xf')][_0x94d6('0x11')]);}else{logger[_0x94d6('0xb')](_0x94d6('0x10'),_0x5971c7,_0x94d6('0xd'));_0x548fb2(_0x4d8b07[_0x94d6('0x12')][_0x94d6('0x11')]);}})[_0x94d6('0x13')](function(_0x1cb661){logger[_0x94d6('0xf')](_0x94d6('0x10'),_0x5971c7,_0x1cb661);_0x21c3e5(_0x1cb661);});});}exports[_0x94d6('0x14')]=function(_0x36a65c){var _0x2a4ff4=this;return new Promise(function(_0x1c6c48,_0x1434b1){return db[_0x94d6('0x15')][_0x94d6('0x16')]({'raw':_0x36a65c[_0x94d6('0x17')]?_0x36a65c[_0x94d6('0x17')][_0x94d6('0x18')]===undefined?!![]:![]:!![],'where':_0x36a65c[_0x94d6('0x17')]?_0x36a65c[_0x94d6('0x17')][_0x94d6('0x19')]||null:null,'attributes':_0x36a65c[_0x94d6('0x17')]?_0x36a65c[_0x94d6('0x17')][_0x94d6('0x1a')]||null:null,'limit':_0x36a65c['options']?_0x36a65c[_0x94d6('0x17')][_0x94d6('0x1b')]||null:null,'include':_0x36a65c['options']?_0x36a65c[_0x94d6('0x17')][_0x94d6('0x1c')]?_[_0x94d6('0x1d')](_0x36a65c[_0x94d6('0x17')][_0x94d6('0x1c')],function(_0x2a9591){return{'model':db[_0x2a9591['model']],'as':_0x2a9591['as'],'attributes':_0x2a9591[_0x94d6('0x1a')],'include':_0x2a9591[_0x94d6('0x1c')]?_[_0x94d6('0x1d')](_0x2a9591[_0x94d6('0x1c')],function(_0x3d6f93){return{'model':db[_0x3d6f93[_0x94d6('0x1e')]],'as':_0x3d6f93['as'],'attributes':_0x3d6f93['attributes'],'include':_0x3d6f93[_0x94d6('0x1c')]?_['map'](_0x3d6f93[_0x94d6('0x1c')],function(_0x142598){return{'model':db[_0x142598[_0x94d6('0x1e')]],'as':_0x142598['as'],'attributes':_0x142598['attributes']};}):[]};}):[]};}):[]:[]})[_0x94d6('0xa')](function(_0x5d8668){logger[_0x94d6('0xb')](_0x94d6('0x14'),_0x36a65c);logger[_0x94d6('0xc')](_0x94d6('0x14'),_0x36a65c,JSON[_0x94d6('0xe')](_0x5d8668));_0x1c6c48(_0x5d8668);})[_0x94d6('0x13')](function(_0x151f37){logger[_0x94d6('0xf')](_0x94d6('0x14'),_0x151f37[_0x94d6('0x11')],_0x36a65c);_0x1434b1(_0x2a4ff4[_0x94d6('0xf')](0x1f4,_0x151f37[_0x94d6('0x11')]));});});};exports[_0x94d6('0x1f')]=function(_0x228166){var _0x42e0ac=this;return new Promise(function(_0x4a30a9,_0x1cf361){return db[_0x94d6('0x15')][_0x94d6('0x20')]({'raw':_0x228166['options']?_0x228166[_0x94d6('0x17')][_0x94d6('0x18')]===undefined?!![]:![]:!![],'where':_0x228166[_0x94d6('0x17')]?_0x228166[_0x94d6('0x17')][_0x94d6('0x19')]||null:null,'attributes':_0x228166[_0x94d6('0x17')]?_0x228166[_0x94d6('0x17')]['attributes']||null:null,'include':_0x228166['options']?_0x228166[_0x94d6('0x17')][_0x94d6('0x1c')]?_[_0x94d6('0x1d')](_0x228166[_0x94d6('0x17')][_0x94d6('0x1c')],function(_0x290f0c){return{'model':db[_0x290f0c[_0x94d6('0x1e')]],'as':_0x290f0c['as'],'attributes':_0x290f0c[_0x94d6('0x1a')],'include':_0x290f0c['include']?_[_0x94d6('0x1d')](_0x290f0c['include'],function(_0x44245c){return{'model':db[_0x44245c[_0x94d6('0x1e')]],'as':_0x44245c['as'],'attributes':_0x44245c[_0x94d6('0x1a')],'include':_0x44245c[_0x94d6('0x1c')]?_['map'](_0x44245c[_0x94d6('0x1c')],function(_0xf7451c){return{'model':db[_0xf7451c[_0x94d6('0x1e')]],'as':_0xf7451c['as'],'attributes':_0xf7451c[_0x94d6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38fd39){logger[_0x94d6('0xb')]('ShowTrunk',_0x228166);logger['debug'](_0x94d6('0x1f'),_0x228166,JSON[_0x94d6('0xe')](_0x38fd39));_0x4a30a9(_0x38fd39);})['catch'](function(_0x291b38){logger[_0x94d6('0xf')]('ShowTrunk',_0x291b38[_0x94d6('0x11')],_0x228166);_0x1cf361(_0x42e0ac[_0x94d6('0xf')](0x1f4,_0x291b38[_0x94d6('0x11')]));});});}; \ No newline at end of file +var _0x1141=['catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x323970,_0x5bde6f){var _0x3217da=function(_0x4dcdf3){while(--_0x4dcdf3){_0x323970['push'](_0x323970['shift']());}};_0x3217da(++_0x5bde6f);}(_0x1141,0x8d));var _0x1114=function(_0x2b8f84,_0x349ee2){_0x2b8f84=_0x2b8f84-0x0;var _0x2927ca=_0x1141[_0x2b8f84];return _0x2927ca;};'use strict';var _=require('lodash');var util=require(_0x1114('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1114('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x1114('0x2'));var logger=require(_0x1114('0x3'))(_0x1114('0x4'));var config=require(_0x1114('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1114('0x6')][_0x1114('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31cf3b,_0x21990d,_0x17cd58){return new BPromise(function(_0x2ee538,_0x377197){return client['request'](_0x31cf3b,_0x17cd58)[_0x1114('0x8')](function(_0x4c666b){logger[_0x1114('0x9')](_0x1114('0xa'),_0x21990d,'request\x20sent');logger[_0x1114('0xb')](_0x1114('0xc'),_0x21990d,_0x1114('0xd'),JSON[_0x1114('0xe')](_0x4c666b));if(_0x4c666b[_0x1114('0xf')]){if(_0x4c666b[_0x1114('0xf')][_0x1114('0x10')]===0x1f4){logger[_0x1114('0xf')](_0x1114('0xa'),_0x21990d,_0x4c666b[_0x1114('0xf')][_0x1114('0x11')]);return _0x377197(_0x4c666b[_0x1114('0xf')][_0x1114('0x11')]);}logger[_0x1114('0xf')](_0x1114('0xa'),_0x21990d,_0x4c666b[_0x1114('0xf')][_0x1114('0x11')]);return _0x2ee538(_0x4c666b[_0x1114('0xf')][_0x1114('0x11')]);}else{logger[_0x1114('0x9')](_0x1114('0xa'),_0x21990d,_0x1114('0xd'));_0x2ee538(_0x4c666b[_0x1114('0x12')]['message']);}})[_0x1114('0x13')](function(_0xb829ae){logger[_0x1114('0xf')](_0x1114('0xa'),_0x21990d,_0xb829ae);_0x377197(_0xb829ae);});});}exports[_0x1114('0x14')]=function(_0x1b6255){var _0x4d2ccb=this;return new Promise(function(_0x33302b,_0x4d119e){return db[_0x1114('0x15')][_0x1114('0x16')]({'raw':_0x1b6255[_0x1114('0x17')]?_0x1b6255[_0x1114('0x17')][_0x1114('0x18')]===undefined?!![]:![]:!![],'where':_0x1b6255[_0x1114('0x17')]?_0x1b6255[_0x1114('0x17')][_0x1114('0x19')]||null:null,'attributes':_0x1b6255[_0x1114('0x17')]?_0x1b6255[_0x1114('0x17')][_0x1114('0x1a')]||null:null,'limit':_0x1b6255[_0x1114('0x17')]?_0x1b6255[_0x1114('0x17')][_0x1114('0x1b')]||null:null,'include':_0x1b6255[_0x1114('0x17')]?_0x1b6255[_0x1114('0x17')][_0x1114('0x1c')]?_[_0x1114('0x1d')](_0x1b6255[_0x1114('0x17')][_0x1114('0x1c')],function(_0x499a04){return{'model':db[_0x499a04['model']],'as':_0x499a04['as'],'attributes':_0x499a04[_0x1114('0x1a')],'include':_0x499a04[_0x1114('0x1c')]?_['map'](_0x499a04[_0x1114('0x1c')],function(_0x257c34){return{'model':db[_0x257c34['model']],'as':_0x257c34['as'],'attributes':_0x257c34['attributes'],'include':_0x257c34[_0x1114('0x1c')]?_[_0x1114('0x1d')](_0x257c34[_0x1114('0x1c')],function(_0x4a2823){return{'model':db[_0x4a2823[_0x1114('0x1e')]],'as':_0x4a2823['as'],'attributes':_0x4a2823[_0x1114('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1114('0x8')](function(_0x27a485){logger[_0x1114('0x9')]('GetTrunk',_0x1b6255);logger[_0x1114('0xb')](_0x1114('0x14'),_0x1b6255,JSON[_0x1114('0xe')](_0x27a485));_0x33302b(_0x27a485);})[_0x1114('0x13')](function(_0x1b3f68){logger[_0x1114('0xf')](_0x1114('0x14'),_0x1b3f68[_0x1114('0x11')],_0x1b6255);_0x4d119e(_0x4d2ccb['error'](0x1f4,_0x1b3f68[_0x1114('0x11')]));});});};exports[_0x1114('0x1f')]=function(_0x111415){var _0x2d8fc7=this;return new Promise(function(_0x1d569f,_0x2285ea){return db['Trunk']['find']({'raw':_0x111415[_0x1114('0x17')]?_0x111415['options'][_0x1114('0x18')]===undefined?!![]:![]:!![],'where':_0x111415['options']?_0x111415[_0x1114('0x17')]['where']||null:null,'attributes':_0x111415['options']?_0x111415[_0x1114('0x17')]['attributes']||null:null,'include':_0x111415[_0x1114('0x17')]?_0x111415[_0x1114('0x17')]['include']?_['map'](_0x111415['options'][_0x1114('0x1c')],function(_0x26ff94){return{'model':db[_0x26ff94['model']],'as':_0x26ff94['as'],'attributes':_0x26ff94[_0x1114('0x1a')],'include':_0x26ff94[_0x1114('0x1c')]?_[_0x1114('0x1d')](_0x26ff94[_0x1114('0x1c')],function(_0x304827){return{'model':db[_0x304827[_0x1114('0x1e')]],'as':_0x304827['as'],'attributes':_0x304827[_0x1114('0x1a')],'include':_0x304827['include']?_[_0x1114('0x1d')](_0x304827[_0x1114('0x1c')],function(_0x524543){return{'model':db[_0x524543[_0x1114('0x1e')]],'as':_0x524543['as'],'attributes':_0x524543['attributes']};}):[]};}):[]};}):[]:[]})[_0x1114('0x8')](function(_0x463c96){logger[_0x1114('0x9')](_0x1114('0x1f'),_0x111415);logger[_0x1114('0xb')]('ShowTrunk',_0x111415,JSON[_0x1114('0xe')](_0x463c96));_0x1d569f(_0x463c96);})[_0x1114('0x13')](function(_0x26ca9a){logger['error'](_0x1114('0x1f'),_0x26ca9a[_0x1114('0x11')],_0x111415);_0x2285ea(_0x2d8fc7[_0x1114('0xf')](0x1f4,_0x26ca9a[_0x1114('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index b4f836b..404640b 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 _0xe0f7=['Router','put','/:id','update','exports'];(function(_0x19ef32,_0x3b78ff){var _0x20034e=function(_0x3eb2d9){while(--_0x3eb2d9){_0x19ef32['push'](_0x19ef32['shift']());}};_0x20034e(++_0x3b78ff);}(_0xe0f7,0x1a9));var _0x7e0f=function(_0x2f3028,_0x1552ab){_0x2f3028=_0x2f3028-0x0;var _0x4693f8=_0xe0f7[_0x2f3028];return _0x4693f8;};'use strict';var express=require('express');var router=express[_0x7e0f('0x0')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0x7e0f('0x1')](_0x7e0f('0x2'),auth['isAuthenticated'](),controller[_0x7e0f('0x3')]);module[_0x7e0f('0x4')]=router; \ No newline at end of file +var _0xa5c9=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa5c9,0x157));var _0x9a5c=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xa5c9[_0x587ba2];return _0x50ec73;};'use strict';var express=require(_0x9a5c('0x0'));var router=express[_0x9a5c('0x1')]();var auth=require(_0x9a5c('0x2'));var controller=require(_0x9a5c('0x3'));router[_0x9a5c('0x4')](_0x9a5c('0x5'),auth[_0x9a5c('0x6')](),controller[_0x9a5c('0x7')]);module[_0x9a5c('0x8')]=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 2c896e9..c2db25d 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 _0x75d3=['warning','info','debug','ENUM','BOOLEAN','DATE','INTEGER','sequelize','error'];(function(_0x1ed476,_0xf395ef){var _0x38d470=function(_0x253f37){while(--_0x253f37){_0x1ed476['push'](_0x1ed476['shift']());}};_0x38d470(++_0xf395ef);}(_0x75d3,0x97));var _0x375d=function(_0x33cc74,_0x2f90e8){_0x33cc74=_0x33cc74-0x0;var _0x261fe6=_0x75d3[_0x33cc74];return _0x261fe6;};'use strict';var Sequelize=require(_0x375d('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x375d('0x1'),_0x375d('0x2'),_0x375d('0x3'),_0x375d('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x375d('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x375d('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x375d('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x375d('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x375d('0x8')],'unique':'UserId'}}; \ No newline at end of file +var _0xd501=['exports','ENUM','BOOLEAN','TEXT','sequelize','error','warning','debug'];(function(_0x1a6e9f,_0x43903c){var _0x302958=function(_0x41c452){while(--_0x41c452){_0x1a6e9f['push'](_0x1a6e9f['shift']());}};_0x302958(++_0x43903c);}(_0xd501,0x174));var _0x1d50=function(_0x2c40a4,_0x13f7c7){_0x2c40a4=_0x2c40a4-0x0;var _0x2effc0=_0xd501[_0x2c40a4];return _0x2effc0;};'use strict';var Sequelize=require(_0x1d50('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x1d50('0x1'),_0x1d50('0x2'),'info',_0x1d50('0x3')];module[_0x1d50('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x1d50('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x1d50('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x1d50('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 51f8f3a..e931088 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 _0x5645=['redis','./user-setting.socket','register','defaults','localhost','status','json','update','sendStatus','error','stack','name','send','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','then','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter'];(function(_0x4bde50,_0x4213dd){var _0x732af1=function(_0x5097de){while(--_0x5097de){_0x4bde50['push'](_0x4bde50['shift']());}};_0x732af1(++_0x4213dd);}(_0x5645,0x19e));var _0x5564=function(_0x63885,_0x5d0a2e){_0x63885=_0x63885-0x0;var _0x4eba18=_0x5645[_0x63885];return _0x4eba18;};'use strict';var _=require(_0x5564('0x0'));var Redis=require(_0x5564('0x1'));var logger=require(_0x5564('0x2'))(_0x5564('0x3'));var config=require(_0x5564('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x5564('0x5'))(new Redis(config[_0x5564('0x6')]));require(_0x5564('0x7'))[_0x5564('0x8')](socket);config[_0x5564('0x6')]=_[_0x5564('0x9')](config[_0x5564('0x6')],{'host':_0x5564('0xa'),'port':0x18eb});function respondWithResult(_0x372fb5,_0x49567f){_0x49567f=_0x49567f||0xc8;return function(_0x49be4e){if(_0x49be4e){return _0x372fb5[_0x5564('0xb')](_0x49567f)[_0x5564('0xc')](_0x49be4e);}};}function saveUpdates(_0x12778a){return function(_0x180900){if(_0x180900){return _0x180900[_0x5564('0xd')](_0x12778a)['then'](function(_0x1ba45a){return _0x1ba45a;});}return null;};}function handleEntityNotFound(_0x7d0bd5){return function(_0x5ca56f){if(!_0x5ca56f){_0x7d0bd5[_0x5564('0xe')](0x194);}return _0x5ca56f;};}function handleError(_0x1e63ca,_0x1c124a){_0x1c124a=_0x1c124a||0x1f4;return function(_0x1f5bb5){logger[_0x5564('0xf')](_0x1f5bb5[_0x5564('0x10')]);if(_0x1f5bb5[_0x5564('0x11')]){delete _0x1f5bb5[_0x5564('0x11')];}_0x1e63ca['status'](_0x1c124a)[_0x5564('0x12')](_0x1f5bb5);};}exports['update']=function(_0x423074,_0x10185f){if(_0x423074['user'][_0x5564('0x13')]!==_0x5564('0x14'))throw new Error(_0x5564('0x15'));if(isNaN(Number(_0x423074[_0x5564('0x16')]['id'])))throw new Error(_0x5564('0x17'));return db[_0x5564('0x18')]['find']({'where':{'id':_0x423074[_0x5564('0x16')]['id']}})[_0x5564('0x19')](handleEntityNotFound(_0x10185f,null))[_0x5564('0x19')](saveUpdates(_0x423074[_0x5564('0x1a')],null))['then'](respondWithResult(_0x10185f,null))[_0x5564('0x1b')](handleError(_0x10185f,null));}; \ No newline at end of file +var _0x5900=['register','defaults','redis','status','json','update','then','stack','name','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket'];(function(_0x3b5071,_0x5e7e6f){var _0x1ea3f3=function(_0x2192b2){while(--_0x2192b2){_0x3b5071['push'](_0x3b5071['shift']());}};_0x1ea3f3(++_0x5e7e6f);}(_0x5900,0xd2));var _0x0590=function(_0xdee30,_0x41b7b5){_0xdee30=_0xdee30-0x0;var _0x4b95ee=_0x5900[_0xdee30];return _0x4b95ee;};'use strict';var _=require('lodash');var Redis=require(_0x0590('0x0'));var logger=require(_0x0590('0x1'))('api');var config=require(_0x0590('0x2'));var db=require(_0x0590('0x3'))['db'];var socket=require(_0x0590('0x4'))(new Redis(config['redis']));require(_0x0590('0x5'))[_0x0590('0x6')](socket);config['redis']=_[_0x0590('0x7')](config[_0x0590('0x8')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x469e15,_0x2d5b51){_0x2d5b51=_0x2d5b51||0xc8;return function(_0x149322){if(_0x149322){return _0x469e15[_0x0590('0x9')](_0x2d5b51)[_0x0590('0xa')](_0x149322);}};}function saveUpdates(_0x1025bf){return function(_0x1c626a){if(_0x1c626a){return _0x1c626a[_0x0590('0xb')](_0x1025bf)[_0x0590('0xc')](function(_0x5cffbc){return _0x5cffbc;});}return null;};}function handleEntityNotFound(_0x354ef5){return function(_0x42bfba){if(!_0x42bfba){_0x354ef5['sendStatus'](0x194);}return _0x42bfba;};}function handleError(_0x138516,_0x392dad){_0x392dad=_0x392dad||0x1f4;return function(_0x4ef139){logger['error'](_0x4ef139[_0x0590('0xd')]);if(_0x4ef139['name']){delete _0x4ef139[_0x0590('0xe')];}_0x138516[_0x0590('0x9')](_0x392dad)[_0x0590('0xf')](_0x4ef139);};}exports[_0x0590('0xb')]=function(_0x15d0a3,_0x491f24){if(_0x15d0a3[_0x0590('0x10')][_0x0590('0x11')]!=='admin')throw new Error(_0x0590('0x12'));if(isNaN(Number(_0x15d0a3[_0x0590('0x13')]['id'])))throw new Error(_0x0590('0x14'));return db['UserSetting'][_0x0590('0x15')]({'where':{'id':_0x15d0a3['params']['id']}})[_0x0590('0xc')](handleEntityNotFound(_0x491f24,null))[_0x0590('0xc')](saveUpdates(_0x15d0a3[_0x0590('0x16')],null))[_0x0590('0xc')](respondWithResult(_0x491f24,null))[_0x0590('0x17')](handleError(_0x491f24,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 e6b4596..9d4715b 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 _0x3961=['hook','exports','events','../../mysqldb','UserSetting','save','update','remove','emit'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3961,0x1d6));var _0x1396=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x3961[_0x44afa4];return _0xcad289;};'use strict';var EventEmitter=require(_0x1396('0x0'));var UserSetting=require(_0x1396('0x1'))['db'][_0x1396('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1396('0x3'),'afterUpdate':_0x1396('0x4'),'afterDestroy':_0x1396('0x5')};function emitEvent(_0x31f3a4){return function(_0x38f65a,_0x155863,_0x4f1a6b){UserSettingEvents['emit'](_0x31f3a4+':'+_0x38f65a['id'],_0x38f65a);UserSettingEvents[_0x1396('0x6')](_0x31f3a4,_0x38f65a);_0x4f1a6b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x1396('0x7')](e,emitEvent(event));}}module[_0x1396('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x839e=['exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x312535,_0x134f0c){var _0x70248a=function(_0x4190ee){while(--_0x4190ee){_0x312535['push'](_0x312535['shift']());}};_0x70248a(++_0x134f0c);}(_0x839e,0x106));var _0xe839=function(_0x190b37,_0x386197){_0x190b37=_0x190b37-0x0;var _0x4e7eb7=_0x839e[_0x190b37];return _0x4e7eb7;};'use strict';var EventEmitter=require(_0xe839('0x0'));var UserSetting=require(_0xe839('0x1'))['db'][_0xe839('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe839('0x3')](0x0);var events={'afterCreate':_0xe839('0x4'),'afterUpdate':_0xe839('0x5'),'afterDestroy':_0xe839('0x6')};function emitEvent(_0x4f877d){return function(_0x401257,_0x20f0fc,_0x4150a1){UserSettingEvents['emit'](_0x4f877d+':'+_0x401257['id'],_0x401257);UserSettingEvents[_0xe839('0x7')](_0x4f877d,_0x401257);_0x4150a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xe839('0x8')]=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 6fa7658..7fa873b 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 _0xce3a=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x2b98d4,_0x1de753){var _0x76ce5b=function(_0x5bfe11){while(--_0x5bfe11){_0x2b98d4['push'](_0x2b98d4['shift']());}};_0x76ce5b(++_0x1de753);}(_0xce3a,0x194));var _0xace3=function(_0x527636,_0x157965){_0x527636=_0x527636-0x0;var _0x5abe4b=_0xce3a[_0x527636];return _0x5abe4b;};'use strict';var attributes=require(_0xace3('0x0'));module[_0xace3('0x1')]=function(_0x3ecaa1){return _0x3ecaa1[_0xace3('0x2')](_0xace3('0x3'),attributes,{'tableName':_0xace3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f1865){if(!_0x1f1865[_0xace3('0x5')])_0x1f1865[_0xace3('0x6')]=null;else if(_0x1f1865[_0xace3('0x6')]===null)_0x1f1865[_0xace3('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x2b65=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x593d14,_0x1d0a36){var _0x2f9cc4=function(_0x66635b){while(--_0x66635b){_0x593d14['push'](_0x593d14['shift']());}};_0x2f9cc4(++_0x1d0a36);}(_0x2b65,0x131));var _0x52b6=function(_0x3d8502,_0x5b23b4){_0x3d8502=_0x3d8502-0x0;var _0x2e8073=_0x2b65[_0x3d8502];return _0x2e8073;};'use strict';var attributes=require(_0x52b6('0x0'));module[_0x52b6('0x1')]=function(_0x9b1a2c){return _0x9b1a2c[_0x52b6('0x2')](_0x52b6('0x3'),attributes,{'tableName':_0x52b6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x141913){if(!_0x141913[_0x52b6('0x5')])_0x141913['clientSideLoggingEnabledSince']=null;else if(_0x141913[_0x52b6('0x6')]===null)_0x141913[_0x52b6('0x6')]=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 e4061d4..5d9c8a3 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 _0xf50f=['user-setting:update:user-','register','length','user-setting:','./user-setting.events','save','remove','emit'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xf50f,0x84));var _0xff50=function(_0x2866fe,_0x28d070){_0x2866fe=_0x2866fe-0x0;var _0x4271e9=_0xf50f[_0x2866fe];return _0x4271e9;};'use strict';var UserSettingEvents=require(_0xff50('0x0'));var events=[_0xff50('0x1'),_0xff50('0x2'),'update'];function createListener(_0x3474f4,_0x3af943){return function(_0x310d44){_0x3af943[_0xff50('0x3')](_0x3474f4,_0x310d44);if(_0x3474f4==='user-setting:update'){_0x3af943[_0xff50('0x3')](_0xff50('0x4')+_0x310d44['UserId'],_0x310d44);}};}exports[_0xff50('0x5')]=function(_0x241875){for(var _0x30c23f=0x0,_0x2532aa=events[_0xff50('0x6')];_0x30c23f<_0x2532aa;_0x30c23f++){var _0x4f8998=events[_0x30c23f];var _0x37ead4=createListener(_0xff50('0x7')+_0x4f8998,_0x241875);UserSettingEvents['on'](_0x4f8998,_0x37ead4);}}; \ No newline at end of file +var _0x132c=['remove','update','emit','user-setting:update','user-setting:update:user-','UserId','length','user-setting:','./user-setting.events','save'];(function(_0x23807f,_0x3c5892){var _0x5351a7=function(_0x38a5e5){while(--_0x38a5e5){_0x23807f['push'](_0x23807f['shift']());}};_0x5351a7(++_0x3c5892);}(_0x132c,0x1ac));var _0xc132=function(_0x4e5ab6,_0x575ae6){_0x4e5ab6=_0x4e5ab6-0x0;var _0x3defad=_0x132c[_0x4e5ab6];return _0x3defad;};'use strict';var UserSettingEvents=require(_0xc132('0x0'));var events=[_0xc132('0x1'),_0xc132('0x2'),_0xc132('0x3')];function createListener(_0x5ae45b,_0x109ee2){return function(_0x15b80d){_0x109ee2[_0xc132('0x4')](_0x5ae45b,_0x15b80d);if(_0x5ae45b===_0xc132('0x5')){_0x109ee2[_0xc132('0x4')](_0xc132('0x6')+_0x15b80d[_0xc132('0x7')],_0x15b80d);}};}exports['register']=function(_0x539269){for(var _0x42870a=0x0,_0x704d8e=events[_0xc132('0x8')];_0x42870a<_0x704d8e;_0x42870a++){var _0x5b1a0e=events[_0x42870a];var _0x2c5ba8=createListener(_0xc132('0x9')+_0x5b1a0e,_0x539269);UserSettingEvents['on'](_0x5b1a0e,_0x2c5ba8);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 850da8a..487a99d 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 _0xc759=['logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout'];(function(_0x5e8130,_0x40e714){var _0x679567=function(_0x3cb3dd){while(--_0x3cb3dd){_0x5e8130['push'](_0x5e8130['shift']());}};_0x679567(++_0x40e714);}(_0xc759,0xa0));var _0x9c75=function(_0x5322de,_0x138180){_0x5322de=_0x5322de-0x0;var _0x55fd0c=_0xc759[_0x5322de];return _0x55fd0c;};'use strict';var multer=require('multer');var util=require(_0x9c75('0x0'));var path=require(_0x9c75('0x1'));var timeout=require(_0x9c75('0x2'));var express=require(_0x9c75('0x3'));var router=express['Router']();var fs_extra=require(_0x9c75('0x4'));var auth=require(_0x9c75('0x5'));var interaction=require(_0x9c75('0x6'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0x9c75('0x7')]('/',auth[_0x9c75('0x8')](),controller['index']);router[_0x9c75('0x7')](_0x9c75('0x9'),auth[_0x9c75('0x8')](),controller['describe']);router[_0x9c75('0x7')](_0x9c75('0xa'),auth[_0x9c75('0x8')](),controller['whoami']);router[_0x9c75('0x7')](_0x9c75('0xb'),auth[_0x9c75('0x8')](),controller['getPresence']);router[_0x9c75('0x7')](_0x9c75('0xc'),auth[_0x9c75('0x8')](),controller[_0x9c75('0xd')]);router[_0x9c75('0x7')](_0x9c75('0xe'),controller[_0x9c75('0xf')]);router[_0x9c75('0x7')](_0x9c75('0x10'),auth['isAuthenticated'](),controller[_0x9c75('0x11')]);router[_0x9c75('0x7')](_0x9c75('0x12'),auth['isAuthenticated'](),controller[_0x9c75('0x13')]);router[_0x9c75('0x7')]('/:id/queues',auth[_0x9c75('0x8')](),controller[_0x9c75('0x14')]);router[_0x9c75('0x7')](_0x9c75('0x15'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x16')]);router[_0x9c75('0x7')](_0x9c75('0x17'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x18')]);router['get'](_0x9c75('0x19'),auth[_0x9c75('0x8')](),controller['getRecordings']);router['get'](_0x9c75('0x1a'),auth['isAuthenticated'](),controller[_0x9c75('0x1b')]);router[_0x9c75('0x7')](_0x9c75('0x1c'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x1d')]);router[_0x9c75('0x7')](_0x9c75('0x1e'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x1f')]);router['get'](_0x9c75('0x20'),auth[_0x9c75('0x8')](),controller['getMailInteractions']);router[_0x9c75('0x7')]('/:id/sms/interactions',auth[_0x9c75('0x8')](),controller['getSmsInteractions']);router[_0x9c75('0x7')]('/:id/fax/interactions',auth[_0x9c75('0x8')](),controller['getFaxInteractions']);router[_0x9c75('0x7')](_0x9c75('0x21'),auth['isAuthenticated'](),controller[_0x9c75('0x22')]);router[_0x9c75('0x7')]('/:id/teams',auth[_0x9c75('0x8')](),controller[_0x9c75('0x23')]);router[_0x9c75('0x7')](_0x9c75('0x24'),auth['isAuthenticated'](),controller['getLists']);router[_0x9c75('0x7')](_0x9c75('0x25'),auth[_0x9c75('0x8')](),controller['getAgents']);router['get'](_0x9c75('0x26'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x27')]);router['get'](_0x9c75('0x28'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x29')]);router[_0x9c75('0x7')](_0x9c75('0x2a'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x2b')]);router[_0x9c75('0x7')](_0x9c75('0x2c'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x2d')]);router[_0x9c75('0x7')](_0x9c75('0x2e'),auth['isAuthenticated'](),controller[_0x9c75('0x2f')]);router[_0x9c75('0x7')](_0x9c75('0x30'),auth['isAuthenticated'](),controller[_0x9c75('0x31')]);router[_0x9c75('0x7')](_0x9c75('0x32'),auth[_0x9c75('0x8')](),controller['getWhatsappAccounts']);router[_0x9c75('0x7')](_0x9c75('0x33'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x34')]);router[_0x9c75('0x7')](_0x9c75('0x35'),auth['isAuthenticated'](),controller[_0x9c75('0x36')]);router[_0x9c75('0x37')](_0x9c75('0x12'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x38')]);router[_0x9c75('0x37')]('/',auth[_0x9c75('0x8')](),controller[_0x9c75('0x39')]);router[_0x9c75('0x37')](_0x9c75('0x3a'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x3b')]);router[_0x9c75('0x37')](_0x9c75('0x3c'),auth['isAuthenticated'](),controller[_0x9c75('0x3d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x242b36,_0x31442b,_0x5992d7){_0x5992d7(null,path[_0x9c75('0x3e')](config[_0x9c75('0x3f')],_0x9c75('0x40')));},'filename':function(_0xf794d2,_0x2c101b,_0x6c5649){_0x6c5649(null,util[_0x9c75('0x41')](_0x9c75('0x42'),Date[_0x9c75('0x43')](),_0x2c101b[_0x9c75('0x44')]));}})});router['post']('/:id/avatar',upload[_0x9c75('0x45')](_0x9c75('0x46')),controller[_0x9c75('0x47')]);router[_0x9c75('0x37')]('/:id/login',auth[_0x9c75('0x8')](),controller[_0x9c75('0x48')]);router[_0x9c75('0x37')](_0x9c75('0x49'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x4a')]);router['post'](_0x9c75('0x4b'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x4c')]);router[_0x9c75('0x37')](_0x9c75('0x4d'),auth[_0x9c75('0x8')](),controller['unpause']);router[_0x9c75('0x37')](_0x9c75('0x4e'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x4f')]);router[_0x9c75('0x37')](_0x9c75('0x50'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x51')]);router[_0x9c75('0x37')](_0x9c75('0x52'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x53')]);router[_0x9c75('0x37')](_0x9c75('0x54'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x55')]);router['post'](_0x9c75('0x56'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x57')]);router[_0x9c75('0x37')](_0x9c75('0x58'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x59')]);router['post']('/:id/whatsapp_interactions',auth[_0x9c75('0x8')](),controller[_0x9c75('0x5a')]);router[_0x9c75('0x37')](_0x9c75('0x28'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x5b')]);router[_0x9c75('0x37')](_0x9c75('0x2a'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x9c75('0x37')](_0x9c75('0x2c'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x5c')]);router['post'](_0x9c75('0x2e'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x5d')]);router['post'](_0x9c75('0x30'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x5e')]);router[_0x9c75('0x37')]('/:id/whatsapp_accounts',auth[_0x9c75('0x8')](),controller[_0x9c75('0x5f')]);router[_0x9c75('0x37')](_0x9c75('0x35'),auth[_0x9c75('0x8')](),controller['createApiKey']);router['put']('/:id',auth[_0x9c75('0x8')](),controller[_0x9c75('0x60')]);router[_0x9c75('0x61')](_0x9c75('0x62'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x63')]);router[_0x9c75('0x64')](_0x9c75('0x3c'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x65')]);router[_0x9c75('0x64')](_0x9c75('0x4e'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x66')]);router[_0x9c75('0x64')](_0x9c75('0xc'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x67')]);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x9c75('0x64')](_0x9c75('0x52'),auth[_0x9c75('0x8')](),controller['removeMailInteractions']);router[_0x9c75('0x64')](_0x9c75('0x54'),auth[_0x9c75('0x8')](),controller['removeFaxInteractions']);router[_0x9c75('0x64')](_0x9c75('0x56'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x68')]);router[_0x9c75('0x64')]('/:id/openchannel_interactions',auth[_0x9c75('0x8')](),controller[_0x9c75('0x69')]);router[_0x9c75('0x64')](_0x9c75('0x6a'),auth[_0x9c75('0x8')](),controller['removeWhatsappInteractions']);router['delete'](_0x9c75('0x28'),auth['isAuthenticated'](),controller[_0x9c75('0x6b')]);router['delete'](_0x9c75('0x2a'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x6c')]);router[_0x9c75('0x64')](_0x9c75('0x2c'),auth['isAuthenticated'](),controller[_0x9c75('0x6d')]);router[_0x9c75('0x64')](_0x9c75('0x2e'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x6e')]);router[_0x9c75('0x64')](_0x9c75('0x30'),auth['isAuthenticated'](),controller[_0x9c75('0x6f')]);router[_0x9c75('0x64')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x9c75('0x70')]);router['delete'](_0x9c75('0x35'),auth['isAuthenticated'](),controller[_0x9c75('0x71')]);router[_0x9c75('0x37')](_0x9c75('0x72'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x73')]);module[_0x9c75('0x74')]=router; \ No newline at end of file +var _0x0966=['server/files/images/','format','%s-%s','now','originalname','single','addAvatar','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','createApiKey','update','put','changePassword','delete','removeQueues','removeTeams','/:id','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','get','/describe','/presence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','addQueues','join'];(function(_0x5db6aa,_0x31d269){var _0x3a8a1a=function(_0x34549c){while(--_0x34549c){_0x5db6aa['push'](_0x5db6aa['shift']());}};_0x3a8a1a(++_0x31d269);}(_0x0966,0x9d));var _0x6096=function(_0x234ea1,_0x4f3e4){_0x234ea1=_0x234ea1-0x0;var _0x42701a=_0x0966[_0x234ea1];return _0x42701a;};'use strict';var multer=require(_0x6096('0x0'));var util=require(_0x6096('0x1'));var path=require('path');var timeout=require(_0x6096('0x2'));var express=require('express');var router=express[_0x6096('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6096('0x4'));var interaction=require(_0x6096('0x5'));var config=require(_0x6096('0x6'));var controller=require(_0x6096('0x7'));router['get']('/',auth[_0x6096('0x8')](),controller['index']);router[_0x6096('0x9')](_0x6096('0xa'),auth[_0x6096('0x8')](),controller['describe']);router[_0x6096('0x9')]('/whoami',auth[_0x6096('0x8')](),controller['whoami']);router['get'](_0x6096('0xb'),auth[_0x6096('0x8')](),controller['getPresence']);router['get']('/:id',auth[_0x6096('0x8')](),controller[_0x6096('0xc')]);router['get'](_0x6096('0xd'),controller['getAvatar']);router[_0x6096('0x9')](_0x6096('0xe'),auth[_0x6096('0x8')](),controller[_0x6096('0xf')]);router[_0x6096('0x9')](_0x6096('0x10'),auth['isAuthenticated'](),controller[_0x6096('0x11')]);router[_0x6096('0x9')](_0x6096('0x12'),auth[_0x6096('0x8')](),controller[_0x6096('0x13')]);router['get']('/:id/queues_rt',auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x6096('0x9')]('/:id/groups',auth[_0x6096('0x8')](),controller[_0x6096('0x14')]);router[_0x6096('0x9')](_0x6096('0x15'),auth[_0x6096('0x8')](),controller[_0x6096('0x16')]);router[_0x6096('0x9')](_0x6096('0x17'),auth[_0x6096('0x8')](),controller[_0x6096('0x18')]);router[_0x6096('0x9')]('/:id/chat/interactions',auth[_0x6096('0x8')](),controller[_0x6096('0x19')]);router[_0x6096('0x9')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x6096('0x1a')]);router[_0x6096('0x9')](_0x6096('0x1b'),auth['isAuthenticated'](),controller[_0x6096('0x1c')]);router[_0x6096('0x9')]('/:id/sms/interactions',auth[_0x6096('0x8')](),controller[_0x6096('0x1d')]);router['get']('/:id/fax/interactions',auth[_0x6096('0x8')](),controller['getFaxInteractions']);router['get'](_0x6096('0x1e'),auth[_0x6096('0x8')](),controller[_0x6096('0x1f')]);router[_0x6096('0x9')](_0x6096('0x20'),auth[_0x6096('0x8')](),controller[_0x6096('0x21')]);router[_0x6096('0x9')](_0x6096('0x22'),auth['isAuthenticated'](),controller[_0x6096('0x23')]);router[_0x6096('0x9')](_0x6096('0x24'),auth[_0x6096('0x8')](),controller[_0x6096('0x25')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0x6096('0x26')]);router[_0x6096('0x9')](_0x6096('0x27'),auth[_0x6096('0x8')](),controller[_0x6096('0x28')]);router[_0x6096('0x9')](_0x6096('0x29'),auth[_0x6096('0x8')](),controller[_0x6096('0x2a')]);router[_0x6096('0x9')](_0x6096('0x2b'),auth[_0x6096('0x8')](),controller[_0x6096('0x2c')]);router[_0x6096('0x9')](_0x6096('0x2d'),auth[_0x6096('0x8')](),controller[_0x6096('0x2e')]);router[_0x6096('0x9')](_0x6096('0x2f'),auth['isAuthenticated'](),controller[_0x6096('0x30')]);router['get'](_0x6096('0x31'),auth[_0x6096('0x8')](),controller['getWhatsappAccounts']);router[_0x6096('0x9')]('/:id/scheduled_calls',auth[_0x6096('0x8')](),controller[_0x6096('0x32')]);router[_0x6096('0x9')](_0x6096('0x33'),auth['isAuthenticated'](),controller[_0x6096('0x34')]);router[_0x6096('0x35')](_0x6096('0x10'),auth[_0x6096('0x8')](),controller[_0x6096('0x36')]);router[_0x6096('0x35')]('/',auth[_0x6096('0x8')](),controller['create']);router[_0x6096('0x35')](_0x6096('0x37'),auth[_0x6096('0x8')](),controller[_0x6096('0x38')]);router[_0x6096('0x35')](_0x6096('0x12'),auth[_0x6096('0x8')](),controller[_0x6096('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x520fd6,_0x19cfc3,_0x39a331){_0x39a331(null,path[_0x6096('0x3a')](config['root'],_0x6096('0x3b')));},'filename':function(_0x1ea7f4,_0x59cf32,_0x225ff1){_0x225ff1(null,util[_0x6096('0x3c')](_0x6096('0x3d'),Date[_0x6096('0x3e')](),_0x59cf32[_0x6096('0x3f')]));}})});router[_0x6096('0x35')]('/:id/avatar',upload[_0x6096('0x40')]('file'),controller[_0x6096('0x41')]);router['post']('/:id/login',auth[_0x6096('0x8')](),controller[_0x6096('0x42')]);router[_0x6096('0x35')](_0x6096('0x43'),auth[_0x6096('0x8')](),controller[_0x6096('0x44')]);router[_0x6096('0x35')](_0x6096('0x45'),auth[_0x6096('0x8')](),controller[_0x6096('0x46')]);router['post']('/:id/unpause',auth[_0x6096('0x8')](),controller[_0x6096('0x47')]);router[_0x6096('0x35')]('/:id/teams',auth[_0x6096('0x8')](),controller[_0x6096('0x48')]);router[_0x6096('0x35')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x6096('0x49')]);router[_0x6096('0x35')](_0x6096('0x4a'),auth[_0x6096('0x8')](),controller['addMailInteractions']);router[_0x6096('0x35')](_0x6096('0x4b'),auth[_0x6096('0x8')](),controller[_0x6096('0x4c')]);router[_0x6096('0x35')](_0x6096('0x4d'),auth[_0x6096('0x8')](),controller[_0x6096('0x4e')]);router[_0x6096('0x35')](_0x6096('0x4f'),auth['isAuthenticated'](),controller[_0x6096('0x50')]);router['post'](_0x6096('0x51'),auth[_0x6096('0x8')](),controller['addWhatsappInteractions']);router[_0x6096('0x35')]('/:id/fax_accounts',auth[_0x6096('0x8')](),controller[_0x6096('0x52')]);router[_0x6096('0x35')]('/:id/mail_accounts',auth[_0x6096('0x8')](),controller[_0x6096('0x53')]);router[_0x6096('0x35')](_0x6096('0x2b'),auth[_0x6096('0x8')](),controller['addOpenchannelAccounts']);router[_0x6096('0x35')]('/:id/sms_accounts',auth[_0x6096('0x8')](),controller[_0x6096('0x54')]);router[_0x6096('0x35')]('/:id/chat_websites',auth[_0x6096('0x8')](),controller[_0x6096('0x55')]);router[_0x6096('0x35')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x6096('0x35')](_0x6096('0x33'),auth[_0x6096('0x8')](),controller[_0x6096('0x56')]);router['put']('/:id',auth[_0x6096('0x8')](),controller[_0x6096('0x57')]);router[_0x6096('0x58')]('/:id/password',auth[_0x6096('0x8')](),controller[_0x6096('0x59')]);router[_0x6096('0x5a')](_0x6096('0x12'),auth['isAuthenticated'](),controller[_0x6096('0x5b')]);router[_0x6096('0x5a')](_0x6096('0x20'),auth[_0x6096('0x8')](),controller[_0x6096('0x5c')]);router[_0x6096('0x5a')](_0x6096('0x5d'),auth[_0x6096('0x8')](),controller['destroy']);router[_0x6096('0x5a')](_0x6096('0x5e'),auth[_0x6096('0x8')](),controller['removeChatInteractions']);router[_0x6096('0x5a')](_0x6096('0x4a'),auth[_0x6096('0x8')](),controller[_0x6096('0x5f')]);router['delete'](_0x6096('0x4b'),auth[_0x6096('0x8')](),controller[_0x6096('0x60')]);router[_0x6096('0x5a')](_0x6096('0x4d'),auth[_0x6096('0x8')](),controller[_0x6096('0x61')]);router[_0x6096('0x5a')](_0x6096('0x4f'),auth[_0x6096('0x8')](),controller[_0x6096('0x62')]);router['delete'](_0x6096('0x51'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router['delete'](_0x6096('0x27'),auth[_0x6096('0x8')](),controller[_0x6096('0x63')]);router['delete'](_0x6096('0x29'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x6096('0x5a')](_0x6096('0x2b'),auth[_0x6096('0x8')](),controller[_0x6096('0x64')]);router[_0x6096('0x5a')](_0x6096('0x2d'),auth['isAuthenticated'](),controller[_0x6096('0x65')]);router[_0x6096('0x5a')](_0x6096('0x2f'),auth[_0x6096('0x8')](),controller[_0x6096('0x66')]);router[_0x6096('0x5a')](_0x6096('0x31'),auth['isAuthenticated'](),controller[_0x6096('0x67')]);router[_0x6096('0x5a')](_0x6096('0x33'),auth[_0x6096('0x8')](),controller[_0x6096('0x68')]);router[_0x6096('0x35')](_0x6096('0x69'),auth[_0x6096('0x8')](),controller[_0x6096('0x6a')]);module[_0x6096('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 512090f..d9c328a 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 _0xdded=['dtlsprivatekey','rtcp_mux','icesupport','dtlsenable','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','sequelize','moment','util','lodash','STRING','name','setDataValue','fullname','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','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]','yes','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','isArray','udp','wss','encryption','avpf','force_avp','dtlsverify','dtlssetup','dtlscertfile'];(function(_0x59eef6,_0x120d63){var _0x3dc0f4=function(_0x1a898c){while(--_0x1a898c){_0x59eef6['push'](_0x59eef6['shift']());}};_0x3dc0f4(++_0x120d63);}(_0xdded,0x188));var _0xddde=function(_0x32fe4b,_0x5dde01){_0x32fe4b=_0x32fe4b-0x0;var _0x61c6e5=_0xdded[_0x32fe4b];return _0x61c6e5;};'use strict';var Sequelize=require(_0xddde('0x0'));var moment=require(_0xddde('0x1'));var util=require(_0xddde('0x2'));var _=require(_0xddde('0x3'));module['exports']={'name':{'type':Sequelize[_0xddde('0x4')],'allowNull':![],'unique':_0xddde('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4ffe41){this[_0xddde('0x6')](_0xddde('0x5'),_0x4ffe41);this['setDataValue']('defaultuser',_0x4ffe41);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56535a){this[_0xddde('0x6')](_0xddde('0x7'),_0x56535a);this[_0xddde('0x6')]('callerid',util[_0xddde('0x8')]('\x22%s\x22\x20<%s>',_0x56535a,this[_0xddde('0x9')](_0xddde('0xa'))));}},'alias':{'type':Sequelize[_0xddde('0x4')]},'email':{'type':Sequelize[_0xddde('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x532487){if(_0x532487){this[_0xddde('0x6')](_0xddde('0xb'),_0x532487[_0xddde('0xc')]());}}},'role':{'type':Sequelize[_0xddde('0xd')](_0xddde('0xe'),_0xddde('0xf'),_0xddde('0x10'),_0xddde('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0xddde('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xddde('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':![],'unique':_0xddde('0xa'),'set':function(_0x5d31eb){this[_0xddde('0x6')](_0xddde('0xa'),_0x5d31eb);this[_0xddde('0x6')](_0xddde('0x13'),_0x5d31eb);this[_0xddde('0x6')]('callerid',util['format']('\x22%s\x22\x20<%s>',this['getDataValue'](_0xddde('0x7')),_0x5d31eb));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xddde('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xddde('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xddde('0x4')]},'city':{'type':Sequelize[_0xddde('0x4')]},'country':{'type':Sequelize[_0xddde('0x4')]},'online':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xddde('0x15')]},'voicePause':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xddde('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xddde('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xddde('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xddde('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xddde('0xd')]('friend',_0xddde('0xf'),_0xddde('0x16')),'allowNull':!![],'defaultValue':_0xddde('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xddde('0x18')},'callingpres':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x19'),_0xddde('0x1a'),_0xddde('0x1b'),_0xddde('0x1c'),_0xddde('0x1d'),_0xddde('0x1e'),_0xddde('0x1f'),_0xddde('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3b70fd){this[_0xddde('0x6')](_0xddde('0x21'),_0x3b70fd?_0x3b70fd[_0xddde('0x22')](','):null);},'get':function(){return this[_0xddde('0x9')]('transport')?this[_0xddde('0x9')](_0xddde('0x21'))[_0xddde('0x23')](','):null;},'comment':_0xddde('0x24')},'dtmfmode':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x25'),_0xddde('0x26'),_0xddde('0x27'),_0xddde('0x28'),_0xddde('0x29')),'allowNull':!![],'defaultValue':_0xddde('0x25')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xddde('0x2a'),_0xddde('0x2b'),_0xddde('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x171df4){this[_0xddde('0x6')](_0xddde('0x2d'),_0x171df4?_0x171df4['join'](','):null);},'get':function(){return this[_0xddde('0x9')]('nat')?this[_0xddde('0x9')]('nat')[_0xddde('0x23')](','):null;},'comment':_0xddde('0x2e')},'callgroup':{'type':Sequelize[_0xddde('0x4')]},'namedcallgroup':{'type':Sequelize[_0xddde('0x4')]},'pickupgroup':{'type':Sequelize[_0xddde('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xddde('0x4')]},'language':{'type':Sequelize[_0xddde('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xddde('0x4')]},'disallow':{'type':Sequelize[_0xddde('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xddde('0x4')],'allowNull':![],'defaultValue':_0xddde('0x2f'),'set':function(_0x4b36e2){this[_0xddde('0x6')](_0xddde('0x30'),_0x4b36e2?_0x4b36e2[_0xddde('0x22')](';'):_0xddde('0x2f'));},'get':function(){return this['getDataValue'](_0xddde('0x30'))?this['getDataValue'](_0xddde('0x30'))['split'](';'):null;},'comment':_0xddde('0x31')},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x360587){this[_0xddde('0x6')](_0xddde('0x32'),_0x360587?_0x360587['join'](','):null);},'get':function(){return this[_0xddde('0x9')](_0xddde('0x32'))?this['getDataValue'](_0xddde('0x32'))[_0xddde('0x23')](','):null;},'comment':_0xddde('0x33')},'trustrpid':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no',_0xddde('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xddde('0x34'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![],'defaultValue':_0xddde('0x36')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':_0xddde('0x34')},'busylevel':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no',_0xddde('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xddde('0xd')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xddde('0x38'),_0xddde('0x39'),_0xddde('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x3b'),_0xddde('0x3c')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':_0xddde('0x34')},'keepalive':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xddde('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xddde('0x34'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xddde('0xd')]('yes','no',_0xddde('0x3d'),_0xddde('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x3f'),_0xddde('0x40'),_0xddde('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xddde('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xddde('0x34'),'no',_0xddde('0x2a'),'update',_0xddde('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xddde('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xddde('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0,'set':function(_0x20c679){this[_0xddde('0x6')](_0xddde('0x43'),_0x20c679);var _0xe056d1=this[_0xddde('0x44')]({'plain':!![]});switch(_0x20c679){case 0x0:case 0x1:var _0x329a00=_0xe056d1[_0xddde('0x21')]?_[_0xddde('0x45')](_0xe056d1['transport'])?_0xe056d1[_0xddde('0x21')][_0xddde('0x22')]():_0xe056d1['transport']:_0xddde('0x46');if(_0x329a00===_0xddde('0x47')){_0x329a00=_0xddde('0x46');}this[_0xddde('0x6')](_0xddde('0x21'),_0x329a00);this[_0xddde('0x6')](_0xddde('0x48'),'no');this['setDataValue'](_0xddde('0x49'),null);this[_0xddde('0x6')](_0xddde('0x4a'),null);this[_0xddde('0x6')]('icesupport',null);this[_0xddde('0x6')]('dtlsenable',null);this['setDataValue'](_0xddde('0x4b'),null);this[_0xddde('0x6')](_0xddde('0x4c'),null);this[_0xddde('0x6')](_0xddde('0x4d'),null);this[_0xddde('0x6')](_0xddde('0x4e'),null);this[_0xddde('0x6')](_0xddde('0x4f'),'no');break;case 0x2:this[_0xddde('0x6')](_0xddde('0x21'),_0xddde('0x47'));this['setDataValue']('encryption',_0xddde('0x34'));this[_0xddde('0x6')](_0xddde('0x49'),_0xddde('0x34'));this[_0xddde('0x6')]('force_avp',_0xddde('0x34'));this[_0xddde('0x6')](_0xddde('0x50'),'yes');this[_0xddde('0x6')](_0xddde('0x51'),'yes');this['setDataValue']('dtlsverify','no');this[_0xddde('0x6')](_0xddde('0x4c'),_0xddde('0x41'));this[_0xddde('0x6')](_0xddde('0x4d'),_0xe056d1[_0xddde('0x4d')]||'/etc/pki/tls/certs/motion.crt');this[_0xddde('0x6')]('dtlsprivatekey',_0xe056d1[_0xddde('0x4e')]||_0xddde('0x52'));this[_0xddde('0x6')](_0xddde('0x4f'),_0xddde('0x34'));break;default:}}},'permissions':{'type':Sequelize[_0xddde('0x53')],'set':function(_0x23bc87){this[_0xddde('0x6')]('permissions',_0x23bc87?_0x23bc87[_0xddde('0x22')](','):[]);},'get':function(){return this['getDataValue'](_0xddde('0x54'))?_[_0xddde('0x55')](this[_0xddde('0x9')](_0xddde('0x54'))[_0xddde('0x23')](','),function(_0x5af63b){return parseInt(_0x5af63b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xddde('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xddde('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xddde('0xd')](_0xddde('0x34'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xddde('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xddde('0x56')],'get':function(){return this['getDataValue'](_0xddde('0x57'))?this[_0xddde('0x9')](_0xddde('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xddde('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xddde('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x2c41d1){if(typeof _0x2c41d1===_0xddde('0x58')){var _0x2accf5=_0x2c41d1==='1'?!![]:_0x2c41d1==='0'?![]:_0x2c41d1===_0xddde('0x59')?!![]:_0x2c41d1===_0xddde('0x5a')?![]:![];this[_0xddde('0x6')](_0xddde('0x5b'),_0x2accf5);}else{this[_0xddde('0x6')](_0xddde('0x5b'),_0x2c41d1);}}},'blocked':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![],'set':function(_0x4e8692){this['setDataValue'](_0xddde('0x5c'),_0x4e8692);if(_0x4e8692===!![]){this[_0xddde('0x6')]('blockedAt',moment());this[_0xddde('0x6')](_0xddde('0x5d'),0x0);}else{this[_0xddde('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xddde('0x12')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xddde('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xddde('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xddde('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xddde('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xddde('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0x2828=['outgoing','yes','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','passive','actpass','update','update,nonat','TEXT','showWebBar','wss','encryption','avpf','force_avp','dtlsverify','dtlssetup','icesupport','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','loginAttempts','blockedAt','sequelize','moment','exports','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','accountcode','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','nonat'];(function(_0x4040c4,_0x571bf1){var _0x489497=function(_0x2bd144){while(--_0x2bd144){_0x4040c4['push'](_0x4040c4['shift']());}};_0x489497(++_0x571bf1);}(_0x2828,0x85));var _0x8282=function(_0x4dfd8a,_0x476a02){_0x4dfd8a=_0x4dfd8a-0x0;var _0x5aeac9=_0x2828[_0x4dfd8a];return _0x5aeac9;};'use strict';var Sequelize=require(_0x8282('0x0'));var moment=require(_0x8282('0x1'));var util=require('util');var _=require('lodash');module[_0x8282('0x2')]={'name':{'type':Sequelize[_0x8282('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1de015){this[_0x8282('0x4')](_0x8282('0x5'),_0x1de015);this[_0x8282('0x4')]('defaultuser',_0x1de015);},'comment':_0x8282('0x6')},'fullname':{'type':Sequelize[_0x8282('0x3')],'allowNull':![],'set':function(_0x4f61d1){this[_0x8282('0x4')]('fullname',_0x4f61d1);this[_0x8282('0x4')](_0x8282('0x7'),util[_0x8282('0x8')](_0x8282('0x9'),_0x4f61d1,this[_0x8282('0xa')](_0x8282('0xb'))));}},'alias':{'type':Sequelize[_0x8282('0x3')]},'email':{'type':Sequelize[_0x8282('0x3')],'allowNull':![],'unique':_0x8282('0xc'),'validate':{'isEmail':!![]},'set':function(_0x1a69b8){if(_0x1a69b8){this['setDataValue'](_0x8282('0xc'),_0x1a69b8[_0x8282('0xd')]());}}},'role':{'type':Sequelize[_0x8282('0xe')](_0x8282('0xf'),'user',_0x8282('0x10'),_0x8282('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x8282('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x8282('0x3')],'defaultValue':_0x8282('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x57edb6){this[_0x8282('0x4')](_0x8282('0xb'),_0x57edb6);this[_0x8282('0x4')](_0x8282('0x13'),_0x57edb6);this[_0x8282('0x4')]('callerid',util[_0x8282('0x8')](_0x8282('0x9'),this[_0x8282('0xa')](_0x8282('0x14')),_0x57edb6));}},'salt':{'type':Sequelize[_0x8282('0x3')]},'phone':{'type':Sequelize[_0x8282('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x8282('0x3')]},'zipcode':{'type':Sequelize[_0x8282('0x3')]},'userpic':{'type':Sequelize[_0x8282('0x3')]},'city':{'type':Sequelize[_0x8282('0x3')]},'country':{'type':Sequelize[_0x8282('0x3')]},'online':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x8282('0x16')]},'voicePause':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8282('0x3')],'defaultValue':_0x8282('0x17')},'lastPauseAt':{'type':Sequelize[_0x8282('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8282('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8282('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![],'defaultValue':_0x8282('0x19')},'ipaddr':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x8282('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x1a'),'user',_0x8282('0x1b')),'allowNull':!![],'defaultValue':_0x8282('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8282('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x8282('0x1d'),_0x8282('0x1e'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x8282('0x1f'),_0x8282('0x20'),_0x8282('0x21'),_0x8282('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8282('0x23'),'set':function(_0x4e7a4b){this[_0x8282('0x4')](_0x8282('0x24'),_0x4e7a4b?_0x4e7a4b[_0x8282('0x25')](','):null);},'get':function(){return this[_0x8282('0xa')](_0x8282('0x24'))?this[_0x8282('0xa')](_0x8282('0x24'))['split'](','):null;},'comment':_0x8282('0x26')},'dtmfmode':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x27'),_0x8282('0x28'),_0x8282('0x29'),'inband','auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x8282('0xe')]('yes','no',_0x8282('0x2a'),'update',_0x8282('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0xeefb56){this[_0x8282('0x4')](_0x8282('0x2d'),_0xeefb56?_0xeefb56[_0x8282('0x25')](','):null);},'get':function(){return this[_0x8282('0xa')](_0x8282('0x2d'))?this[_0x8282('0xa')](_0x8282('0x2d'))[_0x8282('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8282('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x8282('0x3')]},'language':{'type':Sequelize[_0x8282('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8282('0x3')]},'disallow':{'type':Sequelize[_0x8282('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8282('0x2f'),'set':function(_0x2c1052){this[_0x8282('0x4')](_0x8282('0x30'),_0x2c1052?_0x2c1052['join'](';'):_0x8282('0x2f'));},'get':function(){return this[_0x8282('0xa')]('allow')?this['getDataValue'](_0x8282('0x30'))[_0x8282('0x2e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![],'set':function(_0x12e61c){this[_0x8282('0x4')](_0x8282('0x31'),_0x12e61c?_0x12e61c['join'](','):null);},'get':function(){return this[_0x8282('0xa')]('insecure')?this[_0x8282('0xa')](_0x8282('0x31'))[_0x8282('0x2e')](','):null;},'comment':_0x8282('0x32')},'trustrpid':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8282('0xe')]('yes','no',_0x8282('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![],'defaultValue':_0x8282('0x34')},'amaflags':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8282('0xe')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no',_0x8282('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x8282('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x36'),_0x8282('0x37'),_0x8282('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8282('0xe')]('uac',_0x8282('0x39')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x8282('0x2c')},'keepalive':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x8282('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8282('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8282('0xe')]('yes','no',_0x8282('0x3a'),_0x8282('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8282('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8282('0xe')]('active',_0x8282('0x3c'),_0x8282('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8282('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x8282('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x8282('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8282('0xe')](_0x8282('0x2c'),'no','nonat',_0x8282('0x3e'),_0x8282('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8282('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x8282('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8282('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4bab13){this[_0x8282('0x4')](_0x8282('0x41'),_0x4bab13);var _0x365a7d=this['get']({'plain':!![]});switch(_0x4bab13){case 0x0:case 0x1:var _0x28ec28=_0x365a7d[_0x8282('0x24')]?_['isArray'](_0x365a7d[_0x8282('0x24')])?_0x365a7d[_0x8282('0x24')][_0x8282('0x25')]():_0x365a7d[_0x8282('0x24')]:_0x8282('0x23');if(_0x28ec28===_0x8282('0x42')){_0x28ec28='udp';}this[_0x8282('0x4')]('transport',_0x28ec28);this[_0x8282('0x4')](_0x8282('0x43'),'no');this['setDataValue'](_0x8282('0x44'),null);this[_0x8282('0x4')](_0x8282('0x45'),null);this[_0x8282('0x4')]('icesupport',null);this[_0x8282('0x4')]('dtlsenable',null);this[_0x8282('0x4')](_0x8282('0x46'),null);this[_0x8282('0x4')](_0x8282('0x47'),null);this['setDataValue']('dtlscertfile',null);this[_0x8282('0x4')]('dtlsprivatekey',null);this[_0x8282('0x4')]('rtcp_mux','no');break;case 0x2:this[_0x8282('0x4')](_0x8282('0x24'),_0x8282('0x42'));this['setDataValue'](_0x8282('0x43'),_0x8282('0x2c'));this[_0x8282('0x4')](_0x8282('0x44'),_0x8282('0x2c'));this['setDataValue'](_0x8282('0x45'),_0x8282('0x2c'));this['setDataValue'](_0x8282('0x48'),_0x8282('0x2c'));this[_0x8282('0x4')]('dtlsenable',_0x8282('0x2c'));this[_0x8282('0x4')]('dtlsverify','no');this[_0x8282('0x4')](_0x8282('0x47'),_0x8282('0x3d'));this['setDataValue']('dtlscertfile',_0x365a7d[_0x8282('0x49')]||_0x8282('0x4a'));this[_0x8282('0x4')](_0x8282('0x4b'),_0x365a7d[_0x8282('0x4b')]||_0x8282('0x4c'));this['setDataValue'](_0x8282('0x4d'),_0x8282('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x5c4206){this['setDataValue'](_0x8282('0x4e'),_0x5c4206?_0x5c4206[_0x8282('0x25')](','):[]);},'get':function(){return this[_0x8282('0xa')]('permissions')?_[_0x8282('0x4f')](this[_0x8282('0xa')](_0x8282('0x4e'))['split'](','),function(_0x446513){return parseInt(_0x446513,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8282('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8282('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8282('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x8282('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8282('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8282('0x50')],'get':function(){return this[_0x8282('0xa')](_0x8282('0x51'))?this[_0x8282('0xa')](_0x8282('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x8282('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8282('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![],'set':function(_0x31dc28){if(typeof _0x31dc28===_0x8282('0x52')){var _0xeb349f=_0x31dc28==='1'?!![]:_0x31dc28==='0'?![]:_0x31dc28===_0x8282('0x53')?!![]:_0x31dc28==='false'?![]:![];this[_0x8282('0x4')](_0x8282('0x54'),_0xeb349f);}else{this[_0x8282('0x4')](_0x8282('0x54'),_0x31dc28);}}},'blocked':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![],'set':function(_0x152793){this[_0x8282('0x4')](_0x8282('0x55'),_0x152793);if(_0x152793===!![]){this[_0x8282('0x4')]('blockedAt',moment());this[_0x8282('0x4')](_0x8282('0x56'),0x0);}else{this[_0x8282('0x4')](_0x8282('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x8282('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x8282('0x18')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8282('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x8282('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x8282('0x18')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index dbc0d20..ec68ac3 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 _0x9557=['max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','103','104','106','107','108','109','100','111','114','115','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','Telephones','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','findAll','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','oldPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','VoiceQueue','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','remove','isArray','Queue:remove','voice','filename','getAvatar','root','server/files/images/logos/default_profile.png','userpic','existsSync','join','server/files/images/','download','getOpenTabs','fax','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','concat','findOne','format','User\x20with\x20id\x20%s\x20not\x20found','CmList','List','Tags','color','tag','getQueues','model','keys','filters','intersection','fields','order','pick','merge','Unknown\x20role','hasOwnProperty','nolimit','getVoiceQueuesRt','sort','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','smsPause','pauseType','lastPauseAt','getTeams','Team','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','addTeams','getAssociatedQueues','getDataValue','Voice','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','UserVoicePrefix','getLists','getAgents','getVoiceQueues','values','CmHopper','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$overlap','$contains','$contained','lastName','Queue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','unknown','ringing','teams','queues','flatten','toString','lower','col','asc','desc','orderBy','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','lodash','squel','ioredis','jayson/promise','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../errors/api','APIForbiddenrror','handleError','../../mysqldb','redis','register','client','sendStatus','end','json','offset','limit','count','status','set','Content-Range','request','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','message','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','telephone','filter','ignore','map','value','name','UserProfileResource','stack','User','rawAttributes','type','password','salt','resetPasswordToken','resetPasswordExpires','md5secret','includes','getOptions','where','query','includeAll','include','true','UserSetting','userSetting','attributes','push','rows','length','dataValues','sms','openchannel','whatsapp','all','catch','params','options','find','chat','mail','update','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9557,0x123));var _0x7955=function(_0x5c1636,_0x304200){_0x5c1636=_0x5c1636-0x0;var _0x3dc90f=_0x9557[_0x5c1636];return _0x3dc90f;};'use strict';var moment=require('moment');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x7955('0x0'));var squel=require(_0x7955('0x1'));var Redis=require(_0x7955('0x2'));var jayson=require(_0x7955('0x3'));var authService=require(_0x7955('0x4'));var contacts=require(_0x7955('0x5'));var qs=require(_0x7955('0x6'));var rta=require('../../components/realtime/agents');var logger=require(_0x7955('0x7'))('api');var utils=require('../../config/utils');var config=require(_0x7955('0x8'));var licenseUtil=require(_0x7955('0x9'));var APIBadRequestError=require(_0x7955('0xa'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIForbiddenError=require(_0x7955('0xa'))[_0x7955('0xb')];var APIHandleError=require(_0x7955('0xa'))[_0x7955('0xc')];var db=require(_0x7955('0xd'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x7955('0xe')]));require('./user.socket')[_0x7955('0xf')](socket);config['redis']=_['defaults'](config[_0x7955('0xe')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0x7955('0x10')]['http']({'port':0x232a});var values;function respondWithStatusCode(_0xc74055,_0x410c8e){_0x410c8e=_0x410c8e||0xcc;return function(_0x4747aa){if(_0x4747aa){return _0xc74055[_0x7955('0x11')](_0x410c8e);}return _0xc74055['status'](_0x410c8e)[_0x7955('0x12')]();};}function respondWithResult(_0x3c8283,_0x4610ed){_0x4610ed=_0x4610ed||0xc8;return function(_0x210ab1){if(_0x210ab1){return _0x3c8283['status'](_0x4610ed)[_0x7955('0x13')](_0x210ab1);}};}function respondWithFilteredResult(_0x469264,_0x24751b){return function(_0x40d7a9){if(_0x40d7a9){var _0x2bd75b=typeof _0x24751b[_0x7955('0x14')]==='undefined'&&typeof _0x24751b[_0x7955('0x15')]==='undefined';var _0x136dbd=_0x40d7a9[_0x7955('0x16')];var _0x48bc3a=_0x2bd75b?0x0:_0x24751b[_0x7955('0x14')];var _0x2e391a=_0x2bd75b?_0x40d7a9[_0x7955('0x16')]:_0x24751b['offset']+_0x24751b[_0x7955('0x15')];var _0x32e753;if(_0x2e391a>=_0x136dbd){_0x2e391a=_0x136dbd;_0x32e753=0xc8;}else{_0x32e753=0xce;}_0x469264[_0x7955('0x17')](_0x32e753);return _0x469264[_0x7955('0x18')](_0x7955('0x19'),_0x48bc3a+'-'+_0x2e391a+'/'+_0x136dbd)[_0x7955('0x13')](_0x40d7a9);}return null;};}function respondWithRpcPromise(_0x22e4c9,_0x2e2569,_0x2fc8f0,_0x4366d9){return new Promise(function(_0x38ee27,_0x48d4f8){var _0x3ef3e9=_0x4366d9||amiClient;return _0x3ef3e9[_0x7955('0x1a')](_0x22e4c9,_0x2fc8f0)[_0x7955('0x1b')](function(_0x2b5fc3){logger[_0x7955('0x1c')](_0x7955('0x1d'),_0x2e2569,_0x7955('0x1e'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x2e2569,_0x7955('0x1e'),JSON[_0x7955('0x1f')](_0x2b5fc3));if(_0x2b5fc3['error']){if(_0x2b5fc3['error']['code']===0x1f4){logger[_0x7955('0x20')](_0x7955('0x1d'),_0x2e2569,_0x2b5fc3['error'][_0x7955('0x21')]);return _0x48d4f8(_0x2b5fc3[_0x7955('0x20')][_0x7955('0x21')]);}logger[_0x7955('0x20')](_0x7955('0x1d'),_0x2e2569,_0x2b5fc3['error'][_0x7955('0x21')]);return _0x38ee27(_0x2b5fc3[_0x7955('0x20')][_0x7955('0x21')]);}else{logger[_0x7955('0x1c')]('User,\x20%s,\x20%s',_0x2e2569,'request\x20sent');_0x38ee27(_0x2b5fc3['result'][_0x7955('0x21')]);}})['catch'](function(_0x400a0e){logger[_0x7955('0x20')](_0x7955('0x1d'),_0x2e2569,_0x400a0e);_0x48d4f8(_0x400a0e);});});}function saveUpdates(_0x673a10){return function(_0x5c5e02){if(_0x5c5e02){return _0x5c5e02['update'](_0x673a10)['then'](function(_0xdbdcee){if(_0xdbdcee[_0x7955('0x22')]===_0x7955('0x23')){socket[_0x7955('0x24')](_0x7955('0x25')+_0xdbdcee['id'],_0xdbdcee);}return _0xdbdcee;});}return null;};}function removeEntity(_0x5cb7e0,_0x5cab52){return function(_0x451f7f){if(_0x451f7f){return _0x451f7f[_0x7955('0x26')]({'transaction':_0x5cab52})[_0x7955('0x1b')](function(){var _0x4fb9bb=_0x451f7f[_0x7955('0x27')]({'plain':!![]});if(_0x4fb9bb['role']===_0x7955('0x28'))return;var _0x3e0545=[{'name':_0x7955('0x29'),'value':_0x7955('0x2a'),'ignore':!![]},{'name':_0x7955('0x2b'),'value':_0x7955('0x23'),'ignore':![]},{'name':'Telephones','value':_0x7955('0x2c'),'ignore':![]}];var _0x2eda9d=_(_0x3e0545)[_0x7955('0x2d')](_0x7955('0x2e'))[_0x7955('0x2f')](_0x7955('0x30'))[_0x7955('0x30')]();if(_['includes'](_0x2eda9d,_0x4fb9bb['role'])){return;}var _0x5e97cb=_['find'](_0x3e0545,[_0x7955('0x30'),_0x4fb9bb[_0x7955('0x22')]])[_0x7955('0x31')];return db[_0x7955('0x32')][_0x7955('0x26')]({'where':{'type':_0x5e97cb,'resourceId':_0x4fb9bb['id']},'transaction':_0x5cab52})[_0x7955('0x1b')](function(){return _0x451f7f;});})[_0x7955('0x1b')](function(){_0x5cb7e0['status'](0xcc)[_0x7955('0x12')]();});}};}function handleEntityNotFound(_0x481148){return function(_0x4e10f6){if(!_0x4e10f6){_0x481148['sendStatus'](0x194);}return _0x4e10f6;};}function handleError(_0xe143cd,_0x1c3f12){_0x1c3f12=_0x1c3f12||0x1f4;return function(_0x4ca3c9){logger[_0x7955('0x20')](_0x4ca3c9[_0x7955('0x33')]);if(_0x4ca3c9[_0x7955('0x31')]){delete _0x4ca3c9[_0x7955('0x31')];}_0xe143cd[_0x7955('0x17')](_0x1c3f12)['send'](_0x4ca3c9);};}function getUserAttributes(){return _(db[_0x7955('0x34')][_0x7955('0x35')])['map'](function(_0x5ef45b){return{'name':_0x5ef45b['fieldName'],'type':_0x5ef45b[_0x7955('0x36')]['key']};})['filter'](function(_0x4577ae){return![_0x7955('0x37'),_0x7955('0x38'),'previousPasswords',_0x7955('0x39'),_0x7955('0x3a'),_0x7955('0x3b')][_0x7955('0x3c')](_0x4577ae[_0x7955('0x31')]);})['value']();}exports['index']=function(_0x33a753,_0x375164){var _0x495bad={},_0x56c4eb={'count':0x0,'rows':[]};var _0x17845d=getUserAttributes();_0x495bad=qs[_0x7955('0x3d')](_0x17845d,_0x33a753);var _0x37a4f0={'where':_0x495bad[_0x7955('0x3e')]};return db[_0x7955('0x34')][_0x7955('0x16')](_0x37a4f0)[_0x7955('0x1b')](function(_0x4f8557){_0x56c4eb[_0x7955('0x16')]=_0x4f8557;if(_0x33a753[_0x7955('0x3f')][_0x7955('0x40')]){_0x495bad[_0x7955('0x41')]=[{'all':!![]}];}if(_0x33a753[_0x7955('0x3f')]['userSetting']===_0x7955('0x42')){_0x495bad['include']=[{'model':db[_0x7955('0x43')],'as':_0x7955('0x44')}];}if(!_[_0x7955('0x3c')](_0x495bad[_0x7955('0x45')],'id')){_0x495bad[_0x7955('0x45')][_0x7955('0x46')]('id');}return db[_0x7955('0x34')]['findAll'](_0x495bad);})[_0x7955('0x1b')](function(_0x1df586){_0x56c4eb[_0x7955('0x47')]=_0x1df586;if(_0x33a753[_0x7955('0x3f')]['openTabs']===_0x7955('0x42')){var _0x239590=[];for(var _0x19fb7a=0x0;_0x19fb7a<_0x56c4eb['rows'][_0x7955('0x48')];_0x19fb7a++){_0x239590[_0x7955('0x46')](get_open_tabs('chat',_0x56c4eb[_0x7955('0x47')][_0x19fb7a][_0x7955('0x49')]));_0x239590[_0x7955('0x46')](get_open_tabs(_0x7955('0x4a'),_0x56c4eb[_0x7955('0x47')][_0x19fb7a]['dataValues']));_0x239590['push'](get_open_tabs('fax',_0x56c4eb[_0x7955('0x47')][_0x19fb7a][_0x7955('0x49')]));_0x239590['push'](get_open_tabs('mail',_0x56c4eb[_0x7955('0x47')][_0x19fb7a][_0x7955('0x49')]));_0x239590['push'](get_open_tabs(_0x7955('0x4b'),_0x56c4eb[_0x7955('0x47')][_0x19fb7a][_0x7955('0x49')]));_0x239590['push'](get_open_tabs(_0x7955('0x4c'),_0x56c4eb[_0x7955('0x47')][_0x19fb7a][_0x7955('0x49')]));}return Promise[_0x7955('0x4d')](_0x239590)[_0x7955('0x1b')](function(){return _0x56c4eb;});}else{return _0x56c4eb;}})[_0x7955('0x1b')](respondWithFilteredResult(_0x375164,_0x495bad))[_0x7955('0x4e')](handleError(_0x375164,null));};exports['show']=function(_0x2eab06,_0x61490f){var _0x59a8d8=getUserAttributes();_0x2eab06['query']['id']=_0x2eab06[_0x7955('0x4f')]['id'];var _0x45cd92=qs[_0x7955('0x3d')](_0x59a8d8,_0x2eab06);if(_0x2eab06['query'][_0x7955('0x40')]){_0x45cd92['include']=[{'all':!![]}];}if(_0x2eab06[_0x7955('0x3f')]['userSetting']==='true'){_0x45cd92['include']=[{'model':db[_0x7955('0x43')],'as':_0x7955('0x44')}];}_0x45cd92=_['merge']({},_0x45cd92,_0x2eab06[_0x7955('0x50')]);if(!_[_0x7955('0x3c')](_0x45cd92['attributes'],'id')){_0x45cd92[_0x7955('0x45')][_0x7955('0x46')]('id');}return db[_0x7955('0x34')][_0x7955('0x51')](_0x45cd92)[_0x7955('0x1b')](handleEntityNotFound(_0x61490f,null))['then'](function(_0x39b1ed){var _0x44919c=[];values=_0x39b1ed;if(_0x2eab06['query']['openTabs']==='true'){_0x44919c['push'](get_open_tabs(_0x7955('0x52'),_0x39b1ed[_0x7955('0x49')]));_0x44919c[_0x7955('0x46')](get_open_tabs(_0x7955('0x4a'),_0x39b1ed['dataValues']));_0x44919c[_0x7955('0x46')](get_open_tabs(_0x7955('0x4b'),_0x39b1ed[_0x7955('0x49')]));_0x44919c[_0x7955('0x46')](get_open_tabs(_0x7955('0x4c'),_0x39b1ed[_0x7955('0x49')]));_0x44919c[_0x7955('0x46')](get_open_tabs('fax',_0x39b1ed['dataValues']));_0x44919c[_0x7955('0x46')](get_open_tabs(_0x7955('0x53'),_0x39b1ed['dataValues']));return Promise[_0x7955('0x4d')](_0x44919c);}else{return values;}})[_0x7955('0x1b')](function(){return values;})[_0x7955('0x1b')](respondWithResult(_0x61490f,null))[_0x7955('0x4e')](handleError(_0x61490f,null));};exports[_0x7955('0x54')]=function(_0x3e39ee,_0x1d99e9){if(_0x3e39ee[_0x7955('0x55')]['id']){delete _0x3e39ee[_0x7955('0x55')]['id'];}delete _0x3e39ee['body']['role'];return db[_0x7955('0x34')]['find']({'where':{'id':_0x3e39ee[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x1d99e9,null))[_0x7955('0x1b')](saveUpdates(_0x3e39ee['body'],null))['then'](respondWithResult(_0x1d99e9,null))['catch'](handleError(_0x1d99e9,null));};exports[_0x7955('0x56')]=function(_0x322d16,_0x4a4b58){return db[_0x7955('0x34')][_0x7955('0x56')]()[_0x7955('0x1b')](respondWithResult(_0x4a4b58,null))[_0x7955('0x4e')](handleError(_0x4a4b58,null));};exports['addContacts']=function(_0x2fa8e7,_0x45f3e5){return db[_0x7955('0x34')]['find']({'where':{'id':_0x2fa8e7[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x45f3e5,null))[_0x7955('0x1b')](function(_0x2448d8){if(_0x2448d8){return _0x2448d8[_0x7955('0x57')](_0x2fa8e7[_0x7955('0x55')][_0x7955('0x58')],_[_0x7955('0x59')](_0x2fa8e7['body'],['ids','id'])||{});}})[_0x7955('0x1b')](respondWithResult(_0x45f3e5,null))[_0x7955('0x4e')](handleError(_0x45f3e5,null));};function validateUser(_0x1b8353){return new Promise(function(_0x3bb9ac,_0x5d15e3){if(_0x1b8353[_0x7955('0x5a')])return _0x3bb9ac(_0x1b8353);return db[_0x7955('0x5b')][_0x7955('0x5c')](0x1)['then'](function(_0x5e37dd){if(_0x5e37dd[_0x7955('0x5d')])authService[_0x7955('0x5e')](_0x1b8353['password']);db[_0x7955('0x34')][_0x7955('0x5f')]('internal')[_0x7955('0x1b')](function(_0x36c257){if(_[_0x7955('0x60')](_0x36c257)){_0x1b8353[_0x7955('0x5a')]=_0x5e37dd[_0x7955('0x61')]||0x1;return;}if(_[_0x7955('0x60')](_0x5e37dd['min_internal'])||_0x5e37dd[_0x7955('0x61')]===_0x36c257){_0x1b8353[_0x7955('0x5a')]=_0x36c257+0x1;return;}if(_0x5e37dd['min_internal']>_0x36c257){_0x1b8353[_0x7955('0x5a')]=_0x5e37dd[_0x7955('0x61')];return;}return db[_0x7955('0x62')][_0x7955('0x3f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0x7955('0x63')][_0x7955('0x64')]})[_0x7955('0x1b')](function(_0x2e5a54){if(_0x2e5a54&&_0x2e5a54[_0x7955('0x48')]){for(var _0x14943=0x0,_0x1a625d=_0x2e5a54[_0x7955('0x48')];_0x14943<_0x1a625d&&_[_0x7955('0x60')](_0x1b8353[_0x7955('0x5a')]);_0x14943++){if(_0x5e37dd[_0x7955('0x61')]<=_0x2e5a54[_0x14943][_0x7955('0x65')]){_0x1b8353[_0x7955('0x5a')]=_0x2e5a54[_0x14943][_0x7955('0x65')];}else if(_0x5e37dd[_0x7955('0x61')]>_0x2e5a54[_0x14943][_0x7955('0x65')]&&_0x5e37dd[_0x7955('0x61')]<=_0x2e5a54[_0x14943]['to']){_0x1b8353['internal']=_0x5e37dd['min_internal'];}}}if(_[_0x7955('0x60')](_0x1b8353[_0x7955('0x5a')])){_0x1b8353[_0x7955('0x5a')]=_0x36c257+0x1;}return _0x3bb9ac(_0x1b8353);});});})[_0x7955('0x4e')](function(_0x4914d1){_0x5d15e3(_0x4914d1);});});}function updateUser(_0x33d411){return new Promise(function(_0x3f9e02,_0x488be9){try{if(_0x33d411[_0x7955('0x66')]){_0x33d411[_0x7955('0x67')]=_0x33d411[_0x7955('0x5a')];_0x33d411[_0x7955('0x68')]={'mailbox':_0x33d411[_0x7955('0x5a')],'password':_0x33d411['password'],'fullname':_0x33d411[_0x7955('0x69')],'email':_0x33d411[_0x7955('0x6a')]};}if(_0x33d411['role']===_0x7955('0x23')){if(!_0x33d411[_0x7955('0x6b')])_0x33d411[_0x7955('0x6b')]=['101',_0x7955('0x6c'),_0x7955('0x6d'),'113','110',_0x7955('0x6e'),'105',_0x7955('0x6f'),_0x7955('0x70'),_0x7955('0x71'),_0x7955('0x72'),_0x7955('0x73'),_0x7955('0x74'),_0x7955('0x75'),_0x7955('0x76')];}_0x3f9e02(_0x33d411);}catch(_0x4357d8){_0x488be9(_0x4357d8);}});}exports['create']=function(_0x38d3f8,_0x25eae9){if(_0x38d3f8[_0x7955('0x2a')][_0x7955('0x22')]===_0x7955('0x23'))throw new Error('Unauthorized');if(_0x38d3f8[_0x7955('0x55')][_0x7955('0x22')]===_0x7955('0x2a')&&_0x38d3f8[_0x7955('0x2a')][_0x7955('0x22')]!==_0x7955('0x28')){throw new Error(_0x7955('0x77'));}if(_0x38d3f8[_0x7955('0x55')][_0x7955('0x22')]===_0x7955('0x28')&&_0x38d3f8['user'][_0x7955('0x22')]!=='admin'){throw new Error(_0x7955('0x78'));}return licenseUtil['checkUserLimits']([_0x38d3f8[_0x7955('0x55')]])[_0x7955('0x1b')](function(){return validateUser(_0x38d3f8[_0x7955('0x55')]);})['then'](function(_0x159acb){return updateUser(_0x159acb)[_0x7955('0x1b')](function(_0x59a3da){if(_0x59a3da[_0x7955('0x22')]===_0x7955('0x28')){_0x59a3da[_0x7955('0x79')]=_0x38d3f8[_0x7955('0x2a')]['settingsEnabled'];delete _0x59a3da[_0x7955('0x7a')];}return _0x59a3da;});})[_0x7955('0x1b')](function(_0x46c624){return db[_0x7955('0x34')]['create'](_0x46c624,{'include':[{'model':db[_0x7955('0x68')],'as':_0x7955('0x68')}]});})[_0x7955('0x1b')](function(_0x4544b8){if(_0x38d3f8[_0x7955('0x55')][_0x7955('0x22')]===_0x7955('0x2a'))return _0x4544b8;if(_0x38d3f8['user'][_0x7955('0x22')]!==_0x7955('0x2a'))return _0x4544b8;return db[_0x7955('0x7b')]['find']({'where':{'name':_0x4544b8[_0x7955('0x22')]===_0x7955('0x23')?_0x7955('0x2b'):_0x7955('0x7c'),'userProfileId':_0x38d3f8[_0x7955('0x2a')][_0x7955('0x7a')]},'raw':!![]})[_0x7955('0x1b')](function(_0x9cad0f){if(!_0x9cad0f||_0x9cad0f[_0x7955('0x7d')]!=0x0)return _0x4544b8;return db[_0x7955('0x32')][_0x7955('0x7e')]({'name':_0x4544b8['name'],'resourceId':_0x4544b8['id'],'type':_0x9cad0f['name'],'sectionId':_0x9cad0f['id']},{})[_0x7955('0x1b')](function(){return _0x4544b8;});})[_0x7955('0x4e')](function(_0x9dd1be){logger[_0x7955('0x20')](_0x7955('0x7f'),_0x9dd1be);throw _0x9dd1be;});})['then'](respondWithResult(_0x25eae9,0xc9))[_0x7955('0x4e')](handleError(_0x25eae9,null));};exports['bulkCreate']=function(_0x2b5920,_0x56dba3){var _0x4c0365=_0x2b5920[_0x7955('0x55')];var _0x6f912d=[];if(_0x2b5920['user'][_0x7955('0x22')]===_0x7955('0x23'))throw new Error(_0x7955('0x80'));if(_['some'](_0x4c0365,['role','user'])&&_0x2b5920[_0x7955('0x2a')][_0x7955('0x22')]!==_0x7955('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x7955('0x81')](_0x4c0365,[_0x7955('0x22'),_0x7955('0x28')])&&_0x2b5920[_0x7955('0x2a')][_0x7955('0x22')]!==_0x7955('0x28')){throw new Error(_0x7955('0x82'));}return licenseUtil[_0x7955('0x83')](_0x4c0365)['then'](function(){return validateUser(_0x4c0365[0x0]);})[_0x7955('0x1b')](function(){for(var _0x5264a5=0x1;_0x5264a5<_0x4c0365[_0x7955('0x48')];_0x5264a5++){var _0x90c5ee=_0x4c0365[_0x5264a5-0x1][_0x7955('0x5a')];if(!_0x4c0365[_0x5264a5][_0x7955('0x5a')])_0x4c0365[_0x5264a5][_0x7955('0x5a')]=_0x90c5ee+0x1;_0x6f912d[_0x7955('0x46')](validateUser(_0x4c0365[_0x5264a5]));}return Promise[_0x7955('0x4d')](_0x6f912d);})[_0x7955('0x1b')](function(){_0x6f912d=[];for(var _0x4ce56c=0x0;_0x4ce56c<_0x4c0365[_0x7955('0x48')];_0x4ce56c++){_0x6f912d[_0x7955('0x46')](updateUser(_0x4c0365[_0x4ce56c]));}return Promise[_0x7955('0x4d')](_0x6f912d);})['then'](function(){_0x6f912d=_0x4c0365[_0x7955('0x2f')](function(_0x145e9d){return db[_0x7955('0x34')][_0x7955('0x7e')](_0x145e9d,{'include':[{'model':db[_0x7955('0x68')],'as':_0x7955('0x68')}]})[_0x7955('0x1b')](function(_0x3529e2){_0x145e9d['id']=_0x3529e2['id'];return _0x145e9d;});});return Promise[_0x7955('0x4d')](_0x6f912d);})[_0x7955('0x1b')](function(_0x3cc228){if(_0x2b5920[_0x7955('0x55')][_0x7955('0x22')]===_0x7955('0x2a'))return _0x3cc228;if(_0x2b5920[_0x7955('0x2a')][_0x7955('0x22')]!==_0x7955('0x2a'))return _0x3cc228;var _0x3ad5c8=_[_0x7955('0x81')](_0x3cc228,function(_0x2c31f7){return _0x2c31f7[_0x7955('0x22')]==='agent'||_0x2c31f7[_0x7955('0x22')]===_0x7955('0x2c');});if(!_0x3ad5c8)return _0x3cc228;return db[_0x7955('0x7b')][_0x7955('0x84')]({'where':{'name':{'$or':[_0x7955('0x2b'),'Telephones']},'userProfileId':_0x2b5920[_0x7955('0x2a')][_0x7955('0x7a')]},'raw':!![]})[_0x7955('0x1b')](function(_0x277fde){if(_[_0x7955('0x85')](_0x277fde)||!_[_0x7955('0x81')](_0x277fde,['autoAssociation',0x0]))return _0x3cc228;_0x6f912d=[];var _0xa47d1b=_(_0x277fde)['map'](function(_0x1b8873){if(_0x1b8873[_0x7955('0x7d')]===0x1)return;return _0x1b8873[_0x7955('0x31')]===_0x7955('0x2b')?'agent':_0x7955('0x2c');})[_0x7955('0x86')]()['value']();for(var _0x3ba294=0x0;_0x3ba294<_0x3cc228[_0x7955('0x48')];_0x3ba294++){if(!_[_0x7955('0x3c')](_0xa47d1b,_0x3cc228[_0x3ba294][_0x7955('0x22')]))return;var _0x200555=_0x3cc228[_0x3ba294]['role']===_0x7955('0x23')?'Agents':'Telephones';_0x6f912d[_0x7955('0x46')](db['UserProfileResource']['create']({'name':_0x3cc228[_0x3ba294][_0x7955('0x31')],'resourceId':_0x3cc228[_0x3ba294]['id'],'type':_0x200555,'sectionId':_['find'](_0x277fde,[_0x7955('0x31'),_0x200555])['id']},{}));}return Promise[_0x7955('0x4d')](_0x6f912d);});})[_0x7955('0x1b')](respondWithResult(_0x56dba3,0xc9))[_0x7955('0x4e')](handleError(_0x56dba3,null));};exports[_0x7955('0x87')]=function(_0x3b5f96,_0x356abe){if(_0x3b5f96[_0x7955('0x55')]['id']){delete _0x3b5f96[_0x7955('0x55')]['id'];}return db['User'][_0x7955('0x51')]({'where':{'id':_0x3b5f96[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](function(_0x2a0551){if(!_0x2a0551)return null;if(_0x2a0551['id']===_0x3b5f96['user']['id']){if(!_0x3b5f96['body']['oldPassword']||!_0x3b5f96[_0x7955('0x55')][_0x7955('0x88')]){throw new db[(_0x7955('0x89'))][(_0x7955('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x2a0551['authenticate'](_0x3b5f96['body']['oldPassword'])){throw new db['Sequelize'][(_0x7955('0x8a'))]('Wrong\x20credentials');}if(_0x3b5f96[_0x7955('0x55')][_0x7955('0x8b')]===_0x3b5f96[_0x7955('0x55')][_0x7955('0x88')]){throw new db[(_0x7955('0x89'))][(_0x7955('0x8a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x3b5f96[_0x7955('0x2a')][_0x7955('0x22')]===_0x7955('0x28')){if(!_0x3b5f96[_0x7955('0x55')][_0x7955('0x88')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x3b5f96['user'][_0x7955('0x22')]===_0x7955('0x2a')){if(!_0x3b5f96['body'][_0x7955('0x88')]){throw new db['Sequelize'][(_0x7955('0x8a'))](_0x7955('0x8c'));}if(_0x2a0551[_0x7955('0x22')]!==_0x7955('0x23')){throw new db[(_0x7955('0x89'))][(_0x7955('0x8a'))]('Unauthorized');}}else{throw new db[(_0x7955('0x89'))][(_0x7955('0x8a'))]('Unauthorized');}return _0x2a0551;})[_0x7955('0x1b')](handleEntityNotFound(_0x356abe,null))[_0x7955('0x1b')](function(_0x265821){return db[_0x7955('0x5b')]['findOne']({'attributes':['id',_0x7955('0x5d'),_0x7955('0x8d'),_0x7955('0x8e')]})[_0x7955('0x1b')](function(_0x183dae){if(_0x183dae[_0x7955('0x5d')])authService['validatePasswordPattern'](_0x3b5f96['body'][_0x7955('0x88')]);if(!_0x183dae[_0x7955('0x8d')]||!_0x265821[_0x7955('0x8f')])return _0x265821;authService[_0x7955('0x90')](_0x3b5f96[_0x7955('0x55')][_0x7955('0x88')],_0x265821['previousPasswords'],_0x183dae[_0x7955('0x8e')]);return _0x265821;})['then'](saveUpdates({'password':_0x3b5f96[_0x7955('0x55')]['newPassword'],'passwordResetAt':_0x3b5f96[_0x7955('0x2a')]['id']==_0x3b5f96[_0x7955('0x4f')]['id']?moment():null,'previousPasswords':authService[_0x7955('0x91')](_0x3b5f96[_0x7955('0x55')][_0x7955('0x88')],_0x265821['previousPasswords'])},null));})[_0x7955('0x1b')](respondWithResult(_0x356abe,null))[_0x7955('0x4e')](handleError(_0x356abe,null));};exports[_0x7955('0x92')]=function(_0x27411a,_0x2fac28){var _0x59663e=_0x27411a['body'][_0x7955('0x93')];return db['User']['find']({'where':{'id':_0x27411a[_0x7955('0x4f')]['id']},'attributes':['id',_0x7955('0x31'),_0x7955('0x22'),_0x7955('0x94'),_0x7955('0x95'),_0x7955('0x96'),_0x7955('0x97')]})['then'](handleEntityNotFound(_0x2fac28,null))[_0x7955('0x1b')](function(_0x364752){if(_0x364752){if(!utils['isValidChannel'](_0x59663e)){throw new db['Sequelize'][(_0x7955('0x8a'))](_0x7955('0x98'));}return _0x364752['add'+_[_0x7955('0x99')](_0x59663e[_0x7955('0x9a')]())+_0x7955('0x9b')](_0x27411a[_0x7955('0x55')]['ids'],{'penalty':_0x27411a[_0x7955('0x55')][_0x7955('0x9c')]||0x0})[_0x7955('0x9d')](function(_0x5e9755){for(var _0x3da0ae=0x0;_0x3da0ae<_0x27411a[_0x7955('0x55')]['ids'][_0x7955('0x48')];_0x3da0ae+=0x1){var _0x5a697d={'UserId':Number(_0x27411a[_0x7955('0x4f')]['id'])};_0x5a697d[_[_0x7955('0x99')](_0x59663e[_0x7955('0x9a')]())+_0x7955('0x9e')]=Number(_0x27411a[_0x7955('0x55')]['ids'][_0x3da0ae]);socket[_0x7955('0x24')](_0x7955('0x2a')+_['capitalize'](_0x59663e[_0x7955('0x9a')]())+_0x7955('0x9f'),_0x5a697d);}return _0x5e9755;})[_0x7955('0x1b')](function(){if(_0x59663e==='voice'){return db[_0x7955('0xa0')][_0x7955('0x84')]({'where':{'id':_0x27411a[_0x7955('0x55')][_0x7955('0x58')]||[]},'raw':!![],'attributes':['id',_0x7955('0x31')]});}})[_0x7955('0x1b')](function(_0x1129b7){var _0x386631=_0x364752['get']({'plain':!![]});var _0xcadbed=[];if(_0x59663e==='voice'&&_0x386631[_0x7955('0x22')]===_0x7955('0x23')&&_0x386631[_0x7955('0x94')]){for(let _0x3a1361=0x0;_0x3a1361<_0x1129b7[_0x7955('0x48')];_0x3a1361+=0x1){_0xcadbed[_0x7955('0x46')]({'membername':_0x386631[_0x7955('0x31')],'UserId':_0x386631['id'],'queue_name':_0x1129b7[_0x3a1361]['name'],'VoiceQueueId':_0x1129b7[_0x3a1361]['id'],'interface':_[_0x7955('0x60')](_0x386631[_0x7955('0x97')])?util['format'](_0x7955('0xa1'),_0x386631['name']):_0x386631[_0x7955('0x97')],'paused':_0x386631[_0x7955('0x96')]||![],'penalty':_0x27411a['body']['penalty']||0x0});}return Promise['all'](_0xcadbed['map'](function(_0x2f849a){return db[_0x7955('0xa2')][_0x7955('0xa3')](_0x2f849a);}));}return _0x364752;});}})[_0x7955('0x1b')](respondWithStatusCode(_0x2fac28,null))[_0x7955('0x4e')](handleError(_0x2fac28,null));};exports[_0x7955('0xa4')]=function(_0x187052,_0x55b0cd){var _0x59ad3a,_0x124363;return db[_0x7955('0x34')][_0x7955('0x51')]({'where':{'id':_0x187052['params']['id']},'attributes':['id',_0x7955('0x31'),_0x7955('0x22')]})['then'](handleEntityNotFound(_0x55b0cd,null))[_0x7955('0x1b')](function(_0x560942){if(_0x560942){_0x59ad3a=_0x560942;if(!_0x187052['query'][_0x7955('0x93')]||!utils[_0x7955('0xa5')](_0x187052[_0x7955('0x3f')][_0x7955('0x93')])){throw new db[(_0x7955('0x89'))][(_0x7955('0x8a'))](_0x7955('0x98'));}return _0x560942[_0x7955('0xa6')+_[_0x7955('0x99')](_0x187052[_0x7955('0x3f')]['channel'][_0x7955('0x9a')]())+_0x7955('0x9b')](_0x187052[_0x7955('0x3f')][_0x7955('0x58')]);}})[_0x7955('0x1b')](function(_0x53c1ef){if(_[_0x7955('0xa7')](_0x187052['query'][_0x7955('0x58')])){for(var _0x196375=0x0;_0x196375<_0x187052[_0x7955('0x3f')][_0x7955('0x58')][_0x7955('0x48')];_0x196375+=0x1){_0x124363={'UserId':Number(_0x187052[_0x7955('0x4f')]['id'])};_0x124363[_[_0x7955('0x99')](_0x187052['query'][_0x7955('0x93')]['toLowerCase']())+_0x7955('0x9e')]=Number(_0x187052[_0x7955('0x3f')][_0x7955('0x58')][_0x196375]);socket['emit'](_0x7955('0x2a')+_['capitalize'](_0x187052['query'][_0x7955('0x93')]['toLowerCase']())+_0x7955('0xa8'),_0x124363);}}else{_0x124363={'UserId':Number(_0x187052[_0x7955('0x4f')]['id'])};_0x124363[_[_0x7955('0x99')](_0x187052['query'][_0x7955('0x93')][_0x7955('0x9a')]())+_0x7955('0x9e')]=Number(_0x187052['query']['ids']);socket['emit'](_0x7955('0x2a')+_['capitalize'](_0x187052[_0x7955('0x3f')][_0x7955('0x93')][_0x7955('0x9a')]())+_0x7955('0xa8'),_0x124363);}return _0x53c1ef;})[_0x7955('0x1b')](function(){if(_0x187052['query'][_0x7955('0x93')]===_0x7955('0xa9')){return db[_0x7955('0xa2')][_0x7955('0x26')]({'where':{'UserId':_0x187052[_0x7955('0x4f')]['id'],'VoiceQueueId':_0x187052[_0x7955('0x3f')][_0x7955('0x58')]},'individualHooks':!![]})[_0x7955('0x1b')](function(){return _0x59ad3a;});}return _0x59ad3a;})[_0x7955('0x1b')](respondWithStatusCode(_0x55b0cd,null))[_0x7955('0x4e')](handleError(_0x55b0cd,null));};exports['addAvatar']=function(_0x5e998b,_0x26fb63){_0x5e998b['body']['userpic']=_0x5e998b['file'][_0x7955('0xaa')];return db[_0x7955('0x34')][_0x7955('0x51')]({'where':{'id':_0x5e998b['params']['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x26fb63,null))[_0x7955('0x1b')](saveUpdates(_0x5e998b[_0x7955('0x55')],null))[_0x7955('0x1b')](respondWithResult(_0x26fb63,null))[_0x7955('0x4e')](handleError(_0x26fb63,null));};exports[_0x7955('0xab')]=function(_0x4b6547,_0x32f541){var _0x223994=path['join'](config[_0x7955('0xac')],_0x7955('0xad'));return db['User'][_0x7955('0x51')]({'where':{'id':_0x4b6547['params']['id']},'attributes':['id',_0x7955('0xae')],'raw':!![]})[_0x7955('0x1b')](handleEntityNotFound(_0x32f541,null))[_0x7955('0x1b')](function(_0x2eb408){if(_0x2eb408){if(_[_0x7955('0x60')](_0x2eb408[_0x7955('0xae')])){return _0x32f541['download'](_0x223994);}else{if(!fs[_0x7955('0xaf')](path[_0x7955('0xb0')](config[_0x7955('0xac')],_0x7955('0xb1'),_0x2eb408[_0x7955('0xae')]))){return _0x32f541[_0x7955('0xb2')](_0x223994);}return _0x32f541[_0x7955('0xb2')](path[_0x7955('0xb0')](config['root'],_0x7955('0xb1'),_0x2eb408[_0x7955('0xae')]));}}})['catch'](handleError(_0x32f541,null));};exports[_0x7955('0xb3')]=function(_0x743509,_0x45933c){return db[_0x7955('0x34')]['find']({'where':{'id':_0x743509[_0x7955('0x4f')]['id']},'attributes':['id']})[_0x7955('0x1b')](handleEntityNotFound(_0x45933c,null))['then'](function(_0x30af15){var _0x296c21=[];values=_0x30af15['dataValues'];_0x296c21[_0x7955('0x46')](get_open_tabs(_0x7955('0x52'),_0x30af15[_0x7955('0x49')]));_0x296c21[_0x7955('0x46')](get_open_tabs(_0x7955('0x4a'),_0x30af15[_0x7955('0x49')]));_0x296c21['push'](get_open_tabs('openchannel',_0x30af15[_0x7955('0x49')]));_0x296c21[_0x7955('0x46')](get_open_tabs('whatsapp',_0x30af15['dataValues']));_0x296c21[_0x7955('0x46')](get_open_tabs(_0x7955('0xb4'),_0x30af15['dataValues']));_0x296c21[_0x7955('0x46')](get_open_tabs(_0x7955('0x53'),_0x30af15['dataValues']));return Promise[_0x7955('0x4d')](_0x296c21);})[_0x7955('0x1b')](function(_0x1f28c0){if(_0x1f28c0){var _0x27c602=_[_0x7955('0x2f')](values['ChatOpenTabs'],function(_0x4a4163){return{'channel':_0x7955('0xb5'),'id':_0x4a4163['id'],'createdAt':_0x4a4163[_0x7955('0xb6')]};});var _0x5acdc4=_[_0x7955('0x2f')](values[_0x7955('0xb7')],function(_0x5cbfcf){return{'channel':_0x7955('0xb8'),'id':_0x5cbfcf['id'],'createdAt':_0x5cbfcf[_0x7955('0xb6')]};});var _0x4e9438=_[_0x7955('0x2f')](values[_0x7955('0xb9')],function(_0x5539ee){return{'channel':_0x7955('0xba'),'id':_0x5539ee['id'],'createdAt':_0x5539ee['createdAt']};});var _0x42ed2b=_['map'](values[_0x7955('0xbb')],function(_0x53d383){return{'channel':_0x7955('0xbc'),'id':_0x53d383['id'],'createdAt':_0x53d383['createdAt']};});var _0x45e041=_['map'](values['SmsOpenTabs'],function(_0x56cc69){return{'channel':_0x7955('0xbd'),'id':_0x56cc69['id'],'createdAt':_0x56cc69[_0x7955('0xb6')]};});var _0x2092ac=_[_0x7955('0x2f')](values[_0x7955('0xbe')],function(_0x1be926){return{'channel':'WHATSAPP','id':_0x1be926['id'],'createdAt':_0x1be926[_0x7955('0xb6')]};});var _0x1b6674=_[_0x7955('0xbf')](_0x27c602,_0x5acdc4,_0x4e9438,_0x42ed2b,_0x45e041,_0x2092ac);var _0x3748a7={'count':_0x1b6674[_0x7955('0x48')],'rows':_0x1b6674};return _0x3748a7;}else return null;})['then'](respondWithResult(_0x45933c,null))[_0x7955('0x4e')](handleError(_0x45933c,null));};exports['getContacts']=function(_0x38ce4c,_0x149a69){var _0x7553ea={};return db['User'][_0x7955('0xc0')]({'where':{'id':_0x38ce4c[_0x7955('0x4f')]['id']}})['then'](function(_0x4eb128){if(!_0x4eb128){throw new APINotFoundError(util[_0x7955('0xc1')](_0x7955('0xc2'),_0x38ce4c['params']['id']));}return contacts['describe']();})[_0x7955('0x1b')](function(_0x2b0f4b){_0x38ce4c['query'][_0x7955('0x34')]=_0x38ce4c[_0x7955('0x4f')]['id'];_0x7553ea=qs[_0x7955('0x3d')](_0x2b0f4b,_0x38ce4c);if(_0x38ce4c[_0x7955('0x3f')]['hasOwnProperty']('includeAll')){_0x7553ea['include']=[{'model':db[_0x7955('0xc3')],'as':_0x7955('0xc4'),'required':![]},{'model':db['Tag'],'as':_0x7955('0xc5'),'attributes':['id','name',_0x7955('0xc6')],'where':_0x38ce4c[_0x7955('0x3f')][_0x7955('0xc7')]?{'id':_0x38ce4c[_0x7955('0x3f')][_0x7955('0xc7')]}:undefined,'required':_0x38ce4c[_0x7955('0x3f')][_0x7955('0xc7')]?!![]:![]}];}return contacts[_0x7955('0x84')](_0x38ce4c[_0x7955('0x3f')],_0x38ce4c[_0x7955('0x2a')],_0x7553ea,_0x2b0f4b);})[_0x7955('0x1b')](respondWithFilteredResult(_0x149a69,_0x7553ea))[_0x7955('0x4e')](APIHandleError(_0x149a69));};exports[_0x7955('0xc8')]=function(_0x27f967,_0xcdb0f2){var _0xf614ef;var _0x4d4a8d={};var _0xfa98dc;return db['User']['findOne']({'where':{'id':_0x27f967[_0x7955('0x4f')]['id']},'attributes':['id',_0x7955('0x31'),_0x7955('0x22')]})[_0x7955('0x1b')](handleEntityNotFound(_0xcdb0f2,null))['then'](function(_0x48b2d1){if(!utils[_0x7955('0xa5')](_0x27f967[_0x7955('0x3f')][_0x7955('0x93')])){throw new db['Sequelize'][(_0x7955('0x8a'))](_0x7955('0x98'));}_0xf614ef=_0x48b2d1;var _0x199699={};_0x199699[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_['capitalize'](_0x27f967['query']['channel'])+'Queue'][_0x7955('0x35')]);_0x199699[_0x7955('0x3f')]=_[_0x7955('0xca')](_0x27f967['query']);_0x199699[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x199699['model'],_0x199699['query']);_0x4d4a8d[_0x7955('0x45')]=_['intersection'](_0x199699['model'],qs[_0x7955('0xcd')](_0x27f967[_0x7955('0x3f')][_0x7955('0xcd')]));_0x4d4a8d[_0x7955('0x45')]=_0x4d4a8d['attributes'][_0x7955('0x48')]?_0x4d4a8d[_0x7955('0x45')]:_0x199699[_0x7955('0xc9')];_0x4d4a8d[_0x7955('0xce')]=qs['sort'](_0x27f967[_0x7955('0x3f')]['sort']);_0x4d4a8d['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x27f967[_0x7955('0x3f')],_0x199699['filters']));if(_0x27f967[_0x7955('0x3f')][_0x7955('0x2d')]){_0x4d4a8d['where']=_[_0x7955('0xd0')](_0x4d4a8d[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x4d4a8d[_0x7955('0x45')],function(_0x26d809){var _0x4fd0d8={};_0x4fd0d8[_0x26d809]={'$like':'%'+_0x27f967[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x4fd0d8;})});}_0x4d4a8d=_[_0x7955('0xd0')]({},_0x4d4a8d,_0x27f967[_0x7955('0x50')]);switch(_0xf614ef[_0x7955('0x22')]){case _0x7955('0x28'):return db[_['capitalize'](_0x27f967[_0x7955('0x3f')][_0x7955('0x93')])+'Queue'][_0x7955('0x84')](_0x4d4a8d);case _0x7955('0x2a'):case'agent':return _0xf614ef[_0x7955('0x27')+_['capitalize'](_0x27f967[_0x7955('0x3f')][_0x7955('0x93')])+_0x7955('0x9b')](_0x4d4a8d);default:throw new db['Sequelize']['ValidationError'](_0x7955('0xd1'));}})[_0x7955('0x1b')](function(_0x3687d7){_0xfa98dc=_0x3687d7[_0x7955('0x48')];if(!_0x27f967[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x4d4a8d[_0x7955('0x15')]=qs[_0x7955('0x15')](_0x27f967[_0x7955('0x3f')][_0x7955('0x15')]);_0x4d4a8d[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x27f967[_0x7955('0x3f')][_0x7955('0x14')]);}switch(_0xf614ef[_0x7955('0x22')]){case _0x7955('0x28'):return db[_[_0x7955('0x99')](_0x27f967[_0x7955('0x3f')]['channel'])+'Queue'][_0x7955('0x84')](_0x4d4a8d);case'user':case'agent':return _0xf614ef[_0x7955('0x27')+_[_0x7955('0x99')](_0x27f967[_0x7955('0x3f')][_0x7955('0x93')])+_0x7955('0x9b')](_0x4d4a8d);}})[_0x7955('0x1b')](function(_0x2f6acf){return{'count':_0xfa98dc,'rows':_0x2f6acf};})[_0x7955('0x1b')](respondWithResult(_0xcdb0f2,null))['catch'](handleError(_0xcdb0f2,null));};exports[_0x7955('0xd4')]=function(_0x4269d8,_0x3695db){var _0x81d074={};var _0x34d798={};var _0x459869;var _0x28e576;return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x4269d8[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x3695db,null))[_0x7955('0x1b')](function(_0x247f07){if(_0x247f07){_0x459869=_0x247f07;_0x34d798[_0x7955('0xc9')]=_['keys'](db[_0x7955('0xa2')][_0x7955('0x35')]);_0x34d798[_0x7955('0x3f')]=_['keys'](_0x4269d8[_0x7955('0x3f')]);_0x34d798[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x34d798[_0x7955('0xc9')],_0x34d798[_0x7955('0x3f')]);_0x81d074[_0x7955('0x45')]=_[_0x7955('0xcc')](_0x34d798['model'],qs['fields'](_0x4269d8['query'][_0x7955('0xcd')]));_0x81d074[_0x7955('0x45')]=_0x81d074['attributes'][_0x7955('0x48')]?_0x81d074[_0x7955('0x45')]:_0x34d798['model'];_0x81d074[_0x7955('0xce')]=qs[_0x7955('0xd5')](_0x4269d8['query'][_0x7955('0xd5')]);_0x81d074[_0x7955('0x3e')]=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x4269d8['query'],_0x34d798[_0x7955('0xcb')]));if(_0x4269d8[_0x7955('0x3f')][_0x7955('0x2d')]){_0x81d074[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x81d074[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x81d074[_0x7955('0x45')],function(_0x323945){var _0x307a91={};_0x307a91[_0x323945]={'$like':'%'+_0x4269d8[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x307a91;})});}_0x81d074=_[_0x7955('0xd0')]({},_0x81d074,_0x4269d8[_0x7955('0x50')]);return _0x459869[_0x7955('0xd4')](_0x81d074);}})[_0x7955('0x1b')](function(_0x2d5211){if(_0x2d5211){_0x28e576=_0x2d5211[_0x7955('0x48')];if(!_0x4269d8[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x81d074[_0x7955('0x15')]=qs[_0x7955('0x15')](_0x4269d8[_0x7955('0x3f')]['limit']);_0x81d074[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x4269d8['query'][_0x7955('0x14')]);}return _0x459869[_0x7955('0xd4')](_0x81d074);}})[_0x7955('0x1b')](function(_0x5dbe24){if(_0x5dbe24){return _0x5dbe24?{'count':_0x28e576,'rows':_0x5dbe24}:null;}})['then'](respondWithResult(_0x3695db,null))[_0x7955('0x4e')](handleError(_0x3695db,null));};exports[_0x7955('0xd6')]=function(_0x56fbc4,_0x29f35b){var _0x21ea5f={};var _0x283b2d={};var _0x89e7e3;var _0x480a3d;return db['User']['findOne']({'where':{'id':_0x56fbc4[_0x7955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29f35b,null))[_0x7955('0x1b')](function(_0x10ca44){if(_0x10ca44){_0x89e7e3=_0x10ca44;_0x283b2d[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_0x7955('0xd7')][_0x7955('0x35')]);_0x283b2d[_0x7955('0x3f')]=_[_0x7955('0xca')](_0x56fbc4[_0x7955('0x3f')]);_0x283b2d[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x283b2d[_0x7955('0xc9')],_0x283b2d[_0x7955('0x3f')]);_0x21ea5f[_0x7955('0x45')]=_[_0x7955('0xcc')](_0x283b2d[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x56fbc4['query']['fields']));_0x21ea5f[_0x7955('0x45')]=_0x21ea5f['attributes'][_0x7955('0x48')]?_0x21ea5f[_0x7955('0x45')]:_0x283b2d[_0x7955('0xc9')];_0x21ea5f[_0x7955('0xce')]=qs[_0x7955('0xd5')](_0x56fbc4[_0x7955('0x3f')][_0x7955('0xd5')]);_0x21ea5f['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x56fbc4[_0x7955('0x3f')],_0x283b2d[_0x7955('0xcb')]));if(_0x56fbc4['query']['filter']){_0x21ea5f[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x21ea5f['where'],{'$or':_[_0x7955('0x2f')](_0x21ea5f[_0x7955('0x45')],function(_0x37d494){var _0x10b18b={};_0x10b18b[_0x37d494]={'$like':'%'+_0x56fbc4[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x10b18b;})});}_0x21ea5f=_['merge']({},_0x21ea5f,_0x56fbc4[_0x7955('0x50')]);return _0x89e7e3['getGroups'](_0x21ea5f);}})[_0x7955('0x1b')](function(_0x465b57){if(_0x465b57){_0x480a3d=_0x465b57[_0x7955('0x48')];if(!_0x56fbc4[_0x7955('0x3f')]['hasOwnProperty'](_0x7955('0xd3'))){_0x21ea5f[_0x7955('0x15')]=qs[_0x7955('0x15')](_0x56fbc4[_0x7955('0x3f')][_0x7955('0x15')]);_0x21ea5f['offset']=qs[_0x7955('0x14')](_0x56fbc4[_0x7955('0x3f')]['offset']);}return _0x89e7e3[_0x7955('0xd6')](_0x21ea5f);}})[_0x7955('0x1b')](function(_0x135520){if(_0x135520){return _0x135520?{'count':_0x480a3d,'rows':_0x135520}:null;}})[_0x7955('0x1b')](respondWithResult(_0x29f35b,null))[_0x7955('0x4e')](handleError(_0x29f35b,null));};exports[_0x7955('0xd8')]=function(_0x22abc1,_0x5406c3){var _0x3a8f15={'raw':!![],'where':{}};var _0x44cda2={};var _0x3dafb9={'count':0x0,'rows':[]};return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x22abc1['params']['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x5406c3,null))['then'](function(_0x4871d8){if(_0x4871d8){_0x44cda2[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_0x7955('0xd9')][_0x7955('0x35')]);_0x44cda2[_0x7955('0x3f')]=_[_0x7955('0xca')](_0x22abc1[_0x7955('0x3f')]);_0x44cda2['filters']=_[_0x7955('0xcc')](_0x44cda2[_0x7955('0xc9')],_0x44cda2[_0x7955('0x3f')]);_0x3a8f15[_0x7955('0x45')]=_['intersection'](_0x44cda2[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x22abc1[_0x7955('0x3f')][_0x7955('0xcd')]));_0x3a8f15[_0x7955('0x45')]=_0x3a8f15[_0x7955('0x45')][_0x7955('0x48')]?_0x3a8f15[_0x7955('0x45')]:_0x44cda2[_0x7955('0xc9')];if(!_0x22abc1[_0x7955('0x3f')]['hasOwnProperty'](_0x7955('0xd3'))){_0x3a8f15[_0x7955('0x15')]=qs['limit'](_0x22abc1[_0x7955('0x3f')][_0x7955('0x15')]);_0x3a8f15[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x22abc1[_0x7955('0x3f')][_0x7955('0x14')]);}_0x3a8f15[_0x7955('0xce')]=qs[_0x7955('0xd5')](_0x22abc1[_0x7955('0x3f')][_0x7955('0xd5')]);_0x3a8f15[_0x7955('0x3e')]=qs[_0x7955('0xcb')](_['pick'](_0x22abc1[_0x7955('0x3f')],_0x44cda2[_0x7955('0xcb')]));_0x3a8f15[_0x7955('0x3e')][_0x7955('0xda')]=_0x4871d8['id'];if(_0x22abc1['query'][_0x7955('0x2d')]){_0x3a8f15[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x3a8f15[_0x7955('0x3e')],{'$or':_['map'](_0x3a8f15['attributes'],function(_0x267b9b){var _0x2d3d47={};_0x2d3d47[_0x267b9b]={'$like':'%'+_0x22abc1[_0x7955('0x3f')]['filter']+'%'};return _0x2d3d47;})});}_0x3a8f15=_[_0x7955('0xd0')]({},_0x3a8f15,_0x22abc1[_0x7955('0x50')]);return db[_0x7955('0xd9')][_0x7955('0x16')]({'where':_0x3a8f15['where']})[_0x7955('0x1b')](function(_0xcd0e1f){_0x3dafb9[_0x7955('0x16')]=_0xcd0e1f;if(_0x22abc1[_0x7955('0x3f')]['includeAll']){_0x3a8f15[_0x7955('0x41')]=[{'all':!![]}];}return db[_0x7955('0xd9')]['findAll'](_0x3a8f15);})[_0x7955('0x1b')](function(_0x29bcab){_0x3dafb9[_0x7955('0x47')]=_0x29bcab;return _0x3dafb9;});}})['then'](respondWithFilteredResult(_0x5406c3,_0x3a8f15))[_0x7955('0x4e')](handleError(_0x5406c3,null));};exports[_0x7955('0xdb')]=function(_0x8101bc,_0x283c48){var _0x29d66b={'raw':!![],'where':{}};var _0x4113ab={};var _0x38a86c={'count':0x0,'rows':[]};return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x8101bc['params']['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x283c48,null))[_0x7955('0x1b')](function(_0x5e0ae6){if(_0x5e0ae6){_0x4113ab[_0x7955('0xc9')]=_['keys'](db[_0x7955('0xdc')][_0x7955('0x35')]);_0x4113ab['query']=_[_0x7955('0xca')](_0x8101bc[_0x7955('0x3f')]);_0x4113ab[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x4113ab[_0x7955('0xc9')],_0x4113ab[_0x7955('0x3f')]);_0x29d66b[_0x7955('0x45')]=_[_0x7955('0xcc')](_0x4113ab[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x8101bc[_0x7955('0x3f')][_0x7955('0xcd')]));_0x29d66b[_0x7955('0x45')]=_0x29d66b['attributes'][_0x7955('0x48')]?_0x29d66b[_0x7955('0x45')]:_0x4113ab[_0x7955('0xc9')];if(!_0x8101bc[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x29d66b[_0x7955('0x15')]=qs[_0x7955('0x15')](_0x8101bc[_0x7955('0x3f')][_0x7955('0x15')]);_0x29d66b[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x8101bc[_0x7955('0x3f')]['offset']);}_0x29d66b[_0x7955('0xce')]=qs[_0x7955('0xd5')](_0x8101bc[_0x7955('0x3f')]['sort']);_0x29d66b['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x8101bc['query'],_0x4113ab[_0x7955('0xcb')]));_0x29d66b[_0x7955('0x3e')]['UserId']=_0x5e0ae6['id'];if(_0x8101bc[_0x7955('0x3f')][_0x7955('0x2d')]){_0x29d66b[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x29d66b[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x29d66b[_0x7955('0x45')],function(_0xece686){var _0xe26934={};_0xe26934[_0xece686]={'$like':'%'+_0x8101bc[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0xe26934;})});}_0x29d66b=_['merge']({},_0x29d66b,_0x8101bc['options']);return db['ScreenRecording'][_0x7955('0x16')]({'where':_0x29d66b['where']})[_0x7955('0x1b')](function(_0x462fc0){_0x38a86c['count']=_0x462fc0;if(_0x8101bc[_0x7955('0x3f')]['includeAll']){_0x29d66b[_0x7955('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x7955('0x84')](_0x29d66b);})[_0x7955('0x1b')](function(_0x5cea6b){_0x38a86c[_0x7955('0x47')]=_0x5cea6b;return _0x38a86c;});}})['then'](respondWithFilteredResult(_0x283c48,_0x29d66b))[_0x7955('0x4e')](handleError(_0x283c48,null));};exports['getChatInteractions']=function(_0x5e3c8c,_0x1a6163){var _0xa121d4={};var _0x2abed2={};var _0x718db6;var _0x24ddd8;return db['User']['findOne']({'where':{'id':_0x5e3c8c[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x1a6163,null))['then'](function(_0x5d99ee){if(_0x5d99ee){_0x718db6=_0x5d99ee;_0x2abed2[_0x7955('0xc9')]=_['keys'](db[_0x7955('0xdd')][_0x7955('0x35')]);_0x2abed2[_0x7955('0x3f')]=_['keys'](_0x5e3c8c[_0x7955('0x3f')]);_0x2abed2[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x2abed2[_0x7955('0xc9')],_0x2abed2[_0x7955('0x3f')]);_0xa121d4[_0x7955('0x45')]=_['intersection'](_0x2abed2[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x5e3c8c[_0x7955('0x3f')][_0x7955('0xcd')]));_0xa121d4[_0x7955('0x45')]=_0xa121d4[_0x7955('0x45')][_0x7955('0x48')]?_0xa121d4[_0x7955('0x45')]:_0x2abed2[_0x7955('0xc9')];_0xa121d4[_0x7955('0xce')]=qs[_0x7955('0xd5')](_0x5e3c8c[_0x7955('0x3f')][_0x7955('0xd5')]);_0xa121d4['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x5e3c8c['query'],_0x2abed2['filters']));if(_0x5e3c8c[_0x7955('0x3f')]['filter']){_0xa121d4[_0x7955('0x3e')]=_['merge'](_0xa121d4[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0xa121d4[_0x7955('0x45')],function(_0x118082){var _0x239227={};_0x239227[_0x118082]={'$like':'%'+_0x5e3c8c[_0x7955('0x3f')]['filter']+'%'};return _0x239227;})});}_0xa121d4=_['merge']({},_0xa121d4,_0x5e3c8c[_0x7955('0x50')]);return _0x718db6[_0x7955('0xde')](_0xa121d4);}})[_0x7955('0x1b')](function(_0x3cfdf7){if(_0x3cfdf7){_0x24ddd8=_0x3cfdf7[_0x7955('0x48')];if(!_0x5e3c8c[_0x7955('0x3f')]['hasOwnProperty'](_0x7955('0xd3'))){_0xa121d4['limit']=qs[_0x7955('0x15')](_0x5e3c8c[_0x7955('0x3f')][_0x7955('0x15')]);_0xa121d4[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x5e3c8c[_0x7955('0x3f')][_0x7955('0x14')]);}return _0x718db6[_0x7955('0xde')](_0xa121d4);}})['then'](function(_0x5dd88a){if(_0x5dd88a){return _0x5dd88a?{'count':_0x24ddd8,'rows':_0x5dd88a}:null;}})[_0x7955('0x1b')](respondWithResult(_0x1a6163,null))[_0x7955('0x4e')](handleError(_0x1a6163,null));};exports[_0x7955('0xdf')]=function(_0x189fcb,_0x231d3e){var _0x29e1aa={};var _0xbf07c7={};var _0x4922b2;var _0x82d83c;return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x189fcb[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x231d3e,null))[_0x7955('0x1b')](function(_0x37028a){if(_0x37028a){_0x4922b2=_0x37028a;_0xbf07c7[_0x7955('0xc9')]=_['keys'](db[_0x7955('0xe0')][_0x7955('0x35')]);_0xbf07c7[_0x7955('0x3f')]=_[_0x7955('0xca')](_0x189fcb[_0x7955('0x3f')]);_0xbf07c7[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0xbf07c7[_0x7955('0xc9')],_0xbf07c7[_0x7955('0x3f')]);_0x29e1aa[_0x7955('0x45')]=_[_0x7955('0xcc')](_0xbf07c7[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x189fcb[_0x7955('0x3f')][_0x7955('0xcd')]));_0x29e1aa[_0x7955('0x45')]=_0x29e1aa[_0x7955('0x45')]['length']?_0x29e1aa[_0x7955('0x45')]:_0xbf07c7['model'];_0x29e1aa['order']=qs[_0x7955('0xd5')](_0x189fcb[_0x7955('0x3f')][_0x7955('0xd5')]);_0x29e1aa[_0x7955('0x3e')]=qs[_0x7955('0xcb')](_['pick'](_0x189fcb[_0x7955('0x3f')],_0xbf07c7['filters']));if(_0x189fcb[_0x7955('0x3f')][_0x7955('0x2d')]){_0x29e1aa['where']=_[_0x7955('0xd0')](_0x29e1aa['where'],{'$or':_[_0x7955('0x2f')](_0x29e1aa[_0x7955('0x45')],function(_0x1452fd){var _0x4a1375={};_0x4a1375[_0x1452fd]={'$like':'%'+_0x189fcb[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x4a1375;})});}_0x29e1aa=_[_0x7955('0xd0')]({},_0x29e1aa,_0x189fcb[_0x7955('0x50')]);return _0x4922b2[_0x7955('0xdf')](_0x29e1aa);}})[_0x7955('0x1b')](function(_0x36e087){if(_0x36e087){_0x82d83c=_0x36e087[_0x7955('0x48')];if(!_0x189fcb[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x29e1aa['limit']=qs[_0x7955('0x15')](_0x189fcb['query']['limit']);_0x29e1aa['offset']=qs[_0x7955('0x14')](_0x189fcb[_0x7955('0x3f')][_0x7955('0x14')]);}return _0x4922b2['getOpenchannelInteractions'](_0x29e1aa);}})['then'](function(_0x2a3e44){if(_0x2a3e44){return _0x2a3e44?{'count':_0x82d83c,'rows':_0x2a3e44}:null;}})['then'](respondWithResult(_0x231d3e,null))['catch'](handleError(_0x231d3e,null));};exports[_0x7955('0xe1')]=function(_0x97593,_0x10e85b){var _0x30f1f2={'raw':!![],'where':{}};var _0x4609af={};var _0x26fb54={'count':0x0,'rows':[]};return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x97593['params']['id']}})['then'](handleEntityNotFound(_0x10e85b,null))[_0x7955('0x1b')](function(_0x5e37bf){if(_0x5e37bf){_0x4609af[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_0x7955('0xe2')]['rawAttributes']);_0x4609af['query']=_[_0x7955('0xca')](_0x97593[_0x7955('0x3f')]);_0x4609af[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x4609af['model'],_0x4609af['query']);_0x30f1f2['attributes']=_['intersection'](_0x4609af['model'],qs[_0x7955('0xcd')](_0x97593[_0x7955('0x3f')][_0x7955('0xcd')]));_0x30f1f2['attributes']=_0x30f1f2[_0x7955('0x45')]['length']?_0x30f1f2[_0x7955('0x45')]:_0x4609af[_0x7955('0xc9')];if(!_0x97593[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x30f1f2[_0x7955('0x15')]=qs[_0x7955('0x15')](_0x97593['query'][_0x7955('0x15')]);_0x30f1f2[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x97593[_0x7955('0x3f')][_0x7955('0x14')]);}_0x30f1f2[_0x7955('0xce')]=qs[_0x7955('0xd5')](_0x97593[_0x7955('0x3f')][_0x7955('0xd5')]);_0x30f1f2[_0x7955('0x3e')]=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x97593[_0x7955('0x3f')],_0x4609af[_0x7955('0xcb')]));_0x30f1f2['where'][_0x7955('0xda')]=_0x5e37bf['id'];if(_0x97593[_0x7955('0x3f')]['filter']){_0x30f1f2['where']=_[_0x7955('0xd0')](_0x30f1f2[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x30f1f2[_0x7955('0x45')],function(_0x1ff84d){var _0x318b2e={};_0x318b2e[_0x1ff84d]={'$like':'%'+_0x97593[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x318b2e;})});}_0x30f1f2=_[_0x7955('0xd0')]({},_0x30f1f2,_0x97593['options']);return db[_0x7955('0xe2')][_0x7955('0x16')]({'where':_0x30f1f2[_0x7955('0x3e')]})[_0x7955('0x1b')](function(_0x572c83){_0x26fb54['count']=_0x572c83;if(_0x97593['query'][_0x7955('0x40')]){_0x30f1f2[_0x7955('0x41')]=[{'all':!![]}];}return db[_0x7955('0xe2')][_0x7955('0x84')](_0x30f1f2);})[_0x7955('0x1b')](function(_0x47bfef){_0x26fb54[_0x7955('0x47')]=_0x47bfef;return _0x26fb54;});}})[_0x7955('0x1b')](respondWithFilteredResult(_0x10e85b,_0x30f1f2))[_0x7955('0x4e')](handleError(_0x10e85b,null));};exports[_0x7955('0xe3')]=function(_0x14aa1b,_0x4dfa98){var _0x5e408a={};var _0x9e4892={};var _0xae9c88;var _0x29a769;return db['User'][_0x7955('0xc0')]({'where':{'id':_0x14aa1b[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x4dfa98,null))[_0x7955('0x1b')](function(_0x2d31ab){if(_0x2d31ab){_0xae9c88=_0x2d31ab;_0x9e4892['model']=_[_0x7955('0xca')](db[_0x7955('0xe4')]['rawAttributes']);_0x9e4892[_0x7955('0x3f')]=_['keys'](_0x14aa1b[_0x7955('0x3f')]);_0x9e4892[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x9e4892['model'],_0x9e4892[_0x7955('0x3f')]);_0x5e408a[_0x7955('0x45')]=_['intersection'](_0x9e4892[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x14aa1b[_0x7955('0x3f')][_0x7955('0xcd')]));_0x5e408a['attributes']=_0x5e408a['attributes'][_0x7955('0x48')]?_0x5e408a[_0x7955('0x45')]:_0x9e4892['model'];_0x5e408a['order']=qs[_0x7955('0xd5')](_0x14aa1b['query']['sort']);_0x5e408a[_0x7955('0x3e')]=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x14aa1b[_0x7955('0x3f')],_0x9e4892[_0x7955('0xcb')]));if(_0x14aa1b[_0x7955('0x3f')][_0x7955('0x2d')]){_0x5e408a[_0x7955('0x3e')]=_['merge'](_0x5e408a[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x5e408a[_0x7955('0x45')],function(_0x2a87d6){var _0x35d436={};_0x35d436[_0x2a87d6]={'$like':'%'+_0x14aa1b['query']['filter']+'%'};return _0x35d436;})});}_0x5e408a=_[_0x7955('0xd0')]({},_0x5e408a,_0x14aa1b[_0x7955('0x50')]);return _0xae9c88[_0x7955('0xe3')](_0x5e408a);}})[_0x7955('0x1b')](function(_0x1419be){if(_0x1419be){_0x29a769=_0x1419be[_0x7955('0x48')];if(!_0x14aa1b['query'][_0x7955('0xd2')](_0x7955('0xd3'))){_0x5e408a['limit']=qs['limit'](_0x14aa1b[_0x7955('0x3f')][_0x7955('0x15')]);_0x5e408a[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x14aa1b[_0x7955('0x3f')][_0x7955('0x14')]);}return _0xae9c88['getSmsInteractions'](_0x5e408a);}})[_0x7955('0x1b')](function(_0x17385a){if(_0x17385a){return _0x17385a?{'count':_0x29a769,'rows':_0x17385a}:null;}})[_0x7955('0x1b')](respondWithResult(_0x4dfa98,null))[_0x7955('0x4e')](handleError(_0x4dfa98,null));};exports[_0x7955('0xe5')]=function(_0x4c7843,_0xcc55fa){var _0x81a3c4={};var _0x53dc48={};var _0x37f614;var _0xb1c795;return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x4c7843[_0x7955('0x4f')]['id']}})['then'](handleEntityNotFound(_0xcc55fa,null))['then'](function(_0x3bd591){if(_0x3bd591){_0x37f614=_0x3bd591;_0x53dc48[_0x7955('0xc9')]=_[_0x7955('0xca')](db['FaxInteraction'][_0x7955('0x35')]);_0x53dc48[_0x7955('0x3f')]=_[_0x7955('0xca')](_0x4c7843[_0x7955('0x3f')]);_0x53dc48['filters']=_[_0x7955('0xcc')](_0x53dc48['model'],_0x53dc48['query']);_0x81a3c4[_0x7955('0x45')]=_['intersection'](_0x53dc48[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x4c7843[_0x7955('0x3f')]['fields']));_0x81a3c4['attributes']=_0x81a3c4[_0x7955('0x45')]['length']?_0x81a3c4['attributes']:_0x53dc48[_0x7955('0xc9')];_0x81a3c4[_0x7955('0xce')]=qs['sort'](_0x4c7843[_0x7955('0x3f')][_0x7955('0xd5')]);_0x81a3c4['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x4c7843[_0x7955('0x3f')],_0x53dc48[_0x7955('0xcb')]));if(_0x4c7843[_0x7955('0x3f')][_0x7955('0x2d')]){_0x81a3c4[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x81a3c4[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x81a3c4[_0x7955('0x45')],function(_0xc71750){var _0x2401f8={};_0x2401f8[_0xc71750]={'$like':'%'+_0x4c7843[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x2401f8;})});}_0x81a3c4=_[_0x7955('0xd0')]({},_0x81a3c4,_0x4c7843[_0x7955('0x50')]);return _0x37f614[_0x7955('0xe5')](_0x81a3c4);}})[_0x7955('0x1b')](function(_0x4aa119){if(_0x4aa119){_0xb1c795=_0x4aa119[_0x7955('0x48')];if(!_0x4c7843['query']['hasOwnProperty']('nolimit')){_0x81a3c4['limit']=qs['limit'](_0x4c7843['query'][_0x7955('0x15')]);_0x81a3c4[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x4c7843[_0x7955('0x3f')][_0x7955('0x14')]);}return _0x37f614[_0x7955('0xe5')](_0x81a3c4);}})[_0x7955('0x1b')](function(_0x18b195){if(_0x18b195){return _0x18b195?{'count':_0xb1c795,'rows':_0x18b195}:null;}})[_0x7955('0x1b')](respondWithResult(_0xcc55fa,null))['catch'](handleError(_0xcc55fa,null));};exports['getWhatsappInteractions']=function(_0x166a42,_0x31efd6){var _0x3fdbc8={};var _0x41f866={};var _0x373aea;var _0x1b3888;return db['User'][_0x7955('0xc0')]({'where':{'id':_0x166a42[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x31efd6,null))[_0x7955('0x1b')](function(_0x33eb56){if(_0x33eb56){_0x373aea=_0x33eb56;_0x41f866[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_0x7955('0xe6')][_0x7955('0x35')]);_0x41f866[_0x7955('0x3f')]=_[_0x7955('0xca')](_0x166a42[_0x7955('0x3f')]);_0x41f866[_0x7955('0xcb')]=_[_0x7955('0xcc')](_0x41f866['model'],_0x41f866[_0x7955('0x3f')]);_0x3fdbc8[_0x7955('0x45')]=_[_0x7955('0xcc')](_0x41f866[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x166a42[_0x7955('0x3f')]['fields']));_0x3fdbc8[_0x7955('0x45')]=_0x3fdbc8[_0x7955('0x45')]['length']?_0x3fdbc8[_0x7955('0x45')]:_0x41f866[_0x7955('0xc9')];_0x3fdbc8[_0x7955('0xce')]=qs['sort'](_0x166a42['query'][_0x7955('0xd5')]);_0x3fdbc8['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x166a42[_0x7955('0x3f')],_0x41f866[_0x7955('0xcb')]));if(_0x166a42[_0x7955('0x3f')][_0x7955('0x2d')]){_0x3fdbc8[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x3fdbc8[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x3fdbc8['attributes'],function(_0x255ea9){var _0x214a8f={};_0x214a8f[_0x255ea9]={'$like':'%'+_0x166a42['query'][_0x7955('0x2d')]+'%'};return _0x214a8f;})});}_0x3fdbc8=_[_0x7955('0xd0')]({},_0x3fdbc8,_0x166a42[_0x7955('0x50')]);return _0x373aea[_0x7955('0xe7')](_0x3fdbc8);}})[_0x7955('0x1b')](function(_0xab3d73){if(_0xab3d73){_0x1b3888=_0xab3d73['length'];if(!_0x166a42[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x3fdbc8[_0x7955('0x15')]=qs['limit'](_0x166a42[_0x7955('0x3f')]['limit']);_0x3fdbc8[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x166a42[_0x7955('0x3f')][_0x7955('0x14')]);}return _0x373aea[_0x7955('0xe7')](_0x3fdbc8);}})['then'](function(_0x5e8b1d){if(_0x5e8b1d){return _0x5e8b1d?{'count':_0x1b3888,'rows':_0x5e8b1d}:null;}})[_0x7955('0x1b')](respondWithResult(_0x31efd6,null))[_0x7955('0x4e')](handleError(_0x31efd6,null));};exports[_0x7955('0xe8')]=function(_0xb33b75,_0xca43e1,_0x44bbc0){var _0x48aff4;var _0x14f014;var _0x115383;var _0x20783c=!_[_0x7955('0x60')](_0xb33b75[_0x7955('0x4f')]['id'])?_0xb33b75[_0x7955('0x4f')]['id']:!_[_0x7955('0x60')](_0xb33b75[_0x7955('0x2a')]['id'])?_0xb33b75[_0x7955('0x2a')]['id']:null;return db[_0x7955('0x34')][_0x7955('0x51')]({'where':{'id':_0x20783c,'role':{'$or':[_0x7955('0x28'),_0x7955('0x2a'),_0x7955('0x23')]}},'attributes':['id',_0x7955('0x31'),_0x7955('0xe9'),_0x7955('0xea'),_0x7955('0x22'),_0x7955('0x5a'),_0x7955('0x95')]})[_0x7955('0x1b')](function(_0x48d254){if(_0x48d254){if(_0x48d254[_0x7955('0x22')]==='agent'){_0x48aff4=_0x48d254;if(_0xb33b75[_0x7955('0x55')]['interface']){_0x115383=util[_0x7955('0xc1')](_0x7955('0xeb'),_0x48aff4[_0xb33b75[_0x7955('0x55')][_0x7955('0x97')]]);}else if(_0xb33b75['body'][_0x7955('0xec')]){_0x115383=util[_0x7955('0xc1')](_0x7955('0xa1'),_0xb33b75[_0x7955('0x55')][_0x7955('0xec')]);}else{_0x115383=util[_0x7955('0xc1')](_0x7955('0xa1'),_0x48aff4['name']);}socket['to'](util['format'](_0x7955('0xed'),_0x48aff4['name']))['emit']('user:forcelogout',{'user':{'id':_0x48aff4['id'],'name':_0x48aff4[_0x7955('0x31')]},'ip':_0xb33b75['headers'][_0x7955('0xee')]||_0xb33b75['connection'][_0x7955('0xef')]||_0xb33b75[_0x7955('0xf0')][_0x7955('0xef')]||_0xb33b75[_0x7955('0xf1')][_0x7955('0xf0')][_0x7955('0xef')]});return db['UserVoiceQueueRt'][_0x7955('0x26')]({'where':{'membername':_0x48aff4[_0x7955('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x7955('0x89'))][(_0x7955('0x8a'))](_0x7955('0xf2'));}})[_0x7955('0x1b')](function(){if(_0x48aff4){return _0x48aff4['getVoiceQueues']({'raw':!![]});}})[_0x7955('0x1b')](function(_0x13610b){if(_0x48aff4){if(_0x13610b){_0x14f014=_0x13610b;if(_0x14f014[_0x7955('0x48')]){var _0x32e067=_0x14f014[_0x7955('0x2f')](function(_0x1ec8f8){var _0x3047e7={'membername':_0x48aff4['name'],'UserId':_0x48aff4['id'],'queue_name':_0x1ec8f8[_0x7955('0x31')],'VoiceQueueId':_0x1ec8f8['id'],'interface':_0x115383,'paused':_0x48aff4[_0x7955('0x95')]||![],'penalty':_0x1ec8f8[_0x7955('0xf3')]||0x0};return db[_0x7955('0xa2')][_0x7955('0xa3')](_0x3047e7);});return Promise['all'](_0x32e067);}}}})[_0x7955('0x1b')](function(){if(_0x48aff4){return db['MemberReport'][_0x7955('0x84')]({'where':{'membername':_0x48aff4[_0x7955('0x31')],'exitAt':null}});}})[_0x7955('0x1b')](function(_0x4c4823){if(_0x48aff4){var _0x15b72e=[];_0x4c4823['forEach'](function(_0x203bb1){_0x15b72e[_0x7955('0x46')](_0x203bb1[_0x7955('0x54')]({'exitAt':moment()[_0x7955('0xc1')](_0x7955('0xf4'))}));});return Promise['all'](_0x15b72e);}})['then'](function(){if(_0x48aff4){var _0x1c942c=[];var _0x3f0376=[];var _0x266c4c=utils[_0x7955('0xf5')]();var _0x20ab67={'membername':_0x48aff4[_0x7955('0x31')],'interface':_0x115383,'enterAt':moment()[_0x7955('0xc1')](_0x7955('0xf4')),'role':_0x48aff4[_0x7955('0x22')],'internal':_0x48aff4['internal']};_0x266c4c[_0x7955('0xf6')](function(_0x54391b){_0x1c942c[_0x7955('0x46')](_[_0x7955('0xd0')]({'channel':_0x54391b,'type':_0x7955('0xf7'),'data1':_0xb33b75[_0x7955('0x55')][_0x7955('0xf8')],'data2':_0x115383},_0x20ab67));if(_0x48aff4[_0x7955('0x95')]){_0x3f0376[_0x7955('0x46')](_['merge']({'channel':_0x54391b,'type':_0x7955('0xf9'),'data1':_0x7955('0xfa')},_0x20ab67));}});return db[_0x7955('0xfb')][_0x7955('0xfc')](_0x1c942c[_0x7955('0xbf')](_0x3f0376),{'individualHooks':!![]});}})[_0x7955('0x1b')](function(){if(_0x48aff4){return _0x48aff4[_0x7955('0x54')]({'online':!![],'lastLoginAt':moment()['format'](_0x7955('0xf4')),'voicePause':_0x48aff4[_0x7955('0x95')]||![],'mailPause':_0x48aff4[_0x7955('0x95')]||![],'chatPause':_0x48aff4[_0x7955('0x95')]||![],'faxPause':_0x48aff4[_0x7955('0x95')]||![],'smsPause':_0x48aff4[_0x7955('0x95')]||![],'openchannelPause':_0x48aff4['loginInPause']||![],'whatsappPause':_0x48aff4[_0x7955('0x95')]||![],'pauseType':_0x48aff4[_0x7955('0x95')]?'LOGININPAUSE':null,'interface':_0x115383,'lastPauseAt':moment()[_0x7955('0xc1')](_0x7955('0xf4'))});}})[_0x7955('0x1b')](function(_0x474f0a){if(_0xb33b75['isMiddleware']){return _0x44bbc0();}else{return Promise['resolve'](_0x474f0a)['then'](respondWithResult(_0xca43e1,null));}})[_0x7955('0x4e')](handleError(_0xca43e1,null));};exports[_0x7955('0xfd')]=function(_0x2c16d6,_0x2682fe){var _0x50abb1;return db[_0x7955('0x34')][_0x7955('0x51')]({'where':{'id':_0x2c16d6[_0x7955('0x4f')]['id'],'role':_0x7955('0x23')},'attributes':['id',_0x7955('0x31'),_0x7955('0x22')]})[_0x7955('0x1b')](handleEntityNotFound(_0x2682fe,null))[_0x7955('0x1b')](function(_0x2a73d0){if(_0x2a73d0){_0x50abb1=_0x2a73d0;return db[_0x7955('0xa2')][_0x7955('0x26')]({'where':{'membername':_0x50abb1[_0x7955('0x31')]},'individualHooks':!![]});}})[_0x7955('0x1b')](function(){return db['MemberReport'][_0x7955('0x84')]({'where':{'membername':_0x50abb1['name'],'exitAt':null}});})[_0x7955('0x1b')](function(_0x356e27){var _0x475db3=[];_0x356e27['forEach'](function(_0x2300f0){_0x475db3['push'](_0x2300f0[_0x7955('0x54')]({'exitAt':moment()['format'](_0x7955('0xf4'))}));});return Promise['all'](_0x475db3);})[_0x7955('0x1b')](function(){return _0x50abb1['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x2682fe,null))[_0x7955('0x4e')](handleError(_0x2682fe,null));};exports[_0x7955('0xfe')]=function(_0x1e1a9a,_0x39c3a7){var _0x30efb3;return db['UserVoiceQueueRt'][_0x7955('0x54')]({'paused':0x1},{'where':{'UserId':_0x1e1a9a[_0x7955('0x4f')]['id']},'individualHooks':!![]})[_0x7955('0x1b')](function(){return db[_0x7955('0x34')][_0x7955('0x51')]({'where':{'id':_0x1e1a9a[_0x7955('0x4f')]['id'],'role':_0x7955('0x23')},'attributes':['id','name','role',_0x7955('0x5a'),'interface',_0x7955('0x94')]});})[_0x7955('0x1b')](handleEntityNotFound(_0x39c3a7,null))['then'](function(_0x93076d){if(_0x93076d){_0x30efb3=_0x93076d;return respondWithRpcPromise(_0x7955('0xff'),'pause',{'id':_0x30efb3['id'],'name':_0x30efb3[_0x7955('0x31')],'pause':!![]});}})[_0x7955('0x1b')](function(){if(_0x30efb3){return db[_0x7955('0xfb')][_0x7955('0x84')]({'where':{'membername':_0x30efb3[_0x7955('0x31')],'type':_0x7955('0xf9'),'exitAt':null}});}})[_0x7955('0x1b')](function(_0x3f6871){if(_0x3f6871[_0x7955('0x48')]){var _0x2ce3fb=moment()['format'](_0x7955('0xf4'));for(var _0x4bf1dd=0x0,_0x185c83=_0x3f6871['length'];_0x4bf1dd<_0x185c83;_0x4bf1dd++){_0x3f6871[_0x4bf1dd][_0x7955('0x100')]({'exitAt':_0x2ce3fb});}}})[_0x7955('0x1b')](function(){var _0x52bf08=[];var _0x5f1f42=utils[_0x7955('0xf5')]();_0x5f1f42['forEach'](function(_0x3310f3){_0x52bf08['push']({'channel':_0x3310f3,'membername':_0x30efb3[_0x7955('0x31')],'interface':_[_0x7955('0x60')](_0x30efb3[_0x7955('0x97')])?util[_0x7955('0xc1')](_0x7955('0xa1'),_0x30efb3['name']):_0x30efb3[_0x7955('0x97')],'type':_0x7955('0xf9'),'enterAt':moment()[_0x7955('0xc1')](_0x7955('0xf4')),'data1':_0x1e1a9a[_0x7955('0x55')][_0x7955('0x36')]||_0x7955('0x101'),'role':_0x30efb3['role'],'internal':_0x30efb3[_0x7955('0x5a')]});});return db[_0x7955('0xfb')][_0x7955('0xfc')](_0x52bf08,{'individualHooks':!![]});})[_0x7955('0x1b')](function(){return _0x30efb3[_0x7955('0x54')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1e1a9a[_0x7955('0x55')][_0x7955('0x36')]||_0x7955('0x101'),'lastPauseAt':moment()[_0x7955('0xc1')](_0x7955('0xf4'))});})['then'](respondWithResult(_0x39c3a7,null))['catch'](handleError(_0x39c3a7,null));};exports['unpause']=function(_0x274cc7,_0x5c448f){if(_0x274cc7[_0x7955('0x55')][_0x7955('0x93')]&&!utils[_0x7955('0xa5')](_0x274cc7['body'][_0x7955('0x93')])){throw new APIBadRequestError(util[_0x7955('0xc1')](_0x7955('0x102'),_0x274cc7['body'][_0x7955('0x93')]));}return db[_0x7955('0x34')][_0x7955('0x51')]({'where':{'id':_0x274cc7['params']['id']},'attributes':['id',_0x7955('0x31'),_0x7955('0x22'),_0x7955('0x5a'),_0x7955('0x97'),'online',_0x7955('0x96'),_0x7955('0x103'),_0x7955('0x104'),_0x7955('0x105'),'openchannelPause',_0x7955('0x106'),'whatsappPause',_0x7955('0x107'),_0x7955('0x108')]})['then'](function(_0x5acb64){if(!_0x5acb64){throw new APINotFoundError(util['format'](_0x7955('0xc2'),_0x274cc7['params']['id']));}return _0x5acb64['unpause'](_0x274cc7[_0x7955('0x55')]['channel']);})[_0x7955('0x1b')](respondWithResult(_0x5c448f,null))[_0x7955('0x4e')](APIHandleError(_0x5c448f));};exports[_0x7955('0x109')]=function(_0x7d06e4,_0x1eb5d2){var _0xe2c14c={};var _0xc9a20d={};var _0x2716b4;var _0x3bde97;return db['User'][_0x7955('0xc0')]({'where':{'id':_0x7d06e4[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x1eb5d2,null))[_0x7955('0x1b')](function(_0x3810ad){if(_0x3810ad){_0x2716b4=_0x3810ad;_0xc9a20d['model']=_['keys'](db[_0x7955('0x10a')][_0x7955('0x35')]);_0xc9a20d['query']=_['keys'](_0x7d06e4['query']);_0xc9a20d['filters']=_[_0x7955('0xcc')](_0xc9a20d[_0x7955('0xc9')],_0xc9a20d[_0x7955('0x3f')]);_0xe2c14c['attributes']=_[_0x7955('0xcc')](_0xc9a20d[_0x7955('0xc9')],qs['fields'](_0x7d06e4['query']['fields']));_0xe2c14c[_0x7955('0x45')]=_0xe2c14c[_0x7955('0x45')][_0x7955('0x48')]?_0xe2c14c[_0x7955('0x45')]:_0xc9a20d[_0x7955('0xc9')];_0xe2c14c['order']=qs[_0x7955('0xd5')](_0x7d06e4[_0x7955('0x3f')][_0x7955('0xd5')]);_0xe2c14c['where']=qs['filters'](_[_0x7955('0xcf')](_0x7d06e4[_0x7955('0x3f')],_0xc9a20d[_0x7955('0xcb')]));if(_0x7d06e4['query'][_0x7955('0x2d')]){_0xe2c14c[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0xe2c14c[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0xe2c14c[_0x7955('0x45')],function(_0x5971bf){var _0x94c773={};_0x94c773[_0x5971bf]={'$like':'%'+_0x7d06e4[_0x7955('0x3f')]['filter']+'%'};return _0x94c773;})});}_0xe2c14c=_['merge']({},_0xe2c14c,_0x7d06e4['options']);return _0x2716b4[_0x7955('0x109')](_0xe2c14c);}})[_0x7955('0x1b')](function(_0x32bf6d){if(_0x32bf6d){_0x3bde97=_0x32bf6d[_0x7955('0x48')];if(!_0x7d06e4[_0x7955('0x3f')]['hasOwnProperty'](_0x7955('0xd3'))){_0xe2c14c['limit']=qs[_0x7955('0x15')](_0x7d06e4[_0x7955('0x3f')][_0x7955('0x15')]);_0xe2c14c['offset']=qs[_0x7955('0x14')](_0x7d06e4[_0x7955('0x3f')][_0x7955('0x14')]);}return _0x2716b4['getTeams'](_0xe2c14c);}})[_0x7955('0x1b')](function(_0x4a3e34){if(_0x4a3e34){return _0x4a3e34?{'count':_0x3bde97,'rows':_0x4a3e34}:null;}})['then'](respondWithResult(_0x1eb5d2,null))[_0x7955('0x4e')](handleError(_0x1eb5d2,null));};exports['addTeams']=function(_0x1af6a0,_0x48a298){var _0x53824b=_0x1af6a0[_0x7955('0x4f')]['id'];var _0x28ad13=_0x1af6a0[_0x7955('0x55')]?_0x1af6a0['body'][_0x7955('0x58')]:null;var _0x5d08cc=[];return Promise[_0x7955('0x10b')]()['then'](function(){if(!_0x28ad13)throw new APIBadRequestError(_0x7955('0x10c'));})[_0x7955('0x1b')](function(){return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x53824b}});})[_0x7955('0x1b')](function(_0x4368d7){if(!_0x4368d7)throw new APINotFoundError(util['format'](_0x7955('0xc2'),_0x1af6a0[_0x7955('0x4f')]['id']));return db[_0x7955('0x62')]['transaction'](function(_0x387752){return _0x4368d7[_0x7955('0x10d')](_0x28ad13,{'transaction':_0x387752})['then'](function(){return db['Team'][_0x7955('0x84')]({'where':{'id':{'$in':_0x28ad13}}});})[_0x7955('0x1b')](function(_0xd847f4){var _0x2dce42=_[_0x7955('0x2f')](_0xd847f4,function(_0x247071){return _0x247071[_0x7955('0x10e')]();});return Promise['all'](_0x2dce42);})[_0x7955('0x1b')](function(_0x56dc4a){_0x5d08cc=_['flattenDeep'](_0x56dc4a);var _0x2416dd=_[_0x7955('0x2f')](_0x5d08cc,function(_0x4c9d26){return _0x4c9d26['addAgent'](_0x4368d7['id'],{'transaction':_0x387752});});return Promise['all'](_0x2416dd);})[_0x7955('0x1b')](function(){if(!_0x4368d7[_0x7955('0x94')])return;var _0xd575f5=_[_0x7955('0x2d')](_0x5d08cc,function(_0x187db3){return _0x187db3[_0x7955('0x10f')](_0x7955('0x93'))===_0x7955('0x110');});var _0x3bc21f=_['map'](_0xd575f5,function(_0x389d90){return db[_0x7955('0xa2')][_0x7955('0xa3')]({'membername':_0x4368d7[_0x7955('0x31')],'UserId':_0x4368d7['id'],'queue_name':_0x389d90['name'],'VoiceQueueId':_0x389d90['id'],'interface':_[_0x7955('0x60')](_0x4368d7[_0x7955('0x97')])?util['format']('SIP/%s',_0x4368d7[_0x7955('0x31')]):_0x4368d7[_0x7955('0x97')],'paused':_0x4368d7[_0x7955('0x96')]||![],'penalty':_0x4368d7[_0x7955('0x9c')]},{'transaction':_0x387752});});return Promise['all'](_0x3bc21f);})[_0x7955('0x1b')](function(){return db['TeamVoicePrefix'][_0x7955('0x84')]({'where':{'teamId':{'$in':_0x28ad13}}});})[_0x7955('0x1b')](function(_0x1baa95){var _0x3c1033=_['map'](_0x1baa95,function(_0x5b1074){return db['UserVoicePrefix'][_0x7955('0x7e')]({'UserId':_0x4368d7['id'],'VoicePrefixId':_0x5b1074[_0x7955('0x111')]},{'transaction':_0x387752});});return Promise[_0x7955('0x4d')](_0x3c1033);});});})[_0x7955('0x1b')](function(){for(var _0x529a84=0x0;_0x529a84<_0x5d08cc[_0x7955('0x48')];_0x529a84++){var _0x45640e=_0x5d08cc[_0x529a84][_0x7955('0x10f')](_0x7955('0x93'));var _0x1903b0=_0x45640e+_0x7955('0x9e');socket['emit'](_0x7955('0x2a')+_0x45640e+_0x7955('0x9f'),{'UserId':_0x53824b,['queueField']:_0x5d08cc[_0x529a84]['id']});}})['then'](respondWithStatusCode(_0x48a298,null))[_0x7955('0x4e')](APIHandleError(_0x48a298));};exports[_0x7955('0x112')]=function(_0x3b6b1a,_0x1c7b59){var _0x95b694=_0x3b6b1a[_0x7955('0x4f')]['id'];var _0x49e5cb=null;if(_0x3b6b1a[_0x7955('0x3f')][_0x7955('0x58')]){_0x49e5cb=_['isArray'](_0x3b6b1a[_0x7955('0x3f')][_0x7955('0x58')])?_0x3b6b1a[_0x7955('0x3f')]['ids']:[_0x3b6b1a['query'][_0x7955('0x58')]];}var _0x3eab21=[];return Promise['resolve']()[_0x7955('0x1b')](function(){if(!_0x49e5cb)throw new APIBadRequestError(_0x7955('0x113'));})['then'](function(){return db[_0x7955('0x34')]['findOne']({'where':{'id':_0x95b694}});})[_0x7955('0x1b')](function(_0xe55c77){if(!_0xe55c77)throw new APINotFoundError(util[_0x7955('0xc1')](_0x7955('0xc2'),_0x3b6b1a[_0x7955('0x4f')]['id']));return db[_0x7955('0x62')][_0x7955('0x114')](function(_0x5d2337){return _0xe55c77[_0x7955('0x112')](_0x49e5cb,{'transaction':_0x5d2337})[_0x7955('0x1b')](function(){return db[_0x7955('0x10a')][_0x7955('0x84')]({'where':{'id':{'$in':_0x49e5cb}}});})[_0x7955('0x1b')](function(_0x275fe8){var _0x5a279c=_[_0x7955('0x2f')](_0x275fe8,function(_0x537027){return _0x537027['getAssociatedQueues']();});return Promise[_0x7955('0x4d')](_0x5a279c);})[_0x7955('0x1b')](function(_0x1e14b2){_0x3eab21=_['flattenDeep'](_0x1e14b2);var _0x2a4895=_[_0x7955('0x2f')](_0x3eab21,function(_0xdee39d){return _0xdee39d[_0x7955('0x115')](_0xe55c77['id'],{'transaction':_0x5d2337});});return Promise['all'](_0x2a4895);})[_0x7955('0x1b')](function(){if(!_0xe55c77['online'])return;var _0x324375=_[_0x7955('0x2d')](_0x3eab21,function(_0x51d7be){return _0x51d7be['getDataValue'](_0x7955('0x93'))===_0x7955('0x110');});var _0x438a75=_[_0x7955('0x2f')](_0x324375,function(_0x3ae535){return db[_0x7955('0xa2')][_0x7955('0x26')]({'where':{'VoiceQueueId':_0x3ae535['id'],'UserId':_0xe55c77['id']},'transaction':_0x5d2337});});return Promise[_0x7955('0x4d')](_0x438a75);})[_0x7955('0x1b')](function(){return db['TeamVoicePrefix'][_0x7955('0x84')]({'where':{'teamId':{'$in':_0x49e5cb}}});})['then'](function(_0x3c9ef5){var _0x5ae2f1=_[_0x7955('0x2f')](_0x3c9ef5,function(_0x4ee355){return db[_0x7955('0x116')][_0x7955('0x26')]({'where':{'UserId':_0xe55c77['id'],'VoicePrefixId':_0x4ee355[_0x7955('0x111')]}},{'transaction':_0x5d2337});});return Promise['all'](_0x5ae2f1);});});})[_0x7955('0x1b')](function(){for(var _0x10be7f=0x0;_0x10be7f<_0x3eab21[_0x7955('0x48')];_0x10be7f++){var _0x2d3003=_0x3eab21[_0x10be7f]['getDataValue'](_0x7955('0x93'));var _0xc51306=_0x2d3003+_0x7955('0x9e');socket[_0x7955('0x24')](_0x7955('0x2a')+_0x2d3003+_0x7955('0xa8'),{'UserId':_0x95b694,['queueField']:_0x3eab21[_0x10be7f]['id']});}})['then'](respondWithStatusCode(_0x1c7b59,null))[_0x7955('0x4e')](APIHandleError(_0x1c7b59));};exports[_0x7955('0x117')]=function(_0x48ce68,_0x3d0f05){var _0x32168a={};var _0x495aca={};var _0x238ac6;var _0x2cc400;return db[_0x7955('0x34')][_0x7955('0xc0')]({'where':{'id':_0x48ce68['params']['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x3d0f05,null))[_0x7955('0x1b')](function(_0x246752){if(_0x246752){_0x238ac6=_0x246752;_0x495aca[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_0x7955('0xc3')][_0x7955('0x35')]);_0x495aca[_0x7955('0x3f')]=_['keys'](_0x48ce68[_0x7955('0x3f')]);_0x495aca['filters']=_[_0x7955('0xcc')](_0x495aca[_0x7955('0xc9')],_0x495aca['query']);_0x32168a['attributes']=_[_0x7955('0xcc')](_0x495aca[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x48ce68[_0x7955('0x3f')][_0x7955('0xcd')]));_0x32168a[_0x7955('0x45')]=_0x32168a[_0x7955('0x45')]['length']?_0x32168a[_0x7955('0x45')]:_0x495aca[_0x7955('0xc9')];_0x32168a[_0x7955('0xce')]=qs['sort'](_0x48ce68['query'][_0x7955('0xd5')]);_0x32168a[_0x7955('0x3e')]=qs[_0x7955('0xcb')](_['pick'](_0x48ce68[_0x7955('0x3f')],_0x495aca[_0x7955('0xcb')]));if(_0x48ce68['query'][_0x7955('0x2d')]){_0x32168a[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x32168a[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x32168a[_0x7955('0x45')],function(_0x29dd54){var _0x273012={};_0x273012[_0x29dd54]={'$like':'%'+_0x48ce68[_0x7955('0x3f')][_0x7955('0x2d')]+'%'};return _0x273012;})});}_0x32168a=_[_0x7955('0xd0')]({},_0x32168a,_0x48ce68[_0x7955('0x50')]);return _0x238ac6[_0x7955('0x117')](_0x32168a);}})['then'](function(_0x169eea){if(_0x169eea){_0x2cc400=_0x169eea[_0x7955('0x48')];if(!_0x48ce68[_0x7955('0x3f')][_0x7955('0xd2')](_0x7955('0xd3'))){_0x32168a[_0x7955('0x15')]=qs[_0x7955('0x15')](_0x48ce68[_0x7955('0x3f')][_0x7955('0x15')]);_0x32168a[_0x7955('0x14')]=qs[_0x7955('0x14')](_0x48ce68[_0x7955('0x3f')][_0x7955('0x14')]);}return _0x238ac6[_0x7955('0x117')](_0x32168a);}})[_0x7955('0x1b')](function(_0xca787c){if(_0xca787c){return _0xca787c?{'count':_0x2cc400,'rows':_0xca787c}:null;}})[_0x7955('0x1b')](respondWithResult(_0x3d0f05,null))[_0x7955('0x4e')](handleError(_0x3d0f05,null));};exports[_0x7955('0x118')]=function(_0x99525d,_0x1efc32){var _0x42bb30={};var _0xbe4982={};var _0x3f2143;return db[_0x7955('0x34')]['findOne']({'where':{'id':_0x99525d[_0x7955('0x4f')]['id']}})[_0x7955('0x1b')](handleEntityNotFound(_0x1efc32,null))[_0x7955('0x1b')](function(_0x4e178b){if(_0x4e178b){_0x3f2143=_0x4e178b;_0xbe4982[_0x7955('0xc9')]=_[_0x7955('0xca')](db[_0x7955('0x34')][_0x7955('0x35')]);_0xbe4982['query']=_[_0x7955('0xca')](_0x99525d[_0x7955('0x3f')]);_0xbe4982['filters']=_['intersection'](_0xbe4982[_0x7955('0xc9')],_0xbe4982[_0x7955('0x3f')]);_0x42bb30['attributes']=_[_0x7955('0xcc')](_0xbe4982[_0x7955('0xc9')],qs[_0x7955('0xcd')](_0x99525d['query'][_0x7955('0xcd')]));_0x42bb30['attributes']=_0x42bb30[_0x7955('0x45')]['length']?_0x42bb30[_0x7955('0x45')]:_0xbe4982['model'];_0x42bb30['order']=qs[_0x7955('0xd5')](_0x99525d[_0x7955('0x3f')]['sort']);_0x42bb30['where']=qs[_0x7955('0xcb')](_[_0x7955('0xcf')](_0x99525d[_0x7955('0x3f')],_0xbe4982['filters']));if(_0x99525d[_0x7955('0x3f')]['filter']){_0x42bb30[_0x7955('0x3e')]=_[_0x7955('0xd0')](_0x42bb30[_0x7955('0x3e')],{'$or':_[_0x7955('0x2f')](_0x42bb30[_0x7955('0x45')],function(_0x17b9aa){var _0x1d957d={};_0x1d957d[_0x17b9aa]={'$like':'%'+_0x99525d[_0x7955('0x3f')]['filter']+'%'};return _0x1d957d;})});}_0x42bb30[_0x7955('0xc9')]=db[_0x7955('0x34')];_0x42bb30['as']=_0x7955('0x2b');_0x42bb30=_['merge']({},_0x42bb30,_0x99525d[_0x7955('0x50')]);return _0x3f2143[_0x7955('0x119')]({'include':[_0x42bb30]});}})[_0x7955('0x1b')](function(_0x324eb6){if(_0x324eb6){var _0x24a8eb={},_0xc0f8ed=[];for(var _0x283a48=0x0;_0x283a48<_0x324eb6['length'];_0x283a48+=0x1){for(var _0x3bc6bb=0x0,_0x1d0b1a;_0x3bc6bb<_0x324eb6[_0x283a48]['Agents']['length'];_0x3bc6bb+=0x1){_0x1d0b1a=_0x324eb6[_0x283a48][_0x7955('0x2b')][_0x3bc6bb][_0x7955('0x27')]({'plain':!![]});_0x24a8eb[_0x1d0b1a['id']]=_0x1d0b1a;}}_0x24a8eb=_[_0x7955('0x11a')](_0x24a8eb);for(var _0x1d9d4e=qs[_0x7955('0x14')](_0x99525d[_0x7955('0x3f')][_0x7955('0x14')]);_0x1d9d4e<_0x24a8eb['length']&&_0xc0f8ed[_0x7955('0x48')]=_0x5a6613){_0x1a884a=_0x5a6613;_0x599c5a=0xc8;}else{_0x599c5a=0xce;}_0x139a43[_0x1499('0x17')](_0x599c5a);return _0x139a43[_0x1499('0x1d')](_0x1499('0x1e'),_0x2c6e2b+'-'+_0x1a884a+'/'+_0x5a6613)[_0x1499('0x18')](_0x2279f8);}return null;};}function respondWithRpcPromise(_0xca23ff,_0x42271b,_0x116d1f,_0x934256){return new Promise(function(_0x4eee57,_0xf5769e){var _0x1e9e08=_0x934256||amiClient;return _0x1e9e08[_0x1499('0x1f')](_0xca23ff,_0x116d1f)[_0x1499('0x20')](function(_0x288900){logger[_0x1499('0x21')](_0x1499('0x22'),_0x42271b,_0x1499('0x23'));logger[_0x1499('0x24')](_0x1499('0x25'),_0x42271b,_0x1499('0x23'),JSON[_0x1499('0x26')](_0x288900));if(_0x288900['error']){if(_0x288900[_0x1499('0x27')][_0x1499('0x28')]===0x1f4){logger['error'](_0x1499('0x22'),_0x42271b,_0x288900[_0x1499('0x27')]['message']);return _0xf5769e(_0x288900['error'][_0x1499('0x29')]);}logger[_0x1499('0x27')]('User,\x20%s,\x20%s',_0x42271b,_0x288900[_0x1499('0x27')][_0x1499('0x29')]);return _0x4eee57(_0x288900['error'][_0x1499('0x29')]);}else{logger[_0x1499('0x21')](_0x1499('0x22'),_0x42271b,_0x1499('0x23'));_0x4eee57(_0x288900[_0x1499('0x2a')][_0x1499('0x29')]);}})[_0x1499('0x2b')](function(_0xc7bbb4){logger[_0x1499('0x27')](_0x1499('0x22'),_0x42271b,_0xc7bbb4);_0xf5769e(_0xc7bbb4);});});}function saveUpdates(_0x4d92f8){return function(_0x4e1ac9){if(_0x4e1ac9){return _0x4e1ac9['update'](_0x4d92f8)['then'](function(_0x34d8c1){if(_0x34d8c1[_0x1499('0x2c')]===_0x1499('0x2d')){socket[_0x1499('0x2e')](_0x1499('0x2f')+_0x34d8c1['id'],_0x34d8c1);}return _0x34d8c1;});}return null;};}function removeEntity(_0x5ae291,_0x916dab){return function(_0x1726ea){if(_0x1726ea){return _0x1726ea[_0x1499('0x30')]({'transaction':_0x916dab})[_0x1499('0x20')](function(){var _0x406389=_0x1726ea['get']({'plain':!![]});if(_0x406389[_0x1499('0x2c')]===_0x1499('0x31'))return;var _0x3d9f87=[{'name':_0x1499('0x32'),'value':_0x1499('0x33'),'ignore':!![]},{'name':_0x1499('0x34'),'value':'agent','ignore':![]},{'name':_0x1499('0x35'),'value':_0x1499('0x36'),'ignore':![]}];var _0x55f728=_(_0x3d9f87)[_0x1499('0x37')](_0x1499('0x38'))['map'](_0x1499('0x39'))[_0x1499('0x39')]();if(_[_0x1499('0x3a')](_0x55f728,_0x406389[_0x1499('0x2c')])){return;}var _0x2b9e32=_[_0x1499('0x3b')](_0x3d9f87,[_0x1499('0x39'),_0x406389['role']])[_0x1499('0x3c')];return db[_0x1499('0x3d')]['destroy']({'where':{'type':_0x2b9e32,'resourceId':_0x406389['id']},'transaction':_0x916dab})[_0x1499('0x20')](function(){return _0x1726ea;});})['then'](function(){_0x5ae291[_0x1499('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf0afba){return function(_0x52d584){if(!_0x52d584){_0xf0afba[_0x1499('0x3e')](0x194);}return _0x52d584;};}function handleError(_0x82a70,_0x1af103){_0x1af103=_0x1af103||0x1f4;return function(_0x3d92e1){logger[_0x1499('0x27')](_0x3d92e1[_0x1499('0x3f')]);if(_0x3d92e1[_0x1499('0x3c')]){delete _0x3d92e1[_0x1499('0x3c')];}_0x82a70['status'](_0x1af103)['send'](_0x3d92e1);};}function getUserAttributes(){return _(db[_0x1499('0x40')][_0x1499('0x41')])[_0x1499('0x42')](function(_0xdb4e7e){return{'name':_0xdb4e7e[_0x1499('0x43')],'type':_0xdb4e7e[_0x1499('0x44')][_0x1499('0x45')]};})[_0x1499('0x37')](function(_0x219bf8){return!['password',_0x1499('0x46'),_0x1499('0x47'),_0x1499('0x48'),_0x1499('0x49'),'md5secret'][_0x1499('0x3a')](_0x219bf8[_0x1499('0x3c')]);})[_0x1499('0x39')]();}exports[_0x1499('0x4a')]=function(_0x471fd6,_0x27fe40){var _0x5edb4f={},_0x2afe69={'count':0x0,'rows':[]};var _0x36128a=getUserAttributes();_0x5edb4f=qs[_0x1499('0x4b')](_0x36128a,_0x471fd6);var _0x2f5a16={'where':_0x5edb4f['where']};return db['User']['count'](_0x2f5a16)[_0x1499('0x20')](function(_0x1864ef){_0x2afe69['count']=_0x1864ef;if(_0x471fd6[_0x1499('0x4c')][_0x1499('0x4d')]){_0x5edb4f[_0x1499('0x4e')]=[{'all':!![]}];}if(_0x471fd6[_0x1499('0x4c')][_0x1499('0x4f')]===_0x1499('0x50')){_0x5edb4f[_0x1499('0x4e')]=[{'model':db[_0x1499('0x51')],'as':_0x1499('0x4f')}];}if(!_[_0x1499('0x3a')](_0x5edb4f[_0x1499('0x52')],'id')){_0x5edb4f[_0x1499('0x52')][_0x1499('0x53')]('id');}return db[_0x1499('0x40')][_0x1499('0x54')](_0x5edb4f);})['then'](function(_0x5a825f){_0x2afe69[_0x1499('0x55')]=_0x5a825f;if(_0x471fd6[_0x1499('0x4c')][_0x1499('0x56')]===_0x1499('0x50')){var _0x192470=[];for(var _0x5ae625=0x0;_0x5ae625<_0x2afe69[_0x1499('0x55')][_0x1499('0x57')];_0x5ae625++){_0x192470[_0x1499('0x53')](get_open_tabs('chat',_0x2afe69[_0x1499('0x55')][_0x5ae625][_0x1499('0x58')]));_0x192470['push'](get_open_tabs(_0x1499('0x59'),_0x2afe69[_0x1499('0x55')][_0x5ae625][_0x1499('0x58')]));_0x192470['push'](get_open_tabs(_0x1499('0x5a'),_0x2afe69[_0x1499('0x55')][_0x5ae625][_0x1499('0x58')]));_0x192470[_0x1499('0x53')](get_open_tabs(_0x1499('0x5b'),_0x2afe69[_0x1499('0x55')][_0x5ae625][_0x1499('0x58')]));_0x192470[_0x1499('0x53')](get_open_tabs(_0x1499('0x5c'),_0x2afe69['rows'][_0x5ae625]['dataValues']));_0x192470[_0x1499('0x53')](get_open_tabs(_0x1499('0x5d'),_0x2afe69[_0x1499('0x55')][_0x5ae625][_0x1499('0x58')]));}return Promise['all'](_0x192470)[_0x1499('0x20')](function(){return _0x2afe69;});}else{return _0x2afe69;}})[_0x1499('0x20')](respondWithFilteredResult(_0x27fe40,_0x5edb4f))[_0x1499('0x2b')](handleError(_0x27fe40,null));};exports[_0x1499('0x5e')]=function(_0x5c0257,_0x241055){var _0x2416b7=getUserAttributes();_0x5c0257[_0x1499('0x4c')]['id']=_0x5c0257['params']['id'];var _0x557323=qs['getOptions'](_0x2416b7,_0x5c0257);if(_0x5c0257[_0x1499('0x4c')][_0x1499('0x4d')]){_0x557323[_0x1499('0x4e')]=[{'all':!![]}];}if(_0x5c0257['query'][_0x1499('0x4f')]===_0x1499('0x50')){_0x557323['include']=[{'model':db['UserSetting'],'as':_0x1499('0x4f')}];}_0x557323=_[_0x1499('0x5f')]({},_0x557323,_0x5c0257[_0x1499('0x60')]);if(!_[_0x1499('0x3a')](_0x557323[_0x1499('0x52')],'id')){_0x557323['attributes'][_0x1499('0x53')]('id');}return db['User'][_0x1499('0x3b')](_0x557323)[_0x1499('0x20')](handleEntityNotFound(_0x241055,null))[_0x1499('0x20')](function(_0x4bd5cf){var _0x4404bf=[];values=_0x4bd5cf;if(_0x5c0257[_0x1499('0x4c')]['openTabs']===_0x1499('0x50')){_0x4404bf[_0x1499('0x53')](get_open_tabs('chat',_0x4bd5cf[_0x1499('0x58')]));_0x4404bf[_0x1499('0x53')](get_open_tabs('sms',_0x4bd5cf[_0x1499('0x58')]));_0x4404bf[_0x1499('0x53')](get_open_tabs(_0x1499('0x5c'),_0x4bd5cf[_0x1499('0x58')]));_0x4404bf[_0x1499('0x53')](get_open_tabs('whatsapp',_0x4bd5cf[_0x1499('0x58')]));_0x4404bf['push'](get_open_tabs('fax',_0x4bd5cf[_0x1499('0x58')]));_0x4404bf[_0x1499('0x53')](get_open_tabs('mail',_0x4bd5cf[_0x1499('0x58')]));return Promise[_0x1499('0x61')](_0x4404bf);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x241055,null))[_0x1499('0x2b')](handleError(_0x241055,null));};exports[_0x1499('0x62')]=function(_0x1cc48a,_0x1f37df){if(_0x1cc48a[_0x1499('0x63')]['id']){delete _0x1cc48a[_0x1499('0x63')]['id'];}delete _0x1cc48a[_0x1499('0x63')][_0x1499('0x2c')];return db['User'][_0x1499('0x3b')]({'where':{'id':_0x1cc48a[_0x1499('0x64')]['id']}})['then'](handleEntityNotFound(_0x1f37df,null))[_0x1499('0x20')](saveUpdates(_0x1cc48a['body'],null))[_0x1499('0x20')](respondWithResult(_0x1f37df,null))[_0x1499('0x2b')](handleError(_0x1f37df,null));};exports[_0x1499('0x65')]=function(_0x468c2f,_0x42d47d){return db[_0x1499('0x40')]['describe']()['then'](respondWithResult(_0x42d47d,null))['catch'](handleError(_0x42d47d,null));};exports[_0x1499('0x66')]=function(_0x2e05e7,_0x554f72){return db['User'][_0x1499('0x3b')]({'where':{'id':_0x2e05e7[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x554f72,null))[_0x1499('0x20')](function(_0x1e3c29){if(_0x1e3c29){return _0x1e3c29[_0x1499('0x66')](_0x2e05e7[_0x1499('0x63')][_0x1499('0x67')],_[_0x1499('0x68')](_0x2e05e7['body'],[_0x1499('0x67'),'id'])||{});}})[_0x1499('0x20')](respondWithResult(_0x554f72,null))[_0x1499('0x2b')](handleError(_0x554f72,null));};function validateUser(_0x54f368){return new Promise(function(_0x245b51,_0x2436ec){if(_0x54f368[_0x1499('0x69')])return _0x245b51(_0x54f368);return db[_0x1499('0x6a')][_0x1499('0x6b')](0x1)[_0x1499('0x20')](function(_0x4b2648){if(_0x4b2648['securePassword'])authService[_0x1499('0x6c')](_0x54f368['password']);db[_0x1499('0x40')][_0x1499('0x6d')]('internal')[_0x1499('0x20')](function(_0x49eeab){if(_[_0x1499('0x6e')](_0x49eeab)){_0x54f368[_0x1499('0x69')]=_0x4b2648['min_internal']||0x1;return;}if(_[_0x1499('0x6e')](_0x4b2648[_0x1499('0x6f')])||_0x4b2648[_0x1499('0x6f')]===_0x49eeab){_0x54f368[_0x1499('0x69')]=_0x49eeab+0x1;return;}if(_0x4b2648[_0x1499('0x6f')]>_0x49eeab){_0x54f368[_0x1499('0x69')]=_0x4b2648[_0x1499('0x6f')];return;}return db[_0x1499('0x70')][_0x1499('0x4c')](_0x1499('0x71'),{'type':db[_0x1499('0x70')][_0x1499('0x72')][_0x1499('0x73')]})[_0x1499('0x20')](function(_0x2feb60){if(_0x2feb60&&_0x2feb60['length']){for(var _0x54a78e=0x0,_0x20f354=_0x2feb60['length'];_0x54a78e<_0x20f354&&_[_0x1499('0x6e')](_0x54f368['internal']);_0x54a78e++){if(_0x4b2648['min_internal']<=_0x2feb60[_0x54a78e][_0x1499('0x74')]){_0x54f368[_0x1499('0x69')]=_0x2feb60[_0x54a78e][_0x1499('0x74')];}else if(_0x4b2648[_0x1499('0x6f')]>_0x2feb60[_0x54a78e][_0x1499('0x74')]&&_0x4b2648['min_internal']<=_0x2feb60[_0x54a78e]['to']){_0x54f368['internal']=_0x4b2648[_0x1499('0x6f')];}}}if(_['isNil'](_0x54f368[_0x1499('0x69')])){_0x54f368[_0x1499('0x69')]=_0x49eeab+0x1;}return _0x245b51(_0x54f368);});});})['catch'](function(_0x2f49f2){_0x2436ec(_0x2f49f2);});});}function updateUser(_0x2ff1d3){return new Promise(function(_0x79a582,_0xc77f9d){try{if(_0x2ff1d3[_0x1499('0x75')]){_0x2ff1d3[_0x1499('0x76')]=_0x2ff1d3['internal'];_0x2ff1d3[_0x1499('0x77')]={'mailbox':_0x2ff1d3['internal'],'password':_0x2ff1d3[_0x1499('0x78')],'fullname':_0x2ff1d3['fullname'],'email':_0x2ff1d3[_0x1499('0x79')]};}if(_0x2ff1d3[_0x1499('0x2c')]===_0x1499('0x2d')){if(!_0x2ff1d3[_0x1499('0x7a')])_0x2ff1d3[_0x1499('0x7a')]=['101',_0x1499('0x7b'),'103',_0x1499('0x7c'),_0x1499('0x7d'),_0x1499('0x7e'),_0x1499('0x7f'),'106','107',_0x1499('0x80'),_0x1499('0x81'),_0x1499('0x82'),'111',_0x1499('0x83'),_0x1499('0x84')];}_0x79a582(_0x2ff1d3);}catch(_0xd5e41a){_0xc77f9d(_0xd5e41a);}});}exports[_0x1499('0x85')]=function(_0x5caaa7,_0xf4a287){if(_0x5caaa7['user'][_0x1499('0x2c')]===_0x1499('0x2d'))throw new Error(_0x1499('0x86'));if(_0x5caaa7[_0x1499('0x63')][_0x1499('0x2c')]===_0x1499('0x33')&&_0x5caaa7[_0x1499('0x33')][_0x1499('0x2c')]!==_0x1499('0x31')){throw new Error(_0x1499('0x87'));}if(_0x5caaa7[_0x1499('0x63')][_0x1499('0x2c')]==='admin'&&_0x5caaa7['user'][_0x1499('0x2c')]!==_0x1499('0x31')){throw new Error(_0x1499('0x88'));}return licenseUtil['checkUserLimits']([_0x5caaa7[_0x1499('0x63')]])[_0x1499('0x20')](function(){return validateUser(_0x5caaa7[_0x1499('0x63')]);})[_0x1499('0x20')](function(_0x522982){return updateUser(_0x522982)[_0x1499('0x20')](function(_0x2317a5){if(_0x2317a5['role']===_0x1499('0x31')){_0x2317a5[_0x1499('0x89')]=_0x5caaa7[_0x1499('0x33')][_0x1499('0x89')];delete _0x2317a5['userProfileId'];}return _0x2317a5;});})['then'](function(_0x1115d1){return db[_0x1499('0x40')][_0x1499('0x85')](_0x1115d1,{'include':[{'model':db[_0x1499('0x77')],'as':_0x1499('0x77')}]});})[_0x1499('0x20')](function(_0x235610){if(_0x5caaa7[_0x1499('0x63')][_0x1499('0x2c')]===_0x1499('0x33'))return _0x235610;if(_0x5caaa7[_0x1499('0x33')]['role']!==_0x1499('0x33'))return _0x235610;return db['UserProfileSection'][_0x1499('0x3b')]({'where':{'name':_0x235610[_0x1499('0x2c')]===_0x1499('0x2d')?_0x1499('0x34'):_0x1499('0x35'),'userProfileId':_0x5caaa7[_0x1499('0x33')]['userProfileId']},'raw':!![]})[_0x1499('0x20')](function(_0x575bd3){if(!_0x575bd3||_0x575bd3[_0x1499('0x8a')]!=0x0)return _0x235610;return db[_0x1499('0x3d')][_0x1499('0x85')]({'name':_0x235610[_0x1499('0x3c')],'resourceId':_0x235610['id'],'type':_0x575bd3[_0x1499('0x3c')],'sectionId':_0x575bd3['id']},{})[_0x1499('0x20')](function(){return _0x235610;});})['catch'](function(_0x5d78df){logger[_0x1499('0x27')](_0x1499('0x8b'),_0x5d78df);throw _0x5d78df;});})['then'](respondWithResult(_0xf4a287,0xc9))[_0x1499('0x2b')](handleError(_0xf4a287,null));};exports[_0x1499('0x8c')]=function(_0x3c29b2,_0x40ab35){var _0x31c7f0=_0x3c29b2[_0x1499('0x63')];var _0x24448e=[];if(_0x3c29b2[_0x1499('0x33')][_0x1499('0x2c')]===_0x1499('0x2d'))throw new Error(_0x1499('0x86'));if(_[_0x1499('0x8d')](_0x31c7f0,['role','user'])&&_0x3c29b2[_0x1499('0x33')][_0x1499('0x2c')]!=='admin'){throw new Error(_0x1499('0x87'));}if(_['some'](_0x31c7f0,['role','admin'])&&_0x3c29b2[_0x1499('0x33')]['role']!=='admin'){throw new Error(_0x1499('0x8e'));}return licenseUtil[_0x1499('0x8f')](_0x31c7f0)['then'](function(){return validateUser(_0x31c7f0[0x0]);})[_0x1499('0x20')](function(){for(var _0x29585f=0x1;_0x29585f<_0x31c7f0['length'];_0x29585f++){var _0x1bf408=_0x31c7f0[_0x29585f-0x1][_0x1499('0x69')];if(!_0x31c7f0[_0x29585f][_0x1499('0x69')])_0x31c7f0[_0x29585f][_0x1499('0x69')]=_0x1bf408+0x1;_0x24448e[_0x1499('0x53')](validateUser(_0x31c7f0[_0x29585f]));}return Promise[_0x1499('0x61')](_0x24448e);})['then'](function(){_0x24448e=[];for(var _0x21c1a3=0x0;_0x21c1a3<_0x31c7f0[_0x1499('0x57')];_0x21c1a3++){_0x24448e['push'](updateUser(_0x31c7f0[_0x21c1a3]));}return Promise['all'](_0x24448e);})['then'](function(){_0x24448e=_0x31c7f0[_0x1499('0x42')](function(_0x18698d){return db[_0x1499('0x40')]['create'](_0x18698d,{'include':[{'model':db[_0x1499('0x77')],'as':_0x1499('0x77')}]})[_0x1499('0x20')](function(_0x5410b0){_0x18698d['id']=_0x5410b0['id'];return _0x18698d;});});return Promise[_0x1499('0x61')](_0x24448e);})[_0x1499('0x20')](function(_0x5eccb1){if(_0x3c29b2['body'][_0x1499('0x2c')]===_0x1499('0x33'))return _0x5eccb1;if(_0x3c29b2[_0x1499('0x33')][_0x1499('0x2c')]!==_0x1499('0x33'))return _0x5eccb1;var _0x2fb7de=_[_0x1499('0x8d')](_0x5eccb1,function(_0x1390a7){return _0x1390a7['role']===_0x1499('0x2d')||_0x1390a7['role']===_0x1499('0x36');});if(!_0x2fb7de)return _0x5eccb1;return db['UserProfileSection'][_0x1499('0x54')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x3c29b2[_0x1499('0x33')][_0x1499('0x90')]},'raw':!![]})['then'](function(_0x54fd18){if(_[_0x1499('0x91')](_0x54fd18)||!_[_0x1499('0x8d')](_0x54fd18,[_0x1499('0x8a'),0x0]))return _0x5eccb1;_0x24448e=[];var _0x373873=_(_0x54fd18)[_0x1499('0x42')](function(_0x196c10){if(_0x196c10[_0x1499('0x8a')]===0x1)return;return _0x196c10[_0x1499('0x3c')]===_0x1499('0x34')?_0x1499('0x2d'):_0x1499('0x36');})[_0x1499('0x92')]()['value']();for(var _0x17c994=0x0;_0x17c994<_0x5eccb1[_0x1499('0x57')];_0x17c994++){if(!_[_0x1499('0x3a')](_0x373873,_0x5eccb1[_0x17c994]['role']))return;var _0x5cbcf5=_0x5eccb1[_0x17c994][_0x1499('0x2c')]===_0x1499('0x2d')?_0x1499('0x34'):_0x1499('0x35');_0x24448e[_0x1499('0x53')](db[_0x1499('0x3d')]['create']({'name':_0x5eccb1[_0x17c994][_0x1499('0x3c')],'resourceId':_0x5eccb1[_0x17c994]['id'],'type':_0x5cbcf5,'sectionId':_['find'](_0x54fd18,[_0x1499('0x3c'),_0x5cbcf5])['id']},{}));}return Promise[_0x1499('0x61')](_0x24448e);});})['then'](respondWithResult(_0x40ab35,0xc9))[_0x1499('0x2b')](handleError(_0x40ab35,null));};exports['changePassword']=function(_0x4e75b1,_0xbd1620){if(_0x4e75b1[_0x1499('0x63')]['id']){delete _0x4e75b1[_0x1499('0x63')]['id'];}return db[_0x1499('0x40')]['find']({'where':{'id':_0x4e75b1[_0x1499('0x64')]['id']}})['then'](function(_0x41fbdf){if(!_0x41fbdf)return null;if(_0x41fbdf['id']===_0x4e75b1[_0x1499('0x33')]['id']){if(!_0x4e75b1[_0x1499('0x63')][_0x1499('0x93')]||!_0x4e75b1[_0x1499('0x63')][_0x1499('0x94')]){throw new db['Sequelize']['ValidationError'](_0x1499('0x95'));}if(!_0x41fbdf[_0x1499('0x96')](_0x4e75b1[_0x1499('0x63')][_0x1499('0x93')])){throw new db[(_0x1499('0x97'))][(_0x1499('0x98'))](_0x1499('0x99'));}if(_0x4e75b1[_0x1499('0x63')][_0x1499('0x93')]===_0x4e75b1[_0x1499('0x63')][_0x1499('0x94')]){throw new db[(_0x1499('0x97'))]['ValidationError'](_0x1499('0x9a'));}}else if(_0x4e75b1['user'][_0x1499('0x2c')]===_0x1499('0x31')){if(!_0x4e75b1['body'][_0x1499('0x94')]){throw new db['Sequelize'][(_0x1499('0x98'))](_0x1499('0x9b'));}}else if(_0x4e75b1[_0x1499('0x33')]['role']==='user'){if(!_0x4e75b1[_0x1499('0x63')][_0x1499('0x94')]){throw new db[(_0x1499('0x97'))]['ValidationError'](_0x1499('0x9b'));}if(_0x41fbdf['role']!==_0x1499('0x2d')){throw new db['Sequelize'][(_0x1499('0x98'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0x1499('0x98'))](_0x1499('0x86'));}return _0x41fbdf;})[_0x1499('0x20')](handleEntityNotFound(_0xbd1620,null))[_0x1499('0x20')](function(_0x3c3b83){return db[_0x1499('0x6a')][_0x1499('0x9c')]({'attributes':['id','securePassword',_0x1499('0x9d'),_0x1499('0x9e')]})[_0x1499('0x20')](function(_0x41be11){if(_0x41be11['securePassword'])authService['validatePasswordPattern'](_0x4e75b1['body'][_0x1499('0x94')]);if(!_0x41be11['enforcePasswordHistory']||!_0x3c3b83[_0x1499('0x47')])return _0x3c3b83;authService[_0x1499('0x9f')](_0x4e75b1['body'][_0x1499('0x94')],_0x3c3b83[_0x1499('0x47')],_0x41be11['passwordHistoryLimit']);return _0x3c3b83;})[_0x1499('0x20')](saveUpdates({'password':_0x4e75b1[_0x1499('0x63')][_0x1499('0x94')],'passwordResetAt':_0x4e75b1[_0x1499('0x33')]['id']==_0x4e75b1[_0x1499('0x64')]['id']?moment():null,'previousPasswords':authService[_0x1499('0xa0')](_0x4e75b1[_0x1499('0x63')][_0x1499('0x94')],_0x3c3b83[_0x1499('0x47')])},null));})['then'](respondWithResult(_0xbd1620,null))[_0x1499('0x2b')](handleError(_0xbd1620,null));};exports[_0x1499('0xa1')]=function(_0x583b10,_0x564aee){var _0x3d39d4=_0x583b10['body'][_0x1499('0xa2')];return db[_0x1499('0x40')][_0x1499('0x3b')]({'where':{'id':_0x583b10[_0x1499('0x64')]['id']},'attributes':['id','name',_0x1499('0x2c'),_0x1499('0xa3'),_0x1499('0xa4'),_0x1499('0xa5'),_0x1499('0xa6')]})[_0x1499('0x20')](handleEntityNotFound(_0x564aee,null))[_0x1499('0x20')](function(_0x302a9c){if(_0x302a9c){if(!utils[_0x1499('0xa7')](_0x3d39d4)){throw new db[(_0x1499('0x97'))][(_0x1499('0x98'))]('Unknown\x20channel');}return _0x302a9c['add'+_[_0x1499('0xa8')](_0x3d39d4['toLowerCase']())+'Queues'](_0x583b10['body']['ids'],{'penalty':_0x583b10[_0x1499('0x63')][_0x1499('0xa9')]||0x0})[_0x1499('0xaa')](function(_0x392b5f){for(var _0x3b277f=0x0;_0x3b277f<_0x583b10[_0x1499('0x63')][_0x1499('0x67')][_0x1499('0x57')];_0x3b277f+=0x1){var _0x34a8e9={'UserId':Number(_0x583b10['params']['id'])};_0x34a8e9[_[_0x1499('0xa8')](_0x3d39d4['toLowerCase']())+'QueueId']=Number(_0x583b10[_0x1499('0x63')][_0x1499('0x67')][_0x3b277f]);socket['emit'](_0x1499('0x33')+_[_0x1499('0xa8')](_0x3d39d4[_0x1499('0xab')]())+_0x1499('0xac'),_0x34a8e9);}return _0x392b5f;})[_0x1499('0x20')](function(){if(_0x3d39d4==='voice'){return db[_0x1499('0xad')][_0x1499('0x54')]({'where':{'id':_0x583b10[_0x1499('0x63')]['ids']||[]},'raw':!![],'attributes':['id',_0x1499('0x3c')]});}})[_0x1499('0x20')](function(_0x405fd1){var _0x50fc2c=_0x302a9c[_0x1499('0xae')]({'plain':!![]});var _0x46d0b2=[];if(_0x3d39d4===_0x1499('0xaf')&&_0x50fc2c[_0x1499('0x2c')]==='agent'&&_0x50fc2c[_0x1499('0xa3')]){for(let _0x4e75d3=0x0;_0x4e75d3<_0x405fd1['length'];_0x4e75d3+=0x1){_0x46d0b2[_0x1499('0x53')]({'membername':_0x50fc2c[_0x1499('0x3c')],'UserId':_0x50fc2c['id'],'queue_name':_0x405fd1[_0x4e75d3][_0x1499('0x3c')],'VoiceQueueId':_0x405fd1[_0x4e75d3]['id'],'interface':_['isNil'](_0x50fc2c['interface'])?util[_0x1499('0xb0')]('SIP/%s',_0x50fc2c[_0x1499('0x3c')]):_0x50fc2c[_0x1499('0xa6')],'paused':_0x50fc2c[_0x1499('0xa5')]||![],'penalty':_0x583b10[_0x1499('0x63')]['penalty']||0x0});}return Promise[_0x1499('0x61')](_0x46d0b2['map'](function(_0x5aa72f){return db[_0x1499('0xb1')]['upsert'](_0x5aa72f);}));}return _0x302a9c;});}})[_0x1499('0x20')](respondWithStatusCode(_0x564aee,null))['catch'](handleError(_0x564aee,null));};exports[_0x1499('0xb2')]=function(_0x175b9b,_0x50a3b8){var _0x3e6187,_0x521fe8;return db[_0x1499('0x40')][_0x1499('0x3b')]({'where':{'id':_0x175b9b[_0x1499('0x64')]['id']},'attributes':['id','name','role']})[_0x1499('0x20')](handleEntityNotFound(_0x50a3b8,null))[_0x1499('0x20')](function(_0x3a90eb){if(_0x3a90eb){_0x3e6187=_0x3a90eb;if(!_0x175b9b[_0x1499('0x4c')]['channel']||!utils[_0x1499('0xa7')](_0x175b9b[_0x1499('0x4c')]['channel'])){throw new db['Sequelize'][(_0x1499('0x98'))](_0x1499('0xb3'));}return _0x3a90eb[_0x1499('0xb4')+_[_0x1499('0xa8')](_0x175b9b[_0x1499('0x4c')]['channel'][_0x1499('0xab')]())+_0x1499('0xb5')](_0x175b9b[_0x1499('0x4c')][_0x1499('0x67')]);}})[_0x1499('0x20')](function(_0x75e3e6){if(_[_0x1499('0xb6')](_0x175b9b[_0x1499('0x4c')]['ids'])){for(var _0x43bc73=0x0;_0x43bc73<_0x175b9b[_0x1499('0x4c')][_0x1499('0x67')][_0x1499('0x57')];_0x43bc73+=0x1){_0x521fe8={'UserId':Number(_0x175b9b[_0x1499('0x64')]['id'])};_0x521fe8[_['capitalize'](_0x175b9b[_0x1499('0x4c')]['channel'][_0x1499('0xab')]())+_0x1499('0xb7')]=Number(_0x175b9b['query'][_0x1499('0x67')][_0x43bc73]);socket[_0x1499('0x2e')](_0x1499('0x33')+_[_0x1499('0xa8')](_0x175b9b['query'][_0x1499('0xa2')]['toLowerCase']())+_0x1499('0xb8'),_0x521fe8);}}else{_0x521fe8={'UserId':Number(_0x175b9b[_0x1499('0x64')]['id'])};_0x521fe8[_[_0x1499('0xa8')](_0x175b9b['query'][_0x1499('0xa2')]['toLowerCase']())+_0x1499('0xb7')]=Number(_0x175b9b[_0x1499('0x4c')][_0x1499('0x67')]);socket[_0x1499('0x2e')](_0x1499('0x33')+_[_0x1499('0xa8')](_0x175b9b[_0x1499('0x4c')][_0x1499('0xa2')][_0x1499('0xab')]())+_0x1499('0xb8'),_0x521fe8);}return _0x75e3e6;})[_0x1499('0x20')](function(){if(_0x175b9b[_0x1499('0x4c')]['channel']==='voice'){return db[_0x1499('0xb1')]['destroy']({'where':{'UserId':_0x175b9b['params']['id'],'VoiceQueueId':_0x175b9b[_0x1499('0x4c')][_0x1499('0x67')]},'individualHooks':!![]})[_0x1499('0x20')](function(){return _0x3e6187;});}return _0x3e6187;})[_0x1499('0x20')](respondWithStatusCode(_0x50a3b8,null))[_0x1499('0x2b')](handleError(_0x50a3b8,null));};exports[_0x1499('0xb9')]=function(_0x32663f,_0x181569){_0x32663f['body']['userpic']=_0x32663f[_0x1499('0xba')][_0x1499('0xbb')];return db[_0x1499('0x40')][_0x1499('0x3b')]({'where':{'id':_0x32663f[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x181569,null))['then'](saveUpdates(_0x32663f[_0x1499('0x63')],null))['then'](respondWithResult(_0x181569,null))[_0x1499('0x2b')](handleError(_0x181569,null));};exports['getAvatar']=function(_0x1a8f66,_0x308291){var _0x187c94=path[_0x1499('0xbc')](config[_0x1499('0xbd')],_0x1499('0xbe'));return db['User']['find']({'where':{'id':_0x1a8f66[_0x1499('0x64')]['id']},'attributes':['id',_0x1499('0xbf')],'raw':!![]})[_0x1499('0x20')](handleEntityNotFound(_0x308291,null))[_0x1499('0x20')](function(_0x28ff87){if(_0x28ff87){if(_[_0x1499('0x6e')](_0x28ff87[_0x1499('0xbf')])){return _0x308291[_0x1499('0xc0')](_0x187c94);}else{if(!fs['existsSync'](path[_0x1499('0xbc')](config[_0x1499('0xbd')],_0x1499('0xc1'),_0x28ff87[_0x1499('0xbf')]))){return _0x308291[_0x1499('0xc0')](_0x187c94);}return _0x308291['download'](path[_0x1499('0xbc')](config[_0x1499('0xbd')],_0x1499('0xc1'),_0x28ff87[_0x1499('0xbf')]));}}})['catch'](handleError(_0x308291,null));};exports[_0x1499('0xc2')]=function(_0x5302b4,_0x15508f){return db[_0x1499('0x40')]['find']({'where':{'id':_0x5302b4[_0x1499('0x64')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x15508f,null))['then'](function(_0x40b4d5){var _0x3d7de9=[];values=_0x40b4d5[_0x1499('0x58')];_0x3d7de9['push'](get_open_tabs(_0x1499('0xc3'),_0x40b4d5[_0x1499('0x58')]));_0x3d7de9[_0x1499('0x53')](get_open_tabs(_0x1499('0x59'),_0x40b4d5[_0x1499('0x58')]));_0x3d7de9[_0x1499('0x53')](get_open_tabs(_0x1499('0x5c'),_0x40b4d5[_0x1499('0x58')]));_0x3d7de9[_0x1499('0x53')](get_open_tabs(_0x1499('0x5d'),_0x40b4d5['dataValues']));_0x3d7de9['push'](get_open_tabs(_0x1499('0x5a'),_0x40b4d5[_0x1499('0x58')]));_0x3d7de9[_0x1499('0x53')](get_open_tabs('mail',_0x40b4d5[_0x1499('0x58')]));return Promise[_0x1499('0x61')](_0x3d7de9);})[_0x1499('0x20')](function(_0x36e718){if(_0x36e718){var _0x4d06df=_[_0x1499('0x42')](values[_0x1499('0xc4')],function(_0x1e38ae){return{'channel':_0x1499('0xc5'),'id':_0x1e38ae['id'],'createdAt':_0x1e38ae[_0x1499('0xc6')]};});var _0x4a6ced=_['map'](values[_0x1499('0xc7')],function(_0x57684e){return{'channel':_0x1499('0xc8'),'id':_0x57684e['id'],'createdAt':_0x57684e['createdAt']};});var _0x1f3601=_[_0x1499('0x42')](values['OpenchannelOpenTabs'],function(_0x434edb){return{'channel':_0x1499('0xc9'),'id':_0x434edb['id'],'createdAt':_0x434edb['createdAt']};});var _0x34fed0=_[_0x1499('0x42')](values[_0x1499('0xca')],function(_0x36a1aa){return{'channel':'MAIL','id':_0x36a1aa['id'],'createdAt':_0x36a1aa[_0x1499('0xc6')]};});var _0x1df885=_[_0x1499('0x42')](values[_0x1499('0xcb')],function(_0x7a80ff){return{'channel':'SMS','id':_0x7a80ff['id'],'createdAt':_0x7a80ff[_0x1499('0xc6')]};});var _0x2fcc49=_[_0x1499('0x42')](values['WhatsappOpenTabs'],function(_0x1dcf51){return{'channel':_0x1499('0xcc'),'id':_0x1dcf51['id'],'createdAt':_0x1dcf51[_0x1499('0xc6')]};});var _0x38e35d=_[_0x1499('0xcd')](_0x4d06df,_0x4a6ced,_0x1f3601,_0x34fed0,_0x1df885,_0x2fcc49);var _0x472410={'count':_0x38e35d[_0x1499('0x57')],'rows':_0x38e35d};return _0x472410;}else return null;})['then'](respondWithResult(_0x15508f,null))['catch'](handleError(_0x15508f,null));};exports['getContacts']=function(_0x12a17f,_0x41a049){var _0xc0fe7d={};return db['User']['findOne']({'where':{'id':_0x12a17f[_0x1499('0x64')]['id']}})['then'](function(_0x1e36e3){if(!_0x1e36e3){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x12a17f[_0x1499('0x64')]['id']));}return contacts[_0x1499('0x65')]();})[_0x1499('0x20')](function(_0x1b9a39){_0x12a17f['query'][_0x1499('0x40')]=_0x12a17f[_0x1499('0x64')]['id'];_0xc0fe7d=qs['getOptions'](_0x1b9a39,_0x12a17f);if(_0x12a17f['query'][_0x1499('0xce')](_0x1499('0x4d'))){_0xc0fe7d['include']=[{'model':db[_0x1499('0xcf')],'as':_0x1499('0xd0'),'required':![]},{'model':db[_0x1499('0xd1')],'as':_0x1499('0xd2'),'attributes':['id',_0x1499('0x3c'),_0x1499('0xd3')],'where':_0x12a17f['query'][_0x1499('0xd4')]?{'id':_0x12a17f[_0x1499('0x4c')][_0x1499('0xd4')]}:undefined,'required':_0x12a17f[_0x1499('0x4c')][_0x1499('0xd4')]?!![]:![]}];}return contacts[_0x1499('0x54')](_0x12a17f[_0x1499('0x4c')],_0x12a17f[_0x1499('0x33')],_0xc0fe7d,_0x1b9a39);})[_0x1499('0x20')](respondWithFilteredResult(_0x41a049,_0xc0fe7d))['catch'](APIHandleError(_0x41a049));};exports[_0x1499('0xd5')]=function(_0x59e1b6,_0x2d1211){var _0x559b20;var _0x42074a={};var _0x240c7a;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x59e1b6[_0x1499('0x64')]['id']},'attributes':['id',_0x1499('0x3c'),'role']})[_0x1499('0x20')](handleEntityNotFound(_0x2d1211,null))[_0x1499('0x20')](function(_0x39cf99){if(!utils[_0x1499('0xa7')](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xa2')])){throw new db[(_0x1499('0x97'))][(_0x1499('0x98'))](_0x1499('0xb3'));}_0x559b20=_0x39cf99;var _0x4b6e82={};_0x4b6e82['model']=_[_0x1499('0xd6')](db[_[_0x1499('0xa8')](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xa2')])+_0x1499('0xd7')][_0x1499('0x41')]);_0x4b6e82[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x59e1b6[_0x1499('0x4c')]);_0x4b6e82['filters']=_['intersection'](_0x4b6e82[_0x1499('0xd8')],_0x4b6e82['query']);_0x42074a[_0x1499('0x52')]=_['intersection'](_0x4b6e82['model'],qs['fields'](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xd9')]));_0x42074a['attributes']=_0x42074a[_0x1499('0x52')][_0x1499('0x57')]?_0x42074a[_0x1499('0x52')]:_0x4b6e82['model'];_0x42074a[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xdb')]);_0x42074a[_0x1499('0xdc')]=qs['filters'](_[_0x1499('0xdd')](_0x59e1b6['query'],_0x4b6e82[_0x1499('0xde')]));if(_0x59e1b6[_0x1499('0x4c')][_0x1499('0x37')]){_0x42074a[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x42074a[_0x1499('0xdc')],{'$or':_[_0x1499('0x42')](_0x42074a[_0x1499('0x52')],function(_0x47d313){var _0x387808={};_0x387808[_0x47d313]={'$like':'%'+_0x59e1b6['query'][_0x1499('0x37')]+'%'};return _0x387808;})});}_0x42074a=_['merge']({},_0x42074a,_0x59e1b6[_0x1499('0x60')]);switch(_0x559b20[_0x1499('0x2c')]){case _0x1499('0x31'):return db[_[_0x1499('0xa8')](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xa2')])+_0x1499('0xd7')][_0x1499('0x54')](_0x42074a);case _0x1499('0x33'):case'agent':return _0x559b20[_0x1499('0xae')+_['capitalize'](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xa2')])+'Queues'](_0x42074a);default:throw new db[(_0x1499('0x97'))][(_0x1499('0x98'))]('Unknown\x20role');}})[_0x1499('0x20')](function(_0x41443f){_0x240c7a=_0x41443f['length'];if(!_0x59e1b6[_0x1499('0x4c')]['hasOwnProperty'](_0x1499('0xdf'))){_0x42074a[_0x1499('0x1a')]=qs['limit'](_0x59e1b6['query'][_0x1499('0x1a')]);_0x42074a[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x59e1b6[_0x1499('0x4c')][_0x1499('0x19')]);}switch(_0x559b20[_0x1499('0x2c')]){case'admin':return db[_[_0x1499('0xa8')](_0x59e1b6['query'][_0x1499('0xa2')])+_0x1499('0xd7')]['findAll'](_0x42074a);case _0x1499('0x33'):case'agent':return _0x559b20[_0x1499('0xae')+_[_0x1499('0xa8')](_0x59e1b6[_0x1499('0x4c')][_0x1499('0xa2')])+_0x1499('0xb5')](_0x42074a);}})['then'](function(_0x22b1ed){return{'count':_0x240c7a,'rows':_0x22b1ed};})[_0x1499('0x20')](respondWithResult(_0x2d1211,null))[_0x1499('0x2b')](handleError(_0x2d1211,null));};exports['getVoiceQueuesRt']=function(_0x343b65,_0x35ee79){var _0x191075={};var _0x3fc165={};var _0x52cc6e;var _0x106726;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x343b65[_0x1499('0x64')]['id']}})['then'](handleEntityNotFound(_0x35ee79,null))[_0x1499('0x20')](function(_0x200eed){if(_0x200eed){_0x52cc6e=_0x200eed;_0x3fc165[_0x1499('0xd8')]=_[_0x1499('0xd6')](db[_0x1499('0xb1')]['rawAttributes']);_0x3fc165[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x343b65[_0x1499('0x4c')]);_0x3fc165[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x3fc165[_0x1499('0xd8')],_0x3fc165[_0x1499('0x4c')]);_0x191075[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x3fc165[_0x1499('0xd8')],qs[_0x1499('0xd9')](_0x343b65[_0x1499('0x4c')]['fields']));_0x191075[_0x1499('0x52')]=_0x191075[_0x1499('0x52')][_0x1499('0x57')]?_0x191075[_0x1499('0x52')]:_0x3fc165['model'];_0x191075[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x343b65[_0x1499('0x4c')][_0x1499('0xdb')]);_0x191075['where']=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x343b65[_0x1499('0x4c')],_0x3fc165['filters']));if(_0x343b65[_0x1499('0x4c')]['filter']){_0x191075[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x191075['where'],{'$or':_[_0x1499('0x42')](_0x191075[_0x1499('0x52')],function(_0x5c7f0d){var _0x2f6529={};_0x2f6529[_0x5c7f0d]={'$like':'%'+_0x343b65[_0x1499('0x4c')][_0x1499('0x37')]+'%'};return _0x2f6529;})});}_0x191075=_['merge']({},_0x191075,_0x343b65[_0x1499('0x60')]);return _0x52cc6e[_0x1499('0xe1')](_0x191075);}})['then'](function(_0x531ac0){if(_0x531ac0){_0x106726=_0x531ac0[_0x1499('0x57')];if(!_0x343b65['query'][_0x1499('0xce')](_0x1499('0xdf'))){_0x191075[_0x1499('0x1a')]=qs['limit'](_0x343b65['query']['limit']);_0x191075[_0x1499('0x19')]=qs['offset'](_0x343b65[_0x1499('0x4c')][_0x1499('0x19')]);}return _0x52cc6e[_0x1499('0xe1')](_0x191075);}})['then'](function(_0x1c5691){if(_0x1c5691){return _0x1c5691?{'count':_0x106726,'rows':_0x1c5691}:null;}})[_0x1499('0x20')](respondWithResult(_0x35ee79,null))[_0x1499('0x2b')](handleError(_0x35ee79,null));};exports[_0x1499('0xe2')]=function(_0x55c7e9,_0x316810){var _0x3f697e={};var _0x1644ec={};var _0x4e79e1;var _0x4d7c7a;return db['User'][_0x1499('0x9c')]({'where':{'id':_0x55c7e9[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x316810,null))['then'](function(_0x4a6894){if(_0x4a6894){_0x4e79e1=_0x4a6894;_0x1644ec[_0x1499('0xd8')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x1644ec['query']=_['keys'](_0x55c7e9[_0x1499('0x4c')]);_0x1644ec[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x1644ec[_0x1499('0xd8')],_0x1644ec['query']);_0x3f697e[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x1644ec[_0x1499('0xd8')],qs['fields'](_0x55c7e9[_0x1499('0x4c')][_0x1499('0xd9')]));_0x3f697e[_0x1499('0x52')]=_0x3f697e['attributes'][_0x1499('0x57')]?_0x3f697e[_0x1499('0x52')]:_0x1644ec[_0x1499('0xd8')];_0x3f697e['order']=qs[_0x1499('0xdb')](_0x55c7e9[_0x1499('0x4c')][_0x1499('0xdb')]);_0x3f697e[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x55c7e9['query'],_0x1644ec[_0x1499('0xde')]));if(_0x55c7e9[_0x1499('0x4c')][_0x1499('0x37')]){_0x3f697e[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x3f697e[_0x1499('0xdc')],{'$or':_[_0x1499('0x42')](_0x3f697e[_0x1499('0x52')],function(_0x1a8e23){var _0x4f6a1e={};_0x4f6a1e[_0x1a8e23]={'$like':'%'+_0x55c7e9[_0x1499('0x4c')][_0x1499('0x37')]+'%'};return _0x4f6a1e;})});}_0x3f697e=_[_0x1499('0x5f')]({},_0x3f697e,_0x55c7e9[_0x1499('0x60')]);return _0x4e79e1[_0x1499('0xe2')](_0x3f697e);}})['then'](function(_0x4511e8){if(_0x4511e8){_0x4d7c7a=_0x4511e8[_0x1499('0x57')];if(!_0x55c7e9[_0x1499('0x4c')]['hasOwnProperty']('nolimit')){_0x3f697e[_0x1499('0x1a')]=qs['limit'](_0x55c7e9[_0x1499('0x4c')]['limit']);_0x3f697e['offset']=qs['offset'](_0x55c7e9['query'][_0x1499('0x19')]);}return _0x4e79e1[_0x1499('0xe2')](_0x3f697e);}})['then'](function(_0x9e856f){if(_0x9e856f){return _0x9e856f?{'count':_0x4d7c7a,'rows':_0x9e856f}:null;}})[_0x1499('0x20')](respondWithResult(_0x316810,null))['catch'](handleError(_0x316810,null));};exports[_0x1499('0xe3')]=function(_0x26827e,_0x10646e){var _0x3433da={'raw':!![],'where':{}};var _0x454f48={};var _0x235e53={'count':0x0,'rows':[]};return db['User'][_0x1499('0x9c')]({'where':{'id':_0x26827e[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x10646e,null))['then'](function(_0x51c85c){if(_0x51c85c){_0x454f48[_0x1499('0xd8')]=_['keys'](db[_0x1499('0xe4')][_0x1499('0x41')]);_0x454f48[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x26827e[_0x1499('0x4c')]);_0x454f48[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x454f48['model'],_0x454f48[_0x1499('0x4c')]);_0x3433da['attributes']=_['intersection'](_0x454f48['model'],qs['fields'](_0x26827e['query'][_0x1499('0xd9')]));_0x3433da[_0x1499('0x52')]=_0x3433da[_0x1499('0x52')][_0x1499('0x57')]?_0x3433da['attributes']:_0x454f48[_0x1499('0xd8')];if(!_0x26827e[_0x1499('0x4c')][_0x1499('0xce')]('nolimit')){_0x3433da[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x26827e[_0x1499('0x4c')][_0x1499('0x1a')]);_0x3433da[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x26827e[_0x1499('0x4c')]['offset']);}_0x3433da['order']=qs['sort'](_0x26827e['query'][_0x1499('0xdb')]);_0x3433da[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x26827e[_0x1499('0x4c')],_0x454f48[_0x1499('0xde')]));_0x3433da[_0x1499('0xdc')][_0x1499('0xe5')]=_0x51c85c['id'];if(_0x26827e[_0x1499('0x4c')]['filter']){_0x3433da[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x3433da[_0x1499('0xdc')],{'$or':_['map'](_0x3433da[_0x1499('0x52')],function(_0x5116de){var _0x306e9a={};_0x306e9a[_0x5116de]={'$like':'%'+_0x26827e[_0x1499('0x4c')]['filter']+'%'};return _0x306e9a;})});}_0x3433da=_['merge']({},_0x3433da,_0x26827e[_0x1499('0x60')]);return db[_0x1499('0xe4')][_0x1499('0x1c')]({'where':_0x3433da[_0x1499('0xdc')]})[_0x1499('0x20')](function(_0x15130f){_0x235e53[_0x1499('0x1c')]=_0x15130f;if(_0x26827e[_0x1499('0x4c')][_0x1499('0x4d')]){_0x3433da[_0x1499('0x4e')]=[{'all':!![]}];}return db[_0x1499('0xe4')][_0x1499('0x54')](_0x3433da);})[_0x1499('0x20')](function(_0x3818ee){_0x235e53['rows']=_0x3818ee;return _0x235e53;});}})['then'](respondWithFilteredResult(_0x10646e,_0x3433da))['catch'](handleError(_0x10646e,null));};exports[_0x1499('0xe6')]=function(_0x9f970b,_0x16495b){var _0x1c0697={'raw':!![],'where':{}};var _0x318f08={};var _0x441cf4={'count':0x0,'rows':[]};return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x9f970b['params']['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x16495b,null))[_0x1499('0x20')](function(_0x2bf5c4){if(_0x2bf5c4){_0x318f08[_0x1499('0xd8')]=_[_0x1499('0xd6')](db[_0x1499('0xe7')][_0x1499('0x41')]);_0x318f08[_0x1499('0x4c')]=_['keys'](_0x9f970b['query']);_0x318f08[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x318f08[_0x1499('0xd8')],_0x318f08[_0x1499('0x4c')]);_0x1c0697[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x318f08[_0x1499('0xd8')],qs['fields'](_0x9f970b['query'][_0x1499('0xd9')]));_0x1c0697[_0x1499('0x52')]=_0x1c0697['attributes'][_0x1499('0x57')]?_0x1c0697[_0x1499('0x52')]:_0x318f08['model'];if(!_0x9f970b['query'][_0x1499('0xce')]('nolimit')){_0x1c0697[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x9f970b['query']['limit']);_0x1c0697[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x9f970b[_0x1499('0x4c')][_0x1499('0x19')]);}_0x1c0697['order']=qs[_0x1499('0xdb')](_0x9f970b[_0x1499('0x4c')]['sort']);_0x1c0697[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x9f970b[_0x1499('0x4c')],_0x318f08[_0x1499('0xde')]));_0x1c0697[_0x1499('0xdc')][_0x1499('0xe5')]=_0x2bf5c4['id'];if(_0x9f970b['query'][_0x1499('0x37')]){_0x1c0697[_0x1499('0xdc')]=_['merge'](_0x1c0697['where'],{'$or':_[_0x1499('0x42')](_0x1c0697[_0x1499('0x52')],function(_0x6def2c){var _0x3cb318={};_0x3cb318[_0x6def2c]={'$like':'%'+_0x9f970b[_0x1499('0x4c')][_0x1499('0x37')]+'%'};return _0x3cb318;})});}_0x1c0697=_[_0x1499('0x5f')]({},_0x1c0697,_0x9f970b[_0x1499('0x60')]);return db['ScreenRecording'][_0x1499('0x1c')]({'where':_0x1c0697[_0x1499('0xdc')]})[_0x1499('0x20')](function(_0x50897c){_0x441cf4[_0x1499('0x1c')]=_0x50897c;if(_0x9f970b[_0x1499('0x4c')]['includeAll']){_0x1c0697['include']=[{'all':!![]}];}return db[_0x1499('0xe7')][_0x1499('0x54')](_0x1c0697);})[_0x1499('0x20')](function(_0x361968){_0x441cf4[_0x1499('0x55')]=_0x361968;return _0x441cf4;});}})[_0x1499('0x20')](respondWithFilteredResult(_0x16495b,_0x1c0697))[_0x1499('0x2b')](handleError(_0x16495b,null));};exports[_0x1499('0xe8')]=function(_0x19471b,_0x7f3953){var _0x23612d={};var _0x10a7d0={};var _0x315083;var _0x55d15c;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x19471b[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x7f3953,null))[_0x1499('0x20')](function(_0x5b28b9){if(_0x5b28b9){_0x315083=_0x5b28b9;_0x10a7d0[_0x1499('0xd8')]=_[_0x1499('0xd6')](db[_0x1499('0xe9')][_0x1499('0x41')]);_0x10a7d0[_0x1499('0x4c')]=_['keys'](_0x19471b[_0x1499('0x4c')]);_0x10a7d0[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x10a7d0['model'],_0x10a7d0['query']);_0x23612d['attributes']=_[_0x1499('0xe0')](_0x10a7d0['model'],qs[_0x1499('0xd9')](_0x19471b[_0x1499('0x4c')]['fields']));_0x23612d[_0x1499('0x52')]=_0x23612d[_0x1499('0x52')][_0x1499('0x57')]?_0x23612d[_0x1499('0x52')]:_0x10a7d0[_0x1499('0xd8')];_0x23612d[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x19471b['query']['sort']);_0x23612d[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x19471b[_0x1499('0x4c')],_0x10a7d0[_0x1499('0xde')]));if(_0x19471b[_0x1499('0x4c')][_0x1499('0x37')]){_0x23612d[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x23612d['where'],{'$or':_[_0x1499('0x42')](_0x23612d[_0x1499('0x52')],function(_0x4b281b){var _0x5514dc={};_0x5514dc[_0x4b281b]={'$like':'%'+_0x19471b['query'][_0x1499('0x37')]+'%'};return _0x5514dc;})});}_0x23612d=_[_0x1499('0x5f')]({},_0x23612d,_0x19471b[_0x1499('0x60')]);return _0x315083[_0x1499('0xe8')](_0x23612d);}})[_0x1499('0x20')](function(_0x3761e6){if(_0x3761e6){_0x55d15c=_0x3761e6['length'];if(!_0x19471b['query']['hasOwnProperty'](_0x1499('0xdf'))){_0x23612d[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x19471b['query'][_0x1499('0x1a')]);_0x23612d[_0x1499('0x19')]=qs['offset'](_0x19471b['query'][_0x1499('0x19')]);}return _0x315083[_0x1499('0xe8')](_0x23612d);}})[_0x1499('0x20')](function(_0x297e84){if(_0x297e84){return _0x297e84?{'count':_0x55d15c,'rows':_0x297e84}:null;}})[_0x1499('0x20')](respondWithResult(_0x7f3953,null))[_0x1499('0x2b')](handleError(_0x7f3953,null));};exports[_0x1499('0xea')]=function(_0x4bd5a5,_0xda9705){var _0x2e6244={};var _0x447d82={};var _0x28e6c2;var _0x30cf2a;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x4bd5a5['params']['id']}})[_0x1499('0x20')](handleEntityNotFound(_0xda9705,null))[_0x1499('0x20')](function(_0x26d4e2){if(_0x26d4e2){_0x28e6c2=_0x26d4e2;_0x447d82['model']=_['keys'](db[_0x1499('0xeb')][_0x1499('0x41')]);_0x447d82[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x4bd5a5[_0x1499('0x4c')]);_0x447d82['filters']=_[_0x1499('0xe0')](_0x447d82[_0x1499('0xd8')],_0x447d82[_0x1499('0x4c')]);_0x2e6244[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x447d82[_0x1499('0xd8')],qs['fields'](_0x4bd5a5[_0x1499('0x4c')]['fields']));_0x2e6244[_0x1499('0x52')]=_0x2e6244[_0x1499('0x52')][_0x1499('0x57')]?_0x2e6244['attributes']:_0x447d82[_0x1499('0xd8')];_0x2e6244['order']=qs[_0x1499('0xdb')](_0x4bd5a5[_0x1499('0x4c')][_0x1499('0xdb')]);_0x2e6244[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x4bd5a5[_0x1499('0x4c')],_0x447d82[_0x1499('0xde')]));if(_0x4bd5a5[_0x1499('0x4c')][_0x1499('0x37')]){_0x2e6244[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x2e6244[_0x1499('0xdc')],{'$or':_[_0x1499('0x42')](_0x2e6244['attributes'],function(_0x1f2e96){var _0xe50043={};_0xe50043[_0x1f2e96]={'$like':'%'+_0x4bd5a5['query'][_0x1499('0x37')]+'%'};return _0xe50043;})});}_0x2e6244=_[_0x1499('0x5f')]({},_0x2e6244,_0x4bd5a5['options']);return _0x28e6c2['getOpenchannelInteractions'](_0x2e6244);}})['then'](function(_0x1cec8b){if(_0x1cec8b){_0x30cf2a=_0x1cec8b[_0x1499('0x57')];if(!_0x4bd5a5['query'][_0x1499('0xce')](_0x1499('0xdf'))){_0x2e6244[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x4bd5a5[_0x1499('0x4c')][_0x1499('0x1a')]);_0x2e6244['offset']=qs[_0x1499('0x19')](_0x4bd5a5[_0x1499('0x4c')][_0x1499('0x19')]);}return _0x28e6c2['getOpenchannelInteractions'](_0x2e6244);}})['then'](function(_0x27d9a4){if(_0x27d9a4){return _0x27d9a4?{'count':_0x30cf2a,'rows':_0x27d9a4}:null;}})[_0x1499('0x20')](respondWithResult(_0xda9705,null))[_0x1499('0x2b')](handleError(_0xda9705,null));};exports[_0x1499('0xec')]=function(_0x5517e0,_0x2bb2e9){var _0x576b50={'raw':!![],'where':{}};var _0x447364={};var _0x1a08fc={'count':0x0,'rows':[]};return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x5517e0[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x2bb2e9,null))[_0x1499('0x20')](function(_0x35ce24){if(_0x35ce24){_0x447364[_0x1499('0xd8')]=_[_0x1499('0xd6')](db[_0x1499('0xed')][_0x1499('0x41')]);_0x447364[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x5517e0[_0x1499('0x4c')]);_0x447364[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x447364[_0x1499('0xd8')],_0x447364[_0x1499('0x4c')]);_0x576b50[_0x1499('0x52')]=_['intersection'](_0x447364[_0x1499('0xd8')],qs['fields'](_0x5517e0['query'][_0x1499('0xd9')]));_0x576b50[_0x1499('0x52')]=_0x576b50[_0x1499('0x52')]['length']?_0x576b50[_0x1499('0x52')]:_0x447364[_0x1499('0xd8')];if(!_0x5517e0['query'][_0x1499('0xce')](_0x1499('0xdf'))){_0x576b50[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x5517e0[_0x1499('0x4c')][_0x1499('0x1a')]);_0x576b50[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x5517e0[_0x1499('0x4c')][_0x1499('0x19')]);}_0x576b50[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x5517e0[_0x1499('0x4c')][_0x1499('0xdb')]);_0x576b50['where']=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x5517e0[_0x1499('0x4c')],_0x447364[_0x1499('0xde')]));_0x576b50[_0x1499('0xdc')][_0x1499('0xe5')]=_0x35ce24['id'];if(_0x5517e0['query']['filter']){_0x576b50[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x576b50[_0x1499('0xdc')],{'$or':_[_0x1499('0x42')](_0x576b50[_0x1499('0x52')],function(_0x15f9cb){var _0x519c83={};_0x519c83[_0x15f9cb]={'$like':'%'+_0x5517e0[_0x1499('0x4c')][_0x1499('0x37')]+'%'};return _0x519c83;})});}_0x576b50=_[_0x1499('0x5f')]({},_0x576b50,_0x5517e0[_0x1499('0x60')]);return db[_0x1499('0xed')][_0x1499('0x1c')]({'where':_0x576b50[_0x1499('0xdc')]})[_0x1499('0x20')](function(_0x5cf097){_0x1a08fc[_0x1499('0x1c')]=_0x5cf097;if(_0x5517e0[_0x1499('0x4c')]['includeAll']){_0x576b50['include']=[{'all':!![]}];}return db[_0x1499('0xed')]['findAll'](_0x576b50);})['then'](function(_0x49e8c8){_0x1a08fc[_0x1499('0x55')]=_0x49e8c8;return _0x1a08fc;});}})[_0x1499('0x20')](respondWithFilteredResult(_0x2bb2e9,_0x576b50))[_0x1499('0x2b')](handleError(_0x2bb2e9,null));};exports[_0x1499('0xee')]=function(_0x37b001,_0x2d133a){var _0x3f83f4={};var _0x73b8e5={};var _0x26757b;var _0x3b927e;return db[_0x1499('0x40')]['findOne']({'where':{'id':_0x37b001[_0x1499('0x64')]['id']}})['then'](handleEntityNotFound(_0x2d133a,null))[_0x1499('0x20')](function(_0x45be4d){if(_0x45be4d){_0x26757b=_0x45be4d;_0x73b8e5[_0x1499('0xd8')]=_['keys'](db[_0x1499('0xef')]['rawAttributes']);_0x73b8e5[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x37b001[_0x1499('0x4c')]);_0x73b8e5[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x73b8e5[_0x1499('0xd8')],_0x73b8e5[_0x1499('0x4c')]);_0x3f83f4[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x73b8e5[_0x1499('0xd8')],qs[_0x1499('0xd9')](_0x37b001['query'][_0x1499('0xd9')]));_0x3f83f4[_0x1499('0x52')]=_0x3f83f4['attributes']['length']?_0x3f83f4['attributes']:_0x73b8e5[_0x1499('0xd8')];_0x3f83f4[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x37b001['query'][_0x1499('0xdb')]);_0x3f83f4['where']=qs['filters'](_['pick'](_0x37b001['query'],_0x73b8e5['filters']));if(_0x37b001[_0x1499('0x4c')][_0x1499('0x37')]){_0x3f83f4[_0x1499('0xdc')]=_['merge'](_0x3f83f4['where'],{'$or':_[_0x1499('0x42')](_0x3f83f4[_0x1499('0x52')],function(_0x2a576e){var _0x32cc71={};_0x32cc71[_0x2a576e]={'$like':'%'+_0x37b001['query'][_0x1499('0x37')]+'%'};return _0x32cc71;})});}_0x3f83f4=_[_0x1499('0x5f')]({},_0x3f83f4,_0x37b001[_0x1499('0x60')]);return _0x26757b[_0x1499('0xee')](_0x3f83f4);}})[_0x1499('0x20')](function(_0x47048f){if(_0x47048f){_0x3b927e=_0x47048f[_0x1499('0x57')];if(!_0x37b001[_0x1499('0x4c')][_0x1499('0xce')]('nolimit')){_0x3f83f4[_0x1499('0x1a')]=qs['limit'](_0x37b001[_0x1499('0x4c')]['limit']);_0x3f83f4[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x37b001[_0x1499('0x4c')][_0x1499('0x19')]);}return _0x26757b['getSmsInteractions'](_0x3f83f4);}})[_0x1499('0x20')](function(_0x3b9ce3){if(_0x3b9ce3){return _0x3b9ce3?{'count':_0x3b927e,'rows':_0x3b9ce3}:null;}})[_0x1499('0x20')](respondWithResult(_0x2d133a,null))[_0x1499('0x2b')](handleError(_0x2d133a,null));};exports[_0x1499('0xf0')]=function(_0x36fce9,_0x494e3c){var _0x318216={};var _0x462949={};var _0x26907f;var _0xff4c3a;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x36fce9['params']['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x494e3c,null))[_0x1499('0x20')](function(_0x4acb4c){if(_0x4acb4c){_0x26907f=_0x4acb4c;_0x462949['model']=_['keys'](db[_0x1499('0xf1')][_0x1499('0x41')]);_0x462949[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x36fce9[_0x1499('0x4c')]);_0x462949[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x462949['model'],_0x462949[_0x1499('0x4c')]);_0x318216[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x462949[_0x1499('0xd8')],qs[_0x1499('0xd9')](_0x36fce9[_0x1499('0x4c')][_0x1499('0xd9')]));_0x318216['attributes']=_0x318216[_0x1499('0x52')][_0x1499('0x57')]?_0x318216[_0x1499('0x52')]:_0x462949['model'];_0x318216['order']=qs[_0x1499('0xdb')](_0x36fce9['query'][_0x1499('0xdb')]);_0x318216[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x36fce9[_0x1499('0x4c')],_0x462949[_0x1499('0xde')]));if(_0x36fce9['query'][_0x1499('0x37')]){_0x318216[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x318216['where'],{'$or':_[_0x1499('0x42')](_0x318216[_0x1499('0x52')],function(_0xe8971f){var _0x3494d1={};_0x3494d1[_0xe8971f]={'$like':'%'+_0x36fce9[_0x1499('0x4c')][_0x1499('0x37')]+'%'};return _0x3494d1;})});}_0x318216=_[_0x1499('0x5f')]({},_0x318216,_0x36fce9[_0x1499('0x60')]);return _0x26907f[_0x1499('0xf0')](_0x318216);}})['then'](function(_0x315c11){if(_0x315c11){_0xff4c3a=_0x315c11[_0x1499('0x57')];if(!_0x36fce9[_0x1499('0x4c')]['hasOwnProperty'](_0x1499('0xdf'))){_0x318216[_0x1499('0x1a')]=qs['limit'](_0x36fce9[_0x1499('0x4c')][_0x1499('0x1a')]);_0x318216[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x36fce9[_0x1499('0x4c')]['offset']);}return _0x26907f[_0x1499('0xf0')](_0x318216);}})[_0x1499('0x20')](function(_0x4bcc1f){if(_0x4bcc1f){return _0x4bcc1f?{'count':_0xff4c3a,'rows':_0x4bcc1f}:null;}})[_0x1499('0x20')](respondWithResult(_0x494e3c,null))[_0x1499('0x2b')](handleError(_0x494e3c,null));};exports[_0x1499('0xf2')]=function(_0x550b4a,_0x2e5dc9){var _0x45d01e={};var _0x3ad7c0={};var _0x1b87bc;var _0x3a63ea;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x550b4a[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x2e5dc9,null))[_0x1499('0x20')](function(_0x14e4a0){if(_0x14e4a0){_0x1b87bc=_0x14e4a0;_0x3ad7c0[_0x1499('0xd8')]=_[_0x1499('0xd6')](db[_0x1499('0xf3')]['rawAttributes']);_0x3ad7c0[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x550b4a[_0x1499('0x4c')]);_0x3ad7c0['filters']=_['intersection'](_0x3ad7c0[_0x1499('0xd8')],_0x3ad7c0[_0x1499('0x4c')]);_0x45d01e['attributes']=_['intersection'](_0x3ad7c0[_0x1499('0xd8')],qs[_0x1499('0xd9')](_0x550b4a[_0x1499('0x4c')][_0x1499('0xd9')]));_0x45d01e[_0x1499('0x52')]=_0x45d01e[_0x1499('0x52')][_0x1499('0x57')]?_0x45d01e[_0x1499('0x52')]:_0x3ad7c0['model'];_0x45d01e[_0x1499('0xda')]=qs['sort'](_0x550b4a['query'][_0x1499('0xdb')]);_0x45d01e[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x550b4a[_0x1499('0x4c')],_0x3ad7c0[_0x1499('0xde')]));if(_0x550b4a['query'][_0x1499('0x37')]){_0x45d01e[_0x1499('0xdc')]=_['merge'](_0x45d01e[_0x1499('0xdc')],{'$or':_['map'](_0x45d01e['attributes'],function(_0x5b208a){var _0x503a76={};_0x503a76[_0x5b208a]={'$like':'%'+_0x550b4a['query']['filter']+'%'};return _0x503a76;})});}_0x45d01e=_[_0x1499('0x5f')]({},_0x45d01e,_0x550b4a[_0x1499('0x60')]);return _0x1b87bc[_0x1499('0xf2')](_0x45d01e);}})['then'](function(_0x4642e6){if(_0x4642e6){_0x3a63ea=_0x4642e6[_0x1499('0x57')];if(!_0x550b4a[_0x1499('0x4c')]['hasOwnProperty'](_0x1499('0xdf'))){_0x45d01e[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x550b4a[_0x1499('0x4c')]['limit']);_0x45d01e[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x550b4a[_0x1499('0x4c')]['offset']);}return _0x1b87bc[_0x1499('0xf2')](_0x45d01e);}})[_0x1499('0x20')](function(_0x1f1bed){if(_0x1f1bed){return _0x1f1bed?{'count':_0x3a63ea,'rows':_0x1f1bed}:null;}})[_0x1499('0x20')](respondWithResult(_0x2e5dc9,null))['catch'](handleError(_0x2e5dc9,null));};exports['login']=function(_0x34ecc4,_0x6b4758,_0x303b2d){var _0x5d5d56;var _0x4352d0;var _0x415220;var _0x3db20b=!_[_0x1499('0x6e')](_0x34ecc4[_0x1499('0x64')]['id'])?_0x34ecc4[_0x1499('0x64')]['id']:!_[_0x1499('0x6e')](_0x34ecc4[_0x1499('0x33')]['id'])?_0x34ecc4['user']['id']:null;return db[_0x1499('0x40')]['find']({'where':{'id':_0x3db20b,'role':{'$or':[_0x1499('0x31'),_0x1499('0x33'),_0x1499('0x2d')]}},'attributes':['id',_0x1499('0x3c'),_0x1499('0xf4'),_0x1499('0xf5'),_0x1499('0x2c'),_0x1499('0x69'),_0x1499('0xa4')]})[_0x1499('0x20')](function(_0x9cdf6e){if(_0x9cdf6e){if(_0x9cdf6e[_0x1499('0x2c')]===_0x1499('0x2d')){_0x5d5d56=_0x9cdf6e;if(_0x34ecc4[_0x1499('0x63')][_0x1499('0xa6')]){_0x415220=util[_0x1499('0xb0')](_0x1499('0xf6'),_0x5d5d56[_0x34ecc4['body'][_0x1499('0xa6')]]);}else if(_0x34ecc4[_0x1499('0x63')][_0x1499('0xf7')]){_0x415220=util[_0x1499('0xb0')]('SIP/%s',_0x34ecc4[_0x1499('0x63')][_0x1499('0xf7')]);}else{_0x415220=util[_0x1499('0xb0')](_0x1499('0xf8'),_0x5d5d56[_0x1499('0x3c')]);}socket['to'](util[_0x1499('0xb0')](_0x1499('0xf9'),_0x5d5d56[_0x1499('0x3c')]))[_0x1499('0x2e')](_0x1499('0xfa'),{'user':{'id':_0x5d5d56['id'],'name':_0x5d5d56['name']},'ip':_0x34ecc4[_0x1499('0xfb')][_0x1499('0xfc')]||_0x34ecc4[_0x1499('0xfd')][_0x1499('0xfe')]||_0x34ecc4['socket'][_0x1499('0xfe')]||_0x34ecc4[_0x1499('0xfd')][_0x1499('0xff')][_0x1499('0xfe')]});return db[_0x1499('0xb1')][_0x1499('0x30')]({'where':{'membername':_0x5d5d56['name']},'individualHooks':!![]});}}else{throw new db[(_0x1499('0x97'))]['ValidationError'](_0x1499('0x100'));}})[_0x1499('0x20')](function(){if(_0x5d5d56){return _0x5d5d56[_0x1499('0x101')]({'raw':!![]});}})[_0x1499('0x20')](function(_0x3fbcbc){if(_0x5d5d56){if(_0x3fbcbc){_0x4352d0=_0x3fbcbc;if(_0x4352d0['length']){var _0xc9d8ec=_0x4352d0['map'](function(_0x3a3fb7){var _0x16d6c3={'membername':_0x5d5d56[_0x1499('0x3c')],'UserId':_0x5d5d56['id'],'queue_name':_0x3a3fb7[_0x1499('0x3c')],'VoiceQueueId':_0x3a3fb7['id'],'interface':_0x415220,'paused':_0x5d5d56[_0x1499('0xa4')]||![],'penalty':_0x3a3fb7['UserVoiceQueue.penalty']||0x0};return db[_0x1499('0xb1')]['upsert'](_0x16d6c3);});return Promise['all'](_0xc9d8ec);}}}})[_0x1499('0x20')](function(){if(_0x5d5d56){return db[_0x1499('0x102')][_0x1499('0x54')]({'where':{'membername':_0x5d5d56[_0x1499('0x3c')],'exitAt':null}});}})['then'](function(_0x3dd411){if(_0x5d5d56){var _0x5d962b=[];_0x3dd411[_0x1499('0x103')](function(_0x4af7cf){_0x5d962b['push'](_0x4af7cf[_0x1499('0x62')]({'exitAt':moment()['format'](_0x1499('0x104'))}));});return Promise['all'](_0x5d962b);}})[_0x1499('0x20')](function(){if(_0x5d5d56){var _0x27ea54=[];var _0x2d7b21=[];var _0x436384=utils[_0x1499('0x105')]();var _0x318346={'membername':_0x5d5d56[_0x1499('0x3c')],'interface':_0x415220,'enterAt':moment()[_0x1499('0xb0')](_0x1499('0x104')),'role':_0x5d5d56['role'],'internal':_0x5d5d56['internal']};_0x436384[_0x1499('0x103')](function(_0x2b117d){_0x27ea54['push'](_[_0x1499('0x5f')]({'channel':_0x2b117d,'type':_0x1499('0x106'),'data1':_0x34ecc4['body'][_0x1499('0x107')],'data2':_0x415220},_0x318346));if(_0x5d5d56['loginInPause']){_0x2d7b21[_0x1499('0x53')](_[_0x1499('0x5f')]({'channel':_0x2b117d,'type':_0x1499('0x108'),'data1':_0x1499('0x109')},_0x318346));}});return db[_0x1499('0x102')][_0x1499('0x8c')](_0x27ea54[_0x1499('0xcd')](_0x2d7b21),{'individualHooks':!![]});}})['then'](function(){if(_0x5d5d56){return _0x5d5d56[_0x1499('0x62')]({'online':!![],'lastLoginAt':moment()[_0x1499('0xb0')](_0x1499('0x104')),'voicePause':_0x5d5d56[_0x1499('0xa4')]||![],'mailPause':_0x5d5d56['loginInPause']||![],'chatPause':_0x5d5d56[_0x1499('0xa4')]||![],'faxPause':_0x5d5d56[_0x1499('0xa4')]||![],'smsPause':_0x5d5d56[_0x1499('0xa4')]||![],'openchannelPause':_0x5d5d56['loginInPause']||![],'whatsappPause':_0x5d5d56[_0x1499('0xa4')]||![],'pauseType':_0x5d5d56[_0x1499('0xa4')]?_0x1499('0x109'):null,'interface':_0x415220,'lastPauseAt':moment()[_0x1499('0xb0')](_0x1499('0x104'))});}})[_0x1499('0x20')](function(_0x41d785){if(_0x34ecc4[_0x1499('0x10a')]){return _0x303b2d();}else{return Promise['resolve'](_0x41d785)['then'](respondWithResult(_0x6b4758,null));}})[_0x1499('0x2b')](handleError(_0x6b4758,null));};exports[_0x1499('0x10b')]=function(_0x41dbd6,_0x269e1c){var _0xac593e;return db['User'][_0x1499('0x3b')]({'where':{'id':_0x41dbd6[_0x1499('0x64')]['id'],'role':_0x1499('0x2d')},'attributes':['id','name',_0x1499('0x2c')]})[_0x1499('0x20')](handleEntityNotFound(_0x269e1c,null))[_0x1499('0x20')](function(_0x2f9c55){if(_0x2f9c55){_0xac593e=_0x2f9c55;return db[_0x1499('0xb1')][_0x1499('0x30')]({'where':{'membername':_0xac593e['name']},'individualHooks':!![]});}})[_0x1499('0x20')](function(){return db[_0x1499('0x102')][_0x1499('0x54')]({'where':{'membername':_0xac593e[_0x1499('0x3c')],'exitAt':null}});})[_0x1499('0x20')](function(_0xa9fd30){var _0x3251d9=[];_0xa9fd30['forEach'](function(_0x2075af){_0x3251d9[_0x1499('0x53')](_0x2075af[_0x1499('0x62')]({'exitAt':moment()['format'](_0x1499('0x104'))}));});return Promise[_0x1499('0x61')](_0x3251d9);})[_0x1499('0x20')](function(){return _0xac593e['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1499('0x20')](respondWithResult(_0x269e1c,null))[_0x1499('0x2b')](handleError(_0x269e1c,null));};exports[_0x1499('0x10c')]=function(_0x34b132,_0x25bb35){var _0x46c8b4;return db['UserVoiceQueueRt'][_0x1499('0x62')]({'paused':0x1},{'where':{'UserId':_0x34b132[_0x1499('0x64')]['id']},'individualHooks':!![]})[_0x1499('0x20')](function(){return db['User'][_0x1499('0x3b')]({'where':{'id':_0x34b132['params']['id'],'role':'agent'},'attributes':['id','name',_0x1499('0x2c'),'internal',_0x1499('0xa6'),_0x1499('0xa3')]});})[_0x1499('0x20')](handleEntityNotFound(_0x25bb35,null))[_0x1499('0x20')](function(_0x4a277a){if(_0x4a277a){_0x46c8b4=_0x4a277a;return respondWithRpcPromise(_0x1499('0x10d'),_0x1499('0x10c'),{'id':_0x46c8b4['id'],'name':_0x46c8b4['name'],'pause':!![]});}})['then'](function(){if(_0x46c8b4){return db[_0x1499('0x102')]['findAll']({'where':{'membername':_0x46c8b4[_0x1499('0x3c')],'type':_0x1499('0x108'),'exitAt':null}});}})[_0x1499('0x20')](function(_0x52a9f1){if(_0x52a9f1[_0x1499('0x57')]){var _0x29a890=moment()[_0x1499('0xb0')](_0x1499('0x104'));for(var _0x51b82f=0x0,_0x375ece=_0x52a9f1[_0x1499('0x57')];_0x51b82f<_0x375ece;_0x51b82f++){_0x52a9f1[_0x51b82f][_0x1499('0x10e')]({'exitAt':_0x29a890});}}})['then'](function(){var _0x56d0d3=[];var _0x59aa51=utils[_0x1499('0x105')]();_0x59aa51[_0x1499('0x103')](function(_0x1007b4){_0x56d0d3[_0x1499('0x53')]({'channel':_0x1007b4,'membername':_0x46c8b4[_0x1499('0x3c')],'interface':_[_0x1499('0x6e')](_0x46c8b4[_0x1499('0xa6')])?util[_0x1499('0xb0')](_0x1499('0xf8'),_0x46c8b4[_0x1499('0x3c')]):_0x46c8b4['interface'],'type':_0x1499('0x108'),'enterAt':moment()[_0x1499('0xb0')](_0x1499('0x104')),'data1':_0x34b132[_0x1499('0x63')][_0x1499('0x44')]||_0x1499('0x10f'),'role':_0x46c8b4[_0x1499('0x2c')],'internal':_0x46c8b4[_0x1499('0x69')]});});return db[_0x1499('0x102')][_0x1499('0x8c')](_0x56d0d3,{'individualHooks':!![]});})[_0x1499('0x20')](function(){return _0x46c8b4['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x34b132[_0x1499('0x63')][_0x1499('0x44')]||_0x1499('0x10f'),'lastPauseAt':moment()[_0x1499('0xb0')](_0x1499('0x104'))});})['then'](respondWithResult(_0x25bb35,null))[_0x1499('0x2b')](handleError(_0x25bb35,null));};exports['unpause']=function(_0x578eda,_0xec07cf){if(_0x578eda[_0x1499('0x63')][_0x1499('0xa2')]&&!utils[_0x1499('0xa7')](_0x578eda['body'][_0x1499('0xa2')])){throw new APIBadRequestError(util[_0x1499('0xb0')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x578eda[_0x1499('0x63')][_0x1499('0xa2')]));}return db[_0x1499('0x40')][_0x1499('0x3b')]({'where':{'id':_0x578eda[_0x1499('0x64')]['id']},'attributes':['id',_0x1499('0x3c'),'role',_0x1499('0x69'),_0x1499('0xa6'),_0x1499('0xa3'),_0x1499('0xa5'),_0x1499('0x110'),_0x1499('0x111'),_0x1499('0x112'),'openchannelPause',_0x1499('0x113'),_0x1499('0x114'),_0x1499('0x115'),_0x1499('0x116')]})['then'](function(_0x4d5042){if(!_0x4d5042){throw new APINotFoundError(util[_0x1499('0xb0')](_0x1499('0x117'),_0x578eda[_0x1499('0x64')]['id']));}return _0x4d5042['unpause'](_0x578eda[_0x1499('0x63')][_0x1499('0xa2')]);})[_0x1499('0x20')](respondWithResult(_0xec07cf,null))[_0x1499('0x2b')](APIHandleError(_0xec07cf));};exports[_0x1499('0x118')]=function(_0x960e13,_0x1392c7){var _0x1128bd={};var _0x4c3ea1={};var _0x3afe3e;var _0x1194be;return db[_0x1499('0x40')]['findOne']({'where':{'id':_0x960e13[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x1392c7,null))[_0x1499('0x20')](function(_0x12c38c){if(_0x12c38c){_0x3afe3e=_0x12c38c;_0x4c3ea1['model']=_[_0x1499('0xd6')](db[_0x1499('0x119')][_0x1499('0x41')]);_0x4c3ea1[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x960e13[_0x1499('0x4c')]);_0x4c3ea1[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x4c3ea1['model'],_0x4c3ea1[_0x1499('0x4c')]);_0x1128bd[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x4c3ea1[_0x1499('0xd8')],qs[_0x1499('0xd9')](_0x960e13['query'][_0x1499('0xd9')]));_0x1128bd['attributes']=_0x1128bd[_0x1499('0x52')][_0x1499('0x57')]?_0x1128bd[_0x1499('0x52')]:_0x4c3ea1['model'];_0x1128bd[_0x1499('0xda')]=qs['sort'](_0x960e13['query']['sort']);_0x1128bd['where']=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x960e13['query'],_0x4c3ea1[_0x1499('0xde')]));if(_0x960e13['query'][_0x1499('0x37')]){_0x1128bd[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0x1128bd[_0x1499('0xdc')],{'$or':_[_0x1499('0x42')](_0x1128bd[_0x1499('0x52')],function(_0x5fdbf5){var _0xb2af75={};_0xb2af75[_0x5fdbf5]={'$like':'%'+_0x960e13['query']['filter']+'%'};return _0xb2af75;})});}_0x1128bd=_[_0x1499('0x5f')]({},_0x1128bd,_0x960e13[_0x1499('0x60')]);return _0x3afe3e[_0x1499('0x118')](_0x1128bd);}})[_0x1499('0x20')](function(_0x4689e8){if(_0x4689e8){_0x1194be=_0x4689e8[_0x1499('0x57')];if(!_0x960e13[_0x1499('0x4c')]['hasOwnProperty'](_0x1499('0xdf'))){_0x1128bd[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x960e13[_0x1499('0x4c')][_0x1499('0x1a')]);_0x1128bd['offset']=qs['offset'](_0x960e13[_0x1499('0x4c')][_0x1499('0x19')]);}return _0x3afe3e[_0x1499('0x118')](_0x1128bd);}})[_0x1499('0x20')](function(_0x199e95){if(_0x199e95){return _0x199e95?{'count':_0x1194be,'rows':_0x199e95}:null;}})[_0x1499('0x20')](respondWithResult(_0x1392c7,null))['catch'](handleError(_0x1392c7,null));};exports[_0x1499('0x11a')]=function(_0x1d7bbe,_0x34161f){var _0x27ee96=_0x1d7bbe[_0x1499('0x64')]['id'];var _0x13f693=_0x1d7bbe[_0x1499('0x63')]?_0x1d7bbe[_0x1499('0x63')]['ids']:null;var _0x1b2da9=[];return Promise['resolve']()[_0x1499('0x20')](function(){if(!_0x13f693)throw new APIBadRequestError(_0x1499('0x11b'));})[_0x1499('0x20')](function(){return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x27ee96}});})[_0x1499('0x20')](function(_0x42c23e){if(!_0x42c23e)throw new APINotFoundError(util[_0x1499('0xb0')](_0x1499('0x117'),_0x1d7bbe[_0x1499('0x64')]['id']));return db[_0x1499('0x70')]['transaction'](function(_0x1be43d){return _0x42c23e[_0x1499('0x11a')](_0x13f693,{'transaction':_0x1be43d})['then'](function(){return db[_0x1499('0x119')][_0x1499('0x54')]({'where':{'id':{'$in':_0x13f693}}});})['then'](function(_0x1cd460){var _0x2d1a3c=_['map'](_0x1cd460,function(_0x5bab75){return _0x5bab75[_0x1499('0x11c')]();});return Promise[_0x1499('0x61')](_0x2d1a3c);})[_0x1499('0x20')](function(_0x25cbd7){_0x1b2da9=_[_0x1499('0x11d')](_0x25cbd7);var _0x25e4c9=_[_0x1499('0x42')](_0x1b2da9,function(_0x444307){return _0x444307[_0x1499('0x11e')](_0x42c23e['id'],{'transaction':_0x1be43d});});return Promise[_0x1499('0x61')](_0x25e4c9);})['then'](function(){if(!_0x42c23e[_0x1499('0xa3')])return;var _0x2e96f2=_[_0x1499('0x37')](_0x1b2da9,function(_0x504893){return _0x504893[_0x1499('0x11f')]('channel')==='Voice';});var _0x3a7ec7=_['map'](_0x2e96f2,function(_0x14f635){return db['UserVoiceQueueRt'][_0x1499('0x120')]({'membername':_0x42c23e[_0x1499('0x3c')],'UserId':_0x42c23e['id'],'queue_name':_0x14f635[_0x1499('0x3c')],'VoiceQueueId':_0x14f635['id'],'interface':_[_0x1499('0x6e')](_0x42c23e['interface'])?util['format'](_0x1499('0xf8'),_0x42c23e[_0x1499('0x3c')]):_0x42c23e[_0x1499('0xa6')],'paused':_0x42c23e[_0x1499('0xa5')]||![],'penalty':_0x42c23e[_0x1499('0xa9')]},{'transaction':_0x1be43d});});return Promise[_0x1499('0x61')](_0x3a7ec7);})[_0x1499('0x20')](function(){return db[_0x1499('0x121')][_0x1499('0x54')]({'where':{'teamId':{'$in':_0x13f693}}});})['then'](function(_0x1844f8){var _0x477c73=_[_0x1499('0x42')](_0x1844f8,function(_0x3ad9e7){return db[_0x1499('0x122')][_0x1499('0x85')]({'UserId':_0x42c23e['id'],'VoicePrefixId':_0x3ad9e7[_0x1499('0x123')]},{'transaction':_0x1be43d});});return Promise[_0x1499('0x61')](_0x477c73);});});})['then'](function(){for(var _0x2a1e4b=0x0;_0x2a1e4b<_0x1b2da9[_0x1499('0x57')];_0x2a1e4b++){var _0x1ab192=_0x1b2da9[_0x2a1e4b][_0x1499('0x11f')](_0x1499('0xa2'));var _0x2d4570=_0x1ab192+'QueueId';socket[_0x1499('0x2e')](_0x1499('0x33')+_0x1ab192+'Queue:save',{'UserId':_0x27ee96,['queueField']:_0x1b2da9[_0x2a1e4b]['id']});}})['then'](respondWithStatusCode(_0x34161f,null))[_0x1499('0x2b')](APIHandleError(_0x34161f));};exports[_0x1499('0x124')]=function(_0x390b4d,_0x3b3175){var _0x11887d=_0x390b4d['params']['id'];var _0x3f8281=null;if(_0x390b4d[_0x1499('0x4c')][_0x1499('0x67')]){_0x3f8281=_[_0x1499('0xb6')](_0x390b4d['query'][_0x1499('0x67')])?_0x390b4d[_0x1499('0x4c')]['ids']:[_0x390b4d['query'][_0x1499('0x67')]];}var _0x7c8809=[];return Promise[_0x1499('0x125')]()[_0x1499('0x20')](function(){if(!_0x3f8281)throw new APIBadRequestError(_0x1499('0x126'));})[_0x1499('0x20')](function(){return db[_0x1499('0x40')]['findOne']({'where':{'id':_0x11887d}});})[_0x1499('0x20')](function(_0x30990d){if(!_0x30990d)throw new APINotFoundError(util[_0x1499('0xb0')](_0x1499('0x117'),_0x390b4d[_0x1499('0x64')]['id']));return db['sequelize']['transaction'](function(_0x23f84c){return _0x30990d[_0x1499('0x124')](_0x3f8281,{'transaction':_0x23f84c})[_0x1499('0x20')](function(){return db[_0x1499('0x119')][_0x1499('0x54')]({'where':{'id':{'$in':_0x3f8281}}});})['then'](function(_0x21f7c2){var _0x2896be=_[_0x1499('0x42')](_0x21f7c2,function(_0x5c85ab){return _0x5c85ab[_0x1499('0x11c')]();});return Promise[_0x1499('0x61')](_0x2896be);})[_0x1499('0x20')](function(_0x4a55db){_0x7c8809=_[_0x1499('0x11d')](_0x4a55db);var _0x528bd3=_[_0x1499('0x42')](_0x7c8809,function(_0x19b11d){return _0x19b11d[_0x1499('0x127')](_0x30990d['id'],{'transaction':_0x23f84c});});return Promise[_0x1499('0x61')](_0x528bd3);})[_0x1499('0x20')](function(){if(!_0x30990d[_0x1499('0xa3')])return;var _0x2bf0f9=_[_0x1499('0x37')](_0x7c8809,function(_0x127cef){return _0x127cef[_0x1499('0x11f')]('channel')===_0x1499('0x128');});var _0x423b4d=_[_0x1499('0x42')](_0x2bf0f9,function(_0x34fc4e){return db[_0x1499('0xb1')][_0x1499('0x30')]({'where':{'VoiceQueueId':_0x34fc4e['id'],'UserId':_0x30990d['id']},'transaction':_0x23f84c});});return Promise[_0x1499('0x61')](_0x423b4d);})[_0x1499('0x20')](function(){return db[_0x1499('0x121')][_0x1499('0x54')]({'where':{'teamId':{'$in':_0x3f8281}}});})['then'](function(_0x1d13f8){var _0x1c2ed8=_['map'](_0x1d13f8,function(_0x452da4){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x30990d['id'],'VoicePrefixId':_0x452da4[_0x1499('0x123')]}},{'transaction':_0x23f84c});});return Promise[_0x1499('0x61')](_0x1c2ed8);});});})[_0x1499('0x20')](function(){for(var _0x272329=0x0;_0x272329<_0x7c8809['length'];_0x272329++){var _0x2cfe8f=_0x7c8809[_0x272329][_0x1499('0x11f')](_0x1499('0xa2'));var _0x54fd2e=_0x2cfe8f+_0x1499('0xb7');socket[_0x1499('0x2e')](_0x1499('0x33')+_0x2cfe8f+'Queue:remove',{'UserId':_0x11887d,['queueField']:_0x7c8809[_0x272329]['id']});}})[_0x1499('0x20')](respondWithStatusCode(_0x3b3175,null))[_0x1499('0x2b')](APIHandleError(_0x3b3175));};exports['getLists']=function(_0x1f9d75,_0x4c541b){var _0x4a738e={};var _0x12380d={};var _0x336d22;var _0xa7c64d;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x1f9d75['params']['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x4c541b,null))['then'](function(_0x2e2160){if(_0x2e2160){_0x336d22=_0x2e2160;_0x12380d[_0x1499('0xd8')]=_['keys'](db[_0x1499('0xcf')][_0x1499('0x41')]);_0x12380d[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x1f9d75[_0x1499('0x4c')]);_0x12380d['filters']=_['intersection'](_0x12380d[_0x1499('0xd8')],_0x12380d[_0x1499('0x4c')]);_0x4a738e[_0x1499('0x52')]=_[_0x1499('0xe0')](_0x12380d[_0x1499('0xd8')],qs[_0x1499('0xd9')](_0x1f9d75[_0x1499('0x4c')][_0x1499('0xd9')]));_0x4a738e['attributes']=_0x4a738e['attributes'][_0x1499('0x57')]?_0x4a738e['attributes']:_0x12380d['model'];_0x4a738e[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x1f9d75[_0x1499('0x4c')][_0x1499('0xdb')]);_0x4a738e[_0x1499('0xdc')]=qs[_0x1499('0xde')](_[_0x1499('0xdd')](_0x1f9d75[_0x1499('0x4c')],_0x12380d[_0x1499('0xde')]));if(_0x1f9d75['query'][_0x1499('0x37')]){_0x4a738e['where']=_[_0x1499('0x5f')](_0x4a738e[_0x1499('0xdc')],{'$or':_[_0x1499('0x42')](_0x4a738e['attributes'],function(_0x1e6fbe){var _0x2ab441={};_0x2ab441[_0x1e6fbe]={'$like':'%'+_0x1f9d75[_0x1499('0x4c')][_0x1499('0x37')]+'%'};return _0x2ab441;})});}_0x4a738e=_['merge']({},_0x4a738e,_0x1f9d75['options']);return _0x336d22[_0x1499('0x129')](_0x4a738e);}})[_0x1499('0x20')](function(_0x502c8f){if(_0x502c8f){_0xa7c64d=_0x502c8f[_0x1499('0x57')];if(!_0x1f9d75[_0x1499('0x4c')][_0x1499('0xce')](_0x1499('0xdf'))){_0x4a738e[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x1f9d75['query'][_0x1499('0x1a')]);_0x4a738e[_0x1499('0x19')]=qs[_0x1499('0x19')](_0x1f9d75[_0x1499('0x4c')][_0x1499('0x19')]);}return _0x336d22['getLists'](_0x4a738e);}})[_0x1499('0x20')](function(_0x3a4bcb){if(_0x3a4bcb){return _0x3a4bcb?{'count':_0xa7c64d,'rows':_0x3a4bcb}:null;}})[_0x1499('0x20')](respondWithResult(_0x4c541b,null))[_0x1499('0x2b')](handleError(_0x4c541b,null));};exports[_0x1499('0x12a')]=function(_0x335bf6,_0x14ff43){var _0xd7a84b={};var _0x2a3339={};var _0x3ebc6f;return db[_0x1499('0x40')][_0x1499('0x9c')]({'where':{'id':_0x335bf6[_0x1499('0x64')]['id']}})[_0x1499('0x20')](handleEntityNotFound(_0x14ff43,null))['then'](function(_0x131a2a){if(_0x131a2a){_0x3ebc6f=_0x131a2a;_0x2a3339['model']=_[_0x1499('0xd6')](db[_0x1499('0x40')]['rawAttributes']);_0x2a3339[_0x1499('0x4c')]=_[_0x1499('0xd6')](_0x335bf6[_0x1499('0x4c')]);_0x2a3339[_0x1499('0xde')]=_[_0x1499('0xe0')](_0x2a3339[_0x1499('0xd8')],_0x2a3339['query']);_0xd7a84b['attributes']=_[_0x1499('0xe0')](_0x2a3339[_0x1499('0xd8')],qs['fields'](_0x335bf6[_0x1499('0x4c')][_0x1499('0xd9')]));_0xd7a84b[_0x1499('0x52')]=_0xd7a84b[_0x1499('0x52')]['length']?_0xd7a84b[_0x1499('0x52')]:_0x2a3339['model'];_0xd7a84b[_0x1499('0xda')]=qs[_0x1499('0xdb')](_0x335bf6[_0x1499('0x4c')]['sort']);_0xd7a84b[_0x1499('0xdc')]=qs['filters'](_[_0x1499('0xdd')](_0x335bf6[_0x1499('0x4c')],_0x2a3339[_0x1499('0xde')]));if(_0x335bf6[_0x1499('0x4c')][_0x1499('0x37')]){_0xd7a84b[_0x1499('0xdc')]=_[_0x1499('0x5f')](_0xd7a84b['where'],{'$or':_[_0x1499('0x42')](_0xd7a84b[_0x1499('0x52')],function(_0x3b424a){var _0x18cf30={};_0x18cf30[_0x3b424a]={'$like':'%'+_0x335bf6[_0x1499('0x4c')]['filter']+'%'};return _0x18cf30;})});}_0xd7a84b[_0x1499('0xd8')]=db[_0x1499('0x40')];_0xd7a84b['as']='Agents';_0xd7a84b=_['merge']({},_0xd7a84b,_0x335bf6[_0x1499('0x60')]);return _0x3ebc6f[_0x1499('0x101')]({'include':[_0xd7a84b]});}})[_0x1499('0x20')](function(_0x39997f){if(_0x39997f){var _0x1872bd={},_0x2810b7=[];for(var _0x2a8e6e=0x0;_0x2a8e6e<_0x39997f[_0x1499('0x57')];_0x2a8e6e+=0x1){for(var _0x452e35=0x0,_0x246920;_0x452e35<_0x39997f[_0x2a8e6e][_0x1499('0x34')]['length'];_0x452e35+=0x1){_0x246920=_0x39997f[_0x2a8e6e][_0x1499('0x34')][_0x452e35][_0x1499('0xae')]({'plain':!![]});_0x1872bd[_0x246920['id']]=_0x246920;}}_0x1872bd=_[_0x1499('0x12b')](_0x1872bd);for(var _0xdb98a8=qs['offset'](_0x335bf6[_0x1499('0x4c')][_0x1499('0x19')]);_0xdb98a8<_0x1872bd[_0x1499('0x57')]&&_0x2810b7['length']=_0x2474ca[_0xc1d5('0x4e')]){throw new Error(_0xc1d5('0x4f'));}})['then'](function(){if(_0x372410){return db[_0xc1d5('0x27')][_0xc1d5('0x43')]({'where':{'membername':_0x372410[_0xc1d5('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x372410){return _0x372410[_0xc1d5('0x50')]({'raw':!![]});}})[_0xc1d5('0x17')](function(_0x3ae74b){if(_0x372410){if(_0x3ae74b){var _0x84809b=[];_0x12f10c=_0x3ae74b;if(_0x12f10c['length']){for(var _0x5cbd76=0x0;_0x5cbd76<_0x12f10c[_0xc1d5('0x2b')];_0x5cbd76++){_0x84809b['push'](db[_0xc1d5('0x27')][_0xc1d5('0x51')]({'membername':_0x372410['name'],'UserId':_0x372410['id'],'queue_name':_0x12f10c[_0x5cbd76][_0xc1d5('0x21')],'VoiceQueueId':_0x12f10c[_0x5cbd76]['id'],'interface':_0x360a7b,'paused':_0x372410['loginInPause']||![],'penalty':_0x12f10c[_0x5cbd76][_0xc1d5('0x52')]||0x0}));}return BPromise[_0xc1d5('0x45')](_0x84809b);}}}})[_0xc1d5('0x17')](function(){if(_0x372410){return db[_0xc1d5('0x29')]['findAll']({'where':{'membername':_0x372410[_0xc1d5('0x21')],'exitAt':null}});}})[_0xc1d5('0x17')](function(_0x2f6092){if(_0x372410){if(_0x2f6092&&_0x2f6092['length']){var _0x2e457f=[];_0x2f6092['forEach'](function(_0x11ab6c){_0x2e457f[_0xc1d5('0x44')](_0x11ab6c[_0xc1d5('0x28')]({'exitAt':moment()[_0xc1d5('0x24')](_0xc1d5('0x2c'))}));});return BPromise[_0xc1d5('0x45')](_0x2e457f);}}})[_0xc1d5('0x17')](function(){if(_0x372410){var _0x41933f=[];var _0x5b9536=[];var _0x1b15d6=utils[_0xc1d5('0x2e')]();var _0x3837f8={'membername':_0x372410[_0xc1d5('0x21')],'interface':_0x360a7b,'enterAt':moment()['format'](_0xc1d5('0x2c')),'role':_0x372410[_0xc1d5('0x22')],'internal':_0x372410['internal']};_0x1b15d6[_0xc1d5('0x2f')](function(_0x30dfec){_0x41933f[_0xc1d5('0x44')](_[_0xc1d5('0x53')]({'channel':_0x30dfec,'type':_0xc1d5('0x54'),'data1':_0xc1d5('0x55'),'data2':_0x360a7b},_0x3837f8));if(_0x372410['loginInPause']){_0x5b9536[_0xc1d5('0x44')](_[_0xc1d5('0x53')]({'channel':_0x30dfec,'type':_0xc1d5('0x2a'),'data1':_0xc1d5('0x56')},_0x3837f8));}});return db['MemberReport'][_0xc1d5('0x35')](_0x41933f[_0xc1d5('0x57')](_0x5b9536),{'individualHooks':!![]});}})[_0xc1d5('0x17')](function(){if(_0x372410){return _0x372410[_0xc1d5('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0xc1d5('0x2c')),'voicePause':_0x372410['loginInPause']||![],'mailPause':_0x372410['loginInPause']||![],'chatPause':_0x372410[_0xc1d5('0x49')]||![],'faxPause':_0x372410[_0xc1d5('0x49')]||![],'smsPause':_0x372410[_0xc1d5('0x49')]||![],'openchannelPause':_0x372410[_0xc1d5('0x49')]||![],'pauseType':_0x372410[_0xc1d5('0x49')]?_0xc1d5('0x56'):null,'lastPauseAt':moment()[_0xc1d5('0x24')](_0xc1d5('0x2c')),'interface':_0x360a7b});}})['then'](function(_0x34ed7b){_0x17a4dd(_0x34ed7b);})[_0xc1d5('0x20')](function(_0x9b0fb0){_0x42ce7d(_0x198623[_0xc1d5('0x1c')](0x1f4,_0x9b0fb0[_0xc1d5('0x1d')]));});});}; \ No newline at end of file +var _0x4cec=['LOGININPAUSE','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','include','model','then','info','debug','stringify','catch','error','message','ShowUser','find','map','name','role','internal','interface','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','type','body','uniqueid','bulkCreate','DEFAULT\x20PAUSE','resolve','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','lastPauseAt','params','unpause','system','LogoutUser','update','all','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','callysquare','concat'];(function(_0x5b4930,_0x57daac){var _0x4c824d=function(_0x228a59){while(--_0x228a59){_0x5b4930['push'](_0x5b4930['shift']());}};_0x4c824d(++_0x57daac);}(_0x4cec,0xa9));var _0xc4ce=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4cec[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xc4ce('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var Redis=require(_0xc4ce('0x1'));var db=require(_0xc4ce('0x2'))['db'];var utils=require(_0xc4ce('0x3'));var logger=require(_0xc4ce('0x4'))(_0xc4ce('0x5'));var config=require(_0xc4ce('0x6'));config[_0xc4ce('0x7')]=_['defaults'](config[_0xc4ce('0x7')],{'host':_0xc4ce('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc4ce('0x9'))[_0xc4ce('0xa')](socket);exports[_0xc4ce('0xb')]=function(_0x49a1df){var _0x5a9ae2=this;return new Promise(function(_0x179831,_0x3dad9b){return db[_0xc4ce('0xc')][_0xc4ce('0xd')]({'raw':_0x49a1df[_0xc4ce('0xe')]?_0x49a1df[_0xc4ce('0xe')][_0xc4ce('0xf')]===undefined?!![]:![]:!![],'where':_0x49a1df[_0xc4ce('0xe')]?_0x49a1df[_0xc4ce('0xe')][_0xc4ce('0x10')]||null:null,'attributes':_0x49a1df[_0xc4ce('0xe')]?_0x49a1df[_0xc4ce('0xe')][_0xc4ce('0x11')]||null:null,'limit':_0x49a1df['options']?_0x49a1df[_0xc4ce('0xe')]['limit']||null:null,'include':_0x49a1df[_0xc4ce('0xe')]?_0x49a1df[_0xc4ce('0xe')]['include']?_['map'](_0x49a1df[_0xc4ce('0xe')][_0xc4ce('0x12')],function(_0x1dd76d){return{'model':db[_0x1dd76d['model']],'as':_0x1dd76d['as'],'attributes':_0x1dd76d['attributes'],'include':_0x1dd76d[_0xc4ce('0x12')]?_['map'](_0x1dd76d[_0xc4ce('0x12')],function(_0x44e9cf){return{'model':db[_0x44e9cf[_0xc4ce('0x13')]],'as':_0x44e9cf['as'],'attributes':_0x44e9cf[_0xc4ce('0x11')],'include':_0x44e9cf[_0xc4ce('0x12')]?_['map'](_0x44e9cf[_0xc4ce('0x12')],function(_0x54bf96){return{'model':db[_0x54bf96[_0xc4ce('0x13')]],'as':_0x54bf96['as'],'attributes':_0x54bf96[_0xc4ce('0x11')]};}):[]};}):[]};}):[]:[]})[_0xc4ce('0x14')](function(_0x4cd223){logger[_0xc4ce('0x15')]('GetUser',_0x49a1df);logger[_0xc4ce('0x16')](_0xc4ce('0xb'),_0x49a1df,JSON[_0xc4ce('0x17')](_0x4cd223));_0x179831(_0x4cd223);})[_0xc4ce('0x18')](function(_0x104e8e){logger[_0xc4ce('0x19')](_0xc4ce('0xb'),_0x104e8e[_0xc4ce('0x1a')],_0x49a1df);_0x3dad9b(_0x5a9ae2[_0xc4ce('0x19')](0x1f4,_0x104e8e[_0xc4ce('0x1a')]));});});};exports[_0xc4ce('0x1b')]=function(_0x78d80){var _0x1b3a0e=this;return new Promise(function(_0x349c3e,_0x335e05){return db['User'][_0xc4ce('0x1c')]({'raw':_0x78d80[_0xc4ce('0xe')]?_0x78d80[_0xc4ce('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x78d80[_0xc4ce('0xe')]?_0x78d80['options'][_0xc4ce('0x10')]||null:null,'attributes':_0x78d80[_0xc4ce('0xe')]?_0x78d80[_0xc4ce('0xe')][_0xc4ce('0x11')]||null:null,'include':_0x78d80[_0xc4ce('0xe')]?_0x78d80[_0xc4ce('0xe')][_0xc4ce('0x12')]?_[_0xc4ce('0x1d')](_0x78d80[_0xc4ce('0xe')]['include'],function(_0x2de936){return{'model':db[_0x2de936[_0xc4ce('0x13')]],'as':_0x2de936['as'],'attributes':_0x2de936[_0xc4ce('0x11')],'include':_0x2de936[_0xc4ce('0x12')]?_['map'](_0x2de936[_0xc4ce('0x12')],function(_0x65120b){return{'model':db[_0x65120b['model']],'as':_0x65120b['as'],'attributes':_0x65120b[_0xc4ce('0x11')],'include':_0x65120b[_0xc4ce('0x12')]?_['map'](_0x65120b['include'],function(_0x50fc93){return{'model':db[_0x50fc93[_0xc4ce('0x13')]],'as':_0x50fc93['as'],'attributes':_0x50fc93['attributes']};}):[]};}):[]};}):[]:[]})[_0xc4ce('0x14')](function(_0x35d497){logger[_0xc4ce('0x15')](_0xc4ce('0x1b'),_0x78d80);logger[_0xc4ce('0x16')](_0xc4ce('0x1b'),_0x78d80,JSON[_0xc4ce('0x17')](_0x35d497));_0x349c3e(_0x35d497);})[_0xc4ce('0x18')](function(_0x57d4bc){logger[_0xc4ce('0x19')](_0xc4ce('0x1b'),_0x57d4bc[_0xc4ce('0x1a')],_0x78d80);_0x335e05(_0x1b3a0e[_0xc4ce('0x19')](0x1f4,_0x57d4bc['message']));});});};exports['PauseUser']=function(_0x28414b){var _0x5a8364;return db[_0xc4ce('0xc')][_0xc4ce('0x1c')]({'where':_0x28414b[_0xc4ce('0xe')]['where']||{},'attributes':['id',_0xc4ce('0x1e'),_0xc4ce('0x1f'),_0xc4ce('0x20'),_0xc4ce('0x21')]})[_0xc4ce('0x14')](function(_0x5179a5){if(!_0x5179a5){throw new Error(util['format'](_0xc4ce('0x22'),_0x28414b['params']['id']));}_0x5a8364=_0x5179a5;return db[_0xc4ce('0x23')]['update']({'paused':0x1},{'where':{'UserId':_0x5a8364['id']},'individualHooks':!![]});})[_0xc4ce('0x14')](function(){return db[_0xc4ce('0x24')][_0xc4ce('0xd')]({'where':{'membername':_0x5a8364[_0xc4ce('0x1e')],'type':_0xc4ce('0x25'),'exitAt':null}});})[_0xc4ce('0x14')](function(_0x3e000a){if(_0x3e000a&&_0x3e000a[_0xc4ce('0x26')]){var _0x3578b4=moment()[_0xc4ce('0x27')](_0xc4ce('0x28'));for(var _0x262393=0x0,_0x1876aa=_0x3e000a[_0xc4ce('0x26')];_0x262393<_0x1876aa;_0x262393++){_0x3e000a[_0x262393][_0xc4ce('0x29')]({'exitAt':_0x3578b4});}}})[_0xc4ce('0x14')](function(){var _0x143c58=[];var _0xeb96a=utils[_0xc4ce('0x2a')]();_0xeb96a[_0xc4ce('0x2b')](function(_0x19da46){_0x143c58[_0xc4ce('0x2c')]({'channel':_0x19da46,'membername':_0x5a8364[_0xc4ce('0x1e')],'interface':_[_0xc4ce('0x2d')](_0x5a8364['interface'])?util[_0xc4ce('0x27')](_0xc4ce('0x2e'),_0x5a8364['name']):_0x5a8364[_0xc4ce('0x21')],'type':_0xc4ce('0x25'),'enterAt':moment()[_0xc4ce('0x27')](_0xc4ce('0x28')),'data1':_0x28414b['body'][_0xc4ce('0x2f')]||'DEFAULT\x20PAUSE','role':_0x5a8364['role'],'internal':_0x5a8364['internal'],'uniqueid':_0x28414b[_0xc4ce('0x30')][_0xc4ce('0x31')]||null});});return db[_0xc4ce('0x24')][_0xc4ce('0x32')](_0x143c58,{'individualHooks':!![]});})[_0xc4ce('0x14')](function(){return _0x5a8364['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x28414b[_0xc4ce('0x30')][_0xc4ce('0x2f')]||_0xc4ce('0x33'),'lastPauseAt':moment()[_0xc4ce('0x27')](_0xc4ce('0x28'))});})[_0xc4ce('0x18')](function(_0x427957){throw _0x427957;});};exports['UnpauseUser']=function(_0x2131ba){return Promise[_0xc4ce('0x34')]()[_0xc4ce('0x14')](function(){if(_0x2131ba[_0xc4ce('0x30')]['channel']&&!utils[_0xc4ce('0x35')](_0x2131ba[_0xc4ce('0x30')][_0xc4ce('0x36')])){throw new Error(util[_0xc4ce('0x27')](_0xc4ce('0x37'),_0x2131ba['body'][_0xc4ce('0x36')]));}return db[_0xc4ce('0xc')][_0xc4ce('0x38')]({'where':_0x2131ba[_0xc4ce('0xe')][_0xc4ce('0x10')]||{},'attributes':['id',_0xc4ce('0x1e'),_0xc4ce('0x1f'),_0xc4ce('0x20'),_0xc4ce('0x21'),_0xc4ce('0x39'),_0xc4ce('0x3a'),_0xc4ce('0x3b'),_0xc4ce('0x3c'),_0xc4ce('0x3d'),_0xc4ce('0x3e'),_0xc4ce('0x3f'),'whatsappPause','pauseType',_0xc4ce('0x40')]});})[_0xc4ce('0x14')](function(_0x299230){if(!_0x299230){throw new Error(util[_0xc4ce('0x27')](_0xc4ce('0x22'),_0x2131ba[_0xc4ce('0x41')]['id']));}return _0x299230[_0xc4ce('0x42')](_0x2131ba[_0xc4ce('0x30')][_0xc4ce('0x36')],_0xc4ce('0x43'));})[_0xc4ce('0x18')](function(_0x3a382c){throw _0x3a382c;});};exports[_0xc4ce('0x44')]=function(_0x5407fe){var _0x4358a3=this;return new Promise(function(_0x551f9e,_0x5f026d){var _0xbb4fa0;return db[_0xc4ce('0xc')][_0xc4ce('0x38')]({'where':_0x5407fe[_0xc4ce('0xe')]['where']||{},'attributes':['id',_0xc4ce('0x1e')]})[_0xc4ce('0x14')](function(_0x162f11){if(_0x162f11){_0xbb4fa0=_0x162f11;return db[_0xc4ce('0x23')]['destroy']({'where':{'membername':_0xbb4fa0[_0xc4ce('0x1e')]},'individualHooks':!![]});}})[_0xc4ce('0x14')](function(){if(_0xbb4fa0){return db[_0xc4ce('0x24')][_0xc4ce('0xd')]({'where':{'membername':_0xbb4fa0['name'],'exitAt':null}});}})[_0xc4ce('0x14')](function(_0x35d674){if(_0xbb4fa0){if(_0x35d674&&_0x35d674[_0xc4ce('0x26')]){var _0x4e6dd9=[];_0x35d674[_0xc4ce('0x2b')](function(_0x16325b){_0x4e6dd9[_0xc4ce('0x2c')](_0x16325b[_0xc4ce('0x45')]({'exitAt':moment()[_0xc4ce('0x27')](_0xc4ce('0x28'))}));});return BPromise[_0xc4ce('0x46')](_0x4e6dd9);}}})[_0xc4ce('0x14')](function(){if(_0xbb4fa0){return _0xbb4fa0[_0xc4ce('0x45')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xc4ce('0x14')](function(_0x81cdf9){_0x551f9e(_0x81cdf9);})['catch'](function(_0x4f948c){_0x5f026d(_0x4358a3[_0xc4ce('0x19')](0x1f4,_0x4f948c['message']));});});};exports['LoginUser']=function(_0xafc4b){var _0x1afd4b=this;return new Promise(function(_0x480f82,_0x51e4e8){var _0x51d1d3;var _0x104bf9;var _0x3bb34a;var _0x534214;return db[_0xc4ce('0xc')][_0xc4ce('0x38')]({'where':_0xafc4b['options'][_0xc4ce('0x10')]||{},'attributes':['id',_0xc4ce('0x1e'),_0xc4ce('0x1f'),'mobile',_0xc4ce('0x47'),_0xc4ce('0x20'),_0xc4ce('0x48'),'interface']})['then'](function(_0xe60518){if(_0xe60518){_0x51d1d3=_0xe60518;_0x534214=_0xafc4b[_0xc4ce('0x30')][_0xc4ce('0x21')]?_0xafc4b[_0xc4ce('0x30')][_0xc4ce('0x21')]:util[_0xc4ce('0x27')](_0xc4ce('0x2e'),_0x51d1d3[_0xc4ce('0x1e')]);return db[_0xc4ce('0xc')][_0xc4ce('0x49')]({'where':{'role':_0xc4ce('0x4a'),'online':!![],'id':{'$ne':_0x51d1d3['id']}}});}})[_0xc4ce('0x14')](function(_0x636e8d){if(_0x636e8d){_0x3bb34a=_0x636e8d;return require('../../config/license/util')[_0xc4ce('0x4b')]();}})['then'](function(_0x119e63){if(_0x119e63&&_0x119e63[_0xc4ce('0x4c')]&&_0x3bb34a>=_0x119e63[_0xc4ce('0x4c')]){throw new Error(_0xc4ce('0x4d'));}})[_0xc4ce('0x14')](function(){if(_0x51d1d3){return db[_0xc4ce('0x23')]['destroy']({'where':{'membername':_0x51d1d3[_0xc4ce('0x1e')]},'individualHooks':!![]});}})[_0xc4ce('0x14')](function(){if(_0x51d1d3){return _0x51d1d3[_0xc4ce('0x4e')]({'raw':!![]});}})['then'](function(_0x37dc41){if(_0x51d1d3){if(_0x37dc41){var _0x804aec=[];_0x104bf9=_0x37dc41;if(_0x104bf9[_0xc4ce('0x26')]){for(var _0x243600=0x0;_0x243600<_0x104bf9[_0xc4ce('0x26')];_0x243600++){_0x804aec[_0xc4ce('0x2c')](db[_0xc4ce('0x23')][_0xc4ce('0x4f')]({'membername':_0x51d1d3[_0xc4ce('0x1e')],'UserId':_0x51d1d3['id'],'queue_name':_0x104bf9[_0x243600]['name'],'VoiceQueueId':_0x104bf9[_0x243600]['id'],'interface':_0x534214,'paused':_0x51d1d3['loginInPause']||![],'penalty':_0x104bf9[_0x243600][_0xc4ce('0x50')]||0x0}));}return BPromise[_0xc4ce('0x46')](_0x804aec);}}}})[_0xc4ce('0x14')](function(){if(_0x51d1d3){return db[_0xc4ce('0x24')]['findAll']({'where':{'membername':_0x51d1d3[_0xc4ce('0x1e')],'exitAt':null}});}})['then'](function(_0x3eb00a){if(_0x51d1d3){if(_0x3eb00a&&_0x3eb00a[_0xc4ce('0x26')]){var _0x3d247b=[];_0x3eb00a[_0xc4ce('0x2b')](function(_0xcaaf82){_0x3d247b[_0xc4ce('0x2c')](_0xcaaf82[_0xc4ce('0x45')]({'exitAt':moment()['format'](_0xc4ce('0x28'))}));});return BPromise[_0xc4ce('0x46')](_0x3d247b);}}})[_0xc4ce('0x14')](function(){if(_0x51d1d3){var _0x45095a=[];var _0xf94a63=[];var _0x3cde69=utils[_0xc4ce('0x2a')]();var _0x148742={'membername':_0x51d1d3[_0xc4ce('0x1e')],'interface':_0x534214,'enterAt':moment()['format'](_0xc4ce('0x28')),'role':_0x51d1d3[_0xc4ce('0x1f')],'internal':_0x51d1d3[_0xc4ce('0x20')]};_0x3cde69[_0xc4ce('0x2b')](function(_0x5d372f){_0x45095a[_0xc4ce('0x2c')](_['merge']({'channel':_0x5d372f,'type':'LOGIN','data1':_0xc4ce('0x51'),'data2':_0x534214},_0x148742));if(_0x51d1d3[_0xc4ce('0x48')]){_0xf94a63[_0xc4ce('0x2c')](_['merge']({'channel':_0x5d372f,'type':_0xc4ce('0x25'),'data1':'LOGININPAUSE'},_0x148742));}});return db[_0xc4ce('0x24')][_0xc4ce('0x32')](_0x45095a[_0xc4ce('0x52')](_0xf94a63),{'individualHooks':!![]});}})['then'](function(){if(_0x51d1d3){return _0x51d1d3['update']({'online':!![],'lastLoginAt':moment()['format'](_0xc4ce('0x28')),'voicePause':_0x51d1d3['loginInPause']||![],'mailPause':_0x51d1d3[_0xc4ce('0x48')]||![],'chatPause':_0x51d1d3[_0xc4ce('0x48')]||![],'faxPause':_0x51d1d3[_0xc4ce('0x48')]||![],'smsPause':_0x51d1d3[_0xc4ce('0x48')]||![],'openchannelPause':_0x51d1d3['loginInPause']||![],'pauseType':_0x51d1d3[_0xc4ce('0x48')]?_0xc4ce('0x53'):null,'lastPauseAt':moment()[_0xc4ce('0x27')](_0xc4ce('0x28')),'interface':_0x534214});}})[_0xc4ce('0x14')](function(_0x531472){_0x480f82(_0x531472);})[_0xc4ce('0x18')](function(_0x5225b2){_0x51e4e8(_0x1afd4b['error'](0x1f4,_0x5225b2['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 453e7bc..8c9e531 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 _0x4a40=['update','emit','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4a40,0x14a));var _0x04a4=function(_0x55adee,_0x4d9108){_0x55adee=_0x55adee-0x0;var _0x5f0455=_0x4a40[_0x55adee];return _0x5f0455;};'use strict';var UserEvents=require(_0x04a4('0x0'));var events=[_0x04a4('0x1'),_0x04a4('0x2'),_0x04a4('0x3')];function createListener(_0x34b61e,_0xf19ad7){return function(_0x4cf806){_0xf19ad7[_0x04a4('0x4')](_0x34b61e,_0x4cf806);};}function removeListener(_0x8bb10,_0x31ba4d){return function(){UserEvents[_0x04a4('0x5')](_0x8bb10,_0x31ba4d);};}exports[_0x04a4('0x6')]=function(_0x445b9d){for(var _0x1f6c45=0x0,_0x278be3=events[_0x04a4('0x7')];_0x1f6c45<_0x278be3;_0x1f6c45++){var _0x5b7361=events[_0x1f6c45];var _0x46f3c3=createListener(_0x04a4('0x8')+_0x5b7361,_0x445b9d);UserEvents['on'](_0x5b7361,_0x46f3c3);}}; \ No newline at end of file +var _0x9f2a=['removeListener','register','length','user:','./user.events','save','remove','update','emit'];(function(_0x4a699b,_0x461d1f){var _0x5e0cc6=function(_0x100767){while(--_0x100767){_0x4a699b['push'](_0x4a699b['shift']());}};_0x5e0cc6(++_0x461d1f);}(_0x9f2a,0x9d));var _0xa9f2=function(_0xc583c9,_0x2e0d87){_0xc583c9=_0xc583c9-0x0;var _0x5b13b5=_0x9f2a[_0xc583c9];return _0x5b13b5;};'use strict';var UserEvents=require(_0xa9f2('0x0'));var events=[_0xa9f2('0x1'),_0xa9f2('0x2'),_0xa9f2('0x3')];function createListener(_0x20770e,_0x1749f2){return function(_0x17a5fb){_0x1749f2[_0xa9f2('0x4')](_0x20770e,_0x17a5fb);};}function removeListener(_0x5cad8c,_0x138671){return function(){UserEvents[_0xa9f2('0x5')](_0x5cad8c,_0x138671);};}exports[_0xa9f2('0x6')]=function(_0x14da76){for(var _0x578f38=0x0,_0x5a883a=events[_0xa9f2('0x7')];_0x578f38<_0x5a883a;_0x578f38++){var _0x528734=events[_0x578f38];var _0x1702f3=createListener(_0xa9f2('0x8')+_0x528734,_0x14da76);UserEvents['on'](_0x528734,_0x1702f3);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 5c22410..8ee4464 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(_0x1818f4,_0x598dd3){var _0x546d98=function(_0x100a04){while(--_0x100a04){_0x1818f4['push'](_0x1818f4['shift']());}};_0x546d98(++_0x598dd3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x56d158,_0x3699d6){var _0x5ae715=function(_0x46e4a3){while(--_0x46e4a3){_0x56d158['push'](_0x56d158['shift']());}};_0x5ae715(++_0x3699d6);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index db1530b..0e0cad7 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 _0x0ac6=['INTEGER'];(function(_0x2fb866,_0x59bc0c){var _0x5d310f=function(_0x13bf75){while(--_0x13bf75){_0x2fb866['push'](_0x2fb866['shift']());}};_0x5d310f(++_0x59bc0c);}(_0x0ac6,0x188));var _0x60ac=function(_0x408a51,_0xd49817){_0x408a51=_0x408a51-0x0;var _0x454cf9=_0x0ac6[_0x408a51];return _0x454cf9;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x60ac('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf150=['INTEGER','sequelize','exports'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xf150,0x196));var _0x0f15=function(_0x49dfda,_0x5a59c0){_0x49dfda=_0x49dfda-0x0;var _0x3a7c9c=_0xf150[_0x49dfda];return _0x3a7c9c;};'use strict';var Sequelize=require(_0x0f15('0x0'));module[_0x0f15('0x1')]={'penalty':{'type':Sequelize[_0x0f15('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 a0dc063..235d17d 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 _0x8848=['api','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','lodash','../../config/logger'];(function(_0x350dc6,_0x36ab14){var _0x2e5887=function(_0x5370ad){while(--_0x5370ad){_0x350dc6['push'](_0x350dc6['shift']());}};_0x2e5887(++_0x36ab14);}(_0x8848,0x134));var _0x8884=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x8848[_0x211632];return _0x5a1da1;};'use strict';var _=require(_0x8884('0x0'));var util=require('util');var logger=require(_0x8884('0x1'))(_0x8884('0x2'));var moment=require('moment');var BPromise=require(_0x8884('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8884('0x4'));var rimraf=require(_0x8884('0x5'));var config=require(_0x8884('0x6'));var attributes=require(_0x8884('0x7'));module[_0x8884('0x8')]=function(_0x3d5023,_0x81a179){return _0x3d5023['define'](_0x8884('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x309a=['bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','api','moment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x309a,0x140));var _0xa309=function(_0x165995,_0x347887){_0x165995=_0x165995-0x0;var _0x946856=_0x309a[_0x165995];return _0x946856;};'use strict';var _=require(_0xa309('0x0'));var util=require(_0xa309('0x1'));var logger=require('../../config/logger')(_0xa309('0x2'));var moment=require(_0xa309('0x3'));var BPromise=require(_0xa309('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa309('0x5'));var rimraf=require(_0xa309('0x6'));var config=require(_0xa309('0x7'));var attributes=require(_0xa309('0x8'));module[_0xa309('0x9')]=function(_0x2c2381,_0x4f7e0c){return _0x2c2381['define'](_0xa309('0xa'),attributes,{'tableName':_0xa309('0xb'),'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 9628b67..18da589 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 _0xe30d=['../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1412c3,_0x3d4f35){var _0x25b589=function(_0x3fa3a9){while(--_0x3fa3a9){_0x1412c3['push'](_0x1412c3['shift']());}};_0x25b589(++_0x3d4f35);}(_0xe30d,0x1f3));var _0xde30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe30d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde30('0x0'));var util=require(_0xde30('0x1'));var moment=require(_0xde30('0x2'));var BPromise=require(_0xde30('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde30('0x4'));var db=require(_0xde30('0x5'))['db'];var utils=require(_0xde30('0x6'));var logger=require(_0xde30('0x7'))(_0xde30('0x8'));var config=require(_0xde30('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xde30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd3ec77,_0x439f4a,_0x3cc127){return new BPromise(function(_0x2ff698,_0x17af7c){return client['request'](_0xd3ec77,_0x3cc127)[_0xde30('0xb')](function(_0x44b008){logger[_0xde30('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x439f4a,_0xde30('0xd'));logger[_0xde30('0xe')](_0xde30('0xf'),_0x439f4a,_0xde30('0xd'),JSON[_0xde30('0x10')](_0x44b008));if(_0x44b008[_0xde30('0x11')]){if(_0x44b008['error'][_0xde30('0x12')]===0x1f4){logger['error'](_0xde30('0x13'),_0x439f4a,_0x44b008[_0xde30('0x11')][_0xde30('0x14')]);return _0x17af7c(_0x44b008['error'][_0xde30('0x14')]);}logger[_0xde30('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x439f4a,_0x44b008['error']['message']);return _0x2ff698(_0x44b008[_0xde30('0x11')][_0xde30('0x14')]);}else{logger[_0xde30('0xc')](_0xde30('0x13'),_0x439f4a,_0xde30('0xd'));_0x2ff698(_0x44b008['result']['message']);}})[_0xde30('0x15')](function(_0x33f2c6){logger[_0xde30('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x439f4a,_0x33f2c6);_0x17af7c(_0x33f2c6);});});} \ No newline at end of file +var _0x8257=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x5518d4,_0x547a72){var _0x52dbc0=function(_0x21b87c){while(--_0x21b87c){_0x5518d4['push'](_0x5518d4['shift']());}};_0x52dbc0(++_0x547a72);}(_0x8257,0xad));var _0x7825=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0x8257[_0x37b3e5];return _0x207f20;};'use strict';var _=require('lodash');var util=require(_0x7825('0x0'));var moment=require(_0x7825('0x1'));var BPromise=require(_0x7825('0x2'));var rs=require(_0x7825('0x3'));var fs=require('fs');var Redis=require(_0x7825('0x4'));var db=require(_0x7825('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7825('0x6'))(_0x7825('0x7'));var config=require('../../config/environment');var jayson=require(_0x7825('0x8'));var client=jayson[_0x7825('0x9')][_0x7825('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1593e2,_0xb6b86e,_0x4b215c){return new BPromise(function(_0x57d4d7,_0x15c13d){return client['request'](_0x1593e2,_0x4b215c)[_0x7825('0xb')](function(_0x55043c){logger[_0x7825('0xc')]('UserChatQueue,\x20%s,\x20%s',_0xb6b86e,_0x7825('0xd'));logger[_0x7825('0xe')](_0x7825('0xf'),_0xb6b86e,_0x7825('0xd'),JSON['stringify'](_0x55043c));if(_0x55043c['error']){if(_0x55043c[_0x7825('0x10')][_0x7825('0x11')]===0x1f4){logger[_0x7825('0x10')](_0x7825('0x12'),_0xb6b86e,_0x55043c[_0x7825('0x10')][_0x7825('0x13')]);return _0x15c13d(_0x55043c[_0x7825('0x10')][_0x7825('0x13')]);}logger['error'](_0x7825('0x12'),_0xb6b86e,_0x55043c[_0x7825('0x10')][_0x7825('0x13')]);return _0x57d4d7(_0x55043c[_0x7825('0x10')]['message']);}else{logger[_0x7825('0xc')](_0x7825('0x12'),_0xb6b86e,_0x7825('0xd'));_0x57d4d7(_0x55043c[_0x7825('0x14')][_0x7825('0x13')]);}})[_0x7825('0x15')](function(_0xb18637){logger['error']('UserChatQueue,\x20%s,\x20%s',_0xb6b86e,_0xb18637);_0x15c13d(_0xb18637);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3e01223..a297b3d 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1d219c,_0x50820a){var _0x3d9fde=function(_0x2e5b62){while(--_0x2e5b62){_0x1d219c['push'](_0x1d219c['shift']());}};_0x3d9fde(++_0x50820a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x96f3e7,_0x3af6b6){var _0x3a11d1=function(_0x3c4d52){while(--_0x3c4d52){_0x96f3e7['push'](_0x96f3e7['shift']());}};_0x3a11d1(++_0x3af6b6);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index ad819dc..8d7fe72 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 _0xa58d=['STRING','exports','INTEGER'];(function(_0x2ab9b5,_0x5607b8){var _0x9f6232=function(_0x3fe88d){while(--_0x3fe88d){_0x2ab9b5['push'](_0x2ab9b5['shift']());}};_0x9f6232(++_0x5607b8);}(_0xa58d,0x100));var _0xda58=function(_0x30cdf5,_0x328e54){_0x30cdf5=_0x30cdf5-0x0;var _0xeaf6f3=_0xa58d[_0x30cdf5];return _0xeaf6f3;};'use strict';var Sequelize=require('sequelize');module[_0xda58('0x0')]={'penalty':{'type':Sequelize[_0xda58('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xda58('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xda58('0x2')]}}; \ No newline at end of file +var _0xa3fe=['INTEGER','STRING'];(function(_0x1a4cac,_0x116f47){var _0x142f2f=function(_0x4a1e47){while(--_0x4a1e47){_0x1a4cac['push'](_0x1a4cac['shift']());}};_0x142f2f(++_0x116f47);}(_0xa3fe,0x1c0));var _0xea3f=function(_0x372800,_0x5857de){_0x372800=_0x372800-0x0;var _0x3fb5ff=_0xa3fe[_0x372800];return _0x3fb5ff;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xea3f('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xea3f('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xea3f('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d5668b8..e791ce1 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 _0x2996=['rimraf','exports','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x473766,_0x46ead9){var _0x4d1e5a=function(_0x58b056){while(--_0x58b056){_0x473766['push'](_0x473766['shift']());}};_0x4d1e5a(++_0x46ead9);}(_0x2996,0x14f));var _0x6299=function(_0x296805,_0x4460e9){_0x296805=_0x296805-0x0;var _0x4bb609=_0x2996[_0x296805];return _0x4bb609;};'use strict';var _=require('lodash');var util=require(_0x6299('0x0'));var logger=require(_0x6299('0x1'))(_0x6299('0x2'));var moment=require('moment');var BPromise=require(_0x6299('0x3'));var rp=require(_0x6299('0x4'));var fs=require('fs');var path=require(_0x6299('0x5'));var rimraf=require(_0x6299('0x6'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x6299('0x7')]=function(_0x44160a,_0x33f94c){return _0x44160a[_0x6299('0x8')](_0x6299('0x9'),attributes,{'tableName':_0x6299('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8853=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userFaxQueue.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8853,0x183));var _0x3885=function(_0x57be4d,_0x57b945){_0x57be4d=_0x57be4d-0x0;var _0xbf8a91=_0x8853[_0x57be4d];return _0xbf8a91;};'use strict';var _=require(_0x3885('0x0'));var util=require(_0x3885('0x1'));var logger=require(_0x3885('0x2'))(_0x3885('0x3'));var moment=require(_0x3885('0x4'));var BPromise=require('bluebird');var rp=require(_0x3885('0x5'));var fs=require('fs');var path=require(_0x3885('0x6'));var rimraf=require(_0x3885('0x7'));var config=require('../../config/environment');var attributes=require(_0x3885('0x8'));module[_0x3885('0x9')]=function(_0x1c773e,_0x39ab5a){return _0x1c773e[_0x3885('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index d9d9c8b..eee7891 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 _0x7aab=['error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x329978,_0x28323f){var _0x10525a=function(_0x67aba0){while(--_0x67aba0){_0x329978['push'](_0x329978['shift']());}};_0x10525a(++_0x28323f);}(_0x7aab,0x97));var _0xb7aa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7aab[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb7aa('0x0'));var util=require(_0xb7aa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb7aa('0x2'));var fs=require('fs');var Redis=require(_0xb7aa('0x3'));var db=require(_0xb7aa('0x4'))['db'];var utils=require(_0xb7aa('0x5'));var logger=require(_0xb7aa('0x6'))(_0xb7aa('0x7'));var config=require(_0xb7aa('0x8'));var jayson=require(_0xb7aa('0x9'));var client=jayson['client'][_0xb7aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58783f,_0x2c0aef,_0x41eac3){return new BPromise(function(_0x4d4546,_0x17da69){return client[_0xb7aa('0xb')](_0x58783f,_0x41eac3)['then'](function(_0xefbe69){logger[_0xb7aa('0xc')](_0xb7aa('0xd'),_0x2c0aef,'request\x20sent');logger[_0xb7aa('0xe')](_0xb7aa('0xf'),_0x2c0aef,_0xb7aa('0x10'),JSON['stringify'](_0xefbe69));if(_0xefbe69[_0xb7aa('0x11')]){if(_0xefbe69[_0xb7aa('0x11')]['code']===0x1f4){logger[_0xb7aa('0x11')](_0xb7aa('0xd'),_0x2c0aef,_0xefbe69[_0xb7aa('0x11')]['message']);return _0x17da69(_0xefbe69[_0xb7aa('0x11')]['message']);}logger[_0xb7aa('0x11')](_0xb7aa('0xd'),_0x2c0aef,_0xefbe69[_0xb7aa('0x11')][_0xb7aa('0x12')]);return _0x4d4546(_0xefbe69[_0xb7aa('0x11')][_0xb7aa('0x12')]);}else{logger[_0xb7aa('0xc')](_0xb7aa('0xd'),_0x2c0aef,_0xb7aa('0x10'));_0x4d4546(_0xefbe69[_0xb7aa('0x13')]['message']);}})[_0xb7aa('0x14')](function(_0xad3a75){logger[_0xb7aa('0x11')](_0xb7aa('0xd'),_0x2c0aef,_0xad3a75);_0x17da69(_0xad3a75);});});} \ No newline at end of file +var _0x1c99=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','result','lodash'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x1c99,0x19d));var _0x91c9=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0x1c99[_0x5f3de3];return _0x287e0d;};'use strict';var _=require(_0x91c9('0x0'));var util=require(_0x91c9('0x1'));var moment=require(_0x91c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x91c9('0x3'));var fs=require('fs');var Redis=require(_0x91c9('0x4'));var db=require(_0x91c9('0x5'))['db'];var utils=require(_0x91c9('0x6'));var logger=require(_0x91c9('0x7'))('rpc');var config=require(_0x91c9('0x8'));var jayson=require(_0x91c9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xaf0e4e,_0x5c36f3,_0x33fe7c){return new BPromise(function(_0x4f5d22,_0xd694b6){return client['request'](_0xaf0e4e,_0x33fe7c)['then'](function(_0x3213f6){logger[_0x91c9('0xa')](_0x91c9('0xb'),_0x5c36f3,_0x91c9('0xc'));logger[_0x91c9('0xd')](_0x91c9('0xe'),_0x5c36f3,_0x91c9('0xc'),JSON['stringify'](_0x3213f6));if(_0x3213f6[_0x91c9('0xf')]){if(_0x3213f6[_0x91c9('0xf')]['code']===0x1f4){logger[_0x91c9('0xf')](_0x91c9('0xb'),_0x5c36f3,_0x3213f6[_0x91c9('0xf')]['message']);return _0xd694b6(_0x3213f6['error'][_0x91c9('0x10')]);}logger['error'](_0x91c9('0xb'),_0x5c36f3,_0x3213f6[_0x91c9('0xf')][_0x91c9('0x10')]);return _0x4f5d22(_0x3213f6[_0x91c9('0xf')]['message']);}else{logger[_0x91c9('0xa')](_0x91c9('0xb'),_0x5c36f3,_0x91c9('0xc'));_0x4f5d22(_0x3213f6[_0x91c9('0x11')][_0x91c9('0x10')]);}})['catch'](function(_0x464e3b){logger[_0x91c9('0xf')](_0x91c9('0xb'),_0x5c36f3,_0x464e3b);_0xd694b6(_0x464e3b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index db6ec29..b8682aa 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x297834,_0x4eecba){var _0x200202=function(_0x386fca){while(--_0x386fca){_0x297834['push'](_0x297834['shift']());}};_0x200202(++_0x4eecba);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0xcb91[_0x4232d8];return _0x324de2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ca7c9,_0x1cc91d){var _0x261fb4=function(_0x59157c){while(--_0x59157c){_0x5ca7c9['push'](_0x5ca7c9['shift']());}};_0x261fb4(++_0x1cc91d);}(_0xe706,0xa3));var _0x6e70=function(_0x874a49,_0x5b07bc){_0x874a49=_0x874a49-0x0;var _0x343d2f=_0xe706[_0x874a49];return _0x343d2f;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 1c14c91..be48410 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 _0x9333=['INTEGER'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x9333,0x1c3));var _0x3933=function(_0x37a9f7,_0x53c0d4){_0x37a9f7=_0x37a9f7-0x0;var _0x26d2f5=_0x9333[_0x37a9f7];return _0x26d2f5;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3933('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5e76=['INTEGER'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5e76,0x16e));var _0x65e7=function(_0x5bb56e,_0x45343c){_0x5bb56e=_0x5bb56e-0x0;var _0x1e3a33=_0x5e76[_0x5bb56e];return _0x1e3a33;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x65e7('0x0')],'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 ec5fa60..fd3c1a8 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 _0xd9cd=['bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment'];(function(_0x58702f,_0x34f578){var _0x5033b3=function(_0x4fa793){while(--_0x4fa793){_0x58702f['push'](_0x58702f['shift']());}};_0x5033b3(++_0x34f578);}(_0xd9cd,0x15b));var _0xdd9c=function(_0x2cb58b,_0x5a879d){_0x2cb58b=_0x2cb58b-0x0;var _0xe9dd9c=_0xd9cd[_0x2cb58b];return _0xe9dd9c;};'use strict';var _=require(_0xdd9c('0x0'));var util=require(_0xdd9c('0x1'));var logger=require('../../config/logger')(_0xdd9c('0x2'));var moment=require(_0xdd9c('0x3'));var BPromise=require(_0xdd9c('0x4'));var rp=require(_0xdd9c('0x5'));var fs=require('fs');var path=require(_0xdd9c('0x6'));var rimraf=require(_0xdd9c('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd9c('0x8'));module[_0xdd9c('0x9')]=function(_0x2018c3,_0x106076){return _0x2018c3[_0xdd9c('0xa')](_0xdd9c('0xb'),attributes,{'tableName':_0xdd9c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62ae=['rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x585fb6,_0x434296){var _0x920e23=function(_0x59ba5f){while(--_0x59ba5f){_0x585fb6['push'](_0x585fb6['shift']());}};_0x920e23(++_0x434296);}(_0x62ae,0x1c2));var _0xe62a=function(_0xb626f6,_0x4b4075){_0xb626f6=_0xb626f6-0x0;var _0x2c620b=_0x62ae[_0xb626f6];return _0x2c620b;};'use strict';var _=require(_0xe62a('0x0'));var util=require('util');var logger=require(_0xe62a('0x1'))(_0xe62a('0x2'));var moment=require(_0xe62a('0x3'));var BPromise=require('bluebird');var rp=require(_0xe62a('0x4'));var fs=require('fs');var path=require(_0xe62a('0x5'));var rimraf=require(_0xe62a('0x6'));var config=require('../../config/environment');var attributes=require(_0xe62a('0x7'));module[_0xe62a('0x8')]=function(_0x3390de,_0x3c4471){return _0x3390de[_0xe62a('0x9')](_0xe62a('0xa'),attributes,{'tableName':_0xe62a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 088f25c..36923ab 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa0cbbf,_0x3db155){var _0x1edbb7=function(_0x3d7e75){while(--_0x3d7e75){_0xa0cbbf['push'](_0xa0cbbf['shift']());}};_0x1edbb7(++_0x3db155);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5843c6,_0x4427a5){_0x5843c6=_0x5843c6-0x0;var _0x3c3553=_0x8ef6[_0x5843c6];return _0x3c3553;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e9ab0,_0x21ab80){var _0xe1b514=function(_0x4da988){while(--_0x4da988){_0x2e9ab0['push'](_0x2e9ab0['shift']());}};_0xe1b514(++_0x21ab80);}(_0x8ef6,0xf2));var _0x68ef=function(_0x589f61,_0x402505){_0x589f61=_0x589f61-0x0;var _0x43b08b=_0x8ef6[_0x589f61];return _0x43b08b;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index c4cc63c..7526df2 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 _0x95d2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95d2,0x180));var _0x295d=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x95d2[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0x295d('0x0'));var util=require(_0x295d('0x1'));var path=require(_0x295d('0x2'));var timeout=require(_0x295d('0x3'));var express=require(_0x295d('0x4'));var router=express[_0x295d('0x5')]();var fs_extra=require(_0x295d('0x6'));var auth=require(_0x295d('0x7'));var interaction=require(_0x295d('0x8'));var config=require(_0x295d('0x9'));var controller=require(_0x295d('0xa'));router[_0x295d('0xb')]('/',auth[_0x295d('0xc')](),controller[_0x295d('0xd')]);module[_0x295d('0xe')]=router; \ No newline at end of file +var _0xe1a1=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x32af08,_0x510d6d){var _0x21824b=function(_0x17203a){while(--_0x17203a){_0x32af08['push'](_0x32af08['shift']());}};_0x21824b(++_0x510d6d);}(_0xe1a1,0x70));var _0x1e1a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe1a1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1e1a('0x0'));var util=require(_0x1e1a('0x1'));var path=require(_0x1e1a('0x2'));var timeout=require(_0x1e1a('0x3'));var express=require(_0x1e1a('0x4'));var router=express[_0x1e1a('0x5')]();var fs_extra=require(_0x1e1a('0x6'));var auth=require(_0x1e1a('0x7'));var interaction=require(_0x1e1a('0x8'));var config=require(_0x1e1a('0x9'));var controller=require(_0x1e1a('0xa'));router[_0x1e1a('0xb')]('/',auth[_0x1e1a('0xc')](),controller[_0x1e1a('0xd')]);module[_0x1e1a('0xe')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c8b4c17..972ccb1 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 _0x5130=['exports','TEXT','BOOLEAN'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0x5130,0xe4));var _0x0513=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x5130[_0x421196];return _0x2738af;};'use strict';var Sequelize=require('sequelize');module[_0x0513('0x0')]={'body':{'type':Sequelize[_0x0513('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x0513('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x0513('0x2')]}}; \ No newline at end of file +var _0x055b=['STRING','BOOLEAN','sequelize'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x055b,0x158));var _0xb055=function(_0x4e7bb4,_0x472b76){_0x4e7bb4=_0x4e7bb4-0x0;var _0x20d206=_0x055b[_0x4e7bb4];return _0x20d206;};'use strict';var Sequelize=require(_0xb055('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xb055('0x1')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xb055('0x1')]},'beep':{'type':Sequelize[_0xb055('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index adfec91..89ae734 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 _0x8595=['replace','ids','push','flatten','getAgents','map','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','body','hasOwnProperty','text','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','User','union','queue'];(function(_0x1b435b,_0x1eeed9){var _0x5bf86f=function(_0x7bae89){while(--_0x7bae89){_0x1b435b['push'](_0x1b435b['shift']());}};_0x5bf86f(++_0x1eeed9);}(_0x8595,0xcc));var _0x5859=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x8595[_0x166742];return _0xb7814a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5859('0x0'));var jsonpatch=require(_0x5859('0x1'));var rp=require(_0x5859('0x2'));var moment=require(_0x5859('0x3'));var BPromise=require(_0x5859('0x4'));var Mustache=require(_0x5859('0x5'));var util=require(_0x5859('0x6'));var path=require(_0x5859('0x7'));var sox=require(_0x5859('0x8'));var csv=require(_0x5859('0x9'));var ejs=require(_0x5859('0xa'));var fs=require('fs');var fs_extra=require(_0x5859('0xb'));var _=require('lodash');var squel=require(_0x5859('0xc'));var crypto=require(_0x5859('0xd'));var jsforce=require(_0x5859('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5859('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5859('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5859('0x11'))(_0x5859('0x12'));var utils=require('../../config/utils');var config=require(_0x5859('0x13'));var licenseUtil=require(_0x5859('0x14'));var db=require(_0x5859('0x15'))['db'];config[_0x5859('0x16')]=_[_0x5859('0x17')](config[_0x5859('0x16')],{'host':_0x5859('0x18'),'port':0x18eb});var socket=require(_0x5859('0x19'))(new Redis(config['redis']));require('./userNotification.socket')[_0x5859('0x1a')](socket);function respondWithStatusCode(_0x18642b,_0x35ca17){_0x35ca17=_0x35ca17||0xcc;return function(_0x2809f8){if(_0x2809f8){return _0x18642b[_0x5859('0x1b')](_0x35ca17);}return _0x18642b[_0x5859('0x1c')](_0x35ca17)[_0x5859('0x1d')]();};}function respondWithResult(_0x1d40da,_0x303969){_0x303969=_0x303969||0xc8;return function(_0x32dc0c){if(_0x32dc0c){return _0x1d40da[_0x5859('0x1c')](_0x303969)[_0x5859('0x1e')](_0x32dc0c);}};}function respondWithFilteredResult(_0x4867a1,_0x116203){return function(_0x36d39c){if(_0x36d39c){var _0x462cab=typeof _0x116203[_0x5859('0x1f')]==='undefined'&&typeof _0x116203[_0x5859('0x20')]===_0x5859('0x21');var _0x1e93fd=_0x36d39c['count'];var _0x514cb5=_0x462cab?0x0:_0x116203[_0x5859('0x1f')];var _0x50944d=_0x462cab?_0x36d39c['count']:_0x116203[_0x5859('0x1f')]+_0x116203[_0x5859('0x20')];var _0x2f66b8;if(_0x50944d>=_0x1e93fd){_0x50944d=_0x1e93fd;_0x2f66b8=0xc8;}else{_0x2f66b8=0xce;}_0x4867a1[_0x5859('0x1c')](_0x2f66b8);return _0x4867a1[_0x5859('0x22')](_0x5859('0x23'),_0x514cb5+'-'+_0x50944d+'/'+_0x1e93fd)[_0x5859('0x1e')](_0x36d39c);}return null;};}function patchUpdates(_0x1081d0){return function(_0x338790){try{jsonpatch[_0x5859('0x24')](_0x338790,_0x1081d0,!![]);}catch(_0x499f55){return BPromise[_0x5859('0x25')](_0x499f55);}return _0x338790['save']();};}function saveUpdates(_0x567c45,_0x317407){return function(_0x496f1b){if(_0x496f1b){return _0x496f1b[_0x5859('0x26')](_0x567c45)[_0x5859('0x27')](function(_0x49c112){return _0x49c112;});}return null;};}function removeEntity(_0xaf6f62,_0x280b6b){return function(_0x4cc88d){if(_0x4cc88d){return _0x4cc88d[_0x5859('0x28')]()[_0x5859('0x27')](function(){_0xaf6f62[_0x5859('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb054,_0x536e0b){return function(_0x40b3ac){if(!_0x40b3ac){_0x2bb054[_0x5859('0x1b')](0x194);}return _0x40b3ac;};}function handleError(_0x392f86,_0x3bb168){_0x3bb168=_0x3bb168||0x1f4;return function(_0xf223f0){logger['error'](_0xf223f0[_0x5859('0x29')]);if(_0xf223f0[_0x5859('0x2a')]){delete _0xf223f0[_0x5859('0x2a')];}_0x392f86[_0x5859('0x1c')](_0x3bb168)[_0x5859('0x2b')](_0xf223f0);};}exports['sendUserNotification']=function(_0x5af85c,_0x59de76,_0x1c0efa){if(!_0x5af85c[_0x5859('0x2c')][_0x5859('0x2d')](_0x5859('0x2e'))&&!_0x5af85c[_0x5859('0x2c')][_0x5859('0x2d')]('TemplateId')){throw new db[(_0x5859('0x2f'))]['ValidationError'](_0x5859('0x30'));}else{if(_0x5af85c['body'][_0x5859('0x2d')](_0x5859('0x31'))&&!_0x5af85c[_0x5859('0x2c')]['hasOwnProperty'](_0x5859('0x32'))){throw new db[(_0x5859('0x2f'))][(_0x5859('0x33'))](_0x5859('0x34'));}if(!_0x5af85c[_0x5859('0x2c')][_0x5859('0x2d')](_0x5859('0x35'))){throw new db['Sequelize']['ValidationError'](_0x5859('0x36'));}else{try{var _0x247f92=JSON['parse'](_0x5af85c[_0x5859('0x2c')][_0x5859('0x35')]);}catch(_0x174a25){logger[_0x5859('0x37')](_0x174a25);throw new db[(_0x5859('0x2f'))][(_0x5859('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x56a69d=[_0x5859('0x38'),_0x5859('0x39'),_0x5859('0x3a'),_0x5859('0x3b'),_0x5859('0x3c'),_0x5859('0x3d'),_0x5859('0x3e'),_0x5859('0x3f'),_0x5859('0x40')];if(_['some'](_0x247f92,function(_0x48fcb8){return!_[_0x5859('0x41')](_0x56a69d,_0x48fcb8[_0x5859('0x42')]['toLowerCase']());})){throw new db[(_0x5859('0x2f'))]['ValidationError'](_0x5859('0x43'));}}}var _0x1c8afe={};_0x1c8afe[_0x5859('0x44')]=_0x5af85c[_0x5859('0x2c')][_0x5859('0x2d')](_0x5859('0x44'))?_0x5af85c['body']['senderName']:_0x5af85c[_0x5859('0x40')]['fullname'];_0x1c8afe['recipientsDescription']=_[_0x5859('0x45')](_0x5af85c[_0x5859('0x2c')][_0x5859('0x46')])?null:_0x5af85c[_0x5859('0x2c')][_0x5859('0x46')];_0x1c8afe[_0x5859('0x47')]=_0x5af85c[_0x5859('0x2c')]['beep']||![];_0x1c8afe[_0x5859('0x48')]=_0x5af85c[_0x5859('0x40')]['id'];return getContent(_0x5af85c['body'])[_0x5859('0x27')](function(_0x26949e){_0x1c8afe[_0x5859('0x2c')]=_0x26949e;return getRecipients(_0x247f92);})[_0x5859('0x27')](function(_0x44a4e2){_0x1c8afe['recipientsId']=_[_0x5859('0x49')](_0x44a4e2)[_0x5859('0x4a')](',');return db[_0x5859('0x4b')][_0x5859('0x4c')](function(_0x4fe88b){return db[_0x5859('0x4d')][_0x5859('0x4e')](_0x1c8afe,{'raw':!![],'transaction':_0x4fe88b})[_0x5859('0x27')](function(_0x54041d){var _0x2d690c={'sender':_0x1c8afe[_0x5859('0x44')],'description':_0x1c8afe[_0x5859('0x46')],'content':_0x1c8afe[_0x5859('0x2c')],'beep':_0x1c8afe['beep']};_0x44a4e2[_0x5859('0x4f')](function(_0x3420b3){_0x2d690c[_0x5859('0x50')]=_0x3420b3;socket['emit'](_0x5859('0x51'),_0x2d690c);});return _0x54041d;});});})['then'](respondWithResult(_0x59de76,0xc9))[_0x5859('0x52')](handleError(_0x59de76,null));};function getContent(_0x482ac4){return new BPromise(function(_0x6be701,_0x109e24){if(_0x482ac4[_0x5859('0x2e')]){_0x6be701(_0x482ac4[_0x5859('0x2e')]);return;}return db[_0x5859('0x53')][_0x5859('0x54')]({'attributes':[_0x5859('0x55')],'where':{'id':_0x482ac4[_0x5859('0x31')]},'raw':!![]})['then'](function(_0x5d6f51){if(!_0x5d6f51)throw new db[(_0x5859('0x2f'))][(_0x5859('0x33'))](_0x5859('0x56'));var _0x5f1ac5=Mustache[_0x5859('0x57')](_0x5d6f51[_0x5859('0x55')],_0x482ac4[_0x5859('0x32')]);_0x6be701(_0x5f1ac5);})[_0x5859('0x52')](function(_0x327cda){_0x109e24(_0x327cda);});});}function getRecipients(_0x4dc1cc){return new BPromise(function(_0x468260,_0xac7a2c){var _0x17f537=[];var _0x133591=[];_0x4dc1cc[_0x5859('0x4f')](function(_0x32dd33){var _0x152b04=_[_0x5859('0x58')](_0x32dd33[_0x5859('0x42')][_0x5859('0x59')]());if(_0x152b04===_0x5859('0x5a')){_0x17f537=_[_0x5859('0x5b')](_0x17f537,_0x32dd33['ids']);}else{if(_[_0x5859('0x41')](_0x152b04,_0x5859('0x5c')))_0x152b04=_0x152b04[_0x5859('0x5d')](_0x5859('0x5c'),'Queue');_0x32dd33[_0x5859('0x5e')][_0x5859('0x4f')](function(_0x3176e2){_0x133591[_0x5859('0x5f')](getAgents(_0x152b04,_0x3176e2));});}});return BPromise['all'](_0x133591)[_0x5859('0x27')](function(_0x2518c){_0x17f537=_[_0x5859('0x5b')](_0x17f537,_[_0x5859('0x60')](_0x2518c));_0x468260(_0x17f537);})[_0x5859('0x52')](function(_0x4e5bfe){_0xac7a2c(_0x4e5bfe);});});}function getAgents(_0x1cec48,_0x1472cf){return new BPromise(function(_0x22906e,_0x57ef0b){return db[_0x1cec48][_0x5859('0x54')]({'where':{'id':_0x1472cf}})['then'](function(_0x41404f){return _0x41404f[_0x5859('0x61')]({'attributes':['id'],'raw':!![]})[_0x5859('0x27')](function(_0x47c88c){var _0x530d9f=_[_0x5859('0x62')](_0x47c88c,'id');_0x22906e(_0x530d9f);});})[_0x5859('0x52')](function(_0x1c3b56){_0x57ef0b(_0x1c3b56);});});} \ No newline at end of file +var _0x7139=['Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','toLowerCase','User','ids','replace','queue','all','union','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','apply','reject','update','then','destroy','stack','name','send','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x7139,0x91));var _0x9713=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7139[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9713('0x0'));var rimraf=require(_0x9713('0x1'));var zipdir=require(_0x9713('0x2'));var jsonpatch=require(_0x9713('0x3'));var rp=require(_0x9713('0x4'));var moment=require(_0x9713('0x5'));var BPromise=require(_0x9713('0x6'));var Mustache=require(_0x9713('0x7'));var util=require('util');var path=require(_0x9713('0x8'));var sox=require(_0x9713('0x9'));var csv=require(_0x9713('0xa'));var ejs=require(_0x9713('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9713('0xc'));var squel=require('squel');var crypto=require(_0x9713('0xd'));var jsforce=require(_0x9713('0xe'));var deskjs=require(_0x9713('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9713('0x10'));var Papa=require(_0x9713('0x11'));var Redis=require('ioredis');var authService=require(_0x9713('0x12'));var qs=require(_0x9713('0x13'));var as=require(_0x9713('0x14'));var hardwareService=require(_0x9713('0x15'));var logger=require('../../config/logger')(_0x9713('0x16'));var utils=require(_0x9713('0x17'));var config=require(_0x9713('0x18'));var licenseUtil=require(_0x9713('0x19'));var db=require(_0x9713('0x1a'))['db'];config[_0x9713('0x1b')]=_[_0x9713('0x1c')](config[_0x9713('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9713('0x1d'))(new Redis(config[_0x9713('0x1b')]));require(_0x9713('0x1e'))[_0x9713('0x1f')](socket);function respondWithStatusCode(_0x201ad8,_0x3c767d){_0x3c767d=_0x3c767d||0xcc;return function(_0x58e2b0){if(_0x58e2b0){return _0x201ad8[_0x9713('0x20')](_0x3c767d);}return _0x201ad8[_0x9713('0x21')](_0x3c767d)[_0x9713('0x22')]();};}function respondWithResult(_0x24d582,_0x47a48c){_0x47a48c=_0x47a48c||0xc8;return function(_0x309660){if(_0x309660){return _0x24d582[_0x9713('0x21')](_0x47a48c)[_0x9713('0x23')](_0x309660);}};}function respondWithFilteredResult(_0x51d5e1,_0xae2e9d){return function(_0x14060d){if(_0x14060d){var _0x1657de=typeof _0xae2e9d[_0x9713('0x24')]===_0x9713('0x25')&&typeof _0xae2e9d['limit']===_0x9713('0x25');var _0x3e9b74=_0x14060d[_0x9713('0x26')];var _0xd664d9=_0x1657de?0x0:_0xae2e9d[_0x9713('0x24')];var _0x281a3c=_0x1657de?_0x14060d['count']:_0xae2e9d['offset']+_0xae2e9d['limit'];var _0x1e2e09;if(_0x281a3c>=_0x3e9b74){_0x281a3c=_0x3e9b74;_0x1e2e09=0xc8;}else{_0x1e2e09=0xce;}_0x51d5e1['status'](_0x1e2e09);return _0x51d5e1['set']('Content-Range',_0xd664d9+'-'+_0x281a3c+'/'+_0x3e9b74)[_0x9713('0x23')](_0x14060d);}return null;};}function patchUpdates(_0x3a2991){return function(_0x4f185c){try{jsonpatch[_0x9713('0x27')](_0x4f185c,_0x3a2991,!![]);}catch(_0x2693e0){return BPromise[_0x9713('0x28')](_0x2693e0);}return _0x4f185c['save']();};}function saveUpdates(_0x5c7c48,_0x5e9980){return function(_0xdb1aad){if(_0xdb1aad){return _0xdb1aad[_0x9713('0x29')](_0x5c7c48)[_0x9713('0x2a')](function(_0x36435){return _0x36435;});}return null;};}function removeEntity(_0x48f30f,_0x442866){return function(_0x4171de){if(_0x4171de){return _0x4171de[_0x9713('0x2b')]()[_0x9713('0x2a')](function(){_0x48f30f['status'](0xcc)[_0x9713('0x22')]();});}};}function handleEntityNotFound(_0x3830c9,_0x5db4c1){return function(_0x19c152){if(!_0x19c152){_0x3830c9[_0x9713('0x20')](0x194);}return _0x19c152;};}function handleError(_0x3b3121,_0x3780e3){_0x3780e3=_0x3780e3||0x1f4;return function(_0x2ec4c8){logger['error'](_0x2ec4c8[_0x9713('0x2c')]);if(_0x2ec4c8[_0x9713('0x2d')]){delete _0x2ec4c8[_0x9713('0x2d')];}_0x3b3121[_0x9713('0x21')](_0x3780e3)[_0x9713('0x2e')](_0x2ec4c8);};}exports['sendUserNotification']=function(_0xbf8f14,_0x2841e0,_0x430d4b){if(!_0xbf8f14[_0x9713('0x2f')][_0x9713('0x30')](_0x9713('0x31'))&&!_0xbf8f14[_0x9713('0x2f')][_0x9713('0x30')](_0x9713('0x32'))){throw new db['Sequelize'][(_0x9713('0x33'))](_0x9713('0x34'));}else{if(_0xbf8f14[_0x9713('0x2f')]['hasOwnProperty'](_0x9713('0x32'))&&!_0xbf8f14[_0x9713('0x2f')]['hasOwnProperty']('view')){throw new db[(_0x9713('0x35'))][(_0x9713('0x33'))](_0x9713('0x36'));}if(!_0xbf8f14[_0x9713('0x2f')][_0x9713('0x30')](_0x9713('0x37'))){throw new db['Sequelize'][(_0x9713('0x33'))](_0x9713('0x38'));}else{try{var _0x36761c=JSON[_0x9713('0x39')](_0xbf8f14['body']['recipients']);}catch(_0x1c2e02){logger[_0x9713('0x3a')](_0x1c2e02);throw new db[(_0x9713('0x35'))][(_0x9713('0x33'))](_0x9713('0x3b'));}var _0x4496c9=['chatqueue',_0x9713('0x3c'),_0x9713('0x3d'),_0x9713('0x3e'),_0x9713('0x3f'),'voicequeue',_0x9713('0x40'),_0x9713('0x41'),_0x9713('0x42')];if(_[_0x9713('0x43')](_0x36761c,function(_0x31bd73){return!_[_0x9713('0x44')](_0x4496c9,_0x31bd73[_0x9713('0x45')]['toLowerCase']());})){throw new db[(_0x9713('0x35'))][(_0x9713('0x33'))](_0x9713('0x46'));}}}var _0x23635a={};_0x23635a['senderName']=_0xbf8f14[_0x9713('0x2f')][_0x9713('0x30')](_0x9713('0x47'))?_0xbf8f14[_0x9713('0x2f')][_0x9713('0x47')]:_0xbf8f14[_0x9713('0x42')]['fullname'];_0x23635a[_0x9713('0x48')]=_[_0x9713('0x49')](_0xbf8f14[_0x9713('0x2f')]['recipientsDescription'])?null:_0xbf8f14[_0x9713('0x2f')][_0x9713('0x48')];_0x23635a['beep']=_0xbf8f14[_0x9713('0x2f')][_0x9713('0x4a')]||![];_0x23635a[_0x9713('0x4b')]=_0xbf8f14[_0x9713('0x42')]['id'];return getContent(_0xbf8f14[_0x9713('0x2f')])['then'](function(_0x121d2d){_0x23635a[_0x9713('0x2f')]=_0x121d2d;return getRecipients(_0x36761c);})['then'](function(_0x3b9329){_0x23635a['recipientsId']=_[_0x9713('0x4c')](_0x3b9329)[_0x9713('0x4d')](',');return db[_0x9713('0x4e')]['transaction'](function(_0x6bb3df){return db[_0x9713('0x4f')][_0x9713('0x50')](_0x23635a,{'raw':!![],'transaction':_0x6bb3df})[_0x9713('0x2a')](function(_0x738adf){var _0x33c37a={'sender':_0x23635a[_0x9713('0x47')],'description':_0x23635a[_0x9713('0x48')],'content':_0x23635a[_0x9713('0x2f')],'beep':_0x23635a['beep']};_0x3b9329[_0x9713('0x51')](function(_0x4ef64c){_0x33c37a[_0x9713('0x52')]=_0x4ef64c;socket[_0x9713('0x53')](_0x9713('0x54'),_0x33c37a);});return _0x738adf;});});})[_0x9713('0x2a')](respondWithResult(_0x2841e0,0xc9))[_0x9713('0x55')](handleError(_0x2841e0,null));};function getContent(_0x350166){return new BPromise(function(_0x448e60,_0x24bac8){if(_0x350166['text']){_0x448e60(_0x350166[_0x9713('0x31')]);return;}return db['Template']['findOne']({'attributes':[_0x9713('0x56')],'where':{'id':_0x350166[_0x9713('0x32')]},'raw':!![]})['then'](function(_0xbd6863){if(!_0xbd6863)throw new db['Sequelize'][(_0x9713('0x33'))](_0x9713('0x57'));var _0x29e24f=Mustache[_0x9713('0x58')](_0xbd6863[_0x9713('0x56')],_0x350166[_0x9713('0x59')]);_0x448e60(_0x29e24f);})[_0x9713('0x55')](function(_0x2b3e1b){_0x24bac8(_0x2b3e1b);});});}function getRecipients(_0x348adf){return new BPromise(function(_0x518c76,_0x19c060){var _0x229373=[];var _0x461a35=[];_0x348adf[_0x9713('0x51')](function(_0x5118d5){var _0x280d49=_[_0x9713('0x5a')](_0x5118d5[_0x9713('0x45')][_0x9713('0x5b')]());if(_0x280d49===_0x9713('0x5c')){_0x229373=_['union'](_0x229373,_0x5118d5[_0x9713('0x5d')]);}else{if(_[_0x9713('0x44')](_0x280d49,'queue'))_0x280d49=_0x280d49[_0x9713('0x5e')](_0x9713('0x5f'),'Queue');_0x5118d5[_0x9713('0x5d')][_0x9713('0x51')](function(_0x56eb66){_0x461a35['push'](getAgents(_0x280d49,_0x56eb66));});}});return BPromise[_0x9713('0x60')](_0x461a35)[_0x9713('0x2a')](function(_0x559aab){_0x229373=_[_0x9713('0x61')](_0x229373,_[_0x9713('0x62')](_0x559aab));_0x518c76(_0x229373);})['catch'](function(_0x1b432e){_0x19c060(_0x1b432e);});});}function getAgents(_0x58db2d,_0x506e3f){return new BPromise(function(_0x372e78,_0x3ba10a){return db[_0x58db2d][_0x9713('0x63')]({'where':{'id':_0x506e3f}})['then'](function(_0x4ceaf6){return _0x4ceaf6[_0x9713('0x64')]({'attributes':['id'],'raw':!![]})[_0x9713('0x2a')](function(_0x585d6a){var _0x4da89f=_[_0x9713('0x65')](_0x585d6a,'id');_0x372e78(_0x4da89f);});})['catch'](function(_0x81c823){_0x3ba10a(_0x81c823);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index a585715..f9dcb9a 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 _0x4d76=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','save','remove'];(function(_0x5bb124,_0x3464e8){var _0x5e4326=function(_0x283915){while(--_0x283915){_0x5bb124['push'](_0x5bb124['shift']());}};_0x5e4326(++_0x3464e8);}(_0x4d76,0xf7));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x64d7('0x0'));var UserNotification=require(_0x64d7('0x1'))['db'][_0x64d7('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x64d7('0x3'),'afterUpdate':'update','afterDestroy':_0x64d7('0x4')};function emitEvent(_0x3576b0){return function(_0x75885f,_0x24292e,_0x2636ad){UserNotificationEvents[_0x64d7('0x5')](_0x3576b0+':'+_0x75885f['id'],_0x75885f);UserNotificationEvents['emit'](_0x3576b0,_0x75885f);_0x2636ad(null);};}for(var e in events){if(events[_0x64d7('0x6')](e)){var event=events[e];UserNotification[_0x64d7('0x7')](e,emitEvent(event));}}module[_0x64d7('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x4f99=['hook','exports','events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x4f99,0xca));var _0x94f9=function(_0x51c38f,_0xece6e6){_0x51c38f=_0x51c38f-0x0;var _0x510e04=_0x4f99[_0x51c38f];return _0x510e04;};'use strict';var EventEmitter=require(_0x94f9('0x0'));var UserNotification=require(_0x94f9('0x1'))['db'][_0x94f9('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94f9('0x3'),'afterUpdate':_0x94f9('0x4'),'afterDestroy':_0x94f9('0x5')};function emitEvent(_0x5925b1){return function(_0x28769d,_0x468957,_0x4a00ae){UserNotificationEvents[_0x94f9('0x6')](_0x5925b1+':'+_0x28769d['id'],_0x28769d);UserNotificationEvents['emit'](_0x5925b1,_0x28769d);_0x4a00ae(null);};}for(var e in events){if(events[_0x94f9('0x7')](e)){var event=events[e];UserNotification[_0x94f9('0x8')](e,emitEvent(event));}}module[_0x94f9('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 797d86d..2289285 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 _0x605d=['utf8mb4','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x605d,0xe8));var _0xd605=function(_0x101094,_0x5d3900){_0x101094=_0x101094-0x0;var _0x3d6d75=_0x605d[_0x101094];return _0x3d6d75;};'use strict';var _=require('lodash');var util=require(_0xd605('0x0'));var logger=require(_0xd605('0x1'))(_0xd605('0x2'));var moment=require('moment');var BPromise=require(_0xd605('0x3'));var rp=require(_0xd605('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd605('0x5'));var config=require(_0xd605('0x6'));var attributes=require(_0xd605('0x7'));module[_0xd605('0x8')]=function(_0x335c3f,_0x1343c6){return _0x335c3f[_0xd605('0x9')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd605('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7f48=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x19c452,_0x4dbaab){var _0x99698c=function(_0x5aef73){while(--_0x5aef73){_0x19c452['push'](_0x19c452['shift']());}};_0x99698c(++_0x4dbaab);}(_0x7f48,0x13b));var _0x87f4=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x7f48[_0x3b96cf];return _0x2e315a;};'use strict';var _=require(_0x87f4('0x0'));var util=require(_0x87f4('0x1'));var logger=require(_0x87f4('0x2'))(_0x87f4('0x3'));var moment=require(_0x87f4('0x4'));var BPromise=require(_0x87f4('0x5'));var rp=require(_0x87f4('0x6'));var fs=require('fs');var path=require(_0x87f4('0x7'));var rimraf=require('rimraf');var config=require(_0x87f4('0x8'));var attributes=require(_0x87f4('0x9'));module['exports']=function(_0x2ec5eb,_0x5e329d){return _0x2ec5eb[_0x87f4('0xa')](_0x87f4('0xb'),attributes,{'tableName':_0x87f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87f4('0xd'),'collate':_0x87f4('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 7a9eb0f..a04dda3 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 _0x5cb4=['redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2553bb,_0x497713){var _0x3d18a4=function(_0x12046c){while(--_0x12046c){_0x2553bb['push'](_0x2553bb['shift']());}};_0x3d18a4(++_0x497713);}(_0x5cb4,0x123));var _0x45cb=function(_0x20c006,_0x722fd4){_0x20c006=_0x20c006-0x0;var _0xddb6e4=_0x5cb4[_0x20c006];return _0xddb6e4;};'use strict';var _=require('lodash');var util=require(_0x45cb('0x0'));var moment=require(_0x45cb('0x1'));var BPromise=require('bluebird');var rs=require(_0x45cb('0x2'));var fs=require('fs');var Redis=require(_0x45cb('0x3'));var db=require(_0x45cb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x45cb('0x5'))(_0x45cb('0x6'));var config=require(_0x45cb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x45cb('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x45cb('0x9')],{'host':_0x45cb('0xa'),'port':0x18eb});var socket=require(_0x45cb('0xb'))(new Redis(config[_0x45cb('0x9')]));require(_0x45cb('0xc'))['register'](socket);function respondWithRpcPromise(_0x5281d4,_0x45589c,_0x46e2ad){return new BPromise(function(_0x304dc0,_0x152f50){return client[_0x45cb('0xd')](_0x5281d4,_0x46e2ad)[_0x45cb('0xe')](function(_0x147d15){logger[_0x45cb('0xf')](_0x45cb('0x10'),_0x45589c,_0x45cb('0x11'));logger[_0x45cb('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x45589c,_0x45cb('0x11'),JSON[_0x45cb('0x13')](_0x147d15));if(_0x147d15[_0x45cb('0x14')]){if(_0x147d15[_0x45cb('0x14')][_0x45cb('0x15')]===0x1f4){logger[_0x45cb('0x14')]('UserNotification,\x20%s,\x20%s',_0x45589c,_0x147d15[_0x45cb('0x14')][_0x45cb('0x16')]);return _0x152f50(_0x147d15[_0x45cb('0x14')][_0x45cb('0x16')]);}logger['error'](_0x45cb('0x10'),_0x45589c,_0x147d15[_0x45cb('0x14')][_0x45cb('0x16')]);return _0x304dc0(_0x147d15[_0x45cb('0x14')]['message']);}else{logger[_0x45cb('0xf')]('UserNotification,\x20%s,\x20%s',_0x45589c,_0x45cb('0x11'));_0x304dc0(_0x147d15[_0x45cb('0x17')][_0x45cb('0x16')]);}})[_0x45cb('0x18')](function(_0xafe18e){logger['error'](_0x45cb('0x10'),_0x45589c,_0xafe18e);_0x152f50(_0xafe18e);});});} \ No newline at end of file +var _0x8bc2=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserNotification,\x20%s,\x20%s','message'];(function(_0x134e56,_0x4a1930){var _0x5c98aa=function(_0x204939){while(--_0x204939){_0x134e56['push'](_0x134e56['shift']());}};_0x5c98aa(++_0x4a1930);}(_0x8bc2,0x1e1));var _0x28bc=function(_0x337ad4,_0x115de9){_0x337ad4=_0x337ad4-0x0;var _0x5d1d84=_0x8bc2[_0x337ad4];return _0x5d1d84;};'use strict';var _=require(_0x28bc('0x0'));var util=require(_0x28bc('0x1'));var moment=require(_0x28bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x28bc('0x3'));var fs=require('fs');var Redis=require(_0x28bc('0x4'));var db=require(_0x28bc('0x5'))['db'];var utils=require(_0x28bc('0x6'));var logger=require('../../config/logger')(_0x28bc('0x7'));var config=require('../../config/environment');var jayson=require(_0x28bc('0x8'));var client=jayson['client'][_0x28bc('0x9')]({'port':0x232a});config[_0x28bc('0xa')]=_[_0x28bc('0xb')](config[_0x28bc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x28bc('0xc'))(new Redis(config[_0x28bc('0xa')]));require('./userNotification.socket')[_0x28bc('0xd')](socket);function respondWithRpcPromise(_0x3c285c,_0x4acfcd,_0x5b6456){return new BPromise(function(_0x2b4125,_0x198ddb){return client['request'](_0x3c285c,_0x5b6456)[_0x28bc('0xe')](function(_0x32b9ac){logger[_0x28bc('0xf')]('UserNotification,\x20%s,\x20%s',_0x4acfcd,'request\x20sent');logger[_0x28bc('0x10')](_0x28bc('0x11'),_0x4acfcd,_0x28bc('0x12'),JSON[_0x28bc('0x13')](_0x32b9ac));if(_0x32b9ac[_0x28bc('0x14')]){if(_0x32b9ac[_0x28bc('0x14')]['code']===0x1f4){logger[_0x28bc('0x14')](_0x28bc('0x15'),_0x4acfcd,_0x32b9ac['error'][_0x28bc('0x16')]);return _0x198ddb(_0x32b9ac[_0x28bc('0x14')][_0x28bc('0x16')]);}logger[_0x28bc('0x14')]('UserNotification,\x20%s,\x20%s',_0x4acfcd,_0x32b9ac[_0x28bc('0x14')][_0x28bc('0x16')]);return _0x2b4125(_0x32b9ac[_0x28bc('0x14')][_0x28bc('0x16')]);}else{logger['info'](_0x28bc('0x15'),_0x4acfcd,_0x28bc('0x12'));_0x2b4125(_0x32b9ac['result'][_0x28bc('0x16')]);}})[_0x28bc('0x17')](function(_0x286b60){logger['error'](_0x28bc('0x15'),_0x4acfcd,_0x286b60);_0x198ddb(_0x286b60);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 6112c83..763e640 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 _0x0dbc=['userNotification:','./userNotification.events','save','remove','emit','removeListener','length'];(function(_0x7ef41e,_0x1da6c4){var _0x1cfb32=function(_0x810388){while(--_0x810388){_0x7ef41e['push'](_0x7ef41e['shift']());}};_0x1cfb32(++_0x1da6c4);}(_0x0dbc,0x174));var _0xc0db=function(_0x3bc13e,_0x46db0c){_0x3bc13e=_0x3bc13e-0x0;var _0x3cb833=_0x0dbc[_0x3bc13e];return _0x3cb833;};'use strict';var UserNotificationEvents=require(_0xc0db('0x0'));var events=[_0xc0db('0x1'),_0xc0db('0x2'),'update'];function createListener(_0x5d8263,_0x4ecd6d){return function(_0x58f063){_0x4ecd6d[_0xc0db('0x3')](_0x5d8263,_0x58f063);};}function removeListener(_0x3cb20a,_0x48fc8f){return function(){UserNotificationEvents[_0xc0db('0x4')](_0x3cb20a,_0x48fc8f);};}exports['register']=function(_0x38cce0){for(var _0xf95f75=0x0,_0x1f92a8=events[_0xc0db('0x5')];_0xf95f75<_0x1f92a8;_0xf95f75++){var _0x1fa577=events[_0xf95f75];var _0x4eaec1=createListener(_0xc0db('0x6')+_0x1fa577,_0x38cce0);UserNotificationEvents['on'](_0x1fa577,_0x4eaec1);}}; \ No newline at end of file +var _0x383d=['./userNotification.events','remove','update','emit','length'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x383d,0x104));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var UserNotificationEvents=require(_0xd383('0x0'));var events=['save',_0xd383('0x1'),_0xd383('0x2')];function createListener(_0x433733,_0x39e3fa){return function(_0x1afd11){_0x39e3fa[_0xd383('0x3')](_0x433733,_0x1afd11);};}function removeListener(_0x1d2525,_0x112cc6){return function(){UserNotificationEvents['removeListener'](_0x1d2525,_0x112cc6);};}exports['register']=function(_0x37ba45){for(var _0x567f98=0x0,_0x35fb11=events[_0xd383('0x4')];_0x567f98<_0x35fb11;_0x567f98++){var _0x59ede1=events[_0x567f98];var _0x21bc51=createListener('userNotification:'+_0x59ede1,_0x37ba45);UserNotificationEvents['on'](_0x59ede1,_0x21bc51);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index f1cb403..a6c5818 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x503848,_0x31bcc4){var _0xe0ef09=function(_0x461582){while(--_0x461582){_0x503848['push'](_0x503848['shift']());}};_0xe0ef09(++_0x31bcc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x56b3a3,_0x77b2d){var _0x5315cf=function(_0x30622e){while(--_0x30622e){_0x56b3a3['push'](_0x56b3a3['shift']());}};_0x5315cf(++_0x77b2d);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 85cb755..be7b42e 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 _0xff16=['exports'];(function(_0x180d0a,_0x31029c){var _0x285808=function(_0x5db3e1){while(--_0x5db3e1){_0x180d0a['push'](_0x180d0a['shift']());}};_0x285808(++_0x31029c);}(_0xff16,0xa6));var _0x6ff1=function(_0x4daf63,_0x4752b8){_0x4daf63=_0x4daf63-0x0;var _0x1917d3=_0xff16[_0x4daf63];return _0x1917d3;};'use strict';var Sequelize=require('sequelize');module[_0x6ff1('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x870c=['INTEGER'];(function(_0x89dbac,_0x38447d){var _0x2cb880=function(_0x498483){while(--_0x498483){_0x89dbac['push'](_0x89dbac['shift']());}};_0x2cb880(++_0x38447d);}(_0x870c,0x1b9));var _0xc870=function(_0x2861c2,_0x534955){_0x2861c2=_0x2861c2-0x0;var _0x2fe16a=_0x870c[_0x2861c2];return _0x2fe16a;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xc870('0x0')],'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 f62dd45..b04d9b7 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 _0xaad5=['bluebird','request-promise','path','rimraf','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x258e3a,_0x23318c){var _0xcfa382=function(_0x223554){while(--_0x223554){_0x258e3a['push'](_0x258e3a['shift']());}};_0xcfa382(++_0x23318c);}(_0xaad5,0x8c));var _0x5aad=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xaad5[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0x5aad('0x0'));var util=require(_0x5aad('0x1'));var logger=require(_0x5aad('0x2'))(_0x5aad('0x3'));var moment=require('moment');var BPromise=require(_0x5aad('0x4'));var rp=require(_0x5aad('0x5'));var fs=require('fs');var path=require(_0x5aad('0x6'));var rimraf=require(_0x5aad('0x7'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x5aad('0x8')]=function(_0x1276bc,_0x3c581b){return _0x1276bc[_0x5aad('0x9')](_0x5aad('0xa'),attributes,{'tableName':_0x5aad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7923=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','util','../../config/logger','moment'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x7923,0x11d));var _0x3792=function(_0x2675b2,_0x29591b){_0x2675b2=_0x2675b2-0x0;var _0x3c1d2e=_0x7923[_0x2675b2];return _0x3c1d2e;};'use strict';var _=require('lodash');var util=require(_0x3792('0x0'));var logger=require(_0x3792('0x1'))('api');var moment=require(_0x3792('0x2'));var BPromise=require(_0x3792('0x3'));var rp=require(_0x3792('0x4'));var fs=require('fs');var path=require(_0x3792('0x5'));var rimraf=require(_0x3792('0x6'));var config=require(_0x3792('0x7'));var attributes=require(_0x3792('0x8'));module[_0x3792('0x9')]=function(_0x608c7a,_0x375a07){return _0x608c7a[_0x3792('0xa')](_0x3792('0xb'),attributes,{'tableName':'user_has_openchannel_queues','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 6130bcc..bd33382 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 _0x4b29=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0xe5a629,_0x20be77){var _0x5ef3fa=function(_0x4aec8e){while(--_0x4aec8e){_0xe5a629['push'](_0xe5a629['shift']());}};_0x5ef3fa(++_0x20be77);}(_0x4b29,0x73));var _0x94b2=function(_0xaf2b4b,_0x25c192){_0xaf2b4b=_0xaf2b4b-0x0;var _0x316e1e=_0x4b29[_0xaf2b4b];return _0x316e1e;};'use strict';var _=require('lodash');var util=require(_0x94b2('0x0'));var moment=require(_0x94b2('0x1'));var BPromise=require(_0x94b2('0x2'));var rs=require(_0x94b2('0x3'));var fs=require('fs');var Redis=require(_0x94b2('0x4'));var db=require(_0x94b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94b2('0x6'))(_0x94b2('0x7'));var config=require(_0x94b2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x94b2('0x9')][_0x94b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33d805,_0x27424d,_0x10fb9e){return new BPromise(function(_0x128f30,_0x1911af){return client[_0x94b2('0xb')](_0x33d805,_0x10fb9e)['then'](function(_0x129570){logger['info'](_0x94b2('0xc'),_0x27424d,'request\x20sent');logger[_0x94b2('0xd')](_0x94b2('0xe'),_0x27424d,_0x94b2('0xf'),JSON['stringify'](_0x129570));if(_0x129570[_0x94b2('0x10')]){if(_0x129570['error'][_0x94b2('0x11')]===0x1f4){logger[_0x94b2('0x10')](_0x94b2('0xc'),_0x27424d,_0x129570[_0x94b2('0x10')][_0x94b2('0x12')]);return _0x1911af(_0x129570[_0x94b2('0x10')][_0x94b2('0x12')]);}logger[_0x94b2('0x10')](_0x94b2('0xc'),_0x27424d,_0x129570[_0x94b2('0x10')][_0x94b2('0x12')]);return _0x128f30(_0x129570[_0x94b2('0x10')][_0x94b2('0x12')]);}else{logger['info'](_0x94b2('0xc'),_0x27424d,_0x94b2('0xf'));_0x128f30(_0x129570[_0x94b2('0x13')][_0x94b2('0x12')]);}})['catch'](function(_0x219500){logger[_0x94b2('0x10')](_0x94b2('0xc'),_0x27424d,_0x219500);_0x1911af(_0x219500);});});} \ No newline at end of file +var _0xc6dc=['randomstring','../../config/logger','rpc','../../config/environment','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x5051fa,_0x358ab2){var _0x4180cf=function(_0x590f04){while(--_0x590f04){_0x5051fa['push'](_0x5051fa['shift']());}};_0x4180cf(++_0x358ab2);}(_0xc6dc,0x152));var _0xcc6d=function(_0x2b21bd,_0x44d2ed){_0x2b21bd=_0x2b21bd-0x0;var _0x185226=_0xc6dc[_0x2b21bd];return _0x185226;};'use strict';var _=require(_0xcc6d('0x0'));var util=require(_0xcc6d('0x1'));var moment=require(_0xcc6d('0x2'));var BPromise=require(_0xcc6d('0x3'));var rs=require(_0xcc6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc6d('0x5'))(_0xcc6d('0x6'));var config=require(_0xcc6d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23c442,_0x16da88,_0x11cd2c){return new BPromise(function(_0x1e7dd9,_0x236fe7){return client['request'](_0x23c442,_0x11cd2c)[_0xcc6d('0x8')](function(_0x3b125f){logger['info'](_0xcc6d('0x9'),_0x16da88,'request\x20sent');logger[_0xcc6d('0xa')](_0xcc6d('0xb'),_0x16da88,'request\x20sent',JSON[_0xcc6d('0xc')](_0x3b125f));if(_0x3b125f['error']){if(_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xe')]===0x1f4){logger['error'](_0xcc6d('0x9'),_0x16da88,_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);return _0x236fe7(_0x3b125f['error'][_0xcc6d('0xf')]);}logger[_0xcc6d('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x16da88,_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);return _0x1e7dd9(_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);}else{logger[_0xcc6d('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x16da88,_0xcc6d('0x11'));_0x1e7dd9(_0x3b125f['result'][_0xcc6d('0xf')]);}})[_0xcc6d('0x12')](function(_0x37a63e){logger[_0xcc6d('0xd')](_0xcc6d('0x9'),_0x16da88,_0x37a63e);_0x236fe7(_0x37a63e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3ec5bd2..4238121 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 _0x280f=['removeSections','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','addResources','put','delete','destroy'];(function(_0x4c50fb,_0x42d1f2){var _0x5a289f=function(_0x377a84){while(--_0x377a84){_0x4c50fb['push'](_0x4c50fb['shift']());}};_0x5a289f(++_0x42d1f2);}(_0x280f,0x17b));var _0xf280=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x280f[_0x592e40];return _0x5d4288;};'use strict';var multer=require(_0xf280('0x0'));var util=require('util');var path=require(_0xf280('0x1'));var timeout=require(_0xf280('0x2'));var express=require(_0xf280('0x3'));var router=express[_0xf280('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf280('0x5'));var interaction=require(_0xf280('0x6'));var config=require(_0xf280('0x7'));var controller=require(_0xf280('0x8'));router[_0xf280('0x9')]('/',auth[_0xf280('0xa')](),controller[_0xf280('0xb')]);router[_0xf280('0x9')](_0xf280('0xc'),auth[_0xf280('0xa')](),controller['describe']);router[_0xf280('0x9')](_0xf280('0xd'),auth[_0xf280('0xa')](),controller[_0xf280('0xe')]);router[_0xf280('0x9')](_0xf280('0xf'),auth[_0xf280('0xa')](),controller[_0xf280('0x10')]);router[_0xf280('0x9')](_0xf280('0x11'),auth[_0xf280('0xa')](),controller['getResources']);router[_0xf280('0x12')]('/',auth[_0xf280('0xa')](),controller[_0xf280('0x13')]);router[_0xf280('0x12')](_0xf280('0x14'),auth[_0xf280('0xa')](),controller[_0xf280('0x15')]);router[_0xf280('0x12')](_0xf280('0xf'),auth[_0xf280('0xa')](),controller[_0xf280('0x16')]);router[_0xf280('0x12')](_0xf280('0x11'),auth[_0xf280('0xa')](),controller[_0xf280('0x17')]);router[_0xf280('0x18')](_0xf280('0xd'),auth[_0xf280('0xa')](),controller['update']);router[_0xf280('0x19')](_0xf280('0xd'),auth[_0xf280('0xa')](),controller[_0xf280('0x1a')]);router[_0xf280('0x19')](_0xf280('0xf'),auth['isAuthenticated'](),controller[_0xf280('0x1b')]);router[_0xf280('0x19')](_0xf280('0x11'),auth[_0xf280('0xa')](),controller['removeResources']);module[_0xf280('0x1c')]=router; \ No newline at end of file +var _0x2e4e=['removeSections','removeResources','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','clone','addSections','put','update','delete'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2e4e,0x9f));var _0xe2e4=function(_0x578a26,_0x3b2130){_0x578a26=_0x578a26-0x0;var _0x54e24e=_0x2e4e[_0x578a26];return _0x54e24e;};'use strict';var multer=require(_0xe2e4('0x0'));var util=require(_0xe2e4('0x1'));var path=require(_0xe2e4('0x2'));var timeout=require(_0xe2e4('0x3'));var express=require(_0xe2e4('0x4'));var router=express['Router']();var fs_extra=require(_0xe2e4('0x5'));var auth=require(_0xe2e4('0x6'));var interaction=require(_0xe2e4('0x7'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x9')]);router[_0xe2e4('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe2e4('0xa')](_0xe2e4('0xb'),auth[_0xe2e4('0x8')](),controller[_0xe2e4('0xc')]);router['get'](_0xe2e4('0xd'),auth['isAuthenticated'](),controller[_0xe2e4('0xe')]);router[_0xe2e4('0xa')](_0xe2e4('0xf'),auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x10')]);router[_0xe2e4('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe2e4('0x11')]('/:id/clone',auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x12')]);router['post']('/:id/sections',auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x13')]);router[_0xe2e4('0x11')](_0xe2e4('0xf'),auth['isAuthenticated'](),controller['addResources']);router[_0xe2e4('0x14')]('/:id',auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x15')]);router[_0xe2e4('0x16')](_0xe2e4('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xe2e4('0x16')](_0xe2e4('0xd'),auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x17')]);router['delete']('/:id/resources',auth[_0xe2e4('0x8')](),controller[_0xe2e4('0x18')]);module[_0xe2e4('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 98a5b80..1d5245f 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 _0x0249=['exports','STRING','name','setDataValue','crudPermissions','join','split','BOOLEAN','sequelize'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x0249,0xce));var _0x9024=function(_0x29746d,_0x3caff6){_0x29746d=_0x29746d-0x0;var _0x29d781=_0x0249[_0x29746d];return _0x29d781;};'use strict';var Sequelize=require(_0x9024('0x0'));module[_0x9024('0x1')]={'name':{'type':Sequelize[_0x9024('0x2')],'allowNull':![],'unique':_0x9024('0x3')},'crudPermissions':{'type':Sequelize[_0x9024('0x2')],'set':function(_0x9ced18){this[_0x9024('0x4')](_0x9024('0x5'),_0x9ced18?_0x9ced18[_0x9024('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x9024('0x5'))?this['getDataValue']('crudPermissions')[_0x9024('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9024('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9024('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9024('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9024('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9024('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9024('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9024('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe6a0=['crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join'];(function(_0x15b92b,_0x5c1053){var _0x45aba8=function(_0x5614ef){while(--_0x5614ef){_0x15b92b['push'](_0x15b92b['shift']());}};_0x45aba8(++_0x5c1053);}(_0xe6a0,0x112));var _0x0e6a=function(_0x525279,_0x4092f8){_0x525279=_0x525279-0x0;var _0x1b1f05=_0xe6a0[_0x525279];return _0x1b1f05;};'use strict';var Sequelize=require(_0x0e6a('0x0'));module[_0x0e6a('0x1')]={'name':{'type':Sequelize[_0x0e6a('0x2')],'allowNull':![],'unique':_0x0e6a('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1f7966){this[_0x0e6a('0x4')]('crudPermissions',_0x1f7966?_0x1f7966[_0x0e6a('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x0e6a('0x6'))?this[_0x0e6a('0x7')]('crudPermissions')[_0x0e6a('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0e6a('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0e6a('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 0a9d28d..ce9fc1d 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 _0x7c6c=['index','map','UserProfile','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','options','includeAll','include','rows','catch','show','params','merge','find','create','body','clone','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','findAll','each','autoAssociation','UserProfileResource','sectionId','Resources','UserProfileSection','update','describe','addSections','push','get','removeSections','ids','getSections','filter','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','userProfileId','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','send'];(function(_0x38646c,_0x1bb99c){var _0x826935=function(_0x350aa5){while(--_0x350aa5){_0x38646c['push'](_0x38646c['shift']());}};_0x826935(++_0x1bb99c);}(_0x7c6c,0xb9));var _0xc7c6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7c6c[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xc7c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7c6('0x1'));var jsonpatch=require(_0xc7c6('0x2'));var rp=require('request-promise');var moment=require(_0xc7c6('0x3'));var BPromise=require(_0xc7c6('0x4'));var Mustache=require(_0xc7c6('0x5'));var util=require(_0xc7c6('0x6'));var path=require(_0xc7c6('0x7'));var sox=require(_0xc7c6('0x8'));var csv=require('to-csv');var ejs=require(_0xc7c6('0x9'));var fs=require('fs');var fs_extra=require(_0xc7c6('0xa'));var _=require(_0xc7c6('0xb'));var squel=require('squel');var crypto=require(_0xc7c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc7c6('0xd'));var toCsv=require(_0xc7c6('0xe'));var querystring=require(_0xc7c6('0xf'));var Papa=require(_0xc7c6('0x10'));var Redis=require(_0xc7c6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc7c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7c6('0x13'))(_0xc7c6('0x14'));var utils=require(_0xc7c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc7c6('0x16'));var db=require(_0xc7c6('0x17'))['db'];config[_0xc7c6('0x18')]=_[_0xc7c6('0x19')](config[_0xc7c6('0x18')],{'host':_0xc7c6('0x1a'),'port':0x18eb});var socket=require(_0xc7c6('0x1b'))(new Redis(config[_0xc7c6('0x18')]));require('./userProfile.socket')[_0xc7c6('0x1c')](socket);function respondWithStatusCode(_0x1dd347,_0x252c2a){_0x252c2a=_0x252c2a||0xcc;return function(_0xf1949){if(_0xf1949){return _0x1dd347['sendStatus'](_0x252c2a);}return _0x1dd347[_0xc7c6('0x1d')](_0x252c2a)[_0xc7c6('0x1e')]();};}function respondWithResult(_0x442ad1,_0x3cf936){_0x3cf936=_0x3cf936||0xc8;return function(_0x30b9cd){if(_0x30b9cd){return _0x442ad1[_0xc7c6('0x1d')](_0x3cf936)[_0xc7c6('0x1f')](_0x30b9cd);}};}function respondWithFilteredResult(_0x485131,_0xa50b40){return function(_0x5b07ec){if(_0x5b07ec){var _0x3ecbd0=typeof _0xa50b40[_0xc7c6('0x20')]===_0xc7c6('0x21')&&typeof _0xa50b40[_0xc7c6('0x22')]===_0xc7c6('0x21');var _0x3c6678=_0x5b07ec[_0xc7c6('0x23')];var _0x3b7f74=_0x3ecbd0?0x0:_0xa50b40[_0xc7c6('0x20')];var _0x98646b=_0x3ecbd0?_0x5b07ec[_0xc7c6('0x23')]:_0xa50b40[_0xc7c6('0x20')]+_0xa50b40[_0xc7c6('0x22')];var _0x2c5d37;if(_0x98646b>=_0x3c6678){_0x98646b=_0x3c6678;_0x2c5d37=0xc8;}else{_0x2c5d37=0xce;}_0x485131[_0xc7c6('0x1d')](_0x2c5d37);return _0x485131[_0xc7c6('0x24')](_0xc7c6('0x25'),_0x3b7f74+'-'+_0x98646b+'/'+_0x3c6678)[_0xc7c6('0x1f')](_0x5b07ec);}return null;};}function patchUpdates(_0x55e70d){return function(_0x4786ac){try{jsonpatch['apply'](_0x4786ac,_0x55e70d,!![]);}catch(_0x27fe2c){return BPromise[_0xc7c6('0x26')](_0x27fe2c);}return _0x4786ac[_0xc7c6('0x27')]();};}function saveUpdates(_0x3dd09a,_0x242d41){return function(_0x826f42){if(_0x826f42){return _0x826f42['update'](_0x3dd09a)[_0xc7c6('0x28')](function(_0x175045){return _0x175045;});}return null;};}function removeEntity(_0x565564,_0x3d265d){return function(_0x13df9b){if(_0x13df9b){return _0x13df9b[_0xc7c6('0x29')]()[_0xc7c6('0x28')](function(){_0x565564['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48aa32,_0x584b5d){return function(_0x2823b5){if(!_0x2823b5){_0x48aa32['sendStatus'](0x194);}return _0x2823b5;};}function handleError(_0x463e76,_0x53f348){_0x53f348=_0x53f348||0x1f4;return function(_0x8e707b){logger[_0xc7c6('0x2a')](_0x8e707b[_0xc7c6('0x2b')]);if(_0x8e707b['name']){delete _0x8e707b['name'];}_0x463e76[_0xc7c6('0x1d')](_0x53f348)[_0xc7c6('0x2c')](_0x8e707b);};}exports[_0xc7c6('0x2d')]=function(_0x115a5b,_0x44aa32){var _0x57d01e={},_0x42fc39={},_0x1edd1b={'count':0x0,'rows':[]};var _0x3acf2b=_[_0xc7c6('0x2e')](db[_0xc7c6('0x2f')][_0xc7c6('0x30')],function(_0x2bb170){return{'name':_0x2bb170[_0xc7c6('0x31')],'type':_0x2bb170[_0xc7c6('0x32')][_0xc7c6('0x33')]};});_0x42fc39[_0xc7c6('0x34')]=_['map'](_0x3acf2b,_0xc7c6('0x35'));_0x42fc39[_0xc7c6('0x36')]=_[_0xc7c6('0x37')](_0x115a5b[_0xc7c6('0x36')]);_0x42fc39[_0xc7c6('0x38')]=_[_0xc7c6('0x39')](_0x42fc39[_0xc7c6('0x34')],_0x42fc39[_0xc7c6('0x36')]);_0x57d01e[_0xc7c6('0x3a')]=_[_0xc7c6('0x39')](_0x42fc39[_0xc7c6('0x34')],qs[_0xc7c6('0x3b')](_0x115a5b[_0xc7c6('0x36')][_0xc7c6('0x3b')]));_0x57d01e['attributes']=_0x57d01e[_0xc7c6('0x3a')][_0xc7c6('0x3c')]?_0x57d01e[_0xc7c6('0x3a')]:_0x42fc39['model'];if(!_0x115a5b[_0xc7c6('0x36')][_0xc7c6('0x3d')](_0xc7c6('0x3e'))){_0x57d01e[_0xc7c6('0x22')]=qs[_0xc7c6('0x22')](_0x115a5b['query'][_0xc7c6('0x22')]);_0x57d01e['offset']=qs['offset'](_0x115a5b[_0xc7c6('0x36')][_0xc7c6('0x20')]);}_0x57d01e[_0xc7c6('0x3f')]=qs['sort'](_0x115a5b[_0xc7c6('0x36')]['sort']);_0x57d01e['where']=qs['filters'](_[_0xc7c6('0x40')](_0x115a5b['query'],_0x42fc39[_0xc7c6('0x38')]),_0x3acf2b);if(_0x115a5b[_0xc7c6('0x36')]['filter']){_0x57d01e[_0xc7c6('0x41')]=_['merge'](_0x57d01e[_0xc7c6('0x41')],{'$or':_['map'](_0x3acf2b,function(_0x290587){if(_0x290587[_0xc7c6('0x32')]!=='VIRTUAL'){var _0x1e178d={};_0x1e178d[_0x290587[_0xc7c6('0x35')]]={'$like':'%'+_0x115a5b['query']['filter']+'%'};return _0x1e178d;}})});}_0x57d01e=_['merge']({},_0x57d01e,_0x115a5b[_0xc7c6('0x42')]);var _0x29d9b6={'where':_0x57d01e['where']};return db[_0xc7c6('0x2f')]['count'](_0x29d9b6)[_0xc7c6('0x28')](function(_0x3ca2be){_0x1edd1b['count']=_0x3ca2be;if(_0x115a5b['query'][_0xc7c6('0x43')]){_0x57d01e[_0xc7c6('0x44')]=[{'all':!![]}];}return db[_0xc7c6('0x2f')]['findAll'](_0x57d01e);})[_0xc7c6('0x28')](function(_0xd4e103){_0x1edd1b[_0xc7c6('0x45')]=_0xd4e103;return _0x1edd1b;})[_0xc7c6('0x28')](respondWithFilteredResult(_0x44aa32,_0x57d01e))[_0xc7c6('0x46')](handleError(_0x44aa32,null));};exports[_0xc7c6('0x47')]=function(_0x25ce6d,_0x248c46){var _0x29a72f={'raw':![],'where':{'id':_0x25ce6d[_0xc7c6('0x48')]['id']}},_0x412d86={};_0x412d86[_0xc7c6('0x34')]=_[_0xc7c6('0x37')](db['UserProfile'][_0xc7c6('0x30')]);_0x412d86['query']=_[_0xc7c6('0x37')](_0x25ce6d[_0xc7c6('0x36')]);_0x412d86[_0xc7c6('0x38')]=_[_0xc7c6('0x39')](_0x412d86[_0xc7c6('0x34')],_0x412d86['query']);_0x29a72f[_0xc7c6('0x3a')]=_[_0xc7c6('0x39')](_0x412d86[_0xc7c6('0x34')],qs[_0xc7c6('0x3b')](_0x25ce6d['query'][_0xc7c6('0x3b')]));_0x29a72f[_0xc7c6('0x3a')]=_0x29a72f[_0xc7c6('0x3a')][_0xc7c6('0x3c')]?_0x29a72f[_0xc7c6('0x3a')]:_0x412d86[_0xc7c6('0x34')];if(_0x25ce6d['query'][_0xc7c6('0x43')]){_0x29a72f['include']=[{'all':!![]}];}_0x29a72f=_[_0xc7c6('0x49')]({},_0x29a72f,_0x25ce6d[_0xc7c6('0x42')]);return db[_0xc7c6('0x2f')][_0xc7c6('0x4a')](_0x29a72f)[_0xc7c6('0x28')](handleEntityNotFound(_0x248c46,null))[_0xc7c6('0x28')](respondWithResult(_0x248c46,null))[_0xc7c6('0x46')](handleError(_0x248c46,null));};exports[_0xc7c6('0x4b')]=function(_0x476ef8,_0x5c9c8f){return db['UserProfile'][_0xc7c6('0x4b')](_0x476ef8[_0xc7c6('0x4c')],{})[_0xc7c6('0x28')](respondWithResult(_0x5c9c8f,0xc9))[_0xc7c6('0x46')](handleError(_0x5c9c8f,null));};exports[_0xc7c6('0x4d')]=function(_0x111aba,_0x2478c3){var _0x2f2b01={'where':{'id':_0x111aba['params']['id']}},_0x5129ca={};_0x5129ca['model']=_[_0xc7c6('0x37')](db[_0xc7c6('0x2f')]['rawAttributes']);_0x2f2b01[_0xc7c6('0x3a')]=_[_0xc7c6('0x39')](_0x5129ca[_0xc7c6('0x34')],qs[_0xc7c6('0x3b')](_0x111aba[_0xc7c6('0x36')][_0xc7c6('0x3b')]));_0x2f2b01[_0xc7c6('0x3a')]=_0x2f2b01[_0xc7c6('0x3a')][_0xc7c6('0x3c')]?_0x2f2b01['attributes']:_0x5129ca['model'];if(_0x111aba[_0xc7c6('0x36')][_0xc7c6('0x43')]){_0x2f2b01[_0xc7c6('0x44')]=[{'all':!![]}];}_0x2f2b01=_[_0xc7c6('0x49')]({},_0x2f2b01,_0x111aba[_0xc7c6('0x42')]);return db[_0xc7c6('0x2f')][_0xc7c6('0x4a')](_0x2f2b01)[_0xc7c6('0x28')](handleEntityNotFound(_0x2478c3,null))['then'](function(_0x476471){if(_0x476471){var _0x14af07=_0x476471['get']({'plain':!![]});_0x14af07=qs['omit'](_0x14af07,['id',_0xc7c6('0x4e'),_0xc7c6('0x4f'),_0xc7c6('0x50')]);_0x111aba['body']=_[_0xc7c6('0x51')](_0x111aba[_0xc7c6('0x4c')],['id',_0xc7c6('0x4e'),_0xc7c6('0x4f')]);return db[_0xc7c6('0x52')][_0xc7c6('0x53')](function(_0x1d6e2f){return db['UserProfile'][_0xc7c6('0x4b')](_[_0xc7c6('0x49')](_0x14af07,_0x111aba[_0xc7c6('0x4c')]),{'include':_0x111aba[_0xc7c6('0x36')][_0xc7c6('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x1d6e2f})[_0xc7c6('0x28')](function(_0x1e99e8){var _0x20b127=_0x1e99e8['get']({'plain':!![]});return db['UserProfileSection'][_0xc7c6('0x54')]({'where':{'userProfileId':_0x111aba['params']['id']},'raw':!![]})[_0xc7c6('0x28')](function(_0x6b7342){if(_0x6b7342){return BPromise[_0xc7c6('0x55')](_0x6b7342,function(_0x5653d2){return new BPromise(function(_0x408618,_0x5cf4db){if(_0x5653d2[_0xc7c6('0x56')]===null||_0x5653d2[_0xc7c6('0x56')]===0x1)_0x408618(null);return db[_0xc7c6('0x57')][_0xc7c6('0x54')]({'where':{'sectionId':_0x5653d2['id']},'raw':!![]})['then'](function(_0x55dbfd){var _0x22ff28=_[_0xc7c6('0x2e')](_0x55dbfd,function(_0xe87c12){return qs['omit'](_0xe87c12,['id',_0xc7c6('0x4e'),_0xc7c6('0x4f'),_0xc7c6('0x58')]);});_0x408618(_0x22ff28);})[_0xc7c6('0x46')](function(_0x688c){_0x5cf4db(_0x688c);});})[_0xc7c6('0x28')](function(_0x1e6632){var _0x3f944f=qs['omit'](_0x5653d2,['id',_0xc7c6('0x4e'),_0xc7c6('0x4f')]);_0x3f944f['userProfileId']=_0x20b127['id'];if(_0x1e6632)_0x3f944f[_0xc7c6('0x59')]=_0x1e6632;return _0x3f944f;})['then'](function(_0x465cb7){return db[_0xc7c6('0x5a')][_0xc7c6('0x4b')](_0x465cb7,{'include':[{'model':db[_0xc7c6('0x57')],'as':_0xc7c6('0x59')}],'raw':!![],'transaction':_0x1d6e2f});});})[_0xc7c6('0x28')](function(){return _0x20b127;});}});});});}})[_0xc7c6('0x28')](respondWithResult(_0x2478c3,0xc9))[_0xc7c6('0x46')](handleError(_0x2478c3,null));};exports[_0xc7c6('0x5b')]=function(_0xc95a2f,_0x2aee19){if(_0xc95a2f[_0xc7c6('0x4c')]['id']){delete _0xc95a2f[_0xc7c6('0x4c')]['id'];}return db['UserProfile']['find']({'where':{'id':_0xc95a2f[_0xc7c6('0x48')]['id']}})[_0xc7c6('0x28')](handleEntityNotFound(_0x2aee19,null))[_0xc7c6('0x28')](saveUpdates(_0xc95a2f[_0xc7c6('0x4c')],null))['then'](respondWithResult(_0x2aee19,null))[_0xc7c6('0x46')](handleError(_0x2aee19,null));};exports[_0xc7c6('0x29')]=function(_0x28b518,_0x50d529){return db[_0xc7c6('0x2f')][_0xc7c6('0x4a')]({'where':{'id':_0x28b518[_0xc7c6('0x48')]['id']}})[_0xc7c6('0x28')](handleEntityNotFound(_0x50d529,null))[_0xc7c6('0x28')](removeEntity(_0x50d529,null))[_0xc7c6('0x46')](handleError(_0x50d529,null));};exports['describe']=function(_0x1a7539,_0x43e90a){return db[_0xc7c6('0x2f')][_0xc7c6('0x5c')]()['then'](respondWithResult(_0x43e90a,null))[_0xc7c6('0x46')](handleError(_0x43e90a,null));};exports[_0xc7c6('0x5d')]=function(_0x3a2c6d,_0x9c1834){var _0x519940=_0x3a2c6d['body'];return db[_0xc7c6('0x2f')][_0xc7c6('0x4a')]({'where':{'id':_0x3a2c6d[_0xc7c6('0x48')]['id']}})[_0xc7c6('0x28')](handleEntityNotFound(_0x9c1834,null))['then'](function(_0x541caa){if(_0x541caa){return db['sequelize']['transaction'](function(_0x32dc6a){return db[_0xc7c6('0x5a')][_0xc7c6('0x29')]({'where':{'userProfileId':_0x3a2c6d[_0xc7c6('0x48')]['id'],'sectionId':_[_0xc7c6('0x2e')](_0x519940,function(_0x565d57){return _0x565d57[_0xc7c6('0x58')];})},'transaction':_0x32dc6a})['then'](function(){var _0x395405=_[_0xc7c6('0x2e')](_0x519940,function(_0x2c084f){_0x2c084f['userProfileId']=_0x3a2c6d[_0xc7c6('0x48')]['id'];return _0x2c084f;});var _0x2dfb43=[];return BPromise[_0xc7c6('0x55')](_0x395405,function(_0x5ffe5d){return db[_0xc7c6('0x5a')]['create'](_0x5ffe5d,{'include':[{'model':db[_0xc7c6('0x57')],'as':_0xc7c6('0x59')}],'raw':!![],'transaction':_0x32dc6a})[_0xc7c6('0x28')](function(_0x1c44f8){_0x2dfb43[_0xc7c6('0x5e')](_0x1c44f8[_0xc7c6('0x5f')]({'plain':!![]}));});})['then'](function(){return _0x2dfb43;});});});}})[_0xc7c6('0x28')](function(_0x1ee6a8){return _0x1ee6a8;})[_0xc7c6('0x28')](respondWithResult(_0x9c1834,null))[_0xc7c6('0x46')](handleError(_0x9c1834,null));};exports[_0xc7c6('0x60')]=function(_0x3edb80,_0x2b01bd){var _0x17c47d;return db[_0xc7c6('0x2f')][_0xc7c6('0x4a')]({'where':{'id':_0x3edb80['params']['id']},'attributes':['id',_0xc7c6('0x35')]})[_0xc7c6('0x28')](handleEntityNotFound(_0x2b01bd,null))['then'](function(_0x443306){if(_0x443306){_0x17c47d=_0x443306;return db['UserProfileSection'][_0xc7c6('0x29')]({'where':{'userProfileId':_0x3edb80[_0xc7c6('0x48')]['id'],'sectionId':_0x3edb80[_0xc7c6('0x36')][_0xc7c6('0x61')]}});}})[_0xc7c6('0x28')](function(){return _0x17c47d;})[_0xc7c6('0x28')](respondWithStatusCode(_0x2b01bd,null))[_0xc7c6('0x46')](handleError(_0x2b01bd,null));};exports[_0xc7c6('0x62')]=function(_0x728f95,_0x26f3cc){var _0x385b7c=[];var _0x562637=[];return db[_0xc7c6('0x5a')][_0xc7c6('0x54')]({'where':{'userProfileId':_0x728f95['params']['id']},'raw':!![]})[_0xc7c6('0x28')](function(_0x1c0a7f){_0x385b7c=_[_0xc7c6('0x63')](_0x1c0a7f,function(_0x2aed45){return _0x2aed45[_0xc7c6('0x64')]===0x1||_[_0xc7c6('0x65')]([0x3eb,0x709],_0x2aed45[_0xc7c6('0x58')]);});if(!_[_0xc7c6('0x66')](_0x385b7c)){return _['map'](_0x385b7c,function(_0x5ef25e){return _0x5ef25e['sectionId'];});}else{return;}})[_0xc7c6('0x28')](function(_0x5b8e02){if(_0x5b8e02)_0x562637=_0x5b8e02;if(_[_0xc7c6('0x65')](_0x562637,0x64)){var _0x7fa081=_['find'](_0x385b7c,{'sectionId':0x64});return hasDefaultDashboard(_0x7fa081)[_0xc7c6('0x28')](function(_0x5164ed){return _['map'](_0x385b7c,function(_0x413391){if(_0x413391[_0xc7c6('0x58')]===0x64){_0x413391[_0xc7c6('0x67')]=_0x5164ed;}return _0x413391;});});}else{return;}})[_0xc7c6('0x28')](function(_0x2f674f){if(_0x2f674f)_0x385b7c=_0x2f674f;if(_[_0xc7c6('0x65')](_0x562637,0x3eb)){var _0x443762=_[_0xc7c6('0x4a')](_0x385b7c,{'sectionId':0x3eb});return getCustomDashboards(_0x443762)[_0xc7c6('0x28')](function(_0x4fb854){return _['map'](_0x385b7c,function(_0x4d4cd7){if(_0x443762[_0xc7c6('0x64')]){if(_0x4d4cd7[_0xc7c6('0x58')]===0x3eb){_0x4d4cd7[_0xc7c6('0x67')]=_0x4fb854;}}else{if(_0x4d4cd7[_0xc7c6('0x58')]===0x64){if(!_0x4d4cd7[_0xc7c6('0x67')]){_0x4d4cd7[_0xc7c6('0x67')]=[];}_0x4d4cd7['subsections']=_0x4d4cd7[_0xc7c6('0x67')][_0xc7c6('0x68')](_0x4fb854);}}return _0x4d4cd7;});});}else{return;}})[_0xc7c6('0x28')](function(_0x28c55f){if(_0x28c55f)_0x385b7c=_0x28c55f;if(_['includes'](_0x562637,0x709)){var _0xb19950=_[_0xc7c6('0x4a')](_0x385b7c,{'sectionId':0x709});return getPlugins(_0xb19950)[_0xc7c6('0x28')](function(_0x2484f1){if(_0xb19950[_0xc7c6('0x64')]){return _[_0xc7c6('0x2e')](_0x385b7c,function(_0x43923a){if(_0x43923a['sectionId']===0x709){_0x43923a[_0xc7c6('0x67')]=_0x2484f1;}return _0x43923a;});}else{var _0x2aae5c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2484f1};var _0x5b1999=_[_0xc7c6('0x2e')](_0x385b7c);_0x5b1999[_0xc7c6('0x5e')](_0x2aae5c);return _0x5b1999;}});}else{return;}})[_0xc7c6('0x28')](function(_0x1abe45){if(_0x1abe45)_0x385b7c=_0x1abe45;return _[_0xc7c6('0x63')](_0x385b7c,[_0xc7c6('0x64'),0x1]);})[_0xc7c6('0x28')](respondWithResult(_0x26f3cc,null))[_0xc7c6('0x46')](handleError(_0x26f3cc,null));};function hasDefaultDashboard(_0x3c928b){var _0x351dba=[0x65];return new BPromise(function(_0x3e13d8,_0xacc7e6){try{if(_0x3c928b[_0xc7c6('0x56')]){_0x3e13d8(_0x351dba);}else{return db[_0xc7c6('0x57')][_0xc7c6('0x69')]({'where':{'sectionId':_0x3c928b['id']},'raw':!![]})['then'](function(_0x4e3087){_0x4e3087?_0x3e13d8(_0x351dba):_0x3e13d8();});}}catch(_0x30c29b){_0xacc7e6(_0x30c29b);}});}function getCustomDashboards(_0x33b0aa){var _0x94435c=[];return new BPromise(function(_0x5e273c,_0x538fc3){try{if(_0x33b0aa['autoAssociation']){return db[_0xc7c6('0x6a')][_0xc7c6('0x54')]({'raw':!![]})['then'](function(_0x3a6606){_0x3a6606[_0xc7c6('0x6b')](function(_0x5b2c76){_0x94435c['push'](_0x5b2c76['id']+0x1869f);});_0x5e273c(_0x94435c);});}else{return db['UserProfileResource'][_0xc7c6('0x54')]({'where':{'sectionId':_0x33b0aa['id']},'raw':!![]})['then'](function(_0x2d198c){_0x2d198c[_0xc7c6('0x6b')](function(_0x334fc1){_0x94435c[_0xc7c6('0x5e')](_0x334fc1[_0xc7c6('0x6c')]+0x1869f);});_0x5e273c(_0x94435c);});}}catch(_0x21be89){_0x538fc3(_0x21be89);}});}function getPlugins(_0x4ca115){var _0x2e7060=[];return new BPromise(function(_0x15db87,_0x27e22c){try{if(_0x4ca115[_0xc7c6('0x56')]){return db['Plugin'][_0xc7c6('0x54')]({'raw':!![]})[_0xc7c6('0x28')](function(_0x27b6c3){_0x27b6c3['forEach'](function(_0x4614c1){_0x2e7060[_0xc7c6('0x5e')](_0x4614c1['id']+0x15b38);});_0x15db87(_0x2e7060);});}else{return db[_0xc7c6('0x57')][_0xc7c6('0x54')]({'where':{'sectionId':_0x4ca115['id']},'raw':!![]})[_0xc7c6('0x28')](function(_0x456817){_0x456817[_0xc7c6('0x6b')](function(_0x21625c){_0x2e7060['push'](_0x21625c[_0xc7c6('0x6c')]+0x15b38);});_0x15db87(_0x2e7060);});}}catch(_0x1337d4){_0x27e22c(_0x1337d4);}});}exports['addResources']=function(_0x2ce444,_0x59cb6){return db['UserProfile'][_0xc7c6('0x4a')]({'where':{'id':_0x2ce444[_0xc7c6('0x48')]['id']}})[_0xc7c6('0x28')](handleEntityNotFound(_0x59cb6,null))[_0xc7c6('0x28')](function(_0x2b05b2){if(_0x2b05b2){return db['sequelize']['transaction'](function(_0x16ccaf){return db[_0xc7c6('0x5a')][_0xc7c6('0x54')]({'where':{'userProfileId':_0x2ce444[_0xc7c6('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4d592f){if(_0x4d592f){return db['UserProfileSection'][_0xc7c6('0x29')]({'where':{'userProfileId':_0x2ce444[_0xc7c6('0x48')]['id'],'id':_[_0xc7c6('0x2e')](_0x4d592f,function(_0x892032){return _0x892032['id'];})},'transaction':_0x16ccaf});}})['then'](function(_0xd991cf){var _0x410493=_[_0xc7c6('0x2e')](_0x2ce444[_0xc7c6('0x4c')],function(_0x3c002a){_0x3c002a[_0xc7c6('0x6d')]=_0x2ce444[_0xc7c6('0x48')]['id'];return _0x3c002a;});return db['UserProfileSection'][_0xc7c6('0x6e')](_0x410493,{'raw':!![],'transaction':_0x16ccaf});})[_0xc7c6('0x28')](function(_0x845c81){var _0x22933d=_[_0xc7c6('0x63')](_['map'](_0x845c81,function(_0x1dabf6){return _0x1dabf6[_0xc7c6('0x5f')]({'plain':!![]});}),{'includeAll':![]});if(_0x22933d){return db[_0xc7c6('0x5a')]['findAll']({'where':{'userProfileId':_0x2ce444['params']['id'],'sectionId':_[_0xc7c6('0x2e')](_0x22933d,function(_0x17b17d){return _0x17b17d[_0xc7c6('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xc7c6('0x28')](function(_0x3375c5){var _0x264e2f=_[_0xc7c6('0x2e')](_0x2ce444[_0xc7c6('0x4c')],function(_0xae8220){_0xae8220[_0xc7c6('0x6d')]=_0x2ce444['params']['id'];return _0xae8220;});return db['UserProfileResource'][_0xc7c6('0x6e')](_0x264e2f,{'raw':!![],'transaction':_0x16ccaf});});}})['catch'](handleError(_0x59cb6,null));});}})[_0xc7c6('0x28')](function(_0x1c7409){var _0x2131a8=_[_0xc7c6('0x2e')](_0x1c7409,function(_0x4e042c){return _0x4e042c[_0xc7c6('0x5f')]({'plain':!![]});});})[_0xc7c6('0x28')](respondWithResult(_0x59cb6,null))[_0xc7c6('0x46')](handleError(_0x59cb6,null));};exports[_0xc7c6('0x6f')]=function(_0xc702b6,_0x39a20e,_0x45eb3a){return db[_0xc7c6('0x2f')]['find']({'where':{'id':_0xc702b6[_0xc7c6('0x48')]['id']}})[_0xc7c6('0x28')](handleEntityNotFound(_0x39a20e,null))[_0xc7c6('0x28')](function(_0x36968c){if(_0x36968c){return _0x36968c[_0xc7c6('0x6f')](_0xc702b6[_0xc7c6('0x36')][_0xc7c6('0x61')]);}})[_0xc7c6('0x28')](respondWithStatusCode(_0x39a20e,null))['catch'](handleError(_0x39a20e,null));};exports['getResources']=function(_0x481b83,_0x2cf029){var _0x2332e2={};if(!_0x481b83[_0xc7c6('0x36')][_0xc7c6('0x70')])throw new Error(_0xc7c6('0x71'));if(!_0x481b83[_0xc7c6('0x36')][_0xc7c6('0x3d')](_0xc7c6('0x3e'))){_0x2332e2[_0xc7c6('0x22')]=qs[_0xc7c6('0x22')](_0x481b83[_0xc7c6('0x36')][_0xc7c6('0x22')]);_0x2332e2['offset']=qs[_0xc7c6('0x20')](_0x481b83[_0xc7c6('0x36')][_0xc7c6('0x20')]);}return db['UserProfile']['find']({'where':{'id':_0x481b83[_0xc7c6('0x48')]['id']}})[_0xc7c6('0x28')](function(_0x2108de){if(!_0x2108de)throw new Error(_0xc7c6('0x72')+_0x481b83['params']['id']);return db[_0xc7c6('0x2f')]['getResources'](_0x481b83);})[_0xc7c6('0x28')](respondWithFilteredResult(_0x2cf029,_0x2332e2))['catch'](handleError(_0x2cf029,null));}; \ No newline at end of file +var _0x19ea=['hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','rows','params','options','find','catch','create','clone','get','omit','createdAt','crudPermissions','body','updatedAt','UserProfileSection','findAll','autoAssociation','UserProfileResource','sectionId','userProfileId','describe','addSections','sequelize','transaction','each','Resources','removeSections','ids','getSections','enabled','includes','subsections','concat','push','Dashboard','forEach','Plugin','addResources','removeResources','getResources','section','Missing\x20section\x20parameter'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x19ea,0xe0));var _0xa19e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x19ea[_0x122096];return _0x3d1966;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa19e('0x0'));var zipdir=require(_0xa19e('0x1'));var jsonpatch=require(_0xa19e('0x2'));var rp=require(_0xa19e('0x3'));var moment=require(_0xa19e('0x4'));var BPromise=require(_0xa19e('0x5'));var Mustache=require(_0xa19e('0x6'));var util=require('util');var path=require(_0xa19e('0x7'));var sox=require(_0xa19e('0x8'));var csv=require(_0xa19e('0x9'));var ejs=require(_0xa19e('0xa'));var fs=require('fs');var fs_extra=require(_0xa19e('0xb'));var _=require(_0xa19e('0xc'));var squel=require(_0xa19e('0xd'));var crypto=require(_0xa19e('0xe'));var jsforce=require(_0xa19e('0xf'));var deskjs=require(_0xa19e('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa19e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa19e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa19e('0x13'))(_0xa19e('0x14'));var utils=require(_0xa19e('0x15'));var config=require(_0xa19e('0x16'));var licenseUtil=require(_0xa19e('0x17'));var db=require(_0xa19e('0x18'))['db'];config['redis']=_['defaults'](config[_0xa19e('0x19')],{'host':_0xa19e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa19e('0x19')]));require(_0xa19e('0x1b'))[_0xa19e('0x1c')](socket);function respondWithStatusCode(_0x6651a,_0x3436cb){_0x3436cb=_0x3436cb||0xcc;return function(_0x8420a9){if(_0x8420a9){return _0x6651a['sendStatus'](_0x3436cb);}return _0x6651a[_0xa19e('0x1d')](_0x3436cb)[_0xa19e('0x1e')]();};}function respondWithResult(_0x599f8c,_0x5689e0){_0x5689e0=_0x5689e0||0xc8;return function(_0x479498){if(_0x479498){return _0x599f8c[_0xa19e('0x1d')](_0x5689e0)[_0xa19e('0x1f')](_0x479498);}};}function respondWithFilteredResult(_0x33a1f9,_0x90f198){return function(_0x5215df){if(_0x5215df){var _0x2b57d5=typeof _0x90f198[_0xa19e('0x20')]===_0xa19e('0x21')&&typeof _0x90f198[_0xa19e('0x22')]==='undefined';var _0x3f6f3c=_0x5215df[_0xa19e('0x23')];var _0x66e7a6=_0x2b57d5?0x0:_0x90f198[_0xa19e('0x20')];var _0x439af1=_0x2b57d5?_0x5215df[_0xa19e('0x23')]:_0x90f198['offset']+_0x90f198[_0xa19e('0x22')];var _0x43d64e;if(_0x439af1>=_0x3f6f3c){_0x439af1=_0x3f6f3c;_0x43d64e=0xc8;}else{_0x43d64e=0xce;}_0x33a1f9[_0xa19e('0x1d')](_0x43d64e);return _0x33a1f9[_0xa19e('0x24')](_0xa19e('0x25'),_0x66e7a6+'-'+_0x439af1+'/'+_0x3f6f3c)[_0xa19e('0x1f')](_0x5215df);}return null;};}function patchUpdates(_0xb4fa87){return function(_0x40d588){try{jsonpatch['apply'](_0x40d588,_0xb4fa87,!![]);}catch(_0xa8be8f){return BPromise[_0xa19e('0x26')](_0xa8be8f);}return _0x40d588['save']();};}function saveUpdates(_0x1c6d87,_0x5ec2f7){return function(_0x21f051){if(_0x21f051){return _0x21f051[_0xa19e('0x27')](_0x1c6d87)[_0xa19e('0x28')](function(_0x28109c){return _0x28109c;});}return null;};}function removeEntity(_0x1e67cc,_0x28c790){return function(_0x3bbe7a){if(_0x3bbe7a){return _0x3bbe7a[_0xa19e('0x29')]()[_0xa19e('0x28')](function(){_0x1e67cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d560,_0x2adfce){return function(_0x5b3617){if(!_0x5b3617){_0x46d560['sendStatus'](0x194);}return _0x5b3617;};}function handleError(_0x437498,_0x1cbf04){_0x1cbf04=_0x1cbf04||0x1f4;return function(_0x1c2f3a){logger[_0xa19e('0x2a')](_0x1c2f3a[_0xa19e('0x2b')]);if(_0x1c2f3a[_0xa19e('0x2c')]){delete _0x1c2f3a['name'];}_0x437498[_0xa19e('0x1d')](_0x1cbf04)[_0xa19e('0x2d')](_0x1c2f3a);};}exports[_0xa19e('0x2e')]=function(_0x180bf0,_0x18b2a4){var _0x44e2b6={},_0x19e821={},_0x44e04d={'count':0x0,'rows':[]};var _0x378d9f=_['map'](db[_0xa19e('0x2f')][_0xa19e('0x30')],function(_0x244792){return{'name':_0x244792[_0xa19e('0x31')],'type':_0x244792[_0xa19e('0x32')]['key']};});_0x19e821['model']=_[_0xa19e('0x33')](_0x378d9f,_0xa19e('0x2c'));_0x19e821[_0xa19e('0x34')]=_[_0xa19e('0x35')](_0x180bf0['query']);_0x19e821['filters']=_['intersection'](_0x19e821[_0xa19e('0x36')],_0x19e821[_0xa19e('0x34')]);_0x44e2b6[_0xa19e('0x37')]=_[_0xa19e('0x38')](_0x19e821[_0xa19e('0x36')],qs['fields'](_0x180bf0[_0xa19e('0x34')][_0xa19e('0x39')]));_0x44e2b6[_0xa19e('0x37')]=_0x44e2b6[_0xa19e('0x37')][_0xa19e('0x3a')]?_0x44e2b6[_0xa19e('0x37')]:_0x19e821[_0xa19e('0x36')];if(!_0x180bf0[_0xa19e('0x34')]['hasOwnProperty'](_0xa19e('0x3b'))){_0x44e2b6[_0xa19e('0x22')]=qs[_0xa19e('0x22')](_0x180bf0[_0xa19e('0x34')]['limit']);_0x44e2b6[_0xa19e('0x20')]=qs[_0xa19e('0x20')](_0x180bf0['query'][_0xa19e('0x20')]);}_0x44e2b6['order']=qs[_0xa19e('0x3c')](_0x180bf0[_0xa19e('0x34')][_0xa19e('0x3c')]);_0x44e2b6[_0xa19e('0x3d')]=qs[_0xa19e('0x3e')](_[_0xa19e('0x3f')](_0x180bf0[_0xa19e('0x34')],_0x19e821[_0xa19e('0x3e')]),_0x378d9f);if(_0x180bf0[_0xa19e('0x34')][_0xa19e('0x40')]){_0x44e2b6['where']=_[_0xa19e('0x41')](_0x44e2b6[_0xa19e('0x3d')],{'$or':_[_0xa19e('0x33')](_0x378d9f,function(_0x2e3252){if(_0x2e3252[_0xa19e('0x32')]!=='VIRTUAL'){var _0x30c644={};_0x30c644[_0x2e3252['name']]={'$like':'%'+_0x180bf0[_0xa19e('0x34')][_0xa19e('0x40')]+'%'};return _0x30c644;}})});}_0x44e2b6=_[_0xa19e('0x41')]({},_0x44e2b6,_0x180bf0['options']);var _0x46d644={'where':_0x44e2b6[_0xa19e('0x3d')]};return db[_0xa19e('0x2f')][_0xa19e('0x23')](_0x46d644)[_0xa19e('0x28')](function(_0x24f6b3){_0x44e04d[_0xa19e('0x23')]=_0x24f6b3;if(_0x180bf0['query'][_0xa19e('0x42')]){_0x44e2b6[_0xa19e('0x43')]=[{'all':!![]}];}return db[_0xa19e('0x2f')]['findAll'](_0x44e2b6);})[_0xa19e('0x28')](function(_0x335c56){_0x44e04d[_0xa19e('0x44')]=_0x335c56;return _0x44e04d;})[_0xa19e('0x28')](respondWithFilteredResult(_0x18b2a4,_0x44e2b6))['catch'](handleError(_0x18b2a4,null));};exports['show']=function(_0x3632b8,_0x21abbc){var _0x575885={'raw':![],'where':{'id':_0x3632b8[_0xa19e('0x45')]['id']}},_0x21485f={};_0x21485f[_0xa19e('0x36')]=_['keys'](db['UserProfile']['rawAttributes']);_0x21485f[_0xa19e('0x34')]=_[_0xa19e('0x35')](_0x3632b8[_0xa19e('0x34')]);_0x21485f['filters']=_[_0xa19e('0x38')](_0x21485f['model'],_0x21485f[_0xa19e('0x34')]);_0x575885['attributes']=_[_0xa19e('0x38')](_0x21485f[_0xa19e('0x36')],qs[_0xa19e('0x39')](_0x3632b8[_0xa19e('0x34')][_0xa19e('0x39')]));_0x575885[_0xa19e('0x37')]=_0x575885[_0xa19e('0x37')][_0xa19e('0x3a')]?_0x575885['attributes']:_0x21485f['model'];if(_0x3632b8[_0xa19e('0x34')][_0xa19e('0x42')]){_0x575885[_0xa19e('0x43')]=[{'all':!![]}];}_0x575885=_[_0xa19e('0x41')]({},_0x575885,_0x3632b8[_0xa19e('0x46')]);return db[_0xa19e('0x2f')][_0xa19e('0x47')](_0x575885)[_0xa19e('0x28')](handleEntityNotFound(_0x21abbc,null))['then'](respondWithResult(_0x21abbc,null))[_0xa19e('0x48')](handleError(_0x21abbc,null));};exports[_0xa19e('0x49')]=function(_0x547f46,_0x4fcbc5){return db[_0xa19e('0x2f')][_0xa19e('0x49')](_0x547f46['body'],{})[_0xa19e('0x28')](respondWithResult(_0x4fcbc5,0xc9))[_0xa19e('0x48')](handleError(_0x4fcbc5,null));};exports[_0xa19e('0x4a')]=function(_0x5233ff,_0x5d6183){var _0x487f48={'where':{'id':_0x5233ff['params']['id']}},_0x1e79c0={};_0x1e79c0[_0xa19e('0x36')]=_[_0xa19e('0x35')](db['UserProfile'][_0xa19e('0x30')]);_0x487f48[_0xa19e('0x37')]=_[_0xa19e('0x38')](_0x1e79c0['model'],qs[_0xa19e('0x39')](_0x5233ff[_0xa19e('0x34')][_0xa19e('0x39')]));_0x487f48[_0xa19e('0x37')]=_0x487f48['attributes'][_0xa19e('0x3a')]?_0x487f48[_0xa19e('0x37')]:_0x1e79c0[_0xa19e('0x36')];if(_0x5233ff['query'][_0xa19e('0x42')]){_0x487f48[_0xa19e('0x43')]=[{'all':!![]}];}_0x487f48=_[_0xa19e('0x41')]({},_0x487f48,_0x5233ff[_0xa19e('0x46')]);return db[_0xa19e('0x2f')][_0xa19e('0x47')](_0x487f48)[_0xa19e('0x28')](handleEntityNotFound(_0x5d6183,null))['then'](function(_0xc4888e){if(_0xc4888e){var _0x2cf02d=_0xc4888e[_0xa19e('0x4b')]({'plain':!![]});_0x2cf02d=qs[_0xa19e('0x4c')](_0x2cf02d,['id',_0xa19e('0x4d'),'updatedAt',_0xa19e('0x4e')]);_0x5233ff[_0xa19e('0x4f')]=_[_0xa19e('0x4c')](_0x5233ff['body'],['id','createdAt',_0xa19e('0x50')]);return db['sequelize']['transaction'](function(_0x24518c){return db['UserProfile'][_0xa19e('0x49')](_['merge'](_0x2cf02d,_0x5233ff['body']),{'include':_0x5233ff[_0xa19e('0x34')][_0xa19e('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x24518c})['then'](function(_0x4637f7){var _0x22c4b5=_0x4637f7[_0xa19e('0x4b')]({'plain':!![]});return db[_0xa19e('0x51')][_0xa19e('0x52')]({'where':{'userProfileId':_0x5233ff['params']['id']},'raw':!![]})['then'](function(_0x57cba8){if(_0x57cba8){return BPromise['each'](_0x57cba8,function(_0x4b3653){return new BPromise(function(_0x357bc6,_0x33f49c){if(_0x4b3653[_0xa19e('0x53')]===null||_0x4b3653[_0xa19e('0x53')]===0x1)_0x357bc6(null);return db[_0xa19e('0x54')][_0xa19e('0x52')]({'where':{'sectionId':_0x4b3653['id']},'raw':!![]})['then'](function(_0x43768d){var _0x4310a8=_['map'](_0x43768d,function(_0x5ab8d7){return qs[_0xa19e('0x4c')](_0x5ab8d7,['id',_0xa19e('0x4d'),'updatedAt',_0xa19e('0x55')]);});_0x357bc6(_0x4310a8);})['catch'](function(_0x44d560){_0x33f49c(_0x44d560);});})[_0xa19e('0x28')](function(_0x4eb528){var _0x39152e=qs[_0xa19e('0x4c')](_0x4b3653,['id',_0xa19e('0x4d'),'updatedAt']);_0x39152e[_0xa19e('0x56')]=_0x22c4b5['id'];if(_0x4eb528)_0x39152e['Resources']=_0x4eb528;return _0x39152e;})[_0xa19e('0x28')](function(_0x3eafa4){return db[_0xa19e('0x51')][_0xa19e('0x49')](_0x3eafa4,{'include':[{'model':db[_0xa19e('0x54')],'as':'Resources'}],'raw':!![],'transaction':_0x24518c});});})[_0xa19e('0x28')](function(){return _0x22c4b5;});}});});});}})[_0xa19e('0x28')](respondWithResult(_0x5d6183,0xc9))['catch'](handleError(_0x5d6183,null));};exports['update']=function(_0xadf51b,_0x28713f){if(_0xadf51b[_0xa19e('0x4f')]['id']){delete _0xadf51b[_0xa19e('0x4f')]['id'];}return db[_0xa19e('0x2f')][_0xa19e('0x47')]({'where':{'id':_0xadf51b['params']['id']}})['then'](handleEntityNotFound(_0x28713f,null))[_0xa19e('0x28')](saveUpdates(_0xadf51b[_0xa19e('0x4f')],null))[_0xa19e('0x28')](respondWithResult(_0x28713f,null))[_0xa19e('0x48')](handleError(_0x28713f,null));};exports['destroy']=function(_0x587870,_0x136806){return db['UserProfile'][_0xa19e('0x47')]({'where':{'id':_0x587870[_0xa19e('0x45')]['id']}})[_0xa19e('0x28')](handleEntityNotFound(_0x136806,null))[_0xa19e('0x28')](removeEntity(_0x136806,null))['catch'](handleError(_0x136806,null));};exports[_0xa19e('0x57')]=function(_0x1c801e,_0x103fe8){return db[_0xa19e('0x2f')]['describe']()[_0xa19e('0x28')](respondWithResult(_0x103fe8,null))[_0xa19e('0x48')](handleError(_0x103fe8,null));};exports[_0xa19e('0x58')]=function(_0x3758e9,_0x4a5a56){var _0x135393=_0x3758e9[_0xa19e('0x4f')];return db['UserProfile']['find']({'where':{'id':_0x3758e9[_0xa19e('0x45')]['id']}})['then'](handleEntityNotFound(_0x4a5a56,null))[_0xa19e('0x28')](function(_0x1e8d14){if(_0x1e8d14){return db[_0xa19e('0x59')][_0xa19e('0x5a')](function(_0x4e5d69){return db[_0xa19e('0x51')][_0xa19e('0x29')]({'where':{'userProfileId':_0x3758e9['params']['id'],'sectionId':_['map'](_0x135393,function(_0x45242a){return _0x45242a[_0xa19e('0x55')];})},'transaction':_0x4e5d69})[_0xa19e('0x28')](function(){var _0x259d13=_['map'](_0x135393,function(_0x2e2658){_0x2e2658[_0xa19e('0x56')]=_0x3758e9[_0xa19e('0x45')]['id'];return _0x2e2658;});var _0x21f66b=[];return BPromise[_0xa19e('0x5b')](_0x259d13,function(_0x22e567){return db[_0xa19e('0x51')]['create'](_0x22e567,{'include':[{'model':db[_0xa19e('0x54')],'as':_0xa19e('0x5c')}],'raw':!![],'transaction':_0x4e5d69})[_0xa19e('0x28')](function(_0x41f178){_0x21f66b['push'](_0x41f178[_0xa19e('0x4b')]({'plain':!![]}));});})[_0xa19e('0x28')](function(){return _0x21f66b;});});});}})[_0xa19e('0x28')](function(_0x2c2a2c){return _0x2c2a2c;})[_0xa19e('0x28')](respondWithResult(_0x4a5a56,null))['catch'](handleError(_0x4a5a56,null));};exports[_0xa19e('0x5d')]=function(_0x1eeb8c,_0x5241dc){var _0x250ba4;return db[_0xa19e('0x2f')][_0xa19e('0x47')]({'where':{'id':_0x1eeb8c[_0xa19e('0x45')]['id']},'attributes':['id',_0xa19e('0x2c')]})[_0xa19e('0x28')](handleEntityNotFound(_0x5241dc,null))[_0xa19e('0x28')](function(_0x43654c){if(_0x43654c){_0x250ba4=_0x43654c;return db[_0xa19e('0x51')][_0xa19e('0x29')]({'where':{'userProfileId':_0x1eeb8c['params']['id'],'sectionId':_0x1eeb8c[_0xa19e('0x34')][_0xa19e('0x5e')]}});}})[_0xa19e('0x28')](function(){return _0x250ba4;})[_0xa19e('0x28')](respondWithStatusCode(_0x5241dc,null))[_0xa19e('0x48')](handleError(_0x5241dc,null));};exports[_0xa19e('0x5f')]=function(_0x2fb1f5,_0x50f9f2){var _0x251a93=[];var _0x538c3f=[];return db[_0xa19e('0x51')][_0xa19e('0x52')]({'where':{'userProfileId':_0x2fb1f5[_0xa19e('0x45')]['id']},'raw':!![]})[_0xa19e('0x28')](function(_0x5b6fe5){_0x251a93=_['filter'](_0x5b6fe5,function(_0x3d9120){return _0x3d9120[_0xa19e('0x60')]===0x1||_[_0xa19e('0x61')]([0x3eb,0x709],_0x3d9120[_0xa19e('0x55')]);});if(!_['isEmpty'](_0x251a93)){return _['map'](_0x251a93,function(_0x17d26f){return _0x17d26f[_0xa19e('0x55')];});}else{return;}})[_0xa19e('0x28')](function(_0x3651d8){if(_0x3651d8)_0x538c3f=_0x3651d8;if(_[_0xa19e('0x61')](_0x538c3f,0x64)){var _0x3327aa=_[_0xa19e('0x47')](_0x251a93,{'sectionId':0x64});return hasDefaultDashboard(_0x3327aa)[_0xa19e('0x28')](function(_0x735fd){return _[_0xa19e('0x33')](_0x251a93,function(_0x377fc0){if(_0x377fc0['sectionId']===0x64){_0x377fc0[_0xa19e('0x62')]=_0x735fd;}return _0x377fc0;});});}else{return;}})['then'](function(_0x4abe83){if(_0x4abe83)_0x251a93=_0x4abe83;if(_[_0xa19e('0x61')](_0x538c3f,0x3eb)){var _0x20d87c=_[_0xa19e('0x47')](_0x251a93,{'sectionId':0x3eb});return getCustomDashboards(_0x20d87c)[_0xa19e('0x28')](function(_0x1030e0){return _[_0xa19e('0x33')](_0x251a93,function(_0xe2c69d){if(_0x20d87c[_0xa19e('0x60')]){if(_0xe2c69d['sectionId']===0x3eb){_0xe2c69d['subsections']=_0x1030e0;}}else{if(_0xe2c69d[_0xa19e('0x55')]===0x64){if(!_0xe2c69d[_0xa19e('0x62')]){_0xe2c69d[_0xa19e('0x62')]=[];}_0xe2c69d['subsections']=_0xe2c69d[_0xa19e('0x62')][_0xa19e('0x63')](_0x1030e0);}}return _0xe2c69d;});});}else{return;}})[_0xa19e('0x28')](function(_0x2635d9){if(_0x2635d9)_0x251a93=_0x2635d9;if(_['includes'](_0x538c3f,0x709)){var _0x16a605=_[_0xa19e('0x47')](_0x251a93,{'sectionId':0x709});return getPlugins(_0x16a605)['then'](function(_0x134aa3){if(_0x16a605[_0xa19e('0x60')]){return _[_0xa19e('0x33')](_0x251a93,function(_0x7abc78){if(_0x7abc78[_0xa19e('0x55')]===0x709){_0x7abc78[_0xa19e('0x62')]=_0x134aa3;}return _0x7abc78;});}else{var _0x1ee687={'sectionId':0x76c,'enabled':0x1,'subsections':_0x134aa3};var _0xf52156=_[_0xa19e('0x33')](_0x251a93);_0xf52156[_0xa19e('0x64')](_0x1ee687);return _0xf52156;}});}else{return;}})[_0xa19e('0x28')](function(_0x5e0cd0){if(_0x5e0cd0)_0x251a93=_0x5e0cd0;return _['filter'](_0x251a93,[_0xa19e('0x60'),0x1]);})['then'](respondWithResult(_0x50f9f2,null))[_0xa19e('0x48')](handleError(_0x50f9f2,null));};function hasDefaultDashboard(_0x48eb7c){var _0x3c2c01=[0x65];return new BPromise(function(_0x183461,_0x585e38){try{if(_0x48eb7c[_0xa19e('0x53')]){_0x183461(_0x3c2c01);}else{return db[_0xa19e('0x54')]['findOne']({'where':{'sectionId':_0x48eb7c['id']},'raw':!![]})[_0xa19e('0x28')](function(_0x5ed62b){_0x5ed62b?_0x183461(_0x3c2c01):_0x183461();});}}catch(_0x3be595){_0x585e38(_0x3be595);}});}function getCustomDashboards(_0x210308){var _0x2b1247=[];return new BPromise(function(_0x338174,_0x2daa30){try{if(_0x210308[_0xa19e('0x53')]){return db[_0xa19e('0x65')][_0xa19e('0x52')]({'raw':!![]})['then'](function(_0x34245b){_0x34245b[_0xa19e('0x66')](function(_0x384322){_0x2b1247[_0xa19e('0x64')](_0x384322['id']+0x1869f);});_0x338174(_0x2b1247);});}else{return db[_0xa19e('0x54')][_0xa19e('0x52')]({'where':{'sectionId':_0x210308['id']},'raw':!![]})[_0xa19e('0x28')](function(_0x45dd86){_0x45dd86[_0xa19e('0x66')](function(_0x4970f7){_0x2b1247['push'](_0x4970f7['resourceId']+0x1869f);});_0x338174(_0x2b1247);});}}catch(_0x364f39){_0x2daa30(_0x364f39);}});}function getPlugins(_0x18d26c){var _0xea74fe=[];return new BPromise(function(_0x565607,_0x3a2f4c){try{if(_0x18d26c[_0xa19e('0x53')]){return db[_0xa19e('0x67')]['findAll']({'raw':!![]})[_0xa19e('0x28')](function(_0x3f8dc0){_0x3f8dc0[_0xa19e('0x66')](function(_0x252a4c){_0xea74fe[_0xa19e('0x64')](_0x252a4c['id']+0x15b38);});_0x565607(_0xea74fe);});}else{return db[_0xa19e('0x54')][_0xa19e('0x52')]({'where':{'sectionId':_0x18d26c['id']},'raw':!![]})[_0xa19e('0x28')](function(_0x27d8c3){_0x27d8c3[_0xa19e('0x66')](function(_0x4b45f3){_0xea74fe['push'](_0x4b45f3['resourceId']+0x15b38);});_0x565607(_0xea74fe);});}}catch(_0x23662f){_0x3a2f4c(_0x23662f);}});}exports[_0xa19e('0x68')]=function(_0x47d48b,_0x133021){return db[_0xa19e('0x2f')][_0xa19e('0x47')]({'where':{'id':_0x47d48b[_0xa19e('0x45')]['id']}})[_0xa19e('0x28')](handleEntityNotFound(_0x133021,null))[_0xa19e('0x28')](function(_0xb2b4ea){if(_0xb2b4ea){return db[_0xa19e('0x59')][_0xa19e('0x5a')](function(_0x2e2dd8){return db[_0xa19e('0x51')]['findAll']({'where':{'userProfileId':_0x47d48b[_0xa19e('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xa19e('0x28')](function(_0x374648){if(_0x374648){return db[_0xa19e('0x51')][_0xa19e('0x29')]({'where':{'userProfileId':_0x47d48b[_0xa19e('0x45')]['id'],'id':_[_0xa19e('0x33')](_0x374648,function(_0x53ee43){return _0x53ee43['id'];})},'transaction':_0x2e2dd8});}})[_0xa19e('0x28')](function(_0x308702){var _0x55d2b0=_[_0xa19e('0x33')](_0x47d48b[_0xa19e('0x4f')],function(_0x3e788c){_0x3e788c[_0xa19e('0x56')]=_0x47d48b['params']['id'];return _0x3e788c;});return db[_0xa19e('0x51')]['bulkCreate'](_0x55d2b0,{'raw':!![],'transaction':_0x2e2dd8});})['then'](function(_0x55b508){var _0x43010d=_[_0xa19e('0x40')](_['map'](_0x55b508,function(_0x70b22a){return _0x70b22a[_0xa19e('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x43010d){return db[_0xa19e('0x51')][_0xa19e('0x52')]({'where':{'userProfileId':_0x47d48b[_0xa19e('0x45')]['id'],'sectionId':_[_0xa19e('0x33')](_0x43010d,function(_0x4975b7){return _0x4975b7[_0xa19e('0x55')];})},'attributes':['id',_0xa19e('0x55')],'raw':!![]})[_0xa19e('0x28')](function(_0x3cd509){var _0x484283=_[_0xa19e('0x33')](_0x47d48b[_0xa19e('0x4f')],function(_0x480dac){_0x480dac[_0xa19e('0x56')]=_0x47d48b[_0xa19e('0x45')]['id'];return _0x480dac;});return db[_0xa19e('0x54')]['bulkCreate'](_0x484283,{'raw':!![],'transaction':_0x2e2dd8});});}})[_0xa19e('0x48')](handleError(_0x133021,null));});}})[_0xa19e('0x28')](function(_0x3bd1e5){var _0xc40604=_[_0xa19e('0x33')](_0x3bd1e5,function(_0x3cc6c3){return _0x3cc6c3[_0xa19e('0x4b')]({'plain':!![]});});})[_0xa19e('0x28')](respondWithResult(_0x133021,null))['catch'](handleError(_0x133021,null));};exports[_0xa19e('0x69')]=function(_0x59e0f9,_0x2c7106,_0xed8b24){return db[_0xa19e('0x2f')][_0xa19e('0x47')]({'where':{'id':_0x59e0f9[_0xa19e('0x45')]['id']}})[_0xa19e('0x28')](handleEntityNotFound(_0x2c7106,null))[_0xa19e('0x28')](function(_0x3f7611){if(_0x3f7611){return _0x3f7611['removeResources'](_0x59e0f9[_0xa19e('0x34')][_0xa19e('0x5e')]);}})[_0xa19e('0x28')](respondWithStatusCode(_0x2c7106,null))['catch'](handleError(_0x2c7106,null));};exports[_0xa19e('0x6a')]=function(_0x6de35d,_0x3a9fdf){var _0x4f5d54={};if(!_0x6de35d[_0xa19e('0x34')][_0xa19e('0x6b')])throw new Error(_0xa19e('0x6c'));if(!_0x6de35d[_0xa19e('0x34')][_0xa19e('0x6d')](_0xa19e('0x3b'))){_0x4f5d54[_0xa19e('0x22')]=qs['limit'](_0x6de35d['query'][_0xa19e('0x22')]);_0x4f5d54[_0xa19e('0x20')]=qs[_0xa19e('0x20')](_0x6de35d[_0xa19e('0x34')][_0xa19e('0x20')]);}return db['UserProfile']['find']({'where':{'id':_0x6de35d[_0xa19e('0x45')]['id']}})[_0xa19e('0x28')](function(_0x693a37){if(!_0x693a37)throw new Error(_0xa19e('0x6e')+_0x6de35d['params']['id']);return db[_0xa19e('0x2f')][_0xa19e('0x6a')](_0x6de35d);})[_0xa19e('0x28')](respondWithFilteredResult(_0x3a9fdf,_0x4f5d54))[_0xa19e('0x48')](handleError(_0x3a9fdf,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8cafde4..f8c1d91 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 _0x7e27=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x7e27,0xdd));var _0x77e2=function(_0x26bcff,_0x1bf100){_0x26bcff=_0x26bcff-0x0;var _0xb14b0d=_0x7e27[_0x26bcff];return _0xb14b0d;};'use strict';var EventEmitter=require(_0x77e2('0x0'));var UserProfile=require(_0x77e2('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x77e2('0x2')](0x0);var events={'afterCreate':_0x77e2('0x3'),'afterUpdate':_0x77e2('0x4'),'afterDestroy':_0x77e2('0x5')};function emitEvent(_0x49537e){return function(_0x30766a,_0x21bb94,_0x20c6f0){UserProfileEvents['emit'](_0x49537e+':'+_0x30766a['id'],_0x30766a);UserProfileEvents[_0x77e2('0x6')](_0x49537e,_0x30766a);_0x20c6f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x77e2('0x7')](e,emitEvent(event));}}module[_0x77e2('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xe785=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe785,0x128));var _0x5e78=function(_0x4a439a,_0x5a0f41){_0x4a439a=_0x4a439a-0x0;var _0x1477f0=_0xe785[_0x4a439a];return _0x1477f0;};'use strict';var EventEmitter=require(_0x5e78('0x0'));var UserProfile=require(_0x5e78('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5e78('0x2')](0x0);var events={'afterCreate':_0x5e78('0x3'),'afterUpdate':_0x5e78('0x4'),'afterDestroy':_0x5e78('0x5')};function emitEvent(_0x4d8317){return function(_0x4c0243,_0x55fadd,_0x4565a4){UserProfileEvents[_0x5e78('0x6')](_0x4d8317+':'+_0x4c0243['id'],_0x4c0243);UserProfileEvents[_0x5e78('0x6')](_0x4d8317,_0x4c0243);_0x4565a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x5e78('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 006c38c..cb4e0d8 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 _0xdd29=['smsqueues','SmsQueue','WhatsappQueue','whatsappaccounts','teams','Team','telephones','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','ui.createdAt','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','all','ignore','union','autoAssociation','rawAttributes','model','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','sort','filters','pick','merge','VIRTUAL','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','color','tag','true','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','squel','exports','filter','value','findAll','then','associatedResources','map','catch','field','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxaccounts','internalroutes','VoiceExtension','contexts','VoiceMail','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue'];(function(_0x182973,_0xb2ac57){var _0x25b239=function(_0x286c5a){while(--_0x286c5a){_0x182973['push'](_0x182973['shift']());}};_0x25b239(++_0xb2ac57);}(_0xdd29,0x12b));var _0x9dd2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd29[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9dd2('0x0'));var attributes=require(_0x9dd2('0x1'));var squel=require(_0x9dd2('0x2'));module[_0x9dd2('0x3')]=function(_0x55ccff){var _0x302da0=_0x55ccff['models'];function _0xc5489f(_0x3a1325,_0x43b6ca){return new Promise(function(_0x2b14db,_0x35ff60){if(!_0x43b6ca)return _0x2b14db(null);var _0x5b0926=_0x43b6ca[_0x9dd2('0x4')]?{[_0x43b6ca['filter']['field']]:_0x43b6ca[_0x9dd2('0x4')][_0x9dd2('0x5')]}:undefined;return _0x302da0[_0x3a1325][_0x9dd2('0x6')]({'where':_0x5b0926,'raw':!![]})[_0x9dd2('0x7')](function(_0xee1864){_0x43b6ca[_0x9dd2('0x8')]=_[_0x9dd2('0x9')](_0xee1864,'id');_0x2b14db(_0x43b6ca);})[_0x9dd2('0xa')](function(_0xdfd652){_0x35ff60(_0xdfd652);});});}function _0x2ec53c(_0xcf0fd5,_0x3c1337){return new Promise(function(_0x45bc12,_0x520556){var _0x4b8cf0=_0xcf0fd5[_0x9dd2('0x4')]?{[_0xcf0fd5[_0x9dd2('0x4')][_0x9dd2('0xb')]]:_0xcf0fd5['filter']['value']}:undefined;return _0x302da0[_0xcf0fd5['model']][_0x9dd2('0x6')]({'where':_0x4b8cf0,'raw':!![]})[_0x9dd2('0x7')](function(_0x231bf0){_0x3c1337[_0x9dd2('0x8')]=_[_0x9dd2('0x9')](_0x231bf0,function(_0x529d6f){return _0x529d6f['name'];});_0x45bc12(_0x3c1337);})[_0x9dd2('0xa')](function(_0x33047f){_0x520556(_0x33047f);});});}function _0x2f18d3(_0x354b5d,_0xc97fc4,_0x4dfc33){if(!_0xc97fc4)return Promise['resolve'](null);return new Promise(function(_0xeeb5eb,_0x407205){return _0x302da0[_0x9dd2('0xc')][_0x9dd2('0x6')]({'where':{'sectionId':_0xc97fc4['id']},'raw':!![]})[_0x9dd2('0x7')](function(_0x218f93){if(_0x354b5d['field']&&_0x354b5d[_0x9dd2('0xb')]!=='id'){_0xc97fc4[_0x9dd2('0x8')]=_[_0x9dd2('0x9')](_0x218f93,function(_0x2524a0){return _0x2524a0[_0x354b5d['field']];});}else{if(_0x4dfc33===_0x9dd2('0xd')){_0xc97fc4[_0x9dd2('0x8')]=_['map'](_0x218f93,function(_0x4d1188){return{'id':_0x4d1188[_0x9dd2('0xe')],'type':_0x4d1188[_0x9dd2('0xf')]};});}else{_0xc97fc4[_0x9dd2('0x8')]=_[_0x9dd2('0x9')](_0x218f93,function(_0x393f0b){return _0x393f0b[_0x9dd2('0xe')];});}}_0xeeb5eb(_0xc97fc4);})[_0x9dd2('0xa')](function(_0x4ec127){_0x407205(_0x4ec127);});});}function _0xef1e8(_0x46aba8,_0x3cb56f){var _0x5216c6={'parentSections':[]};switch(_0x46aba8[_0x9dd2('0x10')]()){case'squareprojects':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x12');break;case _0x9dd2('0x13'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x14');break;case'squarerecordings':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x15');_0x5216c6[_0x9dd2('0x16')]=[{'name':_0x9dd2('0x17'),'field':_0x9dd2('0x18'),'foreignKey':_0x9dd2('0x19')}];break;case _0x9dd2('0x1a'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x1b');break;case _0x9dd2('0x1c'):_0x5216c6['childModel']=_0x9dd2('0x1d');_0x5216c6[_0x9dd2('0x16')]=[{'name':_0x9dd2('0x1e'),'field':'id','foreignKey':_0x9dd2('0x1f')}];break;case _0x9dd2('0x20'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x21');break;case _0x9dd2('0x22'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x23');break;case _0x9dd2('0x24'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x25');break;case _0x9dd2('0x26'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x27');break;case'chatwebsites':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x28');break;case'faxqueues':_0x5216c6[_0x9dd2('0x11')]='FaxQueue';break;case _0x9dd2('0x29'):_0x5216c6[_0x9dd2('0x11')]='FaxAccount';break;case'inboundroutes':case _0x9dd2('0x2a'):case'outboundroutes':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x2b');break;case _0x9dd2('0x2c'):_0x5216c6[_0x9dd2('0x11')]='VoiceContext';break;case'voicemails':_0x5216c6['childModel']=_0x9dd2('0x2d');break;case'voicerecordings':_0x5216c6['childModel']=_0x9dd2('0x2e');_0x5216c6['parentSections']=[{'name':_0x9dd2('0x2f'),'field':_0x9dd2('0x18'),'foreignKey':_0x9dd2('0x30'),'model':_0x9dd2('0x31'),'filter':{'field':_0x9dd2('0x32'),'value':[_0x9dd2('0x33')]}},{'name':_0x9dd2('0x34'),'field':_0x9dd2('0x18'),'foreignKey':_0x9dd2('0x30'),'model':_0x9dd2('0x31'),'filter':{'field':'role','value':[_0x9dd2('0x35')]}},{'name':_0x9dd2('0x36'),'field':_0x9dd2('0x18'),'foreignKey':_0x9dd2('0x37'),'model':_0x9dd2('0x38'),'filter':{'field':_0x9dd2('0xf'),'value':[_0x9dd2('0x39')]}},{'name':_0x9dd2('0x3a'),'field':_0x9dd2('0x18'),'foreignKey':_0x9dd2('0x37'),'model':'VoiceQueue','filter':{'field':_0x9dd2('0xf'),'value':[_0x9dd2('0x3b')]}}];break;case _0x9dd2('0x3c'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x3d');break;case'chanspies':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x3e');break;case _0x9dd2('0x3f'):_0x5216c6['childModel']=_0x9dd2('0x40');break;case _0x9dd2('0x41'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x42');break;case _0x9dd2('0x43'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x44');break;case _0x9dd2('0x45'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x46');break;case _0x9dd2('0x47'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x48');break;case _0x9dd2('0x49'):_0x5216c6['childModel']=_0x9dd2('0x4a');break;case'openchannelaccounts':_0x5216c6['childModel']='OpenchannelAccount';break;case _0x9dd2('0x4b'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x4c');break;case'smsaccounts':_0x5216c6['childModel']='SmsAccount';break;case'whatsappqueues':_0x5216c6['childModel']=_0x9dd2('0x4d');break;case _0x9dd2('0x4e'):_0x5216c6[_0x9dd2('0x11')]='WhatsappAccount';break;case _0x9dd2('0x4f'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x50');break;case'voicequeues':case'queuecampaigns':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x38');if(_0x3cb56f){_0x5216c6[_0x9dd2('0x16')]=[{'name':_0x9dd2('0x36')},{'name':_0x9dd2('0x3a')}];}break;case'users':case'agents':case _0x9dd2('0x51'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x31');if(_0x3cb56f){_0x5216c6[_0x9dd2('0x16')]=[{'name':'Users','filter':{'field':_0x9dd2('0x32'),'value':[_0x9dd2('0x52'),'user']},'ignore':!![]},{'name':_0x9dd2('0x2f')},{'name':_0x9dd2('0x34')}];}break;case _0x9dd2('0x53'):_0x5216c6['childModel']=_0x9dd2('0x54');break;case _0x9dd2('0x55'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x56');break;case _0x9dd2('0x57'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x58');break;case'sugarcrmaccounts':_0x5216c6['childModel']=_0x9dd2('0x59');break;case _0x9dd2('0x5a'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x5b');break;case _0x9dd2('0x5c'):_0x5216c6['childModel']=_0x9dd2('0x5d');break;case _0x9dd2('0x5e'):_0x5216c6['childModel']='User';break;case _0x9dd2('0x5f'):_0x5216c6['childModel']='CannedAnswer';break;case _0x9dd2('0x60'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x61');break;case'customdashboards':_0x5216c6['childModel']=_0x9dd2('0x62');break;case _0x9dd2('0x63'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x64');break;case'pauses':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x65');break;case _0x9dd2('0x66'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x67');break;case _0x9dd2('0x68'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x69');break;case _0x9dd2('0x6a'):_0x5216c6['childModel']=_0x9dd2('0x6b');break;case _0x9dd2('0x6c'):_0x5216c6[_0x9dd2('0x11')]='Template';break;case _0x9dd2('0x6d'):_0x5216c6['childModel']=_0x9dd2('0x6e');break;case _0x9dd2('0x6f'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x70');break;case _0x9dd2('0x71'):_0x5216c6['childModel']=_0x9dd2('0x72');break;case _0x9dd2('0x73'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x74');break;case _0x9dd2('0x75'):_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0xd');_0x5216c6[_0x9dd2('0x16')]=[{'name':'Reports','field':'id','foreignKey':_0x9dd2('0x76')}];break;case'metrics':_0x5216c6[_0x9dd2('0x11')]=_0x9dd2('0x77');break;}return _0x5216c6;}function _0x4daa69(_0x5e4051,_0x217bbc){var _0x4f317f=_0x5e4051[_0x9dd2('0x78')](0x0)[_0x9dd2('0x79')]()+_0x5e4051[_0x9dd2('0x7a')](0x1);var _0xdfa8a={'type':_0x302da0['Sequelize'][_0x9dd2('0x7b')][_0x9dd2('0x7c')],'raw':!![]};return new Promise(function(_0x5b3698,_0x5df63f){var _0x39ac8c=squel[_0x9dd2('0x7d')]()[_0x9dd2('0xb')](_0x9dd2('0x7e')+_0x4f317f+'InteractionId','id')['field'](_0x9dd2('0x7f'))['from']('user_has_'+_0x5e4051+_0x9dd2('0x80'),'ui')[_0x9dd2('0x81')](_0x9dd2('0x82'),_0x217bbc['id']);return _0x302da0[_0x9dd2('0x83')]['query'](_0x39ac8c[_0x9dd2('0x84')](),_0xdfa8a)[_0x9dd2('0x7')](function(_0x47fa88){_0x217bbc[_0x4f317f+_0x9dd2('0x85')]=_0x47fa88;_0x5b3698(_0x47fa88);})[_0x9dd2('0xa')](function(_0x24db3e){_0x5df63f(_0x24db3e);});});}return _0x55ccff[_0x9dd2('0x86')](_0x9dd2('0x87'),attributes,{'tableName':_0x9dd2('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x19769a){var _0x66e1c8=require(_0x9dd2('0x89'));var _0x4d4c0c={'raw':_0x19769a['query'][_0x9dd2('0x8a')],'where':{}};var _0x30d25e={};var _0x4e268d={'count':0x0,'rows':[]};var _0x2422e1=_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0x8c')];var _0x118c10=_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0x8d')]||![];var _0xb2e0fc=_0xef1e8(_0x2422e1,_0x118c10);if(!_0xb2e0fc['childModel'])throw new Error(_0x9dd2('0x8e')+_0x2422e1+'\x27');var _0x30cf7d=[{'name':_0x2422e1}];if(!_[_0x9dd2('0x8f')](_0xb2e0fc[_0x9dd2('0x16')]))_0x30cf7d=_0xb2e0fc[_0x9dd2('0x16')];var _0x432c2f=[];for(var _0x5d8b1a=0x0;_0x5d8b1a<_0x30cf7d[_0x9dd2('0x90')];_0x5d8b1a++){_0x432c2f[_0x9dd2('0x91')](_0x302da0[_0x9dd2('0x92')][_0x9dd2('0x93')]({'where':{'userProfileId':_0x19769a['params']['id'],'name':_0x30cf7d[_0x5d8b1a][_0x9dd2('0x18')]},'raw':!![]}));}return Promise[_0x9dd2('0x94')](_0x432c2f)[_0x9dd2('0x7')](function(_0x227b49){var _0x477ff2=_[_0x9dd2('0x4')](_0x227b49,function(_0x763b4e){return _0x763b4e?_0x763b4e:undefined;});var _0x5f1ae5=_[_0x9dd2('0x4')](_0x30cf7d,[_0x9dd2('0x95'),!![]]);var _0x29acc0=_[_0x9dd2('0x8f')](_0x477ff2)&&_[_0x9dd2('0x8f')](_0x5f1ae5)?null:_[_0x9dd2('0x96')](_0x5f1ae5,_0x477ff2);if(!_0x29acc0)return null;var _0x567b5e=[];for(var _0xe3e025=0x0;_0xe3e025<_0x29acc0['length'];_0xe3e025++){var _0x54d463=_[_0x9dd2('0x93')](_0x30cf7d,function(_0x24477e){return _0x29acc0[_0xe3e025]?_0x24477e[_0x9dd2('0x18')]===_0x29acc0[_0xe3e025][_0x9dd2('0x18')]:null;});if(_0x54d463){if(_0x29acc0[_0xe3e025][_0x9dd2('0x95')]){_0x567b5e[_0x9dd2('0x91')](_0xc5489f(_0xb2e0fc[_0x9dd2('0x11')],_0x29acc0[_0xe3e025]));}else{if(!_0x29acc0[_0xe3e025][_0x9dd2('0x97')]){_0x567b5e[_0x9dd2('0x91')](_0x2f18d3(_0x54d463,_0x29acc0[_0xe3e025],_0xb2e0fc[_0x9dd2('0x11')]));}else{if(_0x54d463['model']){_0x567b5e[_0x9dd2('0x91')](_0x2ec53c(_0x54d463,_0x29acc0[_0xe3e025]));}}}}}return Promise[_0x9dd2('0x94')](_0x567b5e);})[_0x9dd2('0x7')](function(_0x3c0650){var _0x27f975=_0x3c0650;var _0x3d62c1=null;if(_0x27f975){_0x3d62c1=_0x27f975['length']===0x1?_0x27f975[0x0]:null;}if(!_0x3d62c1&&!_0x27f975)return _0x4e268d;var _0x322580=_0x302da0[_0xb2e0fc[_0x9dd2('0x11')]][_0x9dd2('0x98')];_0x30d25e[_0x9dd2('0x99')]=_['keys'](_0x322580);_0x30d25e[_0x9dd2('0x8b')]=_[_0x9dd2('0x9a')](_0x19769a[_0x9dd2('0x8b')]);_0x30d25e['filters']=_[_0x9dd2('0x9b')](_0x30d25e[_0x9dd2('0x99')],_0x30d25e[_0x9dd2('0x8b')]);_0x4d4c0c[_0x9dd2('0x9c')]=_[_0x9dd2('0x9b')](_0x30d25e[_0x9dd2('0x99')],_0x66e1c8[_0x9dd2('0x9d')](_0x19769a['query'][_0x9dd2('0x9d')]));_0x4d4c0c[_0x9dd2('0x9c')]=_0x4d4c0c[_0x9dd2('0x9c')][_0x9dd2('0x90')]?_0x4d4c0c[_0x9dd2('0x9c')]:_0x30d25e[_0x9dd2('0x99')];if(!_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0x9e')]('nolimit')){_0x4d4c0c[_0x9dd2('0x9f')]=_0x66e1c8[_0x9dd2('0x9f')](_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0x9f')]);_0x4d4c0c[_0x9dd2('0xa0')]=_0x66e1c8[_0x9dd2('0xa0')](_0x19769a[_0x9dd2('0x8b')]['offset']);}_0x4d4c0c['order']=_0x66e1c8[_0x9dd2('0xa1')](_0x19769a['query'][_0x9dd2('0xa1')]);_0x4d4c0c[_0x9dd2('0x81')]=_0x66e1c8[_0x9dd2('0xa2')](_[_0x9dd2('0xa3')](_0x19769a[_0x9dd2('0x8b')],_0x30d25e[_0x9dd2('0xa2')]));if(_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0x4')]){_0x4d4c0c[_0x9dd2('0x81')]=_[_0x9dd2('0xa4')](_0x4d4c0c[_0x9dd2('0x81')],{'$or':_['map'](_0x322580,function(_0x19d68b){if(_0x19d68b[_0x9dd2('0xf')]['key']!==_0x9dd2('0xa5')){var _0x3ac016={};_0x3ac016[_0x19d68b['field']]={'$like':'%'+_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0x4')]+'%'};return _0x3ac016;}})});}var _0x545d61=[];var _0xcea26b=null;var _0x45b4c7={};if(_0x3d62c1){_0xcea26b=_[_0x9dd2('0x93')](_0x30cf7d,['name',_0x3d62c1[_0x9dd2('0x18')]]);if(_0xcea26b[_0x9dd2('0xb')]){_0x45b4c7={};if(_0xb2e0fc[_0x9dd2('0x11')]===_0x9dd2('0xd')){_0x45b4c7[_0xcea26b[_0x9dd2('0xa6')]]=_[_0x9dd2('0x9')](_0x3d62c1[_0x9dd2('0x8')],'id');}else{_0x45b4c7[_0xcea26b['foreignKey']]=_0x3d62c1['associatedResources'];}_0x545d61[_0x9dd2('0x91')](_0x45b4c7);}else{_0x4d4c0c[_0x9dd2('0x81')]['id']=_0x3d62c1[_0x9dd2('0x8')];}}else{for(var _0x14c3b9=0x0;_0x14c3b9<_0x27f975[_0x9dd2('0x90')];_0x14c3b9++){_0xcea26b=_[_0x9dd2('0x93')](_0x30cf7d,['name',_0x27f975[_0x14c3b9][_0x9dd2('0x18')]]);if(_0xcea26b['field']){_0x45b4c7={};_0x45b4c7[_0xcea26b[_0x9dd2('0xa6')]]=_0x27f975[_0x14c3b9][_0x9dd2('0x8')];_0x545d61['push'](_0x45b4c7);}else{if(!_0x4d4c0c[_0x9dd2('0x81')]['id'])_0x4d4c0c[_0x9dd2('0x81')]['id']=[];_0x27f975[_0x14c3b9]['associatedResources'][_0x9dd2('0xa7')](function(_0x53b45a){_0x4d4c0c[_0x9dd2('0x81')]['id'][_0x9dd2('0x91')](_0x53b45a);});}}}if(!_[_0x9dd2('0x8f')](_0x545d61)){_0x4d4c0c['where']=_[_0x9dd2('0xa4')](_0x4d4c0c[_0x9dd2('0x81')],{'$and':{'$or':_0x545d61}});}_0x4d4c0c=_[_0x9dd2('0xa4')]({},_0x4d4c0c,_0x19769a[_0x9dd2('0xa8')]);if(_0x3d62c1&&!_0x3d62c1[_0x9dd2('0x97')]&&_0xb2e0fc[_0x9dd2('0x11')]==='AnalyticExtractedReport'){if(_0x19769a[_0x9dd2('0x8b')]['includeAll']){_0x4d4c0c[_0x9dd2('0xa9')]=[{'all':!![]}];}return _0x302da0[_0xb2e0fc[_0x9dd2('0x11')]]['findAll'](_0x4d4c0c)[_0x9dd2('0x7')](function(_0xa14d9c){var _0x5cc3f2=[];_0xa14d9c['forEach'](function(_0x12a8ea){var _0x294d7e;switch(_0x12a8ea[_0x9dd2('0xaa')]){case _0x9dd2('0xab'):_0x294d7e=_['find'](_0x3d62c1[_0x9dd2('0x8')],function(_0x2c8179){return _0x2c8179['id']===_0x12a8ea[_0x9dd2('0x76')]&&_0x2c8179['type']===_0x9dd2('0xac');});break;case _0x9dd2('0xad'):_0x294d7e=_[_0x9dd2('0x93')](_0x3d62c1[_0x9dd2('0x8')],function(_0x2cfcd7){return _0x2cfcd7['id']===_0x12a8ea[_0x9dd2('0x76')]&&_0x2cfcd7[_0x9dd2('0xf')]==='CustomReports';});break;}if(_0x294d7e)_0x5cc3f2['push'](_0x12a8ea);});_0x4e268d[_0x9dd2('0xae')]=_0x5cc3f2['length'];_0x4e268d[_0x9dd2('0xaf')]=_0x5cc3f2;return _0x4e268d;});}else{if(!_[_0x9dd2('0x8f')](_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0xb0')])){_0x4d4c0c[_0x9dd2('0x81')]['id']=_0x4d4c0c['where']['id']?_['intersection'](_0x4d4c0c[_0x9dd2('0x81')]['id'],_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0xb0')]):_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0xb0')];if(_0x19769a['query'][_0x9dd2('0xb1')]){_0x4d4c0c['order']=_0x19769a[_0x9dd2('0x8b')]['customSorting'];}}if(_0x19769a[_0x9dd2('0x8b')]['extraQueryConditions']){_0x4d4c0c[_0x9dd2('0x81')]=_[_0x9dd2('0xa4')](_0x4d4c0c['where'],{'$and':_0x19769a['query'][_0x9dd2('0xb2')]});}return _0x302da0[_0xb2e0fc[_0x9dd2('0x11')]]['count']({'where':_0x4d4c0c[_0x9dd2('0x81')]})[_0x9dd2('0x7')](function(_0x234f1b){_0x4e268d['count']=_0x234f1b;if(_0x19769a[_0x9dd2('0x8b')]['includeAll']){if(_0xb2e0fc[_0x9dd2('0x11')]===_0x9dd2('0x1d')){_0x4d4c0c[_0x9dd2('0xa9')]=[{'model':_0x302da0['Tag'],'as':'Tags','attributes':['id',_0x9dd2('0x18'),_0x9dd2('0xb3')],'required':_0x19769a['query'][_0x9dd2('0xb4')]?!![]:![]},{'model':_0x302da0[_0x9dd2('0x6b')],'as':'ThroughTags','attributes':['id','name',_0x9dd2('0xb3')],'through':_0x19769a['query']['tag']?{'attributes':[],'where':{'TagId':_0x19769a[_0x9dd2('0x8b')][_0x9dd2('0xb4')]||undefined}}:{},'required':_0x19769a[_0x9dd2('0x8b')]['tag']?!![]:![]}];}else{_0x4d4c0c[_0x9dd2('0xa9')]=[{'all':!![]}];}}return _0x302da0[_0xb2e0fc['childModel']][_0x9dd2('0x6')](_0x4d4c0c);})[_0x9dd2('0x7')](function(_0x5a7456){_0x4e268d['rows']=_0x5a7456;if(_0x2422e1===_0x9dd2('0x2f')&&_0x19769a[_0x9dd2('0x8b')]['openTabs']===_0x9dd2('0xb5')){var _0x1d56a5=[];for(var _0x4bab16=0x0;_0x4bab16<_0x4e268d['rows'][_0x9dd2('0x90')];_0x4bab16++){_0x1d56a5[_0x9dd2('0x91')](_0x4daa69('chat',_0x4e268d['rows'][_0x4bab16][_0x9dd2('0xb6')]));_0x1d56a5[_0x9dd2('0x91')](_0x4daa69(_0x9dd2('0xb7'),_0x4e268d['rows'][_0x4bab16][_0x9dd2('0xb6')]));_0x1d56a5[_0x9dd2('0x91')](_0x4daa69(_0x9dd2('0xb8'),_0x4e268d[_0x9dd2('0xaf')][_0x4bab16][_0x9dd2('0xb6')]));_0x1d56a5[_0x9dd2('0x91')](_0x4daa69(_0x9dd2('0xb9'),_0x4e268d[_0x9dd2('0xaf')][_0x4bab16][_0x9dd2('0xb6')]));_0x1d56a5['push'](_0x4daa69(_0x9dd2('0xba'),_0x4e268d['rows'][_0x4bab16][_0x9dd2('0xb6')]));_0x1d56a5[_0x9dd2('0x91')](_0x4daa69('whatsapp',_0x4e268d[_0x9dd2('0xaf')][_0x4bab16][_0x9dd2('0xb6')]));}return Promise['all'](_0x1d56a5)[_0x9dd2('0x7')](function(){return _0x4e268d;});}return _0x4e268d;});}});}}});}; \ No newline at end of file +var _0xaa99=['VoiceMail','voicerecordings','Agents','membername','role','agent','Telephones','User','telephone','queue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','VoiceQueue','VoiceQueues','users','agents','telephones','Users','user','salesforceaccounts','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','query','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','params','all','length','find','ignore','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','default','custom','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','true','dataValues','fax','mail','openchannel','lodash','squel','exports','models','filter','value','findAll','then','associatedResources','catch','field','model','map','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails'];(function(_0x37a79f,_0xfeb6b5){var _0x2714a7=function(_0x208ccd){while(--_0x208ccd){_0x37a79f['push'](_0x37a79f['shift']());}};_0x2714a7(++_0xfeb6b5);}(_0xaa99,0x151));var _0x9aa9=function(_0x53919e,_0x117ec1){_0x53919e=_0x53919e-0x0;var _0x499d55=_0xaa99[_0x53919e];return _0x499d55;};'use strict';var _=require(_0x9aa9('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0x9aa9('0x1'));module[_0x9aa9('0x2')]=function(_0x1b5f7e){var _0x18df8e=_0x1b5f7e[_0x9aa9('0x3')];function _0x164b61(_0x2f1e98,_0x50c97a){return new Promise(function(_0x40c47f,_0x182b2a){if(!_0x50c97a)return _0x40c47f(null);var _0x336122=_0x50c97a[_0x9aa9('0x4')]?{[_0x50c97a[_0x9aa9('0x4')]['field']]:_0x50c97a[_0x9aa9('0x4')][_0x9aa9('0x5')]}:undefined;return _0x18df8e[_0x2f1e98][_0x9aa9('0x6')]({'where':_0x336122,'raw':!![]})[_0x9aa9('0x7')](function(_0x364791){_0x50c97a[_0x9aa9('0x8')]=_['map'](_0x364791,'id');_0x40c47f(_0x50c97a);})[_0x9aa9('0x9')](function(_0x56ab39){_0x182b2a(_0x56ab39);});});}function _0x417669(_0x3387e8,_0x28982a){return new Promise(function(_0x47af4e,_0x18d6e0){var _0x282019=_0x3387e8[_0x9aa9('0x4')]?{[_0x3387e8[_0x9aa9('0x4')][_0x9aa9('0xa')]]:_0x3387e8[_0x9aa9('0x4')][_0x9aa9('0x5')]}:undefined;return _0x18df8e[_0x3387e8[_0x9aa9('0xb')]][_0x9aa9('0x6')]({'where':_0x282019,'raw':!![]})[_0x9aa9('0x7')](function(_0x5b3cc4){_0x28982a[_0x9aa9('0x8')]=_[_0x9aa9('0xc')](_0x5b3cc4,function(_0x145ed1){return _0x145ed1['name'];});_0x47af4e(_0x28982a);})[_0x9aa9('0x9')](function(_0x33482c){_0x18d6e0(_0x33482c);});});}function _0xc982de(_0x3f5b5d,_0x3f9a77,_0x9bb99e){if(!_0x3f9a77)return Promise['resolve'](null);return new Promise(function(_0x1327c1,_0x30b2d8){return _0x18df8e[_0x9aa9('0xd')][_0x9aa9('0x6')]({'where':{'sectionId':_0x3f9a77['id']},'raw':!![]})[_0x9aa9('0x7')](function(_0x23ff31){if(_0x3f5b5d[_0x9aa9('0xa')]&&_0x3f5b5d['field']!=='id'){_0x3f9a77['associatedResources']=_[_0x9aa9('0xc')](_0x23ff31,function(_0x370ed1){return _0x370ed1[_0x3f5b5d['field']];});}else{if(_0x9bb99e===_0x9aa9('0xe')){_0x3f9a77['associatedResources']=_[_0x9aa9('0xc')](_0x23ff31,function(_0x26e245){return{'id':_0x26e245[_0x9aa9('0xf')],'type':_0x26e245[_0x9aa9('0x10')]};});}else{_0x3f9a77[_0x9aa9('0x8')]=_[_0x9aa9('0xc')](_0x23ff31,function(_0x173443){return _0x173443['resourceId'];});}}_0x1327c1(_0x3f9a77);})[_0x9aa9('0x9')](function(_0x471653){_0x30b2d8(_0x471653);});});}function _0x4486f0(_0x31b636,_0x133feb){var _0xbf592a={'parentSections':[]};switch(_0x31b636[_0x9aa9('0x11')]()){case _0x9aa9('0x12'):_0xbf592a['childModel']='SquareProject';break;case _0x9aa9('0x13'):_0xbf592a[_0x9aa9('0x14')]='SquareOdbc';break;case _0x9aa9('0x15'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x16');_0xbf592a[_0x9aa9('0x17')]=[{'name':_0x9aa9('0x18'),'field':_0x9aa9('0x19'),'foreignKey':_0x9aa9('0x1a')}];break;case _0x9aa9('0x1b'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x1c');break;case'contacts':_0xbf592a[_0x9aa9('0x14')]='CmContact';_0xbf592a[_0x9aa9('0x17')]=[{'name':_0x9aa9('0x1d'),'field':'id','foreignKey':_0x9aa9('0x1e')}];break;case _0x9aa9('0x1f'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x20');break;case'companies':_0xbf592a[_0x9aa9('0x14')]='CmCompany';break;case _0x9aa9('0x21'):_0xbf592a['childModel']=_0x9aa9('0x22');break;case _0x9aa9('0x23'):_0xbf592a['childModel']='ChatQueue';break;case _0x9aa9('0x24'):_0xbf592a['childModel']=_0x9aa9('0x25');break;case _0x9aa9('0x26'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x27');break;case'faxaccounts':_0xbf592a[_0x9aa9('0x14')]='FaxAccount';break;case _0x9aa9('0x28'):case _0x9aa9('0x29'):case _0x9aa9('0x2a'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x2b');break;case _0x9aa9('0x2c'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x2d');break;case _0x9aa9('0x2e'):_0xbf592a['childModel']=_0x9aa9('0x2f');break;case _0x9aa9('0x30'):_0xbf592a[_0x9aa9('0x14')]='VoiceRecording';_0xbf592a['parentSections']=[{'name':_0x9aa9('0x31'),'field':_0x9aa9('0x19'),'foreignKey':_0x9aa9('0x32'),'model':'User','filter':{'field':_0x9aa9('0x33'),'value':[_0x9aa9('0x34')]}},{'name':_0x9aa9('0x35'),'field':_0x9aa9('0x19'),'foreignKey':_0x9aa9('0x32'),'model':_0x9aa9('0x36'),'filter':{'field':_0x9aa9('0x33'),'value':[_0x9aa9('0x37')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x9aa9('0x38'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0x9aa9('0x39'),'field':_0x9aa9('0x19'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x9aa9('0x10'),'value':[_0x9aa9('0x3a')]}}];break;case _0x9aa9('0x3b'):_0xbf592a['childModel']=_0x9aa9('0x3c');break;case _0x9aa9('0x3d'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x3e');break;case _0x9aa9('0x3f'):_0xbf592a[_0x9aa9('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0xbf592a[_0x9aa9('0x14')]='Campaign';break;case _0x9aa9('0x40'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x41');break;case _0x9aa9('0x42'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x43');break;case'mailsubstatuses':_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x44');break;case _0x9aa9('0x45'):_0xbf592a['childModel']=_0x9aa9('0x46');break;case _0x9aa9('0x47'):_0xbf592a[_0x9aa9('0x14')]='OpenchannelAccount';break;case _0x9aa9('0x48'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x49');break;case _0x9aa9('0x4a'):_0xbf592a[_0x9aa9('0x14')]='SmsAccount';break;case _0x9aa9('0x4b'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x4c');break;case _0x9aa9('0x4d'):_0xbf592a['childModel']=_0x9aa9('0x4e');break;case'teams':_0xbf592a['childModel']=_0x9aa9('0x4f');break;case _0x9aa9('0x50'):case _0x9aa9('0x51'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x52');if(_0x133feb){_0xbf592a['parentSections']=[{'name':_0x9aa9('0x53')},{'name':_0x9aa9('0x39')}];}break;case _0x9aa9('0x54'):case _0x9aa9('0x55'):case _0x9aa9('0x56'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x36');if(_0x133feb){_0xbf592a[_0x9aa9('0x17')]=[{'name':_0x9aa9('0x57'),'filter':{'field':'role','value':['admin',_0x9aa9('0x58')]},'ignore':!![]},{'name':_0x9aa9('0x31')},{'name':_0x9aa9('0x35')}];}break;case'zendeskaccounts':_0xbf592a[_0x9aa9('0x14')]='ZendeskAccount';break;case _0x9aa9('0x59'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x5a');break;case'freshdeskaccounts':_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x5b');break;case'sugarcrmaccounts':_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x5c');break;case _0x9aa9('0x5d'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x5e');break;case _0x9aa9('0x5f'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x60');break;case _0x9aa9('0x61'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x36');break;case _0x9aa9('0x62'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x63');break;case _0x9aa9('0x64'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x65');break;case _0x9aa9('0x66'):_0xbf592a['childModel']=_0x9aa9('0x67');break;case _0x9aa9('0x68'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x69');break;case'pauses':_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x6a');break;case _0x9aa9('0x6b'):_0xbf592a['childModel']=_0x9aa9('0x6c');break;case _0x9aa9('0x6d'):_0xbf592a[_0x9aa9('0x14')]='Sound';break;case _0x9aa9('0x6e'):_0xbf592a['childModel']=_0x9aa9('0x6f');break;case _0x9aa9('0x70'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x71');break;case _0x9aa9('0x72'):_0xbf592a['childModel']=_0x9aa9('0x73');break;case'trunks':_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x74');break;case _0x9aa9('0x75'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x76');break;case _0x9aa9('0x77'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x78');break;case _0x9aa9('0x79'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0xe');_0xbf592a['parentSections']=[{'name':_0x9aa9('0x7a'),'field':'id','foreignKey':_0x9aa9('0x7b')}];break;case _0x9aa9('0x7c'):_0xbf592a[_0x9aa9('0x14')]=_0x9aa9('0x7d');break;}return _0xbf592a;}function _0x1140af(_0x441f4b,_0x16fcb1){var _0x362e84=_0x441f4b[_0x9aa9('0x7e')](0x0)[_0x9aa9('0x7f')]()+_0x441f4b[_0x9aa9('0x80')](0x1);var _0x2dc838={'type':_0x18df8e[_0x9aa9('0x81')][_0x9aa9('0x82')][_0x9aa9('0x83')],'raw':!![]};return new Promise(function(_0x2b4b0d,_0x5c2c3d){var _0x183ea9=squel[_0x9aa9('0x84')]()[_0x9aa9('0xa')](_0x9aa9('0x85')+_0x362e84+_0x9aa9('0x86'),'id')['field'](_0x9aa9('0x87'))['from'](_0x9aa9('0x88')+_0x441f4b+_0x9aa9('0x89'),'ui')[_0x9aa9('0x8a')]('ui.UserId\x20=\x20?',_0x16fcb1['id']);return _0x18df8e['sequelize'][_0x9aa9('0x8b')](_0x183ea9['toString'](),_0x2dc838)[_0x9aa9('0x7')](function(_0xd97108){_0x16fcb1[_0x362e84+_0x9aa9('0x8c')]=_0xd97108;_0x2b4b0d(_0xd97108);})['catch'](function(_0x98dc7d){_0x5c2c3d(_0x98dc7d);});});}return _0x1b5f7e['define'](_0x9aa9('0x8d'),attributes,{'tableName':_0x9aa9('0x8e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1cb5ee){var _0x228023=require(_0x9aa9('0x8f'));var _0x1d07c3={'raw':_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0x90')],'where':{}};var _0x3218c4={};var _0x579785={'count':0x0,'rows':[]};var _0x29f5d5=_0x1cb5ee['query'][_0x9aa9('0x91')];var _0x3b9432=_0x1cb5ee[_0x9aa9('0x8b')]['mergeResources']||![];var _0x501057=_0x4486f0(_0x29f5d5,_0x3b9432);if(!_0x501057[_0x9aa9('0x14')])throw new Error(_0x9aa9('0x92')+_0x29f5d5+'\x27');var _0x4920f2=[{'name':_0x29f5d5}];if(!_[_0x9aa9('0x93')](_0x501057['parentSections']))_0x4920f2=_0x501057[_0x9aa9('0x17')];var _0xbf24d2=[];for(var _0x3f0377=0x0;_0x3f0377<_0x4920f2['length'];_0x3f0377++){_0xbf24d2[_0x9aa9('0x94')](_0x18df8e[_0x9aa9('0x95')]['find']({'where':{'userProfileId':_0x1cb5ee[_0x9aa9('0x96')]['id'],'name':_0x4920f2[_0x3f0377][_0x9aa9('0x19')]},'raw':!![]}));}return Promise[_0x9aa9('0x97')](_0xbf24d2)[_0x9aa9('0x7')](function(_0x3d601f){var _0x17d985=_[_0x9aa9('0x4')](_0x3d601f,function(_0x5d5dfc){return _0x5d5dfc?_0x5d5dfc:undefined;});var _0x27b061=_[_0x9aa9('0x4')](_0x4920f2,['ignore',!![]]);var _0x4e4304=_[_0x9aa9('0x93')](_0x17d985)&&_[_0x9aa9('0x93')](_0x27b061)?null:_['union'](_0x27b061,_0x17d985);if(!_0x4e4304)return null;var _0x14ddaa=[];for(var _0x5d3d7f=0x0;_0x5d3d7f<_0x4e4304[_0x9aa9('0x98')];_0x5d3d7f++){var _0x583f66=_[_0x9aa9('0x99')](_0x4920f2,function(_0x44d785){return _0x4e4304[_0x5d3d7f]?_0x44d785[_0x9aa9('0x19')]===_0x4e4304[_0x5d3d7f][_0x9aa9('0x19')]:null;});if(_0x583f66){if(_0x4e4304[_0x5d3d7f][_0x9aa9('0x9a')]){_0x14ddaa[_0x9aa9('0x94')](_0x164b61(_0x501057[_0x9aa9('0x14')],_0x4e4304[_0x5d3d7f]));}else{if(!_0x4e4304[_0x5d3d7f][_0x9aa9('0x9b')]){_0x14ddaa[_0x9aa9('0x94')](_0xc982de(_0x583f66,_0x4e4304[_0x5d3d7f],_0x501057['childModel']));}else{if(_0x583f66[_0x9aa9('0xb')]){_0x14ddaa[_0x9aa9('0x94')](_0x417669(_0x583f66,_0x4e4304[_0x5d3d7f]));}}}}}return Promise['all'](_0x14ddaa);})[_0x9aa9('0x7')](function(_0x4a14d0){var _0xcae951=_0x4a14d0;var _0x1621f7=null;if(_0xcae951){_0x1621f7=_0xcae951[_0x9aa9('0x98')]===0x1?_0xcae951[0x0]:null;}if(!_0x1621f7&&!_0xcae951)return _0x579785;var _0x1dbcdc=_0x18df8e[_0x501057[_0x9aa9('0x14')]]['rawAttributes'];_0x3218c4[_0x9aa9('0xb')]=_[_0x9aa9('0x9c')](_0x1dbcdc);_0x3218c4[_0x9aa9('0x8b')]=_[_0x9aa9('0x9c')](_0x1cb5ee[_0x9aa9('0x8b')]);_0x3218c4[_0x9aa9('0x9d')]=_[_0x9aa9('0x9e')](_0x3218c4[_0x9aa9('0xb')],_0x3218c4[_0x9aa9('0x8b')]);_0x1d07c3['attributes']=_[_0x9aa9('0x9e')](_0x3218c4[_0x9aa9('0xb')],_0x228023[_0x9aa9('0x9f')](_0x1cb5ee['query'][_0x9aa9('0x9f')]));_0x1d07c3[_0x9aa9('0xa0')]=_0x1d07c3['attributes']['length']?_0x1d07c3[_0x9aa9('0xa0')]:_0x3218c4[_0x9aa9('0xb')];if(!_0x1cb5ee['query'][_0x9aa9('0xa1')](_0x9aa9('0xa2'))){_0x1d07c3[_0x9aa9('0xa3')]=_0x228023[_0x9aa9('0xa3')](_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xa3')]);_0x1d07c3[_0x9aa9('0xa4')]=_0x228023[_0x9aa9('0xa4')](_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xa4')]);}_0x1d07c3[_0x9aa9('0xa5')]=_0x228023['sort'](_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xa6')]);_0x1d07c3['where']=_0x228023['filters'](_[_0x9aa9('0xa7')](_0x1cb5ee['query'],_0x3218c4[_0x9aa9('0x9d')]));if(_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0x4')]){_0x1d07c3['where']=_[_0x9aa9('0xa8')](_0x1d07c3[_0x9aa9('0x8a')],{'$or':_['map'](_0x1dbcdc,function(_0x3a7f32){if(_0x3a7f32['type'][_0x9aa9('0xa9')]!==_0x9aa9('0xaa')){var _0x3e2450={};_0x3e2450[_0x3a7f32['field']]={'$like':'%'+_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0x4')]+'%'};return _0x3e2450;}})});}var _0x362c97=[];var _0x44f475=null;var _0x313f05={};if(_0x1621f7){_0x44f475=_['find'](_0x4920f2,[_0x9aa9('0x19'),_0x1621f7['name']]);if(_0x44f475[_0x9aa9('0xa')]){_0x313f05={};if(_0x501057[_0x9aa9('0x14')]==='AnalyticExtractedReport'){_0x313f05[_0x44f475[_0x9aa9('0xab')]]=_[_0x9aa9('0xc')](_0x1621f7[_0x9aa9('0x8')],'id');}else{_0x313f05[_0x44f475['foreignKey']]=_0x1621f7[_0x9aa9('0x8')];}_0x362c97[_0x9aa9('0x94')](_0x313f05);}else{_0x1d07c3[_0x9aa9('0x8a')]['id']=_0x1621f7[_0x9aa9('0x8')];}}else{for(var _0x8a95e8=0x0;_0x8a95e8<_0xcae951[_0x9aa9('0x98')];_0x8a95e8++){_0x44f475=_['find'](_0x4920f2,[_0x9aa9('0x19'),_0xcae951[_0x8a95e8][_0x9aa9('0x19')]]);if(_0x44f475[_0x9aa9('0xa')]){_0x313f05={};_0x313f05[_0x44f475[_0x9aa9('0xab')]]=_0xcae951[_0x8a95e8][_0x9aa9('0x8')];_0x362c97[_0x9aa9('0x94')](_0x313f05);}else{if(!_0x1d07c3[_0x9aa9('0x8a')]['id'])_0x1d07c3[_0x9aa9('0x8a')]['id']=[];_0xcae951[_0x8a95e8][_0x9aa9('0x8')]['forEach'](function(_0x460dfe){_0x1d07c3[_0x9aa9('0x8a')]['id'][_0x9aa9('0x94')](_0x460dfe);});}}}if(!_[_0x9aa9('0x93')](_0x362c97)){_0x1d07c3[_0x9aa9('0x8a')]=_['merge'](_0x1d07c3['where'],{'$and':{'$or':_0x362c97}});}_0x1d07c3=_['merge']({},_0x1d07c3,_0x1cb5ee[_0x9aa9('0xac')]);if(_0x1621f7&&!_0x1621f7[_0x9aa9('0x9b')]&&_0x501057[_0x9aa9('0x14')]===_0x9aa9('0xe')){if(_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xad')]){_0x1d07c3[_0x9aa9('0xae')]=[{'all':!![]}];}return _0x18df8e[_0x501057[_0x9aa9('0x14')]][_0x9aa9('0x6')](_0x1d07c3)[_0x9aa9('0x7')](function(_0x12086e){var _0xac8a11=[];_0x12086e['forEach'](function(_0x368582){var _0x298e7e;switch(_0x368582['reportType']){case _0x9aa9('0xaf'):_0x298e7e=_[_0x9aa9('0x99')](_0x1621f7[_0x9aa9('0x8')],function(_0x49f489){return _0x49f489['id']===_0x368582[_0x9aa9('0x7b')]&&_0x49f489[_0x9aa9('0x10')]==='DefaultReports';});break;case _0x9aa9('0xb0'):_0x298e7e=_['find'](_0x1621f7[_0x9aa9('0x8')],function(_0x4c0667){return _0x4c0667['id']===_0x368582[_0x9aa9('0x7b')]&&_0x4c0667[_0x9aa9('0x10')]==='CustomReports';});break;}if(_0x298e7e)_0xac8a11[_0x9aa9('0x94')](_0x368582);});_0x579785[_0x9aa9('0xb1')]=_0xac8a11[_0x9aa9('0x98')];_0x579785[_0x9aa9('0xb2')]=_0xac8a11;return _0x579785;});}else{if(!_[_0x9aa9('0x93')](_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb3')])){_0x1d07c3['where']['id']=_0x1d07c3[_0x9aa9('0x8a')]['id']?_[_0x9aa9('0x9e')](_0x1d07c3[_0x9aa9('0x8a')]['id'],_0x1cb5ee[_0x9aa9('0x8b')]['ids']):_0x1cb5ee[_0x9aa9('0x8b')]['ids'];if(_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb4')]){_0x1d07c3['order']=_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb4')];}}if(_0x1cb5ee[_0x9aa9('0x8b')]['extraQueryConditions']){_0x1d07c3['where']=_[_0x9aa9('0xa8')](_0x1d07c3[_0x9aa9('0x8a')],{'$and':_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb5')]});}return _0x18df8e[_0x501057[_0x9aa9('0x14')]][_0x9aa9('0xb1')]({'where':_0x1d07c3[_0x9aa9('0x8a')]})[_0x9aa9('0x7')](function(_0x44400d){_0x579785['count']=_0x44400d;if(_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xad')]){if(_0x501057[_0x9aa9('0x14')]==='CmContact'){_0x1d07c3[_0x9aa9('0xae')]=[{'model':_0x18df8e[_0x9aa9('0x6f')],'as':_0x9aa9('0xb6'),'attributes':['id',_0x9aa9('0x19'),_0x9aa9('0xb7')],'required':_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb8')]?!![]:![]},{'model':_0x18df8e['Tag'],'as':_0x9aa9('0xb9'),'attributes':['id',_0x9aa9('0x19'),_0x9aa9('0xb7')],'through':_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb8')]?{'attributes':[],'where':{'TagId':_0x1cb5ee['query'][_0x9aa9('0xb8')]||undefined}}:{},'required':_0x1cb5ee[_0x9aa9('0x8b')][_0x9aa9('0xb8')]?!![]:![]}];}else{_0x1d07c3[_0x9aa9('0xae')]=[{'all':!![]}];}}return _0x18df8e[_0x501057[_0x9aa9('0x14')]]['findAll'](_0x1d07c3);})[_0x9aa9('0x7')](function(_0x4aedfc){_0x579785['rows']=_0x4aedfc;if(_0x29f5d5==='Agents'&&_0x1cb5ee['query'][_0x9aa9('0xba')]===_0x9aa9('0xbb')){var _0x2a643b=[];for(var _0x5ab123=0x0;_0x5ab123<_0x579785[_0x9aa9('0xb2')][_0x9aa9('0x98')];_0x5ab123++){_0x2a643b['push'](_0x1140af('chat',_0x579785['rows'][_0x5ab123][_0x9aa9('0xbc')]));_0x2a643b[_0x9aa9('0x94')](_0x1140af('sms',_0x579785[_0x9aa9('0xb2')][_0x5ab123][_0x9aa9('0xbc')]));_0x2a643b['push'](_0x1140af(_0x9aa9('0xbd'),_0x579785[_0x9aa9('0xb2')][_0x5ab123][_0x9aa9('0xbc')]));_0x2a643b[_0x9aa9('0x94')](_0x1140af(_0x9aa9('0xbe'),_0x579785[_0x9aa9('0xb2')][_0x5ab123][_0x9aa9('0xbc')]));_0x2a643b[_0x9aa9('0x94')](_0x1140af(_0x9aa9('0xbf'),_0x579785[_0x9aa9('0xb2')][_0x5ab123][_0x9aa9('0xbc')]));_0x2a643b[_0x9aa9('0x94')](_0x1140af('whatsapp',_0x579785[_0x9aa9('0xb2')][_0x5ab123][_0x9aa9('0xbc')]));}return Promise['all'](_0x2a643b)[_0x9aa9('0x7')](function(){return _0x579785;});}return _0x579785;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 879979e..331c7b7 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 _0xb5f3=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userProfile.socket','register','request','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x1934a0,_0xcdb917){var _0x2cdd1c=function(_0x3294e4){while(--_0x3294e4){_0x1934a0['push'](_0x1934a0['shift']());}};_0x2cdd1c(++_0xcdb917);}(_0xb5f3,0x137));var _0x3b5f=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xb5f3[_0x576e2b];return _0x46461a;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var moment=require(_0x3b5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b5f('0x3'));var fs=require('fs');var Redis=require(_0x3b5f('0x4'));var db=require(_0x3b5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b5f('0x6'));var config=require(_0x3b5f('0x7'));var jayson=require(_0x3b5f('0x8'));var client=jayson[_0x3b5f('0x9')]['http']({'port':0x232a});config[_0x3b5f('0xa')]=_[_0x3b5f('0xb')](config['redis'],{'host':_0x3b5f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b5f('0xa')]));require(_0x3b5f('0xd'))[_0x3b5f('0xe')](socket);function respondWithRpcPromise(_0xfa2a4d,_0x5f5a5f,_0x13be1a){return new BPromise(function(_0x3d33cb,_0x158ac9){return client[_0x3b5f('0xf')](_0xfa2a4d,_0x13be1a)[_0x3b5f('0x10')](function(_0x57267a){logger['info']('UserProfile,\x20%s,\x20%s',_0x5f5a5f,_0x3b5f('0x11'));logger[_0x3b5f('0x12')](_0x3b5f('0x13'),_0x5f5a5f,_0x3b5f('0x11'),JSON[_0x3b5f('0x14')](_0x57267a));if(_0x57267a[_0x3b5f('0x15')]){if(_0x57267a[_0x3b5f('0x15')][_0x3b5f('0x16')]===0x1f4){logger['error'](_0x3b5f('0x17'),_0x5f5a5f,_0x57267a[_0x3b5f('0x15')][_0x3b5f('0x18')]);return _0x158ac9(_0x57267a['error'][_0x3b5f('0x18')]);}logger['error'](_0x3b5f('0x17'),_0x5f5a5f,_0x57267a[_0x3b5f('0x15')]['message']);return _0x3d33cb(_0x57267a[_0x3b5f('0x15')][_0x3b5f('0x18')]);}else{logger[_0x3b5f('0x19')](_0x3b5f('0x17'),_0x5f5a5f,'request\x20sent');_0x3d33cb(_0x57267a[_0x3b5f('0x1a')]['message']);}})[_0x3b5f('0x1b')](function(_0x19d6fe){logger[_0x3b5f('0x15')]('UserProfile,\x20%s,\x20%s',_0x5f5a5f,_0x19d6fe);_0x158ac9(_0x19d6fe);});});} \ No newline at end of file +var _0x13c5=['request\x20sent','result','lodash','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x187b9f,_0x7f124f){var _0x3b98a6=function(_0x56a70b){while(--_0x56a70b){_0x187b9f['push'](_0x187b9f['shift']());}};_0x3b98a6(++_0x7f124f);}(_0x13c5,0x7a));var _0x513c=function(_0x5b8a54,_0x558166){_0x5b8a54=_0x5b8a54-0x0;var _0x3aed60=_0x13c5[_0x5b8a54];return _0x3aed60;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x513c('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x513c('0x2'));var jayson=require(_0x513c('0x3'));var client=jayson[_0x513c('0x4')][_0x513c('0x5')]({'port':0x232a});config['redis']=_['defaults'](config[_0x513c('0x6')],{'host':_0x513c('0x7'),'port':0x18eb});var socket=require(_0x513c('0x8'))(new Redis(config[_0x513c('0x6')]));require(_0x513c('0x9'))[_0x513c('0xa')](socket);function respondWithRpcPromise(_0x222c25,_0x18471d,_0x4adc04){return new BPromise(function(_0xd70448,_0x224eb2){return client['request'](_0x222c25,_0x4adc04)['then'](function(_0x798eed){logger[_0x513c('0xb')]('UserProfile,\x20%s,\x20%s',_0x18471d,'request\x20sent');logger['debug'](_0x513c('0xc'),_0x18471d,'request\x20sent',JSON[_0x513c('0xd')](_0x798eed));if(_0x798eed[_0x513c('0xe')]){if(_0x798eed['error'][_0x513c('0xf')]===0x1f4){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0x224eb2(_0x798eed['error'][_0x513c('0x11')]);}logger['error'](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0xd70448(_0x798eed[_0x513c('0xe')]['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x18471d,_0x513c('0x12'));_0xd70448(_0x798eed[_0x513c('0x13')]['message']);}})['catch'](function(_0x217e7a){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x217e7a);_0x224eb2(_0x217e7a);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d960442..ec77f12 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 _0x30f5=['save','remove','update','removeListener','register','userProfile:','./userProfile.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x30f5,0x1bf));var _0x530f=function(_0x3f560e,_0x289aa8){_0x3f560e=_0x3f560e-0x0;var _0x5bf213=_0x30f5[_0x3f560e];return _0x5bf213;};'use strict';var UserProfileEvents=require(_0x530f('0x0'));var events=[_0x530f('0x1'),_0x530f('0x2'),_0x530f('0x3')];function createListener(_0xf63afe,_0x41bab9){return function(_0x557ee2){_0x41bab9['emit'](_0xf63afe,_0x557ee2);};}function removeListener(_0x557d17,_0x117107){return function(){UserProfileEvents[_0x530f('0x4')](_0x557d17,_0x117107);};}exports[_0x530f('0x5')]=function(_0x18caf1){for(var _0x245169=0x0,_0x285a93=events['length'];_0x245169<_0x285a93;_0x245169++){var _0x5570a0=events[_0x245169];var _0x40a33a=createListener(_0x530f('0x6')+_0x5570a0,_0x18caf1);UserProfileEvents['on'](_0x5570a0,_0x40a33a);}}; \ No newline at end of file +var _0x06b9=['register','length','userProfile:','./userProfile.events','save','remove','removeListener'];(function(_0x23100d,_0xf8c4ba){var _0x2d7683=function(_0x17fd62){while(--_0x17fd62){_0x23100d['push'](_0x23100d['shift']());}};_0x2d7683(++_0xf8c4ba);}(_0x06b9,0xb2));var _0x906b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x06b9[_0x321bb2];return _0x9c12ed;};'use strict';var UserProfileEvents=require(_0x906b('0x0'));var events=[_0x906b('0x1'),_0x906b('0x2'),'update'];function createListener(_0x135ddb,_0x32f782){return function(_0x34bdbe){_0x32f782['emit'](_0x135ddb,_0x34bdbe);};}function removeListener(_0x18fcf1,_0x19cb69){return function(){UserProfileEvents[_0x906b('0x3')](_0x18fcf1,_0x19cb69);};}exports[_0x906b('0x4')]=function(_0xb4c7db){for(var _0x22599a=0x0,_0x2c7dee=events[_0x906b('0x5')];_0x22599a<_0x2c7dee;_0x22599a++){var _0x2d8de4=events[_0x22599a];var _0x575344=createListener(_0x906b('0x6')+_0x2d8de4,_0xb4c7db);UserProfileEvents['on'](_0x2d8de4,_0x575344);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c15ec4d..5d2952f 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 _0x53f0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3f553b,_0x49a9c2){var _0x183c4e=function(_0x873b22){while(--_0x873b22){_0x3f553b['push'](_0x3f553b['shift']());}};_0x183c4e(++_0x49a9c2);}(_0x53f0,0x14c));var _0x053f=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x53f0[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x053f('0x0'));var util=require(_0x053f('0x1'));var path=require(_0x053f('0x2'));var timeout=require(_0x053f('0x3'));var express=require(_0x053f('0x4'));var router=express[_0x053f('0x5')]();var fs_extra=require(_0x053f('0x6'));var auth=require(_0x053f('0x7'));var interaction=require(_0x053f('0x8'));var config=require(_0x053f('0x9'));var controller=require(_0x053f('0xa'));router[_0x053f('0xb')]('/',auth['isAuthenticated'](),controller[_0x053f('0xc')]);router[_0x053f('0xb')](_0x053f('0xd'),auth[_0x053f('0xe')](),controller[_0x053f('0xf')]);router[_0x053f('0xb')](_0x053f('0x10'),auth['isAuthenticated'](),controller[_0x053f('0x11')]);router[_0x053f('0x12')]('/',auth[_0x053f('0xe')](),controller[_0x053f('0x13')]);router[_0x053f('0x14')](_0x053f('0x10'),auth['isAuthenticated'](),controller[_0x053f('0x15')]);router['delete'](_0x053f('0x10'),auth[_0x053f('0xe')](),controller[_0x053f('0x16')]);module[_0x053f('0x17')]=router; \ No newline at end of file +var _0x8af1=['post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x4ff544,_0x1fbc52){var _0x3c4e6a=function(_0x117e31){while(--_0x117e31){_0x4ff544['push'](_0x4ff544['shift']());}};_0x3c4e6a(++_0x1fbc52);}(_0x8af1,0xee));var _0x18af=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x8af1[_0x43b584];return _0x48f27b;};'use strict';var multer=require(_0x18af('0x0'));var util=require(_0x18af('0x1'));var path=require(_0x18af('0x2'));var timeout=require(_0x18af('0x3'));var express=require(_0x18af('0x4'));var router=express[_0x18af('0x5')]();var fs_extra=require(_0x18af('0x6'));var auth=require(_0x18af('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x18af('0x8'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x18af('0x9')](),controller[_0x18af('0xa')]);router[_0x18af('0xb')](_0x18af('0xc'),auth[_0x18af('0x9')](),controller[_0x18af('0xd')]);router[_0x18af('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x18af('0xe')]('/',auth['isAuthenticated'](),controller[_0x18af('0xf')]);router[_0x18af('0x10')](_0x18af('0x11'),auth[_0x18af('0x9')](),controller['update']);router[_0x18af('0x12')](_0x18af('0x11'),auth['isAuthenticated'](),controller[_0x18af('0x13')]);module[_0x18af('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d1fb978..4574e87 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 _0xc5b5=['STRING','sequelize','INTEGER'];(function(_0x429be1,_0x1dc9e7){var _0x4f68f5=function(_0x2bac9e){while(--_0x2bac9e){_0x429be1['push'](_0x429be1['shift']());}};_0x4f68f5(++_0x1dc9e7);}(_0xc5b5,0x15d));var _0x5c5b=function(_0x24c135,_0xdb4450){_0x24c135=_0x24c135-0x0;var _0x290c66=_0xc5b5[_0x24c135];return _0x290c66;};'use strict';var Sequelize=require(_0x5c5b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5c5b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5c5b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdb82=['STRING','sequelize'];(function(_0x25f009,_0x303e74){var _0x3e9634=function(_0x4cbd22){while(--_0x4cbd22){_0x25f009['push'](_0x25f009['shift']());}};_0x3e9634(++_0x303e74);}(_0xdb82,0x73));var _0x2db8=function(_0x297a71,_0x330736){_0x297a71=_0x297a71-0x0;var _0x471688=_0xdb82[_0x297a71];return _0x471688;};'use strict';var Sequelize=require(_0x2db8('0x0'));module['exports']={'name':{'type':Sequelize[_0x2db8('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2db8('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 dafe99b..4e7cd58 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 _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','UserProfileResource','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x497641,_0x5d4f64){var _0x3c355e=function(_0xb903f4){while(--_0xb903f4){_0x497641['push'](_0x497641['shift']());}};_0x3c355e(++_0x5d4f64);}(_0x4c60,0xc1));var _0x04c6=function(_0x4af4b3,_0x2512aa){_0x4af4b3=_0x4af4b3-0x0;var _0x3f6498=_0x4c60[_0x4af4b3];return _0x3f6498;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['UserProfileResource'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['UserProfileResource'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['UserProfileResource'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['UserProfileResource'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file +var _0x2a07=['index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a07,0x74));var _0x72a0=function(_0x5f0ecc,_0x36e3de){_0x5f0ecc=_0x5f0ecc-0x0;var _0x47b0ed=_0x2a07[_0x5f0ecc];return _0x47b0ed;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['UserProfileResource'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['UserProfileResource']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 257374f..8d58d30 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 _0x533d=['rimraf','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x504f15,_0x5f0050){var _0x35c9cc=function(_0x3173a5){while(--_0x3173a5){_0x504f15['push'](_0x504f15['shift']());}};_0x35c9cc(++_0x5f0050);}(_0x533d,0x80));var _0xd533=function(_0x5a1e13,_0xff2238){_0x5a1e13=_0x5a1e13-0x0;var _0x248220=_0x533d[_0x5a1e13];return _0x248220;};'use strict';var _=require(_0xd533('0x0'));var util=require(_0xd533('0x1'));var logger=require(_0xd533('0x2'))(_0xd533('0x3'));var moment=require(_0xd533('0x4'));var BPromise=require(_0xd533('0x5'));var rp=require(_0xd533('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd533('0x7'));var config=require('../../config/environment');var attributes=require(_0xd533('0x8'));module[_0xd533('0x9')]=function(_0x55e2f5,_0x55be6f){return _0x55e2f5[_0xd533('0xa')]('UserProfileResource',attributes,{'tableName':_0xd533('0xb'),'paranoid':![],'indexes':[{'name':_0xd533('0xc'),'fields':[_0xd533('0xd'),_0xd533('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf01b=['bluebird','request-promise','path','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','sectionId','../../config/logger','api','moment'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0xf01b,0x171));var _0xbf01=function(_0x168bf3,_0x1c06ef){_0x168bf3=_0x168bf3-0x0;var _0x207033=_0xf01b[_0x168bf3];return _0x207033;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf01('0x0'))(_0xbf01('0x1'));var moment=require(_0xbf01('0x2'));var BPromise=require(_0xbf01('0x3'));var rp=require(_0xbf01('0x4'));var fs=require('fs');var path=require(_0xbf01('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf01('0x6'));module[_0xbf01('0x7')]=function(_0x4e6ee7,_0x20d3e8){return _0x4e6ee7[_0xbf01('0x8')]('UserProfileResource',attributes,{'tableName':_0xbf01('0x9'),'paranoid':![],'indexes':[{'name':_0xbf01('0xa'),'fields':['resourceId',_0xbf01('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 61e4b83..4bcfb78 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 _0x9237=['client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x42db23,_0x498af6){var _0x3c8aab=function(_0x4a64ea){while(--_0x4a64ea){_0x42db23['push'](_0x42db23['shift']());}};_0x3c8aab(++_0x498af6);}(_0x9237,0x1b0));var _0x7923=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x9237[_0x2c9b79];return _0x265032;};'use strict';var _=require(_0x7923('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7923('0x1'));var rs=require(_0x7923('0x2'));var fs=require('fs');var Redis=require(_0x7923('0x3'));var db=require(_0x7923('0x4'))['db'];var utils=require(_0x7923('0x5'));var logger=require('../../config/logger')(_0x7923('0x6'));var config=require(_0x7923('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7923('0x8')][_0x7923('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110cee,_0x1a014d,_0x1370ac){return new BPromise(function(_0x23bc6a,_0x227c47){return client[_0x7923('0xa')](_0x110cee,_0x1370ac)[_0x7923('0xb')](function(_0x43e53f){logger['info'](_0x7923('0xc'),_0x1a014d,_0x7923('0xd'));logger['debug'](_0x7923('0xe'),_0x1a014d,'request\x20sent',JSON['stringify'](_0x43e53f));if(_0x43e53f[_0x7923('0xf')]){if(_0x43e53f[_0x7923('0xf')][_0x7923('0x10')]===0x1f4){logger[_0x7923('0xf')](_0x7923('0xc'),_0x1a014d,_0x43e53f[_0x7923('0xf')][_0x7923('0x11')]);return _0x227c47(_0x43e53f[_0x7923('0xf')][_0x7923('0x11')]);}logger[_0x7923('0xf')](_0x7923('0xc'),_0x1a014d,_0x43e53f[_0x7923('0xf')][_0x7923('0x11')]);return _0x23bc6a(_0x43e53f[_0x7923('0xf')]['message']);}else{logger[_0x7923('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x1a014d,'request\x20sent');_0x23bc6a(_0x43e53f['result']['message']);}})[_0x7923('0x13')](function(_0x3fceaf){logger['error'](_0x7923('0xc'),_0x1a014d,_0x3fceaf);_0x227c47(_0x3fceaf);});});} \ No newline at end of file +var _0xe027=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x52433d,_0x1e0542){var _0x214402=function(_0x1948d4){while(--_0x1948d4){_0x52433d['push'](_0x52433d['shift']());}};_0x214402(++_0x1e0542);}(_0xe027,0x106));var _0x7e02=function(_0x1fb044,_0x14fbcd){_0x1fb044=_0x1fb044-0x0;var _0x215d9f=_0xe027[_0x1fb044];return _0x215d9f;};'use strict';var _=require(_0x7e02('0x0'));var util=require(_0x7e02('0x1'));var moment=require(_0x7e02('0x2'));var BPromise=require(_0x7e02('0x3'));var rs=require(_0x7e02('0x4'));var fs=require('fs');var Redis=require(_0x7e02('0x5'));var db=require(_0x7e02('0x6'))['db'];var utils=require(_0x7e02('0x7'));var logger=require(_0x7e02('0x8'))(_0x7e02('0x9'));var config=require(_0x7e02('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ebeca,_0x10ffc5,_0x53b91c){return new BPromise(function(_0x557349,_0x1533d0){return client['request'](_0x4ebeca,_0x53b91c)[_0x7e02('0xc')](function(_0x135555){logger[_0x7e02('0xd')](_0x7e02('0xe'),_0x10ffc5,_0x7e02('0xf'));logger[_0x7e02('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x10ffc5,_0x7e02('0xf'),JSON['stringify'](_0x135555));if(_0x135555[_0x7e02('0x11')]){if(_0x135555[_0x7e02('0x11')][_0x7e02('0x12')]===0x1f4){logger[_0x7e02('0x11')](_0x7e02('0xe'),_0x10ffc5,_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);return _0x1533d0(_0x135555['error'][_0x7e02('0x13')]);}logger['error'](_0x7e02('0xe'),_0x10ffc5,_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);return _0x557349(_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);}else{logger[_0x7e02('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x10ffc5,'request\x20sent');_0x557349(_0x135555['result'][_0x7e02('0x13')]);}})['catch'](function(_0xc9e71c){logger[_0x7e02('0x11')](_0x7e02('0xe'),_0x10ffc5,_0xc9e71c);_0x1533d0(_0xc9e71c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d483073..7b797f8 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 _0x90df=['describe','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x489618,_0x233987){var _0x3d34b8=function(_0xe4ffd0){while(--_0xe4ffd0){_0x489618['push'](_0x489618['shift']());}};_0x3d34b8(++_0x233987);}(_0x90df,0x106));var _0xf90d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90df[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf90d('0x0'));var util=require(_0xf90d('0x1'));var path=require(_0xf90d('0x2'));var timeout=require(_0xf90d('0x3'));var express=require('express');var router=express[_0xf90d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf90d('0x5'));var config=require(_0xf90d('0x6'));var controller=require('./userProfileSection.controller');router[_0xf90d('0x7')]('/',auth[_0xf90d('0x8')](),controller['index']);router[_0xf90d('0x7')](_0xf90d('0x9'),auth['isAuthenticated'](),controller[_0xf90d('0xa')]);router[_0xf90d('0x7')](_0xf90d('0xb'),auth['isAuthenticated'](),controller[_0xf90d('0xc')]);router['post']('/',auth[_0xf90d('0x8')](),controller[_0xf90d('0xd')]);router['put']('/:id',auth[_0xf90d('0x8')](),controller[_0xf90d('0xe')]);router[_0xf90d('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf90d('0x10')]=router; \ No newline at end of file +var _0x3e10=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','index','get','/describe','describe','/:id','isAuthenticated','post','create','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x85109b,_0x574528){var _0x503994=function(_0x24d0fa){while(--_0x24d0fa){_0x85109b['push'](_0x85109b['shift']());}};_0x503994(++_0x574528);}(_0x3e10,0x18d));var _0x03e1=function(_0x4add34,_0x4c0489){_0x4add34=_0x4add34-0x0;var _0x1200e4=_0x3e10[_0x4add34];return _0x1200e4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x03e1('0x0'));var timeout=require(_0x03e1('0x1'));var express=require(_0x03e1('0x2'));var router=express[_0x03e1('0x3')]();var fs_extra=require(_0x03e1('0x4'));var auth=require(_0x03e1('0x5'));var interaction=require(_0x03e1('0x6'));var config=require('../../config/environment');var controller=require(_0x03e1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x03e1('0x8')]);router[_0x03e1('0x9')](_0x03e1('0xa'),auth['isAuthenticated'](),controller[_0x03e1('0xb')]);router[_0x03e1('0x9')](_0x03e1('0xc'),auth[_0x03e1('0xd')](),controller['show']);router[_0x03e1('0xe')]('/',auth[_0x03e1('0xd')](),controller[_0x03e1('0xf')]);router['put'](_0x03e1('0xc'),auth['isAuthenticated'](),controller[_0x03e1('0x10')]);router[_0x03e1('0x11')](_0x03e1('0xc'),auth[_0x03e1('0xd')](),controller[_0x03e1('0x12')]);module[_0x03e1('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 6810be8..306aaa5 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 _0xbfcc=['split','sequelize','STRING','INTEGER','BOOLEAN','join','getDataValue'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xbfcc[_0x4d674b];return _0x535a1f;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xcbfc('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xcbfc('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x59b1de){this['setDataValue']('crudPermissions',_0x59b1de?_0x59b1de[_0xcbfc('0x4')](''):[]);},'get':function(){return this[_0xcbfc('0x5')]('crudPermissions')?this[_0xcbfc('0x5')]('crudPermissions')[_0xcbfc('0x6')](''):[];}}}; \ No newline at end of file +var _0x9ffd=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x6f5229,_0x1e9031){var _0x5d2f3d=function(_0x57a8c9){while(--_0x57a8c9){_0x6f5229['push'](_0x6f5229['shift']());}};_0x5d2f3d(++_0x1e9031);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x495629,_0x263b6a){_0x495629=_0x495629-0x0;var _0x4c116a=_0x9ffd[_0x495629];return _0x4c116a;};'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 c1780be..04b3151 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 _0x8df4=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','UserProfileSection','includeAll','include','rows','catch','show','params','rawAttributes','options','find','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0xdae520,_0x5cb070){var _0x21f40a=function(_0x153d31){while(--_0x153d31){_0xdae520['push'](_0xdae520['shift']());}};_0x21f40a(++_0x5cb070);}(_0x8df4,0x90));var _0x48df=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x8df4[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48df('0x0'));var zipdir=require(_0x48df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48df('0x2'));var moment=require(_0x48df('0x3'));var BPromise=require(_0x48df('0x4'));var Mustache=require(_0x48df('0x5'));var util=require(_0x48df('0x6'));var path=require(_0x48df('0x7'));var sox=require(_0x48df('0x8'));var csv=require(_0x48df('0x9'));var ejs=require(_0x48df('0xa'));var fs=require('fs');var fs_extra=require(_0x48df('0xb'));var _=require(_0x48df('0xc'));var squel=require('squel');var crypto=require(_0x48df('0xd'));var jsforce=require(_0x48df('0xe'));var deskjs=require(_0x48df('0xf'));var toCsv=require(_0x48df('0x9'));var querystring=require(_0x48df('0x10'));var Papa=require(_0x48df('0x11'));var Redis=require('ioredis');var authService=require(_0x48df('0x12'));var qs=require(_0x48df('0x13'));var as=require(_0x48df('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x48df('0x15'));var utils=require(_0x48df('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x48df('0x17'));var db=require(_0x48df('0x18'))['db'];function respondWithStatusCode(_0x4566c2,_0x593487){_0x593487=_0x593487||0xcc;return function(_0x10fc57){if(_0x10fc57){return _0x4566c2['sendStatus'](_0x593487);}return _0x4566c2[_0x48df('0x19')](_0x593487)[_0x48df('0x1a')]();};}function respondWithResult(_0x123672,_0x58c6a2){_0x58c6a2=_0x58c6a2||0xc8;return function(_0x499a3c){if(_0x499a3c){return _0x123672[_0x48df('0x19')](_0x58c6a2)[_0x48df('0x1b')](_0x499a3c);}};}function respondWithFilteredResult(_0x2f1979,_0x4e3941){return function(_0x4ddb6f){if(_0x4ddb6f){var _0x23124d=typeof _0x4e3941[_0x48df('0x1c')]===_0x48df('0x1d')&&typeof _0x4e3941[_0x48df('0x1e')]===_0x48df('0x1d');var _0x496efe=_0x4ddb6f[_0x48df('0x1f')];var _0x5e8582=_0x23124d?0x0:_0x4e3941[_0x48df('0x1c')];var _0x2e20a7=_0x23124d?_0x4ddb6f['count']:_0x4e3941['offset']+_0x4e3941['limit'];var _0x3d0554;if(_0x2e20a7>=_0x496efe){_0x2e20a7=_0x496efe;_0x3d0554=0xc8;}else{_0x3d0554=0xce;}_0x2f1979['status'](_0x3d0554);return _0x2f1979[_0x48df('0x20')](_0x48df('0x21'),_0x5e8582+'-'+_0x2e20a7+'/'+_0x496efe)[_0x48df('0x1b')](_0x4ddb6f);}return null;};}function patchUpdates(_0x4eec60){return function(_0x3f7c7c){try{jsonpatch[_0x48df('0x22')](_0x3f7c7c,_0x4eec60,!![]);}catch(_0x590eed){return BPromise[_0x48df('0x23')](_0x590eed);}return _0x3f7c7c['save']();};}function saveUpdates(_0x45b500,_0x4be1ac){return function(_0x288df8){if(_0x288df8){return _0x288df8[_0x48df('0x24')](_0x45b500)[_0x48df('0x25')](function(_0x27363a){return _0x27363a;});}return null;};}function removeEntity(_0x441bbb,_0x1a4423){return function(_0x2aed45){if(_0x2aed45){return _0x2aed45[_0x48df('0x26')]()[_0x48df('0x25')](function(){_0x441bbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x420197,_0x26a232){return function(_0x3f64fc){if(!_0x3f64fc){_0x420197['sendStatus'](0x194);}return _0x3f64fc;};}function handleError(_0x32a057,_0x46ae07){_0x46ae07=_0x46ae07||0x1f4;return function(_0x29851c){logger[_0x48df('0x27')](_0x29851c[_0x48df('0x28')]);if(_0x29851c[_0x48df('0x29')]){delete _0x29851c[_0x48df('0x29')];}_0x32a057[_0x48df('0x19')](_0x46ae07)[_0x48df('0x2a')](_0x29851c);};}exports['index']=function(_0xd1f83a,_0x2c942c){var _0x31342a={},_0x5919d0={},_0x1970aa={'count':0x0,'rows':[]};var _0x1688b7=_[_0x48df('0x2b')](db['UserProfileSection']['rawAttributes'],function(_0x50c0b4){return{'name':_0x50c0b4[_0x48df('0x2c')],'type':_0x50c0b4[_0x48df('0x2d')][_0x48df('0x2e')]};});_0x5919d0['model']=_[_0x48df('0x2b')](_0x1688b7,'name');_0x5919d0[_0x48df('0x2f')]=_[_0x48df('0x30')](_0xd1f83a['query']);_0x5919d0[_0x48df('0x31')]=_[_0x48df('0x32')](_0x5919d0[_0x48df('0x33')],_0x5919d0[_0x48df('0x2f')]);_0x31342a['attributes']=_['intersection'](_0x5919d0[_0x48df('0x33')],qs[_0x48df('0x34')](_0xd1f83a[_0x48df('0x2f')][_0x48df('0x34')]));_0x31342a[_0x48df('0x35')]=_0x31342a[_0x48df('0x35')][_0x48df('0x36')]?_0x31342a[_0x48df('0x35')]:_0x5919d0[_0x48df('0x33')];if(!_0xd1f83a[_0x48df('0x2f')][_0x48df('0x37')](_0x48df('0x38'))){_0x31342a[_0x48df('0x1e')]=qs[_0x48df('0x1e')](_0xd1f83a[_0x48df('0x2f')][_0x48df('0x1e')]);_0x31342a[_0x48df('0x1c')]=qs[_0x48df('0x1c')](_0xd1f83a[_0x48df('0x2f')][_0x48df('0x1c')]);}_0x31342a['order']=qs[_0x48df('0x39')](_0xd1f83a['query'][_0x48df('0x39')]);_0x31342a['where']=qs['filters'](_[_0x48df('0x3a')](_0xd1f83a[_0x48df('0x2f')],_0x5919d0['filters']),_0x1688b7);if(_0xd1f83a[_0x48df('0x2f')][_0x48df('0x3b')]){_0x31342a[_0x48df('0x3c')]=_[_0x48df('0x3d')](_0x31342a[_0x48df('0x3c')],{'$or':_[_0x48df('0x2b')](_0x1688b7,function(_0x3f5e56){if(_0x3f5e56[_0x48df('0x2d')]!==_0x48df('0x3e')){var _0x3c46a4={};_0x3c46a4[_0x3f5e56[_0x48df('0x29')]]={'$like':'%'+_0xd1f83a[_0x48df('0x2f')][_0x48df('0x3b')]+'%'};return _0x3c46a4;}})});}_0x31342a=_[_0x48df('0x3d')]({},_0x31342a,_0xd1f83a['options']);var _0x344714={'where':_0x31342a[_0x48df('0x3c')]};return db[_0x48df('0x3f')]['count'](_0x344714)[_0x48df('0x25')](function(_0x3fa592){_0x1970aa[_0x48df('0x1f')]=_0x3fa592;if(_0xd1f83a[_0x48df('0x2f')][_0x48df('0x40')]){_0x31342a[_0x48df('0x41')]=[{'all':!![]}];}return db[_0x48df('0x3f')]['findAll'](_0x31342a);})[_0x48df('0x25')](function(_0x22d7ae){_0x1970aa[_0x48df('0x42')]=_0x22d7ae;return _0x1970aa;})[_0x48df('0x25')](respondWithFilteredResult(_0x2c942c,_0x31342a))[_0x48df('0x43')](handleError(_0x2c942c,null));};exports[_0x48df('0x44')]=function(_0x4d6bc8,_0x3d287f){var _0x534c41={'raw':![],'where':{'id':_0x4d6bc8[_0x48df('0x45')]['id']}},_0x379e61={};_0x379e61[_0x48df('0x33')]=_[_0x48df('0x30')](db['UserProfileSection'][_0x48df('0x46')]);_0x379e61['query']=_['keys'](_0x4d6bc8[_0x48df('0x2f')]);_0x379e61[_0x48df('0x31')]=_[_0x48df('0x32')](_0x379e61[_0x48df('0x33')],_0x379e61[_0x48df('0x2f')]);_0x534c41[_0x48df('0x35')]=_['intersection'](_0x379e61[_0x48df('0x33')],qs['fields'](_0x4d6bc8[_0x48df('0x2f')][_0x48df('0x34')]));_0x534c41[_0x48df('0x35')]=_0x534c41['attributes'][_0x48df('0x36')]?_0x534c41[_0x48df('0x35')]:_0x379e61[_0x48df('0x33')];if(_0x4d6bc8[_0x48df('0x2f')]['includeAll']){_0x534c41[_0x48df('0x41')]=[{'all':!![]}];}_0x534c41=_[_0x48df('0x3d')]({},_0x534c41,_0x4d6bc8[_0x48df('0x47')]);return db[_0x48df('0x3f')][_0x48df('0x48')](_0x534c41)[_0x48df('0x25')](handleEntityNotFound(_0x3d287f,null))[_0x48df('0x25')](respondWithResult(_0x3d287f,null))[_0x48df('0x43')](handleError(_0x3d287f,null));};exports['create']=function(_0xa52bca,_0x483be4){return db['UserProfileSection']['create'](_0xa52bca['body'],{})[_0x48df('0x25')](respondWithResult(_0x483be4,0xc9))[_0x48df('0x43')](handleError(_0x483be4,null));};exports[_0x48df('0x24')]=function(_0x2f4d8d,_0x28fd17){if(_0x2f4d8d['body']['id']){delete _0x2f4d8d[_0x48df('0x49')]['id'];}return db['UserProfileSection'][_0x48df('0x48')]({'where':{'id':_0x2f4d8d['params']['id']}})[_0x48df('0x25')](handleEntityNotFound(_0x28fd17,null))[_0x48df('0x25')](saveUpdates(_0x2f4d8d[_0x48df('0x49')],null))[_0x48df('0x25')](respondWithResult(_0x28fd17,null))['catch'](handleError(_0x28fd17,null));};exports[_0x48df('0x26')]=function(_0x8a6b7,_0x1a4f36){return db[_0x48df('0x3f')][_0x48df('0x48')]({'where':{'id':_0x8a6b7['params']['id']}})[_0x48df('0x25')](handleEntityNotFound(_0x1a4f36,null))[_0x48df('0x25')](removeEntity(_0x1a4f36,null))['catch'](handleError(_0x1a4f36,null));};exports[_0x48df('0x4a')]=function(_0x24f082,_0x2dd22d){return db[_0x48df('0x3f')][_0x48df('0x4a')]()[_0x48df('0x25')](respondWithResult(_0x2dd22d,null))[_0x48df('0x43')](handleError(_0x2dd22d,null));}; \ No newline at end of file +var _0xbb9d=['catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','includeAll','include','UserProfileSection','findAll','rows'];(function(_0x445d20,_0x39643f){var _0x26e5f2=function(_0x1f1e53){while(--_0x1f1e53){_0x445d20['push'](_0x445d20['shift']());}};_0x26e5f2(++_0x39643f);}(_0xbb9d,0xea));var _0xdbb9=function(_0x4b3be7,_0x19d667){_0x4b3be7=_0x4b3be7-0x0;var _0x22de14=_0xbb9d[_0x4b3be7];return _0x22de14;};'use strict';var emlformat=require(_0xdbb9('0x0'));var rimraf=require(_0xdbb9('0x1'));var zipdir=require(_0xdbb9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbb9('0x3'));var moment=require(_0xdbb9('0x4'));var BPromise=require(_0xdbb9('0x5'));var Mustache=require(_0xdbb9('0x6'));var util=require('util');var path=require(_0xdbb9('0x7'));var sox=require(_0xdbb9('0x8'));var csv=require(_0xdbb9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbb9('0xa'));var _=require('lodash');var squel=require(_0xdbb9('0xb'));var crypto=require(_0xdbb9('0xc'));var jsforce=require(_0xdbb9('0xd'));var deskjs=require(_0xdbb9('0xe'));var toCsv=require(_0xdbb9('0x9'));var querystring=require(_0xdbb9('0xf'));var Papa=require(_0xdbb9('0x10'));var Redis=require(_0xdbb9('0x11'));var authService=require(_0xdbb9('0x12'));var qs=require(_0xdbb9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdbb9('0x14'));var utils=require('../../config/utils');var config=require(_0xdbb9('0x15'));var licenseUtil=require(_0xdbb9('0x16'));var db=require(_0xdbb9('0x17'))['db'];function respondWithStatusCode(_0x410b84,_0x3ba0c1){_0x3ba0c1=_0x3ba0c1||0xcc;return function(_0x1fa551){if(_0x1fa551){return _0x410b84[_0xdbb9('0x18')](_0x3ba0c1);}return _0x410b84['status'](_0x3ba0c1)[_0xdbb9('0x19')]();};}function respondWithResult(_0x1fee14,_0xe70a3a){_0xe70a3a=_0xe70a3a||0xc8;return function(_0x356bd8){if(_0x356bd8){return _0x1fee14[_0xdbb9('0x1a')](_0xe70a3a)[_0xdbb9('0x1b')](_0x356bd8);}};}function respondWithFilteredResult(_0x53e2bf,_0x38cfe2){return function(_0x1b2506){if(_0x1b2506){var _0x4f8cc1=typeof _0x38cfe2[_0xdbb9('0x1c')]===_0xdbb9('0x1d')&&typeof _0x38cfe2[_0xdbb9('0x1e')]===_0xdbb9('0x1d');var _0x513fb7=_0x1b2506[_0xdbb9('0x1f')];var _0xc5bc6e=_0x4f8cc1?0x0:_0x38cfe2[_0xdbb9('0x1c')];var _0x32d80a=_0x4f8cc1?_0x1b2506[_0xdbb9('0x1f')]:_0x38cfe2[_0xdbb9('0x1c')]+_0x38cfe2[_0xdbb9('0x1e')];var _0x500926;if(_0x32d80a>=_0x513fb7){_0x32d80a=_0x513fb7;_0x500926=0xc8;}else{_0x500926=0xce;}_0x53e2bf[_0xdbb9('0x1a')](_0x500926);return _0x53e2bf[_0xdbb9('0x20')](_0xdbb9('0x21'),_0xc5bc6e+'-'+_0x32d80a+'/'+_0x513fb7)[_0xdbb9('0x1b')](_0x1b2506);}return null;};}function patchUpdates(_0x49e567){return function(_0x187fde){try{jsonpatch[_0xdbb9('0x22')](_0x187fde,_0x49e567,!![]);}catch(_0x24b218){return BPromise[_0xdbb9('0x23')](_0x24b218);}return _0x187fde['save']();};}function saveUpdates(_0x280870,_0x47d451){return function(_0x22e6ca){if(_0x22e6ca){return _0x22e6ca[_0xdbb9('0x24')](_0x280870)[_0xdbb9('0x25')](function(_0x22a538){return _0x22a538;});}return null;};}function removeEntity(_0x1bf2ed,_0x5447b3){return function(_0x29dcc1){if(_0x29dcc1){return _0x29dcc1['destroy']()[_0xdbb9('0x25')](function(){_0x1bf2ed[_0xdbb9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x351447,_0x136cc3){return function(_0x116340){if(!_0x116340){_0x351447[_0xdbb9('0x18')](0x194);}return _0x116340;};}function handleError(_0x5729ba,_0x9ba4e9){_0x9ba4e9=_0x9ba4e9||0x1f4;return function(_0x38516d){logger['error'](_0x38516d[_0xdbb9('0x26')]);if(_0x38516d[_0xdbb9('0x27')]){delete _0x38516d['name'];}_0x5729ba[_0xdbb9('0x1a')](_0x9ba4e9)[_0xdbb9('0x28')](_0x38516d);};}exports[_0xdbb9('0x29')]=function(_0x215a88,_0x533257){var _0x14ad28={},_0x175aad={},_0x1b7fb2={'count':0x0,'rows':[]};var _0x2af7f1=_['map'](db['UserProfileSection'][_0xdbb9('0x2a')],function(_0x577a84){return{'name':_0x577a84[_0xdbb9('0x2b')],'type':_0x577a84[_0xdbb9('0x2c')][_0xdbb9('0x2d')]};});_0x175aad[_0xdbb9('0x2e')]=_[_0xdbb9('0x2f')](_0x2af7f1,_0xdbb9('0x27'));_0x175aad[_0xdbb9('0x30')]=_[_0xdbb9('0x31')](_0x215a88['query']);_0x175aad['filters']=_['intersection'](_0x175aad[_0xdbb9('0x2e')],_0x175aad[_0xdbb9('0x30')]);_0x14ad28['attributes']=_[_0xdbb9('0x32')](_0x175aad[_0xdbb9('0x2e')],qs[_0xdbb9('0x33')](_0x215a88[_0xdbb9('0x30')][_0xdbb9('0x33')]));_0x14ad28[_0xdbb9('0x34')]=_0x14ad28[_0xdbb9('0x34')][_0xdbb9('0x35')]?_0x14ad28[_0xdbb9('0x34')]:_0x175aad['model'];if(!_0x215a88[_0xdbb9('0x30')][_0xdbb9('0x36')](_0xdbb9('0x37'))){_0x14ad28['limit']=qs[_0xdbb9('0x1e')](_0x215a88[_0xdbb9('0x30')][_0xdbb9('0x1e')]);_0x14ad28[_0xdbb9('0x1c')]=qs['offset'](_0x215a88['query'][_0xdbb9('0x1c')]);}_0x14ad28['order']=qs[_0xdbb9('0x38')](_0x215a88['query'][_0xdbb9('0x38')]);_0x14ad28[_0xdbb9('0x39')]=qs[_0xdbb9('0x3a')](_['pick'](_0x215a88[_0xdbb9('0x30')],_0x175aad[_0xdbb9('0x3a')]),_0x2af7f1);if(_0x215a88[_0xdbb9('0x30')]['filter']){_0x14ad28['where']=_[_0xdbb9('0x3b')](_0x14ad28['where'],{'$or':_[_0xdbb9('0x2f')](_0x2af7f1,function(_0x41548a){if(_0x41548a[_0xdbb9('0x2c')]!=='VIRTUAL'){var _0x53c475={};_0x53c475[_0x41548a[_0xdbb9('0x27')]]={'$like':'%'+_0x215a88[_0xdbb9('0x30')][_0xdbb9('0x3c')]+'%'};return _0x53c475;}})});}_0x14ad28=_['merge']({},_0x14ad28,_0x215a88['options']);var _0x3cccee={'where':_0x14ad28[_0xdbb9('0x39')]};return db['UserProfileSection'][_0xdbb9('0x1f')](_0x3cccee)[_0xdbb9('0x25')](function(_0x2ce6dd){_0x1b7fb2[_0xdbb9('0x1f')]=_0x2ce6dd;if(_0x215a88['query'][_0xdbb9('0x3d')]){_0x14ad28[_0xdbb9('0x3e')]=[{'all':!![]}];}return db[_0xdbb9('0x3f')][_0xdbb9('0x40')](_0x14ad28);})['then'](function(_0x1d3224){_0x1b7fb2[_0xdbb9('0x41')]=_0x1d3224;return _0x1b7fb2;})[_0xdbb9('0x25')](respondWithFilteredResult(_0x533257,_0x14ad28))[_0xdbb9('0x42')](handleError(_0x533257,null));};exports[_0xdbb9('0x43')]=function(_0x531306,_0x485438){var _0x3bd88={'raw':![],'where':{'id':_0x531306[_0xdbb9('0x44')]['id']}},_0x4e6ef6={};_0x4e6ef6[_0xdbb9('0x2e')]=_['keys'](db[_0xdbb9('0x3f')][_0xdbb9('0x2a')]);_0x4e6ef6[_0xdbb9('0x30')]=_[_0xdbb9('0x31')](_0x531306[_0xdbb9('0x30')]);_0x4e6ef6['filters']=_[_0xdbb9('0x32')](_0x4e6ef6[_0xdbb9('0x2e')],_0x4e6ef6[_0xdbb9('0x30')]);_0x3bd88['attributes']=_[_0xdbb9('0x32')](_0x4e6ef6[_0xdbb9('0x2e')],qs['fields'](_0x531306[_0xdbb9('0x30')][_0xdbb9('0x33')]));_0x3bd88[_0xdbb9('0x34')]=_0x3bd88[_0xdbb9('0x34')]['length']?_0x3bd88[_0xdbb9('0x34')]:_0x4e6ef6[_0xdbb9('0x2e')];if(_0x531306[_0xdbb9('0x30')][_0xdbb9('0x3d')]){_0x3bd88[_0xdbb9('0x3e')]=[{'all':!![]}];}_0x3bd88=_['merge']({},_0x3bd88,_0x531306[_0xdbb9('0x45')]);return db[_0xdbb9('0x3f')][_0xdbb9('0x46')](_0x3bd88)[_0xdbb9('0x25')](handleEntityNotFound(_0x485438,null))[_0xdbb9('0x25')](respondWithResult(_0x485438,null))[_0xdbb9('0x42')](handleError(_0x485438,null));};exports[_0xdbb9('0x47')]=function(_0x1dd5c9,_0x98be39){return db[_0xdbb9('0x3f')]['create'](_0x1dd5c9[_0xdbb9('0x48')],{})[_0xdbb9('0x25')](respondWithResult(_0x98be39,0xc9))[_0xdbb9('0x42')](handleError(_0x98be39,null));};exports[_0xdbb9('0x24')]=function(_0x5e9443,_0x590822){if(_0x5e9443[_0xdbb9('0x48')]['id']){delete _0x5e9443['body']['id'];}return db[_0xdbb9('0x3f')]['find']({'where':{'id':_0x5e9443[_0xdbb9('0x44')]['id']}})[_0xdbb9('0x25')](handleEntityNotFound(_0x590822,null))[_0xdbb9('0x25')](saveUpdates(_0x5e9443[_0xdbb9('0x48')],null))[_0xdbb9('0x25')](respondWithResult(_0x590822,null))['catch'](handleError(_0x590822,null));};exports[_0xdbb9('0x49')]=function(_0x234643,_0x5a6dd7){return db[_0xdbb9('0x3f')][_0xdbb9('0x46')]({'where':{'id':_0x234643['params']['id']}})[_0xdbb9('0x25')](handleEntityNotFound(_0x5a6dd7,null))[_0xdbb9('0x25')](removeEntity(_0x5a6dd7,null))[_0xdbb9('0x42')](handleError(_0x5a6dd7,null));};exports[_0xdbb9('0x4a')]=function(_0x51b980,_0x59681d){return db[_0xdbb9('0x3f')][_0xdbb9('0x4a')]()[_0xdbb9('0x25')](respondWithResult(_0x59681d,null))[_0xdbb9('0x42')](handleError(_0x59681d,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0e8ef07..b1b9212 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 _0x523e=['exports','user_profile_has_sections','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a3a82,_0x3e076a){var _0x563434=function(_0x3796e0){while(--_0x3796e0){_0x4a3a82['push'](_0x4a3a82['shift']());}};_0x563434(++_0x3e076a);}(_0x523e,0x146));var _0xe523=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x523e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe523('0x0'));var util=require(_0xe523('0x1'));var logger=require(_0xe523('0x2'))(_0xe523('0x3'));var moment=require(_0xe523('0x4'));var BPromise=require(_0xe523('0x5'));var rp=require(_0xe523('0x6'));var fs=require('fs');var path=require(_0xe523('0x7'));var rimraf=require(_0xe523('0x8'));var config=require(_0xe523('0x9'));var attributes=require('./userProfileSection.attributes');module[_0xe523('0xa')]=function(_0x30dc56,_0x5720c7){return _0x30dc56['define']('UserProfileSection',attributes,{'tableName':_0xe523('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3dc=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x20445c,_0x277ac4){var _0x5439c9=function(_0xe6f9fb){while(--_0xe6f9fb){_0x20445c['push'](_0x20445c['shift']());}};_0x5439c9(++_0x277ac4);}(_0xb3dc,0x12b));var _0xcb3d=function(_0x2c39a8,_0x419568){_0x2c39a8=_0x2c39a8-0x0;var _0x92aad6=_0xb3dc[_0x2c39a8];return _0x92aad6;};'use strict';var _=require(_0xcb3d('0x0'));var util=require(_0xcb3d('0x1'));var logger=require(_0xcb3d('0x2'))(_0xcb3d('0x3'));var moment=require(_0xcb3d('0x4'));var BPromise=require(_0xcb3d('0x5'));var rp=require(_0xcb3d('0x6'));var fs=require('fs');var path=require(_0xcb3d('0x7'));var rimraf=require('rimraf');var config=require(_0xcb3d('0x8'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x29adce,_0x1d6bc4){return _0x29adce[_0xcb3d('0x9')](_0xcb3d('0xa'),attributes,{'tableName':_0xcb3d('0xb'),'paranoid':![],'indexes':[{'name':_0xcb3d('0xc'),'fields':[_0xcb3d('0xd'),_0xcb3d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index c9153ee..395cb62 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 _0x5697=['message','catch','lodash','moment','bluebird','randomstring','../../config/environment','request','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1f5873,_0x1497be){var _0x2a75d9=function(_0x16c497){while(--_0x16c497){_0x1f5873['push'](_0x1f5873['shift']());}};_0x2a75d9(++_0x1497be);}(_0x5697,0x1b5));var _0x7569=function(_0x5f3562,_0x212f41){_0x5f3562=_0x5f3562-0x0;var _0x1b39b4=_0x5697[_0x5f3562];return _0x1b39b4;};'use strict';var _=require(_0x7569('0x0'));var util=require('util');var moment=require(_0x7569('0x1'));var BPromise=require(_0x7569('0x2'));var rs=require(_0x7569('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7569('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x149fa1,_0x11536f,_0x30b7e2){return new BPromise(function(_0xee5a4,_0x3c0470){return client[_0x7569('0x5')](_0x149fa1,_0x30b7e2)['then'](function(_0x45cb1f){logger['info'](_0x7569('0x6'),_0x11536f,_0x7569('0x7'));logger[_0x7569('0x8')](_0x7569('0x9'),_0x11536f,_0x7569('0x7'),JSON[_0x7569('0xa')](_0x45cb1f));if(_0x45cb1f[_0x7569('0xb')]){if(_0x45cb1f[_0x7569('0xb')][_0x7569('0xc')]===0x1f4){logger['error'](_0x7569('0x6'),_0x11536f,_0x45cb1f[_0x7569('0xb')][_0x7569('0xd')]);return _0x3c0470(_0x45cb1f[_0x7569('0xb')][_0x7569('0xd')]);}logger[_0x7569('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x11536f,_0x45cb1f[_0x7569('0xb')][_0x7569('0xd')]);return _0xee5a4(_0x45cb1f[_0x7569('0xb')][_0x7569('0xd')]);}else{logger['info'](_0x7569('0x6'),_0x11536f,_0x7569('0x7'));_0xee5a4(_0x45cb1f['result']['message']);}})[_0x7569('0xe')](function(_0x97974d){logger['error'](_0x7569('0x6'),_0x11536f,_0x97974d);_0x3c0470(_0x97974d);});});} \ No newline at end of file +var _0x1652=['then','UserProfileSection,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x1652,0xc1));var _0x2165=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x1652[_0x4e0026];return _0x3f8ee7;};'use strict';var _=require(_0x2165('0x0'));var util=require(_0x2165('0x1'));var moment=require(_0x2165('0x2'));var BPromise=require(_0x2165('0x3'));var rs=require(_0x2165('0x4'));var fs=require('fs');var Redis=require(_0x2165('0x5'));var db=require(_0x2165('0x6'))['db'];var utils=require(_0x2165('0x7'));var logger=require('../../config/logger')(_0x2165('0x8'));var config=require(_0x2165('0x9'));var jayson=require(_0x2165('0xa'));var client=jayson[_0x2165('0xb')][_0x2165('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40ae40,_0x43a3e0,_0x2ebc86){return new BPromise(function(_0x4871b7,_0x62b6b1){return client[_0x2165('0xd')](_0x40ae40,_0x2ebc86)[_0x2165('0xe')](function(_0x123ddf){logger['info'](_0x2165('0xf'),_0x43a3e0,'request\x20sent');logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x43a3e0,_0x2165('0x10'),JSON['stringify'](_0x123ddf));if(_0x123ddf[_0x2165('0x11')]){if(_0x123ddf[_0x2165('0x11')][_0x2165('0x12')]===0x1f4){logger['error'](_0x2165('0xf'),_0x43a3e0,_0x123ddf[_0x2165('0x11')][_0x2165('0x13')]);return _0x62b6b1(_0x123ddf[_0x2165('0x11')]['message']);}logger[_0x2165('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x43a3e0,_0x123ddf['error'][_0x2165('0x13')]);return _0x4871b7(_0x123ddf[_0x2165('0x11')][_0x2165('0x13')]);}else{logger[_0x2165('0x14')](_0x2165('0xf'),_0x43a3e0,_0x2165('0x10'));_0x4871b7(_0x123ddf[_0x2165('0x15')][_0x2165('0x13')]);}})[_0x2165('0x16')](function(_0x273bbd){logger[_0x2165('0x11')](_0x2165('0xf'),_0x43a3e0,_0x273bbd);_0x62b6b1(_0x273bbd);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 37a5a88..5b043e2 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2cc03b,_0x295c7b){var _0x54948c=function(_0x5e567b){while(--_0x5e567b){_0x2cc03b['push'](_0x2cc03b['shift']());}};_0x54948c(++_0x295c7b);}(_0xedd9,0xfc));var _0x9edd=function(_0x2555ff,_0x2539bd){_0x2555ff=_0x2555ff-0x0;var _0x490fc5=_0xedd9[_0x2555ff];return _0x490fc5;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3e1e47,_0x3082cd){var _0x49e69c=function(_0x4da78a){while(--_0x4da78a){_0x3e1e47['push'](_0x3e1e47['shift']());}};_0x49e69c(++_0x3082cd);}(_0x70e0,0x17b));var _0x070e=function(_0x29381a,_0x434b68){_0x29381a=_0x29381a-0x0;var _0x40c16b=_0x70e0[_0x29381a];return _0x40c16b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4796ba0..72eba60 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 _0x6710=['exports','INTEGER','sequelize'];(function(_0x28392a,_0x1a9084){var _0x52f948=function(_0x723c43){while(--_0x723c43){_0x28392a['push'](_0x28392a['shift']());}};_0x52f948(++_0x1a9084);}(_0x6710,0x12b));var _0x0671=function(_0xfc957f,_0x2e353b){_0xfc957f=_0xfc957f-0x0;var _0x10a878=_0x6710[_0xfc957f];return _0x10a878;};'use strict';var Sequelize=require(_0x0671('0x0'));module[_0x0671('0x1')]={'penalty':{'type':Sequelize[_0x0671('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xab7c=['INTEGER','sequelize'];(function(_0x23a417,_0x56ff8e){var _0x3c1651=function(_0x3e2b19){while(--_0x3e2b19){_0x23a417['push'](_0x23a417['shift']());}};_0x3c1651(++_0x56ff8e);}(_0xab7c,0xfb));var _0xcab7=function(_0x4d127e,_0x5aa2d9){_0x4d127e=_0x4d127e-0x0;var _0x264f22=_0xab7c[_0x4d127e];return _0x264f22;};'use strict';var Sequelize=require(_0xcab7('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcab7('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 512b5f4..7d912b0 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 _0xed1c=['exports','UserSmsQueue','user_has_sms_queues','lodash','util','request-promise','path','rimraf','./userSmsQueue.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xed1c,0xe4));var _0xced1=function(_0x17946f,_0x12a5ef){_0x17946f=_0x17946f-0x0;var _0x316c8c=_0xed1c[_0x17946f];return _0x316c8c;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb934=['exports','define','user_has_sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0xb934,0x92));var _0x4b93=function(_0x59627b,_0x247133){_0x59627b=_0x59627b-0x0;var _0x54f1e7=_0xb934[_0x59627b];return _0x54f1e7;};'use strict';var _=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var logger=require(_0x4b93('0x2'))('api');var moment=require(_0x4b93('0x3'));var BPromise=require(_0x4b93('0x4'));var rp=require(_0x4b93('0x5'));var fs=require('fs');var path=require(_0x4b93('0x6'));var rimraf=require(_0x4b93('0x7'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0x4b93('0x8')]=function(_0x1fa8af,_0x2ea5ad){return _0x1fa8af[_0x4b93('0x9')]('UserSmsQueue',attributes,{'tableName':_0x4b93('0xa'),'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 1357820..92add91 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 _0x1689=['client','http','request','then','info','UserSmsQueue,\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'];(function(_0x98ff43,_0x538579){var _0x4f5757=function(_0x20eac9){while(--_0x20eac9){_0x98ff43['push'](_0x98ff43['shift']());}};_0x4f5757(++_0x538579);}(_0x1689,0x14f));var _0x9168=function(_0x148a91,_0x169d87){_0x148a91=_0x148a91-0x0;var _0x1764c5=_0x1689[_0x148a91];return _0x1764c5;};'use strict';var _=require(_0x9168('0x0'));var util=require(_0x9168('0x1'));var moment=require(_0x9168('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9168('0x3'));var db=require(_0x9168('0x4'))['db'];var utils=require(_0x9168('0x5'));var logger=require(_0x9168('0x6'))(_0x9168('0x7'));var config=require(_0x9168('0x8'));var jayson=require(_0x9168('0x9'));var client=jayson[_0x9168('0xa')][_0x9168('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ad76,_0x346df4,_0x170cff){return new BPromise(function(_0x46b419,_0x339ccc){return client[_0x9168('0xc')](_0x47ad76,_0x170cff)[_0x9168('0xd')](function(_0x16a0fe){logger[_0x9168('0xe')](_0x9168('0xf'),_0x346df4,_0x9168('0x10'));logger[_0x9168('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x346df4,_0x9168('0x10'),JSON[_0x9168('0x12')](_0x16a0fe));if(_0x16a0fe[_0x9168('0x13')]){if(_0x16a0fe[_0x9168('0x13')][_0x9168('0x14')]===0x1f4){logger[_0x9168('0x13')](_0x9168('0xf'),_0x346df4,_0x16a0fe[_0x9168('0x13')][_0x9168('0x15')]);return _0x339ccc(_0x16a0fe[_0x9168('0x13')][_0x9168('0x15')]);}logger[_0x9168('0x13')](_0x9168('0xf'),_0x346df4,_0x16a0fe[_0x9168('0x13')]['message']);return _0x46b419(_0x16a0fe[_0x9168('0x13')]['message']);}else{logger['info'](_0x9168('0xf'),_0x346df4,_0x9168('0x10'));_0x46b419(_0x16a0fe[_0x9168('0x16')]['message']);}})['catch'](function(_0x1d5acb){logger['error'](_0x9168('0xf'),_0x346df4,_0x1d5acb);_0x339ccc(_0x1d5acb);});});} \ No newline at end of file +var _0x8edf=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x31bbe3,_0x108dca){var _0x6abf93=function(_0x248997){while(--_0x248997){_0x31bbe3['push'](_0x31bbe3['shift']());}};_0x6abf93(++_0x108dca);}(_0x8edf,0x11a));var _0xf8ed=function(_0x10f526,_0x2f160b){_0x10f526=_0x10f526-0x0;var _0x274a13=_0x8edf[_0x10f526];return _0x274a13;};'use strict';var _=require(_0xf8ed('0x0'));var util=require(_0xf8ed('0x1'));var moment=require(_0xf8ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf8ed('0x4'))(_0xf8ed('0x5'));var config=require(_0xf8ed('0x6'));var jayson=require(_0xf8ed('0x7'));var client=jayson[_0xf8ed('0x8')][_0xf8ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1969eb,_0x3583b6,_0xe781fc){return new BPromise(function(_0x4226bd,_0x55411e){return client['request'](_0x1969eb,_0xe781fc)[_0xf8ed('0xa')](function(_0x56a9bf){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3583b6,_0xf8ed('0xb'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3583b6,_0xf8ed('0xb'),JSON[_0xf8ed('0xc')](_0x56a9bf));if(_0x56a9bf[_0xf8ed('0xd')]){if(_0x56a9bf[_0xf8ed('0xd')][_0xf8ed('0xe')]===0x1f4){logger[_0xf8ed('0xd')](_0xf8ed('0xf'),_0x3583b6,_0x56a9bf['error']['message']);return _0x55411e(_0x56a9bf[_0xf8ed('0xd')][_0xf8ed('0x10')]);}logger['error'](_0xf8ed('0xf'),_0x3583b6,_0x56a9bf['error'][_0xf8ed('0x10')]);return _0x4226bd(_0x56a9bf[_0xf8ed('0xd')][_0xf8ed('0x10')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3583b6,_0xf8ed('0xb'));_0x4226bd(_0x56a9bf[_0xf8ed('0x11')][_0xf8ed('0x10')]);}})[_0xf8ed('0x12')](function(_0x426c78){logger[_0xf8ed('0xd')](_0xf8ed('0xf'),_0x3583b6,_0x426c78);_0x55411e(_0x426c78);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a221dd0..147aeba 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 _0x73be=['INTEGER','sequelize','exports'];(function(_0x1a160c,_0x5ed766){var _0x4103f7=function(_0x4b4547){while(--_0x4b4547){_0x1a160c['push'](_0x1a160c['shift']());}};_0x4103f7(++_0x5ed766);}(_0x73be,0x11b));var _0xe73b=function(_0x293382,_0x7cac78){_0x293382=_0x293382-0x0;var _0x1cf13b=_0x73be[_0x293382];return _0x1cf13b;};'use strict';var Sequelize=require(_0xe73b('0x0'));module[_0xe73b('0x1')]={'UserId':{'type':Sequelize[_0xe73b('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe73b('0x2')]}}; \ No newline at end of file +var _0xf0ab=['exports','INTEGER','sequelize'];(function(_0x1403ba,_0x21ae03){var _0xa9a873=function(_0x44823f){while(--_0x44823f){_0x1403ba['push'](_0x1403ba['shift']());}};_0xa9a873(++_0x21ae03);}(_0xf0ab,0x17c));var _0xbf0a=function(_0x4ff2e4,_0x3b1489){_0x4ff2e4=_0x4ff2e4-0x0;var _0x69c350=_0xf0ab[_0x4ff2e4];return _0x69c350;};'use strict';var Sequelize=require(_0xbf0a('0x0'));module[_0xbf0a('0x1')]={'UserId':{'type':Sequelize[_0xbf0a('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 ef20fe4..8a43d22 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(_0x11c11a,_0x2b68e2){var _0x27a4e1=function(_0x517f7e){while(--_0x517f7e){_0x11c11a['push'](_0x11c11a['shift']());}};_0x27a4e1(++_0x2b68e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x3516fe,_0x60c65b){var _0x55c750=function(_0x1f62f8){while(--_0x1f62f8){_0x3516fe['push'](_0x3516fe['shift']());}};_0x55c750(++_0x60c65b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index eecfd64..98cc298 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x79324e,_0x4af67e){var _0x555666=function(_0x15d9c2){while(--_0x15d9c2){_0x79324e['push'](_0x79324e['shift']());}};_0x555666(++_0x4af67e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3ce6b0,_0x2e9f26){var _0x5c783c=function(_0x580ef3){while(--_0x580ef3){_0x3ce6b0['push'](_0x3ce6b0['shift']());}};_0x5c783c(++_0x2e9f26);}(_0x70e0,0x17b));var _0x070e=function(_0x55931b,_0x431f7c){_0x55931b=_0x55931b-0x0;var _0xf5154e=_0x70e0[_0x55931b];return _0xf5154e;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9196976..116bb57 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 _0xe8c5=['sequelize','exports'];(function(_0x3cf6b4,_0x49f800){var _0x17f9e7=function(_0x2523f4){while(--_0x2523f4){_0x3cf6b4['push'](_0x3cf6b4['shift']());}};_0x17f9e7(++_0x49f800);}(_0xe8c5,0x1c0));var _0x5e8c=function(_0x1462e8,_0x43ef01){_0x1462e8=_0x1462e8-0x0;var _0x8b2312=_0xe8c5[_0x1462e8];return _0x8b2312;};'use strict';var Sequelize=require(_0x5e8c('0x0'));module[_0x5e8c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc02c=['sequelize','exports','INTEGER'];(function(_0x58a13e,_0xe4f934){var _0x1082b6=function(_0x3d5888){while(--_0x3d5888){_0x58a13e['push'](_0x58a13e['shift']());}};_0x1082b6(++_0xe4f934);}(_0xc02c,0x18f));var _0xcc02=function(_0x3a177c,_0xfb1964){_0x3a177c=_0x3a177c-0x0;var _0x291a58=_0xc02c[_0x3a177c];return _0x291a58;};'use strict';var Sequelize=require(_0xcc02('0x0'));module[_0xcc02('0x1')]={'penalty':{'type':Sequelize[_0xcc02('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 9f1c4a1..eb86ec4 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 _0x154c=['define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','exports'];(function(_0x2c149c,_0x234daa){var _0x32f252=function(_0x51abe4){while(--_0x51abe4){_0x2c149c['push'](_0x2c149c['shift']());}};_0x32f252(++_0x234daa);}(_0x154c,0x161));var _0xc154=function(_0x58e29f,_0x475e63){_0x58e29f=_0x58e29f-0x0;var _0x32a7ab=_0x154c[_0x58e29f];return _0x32a7ab;};'use strict';var _=require(_0xc154('0x0'));var util=require(_0xc154('0x1'));var logger=require(_0xc154('0x2'))(_0xc154('0x3'));var moment=require(_0xc154('0x4'));var BPromise=require(_0xc154('0x5'));var rp=require(_0xc154('0x6'));var fs=require('fs');var path=require(_0xc154('0x7'));var rimraf=require('rimraf');var config=require(_0xc154('0x8'));var attributes=require(_0xc154('0x9'));module[_0xc154('0xa')]=function(_0x3498cb,_0x917250){return _0x3498cb[_0xc154('0xb')](_0xc154('0xc'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51d8=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x51d8,0x168));var _0x851d=function(_0x5e367f,_0xa51c83){_0x5e367f=_0x5e367f-0x0;var _0x3d7263=_0x51d8[_0x5e367f];return _0x3d7263;};'use strict';var _=require('lodash');var util=require(_0x851d('0x0'));var logger=require(_0x851d('0x1'))(_0x851d('0x2'));var moment=require('moment');var BPromise=require(_0x851d('0x3'));var rp=require(_0x851d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x851d('0x5'));var config=require(_0x851d('0x6'));var attributes=require(_0x851d('0x7'));module[_0x851d('0x8')]=function(_0xbffeb6,_0x166ab7){return _0xbffeb6[_0x851d('0x9')](_0x851d('0xa'),attributes,{'tableName':_0x851d('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 6e0a185..fe0e0cf 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 _0x15e6=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x15e6,0x132));var _0x615e=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x15e6[_0x2ad008];return _0x4538cf;};'use strict';var _=require('lodash');var util=require(_0x615e('0x0'));var moment=require(_0x615e('0x1'));var BPromise=require(_0x615e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x615e('0x3'));var db=require(_0x615e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x615e('0x5'))(_0x615e('0x6'));var config=require(_0x615e('0x7'));var jayson=require(_0x615e('0x8'));var client=jayson['client'][_0x615e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe3355c,_0x135e32,_0x256e23){return new BPromise(function(_0x144631,_0x4f2076){return client[_0x615e('0xa')](_0xe3355c,_0x256e23)[_0x615e('0xb')](function(_0x13cc98){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x135e32,_0x615e('0xc'));logger[_0x615e('0xd')](_0x615e('0xe'),_0x135e32,'request\x20sent',JSON[_0x615e('0xf')](_0x13cc98));if(_0x13cc98['error']){if(_0x13cc98[_0x615e('0x10')]['code']===0x1f4){logger[_0x615e('0x10')](_0x615e('0x11'),_0x135e32,_0x13cc98[_0x615e('0x10')][_0x615e('0x12')]);return _0x4f2076(_0x13cc98[_0x615e('0x10')][_0x615e('0x12')]);}logger[_0x615e('0x10')](_0x615e('0x11'),_0x135e32,_0x13cc98[_0x615e('0x10')][_0x615e('0x12')]);return _0x144631(_0x13cc98[_0x615e('0x10')][_0x615e('0x12')]);}else{logger['info'](_0x615e('0x11'),_0x135e32,_0x615e('0xc'));_0x144631(_0x13cc98[_0x615e('0x13')][_0x615e('0x12')]);}})['catch'](function(_0x50fb1c){logger[_0x615e('0x10')](_0x615e('0x11'),_0x135e32,_0x50fb1c);_0x4f2076(_0x50fb1c);});});} \ No newline at end of file +var _0xc63d=['code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xc63d,0x1d2));var _0xdc63=function(_0x15a49b,_0x2c8ed6){_0x15a49b=_0x15a49b-0x0;var _0x213a68=_0xc63d[_0x15a49b];return _0x213a68;};'use strict';var _=require(_0xdc63('0x0'));var util=require(_0xdc63('0x1'));var moment=require(_0xdc63('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc63('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdc63('0x4'))(_0xdc63('0x5'));var config=require(_0xdc63('0x6'));var jayson=require(_0xdc63('0x7'));var client=jayson['client'][_0xdc63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a78ac,_0x52f9f9,_0x27e296){return new BPromise(function(_0x1938b9,_0x13bcd9){return client[_0xdc63('0x9')](_0x3a78ac,_0x27e296)[_0xdc63('0xa')](function(_0x29a70d){logger[_0xdc63('0xb')](_0xdc63('0xc'),_0x52f9f9,'request\x20sent');logger[_0xdc63('0xd')](_0xdc63('0xe'),_0x52f9f9,_0xdc63('0xf'),JSON[_0xdc63('0x10')](_0x29a70d));if(_0x29a70d[_0xdc63('0x11')]){if(_0x29a70d['error'][_0xdc63('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x52f9f9,_0x29a70d[_0xdc63('0x11')][_0xdc63('0x13')]);return _0x13bcd9(_0x29a70d['error'][_0xdc63('0x13')]);}logger[_0xdc63('0x11')](_0xdc63('0xc'),_0x52f9f9,_0x29a70d['error'][_0xdc63('0x13')]);return _0x1938b9(_0x29a70d[_0xdc63('0x11')][_0xdc63('0x13')]);}else{logger[_0xdc63('0xb')](_0xdc63('0xc'),_0x52f9f9,_0xdc63('0xf'));_0x1938b9(_0x29a70d[_0xdc63('0x14')][_0xdc63('0x13')]);}})[_0xdc63('0x15')](function(_0x543afc){logger[_0xdc63('0x11')](_0xdc63('0xc'),_0x52f9f9,_0x543afc);_0x13bcd9(_0x543afc);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d972411..ad1333c 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f5113,_0x535501){var _0x4a5436=function(_0x6ba163){while(--_0x6ba163){_0x2f5113['push'](_0x2f5113['shift']());}};_0x4a5436(++_0x535501);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2276e2,_0x373589){var _0x343d3b=function(_0x4f99e7){while(--_0x4f99e7){_0x2276e2['push'](_0x2276e2['shift']());}};_0x343d3b(++_0x373589);}(_0x70e0,0x17b));var _0x070e=function(_0x452ad2,_0xd9b3c4){_0x452ad2=_0x452ad2-0x0;var _0x4a3b76=_0x70e0[_0x452ad2];return _0x4a3b76;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 83ad65a..0134316 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 _0x8502=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','sequelize'];(function(_0x3c56e2,_0x2d4997){var _0x31f370=function(_0x10fd6f){while(--_0x10fd6f){_0x3c56e2['push'](_0x3c56e2['shift']());}};_0x31f370(++_0x2d4997);}(_0x8502,0xd1));var _0x2850=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0x8502[_0x9c3c56];return _0x2dd782;};'use strict';var Sequelize=require(_0x2850('0x0'));module[_0x2850('0x1')]={'uniqueid':{'type':Sequelize[_0x2850('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2850('0x3')},'membername':{'type':Sequelize[_0x2850('0x4')],'allowNull':![],'comment':_0x2850('0x3')},'UserId':{'type':Sequelize[_0x2850('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2850('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x2850('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x2850('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x2850('0x3')},'penalty':{'type':Sequelize[_0x2850('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x2850('0x2')](0xb),'defaultValue':0x0,'comment':_0x2850('0x3')}}; \ No newline at end of file +var _0x3e86=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports'];(function(_0x51cbcd,_0xf7881d){var _0x49bb5c=function(_0x1bd368){while(--_0x1bd368){_0x51cbcd['push'](_0x51cbcd['shift']());}};_0x49bb5c(++_0xf7881d);}(_0x3e86,0x1c6));var _0x63e8=function(_0x2b9749,_0x42d8cf){_0x2b9749=_0x2b9749-0x0;var _0x47bcee=_0x3e86[_0x2b9749];return _0x47bcee;};'use strict';var Sequelize=require(_0x63e8('0x0'));module[_0x63e8('0x1')]={'uniqueid':{'type':Sequelize[_0x63e8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x63e8('0x3')],'allowNull':![],'comment':_0x63e8('0x4')},'UserId':{'type':Sequelize[_0x63e8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x63e8('0x3')],'allowNull':![],'unique':_0x63e8('0x5'),'comment':_0x63e8('0x4')},'VoiceQueueId':{'type':Sequelize[_0x63e8('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x63e8('0x3')],'allowNull':![],'unique':_0x63e8('0x5'),'comment':_0x63e8('0x4')},'penalty':{'type':Sequelize[_0x63e8('0x2')](0xb),'defaultValue':0x0,'comment':_0x63e8('0x4')},'paused':{'type':Sequelize[_0x63e8('0x2')](0xb),'defaultValue':0x0,'comment':_0x63e8('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 139e7e3..3a80f8d 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 _0x235a=['hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x408d95,_0x43248e){var _0x552bf9=function(_0x37a3d2){while(--_0x37a3d2){_0x408d95['push'](_0x408d95['shift']());}};_0x552bf9(++_0x43248e);}(_0x235a,0xa2));var _0xa235=function(_0x3bc575,_0x400f90){_0x3bc575=_0x3bc575-0x0;var _0x25c47f=_0x235a[_0x3bc575];return _0x25c47f;};'use strict';var EventEmitter=require(_0xa235('0x0'));var UserVoiceQueueRt=require(_0xa235('0x1'))['db'][_0xa235('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa235('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa235('0x4')};function emitEvent(_0x2a5ba8){return function(_0x44bb50,_0x2400f6,_0x31e0ce){UserVoiceQueueRtEvents[_0xa235('0x5')](_0x2a5ba8+':'+_0x44bb50['id'],_0x44bb50);UserVoiceQueueRtEvents['emit'](_0x2a5ba8,_0x44bb50);_0x31e0ce(null);};}for(var e in events){if(events[_0xa235('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xa235('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x57f2=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x108b78,_0x28a619){var _0x3f81ed=function(_0x117143){while(--_0x117143){_0x108b78['push'](_0x108b78['shift']());}};_0x3f81ed(++_0x28a619);}(_0x57f2,0x72));var _0x257f=function(_0x143873,_0x34c95f){_0x143873=_0x143873-0x0;var _0xc717bb=_0x57f2[_0x143873];return _0xc717bb;};'use strict';var EventEmitter=require(_0x257f('0x0'));var UserVoiceQueueRt=require(_0x257f('0x1'))['db'][_0x257f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x257f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x257f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43de0c){return function(_0x2adc5b,_0x252981,_0x3ff187){UserVoiceQueueRtEvents['emit'](_0x43de0c+':'+_0x2adc5b['id'],_0x2adc5b);UserVoiceQueueRtEvents[_0x257f('0x5')](_0x43de0c,_0x2adc5b);_0x3ff187(null);};}for(var e in events){if(events[_0x257f('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x257f('0x7')](e,emitEvent(event));}}module[_0x257f('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index caef3a8..1b30c2d 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 _0x5674=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','util','../../config/logger','api','moment'];(function(_0x9f1737,_0x3e160a){var _0x1cc57f=function(_0x19c034){while(--_0x19c034){_0x9f1737['push'](_0x9f1737['shift']());}};_0x1cc57f(++_0x3e160a);}(_0x5674,0x74));var _0x4567=function(_0x2650df,_0x5daf20){_0x2650df=_0x2650df-0x0;var _0xa8cc92=_0x5674[_0x2650df];return _0xa8cc92;};'use strict';var _=require('lodash');var util=require(_0x4567('0x0'));var logger=require(_0x4567('0x1'))(_0x4567('0x2'));var moment=require(_0x4567('0x3'));var BPromise=require('bluebird');var rp=require(_0x4567('0x4'));var fs=require('fs');var path=require(_0x4567('0x5'));var rimraf=require(_0x4567('0x6'));var config=require(_0x4567('0x7'));var attributes=require(_0x4567('0x8'));module[_0x4567('0x9')]=function(_0x4d362e,_0x8aa6fd){return _0x4d362e[_0x4567('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x4567('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe05e=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x40300e,_0x4506d6){var _0x334662=function(_0x3473ae){while(--_0x3473ae){_0x40300e['push'](_0x40300e['shift']());}};_0x334662(++_0x4506d6);}(_0xe05e,0x94));var _0xee05=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xe05e[_0x3c2b2e];return _0x27a338;};'use strict';var _=require(_0xee05('0x0'));var util=require(_0xee05('0x1'));var logger=require(_0xee05('0x2'))(_0xee05('0x3'));var moment=require('moment');var BPromise=require(_0xee05('0x4'));var rp=require(_0xee05('0x5'));var fs=require('fs');var path=require(_0xee05('0x6'));var rimraf=require(_0xee05('0x7'));var config=require('../../config/environment');var attributes=require(_0xee05('0x8'));module[_0xee05('0x9')]=function(_0x2a2689,_0x2d6048){return _0x2a2689[_0xee05('0xa')](_0xee05('0xb'),attributes,{'tableName':_0xee05('0xc'),'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 f71d015..79299fa 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 _0xf0ce=['UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','socket.io-emitter','redis','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses'];(function(_0xaccc4e,_0x396cda){var _0x3da67b=function(_0x49868b){while(--_0x49868b){_0xaccc4e['push'](_0xaccc4e['shift']());}};_0x3da67b(++_0x396cda);}(_0xf0ce,0xb7));var _0xef0c=function(_0xfb9f9d,_0xadc363){_0xfb9f9d=_0xfb9f9d-0x0;var _0x2a6859=_0xf0ce[_0xfb9f9d];return _0x2a6859;};'use strict';var _=require('lodash');var util=require(_0xef0c('0x0'));var moment=require(_0xef0c('0x1'));var BPromise=require(_0xef0c('0x2'));var rs=require(_0xef0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef0c('0x4'))['db'];var utils=require(_0xef0c('0x5'));var logger=require(_0xef0c('0x6'))(_0xef0c('0x7'));var config=require(_0xef0c('0x8'));var jayson=require(_0xef0c('0x9'));var client=jayson[_0xef0c('0xa')]['http']({'port':0x232a});config['redis']=_[_0xef0c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xef0c('0xc'))(new Redis(config[_0xef0c('0xd')]));require(_0xef0c('0xe'))['register'](socket);function respondWithRpcPromise(_0x4b3d6d,_0x598c5e,_0x40dbee){return new BPromise(function(_0x2daa64,_0x2598d2){return client['request'](_0x4b3d6d,_0x40dbee)[_0xef0c('0xf')](function(_0x541990){logger[_0xef0c('0x10')](_0xef0c('0x11'),_0x598c5e,'request\x20sent');logger['debug'](_0xef0c('0x12'),_0x598c5e,_0xef0c('0x13'),JSON[_0xef0c('0x14')](_0x541990));if(_0x541990[_0xef0c('0x15')]){if(_0x541990[_0xef0c('0x15')][_0xef0c('0x16')]===0x1f4){logger[_0xef0c('0x15')](_0xef0c('0x11'),_0x598c5e,_0x541990['error'][_0xef0c('0x17')]);return _0x2598d2(_0x541990[_0xef0c('0x15')][_0xef0c('0x17')]);}logger[_0xef0c('0x15')](_0xef0c('0x11'),_0x598c5e,_0x541990[_0xef0c('0x15')]['message']);return _0x2daa64(_0x541990[_0xef0c('0x15')][_0xef0c('0x17')]);}else{logger[_0xef0c('0x10')](_0xef0c('0x11'),_0x598c5e,_0xef0c('0x13'));_0x2daa64(_0x541990[_0xef0c('0x18')]['message']);}})[_0xef0c('0x19')](function(_0xd02531){logger[_0xef0c('0x15')](_0xef0c('0x11'),_0x598c5e,_0xd02531);_0x2598d2(_0xd02531);});});}exports[_0xef0c('0x1a')]=function(_0x1aed27){var _0x6c1c00=this;return new Promise(function(_0x1187dc,_0x3cd236){return db[_0xef0c('0x1b')]['findAll']({'raw':_0x1aed27[_0xef0c('0x1c')]?_0x1aed27['options'][_0xef0c('0x1d')]===undefined?!![]:![]:!![],'where':_0x1aed27['options']?_0x1aed27[_0xef0c('0x1c')][_0xef0c('0x1e')]||null:null,'attributes':[[db[_0xef0c('0x1f')]['fn'](_0xef0c('0x20'),db[_0xef0c('0x1f')]['fn']('IF',db[_0xef0c('0x1f')][_0xef0c('0x21')](_0xef0c('0x22')))),'outboundQueuePauses']]})[_0xef0c('0xf')](function(_0x19cde2){logger[_0xef0c('0x10')](_0xef0c('0x1a'),_0x1aed27);logger['debug'](_0xef0c('0x1a'),_0x1aed27,JSON[_0xef0c('0x14')](_0x19cde2));_0x1187dc(_0x19cde2);})[_0xef0c('0x19')](function(_0x28161c){logger[_0xef0c('0x15')](_0xef0c('0x1a'),_0x28161c[_0xef0c('0x17')],_0x1aed27);_0x3cd236(_0x6c1c00[_0xef0c('0x15')](0x1f4,_0x28161c[_0xef0c('0x17')]));});});}; \ No newline at end of file +var _0xb5d4=['redis','defaults','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4f84fc,_0x29ca45){var _0x296601=function(_0x47b054){while(--_0x47b054){_0x4f84fc['push'](_0x4f84fc['shift']());}};_0x296601(++_0x29ca45);}(_0xb5d4,0xd4));var _0x4b5d=function(_0x8b3778,_0x4453db){_0x8b3778=_0x8b3778-0x0;var _0x53bdc8=_0xb5d4[_0x8b3778];return _0x53bdc8;};'use strict';var _=require(_0x4b5d('0x0'));var util=require(_0x4b5d('0x1'));var moment=require(_0x4b5d('0x2'));var BPromise=require(_0x4b5d('0x3'));var rs=require(_0x4b5d('0x4'));var fs=require('fs');var Redis=require(_0x4b5d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b5d('0x6'));var logger=require('../../config/logger')(_0x4b5d('0x7'));var config=require(_0x4b5d('0x8'));var jayson=require(_0x4b5d('0x9'));var client=jayson[_0x4b5d('0xa')][_0x4b5d('0xb')]({'port':0x232a});config[_0x4b5d('0xc')]=_[_0x4b5d('0xd')](config[_0x4b5d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b5d('0xc')]));require(_0x4b5d('0xe'))['register'](socket);function respondWithRpcPromise(_0x182b34,_0x5f4e23,_0x1b2272){return new BPromise(function(_0x788b3c,_0x526c75){return client[_0x4b5d('0xf')](_0x182b34,_0x1b2272)[_0x4b5d('0x10')](function(_0x13969f){logger[_0x4b5d('0x11')](_0x4b5d('0x12'),_0x5f4e23,_0x4b5d('0x13'));logger[_0x4b5d('0x14')](_0x4b5d('0x15'),_0x5f4e23,_0x4b5d('0x13'),JSON[_0x4b5d('0x16')](_0x13969f));if(_0x13969f['error']){if(_0x13969f[_0x4b5d('0x17')]['code']===0x1f4){logger['error'](_0x4b5d('0x12'),_0x5f4e23,_0x13969f[_0x4b5d('0x17')][_0x4b5d('0x18')]);return _0x526c75(_0x13969f[_0x4b5d('0x17')][_0x4b5d('0x18')]);}logger[_0x4b5d('0x17')](_0x4b5d('0x12'),_0x5f4e23,_0x13969f[_0x4b5d('0x17')][_0x4b5d('0x18')]);return _0x788b3c(_0x13969f['error'][_0x4b5d('0x18')]);}else{logger[_0x4b5d('0x11')](_0x4b5d('0x12'),_0x5f4e23,_0x4b5d('0x13'));_0x788b3c(_0x13969f['result'][_0x4b5d('0x18')]);}})['catch'](function(_0x35f1d6){logger[_0x4b5d('0x17')](_0x4b5d('0x12'),_0x5f4e23,_0x35f1d6);_0x526c75(_0x35f1d6);});});}exports[_0x4b5d('0x19')]=function(_0xf57e81){var _0x226f75=this;return new Promise(function(_0x58c334,_0x55bcb4){return db[_0x4b5d('0x1a')][_0x4b5d('0x1b')]({'raw':_0xf57e81[_0x4b5d('0x1c')]?_0xf57e81[_0x4b5d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xf57e81[_0x4b5d('0x1c')]?_0xf57e81[_0x4b5d('0x1c')][_0x4b5d('0x1d')]||null:null,'attributes':[[db[_0x4b5d('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x4b5d('0x10')](function(_0xe44714){logger[_0x4b5d('0x11')](_0x4b5d('0x19'),_0xf57e81);logger[_0x4b5d('0x14')](_0x4b5d('0x19'),_0xf57e81,JSON[_0x4b5d('0x16')](_0xe44714));_0x58c334(_0xe44714);})[_0x4b5d('0x1f')](function(_0x2015c0){logger[_0x4b5d('0x17')](_0x4b5d('0x19'),_0x2015c0[_0x4b5d('0x18')],_0xf57e81);_0x55bcb4(_0x226f75[_0x4b5d('0x17')](0x1f4,_0x2015c0[_0x4b5d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7288912..8230d1f 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 _0x885a=['save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa885('0x0'),_0xa885('0x1'),_0xa885('0x2')];function createListener(_0x2e4bc8,_0x573a2b){return function(_0xcf0656){_0x573a2b[_0xa885('0x3')](_0x2e4bc8,_0xcf0656);};}function removeListener(_0x2386ec,_0x106e16){return function(){UserVoiceQueueRtEvents[_0xa885('0x4')](_0x2386ec,_0x106e16);};}exports[_0xa885('0x5')]=function(_0x5dfd7e){for(var _0x7ac6bd=0x0,_0x1200c7=events[_0xa885('0x6')];_0x7ac6bd<_0x1200c7;_0x7ac6bd++){var _0x546175=events[_0x7ac6bd];var _0x6b26e2=createListener(_0xa885('0x7')+_0x546175,_0x5dfd7e);UserVoiceQueueRtEvents['on'](_0x546175,_0x6b26e2);}}; \ No newline at end of file +var _0xfafd=['removeListener','register','length','userVoiceQueueRt:','save','remove','update','emit'];(function(_0x586785,_0xcc58db){var _0x467e96=function(_0x44c899){while(--_0x44c899){_0x586785['push'](_0x586785['shift']());}};_0x467e96(++_0xcc58db);}(_0xfafd,0xcc));var _0xdfaf=function(_0x5961ba,_0x1efd36){_0x5961ba=_0x5961ba-0x0;var _0x43d1d7=_0xfafd[_0x5961ba];return _0x43d1d7;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xdfaf('0x0'),_0xdfaf('0x1'),_0xdfaf('0x2')];function createListener(_0x3c7fd6,_0x2c31c9){return function(_0x28f37e){_0x2c31c9[_0xdfaf('0x3')](_0x3c7fd6,_0x28f37e);};}function removeListener(_0x2ca36c,_0x7e3bc7){return function(){UserVoiceQueueRtEvents[_0xdfaf('0x4')](_0x2ca36c,_0x7e3bc7);};}exports[_0xdfaf('0x5')]=function(_0x2ac56f){for(var _0x3b455a=0x0,_0x3bbc49=events[_0xdfaf('0x6')];_0x3b455a<_0x3bbc49;_0x3b455a++){var _0x57fcb8=events[_0x3b455a];var _0x19f205=createListener(_0xdfaf('0x7')+_0x57fcb8,_0x2ac56f);UserVoiceQueueRtEvents['on'](_0x57fcb8,_0x19f205);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 80b7377..ccc012e 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x14311a,_0x4fa562){var _0x4b798b=function(_0x5b3a89){while(--_0x5b3a89){_0x14311a['push'](_0x14311a['shift']());}};_0x4b798b(++_0x4fa562);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x11fb16,_0x29a381){var _0x343de1=function(_0x4a69f7){while(--_0x4a69f7){_0x11fb16['push'](_0x11fb16['shift']());}};_0x343de1(++_0x29a381);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index c42fb05..b598e92 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 _0x66d6=['sequelize','exports','INTEGER'];(function(_0x50f7b5,_0x42c733){var _0x2774fd=function(_0xa4b47a){while(--_0xa4b47a){_0x50f7b5['push'](_0x50f7b5['shift']());}};_0x2774fd(++_0x42c733);}(_0x66d6,0x1ad));var _0x666d=function(_0x51991f,_0x3e2f25){_0x51991f=_0x51991f-0x0;var _0x40c6f0=_0x66d6[_0x51991f];return _0x40c6f0;};'use strict';var Sequelize=require(_0x666d('0x0'));module[_0x666d('0x1')]={'penalty':{'type':Sequelize[_0x666d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1c1d=['INTEGER'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x1c1d,0x116));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xd1c1('0x0')],'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 ff44a9e..fc5cd35 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 _0xf2b4=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x1d7e28,_0x32e7f8){var _0x54edf8=function(_0x1b4c7e){while(--_0x1b4c7e){_0x1d7e28['push'](_0x1d7e28['shift']());}};_0x54edf8(++_0x32e7f8);}(_0xf2b4,0x17e));var _0x4f2b=function(_0x4a9f36,_0x7a92a1){_0x4a9f36=_0x4a9f36-0x0;var _0x4097ee=_0xf2b4[_0x4a9f36];return _0x4097ee;};'use strict';var _=require(_0x4f2b('0x0'));var util=require(_0x4f2b('0x1'));var logger=require(_0x4f2b('0x2'))(_0x4f2b('0x3'));var moment=require(_0x4f2b('0x4'));var BPromise=require('bluebird');var rp=require(_0x4f2b('0x5'));var fs=require('fs');var path=require(_0x4f2b('0x6'));var rimraf=require(_0x4f2b('0x7'));var config=require(_0x4f2b('0x8'));var attributes=require(_0x4f2b('0x9'));module[_0x4f2b('0xa')]=function(_0x337f23,_0x4418f5){return _0x337f23[_0x4f2b('0xb')](_0x4f2b('0xc'),attributes,{'tableName':_0x4f2b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fd1=['api','moment','bluebird','request-promise','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fd1,0xbd));var _0x17fd=function(_0x1252ae,_0x32598d){_0x1252ae=_0x1252ae-0x0;var _0x3ed1dc=_0x7fd1[_0x1252ae];return _0x3ed1dc;};'use strict';var _=require(_0x17fd('0x0'));var util=require(_0x17fd('0x1'));var logger=require(_0x17fd('0x2'))(_0x17fd('0x3'));var moment=require(_0x17fd('0x4'));var BPromise=require(_0x17fd('0x5'));var rp=require(_0x17fd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17fd('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x17fd('0x8')]=function(_0x4764ff,_0x1196f3){return _0x4764ff[_0x17fd('0x9')](_0x17fd('0xa'),attributes,{'tableName':_0x17fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index f9b7495..7254ce2 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 _0x50c1=['stringify','error','code','message','result','catch','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x50c1,0xa6));var _0x150c=function(_0x1123ad,_0xede2f3){_0x1123ad=_0x1123ad-0x0;var _0x5c02a0=_0x50c1[_0x1123ad];return _0x5c02a0;};'use strict';var _=require(_0x150c('0x0'));var util=require('util');var moment=require(_0x150c('0x1'));var BPromise=require(_0x150c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x150c('0x3'))(_0x150c('0x4'));var config=require(_0x150c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x150c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14e0c7,_0x30d435,_0x2c9c13){return new BPromise(function(_0x550d2c,_0x403cc0){return client[_0x150c('0x7')](_0x14e0c7,_0x2c9c13)[_0x150c('0x8')](function(_0x3e62c6){logger[_0x150c('0x9')](_0x150c('0xa'),_0x30d435,_0x150c('0xb'));logger[_0x150c('0xc')](_0x150c('0xd'),_0x30d435,_0x150c('0xb'),JSON[_0x150c('0xe')](_0x3e62c6));if(_0x3e62c6[_0x150c('0xf')]){if(_0x3e62c6[_0x150c('0xf')][_0x150c('0x10')]===0x1f4){logger['error'](_0x150c('0xa'),_0x30d435,_0x3e62c6[_0x150c('0xf')][_0x150c('0x11')]);return _0x403cc0(_0x3e62c6[_0x150c('0xf')][_0x150c('0x11')]);}logger[_0x150c('0xf')](_0x150c('0xa'),_0x30d435,_0x3e62c6['error'][_0x150c('0x11')]);return _0x550d2c(_0x3e62c6[_0x150c('0xf')][_0x150c('0x11')]);}else{logger[_0x150c('0x9')]('UserWhatsappQueue,\x20%s,\x20%s',_0x30d435,_0x150c('0xb'));_0x550d2c(_0x3e62c6[_0x150c('0x12')]['message']);}})[_0x150c('0x13')](function(_0x1cdfdf){logger[_0x150c('0xf')](_0x150c('0xa'),_0x30d435,_0x1cdfdf);_0x403cc0(_0x1cdfdf);});});} \ No newline at end of file +var _0x9d96=['code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x1c0bad,_0x2e9bb6){var _0x2348e3=function(_0x199b2d){while(--_0x199b2d){_0x1c0bad['push'](_0x1c0bad['shift']());}};_0x2348e3(++_0x2e9bb6);}(_0x9d96,0x1a5));var _0x69d9=function(_0x6ab2bb,_0x48dd89){_0x6ab2bb=_0x6ab2bb-0x0;var _0x2d1aba=_0x9d96[_0x6ab2bb];return _0x2d1aba;};'use strict';var _=require('lodash');var util=require(_0x69d9('0x0'));var moment=require(_0x69d9('0x1'));var BPromise=require(_0x69d9('0x2'));var rs=require(_0x69d9('0x3'));var fs=require('fs');var Redis=require(_0x69d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x69d9('0x5'));var logger=require(_0x69d9('0x6'))('rpc');var config=require(_0x69d9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x69d9('0x8')][_0x69d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8704f9,_0x2e8f35,_0x35e3c6){return new BPromise(function(_0x4348fc,_0x110cc2){return client['request'](_0x8704f9,_0x35e3c6)['then'](function(_0x1b09c0){logger[_0x69d9('0xa')](_0x69d9('0xb'),_0x2e8f35,_0x69d9('0xc'));logger[_0x69d9('0xd')](_0x69d9('0xe'),_0x2e8f35,_0x69d9('0xc'),JSON['stringify'](_0x1b09c0));if(_0x1b09c0['error']){if(_0x1b09c0[_0x69d9('0xf')][_0x69d9('0x10')]===0x1f4){logger[_0x69d9('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2e8f35,_0x1b09c0[_0x69d9('0xf')]['message']);return _0x110cc2(_0x1b09c0[_0x69d9('0xf')][_0x69d9('0x11')]);}logger[_0x69d9('0xf')](_0x69d9('0xb'),_0x2e8f35,_0x1b09c0[_0x69d9('0xf')][_0x69d9('0x11')]);return _0x4348fc(_0x1b09c0[_0x69d9('0xf')][_0x69d9('0x11')]);}else{logger[_0x69d9('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2e8f35,_0x69d9('0xc'));_0x4348fc(_0x1b09c0[_0x69d9('0x12')][_0x69d9('0x11')]);}})['catch'](function(_0x5a0996){logger[_0x69d9('0xf')](_0x69d9('0xb'),_0x2e8f35,_0x5a0996);_0x110cc2(_0x5a0996);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 51c1b76..9cdf6cc 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 _0x03bc=['create','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x5d5011,_0x4a30cf){var _0x1faf6c=function(_0x51e4eb){while(--_0x51e4eb){_0x5d5011['push'](_0x5d5011['shift']());}};_0x1faf6c(++_0x4a30cf);}(_0x03bc,0xb8));var _0xc03b=function(_0x29d81f,_0x2bf489){_0x29d81f=_0x29d81f-0x0;var _0x54c8ac=_0x03bc[_0x29d81f];return _0x54c8ac;};'use strict';var multer=require(_0xc03b('0x0'));var util=require('util');var path=require(_0xc03b('0x1'));var timeout=require(_0xc03b('0x2'));var express=require('express');var router=express[_0xc03b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc03b('0x4'));var interaction=require(_0xc03b('0x5'));var config=require(_0xc03b('0x6'));var controller=require(_0xc03b('0x7'));router[_0xc03b('0x8')]('/',auth['isAuthenticated'](),controller[_0xc03b('0x9')]);router['get'](_0xc03b('0xa'),auth[_0xc03b('0xb')](),controller[_0xc03b('0xc')]);router[_0xc03b('0xd')]('/',auth[_0xc03b('0xb')](),controller[_0xc03b('0xe')]);router[_0xc03b('0xf')](_0xc03b('0xa'),auth['isAuthenticated'](),controller[_0xc03b('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc03b('0x11')]=router; \ No newline at end of file +var _0x2208=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','util','connect-timeout','Router'];(function(_0x174bf9,_0x59c1c7){var _0x8f9999=function(_0x31de0a){while(--_0x31de0a){_0x174bf9['push'](_0x174bf9['shift']());}};_0x8f9999(++_0x59c1c7);}(_0x2208,0x11e));var _0x8220=function(_0x5c625b,_0x4e0c46){_0x5c625b=_0x5c625b-0x0;var _0x42c7eb=_0x2208[_0x5c625b];return _0x42c7eb;};'use strict';var multer=require('multer');var util=require(_0x8220('0x0'));var path=require('path');var timeout=require(_0x8220('0x1'));var express=require('express');var router=express[_0x8220('0x2')]();var fs_extra=require(_0x8220('0x3'));var auth=require(_0x8220('0x4'));var interaction=require(_0x8220('0x5'));var config=require(_0x8220('0x6'));var controller=require(_0x8220('0x7'));router['get']('/',auth[_0x8220('0x8')](),controller['index']);router[_0x8220('0x9')](_0x8220('0xa'),auth[_0x8220('0x8')](),controller[_0x8220('0xb')]);router[_0x8220('0xc')]('/',auth[_0x8220('0x8')](),controller['create']);router[_0x8220('0xd')](_0x8220('0xa'),auth['isAuthenticated'](),controller[_0x8220('0xe')]);router[_0x8220('0xf')](_0x8220('0xa'),auth[_0x8220('0x8')](),controller[_0x8220('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 3833b4a..c6e9679 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 _0x5b91=['sequelize','exports','STRING','name'];(function(_0x25effb,_0x43bf70){var _0x26d900=function(_0x202648){while(--_0x202648){_0x25effb['push'](_0x25effb['shift']());}};_0x26d900(++_0x43bf70);}(_0x5b91,0x128));var _0x15b9=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0x5b91[_0x151721];return _0x2deaa7;};'use strict';var Sequelize=require(_0x15b9('0x0'));module[_0x15b9('0x1')]={'name':{'type':Sequelize[_0x15b9('0x2')],'unique':_0x15b9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x15b9('0x2')]}}; \ No newline at end of file +var _0xb85f=['exports','STRING','name'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb85f,0x132));var _0xfb85=function(_0x19e589,_0x55f814){_0x19e589=_0x19e589-0x0;var _0x56ab5c=_0xb85f[_0x19e589];return _0x56ab5c;};'use strict';var Sequelize=require('sequelize');module[_0xfb85('0x0')]={'name':{'type':Sequelize[_0xfb85('0x1')],'unique':_0xfb85('0x2'),'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 546a311..c448377 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 _0x212f=['findAll','rows','show','include','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','send','Variable','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x3b4a6c,_0x5721d6){var _0xa9768b=function(_0x2a6584){while(--_0x2a6584){_0x3b4a6c['push'](_0x3b4a6c['shift']());}};_0xa9768b(++_0x5721d6);}(_0x212f,0x160));var _0xf212=function(_0x3dadc6,_0x129208){_0x3dadc6=_0x3dadc6-0x0;var _0x3994fb=_0x212f[_0x3dadc6];return _0x3994fb;};'use strict';var emlformat=require(_0xf212('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf212('0x1'));var jsonpatch=require(_0xf212('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf212('0x3'));var Mustache=require(_0xf212('0x4'));var util=require(_0xf212('0x5'));var path=require(_0xf212('0x6'));var sox=require(_0xf212('0x7'));var csv=require(_0xf212('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf212('0x9'));var _=require(_0xf212('0xa'));var squel=require(_0xf212('0xb'));var crypto=require(_0xf212('0xc'));var jsforce=require(_0xf212('0xd'));var deskjs=require(_0xf212('0xe'));var toCsv=require(_0xf212('0x8'));var querystring=require(_0xf212('0xf'));var Papa=require('papaparse');var Redis=require(_0xf212('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf212('0x11'));var as=require(_0xf212('0x12'));var hardwareService=require(_0xf212('0x13'));var logger=require('../../config/logger')(_0xf212('0x14'));var utils=require(_0xf212('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf212('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d3c1a,_0x5236d2){_0x5236d2=_0x5236d2||0xcc;return function(_0x40239c){if(_0x40239c){return _0x1d3c1a[_0xf212('0x17')](_0x5236d2);}return _0x1d3c1a[_0xf212('0x18')](_0x5236d2)[_0xf212('0x19')]();};}function respondWithResult(_0xb798b,_0xf22795){_0xf22795=_0xf22795||0xc8;return function(_0x3c180c){if(_0x3c180c){return _0xb798b[_0xf212('0x18')](_0xf22795)[_0xf212('0x1a')](_0x3c180c);}};}function respondWithFilteredResult(_0x39f63a,_0x14a474){return function(_0x1ecef1){if(_0x1ecef1){var _0x32b5d7=typeof _0x14a474['offset']==='undefined'&&typeof _0x14a474[_0xf212('0x1b')]===_0xf212('0x1c');var _0x116c5c=_0x1ecef1['count'];var _0x558ac5=_0x32b5d7?0x0:_0x14a474[_0xf212('0x1d')];var _0x4cb61d=_0x32b5d7?_0x1ecef1[_0xf212('0x1e')]:_0x14a474[_0xf212('0x1d')]+_0x14a474[_0xf212('0x1b')];var _0x2e39dd;if(_0x4cb61d>=_0x116c5c){_0x4cb61d=_0x116c5c;_0x2e39dd=0xc8;}else{_0x2e39dd=0xce;}_0x39f63a[_0xf212('0x18')](_0x2e39dd);return _0x39f63a[_0xf212('0x1f')](_0xf212('0x20'),_0x558ac5+'-'+_0x4cb61d+'/'+_0x116c5c)[_0xf212('0x1a')](_0x1ecef1);}return null;};}function patchUpdates(_0x54b53c){return function(_0x3f67ca){try{jsonpatch[_0xf212('0x21')](_0x3f67ca,_0x54b53c,!![]);}catch(_0x19175f){return BPromise[_0xf212('0x22')](_0x19175f);}return _0x3f67ca['save']();};}function saveUpdates(_0x3f8536,_0x1ff784){return function(_0x5d70a2){if(_0x5d70a2){return _0x5d70a2[_0xf212('0x23')](_0x3f8536)[_0xf212('0x24')](function(_0x39d44f){return _0x39d44f;});}return null;};}function removeEntity(_0x16c6b3,_0x133475){return function(_0x1e71d1){if(_0x1e71d1){return _0x1e71d1['destroy']()[_0xf212('0x24')](function(){var _0x25b2be=_0x1e71d1[_0xf212('0x25')]({'plain':!![]});var _0x55aa26=_0xf212('0x26');return db[_0xf212('0x27')][_0xf212('0x28')]({'where':{'type':_0x55aa26,'resourceId':_0x25b2be['id']}})[_0xf212('0x24')](function(){return _0x1e71d1;});})['then'](function(){_0x16c6b3['status'](0xcc)[_0xf212('0x19')]();});}};}function handleEntityNotFound(_0x4a5b8a,_0x5139e9){return function(_0x48a485){if(!_0x48a485){_0x4a5b8a[_0xf212('0x17')](0x194);}return _0x48a485;};}function handleError(_0x1f60ed,_0x59ae62){_0x59ae62=_0x59ae62||0x1f4;return function(_0x1be8b8){logger[_0xf212('0x29')](_0x1be8b8[_0xf212('0x2a')]);if(_0x1be8b8[_0xf212('0x2b')]){delete _0x1be8b8[_0xf212('0x2b')];}_0x1f60ed[_0xf212('0x18')](_0x59ae62)[_0xf212('0x2c')](_0x1be8b8);};}exports['index']=function(_0x4c5004,_0x21cbd7){var _0x72c0ef={},_0x2f926c={},_0x50b863={'count':0x0,'rows':[]};var _0x3696f1=_['map'](db[_0xf212('0x2d')][_0xf212('0x2e')],function(_0x135be0){return{'name':_0x135be0[_0xf212('0x2f')],'type':_0x135be0[_0xf212('0x30')][_0xf212('0x31')]};});_0x2f926c[_0xf212('0x32')]=_[_0xf212('0x33')](_0x3696f1,'name');_0x2f926c['query']=_[_0xf212('0x34')](_0x4c5004[_0xf212('0x35')]);_0x2f926c[_0xf212('0x36')]=_[_0xf212('0x37')](_0x2f926c['model'],_0x2f926c['query']);_0x72c0ef[_0xf212('0x38')]=_[_0xf212('0x37')](_0x2f926c[_0xf212('0x32')],qs['fields'](_0x4c5004[_0xf212('0x35')][_0xf212('0x39')]));_0x72c0ef[_0xf212('0x38')]=_0x72c0ef[_0xf212('0x38')][_0xf212('0x3a')]?_0x72c0ef['attributes']:_0x2f926c[_0xf212('0x32')];if(!_0x4c5004[_0xf212('0x35')][_0xf212('0x3b')](_0xf212('0x3c'))){_0x72c0ef[_0xf212('0x1b')]=qs[_0xf212('0x1b')](_0x4c5004[_0xf212('0x35')][_0xf212('0x1b')]);_0x72c0ef[_0xf212('0x1d')]=qs[_0xf212('0x1d')](_0x4c5004[_0xf212('0x35')][_0xf212('0x1d')]);}_0x72c0ef[_0xf212('0x3d')]=qs[_0xf212('0x3e')](_0x4c5004[_0xf212('0x35')][_0xf212('0x3e')]);_0x72c0ef['where']=qs[_0xf212('0x36')](_[_0xf212('0x3f')](_0x4c5004[_0xf212('0x35')],_0x2f926c[_0xf212('0x36')]),_0x3696f1);if(_0x4c5004[_0xf212('0x35')][_0xf212('0x40')]){_0x72c0ef[_0xf212('0x41')]=_[_0xf212('0x42')](_0x72c0ef[_0xf212('0x41')],{'$or':_[_0xf212('0x33')](_0x3696f1,function(_0x242fb8){if(_0x242fb8[_0xf212('0x30')]!==_0xf212('0x43')){var _0x1d5172={};_0x1d5172[_0x242fb8[_0xf212('0x2b')]]={'$like':'%'+_0x4c5004[_0xf212('0x35')][_0xf212('0x40')]+'%'};return _0x1d5172;}})});}_0x72c0ef=_['merge']({},_0x72c0ef,_0x4c5004['options']);var _0x55dc3c={'where':_0x72c0ef[_0xf212('0x41')]};return db[_0xf212('0x2d')][_0xf212('0x1e')](_0x55dc3c)['then'](function(_0x5ace53){_0x50b863[_0xf212('0x1e')]=_0x5ace53;if(_0x4c5004[_0xf212('0x35')]['includeAll']){_0x72c0ef['include']=[{'all':!![]}];}return db[_0xf212('0x2d')][_0xf212('0x44')](_0x72c0ef);})['then'](function(_0x6fbba5){_0x50b863[_0xf212('0x45')]=_0x6fbba5;return _0x50b863;})[_0xf212('0x24')](respondWithFilteredResult(_0x21cbd7,_0x72c0ef))['catch'](handleError(_0x21cbd7,null));};exports[_0xf212('0x46')]=function(_0x31247f,_0x4c660a){var _0x225ce0={'raw':!![],'where':{'id':_0x31247f['params']['id']}},_0x304134={};_0x304134[_0xf212('0x32')]=_[_0xf212('0x34')](db['Variable'][_0xf212('0x2e')]);_0x304134['query']=_[_0xf212('0x34')](_0x31247f['query']);_0x304134[_0xf212('0x36')]=_['intersection'](_0x304134[_0xf212('0x32')],_0x304134[_0xf212('0x35')]);_0x225ce0[_0xf212('0x38')]=_['intersection'](_0x304134[_0xf212('0x32')],qs[_0xf212('0x39')](_0x31247f['query'][_0xf212('0x39')]));_0x225ce0['attributes']=_0x225ce0[_0xf212('0x38')][_0xf212('0x3a')]?_0x225ce0[_0xf212('0x38')]:_0x304134[_0xf212('0x32')];if(_0x31247f[_0xf212('0x35')]['includeAll']){_0x225ce0[_0xf212('0x47')]=[{'all':!![]}];}_0x225ce0=_[_0xf212('0x42')]({},_0x225ce0,_0x31247f[_0xf212('0x48')]);return db['Variable'][_0xf212('0x49')](_0x225ce0)[_0xf212('0x24')](handleEntityNotFound(_0x4c660a,null))[_0xf212('0x24')](respondWithResult(_0x4c660a,null))[_0xf212('0x4a')](handleError(_0x4c660a,null));};exports['create']=function(_0x52c429,_0x259be7){return db[_0xf212('0x2d')][_0xf212('0x4b')](_0x52c429[_0xf212('0x4c')],{})['then'](function(_0xa21816){var _0x25f43c=_0x52c429[_0xf212('0x4d')]['get']({'plain':!![]});if(!_0x25f43c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25f43c[_0xf212('0x4e')]===_0xf212('0x4d')){var _0x472683=_0xa21816[_0xf212('0x25')]({'plain':!![]});var _0x4923d7='Variables';return db[_0xf212('0x4f')][_0xf212('0x49')]({'where':{'name':_0x4923d7,'userProfileId':_0x25f43c[_0xf212('0x50')]},'raw':!![]})[_0xf212('0x24')](function(_0x3b61ce){if(_0x3b61ce&&_0x3b61ce[_0xf212('0x51')]===0x0){return db['UserProfileResource'][_0xf212('0x4b')]({'name':_0x472683['name'],'resourceId':_0x472683['id'],'type':_0x3b61ce[_0xf212('0x2b')],'sectionId':_0x3b61ce['id']},{})[_0xf212('0x24')](function(){return _0xa21816;});}else{return _0xa21816;}})['catch'](function(_0x2d9965){logger[_0xf212('0x29')](_0xf212('0x52'),_0x2d9965);throw _0x2d9965;});}return _0xa21816;})[_0xf212('0x24')](respondWithResult(_0x259be7,0xc9))['catch'](handleError(_0x259be7,null));};exports['update']=function(_0x203a9d,_0x44d196){if(_0x203a9d[_0xf212('0x4c')]['id']){delete _0x203a9d[_0xf212('0x4c')]['id'];}return db[_0xf212('0x2d')][_0xf212('0x49')]({'where':{'id':_0x203a9d[_0xf212('0x53')]['id']}})['then'](handleEntityNotFound(_0x44d196,null))[_0xf212('0x24')](saveUpdates(_0x203a9d[_0xf212('0x4c')],null))[_0xf212('0x24')](respondWithResult(_0x44d196,null))[_0xf212('0x4a')](handleError(_0x44d196,null));};exports[_0xf212('0x28')]=function(_0x2df2f7,_0x4d4581){return db[_0xf212('0x2d')][_0xf212('0x49')]({'where':{'id':_0x2df2f7[_0xf212('0x53')]['id']}})[_0xf212('0x24')](handleEntityNotFound(_0x4d4581,null))['then'](removeEntity(_0x4d4581,null))[_0xf212('0x4a')](handleError(_0x4d4581,null));}; \ No newline at end of file +var _0xa682=['stack','name','send','index','map','Variable','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','include','findAll','show','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','Variables','UserProfileResource','end','error'];(function(_0xfeba09,_0x21ac17){var _0x3cfecc=function(_0x112660){while(--_0x112660){_0xfeba09['push'](_0xfeba09['shift']());}};_0x3cfecc(++_0x21ac17);}(_0xa682,0x126));var _0x2a68=function(_0x22b742,_0x5ad8bc){_0x22b742=_0x22b742-0x0;var _0x34e8ff=_0xa682[_0x22b742];return _0x34e8ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a68('0x0'));var zipdir=require(_0x2a68('0x1'));var jsonpatch=require(_0x2a68('0x2'));var rp=require(_0x2a68('0x3'));var moment=require('moment');var BPromise=require(_0x2a68('0x4'));var Mustache=require('mustache');var util=require(_0x2a68('0x5'));var path=require(_0x2a68('0x6'));var sox=require(_0x2a68('0x7'));var csv=require(_0x2a68('0x8'));var ejs=require(_0x2a68('0x9'));var fs=require('fs');var fs_extra=require(_0x2a68('0xa'));var _=require(_0x2a68('0xb'));var squel=require(_0x2a68('0xc'));var crypto=require(_0x2a68('0xd'));var jsforce=require(_0x2a68('0xe'));var deskjs=require(_0x2a68('0xf'));var toCsv=require(_0x2a68('0x8'));var querystring=require(_0x2a68('0x10'));var Papa=require(_0x2a68('0x11'));var Redis=require(_0x2a68('0x12'));var authService=require(_0x2a68('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a68('0x14'));var logger=require(_0x2a68('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2a68('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce1ab5,_0x2fcfa9){_0x2fcfa9=_0x2fcfa9||0xcc;return function(_0x4eac1f){if(_0x4eac1f){return _0xce1ab5[_0x2a68('0x17')](_0x2fcfa9);}return _0xce1ab5['status'](_0x2fcfa9)['end']();};}function respondWithResult(_0x140d40,_0x20b862){_0x20b862=_0x20b862||0xc8;return function(_0x847e8a){if(_0x847e8a){return _0x140d40['status'](_0x20b862)[_0x2a68('0x18')](_0x847e8a);}};}function respondWithFilteredResult(_0x29f2a3,_0x4a4616){return function(_0x22646f){if(_0x22646f){var _0x2fd326=typeof _0x4a4616[_0x2a68('0x19')]==='undefined'&&typeof _0x4a4616['limit']===_0x2a68('0x1a');var _0xa79f28=_0x22646f[_0x2a68('0x1b')];var _0x34604f=_0x2fd326?0x0:_0x4a4616[_0x2a68('0x19')];var _0x5bf23d=_0x2fd326?_0x22646f['count']:_0x4a4616[_0x2a68('0x19')]+_0x4a4616[_0x2a68('0x1c')];var _0x3d10a2;if(_0x5bf23d>=_0xa79f28){_0x5bf23d=_0xa79f28;_0x3d10a2=0xc8;}else{_0x3d10a2=0xce;}_0x29f2a3[_0x2a68('0x1d')](_0x3d10a2);return _0x29f2a3[_0x2a68('0x1e')](_0x2a68('0x1f'),_0x34604f+'-'+_0x5bf23d+'/'+_0xa79f28)[_0x2a68('0x18')](_0x22646f);}return null;};}function patchUpdates(_0x288d69){return function(_0x5818a4){try{jsonpatch[_0x2a68('0x20')](_0x5818a4,_0x288d69,!![]);}catch(_0x73ea03){return BPromise[_0x2a68('0x21')](_0x73ea03);}return _0x5818a4[_0x2a68('0x22')]();};}function saveUpdates(_0xf48c08,_0x1ffb17){return function(_0x1ccdf2){if(_0x1ccdf2){return _0x1ccdf2[_0x2a68('0x23')](_0xf48c08)[_0x2a68('0x24')](function(_0x42a0d0){return _0x42a0d0;});}return null;};}function removeEntity(_0x4397c8,_0x4a3fb1){return function(_0x5736d5){if(_0x5736d5){return _0x5736d5[_0x2a68('0x25')]()[_0x2a68('0x24')](function(){var _0x1e1db3=_0x5736d5['get']({'plain':!![]});var _0x28b197=_0x2a68('0x26');return db[_0x2a68('0x27')][_0x2a68('0x25')]({'where':{'type':_0x28b197,'resourceId':_0x1e1db3['id']}})['then'](function(){return _0x5736d5;});})['then'](function(){_0x4397c8['status'](0xcc)[_0x2a68('0x28')]();});}};}function handleEntityNotFound(_0x23ab92,_0x441f3d){return function(_0x4865f7){if(!_0x4865f7){_0x23ab92[_0x2a68('0x17')](0x194);}return _0x4865f7;};}function handleError(_0x2dd1b8,_0x2887d9){_0x2887d9=_0x2887d9||0x1f4;return function(_0x3e8a26){logger[_0x2a68('0x29')](_0x3e8a26[_0x2a68('0x2a')]);if(_0x3e8a26[_0x2a68('0x2b')]){delete _0x3e8a26[_0x2a68('0x2b')];}_0x2dd1b8[_0x2a68('0x1d')](_0x2887d9)[_0x2a68('0x2c')](_0x3e8a26);};}exports[_0x2a68('0x2d')]=function(_0x5d601a,_0x36e963){var _0x50fcce={},_0x4f0d58={},_0x5465c5={'count':0x0,'rows':[]};var _0x510c46=_[_0x2a68('0x2e')](db[_0x2a68('0x2f')]['rawAttributes'],function(_0x34382c){return{'name':_0x34382c[_0x2a68('0x30')],'type':_0x34382c[_0x2a68('0x31')][_0x2a68('0x32')]};});_0x4f0d58[_0x2a68('0x33')]=_[_0x2a68('0x2e')](_0x510c46,_0x2a68('0x2b'));_0x4f0d58['query']=_[_0x2a68('0x34')](_0x5d601a[_0x2a68('0x35')]);_0x4f0d58['filters']=_[_0x2a68('0x36')](_0x4f0d58[_0x2a68('0x33')],_0x4f0d58['query']);_0x50fcce[_0x2a68('0x37')]=_['intersection'](_0x4f0d58['model'],qs[_0x2a68('0x38')](_0x5d601a['query']['fields']));_0x50fcce[_0x2a68('0x37')]=_0x50fcce[_0x2a68('0x37')][_0x2a68('0x39')]?_0x50fcce[_0x2a68('0x37')]:_0x4f0d58[_0x2a68('0x33')];if(!_0x5d601a[_0x2a68('0x35')][_0x2a68('0x3a')](_0x2a68('0x3b'))){_0x50fcce[_0x2a68('0x1c')]=qs[_0x2a68('0x1c')](_0x5d601a['query'][_0x2a68('0x1c')]);_0x50fcce[_0x2a68('0x19')]=qs[_0x2a68('0x19')](_0x5d601a[_0x2a68('0x35')][_0x2a68('0x19')]);}_0x50fcce[_0x2a68('0x3c')]=qs['sort'](_0x5d601a[_0x2a68('0x35')][_0x2a68('0x3d')]);_0x50fcce['where']=qs[_0x2a68('0x3e')](_[_0x2a68('0x3f')](_0x5d601a[_0x2a68('0x35')],_0x4f0d58[_0x2a68('0x3e')]),_0x510c46);if(_0x5d601a[_0x2a68('0x35')][_0x2a68('0x40')]){_0x50fcce['where']=_[_0x2a68('0x41')](_0x50fcce[_0x2a68('0x42')],{'$or':_[_0x2a68('0x2e')](_0x510c46,function(_0x2e167a){if(_0x2e167a['type']!==_0x2a68('0x43')){var _0x267cb6={};_0x267cb6[_0x2e167a[_0x2a68('0x2b')]]={'$like':'%'+_0x5d601a[_0x2a68('0x35')]['filter']+'%'};return _0x267cb6;}})});}_0x50fcce=_['merge']({},_0x50fcce,_0x5d601a['options']);var _0x45a92b={'where':_0x50fcce['where']};return db[_0x2a68('0x2f')][_0x2a68('0x1b')](_0x45a92b)['then'](function(_0x429b6c){_0x5465c5['count']=_0x429b6c;if(_0x5d601a[_0x2a68('0x35')]['includeAll']){_0x50fcce[_0x2a68('0x44')]=[{'all':!![]}];}return db[_0x2a68('0x2f')][_0x2a68('0x45')](_0x50fcce);})[_0x2a68('0x24')](function(_0x1330f8){_0x5465c5['rows']=_0x1330f8;return _0x5465c5;})[_0x2a68('0x24')](respondWithFilteredResult(_0x36e963,_0x50fcce))['catch'](handleError(_0x36e963,null));};exports[_0x2a68('0x46')]=function(_0x20886e,_0x1b1f10){var _0x42ecdb={'raw':!![],'where':{'id':_0x20886e[_0x2a68('0x47')]['id']}},_0x1a8254={};_0x1a8254[_0x2a68('0x33')]=_['keys'](db[_0x2a68('0x2f')][_0x2a68('0x48')]);_0x1a8254[_0x2a68('0x35')]=_['keys'](_0x20886e['query']);_0x1a8254[_0x2a68('0x3e')]=_[_0x2a68('0x36')](_0x1a8254['model'],_0x1a8254[_0x2a68('0x35')]);_0x42ecdb['attributes']=_[_0x2a68('0x36')](_0x1a8254[_0x2a68('0x33')],qs[_0x2a68('0x38')](_0x20886e[_0x2a68('0x35')][_0x2a68('0x38')]));_0x42ecdb[_0x2a68('0x37')]=_0x42ecdb[_0x2a68('0x37')][_0x2a68('0x39')]?_0x42ecdb[_0x2a68('0x37')]:_0x1a8254['model'];if(_0x20886e[_0x2a68('0x35')]['includeAll']){_0x42ecdb[_0x2a68('0x44')]=[{'all':!![]}];}_0x42ecdb=_['merge']({},_0x42ecdb,_0x20886e[_0x2a68('0x49')]);return db[_0x2a68('0x2f')][_0x2a68('0x4a')](_0x42ecdb)['then'](handleEntityNotFound(_0x1b1f10,null))[_0x2a68('0x24')](respondWithResult(_0x1b1f10,null))[_0x2a68('0x4b')](handleError(_0x1b1f10,null));};exports[_0x2a68('0x4c')]=function(_0x2ea86a,_0x22a5fb){return db[_0x2a68('0x2f')][_0x2a68('0x4c')](_0x2ea86a[_0x2a68('0x4d')],{})[_0x2a68('0x24')](function(_0x564c2d){var _0x494126=_0x2ea86a[_0x2a68('0x4e')]['get']({'plain':!![]});if(!_0x494126)throw new Error(_0x2a68('0x4f'));if(_0x494126[_0x2a68('0x50')]===_0x2a68('0x4e')){var _0x2c3e9d=_0x564c2d[_0x2a68('0x51')]({'plain':!![]});var _0x45aba0=_0x2a68('0x26');return db['UserProfileSection'][_0x2a68('0x4a')]({'where':{'name':_0x45aba0,'userProfileId':_0x494126[_0x2a68('0x52')]},'raw':!![]})[_0x2a68('0x24')](function(_0x1027c3){if(_0x1027c3&&_0x1027c3['autoAssociation']===0x0){return db[_0x2a68('0x27')]['create']({'name':_0x2c3e9d[_0x2a68('0x2b')],'resourceId':_0x2c3e9d['id'],'type':_0x1027c3[_0x2a68('0x2b')],'sectionId':_0x1027c3['id']},{})[_0x2a68('0x24')](function(){return _0x564c2d;});}else{return _0x564c2d;}})[_0x2a68('0x4b')](function(_0xb3a171){logger[_0x2a68('0x29')](_0x2a68('0x53'),_0xb3a171);throw _0xb3a171;});}return _0x564c2d;})[_0x2a68('0x24')](respondWithResult(_0x22a5fb,0xc9))[_0x2a68('0x4b')](handleError(_0x22a5fb,null));};exports[_0x2a68('0x23')]=function(_0x278544,_0x3cc7a9){if(_0x278544[_0x2a68('0x4d')]['id']){delete _0x278544[_0x2a68('0x4d')]['id'];}return db['Variable'][_0x2a68('0x4a')]({'where':{'id':_0x278544[_0x2a68('0x47')]['id']}})[_0x2a68('0x24')](handleEntityNotFound(_0x3cc7a9,null))[_0x2a68('0x24')](saveUpdates(_0x278544['body'],null))['then'](respondWithResult(_0x3cc7a9,null))[_0x2a68('0x4b')](handleError(_0x3cc7a9,null));};exports[_0x2a68('0x25')]=function(_0x1012a3,_0x421d17){return db[_0x2a68('0x2f')][_0x2a68('0x4a')]({'where':{'id':_0x1012a3[_0x2a68('0x47')]['id']}})[_0x2a68('0x24')](handleEntityNotFound(_0x421d17,null))[_0x2a68('0x24')](removeEntity(_0x421d17,null))[_0x2a68('0x4b')](handleError(_0x421d17,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8c459de..d321b3c 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 _0x621f=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x621f,0x80));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf621('0x0'));var util=require(_0xf621('0x1'));var logger=require(_0xf621('0x2'))(_0xf621('0x3'));var moment=require(_0xf621('0x4'));var BPromise=require(_0xf621('0x5'));var rp=require(_0xf621('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf621('0x7'));var config=require('../../config/environment');var attributes=require(_0xf621('0x8'));module[_0xf621('0x9')]=function(_0x5a23e4,_0x4e0574){return _0x5a23e4[_0xf621('0xa')](_0xf621('0xb'),attributes,{'tableName':_0xf621('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x519b=['../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','Variable','tools_variables','lodash','util'];(function(_0x21c01f,_0x1641e4){var _0x49f9e3=function(_0x3ca03e){while(--_0x3ca03e){_0x21c01f['push'](_0x21c01f['shift']());}};_0x49f9e3(++_0x1641e4);}(_0x519b,0x111));var _0xb519=function(_0x53935f,_0xab8c3d){_0x53935f=_0x53935f-0x0;var _0xd4774e=_0x519b[_0x53935f];return _0xd4774e;};'use strict';var _=require(_0xb519('0x0'));var util=require(_0xb519('0x1'));var logger=require(_0xb519('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb519('0x3'));var rp=require(_0xb519('0x4'));var fs=require('fs');var path=require(_0xb519('0x5'));var rimraf=require('rimraf');var config=require(_0xb519('0x6'));var attributes=require('./variable.attributes');module[_0xb519('0x7')]=function(_0x14489f,_0x42c68c){return _0x14489f[_0xb519('0x8')](_0xb519('0x9'),attributes,{'tableName':_0xb519('0xa'),'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 d3f96a5..c77efb5 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x36ea79,_0x19ad3f){var _0x19ea3a=function(_0x3c8821){while(--_0x3c8821){_0x36ea79['push'](_0x36ea79['shift']());}};_0x19ea3a(++_0x19ad3f);}(_0x6aa7,0x178));var _0x76aa=function(_0x276c5c,_0x3e5c1f){_0x276c5c=_0x276c5c-0x0;var _0x1d6b23=_0x6aa7[_0x276c5c];return _0x1d6b23;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x296aeb,_0x550891){var _0x48f94f=function(_0x4e63cb){while(--_0x4e63cb){_0x296aeb['push'](_0x296aeb['shift']());}};_0x48f94f(++_0x550891);}(_0x55ca,0x126));var _0xa55c=function(_0x2c9f51,_0x2eec01){_0x2c9f51=_0x2c9f51-0x0;var _0x12abf9=_0x55ca[_0x2c9f51];return _0x12abf9;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index bf4cc7d..684cf1c 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 _0x0c2c=['index','get','/fetch','isAuthenticated','canUpdate','reset','/pull','pull','/restart','/migrations','migrations','Router','./version.controller'];(function(_0x148b59,_0x4e5c5b){var _0x2b9f56=function(_0x431e57){while(--_0x431e57){_0x148b59['push'](_0x148b59['shift']());}};_0x2b9f56(++_0x4e5c5b);}(_0x0c2c,0xb4));var _0xc0c2=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x0c2c[_0x19a49f];return _0x5351ae;};'use strict';var express=require('express');var router=express[_0xc0c2('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xc0c2('0x1'));router['get']('/',controller[_0xc0c2('0x2')]);router[_0xc0c2('0x3')](_0xc0c2('0x4'),auth[_0xc0c2('0x5')](),auth[_0xc0c2('0x6')](),controller['fetch']);router[_0xc0c2('0x3')]('/reset',auth['isAuthenticated'](),auth[_0xc0c2('0x6')](),controller[_0xc0c2('0x7')]);router[_0xc0c2('0x3')](_0xc0c2('0x8'),auth['isAuthenticated'](),auth[_0xc0c2('0x6')](),controller[_0xc0c2('0x9')]);router['get'](_0xc0c2('0xa'),auth[_0xc0c2('0x5')](),controller['restart']);router['get'](_0xc0c2('0xb'),controller[_0xc0c2('0xc')]);module['exports']=router; \ No newline at end of file +var _0xead9=['Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','reset','/pull','pull','/restart','restart','/migrations','exports','express'];(function(_0x18be96,_0x15e628){var _0x4b9baa=function(_0x2791b9){while(--_0x2791b9){_0x18be96['push'](_0x18be96['shift']());}};_0x4b9baa(++_0x15e628);}(_0xead9,0xbf));var _0x9ead=function(_0x4a503e,_0x1b4535){_0x4a503e=_0x4a503e-0x0;var _0x291740=_0xead9[_0x4a503e];return _0x291740;};'use strict';var express=require(_0x9ead('0x0'));var router=express[_0x9ead('0x1')]();var auth=require(_0x9ead('0x2'));var controller=require(_0x9ead('0x3'));router[_0x9ead('0x4')]('/',controller[_0x9ead('0x5')]);router[_0x9ead('0x4')](_0x9ead('0x6'),auth[_0x9ead('0x7')](),auth[_0x9ead('0x8')](),controller['fetch']);router[_0x9ead('0x4')]('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x9ead('0x9')]);router['get'](_0x9ead('0xa'),auth[_0x9ead('0x7')](),auth[_0x9ead('0x8')](),controller[_0x9ead('0xb')]);router[_0x9ead('0x4')](_0x9ead('0xc'),auth['isAuthenticated'](),controller[_0x9ead('0xd')]);router[_0x9ead('0x4')](_0x9ead('0xe'),controller['migrations']);module[_0x9ead('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9d53679..5350b9c 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 _0xaa75=['then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','index','exports','version','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','motion2'];(function(_0x4c2eb8,_0x331297){var _0x284044=function(_0x5ae927){while(--_0x5ae927){_0x4c2eb8['push'](_0x4c2eb8['shift']());}};_0x284044(++_0x331297);}(_0xaa75,0x165));var _0x5aa7=function(_0x3045d5,_0x447aab){_0x3045d5=_0x3045d5-0x0;var _0x1cd5ee=_0xaa75[_0x3045d5];return _0x1cd5ee;};'use strict';var Umzug=require(_0x5aa7('0x0'));var path=require(_0x5aa7('0x1'));var fs=require('fs');var _=require(_0x5aa7('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x5aa7('0x3'));var exec=require(_0x5aa7('0x4'))[_0x5aa7('0x5')];var db=require(_0x5aa7('0x6'))['db'];var config=require(_0x5aa7('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x5aa7('0x8'))('update');var git=require(_0x5aa7('0x9'))(config[_0x5aa7('0xa')]);exports[_0x5aa7('0xb')]=function(_0x50144a,_0x5d5d52){var _0x334b0a={'current':module[_0x5aa7('0xc')][_0x5aa7('0xd')],'phonebar':0x2};if(_0x50144a[_0x5aa7('0xe')]&&_0x50144a['query'][_0x5aa7('0xf')]){return git['fetch']()[_0x5aa7('0x10')](function(_0x2cf09f,_0x436821){_0x334b0a[_0x5aa7('0xf')]=(_0x2cf09f?module[_0x5aa7('0xc')][_0x5aa7('0xd')]:_0x436821[_0x5aa7('0xf')])||_0x5aa7('0x11');return _0x5d5d52[_0x5aa7('0x12')](0xc8)[_0x5aa7('0x13')](_0x334b0a);});}else{return _0x5d5d52[_0x5aa7('0x12')](0xc8)[_0x5aa7('0x13')](_0x334b0a);}};exports[_0x5aa7('0x14')]=function(_0x145f26,_0x5cbfaf){return git[_0x5aa7('0x14')]([_0x5aa7('0x15'),_0x5aa7('0x16')],function(_0x192dbd){if(_0x192dbd){logger[_0x5aa7('0x17')](_0x192dbd);return _0x5cbfaf['status'](0x1f4)[_0x5aa7('0x13')](_0x192dbd);}logger['info'](_0x5aa7('0x18'));return _0x5cbfaf[_0x5aa7('0x12')](0xc8)[_0x5aa7('0x13')]({'output':_0x5aa7('0x19')});});};exports[_0x5aa7('0x1a')]=function(_0x530a18,_0x291334){return git[_0x5aa7('0x1a')](['--hard',_0x5aa7('0x1b')],function(_0x3a9f18){if(_0x3a9f18){logger[_0x5aa7('0x17')](_0x3a9f18);return _0x291334[_0x5aa7('0x12')](0x1f4)['json'](_0x3a9f18);}logger['info'](_0x5aa7('0x1c'));return _0x291334[_0x5aa7('0x12')](0xc8)[_0x5aa7('0x13')]({'output':_0x5aa7('0x1d')});});};exports[_0x5aa7('0x1e')]=function(_0x354b40,_0x396b82){exec(_0x5aa7('0x1f'),function(_0x200cb4,_0x343811,_0x5754a0){logger[_0x5aa7('0x20')](_0x343811);logger[_0x5aa7('0x20')](_0x5754a0);if(_0x200cb4){logger[_0x5aa7('0x17')](_0x200cb4);return _0x396b82['status'](0x1f4)[_0x5aa7('0x13')](_0x200cb4);}return _0x396b82[_0x5aa7('0x12')](0xc8)[_0x5aa7('0x13')]({'output':_0x343811});});};exports[_0x5aa7('0x21')]=function(_0x1f766a,_0x5464d2){return pm2['restart'](_0x5aa7('0x22'))[_0x5aa7('0x23')](function(_0x370923){logger[_0x5aa7('0x20')](_0x5aa7('0x24'),_0x370923);return _0x5464d2[_0x5aa7('0x12')](0xc8)[_0x5aa7('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x5aa7('0x25')](function(_0xf0d23b){logger[_0x5aa7('0x17')](_0xf0d23b);return _0x5464d2[_0x5aa7('0x12')](0x1f4)['json'](_0xf0d23b);});};exports[_0x5aa7('0x26')]=function(_0x31ab5c,_0x37a426){var _0x20185a=fs[_0x5aa7('0x27')](path[_0x5aa7('0x28')](config['root'],_0x5aa7('0x29'),_0x5aa7('0x26')));var _0xaa5151=[];for(var _0x526070=0x0;_0x526070<_0x20185a[_0x5aa7('0x2a')];_0x526070++){var _0x197a91=_0x20185a[_0x526070][_0x5aa7('0x2b')](_0x5aa7('0x2c'),'');if(compareVersions(module[_0x5aa7('0xc')]['version'],_0x197a91)===-0x1){_0xaa5151[_0x5aa7('0x2d')](_0x197a91);}}if(_0xaa5151[_0x5aa7('0x2a')]){var _0x56fa3e=_0xaa5151['sort'](compareVersions);var _0x59693d=new Umzug({'storage':_0x5aa7('0x2e'),'storageOptions':{'model':db['Migration'],'modelName':_0x5aa7('0x2f'),'columnName':'version'},'migrations':{'params':[db[_0x5aa7('0x2e')][_0x5aa7('0x30')](),db[_0x5aa7('0x2e')][_0x5aa7('0x31')],function(){throw new Error(_0x5aa7('0x32'));}],'path':path[_0x5aa7('0x28')](config['root'],'server',_0x5aa7('0x26')),'pattern':/\.js$/}});_0x59693d['up']({'migrations':_[_0x5aa7('0x33')](_0x56fa3e,function(_0x38dbd1){return _0x38dbd1+_0x5aa7('0x2c');})})[_0x5aa7('0x23')](function(){return _0x37a426[_0x5aa7('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x5aa7('0xd')]+_0x5aa7('0x34')+_[_0x5aa7('0x35')](_0x56fa3e),'migrations':_[_0x5aa7('0x28')](_0x56fa3e)});})[_0x5aa7('0x25')](function(_0x73116d){if(_0x73116d instanceof db[_0x5aa7('0x2e')][_0x5aa7('0x36')]){return _0x37a426[_0x5aa7('0x12')](0xc8)['json']({'output':_0x5aa7('0x37')});}else{return _0x37a426[_0x5aa7('0x12')](0x1f4)[_0x5aa7('0x13')](_0x73116d);}});}else{return _0x37a426[_0x5aa7('0x12')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x783a=['join','server','migrations','length','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync'];(function(_0x3399bb,_0x5e7c53){var _0x1afd51=function(_0x463f5f){while(--_0x463f5f){_0x3399bb['push'](_0x3399bb['shift']());}};_0x1afd51(++_0x5e7c53);}(_0x783a,0xe8));var _0xa783=function(_0x1b3f33,_0x759610){_0x1b3f33=_0x1b3f33-0x0;var _0x5af081=_0x783a[_0x1b3f33];return _0x5af081;};'use strict';var Umzug=require(_0xa783('0x0'));var path=require(_0xa783('0x1'));var fs=require('fs');var _=require(_0xa783('0x2'));var pkginfo=require(_0xa783('0x3'))(module,_0xa783('0x4'));var compareVersions=require(_0xa783('0x5'));var exec=require(_0xa783('0x6'))['exec'];var db=require(_0xa783('0x7'))['db'];var config=require(_0xa783('0x8'));var pm2=require(_0xa783('0x9'));var logger=require('../../config/logger')('update');var git=require(_0xa783('0xa'))(config[_0xa783('0xb')]);exports[_0xa783('0xc')]=function(_0xcb4dd2,_0x29d70b){var _0x520ca1={'current':module[_0xa783('0xd')][_0xa783('0x4')],'phonebar':0x2};if(_0xcb4dd2[_0xa783('0xe')]&&_0xcb4dd2['query']['latest']){return git[_0xa783('0xf')]()[_0xa783('0x10')](function(_0x3bdaf0,_0x66a58b){_0x520ca1[_0xa783('0x11')]=(_0x3bdaf0?module[_0xa783('0xd')]['version']:_0x66a58b[_0xa783('0x11')])||_0xa783('0x12');return _0x29d70b[_0xa783('0x13')](0xc8)['json'](_0x520ca1);});}else{return _0x29d70b[_0xa783('0x13')](0xc8)[_0xa783('0x14')](_0x520ca1);}};exports[_0xa783('0xf')]=function(_0x25b2de,_0x455126){return git[_0xa783('0xf')]([_0xa783('0x15'),_0xa783('0x16')],function(_0x231cb5){if(_0x231cb5){logger[_0xa783('0x17')](_0x231cb5);return _0x455126[_0xa783('0x13')](0x1f4)[_0xa783('0x14')](_0x231cb5);}logger[_0xa783('0x18')](_0xa783('0x19'));return _0x455126[_0xa783('0x13')](0xc8)[_0xa783('0x14')]({'output':_0xa783('0x1a')});});};exports[_0xa783('0x1b')]=function(_0x3b47a2,_0x39c4e8){return git[_0xa783('0x1b')]([_0xa783('0x1c'),'FETCH_HEAD'],function(_0x24c346){if(_0x24c346){logger[_0xa783('0x17')](_0x24c346);return _0x39c4e8[_0xa783('0x13')](0x1f4)[_0xa783('0x14')](_0x24c346);}logger[_0xa783('0x18')](_0xa783('0x1d'));return _0x39c4e8[_0xa783('0x13')](0xc8)[_0xa783('0x14')]({'output':_0xa783('0x1e')});});};exports[_0xa783('0x1f')]=function(_0xe5f643,_0x4d8530){exec('npm\x20install\x20--production',function(_0xe29813,_0x37b149,_0x5765c9){logger[_0xa783('0x18')](_0x37b149);logger['info'](_0x5765c9);if(_0xe29813){logger['error'](_0xe29813);return _0x4d8530[_0xa783('0x13')](0x1f4)[_0xa783('0x14')](_0xe29813);}return _0x4d8530['status'](0xc8)['json']({'output':_0x37b149});});};exports[_0xa783('0x20')]=function(_0x541e9a,_0x307089){return pm2[_0xa783('0x20')](_0xa783('0x21'))[_0xa783('0x22')](function(_0x55bfd2){logger['info']('pm2\x20restart\x20motion\x20%s',_0x55bfd2);return _0x307089['status'](0xc8)[_0xa783('0x14')]({'output':_0xa783('0x23')});})[_0xa783('0x24')](function(_0x297a9f){logger['error'](_0x297a9f);return _0x307089[_0xa783('0x13')](0x1f4)[_0xa783('0x14')](_0x297a9f);});};exports['migrations']=function(_0x178f84,_0xd1a7fa){var _0x5a973c=fs[_0xa783('0x25')](path[_0xa783('0x26')](config[_0xa783('0xb')],_0xa783('0x27'),_0xa783('0x28')));var _0x5b3b37=[];for(var _0x482a94=0x0;_0x482a94<_0x5a973c[_0xa783('0x29')];_0x482a94++){var _0x41c193=_0x5a973c[_0x482a94]['replace'](_0xa783('0x2a'),'');if(compareVersions(module['exports'][_0xa783('0x4')],_0x41c193)===-0x1){_0x5b3b37[_0xa783('0x2b')](_0x41c193);}}if(_0x5b3b37[_0xa783('0x29')]){var _0x3be132=_0x5b3b37[_0xa783('0x2c')](compareVersions);var _0x5c55b8=new Umzug({'storage':_0xa783('0x2d'),'storageOptions':{'model':db[_0xa783('0x2e')],'modelName':_0xa783('0x2e'),'columnName':_0xa783('0x4')},'migrations':{'params':[db[_0xa783('0x2d')][_0xa783('0x2f')](),db[_0xa783('0x2d')]['constructor'],function(){throw new Error(_0xa783('0x30'));}],'path':path[_0xa783('0x26')](config[_0xa783('0xb')],'server',_0xa783('0x28')),'pattern':/\.js$/}});_0x5c55b8['up']({'migrations':_['map'](_0x3be132,function(_0x3d4aa5){return _0x3d4aa5+_0xa783('0x2a');})})[_0xa783('0x22')](function(){return _0xd1a7fa[_0xa783('0x13')](0xc8)[_0xa783('0x14')]({'output':_0xa783('0x31')+module[_0xa783('0xd')]['version']+_0xa783('0x32')+_[_0xa783('0x33')](_0x3be132),'migrations':_[_0xa783('0x26')](_0x3be132)});})['catch'](function(_0x192ce1){if(_0x192ce1 instanceof db[_0xa783('0x2d')][_0xa783('0x34')]){return _0xd1a7fa[_0xa783('0x13')](0xc8)[_0xa783('0x14')]({'output':_0xa783('0x35')});}else{return _0xd1a7fa[_0xa783('0x13')](0x1f4)[_0xa783('0x14')](_0x192ce1);}});}else{return _0xd1a7fa[_0xa783('0x13')](0xc8)[_0xa783('0x14')]({'output':_0xa783('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index c3d2efc..c71f059 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 _0x1d89=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x1d89,0x176));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x91d8('0x0'));var path=require(_0x91d8('0x1'));var timeout=require(_0x91d8('0x2'));var express=require(_0x91d8('0x3'));var router=express[_0x91d8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91d8('0x5'));var interaction=require(_0x91d8('0x6'));var config=require(_0x91d8('0x7'));var controller=require(_0x91d8('0x8'));router[_0x91d8('0x9')]('/',auth[_0x91d8('0xa')](),controller[_0x91d8('0xb')]);router['get'](_0x91d8('0xc'),auth[_0x91d8('0xa')](),controller[_0x91d8('0xd')]);router[_0x91d8('0x9')](_0x91d8('0xe'),auth['isAuthenticated'](),controller[_0x91d8('0xf')]);router[_0x91d8('0x10')]('/',auth[_0x91d8('0xa')](),controller['create']);router[_0x91d8('0x11')](_0x91d8('0xe'),auth['isAuthenticated'](),controller[_0x91d8('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x91d8('0x13')]);module[_0x91d8('0x14')]=router; \ No newline at end of file +var _0x2629=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2629,0x107));var _0x9262=function(_0x562456,_0x9ad741){_0x562456=_0x562456-0x0;var _0x46d4a9=_0x2629[_0x562456];return _0x46d4a9;};'use strict';var multer=require(_0x9262('0x0'));var util=require(_0x9262('0x1'));var path=require(_0x9262('0x2'));var timeout=require('connect-timeout');var express=require(_0x9262('0x3'));var router=express[_0x9262('0x4')]();var fs_extra=require(_0x9262('0x5'));var auth=require(_0x9262('0x6'));var interaction=require(_0x9262('0x7'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x9262('0x8')]('/',auth[_0x9262('0x9')](),controller[_0x9262('0xa')]);router['get'](_0x9262('0xb'),auth[_0x9262('0x9')](),controller[_0x9262('0xc')]);router[_0x9262('0x8')](_0x9262('0xd'),auth[_0x9262('0x9')](),controller[_0x9262('0xe')]);router[_0x9262('0xf')]('/',auth[_0x9262('0x9')](),controller['create']);router[_0x9262('0x10')](_0x9262('0xd'),auth[_0x9262('0x9')](),controller['update']);router[_0x9262('0x11')]('/:id',auth[_0x9262('0x9')](),controller[_0x9262('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 4412919..11e1b23 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 _0x7708=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x7708,0x188));var _0x8770=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x7708[_0x17c483];return _0x112bdb;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8770('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8770('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8770('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x8770('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x8770('0x3')]},'holdtime':{'type':Sequelize[_0x8770('0x4')]},'agentcomplete':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8770('0x4')]},'agentacw':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8770('0x2')]},'lastevent':{'type':Sequelize[_0x8770('0x2')]},'channel':{'type':Sequelize[_0x8770('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8770('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8770('0x2')]},'connectedlinename':{'type':Sequelize[_0x8770('0x2')]},'language':{'type':Sequelize[_0x8770('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8770('0x2')]},'exten':{'type':Sequelize[_0x8770('0x2')]},'priority':{'type':Sequelize[_0x8770('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8770('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8770('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8770('0x2')]},'destcalleridname':{'type':Sequelize[_0x8770('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8770('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8770('0x2')]},'destlanguage':{'type':Sequelize[_0x8770('0x2')]},'destaccountcode':{'type':Sequelize[_0x8770('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8770('0x2')]},'destpriority':{'type':Sequelize[_0x8770('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8770('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8770('0x2')]},'agententerreason':{'type':Sequelize[_0x8770('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1c3d=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN'];(function(_0x90b523,_0x10173e){var _0x2dfc72=function(_0x44540e){while(--_0x44540e){_0x90b523['push'](_0x90b523['shift']());}};_0x2dfc72(++_0x10173e);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0xe59404,_0xc31864){_0xe59404=_0xe59404-0x0;var _0x23a1e1=_0x1c3d[_0xe59404];return _0x23a1e1;};'use strict';var Sequelize=require('sequelize');module[_0xd1c3('0x0')]={'type':{'type':Sequelize[_0xd1c3('0x1')]},'uniqueid':{'type':Sequelize[_0xd1c3('0x1')]},'calleridnum':{'type':Sequelize[_0xd1c3('0x1')]},'calleridname':{'type':Sequelize[_0xd1c3('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd1c3('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd1c3('0x2')]},'agentconnectAt':{'type':Sequelize[_0xd1c3('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xd1c3('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd1c3('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd1c3('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd1c3('0x4')]},'agentacw':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd1c3('0x4')]},'reason':{'type':Sequelize[_0xd1c3('0x1')]},'lastevent':{'type':Sequelize[_0xd1c3('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd1c3('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd1c3('0x1')]},'connectedlinename':{'type':Sequelize[_0xd1c3('0x1')]},'language':{'type':Sequelize[_0xd1c3('0x1')]},'accountcode':{'type':Sequelize[_0xd1c3('0x1')]},'context':{'type':Sequelize[_0xd1c3('0x1')]},'exten':{'type':Sequelize[_0xd1c3('0x1')]},'priority':{'type':Sequelize[_0xd1c3('0x1')]},'destchannel':{'type':Sequelize[_0xd1c3('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd1c3('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xd1c3('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd1c3('0x1')]},'destaccountcode':{'type':Sequelize[_0xd1c3('0x1')]},'destcontext':{'type':Sequelize[_0xd1c3('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xd1c3('0x1')]},'destuniqueid':{'type':Sequelize[_0xd1c3('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd1c3('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd1c3('0x1')]},'transfer':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd1c3('0x1')],'comment':_0xd1c3('0x5')},'transferexten':{'type':Sequelize[_0xd1c3('0x1')]},'transferuniqueid':{'type':Sequelize[_0xd1c3('0x1')]},'agententerreason':{'type':Sequelize[_0xd1c3('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 8d31bdd..ec71603 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 6e3dd1b..6271ee4 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 _0x6596=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceAgentReport','destuniqueid','lodash'];(function(_0x557ac9,_0x313e13){var _0x30e5bc=function(_0x4ce033){while(--_0x4ce033){_0x557ac9['push'](_0x557ac9['shift']());}};_0x30e5bc(++_0x313e13);}(_0x6596,0x1d3));var _0x6659=function(_0x55a12d,_0x258c0f){_0x55a12d=_0x55a12d-0x0;var _0x148fd1=_0x6596[_0x55a12d];return _0x148fd1;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var logger=require('../../config/logger')(_0x6659('0x2'));var moment=require(_0x6659('0x3'));var BPromise=require(_0x6659('0x4'));var rp=require(_0x6659('0x5'));var fs=require('fs');var path=require(_0x6659('0x6'));var rimraf=require(_0x6659('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x6659('0x8')]=function(_0x3091f1,_0xd6bf59){return _0x3091f1[_0x6659('0x9')](_0x6659('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x6659('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f9=['request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1b11bf,_0x181bdc){var _0x133774=function(_0x48ae84){while(--_0x48ae84){_0x1b11bf['push'](_0x1b11bf['shift']());}};_0x133774(++_0x181bdc);}(_0xd1f9,0x88));var _0x9d1f=function(_0x3fdd09,_0x2853f7){_0x3fdd09=_0x3fdd09-0x0;var _0x2be280=_0xd1f9[_0x3fdd09];return _0x2be280;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d1f('0x0'))(_0x9d1f('0x1'));var moment=require(_0x9d1f('0x2'));var BPromise=require(_0x9d1f('0x3'));var rp=require(_0x9d1f('0x4'));var fs=require('fs');var path=require(_0x9d1f('0x5'));var rimraf=require(_0x9d1f('0x6'));var config=require(_0x9d1f('0x7'));var attributes=require(_0x9d1f('0x8'));module['exports']=function(_0x3c4bad,_0x1a72d8){return _0x3c4bad[_0x9d1f('0x9')](_0x9d1f('0xa'),attributes,{'tableName':_0x9d1f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9d1f('0xc'),_0x9d1f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1a0ced7..c1e8770 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 _0x1fe0=['http','request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s','message','request\x20sent','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','catch','UpdateVoiceAgentReport','update','raw','where','limit','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x223682,_0x1d1b74){var _0xb6ef3d=function(_0x136635){while(--_0x136635){_0x223682['push'](_0x223682['shift']());}};_0xb6ef3d(++_0x1d1b74);}(_0x1fe0,0x1b0));var _0x01fe=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x1fe0[_0x1a72f3];return _0x57ef47;};'use strict';var _=require('lodash');var util=require(_0x01fe('0x0'));var moment=require(_0x01fe('0x1'));var BPromise=require(_0x01fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01fe('0x3'));var db=require(_0x01fe('0x4'))['db'];var utils=require(_0x01fe('0x5'));var logger=require('../../config/logger')(_0x01fe('0x6'));var config=require(_0x01fe('0x7'));var jayson=require(_0x01fe('0x8'));var client=jayson[_0x01fe('0x9')][_0x01fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ba9e1,_0x372add,_0x295a83){return new BPromise(function(_0x199a32,_0x43b36e){return client[_0x01fe('0xb')](_0x1ba9e1,_0x295a83)[_0x01fe('0xc')](function(_0x5495c4){logger[_0x01fe('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x372add,'request\x20sent');logger[_0x01fe('0xe')](_0x01fe('0xf'),_0x372add,'request\x20sent',JSON['stringify'](_0x5495c4));if(_0x5495c4[_0x01fe('0x10')]){if(_0x5495c4['error'][_0x01fe('0x11')]===0x1f4){logger['error'](_0x01fe('0x12'),_0x372add,_0x5495c4['error']['message']);return _0x43b36e(_0x5495c4[_0x01fe('0x10')][_0x01fe('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x372add,_0x5495c4[_0x01fe('0x10')]['message']);return _0x199a32(_0x5495c4[_0x01fe('0x10')][_0x01fe('0x13')]);}else{logger[_0x01fe('0xd')](_0x01fe('0x12'),_0x372add,_0x01fe('0x14'));_0x199a32(_0x5495c4[_0x01fe('0x15')]['message']);}})['catch'](function(_0x23ffb0){logger[_0x01fe('0x10')](_0x01fe('0x12'),_0x372add,_0x23ffb0);_0x43b36e(_0x23ffb0);});});}exports[_0x01fe('0x16')]=function(_0x1d4abc){var _0x5c90b2=this;return new Promise(function(_0x3e69dc,_0x1c52ac){return db[_0x01fe('0x17')][_0x01fe('0x18')](_0x1d4abc[_0x01fe('0x19')],{'raw':_0x1d4abc[_0x01fe('0x1a')]?_0x1d4abc[_0x01fe('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18f0a4){logger['info'](_0x01fe('0x16'),_0x1d4abc);logger['debug'](_0x01fe('0x16'),_0x1d4abc,JSON['stringify'](_0x18f0a4));_0x3e69dc(_0x18f0a4);})[_0x01fe('0x1b')](function(_0x6d2103){logger[_0x01fe('0x10')]('CreateVoiceAgentReport',_0x6d2103[_0x01fe('0x13')],_0x1d4abc);_0x1c52ac(_0x5c90b2[_0x01fe('0x10')](0x1f4,_0x6d2103[_0x01fe('0x13')]));});});};exports[_0x01fe('0x1c')]=function(_0x20306c){var _0xc3dbd2=this;return new Promise(function(_0x28810b,_0x4faf7a){return db[_0x01fe('0x17')][_0x01fe('0x1d')](_0x20306c[_0x01fe('0x19')],{'raw':_0x20306c[_0x01fe('0x1a')]?_0x20306c['options'][_0x01fe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20306c[_0x01fe('0x1a')]?_0x20306c[_0x01fe('0x1a')][_0x01fe('0x1f')]||null:null,'attributes':_0x20306c[_0x01fe('0x1a')]?_0x20306c['options']['attributes']||null:null,'limit':_0x20306c[_0x01fe('0x1a')]?_0x20306c[_0x01fe('0x1a')][_0x01fe('0x20')]||null:null})[_0x01fe('0xc')](function(_0x191bf9){logger[_0x01fe('0xd')](_0x01fe('0x1c'),_0x20306c);logger[_0x01fe('0xe')](_0x01fe('0x1c'),_0x20306c,JSON[_0x01fe('0x21')](_0x191bf9));_0x28810b(_0x191bf9);})['catch'](function(_0x508bf9){logger['error'](_0x01fe('0x1c'),_0x508bf9['message'],_0x20306c);_0x4faf7a(_0xc3dbd2[_0x01fe('0x10')](0x1f4,_0x508bf9['message']));});});}; \ No newline at end of file +var _0x610e=['result','VoiceAgentReport','create','options','raw','CreateVoiceAgentReport','stringify','catch','update','body','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x610e,0xf5));var _0xe610=function(_0x39c895,_0x3702e1){_0x39c895=_0x39c895-0x0;var _0x1450ce=_0x610e[_0x39c895];return _0x1450ce;};'use strict';var _=require(_0xe610('0x0'));var util=require(_0xe610('0x1'));var moment=require(_0xe610('0x2'));var BPromise=require(_0xe610('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe610('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe610('0x5'))(_0xe610('0x6'));var config=require(_0xe610('0x7'));var jayson=require(_0xe610('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ade3d,_0x17f95d,_0x417a79){return new BPromise(function(_0xa67352,_0x55ef1c){return client[_0xe610('0x9')](_0x2ade3d,_0x417a79)[_0xe610('0xa')](function(_0x1ea007){logger[_0xe610('0xb')](_0xe610('0xc'),_0x17f95d,_0xe610('0xd'));logger[_0xe610('0xe')](_0xe610('0xf'),_0x17f95d,_0xe610('0xd'),JSON['stringify'](_0x1ea007));if(_0x1ea007[_0xe610('0x10')]){if(_0x1ea007[_0xe610('0x10')][_0xe610('0x11')]===0x1f4){logger['error'](_0xe610('0xc'),_0x17f95d,_0x1ea007[_0xe610('0x10')][_0xe610('0x12')]);return _0x55ef1c(_0x1ea007[_0xe610('0x10')][_0xe610('0x12')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x17f95d,_0x1ea007[_0xe610('0x10')][_0xe610('0x12')]);return _0xa67352(_0x1ea007[_0xe610('0x10')]['message']);}else{logger[_0xe610('0xb')](_0xe610('0xc'),_0x17f95d,'request\x20sent');_0xa67352(_0x1ea007[_0xe610('0x13')][_0xe610('0x12')]);}})['catch'](function(_0x5d3db5){logger[_0xe610('0x10')](_0xe610('0xc'),_0x17f95d,_0x5d3db5);_0x55ef1c(_0x5d3db5);});});}exports['CreateVoiceAgentReport']=function(_0x2f395c){var _0x359512=this;return new Promise(function(_0x1b1f9c,_0x216eb5){return db[_0xe610('0x14')][_0xe610('0x15')](_0x2f395c['body'],{'raw':_0x2f395c[_0xe610('0x16')]?_0x2f395c[_0xe610('0x16')][_0xe610('0x17')]===undefined?!![]:![]:!![]})[_0xe610('0xa')](function(_0x586929){logger[_0xe610('0xb')](_0xe610('0x18'),_0x2f395c);logger[_0xe610('0xe')](_0xe610('0x18'),_0x2f395c,JSON[_0xe610('0x19')](_0x586929));_0x1b1f9c(_0x586929);})[_0xe610('0x1a')](function(_0x549930){logger[_0xe610('0x10')](_0xe610('0x18'),_0x549930['message'],_0x2f395c);_0x216eb5(_0x359512[_0xe610('0x10')](0x1f4,_0x549930[_0xe610('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2b83bf){var _0x34f7ea=this;return new Promise(function(_0x3c5208,_0x323e00){return db[_0xe610('0x14')][_0xe610('0x1b')](_0x2b83bf[_0xe610('0x1c')],{'raw':_0x2b83bf['options']?_0x2b83bf['options'][_0xe610('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b83bf[_0xe610('0x16')]?_0x2b83bf['options'][_0xe610('0x1d')]||null:null,'attributes':_0x2b83bf[_0xe610('0x16')]?_0x2b83bf['options'][_0xe610('0x1e')]||null:null,'limit':_0x2b83bf[_0xe610('0x16')]?_0x2b83bf[_0xe610('0x16')][_0xe610('0x1f')]||null:null})[_0xe610('0xa')](function(_0x1800bc){logger[_0xe610('0xb')](_0xe610('0x20'),_0x2b83bf);logger[_0xe610('0xe')](_0xe610('0x20'),_0x2b83bf,JSON[_0xe610('0x19')](_0x1800bc));_0x3c5208(_0x1800bc);})[_0xe610('0x1a')](function(_0x1c76c6){logger[_0xe610('0x10')](_0xe610('0x20'),_0x1c76c6[_0xe610('0x12')],_0x2b83bf);_0x323e00(_0x34f7ea[_0xe610('0x10')](0x1f4,_0x1c76c6[_0xe610('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 94694fd..55c5015 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 _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x421f92,_0x3c0f19){var _0x20c2ac=function(_0x32a489){while(--_0x32a489){_0x421f92['push'](_0x421f92['shift']());}};_0x20c2ac(++_0x3c0f19);}(_0x9b67,0xf6));var _0x79b6=function(_0x5533b3,_0x4bebd0){_0x5533b3=_0x5533b3-0x0;var _0xc0d971=_0x9b67[_0x5533b3];return _0xc0d971;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8d0e=['/describe','isAuthenticated','describe','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get'];(function(_0x337b62,_0x29231a){var _0x3c60f4=function(_0x18a836){while(--_0x18a836){_0x337b62['push'](_0x337b62['shift']());}};_0x3c60f4(++_0x29231a);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5cc7fe,_0x1ba718){_0x5cc7fe=_0x5cc7fe-0x0;var _0xa8d0d4=_0x8d0e[_0x5cc7fe];return _0xa8d0d4;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0xe')]);router[_0xe8d0('0xb')](_0xe8d0('0xf'),auth[_0xe8d0('0xd')](),controller['show']);router[_0xe8d0('0x10')]('/',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x11')]);router['put']('/:id',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x12')]);router[_0xe8d0('0x13')](_0xe8d0('0xf'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a6788a2..0e4fd65 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 _0x6d3f=['exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x6d3f,0xe6));var _0xf6d3=function(_0x239cfa,_0x5c022f){_0x239cfa=_0x239cfa-0x0;var _0x4bbcbf=_0x6d3f[_0x239cfa];return _0x4bbcbf;};'use strict';var Sequelize=require(_0xf6d3('0x0'));module[_0xf6d3('0x1')]={'uniqueid':{'type':Sequelize[_0xf6d3('0x2')]},'type':{'type':Sequelize[_0xf6d3('0x3')](_0xf6d3('0x4'),_0xf6d3('0x5'),'outbound',_0xf6d3('0x6'),_0xf6d3('0x7'),_0xf6d3('0x8'))},'tag':{'type':Sequelize[_0xf6d3('0x2')]},'accountcode':{'type':Sequelize[_0xf6d3('0x2')]},'source':{'type':Sequelize[_0xf6d3('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xf6d3('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf6d3('0x2')]},'destinationchannel':{'type':Sequelize[_0xf6d3('0x2')]},'lastapplication':{'type':Sequelize[_0xf6d3('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xf6d3('0x9')]},'systemanswertime':{'type':Sequelize[_0xf6d3('0x9')]},'answertime':{'type':Sequelize[_0xf6d3('0x9')]},'endtime':{'type':Sequelize[_0xf6d3('0x9')]},'duration':{'type':Sequelize[_0xf6d3('0xa')]},'billableseconds':{'type':Sequelize[_0xf6d3('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf6d3('0x2')]},'amaflags':{'type':Sequelize[_0xf6d3('0x2')]},'userfield':{'type':Sequelize[_0xf6d3('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xf6d3('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xf6d3('0x2')]},'note':{'type':Sequelize[_0xf6d3('0x2')]},'prefix':{'type':Sequelize[_0xf6d3('0x2')]},'routeid':{'type':Sequelize[_0xf6d3('0xa')]},'sipcallid':{'type':Sequelize[_0xf6d3('0x2')]}}; \ No newline at end of file +var _0xb03e=['STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','exports'];(function(_0xce931d,_0x4a2e1a){var _0x57351c=function(_0x141ba9){while(--_0x141ba9){_0xce931d['push'](_0xce931d['shift']());}};_0x57351c(++_0x4a2e1a);}(_0xb03e,0x1eb));var _0xeb03=function(_0x347bba,_0x203e67){_0x347bba=_0x347bba-0x0;var _0x4910a1=_0xb03e[_0x347bba];return _0x4910a1;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'uniqueid':{'type':Sequelize[_0xeb03('0x1')]},'type':{'type':Sequelize[_0xeb03('0x2')](_0xeb03('0x3'),_0xeb03('0x4'),_0xeb03('0x5'),_0xeb03('0x6'),_0xeb03('0x7'),_0xeb03('0x8'))},'tag':{'type':Sequelize[_0xeb03('0x1')]},'accountcode':{'type':Sequelize[_0xeb03('0x1')]},'source':{'type':Sequelize[_0xeb03('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xeb03('0x1')]},'callerid':{'type':Sequelize[_0xeb03('0x1')]},'channel':{'type':Sequelize[_0xeb03('0x1')]},'destinationchannel':{'type':Sequelize[_0xeb03('0x1')]},'lastapplication':{'type':Sequelize[_0xeb03('0x1')]},'lastdata':{'type':Sequelize[_0xeb03('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xeb03('0xa')]},'answertime':{'type':Sequelize[_0xeb03('0xa')]},'endtime':{'type':Sequelize[_0xeb03('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xeb03('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xeb03('0x1')]},'amaflags':{'type':Sequelize[_0xeb03('0x1')]},'userfield':{'type':Sequelize[_0xeb03('0x1')]},'userDisposition':{'type':Sequelize[_0xeb03('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xeb03('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xeb03('0x1')]},'note':{'type':Sequelize[_0xeb03('0x1')]},'prefix':{'type':Sequelize[_0xeb03('0x1')]},'routeid':{'type':Sequelize[_0xeb03('0xb')]},'sipcallid':{'type':Sequelize[_0xeb03('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1c71938..8ff3cc8 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x711ab1,_0x3731c2){_0x711ab1=_0x711ab1-0x0;var _0x1746e6=_0x5f2f[_0x711ab1];return _0x1746e6;};'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 f4e0d77..cd9b81f 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 _0xc036=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','util'];(function(_0x31b1c6,_0x2d5ece){var _0x33c909=function(_0x12920b){while(--_0x12920b){_0x31b1c6['push'](_0x31b1c6['shift']());}};_0x33c909(++_0x2d5ece);}(_0xc036,0x1ec));var _0x6c03=function(_0x16169b,_0x1fe209){_0x16169b=_0x16169b-0x0;var _0x7a7d78=_0xc036[_0x16169b];return _0x7a7d78;};'use strict';var _=require(_0x6c03('0x0'));var util=require(_0x6c03('0x1'));var logger=require(_0x6c03('0x2'))('api');var moment=require(_0x6c03('0x3'));var BPromise=require(_0x6c03('0x4'));var rp=require(_0x6c03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c03('0x6'));var config=require(_0x6c03('0x7'));var attributes=require(_0x6c03('0x8'));module['exports']=function(_0xd587a,_0x3cafb3){return _0xd587a[_0x6c03('0x9')](_0x6c03('0xa'),attributes,{'tableName':_0x6c03('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6c03('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x428c=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x95207,_0x1df5a7){var _0x35f6be=function(_0x80e914){while(--_0x80e914){_0x95207['push'](_0x95207['shift']());}};_0x35f6be(++_0x1df5a7);}(_0x428c,0x1d4));var _0xc428=function(_0x14d626,_0x3b62dd){_0x14d626=_0x14d626-0x0;var _0xcf2897=_0x428c[_0x14d626];return _0xcf2897;};'use strict';var _=require(_0xc428('0x0'));var util=require(_0xc428('0x1'));var logger=require(_0xc428('0x2'))(_0xc428('0x3'));var moment=require(_0xc428('0x4'));var BPromise=require('bluebird');var rp=require(_0xc428('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc428('0x6'));var config=require('../../config/environment');var attributes=require(_0xc428('0x7'));module[_0xc428('0x8')]=function(_0x55ec7a,_0x45953a){return _0x55ec7a[_0xc428('0x9')](_0xc428('0xa'),attributes,{'tableName':_0xc428('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc428('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 8d3dd41..d35fd00 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 _0xadfc=['../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0xadfc,0x1e8));var _0xcadf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xadfc[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xcadf('0x0'));var util=require('util');var moment=require(_0xcadf('0x1'));var BPromise=require('bluebird');var rs=require(_0xcadf('0x2'));var fs=require('fs');var Redis=require(_0xcadf('0x3'));var db=require(_0xcadf('0x4'))['db'];var utils=require(_0xcadf('0x5'));var logger=require(_0xcadf('0x6'))(_0xcadf('0x7'));var config=require('../../config/environment');var jayson=require(_0xcadf('0x8'));var client=jayson[_0xcadf('0x9')][_0xcadf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a458f,_0x1ac4de,_0x4fa365){return new BPromise(function(_0x42bdd2,_0x11d568){return client[_0xcadf('0xb')](_0x3a458f,_0x4fa365)[_0xcadf('0xc')](function(_0x241df8){logger['info'](_0xcadf('0xd'),_0x1ac4de,'request\x20sent');logger[_0xcadf('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1ac4de,_0xcadf('0xf'),JSON[_0xcadf('0x10')](_0x241df8));if(_0x241df8['error']){if(_0x241df8[_0xcadf('0x11')][_0xcadf('0x12')]===0x1f4){logger[_0xcadf('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x1ac4de,_0x241df8[_0xcadf('0x11')][_0xcadf('0x13')]);return _0x11d568(_0x241df8[_0xcadf('0x11')][_0xcadf('0x13')]);}logger['error'](_0xcadf('0xd'),_0x1ac4de,_0x241df8['error'][_0xcadf('0x13')]);return _0x42bdd2(_0x241df8['error']['message']);}else{logger[_0xcadf('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x1ac4de,_0xcadf('0xf'));_0x42bdd2(_0x241df8[_0xcadf('0x15')][_0xcadf('0x13')]);}})[_0xcadf('0x16')](function(_0x4c4cf2){logger[_0xcadf('0x11')](_0xcadf('0xd'),_0x1ac4de,_0x4c4cf2);_0x11d568(_0x4c4cf2);});});}exports[_0xcadf('0x17')]=function(_0x61890b){var _0x78d9f5=this;return new Promise(function(_0x2f7821,_0x398182){return db[_0xcadf('0x18')][_0xcadf('0x19')]({'raw':_0x61890b[_0xcadf('0x1a')]?_0x61890b[_0xcadf('0x1a')][_0xcadf('0x1b')]===undefined?!![]:![]:!![],'where':_0x61890b[_0xcadf('0x1a')]?_0x61890b['options']['where']||null:null,'attributes':_0x61890b['options']?_0x61890b[_0xcadf('0x1a')][_0xcadf('0x1c')]||null:null,'limit':_0x61890b[_0xcadf('0x1a')]?_0x61890b['options'][_0xcadf('0x1d')]||null:null,'include':_0x61890b[_0xcadf('0x1a')]?_0x61890b[_0xcadf('0x1a')][_0xcadf('0x1e')]?_[_0xcadf('0x1f')](_0x61890b['options'][_0xcadf('0x1e')],function(_0x14b254){return{'model':db[_0x14b254['model']],'as':_0x14b254['as'],'attributes':_0x14b254['attributes'],'include':_0x14b254[_0xcadf('0x1e')]?_[_0xcadf('0x1f')](_0x14b254['include'],function(_0x18ac0c){return{'model':db[_0x18ac0c[_0xcadf('0x20')]],'as':_0x18ac0c['as'],'attributes':_0x18ac0c['attributes'],'include':_0x18ac0c['include']?_['map'](_0x18ac0c[_0xcadf('0x1e')],function(_0x13a034){return{'model':db[_0x13a034[_0xcadf('0x20')]],'as':_0x13a034['as'],'attributes':_0x13a034['attributes']};}):[]};}):[]};}):[]:[]})[_0xcadf('0xc')](function(_0x373502){logger[_0xcadf('0x14')]('GetVoiceCallReport',_0x61890b);logger[_0xcadf('0xe')]('GetVoiceCallReport',_0x61890b,JSON['stringify'](_0x373502));_0x2f7821(_0x373502);})[_0xcadf('0x16')](function(_0x1452d7){logger[_0xcadf('0x11')](_0xcadf('0x17'),_0x1452d7[_0xcadf('0x13')],_0x61890b);_0x398182(_0x78d9f5['error'](0x1f4,_0x1452d7[_0xcadf('0x13')]));});});};exports[_0xcadf('0x21')]=function(_0x37e9d3){var _0x1d3eee=this;return new Promise(function(_0x2095d5,_0x3ccc54){return db[_0xcadf('0x18')][_0xcadf('0x22')](_0x37e9d3[_0xcadf('0x23')],{'raw':_0x37e9d3[_0xcadf('0x1a')]?_0x37e9d3[_0xcadf('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xcadf('0xc')](function(_0x43d1c8){logger['info']('CreateVoiceCallReport',_0x37e9d3);logger['debug'](_0xcadf('0x21'),_0x37e9d3,JSON['stringify'](_0x43d1c8));_0x2095d5(_0x43d1c8);})[_0xcadf('0x16')](function(_0x262595){logger[_0xcadf('0x11')](_0xcadf('0x21'),_0x262595[_0xcadf('0x13')],_0x37e9d3);_0x3ccc54(_0x1d3eee[_0xcadf('0x11')](0x1f4,_0x262595[_0xcadf('0x13')]));});});};exports[_0xcadf('0x24')]=function(_0x44c2d3){var _0x43b697=this;return new Promise(function(_0xf4143b,_0x4b4582){return db[_0xcadf('0x18')][_0xcadf('0x25')](_0x44c2d3[_0xcadf('0x23')],{'raw':_0x44c2d3['options']?_0x44c2d3[_0xcadf('0x1a')][_0xcadf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44c2d3['options']?_0x44c2d3[_0xcadf('0x1a')]['where']||null:null,'attributes':_0x44c2d3[_0xcadf('0x1a')]?_0x44c2d3[_0xcadf('0x1a')][_0xcadf('0x1c')]||null:null,'limit':_0x44c2d3[_0xcadf('0x1a')]?_0x44c2d3['options']['limit']||null:null})['then'](function(_0x4991e0){logger['info'](_0xcadf('0x24'),_0x44c2d3);logger[_0xcadf('0xe')](_0xcadf('0x24'),_0x44c2d3,JSON[_0xcadf('0x10')](_0x4991e0));_0xf4143b(_0x4991e0);})[_0xcadf('0x16')](function(_0x3020ac){logger[_0xcadf('0x11')]('UpdateVoiceCallReport',_0x3020ac['message'],_0x44c2d3);_0x4b4582(_0x43b697[_0xcadf('0x11')](0x1f4,_0x3020ac['message']));});});}; \ No newline at end of file +var _0x00e8=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00e8,0xb4));var _0x800e=function(_0x50e04c,_0x3c0b77){_0x50e04c=_0x50e04c-0x0;var _0x4f6b35=_0x00e8[_0x50e04c];return _0x4f6b35;};'use strict';var _=require(_0x800e('0x0'));var util=require(_0x800e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x800e('0x2'));var db=require(_0x800e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x800e('0x4'))(_0x800e('0x5'));var config=require(_0x800e('0x6'));var jayson=require(_0x800e('0x7'));var client=jayson[_0x800e('0x8')][_0x800e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x122788,_0x33fd64,_0x132682){return new BPromise(function(_0x1ad89e,_0x1186ae){return client['request'](_0x122788,_0x132682)[_0x800e('0xa')](function(_0x5e66f2){logger[_0x800e('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x33fd64,_0x800e('0xc'));logger[_0x800e('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x33fd64,_0x800e('0xc'),JSON[_0x800e('0xe')](_0x5e66f2));if(_0x5e66f2[_0x800e('0xf')]){if(_0x5e66f2[_0x800e('0xf')][_0x800e('0x10')]===0x1f4){logger[_0x800e('0xf')](_0x800e('0x11'),_0x33fd64,_0x5e66f2[_0x800e('0xf')][_0x800e('0x12')]);return _0x1186ae(_0x5e66f2['error']['message']);}logger[_0x800e('0xf')](_0x800e('0x11'),_0x33fd64,_0x5e66f2['error'][_0x800e('0x12')]);return _0x1ad89e(_0x5e66f2[_0x800e('0xf')]['message']);}else{logger[_0x800e('0xb')](_0x800e('0x11'),_0x33fd64,_0x800e('0xc'));_0x1ad89e(_0x5e66f2[_0x800e('0x13')][_0x800e('0x12')]);}})[_0x800e('0x14')](function(_0x5d53d9){logger[_0x800e('0xf')](_0x800e('0x11'),_0x33fd64,_0x5d53d9);_0x1186ae(_0x5d53d9);});});}exports['GetVoiceCallReport']=function(_0x5a3cb7){var _0xa6b0db=this;return new Promise(function(_0x564b3,_0x35ed5d){return db[_0x800e('0x15')][_0x800e('0x16')]({'raw':_0x5a3cb7[_0x800e('0x17')]?_0x5a3cb7['options'][_0x800e('0x18')]===undefined?!![]:![]:!![],'where':_0x5a3cb7[_0x800e('0x17')]?_0x5a3cb7[_0x800e('0x17')][_0x800e('0x19')]||null:null,'attributes':_0x5a3cb7[_0x800e('0x17')]?_0x5a3cb7[_0x800e('0x17')][_0x800e('0x1a')]||null:null,'limit':_0x5a3cb7[_0x800e('0x17')]?_0x5a3cb7['options'][_0x800e('0x1b')]||null:null,'include':_0x5a3cb7[_0x800e('0x17')]?_0x5a3cb7[_0x800e('0x17')][_0x800e('0x1c')]?_[_0x800e('0x1d')](_0x5a3cb7[_0x800e('0x17')]['include'],function(_0x1dc6d2){return{'model':db[_0x1dc6d2[_0x800e('0x1e')]],'as':_0x1dc6d2['as'],'attributes':_0x1dc6d2[_0x800e('0x1a')],'include':_0x1dc6d2['include']?_[_0x800e('0x1d')](_0x1dc6d2[_0x800e('0x1c')],function(_0x1f37ba){return{'model':db[_0x1f37ba[_0x800e('0x1e')]],'as':_0x1f37ba['as'],'attributes':_0x1f37ba[_0x800e('0x1a')],'include':_0x1f37ba[_0x800e('0x1c')]?_[_0x800e('0x1d')](_0x1f37ba[_0x800e('0x1c')],function(_0x1ce9fa){return{'model':db[_0x1ce9fa[_0x800e('0x1e')]],'as':_0x1ce9fa['as'],'attributes':_0x1ce9fa[_0x800e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x800e('0xa')](function(_0x109c8e){logger[_0x800e('0xb')](_0x800e('0x1f'),_0x5a3cb7);logger[_0x800e('0xd')](_0x800e('0x1f'),_0x5a3cb7,JSON[_0x800e('0xe')](_0x109c8e));_0x564b3(_0x109c8e);})[_0x800e('0x14')](function(_0x2b1afa){logger[_0x800e('0xf')](_0x800e('0x1f'),_0x2b1afa['message'],_0x5a3cb7);_0x35ed5d(_0xa6b0db['error'](0x1f4,_0x2b1afa[_0x800e('0x12')]));});});};exports[_0x800e('0x20')]=function(_0x253068){var _0x3fa0e0=this;return new Promise(function(_0x27e970,_0x393584){return db[_0x800e('0x15')][_0x800e('0x21')](_0x253068[_0x800e('0x22')],{'raw':_0x253068[_0x800e('0x17')]?_0x253068[_0x800e('0x17')][_0x800e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3dae21){logger[_0x800e('0xb')]('CreateVoiceCallReport',_0x253068);logger[_0x800e('0xd')]('CreateVoiceCallReport',_0x253068,JSON['stringify'](_0x3dae21));_0x27e970(_0x3dae21);})[_0x800e('0x14')](function(_0x4947f4){logger[_0x800e('0xf')](_0x800e('0x20'),_0x4947f4['message'],_0x253068);_0x393584(_0x3fa0e0[_0x800e('0xf')](0x1f4,_0x4947f4[_0x800e('0x12')]));});});};exports[_0x800e('0x23')]=function(_0x6a9a1c){var _0x37d381=this;return new Promise(function(_0x4f9a45,_0x1ab906){return db['VoiceCallReport'][_0x800e('0x24')](_0x6a9a1c[_0x800e('0x22')],{'raw':_0x6a9a1c[_0x800e('0x17')]?_0x6a9a1c['options'][_0x800e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a9a1c[_0x800e('0x17')]?_0x6a9a1c[_0x800e('0x17')][_0x800e('0x19')]||null:null,'attributes':_0x6a9a1c[_0x800e('0x17')]?_0x6a9a1c['options']['attributes']||null:null,'limit':_0x6a9a1c[_0x800e('0x17')]?_0x6a9a1c[_0x800e('0x17')]['limit']||null:null})[_0x800e('0xa')](function(_0x4fb94a){logger[_0x800e('0xb')](_0x800e('0x23'),_0x6a9a1c);logger[_0x800e('0xd')](_0x800e('0x23'),_0x6a9a1c,JSON['stringify'](_0x4fb94a));_0x4f9a45(_0x4fb94a);})[_0x800e('0x14')](function(_0x45e178){logger[_0x800e('0xf')](_0x800e('0x23'),_0x45e178[_0x800e('0x12')],_0x6a9a1c);_0x1ab906(_0x37d381[_0x800e('0xf')](0x1f4,_0x45e178[_0x800e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e868451..45b6d4d 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 _0x1269=['fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','/:id','post','isAuthenticated','create','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x315861,_0x735b4){var _0x3e2b76=function(_0x436457){while(--_0x436457){_0x315861['push'](_0x315861['shift']());}};_0x3e2b76(++_0x735b4);}(_0x1269,0xbc));var _0x9126=function(_0x7f677f,_0x5f2c1c){_0x7f677f=_0x7f677f-0x0;var _0x5acea1=_0x1269[_0x7f677f];return _0x5acea1;};'use strict';var multer=require(_0x9126('0x0'));var util=require('util');var path=require(_0x9126('0x1'));var timeout=require(_0x9126('0x2'));var express=require('express');var router=express[_0x9126('0x3')]();var fs_extra=require(_0x9126('0x4'));var auth=require(_0x9126('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9126('0x6'));var controller=require(_0x9126('0x7'));router[_0x9126('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9126('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9126('0xa')]('/',auth[_0x9126('0xb')](),controller[_0x9126('0xc')]);router['put']('/:id',auth[_0x9126('0xb')](),controller['update']);router[_0x9126('0xd')]('/:id',auth[_0x9126('0xb')](),controller[_0x9126('0xe')]);module[_0x9126('0xf')]=router; \ No newline at end of file +var _0xf3fc=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy'];(function(_0x515fc5,_0x218565){var _0x343aa2=function(_0x149d93){while(--_0x149d93){_0x515fc5['push'](_0x515fc5['shift']());}};_0x343aa2(++_0x218565);}(_0xf3fc,0xcc));var _0xcf3f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf3fc[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xcf3f('0x0'));var path=require('path');var timeout=require(_0xcf3f('0x1'));var express=require(_0xcf3f('0x2'));var router=express[_0xcf3f('0x3')]();var fs_extra=require(_0xcf3f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcf3f('0x5'));var config=require(_0xcf3f('0x6'));var controller=require(_0xcf3f('0x7'));router[_0xcf3f('0x8')]('/',auth[_0xcf3f('0x9')](),controller[_0xcf3f('0xa')]);router['get'](_0xcf3f('0xb'),auth[_0xcf3f('0x9')](),controller[_0xcf3f('0xc')]);router['post']('/',auth[_0xcf3f('0x9')](),controller[_0xcf3f('0xd')]);router[_0xcf3f('0xe')]('/:id',auth[_0xcf3f('0x9')](),controller['update']);router[_0xcf3f('0xf')](_0xcf3f('0xb'),auth[_0xcf3f('0x9')](),controller[_0xcf3f('0x10')]);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 aee7ac8..cc62656 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 _0x1dd6=['exports','STRING','setDataValue','options','getDataValue','split','sequelize'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1dd6,0x1d4));var _0x61dd=function(_0x1dbca3,_0x2717e1){_0x1dbca3=_0x1dbca3-0x0;var _0x50bd3f=_0x1dd6[_0x1dbca3];return _0x50bd3f;};'use strict';var Sequelize=require(_0x61dd('0x0'));module[_0x61dd('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x61dd('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x61dd('0x2')],'set':function(_0x54d32e){this[_0x61dd('0x3')](_0x61dd('0x4'),_0x54d32e?_0x54d32e['join'](''):[]);},'get':function(){return this[_0x61dd('0x5')](_0x61dd('0x4'))?this[_0x61dd('0x5')](_0x61dd('0x4'))[_0x61dd('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x61dd('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x61dd('0x2')]},'description':{'type':Sequelize[_0x61dd('0x2')]}}; \ No newline at end of file +var _0x8eee=['BOOLEAN','sequelize','exports','STRING','name','join','options','split'];(function(_0x19f727,_0x28224e){var _0x412836=function(_0x40634f){while(--_0x40634f){_0x19f727['push'](_0x19f727['shift']());}};_0x412836(++_0x28224e);}(_0x8eee,0x181));var _0xe8ee=function(_0x44532f,_0x2dac86){_0x44532f=_0x44532f-0x0;var _0x11e878=_0x8eee[_0x44532f];return _0x11e878;};'use strict';var Sequelize=require(_0xe8ee('0x0'));module[_0xe8ee('0x1')]={'name':{'type':Sequelize[_0xe8ee('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xe8ee('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x423de8){this['setDataValue']('options',_0x423de8?_0x423de8[_0xe8ee('0x4')](''):[]);},'get':function(){return this['getDataValue']('options')?this['getDataValue'](_0xe8ee('0x5'))[_0xe8ee('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xe8ee('0x2')]},'record':{'type':Sequelize[_0xe8ee('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 6029793..21bec5e 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 _0x851d=['merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','get','ChanSpies','UserProfileResource','then','end','error','stack','name','send','index','map','VoiceChanSpy','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x17427f,_0x3a58cd){var _0x3ade33=function(_0x19fd36){while(--_0x19fd36){_0x17427f['push'](_0x17427f['shift']());}};_0x3ade33(++_0x3a58cd);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd851('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd851('0x1'));var jsonpatch=require(_0xd851('0x2'));var rp=require('request-promise');var moment=require(_0xd851('0x3'));var BPromise=require(_0xd851('0x4'));var Mustache=require(_0xd851('0x5'));var util=require(_0xd851('0x6'));var path=require(_0xd851('0x7'));var sox=require(_0xd851('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd851('0x9'));var _=require(_0xd851('0xa'));var squel=require(_0xd851('0xb'));var crypto=require(_0xd851('0xc'));var jsforce=require(_0xd851('0xd'));var deskjs=require(_0xd851('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd851('0xf'));var Papa=require('papaparse');var Redis=require(_0xd851('0x10'));var authService=require(_0xd851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd851('0x12'));var hardwareService=require(_0xd851('0x13'));var logger=require(_0xd851('0x14'))(_0xd851('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd851('0x16'));var db=require(_0xd851('0x17'))['db'];function respondWithStatusCode(_0x173c88,_0x1188d5){_0x1188d5=_0x1188d5||0xcc;return function(_0x5a01bf){if(_0x5a01bf){return _0x173c88[_0xd851('0x18')](_0x1188d5);}return _0x173c88[_0xd851('0x19')](_0x1188d5)['end']();};}function respondWithResult(_0x399128,_0x2705fd){_0x2705fd=_0x2705fd||0xc8;return function(_0x237dda){if(_0x237dda){return _0x399128['status'](_0x2705fd)[_0xd851('0x1a')](_0x237dda);}};}function respondWithFilteredResult(_0x370ad3,_0xb26cf1){return function(_0x1e2ee7){if(_0x1e2ee7){var _0x1b3d4c=typeof _0xb26cf1[_0xd851('0x1b')]==='undefined'&&typeof _0xb26cf1[_0xd851('0x1c')]===_0xd851('0x1d');var _0x1f4f98=_0x1e2ee7[_0xd851('0x1e')];var _0x12b309=_0x1b3d4c?0x0:_0xb26cf1[_0xd851('0x1b')];var _0x3559a1=_0x1b3d4c?_0x1e2ee7['count']:_0xb26cf1['offset']+_0xb26cf1[_0xd851('0x1c')];var _0x8ddf05;if(_0x3559a1>=_0x1f4f98){_0x3559a1=_0x1f4f98;_0x8ddf05=0xc8;}else{_0x8ddf05=0xce;}_0x370ad3[_0xd851('0x19')](_0x8ddf05);return _0x370ad3[_0xd851('0x1f')](_0xd851('0x20'),_0x12b309+'-'+_0x3559a1+'/'+_0x1f4f98)[_0xd851('0x1a')](_0x1e2ee7);}return null;};}function patchUpdates(_0x8585e5){return function(_0x239356){try{jsonpatch[_0xd851('0x21')](_0x239356,_0x8585e5,!![]);}catch(_0x46773f){return BPromise[_0xd851('0x22')](_0x46773f);}return _0x239356[_0xd851('0x23')]();};}function saveUpdates(_0x17cb41,_0x4e38af){return function(_0x404ba4){if(_0x404ba4){return _0x404ba4[_0xd851('0x24')](_0x17cb41)['then'](function(_0x3856a8){return _0x3856a8;});}return null;};}function removeEntity(_0x30177c,_0x2f888e){return function(_0x4bb814){if(_0x4bb814){return _0x4bb814['destroy']()['then'](function(){var _0x35a9b0=_0x4bb814[_0xd851('0x25')]({'plain':!![]});var _0x2f2009=_0xd851('0x26');return db[_0xd851('0x27')]['destroy']({'where':{'type':_0x2f2009,'resourceId':_0x35a9b0['id']}})[_0xd851('0x28')](function(){return _0x4bb814;});})['then'](function(){_0x30177c[_0xd851('0x19')](0xcc)[_0xd851('0x29')]();});}};}function handleEntityNotFound(_0x39f9d4,_0x36457c){return function(_0x337da5){if(!_0x337da5){_0x39f9d4[_0xd851('0x18')](0x194);}return _0x337da5;};}function handleError(_0x4d1fa6,_0x94977e){_0x94977e=_0x94977e||0x1f4;return function(_0x441c27){logger[_0xd851('0x2a')](_0x441c27[_0xd851('0x2b')]);if(_0x441c27[_0xd851('0x2c')]){delete _0x441c27[_0xd851('0x2c')];}_0x4d1fa6[_0xd851('0x19')](_0x94977e)[_0xd851('0x2d')](_0x441c27);};}exports[_0xd851('0x2e')]=function(_0x2ef08d,_0xce3947){var _0x132df8={},_0x598ad4={},_0x15ce59={'count':0x0,'rows':[]};var _0x990498=_[_0xd851('0x2f')](db[_0xd851('0x30')]['rawAttributes'],function(_0x165f79){return{'name':_0x165f79['fieldName'],'type':_0x165f79['type'][_0xd851('0x31')]};});_0x598ad4[_0xd851('0x32')]=_['map'](_0x990498,'name');_0x598ad4[_0xd851('0x33')]=_[_0xd851('0x34')](_0x2ef08d[_0xd851('0x33')]);_0x598ad4[_0xd851('0x35')]=_[_0xd851('0x36')](_0x598ad4['model'],_0x598ad4['query']);_0x132df8[_0xd851('0x37')]=_[_0xd851('0x36')](_0x598ad4[_0xd851('0x32')],qs[_0xd851('0x38')](_0x2ef08d[_0xd851('0x33')][_0xd851('0x38')]));_0x132df8[_0xd851('0x37')]=_0x132df8[_0xd851('0x37')]['length']?_0x132df8['attributes']:_0x598ad4['model'];if(!_0x2ef08d[_0xd851('0x33')][_0xd851('0x39')](_0xd851('0x3a'))){_0x132df8[_0xd851('0x1c')]=qs[_0xd851('0x1c')](_0x2ef08d['query'][_0xd851('0x1c')]);_0x132df8[_0xd851('0x1b')]=qs['offset'](_0x2ef08d[_0xd851('0x33')][_0xd851('0x1b')]);}_0x132df8[_0xd851('0x3b')]=qs[_0xd851('0x3c')](_0x2ef08d['query']['sort']);_0x132df8[_0xd851('0x3d')]=qs['filters'](_[_0xd851('0x3e')](_0x2ef08d[_0xd851('0x33')],_0x598ad4[_0xd851('0x35')]),_0x990498);if(_0x2ef08d['query']['filter']){_0x132df8[_0xd851('0x3d')]=_[_0xd851('0x3f')](_0x132df8[_0xd851('0x3d')],{'$or':_['map'](_0x990498,function(_0x326631){if(_0x326631[_0xd851('0x40')]!==_0xd851('0x41')){var _0x321d6e={};_0x321d6e[_0x326631['name']]={'$like':'%'+_0x2ef08d['query'][_0xd851('0x42')]+'%'};return _0x321d6e;}})});}_0x132df8=_[_0xd851('0x3f')]({},_0x132df8,_0x2ef08d[_0xd851('0x43')]);var _0x5056bc={'where':_0x132df8[_0xd851('0x3d')]};return db[_0xd851('0x30')][_0xd851('0x1e')](_0x5056bc)['then'](function(_0x1ebf20){_0x15ce59[_0xd851('0x1e')]=_0x1ebf20;if(_0x2ef08d[_0xd851('0x33')][_0xd851('0x44')]){_0x132df8[_0xd851('0x45')]=[{'all':!![]}];}return db[_0xd851('0x30')][_0xd851('0x46')](_0x132df8);})[_0xd851('0x28')](function(_0x23dc50){_0x15ce59[_0xd851('0x47')]=_0x23dc50;return _0x15ce59;})[_0xd851('0x28')](respondWithFilteredResult(_0xce3947,_0x132df8))[_0xd851('0x48')](handleError(_0xce3947,null));};exports['show']=function(_0x5e4f40,_0x4fe987){var _0x247bb3={'raw':![],'where':{'id':_0x5e4f40['params']['id']}},_0x273868={};_0x273868[_0xd851('0x32')]=_[_0xd851('0x34')](db[_0xd851('0x30')][_0xd851('0x49')]);_0x273868['query']=_[_0xd851('0x34')](_0x5e4f40[_0xd851('0x33')]);_0x273868[_0xd851('0x35')]=_[_0xd851('0x36')](_0x273868[_0xd851('0x32')],_0x273868['query']);_0x247bb3[_0xd851('0x37')]=_[_0xd851('0x36')](_0x273868[_0xd851('0x32')],qs[_0xd851('0x38')](_0x5e4f40['query'][_0xd851('0x38')]));_0x247bb3[_0xd851('0x37')]=_0x247bb3[_0xd851('0x37')][_0xd851('0x4a')]?_0x247bb3['attributes']:_0x273868['model'];if(_0x5e4f40[_0xd851('0x33')][_0xd851('0x44')]){_0x247bb3[_0xd851('0x45')]=[{'all':!![]}];}_0x247bb3=_[_0xd851('0x3f')]({},_0x247bb3,_0x5e4f40[_0xd851('0x43')]);return db[_0xd851('0x30')][_0xd851('0x4b')](_0x247bb3)[_0xd851('0x28')](handleEntityNotFound(_0x4fe987,null))[_0xd851('0x28')](respondWithResult(_0x4fe987,null))[_0xd851('0x48')](handleError(_0x4fe987,null));};exports[_0xd851('0x4c')]=function(_0x3bcd39,_0x3828fe){return db['VoiceChanSpy'][_0xd851('0x4c')](_0x3bcd39[_0xd851('0x4d')],{})[_0xd851('0x28')](function(_0x38014d){var _0x5b9d03=_0x3bcd39[_0xd851('0x4e')][_0xd851('0x25')]({'plain':!![]});if(!_0x5b9d03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b9d03['role']===_0xd851('0x4e')){var _0x2d9ecb=_0x38014d['get']({'plain':!![]});var _0x95c37e=_0xd851('0x26');return db[_0xd851('0x4f')][_0xd851('0x4b')]({'where':{'name':_0x95c37e,'userProfileId':_0x5b9d03[_0xd851('0x50')]},'raw':!![]})['then'](function(_0x10cf5b){if(_0x10cf5b&&_0x10cf5b['autoAssociation']===0x0){return db['UserProfileResource'][_0xd851('0x4c')]({'name':_0x2d9ecb[_0xd851('0x2c')],'resourceId':_0x2d9ecb['id'],'type':_0x10cf5b[_0xd851('0x2c')],'sectionId':_0x10cf5b['id']},{})[_0xd851('0x28')](function(){return _0x38014d;});}else{return _0x38014d;}})['catch'](function(_0x4bc500){logger[_0xd851('0x2a')](_0xd851('0x51'),_0x4bc500);throw _0x4bc500;});}return _0x38014d;})['then'](respondWithResult(_0x3828fe,0xc9))[_0xd851('0x48')](handleError(_0x3828fe,null));};exports[_0xd851('0x24')]=function(_0x2b8db2,_0x2478ad){if(_0x2b8db2['body']['id']){delete _0x2b8db2[_0xd851('0x4d')]['id'];}return db[_0xd851('0x30')]['find']({'where':{'id':_0x2b8db2[_0xd851('0x52')]['id']}})[_0xd851('0x28')](handleEntityNotFound(_0x2478ad,null))[_0xd851('0x28')](saveUpdates(_0x2b8db2[_0xd851('0x4d')],null))[_0xd851('0x28')](respondWithResult(_0x2478ad,null))[_0xd851('0x48')](handleError(_0x2478ad,null));};exports[_0xd851('0x53')]=function(_0x129412,_0x1118cc){return db['VoiceChanSpy'][_0xd851('0x4b')]({'where':{'id':_0x129412['params']['id']}})[_0xd851('0x28')](handleEntityNotFound(_0x1118cc,null))[_0xd851('0x28')](removeEntity(_0x1118cc,null))['catch'](handleError(_0x1118cc,null));}; \ No newline at end of file +var _0x6e16=['destroy','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','zip-dir','request-promise','bluebird','mustache','path','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/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then'];(function(_0x25fd37,_0x1cecd6){var _0x5237e6=function(_0x3a8f80){while(--_0x3a8f80){_0x25fd37['push'](_0x25fd37['shift']());}};_0x5237e6(++_0x1cecd6);}(_0x6e16,0x1d3));var _0x66e1=function(_0x37ce59,_0x559f6e){_0x37ce59=_0x37ce59-0x0;var _0x5a90fe=_0x6e16[_0x37ce59];return _0x5a90fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66e1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66e1('0x1'));var moment=require('moment');var BPromise=require(_0x66e1('0x2'));var Mustache=require(_0x66e1('0x3'));var util=require('util');var path=require(_0x66e1('0x4'));var sox=require('sox');var csv=require(_0x66e1('0x5'));var ejs=require(_0x66e1('0x6'));var fs=require('fs');var fs_extra=require(_0x66e1('0x7'));var _=require('lodash');var squel=require(_0x66e1('0x8'));var crypto=require(_0x66e1('0x9'));var jsforce=require(_0x66e1('0xa'));var deskjs=require(_0x66e1('0xb'));var toCsv=require(_0x66e1('0x5'));var querystring=require(_0x66e1('0xc'));var Papa=require(_0x66e1('0xd'));var Redis=require(_0x66e1('0xe'));var authService=require(_0x66e1('0xf'));var qs=require(_0x66e1('0x10'));var as=require(_0x66e1('0x11'));var hardwareService=require(_0x66e1('0x12'));var logger=require(_0x66e1('0x13'))(_0x66e1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x66e1('0x15'));var db=require(_0x66e1('0x16'))['db'];function respondWithStatusCode(_0x23e018,_0x497712){_0x497712=_0x497712||0xcc;return function(_0x58c184){if(_0x58c184){return _0x23e018[_0x66e1('0x17')](_0x497712);}return _0x23e018['status'](_0x497712)[_0x66e1('0x18')]();};}function respondWithResult(_0x3e36ff,_0x5b802b){_0x5b802b=_0x5b802b||0xc8;return function(_0x9c17f9){if(_0x9c17f9){return _0x3e36ff[_0x66e1('0x19')](_0x5b802b)['json'](_0x9c17f9);}};}function respondWithFilteredResult(_0x137f52,_0x12ca0b){return function(_0x18e2ab){if(_0x18e2ab){var _0x3a68b3=typeof _0x12ca0b['offset']===_0x66e1('0x1a')&&typeof _0x12ca0b[_0x66e1('0x1b')]===_0x66e1('0x1a');var _0x28e236=_0x18e2ab[_0x66e1('0x1c')];var _0x4f3276=_0x3a68b3?0x0:_0x12ca0b['offset'];var _0x2b5585=_0x3a68b3?_0x18e2ab['count']:_0x12ca0b[_0x66e1('0x1d')]+_0x12ca0b[_0x66e1('0x1b')];var _0x260e87;if(_0x2b5585>=_0x28e236){_0x2b5585=_0x28e236;_0x260e87=0xc8;}else{_0x260e87=0xce;}_0x137f52[_0x66e1('0x19')](_0x260e87);return _0x137f52[_0x66e1('0x1e')]('Content-Range',_0x4f3276+'-'+_0x2b5585+'/'+_0x28e236)[_0x66e1('0x1f')](_0x18e2ab);}return null;};}function patchUpdates(_0x23c6ce){return function(_0xe2822e){try{jsonpatch[_0x66e1('0x20')](_0xe2822e,_0x23c6ce,!![]);}catch(_0x28f6cf){return BPromise[_0x66e1('0x21')](_0x28f6cf);}return _0xe2822e[_0x66e1('0x22')]();};}function saveUpdates(_0x38cf5b,_0x11232c){return function(_0x350b81){if(_0x350b81){return _0x350b81[_0x66e1('0x23')](_0x38cf5b)[_0x66e1('0x24')](function(_0x43686e){return _0x43686e;});}return null;};}function removeEntity(_0x2ea42d,_0x756840){return function(_0x11b7f0){if(_0x11b7f0){return _0x11b7f0[_0x66e1('0x25')]()['then'](function(){var _0xca80e3=_0x11b7f0['get']({'plain':!![]});var _0x203919=_0x66e1('0x26');return db[_0x66e1('0x27')][_0x66e1('0x25')]({'where':{'type':_0x203919,'resourceId':_0xca80e3['id']}})[_0x66e1('0x24')](function(){return _0x11b7f0;});})['then'](function(){_0x2ea42d[_0x66e1('0x19')](0xcc)[_0x66e1('0x18')]();});}};}function handleEntityNotFound(_0x2c4d08,_0x57fd03){return function(_0x4036c5){if(!_0x4036c5){_0x2c4d08['sendStatus'](0x194);}return _0x4036c5;};}function handleError(_0x5e1e87,_0x21fd24){_0x21fd24=_0x21fd24||0x1f4;return function(_0x3fcc99){logger[_0x66e1('0x28')](_0x3fcc99[_0x66e1('0x29')]);if(_0x3fcc99[_0x66e1('0x2a')]){delete _0x3fcc99[_0x66e1('0x2a')];}_0x5e1e87[_0x66e1('0x19')](_0x21fd24)[_0x66e1('0x2b')](_0x3fcc99);};}exports[_0x66e1('0x2c')]=function(_0x2b9045,_0x87bf90){var _0x24730f={},_0x53227c={},_0x1fefdb={'count':0x0,'rows':[]};var _0x1a708a=_['map'](db[_0x66e1('0x2d')][_0x66e1('0x2e')],function(_0xe4df21){return{'name':_0xe4df21[_0x66e1('0x2f')],'type':_0xe4df21['type'][_0x66e1('0x30')]};});_0x53227c[_0x66e1('0x31')]=_[_0x66e1('0x32')](_0x1a708a,'name');_0x53227c[_0x66e1('0x33')]=_['keys'](_0x2b9045['query']);_0x53227c['filters']=_[_0x66e1('0x34')](_0x53227c[_0x66e1('0x31')],_0x53227c['query']);_0x24730f[_0x66e1('0x35')]=_[_0x66e1('0x34')](_0x53227c['model'],qs['fields'](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x36')]));_0x24730f[_0x66e1('0x35')]=_0x24730f['attributes'][_0x66e1('0x37')]?_0x24730f[_0x66e1('0x35')]:_0x53227c[_0x66e1('0x31')];if(!_0x2b9045[_0x66e1('0x33')]['hasOwnProperty'](_0x66e1('0x38'))){_0x24730f[_0x66e1('0x1b')]=qs[_0x66e1('0x1b')](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x1b')]);_0x24730f[_0x66e1('0x1d')]=qs[_0x66e1('0x1d')](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x1d')]);}_0x24730f[_0x66e1('0x39')]=qs[_0x66e1('0x3a')](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x3a')]);_0x24730f[_0x66e1('0x3b')]=qs[_0x66e1('0x3c')](_[_0x66e1('0x3d')](_0x2b9045[_0x66e1('0x33')],_0x53227c['filters']),_0x1a708a);if(_0x2b9045[_0x66e1('0x33')][_0x66e1('0x3e')]){_0x24730f[_0x66e1('0x3b')]=_['merge'](_0x24730f[_0x66e1('0x3b')],{'$or':_[_0x66e1('0x32')](_0x1a708a,function(_0xcaf0ae){if(_0xcaf0ae[_0x66e1('0x3f')]!==_0x66e1('0x40')){var _0x1bd058={};_0x1bd058[_0xcaf0ae[_0x66e1('0x2a')]]={'$like':'%'+_0x2b9045[_0x66e1('0x33')]['filter']+'%'};return _0x1bd058;}})});}_0x24730f=_[_0x66e1('0x41')]({},_0x24730f,_0x2b9045[_0x66e1('0x42')]);var _0x1d331e={'where':_0x24730f[_0x66e1('0x3b')]};return db[_0x66e1('0x2d')][_0x66e1('0x1c')](_0x1d331e)[_0x66e1('0x24')](function(_0x42f58e){_0x1fefdb[_0x66e1('0x1c')]=_0x42f58e;if(_0x2b9045[_0x66e1('0x33')][_0x66e1('0x43')]){_0x24730f[_0x66e1('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x66e1('0x45')](_0x24730f);})[_0x66e1('0x24')](function(_0x561b89){_0x1fefdb[_0x66e1('0x46')]=_0x561b89;return _0x1fefdb;})[_0x66e1('0x24')](respondWithFilteredResult(_0x87bf90,_0x24730f))[_0x66e1('0x47')](handleError(_0x87bf90,null));};exports[_0x66e1('0x48')]=function(_0x986bca,_0x9d35f1){var _0x406c70={'raw':![],'where':{'id':_0x986bca['params']['id']}},_0x46511c={};_0x46511c[_0x66e1('0x31')]=_['keys'](db[_0x66e1('0x2d')]['rawAttributes']);_0x46511c['query']=_[_0x66e1('0x49')](_0x986bca[_0x66e1('0x33')]);_0x46511c[_0x66e1('0x3c')]=_['intersection'](_0x46511c[_0x66e1('0x31')],_0x46511c[_0x66e1('0x33')]);_0x406c70[_0x66e1('0x35')]=_[_0x66e1('0x34')](_0x46511c['model'],qs['fields'](_0x986bca[_0x66e1('0x33')][_0x66e1('0x36')]));_0x406c70[_0x66e1('0x35')]=_0x406c70[_0x66e1('0x35')][_0x66e1('0x37')]?_0x406c70['attributes']:_0x46511c[_0x66e1('0x31')];if(_0x986bca['query'][_0x66e1('0x43')]){_0x406c70['include']=[{'all':!![]}];}_0x406c70=_[_0x66e1('0x41')]({},_0x406c70,_0x986bca['options']);return db[_0x66e1('0x2d')][_0x66e1('0x4a')](_0x406c70)[_0x66e1('0x24')](handleEntityNotFound(_0x9d35f1,null))[_0x66e1('0x24')](respondWithResult(_0x9d35f1,null))[_0x66e1('0x47')](handleError(_0x9d35f1,null));};exports[_0x66e1('0x4b')]=function(_0x529fe2,_0x317424){return db['VoiceChanSpy'][_0x66e1('0x4b')](_0x529fe2[_0x66e1('0x4c')],{})['then'](function(_0x441405){var _0xbb788c=_0x529fe2[_0x66e1('0x4d')][_0x66e1('0x4e')]({'plain':!![]});if(!_0xbb788c)throw new Error(_0x66e1('0x4f'));if(_0xbb788c['role']===_0x66e1('0x4d')){var _0x2db8f3=_0x441405[_0x66e1('0x4e')]({'plain':!![]});var _0x6bed1f=_0x66e1('0x26');return db[_0x66e1('0x50')][_0x66e1('0x4a')]({'where':{'name':_0x6bed1f,'userProfileId':_0xbb788c[_0x66e1('0x51')]},'raw':!![]})['then'](function(_0x7c6ced){if(_0x7c6ced&&_0x7c6ced[_0x66e1('0x52')]===0x0){return db[_0x66e1('0x27')]['create']({'name':_0x2db8f3[_0x66e1('0x2a')],'resourceId':_0x2db8f3['id'],'type':_0x7c6ced[_0x66e1('0x2a')],'sectionId':_0x7c6ced['id']},{})['then'](function(){return _0x441405;});}else{return _0x441405;}})['catch'](function(_0x14d27e){logger[_0x66e1('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14d27e);throw _0x14d27e;});}return _0x441405;})['then'](respondWithResult(_0x317424,0xc9))[_0x66e1('0x47')](handleError(_0x317424,null));};exports[_0x66e1('0x23')]=function(_0x172768,_0x1ef749){if(_0x172768[_0x66e1('0x4c')]['id']){delete _0x172768[_0x66e1('0x4c')]['id'];}return db[_0x66e1('0x2d')][_0x66e1('0x4a')]({'where':{'id':_0x172768['params']['id']}})[_0x66e1('0x24')](handleEntityNotFound(_0x1ef749,null))[_0x66e1('0x24')](saveUpdates(_0x172768[_0x66e1('0x4c')],null))[_0x66e1('0x24')](respondWithResult(_0x1ef749,null))['catch'](handleError(_0x1ef749,null));};exports[_0x66e1('0x25')]=function(_0x33eb7f,_0x169d5a){return db[_0x66e1('0x2d')][_0x66e1('0x4a')]({'where':{'id':_0x33eb7f[_0x66e1('0x53')]['id']}})[_0x66e1('0x24')](handleEntityNotFound(_0x169d5a,null))[_0x66e1('0x24')](removeEntity(_0x169d5a,null))[_0x66e1('0x47')](handleError(_0x169d5a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 1cbac90..6a19686 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 _0x85ed=['SIP/%s,%s','options','StopMixMonitor','length','concat','internal','name','agent','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','prefix','system','push','Set','CDR(type)=%s','chanspy','record','MixMonitor','format','recordingFormat','auth','merge','Authenticate','password','ChanSpy'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x85ed,0x15e));var _0xd85e=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x85ed[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xd85e('0x0'));var util=require(_0xd85e('0x1'));var BPromise=require('bluebird');var attributes=require(_0xd85e('0x2'));var getUserApplications=function(_0x2a1a5a,_0x4c9230,_0x32ae0a){var _0x2dd30a=0x1;var _0xb4332f=[];var _0x390e2a={'context':_0x4c9230[_0xd85e('0x3')]||_0xd85e('0x4'),'exten':util['format']('%s%s',_0x2a1a5a[_0xd85e('0x5')],_0x32ae0a),'type':_0xd85e('0x6'),'isApp':![],'ChanSpyId':_0x2a1a5a['id'],'UserId':_0x4c9230['id']};_0xb4332f[_0xd85e('0x7')](_['merge']({'app':_0xd85e('0x8'),'appdata':util['format'](_0xd85e('0x9'),_0xd85e('0xa')),'priority':_0x2dd30a++},_0x390e2a));if(_0x2a1a5a[_0xd85e('0xb')]){_0xb4332f[_0xd85e('0x7')](_['merge']({'app':_0xd85e('0xc'),'appdata':util[_0xd85e('0xd')]('${UNIQUEID}.%s,a',_0x2a1a5a[_0xd85e('0xe')]),'priority':_0x2dd30a++},_0x390e2a));}if(_0x2a1a5a[_0xd85e('0xf')]){_0xb4332f[_0xd85e('0x7')](_[_0xd85e('0x10')]({'app':_0xd85e('0x11'),'appdata':_0x2a1a5a[_0xd85e('0x12')],'priority':_0x2dd30a++},_0x390e2a));}_0xb4332f['push'](_[_0xd85e('0x10')]({'app':_0xd85e('0x13'),'appdata':util[_0xd85e('0xd')](_0xd85e('0x14'),_0x4c9230['name'],_0x2a1a5a[_0xd85e('0x15')]?_0x2a1a5a[_0xd85e('0x15')]['join'](''):''),'priority':_0x2dd30a++},_0x390e2a));if(_0x2a1a5a[_0xd85e('0xb')]){_0xb4332f[_0xd85e('0x7')](_[_0xd85e('0x10')]({'app':_0xd85e('0x16'),'priority':_0x2dd30a++},_0x390e2a));}return _0xb4332f;};var getChanSpyApplications=function(_0x1f1cfa,_0x34fbc1){var _0x1a4050=[];for(var _0x574f3e=0x0,_0x207baa=0x1;_0x574f3e<_0x34fbc1[_0xd85e('0x17')];_0x574f3e++,_0x207baa=0x1){_0x1a4050=_0x1a4050[_0xd85e('0x18')](getUserApplications(_0x1f1cfa,_0x34fbc1[_0x574f3e],_0x34fbc1[_0x574f3e]['internal']));if(_0x34fbc1[_0x574f3e][_0xd85e('0x19')]!=_0x34fbc1[_0x574f3e][_0xd85e('0x1a')]){_0x1a4050=_0x1a4050['concat'](getUserApplications(_0x1f1cfa,_0x34fbc1[_0x574f3e],_0x34fbc1[_0x574f3e][_0xd85e('0x1a')]));}}return _0x1a4050;};var getChanSpyPromise=function(_0x9664f2,_0x2124f4){return new BPromise(function(_0x3b3ee7,_0x5aa043){return _0x9664f2['User']['findAll']({'attributes':['id','name',_0xd85e('0x19')],'where':{'role':_0xd85e('0x1b'),'chanspy':!![]},'raw':!![]})[_0xd85e('0x1c')](function(_0x466b8c){if(_0x466b8c){return _0x3b3ee7(getChanSpyApplications(_0x2124f4,_0x466b8c));}return _0x3b3ee7([]);})[_0xd85e('0x1d')](function(_0x533967){_0x5aa043(_0x533967);});});};module[_0xd85e('0x1e')]=function(_0x124e9b,_0x4cdb6c){var _0x55c0a4=_0x124e9b[_0xd85e('0x1f')];return _0x124e9b[_0xd85e('0x20')](_0xd85e('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xe1a9dd,_0x56b2fe,_0x26feca){return getChanSpyPromise(_0x55c0a4,_0xe1a9dd)[_0xd85e('0x1c')](function(_0x399867){if(_0x399867&&_0x399867[_0xd85e('0x17')]){return _0x55c0a4[_0xd85e('0x22')][_0xd85e('0x23')](_0x399867);}})['then'](function(){_0x26feca();})[_0xd85e('0x1d')](function(_0x4e97d4){_0x26feca(_0x4e97d4);});},'afterUpdate':function(_0x16287d,_0x118ea4,_0x3e6366){return _0x55c0a4['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x16287d['id']}})[_0xd85e('0x1c')](function(){return getChanSpyPromise(_0x55c0a4,_0x16287d);})['then'](function(_0x20ac18){if(_0x20ac18&&_0x20ac18[_0xd85e('0x17')]){return _0x55c0a4[_0xd85e('0x22')]['bulkCreate'](_0x20ac18);}})[_0xd85e('0x1c')](function(){_0x3e6366();})[_0xd85e('0x1d')](function(_0x17471e){_0x3e6366(_0x17471e);});},'afterDestroy':function(_0x3aeeab,_0x7772c6,_0x1fed19){return _0x55c0a4[_0xd85e('0x22')][_0xd85e('0x24')]({'where':{'ChanSpyId':_0x3aeeab['id']}})[_0xd85e('0x1c')](function(){_0x1fed19();})['catch'](function(_0x51a916){_0x1fed19(_0x51a916);});}}});}; \ No newline at end of file +var _0x9039=['then','catch','exports','models','define','voice_chanspy','bulkCreate','destroy','VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','merge','Set','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','push','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','agent'];(function(_0x498b8f,_0x460c72){var _0x26c57e=function(_0x59f493){while(--_0x59f493){_0x498b8f['push'](_0x498b8f['shift']());}};_0x26c57e(++_0x460c72);}(_0x9039,0x1c3));var _0x9903=function(_0x270a12,_0x50745c){_0x270a12=_0x270a12-0x0;var _0x35ce30=_0x9039[_0x270a12];return _0x35ce30;};'use strict';var _=require(_0x9903('0x0'));var util=require(_0x9903('0x1'));var BPromise=require(_0x9903('0x2'));var attributes=require(_0x9903('0x3'));var getUserApplications=function(_0x1f9c41,_0x2e4568,_0x323238){var _0x1dde6d=0x1;var _0x37bb89=[];var _0x419906={'context':_0x2e4568[_0x9903('0x4')]||_0x9903('0x5'),'exten':util[_0x9903('0x6')]('%s%s',_0x1f9c41['prefix'],_0x323238),'type':'system','isApp':![],'ChanSpyId':_0x1f9c41['id'],'UserId':_0x2e4568['id']};_0x37bb89['push'](_[_0x9903('0x7')]({'app':_0x9903('0x8'),'appdata':util[_0x9903('0x6')](_0x9903('0x9'),'chanspy'),'priority':_0x1dde6d++},_0x419906));if(_0x1f9c41['record']){_0x37bb89['push'](_[_0x9903('0x7')]({'app':_0x9903('0xa'),'appdata':util[_0x9903('0x6')](_0x9903('0xb'),_0x1f9c41['recordingFormat']),'priority':_0x1dde6d++},_0x419906));}if(_0x1f9c41[_0x9903('0xc')]){_0x37bb89['push'](_[_0x9903('0x7')]({'app':_0x9903('0xd'),'appdata':_0x1f9c41['password'],'priority':_0x1dde6d++},_0x419906));}_0x37bb89[_0x9903('0xe')](_['merge']({'app':'ChanSpy','appdata':util[_0x9903('0x6')](_0x9903('0xf'),_0x2e4568[_0x9903('0x10')],_0x1f9c41[_0x9903('0x11')]?_0x1f9c41[_0x9903('0x11')][_0x9903('0x12')](''):''),'priority':_0x1dde6d++},_0x419906));if(_0x1f9c41[_0x9903('0x13')]){_0x37bb89['push'](_[_0x9903('0x7')]({'app':_0x9903('0x14'),'priority':_0x1dde6d++},_0x419906));}return _0x37bb89;};var getChanSpyApplications=function(_0x13ecf1,_0x323e2d){var _0x5a06e4=[];for(var _0x51fdbd=0x0,_0xd399e4=0x1;_0x51fdbd<_0x323e2d[_0x9903('0x15')];_0x51fdbd++,_0xd399e4=0x1){_0x5a06e4=_0x5a06e4[_0x9903('0x16')](getUserApplications(_0x13ecf1,_0x323e2d[_0x51fdbd],_0x323e2d[_0x51fdbd][_0x9903('0x17')]));if(_0x323e2d[_0x51fdbd][_0x9903('0x17')]!=_0x323e2d[_0x51fdbd][_0x9903('0x10')]){_0x5a06e4=_0x5a06e4[_0x9903('0x16')](getUserApplications(_0x13ecf1,_0x323e2d[_0x51fdbd],_0x323e2d[_0x51fdbd][_0x9903('0x10')]));}}return _0x5a06e4;};var getChanSpyPromise=function(_0x202158,_0x400c2e){return new BPromise(function(_0x50b073,_0xcb573f){return _0x202158['User']['findAll']({'attributes':['id',_0x9903('0x10'),_0x9903('0x17')],'where':{'role':_0x9903('0x18'),'chanspy':!![]},'raw':!![]})[_0x9903('0x19')](function(_0x26afc0){if(_0x26afc0){return _0x50b073(getChanSpyApplications(_0x400c2e,_0x26afc0));}return _0x50b073([]);})[_0x9903('0x1a')](function(_0x4aa142){_0xcb573f(_0x4aa142);});});};module[_0x9903('0x1b')]=function(_0x3c923e,_0xe724aa){var _0x5464a8=_0x3c923e[_0x9903('0x1c')];return _0x3c923e[_0x9903('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x9903('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41608b,_0x327763,_0x418ca7){return getChanSpyPromise(_0x5464a8,_0x41608b)['then'](function(_0xf28fd){if(_0xf28fd&&_0xf28fd[_0x9903('0x15')]){return _0x5464a8['VoiceExtension'][_0x9903('0x1f')](_0xf28fd);}})['then'](function(){_0x418ca7();})['catch'](function(_0x654819){_0x418ca7(_0x654819);});},'afterUpdate':function(_0x465d93,_0x37ccfa,_0x2bb826){return _0x5464a8['VoiceExtension'][_0x9903('0x20')]({'where':{'ChanSpyId':_0x465d93['id']}})[_0x9903('0x19')](function(){return getChanSpyPromise(_0x5464a8,_0x465d93);})['then'](function(_0x930795){if(_0x930795&&_0x930795[_0x9903('0x15')]){return _0x5464a8[_0x9903('0x21')][_0x9903('0x1f')](_0x930795);}})[_0x9903('0x19')](function(){_0x2bb826();})[_0x9903('0x1a')](function(_0x4570f1){_0x2bb826(_0x4570f1);});},'afterDestroy':function(_0xb97437,_0x46cd5e,_0x3b64c4){return _0x5464a8[_0x9903('0x21')][_0x9903('0x20')]({'where':{'ChanSpyId':_0xb97437['id']}})[_0x9903('0x19')](function(){_0x3b64c4();})[_0x9903('0x1a')](function(_0x370c38){_0x3b64c4(_0x370c38);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ea04467..2565a9b 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 _0x41bb=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x57a55f,_0x3182d3){var _0x50e8ab=function(_0xcb0dc7){while(--_0xcb0dc7){_0x57a55f['push'](_0x57a55f['shift']());}};_0x50e8ab(++_0x3182d3);}(_0x41bb,0xc5));var _0xb41b=function(_0x143727,_0x775f88){_0x143727=_0x143727-0x0;var _0x4753e5=_0x41bb[_0x143727];return _0x4753e5;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});} \ No newline at end of file +var _0xb49a=['info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3199af,_0x339560){var _0x5aa4d0=function(_0x1cb5f0){while(--_0x1cb5f0){_0x3199af['push'](_0x3199af['shift']());}};_0x5aa4d0(++_0x339560);}(_0xb49a,0xfb));var _0xab49=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xb49a[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require(_0xab49('0x3'));var rs=require(_0xab49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x5'))['db'];var utils=require(_0xab49('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab49('0x7'));var jayson=require(_0xab49('0x8'));var client=jayson[_0xab49('0x9')][_0xab49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea72,_0x26a98a,_0xd86a5){return new BPromise(function(_0x4d4d00,_0x15f259){return client[_0xab49('0xb')](_0x57ea72,_0xd86a5)[_0xab49('0xc')](function(_0x79f764){logger[_0xab49('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x26a98a,'request\x20sent');logger[_0xab49('0xe')](_0xab49('0xf'),_0x26a98a,_0xab49('0x10'),JSON[_0xab49('0x11')](_0x79f764));if(_0x79f764[_0xab49('0x12')]){if(_0x79f764['error'][_0xab49('0x13')]===0x1f4){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x15f259(_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);}logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x4d4d00(_0x79f764['error'][_0xab49('0x15')]);}else{logger[_0xab49('0xd')](_0xab49('0x14'),_0x26a98a,_0xab49('0x10'));_0x4d4d00(_0x79f764[_0xab49('0x16')]['message']);}})[_0xab49('0x17')](function(_0x2cbcff){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x2cbcff);_0x15f259(_0x2cbcff);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e579c4e..8059636 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 _0x6f69=['../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x5469ba,_0x52f08f){var _0x1a8518=function(_0x9714e8){while(--_0x9714e8){_0x5469ba['push'](_0x5469ba['shift']());}};_0x1a8518(++_0x52f08f);}(_0x6f69,0x8a));var _0x96f6=function(_0x5c2000,_0x8fa375){_0x5c2000=_0x5c2000-0x0;var _0x16da17=_0x6f69[_0x5c2000];return _0x16da17;};'use strict';var multer=require(_0x96f6('0x0'));var util=require(_0x96f6('0x1'));var path=require(_0x96f6('0x2'));var timeout=require(_0x96f6('0x3'));var express=require(_0x96f6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x96f6('0x5'));var interaction=require(_0x96f6('0x6'));var config=require(_0x96f6('0x7'));var controller=require(_0x96f6('0x8'));router[_0x96f6('0x9')]('/',auth['isAuthenticated'](),controller[_0x96f6('0xa')]);router['get'](_0x96f6('0xb'),auth[_0x96f6('0xc')](),controller[_0x96f6('0xd')]);router[_0x96f6('0xe')]('/',auth[_0x96f6('0xc')](),controller[_0x96f6('0xf')]);router[_0x96f6('0x10')](_0x96f6('0xb'),auth[_0x96f6('0xc')](),controller[_0x96f6('0x11')]);router['delete'](_0x96f6('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc5ac=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','update','delete'];(function(_0x155ef6,_0x2ade34){var _0x4e4164=function(_0x3b2486){while(--_0x3b2486){_0x155ef6['push'](_0x155ef6['shift']());}};_0x4e4164(++_0x2ade34);}(_0xc5ac,0x100));var _0xcc5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5ac[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xcc5a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc5a('0x1'));var router=express[_0xcc5a('0x2')]();var fs_extra=require(_0xcc5a('0x3'));var auth=require(_0xcc5a('0x4'));var interaction=require(_0xcc5a('0x5'));var config=require(_0xcc5a('0x6'));var controller=require(_0xcc5a('0x7'));router['get']('/',auth[_0xcc5a('0x8')](),controller[_0xcc5a('0x9')]);router[_0xcc5a('0xa')](_0xcc5a('0xb'),auth[_0xcc5a('0x8')](),controller[_0xcc5a('0xc')]);router[_0xcc5a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xcc5a('0xb'),auth[_0xcc5a('0x8')](),controller[_0xcc5a('0xe')]);router[_0xcc5a('0xf')](_0xcc5a('0xb'),auth[_0xcc5a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index d49f2a7..c436100 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 _0x6ad5=['BOOLEAN','sequelize','STRING','name'];(function(_0x25b5c1,_0x15f706){var _0x15cb0d=function(_0x269d4e){while(--_0x269d4e){_0x25b5c1['push'](_0x25b5c1['shift']());}};_0x15cb0d(++_0x15f706);}(_0x6ad5,0x1e1));var _0x56ad=function(_0x5c338d,_0x2c9274){_0x5c338d=_0x5c338d-0x0;var _0x28f8f5=_0x6ad5[_0x5c338d];return _0x28f8f5;};'use strict';var Sequelize=require(_0x56ad('0x0'));module['exports']={'name':{'type':Sequelize[_0x56ad('0x1')],'unique':_0x56ad('0x2')},'description':{'type':Sequelize[_0x56ad('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x56ad('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1dec=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x1dec,0x157));var _0xc1de=function(_0x45c388,_0xb70f0a){_0x45c388=_0x45c388-0x0;var _0x24acb7=_0x1dec[_0x45c388];return _0x24acb7;};'use strict';var Sequelize=require(_0xc1de('0x0'));module[_0xc1de('0x1')]={'name':{'type':Sequelize[_0xc1de('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xc1de('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc1de('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 2b8ad32..d581915 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 _0x62a3=['Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','readFileSync','writeFileSync','render','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/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','client','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','create','body','findAll','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf'];(function(_0xf35621,_0xa71e8c){var _0x46ec28=function(_0x50d7d9){while(--_0x50d7d9){_0xf35621['push'](_0xf35621['shift']());}};_0x46ec28(++_0xa71e8c);}(_0x62a3,0xe2));var _0x362a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x62a3[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x362a('0x0'));var rimraf=require(_0x362a('0x1'));var zipdir=require(_0x362a('0x2'));var jsonpatch=require(_0x362a('0x3'));var rp=require('request-promise');var moment=require(_0x362a('0x4'));var BPromise=require(_0x362a('0x5'));var Mustache=require(_0x362a('0x6'));var util=require(_0x362a('0x7'));var path=require(_0x362a('0x8'));var sox=require(_0x362a('0x9'));var csv=require(_0x362a('0xa'));var ejs=require(_0x362a('0xb'));var fs=require('fs');var fs_extra=require(_0x362a('0xc'));var _=require(_0x362a('0xd'));var squel=require(_0x362a('0xe'));var crypto=require(_0x362a('0xf'));var jsforce=require(_0x362a('0x10'));var deskjs=require(_0x362a('0x11'));var toCsv=require(_0x362a('0xa'));var querystring=require(_0x362a('0x12'));var Papa=require(_0x362a('0x13'));var Redis=require(_0x362a('0x14'));var authService=require(_0x362a('0x15'));var qs=require(_0x362a('0x16'));var as=require(_0x362a('0x17'));var hardwareService=require(_0x362a('0x18'));var logger=require(_0x362a('0x19'))('api');var utils=require(_0x362a('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x362a('0x1b'));var db=require(_0x362a('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x362a('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d66e8,_0x2db1fb,_0x22371c,_0x37893c){return new BPromise(function(_0x9ec41c,_0x1b196b){var _0x460325=_0x37893c||client;return _0x460325[_0x362a('0x1e')](_0x4d66e8,_0x22371c)['then'](function(_0x534cc4){logger[_0x362a('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x2db1fb,_0x362a('0x20'));logger[_0x362a('0x21')](_0x362a('0x22'),_0x2db1fb,_0x362a('0x20'),JSON[_0x362a('0x23')](_0x534cc4));if(_0x534cc4['error']){if(_0x534cc4[_0x362a('0x24')][_0x362a('0x25')]===0x1f4){logger['error'](_0x362a('0x26'),_0x2db1fb,_0x534cc4[_0x362a('0x24')][_0x362a('0x27')]);return _0x1b196b(_0x534cc4[_0x362a('0x24')][_0x362a('0x27')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x2db1fb,_0x534cc4['error'][_0x362a('0x27')]);return _0x9ec41c(_0x534cc4['error'][_0x362a('0x27')]);}else{logger['info'](_0x362a('0x26'),_0x2db1fb,_0x362a('0x20'));_0x9ec41c(_0x534cc4[_0x362a('0x28')][_0x362a('0x27')]);}})[_0x362a('0x29')](function(_0x1352c4){logger[_0x362a('0x24')](_0x362a('0x26'),_0x2db1fb,_0x1352c4);_0x1b196b(_0x1352c4);});});}function respondWithStatusCode(_0x5605eb,_0x13cfef){_0x13cfef=_0x13cfef||0xcc;return function(_0x35901e){if(_0x35901e){return _0x5605eb[_0x362a('0x2a')](_0x13cfef);}return _0x5605eb[_0x362a('0x2b')](_0x13cfef)[_0x362a('0x2c')]();};}function respondWithResult(_0x53dcd5,_0x51c9d0){_0x51c9d0=_0x51c9d0||0xc8;return function(_0x2342ab){if(_0x2342ab){return _0x53dcd5[_0x362a('0x2b')](_0x51c9d0)[_0x362a('0x2d')](_0x2342ab);}};}function respondWithFilteredResult(_0x2d0631,_0xe4f6a){return function(_0x3867cc){if(_0x3867cc){var _0x3f1aaa=typeof _0xe4f6a[_0x362a('0x2e')]==='undefined'&&typeof _0xe4f6a[_0x362a('0x2f')]===_0x362a('0x30');var _0x290807=_0x3867cc[_0x362a('0x31')];var _0x46e98e=_0x3f1aaa?0x0:_0xe4f6a['offset'];var _0x2dfbe9=_0x3f1aaa?_0x3867cc[_0x362a('0x31')]:_0xe4f6a['offset']+_0xe4f6a[_0x362a('0x2f')];var _0x2b01f2;if(_0x2dfbe9>=_0x290807){_0x2dfbe9=_0x290807;_0x2b01f2=0xc8;}else{_0x2b01f2=0xce;}_0x2d0631[_0x362a('0x2b')](_0x2b01f2);return _0x2d0631[_0x362a('0x32')](_0x362a('0x33'),_0x46e98e+'-'+_0x2dfbe9+'/'+_0x290807)[_0x362a('0x2d')](_0x3867cc);}return null;};}function patchUpdates(_0x32ac8c){return function(_0x143408){try{jsonpatch[_0x362a('0x34')](_0x143408,_0x32ac8c,!![]);}catch(_0x468217){return BPromise[_0x362a('0x35')](_0x468217);}return _0x143408['save']();};}function saveUpdates(_0x27852d,_0x34a4c6){return function(_0x3ccab6){if(_0x3ccab6){return _0x3ccab6[_0x362a('0x36')](_0x27852d)[_0x362a('0x37')](function(_0x4d5b4e){return _0x4d5b4e;});}return null;};}function removeEntity(_0x46c55f,_0x1ad98e){return function(_0x4fae2b){if(_0x4fae2b){return _0x4fae2b[_0x362a('0x38')]()['then'](function(){var _0x1f1d84=_0x4fae2b[_0x362a('0x39')]({'plain':!![]});var _0x26d04d=_0x362a('0x3a');return db[_0x362a('0x3b')][_0x362a('0x38')]({'where':{'type':_0x26d04d,'resourceId':_0x1f1d84['id']}})[_0x362a('0x37')](function(){return _0x4fae2b;});})[_0x362a('0x37')](function(){_0x46c55f[_0x362a('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x397cc6,_0x5ec271){return function(_0x220f01){if(!_0x220f01){_0x397cc6[_0x362a('0x2a')](0x194);}return _0x220f01;};}function handleError(_0x4bff95,_0x2158d5){_0x2158d5=_0x2158d5||0x1f4;return function(_0x186aeb){logger[_0x362a('0x24')](_0x186aeb[_0x362a('0x3c')]);if(_0x186aeb[_0x362a('0x3d')]){delete _0x186aeb['name'];}_0x4bff95['status'](_0x2158d5)[_0x362a('0x3e')](_0x186aeb);};}exports[_0x362a('0x3f')]=function(_0x1084b4,_0x23081c){var _0x548f41={},_0x356b44={},_0x233103={'count':0x0,'rows':[]};var _0xdb4903=_[_0x362a('0x40')](db[_0x362a('0x41')][_0x362a('0x42')],function(_0x4dee2b){return{'name':_0x4dee2b[_0x362a('0x43')],'type':_0x4dee2b[_0x362a('0x44')][_0x362a('0x45')]};});_0x356b44[_0x362a('0x46')]=_[_0x362a('0x40')](_0xdb4903,_0x362a('0x3d'));_0x356b44['query']=_[_0x362a('0x47')](_0x1084b4['query']);_0x356b44[_0x362a('0x48')]=_['intersection'](_0x356b44[_0x362a('0x46')],_0x356b44[_0x362a('0x49')]);_0x548f41[_0x362a('0x4a')]=_[_0x362a('0x4b')](_0x356b44['model'],qs[_0x362a('0x4c')](_0x1084b4[_0x362a('0x49')][_0x362a('0x4c')]));_0x548f41['attributes']=_0x548f41[_0x362a('0x4a')][_0x362a('0x4d')]?_0x548f41['attributes']:_0x356b44['model'];if(!_0x1084b4['query']['hasOwnProperty']('nolimit')){_0x548f41[_0x362a('0x2f')]=qs[_0x362a('0x2f')](_0x1084b4[_0x362a('0x49')][_0x362a('0x2f')]);_0x548f41['offset']=qs[_0x362a('0x2e')](_0x1084b4['query'][_0x362a('0x2e')]);}_0x548f41['order']=qs[_0x362a('0x4e')](_0x1084b4['query'][_0x362a('0x4e')]);_0x548f41[_0x362a('0x4f')]=qs['filters'](_['pick'](_0x1084b4[_0x362a('0x49')],_0x356b44[_0x362a('0x48')]),_0xdb4903);if(_0x1084b4[_0x362a('0x49')][_0x362a('0x50')]){_0x548f41['where']=_[_0x362a('0x51')](_0x548f41['where'],{'$or':_[_0x362a('0x40')](_0xdb4903,function(_0x78239a){if(_0x78239a['type']!==_0x362a('0x52')){var _0x53ef9a={};_0x53ef9a[_0x78239a[_0x362a('0x3d')]]={'$like':'%'+_0x1084b4[_0x362a('0x49')][_0x362a('0x50')]+'%'};return _0x53ef9a;}})});}_0x548f41=_['merge']({},_0x548f41,_0x1084b4[_0x362a('0x53')]);var _0x28e5ec={'where':_0x548f41[_0x362a('0x4f')]};return db[_0x362a('0x41')][_0x362a('0x31')](_0x28e5ec)[_0x362a('0x37')](function(_0x1ff709){_0x233103[_0x362a('0x31')]=_0x1ff709;if(_0x1084b4[_0x362a('0x49')][_0x362a('0x54')]){_0x548f41['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x548f41);})[_0x362a('0x37')](function(_0x14b867){_0x233103[_0x362a('0x55')]=_0x14b867;return _0x233103;})[_0x362a('0x37')](respondWithFilteredResult(_0x23081c,_0x548f41))[_0x362a('0x29')](handleError(_0x23081c,null));};exports[_0x362a('0x56')]=function(_0x3463e5,_0xc85a69){var _0x12f86d={'raw':![],'where':{'id':_0x3463e5[_0x362a('0x57')]['id']}},_0x1fb2fb={};_0x1fb2fb[_0x362a('0x46')]=_['keys'](db[_0x362a('0x41')][_0x362a('0x42')]);_0x1fb2fb[_0x362a('0x49')]=_[_0x362a('0x47')](_0x3463e5[_0x362a('0x49')]);_0x1fb2fb[_0x362a('0x48')]=_[_0x362a('0x4b')](_0x1fb2fb[_0x362a('0x46')],_0x1fb2fb[_0x362a('0x49')]);_0x12f86d[_0x362a('0x4a')]=_[_0x362a('0x4b')](_0x1fb2fb[_0x362a('0x46')],qs[_0x362a('0x4c')](_0x3463e5[_0x362a('0x49')][_0x362a('0x4c')]));_0x12f86d[_0x362a('0x4a')]=_0x12f86d[_0x362a('0x4a')]['length']?_0x12f86d[_0x362a('0x4a')]:_0x1fb2fb[_0x362a('0x46')];if(_0x3463e5[_0x362a('0x49')][_0x362a('0x54')]){_0x12f86d[_0x362a('0x58')]=[{'all':!![]}];}_0x12f86d=_['merge']({},_0x12f86d,_0x3463e5['options']);return db['VoiceContext'][_0x362a('0x59')](_0x12f86d)[_0x362a('0x37')](handleEntityNotFound(_0xc85a69,null))[_0x362a('0x37')](respondWithResult(_0xc85a69,null))['catch'](handleError(_0xc85a69,null));};exports[_0x362a('0x5a')]=function(_0x1c4204,_0x57cbb0,_0x5ed74f){var _0x5de846;return db['VoiceContext']['create'](_0x1c4204[_0x362a('0x5b')],{'raw':!![]})['then'](function(_0xdf27fe){_0x5de846=_0xdf27fe;return db[_0x362a('0x41')][_0x362a('0x5c')]({'raw':!![]});})[_0x362a('0x37')](function(_0x2aa367){var _0x474819=fs['readFileSync'](path[_0x362a('0x5d')](config[_0x362a('0x5e')],_0x362a('0x5f')),_0x362a('0x60'));var _0x585f52=ejs['render'](_0x474819,{'contexts':_0x2aa367||[]});fs['writeFileSync'](_0x362a('0x61'),_0x585f52);})[_0x362a('0x37')](function(){return respondWithRpcPromise(_0x362a('0x62'),_0x362a('0x5a'),{'module':_0x362a('0x63')});})[_0x362a('0x37')](function(){var _0x240e43=_0x1c4204['user'][_0x362a('0x39')]({'plain':!![]});if(!_0x240e43)throw new Error(_0x362a('0x64'));if(_0x240e43[_0x362a('0x65')]===_0x362a('0x66')){var _0x47a7f8=_0x5de846['get']({'plain':!![]});return db[_0x362a('0x67')][_0x362a('0x59')]({'where':{'name':'Contexts','userProfileId':_0x240e43[_0x362a('0x68')]},'raw':!![]})['then'](function(_0x4f79d2){if(_0x4f79d2&&_0x4f79d2['autoAssociation']===0x0){return db[_0x362a('0x3b')]['create']({'name':_0x47a7f8[_0x362a('0x3d')],'resourceId':_0x47a7f8['id'],'type':_0x4f79d2[_0x362a('0x3d')],'sectionId':_0x4f79d2['id']},{})[_0x362a('0x37')](function(){return _0x5de846;});}else{return _0x5de846;}})[_0x362a('0x29')](function(_0x27054e){logger[_0x362a('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27054e);throw _0x27054e;});}return _0x5de846;})[_0x362a('0x37')](respondWithResult(_0x57cbb0,0xc9))[_0x362a('0x29')](handleError(_0x57cbb0,null));};exports[_0x362a('0x36')]=function(_0x2e0435,_0x56a893,_0x507a32){var _0x1b6afa;return db[_0x362a('0x41')]['find']({'where':{'id':_0x2e0435[_0x362a('0x57')]['id']}})[_0x362a('0x37')](handleEntityNotFound(_0x56a893,null))[_0x362a('0x37')](saveUpdates(_0x2e0435[_0x362a('0x5b')],null))[_0x362a('0x37')](function(_0x2ea0d8){if(_0x2ea0d8){_0x1b6afa=_0x2ea0d8;return db['VoiceContext'][_0x362a('0x5c')]({'raw':!![]});}})[_0x362a('0x37')](function(_0x1224bc){var _0x34ff7f=fs[_0x362a('0x69')](path['join'](config['root'],_0x362a('0x5f')),'utf8');var _0x21ed95=ejs['render'](_0x34ff7f,{'contexts':_0x1224bc||[]});fs[_0x362a('0x6a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x21ed95);})[_0x362a('0x37')](function(){return respondWithRpcPromise(_0x362a('0x62'),'update',{'module':_0x362a('0x63')});})['then'](function(){return _0x1b6afa;})[_0x362a('0x37')](respondWithResult(_0x56a893,null))[_0x362a('0x29')](handleError(_0x56a893,null));};exports[_0x362a('0x38')]=function(_0x576ac2,_0x5a6a3d,_0x3fdd79){var _0x3a39c0;return db[_0x362a('0x41')][_0x362a('0x59')]({'where':{'id':_0x576ac2[_0x362a('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a6a3d,null))[_0x362a('0x37')](removeEntity(_0x5a6a3d,null))['then'](function(){return db[_0x362a('0x41')][_0x362a('0x5c')]({'raw':!![]});})['then'](function(_0x3ff610){var _0x3a45db=fs['readFileSync'](path[_0x362a('0x5d')](config[_0x362a('0x5e')],_0x362a('0x5f')),_0x362a('0x60'));var _0x217c25=ejs[_0x362a('0x6b')](_0x3a45db,{'contexts':_0x3ff610});fs[_0x362a('0x6a')](_0x362a('0x61'),_0x217c25);return respondWithRpcPromise(_0x362a('0x62'),_0x362a('0x38'),{'module':'chan_sip.so'});})[_0x362a('0x29')](handleError(_0x5a6a3d,null));}; \ No newline at end of file +var _0xfb3f=['destroy','Contexts','UserProfileResource','stack','name','send','index','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceContext','includeAll','include','findAll','show','params','keys','options','find','create','body','join','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','server/files/templates/context.ejs','readFileSync','root','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','undefined','offset','count','limit','set','json','save','update'];(function(_0x29e327,_0x2b6ea9){var _0x3dac9e=function(_0x5c0e02){while(--_0x5c0e02){_0x29e327['push'](_0x29e327['shift']());}};_0x3dac9e(++_0x2b6ea9);}(_0xfb3f,0x99));var _0xffb3=function(_0x150766,_0x458f38){_0x150766=_0x150766-0x0;var _0x12a585=_0xfb3f[_0x150766];return _0x12a585;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require(_0xffb3('0x2'));var jsonpatch=require(_0xffb3('0x3'));var rp=require(_0xffb3('0x4'));var moment=require(_0xffb3('0x5'));var BPromise=require(_0xffb3('0x6'));var Mustache=require(_0xffb3('0x7'));var util=require(_0xffb3('0x8'));var path=require(_0xffb3('0x9'));var sox=require(_0xffb3('0xa'));var csv=require(_0xffb3('0xb'));var ejs=require(_0xffb3('0xc'));var fs=require('fs');var fs_extra=require(_0xffb3('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xffb3('0xe'));var toCsv=require(_0xffb3('0xb'));var querystring=require('querystring');var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xffb3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xffb3('0x11'));var logger=require(_0xffb3('0x12'))('api');var utils=require(_0xffb3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xffb3('0x14'));var db=require(_0xffb3('0x15'))['db'];var jayson=require(_0xffb3('0x16'));var client=jayson['client'][_0xffb3('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4873a2,_0xff0caa,_0x30cb3a,_0x1a8e33){return new BPromise(function(_0x3d5539,_0x440edd){var _0x2f832f=_0x1a8e33||client;return _0x2f832f['request'](_0x4873a2,_0x30cb3a)[_0xffb3('0x18')](function(_0x5eee20){logger[_0xffb3('0x19')](_0xffb3('0x1a'),_0xff0caa,_0xffb3('0x1b'));logger[_0xffb3('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xff0caa,_0xffb3('0x1b'),JSON[_0xffb3('0x1d')](_0x5eee20));if(_0x5eee20[_0xffb3('0x1e')]){if(_0x5eee20[_0xffb3('0x1e')]['code']===0x1f4){logger[_0xffb3('0x1e')]('VoiceContext,\x20%s,\x20%s',_0xff0caa,_0x5eee20[_0xffb3('0x1e')][_0xffb3('0x1f')]);return _0x440edd(_0x5eee20[_0xffb3('0x1e')][_0xffb3('0x1f')]);}logger[_0xffb3('0x1e')](_0xffb3('0x1a'),_0xff0caa,_0x5eee20[_0xffb3('0x1e')]['message']);return _0x3d5539(_0x5eee20[_0xffb3('0x1e')][_0xffb3('0x1f')]);}else{logger[_0xffb3('0x19')](_0xffb3('0x1a'),_0xff0caa,_0xffb3('0x1b'));_0x3d5539(_0x5eee20[_0xffb3('0x20')][_0xffb3('0x1f')]);}})[_0xffb3('0x21')](function(_0x1a2958){logger['error'](_0xffb3('0x1a'),_0xff0caa,_0x1a2958);_0x440edd(_0x1a2958);});});}function respondWithStatusCode(_0x4ed94e,_0x5af32f){_0x5af32f=_0x5af32f||0xcc;return function(_0x42c3b0){if(_0x42c3b0){return _0x4ed94e[_0xffb3('0x22')](_0x5af32f);}return _0x4ed94e[_0xffb3('0x23')](_0x5af32f)[_0xffb3('0x24')]();};}function respondWithResult(_0x146385,_0x29fa32){_0x29fa32=_0x29fa32||0xc8;return function(_0x4da7da){if(_0x4da7da){return _0x146385[_0xffb3('0x23')](_0x29fa32)['json'](_0x4da7da);}};}function respondWithFilteredResult(_0x2dd9f4,_0x10fbd6){return function(_0x22b33d){if(_0x22b33d){var _0x5fa11f=typeof _0x10fbd6['offset']===_0xffb3('0x25')&&typeof _0x10fbd6['limit']===_0xffb3('0x25');var _0x1cd811=_0x22b33d['count'];var _0x54b465=_0x5fa11f?0x0:_0x10fbd6[_0xffb3('0x26')];var _0x2ea14f=_0x5fa11f?_0x22b33d[_0xffb3('0x27')]:_0x10fbd6['offset']+_0x10fbd6[_0xffb3('0x28')];var _0x355de1;if(_0x2ea14f>=_0x1cd811){_0x2ea14f=_0x1cd811;_0x355de1=0xc8;}else{_0x355de1=0xce;}_0x2dd9f4[_0xffb3('0x23')](_0x355de1);return _0x2dd9f4[_0xffb3('0x29')]('Content-Range',_0x54b465+'-'+_0x2ea14f+'/'+_0x1cd811)[_0xffb3('0x2a')](_0x22b33d);}return null;};}function patchUpdates(_0x15a1e2){return function(_0x4a5da8){try{jsonpatch['apply'](_0x4a5da8,_0x15a1e2,!![]);}catch(_0x4244a0){return BPromise['reject'](_0x4244a0);}return _0x4a5da8[_0xffb3('0x2b')]();};}function saveUpdates(_0xe7574b,_0x183b0a){return function(_0x6faf07){if(_0x6faf07){return _0x6faf07[_0xffb3('0x2c')](_0xe7574b)[_0xffb3('0x18')](function(_0x40500e){return _0x40500e;});}return null;};}function removeEntity(_0x5334f3,_0xd9f2b1){return function(_0x3ed32b){if(_0x3ed32b){return _0x3ed32b[_0xffb3('0x2d')]()['then'](function(){var _0x41c964=_0x3ed32b['get']({'plain':!![]});var _0x235175=_0xffb3('0x2e');return db[_0xffb3('0x2f')][_0xffb3('0x2d')]({'where':{'type':_0x235175,'resourceId':_0x41c964['id']}})[_0xffb3('0x18')](function(){return _0x3ed32b;});})[_0xffb3('0x18')](function(){_0x5334f3['status'](0xcc)[_0xffb3('0x24')]();});}};}function handleEntityNotFound(_0x3f8173,_0x3e6828){return function(_0x2894da){if(!_0x2894da){_0x3f8173[_0xffb3('0x22')](0x194);}return _0x2894da;};}function handleError(_0xc890b1,_0x5041da){_0x5041da=_0x5041da||0x1f4;return function(_0x1414a8){logger[_0xffb3('0x1e')](_0x1414a8[_0xffb3('0x30')]);if(_0x1414a8[_0xffb3('0x31')]){delete _0x1414a8[_0xffb3('0x31')];}_0xc890b1[_0xffb3('0x23')](_0x5041da)[_0xffb3('0x32')](_0x1414a8);};}exports[_0xffb3('0x33')]=function(_0x517a85,_0x475bf2){var _0x551f09={},_0x1654a6={},_0x1bbe83={'count':0x0,'rows':[]};var _0x513bea=_['map'](db['VoiceContext'][_0xffb3('0x34')],function(_0x2d81be){return{'name':_0x2d81be['fieldName'],'type':_0x2d81be[_0xffb3('0x35')]['key']};});_0x1654a6[_0xffb3('0x36')]=_[_0xffb3('0x37')](_0x513bea,_0xffb3('0x31'));_0x1654a6[_0xffb3('0x38')]=_['keys'](_0x517a85[_0xffb3('0x38')]);_0x1654a6[_0xffb3('0x39')]=_[_0xffb3('0x3a')](_0x1654a6[_0xffb3('0x36')],_0x1654a6['query']);_0x551f09['attributes']=_[_0xffb3('0x3a')](_0x1654a6[_0xffb3('0x36')],qs[_0xffb3('0x3b')](_0x517a85['query'][_0xffb3('0x3b')]));_0x551f09['attributes']=_0x551f09[_0xffb3('0x3c')][_0xffb3('0x3d')]?_0x551f09[_0xffb3('0x3c')]:_0x1654a6[_0xffb3('0x36')];if(!_0x517a85['query'][_0xffb3('0x3e')](_0xffb3('0x3f'))){_0x551f09['limit']=qs[_0xffb3('0x28')](_0x517a85[_0xffb3('0x38')][_0xffb3('0x28')]);_0x551f09[_0xffb3('0x26')]=qs[_0xffb3('0x26')](_0x517a85[_0xffb3('0x38')]['offset']);}_0x551f09[_0xffb3('0x40')]=qs[_0xffb3('0x41')](_0x517a85[_0xffb3('0x38')][_0xffb3('0x41')]);_0x551f09[_0xffb3('0x42')]=qs[_0xffb3('0x39')](_[_0xffb3('0x43')](_0x517a85[_0xffb3('0x38')],_0x1654a6[_0xffb3('0x39')]),_0x513bea);if(_0x517a85['query'][_0xffb3('0x44')]){_0x551f09[_0xffb3('0x42')]=_[_0xffb3('0x45')](_0x551f09[_0xffb3('0x42')],{'$or':_[_0xffb3('0x37')](_0x513bea,function(_0x23b845){if(_0x23b845[_0xffb3('0x35')]!==_0xffb3('0x46')){var _0x3e7357={};_0x3e7357[_0x23b845[_0xffb3('0x31')]]={'$like':'%'+_0x517a85['query']['filter']+'%'};return _0x3e7357;}})});}_0x551f09=_[_0xffb3('0x45')]({},_0x551f09,_0x517a85['options']);var _0x57658e={'where':_0x551f09[_0xffb3('0x42')]};return db[_0xffb3('0x47')][_0xffb3('0x27')](_0x57658e)[_0xffb3('0x18')](function(_0x374db1){_0x1bbe83[_0xffb3('0x27')]=_0x374db1;if(_0x517a85['query'][_0xffb3('0x48')]){_0x551f09[_0xffb3('0x49')]=[{'all':!![]}];}return db[_0xffb3('0x47')][_0xffb3('0x4a')](_0x551f09);})['then'](function(_0x33732c){_0x1bbe83['rows']=_0x33732c;return _0x1bbe83;})[_0xffb3('0x18')](respondWithFilteredResult(_0x475bf2,_0x551f09))[_0xffb3('0x21')](handleError(_0x475bf2,null));};exports[_0xffb3('0x4b')]=function(_0x45a3b0,_0x54dde8){var _0x323d2e={'raw':![],'where':{'id':_0x45a3b0[_0xffb3('0x4c')]['id']}},_0xce6b8a={};_0xce6b8a['model']=_[_0xffb3('0x4d')](db[_0xffb3('0x47')][_0xffb3('0x34')]);_0xce6b8a[_0xffb3('0x38')]=_['keys'](_0x45a3b0['query']);_0xce6b8a[_0xffb3('0x39')]=_[_0xffb3('0x3a')](_0xce6b8a[_0xffb3('0x36')],_0xce6b8a['query']);_0x323d2e[_0xffb3('0x3c')]=_[_0xffb3('0x3a')](_0xce6b8a[_0xffb3('0x36')],qs[_0xffb3('0x3b')](_0x45a3b0[_0xffb3('0x38')][_0xffb3('0x3b')]));_0x323d2e[_0xffb3('0x3c')]=_0x323d2e['attributes'][_0xffb3('0x3d')]?_0x323d2e[_0xffb3('0x3c')]:_0xce6b8a[_0xffb3('0x36')];if(_0x45a3b0[_0xffb3('0x38')][_0xffb3('0x48')]){_0x323d2e[_0xffb3('0x49')]=[{'all':!![]}];}_0x323d2e=_[_0xffb3('0x45')]({},_0x323d2e,_0x45a3b0[_0xffb3('0x4e')]);return db['VoiceContext'][_0xffb3('0x4f')](_0x323d2e)['then'](handleEntityNotFound(_0x54dde8,null))[_0xffb3('0x18')](respondWithResult(_0x54dde8,null))[_0xffb3('0x21')](handleError(_0x54dde8,null));};exports['create']=function(_0x43e19d,_0x1d6021,_0xc66216){var _0xc1b412;return db[_0xffb3('0x47')][_0xffb3('0x50')](_0x43e19d[_0xffb3('0x51')],{'raw':!![]})[_0xffb3('0x18')](function(_0x18754b){_0xc1b412=_0x18754b;return db[_0xffb3('0x47')]['findAll']({'raw':!![]});})[_0xffb3('0x18')](function(_0x705867){var _0x198f93=fs['readFileSync'](path[_0xffb3('0x52')](config['root'],'server/files/templates/context.ejs'),_0xffb3('0x53'));var _0x1724f7=ejs[_0xffb3('0x54')](_0x198f93,{'contexts':_0x705867||[]});fs[_0xffb3('0x55')](_0xffb3('0x56'),_0x1724f7);})[_0xffb3('0x18')](function(){return respondWithRpcPromise('Reload','create',{'module':_0xffb3('0x57')});})[_0xffb3('0x18')](function(){var _0x445158=_0x43e19d['user'][_0xffb3('0x58')]({'plain':!![]});if(!_0x445158)throw new Error(_0xffb3('0x59'));if(_0x445158[_0xffb3('0x5a')]===_0xffb3('0x5b')){var _0x12b1d6=_0xc1b412['get']({'plain':!![]});return db[_0xffb3('0x5c')]['find']({'where':{'name':'Contexts','userProfileId':_0x445158[_0xffb3('0x5d')]},'raw':!![]})[_0xffb3('0x18')](function(_0x52577c){if(_0x52577c&&_0x52577c[_0xffb3('0x5e')]===0x0){return db[_0xffb3('0x2f')][_0xffb3('0x50')]({'name':_0x12b1d6[_0xffb3('0x31')],'resourceId':_0x12b1d6['id'],'type':_0x52577c[_0xffb3('0x31')],'sectionId':_0x52577c['id']},{})[_0xffb3('0x18')](function(){return _0xc1b412;});}else{return _0xc1b412;}})[_0xffb3('0x21')](function(_0x3c50e4){logger[_0xffb3('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c50e4);throw _0x3c50e4;});}return _0xc1b412;})[_0xffb3('0x18')](respondWithResult(_0x1d6021,0xc9))[_0xffb3('0x21')](handleError(_0x1d6021,null));};exports[_0xffb3('0x2c')]=function(_0x1ed38a,_0x12612f,_0x39c25d){var _0x5933d0;return db[_0xffb3('0x47')][_0xffb3('0x4f')]({'where':{'id':_0x1ed38a['params']['id']}})[_0xffb3('0x18')](handleEntityNotFound(_0x12612f,null))[_0xffb3('0x18')](saveUpdates(_0x1ed38a[_0xffb3('0x51')],null))[_0xffb3('0x18')](function(_0x17e9f8){if(_0x17e9f8){_0x5933d0=_0x17e9f8;return db[_0xffb3('0x47')][_0xffb3('0x4a')]({'raw':!![]});}})[_0xffb3('0x18')](function(_0x3e8f83){var _0x3485d1=fs['readFileSync'](path[_0xffb3('0x52')](config['root'],_0xffb3('0x5f')),_0xffb3('0x53'));var _0x3bec11=ejs[_0xffb3('0x54')](_0x3485d1,{'contexts':_0x3e8f83||[]});fs[_0xffb3('0x55')](_0xffb3('0x56'),_0x3bec11);})[_0xffb3('0x18')](function(){return respondWithRpcPromise('Reload',_0xffb3('0x2c'),{'module':_0xffb3('0x57')});})[_0xffb3('0x18')](function(){return _0x5933d0;})['then'](respondWithResult(_0x12612f,null))[_0xffb3('0x21')](handleError(_0x12612f,null));};exports[_0xffb3('0x2d')]=function(_0x943899,_0x5d1d56,_0x91f05){var _0x2839cb;return db[_0xffb3('0x47')][_0xffb3('0x4f')]({'where':{'id':_0x943899[_0xffb3('0x4c')]['id']}})[_0xffb3('0x18')](handleEntityNotFound(_0x5d1d56,null))['then'](removeEntity(_0x5d1d56,null))['then'](function(){return db[_0xffb3('0x47')][_0xffb3('0x4a')]({'raw':!![]});})[_0xffb3('0x18')](function(_0x34406b){var _0xd7c2bd=fs[_0xffb3('0x60')](path[_0xffb3('0x52')](config[_0xffb3('0x61')],_0xffb3('0x5f')),_0xffb3('0x53'));var _0x2598f0=ejs[_0xffb3('0x54')](_0xd7c2bd,{'contexts':_0x34406b});fs['writeFileSync'](_0xffb3('0x56'),_0x2598f0);return respondWithRpcPromise(_0xffb3('0x62'),_0xffb3('0x2d'),{'module':_0xffb3('0x57')});})['catch'](handleError(_0x5d1d56,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index a176026..59a0aba 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 _0xafb2=['../../config/logger','bluebird','path','./voiceContext.attributes','exports','define','voice_contexts','lodash','util'];(function(_0x75b0e8,_0x4f0954){var _0xb93ff=function(_0x33ba4b){while(--_0x33ba4b){_0x75b0e8['push'](_0x75b0e8['shift']());}};_0xb93ff(++_0x4f0954);}(_0xafb2,0x73));var _0x2afb=function(_0x4353dc,_0x53196a){_0x4353dc=_0x4353dc-0x0;var _0xea058d=_0xafb2[_0x4353dc];return _0xea058d;};'use strict';var _=require(_0x2afb('0x0'));var util=require(_0x2afb('0x1'));var logger=require(_0x2afb('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2afb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2afb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2afb('0x5'));module[_0x2afb('0x6')]=function(_0x2e37c6,_0x1e542b){return _0x2e37c6[_0x2afb('0x7')]('VoiceContext',attributes,{'tableName':_0x2afb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf98d=['./voiceContext.attributes','define','VoiceContext','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x149736,_0x15dbc4){var _0x3c9a80=function(_0x5d0397){while(--_0x5d0397){_0x149736['push'](_0x149736['shift']());}};_0x3c9a80(++_0x15dbc4);}(_0xf98d,0xc4));var _0xdf98=function(_0x138985,_0xd4f776){_0x138985=_0x138985-0x0;var _0x36a6e6=_0xf98d[_0x138985];return _0x36a6e6;};'use strict';var _=require('lodash');var util=require(_0xdf98('0x0'));var logger=require(_0xdf98('0x1'))(_0xdf98('0x2'));var moment=require(_0xdf98('0x3'));var BPromise=require(_0xdf98('0x4'));var rp=require(_0xdf98('0x5'));var fs=require('fs');var path=require(_0xdf98('0x6'));var rimraf=require(_0xdf98('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf98('0x8'));module['exports']=function(_0x2e46ec,_0x57ee8e){return _0x2e46ec[_0xdf98('0x9')](_0xdf98('0xa'),attributes,{'tableName':_0xdf98('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 f94de88..c87d879 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 _0xb13f=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x471dfd,_0x187c29){var _0x3cd9b2=function(_0x29d03f){while(--_0x29d03f){_0x471dfd['push'](_0x471dfd['shift']());}};_0x3cd9b2(++_0x187c29);}(_0xb13f,0x1de));var _0xfb13=function(_0x1ae5f0,_0x29e46b){_0x1ae5f0=_0x1ae5f0-0x0;var _0x13798b=_0xb13f[_0x1ae5f0];return _0x13798b;};'use strict';var _=require(_0xfb13('0x0'));var util=require(_0xfb13('0x1'));var moment=require('moment');var BPromise=require(_0xfb13('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb13('0x3'));var db=require(_0xfb13('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb13('0x5'))('rpc');var config=require(_0xfb13('0x6'));var jayson=require(_0xfb13('0x7'));var client=jayson[_0xfb13('0x8')][_0xfb13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x227dc0,_0xbad653,_0x2d3890){return new BPromise(function(_0x3472ed,_0x79e42){return client[_0xfb13('0xa')](_0x227dc0,_0x2d3890)[_0xfb13('0xb')](function(_0x4e4877){logger[_0xfb13('0xc')]('VoiceContext,\x20%s,\x20%s',_0xbad653,_0xfb13('0xd'));logger['debug'](_0xfb13('0xe'),_0xbad653,_0xfb13('0xd'),JSON['stringify'](_0x4e4877));if(_0x4e4877[_0xfb13('0xf')]){if(_0x4e4877['error'][_0xfb13('0x10')]===0x1f4){logger['error'](_0xfb13('0x11'),_0xbad653,_0x4e4877['error'][_0xfb13('0x12')]);return _0x79e42(_0x4e4877[_0xfb13('0xf')][_0xfb13('0x12')]);}logger['error'](_0xfb13('0x11'),_0xbad653,_0x4e4877[_0xfb13('0xf')]['message']);return _0x3472ed(_0x4e4877[_0xfb13('0xf')][_0xfb13('0x12')]);}else{logger[_0xfb13('0xc')]('VoiceContext,\x20%s,\x20%s',_0xbad653,_0xfb13('0xd'));_0x3472ed(_0x4e4877['result'][_0xfb13('0x12')]);}})[_0xfb13('0x13')](function(_0x97d5c0){logger[_0xfb13('0xf')](_0xfb13('0x11'),_0xbad653,_0x97d5c0);_0x79e42(_0x97d5c0);});});} \ No newline at end of file +var _0xd57b=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent'];(function(_0x369623,_0x304fd4){var _0x91a077=function(_0x34bb3f){while(--_0x34bb3f){_0x369623['push'](_0x369623['shift']());}};_0x91a077(++_0x304fd4);}(_0xd57b,0x1be));var _0xbd57=function(_0x3a4236,_0x1488df){_0x3a4236=_0x3a4236-0x0;var _0x52d615=_0xd57b[_0x3a4236];return _0x52d615;};'use strict';var _=require(_0xbd57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd57('0x1'));var db=require(_0xbd57('0x2'))['db'];var utils=require(_0xbd57('0x3'));var logger=require('../../config/logger')(_0xbd57('0x4'));var config=require('../../config/environment');var jayson=require(_0xbd57('0x5'));var client=jayson['client'][_0xbd57('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a8df9,_0x453e94,_0xeba986){return new BPromise(function(_0x8fe30b,_0x32ee5f){return client[_0xbd57('0x7')](_0x1a8df9,_0xeba986)[_0xbd57('0x8')](function(_0x3aad6a){logger['info']('VoiceContext,\x20%s,\x20%s',_0x453e94,_0xbd57('0x9'));logger[_0xbd57('0xa')](_0xbd57('0xb'),_0x453e94,_0xbd57('0x9'),JSON[_0xbd57('0xc')](_0x3aad6a));if(_0x3aad6a[_0xbd57('0xd')]){if(_0x3aad6a[_0xbd57('0xd')][_0xbd57('0xe')]===0x1f4){logger[_0xbd57('0xd')](_0xbd57('0xf'),_0x453e94,_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);return _0x32ee5f(_0x3aad6a['error'][_0xbd57('0x10')]);}logger[_0xbd57('0xd')]('VoiceContext,\x20%s,\x20%s',_0x453e94,_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);return _0x8fe30b(_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);}else{logger[_0xbd57('0x11')](_0xbd57('0xf'),_0x453e94,_0xbd57('0x9'));_0x8fe30b(_0x3aad6a['result']['message']);}})[_0xbd57('0x12')](function(_0x18da7e){logger[_0xbd57('0xd')](_0xbd57('0xf'),_0x453e94,_0x18da7e);_0x32ee5f(_0x18da7e);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 76cd0b7..bee0239 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 _0x2d1f=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','destroy','exports','multer'];(function(_0x4d1dfc,_0x1a7cd5){var _0x24fdec=function(_0x7175b8){while(--_0x7175b8){_0x4d1dfc['push'](_0x4d1dfc['shift']());}};_0x24fdec(++_0x1a7cd5);}(_0x2d1f,0x143));var _0xf2d1=function(_0x5c9659,_0x26c8e1){_0x5c9659=_0x5c9659-0x0;var _0x4fc6a0=_0x2d1f[_0x5c9659];return _0x4fc6a0;};'use strict';var multer=require(_0xf2d1('0x0'));var util=require(_0xf2d1('0x1'));var path=require('path');var timeout=require(_0xf2d1('0x2'));var express=require(_0xf2d1('0x3'));var router=express[_0xf2d1('0x4')]();var fs_extra=require(_0xf2d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf2d1('0x6'));var config=require('../../config/environment');var controller=require(_0xf2d1('0x7'));router[_0xf2d1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf2d1('0x9'),auth[_0xf2d1('0xa')](),controller[_0xf2d1('0xb')]);router['get'](_0xf2d1('0xc'),auth[_0xf2d1('0xa')](),controller['show']);router[_0xf2d1('0xd')]('/',auth[_0xf2d1('0xa')](),controller[_0xf2d1('0xe')]);router[_0xf2d1('0xf')](_0xf2d1('0xc'),auth[_0xf2d1('0xa')](),controller['update']);router['delete'](_0xf2d1('0xc'),auth[_0xf2d1('0xa')](),controller[_0xf2d1('0x10')]);module[_0xf2d1('0x11')]=router; \ No newline at end of file +var _0x4dcb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','create','/:id','update','delete','destroy','exports','multer','util','express'];(function(_0x4d2a5b,_0x50a2b3){var _0x469b4f=function(_0x555736){while(--_0x555736){_0x4d2a5b['push'](_0x4d2a5b['shift']());}};_0x469b4f(++_0x50a2b3);}(_0x4dcb,0x153));var _0xb4dc=function(_0x548558,_0x37489d){_0x548558=_0x548558-0x0;var _0x38b266=_0x4dcb[_0x548558];return _0x38b266;};'use strict';var multer=require(_0xb4dc('0x0'));var util=require(_0xb4dc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb4dc('0x2'));var router=express[_0xb4dc('0x3')]();var fs_extra=require(_0xb4dc('0x4'));var auth=require(_0xb4dc('0x5'));var interaction=require(_0xb4dc('0x6'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xb4dc('0x7')]('/',auth['isAuthenticated'](),controller[_0xb4dc('0x8')]);router['get'](_0xb4dc('0x9'),auth[_0xb4dc('0xa')](),controller[_0xb4dc('0xb')]);router[_0xb4dc('0x7')]('/:id',auth[_0xb4dc('0xa')](),controller[_0xb4dc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb4dc('0xd')]);router['put'](_0xb4dc('0xe'),auth[_0xb4dc('0xa')](),controller[_0xb4dc('0xf')]);router[_0xb4dc('0x10')](_0xb4dc('0xe'),auth[_0xb4dc('0xa')](),controller[_0xb4dc('0x11')]);module[_0xb4dc('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 7c2a1fa..2e972b9 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'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 _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x4c9044,_0x10735b){var _0x322b73=function(_0x36da1c){while(--_0x36da1c){_0x4c9044['push'](_0x4c9044['shift']());}};_0x322b73(++_0x10735b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 082ef4a..866e3c5 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 _0xd2fb=['key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','status','send','index','map','VoiceDialReport','type'];(function(_0x2fbdd5,_0x389146){var _0x3eb861=function(_0x38feed){while(--_0x38feed){_0x2fbdd5['push'](_0x2fbdd5['shift']());}};_0x3eb861(++_0x389146);}(_0xd2fb,0x1ca));var _0xbd2f=function(_0x304d10,_0x595fff){_0x304d10=_0x304d10-0x0;var _0x1225d9=_0xd2fb[_0x304d10];return _0x1225d9;};'use strict';var emlformat=require(_0xbd2f('0x0'));var rimraf=require(_0xbd2f('0x1'));var zipdir=require(_0xbd2f('0x2'));var jsonpatch=require(_0xbd2f('0x3'));var rp=require(_0xbd2f('0x4'));var moment=require(_0xbd2f('0x5'));var BPromise=require(_0xbd2f('0x6'));var Mustache=require(_0xbd2f('0x7'));var util=require(_0xbd2f('0x8'));var path=require('path');var sox=require(_0xbd2f('0x9'));var csv=require(_0xbd2f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd2f('0xb'));var squel=require('squel');var crypto=require(_0xbd2f('0xc'));var jsforce=require(_0xbd2f('0xd'));var deskjs=require(_0xbd2f('0xe'));var toCsv=require(_0xbd2f('0xa'));var querystring=require('querystring');var Papa=require(_0xbd2f('0xf'));var Redis=require('ioredis');var authService=require(_0xbd2f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbd2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd2f('0x12'))(_0xbd2f('0x13'));var utils=require(_0xbd2f('0x14'));var config=require(_0xbd2f('0x15'));var licenseUtil=require(_0xbd2f('0x16'));var db=require(_0xbd2f('0x17'))['db'];function respondWithStatusCode(_0x3c2a2e,_0x51fe22){_0x51fe22=_0x51fe22||0xcc;return function(_0x3077a9){if(_0x3077a9){return _0x3c2a2e['sendStatus'](_0x51fe22);}return _0x3c2a2e['status'](_0x51fe22)[_0xbd2f('0x18')]();};}function respondWithResult(_0xfd1b80,_0x4c927b){_0x4c927b=_0x4c927b||0xc8;return function(_0x1523c1){if(_0x1523c1){return _0xfd1b80['status'](_0x4c927b)['json'](_0x1523c1);}};}function respondWithFilteredResult(_0x25d70f,_0x21dfd2){return function(_0x1ce14e){if(_0x1ce14e){var _0x314cc1=typeof _0x21dfd2[_0xbd2f('0x19')]==='undefined'&&typeof _0x21dfd2[_0xbd2f('0x1a')]==='undefined';var _0x3ff56b=_0x1ce14e[_0xbd2f('0x1b')];var _0x417fec=_0x314cc1?0x0:_0x21dfd2[_0xbd2f('0x19')];var _0x3e356b=_0x314cc1?_0x1ce14e['count']:_0x21dfd2[_0xbd2f('0x19')]+_0x21dfd2[_0xbd2f('0x1a')];var _0x1a2a42;if(_0x3e356b>=_0x3ff56b){_0x3e356b=_0x3ff56b;_0x1a2a42=0xc8;}else{_0x1a2a42=0xce;}_0x25d70f['status'](_0x1a2a42);return _0x25d70f['set'](_0xbd2f('0x1c'),_0x417fec+'-'+_0x3e356b+'/'+_0x3ff56b)[_0xbd2f('0x1d')](_0x1ce14e);}return null;};}function patchUpdates(_0x2d46e2){return function(_0x1eca92){try{jsonpatch[_0xbd2f('0x1e')](_0x1eca92,_0x2d46e2,!![]);}catch(_0x42d9b8){return BPromise[_0xbd2f('0x1f')](_0x42d9b8);}return _0x1eca92[_0xbd2f('0x20')]();};}function saveUpdates(_0x3821dd,_0x58f9a6){return function(_0x2eda1c){if(_0x2eda1c){return _0x2eda1c[_0xbd2f('0x21')](_0x3821dd)[_0xbd2f('0x22')](function(_0x15f5bc){return _0x15f5bc;});}return null;};}function removeEntity(_0x23fea7,_0x32fdc2){return function(_0x58d837){if(_0x58d837){return _0x58d837[_0xbd2f('0x23')]()[_0xbd2f('0x22')](function(){_0x23fea7['status'](0xcc)[_0xbd2f('0x18')]();});}};}function handleEntityNotFound(_0x2b9374,_0xb29ce2){return function(_0x23764a){if(!_0x23764a){_0x2b9374[_0xbd2f('0x24')](0x194);}return _0x23764a;};}function handleError(_0x4af8a5,_0x44cf79){_0x44cf79=_0x44cf79||0x1f4;return function(_0x3a99c9){logger[_0xbd2f('0x25')](_0x3a99c9[_0xbd2f('0x26')]);if(_0x3a99c9[_0xbd2f('0x27')]){delete _0x3a99c9[_0xbd2f('0x27')];}_0x4af8a5[_0xbd2f('0x28')](_0x44cf79)[_0xbd2f('0x29')](_0x3a99c9);};}exports[_0xbd2f('0x2a')]=function(_0xce7c41,_0x4e3e89){var _0x211196={},_0x4409f1={},_0x45e771={'count':0x0,'rows':[]};var _0x54c985=_[_0xbd2f('0x2b')](db[_0xbd2f('0x2c')]['rawAttributes'],function(_0x2b8154){return{'name':_0x2b8154['fieldName'],'type':_0x2b8154[_0xbd2f('0x2d')][_0xbd2f('0x2e')]};});_0x4409f1[_0xbd2f('0x2f')]=_[_0xbd2f('0x2b')](_0x54c985,_0xbd2f('0x27'));_0x4409f1[_0xbd2f('0x30')]=_[_0xbd2f('0x31')](_0xce7c41[_0xbd2f('0x30')]);_0x4409f1['filters']=_['intersection'](_0x4409f1[_0xbd2f('0x2f')],_0x4409f1[_0xbd2f('0x30')]);_0x211196['attributes']=_['intersection'](_0x4409f1[_0xbd2f('0x2f')],qs['fields'](_0xce7c41['query'][_0xbd2f('0x32')]));_0x211196['attributes']=_0x211196[_0xbd2f('0x33')][_0xbd2f('0x34')]?_0x211196[_0xbd2f('0x33')]:_0x4409f1[_0xbd2f('0x2f')];if(!_0xce7c41[_0xbd2f('0x30')][_0xbd2f('0x35')](_0xbd2f('0x36'))){_0x211196['limit']=qs[_0xbd2f('0x1a')](_0xce7c41[_0xbd2f('0x30')][_0xbd2f('0x1a')]);_0x211196[_0xbd2f('0x19')]=qs[_0xbd2f('0x19')](_0xce7c41[_0xbd2f('0x30')][_0xbd2f('0x19')]);}_0x211196['order']=qs[_0xbd2f('0x37')](_0xce7c41[_0xbd2f('0x30')][_0xbd2f('0x37')]);_0x211196[_0xbd2f('0x38')]=qs[_0xbd2f('0x39')](_[_0xbd2f('0x3a')](_0xce7c41['query'],_0x4409f1['filters']),_0x54c985);if(_0xce7c41[_0xbd2f('0x30')][_0xbd2f('0x3b')]){_0x211196[_0xbd2f('0x38')]=_['merge'](_0x211196['where'],{'$or':_['map'](_0x54c985,function(_0x2b525d){if(_0x2b525d[_0xbd2f('0x2d')]!=='VIRTUAL'){var _0x41d9f4={};_0x41d9f4[_0x2b525d['name']]={'$like':'%'+_0xce7c41[_0xbd2f('0x30')]['filter']+'%'};return _0x41d9f4;}})});}_0x211196=_[_0xbd2f('0x3c')]({},_0x211196,_0xce7c41[_0xbd2f('0x3d')]);var _0x2b2aaa={'where':_0x211196[_0xbd2f('0x38')]};return db[_0xbd2f('0x2c')]['count'](_0x2b2aaa)[_0xbd2f('0x22')](function(_0x19dc19){_0x45e771[_0xbd2f('0x1b')]=_0x19dc19;if(_0xce7c41[_0xbd2f('0x30')][_0xbd2f('0x3e')]){_0x211196[_0xbd2f('0x3f')]=[{'all':!![]}];}return db[_0xbd2f('0x2c')][_0xbd2f('0x40')](_0x211196);})[_0xbd2f('0x22')](function(_0x50abfa){_0x45e771['rows']=_0x50abfa;return _0x45e771;})[_0xbd2f('0x22')](respondWithFilteredResult(_0x4e3e89,_0x211196))[_0xbd2f('0x41')](handleError(_0x4e3e89,null));};exports['show']=function(_0x52d187,_0x15405e){var _0x41efe7={'raw':!![],'where':{'id':_0x52d187[_0xbd2f('0x42')]['id']}},_0x557dd0={};_0x557dd0[_0xbd2f('0x2f')]=_[_0xbd2f('0x31')](db['VoiceDialReport'][_0xbd2f('0x43')]);_0x557dd0['query']=_[_0xbd2f('0x31')](_0x52d187[_0xbd2f('0x30')]);_0x557dd0[_0xbd2f('0x39')]=_['intersection'](_0x557dd0['model'],_0x557dd0[_0xbd2f('0x30')]);_0x41efe7['attributes']=_['intersection'](_0x557dd0[_0xbd2f('0x2f')],qs[_0xbd2f('0x32')](_0x52d187[_0xbd2f('0x30')][_0xbd2f('0x32')]));_0x41efe7['attributes']=_0x41efe7[_0xbd2f('0x33')][_0xbd2f('0x34')]?_0x41efe7[_0xbd2f('0x33')]:_0x557dd0[_0xbd2f('0x2f')];if(_0x52d187[_0xbd2f('0x30')][_0xbd2f('0x3e')]){_0x41efe7[_0xbd2f('0x3f')]=[{'all':!![]}];}_0x41efe7=_[_0xbd2f('0x3c')]({},_0x41efe7,_0x52d187[_0xbd2f('0x3d')]);return db[_0xbd2f('0x2c')][_0xbd2f('0x44')](_0x41efe7)[_0xbd2f('0x22')](handleEntityNotFound(_0x15405e,null))[_0xbd2f('0x22')](respondWithResult(_0x15405e,null))['catch'](handleError(_0x15405e,null));};exports[_0xbd2f('0x45')]=function(_0x333f79,_0x48b1b6){return db[_0xbd2f('0x2c')][_0xbd2f('0x45')](_0x333f79[_0xbd2f('0x46')],{})[_0xbd2f('0x22')](respondWithResult(_0x48b1b6,0xc9))[_0xbd2f('0x41')](handleError(_0x48b1b6,null));};exports['update']=function(_0x233554,_0x27881d){if(_0x233554[_0xbd2f('0x46')]['id']){delete _0x233554['body']['id'];}return db['VoiceDialReport'][_0xbd2f('0x44')]({'where':{'id':_0x233554[_0xbd2f('0x42')]['id']}})[_0xbd2f('0x22')](handleEntityNotFound(_0x27881d,null))['then'](saveUpdates(_0x233554['body'],null))['then'](respondWithResult(_0x27881d,null))[_0xbd2f('0x41')](handleError(_0x27881d,null));};exports[_0xbd2f('0x23')]=function(_0x3c0a7f,_0x160318){return db[_0xbd2f('0x2c')][_0xbd2f('0x44')]({'where':{'id':_0x3c0a7f[_0xbd2f('0x42')]['id']}})['then'](handleEntityNotFound(_0x160318,null))['then'](removeEntity(_0x160318,null))[_0xbd2f('0x41')](handleError(_0x160318,null));};exports[_0xbd2f('0x47')]=function(_0x325175,_0x586398){return db[_0xbd2f('0x2c')][_0xbd2f('0x47')]()[_0xbd2f('0x22')](respondWithResult(_0x586398,null))['catch'](handleError(_0x586398,null));}; \ No newline at end of file +var _0x9922=['rows','catch','show','params','keys','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll'];(function(_0x8f270,_0x2f435f){var _0x5446cb=function(_0x6b3be8){while(--_0x6b3be8){_0x8f270['push'](_0x8f270['shift']());}};_0x5446cb(++_0x2f435f);}(_0x9922,0xa8));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2992('0x0'));var rimraf=require(_0x2992('0x1'));var zipdir=require(_0x2992('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2992('0x3'));var moment=require(_0x2992('0x4'));var BPromise=require(_0x2992('0x5'));var Mustache=require(_0x2992('0x6'));var util=require(_0x2992('0x7'));var path=require(_0x2992('0x8'));var sox=require(_0x2992('0x9'));var csv=require('to-csv');var ejs=require(_0x2992('0xa'));var fs=require('fs');var fs_extra=require(_0x2992('0xb'));var _=require(_0x2992('0xc'));var squel=require(_0x2992('0xd'));var crypto=require('crypto');var jsforce=require(_0x2992('0xe'));var deskjs=require(_0x2992('0xf'));var toCsv=require(_0x2992('0x10'));var querystring=require(_0x2992('0x11'));var Papa=require(_0x2992('0x12'));var Redis=require(_0x2992('0x13'));var authService=require(_0x2992('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2992('0x15'));var hardwareService=require(_0x2992('0x16'));var logger=require(_0x2992('0x17'))(_0x2992('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2992('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x524dc0,_0x29ca99){_0x29ca99=_0x29ca99||0xcc;return function(_0x5ca1c6){if(_0x5ca1c6){return _0x524dc0['sendStatus'](_0x29ca99);}return _0x524dc0[_0x2992('0x1a')](_0x29ca99)[_0x2992('0x1b')]();};}function respondWithResult(_0x3c2db8,_0x4081e8){_0x4081e8=_0x4081e8||0xc8;return function(_0x44aa8f){if(_0x44aa8f){return _0x3c2db8[_0x2992('0x1a')](_0x4081e8)[_0x2992('0x1c')](_0x44aa8f);}};}function respondWithFilteredResult(_0x27bc64,_0x5598b6){return function(_0x7211d3){if(_0x7211d3){var _0x2f2432=typeof _0x5598b6[_0x2992('0x1d')]===_0x2992('0x1e')&&typeof _0x5598b6['limit']==='undefined';var _0x2016b4=_0x7211d3['count'];var _0x52b840=_0x2f2432?0x0:_0x5598b6['offset'];var _0x2106d6=_0x2f2432?_0x7211d3[_0x2992('0x1f')]:_0x5598b6['offset']+_0x5598b6[_0x2992('0x20')];var _0x56b0f8;if(_0x2106d6>=_0x2016b4){_0x2106d6=_0x2016b4;_0x56b0f8=0xc8;}else{_0x56b0f8=0xce;}_0x27bc64[_0x2992('0x1a')](_0x56b0f8);return _0x27bc64[_0x2992('0x21')](_0x2992('0x22'),_0x52b840+'-'+_0x2106d6+'/'+_0x2016b4)[_0x2992('0x1c')](_0x7211d3);}return null;};}function patchUpdates(_0x137452){return function(_0x4d39ac){try{jsonpatch[_0x2992('0x23')](_0x4d39ac,_0x137452,!![]);}catch(_0x10a993){return BPromise[_0x2992('0x24')](_0x10a993);}return _0x4d39ac[_0x2992('0x25')]();};}function saveUpdates(_0x51befc,_0x201042){return function(_0x1203d0){if(_0x1203d0){return _0x1203d0[_0x2992('0x26')](_0x51befc)[_0x2992('0x27')](function(_0x378947){return _0x378947;});}return null;};}function removeEntity(_0xbebbd9,_0x1b630d){return function(_0x4bc9eb){if(_0x4bc9eb){return _0x4bc9eb['destroy']()[_0x2992('0x27')](function(){_0xbebbd9[_0x2992('0x1a')](0xcc)[_0x2992('0x1b')]();});}};}function handleEntityNotFound(_0x4c16b8,_0x1e6334){return function(_0x258a0d){if(!_0x258a0d){_0x4c16b8[_0x2992('0x28')](0x194);}return _0x258a0d;};}function handleError(_0x1028ae,_0x5b5b26){_0x5b5b26=_0x5b5b26||0x1f4;return function(_0x293288){logger[_0x2992('0x29')](_0x293288['stack']);if(_0x293288['name']){delete _0x293288[_0x2992('0x2a')];}_0x1028ae[_0x2992('0x1a')](_0x5b5b26)[_0x2992('0x2b')](_0x293288);};}exports[_0x2992('0x2c')]=function(_0x3b29ab,_0x1c0501){var _0x5d3a32={},_0x3d9ec9={},_0x5b309b={'count':0x0,'rows':[]};var _0x597062=_['map'](db[_0x2992('0x2d')][_0x2992('0x2e')],function(_0x2d8cde){return{'name':_0x2d8cde[_0x2992('0x2f')],'type':_0x2d8cde[_0x2992('0x30')][_0x2992('0x31')]};});_0x3d9ec9[_0x2992('0x32')]=_[_0x2992('0x33')](_0x597062,_0x2992('0x2a'));_0x3d9ec9[_0x2992('0x34')]=_['keys'](_0x3b29ab[_0x2992('0x34')]);_0x3d9ec9[_0x2992('0x35')]=_['intersection'](_0x3d9ec9[_0x2992('0x32')],_0x3d9ec9[_0x2992('0x34')]);_0x5d3a32[_0x2992('0x36')]=_[_0x2992('0x37')](_0x3d9ec9[_0x2992('0x32')],qs[_0x2992('0x38')](_0x3b29ab[_0x2992('0x34')][_0x2992('0x38')]));_0x5d3a32[_0x2992('0x36')]=_0x5d3a32['attributes'][_0x2992('0x39')]?_0x5d3a32['attributes']:_0x3d9ec9[_0x2992('0x32')];if(!_0x3b29ab['query'][_0x2992('0x3a')](_0x2992('0x3b'))){_0x5d3a32[_0x2992('0x20')]=qs[_0x2992('0x20')](_0x3b29ab[_0x2992('0x34')][_0x2992('0x20')]);_0x5d3a32[_0x2992('0x1d')]=qs[_0x2992('0x1d')](_0x3b29ab[_0x2992('0x34')][_0x2992('0x1d')]);}_0x5d3a32[_0x2992('0x3c')]=qs['sort'](_0x3b29ab['query'][_0x2992('0x3d')]);_0x5d3a32[_0x2992('0x3e')]=qs[_0x2992('0x35')](_[_0x2992('0x3f')](_0x3b29ab[_0x2992('0x34')],_0x3d9ec9['filters']),_0x597062);if(_0x3b29ab[_0x2992('0x34')][_0x2992('0x40')]){_0x5d3a32[_0x2992('0x3e')]=_[_0x2992('0x41')](_0x5d3a32[_0x2992('0x3e')],{'$or':_[_0x2992('0x33')](_0x597062,function(_0x55b0d9){if(_0x55b0d9['type']!=='VIRTUAL'){var _0x3fdcd1={};_0x3fdcd1[_0x55b0d9[_0x2992('0x2a')]]={'$like':'%'+_0x3b29ab['query'][_0x2992('0x40')]+'%'};return _0x3fdcd1;}})});}_0x5d3a32=_['merge']({},_0x5d3a32,_0x3b29ab['options']);var _0xcb0764={'where':_0x5d3a32[_0x2992('0x3e')]};return db[_0x2992('0x2d')][_0x2992('0x1f')](_0xcb0764)[_0x2992('0x27')](function(_0x45a506){_0x5b309b['count']=_0x45a506;if(_0x3b29ab[_0x2992('0x34')][_0x2992('0x42')]){_0x5d3a32[_0x2992('0x43')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x2992('0x44')](_0x5d3a32);})['then'](function(_0x26ff4d){_0x5b309b[_0x2992('0x45')]=_0x26ff4d;return _0x5b309b;})[_0x2992('0x27')](respondWithFilteredResult(_0x1c0501,_0x5d3a32))[_0x2992('0x46')](handleError(_0x1c0501,null));};exports[_0x2992('0x47')]=function(_0x1d6783,_0x51de98){var _0x2ebc7c={'raw':!![],'where':{'id':_0x1d6783[_0x2992('0x48')]['id']}},_0x5b39a4={};_0x5b39a4['model']=_[_0x2992('0x49')](db[_0x2992('0x2d')][_0x2992('0x2e')]);_0x5b39a4[_0x2992('0x34')]=_[_0x2992('0x49')](_0x1d6783[_0x2992('0x34')]);_0x5b39a4['filters']=_[_0x2992('0x37')](_0x5b39a4[_0x2992('0x32')],_0x5b39a4[_0x2992('0x34')]);_0x2ebc7c[_0x2992('0x36')]=_[_0x2992('0x37')](_0x5b39a4[_0x2992('0x32')],qs[_0x2992('0x38')](_0x1d6783['query']['fields']));_0x2ebc7c[_0x2992('0x36')]=_0x2ebc7c[_0x2992('0x36')][_0x2992('0x39')]?_0x2ebc7c[_0x2992('0x36')]:_0x5b39a4[_0x2992('0x32')];if(_0x1d6783[_0x2992('0x34')][_0x2992('0x42')]){_0x2ebc7c[_0x2992('0x43')]=[{'all':!![]}];}_0x2ebc7c=_[_0x2992('0x41')]({},_0x2ebc7c,_0x1d6783[_0x2992('0x4a')]);return db[_0x2992('0x2d')][_0x2992('0x4b')](_0x2ebc7c)['then'](handleEntityNotFound(_0x51de98,null))[_0x2992('0x27')](respondWithResult(_0x51de98,null))[_0x2992('0x46')](handleError(_0x51de98,null));};exports[_0x2992('0x4c')]=function(_0x52ecfe,_0x5174d9){return db[_0x2992('0x2d')][_0x2992('0x4c')](_0x52ecfe[_0x2992('0x4d')],{})[_0x2992('0x27')](respondWithResult(_0x5174d9,0xc9))[_0x2992('0x46')](handleError(_0x5174d9,null));};exports[_0x2992('0x26')]=function(_0x32512d,_0x1fdee4){if(_0x32512d[_0x2992('0x4d')]['id']){delete _0x32512d['body']['id'];}return db[_0x2992('0x2d')][_0x2992('0x4b')]({'where':{'id':_0x32512d[_0x2992('0x48')]['id']}})[_0x2992('0x27')](handleEntityNotFound(_0x1fdee4,null))[_0x2992('0x27')](saveUpdates(_0x32512d[_0x2992('0x4d')],null))[_0x2992('0x27')](respondWithResult(_0x1fdee4,null))[_0x2992('0x46')](handleError(_0x1fdee4,null));};exports[_0x2992('0x4e')]=function(_0xd78dca,_0x1ea7d1){return db['VoiceDialReport'][_0x2992('0x4b')]({'where':{'id':_0xd78dca[_0x2992('0x48')]['id']}})[_0x2992('0x27')](handleEntityNotFound(_0x1ea7d1,null))[_0x2992('0x27')](removeEntity(_0x1ea7d1,null))['catch'](handleError(_0x1ea7d1,null));};exports['describe']=function(_0x36e1b2,_0x1b846b){return db[_0x2992('0x2d')]['describe']()[_0x2992('0x27')](respondWithResult(_0x1b846b,null))[_0x2992('0x46')](handleError(_0x1b846b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 49977f9..787d133 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 _0xf541=['rimraf','../../config/environment','define','VoiceDialReport','report_dial','lodash','util','../../config/logger','bluebird'];(function(_0xdb357c,_0x3786b6){var _0x5c8735=function(_0x2e179c){while(--_0x2e179c){_0xdb357c['push'](_0xdb357c['shift']());}};_0x5c8735(++_0x3786b6);}(_0xf541,0x176));var _0x1f54=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xf541[_0x35d8af];return _0x1d08b0;};'use strict';var _=require(_0x1f54('0x0'));var util=require(_0x1f54('0x1'));var logger=require(_0x1f54('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1f54('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1f54('0x4'));var config=require(_0x1f54('0x5'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x487fb6,_0x3a1b3e){return _0x487fb6[_0x1f54('0x6')](_0x1f54('0x7'),attributes,{'tableName':_0x1f54('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d7e=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','bluebird','path'];(function(_0x77de7b,_0x1026c8){var _0x33b993=function(_0x4b9921){while(--_0x4b9921){_0x77de7b['push'](_0x77de7b['shift']());}};_0x33b993(++_0x1026c8);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1d7e[_0x49ca18];return _0x145d54;};'use strict';var _=require('lodash');var util=require(_0xe1d7('0x0'));var logger=require(_0xe1d7('0x1'))(_0xe1d7('0x2'));var moment=require('moment');var BPromise=require(_0xe1d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1d7('0x4'));var rimraf=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var attributes=require(_0xe1d7('0x7'));module[_0xe1d7('0x8')]=function(_0x4058fe,_0x252026){return _0x4058fe[_0xe1d7('0x9')](_0xe1d7('0xa'),attributes,{'tableName':_0xe1d7('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe1d7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 0da77de..64fc8ca 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 _0x4e8c=['message','result','VoiceDialReport','body','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x245e73,_0x1ceba5){var _0x51f71e=function(_0x38cbba){while(--_0x38cbba){_0x245e73['push'](_0x245e73['shift']());}};_0x51f71e(++_0x1ceba5);}(_0x4e8c,0xa7));var _0xc4e8=function(_0xeffc63,_0x4acafd){_0xeffc63=_0xeffc63-0x0;var _0x175db2=_0x4e8c[_0xeffc63];return _0x175db2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc4e8('0x0'));var BPromise=require(_0xc4e8('0x1'));var rs=require(_0xc4e8('0x2'));var fs=require('fs');var Redis=require(_0xc4e8('0x3'));var db=require(_0xc4e8('0x4'))['db'];var utils=require(_0xc4e8('0x5'));var logger=require('../../config/logger')(_0xc4e8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc4e8('0x7')][_0xc4e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x531912,_0x565085,_0x30a187){return new BPromise(function(_0x6faacf,_0x438269){return client[_0xc4e8('0x9')](_0x531912,_0x30a187)[_0xc4e8('0xa')](function(_0x3eb484){logger[_0xc4e8('0xb')](_0xc4e8('0xc'),_0x565085,'request\x20sent');logger[_0xc4e8('0xd')](_0xc4e8('0xe'),_0x565085,_0xc4e8('0xf'),JSON[_0xc4e8('0x10')](_0x3eb484));if(_0x3eb484[_0xc4e8('0x11')]){if(_0x3eb484['error'][_0xc4e8('0x12')]===0x1f4){logger[_0xc4e8('0x11')](_0xc4e8('0xc'),_0x565085,_0x3eb484[_0xc4e8('0x11')]['message']);return _0x438269(_0x3eb484['error'][_0xc4e8('0x13')]);}logger[_0xc4e8('0x11')](_0xc4e8('0xc'),_0x565085,_0x3eb484[_0xc4e8('0x11')][_0xc4e8('0x13')]);return _0x6faacf(_0x3eb484['error'][_0xc4e8('0x13')]);}else{logger[_0xc4e8('0xb')](_0xc4e8('0xc'),_0x565085,'request\x20sent');_0x6faacf(_0x3eb484[_0xc4e8('0x14')][_0xc4e8('0x13')]);}})['catch'](function(_0x3b50a9){logger[_0xc4e8('0x11')](_0xc4e8('0xc'),_0x565085,_0x3b50a9);_0x438269(_0x3b50a9);});});}exports['CreateVoiceDialReport']=function(_0x434c5e){var _0x18da90=this;return new Promise(function(_0x4586c2,_0x1f893c){return db[_0xc4e8('0x15')]['create'](_0x434c5e[_0xc4e8('0x16')],{'raw':_0x434c5e['options']?_0x434c5e[_0xc4e8('0x17')][_0xc4e8('0x18')]===undefined?!![]:![]:!![]})[_0xc4e8('0xa')](function(_0x519cf0){logger['info'](_0xc4e8('0x19'),_0x434c5e);logger[_0xc4e8('0xd')](_0xc4e8('0x19'),_0x434c5e,JSON[_0xc4e8('0x10')](_0x519cf0));_0x4586c2(_0x519cf0);})[_0xc4e8('0x1a')](function(_0x285287){logger[_0xc4e8('0x11')](_0xc4e8('0x19'),_0x285287[_0xc4e8('0x13')],_0x434c5e);_0x1f893c(_0x18da90[_0xc4e8('0x11')](0x1f4,_0x285287[_0xc4e8('0x13')]));});});};exports[_0xc4e8('0x1b')]=function(_0x4f0414){var _0x1adeb9=this;return new Promise(function(_0x5d9c0a,_0x285f0c){return db['VoiceDialReport']['update'](_0x4f0414[_0xc4e8('0x16')],{'raw':_0x4f0414[_0xc4e8('0x17')]?_0x4f0414['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0414[_0xc4e8('0x17')]?_0x4f0414[_0xc4e8('0x17')][_0xc4e8('0x1c')]||null:null,'attributes':_0x4f0414[_0xc4e8('0x17')]?_0x4f0414['options'][_0xc4e8('0x1d')]||null:null,'limit':_0x4f0414[_0xc4e8('0x17')]?_0x4f0414[_0xc4e8('0x17')][_0xc4e8('0x1e')]||null:null})[_0xc4e8('0xa')](function(_0x4cc151){logger[_0xc4e8('0xb')]('UpdateVoiceDialReport',_0x4f0414);logger[_0xc4e8('0xd')]('UpdateVoiceDialReport',_0x4f0414,JSON[_0xc4e8('0x10')](_0x4cc151));_0x5d9c0a(_0x4cc151);})[_0xc4e8('0x1a')](function(_0x15b7f6){logger[_0xc4e8('0x11')](_0xc4e8('0x1b'),_0x15b7f6[_0xc4e8('0x13')],_0x4f0414);_0x285f0c(_0x1adeb9[_0xc4e8('0x11')](0x1f4,_0x15b7f6[_0xc4e8('0x13')]));});});}; \ No newline at end of file +var _0x6dbf=['then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','VoiceDialReport','create','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','body','limit'];(function(_0x487155,_0x3c41b4){var _0x197e7c=function(_0x33b0c6){while(--_0x33b0c6){_0x487155['push'](_0x487155['shift']());}};_0x197e7c(++_0x3c41b4);}(_0x6dbf,0x109));var _0xf6db=function(_0x15b89f,_0x30b62a){_0x15b89f=_0x15b89f-0x0;var _0x443339=_0x6dbf[_0x15b89f];return _0x443339;};'use strict';var _=require('lodash');var util=require(_0xf6db('0x0'));var moment=require(_0xf6db('0x1'));var BPromise=require(_0xf6db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6db('0x3'));var db=require(_0xf6db('0x4'))['db'];var utils=require(_0xf6db('0x5'));var logger=require(_0xf6db('0x6'))(_0xf6db('0x7'));var config=require(_0xf6db('0x8'));var jayson=require(_0xf6db('0x9'));var client=jayson[_0xf6db('0xa')][_0xf6db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114826,_0x458316,_0x39150b){return new BPromise(function(_0xef8a2a,_0x2ccc80){return client[_0xf6db('0xc')](_0x114826,_0x39150b)['then'](function(_0x1bf574){logger[_0xf6db('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x458316,_0xf6db('0xe'));logger[_0xf6db('0xf')](_0xf6db('0x10'),_0x458316,_0xf6db('0xe'),JSON[_0xf6db('0x11')](_0x1bf574));if(_0x1bf574['error']){if(_0x1bf574[_0xf6db('0x12')][_0xf6db('0x13')]===0x1f4){logger['error'](_0xf6db('0x14'),_0x458316,_0x1bf574[_0xf6db('0x12')][_0xf6db('0x15')]);return _0x2ccc80(_0x1bf574['error'][_0xf6db('0x15')]);}logger[_0xf6db('0x12')](_0xf6db('0x14'),_0x458316,_0x1bf574[_0xf6db('0x12')]['message']);return _0xef8a2a(_0x1bf574[_0xf6db('0x12')]['message']);}else{logger[_0xf6db('0xd')](_0xf6db('0x14'),_0x458316,_0xf6db('0xe'));_0xef8a2a(_0x1bf574['result'][_0xf6db('0x15')]);}})['catch'](function(_0x10a683){logger[_0xf6db('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x458316,_0x10a683);_0x2ccc80(_0x10a683);});});}exports['CreateVoiceDialReport']=function(_0x45fda4){var _0x258d41=this;return new Promise(function(_0x26c617,_0x519b8b){return db[_0xf6db('0x16')][_0xf6db('0x17')](_0x45fda4['body'],{'raw':_0x45fda4[_0xf6db('0x18')]?_0x45fda4[_0xf6db('0x18')][_0xf6db('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x33d3b0){logger[_0xf6db('0xd')](_0xf6db('0x1a'),_0x45fda4);logger[_0xf6db('0xf')]('CreateVoiceDialReport',_0x45fda4,JSON[_0xf6db('0x11')](_0x33d3b0));_0x26c617(_0x33d3b0);})[_0xf6db('0x1b')](function(_0x333c55){logger[_0xf6db('0x12')](_0xf6db('0x1a'),_0x333c55[_0xf6db('0x15')],_0x45fda4);_0x519b8b(_0x258d41[_0xf6db('0x12')](0x1f4,_0x333c55[_0xf6db('0x15')]));});});};exports[_0xf6db('0x1c')]=function(_0x1d0931){var _0x2f0057=this;return new Promise(function(_0x3f169b,_0x4ca31d){return db['VoiceDialReport'][_0xf6db('0x1d')](_0x1d0931[_0xf6db('0x1e')],{'raw':_0x1d0931[_0xf6db('0x18')]?_0x1d0931[_0xf6db('0x18')][_0xf6db('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0931[_0xf6db('0x18')]?_0x1d0931[_0xf6db('0x18')]['where']||null:null,'attributes':_0x1d0931[_0xf6db('0x18')]?_0x1d0931[_0xf6db('0x18')]['attributes']||null:null,'limit':_0x1d0931[_0xf6db('0x18')]?_0x1d0931[_0xf6db('0x18')][_0xf6db('0x1f')]||null:null})[_0xf6db('0x20')](function(_0x1d4cdb){logger[_0xf6db('0xd')](_0xf6db('0x1c'),_0x1d0931);logger[_0xf6db('0xf')]('UpdateVoiceDialReport',_0x1d0931,JSON['stringify'](_0x1d4cdb));_0x3f169b(_0x1d4cdb);})[_0xf6db('0x1b')](function(_0x1712e4){logger[_0xf6db('0x12')]('UpdateVoiceDialReport',_0x1712e4[_0xf6db('0x15')],_0x1d0931);_0x4ca31d(_0x2f0057[_0xf6db('0x12')](0x1f4,_0x1712e4[_0xf6db('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b4b42b1..ddb9da2 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 _0x2716=['../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','post','/:id/applications','addApplications','delete','destroy','exports','util','path','../../components/auth/service'];(function(_0x14c6ad,_0x516172){var _0x1e4858=function(_0x3988c8){while(--_0x3988c8){_0x14c6ad['push'](_0x14c6ad['shift']());}};_0x1e4858(++_0x516172);}(_0x2716,0x6d));var _0x6271=function(_0x52dace,_0x530aa7){_0x52dace=_0x52dace-0x0;var _0x4e43b6=_0x2716[_0x52dace];return _0x4e43b6;};'use strict';var multer=require('multer');var util=require(_0x6271('0x0'));var path=require(_0x6271('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6271('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x6271('0x3'));var controller=require(_0x6271('0x4'));router[_0x6271('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6271('0x5')](_0x6271('0x6'),auth[_0x6271('0x7')](),controller['show']);router[_0x6271('0x8')]('/',auth[_0x6271('0x7')](),controller['create']);router[_0x6271('0x8')](_0x6271('0x9'),auth[_0x6271('0x7')](),controller[_0x6271('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6271('0xb')](_0x6271('0x6'),auth[_0x6271('0x7')](),controller[_0x6271('0xc')]);module[_0x6271('0xd')]=router; \ No newline at end of file +var _0xe767=['Router','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','/:id','show','create','post','/:id/applications','put','update','delete','destroy','multer','util','path'];(function(_0x2c44d2,_0x13cb52){var _0x195143=function(_0x34b67d){while(--_0x34b67d){_0x2c44d2['push'](_0x2c44d2['shift']());}};_0x195143(++_0x13cb52);}(_0xe767,0x184));var _0x7e76=function(_0x2f004f,_0x2b356d){_0x2f004f=_0x2f004f-0x0;var _0x3dcd59=_0xe767[_0x2f004f];return _0x3dcd59;};'use strict';var multer=require(_0x7e76('0x0'));var util=require(_0x7e76('0x1'));var path=require(_0x7e76('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e76('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7e76('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7e76('0x5'));router[_0x7e76('0x6')]('/',auth[_0x7e76('0x7')](),controller['index']);router['get'](_0x7e76('0x8'),auth[_0x7e76('0x7')](),controller[_0x7e76('0x9')]);router['post']('/',auth[_0x7e76('0x7')](),controller[_0x7e76('0xa')]);router[_0x7e76('0xb')](_0x7e76('0xc'),auth['isAuthenticated'](),controller['addApplications']);router[_0x7e76('0xd')](_0x7e76('0x8'),auth[_0x7e76('0x7')](),controller[_0x7e76('0xe')]);router[_0x7e76('0xf')](_0x7e76('0x8'),auth[_0x7e76('0x7')](),controller[_0x7e76('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index bc3ece3..a72f81a 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 _0x2fd1=['any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM','inbound','outbound','internal','outbound-fax','system'];(function(_0x4a7d9b,_0xd28d37){var _0x238d70=function(_0x53a872){while(--_0x53a872){_0x4a7d9b['push'](_0x4a7d9b['shift']());}};_0x238d70(++_0xd28d37);}(_0x2fd1,0x106));var _0x12fd=function(_0x4bcbc2,_0x46cbff){_0x4bcbc2=_0x4bcbc2-0x0;var _0xe5b888=_0x2fd1[_0x4bcbc2];return _0xe5b888;};'use strict';var Sequelize=require(_0x12fd('0x0'));module[_0x12fd('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x12fd('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x12fd('0x2')},'priority':{'type':Sequelize[_0x12fd('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x12fd('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x12fd('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x12fd('0x4')](_0x12fd('0x5'),_0x12fd('0x6'),_0x12fd('0x7'),'inbound-fax',_0x12fd('0x8'),_0x12fd('0x9'),_0x12fd('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x12fd('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x12fd('0xb')]},'isApp':{'type':Sequelize[_0x12fd('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x12fd('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x12fd('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x12fd('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x12fd('0xd')},'answer':{'type':Sequelize[_0x12fd('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x12fd('0xe')],'get':function(_0x2536ac){return this[_0x12fd('0xf')](_0x12fd('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x70f7=['INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*'];(function(_0x5e8b10,_0x5afe9e){var _0x4d2a10=function(_0x1629fb){while(--_0x1629fb){_0x5e8b10['push'](_0x5e8b10['shift']());}};_0x4d2a10(++_0x5afe9e);}(_0x70f7,0xcb));var _0x770f=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x70f7[_0x299784];return _0x5ab008;};'use strict';var Sequelize=require(_0x770f('0x0'));module[_0x770f('0x1')]={'context':{'type':Sequelize[_0x770f('0x2')],'allowNull':![],'unique':_0x770f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x770f('0x3')},'priority':{'type':Sequelize[_0x770f('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x770f('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x770f('0x2')],'allowNull':![],'defaultValue':_0x770f('0x4')},'appdata':{'type':Sequelize[_0x770f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x770f('0x5'),_0x770f('0x6'),_0x770f('0x7'),_0x770f('0x8'),_0x770f('0x9'),_0x770f('0xa'),_0x770f('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x770f('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x770f('0xc')},'IntervalId':{'type':Sequelize[_0x770f('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x770f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x770f('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x770f('0xd')]},'recordingFormat':{'type':Sequelize[_0x770f('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x770f('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x770f('0xf')],'get':function(_0x398dd1){return this[_0x770f('0x10')](_0x770f('0x11'));}},'alias':{'type':Sequelize[_0x770f('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 6400c29..61fc1f2 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 _0xddd1=['inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','type','find','name','UserProfileResource','end','error','stack','send','VoiceExtension','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','concat','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','mandatoryDisposition','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','finally','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','destroy','then','get','InboundRoutes'];(function(_0x178cbc,_0x5dd294){var _0x5da6cb=function(_0xd099cc){while(--_0xd099cc){_0x178cbc['push'](_0x178cbc['shift']());}};_0x5da6cb(++_0x5dd294);}(_0xddd1,0x147));var _0x1ddd=function(_0x1b1c33,_0x429996){_0x1b1c33=_0x1b1c33-0x0;var _0x25bb4f=_0xddd1[_0x1b1c33];return _0x25bb4f;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x1ddd('0x0'));var logger=require(_0x1ddd('0x1'))('api');var config=require('../../config/environment');var db=require(_0x1ddd('0x2'))['db'];config['redis']=_[_0x1ddd('0x3')](config[_0x1ddd('0x4')],{'host':_0x1ddd('0x5'),'port':0x18eb});var socket=require(_0x1ddd('0x6'))(new Redis(config[_0x1ddd('0x4')]));require(_0x1ddd('0x7'))[_0x1ddd('0x8')](socket);function respondWithStatusCode(_0x342adc,_0x1138ff){_0x1138ff=_0x1138ff||0xcc;return function(_0x641689){if(_0x641689){return _0x342adc[_0x1ddd('0x9')](_0x1138ff);}return _0x342adc[_0x1ddd('0xa')](_0x1138ff)['end']();};}function respondWithResult(_0x382903,_0x26c00f){_0x26c00f=_0x26c00f||0xc8;return function(_0x114601){if(_0x114601){return _0x382903[_0x1ddd('0xa')](_0x26c00f)[_0x1ddd('0xb')](_0x114601);}};}function respondWithFilteredResult(_0x5e9551,_0x28891e){return function(_0x2d5abf){if(_0x2d5abf){var _0x51829a=typeof _0x28891e[_0x1ddd('0xc')]===_0x1ddd('0xd')&&typeof _0x28891e['limit']===_0x1ddd('0xd');var _0xa3e268=_0x2d5abf[_0x1ddd('0xe')];var _0x4a98d9=_0x51829a?0x0:_0x28891e[_0x1ddd('0xc')];var _0x5559ee=_0x51829a?_0x2d5abf[_0x1ddd('0xe')]:_0x28891e[_0x1ddd('0xc')]+_0x28891e[_0x1ddd('0xf')];var _0x526200;if(_0x5559ee>=_0xa3e268){_0x5559ee=_0xa3e268;_0x526200=0xc8;}else{_0x526200=0xce;}_0x5e9551[_0x1ddd('0xa')](_0x526200);return _0x5e9551['set'](_0x1ddd('0x10'),_0x4a98d9+'-'+_0x5559ee+'/'+_0xa3e268)[_0x1ddd('0xb')](_0x2d5abf);}return null;};}function removeEntity(_0x204250){return function(_0x42dbb6){if(_0x42dbb6){return _0x42dbb6[_0x1ddd('0x11')]()[_0x1ddd('0x12')](function(){var _0x35338a=_0x42dbb6[_0x1ddd('0x13')]({'plain':!![]});var _0x99ce6e=[{'name':_0x1ddd('0x14'),'value':_0x1ddd('0x15'),'ignore':![]},{'name':_0x1ddd('0x16'),'value':_0x1ddd('0x17'),'ignore':![]},{'name':_0x1ddd('0x18'),'value':_0x1ddd('0x19'),'ignore':![]}];var _0x334005=_(_0x99ce6e)['filter'](_0x1ddd('0x1a'))[_0x1ddd('0x1b')](_0x1ddd('0x1c'))[_0x1ddd('0x1c')]();if(_['includes'](_0x334005,_0x35338a[_0x1ddd('0x1d')])){return;}var _0x47cdde=_[_0x1ddd('0x1e')](_0x99ce6e,[_0x1ddd('0x1c'),_0x35338a[_0x1ddd('0x1d')]])[_0x1ddd('0x1f')];return db[_0x1ddd('0x20')][_0x1ddd('0x11')]({'where':{'type':_0x47cdde,'resourceId':_0x35338a['id']}})[_0x1ddd('0x12')](function(){return _0x42dbb6;});})['then'](function(){_0x204250['status'](0xcc)[_0x1ddd('0x21')]();});}};}function handleEntityNotFound(_0x4d446c){return function(_0x15ab81){if(!_0x15ab81){_0x4d446c[_0x1ddd('0x9')](0x194);}return _0x15ab81;};}function handleError(_0x567858,_0x85d84a){_0x85d84a=_0x85d84a||0x1f4;return function(_0x586fc8){logger[_0x1ddd('0x22')](_0x586fc8[_0x1ddd('0x23')]);if(_0x586fc8[_0x1ddd('0x1f')]){delete _0x586fc8['name'];}_0x567858[_0x1ddd('0xa')](_0x85d84a)[_0x1ddd('0x24')](_0x586fc8);};}exports['index']=function(_0x1e0525,_0x2e82cf){var _0x59db46={},_0x4dbc3b={},_0x50ecd0={'count':0x0,'rows':[]};var _0x316fef=_[_0x1ddd('0x1b')](db[_0x1ddd('0x25')][_0x1ddd('0x26')],function(_0x135bda){return{'name':_0x135bda['fieldName'],'type':_0x135bda['type'][_0x1ddd('0x27')]};});_0x4dbc3b['model']=_['map'](_0x316fef,'name');_0x4dbc3b[_0x1ddd('0x28')]=_[_0x1ddd('0x29')](_0x1e0525[_0x1ddd('0x28')]);_0x4dbc3b[_0x1ddd('0x2a')]=_[_0x1ddd('0x2b')](_0x4dbc3b['model'],_0x4dbc3b[_0x1ddd('0x28')]);_0x59db46[_0x1ddd('0x2c')]=_['intersection'](_0x4dbc3b[_0x1ddd('0x2d')],qs[_0x1ddd('0x2e')](_0x1e0525[_0x1ddd('0x28')][_0x1ddd('0x2e')]));_0x59db46['attributes']=_0x59db46[_0x1ddd('0x2c')][_0x1ddd('0x2f')]?_0x59db46[_0x1ddd('0x2c')]:_0x4dbc3b[_0x1ddd('0x2d')];if(!_0x1e0525[_0x1ddd('0x28')][_0x1ddd('0x30')]('nolimit')){_0x59db46['limit']=qs[_0x1ddd('0xf')](_0x1e0525['query'][_0x1ddd('0xf')]);_0x59db46[_0x1ddd('0xc')]=qs[_0x1ddd('0xc')](_0x1e0525['query'][_0x1ddd('0xc')]);}_0x59db46[_0x1ddd('0x31')]=qs[_0x1ddd('0x32')](_0x1e0525[_0x1ddd('0x28')][_0x1ddd('0x32')]);_0x59db46['where']=qs[_0x1ddd('0x2a')](_['pick'](_0x1e0525['query'],_0x4dbc3b[_0x1ddd('0x2a')]),_0x316fef);if(_0x1e0525[_0x1ddd('0x28')][_0x1ddd('0x33')]){_0x59db46['where']=_[_0x1ddd('0x34')](_0x59db46[_0x1ddd('0x35')],{'$or':_[_0x1ddd('0x1b')](_0x316fef,function(_0x4061d1){if(_0x4061d1[_0x1ddd('0x1d')]!==_0x1ddd('0x36')){var _0x5f32e2={};_0x5f32e2[_0x4061d1[_0x1ddd('0x1f')]]={'$like':'%'+_0x1e0525[_0x1ddd('0x28')]['filter']+'%'};return _0x5f32e2;}})});}_0x59db46=_[_0x1ddd('0x34')]({},_0x59db46,_0x1e0525[_0x1ddd('0x37')]);var _0x4cf841={'where':_0x59db46[_0x1ddd('0x35')]};return db[_0x1ddd('0x25')][_0x1ddd('0xe')](_0x4cf841)[_0x1ddd('0x12')](function(_0x2957f1){_0x50ecd0['count']=_0x2957f1;if(_0x1e0525[_0x1ddd('0x28')][_0x1ddd('0x38')]){_0x59db46[_0x1ddd('0x39')]=[{'all':!![]}];}return db[_0x1ddd('0x25')][_0x1ddd('0x3a')](_0x59db46);})[_0x1ddd('0x12')](function(_0x3eda99){_0x50ecd0[_0x1ddd('0x3b')]=_0x3eda99;return _0x50ecd0;})[_0x1ddd('0x12')](respondWithFilteredResult(_0x2e82cf,_0x59db46))['catch'](handleError(_0x2e82cf,null));};exports['show']=function(_0x16bb33,_0x349354){var _0x33c949={'raw':![],'where':{'id':_0x16bb33[_0x1ddd('0x3c')]['id']}},_0x50a033={};_0x50a033['model']=_['keys'](db[_0x1ddd('0x25')][_0x1ddd('0x26')]);_0x50a033[_0x1ddd('0x28')]=_[_0x1ddd('0x29')](_0x16bb33[_0x1ddd('0x28')]);_0x50a033['filters']=_[_0x1ddd('0x2b')](_0x50a033[_0x1ddd('0x2d')],_0x50a033[_0x1ddd('0x28')]);_0x33c949[_0x1ddd('0x2c')]=_[_0x1ddd('0x2b')](_0x50a033[_0x1ddd('0x2d')],qs[_0x1ddd('0x2e')](_0x16bb33['query'][_0x1ddd('0x2e')]));_0x33c949[_0x1ddd('0x2c')]=_0x33c949[_0x1ddd('0x2c')][_0x1ddd('0x2f')]?_0x33c949['attributes']:_0x50a033['model'];if(_0x16bb33[_0x1ddd('0x28')][_0x1ddd('0x38')]){_0x33c949[_0x1ddd('0x39')]=[{'all':!![]}];}_0x33c949=_['merge']({},_0x33c949,_0x16bb33[_0x1ddd('0x37')]);return db[_0x1ddd('0x25')][_0x1ddd('0x1e')](_0x33c949)[_0x1ddd('0x12')](handleEntityNotFound(_0x349354,null))[_0x1ddd('0x12')](respondWithResult(_0x349354,null))[_0x1ddd('0x3d')](handleError(_0x349354,null));};exports[_0x1ddd('0x11')]=function(_0x20d8af,_0x2f9dc9){return db[_0x1ddd('0x25')][_0x1ddd('0x1e')]({'where':{'id':_0x20d8af[_0x1ddd('0x3c')]['id']}})[_0x1ddd('0x12')](handleEntityNotFound(_0x2f9dc9,null))['then'](removeEntity(_0x2f9dc9,null))[_0x1ddd('0x3d')](handleError(_0x2f9dc9,null));};exports[_0x1ddd('0x3e')]=function(_0x1060b9,_0x224af6){if(_0x1060b9[_0x1ddd('0x3f')][_0x1ddd('0x1d')]==='outbound'&&!_['startsWith'](_0x1060b9[_0x1ddd('0x3f')]['exten'],'_')){_0x1060b9['body']['exten']='_'[_0x1ddd('0x40')](_0x1060b9[_0x1ddd('0x3f')][_0x1ddd('0x41')]);}return db[_0x1ddd('0x25')]['create'](_0x1060b9[_0x1ddd('0x3f')],{'raw':![]})[_0x1ddd('0x12')](function(_0x84e2a6){var _0xc49d85=_0x1060b9[_0x1ddd('0x42')][_0x1ddd('0x13')]({'plain':!![]});if(!_0xc49d85)throw new Error(_0x1ddd('0x43'));if(_0xc49d85['role']===_0x1ddd('0x42')){var _0x5d1d01=_0x84e2a6[_0x1ddd('0x13')]({'plain':!![]});var _0x9dc0c6=[{'name':_0x1ddd('0x14'),'value':'inbound'},{'name':_0x1ddd('0x16'),'value':_0x1ddd('0x17')},{'name':_0x1ddd('0x18'),'value':_0x1ddd('0x19')}];var _0x49c792=_['find'](_0x9dc0c6,[_0x1ddd('0x1c'),_0x5d1d01[_0x1ddd('0x1d')]])[_0x1ddd('0x1f')];return db[_0x1ddd('0x44')]['find']({'where':{'name':_0x49c792,'userProfileId':_0xc49d85[_0x1ddd('0x45')]},'raw':!![]})[_0x1ddd('0x12')](function(_0x464351){if(_0x464351&&_0x464351['autoAssociation']===0x0){return db[_0x1ddd('0x20')][_0x1ddd('0x3e')]({'name':_0x5d1d01[_0x1ddd('0x1f')],'resourceId':_0x5d1d01['id'],'type':_0x464351[_0x1ddd('0x1f')],'sectionId':_0x464351['id']},{})[_0x1ddd('0x12')](function(){return _0x84e2a6;});}else{return _0x84e2a6;}})['catch'](function(_0x1bf833){logger[_0x1ddd('0x22')](_0x1ddd('0x46'),_0x1bf833);throw _0x1bf833;});}return _0x84e2a6;})[_0x1ddd('0x12')](respondWithResult(_0x224af6,0xc9))[_0x1ddd('0x3d')](handleError(_0x224af6,null));};exports[_0x1ddd('0x47')]=function(_0x38abca,_0x12bfa8){if(_0x38abca[_0x1ddd('0x3f')]['id']){delete _0x38abca[_0x1ddd('0x3f')]['id'];}return db[_0x1ddd('0x25')]['find']({'where':{'id':_0x38abca[_0x1ddd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x12bfa8,null))[_0x1ddd('0x12')](function(_0x11494c){if(_0x11494c){return db[_0x1ddd('0x25')][_0x1ddd('0x47')](_[_0x1ddd('0x48')](_0x38abca[_0x1ddd('0x3f')],['exten',_0x1ddd('0x49'),'description','recordingFormat','cutdigits',_0x1ddd('0x4a'),_0x1ddd('0x4b')]),{'where':{'context':_0x11494c['context'],'exten':_0x11494c['exten']},'individualHooks':!![]})['then'](function(_0x487000){return _0x487000;});}return null;})['then'](respondWithStatusCode(_0x12bfa8,null))[_0x1ddd('0x3d')](handleError(_0x12bfa8,null));};exports[_0x1ddd('0x4c')]=function(_0x5c3d8,_0x2a6410){var _0x50ca2c=_0x5c3d8[_0x1ddd('0x3c')]['id'];var _0x37c3db=_0x5c3d8['body'];var _0x4da024=0xc8;var _0x2e29c2=null;return db['sequelize'][_0x1ddd('0x4d')]({'isolationLevel':db[_0x1ddd('0x4e')][_0x1ddd('0x4f')][_0x1ddd('0x50')]['READ_COMMITTED']},function(_0x304a17){return db[_0x1ddd('0x25')][_0x1ddd('0x51')]({'where':{'id':_0x50ca2c},'transaction':_0x304a17})[_0x1ddd('0x12')](function(_0x37ccc3){if(_0x37ccc3){return db[_0x1ddd('0x25')][_0x1ddd('0x11')]({'where':{'VoiceExtensionId':_0x50ca2c},'transaction':_0x304a17})[_0x1ddd('0x12')](function(){var _0x11e6c1=_[_0x1ddd('0x1b')](_0x37c3db,function(_0x190785){_0x190785[_0x1ddd('0x52')]=_0x50ca2c;_0x190785[_0x1ddd('0x53')]=!![];return _0x190785;});return _0x37ccc3[_0x1ddd('0x54')](_0x11e6c1);})[_0x1ddd('0x12')](function(_0x24c377){return db[_0x1ddd('0x25')][_0x1ddd('0x55')](_0x24c377,{'transaction':_0x304a17});});}else{_0x4da024=0x194;_0x2e29c2=[];}});})[_0x1ddd('0x12')](function(){if(_0x4da024!==0x194){return db[_0x1ddd('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x50ca2c},'order':'cast(priority\x20as\x20unsigned)'})[_0x1ddd('0x12')](function(_0x1afd07){_0x2e29c2=_0x1afd07;});}})['catch'](function(_0x496b14){_0x4da024=0x1f4;logger[_0x1ddd('0x22')](_0x496b14[_0x1ddd('0x23')]);if(_0x496b14[_0x1ddd('0x1f')]){delete _0x496b14[_0x1ddd('0x1f')];}_0x2e29c2=_0x496b14;})[_0x1ddd('0x56')](function(){if(_0x2e29c2===null){_0x2a6410[_0x1ddd('0x9')](_0x4da024);}else{if(_0x4da024===0x1f4){_0x2a6410[_0x1ddd('0xa')](_0x4da024)[_0x1ddd('0x24')](_0x2e29c2);}else{_0x2a6410[_0x1ddd('0xa')](_0x4da024)[_0x1ddd('0xb')](_0x2e29c2);}}});}; \ No newline at end of file +var _0xa13d=['concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','catch','update','context','description','recordingFormat','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','findOne','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','find','type','name','destroy','error','send','index','map','VoiceExtension','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','where','merge','options','includeAll','rows','show','params','include','create','body','startsWith','exten'];(function(_0x234644,_0xdb62e6){var _0x1168d8=function(_0x4eb1cd){while(--_0x4eb1cd){_0x234644['push'](_0x234644['shift']());}};_0x1168d8(++_0xdb62e6);}(_0xa13d,0x71));var _0xda13=function(_0x345605,_0x19db4d){_0x345605=_0x345605-0x0;var _0x52fbb3=_0xa13d[_0x345605];return _0x52fbb3;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xda13('0x0'));var logger=require(_0xda13('0x1'))(_0xda13('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xda13('0x3')]=_[_0xda13('0x4')](config[_0xda13('0x3')],{'host':_0xda13('0x5'),'port':0x18eb});var socket=require(_0xda13('0x6'))(new Redis(config[_0xda13('0x3')]));require(_0xda13('0x7'))[_0xda13('0x8')](socket);function respondWithStatusCode(_0x832ddc,_0x5ea74b){_0x5ea74b=_0x5ea74b||0xcc;return function(_0x38ffe7){if(_0x38ffe7){return _0x832ddc[_0xda13('0x9')](_0x5ea74b);}return _0x832ddc[_0xda13('0xa')](_0x5ea74b)[_0xda13('0xb')]();};}function respondWithResult(_0x354f41,_0x2d43a7){_0x2d43a7=_0x2d43a7||0xc8;return function(_0x6e2a23){if(_0x6e2a23){return _0x354f41[_0xda13('0xa')](_0x2d43a7)['json'](_0x6e2a23);}};}function respondWithFilteredResult(_0x5aa055,_0x1773ba){return function(_0x772775){if(_0x772775){var _0x47ca7a=typeof _0x1773ba[_0xda13('0xc')]==='undefined'&&typeof _0x1773ba[_0xda13('0xd')]===_0xda13('0xe');var _0x1258e1=_0x772775[_0xda13('0xf')];var _0x21ee4d=_0x47ca7a?0x0:_0x1773ba[_0xda13('0xc')];var _0x4faafe=_0x47ca7a?_0x772775[_0xda13('0xf')]:_0x1773ba[_0xda13('0xc')]+_0x1773ba[_0xda13('0xd')];var _0x5af30a;if(_0x4faafe>=_0x1258e1){_0x4faafe=_0x1258e1;_0x5af30a=0xc8;}else{_0x5af30a=0xce;}_0x5aa055[_0xda13('0xa')](_0x5af30a);return _0x5aa055['set'](_0xda13('0x10'),_0x21ee4d+'-'+_0x4faafe+'/'+_0x1258e1)['json'](_0x772775);}return null;};}function removeEntity(_0x35d14a){return function(_0x1b207d){if(_0x1b207d){return _0x1b207d['destroy']()[_0xda13('0x11')](function(){var _0x3663e0=_0x1b207d[_0xda13('0x12')]({'plain':!![]});var _0x178f59=[{'name':_0xda13('0x13'),'value':_0xda13('0x14'),'ignore':![]},{'name':_0xda13('0x15'),'value':_0xda13('0x16'),'ignore':![]},{'name':_0xda13('0x17'),'value':_0xda13('0x18'),'ignore':![]}];var _0x127a71=_(_0x178f59)[_0xda13('0x19')](_0xda13('0x1a'))['map']('value')[_0xda13('0x1b')]();if(_[_0xda13('0x1c')](_0x127a71,_0x3663e0['type'])){return;}var _0x434c44=_[_0xda13('0x1d')](_0x178f59,[_0xda13('0x1b'),_0x3663e0[_0xda13('0x1e')]])[_0xda13('0x1f')];return db['UserProfileResource'][_0xda13('0x20')]({'where':{'type':_0x434c44,'resourceId':_0x3663e0['id']}})[_0xda13('0x11')](function(){return _0x1b207d;});})[_0xda13('0x11')](function(){_0x35d14a[_0xda13('0xa')](0xcc)[_0xda13('0xb')]();});}};}function handleEntityNotFound(_0x5aebd6){return function(_0x29ddbd){if(!_0x29ddbd){_0x5aebd6['sendStatus'](0x194);}return _0x29ddbd;};}function handleError(_0x88e167,_0x14f6b2){_0x14f6b2=_0x14f6b2||0x1f4;return function(_0xfb6f49){logger[_0xda13('0x21')](_0xfb6f49['stack']);if(_0xfb6f49[_0xda13('0x1f')]){delete _0xfb6f49['name'];}_0x88e167[_0xda13('0xa')](_0x14f6b2)[_0xda13('0x22')](_0xfb6f49);};}exports[_0xda13('0x23')]=function(_0x4be90e,_0x538a43){var _0x3ca783={},_0x22a4bb={},_0x3e3b21={'count':0x0,'rows':[]};var _0xb1e74d=_[_0xda13('0x24')](db[_0xda13('0x25')][_0xda13('0x26')],function(_0xb3dcb){return{'name':_0xb3dcb[_0xda13('0x27')],'type':_0xb3dcb[_0xda13('0x1e')][_0xda13('0x28')]};});_0x22a4bb['model']=_[_0xda13('0x24')](_0xb1e74d,_0xda13('0x1f'));_0x22a4bb[_0xda13('0x29')]=_[_0xda13('0x2a')](_0x4be90e[_0xda13('0x29')]);_0x22a4bb['filters']=_[_0xda13('0x2b')](_0x22a4bb[_0xda13('0x2c')],_0x22a4bb['query']);_0x3ca783['attributes']=_[_0xda13('0x2b')](_0x22a4bb[_0xda13('0x2c')],qs[_0xda13('0x2d')](_0x4be90e[_0xda13('0x29')][_0xda13('0x2d')]));_0x3ca783[_0xda13('0x2e')]=_0x3ca783[_0xda13('0x2e')][_0xda13('0x2f')]?_0x3ca783[_0xda13('0x2e')]:_0x22a4bb['model'];if(!_0x4be90e[_0xda13('0x29')][_0xda13('0x30')](_0xda13('0x31'))){_0x3ca783[_0xda13('0xd')]=qs['limit'](_0x4be90e[_0xda13('0x29')][_0xda13('0xd')]);_0x3ca783[_0xda13('0xc')]=qs[_0xda13('0xc')](_0x4be90e[_0xda13('0x29')][_0xda13('0xc')]);}_0x3ca783['order']=qs['sort'](_0x4be90e['query'][_0xda13('0x32')]);_0x3ca783['where']=qs['filters'](_[_0xda13('0x33')](_0x4be90e[_0xda13('0x29')],_0x22a4bb[_0xda13('0x34')]),_0xb1e74d);if(_0x4be90e[_0xda13('0x29')][_0xda13('0x19')]){_0x3ca783[_0xda13('0x35')]=_['merge'](_0x3ca783['where'],{'$or':_[_0xda13('0x24')](_0xb1e74d,function(_0x10bbfb){if(_0x10bbfb[_0xda13('0x1e')]!=='VIRTUAL'){var _0x46508e={};_0x46508e[_0x10bbfb[_0xda13('0x1f')]]={'$like':'%'+_0x4be90e[_0xda13('0x29')][_0xda13('0x19')]+'%'};return _0x46508e;}})});}_0x3ca783=_[_0xda13('0x36')]({},_0x3ca783,_0x4be90e[_0xda13('0x37')]);var _0x154ab7={'where':_0x3ca783[_0xda13('0x35')]};return db['VoiceExtension'][_0xda13('0xf')](_0x154ab7)[_0xda13('0x11')](function(_0x120e11){_0x3e3b21[_0xda13('0xf')]=_0x120e11;if(_0x4be90e[_0xda13('0x29')][_0xda13('0x38')]){_0x3ca783['include']=[{'all':!![]}];}return db[_0xda13('0x25')]['findAll'](_0x3ca783);})[_0xda13('0x11')](function(_0x15fac6){_0x3e3b21[_0xda13('0x39')]=_0x15fac6;return _0x3e3b21;})['then'](respondWithFilteredResult(_0x538a43,_0x3ca783))['catch'](handleError(_0x538a43,null));};exports[_0xda13('0x3a')]=function(_0x3cc947,_0x219acb){var _0x3f1e3e={'raw':![],'where':{'id':_0x3cc947[_0xda13('0x3b')]['id']}},_0x38b522={};_0x38b522['model']=_[_0xda13('0x2a')](db[_0xda13('0x25')][_0xda13('0x26')]);_0x38b522['query']=_['keys'](_0x3cc947[_0xda13('0x29')]);_0x38b522[_0xda13('0x34')]=_[_0xda13('0x2b')](_0x38b522['model'],_0x38b522['query']);_0x3f1e3e[_0xda13('0x2e')]=_[_0xda13('0x2b')](_0x38b522[_0xda13('0x2c')],qs[_0xda13('0x2d')](_0x3cc947[_0xda13('0x29')][_0xda13('0x2d')]));_0x3f1e3e[_0xda13('0x2e')]=_0x3f1e3e['attributes'][_0xda13('0x2f')]?_0x3f1e3e['attributes']:_0x38b522[_0xda13('0x2c')];if(_0x3cc947[_0xda13('0x29')][_0xda13('0x38')]){_0x3f1e3e[_0xda13('0x3c')]=[{'all':!![]}];}_0x3f1e3e=_[_0xda13('0x36')]({},_0x3f1e3e,_0x3cc947[_0xda13('0x37')]);return db[_0xda13('0x25')][_0xda13('0x1d')](_0x3f1e3e)[_0xda13('0x11')](handleEntityNotFound(_0x219acb,null))[_0xda13('0x11')](respondWithResult(_0x219acb,null))['catch'](handleError(_0x219acb,null));};exports[_0xda13('0x20')]=function(_0x22cc76,_0x5557e6){return db['VoiceExtension'][_0xda13('0x1d')]({'where':{'id':_0x22cc76[_0xda13('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5557e6,null))[_0xda13('0x11')](removeEntity(_0x5557e6,null))['catch'](handleError(_0x5557e6,null));};exports[_0xda13('0x3d')]=function(_0x4e4491,_0xd880af){if(_0x4e4491[_0xda13('0x3e')]['type']===_0xda13('0x16')&&!_[_0xda13('0x3f')](_0x4e4491[_0xda13('0x3e')][_0xda13('0x40')],'_')){_0x4e4491[_0xda13('0x3e')]['exten']='_'[_0xda13('0x41')](_0x4e4491[_0xda13('0x3e')][_0xda13('0x40')]);}return db[_0xda13('0x25')]['create'](_0x4e4491[_0xda13('0x3e')],{'raw':![]})[_0xda13('0x11')](function(_0x20ee17){var _0x4e4e43=_0x4e4491[_0xda13('0x42')]['get']({'plain':!![]});if(!_0x4e4e43)throw new Error(_0xda13('0x43'));if(_0x4e4e43['role']===_0xda13('0x42')){var _0x37347a=_0x20ee17[_0xda13('0x12')]({'plain':!![]});var _0x3d36ac=[{'name':_0xda13('0x13'),'value':'inbound'},{'name':'OutboundRoutes','value':_0xda13('0x16')},{'name':_0xda13('0x17'),'value':_0xda13('0x18')}];var _0x5c71bf=_[_0xda13('0x1d')](_0x3d36ac,[_0xda13('0x1b'),_0x37347a[_0xda13('0x1e')]])['name'];return db['UserProfileSection'][_0xda13('0x1d')]({'where':{'name':_0x5c71bf,'userProfileId':_0x4e4e43[_0xda13('0x44')]},'raw':!![]})['then'](function(_0x2f5fd5){if(_0x2f5fd5&&_0x2f5fd5[_0xda13('0x45')]===0x0){return db[_0xda13('0x46')][_0xda13('0x3d')]({'name':_0x37347a['name'],'resourceId':_0x37347a['id'],'type':_0x2f5fd5[_0xda13('0x1f')],'sectionId':_0x2f5fd5['id']},{})[_0xda13('0x11')](function(){return _0x20ee17;});}else{return _0x20ee17;}})[_0xda13('0x47')](function(_0x30ad0a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30ad0a);throw _0x30ad0a;});}return _0x20ee17;})[_0xda13('0x11')](respondWithResult(_0xd880af,0xc9))[_0xda13('0x47')](handleError(_0xd880af,null));};exports[_0xda13('0x48')]=function(_0xef5cb0,_0x1f2e00){if(_0xef5cb0[_0xda13('0x3e')]['id']){delete _0xef5cb0[_0xda13('0x3e')]['id'];}return db[_0xda13('0x25')][_0xda13('0x1d')]({'where':{'id':_0xef5cb0['params']['id']}})[_0xda13('0x11')](handleEntityNotFound(_0x1f2e00,null))[_0xda13('0x11')](function(_0x25ade0){if(_0x25ade0){return db[_0xda13('0x25')][_0xda13('0x48')](_['pick'](_0xef5cb0[_0xda13('0x3e')],[_0xda13('0x40'),_0xda13('0x49'),_0xda13('0x4a'),_0xda13('0x4b'),'cutdigits','mandatoryDisposition',_0xda13('0x4c')]),{'where':{'context':_0x25ade0['context'],'exten':_0x25ade0[_0xda13('0x40')]},'individualHooks':!![]})[_0xda13('0x11')](function(_0x5beb8b){return _0x5beb8b;});}return null;})[_0xda13('0x11')](respondWithStatusCode(_0x1f2e00,null))[_0xda13('0x47')](handleError(_0x1f2e00,null));};exports[_0xda13('0x4d')]=function(_0x547745,_0x4cdeef){var _0x2f2451=_0x547745[_0xda13('0x3b')]['id'];var _0x52b353=_0x547745[_0xda13('0x3e')];var _0xe1e95=0xc8;var _0xd0be19=null;return db['sequelize'][_0xda13('0x4e')]({'isolationLevel':db[_0xda13('0x4f')][_0xda13('0x50')][_0xda13('0x51')]['READ_COMMITTED']},function(_0x557a7e){return db[_0xda13('0x25')][_0xda13('0x52')]({'where':{'id':_0x2f2451},'transaction':_0x557a7e})[_0xda13('0x11')](function(_0x3b90ad){if(_0x3b90ad){return db[_0xda13('0x25')][_0xda13('0x20')]({'where':{'VoiceExtensionId':_0x2f2451},'transaction':_0x557a7e})[_0xda13('0x11')](function(){var _0x50b3db=_[_0xda13('0x24')](_0x52b353,function(_0x534ada){_0x534ada['VoiceExtensionId']=_0x2f2451;_0x534ada[_0xda13('0x53')]=!![];return _0x534ada;});return _0x3b90ad['createRouting'](_0x50b3db);})[_0xda13('0x11')](function(_0x740371){return db[_0xda13('0x25')][_0xda13('0x54')](_0x740371,{'transaction':_0x557a7e});});}else{_0xe1e95=0x194;_0xd0be19=[];}});})[_0xda13('0x11')](function(){if(_0xe1e95!==0x194){return db[_0xda13('0x25')][_0xda13('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2f2451},'order':_0xda13('0x56')})['then'](function(_0x624e79){_0xd0be19=_0x624e79;});}})[_0xda13('0x47')](function(_0x4f3c20){_0xe1e95=0x1f4;logger['error'](_0x4f3c20[_0xda13('0x57')]);if(_0x4f3c20['name']){delete _0x4f3c20[_0xda13('0x1f')];}_0xd0be19=_0x4f3c20;})[_0xda13('0x58')](function(){if(_0xd0be19===null){_0x4cdeef[_0xda13('0x9')](_0xe1e95);}else{if(_0xe1e95===0x1f4){_0x4cdeef[_0xda13('0xa')](_0xe1e95)[_0xda13('0x22')](_0xd0be19);}else{_0x4cdeef[_0xda13('0xa')](_0xe1e95)['json'](_0xd0be19);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5f52cd1..73a29cc 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 _0x42fe=['events','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x112b41,_0x1b882e){var _0x10047a=function(_0x222267){while(--_0x222267){_0x112b41['push'](_0x112b41['shift']());}};_0x10047a(++_0x1b882e);}(_0x42fe,0x1c0));var _0xe42f=function(_0x27b423,_0x312583){_0x27b423=_0x27b423-0x0;var _0x5c11b8=_0x42fe[_0x27b423];return _0x5c11b8;};'use strict';var EventEmitter=require(_0xe42f('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xe42f('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe42f('0x2')](0x0);var events={'afterCreate':_0xe42f('0x3'),'afterUpdate':_0xe42f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f889d){return function(_0x4120c3,_0x411339,_0x200760){VoiceExtensionEvents[_0xe42f('0x5')](_0x3f889d+':'+_0x4120c3['id'],_0x4120c3);VoiceExtensionEvents[_0xe42f('0x5')](_0x3f889d,_0x4120c3);_0x200760(null);};}for(var e in events){if(events[_0xe42f('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xe42f('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0766=['emit','hasOwnProperty','exports','../../mysqldb','VoiceExtension','save','remove'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0766,0xc0));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x6076('0x0'))['db'][_0x6076('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6076('0x2'),'afterUpdate':'update','afterDestroy':_0x6076('0x3')};function emitEvent(_0x373719){return function(_0x58add2,_0x2330b2,_0x1a344c){VoiceExtensionEvents[_0x6076('0x4')](_0x373719+':'+_0x58add2['id'],_0x58add2);VoiceExtensionEvents[_0x6076('0x4')](_0x373719,_0x58add2);_0x1a344c(null);};}for(var e in events){if(events[_0x6076('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x6076('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f9b9c05..78b7448 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 _0x3141=['answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','exports','models','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','url','split','length','name','param','phone','prefix','${EXTEN:','SIP','options','U(xcally-mixmonitor-context)','replace','join','isEmpty','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x3141,0x6d));var _0x1314=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3141[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1314('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x1314('0x1')]=function(_0x5296bf){var _0x81c992=_0x5296bf[_0x1314('0x2')];function _0x20087a(_0xf8130b){var _0x1d67cd=0x2;var _0x50d8bc=[{'type':_0xf8130b[_0x1314('0x3')],'app':'Set','appdata':'CDR(type)='+_0xf8130b[_0x1314('0x3')],'context':_0xf8130b[_0x1314('0x4')],'exten':_0xf8130b[_0x1314('0x5')],'priority':_0x1d67cd++,'VoiceExtensionId':_0xf8130b['id']},{'type':_0xf8130b[_0x1314('0x3')],'app':_0xf8130b[_0x1314('0x6')]?'Set':_0x1314('0x7'),'appdata':_0xf8130b[_0x1314('0x6')]?_0x1314('0x8')+_0xf8130b[_0x1314('0x6')]:_0x1314('0x9'),'context':_0xf8130b[_0x1314('0x4')],'exten':_0xf8130b['exten'],'priority':_0x1d67cd++,'VoiceExtensionId':_0xf8130b['id']}];if(_0xf8130b[_0x1314('0x3')]===_0x1314('0xa')){_0x50d8bc[_0x1314('0xb')]({'type':_0x1314('0xa'),'app':_0x1314('0xc'),'appdata':_0x1314('0xd')+_0xf8130b['id'],'context':_0xf8130b[_0x1314('0x4')],'exten':_0xf8130b['exten'],'priority':_0x1d67cd++,'VoiceExtensionId':_0xf8130b['id']});}_0x50d8bc[_0x1314('0xb')]({'type':_0xf8130b[_0x1314('0x3')],'app':_0x1314('0xc'),'appdata':_0x1314('0xe'),'context':_0xf8130b[_0x1314('0x4')],'exten':_0xf8130b[_0x1314('0x5')],'priority':_0x1d67cd++,'VoiceExtensionId':_0xf8130b['id']},{'type':_0xf8130b[_0x1314('0x3')],'app':_0x1314('0xc'),'appdata':_0x1314('0xf'),'context':_0xf8130b['context'],'exten':_0xf8130b[_0x1314('0x5')],'priority':_0x1d67cd++,'VoiceExtensionId':_0xf8130b['id']},{'type':_0xf8130b[_0x1314('0x3')],'app':'Set','appdata':_0x1314('0x10'),'context':_0xf8130b[_0x1314('0x4')],'exten':_0xf8130b[_0x1314('0x5')],'priority':_0x1d67cd++,'VoiceExtensionId':_0xf8130b['id']});return _0x50d8bc;}function _0x4595ff(_0x3fb085){var _0x4aa911=0x2;var _0xb9038e=[{'type':_0x1314('0x11'),'app':_0x1314('0xc'),'appdata':_0x1314('0x12'),'context':_0x3fb085['context'],'exten':_0x3fb085['exten'],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':_0x3fb085[_0x1314('0x6')]?_0x1314('0xc'):'NoOp','appdata':_0x3fb085[_0x1314('0x6')]?_0x1314('0x8')+_0x3fb085[_0x1314('0x6')]:_0x1314('0x9'),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':_0x1314('0xc'),'appdata':_0x1314('0x13')+(_0x3fb085[_0x1314('0x14')]?'${EXTEN:'+_0x3fb085[_0x1314('0x14')]+'}':_0x1314('0x15')),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':'outbound','app':'Set','appdata':_0x1314('0xd')+_0x3fb085['id'],'context':_0x3fb085['context'],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4aa911+0x2)+_0x1314('0x16')+(_0x4aa911+0x1)+')','context':_0x3fb085['context'],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':'outbound','app':'Set','appdata':_0x3fb085['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x3fb085[_0x1314('0x14')]+'}':_0x1314('0x17'),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':_0x1314('0xc'),'appdata':_0x1314('0xe'),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085['exten'],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':_0x1314('0xc'),'appdata':_0x1314('0xf'),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':'Set','appdata':_0x1314('0x10'),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':_0x1314('0xc'),'appdata':_0x1314('0x18')+_0x3fb085['id'],'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']}];if(_0x3fb085[_0x1314('0x19')](_0x1314('0x1a'))&&_0x3fb085[_0x1314('0x1a')]!==_0x1314('0x1b')){_0xb9038e['push']({'type':_0x1314('0x11'),'app':'Set','appdata':_0x1314('0x1c'),'context':_0x3fb085['context'],'exten':_0x3fb085[_0x1314('0x5')],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']},{'type':_0x1314('0x11'),'app':_0x1314('0xc'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3fb085[_0x1314('0x1a')]||_0x1314('0x1d'),'context':_0x3fb085[_0x1314('0x4')],'exten':_0x3fb085['exten'],'priority':_0x4aa911++,'VoiceExtensionId':_0x3fb085['id']});}return _0xb9038e;}function _0x108647(_0xe9f8f0,_0x236741){var _0x574cad=[{'name':_0x1314('0x1e'),'param':0x0},{'name':_0x1314('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x1314('0x20'),'param':0x3}];var _0x16b6c4={};var _0xba772=_0x236741[_0x1314('0x21')](',');var _0x5d3a16=[];for(var _0x18d7e1=0x0;_0x18d7e1<_0x574cad[_0x1314('0x22')];_0x18d7e1++){switch(_0x574cad[_0x18d7e1][_0x1314('0x23')]){case _0x1314('0x1e'):_0x16b6c4[_0x1314('0x1e')]=_0xba772[_0x574cad[_0x18d7e1][_0x1314('0x24')]][_0x1314('0x21')]('/')[0x1];_0x16b6c4[_0x1314('0x25')]=_0xba772[_0x574cad[_0x18d7e1][_0x1314('0x24')]][_0x1314('0x21')]('/')[0x2];_0x16b6c4['prefix']=_0x16b6c4[_0x1314('0x25')]?_0x16b6c4[_0x1314('0x25')][_0x1314('0x21')]('$')[0x0]:undefined;_0x16b6c4[_0x1314('0x25')]=_0xe9f8f0[_0x1314('0x14')]?(_0x16b6c4[_0x1314('0x26')]||'')+_0x1314('0x27')+_0xe9f8f0[_0x1314('0x14')]+'}':(_0x16b6c4[_0x1314('0x26')]||'')+_0x1314('0x15');_0x5d3a16[_0x574cad[_0x18d7e1]['param']]=[_0x1314('0x28'),_0x16b6c4[_0x1314('0x1e')],_0x16b6c4['phone']]['join']('/');break;case _0x1314('0x29'):_0x16b6c4[_0x1314('0x29')]=_0xba772[_0x574cad[_0x18d7e1]['param']];if(_0xe9f8f0[_0x1314('0x1a')]!==_0x1314('0x1b')){if(_0x16b6c4[_0x1314('0x29')]['indexOf'](_0x1314('0x2a'))<0x0){_0x16b6c4['options']+=_0x1314('0x2a');}}else{_0x16b6c4['options']=_0x16b6c4[_0x1314('0x29')][_0x1314('0x2b')](_0x1314('0x2a'),'');}_0x5d3a16[_0x574cad[_0x18d7e1][_0x1314('0x24')]]=_0x16b6c4['options'];break;default:_0x5d3a16[_0x574cad[_0x18d7e1][_0x1314('0x24')]]=_0xba772[_0x574cad[_0x18d7e1][_0x1314('0x24')]];}}return _0x5d3a16[_0x1314('0x2c')](',');}function _0xa9f444(_0x5510b4,_0x6c45c4,_0x5cd4d2){return new Promise(function(_0x110fa2,_0x22f51a){var _0x3e99e0=[];if(_[_0x1314('0x2d')](_0x6c45c4))return _0x110fa2(_0x3e99e0);_0x81c992['Interval'][_0x1314('0x2e')]({'attributes':['id','interval',_0x1314('0x2f')],'raw':!![]})[_0x1314('0x30')](function(_0x5da14b){for(var _0x2b29de=0x0,_0x255e66=0x0;_0x2b29de<_0x6c45c4[_0x1314('0x22')];_0x2b29de++,_0x255e66=0x0){var _0x3ee1c8=_0x6c45c4[_0x2b29de];var _0x37c9d0=[];var _0x4433a2=[];delete _0x3ee1c8['id'];if(_0x3ee1c8[_0x1314('0x31')]!==_0x1314('0x32')){_0x3ee1c8[_0x1314('0x33')]=[_0x3ee1c8['interval']];}else{_0x3ee1c8[_0x1314('0x33')]=_0x3ee1c8['IntervalId']?_[_0x1314('0x34')](_[_0x1314('0x35')](_0x5da14b,{'IntervalId':_0x3ee1c8[_0x1314('0x2f')]}),'interval'):[];}_0x3ee1c8[_0x1314('0x4')]=_0x5510b4[_0x1314('0x4')];_0x3ee1c8[_0x1314('0x5')]=_0x5510b4['exten'];if(_0x3ee1c8['type'])_0x3ee1c8[_0x1314('0x3')]=_0x3ee1c8['type']['toLowerCase']();if(_0x5510b4[_0x1314('0x3')]===_0x1314('0x11')){if(_0x3ee1c8[_0x1314('0x19')](_0x1314('0x36'))&&_0x3ee1c8[_0x1314('0x36')]&&_0x3ee1c8[_0x1314('0x36')]!=='--'){_0x37c9d0[_0x1314('0xb')]({'type':_0x3ee1c8[_0x1314('0x3')][_0x1314('0x37')](),'app':'Set','appdata':_0x1314('0x38')+_0x3ee1c8[_0x1314('0x36')],'context':_0x5510b4[_0x1314('0x4')],'exten':_0x5510b4['exten'],'priority':_0x3ee1c8[_0x1314('0x33')][_0x1314('0x22')]+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});}_0x37c9d0[_0x1314('0xb')]({'type':_0x3ee1c8[_0x1314('0x3')][_0x1314('0x37')](),'app':_0x1314('0x39'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3ee1c8[_0x1314('0x3a')]?_0x1314('0x3b')+_0x3ee1c8[_0x1314('0x3a')]+')':_0x1314('0x3c')),'context':_0x5510b4[_0x1314('0x4')],'exten':_0x5510b4[_0x1314('0x5')],'priority':_0x3ee1c8['intervals']['length']+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});}else{if(_0x3ee1c8['hasOwnProperty'](_0x1314('0x3d'))){if([_0x1314('0x3e'),_0x1314('0x3f')][_0x1314('0x40')](_0x3ee1c8[_0x1314('0x41')][_0x1314('0x37')]())&&_0x3ee1c8[_0x1314('0x42')]!==_0x1314('0x43')){if(_0x3ee1c8[_0x1314('0x3d')]){_0x37c9d0[_0x1314('0xb')]({'type':_0x3ee1c8['type']['toLowerCase'](),'app':'ExecIf','appdata':_0x1314('0x44'),'context':_0x5510b4[_0x1314('0x4')],'exten':_0x5510b4[_0x1314('0x5')],'priority':_0x3ee1c8[_0x1314('0x33')]['length']+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});_0x37c9d0[_0x1314('0xb')]({'type':_0x3ee1c8[_0x1314('0x3')][_0x1314('0x37')](),'app':_0x1314('0xc'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5510b4[_0x1314('0x4')],'exten':_0x5510b4[_0x1314('0x5')],'priority':_0x3ee1c8['intervals'][_0x1314('0x22')]+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});}else{_0x37c9d0[_0x1314('0xb')]({'type':_0x3ee1c8[_0x1314('0x3')][_0x1314('0x37')](),'app':'ExecIf','appdata':_0x1314('0x45'),'context':_0x5510b4['context'],'exten':_0x5510b4['exten'],'priority':_0x3ee1c8[_0x1314('0x33')][_0x1314('0x22')]+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});_0x37c9d0[_0x1314('0xb')]({'type':_0x3ee1c8[_0x1314('0x3')][_0x1314('0x37')](),'app':_0x1314('0xc'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5510b4['context'],'exten':_0x5510b4[_0x1314('0x5')],'priority':_0x3ee1c8[_0x1314('0x33')][_0x1314('0x22')]+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});}}}}for(var _0x4469ea=0x0;_0x4469ea<_0x3ee1c8[_0x1314('0x33')][_0x1314('0x22')];_0x4469ea++){var _0x4622ed=_0x5cd4d2+_0x3ee1c8['intervals']['length'];var _0x39b63e=_0x4469ea===_0x3ee1c8[_0x1314('0x33')][_0x1314('0x22')]-0x1?_0x5cd4d2+_0x37c9d0[_0x1314('0x22')]+_0x4433a2[_0x1314('0x22')]+0x2:_0x5cd4d2+_0x4469ea+0x1;_0x37c9d0[_0x1314('0x46')](_0x4469ea,0x0,{'type':_0x5510b4[_0x1314('0x3')],'app':_0x1314('0x47'),'appdata':_0x3ee1c8[_0x1314('0x33')][_0x4469ea]+'?'+_0x5510b4['context']+_0x1314('0x48')+_0x4622ed+':'+_0x5510b4['context']+_0x1314('0x48')+_0x39b63e,'exten':_0x5510b4['exten'],'context':_0x5510b4[_0x1314('0x4')],'priority':_0x5cd4d2+_0x4469ea,'VoiceExtensionId':_0x5510b4['id']});}if(_0x3ee1c8[_0x1314('0x42')]===_0x1314('0x49')){_0x3ee1c8[_0x1314('0x4a')]=_0x108647(_0x5510b4,_0x3ee1c8[_0x1314('0x4a')]);}if(_0x3ee1c8[_0x1314('0x42')]===_0x1314('0x4b')){_0x37c9d0['push']({'type':_0x3ee1c8[_0x1314('0x3')][_0x1314('0x37')](),'app':_0x1314('0xc'),'appdata':_0x1314('0x4c'),'context':_0x5510b4[_0x1314('0x4')],'exten':_0x5510b4[_0x1314('0x5')],'priority':_0x3ee1c8[_0x1314('0x33')]['length']+_0x5cd4d2+_0x255e66++,'VoiceExtensionId':_0x5510b4['id']});}_0x3ee1c8[_0x1314('0x4d')]=_0x37c9d0['length']?_[_0x1314('0x4e')](_0x37c9d0)[_0x1314('0x4d')]+0x1:_0x5cd4d2;_0x3e99e0=_[_0x1314('0x4f')](_0x3e99e0,_0x37c9d0,[_0x3ee1c8],_0x4433a2);_0x5cd4d2=_[_0x1314('0x4e')](_0x3e99e0)[_0x1314('0x4d')]+0x1;}return _0x110fa2(_0x3e99e0);})[_0x1314('0x50')](function(_0x44d6ef){_0x22f51a(_0x44d6ef);});});}return _0x5296bf[_0x1314('0x51')](_0x1314('0x52'),attributes,{'tableName':_0x1314('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5c564f){var _0x498ee5=this['get']({'plain':!![]});var _0x524c76=_0x498ee5[_0x1314('0x3')]===_0x1314('0x11')?_0x4595ff(_0x498ee5):_0x20087a(_0x498ee5);return _0xa9f444(_0x498ee5,_0x5c564f,_[_0x1314('0x4e')](_0x524c76)[_0x1314('0x4d')]+0x1)[_0x1314('0x30')](function(_0x389b5c){var _0x629825=_[_0x1314('0x4f')](_0x524c76,_0x389b5c);_0x629825[_0x1314('0xb')]({'type':_0x498ee5[_0x1314('0x3')],'app':_0x1314('0x54'),'exten':_0x498ee5[_0x1314('0x5')],'context':_0x498ee5[_0x1314('0x4')],'priority':_['last'](_0x629825)[_0x1314('0x4d')]+0x1,'VoiceExtensionId':_0x498ee5['id']});return _0x629825;});}}});}; \ No newline at end of file +var _0xfd40=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','then','length','*,*,*,*','intervals','interval','IntervalId','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat'];(function(_0x261d18,_0x13490f){var _0x3e7208=function(_0xd1a22b){while(--_0xd1a22b){_0x261d18['push'](_0x261d18['shift']());}};_0x3e7208(++_0x13490f);}(_0xfd40,0x182));var _0x0fd4=function(_0x12bb08,_0x3032f3){_0x12bb08=_0x12bb08-0x0;var _0x2e2ef8=_0xfd40[_0x12bb08];return _0x2e2ef8;};'use strict';var _=require('lodash');var attributes=require(_0x0fd4('0x0'));module[_0x0fd4('0x1')]=function(_0x2e0ef4){var _0x18c5e0=_0x2e0ef4[_0x0fd4('0x2')];function _0x325260(_0x5a7b70){var _0x291b5a=0x2;var _0x3400dd=[{'type':_0x5a7b70[_0x0fd4('0x3')],'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x5')+_0x5a7b70[_0x0fd4('0x3')],'context':_0x5a7b70[_0x0fd4('0x6')],'exten':_0x5a7b70['exten'],'priority':_0x291b5a++,'VoiceExtensionId':_0x5a7b70['id']},{'type':_0x5a7b70[_0x0fd4('0x3')],'app':_0x5a7b70['alias']?_0x0fd4('0x4'):_0x0fd4('0x7'),'appdata':_0x5a7b70[_0x0fd4('0x8')]?_0x0fd4('0x9')+_0x5a7b70[_0x0fd4('0x8')]:_0x0fd4('0xa'),'context':_0x5a7b70[_0x0fd4('0x6')],'exten':_0x5a7b70[_0x0fd4('0xb')],'priority':_0x291b5a++,'VoiceExtensionId':_0x5a7b70['id']}];if(_0x5a7b70[_0x0fd4('0x3')]===_0x0fd4('0xc')){_0x3400dd[_0x0fd4('0xd')]({'type':_0x0fd4('0xc'),'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0xe')+_0x5a7b70['id'],'context':_0x5a7b70['context'],'exten':_0x5a7b70[_0x0fd4('0xb')],'priority':_0x291b5a++,'VoiceExtensionId':_0x5a7b70['id']});}_0x3400dd[_0x0fd4('0xd')]({'type':_0x5a7b70['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5a7b70['context'],'exten':_0x5a7b70[_0x0fd4('0xb')],'priority':_0x291b5a++,'VoiceExtensionId':_0x5a7b70['id']},{'type':_0x5a7b70['type'],'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0xf'),'context':_0x5a7b70[_0x0fd4('0x6')],'exten':_0x5a7b70[_0x0fd4('0xb')],'priority':_0x291b5a++,'VoiceExtensionId':_0x5a7b70['id']},{'type':_0x5a7b70['type'],'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x10'),'context':_0x5a7b70[_0x0fd4('0x6')],'exten':_0x5a7b70[_0x0fd4('0xb')],'priority':_0x291b5a++,'VoiceExtensionId':_0x5a7b70['id']});return _0x3400dd;}function _0x49200c(_0x49dc73){var _0x3584b6=0x2;var _0x42089f=[{'type':_0x0fd4('0x11'),'app':'Set','appdata':_0x0fd4('0x12'),'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73['exten'],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':_0x49dc73[_0x0fd4('0x8')]?_0x0fd4('0x4'):_0x0fd4('0x7'),'appdata':_0x49dc73[_0x0fd4('0x8')]?_0x0fd4('0x9')+_0x49dc73[_0x0fd4('0x8')]:'No\x20alias\x20set','context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':'outbound','app':'Set','appdata':_0x0fd4('0x13')+(_0x49dc73[_0x0fd4('0x14')]?_0x0fd4('0x15')+_0x49dc73['cutdigits']+'}':_0x0fd4('0x16')),'context':_0x49dc73['context'],'exten':_0x49dc73['exten'],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':'Set','appdata':_0x0fd4('0xe')+_0x49dc73['id'],'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':_0x0fd4('0x17'),'appdata':_0x0fd4('0x18')+(_0x3584b6+0x2)+'):Goto('+(_0x3584b6+0x1)+')','context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':_0x0fd4('0x4'),'appdata':_0x49dc73[_0x0fd4('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x49dc73[_0x0fd4('0x14')]+'}':_0x0fd4('0x19'),'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':_0x0fd4('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73['exten'],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':'outbound','app':_0x0fd4('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x10'),'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x1a')+_0x49dc73['id'],'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']}];if(_0x49dc73[_0x0fd4('0x1b')](_0x0fd4('0x1c'))&&_0x49dc73['recordingFormat']!==_0x0fd4('0x1d')){_0x42089f['push']({'type':_0x0fd4('0x11'),'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x1e'),'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73[_0x0fd4('0xb')],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']},{'type':_0x0fd4('0x11'),'app':'Set','appdata':_0x0fd4('0x1f')+_0x49dc73[_0x0fd4('0x1c')]||_0x0fd4('0x20'),'context':_0x49dc73[_0x0fd4('0x6')],'exten':_0x49dc73['exten'],'priority':_0x3584b6++,'VoiceExtensionId':_0x49dc73['id']});}return _0x42089f;}function _0x43ac08(_0x40658c,_0x42699e){var _0x4fa404=[{'name':_0x0fd4('0x21'),'param':0x0},{'name':_0x0fd4('0x22'),'param':0x1},{'name':_0x0fd4('0x23'),'param':0x2},{'name':_0x0fd4('0x24'),'param':0x3}];var _0x1d873d={};var _0x234c22=_0x42699e[_0x0fd4('0x25')](',');var _0x295971=[];for(var _0x2ef7ac=0x0;_0x2ef7ac<_0x4fa404['length'];_0x2ef7ac++){switch(_0x4fa404[_0x2ef7ac][_0x0fd4('0x26')]){case _0x0fd4('0x21'):_0x1d873d[_0x0fd4('0x21')]=_0x234c22[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]][_0x0fd4('0x25')]('/')[0x1];_0x1d873d[_0x0fd4('0x28')]=_0x234c22[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]]['split']('/')[0x2];_0x1d873d[_0x0fd4('0x29')]=_0x1d873d[_0x0fd4('0x28')]?_0x1d873d[_0x0fd4('0x28')][_0x0fd4('0x25')]('$')[0x0]:undefined;_0x1d873d[_0x0fd4('0x28')]=_0x40658c[_0x0fd4('0x14')]?(_0x1d873d['prefix']||'')+'${EXTEN:'+_0x40658c['cutdigits']+'}':(_0x1d873d['prefix']||'')+_0x0fd4('0x16');_0x295971[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]]=[_0x0fd4('0x2a'),_0x1d873d[_0x0fd4('0x21')],_0x1d873d['phone']][_0x0fd4('0x2b')]('/');break;case'options':_0x1d873d[_0x0fd4('0x23')]=_0x234c22[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]];if(_0x40658c[_0x0fd4('0x1c')]!==_0x0fd4('0x1d')){if(_0x1d873d[_0x0fd4('0x23')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x1d873d[_0x0fd4('0x23')]+=_0x0fd4('0x2c');}}else{_0x1d873d[_0x0fd4('0x23')]=_0x1d873d[_0x0fd4('0x23')]['replace'](_0x0fd4('0x2c'),'');}_0x295971[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]]=_0x1d873d[_0x0fd4('0x23')];break;default:_0x295971[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]]=_0x234c22[_0x4fa404[_0x2ef7ac][_0x0fd4('0x27')]];}}return _0x295971[_0x0fd4('0x2b')](',');}function _0x5ca5e8(_0x162ee5,_0x482c57,_0x2dd51d){return new Promise(function(_0x25e8cb,_0x26e4aa){var _0x1a2769=[];if(_[_0x0fd4('0x2d')](_0x482c57))return _0x25e8cb(_0x1a2769);_0x18c5e0[_0x0fd4('0x2e')][_0x0fd4('0x2f')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x0fd4('0x30')](function(_0x19f336){for(var _0x101fd4=0x0,_0x38d2b1=0x0;_0x101fd4<_0x482c57[_0x0fd4('0x31')];_0x101fd4++,_0x38d2b1=0x0){var _0x37254d=_0x482c57[_0x101fd4];var _0x28b9c0=[];var _0x4f965b=[];delete _0x37254d['id'];if(_0x37254d['interval']!==_0x0fd4('0x32')){_0x37254d[_0x0fd4('0x33')]=[_0x37254d[_0x0fd4('0x34')]];}else{_0x37254d[_0x0fd4('0x33')]=_0x37254d[_0x0fd4('0x35')]?_['map'](_[_0x0fd4('0x36')](_0x19f336,{'IntervalId':_0x37254d[_0x0fd4('0x35')]}),_0x0fd4('0x34')):[];}_0x37254d[_0x0fd4('0x6')]=_0x162ee5[_0x0fd4('0x6')];_0x37254d['exten']=_0x162ee5[_0x0fd4('0xb')];if(_0x37254d[_0x0fd4('0x3')])_0x37254d[_0x0fd4('0x3')]=_0x37254d[_0x0fd4('0x3')][_0x0fd4('0x37')]();if(_0x162ee5['type']===_0x0fd4('0x11')){if(_0x37254d['hasOwnProperty'](_0x0fd4('0x38'))&&_0x37254d[_0x0fd4('0x38')]&&_0x37254d[_0x0fd4('0x38')]!=='--'){_0x28b9c0[_0x0fd4('0xd')]({'type':_0x37254d[_0x0fd4('0x3')][_0x0fd4('0x37')](),'app':_0x0fd4('0x4'),'appdata':'CDR(tag)='+_0x37254d['tag'],'context':_0x162ee5['context'],'exten':_0x162ee5['exten'],'priority':_0x37254d['intervals'][_0x0fd4('0x31')]+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});}_0x28b9c0[_0x0fd4('0xd')]({'type':_0x37254d['type']['toLowerCase'](),'app':_0x0fd4('0x17'),'appdata':_0x0fd4('0x39')+(_0x37254d['callerID']?_0x0fd4('0x3a')+_0x37254d[_0x0fd4('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x162ee5[_0x0fd4('0x6')],'exten':_0x162ee5[_0x0fd4('0xb')],'priority':_0x37254d[_0x0fd4('0x33')]['length']+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});}else{if(_0x37254d[_0x0fd4('0x1b')]('answer')){if([_0x0fd4('0x3c'),_0x0fd4('0x3d')][_0x0fd4('0x3e')](_0x37254d[_0x0fd4('0x3f')][_0x0fd4('0x37')]())&&_0x37254d[_0x0fd4('0x40')]!==_0x0fd4('0x41')){if(_0x37254d[_0x0fd4('0x42')]){_0x28b9c0[_0x0fd4('0xd')]({'type':_0x37254d[_0x0fd4('0x3')][_0x0fd4('0x37')](),'app':'ExecIf','appdata':_0x0fd4('0x43'),'context':_0x162ee5[_0x0fd4('0x6')],'exten':_0x162ee5[_0x0fd4('0xb')],'priority':_0x37254d[_0x0fd4('0x33')][_0x0fd4('0x31')]+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});_0x28b9c0[_0x0fd4('0xd')]({'type':_0x37254d[_0x0fd4('0x3')]['toLowerCase'](),'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x44'),'context':_0x162ee5[_0x0fd4('0x6')],'exten':_0x162ee5[_0x0fd4('0xb')],'priority':_0x37254d['intervals']['length']+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});}else{_0x28b9c0[_0x0fd4('0xd')]({'type':_0x37254d[_0x0fd4('0x3')][_0x0fd4('0x37')](),'app':_0x0fd4('0x17'),'appdata':_0x0fd4('0x45'),'context':_0x162ee5[_0x0fd4('0x6')],'exten':_0x162ee5[_0x0fd4('0xb')],'priority':_0x37254d[_0x0fd4('0x33')][_0x0fd4('0x31')]+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});_0x28b9c0['push']({'type':_0x37254d[_0x0fd4('0x3')][_0x0fd4('0x37')](),'app':_0x0fd4('0x4'),'appdata':_0x0fd4('0x46'),'context':_0x162ee5[_0x0fd4('0x6')],'exten':_0x162ee5[_0x0fd4('0xb')],'priority':_0x37254d[_0x0fd4('0x33')][_0x0fd4('0x31')]+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});}}}}for(var _0x57e126=0x0;_0x57e126<_0x37254d[_0x0fd4('0x33')]['length'];_0x57e126++){var _0x33358f=_0x2dd51d+_0x37254d[_0x0fd4('0x33')][_0x0fd4('0x31')];var _0x55185a=_0x57e126===_0x37254d[_0x0fd4('0x33')][_0x0fd4('0x31')]-0x1?_0x2dd51d+_0x28b9c0[_0x0fd4('0x31')]+_0x4f965b[_0x0fd4('0x31')]+0x2:_0x2dd51d+_0x57e126+0x1;_0x28b9c0[_0x0fd4('0x47')](_0x57e126,0x0,{'type':_0x162ee5[_0x0fd4('0x3')],'app':_0x0fd4('0x48'),'appdata':_0x37254d['intervals'][_0x57e126]+'?'+_0x162ee5[_0x0fd4('0x6')]+',${EXTEN},'+_0x33358f+':'+_0x162ee5['context']+_0x0fd4('0x49')+_0x55185a,'exten':_0x162ee5['exten'],'context':_0x162ee5[_0x0fd4('0x6')],'priority':_0x2dd51d+_0x57e126,'VoiceExtensionId':_0x162ee5['id']});}if(_0x37254d[_0x0fd4('0x40')]==='outboundDial'){_0x37254d[_0x0fd4('0x4a')]=_0x43ac08(_0x162ee5,_0x37254d['appdata']);}if(_0x37254d[_0x0fd4('0x40')]===_0x0fd4('0x4b')){_0x28b9c0[_0x0fd4('0xd')]({'type':_0x37254d[_0x0fd4('0x3')][_0x0fd4('0x37')](),'app':'Set','appdata':_0x0fd4('0x4c'),'context':_0x162ee5[_0x0fd4('0x6')],'exten':_0x162ee5[_0x0fd4('0xb')],'priority':_0x37254d['intervals'][_0x0fd4('0x31')]+_0x2dd51d+_0x38d2b1++,'VoiceExtensionId':_0x162ee5['id']});}_0x37254d[_0x0fd4('0x4d')]=_0x28b9c0[_0x0fd4('0x31')]?_[_0x0fd4('0x4e')](_0x28b9c0)[_0x0fd4('0x4d')]+0x1:_0x2dd51d;_0x1a2769=_[_0x0fd4('0x4f')](_0x1a2769,_0x28b9c0,[_0x37254d],_0x4f965b);_0x2dd51d=_['last'](_0x1a2769)['priority']+0x1;}return _0x25e8cb(_0x1a2769);})['catch'](function(_0x31be09){_0x26e4aa(_0x31be09);});});}return _0x2e0ef4['define'](_0x0fd4('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3e43da){var _0x44a988=this[_0x0fd4('0x51')]({'plain':!![]});var _0x552992=_0x44a988['type']===_0x0fd4('0x11')?_0x49200c(_0x44a988):_0x325260(_0x44a988);return _0x5ca5e8(_0x44a988,_0x3e43da,_[_0x0fd4('0x4e')](_0x552992)[_0x0fd4('0x4d')]+0x1)[_0x0fd4('0x30')](function(_0x3ef171){var _0x363fa1=_['concat'](_0x552992,_0x3ef171);_0x363fa1[_0x0fd4('0xd')]({'type':_0x44a988[_0x0fd4('0x3')],'app':_0x0fd4('0x52'),'exten':_0x44a988['exten'],'context':_0x44a988[_0x0fd4('0x6')],'priority':_[_0x0fd4('0x4e')](_0x363fa1)[_0x0fd4('0x4d')]+0x1,'VoiceExtensionId':_0x44a988['id']});return _0x363fa1;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 2c3093d..6b18627 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 _0xbd0a=['request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x1debb7,_0x4fce1d){var _0xf2bd90=function(_0x2a01ac){while(--_0x2a01ac){_0x1debb7['push'](_0x1debb7['shift']());}};_0xf2bd90(++_0x4fce1d);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x137035,_0x32ae77){_0x137035=_0x137035-0x0;var _0x117561=_0xbd0a[_0x137035];return _0x117561;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var moment=require(_0xabd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd0('0x2'))['db'];var utils=require(_0xabd0('0x3'));var logger=require(_0xabd0('0x4'))(_0xabd0('0x5'));var config=require(_0xabd0('0x6'));var jayson=require(_0xabd0('0x7'));var client=jayson[_0xabd0('0x8')][_0xabd0('0x9')]({'port':0x232a});config[_0xabd0('0xa')]=_['defaults'](config[_0xabd0('0xa')],{'host':_0xabd0('0xb'),'port':0x18eb});var socket=require(_0xabd0('0xc'))(new Redis(config['redis']));require(_0xabd0('0xd'))['register'](socket);function respondWithRpcPromise(_0x151048,_0x23d4e4,_0x2c31c9){return new BPromise(function(_0x3dc0ab,_0x50fc2d){return client[_0xabd0('0xe')](_0x151048,_0x2c31c9)['then'](function(_0x1b78e2){logger[_0xabd0('0xf')](_0xabd0('0x10'),_0x23d4e4,_0xabd0('0x11'));logger[_0xabd0('0x12')](_0xabd0('0x13'),_0x23d4e4,'request\x20sent',JSON[_0xabd0('0x14')](_0x1b78e2));if(_0x1b78e2['error']){if(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x23d4e4,_0x1b78e2['error']['message']);return _0x50fc2d(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);}logger[_0xabd0('0x15')](_0xabd0('0x10'),_0x23d4e4,_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);return _0x3dc0ab(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);}else{logger[_0xabd0('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x23d4e4,_0xabd0('0x11'));_0x3dc0ab(_0x1b78e2['result']['message']);}})[_0xabd0('0x18')](function(_0x391988){logger[_0xabd0('0x15')](_0xabd0('0x10'),_0x23d4e4,_0x391988);_0x50fc2d(_0x391988);});});}exports['GetVoiceExtension']=function(_0x862492){var _0x1f2ecb=this;return new Promise(function(_0x4eed20,_0x56c2f5){return db[_0xabd0('0x19')][_0xabd0('0x1a')]({'raw':_0x862492['options']?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1c')]===undefined?!![]:![]:!![],'where':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')]['where']||null:null,'attributes':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1d')]||null:null,'limit':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1e')]||null:null,'include':_0x862492[_0xabd0('0x1b')]?_0x862492[_0xabd0('0x1b')][_0xabd0('0x1f')]?_[_0xabd0('0x20')](_0x862492['options'][_0xabd0('0x1f')],function(_0x2699c4){return{'model':db[_0x2699c4[_0xabd0('0x21')]],'as':_0x2699c4['as'],'attributes':_0x2699c4[_0xabd0('0x1d')],'include':_0x2699c4[_0xabd0('0x1f')]?_[_0xabd0('0x20')](_0x2699c4[_0xabd0('0x1f')],function(_0x3a10d6){return{'model':db[_0x3a10d6[_0xabd0('0x21')]],'as':_0x3a10d6['as'],'attributes':_0x3a10d6[_0xabd0('0x1d')],'include':_0x3a10d6[_0xabd0('0x1f')]?_[_0xabd0('0x20')](_0x3a10d6[_0xabd0('0x1f')],function(_0x3246de){return{'model':db[_0x3246de[_0xabd0('0x21')]],'as':_0x3246de['as'],'attributes':_0x3246de[_0xabd0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c0d90){logger[_0xabd0('0xf')](_0xabd0('0x22'),_0x862492);logger[_0xabd0('0x12')]('GetVoiceExtension',_0x862492,JSON[_0xabd0('0x14')](_0x1c0d90));_0x4eed20(_0x1c0d90);})[_0xabd0('0x18')](function(_0x20ff0a){logger['error'](_0xabd0('0x22'),_0x20ff0a[_0xabd0('0x17')],_0x862492);_0x56c2f5(_0x1f2ecb['error'](0x1f4,_0x20ff0a[_0xabd0('0x17')]));});});}; \ No newline at end of file +var _0xbdb9=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','attributes','model','then','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x4d31de,_0x4e403f){var _0x515423=function(_0x57c4dc){while(--_0x57c4dc){_0x4d31de['push'](_0x4d31de['shift']());}};_0x515423(++_0x4e403f);}(_0xbdb9,0xac));var _0x9bdb=function(_0x213aa7,_0x26e5b8){_0x213aa7=_0x213aa7-0x0;var _0x2b60b7=_0xbdb9[_0x213aa7];return _0x2b60b7;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var moment=require(_0x9bdb('0x2'));var BPromise=require(_0x9bdb('0x3'));var rs=require(_0x9bdb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9bdb('0x6'));var client=jayson['client'][_0x9bdb('0x7')]({'port':0x232a});config['redis']=_[_0x9bdb('0x8')](config[_0x9bdb('0x9')],{'host':_0x9bdb('0xa'),'port':0x18eb});var socket=require(_0x9bdb('0xb'))(new Redis(config[_0x9bdb('0x9')]));require(_0x9bdb('0xc'))[_0x9bdb('0xd')](socket);function respondWithRpcPromise(_0x58812d,_0x118bb1,_0x355bad){return new BPromise(function(_0x274dee,_0x35a5b9){return client[_0x9bdb('0xe')](_0x58812d,_0x355bad)['then'](function(_0x5af5d6){logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));logger[_0x9bdb('0x12')](_0x9bdb('0x13'),_0x118bb1,_0x9bdb('0x11'),JSON['stringify'](_0x5af5d6));if(_0x5af5d6[_0x9bdb('0x14')]){if(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x15')]===0x1f4){logger[_0x9bdb('0x14')](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6['error'][_0x9bdb('0x16')]);return _0x35a5b9(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}logger['error'](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);return _0x274dee(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}else{logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));_0x274dee(_0x5af5d6[_0x9bdb('0x17')][_0x9bdb('0x16')]);}})['catch'](function(_0x37837d){logger[_0x9bdb('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x118bb1,_0x37837d);_0x35a5b9(_0x37837d);});});}exports[_0x9bdb('0x18')]=function(_0x16a953){var _0x2fb1f3=this;return new Promise(function(_0x582a46,_0xdaab91){return db[_0x9bdb('0x19')][_0x9bdb('0x1a')]({'raw':_0x16a953['options']?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1c')]===undefined?!![]:![]:!![],'where':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1d')]||null:null,'attributes':_0x16a953[_0x9bdb('0x1b')]?_0x16a953['options']['attributes']||null:null,'limit':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1e')]||null:null,'include':_0x16a953['options']?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1f')]?_[_0x9bdb('0x20')](_0x16a953[_0x9bdb('0x1b')]['include'],function(_0x37a02a){return{'model':db[_0x37a02a['model']],'as':_0x37a02a['as'],'attributes':_0x37a02a[_0x9bdb('0x21')],'include':_0x37a02a[_0x9bdb('0x1f')]?_[_0x9bdb('0x20')](_0x37a02a['include'],function(_0x158604){return{'model':db[_0x158604[_0x9bdb('0x22')]],'as':_0x158604['as'],'attributes':_0x158604[_0x9bdb('0x21')],'include':_0x158604[_0x9bdb('0x1f')]?_[_0x9bdb('0x20')](_0x158604[_0x9bdb('0x1f')],function(_0x426390){return{'model':db[_0x426390[_0x9bdb('0x22')]],'as':_0x426390['as'],'attributes':_0x426390[_0x9bdb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9bdb('0x23')](function(_0x54ed65){logger[_0x9bdb('0xf')](_0x9bdb('0x18'),_0x16a953);logger[_0x9bdb('0x12')](_0x9bdb('0x18'),_0x16a953,JSON[_0x9bdb('0x24')](_0x54ed65));_0x582a46(_0x54ed65);})[_0x9bdb('0x25')](function(_0x106160){logger['error'](_0x9bdb('0x18'),_0x106160['message'],_0x16a953);_0xdaab91(_0x2fb1f3[_0x9bdb('0x14')](0x1f4,_0x106160[_0x9bdb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a4bb83f..2e5a76c 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x128d77,_0x32b2a4){var _0x37feb2=function(_0x5f5c6f){while(--_0x5f5c6f){_0x128d77['push'](_0x128d77['shift']());}};_0x37feb2(++_0x32b2a4);}(_0x4975,0x86));var _0x5497=function(_0x2f6baf,_0x164593){_0x2f6baf=_0x2f6baf-0x0;var _0xf4a8d9=_0x4975[_0x2f6baf];return _0xf4a8d9;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0xcb5d5d,_0x5eadc1){var _0x165b44=function(_0x5654bd){while(--_0x5654bd){_0xcb5d5d['push'](_0xcb5d5d['shift']());}};_0x165b44(++_0x5eadc1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 6dd1a50..47f422d 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 _0x3e24=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','create','destroy','exports','multer'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x3e24,0x167));var _0x43e2=function(_0x240df3,_0x515368){_0x240df3=_0x240df3-0x0;var _0x4a2815=_0x3e24[_0x240df3];return _0x4a2815;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var fs_extra=require(_0x43e2('0x5'));var auth=require(_0x43e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43e2('0x7'));var controller=require(_0x43e2('0x8'));router[_0x43e2('0x9')]('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xb')]);router[_0x43e2('0x9')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0x9')]('/:id/messages',auth[_0x43e2('0xa')](),controller[_0x43e2('0xe')]);router['post']('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xf')]);router['put'](_0x43e2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x43e2('0xc'),auth[_0x43e2('0xa')](),controller[_0x43e2('0x10')]);module[_0x43e2('0x11')]=router; \ No newline at end of file +var _0x2272=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x31f7c5,_0x3bf428){var _0x19fabc=function(_0x268080){while(--_0x268080){_0x31f7c5['push'](_0x31f7c5['shift']());}};_0x19fabc(++_0x3bf428);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var path=require(_0x2227('0x2'));var timeout=require(_0x2227('0x3'));var express=require(_0x2227('0x4'));var router=express['Router']();var fs_extra=require(_0x2227('0x5'));var auth=require(_0x2227('0x6'));var interaction=require(_0x2227('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x2227('0x8')]('/',auth[_0x2227('0x9')](),controller[_0x2227('0xa')]);router[_0x2227('0x8')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0xc')]);router[_0x2227('0x8')](_0x2227('0xd'),auth[_0x2227('0x9')](),controller['getMessages']);router[_0x2227('0xe')]('/',auth['isAuthenticated'](),controller[_0x2227('0xf')]);router[_0x2227('0x10')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x11')]);router['delete'](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x12')]);module[_0x2227('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 763b627..75d7ed0 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 _0x3505=['INTEGER','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x54d635,_0x5a7888){var _0x59cf7a=function(_0x5b166d){while(--_0x5b166d){_0x54d635['push'](_0x54d635['shift']());}};_0x59cf7a(++_0x5a7888);}(_0x3505,0x112));var _0x5350=function(_0x56dbdb,_0x39509c){_0x56dbdb=_0x56dbdb-0x0;var _0x41f3b2=_0x3505[_0x56dbdb];return _0x41f3b2;};'use strict';var Sequelize=require(_0x5350('0x0'));module[_0x5350('0x1')]={'customer_id':{'type':Sequelize[_0x5350('0x2')]},'context':{'type':Sequelize[_0x5350('0x2')],'defaultValue':_0x5350('0x3'),'unique':_0x5350('0x4')},'mailbox':{'type':Sequelize[_0x5350('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x5350('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5350('0x2')],'validate':{'isEmail':!![]},'set':function(_0x27619c){this[_0x5350('0x5')](_0x5350('0x6'),typeof _0x27619c===_0x5350('0x7')&&_0x27619c[_0x5350('0x8')]()?_0x27619c[_0x5350('0x8')]():null);}},'pager':{'type':Sequelize[_0x5350('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x5350('0x9')},'attach':{'type':Sequelize[_0x5350('0xa')]('yes','no'),'defaultValue':_0x5350('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5350('0xa')](_0x5350('0xb'),'no'),'defaultValue':_0x5350('0xb'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x5350('0x2')]},'review':{'type':Sequelize[_0x5350('0xa')](_0x5350('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5350('0xa')](_0x5350('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5350('0xa')](_0x5350('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5350('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x5350('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5350('0xa')]('yes','no'),'defaultValue':_0x5350('0xb'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x5350('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5350('0xa')](_0x5350('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5350('0xb'),'allowNull':![]},'stamp':{'type':_0x5350('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x5350('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5350('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5350('0xf')](_0x5350('0x10'))+_0x5350('0x11')+this[_0x5350('0xf')]('mailbox');}}}; \ No newline at end of file +var _0xd1be=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','exports','from-voicemail','contest_mailbox','STRING','email','string'];(function(_0x380756,_0xbc18a0){var _0x2e002d=function(_0x135b40){while(--_0x135b40){_0x380756['push'](_0x380756['shift']());}};_0x2e002d(++_0xbc18a0);}(_0xd1be,0x77));var _0xed1b=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0xd1be[_0x21ecc8];return _0x510c1d;};'use strict';var Sequelize=require(_0xed1b('0x0'));module[_0xed1b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xed1b('0x2'),'unique':_0xed1b('0x3')},'mailbox':{'type':Sequelize[_0xed1b('0x4')],'defaultValue':'','allowNull':![],'unique':_0xed1b('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xed1b('0x4')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x28a799){this['setDataValue'](_0xed1b('0x5'),typeof _0x28a799===_0xed1b('0x6')&&_0x28a799[_0xed1b('0x7')]()?_0x28a799[_0xed1b('0x7')]():null);}},'pager':{'type':Sequelize[_0xed1b('0x4')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xed1b('0x8')},'attach':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xed1b('0xa'),'no'),'defaultValue':_0xed1b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xed1b('0x4')]},'review':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xed1b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':_0xed1b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xed1b('0x9')](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xed1b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xed1b('0xc')},'emailsubject':{'type':Sequelize[_0xed1b('0x4')]},'emailbody':{'type':Sequelize[_0xed1b('0x4')]},'maxsecs':{'type':Sequelize[_0xed1b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xed1b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xed1b('0xe')],'get':function(){return this[_0xed1b('0xf')]('fullname')+_0xed1b('0x10')+this['getDataValue'](_0xed1b('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 48f38e8..ee7d65b 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 _0x9c00=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','Voicemails','UserProfileResource','then','stack'];(function(_0x20ae63,_0x348927){var _0x2f0657=function(_0x4c4ff7){while(--_0x4c4ff7){_0x20ae63['push'](_0x20ae63['shift']());}};_0x2f0657(++_0x348927);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5dbc86,_0xcdbb86){_0x5dbc86=_0x5dbc86-0x0;var _0x1f80e3=_0x9c00[_0x5dbc86];return _0x1f80e3;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){var _0x42ebfc=_0x1e8a1c[_0x09c0('0x27')]({'plain':!![]});var _0x56d883=_0x09c0('0x28');return db[_0x09c0('0x29')][_0x09c0('0x26')]({'where':{'type':_0x56d883,'resourceId':_0x42ebfc['id']}})[_0x09c0('0x2a')](function(){return _0x1e8a1c;});})[_0x09c0('0x2a')](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x35b61c,_0x1ea951){return function(_0x1aa80e){if(!_0x1aa80e){_0x35b61c[_0x09c0('0x1b')](0x194);}return _0x1aa80e;};}function handleError(_0x5e53ac,_0x15a667){_0x15a667=_0x15a667||0x1f4;return function(_0x1bdde9){logger['error'](_0x1bdde9[_0x09c0('0x2b')]);if(_0x1bdde9['name']){delete _0x1bdde9[_0x09c0('0x2c')];}_0x5e53ac['status'](_0x15a667)[_0x09c0('0x2d')](_0x1bdde9);};}exports[_0x09c0('0x2e')]=function(_0x108409,_0x4159bc){var _0x4e999a={},_0x5478b7={},_0x17c374={'count':0x0,'rows':[]};var _0x38a315=_[_0x09c0('0x2f')](db['VoiceMail'][_0x09c0('0x30')],function(_0x4bdae9){return{'name':_0x4bdae9[_0x09c0('0x31')],'type':_0x4bdae9[_0x09c0('0x32')][_0x09c0('0x33')]};});_0x5478b7['model']=_[_0x09c0('0x2f')](_0x38a315,_0x09c0('0x2c'));_0x5478b7[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x108409[_0x09c0('0x34')]);_0x5478b7[_0x09c0('0x36')]=_[_0x09c0('0x37')](_0x5478b7['model'],_0x5478b7[_0x09c0('0x34')]);_0x4e999a[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x5478b7[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x108409['query'][_0x09c0('0x3a')]));_0x4e999a[_0x09c0('0x38')]=_0x4e999a[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x4e999a[_0x09c0('0x38')]:_0x5478b7['model'];if(!_0x108409[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x4e999a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x108409[_0x09c0('0x34')][_0x09c0('0x20')]);_0x4e999a['offset']=qs[_0x09c0('0x3e')](_0x108409[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x4e999a[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x108409['query']['sort']);_0x4e999a['where']=qs['filters'](_[_0x09c0('0x41')](_0x108409[_0x09c0('0x34')],_0x5478b7[_0x09c0('0x36')]),_0x38a315);if(_0x108409[_0x09c0('0x34')][_0x09c0('0x42')]){_0x4e999a['where']=_[_0x09c0('0x43')](_0x4e999a[_0x09c0('0x44')],{'$or':_['map'](_0x38a315,function(_0x1067cf){if(_0x1067cf['type']!==_0x09c0('0x45')){var _0x5c80a2={};_0x5c80a2[_0x1067cf[_0x09c0('0x2c')]]={'$like':'%'+_0x108409[_0x09c0('0x34')]['filter']+'%'};return _0x5c80a2;}})});}_0x4e999a=_[_0x09c0('0x43')]({},_0x4e999a,_0x108409[_0x09c0('0x46')]);var _0x5d69fd={'where':_0x4e999a[_0x09c0('0x44')]};return db[_0x09c0('0x47')][_0x09c0('0x21')](_0x5d69fd)[_0x09c0('0x2a')](function(_0xeb8191){_0x17c374[_0x09c0('0x21')]=_0xeb8191;if(_0x108409['query'][_0x09c0('0x48')]){_0x4e999a[_0x09c0('0x49')]=[{'all':!![]}];}return db[_0x09c0('0x47')]['findAll'](_0x4e999a);})[_0x09c0('0x2a')](function(_0x30c0c5){_0x17c374[_0x09c0('0x4a')]=_0x30c0c5;return _0x17c374;})['then'](respondWithFilteredResult(_0x4159bc,_0x4e999a))[_0x09c0('0x4b')](handleError(_0x4159bc,null));};exports[_0x09c0('0x4c')]=function(_0x52cd5c,_0x5bbf4e){var _0x397e73={'raw':!![],'where':{'id':_0x52cd5c['params']['id']}},_0x471078={};_0x471078[_0x09c0('0x39')]=_[_0x09c0('0x35')](db['VoiceMail'][_0x09c0('0x30')]);_0x471078[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x52cd5c[_0x09c0('0x34')]);_0x471078[_0x09c0('0x36')]=_['intersection'](_0x471078[_0x09c0('0x39')],_0x471078['query']);_0x397e73['attributes']=_[_0x09c0('0x37')](_0x471078[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x3a')]));_0x397e73[_0x09c0('0x38')]=_0x397e73['attributes']['length']?_0x397e73['attributes']:_0x471078[_0x09c0('0x39')];if(_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x48')]){_0x397e73['include']=[{'all':!![]}];}_0x397e73=_[_0x09c0('0x43')]({},_0x397e73,_0x52cd5c[_0x09c0('0x46')]);return db[_0x09c0('0x47')][_0x09c0('0x4d')](_0x397e73)[_0x09c0('0x2a')](handleEntityNotFound(_0x5bbf4e,null))[_0x09c0('0x2a')](respondWithResult(_0x5bbf4e,null))[_0x09c0('0x4b')](handleError(_0x5bbf4e,null));};exports[_0x09c0('0x4e')]=function(_0x3f6d14,_0x38085c){return db[_0x09c0('0x47')][_0x09c0('0x4e')](_0x3f6d14[_0x09c0('0x4f')],{})[_0x09c0('0x2a')](function(_0x332b69){var _0x32abbe=_0x3f6d14[_0x09c0('0x50')][_0x09c0('0x27')]({'plain':!![]});if(!_0x32abbe)throw new Error(_0x09c0('0x51'));if(_0x32abbe[_0x09c0('0x52')]==='user'){var _0x4acf54=_0x332b69[_0x09c0('0x27')]({'plain':!![]});var _0x15b0a2=_0x09c0('0x28');return db[_0x09c0('0x53')]['find']({'where':{'name':_0x15b0a2,'userProfileId':_0x32abbe[_0x09c0('0x54')]},'raw':!![]})[_0x09c0('0x2a')](function(_0x1823c2){if(_0x1823c2&&_0x1823c2['autoAssociation']===0x0){return db[_0x09c0('0x29')][_0x09c0('0x4e')]({'name':_0x4acf54[_0x09c0('0x2c')],'resourceId':_0x4acf54['id'],'type':_0x1823c2[_0x09c0('0x2c')],'sectionId':_0x1823c2['id']},{})[_0x09c0('0x2a')](function(){return _0x332b69;});}else{return _0x332b69;}})[_0x09c0('0x4b')](function(_0x45ecd0){logger['error'](_0x09c0('0x55'),_0x45ecd0);throw _0x45ecd0;});}return _0x332b69;})[_0x09c0('0x2a')](respondWithResult(_0x38085c,0xc9))[_0x09c0('0x4b')](handleError(_0x38085c,null));};exports[_0x09c0('0x25')]=function(_0x21fe00,_0x316fbd){if(_0x21fe00[_0x09c0('0x4f')]['id']){delete _0x21fe00['body']['id'];}return db['VoiceMail'][_0x09c0('0x4d')]({'where':{'id':_0x21fe00[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x316fbd,null))['then'](saveUpdates(_0x21fe00[_0x09c0('0x4f')],null))['then'](respondWithResult(_0x316fbd,null))[_0x09c0('0x4b')](handleError(_0x316fbd,null));};exports[_0x09c0('0x26')]=function(_0x42d4dd,_0x290618){return db[_0x09c0('0x47')][_0x09c0('0x4d')]({'where':{'id':_0x42d4dd[_0x09c0('0x56')]['id']}})['then'](handleEntityNotFound(_0x290618,null))[_0x09c0('0x2a')](removeEntity(_0x290618,null))[_0x09c0('0x4b')](handleError(_0x290618,null));};exports[_0x09c0('0x57')]=function(_0x270ff2,_0x3a6845,_0x219195){return db[_0x09c0('0x47')][_0x09c0('0x58')]({'where':{'id':_0x270ff2[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x3a6845,null))[_0x09c0('0x2a')](function(_0x4c4339){var _0x34cc0a;var _0x3564e6={},_0x26dc22={};_0x26dc22[_0x09c0('0x39')]=_['keys'](db[_0x09c0('0x59')]['rawAttributes']);_0x26dc22[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x270ff2[_0x09c0('0x34')]);_0x26dc22['filters']=_['intersection'](_0x26dc22[_0x09c0('0x39')],_0x26dc22[_0x09c0('0x34')]);_0x3564e6[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x26dc22['model'],qs[_0x09c0('0x3a')](_0x270ff2[_0x09c0('0x34')]['fields']));_0x3564e6[_0x09c0('0x38')]=_0x3564e6[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x3564e6[_0x09c0('0x38')]:_0x26dc22['model'];if(!_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x3564e6[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x20')]);_0x3564e6[_0x09c0('0x3e')]=qs[_0x09c0('0x3e')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x3564e6[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x270ff2['query'][_0x09c0('0x40')]);_0x3564e6[_0x09c0('0x44')]=qs[_0x09c0('0x36')](_[_0x09c0('0x41')](_0x270ff2[_0x09c0('0x34')],_0x26dc22['filters']));if(_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]){_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'$or':_[_0x09c0('0x2f')](_0x3564e6[_0x09c0('0x38')],function(_0x569462){var _0x325013={};_0x325013[_0x569462]={'$like':'%'+_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]+'%'};return _0x325013;})});}_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'mailboxuser':_0x4c4339[_0x09c0('0x5a')]});_0x3564e6=_[_0x09c0('0x43')]({},_0x3564e6,_0x270ff2[_0x09c0('0x46')]);return db[_0x09c0('0x59')][_0x09c0('0x5b')](_0x3564e6)['then'](respondWithFilteredResult(_0x3a6845,_0x3564e6));})[_0x09c0('0x4b')](handleError(_0x3a6845,null));}; \ No newline at end of file +var _0x84a0=['UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','get','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0x84a0,0x66));var _0x084a=function(_0x834994,_0x19bb3d){_0x834994=_0x834994-0x0;var _0x3af23d=_0x84a0[_0x834994];return _0x3af23d;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];function respondWithStatusCode(_0x3ca72f,_0xec90a5){_0xec90a5=_0xec90a5||0xcc;return function(_0x9245b1){if(_0x9245b1){return _0x3ca72f[_0x084a('0x18')](_0xec90a5);}return _0x3ca72f[_0x084a('0x19')](_0xec90a5)[_0x084a('0x1a')]();};}function respondWithResult(_0x3a76d1,_0x5aef40){_0x5aef40=_0x5aef40||0xc8;return function(_0x4277c9){if(_0x4277c9){return _0x3a76d1['status'](_0x5aef40)[_0x084a('0x1b')](_0x4277c9);}};}function respondWithFilteredResult(_0x3ccaca,_0x366624){return function(_0x2d35b8){if(_0x2d35b8){var _0xd20527=typeof _0x366624['offset']===_0x084a('0x1c')&&typeof _0x366624['limit']===_0x084a('0x1c');var _0x355b45=_0x2d35b8['count'];var _0xf2c333=_0xd20527?0x0:_0x366624[_0x084a('0x1d')];var _0x4134b9=_0xd20527?_0x2d35b8[_0x084a('0x1e')]:_0x366624[_0x084a('0x1d')]+_0x366624[_0x084a('0x1f')];var _0x447a19;if(_0x4134b9>=_0x355b45){_0x4134b9=_0x355b45;_0x447a19=0xc8;}else{_0x447a19=0xce;}_0x3ccaca[_0x084a('0x19')](_0x447a19);return _0x3ccaca[_0x084a('0x20')](_0x084a('0x21'),_0xf2c333+'-'+_0x4134b9+'/'+_0x355b45)[_0x084a('0x1b')](_0x2d35b8);}return null;};}function patchUpdates(_0x279e25){return function(_0x116328){try{jsonpatch[_0x084a('0x22')](_0x116328,_0x279e25,!![]);}catch(_0xf0dd98){return BPromise['reject'](_0xf0dd98);}return _0x116328[_0x084a('0x23')]();};}function saveUpdates(_0x1ad257,_0x41a90f){return function(_0x2d62bf){if(_0x2d62bf){return _0x2d62bf[_0x084a('0x24')](_0x1ad257)['then'](function(_0x755c24){return _0x755c24;});}return null;};}function removeEntity(_0x288e9e,_0x6346a5){return function(_0x1f2c9f){if(_0x1f2c9f){return _0x1f2c9f[_0x084a('0x25')]()[_0x084a('0x26')](function(){var _0x5be167=_0x1f2c9f[_0x084a('0x27')]({'plain':!![]});var _0x2af138=_0x084a('0x28');return db['UserProfileResource'][_0x084a('0x25')]({'where':{'type':_0x2af138,'resourceId':_0x5be167['id']}})[_0x084a('0x26')](function(){return _0x1f2c9f;});})[_0x084a('0x26')](function(){_0x288e9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4874fe,_0x52227a){return function(_0x33b88f){if(!_0x33b88f){_0x4874fe['sendStatus'](0x194);}return _0x33b88f;};}function handleError(_0x5bea78,_0x51c9f4){_0x51c9f4=_0x51c9f4||0x1f4;return function(_0x3b8176){logger[_0x084a('0x29')](_0x3b8176[_0x084a('0x2a')]);if(_0x3b8176[_0x084a('0x2b')]){delete _0x3b8176[_0x084a('0x2b')];}_0x5bea78[_0x084a('0x19')](_0x51c9f4)[_0x084a('0x2c')](_0x3b8176);};}exports[_0x084a('0x2d')]=function(_0x5e6ea8,_0x2ed3cd){var _0x3b2b38={},_0x501a16={},_0xe1980b={'count':0x0,'rows':[]};var _0x24bcf5=_[_0x084a('0x2e')](db[_0x084a('0x2f')][_0x084a('0x30')],function(_0x202602){return{'name':_0x202602[_0x084a('0x31')],'type':_0x202602[_0x084a('0x32')][_0x084a('0x33')]};});_0x501a16[_0x084a('0x34')]=_[_0x084a('0x2e')](_0x24bcf5,_0x084a('0x2b'));_0x501a16[_0x084a('0x35')]=_['keys'](_0x5e6ea8['query']);_0x501a16[_0x084a('0x36')]=_[_0x084a('0x37')](_0x501a16[_0x084a('0x34')],_0x501a16[_0x084a('0x35')]);_0x3b2b38[_0x084a('0x38')]=_['intersection'](_0x501a16[_0x084a('0x34')],qs[_0x084a('0x39')](_0x5e6ea8[_0x084a('0x35')]['fields']));_0x3b2b38[_0x084a('0x38')]=_0x3b2b38[_0x084a('0x38')][_0x084a('0x3a')]?_0x3b2b38['attributes']:_0x501a16['model'];if(!_0x5e6ea8['query'][_0x084a('0x3b')](_0x084a('0x3c'))){_0x3b2b38[_0x084a('0x1f')]=qs['limit'](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x1f')]);_0x3b2b38[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x1d')]);}_0x3b2b38[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x3e')]);_0x3b2b38[_0x084a('0x3f')]=qs[_0x084a('0x36')](_[_0x084a('0x40')](_0x5e6ea8[_0x084a('0x35')],_0x501a16[_0x084a('0x36')]),_0x24bcf5);if(_0x5e6ea8['query'][_0x084a('0x41')]){_0x3b2b38[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x3b2b38[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x24bcf5,function(_0x22862b){if(_0x22862b[_0x084a('0x32')]!==_0x084a('0x43')){var _0x13dc4c={};_0x13dc4c[_0x22862b['name']]={'$like':'%'+_0x5e6ea8[_0x084a('0x35')][_0x084a('0x41')]+'%'};return _0x13dc4c;}})});}_0x3b2b38=_[_0x084a('0x42')]({},_0x3b2b38,_0x5e6ea8[_0x084a('0x44')]);var _0x256008={'where':_0x3b2b38[_0x084a('0x3f')]};return db['VoiceMail'][_0x084a('0x1e')](_0x256008)[_0x084a('0x26')](function(_0x55c5f4){_0xe1980b[_0x084a('0x1e')]=_0x55c5f4;if(_0x5e6ea8[_0x084a('0x35')][_0x084a('0x45')]){_0x3b2b38['include']=[{'all':!![]}];}return db[_0x084a('0x2f')][_0x084a('0x46')](_0x3b2b38);})['then'](function(_0x3e2b92){_0xe1980b[_0x084a('0x47')]=_0x3e2b92;return _0xe1980b;})['then'](respondWithFilteredResult(_0x2ed3cd,_0x3b2b38))['catch'](handleError(_0x2ed3cd,null));};exports[_0x084a('0x48')]=function(_0x17a8d4,_0x3726bd){var _0xec2713={'raw':!![],'where':{'id':_0x17a8d4[_0x084a('0x49')]['id']}},_0x1e2a2d={};_0x1e2a2d[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x2f')][_0x084a('0x30')]);_0x1e2a2d[_0x084a('0x35')]=_['keys'](_0x17a8d4['query']);_0x1e2a2d[_0x084a('0x36')]=_[_0x084a('0x37')](_0x1e2a2d[_0x084a('0x34')],_0x1e2a2d['query']);_0xec2713[_0x084a('0x38')]=_[_0x084a('0x37')](_0x1e2a2d[_0x084a('0x34')],qs[_0x084a('0x39')](_0x17a8d4[_0x084a('0x35')]['fields']));_0xec2713[_0x084a('0x38')]=_0xec2713['attributes'][_0x084a('0x3a')]?_0xec2713[_0x084a('0x38')]:_0x1e2a2d[_0x084a('0x34')];if(_0x17a8d4['query']['includeAll']){_0xec2713[_0x084a('0x4b')]=[{'all':!![]}];}_0xec2713=_[_0x084a('0x42')]({},_0xec2713,_0x17a8d4['options']);return db[_0x084a('0x2f')][_0x084a('0x4c')](_0xec2713)[_0x084a('0x26')](handleEntityNotFound(_0x3726bd,null))[_0x084a('0x26')](respondWithResult(_0x3726bd,null))['catch'](handleError(_0x3726bd,null));};exports[_0x084a('0x4d')]=function(_0x865368,_0x31677b){return db[_0x084a('0x2f')]['create'](_0x865368[_0x084a('0x4e')],{})[_0x084a('0x26')](function(_0x411fa9){var _0x2d3d01=_0x865368['user']['get']({'plain':!![]});if(!_0x2d3d01)throw new Error(_0x084a('0x4f'));if(_0x2d3d01[_0x084a('0x50')]===_0x084a('0x51')){var _0x264f09=_0x411fa9[_0x084a('0x27')]({'plain':!![]});var _0x3b2df4=_0x084a('0x28');return db[_0x084a('0x52')][_0x084a('0x4c')]({'where':{'name':_0x3b2df4,'userProfileId':_0x2d3d01[_0x084a('0x53')]},'raw':!![]})[_0x084a('0x26')](function(_0x98769c){if(_0x98769c&&_0x98769c['autoAssociation']===0x0){return db[_0x084a('0x54')][_0x084a('0x4d')]({'name':_0x264f09[_0x084a('0x2b')],'resourceId':_0x264f09['id'],'type':_0x98769c[_0x084a('0x2b')],'sectionId':_0x98769c['id']},{})[_0x084a('0x26')](function(){return _0x411fa9;});}else{return _0x411fa9;}})[_0x084a('0x55')](function(_0xa5362){logger['error'](_0x084a('0x56'),_0xa5362);throw _0xa5362;});}return _0x411fa9;})[_0x084a('0x26')](respondWithResult(_0x31677b,0xc9))[_0x084a('0x55')](handleError(_0x31677b,null));};exports['update']=function(_0x54ca1f,_0x424cd1){if(_0x54ca1f['body']['id']){delete _0x54ca1f[_0x084a('0x4e')]['id'];}return db[_0x084a('0x2f')]['find']({'where':{'id':_0x54ca1f[_0x084a('0x49')]['id']}})['then'](handleEntityNotFound(_0x424cd1,null))['then'](saveUpdates(_0x54ca1f[_0x084a('0x4e')],null))[_0x084a('0x26')](respondWithResult(_0x424cd1,null))[_0x084a('0x55')](handleError(_0x424cd1,null));};exports[_0x084a('0x25')]=function(_0x2a8056,_0x57d397){return db[_0x084a('0x2f')]['find']({'where':{'id':_0x2a8056[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x57d397,null))[_0x084a('0x26')](removeEntity(_0x57d397,null))['catch'](handleError(_0x57d397,null));};exports[_0x084a('0x57')]=function(_0x339088,_0x12db87,_0x9246dd){return db['VoiceMail'][_0x084a('0x58')]({'where':{'id':_0x339088['params']['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x12db87,null))[_0x084a('0x26')](function(_0x21a18a){var _0x4cc344;var _0x589e38={},_0xd37003={};_0xd37003[_0x084a('0x34')]=_['keys'](db[_0x084a('0x59')]['rawAttributes']);_0xd37003['query']=_[_0x084a('0x4a')](_0x339088[_0x084a('0x35')]);_0xd37003[_0x084a('0x36')]=_[_0x084a('0x37')](_0xd37003[_0x084a('0x34')],_0xd37003[_0x084a('0x35')]);_0x589e38[_0x084a('0x38')]=_[_0x084a('0x37')](_0xd37003[_0x084a('0x34')],qs['fields'](_0x339088[_0x084a('0x35')][_0x084a('0x39')]));_0x589e38[_0x084a('0x38')]=_0x589e38['attributes'][_0x084a('0x3a')]?_0x589e38[_0x084a('0x38')]:_0xd37003['model'];if(!_0x339088[_0x084a('0x35')]['hasOwnProperty']('nolimit')){_0x589e38[_0x084a('0x1f')]=qs['limit'](_0x339088['query'][_0x084a('0x1f')]);_0x589e38[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0x339088['query'][_0x084a('0x1d')]);}_0x589e38[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x339088[_0x084a('0x35')][_0x084a('0x3e')]);_0x589e38[_0x084a('0x3f')]=qs[_0x084a('0x36')](_['pick'](_0x339088['query'],_0xd37003[_0x084a('0x36')]));if(_0x339088[_0x084a('0x35')]['filter']){_0x589e38[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x589e38[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x589e38['attributes'],function(_0x21dd85){var _0x3fa52e={};_0x3fa52e[_0x21dd85]={'$like':'%'+_0x339088[_0x084a('0x35')]['filter']+'%'};return _0x3fa52e;})});}_0x589e38['where']=_[_0x084a('0x42')](_0x589e38[_0x084a('0x3f')],{'mailboxuser':_0x21a18a[_0x084a('0x5a')]});_0x589e38=_[_0x084a('0x42')]({},_0x589e38,_0x339088[_0x084a('0x44')]);return db[_0x084a('0x59')][_0x084a('0x5b')](_0x589e38)['then'](respondWithFilteredResult(_0x12db87,_0x589e38));})[_0x084a('0x55')](handleError(_0x12db87,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9c13a9a..df60c3e 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 _0x0a68=['path','../../config/environment','exports','define','VoiceMail','mailbox_context','context','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1cf433,_0x98dbde){var _0x1e2287=function(_0x1c5788){while(--_0x1c5788){_0x1cf433['push'](_0x1cf433['shift']());}};_0x1e2287(++_0x98dbde);}(_0x0a68,0x67));var _0x80a6=function(_0x1d6b45,_0x3f4b08){_0x1d6b45=_0x1d6b45-0x0;var _0x127935=_0x0a68[_0x1d6b45];return _0x127935;};'use strict';var _=require(_0x80a6('0x0'));var util=require(_0x80a6('0x1'));var logger=require(_0x80a6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x80a6('0x3'));var rp=require(_0x80a6('0x4'));var fs=require('fs');var path=require(_0x80a6('0x5'));var rimraf=require('rimraf');var config=require(_0x80a6('0x6'));var attributes=require('./voiceMail.attributes');module[_0x80a6('0x7')]=function(_0x39889d,_0x5b691e){return _0x39889d[_0x80a6('0x8')](_0x80a6('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x80a6('0xa'),'fields':['mailbox',_0x80a6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x988c=['path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19a11f,_0x6d8be7){var _0x51485f=function(_0x1394a1){while(--_0x1394a1){_0x19a11f['push'](_0x19a11f['shift']());}};_0x51485f(++_0x6d8be7);}(_0x988c,0x1d5));var _0xc988=function(_0x2b5472,_0x4ad5ed){_0x2b5472=_0x2b5472-0x0;var _0xf4b1e0=_0x988c[_0x2b5472];return _0xf4b1e0;};'use strict';var _=require(_0xc988('0x0'));var util=require(_0xc988('0x1'));var logger=require(_0xc988('0x2'))(_0xc988('0x3'));var moment=require(_0xc988('0x4'));var BPromise=require(_0xc988('0x5'));var rp=require(_0xc988('0x6'));var fs=require('fs');var path=require(_0xc988('0x7'));var rimraf=require(_0xc988('0x8'));var config=require(_0xc988('0x9'));var attributes=require(_0xc988('0xa'));module['exports']=function(_0xbf4062,_0x254d23){return _0xbf4062[_0xc988('0xb')](_0xc988('0xc'),attributes,{'tableName':_0xc988('0xd'),'paranoid':![],'indexes':[{'name':_0xc988('0xe'),'fields':[_0xc988('0xf'),_0xc988('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3bdae2d..98661c3 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 _0x9e23=['then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http'];(function(_0x14f89e,_0x139fce){var _0x26092d=function(_0x2bdc20){while(--_0x2bdc20){_0x14f89e['push'](_0x14f89e['shift']());}};_0x26092d(++_0x139fce);}(_0x9e23,0xf4));var _0x39e2=function(_0x38fce3,_0x535e95){_0x38fce3=_0x38fce3-0x0;var _0x2b2571=_0x9e23[_0x38fce3];return _0x2b2571;};'use strict';var _=require('lodash');var util=require(_0x39e2('0x0'));var moment=require(_0x39e2('0x1'));var BPromise=require('bluebird');var rs=require(_0x39e2('0x2'));var fs=require('fs');var Redis=require(_0x39e2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x39e2('0x4'));var logger=require('../../config/logger')(_0x39e2('0x5'));var config=require('../../config/environment');var jayson=require(_0x39e2('0x6'));var client=jayson['client'][_0x39e2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3efe81,_0x394788,_0x52e947){return new BPromise(function(_0x52e451,_0x275c25){return client['request'](_0x3efe81,_0x52e947)[_0x39e2('0x8')](function(_0x1d1030){logger[_0x39e2('0x9')](_0x39e2('0xa'),_0x394788,_0x39e2('0xb'));logger['debug'](_0x39e2('0xc'),_0x394788,_0x39e2('0xb'),JSON[_0x39e2('0xd')](_0x1d1030));if(_0x1d1030[_0x39e2('0xe')]){if(_0x1d1030[_0x39e2('0xe')][_0x39e2('0xf')]===0x1f4){logger[_0x39e2('0xe')]('VoiceMail,\x20%s,\x20%s',_0x394788,_0x1d1030[_0x39e2('0xe')][_0x39e2('0x10')]);return _0x275c25(_0x1d1030[_0x39e2('0xe')][_0x39e2('0x10')]);}logger[_0x39e2('0xe')](_0x39e2('0xa'),_0x394788,_0x1d1030[_0x39e2('0xe')][_0x39e2('0x10')]);return _0x52e451(_0x1d1030[_0x39e2('0xe')][_0x39e2('0x10')]);}else{logger[_0x39e2('0x9')](_0x39e2('0xa'),_0x394788,_0x39e2('0xb'));_0x52e451(_0x1d1030['result'][_0x39e2('0x10')]);}})[_0x39e2('0x11')](function(_0x10975c){logger[_0x39e2('0xe')](_0x39e2('0xa'),_0x394788,_0x10975c);_0x275c25(_0x10975c);});});} \ No newline at end of file +var _0x642f=['catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x235e61,_0x39bf64){var _0x58af19=function(_0x2e55df){while(--_0x2e55df){_0x235e61['push'](_0x235e61['shift']());}};_0x58af19(++_0x39bf64);}(_0x642f,0x1e4));var _0xf642=function(_0xd35f8d,_0x1af405){_0xd35f8d=_0xd35f8d-0x0;var _0x58bc8e=_0x642f[_0xd35f8d];return _0x58bc8e;};'use strict';var _=require(_0xf642('0x0'));var util=require(_0xf642('0x1'));var moment=require('moment');var BPromise=require(_0xf642('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf642('0x3'));var db=require(_0xf642('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf642('0x5'));var config=require(_0xf642('0x6'));var jayson=require(_0xf642('0x7'));var client=jayson[_0xf642('0x8')][_0xf642('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4741a9,_0x2df2d0,_0x1da5f0){return new BPromise(function(_0x58c9a5,_0x18409a){return client[_0xf642('0xa')](_0x4741a9,_0x1da5f0)[_0xf642('0xb')](function(_0x48403c){logger[_0xf642('0xc')](_0xf642('0xd'),_0x2df2d0,_0xf642('0xe'));logger[_0xf642('0xf')](_0xf642('0x10'),_0x2df2d0,_0xf642('0xe'),JSON['stringify'](_0x48403c));if(_0x48403c['error']){if(_0x48403c[_0xf642('0x11')]['code']===0x1f4){logger[_0xf642('0x11')](_0xf642('0xd'),_0x2df2d0,_0x48403c[_0xf642('0x11')]['message']);return _0x18409a(_0x48403c[_0xf642('0x11')][_0xf642('0x12')]);}logger['error'](_0xf642('0xd'),_0x2df2d0,_0x48403c[_0xf642('0x11')][_0xf642('0x12')]);return _0x58c9a5(_0x48403c[_0xf642('0x11')][_0xf642('0x12')]);}else{logger['info'](_0xf642('0xd'),_0x2df2d0,'request\x20sent');_0x58c9a5(_0x48403c[_0xf642('0x13')]['message']);}})[_0xf642('0x14')](function(_0x1487b3){logger[_0xf642('0x11')](_0xf642('0xd'),_0x2df2d0,_0x1487b3);_0x18409a(_0x1487b3);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0066928..d063a9d 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 _0x86b2=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated','show','get','/:id/download','post','create','put','update','delete','exports','multer'];(function(_0x4d85fe,_0x3d1cfb){var _0x1a8b76=function(_0x3a1efe){while(--_0x3a1efe){_0x4d85fe['push'](_0x4d85fe['shift']());}};_0x1a8b76(++_0x3d1cfb);}(_0x86b2,0x103));var _0x286b=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x86b2[_0x342700];return _0x53406f;};'use strict';var multer=require(_0x286b('0x0'));var util=require(_0x286b('0x1'));var path=require(_0x286b('0x2'));var timeout=require('connect-timeout');var express=require(_0x286b('0x3'));var router=express[_0x286b('0x4')]();var fs_extra=require(_0x286b('0x5'));var auth=require(_0x286b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x286b('0x7'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x286b('0x8')]);router['get'](_0x286b('0x9'),auth[_0x286b('0xa')](),controller[_0x286b('0xb')]);router[_0x286b('0xc')](_0x286b('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x286b('0xe')]('/',auth[_0x286b('0xa')](),controller[_0x286b('0xf')]);router[_0x286b('0x10')](_0x286b('0x9'),auth['isAuthenticated'](),controller[_0x286b('0x11')]);router[_0x286b('0x12')]('/:id',auth[_0x286b('0xa')](),controller['destroy']);module[_0x286b('0x13')]=router; \ No newline at end of file +var _0x5dc9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x1b9544,_0xe23637){var _0x3bfb58=function(_0x440637){while(--_0x440637){_0x1b9544['push'](_0x1b9544['shift']());}};_0x3bfb58(++_0xe23637);}(_0x5dc9,0x16e));var _0x95dc=function(_0x399c4f,_0x417e30){_0x399c4f=_0x399c4f-0x0;var _0x179470=_0x5dc9[_0x399c4f];return _0x179470;};'use strict';var multer=require(_0x95dc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x95dc('0x1'));var express=require(_0x95dc('0x2'));var router=express[_0x95dc('0x3')]();var fs_extra=require(_0x95dc('0x4'));var auth=require(_0x95dc('0x5'));var interaction=require(_0x95dc('0x6'));var config=require(_0x95dc('0x7'));var controller=require(_0x95dc('0x8'));router[_0x95dc('0x9')]('/',auth[_0x95dc('0xa')](),controller[_0x95dc('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x95dc('0xc')]);router[_0x95dc('0x9')](_0x95dc('0xd'),auth[_0x95dc('0xa')](),controller[_0x95dc('0xe')]);router[_0x95dc('0xf')]('/',auth[_0x95dc('0xa')](),controller[_0x95dc('0x10')]);router[_0x95dc('0x11')](_0x95dc('0x12'),auth[_0x95dc('0xa')](),controller[_0x95dc('0x13')]);router[_0x95dc('0x14')](_0x95dc('0x12'),auth[_0x95dc('0xa')](),controller[_0x95dc('0x15')]);module[_0x95dc('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 0086f00..f386a73 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 _0xb027=['VIRTUAL','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x30eeb3,_0x3f2ca1){var _0x2854d6=function(_0x14115c){while(--_0x14115c){_0x30eeb3['push'](_0x30eeb3['shift']());}};_0x2854d6(++_0x3f2ca1);}(_0xb027,0xb7));var _0x7b02=function(_0x174c76,_0x4224c9){_0x174c76=_0x174c76-0x0;var _0x228b84=_0xb027[_0x174c76];return _0x228b84;};'use strict';var Sequelize=require(_0x7b02('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b02('0x1')],'get':function(_0x23c1e3){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x7b02('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x7b02('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7b02('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7b02('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7b02('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7b02('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x7b02('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x7b02('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x7b02('0x5'),'defaultValue':Sequelize[_0x7b02('0x6')](_0x7b02('0x7'))}}; \ No newline at end of file +var _0x65b6=['getDataValue','INTEGER','STRING','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x925616,_0x144755){var _0x323713=function(_0x1c26d8){while(--_0x1c26d8){_0x925616['push'](_0x925616['shift']());}};_0x323713(++_0x144755);}(_0x65b6,0x15c));var _0x665b=function(_0x1641ca,_0x290a2e){_0x1641ca=_0x1641ca-0x0;var _0xd3a8d2=_0x65b6[_0x1641ca];return _0xd3a8d2;};'use strict';var Sequelize=require(_0x665b('0x0'));module[_0x665b('0x1')]={'name':{'type':Sequelize[_0x665b('0x2')],'get':function(_0x49a436){return this[_0x665b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x665b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x665b('0x5')],'defaultValue':''},'stamp':{'type':_0x665b('0x6'),'defaultValue':Sequelize[_0x665b('0x7')](_0x665b('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 7432e67..00a56b3 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 _0x9c50=['options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','destroy','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','Content-Disposition','msg_id','.wav\x22','set','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','where','filters','filter','merge','VIRTUAL'];(function(_0x3f1d63,_0x1c9397){var _0x48173a=function(_0xa1ae0b){while(--_0xa1ae0b){_0x3f1d63['push'](_0x3f1d63['shift']());}};_0x48173a(++_0x1c9397);}(_0x9c50,0x1a9));var _0x09c5=function(_0x1f8a0e,_0xa8c3fe){_0x1f8a0e=_0x1f8a0e-0x0;var _0x1ab7a9=_0x9c50[_0x1f8a0e];return _0x1ab7a9;};'use strict';var emlformat=require(_0x09c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09c5('0x1'));var jsonpatch=require(_0x09c5('0x2'));var rp=require(_0x09c5('0x3'));var moment=require(_0x09c5('0x4'));var BPromise=require(_0x09c5('0x5'));var Mustache=require(_0x09c5('0x6'));var util=require('util');var path=require(_0x09c5('0x7'));var sox=require('sox');var csv=require(_0x09c5('0x8'));var ejs=require(_0x09c5('0x9'));var fs=require('fs');var fs_extra=require(_0x09c5('0xa'));var _=require(_0x09c5('0xb'));var squel=require(_0x09c5('0xc'));var crypto=require('crypto');var jsforce=require(_0x09c5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09c5('0xe'));var Papa=require(_0x09c5('0xf'));var Redis=require(_0x09c5('0x10'));var authService=require(_0x09c5('0x11'));var qs=require(_0x09c5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09c5('0x13'));var logger=require(_0x09c5('0x14'))(_0x09c5('0x15'));var utils=require('../../config/utils');var config=require(_0x09c5('0x16'));var licenseUtil=require(_0x09c5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14a37d,_0x44e7aa){_0x44e7aa=_0x44e7aa||0xcc;return function(_0x1580f1){if(_0x1580f1){return _0x14a37d[_0x09c5('0x18')](_0x44e7aa);}return _0x14a37d[_0x09c5('0x19')](_0x44e7aa)[_0x09c5('0x1a')]();};}function respondWithResult(_0x1c403b,_0x24b31f){_0x24b31f=_0x24b31f||0xc8;return function(_0x29dfdc){if(_0x29dfdc){return _0x1c403b[_0x09c5('0x19')](_0x24b31f)[_0x09c5('0x1b')](_0x29dfdc);}};}function respondWithFilteredResult(_0x34bd15,_0x112068){return function(_0x5c2fa5){if(_0x5c2fa5){var _0x17abc4=typeof _0x112068['offset']===_0x09c5('0x1c')&&typeof _0x112068[_0x09c5('0x1d')]===_0x09c5('0x1c');var _0x5414d4=_0x5c2fa5[_0x09c5('0x1e')];var _0x37d210=_0x17abc4?0x0:_0x112068['offset'];var _0x1112fc=_0x17abc4?_0x5c2fa5[_0x09c5('0x1e')]:_0x112068['offset']+_0x112068[_0x09c5('0x1d')];var _0x170606;if(_0x1112fc>=_0x5414d4){_0x1112fc=_0x5414d4;_0x170606=0xc8;}else{_0x170606=0xce;}_0x34bd15[_0x09c5('0x19')](_0x170606);return _0x34bd15['set'](_0x09c5('0x1f'),_0x37d210+'-'+_0x1112fc+'/'+_0x5414d4)['json'](_0x5c2fa5);}return null;};}function patchUpdates(_0x4879a9){return function(_0x47faaf){try{jsonpatch['apply'](_0x47faaf,_0x4879a9,!![]);}catch(_0x32155c){return BPromise[_0x09c5('0x20')](_0x32155c);}return _0x47faaf[_0x09c5('0x21')]();};}function saveUpdates(_0x338ec7,_0xdce33d){return function(_0xc5094c){if(_0xc5094c){return _0xc5094c[_0x09c5('0x22')](_0x338ec7)['then'](function(_0x454fe3){return _0x454fe3;});}return null;};}function removeEntity(_0x3b1c24,_0x5b3854){return function(_0x548bf5){if(_0x548bf5){return _0x548bf5['destroy']()[_0x09c5('0x23')](function(){_0x3b1c24[_0x09c5('0x19')](0xcc)[_0x09c5('0x1a')]();});}};}function handleEntityNotFound(_0x53b745,_0x40bac6){return function(_0x33b3ff){if(!_0x33b3ff){_0x53b745[_0x09c5('0x18')](0x194);}return _0x33b3ff;};}function handleError(_0x387e4e,_0x28b06d){_0x28b06d=_0x28b06d||0x1f4;return function(_0x65f20){logger[_0x09c5('0x24')](_0x65f20[_0x09c5('0x25')]);if(_0x65f20[_0x09c5('0x26')]){delete _0x65f20['name'];}_0x387e4e[_0x09c5('0x19')](_0x28b06d)[_0x09c5('0x27')](_0x65f20);};}exports[_0x09c5('0x28')]=function(_0x5c9bf1,_0x256299){var _0x3b441b={},_0x27cc2e={},_0x2e726e={'count':0x0,'rows':[]};var _0x312681=_['map'](db[_0x09c5('0x29')][_0x09c5('0x2a')],function(_0x39ba82){return{'name':_0x39ba82[_0x09c5('0x2b')],'type':_0x39ba82[_0x09c5('0x2c')][_0x09c5('0x2d')]};});_0x27cc2e['model']=_['differenceBy'](_[_0x09c5('0x2e')](_0x312681,_0x09c5('0x26')),[_0x09c5('0x26')]);_0x27cc2e[_0x09c5('0x2f')]=_['keys'](_0x5c9bf1['query']);_0x27cc2e['filters']=_[_0x09c5('0x30')](_0x27cc2e[_0x09c5('0x31')],_0x27cc2e[_0x09c5('0x2f')]);_0x3b441b[_0x09c5('0x32')]=_[_0x09c5('0x30')](_0x27cc2e[_0x09c5('0x31')],qs[_0x09c5('0x33')](_0x5c9bf1[_0x09c5('0x2f')]['fields']));_0x3b441b[_0x09c5('0x32')]=_0x3b441b['attributes'][_0x09c5('0x34')]?_0x3b441b[_0x09c5('0x32')]:_0x27cc2e[_0x09c5('0x31')];if(!_0x5c9bf1['query'][_0x09c5('0x35')]('nolimit')){_0x3b441b[_0x09c5('0x1d')]=qs[_0x09c5('0x1d')](_0x5c9bf1[_0x09c5('0x2f')][_0x09c5('0x1d')]);_0x3b441b['offset']=qs[_0x09c5('0x36')](_0x5c9bf1[_0x09c5('0x2f')][_0x09c5('0x36')]);}_0x3b441b[_0x09c5('0x37')]=qs['sort'](_0x5c9bf1[_0x09c5('0x2f')]['sort']);_0x3b441b[_0x09c5('0x38')]=qs['filters'](_['pick'](_0x5c9bf1[_0x09c5('0x2f')],_0x27cc2e[_0x09c5('0x39')]),_0x312681);if(_0x5c9bf1[_0x09c5('0x2f')][_0x09c5('0x3a')]){_0x3b441b[_0x09c5('0x38')]=_[_0x09c5('0x3b')](_0x3b441b[_0x09c5('0x38')],{'$or':_[_0x09c5('0x2e')](_0x312681,function(_0x382ac1){if(_0x382ac1[_0x09c5('0x2c')]!==_0x09c5('0x3c')){var _0x538994={};_0x538994[_0x382ac1[_0x09c5('0x26')]]={'$like':'%'+_0x5c9bf1[_0x09c5('0x2f')][_0x09c5('0x3a')]+'%'};return _0x538994;}})});}_0x3b441b=_['merge']({},_0x3b441b,_0x5c9bf1[_0x09c5('0x3d')]);var _0x3c8d8b={'where':_0x3b441b['where']};return db[_0x09c5('0x29')][_0x09c5('0x1e')](_0x3c8d8b)[_0x09c5('0x23')](function(_0x488f0a){_0x2e726e[_0x09c5('0x1e')]=_0x488f0a;if(_0x5c9bf1[_0x09c5('0x2f')][_0x09c5('0x3e')]){_0x3b441b['include']=[{'all':!![]}];}return db[_0x09c5('0x29')][_0x09c5('0x3f')](_0x3b441b);})[_0x09c5('0x23')](function(_0x798710){_0x2e726e[_0x09c5('0x40')]=_0x798710;return _0x2e726e;})['then'](respondWithFilteredResult(_0x256299,_0x3b441b))[_0x09c5('0x41')](handleError(_0x256299,null));};exports[_0x09c5('0x42')]=function(_0x45781a,_0x4afb65){var _0x1cfa53={'raw':!![],'where':{'id':_0x45781a[_0x09c5('0x43')]['id']}},_0x21c486={};_0x21c486['model']=_[_0x09c5('0x44')](db[_0x09c5('0x29')][_0x09c5('0x2a')]);_0x21c486['query']=_['keys'](_0x45781a[_0x09c5('0x2f')]);_0x21c486[_0x09c5('0x39')]=_[_0x09c5('0x30')](_0x21c486['model'],_0x21c486[_0x09c5('0x2f')]);_0x1cfa53[_0x09c5('0x32')]=_['intersection'](_0x21c486[_0x09c5('0x31')],qs['fields'](_0x45781a[_0x09c5('0x2f')][_0x09c5('0x33')]));_0x1cfa53[_0x09c5('0x32')]=_0x1cfa53['attributes'][_0x09c5('0x34')]?_0x1cfa53[_0x09c5('0x32')]:_0x21c486[_0x09c5('0x31')];if(_0x45781a[_0x09c5('0x2f')]['includeAll']){_0x1cfa53['include']=[{'all':!![]}];}_0x1cfa53=_[_0x09c5('0x3b')]({},_0x1cfa53,_0x45781a[_0x09c5('0x3d')]);return db['VoiceMailMessage'][_0x09c5('0x45')](_0x1cfa53)[_0x09c5('0x23')](handleEntityNotFound(_0x4afb65,null))[_0x09c5('0x23')](respondWithResult(_0x4afb65,null))[_0x09c5('0x41')](handleError(_0x4afb65,null));};exports[_0x09c5('0x46')]=function(_0x4767e4,_0x21ab76){return db['VoiceMailMessage'][_0x09c5('0x46')](_0x4767e4[_0x09c5('0x47')],{})[_0x09c5('0x23')](respondWithResult(_0x21ab76,0xc9))[_0x09c5('0x41')](handleError(_0x21ab76,null));};exports[_0x09c5('0x22')]=function(_0x2155a9,_0x51c546){if(_0x2155a9['body']['id']){delete _0x2155a9[_0x09c5('0x47')]['id'];}return db[_0x09c5('0x29')][_0x09c5('0x45')]({'where':{'id':_0x2155a9[_0x09c5('0x43')]['id']}})['then'](handleEntityNotFound(_0x51c546,null))['then'](saveUpdates(_0x2155a9['body'],null))[_0x09c5('0x23')](respondWithResult(_0x51c546,null))[_0x09c5('0x41')](handleError(_0x51c546,null));};exports[_0x09c5('0x48')]=function(_0x43a99f,_0x18881f){return db[_0x09c5('0x29')][_0x09c5('0x45')]({'where':{'id':_0x43a99f[_0x09c5('0x43')]['id']}})['then'](handleEntityNotFound(_0x18881f,null))['then'](removeEntity(_0x18881f,null))[_0x09c5('0x41')](handleError(_0x18881f,null));};exports['download']=function(_0x5666c6,_0x45657f,_0x3d2833){return db[_0x09c5('0x29')][_0x09c5('0x45')]({'where':{'id':_0x5666c6[_0x09c5('0x43')]['id']},'attributes':['id',_0x09c5('0x49'),'msg_id']})[_0x09c5('0x23')](handleEntityNotFound(_0x45657f,null))['then'](function(_0xcf4178){if(_0xcf4178){if(!_0xcf4178['recording']){throw new db[(_0x09c5('0x4a'))][(_0x09c5('0x4b'))](_0x09c5('0x4c'));}var _0x28bab8={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0xcf4178['msg_id']){_0x28bab8[_0x09c5('0x4d')]='attachment;\x20filename=\x22'+_0xcf4178[_0x09c5('0x4e')]+_0x09c5('0x4f');}_0x45657f[_0x09c5('0x50')](_0x28bab8);return _0x45657f[_0x09c5('0x27')](new Buffer(_0xcf4178[_0x09c5('0x49')]));}})[_0x09c5('0x41')](handleError(_0x45657f,null));}; \ No newline at end of file +var _0x4a75=['params','find','create','body','destroy','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','includeAll','include','rows','catch'];(function(_0x2c4e40,_0x1f77a1){var _0x5b2bba=function(_0x1f6d0f){while(--_0x1f6d0f){_0x2c4e40['push'](_0x2c4e40['shift']());}};_0x5b2bba(++_0x1f77a1);}(_0x4a75,0x65));var _0x54a7=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x4a75[_0x81dcac];return _0xc7803b;};'use strict';var emlformat=require(_0x54a7('0x0'));var rimraf=require(_0x54a7('0x1'));var zipdir=require(_0x54a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x54a7('0x3'));var moment=require('moment');var BPromise=require(_0x54a7('0x4'));var Mustache=require(_0x54a7('0x5'));var util=require(_0x54a7('0x6'));var path=require(_0x54a7('0x7'));var sox=require('sox');var csv=require(_0x54a7('0x8'));var ejs=require(_0x54a7('0x9'));var fs=require('fs');var fs_extra=require(_0x54a7('0xa'));var _=require(_0x54a7('0xb'));var squel=require(_0x54a7('0xc'));var crypto=require(_0x54a7('0xd'));var jsforce=require(_0x54a7('0xe'));var deskjs=require(_0x54a7('0xf'));var toCsv=require(_0x54a7('0x8'));var querystring=require(_0x54a7('0x10'));var Papa=require(_0x54a7('0x11'));var Redis=require(_0x54a7('0x12'));var authService=require(_0x54a7('0x13'));var qs=require(_0x54a7('0x14'));var as=require(_0x54a7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54a7('0x16'))(_0x54a7('0x17'));var utils=require(_0x54a7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x54a7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x240a56,_0x9f3699){_0x9f3699=_0x9f3699||0xcc;return function(_0x9a2a78){if(_0x9a2a78){return _0x240a56['sendStatus'](_0x9f3699);}return _0x240a56[_0x54a7('0x1a')](_0x9f3699)[_0x54a7('0x1b')]();};}function respondWithResult(_0x353c55,_0x57cb0e){_0x57cb0e=_0x57cb0e||0xc8;return function(_0x3b4b43){if(_0x3b4b43){return _0x353c55[_0x54a7('0x1a')](_0x57cb0e)[_0x54a7('0x1c')](_0x3b4b43);}};}function respondWithFilteredResult(_0x4fcaef,_0xbf7f5e){return function(_0x36d8a2){if(_0x36d8a2){var _0x24b423=typeof _0xbf7f5e[_0x54a7('0x1d')]===_0x54a7('0x1e')&&typeof _0xbf7f5e[_0x54a7('0x1f')]==='undefined';var _0x4046c2=_0x36d8a2[_0x54a7('0x20')];var _0x10354b=_0x24b423?0x0:_0xbf7f5e[_0x54a7('0x1d')];var _0xf4321a=_0x24b423?_0x36d8a2['count']:_0xbf7f5e[_0x54a7('0x1d')]+_0xbf7f5e[_0x54a7('0x1f')];var _0x44f919;if(_0xf4321a>=_0x4046c2){_0xf4321a=_0x4046c2;_0x44f919=0xc8;}else{_0x44f919=0xce;}_0x4fcaef['status'](_0x44f919);return _0x4fcaef[_0x54a7('0x21')](_0x54a7('0x22'),_0x10354b+'-'+_0xf4321a+'/'+_0x4046c2)['json'](_0x36d8a2);}return null;};}function patchUpdates(_0x2e0eb8){return function(_0x2f39ae){try{jsonpatch[_0x54a7('0x23')](_0x2f39ae,_0x2e0eb8,!![]);}catch(_0x3b74e3){return BPromise[_0x54a7('0x24')](_0x3b74e3);}return _0x2f39ae[_0x54a7('0x25')]();};}function saveUpdates(_0x567f50,_0x437cea){return function(_0x52e109){if(_0x52e109){return _0x52e109[_0x54a7('0x26')](_0x567f50)[_0x54a7('0x27')](function(_0x5af5e6){return _0x5af5e6;});}return null;};}function removeEntity(_0x4dab07,_0x29197e){return function(_0x8feb95){if(_0x8feb95){return _0x8feb95['destroy']()[_0x54a7('0x27')](function(){_0x4dab07['status'](0xcc)[_0x54a7('0x1b')]();});}};}function handleEntityNotFound(_0x5cd506,_0x4ace8a){return function(_0x25156b){if(!_0x25156b){_0x5cd506[_0x54a7('0x28')](0x194);}return _0x25156b;};}function handleError(_0x503312,_0x32685b){_0x32685b=_0x32685b||0x1f4;return function(_0x140b3d){logger[_0x54a7('0x29')](_0x140b3d['stack']);if(_0x140b3d['name']){delete _0x140b3d[_0x54a7('0x2a')];}_0x503312[_0x54a7('0x1a')](_0x32685b)[_0x54a7('0x2b')](_0x140b3d);};}exports[_0x54a7('0x2c')]=function(_0x2734ba,_0x164384){var _0x2e1162={},_0x511b35={},_0x3c418d={'count':0x0,'rows':[]};var _0x55fd67=_[_0x54a7('0x2d')](db['VoiceMailMessage'][_0x54a7('0x2e')],function(_0x3ef02b){return{'name':_0x3ef02b[_0x54a7('0x2f')],'type':_0x3ef02b[_0x54a7('0x30')][_0x54a7('0x31')]};});_0x511b35[_0x54a7('0x32')]=_[_0x54a7('0x33')](_[_0x54a7('0x2d')](_0x55fd67,_0x54a7('0x2a')),[_0x54a7('0x2a')]);_0x511b35[_0x54a7('0x34')]=_[_0x54a7('0x35')](_0x2734ba[_0x54a7('0x34')]);_0x511b35[_0x54a7('0x36')]=_[_0x54a7('0x37')](_0x511b35[_0x54a7('0x32')],_0x511b35[_0x54a7('0x34')]);_0x2e1162[_0x54a7('0x38')]=_['intersection'](_0x511b35['model'],qs[_0x54a7('0x39')](_0x2734ba[_0x54a7('0x34')]['fields']));_0x2e1162[_0x54a7('0x38')]=_0x2e1162[_0x54a7('0x38')][_0x54a7('0x3a')]?_0x2e1162[_0x54a7('0x38')]:_0x511b35['model'];if(!_0x2734ba['query']['hasOwnProperty'](_0x54a7('0x3b'))){_0x2e1162[_0x54a7('0x1f')]=qs[_0x54a7('0x1f')](_0x2734ba['query'][_0x54a7('0x1f')]);_0x2e1162['offset']=qs[_0x54a7('0x1d')](_0x2734ba[_0x54a7('0x34')][_0x54a7('0x1d')]);}_0x2e1162[_0x54a7('0x3c')]=qs[_0x54a7('0x3d')](_0x2734ba[_0x54a7('0x34')][_0x54a7('0x3d')]);_0x2e1162[_0x54a7('0x3e')]=qs[_0x54a7('0x36')](_[_0x54a7('0x3f')](_0x2734ba[_0x54a7('0x34')],_0x511b35[_0x54a7('0x36')]),_0x55fd67);if(_0x2734ba[_0x54a7('0x34')][_0x54a7('0x40')]){_0x2e1162[_0x54a7('0x3e')]=_[_0x54a7('0x41')](_0x2e1162[_0x54a7('0x3e')],{'$or':_['map'](_0x55fd67,function(_0x1cf41a){if(_0x1cf41a[_0x54a7('0x30')]!==_0x54a7('0x42')){var _0x11791f={};_0x11791f[_0x1cf41a['name']]={'$like':'%'+_0x2734ba[_0x54a7('0x34')][_0x54a7('0x40')]+'%'};return _0x11791f;}})});}_0x2e1162=_['merge']({},_0x2e1162,_0x2734ba[_0x54a7('0x43')]);var _0x4af67e={'where':_0x2e1162[_0x54a7('0x3e')]};return db[_0x54a7('0x44')]['count'](_0x4af67e)[_0x54a7('0x27')](function(_0x520cc0){_0x3c418d['count']=_0x520cc0;if(_0x2734ba[_0x54a7('0x34')][_0x54a7('0x45')]){_0x2e1162[_0x54a7('0x46')]=[{'all':!![]}];}return db[_0x54a7('0x44')]['findAll'](_0x2e1162);})['then'](function(_0x1acc3d){_0x3c418d[_0x54a7('0x47')]=_0x1acc3d;return _0x3c418d;})[_0x54a7('0x27')](respondWithFilteredResult(_0x164384,_0x2e1162))[_0x54a7('0x48')](handleError(_0x164384,null));};exports['show']=function(_0x1c8c48,_0x1c3b34){var _0x56fcf2={'raw':!![],'where':{'id':_0x1c8c48[_0x54a7('0x49')]['id']}},_0x4cf90a={};_0x4cf90a['model']=_[_0x54a7('0x35')](db[_0x54a7('0x44')][_0x54a7('0x2e')]);_0x4cf90a[_0x54a7('0x34')]=_[_0x54a7('0x35')](_0x1c8c48[_0x54a7('0x34')]);_0x4cf90a['filters']=_[_0x54a7('0x37')](_0x4cf90a[_0x54a7('0x32')],_0x4cf90a['query']);_0x56fcf2[_0x54a7('0x38')]=_[_0x54a7('0x37')](_0x4cf90a[_0x54a7('0x32')],qs[_0x54a7('0x39')](_0x1c8c48['query'][_0x54a7('0x39')]));_0x56fcf2['attributes']=_0x56fcf2[_0x54a7('0x38')][_0x54a7('0x3a')]?_0x56fcf2[_0x54a7('0x38')]:_0x4cf90a['model'];if(_0x1c8c48[_0x54a7('0x34')][_0x54a7('0x45')]){_0x56fcf2[_0x54a7('0x46')]=[{'all':!![]}];}_0x56fcf2=_['merge']({},_0x56fcf2,_0x1c8c48[_0x54a7('0x43')]);return db[_0x54a7('0x44')][_0x54a7('0x4a')](_0x56fcf2)['then'](handleEntityNotFound(_0x1c3b34,null))[_0x54a7('0x27')](respondWithResult(_0x1c3b34,null))['catch'](handleError(_0x1c3b34,null));};exports[_0x54a7('0x4b')]=function(_0x5af9e7,_0x26b83a){return db[_0x54a7('0x44')]['create'](_0x5af9e7['body'],{})[_0x54a7('0x27')](respondWithResult(_0x26b83a,0xc9))[_0x54a7('0x48')](handleError(_0x26b83a,null));};exports[_0x54a7('0x26')]=function(_0x140cdc,_0x1775a0){if(_0x140cdc[_0x54a7('0x4c')]['id']){delete _0x140cdc['body']['id'];}return db[_0x54a7('0x44')][_0x54a7('0x4a')]({'where':{'id':_0x140cdc[_0x54a7('0x49')]['id']}})['then'](handleEntityNotFound(_0x1775a0,null))['then'](saveUpdates(_0x140cdc[_0x54a7('0x4c')],null))[_0x54a7('0x27')](respondWithResult(_0x1775a0,null))[_0x54a7('0x48')](handleError(_0x1775a0,null));};exports[_0x54a7('0x4d')]=function(_0x257359,_0x1cd1a9){return db[_0x54a7('0x44')][_0x54a7('0x4a')]({'where':{'id':_0x257359[_0x54a7('0x49')]['id']}})[_0x54a7('0x27')](handleEntityNotFound(_0x1cd1a9,null))[_0x54a7('0x27')](removeEntity(_0x1cd1a9,null))[_0x54a7('0x48')](handleError(_0x1cd1a9,null));};exports[_0x54a7('0x4e')]=function(_0x71e649,_0x45b837,_0x11846c){return db[_0x54a7('0x44')][_0x54a7('0x4a')]({'where':{'id':_0x71e649[_0x54a7('0x49')]['id']},'attributes':['id','recording',_0x54a7('0x4f')]})[_0x54a7('0x27')](handleEntityNotFound(_0x45b837,null))[_0x54a7('0x27')](function(_0x46568d){if(_0x46568d){if(!_0x46568d[_0x54a7('0x50')]){throw new db[(_0x54a7('0x51'))][(_0x54a7('0x52'))](_0x54a7('0x53'));}var _0x1ec38f={'Content-Type':_0x54a7('0x54'),'Content-Disposition':_0x54a7('0x55')};if(_0x46568d[_0x54a7('0x4f')]){_0x1ec38f['Content-Disposition']='attachment;\x20filename=\x22'+_0x46568d[_0x54a7('0x4f')]+_0x54a7('0x56');}_0x45b837[_0x54a7('0x21')](_0x1ec38f);return _0x45b837[_0x54a7('0x2b')](new Buffer(_0x46568d[_0x54a7('0x50')]));}})[_0x54a7('0x48')](handleError(_0x45b837,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f06d110..96c05ed 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 _0xde7f=['rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x513d97,_0x4a86d6){var _0x173833=function(_0x34d4af){while(--_0x34d4af){_0x513d97['push'](_0x513d97['shift']());}};_0x173833(++_0x4a86d6);}(_0xde7f,0x1e8));var _0xfde7=function(_0x1613c0,_0x2bda97){_0x1613c0=_0x1613c0-0x0;var _0x41b12b=_0xde7f[_0x1613c0];return _0x41b12b;};'use strict';var _=require(_0xfde7('0x0'));var util=require(_0xfde7('0x1'));var logger=require(_0xfde7('0x2'))(_0xfde7('0x3'));var moment=require(_0xfde7('0x4'));var BPromise=require(_0xfde7('0x5'));var rp=require(_0xfde7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfde7('0x7'));var config=require(_0xfde7('0x8'));var attributes=require(_0xfde7('0x9'));module[_0xfde7('0xa')]=function(_0x1c2f1a,_0x52964d){return _0x1c2f1a[_0xfde7('0xb')](_0xfde7('0xc'),attributes,{'tableName':_0xfde7('0xd'),'paranoid':![],'indexes':[{'name':_0xfde7('0xe'),'fields':[_0xfde7('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6195=['voice_voicemail_messages','dir','lodash','util','api','moment','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define'];(function(_0x2ede74,_0x36ac75){var _0x25020c=function(_0x314890){while(--_0x314890){_0x2ede74['push'](_0x2ede74['shift']());}};_0x25020c(++_0x36ac75);}(_0x6195,0x1e2));var _0x5619=function(_0x419018,_0x23a46c){_0x419018=_0x419018-0x0;var _0x2197ef=_0x6195[_0x419018];return _0x2197ef;};'use strict';var _=require(_0x5619('0x0'));var util=require(_0x5619('0x1'));var logger=require('../../config/logger')(_0x5619('0x2'));var moment=require(_0x5619('0x3'));var BPromise=require('bluebird');var rp=require(_0x5619('0x4'));var fs=require('fs');var path=require(_0x5619('0x5'));var rimraf=require(_0x5619('0x6'));var config=require('../../config/environment');var attributes=require(_0x5619('0x7'));module[_0x5619('0x8')]=function(_0x195649,_0x1806c8){return _0x195649[_0x5619('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x5619('0xa'),'paranoid':![],'indexes':[{'name':_0x5619('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c9c0c26..4ff57a0 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 _0xd716=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4374d1,_0x2cdb4a){var _0x3d5dc2=function(_0x19c2fe){while(--_0x19c2fe){_0x4374d1['push'](_0x4374d1['shift']());}};_0x3d5dc2(++_0x2cdb4a);}(_0xd716,0x11d));var _0x6d71=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0xd716[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require(_0x6d71('0x0'));var util=require(_0x6d71('0x1'));var moment=require('moment');var BPromise=require(_0x6d71('0x2'));var rs=require(_0x6d71('0x3'));var fs=require('fs');var Redis=require(_0x6d71('0x4'));var db=require(_0x6d71('0x5'))['db'];var utils=require(_0x6d71('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d71('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6d71('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x196b7b,_0x22d339,_0x487f0d){return new BPromise(function(_0x17f702,_0x4c75a8){return client[_0x6d71('0x9')](_0x196b7b,_0x487f0d)[_0x6d71('0xa')](function(_0x146c83){logger[_0x6d71('0xb')](_0x6d71('0xc'),_0x22d339,_0x6d71('0xd'));logger[_0x6d71('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x22d339,_0x6d71('0xd'),JSON[_0x6d71('0xf')](_0x146c83));if(_0x146c83[_0x6d71('0x10')]){if(_0x146c83[_0x6d71('0x10')][_0x6d71('0x11')]===0x1f4){logger['error'](_0x6d71('0xc'),_0x22d339,_0x146c83[_0x6d71('0x10')][_0x6d71('0x12')]);return _0x4c75a8(_0x146c83[_0x6d71('0x10')][_0x6d71('0x12')]);}logger[_0x6d71('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x22d339,_0x146c83[_0x6d71('0x10')]['message']);return _0x17f702(_0x146c83[_0x6d71('0x10')][_0x6d71('0x12')]);}else{logger[_0x6d71('0xb')](_0x6d71('0xc'),_0x22d339,'request\x20sent');_0x17f702(_0x146c83[_0x6d71('0x13')][_0x6d71('0x12')]);}})['catch'](function(_0x32db4e){logger[_0x6d71('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x22d339,_0x32db4e);_0x4c75a8(_0x32db4e);});});} \ No newline at end of file +var _0xa277=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xa277,0x143));var _0x7a27=function(_0x3e6f41,_0x307396){_0x3e6f41=_0x3e6f41-0x0;var _0xa7503e=_0xa277[_0x3e6f41];return _0xa7503e;};'use strict';var _=require('lodash');var util=require(_0x7a27('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a27('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a27('0x2'))['db'];var utils=require(_0x7a27('0x3'));var logger=require(_0x7a27('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a27('0x5'));var client=jayson[_0x7a27('0x6')][_0x7a27('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3bb71a,_0x2c97d3,_0x42a32d){return new BPromise(function(_0x42834a,_0x56c4f0){return client[_0x7a27('0x8')](_0x3bb71a,_0x42a32d)[_0x7a27('0x9')](function(_0x2d48b4){logger[_0x7a27('0xa')](_0x7a27('0xb'),_0x2c97d3,'request\x20sent');logger[_0x7a27('0xc')](_0x7a27('0xd'),_0x2c97d3,_0x7a27('0xe'),JSON[_0x7a27('0xf')](_0x2d48b4));if(_0x2d48b4[_0x7a27('0x10')]){if(_0x2d48b4[_0x7a27('0x10')][_0x7a27('0x11')]===0x1f4){logger[_0x7a27('0x10')](_0x7a27('0xb'),_0x2c97d3,_0x2d48b4['error'][_0x7a27('0x12')]);return _0x56c4f0(_0x2d48b4[_0x7a27('0x10')]['message']);}logger['error'](_0x7a27('0xb'),_0x2c97d3,_0x2d48b4[_0x7a27('0x10')][_0x7a27('0x12')]);return _0x42834a(_0x2d48b4[_0x7a27('0x10')][_0x7a27('0x12')]);}else{logger['info'](_0x7a27('0xb'),_0x2c97d3,_0x7a27('0xe'));_0x42834a(_0x2d48b4[_0x7a27('0x13')]['message']);}})[_0x7a27('0x14')](function(_0x55e1e2){logger[_0x7a27('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x2c97d3,_0x55e1e2);_0x56c4f0(_0x55e1e2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index a0c5c04..e30935d 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 _0xf549=['isAuthenticated','index','/:id','show','getSounds','post','create','/:id/sounds','addSound','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get'];(function(_0x5d909a,_0x3752be){var _0x2a3616=function(_0x6f3fdb){while(--_0x6f3fdb){_0x5d909a['push'](_0x5d909a['shift']());}};_0x2a3616(++_0x3752be);}(_0xf549,0xb0));var _0x9f54=function(_0x22a471,_0xeee2dd){_0x22a471=_0x22a471-0x0;var _0x51dd8c=_0xf549[_0x22a471];return _0x51dd8c;};'use strict';var multer=require(_0x9f54('0x0'));var util=require(_0x9f54('0x1'));var path=require('path');var timeout=require(_0x9f54('0x2'));var express=require('express');var router=express[_0x9f54('0x3')]();var fs_extra=require(_0x9f54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f54('0x5'));var config=require('../../config/environment');var controller=require(_0x9f54('0x6'));router[_0x9f54('0x7')]('/',auth[_0x9f54('0x8')](),controller[_0x9f54('0x9')]);router[_0x9f54('0x7')](_0x9f54('0xa'),auth[_0x9f54('0x8')](),controller[_0x9f54('0xb')]);router[_0x9f54('0x7')]('/:id/sounds',auth[_0x9f54('0x8')](),controller[_0x9f54('0xc')]);router[_0x9f54('0xd')]('/',auth[_0x9f54('0x8')](),controller[_0x9f54('0xe')]);router['post'](_0x9f54('0xf'),auth[_0x9f54('0x8')](),controller[_0x9f54('0x10')]);router[_0x9f54('0x11')](_0x9f54('0xa'),auth[_0x9f54('0x8')](),controller[_0x9f54('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x9f54('0x13')](_0x9f54('0x14'),auth[_0x9f54('0x8')](),controller[_0x9f54('0x15')]);module[_0x9f54('0x16')]=router; \ No newline at end of file +var _0x5236=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id/sounds','post','addSound','put','destroy','delete','/:id/sounds/:id2'];(function(_0x228a4a,_0x23d65e){var _0x3d3937=function(_0x3e9511){while(--_0x3e9511){_0x228a4a['push'](_0x228a4a['shift']());}};_0x3d3937(++_0x23d65e);}(_0x5236,0x190));var _0x6523=function(_0x46ec3e,_0x1c8c95){_0x46ec3e=_0x46ec3e-0x0;var _0x453789=_0x5236[_0x46ec3e];return _0x453789;};'use strict';var multer=require(_0x6523('0x0'));var util=require('util');var path=require(_0x6523('0x1'));var timeout=require(_0x6523('0x2'));var express=require(_0x6523('0x3'));var router=express[_0x6523('0x4')]();var fs_extra=require(_0x6523('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6523('0x6'));var config=require(_0x6523('0x7'));var controller=require(_0x6523('0x8'));router[_0x6523('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6523('0x9')]('/:id',auth[_0x6523('0xa')](),controller['show']);router[_0x6523('0x9')](_0x6523('0xb'),auth[_0x6523('0xa')](),controller['getSounds']);router[_0x6523('0xc')]('/',auth[_0x6523('0xa')](),controller['create']);router[_0x6523('0xc')](_0x6523('0xb'),auth['isAuthenticated'](),controller[_0x6523('0xd')]);router[_0x6523('0xe')]('/:id',auth[_0x6523('0xa')](),controller['update']);router['delete']('/:id',auth[_0x6523('0xa')](),controller[_0x6523('0xf')]);router[_0x6523('0x10')](_0x6523('0x11'),auth[_0x6523('0xa')](),controller['removeSound']);module[_0x6523('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1201d11..813c373 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 _0x86d2=['alpha','TIMESTAMP','BOOLEAN','exports','name','ENUM','custom','files','mp3nb','quietmp3','mp3','STRING'];(function(_0x2e112c,_0x2cdccc){var _0x135feb=function(_0x326f36){while(--_0x326f36){_0x2e112c['push'](_0x2e112c['shift']());}};_0x135feb(++_0x2cdccc);}(_0x86d2,0x1bf));var _0x286d=function(_0x4f080e,_0x3455cf){_0x4f080e=_0x4f080e-0x0;var _0x2c8e58=_0x86d2[_0x4f080e];return _0x2c8e58;};'use strict';var Sequelize=require('sequelize');module[_0x286d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x286d('0x1')},'mode':{'type':Sequelize[_0x286d('0x2')](_0x286d('0x3'),_0x286d('0x4'),_0x286d('0x5'),'quietmp3nb',_0x286d('0x6'),_0x286d('0x7')),'allowNull':!![],'defaultValue':_0x286d('0x4')},'directory':{'type':Sequelize[_0x286d('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x286d('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x286d('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x286d('0x8')],'allowNull':!![],'defaultValue':_0x286d('0x9')},'format':{'type':Sequelize[_0x286d('0x8')],'allowNull':!![]},'stamp':{'type':_0x286d('0xa')},'defaultEntry':{'type':Sequelize[_0x286d('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf7f8=['quietmp3','mp3','alpha','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xf7f8,0x13b));var _0x8f7f=function(_0x5adc46,_0x2b2b0d){_0x5adc46=_0x5adc46-0x0;var _0x1bab26=_0xf7f8[_0x5adc46];return _0x1bab26;};'use strict';var Sequelize=require(_0x8f7f('0x0'));module[_0x8f7f('0x1')]={'name':{'type':Sequelize[_0x8f7f('0x2')],'allowNull':![],'unique':_0x8f7f('0x3')},'mode':{'type':Sequelize[_0x8f7f('0x4')](_0x8f7f('0x5'),_0x8f7f('0x6'),_0x8f7f('0x7'),_0x8f7f('0x8'),_0x8f7f('0x9'),_0x8f7f('0xa')),'allowNull':!![],'defaultValue':_0x8f7f('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x8f7f('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8f7f('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8f7f('0xb')},'format':{'type':Sequelize[_0x8f7f('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'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 ee937e6..ca3d8a2 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 _0x7fb4=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','params','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','save_name','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','removeSound','id2','findOne','getSounds','order','hasOwnProperty','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','map','VoiceMusicOnHold','fieldName','type','key','model','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','intersection','length','find','body','create','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user'];(function(_0x2212d3,_0x324f32){var _0x51c05d=function(_0x376102){while(--_0x376102){_0x2212d3['push'](_0x2212d3['shift']());}};_0x51c05d(++_0x324f32);}(_0x7fb4,0x94));var _0x47fb=function(_0x17e269,_0x4d4641){_0x17e269=_0x17e269-0x0;var _0x395b87=_0x7fb4[_0x17e269];return _0x395b87;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x47fb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47fb('0x1'));var moment=require(_0x47fb('0x2'));var BPromise=require(_0x47fb('0x3'));var Mustache=require(_0x47fb('0x4'));var util=require(_0x47fb('0x5'));var path=require(_0x47fb('0x6'));var sox=require(_0x47fb('0x7'));var csv=require(_0x47fb('0x8'));var ejs=require(_0x47fb('0x9'));var fs=require('fs');var fs_extra=require(_0x47fb('0xa'));var _=require(_0x47fb('0xb'));var squel=require(_0x47fb('0xc'));var crypto=require('crypto');var jsforce=require(_0x47fb('0xd'));var deskjs=require(_0x47fb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x47fb('0xf'));var Papa=require(_0x47fb('0x10'));var Redis=require(_0x47fb('0x11'));var authService=require(_0x47fb('0x12'));var qs=require(_0x47fb('0x13'));var as=require(_0x47fb('0x14'));var hardwareService=require(_0x47fb('0x15'));var logger=require(_0x47fb('0x16'))(_0x47fb('0x17'));var utils=require('../../config/utils');var config=require(_0x47fb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x47fb('0x19'))['db'];function respondWithStatusCode(_0x34a165,_0x1971c3){_0x1971c3=_0x1971c3||0xcc;return function(_0x34c738){if(_0x34c738){return _0x34a165[_0x47fb('0x1a')](_0x1971c3);}return _0x34a165[_0x47fb('0x1b')](_0x1971c3)[_0x47fb('0x1c')]();};}function respondWithResult(_0x4ecfe2,_0x1663bf){_0x1663bf=_0x1663bf||0xc8;return function(_0x20b0c4){if(_0x20b0c4){return _0x4ecfe2[_0x47fb('0x1b')](_0x1663bf)[_0x47fb('0x1d')](_0x20b0c4);}};}function respondWithFilteredResult(_0x445d87,_0x867137){return function(_0x5a0472){if(_0x5a0472){var _0x48374a=typeof _0x867137[_0x47fb('0x1e')]===_0x47fb('0x1f')&&typeof _0x867137[_0x47fb('0x20')]==='undefined';var _0x2c6c74=_0x5a0472[_0x47fb('0x21')];var _0x51bbdb=_0x48374a?0x0:_0x867137[_0x47fb('0x1e')];var _0x47c026=_0x48374a?_0x5a0472[_0x47fb('0x21')]:_0x867137['offset']+_0x867137[_0x47fb('0x20')];var _0x4ab941;if(_0x47c026>=_0x2c6c74){_0x47c026=_0x2c6c74;_0x4ab941=0xc8;}else{_0x4ab941=0xce;}_0x445d87['status'](_0x4ab941);return _0x445d87[_0x47fb('0x22')](_0x47fb('0x23'),_0x51bbdb+'-'+_0x47c026+'/'+_0x2c6c74)['json'](_0x5a0472);}return null;};}function patchUpdates(_0x2624bd){return function(_0x167f41){try{jsonpatch[_0x47fb('0x24')](_0x167f41,_0x2624bd,!![]);}catch(_0x13b429){return BPromise[_0x47fb('0x25')](_0x13b429);}return _0x167f41[_0x47fb('0x26')]();};}function saveUpdates(_0x3b8edb,_0x526ba2){return function(_0x38dfd0){if(_0x38dfd0){return _0x38dfd0[_0x47fb('0x27')](_0x3b8edb)[_0x47fb('0x28')](function(_0x10cb58){return _0x10cb58;});}return null;};}function removeEntity(_0x529da2,_0x2c5a84){return function(_0x2679f6){if(_0x2679f6){return _0x2679f6[_0x47fb('0x29')]()[_0x47fb('0x28')](function(){var _0x27b2c7=_0x2679f6['get']({'plain':!![]});var _0x4173f2='MusicOnHolds';return db[_0x47fb('0x2a')][_0x47fb('0x29')]({'where':{'type':_0x4173f2,'resourceId':_0x27b2c7['id']}})[_0x47fb('0x28')](function(){return _0x2679f6;});})[_0x47fb('0x28')](function(){_0x529da2[_0x47fb('0x1b')](0xcc)[_0x47fb('0x1c')]();});}};}function handleEntityNotFound(_0xce3f80,_0x54f154){return function(_0x528cee){if(!_0x528cee){_0xce3f80[_0x47fb('0x1a')](0x194);}return _0x528cee;};}function handleError(_0x511006,_0x235346){_0x235346=_0x235346||0x1f4;return function(_0x294e58){logger[_0x47fb('0x2b')](_0x294e58[_0x47fb('0x2c')]);if(_0x294e58[_0x47fb('0x2d')]){delete _0x294e58['name'];}_0x511006['status'](_0x235346)[_0x47fb('0x2e')](_0x294e58);};}exports['index']=function(_0x433d03,_0x599437){var _0x29ddb2={},_0x5befaa={},_0x44b176={'count':0x0,'rows':[]};var _0x537488=_[_0x47fb('0x2f')](db[_0x47fb('0x30')]['rawAttributes'],function(_0x40e87c){return{'name':_0x40e87c[_0x47fb('0x31')],'type':_0x40e87c[_0x47fb('0x32')][_0x47fb('0x33')]};});_0x5befaa[_0x47fb('0x34')]=_['map'](_0x537488,_0x47fb('0x2d'));_0x5befaa[_0x47fb('0x35')]=_['keys'](_0x433d03[_0x47fb('0x35')]);_0x5befaa[_0x47fb('0x36')]=_['intersection'](_0x5befaa[_0x47fb('0x34')],_0x5befaa['query']);_0x29ddb2[_0x47fb('0x37')]=_['intersection'](_0x5befaa[_0x47fb('0x34')],qs[_0x47fb('0x38')](_0x433d03['query'][_0x47fb('0x38')]));_0x29ddb2['attributes']=_0x29ddb2['attributes']['length']?_0x29ddb2[_0x47fb('0x37')]:_0x5befaa['model'];if(!_0x433d03['query']['hasOwnProperty'](_0x47fb('0x39'))){_0x29ddb2[_0x47fb('0x20')]=qs[_0x47fb('0x20')](_0x433d03[_0x47fb('0x35')]['limit']);_0x29ddb2['offset']=qs[_0x47fb('0x1e')](_0x433d03[_0x47fb('0x35')]['offset']);}_0x29ddb2['order']=qs['sort'](_0x433d03[_0x47fb('0x35')][_0x47fb('0x3a')]);delete _0x433d03[_0x47fb('0x35')][_0x47fb('0x3a')];_0x29ddb2[_0x47fb('0x3b')]=qs[_0x47fb('0x36')](_[_0x47fb('0x3c')](_0x433d03['query'],_0x5befaa[_0x47fb('0x36')]),_0x537488);if(_0x433d03['query'][_0x47fb('0x3d')]){_0x29ddb2[_0x47fb('0x3b')]=_[_0x47fb('0x3e')](_0x29ddb2[_0x47fb('0x3b')],{'$or':_['map'](_0x537488,function(_0x3ac16e){if(_0x3ac16e[_0x47fb('0x32')]!==_0x47fb('0x3f')){var _0x26e8b2={};_0x26e8b2[_0x3ac16e['name']]={'$like':'%'+_0x433d03['query']['filter']+'%'};return _0x26e8b2;}})});}_0x29ddb2=_[_0x47fb('0x3e')]({},_0x29ddb2,_0x433d03[_0x47fb('0x40')]);var _0x1ef8e0={'where':_0x29ddb2[_0x47fb('0x3b')]};return db[_0x47fb('0x30')][_0x47fb('0x21')](_0x1ef8e0)['then'](function(_0x378ed2){_0x44b176[_0x47fb('0x21')]=_0x378ed2;if(_0x433d03[_0x47fb('0x35')][_0x47fb('0x41')]){_0x29ddb2[_0x47fb('0x42')]=[{'all':!![]}];}return db[_0x47fb('0x30')][_0x47fb('0x43')](_0x29ddb2);})[_0x47fb('0x28')](function(_0x45cd53){_0x44b176[_0x47fb('0x44')]=_0x45cd53;return _0x44b176;})[_0x47fb('0x28')](respondWithFilteredResult(_0x599437,_0x29ddb2))[_0x47fb('0x45')](handleError(_0x599437,null));};exports['show']=function(_0x2b3330,_0x3ab359){var _0x13c748={'raw':![],'where':{'id':_0x2b3330['params']['id']}},_0x4f5138={};_0x4f5138[_0x47fb('0x34')]=_[_0x47fb('0x46')](db['VoiceMusicOnHold'][_0x47fb('0x47')]);_0x4f5138[_0x47fb('0x35')]=_[_0x47fb('0x46')](_0x2b3330[_0x47fb('0x35')]);_0x4f5138[_0x47fb('0x36')]=_[_0x47fb('0x48')](_0x4f5138[_0x47fb('0x34')],_0x4f5138[_0x47fb('0x35')]);_0x13c748[_0x47fb('0x37')]=_['intersection'](_0x4f5138[_0x47fb('0x34')],qs[_0x47fb('0x38')](_0x2b3330[_0x47fb('0x35')][_0x47fb('0x38')]));_0x13c748[_0x47fb('0x37')]=_0x13c748[_0x47fb('0x37')][_0x47fb('0x49')]?_0x13c748['attributes']:_0x4f5138[_0x47fb('0x34')];if(_0x2b3330['query'][_0x47fb('0x41')]){_0x13c748[_0x47fb('0x42')]=[{'all':!![]}];}_0x13c748=_[_0x47fb('0x3e')]({},_0x13c748,_0x2b3330[_0x47fb('0x40')]);return db[_0x47fb('0x30')][_0x47fb('0x4a')](_0x13c748)[_0x47fb('0x28')](handleEntityNotFound(_0x3ab359,null))[_0x47fb('0x28')](respondWithResult(_0x3ab359,null))['catch'](handleError(_0x3ab359,null));};exports[_0x47fb('0x27')]=function(_0x598743,_0x2bf0f4){if(_0x598743[_0x47fb('0x4b')]['id']){delete _0x598743[_0x47fb('0x4b')]['id'];}return db[_0x47fb('0x30')][_0x47fb('0x4a')]({'where':{'id':_0x598743['params']['id']}})['then'](handleEntityNotFound(_0x2bf0f4,null))[_0x47fb('0x28')](saveUpdates(_0x598743['body'],null))['then'](respondWithResult(_0x2bf0f4,null))[_0x47fb('0x45')](handleError(_0x2bf0f4,null));};exports[_0x47fb('0x4c')]=function(_0x2dbc77,_0x2196e7,_0x4b6f17){return db['sequelize'][_0x47fb('0x4d')](function(_0x15b3d2){if(_0x2dbc77[_0x47fb('0x4b')][_0x47fb('0x4e')]===_0x47fb('0x4f')){_0x2dbc77[_0x47fb('0x4b')][_0x47fb('0x50')]=path[_0x47fb('0x51')](config['root'],_0x47fb('0x52'),_0x2dbc77[_0x47fb('0x4b')][_0x47fb('0x2d')]);}return db['VoiceMusicOnHold']['create'](_0x2dbc77[_0x47fb('0x4b')],{'transaction':_0x15b3d2})[_0x47fb('0x28')](function(_0x1591fa){if(_0x2dbc77[_0x47fb('0x4b')][_0x47fb('0x4e')]===_0x47fb('0x4f')){fs[_0x47fb('0x53')](_0x1591fa['directory'],parseInt(_0x47fb('0x54'),0x8));}var _0x31bd9a=_0x2dbc77[_0x47fb('0x55')]['get']({'plain':!![]});if(!_0x31bd9a)throw new Error(_0x47fb('0x56'));if(_0x31bd9a[_0x47fb('0x57')]===_0x47fb('0x55')){var _0x340ce2=_0x1591fa[_0x47fb('0x58')]({'plain':!![]});return db[_0x47fb('0x59')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x31bd9a['userProfileId']},'raw':!![]})[_0x47fb('0x28')](function(_0x2c6d15){if(_0x2c6d15&&_0x2c6d15[_0x47fb('0x5a')]===0x0){return db[_0x47fb('0x2a')][_0x47fb('0x4c')]({'name':_0x340ce2[_0x47fb('0x2d')],'resourceId':_0x340ce2['id'],'type':_0x2c6d15[_0x47fb('0x2d')],'sectionId':_0x2c6d15['id']},{})['then'](function(){return _0x1591fa;});}else{return _0x1591fa;}})[_0x47fb('0x45')](function(_0x5d081d){logger[_0x47fb('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d081d);});}return _0x1591fa;});})['then'](respondWithResult(_0x2196e7,0xc9))[_0x47fb('0x45')](handleError(_0x2196e7,null));};exports[_0x47fb('0x29')]=function(_0x1c7a0f,_0xea655f,_0xb0479c){var _0x57c8f2;return db[_0x47fb('0x30')][_0x47fb('0x4a')]({'where':{'id':_0x1c7a0f[_0x47fb('0x5b')]['id']}})[_0x47fb('0x28')](function(_0x29ee5b){if(_0x29ee5b){return db['sequelize'][_0x47fb('0x4d')](function(_0x4f1296){return _0x29ee5b['destroy']({'transaction':_0x4f1296,'raw':!![]})['then'](function(_0xf701cf){if(_0xf701cf[_0x47fb('0x50')]){fs[_0x47fb('0x5c')](_0xf701cf['directory'])[_0x47fb('0x5d')](function(_0x3f3e15){fs[_0x47fb('0x5e')](path[_0x47fb('0x51')](_0xf701cf[_0x47fb('0x50')],_0x3f3e15));});fs[_0x47fb('0x5f')](_0xf701cf['directory']);}return _0xf701cf;});})['catch'](function(_0x47653d){throw new db[(_0x47fb('0x60'))][(_0x47fb('0x61'))](_0x47653d[_0x47fb('0x62')]);});}})[_0x47fb('0x28')](handleEntityNotFound(_0xea655f,null))[_0x47fb('0x28')](removeEntity(_0xea655f,null))[_0x47fb('0x45')](handleError(_0xea655f,null));};exports[_0x47fb('0x63')]=function(_0x228ff7,_0x4b773e,_0x5a78b4){return db[_0x47fb('0x64')][_0x47fb('0x4d')](function(_0x4380eb){var _0x2a97ac;return db[_0x47fb('0x30')][_0x47fb('0x4a')]({'where':{'id':_0x228ff7[_0x47fb('0x5b')]['id']}})['then'](function(_0x239b88){if(_0x239b88){_0x2a97ac=_0x239b88;return _0x239b88[_0x47fb('0x63')](_0x228ff7[_0x47fb('0x4b')]['id'],{'transaction':_0x4380eb});}})['then'](function(_0x3c82c2){if(_0x3c82c2){return db[_0x47fb('0x65')]['findOne']({'where':{'id':_0x228ff7[_0x47fb('0x4b')]['id']},'attributes':['id',_0x47fb('0x2d'),_0x47fb('0x66'),'converted_format',_0x47fb('0x67')],'raw':!![]});}})[_0x47fb('0x28')](function(_0x4c3812){if(_0x4c3812){var _0x561338=path[_0x47fb('0x51')](config[_0x47fb('0x68')],_0x47fb('0x69'),util[_0x47fb('0x6a')](_0x47fb('0x6b'),path[_0x47fb('0x6c')](_0x4c3812[_0x47fb('0x66')],path[_0x47fb('0x6d')](_0x4c3812[_0x47fb('0x66')])),_0x4c3812[_0x47fb('0x6e')]));var _0x5b83f9=path['join'](config[_0x47fb('0x68')],_0x47fb('0x52'),_0x2a97ac['name'],util[_0x47fb('0x6a')](_0x47fb('0x6b'),_0x4c3812[_0x47fb('0x2d')],_0x4c3812[_0x47fb('0x6e')]));fs['symlinkSync'](_0x561338,_0x5b83f9);return _0x4c3812;}})[_0x47fb('0x45')](function(_0x3af761){throw new db[(_0x47fb('0x60'))][(_0x47fb('0x61'))](_0x3af761[_0x47fb('0x62')]);});})['then'](handleEntityNotFound(_0x4b773e,null))[_0x47fb('0x28')](respondWithResult(_0x4b773e,0xc9))['catch'](handleError(_0x4b773e,null));};exports[_0x47fb('0x6f')]=function(_0x1ae01b,_0x49ae5c,_0x2655da){return db[_0x47fb('0x64')][_0x47fb('0x4d')](function(_0x58643f){var _0x5efb1d;return db[_0x47fb('0x30')]['findOne']({'where':{'id':_0x1ae01b[_0x47fb('0x5b')]['id']}})[_0x47fb('0x28')](handleEntityNotFound(_0x49ae5c,null))['then'](function(_0x1fcdd5){if(_0x1fcdd5){_0x5efb1d=_0x1fcdd5;return _0x1fcdd5[_0x47fb('0x6f')](_0x1ae01b['params'][_0x47fb('0x70')]);}})['then'](function(_0x15ce7c){if(_0x15ce7c){return db[_0x47fb('0x65')][_0x47fb('0x71')]({'where':{'id':_0x1ae01b[_0x47fb('0x5b')]['id2']},'attributes':['id',_0x47fb('0x2d'),_0x47fb('0x66'),_0x47fb('0x6e'),_0x47fb('0x67')],'raw':!![]});}})[_0x47fb('0x28')](function(_0x21a004){if(_0x21a004){fs['unlinkSync'](path[_0x47fb('0x51')](_0x5efb1d['directory'],util[_0x47fb('0x6a')]('%s.%s',_0x21a004[_0x47fb('0x2d')],_0x21a004[_0x47fb('0x6e')])));return _0x21a004;}})['catch'](function(_0x569866){throw new db[(_0x47fb('0x60'))][(_0x47fb('0x61'))](_0x569866['message']);});})[_0x47fb('0x28')](handleEntityNotFound(_0x49ae5c,null))[_0x47fb('0x28')](respondWithStatusCode(_0x49ae5c,0xcc))[_0x47fb('0x45')](handleError(_0x49ae5c,null));};exports[_0x47fb('0x72')]=function(_0x333df8,_0x3e9059,_0x54bf90){var _0x406530={};var _0x2ae666={};var _0x4069fc;var _0x3ab1e6;return db['VoiceMusicOnHold'][_0x47fb('0x71')]({'where':{'id':_0x333df8[_0x47fb('0x5b')]['id']}})[_0x47fb('0x28')](handleEntityNotFound(_0x3e9059,null))[_0x47fb('0x28')](function(_0x3dcf81){if(_0x3dcf81){_0x4069fc=_0x3dcf81;_0x2ae666[_0x47fb('0x34')]=_[_0x47fb('0x46')](db[_0x47fb('0x65')][_0x47fb('0x47')]);_0x2ae666[_0x47fb('0x35')]=_['keys'](_0x333df8[_0x47fb('0x35')]);_0x2ae666[_0x47fb('0x36')]=_[_0x47fb('0x48')](_0x2ae666[_0x47fb('0x34')],_0x2ae666[_0x47fb('0x35')]);_0x406530[_0x47fb('0x37')]=_['intersection'](_0x2ae666[_0x47fb('0x34')],qs[_0x47fb('0x38')](_0x333df8[_0x47fb('0x35')][_0x47fb('0x38')]));_0x406530[_0x47fb('0x37')]=_0x406530[_0x47fb('0x37')][_0x47fb('0x49')]?_0x406530[_0x47fb('0x37')]:_0x2ae666[_0x47fb('0x34')];_0x406530[_0x47fb('0x73')]=qs[_0x47fb('0x3a')](_0x333df8[_0x47fb('0x35')][_0x47fb('0x3a')]);_0x406530[_0x47fb('0x3b')]=qs[_0x47fb('0x36')](_[_0x47fb('0x3c')](_0x333df8[_0x47fb('0x35')],_0x2ae666[_0x47fb('0x36')]));if(_0x333df8[_0x47fb('0x35')][_0x47fb('0x3d')]){_0x406530[_0x47fb('0x3b')]=_[_0x47fb('0x3e')](_0x406530[_0x47fb('0x3b')],{'$or':_[_0x47fb('0x2f')](_0x406530[_0x47fb('0x37')],function(_0x51404d){var _0x16d88f={};_0x16d88f[_0x51404d]={'$like':'%'+_0x333df8['query'][_0x47fb('0x3d')]+'%'};return _0x16d88f;})});}_0x406530=_['merge']({},_0x406530,_0x333df8[_0x47fb('0x40')]);return _0x4069fc[_0x47fb('0x72')](_0x406530);}})[_0x47fb('0x28')](function(_0x5d68d7){if(_0x5d68d7){_0x3ab1e6=_0x5d68d7[_0x47fb('0x49')];if(!_0x333df8['query'][_0x47fb('0x74')]('nolimit')){_0x406530[_0x47fb('0x20')]=qs['limit'](_0x333df8[_0x47fb('0x35')][_0x47fb('0x20')]);_0x406530[_0x47fb('0x1e')]=qs[_0x47fb('0x1e')](_0x333df8[_0x47fb('0x35')]['offset']);}return _0x4069fc[_0x47fb('0x72')](_0x406530);}})[_0x47fb('0x28')](function(_0x2ae835){if(_0x2ae835){return _0x2ae835?{'count':_0x3ab1e6,'rows':_0x2ae835}:null;}})['then'](respondWithResult(_0x3e9059,null))[_0x47fb('0x45')](handleError(_0x3e9059,null));}; \ No newline at end of file +var _0x2561=['transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','ValidationError','message','addSound','Sound','save_name','createdAt','format','%s.%s','basename','extname','converted_format','symlinkSync','Sequelize','findOne','removeSound','getSounds','length','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','body','params','create'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x2561,0x96));var _0x1256=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2561[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x1256('0x0'));var rimraf=require(_0x1256('0x1'));var zipdir=require(_0x1256('0x2'));var jsonpatch=require(_0x1256('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1256('0x4'));var Mustache=require('mustache');var util=require(_0x1256('0x5'));var path=require('path');var sox=require(_0x1256('0x6'));var csv=require(_0x1256('0x7'));var ejs=require(_0x1256('0x8'));var fs=require('fs');var fs_extra=require(_0x1256('0x9'));var _=require(_0x1256('0xa'));var squel=require(_0x1256('0xb'));var crypto=require(_0x1256('0xc'));var jsforce=require(_0x1256('0xd'));var deskjs=require(_0x1256('0xe'));var toCsv=require(_0x1256('0x7'));var querystring=require('querystring');var Papa=require(_0x1256('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1256('0x10'));var as=require(_0x1256('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1256('0x12'))(_0x1256('0x13'));var utils=require(_0x1256('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1256('0x15'))['db'];function respondWithStatusCode(_0x4ba37c,_0x748339){_0x748339=_0x748339||0xcc;return function(_0x812724){if(_0x812724){return _0x4ba37c[_0x1256('0x16')](_0x748339);}return _0x4ba37c[_0x1256('0x17')](_0x748339)[_0x1256('0x18')]();};}function respondWithResult(_0x4ef6d6,_0x5855c0){_0x5855c0=_0x5855c0||0xc8;return function(_0x15bc96){if(_0x15bc96){return _0x4ef6d6['status'](_0x5855c0)[_0x1256('0x19')](_0x15bc96);}};}function respondWithFilteredResult(_0x55f090,_0xf697cc){return function(_0x37a25e){if(_0x37a25e){var _0x81cabc=typeof _0xf697cc[_0x1256('0x1a')]==='undefined'&&typeof _0xf697cc[_0x1256('0x1b')]===_0x1256('0x1c');var _0x2e0a66=_0x37a25e[_0x1256('0x1d')];var _0x537a71=_0x81cabc?0x0:_0xf697cc[_0x1256('0x1a')];var _0x54ab60=_0x81cabc?_0x37a25e[_0x1256('0x1d')]:_0xf697cc[_0x1256('0x1a')]+_0xf697cc[_0x1256('0x1b')];var _0x150770;if(_0x54ab60>=_0x2e0a66){_0x54ab60=_0x2e0a66;_0x150770=0xc8;}else{_0x150770=0xce;}_0x55f090[_0x1256('0x17')](_0x150770);return _0x55f090['set'](_0x1256('0x1e'),_0x537a71+'-'+_0x54ab60+'/'+_0x2e0a66)[_0x1256('0x19')](_0x37a25e);}return null;};}function patchUpdates(_0x3116c7){return function(_0x4669b7){try{jsonpatch[_0x1256('0x1f')](_0x4669b7,_0x3116c7,!![]);}catch(_0x3ab2c5){return BPromise[_0x1256('0x20')](_0x3ab2c5);}return _0x4669b7[_0x1256('0x21')]();};}function saveUpdates(_0x4d6a55,_0x3f5c4c){return function(_0x5deaff){if(_0x5deaff){return _0x5deaff[_0x1256('0x22')](_0x4d6a55)[_0x1256('0x23')](function(_0x1ce5b6){return _0x1ce5b6;});}return null;};}function removeEntity(_0x3d2d7b,_0x2f54bf){return function(_0x4581fa){if(_0x4581fa){return _0x4581fa[_0x1256('0x24')]()[_0x1256('0x23')](function(){var _0x51e58b=_0x4581fa[_0x1256('0x25')]({'plain':!![]});var _0x565dc0=_0x1256('0x26');return db[_0x1256('0x27')]['destroy']({'where':{'type':_0x565dc0,'resourceId':_0x51e58b['id']}})[_0x1256('0x23')](function(){return _0x4581fa;});})[_0x1256('0x23')](function(){_0x3d2d7b[_0x1256('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c95ea,_0x172e65){return function(_0x143fb9){if(!_0x143fb9){_0x3c95ea[_0x1256('0x16')](0x194);}return _0x143fb9;};}function handleError(_0x3ab789,_0xbd72d0){_0xbd72d0=_0xbd72d0||0x1f4;return function(_0x220d11){logger[_0x1256('0x28')](_0x220d11[_0x1256('0x29')]);if(_0x220d11['name']){delete _0x220d11[_0x1256('0x2a')];}_0x3ab789[_0x1256('0x17')](_0xbd72d0)[_0x1256('0x2b')](_0x220d11);};}exports[_0x1256('0x2c')]=function(_0x4e82e1,_0x1b2880){var _0x30b3ef={},_0x14c721={},_0xd12314={'count':0x0,'rows':[]};var _0x39739a=_[_0x1256('0x2d')](db[_0x1256('0x2e')]['rawAttributes'],function(_0x25e806){return{'name':_0x25e806[_0x1256('0x2f')],'type':_0x25e806[_0x1256('0x30')][_0x1256('0x31')]};});_0x14c721[_0x1256('0x32')]=_['map'](_0x39739a,'name');_0x14c721[_0x1256('0x33')]=_[_0x1256('0x34')](_0x4e82e1[_0x1256('0x33')]);_0x14c721['filters']=_[_0x1256('0x35')](_0x14c721['model'],_0x14c721[_0x1256('0x33')]);_0x30b3ef[_0x1256('0x36')]=_[_0x1256('0x35')](_0x14c721[_0x1256('0x32')],qs['fields'](_0x4e82e1[_0x1256('0x33')][_0x1256('0x37')]));_0x30b3ef[_0x1256('0x36')]=_0x30b3ef[_0x1256('0x36')]['length']?_0x30b3ef[_0x1256('0x36')]:_0x14c721['model'];if(!_0x4e82e1[_0x1256('0x33')][_0x1256('0x38')]('nolimit')){_0x30b3ef[_0x1256('0x1b')]=qs[_0x1256('0x1b')](_0x4e82e1[_0x1256('0x33')]['limit']);_0x30b3ef[_0x1256('0x1a')]=qs['offset'](_0x4e82e1[_0x1256('0x33')][_0x1256('0x1a')]);}_0x30b3ef['order']=qs[_0x1256('0x39')](_0x4e82e1[_0x1256('0x33')][_0x1256('0x39')]);delete _0x4e82e1[_0x1256('0x33')][_0x1256('0x39')];_0x30b3ef[_0x1256('0x3a')]=qs['filters'](_[_0x1256('0x3b')](_0x4e82e1[_0x1256('0x33')],_0x14c721[_0x1256('0x3c')]),_0x39739a);if(_0x4e82e1[_0x1256('0x33')][_0x1256('0x3d')]){_0x30b3ef[_0x1256('0x3a')]=_[_0x1256('0x3e')](_0x30b3ef[_0x1256('0x3a')],{'$or':_[_0x1256('0x2d')](_0x39739a,function(_0x342766){if(_0x342766[_0x1256('0x30')]!==_0x1256('0x3f')){var _0x4b1f9a={};_0x4b1f9a[_0x342766[_0x1256('0x2a')]]={'$like':'%'+_0x4e82e1['query']['filter']+'%'};return _0x4b1f9a;}})});}_0x30b3ef=_[_0x1256('0x3e')]({},_0x30b3ef,_0x4e82e1['options']);var _0x308d33={'where':_0x30b3ef[_0x1256('0x3a')]};return db[_0x1256('0x2e')][_0x1256('0x1d')](_0x308d33)[_0x1256('0x23')](function(_0x166c5e){_0xd12314[_0x1256('0x1d')]=_0x166c5e;if(_0x4e82e1[_0x1256('0x33')][_0x1256('0x40')]){_0x30b3ef[_0x1256('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x1256('0x42')](_0x30b3ef);})[_0x1256('0x23')](function(_0x24dd4f){_0xd12314[_0x1256('0x43')]=_0x24dd4f;return _0xd12314;})[_0x1256('0x23')](respondWithFilteredResult(_0x1b2880,_0x30b3ef))[_0x1256('0x44')](handleError(_0x1b2880,null));};exports[_0x1256('0x45')]=function(_0x36d07e,_0x11463d){var _0x54b4e1={'raw':![],'where':{'id':_0x36d07e['params']['id']}},_0xda7172={};_0xda7172['model']=_[_0x1256('0x34')](db['VoiceMusicOnHold'][_0x1256('0x46')]);_0xda7172[_0x1256('0x33')]=_[_0x1256('0x34')](_0x36d07e[_0x1256('0x33')]);_0xda7172[_0x1256('0x3c')]=_[_0x1256('0x35')](_0xda7172[_0x1256('0x32')],_0xda7172[_0x1256('0x33')]);_0x54b4e1['attributes']=_[_0x1256('0x35')](_0xda7172[_0x1256('0x32')],qs[_0x1256('0x37')](_0x36d07e[_0x1256('0x33')]['fields']));_0x54b4e1[_0x1256('0x36')]=_0x54b4e1[_0x1256('0x36')]['length']?_0x54b4e1['attributes']:_0xda7172[_0x1256('0x32')];if(_0x36d07e[_0x1256('0x33')][_0x1256('0x40')]){_0x54b4e1[_0x1256('0x41')]=[{'all':!![]}];}_0x54b4e1=_['merge']({},_0x54b4e1,_0x36d07e[_0x1256('0x47')]);return db[_0x1256('0x2e')][_0x1256('0x48')](_0x54b4e1)['then'](handleEntityNotFound(_0x11463d,null))['then'](respondWithResult(_0x11463d,null))[_0x1256('0x44')](handleError(_0x11463d,null));};exports[_0x1256('0x22')]=function(_0x1b8713,_0x9d40b8){if(_0x1b8713[_0x1256('0x49')]['id']){delete _0x1b8713[_0x1256('0x49')]['id'];}return db[_0x1256('0x2e')][_0x1256('0x48')]({'where':{'id':_0x1b8713[_0x1256('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9d40b8,null))['then'](saveUpdates(_0x1b8713[_0x1256('0x49')],null))['then'](respondWithResult(_0x9d40b8,null))[_0x1256('0x44')](handleError(_0x9d40b8,null));};exports[_0x1256('0x4b')]=function(_0x40eb38,_0x279503,_0x502761){return db['sequelize'][_0x1256('0x4c')](function(_0x2b6009){if(_0x40eb38[_0x1256('0x49')][_0x1256('0x4d')]===_0x1256('0x4e')){_0x40eb38[_0x1256('0x49')][_0x1256('0x4f')]=path[_0x1256('0x50')](config[_0x1256('0x51')],_0x1256('0x52'),_0x40eb38[_0x1256('0x49')]['name']);}return db[_0x1256('0x2e')][_0x1256('0x4b')](_0x40eb38[_0x1256('0x49')],{'transaction':_0x2b6009})[_0x1256('0x23')](function(_0xe29086){if(_0x40eb38[_0x1256('0x49')][_0x1256('0x4d')]===_0x1256('0x4e')){fs[_0x1256('0x53')](_0xe29086[_0x1256('0x4f')],parseInt(_0x1256('0x54'),0x8));}var _0x27d76=_0x40eb38[_0x1256('0x55')]['get']({'plain':!![]});if(!_0x27d76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27d76[_0x1256('0x56')]==='user'){var _0x155934=_0xe29086[_0x1256('0x25')]({'plain':!![]});return db[_0x1256('0x57')][_0x1256('0x48')]({'where':{'name':_0x1256('0x26'),'userProfileId':_0x27d76[_0x1256('0x58')]},'raw':!![]})[_0x1256('0x23')](function(_0x52578b){if(_0x52578b&&_0x52578b[_0x1256('0x59')]===0x0){return db[_0x1256('0x27')][_0x1256('0x4b')]({'name':_0x155934[_0x1256('0x2a')],'resourceId':_0x155934['id'],'type':_0x52578b[_0x1256('0x2a')],'sectionId':_0x52578b['id']},{})['then'](function(){return _0xe29086;});}else{return _0xe29086;}})['catch'](function(_0x6c0b00){logger[_0x1256('0x28')](_0x1256('0x5a'),_0x6c0b00);});}return _0xe29086;});})[_0x1256('0x23')](respondWithResult(_0x279503,0xc9))[_0x1256('0x44')](handleError(_0x279503,null));};exports['destroy']=function(_0x29a335,_0x623f38,_0x1fe005){var _0x4c72c6;return db[_0x1256('0x2e')]['find']({'where':{'id':_0x29a335[_0x1256('0x4a')]['id']}})['then'](function(_0x34a32a){if(_0x34a32a){return db[_0x1256('0x5b')][_0x1256('0x4c')](function(_0x30f5e4){return _0x34a32a[_0x1256('0x24')]({'transaction':_0x30f5e4,'raw':!![]})[_0x1256('0x23')](function(_0x170f06){if(_0x170f06[_0x1256('0x4f')]){fs[_0x1256('0x5c')](_0x170f06['directory'])[_0x1256('0x5d')](function(_0x41a3ce){fs['unlinkSync'](path[_0x1256('0x50')](_0x170f06[_0x1256('0x4f')],_0x41a3ce));});fs['rmdirSync'](_0x170f06['directory']);}return _0x170f06;});})['catch'](function(_0x23893f){throw new db['Sequelize'][(_0x1256('0x5e'))](_0x23893f[_0x1256('0x5f')]);});}})[_0x1256('0x23')](handleEntityNotFound(_0x623f38,null))[_0x1256('0x23')](removeEntity(_0x623f38,null))[_0x1256('0x44')](handleError(_0x623f38,null));};exports[_0x1256('0x60')]=function(_0xc5515c,_0xfef8a6,_0x36971e){return db['sequelize']['transaction'](function(_0x4b05ca){var _0x4e3a0f;return db['VoiceMusicOnHold']['find']({'where':{'id':_0xc5515c[_0x1256('0x4a')]['id']}})[_0x1256('0x23')](function(_0x587da2){if(_0x587da2){_0x4e3a0f=_0x587da2;return _0x587da2[_0x1256('0x60')](_0xc5515c[_0x1256('0x49')]['id'],{'transaction':_0x4b05ca});}})[_0x1256('0x23')](function(_0x93d842){if(_0x93d842){return db[_0x1256('0x61')]['findOne']({'where':{'id':_0xc5515c['body']['id']},'attributes':['id',_0x1256('0x2a'),_0x1256('0x62'),'converted_format',_0x1256('0x63')],'raw':!![]});}})['then'](function(_0x44f6e4){if(_0x44f6e4){var _0x48195b=path[_0x1256('0x50')](config['root'],'server/files/sounds/converted',util[_0x1256('0x64')](_0x1256('0x65'),path[_0x1256('0x66')](_0x44f6e4[_0x1256('0x62')],path[_0x1256('0x67')](_0x44f6e4[_0x1256('0x62')])),_0x44f6e4[_0x1256('0x68')]));var _0x1ee8e0=path['join'](config[_0x1256('0x51')],'server/files/moh',_0x4e3a0f[_0x1256('0x2a')],util[_0x1256('0x64')](_0x1256('0x65'),_0x44f6e4[_0x1256('0x2a')],_0x44f6e4['converted_format']));fs[_0x1256('0x69')](_0x48195b,_0x1ee8e0);return _0x44f6e4;}})['catch'](function(_0x42dc68){throw new db[(_0x1256('0x6a'))]['ValidationError'](_0x42dc68[_0x1256('0x5f')]);});})[_0x1256('0x23')](handleEntityNotFound(_0xfef8a6,null))[_0x1256('0x23')](respondWithResult(_0xfef8a6,0xc9))[_0x1256('0x44')](handleError(_0xfef8a6,null));};exports['removeSound']=function(_0x49ed55,_0x45af7c,_0x1468d8){return db[_0x1256('0x5b')][_0x1256('0x4c')](function(_0x5c6c1e){var _0x58fc6d;return db[_0x1256('0x2e')][_0x1256('0x6b')]({'where':{'id':_0x49ed55[_0x1256('0x4a')]['id']}})[_0x1256('0x23')](handleEntityNotFound(_0x45af7c,null))[_0x1256('0x23')](function(_0x30bbda){if(_0x30bbda){_0x58fc6d=_0x30bbda;return _0x30bbda[_0x1256('0x6c')](_0x49ed55['params']['id2']);}})['then'](function(_0x3f52ec){if(_0x3f52ec){return db['Sound'][_0x1256('0x6b')]({'where':{'id':_0x49ed55['params']['id2']},'attributes':['id',_0x1256('0x2a'),'save_name',_0x1256('0x68'),_0x1256('0x63')],'raw':!![]});}})['then'](function(_0x541d90){if(_0x541d90){fs['unlinkSync'](path[_0x1256('0x50')](_0x58fc6d[_0x1256('0x4f')],util['format'](_0x1256('0x65'),_0x541d90[_0x1256('0x2a')],_0x541d90[_0x1256('0x68')])));return _0x541d90;}})[_0x1256('0x44')](function(_0x2c4e62){throw new db[(_0x1256('0x6a'))][(_0x1256('0x5e'))](_0x2c4e62['message']);});})[_0x1256('0x23')](handleEntityNotFound(_0x45af7c,null))[_0x1256('0x23')](respondWithStatusCode(_0x45af7c,0xcc))[_0x1256('0x44')](handleError(_0x45af7c,null));};exports[_0x1256('0x6d')]=function(_0x24e979,_0x3e1ca0,_0x45623e){var _0x182af0={};var _0x28fe83={};var _0x3c7154;var _0x542b61;return db[_0x1256('0x2e')][_0x1256('0x6b')]({'where':{'id':_0x24e979[_0x1256('0x4a')]['id']}})[_0x1256('0x23')](handleEntityNotFound(_0x3e1ca0,null))['then'](function(_0x1e6d51){if(_0x1e6d51){_0x3c7154=_0x1e6d51;_0x28fe83[_0x1256('0x32')]=_[_0x1256('0x34')](db['Sound'][_0x1256('0x46')]);_0x28fe83[_0x1256('0x33')]=_['keys'](_0x24e979[_0x1256('0x33')]);_0x28fe83[_0x1256('0x3c')]=_['intersection'](_0x28fe83['model'],_0x28fe83[_0x1256('0x33')]);_0x182af0[_0x1256('0x36')]=_[_0x1256('0x35')](_0x28fe83['model'],qs[_0x1256('0x37')](_0x24e979[_0x1256('0x33')]['fields']));_0x182af0[_0x1256('0x36')]=_0x182af0[_0x1256('0x36')][_0x1256('0x6e')]?_0x182af0['attributes']:_0x28fe83['model'];_0x182af0[_0x1256('0x6f')]=qs[_0x1256('0x39')](_0x24e979[_0x1256('0x33')][_0x1256('0x39')]);_0x182af0[_0x1256('0x3a')]=qs[_0x1256('0x3c')](_[_0x1256('0x3b')](_0x24e979[_0x1256('0x33')],_0x28fe83[_0x1256('0x3c')]));if(_0x24e979[_0x1256('0x33')]['filter']){_0x182af0[_0x1256('0x3a')]=_['merge'](_0x182af0[_0x1256('0x3a')],{'$or':_[_0x1256('0x2d')](_0x182af0[_0x1256('0x36')],function(_0x2d2383){var _0x3c349d={};_0x3c349d[_0x2d2383]={'$like':'%'+_0x24e979[_0x1256('0x33')]['filter']+'%'};return _0x3c349d;})});}_0x182af0=_['merge']({},_0x182af0,_0x24e979[_0x1256('0x47')]);return _0x3c7154['getSounds'](_0x182af0);}})[_0x1256('0x23')](function(_0x29311f){if(_0x29311f){_0x542b61=_0x29311f[_0x1256('0x6e')];if(!_0x24e979[_0x1256('0x33')]['hasOwnProperty'](_0x1256('0x70'))){_0x182af0[_0x1256('0x1b')]=qs[_0x1256('0x1b')](_0x24e979['query'][_0x1256('0x1b')]);_0x182af0[_0x1256('0x1a')]=qs[_0x1256('0x1a')](_0x24e979[_0x1256('0x33')][_0x1256('0x1a')]);}return _0x3c7154['getSounds'](_0x182af0);}})[_0x1256('0x23')](function(_0xc66651){if(_0xc66651){return _0xc66651?{'count':_0x542b61,'rows':_0xc66651}:null;}})['then'](respondWithResult(_0x3e1ca0,null))[_0x1256('0x44')](handleError(_0x3e1ca0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 6342af9..bd5298d 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 _0xf75f=['voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x21683b,_0x357425){var _0x5ca87e=function(_0xfa5359){while(--_0xfa5359){_0x21683b['push'](_0x21683b['shift']());}};_0x5ca87e(++_0x357425);}(_0xf75f,0x1ef));var _0xff75=function(_0x5b10d5,_0x34502f){_0x5b10d5=_0x5b10d5-0x0;var _0x326348=_0xf75f[_0x5b10d5];return _0x326348;};'use strict';var _=require(_0xff75('0x0'));var util=require('util');var logger=require(_0xff75('0x1'))(_0xff75('0x2'));var moment=require(_0xff75('0x3'));var BPromise=require(_0xff75('0x4'));var rp=require(_0xff75('0x5'));var fs=require('fs');var path=require(_0xff75('0x6'));var rimraf=require(_0xff75('0x7'));var config=require('../../config/environment');var attributes=require(_0xff75('0x8'));module[_0xff75('0x9')]=function(_0x59ae1b,_0x1a8203){return _0x59ae1b[_0xff75('0xa')](_0xff75('0xb'),attributes,{'tableName':_0xff75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe500=['request-promise','rimraf','../../config/environment','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment'];(function(_0x3cbda0,_0x289456){var _0x36acb2=function(_0x1181c1){while(--_0x1181c1){_0x3cbda0['push'](_0x3cbda0['shift']());}};_0x36acb2(++_0x289456);}(_0xe500,0x67));var _0x0e50=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0xe500[_0x4b2b03];return _0x1bf0ed;};'use strict';var _=require(_0x0e50('0x0'));var util=require(_0x0e50('0x1'));var logger=require(_0x0e50('0x2'))(_0x0e50('0x3'));var moment=require(_0x0e50('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e50('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e50('0x6'));var config=require(_0x0e50('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x2f60ab,_0x245dfb){return _0x2f60ab['define'](_0x0e50('0x8'),attributes,{'tableName':'voice_musiconhold','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 4a17f05..7214181 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x8db28a,_0x21b680){var _0x309227=function(_0x57fb27){while(--_0x57fb27){_0x8db28a['push'](_0x8db28a['shift']());}};_0x309227(++_0x21b680);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xcb91[_0x104e21];return _0x605b37;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x2b478c,_0xf4a488){var _0x54187c=function(_0x44ecc6){while(--_0x44ecc6){_0x2b478c['push'](_0x2b478c['shift']());}};_0x54187c(++_0xf4a488);}(_0xedd9,0xfc));var _0x9edd=function(_0x490a99,_0x385d34){_0x490a99=_0x490a99-0x0;var _0x5b6a4e=_0xedd9[_0x490a99];return _0x5b6a4e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 42d2d27..b6f9af5 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 _0x1134=['show','getAgents','/:id/teams','getTeams','post','create','put','destroy','delete','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1134,0x19c));var _0x4113=function(_0x97421b,_0x2ebb2e){_0x97421b=_0x97421b-0x0;var _0x1f7cf2=_0x1134[_0x97421b];return _0x1f7cf2;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var fs_extra=require(_0x4113('0x4'));var auth=require(_0x4113('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4113('0x6'));var controller=require('./voicePrefix.controller');router[_0x4113('0x7')]('/',auth['isAuthenticated'](),controller[_0x4113('0x8')]);router['get'](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0xb')]);router[_0x4113('0x7')](_0x4113('0xc'),auth[_0x4113('0xa')](),controller[_0x4113('0xd')]);router[_0x4113('0x7')]('/:id/users',auth[_0x4113('0xa')](),controller[_0x4113('0xe')]);router[_0x4113('0x7')](_0x4113('0xf'),auth[_0x4113('0xa')](),controller[_0x4113('0x10')]);router[_0x4113('0x11')]('/',auth[_0x4113('0xa')](),controller[_0x4113('0x12')]);router[_0x4113('0x11')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x4113('0x11')](_0x4113('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4113('0x13')]('/:id',auth[_0x4113('0xa')](),controller['update']);router['delete'](_0x4113('0xc'),auth[_0x4113('0xa')](),controller[_0x4113('0x14')]);router[_0x4113('0x15')](_0x4113('0x16'),auth[_0x4113('0xa')](),controller[_0x4113('0x17')]);router[_0x4113('0x15')](_0x4113('0xf'),auth[_0x4113('0xa')](),controller['removeTeams']);module[_0x4113('0x18')]=router; \ No newline at end of file +var _0xd846=['Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/users','getTeams','post','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeAgents','removeTeams','multer','util','path'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0xd846,0x195));var _0x6d84=function(_0x2f63fe,_0x1b5a27){_0x2f63fe=_0x2f63fe-0x0;var _0x6613f9=_0xd846[_0x2f63fe];return _0x6613f9;};'use strict';var multer=require(_0x6d84('0x0'));var util=require(_0x6d84('0x1'));var path=require(_0x6d84('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6d84('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d84('0x4'));var config=require(_0x6d84('0x5'));var controller=require('./voicePrefix.controller');router[_0x6d84('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d84('0x6')](_0x6d84('0x7'),auth[_0x6d84('0x8')](),controller[_0x6d84('0x9')]);router[_0x6d84('0x6')](_0x6d84('0xa'),auth[_0x6d84('0x8')](),controller[_0x6d84('0xb')]);router[_0x6d84('0x6')](_0x6d84('0xc'),auth[_0x6d84('0x8')](),controller['getAgents']);router[_0x6d84('0x6')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6d84('0xd')]);router[_0x6d84('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6d84('0xe')](_0x6d84('0xc'),auth[_0x6d84('0x8')](),controller[_0x6d84('0xf')]);router[_0x6d84('0xe')](_0x6d84('0x10'),auth[_0x6d84('0x8')](),controller[_0x6d84('0x11')]);router[_0x6d84('0x12')](_0x6d84('0xa'),auth[_0x6d84('0x8')](),controller[_0x6d84('0x13')]);router[_0x6d84('0x14')]('/:id',auth[_0x6d84('0x8')](),controller[_0x6d84('0x15')]);router['delete'](_0x6d84('0xc'),auth[_0x6d84('0x8')](),controller[_0x6d84('0x16')]);router[_0x6d84('0x14')](_0x6d84('0x10'),auth[_0x6d84('0x8')](),controller[_0x6d84('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 90ea8a9..07f2e8d 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 _0x8451=['STRING','VIRTUAL','system-','name','sequelize','exports'];(function(_0x41dabf,_0x4fc101){var _0x2426d1=function(_0x3dfee3){while(--_0x3dfee3){_0x41dabf['push'](_0x41dabf['shift']());}};_0x2426d1(++_0x4fc101);}(_0x8451,0x100));var _0x1845=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x8451[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x1845('0x0'));module[_0x1845('0x1')]={'name':{'type':Sequelize[_0x1845('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x1845('0x3')],'get':function(_0x523968){return _0x1845('0x4')+this['getDataValue'](_0x1845('0x5'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x1845('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x078e=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x28a940,_0x2e1581){var _0x4f7d3e=function(_0x1c13ee){while(--_0x1c13ee){_0x28a940['push'](_0x28a940['shift']());}};_0x4f7d3e(++_0x2e1581);}(_0x078e,0x182));var _0xe078=function(_0x38a651,_0x1698c2){_0x38a651=_0x38a651-0x0;var _0x1c2095=_0x078e[_0x38a651];return _0x1c2095;};'use strict';var Sequelize=require(_0xe078('0x0'));module[_0xe078('0x1')]={'name':{'type':Sequelize[_0xe078('0x2')],'allowNull':![],'unique':_0xe078('0x3')},'prefix':{'type':Sequelize[_0xe078('0x4')],'get':function(_0xdf35a9){return _0xe078('0x5')+this[_0xe078('0x6')](_0xe078('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xe078('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xe078('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 6e8276e..9cdecbd 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 _0x757a=['create','transaction','VoiceExtension','VoiceExtensionId','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','context','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','${EXTEN:','charAt','update','body','system-','sequelize','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','find','destroy','params','describe'];(function(_0x4e81a6,_0x55dee5){var _0x36cade=function(_0x24fb52){while(--_0x24fb52){_0x4e81a6['push'](_0x4e81a6['shift']());}};_0x36cade(++_0x55dee5);}(_0x757a,0xde));var _0xa757=function(_0x41548e,_0x1c582c){_0x41548e=_0x41548e-0x0;var _0x4cf99e=_0x757a[_0x41548e];return _0x4cf99e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa757('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa757('0x16'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xa757('0x17')](socket);function respondWithStatusCode(_0x1b670e,_0x355f0a){_0x355f0a=_0x355f0a||0xcc;return function(_0x4a0c38){if(_0x4a0c38){return _0x1b670e[_0xa757('0x18')](_0x355f0a);}return _0x1b670e[_0xa757('0x19')](_0x355f0a)[_0xa757('0x1a')]();};}function respondWithResult(_0x2f7947,_0x185011){_0x185011=_0x185011||0xc8;return function(_0x3df1f9){if(_0x3df1f9){return _0x2f7947['status'](_0x185011)[_0xa757('0x1b')](_0x3df1f9);}};}function respondWithFilteredResult(_0x44eab8,_0xde8248){return function(_0x4d9f58){if(_0x4d9f58){var _0x54b305=typeof _0xde8248[_0xa757('0x1c')]===_0xa757('0x1d')&&typeof _0xde8248[_0xa757('0x1e')]===_0xa757('0x1d');var _0x27f4ba=_0x4d9f58[_0xa757('0x1f')];var _0x4bd137=_0x54b305?0x0:_0xde8248[_0xa757('0x1c')];var _0x4fec52=_0x54b305?_0x4d9f58[_0xa757('0x1f')]:_0xde8248[_0xa757('0x1c')]+_0xde8248[_0xa757('0x1e')];var _0x2c9ec6;if(_0x4fec52>=_0x27f4ba){_0x4fec52=_0x27f4ba;_0x2c9ec6=0xc8;}else{_0x2c9ec6=0xce;}_0x44eab8['status'](_0x2c9ec6);return _0x44eab8['set'](_0xa757('0x20'),_0x4bd137+'-'+_0x4fec52+'/'+_0x27f4ba)[_0xa757('0x1b')](_0x4d9f58);}return null;};}function patchUpdates(_0x2ba923){return function(_0x8d121f){try{jsonpatch[_0xa757('0x21')](_0x8d121f,_0x2ba923,!![]);}catch(_0x40562f){return BPromise[_0xa757('0x22')](_0x40562f);}return _0x8d121f[_0xa757('0x23')]();};}function saveUpdates(_0x2bf276,_0x59fae6){return function(_0x3707c1){if(_0x3707c1){return _0x3707c1['update'](_0x2bf276)[_0xa757('0x24')](function(_0x47903b){return _0x47903b;});}return null;};}function removeEntity(_0x40551d,_0x3859ce){return function(_0x37c7e6){if(_0x37c7e6){return _0x37c7e6['destroy']()[_0xa757('0x24')](function(){var _0xcd98bd=_0x37c7e6[_0xa757('0x25')]({'plain':!![]});var _0x3bf7f3='VoicePrefixes';return db[_0xa757('0x26')]['destroy']({'where':{'type':_0x3bf7f3,'resourceId':_0xcd98bd['id']}})['then'](function(){return _0x37c7e6;});})['then'](function(){_0x40551d['status'](0xcc)[_0xa757('0x1a')]();});}};}function handleEntityNotFound(_0x596ae2,_0x2208f9){return function(_0x3bc24c){if(!_0x3bc24c){_0x596ae2['sendStatus'](0x194);}return _0x3bc24c;};}function handleError(_0x2a0c9a,_0x5119ad){_0x5119ad=_0x5119ad||0x1f4;return function(_0x2c4823){logger[_0xa757('0x27')](_0x2c4823['stack']);if(_0x2c4823[_0xa757('0x28')]){delete _0x2c4823['name'];}_0x2a0c9a[_0xa757('0x19')](_0x5119ad)[_0xa757('0x29')](_0x2c4823);};}exports[_0xa757('0x2a')]=function(_0x300dc4,_0xcc87c0){var _0x2c1885={},_0x1a44a9={},_0x2220df={'count':0x0,'rows':[]};var _0x112282=_[_0xa757('0x2b')](db[_0xa757('0x2c')][_0xa757('0x2d')],function(_0x25dfbb){return{'name':_0x25dfbb[_0xa757('0x2e')],'type':_0x25dfbb[_0xa757('0x2f')][_0xa757('0x30')]};});_0x1a44a9[_0xa757('0x31')]=_[_0xa757('0x2b')](_0x112282,_0xa757('0x28'));_0x1a44a9[_0xa757('0x32')]=_[_0xa757('0x33')](_0x300dc4[_0xa757('0x32')]);_0x1a44a9[_0xa757('0x34')]=_[_0xa757('0x35')](_0x1a44a9['model'],_0x1a44a9[_0xa757('0x32')]);_0x2c1885[_0xa757('0x36')]=_[_0xa757('0x35')](_0x1a44a9[_0xa757('0x31')],qs[_0xa757('0x37')](_0x300dc4['query'][_0xa757('0x37')]));_0x2c1885[_0xa757('0x36')]=_0x2c1885[_0xa757('0x36')][_0xa757('0x38')]?_0x2c1885[_0xa757('0x36')]:_0x1a44a9[_0xa757('0x31')];if(!_0x300dc4['query'][_0xa757('0x39')](_0xa757('0x3a'))){_0x2c1885[_0xa757('0x1e')]=qs[_0xa757('0x1e')](_0x300dc4[_0xa757('0x32')][_0xa757('0x1e')]);_0x2c1885[_0xa757('0x1c')]=qs[_0xa757('0x1c')](_0x300dc4[_0xa757('0x32')]['offset']);}_0x2c1885[_0xa757('0x3b')]=qs[_0xa757('0x3c')](_0x300dc4[_0xa757('0x32')][_0xa757('0x3c')]);_0x2c1885[_0xa757('0x3d')]=qs[_0xa757('0x34')](_['pick'](_0x300dc4[_0xa757('0x32')],_0x1a44a9[_0xa757('0x34')]),_0x112282);if(_0x300dc4['query']['filter']){_0x2c1885[_0xa757('0x3d')]=_[_0xa757('0x3e')](_0x2c1885['where'],{'$or':_['map'](_0x112282,function(_0xcff7c4){if(_0xcff7c4[_0xa757('0x2f')]!==_0xa757('0x3f')){var _0x59d699={};_0x59d699[_0xcff7c4[_0xa757('0x28')]]={'$like':'%'+_0x300dc4[_0xa757('0x32')][_0xa757('0x40')]+'%'};return _0x59d699;}})});}_0x2c1885=_[_0xa757('0x3e')]({},_0x2c1885,_0x300dc4[_0xa757('0x41')]);var _0x4c6639={'where':_0x2c1885[_0xa757('0x3d')]};return db['VoicePrefix']['count'](_0x4c6639)[_0xa757('0x24')](function(_0x57298b){_0x2220df[_0xa757('0x1f')]=_0x57298b;if(_0x300dc4[_0xa757('0x32')][_0xa757('0x42')]){_0x2c1885['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xa757('0x43')](_0x2c1885);})[_0xa757('0x24')](function(_0x2b171c){_0x2220df[_0xa757('0x44')]=_0x2b171c;return _0x2220df;})[_0xa757('0x24')](respondWithFilteredResult(_0xcc87c0,_0x2c1885))[_0xa757('0x45')](handleError(_0xcc87c0,null));};exports['show']=function(_0xd61628,_0x364998){var _0x4d66d4={'raw':![],'where':{'id':_0xd61628['params']['id']}},_0x40e291={};_0x40e291[_0xa757('0x31')]=_[_0xa757('0x33')](db['VoicePrefix'][_0xa757('0x2d')]);_0x40e291[_0xa757('0x32')]=_['keys'](_0xd61628[_0xa757('0x32')]);_0x40e291[_0xa757('0x34')]=_[_0xa757('0x35')](_0x40e291[_0xa757('0x31')],_0x40e291['query']);_0x4d66d4[_0xa757('0x36')]=_[_0xa757('0x35')](_0x40e291[_0xa757('0x31')],qs[_0xa757('0x37')](_0xd61628['query'][_0xa757('0x37')]));_0x4d66d4['attributes']=_0x4d66d4['attributes'][_0xa757('0x38')]?_0x4d66d4[_0xa757('0x36')]:_0x40e291[_0xa757('0x31')];if(_0xd61628['query'][_0xa757('0x42')]){_0x4d66d4['include']=[{'all':!![]}];}_0x4d66d4=_[_0xa757('0x3e')]({},_0x4d66d4,_0xd61628[_0xa757('0x41')]);return db[_0xa757('0x2c')][_0xa757('0x46')](_0x4d66d4)[_0xa757('0x24')](handleEntityNotFound(_0x364998,null))[_0xa757('0x24')](respondWithResult(_0x364998,null))[_0xa757('0x45')](handleError(_0x364998,null));};exports[_0xa757('0x47')]=function(_0x581e95,_0x2de226){return db[_0xa757('0x2c')][_0xa757('0x46')]({'where':{'id':_0x581e95[_0xa757('0x48')]['id']}})[_0xa757('0x24')](handleEntityNotFound(_0x2de226,null))[_0xa757('0x24')](removeEntity(_0x2de226,null))[_0xa757('0x45')](handleError(_0x2de226,null));};exports[_0xa757('0x49')]=function(_0x405397,_0x1d05d7){return db[_0xa757('0x2c')][_0xa757('0x49')]()[_0xa757('0x24')](respondWithResult(_0x1d05d7,null))[_0xa757('0x45')](handleError(_0x1d05d7,null));};exports[_0xa757('0x4a')]=function(_0x23caca,_0x492e7e){var _0x3b5116;return db['sequelize'][_0xa757('0x4b')](function(_0x311c25){return db[_0xa757('0x2c')][_0xa757('0x4a')](_0x23caca['body'],{'transaction':_0x311c25})[_0xa757('0x24')](function(_0x1ee01e){_0x3b5116=_0x1ee01e[_0xa757('0x25')]({'plain':!![]});return db[_0xa757('0x4c')]['find']({'where':{'id':_0x3b5116[_0xa757('0x4d')]},'raw':!![]})[_0xa757('0x24')](function(_0x216b32){return createVoicePrefixExtensions(_0x3b5116,_0x216b32,_0x311c25);});});})[_0xa757('0x24')](function(){var _0x33666d=_0x23caca[_0xa757('0x4e')]['get']({'plain':!![]});if(!_0x33666d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33666d['role']==='user'){var _0x1d8742=_0x3b5116;return db[_0xa757('0x4f')][_0xa757('0x46')]({'where':{'name':_0xa757('0x50'),'userProfileId':_0x33666d[_0xa757('0x51')]},'raw':!![]})[_0xa757('0x24')](function(_0x5efb32){if(_0x5efb32&&_0x5efb32[_0xa757('0x52')]===0x0){return db[_0xa757('0x26')][_0xa757('0x4a')]({'name':_0x1d8742[_0xa757('0x28')],'resourceId':_0x1d8742['id'],'type':_0x5efb32['name'],'sectionId':_0x5efb32['id']},{})[_0xa757('0x24')](function(){return _0x3b5116;});}else{return _0x3b5116;}})[_0xa757('0x45')](function(_0x4af840){logger[_0xa757('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4af840);throw _0x4af840;});}return _0x3b5116;})[_0xa757('0x24')](respondWithResult(_0x492e7e,null))['catch'](handleError(_0x492e7e,null));};function Extension(_0x51be6e,_0x58633a,_0x4badee,_0x367b48){this[_0xa757('0x53')]=_0xa757('0x54');this[_0xa757('0x55')]=_0x51be6e;this[_0xa757('0x56')]=_0x4badee;this[_0xa757('0x2f')]='system';this['description']=_0xa757('0x57');this[_0xa757('0x58')]=_0x58633a;this[_0xa757('0x59')]=_0x367b48;}function createVoicePrefixExtensions(_0x4a5ad5,_0x55a7d2,_0x18dff7){return new BPromise(function(_0x31c4cd,_0x215a80){var _0x504c4f=new Extension(formatPrefixName(_0x4a5ad5[_0xa757('0x5a')]),0x1,_0xa757('0x5b'),'Voice\x20Prefix');_0x504c4f[_0xa757('0x5c')]=_0x4a5ad5['id'];return db[_0xa757('0x4c')][_0xa757('0x4a')](_0x504c4f,{'transaction':_0x18dff7})[_0xa757('0x24')](function(_0x1291df){var _0xfbcb43=_0x1291df[_0xa757('0x25')]({'plain':!![]});var _0x13dd81=_[_0xa757('0x2b')](addVoicePrefixExtensions(_0x4a5ad5,_0x55a7d2),function(_0x3b1bb8){_0x3b1bb8['VoiceExtensionId']=_0xfbcb43['id'];_0x3b1bb8[_0xa757('0x5c')]=_0x4a5ad5['id'];return _0x3b1bb8;});return db['VoiceExtension']['bulkCreate'](_0x13dd81,{'transaction':_0x18dff7})[_0xa757('0x24')](function(_0x3da8c1){if(!_0x3da8c1){return _0x215a80(_0xa757('0x5d'));}else{return _0x31c4cd(_0x3da8c1);}})[_0xa757('0x45')](function(_0x3c3ff1){return _0x215a80(_0x3c3ff1);});});;});};function addVoicePrefixExtensions(_0x3672a7,_0x1b34ad){var _0x32e0b9=[];var _0x13e584=formatPrefixName(_0x3672a7[_0xa757('0x5a')]);_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x2,'Set',_0xa757('0x5f')+_0x3672a7[_0xa757('0x28')]));if(_0x3672a7['callerIdAll']){_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x3,_0xa757('0x60'),_0xa757('0x61')+_0x3672a7[_0xa757('0x62')]));}else{_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x3,_0xa757('0x5b'),'No\x20callerid\x20available'));}_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x4,'goto',_0x1b34ad[_0xa757('0x53')]+','+_0xa757('0x63')+(0x8+_0x3672a7[_0xa757('0x28')][_0xa757('0x38')])+'}'+','+0x1));return _0x32e0b9;}function formatPrefixName(_0x39ca41){var _0x5c0870='_';for(var _0x57ec52=0x0;_0x57ec52<_0x39ca41[_0xa757('0x38')];_0x57ec52++){if(_0x39ca41[_0xa757('0x64')](_0x57ec52)=='-'){_0x5c0870+=_0x39ca41[_0xa757('0x64')](_0x57ec52);}else{_0x5c0870+='['+_0x39ca41['charAt'](_0x57ec52)+']';}}_0x5c0870+='.';return _0x5c0870;}exports[_0xa757('0x65')]=function(_0x55bc0f,_0x34982a,_0x294165){var _0x2b0ad4=_0x55bc0f[_0xa757('0x66')];_0x2b0ad4[_0xa757('0x5a')]=_0xa757('0x67')+_0x2b0ad4['name']+'-';return db[_0xa757('0x68')][_0xa757('0x4b')](function(_0x1e15ee){return db[_0xa757('0x2c')][_0xa757('0x65')](_0x2b0ad4,{'where':{'id':_0x2b0ad4['id']},'transaction':_0x1e15ee})['then'](function(){return db[_0xa757('0x4c')][_0xa757('0x47')]({'where':{'VoicePrefixId':_0x2b0ad4['id']},'transaction':_0x1e15ee})[_0xa757('0x24')](function(){return db[_0xa757('0x4c')][_0xa757('0x46')]({'where':{'id':_0x2b0ad4['VoiceExtensionId']},'raw':!![]})[_0xa757('0x24')](function(_0x1c6287){return createVoicePrefixExtensions(_0x2b0ad4,_0x1c6287,_0x1e15ee);});});});})[_0xa757('0x24')](function(){return db['VoicePrefix'][_0xa757('0x69')](_0x2b0ad4['id']);})[_0xa757('0x24')](respondWithResult(_0x34982a,null))[_0xa757('0x45')](handleError(_0x34982a,null));};exports[_0xa757('0x6a')]=function(_0x78511f,_0x4695ef,_0x19ff32){return db[_0xa757('0x2c')][_0xa757('0x46')]({'where':{'id':_0x78511f[_0xa757('0x48')]['id']}})[_0xa757('0x24')](handleEntityNotFound(_0x4695ef,null))[_0xa757('0x24')](function(_0x47425b){if(_0x47425b){return _0x47425b[_0xa757('0x6a')](_0x78511f['body'][_0xa757('0x6b')],_[_0xa757('0x6c')](_0x78511f['body'],[_0xa757('0x6b'),'id'])||{})[_0xa757('0x6d')](function(_0x505bd6){for(var _0x29aea2=0x0;_0x29aea2<_0x78511f[_0xa757('0x66')][_0xa757('0x6b')][_0xa757('0x38')];_0x29aea2+=0x1){socket[_0xa757('0x6e')](_0xa757('0x6f'),{'UserId':Number(_0x78511f[_0xa757('0x66')][_0xa757('0x6b')][_0x29aea2]),'VoicePrefixId':Number(_0x78511f[_0xa757('0x48')]['id'])});}return _0x505bd6;});}})[_0xa757('0x24')](respondWithResult(_0x4695ef,null))[_0xa757('0x45')](handleError(_0x4695ef,null));};exports[_0xa757('0x70')]=function(_0x2c2b40,_0x46bc34,_0x27604c){return db[_0xa757('0x2c')]['find']({'where':{'id':_0x2c2b40[_0xa757('0x48')]['id']}})['then'](handleEntityNotFound(_0x46bc34,null))[_0xa757('0x24')](function(_0x20c444){if(_0x20c444){return _0x20c444[_0xa757('0x70')](_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')])['then'](function(){if(_[_0xa757('0x71')](_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')])){for(var _0x4a691d=0x0;_0x4a691d<_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')][_0xa757('0x38')];_0x4a691d+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')][_0x4a691d]),'VoicePrefixId':Number(_0x2c2b40[_0xa757('0x48')]['id'])});}}else{socket['emit'](_0xa757('0x72'),{'UserId':Number(_0x2c2b40['query']['ids']),'VoicePrefixId':Number(_0x2c2b40[_0xa757('0x48')]['id'])});}});}})[_0xa757('0x24')](respondWithStatusCode(_0x46bc34,null))[_0xa757('0x45')](handleError(_0x46bc34,null));};exports['getAgents']=function(_0x2a1c30,_0x1f85b,_0x17accd){var _0x199f75={};var _0x3e5cf5={};var _0x2d0ce0;var _0x26dcec;return db[_0xa757('0x2c')][_0xa757('0x73')]({'where':{'id':_0x2a1c30[_0xa757('0x48')]['id']}})[_0xa757('0x24')](handleEntityNotFound(_0x1f85b,null))[_0xa757('0x24')](function(_0x5a7042){if(_0x5a7042){_0x2d0ce0=_0x5a7042;_0x3e5cf5[_0xa757('0x31')]=_[_0xa757('0x33')](db[_0xa757('0x74')][_0xa757('0x2d')]);_0x3e5cf5[_0xa757('0x32')]=_[_0xa757('0x33')](_0x2a1c30[_0xa757('0x32')]);_0x3e5cf5[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3e5cf5[_0xa757('0x31')],_0x3e5cf5[_0xa757('0x32')]);_0x199f75[_0xa757('0x36')]=_[_0xa757('0x35')](_0x3e5cf5[_0xa757('0x31')],qs[_0xa757('0x37')](_0x2a1c30[_0xa757('0x32')][_0xa757('0x37')]));_0x199f75[_0xa757('0x36')]=_0x199f75[_0xa757('0x36')][_0xa757('0x38')]?_0x199f75[_0xa757('0x36')]:_0x3e5cf5[_0xa757('0x31')];_0x199f75['order']=qs[_0xa757('0x3c')](_0x2a1c30[_0xa757('0x32')]['sort']);_0x199f75[_0xa757('0x3d')]=qs['filters'](_[_0xa757('0x75')](_0x2a1c30[_0xa757('0x32')],_0x3e5cf5['filters']));if(_0x2a1c30[_0xa757('0x32')][_0xa757('0x40')]){_0x199f75[_0xa757('0x3d')]=_[_0xa757('0x3e')](_0x199f75['where'],{'$or':_[_0xa757('0x2b')](_0x199f75[_0xa757('0x36')],function(_0x4bf5c2){var _0x30716a={};_0x30716a[_0x4bf5c2]={'$like':'%'+_0x2a1c30[_0xa757('0x32')]['filter']+'%'};return _0x30716a;})});}_0x199f75=_[_0xa757('0x3e')]({},_0x199f75,_0x2a1c30[_0xa757('0x41')]);return _0x2d0ce0[_0xa757('0x76')](_0x199f75);}})[_0xa757('0x24')](function(_0x7d106e){if(_0x7d106e){_0x26dcec=_0x7d106e[_0xa757('0x38')];if(!_0x2a1c30[_0xa757('0x32')][_0xa757('0x39')](_0xa757('0x3a'))){_0x199f75['limit']=qs['limit'](_0x2a1c30[_0xa757('0x32')][_0xa757('0x1e')]);_0x199f75[_0xa757('0x1c')]=qs[_0xa757('0x1c')](_0x2a1c30[_0xa757('0x32')][_0xa757('0x1c')]);}return _0x2d0ce0[_0xa757('0x76')](_0x199f75);}})['then'](function(_0x4603f3){if(_0x4603f3){return _0x4603f3?{'count':_0x26dcec,'rows':_0x4603f3}:null;}})['then'](respondWithResult(_0x1f85b,null))[_0xa757('0x45')](handleError(_0x1f85b,null));};exports[_0xa757('0x77')]=function(_0x365a0d,_0x1b8444,_0x9723da){var _0x558b86={};var _0x3fa436={};var _0x4cb547;var _0x2d1113;return db[_0xa757('0x2c')][_0xa757('0x73')]({'where':{'id':_0x365a0d[_0xa757('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b8444,null))[_0xa757('0x24')](function(_0x1975a3){if(_0x1975a3){_0x4cb547=_0x1975a3;_0x3fa436[_0xa757('0x31')]=_[_0xa757('0x33')](db[_0xa757('0x78')][_0xa757('0x2d')]);_0x3fa436[_0xa757('0x32')]=_[_0xa757('0x33')](_0x365a0d['query']);_0x3fa436[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3fa436[_0xa757('0x31')],_0x3fa436[_0xa757('0x32')]);_0x558b86['attributes']=_[_0xa757('0x35')](_0x3fa436[_0xa757('0x31')],qs[_0xa757('0x37')](_0x365a0d[_0xa757('0x32')][_0xa757('0x37')]));_0x558b86[_0xa757('0x36')]=_0x558b86[_0xa757('0x36')]['length']?_0x558b86['attributes']:_0x3fa436[_0xa757('0x31')];_0x558b86['order']=qs[_0xa757('0x3c')](_0x365a0d['query']['sort']);_0x558b86[_0xa757('0x3d')]=qs[_0xa757('0x34')](_[_0xa757('0x75')](_0x365a0d[_0xa757('0x32')],_0x3fa436[_0xa757('0x34')]));if(_0x365a0d[_0xa757('0x32')][_0xa757('0x40')]){_0x558b86[_0xa757('0x3d')]=_[_0xa757('0x3e')](_0x558b86[_0xa757('0x3d')],{'$or':_['map'](_0x558b86[_0xa757('0x36')],function(_0x5b37f0){var _0x221e5b={};_0x221e5b[_0x5b37f0]={'$like':'%'+_0x365a0d[_0xa757('0x32')][_0xa757('0x40')]+'%'};return _0x221e5b;})});}_0x558b86=_[_0xa757('0x3e')]({},_0x558b86,_0x365a0d['options']);return _0x4cb547[_0xa757('0x77')](_0x558b86);}})[_0xa757('0x24')](function(_0x3e097b){if(_0x3e097b){_0x2d1113=_0x3e097b[_0xa757('0x38')];if(!_0x365a0d[_0xa757('0x32')][_0xa757('0x39')](_0xa757('0x3a'))){_0x558b86[_0xa757('0x1e')]=qs[_0xa757('0x1e')](_0x365a0d[_0xa757('0x32')][_0xa757('0x1e')]);_0x558b86[_0xa757('0x1c')]=qs[_0xa757('0x1c')](_0x365a0d[_0xa757('0x32')][_0xa757('0x1c')]);}return _0x4cb547['getTeams'](_0x558b86);}})['then'](function(_0x1176d5){if(_0x1176d5){return _0x1176d5?{'count':_0x2d1113,'rows':_0x1176d5}:null;}})['then'](respondWithResult(_0x1b8444,null))[_0xa757('0x45')](handleError(_0x1b8444,null));};exports[_0xa757('0x79')]=function(_0x2edad2,_0x1d03a7,_0x48c52f){var _0x33995b=_0x2edad2[_0xa757('0x66')][_0xa757('0x6b')];var _0x2f0ec5;return db[_0xa757('0x78')][_0xa757('0x43')]({'where':{'id':_0x33995b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa757('0x7a'),'attributes':['id',_0xa757('0x28'),_0xa757('0x7b'),_0xa757('0x7c'),_0xa757('0x7d')],'raw':!![]}]})['then'](function(_0x4b022c){if(_0x4b022c){_0x2f0ec5=_0x4b022c;var _0x26954d=_['flatMap'](_0x4b022c,function(_0x2b177c){var _0x55e4e5=_0x2b177c[_0xa757('0x25')]({'plain':!![]});return _0x55e4e5[_0xa757('0x7a')];});return db[_0xa757('0x2c')][_0xa757('0x46')]({'where':{'id':_0x2edad2[_0xa757('0x48')]['id']}})[_0xa757('0x24')](function(_0x2fb515){return db[_0xa757('0x68')][_0xa757('0x4b')](function(_0x1a4911){return _0x2fb515[_0xa757('0x79')](_0x33995b,{'transaction':_0x1a4911})['then'](function(){return BPromise[_0xa757('0x7e')](_0x2f0ec5,function(_0x38a6db){return db[_0xa757('0x7f')][_0xa757('0x80')]({'TeamId':_0x38a6db['id'],'VoicePrefixId':_0x2edad2[_0xa757('0x48')]['id']},{'transaction':_0x1a4911});});})[_0xa757('0x24')](function(){return BPromise['each'](_0x26954d,function(_0x30439a){return db[_0xa757('0x81')]['findOrCreate']({'where':{'UserId':_0x30439a['id'],'VoicePrefixId':_0x2edad2[_0xa757('0x48')]['id']},'transaction':_0x1a4911});});})[_0xa757('0x24')](function(){_0x26954d[_0xa757('0x82')](function(_0x5e6171){socket[_0xa757('0x6e')](_0xa757('0x6f'),{'UserId':_0x5e6171['id'],'VoicePrefixId':_0x2fb515['id']});});});});});}})[_0xa757('0x24')](respondWithStatusCode(_0x1d03a7,null))[_0xa757('0x45')](handleError(_0x1d03a7,null));};exports[_0xa757('0x83')]=function(_0x5b9be2,_0x16fdb7,_0x5ddcab){return db['Team'][_0xa757('0x43')]({'where':{'id':_0x5b9be2['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa757('0x74')],'as':_0xa757('0x7a'),'attributes':['id'],'raw':!![]}]})[_0xa757('0x24')](handleEntityNotFound(_0x16fdb7,null))[_0xa757('0x24')](function(_0x168313){var _0x2ed413=_['map'](_0x168313,'id');var _0x59e5c8=[];var _0x556b78=[];var _0x4b4a87=squel['select']();_0x4b4a87['field']('tq.TeamId')[_0xa757('0x84')]('team_has_voice_prefixes','tq')[_0xa757('0x85')](_0xa757('0x86'),'ut',_0xa757('0x87'))[_0xa757('0x3d')](_0xa757('0x88'),_0x5b9be2[_0xa757('0x48')]['id']);for(var _0x399952=0x0;_0x399952<_0x168313[_0xa757('0x38')];_0x399952+=0x1){let _0x1b1524=_0x168313[_0x399952];for(var _0x49f3fe=0x0;_0x49f3fe<_0x1b1524['Agents'][_0xa757('0x38')];_0x49f3fe+=0x1){let _0x3147eb=_0x1b1524[_0xa757('0x7a')][_0x49f3fe];var _0x2a7147=_0x4b4a87['clone']();_0x2a7147[_0xa757('0x3d')](_0xa757('0x89'),_0x3147eb['id']);_0x556b78[_0xa757('0x5e')](db[_0xa757('0x68')][_0xa757('0x32')](_0x2a7147[_0xa757('0x8a')](),{'type':db[_0xa757('0x68')]['QueryTypes'][_0xa757('0x8b')]})[_0xa757('0x24')](function(_0x494735){if(_0x494735[_0xa757('0x38')]===0x1){return _0x3147eb['id'];}else{var _0x3924af=_[_0xa757('0x8c')](_[_0xa757('0x2b')](_0x494735,_0xa757('0x8d')),function(_0x5d0701){return _[_0xa757('0x8e')](_0x2ed413,_0x5d0701);});if(_0x3924af){return _0x3147eb['id'];}}}));}}return BPromise[_0xa757('0x8f')](_0x556b78)[_0xa757('0x24')](function(_0x5081a0){_0x59e5c8=_(_0x59e5c8)[_0xa757('0x90')](_0x5081a0)[_0xa757('0x91')]()[_0xa757('0x92')]();return db['VoicePrefix'][_0xa757('0x46')]({'where':{'id':_0x5b9be2[_0xa757('0x48')]['id']}})[_0xa757('0x24')](function(_0x41b710){return db[_0xa757('0x68')]['transaction'](function(_0x2dcc43){return _0x41b710['removeTeams'](_0x5b9be2['query'][_0xa757('0x6b')],{'transaction':_0x2dcc43})[_0xa757('0x24')](function(){if(!_[_0xa757('0x93')](_0x59e5c8)){return _0x41b710[_0xa757('0x70')](_0x59e5c8,{'transaction':_0x2dcc43});}})['then'](function(){_0x59e5c8[_0xa757('0x82')](function(_0x36c462){socket[_0xa757('0x6e')](_0xa757('0x72'),{'UserId':_0x36c462,'VoicePrefixId':_0x41b710['id']});});});});});});})[_0xa757('0x24')](respondWithStatusCode(_0x16fdb7,null))[_0xa757('0x45')](handleError(_0x16fdb7,null));}; \ No newline at end of file +var _0x14a0=['mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','describe','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','create','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','charAt','system-','transaction','addAgents','ids','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','pick','getTeams','addTeams','findAll','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','Team','select','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x26ca1f,_0x4cbdd6){var _0x34c6e7=function(_0x5171ed){while(--_0x5171ed){_0x26ca1f['push'](_0x26ca1f['shift']());}};_0x34c6e7(++_0x4cbdd6);}(_0x14a0,0x8e));var _0x014a=function(_0x4ac11c,_0x3446ca){_0x4ac11c=_0x4ac11c-0x0;var _0x453f36=_0x14a0[_0x4ac11c];return _0x453f36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];config[_0x014a('0x14')]=_[_0x014a('0x15')](config[_0x014a('0x14')],{'host':_0x014a('0x16'),'port':0x18eb});var socket=require(_0x014a('0x17'))(new Redis(config[_0x014a('0x14')]));require(_0x014a('0x18'))[_0x014a('0x19')](socket);function respondWithStatusCode(_0x3c54c8,_0x4fe87c){_0x4fe87c=_0x4fe87c||0xcc;return function(_0x130d13){if(_0x130d13){return _0x3c54c8[_0x014a('0x1a')](_0x4fe87c);}return _0x3c54c8['status'](_0x4fe87c)[_0x014a('0x1b')]();};}function respondWithResult(_0x128c46,_0x59a4ea){_0x59a4ea=_0x59a4ea||0xc8;return function(_0x16e6fc){if(_0x16e6fc){return _0x128c46[_0x014a('0x1c')](_0x59a4ea)[_0x014a('0x1d')](_0x16e6fc);}};}function respondWithFilteredResult(_0x12da95,_0x2c26ac){return function(_0x12d339){if(_0x12d339){var _0x61ec9f=typeof _0x2c26ac[_0x014a('0x1e')]===_0x014a('0x1f')&&typeof _0x2c26ac[_0x014a('0x20')]===_0x014a('0x1f');var _0x89e132=_0x12d339[_0x014a('0x21')];var _0x34e5c3=_0x61ec9f?0x0:_0x2c26ac['offset'];var _0x359903=_0x61ec9f?_0x12d339[_0x014a('0x21')]:_0x2c26ac[_0x014a('0x1e')]+_0x2c26ac[_0x014a('0x20')];var _0xc9a563;if(_0x359903>=_0x89e132){_0x359903=_0x89e132;_0xc9a563=0xc8;}else{_0xc9a563=0xce;}_0x12da95[_0x014a('0x1c')](_0xc9a563);return _0x12da95[_0x014a('0x22')](_0x014a('0x23'),_0x34e5c3+'-'+_0x359903+'/'+_0x89e132)[_0x014a('0x1d')](_0x12d339);}return null;};}function patchUpdates(_0x486e66){return function(_0x3679ed){try{jsonpatch['apply'](_0x3679ed,_0x486e66,!![]);}catch(_0x1a1318){return BPromise[_0x014a('0x24')](_0x1a1318);}return _0x3679ed[_0x014a('0x25')]();};}function saveUpdates(_0x36d52b,_0x2b3c10){return function(_0x113b12){if(_0x113b12){return _0x113b12[_0x014a('0x26')](_0x36d52b)[_0x014a('0x27')](function(_0x165a42){return _0x165a42;});}return null;};}function removeEntity(_0x4c2627,_0x3b4b92){return function(_0x5358e9){if(_0x5358e9){return _0x5358e9[_0x014a('0x28')]()[_0x014a('0x27')](function(){var _0x4f1c44=_0x5358e9['get']({'plain':!![]});var _0x9a901f=_0x014a('0x29');return db[_0x014a('0x2a')]['destroy']({'where':{'type':_0x9a901f,'resourceId':_0x4f1c44['id']}})[_0x014a('0x27')](function(){return _0x5358e9;});})[_0x014a('0x27')](function(){_0x4c2627['status'](0xcc)[_0x014a('0x1b')]();});}};}function handleEntityNotFound(_0x2560a6,_0x496040){return function(_0x4f9c1c){if(!_0x4f9c1c){_0x2560a6[_0x014a('0x1a')](0x194);}return _0x4f9c1c;};}function handleError(_0x3e5a0a,_0xe70dfa){_0xe70dfa=_0xe70dfa||0x1f4;return function(_0x29fce5){logger['error'](_0x29fce5[_0x014a('0x2b')]);if(_0x29fce5[_0x014a('0x2c')]){delete _0x29fce5[_0x014a('0x2c')];}_0x3e5a0a[_0x014a('0x1c')](_0xe70dfa)[_0x014a('0x2d')](_0x29fce5);};}exports[_0x014a('0x2e')]=function(_0x354f4c,_0x1dae8e){var _0xc802d5={},_0x3c8755={},_0x9dfb11={'count':0x0,'rows':[]};var _0x4ed54e=_[_0x014a('0x2f')](db[_0x014a('0x30')][_0x014a('0x31')],function(_0x457883){return{'name':_0x457883[_0x014a('0x32')],'type':_0x457883[_0x014a('0x33')][_0x014a('0x34')]};});_0x3c8755['model']=_[_0x014a('0x2f')](_0x4ed54e,_0x014a('0x2c'));_0x3c8755['query']=_[_0x014a('0x35')](_0x354f4c[_0x014a('0x36')]);_0x3c8755[_0x014a('0x37')]=_[_0x014a('0x38')](_0x3c8755[_0x014a('0x39')],_0x3c8755[_0x014a('0x36')]);_0xc802d5[_0x014a('0x3a')]=_[_0x014a('0x38')](_0x3c8755['model'],qs[_0x014a('0x3b')](_0x354f4c[_0x014a('0x36')][_0x014a('0x3b')]));_0xc802d5[_0x014a('0x3a')]=_0xc802d5['attributes'][_0x014a('0x3c')]?_0xc802d5[_0x014a('0x3a')]:_0x3c8755[_0x014a('0x39')];if(!_0x354f4c[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0xc802d5[_0x014a('0x20')]=qs[_0x014a('0x20')](_0x354f4c[_0x014a('0x36')]['limit']);_0xc802d5[_0x014a('0x1e')]=qs['offset'](_0x354f4c[_0x014a('0x36')][_0x014a('0x1e')]);}_0xc802d5[_0x014a('0x3f')]=qs[_0x014a('0x40')](_0x354f4c[_0x014a('0x36')]['sort']);_0xc802d5[_0x014a('0x41')]=qs[_0x014a('0x37')](_['pick'](_0x354f4c[_0x014a('0x36')],_0x3c8755[_0x014a('0x37')]),_0x4ed54e);if(_0x354f4c[_0x014a('0x36')][_0x014a('0x42')]){_0xc802d5[_0x014a('0x41')]=_[_0x014a('0x43')](_0xc802d5[_0x014a('0x41')],{'$or':_[_0x014a('0x2f')](_0x4ed54e,function(_0x2beddc){if(_0x2beddc['type']!==_0x014a('0x44')){var _0x3baf40={};_0x3baf40[_0x2beddc[_0x014a('0x2c')]]={'$like':'%'+_0x354f4c[_0x014a('0x36')]['filter']+'%'};return _0x3baf40;}})});}_0xc802d5=_[_0x014a('0x43')]({},_0xc802d5,_0x354f4c[_0x014a('0x45')]);var _0x4cd132={'where':_0xc802d5[_0x014a('0x41')]};return db[_0x014a('0x30')][_0x014a('0x21')](_0x4cd132)['then'](function(_0x361866){_0x9dfb11[_0x014a('0x21')]=_0x361866;if(_0x354f4c['query'][_0x014a('0x46')]){_0xc802d5[_0x014a('0x47')]=[{'all':!![]}];}return db[_0x014a('0x30')]['findAll'](_0xc802d5);})[_0x014a('0x27')](function(_0x50a8f0){_0x9dfb11['rows']=_0x50a8f0;return _0x9dfb11;})[_0x014a('0x27')](respondWithFilteredResult(_0x1dae8e,_0xc802d5))[_0x014a('0x48')](handleError(_0x1dae8e,null));};exports['show']=function(_0x1557ad,_0x11c0d5){var _0xa4b68e={'raw':![],'where':{'id':_0x1557ad[_0x014a('0x49')]['id']}},_0x15c5dc={};_0x15c5dc[_0x014a('0x39')]=_['keys'](db[_0x014a('0x30')][_0x014a('0x31')]);_0x15c5dc[_0x014a('0x36')]=_['keys'](_0x1557ad['query']);_0x15c5dc[_0x014a('0x37')]=_['intersection'](_0x15c5dc['model'],_0x15c5dc[_0x014a('0x36')]);_0xa4b68e['attributes']=_[_0x014a('0x38')](_0x15c5dc[_0x014a('0x39')],qs[_0x014a('0x3b')](_0x1557ad['query'][_0x014a('0x3b')]));_0xa4b68e[_0x014a('0x3a')]=_0xa4b68e[_0x014a('0x3a')][_0x014a('0x3c')]?_0xa4b68e[_0x014a('0x3a')]:_0x15c5dc[_0x014a('0x39')];if(_0x1557ad['query'][_0x014a('0x46')]){_0xa4b68e[_0x014a('0x47')]=[{'all':!![]}];}_0xa4b68e=_['merge']({},_0xa4b68e,_0x1557ad[_0x014a('0x45')]);return db[_0x014a('0x30')][_0x014a('0x4a')](_0xa4b68e)[_0x014a('0x27')](handleEntityNotFound(_0x11c0d5,null))[_0x014a('0x27')](respondWithResult(_0x11c0d5,null))[_0x014a('0x48')](handleError(_0x11c0d5,null));};exports[_0x014a('0x28')]=function(_0x21680f,_0x4aa72b){return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x21680f[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x4aa72b,null))[_0x014a('0x27')](removeEntity(_0x4aa72b,null))['catch'](handleError(_0x4aa72b,null));};exports[_0x014a('0x4b')]=function(_0x5bee56,_0x2da804){return db[_0x014a('0x30')][_0x014a('0x4b')]()[_0x014a('0x27')](respondWithResult(_0x2da804,null))[_0x014a('0x48')](handleError(_0x2da804,null));};exports['create']=function(_0x51e1de,_0x4bb0b2){var _0x58905d;return db[_0x014a('0x4c')]['transaction'](function(_0x1fe253){return db['VoicePrefix']['create'](_0x51e1de[_0x014a('0x4d')],{'transaction':_0x1fe253})['then'](function(_0x1c640b){_0x58905d=_0x1c640b[_0x014a('0x4e')]({'plain':!![]});return db[_0x014a('0x4f')][_0x014a('0x4a')]({'where':{'id':_0x58905d[_0x014a('0x50')]},'raw':!![]})[_0x014a('0x27')](function(_0x35a421){return createVoicePrefixExtensions(_0x58905d,_0x35a421,_0x1fe253);});});})[_0x014a('0x27')](function(){var _0x133fcd=_0x51e1de[_0x014a('0x51')]['get']({'plain':!![]});if(!_0x133fcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133fcd[_0x014a('0x52')]===_0x014a('0x51')){var _0x237345=_0x58905d;return db['UserProfileSection']['find']({'where':{'name':_0x014a('0x29'),'userProfileId':_0x133fcd['userProfileId']},'raw':!![]})[_0x014a('0x27')](function(_0x3f6177){if(_0x3f6177&&_0x3f6177[_0x014a('0x53')]===0x0){return db[_0x014a('0x2a')]['create']({'name':_0x237345[_0x014a('0x2c')],'resourceId':_0x237345['id'],'type':_0x3f6177[_0x014a('0x2c')],'sectionId':_0x3f6177['id']},{})[_0x014a('0x27')](function(){return _0x58905d;});}else{return _0x58905d;}})['catch'](function(_0xbaeb5f){logger['error'](_0x014a('0x54'),_0xbaeb5f);throw _0xbaeb5f;});}return _0x58905d;})[_0x014a('0x27')](respondWithResult(_0x4bb0b2,null))[_0x014a('0x48')](handleError(_0x4bb0b2,null));};function Extension(_0x24d433,_0xd0334a,_0x1a308b,_0x4e9260){this[_0x014a('0x55')]=_0x014a('0x56');this[_0x014a('0x57')]=_0x24d433;this['app']=_0x1a308b;this[_0x014a('0x33')]=_0x014a('0x58');this[_0x014a('0x59')]=_0x014a('0x5a');this[_0x014a('0x5b')]=_0xd0334a;this['appdata']=_0x4e9260;}function createVoicePrefixExtensions(_0x8ac9cd,_0x46168d,_0x63c341){return new BPromise(function(_0x37a7b8,_0x3ca7e6){var _0x37b4a5=new Extension(formatPrefixName(_0x8ac9cd[_0x014a('0x5c')]),0x1,_0x014a('0x5d'),_0x014a('0x5e'));_0x37b4a5[_0x014a('0x5f')]=_0x8ac9cd['id'];return db[_0x014a('0x4f')][_0x014a('0x60')](_0x37b4a5,{'transaction':_0x63c341})['then'](function(_0x2ac66a){var _0x5ac216=_0x2ac66a['get']({'plain':!![]});var _0x5c9c47=_['map'](addVoicePrefixExtensions(_0x8ac9cd,_0x46168d),function(_0x5a38b4){_0x5a38b4[_0x014a('0x50')]=_0x5ac216['id'];_0x5a38b4[_0x014a('0x5f')]=_0x8ac9cd['id'];return _0x5a38b4;});return db[_0x014a('0x4f')]['bulkCreate'](_0x5c9c47,{'transaction':_0x63c341})[_0x014a('0x27')](function(_0x2a5007){if(!_0x2a5007){return _0x3ca7e6(_0x014a('0x61'));}else{return _0x37a7b8(_0x2a5007);}})[_0x014a('0x48')](function(_0x4dd210){return _0x3ca7e6(_0x4dd210);});});;});};function addVoicePrefixExtensions(_0x5edf80,_0xd3ab26){var _0x39154c=[];var _0x411948=formatPrefixName(_0x5edf80[_0x014a('0x5c')]);_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x2,_0x014a('0x63'),_0x014a('0x64')+_0x5edf80[_0x014a('0x2c')]));if(_0x5edf80[_0x014a('0x65')]){_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x3,_0x014a('0x63'),'PREFIX-CALLERIDALL='+_0x5edf80[_0x014a('0x65')]));}else{_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x3,'NoOp',_0x014a('0x66')));}_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x4,'goto',_0xd3ab26[_0x014a('0x55')]+','+'${EXTEN:'+(0x8+_0x5edf80[_0x014a('0x2c')][_0x014a('0x3c')])+'}'+','+0x1));return _0x39154c;}function formatPrefixName(_0xcdcbbb){var _0x456d69='_';for(var _0x37b8f=0x0;_0x37b8f<_0xcdcbbb['length'];_0x37b8f++){if(_0xcdcbbb[_0x014a('0x67')](_0x37b8f)=='-'){_0x456d69+=_0xcdcbbb[_0x014a('0x67')](_0x37b8f);}else{_0x456d69+='['+_0xcdcbbb[_0x014a('0x67')](_0x37b8f)+']';}}_0x456d69+='.';return _0x456d69;}exports[_0x014a('0x26')]=function(_0xbad5ef,_0x52e79e,_0x20cddc){var _0x188e65=_0xbad5ef[_0x014a('0x4d')];_0x188e65['prefix']=_0x014a('0x68')+_0x188e65['name']+'-';return db[_0x014a('0x4c')][_0x014a('0x69')](function(_0x267026){return db[_0x014a('0x30')][_0x014a('0x26')](_0x188e65,{'where':{'id':_0x188e65['id']},'transaction':_0x267026})[_0x014a('0x27')](function(){return db[_0x014a('0x4f')]['destroy']({'where':{'VoicePrefixId':_0x188e65['id']},'transaction':_0x267026})['then'](function(){return db[_0x014a('0x4f')]['find']({'where':{'id':_0x188e65[_0x014a('0x50')]},'raw':!![]})['then'](function(_0x1dcfc6){return createVoicePrefixExtensions(_0x188e65,_0x1dcfc6,_0x267026);});});});})[_0x014a('0x27')](function(){return db['VoicePrefix']['findById'](_0x188e65['id']);})[_0x014a('0x27')](respondWithResult(_0x52e79e,null))[_0x014a('0x48')](handleError(_0x52e79e,null));};exports['addAgents']=function(_0x882fc9,_0x42e4e9,_0x5635fc){return db['VoicePrefix'][_0x014a('0x4a')]({'where':{'id':_0x882fc9[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x42e4e9,null))[_0x014a('0x27')](function(_0x37ea2d){if(_0x37ea2d){return _0x37ea2d[_0x014a('0x6a')](_0x882fc9['body'][_0x014a('0x6b')],_['omit'](_0x882fc9['body'],[_0x014a('0x6b'),'id'])||{})[_0x014a('0x6c')](function(_0x523859){for(var _0x27e363=0x0;_0x27e363<_0x882fc9[_0x014a('0x4d')][_0x014a('0x6b')][_0x014a('0x3c')];_0x27e363+=0x1){socket[_0x014a('0x6d')]('userVoicePrefix:save',{'UserId':Number(_0x882fc9[_0x014a('0x4d')][_0x014a('0x6b')][_0x27e363]),'VoicePrefixId':Number(_0x882fc9[_0x014a('0x49')]['id'])});}return _0x523859;});}})[_0x014a('0x27')](respondWithResult(_0x42e4e9,null))['catch'](handleError(_0x42e4e9,null));};exports[_0x014a('0x6e')]=function(_0x4c568c,_0x469bb0,_0x3807c4){return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x4c568c[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x469bb0,null))['then'](function(_0x389bfb){if(_0x389bfb){return _0x389bfb[_0x014a('0x6e')](_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')])[_0x014a('0x27')](function(){if(_[_0x014a('0x6f')](_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')])){for(var _0x55cfe7=0x0;_0x55cfe7<_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')][_0x014a('0x3c')];_0x55cfe7+=0x1){socket['emit'](_0x014a('0x70'),{'UserId':Number(_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')][_0x55cfe7]),'VoicePrefixId':Number(_0x4c568c[_0x014a('0x49')]['id'])});}}else{socket[_0x014a('0x6d')](_0x014a('0x70'),{'UserId':Number(_0x4c568c[_0x014a('0x36')]['ids']),'VoicePrefixId':Number(_0x4c568c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x469bb0,null))['catch'](handleError(_0x469bb0,null));};exports[_0x014a('0x71')]=function(_0x32683c,_0x1810a8,_0x3804e1){var _0xe1b5ed={};var _0x7cd599={};var _0x1ba571;var _0x4e5d25;return db[_0x014a('0x30')][_0x014a('0x72')]({'where':{'id':_0x32683c[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x1810a8,null))['then'](function(_0x55d5f1){if(_0x55d5f1){_0x1ba571=_0x55d5f1;_0x7cd599[_0x014a('0x39')]=_[_0x014a('0x35')](db['User']['rawAttributes']);_0x7cd599[_0x014a('0x36')]=_['keys'](_0x32683c['query']);_0x7cd599[_0x014a('0x37')]=_[_0x014a('0x38')](_0x7cd599['model'],_0x7cd599[_0x014a('0x36')]);_0xe1b5ed[_0x014a('0x3a')]=_[_0x014a('0x38')](_0x7cd599[_0x014a('0x39')],qs[_0x014a('0x3b')](_0x32683c[_0x014a('0x36')][_0x014a('0x3b')]));_0xe1b5ed[_0x014a('0x3a')]=_0xe1b5ed['attributes']['length']?_0xe1b5ed[_0x014a('0x3a')]:_0x7cd599['model'];_0xe1b5ed['order']=qs['sort'](_0x32683c[_0x014a('0x36')][_0x014a('0x40')]);_0xe1b5ed[_0x014a('0x41')]=qs['filters'](_[_0x014a('0x73')](_0x32683c[_0x014a('0x36')],_0x7cd599[_0x014a('0x37')]));if(_0x32683c[_0x014a('0x36')]['filter']){_0xe1b5ed[_0x014a('0x41')]=_[_0x014a('0x43')](_0xe1b5ed[_0x014a('0x41')],{'$or':_['map'](_0xe1b5ed[_0x014a('0x3a')],function(_0x52a3a8){var _0x59871d={};_0x59871d[_0x52a3a8]={'$like':'%'+_0x32683c[_0x014a('0x36')][_0x014a('0x42')]+'%'};return _0x59871d;})});}_0xe1b5ed=_[_0x014a('0x43')]({},_0xe1b5ed,_0x32683c['options']);return _0x1ba571[_0x014a('0x71')](_0xe1b5ed);}})[_0x014a('0x27')](function(_0x53c335){if(_0x53c335){_0x4e5d25=_0x53c335[_0x014a('0x3c')];if(!_0x32683c[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0xe1b5ed[_0x014a('0x20')]=qs[_0x014a('0x20')](_0x32683c[_0x014a('0x36')][_0x014a('0x20')]);_0xe1b5ed['offset']=qs[_0x014a('0x1e')](_0x32683c[_0x014a('0x36')]['offset']);}return _0x1ba571['getAgents'](_0xe1b5ed);}})[_0x014a('0x27')](function(_0x45a093){if(_0x45a093){return _0x45a093?{'count':_0x4e5d25,'rows':_0x45a093}:null;}})['then'](respondWithResult(_0x1810a8,null))[_0x014a('0x48')](handleError(_0x1810a8,null));};exports[_0x014a('0x74')]=function(_0x216b27,_0x5ddb47,_0x3a0012){var _0x2c320f={};var _0x5dedaf={};var _0x5baf80;var _0x105786;return db['VoicePrefix'][_0x014a('0x72')]({'where':{'id':_0x216b27['params']['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x5ddb47,null))[_0x014a('0x27')](function(_0xda07b5){if(_0xda07b5){_0x5baf80=_0xda07b5;_0x5dedaf[_0x014a('0x39')]=_[_0x014a('0x35')](db['Team'][_0x014a('0x31')]);_0x5dedaf[_0x014a('0x36')]=_[_0x014a('0x35')](_0x216b27[_0x014a('0x36')]);_0x5dedaf[_0x014a('0x37')]=_[_0x014a('0x38')](_0x5dedaf[_0x014a('0x39')],_0x5dedaf[_0x014a('0x36')]);_0x2c320f['attributes']=_[_0x014a('0x38')](_0x5dedaf['model'],qs[_0x014a('0x3b')](_0x216b27['query']['fields']));_0x2c320f['attributes']=_0x2c320f['attributes'][_0x014a('0x3c')]?_0x2c320f[_0x014a('0x3a')]:_0x5dedaf[_0x014a('0x39')];_0x2c320f[_0x014a('0x3f')]=qs[_0x014a('0x40')](_0x216b27[_0x014a('0x36')][_0x014a('0x40')]);_0x2c320f[_0x014a('0x41')]=qs['filters'](_['pick'](_0x216b27[_0x014a('0x36')],_0x5dedaf[_0x014a('0x37')]));if(_0x216b27[_0x014a('0x36')][_0x014a('0x42')]){_0x2c320f[_0x014a('0x41')]=_[_0x014a('0x43')](_0x2c320f[_0x014a('0x41')],{'$or':_[_0x014a('0x2f')](_0x2c320f['attributes'],function(_0x27431c){var _0x3cfcc7={};_0x3cfcc7[_0x27431c]={'$like':'%'+_0x216b27[_0x014a('0x36')][_0x014a('0x42')]+'%'};return _0x3cfcc7;})});}_0x2c320f=_[_0x014a('0x43')]({},_0x2c320f,_0x216b27['options']);return _0x5baf80[_0x014a('0x74')](_0x2c320f);}})[_0x014a('0x27')](function(_0x2b9496){if(_0x2b9496){_0x105786=_0x2b9496[_0x014a('0x3c')];if(!_0x216b27[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0x2c320f['limit']=qs[_0x014a('0x20')](_0x216b27['query']['limit']);_0x2c320f[_0x014a('0x1e')]=qs[_0x014a('0x1e')](_0x216b27['query'][_0x014a('0x1e')]);}return _0x5baf80[_0x014a('0x74')](_0x2c320f);}})[_0x014a('0x27')](function(_0x5e116d){if(_0x5e116d){return _0x5e116d?{'count':_0x105786,'rows':_0x5e116d}:null;}})[_0x014a('0x27')](respondWithResult(_0x5ddb47,null))[_0x014a('0x48')](handleError(_0x5ddb47,null));};exports[_0x014a('0x75')]=function(_0x336bcf,_0x2f7969,_0x263212){var _0x13c2b2=_0x336bcf[_0x014a('0x4d')][_0x014a('0x6b')];var _0x58341b;return db['Team'][_0x014a('0x76')]({'where':{'id':_0x13c2b2},'attributes':['id'],'include':[{'model':db[_0x014a('0x77')],'as':_0x014a('0x78'),'attributes':['id','name',_0x014a('0x79'),_0x014a('0x7a'),_0x014a('0x7b')],'raw':!![]}]})[_0x014a('0x27')](function(_0x49997){if(_0x49997){_0x58341b=_0x49997;var _0x2888a0=_['flatMap'](_0x49997,function(_0x1c8cba){var _0x3ab005=_0x1c8cba[_0x014a('0x4e')]({'plain':!![]});return _0x3ab005[_0x014a('0x78')];});return db['VoicePrefix'][_0x014a('0x4a')]({'where':{'id':_0x336bcf[_0x014a('0x49')]['id']}})[_0x014a('0x27')](function(_0x30999a){return db[_0x014a('0x4c')]['transaction'](function(_0xcf0aee){return _0x30999a['addTeams'](_0x13c2b2,{'transaction':_0xcf0aee})['then'](function(){return BPromise[_0x014a('0x7c')](_0x58341b,function(_0x369fbd){return db[_0x014a('0x7d')][_0x014a('0x7e')]({'TeamId':_0x369fbd['id'],'VoicePrefixId':_0x336bcf[_0x014a('0x49')]['id']},{'transaction':_0xcf0aee});});})[_0x014a('0x27')](function(){return BPromise[_0x014a('0x7c')](_0x2888a0,function(_0x3a9352){return db[_0x014a('0x7f')][_0x014a('0x80')]({'where':{'UserId':_0x3a9352['id'],'VoicePrefixId':_0x336bcf[_0x014a('0x49')]['id']},'transaction':_0xcf0aee});});})[_0x014a('0x27')](function(){_0x2888a0[_0x014a('0x81')](function(_0x175c12){socket[_0x014a('0x6d')](_0x014a('0x82'),{'UserId':_0x175c12['id'],'VoicePrefixId':_0x30999a['id']});});});});});}})['then'](respondWithStatusCode(_0x2f7969,null))[_0x014a('0x48')](handleError(_0x2f7969,null));};exports[_0x014a('0x83')]=function(_0x3c03ac,_0x4ab9d6,_0x4495c1){return db[_0x014a('0x84')][_0x014a('0x76')]({'where':{'id':_0x3c03ac[_0x014a('0x36')][_0x014a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x014a('0x77')],'as':_0x014a('0x78'),'attributes':['id'],'raw':!![]}]})[_0x014a('0x27')](handleEntityNotFound(_0x4ab9d6,null))[_0x014a('0x27')](function(_0x480639){var _0x346734=_[_0x014a('0x2f')](_0x480639,'id');var _0x1b1e6a=[];var _0x11aab3=[];var _0x4f91f1=squel[_0x014a('0x85')]();_0x4f91f1['field']('tq.TeamId')[_0x014a('0x86')]('team_has_voice_prefixes','tq')[_0x014a('0x87')](_0x014a('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x014a('0x41')]('VoicePrefixId\x20=\x20?',_0x3c03ac[_0x014a('0x49')]['id']);for(var _0x8cc35d=0x0;_0x8cc35d<_0x480639['length'];_0x8cc35d+=0x1){let _0x183bf6=_0x480639[_0x8cc35d];for(var _0x1b1c4e=0x0;_0x1b1c4e<_0x183bf6['Agents'][_0x014a('0x3c')];_0x1b1c4e+=0x1){let _0x3f5c3e=_0x183bf6[_0x014a('0x78')][_0x1b1c4e];var _0x383c07=_0x4f91f1[_0x014a('0x89')]();_0x383c07[_0x014a('0x41')](_0x014a('0x8a'),_0x3f5c3e['id']);_0x11aab3[_0x014a('0x62')](db[_0x014a('0x4c')][_0x014a('0x36')](_0x383c07[_0x014a('0x8b')](),{'type':db[_0x014a('0x4c')]['QueryTypes'][_0x014a('0x8c')]})[_0x014a('0x27')](function(_0x3d8d34){if(_0x3d8d34[_0x014a('0x3c')]===0x1){return _0x3f5c3e['id'];}else{var _0x3cf20e=_[_0x014a('0x8d')](_[_0x014a('0x2f')](_0x3d8d34,_0x014a('0x8e')),function(_0x5a7fd0){return _[_0x014a('0x8f')](_0x346734,_0x5a7fd0);});if(_0x3cf20e){return _0x3f5c3e['id'];}}}));}}return BPromise[_0x014a('0x90')](_0x11aab3)[_0x014a('0x27')](function(_0x29d217){_0x1b1e6a=_(_0x1b1e6a)[_0x014a('0x91')](_0x29d217)[_0x014a('0x92')]()['value']();return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x3c03ac[_0x014a('0x49')]['id']}})['then'](function(_0x4e6844){return db[_0x014a('0x4c')][_0x014a('0x69')](function(_0x262513){return _0x4e6844[_0x014a('0x83')](_0x3c03ac[_0x014a('0x36')]['ids'],{'transaction':_0x262513})[_0x014a('0x27')](function(){if(!_[_0x014a('0x93')](_0x1b1e6a)){return _0x4e6844[_0x014a('0x6e')](_0x1b1e6a,{'transaction':_0x262513});}})[_0x014a('0x27')](function(){_0x1b1e6a[_0x014a('0x81')](function(_0x87c7e5){socket['emit'](_0x014a('0x70'),{'UserId':_0x87c7e5,'VoicePrefixId':_0x4e6844['id']});});});});});});})['then'](respondWithStatusCode(_0x4ab9d6,null))[_0x014a('0x48')](handleError(_0x4ab9d6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3021a39..797dde5 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 _0x6217=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x6217,0x133));var _0x7621=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x6217[_0x11e30d];return _0x2d4e29;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x7621('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7621('0x1')](0x0);var events={'afterCreate':_0x7621('0x2'),'afterUpdate':_0x7621('0x3'),'afterDestroy':_0x7621('0x4')};function emitEvent(_0x1fcd1b){return function(_0x46355f,_0x54fbe1,_0xb6f3bf){VoicePrefixEvents[_0x7621('0x5')](_0x1fcd1b+':'+_0x46355f['id'],_0x46355f);VoicePrefixEvents[_0x7621('0x5')](_0x1fcd1b,_0x46355f);_0xb6f3bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7621('0x6')](e,emitEvent(event));}}module[_0x7621('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xf390=['save','update','remove','hook','events','VoicePrefix'];(function(_0x2cf680,_0x228066){var _0x4bf780=function(_0x2dd9e3){while(--_0x2dd9e3){_0x2cf680['push'](_0x2cf680['shift']());}};_0x4bf780(++_0x228066);}(_0xf390,0x196));var _0x0f39=function(_0x275dd2,_0x5a5a54){_0x275dd2=_0x275dd2-0x0;var _0x26364=_0xf390[_0x275dd2];return _0x26364;};'use strict';var EventEmitter=require(_0x0f39('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x0f39('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0f39('0x2'),'afterUpdate':_0x0f39('0x3'),'afterDestroy':_0x0f39('0x4')};function emitEvent(_0x51221c){return function(_0x5a6a1f,_0x2e5cdc,_0x169ae5){VoicePrefixEvents['emit'](_0x51221c+':'+_0x5a6a1f['id'],_0x5a6a1f);VoicePrefixEvents['emit'](_0x51221c,_0x5a6a1f);_0x169ae5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x0f39('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 2326398..60180a8 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 _0xf38f=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4abfd2,_0xd09564){var _0x35a13c=function(_0x232d0b){while(--_0x232d0b){_0x4abfd2['push'](_0x4abfd2['shift']());}};_0x35a13c(++_0xd09564);}(_0xf38f,0x161));var _0xff38=function(_0x37437c,_0x55dacf){_0x37437c=_0x37437c-0x0;var _0x35e1a1=_0xf38f[_0x37437c];return _0x35e1a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xff38('0x0'))(_0xff38('0x1'));var moment=require(_0xff38('0x2'));var BPromise=require(_0xff38('0x3'));var rp=require(_0xff38('0x4'));var fs=require('fs');var path=require(_0xff38('0x5'));var rimraf=require(_0xff38('0x6'));var config=require('../../config/environment');var attributes=require(_0xff38('0x7'));module[_0xff38('0x8')]=function(_0x467dc0,_0x2d462c){return _0x467dc0[_0xff38('0x9')](_0xff38('0xa'),attributes,{'tableName':_0xff38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41cd=['./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2bf181,_0x2bba7d){var _0x17dd00=function(_0x1baef2){while(--_0x1baef2){_0x2bf181['push'](_0x2bf181['shift']());}};_0x17dd00(++_0x2bba7d);}(_0x41cd,0x16c));var _0xd41c=function(_0x5997f4,_0x482272){_0x5997f4=_0x5997f4-0x0;var _0xa47e6a=_0x41cd[_0x5997f4];return _0xa47e6a;};'use strict';var _=require(_0xd41c('0x0'));var util=require(_0xd41c('0x1'));var logger=require('../../config/logger')(_0xd41c('0x2'));var moment=require(_0xd41c('0x3'));var BPromise=require('bluebird');var rp=require(_0xd41c('0x4'));var fs=require('fs');var path=require(_0xd41c('0x5'));var rimraf=require(_0xd41c('0x6'));var config=require(_0xd41c('0x7'));var attributes=require(_0xd41c('0x8'));module[_0xd41c('0x9')]=function(_0x2c2bfe,_0x61ab45){return _0x2c2bfe[_0xd41c('0xa')](_0xd41c('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 9d5f71f..3b824c1 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 _0x565e=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','moment','bluebird'];(function(_0x4b6383,_0x2d248f){var _0xc5ebf0=function(_0x396322){while(--_0x396322){_0x4b6383['push'](_0x4b6383['shift']());}};_0xc5ebf0(++_0x2d248f);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require('util');var moment=require(_0xe565('0x1'));var BPromise=require(_0xe565('0x2'));var rs=require(_0xe565('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe565('0x4'));var logger=require(_0xe565('0x5'))(_0xe565('0x6'));var config=require(_0xe565('0x7'));var jayson=require(_0xe565('0x8'));var client=jayson[_0xe565('0x9')][_0xe565('0xa')]({'port':0x232a});config[_0xe565('0xb')]=_[_0xe565('0xc')](config[_0xe565('0xb')],{'host':_0xe565('0xd'),'port':0x18eb});var socket=require(_0xe565('0xe'))(new Redis(config[_0xe565('0xb')]));require(_0xe565('0xf'))[_0xe565('0x10')](socket);function respondWithRpcPromise(_0x41640f,_0x5b82c1,_0x3dd4dc){return new BPromise(function(_0x36c827,_0x9fd021){return client['request'](_0x41640f,_0x3dd4dc)[_0xe565('0x11')](function(_0x9f674){logger[_0xe565('0x12')](_0xe565('0x13'),_0x5b82c1,'request\x20sent');logger[_0xe565('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5b82c1,_0xe565('0x15'),JSON['stringify'](_0x9f674));if(_0x9f674[_0xe565('0x16')]){if(_0x9f674[_0xe565('0x16')][_0xe565('0x17')]===0x1f4){logger['error'](_0xe565('0x13'),_0x5b82c1,_0x9f674[_0xe565('0x16')][_0xe565('0x18')]);return _0x9fd021(_0x9f674[_0xe565('0x16')]['message']);}logger[_0xe565('0x16')](_0xe565('0x13'),_0x5b82c1,_0x9f674[_0xe565('0x16')][_0xe565('0x18')]);return _0x36c827(_0x9f674[_0xe565('0x16')][_0xe565('0x18')]);}else{logger['info'](_0xe565('0x13'),_0x5b82c1,_0xe565('0x15'));_0x36c827(_0x9f674[_0xe565('0x19')][_0xe565('0x18')]);}})['catch'](function(_0x403f94){logger[_0xe565('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x5b82c1,_0x403f94);_0x9fd021(_0x403f94);});});} \ No newline at end of file +var _0xafb9=['../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ce92f,_0x3ce63f){var _0x15ac02=function(_0x53c88e){while(--_0x53c88e){_0x1ce92f['push'](_0x1ce92f['shift']());}};_0x15ac02(++_0x3ce63f);}(_0xafb9,0x68));var _0x9afb=function(_0x5b456b,_0x80d465){_0x5b456b=_0x5b456b-0x0;var _0x59891c=_0xafb9[_0x5b456b];return _0x59891c;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9afb('0xb')],{'host':_0x9afb('0xc'),'port':0x18eb});var socket=require(_0x9afb('0xd'))(new Redis(config['redis']));require(_0x9afb('0xe'))[_0x9afb('0xf')](socket);function respondWithRpcPromise(_0x2aaefe,_0x27fa71,_0x1e5325){return new BPromise(function(_0x56f477,_0x5bb974){return client[_0x9afb('0x10')](_0x2aaefe,_0x1e5325)[_0x9afb('0x11')](function(_0x3e6a29){logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,_0x9afb('0x14'));logger[_0x9afb('0x15')](_0x9afb('0x16'),_0x27fa71,_0x9afb('0x14'),JSON[_0x9afb('0x17')](_0x3e6a29));if(_0x3e6a29['error']){if(_0x3e6a29[_0x9afb('0x18')]['code']===0x1f4){logger['error'](_0x9afb('0x13'),_0x27fa71,_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);return _0x5bb974(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}logger[_0x9afb('0x18')](_0x9afb('0x13'),_0x27fa71,_0x3e6a29['error'][_0x9afb('0x19')]);return _0x56f477(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}else{logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,'request\x20sent');_0x56f477(_0x3e6a29[_0x9afb('0x1a')]['message']);}})[_0x9afb('0x1b')](function(_0x12aa19){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x27fa71,_0x12aa19);_0x5bb974(_0x12aa19);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d227318..a1149a4 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 _0x9755=['remove','update','removeListener','register','./voicePrefix.events'];(function(_0x216c10,_0xd83344){var _0x53cfca=function(_0xab6d33){while(--_0xab6d33){_0x216c10['push'](_0x216c10['shift']());}};_0x53cfca(++_0xd83344);}(_0x9755,0x1c6));var _0x5975=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9755[_0x1cc8fe];return _0x230054;};'use strict';var VoicePrefixEvents=require(_0x5975('0x0'));var events=['save',_0x5975('0x1'),_0x5975('0x2')];function createListener(_0x398970,_0x5e3640){return function(_0x53201e){_0x5e3640['emit'](_0x398970,_0x53201e);};}function removeListener(_0x261737,_0x453917){return function(){VoicePrefixEvents[_0x5975('0x3')](_0x261737,_0x453917);};}exports[_0x5975('0x4')]=function(_0x414e54){for(var _0x1839fb=0x0,_0x365ac3=events['length'];_0x1839fb<_0x365ac3;_0x1839fb++){var _0x48d8b5=events[_0x1839fb];var _0x2209f1=createListener('voicePrefix:'+_0x48d8b5,_0x414e54);VoicePrefixEvents['on'](_0x48d8b5,_0x2209f1);}}; \ No newline at end of file +var _0x54f3=['save','remove','update','removeListener','length','voicePrefix:'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x54f3,0x120));var _0x354f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x54f3[_0x4e676e];return _0x336a3c;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x354f('0x0'),_0x354f('0x1'),_0x354f('0x2')];function createListener(_0x1cb51f,_0x2cd824){return function(_0x517a53){_0x2cd824['emit'](_0x1cb51f,_0x517a53);};}function removeListener(_0xe4efe,_0x86b73e){return function(){VoicePrefixEvents[_0x354f('0x3')](_0xe4efe,_0x86b73e);};}exports['register']=function(_0x5618ac){for(var _0x234ac6=0x0,_0x51cd16=events[_0x354f('0x4')];_0x234ac6<_0x51cd16;_0x234ac6++){var _0x4311ad=events[_0x234ac6];var _0x2f111a=createListener(_0x354f('0x5')+_0x4311ad,_0x5618ac);VoicePrefixEvents['on'](_0x4311ad,_0x2f111a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index ef9aabd..25d84b7 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x2093f0,_0x1f903c){var _0x37829f=function(_0x27d3bc){while(--_0x27d3bc){_0x2093f0['push'](_0x2093f0['shift']());}};_0x37829f(++_0x1f903c);}(_0xb10b,0x12a));var _0xbb10=function(_0x360c92,_0x5ed443){_0x360c92=_0x360c92-0x0;var _0x429495=_0xb10b[_0x360c92];return _0x429495;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xb10b,0x12a));var _0xbb10=function(_0xefd3e6,_0x10d71e){_0xefd3e6=_0xefd3e6-0x0;var _0x52a204=_0xb10b[_0xefd3e6];return _0x52a204;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 3a15337..2ed5c0e 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 _0x9aa2=['leavewhenempty','wrapuptime','preview','predictive','booked','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','ENUM','outbound','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','dialMethod','strategy','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty'];(function(_0x1fcbb7,_0x21ff69){var _0x1a5046=function(_0xe0768){while(--_0xe0768){_0x1fcbb7['push'](_0x1fcbb7['shift']());}};_0x1a5046(++_0x21ff69);}(_0x9aa2,0xc7));var _0x29aa=function(_0xab44f7,_0x4794e0){_0xab44f7=_0xab44f7-0x0;var _0x284b58=_0x9aa2[_0xab44f7];return _0x284b58;};'use strict';var Sequelize=require('sequelize');module[_0x29aa('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x29aa('0x1')]('inbound',_0x29aa('0x2')),'allowNull':![],'defaultValue':_0x29aa('0x3')},'musiconhold':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':_0x29aa('0x5')},'announce':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0x29aa('0x1')]('rr',_0x29aa('0x6'),_0x29aa('0x7'),_0x29aa('0x8'),_0x29aa('0x9'),_0x29aa('0xa'),_0x29aa('0xb'),_0x29aa('0xc'),_0x29aa('0xd')),'allowNull':![],'defaultValue':_0x29aa('0x6'),'set':function(_0x46c62c){this[_0x29aa('0xe')]('strategy',_0x46c62c?_0x46c62c:'rrmemory');},'get':function(){var _0x29cc80=this[_0x29aa('0xf')]('type');var _0x3471bc=this[_0x29aa('0xf')](_0x29aa('0x10'));var _0x3a2111=this[_0x29aa('0xf')](_0x29aa('0x11'));if(_0x29cc80===_0x29aa('0x2')){if(_0x3471bc==='preview'){return null;}if(_0x3471bc==='booked'&&![_0x29aa('0xa'),_0x29aa('0x12')][_0x29aa('0x13')](_0x3a2111)){this[_0x29aa('0xe')](_0x29aa('0x11'),'rrmemory');}}return _0x3a2111;}},'servicelevel':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x29aa('0x14')](0xb)},'timeout':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x29aa('0x4')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':_0x29aa('0x15')},'autopause':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no',_0x29aa('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x29aa('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x29aa('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x29aa('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x29aa('0x15'),'no',_0x29aa('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x29aa('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x29aa('0x4')]},'queue_youarenext':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x29aa('0x4')]},'queue_quantity1':{'type':Sequelize[_0x29aa('0x4')]},'queue_quantity2':{'type':Sequelize[_0x29aa('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x29aa('0x4')]},'queue_less_than':{'type':Sequelize[_0x29aa('0x4')]},'periodic_announce':{'type':Sequelize[_0x29aa('0x18')],'set':function(_0x5aba63){this[_0x29aa('0xe')](_0x29aa('0x19'),_0x5aba63?_0x5aba63[_0x29aa('0x1a')](','):[]);},'get':function(){return this[_0x29aa('0xf')](_0x29aa('0x19'))?this[_0x29aa('0xf')](_0x29aa('0x19'))[_0x29aa('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x29aa('0x15'),'set':function(_0x1f9f70){this[_0x29aa('0xe')]('joinempty',_0x1f9f70?_0x1f9f70[_0x29aa('0x1a')](','):undefined);},'get':function(){return this[_0x29aa('0xf')]('joinempty')?this[_0x29aa('0xf')](_0x29aa('0x1c'))[_0x29aa('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':'no','set':function(_0x3ccb6e){this['setDataValue']('leavewhenempty',_0x3ccb6e?_0x3ccb6e[_0x29aa('0x1a')](','):undefined);},'get':function(){return this[_0x29aa('0xf')]('leavewhenempty')?this[_0x29aa('0xf')](_0x29aa('0x1d'))[_0x29aa('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x29aa('0x1')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x29aa('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x29aa('0x4')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0xc445f7){this['setDataValue']('acw',_0xc445f7);if(_0xc445f7){if(this['getDataValue'](_0x29aa('0x1e'))<0x2){this[_0x29aa('0xe')](_0x29aa('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x1f'),'progressive','power',_0x29aa('0x20'),_0x29aa('0x21')),'defaultValue':_0x29aa('0x22'),'comment':_0x29aa('0x23')},'dialLimitChannel':{'type':Sequelize[_0x29aa('0x14')](0x4)[_0x29aa('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x29aa('0x25')},'dialLimitQueue':{'type':Sequelize[_0x29aa('0x14')](0x4)[_0x29aa('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x29aa('0x26')](0x2)[_0x29aa('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x29aa('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x29aa('0x1')]('agentBusyFactor','dropRate'),'defaultValue':_0x29aa('0x28'),'comment':_0x29aa('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x29aa('0x26')](0x2)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x29aa('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x29aa('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x29aa('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x29aa('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x29aa('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x29aa('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':_0x29aa('0x2d'),'comment':_0x29aa('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x29aa('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x29aa('0x2f')},'dialQueueProject':{'type':Sequelize[_0x29aa('0x4')],'comment':_0x29aa('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x29aa('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x29aa('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x29aa('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0x3,'comment':_0x29aa('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x29aa('0x35')},'dialTimezone':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':_0x29aa('0x36')},'dialPrefix':{'type':Sequelize[_0x29aa('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x37'),'never',_0x29aa('0x38')),'defaultValue':_0x29aa('0x37')},'dialAMDActive':{'type':Sequelize[_0x29aa('0x39')],'defaultValue':0x0,'comment':_0x29aa('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x29aa('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x29aa('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x29aa('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x29aa('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x29aa('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x29aa('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x29aa('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x29aa('0x14')](0x9)[_0x29aa('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x29aa('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x29aa('0x14')](0x9)[_0x29aa('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x29aa('0x14')](0x9)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x29aa('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x29aa('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x29aa('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x29aa('0x39')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x29aa('0x1')](_0x29aa('0x41'),'ASC'),'defaultValue':_0x29aa('0x41')},'dialQueueProject2':{'type':Sequelize[_0x29aa('0x4')],'comment':_0x29aa('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x29aa('0x39')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x29aa('0x39')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x29aa('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x29aa('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x29aa('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x29aa('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x29aa('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x29aa('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x29aa('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x29aa('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x29aa('0x14')](0x5)[_0x29aa('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x29aa('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29aa('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29aa('0x39')],'defaultValue':![],'comment':_0x29aa('0x4a'),'set':function(_0x519458){if(!_0x519458)this['setDataValue'](_0x29aa('0x4b'),null);this[_0x29aa('0xe')]('mandatoryDisposition',_0x519458);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x29aa('0x14')](0x3)[_0x29aa('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x29aa('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x29aa('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6943=['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','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#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','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','outbound','ENUM','ringall','leastrecent','fewestcalls','random','linear','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','preview','booked','includes','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.'];(function(_0x1d3953,_0x550473){var _0x57eeb4=function(_0x5f0f58){while(--_0x5f0f58){_0x1d3953['push'](_0x1d3953['shift']());}};_0x57eeb4(++_0x550473);}(_0x6943,0x6f));var _0x3694=function(_0x4b980d,_0x32fc6a){_0x4b980d=_0x4b980d-0x0;var _0x5c7974=_0x6943[_0x4b980d];return _0x5c7974;};'use strict';var Sequelize=require(_0x3694('0x0'));module[_0x3694('0x1')]={'name':{'type':Sequelize[_0x3694('0x2')],'allowNull':![],'unique':_0x3694('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x3694('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x3694('0x5')]('rr',_0x3694('0x6'),_0x3694('0x7'),_0x3694('0x8'),_0x3694('0x9'),'rrmemory',_0x3694('0xa'),'wrandom',_0x3694('0xb')),'allowNull':![],'defaultValue':_0x3694('0x6'),'set':function(_0x5a7543){this[_0x3694('0xc')](_0x3694('0xd'),_0x5a7543?_0x5a7543:_0x3694('0xe'));},'get':function(){var _0x14ecaf=this[_0x3694('0xf')](_0x3694('0x10'));var _0x5cc36d=this[_0x3694('0xf')](_0x3694('0x11'));var _0x4b3c15=this[_0x3694('0xf')](_0x3694('0xd'));if(_0x14ecaf==='outbound'){if(_0x5cc36d===_0x3694('0x12')){return null;}if(_0x5cc36d===_0x3694('0x13')&&!['rrmemory','roundrobin'][_0x3694('0x14')](_0x4b3c15)){this[_0x3694('0xc')](_0x3694('0xd'),_0x3694('0xe'));}}return _0x4b3c15;}},'servicelevel':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3694('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3694('0x5')]('yes','no'),'defaultValue':_0x3694('0x16')},'autopause':{'type':Sequelize['ENUM']('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3694('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x3694('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3694('0x5')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3694('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3694('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3694('0x5')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3694('0x16')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x3694('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3694('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x3694('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3694('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3694('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3694('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3694('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3694('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x3694('0x2')]},'queue_less_than':{'type':Sequelize[_0x3694('0x2')]},'periodic_announce':{'type':Sequelize[_0x3694('0x18')],'set':function(_0xe34dde){this['setDataValue'](_0x3694('0x19'),_0xe34dde?_0xe34dde[_0x3694('0x1a')](','):[]);},'get':function(){return this[_0x3694('0xf')](_0x3694('0x19'))?this[_0x3694('0xf')](_0x3694('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3694('0x2')],'defaultValue':_0x3694('0x16'),'set':function(_0x261bf7){this[_0x3694('0xc')](_0x3694('0x1b'),_0x261bf7?_0x261bf7[_0x3694('0x1a')](','):undefined);},'get':function(){return this[_0x3694('0xf')](_0x3694('0x1b'))?this['getDataValue']('joinempty')[_0x3694('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3694('0x2')],'defaultValue':'no','set':function(_0x217264){this[_0x3694('0xc')](_0x3694('0x1d'),_0x217264?_0x217264['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x3694('0x1d'))?this[_0x3694('0xf')](_0x3694('0x1d'))[_0x3694('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3694('0x2')]},'description':{'type':Sequelize[_0x3694('0x2')]},'acw':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':0x0,'set':function(_0x18609d){this[_0x3694('0xc')](_0x3694('0x1f'),_0x18609d);if(_0x18609d){if(this['getDataValue'](_0x3694('0x20'))<0x2){this[_0x3694('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3694('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3694('0x21')},'dialMethod':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x12'),_0x3694('0x22'),_0x3694('0x23'),_0x3694('0x24'),_0x3694('0x13')),'defaultValue':'progressive','comment':_0x3694('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3694('0x26')},'dialLimitQueue':{'type':Sequelize[_0x3694('0x15')](0x4)[_0x3694('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3694('0x28')},'dialPowerLevel':{'type':Sequelize[_0x3694('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3694('0x2a')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x3694('0x2b')),'defaultValue':_0x3694('0x2b'),'comment':_0x3694('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3694('0x29')](0x2)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3694('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3694('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3694('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3694('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x3694('0x30'),'comment':_0x3694('0x31')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3694('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3694('0x15')](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3694('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3694('0x15')](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3694('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'defaultValue':0x3,'comment':_0x3694('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3694('0x15')](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3694('0x35')},'dialTimezone':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3694('0x2')],'defaultValue':_0x3694('0x36')},'dialPrefix':{'type':Sequelize[_0x3694('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x37'),_0x3694('0x38'),_0x3694('0x39')),'defaultValue':_0x3694('0x37')},'dialAMDActive':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3694('0x15')](0x9)[_0x3694('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x3694('0x15')](0x9)[_0x3694('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3694('0x15')](0x9)[_0x3694('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3694('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3694('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x3694('0x15')](0x9)[_0x3694('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3694('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3694('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3694('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3694('0x15')](0x5)[_0x3694('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3694('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3694('0x15')](0x9)[_0x3694('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3694('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x3694('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3694('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':0x0,'comment':_0x3694('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3694('0x5')](_0x3694('0x42'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x3694('0x2')],'comment':_0x3694('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3694('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3694('0x44')},'dialCutDigit':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3694('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3694('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x3694('0x15')](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3694('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3694('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3694('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3694('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3694('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3694('0x15')](0x3)[_0x3694('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3694('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3694('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x3694('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':![],'comment':_0x3694('0x4c'),'set':function(_0x9498d){if(!_0x9498d)this[_0x3694('0xc')]('mandatoryDispositionPauseId',null);this[_0x3694('0xc')](_0x3694('0x4d'),_0x9498d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3694('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3694('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x3694('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x3694('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index de75b16..2c420c2 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 _0x4b84=['type','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','getOptions','where','VoiceQueue','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','getHopperHistories','pick','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','forEach','penalty','transaction','TeamVoiceQueue','each','UserVoiceQueue','UserVoiceQueueRt','upsert','format','SIP/%s','emit','ids','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','TeamId','all','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','online','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','fromQuery','phone','scheduledAt','ContactId','ListId','select','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','NOW()','removeBlackLists','moment','bluebird','squel','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','undefined','count','offset','limit','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x4b84[_0x3fd3a3];return _0xa3e4d5;};'use strict';var moment=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0x44b8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x44b8('0x3'))(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x44b8('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x7'))(new Redis(config['redis']));require(_0x44b8('0x8'))['register'](socket);function respondWithStatusCode(_0x5034b6,_0x41d515){_0x41d515=_0x41d515||0xcc;return function(_0x42319d){if(_0x42319d){return _0x5034b6[_0x44b8('0x9')](_0x41d515);}return _0x5034b6['status'](_0x41d515)[_0x44b8('0xa')]();};}function respondWithResult(_0x2cc74b,_0x4315f6){_0x4315f6=_0x4315f6||0xc8;return function(_0x9b6048){if(_0x9b6048){return _0x2cc74b[_0x44b8('0xb')](_0x4315f6)[_0x44b8('0xc')](_0x9b6048);}};}function respondWithFilteredResult(_0xe9a025,_0x4ae8a1){return function(_0x147529){if(_0x147529){var _0x4301a6=typeof _0x4ae8a1['offset']===_0x44b8('0xd')&&typeof _0x4ae8a1['limit']===_0x44b8('0xd');var _0x18d642=_0x147529['count'];var _0x63e8f6=_0x4301a6?0x0:_0x4ae8a1['offset'];var _0x54fa95=_0x4301a6?_0x147529[_0x44b8('0xe')]:_0x4ae8a1[_0x44b8('0xf')]+_0x4ae8a1[_0x44b8('0x10')];var _0x41ab46;if(_0x54fa95>=_0x18d642){_0x54fa95=_0x18d642;_0x41ab46=0xc8;}else{_0x41ab46=0xce;}_0xe9a025['status'](_0x41ab46);return _0xe9a025['set']('Content-Range',_0x63e8f6+'-'+_0x54fa95+'/'+_0x18d642)[_0x44b8('0xc')](_0x147529);}return null;};}function saveUpdates(_0x5b7803){return function(_0x28ef36){if(_0x28ef36){return _0x28ef36[_0x44b8('0x11')](_0x5b7803)['then'](function(_0x36743e){return _0x36743e;});}return null;};}function removeEntity(_0xe3de8f){return function(_0x5103f5){if(_0x5103f5){return _0x5103f5[_0x44b8('0x12')]()[_0x44b8('0x13')](function(){var _0x4b600f=_0x5103f5[_0x44b8('0x14')]({'plain':!![]});var _0x8b4301=[{'name':_0x44b8('0x15'),'value':_0x44b8('0x16'),'ignore':![]},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18'),'ignore':![]}];var _0x452f2f=_(_0x8b4301)[_0x44b8('0x19')](_0x44b8('0x1a'))[_0x44b8('0x1b')](_0x44b8('0x1c'))[_0x44b8('0x1c')]();if(_['includes'](_0x452f2f,_0x4b600f[_0x44b8('0x1d')])){return;}var _0x3a8aa4=_[_0x44b8('0x1e')](_0x8b4301,[_0x44b8('0x1c'),_0x4b600f[_0x44b8('0x1d')]])['name'];return db[_0x44b8('0x1f')]['destroy']({'where':{'type':_0x3a8aa4,'resourceId':_0x4b600f['id']}})[_0x44b8('0x13')](function(){return _0x5103f5;});})[_0x44b8('0x13')](function(){_0xe3de8f[_0x44b8('0xb')](0xcc)[_0x44b8('0xa')]();});}};}function handleEntityNotFound(_0x230a3d){return function(_0x59acbc){if(!_0x59acbc){_0x230a3d[_0x44b8('0x9')](0x194);}return _0x59acbc;};}function handleError(_0x502acf,_0x41d673){_0x41d673=_0x41d673||0x1f4;return function(_0x350482){logger['error'](_0x350482[_0x44b8('0x20')]);if(_0x350482[_0x44b8('0x21')]){delete _0x350482[_0x44b8('0x21')];}_0x502acf['status'](_0x41d673)[_0x44b8('0x22')](_0x350482);};}exports[_0x44b8('0x23')]=function(_0x53d9c7,_0x2e0174){var _0x4a182d={};var _0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['VoiceQueue'][_0x44b8('0x24')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x25')],'type':_0x29b18d[_0x44b8('0x1d')][_0x44b8('0x26')]};});_0x4a182d=qs[_0x44b8('0x27')](_0x5a544c,_0x53d9c7);var _0x2cf205={'where':_0x4a182d[_0x44b8('0x28')]};return db[_0x44b8('0x29')][_0x44b8('0xe')](_0x2cf205)[_0x44b8('0x13')](function(_0x417d81){_0xfb0028[_0x44b8('0xe')]=_0x417d81;_0x4a182d['include']=qs[_0x44b8('0x2a')](_0x53d9c7['query']);return db[_0x44b8('0x29')][_0x44b8('0x2b')](_0x4a182d);})[_0x44b8('0x13')](function(_0xb64609){_0xfb0028[_0x44b8('0x2c')]=_0xb64609;return _0xfb0028;})['then'](respondWithFilteredResult(_0x2e0174,_0x4a182d))[_0x44b8('0x2d')](handleError(_0x2e0174,null));};exports[_0x44b8('0x2e')]=function(_0x26265f,_0x339f0f){var _0x46b008={'raw':![],'where':{'id':_0x26265f[_0x44b8('0x2f')]['id']}},_0x5f541d={};_0x5f541d[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0x5f541d[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x26265f[_0x44b8('0x32')]);_0x5f541d[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],_0x5f541d[_0x44b8('0x32')]);_0x46b008[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x26265f[_0x44b8('0x32')][_0x44b8('0x36')]));_0x46b008[_0x44b8('0x35')]=_0x46b008[_0x44b8('0x35')][_0x44b8('0x37')]?_0x46b008[_0x44b8('0x35')]:_0x5f541d['model'];if(_0x26265f[_0x44b8('0x32')][_0x44b8('0x38')]){_0x46b008['include']=[{'all':!![]}];}_0x46b008=_[_0x44b8('0x39')]({},_0x46b008,_0x26265f[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0x46b008)['then'](handleEntityNotFound(_0x339f0f,null))[_0x44b8('0x13')](respondWithResult(_0x339f0f,null))[_0x44b8('0x2d')](handleError(_0x339f0f,null));};exports[_0x44b8('0x3b')]=function(_0x1ee3cc,_0x9cb2a){return db[_0x44b8('0x29')][_0x44b8('0x3b')](_0x1ee3cc[_0x44b8('0x3c')],{})[_0x44b8('0x13')](function(_0x3d1be1){var _0x1c9983=_0x1ee3cc[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x1c9983)throw new Error(_0x44b8('0x3e'));if(_0x1c9983[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x57d8c4=_0x3d1be1[_0x44b8('0x14')]({'plain':!![]});var _0x43e43a=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x229cc9=_['find'](_0x43e43a,[_0x44b8('0x1c'),_0x57d8c4[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db[_0x44b8('0x40')][_0x44b8('0x1e')]({'where':{'name':_0x229cc9,'userProfileId':_0x1c9983['userProfileId']},'raw':!![]})['then'](function(_0x215f7b){if(_0x215f7b&&_0x215f7b[_0x44b8('0x41')]===0x0){return db[_0x44b8('0x1f')][_0x44b8('0x3b')]({'name':_0x57d8c4[_0x44b8('0x21')],'resourceId':_0x57d8c4['id'],'type':_0x215f7b[_0x44b8('0x21')],'sectionId':_0x215f7b['id']},{})[_0x44b8('0x13')](function(){return _0x3d1be1;});}else{return _0x3d1be1;}})[_0x44b8('0x2d')](function(_0x455fd6){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x455fd6);throw _0x455fd6;});}return _0x3d1be1;})[_0x44b8('0x13')](respondWithResult(_0x9cb2a,0xc9))[_0x44b8('0x2d')](handleError(_0x9cb2a,null));};exports[_0x44b8('0x44')]=function(_0x149731,_0x60eeb2){var _0xce06dc={'where':{'id':_0x149731[_0x44b8('0x2f')]['id']}},_0x3b3d5d={};_0x3b3d5d['model']=_['keys'](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0xce06dc[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x3b3d5d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x149731[_0x44b8('0x32')]['fields']));_0xce06dc[_0x44b8('0x35')]=_0xce06dc['attributes'][_0x44b8('0x37')]?_0xce06dc[_0x44b8('0x35')]:_0x3b3d5d[_0x44b8('0x30')];if(_0x149731[_0x44b8('0x32')][_0x44b8('0x38')]){_0xce06dc[_0x44b8('0x2a')]=[{'all':!![]}];}_0xce06dc=_['merge']({},_0xce06dc,_0x149731[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0xce06dc)[_0x44b8('0x13')](handleEntityNotFound(_0x60eeb2,null))['then'](function(_0x4e4ed1){if(_0x4e4ed1){var _0x2f549d=_0x4e4ed1[_0x44b8('0x14')]({'plain':!![]});_0x2f549d=qs[_0x44b8('0x45')](_0x2f549d,['id',_0x44b8('0x46'),_0x44b8('0x47')]);_0x149731['body']=_[_0x44b8('0x45')](_0x149731[_0x44b8('0x3c')],['id',_0x44b8('0x46'),_0x44b8('0x47')]);return db[_0x44b8('0x29')]['create'](_['merge'](_0x2f549d,_0x149731[_0x44b8('0x3c')]),{'include':_0x149731['query'][_0x44b8('0x38')]?[{'all':!![]}]:undefined})['then'](function(_0x40164d){var _0x434d6a=_0x149731[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x434d6a)throw new Error(_0x44b8('0x3e'));if(_0x434d6a[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x533967=_0x40164d[_0x44b8('0x14')]({'plain':!![]});var _0x37b2c2=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x45f9a0=_[_0x44b8('0x1e')](_0x37b2c2,['value',_0x533967[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db['UserProfileSection'][_0x44b8('0x1e')]({'where':{'name':_0x45f9a0,'userProfileId':_0x434d6a[_0x44b8('0x48')]},'raw':!![]})[_0x44b8('0x13')](function(_0x3df6aa){if(_0x3df6aa&&_0x3df6aa[_0x44b8('0x41')]===0x0){return db['UserProfileResource']['create']({'name':_0x533967[_0x44b8('0x21')],'resourceId':_0x533967['id'],'type':_0x3df6aa[_0x44b8('0x21')],'sectionId':_0x3df6aa['id']},{})[_0x44b8('0x13')](function(){return _0x40164d;});}else{return _0x40164d;}})[_0x44b8('0x2d')](function(_0x765e45){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x765e45);throw _0x765e45;});}return _0x40164d;});}})[_0x44b8('0x13')](respondWithResult(_0x60eeb2,0xc9))[_0x44b8('0x2d')](handleError(_0x60eeb2,null));};exports[_0x44b8('0x11')]=function(_0x16c628,_0x3f7576){if(_0x16c628['body']['id']){delete _0x16c628[_0x44b8('0x3c')]['id'];}return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x16c628[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3f7576,null))[_0x44b8('0x13')](saveUpdates(_0x16c628[_0x44b8('0x3c')],null))[_0x44b8('0x13')](respondWithResult(_0x3f7576,null))[_0x44b8('0x2d')](handleError(_0x3f7576,null));};exports[_0x44b8('0x12')]=function(_0x2ecff9,_0x15bcba){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2ecff9[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x15bcba,null))[_0x44b8('0x13')](removeEntity(_0x15bcba,null))[_0x44b8('0x2d')](handleError(_0x15bcba,null));};exports['getHoppers']=function(_0x1ec516,_0x3aac51){var _0x10e519={'raw':![],'where':{}};var _0x2b37e={};var _0x51f763={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x1ec516['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3aac51,null))[_0x44b8('0x13')](function(_0x5df821){if(_0x5df821){_0x2b37e[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopper'][_0x44b8('0x24')]);_0x2b37e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1ec516['query']);_0x2b37e[_0x44b8('0x33')]=_['intersection'](_0x2b37e[_0x44b8('0x30')],_0x2b37e['query']);_0x10e519[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2b37e[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x36')]));_0x10e519['attributes']=_0x10e519[_0x44b8('0x35')]['length']?_0x10e519[_0x44b8('0x35')]:_0x2b37e[_0x44b8('0x30')];if(!_0x1ec516['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x10e519[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x10')]);_0x10e519[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x10e519[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x1ec516['query'][_0x44b8('0x4d')]);_0x10e519[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_['pick'](_0x1ec516[_0x44b8('0x32')],_0x2b37e[_0x44b8('0x33')]));_0x10e519['where'][_0x44b8('0x4e')]=_0x5df821['id'];if(_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]){_0x10e519[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x10e519['where'],{'$or':_[_0x44b8('0x1b')](_0x10e519[_0x44b8('0x35')],function(_0x279753){var _0x270224={};_0x270224[_0x279753]={'$like':'%'+_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x270224;})});}_0x10e519=_[_0x44b8('0x39')]({},_0x10e519,_0x1ec516[_0x44b8('0x3a')]);return db['CmHopper'][_0x44b8('0xe')]({'where':_0x10e519[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x3ce76e){_0x51f763['count']=_0x3ce76e;if(_0x1ec516['query']['includeAll']){_0x10e519[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x4f')][_0x44b8('0x2b')](_0x10e519);})[_0x44b8('0x13')](function(_0x32e630){_0x51f763['rows']=_0x32e630;return _0x51f763;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x3aac51,_0x10e519))['catch'](handleError(_0x3aac51,null));};exports[_0x44b8('0x50')]=function(_0x155bcf,_0xea2c3e){var _0x5da034={'raw':!![],'where':{}};var _0x4cac12={};var _0xb4c6dc={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x155bcf['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xea2c3e,null))[_0x44b8('0x13')](function(_0x1258c2){if(_0x1258c2){_0x4cac12[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopperHistory'][_0x44b8('0x24')]);_0x4cac12[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x155bcf[_0x44b8('0x32')]);_0x4cac12[_0x44b8('0x33')]=_['intersection'](_0x4cac12[_0x44b8('0x30')],_0x4cac12[_0x44b8('0x32')]);_0x5da034[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x4cac12[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x155bcf[_0x44b8('0x32')]['fields']));_0x5da034[_0x44b8('0x35')]=_0x5da034[_0x44b8('0x35')]['length']?_0x5da034[_0x44b8('0x35')]:_0x4cac12[_0x44b8('0x30')];if(!_0x155bcf['query'][_0x44b8('0x4a')]('nolimit')){_0x5da034['limit']=qs[_0x44b8('0x10')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x10')]);_0x5da034['offset']=qs['offset'](_0x155bcf['query'][_0x44b8('0xf')]);}_0x5da034[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x5da034[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x155bcf['query'],_0x4cac12[_0x44b8('0x33')]));_0x5da034['where']['VoiceQueueId']=_0x1258c2['id'];if(_0x155bcf['query'][_0x44b8('0x19')]){_0x5da034['where']=_[_0x44b8('0x39')](_0x5da034[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x5da034[_0x44b8('0x35')],function(_0x3a9780){var _0x245ba3={};_0x245ba3[_0x3a9780]={'$like':'%'+_0x155bcf[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x245ba3;})});}_0x5da034=_['merge']({},_0x5da034,_0x155bcf[_0x44b8('0x3a')]);return db[_0x44b8('0x52')][_0x44b8('0xe')]({'where':_0x5da034[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0xee44b3){_0xb4c6dc[_0x44b8('0xe')]=_0xee44b3;if(_0x155bcf[_0x44b8('0x32')][_0x44b8('0x38')]){_0x5da034['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x44b8('0x2b')](_0x5da034);})['then'](function(_0x531d65){_0xb4c6dc[_0x44b8('0x2c')]=_0x531d65;return _0xb4c6dc;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0xea2c3e,_0x5da034))['catch'](handleError(_0xea2c3e,null));};exports['getHopperFinals']=function(_0x4b22e7,_0x2e0289){var _0x4860af={'raw':!![],'where':{}};var _0x353ff1={};var _0x2812da={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x4b22e7[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2e0289,null))[_0x44b8('0x13')](function(_0x3a7229){if(_0x3a7229){_0x353ff1[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x53')][_0x44b8('0x24')]);_0x353ff1[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x4b22e7['query']);_0x353ff1[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],_0x353ff1[_0x44b8('0x32')]);_0x4860af[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x36')]));_0x4860af[_0x44b8('0x35')]=_0x4860af[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4860af['attributes']:_0x353ff1[_0x44b8('0x30')];if(!_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4860af['limit']=qs[_0x44b8('0x10')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4860af['offset']=qs[_0x44b8('0xf')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x4860af[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4860af[_0x44b8('0x28')]=qs['filters'](_[_0x44b8('0x51')](_0x4b22e7[_0x44b8('0x32')],_0x353ff1[_0x44b8('0x33')]));_0x4860af[_0x44b8('0x28')][_0x44b8('0x4e')]=_0x3a7229['id'];if(_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4860af['where']=_['merge'](_0x4860af['where'],{'$or':_[_0x44b8('0x1b')](_0x4860af[_0x44b8('0x35')],function(_0x2d74ee){var _0x312f4c={};_0x312f4c[_0x2d74ee]={'$like':'%'+_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x312f4c;})});}_0x4860af=_[_0x44b8('0x39')]({},_0x4860af,_0x4b22e7[_0x44b8('0x3a')]);return db[_0x44b8('0x53')]['count']({'where':_0x4860af[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x4b8036){_0x2812da['count']=_0x4b8036;if(_0x4b22e7[_0x44b8('0x32')]['includeAll']){_0x4860af[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x53')][_0x44b8('0x2b')](_0x4860af);})['then'](function(_0x3f4a2a){_0x2812da[_0x44b8('0x2c')]=_0x3f4a2a;return _0x2812da;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x2e0289,_0x4860af))[_0x44b8('0x2d')](handleError(_0x2e0289,null));};exports['getHopperBlacks']=function(_0x216030,_0x584ae3){var _0x38c0c5={'raw':!![],'where':{}};var _0x2f2923={};var _0x2d9d62={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x216030[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x584ae3,null))['then'](function(_0x4d3b82){if(_0x4d3b82){_0x2f2923['model']=_[_0x44b8('0x31')](db[_0x44b8('0x54')][_0x44b8('0x24')]);_0x2f2923[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x216030[_0x44b8('0x32')]);_0x2f2923[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],_0x2f2923[_0x44b8('0x32')]);_0x38c0c5[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x216030[_0x44b8('0x32')][_0x44b8('0x36')]));_0x38c0c5[_0x44b8('0x35')]=_0x38c0c5[_0x44b8('0x35')]['length']?_0x38c0c5[_0x44b8('0x35')]:_0x2f2923['model'];if(!_0x216030[_0x44b8('0x32')]['hasOwnProperty']('nolimit')){_0x38c0c5[_0x44b8('0x10')]=qs['limit'](_0x216030['query']['limit']);_0x38c0c5['offset']=qs['offset'](_0x216030[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x38c0c5[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x216030['query'][_0x44b8('0x4d')]);_0x38c0c5[_0x44b8('0x28')]=qs['filters'](_['pick'](_0x216030[_0x44b8('0x32')],_0x2f2923[_0x44b8('0x33')]));_0x38c0c5[_0x44b8('0x28')]['VoiceQueueId']=_0x4d3b82['id'];if(_0x216030[_0x44b8('0x32')][_0x44b8('0x19')]){_0x38c0c5[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x38c0c5[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x38c0c5[_0x44b8('0x35')],function(_0x16344b){var _0x21057f={};_0x21057f[_0x16344b]={'$like':'%'+_0x216030['query'][_0x44b8('0x19')]+'%'};return _0x21057f;})});}_0x38c0c5=_[_0x44b8('0x39')]({},_0x38c0c5,_0x216030['options']);return db[_0x44b8('0x54')][_0x44b8('0xe')]({'where':_0x38c0c5[_0x44b8('0x28')]})['then'](function(_0x3a09e4){_0x2d9d62['count']=_0x3a09e4;if(_0x216030[_0x44b8('0x32')][_0x44b8('0x38')]){_0x38c0c5['include']=[{'all':!![]}];}return db[_0x44b8('0x54')][_0x44b8('0x2b')](_0x38c0c5);})[_0x44b8('0x13')](function(_0x37871e){_0x2d9d62['rows']=_0x37871e;return _0x2d9d62;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x584ae3,_0x38c0c5))[_0x44b8('0x2d')](handleError(_0x584ae3,null));};exports[_0x44b8('0x55')]=function(_0x35d46c,_0x2d4a8a){var _0x1d666e={};var _0x10a66a={};var _0x1e608f;var _0x470f90;return db['VoiceQueue']['findOne']({'where':{'id':_0x35d46c[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2d4a8a,null))[_0x44b8('0x13')](function(_0x3539f9){if(_0x3539f9){_0x1e608f=_0x3539f9;_0x10a66a[_0x44b8('0x30')]=_['keys'](db[_0x44b8('0x56')]['rawAttributes']);_0x10a66a[_0x44b8('0x32')]=_['keys'](_0x35d46c[_0x44b8('0x32')]);_0x10a66a[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],_0x10a66a[_0x44b8('0x32')]);_0x1d666e[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x35d46c['query'][_0x44b8('0x36')]));_0x1d666e[_0x44b8('0x35')]=_0x1d666e[_0x44b8('0x35')][_0x44b8('0x37')]?_0x1d666e['attributes']:_0x10a66a['model'];_0x1d666e['order']=qs[_0x44b8('0x4d')](_0x35d46c['query']['sort']);_0x1d666e[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x35d46c[_0x44b8('0x32')],_0x10a66a[_0x44b8('0x33')]));if(_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]){_0x1d666e[_0x44b8('0x28')]=_['merge'](_0x1d666e[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x1d666e[_0x44b8('0x35')],function(_0x2594bf){var _0x5f0c0c={};_0x5f0c0c[_0x2594bf]={'$like':'%'+_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x5f0c0c;})});}_0x1d666e=_[_0x44b8('0x39')]({},_0x1d666e,_0x35d46c['options']);return _0x1e608f['getTeams'](_0x1d666e);}})[_0x44b8('0x13')](function(_0xae9b10){if(_0xae9b10){_0x470f90=_0xae9b10[_0x44b8('0x37')];if(!_0x35d46c[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x1d666e[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x35d46c['query'][_0x44b8('0x10')]);_0x1d666e[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x35d46c[_0x44b8('0x32')]['offset']);}return _0x1e608f[_0x44b8('0x55')](_0x1d666e);}})['then'](function(_0x4464d3){if(_0x4464d3){return _0x4464d3?{'count':_0x470f90,'rows':_0x4464d3}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2d4a8a,null))[_0x44b8('0x2d')](handleError(_0x2d4a8a,null));};exports[_0x44b8('0x57')]=function(_0x45ff62,_0x343c5c){var _0x3cb290=_0x45ff62[_0x44b8('0x3c')]['teams'];var _0x2d27bf=_[_0x44b8('0x1b')](_0x3cb290,'id');return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x2d27bf},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id','name','online',_0x44b8('0x5a'),_0x44b8('0x5b')],'raw':!![]}]})['then'](function(_0x41f732){if(_0x41f732){var _0x16074e=_['flatMap'](_0x41f732,function(_0x1ec23e){var _0x3208b4=_0x1ec23e[_0x44b8('0x14')]({'plain':!![]});_0x3208b4[_0x44b8('0x59')][_0x44b8('0x5c')](function(_0x43f416){_0x43f416[_0x44b8('0x5d')]=_[_0x44b8('0x1e')](_0x3cb290,{'id':_0x3208b4['id']})[_0x44b8('0x5d')];});return _0x3208b4[_0x44b8('0x59')];});return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x45ff62[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x15365d){return db['sequelize'][_0x44b8('0x5e')](function(_0x3d92a9){return _0x15365d[_0x44b8('0x57')](_0x2d27bf,{'transaction':_0x3d92a9})[_0x44b8('0x13')](function(){return BPromise['each'](_0x3cb290,function(_0x611876){return db[_0x44b8('0x5f')]['upsert']({'TeamId':_0x611876['id'],'VoiceQueueId':_0x45ff62[_0x44b8('0x2f')]['id'],'penalty':_0x611876['penalty']},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise[_0x44b8('0x60')](_0x16074e,function(_0x5a508f){return db[_0x44b8('0x61')]['findOrCreate']({'where':{'UserId':_0x5a508f['id'],'VoiceQueueId':_0x45ff62['params']['id']},'defaults':{'penalty':_0x5a508f[_0x44b8('0x5d')]},'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise['each'](_['filter'](_0x16074e,{'online':!![]}),function(_0x52af57){return db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x52af57[_0x44b8('0x21')],'UserId':_0x52af57['id'],'queue_name':_0x15365d['name'],'VoiceQueueId':_0x15365d['id'],'interface':_['isNil'](_0x52af57[_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x52af57[_0x44b8('0x21')]):_0x52af57[_0x44b8('0x5b')],'paused':_0x52af57[_0x44b8('0x5a')]||![],'penalty':_0x52af57[_0x44b8('0x5d')]},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){_0x16074e[_0x44b8('0x5c')](function(_0x4ed62f){socket[_0x44b8('0x66')]('userVoiceQueue:save',{'UserId':_0x4ed62f['id'],'VoiceQueueId':_0x15365d['id']});});});});});}})[_0x44b8('0x13')](respondWithStatusCode(_0x343c5c,null))['catch'](handleError(_0x343c5c,null));};exports['removeTeams']=function(_0x1fb070,_0x224071){return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x1fb070[_0x44b8('0x32')][_0x44b8('0x67')]},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id'],'raw':!![]}]})[_0x44b8('0x13')](handleEntityNotFound(_0x224071,null))['then'](function(_0x1eb0a8){var _0x1e3b5f=_[_0x44b8('0x1b')](_0x1eb0a8,'id');var _0x536d1d=[];var _0x5bc747=[];var _0x3e44ea=squel['select']();_0x3e44ea[_0x44b8('0x68')]('tq.TeamId')[_0x44b8('0x69')]('team_has_voice_queues','tq')['join'](_0x44b8('0x6a'),'ut',_0x44b8('0x6b'))['where'](_0x44b8('0x6c'),_0x1fb070[_0x44b8('0x2f')]['id']);for(var _0x276dfc=0x0;_0x276dfc<_0x1eb0a8[_0x44b8('0x37')];_0x276dfc+=0x1){let _0x291617=_0x1eb0a8[_0x276dfc];for(var _0x57b73f=0x0;_0x57b73f<_0x291617[_0x44b8('0x59')]['length'];_0x57b73f+=0x1){let _0x595af5=_0x291617['Agents'][_0x57b73f];var _0x3015f9=_0x3e44ea[_0x44b8('0x44')]();_0x3015f9['where'](_0x44b8('0x6d'),_0x595af5['id']);_0x5bc747[_0x44b8('0x6e')](db['sequelize']['query'](_0x3015f9[_0x44b8('0x6f')](),{'type':db[_0x44b8('0x70')]['QueryTypes'][_0x44b8('0x71')]})[_0x44b8('0x13')](function(_0x5e2d3b){if(_0x5e2d3b[_0x44b8('0x37')]===0x1){return _0x595af5['id'];}else{var _0x97f4=_['every'](_[_0x44b8('0x1b')](_0x5e2d3b,_0x44b8('0x72')),function(_0xdb42f2){return _['includes'](_0x1e3b5f,_0xdb42f2);});if(_0x97f4){return _0x595af5['id'];}}}));}}return BPromise[_0x44b8('0x73')](_0x5bc747)['then'](function(_0x2ea49d){_0x536d1d=_(_0x536d1d)['union'](_0x2ea49d)['compact']()[_0x44b8('0x1c')]();return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x1fb070[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x1db2cf){return db[_0x44b8('0x70')][_0x44b8('0x5e')](function(_0x1b7826){return _0x1db2cf[_0x44b8('0x74')](_0x1fb070[_0x44b8('0x32')]['ids'],{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){if(!_[_0x44b8('0x75')](_0x536d1d)){return _0x1db2cf[_0x44b8('0x76')](_0x536d1d,{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){return db[_0x44b8('0x62')][_0x44b8('0x12')]({'where':{'VoiceQueueId':_0x1fb070[_0x44b8('0x2f')]['id'],'UserId':_0x536d1d},'transaction':_0x1b7826});});}})[_0x44b8('0x13')](function(){_0x536d1d['forEach'](function(_0x4234bc){socket[_0x44b8('0x66')]('userVoiceQueue:remove',{'UserId':_0x4234bc,'VoiceQueueId':_0x1db2cf['id']});});});});});});})[_0x44b8('0x13')](respondWithStatusCode(_0x224071,null))[_0x44b8('0x2d')](handleError(_0x224071,null));};exports[_0x44b8('0x77')]=function(_0x5596c0,_0x4b2b8f){var _0x18cd30,_0x133da8;return db['VoiceQueue']['find']({'where':{'id':_0x5596c0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x4b2b8f,null))[_0x44b8('0x13')](function(_0x2bccf9){if(_0x2bccf9){_0x133da8=_0x2bccf9;return _0x2bccf9[_0x44b8('0x77')](_0x5596c0['body'][_0x44b8('0x67')],_['omit'](_0x5596c0[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{})[_0x44b8('0x78')](function(_0x156a60){for(var _0x3cbec9=0x0;_0x3cbec9<_0x5596c0[_0x44b8('0x3c')]['ids'][_0x44b8('0x37')];_0x3cbec9+=0x1){socket['emit'](_0x44b8('0x79'),{'UserId':Number(_0x5596c0[_0x44b8('0x3c')]['ids'][_0x3cbec9]),'VoiceQueueId':Number(_0x5596c0[_0x44b8('0x2f')]['id'])});}return _0x156a60;});}})['then'](function(_0x42b0c9){_0x18cd30=_0x42b0c9||[];if(_0x133da8){return db[_0x44b8('0x58')][_0x44b8('0x2b')]({'where':{'id':_0x5596c0['body'][_0x44b8('0x67')]},'attributes':['id',_0x44b8('0x21'),'online',_0x44b8('0x5a'),'interface'],'raw':!![]});}})['then'](function(_0x4220b5){if(!_['isEmpty'](_0x4220b5)){var _0x336436=[];for(var _0x51add5=0x0;_0x51add5<_0x4220b5[_0x44b8('0x37')];_0x51add5++){if(_0x4220b5[_0x51add5][_0x44b8('0x7a')]){_0x336436['push'](db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x4220b5[_0x51add5]['name'],'UserId':_0x4220b5[_0x51add5]['id'],'queue_name':_0x133da8['name'],'VoiceQueueId':_0x133da8['id'],'interface':_[_0x44b8('0x7b')](_0x4220b5[_0x51add5][_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x4220b5[_0x51add5]['name']):_0x4220b5[_0x51add5][_0x44b8('0x5b')],'paused':_0x4220b5[_0x51add5][_0x44b8('0x5a')]||![],'penalty':_0x5596c0[_0x44b8('0x3c')][_0x44b8('0x5d')]||0x0}));}}return BPromise['all'](_0x336436);}})['then'](function(){return _0x18cd30;})[_0x44b8('0x13')](respondWithResult(_0x4b2b8f,null))[_0x44b8('0x2d')](handleError(_0x4b2b8f,null));};exports[_0x44b8('0x76')]=function(_0x4cf4a0,_0x1443bd){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4cf4a0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x1443bd,null))[_0x44b8('0x13')](function(_0x2cb698){if(_0x2cb698){return _0x2cb698[_0x44b8('0x76')](_0x4cf4a0[_0x44b8('0x32')]['ids'])['then'](function(){if(_[_0x44b8('0x7c')](_0x4cf4a0['query'][_0x44b8('0x67')])){for(var _0x4dc333=0x0;_0x4dc333<_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x44b8('0x37')];_0x4dc333+=0x1){socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x4dc333]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}}else{socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}});}})[_0x44b8('0x13')](function(_0x4026d7){return db[_0x44b8('0x62')]['destroy']({'where':{'VoiceQueueId':_0x4cf4a0[_0x44b8('0x2f')]['id'],'UserId':_0x4cf4a0['query'][_0x44b8('0x67')]}})[_0x44b8('0x13')](function(){return _0x4026d7;});})[_0x44b8('0x13')](respondWithStatusCode(_0x1443bd,null))[_0x44b8('0x2d')](handleError(_0x1443bd,null));};exports[_0x44b8('0x7e')]=function(_0x22e5ae,_0x2f3340){var _0x4d98de={};var _0x597139={};var _0x2fffd5;var _0x3c90c2;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x22e5ae[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2f3340,null))[_0x44b8('0x13')](function(_0x208c53){if(_0x208c53){_0x2fffd5=_0x208c53;_0x597139[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x58')][_0x44b8('0x24')]);_0x597139['query']=_[_0x44b8('0x31')](_0x22e5ae[_0x44b8('0x32')]);_0x597139[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],_0x597139['query']);_0x4d98de['attributes']=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],qs['fields'](_0x22e5ae['query'][_0x44b8('0x36')]));_0x4d98de['attributes']=_0x4d98de[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4d98de[_0x44b8('0x35')]:_0x597139[_0x44b8('0x30')];_0x4d98de[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4d98de['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x22e5ae[_0x44b8('0x32')],_0x597139['filters']));if(_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4d98de['where']=_['merge'](_0x4d98de['where'],{'$or':_['map'](_0x4d98de[_0x44b8('0x35')],function(_0x5e423c){var _0x48065d={};_0x48065d[_0x5e423c]={'$like':'%'+_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x48065d;})});}_0x4d98de=_[_0x44b8('0x39')]({},_0x4d98de,_0x22e5ae['options']);return _0x2fffd5[_0x44b8('0x7e')](_0x4d98de);}})['then'](function(_0x230407){if(_0x230407){_0x3c90c2=_0x230407[_0x44b8('0x37')];if(!_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4d98de[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4d98de['offset']=qs['offset'](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0x2fffd5['getAgents'](_0x4d98de);}})[_0x44b8('0x13')](function(_0x188744){if(_0x188744){return _0x188744?{'count':_0x3c90c2,'rows':_0x188744}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2f3340,null))[_0x44b8('0x2d')](handleError(_0x2f3340,null));};exports[_0x44b8('0x7f')]=function(_0x2da727,_0x319520){var _0x2f7550={};var _0x57d24f={};var _0x223e54;var _0x3e5fa8;return db[_0x44b8('0x29')]['findOne']({'where':{'id':_0x2da727[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x319520,null))[_0x44b8('0x13')](function(_0x5370a5){if(_0x5370a5){_0x223e54=_0x5370a5;_0x57d24f[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x62')][_0x44b8('0x24')]);_0x57d24f[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x2da727[_0x44b8('0x32')]);_0x57d24f[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x57d24f[_0x44b8('0x30')],_0x57d24f[_0x44b8('0x32')]);_0x2f7550[_0x44b8('0x35')]=_['intersection'](_0x57d24f[_0x44b8('0x30')],qs['fields'](_0x2da727[_0x44b8('0x32')]['fields']));_0x2f7550[_0x44b8('0x35')]=_0x2f7550[_0x44b8('0x35')][_0x44b8('0x37')]?_0x2f7550[_0x44b8('0x35')]:_0x57d24f[_0x44b8('0x30')];_0x2f7550[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x2da727['query'][_0x44b8('0x4d')]);_0x2f7550[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x2da727[_0x44b8('0x32')],_0x57d24f[_0x44b8('0x33')]));if(_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]){_0x2f7550[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x2f7550[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x2f7550[_0x44b8('0x35')],function(_0x4281a6){var _0x4bb399={};_0x4bb399[_0x4281a6]={'$like':'%'+_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x4bb399;})});}_0x2f7550=_['merge']({},_0x2f7550,_0x2da727[_0x44b8('0x3a')]);return _0x223e54[_0x44b8('0x7f')](_0x2f7550);}})[_0x44b8('0x13')](function(_0x1f389e){if(_0x1f389e){_0x3e5fa8=_0x1f389e[_0x44b8('0x37')];if(!_0x2da727['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x2f7550[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x2da727['query'][_0x44b8('0x10')]);_0x2f7550[_0x44b8('0xf')]=qs['offset'](_0x2da727['query']['offset']);}return _0x223e54['getMembers'](_0x2f7550);}})[_0x44b8('0x13')](function(_0x5824a8){return _0x5824a8?{'count':_0x3e5fa8,'rows':_0x5824a8}:null;})['then'](respondWithResult(_0x319520,null))[_0x44b8('0x2d')](handleError(_0x319520,null));};exports[_0x44b8('0x80')]=function(_0x87a38,_0x54adf9){var _0x44dc3d={};var _0x32dafb={};var _0x3c8e0c;var _0x21ea61;return db['VoiceQueue'][_0x44b8('0x49')]({'where':{'id':_0x87a38['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x54adf9,null))[_0x44b8('0x13')](function(_0x56cfa5){if(_0x56cfa5){_0x3c8e0c=_0x56cfa5;_0x32dafb[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x32dafb[_0x44b8('0x32')]=_['keys'](_0x87a38['query']);_0x32dafb[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],_0x32dafb[_0x44b8('0x32')]);_0x44dc3d[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x36')]));_0x44dc3d[_0x44b8('0x35')]=_0x44dc3d[_0x44b8('0x35')]['length']?_0x44dc3d['attributes']:_0x32dafb[_0x44b8('0x30')];_0x44dc3d['order']=qs[_0x44b8('0x4d')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x44dc3d['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x87a38[_0x44b8('0x32')],_0x32dafb[_0x44b8('0x33')]));if(_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]){_0x44dc3d['where']=_[_0x44b8('0x39')](_0x44dc3d[_0x44b8('0x28')],{'$or':_['map'](_0x44dc3d[_0x44b8('0x35')],function(_0x1ffa05){var _0x22edd7={};_0x22edd7[_0x1ffa05]={'$like':'%'+_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x22edd7;})});}_0x44dc3d=_['merge']({},_0x44dc3d,_0x87a38[_0x44b8('0x3a')]);return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})[_0x44b8('0x13')](function(_0x2fca1a){if(_0x2fca1a){_0x21ea61=_0x2fca1a[_0x44b8('0x37')];if(!_0x87a38[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x44dc3d[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x87a38['query'][_0x44b8('0x10')]);_0x44dc3d[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x87a38['query']['offset']);}return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})['then'](function(_0x9458fb){if(_0x9458fb){return _0x9458fb?{'count':_0x21ea61,'rows':_0x9458fb}:null;}})[_0x44b8('0x13')](respondWithResult(_0x54adf9,null))[_0x44b8('0x2d')](handleError(_0x54adf9,null));};exports[_0x44b8('0x82')]=function(_0x2eb6ce,_0x105ca0){var _0x25f364=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x77c009,_0x161362;return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2eb6ce[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x105ca0,null))['then'](function(_0x4d88a6){if(_0x4d88a6){_0x161362=_0x4d88a6;return _0x4d88a6[_0x44b8('0x82')](_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x67')],_[_0x44b8('0x45')](_0x2eb6ce[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x4b49df){var _0xbf96c1;_0x77c009=_0x4b49df||[];var _0x1f6244=[];if(_0x4b49df){for(var _0x96a3cd=0x0;_0x96a3cd<_0x4b49df['length'];_0x96a3cd+=0x1){var _0x16721d=_0x4b49df[_0x96a3cd][_0x44b8('0x14')]({'plain':!![]});_0x161362[_0x44b8('0x83')]=_0x2eb6ce[_0x44b8('0x3c')]['dialCheckDuplicateType']?_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x83')]:_0x161362[_0x44b8('0x83')];switch(_0x161362['dialCheckDuplicateType']){case'always':_0xbf96c1=squel['insert']()['into']('cm_hopper')[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x85'),'phone')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))[_0x44b8('0x68')](_0x16721d['CmListId'][_0x44b8('0x6f')](),'ListId')[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),'VoiceQueueId')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))['where'](_0x44b8('0x8b'))['where'](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e'))['where'](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x90'))[_0x44b8('0x69')](_0x44b8('0x91'))['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]()))[_0x44b8('0x28')]('phone\x20NOT\x20IN\x20(?)',squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x92'))[_0x44b8('0x69')](_0x44b8('0x93'))[_0x44b8('0x28')](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;case _0x44b8('0x94'):_0xbf96c1=squel[_0x44b8('0x95')]()['into'](_0x44b8('0x93'))[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),'ContactId',_0x44b8('0x88'),'VoiceQueueId',_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field'](_0x44b8('0x85'),_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id','ContactId')[_0x44b8('0x68')](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')]['toString']())['where'](_0x44b8('0x8e'))[_0x44b8('0x28')](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;default:_0xbf96c1=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper')[_0x44b8('0x84')](['phone',_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),'VoiceQueueId','createdAt',_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field']('phone',_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))['field'](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e')))[_0x44b8('0x6f')]();}_0x1f6244[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0xbf96c1));}return BPromise['all'](_0x1f6244);}})[_0x44b8('0x13')](function(){var _0x2ad4ab=[];var _0x196b4b=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper_additional_phones')[_0x44b8('0x84')]([_0x44b8('0x97'),_0x44b8('0x85'),_0x44b8('0x98'),_0x44b8('0x46'),_0x44b8('0x47')],squel['select']()[_0x44b8('0x68')](_0x44b8('0x99'))[_0x44b8('0x68')](_0x44b8('0x9a'))[_0x44b8('0x68')](_0x44b8('0x9b'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27','createdAt')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x9c'),'ci')['join'](_0x44b8('0x93'),'h','h.ContactId=ci.CmContactId')[_0x44b8('0x28')](_0x44b8('0x9d'),_0x25f364)[_0x44b8('0x28')](_0x44b8('0x9e'),'PHONE'))[_0x44b8('0x6f')]();_0x2ad4ab[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0x196b4b));return BPromise[_0x44b8('0x73')](_0x2ad4ab);})[_0x44b8('0x13')](function(){return _0x77c009;})[_0x44b8('0x13')](respondWithResult(_0x105ca0,null))[_0x44b8('0x2d')](handleError(_0x105ca0,null));};exports[_0x44b8('0x9f')]=function(_0x257702,_0x17560c){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x257702[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x17560c,null))[_0x44b8('0x13')](function(_0x4d11d5){if(_0x4d11d5){return _0x4d11d5[_0x44b8('0x9f')](_0x257702[_0x44b8('0x32')][_0x44b8('0x67')]);}})[_0x44b8('0x13')](function(_0xafca17){if(_0xafca17){return db['CmHopper']['destroy']({'where':{'ListId':_0x257702['query'][_0x44b8('0x67')],'VoiceQueueId':_0x257702[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(){return _0xafca17;});}})[_0x44b8('0x13')](respondWithStatusCode(_0x17560c,null))[_0x44b8('0x2d')](handleError(_0x17560c,null));};exports[_0x44b8('0xa0')]=function(_0x513302,_0xfdb408){var _0x119dda={};var _0x5834fe={};var _0xe5cc1e;var _0x4c55e6;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x513302['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xfdb408,null))[_0x44b8('0x13')](function(_0x537eab){if(_0x537eab){_0xe5cc1e=_0x537eab;_0x5834fe[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x5834fe['query']=_[_0x44b8('0x31')](_0x513302[_0x44b8('0x32')]);_0x5834fe[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5834fe[_0x44b8('0x30')],_0x5834fe[_0x44b8('0x32')]);_0x119dda[_0x44b8('0x35')]=_['intersection'](_0x5834fe[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x513302[_0x44b8('0x32')]['fields']));_0x119dda[_0x44b8('0x35')]=_0x119dda[_0x44b8('0x35')]['length']?_0x119dda[_0x44b8('0x35')]:_0x5834fe[_0x44b8('0x30')];_0x119dda[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x513302['query'][_0x44b8('0x4d')]);_0x119dda[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x513302[_0x44b8('0x32')],_0x5834fe['filters']));if(_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]){_0x119dda['where']=_[_0x44b8('0x39')](_0x119dda[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x119dda[_0x44b8('0x35')],function(_0x4e9376){var _0x25f31c={};_0x25f31c[_0x4e9376]={'$like':'%'+_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x25f31c;})});}_0x119dda=_[_0x44b8('0x39')]({},_0x119dda,_0x513302[_0x44b8('0x3a')]);return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x57e3c9){if(_0x57e3c9){_0x4c55e6=_0x57e3c9[_0x44b8('0x37')];if(!_0x513302[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x119dda['limit']=qs[_0x44b8('0x10')](_0x513302[_0x44b8('0x32')][_0x44b8('0x10')]);_0x119dda['offset']=qs['offset'](_0x513302[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x4a5916){if(_0x4a5916){return _0x4a5916?{'count':_0x4c55e6,'rows':_0x4a5916}:null;}})[_0x44b8('0x13')](respondWithResult(_0xfdb408,null))[_0x44b8('0x2d')](handleError(_0xfdb408,null));};exports['addBlackLists']=function(_0xd19a35,_0x2439f2){var _0x22a624;return db['VoiceQueue'][_0x44b8('0x1e')]({'where':{'id':_0xd19a35[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2439f2,null))[_0x44b8('0x13')](function(_0x14c021){if(_0x14c021){return _0x14c021['addBlackLists'](_0xd19a35[_0x44b8('0x3c')][_0x44b8('0x67')],_['omit'](_0xd19a35[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x3b9cd2){var _0xb6cadf;_0x22a624=_0x3b9cd2||[];var _0x2024eb=[];if(_0x3b9cd2){for(var _0x29af58=0x0;_0x29af58<_0x3b9cd2[_0x44b8('0x37')];_0x29af58+=0x1){var _0x3870a9=_0x3b9cd2[_0x29af58]['get']({'plain':!![]});_0xb6cadf=squel['insert']()['into']('cm_hopper_black')[_0x44b8('0x84')]([_0x44b8('0x85'),'ContactId',_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('phone',_0x44b8('0x85'))['field']('id','ContactId')[_0x44b8('0x68')](_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0xd19a35['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')](_0x44b8('0xa1'),_0x44b8('0x46'))[_0x44b8('0x68')](_0x44b8('0xa1'),'updatedAt')[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')]())[_0x44b8('0x28')](_0x44b8('0x8e')))[_0x44b8('0x6f')]();_0x2024eb[_0x44b8('0x6e')](db['sequelize'][_0x44b8('0x32')](_0xb6cadf));}return BPromise[_0x44b8('0x73')](_0x2024eb);}})[_0x44b8('0x13')](function(){return _0x22a624;})[_0x44b8('0x13')](respondWithResult(_0x2439f2,null))[_0x44b8('0x2d')](handleError(_0x2439f2,null));};exports[_0x44b8('0xa2')]=function(_0x4ec799,_0x3fa943){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4ec799[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3fa943,null))[_0x44b8('0x13')](function(_0x3b1643){if(_0x3b1643){return _0x3b1643['removeBlackLists'](_0x4ec799[_0x44b8('0x32')]['ids']);}})['then'](function(_0x9a5734){if(_0x9a5734){return db[_0x44b8('0x54')][_0x44b8('0x12')]({'where':{'ListId':_0x4ec799[_0x44b8('0x32')][_0x44b8('0x67')],'VoiceQueueId':_0x4ec799['params']['id']}})['then'](function(){return _0x9a5734;});}})['then'](respondWithStatusCode(_0x3fa943,null))[_0x44b8('0x2d')](handleError(_0x3fa943,null));}; \ No newline at end of file +var _0x9957=['includes','find','type','name','UserProfileResource','destroy','stack','send','fieldName','key','getOptions','include','query','findAll','catch','show','params','model','rawAttributes','filters','attributes','intersection','fields','includeAll','merge','VoiceQueue','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','error','clone','length','options','omit','updatedAt','user','role','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','keys','order','sort','where','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','Agents','voicePause','interface','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','online','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','createdAt','select','ContactId','CmListId','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','VoiceQueues','QueueCampaigns','filter','ignore','map','value'];(function(_0x333456,_0x2993b5){var _0x13ea10=function(_0x2c5a5b){while(--_0x2c5a5b){_0x333456['push'](_0x333456['shift']());}};_0x13ea10(++_0x2993b5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var moment=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var _=require(_0x7995('0x3'));var squel=require('squel');var Redis=require(_0x7995('0x4'));var qs=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var db=require(_0x7995('0x8'))['db'];config[_0x7995('0x9')]=_[_0x7995('0xa')](config[_0x7995('0x9')],{'host':_0x7995('0xb'),'port':0x18eb});var socket=require(_0x7995('0xc'))(new Redis(config['redis']));require(_0x7995('0xd'))[_0x7995('0xe')](socket);function respondWithStatusCode(_0x4a64f7,_0xa2e5f0){_0xa2e5f0=_0xa2e5f0||0xcc;return function(_0x3116fb){if(_0x3116fb){return _0x4a64f7[_0x7995('0xf')](_0xa2e5f0);}return _0x4a64f7[_0x7995('0x10')](_0xa2e5f0)[_0x7995('0x11')]();};}function respondWithResult(_0x1e400a,_0x341672){_0x341672=_0x341672||0xc8;return function(_0x524f7b){if(_0x524f7b){return _0x1e400a[_0x7995('0x10')](_0x341672)[_0x7995('0x12')](_0x524f7b);}};}function respondWithFilteredResult(_0x581f22,_0xb0c872){return function(_0x2cb37a){if(_0x2cb37a){var _0x19a27e=typeof _0xb0c872[_0x7995('0x13')]===_0x7995('0x14')&&typeof _0xb0c872[_0x7995('0x15')]===_0x7995('0x14');var _0x4cc004=_0x2cb37a['count'];var _0x2b4e94=_0x19a27e?0x0:_0xb0c872[_0x7995('0x13')];var _0x24b5bb=_0x19a27e?_0x2cb37a[_0x7995('0x16')]:_0xb0c872[_0x7995('0x13')]+_0xb0c872[_0x7995('0x15')];var _0x2202ce;if(_0x24b5bb>=_0x4cc004){_0x24b5bb=_0x4cc004;_0x2202ce=0xc8;}else{_0x2202ce=0xce;}_0x581f22[_0x7995('0x10')](_0x2202ce);return _0x581f22['set'](_0x7995('0x17'),_0x2b4e94+'-'+_0x24b5bb+'/'+_0x4cc004)['json'](_0x2cb37a);}return null;};}function saveUpdates(_0x2f832e){return function(_0x37f297){if(_0x37f297){return _0x37f297[_0x7995('0x18')](_0x2f832e)[_0x7995('0x19')](function(_0x1e1415){return _0x1e1415;});}return null;};}function removeEntity(_0x37a7d4){return function(_0x4faa60){if(_0x4faa60){return _0x4faa60['destroy']()[_0x7995('0x19')](function(){var _0x5e6f90=_0x4faa60['get']({'plain':!![]});var _0x3ec178=[{'name':_0x7995('0x1a'),'value':'inbound','ignore':![]},{'name':_0x7995('0x1b'),'value':'outbound','ignore':![]}];var _0x4b1a8e=_(_0x3ec178)[_0x7995('0x1c')](_0x7995('0x1d'))[_0x7995('0x1e')](_0x7995('0x1f'))[_0x7995('0x1f')]();if(_[_0x7995('0x20')](_0x4b1a8e,_0x5e6f90['type'])){return;}var _0x32a09a=_[_0x7995('0x21')](_0x3ec178,[_0x7995('0x1f'),_0x5e6f90[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x24')][_0x7995('0x25')]({'where':{'type':_0x32a09a,'resourceId':_0x5e6f90['id']}})[_0x7995('0x19')](function(){return _0x4faa60;});})['then'](function(){_0x37a7d4[_0x7995('0x10')](0xcc)[_0x7995('0x11')]();});}};}function handleEntityNotFound(_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x401dc3[_0x7995('0xf')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x26')]);if(_0x47625f[_0x7995('0x23')]){delete _0x47625f[_0x7995('0x23')];}_0x2a307e[_0x7995('0x10')](_0x56691a)[_0x7995('0x27')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={};var _0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x28')],'type':_0x3573be[_0x7995('0x22')][_0x7995('0x29')]};});_0x456a28=qs[_0x7995('0x2a')](_0x4253e5,_0x9b2a15);var _0x1ca460={'where':_0x456a28['where']};return db['VoiceQueue'][_0x7995('0x16')](_0x1ca460)['then'](function(_0x553671){_0x3250e0[_0x7995('0x16')]=_0x553671;_0x456a28[_0x7995('0x2b')]=qs[_0x7995('0x2b')](_0x9b2a15[_0x7995('0x2c')]);return db['VoiceQueue'][_0x7995('0x2d')](_0x456a28);})[_0x7995('0x19')](function(_0x5dd802){_0x3250e0['rows']=_0x5dd802;return _0x3250e0;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x2e')](handleError(_0x514445,null));};exports[_0x7995('0x2f')]=function(_0x4a176f,_0x3e7020){var _0x51b95d={'raw':![],'where':{'id':_0x4a176f[_0x7995('0x30')]['id']}},_0x37917b={};_0x37917b[_0x7995('0x31')]=_['keys'](db['VoiceQueue'][_0x7995('0x32')]);_0x37917b['query']=_['keys'](_0x4a176f[_0x7995('0x2c')]);_0x37917b[_0x7995('0x33')]=_['intersection'](_0x37917b[_0x7995('0x31')],_0x37917b[_0x7995('0x2c')]);_0x51b95d[_0x7995('0x34')]=_[_0x7995('0x35')](_0x37917b[_0x7995('0x31')],qs['fields'](_0x4a176f[_0x7995('0x2c')][_0x7995('0x36')]));_0x51b95d[_0x7995('0x34')]=_0x51b95d[_0x7995('0x34')]['length']?_0x51b95d[_0x7995('0x34')]:_0x37917b[_0x7995('0x31')];if(_0x4a176f[_0x7995('0x2c')][_0x7995('0x37')]){_0x51b95d[_0x7995('0x2b')]=[{'all':!![]}];}_0x51b95d=_[_0x7995('0x38')]({},_0x51b95d,_0x4a176f['options']);return db[_0x7995('0x39')][_0x7995('0x21')](_0x51b95d)[_0x7995('0x19')](handleEntityNotFound(_0x3e7020,null))[_0x7995('0x19')](respondWithResult(_0x3e7020,null))[_0x7995('0x2e')](handleError(_0x3e7020,null));};exports[_0x7995('0x3a')]=function(_0x14d638,_0x270c0e){return db[_0x7995('0x39')][_0x7995('0x3a')](_0x14d638[_0x7995('0x3b')],{})[_0x7995('0x19')](function(_0x7b4e67){var _0x53cda2=_0x14d638['user'][_0x7995('0x3c')]({'plain':!![]});if(!_0x53cda2)throw new Error(_0x7995('0x3d'));if(_0x53cda2['role']==='user'){var _0x3f8522=_0x7b4e67['get']({'plain':!![]});var _0x504a33=[{'name':_0x7995('0x1a'),'value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':'outbound'}];var _0x46ac4f=_['find'](_0x504a33,[_0x7995('0x1f'),_0x3f8522['type']])['name'];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x46ac4f,'userProfileId':_0x53cda2[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x599ecb){if(_0x599ecb&&_0x599ecb[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x3f8522[_0x7995('0x23')],'resourceId':_0x3f8522['id'],'type':_0x599ecb['name'],'sectionId':_0x599ecb['id']},{})['then'](function(){return _0x7b4e67;});}else{return _0x7b4e67;}})[_0x7995('0x2e')](function(_0x55791b){logger[_0x7995('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55791b);throw _0x55791b;});}return _0x7b4e67;})[_0x7995('0x19')](respondWithResult(_0x270c0e,0xc9))['catch'](handleError(_0x270c0e,null));};exports[_0x7995('0x43')]=function(_0x1b0373,_0x4d9245){var _0x3e9e62={'where':{'id':_0x1b0373[_0x7995('0x30')]['id']}},_0x336ff2={};_0x336ff2[_0x7995('0x31')]=_['keys'](db[_0x7995('0x39')][_0x7995('0x32')]);_0x3e9e62[_0x7995('0x34')]=_['intersection'](_0x336ff2[_0x7995('0x31')],qs[_0x7995('0x36')](_0x1b0373[_0x7995('0x2c')][_0x7995('0x36')]));_0x3e9e62[_0x7995('0x34')]=_0x3e9e62['attributes'][_0x7995('0x44')]?_0x3e9e62[_0x7995('0x34')]:_0x336ff2['model'];if(_0x1b0373[_0x7995('0x2c')]['includeAll']){_0x3e9e62[_0x7995('0x2b')]=[{'all':!![]}];}_0x3e9e62=_[_0x7995('0x38')]({},_0x3e9e62,_0x1b0373[_0x7995('0x45')]);return db[_0x7995('0x39')][_0x7995('0x21')](_0x3e9e62)[_0x7995('0x19')](handleEntityNotFound(_0x4d9245,null))[_0x7995('0x19')](function(_0x4d46bc){if(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x3c')]({'plain':!![]});_0x427dcf=qs[_0x7995('0x46')](_0x427dcf,['id','createdAt',_0x7995('0x47')]);_0x1b0373[_0x7995('0x3b')]=_[_0x7995('0x46')](_0x1b0373['body'],['id','createdAt','updatedAt']);return db[_0x7995('0x39')][_0x7995('0x3a')](_['merge'](_0x427dcf,_0x1b0373[_0x7995('0x3b')]),{'include':_0x1b0373[_0x7995('0x2c')][_0x7995('0x37')]?[{'all':!![]}]:undefined})[_0x7995('0x19')](function(_0xc04004){var _0x528c8e=_0x1b0373[_0x7995('0x48')]['get']({'plain':!![]});if(!_0x528c8e)throw new Error(_0x7995('0x3d'));if(_0x528c8e[_0x7995('0x49')]===_0x7995('0x48')){var _0x50c7b5=_0xc04004['get']({'plain':!![]});var _0x54e2b1=[{'name':'VoiceQueues','value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':_0x7995('0x4a')}];var _0x150261=_[_0x7995('0x21')](_0x54e2b1,[_0x7995('0x1f'),_0x50c7b5[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x150261,'userProfileId':_0x528c8e[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x3da72b){if(_0x3da72b&&_0x3da72b[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x50c7b5[_0x7995('0x23')],'resourceId':_0x50c7b5['id'],'type':_0x3da72b[_0x7995('0x23')],'sectionId':_0x3da72b['id']},{})[_0x7995('0x19')](function(){return _0xc04004;});}else{return _0xc04004;}})['catch'](function(_0x56a374){logger[_0x7995('0x42')](_0x7995('0x4b'),_0x56a374);throw _0x56a374;});}return _0xc04004;});}})[_0x7995('0x19')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports['update']=function(_0x402fa0,_0x197b52){if(_0x402fa0[_0x7995('0x3b')]['id']){delete _0x402fa0[_0x7995('0x3b')]['id'];}return db['VoiceQueue'][_0x7995('0x21')]({'where':{'id':_0x402fa0[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x197b52,null))[_0x7995('0x19')](saveUpdates(_0x402fa0['body'],null))['then'](respondWithResult(_0x197b52,null))[_0x7995('0x2e')](handleError(_0x197b52,null));};exports[_0x7995('0x25')]=function(_0x6c0221,_0x1d69ce){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x6c0221[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1d69ce,null))[_0x7995('0x19')](removeEntity(_0x1d69ce,null))['catch'](handleError(_0x1d69ce,null));};exports[_0x7995('0x4c')]=function(_0x3ec5a8,_0xdf9e38){var _0x1ecfdb={'raw':![],'where':{}};var _0x59c5aa={};var _0x51bf6a={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3ec5a8['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0xdf9e38,null))[_0x7995('0x19')](function(_0x2e3421){if(_0x2e3421){_0x59c5aa[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopper'][_0x7995('0x32')]);_0x59c5aa['query']=_[_0x7995('0x4e')](_0x3ec5a8[_0x7995('0x2c')]);_0x59c5aa[_0x7995('0x33')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],_0x59c5aa[_0x7995('0x2c')]);_0x1ecfdb[_0x7995('0x34')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x36')]));_0x1ecfdb['attributes']=_0x1ecfdb[_0x7995('0x34')][_0x7995('0x44')]?_0x1ecfdb[_0x7995('0x34')]:_0x59c5aa[_0x7995('0x31')];if(!_0x3ec5a8[_0x7995('0x2c')]['hasOwnProperty']('nolimit')){_0x1ecfdb[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x15')]);_0x1ecfdb['offset']=qs[_0x7995('0x13')](_0x3ec5a8['query']['offset']);}_0x1ecfdb[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x50')]);_0x1ecfdb[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x3ec5a8[_0x7995('0x2c')],_0x59c5aa[_0x7995('0x33')]));_0x1ecfdb[_0x7995('0x51')]['VoiceQueueId']=_0x2e3421['id'];if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]){_0x1ecfdb[_0x7995('0x51')]=_['merge'](_0x1ecfdb[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x1ecfdb[_0x7995('0x34')],function(_0x3a7d9d){var _0x3b0d30={};_0x3b0d30[_0x3a7d9d]={'$like':'%'+_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x3b0d30;})});}_0x1ecfdb=_[_0x7995('0x38')]({},_0x1ecfdb,_0x3ec5a8[_0x7995('0x45')]);return db[_0x7995('0x53')][_0x7995('0x16')]({'where':_0x1ecfdb['where']})['then'](function(_0xd07c1c){_0x51bf6a[_0x7995('0x16')]=_0xd07c1c;if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x37')]){_0x1ecfdb['include']=[{'all':!![]}];}return db[_0x7995('0x53')][_0x7995('0x2d')](_0x1ecfdb);})['then'](function(_0x480fdb){_0x51bf6a[_0x7995('0x54')]=_0x480fdb;return _0x51bf6a;});}})[_0x7995('0x19')](respondWithFilteredResult(_0xdf9e38,_0x1ecfdb))['catch'](handleError(_0xdf9e38,null));};exports[_0x7995('0x55')]=function(_0x5b1cba,_0x3758f9){var _0xea9aba={'raw':!![],'where':{}};var _0x4ff9ff={};var _0x5d9d33={'count':0x0,'rows':[]};return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x5b1cba[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3758f9,null))[_0x7995('0x19')](function(_0x45bd8a){if(_0x45bd8a){_0x4ff9ff[_0x7995('0x31')]=_[_0x7995('0x4e')](db[_0x7995('0x56')][_0x7995('0x32')]);_0x4ff9ff[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x5b1cba[_0x7995('0x2c')]);_0x4ff9ff[_0x7995('0x33')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],_0x4ff9ff[_0x7995('0x2c')]);_0xea9aba[_0x7995('0x34')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],qs[_0x7995('0x36')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x36')]));_0xea9aba[_0x7995('0x34')]=_0xea9aba[_0x7995('0x34')][_0x7995('0x44')]?_0xea9aba[_0x7995('0x34')]:_0x4ff9ff[_0x7995('0x31')];if(!_0x5b1cba[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0xea9aba[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x5b1cba['query']['limit']);_0xea9aba[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x13')]);}_0xea9aba[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x5b1cba['query'][_0x7995('0x50')]);_0xea9aba[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5b1cba[_0x7995('0x2c')],_0x4ff9ff[_0x7995('0x33')]));_0xea9aba[_0x7995('0x51')][_0x7995('0x58')]=_0x45bd8a['id'];if(_0x5b1cba['query'][_0x7995('0x1c')]){_0xea9aba[_0x7995('0x51')]=_['merge'](_0xea9aba['where'],{'$or':_[_0x7995('0x1e')](_0xea9aba[_0x7995('0x34')],function(_0x18e1a2){var _0x3db7a9={};_0x3db7a9[_0x18e1a2]={'$like':'%'+_0x5b1cba[_0x7995('0x2c')]['filter']+'%'};return _0x3db7a9;})});}_0xea9aba=_[_0x7995('0x38')]({},_0xea9aba,_0x5b1cba[_0x7995('0x45')]);return db['CmHopperHistory'][_0x7995('0x16')]({'where':_0xea9aba[_0x7995('0x51')]})['then'](function(_0x1535a3){_0x5d9d33['count']=_0x1535a3;if(_0x5b1cba[_0x7995('0x2c')][_0x7995('0x37')]){_0xea9aba[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x56')][_0x7995('0x2d')](_0xea9aba);})['then'](function(_0x1f0506){_0x5d9d33[_0x7995('0x54')]=_0x1f0506;return _0x5d9d33;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x3758f9,_0xea9aba))['catch'](handleError(_0x3758f9,null));};exports[_0x7995('0x59')]=function(_0x3f3434,_0x350ed3){var _0x308a26={'raw':!![],'where':{}};var _0x5d7018={};var _0x3356fd={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3f3434['params']['id']}})['then'](handleEntityNotFound(_0x350ed3,null))[_0x7995('0x19')](function(_0x333379){if(_0x333379){_0x5d7018['model']=_['keys'](db[_0x7995('0x5a')][_0x7995('0x32')]);_0x5d7018[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x3f3434[_0x7995('0x2c')]);_0x5d7018['filters']=_['intersection'](_0x5d7018[_0x7995('0x31')],_0x5d7018['query']);_0x308a26['attributes']=_[_0x7995('0x35')](_0x5d7018[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3f3434['query'][_0x7995('0x36')]));_0x308a26[_0x7995('0x34')]=_0x308a26[_0x7995('0x34')][_0x7995('0x44')]?_0x308a26[_0x7995('0x34')]:_0x5d7018['model'];if(!_0x3f3434[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x308a26[_0x7995('0x15')]=qs['limit'](_0x3f3434[_0x7995('0x2c')][_0x7995('0x15')]);_0x308a26['offset']=qs[_0x7995('0x13')](_0x3f3434[_0x7995('0x2c')]['offset']);}_0x308a26[_0x7995('0x4f')]=qs['sort'](_0x3f3434[_0x7995('0x2c')]['sort']);_0x308a26[_0x7995('0x51')]=qs['filters'](_[_0x7995('0x52')](_0x3f3434[_0x7995('0x2c')],_0x5d7018['filters']));_0x308a26[_0x7995('0x51')]['VoiceQueueId']=_0x333379['id'];if(_0x3f3434['query'][_0x7995('0x1c')]){_0x308a26[_0x7995('0x51')]=_[_0x7995('0x38')](_0x308a26[_0x7995('0x51')],{'$or':_['map'](_0x308a26[_0x7995('0x34')],function(_0x35044a){var _0x4bd29f={};_0x4bd29f[_0x35044a]={'$like':'%'+_0x3f3434['query'][_0x7995('0x1c')]+'%'};return _0x4bd29f;})});}_0x308a26=_['merge']({},_0x308a26,_0x3f3434[_0x7995('0x45')]);return db[_0x7995('0x5a')][_0x7995('0x16')]({'where':_0x308a26['where']})['then'](function(_0x2b7852){_0x3356fd['count']=_0x2b7852;if(_0x3f3434[_0x7995('0x2c')][_0x7995('0x37')]){_0x308a26[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x5a')]['findAll'](_0x308a26);})['then'](function(_0x50f880){_0x3356fd[_0x7995('0x54')]=_0x50f880;return _0x3356fd;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x350ed3,_0x308a26))[_0x7995('0x2e')](handleError(_0x350ed3,null));};exports[_0x7995('0x5c')]=function(_0x265f07,_0x168e7f){var _0x59a793={'raw':!![],'where':{}};var _0x53cbec={};var _0x1a2902={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x265f07[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x168e7f,null))['then'](function(_0x35c3f3){if(_0x35c3f3){_0x53cbec[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopperBlack'][_0x7995('0x32')]);_0x53cbec[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x265f07[_0x7995('0x2c')]);_0x53cbec[_0x7995('0x33')]=_[_0x7995('0x35')](_0x53cbec[_0x7995('0x31')],_0x53cbec[_0x7995('0x2c')]);_0x59a793[_0x7995('0x34')]=_['intersection'](_0x53cbec[_0x7995('0x31')],qs[_0x7995('0x36')](_0x265f07[_0x7995('0x2c')][_0x7995('0x36')]));_0x59a793[_0x7995('0x34')]=_0x59a793['attributes'][_0x7995('0x44')]?_0x59a793[_0x7995('0x34')]:_0x53cbec[_0x7995('0x31')];if(!_0x265f07['query']['hasOwnProperty']('nolimit')){_0x59a793[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x265f07[_0x7995('0x2c')][_0x7995('0x15')]);_0x59a793[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x265f07['query'][_0x7995('0x13')]);}_0x59a793['order']=qs[_0x7995('0x50')](_0x265f07[_0x7995('0x2c')][_0x7995('0x50')]);_0x59a793[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x265f07[_0x7995('0x2c')],_0x53cbec[_0x7995('0x33')]));_0x59a793[_0x7995('0x51')][_0x7995('0x58')]=_0x35c3f3['id'];if(_0x265f07[_0x7995('0x2c')]['filter']){_0x59a793[_0x7995('0x51')]=_['merge'](_0x59a793[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x59a793['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x265f07[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x2a25eb;})});}_0x59a793=_[_0x7995('0x38')]({},_0x59a793,_0x265f07[_0x7995('0x45')]);return db[_0x7995('0x5d')][_0x7995('0x16')]({'where':_0x59a793[_0x7995('0x51')]})[_0x7995('0x19')](function(_0x3c9b3c){_0x1a2902[_0x7995('0x16')]=_0x3c9b3c;if(_0x265f07[_0x7995('0x2c')]['includeAll']){_0x59a793['include']=[{'all':!![]}];}return db[_0x7995('0x5d')][_0x7995('0x2d')](_0x59a793);})[_0x7995('0x19')](function(_0x1531a9){_0x1a2902[_0x7995('0x54')]=_0x1531a9;return _0x1a2902;});}})['then'](respondWithFilteredResult(_0x168e7f,_0x59a793))[_0x7995('0x2e')](handleError(_0x168e7f,null));};exports[_0x7995('0x5e')]=function(_0x5ebf5e,_0x46fc1c){var _0x53d693={};var _0x37416c={};var _0x30cda5;var _0x234a40;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x5ebf5e[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x46fc1c,null))[_0x7995('0x19')](function(_0x11f9fb){if(_0x11f9fb){_0x30cda5=_0x11f9fb;_0x37416c[_0x7995('0x31')]=_[_0x7995('0x4e')](db['Team']['rawAttributes']);_0x37416c['query']=_[_0x7995('0x4e')](_0x5ebf5e[_0x7995('0x2c')]);_0x37416c['filters']=_['intersection'](_0x37416c[_0x7995('0x31')],_0x37416c[_0x7995('0x2c')]);_0x53d693['attributes']=_['intersection'](_0x37416c['model'],qs['fields'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x36')]));_0x53d693[_0x7995('0x34')]=_0x53d693[_0x7995('0x34')]['length']?_0x53d693[_0x7995('0x34')]:_0x37416c[_0x7995('0x31')];_0x53d693['order']=qs[_0x7995('0x50')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x50')]);_0x53d693['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5ebf5e['query'],_0x37416c[_0x7995('0x33')]));if(_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]){_0x53d693[_0x7995('0x51')]=_[_0x7995('0x38')](_0x53d693[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x53d693[_0x7995('0x34')],function(_0x4254de){var _0x278004={};_0x278004[_0x4254de]={'$like':'%'+_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x278004;})});}_0x53d693=_[_0x7995('0x38')]({},_0x53d693,_0x5ebf5e['options']);return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})[_0x7995('0x19')](function(_0x3603e8){if(_0x3603e8){_0x234a40=_0x3603e8[_0x7995('0x44')];if(!_0x5ebf5e['query'][_0x7995('0x57')](_0x7995('0x5b'))){_0x53d693[_0x7995('0x15')]=qs['limit'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x15')]);_0x53d693[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})['then'](function(_0x35dbd7){if(_0x35dbd7){return _0x35dbd7?{'count':_0x234a40,'rows':_0x35dbd7}:null;}})['then'](respondWithResult(_0x46fc1c,null))[_0x7995('0x2e')](handleError(_0x46fc1c,null));};exports[_0x7995('0x5f')]=function(_0x2190d1,_0x4cae1c){var _0xd012b9=_0x2190d1['body']['teams'];var _0x4ee5ee=_['map'](_0xd012b9,'id');return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x4ee5ee},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7995('0x61'),'attributes':['id',_0x7995('0x23'),'online',_0x7995('0x62'),_0x7995('0x63')],'raw':!![]}]})[_0x7995('0x19')](function(_0x45a479){if(_0x45a479){var _0x443863=_['flatMap'](_0x45a479,function(_0x38ea3e){var _0x1df81d=_0x38ea3e[_0x7995('0x3c')]({'plain':!![]});_0x1df81d[_0x7995('0x61')]['forEach'](function(_0x428d5a){_0x428d5a[_0x7995('0x64')]=_[_0x7995('0x21')](_0xd012b9,{'id':_0x1df81d['id']})[_0x7995('0x64')];});return _0x1df81d[_0x7995('0x61')];});return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2190d1[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x1fda95){return db['sequelize'][_0x7995('0x65')](function(_0x521712){return _0x1fda95[_0x7995('0x5f')](_0x4ee5ee,{'transaction':_0x521712})[_0x7995('0x19')](function(){return BPromise[_0x7995('0x66')](_0xd012b9,function(_0x50eb5e){return db['TeamVoiceQueue'][_0x7995('0x67')]({'TeamId':_0x50eb5e['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id'],'penalty':_0x50eb5e['penalty']},{'transaction':_0x521712});});})[_0x7995('0x19')](function(){return BPromise['each'](_0x443863,function(_0x43de18){return db[_0x7995('0x68')][_0x7995('0x69')]({'where':{'UserId':_0x43de18['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id']},'defaults':{'penalty':_0x43de18['penalty']},'transaction':_0x521712});});})['then'](function(){return BPromise[_0x7995('0x66')](_[_0x7995('0x1c')](_0x443863,{'online':!![]}),function(_0x365318){return db[_0x7995('0x6a')]['upsert']({'membername':_0x365318[_0x7995('0x23')],'UserId':_0x365318['id'],'queue_name':_0x1fda95[_0x7995('0x23')],'VoiceQueueId':_0x1fda95['id'],'interface':_[_0x7995('0x6b')](_0x365318[_0x7995('0x63')])?util[_0x7995('0x6c')]('SIP/%s',_0x365318['name']):_0x365318['interface'],'paused':_0x365318[_0x7995('0x62')]||![],'penalty':_0x365318[_0x7995('0x64')]},{'transaction':_0x521712});});})['then'](function(){_0x443863[_0x7995('0x6d')](function(_0x5635d6){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':_0x5635d6['id'],'VoiceQueueId':_0x1fda95['id']});});});});});}})[_0x7995('0x19')](respondWithStatusCode(_0x4cae1c,null))[_0x7995('0x2e')](handleError(_0x4cae1c,null));};exports['removeTeams']=function(_0x3fbafb,_0x2caacd){return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7995('0x71')],'as':_0x7995('0x61'),'attributes':['id'],'raw':!![]}]})[_0x7995('0x19')](handleEntityNotFound(_0x2caacd,null))[_0x7995('0x19')](function(_0x30893a){var _0x2b8d90=_[_0x7995('0x1e')](_0x30893a,'id');var _0x2122af=[];var _0x4ff0b6=[];var _0x764245=squel['select']();_0x764245[_0x7995('0x72')](_0x7995('0x73'))['from'](_0x7995('0x74'),'tq')['join'](_0x7995('0x75'),'ut',_0x7995('0x76'))['where']('VoiceQueueId\x20=\x20?',_0x3fbafb['params']['id']);for(var _0x8f5ecd=0x0;_0x8f5ecd<_0x30893a[_0x7995('0x44')];_0x8f5ecd+=0x1){let _0x139f76=_0x30893a[_0x8f5ecd];for(var _0x2b7bc2=0x0;_0x2b7bc2<_0x139f76['Agents'][_0x7995('0x44')];_0x2b7bc2+=0x1){let _0x2b2814=_0x139f76[_0x7995('0x61')][_0x2b7bc2];var _0x2de960=_0x764245[_0x7995('0x43')]();_0x2de960[_0x7995('0x51')](_0x7995('0x77'),_0x2b2814['id']);_0x4ff0b6[_0x7995('0x78')](db['sequelize'][_0x7995('0x2c')](_0x2de960[_0x7995('0x79')](),{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT']})[_0x7995('0x19')](function(_0x3a2958){if(_0x3a2958[_0x7995('0x44')]===0x1){return _0x2b2814['id'];}else{var _0x339e6b=_[_0x7995('0x7c')](_[_0x7995('0x1e')](_0x3a2958,'TeamId'),function(_0x1bc617){return _[_0x7995('0x20')](_0x2b8d90,_0x1bc617);});if(_0x339e6b){return _0x2b2814['id'];}}}));}}return BPromise[_0x7995('0x7d')](_0x4ff0b6)[_0x7995('0x19')](function(_0x3fcc49){_0x2122af=_(_0x2122af)[_0x7995('0x7e')](_0x3fcc49)[_0x7995('0x7f')]()[_0x7995('0x1f')]();return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3fbafb[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x64a62d){return db[_0x7995('0x7a')][_0x7995('0x65')](function(_0x370984){return _0x64a62d[_0x7995('0x80')](_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')],{'transaction':_0x370984})[_0x7995('0x19')](function(){if(!_[_0x7995('0x81')](_0x2122af)){return _0x64a62d['removeAgents'](_0x2122af,{'transaction':_0x370984})['then'](function(){return db[_0x7995('0x6a')][_0x7995('0x25')]({'where':{'VoiceQueueId':_0x3fbafb['params']['id'],'UserId':_0x2122af},'transaction':_0x370984});});}})[_0x7995('0x19')](function(){_0x2122af['forEach'](function(_0x2ce103){socket['emit'](_0x7995('0x82'),{'UserId':_0x2ce103,'VoiceQueueId':_0x64a62d['id']});});});});});});})[_0x7995('0x19')](respondWithStatusCode(_0x2caacd,null))[_0x7995('0x2e')](handleError(_0x2caacd,null));};exports[_0x7995('0x83')]=function(_0x3aa676,_0x1df2a2){var _0xd82313,_0x1fa59d;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3aa676['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1df2a2,null))[_0x7995('0x19')](function(_0x1d0481){if(_0x1d0481){_0x1fa59d=_0x1d0481;return _0x1d0481[_0x7995('0x83')](_0x3aa676['body'][_0x7995('0x70')],_[_0x7995('0x46')](_0x3aa676[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{})['spread'](function(_0x32c550){for(var _0x37e647=0x0;_0x37e647<_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x7995('0x44')];_0x37e647+=0x1){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':Number(_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x37e647]),'VoiceQueueId':Number(_0x3aa676['params']['id'])});}return _0x32c550;});}})[_0x7995('0x19')](function(_0x5f5496){_0xd82313=_0x5f5496||[];if(_0x1fa59d){return db[_0x7995('0x71')][_0x7995('0x2d')]({'where':{'id':_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')]},'attributes':['id','name',_0x7995('0x84'),_0x7995('0x62'),_0x7995('0x63')],'raw':!![]});}})[_0x7995('0x19')](function(_0x2c715){if(!_[_0x7995('0x81')](_0x2c715)){var _0x3661ab=[];for(var _0x408692=0x0;_0x408692<_0x2c715[_0x7995('0x44')];_0x408692++){if(_0x2c715[_0x408692][_0x7995('0x84')]){_0x3661ab[_0x7995('0x78')](db[_0x7995('0x6a')][_0x7995('0x67')]({'membername':_0x2c715[_0x408692][_0x7995('0x23')],'UserId':_0x2c715[_0x408692]['id'],'queue_name':_0x1fa59d['name'],'VoiceQueueId':_0x1fa59d['id'],'interface':_['isNil'](_0x2c715[_0x408692][_0x7995('0x63')])?util[_0x7995('0x6c')](_0x7995('0x85'),_0x2c715[_0x408692]['name']):_0x2c715[_0x408692][_0x7995('0x63')],'paused':_0x2c715[_0x408692][_0x7995('0x62')]||![],'penalty':_0x3aa676[_0x7995('0x3b')]['penalty']||0x0}));}}return BPromise[_0x7995('0x7d')](_0x3661ab);}})[_0x7995('0x19')](function(){return _0xd82313;})[_0x7995('0x19')](respondWithResult(_0x1df2a2,null))[_0x7995('0x2e')](handleError(_0x1df2a2,null));};exports[_0x7995('0x86')]=function(_0x3d42a3,_0x29fb77){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3d42a3[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x29fb77,null))['then'](function(_0x580571){if(_0x580571){return _0x580571[_0x7995('0x86')](_0x3d42a3['query'][_0x7995('0x70')])[_0x7995('0x19')](function(){if(_[_0x7995('0x87')](_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')])){for(var _0x4eebf4=0x0;_0x4eebf4<_0x3d42a3['query'][_0x7995('0x70')][_0x7995('0x44')];_0x4eebf4+=0x1){socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')][_0x4eebf4]),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}}else{socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')]['ids']),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}});}})[_0x7995('0x19')](function(_0x38e67a){return db[_0x7995('0x6a')]['destroy']({'where':{'VoiceQueueId':_0x3d42a3['params']['id'],'UserId':_0x3d42a3['query']['ids']}})['then'](function(){return _0x38e67a;});})[_0x7995('0x19')](respondWithStatusCode(_0x29fb77,null))['catch'](handleError(_0x29fb77,null));};exports['getAgents']=function(_0x32f19d,_0x44dbb8){var _0x181ed6={};var _0x48b807={};var _0xba00af;var _0x4f008a;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x32f19d[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x44dbb8,null))[_0x7995('0x19')](function(_0x14be06){if(_0x14be06){_0xba00af=_0x14be06;_0x48b807[_0x7995('0x31')]=_['keys'](db[_0x7995('0x71')][_0x7995('0x32')]);_0x48b807[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x32f19d[_0x7995('0x2c')]);_0x48b807['filters']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],_0x48b807[_0x7995('0x2c')]);_0x181ed6['attributes']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],qs[_0x7995('0x36')](_0x32f19d[_0x7995('0x2c')][_0x7995('0x36')]));_0x181ed6['attributes']=_0x181ed6[_0x7995('0x34')][_0x7995('0x44')]?_0x181ed6[_0x7995('0x34')]:_0x48b807[_0x7995('0x31')];_0x181ed6[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x32f19d[_0x7995('0x2c')]['sort']);_0x181ed6['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x32f19d['query'],_0x48b807['filters']));if(_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]){_0x181ed6[_0x7995('0x51')]=_[_0x7995('0x38')](_0x181ed6[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x181ed6[_0x7995('0x34')],function(_0x4dca11){var _0xf90cd8={};_0xf90cd8[_0x4dca11]={'$like':'%'+_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0xf90cd8;})});}_0x181ed6=_[_0x7995('0x38')]({},_0x181ed6,_0x32f19d[_0x7995('0x45')]);return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x1d7c33){if(_0x1d7c33){_0x4f008a=_0x1d7c33[_0x7995('0x44')];if(!_0x32f19d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x181ed6[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x32f19d['query'][_0x7995('0x15')]);_0x181ed6[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x32f19d[_0x7995('0x2c')]['offset']);}return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x21ba9b){if(_0x21ba9b){return _0x21ba9b?{'count':_0x4f008a,'rows':_0x21ba9b}:null;}})[_0x7995('0x19')](respondWithResult(_0x44dbb8,null))['catch'](handleError(_0x44dbb8,null));};exports['getMembers']=function(_0x478c12,_0x3b22ec){var _0xf503d5={};var _0x7d2ccf={};var _0x18a3dc;var _0x503b32;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x478c12[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3b22ec,null))[_0x7995('0x19')](function(_0x1fa484){if(_0x1fa484){_0x18a3dc=_0x1fa484;_0x7d2ccf[_0x7995('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x7995('0x32')]);_0x7d2ccf['query']=_['keys'](_0x478c12[_0x7995('0x2c')]);_0x7d2ccf[_0x7995('0x33')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],_0x7d2ccf[_0x7995('0x2c')]);_0xf503d5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],qs[_0x7995('0x36')](_0x478c12[_0x7995('0x2c')][_0x7995('0x36')]));_0xf503d5[_0x7995('0x34')]=_0xf503d5['attributes'][_0x7995('0x44')]?_0xf503d5[_0x7995('0x34')]:_0x7d2ccf[_0x7995('0x31')];_0xf503d5[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x478c12[_0x7995('0x2c')][_0x7995('0x50')]);_0xf503d5['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x478c12[_0x7995('0x2c')],_0x7d2ccf[_0x7995('0x33')]));if(_0x478c12[_0x7995('0x2c')]['filter']){_0xf503d5[_0x7995('0x51')]=_['merge'](_0xf503d5[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0xf503d5[_0x7995('0x34')],function(_0x5150aa){var _0x260e84={};_0x260e84[_0x5150aa]={'$like':'%'+_0x478c12[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x260e84;})});}_0xf503d5=_[_0x7995('0x38')]({},_0xf503d5,_0x478c12[_0x7995('0x45')]);return _0x18a3dc[_0x7995('0x89')](_0xf503d5);}})[_0x7995('0x19')](function(_0x4fb899){if(_0x4fb899){_0x503b32=_0x4fb899['length'];if(!_0x478c12[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0xf503d5[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x478c12[_0x7995('0x2c')]['limit']);_0xf503d5[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x478c12[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x18a3dc['getMembers'](_0xf503d5);}})['then'](function(_0x5b93e6){return _0x5b93e6?{'count':_0x503b32,'rows':_0x5b93e6}:null;})[_0x7995('0x19')](respondWithResult(_0x3b22ec,null))['catch'](handleError(_0x3b22ec,null));};exports[_0x7995('0x8a')]=function(_0x1b6411,_0x54e348){var _0x390bd3={};var _0x3f0a01={};var _0x45d8a2;var _0x26ab59;return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x1b6411['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x54e348,null))[_0x7995('0x19')](function(_0x2cfa1d){if(_0x2cfa1d){_0x45d8a2=_0x2cfa1d;_0x3f0a01[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmList'][_0x7995('0x32')]);_0x3f0a01[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x1b6411[_0x7995('0x2c')]);_0x3f0a01[_0x7995('0x33')]=_['intersection'](_0x3f0a01['model'],_0x3f0a01['query']);_0x390bd3['attributes']=_[_0x7995('0x35')](_0x3f0a01[_0x7995('0x31')],qs['fields'](_0x1b6411[_0x7995('0x2c')][_0x7995('0x36')]));_0x390bd3['attributes']=_0x390bd3['attributes'][_0x7995('0x44')]?_0x390bd3[_0x7995('0x34')]:_0x3f0a01[_0x7995('0x31')];_0x390bd3[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x50')]);_0x390bd3['where']=qs['filters'](_[_0x7995('0x52')](_0x1b6411[_0x7995('0x2c')],_0x3f0a01[_0x7995('0x33')]));if(_0x1b6411['query'][_0x7995('0x1c')]){_0x390bd3[_0x7995('0x51')]=_[_0x7995('0x38')](_0x390bd3[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x390bd3[_0x7995('0x34')],function(_0x28ac7c){var _0x1b4cab={};_0x1b4cab[_0x28ac7c]={'$like':'%'+_0x1b6411[_0x7995('0x2c')]['filter']+'%'};return _0x1b4cab;})});}_0x390bd3=_['merge']({},_0x390bd3,_0x1b6411[_0x7995('0x45')]);return _0x45d8a2['getLists'](_0x390bd3);}})[_0x7995('0x19')](function(_0x5953d1){if(_0x5953d1){_0x26ab59=_0x5953d1[_0x7995('0x44')];if(!_0x1b6411[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0x390bd3['limit']=qs[_0x7995('0x15')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x15')]);_0x390bd3[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x45d8a2[_0x7995('0x8a')](_0x390bd3);}})[_0x7995('0x19')](function(_0x35403c){if(_0x35403c){return _0x35403c?{'count':_0x26ab59,'rows':_0x35403c}:null;}})[_0x7995('0x19')](respondWithResult(_0x54e348,null))['catch'](handleError(_0x54e348,null));};exports[_0x7995('0x8b')]=function(_0xe43c99,_0x1b7e44){var _0x442c6d=moment()[_0x7995('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3b5edf,_0x44068f;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xe43c99[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1b7e44,null))[_0x7995('0x19')](function(_0x2b812f){if(_0x2b812f){_0x44068f=_0x2b812f;return _0x2b812f[_0x7995('0x8b')](_0xe43c99['body']['ids'],_[_0x7995('0x46')](_0xe43c99[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})[_0x7995('0x8c')](function(_0x17fd98){var _0x498d7c;_0x3b5edf=_0x17fd98||[];var _0x341024=[];if(_0x17fd98){for(var _0x2bcbc6=0x0;_0x2bcbc6<_0x17fd98[_0x7995('0x44')];_0x2bcbc6+=0x1){var _0x2dd6c7=_0x17fd98[_0x2bcbc6][_0x7995('0x3c')]({'plain':!![]});_0x44068f[_0x7995('0x8d')]=_0xe43c99[_0x7995('0x3b')][_0x7995('0x8d')]?_0xe43c99[_0x7995('0x3b')]['dialCheckDuplicateType']:_0x44068f['dialCheckDuplicateType'];switch(_0x44068f[_0x7995('0x8d')]){case _0x7995('0x8e'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),_0x7995('0x94'),'ContactId','ListId',_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),'VoiceQueueId')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')]('cm_contacts')[_0x7995('0x51')]('deletedAt\x20IS\x20NULL')[_0x7995('0x51')](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x9e'))['from']('cm_hopper_final')[_0x7995('0x51')](_0x7995('0x9f'),_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]()))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')]('COALESCE(phone,\x27\x27)')[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))[_0x7995('0x79')]();break;case _0x7995('0xa0'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt',_0x7995('0x97'),_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),'updatedAt'],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))['field'](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))['from'](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where']('ListId\x20=\x20?',_0x2dd6c7['CmListId'][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))[_0x7995('0x51')](_0x7995('0x9d'),squel[_0x7995('0x96')]()['field'](_0x7995('0xa3'))[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))['toString']();break;default:_0x498d7c=squel[_0x7995('0x8f')]()['into'](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt','ContactId',_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id','ContactId')['field'](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99['params']['id']['toString'](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where'](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')]['toString']())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();}_0x341024['push'](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x498d7c));}return BPromise[_0x7995('0x7d')](_0x341024);}})[_0x7995('0x19')](function(){var _0x113e03=[];var _0x5348b1=squel['insert']()[_0x7995('0x90')]('cm_hopper_additional_phones')[_0x7995('0x92')](['CmHopperId',_0x7995('0x93'),_0x7995('0xa4'),_0x7995('0x95'),'updatedAt'],squel['select']()['field'](_0x7995('0xa5'))[_0x7995('0x72')](_0x7995('0xa6'))['field'](_0x7995('0xa7'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa8'),'ci')[_0x7995('0xa9')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x7995('0x51')](_0x7995('0xaa'),_0x442c6d)[_0x7995('0x51')](_0x7995('0xab'),_0x7995('0xac')))[_0x7995('0x79')]();_0x113e03[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x5348b1));return BPromise[_0x7995('0x7d')](_0x113e03);})['then'](function(){return _0x3b5edf;})[_0x7995('0x19')](respondWithResult(_0x1b7e44,null))[_0x7995('0x2e')](handleError(_0x1b7e44,null));};exports[_0x7995('0xad')]=function(_0xff759b,_0x39ee00){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xff759b['params']['id']}})['then'](handleEntityNotFound(_0x39ee00,null))[_0x7995('0x19')](function(_0x2aec8d){if(_0x2aec8d){return _0x2aec8d[_0x7995('0xad')](_0xff759b[_0x7995('0x2c')]['ids']);}})['then'](function(_0x4b477a){if(_0x4b477a){return db[_0x7995('0x53')][_0x7995('0x25')]({'where':{'ListId':_0xff759b['query'][_0x7995('0x70')],'VoiceQueueId':_0xff759b[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x4b477a;});}})[_0x7995('0x19')](respondWithStatusCode(_0x39ee00,null))[_0x7995('0x2e')](handleError(_0x39ee00,null));};exports[_0x7995('0xae')]=function(_0x35229d,_0x22d392){var _0x57438e={};var _0x463c25={};var _0x13d525;var _0x37b7e7;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x35229d['params']['id']}})['then'](handleEntityNotFound(_0x22d392,null))['then'](function(_0x507bf3){if(_0x507bf3){_0x13d525=_0x507bf3;_0x463c25[_0x7995('0x31')]=_['keys'](db[_0x7995('0xaf')][_0x7995('0x32')]);_0x463c25['query']=_[_0x7995('0x4e')](_0x35229d[_0x7995('0x2c')]);_0x463c25[_0x7995('0x33')]=_[_0x7995('0x35')](_0x463c25['model'],_0x463c25[_0x7995('0x2c')]);_0x57438e['attributes']=_[_0x7995('0x35')](_0x463c25[_0x7995('0x31')],qs[_0x7995('0x36')](_0x35229d[_0x7995('0x2c')][_0x7995('0x36')]));_0x57438e[_0x7995('0x34')]=_0x57438e[_0x7995('0x34')][_0x7995('0x44')]?_0x57438e[_0x7995('0x34')]:_0x463c25[_0x7995('0x31')];_0x57438e['order']=qs[_0x7995('0x50')](_0x35229d[_0x7995('0x2c')]['sort']);_0x57438e[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x35229d[_0x7995('0x2c')],_0x463c25[_0x7995('0x33')]));if(_0x35229d[_0x7995('0x2c')]['filter']){_0x57438e[_0x7995('0x51')]=_['merge'](_0x57438e[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x57438e[_0x7995('0x34')],function(_0xb79b0b){var _0x259bf2={};_0x259bf2[_0xb79b0b]={'$like':'%'+_0x35229d[_0x7995('0x2c')]['filter']+'%'};return _0x259bf2;})});}_0x57438e=_[_0x7995('0x38')]({},_0x57438e,_0x35229d[_0x7995('0x45')]);return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x1176cd){if(_0x1176cd){_0x37b7e7=_0x1176cd[_0x7995('0x44')];if(!_0x35229d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x57438e[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x35229d[_0x7995('0x2c')][_0x7995('0x15')]);_0x57438e[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x35229d['query'][_0x7995('0x13')]);}return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x3098ef){if(_0x3098ef){return _0x3098ef?{'count':_0x37b7e7,'rows':_0x3098ef}:null;}})[_0x7995('0x19')](respondWithResult(_0x22d392,null))[_0x7995('0x2e')](handleError(_0x22d392,null));};exports[_0x7995('0xb0')]=function(_0x258f87,_0x5a5cc4){var _0x37af6b;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x258f87[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x5a5cc4,null))[_0x7995('0x19')](function(_0x120bef){if(_0x120bef){return _0x120bef[_0x7995('0xb0')](_0x258f87[_0x7995('0x3b')][_0x7995('0x70')],_[_0x7995('0x46')](_0x258f87[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})['spread'](function(_0x247b71){var _0x1ecb6f;_0x37af6b=_0x247b71||[];var _0x225a37=[];if(_0x247b71){for(var _0x1a9f59=0x0;_0x1a9f59<_0x247b71['length'];_0x1a9f59+=0x1){var _0x92a561=_0x247b71[_0x1a9f59][_0x7995('0x3c')]({'plain':!![]});_0x1ecb6f=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0xb1'))[_0x7995('0x92')]([_0x7995('0x93'),'ContactId',_0x7995('0x99'),'VoiceQueueId',_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('id',_0x7995('0x97'))['field'](_0x92a561[_0x7995('0x98')]['toString'](),_0x7995('0x99'))[_0x7995('0x72')](_0x258f87[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('NOW()',_0x7995('0x95'))[_0x7995('0x72')]('NOW()',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))[_0x7995('0x51')](_0x7995('0x9b'),_0x92a561[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();_0x225a37[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x1ecb6f));}return BPromise[_0x7995('0x7d')](_0x225a37);}})[_0x7995('0x19')](function(){return _0x37af6b;})['then'](respondWithResult(_0x5a5cc4,null))['catch'](handleError(_0x5a5cc4,null));};exports[_0x7995('0xb2')]=function(_0x2f3c17,_0x4fe5eb){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2f3c17['params']['id']}})['then'](handleEntityNotFound(_0x4fe5eb,null))[_0x7995('0x19')](function(_0x31a3d6){if(_0x31a3d6){return _0x31a3d6[_0x7995('0xb2')](_0x2f3c17[_0x7995('0x2c')][_0x7995('0x70')]);}})[_0x7995('0x19')](function(_0x1b3920){if(_0x1b3920){return db[_0x7995('0x5d')][_0x7995('0x25')]({'where':{'ListId':_0x2f3c17[_0x7995('0x2c')]['ids'],'VoiceQueueId':_0x2f3c17[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x1b3920;});}})[_0x7995('0x19')](respondWithStatusCode(_0x4fe5eb,null))[_0x7995('0x2e')](handleError(_0x4fe5eb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 981959f..a5ec7fb 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 _0x9dcf=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue'];(function(_0x5e6d65,_0x5db89c){var _0x5e1f75=function(_0x3729a1){while(--_0x3729a1){_0x5e6d65['push'](_0x5e6d65['shift']());}};_0x5e1f75(++_0x5db89c);}(_0x9dcf,0x114));var _0xf9dc=function(_0x58d937,_0x3550de){_0x58d937=_0x58d937-0x0;var _0x445496=_0x9dcf[_0x58d937];return _0x445496;};'use strict';var EventEmitter=require(_0xf9dc('0x0'));var VoiceQueue=require(_0xf9dc('0x1'))['db'][_0xf9dc('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf9dc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf9dc('0x4'),'afterDestroy':_0xf9dc('0x5')};function emitEvent(_0x5a0d8f){return function(_0x3d6c24,_0x49499b,_0xfbdf70){VoiceQueueEvents['emit'](_0x5a0d8f+':'+_0x3d6c24['id'],_0x3d6c24);VoiceQueueEvents[_0xf9dc('0x6')](_0x5a0d8f,_0x3d6c24);_0xfbdf70(null);};}for(var e in events){if(events[_0xf9dc('0x7')](e)){var event=events[e];VoiceQueue[_0xf9dc('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x28e1=['remove','emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x400df5,_0x13c4ff){var _0x47de81=function(_0x4f3889){while(--_0x4f3889){_0x400df5['push'](_0x400df5['shift']());}};_0x47de81(++_0x13c4ff);}(_0x28e1,0x11c));var _0x128e=function(_0x35c6e9,_0x438507){_0x35c6e9=_0x35c6e9-0x0;var _0x3cd6ae=_0x28e1[_0x35c6e9];return _0x3cd6ae;};'use strict';var EventEmitter=require(_0x128e('0x0'));var VoiceQueue=require(_0x128e('0x1'))['db'][_0x128e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x128e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x128e('0x4')};function emitEvent(_0x38273f){return function(_0x55ae4b,_0x18f810,_0x4d7487){VoiceQueueEvents[_0x128e('0x5')](_0x38273f+':'+_0x55ae4b['id'],_0x55ae4b);VoiceQueueEvents['emit'](_0x38273f,_0x55ae4b);_0x4d7487(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x128e('0x6')](e,emitEvent(event));}}module[_0x128e('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 cd5a7f1..3bca146 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x4031c0,_0x4df123){var _0x2f3527=function(_0x5ad852){while(--_0x5ad852){_0x4031c0['push'](_0x4031c0['shift']());}};_0x2f3527(++_0x4df123);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x21233e,_0x2d39c1){var _0x3752c9=function(_0x1201f3){while(--_0x1201f3){_0x21233e['push'](_0x21233e['shift']());}};_0x3752c9(++_0x2d39c1);}(_0x3e74,0x175));var _0x43e7=function(_0x48edb2,_0x479826){_0x48edb2=_0x48edb2-0x0;var _0x31104a=_0x3e74[_0x48edb2];return _0x31104a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 62c2f9d..915be29 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 _0x08a3=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','raw','attributes','limit','include','model','then','GetVoiceQueue','where','map','ShowVoiceQueue','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x08a3,0xbc));var _0x308a=function(_0x4837a0,_0x524ae3){_0x4837a0=_0x4837a0-0x0;var _0xb28920=_0x08a3[_0x4837a0];return _0xb28920;};'use strict';var _=require('lodash');var util=require(_0x308a('0x0'));var moment=require(_0x308a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x308a('0x2'))['db'];var utils=require(_0x308a('0x3'));var logger=require(_0x308a('0x4'))('rpc');var config=require(_0x308a('0x5'));var jayson=require(_0x308a('0x6'));var client=jayson['client'][_0x308a('0x7')]({'port':0x232a});config['redis']=_[_0x308a('0x8')](config[_0x308a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x308a('0xa'))(new Redis(config[_0x308a('0x9')]));require(_0x308a('0xb'))[_0x308a('0xc')](socket);function respondWithRpcPromise(_0x52a59a,_0x16663d,_0x68b2b5){return new BPromise(function(_0x41ef66,_0x42e043){return client[_0x308a('0xd')](_0x52a59a,_0x68b2b5)['then'](function(_0x50560b){logger[_0x308a('0xe')](_0x308a('0xf'),_0x16663d,_0x308a('0x10'));logger[_0x308a('0x11')](_0x308a('0x12'),_0x16663d,_0x308a('0x10'),JSON[_0x308a('0x13')](_0x50560b));if(_0x50560b[_0x308a('0x14')]){if(_0x50560b[_0x308a('0x14')][_0x308a('0x15')]===0x1f4){logger[_0x308a('0x14')](_0x308a('0xf'),_0x16663d,_0x50560b[_0x308a('0x14')]['message']);return _0x42e043(_0x50560b['error']['message']);}logger['error'](_0x308a('0xf'),_0x16663d,_0x50560b[_0x308a('0x14')][_0x308a('0x16')]);return _0x41ef66(_0x50560b[_0x308a('0x14')][_0x308a('0x16')]);}else{logger['info'](_0x308a('0xf'),_0x16663d,_0x308a('0x10'));_0x41ef66(_0x50560b[_0x308a('0x17')][_0x308a('0x16')]);}})[_0x308a('0x18')](function(_0x59d5cc){logger[_0x308a('0x14')](_0x308a('0xf'),_0x16663d,_0x59d5cc);_0x42e043(_0x59d5cc);});});}exports['GetVoiceQueue']=function(_0x4d6261){var _0x58296b=this;return new Promise(function(_0x1c058d,_0x408d58){return db[_0x308a('0x19')][_0x308a('0x1a')]({'raw':_0x4d6261[_0x308a('0x1b')]?_0x4d6261[_0x308a('0x1b')][_0x308a('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d6261[_0x308a('0x1b')]?_0x4d6261[_0x308a('0x1b')]['where']||null:null,'attributes':_0x4d6261['options']?_0x4d6261[_0x308a('0x1b')][_0x308a('0x1d')]||null:null,'limit':_0x4d6261[_0x308a('0x1b')]?_0x4d6261['options'][_0x308a('0x1e')]||null:null,'include':_0x4d6261['options']?_0x4d6261[_0x308a('0x1b')]['include']?_['map'](_0x4d6261[_0x308a('0x1b')][_0x308a('0x1f')],function(_0x7d97ef){return{'model':db[_0x7d97ef[_0x308a('0x20')]],'as':_0x7d97ef['as'],'attributes':_0x7d97ef['attributes'],'include':_0x7d97ef[_0x308a('0x1f')]?_['map'](_0x7d97ef['include'],function(_0x38224b){return{'model':db[_0x38224b['model']],'as':_0x38224b['as'],'attributes':_0x38224b[_0x308a('0x1d')],'include':_0x38224b[_0x308a('0x1f')]?_['map'](_0x38224b[_0x308a('0x1f')],function(_0x2c0cf5){return{'model':db[_0x2c0cf5['model']],'as':_0x2c0cf5['as'],'attributes':_0x2c0cf5['attributes']};}):[]};}):[]};}):[]:[]})[_0x308a('0x21')](function(_0x2448e8){logger[_0x308a('0xe')](_0x308a('0x22'),_0x4d6261);logger[_0x308a('0x11')](_0x308a('0x22'),_0x4d6261,JSON[_0x308a('0x13')](_0x2448e8));_0x1c058d(_0x2448e8);})[_0x308a('0x18')](function(_0x17d834){logger['error']('GetVoiceQueue',_0x17d834[_0x308a('0x16')],_0x4d6261);_0x408d58(_0x58296b[_0x308a('0x14')](0x1f4,_0x17d834[_0x308a('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x13ad74){var _0x2abf3f=this;return new Promise(function(_0xb97c9e,_0x4d611b){return db[_0x308a('0x19')]['find']({'raw':_0x13ad74['options']?_0x13ad74[_0x308a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x13ad74['options']?_0x13ad74[_0x308a('0x1b')][_0x308a('0x23')]||null:null,'attributes':_0x13ad74['options']?_0x13ad74[_0x308a('0x1b')]['attributes']||null:null,'include':_0x13ad74[_0x308a('0x1b')]?_0x13ad74[_0x308a('0x1b')][_0x308a('0x1f')]?_[_0x308a('0x24')](_0x13ad74[_0x308a('0x1b')][_0x308a('0x1f')],function(_0x3e5129){return{'model':db[_0x3e5129['model']],'as':_0x3e5129['as'],'attributes':_0x3e5129[_0x308a('0x1d')],'include':_0x3e5129[_0x308a('0x1f')]?_[_0x308a('0x24')](_0x3e5129['include'],function(_0x1c6739){return{'model':db[_0x1c6739[_0x308a('0x20')]],'as':_0x1c6739['as'],'attributes':_0x1c6739[_0x308a('0x1d')],'include':_0x1c6739[_0x308a('0x1f')]?_[_0x308a('0x24')](_0x1c6739[_0x308a('0x1f')],function(_0x2d3735){return{'model':db[_0x2d3735[_0x308a('0x20')]],'as':_0x2d3735['as'],'attributes':_0x2d3735[_0x308a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x308a('0x21')](function(_0x145bc1){logger[_0x308a('0xe')](_0x308a('0x25'),_0x13ad74);logger[_0x308a('0x11')](_0x308a('0x25'),_0x13ad74,JSON[_0x308a('0x13')](_0x145bc1));_0xb97c9e(_0x145bc1);})['catch'](function(_0xe2babf){logger['error'](_0x308a('0x25'),_0xe2babf[_0x308a('0x16')],_0x13ad74);_0x4d611b(_0x2abf3f[_0x308a('0x14')](0x1f4,_0xe2babf[_0x308a('0x16')]));});});}; \ No newline at end of file +var _0x224f=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','info','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','debug','ShowVoiceQueue','find','map','lodash','util','bluebird','randomstring','ioredis'];(function(_0x15edb4,_0x312549){var _0x389446=function(_0x78b78f){while(--_0x78b78f){_0x15edb4['push'](_0x15edb4['shift']());}};_0x389446(++_0x312549);}(_0x224f,0x19d));var _0xf224=function(_0x311f44,_0x1d7f5b){_0x311f44=_0x311f44-0x0;var _0x46f1e6=_0x224f[_0x311f44];return _0x46f1e6;};'use strict';var _=require(_0xf224('0x0'));var util=require(_0xf224('0x1'));var moment=require('moment');var BPromise=require(_0xf224('0x2'));var rs=require(_0xf224('0x3'));var fs=require('fs');var Redis=require(_0xf224('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf224('0x5'))(_0xf224('0x6'));var config=require(_0xf224('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf224('0x8')][_0xf224('0x9')]({'port':0x232a});config[_0xf224('0xa')]=_[_0xf224('0xb')](config[_0xf224('0xa')],{'host':_0xf224('0xc'),'port':0x18eb});var socket=require(_0xf224('0xd'))(new Redis(config[_0xf224('0xa')]));require(_0xf224('0xe'))['register'](socket);function respondWithRpcPromise(_0x33a245,_0x2208c1,_0x1ed5b7){return new BPromise(function(_0x50a1d9,_0xc148ef){return client['request'](_0x33a245,_0x1ed5b7)['then'](function(_0x4b54ca){logger[_0xf224('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x2208c1,_0xf224('0x10'));logger['debug'](_0xf224('0x11'),_0x2208c1,_0xf224('0x10'),JSON[_0xf224('0x12')](_0x4b54ca));if(_0x4b54ca[_0xf224('0x13')]){if(_0x4b54ca[_0xf224('0x13')][_0xf224('0x14')]===0x1f4){logger['error'](_0xf224('0x15'),_0x2208c1,_0x4b54ca[_0xf224('0x13')][_0xf224('0x16')]);return _0xc148ef(_0x4b54ca['error'][_0xf224('0x16')]);}logger[_0xf224('0x13')](_0xf224('0x15'),_0x2208c1,_0x4b54ca[_0xf224('0x13')][_0xf224('0x16')]);return _0x50a1d9(_0x4b54ca[_0xf224('0x13')]['message']);}else{logger[_0xf224('0xf')](_0xf224('0x15'),_0x2208c1,_0xf224('0x10'));_0x50a1d9(_0x4b54ca['result'][_0xf224('0x16')]);}})[_0xf224('0x17')](function(_0x2055f3){logger[_0xf224('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x2208c1,_0x2055f3);_0xc148ef(_0x2055f3);});});}exports[_0xf224('0x18')]=function(_0x3dc014){var _0x55bbd3=this;return new Promise(function(_0x1ef3f3,_0x1a9543){return db[_0xf224('0x19')][_0xf224('0x1a')]({'raw':_0x3dc014['options']?_0x3dc014[_0xf224('0x1b')][_0xf224('0x1c')]===undefined?!![]:![]:!![],'where':_0x3dc014[_0xf224('0x1b')]?_0x3dc014['options'][_0xf224('0x1d')]||null:null,'attributes':_0x3dc014[_0xf224('0x1b')]?_0x3dc014[_0xf224('0x1b')][_0xf224('0x1e')]||null:null,'limit':_0x3dc014[_0xf224('0x1b')]?_0x3dc014[_0xf224('0x1b')][_0xf224('0x1f')]||null:null,'include':_0x3dc014[_0xf224('0x1b')]?_0x3dc014['options'][_0xf224('0x20')]?_['map'](_0x3dc014[_0xf224('0x1b')]['include'],function(_0x4ca435){return{'model':db[_0x4ca435[_0xf224('0x21')]],'as':_0x4ca435['as'],'attributes':_0x4ca435['attributes'],'include':_0x4ca435['include']?_['map'](_0x4ca435['include'],function(_0x28ca66){return{'model':db[_0x28ca66[_0xf224('0x21')]],'as':_0x28ca66['as'],'attributes':_0x28ca66[_0xf224('0x1e')],'include':_0x28ca66['include']?_['map'](_0x28ca66[_0xf224('0x20')],function(_0x1490e9){return{'model':db[_0x1490e9[_0xf224('0x21')]],'as':_0x1490e9['as'],'attributes':_0x1490e9[_0xf224('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x456bde){logger[_0xf224('0xf')](_0xf224('0x18'),_0x3dc014);logger[_0xf224('0x22')](_0xf224('0x18'),_0x3dc014,JSON['stringify'](_0x456bde));_0x1ef3f3(_0x456bde);})['catch'](function(_0x491b63){logger[_0xf224('0x13')](_0xf224('0x18'),_0x491b63[_0xf224('0x16')],_0x3dc014);_0x1a9543(_0x55bbd3[_0xf224('0x13')](0x1f4,_0x491b63['message']));});});};exports[_0xf224('0x23')]=function(_0x34a5c7){var _0x4e8000=this;return new Promise(function(_0x4bc6ff,_0x447ef8){return db[_0xf224('0x19')][_0xf224('0x24')]({'raw':_0x34a5c7[_0xf224('0x1b')]?_0x34a5c7[_0xf224('0x1b')][_0xf224('0x1c')]===undefined?!![]:![]:!![],'where':_0x34a5c7[_0xf224('0x1b')]?_0x34a5c7[_0xf224('0x1b')]['where']||null:null,'attributes':_0x34a5c7[_0xf224('0x1b')]?_0x34a5c7['options']['attributes']||null:null,'include':_0x34a5c7[_0xf224('0x1b')]?_0x34a5c7[_0xf224('0x1b')][_0xf224('0x20')]?_[_0xf224('0x25')](_0x34a5c7[_0xf224('0x1b')]['include'],function(_0xc54b0f){return{'model':db[_0xc54b0f['model']],'as':_0xc54b0f['as'],'attributes':_0xc54b0f[_0xf224('0x1e')],'include':_0xc54b0f['include']?_['map'](_0xc54b0f[_0xf224('0x20')],function(_0x97ead2){return{'model':db[_0x97ead2[_0xf224('0x21')]],'as':_0x97ead2['as'],'attributes':_0x97ead2[_0xf224('0x1e')],'include':_0x97ead2[_0xf224('0x20')]?_[_0xf224('0x25')](_0x97ead2['include'],function(_0x7a315f){return{'model':db[_0x7a315f[_0xf224('0x21')]],'as':_0x7a315f['as'],'attributes':_0x7a315f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18826c){logger[_0xf224('0xf')]('ShowVoiceQueue',_0x34a5c7);logger['debug']('ShowVoiceQueue',_0x34a5c7,JSON['stringify'](_0x18826c));_0x4bc6ff(_0x18826c);})[_0xf224('0x17')](function(_0x56f35d){logger[_0xf224('0x13')](_0xf224('0x23'),_0x56f35d['message'],_0x34a5c7);_0x447ef8(_0x4e8000[_0xf224('0x13')](0x1f4,_0x56f35d[_0xf224('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index aea7dd3..429fc61 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 _0xd383=['./voiceQueue.events','remove','update','register','voiceQueue:'];(function(_0x201c46,_0x3ed68e){var _0x197e98=function(_0x481494){while(--_0x481494){_0x201c46['push'](_0x201c46['shift']());}};_0x197e98(++_0x3ed68e);}(_0xd383,0xcd));var _0x3d38=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xd383[_0x5a95fa];return _0x1a61b8;};'use strict';var VoiceQueueEvents=require(_0x3d38('0x0'));var events=['save',_0x3d38('0x1'),_0x3d38('0x2')];function createListener(_0x39e56f,_0xd93efc){return function(_0x30ecdb){_0xd93efc['emit'](_0x39e56f,_0x30ecdb);};}function removeListener(_0x5e5b83,_0x410113){return function(){VoiceQueueEvents['removeListener'](_0x5e5b83,_0x410113);};}exports[_0x3d38('0x3')]=function(_0x4c422c){for(var _0x445caa=0x0,_0xa47602=events['length'];_0x445caa<_0xa47602;_0x445caa++){var _0x3bcdf3=events[_0x445caa];var _0xafd844=createListener(_0x3d38('0x4')+_0x3bcdf3,_0x4c422c);VoiceQueueEvents['on'](_0x3bcdf3,_0xafd844);}}; \ No newline at end of file +var _0x7d6f=['./voiceQueue.events','save','remove','update','length'];(function(_0x902d2d,_0x349166){var _0x1422d5=function(_0x29e810){while(--_0x29e810){_0x902d2d['push'](_0x902d2d['shift']());}};_0x1422d5(++_0x349166);}(_0x7d6f,0x104));var _0xf7d6=function(_0x1f79b5,_0x46d8d7){_0x1f79b5=_0x1f79b5-0x0;var _0xcf8bee=_0x7d6f[_0x1f79b5];return _0xcf8bee;};'use strict';var VoiceQueueEvents=require(_0xf7d6('0x0'));var events=[_0xf7d6('0x1'),_0xf7d6('0x2'),_0xf7d6('0x3')];function createListener(_0x4d1996,_0x57a192){return function(_0x12faf2){_0x57a192['emit'](_0x4d1996,_0x12faf2);};}function removeListener(_0x292a9f,_0x19eda1){return function(){VoiceQueueEvents['removeListener'](_0x292a9f,_0x19eda1);};}exports['register']=function(_0x1f5f96){for(var _0x5b8098=0x0,_0x57f055=events[_0xf7d6('0x4')];_0x5b8098<_0x57f055;_0x5b8098++){var _0x1fa3dd=events[_0x5b8098];var _0x54f2ff=createListener('voiceQueue:'+_0x1fa3dd,_0x1f5f96);VoiceQueueEvents['on'](_0x1fa3dd,_0x54f2ff);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index cd540b4..034205c 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 _0x732e=['destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','create','put','update','delete'];(function(_0x62199f,_0x1b8ce5){var _0x853db1=function(_0x5db525){while(--_0x5db525){_0x62199f['push'](_0x62199f['shift']());}};_0x853db1(++_0x1b8ce5);}(_0x732e,0x1c9));var _0xe732=function(_0x41ed37,_0xbcd1d4){_0x41ed37=_0x41ed37-0x0;var _0x13f7ea=_0x732e[_0x41ed37];return _0x13f7ea;};'use strict';var multer=require(_0xe732('0x0'));var util=require(_0xe732('0x1'));var path=require(_0xe732('0x2'));var timeout=require(_0xe732('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe732('0x4'));var auth=require(_0xe732('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe732('0x6'));var controller=require('./voiceQueueReport.controller');router[_0xe732('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe732('0x8'),auth[_0xe732('0x9')](),controller['describe']);router['get'](_0xe732('0xa'),auth[_0xe732('0x9')](),controller[_0xe732('0xb')]);router['get'](_0xe732('0xc'),auth[_0xe732('0x9')](),controller[_0xe732('0xd')]);router['post']('/',auth[_0xe732('0x9')](),controller[_0xe732('0xe')]);router[_0xe732('0xf')](_0xe732('0xc'),auth[_0xe732('0x9')](),controller[_0xe732('0x10')]);router[_0xe732('0x11')](_0xe732('0xc'),auth[_0xe732('0x9')](),controller[_0xe732('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa068=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','show','post','create','put','/:id','update'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xa068,0xc2));var _0x8a06=function(_0x328df6,_0x43f53a){_0x328df6=_0x328df6-0x0;var _0x2695bc=_0xa068[_0x328df6];return _0x2695bc;};'use strict';var multer=require(_0x8a06('0x0'));var util=require(_0x8a06('0x1'));var path=require(_0x8a06('0x2'));var timeout=require(_0x8a06('0x3'));var express=require(_0x8a06('0x4'));var router=express[_0x8a06('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a06('0x6'));var config=require(_0x8a06('0x7'));var controller=require(_0x8a06('0x8'));router[_0x8a06('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a06('0xa')]);router[_0x8a06('0x9')](_0x8a06('0xb'),auth['isAuthenticated'](),controller[_0x8a06('0xc')]);router[_0x8a06('0x9')](_0x8a06('0xd'),auth[_0x8a06('0xe')](),controller[_0x8a06('0xf')]);router[_0x8a06('0x9')]('/:id',auth[_0x8a06('0xe')](),controller[_0x8a06('0x10')]);router[_0x8a06('0x11')]('/',auth['isAuthenticated'](),controller[_0x8a06('0x12')]);router[_0x8a06('0x13')](_0x8a06('0x14'),auth[_0x8a06('0xe')](),controller[_0x8a06('0x15')]);router['delete']('/:id',auth[_0x8a06('0xe')](),controller[_0x8a06('0x16')]);module[_0x8a06('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 212bd8a..a2c3e3a 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 _0x752f=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x752f,0x177));var _0xf752=function(_0x2a3d49,_0x1067b1){_0x2a3d49=_0x2a3d49-0x0;var _0x1e91e3=_0x752f[_0x2a3d49];return _0x1e91e3;};'use strict';var Sequelize=require(_0xf752('0x0'));var moment=require(_0xf752('0x1'));module[_0xf752('0x2')]={'type':{'type':Sequelize[_0xf752('0x3')]},'uniqueid':{'type':Sequelize[_0xf752('0x3')]},'calleridnum':{'type':Sequelize[_0xf752('0x3')]},'calleridname':{'type':Sequelize[_0xf752('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xf752('0x4')],'set':function(_0x55d6cf){var _0x28e07c=moment(_0x55d6cf);var _0x2517c3=moment(this[_0xf752('0x5')]('queuecallerjoinAt'))['format'](_0xf752('0x6'));var _0x941f9c=_0x28e07c[_0xf752('0x7')](_0x2517c3,_0xf752('0x8'));this['setDataValue']('queuecallerleaveAt',_0x55d6cf);this['setDataValue']('holdtime',_0x941f9c||null);}},'position':{'type':Sequelize[_0xf752('0x9')]},'count':{'type':Sequelize[_0xf752('0x9')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xf752('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xf752('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf752('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf752('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xf752('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xf752('0x3')]},'connectedlinenum':{'type':Sequelize[_0xf752('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf752('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf752('0x3')]},'holdtime':{'type':Sequelize[_0xf752('0x9')]},'mohtime':{'type':Sequelize[_0xf752('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf752('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xf752('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf752('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf752('0x3')]},'secondDisposition':{'type':Sequelize[_0xf752('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf752('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xf752('0x3')]}}; \ No newline at end of file +var _0xa3e2=['exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa3e2,0x1d0));var _0x2a3e=function(_0x424ebf,_0x4c64d3){_0x424ebf=_0x424ebf-0x0;var _0x4c6aef=_0xa3e2[_0x424ebf];return _0x4c6aef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2a3e('0x0'));module[_0x2a3e('0x1')]={'type':{'type':Sequelize[_0x2a3e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2a3e('0x2')]},'calleridname':{'type':Sequelize[_0x2a3e('0x2')]},'queue':{'type':Sequelize[_0x2a3e('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x2a3e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x2a3e('0x3')],'set':function(_0x289c3c){var _0x4cfa3b=moment(_0x289c3c);var _0x5a944e=moment(this['getDataValue'](_0x2a3e('0x4')))[_0x2a3e('0x5')](_0x2a3e('0x6'));var _0x33de89=_0x4cfa3b[_0x2a3e('0x7')](_0x5a944e,_0x2a3e('0x8'));this[_0x2a3e('0x9')](_0x2a3e('0xa'),_0x289c3c);this['setDataValue']('holdtime',_0x33de89||null);}},'position':{'type':Sequelize[_0x2a3e('0xb')]},'count':{'type':Sequelize[_0x2a3e('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2a3e('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x2a3e('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x2a3e('0x2')],'comment':_0x2a3e('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x2a3e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2a3e('0x2')]},'accountcode':{'type':Sequelize[_0x2a3e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2a3e('0x2')]},'priority':{'type':Sequelize[_0x2a3e('0x2')]},'holdtime':{'type':Sequelize[_0x2a3e('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2a3e('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2a3e('0x2')]},'transfer':{'type':Sequelize[_0x2a3e('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x2a3e('0xe')},'transferexten':{'type':Sequelize[_0x2a3e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x2a3e('0x2')]},'disposition':{'type':Sequelize[_0x2a3e('0x2')]},'secondDisposition':{'type':Sequelize[_0x2a3e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2a3e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x2a3e('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x2a3e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index ddb1ef8..4ac438f 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 _0x61da=['limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','nolimit','order','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','offset','count'];(function(_0x54ff85,_0x49f9c0){var _0x53273f=function(_0x1ce1df){while(--_0x1ce1df){_0x54ff85['push'](_0x54ff85['shift']());}};_0x53273f(++_0x49f9c0);}(_0x61da,0x12b));var _0xa61d=function(_0x1c09a3,_0x46e97a){_0x1c09a3=_0x1c09a3-0x0;var _0x6a11fd=_0x61da[_0x1c09a3];return _0x6a11fd;};'use strict';var emlformat=require(_0xa61d('0x0'));var rimraf=require(_0xa61d('0x1'));var zipdir=require(_0xa61d('0x2'));var jsonpatch=require(_0xa61d('0x3'));var rp=require(_0xa61d('0x4'));var moment=require(_0xa61d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa61d('0x6'));var path=require(_0xa61d('0x7'));var sox=require('sox');var csv=require(_0xa61d('0x8'));var ejs=require(_0xa61d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa61d('0xa'));var squel=require(_0xa61d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa61d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa61d('0xd'));var Papa=require(_0xa61d('0xe'));var Redis=require(_0xa61d('0xf'));var authService=require(_0xa61d('0x10'));var qs=require(_0xa61d('0x11'));var as=require(_0xa61d('0x12'));var hardwareService=require(_0xa61d('0x13'));var logger=require(_0xa61d('0x14'))(_0xa61d('0x15'));var utils=require(_0xa61d('0x16'));var config=require(_0xa61d('0x17'));var licenseUtil=require(_0xa61d('0x18'));var db=require(_0xa61d('0x19'))['db'];config['redis']=_['defaults'](config[_0xa61d('0x1a')],{'host':_0xa61d('0x1b'),'port':0x18eb});var socket=require(_0xa61d('0x1c'))(new Redis(config[_0xa61d('0x1a')]));require('./voiceQueueReport.socket')[_0xa61d('0x1d')](socket);function respondWithStatusCode(_0x61a9aa,_0x56e833){_0x56e833=_0x56e833||0xcc;return function(_0x403bdd){if(_0x403bdd){return _0x61a9aa[_0xa61d('0x1e')](_0x56e833);}return _0x61a9aa[_0xa61d('0x1f')](_0x56e833)[_0xa61d('0x20')]();};}function respondWithResult(_0x175c91,_0x1ecdf0){_0x1ecdf0=_0x1ecdf0||0xc8;return function(_0x1efa29){if(_0x1efa29){return _0x175c91[_0xa61d('0x1f')](_0x1ecdf0)[_0xa61d('0x21')](_0x1efa29);}};}function respondWithFilteredResult(_0x4ecaa4,_0x3695ec){return function(_0x4b2111){if(_0x4b2111){var _0x15806b=typeof _0x3695ec['offset']==='undefined'&&typeof _0x3695ec['limit']===_0xa61d('0x22');var _0x41ff25=_0x4b2111['count'];var _0x234650=_0x15806b?0x0:_0x3695ec[_0xa61d('0x23')];var _0x4fbcf0=_0x15806b?_0x4b2111[_0xa61d('0x24')]:_0x3695ec[_0xa61d('0x23')]+_0x3695ec[_0xa61d('0x25')];var _0x5097dd;if(_0x4fbcf0>=_0x41ff25){_0x4fbcf0=_0x41ff25;_0x5097dd=0xc8;}else{_0x5097dd=0xce;}_0x4ecaa4[_0xa61d('0x1f')](_0x5097dd);return _0x4ecaa4['set'](_0xa61d('0x26'),_0x234650+'-'+_0x4fbcf0+'/'+_0x41ff25)[_0xa61d('0x21')](_0x4b2111);}return null;};}function patchUpdates(_0x339555){return function(_0x44226c){try{jsonpatch[_0xa61d('0x27')](_0x44226c,_0x339555,!![]);}catch(_0x110bdb){return BPromise[_0xa61d('0x28')](_0x110bdb);}return _0x44226c['save']();};}function saveUpdates(_0x3acba7,_0x13dcba){return function(_0x18a037){if(_0x18a037){return _0x18a037[_0xa61d('0x29')](_0x3acba7)[_0xa61d('0x2a')](function(_0x26a6c9){return _0x26a6c9;});}return null;};}function removeEntity(_0x4965e3,_0x1595a2){return function(_0x4521ef){if(_0x4521ef){return _0x4521ef[_0xa61d('0x2b')]()[_0xa61d('0x2a')](function(){_0x4965e3[_0xa61d('0x1f')](0xcc)[_0xa61d('0x20')]();});}};}function handleEntityNotFound(_0x272375,_0x1ed731){return function(_0x2e1ad3){if(!_0x2e1ad3){_0x272375[_0xa61d('0x1e')](0x194);}return _0x2e1ad3;};}function handleError(_0x59c59e,_0x58b90a){_0x58b90a=_0x58b90a||0x1f4;return function(_0xbc7877){logger[_0xa61d('0x2c')](_0xbc7877[_0xa61d('0x2d')]);if(_0xbc7877[_0xa61d('0x2e')]){delete _0xbc7877[_0xa61d('0x2e')];}_0x59c59e[_0xa61d('0x1f')](_0x58b90a)['send'](_0xbc7877);};}exports[_0xa61d('0x2f')]=function(_0x105c5e,_0x51d8cd){var _0x4153ea={},_0x4ad074={},_0x3b370b={'count':0x0,'rows':[]};var _0x41fd67=_['map'](db[_0xa61d('0x30')][_0xa61d('0x31')],function(_0x42594e){return{'name':_0x42594e[_0xa61d('0x32')],'type':_0x42594e[_0xa61d('0x33')][_0xa61d('0x34')]};});_0x4ad074[_0xa61d('0x35')]=_[_0xa61d('0x36')](_0x41fd67,_0xa61d('0x2e'));_0x4ad074[_0xa61d('0x37')]=_[_0xa61d('0x38')](_0x105c5e[_0xa61d('0x37')]);_0x4ad074[_0xa61d('0x39')]=_['intersection'](_0x4ad074[_0xa61d('0x35')],_0x4ad074['query']);_0x4153ea[_0xa61d('0x3a')]=_[_0xa61d('0x3b')](_0x4ad074[_0xa61d('0x35')],qs[_0xa61d('0x3c')](_0x105c5e[_0xa61d('0x37')]['fields']));_0x4153ea[_0xa61d('0x3a')]=_0x4153ea[_0xa61d('0x3a')][_0xa61d('0x3d')]?_0x4153ea['attributes']:_0x4ad074['model'];if(!_0x105c5e[_0xa61d('0x37')][_0xa61d('0x3e')]('nolimit')){_0x4153ea[_0xa61d('0x25')]=qs['limit'](_0x105c5e['query']['limit']);_0x4153ea[_0xa61d('0x23')]=qs[_0xa61d('0x23')](_0x105c5e['query'][_0xa61d('0x23')]);}_0x4153ea['order']=qs[_0xa61d('0x3f')](_0x105c5e[_0xa61d('0x37')][_0xa61d('0x3f')]);_0x4153ea['where']=qs['filters'](_[_0xa61d('0x40')](_0x105c5e['query'],_0x4ad074[_0xa61d('0x39')]),_0x41fd67);if(_0x105c5e[_0xa61d('0x37')][_0xa61d('0x41')]){_0x4153ea[_0xa61d('0x42')]=_[_0xa61d('0x43')](_0x4153ea[_0xa61d('0x42')],{'$or':_[_0xa61d('0x36')](_0x41fd67,function(_0x324694){if(_0x324694['type']!==_0xa61d('0x44')){var _0x5cdcfc={};_0x5cdcfc[_0x324694['name']]={'$like':'%'+_0x105c5e[_0xa61d('0x37')][_0xa61d('0x41')]+'%'};return _0x5cdcfc;}})});}_0x4153ea=_['merge']({},_0x4153ea,_0x105c5e[_0xa61d('0x45')]);var _0x2562e7={'where':_0x4153ea[_0xa61d('0x42')]};return db[_0xa61d('0x30')][_0xa61d('0x24')](_0x2562e7)['then'](function(_0x3690e2){_0x3b370b['count']=_0x3690e2;if(_0x105c5e[_0xa61d('0x37')]['includeAll']){_0x4153ea[_0xa61d('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa61d('0x47')](_0x4153ea);})[_0xa61d('0x2a')](function(_0x368e6f){_0x3b370b[_0xa61d('0x48')]=_0x368e6f;return _0x3b370b;})[_0xa61d('0x2a')](respondWithFilteredResult(_0x51d8cd,_0x4153ea))[_0xa61d('0x49')](handleError(_0x51d8cd,null));};exports[_0xa61d('0x4a')]=function(_0x35de7f,_0x36a2a1){var _0x4ef0e0={'raw':![],'where':{'id':_0x35de7f[_0xa61d('0x4b')]['id']}},_0x471a5c={};_0x471a5c[_0xa61d('0x35')]=_[_0xa61d('0x38')](db['VoiceQueueReport'][_0xa61d('0x31')]);_0x471a5c[_0xa61d('0x37')]=_[_0xa61d('0x38')](_0x35de7f['query']);_0x471a5c[_0xa61d('0x39')]=_[_0xa61d('0x3b')](_0x471a5c[_0xa61d('0x35')],_0x471a5c['query']);_0x4ef0e0['attributes']=_[_0xa61d('0x3b')](_0x471a5c[_0xa61d('0x35')],qs[_0xa61d('0x3c')](_0x35de7f['query']['fields']));_0x4ef0e0[_0xa61d('0x3a')]=_0x4ef0e0[_0xa61d('0x3a')][_0xa61d('0x3d')]?_0x4ef0e0['attributes']:_0x471a5c[_0xa61d('0x35')];if(_0x35de7f[_0xa61d('0x37')][_0xa61d('0x4c')]){_0x4ef0e0['include']=[{'all':!![]}];}_0x4ef0e0=_[_0xa61d('0x43')]({},_0x4ef0e0,_0x35de7f['options']);return db[_0xa61d('0x30')][_0xa61d('0x4d')](_0x4ef0e0)['then'](handleEntityNotFound(_0x36a2a1,null))[_0xa61d('0x2a')](respondWithResult(_0x36a2a1,null))[_0xa61d('0x49')](handleError(_0x36a2a1,null));};exports[_0xa61d('0x4e')]=function(_0x18be5a,_0x3990a0){return db[_0xa61d('0x30')]['create'](_0x18be5a[_0xa61d('0x4f')],{})[_0xa61d('0x2a')](respondWithResult(_0x3990a0,0xc9))[_0xa61d('0x49')](handleError(_0x3990a0,null));};exports[_0xa61d('0x29')]=function(_0x1789a3,_0x423a30){if(_0x1789a3[_0xa61d('0x4f')]['id']){delete _0x1789a3[_0xa61d('0x4f')]['id'];}return db[_0xa61d('0x30')][_0xa61d('0x4d')]({'where':{'id':_0x1789a3[_0xa61d('0x4b')]['id']}})[_0xa61d('0x2a')](handleEntityNotFound(_0x423a30,null))[_0xa61d('0x2a')](saveUpdates(_0x1789a3[_0xa61d('0x4f')],null))[_0xa61d('0x2a')](respondWithResult(_0x423a30,null))['catch'](handleError(_0x423a30,null));};exports['destroy']=function(_0x5301b0,_0x2e53c1){return db[_0xa61d('0x30')][_0xa61d('0x4d')]({'where':{'id':_0x5301b0[_0xa61d('0x4b')]['id']}})[_0xa61d('0x2a')](handleEntityNotFound(_0x2e53c1,null))[_0xa61d('0x2a')](removeEntity(_0x2e53c1,null))[_0xa61d('0x49')](handleError(_0x2e53c1,null));};exports[_0xa61d('0x50')]=function(_0x1e86a2,_0x324c96){return db[_0xa61d('0x30')][_0xa61d('0x50')]()['then'](respondWithResult(_0x324c96,null))[_0xa61d('0x49')](handleError(_0x324c96,null));};exports['getVoiceQueuesReport']=function(_0x127cbf,_0x493118){var _0xc27472={},_0x38e0f9={},_0x7abd48={'count':0x0,'rows':[]};_0x38e0f9[_0xa61d('0x35')]=_[_0xa61d('0x38')](db['VoiceQueueReport'][_0xa61d('0x31')]);_0x38e0f9[_0xa61d('0x37')]=_[_0xa61d('0x38')](_0x127cbf[_0xa61d('0x37')]);_0x38e0f9[_0xa61d('0x39')]=_[_0xa61d('0x3b')](_0x38e0f9[_0xa61d('0x35')],_0x38e0f9[_0xa61d('0x37')]);_0xc27472['attributes']=_['intersection'](_0x38e0f9[_0xa61d('0x35')],qs[_0xa61d('0x3c')](_0x127cbf[_0xa61d('0x37')][_0xa61d('0x3c')]));_0xc27472[_0xa61d('0x3a')]=_0xc27472[_0xa61d('0x3a')][_0xa61d('0x3d')]?_0xc27472[_0xa61d('0x3a')]:_0x38e0f9[_0xa61d('0x35')];if(!_0x127cbf['query']['hasOwnProperty'](_0xa61d('0x51'))){_0xc27472[_0xa61d('0x25')]=qs[_0xa61d('0x25')](_0x127cbf[_0xa61d('0x37')]['limit']);_0xc27472['offset']=qs[_0xa61d('0x23')](_0x127cbf['query'][_0xa61d('0x23')]);}_0xc27472[_0xa61d('0x52')]=qs[_0xa61d('0x3f')](_0x127cbf[_0xa61d('0x37')][_0xa61d('0x3f')]);_0xc27472[_0xa61d('0x42')]=qs[_0xa61d('0x39')](_[_0xa61d('0x40')](_0x127cbf[_0xa61d('0x37')],_0x38e0f9[_0xa61d('0x39')]));if(_0x127cbf[_0xa61d('0x37')][_0xa61d('0x41')]){_0xc27472[_0xa61d('0x42')]=_[_0xa61d('0x43')](_0xc27472[_0xa61d('0x42')],{'$or':_[_0xa61d('0x36')](_0xc27472[_0xa61d('0x3a')],function(_0xb63e3b){var _0x135bcb={};_0x135bcb[_0xb63e3b]={'$like':'%'+_0x127cbf[_0xa61d('0x37')][_0xa61d('0x41')]+'%'};return _0x135bcb;})});}_0xc27472=_[_0xa61d('0x43')]({},_0xc27472,_0x127cbf['options']);var _0x514284={'where':_0xc27472['where']};return db[_0xa61d('0x30')][_0xa61d('0x24')](_0x514284)[_0xa61d('0x2a')](function(_0xaed267){_0x7abd48[_0xa61d('0x24')]=_0xaed267;if(_0x127cbf[_0xa61d('0x37')][_0xa61d('0x4c')]){_0xc27472['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa61d('0x47')](_0xc27472);})[_0xa61d('0x2a')](function(_0x5c9652){_0x7abd48[_0xa61d('0x48')]=_0x5c9652;return _0x7abd48;})[_0xa61d('0x2a')](respondWithFilteredResult(_0x493118,_0xc27472,_0xa61d('0x53')))[_0xa61d('0x49')](handleError(_0x493118,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xf5ef=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','VoiceQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2721ae,_0x162c17){var _0x1438df=function(_0x39ed24){while(--_0x39ed24){_0x2721ae['push'](_0x2721ae['shift']());}};_0x1438df(++_0x162c17);}(_0xf5ef,0xf5));var _0xff5e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xf5ef[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0xff5e('0x0'));var rimraf=require(_0xff5e('0x1'));var zipdir=require(_0xff5e('0x2'));var jsonpatch=require(_0xff5e('0x3'));var rp=require(_0xff5e('0x4'));var moment=require(_0xff5e('0x5'));var BPromise=require(_0xff5e('0x6'));var Mustache=require(_0xff5e('0x7'));var util=require(_0xff5e('0x8'));var path=require(_0xff5e('0x9'));var sox=require(_0xff5e('0xa'));var csv=require(_0xff5e('0xb'));var ejs=require(_0xff5e('0xc'));var fs=require('fs');var fs_extra=require(_0xff5e('0xd'));var _=require(_0xff5e('0xe'));var squel=require(_0xff5e('0xf'));var crypto=require(_0xff5e('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xff5e('0x11'));var toCsv=require(_0xff5e('0xb'));var querystring=require(_0xff5e('0x12'));var Papa=require(_0xff5e('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xff5e('0x14'));var as=require(_0xff5e('0x15'));var hardwareService=require(_0xff5e('0x16'));var logger=require(_0xff5e('0x17'))('api');var utils=require(_0xff5e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xff5e('0x19'));var db=require(_0xff5e('0x1a'))['db'];config[_0xff5e('0x1b')]=_['defaults'](config[_0xff5e('0x1b')],{'host':_0xff5e('0x1c'),'port':0x18eb});var socket=require(_0xff5e('0x1d'))(new Redis(config[_0xff5e('0x1b')]));require('./voiceQueueReport.socket')[_0xff5e('0x1e')](socket);function respondWithStatusCode(_0x39c86d,_0xd2e5be){_0xd2e5be=_0xd2e5be||0xcc;return function(_0x4b3185){if(_0x4b3185){return _0x39c86d[_0xff5e('0x1f')](_0xd2e5be);}return _0x39c86d[_0xff5e('0x20')](_0xd2e5be)[_0xff5e('0x21')]();};}function respondWithResult(_0x452007,_0xd0fc5f){_0xd0fc5f=_0xd0fc5f||0xc8;return function(_0x160470){if(_0x160470){return _0x452007['status'](_0xd0fc5f)[_0xff5e('0x22')](_0x160470);}};}function respondWithFilteredResult(_0x1e5b2c,_0x195b8f){return function(_0x1a057e){if(_0x1a057e){var _0x58b324=typeof _0x195b8f[_0xff5e('0x23')]==='undefined'&&typeof _0x195b8f[_0xff5e('0x24')]===_0xff5e('0x25');var _0x521ead=_0x1a057e[_0xff5e('0x26')];var _0x41669c=_0x58b324?0x0:_0x195b8f[_0xff5e('0x23')];var _0x4b797b=_0x58b324?_0x1a057e[_0xff5e('0x26')]:_0x195b8f[_0xff5e('0x23')]+_0x195b8f['limit'];var _0x7c9885;if(_0x4b797b>=_0x521ead){_0x4b797b=_0x521ead;_0x7c9885=0xc8;}else{_0x7c9885=0xce;}_0x1e5b2c[_0xff5e('0x20')](_0x7c9885);return _0x1e5b2c[_0xff5e('0x27')](_0xff5e('0x28'),_0x41669c+'-'+_0x4b797b+'/'+_0x521ead)[_0xff5e('0x22')](_0x1a057e);}return null;};}function patchUpdates(_0x37e2f1){return function(_0xbc764f){try{jsonpatch[_0xff5e('0x29')](_0xbc764f,_0x37e2f1,!![]);}catch(_0x24ff51){return BPromise[_0xff5e('0x2a')](_0x24ff51);}return _0xbc764f[_0xff5e('0x2b')]();};}function saveUpdates(_0x3ef71d,_0x2c6755){return function(_0x314e29){if(_0x314e29){return _0x314e29[_0xff5e('0x2c')](_0x3ef71d)[_0xff5e('0x2d')](function(_0x1a55b1){return _0x1a55b1;});}return null;};}function removeEntity(_0x54a8b2,_0x437b0f){return function(_0x1ef5ba){if(_0x1ef5ba){return _0x1ef5ba[_0xff5e('0x2e')]()[_0xff5e('0x2d')](function(){_0x54a8b2[_0xff5e('0x20')](0xcc)[_0xff5e('0x21')]();});}};}function handleEntityNotFound(_0x544e54,_0x2461b){return function(_0x5c992f){if(!_0x5c992f){_0x544e54[_0xff5e('0x1f')](0x194);}return _0x5c992f;};}function handleError(_0x3259dc,_0x178e82){_0x178e82=_0x178e82||0x1f4;return function(_0x19b66b){logger['error'](_0x19b66b[_0xff5e('0x2f')]);if(_0x19b66b['name']){delete _0x19b66b[_0xff5e('0x30')];}_0x3259dc[_0xff5e('0x20')](_0x178e82)['send'](_0x19b66b);};}exports[_0xff5e('0x31')]=function(_0x419599,_0x587c75){var _0x2221c7={},_0x526680={},_0x154dda={'count':0x0,'rows':[]};var _0x2d68e3=_[_0xff5e('0x32')](db[_0xff5e('0x33')]['rawAttributes'],function(_0xf09421){return{'name':_0xf09421[_0xff5e('0x34')],'type':_0xf09421['type'][_0xff5e('0x35')]};});_0x526680[_0xff5e('0x36')]=_['map'](_0x2d68e3,_0xff5e('0x30'));_0x526680[_0xff5e('0x37')]=_[_0xff5e('0x38')](_0x419599['query']);_0x526680[_0xff5e('0x39')]=_[_0xff5e('0x3a')](_0x526680[_0xff5e('0x36')],_0x526680[_0xff5e('0x37')]);_0x2221c7[_0xff5e('0x3b')]=_[_0xff5e('0x3a')](_0x526680[_0xff5e('0x36')],qs[_0xff5e('0x3c')](_0x419599['query'][_0xff5e('0x3c')]));_0x2221c7[_0xff5e('0x3b')]=_0x2221c7[_0xff5e('0x3b')][_0xff5e('0x3d')]?_0x2221c7['attributes']:_0x526680[_0xff5e('0x36')];if(!_0x419599[_0xff5e('0x37')][_0xff5e('0x3e')](_0xff5e('0x3f'))){_0x2221c7[_0xff5e('0x24')]=qs['limit'](_0x419599[_0xff5e('0x37')]['limit']);_0x2221c7[_0xff5e('0x23')]=qs[_0xff5e('0x23')](_0x419599['query'][_0xff5e('0x23')]);}_0x2221c7[_0xff5e('0x40')]=qs[_0xff5e('0x41')](_0x419599[_0xff5e('0x37')][_0xff5e('0x41')]);_0x2221c7[_0xff5e('0x42')]=qs[_0xff5e('0x39')](_[_0xff5e('0x43')](_0x419599[_0xff5e('0x37')],_0x526680[_0xff5e('0x39')]),_0x2d68e3);if(_0x419599[_0xff5e('0x37')][_0xff5e('0x44')]){_0x2221c7['where']=_[_0xff5e('0x45')](_0x2221c7['where'],{'$or':_[_0xff5e('0x32')](_0x2d68e3,function(_0x1863d6){if(_0x1863d6[_0xff5e('0x46')]!==_0xff5e('0x47')){var _0x4c119a={};_0x4c119a[_0x1863d6[_0xff5e('0x30')]]={'$like':'%'+_0x419599[_0xff5e('0x37')]['filter']+'%'};return _0x4c119a;}})});}_0x2221c7=_[_0xff5e('0x45')]({},_0x2221c7,_0x419599[_0xff5e('0x48')]);var _0x4a109a={'where':_0x2221c7['where']};return db[_0xff5e('0x33')][_0xff5e('0x26')](_0x4a109a)[_0xff5e('0x2d')](function(_0xb4a443){_0x154dda[_0xff5e('0x26')]=_0xb4a443;if(_0x419599['query'][_0xff5e('0x49')]){_0x2221c7[_0xff5e('0x4a')]=[{'all':!![]}];}return db[_0xff5e('0x33')][_0xff5e('0x4b')](_0x2221c7);})['then'](function(_0x2e6e85){_0x154dda[_0xff5e('0x4c')]=_0x2e6e85;return _0x154dda;})[_0xff5e('0x2d')](respondWithFilteredResult(_0x587c75,_0x2221c7))[_0xff5e('0x4d')](handleError(_0x587c75,null));};exports[_0xff5e('0x4e')]=function(_0x1c72f0,_0x182610){var _0x5613bc={'raw':![],'where':{'id':_0x1c72f0[_0xff5e('0x4f')]['id']}},_0x190dc={};_0x190dc['model']=_[_0xff5e('0x38')](db[_0xff5e('0x33')][_0xff5e('0x50')]);_0x190dc[_0xff5e('0x37')]=_[_0xff5e('0x38')](_0x1c72f0[_0xff5e('0x37')]);_0x190dc[_0xff5e('0x39')]=_[_0xff5e('0x3a')](_0x190dc[_0xff5e('0x36')],_0x190dc['query']);_0x5613bc[_0xff5e('0x3b')]=_[_0xff5e('0x3a')](_0x190dc[_0xff5e('0x36')],qs[_0xff5e('0x3c')](_0x1c72f0[_0xff5e('0x37')]['fields']));_0x5613bc[_0xff5e('0x3b')]=_0x5613bc[_0xff5e('0x3b')]['length']?_0x5613bc[_0xff5e('0x3b')]:_0x190dc['model'];if(_0x1c72f0[_0xff5e('0x37')][_0xff5e('0x49')]){_0x5613bc[_0xff5e('0x4a')]=[{'all':!![]}];}_0x5613bc=_[_0xff5e('0x45')]({},_0x5613bc,_0x1c72f0[_0xff5e('0x48')]);return db[_0xff5e('0x33')][_0xff5e('0x51')](_0x5613bc)[_0xff5e('0x2d')](handleEntityNotFound(_0x182610,null))[_0xff5e('0x2d')](respondWithResult(_0x182610,null))[_0xff5e('0x4d')](handleError(_0x182610,null));};exports[_0xff5e('0x52')]=function(_0xf5951a,_0x2241e3){return db[_0xff5e('0x33')]['create'](_0xf5951a[_0xff5e('0x53')],{})[_0xff5e('0x2d')](respondWithResult(_0x2241e3,0xc9))[_0xff5e('0x4d')](handleError(_0x2241e3,null));};exports[_0xff5e('0x2c')]=function(_0x549536,_0x387e76){if(_0x549536['body']['id']){delete _0x549536[_0xff5e('0x53')]['id'];}return db['VoiceQueueReport'][_0xff5e('0x51')]({'where':{'id':_0x549536[_0xff5e('0x4f')]['id']}})[_0xff5e('0x2d')](handleEntityNotFound(_0x387e76,null))[_0xff5e('0x2d')](saveUpdates(_0x549536[_0xff5e('0x53')],null))[_0xff5e('0x2d')](respondWithResult(_0x387e76,null))[_0xff5e('0x4d')](handleError(_0x387e76,null));};exports['destroy']=function(_0x23fa1d,_0xf6bbe7){return db[_0xff5e('0x33')][_0xff5e('0x51')]({'where':{'id':_0x23fa1d[_0xff5e('0x4f')]['id']}})[_0xff5e('0x2d')](handleEntityNotFound(_0xf6bbe7,null))['then'](removeEntity(_0xf6bbe7,null))[_0xff5e('0x4d')](handleError(_0xf6bbe7,null));};exports[_0xff5e('0x54')]=function(_0xfe428f,_0x5b58fa){return db['VoiceQueueReport'][_0xff5e('0x54')]()[_0xff5e('0x2d')](respondWithResult(_0x5b58fa,null))[_0xff5e('0x4d')](handleError(_0x5b58fa,null));};exports['getVoiceQueuesReport']=function(_0x426c85,_0x1c894a){var _0x2574b9={},_0x1787c9={},_0x5a8435={'count':0x0,'rows':[]};_0x1787c9[_0xff5e('0x36')]=_['keys'](db[_0xff5e('0x33')]['rawAttributes']);_0x1787c9[_0xff5e('0x37')]=_[_0xff5e('0x38')](_0x426c85[_0xff5e('0x37')]);_0x1787c9[_0xff5e('0x39')]=_[_0xff5e('0x3a')](_0x1787c9[_0xff5e('0x36')],_0x1787c9[_0xff5e('0x37')]);_0x2574b9[_0xff5e('0x3b')]=_[_0xff5e('0x3a')](_0x1787c9[_0xff5e('0x36')],qs[_0xff5e('0x3c')](_0x426c85[_0xff5e('0x37')][_0xff5e('0x3c')]));_0x2574b9['attributes']=_0x2574b9[_0xff5e('0x3b')][_0xff5e('0x3d')]?_0x2574b9[_0xff5e('0x3b')]:_0x1787c9['model'];if(!_0x426c85['query'][_0xff5e('0x3e')]('nolimit')){_0x2574b9[_0xff5e('0x24')]=qs[_0xff5e('0x24')](_0x426c85[_0xff5e('0x37')][_0xff5e('0x24')]);_0x2574b9[_0xff5e('0x23')]=qs['offset'](_0x426c85[_0xff5e('0x37')][_0xff5e('0x23')]);}_0x2574b9[_0xff5e('0x40')]=qs[_0xff5e('0x41')](_0x426c85[_0xff5e('0x37')][_0xff5e('0x41')]);_0x2574b9[_0xff5e('0x42')]=qs['filters'](_[_0xff5e('0x43')](_0x426c85[_0xff5e('0x37')],_0x1787c9['filters']));if(_0x426c85[_0xff5e('0x37')][_0xff5e('0x44')]){_0x2574b9[_0xff5e('0x42')]=_[_0xff5e('0x45')](_0x2574b9[_0xff5e('0x42')],{'$or':_[_0xff5e('0x32')](_0x2574b9[_0xff5e('0x3b')],function(_0x4aae1e){var _0x29252e={};_0x29252e[_0x4aae1e]={'$like':'%'+_0x426c85[_0xff5e('0x37')][_0xff5e('0x44')]+'%'};return _0x29252e;})});}_0x2574b9=_['merge']({},_0x2574b9,_0x426c85['options']);var _0x2a2bbe={'where':_0x2574b9[_0xff5e('0x42')]};return db[_0xff5e('0x33')][_0xff5e('0x26')](_0x2a2bbe)[_0xff5e('0x2d')](function(_0xe6a8b2){_0x5a8435[_0xff5e('0x26')]=_0xe6a8b2;if(_0x426c85[_0xff5e('0x37')][_0xff5e('0x49')]){_0x2574b9['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2574b9);})['then'](function(_0x64fcb9){_0x5a8435['rows']=_0x64fcb9;return _0x5a8435;})[_0xff5e('0x2d')](respondWithFilteredResult(_0x1c894a,_0x2574b9,_0xff5e('0x55')))['catch'](handleError(_0x1c894a,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 9ebbab9..ddc177a 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 _0xc351=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x13d5a3,_0x4fe4ec){var _0xf5e40d=function(_0x240fe2){while(--_0x240fe2){_0x13d5a3['push'](_0x13d5a3['shift']());}};_0xf5e40d(++_0x4fe4ec);}(_0xc351,0x83));var _0x1c35=function(_0x4bc4ab,_0x2c1bad){_0x4bc4ab=_0x4bc4ab-0x0;var _0x368014=_0xc351[_0x4bc4ab];return _0x368014;};'use strict';var EventEmitter=require(_0x1c35('0x0'));var VoiceQueueReport=require(_0x1c35('0x1'))['db'][_0x1c35('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1c35('0x3')](0x0);var events={'afterCreate':_0x1c35('0x4'),'afterUpdate':_0x1c35('0x5'),'afterDestroy':_0x1c35('0x6')};function emitEvent(_0x49ca9c){return function(_0x153cef,_0x1e6abb,_0x147884){VoiceQueueReportEvents['emit'](_0x49ca9c+':'+_0x153cef['id'],_0x153cef);VoiceQueueReportEvents[_0x1c35('0x7')](_0x49ca9c,_0x153cef);_0x147884(null);};}for(var e in events){if(events[_0x1c35('0x8')](e)){var event=events[e];VoiceQueueReport[_0x1c35('0x9')](e,emitEvent(event));}}module[_0x1c35('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xfcf1=['../../mysqldb','VoiceQueueReport','save','update','remove','hasOwnProperty','exports','events'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xfcf1,0x87));var _0x1fcf=function(_0x223c13,_0x2c4e2a){_0x223c13=_0x223c13-0x0;var _0x406055=_0xfcf1[_0x223c13];return _0x406055;};'use strict';var EventEmitter=require(_0x1fcf('0x0'));var VoiceQueueReport=require(_0x1fcf('0x1'))['db'][_0x1fcf('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1fcf('0x3'),'afterUpdate':_0x1fcf('0x4'),'afterDestroy':_0x1fcf('0x5')};function emitEvent(_0x2c3fa1){return function(_0x4ba0cb,_0x36189c,_0x2421dd){VoiceQueueReportEvents['emit'](_0x2c3fa1+':'+_0x4ba0cb['id'],_0x4ba0cb);VoiceQueueReportEvents['emit'](_0x2c3fa1,_0x4ba0cb);_0x2421dd(null);};}for(var e in events){if(events[_0x1fcf('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x1fcf('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 cea4d6e..f86e6de 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 _0x0390=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util'];(function(_0x38d4ac,_0x19cf87){var _0x3497fb=function(_0x5dc7a0){while(--_0x5dc7a0){_0x38d4ac['push'](_0x38d4ac['shift']());}};_0x3497fb(++_0x19cf87);}(_0x0390,0x1e9));var _0x0039=function(_0x59355d,_0xd083fb){_0x59355d=_0x59355d-0x0;var _0x65d2b9=_0x0390[_0x59355d];return _0x65d2b9;};'use strict';var _=require('lodash');var util=require(_0x0039('0x0'));var logger=require(_0x0039('0x1'))(_0x0039('0x2'));var moment=require(_0x0039('0x3'));var BPromise=require(_0x0039('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0039('0x5'));var config=require(_0x0039('0x6'));var attributes=require(_0x0039('0x7'));module[_0x0039('0x8')]=function(_0x19bdae,_0x15bdd6){return _0x19bdae[_0x0039('0x9')](_0x0039('0xa'),attributes,{'tableName':_0x0039('0xb'),'paranoid':![],'indexes':[{'fields':[_0x0039('0xc')]},{'fields':[_0x0039('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bc3=['bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x2bc3,0x1ae));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32bc('0x0'));var util=require(_0x32bc('0x1'));var logger=require(_0x32bc('0x2'))(_0x32bc('0x3'));var moment=require(_0x32bc('0x4'));var BPromise=require(_0x32bc('0x5'));var rp=require(_0x32bc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32bc('0x7'));var config=require(_0x32bc('0x8'));var attributes=require(_0x32bc('0x9'));module[_0x32bc('0xa')]=function(_0x2c8ca5,_0xf64c6){return _0x2c8ca5[_0x32bc('0xb')](_0x32bc('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x32bc('0xd')]},{'fields':[_0x32bc('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 58bc61d..be37b66 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 _0x2ef3=['rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','attributes','include','model','map','catch','CreateVoiceQueueReport','create','body','where','limit','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ee5cd,_0x3023f6){var _0x593fa4=function(_0x266f68){while(--_0x266f68){_0x3ee5cd['push'](_0x3ee5cd['shift']());}};_0x593fa4(++_0x3023f6);}(_0x2ef3,0xa8));var _0x32ef=function(_0x3d9fd9,_0x5842bd){_0x3d9fd9=_0x3d9fd9-0x0;var _0x4db947=_0x2ef3[_0x3d9fd9];return _0x4db947;};'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(_0x32ef('0x6'))['db'];var utils=require(_0x32ef('0x7'));var logger=require('../../config/logger')(_0x32ef('0x8'));var config=require(_0x32ef('0x9'));var jayson=require(_0x32ef('0xa'));var client=jayson[_0x32ef('0xb')]['http']({'port':0x232a});config['redis']=_[_0x32ef('0xc')](config['redis'],{'host':_0x32ef('0xd'),'port':0x18eb});var socket=require(_0x32ef('0xe'))(new Redis(config[_0x32ef('0xf')]));require(_0x32ef('0x10'))[_0x32ef('0x11')](socket);function respondWithRpcPromise(_0x23d37e,_0x51bdd7,_0x19c10b){return new BPromise(function(_0x31875a,_0x155888){return client['request'](_0x23d37e,_0x19c10b)[_0x32ef('0x12')](function(_0x702a70){logger['info'](_0x32ef('0x13'),_0x51bdd7,_0x32ef('0x14'));logger[_0x32ef('0x15')](_0x32ef('0x16'),_0x51bdd7,'request\x20sent',JSON[_0x32ef('0x17')](_0x702a70));if(_0x702a70[_0x32ef('0x18')]){if(_0x702a70['error']['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x51bdd7,_0x702a70[_0x32ef('0x18')][_0x32ef('0x19')]);return _0x155888(_0x702a70[_0x32ef('0x18')][_0x32ef('0x19')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x51bdd7,_0x702a70['error'][_0x32ef('0x19')]);return _0x31875a(_0x702a70[_0x32ef('0x18')][_0x32ef('0x19')]);}else{logger[_0x32ef('0x1a')]('VoiceQueueReport,\x20%s,\x20%s',_0x51bdd7,'request\x20sent');_0x31875a(_0x702a70[_0x32ef('0x1b')]['message']);}})['catch'](function(_0x5db4ca){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x51bdd7,_0x5db4ca);_0x155888(_0x5db4ca);});});}exports[_0x32ef('0x1c')]=function(_0x426f18){var _0x3e833d=this;return new Promise(function(_0x32be77,_0x336372){return db[_0x32ef('0x1d')][_0x32ef('0x1e')]({'raw':_0x426f18['options']?_0x426f18['options'][_0x32ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x426f18['options']?_0x426f18[_0x32ef('0x20')]['where']||null:null,'attributes':_0x426f18[_0x32ef('0x20')]?_0x426f18[_0x32ef('0x20')][_0x32ef('0x21')]||null:null,'limit':_0x426f18['options']?_0x426f18[_0x32ef('0x20')]['limit']||null:null,'include':_0x426f18['options']?_0x426f18['options']['include']?_['map'](_0x426f18[_0x32ef('0x20')][_0x32ef('0x22')],function(_0x4429be){return{'model':db[_0x4429be[_0x32ef('0x23')]],'as':_0x4429be['as'],'attributes':_0x4429be[_0x32ef('0x21')],'include':_0x4429be['include']?_[_0x32ef('0x24')](_0x4429be[_0x32ef('0x22')],function(_0x2ef3c2){return{'model':db[_0x2ef3c2['model']],'as':_0x2ef3c2['as'],'attributes':_0x2ef3c2[_0x32ef('0x21')],'include':_0x2ef3c2['include']?_[_0x32ef('0x24')](_0x2ef3c2['include'],function(_0x563581){return{'model':db[_0x563581[_0x32ef('0x23')]],'as':_0x563581['as'],'attributes':_0x563581[_0x32ef('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b89bc){logger['info'](_0x32ef('0x1c'),_0x426f18);logger[_0x32ef('0x15')]('GetVoiceQueueReport',_0x426f18,JSON[_0x32ef('0x17')](_0x2b89bc));_0x32be77(_0x2b89bc);})[_0x32ef('0x25')](function(_0x3de420){logger[_0x32ef('0x18')](_0x32ef('0x1c'),_0x3de420[_0x32ef('0x19')],_0x426f18);_0x336372(_0x3e833d[_0x32ef('0x18')](0x1f4,_0x3de420[_0x32ef('0x19')]));});});};exports[_0x32ef('0x26')]=function(_0x10dae3){var _0x4769fa=this;return new Promise(function(_0x16413e,_0xc9e053){return db[_0x32ef('0x1d')][_0x32ef('0x27')](_0x10dae3[_0x32ef('0x28')],{'raw':_0x10dae3['options']?_0x10dae3[_0x32ef('0x20')][_0x32ef('0x1f')]===undefined?!![]:![]:!![]})[_0x32ef('0x12')](function(_0x26bc36){logger[_0x32ef('0x1a')](_0x32ef('0x26'),_0x10dae3);logger['debug'](_0x32ef('0x26'),_0x10dae3,JSON[_0x32ef('0x17')](_0x26bc36));_0x16413e(_0x26bc36);})[_0x32ef('0x25')](function(_0x2ddfab){logger[_0x32ef('0x18')](_0x32ef('0x26'),_0x2ddfab[_0x32ef('0x19')],_0x10dae3);_0xc9e053(_0x4769fa[_0x32ef('0x18')](0x1f4,_0x2ddfab[_0x32ef('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x20d957){var _0x1d3d1a=this;return new Promise(function(_0x240831,_0x23e6f2){return db[_0x32ef('0x1d')]['update'](_0x20d957[_0x32ef('0x28')],{'raw':_0x20d957[_0x32ef('0x20')]?_0x20d957[_0x32ef('0x20')][_0x32ef('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20d957[_0x32ef('0x20')]?_0x20d957['options'][_0x32ef('0x29')]||null:null,'attributes':_0x20d957[_0x32ef('0x20')]?_0x20d957['options'][_0x32ef('0x21')]||null:null,'limit':_0x20d957[_0x32ef('0x20')]?_0x20d957['options'][_0x32ef('0x2a')]||null:null})[_0x32ef('0x12')](function(_0x4709ed){logger[_0x32ef('0x1a')](_0x32ef('0x2b'),_0x20d957);logger[_0x32ef('0x15')](_0x32ef('0x2b'),_0x20d957,JSON[_0x32ef('0x17')](_0x4709ed));_0x240831(_0x4709ed);})[_0x32ef('0x25')](function(_0x10d4f2){logger[_0x32ef('0x18')](_0x32ef('0x2b'),_0x10d4f2['message'],_0x20d957);_0x23e6f2(_0x1d3d1a[_0x32ef('0x18')](0x1f4,_0x10d4f2[_0x32ef('0x19')]));});});}; \ No newline at end of file +var _0x3451=['stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','VoiceQueueReport','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x19a41b,_0x59f827){var _0x3bd57d=function(_0x48db5e){while(--_0x48db5e){_0x19a41b['push'](_0x19a41b['shift']());}};_0x3bd57d(++_0x59f827);}(_0x3451,0x112));var _0x1345=function(_0x7c6b9f,_0x633a39){_0x7c6b9f=_0x7c6b9f-0x0;var _0x2d47e0=_0x3451[_0x7c6b9f];return _0x2d47e0;};'use strict';var _=require(_0x1345('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1345('0x1'));var fs=require('fs');var Redis=require(_0x1345('0x2'));var db=require(_0x1345('0x3'))['db'];var utils=require(_0x1345('0x4'));var logger=require(_0x1345('0x5'))(_0x1345('0x6'));var config=require(_0x1345('0x7'));var jayson=require(_0x1345('0x8'));var client=jayson[_0x1345('0x9')][_0x1345('0xa')]({'port':0x232a});config[_0x1345('0xb')]=_[_0x1345('0xc')](config[_0x1345('0xb')],{'host':_0x1345('0xd'),'port':0x18eb});var socket=require(_0x1345('0xe'))(new Redis(config[_0x1345('0xb')]));require(_0x1345('0xf'))['register'](socket);function respondWithRpcPromise(_0x49d2a2,_0x452ba4,_0x332917){return new BPromise(function(_0x29036e,_0x3ea1eb){return client['request'](_0x49d2a2,_0x332917)[_0x1345('0x10')](function(_0x424d37){logger[_0x1345('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x452ba4,_0x1345('0x12'));logger['debug'](_0x1345('0x13'),_0x452ba4,'request\x20sent',JSON[_0x1345('0x14')](_0x424d37));if(_0x424d37['error']){if(_0x424d37[_0x1345('0x15')][_0x1345('0x16')]===0x1f4){logger['error'](_0x1345('0x17'),_0x452ba4,_0x424d37[_0x1345('0x15')][_0x1345('0x18')]);return _0x3ea1eb(_0x424d37[_0x1345('0x15')]['message']);}logger[_0x1345('0x15')](_0x1345('0x17'),_0x452ba4,_0x424d37[_0x1345('0x15')]['message']);return _0x29036e(_0x424d37['error'][_0x1345('0x18')]);}else{logger['info'](_0x1345('0x17'),_0x452ba4,_0x1345('0x12'));_0x29036e(_0x424d37['result']['message']);}})[_0x1345('0x19')](function(_0x4795ea){logger[_0x1345('0x15')](_0x1345('0x17'),_0x452ba4,_0x4795ea);_0x3ea1eb(_0x4795ea);});});}exports[_0x1345('0x1a')]=function(_0x10cd22){var _0x2e7a7a=this;return new Promise(function(_0x3ed709,_0x2a229a){return db['VoiceQueueReport'][_0x1345('0x1b')]({'raw':_0x10cd22[_0x1345('0x1c')]?_0x10cd22[_0x1345('0x1c')][_0x1345('0x1d')]===undefined?!![]:![]:!![],'where':_0x10cd22[_0x1345('0x1c')]?_0x10cd22['options'][_0x1345('0x1e')]||null:null,'attributes':_0x10cd22[_0x1345('0x1c')]?_0x10cd22[_0x1345('0x1c')][_0x1345('0x1f')]||null:null,'limit':_0x10cd22[_0x1345('0x1c')]?_0x10cd22[_0x1345('0x1c')]['limit']||null:null,'include':_0x10cd22[_0x1345('0x1c')]?_0x10cd22[_0x1345('0x1c')][_0x1345('0x20')]?_[_0x1345('0x21')](_0x10cd22[_0x1345('0x1c')][_0x1345('0x20')],function(_0x5693cd){return{'model':db[_0x5693cd[_0x1345('0x22')]],'as':_0x5693cd['as'],'attributes':_0x5693cd[_0x1345('0x1f')],'include':_0x5693cd[_0x1345('0x20')]?_['map'](_0x5693cd[_0x1345('0x20')],function(_0x1631f9){return{'model':db[_0x1631f9[_0x1345('0x22')]],'as':_0x1631f9['as'],'attributes':_0x1631f9[_0x1345('0x1f')],'include':_0x1631f9[_0x1345('0x20')]?_[_0x1345('0x21')](_0x1631f9['include'],function(_0x67011f){return{'model':db[_0x67011f[_0x1345('0x22')]],'as':_0x67011f['as'],'attributes':_0x67011f[_0x1345('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1345('0x10')](function(_0x3d8b6a){logger['info']('GetVoiceQueueReport',_0x10cd22);logger[_0x1345('0x23')](_0x1345('0x1a'),_0x10cd22,JSON[_0x1345('0x14')](_0x3d8b6a));_0x3ed709(_0x3d8b6a);})[_0x1345('0x19')](function(_0xf81dd0){logger[_0x1345('0x15')]('GetVoiceQueueReport',_0xf81dd0[_0x1345('0x18')],_0x10cd22);_0x2a229a(_0x2e7a7a['error'](0x1f4,_0xf81dd0[_0x1345('0x18')]));});});};exports[_0x1345('0x24')]=function(_0x5f0112){var _0x5331d4=this;return new Promise(function(_0x12b330,_0x2a53bc){return db['VoiceQueueReport'][_0x1345('0x25')](_0x5f0112[_0x1345('0x26')],{'raw':_0x5f0112[_0x1345('0x1c')]?_0x5f0112[_0x1345('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x328eb9){logger[_0x1345('0x11')](_0x1345('0x24'),_0x5f0112);logger['debug']('CreateVoiceQueueReport',_0x5f0112,JSON[_0x1345('0x14')](_0x328eb9));_0x12b330(_0x328eb9);})[_0x1345('0x19')](function(_0xe2ec68){logger['error']('CreateVoiceQueueReport',_0xe2ec68['message'],_0x5f0112);_0x2a53bc(_0x5331d4[_0x1345('0x15')](0x1f4,_0xe2ec68[_0x1345('0x18')]));});});};exports[_0x1345('0x27')]=function(_0x1b8b11){var _0x25e96b=this;return new Promise(function(_0x125f98,_0x3151d3){return db[_0x1345('0x28')]['update'](_0x1b8b11[_0x1345('0x26')],{'raw':_0x1b8b11[_0x1345('0x1c')]?_0x1b8b11[_0x1345('0x1c')][_0x1345('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b8b11[_0x1345('0x1c')]?_0x1b8b11[_0x1345('0x1c')][_0x1345('0x1e')]||null:null,'attributes':_0x1b8b11[_0x1345('0x1c')]?_0x1b8b11[_0x1345('0x1c')]['attributes']||null:null,'limit':_0x1b8b11['options']?_0x1b8b11['options'][_0x1345('0x29')]||null:null})[_0x1345('0x10')](function(_0x3ff9bd){logger[_0x1345('0x11')](_0x1345('0x27'),_0x1b8b11);logger[_0x1345('0x23')](_0x1345('0x27'),_0x1b8b11,JSON[_0x1345('0x14')](_0x3ff9bd));_0x125f98(_0x3ff9bd);})[_0x1345('0x19')](function(_0x1d083c){logger[_0x1345('0x15')](_0x1345('0x27'),_0x1d083c[_0x1345('0x18')],_0x1b8b11);_0x3151d3(_0x25e96b[_0x1345('0x15')](0x1f4,_0x1d083c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 71083b8..b006141 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 _0x120b=['removeListener','register','length','./voiceQueueReport.events','save','update','emit'];(function(_0x1c951c,_0x1f6839){var _0x879b04=function(_0x460245){while(--_0x460245){_0x1c951c['push'](_0x1c951c['shift']());}};_0x879b04(++_0x1f6839);}(_0x120b,0x8f));var _0xb120=function(_0x238a66,_0x4381fb){_0x238a66=_0x238a66-0x0;var _0x2a3b2f=_0x120b[_0x238a66];return _0x2a3b2f;};'use strict';var VoiceQueueReportEvents=require(_0xb120('0x0'));var events=[_0xb120('0x1'),'remove',_0xb120('0x2')];function createListener(_0xad3ac,_0x4301e9){return function(_0x2580ae){_0x4301e9[_0xb120('0x3')](_0xad3ac,_0x2580ae);};}function removeListener(_0xe1d9d1,_0x2208f9){return function(){VoiceQueueReportEvents[_0xb120('0x4')](_0xe1d9d1,_0x2208f9);};}exports[_0xb120('0x5')]=function(_0xbc7c27){for(var _0x1e3073=0x0,_0x568841=events[_0xb120('0x6')];_0x1e3073<_0x568841;_0x1e3073++){var _0x1f1165=events[_0x1e3073];var _0xa1d8ba=createListener('voiceQueueReport:'+_0x1f1165,_0xbc7c27);VoiceQueueReportEvents['on'](_0x1f1165,_0xa1d8ba);}}; \ No newline at end of file +var _0x5eb8=['save','remove','removeListener','register','length'];(function(_0x5c9b35,_0x112dd5){var _0x20b56b=function(_0x261acf){while(--_0x261acf){_0x5c9b35['push'](_0x5c9b35['shift']());}};_0x20b56b(++_0x112dd5);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x5eb8[_0x180c9b];return _0x3ff116;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x85eb('0x0'),_0x85eb('0x1'),'update'];function createListener(_0x4e9ac4,_0x963724){return function(_0x2e57e9){_0x963724['emit'](_0x4e9ac4,_0x2e57e9);};}function removeListener(_0x41b11e,_0x30ac6a){return function(){VoiceQueueReportEvents[_0x85eb('0x2')](_0x41b11e,_0x30ac6a);};}exports[_0x85eb('0x3')]=function(_0x4c6606){for(var _0xec020a=0x0,_0x665c30=events[_0x85eb('0x4')];_0xec020a<_0x665c30;_0xec020a++){var _0x415299=events[_0xec020a];var _0x2a5cef=createListener('voiceQueueReport:'+_0x415299,_0x4c6606);VoiceQueueReportEvents['on'](_0x415299,_0x2a5cef);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 2b79bcc..5af590e 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 _0x238f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3bf51a,_0x5ce05f){var _0x33e0c5=function(_0x51b95e){while(--_0x51b95e){_0x3bf51a['push'](_0x3bf51a['shift']());}};_0x33e0c5(++_0x5ce05f);}(_0x238f,0xa5));var _0xf238=function(_0x3f6dc1,_0x50a8f7){_0x3f6dc1=_0x3f6dc1-0x0;var _0x417eba=_0x238f[_0x3f6dc1];return _0x417eba;};'use strict';var multer=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var path=require(_0xf238('0x2'));var timeout=require('connect-timeout');var express=require(_0xf238('0x3'));var router=express[_0xf238('0x4')]();var fs_extra=require(_0xf238('0x5'));var auth=require(_0xf238('0x6'));var interaction=require(_0xf238('0x7'));var config=require(_0xf238('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0xf238('0x9')]('/',auth[_0xf238('0xa')](),controller['index']);router['get'](_0xf238('0xb'),auth['isAuthenticated'](),controller[_0xf238('0xc')]);router[_0xf238('0xd')]('/',auth[_0xf238('0xa')](),controller[_0xf238('0xe')]);router['put'](_0xf238('0xb'),auth['isAuthenticated'](),controller[_0xf238('0xf')]);router[_0xf238('0x10')](_0xf238('0xb'),auth[_0xf238('0xa')](),controller[_0xf238('0x11')]);module[_0xf238('0x12')]=router; \ No newline at end of file +var _0x2194=['/:id','show','post','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x122633,_0x28b158){var _0x8eb68f=function(_0x3c6795){while(--_0x3c6795){_0x122633['push'](_0x122633['shift']());}};_0x8eb68f(++_0x28b158);}(_0x2194,0x8d));var _0x4219=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2194[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require('multer');var util=require(_0x4219('0x0'));var path=require(_0x4219('0x1'));var timeout=require('connect-timeout');var express=require(_0x4219('0x2'));var router=express[_0x4219('0x3')]();var fs_extra=require(_0x4219('0x4'));var auth=require(_0x4219('0x5'));var interaction=require(_0x4219('0x6'));var config=require(_0x4219('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x4219('0x8')]('/',auth[_0x4219('0x9')](),controller[_0x4219('0xa')]);router[_0x4219('0x8')](_0x4219('0xb'),auth[_0x4219('0x9')](),controller[_0x4219('0xc')]);router[_0x4219('0xd')]('/',auth[_0x4219('0x9')](),controller[_0x4219('0xe')]);router['put'](_0x4219('0xb'),auth[_0x4219('0x9')](),controller[_0x4219('0xf')]);router[_0x4219('0x10')](_0x4219('0xb'),auth[_0x4219('0x9')](),controller[_0x4219('0x11')]);module[_0x4219('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 422358e..ed4cd22 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 _0xec6f=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x213c2c,_0x3e685b){var _0x40da97=function(_0x188047){while(--_0x188047){_0x213c2c['push'](_0x213c2c['shift']());}};_0x40da97(++_0x3e685b);}(_0xec6f,0x130));var _0xfec6=function(_0x27a0bd,_0x41e831){_0x27a0bd=_0x27a0bd-0x0;var _0xa68da6=_0xec6f[_0x27a0bd];return _0xa68da6;};'use strict';var Sequelize=require(_0xfec6('0x0'));var moment=require(_0xfec6('0x1'));module[_0xfec6('0x2')]={'time':{'type':Sequelize[_0xfec6('0x3')]},'callid':{'type':Sequelize[_0xfec6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfec6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfec6('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfec6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xfec6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfec6('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xfec6('0x5')](_0xfec6('0x6'))}}; \ No newline at end of file +var _0x409f=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x49677a,_0x197e86){var _0x115408=function(_0xc88918){while(--_0xc88918){_0x49677a['push'](_0x49677a['shift']());}};_0x115408(++_0x197e86);}(_0x409f,0x1ac));var _0xf409=function(_0x29940f,_0x5c519a){_0x29940f=_0x29940f-0x0;var _0x342c30=_0x409f[_0x29940f];return _0x342c30;};'use strict';var Sequelize=require(_0xf409('0x0'));var moment=require(_0xf409('0x1'));module[_0xf409('0x2')]={'time':{'type':Sequelize[_0xf409('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf409('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf409('0x4')](_0xf409('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 84367fd..01cedcf 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 _0xf8d6=['limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xf8d6,0xc7));var _0x6f8d=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xf8d6[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f8d('0x0'));var jsonpatch=require(_0x6f8d('0x1'));var rp=require(_0x6f8d('0x2'));var moment=require(_0x6f8d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f8d('0x4'));var util=require('util');var path=require(_0x6f8d('0x5'));var sox=require(_0x6f8d('0x6'));var csv=require(_0x6f8d('0x7'));var ejs=require(_0x6f8d('0x8'));var fs=require('fs');var fs_extra=require(_0x6f8d('0x9'));var _=require(_0x6f8d('0xa'));var squel=require(_0x6f8d('0xb'));var crypto=require(_0x6f8d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6f8d('0xd'));var toCsv=require(_0x6f8d('0x7'));var querystring=require(_0x6f8d('0xe'));var Papa=require(_0x6f8d('0xf'));var Redis=require(_0x6f8d('0x10'));var authService=require(_0x6f8d('0x11'));var qs=require(_0x6f8d('0x12'));var as=require(_0x6f8d('0x13'));var hardwareService=require(_0x6f8d('0x14'));var logger=require(_0x6f8d('0x15'))(_0x6f8d('0x16'));var utils=require(_0x6f8d('0x17'));var config=require(_0x6f8d('0x18'));var licenseUtil=require(_0x6f8d('0x19'));var db=require(_0x6f8d('0x1a'))['db'];function respondWithStatusCode(_0x43c8b1,_0x4564e6){_0x4564e6=_0x4564e6||0xcc;return function(_0x33c2f9){if(_0x33c2f9){return _0x43c8b1[_0x6f8d('0x1b')](_0x4564e6);}return _0x43c8b1[_0x6f8d('0x1c')](_0x4564e6)[_0x6f8d('0x1d')]();};}function respondWithResult(_0x407324,_0x27b0d4){_0x27b0d4=_0x27b0d4||0xc8;return function(_0xdfa919){if(_0xdfa919){return _0x407324[_0x6f8d('0x1c')](_0x27b0d4)['json'](_0xdfa919);}};}function respondWithFilteredResult(_0x10e482,_0x5e6e9d){return function(_0x28a5fb){if(_0x28a5fb){var _0x38f97f=typeof _0x5e6e9d[_0x6f8d('0x1e')]===_0x6f8d('0x1f')&&typeof _0x5e6e9d[_0x6f8d('0x20')]===_0x6f8d('0x1f');var _0x5b221d=_0x28a5fb['count'];var _0x2c954d=_0x38f97f?0x0:_0x5e6e9d['offset'];var _0x4f761f=_0x38f97f?_0x28a5fb[_0x6f8d('0x21')]:_0x5e6e9d[_0x6f8d('0x1e')]+_0x5e6e9d[_0x6f8d('0x20')];var _0x26e753;if(_0x4f761f>=_0x5b221d){_0x4f761f=_0x5b221d;_0x26e753=0xc8;}else{_0x26e753=0xce;}_0x10e482['status'](_0x26e753);return _0x10e482[_0x6f8d('0x22')](_0x6f8d('0x23'),_0x2c954d+'-'+_0x4f761f+'/'+_0x5b221d)['json'](_0x28a5fb);}return null;};}function patchUpdates(_0xcf1505){return function(_0x5b5579){try{jsonpatch[_0x6f8d('0x24')](_0x5b5579,_0xcf1505,!![]);}catch(_0x592a18){return BPromise['reject'](_0x592a18);}return _0x5b5579['save']();};}function saveUpdates(_0x3261b1,_0xf1b8c1){return function(_0x141e70){if(_0x141e70){return _0x141e70[_0x6f8d('0x25')](_0x3261b1)['then'](function(_0x3618fe){return _0x3618fe;});}return null;};}function removeEntity(_0x42beff,_0x3aa7dc){return function(_0x2a9774){if(_0x2a9774){return _0x2a9774[_0x6f8d('0x26')]()[_0x6f8d('0x27')](function(){_0x42beff[_0x6f8d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14d5a8,_0x55e1ab){return function(_0x3a8184){if(!_0x3a8184){_0x14d5a8['sendStatus'](0x194);}return _0x3a8184;};}function handleError(_0x1210bb,_0x128421){_0x128421=_0x128421||0x1f4;return function(_0x2bc7a9){logger[_0x6f8d('0x28')](_0x2bc7a9[_0x6f8d('0x29')]);if(_0x2bc7a9[_0x6f8d('0x2a')]){delete _0x2bc7a9[_0x6f8d('0x2a')];}_0x1210bb[_0x6f8d('0x1c')](_0x128421)[_0x6f8d('0x2b')](_0x2bc7a9);};}exports[_0x6f8d('0x2c')]=function(_0x1a5fac,_0x2c2ed7){var _0x5806cc={},_0x2237c8={},_0x883f98={'count':0x0,'rows':[]};var _0x563992=_[_0x6f8d('0x2d')](db[_0x6f8d('0x2e')][_0x6f8d('0x2f')],function(_0x2fd4ea){return{'name':_0x2fd4ea[_0x6f8d('0x30')],'type':_0x2fd4ea[_0x6f8d('0x31')][_0x6f8d('0x32')]};});_0x2237c8['model']=_[_0x6f8d('0x2d')](_0x563992,_0x6f8d('0x2a'));_0x2237c8[_0x6f8d('0x33')]=_['keys'](_0x1a5fac[_0x6f8d('0x33')]);_0x2237c8[_0x6f8d('0x34')]=_['intersection'](_0x2237c8[_0x6f8d('0x35')],_0x2237c8[_0x6f8d('0x33')]);_0x5806cc[_0x6f8d('0x36')]=_[_0x6f8d('0x37')](_0x2237c8[_0x6f8d('0x35')],qs['fields'](_0x1a5fac[_0x6f8d('0x33')][_0x6f8d('0x38')]));_0x5806cc['attributes']=_0x5806cc[_0x6f8d('0x36')][_0x6f8d('0x39')]?_0x5806cc['attributes']:_0x2237c8[_0x6f8d('0x35')];if(!_0x1a5fac['query'][_0x6f8d('0x3a')](_0x6f8d('0x3b'))){_0x5806cc[_0x6f8d('0x20')]=qs[_0x6f8d('0x20')](_0x1a5fac['query'][_0x6f8d('0x20')]);_0x5806cc[_0x6f8d('0x1e')]=qs[_0x6f8d('0x1e')](_0x1a5fac[_0x6f8d('0x33')]['offset']);}_0x5806cc[_0x6f8d('0x3c')]=qs[_0x6f8d('0x3d')](_0x1a5fac[_0x6f8d('0x33')][_0x6f8d('0x3d')]);_0x5806cc[_0x6f8d('0x3e')]=qs[_0x6f8d('0x34')](_['pick'](_0x1a5fac[_0x6f8d('0x33')],_0x2237c8[_0x6f8d('0x34')]),_0x563992);if(_0x1a5fac[_0x6f8d('0x33')][_0x6f8d('0x3f')]){_0x5806cc[_0x6f8d('0x3e')]=_[_0x6f8d('0x40')](_0x5806cc[_0x6f8d('0x3e')],{'$or':_['map'](_0x563992,function(_0x36be37){if(_0x36be37[_0x6f8d('0x31')]!==_0x6f8d('0x41')){var _0x6a1f14={};_0x6a1f14[_0x36be37['name']]={'$like':'%'+_0x1a5fac['query'][_0x6f8d('0x3f')]+'%'};return _0x6a1f14;}})});}_0x5806cc=_[_0x6f8d('0x40')]({},_0x5806cc,_0x1a5fac['options']);var _0x1a4580={'where':_0x5806cc['where']};return db[_0x6f8d('0x2e')]['count'](_0x1a4580)[_0x6f8d('0x27')](function(_0x200b10){_0x883f98[_0x6f8d('0x21')]=_0x200b10;if(_0x1a5fac['query'][_0x6f8d('0x42')]){_0x5806cc[_0x6f8d('0x43')]=[{'all':!![]}];}return db[_0x6f8d('0x2e')][_0x6f8d('0x44')](_0x5806cc);})['then'](function(_0x55af52){_0x883f98[_0x6f8d('0x45')]=_0x55af52;return _0x883f98;})[_0x6f8d('0x27')](respondWithFilteredResult(_0x2c2ed7,_0x5806cc))['catch'](handleError(_0x2c2ed7,null));};exports['show']=function(_0x455f77,_0x12c015){var _0x4abeef={'raw':!![],'where':{'id':_0x455f77[_0x6f8d('0x46')]['id']}},_0x47c619={};_0x47c619[_0x6f8d('0x35')]=_[_0x6f8d('0x47')](db[_0x6f8d('0x2e')][_0x6f8d('0x2f')]);_0x47c619[_0x6f8d('0x33')]=_[_0x6f8d('0x47')](_0x455f77[_0x6f8d('0x33')]);_0x47c619[_0x6f8d('0x34')]=_[_0x6f8d('0x37')](_0x47c619[_0x6f8d('0x35')],_0x47c619[_0x6f8d('0x33')]);_0x4abeef[_0x6f8d('0x36')]=_[_0x6f8d('0x37')](_0x47c619[_0x6f8d('0x35')],qs['fields'](_0x455f77[_0x6f8d('0x33')][_0x6f8d('0x38')]));_0x4abeef[_0x6f8d('0x36')]=_0x4abeef[_0x6f8d('0x36')][_0x6f8d('0x39')]?_0x4abeef['attributes']:_0x47c619[_0x6f8d('0x35')];if(_0x455f77[_0x6f8d('0x33')]['includeAll']){_0x4abeef[_0x6f8d('0x43')]=[{'all':!![]}];}_0x4abeef=_[_0x6f8d('0x40')]({},_0x4abeef,_0x455f77[_0x6f8d('0x48')]);return db[_0x6f8d('0x2e')][_0x6f8d('0x49')](_0x4abeef)[_0x6f8d('0x27')](handleEntityNotFound(_0x12c015,null))['then'](respondWithResult(_0x12c015,null))[_0x6f8d('0x4a')](handleError(_0x12c015,null));};exports[_0x6f8d('0x4b')]=function(_0xcbbcd5,_0x391982){return db[_0x6f8d('0x2e')]['create'](_0xcbbcd5[_0x6f8d('0x4c')],{})[_0x6f8d('0x27')](respondWithResult(_0x391982,0xc9))[_0x6f8d('0x4a')](handleError(_0x391982,null));};exports['update']=function(_0x5357dc,_0x4077c5){if(_0x5357dc['body']['id']){delete _0x5357dc['body']['id'];}return db[_0x6f8d('0x2e')][_0x6f8d('0x49')]({'where':{'id':_0x5357dc['params']['id']}})['then'](handleEntityNotFound(_0x4077c5,null))[_0x6f8d('0x27')](saveUpdates(_0x5357dc[_0x6f8d('0x4c')],null))[_0x6f8d('0x27')](respondWithResult(_0x4077c5,null))[_0x6f8d('0x4a')](handleError(_0x4077c5,null));};exports[_0x6f8d('0x26')]=function(_0x5ab704,_0x213af7){return db['VoiceQueuesLog'][_0x6f8d('0x49')]({'where':{'id':_0x5ab704[_0x6f8d('0x46')]['id']}})[_0x6f8d('0x27')](handleEntityNotFound(_0x213af7,null))['then'](removeEntity(_0x213af7,null))[_0x6f8d('0x4a')](handleError(_0x213af7,null));}; \ No newline at end of file +var _0x918c=['offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','VoiceQueuesLog','type','map','query','keys','intersection','model','fields','attributes','length','order','sort','filters','where','VIRTUAL','filter','merge','options','findAll','catch','show','rawAttributes','includeAll','include','find','create','body','params','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json'];(function(_0x28d391,_0x1357b3){var _0x3c8bf0=function(_0x55bac9){while(--_0x55bac9){_0x28d391['push'](_0x28d391['shift']());}};_0x3c8bf0(++_0x1357b3);}(_0x918c,0x13e));var _0xc918=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x918c[_0x22b68a];return _0x1ac67a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc918('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc918('0x1'));var moment=require(_0xc918('0x2'));var BPromise=require(_0xc918('0x3'));var Mustache=require(_0xc918('0x4'));var util=require('util');var path=require(_0xc918('0x5'));var sox=require('sox');var csv=require(_0xc918('0x6'));var ejs=require(_0xc918('0x7'));var fs=require('fs');var fs_extra=require(_0xc918('0x8'));var _=require(_0xc918('0x9'));var squel=require(_0xc918('0xa'));var crypto=require(_0xc918('0xb'));var jsforce=require(_0xc918('0xc'));var deskjs=require(_0xc918('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc918('0xe'));var Papa=require('papaparse');var Redis=require(_0xc918('0xf'));var authService=require(_0xc918('0x10'));var qs=require(_0xc918('0x11'));var as=require(_0xc918('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc918('0x13'))(_0xc918('0x14'));var utils=require(_0xc918('0x15'));var config=require(_0xc918('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc918('0x17'))['db'];function respondWithStatusCode(_0x27bd1e,_0xa8c9a0){_0xa8c9a0=_0xa8c9a0||0xcc;return function(_0x4c4113){if(_0x4c4113){return _0x27bd1e['sendStatus'](_0xa8c9a0);}return _0x27bd1e[_0xc918('0x18')](_0xa8c9a0)[_0xc918('0x19')]();};}function respondWithResult(_0x383c9c,_0x408bf2){_0x408bf2=_0x408bf2||0xc8;return function(_0x2c53b2){if(_0x2c53b2){return _0x383c9c[_0xc918('0x18')](_0x408bf2)[_0xc918('0x1a')](_0x2c53b2);}};}function respondWithFilteredResult(_0x3e659d,_0x40a323){return function(_0x175bc6){if(_0x175bc6){var _0x49223c=typeof _0x40a323[_0xc918('0x1b')]===_0xc918('0x1c')&&typeof _0x40a323[_0xc918('0x1d')]===_0xc918('0x1c');var _0x58cecc=_0x175bc6[_0xc918('0x1e')];var _0x8e5183=_0x49223c?0x0:_0x40a323['offset'];var _0x49e00c=_0x49223c?_0x175bc6[_0xc918('0x1e')]:_0x40a323['offset']+_0x40a323[_0xc918('0x1d')];var _0x2df26b;if(_0x49e00c>=_0x58cecc){_0x49e00c=_0x58cecc;_0x2df26b=0xc8;}else{_0x2df26b=0xce;}_0x3e659d[_0xc918('0x18')](_0x2df26b);return _0x3e659d[_0xc918('0x1f')](_0xc918('0x20'),_0x8e5183+'-'+_0x49e00c+'/'+_0x58cecc)[_0xc918('0x1a')](_0x175bc6);}return null;};}function patchUpdates(_0x322143){return function(_0x43af9f){try{jsonpatch[_0xc918('0x21')](_0x43af9f,_0x322143,!![]);}catch(_0x2ae02a){return BPromise[_0xc918('0x22')](_0x2ae02a);}return _0x43af9f['save']();};}function saveUpdates(_0x1552d1,_0x5c9e10){return function(_0x527da7){if(_0x527da7){return _0x527da7[_0xc918('0x23')](_0x1552d1)[_0xc918('0x24')](function(_0x4ad199){return _0x4ad199;});}return null;};}function removeEntity(_0x509636,_0x5a2fab){return function(_0x2ee576){if(_0x2ee576){return _0x2ee576[_0xc918('0x25')]()[_0xc918('0x24')](function(){_0x509636['status'](0xcc)[_0xc918('0x19')]();});}};}function handleEntityNotFound(_0xf0c17a,_0x94b67b){return function(_0x200cdb){if(!_0x200cdb){_0xf0c17a['sendStatus'](0x194);}return _0x200cdb;};}function handleError(_0x325d25,_0x4c7eea){_0x4c7eea=_0x4c7eea||0x1f4;return function(_0x48a9c8){logger['error'](_0x48a9c8[_0xc918('0x26')]);if(_0x48a9c8[_0xc918('0x27')]){delete _0x48a9c8[_0xc918('0x27')];}_0x325d25[_0xc918('0x18')](_0x4c7eea)['send'](_0x48a9c8);};}exports[_0xc918('0x28')]=function(_0x351504,_0x303318){var _0x39e866={},_0x4ebd52={},_0x45cdaf={'count':0x0,'rows':[]};var _0x26136f=_['map'](db[_0xc918('0x29')]['rawAttributes'],function(_0x2eb492){return{'name':_0x2eb492['fieldName'],'type':_0x2eb492[_0xc918('0x2a')]['key']};});_0x4ebd52['model']=_[_0xc918('0x2b')](_0x26136f,_0xc918('0x27'));_0x4ebd52[_0xc918('0x2c')]=_[_0xc918('0x2d')](_0x351504[_0xc918('0x2c')]);_0x4ebd52['filters']=_[_0xc918('0x2e')](_0x4ebd52[_0xc918('0x2f')],_0x4ebd52['query']);_0x39e866['attributes']=_['intersection'](_0x4ebd52['model'],qs[_0xc918('0x30')](_0x351504[_0xc918('0x2c')]['fields']));_0x39e866['attributes']=_0x39e866[_0xc918('0x31')][_0xc918('0x32')]?_0x39e866[_0xc918('0x31')]:_0x4ebd52[_0xc918('0x2f')];if(!_0x351504[_0xc918('0x2c')]['hasOwnProperty']('nolimit')){_0x39e866[_0xc918('0x1d')]=qs[_0xc918('0x1d')](_0x351504[_0xc918('0x2c')][_0xc918('0x1d')]);_0x39e866[_0xc918('0x1b')]=qs[_0xc918('0x1b')](_0x351504[_0xc918('0x2c')][_0xc918('0x1b')]);}_0x39e866[_0xc918('0x33')]=qs[_0xc918('0x34')](_0x351504[_0xc918('0x2c')][_0xc918('0x34')]);_0x39e866['where']=qs['filters'](_['pick'](_0x351504[_0xc918('0x2c')],_0x4ebd52[_0xc918('0x35')]),_0x26136f);if(_0x351504[_0xc918('0x2c')]['filter']){_0x39e866[_0xc918('0x36')]=_['merge'](_0x39e866[_0xc918('0x36')],{'$or':_[_0xc918('0x2b')](_0x26136f,function(_0x4deabe){if(_0x4deabe[_0xc918('0x2a')]!==_0xc918('0x37')){var _0xa3a399={};_0xa3a399[_0x4deabe['name']]={'$like':'%'+_0x351504['query'][_0xc918('0x38')]+'%'};return _0xa3a399;}})});}_0x39e866=_[_0xc918('0x39')]({},_0x39e866,_0x351504[_0xc918('0x3a')]);var _0xa4e59b={'where':_0x39e866[_0xc918('0x36')]};return db['VoiceQueuesLog'][_0xc918('0x1e')](_0xa4e59b)[_0xc918('0x24')](function(_0xbc641c){_0x45cdaf[_0xc918('0x1e')]=_0xbc641c;if(_0x351504[_0xc918('0x2c')]['includeAll']){_0x39e866['include']=[{'all':!![]}];}return db[_0xc918('0x29')][_0xc918('0x3b')](_0x39e866);})[_0xc918('0x24')](function(_0x33becb){_0x45cdaf['rows']=_0x33becb;return _0x45cdaf;})['then'](respondWithFilteredResult(_0x303318,_0x39e866))[_0xc918('0x3c')](handleError(_0x303318,null));};exports[_0xc918('0x3d')]=function(_0x3be4a4,_0x517a0a){var _0x3c7c32={'raw':!![],'where':{'id':_0x3be4a4['params']['id']}},_0x428adc={};_0x428adc[_0xc918('0x2f')]=_[_0xc918('0x2d')](db[_0xc918('0x29')][_0xc918('0x3e')]);_0x428adc[_0xc918('0x2c')]=_[_0xc918('0x2d')](_0x3be4a4['query']);_0x428adc[_0xc918('0x35')]=_[_0xc918('0x2e')](_0x428adc[_0xc918('0x2f')],_0x428adc[_0xc918('0x2c')]);_0x3c7c32[_0xc918('0x31')]=_['intersection'](_0x428adc['model'],qs['fields'](_0x3be4a4[_0xc918('0x2c')][_0xc918('0x30')]));_0x3c7c32['attributes']=_0x3c7c32['attributes'][_0xc918('0x32')]?_0x3c7c32['attributes']:_0x428adc[_0xc918('0x2f')];if(_0x3be4a4[_0xc918('0x2c')][_0xc918('0x3f')]){_0x3c7c32[_0xc918('0x40')]=[{'all':!![]}];}_0x3c7c32=_[_0xc918('0x39')]({},_0x3c7c32,_0x3be4a4[_0xc918('0x3a')]);return db[_0xc918('0x29')][_0xc918('0x41')](_0x3c7c32)[_0xc918('0x24')](handleEntityNotFound(_0x517a0a,null))[_0xc918('0x24')](respondWithResult(_0x517a0a,null))[_0xc918('0x3c')](handleError(_0x517a0a,null));};exports[_0xc918('0x42')]=function(_0x5c442c,_0x53f924){return db[_0xc918('0x29')][_0xc918('0x42')](_0x5c442c[_0xc918('0x43')],{})[_0xc918('0x24')](respondWithResult(_0x53f924,0xc9))['catch'](handleError(_0x53f924,null));};exports[_0xc918('0x23')]=function(_0xc50309,_0x4044a5){if(_0xc50309['body']['id']){delete _0xc50309[_0xc918('0x43')]['id'];}return db[_0xc918('0x29')][_0xc918('0x41')]({'where':{'id':_0xc50309[_0xc918('0x44')]['id']}})['then'](handleEntityNotFound(_0x4044a5,null))['then'](saveUpdates(_0xc50309[_0xc918('0x43')],null))[_0xc918('0x24')](respondWithResult(_0x4044a5,null))['catch'](handleError(_0x4044a5,null));};exports[_0xc918('0x25')]=function(_0x2e8d70,_0x30fa84){return db['VoiceQueuesLog']['find']({'where':{'id':_0x2e8d70[_0xc918('0x44')]['id']}})['then'](handleEntityNotFound(_0x30fa84,null))['then'](removeEntity(_0x30fa84,null))[_0xc918('0x3c')](handleError(_0x30fa84,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 6c0e312..28c8fc1 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 _0x6113=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6113,0x1c8));var _0x3611=function(_0x244c29,_0x1ab93c){_0x244c29=_0x244c29-0x0;var _0x4845af=_0x6113[_0x244c29];return _0x4845af;};'use strict';var _=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var logger=require(_0x3611('0x2'))('api');var moment=require(_0x3611('0x3'));var BPromise=require(_0x3611('0x4'));var rp=require(_0x3611('0x5'));var fs=require('fs');var path=require(_0x3611('0x6'));var rimraf=require(_0x3611('0x7'));var config=require(_0x3611('0x8'));var attributes=require(_0x3611('0x9'));module['exports']=function(_0x377654,_0x18306f){return _0x377654[_0x3611('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0x3611('0xb'),'paranoid':![],'indexes':[{'name':_0x3611('0xc'),'fields':[_0x3611('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xa882=['dtm','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event_dtm','event'];(function(_0x4e3261,_0x54dc80){var _0x496bf9=function(_0x402aae){while(--_0x402aae){_0x4e3261['push'](_0x4e3261['shift']());}};_0x496bf9(++_0x54dc80);}(_0xa882,0x135));var _0x2a88=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xa882[_0x2d61b2];return _0x12df89;};'use strict';var _=require(_0x2a88('0x0'));var util=require(_0x2a88('0x1'));var logger=require(_0x2a88('0x2'))('api');var moment=require(_0x2a88('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a88('0x4'));var fs=require('fs');var path=require(_0x2a88('0x5'));var rimraf=require(_0x2a88('0x6'));var config=require(_0x2a88('0x7'));var attributes=require(_0x2a88('0x8'));module['exports']=function(_0x106b35,_0x58339c){return _0x106b35[_0x2a88('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x2a88('0xa'),'paranoid':![],'indexes':[{'name':_0x2a88('0xb'),'fields':[_0x2a88('0xc'),_0x2a88('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 4eb1bba..94db87f 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 _0xccef=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x5c12f2,_0x5de043){var _0x5e8344=function(_0x445932){while(--_0x445932){_0x5c12f2['push'](_0x5c12f2['shift']());}};_0x5e8344(++_0x5de043);}(_0xccef,0x1ee));var _0xfcce=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xccef[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xfcce('0x0'));var moment=require('moment');var BPromise=require(_0xfcce('0x1'));var rs=require(_0xfcce('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcce('0x3'))['db'];var utils=require(_0xfcce('0x4'));var logger=require(_0xfcce('0x5'))('rpc');var config=require(_0xfcce('0x6'));var jayson=require(_0xfcce('0x7'));var client=jayson['client'][_0xfcce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25256d,_0x4bcc9f,_0x30730c){return new BPromise(function(_0x2e4775,_0x51586d){return client['request'](_0x25256d,_0x30730c)[_0xfcce('0x9')](function(_0x4566ad){logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x4bcc9f,'request\x20sent');logger[_0xfcce('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4bcc9f,_0xfcce('0xd'),JSON[_0xfcce('0xe')](_0x4566ad));if(_0x4566ad['error']){if(_0x4566ad[_0xfcce('0xf')]['code']===0x1f4){logger[_0xfcce('0xf')](_0xfcce('0xb'),_0x4bcc9f,_0x4566ad[_0xfcce('0xf')][_0xfcce('0x10')]);return _0x51586d(_0x4566ad['error'][_0xfcce('0x10')]);}logger[_0xfcce('0xf')](_0xfcce('0xb'),_0x4bcc9f,_0x4566ad[_0xfcce('0xf')]['message']);return _0x2e4775(_0x4566ad['error'][_0xfcce('0x10')]);}else{logger[_0xfcce('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4bcc9f,_0xfcce('0xd'));_0x2e4775(_0x4566ad[_0xfcce('0x11')]['message']);}})[_0xfcce('0x12')](function(_0x5b7b9b){logger[_0xfcce('0xf')](_0xfcce('0xb'),_0x4bcc9f,_0x5b7b9b);_0x51586d(_0x5b7b9b);});});} \ No newline at end of file +var _0x68f9=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x212579,_0xdb4d5a){var _0x55d50e=function(_0x38fa1d){while(--_0x38fa1d){_0x212579['push'](_0x212579['shift']());}};_0x55d50e(++_0xdb4d5a);}(_0x68f9,0xca));var _0x968f=function(_0x1ed0ab,_0x13bf64){_0x1ed0ab=_0x1ed0ab-0x0;var _0x47fd17=_0x68f9[_0x1ed0ab];return _0x47fd17;};'use strict';var _=require(_0x968f('0x0'));var util=require(_0x968f('0x1'));var moment=require(_0x968f('0x2'));var BPromise=require(_0x968f('0x3'));var rs=require(_0x968f('0x4'));var fs=require('fs');var Redis=require(_0x968f('0x5'));var db=require(_0x968f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x968f('0x7'))(_0x968f('0x8'));var config=require(_0x968f('0x9'));var jayson=require(_0x968f('0xa'));var client=jayson[_0x968f('0xb')][_0x968f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5214b6,_0x3883c4,_0x4dd516){return new BPromise(function(_0x14140f,_0x352cae){return client[_0x968f('0xd')](_0x5214b6,_0x4dd516)['then'](function(_0x1a812c){logger[_0x968f('0xe')](_0x968f('0xf'),_0x3883c4,_0x968f('0x10'));logger[_0x968f('0x11')](_0x968f('0x12'),_0x3883c4,_0x968f('0x10'),JSON['stringify'](_0x1a812c));if(_0x1a812c[_0x968f('0x13')]){if(_0x1a812c[_0x968f('0x13')][_0x968f('0x14')]===0x1f4){logger['error'](_0x968f('0xf'),_0x3883c4,_0x1a812c[_0x968f('0x13')][_0x968f('0x15')]);return _0x352cae(_0x1a812c['error'][_0x968f('0x15')]);}logger[_0x968f('0x13')](_0x968f('0xf'),_0x3883c4,_0x1a812c[_0x968f('0x13')][_0x968f('0x15')]);return _0x14140f(_0x1a812c[_0x968f('0x13')]['message']);}else{logger[_0x968f('0xe')](_0x968f('0xf'),_0x3883c4,_0x968f('0x10'));_0x14140f(_0x1a812c[_0x968f('0x16')]['message']);}})[_0x968f('0x17')](function(_0x3d77a6){logger[_0x968f('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3883c4,_0x3d77a6);_0x352cae(_0x3d77a6);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6bb9d70..29ab6e4 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 _0x7018=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','delete'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7018,0x1b6));var _0x8701=function(_0x3fc009,_0x4c36e3){_0x3fc009=_0x3fc009-0x0;var _0x414869=_0x7018[_0x3fc009];return _0x414869;};'use strict';var multer=require(_0x8701('0x0'));var util=require(_0x8701('0x1'));var path=require('path');var timeout=require(_0x8701('0x2'));var express=require(_0x8701('0x3'));var router=express[_0x8701('0x4')]();var fs_extra=require(_0x8701('0x5'));var auth=require(_0x8701('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8701('0x7'));var controller=require('./voiceRecording.controller');router[_0x8701('0x8')]('/',auth[_0x8701('0x9')](),controller[_0x8701('0xa')]);router[_0x8701('0x8')](_0x8701('0xb'),auth[_0x8701('0x9')](),controller[_0x8701('0xc')]);router[_0x8701('0x8')](_0x8701('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8701('0x8')](_0x8701('0xe'),auth[_0x8701('0x9')](),controller['download']);router['get']('/:id/downloads',controller[_0x8701('0xf')]);router['get'](_0x8701('0x10'),auth[_0x8701('0x9')](),controller[_0x8701('0x11')]);router[_0x8701('0x12')]('/',auth[_0x8701('0x9')](),controller['create']);router[_0x8701('0x12')](_0x8701('0x10'),auth[_0x8701('0x9')](),controller[_0x8701('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8701('0x14')]);router[_0x8701('0x15')](_0x8701('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x8701('0x16')]=router; \ No newline at end of file +var _0x61d9=['show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x3b5da3,_0x12aa79){var _0x7e0d98=function(_0xb3f02){while(--_0xb3f02){_0x3b5da3['push'](_0x3b5da3['shift']());}};_0x7e0d98(++_0x12aa79);}(_0x61d9,0xff));var _0x961d=function(_0x5197da,_0x510a44){_0x5197da=_0x5197da-0x0;var _0x1d2374=_0x61d9[_0x5197da];return _0x1d2374;};'use strict';var multer=require(_0x961d('0x0'));var util=require(_0x961d('0x1'));var path=require(_0x961d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x961d('0x3')]();var fs_extra=require(_0x961d('0x4'));var auth=require(_0x961d('0x5'));var interaction=require(_0x961d('0x6'));var config=require(_0x961d('0x7'));var controller=require(_0x961d('0x8'));router['get']('/',auth[_0x961d('0x9')](),controller[_0x961d('0xa')]);router[_0x961d('0xb')](_0x961d('0xc'),auth[_0x961d('0x9')](),controller[_0x961d('0xd')]);router['get'](_0x961d('0xe'),auth[_0x961d('0x9')](),controller[_0x961d('0xf')]);router[_0x961d('0xb')](_0x961d('0x10'),auth[_0x961d('0x9')](),controller[_0x961d('0x11')]);router[_0x961d('0xb')](_0x961d('0x12'),controller[_0x961d('0x13')]);router['get'](_0x961d('0x14'),auth[_0x961d('0x9')](),controller[_0x961d('0x15')]);router[_0x961d('0x16')]('/',auth[_0x961d('0x9')](),controller[_0x961d('0x17')]);router[_0x961d('0x16')]('/:id/transcribe',auth[_0x961d('0x9')](),controller[_0x961d('0x18')]);router[_0x961d('0x19')]('/:id',auth[_0x961d('0x9')](),controller[_0x961d('0x1a')]);router[_0x961d('0x1b')](_0x961d('0xe'),auth[_0x961d('0x9')](),controller[_0x961d('0x1c')]);module[_0x961d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 300e17e..86f2c62 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(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 4b2ebad..13a62be 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 _0x2778=['readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Sequelize','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','params','length','includeAll','find','create','body','describe','download','../../components/encryptor','type','uniqueid','value','existsSync','decryptFile','secrets','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','%s.cypher','recording','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','basename'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x2778,0x1e9));var _0x8277=function(_0x125529,_0x4d081e){_0x125529=_0x125529-0x0;var _0x98822c=_0x2778[_0x125529];return _0x98822c;};'use strict';var emlformat=require(_0x8277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8277('0x1'));var jsonpatch=require(_0x8277('0x2'));var rp=require(_0x8277('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8277('0x4'));var util=require(_0x8277('0x5'));var path=require(_0x8277('0x6'));var sox=require('sox');var csv=require(_0x8277('0x7'));var ejs=require(_0x8277('0x8'));var fs=require('fs');var fs_extra=require(_0x8277('0x9'));var _=require(_0x8277('0xa'));var squel=require(_0x8277('0xb'));var crypto=require(_0x8277('0xc'));var jsforce=require(_0x8277('0xd'));var deskjs=require(_0x8277('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8277('0xf'));var Papa=require(_0x8277('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0x8277('0x11'));var Redis=require(_0x8277('0x12'));var authService=require(_0x8277('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8277('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8277('0x15'))(_0x8277('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8277('0x17'));var db=require(_0x8277('0x18'))['db'];function respondWithStatusCode(_0x3f7454,_0xb5ef52){_0xb5ef52=_0xb5ef52||0xcc;return function(_0x547cf2){if(_0x547cf2){return _0x3f7454[_0x8277('0x19')](_0xb5ef52);}return _0x3f7454['status'](_0xb5ef52)[_0x8277('0x1a')]();};}function respondWithResult(_0x3b0aa4,_0x51f54b){_0x51f54b=_0x51f54b||0xc8;return function(_0x3586d6){if(_0x3586d6){return _0x3b0aa4['status'](_0x51f54b)[_0x8277('0x1b')](_0x3586d6);}};}function respondWithFilteredResult(_0xe9ab34,_0x26b9c4){return function(_0x2ab034){if(_0x2ab034){var _0x2e5b8f=typeof _0x26b9c4[_0x8277('0x1c')]===_0x8277('0x1d')&&typeof _0x26b9c4['limit']==='undefined';var _0x17d87c=_0x2ab034['count'];var _0x25cf94=_0x2e5b8f?0x0:_0x26b9c4[_0x8277('0x1c')];var _0x32d75b=_0x2e5b8f?_0x2ab034[_0x8277('0x1e')]:_0x26b9c4['offset']+_0x26b9c4[_0x8277('0x1f')];var _0x24f267;if(_0x32d75b>=_0x17d87c){_0x32d75b=_0x17d87c;_0x24f267=0xc8;}else{_0x24f267=0xce;}_0xe9ab34[_0x8277('0x20')](_0x24f267);return _0xe9ab34['set'](_0x8277('0x21'),_0x25cf94+'-'+_0x32d75b+'/'+_0x17d87c)[_0x8277('0x1b')](_0x2ab034);}return null;};}function patchUpdates(_0x10be10){return function(_0x2432b6){try{jsonpatch[_0x8277('0x22')](_0x2432b6,_0x10be10,!![]);}catch(_0xc53e9d){return BPromise[_0x8277('0x23')](_0xc53e9d);}return _0x2432b6[_0x8277('0x24')]();};}function saveUpdates(_0x2e4db5,_0x4fc1e4){return function(_0x4468aa){if(_0x4468aa){return _0x4468aa[_0x8277('0x25')](_0x2e4db5)[_0x8277('0x26')](function(_0x565616){return _0x565616;});}return null;};}function removeEntity(_0x4867a5,_0x379c82){return function(_0x2f7e51){if(_0x2f7e51){return _0x2f7e51['destroy']()[_0x8277('0x26')](function(){_0x4867a5[_0x8277('0x20')](0xcc)[_0x8277('0x1a')]();});}};}function handleEntityNotFound(_0x3b2324,_0x1920cc){return function(_0xec41b7){if(!_0xec41b7){_0x3b2324[_0x8277('0x19')](0x194);}return _0xec41b7;};}function handleError(_0x9899fa,_0x3f94ad){_0x3f94ad=_0x3f94ad||0x1f4;return function(_0x549ff0){logger[_0x8277('0x27')](_0x549ff0['stack']);if(_0x549ff0[_0x8277('0x28')]){delete _0x549ff0['name'];}_0x9899fa[_0x8277('0x20')](_0x3f94ad)[_0x8277('0x29')](_0x549ff0);};}exports[_0x8277('0x2a')]=function(_0x2aa0f4,_0x5482cc){var _0x278bba={},_0x42e3a5={},_0x4f37c8={'count':0x0,'rows':[]};var _0x103995=_[_0x8277('0x2b')](db[_0x8277('0x2c')][_0x8277('0x2d')],function(_0x35c19f){return{'name':_0x35c19f[_0x8277('0x2e')],'type':_0x35c19f['type'][_0x8277('0x2f')]};});_0x42e3a5[_0x8277('0x30')]=_[_0x8277('0x31')](_['map'](_0x103995,_0x8277('0x28')),[_0x8277('0x32')]);_0x42e3a5[_0x8277('0x33')]=_[_0x8277('0x34')](_0x2aa0f4[_0x8277('0x33')]);_0x42e3a5[_0x8277('0x35')]=_[_0x8277('0x36')](_0x42e3a5['model'],_0x42e3a5[_0x8277('0x33')]);_0x278bba[_0x8277('0x37')]=_['intersection'](_0x42e3a5[_0x8277('0x30')],qs['fields'](_0x2aa0f4['query'][_0x8277('0x38')]));_0x278bba[_0x8277('0x37')]=_0x278bba[_0x8277('0x37')]['length']?_0x278bba[_0x8277('0x37')]:_0x42e3a5['model'];if(!_0x2aa0f4[_0x8277('0x33')][_0x8277('0x39')](_0x8277('0x3a'))){_0x278bba[_0x8277('0x1f')]=qs[_0x8277('0x1f')](_0x2aa0f4[_0x8277('0x33')][_0x8277('0x1f')]);_0x278bba[_0x8277('0x1c')]=qs['offset'](_0x2aa0f4[_0x8277('0x33')][_0x8277('0x1c')]);}_0x278bba['order']=qs[_0x8277('0x3b')](_0x2aa0f4[_0x8277('0x33')]['sort']);_0x278bba[_0x8277('0x3c')]=qs['filters'](_['pick'](_0x2aa0f4[_0x8277('0x33')],_0x42e3a5[_0x8277('0x35')]),_0x103995);if(_0x2aa0f4[_0x8277('0x33')][_0x8277('0x3d')]){_0x278bba['where']=_[_0x8277('0x3e')](_0x278bba[_0x8277('0x3c')],{'$or':_[_0x8277('0x2b')](_0x103995,function(_0x3860a5){if(_0x3860a5['type']!==_0x8277('0x3f')){var _0x2a2e7b={};_0x2a2e7b[_0x3860a5[_0x8277('0x28')]]={'$like':'%'+_0x2aa0f4[_0x8277('0x33')][_0x8277('0x3d')]+'%'};return _0x2a2e7b;}})});}_0x278bba=_['merge']({},_0x278bba,_0x2aa0f4[_0x8277('0x40')]);var _0x30d100={'where':_0x278bba['where']};return db[_0x8277('0x2c')][_0x8277('0x1e')](_0x30d100)[_0x8277('0x26')](function(_0x3dff25){_0x4f37c8[_0x8277('0x1e')]=_0x3dff25;if(_0x2aa0f4[_0x8277('0x33')]['includeAll']){_0x278bba[_0x8277('0x41')]=[{'all':!![]}];}return db[_0x8277('0x2c')]['findAll'](_0x278bba);})['then'](function(_0x41ff24){_0x4f37c8[_0x8277('0x42')]=_0x41ff24;return _0x4f37c8;})[_0x8277('0x26')](respondWithFilteredResult(_0x5482cc,_0x278bba))[_0x8277('0x43')](handleError(_0x5482cc,null));};exports['show']=function(_0x1215ef,_0x18534c){var _0x31d688={'raw':![],'where':{'id':_0x1215ef[_0x8277('0x44')]['id']}},_0x503aad={};_0x503aad[_0x8277('0x30')]=_[_0x8277('0x34')](db['VoiceRecording'][_0x8277('0x2d')]);_0x503aad['query']=_[_0x8277('0x34')](_0x1215ef[_0x8277('0x33')]);_0x503aad[_0x8277('0x35')]=_[_0x8277('0x36')](_0x503aad[_0x8277('0x30')],_0x503aad[_0x8277('0x33')]);_0x31d688['attributes']=_[_0x8277('0x36')](_0x503aad['model'],qs[_0x8277('0x38')](_0x1215ef['query'][_0x8277('0x38')]));_0x31d688[_0x8277('0x37')]=_0x31d688[_0x8277('0x37')][_0x8277('0x45')]?_0x31d688[_0x8277('0x37')]:_0x503aad[_0x8277('0x30')];if(_0x1215ef[_0x8277('0x33')][_0x8277('0x46')]){_0x31d688[_0x8277('0x41')]=[{'all':!![]}];}_0x31d688=_[_0x8277('0x3e')]({},_0x31d688,_0x1215ef[_0x8277('0x40')]);return db['VoiceRecording'][_0x8277('0x47')](_0x31d688)['then'](handleEntityNotFound(_0x18534c,null))[_0x8277('0x26')](respondWithResult(_0x18534c,null))[_0x8277('0x43')](handleError(_0x18534c,null));};exports[_0x8277('0x48')]=function(_0x3ccd93,_0x4666bc){return db[_0x8277('0x2c')]['create'](_0x3ccd93[_0x8277('0x49')],{})[_0x8277('0x26')](respondWithResult(_0x4666bc,0xc9))[_0x8277('0x43')](handleError(_0x4666bc,null));};exports[_0x8277('0x25')]=function(_0x56885f,_0x32c9d3){if(_0x56885f[_0x8277('0x49')]['id']){delete _0x56885f['body']['id'];}return db[_0x8277('0x2c')][_0x8277('0x47')]({'where':{'id':_0x56885f[_0x8277('0x44')]['id']}})['then'](handleEntityNotFound(_0x32c9d3,null))[_0x8277('0x26')](saveUpdates(_0x56885f['body'],null))[_0x8277('0x26')](respondWithResult(_0x32c9d3,null))[_0x8277('0x43')](handleError(_0x32c9d3,null));};exports[_0x8277('0x4a')]=function(_0xd09a45,_0x460dc1){return db[_0x8277('0x2c')][_0x8277('0x4a')]()[_0x8277('0x26')](respondWithResult(_0x460dc1,null))['catch'](handleError(_0x460dc1,null));};exports[_0x8277('0x4b')]=function(_0x5288cb,_0x3b4882,_0x4a8177){var _0xa7faa2=require(_0x8277('0x4c'));var _0x32f71c=![];var _0x56b4d8={};if(_0x5288cb[_0x8277('0x33')][_0x8277('0x4d')]&&_0x5288cb[_0x8277('0x33')][_0x8277('0x4d')]===_0x8277('0x4e')){_0x56b4d8['uniqueid']=_0x5288cb[_0x8277('0x44')]['id'];}else{_0x56b4d8['id']=_0x5288cb[_0x8277('0x44')]['id'];}return db[_0x8277('0x2c')][_0x8277('0x47')]({'where':_0x56b4d8,'attributes':['id',_0x8277('0x4f')],'raw':!![]})[_0x8277('0x26')](handleEntityNotFound(_0x3b4882,null))[_0x8277('0x26')](function(_0x4c52c3){if(_0x4c52c3){var _0x25a22f=_0x4c52c3['value'];var _0x513f58=util[_0x8277('0x32')]('%s.cypher',_0x25a22f);if(fs[_0x8277('0x50')](_0x513f58)){_0x32f71c=!![];return _0xa7faa2[_0x8277('0x51')](_0x513f58,_0x25a22f,config[_0x8277('0x52')]['recording'])['then'](function(){return _0x4c52c3;});}return _0x4c52c3;}})[_0x8277('0x26')](function(_0x36e143){if(_0x36e143){var _0x4ddf45=_0x36e143['value'];if(!fs['existsSync'](_0x4ddf45)){throw new db['Sequelize'][(_0x8277('0x53'))](_0x8277('0x54'));}if(_0x36e143[_0x8277('0x55')]){return _0x3b4882['download'](_0x4ddf45,_0x36e143[_0x8277('0x55')]+path[_0x8277('0x56')](_0x4ddf45),function(){if(_0x32f71c){fs[_0x8277('0x57')](_0x4ddf45);}});}else{return _0x3b4882['download'](_0x4ddf45,function(_0x45e726){if(_0x32f71c){fs['unlink'](_0x4ddf45);}});}}})[_0x8277('0x43')](function(_0x127ff0){if(_0x127ff0[_0x8277('0x58')]==='VoiceRecording\x20not\x20found'){_0x3b4882[_0x8277('0x20')](0x194)[_0x8277('0x29')](_0x8277('0x59'));}else{return handleError(_0x3b4882,null);}});};exports[_0x8277('0x5a')]=function(_0x236ea6,_0x37076f,_0x5532c8){var _0x5976a9=require(_0x8277('0x4c'));var _0x580e7e=![];var _0x50c57d={'$and':[db[_0x8277('0x5b')][_0x8277('0x3c')](db[_0x8277('0x5b')]['fn']('MD5',db[_0x8277('0x5b')][_0x8277('0x5c')](_0x8277('0x4e'))),_0x236ea6[_0x8277('0x33')][_0x8277('0x5d')])]};if(_0x236ea6[_0x8277('0x33')][_0x8277('0x4d')]&&_0x236ea6[_0x8277('0x33')]['type']===_0x8277('0x4e')){_0x50c57d[_0x8277('0x5e')][_0x8277('0x5f')]({'uniqueid':_0x236ea6[_0x8277('0x44')]['id']});}else{_0x50c57d[_0x8277('0x5e')][_0x8277('0x5f')]({'id':_0x236ea6[_0x8277('0x44')]['id']});}return db[_0x8277('0x2c')][_0x8277('0x47')]({'where':_0x50c57d,'attributes':['id',_0x8277('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x37076f,null))[_0x8277('0x26')](function(_0x44c632){if(_0x44c632){var _0x3ecc1d=util[_0x8277('0x32')](_0x8277('0x60'),_0x44c632[_0x8277('0x4f')]);if(fs['existsSync'](_0x3ecc1d)){_0x580e7e=!![];return _0x5976a9[_0x8277('0x51')](_0x3ecc1d,_0x44c632[_0x8277('0x4f')],config['secrets'][_0x8277('0x61')])[_0x8277('0x26')](function(){return _0x44c632;});}return _0x44c632;}})['then'](function(_0x30811a){if(_0x30811a){if(!fs[_0x8277('0x50')](_0x30811a[_0x8277('0x4f')])){throw new db['Sequelize'][(_0x8277('0x53'))](_0x8277('0x54'));}if(_0x30811a[_0x8277('0x55')]){return _0x37076f['download'](_0x30811a[_0x8277('0x4f')],_0x30811a[_0x8277('0x55')]+path[_0x8277('0x56')](_0x30811a[_0x8277('0x4f')]),function(){if(_0x580e7e){fs[_0x8277('0x57')](_0x30811a[_0x8277('0x4f')]);}});}else{return _0x37076f[_0x8277('0x4b')](_0x30811a[_0x8277('0x4f')],function(_0x5bdd2e){if(_0x580e7e){fs[_0x8277('0x57')](_0x30811a[_0x8277('0x4f')]);}});}}})[_0x8277('0x43')](handleError(_0x37076f,null));};exports[_0x8277('0x62')]=function(_0x5f5d90,_0x170938){return db[_0x8277('0x2c')][_0x8277('0x47')]({'where':{'id':_0x5f5d90['params']['id']}})[_0x8277('0x26')](function(_0x372c13){if(_[_0x8277('0x63')](_0x372c13)){throw new ReferenceError(_0x8277('0x64'));}return _0x372c13;})['then'](function(_0x17c9a6){var _0x6b6e59=_0x17c9a6[_0x8277('0x4f')];logger[_0x8277('0x65')](_0x8277('0x66'),_0x6b6e59);if(!_[_0x8277('0x63')](_0x17c9a6[_0x8277('0x4f')])&&fs[_0x8277('0x50')](_0x6b6e59)){logger[_0x8277('0x65')]('File:\x20\x22'+_0x6b6e59+_0x8277('0x67'));fs[_0x8277('0x68')](_0x6b6e59);}_0x6b6e59=_0x6b6e59+'.cypher';if(!_[_0x8277('0x63')](_0x17c9a6['value'])&&fs['existsSync'](_0x6b6e59)){logger['info'](_0x8277('0x69')+_0x6b6e59+_0x8277('0x67'));fs[_0x8277('0x68')](_0x6b6e59);}return _0x17c9a6;})[_0x8277('0x26')](function(_0x29ee73){if(!_0x29ee73)throw new InternalError();return _0x29ee73[_0x8277('0x62')]();})[_0x8277('0x26')](function(){_0x170938[_0x8277('0x20')](0xcc)[_0x8277('0x1a')]();})[_0x8277('0x43')](handleError(_0x170938,null));};function getBucketslist(_0x349455,_0x5ad543,_0xd2cdec){return new Promise(function(_0x54f865,_0x24149b){var _0x206796=new AWS['S3']({'accessKeyId':_0x5ad543,'secretAccessKey':_0x349455,'region':_0xd2cdec});_0x206796[_0x8277('0x6a')]({},function(_0x33139e,_0x5836b1){if(_0x33139e){return _0x24149b(_0x33139e);}else{return _0x54f865(_0x5836b1);}});});}function createBucket(_0x55e5b2,_0x5a6fa6,_0x42f227,_0x58b878){return new Promise(function(_0x294eab,_0x453ff4){var _0x31a6d0=new AWS['S3']({'accessKeyId':_0x5a6fa6,'secretAccessKey':_0x55e5b2,'region':_0x42f227});_0x31a6d0[_0x8277('0x6b')]({'Bucket':_0x58b878},function(_0x13f60d,_0x491a64){if(_0x13f60d){return _0x453ff4(_0x13f60d);}else{return _0x294eab(_0x491a64);}});});}function uploadFile(_0x513c0d,_0x2bbd71,_0x3663ed,_0x5a32d9,_0x3e6cbe,_0x2d8791){return new Promise(function(_0x536d9f,_0x3e1194){var _0x7f18ae=new AWS['S3']({'accessKeyId':_0x2bbd71,'secretAccessKey':_0x513c0d,'region':_0x3663ed});_0x7f18ae[_0x8277('0x6c')]({'Bucket':_0x5a32d9,'Key':_0x3e6cbe,'Body':_0x2d8791},function(_0x391675,_0x304944){if(_0x391675){return _0x3e1194(_0x391675);}else{return _0x536d9f(_0x304944);}});});}function startTranscribe(_0x27680e,_0x3a6d7a,_0x47796e,_0x412cbd,_0x28d8fe,_0x49d339){return new Promise(function(_0x43ab0d,_0xf28a85){var _0xf4dfac=new AWS[(_0x8277('0x6d'))]({'accessKeyId':_0x3a6d7a,'secretAccessKey':_0x27680e,'region':_0x47796e});_0xf4dfac['startTranscriptionJob']({'TranscriptionJobName':_0x412cbd,'LanguageCode':_0x28d8fe,'Media':{'MediaFileUri':_0x49d339}},function(_0x2a46b2,_0x4f8747){if(_0x2a46b2){return _0xf28a85(_0x2a46b2);}else{return _0x43ab0d(_0x4f8747);}});});}function transcribe(_0xabac28,_0x1179d9,_0x45fc1b,_0x2099c6,_0x1533ff,_0x17c6e3,_0x973312){return new Promise(function(_0x45e5b6,_0x27eead){var _0x4e40e9={};logger['info'](util[_0x8277('0x32')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xabac28,_0x1533ff));return uploadFile(_0x1179d9,_0x45fc1b,_0x2099c6,_0x1533ff,path[_0x8277('0x6e')](_0x17c6e3),fs[_0x8277('0x6f')](_0x17c6e3))[_0x8277('0x26')](function(_0x64511d){logger[_0x8277('0x65')](util['format'](_0x8277('0x70'),_0xabac28,_0x1533ff,_0x64511d[_0x8277('0x71')]));_0x4e40e9[_0x8277('0x72')]=_0x64511d[_0x8277('0x73')];_0x4e40e9[_0x8277('0x74')]=_0x64511d[_0x8277('0x71')];logger['info'](util[_0x8277('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xabac28));return startTranscribe(_0x1179d9,_0x45fc1b,_0x2099c6,uuidv4(),_0x973312,_0x64511d[_0x8277('0x71')]);})[_0x8277('0x26')](function(_0x285422){logger[_0x8277('0x65')](util[_0x8277('0x32')](_0x8277('0x75'),_0xabac28,_0x285422[_0x8277('0x76')][_0x8277('0x77')]));_0x4e40e9[_0x8277('0x78')]=_0x285422['TranscriptionJob'][_0x8277('0x77')];_0x4e40e9[_0x8277('0x79')]=_0x285422[_0x8277('0x76')][_0x8277('0x7a')];return _0x45e5b6(_0x4e40e9);})[_0x8277('0x43')](function(_0x5058ac){return _0x27eead(_0x5058ac);});});}exports[_0x8277('0x7b')]=function(_0x355545,_0x515124,_0x38660e){var _0x5a3a50;var _0x1ab434;var _0x47988e;var _0x278e2a=require('../../components/encryptor');return db[_0x8277('0x2c')][_0x8277('0x7c')]({'where':{'id':_0x355545[_0x8277('0x44')]['id']}})[_0x8277('0x26')](function(_0x543145){if(_0x543145){var _0x2acb62=util['format'](_0x8277('0x60'),_0x543145[_0x8277('0x4f')]);if(fs[_0x8277('0x50')](_0x2acb62)){cypher=!![];return _0x278e2a[_0x8277('0x51')](_0x2acb62,_0x543145[_0x8277('0x4f')],config[_0x8277('0x52')][_0x8277('0x61')])[_0x8277('0x26')](function(){return _0x543145;});}return _0x543145;}})[_0x8277('0x26')](function(_0x36059d){if(!_0x36059d){throw new db[(_0x8277('0x7d'))]['ValidationError'](_0x8277('0x7e'));}_0x1ab434=_0x36059d;return db['Setting'][_0x8277('0x7c')]({'where':{'id':0x1}});})[_0x8277('0x26')](handleEntityNotFound(_0x515124,null))[_0x8277('0x26')](function(_0x52fdb8){if(_0x52fdb8){_0x5a3a50=_0x52fdb8;if(!_0x5a3a50[_0x8277('0x7f')]||!_0x5a3a50[_0x8277('0x80')]||!_0x5a3a50[_0x8277('0x81')]||!_0x5a3a50[_0x8277('0x82')]||!_0x5a3a50['bucket']){throw new db[(_0x8277('0x7d'))][(_0x8277('0x53'))](_0x8277('0x83'));}if(_0x355545[_0x8277('0x49')][_0x8277('0x84')]&&(!_0x5a3a50[_0x8277('0x85')]||!_0x5a3a50['sentimentAccountId']||!_0x5a3a50['sentimentRegion']||!_0x5a3a50['language']||!_0x5a3a50[_0x8277('0x72')])){throw new db[(_0x8277('0x7d'))][(_0x8277('0x53'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x8277('0x86')][_0x8277('0x7c')]({'where':{'id':_0x5a3a50[_0x8277('0x80')]}});}})[_0x8277('0x26')](function(_0x1b7f8b){if(!_0x1b7f8b){throw new db[(_0x8277('0x7d'))]['ValidationError'](_0x8277('0x87'));}if(!_0x1b7f8b[_0x8277('0x88')]||!_0x1b7f8b[_0x8277('0x89')]){throw new db[(_0x8277('0x7d'))][(_0x8277('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x47988e=_0x1b7f8b;return getBucketslist(_0x47988e[_0x8277('0x88')],_0x47988e[_0x8277('0x89')],_0x5a3a50[_0x8277('0x81')]);})[_0x8277('0x26')](function(_0x19e9bb){if(_0x19e9bb&&_0x19e9bb[_0x8277('0x8a')]){var _0x195851=_[_0x8277('0x47')](_0x19e9bb[_0x8277('0x8a')],function(_0x576050){return _0x576050[_0x8277('0x8b')]===_0x5a3a50[_0x8277('0x72')];});if(!_0x195851){logger[_0x8277('0x65')](util[_0x8277('0x32')](_0x8277('0x8c'),_0x355545[_0x8277('0x44')]['id'],_0x5a3a50[_0x8277('0x72')]));return createBucket(_0x47988e[_0x8277('0x88')],_0x47988e['data2'],_0x5a3a50['transcribeRegion'],_0x5a3a50[_0x8277('0x72')]);}logger[_0x8277('0x65')](util[_0x8277('0x32')](_0x8277('0x8d'),_0x355545[_0x8277('0x44')]['id'],_0x5a3a50[_0x8277('0x72')]));return;}})[_0x8277('0x26')](function(_0x236cc8){if(_0x1ab434['transcribeStatus']===_0x8277('0x8e')){return transcribe(_0x355545['params']['id'],_0x47988e[_0x8277('0x88')],_0x47988e[_0x8277('0x89')],_0x5a3a50['transcribeRegion'],_0x5a3a50['bucket'],_0x1ab434[_0x8277('0x4f')],_0x5a3a50[_0x8277('0x82')]);}else{logger['info'](util[_0x8277('0x32')](_0x8277('0x8f'),_0x355545[_0x8277('0x44')]['id']));return{'transcribeStatus':_0x8277('0x90')};}})['then'](function(_0x5aa3f8){if(_0x5aa3f8){_0x5aa3f8['tempSentiment']=_0x355545[_0x8277('0x49')]['runSentiment'];return _0x1ab434['updateAttributes'](_0x5aa3f8);}})['then'](respondWithResult(_0x515124,null))[_0x8277('0x43')](handleError(_0x515124,null));};function writeFile(_0x351f10,_0x343583){return new Promise(function(_0x381e42,_0x550718){fs['writeFile'](_0x343583,_0x351f10,function(_0x1edf09,_0x54efa9){if(_0x1edf09){return _0x550718(_0x1edf09);}else{return _0x381e42(_0x54efa9);}});});}exports[_0x8277('0x91')]=function(_0x45e446,_0x1f7745,_0x250ad3){return db[_0x8277('0x2c')][_0x8277('0x7c')]({'where':{'id':_0x45e446[_0x8277('0x44')]['id']}})[_0x8277('0x26')](handleEntityNotFound(_0x1f7745))[_0x8277('0x26')](function(_0x2ff2d2){if(_0x2ff2d2&&_0x2ff2d2[_0x8277('0x92')]){var _0x3a9e28=_0x2ff2d2[_0x8277('0x92')];var _0x3bec8e=config[_0x8277('0x93')]+_0x8277('0x94')+_0x2ff2d2['id']+'.txt';if(fs[_0x8277('0x50')](_0x3bec8e)){return _0x3bec8e;}return writeFile(_0x3a9e28,_0x3bec8e)[_0x8277('0x26')](function(){return _0x3bec8e;});}else{throw new db[(_0x8277('0x7d'))][(_0x8277('0x53'))](_0x8277('0x95'));}})['then'](function(_0x597d13){return _0x1f7745[_0x8277('0x4b')](_0x597d13);})[_0x8277('0x43')](handleError(_0x1f7745));}; \ No newline at end of file +var _0x41d4=['bluebird','mustache','util','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','index','map','VoiceRecording','rawAttributes','type','key','format','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','unlink','VoiceRecording\x20not\x20found','send','../../components/encryptor','sequelize','MD5','col','token','$and','push','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','TranscriptionJobStatus','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentRegion','Sequelize','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x41d4,0x1a6));var _0x441d=function(_0x53fda3,_0x5cc847){_0x53fda3=_0x53fda3-0x0;var _0x3c0742=_0x41d4[_0x53fda3];return _0x3c0742;};'use strict';var emlformat=require(_0x441d('0x0'));var rimraf=require(_0x441d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x441d('0x2'));var rp=require(_0x441d('0x3'));var moment=require('moment');var BPromise=require(_0x441d('0x4'));var Mustache=require(_0x441d('0x5'));var util=require(_0x441d('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(_0x441d('0x7'));var _=require(_0x441d('0x8'));var squel=require(_0x441d('0x9'));var crypto=require('crypto');var jsforce=require(_0x441d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x441d('0xb'));var querystring=require(_0x441d('0xc'));var Papa=require(_0x441d('0xd'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x441d('0xe'));var as=require(_0x441d('0xf'));var hardwareService=require(_0x441d('0x10'));var logger=require(_0x441d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x441d('0x12'));var licenseUtil=require(_0x441d('0x13'));var db=require(_0x441d('0x14'))['db'];function respondWithStatusCode(_0x2cef7f,_0x1dcb3a){_0x1dcb3a=_0x1dcb3a||0xcc;return function(_0x5a9e2a){if(_0x5a9e2a){return _0x2cef7f[_0x441d('0x15')](_0x1dcb3a);}return _0x2cef7f[_0x441d('0x16')](_0x1dcb3a)[_0x441d('0x17')]();};}function respondWithResult(_0x1e853b,_0x557b76){_0x557b76=_0x557b76||0xc8;return function(_0x2be9c3){if(_0x2be9c3){return _0x1e853b[_0x441d('0x16')](_0x557b76)[_0x441d('0x18')](_0x2be9c3);}};}function respondWithFilteredResult(_0xc99ad5,_0x2d7711){return function(_0x1fcd96){if(_0x1fcd96){var _0x1a8a43=typeof _0x2d7711[_0x441d('0x19')]===_0x441d('0x1a')&&typeof _0x2d7711[_0x441d('0x1b')]===_0x441d('0x1a');var _0x1428f=_0x1fcd96[_0x441d('0x1c')];var _0x46bb38=_0x1a8a43?0x0:_0x2d7711[_0x441d('0x19')];var _0x2eea2c=_0x1a8a43?_0x1fcd96['count']:_0x2d7711[_0x441d('0x19')]+_0x2d7711['limit'];var _0x5852bf;if(_0x2eea2c>=_0x1428f){_0x2eea2c=_0x1428f;_0x5852bf=0xc8;}else{_0x5852bf=0xce;}_0xc99ad5[_0x441d('0x16')](_0x5852bf);return _0xc99ad5[_0x441d('0x1d')](_0x441d('0x1e'),_0x46bb38+'-'+_0x2eea2c+'/'+_0x1428f)[_0x441d('0x18')](_0x1fcd96);}return null;};}function patchUpdates(_0x2a2f49){return function(_0x1677f9){try{jsonpatch['apply'](_0x1677f9,_0x2a2f49,!![]);}catch(_0xaecfa2){return BPromise['reject'](_0xaecfa2);}return _0x1677f9[_0x441d('0x1f')]();};}function saveUpdates(_0x52cb58,_0x5c864d){return function(_0x24854a){if(_0x24854a){return _0x24854a[_0x441d('0x20')](_0x52cb58)[_0x441d('0x21')](function(_0x958e51){return _0x958e51;});}return null;};}function removeEntity(_0x422cf9,_0xd931e2){return function(_0x4203bc){if(_0x4203bc){return _0x4203bc[_0x441d('0x22')]()[_0x441d('0x21')](function(){_0x422cf9['status'](0xcc)[_0x441d('0x17')]();});}};}function handleEntityNotFound(_0x176737,_0x139b79){return function(_0x18bec3){if(!_0x18bec3){_0x176737[_0x441d('0x15')](0x194);}return _0x18bec3;};}function handleError(_0x2a3e2d,_0x43fde5){_0x43fde5=_0x43fde5||0x1f4;return function(_0xba060e){logger['error'](_0xba060e[_0x441d('0x23')]);if(_0xba060e[_0x441d('0x24')]){delete _0xba060e[_0x441d('0x24')];}_0x2a3e2d[_0x441d('0x16')](_0x43fde5)['send'](_0xba060e);};}exports[_0x441d('0x25')]=function(_0x2a86b2,_0x16dd7c){var _0x367d2f={},_0x54c805={},_0x418da8={'count':0x0,'rows':[]};var _0x23e041=_[_0x441d('0x26')](db[_0x441d('0x27')][_0x441d('0x28')],function(_0x304478){return{'name':_0x304478['fieldName'],'type':_0x304478[_0x441d('0x29')][_0x441d('0x2a')]};});_0x54c805['model']=_['differenceBy'](_[_0x441d('0x26')](_0x23e041,_0x441d('0x24')),[_0x441d('0x2b')]);_0x54c805[_0x441d('0x2c')]=_[_0x441d('0x2d')](_0x2a86b2[_0x441d('0x2c')]);_0x54c805[_0x441d('0x2e')]=_[_0x441d('0x2f')](_0x54c805[_0x441d('0x30')],_0x54c805[_0x441d('0x2c')]);_0x367d2f[_0x441d('0x31')]=_[_0x441d('0x2f')](_0x54c805['model'],qs[_0x441d('0x32')](_0x2a86b2[_0x441d('0x2c')][_0x441d('0x32')]));_0x367d2f[_0x441d('0x31')]=_0x367d2f[_0x441d('0x31')]['length']?_0x367d2f['attributes']:_0x54c805[_0x441d('0x30')];if(!_0x2a86b2['query']['hasOwnProperty'](_0x441d('0x33'))){_0x367d2f[_0x441d('0x1b')]=qs['limit'](_0x2a86b2[_0x441d('0x2c')][_0x441d('0x1b')]);_0x367d2f['offset']=qs[_0x441d('0x19')](_0x2a86b2[_0x441d('0x2c')][_0x441d('0x19')]);}_0x367d2f[_0x441d('0x34')]=qs[_0x441d('0x35')](_0x2a86b2['query']['sort']);_0x367d2f[_0x441d('0x36')]=qs[_0x441d('0x2e')](_['pick'](_0x2a86b2[_0x441d('0x2c')],_0x54c805['filters']),_0x23e041);if(_0x2a86b2['query'][_0x441d('0x37')]){_0x367d2f[_0x441d('0x36')]=_[_0x441d('0x38')](_0x367d2f[_0x441d('0x36')],{'$or':_[_0x441d('0x26')](_0x23e041,function(_0x23d30e){if(_0x23d30e[_0x441d('0x29')]!==_0x441d('0x39')){var _0x2c3c83={};_0x2c3c83[_0x23d30e[_0x441d('0x24')]]={'$like':'%'+_0x2a86b2[_0x441d('0x2c')]['filter']+'%'};return _0x2c3c83;}})});}_0x367d2f=_[_0x441d('0x38')]({},_0x367d2f,_0x2a86b2[_0x441d('0x3a')]);var _0x16128c={'where':_0x367d2f[_0x441d('0x36')]};return db[_0x441d('0x27')][_0x441d('0x1c')](_0x16128c)['then'](function(_0x1be9dd){_0x418da8[_0x441d('0x1c')]=_0x1be9dd;if(_0x2a86b2[_0x441d('0x2c')][_0x441d('0x3b')]){_0x367d2f[_0x441d('0x3c')]=[{'all':!![]}];}return db[_0x441d('0x27')]['findAll'](_0x367d2f);})['then'](function(_0x474f77){_0x418da8[_0x441d('0x3d')]=_0x474f77;return _0x418da8;})[_0x441d('0x21')](respondWithFilteredResult(_0x16dd7c,_0x367d2f))[_0x441d('0x3e')](handleError(_0x16dd7c,null));};exports[_0x441d('0x3f')]=function(_0x11e272,_0xa12c25){var _0x24f212={'raw':![],'where':{'id':_0x11e272[_0x441d('0x40')]['id']}},_0x321176={};_0x321176[_0x441d('0x30')]=_['keys'](db[_0x441d('0x27')]['rawAttributes']);_0x321176[_0x441d('0x2c')]=_[_0x441d('0x2d')](_0x11e272[_0x441d('0x2c')]);_0x321176[_0x441d('0x2e')]=_[_0x441d('0x2f')](_0x321176['model'],_0x321176[_0x441d('0x2c')]);_0x24f212[_0x441d('0x31')]=_['intersection'](_0x321176[_0x441d('0x30')],qs[_0x441d('0x32')](_0x11e272[_0x441d('0x2c')][_0x441d('0x32')]));_0x24f212[_0x441d('0x31')]=_0x24f212[_0x441d('0x31')]['length']?_0x24f212[_0x441d('0x31')]:_0x321176[_0x441d('0x30')];if(_0x11e272['query']['includeAll']){_0x24f212[_0x441d('0x3c')]=[{'all':!![]}];}_0x24f212=_[_0x441d('0x38')]({},_0x24f212,_0x11e272[_0x441d('0x3a')]);return db[_0x441d('0x27')][_0x441d('0x41')](_0x24f212)[_0x441d('0x21')](handleEntityNotFound(_0xa12c25,null))['then'](respondWithResult(_0xa12c25,null))[_0x441d('0x3e')](handleError(_0xa12c25,null));};exports[_0x441d('0x42')]=function(_0x182977,_0x139ed1){return db[_0x441d('0x27')][_0x441d('0x42')](_0x182977['body'],{})[_0x441d('0x21')](respondWithResult(_0x139ed1,0xc9))[_0x441d('0x3e')](handleError(_0x139ed1,null));};exports[_0x441d('0x20')]=function(_0x409ec6,_0x328bb9){if(_0x409ec6[_0x441d('0x43')]['id']){delete _0x409ec6[_0x441d('0x43')]['id'];}return db[_0x441d('0x27')][_0x441d('0x41')]({'where':{'id':_0x409ec6['params']['id']}})['then'](handleEntityNotFound(_0x328bb9,null))[_0x441d('0x21')](saveUpdates(_0x409ec6['body'],null))[_0x441d('0x21')](respondWithResult(_0x328bb9,null))[_0x441d('0x3e')](handleError(_0x328bb9,null));};exports[_0x441d('0x44')]=function(_0x4d08b8,_0x1d1156){return db[_0x441d('0x27')]['describe']()[_0x441d('0x21')](respondWithResult(_0x1d1156,null))[_0x441d('0x3e')](handleError(_0x1d1156,null));};exports[_0x441d('0x45')]=function(_0x43267b,_0x280ab3,_0x3322b0){var _0x97062c=require('../../components/encryptor');var _0x4e2c2c=![];var _0x59a22b={};if(_0x43267b[_0x441d('0x2c')]['type']&&_0x43267b[_0x441d('0x2c')]['type']===_0x441d('0x46')){_0x59a22b['uniqueid']=_0x43267b['params']['id'];}else{_0x59a22b['id']=_0x43267b['params']['id'];}return db[_0x441d('0x27')][_0x441d('0x41')]({'where':_0x59a22b,'attributes':['id',_0x441d('0x47')],'raw':!![]})[_0x441d('0x21')](handleEntityNotFound(_0x280ab3,null))[_0x441d('0x21')](function(_0x4082b1){if(_0x4082b1){var _0x21508a=_0x4082b1[_0x441d('0x47')];var _0x3970bd=util[_0x441d('0x2b')](_0x441d('0x48'),_0x21508a);if(fs[_0x441d('0x49')](_0x3970bd)){_0x4e2c2c=!![];return _0x97062c[_0x441d('0x4a')](_0x3970bd,_0x21508a,config[_0x441d('0x4b')][_0x441d('0x4c')])['then'](function(){return _0x4082b1;});}return _0x4082b1;}})[_0x441d('0x21')](function(_0x55ad58){if(_0x55ad58){var _0x3670f3=_0x55ad58[_0x441d('0x47')];if(!fs['existsSync'](_0x3670f3)){throw new db['Sequelize'][(_0x441d('0x4d'))]('VoiceRecording\x20not\x20found');}if(_0x55ad58['filename']){return _0x280ab3[_0x441d('0x45')](_0x3670f3,_0x55ad58[_0x441d('0x4e')]+path['extname'](_0x3670f3),function(){if(_0x4e2c2c){fs[_0x441d('0x4f')](_0x3670f3);}});}else{return _0x280ab3[_0x441d('0x45')](_0x3670f3,function(_0x5d4e6f){if(_0x4e2c2c){fs['unlink'](_0x3670f3);}});}}})[_0x441d('0x3e')](function(_0x150984){if(_0x150984['message']===_0x441d('0x50')){_0x280ab3[_0x441d('0x16')](0x194)[_0x441d('0x51')]('Not\x20found');}else{return handleError(_0x280ab3,null);}});};exports['downloads']=function(_0xbf9458,_0x223163,_0x128c02){var _0x75c21a=require(_0x441d('0x52'));var _0x3fc15e=![];var _0x480b50={'$and':[db[_0x441d('0x53')][_0x441d('0x36')](db['sequelize']['fn'](_0x441d('0x54'),db['sequelize'][_0x441d('0x55')](_0x441d('0x46'))),_0xbf9458[_0x441d('0x2c')][_0x441d('0x56')])]};if(_0xbf9458['query'][_0x441d('0x29')]&&_0xbf9458[_0x441d('0x2c')][_0x441d('0x29')]==='uniqueid'){_0x480b50[_0x441d('0x57')]['push']({'uniqueid':_0xbf9458[_0x441d('0x40')]['id']});}else{_0x480b50[_0x441d('0x57')][_0x441d('0x58')]({'id':_0xbf9458[_0x441d('0x40')]['id']});}return db[_0x441d('0x27')]['find']({'where':_0x480b50,'attributes':['id','value'],'raw':!![]})[_0x441d('0x21')](handleEntityNotFound(_0x223163,null))[_0x441d('0x21')](function(_0x2b181f){if(_0x2b181f){var _0x30fbad=util[_0x441d('0x2b')]('%s.cypher',_0x2b181f[_0x441d('0x47')]);if(fs[_0x441d('0x49')](_0x30fbad)){_0x3fc15e=!![];return _0x75c21a[_0x441d('0x4a')](_0x30fbad,_0x2b181f[_0x441d('0x47')],config[_0x441d('0x4b')]['recording'])[_0x441d('0x21')](function(){return _0x2b181f;});}return _0x2b181f;}})[_0x441d('0x21')](function(_0x47c83c){if(_0x47c83c){if(!fs['existsSync'](_0x47c83c['value'])){throw new db['Sequelize'][(_0x441d('0x4d'))](_0x441d('0x50'));}if(_0x47c83c[_0x441d('0x4e')]){return _0x223163[_0x441d('0x45')](_0x47c83c[_0x441d('0x47')],_0x47c83c[_0x441d('0x4e')]+path[_0x441d('0x59')](_0x47c83c[_0x441d('0x47')]),function(){if(_0x3fc15e){fs[_0x441d('0x4f')](_0x47c83c['value']);}});}else{return _0x223163[_0x441d('0x45')](_0x47c83c[_0x441d('0x47')],function(_0x42938e){if(_0x3fc15e){fs['unlink'](_0x47c83c[_0x441d('0x47')]);}});}}})[_0x441d('0x3e')](handleError(_0x223163,null));};exports[_0x441d('0x22')]=function(_0x25e3fe,_0x2d58b7){return db[_0x441d('0x27')][_0x441d('0x41')]({'where':{'id':_0x25e3fe[_0x441d('0x40')]['id']}})[_0x441d('0x21')](function(_0x257885){if(_[_0x441d('0x5a')](_0x257885)){throw new ReferenceError(_0x441d('0x5b'));}return _0x257885;})[_0x441d('0x21')](function(_0x2d09f8){var _0x1473c5=_0x2d09f8['value'];logger[_0x441d('0x5c')](_0x441d('0x5d'),_0x1473c5);if(!_[_0x441d('0x5a')](_0x2d09f8[_0x441d('0x47')])&&fs[_0x441d('0x49')](_0x1473c5)){logger[_0x441d('0x5c')](_0x441d('0x5e')+_0x1473c5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x1473c5);}_0x1473c5=_0x1473c5+_0x441d('0x5f');if(!_[_0x441d('0x5a')](_0x2d09f8[_0x441d('0x47')])&&fs['existsSync'](_0x1473c5)){logger[_0x441d('0x5c')](_0x441d('0x5e')+_0x1473c5+_0x441d('0x60'));fs[_0x441d('0x61')](_0x1473c5);}return _0x2d09f8;})['then'](function(_0x3ae2c7){if(!_0x3ae2c7)throw new InternalError();return _0x3ae2c7[_0x441d('0x22')]();})[_0x441d('0x21')](function(){_0x2d58b7[_0x441d('0x16')](0xcc)[_0x441d('0x17')]();})[_0x441d('0x3e')](handleError(_0x2d58b7,null));};function getBucketslist(_0x24aee5,_0x496335,_0x36a9c2){return new Promise(function(_0x347ad5,_0x5a29db){var _0x40b214=new AWS['S3']({'accessKeyId':_0x496335,'secretAccessKey':_0x24aee5,'region':_0x36a9c2});_0x40b214[_0x441d('0x62')]({},function(_0x52f954,_0x207433){if(_0x52f954){return _0x5a29db(_0x52f954);}else{return _0x347ad5(_0x207433);}});});}function createBucket(_0x3d018c,_0x43bb1d,_0x218de2,_0x3584a8){return new Promise(function(_0x3d1d5e,_0x5b3ac2){var _0x5633df=new AWS['S3']({'accessKeyId':_0x43bb1d,'secretAccessKey':_0x3d018c,'region':_0x218de2});_0x5633df['createBucket']({'Bucket':_0x3584a8},function(_0x4acec3,_0x3b7a31){if(_0x4acec3){return _0x5b3ac2(_0x4acec3);}else{return _0x3d1d5e(_0x3b7a31);}});});}function uploadFile(_0x4908f1,_0x47b26d,_0x2eaaf5,_0x3c6f5f,_0x14ea86,_0x49bd43){return new Promise(function(_0x30c3d5,_0x5989d3){var _0xae7e97=new AWS['S3']({'accessKeyId':_0x47b26d,'secretAccessKey':_0x4908f1,'region':_0x2eaaf5});_0xae7e97[_0x441d('0x63')]({'Bucket':_0x3c6f5f,'Key':_0x14ea86,'Body':_0x49bd43},function(_0x20c912,_0x5379e9){if(_0x20c912){return _0x5989d3(_0x20c912);}else{return _0x30c3d5(_0x5379e9);}});});}function startTranscribe(_0x33a551,_0x41f238,_0x12f8e1,_0x1ba117,_0x28efe1,_0x3f4eb3){return new Promise(function(_0x5c009b,_0x310e8c){var _0x3f6133=new AWS[(_0x441d('0x64'))]({'accessKeyId':_0x41f238,'secretAccessKey':_0x33a551,'region':_0x12f8e1});_0x3f6133[_0x441d('0x65')]({'TranscriptionJobName':_0x1ba117,'LanguageCode':_0x28efe1,'Media':{'MediaFileUri':_0x3f4eb3}},function(_0x9dbaea,_0x5a6fe0){if(_0x9dbaea){return _0x310e8c(_0x9dbaea);}else{return _0x5c009b(_0x5a6fe0);}});});}function transcribe(_0x18fd59,_0x28f09b,_0x336e5f,_0x399916,_0x4685a0,_0x48fb90,_0x9bb06f){return new Promise(function(_0x1e17cc,_0x2c3cc0){var _0x1772f9={};logger[_0x441d('0x5c')](util[_0x441d('0x2b')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x18fd59,_0x4685a0));return uploadFile(_0x28f09b,_0x336e5f,_0x399916,_0x4685a0,path['basename'](_0x48fb90),fs[_0x441d('0x66')](_0x48fb90))['then'](function(_0xab7162){logger['info'](util[_0x441d('0x2b')](_0x441d('0x67'),_0x18fd59,_0x4685a0,_0xab7162[_0x441d('0x68')]));_0x1772f9[_0x441d('0x69')]=_0xab7162[_0x441d('0x6a')];_0x1772f9[_0x441d('0x6b')]=_0xab7162[_0x441d('0x68')];logger[_0x441d('0x5c')](util['format'](_0x441d('0x6c'),_0x18fd59));return startTranscribe(_0x28f09b,_0x336e5f,_0x399916,uuidv4(),_0x9bb06f,_0xab7162[_0x441d('0x68')]);})[_0x441d('0x21')](function(_0x23df93){logger[_0x441d('0x5c')](util[_0x441d('0x2b')](_0x441d('0x6d'),_0x18fd59,_0x23df93['TranscriptionJob'][_0x441d('0x6e')]));_0x1772f9['transcribeName']=_0x23df93[_0x441d('0x6f')][_0x441d('0x6e')];_0x1772f9['transcribeStatus']=_0x23df93[_0x441d('0x6f')][_0x441d('0x70')];return _0x1e17cc(_0x1772f9);})[_0x441d('0x3e')](function(_0x43ac99){return _0x2c3cc0(_0x43ac99);});});}exports['runTranscribe']=function(_0x37df98,_0x5c7fe1,_0x2fb16c){var _0x482698;var _0x3b275d;var _0x22f6ed;var _0x22278e=require('../../components/encryptor');return db[_0x441d('0x27')]['findOne']({'where':{'id':_0x37df98['params']['id']}})['then'](function(_0x26dcc6){if(_0x26dcc6){var _0x21bb81=util[_0x441d('0x2b')](_0x441d('0x48'),_0x26dcc6['value']);if(fs['existsSync'](_0x21bb81)){cypher=!![];return _0x22278e['decryptFile'](_0x21bb81,_0x26dcc6[_0x441d('0x47')],config[_0x441d('0x4b')][_0x441d('0x4c')])[_0x441d('0x21')](function(){return _0x26dcc6;});}return _0x26dcc6;}})[_0x441d('0x21')](function(_0x5f03d3){if(!_0x5f03d3){throw new db['Sequelize'][(_0x441d('0x4d'))]('Voice\x20Recording\x20not\x20found');}_0x3b275d=_0x5f03d3;return db[_0x441d('0x71')][_0x441d('0x72')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x5c7fe1,null))[_0x441d('0x21')](function(_0x2f0e98){if(_0x2f0e98){_0x482698=_0x2f0e98;if(!_0x482698[_0x441d('0x73')]||!_0x482698[_0x441d('0x74')]||!_0x482698[_0x441d('0x75')]||!_0x482698[_0x441d('0x76')]||!_0x482698[_0x441d('0x69')]){throw new db['Sequelize'][(_0x441d('0x4d'))]('Transcribe\x20not\x20configured');}if(_0x37df98['body'][_0x441d('0x77')]&&(!_0x482698[_0x441d('0x78')]||!_0x482698['sentimentAccountId']||!_0x482698[_0x441d('0x79')]||!_0x482698[_0x441d('0x76')]||!_0x482698[_0x441d('0x69')])){throw new db[(_0x441d('0x7a'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x441d('0x7b')][_0x441d('0x72')]({'where':{'id':_0x482698[_0x441d('0x74')]}});}})[_0x441d('0x21')](function(_0x4254f6){if(!_0x4254f6){throw new db['Sequelize']['ValidationError'](_0x441d('0x7c'));}if(!_0x4254f6[_0x441d('0x7d')]||!_0x4254f6['data2']){throw new db[(_0x441d('0x7a'))][(_0x441d('0x4d'))](_0x441d('0x7e'));}_0x22f6ed=_0x4254f6;return getBucketslist(_0x22f6ed[_0x441d('0x7d')],_0x22f6ed[_0x441d('0x7f')],_0x482698['transcribeRegion']);})[_0x441d('0x21')](function(_0xc9605d){if(_0xc9605d&&_0xc9605d[_0x441d('0x80')]){var _0x4cc35c=_[_0x441d('0x41')](_0xc9605d['Buckets'],function(_0x509d73){return _0x509d73[_0x441d('0x81')]===_0x482698[_0x441d('0x69')];});if(!_0x4cc35c){logger[_0x441d('0x5c')](util[_0x441d('0x2b')](_0x441d('0x82'),_0x37df98[_0x441d('0x40')]['id'],_0x482698['bucket']));return createBucket(_0x22f6ed[_0x441d('0x7d')],_0x22f6ed[_0x441d('0x7f')],_0x482698[_0x441d('0x75')],_0x482698[_0x441d('0x69')]);}logger[_0x441d('0x5c')](util['format'](_0x441d('0x83'),_0x37df98[_0x441d('0x40')]['id'],_0x482698[_0x441d('0x69')]));return;}})['then'](function(_0x38b62b){if(_0x3b275d[_0x441d('0x84')]===_0x441d('0x85')){return transcribe(_0x37df98['params']['id'],_0x22f6ed['data1'],_0x22f6ed[_0x441d('0x7f')],_0x482698[_0x441d('0x75')],_0x482698[_0x441d('0x69')],_0x3b275d[_0x441d('0x47')],_0x482698['language']);}else{logger[_0x441d('0x5c')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x37df98[_0x441d('0x40')]['id']));return{'transcribeStatus':_0x441d('0x86')};}})[_0x441d('0x21')](function(_0x515a96){if(_0x515a96){_0x515a96[_0x441d('0x87')]=_0x37df98['body'][_0x441d('0x77')];return _0x3b275d[_0x441d('0x88')](_0x515a96);}})['then'](respondWithResult(_0x5c7fe1,null))[_0x441d('0x3e')](handleError(_0x5c7fe1,null));};function writeFile(_0x4ed7e9,_0xea74f2){return new Promise(function(_0xad7d20,_0xcdced6){fs[_0x441d('0x89')](_0xea74f2,_0x4ed7e9,function(_0x4212e2,_0x309d72){if(_0x4212e2){return _0xcdced6(_0x4212e2);}else{return _0xad7d20(_0x309d72);}});});}exports[_0x441d('0x8a')]=function(_0x9fee21,_0x557810,_0x21a5ad){return db[_0x441d('0x27')]['findOne']({'where':{'id':_0x9fee21[_0x441d('0x40')]['id']}})['then'](handleEntityNotFound(_0x557810))[_0x441d('0x21')](function(_0x48b36b){if(_0x48b36b&&_0x48b36b[_0x441d('0x8b')]){var _0x224748=_0x48b36b['fileText'];var _0x32f3c3=config[_0x441d('0x8c')]+'/server/files/transcribes/transcribe_'+_0x48b36b['id']+'.txt';if(fs[_0x441d('0x49')](_0x32f3c3)){return _0x32f3c3;}return writeFile(_0x224748,_0x32f3c3)[_0x441d('0x21')](function(){return _0x32f3c3;});}else{throw new db[(_0x441d('0x7a'))]['ValidationError'](_0x441d('0x8d'));}})[_0x441d('0x21')](function(_0x235b22){return _0x557810['download'](_0x235b22);})[_0x441d('0x3e')](handleError(_0x557810));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index fbab781..a3c57cd 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 _0x3351=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','define'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x3351,0x1b4));var _0x1335=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3351[_0xc6be3a];return _0x56a310;};'use strict';var attributes=require(_0x1335('0x0'));module['exports']=function(_0x5a075d,_0x2bf4df){return _0x5a075d[_0x1335('0x1')](_0x1335('0x2'),attributes,{'tableName':_0x1335('0x3'),'paranoid':![],'indexes':[{'name':_0x1335('0x4'),'fields':[_0x1335('0x4')]},{'name':_0x1335('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc17f=['define','VoiceRecording','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x18ac34,_0x2b1ba2){var _0x4d5444=function(_0x5631e8){while(--_0x5631e8){_0x18ac34['push'](_0x18ac34['shift']());}};_0x4d5444(++_0x2b1ba2);}(_0xc17f,0xb8));var _0xfc17=function(_0x4852f2,_0x3ce31e){_0x4852f2=_0x4852f2-0x0;var _0x10fcf9=_0xc17f[_0x4852f2];return _0x10fcf9;};'use strict';var attributes=require(_0xfc17('0x0'));module[_0xfc17('0x1')]=function(_0x45c778,_0x46c84a){return _0x45c778[_0xfc17('0x2')](_0xfc17('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xfc17('0x4'),'fields':[_0xfc17('0x4')]},{'name':_0xfc17('0x5'),'fields':[_0xfc17('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index e1c8199..bbcf44e 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 _0x0b0e=['secrets','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','update','options','where','attributes','UpdateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','create','body','existsSync','format','encryptFile','value'];(function(_0xa380e1,_0x42698c){var _0x341c25=function(_0x289cf8){while(--_0x289cf8){_0xa380e1['push'](_0xa380e1['shift']());}};_0x341c25(++_0x42698c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0x0b0e[_0x623e7];return _0x121131;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}exports['UpdateVoiceRecording']=function(_0x54a3eb){var _0x46bb44=this;return new Promise(function(_0x50a441,_0x4df8da){return db['VoiceRecording'][_0xe0b0('0x18')](_0x54a3eb['body'],{'raw':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a3eb[_0xe0b0('0x19')]?_0x54a3eb['options'][_0xe0b0('0x1a')]||null:null,'attributes':_0x54a3eb[_0xe0b0('0x19')]?_0x54a3eb[_0xe0b0('0x19')][_0xe0b0('0x1b')]||null:null,'limit':_0x54a3eb[_0xe0b0('0x19')]?_0x54a3eb['options']['limit']||null:null})[_0xe0b0('0xd')](function(_0x5512bb){logger[_0xe0b0('0xe')](_0xe0b0('0x1c'),_0x54a3eb);logger['debug'](_0xe0b0('0x1c'),_0x54a3eb,JSON['stringify'](_0x5512bb));_0x50a441(_0x5512bb);})[_0xe0b0('0x17')](function(_0x49a727){logger[_0xe0b0('0x13')]('UpdateVoiceRecording',_0x49a727[_0xe0b0('0x14')],_0x54a3eb);_0x4df8da(_0x46bb44['error'](0x1f4,_0x49a727[_0xe0b0('0x14')]));});});};exports['CreateVoiceRecording']=function(_0x3c221d){var _0x5c5317=this;return new Promise(function(_0x362aba,_0x3c3bc2){var _0x1f1ebd=require(_0xe0b0('0x1d'));var _0x3ec2;return db[_0xe0b0('0x1e')]['findOne']({'attributes':['id',_0xe0b0('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xe0b0('0xd')](function(_0x5b7a64){_0x3ec2=_0x5b7a64;return db[_0xe0b0('0x20')][_0xe0b0('0x21')](_0x3c221d[_0xe0b0('0x22')]);})[_0xe0b0('0xd')](function(_0x3cdbd5){if(_0x3ec2[_0xe0b0('0x1f')]&&fs[_0xe0b0('0x23')](_0x3cdbd5['value'])){var _0x1854b8=util[_0xe0b0('0x24')]('%s.cypher',_0x3cdbd5['value']);return _0x1f1ebd[_0xe0b0('0x25')](_0x3cdbd5[_0xe0b0('0x26')],_0x1854b8,config[_0xe0b0('0x27')][_0xe0b0('0x28')])[_0xe0b0('0xd')](function(){fs['unlink'](_0x3cdbd5[_0xe0b0('0x26')]);logger[_0xe0b0('0xe')](_0xe0b0('0x29'));return _0x3cdbd5;});}return _0x3cdbd5;})[_0xe0b0('0xd')](function(_0x27158f){logger['info'](_0xe0b0('0x2a'),_0x3c221d);logger[_0xe0b0('0x10')](_0xe0b0('0x2a'),_0x3c221d,JSON[_0xe0b0('0x12')](_0x27158f));_0x362aba(_0x27158f);})[_0xe0b0('0x17')](function(_0x12eeb8){logger[_0xe0b0('0x13')](_0xe0b0('0x2a'),_0x12eeb8[_0xe0b0('0x14')],_0x3c221d);_0x3c3bc2(_0x5c5317[_0xe0b0('0x13')](0x1f4,_0x12eeb8[_0xe0b0('0x14')]));});});}; \ No newline at end of file +var _0xd943=['info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0xd943,0x15d));var _0x3d94=function(_0x1eba81,_0x18cee3){_0x1eba81=_0x1eba81-0x0;var _0x2ff17f=_0xd943[_0x1eba81];return _0x2ff17f;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['update'](_0x2acee3[_0x3d94('0x16')],{'raw':_0x2acee3['options']?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x19')]||null:null,'attributes':_0x2acee3['options']?_0x2acee3['options'][_0x3d94('0x1a')]||null:null,'limit':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')]['limit']||null:null})[_0x3d94('0xa')](function(_0x2e8c91){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1b')](_0x3d94('0x14'),_0x2acee3,JSON[_0x3d94('0x1c')](_0x2e8c91));_0x4afc92(_0x2e8c91);})[_0x3d94('0x13')](function(_0xee7b8d){logger[_0x3d94('0xe')](_0x3d94('0x14'),_0xee7b8d[_0x3d94('0x11')],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0xee7b8d[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1d')]=function(_0x5b3b31){var _0x123183=this;return new Promise(function(_0x558fd2,_0x28a698){var _0x1d0a7a=require(_0x3d94('0x1e'));var _0x439173;return db[_0x3d94('0x1f')][_0x3d94('0x20')]({'attributes':['id',_0x3d94('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x584c4a){_0x439173=_0x584c4a;return db[_0x3d94('0x15')]['create'](_0x5b3b31['body']);})[_0x3d94('0xa')](function(_0x58c0d0){if(_0x439173[_0x3d94('0x21')]&&fs[_0x3d94('0x22')](_0x58c0d0[_0x3d94('0x23')])){var _0x4cef9c=util[_0x3d94('0x24')]('%s.cypher',_0x58c0d0[_0x3d94('0x23')]);return _0x1d0a7a['encryptFile'](_0x58c0d0[_0x3d94('0x23')],_0x4cef9c,config[_0x3d94('0x25')][_0x3d94('0x26')])[_0x3d94('0xa')](function(){fs['unlink'](_0x58c0d0[_0x3d94('0x23')]);logger['info'](_0x3d94('0x27'));return _0x58c0d0;});}return _0x58c0d0;})[_0x3d94('0xa')](function(_0x51d308){logger['info'](_0x3d94('0x1d'),_0x5b3b31);logger[_0x3d94('0x1b')](_0x3d94('0x1d'),_0x5b3b31,JSON['stringify'](_0x51d308));_0x558fd2(_0x51d308);})[_0x3d94('0x13')](function(_0x3d29fd){logger['error'](_0x3d94('0x1d'),_0x3d29fd[_0x3d94('0x11')],_0x5b3b31);_0x28a698(_0x123183[_0x3d94('0xe')](0x1f4,_0x3d29fd[_0x3d94('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b6516ad..7437a8b 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 _0xcae5=['../../components/interaction/service','./voiceTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','post','update','exports','util','express','fs-extra'];(function(_0x57f8b8,_0x2ac6d2){var _0x40a6d4=function(_0x5b3dcd){while(--_0x5b3dcd){_0x57f8b8['push'](_0x57f8b8['shift']());}};_0x40a6d4(++_0x2ac6d2);}(_0xcae5,0x1bd));var _0x5cae=function(_0x22edc8,_0x508ec4){_0x22edc8=_0x22edc8-0x0;var _0x47ac3e=_0xcae5[_0x22edc8];return _0x47ac3e;};'use strict';var multer=require('multer');var util=require(_0x5cae('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5cae('0x1'));var router=express['Router']();var fs_extra=require(_0x5cae('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5cae('0x3'));var config=require('../../config/environment');var controller=require(_0x5cae('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x5cae('0x5')]);router['get'](_0x5cae('0x6'),auth[_0x5cae('0x7')](),controller[_0x5cae('0x8')]);router[_0x5cae('0x9')](_0x5cae('0xa'),auth[_0x5cae('0x7')](),controller['show']);router[_0x5cae('0xb')]('/',auth[_0x5cae('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5cae('0xc')]);router['delete'](_0x5cae('0xa'),auth[_0x5cae('0x7')](),controller['destroy']);module[_0x5cae('0xd')]=router; \ No newline at end of file +var _0x1833=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0xb9de30,_0x19c1a1){var _0x2ca6a2=function(_0x272594){while(--_0x272594){_0xb9de30['push'](_0xb9de30['shift']());}};_0x2ca6a2(++_0x19c1a1);}(_0x1833,0xa2));var _0x3183=function(_0x55c7e4,_0x1746d7){_0x55c7e4=_0x55c7e4-0x0;var _0x48b877=_0x1833[_0x55c7e4];return _0x48b877;};'use strict';var multer=require(_0x3183('0x0'));var util=require(_0x3183('0x1'));var path=require(_0x3183('0x2'));var timeout=require(_0x3183('0x3'));var express=require(_0x3183('0x4'));var router=express['Router']();var fs_extra=require(_0x3183('0x5'));var auth=require(_0x3183('0x6'));var interaction=require(_0x3183('0x7'));var config=require(_0x3183('0x8'));var controller=require(_0x3183('0x9'));router[_0x3183('0xa')]('/',auth['isAuthenticated'](),controller[_0x3183('0xb')]);router[_0x3183('0xa')](_0x3183('0xc'),auth[_0x3183('0xd')](),controller['describe']);router['get'](_0x3183('0xe'),auth[_0x3183('0xd')](),controller[_0x3183('0xf')]);router[_0x3183('0x10')]('/',auth['isAuthenticated'](),controller[_0x3183('0x11')]);router[_0x3183('0x12')](_0x3183('0xe'),auth[_0x3183('0xd')](),controller[_0x3183('0x13')]);router[_0x3183('0x14')](_0x3183('0xe'),auth['isAuthenticated'](),controller[_0x3183('0x15')]);module[_0x3183('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ab3fe86..f4f9d7a 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 _0xcee9=['blind','attended','STRING','ENUM','Yes'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0xcee9,0x6e));var _0x9cee=function(_0x132d09,_0xeb22db){_0x132d09=_0x132d09-0x0;var _0x818e12=_0xcee9[_0x132d09];return _0x818e12;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM'](_0x9cee('0x0'),_0x9cee('0x1'))},'result':{'type':Sequelize[_0x9cee('0x2')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x9cee('0x2')]},'transferercalleridname':{'type':Sequelize[_0x9cee('0x2')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9cee('0x2')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x9cee('0x2')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x9cee('0x2')]},'transfererlinkedid':{'type':Sequelize[_0x9cee('0x2')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x9cee('0x2')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9cee('0x2')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9cee('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0x9cee('0x2')]},'transfereecontext':{'type':Sequelize[_0x9cee('0x2')]},'transfereeexten':{'type':Sequelize[_0x9cee('0x2')]},'transfereelinkedid':{'type':Sequelize[_0x9cee('0x2')]},'isexternal':{'type':Sequelize[_0x9cee('0x3')](_0x9cee('0x4'),'No')},'context':{'type':Sequelize[_0x9cee('0x2')]},'extension':{'type':Sequelize[_0x9cee('0x2')]}}; \ No newline at end of file +var _0x23f2=['ENUM','blind','STRING','sequelize','moment','exports'];(function(_0x52cf0b,_0x50fd6f){var _0x3b887a=function(_0x4986b6){while(--_0x4986b6){_0x52cf0b['push'](_0x52cf0b['shift']());}};_0x3b887a(++_0x50fd6f);}(_0x23f2,0x171));var _0x223f=function(_0xf697c3,_0x31c085){_0xf697c3=_0xf697c3-0x0;var _0x30bf03=_0x23f2[_0xf697c3];return _0x30bf03;};'use strict';var Sequelize=require(_0x223f('0x0'));var moment=require(_0x223f('0x1'));module[_0x223f('0x2')]={'type':{'type':Sequelize[_0x223f('0x3')](_0x223f('0x4'),'attended')},'result':{'type':Sequelize[_0x223f('0x5')]},'transfererchannel':{'type':Sequelize[_0x223f('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x223f('0x5')]},'transferercalleridname':{'type':Sequelize[_0x223f('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x223f('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x223f('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x223f('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x223f('0x5')]},'transfereechannel':{'type':Sequelize[_0x223f('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x223f('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x223f('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x223f('0x5')]},'transfereecontext':{'type':Sequelize[_0x223f('0x5')]},'transfereeexten':{'type':Sequelize[_0x223f('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x223f('0x5')]},'isexternal':{'type':Sequelize[_0x223f('0x3')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x223f('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e19924d..a0fb8ae 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 _0xd932=['update','body','params','destroy','describe','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','VoiceTransferReport','includeAll','include','findAll','rows','show','find','catch','create'];(function(_0x5ab3b4,_0x5ede5d){var _0x1a7c0c=function(_0x590648){while(--_0x590648){_0x5ab3b4['push'](_0x5ab3b4['shift']());}};_0x1a7c0c(++_0x5ede5d);}(_0xd932,0xa1));var _0x2d93=function(_0x34535a,_0x2a99c8){_0x34535a=_0x34535a-0x0;var _0x2fb9ca=_0xd932[_0x34535a];return _0x2fb9ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d93('0x0'));var rp=require(_0x2d93('0x1'));var moment=require(_0x2d93('0x2'));var BPromise=require(_0x2d93('0x3'));var Mustache=require(_0x2d93('0x4'));var util=require('util');var path=require(_0x2d93('0x5'));var sox=require('sox');var csv=require(_0x2d93('0x6'));var ejs=require(_0x2d93('0x7'));var fs=require('fs');var fs_extra=require(_0x2d93('0x8'));var _=require(_0x2d93('0x9'));var squel=require(_0x2d93('0xa'));var crypto=require('crypto');var jsforce=require(_0x2d93('0xb'));var deskjs=require(_0x2d93('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2d93('0xd'));var Papa=require(_0x2d93('0xe'));var Redis=require(_0x2d93('0xf'));var authService=require(_0x2d93('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d93('0x11'));var logger=require(_0x2d93('0x12'))(_0x2d93('0x13'));var utils=require(_0x2d93('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d93('0x15'));var db=require(_0x2d93('0x16'))['db'];function respondWithStatusCode(_0x511680,_0x33cbd3){_0x33cbd3=_0x33cbd3||0xcc;return function(_0x4b179a){if(_0x4b179a){return _0x511680['sendStatus'](_0x33cbd3);}return _0x511680[_0x2d93('0x17')](_0x33cbd3)[_0x2d93('0x18')]();};}function respondWithResult(_0xa23af2,_0x59e4cf){_0x59e4cf=_0x59e4cf||0xc8;return function(_0xb71d3c){if(_0xb71d3c){return _0xa23af2[_0x2d93('0x17')](_0x59e4cf)[_0x2d93('0x19')](_0xb71d3c);}};}function respondWithFilteredResult(_0x572bd6,_0x1211cc){return function(_0x3c18ca){if(_0x3c18ca){var _0x384df1=typeof _0x1211cc[_0x2d93('0x1a')]==='undefined'&&typeof _0x1211cc['limit']===_0x2d93('0x1b');var _0x4f50a1=_0x3c18ca[_0x2d93('0x1c')];var _0x31f320=_0x384df1?0x0:_0x1211cc[_0x2d93('0x1a')];var _0x570d03=_0x384df1?_0x3c18ca[_0x2d93('0x1c')]:_0x1211cc['offset']+_0x1211cc[_0x2d93('0x1d')];var _0x2645b0;if(_0x570d03>=_0x4f50a1){_0x570d03=_0x4f50a1;_0x2645b0=0xc8;}else{_0x2645b0=0xce;}_0x572bd6['status'](_0x2645b0);return _0x572bd6[_0x2d93('0x1e')](_0x2d93('0x1f'),_0x31f320+'-'+_0x570d03+'/'+_0x4f50a1)[_0x2d93('0x19')](_0x3c18ca);}return null;};}function patchUpdates(_0x39c738){return function(_0x2c1b74){try{jsonpatch[_0x2d93('0x20')](_0x2c1b74,_0x39c738,!![]);}catch(_0xefd642){return BPromise[_0x2d93('0x21')](_0xefd642);}return _0x2c1b74[_0x2d93('0x22')]();};}function saveUpdates(_0x14d80b,_0x180995){return function(_0x586ff4){if(_0x586ff4){return _0x586ff4['update'](_0x14d80b)[_0x2d93('0x23')](function(_0x43da6f){return _0x43da6f;});}return null;};}function removeEntity(_0x5382c7,_0x3ed127){return function(_0x253f00){if(_0x253f00){return _0x253f00['destroy']()['then'](function(){_0x5382c7[_0x2d93('0x17')](0xcc)[_0x2d93('0x18')]();});}};}function handleEntityNotFound(_0x1573db,_0x2985d3){return function(_0x542756){if(!_0x542756){_0x1573db[_0x2d93('0x24')](0x194);}return _0x542756;};}function handleError(_0x491534,_0x50fef1){_0x50fef1=_0x50fef1||0x1f4;return function(_0x2f57ad){logger[_0x2d93('0x25')](_0x2f57ad['stack']);if(_0x2f57ad[_0x2d93('0x26')]){delete _0x2f57ad[_0x2d93('0x26')];}_0x491534[_0x2d93('0x17')](_0x50fef1)[_0x2d93('0x27')](_0x2f57ad);};}exports[_0x2d93('0x28')]=function(_0x138606,_0x52f44b){var _0x23d721={},_0x3cdfb3={},_0x52e7a7={'count':0x0,'rows':[]};var _0x2d3a96=_['map'](db['VoiceTransferReport'][_0x2d93('0x29')],function(_0x2bf6f0){return{'name':_0x2bf6f0[_0x2d93('0x2a')],'type':_0x2bf6f0[_0x2d93('0x2b')][_0x2d93('0x2c')]};});_0x3cdfb3[_0x2d93('0x2d')]=_['map'](_0x2d3a96,_0x2d93('0x26'));_0x3cdfb3['query']=_[_0x2d93('0x2e')](_0x138606['query']);_0x3cdfb3[_0x2d93('0x2f')]=_['intersection'](_0x3cdfb3[_0x2d93('0x2d')],_0x3cdfb3[_0x2d93('0x30')]);_0x23d721['attributes']=_[_0x2d93('0x31')](_0x3cdfb3['model'],qs[_0x2d93('0x32')](_0x138606[_0x2d93('0x30')][_0x2d93('0x32')]));_0x23d721[_0x2d93('0x33')]=_0x23d721[_0x2d93('0x33')][_0x2d93('0x34')]?_0x23d721[_0x2d93('0x33')]:_0x3cdfb3[_0x2d93('0x2d')];if(!_0x138606[_0x2d93('0x30')][_0x2d93('0x35')](_0x2d93('0x36'))){_0x23d721[_0x2d93('0x1d')]=qs[_0x2d93('0x1d')](_0x138606[_0x2d93('0x30')][_0x2d93('0x1d')]);_0x23d721[_0x2d93('0x1a')]=qs[_0x2d93('0x1a')](_0x138606[_0x2d93('0x30')][_0x2d93('0x1a')]);}_0x23d721[_0x2d93('0x37')]=qs[_0x2d93('0x38')](_0x138606[_0x2d93('0x30')][_0x2d93('0x38')]);_0x23d721['where']=qs[_0x2d93('0x2f')](_[_0x2d93('0x39')](_0x138606['query'],_0x3cdfb3[_0x2d93('0x2f')]),_0x2d3a96);if(_0x138606[_0x2d93('0x30')][_0x2d93('0x3a')]){_0x23d721[_0x2d93('0x3b')]=_['merge'](_0x23d721['where'],{'$or':_[_0x2d93('0x3c')](_0x2d3a96,function(_0x32945e){if(_0x32945e['type']!==_0x2d93('0x3d')){var _0x103275={};_0x103275[_0x32945e['name']]={'$like':'%'+_0x138606[_0x2d93('0x30')][_0x2d93('0x3a')]+'%'};return _0x103275;}})});}_0x23d721=_[_0x2d93('0x3e')]({},_0x23d721,_0x138606[_0x2d93('0x3f')]);var _0x1a94ec={'where':_0x23d721['where']};return db[_0x2d93('0x40')]['count'](_0x1a94ec)[_0x2d93('0x23')](function(_0x181b61){_0x52e7a7[_0x2d93('0x1c')]=_0x181b61;if(_0x138606[_0x2d93('0x30')][_0x2d93('0x41')]){_0x23d721[_0x2d93('0x42')]=[{'all':!![]}];}return db[_0x2d93('0x40')][_0x2d93('0x43')](_0x23d721);})[_0x2d93('0x23')](function(_0x37ac7d){_0x52e7a7[_0x2d93('0x44')]=_0x37ac7d;return _0x52e7a7;})[_0x2d93('0x23')](respondWithFilteredResult(_0x52f44b,_0x23d721))['catch'](handleError(_0x52f44b,null));};exports[_0x2d93('0x45')]=function(_0x51c7c8,_0x54d5e1){var _0x5f45f9={'raw':!![],'where':{'id':_0x51c7c8['params']['id']}},_0x3014df={};_0x3014df[_0x2d93('0x2d')]=_[_0x2d93('0x2e')](db[_0x2d93('0x40')][_0x2d93('0x29')]);_0x3014df[_0x2d93('0x30')]=_[_0x2d93('0x2e')](_0x51c7c8['query']);_0x3014df[_0x2d93('0x2f')]=_[_0x2d93('0x31')](_0x3014df['model'],_0x3014df[_0x2d93('0x30')]);_0x5f45f9['attributes']=_[_0x2d93('0x31')](_0x3014df[_0x2d93('0x2d')],qs[_0x2d93('0x32')](_0x51c7c8['query'][_0x2d93('0x32')]));_0x5f45f9[_0x2d93('0x33')]=_0x5f45f9['attributes']['length']?_0x5f45f9[_0x2d93('0x33')]:_0x3014df[_0x2d93('0x2d')];if(_0x51c7c8[_0x2d93('0x30')][_0x2d93('0x41')]){_0x5f45f9['include']=[{'all':!![]}];}_0x5f45f9=_[_0x2d93('0x3e')]({},_0x5f45f9,_0x51c7c8[_0x2d93('0x3f')]);return db['VoiceTransferReport'][_0x2d93('0x46')](_0x5f45f9)[_0x2d93('0x23')](handleEntityNotFound(_0x54d5e1,null))[_0x2d93('0x23')](respondWithResult(_0x54d5e1,null))[_0x2d93('0x47')](handleError(_0x54d5e1,null));};exports['create']=function(_0x2f6287,_0x56d2f3){return db[_0x2d93('0x40')][_0x2d93('0x48')](_0x2f6287['body'],{})[_0x2d93('0x23')](respondWithResult(_0x56d2f3,0xc9))[_0x2d93('0x47')](handleError(_0x56d2f3,null));};exports[_0x2d93('0x49')]=function(_0x273a1e,_0x263205){if(_0x273a1e[_0x2d93('0x4a')]['id']){delete _0x273a1e['body']['id'];}return db[_0x2d93('0x40')]['find']({'where':{'id':_0x273a1e[_0x2d93('0x4b')]['id']}})[_0x2d93('0x23')](handleEntityNotFound(_0x263205,null))['then'](saveUpdates(_0x273a1e[_0x2d93('0x4a')],null))[_0x2d93('0x23')](respondWithResult(_0x263205,null))[_0x2d93('0x47')](handleError(_0x263205,null));};exports[_0x2d93('0x4c')]=function(_0x4de01e,_0x483e9b){return db['VoiceTransferReport'][_0x2d93('0x46')]({'where':{'id':_0x4de01e['params']['id']}})[_0x2d93('0x23')](handleEntityNotFound(_0x483e9b,null))[_0x2d93('0x23')](removeEntity(_0x483e9b,null))[_0x2d93('0x47')](handleError(_0x483e9b,null));};exports[_0x2d93('0x4d')]=function(_0x3cc579,_0x3fd5a2){return db[_0x2d93('0x40')][_0x2d93('0x4d')]()[_0x2d93('0x23')](respondWithResult(_0x3fd5a2,null))[_0x2d93('0x47')](handleError(_0x3fd5a2,null));}; \ No newline at end of file +var _0x55d1=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','VoiceTransferReport','fieldName','type','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','catch','show','params','rawAttributes','keys','fields','includeAll','options','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x485cd7,_0x3c438b){var _0x3b1f04=function(_0x4c3a16){while(--_0x4c3a16){_0x485cd7['push'](_0x485cd7['shift']());}};_0x3b1f04(++_0x3c438b);}(_0x55d1,0x15b));var _0x155d=function(_0x467e9a,_0x3f060b){_0x467e9a=_0x467e9a-0x0;var _0x54ab51=_0x55d1[_0x467e9a];return _0x54ab51;};'use strict';var emlformat=require(_0x155d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x155d('0x1'));var jsonpatch=require(_0x155d('0x2'));var rp=require(_0x155d('0x3'));var moment=require('moment');var BPromise=require(_0x155d('0x4'));var Mustache=require(_0x155d('0x5'));var util=require(_0x155d('0x6'));var path=require(_0x155d('0x7'));var sox=require(_0x155d('0x8'));var csv=require(_0x155d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x155d('0xa'));var _=require(_0x155d('0xb'));var squel=require(_0x155d('0xc'));var crypto=require('crypto');var jsforce=require(_0x155d('0xd'));var deskjs=require(_0x155d('0xe'));var toCsv=require(_0x155d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x155d('0xf'));var qs=require(_0x155d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x155d('0x11'));var logger=require(_0x155d('0x12'))(_0x155d('0x13'));var utils=require(_0x155d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x155d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c0771,_0xb12c7e){_0xb12c7e=_0xb12c7e||0xcc;return function(_0x1f31fa){if(_0x1f31fa){return _0x3c0771[_0x155d('0x16')](_0xb12c7e);}return _0x3c0771[_0x155d('0x17')](_0xb12c7e)[_0x155d('0x18')]();};}function respondWithResult(_0x5eb35e,_0x4c9611){_0x4c9611=_0x4c9611||0xc8;return function(_0x4d6354){if(_0x4d6354){return _0x5eb35e[_0x155d('0x17')](_0x4c9611)[_0x155d('0x19')](_0x4d6354);}};}function respondWithFilteredResult(_0x21adb8,_0x3bd443){return function(_0x1628f6){if(_0x1628f6){var _0x5a5b76=typeof _0x3bd443[_0x155d('0x1a')]===_0x155d('0x1b')&&typeof _0x3bd443[_0x155d('0x1c')]==='undefined';var _0x7d5724=_0x1628f6[_0x155d('0x1d')];var _0x42ce6d=_0x5a5b76?0x0:_0x3bd443[_0x155d('0x1a')];var _0x41a1d2=_0x5a5b76?_0x1628f6[_0x155d('0x1d')]:_0x3bd443[_0x155d('0x1a')]+_0x3bd443[_0x155d('0x1c')];var _0x5c049;if(_0x41a1d2>=_0x7d5724){_0x41a1d2=_0x7d5724;_0x5c049=0xc8;}else{_0x5c049=0xce;}_0x21adb8[_0x155d('0x17')](_0x5c049);return _0x21adb8[_0x155d('0x1e')](_0x155d('0x1f'),_0x42ce6d+'-'+_0x41a1d2+'/'+_0x7d5724)[_0x155d('0x19')](_0x1628f6);}return null;};}function patchUpdates(_0x528d28){return function(_0x2c9397){try{jsonpatch[_0x155d('0x20')](_0x2c9397,_0x528d28,!![]);}catch(_0x4f4f31){return BPromise['reject'](_0x4f4f31);}return _0x2c9397[_0x155d('0x21')]();};}function saveUpdates(_0x16f409,_0x3dbca9){return function(_0x192dde){if(_0x192dde){return _0x192dde['update'](_0x16f409)[_0x155d('0x22')](function(_0x3ae3ee){return _0x3ae3ee;});}return null;};}function removeEntity(_0x13590c,_0x19cedf){return function(_0x391e71){if(_0x391e71){return _0x391e71[_0x155d('0x23')]()[_0x155d('0x22')](function(){_0x13590c[_0x155d('0x17')](0xcc)[_0x155d('0x18')]();});}};}function handleEntityNotFound(_0x224bb7,_0x53c4ef){return function(_0x47615e){if(!_0x47615e){_0x224bb7[_0x155d('0x16')](0x194);}return _0x47615e;};}function handleError(_0x4a7e66,_0x8d33ff){_0x8d33ff=_0x8d33ff||0x1f4;return function(_0x14a6e8){logger[_0x155d('0x24')](_0x14a6e8[_0x155d('0x25')]);if(_0x14a6e8[_0x155d('0x26')]){delete _0x14a6e8['name'];}_0x4a7e66[_0x155d('0x17')](_0x8d33ff)['send'](_0x14a6e8);};}exports[_0x155d('0x27')]=function(_0x3c6bff,_0x2aadf9){var _0x1ec6de={},_0x4539a5={},_0xd9e65e={'count':0x0,'rows':[]};var _0x1f3e56=_['map'](db[_0x155d('0x28')]['rawAttributes'],function(_0x4b86fa){return{'name':_0x4b86fa[_0x155d('0x29')],'type':_0x4b86fa[_0x155d('0x2a')]['key']};});_0x4539a5[_0x155d('0x2b')]=_[_0x155d('0x2c')](_0x1f3e56,'name');_0x4539a5[_0x155d('0x2d')]=_['keys'](_0x3c6bff[_0x155d('0x2d')]);_0x4539a5['filters']=_[_0x155d('0x2e')](_0x4539a5['model'],_0x4539a5[_0x155d('0x2d')]);_0x1ec6de[_0x155d('0x2f')]=_[_0x155d('0x2e')](_0x4539a5[_0x155d('0x2b')],qs['fields'](_0x3c6bff[_0x155d('0x2d')]['fields']));_0x1ec6de[_0x155d('0x2f')]=_0x1ec6de[_0x155d('0x2f')][_0x155d('0x30')]?_0x1ec6de['attributes']:_0x4539a5[_0x155d('0x2b')];if(!_0x3c6bff['query'][_0x155d('0x31')](_0x155d('0x32'))){_0x1ec6de[_0x155d('0x1c')]=qs[_0x155d('0x1c')](_0x3c6bff[_0x155d('0x2d')]['limit']);_0x1ec6de[_0x155d('0x1a')]=qs[_0x155d('0x1a')](_0x3c6bff['query']['offset']);}_0x1ec6de[_0x155d('0x33')]=qs[_0x155d('0x34')](_0x3c6bff[_0x155d('0x2d')]['sort']);_0x1ec6de[_0x155d('0x35')]=qs[_0x155d('0x36')](_['pick'](_0x3c6bff[_0x155d('0x2d')],_0x4539a5['filters']),_0x1f3e56);if(_0x3c6bff[_0x155d('0x2d')][_0x155d('0x37')]){_0x1ec6de[_0x155d('0x35')]=_[_0x155d('0x38')](_0x1ec6de[_0x155d('0x35')],{'$or':_[_0x155d('0x2c')](_0x1f3e56,function(_0x3f97c9){if(_0x3f97c9[_0x155d('0x2a')]!==_0x155d('0x39')){var _0x4ec7ae={};_0x4ec7ae[_0x3f97c9[_0x155d('0x26')]]={'$like':'%'+_0x3c6bff[_0x155d('0x2d')]['filter']+'%'};return _0x4ec7ae;}})});}_0x1ec6de=_[_0x155d('0x38')]({},_0x1ec6de,_0x3c6bff['options']);var _0x38d3b1={'where':_0x1ec6de['where']};return db[_0x155d('0x28')][_0x155d('0x1d')](_0x38d3b1)[_0x155d('0x22')](function(_0x316f89){_0xd9e65e[_0x155d('0x1d')]=_0x316f89;if(_0x3c6bff[_0x155d('0x2d')]['includeAll']){_0x1ec6de[_0x155d('0x3a')]=[{'all':!![]}];}return db[_0x155d('0x28')][_0x155d('0x3b')](_0x1ec6de);})['then'](function(_0x46ded0){_0xd9e65e['rows']=_0x46ded0;return _0xd9e65e;})[_0x155d('0x22')](respondWithFilteredResult(_0x2aadf9,_0x1ec6de))[_0x155d('0x3c')](handleError(_0x2aadf9,null));};exports[_0x155d('0x3d')]=function(_0x40481b,_0x5deccf){var _0x202fad={'raw':!![],'where':{'id':_0x40481b[_0x155d('0x3e')]['id']}},_0x332fe1={};_0x332fe1['model']=_['keys'](db[_0x155d('0x28')][_0x155d('0x3f')]);_0x332fe1[_0x155d('0x2d')]=_[_0x155d('0x40')](_0x40481b[_0x155d('0x2d')]);_0x332fe1[_0x155d('0x36')]=_[_0x155d('0x2e')](_0x332fe1[_0x155d('0x2b')],_0x332fe1[_0x155d('0x2d')]);_0x202fad['attributes']=_[_0x155d('0x2e')](_0x332fe1[_0x155d('0x2b')],qs[_0x155d('0x41')](_0x40481b[_0x155d('0x2d')]['fields']));_0x202fad['attributes']=_0x202fad[_0x155d('0x2f')][_0x155d('0x30')]?_0x202fad[_0x155d('0x2f')]:_0x332fe1[_0x155d('0x2b')];if(_0x40481b[_0x155d('0x2d')][_0x155d('0x42')]){_0x202fad[_0x155d('0x3a')]=[{'all':!![]}];}_0x202fad=_['merge']({},_0x202fad,_0x40481b[_0x155d('0x43')]);return db[_0x155d('0x28')][_0x155d('0x44')](_0x202fad)[_0x155d('0x22')](handleEntityNotFound(_0x5deccf,null))[_0x155d('0x22')](respondWithResult(_0x5deccf,null))['catch'](handleError(_0x5deccf,null));};exports[_0x155d('0x45')]=function(_0x4f246a,_0x43325e){return db[_0x155d('0x28')][_0x155d('0x45')](_0x4f246a['body'],{})[_0x155d('0x22')](respondWithResult(_0x43325e,0xc9))[_0x155d('0x3c')](handleError(_0x43325e,null));};exports[_0x155d('0x46')]=function(_0x5b85d9,_0x2bc1e9){if(_0x5b85d9[_0x155d('0x47')]['id']){delete _0x5b85d9[_0x155d('0x47')]['id'];}return db[_0x155d('0x28')]['find']({'where':{'id':_0x5b85d9['params']['id']}})[_0x155d('0x22')](handleEntityNotFound(_0x2bc1e9,null))[_0x155d('0x22')](saveUpdates(_0x5b85d9['body'],null))[_0x155d('0x22')](respondWithResult(_0x2bc1e9,null))[_0x155d('0x3c')](handleError(_0x2bc1e9,null));};exports[_0x155d('0x23')]=function(_0x3f6488,_0x27f973){return db[_0x155d('0x28')]['find']({'where':{'id':_0x3f6488[_0x155d('0x3e')]['id']}})[_0x155d('0x22')](handleEntityNotFound(_0x27f973,null))[_0x155d('0x22')](removeEntity(_0x27f973,null))[_0x155d('0x3c')](handleError(_0x27f973,null));};exports[_0x155d('0x48')]=function(_0x1d2a21,_0x3e77de){return db[_0x155d('0x28')][_0x155d('0x48')]()[_0x155d('0x22')](respondWithResult(_0x3e77de,null))['catch'](handleError(_0x3e77de,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 26a8fe1..7c2cb9f 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 _0x3705=['exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x5691ec,_0x319320){var _0x8a7d6d=function(_0x5c8419){while(--_0x5c8419){_0x5691ec['push'](_0x5691ec['shift']());}};_0x8a7d6d(++_0x319320);}(_0x3705,0x1a7));var _0x5370=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3705[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x5370('0x0'));var util=require(_0x5370('0x1'));var logger=require(_0x5370('0x2'))(_0x5370('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5370('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5370('0x5'));var config=require(_0x5370('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x5370('0x7')]=function(_0x311a68,_0x358d92){return _0x311a68['define'](_0x5370('0x8'),attributes,{'tableName':_0x5370('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe857=['report_call_transfer','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0xcb7169,_0x1412c3){var _0x458921=function(_0x42ba82){while(--_0x42ba82){_0xcb7169['push'](_0xcb7169['shift']());}};_0x458921(++_0x1412c3);}(_0xe857,0x199));var _0x7e85=function(_0x54e64c,_0x246c37){_0x54e64c=_0x54e64c-0x0;var _0x512e24=_0xe857[_0x54e64c];return _0x512e24;};'use strict';var _=require('lodash');var util=require(_0x7e85('0x0'));var logger=require(_0x7e85('0x1'))('api');var moment=require(_0x7e85('0x2'));var BPromise=require(_0x7e85('0x3'));var rp=require(_0x7e85('0x4'));var fs=require('fs');var path=require(_0x7e85('0x5'));var rimraf=require(_0x7e85('0x6'));var config=require('../../config/environment');var attributes=require(_0x7e85('0x7'));module[_0x7e85('0x8')]=function(_0x10b30c,_0x5a06a5){return _0x10b30c[_0x7e85('0x9')](_0x7e85('0xa'),attributes,{'tableName':_0x7e85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 9713bd3..adb4a4b 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 _0x3c5c=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','catch'];(function(_0x1f4d52,_0x59dc1c){var _0x1c6209=function(_0x5d9bad){while(--_0x5d9bad){_0x1f4d52['push'](_0x1f4d52['shift']());}};_0x1c6209(++_0x59dc1c);}(_0x3c5c,0x96));var _0xc3c5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3c5c[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xc3c5('0x0'));var moment=require('moment');var BPromise=require(_0xc3c5('0x1'));var rs=require(_0xc3c5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3c5('0x3'))['db'];var utils=require(_0xc3c5('0x4'));var logger=require(_0xc3c5('0x5'))('rpc');var config=require(_0xc3c5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc3c5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbeb50b,_0x13dd21,_0x2114ab){return new BPromise(function(_0x51a09a,_0x26e864){return client['request'](_0xbeb50b,_0x2114ab)[_0xc3c5('0x8')](function(_0x3aca95){logger['info'](_0xc3c5('0x9'),_0x13dd21,_0xc3c5('0xa'));logger[_0xc3c5('0xb')](_0xc3c5('0xc'),_0x13dd21,'request\x20sent',JSON[_0xc3c5('0xd')](_0x3aca95));if(_0x3aca95[_0xc3c5('0xe')]){if(_0x3aca95['error']['code']===0x1f4){logger[_0xc3c5('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x13dd21,_0x3aca95[_0xc3c5('0xe')][_0xc3c5('0xf')]);return _0x26e864(_0x3aca95[_0xc3c5('0xe')][_0xc3c5('0xf')]);}logger[_0xc3c5('0xe')](_0xc3c5('0x9'),_0x13dd21,_0x3aca95[_0xc3c5('0xe')][_0xc3c5('0xf')]);return _0x51a09a(_0x3aca95[_0xc3c5('0xe')]['message']);}else{logger['info'](_0xc3c5('0x9'),_0x13dd21,'request\x20sent');_0x51a09a(_0x3aca95[_0xc3c5('0x10')][_0xc3c5('0xf')]);}})['catch'](function(_0x46d971){logger['error'](_0xc3c5('0x9'),_0x13dd21,_0x46d971);_0x26e864(_0x46d971);});});}exports[_0xc3c5('0x11')]=function(_0x386fb6){var _0x5c4cf7=this;return new Promise(function(_0x398c73,_0x5c54d3){return db[_0xc3c5('0x12')][_0xc3c5('0x13')](_0x386fb6[_0xc3c5('0x14')],{'raw':_0x386fb6[_0xc3c5('0x15')]?_0x386fb6[_0xc3c5('0x15')][_0xc3c5('0x16')]===undefined?!![]:![]:!![]})[_0xc3c5('0x8')](function(_0x4ec955){logger[_0xc3c5('0x17')](_0xc3c5('0x11'),_0x386fb6);logger[_0xc3c5('0xb')](_0xc3c5('0x11'),_0x386fb6,JSON['stringify'](_0x4ec955));_0x398c73(_0x4ec955);})[_0xc3c5('0x18')](function(_0xa5d541){logger[_0xc3c5('0xe')](_0xc3c5('0x11'),_0xa5d541[_0xc3c5('0xf')],_0x386fb6);_0x5c54d3(_0x5c4cf7[_0xc3c5('0xe')](0x1f4,_0xa5d541[_0xc3c5('0xf')]));});});}; \ No newline at end of file +var _0x3fec=['raw','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options'];(function(_0x1a17d9,_0x4db427){var _0x481201=function(_0x3deae9){while(--_0x3deae9){_0x1a17d9['push'](_0x1a17d9['shift']());}};_0x481201(++_0x4db427);}(_0x3fec,0x79));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require(_0xc3fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3fe('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3fe('0x3'));var logger=require(_0xc3fe('0x4'))(_0xc3fe('0x5'));var config=require(_0xc3fe('0x6'));var jayson=require(_0xc3fe('0x7'));var client=jayson['client'][_0xc3fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5725f3,_0x509825,_0x4a1ef2){return new BPromise(function(_0x5b8a29,_0x333fa3){return client['request'](_0x5725f3,_0x4a1ef2)['then'](function(_0x317356){logger[_0xc3fe('0x9')](_0xc3fe('0xa'),_0x509825,'request\x20sent');logger[_0xc3fe('0xb')](_0xc3fe('0xc'),_0x509825,_0xc3fe('0xd'),JSON['stringify'](_0x317356));if(_0x317356[_0xc3fe('0xe')]){if(_0x317356[_0xc3fe('0xe')][_0xc3fe('0xf')]===0x1f4){logger['error'](_0xc3fe('0xa'),_0x509825,_0x317356[_0xc3fe('0xe')]['message']);return _0x333fa3(_0x317356[_0xc3fe('0xe')][_0xc3fe('0x10')]);}logger[_0xc3fe('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x509825,_0x317356[_0xc3fe('0xe')][_0xc3fe('0x10')]);return _0x5b8a29(_0x317356[_0xc3fe('0xe')][_0xc3fe('0x10')]);}else{logger[_0xc3fe('0x9')](_0xc3fe('0xa'),_0x509825,_0xc3fe('0xd'));_0x5b8a29(_0x317356[_0xc3fe('0x11')]['message']);}})[_0xc3fe('0x12')](function(_0x2401af){logger[_0xc3fe('0xe')](_0xc3fe('0xa'),_0x509825,_0x2401af);_0x333fa3(_0x2401af);});});}exports[_0xc3fe('0x13')]=function(_0xe5cb83){var _0x1bba78=this;return new Promise(function(_0x27428f,_0x465b10){return db[_0xc3fe('0x14')]['create'](_0xe5cb83[_0xc3fe('0x15')],{'raw':_0xe5cb83[_0xc3fe('0x16')]?_0xe5cb83['options'][_0xc3fe('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x50c77c){logger[_0xc3fe('0x9')](_0xc3fe('0x13'),_0xe5cb83);logger[_0xc3fe('0xb')]('CreateVoiceTransferReport',_0xe5cb83,JSON['stringify'](_0x50c77c));_0x27428f(_0x50c77c);})[_0xc3fe('0x12')](function(_0x15d1b1){logger[_0xc3fe('0xe')](_0xc3fe('0x13'),_0x15d1b1[_0xc3fe('0x10')],_0xe5cb83);_0x465b10(_0x1bba78[_0xc3fe('0xe')](0x1f4,_0x15d1b1['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index aa5d4bb..47c44ec 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 _0xb821=['/unhold','unhold','/calls','calls','/transfer','Router','../../components/auth/service','/originate','originate','post','/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','answer','/hold','hold'];(function(_0x94d082,_0x394007){var _0xc23f81=function(_0x2ff6b0){while(--_0x2ff6b0){_0x94d082['push'](_0x94d082['shift']());}};_0xc23f81(++_0x394007);}(_0xb821,0xa7));var _0x1b82=function(_0xae4569,_0x304a05){_0xae4569=_0xae4569-0x0;var _0x410dc9=_0xb821[_0xae4569];return _0x410dc9;};'use strict';var express=require('express');var router=express[_0x1b82('0x0')]();var auth=require(_0x1b82('0x1'));var controller=require('./webbar.controller');router['post'](_0x1b82('0x2'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x1b82('0x3')]);router[_0x1b82('0x4')](_0x1b82('0x5'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x4')](_0x1b82('0x8'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x4')](_0x1b82('0xb'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0xc')]);router[_0x1b82('0x4')](_0x1b82('0xd'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0x4')](_0x1b82('0xf'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);router[_0x1b82('0x4')](_0x1b82('0x11'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller['transfer']);module['exports']=router; \ No newline at end of file +var _0xf4eb=['/hangup','isAuthenticated','isWebrtcLicence','hangup','/hold','hold','/unhold','unhold','/calls','calls','transfer','exports','express','/originate','originate','post'];(function(_0x25b310,_0x5ce2ee){var _0x525d37=function(_0x30930a){while(--_0x30930a){_0x25b310['push'](_0x25b310['shift']());}};_0x525d37(++_0x5ce2ee);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4f9e2b,_0x216629){_0x4f9e2b=_0x4f9e2b-0x0;var _0x494d90=_0xf4eb[_0x4f9e2b];return _0x494d90;};'use strict';var express=require(_0xbf4e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post'](_0xbf4e('0x1'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0x2')]);router[_0xbf4e('0x3')](_0xbf4e('0x4'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x3')]('/answer',auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xbf4e('0x3')](_0xbf4e('0x8'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x3')](_0xbf4e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xb')]);router['post'](_0xbf4e('0xc'),auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xd')]);router['post']('/transfer',auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xe')]);module[_0xbf4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0db5a71..be5ea76 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 _0x04b8=['sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','hangup\x20fired:','sessionId','format','user:%s','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','NotFound','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','UserId','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x04b8,0x159));var _0x804b=function(_0x2afb28,_0x19e8b0){_0x2afb28=_0x2afb28-0x0;var _0x41d764=_0x04b8[_0x2afb28];return _0x41d764;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x804b('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x804b('0x1'));var util=require(_0x804b('0x2'));var BPromise=require('bluebird');var jayson=require(_0x804b('0x3'));var amiClient=jayson[_0x804b('0x4')]['http']({'port':0x232a});var logger=require(_0x804b('0x5'))(_0x804b('0x6'));var Redis=require(_0x804b('0x7'));config['redis']=_[_0x804b('0x8')](config[_0x804b('0x9')],{'host':_0x804b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x804b('0x9')]));var Schema=require(_0x804b('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x804b('0xc')]},'callNumber':{'type':_0x804b('0xd'),'required':[!![],_0x804b('0xe')]},'callerId':{'type':_0x804b('0xd')},'callbackUrl':{'type':_0x804b('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x804b('0xc')]},'sessionId':{'type':_0x804b('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]},'sessionId':{'type':_0x804b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x804b('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x804b('0xd'),'required':[!![],_0x804b('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]},'sessionId':{'type':_0x804b('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]}});function emit(_0x5e1cfe,_0x3c5986,_0x511d22){logger[_0x804b('0x11')](_0x5e1cfe,_0x3c5986,JSON[_0x804b('0x12')](_0x511d22));io['to'](_0x5e1cfe)[_0x804b('0x13')](_0x3c5986,_0x511d22);}function handleError(_0x1760f8){return function(_0x3a05c0){console['log'](_0x804b('0x14'),_0x3a05c0,_0x3a05c0 instanceof RangeError);logger['error'](_0x3a05c0[_0x804b('0x15')]);if(_0x3a05c0 instanceof RangeError){if(_0x3a05c0[_0x804b('0x16')]){delete _0x3a05c0[_0x804b('0x16')];}_0x1760f8[_0x804b('0x17')](0x194)['send'](_0x3a05c0);}else{if(_0x3a05c0[_0x804b('0x16')]){delete _0x3a05c0[_0x804b('0x16')];}_0x1760f8[_0x804b('0x17')](0x1f4)[_0x804b('0x18')](_0x3a05c0);}};}function checkError(){return function(_0x27844b){if(!_0x27844b){throw new RangeError(_0x804b('0x19'));}return _0x27844b;};}function respondWithRpcPromise(_0x3241a0,_0x162204){return new BPromise(function(_0xaa9521,_0x2b7271){var _0x1acc48=amiClient;return _0x1acc48['request'](_0x3241a0,_0x162204)[_0x804b('0x1a')](function(_0x5a77e0){if(_0x5a77e0['error']){if(_0x5a77e0[_0x804b('0x1b')][_0x804b('0x1c')]===0x1f4){return _0x2b7271(_0x5a77e0[_0x804b('0x1b')][_0x804b('0x1d')]);}return _0xaa9521(_0x5a77e0[_0x804b('0x1b')]['message']);}else{_0xaa9521(_0x5a77e0[_0x804b('0x1e')]);}})[_0x804b('0x1f')](function(_0x4e7266){_0x2b7271(_0x4e7266);});});}function getAgent(_0x12b6a6){return db[_0x804b('0x20')][_0x804b('0x21')]({'where':{'id':_0x12b6a6,'role':_0x804b('0x22')}})[_0x804b('0x1a')](checkError());}function getAgentCheckSession(_0x5cc1dd,_0x456580){return new BPromise(function(_0x22f822,_0x1f08f4){var _0xe145e=respondWithRpcPromise(_0x804b('0x23'));var _0x4a6079=getAgent(_0x5cc1dd);Promise[_0x804b('0x24')]([_0xe145e,_0x4a6079])[_0x804b('0x1a')](function(_0x410871){var _0x5c7026=_0x410871[0x0];var _0x3dbd41=_0x410871[0x1];var _0x407357=_[_0x804b('0x25')](_0x5c7026['rows'],function(_0x408857){return _0x408857[_0x804b('0x26')]==_0x3dbd41['id']&&_0x408857['sessionId']==_0x456580;});if(_0x407357[_0x804b('0x27')]==0x1){_0x22f822(_0x3dbd41);}else{_0x1f08f4(new RangeError(_0x804b('0x28')+_0x456580+_0x804b('0x29')));}});});}exports[_0x804b('0x2a')]=function(_0x46de73,_0x241c96){logger['info'](_0x804b('0x2b'),_0x46de73[_0x804b('0x2c')]);var _0x16e460=originateValidation[_0x804b('0xb')](_0x46de73[_0x804b('0x2c')]);if(_0x16e460[_0x804b('0x27')]>0x0){return _0x241c96[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x16e460);}var _0x30f25f=_0x46de73[_0x804b('0x2c')][_0x804b('0x2e')];var _0x27906a=_0x46de73[_0x804b('0x2c')][_0x804b('0x2f')];var _0x20c50b=_0x46de73[_0x804b('0x2c')][_0x804b('0x30')];var _0x1be16f=_0x46de73[_0x804b('0x2c')][_0x804b('0x31')];return getAgent(_0x30f25f)[_0x804b('0x1a')](function(_0x350387){logger[_0x804b('0x11')](_0x804b('0x32'),_0x350387[_0x804b('0x16')]);emit(util['format']('user:%s',_0x350387['name']),_0x804b('0x33'),{'callNumber':_0x27906a,'callerId':_0x20c50b,'callbackUrl':_0x1be16f});return _0x241c96[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x241c96));};exports['hangup']=function(_0x27a4fb,_0x1aaa47){logger[_0x804b('0x11')](_0x804b('0x34'),_0x27a4fb[_0x804b('0x2c')]);var _0x10b49a=hangupValidation[_0x804b('0xb')](_0x27a4fb[_0x804b('0x2c')]);if(_0x10b49a[_0x804b('0x27')]>0x0){return _0x1aaa47[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x10b49a);}var _0x22a3fa=_0x27a4fb[_0x804b('0x2c')]['userId'];var _0x2c6e93=_0x27a4fb[_0x804b('0x2c')][_0x804b('0x35')];return getAgent(_0x22a3fa)[_0x804b('0x1a')](function(_0x62cfee){logger['info']('entityFound:',_0x62cfee[_0x804b('0x16')]);emit(util[_0x804b('0x36')](_0x804b('0x37'),_0x62cfee['name']),_0x804b('0x38'),{'sessionId':_0x2c6e93});return _0x1aaa47['status'](0xc8)[_0x804b('0x2d')]({'error':![],'message':_0x804b('0x39')});})[_0x804b('0x1f')](handleError(_0x1aaa47));};exports[_0x804b('0x3a')]=function(_0xc4a0fc,_0x13b986){logger[_0x804b('0x11')]('answer\x20fired:',_0xc4a0fc[_0x804b('0x2c')]);var _0x1c0363=answerValidation[_0x804b('0xb')](_0xc4a0fc[_0x804b('0x2c')]);if(_0x1c0363['length']>0x0){return _0x13b986[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x1c0363);}var _0x1df519=_0xc4a0fc[_0x804b('0x2c')][_0x804b('0x2e')];var _0xbca498=_0xc4a0fc[_0x804b('0x2c')][_0x804b('0x35')];return getAgent(_0x1df519)['then'](function(_0x3f6f1c){logger['info']('entityFound:',_0x3f6f1c['name']);emit(util[_0x804b('0x36')]('user:%s',_0x3f6f1c[_0x804b('0x16')]),_0x804b('0x3b'),{'sessionId':_0xbca498});return _0x13b986[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':'answer\x20executed!'});})[_0x804b('0x1f')](handleError(_0x13b986));};exports[_0x804b('0x3c')]=function(_0x44211d,_0x523dbb){logger[_0x804b('0x11')](_0x804b('0x3d'),_0x44211d[_0x804b('0x2c')]);var _0x4cada2=holdValidation[_0x804b('0xb')](_0x44211d[_0x804b('0x2c')]);if(_0x4cada2[_0x804b('0x27')]>0x0){return _0x523dbb[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x4cada2);}var _0x3a39f5=_0x44211d[_0x804b('0x2c')][_0x804b('0x2e')];var _0x1d3e73=_0x44211d[_0x804b('0x2c')][_0x804b('0x35')];return getAgent(_0x3a39f5)[_0x804b('0x1a')](function(_0x20862f){logger[_0x804b('0x11')]('entityFound:',_0x20862f['name']);emit(util[_0x804b('0x36')](_0x804b('0x37'),_0x20862f[_0x804b('0x16')]),_0x804b('0x3e'),{'sessionId':_0x1d3e73});return _0x523dbb[_0x804b('0x17')](0xc8)['json']({'error':![],'message':_0x804b('0x3f')});})[_0x804b('0x1f')](handleError(_0x523dbb));};exports[_0x804b('0x40')]=function(_0x3ca9ff,_0x47247c){logger[_0x804b('0x11')]('unhold\x20fired:',_0x3ca9ff['body']);var _0x3fe62a=unholdValidation[_0x804b('0xb')](_0x3ca9ff['body']);if(_0x3fe62a['length']>0x0){return _0x47247c[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x3fe62a);}var _0x4a5068=_0x3ca9ff['body'][_0x804b('0x2e')];var _0x38c2c0=_0x3ca9ff['body'][_0x804b('0x35')];return getAgent(_0x4a5068)['then'](function(_0x165155){logger['info'](_0x804b('0x32'),_0x165155[_0x804b('0x16')]);emit(util['format'](_0x804b('0x37'),_0x165155['name']),_0x804b('0x41'),{'sessionId':_0x38c2c0});return _0x47247c[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':_0x804b('0x42')});})[_0x804b('0x1f')](handleError(_0x47247c));};exports[_0x804b('0x43')]=function(_0x3a3a59,_0x13a84f){logger[_0x804b('0x11')](_0x804b('0x44'),_0x13a84f['body']);var _0x53b91d=callsValidation[_0x804b('0xb')](_0x3a3a59['body']);if(_0x53b91d['length']>0x0){return _0x13a84f[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x53b91d);}var _0x2df300=_0x3a3a59[_0x804b('0x2c')]['userId'];var _0x4f7cc4=respondWithRpcPromise(_0x804b('0x23'));var _0x3954d0=getAgent(_0x2df300);return Promise[_0x804b('0x24')]([_0x4f7cc4,_0x3954d0])[_0x804b('0x1a')](function(_0x9e261a){var _0xe19c3d=_0x9e261a[0x0];var _0x24c9b0=_0x9e261a[0x1];var _0x3100aa=_[_0x804b('0x25')](_0xe19c3d[_0x804b('0x45')],function(_0x3c0f28){return _0x3c0f28[_0x804b('0x26')]==_0x24c9b0['id'];});return _0x13a84f[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'count':_0x3100aa[_0x804b('0x27')],'rows':_0x3100aa});})[_0x804b('0x1f')](handleError(_0x13a84f));};exports['conference']=function(_0x30b23a,_0x3d94f9){logger['info'](_0x804b('0x46'),_0x30b23a[_0x804b('0x2c')]);var _0x180251=conferenceValidation[_0x804b('0xb')](_0x30b23a['body']);if(_0x180251[_0x804b('0x27')]>0x0){return _0x3d94f9[_0x804b('0x17')](0x190)['json'](_0x180251);}var _0x3098a1=_0x30b23a[_0x804b('0x2c')][_0x804b('0x2e')];return getAgent(_0x3098a1)['then'](function(_0x126ae4){logger[_0x804b('0x11')](_0x804b('0x32'),_0x126ae4[_0x804b('0x16')]);emit(util[_0x804b('0x36')]('user:%s',_0x126ae4[_0x804b('0x16')]),_0x804b('0x47'));return _0x3d94f9[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x3d94f9));};exports[_0x804b('0x48')]=function(_0x5695bb,_0x22d816){logger[_0x804b('0x11')](_0x804b('0x49'),_0x5695bb[_0x804b('0x2c')]);var _0x2bfef2=transferValidation['validate'](_0x5695bb[_0x804b('0x2c')]);if(_0x2bfef2[_0x804b('0x27')]>0x0){return _0x22d816[_0x804b('0x17')](0x190)['json'](_0x2bfef2);}var _0x360a81=_0x5695bb[_0x804b('0x2c')]['userId'];var _0xb9deae=_0x5695bb['body'][_0x804b('0x35')];var _0x45d98f=_0x5695bb['body'][_0x804b('0x4a')];return getAgent(_0x360a81)[_0x804b('0x1a')](function(_0xaedaf6){logger['info'](_0x804b('0x32'),_0xaedaf6['name']);emit(util[_0x804b('0x36')](_0x804b('0x37'),_0xaedaf6[_0x804b('0x16')]),_0x804b('0x4b'),{'sessionId':_0xb9deae,'transferNumber':_0x45d98f});return _0x22d816['status'](0xc8)[_0x804b('0x2d')]({'error':![],'message':_0x804b('0x4c')});})[_0x804b('0x1f')](handleError(_0x22d816));}; \ No newline at end of file +var _0xe205=['hold\x20fired:','hold\x20executed!','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','hangup','hangup\x20fired:','userId','format','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold'];(function(_0x4bda76,_0x58f3b4){var _0x753838=function(_0x307050){while(--_0x307050){_0x4bda76['push'](_0x4bda76['shift']());}};_0x753838(++_0x58f3b4);}(_0xe205,0xa7));var _0x5e20=function(_0x58991c,_0x1eaab5){_0x58991c=_0x58991c-0x0;var _0x4ddbfd=_0xe205[_0x58991c];return _0x4ddbfd;};'use strict';var path=require(_0x5e20('0x0'));var fs=require('fs');var _=require(_0x5e20('0x1'));var db=require(_0x5e20('0x2'))['db'];var config=require(_0x5e20('0x3'));var util=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var jayson=require(_0x5e20('0x6'));var amiClient=jayson[_0x5e20('0x7')][_0x5e20('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0x5e20('0x9'));var Redis=require(_0x5e20('0xa'));config[_0x5e20('0xb')]=_[_0x5e20('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5e20('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'callNumber':{'type':'string','required':[!![],_0x5e20('0x10')]},'callerId':{'type':_0x5e20('0x11')},'callbackUrl':{'type':_0x5e20('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':[!![],_0x5e20('0x12')]},'transferNumber':{'type':_0x5e20('0x11'),'required':[!![],_0x5e20('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});function emit(_0x542b3c,_0xeaeb77,_0x9a59ce){logger[_0x5e20('0x14')](_0x542b3c,_0xeaeb77,JSON[_0x5e20('0x15')](_0x9a59ce));io['to'](_0x542b3c)[_0x5e20('0x16')](_0xeaeb77,_0x9a59ce);}function handleError(_0x3b353f){return function(_0x1cc706){console[_0x5e20('0x17')]('handleError:',_0x1cc706,_0x1cc706 instanceof RangeError);logger[_0x5e20('0x18')](_0x1cc706[_0x5e20('0x19')]);if(_0x1cc706 instanceof RangeError){if(_0x1cc706['name']){delete _0x1cc706[_0x5e20('0x1a')];}_0x3b353f[_0x5e20('0x1b')](0x194)[_0x5e20('0x1c')](_0x1cc706);}else{if(_0x1cc706[_0x5e20('0x1a')]){delete _0x1cc706['name'];}_0x3b353f[_0x5e20('0x1b')](0x1f4)['send'](_0x1cc706);}};}function checkError(){return function(_0x4a3587){if(!_0x4a3587){throw new RangeError('NotFound');}return _0x4a3587;};}function respondWithRpcPromise(_0x5d0d1a,_0xe562ba){return new BPromise(function(_0x5cca90,_0x3d89e4){var _0x29b111=amiClient;return _0x29b111[_0x5e20('0x1d')](_0x5d0d1a,_0xe562ba)[_0x5e20('0x1e')](function(_0x3ef7fa){if(_0x3ef7fa[_0x5e20('0x18')]){if(_0x3ef7fa['error'][_0x5e20('0x1f')]===0x1f4){return _0x3d89e4(_0x3ef7fa['error']['message']);}return _0x5cca90(_0x3ef7fa[_0x5e20('0x18')][_0x5e20('0x20')]);}else{_0x5cca90(_0x3ef7fa[_0x5e20('0x21')]);}})[_0x5e20('0x22')](function(_0xbf7a24){_0x3d89e4(_0xbf7a24);});});}function getAgent(_0x200774){return db[_0x5e20('0x23')]['findOne']({'where':{'id':_0x200774,'role':_0x5e20('0x24')}})[_0x5e20('0x1e')](checkError());}function getAgentCheckSession(_0x238758,_0x3032ef){return new BPromise(function(_0x4c799d,_0x3a0f06){var _0x2c5d80=respondWithRpcPromise(_0x5e20('0x25'));var _0x222e7a=getAgent(_0x238758);Promise[_0x5e20('0x26')]([_0x2c5d80,_0x222e7a])[_0x5e20('0x1e')](function(_0x5ec45b){var _0xbc2b0e=_0x5ec45b[0x0];var _0x34a3d6=_0x5ec45b[0x1];var _0x543c29=_[_0x5e20('0x27')](_0xbc2b0e[_0x5e20('0x28')],function(_0x335f1e){return _0x335f1e[_0x5e20('0x29')]==_0x34a3d6['id']&&_0x335f1e[_0x5e20('0x2a')]==_0x3032ef;});if(_0x543c29[_0x5e20('0x2b')]==0x1){_0x4c799d(_0x34a3d6);}else{_0x3a0f06(new RangeError('sessionId\x20'+_0x3032ef+_0x5e20('0x2c')));}});});}exports[_0x5e20('0x2d')]=function(_0x330341,_0x5f2f1d){logger[_0x5e20('0x14')](_0x5e20('0x2e'),_0x330341[_0x5e20('0x2f')]);var _0x1ed59d=originateValidation[_0x5e20('0x30')](_0x330341[_0x5e20('0x2f')]);if(_0x1ed59d[_0x5e20('0x2b')]>0x0){return _0x5f2f1d['status'](0x190)[_0x5e20('0x31')](_0x1ed59d);}var _0x1a9fff=_0x330341[_0x5e20('0x2f')]['userId'];var _0x9469cd=_0x330341[_0x5e20('0x2f')][_0x5e20('0x32')];var _0x2e367e=_0x330341[_0x5e20('0x2f')][_0x5e20('0x33')];var _0x1114ae=_0x330341[_0x5e20('0x2f')][_0x5e20('0x34')];return getAgent(_0x1a9fff)[_0x5e20('0x1e')](function(_0x36e825){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x36e825[_0x5e20('0x1a')]);emit(util['format'](_0x5e20('0x36'),_0x36e825['name']),'webbar:originate',{'callNumber':_0x9469cd,'callerId':_0x2e367e,'callbackUrl':_0x1114ae});return _0x5f2f1d[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':'originate\x20executed!'});})[_0x5e20('0x22')](handleError(_0x5f2f1d));};exports[_0x5e20('0x37')]=function(_0x4f34c0,_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x38'),_0x4f34c0[_0x5e20('0x2f')]);var _0x15ce1d=hangupValidation[_0x5e20('0x30')](_0x4f34c0[_0x5e20('0x2f')]);if(_0x15ce1d[_0x5e20('0x2b')]>0x0){return _0x3f3908[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x15ce1d);}var _0x473b69=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x1cb3f0=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x473b69)[_0x5e20('0x1e')](function(_0x17feb4){logger['info'](_0x5e20('0x35'),_0x17feb4[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x17feb4[_0x5e20('0x1a')]),'webbar:hangup',{'sessionId':_0x1cb3f0});return _0x3f3908[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x3b')});})[_0x5e20('0x22')](handleError(_0x3f3908));};exports[_0x5e20('0x3c')]=function(_0x30d3ef,_0x5c7ae8){logger[_0x5e20('0x14')](_0x5e20('0x3d'),_0x30d3ef[_0x5e20('0x2f')]);var _0x5a21f0=answerValidation[_0x5e20('0x30')](_0x30d3ef[_0x5e20('0x2f')]);if(_0x5a21f0[_0x5e20('0x2b')]>0x0){return _0x5c7ae8[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5a21f0);}var _0x336d61=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x5c9504=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x336d61)[_0x5e20('0x1e')](function(_0x503cb6){logger[_0x5e20('0x14')]('entityFound:',_0x503cb6[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x503cb6[_0x5e20('0x1a')]),_0x5e20('0x3e'),{'sessionId':_0x5c9504});return _0x5c7ae8['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x5c7ae8));};exports[_0x5e20('0x3f')]=function(_0x28f155,_0x9d9d62){logger[_0x5e20('0x14')](_0x5e20('0x40'),_0x28f155[_0x5e20('0x2f')]);var _0x57c794=holdValidation['validate'](_0x28f155['body']);if(_0x57c794[_0x5e20('0x2b')]>0x0){return _0x9d9d62[_0x5e20('0x1b')](0x190)['json'](_0x57c794);}var _0x22b84e=_0x28f155[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x3bd5b8=_0x28f155[_0x5e20('0x2f')]['sessionId'];return getAgent(_0x22b84e)[_0x5e20('0x1e')](function(_0x245b52){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x245b52[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x245b52[_0x5e20('0x1a')]),'webbar:hold',{'sessionId':_0x3bd5b8});return _0x9d9d62['status'](0xc8)['json']({'error':![],'message':_0x5e20('0x41')});})[_0x5e20('0x22')](handleError(_0x9d9d62));};exports['unhold']=function(_0x4392ca,_0x4bfea7){logger[_0x5e20('0x14')]('unhold\x20fired:',_0x4392ca[_0x5e20('0x2f')]);var _0x59372c=unholdValidation[_0x5e20('0x30')](_0x4392ca[_0x5e20('0x2f')]);if(_0x59372c[_0x5e20('0x2b')]>0x0){return _0x4bfea7[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59372c);}var _0x200094=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x19c128=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x200094)[_0x5e20('0x1e')](function(_0x278b0e){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x278b0e[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x278b0e['name']),'webbar:unhold',{'sessionId':_0x19c128});return _0x4bfea7[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x42')});})[_0x5e20('0x22')](handleError(_0x4bfea7));};exports[_0x5e20('0x43')]=function(_0x596971,_0x457552){logger[_0x5e20('0x14')](_0x5e20('0x44'),_0x457552['body']);var _0x5d2aa2=callsValidation['validate'](_0x596971[_0x5e20('0x2f')]);if(_0x5d2aa2[_0x5e20('0x2b')]>0x0){return _0x457552[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5d2aa2);}var _0xbacc1f=_0x596971[_0x5e20('0x2f')]['userId'];var _0x393724=respondWithRpcPromise('VoiceChannels');var _0x2913e7=getAgent(_0xbacc1f);return Promise['all']([_0x393724,_0x2913e7])[_0x5e20('0x1e')](function(_0x2eff14){var _0x141743=_0x2eff14[0x0];var _0x5f025b=_0x2eff14[0x1];var _0x1f6a32=_[_0x5e20('0x27')](_0x141743[_0x5e20('0x28')],function(_0x4309b8){return _0x4309b8[_0x5e20('0x29')]==_0x5f025b['id'];});return _0x457552[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'count':_0x1f6a32['length'],'rows':_0x1f6a32});})[_0x5e20('0x22')](handleError(_0x457552));};exports[_0x5e20('0x45')]=function(_0x1a03e4,_0x2f9089){logger['info'](_0x5e20('0x46'),_0x1a03e4[_0x5e20('0x2f')]);var _0x23f07d=conferenceValidation[_0x5e20('0x30')](_0x1a03e4['body']);if(_0x23f07d[_0x5e20('0x2b')]>0x0){return _0x2f9089[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x23f07d);}var _0x53ddd4=_0x1a03e4['body']['userId'];return getAgent(_0x53ddd4)[_0x5e20('0x1e')](function(_0x1eb84c){logger['info'](_0x5e20('0x35'),_0x1eb84c[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')]('user:%s',_0x1eb84c[_0x5e20('0x1a')]),_0x5e20('0x47'));return _0x2f9089['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x48')});})['catch'](handleError(_0x2f9089));};exports[_0x5e20('0x49')]=function(_0x9993ae,_0x1e531d){logger[_0x5e20('0x14')]('transfer\x20fired:',_0x9993ae[_0x5e20('0x2f')]);var _0x59bff7=transferValidation['validate'](_0x9993ae[_0x5e20('0x2f')]);if(_0x59bff7[_0x5e20('0x2b')]>0x0){return _0x1e531d[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59bff7);}var _0x54cd1=_0x9993ae[_0x5e20('0x2f')]['userId'];var _0x4bccbe=_0x9993ae[_0x5e20('0x2f')][_0x5e20('0x2a')];var _0x17f248=_0x9993ae['body'][_0x5e20('0x4a')];return getAgent(_0x54cd1)[_0x5e20('0x1e')](function(_0x52f8ef){logger[_0x5e20('0x14')]('entityFound:',_0x52f8ef['name']);emit(util[_0x5e20('0x3a')]('user:%s',_0x52f8ef[_0x5e20('0x1a')]),_0x5e20('0x4b'),{'sessionId':_0x4bccbe,'transferNumber':_0x17f248});return _0x1e531d[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x4c')});})[_0x5e20('0x22')](handleError(_0x1e531d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 27bb5b1..999c62c 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 _0x51ad=['index','/describe','describe','/:id','get','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x51ad,0x1be));var _0xd51a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51ad[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xd51a('0x0'));var util=require(_0xd51a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd51a('0x2'));var router=express['Router']();var fs_extra=require(_0xd51a('0x3'));var auth=require(_0xd51a('0x4'));var interaction=require(_0xd51a('0x5'));var config=require(_0xd51a('0x6'));var controller=require(_0xd51a('0x7'));router['get']('/',auth[_0xd51a('0x8')](),controller[_0xd51a('0x9')]);router['get'](_0xd51a('0xa'),auth[_0xd51a('0x8')](),controller[_0xd51a('0xb')]);router['get'](_0xd51a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd51a('0xd')](_0xd51a('0xe'),auth[_0xd51a('0x8')](),controller['getDispositions']);router['get'](_0xd51a('0xf'),auth[_0xd51a('0x8')](),controller['getAnswers']);router[_0xd51a('0xd')](_0xd51a('0x10'),auth[_0xd51a('0x8')](),controller[_0xd51a('0x11')]);router[_0xd51a('0xd')]('/:id/applications',auth[_0xd51a('0x8')](),controller[_0xd51a('0x12')]);router[_0xd51a('0x13')]('/',auth[_0xd51a('0x8')](),controller[_0xd51a('0x14')]);router['post'](_0xd51a('0xe'),auth[_0xd51a('0x8')](),controller[_0xd51a('0x15')]);router[_0xd51a('0x13')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd51a('0x16')]);router[_0xd51a('0x13')](_0xd51a('0x10'),auth[_0xd51a('0x8')](),controller[_0xd51a('0x17')]);router[_0xd51a('0x13')](_0xd51a('0x18'),auth[_0xd51a('0x8')](),controller[_0xd51a('0x19')]);router[_0xd51a('0x13')](_0xd51a('0x1a'),controller[_0xd51a('0x1b')]);router['post']('/:id/send',auth[_0xd51a('0x8')](),controller[_0xd51a('0x1c')]);router[_0xd51a('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xd51a('0x1e')]);router[_0xd51a('0x1f')]('/:id',auth[_0xd51a('0x8')](),controller[_0xd51a('0x20')]);router[_0xd51a('0x1f')](_0xd51a('0xe'),auth[_0xd51a('0x8')](),controller[_0xd51a('0x21')]);router[_0xd51a('0x1f')](_0xd51a('0xf'),auth[_0xd51a('0x8')](),controller['removeAnswers']);router[_0xd51a('0x1f')](_0xd51a('0x10'),auth[_0xd51a('0x8')](),controller[_0xd51a('0x22')]);module['exports']=router; \ No newline at end of file +var _0x4786=['index','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4786,0xff));var _0x6478=function(_0x473141,_0x53a677){_0x473141=_0x473141-0x0;var _0xa8ecfb=_0x4786[_0x473141];return _0xa8ecfb;};'use strict';var multer=require(_0x6478('0x0'));var util=require('util');var path=require(_0x6478('0x1'));var timeout=require('connect-timeout');var express=require(_0x6478('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6478('0x3'));var interaction=require(_0x6478('0x4'));var config=require(_0x6478('0x5'));var controller=require(_0x6478('0x6'));router[_0x6478('0x7')]('/',auth[_0x6478('0x8')](),controller[_0x6478('0x9')]);router[_0x6478('0x7')]('/describe',auth[_0x6478('0x8')](),controller[_0x6478('0xa')]);router[_0x6478('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6478('0xb')]);router[_0x6478('0x7')](_0x6478('0xc'),auth[_0x6478('0x8')](),controller[_0x6478('0xd')]);router[_0x6478('0x7')]('/:id/canned_answers',auth[_0x6478('0x8')](),controller[_0x6478('0xe')]);router[_0x6478('0x7')](_0x6478('0xf'),auth[_0x6478('0x8')](),controller['getAgents']);router['get']('/:id/applications',auth[_0x6478('0x8')](),controller[_0x6478('0x10')]);router[_0x6478('0x11')]('/',auth[_0x6478('0x8')](),controller[_0x6478('0x12')]);router[_0x6478('0x11')](_0x6478('0xc'),auth['isAuthenticated'](),controller[_0x6478('0x13')]);router['post'](_0x6478('0x14'),auth[_0x6478('0x8')](),controller[_0x6478('0x15')]);router[_0x6478('0x11')](_0x6478('0xf'),auth[_0x6478('0x8')](),controller[_0x6478('0x16')]);router['post'](_0x6478('0x17'),auth['isAuthenticated'](),controller['addApplications']);router[_0x6478('0x11')]('/:id/notify',controller['notify']);router['post'](_0x6478('0x18'),auth[_0x6478('0x8')](),controller[_0x6478('0x19')]);router[_0x6478('0x1a')](_0x6478('0x1b'),auth['isAuthenticated'](),controller[_0x6478('0x1c')]);router[_0x6478('0x1d')](_0x6478('0x1b'),auth[_0x6478('0x8')](),controller[_0x6478('0x1e')]);router[_0x6478('0x1d')]('/:id/dispositions',auth[_0x6478('0x8')](),controller[_0x6478('0x1f')]);router[_0x6478('0x1d')](_0x6478('0x14'),auth[_0x6478('0x8')](),controller[_0x6478('0x20')]);router[_0x6478('0x1d')](_0x6478('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index d15186d..6951cb4 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 _0xbd85=['ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','generate'];(function(_0x53a36b,_0x29679c){var _0x42fed8=function(_0x31dcf8){while(--_0x31dcf8){_0x53a36b['push'](_0x53a36b['shift']());}};_0x42fed8(++_0x29679c);}(_0xbd85,0x1f4));var _0x5bd8=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0xbd85[_0x152aa1];return _0x1bc01a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5bd8('0x0'));module[_0x5bd8('0x1')]={'name':{'type':Sequelize[_0x5bd8('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5bd8('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5bd8('0x2')],'defaultValue':function(){return rs[_0x5bd8('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5bd8('0x4')](_0x5bd8('0x5'),_0x5bd8('0x6'))},'accountSid':{'type':Sequelize[_0x5bd8('0x2')]},'baseUrl':{'type':Sequelize[_0x5bd8('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5bd8('0x7')],'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[_0x5bd8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5bd8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5bd8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bd8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5bd8('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x5bd8('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b470c){if(!_0x4b470c){this['setDataValue'](_0x5bd8('0xb'),null);}this[_0x5bd8('0xc')](_0x5bd8('0xd'),_0x4b470c);}},'description':{'type':Sequelize[_0x5bd8('0x2')]}}; \ No newline at end of file +var _0xfd1c=['mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x3cadb1,_0x5174ee){var _0x5d198=function(_0x4b701d){while(--_0x4b701d){_0x3cadb1['push'](_0x3cadb1['shift']());}};_0x5d198(++_0x5174ee);}(_0xfd1c,0xd3));var _0xcfd1=function(_0x46306f,_0x5aef14){_0x46306f=_0x46306f-0x0;var _0x16a27f=_0xfd1c[_0x46306f];return _0x16a27f;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xcfd1('0x0')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xcfd1('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0xcfd1('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0xcfd1('0x0')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xcfd1('0x0')]},'type':{'type':Sequelize[_0xcfd1('0x1')](_0xcfd1('0x2'),'sinch')},'accountSid':{'type':Sequelize[_0xcfd1('0x0')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xcfd1('0x0')]},'notificationTemplate':{'type':Sequelize[_0xcfd1('0x3')],'defaultValue':function(){return _0xcfd1('0x4');}},'notificationSound':{'type':Sequelize[_0xcfd1('0x5')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xcfd1('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcfd1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcfd1('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcfd1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcfd1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcfd1('0x6')],'comment':_0xcfd1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xcfd1('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x56f9d7){if(!_0x56f9d7){this[_0xcfd1('0x8')](_0xcfd1('0x9'),null);}this[_0xcfd1('0x8')](_0xcfd1('0xa'),_0x56f9d7);}},'description':{'type':Sequelize[_0xcfd1('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index a0870b0..591bec8 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 _0x42dc=['result','catch','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappAccounts','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','include','findAll','show','keys','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','findOne','merge','includeAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','messageId','notifications','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','UserId','agent','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','user','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappAccount.socket','jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b5886,_0x30c981){var _0x247fbe=function(_0x1148e6){while(--_0x1148e6){_0x4b5886['push'](_0x4b5886['shift']());}};_0x247fbe(++_0x30c981);}(_0x42dc,0xa6));var _0xc42d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x42dc[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xc42d('0x0'));var rimraf=require(_0xc42d('0x1'));var zipdir=require(_0xc42d('0x2'));var jsonpatch=require(_0xc42d('0x3'));var rp=require(_0xc42d('0x4'));var moment=require(_0xc42d('0x5'));var BPromise=require(_0xc42d('0x6'));var Mustache=require(_0xc42d('0x7'));var util=require(_0xc42d('0x8'));var path=require(_0xc42d('0x9'));var sox=require(_0xc42d('0xa'));var csv=require(_0xc42d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc42d('0xc'));var _=require(_0xc42d('0xd'));var squel=require(_0xc42d('0xe'));var crypto=require('crypto');var jsforce=require(_0xc42d('0xf'));var deskjs=require(_0xc42d('0x10'));var toCsv=require(_0xc42d('0xb'));var querystring=require(_0xc42d('0x11'));var Papa=require(_0xc42d('0x12'));var Redis=require(_0xc42d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc42d('0x14'));var as=require(_0xc42d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc42d('0x16'))('api');var utils=require(_0xc42d('0x17'));var config=require(_0xc42d('0x18'));var licenseUtil=require(_0xc42d('0x19'));var db=require('../../mysqldb')['db'];config[_0xc42d('0x1a')]=_[_0xc42d('0x1b')](config[_0xc42d('0x1a')],{'host':_0xc42d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc42d('0x1a')]));require(_0xc42d('0x1d'))['register'](socket);var jayson=require(_0xc42d('0x1e'));var client=jayson['client'][_0xc42d('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xa59016,_0x3b8e33,_0x567480,_0x27c6e3){return new BPromise(function(_0x4a637f,_0x5a3536){var _0x23b4ff=_0x27c6e3||client;return _0x23b4ff[_0xc42d('0x20')](_0xa59016,_0x567480)['then'](function(_0x478536){logger[_0xc42d('0x21')](_0xc42d('0x22'),_0x3b8e33,_0xc42d('0x23'));logger['debug'](_0xc42d('0x24'),_0x3b8e33,_0xc42d('0x23'),JSON[_0xc42d('0x25')](_0x478536));if(_0x478536['error']){if(_0x478536[_0xc42d('0x26')][_0xc42d('0x27')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3b8e33,_0x478536[_0xc42d('0x26')][_0xc42d('0x28')]);return _0x5a3536(_0x478536[_0xc42d('0x26')][_0xc42d('0x28')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3b8e33,_0x478536[_0xc42d('0x26')][_0xc42d('0x28')]);return _0x4a637f(_0x478536['error'][_0xc42d('0x28')]);}else{logger[_0xc42d('0x21')](_0xc42d('0x22'),_0x3b8e33,_0xc42d('0x23'));_0x4a637f(_0x478536[_0xc42d('0x29')][_0xc42d('0x28')]);}})[_0xc42d('0x2a')](function(_0x3b36e){logger[_0xc42d('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x3b8e33,_0x3b36e);_0x5a3536(_0x3b36e);});});}function respondWithStatusCode(_0x2f8e2d,_0x5f0140){_0x5f0140=_0x5f0140||0xcc;return function(_0x1d8a68){if(_0x1d8a68){return _0x2f8e2d[_0xc42d('0x2b')](_0x5f0140);}return _0x2f8e2d['status'](_0x5f0140)[_0xc42d('0x2c')]();};}function respondWithResult(_0x1aedb4,_0x3991e9){_0x3991e9=_0x3991e9||0xc8;return function(_0x3f0494){if(_0x3f0494){return _0x1aedb4['status'](_0x3991e9)['json'](_0x3f0494);}};}function respondWithFilteredResult(_0x1aa740,_0x1c56db){return function(_0x505b49){if(_0x505b49){var _0x5b7da2=typeof _0x1c56db[_0xc42d('0x2d')]===_0xc42d('0x2e')&&typeof _0x1c56db[_0xc42d('0x2f')]===_0xc42d('0x2e');var _0x4780b8=_0x505b49[_0xc42d('0x30')];var _0x6004ec=_0x5b7da2?0x0:_0x1c56db[_0xc42d('0x2d')];var _0x34a4da=_0x5b7da2?_0x505b49[_0xc42d('0x30')]:_0x1c56db['offset']+_0x1c56db[_0xc42d('0x2f')];var _0x13a132;if(_0x34a4da>=_0x4780b8){_0x34a4da=_0x4780b8;_0x13a132=0xc8;}else{_0x13a132=0xce;}_0x1aa740[_0xc42d('0x31')](_0x13a132);return _0x1aa740[_0xc42d('0x32')](_0xc42d('0x33'),_0x6004ec+'-'+_0x34a4da+'/'+_0x4780b8)[_0xc42d('0x34')](_0x505b49);}return null;};}function patchUpdates(_0x75c90c){return function(_0x1c9cb4){try{jsonpatch[_0xc42d('0x35')](_0x1c9cb4,_0x75c90c,!![]);}catch(_0x42f3cf){return BPromise[_0xc42d('0x36')](_0x42f3cf);}return _0x1c9cb4[_0xc42d('0x37')]();};}function saveUpdates(_0x5a8e98,_0x4b4c64){return function(_0x376e0f){if(_0x376e0f){return _0x376e0f[_0xc42d('0x38')](_0x5a8e98)[_0xc42d('0x39')](function(_0x1f0c15){return _0x1f0c15;});}return null;};}function removeEntity(_0x2dc0f7,_0x1555ef){return function(_0xfb29f2){if(_0xfb29f2){return _0xfb29f2[_0xc42d('0x3a')]()['then'](function(){var _0x336eb7=_0xfb29f2[_0xc42d('0x3b')]({'plain':!![]});var _0x5bf13c=_0xc42d('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5bf13c,'resourceId':_0x336eb7['id']}})['then'](function(){return _0xfb29f2;});})['then'](function(){_0x2dc0f7[_0xc42d('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be790,_0x593746){return function(_0x52d77f){if(!_0x52d77f){_0x4be790[_0xc42d('0x2b')](0x194);}return _0x52d77f;};}function handleError(_0x52b28d,_0x26c369){_0x26c369=_0x26c369||0x1f4;return function(_0x233bdc){logger['error'](_0x233bdc['stack']);if(_0x233bdc[_0xc42d('0x3d')]){delete _0x233bdc[_0xc42d('0x3d')];}_0x52b28d[_0xc42d('0x31')](_0x26c369)[_0xc42d('0x3e')](_0x233bdc);};}exports[_0xc42d('0x3f')]=function(_0x35679c,_0x267742){var _0x43d73d={'include':[{'model':db[_0xc42d('0x40')],'as':_0xc42d('0x41')}]},_0x58e964={},_0xa565ea={'count':0x0,'rows':[]};var _0x35df2f=_[_0xc42d('0x42')](db[_0xc42d('0x43')][_0xc42d('0x44')],function(_0x2b05a6){return{'name':_0x2b05a6['fieldName'],'type':_0x2b05a6[_0xc42d('0x45')][_0xc42d('0x46')]};});_0x58e964[_0xc42d('0x47')]=_[_0xc42d('0x42')](_0x35df2f,'name');_0x58e964[_0xc42d('0x48')]=_['keys'](_0x35679c[_0xc42d('0x48')]);_0x58e964['filters']=_['intersection'](_0x58e964[_0xc42d('0x47')],_0x58e964[_0xc42d('0x48')]);_0x43d73d[_0xc42d('0x49')]=_['intersection'](_0x58e964[_0xc42d('0x47')],qs[_0xc42d('0x4a')](_0x35679c[_0xc42d('0x48')][_0xc42d('0x4a')]));_0x43d73d['attributes']=_0x43d73d[_0xc42d('0x49')][_0xc42d('0x4b')]?_0x43d73d[_0xc42d('0x49')]:_0x58e964['model'];if(!_0x35679c[_0xc42d('0x48')][_0xc42d('0x4c')](_0xc42d('0x4d'))){_0x43d73d[_0xc42d('0x2f')]=qs[_0xc42d('0x2f')](_0x35679c[_0xc42d('0x48')][_0xc42d('0x2f')]);_0x43d73d['offset']=qs[_0xc42d('0x2d')](_0x35679c[_0xc42d('0x48')][_0xc42d('0x2d')]);}_0x43d73d[_0xc42d('0x4e')]=qs[_0xc42d('0x4f')](_0x35679c[_0xc42d('0x48')]['sort']);_0x43d73d[_0xc42d('0x50')]=qs[_0xc42d('0x51')](_[_0xc42d('0x52')](_0x35679c[_0xc42d('0x48')],_0x58e964['filters']),_0x35df2f);if(_0x35679c[_0xc42d('0x48')][_0xc42d('0x53')]){_0x43d73d[_0xc42d('0x50')]=_['merge'](_0x43d73d[_0xc42d('0x50')],{'$or':_[_0xc42d('0x42')](_0x35df2f,function(_0x4dd3ab){if(_0x4dd3ab[_0xc42d('0x45')]!==_0xc42d('0x54')){var _0x10d14f={};_0x10d14f[_0x4dd3ab[_0xc42d('0x3d')]]={'$like':'%'+_0x35679c['query']['filter']+'%'};return _0x10d14f;}})});}_0x43d73d=_['merge']({},_0x43d73d,_0x35679c[_0xc42d('0x55')]);var _0x27be9c={'where':_0x43d73d[_0xc42d('0x50')]};return db[_0xc42d('0x43')][_0xc42d('0x30')](_0x27be9c)[_0xc42d('0x39')](function(_0x24a0ab){_0xa565ea[_0xc42d('0x30')]=_0x24a0ab;if(_0x35679c[_0xc42d('0x48')]['includeAll']){_0x43d73d[_0xc42d('0x56')]=[{'all':!![]}];}return db[_0xc42d('0x43')][_0xc42d('0x57')](_0x43d73d);})[_0xc42d('0x39')](function(_0x5d1358){_0xa565ea['rows']=_0x5d1358;return _0xa565ea;})[_0xc42d('0x39')](respondWithFilteredResult(_0x267742,_0x43d73d))[_0xc42d('0x2a')](handleError(_0x267742,null));};exports[_0xc42d('0x58')]=function(_0x3e4f57,_0x5e0b79){var _0x10f449={'raw':![],'where':{'id':_0x3e4f57['params']['id']},'include':[{'model':db['Pause'],'as':_0xc42d('0x41')}]},_0x2dcd13={};_0x2dcd13[_0xc42d('0x47')]=_[_0xc42d('0x59')](db[_0xc42d('0x43')][_0xc42d('0x44')]);_0x2dcd13[_0xc42d('0x48')]=_[_0xc42d('0x59')](_0x3e4f57[_0xc42d('0x48')]);_0x2dcd13[_0xc42d('0x51')]=_['intersection'](_0x2dcd13[_0xc42d('0x47')],_0x2dcd13['query']);_0x10f449['attributes']=_[_0xc42d('0x5a')](_0x2dcd13[_0xc42d('0x47')],qs[_0xc42d('0x4a')](_0x3e4f57[_0xc42d('0x48')][_0xc42d('0x4a')]));_0x10f449[_0xc42d('0x49')]=_0x10f449[_0xc42d('0x49')][_0xc42d('0x4b')]?_0x10f449['attributes']:_0x2dcd13[_0xc42d('0x47')];if(_0x3e4f57[_0xc42d('0x48')]['includeAll']){_0x10f449['include']=[{'all':!![]}];}_0x10f449=_['merge']({},_0x10f449,_0x3e4f57[_0xc42d('0x55')]);return db[_0xc42d('0x43')][_0xc42d('0x5b')](_0x10f449)[_0xc42d('0x39')](handleEntityNotFound(_0x5e0b79,null))[_0xc42d('0x39')](respondWithResult(_0x5e0b79,null))[_0xc42d('0x2a')](handleError(_0x5e0b79,null));};exports[_0xc42d('0x5c')]=function(_0x5b27e0,_0x1dcb47){return db[_0xc42d('0x43')]['create'](_0x5b27e0[_0xc42d('0x5d')],{})[_0xc42d('0x39')](function(_0xf82255){var _0x38b5bf=_0x5b27e0['user'][_0xc42d('0x3b')]({'plain':!![]});if(!_0x38b5bf)throw new Error(_0xc42d('0x5e'));if(_0x38b5bf[_0xc42d('0x5f')]==='user'){var _0x205ca1=_0xf82255['get']({'plain':!![]});var _0xe19b48='WhatsappAccounts';return db[_0xc42d('0x60')][_0xc42d('0x5b')]({'where':{'name':_0xe19b48,'userProfileId':_0x38b5bf[_0xc42d('0x61')]},'raw':!![]})[_0xc42d('0x39')](function(_0x8df06f){if(_0x8df06f&&_0x8df06f[_0xc42d('0x62')]===0x0){return db[_0xc42d('0x63')][_0xc42d('0x5c')]({'name':_0x205ca1['name'],'resourceId':_0x205ca1['id'],'type':_0x8df06f[_0xc42d('0x3d')],'sectionId':_0x8df06f['id']},{})[_0xc42d('0x39')](function(){return _0xf82255;});}else{return _0xf82255;}})['catch'](function(_0xc0b247){logger[_0xc42d('0x26')](_0xc42d('0x64'),_0xc0b247);throw _0xc0b247;});}return _0xf82255;})[_0xc42d('0x39')](respondWithResult(_0x1dcb47,0xc9))['catch'](handleError(_0x1dcb47,null));};exports[_0xc42d('0x38')]=function(_0x16c66e,_0x4a64f0){if(_0x16c66e['body']['id']){delete _0x16c66e[_0xc42d('0x5d')]['id'];}return db[_0xc42d('0x43')][_0xc42d('0x5b')]({'where':{'id':_0x16c66e['params']['id']},'include':[{'model':db[_0xc42d('0x40')],'as':_0xc42d('0x41')}]})[_0xc42d('0x39')](handleEntityNotFound(_0x4a64f0,null))[_0xc42d('0x39')](saveUpdates(_0x16c66e[_0xc42d('0x5d')],null))[_0xc42d('0x39')](respondWithResult(_0x4a64f0,null))['catch'](handleError(_0x4a64f0,null));};exports[_0xc42d('0x3a')]=function(_0x1ab786,_0x3f0443){return db[_0xc42d('0x43')]['find']({'where':{'id':_0x1ab786[_0xc42d('0x65')]['id']}})['then'](handleEntityNotFound(_0x3f0443,null))[_0xc42d('0x39')](removeEntity(_0x3f0443,null))[_0xc42d('0x2a')](handleError(_0x3f0443,null));};exports[_0xc42d('0x66')]=function(_0xfbb108,_0x4fa19c){return db[_0xc42d('0x43')][_0xc42d('0x66')]()[_0xc42d('0x39')](respondWithResult(_0x4fa19c,null))['catch'](handleError(_0x4fa19c,null));};exports[_0xc42d('0x67')]=function(_0x1fd464,_0xd8178e,_0x1f8e15){if(_0x1fd464['body']['id']){delete _0x1fd464[_0xc42d('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x1fd464[_0xc42d('0x65')]['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0xd8178e,null))[_0xc42d('0x39')](function(_0x1e3a84){if(_0x1e3a84){_0x1fd464[_0xc42d('0x5d')][_0xc42d('0x68')]=_0x1e3a84['id'];return db[_0xc42d('0x69')][_0xc42d('0x5c')](_0x1fd464[_0xc42d('0x5d')]);}})['then'](respondWithResult(_0xd8178e,null))[_0xc42d('0x2a')](handleError(_0xd8178e,null));};exports['getDispositions']=function(_0x1d7f0c,_0x93481c,_0x41cd6a){var _0x568818={'raw':![],'where':{}};var _0x3da72e={};var _0x339611={'count':0x0,'rows':[]};return db[_0xc42d('0x43')][_0xc42d('0x6a')]({'where':{'id':_0x1d7f0c[_0xc42d('0x65')]['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x93481c,null))[_0xc42d('0x39')](function(_0x5c35da){if(_0x5c35da){_0x3da72e[_0xc42d('0x47')]=_['keys'](db[_0xc42d('0x69')][_0xc42d('0x44')]);_0x3da72e[_0xc42d('0x48')]=_[_0xc42d('0x59')](_0x1d7f0c[_0xc42d('0x48')]);_0x3da72e[_0xc42d('0x51')]=_[_0xc42d('0x5a')](_0x3da72e['model'],_0x3da72e[_0xc42d('0x48')]);_0x568818['attributes']=_[_0xc42d('0x5a')](_0x3da72e[_0xc42d('0x47')],qs[_0xc42d('0x4a')](_0x1d7f0c[_0xc42d('0x48')][_0xc42d('0x4a')]));_0x568818[_0xc42d('0x49')]=_0x568818['attributes'][_0xc42d('0x4b')]?_0x568818[_0xc42d('0x49')]:_0x3da72e[_0xc42d('0x47')];if(!_0x1d7f0c[_0xc42d('0x48')][_0xc42d('0x4c')](_0xc42d('0x4d'))){_0x568818[_0xc42d('0x2f')]=qs['limit'](_0x1d7f0c[_0xc42d('0x48')][_0xc42d('0x2f')]);_0x568818[_0xc42d('0x2d')]=qs[_0xc42d('0x2d')](_0x1d7f0c['query']['offset']);}_0x568818[_0xc42d('0x4e')]=qs[_0xc42d('0x4f')](_0x1d7f0c[_0xc42d('0x48')]['sort']);_0x568818[_0xc42d('0x50')]=qs['filters'](_['pick'](_0x1d7f0c[_0xc42d('0x48')],_0x3da72e['filters']));_0x568818[_0xc42d('0x50')][_0xc42d('0x68')]=_0x5c35da['id'];if(_0x1d7f0c[_0xc42d('0x48')]['filter']){_0x568818[_0xc42d('0x50')]=_[_0xc42d('0x6b')](_0x568818[_0xc42d('0x50')],{'$or':_[_0xc42d('0x42')](_0x568818[_0xc42d('0x49')],function(_0x19ccb7){var _0x1ba49a={};_0x1ba49a[_0x19ccb7]={'$like':'%'+_0x1d7f0c['query'][_0xc42d('0x53')]+'%'};return _0x1ba49a;})});}_0x568818=_[_0xc42d('0x6b')]({},_0x568818,_0x1d7f0c[_0xc42d('0x55')]);return db[_0xc42d('0x69')]['count']({'where':_0x568818['where']})[_0xc42d('0x39')](function(_0x5d7416){_0x339611[_0xc42d('0x30')]=_0x5d7416;if(_0x1d7f0c['query'][_0xc42d('0x6c')]){_0x568818['include']=[{'all':!![]}];}return db['Disposition'][_0xc42d('0x57')](_0x568818);})[_0xc42d('0x39')](function(_0x1a061b){_0x339611[_0xc42d('0x6d')]=_0x1a061b;return _0x339611;});}})[_0xc42d('0x39')](respondWithFilteredResult(_0x93481c,_0x568818))[_0xc42d('0x2a')](handleError(_0x93481c,null));};exports[_0xc42d('0x6e')]=function(_0x49c8c0,_0x6ca98c,_0x3d9761){return db['WhatsappAccount'][_0xc42d('0x5b')]({'where':{'id':_0x49c8c0[_0xc42d('0x65')]['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x6ca98c,null))['then'](function(_0x10c118){if(_0x10c118){return _0x10c118[_0xc42d('0x6e')](_0x49c8c0[_0xc42d('0x48')][_0xc42d('0x6f')]);}})[_0xc42d('0x39')](respondWithStatusCode(_0x6ca98c,null))[_0xc42d('0x2a')](handleError(_0x6ca98c,null));};exports['addAnswer']=function(_0x5e6ab3,_0x35cacd,_0x4d8fdf){if(_0x5e6ab3['body']['id']){delete _0x5e6ab3[_0xc42d('0x5d')]['id'];}return db[_0xc42d('0x43')][_0xc42d('0x5b')]({'where':{'id':_0x5e6ab3[_0xc42d('0x65')]['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x35cacd,null))[_0xc42d('0x39')](function(_0x502a48){if(_0x502a48){_0x5e6ab3[_0xc42d('0x5d')]['WhatsappAccountId']=_0x502a48['id'];return db[_0xc42d('0x70')][_0xc42d('0x5c')](_0x5e6ab3[_0xc42d('0x5d')]);}})['then'](respondWithResult(_0x35cacd,null))[_0xc42d('0x2a')](handleError(_0x35cacd,null));};exports[_0xc42d('0x71')]=function(_0x3d825d,_0x3ed4b4,_0x9c3ba1){var _0x1bec6f={'raw':![],'where':{}};var _0xed6051={};var _0x5b0639={'count':0x0,'rows':[]};return db[_0xc42d('0x43')][_0xc42d('0x6a')]({'where':{'id':_0x3d825d[_0xc42d('0x65')]['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x3ed4b4,null))[_0xc42d('0x39')](function(_0x5b45bc){if(_0x5b45bc){_0xed6051['model']=_['keys'](db['CannedAnswer'][_0xc42d('0x44')]);_0xed6051[_0xc42d('0x48')]=_[_0xc42d('0x59')](_0x3d825d[_0xc42d('0x48')]);_0xed6051[_0xc42d('0x51')]=_[_0xc42d('0x5a')](_0xed6051[_0xc42d('0x47')],_0xed6051['query']);_0x1bec6f[_0xc42d('0x49')]=_[_0xc42d('0x5a')](_0xed6051[_0xc42d('0x47')],qs[_0xc42d('0x4a')](_0x3d825d['query']['fields']));_0x1bec6f[_0xc42d('0x49')]=_0x1bec6f[_0xc42d('0x49')][_0xc42d('0x4b')]?_0x1bec6f['attributes']:_0xed6051[_0xc42d('0x47')];if(!_0x3d825d[_0xc42d('0x48')][_0xc42d('0x4c')]('nolimit')){_0x1bec6f[_0xc42d('0x2f')]=qs[_0xc42d('0x2f')](_0x3d825d[_0xc42d('0x48')][_0xc42d('0x2f')]);_0x1bec6f[_0xc42d('0x2d')]=qs[_0xc42d('0x2d')](_0x3d825d['query'][_0xc42d('0x2d')]);}_0x1bec6f[_0xc42d('0x4e')]=qs[_0xc42d('0x4f')](_0x3d825d[_0xc42d('0x48')][_0xc42d('0x4f')]);_0x1bec6f[_0xc42d('0x50')]=qs[_0xc42d('0x51')](_[_0xc42d('0x52')](_0x3d825d['query'],_0xed6051[_0xc42d('0x51')]));_0x1bec6f[_0xc42d('0x50')][_0xc42d('0x68')]=_0x5b45bc['id'];if(_0x3d825d[_0xc42d('0x48')][_0xc42d('0x53')]){_0x1bec6f[_0xc42d('0x50')]=_['merge'](_0x1bec6f[_0xc42d('0x50')],{'$or':_[_0xc42d('0x42')](_0x1bec6f[_0xc42d('0x49')],function(_0x4ac9b3){var _0x327a44={};_0x327a44[_0x4ac9b3]={'$like':'%'+_0x3d825d[_0xc42d('0x48')][_0xc42d('0x53')]+'%'};return _0x327a44;})});}_0x1bec6f=_[_0xc42d('0x6b')]({},_0x1bec6f,_0x3d825d['options']);return db[_0xc42d('0x70')][_0xc42d('0x30')]({'where':_0x1bec6f['where']})[_0xc42d('0x39')](function(_0x449a2c){_0x5b0639[_0xc42d('0x30')]=_0x449a2c;if(_0x3d825d[_0xc42d('0x48')]['includeAll']){_0x1bec6f[_0xc42d('0x56')]=[{'all':!![]}];}return db[_0xc42d('0x70')][_0xc42d('0x57')](_0x1bec6f);})[_0xc42d('0x39')](function(_0x4514eb){_0x5b0639[_0xc42d('0x6d')]=_0x4514eb;return _0x5b0639;});}})['then'](respondWithFilteredResult(_0x3ed4b4,_0x1bec6f))[_0xc42d('0x2a')](handleError(_0x3ed4b4,null));};exports['removeAnswers']=function(_0x5e284f,_0x1426ec,_0x4f4316){return db['WhatsappAccount'][_0xc42d('0x5b')]({'where':{'id':_0x5e284f['params']['id']}})['then'](handleEntityNotFound(_0x1426ec,null))[_0xc42d('0x39')](function(_0x2c8f24){if(_0x2c8f24){return _0x2c8f24[_0xc42d('0x72')](_0x5e284f[_0xc42d('0x48')][_0xc42d('0x6f')]);}})['then'](respondWithStatusCode(_0x1426ec,null))[_0xc42d('0x2a')](handleError(_0x1426ec,null));};exports[_0xc42d('0x73')]=function(_0x368a11,_0x50fb1f,_0x43812b){return db[_0xc42d('0x43')][_0xc42d('0x5b')]({'where':{'id':_0x368a11[_0xc42d('0x65')]['id']}})['then'](handleEntityNotFound(_0x50fb1f,null))[_0xc42d('0x39')](function(_0x6dc280){if(_0x6dc280){return _0x6dc280[_0xc42d('0x73')](_0x368a11[_0xc42d('0x5d')][_0xc42d('0x6f')],_['omit'](_0x368a11['body'],[_0xc42d('0x6f'),'id'])||{})[_0xc42d('0x74')](function(_0x29d2b1){for(var _0xd08fe=0x0;_0xd08fe<_0x368a11['body'][_0xc42d('0x6f')][_0xc42d('0x4b')];_0xd08fe+=0x1){socket[_0xc42d('0x75')](_0xc42d('0x76'),{'UserId':Number(_0x368a11[_0xc42d('0x5d')][_0xc42d('0x6f')][_0xd08fe]),'WhatsappAccountId':Number(_0x368a11[_0xc42d('0x65')]['id'])});}return _0x29d2b1;});}})[_0xc42d('0x39')](respondWithResult(_0x50fb1f,null))['catch'](handleError(_0x50fb1f,null));};exports[_0xc42d('0x77')]=function(_0x3b839d,_0x4153fd,_0x39ac13){return db[_0xc42d('0x43')][_0xc42d('0x5b')]({'where':{'id':_0x3b839d[_0xc42d('0x65')]['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x4153fd,null))[_0xc42d('0x39')](function(_0x1f84af){if(_0x1f84af){return _0x1f84af[_0xc42d('0x77')](_0x3b839d['query'][_0xc42d('0x6f')])[_0xc42d('0x39')](function(){if(_[_0xc42d('0x78')](_0x3b839d[_0xc42d('0x48')][_0xc42d('0x6f')])){for(var _0x165d03=0x0;_0x165d03<_0x3b839d[_0xc42d('0x48')][_0xc42d('0x6f')]['length'];_0x165d03+=0x1){socket[_0xc42d('0x75')](_0xc42d('0x79'),{'UserId':Number(_0x3b839d[_0xc42d('0x48')]['ids'][_0x165d03]),'WhatsappAccountId':Number(_0x3b839d[_0xc42d('0x65')]['id'])});}}else{socket['emit'](_0xc42d('0x79'),{'UserId':Number(_0x3b839d[_0xc42d('0x48')][_0xc42d('0x6f')]),'WhatsappAccountId':Number(_0x3b839d['params']['id'])});}});}})[_0xc42d('0x39')](respondWithStatusCode(_0x4153fd,null))['catch'](handleError(_0x4153fd,null));};exports[_0xc42d('0x7a')]=function(_0x5e2bbd,_0x4bcee5,_0x5d9f9f){var _0x2610e1={};var _0x1493b1={};var _0x31d69f;var _0x44d7fe;return db['WhatsappAccount']['findOne']({'where':{'id':_0x5e2bbd['params']['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x4bcee5,null))[_0xc42d('0x39')](function(_0x4ea490){if(_0x4ea490){_0x31d69f=_0x4ea490;_0x1493b1['model']=_[_0xc42d('0x59')](db[_0xc42d('0x7b')][_0xc42d('0x44')]);_0x1493b1[_0xc42d('0x48')]=_[_0xc42d('0x59')](_0x5e2bbd['query']);_0x1493b1['filters']=_[_0xc42d('0x5a')](_0x1493b1[_0xc42d('0x47')],_0x1493b1[_0xc42d('0x48')]);_0x2610e1[_0xc42d('0x49')]=_[_0xc42d('0x5a')](_0x1493b1['model'],qs[_0xc42d('0x4a')](_0x5e2bbd[_0xc42d('0x48')]['fields']));_0x2610e1[_0xc42d('0x49')]=_0x2610e1[_0xc42d('0x49')][_0xc42d('0x4b')]?_0x2610e1[_0xc42d('0x49')]:_0x1493b1[_0xc42d('0x47')];_0x2610e1[_0xc42d('0x4e')]=qs[_0xc42d('0x4f')](_0x5e2bbd['query']['sort']);_0x2610e1[_0xc42d('0x50')]=qs[_0xc42d('0x51')](_[_0xc42d('0x52')](_0x5e2bbd[_0xc42d('0x48')],_0x1493b1[_0xc42d('0x51')]));if(_0x5e2bbd[_0xc42d('0x48')][_0xc42d('0x53')]){_0x2610e1['where']=_[_0xc42d('0x6b')](_0x2610e1[_0xc42d('0x50')],{'$or':_[_0xc42d('0x42')](_0x2610e1[_0xc42d('0x49')],function(_0x2f490a){var _0x3e9763={};_0x3e9763[_0x2f490a]={'$like':'%'+_0x5e2bbd[_0xc42d('0x48')][_0xc42d('0x53')]+'%'};return _0x3e9763;})});}_0x2610e1=_[_0xc42d('0x6b')]({},_0x2610e1,_0x5e2bbd[_0xc42d('0x55')]);return _0x31d69f['getAgents'](_0x2610e1);}})[_0xc42d('0x39')](function(_0xb1b7d6){if(_0xb1b7d6){_0x44d7fe=_0xb1b7d6[_0xc42d('0x4b')];if(!_0x5e2bbd[_0xc42d('0x48')][_0xc42d('0x4c')]('nolimit')){_0x2610e1[_0xc42d('0x2f')]=qs[_0xc42d('0x2f')](_0x5e2bbd[_0xc42d('0x48')]['limit']);_0x2610e1['offset']=qs[_0xc42d('0x2d')](_0x5e2bbd[_0xc42d('0x48')][_0xc42d('0x2d')]);}return _0x31d69f[_0xc42d('0x7a')](_0x2610e1);}})[_0xc42d('0x39')](function(_0x39229c){if(_0x39229c){return _0x39229c?{'count':_0x44d7fe,'rows':_0x39229c}:null;}})[_0xc42d('0x39')](respondWithResult(_0x4bcee5,null))['catch'](handleError(_0x4bcee5,null));};exports[_0xc42d('0x7c')]=function(_0x382f57,_0xd022dc){var _0x31200c=_0x382f57[_0xc42d('0x65')]['id'];var _0x5baabb=_0x382f57['body'];var _0x414915=0xc8;var _0x384c13=null;return db[_0xc42d('0x7d')][_0xc42d('0x7e')]({'isolationLevel':db[_0xc42d('0x7d')][_0xc42d('0x7f')][_0xc42d('0x80')]['READ_COMMITTED']},function(_0x150b2c){return db['WhatsappAccount'][_0xc42d('0x6a')]({'where':{'id':_0x31200c},'transaction':_0x150b2c})['then'](function(_0x308be4){if(_0x308be4){return db[_0xc42d('0x81')][_0xc42d('0x3a')]({'where':{'WhatsappAccountId':_0x31200c},'transaction':_0x150b2c})[_0xc42d('0x39')](function(){var _0x1e5e3d=_['map'](_0x5baabb,function(_0x48e5dc){_0x48e5dc[_0xc42d('0x68')]=_0x31200c;return _0x48e5dc;});return db[_0xc42d('0x81')][_0xc42d('0x82')](_0x1e5e3d,{'transaction':_0x150b2c});});}else{_0x414915=0x194;_0x384c13=[];}});})['then'](function(){if(_0x414915!==0x194){return db[_0xc42d('0x81')][_0xc42d('0x83')]({'where':{'WhatsappAccountId':_0x31200c},'order':_0xc42d('0x84')})[_0xc42d('0x39')](function(_0x480955){_0x384c13=_0x480955;});}})['catch'](function(_0xb31b35){_0x414915=0x1f4;logger['error'](_0xb31b35['stack']);if(_0xb31b35[_0xc42d('0x3d')]){delete _0xb31b35[_0xc42d('0x3d')];}_0x384c13=_0xb31b35;})[_0xc42d('0x85')](function(){if(_0x384c13===null){_0xd022dc[_0xc42d('0x2b')](_0x414915);}else{if(_0x414915===0x1f4){_0xd022dc[_0xc42d('0x31')](_0x414915)['send'](_0x384c13);}else{_0xd022dc[_0xc42d('0x31')](_0x414915)[_0xc42d('0x34')](_0x384c13);}}});};exports['getApplications']=function(_0x539f3f,_0x5df6d1,_0x23b0ca){var _0x4a1cf9={};var _0x55862e={};var _0x3213d1;var _0x32bb53;return db[_0xc42d('0x43')][_0xc42d('0x6a')]({'where':{'id':_0x539f3f['params']['id']}})[_0xc42d('0x39')](handleEntityNotFound(_0x5df6d1,null))[_0xc42d('0x39')](function(_0x3873d1){if(_0x3873d1){_0x3213d1=_0x3873d1;_0x55862e[_0xc42d('0x47')]=_[_0xc42d('0x59')](db['WhatsappApplication'][_0xc42d('0x44')]);_0x55862e['query']=_[_0xc42d('0x59')](_0x539f3f[_0xc42d('0x48')]);_0x55862e[_0xc42d('0x51')]=_[_0xc42d('0x5a')](_0x55862e[_0xc42d('0x47')],_0x55862e['query']);_0x4a1cf9['attributes']=_[_0xc42d('0x5a')](_0x55862e['model'],qs['fields'](_0x539f3f[_0xc42d('0x48')][_0xc42d('0x4a')]));_0x4a1cf9[_0xc42d('0x49')]=_0x4a1cf9['attributes'][_0xc42d('0x4b')]?_0x4a1cf9['attributes']:_0x55862e['model'];_0x4a1cf9['order']=qs[_0xc42d('0x4f')](_0x539f3f[_0xc42d('0x48')][_0xc42d('0x4f')]);_0x4a1cf9[_0xc42d('0x50')]=qs[_0xc42d('0x51')](_[_0xc42d('0x52')](_0x539f3f[_0xc42d('0x48')],_0x55862e[_0xc42d('0x51')]));if(_0x539f3f[_0xc42d('0x48')][_0xc42d('0x53')]){_0x4a1cf9[_0xc42d('0x50')]=_[_0xc42d('0x6b')](_0x4a1cf9['where'],{'$or':_[_0xc42d('0x42')](_0x4a1cf9[_0xc42d('0x49')],function(_0x26f00e){var _0x2f246c={};_0x2f246c[_0x26f00e]={'$like':'%'+_0x539f3f['query']['filter']+'%'};return _0x2f246c;})});}_0x4a1cf9=_[_0xc42d('0x6b')]({},_0x4a1cf9,_0x539f3f[_0xc42d('0x55')]);return _0x3213d1[_0xc42d('0x86')](_0x4a1cf9);}})[_0xc42d('0x39')](function(_0x313b72){if(_0x313b72){_0x32bb53=_0x313b72[_0xc42d('0x4b')];if(!_0x539f3f['query'][_0xc42d('0x4c')](_0xc42d('0x4d'))){_0x4a1cf9[_0xc42d('0x2f')]=qs[_0xc42d('0x2f')](_0x539f3f[_0xc42d('0x48')][_0xc42d('0x2f')]);_0x4a1cf9[_0xc42d('0x2d')]=qs[_0xc42d('0x2d')](_0x539f3f[_0xc42d('0x48')][_0xc42d('0x2d')]);}return _0x3213d1[_0xc42d('0x86')](_0x4a1cf9);}})['then'](function(_0x2365f7){if(_0x2365f7){return _0x2365f7?{'count':_0x32bb53,'rows':_0x2365f7}:null;}})[_0xc42d('0x39')](respondWithResult(_0x5df6d1,null))['catch'](handleError(_0x5df6d1,null));};exports[_0xc42d('0x87')]=function(_0x3f49a2,_0x1d8836,_0x193c1d){var _0x181849={'channel':_0xc42d('0x88')};var _0x293eca=[];var _0x229c76=[];var _0x3c4d60={};return db[_0xc42d('0x43')][_0xc42d('0x5b')]({'where':{'id':_0x3f49a2[_0xc42d('0x65')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xc42d('0x89')}]})[_0xc42d('0x39')](handleEntityNotFound(_0x1d8836,null))['then'](function(_0x49db16){_0x181849[_0xc42d('0x8a')]=_0x49db16;if(_0x181849[_0xc42d('0x8a')]&&_0x181849[_0xc42d('0x8a')][_0xc42d('0x45')]===_0xc42d('0x8b')&&_0x3f49a2[_0xc42d('0x5d')]['statuses']){if(_0x3f49a2[_0xc42d('0x5d')]['statuses'][_0xc42d('0x4b')]===0x0)return;if(_0x3f49a2[_0xc42d('0x5d')][_0xc42d('0x8c')][0x0][_0xc42d('0x8d')]!==_0xc42d('0x8e'))return;return db['WhatsappMessage'][_0xc42d('0x38')]({'read':!![],'readAt':_0x3f49a2[_0xc42d('0x5d')][_0xc42d('0x8c')][0x0][_0xc42d('0x8f')]},{'where':{'messageId':_0x3f49a2[_0xc42d('0x5d')]['statuses'][0x0][_0xc42d('0x90')]},'individualHooks':!![]})[_0xc42d('0x39')](function(_0x58f020){return _0x1d8836['status'](0xc8)[_0xc42d('0x34')](_0x58f020);});}_0x181849[_0xc42d('0x91')]=_['orderBy'](_0x49db16[_0xc42d('0x89')],[_0xc42d('0x84')],[_0xc42d('0x92')]);if(_0x181849[_0xc42d('0x8a')][_0xc42d('0x89')]){delete _0x181849[_0xc42d('0x8a')][_0xc42d('0x89')];}return db[_0xc42d('0x93')][_0xc42d('0x66')]()[_0xc42d('0x39')](function(_0x56a35e){if(!_0x56a35e){throw new db[(_0xc42d('0x94'))][(_0xc42d('0x95'))](_0xc42d('0x96'));}_0x293eca=_[_0xc42d('0x97')](_[_0xc42d('0x59')](_0x56a35e),['createdAt',_0xc42d('0x98')]);_0x229c76=_[_0xc42d('0x97')](_[_0xc42d('0x59')](_0x56a35e),[_0xc42d('0x99'),_0xc42d('0x98'),_0xc42d('0x9a'),_0xc42d('0x9b')]);_0x181849[_0xc42d('0x5d')]={'mapKey':_0xc42d('0x9c')};if(_0x181849['account']&&_0x181849[_0xc42d('0x8a')][_0xc42d('0x45')]===_0xc42d('0x9d')){_0x181849['body'][_0xc42d('0x9e')]=_0x3f49a2[_0xc42d('0x5d')]['From'][_0xc42d('0x9f')](_0xc42d('0xa0'),'');_0x181849[_0xc42d('0x5d')]['body']=_0x3f49a2['body']['Body'];_0x181849[_0xc42d('0x5d')][_0xc42d('0xa1')]=_0x3f49a2[_0xc42d('0x5d')]['MessageSid'];}if(_0x181849[_0xc42d('0x8a')]&&_0x181849[_0xc42d('0x8a')][_0xc42d('0x45')]===_0xc42d('0x8b')){_0x181849[_0xc42d('0x5d')][_0xc42d('0x9e')]=_0x3f49a2[_0xc42d('0x5d')][_0xc42d('0xa2')][0x0][_0xc42d('0x9e')];_0x181849[_0xc42d('0x5d')][_0xc42d('0x5d')]=_0x3f49a2['body'][_0xc42d('0xa2')][0x0][_0xc42d('0x28')][_0xc42d('0x5d')];_0x181849['body'][_0xc42d('0xa1')]=_0x3f49a2['body'][_0xc42d('0xa2')][0x0][_0xc42d('0x90')];}if(_0x181849[_0xc42d('0x5d')]['id']){delete _0x181849[_0xc42d('0x5d')]['id'];}if(_[_0xc42d('0xa3')](_0x181849[_0xc42d('0x5d')][_0xc42d('0x9e')])){throw new db[(_0xc42d('0x94'))][(_0xc42d('0x95'))](_0xc42d('0xa4'));}if(_[_0xc42d('0xa3')](_0x181849[_0xc42d('0x5d')][_0xc42d('0x5d')])||_0x181849[_0xc42d('0x5d')][_0xc42d('0x5d')]===''){throw new db[(_0xc42d('0x94'))][(_0xc42d('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc42d('0xa3')](_0x181849['body'][_0xc42d('0xa5')])){throw new db[(_0xc42d('0x94'))]['ValidationError'](_0xc42d('0xa6')+_0x229c76);}if(!_[_0xc42d('0xa7')](_0x229c76,_0x181849[_0xc42d('0x5d')][_0xc42d('0xa5')])){throw new db[(_0xc42d('0x94'))][(_0xc42d('0x95'))](_0xc42d('0xa8')+_0x229c76);}_0x3c4d60[_0x181849['body'][_0xc42d('0xa5')]]=_0x181849[_0xc42d('0x5d')][_0xc42d('0x9e')];return db[_0xc42d('0xa9')][_0xc42d('0x5b')]({'where':{'id':_0x181849[_0xc42d('0x8a')][_0xc42d('0x9b')]},'include':[{'model':db[_0xc42d('0x93')],'as':_0xc42d('0xaa'),'where':_0x3c4d60,'limit':0x1,'order':[['updatedAt',_0xc42d('0xab')]]}]});})['then'](handleEntityNotFound(_0x1d8836,null))[_0xc42d('0x39')](function(_0x335dfd){if(_0x335dfd){_0x181849[_0xc42d('0xac')]=_[_0xc42d('0xad')](_0x335dfd,[_0xc42d('0xaa')]);if(_0x335dfd['Contacts'][_0xc42d('0x4b')]){return _0x335dfd[_0xc42d('0xaa')][0x0];}var _0x550d96=_[_0xc42d('0x1b')](_0x181849[_0xc42d('0x5d')],{'firstName':_0x181849[_0xc42d('0x5d')][_0xc42d('0x9e')],'ListId':_0x335dfd['id']});_0x550d96[_0x181849['body'][_0xc42d('0xa5')]]=_0x181849[_0xc42d('0x5d')][_0xc42d('0x9e')];return db[_0xc42d('0x93')]['create'](_0x550d96,{'fields':_0x293eca,'raw':!![]});}})[_0xc42d('0x39')](handleEntityNotFound(_0x1d8836,null))[_0xc42d('0x39')](function(_0xa026e9){if(_0xa026e9){_0x181849[_0xc42d('0xae')]=_0xa026e9;var _0x507e80={'ContactId':_0xa026e9['id'],'phone':_0x181849[_0xc42d('0x5d')]['from'],'WhatsappAccountId':_0x3f49a2['params']['id']};var _0x2b358d={'ContactId':_0xa026e9['id'],'WhatsappAccountId':_0x3f49a2[_0xc42d('0x65')]['id'],'closed':![]};return db[_0xc42d('0xaf')][_0xc42d('0x5b')]({'where':_0x2b358d})[_0xc42d('0x39')](function(_0x12d492){if(_0x12d492){return[_0x12d492,![]];}return db['WhatsappInteraction']['create'](_0x507e80)[_0xc42d('0x39')](function(_0xe11c9){return[_0xe11c9,!![]];});});}})['spread'](function(_0x206888,_0x456edf){_0x181849[_0xc42d('0xb0')]=_0x206888[_0xc42d('0x3b')]({'plain':!![]});_0x181849[_0xc42d('0xb0')][_0xc42d('0xb1')]=![];if(_0x456edf){if(_0x181849[_0xc42d('0x8a')]['autoclose']){_0x181849[_0xc42d('0x91')][_0xc42d('0xb2')]({'id':0x0,'priority':_0x181849[_0xc42d('0x91')][_0xc42d('0x4b')]+0x1,'app':_0xc42d('0xb3'),'appdata':_0xc42d('0xb4'),'interval':_0xc42d('0xb5')});}_0x181849[_0xc42d('0xb0')]['created']=!![];}return db[_0xc42d('0xb6')][_0xc42d('0x5c')]({'phone':_0x181849[_0xc42d('0x5d')]['from'],'messageId':_0x181849[_0xc42d('0x5d')][_0xc42d('0xa1')],'body':_0x181849[_0xc42d('0x5d')][_0xc42d('0x5d')],'WhatsappAccountId':_0x3f49a2[_0xc42d('0x65')]['id'],'WhatsappInteractionId':_0x206888['id'],'direction':'in','ContactId':_0x206888[_0xc42d('0xb7')],'AttachmentId':_0x181849[_0xc42d('0x5d')]['AttachmentId']});})[_0xc42d('0x39')](function(_0x2ee8ed){_0x181849[_0xc42d('0x28')]=_0x2ee8ed;if(!_0x181849[_0xc42d('0xb0')][_0xc42d('0xb8')])return;return db[_0xc42d('0x7b')]['find']({'attributes':['id',_0xc42d('0x3d')],'where':{'id':_0x181849[_0xc42d('0xb0')][_0xc42d('0xb8')]}});})[_0xc42d('0x39')](function(_0x5c806d){if(_0x5c806d){_0x181849[_0xc42d('0x91')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc42d('0xb9'),'appdata':_0x5c806d[_0xc42d('0x3d')]+','+(_0x181849[_0xc42d('0x8a')][_0xc42d('0xba')]||0xa),'interval':'*,*,*,*'});}if(!_0x181849[_0xc42d('0xb0')]['queueId'])return;return db['WhatsappQueue'][_0xc42d('0x5b')]({'attributes':['id',_0xc42d('0x3d')],'where':{'id':_0x181849[_0xc42d('0xb0')][_0xc42d('0xbb')]}});})[_0xc42d('0x39')](function(_0x6b6602){if(_0x6b6602){_0x181849[_0xc42d('0x91')][_0xc42d('0xbc')]({'id':0x0,'priority':0x1,'app':_0xc42d('0xbd'),'appdata':_0x6b6602[_0xc42d('0x3d')]+','+(_0x181849[_0xc42d('0x8a')][_0xc42d('0xbe')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc42d('0xbf'),_0xc42d('0xc0'),_0x181849);})[_0xc42d('0x39')](function(_0x2acded){if(_0x2acded){var _0x2b63b6=0xc8;var _0x2a3b5c=_0xc42d('0xc1');logger[_0xc42d('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2a3b5c,_0x2b63b6,_0xc42d('0xc2'));logger[_0xc42d('0xc3')](_0xc42d('0xc4'),_0x2a3b5c,_0x2b63b6,_0xc42d('0xc2'),JSON[_0xc42d('0x25')](_0x2acded));if(_0x181849[_0xc42d('0x8a')][_0xc42d('0x45')]===_0xc42d('0x9d')){return _0x1d8836[_0xc42d('0x31')](_0x2b63b6)[_0xc42d('0x32')](_0xc42d('0xc5'),_0xc42d('0xc6'))[_0xc42d('0x3e')](_0xc42d('0xc7'));}else{return _0x1d8836['status'](_0x2b63b6)['json'](_0x2acded);}}});})[_0xc42d('0x2a')](handleError(_0x1d8836,null));};exports['send']=function(_0x2add6f,_0x295fbc,_0x32af8e){var _0x447f51,_0x4c030c,_0x54a6d7;if(_['isNil'](_0x2add6f[_0xc42d('0x5d')][_0xc42d('0x5d')])||_0x2add6f[_0xc42d('0x5d')][_0xc42d('0x5d')]===''){throw new db[(_0xc42d('0x94'))][(_0xc42d('0x95'))](_0xc42d('0xc8'));}if(_[_0xc42d('0xa3')](_0x2add6f[_0xc42d('0x5d')]['to'])){throw new db['Sequelize']['ValidationError'](_0xc42d('0xc9'));}_0x447f51=_0x2add6f['body']['to'];return db[_0xc42d('0x43')][_0xc42d('0x5b')]({'where':{'id':_0x2add6f[_0xc42d('0x65')]['id']},'include':[{'model':db[_0xc42d('0xa9')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc42d('0xaa'),'where':{'mobile':_0x447f51},'limit':0x1,'order':[[_0xc42d('0x98'),_0xc42d('0xab')]]}]}]})[_0xc42d('0x39')](handleEntityNotFound(_0x295fbc,null))[_0xc42d('0x39')](function(_0x3f84fe){if(_0x3f84fe&&_0x3f84fe['List']){_0x4c030c=_0x3f84fe[_0xc42d('0x3b')]({'plain':!![]});if(_0x4c030c[_0xc42d('0xca')]&&_0x4c030c[_0xc42d('0xca')][_0xc42d('0xaa')][_0xc42d('0x4b')]){return _0x4c030c[_0xc42d('0xca')][_0xc42d('0xaa')][0x0];}return db[_0xc42d('0x93')][_0xc42d('0x5c')](_['defaults'](_0x2add6f[_0xc42d('0x5d')],{'firstName':_0x447f51,'mobile':_0x447f51,'phone':_0x447f51,'ListId':_0x4c030c['ListId']}));}})[_0xc42d('0x39')](handleEntityNotFound(_0x295fbc,null))[_0xc42d('0x39')](function(_0x23c160){if(_0x23c160){_0x54a6d7=_0x23c160;return db[_0xc42d('0xaf')][_0xc42d('0x5b')]({'where':{'ContactId':_0x54a6d7['id'],'closed':![],'WhatsappAccountId':_0x4c030c['id']}})[_0xc42d('0x39')](function(_0x151298){if(_0x151298){return[_0x151298,![]];}return db[_0xc42d('0xaf')]['create']({'UserId':_0x2add6f[_0xc42d('0xcb')]['id'],'ContactId':_0x54a6d7['id'],'WhatsappAccountId':_0x4c030c['id'],'phone':_0x447f51,'firstMsgDirection':_0xc42d('0xcc'),'Messages':[_[_0xc42d('0x6b')](_0x2add6f[_0xc42d('0x5d')],{'read':![],'body':_0x2add6f[_0xc42d('0x5d')][_0xc42d('0x5d')],'phone':_0x447f51,'WhatsappAccountId':_0x4c030c['id'],'UserId':_0x2add6f[_0xc42d('0xcb')]['id'],'ContactId':_0x54a6d7['id']})]},{'include':[{'model':db[_0xc42d('0xb6')],'as':_0xc42d('0xcd')}]})[_0xc42d('0x39')](function(_0x43fd04){return[_0x43fd04,!![]];});});}})[_0xc42d('0x74')](function(_0x2be7c8,_0x3b23b1){if(_0x3b23b1){return _0x2be7c8;}return db[_0xc42d('0xb6')][_0xc42d('0x5c')](_['merge'](_0x2add6f[_0xc42d('0x5d')],{'read':![],'body':_0x2add6f[_0xc42d('0x5d')]['body'],'phone':_0x447f51,'WhatsappAccountId':_0x4c030c['id'],'WhatsappInteractionId':_0x2be7c8['id'],'UserId':_0x2add6f[_0xc42d('0xcb')]['id'],'ContactId':_0x54a6d7['id']}))[_0xc42d('0x39')](function(_0x113d10){_0x2be7c8[_0xc42d('0xce')][_0xc42d('0xcd')]=[];_0x2be7c8[_0xc42d('0xce')][_0xc42d('0xcd')][_0xc42d('0xb2')](_0x113d10[_0xc42d('0xce')]);return _0x2be7c8;});})['then'](respondWithResult(_0x295fbc,null))['catch'](handleError(_0x295fbc,null));}; \ No newline at end of file +var _0xe1b5=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','register','client','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappAccount','findAll','rows','show','keys','rawAttributes','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','ids','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','replace','Body','MessageSid','from','notifications','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','defaults','contact','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','Start','startRouting','info','entity\x20found','stringify','set','Content-Type','text/xml','send','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','rimraf'];(function(_0x4dfce8,_0x2a9880){var _0x488a8c=function(_0xcf49e5){while(--_0xcf49e5){_0x4dfce8['push'](_0x4dfce8['shift']());}};_0x488a8c(++_0x2a9880);}(_0xe1b5,0xc2));var _0x5e1b=function(_0xf4990c,_0x37b7a7){_0xf4990c=_0xf4990c-0x0;var _0x171da9=_0xe1b5[_0xf4990c];return _0x171da9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e1b('0x0'));var zipdir=require(_0x5e1b('0x1'));var jsonpatch=require(_0x5e1b('0x2'));var rp=require('request-promise');var moment=require(_0x5e1b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e1b('0x4'));var util=require(_0x5e1b('0x5'));var path=require(_0x5e1b('0x6'));var sox=require(_0x5e1b('0x7'));var csv=require(_0x5e1b('0x8'));var ejs=require(_0x5e1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e1b('0xa'));var crypto=require('crypto');var jsforce=require(_0x5e1b('0xb'));var deskjs=require(_0x5e1b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5e1b('0xd'));var Redis=require(_0x5e1b('0xe'));var authService=require(_0x5e1b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5e1b('0x10'));var hardwareService=require(_0x5e1b('0x11'));var logger=require(_0x5e1b('0x12'))(_0x5e1b('0x13'));var utils=require('../../config/utils');var config=require(_0x5e1b('0x14'));var licenseUtil=require(_0x5e1b('0x15'));var db=require(_0x5e1b('0x16'))['db'];config['redis']=_['defaults'](config[_0x5e1b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e1b('0x18'))(new Redis(config[_0x5e1b('0x17')]));require(_0x5e1b('0x19'))[_0x5e1b('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5e1b('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x421e33,_0x4cfb85,_0x344843,_0x362d78){return new BPromise(function(_0x47c715,_0x430aee){var _0x16db54=_0x362d78||client;return _0x16db54['request'](_0x421e33,_0x344843)[_0x5e1b('0x1c')](function(_0x143ed8){logger['info'](_0x5e1b('0x1d'),_0x4cfb85,_0x5e1b('0x1e'));logger[_0x5e1b('0x1f')](_0x5e1b('0x20'),_0x4cfb85,_0x5e1b('0x1e'),JSON['stringify'](_0x143ed8));if(_0x143ed8[_0x5e1b('0x21')]){if(_0x143ed8[_0x5e1b('0x21')][_0x5e1b('0x22')]===0x1f4){logger[_0x5e1b('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x4cfb85,_0x143ed8[_0x5e1b('0x21')]['message']);return _0x430aee(_0x143ed8['error']['message']);}logger[_0x5e1b('0x21')](_0x5e1b('0x1d'),_0x4cfb85,_0x143ed8['error'][_0x5e1b('0x23')]);return _0x47c715(_0x143ed8[_0x5e1b('0x21')][_0x5e1b('0x23')]);}else{logger['info'](_0x5e1b('0x1d'),_0x4cfb85,_0x5e1b('0x1e'));_0x47c715(_0x143ed8[_0x5e1b('0x24')][_0x5e1b('0x23')]);}})[_0x5e1b('0x25')](function(_0x5a9abb){logger['error'](_0x5e1b('0x1d'),_0x4cfb85,_0x5a9abb);_0x430aee(_0x5a9abb);});});}function respondWithStatusCode(_0x22f63e,_0x530968){_0x530968=_0x530968||0xcc;return function(_0x5e72e3){if(_0x5e72e3){return _0x22f63e[_0x5e1b('0x26')](_0x530968);}return _0x22f63e[_0x5e1b('0x27')](_0x530968)['end']();};}function respondWithResult(_0x3eafdd,_0x294de3){_0x294de3=_0x294de3||0xc8;return function(_0x422919){if(_0x422919){return _0x3eafdd[_0x5e1b('0x27')](_0x294de3)[_0x5e1b('0x28')](_0x422919);}};}function respondWithFilteredResult(_0x346565,_0x8b1766){return function(_0x5b6e85){if(_0x5b6e85){var _0x58f97a=typeof _0x8b1766['offset']===_0x5e1b('0x29')&&typeof _0x8b1766[_0x5e1b('0x2a')]===_0x5e1b('0x29');var _0x1d2f21=_0x5b6e85['count'];var _0x477b9f=_0x58f97a?0x0:_0x8b1766[_0x5e1b('0x2b')];var _0x4c5506=_0x58f97a?_0x5b6e85[_0x5e1b('0x2c')]:_0x8b1766['offset']+_0x8b1766['limit'];var _0x4da395;if(_0x4c5506>=_0x1d2f21){_0x4c5506=_0x1d2f21;_0x4da395=0xc8;}else{_0x4da395=0xce;}_0x346565['status'](_0x4da395);return _0x346565['set'](_0x5e1b('0x2d'),_0x477b9f+'-'+_0x4c5506+'/'+_0x1d2f21)[_0x5e1b('0x28')](_0x5b6e85);}return null;};}function patchUpdates(_0x51cce8){return function(_0x4b8b46){try{jsonpatch[_0x5e1b('0x2e')](_0x4b8b46,_0x51cce8,!![]);}catch(_0x5f1799){return BPromise['reject'](_0x5f1799);}return _0x4b8b46[_0x5e1b('0x2f')]();};}function saveUpdates(_0x4bd213,_0x42e954){return function(_0x26f74b){if(_0x26f74b){return _0x26f74b[_0x5e1b('0x30')](_0x4bd213)[_0x5e1b('0x1c')](function(_0xa007c3){return _0xa007c3;});}return null;};}function removeEntity(_0x51ad7,_0x143489){return function(_0x4a9e34){if(_0x4a9e34){return _0x4a9e34[_0x5e1b('0x31')]()[_0x5e1b('0x1c')](function(){var _0x2c4f2c=_0x4a9e34[_0x5e1b('0x32')]({'plain':!![]});var _0x4943b0='WhatsappAccounts';return db[_0x5e1b('0x33')][_0x5e1b('0x31')]({'where':{'type':_0x4943b0,'resourceId':_0x2c4f2c['id']}})[_0x5e1b('0x1c')](function(){return _0x4a9e34;});})[_0x5e1b('0x1c')](function(){_0x51ad7['status'](0xcc)[_0x5e1b('0x34')]();});}};}function handleEntityNotFound(_0x4880a7,_0x5a6728){return function(_0x3bb8d6){if(!_0x3bb8d6){_0x4880a7['sendStatus'](0x194);}return _0x3bb8d6;};}function handleError(_0xbc0270,_0x3eb256){_0x3eb256=_0x3eb256||0x1f4;return function(_0x592416){logger['error'](_0x592416[_0x5e1b('0x35')]);if(_0x592416[_0x5e1b('0x36')]){delete _0x592416[_0x5e1b('0x36')];}_0xbc0270['status'](_0x3eb256)['send'](_0x592416);};}exports[_0x5e1b('0x37')]=function(_0x2cb49a,_0x2d6eac){var _0x9ee489={'include':[{'model':db[_0x5e1b('0x38')],'as':_0x5e1b('0x39')}]},_0x5c105b={},_0x530155={'count':0x0,'rows':[]};var _0x12c048=_[_0x5e1b('0x3a')](db['WhatsappAccount']['rawAttributes'],function(_0x3dd166){return{'name':_0x3dd166['fieldName'],'type':_0x3dd166[_0x5e1b('0x3b')][_0x5e1b('0x3c')]};});_0x5c105b[_0x5e1b('0x3d')]=_['map'](_0x12c048,'name');_0x5c105b['query']=_['keys'](_0x2cb49a[_0x5e1b('0x3e')]);_0x5c105b[_0x5e1b('0x3f')]=_[_0x5e1b('0x40')](_0x5c105b['model'],_0x5c105b[_0x5e1b('0x3e')]);_0x9ee489[_0x5e1b('0x41')]=_['intersection'](_0x5c105b[_0x5e1b('0x3d')],qs[_0x5e1b('0x42')](_0x2cb49a['query'][_0x5e1b('0x42')]));_0x9ee489['attributes']=_0x9ee489[_0x5e1b('0x41')][_0x5e1b('0x43')]?_0x9ee489['attributes']:_0x5c105b['model'];if(!_0x2cb49a[_0x5e1b('0x3e')]['hasOwnProperty'](_0x5e1b('0x44'))){_0x9ee489[_0x5e1b('0x2a')]=qs[_0x5e1b('0x2a')](_0x2cb49a['query'][_0x5e1b('0x2a')]);_0x9ee489[_0x5e1b('0x2b')]=qs[_0x5e1b('0x2b')](_0x2cb49a[_0x5e1b('0x3e')][_0x5e1b('0x2b')]);}_0x9ee489['order']=qs[_0x5e1b('0x45')](_0x2cb49a[_0x5e1b('0x3e')][_0x5e1b('0x45')]);_0x9ee489['where']=qs[_0x5e1b('0x3f')](_[_0x5e1b('0x46')](_0x2cb49a[_0x5e1b('0x3e')],_0x5c105b[_0x5e1b('0x3f')]),_0x12c048);if(_0x2cb49a[_0x5e1b('0x3e')][_0x5e1b('0x47')]){_0x9ee489[_0x5e1b('0x48')]=_[_0x5e1b('0x49')](_0x9ee489[_0x5e1b('0x48')],{'$or':_[_0x5e1b('0x3a')](_0x12c048,function(_0x482fa3){if(_0x482fa3[_0x5e1b('0x3b')]!==_0x5e1b('0x4a')){var _0x5c8552={};_0x5c8552[_0x482fa3['name']]={'$like':'%'+_0x2cb49a[_0x5e1b('0x3e')][_0x5e1b('0x47')]+'%'};return _0x5c8552;}})});}_0x9ee489=_['merge']({},_0x9ee489,_0x2cb49a[_0x5e1b('0x4b')]);var _0x358d55={'where':_0x9ee489[_0x5e1b('0x48')]};return db[_0x5e1b('0x4c')]['count'](_0x358d55)[_0x5e1b('0x1c')](function(_0x31ef8b){_0x530155[_0x5e1b('0x2c')]=_0x31ef8b;if(_0x2cb49a[_0x5e1b('0x3e')]['includeAll']){_0x9ee489['include']=[{'all':!![]}];}return db[_0x5e1b('0x4c')][_0x5e1b('0x4d')](_0x9ee489);})[_0x5e1b('0x1c')](function(_0x4e3c0f){_0x530155[_0x5e1b('0x4e')]=_0x4e3c0f;return _0x530155;})['then'](respondWithFilteredResult(_0x2d6eac,_0x9ee489))['catch'](handleError(_0x2d6eac,null));};exports[_0x5e1b('0x4f')]=function(_0x653878,_0x194f32){var _0x21c335={'raw':![],'where':{'id':_0x653878['params']['id']},'include':[{'model':db[_0x5e1b('0x38')],'as':_0x5e1b('0x39')}]},_0x21e00d={};_0x21e00d[_0x5e1b('0x3d')]=_[_0x5e1b('0x50')](db['WhatsappAccount'][_0x5e1b('0x51')]);_0x21e00d[_0x5e1b('0x3e')]=_[_0x5e1b('0x50')](_0x653878[_0x5e1b('0x3e')]);_0x21e00d[_0x5e1b('0x3f')]=_['intersection'](_0x21e00d[_0x5e1b('0x3d')],_0x21e00d['query']);_0x21c335['attributes']=_[_0x5e1b('0x40')](_0x21e00d[_0x5e1b('0x3d')],qs['fields'](_0x653878['query'][_0x5e1b('0x42')]));_0x21c335[_0x5e1b('0x41')]=_0x21c335[_0x5e1b('0x41')]['length']?_0x21c335[_0x5e1b('0x41')]:_0x21e00d['model'];if(_0x653878[_0x5e1b('0x3e')][_0x5e1b('0x52')]){_0x21c335[_0x5e1b('0x53')]=[{'all':!![]}];}_0x21c335=_[_0x5e1b('0x49')]({},_0x21c335,_0x653878[_0x5e1b('0x4b')]);return db[_0x5e1b('0x4c')]['find'](_0x21c335)[_0x5e1b('0x1c')](handleEntityNotFound(_0x194f32,null))[_0x5e1b('0x1c')](respondWithResult(_0x194f32,null))[_0x5e1b('0x25')](handleError(_0x194f32,null));};exports[_0x5e1b('0x54')]=function(_0x3e2962,_0x26f625){return db[_0x5e1b('0x4c')][_0x5e1b('0x54')](_0x3e2962[_0x5e1b('0x55')],{})[_0x5e1b('0x1c')](function(_0x1d2c3e){var _0x5cb0f0=_0x3e2962[_0x5e1b('0x56')][_0x5e1b('0x32')]({'plain':!![]});if(!_0x5cb0f0)throw new Error(_0x5e1b('0x57'));if(_0x5cb0f0[_0x5e1b('0x58')]==='user'){var _0x3002e7=_0x1d2c3e['get']({'plain':!![]});var _0x4147be=_0x5e1b('0x59');return db['UserProfileSection'][_0x5e1b('0x5a')]({'where':{'name':_0x4147be,'userProfileId':_0x5cb0f0[_0x5e1b('0x5b')]},'raw':!![]})[_0x5e1b('0x1c')](function(_0x35c11c){if(_0x35c11c&&_0x35c11c['autoAssociation']===0x0){return db[_0x5e1b('0x33')]['create']({'name':_0x3002e7[_0x5e1b('0x36')],'resourceId':_0x3002e7['id'],'type':_0x35c11c[_0x5e1b('0x36')],'sectionId':_0x35c11c['id']},{})[_0x5e1b('0x1c')](function(){return _0x1d2c3e;});}else{return _0x1d2c3e;}})[_0x5e1b('0x25')](function(_0x279958){logger[_0x5e1b('0x21')](_0x5e1b('0x5c'),_0x279958);throw _0x279958;});}return _0x1d2c3e;})['then'](respondWithResult(_0x26f625,0xc9))['catch'](handleError(_0x26f625,null));};exports[_0x5e1b('0x30')]=function(_0x30336a,_0x19ed93){if(_0x30336a[_0x5e1b('0x55')]['id']){delete _0x30336a['body']['id'];}return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x30336a['params']['id']},'include':[{'model':db[_0x5e1b('0x38')],'as':_0x5e1b('0x39')}]})[_0x5e1b('0x1c')](handleEntityNotFound(_0x19ed93,null))['then'](saveUpdates(_0x30336a[_0x5e1b('0x55')],null))[_0x5e1b('0x1c')](respondWithResult(_0x19ed93,null))[_0x5e1b('0x25')](handleError(_0x19ed93,null));};exports[_0x5e1b('0x31')]=function(_0x3ba11c,_0x36c73c){return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x3ba11c[_0x5e1b('0x5d')]['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x36c73c,null))[_0x5e1b('0x1c')](removeEntity(_0x36c73c,null))['catch'](handleError(_0x36c73c,null));};exports[_0x5e1b('0x5e')]=function(_0x246163,_0x4bd821){return db['WhatsappAccount']['describe']()[_0x5e1b('0x1c')](respondWithResult(_0x4bd821,null))['catch'](handleError(_0x4bd821,null));};exports['addDisposition']=function(_0x16e104,_0x503339,_0x5a87c0){if(_0x16e104[_0x5e1b('0x55')]['id']){delete _0x16e104['body']['id'];}return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x16e104['params']['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x503339,null))[_0x5e1b('0x1c')](function(_0x2566d3){if(_0x2566d3){_0x16e104[_0x5e1b('0x55')][_0x5e1b('0x5f')]=_0x2566d3['id'];return db[_0x5e1b('0x60')][_0x5e1b('0x54')](_0x16e104[_0x5e1b('0x55')]);}})[_0x5e1b('0x1c')](respondWithResult(_0x503339,null))['catch'](handleError(_0x503339,null));};exports[_0x5e1b('0x61')]=function(_0x39f943,_0x2571ce,_0x4f2dd0){var _0x3de084={'raw':![],'where':{}};var _0x5a2bbf={};var _0x4bfc54={'count':0x0,'rows':[]};return db[_0x5e1b('0x4c')][_0x5e1b('0x62')]({'where':{'id':_0x39f943[_0x5e1b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2571ce,null))['then'](function(_0x2ebad8){if(_0x2ebad8){_0x5a2bbf[_0x5e1b('0x3d')]=_[_0x5e1b('0x50')](db[_0x5e1b('0x60')][_0x5e1b('0x51')]);_0x5a2bbf[_0x5e1b('0x3e')]=_['keys'](_0x39f943['query']);_0x5a2bbf[_0x5e1b('0x3f')]=_[_0x5e1b('0x40')](_0x5a2bbf[_0x5e1b('0x3d')],_0x5a2bbf[_0x5e1b('0x3e')]);_0x3de084[_0x5e1b('0x41')]=_['intersection'](_0x5a2bbf[_0x5e1b('0x3d')],qs[_0x5e1b('0x42')](_0x39f943['query']['fields']));_0x3de084['attributes']=_0x3de084['attributes'][_0x5e1b('0x43')]?_0x3de084[_0x5e1b('0x41')]:_0x5a2bbf[_0x5e1b('0x3d')];if(!_0x39f943['query'][_0x5e1b('0x63')](_0x5e1b('0x44'))){_0x3de084[_0x5e1b('0x2a')]=qs[_0x5e1b('0x2a')](_0x39f943[_0x5e1b('0x3e')]['limit']);_0x3de084[_0x5e1b('0x2b')]=qs[_0x5e1b('0x2b')](_0x39f943[_0x5e1b('0x3e')]['offset']);}_0x3de084[_0x5e1b('0x64')]=qs['sort'](_0x39f943[_0x5e1b('0x3e')][_0x5e1b('0x45')]);_0x3de084[_0x5e1b('0x48')]=qs[_0x5e1b('0x3f')](_[_0x5e1b('0x46')](_0x39f943['query'],_0x5a2bbf[_0x5e1b('0x3f')]));_0x3de084[_0x5e1b('0x48')][_0x5e1b('0x5f')]=_0x2ebad8['id'];if(_0x39f943[_0x5e1b('0x3e')]['filter']){_0x3de084['where']=_[_0x5e1b('0x49')](_0x3de084['where'],{'$or':_[_0x5e1b('0x3a')](_0x3de084['attributes'],function(_0x588c60){var _0x53241a={};_0x53241a[_0x588c60]={'$like':'%'+_0x39f943[_0x5e1b('0x3e')][_0x5e1b('0x47')]+'%'};return _0x53241a;})});}_0x3de084=_[_0x5e1b('0x49')]({},_0x3de084,_0x39f943[_0x5e1b('0x4b')]);return db[_0x5e1b('0x60')][_0x5e1b('0x2c')]({'where':_0x3de084['where']})[_0x5e1b('0x1c')](function(_0x39c32f){_0x4bfc54[_0x5e1b('0x2c')]=_0x39c32f;if(_0x39f943[_0x5e1b('0x3e')][_0x5e1b('0x52')]){_0x3de084['include']=[{'all':!![]}];}return db[_0x5e1b('0x60')]['findAll'](_0x3de084);})[_0x5e1b('0x1c')](function(_0x2d41c8){_0x4bfc54[_0x5e1b('0x4e')]=_0x2d41c8;return _0x4bfc54;});}})[_0x5e1b('0x1c')](respondWithFilteredResult(_0x2571ce,_0x3de084))['catch'](handleError(_0x2571ce,null));};exports['removeDispositions']=function(_0x2d897c,_0x417131,_0x42dfa6){return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x2d897c['params']['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x417131,null))[_0x5e1b('0x1c')](function(_0x308fb5){if(_0x308fb5){return _0x308fb5[_0x5e1b('0x65')](_0x2d897c[_0x5e1b('0x3e')]['ids']);}})[_0x5e1b('0x1c')](respondWithStatusCode(_0x417131,null))[_0x5e1b('0x25')](handleError(_0x417131,null));};exports[_0x5e1b('0x66')]=function(_0x214d63,_0x366dcf,_0x2224cd){if(_0x214d63[_0x5e1b('0x55')]['id']){delete _0x214d63[_0x5e1b('0x55')]['id'];}return db[_0x5e1b('0x4c')]['find']({'where':{'id':_0x214d63[_0x5e1b('0x5d')]['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x366dcf,null))[_0x5e1b('0x1c')](function(_0x5a9bd0){if(_0x5a9bd0){_0x214d63[_0x5e1b('0x55')][_0x5e1b('0x5f')]=_0x5a9bd0['id'];return db['CannedAnswer']['create'](_0x214d63['body']);}})['then'](respondWithResult(_0x366dcf,null))[_0x5e1b('0x25')](handleError(_0x366dcf,null));};exports[_0x5e1b('0x67')]=function(_0xa01c7a,_0x3eb627,_0x47f4cb){var _0x9a7752={'raw':![],'where':{}};var _0x41c0e4={};var _0x41247a={'count':0x0,'rows':[]};return db[_0x5e1b('0x4c')][_0x5e1b('0x62')]({'where':{'id':_0xa01c7a[_0x5e1b('0x5d')]['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x3eb627,null))[_0x5e1b('0x1c')](function(_0x5ee0c8){if(_0x5ee0c8){_0x41c0e4[_0x5e1b('0x3d')]=_[_0x5e1b('0x50')](db[_0x5e1b('0x68')][_0x5e1b('0x51')]);_0x41c0e4[_0x5e1b('0x3e')]=_[_0x5e1b('0x50')](_0xa01c7a[_0x5e1b('0x3e')]);_0x41c0e4[_0x5e1b('0x3f')]=_[_0x5e1b('0x40')](_0x41c0e4[_0x5e1b('0x3d')],_0x41c0e4[_0x5e1b('0x3e')]);_0x9a7752['attributes']=_[_0x5e1b('0x40')](_0x41c0e4['model'],qs['fields'](_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x42')]));_0x9a7752['attributes']=_0x9a7752[_0x5e1b('0x41')][_0x5e1b('0x43')]?_0x9a7752[_0x5e1b('0x41')]:_0x41c0e4[_0x5e1b('0x3d')];if(!_0xa01c7a['query'][_0x5e1b('0x63')](_0x5e1b('0x44'))){_0x9a7752['limit']=qs['limit'](_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x2a')]);_0x9a7752[_0x5e1b('0x2b')]=qs['offset'](_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x2b')]);}_0x9a7752[_0x5e1b('0x64')]=qs[_0x5e1b('0x45')](_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x45')]);_0x9a7752['where']=qs[_0x5e1b('0x3f')](_['pick'](_0xa01c7a[_0x5e1b('0x3e')],_0x41c0e4['filters']));_0x9a7752[_0x5e1b('0x48')]['WhatsappAccountId']=_0x5ee0c8['id'];if(_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x47')]){_0x9a7752[_0x5e1b('0x48')]=_[_0x5e1b('0x49')](_0x9a7752[_0x5e1b('0x48')],{'$or':_[_0x5e1b('0x3a')](_0x9a7752['attributes'],function(_0x26dc16){var _0x819a50={};_0x819a50[_0x26dc16]={'$like':'%'+_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x47')]+'%'};return _0x819a50;})});}_0x9a7752=_[_0x5e1b('0x49')]({},_0x9a7752,_0xa01c7a[_0x5e1b('0x4b')]);return db[_0x5e1b('0x68')][_0x5e1b('0x2c')]({'where':_0x9a7752[_0x5e1b('0x48')]})['then'](function(_0x4781e8){_0x41247a['count']=_0x4781e8;if(_0xa01c7a[_0x5e1b('0x3e')][_0x5e1b('0x52')]){_0x9a7752[_0x5e1b('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5e1b('0x4d')](_0x9a7752);})[_0x5e1b('0x1c')](function(_0x228111){_0x41247a[_0x5e1b('0x4e')]=_0x228111;return _0x41247a;});}})[_0x5e1b('0x1c')](respondWithFilteredResult(_0x3eb627,_0x9a7752))[_0x5e1b('0x25')](handleError(_0x3eb627,null));};exports[_0x5e1b('0x69')]=function(_0x5c494b,_0x4e2378,_0x58bb97){return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x5c494b[_0x5e1b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4e2378,null))[_0x5e1b('0x1c')](function(_0x2f7319){if(_0x2f7319){return _0x2f7319['removeAnswers'](_0x5c494b[_0x5e1b('0x3e')]['ids']);}})[_0x5e1b('0x1c')](respondWithStatusCode(_0x4e2378,null))[_0x5e1b('0x25')](handleError(_0x4e2378,null));};exports[_0x5e1b('0x6a')]=function(_0x25c26e,_0x3f787a,_0x4500ff){return db[_0x5e1b('0x4c')]['find']({'where':{'id':_0x25c26e['params']['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x3f787a,null))[_0x5e1b('0x1c')](function(_0x4a6084){if(_0x4a6084){return _0x4a6084[_0x5e1b('0x6a')](_0x25c26e[_0x5e1b('0x55')][_0x5e1b('0x6b')],_[_0x5e1b('0x6c')](_0x25c26e[_0x5e1b('0x55')],[_0x5e1b('0x6b'),'id'])||{})['spread'](function(_0x582d93){for(var _0x4c4684=0x0;_0x4c4684<_0x25c26e[_0x5e1b('0x55')][_0x5e1b('0x6b')][_0x5e1b('0x43')];_0x4c4684+=0x1){socket[_0x5e1b('0x6d')](_0x5e1b('0x6e'),{'UserId':Number(_0x25c26e[_0x5e1b('0x55')][_0x5e1b('0x6b')][_0x4c4684]),'WhatsappAccountId':Number(_0x25c26e['params']['id'])});}return _0x582d93;});}})['then'](respondWithResult(_0x3f787a,null))[_0x5e1b('0x25')](handleError(_0x3f787a,null));};exports[_0x5e1b('0x6f')]=function(_0x5a5471,_0x3c3722,_0x3dc4ac){return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x5a5471[_0x5e1b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3c3722,null))['then'](function(_0x812aa4){if(_0x812aa4){return _0x812aa4['removeAgents'](_0x5a5471['query'][_0x5e1b('0x6b')])[_0x5e1b('0x1c')](function(){if(_[_0x5e1b('0x70')](_0x5a5471[_0x5e1b('0x3e')]['ids'])){for(var _0x2f830c=0x0;_0x2f830c<_0x5a5471[_0x5e1b('0x3e')][_0x5e1b('0x6b')][_0x5e1b('0x43')];_0x2f830c+=0x1){socket[_0x5e1b('0x6d')](_0x5e1b('0x71'),{'UserId':Number(_0x5a5471[_0x5e1b('0x3e')]['ids'][_0x2f830c]),'WhatsappAccountId':Number(_0x5a5471['params']['id'])});}}else{socket[_0x5e1b('0x6d')](_0x5e1b('0x71'),{'UserId':Number(_0x5a5471['query']['ids']),'WhatsappAccountId':Number(_0x5a5471[_0x5e1b('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c3722,null))[_0x5e1b('0x25')](handleError(_0x3c3722,null));};exports[_0x5e1b('0x72')]=function(_0x3e9a6c,_0x544f7e,_0x1c546e){var _0x35c65f={};var _0x432c52={};var _0x22fee4;var _0x4cc45c;return db['WhatsappAccount'][_0x5e1b('0x62')]({'where':{'id':_0x3e9a6c[_0x5e1b('0x5d')]['id']}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x544f7e,null))['then'](function(_0x3372be){if(_0x3372be){_0x22fee4=_0x3372be;_0x432c52['model']=_['keys'](db[_0x5e1b('0x73')][_0x5e1b('0x51')]);_0x432c52[_0x5e1b('0x3e')]=_[_0x5e1b('0x50')](_0x3e9a6c['query']);_0x432c52['filters']=_[_0x5e1b('0x40')](_0x432c52[_0x5e1b('0x3d')],_0x432c52['query']);_0x35c65f[_0x5e1b('0x41')]=_[_0x5e1b('0x40')](_0x432c52[_0x5e1b('0x3d')],qs[_0x5e1b('0x42')](_0x3e9a6c[_0x5e1b('0x3e')]['fields']));_0x35c65f[_0x5e1b('0x41')]=_0x35c65f['attributes'][_0x5e1b('0x43')]?_0x35c65f[_0x5e1b('0x41')]:_0x432c52[_0x5e1b('0x3d')];_0x35c65f['order']=qs[_0x5e1b('0x45')](_0x3e9a6c[_0x5e1b('0x3e')]['sort']);_0x35c65f[_0x5e1b('0x48')]=qs[_0x5e1b('0x3f')](_['pick'](_0x3e9a6c['query'],_0x432c52['filters']));if(_0x3e9a6c['query'][_0x5e1b('0x47')]){_0x35c65f['where']=_[_0x5e1b('0x49')](_0x35c65f[_0x5e1b('0x48')],{'$or':_[_0x5e1b('0x3a')](_0x35c65f[_0x5e1b('0x41')],function(_0x5e6c3f){var _0x5e8bbf={};_0x5e8bbf[_0x5e6c3f]={'$like':'%'+_0x3e9a6c[_0x5e1b('0x3e')]['filter']+'%'};return _0x5e8bbf;})});}_0x35c65f=_[_0x5e1b('0x49')]({},_0x35c65f,_0x3e9a6c[_0x5e1b('0x4b')]);return _0x22fee4[_0x5e1b('0x72')](_0x35c65f);}})[_0x5e1b('0x1c')](function(_0x4ca1c9){if(_0x4ca1c9){_0x4cc45c=_0x4ca1c9[_0x5e1b('0x43')];if(!_0x3e9a6c[_0x5e1b('0x3e')][_0x5e1b('0x63')]('nolimit')){_0x35c65f[_0x5e1b('0x2a')]=qs['limit'](_0x3e9a6c[_0x5e1b('0x3e')][_0x5e1b('0x2a')]);_0x35c65f[_0x5e1b('0x2b')]=qs['offset'](_0x3e9a6c[_0x5e1b('0x3e')][_0x5e1b('0x2b')]);}return _0x22fee4[_0x5e1b('0x72')](_0x35c65f);}})[_0x5e1b('0x1c')](function(_0x1b2bd3){if(_0x1b2bd3){return _0x1b2bd3?{'count':_0x4cc45c,'rows':_0x1b2bd3}:null;}})[_0x5e1b('0x1c')](respondWithResult(_0x544f7e,null))[_0x5e1b('0x25')](handleError(_0x544f7e,null));};exports[_0x5e1b('0x74')]=function(_0x3a384b,_0x129b7a){var _0x247b7f=_0x3a384b['params']['id'];var _0x6b43e6=_0x3a384b[_0x5e1b('0x55')];var _0x4153dc=0xc8;var _0x2e13ad=null;return db['sequelize'][_0x5e1b('0x75')]({'isolationLevel':db['sequelize']['Transaction'][_0x5e1b('0x76')][_0x5e1b('0x77')]},function(_0x48e8bc){return db[_0x5e1b('0x4c')][_0x5e1b('0x62')]({'where':{'id':_0x247b7f},'transaction':_0x48e8bc})[_0x5e1b('0x1c')](function(_0x3dc6b3){if(_0x3dc6b3){return db[_0x5e1b('0x78')][_0x5e1b('0x31')]({'where':{'WhatsappAccountId':_0x247b7f},'transaction':_0x48e8bc})['then'](function(){var _0x2073b1=_[_0x5e1b('0x3a')](_0x6b43e6,function(_0x39d28e){_0x39d28e[_0x5e1b('0x5f')]=_0x247b7f;return _0x39d28e;});return db[_0x5e1b('0x78')][_0x5e1b('0x79')](_0x2073b1,{'transaction':_0x48e8bc});});}else{_0x4153dc=0x194;_0x2e13ad=[];}});})[_0x5e1b('0x1c')](function(){if(_0x4153dc!==0x194){return db[_0x5e1b('0x78')][_0x5e1b('0x7a')]({'where':{'WhatsappAccountId':_0x247b7f},'order':'priority'})[_0x5e1b('0x1c')](function(_0x17cfec){_0x2e13ad=_0x17cfec;});}})[_0x5e1b('0x25')](function(_0x13facd){_0x4153dc=0x1f4;logger['error'](_0x13facd[_0x5e1b('0x35')]);if(_0x13facd['name']){delete _0x13facd[_0x5e1b('0x36')];}_0x2e13ad=_0x13facd;})[_0x5e1b('0x7b')](function(){if(_0x2e13ad===null){_0x129b7a[_0x5e1b('0x26')](_0x4153dc);}else{if(_0x4153dc===0x1f4){_0x129b7a[_0x5e1b('0x27')](_0x4153dc)['send'](_0x2e13ad);}else{_0x129b7a[_0x5e1b('0x27')](_0x4153dc)[_0x5e1b('0x28')](_0x2e13ad);}}});};exports[_0x5e1b('0x7c')]=function(_0x599a46,_0x2e98fa,_0xe9df79){var _0x7f1b9b={};var _0x592752={};var _0x31f403;var _0x93cd5c;return db[_0x5e1b('0x4c')][_0x5e1b('0x62')]({'where':{'id':_0x599a46[_0x5e1b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2e98fa,null))[_0x5e1b('0x1c')](function(_0x5aa5c2){if(_0x5aa5c2){_0x31f403=_0x5aa5c2;_0x592752[_0x5e1b('0x3d')]=_[_0x5e1b('0x50')](db[_0x5e1b('0x78')]['rawAttributes']);_0x592752[_0x5e1b('0x3e')]=_[_0x5e1b('0x50')](_0x599a46[_0x5e1b('0x3e')]);_0x592752[_0x5e1b('0x3f')]=_[_0x5e1b('0x40')](_0x592752[_0x5e1b('0x3d')],_0x592752['query']);_0x7f1b9b['attributes']=_[_0x5e1b('0x40')](_0x592752['model'],qs[_0x5e1b('0x42')](_0x599a46['query']['fields']));_0x7f1b9b[_0x5e1b('0x41')]=_0x7f1b9b[_0x5e1b('0x41')][_0x5e1b('0x43')]?_0x7f1b9b[_0x5e1b('0x41')]:_0x592752[_0x5e1b('0x3d')];_0x7f1b9b['order']=qs[_0x5e1b('0x45')](_0x599a46[_0x5e1b('0x3e')]['sort']);_0x7f1b9b[_0x5e1b('0x48')]=qs[_0x5e1b('0x3f')](_['pick'](_0x599a46[_0x5e1b('0x3e')],_0x592752['filters']));if(_0x599a46[_0x5e1b('0x3e')][_0x5e1b('0x47')]){_0x7f1b9b[_0x5e1b('0x48')]=_['merge'](_0x7f1b9b[_0x5e1b('0x48')],{'$or':_[_0x5e1b('0x3a')](_0x7f1b9b[_0x5e1b('0x41')],function(_0x125015){var _0x432383={};_0x432383[_0x125015]={'$like':'%'+_0x599a46['query']['filter']+'%'};return _0x432383;})});}_0x7f1b9b=_[_0x5e1b('0x49')]({},_0x7f1b9b,_0x599a46['options']);return _0x31f403[_0x5e1b('0x7c')](_0x7f1b9b);}})[_0x5e1b('0x1c')](function(_0x290239){if(_0x290239){_0x93cd5c=_0x290239[_0x5e1b('0x43')];if(!_0x599a46[_0x5e1b('0x3e')][_0x5e1b('0x63')](_0x5e1b('0x44'))){_0x7f1b9b[_0x5e1b('0x2a')]=qs['limit'](_0x599a46[_0x5e1b('0x3e')][_0x5e1b('0x2a')]);_0x7f1b9b[_0x5e1b('0x2b')]=qs['offset'](_0x599a46['query']['offset']);}return _0x31f403[_0x5e1b('0x7c')](_0x7f1b9b);}})[_0x5e1b('0x1c')](function(_0x3abc83){if(_0x3abc83){return _0x3abc83?{'count':_0x93cd5c,'rows':_0x3abc83}:null;}})[_0x5e1b('0x1c')](respondWithResult(_0x2e98fa,null))['catch'](handleError(_0x2e98fa,null));};exports[_0x5e1b('0x7d')]=function(_0x15604d,_0x38c345,_0x536542){var _0x3269ba={'channel':_0x5e1b('0x7e')};var _0x45b963=[];var _0x48bb04=[];var _0x9dfce1={};return db['WhatsappAccount']['find']({'where':{'id':_0x15604d[_0x5e1b('0x5d')]['id']},'include':[{'model':db[_0x5e1b('0x78')],'as':_0x5e1b('0x7f')}]})[_0x5e1b('0x1c')](handleEntityNotFound(_0x38c345,null))[_0x5e1b('0x1c')](function(_0x2ad4b2){_0x3269ba[_0x5e1b('0x80')]=_0x2ad4b2;if(_0x3269ba[_0x5e1b('0x80')]&&_0x3269ba[_0x5e1b('0x80')][_0x5e1b('0x3b')]===_0x5e1b('0x81')&&_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x82')]){if(_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x82')][_0x5e1b('0x43')]===0x0)return;if(_0x15604d[_0x5e1b('0x55')]['statuses'][0x0]['state']!==_0x5e1b('0x83'))return;return db[_0x5e1b('0x84')][_0x5e1b('0x30')]({'read':!![],'readAt':_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x82')][0x0][_0x5e1b('0x85')]},{'where':{'messageId':_0x15604d[_0x5e1b('0x55')]['statuses'][0x0][_0x5e1b('0x86')]},'individualHooks':!![]})[_0x5e1b('0x1c')](function(_0x442baa){return _0x38c345[_0x5e1b('0x27')](0xc8)[_0x5e1b('0x28')](_0x442baa);});}_0x3269ba[_0x5e1b('0x87')]=_['orderBy'](_0x2ad4b2[_0x5e1b('0x7f')],['priority'],['asc']);if(_0x3269ba[_0x5e1b('0x80')]['Applications']){delete _0x3269ba[_0x5e1b('0x80')][_0x5e1b('0x7f')];}return db[_0x5e1b('0x88')]['describe']()['then'](function(_0x5048d0){if(!_0x5048d0){throw new db[(_0x5e1b('0x89'))][(_0x5e1b('0x8a'))](_0x5e1b('0x8b'));}_0x45b963=_[_0x5e1b('0x8c')](_[_0x5e1b('0x50')](_0x5048d0),['createdAt',_0x5e1b('0x8d')]);_0x48bb04=_[_0x5e1b('0x8c')](_[_0x5e1b('0x50')](_0x5048d0),[_0x5e1b('0x8e'),_0x5e1b('0x8d'),_0x5e1b('0x8f'),_0x5e1b('0x90')]);_0x3269ba[_0x5e1b('0x55')]={'mapKey':_0x5e1b('0x91')};if(_0x3269ba[_0x5e1b('0x80')]&&_0x3269ba[_0x5e1b('0x80')]['type']===_0x5e1b('0x92')){_0x3269ba[_0x5e1b('0x55')]['from']=_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x93')][_0x5e1b('0x94')]('whatsapp:','');_0x3269ba[_0x5e1b('0x55')]['body']=_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x95')];_0x3269ba[_0x5e1b('0x55')]['messageId']=_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x96')];}if(_0x3269ba[_0x5e1b('0x80')]&&_0x3269ba['account']['type']===_0x5e1b('0x81')){_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x97')]=_0x15604d[_0x5e1b('0x55')][_0x5e1b('0x98')][0x0]['from'];_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x55')]=_0x15604d['body'][_0x5e1b('0x98')][0x0]['message']['body'];_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x99')]=_0x15604d[_0x5e1b('0x55')]['notifications'][0x0][_0x5e1b('0x86')];}if(_0x3269ba['body']['id']){delete _0x3269ba[_0x5e1b('0x55')]['id'];}if(_['isNil'](_0x3269ba['body'][_0x5e1b('0x97')])){throw new db[(_0x5e1b('0x89'))][(_0x5e1b('0x8a'))](_0x5e1b('0x9a'));}if(_[_0x5e1b('0x9b')](_0x3269ba[_0x5e1b('0x55')]['body'])||_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x55')]===''){throw new db[(_0x5e1b('0x89'))][(_0x5e1b('0x8a'))](_0x5e1b('0x9c'));}if(_[_0x5e1b('0x9b')](_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x9d')])){throw new db[(_0x5e1b('0x89'))][(_0x5e1b('0x8a'))](_0x5e1b('0x9e')+_0x48bb04);}if(!_['includes'](_0x48bb04,_0x3269ba['body'][_0x5e1b('0x9d')])){throw new db[(_0x5e1b('0x89'))][(_0x5e1b('0x8a'))](_0x5e1b('0x9f')+_0x48bb04);}_0x9dfce1[_0x3269ba[_0x5e1b('0x55')]['mapKey']]=_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x97')];return db[_0x5e1b('0xa0')][_0x5e1b('0x5a')]({'where':{'id':_0x3269ba[_0x5e1b('0x80')][_0x5e1b('0x90')]},'include':[{'model':db[_0x5e1b('0x88')],'as':_0x5e1b('0xa1'),'where':_0x9dfce1,'limit':0x1,'order':[[_0x5e1b('0x8d'),_0x5e1b('0xa2')]]}]});})[_0x5e1b('0x1c')](handleEntityNotFound(_0x38c345,null))[_0x5e1b('0x1c')](function(_0x386d51){if(_0x386d51){_0x3269ba[_0x5e1b('0xa3')]=_[_0x5e1b('0x6c')](_0x386d51,['Contacts']);if(_0x386d51[_0x5e1b('0xa1')][_0x5e1b('0x43')]){return _0x386d51['Contacts'][0x0];}var _0x3c1fa5=_[_0x5e1b('0xa4')](_0x3269ba[_0x5e1b('0x55')],{'firstName':_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x97')],'ListId':_0x386d51['id']});_0x3c1fa5[_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x9d')]]=_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x97')];return db['CmContact'][_0x5e1b('0x54')](_0x3c1fa5,{'fields':_0x45b963,'raw':!![]});}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x38c345,null))['then'](function(_0x132303){if(_0x132303){_0x3269ba[_0x5e1b('0xa5')]=_0x132303;var _0x2fd7bd={'ContactId':_0x132303['id'],'phone':_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x97')],'WhatsappAccountId':_0x15604d[_0x5e1b('0x5d')]['id']};var _0x4b42f0={'ContactId':_0x132303['id'],'WhatsappAccountId':_0x15604d[_0x5e1b('0x5d')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x5e1b('0x5a')]({'where':_0x4b42f0})['then'](function(_0x532253){if(_0x532253){return[_0x532253,![]];}return db['WhatsappInteraction']['create'](_0x2fd7bd)[_0x5e1b('0x1c')](function(_0x1c42a1){return[_0x1c42a1,!![]];});});}})['spread'](function(_0x47bc5d,_0x2c7acb){_0x3269ba['interaction']=_0x47bc5d[_0x5e1b('0x32')]({'plain':!![]});_0x3269ba[_0x5e1b('0xa6')]['created']=![];if(_0x2c7acb){if(_0x3269ba[_0x5e1b('0x80')][_0x5e1b('0xa7')]){_0x3269ba[_0x5e1b('0x87')][_0x5e1b('0xa8')]({'id':0x0,'priority':_0x3269ba[_0x5e1b('0x87')][_0x5e1b('0x43')]+0x1,'app':_0x5e1b('0xa9'),'appdata':_0x5e1b('0xaa'),'interval':_0x5e1b('0xab')});}_0x3269ba[_0x5e1b('0xa6')][_0x5e1b('0xac')]=!![];}return db[_0x5e1b('0x84')][_0x5e1b('0x54')]({'phone':_0x3269ba['body'][_0x5e1b('0x97')],'messageId':_0x3269ba['body'][_0x5e1b('0x99')],'body':_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0x55')],'WhatsappAccountId':_0x15604d[_0x5e1b('0x5d')]['id'],'WhatsappInteractionId':_0x47bc5d['id'],'direction':'in','ContactId':_0x47bc5d[_0x5e1b('0xad')],'AttachmentId':_0x3269ba[_0x5e1b('0x55')][_0x5e1b('0xae')]});})['then'](function(_0x45a837){_0x3269ba[_0x5e1b('0x23')]=_0x45a837;if(!_0x3269ba[_0x5e1b('0xa6')][_0x5e1b('0xaf')])return;return db[_0x5e1b('0x73')][_0x5e1b('0x5a')]({'attributes':['id',_0x5e1b('0x36')],'where':{'id':_0x3269ba['interaction'][_0x5e1b('0xaf')]}});})[_0x5e1b('0x1c')](function(_0x43dc18){if(_0x43dc18){_0x3269ba['applications'][_0x5e1b('0xb0')]({'id':0x0,'priority':0x0,'app':_0x5e1b('0xb1'),'appdata':_0x43dc18[_0x5e1b('0x36')]+','+(_0x3269ba['account'][_0x5e1b('0xb2')]||0xa),'interval':'*,*,*,*'});}if(!_0x3269ba['interaction'][_0x5e1b('0xb3')])return;return db['WhatsappQueue']['find']({'attributes':['id','name'],'where':{'id':_0x3269ba[_0x5e1b('0xa6')][_0x5e1b('0xb3')]}});})[_0x5e1b('0x1c')](function(_0x2efabe){if(_0x2efabe){_0x3269ba[_0x5e1b('0x87')][_0x5e1b('0xb0')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2efabe[_0x5e1b('0x36')]+','+(_0x3269ba['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x5e1b('0xab')});}return respondWithRpcPromise(_0x5e1b('0xb4'),_0x5e1b('0xb5'),_0x3269ba);})[_0x5e1b('0x1c')](function(_0x3aee21){if(_0x3aee21){var _0x7ebe42=0xc8;var _0x3610eb='receiveMessage';logger[_0x5e1b('0xb6')](_0x5e1b('0x20'),_0x3610eb,_0x7ebe42,'entity\x20found');logger[_0x5e1b('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3610eb,_0x7ebe42,_0x5e1b('0xb7'),JSON[_0x5e1b('0xb8')](_0x3aee21));if(_0x3269ba['account'][_0x5e1b('0x3b')]===_0x5e1b('0x92')){return _0x38c345['status'](_0x7ebe42)[_0x5e1b('0xb9')](_0x5e1b('0xba'),_0x5e1b('0xbb'))[_0x5e1b('0xbc')]('\x0a');}else{return _0x38c345[_0x5e1b('0x27')](_0x7ebe42)[_0x5e1b('0x28')](_0x3aee21);}}});})[_0x5e1b('0x25')](handleError(_0x38c345,null));};exports['send']=function(_0x408897,_0x4506c6,_0x2d9ad5){var _0x186e71,_0xc65de7,_0x43f23c;if(_[_0x5e1b('0x9b')](_0x408897['body'][_0x5e1b('0x55')])||_0x408897[_0x5e1b('0x55')][_0x5e1b('0x55')]===''){throw new db['Sequelize'][(_0x5e1b('0x8a'))](_0x5e1b('0x9c'));}if(_[_0x5e1b('0x9b')](_0x408897[_0x5e1b('0x55')]['to'])){throw new db['Sequelize']['ValidationError'](_0x5e1b('0xbd'));}_0x186e71=_0x408897['body']['to'];return db[_0x5e1b('0x4c')][_0x5e1b('0x5a')]({'where':{'id':_0x408897['params']['id']},'include':[{'model':db[_0x5e1b('0xa0')],'as':_0x5e1b('0xbe'),'include':[{'model':db[_0x5e1b('0x88')],'as':_0x5e1b('0xa1'),'where':{'mobile':_0x186e71},'limit':0x1,'order':[[_0x5e1b('0x8d'),_0x5e1b('0xa2')]]}]}]})['then'](handleEntityNotFound(_0x4506c6,null))[_0x5e1b('0x1c')](function(_0x45e9ea){if(_0x45e9ea&&_0x45e9ea[_0x5e1b('0xbe')]){_0xc65de7=_0x45e9ea[_0x5e1b('0x32')]({'plain':!![]});if(_0xc65de7[_0x5e1b('0xbe')]&&_0xc65de7[_0x5e1b('0xbe')]['Contacts'][_0x5e1b('0x43')]){return _0xc65de7[_0x5e1b('0xbe')][_0x5e1b('0xa1')][0x0];}return db[_0x5e1b('0x88')][_0x5e1b('0x54')](_[_0x5e1b('0xa4')](_0x408897[_0x5e1b('0x55')],{'firstName':_0x186e71,'mobile':_0x186e71,'phone':_0x186e71,'ListId':_0xc65de7['ListId']}));}})[_0x5e1b('0x1c')](handleEntityNotFound(_0x4506c6,null))[_0x5e1b('0x1c')](function(_0x35f3f6){if(_0x35f3f6){_0x43f23c=_0x35f3f6;return db[_0x5e1b('0xbf')]['find']({'where':{'ContactId':_0x43f23c['id'],'closed':![],'WhatsappAccountId':_0xc65de7['id']}})[_0x5e1b('0x1c')](function(_0x552db4){if(_0x552db4){return[_0x552db4,![]];}return db[_0x5e1b('0xbf')][_0x5e1b('0x54')]({'UserId':_0x408897[_0x5e1b('0x56')]['id'],'ContactId':_0x43f23c['id'],'WhatsappAccountId':_0xc65de7['id'],'phone':_0x186e71,'firstMsgDirection':_0x5e1b('0xc0'),'Messages':[_[_0x5e1b('0x49')](_0x408897[_0x5e1b('0x55')],{'read':![],'body':_0x408897[_0x5e1b('0x55')]['body'],'phone':_0x186e71,'WhatsappAccountId':_0xc65de7['id'],'UserId':_0x408897['user']['id'],'ContactId':_0x43f23c['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x5e1b('0xc1')}]})[_0x5e1b('0x1c')](function(_0x3b0615){return[_0x3b0615,!![]];});});}})['spread'](function(_0x32cbc6,_0x2114f9){if(_0x2114f9){return _0x32cbc6;}return db[_0x5e1b('0x84')][_0x5e1b('0x54')](_['merge'](_0x408897[_0x5e1b('0x55')],{'read':![],'body':_0x408897[_0x5e1b('0x55')][_0x5e1b('0x55')],'phone':_0x186e71,'WhatsappAccountId':_0xc65de7['id'],'WhatsappInteractionId':_0x32cbc6['id'],'UserId':_0x408897[_0x5e1b('0x56')]['id'],'ContactId':_0x43f23c['id']}))['then'](function(_0x401dbd){_0x32cbc6[_0x5e1b('0xc2')][_0x5e1b('0xc1')]=[];_0x32cbc6[_0x5e1b('0xc2')][_0x5e1b('0xc1')][_0x5e1b('0xa8')](_0x401dbd[_0x5e1b('0xc2')]);return _0x32cbc6;});})[_0x5e1b('0x1c')](respondWithResult(_0x4506c6,null))['catch'](handleError(_0x4506c6,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index aaeb3b4..2f6dbae 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 _0x7245=['emit','hasOwnProperty','hook','events','../../mysqldb','update','remove'];(function(_0x82a0bf,_0x57b0ec){var _0x505859=function(_0x34799f){while(--_0x34799f){_0x82a0bf['push'](_0x82a0bf['shift']());}};_0x505859(++_0x57b0ec);}(_0x7245,0x106));var _0x5724=function(_0x3645f1,_0x346420){_0x3645f1=_0x3645f1-0x0;var _0x131b69=_0x7245[_0x3645f1];return _0x131b69;};'use strict';var EventEmitter=require(_0x5724('0x0'));var WhatsappAccount=require(_0x5724('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5724('0x2'),'afterDestroy':_0x5724('0x3')};function emitEvent(_0x278309){return function(_0x11015c,_0x57972d,_0x5d696f){WhatsappAccountEvents[_0x5724('0x4')](_0x278309+':'+_0x11015c['id'],_0x11015c);WhatsappAccountEvents['emit'](_0x278309,_0x11015c);_0x5d696f(null);};}for(var e in events){if(events[_0x5724('0x5')](e)){var event=events[e];WhatsappAccount[_0x5724('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xc436=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0xc436,0x153));var _0x6c43=function(_0x4b0297,_0x27af79){_0x4b0297=_0x4b0297-0x0;var _0x179539=_0xc436[_0x4b0297];return _0x179539;};'use strict';var EventEmitter=require(_0x6c43('0x0'));var WhatsappAccount=require(_0x6c43('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6c43('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c43('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37ee0e){return function(_0x35d95d,_0x2f479f,_0x23d795){WhatsappAccountEvents[_0x6c43('0x4')](_0x37ee0e+':'+_0x35d95d['id'],_0x35d95d);WhatsappAccountEvents[_0x6c43('0x4')](_0x37ee0e,_0x35d95d);_0x23d795(null);};}for(var e in events){if(events[_0x6c43('0x5')](e)){var event=events[e];WhatsappAccount[_0x6c43('0x6')](e,emitEvent(event));}}module[_0x6c43('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 553d302..a02a834 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 _0x6971=['exports','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes'];(function(_0x14dbdd,_0x3a073c){var _0x4afd72=function(_0x30bd02){while(--_0x30bd02){_0x14dbdd['push'](_0x14dbdd['shift']());}};_0x4afd72(++_0x3a073c);}(_0x6971,0x10c));var _0x1697=function(_0x206f86,_0x279fcc){_0x206f86=_0x206f86-0x0;var _0x46bbf4=_0x6971[_0x206f86];return _0x46bbf4;};'use strict';var _=require('lodash');var util=require(_0x1697('0x0'));var logger=require(_0x1697('0x1'))(_0x1697('0x2'));var moment=require('moment');var BPromise=require(_0x1697('0x3'));var rp=require(_0x1697('0x4'));var fs=require('fs');var path=require(_0x1697('0x5'));var rimraf=require('rimraf');var config=require(_0x1697('0x6'));var attributes=require(_0x1697('0x7'));module[_0x1697('0x8')]=function(_0x126c16,_0x421370){return _0x126c16[_0x1697('0x9')](_0x1697('0xa'),attributes,{'tableName':_0x1697('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaed0=['../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x922cd8,_0x3e8b4c){var _0x3427e6=function(_0x91e6ff){while(--_0x91e6ff){_0x922cd8['push'](_0x922cd8['shift']());}};_0x3427e6(++_0x3e8b4c);}(_0xaed0,0x1cb));var _0x0aed=function(_0x32ff72,_0x5047b3){_0x32ff72=_0x32ff72-0x0;var _0x59a8b4=_0xaed0[_0x32ff72];return _0x59a8b4;};'use strict';var _=require(_0x0aed('0x0'));var util=require(_0x0aed('0x1'));var logger=require(_0x0aed('0x2'))(_0x0aed('0x3'));var moment=require(_0x0aed('0x4'));var BPromise=require(_0x0aed('0x5'));var rp=require(_0x0aed('0x6'));var fs=require('fs');var path=require(_0x0aed('0x7'));var rimraf=require(_0x0aed('0x8'));var config=require(_0x0aed('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0x0aed('0xa')]=function(_0x5a8d7a,_0x5d4ccc){return _0x5a8d7a['define'](_0x0aed('0xb'),attributes,{'tableName':_0x0aed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 07ceb80..cedc352 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 _0x93a2=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','WhatsappAccount','find','options','raw','where','attributes','include','model','map','ShowWhatsappAccount','lodash','moment'];(function(_0x3722b3,_0x18a764){var _0x4614ae=function(_0x522c8e){while(--_0x522c8e){_0x3722b3['push'](_0x3722b3['shift']());}};_0x4614ae(++_0x18a764);}(_0x93a2,0x142));var _0x293a=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x93a2[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0x293a('0x0'));var util=require('util');var moment=require(_0x293a('0x1'));var BPromise=require(_0x293a('0x2'));var rs=require(_0x293a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x293a('0x4'))['db'];var utils=require(_0x293a('0x5'));var logger=require(_0x293a('0x6'))(_0x293a('0x7'));var config=require(_0x293a('0x8'));var jayson=require(_0x293a('0x9'));var client=jayson['client'][_0x293a('0xa')]({'port':0x232a});config[_0x293a('0xb')]=_[_0x293a('0xc')](config[_0x293a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x293a('0xd'))(new Redis(config[_0x293a('0xb')]));require(_0x293a('0xe'))['register'](socket);function respondWithRpcPromise(_0x3cc016,_0x73d1c8,_0x51db32){return new BPromise(function(_0x80bd3d,_0x42b511){return client['request'](_0x3cc016,_0x51db32)[_0x293a('0xf')](function(_0x28c4e1){logger['info'](_0x293a('0x10'),_0x73d1c8,_0x293a('0x11'));logger[_0x293a('0x12')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x73d1c8,_0x293a('0x11'),JSON[_0x293a('0x13')](_0x28c4e1));if(_0x28c4e1[_0x293a('0x14')]){if(_0x28c4e1[_0x293a('0x14')][_0x293a('0x15')]===0x1f4){logger[_0x293a('0x14')](_0x293a('0x10'),_0x73d1c8,_0x28c4e1[_0x293a('0x14')][_0x293a('0x16')]);return _0x42b511(_0x28c4e1[_0x293a('0x14')]['message']);}logger[_0x293a('0x14')](_0x293a('0x10'),_0x73d1c8,_0x28c4e1['error'][_0x293a('0x16')]);return _0x80bd3d(_0x28c4e1['error']['message']);}else{logger[_0x293a('0x17')](_0x293a('0x10'),_0x73d1c8,_0x293a('0x11'));_0x80bd3d(_0x28c4e1[_0x293a('0x18')]['message']);}})[_0x293a('0x19')](function(_0x222edb){logger[_0x293a('0x14')](_0x293a('0x10'),_0x73d1c8,_0x222edb);_0x42b511(_0x222edb);});});}exports['ShowWhatsappAccount']=function(_0x4edc0e){var _0x52a089=this;return new Promise(function(_0x3ccae7,_0x38dc3f){return db[_0x293a('0x1a')][_0x293a('0x1b')]({'raw':_0x4edc0e[_0x293a('0x1c')]?_0x4edc0e[_0x293a('0x1c')][_0x293a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4edc0e[_0x293a('0x1c')]?_0x4edc0e[_0x293a('0x1c')][_0x293a('0x1e')]||null:null,'attributes':_0x4edc0e[_0x293a('0x1c')]?_0x4edc0e[_0x293a('0x1c')][_0x293a('0x1f')]||null:null,'include':_0x4edc0e[_0x293a('0x1c')]?_0x4edc0e['options']['include']?_['map'](_0x4edc0e[_0x293a('0x1c')][_0x293a('0x20')],function(_0x2ed651){return{'model':db[_0x2ed651[_0x293a('0x21')]],'as':_0x2ed651['as'],'attributes':_0x2ed651[_0x293a('0x1f')],'include':_0x2ed651[_0x293a('0x20')]?_[_0x293a('0x22')](_0x2ed651[_0x293a('0x20')],function(_0x1bf4f3){return{'model':db[_0x1bf4f3[_0x293a('0x21')]],'as':_0x1bf4f3['as'],'attributes':_0x1bf4f3[_0x293a('0x1f')],'include':_0x1bf4f3[_0x293a('0x20')]?_['map'](_0x1bf4f3[_0x293a('0x20')],function(_0x51b93d){return{'model':db[_0x51b93d['model']],'as':_0x51b93d['as'],'attributes':_0x51b93d[_0x293a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x293a('0xf')](function(_0x3ea50c){logger[_0x293a('0x17')]('ShowWhatsappAccount',_0x4edc0e);logger[_0x293a('0x12')](_0x293a('0x23'),_0x4edc0e,JSON[_0x293a('0x13')](_0x3ea50c));_0x3ccae7(_0x3ea50c);})[_0x293a('0x19')](function(_0x304e19){logger[_0x293a('0x14')](_0x293a('0x23'),_0x304e19[_0x293a('0x16')],_0x4edc0e);_0x38dc3f(_0x52a089['error'](0x1f4,_0x304e19[_0x293a('0x16')]));});});}; \ No newline at end of file +var _0xa246=['where','include','map','model','attributes','then','debug','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw'];(function(_0x2dc519,_0x4328e8){var _0x39b6fe=function(_0x2e1000){while(--_0x2e1000){_0x2dc519['push'](_0x2dc519['shift']());}};_0x39b6fe(++_0x4328e8);}(_0xa246,0xfc));var _0x6a24=function(_0x50ca66,_0x3f59ec){_0x50ca66=_0x50ca66-0x0;var _0x32c421=_0xa246[_0x50ca66];return _0x32c421;};'use strict';var _=require('lodash');var util=require(_0x6a24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6a24('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a24('0x2'))['db'];var utils=require(_0x6a24('0x3'));var logger=require(_0x6a24('0x4'))('rpc');var config=require(_0x6a24('0x5'));var jayson=require(_0x6a24('0x6'));var client=jayson['client'][_0x6a24('0x7')]({'port':0x232a});config[_0x6a24('0x8')]=_[_0x6a24('0x9')](config[_0x6a24('0x8')],{'host':_0x6a24('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a24('0x8')]));require(_0x6a24('0xb'))[_0x6a24('0xc')](socket);function respondWithRpcPromise(_0x20dc23,_0x599ac5,_0x56b979){return new BPromise(function(_0x2c0750,_0x3312a5){return client[_0x6a24('0xd')](_0x20dc23,_0x56b979)['then'](function(_0x52ccf2){logger[_0x6a24('0xe')](_0x6a24('0xf'),_0x599ac5,'request\x20sent');logger['debug'](_0x6a24('0x10'),_0x599ac5,_0x6a24('0x11'),JSON[_0x6a24('0x12')](_0x52ccf2));if(_0x52ccf2[_0x6a24('0x13')]){if(_0x52ccf2[_0x6a24('0x13')]['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x599ac5,_0x52ccf2[_0x6a24('0x13')][_0x6a24('0x14')]);return _0x3312a5(_0x52ccf2['error']['message']);}logger[_0x6a24('0x13')](_0x6a24('0xf'),_0x599ac5,_0x52ccf2[_0x6a24('0x13')]['message']);return _0x2c0750(_0x52ccf2[_0x6a24('0x13')][_0x6a24('0x14')]);}else{logger[_0x6a24('0xe')](_0x6a24('0xf'),_0x599ac5,_0x6a24('0x11'));_0x2c0750(_0x52ccf2[_0x6a24('0x15')][_0x6a24('0x14')]);}})[_0x6a24('0x16')](function(_0x28c763){logger[_0x6a24('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x599ac5,_0x28c763);_0x3312a5(_0x28c763);});});}exports[_0x6a24('0x17')]=function(_0x18dbb9){var _0x239d2d=this;return new Promise(function(_0x249b97,_0x389fec){return db[_0x6a24('0x18')][_0x6a24('0x19')]({'raw':_0x18dbb9[_0x6a24('0x1a')]?_0x18dbb9[_0x6a24('0x1a')][_0x6a24('0x1b')]===undefined?!![]:![]:!![],'where':_0x18dbb9['options']?_0x18dbb9['options'][_0x6a24('0x1c')]||null:null,'attributes':_0x18dbb9['options']?_0x18dbb9[_0x6a24('0x1a')]['attributes']||null:null,'include':_0x18dbb9[_0x6a24('0x1a')]?_0x18dbb9[_0x6a24('0x1a')][_0x6a24('0x1d')]?_[_0x6a24('0x1e')](_0x18dbb9[_0x6a24('0x1a')]['include'],function(_0x44ea51){return{'model':db[_0x44ea51[_0x6a24('0x1f')]],'as':_0x44ea51['as'],'attributes':_0x44ea51[_0x6a24('0x20')],'include':_0x44ea51[_0x6a24('0x1d')]?_[_0x6a24('0x1e')](_0x44ea51[_0x6a24('0x1d')],function(_0x1dc73f){return{'model':db[_0x1dc73f[_0x6a24('0x1f')]],'as':_0x1dc73f['as'],'attributes':_0x1dc73f[_0x6a24('0x20')],'include':_0x1dc73f[_0x6a24('0x1d')]?_[_0x6a24('0x1e')](_0x1dc73f[_0x6a24('0x1d')],function(_0x11c3b3){return{'model':db[_0x11c3b3['model']],'as':_0x11c3b3['as'],'attributes':_0x11c3b3[_0x6a24('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a24('0x21')](function(_0xa6e782){logger[_0x6a24('0xe')](_0x6a24('0x17'),_0x18dbb9);logger[_0x6a24('0x22')](_0x6a24('0x17'),_0x18dbb9,JSON['stringify'](_0xa6e782));_0x249b97(_0xa6e782);})['catch'](function(_0xaf4501){logger[_0x6a24('0x13')]('ShowWhatsappAccount',_0xaf4501[_0x6a24('0x14')],_0x18dbb9);_0x389fec(_0x239d2d['error'](0x1f4,_0xaf4501[_0x6a24('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a978965..38aab53 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 _0x63b9=['emit','removeListener','register','./whatsappAccount.events','update'];(function(_0x56ccd2,_0x1fbef1){var _0x341819=function(_0x5b0bc1){while(--_0x5b0bc1){_0x56ccd2['push'](_0x56ccd2['shift']());}};_0x341819(++_0x1fbef1);}(_0x63b9,0x15c));var _0x963b=function(_0x5e586a,_0xe70795){_0x5e586a=_0x5e586a-0x0;var _0x47568a=_0x63b9[_0x5e586a];return _0x47568a;};'use strict';var WhatsappAccountEvents=require(_0x963b('0x0'));var events=['save','remove',_0x963b('0x1')];function createListener(_0x9ae9a5,_0x5d8105){return function(_0x40be61){_0x5d8105[_0x963b('0x2')](_0x9ae9a5,_0x40be61);};}function removeListener(_0xc72d3a,_0x2dbe04){return function(){WhatsappAccountEvents[_0x963b('0x3')](_0xc72d3a,_0x2dbe04);};}exports[_0x963b('0x4')]=function(_0x3c9cf0){for(var _0x30455c=0x0,_0x553bb8=events['length'];_0x30455c<_0x553bb8;_0x30455c++){var _0x1364a1=events[_0x30455c];var _0x37c089=createListener('whatsappAccount:'+_0x1364a1,_0x3c9cf0);WhatsappAccountEvents['on'](_0x1364a1,_0x37c089);}}; \ No newline at end of file +var _0xf115=['remove','update','removeListener','register','whatsappAccount:','./whatsappAccount.events','save'];(function(_0xe2f267,_0x2a0fe9){var _0x2ef170=function(_0x17d81a){while(--_0x17d81a){_0xe2f267['push'](_0xe2f267['shift']());}};_0x2ef170(++_0x2a0fe9);}(_0xf115,0x1da));var _0x5f11=function(_0x132448,_0x3b6a79){_0x132448=_0x132448-0x0;var _0x3d7fbc=_0xf115[_0x132448];return _0x3d7fbc;};'use strict';var WhatsappAccountEvents=require(_0x5f11('0x0'));var events=[_0x5f11('0x1'),_0x5f11('0x2'),_0x5f11('0x3')];function createListener(_0x710b44,_0x42a996){return function(_0x43a9a1){_0x42a996['emit'](_0x710b44,_0x43a9a1);};}function removeListener(_0x994d8e,_0x15cd50){return function(){WhatsappAccountEvents[_0x5f11('0x4')](_0x994d8e,_0x15cd50);};}exports[_0x5f11('0x5')]=function(_0xa95ed3){for(var _0x31c291=0x0,_0x5c9459=events['length'];_0x31c291<_0x5c9459;_0x31c291++){var _0x1022ef=events[_0x31c291];var _0xe1cc25=createListener(_0x5f11('0x6')+_0x1022ef,_0xa95ed3);WhatsappAccountEvents['on'](_0x1022ef,_0xe1cc25);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 41261dc..3184b6d 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 _0xd9ad=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports'];(function(_0xab1b8d,_0x2ca1d7){var _0x446863=function(_0x1aebe9){while(--_0x1aebe9){_0xab1b8d['push'](_0xab1b8d['shift']());}};_0x446863(++_0x2ca1d7);}(_0xd9ad,0x10a));var _0xdd9a=function(_0x294288,_0x3005db){_0x294288=_0x294288-0x0;var _0x3b0156=_0xd9ad[_0x294288];return _0x3b0156;};'use strict';var multer=require('multer');var util=require(_0xdd9a('0x0'));var path=require(_0xdd9a('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd9a('0x2'));var router=express[_0xdd9a('0x3')]();var fs_extra=require(_0xdd9a('0x4'));var auth=require(_0xdd9a('0x5'));var interaction=require(_0xdd9a('0x6'));var config=require(_0xdd9a('0x7'));var controller=require(_0xdd9a('0x8'));router[_0xdd9a('0x9')]('/',auth[_0xdd9a('0xa')](),controller['index']);router[_0xdd9a('0x9')](_0xdd9a('0xb'),auth[_0xdd9a('0xa')](),controller[_0xdd9a('0xc')]);router[_0xdd9a('0xd')]('/',auth[_0xdd9a('0xa')](),controller[_0xdd9a('0xe')]);router[_0xdd9a('0xf')](_0xdd9a('0xb'),auth[_0xdd9a('0xa')](),controller['update']);router[_0xdd9a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xdd9a('0x11')]);module[_0xdd9a('0x12')]=router; \ No newline at end of file +var _0x576d=['post','create','/:id','update','exports','multer','connect-timeout','Router','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','show'];(function(_0x33350b,_0x3ae04e){var _0x547688=function(_0x1ee3f3){while(--_0x1ee3f3){_0x33350b['push'](_0x33350b['shift']());}};_0x547688(++_0x3ae04e);}(_0x576d,0xf3));var _0xd576=function(_0x409add,_0xb80113){_0x409add=_0x409add-0x0;var _0x4bdf9a=_0x576d[_0x409add];return _0x4bdf9a;};'use strict';var multer=require(_0xd576('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd576('0x1'));var express=require('express');var router=express[_0xd576('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd576('0x3'));var controller=require(_0xd576('0x4'));router['get']('/',auth[_0xd576('0x5')](),controller[_0xd576('0x6')]);router[_0xd576('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd576('0x8')]);router[_0xd576('0x9')]('/',auth[_0xd576('0x5')](),controller[_0xd576('0xa')]);router['put'](_0xd576('0xb'),auth['isAuthenticated'](),controller[_0xd576('0xc')]);router['delete'](_0xd576('0xb'),auth[_0xd576('0x5')](),controller['destroy']);module[_0xd576('0xd')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 32f3a5a..bedee3f 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 _0xd46a=['sequelize','exports','TEXT','STRING','*,*,*,*'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0xd46a,0x1a9));var _0xad46=function(_0x4e6b76,_0x789fcf){_0x4e6b76=_0x4e6b76-0x0;var _0xc0ef98=_0xd46a[_0x4e6b76];return _0xc0ef98;};'use strict';var Sequelize=require(_0xad46('0x0'));module[_0xad46('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xad46('0x2')]()},'description':{'type':Sequelize[_0xad46('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xad46('0x4')}}; \ No newline at end of file +var _0x6ea4=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6ea4,0x178));var _0x46ea=function(_0x436dd1,_0x19272c){_0x436dd1=_0x436dd1-0x0;var _0x504c58=_0x6ea4[_0x436dd1];return _0x504c58;};'use strict';var Sequelize=require(_0x46ea('0x0'));module[_0x46ea('0x1')]={'priority':{'type':Sequelize[_0x46ea('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x46ea('0x3')],'allowNull':![],'defaultValue':_0x46ea('0x4')},'appdata':{'type':Sequelize[_0x46ea('0x5')]()},'description':{'type':Sequelize[_0x46ea('0x3')]},'interval':{'type':Sequelize[_0x46ea('0x3')],'defaultValue':_0x46ea('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 9ab0916..1d41c27 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 _0x38b8=['crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','catch','show','params','length','include','create','body','find','eml-format','zip-dir','fast-json-patch','moment','util','path','ejs','fs-extra','squel'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x838b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x838b('0x1'));var jsonpatch=require(_0x838b('0x2'));var rp=require('request-promise');var moment=require(_0x838b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x838b('0x4'));var path=require(_0x838b('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x838b('0x6'));var fs=require('fs');var fs_extra=require(_0x838b('0x7'));var _=require('lodash');var squel=require(_0x838b('0x8'));var crypto=require(_0x838b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x838b('0xa'));var querystring=require(_0x838b('0xb'));var Papa=require(_0x838b('0xc'));var Redis=require('ioredis');var authService=require(_0x838b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x838b('0xe'));var hardwareService=require(_0x838b('0xf'));var logger=require(_0x838b('0x10'))(_0x838b('0x11'));var utils=require(_0x838b('0x12'));var config=require(_0x838b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x838b('0x14'))['db'];function respondWithStatusCode(_0x281764,_0x13fe8a){_0x13fe8a=_0x13fe8a||0xcc;return function(_0x144189){if(_0x144189){return _0x281764[_0x838b('0x15')](_0x13fe8a);}return _0x281764[_0x838b('0x16')](_0x13fe8a)[_0x838b('0x17')]();};}function respondWithResult(_0x3324de,_0x1ddf43){_0x1ddf43=_0x1ddf43||0xc8;return function(_0x525c60){if(_0x525c60){return _0x3324de[_0x838b('0x16')](_0x1ddf43)['json'](_0x525c60);}};}function respondWithFilteredResult(_0x4e1085,_0x584b04){return function(_0x450b9b){if(_0x450b9b){var _0x1da340=typeof _0x584b04[_0x838b('0x18')]===_0x838b('0x19')&&typeof _0x584b04[_0x838b('0x1a')]==='undefined';var _0x21aa1a=_0x450b9b[_0x838b('0x1b')];var _0x44a62c=_0x1da340?0x0:_0x584b04[_0x838b('0x18')];var _0x48c4ab=_0x1da340?_0x450b9b[_0x838b('0x1b')]:_0x584b04[_0x838b('0x18')]+_0x584b04['limit'];var _0x4c1251;if(_0x48c4ab>=_0x21aa1a){_0x48c4ab=_0x21aa1a;_0x4c1251=0xc8;}else{_0x4c1251=0xce;}_0x4e1085[_0x838b('0x16')](_0x4c1251);return _0x4e1085['set'](_0x838b('0x1c'),_0x44a62c+'-'+_0x48c4ab+'/'+_0x21aa1a)[_0x838b('0x1d')](_0x450b9b);}return null;};}function patchUpdates(_0x432a75){return function(_0x4deb91){try{jsonpatch[_0x838b('0x1e')](_0x4deb91,_0x432a75,!![]);}catch(_0x389a99){return BPromise[_0x838b('0x1f')](_0x389a99);}return _0x4deb91[_0x838b('0x20')]();};}function saveUpdates(_0x371082,_0x3f8848){return function(_0x11de0e){if(_0x11de0e){return _0x11de0e[_0x838b('0x21')](_0x371082)[_0x838b('0x22')](function(_0xd48f3b){return _0xd48f3b;});}return null;};}function removeEntity(_0x2eecf9,_0xba76){return function(_0x451089){if(_0x451089){return _0x451089[_0x838b('0x23')]()['then'](function(){_0x2eecf9[_0x838b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51adc6,_0x430400){return function(_0x2bc24c){if(!_0x2bc24c){_0x51adc6[_0x838b('0x15')](0x194);}return _0x2bc24c;};}function handleError(_0x5cec50,_0x302445){_0x302445=_0x302445||0x1f4;return function(_0x27f385){logger['error'](_0x27f385[_0x838b('0x24')]);if(_0x27f385[_0x838b('0x25')]){delete _0x27f385['name'];}_0x5cec50['status'](_0x302445)['send'](_0x27f385);};}exports['index']=function(_0x4f6179,_0x4b46bc){var _0x1e74a6={},_0x227876={},_0x5b66f6={'count':0x0,'rows':[]};var _0x5aeeca=_[_0x838b('0x26')](db[_0x838b('0x27')][_0x838b('0x28')],function(_0x29e161){return{'name':_0x29e161[_0x838b('0x29')],'type':_0x29e161[_0x838b('0x2a')][_0x838b('0x2b')]};});_0x227876[_0x838b('0x2c')]=_[_0x838b('0x26')](_0x5aeeca,'name');_0x227876[_0x838b('0x2d')]=_[_0x838b('0x2e')](_0x4f6179[_0x838b('0x2d')]);_0x227876[_0x838b('0x2f')]=_['intersection'](_0x227876[_0x838b('0x2c')],_0x227876[_0x838b('0x2d')]);_0x1e74a6[_0x838b('0x30')]=_[_0x838b('0x31')](_0x227876[_0x838b('0x2c')],qs['fields'](_0x4f6179[_0x838b('0x2d')][_0x838b('0x32')]));_0x1e74a6[_0x838b('0x30')]=_0x1e74a6[_0x838b('0x30')]['length']?_0x1e74a6[_0x838b('0x30')]:_0x227876[_0x838b('0x2c')];if(!_0x4f6179['query'][_0x838b('0x33')](_0x838b('0x34'))){_0x1e74a6[_0x838b('0x1a')]=qs[_0x838b('0x1a')](_0x4f6179[_0x838b('0x2d')]['limit']);_0x1e74a6[_0x838b('0x18')]=qs[_0x838b('0x18')](_0x4f6179['query'][_0x838b('0x18')]);}_0x1e74a6['order']=qs[_0x838b('0x35')](_0x4f6179['query'][_0x838b('0x35')]);_0x1e74a6['where']=qs[_0x838b('0x2f')](_[_0x838b('0x36')](_0x4f6179[_0x838b('0x2d')],_0x227876[_0x838b('0x2f')]),_0x5aeeca);if(_0x4f6179[_0x838b('0x2d')][_0x838b('0x37')]){_0x1e74a6[_0x838b('0x38')]=_[_0x838b('0x39')](_0x1e74a6[_0x838b('0x38')],{'$or':_[_0x838b('0x26')](_0x5aeeca,function(_0x4ee9c2){if(_0x4ee9c2[_0x838b('0x2a')]!=='VIRTUAL'){var _0x24958f={};_0x24958f[_0x4ee9c2[_0x838b('0x25')]]={'$like':'%'+_0x4f6179[_0x838b('0x2d')][_0x838b('0x37')]+'%'};return _0x24958f;}})});}_0x1e74a6=_[_0x838b('0x39')]({},_0x1e74a6,_0x4f6179[_0x838b('0x3a')]);var _0x26dfab={'where':_0x1e74a6[_0x838b('0x38')]};return db['WhatsappApplication'][_0x838b('0x1b')](_0x26dfab)[_0x838b('0x22')](function(_0x18db4f){_0x5b66f6[_0x838b('0x1b')]=_0x18db4f;if(_0x4f6179[_0x838b('0x2d')][_0x838b('0x3b')]){_0x1e74a6['include']=[{'all':!![]}];}return db[_0x838b('0x27')]['findAll'](_0x1e74a6);})[_0x838b('0x22')](function(_0x3e67de){_0x5b66f6['rows']=_0x3e67de;return _0x5b66f6;})[_0x838b('0x22')](respondWithFilteredResult(_0x4b46bc,_0x1e74a6))[_0x838b('0x3c')](handleError(_0x4b46bc,null));};exports[_0x838b('0x3d')]=function(_0x8e18a8,_0x4a66fb){var _0x51689a={'raw':!![],'where':{'id':_0x8e18a8[_0x838b('0x3e')]['id']}},_0x3e727d={};_0x3e727d['model']=_[_0x838b('0x2e')](db['WhatsappApplication'][_0x838b('0x28')]);_0x3e727d[_0x838b('0x2d')]=_[_0x838b('0x2e')](_0x8e18a8[_0x838b('0x2d')]);_0x3e727d[_0x838b('0x2f')]=_['intersection'](_0x3e727d[_0x838b('0x2c')],_0x3e727d['query']);_0x51689a[_0x838b('0x30')]=_['intersection'](_0x3e727d[_0x838b('0x2c')],qs[_0x838b('0x32')](_0x8e18a8['query'][_0x838b('0x32')]));_0x51689a[_0x838b('0x30')]=_0x51689a['attributes'][_0x838b('0x3f')]?_0x51689a['attributes']:_0x3e727d[_0x838b('0x2c')];if(_0x8e18a8[_0x838b('0x2d')]['includeAll']){_0x51689a[_0x838b('0x40')]=[{'all':!![]}];}_0x51689a=_['merge']({},_0x51689a,_0x8e18a8['options']);return db['WhatsappApplication']['find'](_0x51689a)[_0x838b('0x22')](handleEntityNotFound(_0x4a66fb,null))[_0x838b('0x22')](respondWithResult(_0x4a66fb,null))[_0x838b('0x3c')](handleError(_0x4a66fb,null));};exports[_0x838b('0x41')]=function(_0x829aef,_0x1aaeb2){return db['WhatsappApplication'][_0x838b('0x41')](_0x829aef['body'],{})[_0x838b('0x22')](respondWithResult(_0x1aaeb2,0xc9))['catch'](handleError(_0x1aaeb2,null));};exports[_0x838b('0x21')]=function(_0x2b8990,_0x2d7e50){if(_0x2b8990[_0x838b('0x42')]['id']){delete _0x2b8990[_0x838b('0x42')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x2b8990[_0x838b('0x3e')]['id']}})[_0x838b('0x22')](handleEntityNotFound(_0x2d7e50,null))['then'](saveUpdates(_0x2b8990['body'],null))[_0x838b('0x22')](respondWithResult(_0x2d7e50,null))[_0x838b('0x3c')](handleError(_0x2d7e50,null));};exports[_0x838b('0x23')]=function(_0xa54216,_0x438afa){return db[_0x838b('0x27')][_0x838b('0x43')]({'where':{'id':_0xa54216[_0x838b('0x3e')]['id']}})[_0x838b('0x22')](handleEntityNotFound(_0x438afa,null))[_0x838b('0x22')](removeEntity(_0x438afa,null))['catch'](handleError(_0x438afa,null));}; \ No newline at end of file +var _0x0598=['merge','VIRTUAL','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','WhatsappApplication','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x0598,0x92));var _0x8059=function(_0x558487,_0x15bae5){_0x558487=_0x558487-0x0;var _0x4e726d=_0x0598[_0x558487];return _0x4e726d;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['WhatsappApplication']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':!![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['WhatsappApplication'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1108e67..efc63f3 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 _0x48ea=['lodash','../../config/logger','api','moment','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x48ea,0x9c));var _0xa48e=function(_0x45e6cf,_0x46cd24){_0x45e6cf=_0x45e6cf-0x0;var _0x4cba3f=_0x48ea[_0x45e6cf];return _0x4cba3f;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var logger=require(_0xa48e('0x1'))(_0xa48e('0x2'));var moment=require(_0xa48e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa48e('0x4'));var rimraf=require('rimraf');var config=require(_0xa48e('0x5'));var attributes=require(_0xa48e('0x6'));module[_0xa48e('0x7')]=function(_0x4387b5,_0x2b058d){return _0x4387b5[_0xa48e('0x8')](_0xa48e('0x9'),attributes,{'tableName':_0xa48e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa48e('0xb'),'collate':_0xa48e('0xc')});}; \ No newline at end of file +var _0x32ef=['WhatsappApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define'];(function(_0x56b963,_0x52279f){var _0x144fe4=function(_0xaba6f8){while(--_0xaba6f8){_0x56b963['push'](_0x56b963['shift']());}};_0x144fe4(++_0x52279f);}(_0x32ef,0xf9));var _0xf32e=function(_0xfe06e8,_0x4f6237){_0xfe06e8=_0xfe06e8-0x0;var _0x3fab35=_0x32ef[_0xfe06e8];return _0x3fab35;};'use strict';var _=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var logger=require(_0xf32e('0x2'))(_0xf32e('0x3'));var moment=require(_0xf32e('0x4'));var BPromise=require(_0xf32e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf32e('0x6'));var rimraf=require(_0xf32e('0x7'));var config=require('../../config/environment');var attributes=require(_0xf32e('0x8'));module[_0xf32e('0x9')]=function(_0x1a7d35,_0x1062c8){return _0x1a7d35[_0xf32e('0xa')](_0xf32e('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf32e('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 0c11782..6dbb935 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 _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x47c902,_0x220fd2){var _0x1ad6a0=function(_0xf9fdb0){while(--_0xf9fdb0){_0x47c902['push'](_0x47c902['shift']());}};_0x1ad6a0(++_0x220fd2);}(_0x9a19,0x114));var _0x99a1=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x9a19[_0x2d2ca2];return _0x48489d;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x50c3ff,_0x5025cb){var _0x13f78d=function(_0x2a73a8){while(--_0x2a73a8){_0x50c3ff['push'](_0x50c3ff['shift']());}};_0x13f78d(++_0x5025cb);}(_0xa8a8,0xec));var _0x8a8a=function(_0x5c73f8,_0xabfce3){_0x5c73f8=_0x5c73f8-0x0;var _0x1f780b=_0xa8a8[_0x5c73f8];return _0x1f780b;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 846650a..531bcb3 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 _0x6ec2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','/:id','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x448c77,_0x490e48){var _0x33eda2=function(_0x13b6b7){while(--_0x13b6b7){_0x448c77['push'](_0x448c77['shift']());}};_0x33eda2(++_0x490e48);}(_0x6ec2,0x78));var _0x26ec=function(_0x4eab29,_0x5e9eec){_0x4eab29=_0x4eab29-0x0;var _0x55e176=_0x6ec2[_0x4eab29];return _0x55e176;};'use strict';var multer=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var path=require(_0x26ec('0x2'));var timeout=require(_0x26ec('0x3'));var express=require(_0x26ec('0x4'));var router=express[_0x26ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ec('0x6'));var interaction=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var controller=require(_0x26ec('0x9'));router[_0x26ec('0xa')]('/',auth['isAuthenticated'](),controller[_0x26ec('0xb')]);router['get']('/describe',auth[_0x26ec('0xc')](),controller[_0x26ec('0xd')]);router[_0x26ec('0xa')]('/:id',auth[_0x26ec('0xc')](),controller['show']);router[_0x26ec('0xa')](_0x26ec('0xe'),auth[_0x26ec('0xc')](),controller[_0x26ec('0xf')]);router[_0x26ec('0xa')](_0x26ec('0x10'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x11')]);router[_0x26ec('0x12')]('/',auth[_0x26ec('0xc')](),controller['create']);router['post'](_0x26ec('0xe'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x13')]);router[_0x26ec('0x12')](_0x26ec('0x14'),auth[_0x26ec('0xc')](),interaction[_0x26ec('0x15')]('whatsapp',_0x26ec('0x16')),controller[_0x26ec('0x17')]);router[_0x26ec('0x18')](_0x26ec('0x19'),auth['isAuthenticated'](),interaction['tracked'](_0x26ec('0x1a'),_0x26ec('0x1b')),controller[_0x26ec('0x1c')]);router[_0x26ec('0x1d')]('/:id',auth[_0x26ec('0xc')](),interaction[_0x26ec('0x15')]('whatsapp','whatsappinteraction:destroy'),controller['destroy']);router[_0x26ec('0x1d')](_0x26ec('0x14'),auth[_0x26ec('0xc')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x8c46=['whatsappinteraction:addtags','addTags','update','delete','whatsapp','whatsappinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked'];(function(_0x10c07c,_0x3664b8){var _0x2ad7d2=function(_0xcbcec8){while(--_0xcbcec8){_0x10c07c['push'](_0x10c07c['shift']());}};_0x2ad7d2(++_0x3664b8);}(_0x8c46,0x171));var _0x68c4=function(_0x4f8784,_0x21dc05){_0x4f8784=_0x4f8784-0x0;var _0x4ec172=_0x8c46[_0x4f8784];return _0x4ec172;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0x7')](_0x68c4('0xc'),auth['isAuthenticated'](),controller[_0x68c4('0xd')]);router[_0x68c4('0x7')](_0x68c4('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x68c4('0x7')](_0x68c4('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x68c4('0x10')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x11')]);router['post'](_0x68c4('0xe'),auth[_0x68c4('0x8')](),controller[_0x68c4('0x12')]);router['post'](_0x68c4('0x13'),auth[_0x68c4('0x8')](),interaction[_0x68c4('0x14')]('whatsapp',_0x68c4('0x15')),controller[_0x68c4('0x16')]);router['put'](_0x68c4('0xc'),auth['isAuthenticated'](),interaction[_0x68c4('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x68c4('0x17')]);router[_0x68c4('0x18')]('/:id',auth[_0x68c4('0x8')](),interaction[_0x68c4('0x14')](_0x68c4('0x19'),_0x68c4('0x1a')),controller[_0x68c4('0x1b')]);router[_0x68c4('0x18')](_0x68c4('0x13'),auth[_0x68c4('0x8')](),controller[_0x68c4('0x1c')]);module[_0x68c4('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 62f2005..bc8bc1a 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 _0x1678=['INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x531c46,_0x55fa63){var _0x3b4ec5=function(_0x35c94b){while(--_0x35c94b){_0x531c46['push'](_0x531c46['shift']());}};_0x3b4ec5(++_0x55fa63);}(_0x1678,0x17b));var _0x8167=function(_0x23ce26,_0x2524ee){_0x23ce26=_0x23ce26-0x0;var _0x8d4207=_0x1678[_0x23ce26];return _0x8d4207;};'use strict';var Sequelize=require(_0x8167('0x0'));var moment=require(_0x8167('0x1'));module[_0x8167('0x2')]={'closed':{'type':Sequelize[_0x8167('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8167('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8167('0x5')]},'note':{'type':Sequelize[_0x8167('0x5')]},'phone':{'type':Sequelize[_0x8167('0x5')]},'read1stAt':{'type':Sequelize[_0x8167('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8167('0x6')]('in',_0x8167('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8167('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8167('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8167('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8167('0x8')]}}; \ No newline at end of file +var _0x7292=['INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x7292,0x6d));var _0x2729=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7292[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x2729('0x0'));var moment=require(_0x2729('0x1'));module[_0x2729('0x2')]={'closed':{'type':Sequelize[_0x2729('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2729('0x4')]},'disposition':{'type':Sequelize[_0x2729('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2729('0x5')]},'note':{'type':Sequelize[_0x2729('0x5')]},'phone':{'type':Sequelize[_0x2729('0x5')]},'read1stAt':{'type':Sequelize[_0x2729('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2729('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2729('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2729('0x6')]('in',_0x2729('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2729('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2729('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 30dd7cd..c1d7e45 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 _0xb3f9=['tmp','attachments','User','CmContact','firstName','push','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Account','Owner','fullname','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','direction','System','Contact','lastName','value','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','stack','name','map','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','model','keys','WhatsappInteraction','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','create','body','params','describe','ids','getMessages','WhatsappMessage','order','sort','where','pick','WhatsappInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','Tag','color','emit','whatsappInteractionTags:save','removeTags','toString','join','root','server','files'];(function(_0x35e4ee,_0x5a1de3){var _0x34cf61=function(_0x29ac33){while(--_0x29ac33){_0x35e4ee['push'](_0x35e4ee['shift']());}};_0x34cf61(++_0x5a1de3);}(_0xb3f9,0x122));var _0x9b3f=function(_0x4539b4,_0x574eb0){_0x4539b4=_0x4539b4-0x0;var _0x490b1a=_0xb3f9[_0x4539b4];return _0x490b1a;};'use strict';var rimraf=require(_0x9b3f('0x0'));var zipdir=require(_0x9b3f('0x1'));var moment=require(_0x9b3f('0x2'));var BPromise=require(_0x9b3f('0x3'));var util=require(_0x9b3f('0x4'));var path=require('path');var ejs=require(_0x9b3f('0x5'));var fs=require('fs');var _=require(_0x9b3f('0x6'));var Redis=require(_0x9b3f('0x7'));var interaction=require(_0x9b3f('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x9b3f('0x9'));var logger=require('../../config/logger')(_0x9b3f('0xa'));var config=require(_0x9b3f('0xb'));var db=require(_0x9b3f('0xc'))['db'];config[_0x9b3f('0xd')]=_['defaults'](config['redis'],{'host':_0x9b3f('0xe'),'port':0x18eb});var socket=require(_0x9b3f('0xf'))(new Redis(config[_0x9b3f('0xd')]));require(_0x9b3f('0x10'))[_0x9b3f('0x11')](socket);function respondWithStatusCode(_0x2a53d1,_0x32eafa){_0x32eafa=_0x32eafa||0xcc;return function(_0x154317){if(_0x154317){return _0x2a53d1[_0x9b3f('0x12')](_0x32eafa);}return _0x2a53d1[_0x9b3f('0x13')](_0x32eafa)[_0x9b3f('0x14')]();};}function respondWithResult(_0x202e07,_0x40faaf){_0x40faaf=_0x40faaf||0xc8;return function(_0x56a7b2){if(_0x56a7b2){return _0x202e07[_0x9b3f('0x13')](_0x40faaf)[_0x9b3f('0x15')](_0x56a7b2);}};}function respondWithFilteredResult(_0x39931d,_0x84412e){return function(_0x2d8879){if(_0x2d8879){var _0x1fec63=typeof _0x84412e[_0x9b3f('0x16')]===_0x9b3f('0x17')&&typeof _0x84412e[_0x9b3f('0x18')]===_0x9b3f('0x17');var _0x21fef5=_0x2d8879[_0x9b3f('0x19')];var _0x21cd24=_0x1fec63?0x0:_0x84412e['offset'];var _0x267da8=_0x1fec63?_0x2d8879[_0x9b3f('0x19')]:_0x84412e[_0x9b3f('0x16')]+_0x84412e[_0x9b3f('0x18')];var _0x50baf0;if(_0x267da8>=_0x21fef5){_0x267da8=_0x21fef5;_0x50baf0=0xc8;}else{_0x50baf0=0xce;}_0x39931d[_0x9b3f('0x13')](_0x50baf0);return _0x39931d[_0x9b3f('0x1a')](_0x9b3f('0x1b'),_0x21cd24+'-'+_0x267da8+'/'+_0x21fef5)[_0x9b3f('0x15')](_0x2d8879);}return null;};}function saveUpdates(_0x32fecc){return function(_0x4e159c){if(_0x4e159c){return _0x4e159c[_0x9b3f('0x1c')](_0x32fecc)['then'](function(_0x3addd7){return _0x3addd7;});}return null;};}function removeEntity(_0x406631){return function(_0x1c29d2){if(_0x1c29d2){return _0x1c29d2[_0x9b3f('0x1d')]()[_0x9b3f('0x1e')](function(){_0x406631['status'](0xcc)[_0x9b3f('0x14')]();});}};}function handleEntityNotFound(_0xbb7aa5){return function(_0x4f0e55){if(!_0x4f0e55){_0xbb7aa5[_0x9b3f('0x12')](0x194);}return _0x4f0e55;};}function handleError(_0x4ef190,_0x599b4a){_0x599b4a=_0x599b4a||0x1f4;return function(_0x18a8ce){logger['error'](_0x18a8ce[_0x9b3f('0x1f')]);if(_0x18a8ce[_0x9b3f('0x20')]){delete _0x18a8ce[_0x9b3f('0x20')];}_0x4ef190['status'](_0x599b4a)['send'](_0x18a8ce);};}exports['index']=function(_0x2d84d7,_0x1fb8f6){var _0x58b464={};var _0x5644e4=_[_0x9b3f('0x21')](db['WhatsappInteraction'][_0x9b3f('0x22')],function(_0x401eef){return{'name':_0x401eef[_0x9b3f('0x23')],'type':_0x401eef[_0x9b3f('0x24')][_0x9b3f('0x25')]};});_0x58b464=qs[_0x9b3f('0x26')](_0x5644e4,_0x2d84d7);return interaction[_0x9b3f('0x27')](_0x9b3f('0x28'),_0x2d84d7[_0x9b3f('0x29')],_0x2d84d7[_0x9b3f('0x2a')],_0x58b464,_0x5644e4)[_0x9b3f('0x1e')](respondWithFilteredResult(_0x1fb8f6,_0x58b464))['catch'](handleError(_0x1fb8f6,null));};exports['show']=function(_0x54ed85,_0x3bb032){var _0x85bb32={'raw':![],'where':{'id':_0x54ed85['params']['id']}},_0x406e30={};_0x406e30[_0x9b3f('0x2b')]=_[_0x9b3f('0x2c')](db[_0x9b3f('0x2d')]['rawAttributes']);_0x406e30['query']=_['keys'](_0x54ed85[_0x9b3f('0x29')]);_0x406e30[_0x9b3f('0x2e')]=_['intersection'](_0x406e30['model'],_0x406e30['query']);_0x85bb32[_0x9b3f('0x2f')]=_[_0x9b3f('0x30')](_0x406e30['model'],qs[_0x9b3f('0x31')](_0x54ed85[_0x9b3f('0x29')]['fields']));_0x85bb32[_0x9b3f('0x2f')]=_0x85bb32[_0x9b3f('0x2f')][_0x9b3f('0x32')]?_0x85bb32[_0x9b3f('0x2f')]:_0x406e30[_0x9b3f('0x2b')];if(_0x54ed85[_0x9b3f('0x29')][_0x9b3f('0x33')]){_0x85bb32[_0x9b3f('0x34')]=[{'all':!![]}];}_0x85bb32=_['merge']({},_0x85bb32,_0x54ed85[_0x9b3f('0x35')]);return db[_0x9b3f('0x2d')][_0x9b3f('0x36')](_0x85bb32)['then'](handleEntityNotFound(_0x3bb032,null))[_0x9b3f('0x1e')](respondWithResult(_0x3bb032,null))[_0x9b3f('0x37')](handleError(_0x3bb032,null));};exports[_0x9b3f('0x38')]=function(_0x1fd02d,_0x8c8a34){return db[_0x9b3f('0x2d')]['create'](_0x1fd02d['body'],{})[_0x9b3f('0x1e')](respondWithResult(_0x8c8a34,0xc9))[_0x9b3f('0x37')](handleError(_0x8c8a34,null));};exports['update']=function(_0x518afa,_0x44bea4){if(_0x518afa[_0x9b3f('0x39')]['id']){delete _0x518afa[_0x9b3f('0x39')]['id'];}return db[_0x9b3f('0x2d')][_0x9b3f('0x36')]({'where':{'id':_0x518afa['params']['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x44bea4,null))[_0x9b3f('0x1e')](saveUpdates(_0x518afa[_0x9b3f('0x39')],null))[_0x9b3f('0x1e')](respondWithResult(_0x44bea4,null))[_0x9b3f('0x37')](handleError(_0x44bea4,null));};exports[_0x9b3f('0x1d')]=function(_0x4de0cc,_0x57ac30){return db['WhatsappInteraction'][_0x9b3f('0x36')]({'where':{'id':_0x4de0cc[_0x9b3f('0x3a')]['id']}})['then'](handleEntityNotFound(_0x57ac30,null))[_0x9b3f('0x1e')](removeEntity(_0x57ac30,null))[_0x9b3f('0x37')](handleError(_0x57ac30,null));};exports[_0x9b3f('0x3b')]=function(_0x4ce00b,_0x5be3fd){return db[_0x9b3f('0x2d')][_0x9b3f('0x3b')]()[_0x9b3f('0x1e')](respondWithResult(_0x5be3fd,null))[_0x9b3f('0x37')](handleError(_0x5be3fd,null));};exports['addMessage']=function(_0x7a6369,_0x4c7cb9){return db['WhatsappMessage']['find']({'where':{'id':_0x7a6369[_0x9b3f('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4c7cb9,null))['then'](function(_0x4431c){if(_0x4431c){return _0x4431c['addMessage'](_0x7a6369[_0x9b3f('0x39')][_0x9b3f('0x3c')],_['omit'](_0x7a6369[_0x9b3f('0x39')],[_0x9b3f('0x3c'),'id'])||{});}})[_0x9b3f('0x1e')](respondWithResult(_0x4c7cb9,null))[_0x9b3f('0x37')](handleError(_0x4c7cb9,null));};exports[_0x9b3f('0x3d')]=function(_0x21455d,_0x36f69f){var _0x5abd51={'raw':![],'where':{}};var _0x1eae83={};var _0x468ea6={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x21455d[_0x9b3f('0x3a')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x36f69f,null))[_0x9b3f('0x1e')](function(_0x2bea23){if(_0x2bea23){_0x1eae83[_0x9b3f('0x2b')]=_[_0x9b3f('0x2c')](db[_0x9b3f('0x3e')][_0x9b3f('0x22')]);_0x1eae83[_0x9b3f('0x29')]=_[_0x9b3f('0x2c')](_0x21455d[_0x9b3f('0x29')]);_0x1eae83[_0x9b3f('0x2e')]=_[_0x9b3f('0x30')](_0x1eae83[_0x9b3f('0x2b')],_0x1eae83[_0x9b3f('0x29')]);_0x5abd51[_0x9b3f('0x2f')]=_[_0x9b3f('0x30')](_0x1eae83[_0x9b3f('0x2b')],qs[_0x9b3f('0x31')](_0x21455d[_0x9b3f('0x29')][_0x9b3f('0x31')]));_0x5abd51['attributes']=_0x5abd51['attributes']['length']?_0x5abd51['attributes']:_0x1eae83[_0x9b3f('0x2b')];if(!_0x21455d[_0x9b3f('0x29')]['hasOwnProperty']('nolimit')){_0x5abd51[_0x9b3f('0x18')]=qs[_0x9b3f('0x18')](_0x21455d['query']['limit']);_0x5abd51[_0x9b3f('0x16')]=qs['offset'](_0x21455d['query']['offset']);}_0x5abd51[_0x9b3f('0x3f')]=qs[_0x9b3f('0x40')](_0x21455d[_0x9b3f('0x29')][_0x9b3f('0x40')]);_0x5abd51[_0x9b3f('0x41')]=qs[_0x9b3f('0x2e')](_[_0x9b3f('0x42')](_0x21455d[_0x9b3f('0x29')],_0x1eae83[_0x9b3f('0x2e')]));_0x5abd51['where'][_0x9b3f('0x43')]=_0x2bea23['id'];if(_0x21455d[_0x9b3f('0x29')]['filter']){_0x5abd51['where']=_[_0x9b3f('0x44')](_0x5abd51[_0x9b3f('0x41')],{'$or':_[_0x9b3f('0x21')](_0x5abd51['attributes'],function(_0x2742e7){var _0x491eae={};_0x491eae[_0x2742e7]={'$like':'%'+_0x21455d['query'][_0x9b3f('0x45')]+'%'};return _0x491eae;})});}if(_0x21455d[_0x9b3f('0x29')]['$gte']){var _0x43f4a4=_0x21455d['query'][_0x9b3f('0x46')][_0x9b3f('0x47')](',');var _0x5624d1={};_0x5624d1[_0x43f4a4[0x0]]={'$gte':moment(_0x43f4a4[0x1])[_0x9b3f('0x48')](_0x9b3f('0x49'))};_0x5abd51['where']=_['merge'](_0x5abd51['where'],_0x5624d1);}_0x5abd51=_[_0x9b3f('0x44')]({},_0x5abd51,_0x21455d[_0x9b3f('0x35')]);return db[_0x9b3f('0x3e')][_0x9b3f('0x19')]({'where':_0x5abd51[_0x9b3f('0x41')]})['then'](function(_0x54d9ed){_0x468ea6['count']=_0x54d9ed;if(_0x21455d['query'][_0x9b3f('0x33')]){_0x5abd51['include']=[{'all':!![]}];}return db[_0x9b3f('0x3e')][_0x9b3f('0x27')](_0x5abd51);})['then'](function(_0x5af60a){_0x468ea6[_0x9b3f('0x4a')]=_0x5af60a;return _0x468ea6;});}})[_0x9b3f('0x1e')](respondWithFilteredResult(_0x36f69f,_0x5abd51))[_0x9b3f('0x37')](handleError(_0x36f69f,null));};exports[_0x9b3f('0x4b')]=function(_0x2d04fe,_0x235272){return db[_0x9b3f('0x2d')][_0x9b3f('0x36')]({'where':{'id':_0x2d04fe[_0x9b3f('0x3a')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x235272,null))[_0x9b3f('0x1e')](function(_0x2e86b1){if(_0x2e86b1){return _0x2e86b1[_0x9b3f('0x4c')](_0x2d04fe[_0x9b3f('0x39')][_0x9b3f('0x3c')],_[_0x9b3f('0x4d')](_0x2d04fe[_0x9b3f('0x39')],[_0x9b3f('0x3c'),'id'])||{})['spread'](function(){return db[_0x9b3f('0x4e')]['findAll']({'attributes':['id',_0x9b3f('0x20'),_0x9b3f('0x4f')],'where':{'id':_0x2d04fe['body'][_0x9b3f('0x3c')]}});})[_0x9b3f('0x1e')](function(_0x520b8e){socket[_0x9b3f('0x50')](_0x9b3f('0x51'),{'id':Number(_0x2d04fe[_0x9b3f('0x3a')]['id']),'tags':_0x520b8e||[]});return{'id':Number(_0x2d04fe['params']['id']),'tags':_0x520b8e||[]};});}})['then'](respondWithResult(_0x235272,null))[_0x9b3f('0x37')](handleError(_0x235272,null));};exports[_0x9b3f('0x52')]=function(_0x243536,_0x10ed2d){return db[_0x9b3f('0x2d')][_0x9b3f('0x36')]({'where':{'id':_0x243536['params']['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x10ed2d,null))[_0x9b3f('0x1e')](function(_0x4aeb7f){if(_0x4aeb7f){return _0x4aeb7f[_0x9b3f('0x52')](_0x243536[_0x9b3f('0x29')][_0x9b3f('0x3c')]);}})[_0x9b3f('0x1e')](respondWithStatusCode(_0x10ed2d,null))[_0x9b3f('0x37')](handleError(_0x10ed2d,null));};exports['download']=function(_0x6d506d,_0x428e85){var _0x4546da=moment()['unix']()[_0x9b3f('0x53')]();var _0xb63012=path[_0x9b3f('0x54')](config[_0x9b3f('0x55')],_0x9b3f('0x56'),_0x9b3f('0x57'),_0x9b3f('0x58'));var _0x30bfb7=path['join'](config[_0x9b3f('0x55')],_0x9b3f('0x56'),_0x9b3f('0x57'),_0x9b3f('0x59'));var _0x32b703=path[_0x9b3f('0x54')](_0xb63012,_0x4546da);var _0x5d6797=util['format']('transcript-%d-%s.zip',_0x6d506d[_0x9b3f('0x3a')]['id'],_0x4546da);var _0x7cc6ac=path[_0x9b3f('0x54')](_0xb63012,_0x5d6797);var _0x2ffb12=[];_0x2ffb12['push']({'model':db['User'],'as':_0x9b3f('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x2ffb12['push']({'model':db[_0x9b3f('0x5b')],'as':'Contact','attributes':['id',_0x9b3f('0x5c'),'lastName'],'raw':!![]});if(_0x6d506d[_0x9b3f('0x29')]['attachments']){_0x2ffb12[_0x9b3f('0x5d')]({'model':db['Attachment'],'as':_0x9b3f('0x5e'),'raw':!![]});}var _0x207a1e=[{'model':db[_0x9b3f('0x3e')],'as':_0x9b3f('0x5f'),'attributes':['id',_0x9b3f('0x39'),_0x9b3f('0x60'),'direction',_0x9b3f('0x61'),_0x9b3f('0x62')],'include':_0x2ffb12}];_0x207a1e[_0x9b3f('0x5d')]({'model':db[_0x9b3f('0x63')],'as':_0x9b3f('0x64'),'attributes':['id',_0x9b3f('0x20')]});_0x207a1e[_0x9b3f('0x5d')]({'model':db[_0x9b3f('0x5a')],'as':_0x9b3f('0x65'),'attributes':['id',_0x9b3f('0x66')]});return db[_0x9b3f('0x2d')]['find']({'where':{'id':_0x6d506d['params']['id']},'include':_0x207a1e})[_0x9b3f('0x1e')](handleEntityNotFound(_0x428e85,null))[_0x9b3f('0x1e')](function(_0x168d36){if(_0x168d36){var _0x2dbc3a=_0x168d36[_0x9b3f('0x67')]({'plain':!![]});fs[_0x9b3f('0x68')](_0x32b703);var _0x52252e={'channel':_0x9b3f('0x69'),'account':_0x2dbc3a['Account'][_0x9b3f('0x20')],'agent':_0x2dbc3a['Owner']?_0x2dbc3a[_0x9b3f('0x65')][_0x9b3f('0x66')]:_0x9b3f('0x6a'),'createdAt':moment(_0x2dbc3a[_0x9b3f('0x60')])[_0x9b3f('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9b3f('0x53')](),'closedAt':_0x2dbc3a[_0x9b3f('0x6b')]?moment(_0x2dbc3a[_0x9b3f('0x6c')])[_0x9b3f('0x48')](_0x9b3f('0x49'))['toString']():'','disposition':_0x2dbc3a[_0x9b3f('0x6d')],'messages':_(_0x2dbc3a[_0x9b3f('0x5f')])[_0x9b3f('0x45')]({'secret':![]})[_0x9b3f('0x21')](function(_0xb9f259){if(_0xb9f259['Attachment']){var _0x1061b0=path[_0x9b3f('0x54')](_0x30bfb7,_0xb9f259['Attachment'][_0x9b3f('0x6e')]);if(fs['existsSync'](_0x1061b0)){fs[_0x9b3f('0x6f')](_0x1061b0)[_0x9b3f('0x70')](fs[_0x9b3f('0x71')](path[_0x9b3f('0x54')](_0x32b703,_0xb9f259[_0x9b3f('0x5e')][_0x9b3f('0x6e')])));}}return{'date':moment(_0xb9f259[_0x9b3f('0x60')])[_0x9b3f('0x48')](_0x9b3f('0x49'))[_0x9b3f('0x53')](),'sender':_0xb9f259[_0x9b3f('0x72')]==='out'?_0xb9f259[_0x9b3f('0x5a')]?_0xb9f259['User'][_0x9b3f('0x66')]:_0x9b3f('0x73'):_0xb9f259[_0x9b3f('0x74')]['firstName']+(_0xb9f259[_0x9b3f('0x74')]['lastName']?'\x20'+_0xb9f259['Contact'][_0x9b3f('0x75')]:''),'body':_0xb9f259[_0x9b3f('0x5e')]?_0xb9f259[_0x9b3f('0x5e')][_0x9b3f('0x6e')]:_0xb9f259[_0x9b3f('0x39')],'direction':_0xb9f259[_0x9b3f('0x72')]==='out'?'A':'C','secret':_0xb9f259['secret'],'read':_0xb9f259[_0x9b3f('0x62')],'attachment':_0xb9f259['Attachment']};})[_0x9b3f('0x76')]()};return ejs['renderFile'](path[_0x9b3f('0x54')](config[_0x9b3f('0x55')],_0x9b3f('0x56'),'views',_0x9b3f('0x77')),{'interaction':_0x52252e})[_0x9b3f('0x1e')](function(_0x243d07){var _0x8d1f04=path['join'](_0x32b703,_0x9b3f('0x78')+_0x2dbc3a['id']+'-'+_0x4546da+_0x9b3f('0x79'));var _0xef6d9b={'path':_0x8d1f04,'channel':'Whatsapp','interactionId':_0x2dbc3a['id']};return pdf['createPdfFromHTML'](_0x243d07,_0xef6d9b);})[_0x9b3f('0x1e')](function(){return new BPromise(function(_0x237ed2,_0x574461){zipdir(_0x32b703,{'saveTo':_0x7cc6ac},function(_0x4c1c9f,_0x3390d9){if(_0x4c1c9f)return _0x574461(_0x4c1c9f);return _0x237ed2(_0x3390d9);});})[_0x9b3f('0x1e')](function(){return new BPromise(function(_0x35ba43,_0x52083b){rimraf(_0x32b703,function(_0x17d462){if(_0x17d462)_0x52083b(_0x17d462);return _0x35ba43();});});})['then'](function(){return _0x428e85[_0x9b3f('0x7a')](_0x7cc6ac,_0x5d6797,function(_0x36bb42){if(_0x36bb42){console[_0x9b3f('0x7b')](_0x9b3f('0x7c'),_0x36bb42);}else{fs[_0x9b3f('0x7d')](_0x7cc6ac);}});});});}else{return _0x428e85[_0x9b3f('0x12')](0xc8);}})[_0x9b3f('0x37')](handleError(_0x428e85,null));}; \ No newline at end of file +var _0xb678=['defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','update','then','destroy','error','stack','name','send','index','map','WhatsappInteraction','type','key','getOptions','findAll','whatsapp','catch','params','model','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','omit','ids','getMessages','keys','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','server','files','join','root','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','closedAt','disposition','basename','existsSync','createWriteStream','direction','Contact','value','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','rimraf','zip-dir','util','lodash','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x1318a7,_0x2975f6){var _0x525cd9=function(_0x22ba67){while(--_0x22ba67){_0x1318a7['push'](_0x1318a7['shift']());}};_0x525cd9(++_0x2975f6);}(_0xb678,0x6a));var _0x8b67=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xb678[_0x2642cb];return _0xe6e41;};'use strict';var rimraf=require(_0x8b67('0x0'));var zipdir=require(_0x8b67('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8b67('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8b67('0x3'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x8b67('0x4'));var logger=require(_0x8b67('0x5'))(_0x8b67('0x6'));var config=require(_0x8b67('0x7'));var db=require(_0x8b67('0x8'))['db'];config[_0x8b67('0x9')]=_[_0x8b67('0xa')](config[_0x8b67('0x9')],{'host':_0x8b67('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b67('0x9')]));require(_0x8b67('0xc'))[_0x8b67('0xd')](socket);function respondWithStatusCode(_0x5a30b8,_0x10d727){_0x10d727=_0x10d727||0xcc;return function(_0x4efa00){if(_0x4efa00){return _0x5a30b8[_0x8b67('0xe')](_0x10d727);}return _0x5a30b8[_0x8b67('0xf')](_0x10d727)[_0x8b67('0x10')]();};}function respondWithResult(_0x290bef,_0x1258b7){_0x1258b7=_0x1258b7||0xc8;return function(_0x2a094c){if(_0x2a094c){return _0x290bef[_0x8b67('0xf')](_0x1258b7)['json'](_0x2a094c);}};}function respondWithFilteredResult(_0x1246f6,_0x4cdb7d){return function(_0x369641){if(_0x369641){var _0x5b478c=typeof _0x4cdb7d['offset']===_0x8b67('0x11')&&typeof _0x4cdb7d[_0x8b67('0x12')]===_0x8b67('0x11');var _0x279120=_0x369641[_0x8b67('0x13')];var _0x39d4bd=_0x5b478c?0x0:_0x4cdb7d[_0x8b67('0x14')];var _0x68ee18=_0x5b478c?_0x369641[_0x8b67('0x13')]:_0x4cdb7d[_0x8b67('0x14')]+_0x4cdb7d[_0x8b67('0x12')];var _0x1f1333;if(_0x68ee18>=_0x279120){_0x68ee18=_0x279120;_0x1f1333=0xc8;}else{_0x1f1333=0xce;}_0x1246f6[_0x8b67('0xf')](_0x1f1333);return _0x1246f6[_0x8b67('0x15')]('Content-Range',_0x39d4bd+'-'+_0x68ee18+'/'+_0x279120)[_0x8b67('0x16')](_0x369641);}return null;};}function saveUpdates(_0x1c214e){return function(_0x3f945f){if(_0x3f945f){return _0x3f945f[_0x8b67('0x17')](_0x1c214e)[_0x8b67('0x18')](function(_0x245621){return _0x245621;});}return null;};}function removeEntity(_0x58b779){return function(_0x29a8da){if(_0x29a8da){return _0x29a8da[_0x8b67('0x19')]()[_0x8b67('0x18')](function(){_0x58b779['status'](0xcc)[_0x8b67('0x10')]();});}};}function handleEntityNotFound(_0x87e7dc){return function(_0xaadbaf){if(!_0xaadbaf){_0x87e7dc[_0x8b67('0xe')](0x194);}return _0xaadbaf;};}function handleError(_0x37e2d6,_0x4662cb){_0x4662cb=_0x4662cb||0x1f4;return function(_0x44a4b3){logger[_0x8b67('0x1a')](_0x44a4b3[_0x8b67('0x1b')]);if(_0x44a4b3[_0x8b67('0x1c')]){delete _0x44a4b3['name'];}_0x37e2d6[_0x8b67('0xf')](_0x4662cb)[_0x8b67('0x1d')](_0x44a4b3);};}exports[_0x8b67('0x1e')]=function(_0x29ac1e,_0x4b441e){var _0x58b774={};var _0x4ec9c8=_[_0x8b67('0x1f')](db[_0x8b67('0x20')]['rawAttributes'],function(_0x12417f){return{'name':_0x12417f['fieldName'],'type':_0x12417f[_0x8b67('0x21')][_0x8b67('0x22')]};});_0x58b774=qs[_0x8b67('0x23')](_0x4ec9c8,_0x29ac1e);return interaction[_0x8b67('0x24')](_0x8b67('0x25'),_0x29ac1e['query'],_0x29ac1e['user'],_0x58b774,_0x4ec9c8)[_0x8b67('0x18')](respondWithFilteredResult(_0x4b441e,_0x58b774))[_0x8b67('0x26')](handleError(_0x4b441e,null));};exports['show']=function(_0x225e50,_0x1d6d8c){var _0x4ecf0={'raw':![],'where':{'id':_0x225e50[_0x8b67('0x27')]['id']}},_0x561d53={};_0x561d53[_0x8b67('0x28')]=_['keys'](db[_0x8b67('0x20')][_0x8b67('0x29')]);_0x561d53['query']=_['keys'](_0x225e50[_0x8b67('0x2a')]);_0x561d53[_0x8b67('0x2b')]=_[_0x8b67('0x2c')](_0x561d53[_0x8b67('0x28')],_0x561d53[_0x8b67('0x2a')]);_0x4ecf0['attributes']=_[_0x8b67('0x2c')](_0x561d53[_0x8b67('0x28')],qs[_0x8b67('0x2d')](_0x225e50['query'][_0x8b67('0x2d')]));_0x4ecf0[_0x8b67('0x2e')]=_0x4ecf0['attributes']['length']?_0x4ecf0[_0x8b67('0x2e')]:_0x561d53['model'];if(_0x225e50['query'][_0x8b67('0x2f')]){_0x4ecf0[_0x8b67('0x30')]=[{'all':!![]}];}_0x4ecf0=_[_0x8b67('0x31')]({},_0x4ecf0,_0x225e50[_0x8b67('0x32')]);return db[_0x8b67('0x20')][_0x8b67('0x33')](_0x4ecf0)[_0x8b67('0x18')](handleEntityNotFound(_0x1d6d8c,null))[_0x8b67('0x18')](respondWithResult(_0x1d6d8c,null))[_0x8b67('0x26')](handleError(_0x1d6d8c,null));};exports['create']=function(_0x49d635,_0x2114fa){return db[_0x8b67('0x20')][_0x8b67('0x34')](_0x49d635[_0x8b67('0x35')],{})[_0x8b67('0x18')](respondWithResult(_0x2114fa,0xc9))[_0x8b67('0x26')](handleError(_0x2114fa,null));};exports[_0x8b67('0x17')]=function(_0x4945c2,_0x1e2b87){if(_0x4945c2['body']['id']){delete _0x4945c2[_0x8b67('0x35')]['id'];}return db['WhatsappInteraction'][_0x8b67('0x33')]({'where':{'id':_0x4945c2[_0x8b67('0x27')]['id']}})[_0x8b67('0x18')](handleEntityNotFound(_0x1e2b87,null))[_0x8b67('0x18')](saveUpdates(_0x4945c2[_0x8b67('0x35')],null))['then'](respondWithResult(_0x1e2b87,null))[_0x8b67('0x26')](handleError(_0x1e2b87,null));};exports[_0x8b67('0x19')]=function(_0x354eb6,_0x40ebed){return db['WhatsappInteraction'][_0x8b67('0x33')]({'where':{'id':_0x354eb6[_0x8b67('0x27')]['id']}})['then'](handleEntityNotFound(_0x40ebed,null))[_0x8b67('0x18')](removeEntity(_0x40ebed,null))['catch'](handleError(_0x40ebed,null));};exports[_0x8b67('0x36')]=function(_0x2d8b8d,_0x521b2b){return db[_0x8b67('0x20')][_0x8b67('0x36')]()[_0x8b67('0x18')](respondWithResult(_0x521b2b,null))['catch'](handleError(_0x521b2b,null));};exports[_0x8b67('0x37')]=function(_0x3ffa29,_0x5910c6){return db[_0x8b67('0x38')][_0x8b67('0x33')]({'where':{'id':_0x3ffa29[_0x8b67('0x27')]['id']}})[_0x8b67('0x18')](handleEntityNotFound(_0x5910c6,null))[_0x8b67('0x18')](function(_0x1cb2f4){if(_0x1cb2f4){return _0x1cb2f4[_0x8b67('0x37')](_0x3ffa29['body']['ids'],_[_0x8b67('0x39')](_0x3ffa29[_0x8b67('0x35')],[_0x8b67('0x3a'),'id'])||{});}})[_0x8b67('0x18')](respondWithResult(_0x5910c6,null))['catch'](handleError(_0x5910c6,null));};exports[_0x8b67('0x3b')]=function(_0x4450c6,_0x4d5be2){var _0xe01218={'raw':![],'where':{}};var _0x30c772={};var _0x2ea6c0={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x4450c6[_0x8b67('0x27')]['id']}})[_0x8b67('0x18')](handleEntityNotFound(_0x4d5be2,null))[_0x8b67('0x18')](function(_0xe33240){if(_0xe33240){_0x30c772[_0x8b67('0x28')]=_[_0x8b67('0x3c')](db[_0x8b67('0x38')][_0x8b67('0x29')]);_0x30c772[_0x8b67('0x2a')]=_[_0x8b67('0x3c')](_0x4450c6[_0x8b67('0x2a')]);_0x30c772[_0x8b67('0x2b')]=_['intersection'](_0x30c772[_0x8b67('0x28')],_0x30c772['query']);_0xe01218['attributes']=_[_0x8b67('0x2c')](_0x30c772[_0x8b67('0x28')],qs[_0x8b67('0x2d')](_0x4450c6[_0x8b67('0x2a')][_0x8b67('0x2d')]));_0xe01218[_0x8b67('0x2e')]=_0xe01218[_0x8b67('0x2e')]['length']?_0xe01218['attributes']:_0x30c772[_0x8b67('0x28')];if(!_0x4450c6['query'][_0x8b67('0x3d')](_0x8b67('0x3e'))){_0xe01218[_0x8b67('0x12')]=qs[_0x8b67('0x12')](_0x4450c6[_0x8b67('0x2a')][_0x8b67('0x12')]);_0xe01218[_0x8b67('0x14')]=qs['offset'](_0x4450c6['query'][_0x8b67('0x14')]);}_0xe01218[_0x8b67('0x3f')]=qs[_0x8b67('0x40')](_0x4450c6[_0x8b67('0x2a')][_0x8b67('0x40')]);_0xe01218[_0x8b67('0x41')]=qs[_0x8b67('0x2b')](_[_0x8b67('0x42')](_0x4450c6[_0x8b67('0x2a')],_0x30c772[_0x8b67('0x2b')]));_0xe01218[_0x8b67('0x41')][_0x8b67('0x43')]=_0xe33240['id'];if(_0x4450c6['query'][_0x8b67('0x44')]){_0xe01218['where']=_['merge'](_0xe01218[_0x8b67('0x41')],{'$or':_[_0x8b67('0x1f')](_0xe01218[_0x8b67('0x2e')],function(_0x2a90bf){var _0x182d29={};_0x182d29[_0x2a90bf]={'$like':'%'+_0x4450c6['query'][_0x8b67('0x44')]+'%'};return _0x182d29;})});}if(_0x4450c6['query']['$gte']){var _0x4b8fac=_0x4450c6[_0x8b67('0x2a')][_0x8b67('0x45')]['split'](',');var _0x3bb588={};_0x3bb588[_0x4b8fac[0x0]]={'$gte':moment(_0x4b8fac[0x1])['format'](_0x8b67('0x46'))};_0xe01218[_0x8b67('0x41')]=_[_0x8b67('0x31')](_0xe01218[_0x8b67('0x41')],_0x3bb588);}_0xe01218=_[_0x8b67('0x31')]({},_0xe01218,_0x4450c6[_0x8b67('0x32')]);return db['WhatsappMessage']['count']({'where':_0xe01218[_0x8b67('0x41')]})['then'](function(_0x75286f){_0x2ea6c0[_0x8b67('0x13')]=_0x75286f;if(_0x4450c6[_0x8b67('0x2a')][_0x8b67('0x2f')]){_0xe01218[_0x8b67('0x30')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0xe01218);})['then'](function(_0x2160f9){_0x2ea6c0[_0x8b67('0x47')]=_0x2160f9;return _0x2ea6c0;});}})[_0x8b67('0x18')](respondWithFilteredResult(_0x4d5be2,_0xe01218))['catch'](handleError(_0x4d5be2,null));};exports['addTags']=function(_0x2b14bd,_0x26f0b7){return db[_0x8b67('0x20')][_0x8b67('0x33')]({'where':{'id':_0x2b14bd[_0x8b67('0x27')]['id']}})[_0x8b67('0x18')](handleEntityNotFound(_0x26f0b7,null))[_0x8b67('0x18')](function(_0x560ce6){if(_0x560ce6){return _0x560ce6[_0x8b67('0x48')](_0x2b14bd[_0x8b67('0x35')]['ids'],_[_0x8b67('0x39')](_0x2b14bd[_0x8b67('0x35')],[_0x8b67('0x3a'),'id'])||{})['spread'](function(){return db[_0x8b67('0x49')][_0x8b67('0x24')]({'attributes':['id',_0x8b67('0x1c'),'color'],'where':{'id':_0x2b14bd[_0x8b67('0x35')]['ids']}});})[_0x8b67('0x18')](function(_0x497587){socket[_0x8b67('0x4a')](_0x8b67('0x4b'),{'id':Number(_0x2b14bd[_0x8b67('0x27')]['id']),'tags':_0x497587||[]});return{'id':Number(_0x2b14bd[_0x8b67('0x27')]['id']),'tags':_0x497587||[]};});}})['then'](respondWithResult(_0x26f0b7,null))[_0x8b67('0x26')](handleError(_0x26f0b7,null));};exports[_0x8b67('0x4c')]=function(_0x3a8adb,_0x15bd4a){return db['WhatsappInteraction'][_0x8b67('0x33')]({'where':{'id':_0x3a8adb['params']['id']}})[_0x8b67('0x18')](handleEntityNotFound(_0x15bd4a,null))[_0x8b67('0x18')](function(_0x2c617d){if(_0x2c617d){return _0x2c617d[_0x8b67('0x4c')](_0x3a8adb[_0x8b67('0x2a')]['ids']);}})[_0x8b67('0x18')](respondWithStatusCode(_0x15bd4a,null))[_0x8b67('0x26')](handleError(_0x15bd4a,null));};exports[_0x8b67('0x4d')]=function(_0x2c48ce,_0x6f3db1){var _0x1f4884=moment()[_0x8b67('0x4e')]()[_0x8b67('0x4f')]();var _0x41f162=path['join'](config['root'],_0x8b67('0x50'),_0x8b67('0x51'),'tmp');var _0x4c665c=path[_0x8b67('0x52')](config[_0x8b67('0x53')],_0x8b67('0x50'),'files',_0x8b67('0x54'));var _0x11d529=path[_0x8b67('0x52')](_0x41f162,_0x1f4884);var _0x15ac72=util[_0x8b67('0x55')](_0x8b67('0x56'),_0x2c48ce[_0x8b67('0x27')]['id'],_0x1f4884);var _0x195bc8=path[_0x8b67('0x52')](_0x41f162,_0x15ac72);var _0x1ab122=[];_0x1ab122[_0x8b67('0x57')]({'model':db[_0x8b67('0x58')],'as':'User','attributes':['id',_0x8b67('0x59')],'raw':!![]});_0x1ab122['push']({'model':db[_0x8b67('0x5a')],'as':'Contact','attributes':['id',_0x8b67('0x5b'),_0x8b67('0x5c')],'raw':!![]});if(_0x2c48ce['query'][_0x8b67('0x54')]){_0x1ab122[_0x8b67('0x57')]({'model':db[_0x8b67('0x5d')],'as':'Attachment','raw':!![]});}var _0x482856=[{'model':db[_0x8b67('0x38')],'as':_0x8b67('0x5e'),'attributes':['id',_0x8b67('0x35'),'createdAt','direction',_0x8b67('0x5f'),'read'],'include':_0x1ab122}];_0x482856['push']({'model':db[_0x8b67('0x60')],'as':_0x8b67('0x61'),'attributes':['id',_0x8b67('0x1c')]});_0x482856[_0x8b67('0x57')]({'model':db[_0x8b67('0x58')],'as':_0x8b67('0x62'),'attributes':['id',_0x8b67('0x59')]});return db[_0x8b67('0x20')][_0x8b67('0x33')]({'where':{'id':_0x2c48ce[_0x8b67('0x27')]['id']},'include':_0x482856})[_0x8b67('0x18')](handleEntityNotFound(_0x6f3db1,null))[_0x8b67('0x18')](function(_0x15d4c0){if(_0x15d4c0){var _0xddd626=_0x15d4c0[_0x8b67('0x63')]({'plain':!![]});fs[_0x8b67('0x64')](_0x11d529);var _0x2f8a1c={'channel':_0x8b67('0x65'),'account':_0xddd626[_0x8b67('0x61')]['name'],'agent':_0xddd626['Owner']?_0xddd626[_0x8b67('0x62')]['fullname']:_0x8b67('0x66'),'createdAt':moment(_0xddd626[_0x8b67('0x67')])[_0x8b67('0x55')](_0x8b67('0x46'))[_0x8b67('0x4f')](),'closedAt':_0xddd626['closed']?moment(_0xddd626[_0x8b67('0x68')])[_0x8b67('0x55')](_0x8b67('0x46'))[_0x8b67('0x4f')]():'','disposition':_0xddd626[_0x8b67('0x69')],'messages':_(_0xddd626[_0x8b67('0x5e')])[_0x8b67('0x44')]({'secret':![]})[_0x8b67('0x1f')](function(_0x25e97f){if(_0x25e97f[_0x8b67('0x5d')]){var _0x19e514=path['join'](_0x4c665c,_0x25e97f[_0x8b67('0x5d')][_0x8b67('0x6a')]);if(fs[_0x8b67('0x6b')](_0x19e514)){fs['createReadStream'](_0x19e514)['pipe'](fs[_0x8b67('0x6c')](path[_0x8b67('0x52')](_0x11d529,_0x25e97f['Attachment']['basename'])));}}return{'date':moment(_0x25e97f[_0x8b67('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8b67('0x4f')](),'sender':_0x25e97f[_0x8b67('0x6d')]==='out'?_0x25e97f['User']?_0x25e97f['User'][_0x8b67('0x59')]:'System':_0x25e97f['Contact'][_0x8b67('0x5b')]+(_0x25e97f['Contact']['lastName']?'\x20'+_0x25e97f[_0x8b67('0x6e')][_0x8b67('0x5c')]:''),'body':_0x25e97f[_0x8b67('0x5d')]?_0x25e97f[_0x8b67('0x5d')][_0x8b67('0x6a')]:_0x25e97f[_0x8b67('0x35')],'direction':_0x25e97f[_0x8b67('0x6d')]==='out'?'A':'C','secret':_0x25e97f[_0x8b67('0x5f')],'read':_0x25e97f['read'],'attachment':_0x25e97f[_0x8b67('0x5d')]};})[_0x8b67('0x6f')]()};return ejs['renderFile'](path[_0x8b67('0x52')](config[_0x8b67('0x53')],'server','views',_0x8b67('0x70')),{'interaction':_0x2f8a1c})[_0x8b67('0x18')](function(_0x2db66f){var _0x351f05=path['join'](_0x11d529,_0x8b67('0x71')+_0xddd626['id']+'-'+_0x1f4884+'.pdf');var _0x1084f0={'path':_0x351f05,'channel':_0x8b67('0x65'),'interactionId':_0xddd626['id']};return pdf[_0x8b67('0x72')](_0x2db66f,_0x1084f0);})[_0x8b67('0x18')](function(){return new BPromise(function(_0x14a10a,_0x1afd2c){zipdir(_0x11d529,{'saveTo':_0x195bc8},function(_0xef30a2,_0x41067a){if(_0xef30a2)return _0x1afd2c(_0xef30a2);return _0x14a10a(_0x41067a);});})[_0x8b67('0x18')](function(){return new BPromise(function(_0x250581,_0x235fe7){rimraf(_0x11d529,function(_0x3fcc9c){if(_0x3fcc9c)_0x235fe7(_0x3fcc9c);return _0x250581();});});})[_0x8b67('0x18')](function(){return _0x6f3db1['download'](_0x195bc8,_0x15ac72,function(_0x391d66){if(_0x391d66){console[_0x8b67('0x73')]('err',_0x391d66);}else{fs['unlinkSync'](_0x195bc8);}});});});}else{return _0x6f3db1[_0x8b67('0xe')](0xc8);}})[_0x8b67('0x26')](handleError(_0x6f3db1,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4729e0a..fc9638e 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 _0x422f=['map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','WhatsappMessage','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x506a4f,_0x188735){var _0x59ab1b=function(_0x10ccdb){while(--_0x10ccdb){_0x506a4f['push'](_0x506a4f['shift']());}};_0x59ab1b(++_0x188735);}(_0x422f,0x1c7));var _0xf422=function(_0x31fe44,_0x33271b){_0x31fe44=_0x31fe44-0x0;var _0x424745=_0x422f[_0x31fe44];return _0x424745;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xf422('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xf422('0x0'))['db'][_0xf422('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf422('0x2'),'afterUpdate':_0xf422('0x3'),'afterDestroy':_0xf422('0x4')};function emitEvent(_0x444ad5){return function(_0x16047c,_0x434f27,_0x3e3e5d){_0x16047c[_0xf422('0x5')]({'attributes':['id'],'raw':!![]})[_0xf422('0x6')](function(_0x583283){_0x16047c[_0xf422('0x7')](_0xf422('0x8'),_0x583283[_0xf422('0x9')](function(_0x23a1bf){return{'id':_0x23a1bf['id']};}));return WhatsappMessage[_0xf422('0xa')]({'where':{'WhatsappInteractionId':_0x16047c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x419ec4){_0x16047c['setDataValue']('unreadMessages',_0x419ec4[_0xf422('0xb')]);WhatsappInteractionEvents[_0xf422('0xc')](_0x444ad5+':'+_0x16047c['id'],_0x16047c);WhatsappInteractionEvents[_0xf422('0xc')](_0x444ad5,_0x16047c);_0x3e3e5d(null);})[_0xf422('0xd')](_0x3e3e5d(null));};}for(var e in events){if(events[_0xf422('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xf422('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6e6c=['events','../../mysqldb','WhatsappMessage','update','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xc6e6('0x0'));var WhatsappInteraction=require(_0xc6e6('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xc6e6('0x1'))['db'][_0xc6e6('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc6e6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40b7e1){return function(_0x4b13f0,_0xe59212,_0x1182c7){_0x4b13f0['getUsers']({'attributes':['id'],'raw':!![]})[_0xc6e6('0x4')](function(_0x30a10b){_0x4b13f0['setDataValue'](_0xc6e6('0x5'),_0x30a10b[_0xc6e6('0x6')](function(_0x5a7ef3){return{'id':_0x5a7ef3['id']};}));return WhatsappMessage[_0xc6e6('0x7')]({'where':{'WhatsappInteractionId':_0x4b13f0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x172aa9){_0x4b13f0[_0xc6e6('0x8')](_0xc6e6('0x9'),_0x172aa9[_0xc6e6('0xa')]);WhatsappInteractionEvents[_0xc6e6('0xb')](_0x40b7e1+':'+_0x4b13f0['id'],_0x4b13f0);WhatsappInteractionEvents[_0xc6e6('0xb')](_0x40b7e1,_0x4b13f0);_0x1182c7(null);})[_0xc6e6('0xc')](_0x1182c7(null));};}for(var e in events){if(events[_0xc6e6('0xd')](e)){var event=events[e];WhatsappInteraction[_0xc6e6('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 9b57722..eb0e07b 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 _0x7ff7=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','changed','closed','closedAt'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7ff7,0xef));var _0x77ff=function(_0x20c425,_0xe35a98){_0x20c425=_0x20c425-0x0;var _0x3e9a5c=_0x7ff7[_0x20c425];return _0x3e9a5c;};'use strict';var _=require(_0x77ff('0x0'));var util=require('util');var logger=require(_0x77ff('0x1'))(_0x77ff('0x2'));var moment=require(_0x77ff('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x77ff('0x4'));var rimraf=require(_0x77ff('0x5'));var config=require(_0x77ff('0x6'));var attributes=require(_0x77ff('0x7'));module['exports']=function(_0x5e3b10,_0x3a5e03){return _0x5e3b10[_0x77ff('0x8')](_0x77ff('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cf9e3,_0x3be72b,_0x2638d9){if(_0x2cf9e3[_0x77ff('0xa')](_0x77ff('0xb'))){_0x2cf9e3[_0x77ff('0xc')]=moment()['format'](_0x77ff('0xd'));}_0x2638d9(null,_0x2cf9e3);}}});}; \ No newline at end of file +var _0x0214=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x15d9a0,_0x3d2b19){var _0x5661cf=function(_0x283e16){while(--_0x283e16){_0x15d9a0['push'](_0x15d9a0['shift']());}};_0x5661cf(++_0x3d2b19);}(_0x0214,0xf0));var _0x4021=function(_0x28de75,_0x103055){_0x28de75=_0x28de75-0x0;var _0xa1b275=_0x0214[_0x28de75];return _0xa1b275;};'use strict';var _=require(_0x4021('0x0'));var util=require(_0x4021('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4021('0x2'));var BPromise=require(_0x4021('0x3'));var rp=require(_0x4021('0x4'));var fs=require('fs');var path=require(_0x4021('0x5'));var rimraf=require('rimraf');var config=require(_0x4021('0x6'));var attributes=require(_0x4021('0x7'));module[_0x4021('0x8')]=function(_0xfe186c,_0x50d2d5){return _0xfe186c[_0x4021('0x9')](_0x4021('0xa'),attributes,{'tableName':_0x4021('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x514d67,_0x195282,_0x41dcee){if(_0x514d67[_0x4021('0xc')](_0x4021('0xd'))){_0x514d67[_0x4021('0xe')]=moment()[_0x4021('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x41dcee(null,_0x514d67);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 07f2bf6..67d3ecf 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 _0x1abf=['stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','omit','ids','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x1abf,0x1d6));var _0xf1ab=function(_0xb49f68,_0x3b2899){_0xb49f68=_0xb49f68-0x0;var _0x503f83=_0x1abf[_0xb49f68];return _0x503f83;};'use strict';var _=require('lodash');var util=require(_0xf1ab('0x0'));var moment=require(_0xf1ab('0x1'));var BPromise=require('bluebird');var rs=require(_0xf1ab('0x2'));var fs=require('fs');var Redis=require(_0xf1ab('0x3'));var db=require(_0xf1ab('0x4'))['db'];var utils=require(_0xf1ab('0x5'));var logger=require(_0xf1ab('0x6'))(_0xf1ab('0x7'));var config=require(_0xf1ab('0x8'));var jayson=require(_0xf1ab('0x9'));var client=jayson[_0xf1ab('0xa')][_0xf1ab('0xb')]({'port':0x232a});config[_0xf1ab('0xc')]=_['defaults'](config[_0xf1ab('0xc')],{'host':_0xf1ab('0xd'),'port':0x18eb});var socket=require(_0xf1ab('0xe'))(new Redis(config[_0xf1ab('0xc')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x314474,_0xb4a110,_0x5a87d8){return new BPromise(function(_0xf6b23e,_0x342a86){return client[_0xf1ab('0xf')](_0x314474,_0x5a87d8)[_0xf1ab('0x10')](function(_0x36198a){logger[_0xf1ab('0x11')](_0xf1ab('0x12'),_0xb4a110,_0xf1ab('0x13'));logger[_0xf1ab('0x14')](_0xf1ab('0x15'),_0xb4a110,_0xf1ab('0x13'),JSON[_0xf1ab('0x16')](_0x36198a));if(_0x36198a[_0xf1ab('0x17')]){if(_0x36198a[_0xf1ab('0x17')][_0xf1ab('0x18')]===0x1f4){logger['error'](_0xf1ab('0x12'),_0xb4a110,_0x36198a[_0xf1ab('0x17')][_0xf1ab('0x19')]);return _0x342a86(_0x36198a[_0xf1ab('0x17')][_0xf1ab('0x19')]);}logger['error'](_0xf1ab('0x12'),_0xb4a110,_0x36198a[_0xf1ab('0x17')][_0xf1ab('0x19')]);return _0xf6b23e(_0x36198a[_0xf1ab('0x17')][_0xf1ab('0x19')]);}else{logger[_0xf1ab('0x11')](_0xf1ab('0x12'),_0xb4a110,'request\x20sent');_0xf6b23e(_0x36198a[_0xf1ab('0x1a')][_0xf1ab('0x19')]);}})[_0xf1ab('0x1b')](function(_0x1ca2ed){logger[_0xf1ab('0x17')](_0xf1ab('0x12'),_0xb4a110,_0x1ca2ed);_0x342a86(_0x1ca2ed);});});}exports[_0xf1ab('0x1c')]=function(_0x14a07c){var _0x5127d4=this;return new Promise(function(_0x734437,_0x41abb2){return db[_0xf1ab('0x1d')][_0xf1ab('0x1e')](_0x14a07c[_0xf1ab('0x1f')],{'raw':_0x14a07c['options']?_0x14a07c[_0xf1ab('0x20')][_0xf1ab('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14a07c['options']?_0x14a07c[_0xf1ab('0x20')][_0xf1ab('0x22')]||null:null,'attributes':_0x14a07c[_0xf1ab('0x20')]?_0x14a07c[_0xf1ab('0x20')][_0xf1ab('0x23')]||null:null,'limit':_0x14a07c[_0xf1ab('0x20')]?_0x14a07c[_0xf1ab('0x20')][_0xf1ab('0x24')]||null:null})[_0xf1ab('0x10')](function(_0x531674){logger[_0xf1ab('0x11')]('UpdateWhatsappInteraction',_0x14a07c);logger[_0xf1ab('0x14')]('UpdateWhatsappInteraction',_0x14a07c,JSON[_0xf1ab('0x16')](_0x531674));_0x734437(_0x531674);})[_0xf1ab('0x1b')](function(_0x5f4be8){logger[_0xf1ab('0x17')]('UpdateWhatsappInteraction',_0x5f4be8[_0xf1ab('0x19')],_0x14a07c);_0x41abb2(_0x5127d4[_0xf1ab('0x17')](0x1f4,_0x5f4be8[_0xf1ab('0x19')]));});});};exports[_0xf1ab('0x25')]=function(_0x2e03fe){return new Promise(function(_0x4c8d4a,_0x5532a6){return db[_0xf1ab('0x1d')]['find']({'where':_0x2e03fe['options']?_0x2e03fe['options'][_0xf1ab('0x22')]||null:null})[_0xf1ab('0x10')](function(_0x53253d){if(_0x53253d){return _0x53253d['addTags'](_0x2e03fe[_0xf1ab('0x1f')]['ids'],_[_0xf1ab('0x26')](_0x2e03fe[_0xf1ab('0x1f')],[_0xf1ab('0x27'),'id'])||{});}})['spread'](function(_0x552c15){logger['info'](_0xf1ab('0x28'),_0x2e03fe);logger[_0xf1ab('0x14')]('AddTags',_0x2e03fe,JSON[_0xf1ab('0x16')](_0x552c15));_0x4c8d4a(_0x552c15);})[_0xf1ab('0x1b')](function(_0x4c33b4){logger[_0xf1ab('0x17')](_0xf1ab('0x28'),_0x4c33b4[_0xf1ab('0x19')],_0x2e03fe);_0x5532a6(_this[_0xf1ab('0x17')](0x1f4,_0x4c33b4['message']));});});}; \ No newline at end of file +var _0x2d2c=['error','code','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','limit','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5765db,_0x409bde){var _0x187812=function(_0x504d83){while(--_0x504d83){_0x5765db['push'](_0x5765db['shift']());}};_0x187812(++_0x409bde);}(_0x2d2c,0xaf));var _0xc2d2=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0x2d2c[_0x1945a5];return _0x5817a5;};'use strict';var _=require('lodash');var util=require(_0xc2d2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2d2('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc2d2('0x2'));var config=require(_0xc2d2('0x3'));var jayson=require(_0xc2d2('0x4'));var client=jayson[_0xc2d2('0x5')][_0xc2d2('0x6')]({'port':0x232a});config[_0xc2d2('0x7')]=_[_0xc2d2('0x8')](config['redis'],{'host':_0xc2d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc2d2('0x7')]));require(_0xc2d2('0xa'))[_0xc2d2('0xb')](socket);function respondWithRpcPromise(_0x5baad2,_0x2fd009,_0x59fe79){return new BPromise(function(_0x6bd696,_0x2aad44){return client[_0xc2d2('0xc')](_0x5baad2,_0x59fe79)[_0xc2d2('0xd')](function(_0x1d910d){logger[_0xc2d2('0xe')](_0xc2d2('0xf'),_0x2fd009,_0xc2d2('0x10'));logger[_0xc2d2('0x11')](_0xc2d2('0x12'),_0x2fd009,_0xc2d2('0x10'),JSON[_0xc2d2('0x13')](_0x1d910d));if(_0x1d910d[_0xc2d2('0x14')]){if(_0x1d910d[_0xc2d2('0x14')][_0xc2d2('0x15')]===0x1f4){logger[_0xc2d2('0x14')](_0xc2d2('0xf'),_0x2fd009,_0x1d910d[_0xc2d2('0x14')][_0xc2d2('0x16')]);return _0x2aad44(_0x1d910d[_0xc2d2('0x14')]['message']);}logger[_0xc2d2('0x14')](_0xc2d2('0xf'),_0x2fd009,_0x1d910d[_0xc2d2('0x14')][_0xc2d2('0x16')]);return _0x6bd696(_0x1d910d[_0xc2d2('0x14')][_0xc2d2('0x16')]);}else{logger[_0xc2d2('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x2fd009,_0xc2d2('0x10'));_0x6bd696(_0x1d910d[_0xc2d2('0x17')][_0xc2d2('0x16')]);}})[_0xc2d2('0x18')](function(_0x1625ff){logger['error'](_0xc2d2('0xf'),_0x2fd009,_0x1625ff);_0x2aad44(_0x1625ff);});});}exports[_0xc2d2('0x19')]=function(_0x531641){var _0x452348=this;return new Promise(function(_0x365f6d,_0x30fb40){return db['WhatsappInteraction'][_0xc2d2('0x1a')](_0x531641[_0xc2d2('0x1b')],{'raw':_0x531641[_0xc2d2('0x1c')]?_0x531641[_0xc2d2('0x1c')][_0xc2d2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531641[_0xc2d2('0x1c')]?_0x531641['options'][_0xc2d2('0x1e')]||null:null,'attributes':_0x531641[_0xc2d2('0x1c')]?_0x531641[_0xc2d2('0x1c')]['attributes']||null:null,'limit':_0x531641[_0xc2d2('0x1c')]?_0x531641[_0xc2d2('0x1c')][_0xc2d2('0x1f')]||null:null})['then'](function(_0x5654b6){logger['info'](_0xc2d2('0x19'),_0x531641);logger[_0xc2d2('0x11')](_0xc2d2('0x19'),_0x531641,JSON['stringify'](_0x5654b6));_0x365f6d(_0x5654b6);})[_0xc2d2('0x18')](function(_0x1679b8){logger['error'](_0xc2d2('0x19'),_0x1679b8[_0xc2d2('0x16')],_0x531641);_0x30fb40(_0x452348[_0xc2d2('0x14')](0x1f4,_0x1679b8['message']));});});};exports[_0xc2d2('0x20')]=function(_0x5b8db6){return new Promise(function(_0xe028b6,_0x1d5554){return db['WhatsappInteraction'][_0xc2d2('0x21')]({'where':_0x5b8db6['options']?_0x5b8db6[_0xc2d2('0x1c')][_0xc2d2('0x1e')]||null:null})['then'](function(_0x2dd337){if(_0x2dd337){return _0x2dd337[_0xc2d2('0x22')](_0x5b8db6[_0xc2d2('0x1b')][_0xc2d2('0x23')],_[_0xc2d2('0x24')](_0x5b8db6['body'],[_0xc2d2('0x23'),'id'])||{});}})[_0xc2d2('0x25')](function(_0x25f123){logger[_0xc2d2('0xe')]('AddTags',_0x5b8db6);logger[_0xc2d2('0x11')](_0xc2d2('0x26'),_0x5b8db6,JSON[_0xc2d2('0x13')](_0x25f123));_0xe028b6(_0x25f123);})['catch'](function(_0x16d076){logger[_0xc2d2('0x14')](_0xc2d2('0x26'),_0x16d076[_0xc2d2('0x16')],_0x5b8db6);_0x1d5554(_this[_0xc2d2('0x14')](0x1f4,_0x16d076['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 4f4538a..29b9aba 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 _0xb7d5=['update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0xb7d5,0x116));var _0x5b7d=function(_0x18b47d,_0x170b85){_0x18b47d=_0x18b47d-0x0;var _0x1b0086=_0xb7d5[_0x18b47d];return _0x1b0086;};'use strict';var WhatsappInteractionEvents=require(_0x5b7d('0x0'));var events=[_0x5b7d('0x1'),'remove',_0x5b7d('0x2')];function createListener(_0x403b0a,_0x5db728){return function(_0x165f07){_0x5db728[_0x5b7d('0x3')](_0x403b0a,_0x165f07);};}function removeListener(_0x2dda76,_0x425cbd){return function(){WhatsappInteractionEvents['removeListener'](_0x2dda76,_0x425cbd);};}exports[_0x5b7d('0x4')]=function(_0x3561ef){for(var _0x25109f=0x0,_0x37b745=events[_0x5b7d('0x5')];_0x25109f<_0x37b745;_0x25109f++){var _0x4219a7=events[_0x25109f];var _0xdb5304=createListener(_0x5b7d('0x6')+_0x4219a7,_0x3561ef);WhatsappInteractionEvents['on'](_0x4219a7,_0xdb5304);}}; \ No newline at end of file +var _0x0b6a=['./whatsappInteraction.events','save','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0x0b6a,0x1a8));var _0xa0b6=function(_0x20ee8a,_0x543cdd){_0x20ee8a=_0x20ee8a-0x0;var _0x340c92=_0x0b6a[_0x20ee8a];return _0x340c92;};'use strict';var WhatsappInteractionEvents=require(_0xa0b6('0x0'));var events=[_0xa0b6('0x1'),'remove',_0xa0b6('0x2')];function createListener(_0x4ed23f,_0x58f39b){return function(_0x49c120){_0x58f39b[_0xa0b6('0x3')](_0x4ed23f,_0x49c120);};}function removeListener(_0x51d46f,_0x1e546a){return function(){WhatsappInteractionEvents[_0xa0b6('0x4')](_0x51d46f,_0x1e546a);};}exports[_0xa0b6('0x5')]=function(_0x441796){for(var _0x37ac85=0x0,_0x76c462=events[_0xa0b6('0x6')];_0x37ac85<_0x76c462;_0x37ac85++){var _0x53fd81=events[_0x37ac85];var _0x35e4bb=createListener(_0xa0b6('0x7')+_0x53fd81,_0x441796);WhatsappInteractionEvents['on'](_0x53fd81,_0x35e4bb);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index fbbc429..ade78df 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 _0x5c12=['index','/describe','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated'];(function(_0x46dab8,_0x4ef8ed){var _0x3d1e3a=function(_0x4579fe){while(--_0x4579fe){_0x46dab8['push'](_0x46dab8['shift']());}};_0x3d1e3a(++_0x4ef8ed);}(_0x5c12,0xbf));var _0x25c1=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0x5c12[_0x126f47];return _0x49508a;};'use strict';var multer=require(_0x25c1('0x0'));var util=require(_0x25c1('0x1'));var path=require('path');var timeout=require(_0x25c1('0x2'));var express=require(_0x25c1('0x3'));var router=express[_0x25c1('0x4')]();var fs_extra=require(_0x25c1('0x5'));var auth=require(_0x25c1('0x6'));var interaction=require(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var controller=require(_0x25c1('0x9'));router[_0x25c1('0xa')]('/',auth[_0x25c1('0xb')](),controller[_0x25c1('0xc')]);router[_0x25c1('0xa')](_0x25c1('0xd'),auth[_0x25c1('0xb')](),controller[_0x25c1('0xe')]);router[_0x25c1('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')]('/',auth[_0x25c1('0xb')](),interaction[_0x25c1('0x11')](_0x25c1('0x12'),_0x25c1('0x13')),controller[_0x25c1('0x14')]);router[_0x25c1('0x10')]('/:id/status',controller[_0x25c1('0x15')]);router[_0x25c1('0x16')](_0x25c1('0x17'),auth[_0x25c1('0xb')](),controller['update']);router[_0x25c1('0x16')](_0x25c1('0x18'),auth[_0x25c1('0xb')](),controller['accept']);router['put'](_0x25c1('0x19'),auth[_0x25c1('0xb')](),controller['reject']);router[_0x25c1('0x1a')]('/:id',auth[_0x25c1('0xb')](),controller[_0x25c1('0x1b')]);module[_0x25c1('0x1c')]=router; \ No newline at end of file +var _0x3618=['post','tracked','whatsapp','whatsappmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x3618,0x14f));var _0x8361=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x3618[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0x8361('0x0'));var util=require(_0x8361('0x1'));var path=require(_0x8361('0x2'));var timeout=require(_0x8361('0x3'));var express=require(_0x8361('0x4'));var router=express[_0x8361('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8361('0x6'));var interaction=require(_0x8361('0x7'));var config=require(_0x8361('0x8'));var controller=require(_0x8361('0x9'));router['get']('/',auth[_0x8361('0xa')](),controller[_0x8361('0xb')]);router['get'](_0x8361('0xc'),auth[_0x8361('0xa')](),controller[_0x8361('0xd')]);router[_0x8361('0xe')](_0x8361('0xf'),auth[_0x8361('0xa')](),controller[_0x8361('0x10')]);router[_0x8361('0x11')]('/',auth['isAuthenticated'](),interaction[_0x8361('0x12')](_0x8361('0x13'),_0x8361('0x14')),controller[_0x8361('0x15')]);router['post']('/:id/status',controller[_0x8361('0x16')]);router[_0x8361('0x17')](_0x8361('0xf'),auth[_0x8361('0xa')](),controller[_0x8361('0x18')]);router[_0x8361('0x17')](_0x8361('0x19'),auth[_0x8361('0xa')](),controller[_0x8361('0x1a')]);router[_0x8361('0x17')](_0x8361('0x1b'),auth['isAuthenticated'](),controller[_0x8361('0x1c')]);router[_0x8361('0x1d')](_0x8361('0xf'),auth[_0x8361('0xa')](),controller[_0x8361('0x1e')]);module[_0x8361('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 26d80ab..8c35c88 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 _0x5097=['TEXT','BOOLEAN','STRING','DATE','sequelize','exports'];(function(_0x100ca3,_0x37d616){var _0x2d572e=function(_0x1f504c){while(--_0x1f504c){_0x100ca3['push'](_0x100ca3['shift']());}};_0x2d572e(++_0x37d616);}(_0x5097,0x1ae));var _0x7509=function(_0x4b61f0,_0x414129){_0x4b61f0=_0x4b61f0-0x0;var _0x9de7de=_0x5097[_0x4b61f0];return _0x9de7de;};'use strict';var Sequelize=require(_0x7509('0x0'));module[_0x7509('0x1')]={'body':{'type':Sequelize[_0x7509('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7509('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7509('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x7509('0x5')]},'secret':{'type':Sequelize[_0x7509('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7509('0x4')]},'providerResponse':{'type':Sequelize[_0x7509('0x2')]}}; \ No newline at end of file +var _0x0725=['medium','BOOLEAN','out','STRING','DATE','exports'];(function(_0x5649ef,_0x3745d5){var _0x97109=function(_0x2ff5e4){while(--_0x2ff5e4){_0x5649ef['push'](_0x5649ef['shift']());}};_0x97109(++_0x3745d5);}(_0x0725,0x167));var _0x5072=function(_0x54772b,_0x291042){_0x54772b=_0x54772b-0x0;var _0x4d178d=_0x0725[_0x54772b];return _0x4d178d;};'use strict';var Sequelize=require('sequelize');module[_0x5072('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5072('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5072('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5072('0x3')),'defaultValue':_0x5072('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5072('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x5072('0x5')]},'secret':{'type':Sequelize[_0x5072('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5072('0x4')]},'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 a50767b..d5137bc 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 _0xca7d=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','WhatsappMessage','findAll','show','params','length','create','body','find','describe','whatsapp-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','format','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp','WhatsappInteraction','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xca7d,0x18a));var _0xdca7=function(_0x4fa6cc,_0xd46a5b){_0x4fa6cc=_0x4fa6cc-0x0;var _0x49ba0d=_0xca7d[_0x4fa6cc];return _0x49ba0d;};'use strict';var emlformat=require(_0xdca7('0x0'));var rimraf=require(_0xdca7('0x1'));var zipdir=require(_0xdca7('0x2'));var jsonpatch=require(_0xdca7('0x3'));var rp=require(_0xdca7('0x4'));var moment=require(_0xdca7('0x5'));var BPromise=require(_0xdca7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdca7('0x7'));var sox=require(_0xdca7('0x8'));var csv=require(_0xdca7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdca7('0xa'));var _=require(_0xdca7('0xb'));var squel=require('squel');var crypto=require(_0xdca7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdca7('0x9'));var querystring=require('querystring');var Papa=require(_0xdca7('0xd'));var Redis=require(_0xdca7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdca7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdca7('0x10'));var logger=require(_0xdca7('0x11'))(_0xdca7('0x12'));var utils=require('../../config/utils');var config=require(_0xdca7('0x13'));var licenseUtil=require(_0xdca7('0x14'));var db=require(_0xdca7('0x15'))['db'];config['redis']=_['defaults'](config[_0xdca7('0x16')],{'host':_0xdca7('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdca7('0x16')]));require(_0xdca7('0x18'))[_0xdca7('0x19')](socket);var jayson=require(_0xdca7('0x1a'));var client=jayson[_0xdca7('0x1b')][_0xdca7('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xdca7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2ed6a9,_0x5ec92a,_0x4789f8,_0x459b89){return new BPromise(function(_0x30f40c,_0x48907e){var _0x2d20f4=_0x459b89||client;return _0x2d20f4['request'](_0x2ed6a9,_0x4789f8)[_0xdca7('0x1d')](function(_0x57ac83){logger[_0xdca7('0x1e')](_0xdca7('0x1f'),_0x5ec92a,'request\x20sent');logger[_0xdca7('0x20')](_0xdca7('0x21'),_0x5ec92a,_0xdca7('0x22'),JSON['stringify'](_0x57ac83));if(_0x57ac83[_0xdca7('0x23')]){if(_0x57ac83[_0xdca7('0x23')]['code']===0x1f4){logger['error'](_0xdca7('0x1f'),_0x5ec92a,_0x57ac83[_0xdca7('0x23')][_0xdca7('0x24')]);return _0x48907e(_0x57ac83[_0xdca7('0x23')][_0xdca7('0x24')]);}logger[_0xdca7('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x5ec92a,_0x57ac83[_0xdca7('0x23')]['message']);return _0x30f40c(_0x57ac83[_0xdca7('0x23')][_0xdca7('0x24')]);}else{logger['info'](_0xdca7('0x1f'),_0x5ec92a,_0xdca7('0x22'));_0x30f40c(_0x57ac83[_0xdca7('0x25')]['message']);}})[_0xdca7('0x26')](function(_0x5ab3f2){logger[_0xdca7('0x23')](_0xdca7('0x1f'),_0x5ec92a,_0x5ab3f2);_0x48907e(_0x5ab3f2);});});}function respondWithStatusCode(_0x10f285,_0xb63a65){_0xb63a65=_0xb63a65||0xcc;return function(_0x592fc2){if(_0x592fc2){return _0x10f285[_0xdca7('0x27')](_0xb63a65);}return _0x10f285[_0xdca7('0x28')](_0xb63a65)[_0xdca7('0x29')]();};}function respondWithResult(_0x2eb424,_0x5a7e43){_0x5a7e43=_0x5a7e43||0xc8;return function(_0x36feb0){if(_0x36feb0){return _0x2eb424[_0xdca7('0x28')](_0x5a7e43)[_0xdca7('0x2a')](_0x36feb0);}};}function respondWithFilteredResult(_0xb90610,_0x75341d){return function(_0x1561fd){if(_0x1561fd){var _0x5a8311=typeof _0x75341d['offset']==='undefined'&&typeof _0x75341d['limit']===_0xdca7('0x2b');var _0x27678e=_0x1561fd[_0xdca7('0x2c')];var _0x181d4d=_0x5a8311?0x0:_0x75341d[_0xdca7('0x2d')];var _0x170049=_0x5a8311?_0x1561fd['count']:_0x75341d['offset']+_0x75341d['limit'];var _0x36c837;if(_0x170049>=_0x27678e){_0x170049=_0x27678e;_0x36c837=0xc8;}else{_0x36c837=0xce;}_0xb90610[_0xdca7('0x28')](_0x36c837);return _0xb90610[_0xdca7('0x2e')](_0xdca7('0x2f'),_0x181d4d+'-'+_0x170049+'/'+_0x27678e)['json'](_0x1561fd);}return null;};}function patchUpdates(_0x186f82){return function(_0x14e191){try{jsonpatch[_0xdca7('0x30')](_0x14e191,_0x186f82,!![]);}catch(_0x486963){return BPromise[_0xdca7('0x31')](_0x486963);}return _0x14e191[_0xdca7('0x32')]();};}function saveUpdates(_0x5f2b71,_0x487f5c){return function(_0x1e01d9){if(_0x1e01d9){return _0x1e01d9[_0xdca7('0x33')](_0x5f2b71)[_0xdca7('0x1d')](function(_0x2ccb51){return _0x2ccb51;});}return null;};}function removeEntity(_0x4f4592,_0x163051){return function(_0x538af7){if(_0x538af7){return _0x538af7[_0xdca7('0x34')]()['then'](function(){_0x4f4592[_0xdca7('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2894d5,_0x1e71b6){return function(_0x17009a){if(!_0x17009a){_0x2894d5['sendStatus'](0x194);}return _0x17009a;};}function handleError(_0x20a948,_0x3084ea){_0x3084ea=_0x3084ea||0x1f4;return function(_0x22e2c3){logger[_0xdca7('0x23')](_0x22e2c3[_0xdca7('0x35')]);if(_0x22e2c3[_0xdca7('0x36')]){delete _0x22e2c3[_0xdca7('0x36')];}_0x20a948[_0xdca7('0x28')](_0x3084ea)['send'](_0x22e2c3);};}exports[_0xdca7('0x37')]=function(_0x598770,_0x4d2846){var _0x45d92a={},_0x2a4704={},_0x2a4125={'count':0x0,'rows':[]};var _0x230935=_['map'](db['WhatsappMessage'][_0xdca7('0x38')],function(_0x27ce15){return{'name':_0x27ce15[_0xdca7('0x39')],'type':_0x27ce15[_0xdca7('0x3a')][_0xdca7('0x3b')]};});_0x2a4704[_0xdca7('0x3c')]=_[_0xdca7('0x3d')](_0x230935,_0xdca7('0x36'));_0x2a4704[_0xdca7('0x3e')]=_[_0xdca7('0x3f')](_0x598770[_0xdca7('0x3e')]);_0x2a4704[_0xdca7('0x40')]=_[_0xdca7('0x41')](_0x2a4704[_0xdca7('0x3c')],_0x2a4704[_0xdca7('0x3e')]);_0x45d92a[_0xdca7('0x42')]=_[_0xdca7('0x41')](_0x2a4704[_0xdca7('0x3c')],qs['fields'](_0x598770[_0xdca7('0x3e')][_0xdca7('0x43')]));_0x45d92a[_0xdca7('0x42')]=_0x45d92a[_0xdca7('0x42')]['length']?_0x45d92a[_0xdca7('0x42')]:_0x2a4704[_0xdca7('0x3c')];if(!_0x598770[_0xdca7('0x3e')]['hasOwnProperty'](_0xdca7('0x44'))){_0x45d92a['limit']=qs[_0xdca7('0x45')](_0x598770[_0xdca7('0x3e')][_0xdca7('0x45')]);_0x45d92a[_0xdca7('0x2d')]=qs[_0xdca7('0x2d')](_0x598770['query'][_0xdca7('0x2d')]);}_0x45d92a['order']=qs[_0xdca7('0x46')](_0x598770[_0xdca7('0x3e')][_0xdca7('0x46')]);_0x45d92a['where']=qs[_0xdca7('0x40')](_[_0xdca7('0x47')](_0x598770['query'],_0x2a4704['filters']),_0x230935);if(_0x598770[_0xdca7('0x3e')][_0xdca7('0x48')]){_0x45d92a[_0xdca7('0x49')]=_['merge'](_0x45d92a['where'],{'$or':_[_0xdca7('0x3d')](_0x230935,function(_0x4aa4a1){if(_0x4aa4a1[_0xdca7('0x3a')]!==_0xdca7('0x4a')){var _0x369072={};_0x369072[_0x4aa4a1['name']]={'$like':'%'+_0x598770[_0xdca7('0x3e')]['filter']+'%'};return _0x369072;}})});}_0x45d92a=_[_0xdca7('0x4b')]({},_0x45d92a,_0x598770[_0xdca7('0x4c')]);var _0x1d3dbc={'where':_0x45d92a[_0xdca7('0x49')]};return db['WhatsappMessage'][_0xdca7('0x2c')](_0x1d3dbc)['then'](function(_0x37cd5b){_0x2a4125[_0xdca7('0x2c')]=_0x37cd5b;if(_0x598770[_0xdca7('0x3e')][_0xdca7('0x4d')]){_0x45d92a[_0xdca7('0x4e')]=[{'all':!![]}];}return db[_0xdca7('0x4f')][_0xdca7('0x50')](_0x45d92a);})[_0xdca7('0x1d')](function(_0x150c90){_0x2a4125['rows']=_0x150c90;return _0x2a4125;})['then'](respondWithFilteredResult(_0x4d2846,_0x45d92a))[_0xdca7('0x26')](handleError(_0x4d2846,null));};exports[_0xdca7('0x51')]=function(_0x39499d,_0x59fc24){var _0x1ab9a1={'raw':!![],'where':{'id':_0x39499d[_0xdca7('0x52')]['id']}},_0x175b23={};_0x175b23[_0xdca7('0x3c')]=_[_0xdca7('0x3f')](db[_0xdca7('0x4f')][_0xdca7('0x38')]);_0x175b23[_0xdca7('0x3e')]=_['keys'](_0x39499d['query']);_0x175b23['filters']=_[_0xdca7('0x41')](_0x175b23['model'],_0x175b23[_0xdca7('0x3e')]);_0x1ab9a1[_0xdca7('0x42')]=_[_0xdca7('0x41')](_0x175b23[_0xdca7('0x3c')],qs[_0xdca7('0x43')](_0x39499d[_0xdca7('0x3e')][_0xdca7('0x43')]));_0x1ab9a1[_0xdca7('0x42')]=_0x1ab9a1['attributes'][_0xdca7('0x53')]?_0x1ab9a1['attributes']:_0x175b23[_0xdca7('0x3c')];if(_0x39499d[_0xdca7('0x3e')]['includeAll']){_0x1ab9a1[_0xdca7('0x4e')]=[{'all':!![]}];}_0x1ab9a1=_[_0xdca7('0x4b')]({},_0x1ab9a1,_0x39499d['options']);return db[_0xdca7('0x4f')]['find'](_0x1ab9a1)[_0xdca7('0x1d')](handleEntityNotFound(_0x59fc24,null))[_0xdca7('0x1d')](respondWithResult(_0x59fc24,null))['catch'](handleError(_0x59fc24,null));};exports[_0xdca7('0x54')]=function(_0x19a75a,_0x1119e2){return db[_0xdca7('0x4f')]['create'](_0x19a75a[_0xdca7('0x55')],{})[_0xdca7('0x1d')](respondWithResult(_0x1119e2,0xc9))[_0xdca7('0x26')](handleError(_0x1119e2,null));};exports['update']=function(_0x23fe9b,_0x15d547){if(_0x23fe9b['body']['id']){delete _0x23fe9b[_0xdca7('0x55')]['id'];}return db[_0xdca7('0x4f')][_0xdca7('0x56')]({'where':{'id':_0x23fe9b[_0xdca7('0x52')]['id']}})[_0xdca7('0x1d')](handleEntityNotFound(_0x15d547,null))[_0xdca7('0x1d')](saveUpdates(_0x23fe9b[_0xdca7('0x55')],null))[_0xdca7('0x1d')](respondWithResult(_0x15d547,null))['catch'](handleError(_0x15d547,null));};exports[_0xdca7('0x34')]=function(_0x5c92a7,_0x2aeac8){return db['WhatsappMessage']['find']({'where':{'id':_0x5c92a7[_0xdca7('0x52')]['id']}})[_0xdca7('0x1d')](handleEntityNotFound(_0x2aeac8,null))[_0xdca7('0x1d')](removeEntity(_0x2aeac8,null))[_0xdca7('0x26')](handleError(_0x2aeac8,null));};exports[_0xdca7('0x57')]=function(_0x3af4a7,_0x581421){return db[_0xdca7('0x4f')][_0xdca7('0x57')]()['then'](respondWithResult(_0x581421,null))['catch'](handleError(_0x581421,null));};var interaction_log=require('../../config/logger')(_0xdca7('0x58'));exports[_0xdca7('0x59')]=function(_0x32bd84,_0x13f178,_0xbf0bc7){var _0x19a5ef={'agent':{},'channel':'whatsapp'};if(_0x32bd84['body']['id']){delete _0x32bd84[_0xdca7('0x55')]['id'];}_0x32bd84[_0xdca7('0x55')]['read']=!![];_0x32bd84['body'][_0xdca7('0x5a')]=moment()['format'](_0xdca7('0x5b'));_0x32bd84[_0xdca7('0x55')]['UserId']=_0x32bd84['body'][_0xdca7('0x5c')]||_0x32bd84[_0xdca7('0x5d')]['id'];_0x19a5ef[_0xdca7('0x5e')]['id']=_0x32bd84[_0xdca7('0x55')]['UserId'];return db[_0xdca7('0x4f')][_0xdca7('0x56')]({'where':{'id':_0x32bd84[_0xdca7('0x52')]['id'],'UserId':null}})[_0xdca7('0x1d')](handleEntityNotFound(_0x13f178,null))[_0xdca7('0x1d')](saveUpdates(_0x32bd84[_0xdca7('0x55')],null))['then'](function(_0x1cb0f7){if(_0x1cb0f7){_0x19a5ef[_0xdca7('0x24')]=_0x1cb0f7[_0xdca7('0x5f')]({'plain':!![]});return db['WhatsappInteraction'][_0xdca7('0x56')]({'where':{'id':_0x1cb0f7[_0xdca7('0x60')]}});}return null;})[_0xdca7('0x1d')](handleEntityNotFound(_0x13f178,null))['then'](function(_0x27068a){if(_0x27068a){return _0x27068a['update']({'UserId':_0x32bd84[_0xdca7('0x55')][_0xdca7('0x5c')],'read1stAt':_[_0xdca7('0x61')](_0x27068a[_0xdca7('0x62')])?moment()[_0xdca7('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdca7('0x1d')](function(_0x58e45f){if(_0x58e45f){_0x19a5ef[_0xdca7('0x64')]=_0x58e45f[_0xdca7('0x5f')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x32bd84[_0xdca7('0x5d')]['id'],_0x32bd84[_0xdca7('0x5d')][_0xdca7('0x36')],_0x32bd84[_0xdca7('0x5d')]['role'],_0x19a5ef[_0xdca7('0x64')]['id'],_0x32bd84[_0xdca7('0x55')]?JSON[_0xdca7('0x65')](_0x32bd84[_0xdca7('0x55')]):_0xdca7('0x66'));return respondWithRpcPromise(_0xdca7('0x67'),'acceptMessage',_0x19a5ef);}return null;})[_0xdca7('0x1d')](function(_0x50715d){var _0x145e4e=_0xdca7('0x68')+_0x50715d[_0xdca7('0x24')][_0xdca7('0x69')];return db[_0xdca7('0x6a')][_0xdca7('0x3e')](_0x145e4e,{'type':db[_0xdca7('0x6b')][_0xdca7('0x6c')][_0xdca7('0x6d')],'raw':!![]})['then'](function(_0x122b87){return _0x122b87;});})[_0xdca7('0x1d')](function(_0x28abca){if(_0x28abca){_0x19a5ef['message'][_0xdca7('0x6e')]=_0x28abca[0x0];if(!_0x32bd84[_0xdca7('0x55')][_0xdca7('0x5c')])return;return db[_0xdca7('0x6f')][_0xdca7('0x56')]({'where':{'id':_0x32bd84[_0xdca7('0x55')][_0xdca7('0x5c')],'role':_0xdca7('0x5e')},'attributes':['id',_0xdca7('0x36'),_0xdca7('0x70'),_0xdca7('0x71'),_0xdca7('0x72')],'raw':!![]});}return null;})[_0xdca7('0x1d')](function(_0x199e24){if(!_0x199e24)return null;_0x19a5ef[_0xdca7('0x24')][_0xdca7('0x5e')]=_0x199e24;return _0x19a5ef;})['then'](function(_0x4ff33c){if(_0x4ff33c){if(_0x32bd84[_0xdca7('0x55')][_0xdca7('0x73')]){_0x19a5ef[_0xdca7('0x24')][_0xdca7('0x74')]=util[_0xdca7('0x63')](_0xdca7('0x75'),_0x32bd84[_0xdca7('0x5d')][_0xdca7('0x36')]);_0x19a5ef['message'][_0xdca7('0x76')]=_0x19a5ef[_0xdca7('0x76')];_0x19a5ef[_0xdca7('0x24')][_0xdca7('0x77')]=_0x19a5ef['channel'];_0x19a5ef['message']['event']=_0xdca7('0x59');return respondWithRpcPromise(_0xdca7('0x78'),'EventManager',{'event':_0xdca7('0x79'),'message':_0x19a5ef[_0xdca7('0x24')]},client9002)['then'](function(){return _0x19a5ef;});}return _0x19a5ef;}return null;})['then'](respondWithResult(_0x13f178,null))['catch'](handleError(_0x13f178,null));};var interaction_log=require(_0xdca7('0x11'))(_0xdca7('0x58'));exports[_0xdca7('0x31')]=function(_0x39f036,_0x26e543,_0x544eb8){var _0x575a29={'agent':{},'channel':_0xdca7('0x7a')};if(_0x39f036[_0xdca7('0x55')]['id']){delete _0x39f036[_0xdca7('0x55')]['id'];}_0x39f036['body'][_0xdca7('0x5c')]=_0x39f036[_0xdca7('0x55')][_0xdca7('0x5c')]||_0x39f036[_0xdca7('0x5d')]['id'];_0x575a29[_0xdca7('0x5e')]['id']=_0x39f036[_0xdca7('0x55')][_0xdca7('0x5c')];return db[_0xdca7('0x4f')][_0xdca7('0x56')]({'where':{'id':_0x39f036['params']['id'],'UserId':null}})[_0xdca7('0x1d')](handleEntityNotFound(_0x26e543,null))[_0xdca7('0x1d')](function(_0x21c2e3){if(_0x21c2e3){_0x575a29[_0xdca7('0x24')]=_0x21c2e3['get']({'plain':!![]});return db[_0xdca7('0x7b')][_0xdca7('0x56')]({'where':{'id':_0x21c2e3['WhatsappInteractionId']}});}return null;})[_0xdca7('0x1d')](handleEntityNotFound(_0x26e543,null))[_0xdca7('0x1d')](function(_0x27acbe){if(_0x27acbe){_0x575a29[_0xdca7('0x64')]=_0x27acbe[_0xdca7('0x5f')]({'plain':!![]});interaction_log[_0xdca7('0x1e')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39f036[_0xdca7('0x5d')]['id'],_0x39f036[_0xdca7('0x5d')][_0xdca7('0x36')],_0x39f036[_0xdca7('0x5d')]['role'],_0x575a29['interaction']['id'],_0x39f036['body']?JSON[_0xdca7('0x65')](_0x39f036['body']):_0xdca7('0x66'));return respondWithRpcPromise(_0xdca7('0x7c'),_0xdca7('0x7d'),_0x575a29);}return null;})[_0xdca7('0x1d')](function(_0x9a6756){var _0x32dede='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9a6756[_0xdca7('0x24')][_0xdca7('0x69')];return db['sequelize']['query'](_0x32dede,{'type':db[_0xdca7('0x6b')][_0xdca7('0x6c')][_0xdca7('0x6d')],'raw':!![]})['then'](function(_0x449d41){return _0x449d41;});})['then'](function(_0x466520){if(_0x466520){_0x575a29['message'][_0xdca7('0x6e')]=_0x466520[0x0];if(!_0x39f036[_0xdca7('0x55')][_0xdca7('0x5c')])return;return db[_0xdca7('0x6f')][_0xdca7('0x56')]({'where':{'id':_0x39f036['body'][_0xdca7('0x5c')],'role':_0xdca7('0x5e')},'attributes':['id',_0xdca7('0x36'),_0xdca7('0x70'),'email',_0xdca7('0x72')],'raw':!![]});}return null;})[_0xdca7('0x1d')](function(_0x28c359){if(!_0x28c359)return null;_0x575a29[_0xdca7('0x24')][_0xdca7('0x5e')]=_0x28c359;return _0x575a29;})[_0xdca7('0x1d')](function(_0x1acf37){if(_0x1acf37){_0x1acf37[_0xdca7('0x24')][_0xdca7('0x74')]=util[_0xdca7('0x63')](_0xdca7('0x75'),_0x39f036[_0xdca7('0x5d')][_0xdca7('0x36')]);_0x1acf37[_0xdca7('0x24')][_0xdca7('0x76')]=_0x575a29[_0xdca7('0x76')];_0x1acf37[_0xdca7('0x24')][_0xdca7('0x77')]=_0x575a29['channel'];_0x1acf37['message']['event']=_0xdca7('0x31');respondWithRpcPromise('EventManager',_0xdca7('0x78'),{'event':_0xdca7('0x7e'),'message':_0x1acf37[_0xdca7('0x24')]},client9002);return _0x575a29;}return null;})['then'](respondWithResult(_0x26e543,null))[_0xdca7('0x26')](handleError(_0x26e543,null));};exports[_0xdca7('0x28')]=function(_0x45043b,_0x47c4fc,_0xc76570){if(_0x45043b['body']['id']){delete _0x45043b[_0xdca7('0x55')]['id'];}var _0x380f21;return db[_0xdca7('0x4f')][_0xdca7('0x56')]({'where':{'id':_0x45043b[_0xdca7('0x52')]['id']}})['then'](handleEntityNotFound(_0x47c4fc,null))[_0xdca7('0x1d')](function(_0x485f00){if(_0x485f00){_0x380f21=_0x485f00;return db[_0xdca7('0x7f')][_0xdca7('0x56')]({'where':{'id':_0x485f00[_0xdca7('0x80')]}});}})[_0xdca7('0x1d')](handleEntityNotFound(_0x47c4fc,null))[_0xdca7('0x1d')](function(_0x2e5c75){if(_0x2e5c75){logger[_0xdca7('0x20')](_0xdca7('0x81'),'status',_0xdca7('0x82'),_0x2e5c75[_0xdca7('0x3a')],util[_0xdca7('0x83')](_0x45043b[_0xdca7('0x55')],{'showHidden':![],'depth':null}));switch(_0x2e5c75['type']){case _0xdca7('0x84'):if(_0x45043b[_0xdca7('0x55')][_0xdca7('0x85')]&&_0x45043b['body'][_0xdca7('0x85')]===_0x380f21['messageId']&&_0x45043b[_0xdca7('0x55')][_0xdca7('0x86')]&&_0x45043b['body'][_0xdca7('0x86')]===_0xdca7('0x87')){return _0x380f21['update']({'read':!![]});}else{logger[_0xdca7('0x23')](_0xdca7('0x88'),'status','twilio',util[_0xdca7('0x83')](_0x45043b[_0xdca7('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x380f21;}})[_0xdca7('0x1d')](respondWithResult(_0x47c4fc,null))[_0xdca7('0x26')](handleError(_0x47c4fc,null));}; \ No newline at end of file +var _0x8422=['mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','WhatsappMessage','findAll','rows','show','params','length','includeAll','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','interface','SIP/%s','channel','motionChannel','event','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','email','internal','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x8422,0x8b));var _0x2842=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x8422[_0x2e249d];return _0x1faa37;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2842('0x0'));var jsonpatch=require(_0x2842('0x1'));var rp=require(_0x2842('0x2'));var moment=require(_0x2842('0x3'));var BPromise=require(_0x2842('0x4'));var Mustache=require(_0x2842('0x5'));var util=require(_0x2842('0x6'));var path=require('path');var sox=require(_0x2842('0x7'));var csv=require('to-csv');var ejs=require(_0x2842('0x8'));var fs=require('fs');var fs_extra=require(_0x2842('0x9'));var _=require(_0x2842('0xa'));var squel=require(_0x2842('0xb'));var crypto=require(_0x2842('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2842('0xd'));var toCsv=require(_0x2842('0xe'));var querystring=require('querystring');var Papa=require(_0x2842('0xf'));var Redis=require(_0x2842('0x10'));var authService=require(_0x2842('0x11'));var qs=require(_0x2842('0x12'));var as=require(_0x2842('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2842('0x14'))(_0x2842('0x15'));var utils=require(_0x2842('0x16'));var config=require(_0x2842('0x17'));var licenseUtil=require(_0x2842('0x18'));var db=require(_0x2842('0x19'))['db'];config[_0x2842('0x1a')]=_['defaults'](config[_0x2842('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2842('0x1b'))[_0x2842('0x1c')](socket);var jayson=require(_0x2842('0x1d'));var client=jayson[_0x2842('0x1e')][_0x2842('0x1f')]({'port':0x232c});var client9002=jayson[_0x2842('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c663f,_0x130110,_0x41a55b,_0x3b26ac){return new BPromise(function(_0x237098,_0xfff048){var _0x440811=_0x3b26ac||client;return _0x440811[_0x2842('0x20')](_0x1c663f,_0x41a55b)[_0x2842('0x21')](function(_0x5d1dac){logger[_0x2842('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x130110,_0x2842('0x23'));logger[_0x2842('0x24')](_0x2842('0x25'),_0x130110,_0x2842('0x23'),JSON[_0x2842('0x26')](_0x5d1dac));if(_0x5d1dac['error']){if(_0x5d1dac[_0x2842('0x27')][_0x2842('0x28')]===0x1f4){logger[_0x2842('0x27')](_0x2842('0x29'),_0x130110,_0x5d1dac[_0x2842('0x27')][_0x2842('0x2a')]);return _0xfff048(_0x5d1dac[_0x2842('0x27')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x130110,_0x5d1dac['error'][_0x2842('0x2a')]);return _0x237098(_0x5d1dac[_0x2842('0x27')][_0x2842('0x2a')]);}else{logger[_0x2842('0x22')](_0x2842('0x29'),_0x130110,_0x2842('0x23'));_0x237098(_0x5d1dac[_0x2842('0x2b')][_0x2842('0x2a')]);}})[_0x2842('0x2c')](function(_0x5478a5){logger[_0x2842('0x27')](_0x2842('0x29'),_0x130110,_0x5478a5);_0xfff048(_0x5478a5);});});}function respondWithStatusCode(_0x1af3f8,_0x3fae4b){_0x3fae4b=_0x3fae4b||0xcc;return function(_0x915d36){if(_0x915d36){return _0x1af3f8['sendStatus'](_0x3fae4b);}return _0x1af3f8[_0x2842('0x2d')](_0x3fae4b)[_0x2842('0x2e')]();};}function respondWithResult(_0x2fed2b,_0x33ae0b){_0x33ae0b=_0x33ae0b||0xc8;return function(_0x76b4da){if(_0x76b4da){return _0x2fed2b[_0x2842('0x2d')](_0x33ae0b)[_0x2842('0x2f')](_0x76b4da);}};}function respondWithFilteredResult(_0x28d443,_0x47013d){return function(_0x3a887b){if(_0x3a887b){var _0x246fcf=typeof _0x47013d[_0x2842('0x30')]===_0x2842('0x31')&&typeof _0x47013d[_0x2842('0x32')]===_0x2842('0x31');var _0x2b4d91=_0x3a887b[_0x2842('0x33')];var _0x190865=_0x246fcf?0x0:_0x47013d[_0x2842('0x30')];var _0x5c18a1=_0x246fcf?_0x3a887b[_0x2842('0x33')]:_0x47013d['offset']+_0x47013d[_0x2842('0x32')];var _0x56c4e4;if(_0x5c18a1>=_0x2b4d91){_0x5c18a1=_0x2b4d91;_0x56c4e4=0xc8;}else{_0x56c4e4=0xce;}_0x28d443[_0x2842('0x2d')](_0x56c4e4);return _0x28d443['set'](_0x2842('0x34'),_0x190865+'-'+_0x5c18a1+'/'+_0x2b4d91)[_0x2842('0x2f')](_0x3a887b);}return null;};}function patchUpdates(_0x45383c){return function(_0x4bbb96){try{jsonpatch[_0x2842('0x35')](_0x4bbb96,_0x45383c,!![]);}catch(_0x2e029a){return BPromise[_0x2842('0x36')](_0x2e029a);}return _0x4bbb96['save']();};}function saveUpdates(_0x3f54c9,_0x505567){return function(_0x26b559){if(_0x26b559){return _0x26b559[_0x2842('0x37')](_0x3f54c9)[_0x2842('0x21')](function(_0x5898c0){return _0x5898c0;});}return null;};}function removeEntity(_0x30f2a5,_0x3f5e81){return function(_0x1d8ac6){if(_0x1d8ac6){return _0x1d8ac6[_0x2842('0x38')]()[_0x2842('0x21')](function(){_0x30f2a5[_0x2842('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb83fdb,_0x14c906){return function(_0x483ca3){if(!_0x483ca3){_0xb83fdb[_0x2842('0x39')](0x194);}return _0x483ca3;};}function handleError(_0x5ce04d,_0x1c2d76){_0x1c2d76=_0x1c2d76||0x1f4;return function(_0x4a0b5e){logger[_0x2842('0x27')](_0x4a0b5e[_0x2842('0x3a')]);if(_0x4a0b5e['name']){delete _0x4a0b5e[_0x2842('0x3b')];}_0x5ce04d['status'](_0x1c2d76)[_0x2842('0x3c')](_0x4a0b5e);};}exports[_0x2842('0x3d')]=function(_0x286ca0,_0x44dc28){var _0x48ba68={},_0x51289d={},_0x3e7aa9={'count':0x0,'rows':[]};var _0x5f53df=_['map'](db['WhatsappMessage'][_0x2842('0x3e')],function(_0x287bd6){return{'name':_0x287bd6[_0x2842('0x3f')],'type':_0x287bd6[_0x2842('0x40')]['key']};});_0x51289d['model']=_[_0x2842('0x41')](_0x5f53df,'name');_0x51289d['query']=_[_0x2842('0x42')](_0x286ca0[_0x2842('0x43')]);_0x51289d[_0x2842('0x44')]=_[_0x2842('0x45')](_0x51289d[_0x2842('0x46')],_0x51289d[_0x2842('0x43')]);_0x48ba68[_0x2842('0x47')]=_['intersection'](_0x51289d['model'],qs[_0x2842('0x48')](_0x286ca0['query']['fields']));_0x48ba68[_0x2842('0x47')]=_0x48ba68[_0x2842('0x47')]['length']?_0x48ba68[_0x2842('0x47')]:_0x51289d['model'];if(!_0x286ca0[_0x2842('0x43')][_0x2842('0x49')](_0x2842('0x4a'))){_0x48ba68['limit']=qs['limit'](_0x286ca0[_0x2842('0x43')][_0x2842('0x32')]);_0x48ba68[_0x2842('0x30')]=qs[_0x2842('0x30')](_0x286ca0[_0x2842('0x43')]['offset']);}_0x48ba68[_0x2842('0x4b')]=qs[_0x2842('0x4c')](_0x286ca0[_0x2842('0x43')]['sort']);_0x48ba68[_0x2842('0x4d')]=qs['filters'](_[_0x2842('0x4e')](_0x286ca0['query'],_0x51289d[_0x2842('0x44')]),_0x5f53df);if(_0x286ca0[_0x2842('0x43')]['filter']){_0x48ba68[_0x2842('0x4d')]=_[_0x2842('0x4f')](_0x48ba68['where'],{'$or':_[_0x2842('0x41')](_0x5f53df,function(_0x312af4){if(_0x312af4[_0x2842('0x40')]!==_0x2842('0x50')){var _0xdf728c={};_0xdf728c[_0x312af4[_0x2842('0x3b')]]={'$like':'%'+_0x286ca0[_0x2842('0x43')][_0x2842('0x51')]+'%'};return _0xdf728c;}})});}_0x48ba68=_[_0x2842('0x4f')]({},_0x48ba68,_0x286ca0[_0x2842('0x52')]);var _0x2e5581={'where':_0x48ba68['where']};return db['WhatsappMessage'][_0x2842('0x33')](_0x2e5581)['then'](function(_0x20eb43){_0x3e7aa9[_0x2842('0x33')]=_0x20eb43;if(_0x286ca0[_0x2842('0x43')]['includeAll']){_0x48ba68[_0x2842('0x53')]=[{'all':!![]}];}return db[_0x2842('0x54')][_0x2842('0x55')](_0x48ba68);})[_0x2842('0x21')](function(_0x54667a){_0x3e7aa9[_0x2842('0x56')]=_0x54667a;return _0x3e7aa9;})[_0x2842('0x21')](respondWithFilteredResult(_0x44dc28,_0x48ba68))[_0x2842('0x2c')](handleError(_0x44dc28,null));};exports[_0x2842('0x57')]=function(_0x45cfd3,_0x2e02a2){var _0x26348c={'raw':!![],'where':{'id':_0x45cfd3[_0x2842('0x58')]['id']}},_0x4c0804={};_0x4c0804[_0x2842('0x46')]=_[_0x2842('0x42')](db[_0x2842('0x54')]['rawAttributes']);_0x4c0804[_0x2842('0x43')]=_[_0x2842('0x42')](_0x45cfd3[_0x2842('0x43')]);_0x4c0804[_0x2842('0x44')]=_['intersection'](_0x4c0804[_0x2842('0x46')],_0x4c0804['query']);_0x26348c[_0x2842('0x47')]=_['intersection'](_0x4c0804[_0x2842('0x46')],qs[_0x2842('0x48')](_0x45cfd3[_0x2842('0x43')][_0x2842('0x48')]));_0x26348c[_0x2842('0x47')]=_0x26348c['attributes'][_0x2842('0x59')]?_0x26348c[_0x2842('0x47')]:_0x4c0804['model'];if(_0x45cfd3[_0x2842('0x43')][_0x2842('0x5a')]){_0x26348c[_0x2842('0x53')]=[{'all':!![]}];}_0x26348c=_[_0x2842('0x4f')]({},_0x26348c,_0x45cfd3[_0x2842('0x52')]);return db[_0x2842('0x54')][_0x2842('0x5b')](_0x26348c)[_0x2842('0x21')](handleEntityNotFound(_0x2e02a2,null))[_0x2842('0x21')](respondWithResult(_0x2e02a2,null))[_0x2842('0x2c')](handleError(_0x2e02a2,null));};exports[_0x2842('0x5c')]=function(_0x16cf2f,_0x5e4b0a){return db[_0x2842('0x54')][_0x2842('0x5c')](_0x16cf2f[_0x2842('0x5d')],{})['then'](respondWithResult(_0x5e4b0a,0xc9))[_0x2842('0x2c')](handleError(_0x5e4b0a,null));};exports[_0x2842('0x37')]=function(_0x104904,_0x2e16b3){if(_0x104904['body']['id']){delete _0x104904['body']['id'];}return db[_0x2842('0x54')][_0x2842('0x5b')]({'where':{'id':_0x104904['params']['id']}})[_0x2842('0x21')](handleEntityNotFound(_0x2e16b3,null))[_0x2842('0x21')](saveUpdates(_0x104904['body'],null))['then'](respondWithResult(_0x2e16b3,null))['catch'](handleError(_0x2e16b3,null));};exports[_0x2842('0x38')]=function(_0xd6b4a9,_0x15b98f){return db[_0x2842('0x54')][_0x2842('0x5b')]({'where':{'id':_0xd6b4a9[_0x2842('0x58')]['id']}})[_0x2842('0x21')](handleEntityNotFound(_0x15b98f,null))[_0x2842('0x21')](removeEntity(_0x15b98f,null))['catch'](handleError(_0x15b98f,null));};exports[_0x2842('0x5e')]=function(_0x7118b0,_0x15004e){return db[_0x2842('0x54')][_0x2842('0x5e')]()[_0x2842('0x21')](respondWithResult(_0x15004e,null))[_0x2842('0x2c')](handleError(_0x15004e,null));};var interaction_log=require(_0x2842('0x14'))(_0x2842('0x5f'));exports[_0x2842('0x60')]=function(_0x503398,_0x47a431,_0x1247f8){var _0x111e89={'agent':{},'channel':_0x2842('0x61')};if(_0x503398[_0x2842('0x5d')]['id']){delete _0x503398[_0x2842('0x5d')]['id'];}_0x503398[_0x2842('0x5d')][_0x2842('0x62')]=!![];_0x503398[_0x2842('0x5d')][_0x2842('0x63')]=moment()[_0x2842('0x64')](_0x2842('0x65'));_0x503398[_0x2842('0x5d')]['UserId']=_0x503398['body']['UserId']||_0x503398[_0x2842('0x66')]['id'];_0x111e89[_0x2842('0x67')]['id']=_0x503398[_0x2842('0x5d')][_0x2842('0x68')];return db[_0x2842('0x54')][_0x2842('0x5b')]({'where':{'id':_0x503398[_0x2842('0x58')]['id'],'UserId':null}})[_0x2842('0x21')](handleEntityNotFound(_0x47a431,null))['then'](saveUpdates(_0x503398[_0x2842('0x5d')],null))[_0x2842('0x21')](function(_0x9508f0){if(_0x9508f0){_0x111e89[_0x2842('0x2a')]=_0x9508f0[_0x2842('0x69')]({'plain':!![]});return db['WhatsappInteraction'][_0x2842('0x5b')]({'where':{'id':_0x9508f0['WhatsappInteractionId']}});}return null;})[_0x2842('0x21')](handleEntityNotFound(_0x47a431,null))['then'](function(_0x164da4){if(_0x164da4){return _0x164da4[_0x2842('0x37')]({'UserId':_0x503398[_0x2842('0x5d')]['UserId'],'read1stAt':_[_0x2842('0x6a')](_0x164da4[_0x2842('0x6b')])?moment()['format'](_0x2842('0x65')):undefined});}return null;})[_0x2842('0x21')](function(_0xad83d5){if(_0xad83d5){_0x111e89[_0x2842('0x6c')]=_0xad83d5[_0x2842('0x69')]({'plain':!![]});interaction_log[_0x2842('0x22')](_0x2842('0x6d'),_0x503398[_0x2842('0x66')]['id'],_0x503398[_0x2842('0x66')]['name'],_0x503398[_0x2842('0x66')][_0x2842('0x6e')],_0x111e89[_0x2842('0x6c')]['id'],_0x503398['body']?JSON['stringify'](_0x503398['body']):_0x2842('0x6f'));return respondWithRpcPromise(_0x2842('0x70'),_0x2842('0x71'),_0x111e89);}return null;})[_0x2842('0x21')](function(_0x4eebb6){var _0x419f33=_0x2842('0x72')+_0x4eebb6[_0x2842('0x2a')][_0x2842('0x73')];return db[_0x2842('0x74')]['query'](_0x419f33,{'type':db['Sequelize'][_0x2842('0x75')][_0x2842('0x76')],'raw':!![]})[_0x2842('0x21')](function(_0x10e0e1){return _0x10e0e1;});})[_0x2842('0x21')](function(_0x597c2a){if(_0x597c2a){_0x111e89['message'][_0x2842('0x77')]=_0x597c2a[0x0];if(!_0x503398[_0x2842('0x5d')][_0x2842('0x68')])return;return db[_0x2842('0x78')][_0x2842('0x5b')]({'where':{'id':_0x503398[_0x2842('0x5d')][_0x2842('0x68')],'role':_0x2842('0x67')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x3c98b7){if(!_0x3c98b7)return null;_0x111e89[_0x2842('0x2a')][_0x2842('0x67')]=_0x3c98b7;return _0x111e89;})[_0x2842('0x21')](function(_0x5edbcc){if(_0x5edbcc){if(_0x503398[_0x2842('0x5d')]['manual']){_0x111e89[_0x2842('0x2a')][_0x2842('0x79')]=util['format'](_0x2842('0x7a'),_0x503398[_0x2842('0x66')]['name']);_0x111e89[_0x2842('0x2a')][_0x2842('0x7b')]=_0x111e89[_0x2842('0x7b')];_0x111e89[_0x2842('0x2a')][_0x2842('0x7c')]=_0x111e89[_0x2842('0x7b')];_0x111e89[_0x2842('0x2a')][_0x2842('0x7d')]=_0x2842('0x60');return respondWithRpcPromise('EventManager',_0x2842('0x7e'),{'event':'acceptmessage','message':_0x111e89[_0x2842('0x2a')]},client9002)[_0x2842('0x21')](function(){return _0x111e89;});}return _0x111e89;}return null;})[_0x2842('0x21')](respondWithResult(_0x47a431,null))[_0x2842('0x2c')](handleError(_0x47a431,null));};var interaction_log=require(_0x2842('0x14'))(_0x2842('0x5f'));exports[_0x2842('0x36')]=function(_0x211d4e,_0x57e261,_0x2157c0){var _0x539a7d={'agent':{},'channel':_0x2842('0x61')};if(_0x211d4e[_0x2842('0x5d')]['id']){delete _0x211d4e['body']['id'];}_0x211d4e[_0x2842('0x5d')]['UserId']=_0x211d4e['body'][_0x2842('0x68')]||_0x211d4e['user']['id'];_0x539a7d[_0x2842('0x67')]['id']=_0x211d4e[_0x2842('0x5d')]['UserId'];return db[_0x2842('0x54')][_0x2842('0x5b')]({'where':{'id':_0x211d4e['params']['id'],'UserId':null}})[_0x2842('0x21')](handleEntityNotFound(_0x57e261,null))[_0x2842('0x21')](function(_0x25445f){if(_0x25445f){_0x539a7d[_0x2842('0x2a')]=_0x25445f[_0x2842('0x69')]({'plain':!![]});return db[_0x2842('0x7f')][_0x2842('0x5b')]({'where':{'id':_0x25445f['WhatsappInteractionId']}});}return null;})[_0x2842('0x21')](handleEntityNotFound(_0x57e261,null))[_0x2842('0x21')](function(_0x7c7b6d){if(_0x7c7b6d){_0x539a7d['interaction']=_0x7c7b6d[_0x2842('0x69')]({'plain':!![]});interaction_log[_0x2842('0x22')](_0x2842('0x80'),_0x211d4e[_0x2842('0x66')]['id'],_0x211d4e['user'][_0x2842('0x3b')],_0x211d4e['user'][_0x2842('0x6e')],_0x539a7d[_0x2842('0x6c')]['id'],_0x211d4e[_0x2842('0x5d')]?JSON['stringify'](_0x211d4e[_0x2842('0x5d')]):'null');return respondWithRpcPromise(_0x2842('0x81'),_0x2842('0x82'),_0x539a7d);}return null;})['then'](function(_0x175691){var _0x207086='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x175691[_0x2842('0x2a')][_0x2842('0x73')];return db[_0x2842('0x74')][_0x2842('0x43')](_0x207086,{'type':db[_0x2842('0x83')][_0x2842('0x75')][_0x2842('0x76')],'raw':!![]})[_0x2842('0x21')](function(_0x2a7e8a){return _0x2a7e8a;});})[_0x2842('0x21')](function(_0x450efa){if(_0x450efa){_0x539a7d['message'][_0x2842('0x77')]=_0x450efa[0x0];if(!_0x211d4e[_0x2842('0x5d')][_0x2842('0x68')])return;return db[_0x2842('0x78')][_0x2842('0x5b')]({'where':{'id':_0x211d4e[_0x2842('0x5d')][_0x2842('0x68')],'role':_0x2842('0x67')},'attributes':['id',_0x2842('0x3b'),'fullname',_0x2842('0x84'),_0x2842('0x85')],'raw':!![]});}return null;})[_0x2842('0x21')](function(_0x267217){if(!_0x267217)return null;_0x539a7d[_0x2842('0x2a')][_0x2842('0x67')]=_0x267217;return _0x539a7d;})[_0x2842('0x21')](function(_0x101b95){if(_0x101b95){_0x101b95['message'][_0x2842('0x79')]=util['format'](_0x2842('0x7a'),_0x211d4e['user']['name']);_0x101b95[_0x2842('0x2a')][_0x2842('0x7b')]=_0x539a7d[_0x2842('0x7b')];_0x101b95[_0x2842('0x2a')]['motionChannel']=_0x539a7d[_0x2842('0x7b')];_0x101b95[_0x2842('0x2a')][_0x2842('0x7d')]='reject';respondWithRpcPromise(_0x2842('0x7e'),'EventManager',{'event':'rejectmessage','message':_0x101b95[_0x2842('0x2a')]},client9002);return _0x539a7d;}return null;})[_0x2842('0x21')](respondWithResult(_0x57e261,null))[_0x2842('0x2c')](handleError(_0x57e261,null));};exports[_0x2842('0x2d')]=function(_0x405247,_0x4718ae,_0x102e93){if(_0x405247['body']['id']){delete _0x405247[_0x2842('0x5d')]['id'];}var _0x48ab0d;return db['WhatsappMessage'][_0x2842('0x5b')]({'where':{'id':_0x405247[_0x2842('0x58')]['id']}})[_0x2842('0x21')](handleEntityNotFound(_0x4718ae,null))[_0x2842('0x21')](function(_0x2bcd48){if(_0x2bcd48){_0x48ab0d=_0x2bcd48;return db[_0x2842('0x86')][_0x2842('0x5b')]({'where':{'id':_0x2bcd48[_0x2842('0x87')]}});}})[_0x2842('0x21')](handleEntityNotFound(_0x4718ae,null))[_0x2842('0x21')](function(_0x290d5a){if(_0x290d5a){logger[_0x2842('0x24')](_0x2842('0x88'),'status',_0x2842('0x89'),_0x290d5a[_0x2842('0x40')],util[_0x2842('0x8a')](_0x405247[_0x2842('0x5d')],{'showHidden':![],'depth':null}));switch(_0x290d5a[_0x2842('0x40')]){case _0x2842('0x8b'):if(_0x405247['body'][_0x2842('0x8c')]&&_0x405247[_0x2842('0x5d')]['MessageSid']===_0x48ab0d[_0x2842('0x8d')]&&_0x405247[_0x2842('0x5d')][_0x2842('0x8e')]&&_0x405247['body'][_0x2842('0x8e')]===_0x2842('0x62')){return _0x48ab0d['update']({'read':!![]});}else{logger[_0x2842('0x27')](_0x2842('0x8f'),_0x2842('0x2d'),_0x2842('0x8b'),util[_0x2842('0x8a')](_0x405247['body'],{'showHidden':![],'depth':null}));}break;}return _0x48ab0d;}})[_0x2842('0x21')](respondWithResult(_0x4718ae,null))['catch'](handleError(_0x4718ae,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index e558ac4..cd60439 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 _0x2f3a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x3e10b0,_0x4544e3){var _0x14b94d=function(_0x75a72d){while(--_0x75a72d){_0x3e10b0['push'](_0x3e10b0['shift']());}};_0x14b94d(++_0x4544e3);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x2e4ef9,_0x42f504){_0x2e4ef9=_0x2e4ef9-0x0;var _0x4160ac=_0x2f3a[_0x2e4ef9];return _0x4160ac;};'use strict';var EventEmitter=require(_0xa2f3('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xa2f3('0x1')](0x0);var events={'afterCreate':_0xa2f3('0x2'),'afterUpdate':_0xa2f3('0x3'),'afterDestroy':_0xa2f3('0x4')};function emitEvent(_0x17ec7a){return function(_0xdf4c17,_0x50ef95,_0x78edcd){WhatsappMessageEvents['emit'](_0x17ec7a+':'+_0xdf4c17['id'],_0xdf4c17);WhatsappMessageEvents[_0xa2f3('0x5')](_0x17ec7a,_0xdf4c17);_0x78edcd(null);};}for(var e in events){if(events[_0xa2f3('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x5c00=['WhatsappMessage','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0x5c00,0x17e));var _0x05c0=function(_0x347884,_0xd8ef37){_0x347884=_0x347884-0x0;var _0x2cd3fa=_0x5c00[_0x347884];return _0x2cd3fa;};'use strict';var EventEmitter=require(_0x05c0('0x0'));var WhatsappMessage=require(_0x05c0('0x1'))['db'][_0x05c0('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x05c0('0x3'),'afterUpdate':'update','afterDestroy':_0x05c0('0x4')};function emitEvent(_0x25c3a9){return function(_0x37b644,_0x28d9c7,_0x565efc){WhatsappMessageEvents[_0x05c0('0x5')](_0x25c3a9+':'+_0x37b644['id'],_0x37b644);WhatsappMessageEvents[_0x05c0('0x5')](_0x25c3a9,_0x37b644);_0x565efc(null);};}for(var e in events){if(events[_0x05c0('0x6')](e)){var event=events[e];WhatsappMessage[_0x05c0('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 b948c5f..106e956 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 _0x27c0=['then','type','twilio','accountSid','authToken','create','whatsapp:','phone','remote','/status?token=','token','update','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','node-fetch','path','rimraf','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','catch','out','WhatsappAccount','find','WhatsappAccountId'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x27c0,0x1bb));var _0x027c=function(_0x4cae3f,_0x26442e){_0x4cae3f=_0x4cae3f-0x0;var _0x408eaf=_0x27c0[_0x4cae3f];return _0x408eaf;};'use strict';var _=require(_0x027c('0x0'));var util=require(_0x027c('0x1'));var logger=require('../../config/logger')(_0x027c('0x2'));var moment=require(_0x027c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x027c('0x4'));var fs=require('fs');var path=require(_0x027c('0x5'));var rimraf=require(_0x027c('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x027c('0x7')]=function(_0x43d883,_0x4a8bc2){return _0x43d883[_0x027c('0x8')](_0x027c('0x9'),attributes,{'tableName':_0x027c('0xa'),'paranoid':![],'indexes':[{'name':_0x027c('0xb'),'fields':[_0x027c('0xb')]},{'name':_0x027c('0xc'),'fields':[_0x027c('0xd')],'type':_0x027c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa77231,_0x11ae91,_0x566e70){var _0x1e814d=_0x43d883[_0x027c('0xf')];var _0x24c90a=_0xa77231['get']({'plain':!![]});if(_0x24c90a[_0x027c('0x10')][_0x027c('0x11')]()==='in'||_0x24c90a[_0x027c('0x10')][_0x027c('0x11')]()==='out'&&!_0x24c90a[_0x027c('0x12')]&&!_[_0x027c('0x13')](_0x24c90a[_0x027c('0x14')])){_0x1e814d[_0x027c('0x15')][_0x027c('0x16')]({'where':{'id':_0x24c90a[_0x027c('0x17')]}})['then'](function(_0x4f4e36){if(_0x4f4e36){_0x4f4e36['update']({'lastMsgAt':_0x24c90a['createdAt'],'lastMsgDirection':_0x24c90a[_0x027c('0x10')]['toLowerCase']()});}})[_0x027c('0x18')](function(_0x35688e){console['error'](_0x35688e);});}if(_0x24c90a[_0x027c('0x10')]===_0x027c('0x19')&&!_0x24c90a[_0x027c('0x12')]){var _0x52aa9e;_0x1e814d[_0x027c('0x1a')][_0x027c('0x1b')]({'where':{'id':_0x24c90a[_0x027c('0x1c')]},'raw':!![]})[_0x027c('0x1d')](function(_0x2f59ed){_0x52aa9e=_0x2f59ed;if(_0x52aa9e&&_0x52aa9e[_0x027c('0x1e')]){switch(_0x52aa9e[_0x027c('0x1e')]){case _0x027c('0x1f'):var _0x26454c=require(_0x027c('0x1f'));if(_0x52aa9e[_0x027c('0x20')]&&_0x52aa9e['authToken']&&_0x52aa9e['phone']){var _0x3740db=new _0x26454c(_0x52aa9e[_0x027c('0x20')],_0x52aa9e[_0x027c('0x21')]);_0x3740db['messages'][_0x027c('0x22')]({'body':_0x24c90a['body'],'to':_0x027c('0x23')+_0x24c90a['phone'],'from':_0x027c('0x23')+_0x52aa9e[_0x027c('0x24')],'statusCallback':_0x52aa9e[_0x027c('0x25')]+'/api/whatsapp/messages/'+_0x24c90a['id']+_0x027c('0x26')+_0x52aa9e[_0x027c('0x27')]})['then'](function(_0x374765){if(_0x374765['sid']){return _0xa77231[_0x027c('0x28')]({'messageId':_0x374765[_0x027c('0x29')]});}})[_0x027c('0x18')](function(_0x2f9a3d){logger[_0x027c('0x2a')](_0x027c('0x2b'),_0x027c('0x2c'),_0x027c('0x1f'),util[_0x027c('0x2d')](_0x2f9a3d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x027c('0x2b'),_0x027c('0x2c'),_0x027c('0x1f'),_0x027c('0x2e'));}break;case _0x027c('0x2f'):var _0x10706e=_0x52aa9e[_0x027c('0x20')];var _0x315a59=_0x52aa9e[_0x027c('0x21')];var _0x13968f=_0x52aa9e[_0x027c('0x30')]+_0x027c('0x31')+_0x10706e+_0x027c('0x32');var _0x56cee7={'to':[_0x24c90a[_0x027c('0x24')]],'message':{'type':'text','text':_0x24c90a[_0x027c('0xd')]}};var _0x54fa7c={'method':_0x027c('0x33'),'uri':_0x13968f,'headers':{'Authorization':'Bearer\x20'+_0x315a59,'Content-Type':_0x027c('0x34')},'body':_0x56cee7,'json':!![]};rp(_0x54fa7c)[_0x027c('0x1d')](function(_0x206bc9){if(_0x206bc9['statuses'][0x0][_0x027c('0x35')]){return _0xa77231[_0x027c('0x28')]({'messageId':_0x206bc9[_0x027c('0x36')][0x0][_0x027c('0x35')]});}})[_0x027c('0x18')](function(_0x454e88){logger[_0x027c('0x37')](_0x027c('0x38'),_0x454e88);});break;}}})['finally'](function(){_0x566e70();});}else{_0x566e70();}}},'charset':_0x027c('0x39'),'collate':_0x027c('0x3a')});}; \ No newline at end of file +var _0x34ab=['messages','create','whatsapp:','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','/whatsapp/v1/','/messages/','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','UserId','findOne','WhatsappInteractionId','then','update','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone'];(function(_0x2079e7,_0xdc5145){var _0x5a26c9=function(_0x29422d){while(--_0x29422d){_0x2079e7['push'](_0x2079e7['shift']());}};_0x5a26c9(++_0xdc5145);}(_0x34ab,0xf1));var _0xb34a=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0x34ab[_0x5e9a69];return _0x5979c8;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var logger=require(_0xb34a('0x2'))(_0xb34a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb34a('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xb34a('0x5'));var rimraf=require(_0xb34a('0x6'));var config=require(_0xb34a('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0xb34a('0x8')]=function(_0x1f6df3,_0x2c7c79){return _0x1f6df3[_0xb34a('0x9')](_0xb34a('0xa'),attributes,{'tableName':_0xb34a('0xb'),'paranoid':![],'indexes':[{'name':_0xb34a('0xc'),'fields':['messageId']},{'name':_0xb34a('0xd'),'fields':[_0xb34a('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22f097,_0x3888c8,_0x351970){var _0x53f630=_0x1f6df3[_0xb34a('0xf')];var _0x468c1b=_0x22f097[_0xb34a('0x10')]({'plain':!![]});if(_0x468c1b[_0xb34a('0x11')][_0xb34a('0x12')]()==='in'||_0x468c1b[_0xb34a('0x11')][_0xb34a('0x12')]()===_0xb34a('0x13')&&!_0x468c1b[_0xb34a('0x14')]&&!_['isNil'](_0x468c1b[_0xb34a('0x15')])){_0x53f630['WhatsappInteraction'][_0xb34a('0x16')]({'where':{'id':_0x468c1b[_0xb34a('0x17')]}})[_0xb34a('0x18')](function(_0x7f4b87){if(_0x7f4b87){_0x7f4b87[_0xb34a('0x19')]({'lastMsgAt':_0x468c1b['createdAt'],'lastMsgDirection':_0x468c1b[_0xb34a('0x11')][_0xb34a('0x12')]()});}})['catch'](function(_0x573c6c){console[_0xb34a('0x1a')](_0x573c6c);});}if(_0x468c1b[_0xb34a('0x11')]===_0xb34a('0x13')&&!_0x468c1b['secret']){var _0x3d3404;_0x53f630[_0xb34a('0x1b')][_0xb34a('0x1c')]({'where':{'id':_0x468c1b[_0xb34a('0x1d')]},'raw':!![]})['then'](function(_0x5ed23c){_0x3d3404=_0x5ed23c;if(_0x3d3404&&_0x3d3404[_0xb34a('0x1e')]){switch(_0x3d3404[_0xb34a('0x1e')]){case _0xb34a('0x1f'):var _0x15d0ae=require(_0xb34a('0x1f'));if(_0x3d3404[_0xb34a('0x20')]&&_0x3d3404['authToken']&&_0x3d3404[_0xb34a('0x21')]){var _0x4532d7=new _0x15d0ae(_0x3d3404[_0xb34a('0x20')],_0x3d3404['authToken']);_0x4532d7[_0xb34a('0x22')][_0xb34a('0x23')]({'body':_0x468c1b[_0xb34a('0xe')],'to':_0xb34a('0x24')+_0x468c1b[_0xb34a('0x21')],'from':'whatsapp:'+_0x3d3404[_0xb34a('0x21')],'statusCallback':_0x3d3404['remote']+'/api/whatsapp/messages/'+_0x468c1b['id']+_0xb34a('0x25')+_0x3d3404[_0xb34a('0x26')]})[_0xb34a('0x18')](function(_0x4ddb88){if(_0x4ddb88['sid']){return _0x22f097[_0xb34a('0x19')]({'messageId':_0x4ddb88[_0xb34a('0x27')]});}})['catch'](function(_0x195846){logger[_0xb34a('0x1a')](_0xb34a('0x28'),_0xb34a('0x29'),_0xb34a('0x1f'),util['inspect'](_0x195846,{'showHidden':![],'depth':null}));});}else{logger[_0xb34a('0x1a')](_0xb34a('0x28'),'afterCreate',_0xb34a('0x1f'),_0xb34a('0x2a'));}break;case _0xb34a('0x2b'):var _0x23bc41=_0x3d3404['accountSid'];var _0x487d46=_0x3d3404[_0xb34a('0x2c')];var _0x8cc74d=_0x3d3404['baseUrl']+_0xb34a('0x2d')+_0x23bc41+_0xb34a('0x2e');var _0x442baf={'to':[_0x468c1b[_0xb34a('0x21')]],'message':{'type':'text','text':_0x468c1b[_0xb34a('0xe')]}};var _0x198e52={'method':'POST','uri':_0x8cc74d,'headers':{'Authorization':_0xb34a('0x2f')+_0x487d46,'Content-Type':_0xb34a('0x30')},'body':_0x442baf,'json':!![]};rp(_0x198e52)[_0xb34a('0x18')](function(_0x23e5aa){if(_0x23e5aa[_0xb34a('0x31')][0x0][_0xb34a('0x32')]){return _0x22f097[_0xb34a('0x19')]({'messageId':_0x23e5aa[_0xb34a('0x31')][0x0][_0xb34a('0x32')]});}})['catch'](function(_0x321cce){logger[_0xb34a('0x33')](_0xb34a('0x34'),_0x321cce);});break;}}})['finally'](function(){_0x351970();});}else{_0x351970();}}},'charset':_0xb34a('0x35'),'collate':_0xb34a('0x36')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f966214..baf456a 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 _0x2748=['http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','create','body','options','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x31fdb0,_0x22eb3c){var _0x1051bb=function(_0x1083a5){while(--_0x1083a5){_0x31fdb0['push'](_0x31fdb0['shift']());}};_0x1051bb(++_0x22eb3c);}(_0x2748,0xe9));var _0x8274=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2748[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8274('0x0'));var util=require(_0x8274('0x1'));var moment=require(_0x8274('0x2'));var BPromise=require(_0x8274('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8274('0x4'));var db=require(_0x8274('0x5'))['db'];var utils=require(_0x8274('0x6'));var logger=require(_0x8274('0x7'))(_0x8274('0x8'));var config=require(_0x8274('0x9'));var jayson=require(_0x8274('0xa'));var client=jayson[_0x8274('0xb')][_0x8274('0xc')]({'port':0x232a});config[_0x8274('0xd')]=_[_0x8274('0xe')](config['redis'],{'host':_0x8274('0xf'),'port':0x18eb});var socket=require(_0x8274('0x10'))(new Redis(config['redis']));require(_0x8274('0x11'))[_0x8274('0x12')](socket);function respondWithRpcPromise(_0x2b637e,_0x8dbb4,_0xcd5fc){return new BPromise(function(_0x83e822,_0x2b59d5){return client['request'](_0x2b637e,_0xcd5fc)[_0x8274('0x13')](function(_0x4af7bb){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x8dbb4,_0x8274('0x14'));logger[_0x8274('0x15')](_0x8274('0x16'),_0x8dbb4,'request\x20sent',JSON[_0x8274('0x17')](_0x4af7bb));if(_0x4af7bb['error']){if(_0x4af7bb[_0x8274('0x18')][_0x8274('0x19')]===0x1f4){logger[_0x8274('0x18')](_0x8274('0x1a'),_0x8dbb4,_0x4af7bb[_0x8274('0x18')][_0x8274('0x1b')]);return _0x2b59d5(_0x4af7bb['error']['message']);}logger[_0x8274('0x18')](_0x8274('0x1a'),_0x8dbb4,_0x4af7bb['error']['message']);return _0x83e822(_0x4af7bb[_0x8274('0x18')][_0x8274('0x1b')]);}else{logger['info'](_0x8274('0x1a'),_0x8dbb4,_0x8274('0x14'));_0x83e822(_0x4af7bb[_0x8274('0x1c')][_0x8274('0x1b')]);}})[_0x8274('0x1d')](function(_0x3d2c17){logger['error'](_0x8274('0x1a'),_0x8dbb4,_0x3d2c17);_0x2b59d5(_0x3d2c17);});});}exports[_0x8274('0x1e')]=function(_0x41254b){var _0x41330a=this;return new Promise(function(_0x5c81c6,_0x397029){return db['WhatsappMessage'][_0x8274('0x1f')](_0x41254b[_0x8274('0x20')],{'raw':_0x41254b[_0x8274('0x21')]?_0x41254b[_0x8274('0x21')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49febd){logger[_0x8274('0x22')]('CreateWhatsappMessage',_0x41254b);logger[_0x8274('0x15')](_0x8274('0x1e'),_0x41254b,JSON[_0x8274('0x17')](_0x49febd));_0x5c81c6(_0x49febd);})[_0x8274('0x1d')](function(_0x3e09bc){logger[_0x8274('0x18')](_0x8274('0x1e'),_0x3e09bc[_0x8274('0x1b')],_0x41254b);_0x397029(_0x41330a[_0x8274('0x18')](0x1f4,_0x3e09bc[_0x8274('0x1b')]));});});}; \ No newline at end of file +var _0xf5eb=['WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappMessage','create','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xe42f5,_0x526183){var _0xc7b5ec=function(_0x31036e){while(--_0x31036e){_0xe42f5['push'](_0xe42f5['shift']());}};_0xc7b5ec(++_0x526183);}(_0xf5eb,0x181));var _0xbf5e=function(_0x25c26,_0x84fc41){_0x25c26=_0x25c26-0x0;var _0x321e20=_0xf5eb[_0x25c26];return _0x321e20;};'use strict';var _=require('lodash');var util=require(_0xbf5e('0x0'));var moment=require(_0xbf5e('0x1'));var BPromise=require(_0xbf5e('0x2'));var rs=require(_0xbf5e('0x3'));var fs=require('fs');var Redis=require(_0xbf5e('0x4'));var db=require(_0xbf5e('0x5'))['db'];var utils=require(_0xbf5e('0x6'));var logger=require(_0xbf5e('0x7'))(_0xbf5e('0x8'));var config=require(_0xbf5e('0x9'));var jayson=require(_0xbf5e('0xa'));var client=jayson[_0xbf5e('0xb')]['http']({'port':0x232a});config[_0xbf5e('0xc')]=_[_0xbf5e('0xd')](config[_0xbf5e('0xc')],{'host':_0xbf5e('0xe'),'port':0x18eb});var socket=require(_0xbf5e('0xf'))(new Redis(config[_0xbf5e('0xc')]));require(_0xbf5e('0x10'))[_0xbf5e('0x11')](socket);function respondWithRpcPromise(_0x5d1332,_0x2f1964,_0x22535e){return new BPromise(function(_0x5405b7,_0x41292a){return client[_0xbf5e('0x12')](_0x5d1332,_0x22535e)[_0xbf5e('0x13')](function(_0x45902a){logger[_0xbf5e('0x14')](_0xbf5e('0x15'),_0x2f1964,_0xbf5e('0x16'));logger['debug'](_0xbf5e('0x17'),_0x2f1964,_0xbf5e('0x16'),JSON[_0xbf5e('0x18')](_0x45902a));if(_0x45902a[_0xbf5e('0x19')]){if(_0x45902a[_0xbf5e('0x19')][_0xbf5e('0x1a')]===0x1f4){logger[_0xbf5e('0x19')](_0xbf5e('0x15'),_0x2f1964,_0x45902a[_0xbf5e('0x19')]['message']);return _0x41292a(_0x45902a[_0xbf5e('0x19')][_0xbf5e('0x1b')]);}logger['error'](_0xbf5e('0x15'),_0x2f1964,_0x45902a[_0xbf5e('0x19')][_0xbf5e('0x1b')]);return _0x5405b7(_0x45902a[_0xbf5e('0x19')][_0xbf5e('0x1b')]);}else{logger[_0xbf5e('0x14')](_0xbf5e('0x15'),_0x2f1964,'request\x20sent');_0x5405b7(_0x45902a['result'][_0xbf5e('0x1b')]);}})[_0xbf5e('0x1c')](function(_0x175160){logger[_0xbf5e('0x19')](_0xbf5e('0x15'),_0x2f1964,_0x175160);_0x41292a(_0x175160);});});}exports[_0xbf5e('0x1d')]=function(_0x3b9f2b){var _0x5441ff=this;return new Promise(function(_0x7da6ec,_0x532af1){return db['WhatsappMessage'][_0xbf5e('0x1e')](_0x3b9f2b['body'],{'raw':_0x3b9f2b[_0xbf5e('0x1f')]?_0x3b9f2b[_0xbf5e('0x1f')][_0xbf5e('0x20')]===undefined?!![]:![]:!![]})[_0xbf5e('0x13')](function(_0x4b4041){logger[_0xbf5e('0x14')](_0xbf5e('0x1d'),_0x3b9f2b);logger[_0xbf5e('0x21')](_0xbf5e('0x1d'),_0x3b9f2b,JSON[_0xbf5e('0x18')](_0x4b4041));_0x7da6ec(_0x4b4041);})['catch'](function(_0xd62326){logger[_0xbf5e('0x19')](_0xbf5e('0x1d'),_0xd62326['message'],_0x3b9f2b);_0x532af1(_0x5441ff[_0xbf5e('0x19')](0x1f4,_0xd62326[_0xbf5e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 81d0aa1..9f1fca0 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 _0x240f=['register','./whatsappMessage.events','save','remove','update','emit'];(function(_0x1cfe2e,_0x1ebbcd){var _0x39233f=function(_0x48831a){while(--_0x48831a){_0x1cfe2e['push'](_0x1cfe2e['shift']());}};_0x39233f(++_0x1ebbcd);}(_0x240f,0x67));var _0xf240=function(_0x4c4cff,_0xaa8322){_0x4c4cff=_0x4c4cff-0x0;var _0x19a607=_0x240f[_0x4c4cff];return _0x19a607;};'use strict';var WhatsappMessageEvents=require(_0xf240('0x0'));var events=[_0xf240('0x1'),_0xf240('0x2'),_0xf240('0x3')];function createListener(_0x19d777,_0x5632ad){return function(_0x1306d7){_0x5632ad[_0xf240('0x4')](_0x19d777,_0x1306d7);};}function removeListener(_0x129154,_0x30a471){return function(){WhatsappMessageEvents['removeListener'](_0x129154,_0x30a471);};}exports[_0xf240('0x5')]=function(_0x30d828){for(var _0x44bb0d=0x0,_0x409f36=events['length'];_0x44bb0d<_0x409f36;_0x44bb0d++){var _0x51c71e=events[_0x44bb0d];var _0x5ad0d7=createListener('whatsappMessage:'+_0x51c71e,_0x30d828);WhatsappMessageEvents['on'](_0x51c71e,_0x5ad0d7);}}; \ No newline at end of file +var _0x4da4=['whatsappMessage:','./whatsappMessage.events','save','remove','update','removeListener','register','length'];(function(_0x392d1d,_0x486c41){var _0xb1282a=function(_0x113aeb){while(--_0x113aeb){_0x392d1d['push'](_0x392d1d['shift']());}};_0xb1282a(++_0x486c41);}(_0x4da4,0x121));var _0x44da=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0x4da4[_0x2a2e72];return _0x3cfb4a;};'use strict';var WhatsappMessageEvents=require(_0x44da('0x0'));var events=[_0x44da('0x1'),_0x44da('0x2'),_0x44da('0x3')];function createListener(_0x34ae85,_0x16ae98){return function(_0x3ce28e){_0x16ae98['emit'](_0x34ae85,_0x3ce28e);};}function removeListener(_0xa9c515,_0x321280){return function(){WhatsappMessageEvents[_0x44da('0x4')](_0xa9c515,_0x321280);};}exports[_0x44da('0x5')]=function(_0x1f4758){for(var _0x2ba114=0x0,_0x4db5e7=events[_0x44da('0x6')];_0x2ba114<_0x4db5e7;_0x2ba114++){var _0x3ba248=events[_0x2ba114];var _0x5798b2=createListener(_0x44da('0x7')+_0x3ba248,_0x1f4758);WhatsappMessageEvents['on'](_0x3ba248,_0x5798b2);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3401b89..519881b 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 _0xcbb1=['/describe','describe','/:id','isAuthenticated','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','update','delete','removeTeams','removeAgents','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','index','get'];(function(_0x4146ac,_0x380390){var _0x1773d0=function(_0x1b4037){while(--_0x1b4037){_0x4146ac['push'](_0x4146ac['shift']());}};_0x1773d0(++_0x380390);}(_0xcbb1,0x1d2));var _0x1cbb=function(_0x6c3a50,_0x242eb2){_0x6c3a50=_0x6c3a50-0x0;var _0x51f665=_0xcbb1[_0x6c3a50];return _0x51f665;};'use strict';var multer=require('multer');var util=require(_0x1cbb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1cbb('0x1'));var router=express[_0x1cbb('0x2')]();var fs_extra=require(_0x1cbb('0x3'));var auth=require(_0x1cbb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1cbb('0x5'));var controller=require(_0x1cbb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1cbb('0x7')]);router[_0x1cbb('0x8')](_0x1cbb('0x9'),auth['isAuthenticated'](),controller[_0x1cbb('0xa')]);router[_0x1cbb('0x8')](_0x1cbb('0xb'),auth[_0x1cbb('0xc')](),controller['show']);router[_0x1cbb('0x8')](_0x1cbb('0xd'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x1cbb('0xe'),auth[_0x1cbb('0xc')](),controller[_0x1cbb('0xf')]);router[_0x1cbb('0x8')](_0x1cbb('0x10'),auth[_0x1cbb('0xc')](),controller['getAgents']);router[_0x1cbb('0x11')]('/',auth[_0x1cbb('0xc')](),controller[_0x1cbb('0x12')]);router[_0x1cbb('0x11')](_0x1cbb('0xe'),auth[_0x1cbb('0xc')](),controller['addTeams']);router[_0x1cbb('0x11')](_0x1cbb('0x10'),auth['isAuthenticated'](),controller[_0x1cbb('0x13')]);router['put'](_0x1cbb('0xb'),auth[_0x1cbb('0xc')](),controller[_0x1cbb('0x14')]);router[_0x1cbb('0x15')]('/:id',auth[_0x1cbb('0xc')](),controller['destroy']);router[_0x1cbb('0x15')]('/:id/teams',auth[_0x1cbb('0xc')](),controller[_0x1cbb('0x16')]);router[_0x1cbb('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x1cbb('0x17')]);module[_0x1cbb('0x18')]=router; \ No newline at end of file +var _0x61cb=['fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','express','Router'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x61cb,0xbf));var _0xb61c=function(_0x1f6ba3,_0x5b7a1d){_0x1f6ba3=_0x1f6ba3-0x0;var _0x218b24=_0x61cb[_0x1f6ba3];return _0x218b24;};'use strict';var multer=require(_0xb61c('0x0'));var util=require(_0xb61c('0x1'));var path=require(_0xb61c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb61c('0x3'));var router=express[_0xb61c('0x4')]();var fs_extra=require(_0xb61c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb61c('0x6'));var config=require(_0xb61c('0x7'));var controller=require(_0xb61c('0x8'));router[_0xb61c('0x9')]('/',auth[_0xb61c('0xa')](),controller[_0xb61c('0xb')]);router['get'](_0xb61c('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb61c('0xd'),auth[_0xb61c('0xa')](),controller[_0xb61c('0xe')]);router[_0xb61c('0x9')](_0xb61c('0xf'),auth[_0xb61c('0xa')](),controller[_0xb61c('0x10')]);router[_0xb61c('0x9')](_0xb61c('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0xb61c('0x9')](_0xb61c('0x12'),auth[_0xb61c('0xa')](),controller['getAgents']);router[_0xb61c('0x13')]('/',auth[_0xb61c('0xa')](),controller['create']);router[_0xb61c('0x13')](_0xb61c('0x11'),auth[_0xb61c('0xa')](),controller[_0xb61c('0x14')]);router[_0xb61c('0x13')]('/:id/users',auth[_0xb61c('0xa')](),controller['addAgents']);router[_0xb61c('0x15')](_0xb61c('0xd'),auth[_0xb61c('0xa')](),controller[_0xb61c('0x16')]);router['delete'](_0xb61c('0xd'),auth[_0xb61c('0xa')](),controller[_0xb61c('0x17')]);router['delete']('/:id/teams',auth[_0xb61c('0xa')](),controller[_0xb61c('0x18')]);router[_0xb61c('0x19')](_0xb61c('0x12'),auth[_0xb61c('0xa')](),controller[_0xb61c('0x1a')]);module[_0xb61c('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 65b403b..0d54eab 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 _0x6ce9=['STRING','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x1e8bea,_0x47bde9){var _0x29f756=function(_0x37bb53){while(--_0x37bb53){_0x1e8bea['push'](_0x1e8bea['shift']());}};_0x29f756(++_0x47bde9);}(_0x6ce9,0x76));var _0x96ce=function(_0x593929,_0x51385b){_0x593929=_0x593929-0x0;var _0x548c5c=_0x6ce9[_0x593929];return _0x548c5c;};'use strict';var Sequelize=require(_0x96ce('0x0'));module[_0x96ce('0x1')]={'name':{'type':Sequelize[_0x96ce('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x96ce('0x3')]('rrmemory',_0x96ce('0x4'),_0x96ce('0x5'))},'description':{'type':Sequelize[_0x96ce('0x2')]}}; \ No newline at end of file +var _0x138d=['rrmemory','beepall','roundrobin','sequelize','exports','name','INTEGER','ENUM'];(function(_0x3ef6ed,_0x8c54b){var _0x422936=function(_0x2b4f3a){while(--_0x2b4f3a){_0x3ef6ed['push'](_0x3ef6ed['shift']());}};_0x422936(++_0x8c54b);}(_0x138d,0x1ab));var _0xd138=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0x138d[_0x114d1f];return _0x5b91d4;};'use strict';var Sequelize=require(_0xd138('0x0'));module[_0xd138('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd138('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xd138('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd138('0x4')](_0xd138('0x5'),_0xd138('0x6'),_0xd138('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 124db0b..717c502 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 _0x3958=['register','status','end','json','offset','undefined','count','limit','set','then','destroy','get','UserProfileResource','sendStatus','stack','name','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','create','body','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','error','update','find','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','where','filters','WhatsappQueueId','filter','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','pick','addTeams','ids','Agents','interface','flatMap','sequelize','transaction','emit','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','SELECT','every','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userWhatsappQueue:save','isArray','userWhatsappQueue:remove','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket'];(function(_0x57e7f8,_0x328bcd){var _0x39f93b=function(_0x478568){while(--_0x478568){_0x57e7f8['push'](_0x57e7f8['shift']());}};_0x39f93b(++_0x328bcd);}(_0x3958,0x6a));var _0x8395=function(_0x5da0dd,_0x621a99){_0x5da0dd=_0x5da0dd-0x0;var _0x2e0032=_0x3958[_0x5da0dd];return _0x2e0032;};'use strict';var BPromise=require(_0x8395('0x0'));var util=require('util');var _=require(_0x8395('0x1'));var squel=require(_0x8395('0x2'));var Redis=require(_0x8395('0x3'));var qs=require(_0x8395('0x4'));var logger=require(_0x8395('0x5'))(_0x8395('0x6'));var config=require('../../config/environment');var db=require(_0x8395('0x7'))['db'];config['redis']=_['defaults'](config[_0x8395('0x8')],{'host':_0x8395('0x9'),'port':0x18eb});var socket=require(_0x8395('0xa'))(new Redis(config[_0x8395('0x8')]));require(_0x8395('0xb'))[_0x8395('0xc')](socket);function respondWithStatusCode(_0x31786e,_0x55fd66){_0x55fd66=_0x55fd66||0xcc;return function(_0x49efeb){if(_0x49efeb){return _0x31786e['sendStatus'](_0x55fd66);}return _0x31786e[_0x8395('0xd')](_0x55fd66)[_0x8395('0xe')]();};}function respondWithResult(_0x1f56ed,_0x200dab){_0x200dab=_0x200dab||0xc8;return function(_0x4f43d6){if(_0x4f43d6){return _0x1f56ed[_0x8395('0xd')](_0x200dab)[_0x8395('0xf')](_0x4f43d6);}};}function respondWithFilteredResult(_0xcfb8d5,_0x34faed){return function(_0x2f5bf2){if(_0x2f5bf2){var _0x60082e=typeof _0x34faed[_0x8395('0x10')]==='undefined'&&typeof _0x34faed['limit']===_0x8395('0x11');var _0x47a3b1=_0x2f5bf2[_0x8395('0x12')];var _0x53fcb4=_0x60082e?0x0:_0x34faed[_0x8395('0x10')];var _0x52792e=_0x60082e?_0x2f5bf2[_0x8395('0x12')]:_0x34faed['offset']+_0x34faed[_0x8395('0x13')];var _0x303dcf;if(_0x52792e>=_0x47a3b1){_0x52792e=_0x47a3b1;_0x303dcf=0xc8;}else{_0x303dcf=0xce;}_0xcfb8d5['status'](_0x303dcf);return _0xcfb8d5[_0x8395('0x14')]('Content-Range',_0x53fcb4+'-'+_0x52792e+'/'+_0x47a3b1)[_0x8395('0xf')](_0x2f5bf2);}return null;};}function saveUpdates(_0x454303){return function(_0x25614e){if(_0x25614e){return _0x25614e['update'](_0x454303)[_0x8395('0x15')](function(_0x2c62ac){return _0x2c62ac;});}return null;};}function removeEntity(_0xe1c06e){return function(_0x39f7b1){if(_0x39f7b1){return _0x39f7b1[_0x8395('0x16')]()[_0x8395('0x15')](function(){var _0x2ccfda=_0x39f7b1[_0x8395('0x17')]({'plain':!![]});var _0x3f3c33='WhatsappQueues';return db[_0x8395('0x18')][_0x8395('0x16')]({'where':{'type':_0x3f3c33,'resourceId':_0x2ccfda['id']}})[_0x8395('0x15')](function(){return _0x39f7b1;});})[_0x8395('0x15')](function(){_0xe1c06e[_0x8395('0xd')](0xcc)[_0x8395('0xe')]();});}};}function handleEntityNotFound(_0x3e1b16){return function(_0x488170){if(!_0x488170){_0x3e1b16[_0x8395('0x19')](0x194);}return _0x488170;};}function handleError(_0x5c3f18,_0x4da678){_0x4da678=_0x4da678||0x1f4;return function(_0xdaffd1){logger['error'](_0xdaffd1[_0x8395('0x1a')]);if(_0xdaffd1[_0x8395('0x1b')]){delete _0xdaffd1[_0x8395('0x1b')];}_0x5c3f18[_0x8395('0xd')](_0x4da678)['send'](_0xdaffd1);};}exports['index']=function(_0x4c6ba1,_0xa494ac){var _0x5c6e47={};var _0xa5e442={'count':0x0,'rows':[]};var _0x5114fe=_[_0x8395('0x1c')](db[_0x8395('0x1d')][_0x8395('0x1e')],function(_0x3224f9){return{'name':_0x3224f9[_0x8395('0x1f')],'type':_0x3224f9[_0x8395('0x20')][_0x8395('0x21')]};});_0x5c6e47=qs[_0x8395('0x22')](_0x5114fe,_0x4c6ba1);var _0x1e26d7={'where':_0x5c6e47['where']};return db['WhatsappQueue'][_0x8395('0x12')](_0x1e26d7)[_0x8395('0x15')](function(_0x51f835){_0xa5e442['count']=_0x51f835;_0x5c6e47[_0x8395('0x23')]=qs[_0x8395('0x23')](_0x4c6ba1[_0x8395('0x24')]);return db['WhatsappQueue'][_0x8395('0x25')](_0x5c6e47);})[_0x8395('0x15')](function(_0xe5a17b){_0xa5e442['rows']=_0xe5a17b;return _0xa5e442;})[_0x8395('0x15')](respondWithFilteredResult(_0xa494ac,_0x5c6e47))[_0x8395('0x26')](handleError(_0xa494ac,null));};exports[_0x8395('0x27')]=function(_0x2f4e00,_0x1b600a){var _0x3a6715={'raw':!![],'where':{'id':_0x2f4e00[_0x8395('0x28')]['id']}},_0x2e8c7e={};_0x2e8c7e[_0x8395('0x29')]=_[_0x8395('0x2a')](db[_0x8395('0x1d')][_0x8395('0x1e')]);_0x2e8c7e['query']=_['keys'](_0x2f4e00[_0x8395('0x24')]);_0x2e8c7e['filters']=_[_0x8395('0x2b')](_0x2e8c7e['model'],_0x2e8c7e[_0x8395('0x24')]);_0x3a6715[_0x8395('0x2c')]=_[_0x8395('0x2b')](_0x2e8c7e[_0x8395('0x29')],qs[_0x8395('0x2d')](_0x2f4e00[_0x8395('0x24')]['fields']));_0x3a6715[_0x8395('0x2c')]=_0x3a6715['attributes'][_0x8395('0x2e')]?_0x3a6715[_0x8395('0x2c')]:_0x2e8c7e[_0x8395('0x29')];if(_0x2f4e00['query'][_0x8395('0x2f')]){_0x3a6715[_0x8395('0x23')]=[{'all':!![]}];}_0x3a6715=_[_0x8395('0x30')]({},_0x3a6715,_0x2f4e00[_0x8395('0x31')]);return db[_0x8395('0x1d')]['find'](_0x3a6715)['then'](handleEntityNotFound(_0x1b600a,null))[_0x8395('0x15')](respondWithResult(_0x1b600a,null))['catch'](handleError(_0x1b600a,null));};exports[_0x8395('0x32')]=function(_0x32fc9e,_0x45df02){return db[_0x8395('0x1d')][_0x8395('0x32')](_0x32fc9e[_0x8395('0x33')],{})[_0x8395('0x15')](function(_0x57c6e1){var _0x37903c=_0x32fc9e['user']['get']({'plain':!![]});if(!_0x37903c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37903c['role']==='user'){var _0x143b84=_0x57c6e1[_0x8395('0x17')]({'plain':!![]});var _0x3cc064=_0x8395('0x34');return db[_0x8395('0x35')]['find']({'where':{'name':_0x3cc064,'userProfileId':_0x37903c[_0x8395('0x36')]},'raw':!![]})['then'](function(_0x2cbb27){if(_0x2cbb27&&_0x2cbb27[_0x8395('0x37')]===0x0){return db[_0x8395('0x18')][_0x8395('0x32')]({'name':_0x143b84['name'],'resourceId':_0x143b84['id'],'type':_0x2cbb27['name'],'sectionId':_0x2cbb27['id']},{})[_0x8395('0x15')](function(){return _0x57c6e1;});}else{return _0x57c6e1;}})[_0x8395('0x26')](function(_0xf23120){logger[_0x8395('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf23120);throw _0xf23120;});}return _0x57c6e1;})['then'](respondWithResult(_0x45df02,0xc9))[_0x8395('0x26')](handleError(_0x45df02,null));};exports[_0x8395('0x39')]=function(_0x50c8b0,_0x2afd88){if(_0x50c8b0[_0x8395('0x33')]['id']){delete _0x50c8b0[_0x8395('0x33')]['id'];}return db[_0x8395('0x1d')][_0x8395('0x3a')]({'where':{'id':_0x50c8b0[_0x8395('0x28')]['id']}})[_0x8395('0x15')](handleEntityNotFound(_0x2afd88,null))[_0x8395('0x15')](saveUpdates(_0x50c8b0[_0x8395('0x33')],null))['then'](respondWithResult(_0x2afd88,null))[_0x8395('0x26')](handleError(_0x2afd88,null));};exports[_0x8395('0x16')]=function(_0x357832,_0x647016){return db[_0x8395('0x1d')][_0x8395('0x3a')]({'where':{'id':_0x357832[_0x8395('0x28')]['id']}})[_0x8395('0x15')](handleEntityNotFound(_0x647016,null))[_0x8395('0x15')](removeEntity(_0x647016,null))[_0x8395('0x26')](handleError(_0x647016,null));};exports[_0x8395('0x3b')]=function(_0x3e44d5,_0x90dd6a){return db[_0x8395('0x1d')][_0x8395('0x3b')]()['then'](respondWithResult(_0x90dd6a,null))[_0x8395('0x26')](handleError(_0x90dd6a,null));};exports[_0x8395('0x3c')]=function(_0xadf959,_0x365562){var _0x28b02b={'raw':!![],'where':{}},_0xdf0dc8={},_0x28a97a;return db[_0x8395('0x1d')][_0x8395('0x3d')]({'where':{'id':_0xadf959['params']['id']}})[_0x8395('0x15')](handleEntityNotFound(_0x365562,null))['then'](function(_0x2d7641){if(_0x2d7641){_0x28a97a=_0x2d7641[_0x8395('0x17')]({'plain':!![]});_0xdf0dc8['model']=_[_0x8395('0x2a')](db['UserWhatsappQueue'][_0x8395('0x1e')]);_0xdf0dc8[_0x8395('0x24')]=_[_0x8395('0x2a')](_0xadf959[_0x8395('0x24')]);_0xdf0dc8['filters']=_[_0x8395('0x2b')](_0xdf0dc8[_0x8395('0x29')],_0xdf0dc8[_0x8395('0x24')]);_0x28b02b[_0x8395('0x2c')]=_[_0x8395('0x2b')](_0xdf0dc8[_0x8395('0x29')],qs[_0x8395('0x2d')](_0xadf959['query'][_0x8395('0x2d')]));_0x28b02b['attributes']=_0x28b02b[_0x8395('0x2c')][_0x8395('0x2e')]?_0x28b02b[_0x8395('0x2c')]:_0xdf0dc8[_0x8395('0x29')];if(!_0xadf959[_0x8395('0x24')][_0x8395('0x3e')](_0x8395('0x3f'))){_0x28b02b['limit']=qs[_0x8395('0x13')](_0xadf959['query'][_0x8395('0x13')]);_0x28b02b['offset']=qs[_0x8395('0x10')](_0xadf959[_0x8395('0x24')]['offset']);}_0x28b02b[_0x8395('0x40')]=qs[_0x8395('0x41')](_0xadf959[_0x8395('0x24')][_0x8395('0x41')]);_0x28b02b[_0x8395('0x42')]=qs[_0x8395('0x43')](_['pick'](_0xadf959[_0x8395('0x24')],_0xdf0dc8[_0x8395('0x43')]));_0x28b02b[_0x8395('0x42')][_0x8395('0x44')]=_0x2d7641['id'];if(_0xadf959[_0x8395('0x24')]['filter']){_0x28b02b[_0x8395('0x42')]=_[_0x8395('0x30')](_0x28b02b[_0x8395('0x42')],{'$or':_[_0x8395('0x1c')](_0x28b02b[_0x8395('0x2c')],function(_0x4590a6){var _0x28791c={};_0x28791c[_0x4590a6]={'$like':'%'+_0xadf959[_0x8395('0x24')][_0x8395('0x45')]+'%'};return _0x28791c;})});}_0x28b02b=_[_0x8395('0x30')]({},_0x28b02b,_0xadf959[_0x8395('0x31')]);return db['UserWhatsappQueue']['findAll'](_0x28b02b);}})['then'](function(_0x96229e){if(_0x96229e){return db[_0x8395('0x46')][_0x8395('0x47')]({'where':{'id':_[_0x8395('0x1c')](_0x96229e,_0x8395('0x48')),'role':'agent'},'attributes':['id',_0x8395('0x1b'),_0x8395('0x49'),_0x8395('0x4a'),_0x8395('0x4b')]});}})[_0x8395('0x15')](function(_0x5e522b){if(_0x5e522b){return{'count':_0x5e522b[_0x8395('0x12')],'rows':_[_0x8395('0x1c')](_0x5e522b[_0x8395('0x4c')],function(_0x53a76d){return{'membername':_0x53a76d['name'],'UserId':_0x53a76d['id'],'queue_name':_0x28a97a[_0x8395('0x1b')],'WhatsappQueueId':_0x28a97a['id'],'interface':util[_0x8395('0x4d')](_0x8395('0x4e'),'SIP',_0x53a76d[_0x8395('0x1b')]),'penalty':0x0,'paused':_0x53a76d[_0x8395('0x49')],'createdAt':_0x53a76d[_0x8395('0x4b')],'updatedAt':_0x53a76d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8395('0x15')](respondWithFilteredResult(_0x365562,_0x28b02b))[_0x8395('0x26')](handleError(_0x365562,null));};exports[_0x8395('0x4f')]=function(_0x46066a,_0x372dea){var _0x4fd500={};var _0x496387={};var _0xb0d0e3;var _0x503dc7;return db['WhatsappQueue'][_0x8395('0x3d')]({'where':{'id':_0x46066a['params']['id']}})['then'](handleEntityNotFound(_0x372dea,null))[_0x8395('0x15')](function(_0x6a20e3){if(_0x6a20e3){_0xb0d0e3=_0x6a20e3;_0x496387[_0x8395('0x29')]=_[_0x8395('0x2a')](db[_0x8395('0x50')][_0x8395('0x1e')]);_0x496387['query']=_[_0x8395('0x2a')](_0x46066a[_0x8395('0x24')]);_0x496387[_0x8395('0x43')]=_[_0x8395('0x2b')](_0x496387[_0x8395('0x29')],_0x496387[_0x8395('0x24')]);_0x4fd500[_0x8395('0x2c')]=_[_0x8395('0x2b')](_0x496387['model'],qs[_0x8395('0x2d')](_0x46066a[_0x8395('0x24')][_0x8395('0x2d')]));_0x4fd500[_0x8395('0x2c')]=_0x4fd500['attributes'][_0x8395('0x2e')]?_0x4fd500[_0x8395('0x2c')]:_0x496387[_0x8395('0x29')];_0x4fd500[_0x8395('0x40')]=qs[_0x8395('0x41')](_0x46066a[_0x8395('0x24')]['sort']);_0x4fd500['where']=qs['filters'](_[_0x8395('0x51')](_0x46066a['query'],_0x496387[_0x8395('0x43')]));if(_0x46066a[_0x8395('0x24')]['filter']){_0x4fd500[_0x8395('0x42')]=_[_0x8395('0x30')](_0x4fd500[_0x8395('0x42')],{'$or':_[_0x8395('0x1c')](_0x4fd500[_0x8395('0x2c')],function(_0x2de2b6){var _0x13f3c8={};_0x13f3c8[_0x2de2b6]={'$like':'%'+_0x46066a[_0x8395('0x24')][_0x8395('0x45')]+'%'};return _0x13f3c8;})});}_0x4fd500=_[_0x8395('0x30')]({},_0x4fd500,_0x46066a[_0x8395('0x31')]);return _0xb0d0e3[_0x8395('0x4f')](_0x4fd500);}})[_0x8395('0x15')](function(_0x35f59f){if(_0x35f59f){_0x503dc7=_0x35f59f[_0x8395('0x2e')];if(!_0x46066a[_0x8395('0x24')][_0x8395('0x3e')](_0x8395('0x3f'))){_0x4fd500['limit']=qs[_0x8395('0x13')](_0x46066a[_0x8395('0x24')][_0x8395('0x13')]);_0x4fd500[_0x8395('0x10')]=qs['offset'](_0x46066a[_0x8395('0x24')][_0x8395('0x10')]);}return _0xb0d0e3[_0x8395('0x4f')](_0x4fd500);}})[_0x8395('0x15')](function(_0x45129a){if(_0x45129a){return _0x45129a?{'count':_0x503dc7,'rows':_0x45129a}:null;}})[_0x8395('0x15')](respondWithResult(_0x372dea,null))[_0x8395('0x26')](handleError(_0x372dea,null));};exports[_0x8395('0x52')]=function(_0x1b7e50,_0x579f22){var _0x476d89=_0x1b7e50[_0x8395('0x33')][_0x8395('0x53')];return db[_0x8395('0x50')]['findAll']({'where':{'id':_0x476d89},'attributes':['id'],'include':[{'model':db[_0x8395('0x46')],'as':_0x8395('0x54'),'attributes':['id',_0x8395('0x1b'),'online','voicePause',_0x8395('0x55')],'raw':!![]}]})[_0x8395('0x15')](function(_0x26cc05){if(_0x26cc05){var _0x3dda11=_[_0x8395('0x56')](_0x26cc05,function(_0x2163c5){var _0x21cee3=_0x2163c5[_0x8395('0x17')]({'plain':!![]});return _0x21cee3['Agents'];});return db[_0x8395('0x1d')]['find']({'where':{'id':_0x1b7e50[_0x8395('0x28')]['id']}})[_0x8395('0x15')](function(_0x2ff705){return db[_0x8395('0x57')][_0x8395('0x58')](function(_0x2aca8f){return _0x2ff705[_0x8395('0x52')](_0x476d89,{'transaction':_0x2aca8f})[_0x8395('0x15')](function(){return BPromise['each'](_0x3dda11,function(_0x2cf52c){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x2cf52c['id'],'WhatsappQueueId':_0x1b7e50[_0x8395('0x28')]['id']},'transaction':_0x2aca8f});});})['then'](function(){_0x3dda11['forEach'](function(_0x4c0fc8){socket[_0x8395('0x59')]('userWhatsappQueue:save',{'UserId':_0x4c0fc8['id'],'WhatsappQueueId':_0x2ff705['id']});});});});});}})[_0x8395('0x15')](respondWithStatusCode(_0x579f22,null))['catch'](handleError(_0x579f22,null));};exports[_0x8395('0x5a')]=function(_0x15bddd,_0x502c36){return db[_0x8395('0x50')]['findAll']({'where':{'id':_0x15bddd['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x8395('0x46')],'as':_0x8395('0x54'),'attributes':['id'],'raw':!![]}]})[_0x8395('0x15')](handleEntityNotFound(_0x502c36,null))['then'](function(_0x4c79d8){var _0x3ce6a4=_['map'](_0x4c79d8,'id');var _0x3d4570=[];var _0x2b18a5=[];var _0x5a84cb=squel[_0x8395('0x5b')]();_0x5a84cb[_0x8395('0x5c')](_0x8395('0x5d'))[_0x8395('0x5e')](_0x8395('0x5f'),'tq')[_0x8395('0x60')](_0x8395('0x61'),'ut',_0x8395('0x62'))[_0x8395('0x42')](_0x8395('0x63'),_0x15bddd[_0x8395('0x28')]['id']);for(var _0x39ef45=0x0;_0x39ef45<_0x4c79d8[_0x8395('0x2e')];_0x39ef45+=0x1){let _0x3299c8=_0x4c79d8[_0x39ef45];for(var _0xd32424=0x0;_0xd32424<_0x3299c8[_0x8395('0x54')][_0x8395('0x2e')];_0xd32424+=0x1){let _0xa0f2a4=_0x3299c8[_0x8395('0x54')][_0xd32424];var _0x3894e6=_0x5a84cb[_0x8395('0x64')]();_0x3894e6[_0x8395('0x42')]('ut.UserId\x20=\x20?',_0xa0f2a4['id']);_0x2b18a5[_0x8395('0x65')](db[_0x8395('0x57')]['query'](_0x3894e6[_0x8395('0x66')](),{'type':db[_0x8395('0x57')]['QueryTypes'][_0x8395('0x67')]})[_0x8395('0x15')](function(_0x47ae76){if(_0x47ae76[_0x8395('0x2e')]===0x1){return _0xa0f2a4['id'];}else{var _0x1674c3=_[_0x8395('0x68')](_[_0x8395('0x1c')](_0x47ae76,'TeamId'),function(_0x4d3825){return _['includes'](_0x3ce6a4,_0x4d3825);});if(_0x1674c3){return _0xa0f2a4['id'];}}}));}}return BPromise['all'](_0x2b18a5)[_0x8395('0x15')](function(_0x31a198){_0x3d4570=_(_0x3d4570)[_0x8395('0x69')](_0x31a198)[_0x8395('0x6a')]()[_0x8395('0x6b')]();return db[_0x8395('0x1d')][_0x8395('0x3a')]({'where':{'id':_0x15bddd['params']['id']}})[_0x8395('0x15')](function(_0x2c0a54){return db['sequelize'][_0x8395('0x58')](function(_0x43539b){return _0x2c0a54[_0x8395('0x5a')](_0x15bddd[_0x8395('0x24')][_0x8395('0x53')],{'transaction':_0x43539b})['then'](function(){if(!_[_0x8395('0x6c')](_0x3d4570)){return _0x2c0a54[_0x8395('0x6d')](_0x3d4570,{'transaction':_0x43539b});}})[_0x8395('0x15')](function(){_0x3d4570[_0x8395('0x6e')](function(_0x488b0e){socket[_0x8395('0x59')]('userWhatsappQueue:remove',{'UserId':_0x488b0e,'WhatsappQueueId':_0x2c0a54['id']});});});});});});})['then'](respondWithStatusCode(_0x502c36,null))[_0x8395('0x26')](handleError(_0x502c36,null));};exports[_0x8395('0x6f')]=function(_0x207abc,_0x104b42){return db[_0x8395('0x1d')][_0x8395('0x3a')]({'where':{'id':_0x207abc[_0x8395('0x28')]['id']}})[_0x8395('0x15')](handleEntityNotFound(_0x104b42,null))['then'](function(_0x28ca48){if(_0x28ca48){return _0x28ca48[_0x8395('0x6f')](_0x207abc[_0x8395('0x33')][_0x8395('0x53')],_[_0x8395('0x70')](_0x207abc[_0x8395('0x33')],[_0x8395('0x53'),'id'])||{})[_0x8395('0x71')](function(_0x111a9f){for(var _0x9e4397=0x0;_0x9e4397<_0x207abc[_0x8395('0x33')][_0x8395('0x53')][_0x8395('0x2e')];_0x9e4397+=0x1){socket[_0x8395('0x59')](_0x8395('0x72'),{'UserId':Number(_0x207abc['body'][_0x8395('0x53')][_0x9e4397]),'WhatsappQueueId':Number(_0x207abc[_0x8395('0x28')]['id'])});}return _0x111a9f;});}})['then'](respondWithResult(_0x104b42,null))[_0x8395('0x26')](handleError(_0x104b42,null));};exports[_0x8395('0x6d')]=function(_0x17cb9a,_0x4aa4a8){return db[_0x8395('0x1d')][_0x8395('0x3a')]({'where':{'id':_0x17cb9a[_0x8395('0x28')]['id']}})[_0x8395('0x15')](handleEntityNotFound(_0x4aa4a8,null))[_0x8395('0x15')](function(_0x52fa10){if(_0x52fa10){return _0x52fa10[_0x8395('0x6d')](_0x17cb9a[_0x8395('0x24')][_0x8395('0x53')])[_0x8395('0x15')](function(){if(_[_0x8395('0x73')](_0x17cb9a[_0x8395('0x24')][_0x8395('0x53')])){for(var _0x335797=0x0;_0x335797<_0x17cb9a[_0x8395('0x24')]['ids'][_0x8395('0x2e')];_0x335797+=0x1){socket[_0x8395('0x59')](_0x8395('0x74'),{'UserId':Number(_0x17cb9a[_0x8395('0x24')][_0x8395('0x53')][_0x335797]),'WhatsappQueueId':Number(_0x17cb9a['params']['id'])});}}else{socket[_0x8395('0x59')](_0x8395('0x74'),{'UserId':Number(_0x17cb9a[_0x8395('0x24')][_0x8395('0x53')]),'WhatsappQueueId':Number(_0x17cb9a[_0x8395('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x4aa4a8,null))[_0x8395('0x26')](handleError(_0x4aa4a8,null));};exports[_0x8395('0x75')]=function(_0x9b84de,_0xe1ced5){var _0x406053={};var _0x5b7f6e={};var _0x26b40f;var _0x13ead1;return db['WhatsappQueue'][_0x8395('0x3d')]({'where':{'id':_0x9b84de[_0x8395('0x28')]['id']}})[_0x8395('0x15')](handleEntityNotFound(_0xe1ced5,null))[_0x8395('0x15')](function(_0x98ed43){if(_0x98ed43){_0x26b40f=_0x98ed43;_0x5b7f6e[_0x8395('0x29')]=_['keys'](db[_0x8395('0x46')][_0x8395('0x1e')]);_0x5b7f6e[_0x8395('0x24')]=_[_0x8395('0x2a')](_0x9b84de[_0x8395('0x24')]);_0x5b7f6e[_0x8395('0x43')]=_[_0x8395('0x2b')](_0x5b7f6e[_0x8395('0x29')],_0x5b7f6e[_0x8395('0x24')]);_0x406053[_0x8395('0x2c')]=_[_0x8395('0x2b')](_0x5b7f6e['model'],qs[_0x8395('0x2d')](_0x9b84de[_0x8395('0x24')]['fields']));_0x406053[_0x8395('0x2c')]=_0x406053[_0x8395('0x2c')][_0x8395('0x2e')]?_0x406053[_0x8395('0x2c')]:_0x5b7f6e[_0x8395('0x29')];_0x406053[_0x8395('0x40')]=qs[_0x8395('0x41')](_0x9b84de['query'][_0x8395('0x41')]);_0x406053[_0x8395('0x42')]=qs[_0x8395('0x43')](_[_0x8395('0x51')](_0x9b84de[_0x8395('0x24')],_0x5b7f6e[_0x8395('0x43')]));if(_0x9b84de[_0x8395('0x24')]['filter']){_0x406053[_0x8395('0x42')]=_['merge'](_0x406053[_0x8395('0x42')],{'$or':_[_0x8395('0x1c')](_0x406053[_0x8395('0x2c')],function(_0x1fa79c){var _0x576f49={};_0x576f49[_0x1fa79c]={'$like':'%'+_0x9b84de[_0x8395('0x24')][_0x8395('0x45')]+'%'};return _0x576f49;})});}_0x406053=_[_0x8395('0x30')]({},_0x406053,_0x9b84de[_0x8395('0x31')]);return _0x26b40f[_0x8395('0x75')](_0x406053);}})['then'](function(_0x4dd115){if(_0x4dd115){_0x13ead1=_0x4dd115[_0x8395('0x2e')];if(!_0x9b84de[_0x8395('0x24')][_0x8395('0x3e')](_0x8395('0x3f'))){_0x406053['limit']=qs[_0x8395('0x13')](_0x9b84de[_0x8395('0x24')][_0x8395('0x13')]);_0x406053[_0x8395('0x10')]=qs[_0x8395('0x10')](_0x9b84de[_0x8395('0x24')]['offset']);}return _0x26b40f['getAgents'](_0x406053);}})[_0x8395('0x15')](function(_0x24ca6f){if(_0x24ca6f){return _0x24ca6f?{'count':_0x13ead1,'rows':_0x24ca6f}:null;}})[_0x8395('0x15')](respondWithResult(_0xe1ced5,null))[_0x8395('0x26')](handleError(_0xe1ced5,null));}; \ No newline at end of file +var _0xcf91=['UserWhatsappQueue','findAll','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','omit','getAgents','bluebird','lodash','squel','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','status','json','offset','limit','count','set','Content-Range','then','destroy','get','UserProfileResource','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','getOptions','where','include','query','rows','catch','show','params','keys','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','error','body','describe','getMembers','findOne','filters','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x58df37,_0xa0cc7b){var _0x491b76=function(_0x55c225){while(--_0x55c225){_0x58df37['push'](_0x58df37['shift']());}};_0x491b76(++_0xa0cc7b);}(_0xcf91,0xac));var _0x1cf9=function(_0x231508,_0x5bb273){_0x231508=_0x231508-0x0;var _0xe2468e=_0xcf91[_0x231508];return _0xe2468e;};'use strict';var BPromise=require(_0x1cf9('0x0'));var util=require('util');var _=require(_0x1cf9('0x1'));var squel=require(_0x1cf9('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1cf9('0x3'))(_0x1cf9('0x4'));var config=require('../../config/environment');var db=require(_0x1cf9('0x5'))['db'];config[_0x1cf9('0x6')]=_[_0x1cf9('0x7')](config[_0x1cf9('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x1cf9('0x8'))(new Redis(config[_0x1cf9('0x6')]));require(_0x1cf9('0x9'))['register'](socket);function respondWithStatusCode(_0x2a03e7,_0x40823f){_0x40823f=_0x40823f||0xcc;return function(_0x49406b){if(_0x49406b){return _0x2a03e7[_0x1cf9('0xa')](_0x40823f);}return _0x2a03e7['status'](_0x40823f)[_0x1cf9('0xb')]();};}function respondWithResult(_0x32e50f,_0x4ed431){_0x4ed431=_0x4ed431||0xc8;return function(_0x2fffd8){if(_0x2fffd8){return _0x32e50f[_0x1cf9('0xc')](_0x4ed431)[_0x1cf9('0xd')](_0x2fffd8);}};}function respondWithFilteredResult(_0x284a28,_0xb15be6){return function(_0x51fb29){if(_0x51fb29){var _0x394960=typeof _0xb15be6[_0x1cf9('0xe')]==='undefined'&&typeof _0xb15be6[_0x1cf9('0xf')]==='undefined';var _0x387b66=_0x51fb29[_0x1cf9('0x10')];var _0x487451=_0x394960?0x0:_0xb15be6[_0x1cf9('0xe')];var _0x2a645d=_0x394960?_0x51fb29[_0x1cf9('0x10')]:_0xb15be6[_0x1cf9('0xe')]+_0xb15be6[_0x1cf9('0xf')];var _0x59eef6;if(_0x2a645d>=_0x387b66){_0x2a645d=_0x387b66;_0x59eef6=0xc8;}else{_0x59eef6=0xce;}_0x284a28[_0x1cf9('0xc')](_0x59eef6);return _0x284a28[_0x1cf9('0x11')](_0x1cf9('0x12'),_0x487451+'-'+_0x2a645d+'/'+_0x387b66)[_0x1cf9('0xd')](_0x51fb29);}return null;};}function saveUpdates(_0x56697f){return function(_0x550648){if(_0x550648){return _0x550648['update'](_0x56697f)[_0x1cf9('0x13')](function(_0x769d8a){return _0x769d8a;});}return null;};}function removeEntity(_0x5aeeac){return function(_0x47046b){if(_0x47046b){return _0x47046b[_0x1cf9('0x14')]()['then'](function(){var _0x482c02=_0x47046b[_0x1cf9('0x15')]({'plain':!![]});var _0x3576ff='WhatsappQueues';return db[_0x1cf9('0x16')][_0x1cf9('0x14')]({'where':{'type':_0x3576ff,'resourceId':_0x482c02['id']}})['then'](function(){return _0x47046b;});})[_0x1cf9('0x13')](function(){_0x5aeeac['status'](0xcc)[_0x1cf9('0xb')]();});}};}function handleEntityNotFound(_0x1c4f4e){return function(_0x292267){if(!_0x292267){_0x1c4f4e['sendStatus'](0x194);}return _0x292267;};}function handleError(_0x169dbf,_0x5b7a10){_0x5b7a10=_0x5b7a10||0x1f4;return function(_0x385026){logger['error'](_0x385026[_0x1cf9('0x17')]);if(_0x385026[_0x1cf9('0x18')]){delete _0x385026[_0x1cf9('0x18')];}_0x169dbf[_0x1cf9('0xc')](_0x5b7a10)[_0x1cf9('0x19')](_0x385026);};}exports['index']=function(_0x46749b,_0x3decad){var _0x5da6fe={};var _0x3424f3={'count':0x0,'rows':[]};var _0x2f6b13=_[_0x1cf9('0x1a')](db[_0x1cf9('0x1b')][_0x1cf9('0x1c')],function(_0x436fe4){return{'name':_0x436fe4[_0x1cf9('0x1d')],'type':_0x436fe4[_0x1cf9('0x1e')]['key']};});_0x5da6fe=qs[_0x1cf9('0x1f')](_0x2f6b13,_0x46749b);var _0x301f44={'where':_0x5da6fe[_0x1cf9('0x20')]};return db[_0x1cf9('0x1b')][_0x1cf9('0x10')](_0x301f44)[_0x1cf9('0x13')](function(_0x398e21){_0x3424f3[_0x1cf9('0x10')]=_0x398e21;_0x5da6fe['include']=qs[_0x1cf9('0x21')](_0x46749b[_0x1cf9('0x22')]);return db[_0x1cf9('0x1b')]['findAll'](_0x5da6fe);})[_0x1cf9('0x13')](function(_0x484ed9){_0x3424f3[_0x1cf9('0x23')]=_0x484ed9;return _0x3424f3;})[_0x1cf9('0x13')](respondWithFilteredResult(_0x3decad,_0x5da6fe))[_0x1cf9('0x24')](handleError(_0x3decad,null));};exports[_0x1cf9('0x25')]=function(_0x1a505e,_0x4d7266){var _0x4c003d={'raw':!![],'where':{'id':_0x1a505e[_0x1cf9('0x26')]['id']}},_0x4dc187={};_0x4dc187['model']=_['keys'](db[_0x1cf9('0x1b')][_0x1cf9('0x1c')]);_0x4dc187[_0x1cf9('0x22')]=_[_0x1cf9('0x27')](_0x1a505e[_0x1cf9('0x22')]);_0x4dc187['filters']=_[_0x1cf9('0x28')](_0x4dc187[_0x1cf9('0x29')],_0x4dc187[_0x1cf9('0x22')]);_0x4c003d[_0x1cf9('0x2a')]=_[_0x1cf9('0x28')](_0x4dc187[_0x1cf9('0x29')],qs[_0x1cf9('0x2b')](_0x1a505e[_0x1cf9('0x22')][_0x1cf9('0x2b')]));_0x4c003d[_0x1cf9('0x2a')]=_0x4c003d[_0x1cf9('0x2a')][_0x1cf9('0x2c')]?_0x4c003d[_0x1cf9('0x2a')]:_0x4dc187[_0x1cf9('0x29')];if(_0x1a505e[_0x1cf9('0x22')][_0x1cf9('0x2d')]){_0x4c003d[_0x1cf9('0x21')]=[{'all':!![]}];}_0x4c003d=_[_0x1cf9('0x2e')]({},_0x4c003d,_0x1a505e[_0x1cf9('0x2f')]);return db[_0x1cf9('0x1b')][_0x1cf9('0x30')](_0x4c003d)['then'](handleEntityNotFound(_0x4d7266,null))['then'](respondWithResult(_0x4d7266,null))[_0x1cf9('0x24')](handleError(_0x4d7266,null));};exports['create']=function(_0x3c599f,_0x436e84){return db['WhatsappQueue'][_0x1cf9('0x31')](_0x3c599f['body'],{})[_0x1cf9('0x13')](function(_0x3e66d1){var _0x554666=_0x3c599f[_0x1cf9('0x32')]['get']({'plain':!![]});if(!_0x554666)throw new Error(_0x1cf9('0x33'));if(_0x554666[_0x1cf9('0x34')]===_0x1cf9('0x32')){var _0xdfbd25=_0x3e66d1[_0x1cf9('0x15')]({'plain':!![]});var _0x681112=_0x1cf9('0x35');return db[_0x1cf9('0x36')][_0x1cf9('0x30')]({'where':{'name':_0x681112,'userProfileId':_0x554666[_0x1cf9('0x37')]},'raw':!![]})[_0x1cf9('0x13')](function(_0x29825d){if(_0x29825d&&_0x29825d['autoAssociation']===0x0){return db[_0x1cf9('0x16')][_0x1cf9('0x31')]({'name':_0xdfbd25['name'],'resourceId':_0xdfbd25['id'],'type':_0x29825d[_0x1cf9('0x18')],'sectionId':_0x29825d['id']},{})[_0x1cf9('0x13')](function(){return _0x3e66d1;});}else{return _0x3e66d1;}})[_0x1cf9('0x24')](function(_0x14bb5c){logger[_0x1cf9('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14bb5c);throw _0x14bb5c;});}return _0x3e66d1;})[_0x1cf9('0x13')](respondWithResult(_0x436e84,0xc9))[_0x1cf9('0x24')](handleError(_0x436e84,null));};exports['update']=function(_0x1d217a,_0x210c8c){if(_0x1d217a[_0x1cf9('0x39')]['id']){delete _0x1d217a[_0x1cf9('0x39')]['id'];}return db[_0x1cf9('0x1b')][_0x1cf9('0x30')]({'where':{'id':_0x1d217a[_0x1cf9('0x26')]['id']}})[_0x1cf9('0x13')](handleEntityNotFound(_0x210c8c,null))[_0x1cf9('0x13')](saveUpdates(_0x1d217a[_0x1cf9('0x39')],null))[_0x1cf9('0x13')](respondWithResult(_0x210c8c,null))['catch'](handleError(_0x210c8c,null));};exports[_0x1cf9('0x14')]=function(_0x2da9cb,_0x4c2dbe){return db[_0x1cf9('0x1b')][_0x1cf9('0x30')]({'where':{'id':_0x2da9cb['params']['id']}})[_0x1cf9('0x13')](handleEntityNotFound(_0x4c2dbe,null))['then'](removeEntity(_0x4c2dbe,null))[_0x1cf9('0x24')](handleError(_0x4c2dbe,null));};exports[_0x1cf9('0x3a')]=function(_0x4397dc,_0x181337){return db[_0x1cf9('0x1b')][_0x1cf9('0x3a')]()[_0x1cf9('0x13')](respondWithResult(_0x181337,null))[_0x1cf9('0x24')](handleError(_0x181337,null));};exports[_0x1cf9('0x3b')]=function(_0x55bc61,_0x31ea10){var _0x33c37e={'raw':!![],'where':{}},_0x139eb6={},_0x2b0193;return db[_0x1cf9('0x1b')][_0x1cf9('0x3c')]({'where':{'id':_0x55bc61['params']['id']}})[_0x1cf9('0x13')](handleEntityNotFound(_0x31ea10,null))[_0x1cf9('0x13')](function(_0x57fda0){if(_0x57fda0){_0x2b0193=_0x57fda0[_0x1cf9('0x15')]({'plain':!![]});_0x139eb6[_0x1cf9('0x29')]=_[_0x1cf9('0x27')](db['UserWhatsappQueue'][_0x1cf9('0x1c')]);_0x139eb6['query']=_['keys'](_0x55bc61[_0x1cf9('0x22')]);_0x139eb6[_0x1cf9('0x3d')]=_[_0x1cf9('0x28')](_0x139eb6[_0x1cf9('0x29')],_0x139eb6['query']);_0x33c37e[_0x1cf9('0x2a')]=_[_0x1cf9('0x28')](_0x139eb6[_0x1cf9('0x29')],qs[_0x1cf9('0x2b')](_0x55bc61[_0x1cf9('0x22')][_0x1cf9('0x2b')]));_0x33c37e[_0x1cf9('0x2a')]=_0x33c37e['attributes'][_0x1cf9('0x2c')]?_0x33c37e['attributes']:_0x139eb6[_0x1cf9('0x29')];if(!_0x55bc61[_0x1cf9('0x22')][_0x1cf9('0x3e')](_0x1cf9('0x3f'))){_0x33c37e[_0x1cf9('0xf')]=qs[_0x1cf9('0xf')](_0x55bc61['query']['limit']);_0x33c37e[_0x1cf9('0xe')]=qs[_0x1cf9('0xe')](_0x55bc61[_0x1cf9('0x22')]['offset']);}_0x33c37e[_0x1cf9('0x40')]=qs[_0x1cf9('0x41')](_0x55bc61[_0x1cf9('0x22')]['sort']);_0x33c37e[_0x1cf9('0x20')]=qs[_0x1cf9('0x3d')](_[_0x1cf9('0x42')](_0x55bc61[_0x1cf9('0x22')],_0x139eb6[_0x1cf9('0x3d')]));_0x33c37e['where']['WhatsappQueueId']=_0x57fda0['id'];if(_0x55bc61[_0x1cf9('0x22')][_0x1cf9('0x43')]){_0x33c37e[_0x1cf9('0x20')]=_[_0x1cf9('0x2e')](_0x33c37e[_0x1cf9('0x20')],{'$or':_['map'](_0x33c37e['attributes'],function(_0x26596c){var _0x467915={};_0x467915[_0x26596c]={'$like':'%'+_0x55bc61[_0x1cf9('0x22')][_0x1cf9('0x43')]+'%'};return _0x467915;})});}_0x33c37e=_[_0x1cf9('0x2e')]({},_0x33c37e,_0x55bc61['options']);return db[_0x1cf9('0x44')][_0x1cf9('0x45')](_0x33c37e);}})[_0x1cf9('0x13')](function(_0x2a4fb3){if(_0x2a4fb3){return db[_0x1cf9('0x46')][_0x1cf9('0x47')]({'where':{'id':_[_0x1cf9('0x1a')](_0x2a4fb3,_0x1cf9('0x48')),'role':_0x1cf9('0x49')},'attributes':['id',_0x1cf9('0x18'),_0x1cf9('0x4a'),_0x1cf9('0x4b'),'createdAt']});}})[_0x1cf9('0x13')](function(_0x2199c3){if(_0x2199c3){return{'count':_0x2199c3[_0x1cf9('0x10')],'rows':_[_0x1cf9('0x1a')](_0x2199c3[_0x1cf9('0x23')],function(_0x54b61a){return{'membername':_0x54b61a[_0x1cf9('0x18')],'UserId':_0x54b61a['id'],'queue_name':_0x2b0193['name'],'WhatsappQueueId':_0x2b0193['id'],'interface':util[_0x1cf9('0x4c')](_0x1cf9('0x4d'),_0x1cf9('0x4e'),_0x54b61a[_0x1cf9('0x18')]),'penalty':0x0,'paused':_0x54b61a[_0x1cf9('0x4a')],'createdAt':_0x54b61a[_0x1cf9('0x4f')],'updatedAt':_0x54b61a[_0x1cf9('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1cf9('0x13')](respondWithFilteredResult(_0x31ea10,_0x33c37e))[_0x1cf9('0x24')](handleError(_0x31ea10,null));};exports['getTeams']=function(_0x186dcf,_0x53a362){var _0x1ddc64={};var _0x41bdf5={};var _0x1bcd6b;var _0x3febe0;return db[_0x1cf9('0x1b')]['findOne']({'where':{'id':_0x186dcf[_0x1cf9('0x26')]['id']}})[_0x1cf9('0x13')](handleEntityNotFound(_0x53a362,null))[_0x1cf9('0x13')](function(_0xbed44d){if(_0xbed44d){_0x1bcd6b=_0xbed44d;_0x41bdf5[_0x1cf9('0x29')]=_[_0x1cf9('0x27')](db[_0x1cf9('0x50')][_0x1cf9('0x1c')]);_0x41bdf5[_0x1cf9('0x22')]=_[_0x1cf9('0x27')](_0x186dcf[_0x1cf9('0x22')]);_0x41bdf5[_0x1cf9('0x3d')]=_[_0x1cf9('0x28')](_0x41bdf5['model'],_0x41bdf5['query']);_0x1ddc64['attributes']=_[_0x1cf9('0x28')](_0x41bdf5[_0x1cf9('0x29')],qs[_0x1cf9('0x2b')](_0x186dcf[_0x1cf9('0x22')][_0x1cf9('0x2b')]));_0x1ddc64[_0x1cf9('0x2a')]=_0x1ddc64[_0x1cf9('0x2a')][_0x1cf9('0x2c')]?_0x1ddc64[_0x1cf9('0x2a')]:_0x41bdf5['model'];_0x1ddc64[_0x1cf9('0x40')]=qs[_0x1cf9('0x41')](_0x186dcf[_0x1cf9('0x22')][_0x1cf9('0x41')]);_0x1ddc64['where']=qs[_0x1cf9('0x3d')](_[_0x1cf9('0x42')](_0x186dcf[_0x1cf9('0x22')],_0x41bdf5[_0x1cf9('0x3d')]));if(_0x186dcf[_0x1cf9('0x22')]['filter']){_0x1ddc64[_0x1cf9('0x20')]=_[_0x1cf9('0x2e')](_0x1ddc64['where'],{'$or':_[_0x1cf9('0x1a')](_0x1ddc64[_0x1cf9('0x2a')],function(_0x3424e0){var _0x96e024={};_0x96e024[_0x3424e0]={'$like':'%'+_0x186dcf[_0x1cf9('0x22')][_0x1cf9('0x43')]+'%'};return _0x96e024;})});}_0x1ddc64=_[_0x1cf9('0x2e')]({},_0x1ddc64,_0x186dcf['options']);return _0x1bcd6b[_0x1cf9('0x51')](_0x1ddc64);}})[_0x1cf9('0x13')](function(_0x5a46ee){if(_0x5a46ee){_0x3febe0=_0x5a46ee['length'];if(!_0x186dcf[_0x1cf9('0x22')][_0x1cf9('0x3e')]('nolimit')){_0x1ddc64['limit']=qs[_0x1cf9('0xf')](_0x186dcf[_0x1cf9('0x22')][_0x1cf9('0xf')]);_0x1ddc64[_0x1cf9('0xe')]=qs['offset'](_0x186dcf[_0x1cf9('0x22')][_0x1cf9('0xe')]);}return _0x1bcd6b[_0x1cf9('0x51')](_0x1ddc64);}})[_0x1cf9('0x13')](function(_0x45ee3f){if(_0x45ee3f){return _0x45ee3f?{'count':_0x3febe0,'rows':_0x45ee3f}:null;}})[_0x1cf9('0x13')](respondWithResult(_0x53a362,null))[_0x1cf9('0x24')](handleError(_0x53a362,null));};exports['addTeams']=function(_0x38789b,_0x4e75a9){var _0x5d1b14=_0x38789b[_0x1cf9('0x39')][_0x1cf9('0x52')];return db[_0x1cf9('0x50')][_0x1cf9('0x45')]({'where':{'id':_0x5d1b14},'attributes':['id'],'include':[{'model':db[_0x1cf9('0x46')],'as':_0x1cf9('0x53'),'attributes':['id','name',_0x1cf9('0x54'),_0x1cf9('0x55'),_0x1cf9('0x56')],'raw':!![]}]})['then'](function(_0x30a295){if(_0x30a295){var _0x1a30ca=_[_0x1cf9('0x57')](_0x30a295,function(_0x55d3bc){var _0x39fd05=_0x55d3bc[_0x1cf9('0x15')]({'plain':!![]});return _0x39fd05['Agents'];});return db[_0x1cf9('0x1b')]['find']({'where':{'id':_0x38789b[_0x1cf9('0x26')]['id']}})[_0x1cf9('0x13')](function(_0x50169a){return db['sequelize'][_0x1cf9('0x58')](function(_0x3bc6c4){return _0x50169a[_0x1cf9('0x59')](_0x5d1b14,{'transaction':_0x3bc6c4})[_0x1cf9('0x13')](function(){return BPromise[_0x1cf9('0x5a')](_0x1a30ca,function(_0x183788){return db[_0x1cf9('0x44')]['findOrCreate']({'where':{'UserId':_0x183788['id'],'WhatsappQueueId':_0x38789b['params']['id']},'transaction':_0x3bc6c4});});})[_0x1cf9('0x13')](function(){_0x1a30ca[_0x1cf9('0x5b')](function(_0xe4e47a){socket[_0x1cf9('0x5c')](_0x1cf9('0x5d'),{'UserId':_0xe4e47a['id'],'WhatsappQueueId':_0x50169a['id']});});});});});}})[_0x1cf9('0x13')](respondWithStatusCode(_0x4e75a9,null))[_0x1cf9('0x24')](handleError(_0x4e75a9,null));};exports[_0x1cf9('0x5e')]=function(_0x4f9590,_0x43f414){return db['Team'][_0x1cf9('0x45')]({'where':{'id':_0x4f9590[_0x1cf9('0x22')][_0x1cf9('0x52')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1cf9('0x13')](handleEntityNotFound(_0x43f414,null))['then'](function(_0x33f799){var _0x3e62d5=_[_0x1cf9('0x1a')](_0x33f799,'id');var _0x32ace0=[];var _0x6cc2=[];var _0x309dca=squel[_0x1cf9('0x5f')]();_0x309dca[_0x1cf9('0x60')](_0x1cf9('0x61'))[_0x1cf9('0x62')](_0x1cf9('0x63'),'tq')[_0x1cf9('0x64')](_0x1cf9('0x65'),'ut',_0x1cf9('0x66'))[_0x1cf9('0x20')]('WhatsappQueueId\x20=\x20?',_0x4f9590['params']['id']);for(var _0xe5a60=0x0;_0xe5a60<_0x33f799[_0x1cf9('0x2c')];_0xe5a60+=0x1){let _0x2e7547=_0x33f799[_0xe5a60];for(var _0x5eb722=0x0;_0x5eb722<_0x2e7547[_0x1cf9('0x53')]['length'];_0x5eb722+=0x1){let _0x36761b=_0x2e7547[_0x1cf9('0x53')][_0x5eb722];var _0x4ab658=_0x309dca[_0x1cf9('0x67')]();_0x4ab658[_0x1cf9('0x20')](_0x1cf9('0x68'),_0x36761b['id']);_0x6cc2[_0x1cf9('0x69')](db[_0x1cf9('0x6a')]['query'](_0x4ab658['toString'](),{'type':db[_0x1cf9('0x6a')][_0x1cf9('0x6b')][_0x1cf9('0x6c')]})[_0x1cf9('0x13')](function(_0x188ae3){if(_0x188ae3[_0x1cf9('0x2c')]===0x1){return _0x36761b['id'];}else{var _0x3d2a92=_[_0x1cf9('0x6d')](_[_0x1cf9('0x1a')](_0x188ae3,_0x1cf9('0x6e')),function(_0x32e9bb){return _[_0x1cf9('0x6f')](_0x3e62d5,_0x32e9bb);});if(_0x3d2a92){return _0x36761b['id'];}}}));}}return BPromise['all'](_0x6cc2)[_0x1cf9('0x13')](function(_0x56068f){_0x32ace0=_(_0x32ace0)[_0x1cf9('0x70')](_0x56068f)[_0x1cf9('0x71')]()[_0x1cf9('0x72')]();return db['WhatsappQueue'][_0x1cf9('0x30')]({'where':{'id':_0x4f9590[_0x1cf9('0x26')]['id']}})['then'](function(_0x4d7bdd){return db[_0x1cf9('0x6a')][_0x1cf9('0x58')](function(_0x2108a8){return _0x4d7bdd[_0x1cf9('0x5e')](_0x4f9590[_0x1cf9('0x22')][_0x1cf9('0x52')],{'transaction':_0x2108a8})[_0x1cf9('0x13')](function(){if(!_[_0x1cf9('0x73')](_0x32ace0)){return _0x4d7bdd[_0x1cf9('0x74')](_0x32ace0,{'transaction':_0x2108a8});}})[_0x1cf9('0x13')](function(){_0x32ace0[_0x1cf9('0x5b')](function(_0x201e22){socket['emit'](_0x1cf9('0x75'),{'UserId':_0x201e22,'WhatsappQueueId':_0x4d7bdd['id']});});});});});});})['then'](respondWithStatusCode(_0x43f414,null))[_0x1cf9('0x24')](handleError(_0x43f414,null));};exports['addAgents']=function(_0x1b8f3f,_0x579b6c){return db['WhatsappQueue'][_0x1cf9('0x30')]({'where':{'id':_0x1b8f3f[_0x1cf9('0x26')]['id']}})[_0x1cf9('0x13')](handleEntityNotFound(_0x579b6c,null))[_0x1cf9('0x13')](function(_0x49171a){if(_0x49171a){return _0x49171a['addAgents'](_0x1b8f3f[_0x1cf9('0x39')][_0x1cf9('0x52')],_[_0x1cf9('0x76')](_0x1b8f3f[_0x1cf9('0x39')],[_0x1cf9('0x52'),'id'])||{})['spread'](function(_0x57233d){for(var _0x4e5a84=0x0;_0x4e5a84<_0x1b8f3f[_0x1cf9('0x39')][_0x1cf9('0x52')][_0x1cf9('0x2c')];_0x4e5a84+=0x1){socket[_0x1cf9('0x5c')]('userWhatsappQueue:save',{'UserId':Number(_0x1b8f3f[_0x1cf9('0x39')]['ids'][_0x4e5a84]),'WhatsappQueueId':Number(_0x1b8f3f[_0x1cf9('0x26')]['id'])});}return _0x57233d;});}})['then'](respondWithResult(_0x579b6c,null))[_0x1cf9('0x24')](handleError(_0x579b6c,null));};exports[_0x1cf9('0x74')]=function(_0x11ec19,_0x3635be){return db[_0x1cf9('0x1b')][_0x1cf9('0x30')]({'where':{'id':_0x11ec19['params']['id']}})['then'](handleEntityNotFound(_0x3635be,null))['then'](function(_0x534a6a){if(_0x534a6a){return _0x534a6a[_0x1cf9('0x74')](_0x11ec19[_0x1cf9('0x22')][_0x1cf9('0x52')])['then'](function(){if(_['isArray'](_0x11ec19[_0x1cf9('0x22')][_0x1cf9('0x52')])){for(var _0x52ed9b=0x0;_0x52ed9b<_0x11ec19['query'][_0x1cf9('0x52')]['length'];_0x52ed9b+=0x1){socket[_0x1cf9('0x5c')](_0x1cf9('0x75'),{'UserId':Number(_0x11ec19[_0x1cf9('0x22')][_0x1cf9('0x52')][_0x52ed9b]),'WhatsappQueueId':Number(_0x11ec19[_0x1cf9('0x26')]['id'])});}}else{socket[_0x1cf9('0x5c')](_0x1cf9('0x75'),{'UserId':Number(_0x11ec19[_0x1cf9('0x22')]['ids']),'WhatsappQueueId':Number(_0x11ec19[_0x1cf9('0x26')]['id'])});}});}})[_0x1cf9('0x13')](respondWithStatusCode(_0x3635be,null))[_0x1cf9('0x24')](handleError(_0x3635be,null));};exports[_0x1cf9('0x77')]=function(_0x3ae86b,_0x588209){var _0x2eb258={};var _0x2bf778={};var _0x4a2b4d;var _0x40379d;return db['WhatsappQueue'][_0x1cf9('0x3c')]({'where':{'id':_0x3ae86b[_0x1cf9('0x26')]['id']}})[_0x1cf9('0x13')](handleEntityNotFound(_0x588209,null))[_0x1cf9('0x13')](function(_0x276bdd){if(_0x276bdd){_0x4a2b4d=_0x276bdd;_0x2bf778[_0x1cf9('0x29')]=_[_0x1cf9('0x27')](db['User'][_0x1cf9('0x1c')]);_0x2bf778[_0x1cf9('0x22')]=_['keys'](_0x3ae86b[_0x1cf9('0x22')]);_0x2bf778[_0x1cf9('0x3d')]=_['intersection'](_0x2bf778[_0x1cf9('0x29')],_0x2bf778[_0x1cf9('0x22')]);_0x2eb258[_0x1cf9('0x2a')]=_[_0x1cf9('0x28')](_0x2bf778[_0x1cf9('0x29')],qs[_0x1cf9('0x2b')](_0x3ae86b['query'][_0x1cf9('0x2b')]));_0x2eb258[_0x1cf9('0x2a')]=_0x2eb258[_0x1cf9('0x2a')]['length']?_0x2eb258['attributes']:_0x2bf778[_0x1cf9('0x29')];_0x2eb258[_0x1cf9('0x40')]=qs[_0x1cf9('0x41')](_0x3ae86b[_0x1cf9('0x22')][_0x1cf9('0x41')]);_0x2eb258[_0x1cf9('0x20')]=qs[_0x1cf9('0x3d')](_[_0x1cf9('0x42')](_0x3ae86b[_0x1cf9('0x22')],_0x2bf778[_0x1cf9('0x3d')]));if(_0x3ae86b['query'][_0x1cf9('0x43')]){_0x2eb258[_0x1cf9('0x20')]=_['merge'](_0x2eb258['where'],{'$or':_[_0x1cf9('0x1a')](_0x2eb258[_0x1cf9('0x2a')],function(_0x2ae855){var _0x19c52d={};_0x19c52d[_0x2ae855]={'$like':'%'+_0x3ae86b[_0x1cf9('0x22')]['filter']+'%'};return _0x19c52d;})});}_0x2eb258=_[_0x1cf9('0x2e')]({},_0x2eb258,_0x3ae86b[_0x1cf9('0x2f')]);return _0x4a2b4d[_0x1cf9('0x77')](_0x2eb258);}})[_0x1cf9('0x13')](function(_0x5ed7bb){if(_0x5ed7bb){_0x40379d=_0x5ed7bb[_0x1cf9('0x2c')];if(!_0x3ae86b[_0x1cf9('0x22')][_0x1cf9('0x3e')](_0x1cf9('0x3f'))){_0x2eb258['limit']=qs[_0x1cf9('0xf')](_0x3ae86b['query'][_0x1cf9('0xf')]);_0x2eb258[_0x1cf9('0xe')]=qs['offset'](_0x3ae86b[_0x1cf9('0x22')][_0x1cf9('0xe')]);}return _0x4a2b4d[_0x1cf9('0x77')](_0x2eb258);}})[_0x1cf9('0x13')](function(_0x219e00){if(_0x219e00){return _0x219e00?{'count':_0x40379d,'rows':_0x219e00}:null;}})[_0x1cf9('0x13')](respondWithResult(_0x588209,null))['catch'](handleError(_0x588209,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a9661ca..9a80989 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 _0xb0c4=['setMaxListeners','update','remove','emit','hook','exports','events','WhatsappQueue'];(function(_0x19109f,_0x472d8a){var _0x36cb4c=function(_0x313791){while(--_0x313791){_0x19109f['push'](_0x19109f['shift']());}};_0x36cb4c(++_0x472d8a);}(_0xb0c4,0x10e));var _0x4b0c=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xb0c4[_0x2cfb58];return _0xd99951;};'use strict';var EventEmitter=require(_0x4b0c('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x4b0c('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4b0c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b0c('0x3'),'afterDestroy':_0x4b0c('0x4')};function emitEvent(_0x15afaf){return function(_0x201308,_0x286ef6,_0x57bb8d){WhatsappQueueEvents['emit'](_0x15afaf+':'+_0x201308['id'],_0x201308);WhatsappQueueEvents[_0x4b0c('0x5')](_0x15afaf,_0x201308);_0x57bb8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x4b0c('0x6')](e,emitEvent(event));}}module[_0x4b0c('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x15a5=['events','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0xd03fe0,_0x4b55d3){var _0x554ed3=function(_0x2926b5){while(--_0x2926b5){_0xd03fe0['push'](_0xd03fe0['shift']());}};_0x554ed3(++_0x4b55d3);}(_0x15a5,0x1c0));var _0x515a=function(_0x50470f,_0x270a2a){_0x50470f=_0x50470f-0x0;var _0x3ab771=_0x15a5[_0x50470f];return _0x3ab771;};'use strict';var EventEmitter=require(_0x515a('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x515a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x515a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1c50fd){return function(_0x204bd9,_0x4c8141,_0x23933d){WhatsappQueueEvents['emit'](_0x1c50fd+':'+_0x204bd9['id'],_0x204bd9);WhatsappQueueEvents[_0x515a('0x3')](_0x1c50fd,_0x204bd9);_0x23933d(null);};}for(var e in events){if(events[_0x515a('0x4')](e)){var event=events[e];WhatsappQueue[_0x515a('0x5')](e,emitEvent(event));}}module[_0x515a('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 2e7aaea..5e41e78 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 _0xd841=['WhatsappQueue','whatsapp_queues','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x563f95,_0x1421c2){var _0x267eae=function(_0x42baf5){while(--_0x42baf5){_0x563f95['push'](_0x563f95['shift']());}};_0x267eae(++_0x1421c2);}(_0xd841,0x112));var _0x1d84=function(_0x2a67ac,_0x52f069){_0x2a67ac=_0x2a67ac-0x0;var _0xb86849=_0xd841[_0x2a67ac];return _0xb86849;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1d84('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1d84('0x1'));var fs=require('fs');var path=require(_0x1d84('0x2'));var rimraf=require(_0x1d84('0x3'));var config=require(_0x1d84('0x4'));var attributes=require('./whatsappQueue.attributes');module[_0x1d84('0x5')]=function(_0x96584b,_0x585d66){return _0x96584b['define'](_0x1d84('0x6'),attributes,{'tableName':_0x1d84('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6482=['whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6482,0x71));var _0x2648=function(_0x37dbb4,_0xc6ead9){_0x37dbb4=_0x37dbb4-0x0;var _0x34dcf3=_0x6482[_0x37dbb4];return _0x34dcf3;};'use strict';var _=require(_0x2648('0x0'));var util=require(_0x2648('0x1'));var logger=require('../../config/logger')(_0x2648('0x2'));var moment=require(_0x2648('0x3'));var BPromise=require(_0x2648('0x4'));var rp=require(_0x2648('0x5'));var fs=require('fs');var path=require(_0x2648('0x6'));var rimraf=require(_0x2648('0x7'));var config=require(_0x2648('0x8'));var attributes=require(_0x2648('0x9'));module[_0x2648('0xa')]=function(_0x49bcfa,_0x512c11){return _0x49bcfa[_0x2648('0xb')](_0x2648('0xc'),attributes,{'tableName':_0x2648('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index a8cfebc..c4ec98d 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 _0x6d54=['catch','ShowWhatsappQueue','find','raw','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','GetWhatsappQueue','WhatsappQueue','findAll','options','where','limit','include','map','model','attributes','info','stringify'];(function(_0x442151,_0xcbbf6b){var _0x180cf8=function(_0xd52bbf){while(--_0xd52bbf){_0x442151['push'](_0x442151['shift']());}};_0x180cf8(++_0xcbbf6b);}(_0x6d54,0x181));var _0x46d5=function(_0x421443,_0x3eea1e){_0x421443=_0x421443-0x0;var _0x190320=_0x6d54[_0x421443];return _0x190320;};'use strict';var _=require(_0x46d5('0x0'));var util=require('util');var moment=require(_0x46d5('0x1'));var BPromise=require(_0x46d5('0x2'));var rs=require(_0x46d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46d5('0x5'))(_0x46d5('0x6'));var config=require(_0x46d5('0x7'));var jayson=require(_0x46d5('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x46d5('0x9')]=_[_0x46d5('0xa')](config[_0x46d5('0x9')],{'host':_0x46d5('0xb'),'port':0x18eb});var socket=require(_0x46d5('0xc'))(new Redis(config['redis']));require(_0x46d5('0xd'))[_0x46d5('0xe')](socket);function respondWithRpcPromise(_0x17a74d,_0x4eb886,_0x280c25){return new BPromise(function(_0xfc38be,_0x177327){return client[_0x46d5('0xf')](_0x17a74d,_0x280c25)['then'](function(_0x490c78){logger['info'](_0x46d5('0x10'),_0x4eb886,_0x46d5('0x11'));logger[_0x46d5('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4eb886,_0x46d5('0x11'),JSON['stringify'](_0x490c78));if(_0x490c78[_0x46d5('0x13')]){if(_0x490c78[_0x46d5('0x13')]['code']===0x1f4){logger[_0x46d5('0x13')](_0x46d5('0x10'),_0x4eb886,_0x490c78[_0x46d5('0x13')][_0x46d5('0x14')]);return _0x177327(_0x490c78['error'][_0x46d5('0x14')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x4eb886,_0x490c78[_0x46d5('0x13')][_0x46d5('0x14')]);return _0xfc38be(_0x490c78[_0x46d5('0x13')][_0x46d5('0x14')]);}else{logger['info'](_0x46d5('0x10'),_0x4eb886,'request\x20sent');_0xfc38be(_0x490c78['result'][_0x46d5('0x14')]);}})['catch'](function(_0x367f6c){logger[_0x46d5('0x13')](_0x46d5('0x10'),_0x4eb886,_0x367f6c);_0x177327(_0x367f6c);});});}exports[_0x46d5('0x15')]=function(_0x1493d5){var _0x2d3507=this;return new Promise(function(_0x3e4b93,_0x1e7e19){return db[_0x46d5('0x16')][_0x46d5('0x17')]({'raw':_0x1493d5[_0x46d5('0x18')]?_0x1493d5[_0x46d5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1493d5[_0x46d5('0x18')]?_0x1493d5['options'][_0x46d5('0x19')]||null:null,'attributes':_0x1493d5[_0x46d5('0x18')]?_0x1493d5[_0x46d5('0x18')]['attributes']||null:null,'limit':_0x1493d5[_0x46d5('0x18')]?_0x1493d5[_0x46d5('0x18')][_0x46d5('0x1a')]||null:null,'include':_0x1493d5[_0x46d5('0x18')]?_0x1493d5[_0x46d5('0x18')][_0x46d5('0x1b')]?_[_0x46d5('0x1c')](_0x1493d5[_0x46d5('0x18')][_0x46d5('0x1b')],function(_0x22bddf){return{'model':db[_0x22bddf[_0x46d5('0x1d')]],'as':_0x22bddf['as'],'attributes':_0x22bddf[_0x46d5('0x1e')],'include':_0x22bddf['include']?_[_0x46d5('0x1c')](_0x22bddf[_0x46d5('0x1b')],function(_0x514344){return{'model':db[_0x514344['model']],'as':_0x514344['as'],'attributes':_0x514344['attributes'],'include':_0x514344['include']?_[_0x46d5('0x1c')](_0x514344['include'],function(_0x214460){return{'model':db[_0x214460[_0x46d5('0x1d')]],'as':_0x214460['as'],'attributes':_0x214460[_0x46d5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcfa75e){logger[_0x46d5('0x1f')]('GetWhatsappQueue',_0x1493d5);logger[_0x46d5('0x12')](_0x46d5('0x15'),_0x1493d5,JSON[_0x46d5('0x20')](_0xcfa75e));_0x3e4b93(_0xcfa75e);})[_0x46d5('0x21')](function(_0x37fb80){logger['error'](_0x46d5('0x15'),_0x37fb80[_0x46d5('0x14')],_0x1493d5);_0x1e7e19(_0x2d3507[_0x46d5('0x13')](0x1f4,_0x37fb80[_0x46d5('0x14')]));});});};exports[_0x46d5('0x22')]=function(_0x30d395){var _0x3c557b=this;return new Promise(function(_0x14ac89,_0x12fd64){return db[_0x46d5('0x16')][_0x46d5('0x23')]({'raw':_0x30d395['options']?_0x30d395[_0x46d5('0x18')][_0x46d5('0x24')]===undefined?!![]:![]:!![],'where':_0x30d395[_0x46d5('0x18')]?_0x30d395[_0x46d5('0x18')][_0x46d5('0x19')]||null:null,'attributes':_0x30d395[_0x46d5('0x18')]?_0x30d395[_0x46d5('0x18')]['attributes']||null:null,'include':_0x30d395['options']?_0x30d395[_0x46d5('0x18')][_0x46d5('0x1b')]?_[_0x46d5('0x1c')](_0x30d395[_0x46d5('0x18')]['include'],function(_0x4b8278){return{'model':db[_0x4b8278[_0x46d5('0x1d')]],'as':_0x4b8278['as'],'attributes':_0x4b8278['attributes'],'include':_0x4b8278[_0x46d5('0x1b')]?_['map'](_0x4b8278['include'],function(_0x3d8bbd){return{'model':db[_0x3d8bbd[_0x46d5('0x1d')]],'as':_0x3d8bbd['as'],'attributes':_0x3d8bbd[_0x46d5('0x1e')],'include':_0x3d8bbd[_0x46d5('0x1b')]?_[_0x46d5('0x1c')](_0x3d8bbd[_0x46d5('0x1b')],function(_0x5d357b){return{'model':db[_0x5d357b[_0x46d5('0x1d')]],'as':_0x5d357b['as'],'attributes':_0x5d357b[_0x46d5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x46d5('0x25')](function(_0x4df730){logger['info'](_0x46d5('0x22'),_0x30d395);logger[_0x46d5('0x12')]('ShowWhatsappQueue',_0x30d395,JSON[_0x46d5('0x20')](_0x4df730));_0x14ac89(_0x4df730);})[_0x46d5('0x21')](function(_0x2e5a46){logger[_0x46d5('0x13')]('ShowWhatsappQueue',_0x2e5a46[_0x46d5('0x14')],_0x30d395);_0x12fd64(_0x3c557b[_0x46d5('0x13')](0x1f4,_0x2e5a46['message']));});});}; \ No newline at end of file +var _0x793f=['WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','debug','stringify','find','ShowWhatsappQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5e3dd6,_0x57c85f){var _0x51a2a2=function(_0x1fbf8e){while(--_0x1fbf8e){_0x5e3dd6['push'](_0x5e3dd6['shift']());}};_0x51a2a2(++_0x57c85f);}(_0x793f,0xeb));var _0xf793=function(_0x3c00cc,_0x4b0ddb){_0x3c00cc=_0x3c00cc-0x0;var _0x45e86e=_0x793f[_0x3c00cc];return _0x45e86e;};'use strict';var _=require(_0xf793('0x0'));var util=require('util');var moment=require(_0xf793('0x1'));var BPromise=require(_0xf793('0x2'));var rs=require(_0xf793('0x3'));var fs=require('fs');var Redis=require(_0xf793('0x4'));var db=require(_0xf793('0x5'))['db'];var utils=require(_0xf793('0x6'));var logger=require(_0xf793('0x7'))(_0xf793('0x8'));var config=require(_0xf793('0x9'));var jayson=require(_0xf793('0xa'));var client=jayson[_0xf793('0xb')][_0xf793('0xc')]({'port':0x232a});config[_0xf793('0xd')]=_[_0xf793('0xe')](config[_0xf793('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf793('0xf'))(new Redis(config[_0xf793('0xd')]));require(_0xf793('0x10'))[_0xf793('0x11')](socket);function respondWithRpcPromise(_0x4286ad,_0x1c0493,_0x43824c){return new BPromise(function(_0x18b330,_0x349686){return client[_0xf793('0x12')](_0x4286ad,_0x43824c)[_0xf793('0x13')](function(_0xe76899){logger[_0xf793('0x14')](_0xf793('0x15'),_0x1c0493,_0xf793('0x16'));logger['debug'](_0xf793('0x17'),_0x1c0493,_0xf793('0x16'),JSON['stringify'](_0xe76899));if(_0xe76899['error']){if(_0xe76899[_0xf793('0x18')][_0xf793('0x19')]===0x1f4){logger[_0xf793('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x1c0493,_0xe76899[_0xf793('0x18')][_0xf793('0x1a')]);return _0x349686(_0xe76899[_0xf793('0x18')][_0xf793('0x1a')]);}logger[_0xf793('0x18')](_0xf793('0x15'),_0x1c0493,_0xe76899['error'][_0xf793('0x1a')]);return _0x18b330(_0xe76899['error'][_0xf793('0x1a')]);}else{logger['info'](_0xf793('0x15'),_0x1c0493,_0xf793('0x16'));_0x18b330(_0xe76899[_0xf793('0x1b')][_0xf793('0x1a')]);}})[_0xf793('0x1c')](function(_0x2cb107){logger[_0xf793('0x18')](_0xf793('0x15'),_0x1c0493,_0x2cb107);_0x349686(_0x2cb107);});});}exports[_0xf793('0x1d')]=function(_0x342374){var _0x59fa83=this;return new Promise(function(_0x1ad641,_0x331d74){return db[_0xf793('0x1e')]['findAll']({'raw':_0x342374[_0xf793('0x1f')]?_0x342374[_0xf793('0x1f')][_0xf793('0x20')]===undefined?!![]:![]:!![],'where':_0x342374[_0xf793('0x1f')]?_0x342374[_0xf793('0x1f')][_0xf793('0x21')]||null:null,'attributes':_0x342374[_0xf793('0x1f')]?_0x342374['options'][_0xf793('0x22')]||null:null,'limit':_0x342374[_0xf793('0x1f')]?_0x342374[_0xf793('0x1f')][_0xf793('0x23')]||null:null,'include':_0x342374[_0xf793('0x1f')]?_0x342374[_0xf793('0x1f')][_0xf793('0x24')]?_[_0xf793('0x25')](_0x342374[_0xf793('0x1f')][_0xf793('0x24')],function(_0x23ef10){return{'model':db[_0x23ef10[_0xf793('0x26')]],'as':_0x23ef10['as'],'attributes':_0x23ef10['attributes'],'include':_0x23ef10[_0xf793('0x24')]?_[_0xf793('0x25')](_0x23ef10[_0xf793('0x24')],function(_0x4e4b4a){return{'model':db[_0x4e4b4a[_0xf793('0x26')]],'as':_0x4e4b4a['as'],'attributes':_0x4e4b4a['attributes'],'include':_0x4e4b4a['include']?_[_0xf793('0x25')](_0x4e4b4a[_0xf793('0x24')],function(_0x207ee4){return{'model':db[_0x207ee4[_0xf793('0x26')]],'as':_0x207ee4['as'],'attributes':_0x207ee4[_0xf793('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x138ba4){logger['info'](_0xf793('0x1d'),_0x342374);logger[_0xf793('0x27')]('GetWhatsappQueue',_0x342374,JSON[_0xf793('0x28')](_0x138ba4));_0x1ad641(_0x138ba4);})[_0xf793('0x1c')](function(_0x3e6e44){logger['error'](_0xf793('0x1d'),_0x3e6e44[_0xf793('0x1a')],_0x342374);_0x331d74(_0x59fa83[_0xf793('0x18')](0x1f4,_0x3e6e44[_0xf793('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x2576ac){var _0x5b00d5=this;return new Promise(function(_0x2e4215,_0x5d0ab3){return db[_0xf793('0x1e')][_0xf793('0x29')]({'raw':_0x2576ac[_0xf793('0x1f')]?_0x2576ac[_0xf793('0x1f')][_0xf793('0x20')]===undefined?!![]:![]:!![],'where':_0x2576ac[_0xf793('0x1f')]?_0x2576ac['options'][_0xf793('0x21')]||null:null,'attributes':_0x2576ac['options']?_0x2576ac[_0xf793('0x1f')][_0xf793('0x22')]||null:null,'include':_0x2576ac[_0xf793('0x1f')]?_0x2576ac[_0xf793('0x1f')][_0xf793('0x24')]?_[_0xf793('0x25')](_0x2576ac[_0xf793('0x1f')][_0xf793('0x24')],function(_0x552f03){return{'model':db[_0x552f03[_0xf793('0x26')]],'as':_0x552f03['as'],'attributes':_0x552f03[_0xf793('0x22')],'include':_0x552f03[_0xf793('0x24')]?_[_0xf793('0x25')](_0x552f03[_0xf793('0x24')],function(_0x205cc0){return{'model':db[_0x205cc0[_0xf793('0x26')]],'as':_0x205cc0['as'],'attributes':_0x205cc0[_0xf793('0x22')],'include':_0x205cc0['include']?_[_0xf793('0x25')](_0x205cc0[_0xf793('0x24')],function(_0x45d9fa){return{'model':db[_0x45d9fa[_0xf793('0x26')]],'as':_0x45d9fa['as'],'attributes':_0x45d9fa['attributes']};}):[]};}):[]};}):[]:[]})[_0xf793('0x13')](function(_0x468cae){logger[_0xf793('0x14')](_0xf793('0x2a'),_0x2576ac);logger[_0xf793('0x27')]('ShowWhatsappQueue',_0x2576ac,JSON[_0xf793('0x28')](_0x468cae));_0x2e4215(_0x468cae);})['catch'](function(_0x52de12){logger['error']('ShowWhatsappQueue',_0x52de12[_0xf793('0x1a')],_0x2576ac);_0x5d0ab3(_0x5b00d5['error'](0x1f4,_0x52de12[_0xf793('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a0c6f98..d2111a9 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 _0xa2f6=['remove','update','emit','register','length','whatsappQueue:','save'];(function(_0x4546a6,_0x22f442){var _0x580a27=function(_0xdfa086){while(--_0xdfa086){_0x4546a6['push'](_0x4546a6['shift']());}};_0x580a27(++_0x22f442);}(_0xa2f6,0x180));var _0x6a2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2f6[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x6a2f('0x0'),_0x6a2f('0x1'),_0x6a2f('0x2')];function createListener(_0x167419,_0x4bfbeb){return function(_0x5359eb){_0x4bfbeb[_0x6a2f('0x3')](_0x167419,_0x5359eb);};}function removeListener(_0x316a61,_0x56b04c){return function(){WhatsappQueueEvents['removeListener'](_0x316a61,_0x56b04c);};}exports[_0x6a2f('0x4')]=function(_0x565232){for(var _0x33d9a0=0x0,_0x3ce5b7=events[_0x6a2f('0x5')];_0x33d9a0<_0x3ce5b7;_0x33d9a0++){var _0x3e3408=events[_0x33d9a0];var _0x2cd78f=createListener(_0x6a2f('0x6')+_0x3e3408,_0x565232);WhatsappQueueEvents['on'](_0x3e3408,_0x2cd78f);}}; \ No newline at end of file +var _0x3a82=['register','whatsappQueue:','./whatsappQueue.events','update','emit','removeListener'];(function(_0x162b73,_0x128905){var _0x22e1b6=function(_0x3f35ad){while(--_0x3f35ad){_0x162b73['push'](_0x162b73['shift']());}};_0x22e1b6(++_0x128905);}(_0x3a82,0x1a0));var _0x23a8=function(_0x33c0dd,_0x4a6fe9){_0x33c0dd=_0x33c0dd-0x0;var _0x428232=_0x3a82[_0x33c0dd];return _0x428232;};'use strict';var WhatsappQueueEvents=require(_0x23a8('0x0'));var events=['save','remove',_0x23a8('0x1')];function createListener(_0x481a60,_0x2df375){return function(_0x904389){_0x2df375[_0x23a8('0x2')](_0x481a60,_0x904389);};}function removeListener(_0x185d5c,_0x1d2a92){return function(){WhatsappQueueEvents[_0x23a8('0x3')](_0x185d5c,_0x1d2a92);};}exports[_0x23a8('0x4')]=function(_0x73d706){for(var _0x487f45=0x0,_0x1bf234=events['length'];_0x487f45<_0x1bf234;_0x487f45++){var _0x8c4a25=events[_0x487f45];var _0x4f65c8=createListener(_0x23a8('0x5')+_0x8c4a25,_0x73d706);WhatsappQueueEvents['on'](_0x8c4a25,_0x4f65c8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index f5ea007..bcac51b 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 _0x9c2f=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9c2f,0x1e3));var _0xf9c2=function(_0x531adc,_0x11312f){_0x531adc=_0x531adc-0x0;var _0xcb04b6=_0x9c2f[_0x531adc];return _0xcb04b6;};'use strict';var multer=require(_0xf9c2('0x0'));var util=require(_0xf9c2('0x1'));var path=require(_0xf9c2('0x2'));var timeout=require(_0xf9c2('0x3'));var express=require(_0xf9c2('0x4'));var router=express[_0xf9c2('0x5')]();var fs_extra=require(_0xf9c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf9c2('0x7'));var config=require('../../config/environment');var controller=require(_0xf9c2('0x8'));router[_0xf9c2('0x9')]('/',auth[_0xf9c2('0xa')](),controller['index']);router[_0xf9c2('0x9')](_0xf9c2('0xb'),auth['isAuthenticated'](),controller[_0xf9c2('0xc')]);router[_0xf9c2('0x9')](_0xf9c2('0xd'),auth[_0xf9c2('0xa')](),controller[_0xf9c2('0xe')]);router[_0xf9c2('0xf')]('/',auth[_0xf9c2('0xa')](),controller[_0xf9c2('0x10')]);router[_0xf9c2('0x11')](_0xf9c2('0xd'),auth[_0xf9c2('0xa')](),controller[_0xf9c2('0x12')]);router['delete'](_0xf9c2('0xd'),auth[_0xf9c2('0xa')](),controller['destroy']);module[_0xf9c2('0x13')]=router; \ No newline at end of file +var _0x33dd=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','exports'];(function(_0x3d393f,_0x523ddc){var _0xd5cc33=function(_0x4feaee){while(--_0x4feaee){_0x3d393f['push'](_0x3d393f['shift']());}};_0xd5cc33(++_0x523ddc);}(_0x33dd,0xc6));var _0xd33d=function(_0x4d7775,_0x34c15d){_0x4d7775=_0x4d7775-0x0;var _0x138029=_0x33dd[_0x4d7775];return _0x138029;};'use strict';var multer=require(_0xd33d('0x0'));var util=require(_0xd33d('0x1'));var path=require('path');var timeout=require(_0xd33d('0x2'));var express=require('express');var router=express[_0xd33d('0x3')]();var fs_extra=require(_0xd33d('0x4'));var auth=require(_0xd33d('0x5'));var interaction=require(_0xd33d('0x6'));var config=require('../../config/environment');var controller=require(_0xd33d('0x7'));router[_0xd33d('0x8')]('/',auth[_0xd33d('0x9')](),controller[_0xd33d('0xa')]);router[_0xd33d('0x8')](_0xd33d('0xb'),auth[_0xd33d('0x9')](),controller['describe']);router['get'](_0xd33d('0xc'),auth[_0xd33d('0x9')](),controller[_0xd33d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd33d('0xe')]);router[_0xd33d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd33d('0x10')](_0xd33d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd33d('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 36283e5..fd128d8 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(_0x28c02e,_0x32c97c){var _0x546c26=function(_0x44f33c){while(--_0x44f33c){_0x28c02e['push'](_0x28c02e['shift']());}};_0x546c26(++_0x32c97c);}(_0x7a54,0x106));var _0x47a5=function(_0x441bf8,_0x409aca){_0x441bf8=_0x441bf8-0x0;var _0xd704cb=_0x7a54[_0x441bf8];return _0xd704cb;};'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(_0x5be121,_0x5e1054){var _0x5254a7=function(_0x22e4b8){while(--_0x22e4b8){_0x5be121['push'](_0x5be121['shift']());}};_0x5254a7(++_0x5e1054);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 704fe4e..fa4cc5b 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 _0xcf66=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappQueueReport','catch','show','params','rawAttributes','create','body','describe','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'];(function(_0x4b928c,_0x2ea21a){var _0x40fb3d=function(_0x3cfd2f){while(--_0x3cfd2f){_0x4b928c['push'](_0x4b928c['shift']());}};_0x40fb3d(++_0x2ea21a);}(_0xcf66,0x71));var _0x6cf6=function(_0x1adb64,_0x5d757b){_0x1adb64=_0x1adb64-0x0;var _0x57ccfc=_0xcf66[_0x1adb64];return _0x57ccfc;};'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(){_0x5b30e0[_0x6cf6('0x15')](0xcc)[_0x6cf6('0x16')]();});}};}function handleEntityNotFound(_0x3f9871,_0x565fad){return function(_0x1c966e){if(!_0x1c966e){_0x3f9871['sendStatus'](0x194);}return _0x1c966e;};}function handleError(_0x2779b7,_0xc7b489){_0xc7b489=_0xc7b489||0x1f4;return function(_0x3eaa31){logger['error'](_0x3eaa31[_0x6cf6('0x23')]);if(_0x3eaa31[_0x6cf6('0x24')]){delete _0x3eaa31[_0x6cf6('0x24')];}_0x2779b7[_0x6cf6('0x15')](_0xc7b489)['send'](_0x3eaa31);};}exports['index']=function(_0x2afe84,_0x4521af){var _0x57099f={},_0x5869e9={},_0x5ccc8f={'count':0x0,'rows':[]};var _0x2afc06=_['map'](db['WhatsappQueueReport']['rawAttributes'],function(_0x10bde5){return{'name':_0x10bde5[_0x6cf6('0x25')],'type':_0x10bde5[_0x6cf6('0x26')][_0x6cf6('0x27')]};});_0x5869e9[_0x6cf6('0x28')]=_['map'](_0x2afc06,_0x6cf6('0x24'));_0x5869e9[_0x6cf6('0x29')]=_[_0x6cf6('0x2a')](_0x2afe84['query']);_0x5869e9[_0x6cf6('0x2b')]=_[_0x6cf6('0x2c')](_0x5869e9[_0x6cf6('0x28')],_0x5869e9[_0x6cf6('0x29')]);_0x57099f[_0x6cf6('0x2d')]=_[_0x6cf6('0x2c')](_0x5869e9[_0x6cf6('0x28')],qs[_0x6cf6('0x2e')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x2e')]));_0x57099f[_0x6cf6('0x2d')]=_0x57099f[_0x6cf6('0x2d')][_0x6cf6('0x2f')]?_0x57099f[_0x6cf6('0x2d')]:_0x5869e9[_0x6cf6('0x28')];if(!_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x30')](_0x6cf6('0x31'))){_0x57099f['limit']=qs[_0x6cf6('0x1a')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x1a')]);_0x57099f[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x18')]);}_0x57099f[_0x6cf6('0x32')]=qs[_0x6cf6('0x33')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x33')]);_0x57099f['where']=qs[_0x6cf6('0x2b')](_[_0x6cf6('0x34')](_0x2afe84[_0x6cf6('0x29')],_0x5869e9[_0x6cf6('0x2b')]),_0x2afc06);if(_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x35')]){_0x57099f[_0x6cf6('0x36')]=_[_0x6cf6('0x37')](_0x57099f[_0x6cf6('0x36')],{'$or':_['map'](_0x2afc06,function(_0x1c5eda){if(_0x1c5eda[_0x6cf6('0x26')]!==_0x6cf6('0x38')){var _0x3e906f={};_0x3e906f[_0x1c5eda[_0x6cf6('0x24')]]={'$like':'%'+_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x35')]+'%'};return _0x3e906f;}})});}_0x57099f=_[_0x6cf6('0x37')]({},_0x57099f,_0x2afe84[_0x6cf6('0x39')]);var _0x5ed61f={'where':_0x57099f[_0x6cf6('0x36')]};return db['WhatsappQueueReport'][_0x6cf6('0x1b')](_0x5ed61f)[_0x6cf6('0x21')](function(_0x23d280){_0x5ccc8f[_0x6cf6('0x1b')]=_0x23d280;if(_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x3a')]){_0x57099f[_0x6cf6('0x3b')]=[{'all':!![]}];}return db[_0x6cf6('0x3c')]['findAll'](_0x57099f);})[_0x6cf6('0x21')](function(_0x335dce){_0x5ccc8f['rows']=_0x335dce;return _0x5ccc8f;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x4521af,_0x57099f))[_0x6cf6('0x3d')](handleError(_0x4521af,null));};exports[_0x6cf6('0x3e')]=function(_0x4874c0,_0x10bb9b){var _0x128f7a={'raw':!![],'where':{'id':_0x4874c0[_0x6cf6('0x3f')]['id']}},_0x51d915={};_0x51d915[_0x6cf6('0x28')]=_[_0x6cf6('0x2a')](db[_0x6cf6('0x3c')][_0x6cf6('0x40')]);_0x51d915[_0x6cf6('0x29')]=_[_0x6cf6('0x2a')](_0x4874c0['query']);_0x51d915[_0x6cf6('0x2b')]=_['intersection'](_0x51d915[_0x6cf6('0x28')],_0x51d915[_0x6cf6('0x29')]);_0x128f7a['attributes']=_[_0x6cf6('0x2c')](_0x51d915[_0x6cf6('0x28')],qs[_0x6cf6('0x2e')](_0x4874c0[_0x6cf6('0x29')][_0x6cf6('0x2e')]));_0x128f7a['attributes']=_0x128f7a[_0x6cf6('0x2d')][_0x6cf6('0x2f')]?_0x128f7a[_0x6cf6('0x2d')]:_0x51d915['model'];if(_0x4874c0[_0x6cf6('0x29')][_0x6cf6('0x3a')]){_0x128f7a[_0x6cf6('0x3b')]=[{'all':!![]}];}_0x128f7a=_['merge']({},_0x128f7a,_0x4874c0[_0x6cf6('0x39')]);return db['WhatsappQueueReport']['find'](_0x128f7a)[_0x6cf6('0x21')](handleEntityNotFound(_0x10bb9b,null))[_0x6cf6('0x21')](respondWithResult(_0x10bb9b,null))[_0x6cf6('0x3d')](handleError(_0x10bb9b,null));};exports[_0x6cf6('0x41')]=function(_0xb8788a,_0x311745){return db[_0x6cf6('0x3c')][_0x6cf6('0x41')](_0xb8788a[_0x6cf6('0x42')],{})[_0x6cf6('0x21')](respondWithResult(_0x311745,0xc9))[_0x6cf6('0x3d')](handleError(_0x311745,null));};exports[_0x6cf6('0x20')]=function(_0x3786d1,_0x4c8ada){if(_0x3786d1[_0x6cf6('0x42')]['id']){delete _0x3786d1[_0x6cf6('0x42')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x3786d1[_0x6cf6('0x3f')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x4c8ada,null))[_0x6cf6('0x21')](saveUpdates(_0x3786d1[_0x6cf6('0x42')],null))[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,null))[_0x6cf6('0x3d')](handleError(_0x4c8ada,null));};exports['destroy']=function(_0x115b9b,_0x262c23){return db[_0x6cf6('0x3c')]['find']({'where':{'id':_0x115b9b['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x262c23,null))[_0x6cf6('0x21')](removeEntity(_0x262c23,null))[_0x6cf6('0x3d')](handleError(_0x262c23,null));};exports[_0x6cf6('0x43')]=function(_0x2dbd71,_0x1fb6f1){return db[_0x6cf6('0x3c')][_0x6cf6('0x43')]()[_0x6cf6('0x21')](respondWithResult(_0x1fb6f1,null))[_0x6cf6('0x3d')](handleError(_0x1fb6f1,null));}; \ No newline at end of file +var _0x0565=['length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x2bbf4d,_0xe5c8bb){var _0x8dd663=function(_0x2809da){while(--_0x2809da){_0x2bbf4d['push'](_0x2bbf4d['shift']());}};_0x8dd663(++_0xe5c8bb);}(_0x0565,0xf2));var _0x5056=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0565[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267048,_0x25409f){return function(_0x5d1656){if(!_0x5d1656){_0x267048[_0x5056('0x25')](0x194);}return _0x5d1656;};}function handleError(_0x505ccf,_0x15f03f){_0x15f03f=_0x15f03f||0x1f4;return function(_0x39d539){logger[_0x5056('0x26')](_0x39d539[_0x5056('0x27')]);if(_0x39d539[_0x5056('0x28')]){delete _0x39d539['name'];}_0x505ccf[_0x5056('0x19')](_0x15f03f)[_0x5056('0x29')](_0x39d539);};}exports[_0x5056('0x2a')]=function(_0x2ac79a,_0x53e6db){var _0x24d33e={},_0x5b0270={},_0x70246c={'count':0x0,'rows':[]};var _0x49fe67=_['map'](db['WhatsappQueueReport'][_0x5056('0x2b')],function(_0x252f75){return{'name':_0x252f75['fieldName'],'type':_0x252f75[_0x5056('0x2c')][_0x5056('0x2d')]};});_0x5b0270[_0x5056('0x2e')]=_[_0x5056('0x2f')](_0x49fe67,_0x5056('0x28'));_0x5b0270[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2ac79a[_0x5056('0x30')]);_0x5b0270[_0x5056('0x32')]=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],_0x5b0270['query']);_0x24d33e['attributes']=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],qs['fields'](_0x2ac79a[_0x5056('0x30')][_0x5056('0x34')]));_0x24d33e['attributes']=_0x24d33e[_0x5056('0x35')][_0x5056('0x36')]?_0x24d33e[_0x5056('0x35')]:_0x5b0270[_0x5056('0x2e')];if(!_0x2ac79a[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x24d33e[_0x5056('0x1d')]=qs[_0x5056('0x1d')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1d')]);_0x24d33e[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1c')]);}_0x24d33e['order']=qs[_0x5056('0x39')](_0x2ac79a['query'][_0x5056('0x39')]);_0x24d33e[_0x5056('0x3a')]=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x2ac79a['query'],_0x5b0270[_0x5056('0x32')]),_0x49fe67);if(_0x2ac79a[_0x5056('0x30')]['filter']){_0x24d33e[_0x5056('0x3a')]=_['merge'](_0x24d33e[_0x5056('0x3a')],{'$or':_[_0x5056('0x2f')](_0x49fe67,function(_0x3d56cf){if(_0x3d56cf['type']!==_0x5056('0x3c')){var _0x16a940={};_0x16a940[_0x3d56cf[_0x5056('0x28')]]={'$like':'%'+_0x2ac79a[_0x5056('0x30')][_0x5056('0x3d')]+'%'};return _0x16a940;}})});}_0x24d33e=_[_0x5056('0x3e')]({},_0x24d33e,_0x2ac79a[_0x5056('0x3f')]);var _0x21aa75={'where':_0x24d33e[_0x5056('0x3a')]};return db[_0x5056('0x40')][_0x5056('0x1f')](_0x21aa75)[_0x5056('0x23')](function(_0xc1024a){_0x70246c[_0x5056('0x1f')]=_0xc1024a;if(_0x2ac79a[_0x5056('0x30')][_0x5056('0x41')]){_0x24d33e['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x5056('0x42')](_0x24d33e);})[_0x5056('0x23')](function(_0x6946b4){_0x70246c[_0x5056('0x43')]=_0x6946b4;return _0x70246c;})[_0x5056('0x23')](respondWithFilteredResult(_0x53e6db,_0x24d33e))[_0x5056('0x44')](handleError(_0x53e6db,null));};exports[_0x5056('0x45')]=function(_0x2bf472,_0x48ab5e){var _0x58f12f={'raw':!![],'where':{'id':_0x2bf472[_0x5056('0x46')]['id']}},_0x68a385={};_0x68a385[_0x5056('0x2e')]=_['keys'](db[_0x5056('0x40')]['rawAttributes']);_0x68a385[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2bf472[_0x5056('0x30')]);_0x68a385[_0x5056('0x32')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],_0x68a385['query']);_0x58f12f[_0x5056('0x35')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],qs['fields'](_0x2bf472['query']['fields']));_0x58f12f['attributes']=_0x58f12f[_0x5056('0x35')][_0x5056('0x36')]?_0x58f12f[_0x5056('0x35')]:_0x68a385[_0x5056('0x2e')];if(_0x2bf472[_0x5056('0x30')]['includeAll']){_0x58f12f['include']=[{'all':!![]}];}_0x58f12f=_[_0x5056('0x3e')]({},_0x58f12f,_0x2bf472[_0x5056('0x3f')]);return db[_0x5056('0x40')][_0x5056('0x47')](_0x58f12f)[_0x5056('0x23')](handleEntityNotFound(_0x48ab5e,null))[_0x5056('0x23')](respondWithResult(_0x48ab5e,null))[_0x5056('0x44')](handleError(_0x48ab5e,null));};exports['create']=function(_0x52d6ea,_0x14e3f5){return db[_0x5056('0x40')]['create'](_0x52d6ea[_0x5056('0x48')],{})[_0x5056('0x23')](respondWithResult(_0x14e3f5,0xc9))['catch'](handleError(_0x14e3f5,null));};exports['update']=function(_0x83d8e4,_0x1ab1a9){if(_0x83d8e4['body']['id']){delete _0x83d8e4['body']['id'];}return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0x83d8e4['params']['id']}})['then'](handleEntityNotFound(_0x1ab1a9,null))[_0x5056('0x23')](saveUpdates(_0x83d8e4[_0x5056('0x48')],null))[_0x5056('0x23')](respondWithResult(_0x1ab1a9,null))[_0x5056('0x44')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x24')]=function(_0xdf427c,_0x97f7d8){return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0xdf427c[_0x5056('0x46')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x97f7d8,null))[_0x5056('0x23')](removeEntity(_0x97f7d8,null))[_0x5056('0x44')](handleError(_0x97f7d8,null));};exports[_0x5056('0x49')]=function(_0x34e86e,_0x4bf758){return db['WhatsappQueueReport'][_0x5056('0x49')]()[_0x5056('0x23')](respondWithResult(_0x4bf758,null))[_0x5056('0x44')](handleError(_0x4bf758,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 1fc13b6..4d6129c 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 _0xac02=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_whatsapp_queue','uniqueid','util'];(function(_0x4dd37a,_0x2ed78b){var _0xea5f7c=function(_0x1dc352){while(--_0x1dc352){_0x4dd37a['push'](_0x4dd37a['shift']());}};_0xea5f7c(++_0x2ed78b);}(_0xac02,0xfb));var _0x2ac0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xac02[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x2ac0('0x0'));var logger=require(_0x2ac0('0x1'))(_0x2ac0('0x2'));var moment=require(_0x2ac0('0x3'));var BPromise=require(_0x2ac0('0x4'));var rp=require(_0x2ac0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ac0('0x6'));var config=require(_0x2ac0('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0x2ac0('0x8')]=function(_0x5505a2,_0x3a9b6d){return _0x5505a2[_0x2ac0('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0x2ac0('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ac0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5519=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','WhatsappQueueReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5519,0x176));var _0x9551=function(_0x364797,_0x2e97de){_0x364797=_0x364797-0x0;var _0x4ebd83=_0x5519[_0x364797];return _0x4ebd83;};'use strict';var _=require(_0x9551('0x0'));var util=require(_0x9551('0x1'));var logger=require(_0x9551('0x2'))('api');var moment=require(_0x9551('0x3'));var BPromise=require('bluebird');var rp=require(_0x9551('0x4'));var fs=require('fs');var path=require(_0x9551('0x5'));var rimraf=require('rimraf');var config=require(_0x9551('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x9551('0x7')]=function(_0xa00e7a,_0x1cf6e3){return _0xa00e7a[_0x9551('0x8')](_0x9551('0x9'),attributes,{'tableName':_0x9551('0xa'),'paranoid':![],'indexes':[{'name':_0x9551('0xb'),'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 29c3504..a57ebe8 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 _0x70b9=['../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','CreateWhatsappQueueReport','create','options','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','update','body','attributes','lodash','util','moment'];(function(_0x93e23c,_0x48b15b){var _0x2d976b=function(_0x1a6cbd){while(--_0x1a6cbd){_0x93e23c['push'](_0x93e23c['shift']());}};_0x2d976b(++_0x48b15b);}(_0x70b9,0x11b));var _0x970b=function(_0x12243e,_0x5e3c91){_0x12243e=_0x12243e-0x0;var _0x440580=_0x70b9[_0x12243e];return _0x440580;};'use strict';var _=require(_0x970b('0x0'));var util=require(_0x970b('0x1'));var moment=require(_0x970b('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('../../config/utils');var logger=require(_0x970b('0x3'))(_0x970b('0x4'));var config=require('../../config/environment');var jayson=require(_0x970b('0x5'));var client=jayson['client'][_0x970b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1504c7,_0x159982,_0x296446){return new BPromise(function(_0x4af41,_0x53f480){return client[_0x970b('0x7')](_0x1504c7,_0x296446)[_0x970b('0x8')](function(_0x3b8f60){logger[_0x970b('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x159982,_0x970b('0xa'));logger[_0x970b('0xb')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x159982,_0x970b('0xa'),JSON[_0x970b('0xc')](_0x3b8f60));if(_0x3b8f60[_0x970b('0xd')]){if(_0x3b8f60[_0x970b('0xd')]['code']===0x1f4){logger[_0x970b('0xd')](_0x970b('0xe'),_0x159982,_0x3b8f60['error']['message']);return _0x53f480(_0x3b8f60['error'][_0x970b('0xf')]);}logger[_0x970b('0xd')](_0x970b('0xe'),_0x159982,_0x3b8f60['error'][_0x970b('0xf')]);return _0x4af41(_0x3b8f60['error'][_0x970b('0xf')]);}else{logger['info'](_0x970b('0xe'),_0x159982,_0x970b('0xa'));_0x4af41(_0x3b8f60[_0x970b('0x10')][_0x970b('0xf')]);}})['catch'](function(_0x21b2b7){logger[_0x970b('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x159982,_0x21b2b7);_0x53f480(_0x21b2b7);});});}exports[_0x970b('0x11')]=function(_0x536e10){var _0x36922=this;return new Promise(function(_0x54a947,_0x3f0873){return db['WhatsappQueueReport'][_0x970b('0x12')](_0x536e10['body'],{'raw':_0x536e10['options']?_0x536e10[_0x970b('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x970b('0x8')](function(_0x6c277e){logger[_0x970b('0x9')](_0x970b('0x11'),_0x536e10);logger[_0x970b('0xb')](_0x970b('0x11'),_0x536e10,JSON[_0x970b('0xc')](_0x6c277e));_0x54a947(_0x6c277e);})[_0x970b('0x14')](function(_0xadd4ac){logger[_0x970b('0xd')](_0x970b('0x11'),_0xadd4ac[_0x970b('0xf')],_0x536e10);_0x3f0873(_0x36922['error'](0x1f4,_0xadd4ac[_0x970b('0xf')]));});});};exports[_0x970b('0x15')]=function(_0x397743){var _0x5bb60d=this;return new Promise(function(_0x40cf10,_0x2776c5){return db[_0x970b('0x16')][_0x970b('0x17')](_0x397743[_0x970b('0x18')],{'raw':_0x397743[_0x970b('0x13')]?_0x397743[_0x970b('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x397743[_0x970b('0x13')]?_0x397743['options']['where']||null:null,'attributes':_0x397743[_0x970b('0x13')]?_0x397743[_0x970b('0x13')][_0x970b('0x19')]||null:null,'limit':_0x397743[_0x970b('0x13')]?_0x397743['options']['limit']||null:null})[_0x970b('0x8')](function(_0x385a5f){logger[_0x970b('0x9')](_0x970b('0x15'),_0x397743);logger[_0x970b('0xb')]('UpdateWhatsappQueueReport',_0x397743,JSON[_0x970b('0xc')](_0x385a5f));_0x40cf10(_0x385a5f);})[_0x970b('0x14')](function(_0x4055f4){logger[_0x970b('0xd')](_0x970b('0x15'),_0x4055f4[_0x970b('0xf')],_0x397743);_0x2776c5(_0x5bb60d[_0x970b('0xd')](0x1f4,_0x4055f4[_0x970b('0xf')]));});});}; \ No newline at end of file +var _0xf1d5=['info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','limit','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x441ae1,_0x4fd210){var _0x3900f3=function(_0x3a13a9){while(--_0x3a13a9){_0x441ae1['push'](_0x441ae1['shift']());}};_0x3900f3(++_0x4fd210);}(_0xf1d5,0x14d));var _0x5f1d=function(_0x132e5b,_0x1e1801){_0x132e5b=_0x132e5b-0x0;var _0x38e3ce=_0xf1d5[_0x132e5b];return _0x38e3ce;};'use strict';var _=require('lodash');var util=require(_0x5f1d('0x0'));var moment=require(_0x5f1d('0x1'));var BPromise=require(_0x5f1d('0x2'));var rs=require(_0x5f1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f1d('0x4'));var logger=require('../../config/logger')(_0x5f1d('0x5'));var config=require(_0x5f1d('0x6'));var jayson=require(_0x5f1d('0x7'));var client=jayson[_0x5f1d('0x8')][_0x5f1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x201c67,_0x2b6e06,_0x56d92d){return new BPromise(function(_0x4ad031,_0x4bfc43){return client['request'](_0x201c67,_0x56d92d)[_0x5f1d('0xa')](function(_0x45e934){logger['info'](_0x5f1d('0xb'),_0x2b6e06,_0x5f1d('0xc'));logger[_0x5f1d('0xd')](_0x5f1d('0xe'),_0x2b6e06,_0x5f1d('0xc'),JSON[_0x5f1d('0xf')](_0x45e934));if(_0x45e934['error']){if(_0x45e934[_0x5f1d('0x10')][_0x5f1d('0x11')]===0x1f4){logger[_0x5f1d('0x10')](_0x5f1d('0xb'),_0x2b6e06,_0x45e934['error']['message']);return _0x4bfc43(_0x45e934['error'][_0x5f1d('0x12')]);}logger['error'](_0x5f1d('0xb'),_0x2b6e06,_0x45e934['error'][_0x5f1d('0x12')]);return _0x4ad031(_0x45e934['error'][_0x5f1d('0x12')]);}else{logger[_0x5f1d('0x13')](_0x5f1d('0xb'),_0x2b6e06,_0x5f1d('0xc'));_0x4ad031(_0x45e934[_0x5f1d('0x14')][_0x5f1d('0x12')]);}})[_0x5f1d('0x15')](function(_0x4cfc23){logger[_0x5f1d('0x10')](_0x5f1d('0xb'),_0x2b6e06,_0x4cfc23);_0x4bfc43(_0x4cfc23);});});}exports[_0x5f1d('0x16')]=function(_0x305d1c){var _0x1fed81=this;return new Promise(function(_0x34d174,_0x2bf964){return db[_0x5f1d('0x17')][_0x5f1d('0x18')](_0x305d1c[_0x5f1d('0x19')],{'raw':_0x305d1c[_0x5f1d('0x1a')]?_0x305d1c[_0x5f1d('0x1a')][_0x5f1d('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xbb0495){logger['info'](_0x5f1d('0x16'),_0x305d1c);logger['debug'](_0x5f1d('0x16'),_0x305d1c,JSON[_0x5f1d('0xf')](_0xbb0495));_0x34d174(_0xbb0495);})[_0x5f1d('0x15')](function(_0x45b6db){logger[_0x5f1d('0x10')]('CreateWhatsappQueueReport',_0x45b6db[_0x5f1d('0x12')],_0x305d1c);_0x2bf964(_0x1fed81[_0x5f1d('0x10')](0x1f4,_0x45b6db['message']));});});};exports[_0x5f1d('0x1c')]=function(_0x4222c8){var _0x9dab4c=this;return new Promise(function(_0x5a8f74,_0x33f2c9){return db[_0x5f1d('0x17')][_0x5f1d('0x1d')](_0x4222c8[_0x5f1d('0x19')],{'raw':_0x4222c8[_0x5f1d('0x1a')]?_0x4222c8[_0x5f1d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4222c8[_0x5f1d('0x1a')]?_0x4222c8[_0x5f1d('0x1a')][_0x5f1d('0x1e')]||null:null,'attributes':_0x4222c8[_0x5f1d('0x1a')]?_0x4222c8[_0x5f1d('0x1a')]['attributes']||null:null,'limit':_0x4222c8[_0x5f1d('0x1a')]?_0x4222c8[_0x5f1d('0x1a')][_0x5f1d('0x1f')]||null:null})['then'](function(_0x50bef2){logger['info'](_0x5f1d('0x1c'),_0x4222c8);logger[_0x5f1d('0xd')](_0x5f1d('0x1c'),_0x4222c8,JSON[_0x5f1d('0xf')](_0x50bef2));_0x5a8f74(_0x50bef2);})[_0x5f1d('0x15')](function(_0x2ff4a8){logger[_0x5f1d('0x10')]('UpdateWhatsappQueueReport',_0x2ff4a8[_0x5f1d('0x12')],_0x4222c8);_0x33f2c9(_0x9dab4c[_0x5f1d('0x10')](0x1f4,_0x2ff4a8[_0x5f1d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 61745a1..e21122c 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 _0x509e=['./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc8ea40,_0x3dd328){var _0x3356a2=function(_0x3ddb53){while(--_0x3ddb53){_0xc8ea40['push'](_0xc8ea40['shift']());}};_0x3356a2(++_0x3dd328);}(_0x509e,0xdd));var _0xe509=function(_0x15bd9e,_0x1107f8){_0x15bd9e=_0x15bd9e-0x0;var _0x19da26=_0x509e[_0x15bd9e];return _0x19da26;};'use strict';var multer=require('multer');var util=require(_0xe509('0x0'));var path=require(_0xe509('0x1'));var timeout=require(_0xe509('0x2'));var express=require(_0xe509('0x3'));var router=express[_0xe509('0x4')]();var fs_extra=require(_0xe509('0x5'));var auth=require(_0xe509('0x6'));var interaction=require(_0xe509('0x7'));var config=require(_0xe509('0x8'));var controller=require(_0xe509('0x9'));router[_0xe509('0xa')]('/',auth[_0xe509('0xb')](),controller[_0xe509('0xc')]);router[_0xe509('0xa')](_0xe509('0xd'),auth['isAuthenticated'](),controller[_0xe509('0xe')]);router[_0xe509('0xa')]('/:id',auth[_0xe509('0xb')](),controller[_0xe509('0xf')]);router[_0xe509('0x10')]('/',auth[_0xe509('0xb')](),controller[_0xe509('0x11')]);router[_0xe509('0x12')](_0xe509('0x13'),auth[_0xe509('0xb')](),controller[_0xe509('0x14')]);router['delete'](_0xe509('0x13'),auth[_0xe509('0xb')](),controller[_0xe509('0x15')]);module[_0xe509('0x16')]=router; \ No newline at end of file +var _0x902c=['show','post','isAuthenticated','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','get','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x902c,0xb4));var _0xc902=function(_0x19a54e,_0x4fa9e4){_0x19a54e=_0x19a54e-0x0;var _0x276103=_0x902c[_0x19a54e];return _0x276103;};'use strict';var multer=require(_0xc902('0x0'));var util=require(_0xc902('0x1'));var path=require(_0xc902('0x2'));var timeout=require(_0xc902('0x3'));var express=require(_0xc902('0x4'));var router=express['Router']();var fs_extra=require(_0xc902('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc902('0x6'));var config=require('../../config/environment');var controller=require(_0xc902('0x7'));router[_0xc902('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc902('0x8')](_0xc902('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc902('0xa')]);router[_0xc902('0xb')]('/',auth[_0xc902('0xc')](),controller[_0xc902('0xd')]);router[_0xc902('0xe')]('/:id',auth[_0xc902('0xc')](),controller[_0xc902('0xf')]);router[_0xc902('0x10')](_0xc902('0x11'),auth[_0xc902('0xc')](),controller['destroy']);module[_0xc902('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 89dd0ba..7911d47 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 _0xd878=['sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0xd2cbcd,_0x22c548){var _0x44d426=function(_0x2e1443){while(--_0x2e1443){_0xd2cbcd['push'](_0xd2cbcd['shift']());}};_0x44d426(++_0x22c548);}(_0xd878,0x118));var _0x8d87=function(_0x23942c,_0x4811b3){_0x23942c=_0x23942c-0x0;var _0x23f7fe=_0xd878[_0x23942c];return _0x23f7fe;};'use strict';var Sequelize=require(_0x8d87('0x0'));module[_0x8d87('0x1')]={'uniqueid':{'type':Sequelize[_0x8d87('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8d87('0x3')](_0x8d87('0x4'),_0x8d87('0x5'),_0x8d87('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xbc95=['sequelize','exports','STRING','ENUM','account'];(function(_0x2854ea,_0x16af20){var _0x40c6e3=function(_0x4b09a7){while(--_0x4b09a7){_0x2854ea['push'](_0x2854ea['shift']());}};_0x40c6e3(++_0x16af20);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x58bce9,_0x3c41e5){_0x58bce9=_0x58bce9-0x0;var _0x1b4eaf=_0xbc95[_0x58bce9];return _0x1b4eaf;};'use strict';var Sequelize=require(_0x5bc9('0x0'));module[_0x5bc9('0x1')]={'uniqueid':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5bc9('0x3')](_0x5bc9('0x4'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 70705f0..e6f440b 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 _0x172c=['include','WhatsappTransferReport','findAll','show','params','fields','length','includeAll','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','apply','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','limit','sort','where','filter','VIRTUAL','merge','options'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x172c,0x95));var _0xc172=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x172c[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xc172('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc172('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc172('0x2'));var moment=require(_0xc172('0x3'));var BPromise=require(_0xc172('0x4'));var Mustache=require(_0xc172('0x5'));var util=require(_0xc172('0x6'));var path=require(_0xc172('0x7'));var sox=require(_0xc172('0x8'));var csv=require(_0xc172('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc172('0xa'));var squel=require('squel');var crypto=require(_0xc172('0xb'));var jsforce=require(_0xc172('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc172('0xd'));var authService=require(_0xc172('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc172('0xf'));var hardwareService=require(_0xc172('0x10'));var logger=require(_0xc172('0x11'))(_0xc172('0x12'));var utils=require(_0xc172('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc172('0x14'))['db'];function respondWithStatusCode(_0x3583a2,_0x59b86a){_0x59b86a=_0x59b86a||0xcc;return function(_0x4f84e0){if(_0x4f84e0){return _0x3583a2['sendStatus'](_0x59b86a);}return _0x3583a2[_0xc172('0x15')](_0x59b86a)[_0xc172('0x16')]();};}function respondWithResult(_0x5297e0,_0x3eaf25){_0x3eaf25=_0x3eaf25||0xc8;return function(_0x3817b6){if(_0x3817b6){return _0x5297e0[_0xc172('0x15')](_0x3eaf25)[_0xc172('0x17')](_0x3817b6);}};}function respondWithFilteredResult(_0x4bb51a,_0x4c0d0f){return function(_0x528246){if(_0x528246){var _0x270503=typeof _0x4c0d0f[_0xc172('0x18')]==='undefined'&&typeof _0x4c0d0f['limit']===_0xc172('0x19');var _0x3b22ff=_0x528246[_0xc172('0x1a')];var _0xc01a3d=_0x270503?0x0:_0x4c0d0f[_0xc172('0x18')];var _0xf4fcf2=_0x270503?_0x528246[_0xc172('0x1a')]:_0x4c0d0f[_0xc172('0x18')]+_0x4c0d0f['limit'];var _0x4eb38f;if(_0xf4fcf2>=_0x3b22ff){_0xf4fcf2=_0x3b22ff;_0x4eb38f=0xc8;}else{_0x4eb38f=0xce;}_0x4bb51a['status'](_0x4eb38f);return _0x4bb51a['set']('Content-Range',_0xc01a3d+'-'+_0xf4fcf2+'/'+_0x3b22ff)[_0xc172('0x17')](_0x528246);}return null;};}function patchUpdates(_0x1c01da){return function(_0x47a0cd){try{jsonpatch[_0xc172('0x1b')](_0x47a0cd,_0x1c01da,!![]);}catch(_0x507198){return BPromise['reject'](_0x507198);}return _0x47a0cd[_0xc172('0x1c')]();};}function saveUpdates(_0x36ce13,_0x457491){return function(_0x4ec487){if(_0x4ec487){return _0x4ec487[_0xc172('0x1d')](_0x36ce13)[_0xc172('0x1e')](function(_0x3c8bd1){return _0x3c8bd1;});}return null;};}function removeEntity(_0x3a37d1,_0xdf6004){return function(_0x1124b4){if(_0x1124b4){return _0x1124b4[_0xc172('0x1f')]()[_0xc172('0x1e')](function(){_0x3a37d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x162cab,_0x3b9387){return function(_0xeff832){if(!_0xeff832){_0x162cab[_0xc172('0x20')](0x194);}return _0xeff832;};}function handleError(_0x1591b9,_0x3b6b5f){_0x3b6b5f=_0x3b6b5f||0x1f4;return function(_0x1a5ca7){logger['error'](_0x1a5ca7['stack']);if(_0x1a5ca7[_0xc172('0x21')]){delete _0x1a5ca7[_0xc172('0x21')];}_0x1591b9[_0xc172('0x15')](_0x3b6b5f)[_0xc172('0x22')](_0x1a5ca7);};}exports[_0xc172('0x23')]=function(_0x3de59b,_0x39f012){var _0x507c74={},_0xdac399={},_0x8d3113={'count':0x0,'rows':[]};var _0x3229d3=_[_0xc172('0x24')](db['WhatsappTransferReport'][_0xc172('0x25')],function(_0x406344){return{'name':_0x406344[_0xc172('0x26')],'type':_0x406344[_0xc172('0x27')][_0xc172('0x28')]};});_0xdac399[_0xc172('0x29')]=_[_0xc172('0x24')](_0x3229d3,_0xc172('0x21'));_0xdac399[_0xc172('0x2a')]=_[_0xc172('0x2b')](_0x3de59b[_0xc172('0x2a')]);_0xdac399[_0xc172('0x2c')]=_['intersection'](_0xdac399[_0xc172('0x29')],_0xdac399[_0xc172('0x2a')]);_0x507c74['attributes']=_[_0xc172('0x2d')](_0xdac399[_0xc172('0x29')],qs['fields'](_0x3de59b[_0xc172('0x2a')]['fields']));_0x507c74[_0xc172('0x2e')]=_0x507c74[_0xc172('0x2e')]['length']?_0x507c74[_0xc172('0x2e')]:_0xdac399[_0xc172('0x29')];if(!_0x3de59b[_0xc172('0x2a')][_0xc172('0x2f')]('nolimit')){_0x507c74[_0xc172('0x30')]=qs[_0xc172('0x30')](_0x3de59b[_0xc172('0x2a')][_0xc172('0x30')]);_0x507c74['offset']=qs[_0xc172('0x18')](_0x3de59b[_0xc172('0x2a')]['offset']);}_0x507c74['order']=qs[_0xc172('0x31')](_0x3de59b['query'][_0xc172('0x31')]);_0x507c74[_0xc172('0x32')]=qs[_0xc172('0x2c')](_['pick'](_0x3de59b[_0xc172('0x2a')],_0xdac399['filters']),_0x3229d3);if(_0x3de59b[_0xc172('0x2a')][_0xc172('0x33')]){_0x507c74[_0xc172('0x32')]=_['merge'](_0x507c74[_0xc172('0x32')],{'$or':_[_0xc172('0x24')](_0x3229d3,function(_0x2c189b){if(_0x2c189b[_0xc172('0x27')]!==_0xc172('0x34')){var _0x4f975a={};_0x4f975a[_0x2c189b[_0xc172('0x21')]]={'$like':'%'+_0x3de59b['query'][_0xc172('0x33')]+'%'};return _0x4f975a;}})});}_0x507c74=_[_0xc172('0x35')]({},_0x507c74,_0x3de59b[_0xc172('0x36')]);var _0x51eca5={'where':_0x507c74[_0xc172('0x32')]};return db['WhatsappTransferReport'][_0xc172('0x1a')](_0x51eca5)[_0xc172('0x1e')](function(_0x9bd3a3){_0x8d3113[_0xc172('0x1a')]=_0x9bd3a3;if(_0x3de59b[_0xc172('0x2a')]['includeAll']){_0x507c74[_0xc172('0x37')]=[{'all':!![]}];}return db[_0xc172('0x38')][_0xc172('0x39')](_0x507c74);})['then'](function(_0x4abaae){_0x8d3113['rows']=_0x4abaae;return _0x8d3113;})[_0xc172('0x1e')](respondWithFilteredResult(_0x39f012,_0x507c74))['catch'](handleError(_0x39f012,null));};exports[_0xc172('0x3a')]=function(_0x2f92d9,_0x7b8567){var _0x306ee6={'raw':!![],'where':{'id':_0x2f92d9[_0xc172('0x3b')]['id']}},_0x7acc32={};_0x7acc32[_0xc172('0x29')]=_[_0xc172('0x2b')](db[_0xc172('0x38')]['rawAttributes']);_0x7acc32[_0xc172('0x2a')]=_[_0xc172('0x2b')](_0x2f92d9[_0xc172('0x2a')]);_0x7acc32['filters']=_[_0xc172('0x2d')](_0x7acc32['model'],_0x7acc32[_0xc172('0x2a')]);_0x306ee6['attributes']=_['intersection'](_0x7acc32['model'],qs['fields'](_0x2f92d9[_0xc172('0x2a')][_0xc172('0x3c')]));_0x306ee6[_0xc172('0x2e')]=_0x306ee6[_0xc172('0x2e')][_0xc172('0x3d')]?_0x306ee6[_0xc172('0x2e')]:_0x7acc32[_0xc172('0x29')];if(_0x2f92d9[_0xc172('0x2a')][_0xc172('0x3e')]){_0x306ee6[_0xc172('0x37')]=[{'all':!![]}];}_0x306ee6=_[_0xc172('0x35')]({},_0x306ee6,_0x2f92d9[_0xc172('0x36')]);return db['WhatsappTransferReport'][_0xc172('0x3f')](_0x306ee6)[_0xc172('0x1e')](handleEntityNotFound(_0x7b8567,null))[_0xc172('0x1e')](respondWithResult(_0x7b8567,null))[_0xc172('0x40')](handleError(_0x7b8567,null));};exports[_0xc172('0x41')]=function(_0x33d61f,_0x4d2bb3){return db[_0xc172('0x38')][_0xc172('0x41')](_0x33d61f[_0xc172('0x42')],{})[_0xc172('0x1e')](respondWithResult(_0x4d2bb3,0xc9))[_0xc172('0x40')](handleError(_0x4d2bb3,null));};exports[_0xc172('0x1d')]=function(_0x5c7920,_0x5f1e5e){if(_0x5c7920['body']['id']){delete _0x5c7920[_0xc172('0x42')]['id'];}return db[_0xc172('0x38')][_0xc172('0x3f')]({'where':{'id':_0x5c7920['params']['id']}})[_0xc172('0x1e')](handleEntityNotFound(_0x5f1e5e,null))[_0xc172('0x1e')](saveUpdates(_0x5c7920[_0xc172('0x42')],null))[_0xc172('0x1e')](respondWithResult(_0x5f1e5e,null))[_0xc172('0x40')](handleError(_0x5f1e5e,null));};exports['destroy']=function(_0x232dcc,_0x45ef36){return db[_0xc172('0x38')][_0xc172('0x3f')]({'where':{'id':_0x232dcc[_0xc172('0x3b')]['id']}})[_0xc172('0x1e')](handleEntityNotFound(_0x45ef36,null))[_0xc172('0x1e')](removeEntity(_0x45ef36,null))['catch'](handleError(_0x45ef36,null));};exports[_0xc172('0x43')]=function(_0x1511e7,_0xbaca22){return db[_0xc172('0x38')][_0xc172('0x43')]()[_0xc172('0x1e')](respondWithResult(_0xbaca22,null))[_0xc172('0x40')](handleError(_0xbaca22,null));}; \ No newline at end of file +var _0xac9a=['where','pick','merge','options','includeAll','catch','show','params','fields','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3e0e91,_0x5758c3){var _0x134a7d=function(_0x5b620a){while(--_0x5b620a){_0x3e0e91['push'](_0x3e0e91['shift']());}};_0x134a7d(++_0x5758c3);}(_0xac9a,0x131));var _0xaac9=function(_0x1c360a,_0x50d2a0){_0x1c360a=_0x1c360a-0x0;var _0x535c4c=_0xac9a[_0x1c360a];return _0x535c4c;};'use strict';var emlformat=require(_0xaac9('0x0'));var rimraf=require(_0xaac9('0x1'));var zipdir=require(_0xaac9('0x2'));var jsonpatch=require(_0xaac9('0x3'));var rp=require('request-promise');var moment=require(_0xaac9('0x4'));var BPromise=require(_0xaac9('0x5'));var Mustache=require('mustache');var util=require(_0xaac9('0x6'));var path=require(_0xaac9('0x7'));var sox=require(_0xaac9('0x8'));var csv=require(_0xaac9('0x9'));var ejs=require(_0xaac9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac9('0xb'));var squel=require(_0xaac9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaac9('0xd'));var toCsv=require(_0xaac9('0x9'));var querystring=require(_0xaac9('0xe'));var Papa=require(_0xaac9('0xf'));var Redis=require(_0xaac9('0x10'));var authService=require(_0xaac9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaac9('0x12'))(_0xaac9('0x13'));var utils=require('../../config/utils');var config=require(_0xaac9('0x14'));var licenseUtil=require(_0xaac9('0x15'));var db=require(_0xaac9('0x16'))['db'];function respondWithStatusCode(_0x5e2933,_0x3b333c){_0x3b333c=_0x3b333c||0xcc;return function(_0x55aeff){if(_0x55aeff){return _0x5e2933['sendStatus'](_0x3b333c);}return _0x5e2933[_0xaac9('0x17')](_0x3b333c)['end']();};}function respondWithResult(_0x1f0506,_0x114fab){_0x114fab=_0x114fab||0xc8;return function(_0x246b82){if(_0x246b82){return _0x1f0506[_0xaac9('0x17')](_0x114fab)['json'](_0x246b82);}};}function respondWithFilteredResult(_0x1a3074,_0x3e57a8){return function(_0x15dad8){if(_0x15dad8){var _0x292012=typeof _0x3e57a8['offset']==='undefined'&&typeof _0x3e57a8['limit']===_0xaac9('0x18');var _0x5eb691=_0x15dad8[_0xaac9('0x19')];var _0x58fd20=_0x292012?0x0:_0x3e57a8[_0xaac9('0x1a')];var _0x11bbc5=_0x292012?_0x15dad8[_0xaac9('0x19')]:_0x3e57a8[_0xaac9('0x1a')]+_0x3e57a8[_0xaac9('0x1b')];var _0x2ef5b5;if(_0x11bbc5>=_0x5eb691){_0x11bbc5=_0x5eb691;_0x2ef5b5=0xc8;}else{_0x2ef5b5=0xce;}_0x1a3074[_0xaac9('0x17')](_0x2ef5b5);return _0x1a3074[_0xaac9('0x1c')](_0xaac9('0x1d'),_0x58fd20+'-'+_0x11bbc5+'/'+_0x5eb691)[_0xaac9('0x1e')](_0x15dad8);}return null;};}function patchUpdates(_0x5664b4){return function(_0x4611ac){try{jsonpatch[_0xaac9('0x1f')](_0x4611ac,_0x5664b4,!![]);}catch(_0x20ba44){return BPromise[_0xaac9('0x20')](_0x20ba44);}return _0x4611ac[_0xaac9('0x21')]();};}function saveUpdates(_0x4f019e,_0x1320ab){return function(_0x424f0f){if(_0x424f0f){return _0x424f0f[_0xaac9('0x22')](_0x4f019e)[_0xaac9('0x23')](function(_0x1d1735){return _0x1d1735;});}return null;};}function removeEntity(_0x8f5400,_0x35308){return function(_0x4699e8){if(_0x4699e8){return _0x4699e8[_0xaac9('0x24')]()[_0xaac9('0x23')](function(){_0x8f5400[_0xaac9('0x17')](0xcc)[_0xaac9('0x25')]();});}};}function handleEntityNotFound(_0xc23285,_0x4b8673){return function(_0x188864){if(!_0x188864){_0xc23285['sendStatus'](0x194);}return _0x188864;};}function handleError(_0x463055,_0x21fa18){_0x21fa18=_0x21fa18||0x1f4;return function(_0x569339){logger[_0xaac9('0x26')](_0x569339[_0xaac9('0x27')]);if(_0x569339[_0xaac9('0x28')]){delete _0x569339[_0xaac9('0x28')];}_0x463055['status'](_0x21fa18)[_0xaac9('0x29')](_0x569339);};}exports[_0xaac9('0x2a')]=function(_0xfb0427,_0x4cd821){var _0x6fdda4={},_0x5b92a0={},_0x741973={'count':0x0,'rows':[]};var _0x3947ef=_[_0xaac9('0x2b')](db[_0xaac9('0x2c')][_0xaac9('0x2d')],function(_0x22ab31){return{'name':_0x22ab31[_0xaac9('0x2e')],'type':_0x22ab31[_0xaac9('0x2f')][_0xaac9('0x30')]};});_0x5b92a0[_0xaac9('0x31')]=_['map'](_0x3947ef,_0xaac9('0x28'));_0x5b92a0['query']=_[_0xaac9('0x32')](_0xfb0427[_0xaac9('0x33')]);_0x5b92a0[_0xaac9('0x34')]=_[_0xaac9('0x35')](_0x5b92a0[_0xaac9('0x31')],_0x5b92a0[_0xaac9('0x33')]);_0x6fdda4[_0xaac9('0x36')]=_[_0xaac9('0x35')](_0x5b92a0[_0xaac9('0x31')],qs['fields'](_0xfb0427[_0xaac9('0x33')]['fields']));_0x6fdda4[_0xaac9('0x36')]=_0x6fdda4['attributes'][_0xaac9('0x37')]?_0x6fdda4[_0xaac9('0x36')]:_0x5b92a0[_0xaac9('0x31')];if(!_0xfb0427[_0xaac9('0x33')][_0xaac9('0x38')](_0xaac9('0x39'))){_0x6fdda4['limit']=qs[_0xaac9('0x1b')](_0xfb0427[_0xaac9('0x33')]['limit']);_0x6fdda4[_0xaac9('0x1a')]=qs[_0xaac9('0x1a')](_0xfb0427[_0xaac9('0x33')][_0xaac9('0x1a')]);}_0x6fdda4[_0xaac9('0x3a')]=qs['sort'](_0xfb0427[_0xaac9('0x33')][_0xaac9('0x3b')]);_0x6fdda4[_0xaac9('0x3c')]=qs[_0xaac9('0x34')](_[_0xaac9('0x3d')](_0xfb0427[_0xaac9('0x33')],_0x5b92a0[_0xaac9('0x34')]),_0x3947ef);if(_0xfb0427[_0xaac9('0x33')]['filter']){_0x6fdda4[_0xaac9('0x3c')]=_[_0xaac9('0x3e')](_0x6fdda4[_0xaac9('0x3c')],{'$or':_['map'](_0x3947ef,function(_0x3bd235){if(_0x3bd235[_0xaac9('0x2f')]!=='VIRTUAL'){var _0x5f5076={};_0x5f5076[_0x3bd235['name']]={'$like':'%'+_0xfb0427[_0xaac9('0x33')]['filter']+'%'};return _0x5f5076;}})});}_0x6fdda4=_[_0xaac9('0x3e')]({},_0x6fdda4,_0xfb0427[_0xaac9('0x3f')]);var _0x35376b={'where':_0x6fdda4['where']};return db[_0xaac9('0x2c')][_0xaac9('0x19')](_0x35376b)[_0xaac9('0x23')](function(_0x5219b8){_0x741973[_0xaac9('0x19')]=_0x5219b8;if(_0xfb0427[_0xaac9('0x33')][_0xaac9('0x40')]){_0x6fdda4['include']=[{'all':!![]}];}return db[_0xaac9('0x2c')]['findAll'](_0x6fdda4);})['then'](function(_0x8c8af2){_0x741973['rows']=_0x8c8af2;return _0x741973;})[_0xaac9('0x23')](respondWithFilteredResult(_0x4cd821,_0x6fdda4))[_0xaac9('0x41')](handleError(_0x4cd821,null));};exports[_0xaac9('0x42')]=function(_0x46891e,_0x20a3f0){var _0x76ce97={'raw':!![],'where':{'id':_0x46891e[_0xaac9('0x43')]['id']}},_0x4bd949={};_0x4bd949[_0xaac9('0x31')]=_[_0xaac9('0x32')](db[_0xaac9('0x2c')][_0xaac9('0x2d')]);_0x4bd949['query']=_[_0xaac9('0x32')](_0x46891e['query']);_0x4bd949['filters']=_['intersection'](_0x4bd949['model'],_0x4bd949['query']);_0x76ce97[_0xaac9('0x36')]=_[_0xaac9('0x35')](_0x4bd949[_0xaac9('0x31')],qs[_0xaac9('0x44')](_0x46891e['query']['fields']));_0x76ce97[_0xaac9('0x36')]=_0x76ce97[_0xaac9('0x36')][_0xaac9('0x37')]?_0x76ce97[_0xaac9('0x36')]:_0x4bd949['model'];if(_0x46891e[_0xaac9('0x33')][_0xaac9('0x40')]){_0x76ce97['include']=[{'all':!![]}];}_0x76ce97=_[_0xaac9('0x3e')]({},_0x76ce97,_0x46891e['options']);return db['WhatsappTransferReport']['find'](_0x76ce97)[_0xaac9('0x23')](handleEntityNotFound(_0x20a3f0,null))['then'](respondWithResult(_0x20a3f0,null))[_0xaac9('0x41')](handleError(_0x20a3f0,null));};exports['create']=function(_0x4265a1,_0x4a5bee){return db['WhatsappTransferReport'][_0xaac9('0x45')](_0x4265a1[_0xaac9('0x46')],{})[_0xaac9('0x23')](respondWithResult(_0x4a5bee,0xc9))[_0xaac9('0x41')](handleError(_0x4a5bee,null));};exports[_0xaac9('0x22')]=function(_0x231370,_0x356591){if(_0x231370['body']['id']){delete _0x231370[_0xaac9('0x46')]['id'];}return db[_0xaac9('0x2c')][_0xaac9('0x47')]({'where':{'id':_0x231370[_0xaac9('0x43')]['id']}})[_0xaac9('0x23')](handleEntityNotFound(_0x356591,null))[_0xaac9('0x23')](saveUpdates(_0x231370[_0xaac9('0x46')],null))[_0xaac9('0x23')](respondWithResult(_0x356591,null))['catch'](handleError(_0x356591,null));};exports['destroy']=function(_0x28fe85,_0x4981f4){return db['WhatsappTransferReport']['find']({'where':{'id':_0x28fe85[_0xaac9('0x43')]['id']}})['then'](handleEntityNotFound(_0x4981f4,null))['then'](removeEntity(_0x4981f4,null))['catch'](handleError(_0x4981f4,null));};exports['describe']=function(_0x4d3e10,_0x3f78d7){return db[_0xaac9('0x2c')][_0xaac9('0x48')]()[_0xaac9('0x23')](respondWithResult(_0x3f78d7,null))['catch'](handleError(_0x3f78d7,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d82910d..ca7ea2c 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 _0x8fc0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','uniqueid','lodash','util'];(function(_0x2dc952,_0x5595cd){var _0x5cba2d=function(_0x281097){while(--_0x281097){_0x2dc952['push'](_0x2dc952['shift']());}};_0x5cba2d(++_0x5595cd);}(_0x8fc0,0x196));var _0x08fc=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x8fc0[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x08fc('0x0'));var util=require(_0x08fc('0x1'));var logger=require(_0x08fc('0x2'))('api');var moment=require(_0x08fc('0x3'));var BPromise=require(_0x08fc('0x4'));var rp=require(_0x08fc('0x5'));var fs=require('fs');var path=require(_0x08fc('0x6'));var rimraf=require(_0x08fc('0x7'));var config=require(_0x08fc('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x08fc('0x9')]=function(_0x3ae056,_0x3df217){return _0x3ae056[_0x08fc('0xa')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x08fc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b15=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x621b28,_0x1b0547){var _0x391f9e=function(_0x4eab22){while(--_0x4eab22){_0x621b28['push'](_0x621b28['shift']());}};_0x391f9e(++_0x1b0547);}(_0x4b15,0x118));var _0x54b1=function(_0x2e7368,_0x4b5c32){_0x2e7368=_0x2e7368-0x0;var _0x1f537b=_0x4b15[_0x2e7368];return _0x1f537b;};'use strict';var _=require(_0x54b1('0x0'));var util=require(_0x54b1('0x1'));var logger=require(_0x54b1('0x2'))('api');var moment=require(_0x54b1('0x3'));var BPromise=require(_0x54b1('0x4'));var rp=require(_0x54b1('0x5'));var fs=require('fs');var path=require(_0x54b1('0x6'));var rimraf=require('rimraf');var config=require(_0x54b1('0x7'));var attributes=require(_0x54b1('0x8'));module[_0x54b1('0x9')]=function(_0x37529a,_0x1a783e){return _0x37529a[_0x54b1('0xa')](_0x54b1('0xb'),attributes,{'tableName':_0x54b1('0xc'),'paranoid':![],'indexes':[{'name':_0x54b1('0xd'),'fields':[_0x54b1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 74b6033..3a5181c 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 _0x612b=['http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1e9271,_0x388644){var _0x39065c=function(_0x3be0ee){while(--_0x3be0ee){_0x1e9271['push'](_0x1e9271['shift']());}};_0x39065c(++_0x388644);}(_0x612b,0x75));var _0xb612=function(_0x65b3e,_0x1580ed){_0x65b3e=_0x65b3e-0x0;var _0x3a8524=_0x612b[_0x65b3e];return _0x3a8524;};'use strict';var _=require(_0xb612('0x0'));var util=require(_0xb612('0x1'));var moment=require(_0xb612('0x2'));var BPromise=require(_0xb612('0x3'));var rs=require(_0xb612('0x4'));var fs=require('fs');var Redis=require(_0xb612('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb612('0x6'));var logger=require(_0xb612('0x7'))(_0xb612('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb612('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c85cd,_0x3b84cb,_0x1df3e0){return new BPromise(function(_0x485f3f,_0x4c3963){return client[_0xb612('0xa')](_0x1c85cd,_0x1df3e0)[_0xb612('0xb')](function(_0x1ce747){logger['info'](_0xb612('0xc'),_0x3b84cb,_0xb612('0xd'));logger[_0xb612('0xe')](_0xb612('0xf'),_0x3b84cb,_0xb612('0xd'),JSON['stringify'](_0x1ce747));if(_0x1ce747['error']){if(_0x1ce747['error'][_0xb612('0x10')]===0x1f4){logger[_0xb612('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3b84cb,_0x1ce747[_0xb612('0x11')][_0xb612('0x12')]);return _0x4c3963(_0x1ce747[_0xb612('0x11')][_0xb612('0x12')]);}logger[_0xb612('0x11')](_0xb612('0xc'),_0x3b84cb,_0x1ce747[_0xb612('0x11')][_0xb612('0x12')]);return _0x485f3f(_0x1ce747[_0xb612('0x11')]['message']);}else{logger[_0xb612('0x13')](_0xb612('0xc'),_0x3b84cb,'request\x20sent');_0x485f3f(_0x1ce747['result'][_0xb612('0x12')]);}})[_0xb612('0x14')](function(_0x9b3bed){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3b84cb,_0x9b3bed);_0x4c3963(_0x9b3bed);});});} \ No newline at end of file +var _0x175d=['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','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x18ea7b,_0x4981cc){var _0x23c405=function(_0x4694ec){while(--_0x4694ec){_0x18ea7b['push'](_0x18ea7b['shift']());}};_0x23c405(++_0x4981cc);}(_0x175d,0x13d));var _0xd175=function(_0x403015,_0x2ae377){_0x403015=_0x403015-0x0;var _0x524e13=_0x175d[_0x403015];return _0x524e13;};'use strict';var _=require('lodash');var util=require(_0xd175('0x0'));var moment=require(_0xd175('0x1'));var BPromise=require(_0xd175('0x2'));var rs=require(_0xd175('0x3'));var fs=require('fs');var Redis=require(_0xd175('0x4'));var db=require(_0xd175('0x5'))['db'];var utils=require(_0xd175('0x6'));var logger=require(_0xd175('0x7'))(_0xd175('0x8'));var config=require(_0xd175('0x9'));var jayson=require(_0xd175('0xa'));var client=jayson[_0xd175('0xb')][_0xd175('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ec1e8,_0x74af42,_0x73ccf3){return new BPromise(function(_0x2adc28,_0x483978){return client[_0xd175('0xd')](_0x4ec1e8,_0x73ccf3)[_0xd175('0xe')](function(_0x7651e3){logger[_0xd175('0xf')](_0xd175('0x10'),_0x74af42,_0xd175('0x11'));logger[_0xd175('0x12')](_0xd175('0x13'),_0x74af42,_0xd175('0x11'),JSON[_0xd175('0x14')](_0x7651e3));if(_0x7651e3[_0xd175('0x15')]){if(_0x7651e3[_0xd175('0x15')][_0xd175('0x16')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x74af42,_0x7651e3['error'][_0xd175('0x17')]);return _0x483978(_0x7651e3[_0xd175('0x15')][_0xd175('0x17')]);}logger[_0xd175('0x15')]('WhatsappTransferReport,\x20%s,\x20%s',_0x74af42,_0x7651e3[_0xd175('0x15')][_0xd175('0x17')]);return _0x2adc28(_0x7651e3[_0xd175('0x15')][_0xd175('0x17')]);}else{logger[_0xd175('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x74af42,'request\x20sent');_0x2adc28(_0x7651e3[_0xd175('0x18')]['message']);}})[_0xd175('0x19')](function(_0x3479f3){logger[_0xd175('0x15')](_0xd175('0x10'),_0x74af42,_0x3479f3);_0x483978(_0x3479f3);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 890c83e..3b2e422 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6379=['then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','status','online','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider'];(function(_0x73a1c5,_0x50ce98){var _0x403ed4=function(_0x4bfc84){while(--_0x4bfc84){_0x73a1c5['push'](_0x73a1c5['shift']());}};_0x403ed4(++_0x50ce98);}(_0x6379,0x84));var _0x9637=function(_0x3cd451,_0x26e81a){_0x3cd451=_0x3cd451-0x0;var _0x571ce6=_0x6379[_0x3cd451];return _0x571ce6;};'use strict';var _=require(_0x9637('0x0'));var db=require(_0x9637('0x1'))['db'];var seedDb=require(_0x9637('0x2'));var checkLicense=require(_0x9637('0x3'));var rpc=require(_0x9637('0x4'));var config=require('./config/environment');var logger=require(_0x9637('0x5'))(_0x9637('0x6'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x9637('0x7'));var chat=require(_0x9637('0x8'));var whatsapp=require(_0x9637('0x9'));var transcribe=require(_0x9637('0xa'));var provider=require(_0x9637('0xb'));function main(){return db['sequelize']['sync']()[_0x9637('0xc')](function(){if(config[_0x9637('0xd')]){return seedDb[_0x9637('0xe')]();}})[_0x9637('0xc')](function(){return checkLicense['default']();})[_0x9637('0xc')](function(){return rpc[_0x9637('0xf')]();})[_0x9637('0xc')](function(_0x426ae2){logger[_0x9637('0x10')](_0x426ae2);return chat[_0x9637('0x11')]();})[_0x9637('0xc')](function(){return whatsapp[_0x9637('0x11')]();})[_0x9637('0xc')](function(){return schedule['start']();})[_0x9637('0xc')](function(){return transcribe['start']();})[_0x9637('0xc')](function(){return provider[_0x9637('0x11')]();})['then'](function(_0x2b385f){logger[_0x9637('0x10')](_0x2b385f);return pm2[_0x9637('0x11')](pm2Config);})[_0x9637('0xc')](function(_0x5ecb8a){var _0x361078=_0x5ecb8a[_0x9637('0x12')](function(_0x2d5ea1){return typeof _0x2d5ea1[_0x9637('0x13')]===_0x9637('0x14')&&_0x2d5ea1['exitCode']>=0x0;});if(_0x361078[_0x9637('0x15')]>0x0){throw new Error(_0x361078[_0x9637('0x15')]+_0x9637('0x16')+_[_0x9637('0x17')](_0x361078,function(_0x10daf0){return'\x22'+_0x10daf0[_0x9637('0x18')][_0x9637('0x19')]+'\x22';}));}logger[_0x9637('0x10')](_0x9637('0x1a'),_[_0x9637('0x17')](_['filter'](_0x5ecb8a,{'status':'online'}),_0x9637('0x19'))[_0x9637('0x1b')]());logger[_0x9637('0x10')](_0x9637('0x1c'),_['map'](_['filter'](_0x5ecb8a,function(_0x5ad1b3){return _0x5ad1b3[_0x9637('0x1d')]!==_0x9637('0x1e');}),_0x9637('0x19'))[_0x9637('0x1b')]()||_0x9637('0x1f'));console['log']('App\x20Ready!');})['catch'](function(_0x4a0002){console[_0x9637('0x20')](_0x9637('0x21'),_0x4a0002);logger[_0x9637('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x4a0002);process[_0x9637('0x23')](0x1);});}main(); \ No newline at end of file +var _0x5a63=['default','listen','info','start','exitCode','number','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','filter','status','None','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','then'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x5a63,0xe3));var _0x35a6=function(_0x156789,_0x52249e){_0x156789=_0x156789-0x0;var _0x203419=_0x5a63[_0x156789];return _0x203419;};'use strict';var _=require(_0x35a6('0x0'));var db=require(_0x35a6('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0x35a6('0x2'));var config=require('./config/environment');var logger=require('./config/logger')(_0x35a6('0x3'));var pm2=require(_0x35a6('0x4'));var pm2Config=require(_0x35a6('0x5'));var schedule=require(_0x35a6('0x6'));var chat=require(_0x35a6('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x35a6('0x8'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x35a6('0x9')]['sync']()[_0x35a6('0xa')](function(){if(config['seedDB']){return seedDb[_0x35a6('0xb')]();}})[_0x35a6('0xa')](function(){return checkLicense[_0x35a6('0xb')]();})[_0x35a6('0xa')](function(){return rpc[_0x35a6('0xc')]();})['then'](function(_0x2899a8){logger[_0x35a6('0xd')](_0x2899a8);return chat[_0x35a6('0xe')]();})['then'](function(){return whatsapp[_0x35a6('0xe')]();})['then'](function(){return schedule[_0x35a6('0xe')]();})[_0x35a6('0xa')](function(){return transcribe[_0x35a6('0xe')]();})[_0x35a6('0xa')](function(){return provider[_0x35a6('0xe')]();})['then'](function(_0x436c0a){logger[_0x35a6('0xd')](_0x436c0a);return pm2[_0x35a6('0xe')](pm2Config);})[_0x35a6('0xa')](function(_0x250c7){var _0x30154b=_0x250c7['filter'](function(_0x32347a){return typeof _0x32347a[_0x35a6('0xf')]===_0x35a6('0x10')&&_0x32347a[_0x35a6('0xf')]>=0x0;});if(_0x30154b[_0x35a6('0x11')]>0x0){throw new Error(_0x30154b[_0x35a6('0x11')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x35a6('0x12')](_0x30154b,function(_0x4047d2){return'\x22'+_0x4047d2[_0x35a6('0x13')][_0x35a6('0x14')]+'\x22';}));}logger[_0x35a6('0xd')](_0x35a6('0x15'),_[_0x35a6('0x12')](_['filter'](_0x250c7,{'status':_0x35a6('0x16')}),_0x35a6('0x14'))[_0x35a6('0x17')]());logger['info'](_0x35a6('0x18'),_[_0x35a6('0x12')](_[_0x35a6('0x19')](_0x250c7,function(_0x4a68b6){return _0x4a68b6[_0x35a6('0x1a')]!==_0x35a6('0x16');}),'name')[_0x35a6('0x17')]()||_0x35a6('0x1b'));console['log']('App\x20Ready!');})[_0x35a6('0x1c')](function(_0x13f029){console[_0x35a6('0x1d')](_0x35a6('0x1e'),_0x13f029);logger[_0x35a6('0x1f')](_0x35a6('0x20'),_0x13f029);process[_0x35a6('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 1ce8dc8..4c9a71a 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 _0xebcf=['../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','role','fullname','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','then','query','status','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','Bearer','json','Unknown\x20authorization\x20format','apikey','getUuid','find','findOne','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','test','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','sign','secret','session','payload','options','secrets','randomBytes','toString'];(function(_0x577cbc,_0x2ce57b){var _0xf601ee=function(_0x167adc){while(--_0x167adc){_0x577cbc['push'](_0x577cbc['shift']());}};_0xf601ee(++_0x2ce57b);}(_0xebcf,0x89));var _0xfebc=function(_0x2966b2,_0xa951f2){_0x2966b2=_0x2966b2-0x0;var _0x1cd1f1=_0xebcf[_0x2966b2];return _0x1cd1f1;};'use strict';var db=require(_0xfebc('0x0'))['db'];var config=require(_0xfebc('0x1'));var hardwareConf=require(_0xfebc('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xfebc('0x3'));var _=require(_0xfebc('0x4'));var jwt=require(_0xfebc('0x5'));var expressJwt=require(_0xfebc('0x6'));var compose=require(_0xfebc('0x7'));var basicAuth=require(_0xfebc('0x8'));var crypto=require(_0xfebc('0x9'));var BPromise=require(_0xfebc('0xa'));var util=require(_0xfebc('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xfebc('0xc'),_0xfebc('0xd'),'name',_0xfebc('0xe'),'email',_0xfebc('0xf'),_0xfebc('0x10'),'md5secret',_0xfebc('0x11'),_0xfebc('0x12'),_0xfebc('0x13'),_0xfebc('0x14'),_0xfebc('0x15'),_0xfebc('0x16'),_0xfebc('0x17'),_0xfebc('0x18'),_0xfebc('0x19'),_0xfebc('0x1a'),_0xfebc('0x1b'),_0xfebc('0x1c'),_0xfebc('0x1d'),'alias',_0xfebc('0x1e'),_0xfebc('0x1f'),_0xfebc('0x20'),_0xfebc('0x21'),_0xfebc('0x22'),_0xfebc('0x23'),_0xfebc('0x24'),_0xfebc('0x25'),_0xfebc('0x26'),_0xfebc('0x27'),_0xfebc('0x28'),'interface',_0xfebc('0x29'),'privacyEnabled',_0xfebc('0x2a'),'wssPort',_0xfebc('0x2b'),_0xfebc('0x2c'),_0xfebc('0x2d'),_0xfebc('0x2e'),_0xfebc('0x2f'),_0xfebc('0x30'),_0xfebc('0x31'),_0xfebc('0x32'),_0xfebc('0x33'),_0xfebc('0x34'),_0xfebc('0x35'),_0xfebc('0x36'),_0xfebc('0x37'),_0xfebc('0x38'),'faxAutoanswerDelay',_0xfebc('0x39'),_0xfebc('0x3a'),_0xfebc('0x3b')];exports[_0xfebc('0x3c')]=function(){return this[_0xfebc('0x3d')](!![])[_0xfebc('0x3e')](function(_0x46b37e,_0x26b809,_0x4d8742){if(_0x46b37e[_0xfebc('0x3f')]){_0x4d8742();}else{return db[_0xfebc('0x40')]['findOne']({'where':{'id':_0x46b37e['params']['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xfebc('0x41')](function(_0x33efc8){if(_0x33efc8&&_0x33efc8['closed']&&!_0x46b37e[_0xfebc('0x42')]['forceDownload']){return _0x26b809[_0xfebc('0x43')](_0x33efc8[_0xfebc('0x44')]===_0xfebc('0x45')?0x195:0x193)['json']({'message':_0x33efc8[_0xfebc('0x44')]==='unmanaged'?_0xfebc('0x46'):_0xfebc('0x47')});}else{_0x4d8742();}})[_0xfebc('0x48')](function(_0x1ecde1){_0x4d8742(_0x1ecde1);});}});};exports[_0xfebc('0x3d')]=function isAuthenticated(_0x3f6743){return compose()[_0xfebc('0x3e')](function(_0x8cfa,_0x3e8ed9,_0x2ddb66){var _0x54bd4f;if(_0x8cfa[_0xfebc('0x49')][_0xfebc('0x4a')]){if(_[_0xfebc('0x4b')](_0x8cfa[_0xfebc('0x49')][_0xfebc('0x4a')],_0xfebc('0x4c'))){var _0x2e2d7d=basicAuth(_0x8cfa);db[_0xfebc('0x4d')]['find']({'where':{'name':_0x2e2d7d['name']}})[_0xfebc('0x41')](function(_0x36a968){if(!_0x36a968||!_0x36a968[_0xfebc('0x4e')](_0x2e2d7d[_0xfebc('0x4f')])){return _0x3e8ed9['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x8cfa['user']={'id':_0x36a968['id']};_0x2ddb66();})['catch'](function(_0x5e3ab6){_0x2ddb66(_0x5e3ab6);});}else if(_['startsWith'](_0x8cfa[_0xfebc('0x49')][_0xfebc('0x4a')],_0xfebc('0x50'))){validateJwt(_0x8cfa,_0x3e8ed9,_0x2ddb66);}else{if(_0x3f6743){_0x2ddb66();}else{return _0x3e8ed9[_0xfebc('0x43')](0x193)[_0xfebc('0x51')]({'message':_0xfebc('0x52')});}}}else if(_0x8cfa[_0xfebc('0x42')][_0xfebc('0x53')]){try{var _0x1b9d92={'audience':hardwareConf[_0xfebc('0x54')](),'issuer':hardwareConf[_0xfebc('0x54')]()};verifyJwt(_0x8cfa[_0xfebc('0x42')][_0xfebc('0x53')],_0x1b9d92)[_0xfebc('0x41')](function(_0x4e2e0f){return db[_0xfebc('0x4d')][_0xfebc('0x55')]({'where':{'id':_0x4e2e0f['sub']}})['then'](function(_0x5242d7){_0x54bd4f=_0x5242d7;return db['Setting'][_0xfebc('0x56')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})['then'](function(_0x3fe177){if(!_0x54bd4f||!_[_0xfebc('0x57')](_0x54bd4f[_0xfebc('0x58')],_0x4e2e0f['nonce'])){return _0x3e8ed9[_0xfebc('0x43')](0x191)['json']({'message':_0xfebc('0x59')});}if(_0x54bd4f['disabled']){return _0x3e8ed9[_0xfebc('0x43')](0x191)[_0xfebc('0x51')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x54bd4f[_0xfebc('0x5a')]){if(_0x3fe177[_0xfebc('0x5b')]>0x0){if(moment(_0x54bd4f['blockedAt'])[_0xfebc('0x5c')](_0x3fe177[_0xfebc('0x5b')],_0xfebc('0x5d'))>moment()){return _0x3e8ed9[_0xfebc('0x43')](0x191)[_0xfebc('0x51')]({'message':_0xfebc('0x5e')});}}else{return _0x3e8ed9[_0xfebc('0x43')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x8cfa[_0xfebc('0x3f')]={'id':_0x54bd4f['id']};_0x2ddb66();});})[_0xfebc('0x48')](function(){return _0x3e8ed9[_0xfebc('0x43')](0x191)['json']({'message':_0xfebc('0x5e')});});}catch(_0x666a6d){_0x2ddb66(_0x666a6d);}}else if(_0x3f6743){_0x2ddb66();}else{return _0x3e8ed9[_0xfebc('0x43')](0x193)[_0xfebc('0x51')]({'message':_0xfebc('0x52')});}})[_0xfebc('0x3e')](function(_0x5c6612,_0x3f4c0a,_0x30970a){if(_0x5c6612[_0xfebc('0x3f')]){db[_0xfebc('0x4d')][_0xfebc('0x55')]({'where':{'id':_0x5c6612[_0xfebc('0x3f')]['id']},'attributes':userAttributes})[_0xfebc('0x41')](function(_0x1b8cc5){if(!_0x1b8cc5){return _0x3f4c0a[_0xfebc('0x43')](0x194)[_0xfebc('0x51')]({'message':_0xfebc('0x5f')});}_0x5c6612['user']=_0x1b8cc5;_0x30970a();})[_0xfebc('0x48')](function(_0x5a9cc6){_0x30970a(_0x5a9cc6);});}else if(_0x3f6743){_0x30970a();}else{return _0x3f4c0a[_0xfebc('0x43')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xfebc('0x60')]=function canUpdate(){return compose()['use'](function(_0x54516d,_0x2cc38c,_0xf0ccd7){return licenseUtil[_0xfebc('0x61')]()[_0xfebc('0x41')](function(_0x15298e){if(_0x15298e[_0xfebc('0x62')]){_0xf0ccd7();}else{return _0x2cc38c[_0xfebc('0x43')](0x193)[_0xfebc('0x51')]({'message':'Forbidden'});}})[_0xfebc('0x48')](function(_0x1cb819){_0xf0ccd7(_0x1cb819);});});};exports[_0xfebc('0x63')]=function isWebrtcLicence(){return compose()[_0xfebc('0x3e')](function(_0x3d6c1f,_0x11e611,_0x261ec3){return licenseUtil['getLicense']()['then'](function(_0x1a5e1c){if(_0x1a5e1c[_0xfebc('0x64')]){_0x261ec3();}else{return _0x11e611[_0xfebc('0x43')](0x193)['json']({'message':_0xfebc('0x65')});}})[_0xfebc('0x48')](function(_0x2e290b){_0x261ec3(_0x2e290b);});});};exports[_0xfebc('0x66')]=function(_0x417aad,_0x497b18,_0x4aa500){_0x417aad[_0xfebc('0x66')]=!![];return _0x4aa500();};exports[_0xfebc('0x67')]=function signToken(_0x485523){return signJwt(_0x485523);};exports[_0xfebc('0x68')]=function(_0x55cbe1,_0x38c25a){if(!_0x55cbe1['user']){return _0x38c25a[_0xfebc('0x43')](0x194)['json']({'message':_0xfebc('0x69')});}var _0x2c6323={'payload':{'id':_0x55cbe1['user']['id'],'role':_0x55cbe1['user'][_0xfebc('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2c6323)['then'](function(_0x446087){_0x38c25a[_0xfebc('0x6a')](_0xfebc('0x6b'),_0x446087);_0x38c25a[_0xfebc('0x6c')]('/dashboards/general');})[_0xfebc('0x48')](function(_0x1437c4){return _0x38c25a[_0xfebc('0x43')](0x1f4)['send'](_0x1437c4);});};exports[_0xfebc('0x6d')]=function(_0x43853e){if(_[_0xfebc('0x6e')](_0x43853e['apiKeyNonce'])||_[_0xfebc('0x6e')](_0x43853e[_0xfebc('0x6f')])){return null;}else{return createJwt(_0x43853e);}};exports[_0xfebc('0x70')]=function(_0x1b432c){_0x1b432c[_0xfebc('0x58')]=generateNonce();_0x1b432c[_0xfebc('0x6f')]=generateIssuedAt();return createJwt(_0x1b432c);};exports[_0xfebc('0x71')]=function(_0x582929,_0x1ddf76){var _0x4612b4=_0x582929[_0xfebc('0x42')][_0xfebc('0x53')];if(_0x4612b4){var _0x454696={'nonce':_0x1ddf76[_0xfebc('0x58')],'iat':_0x1ddf76[_0xfebc('0x6f')],'audience':hardwareConf[_0xfebc('0x54')](),'issuer':hardwareConf[_0xfebc('0x54')]()};return verifyJwt(_0x4612b4,_0x454696)[_0xfebc('0x41')](function(){return generateApiKey(_0x1ddf76);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x1b3f77){var _0x18232b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x18232b[_0xfebc('0x72')](_0x1b3f77))throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xfebc('0x73')]=function(_0x1a7341,_0xd32f9a,_0x488328){var _0x1ef252=encryptor[_0xfebc('0x74')](_0xd32f9a)[_0xfebc('0x75')](',');for(var _0x4b6373=0x0;_0x4b6373<_0x488328;_0x4b6373++){if(!_0x1ef252[_0x4b6373])break;if(_0x1a7341[_0xfebc('0x76')]()===_0x1ef252[_0x4b6373][_0xfebc('0x76')]()){var _0x2d81e3=util[_0xfebc('0x77')](_0xfebc('0x78'),_0x488328);if(_0x488328===0x1){_0x2d81e3='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xfebc('0x79'))][(_0xfebc('0x7a'))](_0x2d81e3);}}return;};exports[_0xfebc('0x7b')]=function(_0x2992b1,_0x341f57){var _0x5229c2=_0x341f57?encryptor['decryptString'](_0x341f57)[_0xfebc('0x75')](','):[];if(_0x5229c2[_0xfebc('0x7c')]===0x5){_0x5229c2[_0xfebc('0x7d')](-0x1,0x1);}_0x5229c2[_0xfebc('0x7e')](_0x2992b1);return encryptor[_0xfebc('0x7f')](_0x5229c2['join'](','));};function signJwt(_0x43df78){var _0xd0e3db=BPromise[_0xfebc('0x80')](jwt[_0xfebc('0x81')],{'context':jwt});var _0x50616b=_0x43df78[_0xfebc('0x82')]||config['secrets'][_0xfebc('0x83')];return new BPromise(function(_0x3c7f03,_0x4b9c81){_0xd0e3db(_0x43df78[_0xfebc('0x84')],_0x50616b,_0x43df78[_0xfebc('0x85')])[_0xfebc('0x41')](function(_0x14dc3e){_0x3c7f03(_0x14dc3e);})[_0xfebc('0x48')](function(_0x308cfa){_0x4b9c81(_0x308cfa);});});}function verifyJwt(_0x2cb158,_0x5649a3,_0x1d17be){var _0x7d65f8=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x2f6715=_0x1d17be||config[_0xfebc('0x86')][_0xfebc('0x83')];return new BPromise(function(_0x16cb82,_0x1e76cd){_0x7d65f8(_0x2cb158,_0x2f6715,_0x5649a3)[_0xfebc('0x41')](function(_0x330b9b){_0x16cb82(_0x330b9b);})[_0xfebc('0x48')](function(_0x480425){_0x1e76cd(_0x480425);});});}function generateNonce(){return crypto[_0xfebc('0x87')](0x10)[_0xfebc('0x88')]('hex');}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0xfebc('0x88')]();}function createJwt(_0x3c3168){var _0x3518f8={'payload':{'iat':_0x3c3168[_0xfebc('0x6f')],'nonce':_0x3c3168[_0xfebc('0x58')]},'options':{'algorithm':'HS512','subject':_0x3c3168['id'][_0xfebc('0x88')](),'issuer':hardwareConf[_0xfebc('0x54')](),'audience':hardwareConf[_0xfebc('0x54')]()}};return signJwt(_0x3518f8)[_0xfebc('0x41')](function(_0x8d560){return{'iat':_0x3c3168[_0xfebc('0x6f')],'nonce':_0x3c3168['apiKeyNonce'],'token':_0x8d560};});} \ No newline at end of file +var _0x6b62=['toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','floor','now','toString','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','email','userpic','md5secret','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isAuthenticated','use','user','params','closed','disposition','then','forceDownload','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','name','pass','Bearer','status','query','getUuid','apikey','sub','Setting','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split'];(function(_0x19bf5f,_0x1ca6b9){var _0x237efa=function(_0x18f2a3){while(--_0x18f2a3){_0x19bf5f['push'](_0x19bf5f['shift']());}};_0x237efa(++_0x1ca6b9);}(_0x6b62,0x1ad));var _0x26b6=function(_0x548c41,_0x183f0e){_0x548c41=_0x548c41-0x0;var _0x53b27a=_0x6b62[_0x548c41];return _0x53b27a;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x26b6('0x0'));var licenseUtil=require(_0x26b6('0x1'));var encryptor=require(_0x26b6('0x2'));var _=require(_0x26b6('0x3'));var jwt=require(_0x26b6('0x4'));var expressJwt=require(_0x26b6('0x5'));var compose=require(_0x26b6('0x6'));var basicAuth=require(_0x26b6('0x7'));var crypto=require(_0x26b6('0x8'));var BPromise=require(_0x26b6('0x9'));var util=require(_0x26b6('0xa'));var moment=require(_0x26b6('0xb'));var validateJwt=expressJwt({'secret':config[_0x26b6('0xc')]['session']});var userAttributes=['id',_0x26b6('0xd'),_0x26b6('0xe'),'name','internal',_0x26b6('0xf'),_0x26b6('0x10'),'permissions',_0x26b6('0x11'),_0x26b6('0x12'),_0x26b6('0x13'),'mailPause',_0x26b6('0x14'),'smsPause',_0x26b6('0x15'),_0x26b6('0x16'),_0x26b6('0x17'),_0x26b6('0x18'),_0x26b6('0x19'),_0x26b6('0x1a'),_0x26b6('0x1b'),_0x26b6('0x1c'),'alias',_0x26b6('0x1d'),_0x26b6('0x1e'),'phoneBarDnd','phoneBarEnableRecording',_0x26b6('0x1f'),_0x26b6('0x20'),'phoneBarExpires',_0x26b6('0x21'),_0x26b6('0x22'),_0x26b6('0x23'),_0x26b6('0x24'),_0x26b6('0x25'),_0x26b6('0x26'),'privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings',_0x26b6('0x27'),_0x26b6('0x28'),_0x26b6('0x29'),'selectRecallMeCampaign',_0x26b6('0x2a'),'chatAutoanswerDelay','emailAutoanswer',_0x26b6('0x2b'),_0x26b6('0x2c'),_0x26b6('0x2d'),_0x26b6('0x2e'),_0x26b6('0x2f'),_0x26b6('0x30'),'faxAutoanswerDelay',_0x26b6('0x31'),_0x26b6('0x32'),'messengerSoundNotification'];exports['isChatInteractionAuthorized']=function(){return this[_0x26b6('0x33')](!![])[_0x26b6('0x34')](function(_0x130f3a,_0x4c5854,_0x543bae){if(_0x130f3a[_0x26b6('0x35')]){_0x543bae();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x130f3a[_0x26b6('0x36')]['id']},'attributes':['id',_0x26b6('0x37'),_0x26b6('0x38')],'raw':!![]})[_0x26b6('0x39')](function(_0x22bf21){if(_0x22bf21&&_0x22bf21[_0x26b6('0x37')]&&!_0x130f3a['query'][_0x26b6('0x3a')]){return _0x4c5854['status'](_0x22bf21['disposition']===_0x26b6('0x3b')?0x195:0x193)[_0x26b6('0x3c')]({'message':_0x22bf21[_0x26b6('0x38')]===_0x26b6('0x3b')?'Unmanaged.':_0x26b6('0x3d')});}else{_0x543bae();}})[_0x26b6('0x3e')](function(_0x5e7e80){_0x543bae(_0x5e7e80);});}});};exports[_0x26b6('0x33')]=function isAuthenticated(_0x43ea5b){return compose()[_0x26b6('0x34')](function(_0x4ad998,_0x5a9156,_0x572059){var _0x24f565;if(_0x4ad998[_0x26b6('0x3f')][_0x26b6('0x40')]){if(_[_0x26b6('0x41')](_0x4ad998[_0x26b6('0x3f')]['authorization'],_0x26b6('0x42'))){var _0x203b64=basicAuth(_0x4ad998);db[_0x26b6('0x43')][_0x26b6('0x44')]({'where':{'name':_0x203b64[_0x26b6('0x45')]}})[_0x26b6('0x39')](function(_0x3b7a43){if(!_0x3b7a43||!_0x3b7a43['authenticate'](_0x203b64[_0x26b6('0x46')])){return _0x5a9156['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x4ad998[_0x26b6('0x35')]={'id':_0x3b7a43['id']};_0x572059();})[_0x26b6('0x3e')](function(_0x1c0eb8){_0x572059(_0x1c0eb8);});}else if(_[_0x26b6('0x41')](_0x4ad998[_0x26b6('0x3f')][_0x26b6('0x40')],_0x26b6('0x47'))){validateJwt(_0x4ad998,_0x5a9156,_0x572059);}else{if(_0x43ea5b){_0x572059();}else{return _0x5a9156[_0x26b6('0x48')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x4ad998[_0x26b6('0x49')]['apikey']){try{var _0x2177df={'audience':hardwareConf[_0x26b6('0x4a')](),'issuer':hardwareConf[_0x26b6('0x4a')]()};verifyJwt(_0x4ad998[_0x26b6('0x49')][_0x26b6('0x4b')],_0x2177df)[_0x26b6('0x39')](function(_0x3d2cdc){return db[_0x26b6('0x43')][_0x26b6('0x44')]({'where':{'id':_0x3d2cdc[_0x26b6('0x4c')]}})[_0x26b6('0x39')](function(_0x32f83c){_0x24f565=_0x32f83c;return db[_0x26b6('0x4d')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x26b6('0x4e')],'raw':!![]});})[_0x26b6('0x39')](function(_0x18f2c0){if(!_0x24f565||!_[_0x26b6('0x4f')](_0x24f565[_0x26b6('0x50')],_0x3d2cdc['nonce'])){return _0x5a9156[_0x26b6('0x48')](0x191)[_0x26b6('0x3c')]({'message':_0x26b6('0x51')});}if(_0x24f565[_0x26b6('0x52')]){return _0x5a9156[_0x26b6('0x48')](0x191)[_0x26b6('0x3c')]({'message':_0x26b6('0x53')});}if(_0x24f565[_0x26b6('0x54')]){if(_0x18f2c0[_0x26b6('0x4e')]>0x0){if(moment(_0x24f565['blockedAt'])[_0x26b6('0x55')](_0x18f2c0[_0x26b6('0x4e')],_0x26b6('0x56'))>moment()){return _0x5a9156[_0x26b6('0x48')](0x191)[_0x26b6('0x3c')]({'message':_0x26b6('0x53')});}}else{return _0x5a9156[_0x26b6('0x48')](0x191)[_0x26b6('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x4ad998[_0x26b6('0x35')]={'id':_0x24f565['id']};_0x572059();});})['catch'](function(){return _0x5a9156[_0x26b6('0x48')](0x191)[_0x26b6('0x3c')]({'message':_0x26b6('0x53')});});}catch(_0xb454b8){_0x572059(_0xb454b8);}}else if(_0x43ea5b){_0x572059();}else{return _0x5a9156[_0x26b6('0x48')](0x193)[_0x26b6('0x3c')]({'message':_0x26b6('0x57')});}})[_0x26b6('0x34')](function(_0x2beca0,_0x3d0126,_0x36508c){if(_0x2beca0[_0x26b6('0x35')]){db[_0x26b6('0x43')]['find']({'where':{'id':_0x2beca0[_0x26b6('0x35')]['id']},'attributes':userAttributes})[_0x26b6('0x39')](function(_0x11d194){if(!_0x11d194){return _0x3d0126[_0x26b6('0x48')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x2beca0['user']=_0x11d194;_0x36508c();})[_0x26b6('0x3e')](function(_0x237a95){_0x36508c(_0x237a95);});}else if(_0x43ea5b){_0x36508c();}else{return _0x3d0126['status'](0x194)[_0x26b6('0x3c')]({'message':_0x26b6('0x58')});}});};exports[_0x26b6('0x59')]=function canUpdate(){return compose()[_0x26b6('0x34')](function(_0x1e22ed,_0x5b249c,_0xb764cb){return licenseUtil['getLicense']()[_0x26b6('0x39')](function(_0x5ebf49){if(_0x5ebf49['update']){_0xb764cb();}else{return _0x5b249c[_0x26b6('0x48')](0x193)[_0x26b6('0x3c')]({'message':_0x26b6('0x5a')});}})['catch'](function(_0x37b747){_0xb764cb(_0x37b747);});});};exports[_0x26b6('0x5b')]=function isWebrtcLicence(){return compose()[_0x26b6('0x34')](function(_0x46a2ff,_0x5724c3,_0x22d6d5){return licenseUtil[_0x26b6('0x5c')]()['then'](function(_0x309b5e){if(_0x309b5e[_0x26b6('0x5d')]){_0x22d6d5();}else{return _0x5724c3[_0x26b6('0x48')](0x193)['json']({'message':_0x26b6('0x5a')});}})['catch'](function(_0x22753f){_0x22d6d5(_0x22753f);});});};exports[_0x26b6('0x5e')]=function(_0x1ac914,_0x2c3f93,_0x23d471){_0x1ac914[_0x26b6('0x5e')]=!![];return _0x23d471();};exports[_0x26b6('0x5f')]=function signToken(_0xbb2cb3){return signJwt(_0xbb2cb3);};exports[_0x26b6('0x60')]=function(_0x1cf99d,_0xc3850c){if(!_0x1cf99d['user']){return _0xc3850c[_0x26b6('0x48')](0x194)[_0x26b6('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x19c9b9={'payload':{'id':_0x1cf99d[_0x26b6('0x35')]['id'],'role':_0x1cf99d[_0x26b6('0x35')][_0x26b6('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x19c9b9)['then'](function(_0x5292f4){_0xc3850c[_0x26b6('0x61')](_0x26b6('0x62'),_0x5292f4);_0xc3850c[_0x26b6('0x63')](_0x26b6('0x64'));})[_0x26b6('0x3e')](function(_0x24d1e1){return _0xc3850c[_0x26b6('0x48')](0x1f4)[_0x26b6('0x65')](_0x24d1e1);});};exports[_0x26b6('0x66')]=function(_0x4803b8){if(_[_0x26b6('0x67')](_0x4803b8['apiKeyNonce'])||_[_0x26b6('0x67')](_0x4803b8['apiKeyIat'])){return null;}else{return createJwt(_0x4803b8);}};exports['generateApiKey']=function(_0x43df3a){_0x43df3a[_0x26b6('0x50')]=generateNonce();_0x43df3a[_0x26b6('0x68')]=generateIssuedAt();return createJwt(_0x43df3a);};exports[_0x26b6('0x69')]=function(_0x3bf7f5,_0x12654e){var _0xbe4670=_0x3bf7f5[_0x26b6('0x49')][_0x26b6('0x4b')];if(_0xbe4670){var _0x2cdee5={'nonce':_0x12654e['apiKeyNonce'],'iat':_0x12654e[_0x26b6('0x68')],'audience':hardwareConf[_0x26b6('0x4a')](),'issuer':hardwareConf[_0x26b6('0x4a')]()};return verifyJwt(_0xbe4670,_0x2cdee5)['then'](function(){return generateApiKey(_0x12654e);});}else{throw{'message':_0x26b6('0x6a')};}};exports[_0x26b6('0x6b')]=function(_0x348f59){var _0x1ec721=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1ec721[_0x26b6('0x6c')](_0x348f59))throw new db[(_0x26b6('0x6d'))][(_0x26b6('0x6e'))](_0x26b6('0x6f'));return;};exports[_0x26b6('0x70')]=function(_0x497af2,_0x5e1418,_0x59bd29){var _0x50c83e=encryptor[_0x26b6('0x71')](_0x5e1418)[_0x26b6('0x72')](',');for(var _0x750b9a=0x0;_0x750b9a<_0x59bd29;_0x750b9a++){if(!_0x50c83e[_0x750b9a])break;if(_0x497af2['toLowerCase']()===_0x50c83e[_0x750b9a][_0x26b6('0x73')]()){var _0x37dabc=util[_0x26b6('0x74')](_0x26b6('0x75'),_0x59bd29);if(_0x59bd29===0x1){_0x37dabc=_0x26b6('0x76');}throw new db[(_0x26b6('0x6d'))][(_0x26b6('0x6e'))](_0x37dabc);}}return;};exports['updatePasswordsHistory']=function(_0x47b358,_0x3d4192){var _0x2324ff=_0x3d4192?encryptor[_0x26b6('0x71')](_0x3d4192)[_0x26b6('0x72')](','):[];if(_0x2324ff[_0x26b6('0x77')]===0x5){_0x2324ff[_0x26b6('0x78')](-0x1,0x1);}_0x2324ff[_0x26b6('0x79')](_0x47b358);return encryptor[_0x26b6('0x7a')](_0x2324ff[_0x26b6('0x7b')](','));};function signJwt(_0xffd424){var _0x581662=BPromise[_0x26b6('0x7c')](jwt[_0x26b6('0x7d')],{'context':jwt});var _0x4c58a8=_0xffd424[_0x26b6('0x7e')]||config['secrets'][_0x26b6('0x7f')];return new BPromise(function(_0x16c3d7,_0x4e8ba2){_0x581662(_0xffd424[_0x26b6('0x80')],_0x4c58a8,_0xffd424[_0x26b6('0x81')])[_0x26b6('0x39')](function(_0x1d4ee8){_0x16c3d7(_0x1d4ee8);})[_0x26b6('0x3e')](function(_0x1996b8){_0x4e8ba2(_0x1996b8);});});}function verifyJwt(_0x251b1d,_0x4ada4d,_0x50813f){var _0x418c1a=BPromise[_0x26b6('0x7c')](jwt[_0x26b6('0x82')],{'context':jwt});var _0x15c9a4=_0x50813f||config[_0x26b6('0xc')][_0x26b6('0x7f')];return new BPromise(function(_0x3c6785,_0x39e12e){_0x418c1a(_0x251b1d,_0x15c9a4,_0x4ada4d)[_0x26b6('0x39')](function(_0x15cecf){_0x3c6785(_0x15cecf);})['catch'](function(_0x50a4e8){_0x39e12e(_0x50a4e8);});});}function generateNonce(){return crypto[_0x26b6('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x26b6('0x84')](Date[_0x26b6('0x85')]()/0x3e8)[_0x26b6('0x86')]();}function createJwt(_0x5da3d7){var _0x16d7f9={'payload':{'iat':_0x5da3d7[_0x26b6('0x68')],'nonce':_0x5da3d7[_0x26b6('0x50')]},'options':{'algorithm':_0x26b6('0x87'),'subject':_0x5da3d7['id'][_0x26b6('0x86')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x26b6('0x4a')]()}};return signJwt(_0x16d7f9)[_0x26b6('0x39')](function(_0x5bfba5){return{'iat':_0x5da3d7[_0x26b6('0x68')],'nonce':_0x5da3d7[_0x26b6('0x50')],'token':_0x5bfba5};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 1bbe54d..783aa04 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8f3=['buildContactsQuery','clause','catch','describe','keys','filter','CmCustomField','findOne','slice','all','length','fieldType','map','type','lodash','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','default','fields','where','user','checkListsRestrictions','ids','tag','countFilteredContacts','count'];(function(_0x2795fb,_0x51a015){var _0x30e660=function(_0x3404c0){while(--_0x3404c0){_0x2795fb['push'](_0x2795fb['shift']());}};_0x30e660(++_0x51a015);}(_0xc8f3,0x158));var _0x3c8f=function(_0x2dd786,_0x45efe9){_0x2dd786=_0x2dd786-0x0;var _0x5165f6=_0xc8f3[_0x2dd786];return _0x5165f6;};'use strict';var _=require(_0x3c8f('0x0'));var sqlUtils=require(_0x3c8f('0x1'));var db=require('../../mysqldb')['db'];exports[_0x3c8f('0x2')]=function(_0x536c43,_0x30974b,_0x1aa7dd,_0x26a18e){var _0x2e6209={'count':0x0,'rows':[]};var _0x25cdb3=sqlUtils['skipContactsQuery'](_0x30974b,_0x536c43);if(_0x25cdb3){return Promise[_0x3c8f('0x3')](_0x2e6209);}var _0x3f99b7=sqlUtils['getContactsSubquery']();var _0x45e399={};var _0x15cb42=![];var _0x49607b=![];return Promise[_0x3c8f('0x3')]()[_0x3c8f('0x4')](function(){if(_0x536c43[_0x3c8f('0x5')]){return sqlUtils[_0x3c8f('0x6')](_0x536c43[_0x3c8f('0x5')],_0x26a18e);}else{return sqlUtils['parseQueryParameters'](_0x536c43,_0x26a18e);}})['then'](function(_0x5bb41d){_0x3f99b7['where'](_0x5bb41d[_0x3c8f('0x7')]);_0x3f99b7['where'](_0x5bb41d[_0x3c8f('0x8')]);_0x3f99b7[_0x3c8f('0x9')](_0x5bb41d['filter']);_0x3f99b7['where'](_0x5bb41d[_0x3c8f('0xa')]['clause']);_0x45e399=_0x5bb41d['tags'];_0x49607b=_0x5bb41d['user']['skip'];return sqlUtils[_0x3c8f('0xb')](_0x30974b,_0x536c43,_0x49607b);})['then'](function(_0x2c28fc){_0x3f99b7[_0x3c8f('0x9')](_0x2c28fc);var _0x57419b=_0x536c43[_0x3c8f('0x5')]?_0x45e399[_0x3c8f('0xc')]:_0x536c43[_0x3c8f('0xd')];_0x15cb42=_0x57419b?!![]:![];return sqlUtils[_0x3c8f('0xe')](_0x3f99b7,_0x57419b);})[_0x3c8f('0x4')](function(_0x39f856){_0x2e6209[_0x3c8f('0xf')]=_0x39f856;if(_0x2e6209[_0x3c8f('0xf')]===0x0){return;}if(_0x536c43['User']){_0x49607b=!![];}return sqlUtils[_0x3c8f('0x10')](_0x3f99b7,_0x536c43['fields'],_0x1aa7dd,_0x15cb42,_0x45e399[_0x3c8f('0x11')],_0x49607b);})['then'](function(_0x34c326){if(!_0x34c326){return[];}return sqlUtils['getFilteredContacts'](_0x34c326,_0x536c43,_0x1aa7dd);})[_0x3c8f('0x4')](function(_0x1d670e){_0x2e6209['rows']=_0x1d670e;return _0x2e6209;})[_0x3c8f('0x12')](function(_0x54dd55){throw _0x54dd55;});};exports[_0x3c8f('0x13')]=function(){var _0x3c1b01={};var _0xe78123=[];return db['CmContact']['describe']()[_0x3c8f('0x4')](function(_0x500b07){_0x3c1b01=_0x500b07;var _0xa11b80=Object[_0x3c8f('0x14')](_0x3c1b01)[_0x3c8f('0x15')](function(_0x372db6){return _['startsWith'](_0x372db6,'cf_')?_0x372db6:undefined;});var _0x20430c=_0xa11b80['map'](function(_0x47adea){return db[_0x3c8f('0x16')][_0x3c8f('0x17')]({'where':{'id':_0x47adea[_0x3c8f('0x18')](0x3)},'raw':!![]});});return Promise[_0x3c8f('0x19')](_0x20430c);})[_0x3c8f('0x4')](function(_0x12c2f7){for(var _0x17f460=0x0;_0x17f460<_0x12c2f7[_0x3c8f('0x1a')];_0x17f460++){if(_0x12c2f7[_0x17f460]){var _0xdfefa1='cf_'+_0x12c2f7[_0x17f460]['id'];_0x3c1b01[_0xdfefa1][_0x3c8f('0x1b')]=_0x12c2f7[_0x17f460]['type'];}}_0xe78123=_[_0x3c8f('0x1c')](Object['keys'](_0x3c1b01),function(_0x4ff3d6){return{'name':_0x4ff3d6,'type':_0x3c1b01[_0x4ff3d6][_0x3c8f('0x1d')]};});return _0xe78123;})['catch'](function(_0x24d434){throw _0x24d434;});}; \ No newline at end of file +var _0xf1a3=['resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','where','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','User','getFilteredContacts','catch','describe','CmContact','keys','startsWith','cf_','findOne','slice','all','length','fieldType','map','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery'];(function(_0x4cbde1,_0x5785ec){var _0x37d42=function(_0x318af3){while(--_0x318af3){_0x4cbde1['push'](_0x4cbde1['shift']());}};_0x37d42(++_0x5785ec);}(_0xf1a3,0x10c));var _0x3f1a=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xf1a3[_0x2d982d];return _0x4f36b0;};'use strict';var _=require('lodash');var sqlUtils=require(_0x3f1a('0x0'));var db=require(_0x3f1a('0x1'))['db'];exports[_0x3f1a('0x2')]=function(_0x299974,_0x29ec44,_0x3f9b64,_0x376ef3){var _0xba76e9={'count':0x0,'rows':[]};var _0x24de6c=sqlUtils[_0x3f1a('0x3')](_0x29ec44,_0x299974);if(_0x24de6c){return Promise[_0x3f1a('0x4')](_0xba76e9);}var _0x44376d=sqlUtils[_0x3f1a('0x5')]();var _0x178692={};var _0x1ef872=![];var _0x3a95aa=![];return Promise[_0x3f1a('0x4')]()[_0x3f1a('0x6')](function(){if(_0x299974[_0x3f1a('0x7')]){return sqlUtils[_0x3f1a('0x8')](_0x299974[_0x3f1a('0x7')],_0x376ef3);}else{return sqlUtils['parseQueryParameters'](_0x299974,_0x376ef3);}})[_0x3f1a('0x6')](function(_0x4a835c){_0x44376d[_0x3f1a('0x9')](_0x4a835c['default']);_0x44376d[_0x3f1a('0x9')](_0x4a835c[_0x3f1a('0xa')]);_0x44376d[_0x3f1a('0x9')](_0x4a835c[_0x3f1a('0xb')]);_0x44376d[_0x3f1a('0x9')](_0x4a835c[_0x3f1a('0xc')][_0x3f1a('0xd')]);_0x178692=_0x4a835c['tags'];_0x3a95aa=_0x4a835c[_0x3f1a('0xc')][_0x3f1a('0xe')];return sqlUtils['checkListsRestrictions'](_0x29ec44,_0x299974,_0x3a95aa);})[_0x3f1a('0x6')](function(_0x35e310){_0x44376d['where'](_0x35e310);var _0xf5553f=_0x299974[_0x3f1a('0x7')]?_0x178692[_0x3f1a('0xf')]:_0x299974[_0x3f1a('0x10')];_0x1ef872=_0xf5553f?!![]:![];return sqlUtils[_0x3f1a('0x11')](_0x44376d,_0xf5553f);})[_0x3f1a('0x6')](function(_0x1b2e0e){_0xba76e9[_0x3f1a('0x12')]=_0x1b2e0e;if(_0xba76e9[_0x3f1a('0x12')]===0x0){return;}if(_0x299974[_0x3f1a('0x13')]){_0x3a95aa=!![];}return sqlUtils['buildContactsQuery'](_0x44376d,_0x299974[_0x3f1a('0xa')],_0x3f9b64,_0x1ef872,_0x178692[_0x3f1a('0xd')],_0x3a95aa);})['then'](function(_0x4b6e5a){if(!_0x4b6e5a){return[];}return sqlUtils[_0x3f1a('0x14')](_0x4b6e5a,_0x299974,_0x3f9b64);})['then'](function(_0x27abce){_0xba76e9['rows']=_0x27abce;return _0xba76e9;})[_0x3f1a('0x15')](function(_0x36af81){throw _0x36af81;});};exports[_0x3f1a('0x16')]=function(){var _0x35d541={};var _0x3f0b6f=[];return db[_0x3f1a('0x17')]['describe']()[_0x3f1a('0x6')](function(_0x34a0f1){_0x35d541=_0x34a0f1;var _0x39557f=Object[_0x3f1a('0x18')](_0x35d541)['filter'](function(_0x53c11f){return _[_0x3f1a('0x19')](_0x53c11f,_0x3f1a('0x1a'))?_0x53c11f:undefined;});var _0x27322b=_0x39557f['map'](function(_0x97283a){return db['CmCustomField'][_0x3f1a('0x1b')]({'where':{'id':_0x97283a[_0x3f1a('0x1c')](0x3)},'raw':!![]});});return Promise[_0x3f1a('0x1d')](_0x27322b);})[_0x3f1a('0x6')](function(_0xccd8fa){for(var _0x1d83b2=0x0;_0x1d83b2<_0xccd8fa[_0x3f1a('0x1e')];_0x1d83b2++){if(_0xccd8fa[_0x1d83b2]){var _0x550d1e=_0x3f1a('0x1a')+_0xccd8fa[_0x1d83b2]['id'];_0x35d541[_0x550d1e][_0x3f1a('0x1f')]=_0xccd8fa[_0x1d83b2]['type'];}}_0x3f0b6f=_[_0x3f1a('0x20')](Object[_0x3f1a('0x18')](_0x35d541),function(_0x1b404a){return{'name':_0x1b404a,'type':_0x35d541[_0x1b404a][_0x3f1a('0x21')]};});return _0x3f0b6f;})[_0x3f1a('0x15')](function(_0x1dc9ee){throw _0x1dc9ee;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index cf09a2f..d6d590d 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83ae=['toString','COUNT(*)','squel','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','text','value','start','end','Tag','map','tags','and','ids','User','skip','keys','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','resolve','then','fields','tag','clause','filter','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','subqry.id','order','subqry.','DESC','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','query','Tags','clone','isEmpty','t.id\x20IN\x20?'];(function(_0x2375dd,_0x414f9e){var _0x3f494b=function(_0x14a35c){while(--_0x14a35c){_0x2375dd['push'](_0x2375dd['shift']());}};_0x3f494b(++_0x414f9e);}(_0x83ae,0x1a2));var _0xe83a=function(_0x5559b3,_0x1fea6f){_0x5559b3=_0x5559b3-0x0;var _0x50e522=_0x83ae[_0x5559b3];return _0x50e522;};'use strict';var _=require('lodash');var squel=require(_0xe83a('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0xe83a('0x1'));var utils=require('../interaction/utils');var db=require(_0xe83a('0x2'))['db'];function skipContactsQuery(_0x11eeae,_0x5f1f31){var _0xf846d9=![];if(_0x11eeae[_0xe83a('0x3')]===_0xe83a('0x4')&&!_0x5f1f31[_0xe83a('0x5')]&&!_0x5f1f31[_0xe83a('0x6')]&&_0x5f1f31[_0xe83a('0x7')]!==_0xe83a('0x8')){_0xf846d9=!![];}return _0xf846d9;}function getContactsSubquery(){return squel[_0xe83a('0x9')]()[_0xe83a('0xa')](_0xe83a('0xb'),'c')[_0xe83a('0xc')](_0xe83a('0xd'));}function applyJoinClauses(_0xce5f4c,_0x374401){var _0x343dae=_0x374401?'c':_0xe83a('0xe');_0xce5f4c['left_join'](_0xe83a('0xf'),'uc',_0xe83a('0x10')+_0x343dae+_0xe83a('0x11'))[_0xe83a('0x12')]('cm_contact_has_tags','ct',_0xe83a('0x13')+_0x343dae+_0xe83a('0x11'))[_0xe83a('0x12')]('tools_tags','t',_0xe83a('0x14'));return _0xce5f4c;}function addFieldsToQuery(_0x1758ff,_0x5d71ac,_0x169024,_0x3f171b,_0x398b16){var _0x3cdf56=_0x398b16?'c':'subqry';if(!_0x5d71ac){_0x5d71ac=['id',_0xe83a('0x15'),_0xe83a('0x16'),'phone',_0xe83a('0x17'),'fax',_0xe83a('0x18'),_0xe83a('0x6'),_0xe83a('0x19'),_0xe83a('0x1a'),_0xe83a('0x1b'),_0xe83a('0x1c'),_0xe83a('0x1d')];}else if(!_0x5d71ac[_0xe83a('0x1e')]('id')){_0x5d71ac[_0xe83a('0x1f')]('id');}var _0x80fd6e=_0x169024&&_0x398b16||!_0x169024&&!_0x398b16;if(_0x3f171b){_0x80fd6e=_0x3f171b&&_0x398b16||!_0x3f171b&&!_0x398b16;}_0x5d71ac[_0xe83a('0x20')](function(_0x2b90e5){if(_0x2b90e5===_0xe83a('0x1d')){if(_0x80fd6e){_0x1758ff['field'](_0xe83a('0x21'),_0x2b90e5);}else if(_0x169024||_0x3f171b){_0x1758ff[_0xe83a('0x22')](_0x3cdf56+'.'+_0x2b90e5);}}else{_0x1758ff[_0xe83a('0x22')](_0x3cdf56+'.'+_0x2b90e5);}});return _0x1758ff;}function getSqlClauses(){var _0x2db9b8={'default':squel['expr'](),'fields':squel[_0xe83a('0x23')](),'filter':squel[_0xe83a('0x23')](),'tags':{'clause':squel[_0xe83a('0x23')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x2db9b8;}function parseTagParameter(_0x97f9ba){var _0x83553=squel[_0xe83a('0x23')]();if(_0x97f9ba){var _0x2f6cc4=utils[_0xe83a('0x24')](_0x97f9ba);_0x2f6cc4['forEach'](function(_0x46bf95){_0x83553['or'](_0xe83a('0x25'),'%,'+_0x46bf95+',%');});}return _0x83553;}function parseSearchFilter(_0xd00bb7){var _0x21074f=squel[_0xe83a('0x23')]();if(_0xd00bb7){var _0x4b32a4=_0xd00bb7[_0xe83a('0x26')]('\x5c','\x5c\x5c')[_0xe83a('0x26')](/'/g,'\x27\x27');if(_0x4b32a4[_0xe83a('0x27')]('\x20')[_0xe83a('0x28')]>0x1){_0x21074f['or'](_0xe83a('0x29'),qs[_0xe83a('0x2a')](_0x4b32a4,!![]),null);}else{if(qs['isNumeric'](_0x4b32a4)){_0x21074f['or']('c.id\x20LIKE\x20?',_0x4b32a4+'%');_0x21074f['or'](_0xe83a('0x2b'),_0x4b32a4+'%');_0x21074f['or']('c.mobile\x20LIKE\x20?',_0x4b32a4+'%');_0x21074f['or'](_0xe83a('0x2c'),_0x4b32a4+'%');}else if(qs['isEmail'](_0x4b32a4)){_0x21074f['or'](_0xe83a('0x2d'),_0x4b32a4+'%');}else{_0x21074f['or'](_0xe83a('0x2e'),'%'+_0x4b32a4+'%');_0x21074f['or'](_0xe83a('0x2f'),'%'+_0x4b32a4+'%');_0x21074f['or'](_0xe83a('0x2d'),'%'+_0x4b32a4+'%');}}}return _0x21074f;}function parseAdvancedSearchFilter(_0x35a3af,_0x38f73c){var _0x34bedd=getSqlClauses();var _0x12feab=as[_0xe83a('0x30')](_0x35a3af);var _0x444557=_0x12feab['sqlOperator'];for(var _0x59a37f=0x0;_0x59a37f<_0x12feab[_0xe83a('0x31')][_0xe83a('0x28')];_0x59a37f++){var _0x47583a=_0x12feab[_0xe83a('0x31')][_0x59a37f];var _0x39314b='c';var _0x7fa82c=_['find'](_0x38f73c,[_0xe83a('0x32'),_0x47583a['field']]);if(_0x7fa82c){if(_0x47583a[_0xe83a('0x22')]===_0xe83a('0x33')||_0x7fa82c[_0xe83a('0x34')]===_0xe83a('0x35')){_0x47583a[_0xe83a('0x36')]='DATE';}var _0x3401f7=as[_0xe83a('0x37')](_0x39314b,_0x7fa82c[_0xe83a('0x38')],_0x47583a);_0x34bedd['default'][_0x444557](_0x3401f7[_0xe83a('0x39')],_0x3401f7[_0xe83a('0x3a')][_0xe83a('0x3b')],_0x3401f7['value'][_0xe83a('0x3c')]);}else{if(_0x47583a[_0xe83a('0x22')]===_0xe83a('0x3d')){var _0x48c87c=_0x47583a[_0xe83a('0x3a')][_0xe83a('0x27')](',')[_0xe83a('0x3e')](function(_0x16bdb8){return Number(_0x16bdb8);});var _0x463388=parseTagParameter(_0x48c87c);_0x34bedd[_0xe83a('0x3f')]['clause'][_0xe83a('0x40')](_0x463388);_0x34bedd['tags'][_0xe83a('0x41')]=_0x48c87c;}else if(_0x47583a[_0xe83a('0x22')]===_0xe83a('0x42')){_0x34bedd['user']['clause']['and']('uc.UserId\x20=\x20?',_0x47583a['value']);_0x34bedd['user'][_0xe83a('0x43')]=!![];}}}return _0x34bedd;}function parseModelFields(_0x40a460,_0x86682b){var _0x21cdcf=squel[_0xe83a('0x23')]();var _0x37ff15=_(_0x40a460)[_0xe83a('0x44')]()['map'](function(_0xcd3dde){return _['some'](_0x86682b,[_0xe83a('0x32'),_0xcd3dde])?_0xcd3dde:undefined;})[_0xe83a('0x45')]()['value']();if(_0x40a460[_0xe83a('0x46')]){_0x37ff15[_0xe83a('0x1f')](_0xe83a('0x46'));}if(_0x40a460[_0xe83a('0x42')]){_0x37ff15[_0xe83a('0x1f')](_0xe83a('0x42'));}if(_0x37ff15[_0xe83a('0x28')]>0x0){_0x37ff15[_0xe83a('0x20')](function(_0x17b777){if(_0x17b777==='ListId'){_0x21cdcf[_0xe83a('0x40')](_0xe83a('0x47'),[][_0xe83a('0x48')](_0x40a460[_0x17b777]));}else if(_0x17b777==='Contact'){var _0x2a7503='%'+_0x40a460[_0x17b777]+'%';_0x21cdcf['and'](_0xe83a('0x49'),_0x2a7503);}else if(_0x17b777===_0xe83a('0x42')){_0x21cdcf[_0xe83a('0x40')](_0xe83a('0x4a'),_0x40a460[_0x17b777]);}else{_0x21cdcf[_0xe83a('0x40')]('c.'+_0x17b777+'\x20=\x20?',_0x40a460[_0x17b777]);}});}return _0x21cdcf;}function parseQueryParameters(_0x45f771,_0x1c0583){var _0x13454c=getSqlClauses();return Promise[_0xe83a('0x4b')]()[_0xe83a('0x4c')](function(){return parseModelFields(_0x45f771,_0x1c0583);})[_0xe83a('0x4c')](function(_0x4184a6){_0x13454c[_0xe83a('0x4d')][_0xe83a('0x40')](_0x4184a6);return parseTagParameter(_0x45f771[_0xe83a('0x4e')]);})[_0xe83a('0x4c')](function(_0x325a3a){_0x13454c[_0xe83a('0x3f')][_0xe83a('0x4f')]['and'](_0x325a3a);return parseSearchFilter(_0x45f771[_0xe83a('0x50')]);})[_0xe83a('0x4c')](function(_0x5b20e5){_0x13454c[_0xe83a('0x50')]=_0x5b20e5;return _0x13454c;});}function checkListsRestrictions(_0x5299ec,_0x430bb1,_0x431658){var _0x2d8c0e=squel[_0xe83a('0x23')]();return Promise[_0xe83a('0x4b')]()['then'](function(){if(_0x430bb1[_0xe83a('0x5')]&&_0x5299ec['role']==='agent'&&!_0x431658){return _0x5299ec['getLists']({'attributes':['id'],'raw':!![]});}})[_0xe83a('0x4c')](function(_0x4cf14d){if(_0x4cf14d){if(_0x4cf14d[_0xe83a('0x28')]===0x0){_0x2d8c0e['and'](_0xe83a('0x51'));}else{_0x2d8c0e[_0xe83a('0x40')](_0xe83a('0x47'),_['map'](_0x4cf14d,'id'));}}})[_0xe83a('0x4c')](function(){return _0x2d8c0e;});}function buildContactsQuery(_0x4abd00,_0x3364a3,_0x55d13e,_0x596fc5,_0x594582,_0x226234){if(_0x3364a3){_0x3364a3=_0x55d13e[_0xe83a('0x52')];}_0x4abd00=addFieldsToQuery(_0x4abd00,_0x3364a3,_0x596fc5,_0x226234,!![]);var _0x468054=squel[_0xe83a('0x9')]();_0x468054=addFieldsToQuery(_0x468054,_0x3364a3,_0x596fc5,_0x226234,![]);if(_0x596fc5||_0x226234){_0x4abd00=applyJoinClauses(_0x4abd00,!![]);_0x4abd00['group'](_0xe83a('0x53'));if(_0x55d13e[_0xe83a('0x54')]){_0x468054[_0xe83a('0x54')](_0x55d13e[_0xe83a('0x54')]);}if(_0x55d13e[_0xe83a('0x55')]){_0x468054[_0xe83a('0x55')](_0x55d13e['offset']);}}else{_0x468054=applyJoinClauses(_0x468054,![]);_0x468054[_0xe83a('0x56')](_0xe83a('0x57'));if(_0x55d13e['limit']){_0x4abd00[_0xe83a('0x54')](_0x55d13e['limit']);}if(_0x55d13e[_0xe83a('0x55')]){_0x4abd00['offset'](_0x55d13e[_0xe83a('0x55')]);}}_0x468054['having'](_0x594582);if(_0x55d13e[_0xe83a('0x58')]){_0x55d13e['order']['forEach'](function(_0x370a35){_0x4abd00['order']('c.'+_0x370a35[0x0],_0x370a35[0x1]==='DESC'?![]:!![]);_0x468054[_0xe83a('0x58')](_0xe83a('0x59')+_0x370a35[0x0],_0x370a35[0x1]===_0xe83a('0x5a')?![]:!![]);});}_0x468054[_0xe83a('0xa')](_0x4abd00,_0xe83a('0xe'));return _0x468054;}function getFilteredContacts(_0x383790){var _0x5413f2=[];return db[_0xe83a('0x3d')]['findAll']({'attributes':['id',_0xe83a('0x32'),_0xe83a('0x5b')],'raw':!![]})['then'](function(_0x2dafd5){_0x5413f2=_[_0xe83a('0x5c')](_0x2dafd5,'id');var _0x5d45b1={'type':db[_0xe83a('0x5d')][_0xe83a('0x5e')][_0xe83a('0x5f')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xe83a('0x60')][_0xe83a('0x61')](_0x383790['toString'](),_0x5d45b1);})[_0xe83a('0x4c')](function(_0x515bc6){_0x515bc6[_0xe83a('0x20')](function(_0x338788){if(_0x338788[_0xe83a('0x1d')]){_0x338788['Tags']=[];_0x338788[_0xe83a('0x1d')][_0xe83a('0x27')](',')['forEach'](function(_0x3b8098){_0x338788[_0xe83a('0x62')][_0xe83a('0x1f')](_0x5413f2[_0x3b8098]);});}delete _0x338788[_0xe83a('0x1d')];});return _0x515bc6;});}function countFilteredContacts(_0x4deacf,_0xe134b0){var _0x207e0e=_0x4deacf[_0xe83a('0x63')]();_0x207e0e[_0xe83a('0x22')]('COUNT(*)');_0x207e0e=applyJoinClauses(_0x207e0e,!![]);_0x4deacf['group'](_0xe83a('0x53'));var _0x39e7f3=utils[_0xe83a('0x24')](_0xe134b0);if(!_[_0xe83a('0x64')](_0x39e7f3)){_0x207e0e[_0xe83a('0xc')](_0xe83a('0x65'),_0x39e7f3);}var _0x530f94={'type':db[_0xe83a('0x5d')][_0xe83a('0x5e')][_0xe83a('0x5f')],'raw':!![]};return db[_0xe83a('0x60')][_0xe83a('0x61')](_0x207e0e[_0xe83a('0x66')](),_0x530f94)['then'](function(_0x2eb134){return _0x2eb134[0x0][_0xe83a('0x67')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x3356=['c.deletedAt\x20IS\x20NULL','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','left_join','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','ListId','CompanyId','createdAt','updatedAt','TagIds','includes','push','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','DATE','buildExpression','type','text','value','start','end','Tag','split','map','tags','clause','and','ids','User','user','skip','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.id','limit','offset','group','subqry.id','having','order','DESC','subqry.','findAll','keyBy','Sequelize','QueryTypes','CmContact','sequelize','toString','Tags','clone','t.id\x20IN\x20?','SELECT','query','COUNT(*)','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','autocomplete','true','select','from','cm_contacts','where'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x3356,0x19c));var _0x6335=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3356[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x6335('0x0'));var qs=require(_0x6335('0x1'));var utils=require('../interaction/utils');var db=require(_0x6335('0x2'))['db'];function skipContactsQuery(_0x3fbd41,_0x52ac38){var _0xb4ca6f=![];if(_0x3fbd41[_0x6335('0x3')]===_0x6335('0x4')&&!_0x52ac38[_0x6335('0x5')]&&!_0x52ac38['ListId']&&_0x52ac38[_0x6335('0x6')]!==_0x6335('0x7')){_0xb4ca6f=!![];}return _0xb4ca6f;}function getContactsSubquery(){return squel[_0x6335('0x8')]()[_0x6335('0x9')](_0x6335('0xa'),'c')[_0x6335('0xb')](_0x6335('0xc'));}function applyJoinClauses(_0x3223b4,_0x3730fd){var _0x85d6d=_0x3730fd?'c':'subqry';_0x3223b4['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x85d6d+_0x6335('0xd'))['left_join'](_0x6335('0xe'),'ct',_0x6335('0xf')+_0x85d6d+'.id')[_0x6335('0x10')](_0x6335('0x11'),'t',_0x6335('0x12'));return _0x3223b4;}function addFieldsToQuery(_0x28ab08,_0x2a054d,_0x10b778,_0x3d3e08,_0x55d110){var _0x20440b=_0x55d110?'c':_0x6335('0x13');if(!_0x2a054d){_0x2a054d=['id',_0x6335('0x14'),_0x6335('0x15'),_0x6335('0x16'),_0x6335('0x17'),_0x6335('0x18'),_0x6335('0x19'),_0x6335('0x1a'),_0x6335('0x1b'),_0x6335('0x1c'),_0x6335('0x1d'),'deletedAt',_0x6335('0x1e')];}else if(!_0x2a054d[_0x6335('0x1f')]('id')){_0x2a054d[_0x6335('0x20')]('id');}var _0x2f0f71=_0x10b778&&_0x55d110||!_0x10b778&&!_0x55d110;if(_0x3d3e08){_0x2f0f71=_0x3d3e08&&_0x55d110||!_0x3d3e08&&!_0x55d110;}_0x2a054d['forEach'](function(_0x3d9539){if(_0x3d9539===_0x6335('0x1e')){if(_0x2f0f71){_0x28ab08[_0x6335('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3d9539);}else if(_0x10b778||_0x3d3e08){_0x28ab08[_0x6335('0x21')](_0x20440b+'.'+_0x3d9539);}}else{_0x28ab08[_0x6335('0x21')](_0x20440b+'.'+_0x3d9539);}});return _0x28ab08;}function getSqlClauses(){var _0x20261f={'default':squel[_0x6335('0x22')](),'fields':squel['expr'](),'filter':squel[_0x6335('0x22')](),'tags':{'clause':squel[_0x6335('0x22')](),'ids':null},'user':{'clause':squel[_0x6335('0x22')](),'skip':![]}};return _0x20261f;}function parseTagParameter(_0x51d8aa){var _0x1b4c1c=squel[_0x6335('0x22')]();if(_0x51d8aa){var _0x53bbd6=utils[_0x6335('0x23')](_0x51d8aa);_0x53bbd6[_0x6335('0x24')](function(_0x16eb5f){_0x1b4c1c['or'](_0x6335('0x25'),'%,'+_0x16eb5f+',%');});}return _0x1b4c1c;}function parseSearchFilter(_0x401ef0){var _0x501459=squel[_0x6335('0x22')]();if(_0x401ef0){var _0x2f3545=_0x401ef0[_0x6335('0x26')]('\x5c','\x5c\x5c')[_0x6335('0x26')](/'/g,'\x27\x27');if(_0x2f3545['split']('\x20')[_0x6335('0x27')]>0x1){_0x501459['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6335('0x28')](_0x2f3545,!![]),null);}else{if(qs['isNumeric'](_0x2f3545)){_0x501459['or'](_0x6335('0x29'),_0x2f3545+'%');_0x501459['or'](_0x6335('0x2a'),_0x2f3545+'%');_0x501459['or'](_0x6335('0x2b'),_0x2f3545+'%');_0x501459['or']('c.fax\x20LIKE\x20?',_0x2f3545+'%');}else if(qs[_0x6335('0x2c')](_0x2f3545)){_0x501459['or']('c.email\x20LIKE\x20?',_0x2f3545+'%');}else{_0x501459['or'](_0x6335('0x2d'),'%'+_0x2f3545+'%');_0x501459['or']('c.lastName\x20LIKE\x20?','%'+_0x2f3545+'%');_0x501459['or'](_0x6335('0x2e'),'%'+_0x2f3545+'%');}}}return _0x501459;}function parseAdvancedSearchFilter(_0x4ba680,_0x72c5f8){var _0x172fa9=getSqlClauses();var _0xe423cb=as[_0x6335('0x2f')](_0x4ba680);var _0x29de65=_0xe423cb[_0x6335('0x30')];for(var _0x1a6086=0x0;_0x1a6086<_0xe423cb[_0x6335('0x31')][_0x6335('0x27')];_0x1a6086++){var _0x602818=_0xe423cb[_0x6335('0x31')][_0x1a6086];var _0x58d1ea='c';var _0x25b4d6=_[_0x6335('0x32')](_0x72c5f8,[_0x6335('0x33'),_0x602818['field']]);if(_0x25b4d6){if(_0x602818['field']===_0x6335('0x34')||_0x25b4d6[_0x6335('0x35')]==='datetime'){_0x602818['castTo']=_0x6335('0x36');}var _0x29b5fd=as[_0x6335('0x37')](_0x58d1ea,_0x25b4d6[_0x6335('0x38')],_0x602818);_0x172fa9['default'][_0x29de65](_0x29b5fd[_0x6335('0x39')],_0x29b5fd[_0x6335('0x3a')][_0x6335('0x3b')],_0x29b5fd[_0x6335('0x3a')][_0x6335('0x3c')]);}else{if(_0x602818['field']===_0x6335('0x3d')){var _0x431859=_0x602818[_0x6335('0x3a')][_0x6335('0x3e')](',')[_0x6335('0x3f')](function(_0x2f0669){return Number(_0x2f0669);});var _0x34615b=parseTagParameter(_0x431859);_0x172fa9[_0x6335('0x40')][_0x6335('0x41')][_0x6335('0x42')](_0x34615b);_0x172fa9[_0x6335('0x40')][_0x6335('0x43')]=_0x431859;}else if(_0x602818[_0x6335('0x21')]===_0x6335('0x44')){_0x172fa9[_0x6335('0x45')][_0x6335('0x41')][_0x6335('0x42')]('uc.UserId\x20=\x20?',_0x602818[_0x6335('0x3a')]);_0x172fa9[_0x6335('0x45')][_0x6335('0x46')]=!![];}}}return _0x172fa9;}function parseModelFields(_0xb05229,_0x5b4783){var _0x39822d=squel[_0x6335('0x22')]();var _0x5f4372=_(_0xb05229)['keys']()[_0x6335('0x3f')](function(_0x30d5cd){return _['some'](_0x5b4783,[_0x6335('0x33'),_0x30d5cd])?_0x30d5cd:undefined;})['compact']()[_0x6335('0x3a')]();if(_0xb05229[_0x6335('0x47')]){_0x5f4372[_0x6335('0x20')]('Contact');}if(_0xb05229['User']){_0x5f4372[_0x6335('0x20')]('User');}if(_0x5f4372[_0x6335('0x27')]>0x0){_0x5f4372[_0x6335('0x24')](function(_0x1a09ed){if(_0x1a09ed==='ListId'){_0x39822d[_0x6335('0x42')](_0x6335('0x48'),[][_0x6335('0x49')](_0xb05229[_0x1a09ed]));}else if(_0x1a09ed==='Contact'){var _0xb0448f='%'+_0xb05229[_0x1a09ed]+'%';_0x39822d[_0x6335('0x42')](_0x6335('0x4a'),_0xb0448f);}else if(_0x1a09ed===_0x6335('0x44')){_0x39822d['and'](_0x6335('0x4b'),_0xb05229[_0x1a09ed]);}else{_0x39822d[_0x6335('0x42')]('c.'+_0x1a09ed+_0x6335('0x4c'),_0xb05229[_0x1a09ed]);}});}return _0x39822d;}function parseQueryParameters(_0x44a3de,_0x1861ac){var _0x42bc01=getSqlClauses();return Promise[_0x6335('0x4d')]()['then'](function(){return parseModelFields(_0x44a3de,_0x1861ac);})[_0x6335('0x4e')](function(_0x4908b1){_0x42bc01[_0x6335('0x4f')][_0x6335('0x42')](_0x4908b1);return parseTagParameter(_0x44a3de[_0x6335('0x50')]);})[_0x6335('0x4e')](function(_0x56c8da){_0x42bc01[_0x6335('0x40')][_0x6335('0x41')][_0x6335('0x42')](_0x56c8da);return parseSearchFilter(_0x44a3de[_0x6335('0x51')]);})[_0x6335('0x4e')](function(_0x177398){_0x42bc01[_0x6335('0x51')]=_0x177398;return _0x42bc01;});}function checkListsRestrictions(_0x3a6e1a,_0x56d513,_0x30bd8e){var _0x55d7a8=squel[_0x6335('0x22')]();return Promise[_0x6335('0x4d')]()[_0x6335('0x4e')](function(){if(_0x56d513['search']&&_0x3a6e1a[_0x6335('0x3')]===_0x6335('0x4')&&!_0x30bd8e){return _0x3a6e1a[_0x6335('0x52')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4d83a2){if(_0x4d83a2){if(_0x4d83a2['length']===0x0){_0x55d7a8[_0x6335('0x42')](_0x6335('0x53'));}else{_0x55d7a8[_0x6335('0x42')](_0x6335('0x48'),_[_0x6335('0x3f')](_0x4d83a2,'id'));}}})[_0x6335('0x4e')](function(){return _0x55d7a8;});}function buildContactsQuery(_0x284da5,_0x43a4de,_0x124032,_0x3cea72,_0x5acad3,_0x5ba4ab){if(_0x43a4de){_0x43a4de=_0x124032['attributes'];}_0x284da5=addFieldsToQuery(_0x284da5,_0x43a4de,_0x3cea72,_0x5ba4ab,!![]);var _0x3bb0b1=squel[_0x6335('0x8')]();_0x3bb0b1=addFieldsToQuery(_0x3bb0b1,_0x43a4de,_0x3cea72,_0x5ba4ab,![]);if(_0x3cea72||_0x5ba4ab){_0x284da5=applyJoinClauses(_0x284da5,!![]);_0x284da5['group'](_0x6335('0x54'));if(_0x124032[_0x6335('0x55')]){_0x3bb0b1['limit'](_0x124032[_0x6335('0x55')]);}if(_0x124032[_0x6335('0x56')]){_0x3bb0b1['offset'](_0x124032['offset']);}}else{_0x3bb0b1=applyJoinClauses(_0x3bb0b1,![]);_0x3bb0b1[_0x6335('0x57')](_0x6335('0x58'));if(_0x124032[_0x6335('0x55')]){_0x284da5[_0x6335('0x55')](_0x124032[_0x6335('0x55')]);}if(_0x124032[_0x6335('0x56')]){_0x284da5[_0x6335('0x56')](_0x124032['offset']);}}_0x3bb0b1[_0x6335('0x59')](_0x5acad3);if(_0x124032['order']){_0x124032[_0x6335('0x5a')]['forEach'](function(_0x245d71){_0x284da5[_0x6335('0x5a')]('c.'+_0x245d71[0x0],_0x245d71[0x1]===_0x6335('0x5b')?![]:!![]);_0x3bb0b1[_0x6335('0x5a')](_0x6335('0x5c')+_0x245d71[0x0],_0x245d71[0x1]===_0x6335('0x5b')?![]:!![]);});}_0x3bb0b1['from'](_0x284da5,_0x6335('0x13'));return _0x3bb0b1;}function getFilteredContacts(_0x1e0ca3){var _0x2ee7f9=[];return db['Tag'][_0x6335('0x5d')]({'attributes':['id',_0x6335('0x33'),'color'],'raw':!![]})[_0x6335('0x4e')](function(_0x5e53f9){_0x2ee7f9=_[_0x6335('0x5e')](_0x5e53f9,'id');var _0x48a194={'type':db[_0x6335('0x5f')][_0x6335('0x60')]['SELECT'],'model':db[_0x6335('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x6335('0x62')]['query'](_0x1e0ca3[_0x6335('0x63')](),_0x48a194);})[_0x6335('0x4e')](function(_0x498395){_0x498395[_0x6335('0x24')](function(_0x1d3a00){if(_0x1d3a00['TagIds']){_0x1d3a00[_0x6335('0x64')]=[];_0x1d3a00[_0x6335('0x1e')][_0x6335('0x3e')](',')[_0x6335('0x24')](function(_0x89b2cf){_0x1d3a00[_0x6335('0x64')][_0x6335('0x20')](_0x2ee7f9[_0x89b2cf]);});}delete _0x1d3a00[_0x6335('0x1e')];});return _0x498395;});}function countFilteredContacts(_0x4958c8,_0xc0bb87){var _0x5c1c79=_0x4958c8[_0x6335('0x65')]();_0x5c1c79['field']('COUNT(*)');_0x5c1c79=applyJoinClauses(_0x5c1c79,!![]);_0x4958c8[_0x6335('0x57')](_0x6335('0x54'));var _0x5c725e=utils[_0x6335('0x23')](_0xc0bb87);if(!_['isEmpty'](_0x5c725e)){_0x5c1c79[_0x6335('0xb')](_0x6335('0x66'),_0x5c725e);}var _0x190435={'type':db[_0x6335('0x5f')][_0x6335('0x60')][_0x6335('0x67')],'raw':!![]};return db[_0x6335('0x62')][_0x6335('0x68')](_0x5c1c79['toString'](),_0x190435)[_0x6335('0x4e')](function(_0x2b4779){return _0x2b4779[0x0][_0x6335('0x69')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 527597c..9d636b6 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 _0xeaf9=['createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','base64','utf8','crypto','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeaf9,0xd7));var _0x9eaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeaf9[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x9eaf('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x9eaf('0x1'));var config=require(_0x9eaf('0x2'));var logger=require(_0x9eaf('0x3'))(_0x9eaf('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x9eaf('0x5')};const fileOptions={'algorithm':_0x9eaf('0x6')};if(config[_0x9eaf('0x7')]&&config[_0x9eaf('0x7')][_0x9eaf('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x9eaf('0x7')][_0x9eaf('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9eaf('0x9')](',\x20');logger['error'](config[_0x9eaf('0x7')][_0x9eaf('0x8')],_0x9eaf('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x541237){return AES_SUPPORTED_RX[_0x9eaf('0xb')](_0x541237);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x9eaf('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x3882b5){return getSupportedCiphers()[_0x9eaf('0xd')](_0x3882b5)>-0x1;}function combineOptions(_0x5abe8f){var _0x1e9dc5={};for(var _0x88ed73 in fileOptions){if(fileOptions[_0x9eaf('0xe')](_0x88ed73)){_0x1e9dc5[_0x88ed73]=fileOptions[_0x88ed73];}}if(_0x5abe8f){for(var _0x13d91c in _0x5abe8f){if(_0x5abe8f[_0x9eaf('0xe')](_0x13d91c)){_0x1e9dc5[_0x13d91c]=_0x5abe8f[_0x13d91c];}}}return _0x1e9dc5;}exports[_0x9eaf('0xf')]=function(_0x4b8d32,_0x257b80,_0x3cc502,_0x1f068d){return new BPromise(function(_0xcae87c,_0x2e5412){_0x1f068d=combineOptions(_0x1f068d);var _0x26d09d=new Buffer(_0x3cc502);var _0xcf9065=fs[_0x9eaf('0x10')](_0x4b8d32);var _0x1161cf=fs[_0x9eaf('0x11')](_0x257b80);var _0x4ce7e9=crypto[_0x9eaf('0x12')](_0x1f068d[_0x9eaf('0x8')],_0x26d09d);_0xcf9065['on'](_0x9eaf('0x13'),function(_0x4dfd07){var _0x32f0ef=new Buffer(_0x4ce7e9[_0x9eaf('0x14')](_0x4dfd07),_0x9eaf('0x15'));_0x1161cf[_0x9eaf('0x16')](_0x32f0ef);});_0xcf9065['on'](_0x9eaf('0x17'),function(){try{var _0x476597=new Buffer(_0x4ce7e9[_0x9eaf('0x18')](_0x9eaf('0x15')),_0x9eaf('0x15'));_0x1161cf['write'](_0x476597);_0x1161cf[_0x9eaf('0x17')]();_0x1161cf['on'](_0x9eaf('0x19'),function(){return _0xcae87c(_0x257b80);});}catch(_0x54e7a8){fs[_0x9eaf('0x1a')](_0x257b80);return _0x2e5412(_0x54e7a8);}});});};exports[_0x9eaf('0x1b')]=function(_0x4be1d1,_0x18581f,_0xea17e5,_0x9dbdd9){return new BPromise(function(_0x5799eb,_0x35f1da){_0x9dbdd9=combineOptions(_0x9dbdd9);var _0x1a625c=new Buffer(_0xea17e5);var _0x1458c9=fs[_0x9eaf('0x10')](_0x4be1d1);var _0x2446a0=fs[_0x9eaf('0x11')](_0x18581f);var _0x1ef650=crypto[_0x9eaf('0x1c')](_0x9dbdd9[_0x9eaf('0x8')],_0x1a625c);_0x1458c9['on'](_0x9eaf('0x13'),function(_0x1fc5e5){var _0x45cf6b=new Buffer(_0x1ef650[_0x9eaf('0x14')](_0x1fc5e5),_0x9eaf('0x15'));_0x2446a0[_0x9eaf('0x16')](_0x45cf6b);});_0x1458c9['on'](_0x9eaf('0x17'),function(){try{var _0x43d9cd=new Buffer(_0x1ef650['final'](_0x9eaf('0x15')),_0x9eaf('0x15'));_0x2446a0[_0x9eaf('0x16')](_0x43d9cd);_0x2446a0[_0x9eaf('0x17')]();_0x2446a0['on']('close',function(){return _0x5799eb(_0x18581f);});}catch(_0x2fd590){fs[_0x9eaf('0x1a')](_0x18581f);return _0x35f1da(_0x2fd590);}});});};exports[_0x9eaf('0x1d')]=function(_0x21766c,_0x3b2d87,_0x3e582c){var _0x1c934c=_0x3e582c||stringOptions[_0x9eaf('0x8')];var _0x26a10d=_0x3b2d87||stringOptions[_0x9eaf('0x1e')];var _0x76253e=crypto[_0x9eaf('0x12')](_0x1c934c,_0x26a10d);var _0x539880=_0x76253e[_0x9eaf('0x14')](_0x21766c,'utf8',_0x9eaf('0x1f'));_0x539880+=_0x76253e[_0x9eaf('0x18')]('base64');return _0x539880;};exports['decryptString']=function(_0x21001c,_0x2a5920,_0x3acdb3){var _0x1b8b98=_0x3acdb3||stringOptions['algorithm'];var _0x571833=_0x2a5920||stringOptions[_0x9eaf('0x1e')];var _0xa65cca=crypto[_0x9eaf('0x1c')](_0x1b8b98,_0x571833);var _0x4d059d=_0xa65cca[_0x9eaf('0x14')](_0x21001c,_0x9eaf('0x1f'),_0x9eaf('0x20'));_0x4d059d+=_0xa65cca[_0x9eaf('0x18')]('utf8');return _0x4d059d;}; \ No newline at end of file +var _0x8d5f=['data','update','write','end','binary','close','decryptFile','createWriteStream','createDecipher','unlink','secret','base64','final','utf8','crypto','bluebird','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8d5f,0x184));var _0xf8d5=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0x8d5f[_0x453e2b];return _0x50f306;};'use strict';var crypto=require(_0xf8d5('0x0'));var fs=require('fs');var BPromise=require(_0xf8d5('0x1'));var _=require('lodash');var config=require(_0xf8d5('0x2'));var logger=require(_0xf8d5('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf8d5('0x4')][_0xf8d5('0x5')],'algorithm':_0xf8d5('0x6')};const fileOptions={'algorithm':_0xf8d5('0x7')};if(config[_0xf8d5('0x8')]&&config[_0xf8d5('0x8')][_0xf8d5('0x9')]){var isSupported=isAlgorithmSupported(config[_0xf8d5('0x8')]['algorithm']);if(isSupported){fileOptions[_0xf8d5('0x9')]=config[_0xf8d5('0x8')][_0xf8d5('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf8d5('0xa')](',\x20');logger[_0xf8d5('0xb')](config[_0xf8d5('0x8')][_0xf8d5('0x9')],_0xf8d5('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x275055){return AES_SUPPORTED_RX[_0xf8d5('0xd')](_0x275055);}function getSupportedCiphers(){return crypto[_0xf8d5('0xe')]()[_0xf8d5('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x1dbcba){return getSupportedCiphers()[_0xf8d5('0x10')](_0x1dbcba)>-0x1;}function combineOptions(_0x1a000f){var _0x581a72={};for(var _0x151fa7 in fileOptions){if(fileOptions[_0xf8d5('0x11')](_0x151fa7)){_0x581a72[_0x151fa7]=fileOptions[_0x151fa7];}}if(_0x1a000f){for(var _0x17473a in _0x1a000f){if(_0x1a000f[_0xf8d5('0x11')](_0x17473a)){_0x581a72[_0x17473a]=_0x1a000f[_0x17473a];}}}return _0x581a72;}exports[_0xf8d5('0x12')]=function(_0x5b9d7f,_0x4339fd,_0x42f747,_0x4ce91c){return new BPromise(function(_0x502199,_0x559f1f){_0x4ce91c=combineOptions(_0x4ce91c);var _0x5072da=new Buffer(_0x42f747);var _0x77873=fs['createReadStream'](_0x5b9d7f);var _0x102504=fs['createWriteStream'](_0x4339fd);var _0x40cd99=crypto[_0xf8d5('0x13')](_0x4ce91c[_0xf8d5('0x9')],_0x5072da);_0x77873['on'](_0xf8d5('0x14'),function(_0x5c5b46){var _0x9d4277=new Buffer(_0x40cd99[_0xf8d5('0x15')](_0x5c5b46),'binary');_0x102504[_0xf8d5('0x16')](_0x9d4277);});_0x77873['on'](_0xf8d5('0x17'),function(){try{var _0x1c4217=new Buffer(_0x40cd99['final'](_0xf8d5('0x18')),_0xf8d5('0x18'));_0x102504[_0xf8d5('0x16')](_0x1c4217);_0x102504[_0xf8d5('0x17')]();_0x102504['on'](_0xf8d5('0x19'),function(){return _0x502199(_0x4339fd);});}catch(_0x35ac40){fs['unlink'](_0x4339fd);return _0x559f1f(_0x35ac40);}});});};exports[_0xf8d5('0x1a')]=function(_0x5d57dd,_0x583423,_0x34660a,_0x2abfef){return new BPromise(function(_0x42e483,_0xb97478){_0x2abfef=combineOptions(_0x2abfef);var _0x5bff89=new Buffer(_0x34660a);var _0x56505a=fs['createReadStream'](_0x5d57dd);var _0x132bf3=fs[_0xf8d5('0x1b')](_0x583423);var _0x2691d7=crypto[_0xf8d5('0x1c')](_0x2abfef['algorithm'],_0x5bff89);_0x56505a['on'](_0xf8d5('0x14'),function(_0x4734e9){var _0x29b793=new Buffer(_0x2691d7['update'](_0x4734e9),'binary');_0x132bf3[_0xf8d5('0x16')](_0x29b793);});_0x56505a['on'](_0xf8d5('0x17'),function(){try{var _0x3cd16a=new Buffer(_0x2691d7['final']('binary'),_0xf8d5('0x18'));_0x132bf3[_0xf8d5('0x16')](_0x3cd16a);_0x132bf3[_0xf8d5('0x17')]();_0x132bf3['on'](_0xf8d5('0x19'),function(){return _0x42e483(_0x583423);});}catch(_0x534fb6){fs[_0xf8d5('0x1d')](_0x583423);return _0xb97478(_0x534fb6);}});});};exports['encryptString']=function(_0x3975b7,_0x378d7e,_0x12ee68){var _0x15cd6f=_0x12ee68||stringOptions['algorithm'];var _0x333efe=_0x378d7e||stringOptions[_0xf8d5('0x1e')];var _0x15fec0=crypto[_0xf8d5('0x13')](_0x15cd6f,_0x333efe);var _0x228290=_0x15fec0[_0xf8d5('0x15')](_0x3975b7,'utf8',_0xf8d5('0x1f'));_0x228290+=_0x15fec0[_0xf8d5('0x20')](_0xf8d5('0x1f'));return _0x228290;};exports['decryptString']=function(_0x2d2102,_0x581718,_0x4f8e70){var _0x5d990a=_0x4f8e70||stringOptions['algorithm'];var _0x2cde81=_0x581718||stringOptions[_0xf8d5('0x1e')];var _0x36d0a9=crypto[_0xf8d5('0x1c')](_0x5d990a,_0x2cde81);var _0x960f50=_0x36d0a9['update'](_0x2d2102,_0xf8d5('0x1f'),_0xf8d5('0x21'));_0x960f50+=_0x36d0a9[_0xf8d5('0x20')](_0xf8d5('0x21'));return _0x960f50;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 796eb84..5c4da49 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 _0xe072=['num','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','info','CSV','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','format','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x43c7c9,_0x2fe600){var _0x303f38=function(_0xee16e1){while(--_0xee16e1){_0x43c7c9['push'](_0x43c7c9['shift']());}};_0x303f38(++_0x2fe600);}(_0xe072,0x14b));var _0x2e07=function(_0x126ff6,_0x55acb4){_0x126ff6=_0x126ff6-0x0;var _0x5b9762=_0xe072[_0x126ff6];return _0x5b9762;};'use strict';var util=require(_0x2e07('0x0'));var path=require('path');var _=require(_0x2e07('0x1'));var csv=require(_0x2e07('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x2e07('0x3'));var rimraf=require(_0x2e07('0x4'));var db=require(_0x2e07('0x5'))['db'];var dbH=require(_0x2e07('0x5'))[_0x2e07('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2e07('0x7')][0x2]);var QUERY=process[_0x2e07('0x7')][0x3];var PATH=process[_0x2e07('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b8da6,_0x252be5){var _0x52fb12={'status':_0x2b8da6};var _0x3d95aa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x252be5){_0x52fb12[_0x2e07('0x8')]=_0x252be5;}return db[_0x2e07('0x9')][_0x2e07('0xa')](_0x52fb12,_0x3d95aa);}function main(){var _0x23d21c=0x1388;var _0x4e4be7;logger['info'](util[_0x2e07('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x2e07('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2e07('0xd'),_0x2e07('0xe')]})['then'](function(_0x133702){if(_0x133702){_0x4e4be7=_0x133702;_0x23d21c=_0x4e4be7[_0x2e07('0xe')]||0x1388;}})[_0x2e07('0xf')](function(){return dbH[_0x2e07('0x10')][_0x2e07('0x11')](util[_0x2e07('0xb')](_0x2e07('0x12'),QUERY),{'type':dbH[_0x2e07('0x10')][_0x2e07('0x13')][_0x2e07('0x14')]});})['then'](function(_0x37d11f){if(!_0x37d11f[0x0][_0x2e07('0x15')]){return analyticExtractedReport('Empty');}var _0x38f73a=[];var _0x57e24b=0x0;if(_0x4e4be7['split']){if(_0x37d11f&&_0x37d11f[_0x2e07('0x16')]){var _0x59e0a4=_[_0x2e07('0x17')](_0x37d11f[0x0][_0x2e07('0x15')]/_0x23d21c);var _0x4f5b05=Number['isInteger'](_0x37d11f[0x0][_0x2e07('0x15')]/_0x23d21c)?_0x37d11f[0x0]['num']%_0x23d21c:0x0;_0x59e0a4['forEach'](function(_0x26d9e4){if(_0x26d9e4>0x0){_0x57e24b+=_0x23d21c;}_0x38f73a[_0x2e07('0x18')](dbH[_0x2e07('0x10')][_0x2e07('0x11')](util[_0x2e07('0xb')](_0x2e07('0x19'),QUERY,_0x23d21c,_0x57e24b),{'type':dbH['sequelize'][_0x2e07('0x13')][_0x2e07('0x14')]}));});if(_0x4f5b05>0x0){_0x57e24b+=_0x23d21c;_0x38f73a['push'](dbH[_0x2e07('0x10')][_0x2e07('0x11')](util[_0x2e07('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f5b05,_0x57e24b),{'type':dbH['sequelize'][_0x2e07('0x13')][_0x2e07('0x14')]}));}}}else{_0x38f73a[_0x2e07('0x18')](dbH['sequelize'][_0x2e07('0x11')](QUERY,{'type':dbH[_0x2e07('0x10')][_0x2e07('0x13')]['SELECT']}));}var _0x4b2730=path['dirname'](PATH);var _0x162cfc=path[_0x2e07('0x1a')](PATH,_0x2e07('0x1b'));var _0xf36274=_0x4e4be7['split']&&_0x38f73a['length']>0x1;var _0x41c0b9=[];if(!fs[_0x2e07('0x1c')](path[_0x2e07('0x1d')](_0x4b2730,_0x162cfc))&&_0xf36274){fs[_0x2e07('0x1e')](path[_0x2e07('0x1d')](_0x4b2730,_0x162cfc));}return BPromise[_0x2e07('0x1f')](_0x38f73a,function(_0x2b5bdb){_0x41c0b9[_0x2e07('0x18')](_0x2b5bdb);})['then'](function(){for(var _0x231462=0x0;_0x231462<_0x41c0b9[_0x2e07('0x16')];_0x231462+=0x1){var _0x534c51;var _0x1be28e=_0x41c0b9[_0x231462];if(_0xf36274){_0x534c51=path[_0x2e07('0x1d')](_0x4b2730,_0x162cfc,util[_0x2e07('0xb')](_0x2e07('0x20'),_0x162cfc,_0x231462,_0x2e07('0x21')));}else{_0x534c51=path['join'](_0x4b2730,util[_0x2e07('0xb')](_0x2e07('0x22'),_0x162cfc,_0x2e07('0x21')));}fs[_0x2e07('0x23')](_0x534c51,csv(_0x1be28e));}})[_0x2e07('0xf')](function(){if(_0xf36274){return new Promise(function(_0x3703ef){zipdir(path[_0x2e07('0x1d')](_0x4b2730,_0x162cfc),{'saveTo':path[_0x2e07('0x1d')](_0x4b2730,util[_0x2e07('0xb')](_0x2e07('0x22'),_0x162cfc,'zip'))},function(_0x287799,_0x3f8650){rimraf(path['join'](_0x4b2730,_0x162cfc),function(){});_0x3703ef(_0x2e07('0x24'));});});}})[_0x2e07('0xf')](function(){logger[_0x2e07('0x25')](util[_0x2e07('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2e07('0x26')));return analyticExtractedReport('Completed',_0xf36274?util[_0x2e07('0xb')](_0x2e07('0x22'),_0x162cfc,_0xf36274?_0x2e07('0x27'):_0x2e07('0x21')):null);});})[_0x2e07('0x28')](function(_0x1365e1){logger[_0x2e07('0x25')](util[_0x2e07('0xb')](_0x2e07('0x29'),EXTRACTED_REPORT_ID,_0x2e07('0x26')),util['inspect'](_0x1365e1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2e07('0x2a'));})[_0x2e07('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdae1=['%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','existsSync','join','%s%d.%s','csv'];(function(_0x48c232,_0x540a6f){var _0x1503db=function(_0x5640ab){while(--_0x5640ab){_0x48c232['push'](_0x48c232['shift']());}};_0x1503db(++_0x540a6f);}(_0xdae1,0x66));var _0x1dae=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xdae1[_0x138f59];return _0x3d114d;};'use strict';var util=require('util');var path=require(_0x1dae('0x0'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x1dae('0x1'));var zipdir=require(_0x1dae('0x2'));var rimraf=require(_0x1dae('0x3'));var db=require(_0x1dae('0x4'))['db'];var dbH=require(_0x1dae('0x4'))[_0x1dae('0x5')];var logger=require(_0x1dae('0x6'))(_0x1dae('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x1dae('0x8')][0x2]);var QUERY=process[_0x1dae('0x8')][0x3];var PATH=process[_0x1dae('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x6be94c,_0x28420a){var _0x31e0d1={'status':_0x6be94c};var _0x475455={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x28420a){_0x31e0d1['savename']=_0x28420a;}return db[_0x1dae('0x9')][_0x1dae('0xa')](_0x31e0d1,_0x475455);}function main(){var _0x464813=0x1388;var _0x29a06a;logger[_0x1dae('0xb')](util[_0x1dae('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x1dae('0xd')][_0x1dae('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1dae('0xf')]})[_0x1dae('0x10')](function(_0x167d06){if(_0x167d06){_0x29a06a=_0x167d06;_0x464813=_0x29a06a['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x1dae('0x11')][_0x1dae('0x12')](util['format'](_0x1dae('0x13'),QUERY),{'type':dbH[_0x1dae('0x11')][_0x1dae('0x14')][_0x1dae('0x15')]});})[_0x1dae('0x10')](function(_0x4245e3){if(!_0x4245e3[0x0][_0x1dae('0x16')]){return analyticExtractedReport(_0x1dae('0x17'));}var _0x3c24fb=[];var _0x56384e=0x0;if(_0x29a06a[_0x1dae('0x18')]){if(_0x4245e3&&_0x4245e3['length']){var _0x417ca6=_['range'](_0x4245e3[0x0][_0x1dae('0x16')]/_0x464813);var _0x12b3b2=Number[_0x1dae('0x19')](_0x4245e3[0x0][_0x1dae('0x16')]/_0x464813)?_0x4245e3[0x0]['num']%_0x464813:0x0;_0x417ca6[_0x1dae('0x1a')](function(_0xa743ae){if(_0xa743ae>0x0){_0x56384e+=_0x464813;}_0x3c24fb[_0x1dae('0x1b')](dbH[_0x1dae('0x11')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x464813,_0x56384e),{'type':dbH['sequelize'][_0x1dae('0x14')][_0x1dae('0x15')]}));});if(_0x12b3b2>0x0){_0x56384e+=_0x464813;_0x3c24fb['push'](dbH[_0x1dae('0x11')][_0x1dae('0x12')](util[_0x1dae('0xc')](_0x1dae('0x1c'),QUERY,_0x12b3b2,_0x56384e),{'type':dbH[_0x1dae('0x11')][_0x1dae('0x14')][_0x1dae('0x15')]}));}}}else{_0x3c24fb[_0x1dae('0x1b')](dbH[_0x1dae('0x11')][_0x1dae('0x12')](QUERY,{'type':dbH[_0x1dae('0x11')][_0x1dae('0x14')]['SELECT']}));}var _0x5d345b=path[_0x1dae('0x1d')](PATH);var _0x456692=path[_0x1dae('0x1e')](PATH,'.csv');var _0x307813=_0x29a06a['split']&&_0x3c24fb[_0x1dae('0x1f')]>0x1;var _0x30e00b=[];if(!fs[_0x1dae('0x20')](path[_0x1dae('0x21')](_0x5d345b,_0x456692))&&_0x307813){fs['mkdirSync'](path[_0x1dae('0x21')](_0x5d345b,_0x456692));}return BPromise['each'](_0x3c24fb,function(_0x1ddec7){_0x30e00b['push'](_0x1ddec7);})[_0x1dae('0x10')](function(){for(var _0x133234=0x0;_0x133234<_0x30e00b[_0x1dae('0x1f')];_0x133234+=0x1){var _0x52bd75;var _0x11e381=_0x30e00b[_0x133234];if(_0x307813){_0x52bd75=path[_0x1dae('0x21')](_0x5d345b,_0x456692,util[_0x1dae('0xc')](_0x1dae('0x22'),_0x456692,_0x133234,_0x1dae('0x23')));}else{_0x52bd75=path['join'](_0x5d345b,util[_0x1dae('0xc')](_0x1dae('0x24'),_0x456692,_0x1dae('0x23')));}fs[_0x1dae('0x25')](_0x52bd75,csv(_0x11e381));}})['then'](function(){if(_0x307813){return new Promise(function(_0x46f056){zipdir(path[_0x1dae('0x21')](_0x5d345b,_0x456692),{'saveTo':path[_0x1dae('0x21')](_0x5d345b,util[_0x1dae('0xc')](_0x1dae('0x24'),_0x456692,_0x1dae('0x26')))},function(_0x230678,_0x2fc8b5){rimraf(path[_0x1dae('0x21')](_0x5d345b,_0x456692),function(){});_0x46f056(_0x1dae('0x27'));});});}})[_0x1dae('0x10')](function(){logger[_0x1dae('0xb')](util[_0x1dae('0xc')](_0x1dae('0x28'),EXTRACTED_REPORT_ID,_0x1dae('0x29')));return analyticExtractedReport('Completed',_0x307813?util['format'](_0x1dae('0x24'),_0x456692,_0x307813?_0x1dae('0x26'):'csv'):null);});})['catch'](function(_0x27ea19){logger['info'](util['format'](_0x1dae('0x2a'),EXTRACTED_REPORT_ID,_0x1dae('0x29')),util[_0x1dae('0x2b')](_0x27ea19,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1dae('0x2c')](function(){process[_0x1dae('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c133cc1..7881aa1 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 _0x9616=['margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','path','moment','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','toString','value','fill','length','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','header'];(function(_0x2d14a3,_0x1d3fa){var _0x2329c5=function(_0xe7f05){while(--_0xe7f05){_0x2d14a3['push'](_0x2d14a3['shift']());}};_0x2329c5(++_0x1d3fa);}(_0x9616,0x8a));var _0x6961=function(_0x37656f,_0x350ac6){_0x37656f=_0x37656f-0x0;var _0x5cd9d8=_0x9616[_0x37656f];return _0x5cd9d8;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x6961('0x0'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x6961('0x1'));var rimraf=require(_0x6961('0x2'));var JSDOM=require(_0x6961('0x3'))[_0x6961('0x4')];var window=new JSDOM('')[_0x6961('0x5')];var BPromise=require(_0x6961('0x6'));var db=require(_0x6961('0x7'))['db'];var dbH=require(_0x6961('0x7'))['dbH'];var logger=require(_0x6961('0x8'))(_0x6961('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x6961('0xa')][0x3];var PATH=process[_0x6961('0xa')][0x4];var NAME=process[_0x6961('0xa')][0x5];var FORMAT=_0x6961('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ad5ee,_0x521f74){var _0x5e07c0={'status':_0x2ad5ee};var _0x1032e2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x521f74){_0x5e07c0[_0x6961('0xc')]=_0x521f74;}return db[_0x6961('0xd')][_0x6961('0xe')](_0x5e07c0,_0x1032e2);}function getHeaders(_0x1376c9){return _['map'](_0x1376c9,function(_0x1574a6){return{'text':_0x1574a6,'style':_0x6961('0xf')};});}function getRows(_0x1e42ea,_0x41e597){return _[_0x6961('0x10')](_0x41e597,function(_0x243a63){return _(_0x243a63)['pick'](_0x1e42ea)[_0x6961('0x10')](function(_0x3518da){return _0x3518da?_[_0x6961('0x11')](_0x3518da):'';})[_0x6961('0x12')]();});}function createTable(_0x368d45,_0x8146a1){var _0x442f1e={'widths':_[_0x6961('0x13')](Array(_0x368d45[_0x6961('0x14')]),0x91),'heights':function(_0x5acad8){return _0x5acad8===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2867f2=getHeaders(_0x368d45);_0x442f1e[_0x6961('0x15')][_0x6961('0x16')](_0x2867f2);var _0x23682d=getRows(_0x368d45,_0x8146a1);_0x442f1e[_0x6961('0x15')]=_0x442f1e['body'][_0x6961('0x17')](_0x23682d);return _0x442f1e;}function createTables(_0x1aa544){var _0x3d2704=[];var _0x3071e6=_['chunk'](Object[_0x6961('0x18')](_0x1aa544[0x0]),0x5);_0x3071e6[_0x6961('0x19')](function(_0xc1782){_0x3d2704[_0x6961('0x16')](createTable(_0xc1782,_0x1aa544));});return _0x3d2704;}function getPDFDocDefinition(_0x260b2d){var _0x49cb03=util[_0x6961('0x1a')](_0x6961('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x6961('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x6961('0x1c')])['format'](FORMAT));var _0x66ef90=[];for(var _0xe2cea2=0x0;_0xe2cea2<_0x260b2d[_0x6961('0x14')];_0xe2cea2++){var _0x356ae6=[];if(_0xe2cea2===0x0){_0x356ae6[_0x6961('0x16')]({'text':_0x49cb03,'style':_0x6961('0x1d')});}var _0x3c9750={'table':_0x260b2d[_0xe2cea2]};if(_0xe2cea2>0x0){_0x3c9750['pageBreak']='before';_0x3c9750[_0x6961('0x1e')]=[0x0,0x46,0x0,0x0];}_0x356ae6[_0x6961('0x16')](_0x3c9750);_0x66ef90[_0x6961('0x16')](_0x356ae6);}return{'pageSize':'A4','pageOrientation':_0x6961('0x1f'),'content':_0x66ef90,'footer':function(_0x677e43,_0x519dc3){return{'text':_0x677e43[_0x6961('0x11')]()+_0x6961('0x20')+_0x519dc3,'style':_0x6961('0x21')};},'defaultStyle':{'font':_0x6961('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6961('0x23')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x59b75c){var _0x108ff7=0x1388;var _0x2df34c;if(!_0x59b75c[0x0][_0x6961('0x24')]){return analyticExtractedReport(_0x6961('0x25'));}return db[_0x6961('0x26')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6961('0x27'),_0x6961('0x28')]})['then'](function(_0x4c928f){if(_0x4c928f){_0x2df34c=_0x4c928f;_0x108ff7=_0x2df34c[_0x6961('0x28')]||0x3e8;}})[_0x6961('0x29')](function(){var _0x53fcf2=[];var _0x51ba2e=0x0;if(_0x2df34c[_0x6961('0x27')]){if(_0x59b75c&&_0x59b75c['length']){var _0x4084e2=_[_0x6961('0x2a')](_0x59b75c[0x0][_0x6961('0x24')]/_0x108ff7);var _0x36436f=Number[_0x6961('0x2b')](_0x59b75c[0x0][_0x6961('0x24')]/_0x108ff7)?_0x59b75c[0x0]['num']%_0x108ff7:0x0;_0x4084e2[_0x6961('0x19')](function(_0x174244){if(_0x174244>0x0){_0x51ba2e+=_0x108ff7;}_0x53fcf2[_0x6961('0x16')](dbH[_0x6961('0x2c')][_0x6961('0x2d')](util[_0x6961('0x1a')](_0x6961('0x2e'),QUERY,_0x108ff7,_0x51ba2e),{'type':dbH[_0x6961('0x2c')][_0x6961('0x2f')][_0x6961('0x30')]}));});if(_0x36436f>0x0){_0x51ba2e+=_0x108ff7;_0x53fcf2[_0x6961('0x16')](dbH[_0x6961('0x2c')][_0x6961('0x2d')](util[_0x6961('0x1a')](_0x6961('0x2e'),QUERY,_0x36436f,_0x51ba2e),{'type':dbH[_0x6961('0x2c')][_0x6961('0x2f')][_0x6961('0x30')]}));}}}else{_0x53fcf2[_0x6961('0x16')](dbH[_0x6961('0x2c')]['query'](QUERY,{'type':dbH[_0x6961('0x2c')]['QueryTypes']['SELECT']}));}var _0x316900=path[_0x6961('0x31')](PATH);var _0x4d69f8=path[_0x6961('0x32')](PATH,'.pdf');var _0x4c9141=_0x2df34c[_0x6961('0x27')]&&_0x53fcf2[_0x6961('0x14')]>0x1;var _0x1bcd7f=[];if(!fs[_0x6961('0x33')](path[_0x6961('0x34')](_0x316900,_0x4d69f8))&&_0x4c9141){fs['mkdirSync'](path[_0x6961('0x34')](_0x316900,_0x4d69f8));}return BPromise[_0x6961('0x35')](_0x53fcf2,function(_0x4cb8ad){_0x1bcd7f[_0x6961('0x16')](_0x4cb8ad);})[_0x6961('0x29')](function(){var _0x57d135=[];for(var _0x13f1d7=0x0;_0x13f1d7<_0x1bcd7f[_0x6961('0x14')];_0x13f1d7+=0x1){var _0x21a085=_0x1bcd7f[_0x13f1d7];var _0x5de700=createTables(_[_0x6961('0x36')](_0x21a085));var _0x2e3b95;var _0x5c8e21=getPDFDocDefinition(_0x5de700);var _0xc63802=getPDFPrinter();var _0x33d836=_0xc63802[_0x6961('0x37')](_0x5c8e21);if(_0x4c9141){_0x2e3b95=path[_0x6961('0x34')](_0x316900,_0x4d69f8,util['format'](_0x6961('0x38'),_0x4d69f8,_0x13f1d7,'pdf'));}else{_0x2e3b95=path[_0x6961('0x34')](_0x316900,util['format']('%s.%s',_0x4d69f8,_0x6961('0x39')));}_0x57d135[_0x6961('0x16')](writePDFDocument(_0x33d836,_0x2e3b95));}return Promise['all'](_0x57d135);})[_0x6961('0x29')](function(){if(_0x4c9141){return new Promise(function(_0x450d8d){zipdir(path[_0x6961('0x34')](_0x316900,_0x4d69f8),{'saveTo':path[_0x6961('0x34')](_0x316900,util['format']('%s.%s',_0x4d69f8,_0x6961('0x3a')))},function(){rimraf(path[_0x6961('0x34')](_0x316900,_0x4d69f8),function(){});_0x450d8d(_0x6961('0x3b'));});});}})['then'](function(){if(!_0x4c9141)return;rimraf(path[_0x6961('0x34')](_0x316900,_0x4d69f8),function(){});})[_0x6961('0x29')](function(){logger[_0x6961('0x3c')](util[_0x6961('0x1a')](_0x6961('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x6961('0x3e'),_0x4c9141?util[_0x6961('0x1a')](_0x6961('0x3f'),_0x4d69f8,_0x4c9141?_0x6961('0x3a'):_0x6961('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6961('0x3c')](util[_0x6961('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6961('0x40')));return db[_0x6961('0xd')][_0x6961('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x54c940){EXTRACTED_REPORT=_0x54c940;return dbH[_0x6961('0x2c')][_0x6961('0x2d')](util['format'](_0x6961('0x42'),QUERY),{'type':dbH[_0x6961('0x2c')][_0x6961('0x2f')][_0x6961('0x30')]});})[_0x6961('0x29')](extractReport)['catch'](function(_0x496ac0){logger[_0x6961('0x3c')](util[_0x6961('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6961('0x40')),util['inspect'](_0x496ac0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6961('0x43'));})[_0x6961('0x44')](function(){process[_0x6961('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2d55e8=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x6961('0x46'),'italics':__dirname+_0x6961('0x47'),'bolditalics':__dirname+_0x6961('0x48')}});return _0x2d55e8;}function getPDFDocDefinitionFromHTML(_0x353e36,_0x385f6b){var _0x21ffbd=util['format'](_0x6961('0x49'),_0x385f6b[_0x6961('0x4a')],_0x385f6b[_0x6961('0x4b')]);var _0x342198=moment()[_0x6961('0x1a')]('YYYY-MM-DD')['toString']();var _0x4d4a90=htmlToPdfmake(_0x353e36,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4d4a90],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6961('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6961('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6961('0x4c')}},'header':function(){return[{'text':_0x6961('0x4d'),'style':_0x6961('0x1d')}];},'footer':function(_0x3d208a,_0x1446dd){return[{'text':util[_0x6961('0x1a')](_0x6961('0x4e'),_0x21ffbd,_0x3d208a,_0x1446dd,_0x342198),'style':_0x6961('0x21')}];}};}function writePDFDocument(_0x4a246d,_0x384421){return new Promise(function(_0x372c50,_0x1bfd00){var _0x19f85a=_0x4a246d['pipe'](fs[_0x6961('0x4f')](_0x384421));_0x19f85a['on'](_0x6961('0x50'),function(){_0x372c50('finish');});_0x19f85a['on'](_0x6961('0x51'),function(_0x3d8cff){_0x1bfd00(_0x3d8cff);});_0x4a246d['end']();});}exports[_0x6961('0x52')]=function(_0xf3d6b3,_0x5a83ec){var _0x49ea03=getPDFPrinter();var _0xacb7d1=getPDFDocDefinitionFromHTML(_0xf3d6b3,_0x5a83ec);var _0x38a6f5=_0x49ea03[_0x6961('0x37')](_0xacb7d1);return writePDFDocument(_0x38a6f5,_0x5a83ec[_0x6961('0x53')])['catch'](function(_0x4c0c0b){throw _0x4c0c0b;});}; \ No newline at end of file +var _0x4521=['chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','join','mkdirSync','flatten','%s%d.%s','%s.%s','pdf','zip\x20finished','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','PDF','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body'];(function(_0x132f8e,_0x58fbe7){var _0x4f7c29=function(_0x26d0f7){while(--_0x26d0f7){_0x132f8e['push'](_0x132f8e['shift']());}};_0x4f7c29(++_0x58fbe7);}(_0x4521,0x94));var _0x1452=function(_0x5c5f1f,_0x19a5c5){_0x5c5f1f=_0x5c5f1f-0x0;var _0x13a653=_0x4521[_0x5c5f1f];return _0x13a653;};'use strict';var _=require(_0x1452('0x0'));var fs=require('fs');var util=require(_0x1452('0x1'));var path=require(_0x1452('0x2'));var moment=require(_0x1452('0x3'));var htmlToPdfmake=require(_0x1452('0x4'));var PdfPrinter=require(_0x1452('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x1452('0x6'));var JSDOM=require(_0x1452('0x7'))[_0x1452('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0x1452('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1452('0xa'))[_0x1452('0xb')];var logger=require('../../config/logger')(_0x1452('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x1452('0xd')][0x2]);var QUERY=process[_0x1452('0xd')][0x3];var PATH=process[_0x1452('0xd')][0x4];var NAME=process[_0x1452('0xd')][0x5];var FORMAT=_0x1452('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xb7cdca,_0x3d18fa){var _0x2c5b0c={'status':_0xb7cdca};var _0x43c9f5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3d18fa){_0x2c5b0c['savename']=_0x3d18fa;}return db[_0x1452('0xf')][_0x1452('0x10')](_0x2c5b0c,_0x43c9f5);}function getHeaders(_0x1ea52d){return _[_0x1452('0x11')](_0x1ea52d,function(_0x2da134){return{'text':_0x2da134,'style':_0x1452('0x12')};});}function getRows(_0x19c6b9,_0x2c0109){return _['map'](_0x2c0109,function(_0x3bb36d){return _(_0x3bb36d)[_0x1452('0x13')](_0x19c6b9)[_0x1452('0x11')](function(_0x5d8f0d){return _0x5d8f0d?_[_0x1452('0x14')](_0x5d8f0d):'';})[_0x1452('0x15')]();});}function createTable(_0x17b9f0,_0x1f97d7){var _0x181dde={'widths':_[_0x1452('0x16')](Array(_0x17b9f0[_0x1452('0x17')]),0x91),'heights':function(_0x2e52bf){return _0x2e52bf===0x0?_0x1452('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x44656a=getHeaders(_0x17b9f0);_0x181dde[_0x1452('0x19')]['push'](_0x44656a);var _0x412ce8=getRows(_0x17b9f0,_0x1f97d7);_0x181dde[_0x1452('0x19')]=_0x181dde['body']['concat'](_0x412ce8);return _0x181dde;}function createTables(_0x57e3f9){var _0x5d584e=[];var _0x3d7cf4=_[_0x1452('0x1a')](Object[_0x1452('0x1b')](_0x57e3f9[0x0]),0x5);_0x3d7cf4[_0x1452('0x1c')](function(_0x52ea2e){_0x5d584e['push'](createTable(_0x52ea2e,_0x57e3f9));});return _0x5d584e;}function getPDFDocDefinition(_0x42103d){var _0x4aee5a=util[_0x1452('0x1d')](_0x1452('0x1e'),NAME,EXTRACTED_REPORT[_0x1452('0x1f')],moment(EXTRACTED_REPORT[_0x1452('0x20')])[_0x1452('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x1452('0x21')])[_0x1452('0x1d')](FORMAT));var _0x19638e=[];for(var _0x1ce51e=0x0;_0x1ce51e<_0x42103d['length'];_0x1ce51e++){var _0x1919bc=[];if(_0x1ce51e===0x0){_0x1919bc[_0x1452('0x22')]({'text':_0x4aee5a,'style':_0x1452('0x23')});}var _0x4bba6f={'table':_0x42103d[_0x1ce51e]};if(_0x1ce51e>0x0){_0x4bba6f[_0x1452('0x24')]=_0x1452('0x25');_0x4bba6f[_0x1452('0x26')]=[0x0,0x46,0x0,0x0];}_0x1919bc['push'](_0x4bba6f);_0x19638e[_0x1452('0x22')](_0x1919bc);}return{'pageSize':'A4','pageOrientation':_0x1452('0x27'),'content':_0x19638e,'footer':function(_0xd11495,_0x5ee1d8){return{'text':_0xd11495[_0x1452('0x14')]()+_0x1452('0x28')+_0x5ee1d8,'style':_0x1452('0x29')};},'defaultStyle':{'font':_0x1452('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x1452('0x2b')},'footer':{'alignment':_0x1452('0x2c'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x20d0bb){var _0x14b65d=0x1388;var _0x2ab35e;if(!_0x20d0bb[0x0][_0x1452('0x2d')]){return analyticExtractedReport('Empty');}return db[_0x1452('0x2e')][_0x1452('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1452('0x30')]})[_0x1452('0x31')](function(_0x28c8cc){if(_0x28c8cc){_0x2ab35e=_0x28c8cc;_0x14b65d=_0x2ab35e[_0x1452('0x30')]||0x3e8;}})[_0x1452('0x31')](function(){var _0x595e36=[];var _0xd435f1=0x0;if(_0x2ab35e[_0x1452('0x32')]){if(_0x20d0bb&&_0x20d0bb[_0x1452('0x17')]){var _0x1abe88=_[_0x1452('0x33')](_0x20d0bb[0x0]['num']/_0x14b65d);var _0x514f0a=Number[_0x1452('0x34')](_0x20d0bb[0x0]['num']/_0x14b65d)?_0x20d0bb[0x0][_0x1452('0x2d')]%_0x14b65d:0x0;_0x1abe88[_0x1452('0x1c')](function(_0x53c7ba){if(_0x53c7ba>0x0){_0xd435f1+=_0x14b65d;}_0x595e36['push'](dbH[_0x1452('0x35')][_0x1452('0x36')](util[_0x1452('0x1d')](_0x1452('0x37'),QUERY,_0x14b65d,_0xd435f1),{'type':dbH[_0x1452('0x35')][_0x1452('0x38')]['SELECT']}));});if(_0x514f0a>0x0){_0xd435f1+=_0x14b65d;_0x595e36[_0x1452('0x22')](dbH[_0x1452('0x35')][_0x1452('0x36')](util[_0x1452('0x1d')](_0x1452('0x37'),QUERY,_0x514f0a,_0xd435f1),{'type':dbH['sequelize']['QueryTypes'][_0x1452('0x39')]}));}}}else{_0x595e36[_0x1452('0x22')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x454aef=path[_0x1452('0x3a')](PATH);var _0x1933e4=path['basename'](PATH,_0x1452('0x3b'));var _0x2cbaa4=_0x2ab35e['split']&&_0x595e36[_0x1452('0x17')]>0x1;var _0x220c8e=[];if(!fs['existsSync'](path[_0x1452('0x3c')](_0x454aef,_0x1933e4))&&_0x2cbaa4){fs[_0x1452('0x3d')](path[_0x1452('0x3c')](_0x454aef,_0x1933e4));}return BPromise['each'](_0x595e36,function(_0x53d7d0){_0x220c8e['push'](_0x53d7d0);})[_0x1452('0x31')](function(){var _0x546117=[];for(var _0x2079e7=0x0;_0x2079e7<_0x220c8e['length'];_0x2079e7+=0x1){var _0x59a858=_0x220c8e[_0x2079e7];var _0x1cb5aa=createTables(_[_0x1452('0x3e')](_0x59a858));var _0x45727a;var _0x11edee=getPDFDocDefinition(_0x1cb5aa);var _0x4b8c36=getPDFPrinter();var _0x507e7a=_0x4b8c36['createPdfKitDocument'](_0x11edee);if(_0x2cbaa4){_0x45727a=path[_0x1452('0x3c')](_0x454aef,_0x1933e4,util[_0x1452('0x1d')](_0x1452('0x3f'),_0x1933e4,_0x2079e7,'pdf'));}else{_0x45727a=path[_0x1452('0x3c')](_0x454aef,util[_0x1452('0x1d')](_0x1452('0x40'),_0x1933e4,_0x1452('0x41')));}_0x546117[_0x1452('0x22')](writePDFDocument(_0x507e7a,_0x45727a));}return Promise['all'](_0x546117);})['then'](function(){if(_0x2cbaa4){return new Promise(function(_0x1f63ad){zipdir(path[_0x1452('0x3c')](_0x454aef,_0x1933e4),{'saveTo':path['join'](_0x454aef,util['format'](_0x1452('0x40'),_0x1933e4,'zip'))},function(){rimraf(path[_0x1452('0x3c')](_0x454aef,_0x1933e4),function(){});_0x1f63ad(_0x1452('0x42'));});});}})[_0x1452('0x31')](function(){if(!_0x2cbaa4)return;rimraf(path[_0x1452('0x3c')](_0x454aef,_0x1933e4),function(){});})[_0x1452('0x31')](function(){logger['info'](util[_0x1452('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x2cbaa4?util['format'](_0x1452('0x40'),_0x1933e4,_0x2cbaa4?_0x1452('0x43'):_0x1452('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1452('0x44')](util[_0x1452('0x1d')](_0x1452('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x1452('0xf')][_0x1452('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2ece10){EXTRACTED_REPORT=_0x2ece10;return dbH[_0x1452('0x35')][_0x1452('0x36')](util[_0x1452('0x1d')](_0x1452('0x47'),QUERY),{'type':dbH['sequelize'][_0x1452('0x38')][_0x1452('0x39')]});})['then'](extractReport)['catch'](function(_0x5163fb){logger['info'](util[_0x1452('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1452('0x48')),util[_0x1452('0x49')](_0x5163fb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1452('0x4a'));})[_0x1452('0x4b')](function(){process[_0x1452('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x156587=new PdfPrinter({'Arial':{'normal':__dirname+_0x1452('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x1452('0x4e')}});return _0x156587;}function getPDFDocDefinitionFromHTML(_0x416703,_0x1f2d4f){var _0x3d2350=util[_0x1452('0x1d')](_0x1452('0x4f'),_0x1f2d4f['channel'],_0x1f2d4f[_0x1452('0x50')]);var _0x4b1fa0=moment()[_0x1452('0x1d')]('YYYY-MM-DD')['toString']();var _0x17c4de=htmlToPdfmake(_0x416703,{'window':window,'tableAutoSize':!![]});return{'content':[_0x17c4de],'defaultStyle':{'font':_0x1452('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1452('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1452('0x51')}},'header':function(){return[{'text':_0x1452('0x52'),'style':_0x1452('0x23')}];},'footer':function(_0xcdc25c,_0x369528){return[{'text':util['format'](_0x1452('0x53'),_0x3d2350,_0xcdc25c,_0x369528,_0x4b1fa0),'style':'footer'}];}};}function writePDFDocument(_0x4caefe,_0x8c8e84){return new Promise(function(_0x50a2d1,_0x349fa4){var _0x2c6438=_0x4caefe['pipe'](fs['createWriteStream'](_0x8c8e84));_0x2c6438['on'](_0x1452('0x54'),function(){_0x50a2d1(_0x1452('0x54'));});_0x2c6438['on'](_0x1452('0x55'),function(_0x325721){_0x349fa4(_0x325721);});_0x4caefe['end']();});}exports[_0x1452('0x56')]=function(_0x390617,_0x315291){var _0x53eb3c=getPDFPrinter();var _0x3983a8=getPDFDocDefinitionFromHTML(_0x390617,_0x315291);var _0x278ddd=_0x53eb3c['createPdfKitDocument'](_0x3983a8);return writePDFDocument(_0x278ddd,_0x315291['path'])['catch'](function(_0x531399){throw _0x531399;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 78569ca..07b61b5 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 _0x52ed=['find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting'];(function(_0x1b0d19,_0x41297d){var _0x274762=function(_0x236f94){while(--_0x236f94){_0x1b0d19['push'](_0x1b0d19['shift']());}};_0x274762(++_0x41297d);}(_0x52ed,0x132));var _0xd52e=function(_0x5f1d32,_0x47d03f){_0x5f1d32=_0x5f1d32-0x0;var _0x49145a=_0x52ed[_0x5f1d32];return _0x49145a;};'use strict';var util=require(_0xd52e('0x0'));var path=require(_0xd52e('0x1'));var _=require(_0xd52e('0x2'));var fs=require('fs');var json2xls=require(_0xd52e('0x3'));var BPromise=require(_0xd52e('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xd52e('0x5'));var db=require(_0xd52e('0x6'))['db'];var dbH=require(_0xd52e('0x6'))[_0xd52e('0x7')];var logger=require(_0xd52e('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd52e('0x9')][0x2]);var QUERY=process[_0xd52e('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5207fd,_0x321f8d){var _0x5ae178={'status':_0x5207fd};var _0x4d124c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x321f8d){_0x5ae178[_0xd52e('0xa')]=_0x321f8d;}return db[_0xd52e('0xb')][_0xd52e('0xc')](_0x5ae178,_0x4d124c);}function main(){var _0x1d00a9=0x1388;var _0x3d857a;logger[_0xd52e('0xd')](util[_0xd52e('0xe')](_0xd52e('0xf'),EXTRACTED_REPORT_ID,_0xd52e('0x10')));return db[_0xd52e('0x11')][_0xd52e('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd52e('0x13'),_0xd52e('0x14')]})[_0xd52e('0x15')](function(_0x43a5ba){if(_0x43a5ba){_0x3d857a=_0x43a5ba;_0x1d00a9=_0x3d857a['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xd52e('0x16')][_0xd52e('0x17')](util[_0xd52e('0xe')](_0xd52e('0x18'),QUERY),{'type':dbH[_0xd52e('0x16')]['QueryTypes']['SELECT']});})[_0xd52e('0x15')](function(_0x466516){if(!_0x466516[0x0][_0xd52e('0x19')]){return analyticExtractedReport(_0xd52e('0x1a'));}var _0x33230a=[];var _0x58dab2=0x0;if(_0x3d857a[_0xd52e('0x13')]){if(_0x466516&&_0x466516[_0xd52e('0x1b')]){var _0x7eeb4f=_[_0xd52e('0x1c')](_0x466516[0x0][_0xd52e('0x19')]/_0x1d00a9);var _0xdab253=Number[_0xd52e('0x1d')](_0x466516[0x0]['num']/_0x1d00a9)?_0x466516[0x0]['num']%_0x1d00a9:0x0;_0x7eeb4f['forEach'](function(_0x163b1b){if(_0x163b1b>0x0){_0x58dab2+=_0x1d00a9;}_0x33230a[_0xd52e('0x1e')](dbH['sequelize'][_0xd52e('0x17')](util[_0xd52e('0xe')](_0xd52e('0x1f'),QUERY,_0x1d00a9,_0x58dab2),{'type':dbH[_0xd52e('0x16')][_0xd52e('0x20')][_0xd52e('0x21')]}));});if(_0xdab253>0x0){_0x58dab2+=_0x1d00a9;_0x33230a[_0xd52e('0x1e')](dbH[_0xd52e('0x16')][_0xd52e('0x17')](util[_0xd52e('0xe')](_0xd52e('0x1f'),QUERY,_0xdab253,_0x58dab2),{'type':dbH[_0xd52e('0x16')][_0xd52e('0x20')][_0xd52e('0x21')]}));}}}else{_0x33230a[_0xd52e('0x1e')](dbH[_0xd52e('0x16')][_0xd52e('0x17')](QUERY,{'type':dbH[_0xd52e('0x16')][_0xd52e('0x20')]['SELECT']}));}var _0x3c3599=path[_0xd52e('0x22')](PATH);var _0x3a4142=path[_0xd52e('0x23')](PATH,'.xlsx');var _0x140fa0=_0x3d857a[_0xd52e('0x13')]&&_0x33230a['length']>0x1;var _0x5dd8b0=[];if(!fs[_0xd52e('0x24')](path[_0xd52e('0x25')](_0x3c3599,_0x3a4142))&&_0x140fa0){fs[_0xd52e('0x26')](path['join'](_0x3c3599,_0x3a4142));}return BPromise[_0xd52e('0x27')](_0x33230a,function(_0x4b27bc){_0x5dd8b0[_0xd52e('0x1e')](_0x4b27bc);})[_0xd52e('0x15')](function(){for(var _0x505614=0x0;_0x505614<_0x5dd8b0[_0xd52e('0x1b')];_0x505614+=0x1){var _0x2329e4;var _0x5a8ab0=_0x5dd8b0[_0x505614];if(_0x140fa0){_0x2329e4=path['join'](_0x3c3599,_0x3a4142,util[_0xd52e('0xe')](_0xd52e('0x28'),_0x3a4142,_0x505614,'xlsx'));}else{_0x2329e4=path[_0xd52e('0x25')](_0x3c3599,util[_0xd52e('0xe')](_0xd52e('0x29'),_0x3a4142,_0xd52e('0x2a')));}fs[_0xd52e('0x2b')](_0x2329e4,json2xls(_0x5a8ab0),_0xd52e('0x2c'));}})[_0xd52e('0x15')](function(){if(_0x140fa0){return new Promise(function(_0x3b0f46){zipdir(path[_0xd52e('0x25')](_0x3c3599,_0x3a4142),{'saveTo':path[_0xd52e('0x25')](_0x3c3599,util[_0xd52e('0xe')](_0xd52e('0x29'),_0x3a4142,_0xd52e('0x2d')))},function(_0xaf7210,_0x515dc7){rimraf(path[_0xd52e('0x25')](_0x3c3599,_0x3a4142),function(){});_0x3b0f46(_0xd52e('0x2e'));});});}})['then'](function(){logger[_0xd52e('0xd')](util[_0xd52e('0xe')](_0xd52e('0x2f'),EXTRACTED_REPORT_ID,_0xd52e('0x10')));return analyticExtractedReport(_0xd52e('0x30'),_0x140fa0?util[_0xd52e('0xe')](_0xd52e('0x29'),_0x3a4142,_0x140fa0?_0xd52e('0x2d'):_0xd52e('0x2a')):null);});})[_0xd52e('0x31')](function(_0x2181ba){logger[_0xd52e('0xd')](util[_0xd52e('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0xd52e('0x32')](_0x2181ba,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd52e('0x33'));})[_0xd52e('0x34')](function(){process[_0xd52e('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbfcc=['splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split'];(function(_0x287e8f,_0x118814){var _0x2b67a1=function(_0x1dd7e5){while(--_0x1dd7e5){_0x287e8f['push'](_0x287e8f['shift']());}};_0x2b67a1(++_0x118814);}(_0xbfcc,0x186));var _0xcbfc=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xbfcc[_0x382c73];return _0x1dd0bf;};'use strict';var util=require(_0xcbfc('0x0'));var path=require(_0xcbfc('0x1'));var _=require(_0xcbfc('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xcbfc('0x3'));var zipdir=require(_0xcbfc('0x4'));var rimraf=require(_0xcbfc('0x5'));var db=require(_0xcbfc('0x6'))['db'];var dbH=require('../../mysqldb')[_0xcbfc('0x7')];var logger=require('../../config/logger')(_0xcbfc('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xcbfc('0x9')][0x2]);var QUERY=process[_0xcbfc('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x57a207,_0x44fd34){var _0x58eda9={'status':_0x57a207};var _0xb08141={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x44fd34){_0x58eda9['savename']=_0x44fd34;}return db[_0xcbfc('0xa')][_0xcbfc('0xb')](_0x58eda9,_0xb08141);}function main(){var _0x4c3131=0x1388;var _0x3a18e3;logger[_0xcbfc('0xc')](util[_0xcbfc('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcbfc('0xe')));return db[_0xcbfc('0xf')][_0xcbfc('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcbfc('0x11'),_0xcbfc('0x12')]})[_0xcbfc('0x13')](function(_0x4d3341){if(_0x4d3341){_0x3a18e3=_0x4d3341;_0x4c3131=_0x3a18e3[_0xcbfc('0x12')]||0x1388;}})[_0xcbfc('0x13')](function(){return dbH[_0xcbfc('0x14')][_0xcbfc('0x15')](util[_0xcbfc('0xd')](_0xcbfc('0x16'),QUERY),{'type':dbH[_0xcbfc('0x14')][_0xcbfc('0x17')][_0xcbfc('0x18')]});})[_0xcbfc('0x13')](function(_0x34c151){if(!_0x34c151[0x0][_0xcbfc('0x19')]){return analyticExtractedReport(_0xcbfc('0x1a'));}var _0x5b3e44=[];var _0x29aff6=0x0;if(_0x3a18e3['split']){if(_0x34c151&&_0x34c151[_0xcbfc('0x1b')]){var _0x50c042=_[_0xcbfc('0x1c')](_0x34c151[0x0]['num']/_0x4c3131);var _0x3b0f82=Number[_0xcbfc('0x1d')](_0x34c151[0x0]['num']/_0x4c3131)?_0x34c151[0x0][_0xcbfc('0x19')]%_0x4c3131:0x0;_0x50c042[_0xcbfc('0x1e')](function(_0x4fc79c){if(_0x4fc79c>0x0){_0x29aff6+=_0x4c3131;}_0x5b3e44[_0xcbfc('0x1f')](dbH[_0xcbfc('0x14')][_0xcbfc('0x15')](util[_0xcbfc('0xd')](_0xcbfc('0x20'),QUERY,_0x4c3131,_0x29aff6),{'type':dbH[_0xcbfc('0x14')][_0xcbfc('0x17')][_0xcbfc('0x18')]}));});if(_0x3b0f82>0x0){_0x29aff6+=_0x4c3131;_0x5b3e44['push'](dbH[_0xcbfc('0x14')][_0xcbfc('0x15')](util[_0xcbfc('0xd')](_0xcbfc('0x20'),QUERY,_0x3b0f82,_0x29aff6),{'type':dbH[_0xcbfc('0x14')][_0xcbfc('0x17')][_0xcbfc('0x18')]}));}}}else{_0x5b3e44[_0xcbfc('0x1f')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xcbfc('0x17')][_0xcbfc('0x18')]}));}var _0x28833b=path[_0xcbfc('0x21')](PATH);var _0x3baafb=path[_0xcbfc('0x22')](PATH,_0xcbfc('0x23'));var _0x174779=_0x3a18e3['split']&&_0x5b3e44[_0xcbfc('0x1b')]>0x1;var _0x2cc5c1=[];if(!fs[_0xcbfc('0x24')](path['join'](_0x28833b,_0x3baafb))&&_0x174779){fs[_0xcbfc('0x25')](path[_0xcbfc('0x26')](_0x28833b,_0x3baafb));}return BPromise[_0xcbfc('0x27')](_0x5b3e44,function(_0xace3d2){_0x2cc5c1[_0xcbfc('0x1f')](_0xace3d2);})[_0xcbfc('0x13')](function(){for(var _0x51100f=0x0;_0x51100f<_0x2cc5c1[_0xcbfc('0x1b')];_0x51100f+=0x1){var _0x31f71b;var _0x5e0867=_0x2cc5c1[_0x51100f];if(_0x174779){_0x31f71b=path[_0xcbfc('0x26')](_0x28833b,_0x3baafb,util[_0xcbfc('0xd')](_0xcbfc('0x28'),_0x3baafb,_0x51100f,_0xcbfc('0x29')));}else{_0x31f71b=path[_0xcbfc('0x26')](_0x28833b,util['format'](_0xcbfc('0x2a'),_0x3baafb,_0xcbfc('0x29')));}fs['writeFileSync'](_0x31f71b,json2xls(_0x5e0867),_0xcbfc('0x2b'));}})[_0xcbfc('0x13')](function(){if(_0x174779){return new Promise(function(_0x2921a8){zipdir(path[_0xcbfc('0x26')](_0x28833b,_0x3baafb),{'saveTo':path[_0xcbfc('0x26')](_0x28833b,util[_0xcbfc('0xd')](_0xcbfc('0x2a'),_0x3baafb,'zip'))},function(_0x2a0ec2,_0x4a1e05){rimraf(path[_0xcbfc('0x26')](_0x28833b,_0x3baafb),function(){});_0x2921a8(_0xcbfc('0x2c'));});});}})[_0xcbfc('0x13')](function(){logger[_0xcbfc('0xc')](util[_0xcbfc('0xd')](_0xcbfc('0x2d'),EXTRACTED_REPORT_ID,_0xcbfc('0xe')));return analyticExtractedReport('Completed',_0x174779?util[_0xcbfc('0xd')](_0xcbfc('0x2a'),_0x3baafb,_0x174779?'zip':_0xcbfc('0x29')):null);});})[_0xcbfc('0x2e')](function(_0xaf6c8d){logger[_0xcbfc('0xc')](util['format'](_0xcbfc('0x2f'),EXTRACTED_REPORT_ID,_0xcbfc('0xe')),util[_0xcbfc('0x30')](_0xaf6c8d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcbfc('0x31'));})[_0xcbfc('0x32')](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 547632d..e843ce6 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 _0xc635=['XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','filter','tag','CDR(tag)=','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','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','last','Hangup','concat','transaction','bulkCreate','sortBy','catch','error','lodash','util','Interval','findAll','then','intervals','VoiceExtension','models','map','exten','playback','hasOwnProperty','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','priority','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','wav','XCALLY-MOTION-ANSWER=0'];(function(_0x29e278,_0x17a9fd){var _0x37ef66=function(_0x4e1e94){while(--_0x4e1e94){_0x29e278['push'](_0x29e278['shift']());}};_0x37ef66(++_0x17a9fd);}(_0xc635,0x117));var _0x5c63=function(_0x180c70,_0x30d0c7){_0x180c70=_0x180c70-0x0;var _0x51342f=_0xc635[_0x180c70];return _0x51342f;};'use strict';var _=require(_0x5c63('0x0'));var util=require(_0x5c63('0x1'));function rewrite(_0x449e7d,_0x2d52b6){var _0x52b6b7=this;return _0x449e7d['models'][_0x5c63('0x2')][_0x5c63('0x3')]({'raw':!![]})[_0x5c63('0x4')](function(_0x97a74c){_0x52b6b7[_0x5c63('0x5')]=_0x97a74c;return _0x449e7d['models'][_0x5c63('0x6')][_0x5c63('0x3')]({'where':{'IntervalId':_0x2d52b6['IntervalId']},'raw':!![]});})[_0x5c63('0x4')](function(_0x344187){return _0x449e7d[_0x5c63('0x7')][_0x5c63('0x6')][_0x5c63('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x5c63('0x8')](_0x344187,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x5c63('0x4')](function(_0x13597d){var _0x43f9ea=_['filter'](_0x13597d,{'priority':'1'});var _0x51a4a5=_['filter'](_0x13597d,{'isApp':0x1});var _0x4b1d22=_['groupBy'](_0x51a4a5,_0x5c63('0x9'));var _0x40662f=['queue',_0x5c63('0xa')];var _0x18598a=[];var _0x38b357=[];for(var _0x341ff6 in _0x4b1d22){if(_0x4b1d22[_0x5c63('0xb')](_0x341ff6)){_0x52b6b7['priority']=0x2;_0x52b6b7[_0x5c63('0xc')]=[];_0x52b6b7[_0x5c63('0xd')]=_[_0x5c63('0xe')](_0x43f9ea,{'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')]});_0x52b6b7[_0x5c63('0xc')][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0]['type'],'app':_0x5c63('0x10'),'appdata':util[_0x5c63('0x11')](_0x5c63('0x12'),_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')]),'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0]['VoiceExtensionId']});if(_0x4b1d22[_0x341ff6][0x0]['type']==='inbound'){_0x52b6b7['extensions']['push']({'type':_0x4b1d22[_0x341ff6][0x0]['type'],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x16')+_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')],'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0]['exten'],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0]['VoiceExtensionId']});}else if(_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')]===_0x5c63('0x18')){if(_0x52b6b7['extension']){_0x52b6b7['extensions'][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x19')+(_0x52b6b7[_0x5c63('0xd')]['cutdigits']?_0x5c63('0x1a')+_0x52b6b7[_0x5c63('0xd')][_0x5c63('0x1b')]+'}':'${EXTEN}'),'context':_0x4b1d22[_0x341ff6][0x0]['context'],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});}_0x52b6b7[_0x5c63('0xc')][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':'Set','appdata':_0x5c63('0x16')+_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')],'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7['priority']++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});var _0x5bb137=_0x52b6b7[_0x5c63('0x15')]++;_0x52b6b7['extensions'][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':_0x5c63('0x1c'),'appdata':_0x5c63('0x1d')+(_0x5bb137+0x2)+_0x5c63('0x1e')+(_0x5bb137+0x1)+')','context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0]['exten'],'priority':_0x5bb137,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});if(_0x52b6b7[_0x5c63('0xd')]){_0x52b6b7['extensions'][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':_0x5c63('0x10'),'appdata':_0x52b6b7[_0x5c63('0xd')][_0x5c63('0x1b')]?_0x5c63('0x1f')+_0x52b6b7['extension'][_0x5c63('0x1b')]+'}':_0x5c63('0x20'),'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0]['exten'],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});}_0x52b6b7['extensions'][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':_0x5c63('0x10'),'appdata':'outboundrouteid='+_0x4b1d22[_0x341ff6][0x0]['VoiceExtensionId'],'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});if(_0x52b6b7[_0x5c63('0xd')]&&_0x52b6b7[_0x5c63('0xd')]['hasOwnProperty'](_0x5c63('0x21'))&&_0x52b6b7[_0x5c63('0xd')][_0x5c63('0x21')]!=='none'){_0x52b6b7[_0x5c63('0xc')][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});_0x52b6b7[_0x5c63('0xc')]['push']({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x52b6b7[_0x5c63('0xd')]['recordingFormat']||_0x5c63('0x22'),'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7['priority']++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0]['VoiceExtensionId']});}}_0x52b6b7[_0x5c63('0xc')][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x23'),'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7[_0x5c63('0x15')]++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});_0x52b6b7[_0x5c63('0xc')][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0]['type'],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x24'),'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'priority':_0x52b6b7['priority']++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});_0x52b6b7['extensions']['push']({'type':_0x4b1d22[_0x341ff6][0x0]['type'],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x25'),'context':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x14')],'exten':_0x4b1d22[_0x341ff6][0x0]['exten'],'priority':_0x52b6b7['priority']++,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});for(var _0xb454ea=0x0,_0xf52372=0x0;_0xb454ea<_0x4b1d22[_0x341ff6][_0x5c63('0x26')];_0xb454ea+=0x1,_0xf52372=0x0){var _0x2008fc=_0x4b1d22[_0x341ff6][_0xb454ea];if(_0x2008fc[_0x5c63('0x13')]){_0x2008fc[_0x5c63('0x13')]=_0x2008fc[_0x5c63('0x13')]['toLowerCase']();}var _0x391b3c=[];var _0x5e579b=[];delete _0x2008fc['id'];delete _0x2008fc[_0x5c63('0x27')];delete _0x2008fc[_0x5c63('0x28')];var _0x11cae6=_0x2008fc['interval']!=='*,*,*,*'?[_0x2008fc[_0x5c63('0x29')]]:_0x2008fc['IntervalId']?_[_0x5c63('0x8')](_[_0x5c63('0x2a')](_0x52b6b7[_0x5c63('0x5')],{'IntervalId':_0x2008fc['IntervalId']}),_0x5c63('0x29')):[];if(_0x2008fc[_0x5c63('0xb')](_0x5c63('0x2b'))){if(_0x2008fc[_0x5c63('0x2b')]&&_0x2008fc['tag']!=='--'){_0x391b3c[_0x5c63('0xf')]({'type':_0x2008fc[_0x5c63('0x13')],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x2c')+_0x2008fc['tag'],'context':_0x2008fc[_0x5c63('0x14')],'exten':_0x2008fc[_0x5c63('0x9')],'priority':_0x11cae6['length']+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc[_0x5c63('0x17')]});}}if(_0x2008fc[_0x5c63('0x13')]==='outbound'&&_0x2008fc['hasOwnProperty'](_0x5c63('0x2d'))){if(_0x2008fc[_0x5c63('0x2d')]){_0x391b3c[_0x5c63('0xf')]({'type':_0x2008fc[_0x5c63('0x13')],'app':_0x5c63('0x1c'),'appdata':_0x5c63('0x2e')+_0x2008fc[_0x5c63('0x2d')]+')','context':_0x2008fc[_0x5c63('0x14')],'exten':_0x2008fc[_0x5c63('0x9')],'priority':_0x11cae6[_0x5c63('0x26')]+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc['VoiceExtensionId']});}else{_0x391b3c['push']({'type':_0x2008fc[_0x5c63('0x13')],'app':'ExecIf','appdata':_0x5c63('0x2f'),'context':_0x2008fc[_0x5c63('0x14')],'exten':_0x2008fc['exten'],'priority':_0x11cae6[_0x5c63('0x26')]+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc[_0x5c63('0x17')]});}}if(_0x2008fc[_0x5c63('0xb')](_0x5c63('0x30'))){if(_0x40662f['indexOf'](_0x2008fc[_0x5c63('0x31')][_0x5c63('0x32')]())>=0x0&&_0x2008fc['appType']!==_0x5c63('0x33')){if(_0x2008fc[_0x5c63('0x30')]){_0x391b3c[_0x5c63('0xf')]({'type':_0x2008fc[_0x5c63('0x13')],'app':_0x5c63('0x1c'),'appdata':_0x5c63('0x34'),'context':_0x2008fc[_0x5c63('0x14')],'exten':_0x2008fc['exten'],'priority':_0x11cae6[_0x5c63('0x26')]+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc[_0x5c63('0x17')]});_0x391b3c['push']({'type':_0x2008fc['type'],'app':_0x5c63('0x10'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2008fc['context'],'exten':_0x2008fc[_0x5c63('0x9')],'priority':_0x11cae6['length']+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc['VoiceExtensionId']});}else{_0x391b3c[_0x5c63('0xf')]({'type':_0x2008fc[_0x5c63('0x13')],'app':_0x5c63('0x1c'),'appdata':_0x5c63('0x35'),'context':_0x2008fc['context'],'exten':_0x2008fc[_0x5c63('0x9')],'priority':_0x11cae6[_0x5c63('0x26')]+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc['VoiceExtensionId']});_0x391b3c[_0x5c63('0xf')]({'type':_0x2008fc[_0x5c63('0x13')],'app':_0x5c63('0x10'),'appdata':_0x5c63('0x36'),'context':_0x2008fc[_0x5c63('0x14')],'exten':_0x2008fc['exten'],'priority':_0x11cae6[_0x5c63('0x26')]+_0x52b6b7[_0x5c63('0x15')]+_0xf52372++,'VoiceExtensionId':_0x2008fc['VoiceExtensionId']});}}}for(var _0x5b8601=0x0;_0x5b8601<_0x11cae6[_0x5c63('0x26')];_0x5b8601+=0x1){var _0x205a4c=_0x52b6b7[_0x5c63('0x15')]+_0x11cae6['length'];var _0x19ba07=_0x5b8601===_0x11cae6[_0x5c63('0x26')]-0x1?_0x52b6b7[_0x5c63('0x15')]+_0x391b3c['length']+_0x5e579b[_0x5c63('0x26')]+0x2:_0x52b6b7[_0x5c63('0x15')]+_0x5b8601+0x1;_0x391b3c['splice'](_0x5b8601,0x0,{'type':_0x2008fc[_0x5c63('0x13')],'app':'GotoIfTime','appdata':_0x11cae6[_0x5b8601]+'?'+_0x2008fc['context']+',${EXTEN},'+_0x205a4c+':'+_0x2008fc[_0x5c63('0x14')]+',${EXTEN},'+_0x19ba07,'exten':_0x2008fc[_0x5c63('0x9')],'context':_0x2008fc['context'],'priority':_0x52b6b7[_0x5c63('0x15')]+_0x5b8601,'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});}_0x2008fc[_0x5c63('0x15')]=_0x391b3c[_0x5c63('0x26')]?_[_0x5c63('0x37')](_0x391b3c)[_0x5c63('0x15')]+0x1:_0x52b6b7[_0x5c63('0x15')];_0x52b6b7[_0x5c63('0x15')]=(_0x5e579b[_0x5c63('0x26')]?_[_0x5c63('0x37')](_0x5e579b)['priority']:_0x2008fc[_0x5c63('0x15')])+0x1;_0x52b6b7[_0x5c63('0xc')]=_['concat'](_0x52b6b7['extensions'],_0x391b3c,[_0x2008fc],_0x5e579b);}_0x52b6b7['extensions'][_0x5c63('0xf')]({'type':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x13')],'app':_0x5c63('0x38'),'exten':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x9')],'context':_0x4b1d22[_0x341ff6][0x0]['context'],'priority':_0x52b6b7[_0x5c63('0x15')],'VoiceExtensionId':_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]});_0x18598a[_0x5c63('0xf')](_0x4b1d22[_0x341ff6][0x0][_0x5c63('0x17')]);_0x38b357=_[_0x5c63('0x39')](_0x38b357,_0x52b6b7[_0x5c63('0xc')]);}}return _0x449e7d[_0x5c63('0x3a')](function(_0x333d95){return _0x449e7d[_0x5c63('0x7')][_0x5c63('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x18598a}},'transaction':_0x333d95})[_0x5c63('0x4')](function(_0x5a60c7){return _0x449e7d[_0x5c63('0x7')]['VoiceExtension'][_0x5c63('0x3b')](_[_0x5c63('0x3c')](_0x38b357,_0x5c63('0x15')),{'transaction':_0x333d95});});});})[_0x5c63('0x3d')](function(_0xcf6a11){console[_0x5c63('0x3e')](_0xcf6a11);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x36c5=['length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','Hangup','destroy','catch','rewrite','lodash','util','models','then','intervals','VoiceExtension','findAll','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','type','format','CDR(type)=%s','context','inbound','CDR(routeid)=','VoiceExtensionId','Set','CDR(destination)=','extension','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x36c5,0x16d));var _0x536c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x536c('0x0'));var util=require(_0x536c('0x1'));function rewrite(_0x40be5f,_0x2bc0a2){var _0x39a1f6=this;return _0x40be5f[_0x536c('0x2')]['Interval']['findAll']({'raw':!![]})[_0x536c('0x3')](function(_0x29d901){_0x39a1f6[_0x536c('0x4')]=_0x29d901;return _0x40be5f[_0x536c('0x2')][_0x536c('0x5')][_0x536c('0x6')]({'where':{'IntervalId':_0x2bc0a2[_0x536c('0x7')]},'raw':!![]});})[_0x536c('0x3')](function(_0x38a1b8){return _0x40be5f[_0x536c('0x2')]['VoiceExtension'][_0x536c('0x6')]({'where':{'exten':{'$in':_['uniq'](_[_0x536c('0x8')](_0x38a1b8,_0x536c('0x9')))}},'order':[{'raw':_0x536c('0xa')}],'raw':!![]});})['then'](function(_0x26f85d){var _0x5163e8=_['filter'](_0x26f85d,{'priority':'1'});var _0x5de9ae=_[_0x536c('0xb')](_0x26f85d,{'isApp':0x1});var _0xf40f9b=_[_0x536c('0xc')](_0x5de9ae,_0x536c('0x9'));var _0x213c90=[_0x536c('0xd'),_0x536c('0xe')];var _0x45c261=[];var _0x1bf06e=[];for(var _0x4e17fc in _0xf40f9b){if(_0xf40f9b[_0x536c('0xf')](_0x4e17fc)){_0x39a1f6[_0x536c('0x10')]=0x2;_0x39a1f6[_0x536c('0x11')]=[];_0x39a1f6['extension']=_['find'](_0x5163e8,{'exten':_0xf40f9b[_0x4e17fc][0x0]['exten']});_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':'Set','appdata':util[_0x536c('0x14')](_0x536c('0x15'),_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')]),'context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0]['VoiceExtensionId']});if(_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')]===_0x536c('0x17')){_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':'Set','appdata':_0x536c('0x18')+_0xf40f9b[_0x4e17fc][0x0]['VoiceExtensionId'],'context':_0xf40f9b[_0x4e17fc][0x0]['context'],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});}else if(_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')]==='outbound'){if(_0x39a1f6['extension']){_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x536c('0x1b')+(_0x39a1f6[_0x536c('0x1c')][_0x536c('0x1d')]?'${EXTEN:'+_0x39a1f6[_0x536c('0x1c')][_0x536c('0x1d')]+'}':_0x536c('0x1e')),'context':_0xf40f9b[_0x4e17fc][0x0]['context'],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x39a1f6['priority']++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});}_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':'Set','appdata':_0x536c('0x18')+_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')],'context':_0xf40f9b[_0x4e17fc][0x0]['context'],'exten':_0xf40f9b[_0x4e17fc][0x0]['exten'],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});var _0x303f1c=_0x39a1f6[_0x536c('0x10')]++;_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1f'),'appdata':_0x536c('0x20')+(_0x303f1c+0x2)+_0x536c('0x21')+(_0x303f1c+0x1)+')','context':_0xf40f9b[_0x4e17fc][0x0]['context'],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x303f1c,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});if(_0x39a1f6[_0x536c('0x1c')]){_0x39a1f6['extensions'][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x39a1f6[_0x536c('0x1c')]['cutdigits']?_0x536c('0x22')+_0x39a1f6['extension'][_0x536c('0x1d')]+'}':_0x536c('0x23'),'context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'exten':_0xf40f9b[_0x4e17fc][0x0]['exten'],'priority':_0x39a1f6['priority']++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});}_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':'Set','appdata':_0x536c('0x24')+_0xf40f9b[_0x4e17fc][0x0]['VoiceExtensionId'],'context':_0xf40f9b[_0x4e17fc][0x0]['context'],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});if(_0x39a1f6['extension']&&_0x39a1f6[_0x536c('0x1c')][_0x536c('0xf')]('recordingFormat')&&_0x39a1f6[_0x536c('0x1c')][_0x536c('0x25')]!==_0x536c('0x26')){_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x536c('0x27')+_0x39a1f6[_0x536c('0x1c')]['recordingFormat']||_0x536c('0x28'),'context':_0xf40f9b[_0x4e17fc][0x0]['context'],'exten':_0xf40f9b[_0x4e17fc][0x0]['exten'],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});}}_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x536c('0x29'),'context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'exten':_0xf40f9b[_0x4e17fc][0x0]['exten'],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});_0x39a1f6['extensions']['push']({'type':_0xf40f9b[_0x4e17fc][0x0]['type'],'app':_0x536c('0x1a'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'exten':_0xf40f9b[_0x4e17fc][0x0]['exten'],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0]['VoiceExtensionId']});_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x536c('0x2a'),'context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'priority':_0x39a1f6[_0x536c('0x10')]++,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});for(var _0x99fbe3=0x0,_0x37762f=0x0;_0x99fbe3<_0xf40f9b[_0x4e17fc][_0x536c('0x2b')];_0x99fbe3+=0x1,_0x37762f=0x0){var _0x544bac=_0xf40f9b[_0x4e17fc][_0x99fbe3];if(_0x544bac[_0x536c('0x13')]){_0x544bac['type']=_0x544bac[_0x536c('0x13')][_0x536c('0x2c')]();}var _0x8dc9e1=[];var _0x2cf3f7=[];delete _0x544bac['id'];delete _0x544bac[_0x536c('0x2d')];delete _0x544bac[_0x536c('0x2e')];var _0x327565=_0x544bac['interval']!==_0x536c('0x2f')?[_0x544bac[_0x536c('0x30')]]:_0x544bac['IntervalId']?_['map'](_[_0x536c('0xb')](_0x39a1f6[_0x536c('0x4')],{'IntervalId':_0x544bac['IntervalId']}),_0x536c('0x30')):[];if(_0x544bac[_0x536c('0xf')](_0x536c('0x31'))){if(_0x544bac[_0x536c('0x31')]&&_0x544bac[_0x536c('0x31')]!=='--'){_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac[_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x536c('0x32')+_0x544bac[_0x536c('0x31')],'context':_0x544bac[_0x536c('0x16')],'exten':_0x544bac[_0x536c('0x9')],'priority':_0x327565['length']+_0x39a1f6[_0x536c('0x10')]+_0x37762f++,'VoiceExtensionId':_0x544bac[_0x536c('0x19')]});}}if(_0x544bac[_0x536c('0x13')]===_0x536c('0x33')&&_0x544bac[_0x536c('0xf')](_0x536c('0x34'))){if(_0x544bac['callerID']){_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac[_0x536c('0x13')],'app':_0x536c('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x544bac[_0x536c('0x34')]+')','context':_0x544bac['context'],'exten':_0x544bac[_0x536c('0x9')],'priority':_0x327565['length']+_0x39a1f6[_0x536c('0x10')]+_0x37762f++,'VoiceExtensionId':_0x544bac[_0x536c('0x19')]});}else{_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac[_0x536c('0x13')],'app':_0x536c('0x1f'),'appdata':_0x536c('0x35'),'context':_0x544bac[_0x536c('0x16')],'exten':_0x544bac[_0x536c('0x9')],'priority':_0x327565['length']+_0x39a1f6['priority']+_0x37762f++,'VoiceExtensionId':_0x544bac[_0x536c('0x19')]});}}if(_0x544bac['hasOwnProperty']('answer')){if(_0x213c90[_0x536c('0x36')](_0x544bac['app'][_0x536c('0x2c')]())>=0x0&&_0x544bac[_0x536c('0x37')]!==_0x536c('0x38')){if(_0x544bac['answer']){_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac[_0x536c('0x13')],'app':_0x536c('0x1f'),'appdata':_0x536c('0x39'),'context':_0x544bac[_0x536c('0x16')],'exten':_0x544bac['exten'],'priority':_0x327565['length']+_0x39a1f6['priority']+_0x37762f++,'VoiceExtensionId':_0x544bac[_0x536c('0x19')]});_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac['type'],'app':_0x536c('0x1a'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x544bac[_0x536c('0x16')],'exten':_0x544bac[_0x536c('0x9')],'priority':_0x327565['length']+_0x39a1f6[_0x536c('0x10')]+_0x37762f++,'VoiceExtensionId':_0x544bac[_0x536c('0x19')]});}else{_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac[_0x536c('0x13')],'app':'ExecIf','appdata':_0x536c('0x3a'),'context':_0x544bac[_0x536c('0x16')],'exten':_0x544bac[_0x536c('0x9')],'priority':_0x327565[_0x536c('0x2b')]+_0x39a1f6[_0x536c('0x10')]+_0x37762f++,'VoiceExtensionId':_0x544bac[_0x536c('0x19')]});_0x8dc9e1[_0x536c('0x12')]({'type':_0x544bac[_0x536c('0x13')],'app':_0x536c('0x1a'),'appdata':_0x536c('0x3b'),'context':_0x544bac[_0x536c('0x16')],'exten':_0x544bac[_0x536c('0x9')],'priority':_0x327565[_0x536c('0x2b')]+_0x39a1f6[_0x536c('0x10')]+_0x37762f++,'VoiceExtensionId':_0x544bac['VoiceExtensionId']});}}}for(var _0x49eccc=0x0;_0x49eccc<_0x327565[_0x536c('0x2b')];_0x49eccc+=0x1){var _0x48e3ea=_0x39a1f6[_0x536c('0x10')]+_0x327565[_0x536c('0x2b')];var _0x15c86f=_0x49eccc===_0x327565[_0x536c('0x2b')]-0x1?_0x39a1f6[_0x536c('0x10')]+_0x8dc9e1[_0x536c('0x2b')]+_0x2cf3f7['length']+0x2:_0x39a1f6['priority']+_0x49eccc+0x1;_0x8dc9e1[_0x536c('0x3c')](_0x49eccc,0x0,{'type':_0x544bac[_0x536c('0x13')],'app':_0x536c('0x3d'),'appdata':_0x327565[_0x49eccc]+'?'+_0x544bac['context']+_0x536c('0x3e')+_0x48e3ea+':'+_0x544bac[_0x536c('0x16')]+_0x536c('0x3e')+_0x15c86f,'exten':_0x544bac['exten'],'context':_0x544bac[_0x536c('0x16')],'priority':_0x39a1f6[_0x536c('0x10')]+_0x49eccc,'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0]['VoiceExtensionId']});}_0x544bac[_0x536c('0x10')]=_0x8dc9e1[_0x536c('0x2b')]?_['last'](_0x8dc9e1)[_0x536c('0x10')]+0x1:_0x39a1f6[_0x536c('0x10')];_0x39a1f6[_0x536c('0x10')]=(_0x2cf3f7['length']?_['last'](_0x2cf3f7)[_0x536c('0x10')]:_0x544bac['priority'])+0x1;_0x39a1f6[_0x536c('0x11')]=_[_0x536c('0x3f')](_0x39a1f6[_0x536c('0x11')],_0x8dc9e1,[_0x544bac],_0x2cf3f7);}_0x39a1f6[_0x536c('0x11')][_0x536c('0x12')]({'type':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x13')],'app':_0x536c('0x40'),'exten':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x9')],'context':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x16')],'priority':_0x39a1f6[_0x536c('0x10')],'VoiceExtensionId':_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]});_0x45c261['push'](_0xf40f9b[_0x4e17fc][0x0][_0x536c('0x19')]);_0x1bf06e=_[_0x536c('0x3f')](_0x1bf06e,_0x39a1f6[_0x536c('0x11')]);}}return _0x40be5f['transaction'](function(_0x22a825){return _0x40be5f[_0x536c('0x2')][_0x536c('0x5')][_0x536c('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x45c261}},'transaction':_0x22a825})[_0x536c('0x3')](function(_0x2764b6){return _0x40be5f[_0x536c('0x2')][_0x536c('0x5')]['bulkCreate'](_['sortBy'](_0x1bf06e,_0x536c('0x10')),{'transaction':_0x22a825});});});})[_0x536c('0x42')](function(_0x32797b){console['error'](_0x32797b);});}exports[_0x536c('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index a8185c0..19fe8f5 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 _0x98c0=['errors','map','message','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','length','duplicate','Duplicate\x20Contact','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','ContactId','updatedAt','select','field','toString','NOW()','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','fromQuery','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','Campaign','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x98c0,0x128));var _0x098c=function(_0x4f78e9,_0x1cc794){_0x4f78e9=_0x4f78e9-0x0;var _0x32ec94=_0x98c0[_0x4f78e9];return _0x32ec94;};'use strict';var BPromise=require(_0x098c('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x098c('0x1'));var Papa=require('papaparse');var Redis=require(_0x098c('0x2'));var db=require(_0x098c('0x3'))['db'];var config=require(_0x098c('0x4'));var logger=require(_0x098c('0x5'))(_0x098c('0x6'));config[_0x098c('0x7')]=_[_0x098c('0x8')](config[_0x098c('0x7')],{'host':_0x098c('0x9'),'port':0x18eb});var socket=require(_0x098c('0xa'))(new Redis(config[_0x098c('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x098c('0xb')][0x2]||process[_0x098c('0xb')][0x2]===_0x098c('0xc')||process['argv'][0x2]===_0x098c('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x098c('0xb')][0x2];if(!process['argv'][0x3]||process[_0x098c('0xb')][0x3]===_0x098c('0xc')||process[_0x098c('0xb')][0x3]===_0x098c('0xd')||!process[_0x098c('0xb')][0x4]||process[_0x098c('0xb')][0x4]==='undefined'||process[_0x098c('0xb')][0x4]===_0x098c('0xd')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x098c('0xe')](process['argv'][0x3]['split'](','),process[_0x098c('0xb')][0x4][_0x098c('0xf')](','));if(!process[_0x098c('0xb')][0x5]||process[_0x098c('0xb')][0x5]===_0x098c('0xc')||process[_0x098c('0xb')][0x5]==='null'){throw new Error(_0x098c('0x10'));}var LISTID=process[_0x098c('0xb')][0x5];var COMPANYID=process[_0x098c('0xb')][0x6]&&process[_0x098c('0xb')][0x6]!==_0x098c('0xc')&&process[_0x098c('0xb')][0x6]!==_0x098c('0xd')?process[_0x098c('0xb')][0x6]:null;var DUPLICATES=process[_0x098c('0xb')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x098c('0xb')][0x7]!==_0x098c('0xd')?process[_0x098c('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0x098c('0xb')][0x8]==='undefined'||process[_0x098c('0xb')][0x8]===_0x098c('0xd')){throw new Error(_0x098c('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xd51ebd){logger[_0x098c('0x12')](_0xd51ebd);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(_0x17db93,_0x4d2375,_0x127ffb,_0x44c391){var _0x53c6f8={'message':_0x4d2375};_0x53c6f8[_0x17db93]=!![];if(_0x127ffb){_0x53c6f8['contact']=_0x127ffb;}if(_0x44c391){_0x53c6f8[_0x098c('0x13')]=_0x44c391;}return _0x53c6f8;}function isEmail(_0x27e2c6){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'](_0x27e2c6);}function checkRow(_0x4936ba,_0x1e4085,_0x1260b8){return new BPromise(function(_0x4d0ac3,_0x1f89a9){if(_[_0x098c('0x14')](_0x4936ba)){return _0x1f89a9(handleCheckRowError(_0x098c('0x12'),_0x098c('0x15'),null,_0x1260b8));}if(_0x4936ba[_0x098c('0x16')]&&_0x4936ba[_0x098c('0x16')]['length']){var _0x26a40f=_[_0x098c('0x17')](_0x4936ba['errors'],_0x098c('0x18'))['join'](';');return _0x1f89a9(handleCheckRowError(_0x098c('0x12'),_0x26a40f,null,_0x1260b8));}var _0x542ba7={};for(var _0x62e4f8 in FIELDS){if(FIELDS['hasOwnProperty'](_0x62e4f8)&&FIELDS[_0x62e4f8]){_0x542ba7[_0x62e4f8]=_0x4936ba[_0x098c('0x19')][0x0][FIELDS[_0x62e4f8]]||_0x4936ba[_0x098c('0x19')][0x0]['\ufeff'+FIELDS[_0x62e4f8]];}}if(!_0x542ba7[_0x098c('0x1a')]){return _0x1f89a9(handleCheckRowError(_0x098c('0x12'),_0x098c('0x1b'),null,_0x1260b8));}if(!_0x542ba7[_0x098c('0x1c')]){return _0x1f89a9(handleCheckRowError(_0x098c('0x12'),_0x098c('0x1d'),null,_0x1260b8));}if(_0x542ba7[_0x098c('0x1e')]){var _0x52fcc0=moment(_0x542ba7['birthDate'],'YYYY-MM-DD');if(!_0x52fcc0[_0x098c('0x1f')]()){return _0x1f89a9(handleCheckRowError('error',_0x098c('0x20'),null,_0x1260b8));}}if(_0x542ba7[_0x098c('0x21')]){if(!isEmail(_0x542ba7[_0x098c('0x21')])){return _0x1f89a9(handleCheckRowError('error',_0x098c('0x22'),null,_0x1260b8));}}_0x542ba7[_0x098c('0x23')]=LISTID;_0x542ba7['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x098c('0x24')]&&_0x1e4085){var _0x5e18bc={};for(var _0x34c5d6=0x0,_0x976e75=DUPLICATES[_0x098c('0x24')];_0x34c5d6<_0x976e75;_0x34c5d6+=0x1){_0x5e18bc[DUPLICATES[_0x34c5d6]]=_0x542ba7[DUPLICATES[_0x34c5d6]];}var _0x1b3ecc=_['find'](_0x1e4085,_0x5e18bc);if(_0x1b3ecc){return _0x1f89a9(handleCheckRowError(_0x098c('0x25'),_0x098c('0x26'),_0x1b3ecc,_0x1260b8));}}return db[_0x098c('0x27')][_0x098c('0x28')](_0x542ba7,{'raw':!![],'hooks':![],'fields':_['keys'](_0x542ba7)})['then'](function(_0x54a85f){if(DUPLICATES&&DUPLICATES[_0x098c('0x24')]&&_0x1e4085){_0x1e4085[_0x098c('0x29')](_[_0x098c('0x2a')](_0x542ba7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x54a85f['id'];return _0x4d0ac3();})[_0x098c('0x2b')](function(_0x2f9879){return _0x1f89a9(handleCheckRowError('error',_0x098c('0x2c')+(_0x2f9879[_0x098c('0x18')]||JSON[_0x098c('0x2d')](_0x2f9879)),null,_0x1260b8));});});}function checkHopper(){function _0x48633e(){return function(_0x729988){logger[_0x098c('0x12')](_0x098c('0x2e'),_0x098c('0x2f'),util[_0x098c('0x30')](_0x729988,{'showHidden':![],'depth':null}));};}var _0x5c73e2=function(_0x42e526,_0x3c59bb){var _0xb3a48b=squel[_0x098c('0x31')]()[_0x098c('0x32')](_0x098c('0x33'))['fromQuery']([_0x098c('0x1c'),_0x098c('0x34'),_0x098c('0x35'),_0x098c('0x23'),_0x3c59bb,'createdAt',_0x098c('0x36')],squel[_0x098c('0x37')]()['field']('phone',_0x098c('0x1c'))[_0x098c('0x38')]('NOW()',_0x098c('0x34'))[_0x098c('0x38')]('id',_0x098c('0x35'))[_0x098c('0x38')](LISTID[_0x098c('0x39')](),_0x098c('0x23'))['field'](_0x42e526['id'][_0x098c('0x39')](),_0x3c59bb)[_0x098c('0x38')](_0x098c('0x3a'),_0x098c('0x3b'))['field']('NOW()',_0x098c('0x36'))[_0x098c('0x3c')](_0x098c('0x3d'))[_0x098c('0x3e')](_0x098c('0x3f'))[_0x098c('0x3e')](_0x098c('0x40'),LISTID[_0x098c('0x39')]())['where'](_0x098c('0x41'))['where'](_0x098c('0x42'),squel['select']()[_0x098c('0x38')]('phone')['from'](_0x098c('0x33'))[_0x098c('0x3e')](_0x3c59bb+'\x20=\x20?',_0x42e526['id'][_0x098c('0x39')]())))['toString']();return _0xb3a48b;};var _0x42f03c=function(_0xcfeddf,_0x52efc9){var _0x2c88ac=squel[_0x098c('0x31')]()[_0x098c('0x32')](_0x098c('0x33'))[_0x098c('0x43')](['phone',_0x098c('0x34'),_0x098c('0x35'),_0x098c('0x23'),_0x52efc9,_0x098c('0x3b'),_0x098c('0x36')],squel['select']()[_0x098c('0x38')]('phone',_0x098c('0x1c'))['field'](_0x098c('0x3a'),_0x098c('0x34'))[_0x098c('0x38')]('id',_0x098c('0x35'))[_0x098c('0x38')](LISTID[_0x098c('0x39')](),_0x098c('0x23'))[_0x098c('0x38')](_0xcfeddf['id']['toString'](),_0x52efc9)[_0x098c('0x38')](_0x098c('0x3a'),_0x098c('0x3b'))['field'](_0x098c('0x3a'),'updatedAt')[_0x098c('0x3c')](_0x098c('0x3d'))[_0x098c('0x3e')](_0x098c('0x3f'))[_0x098c('0x3e')](_0x098c('0x40'),LISTID[_0x098c('0x39')]())[_0x098c('0x3e')](_0x098c('0x44'),squel[_0x098c('0x45')](hopperContacts))[_0x098c('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x098c('0x3e')](_0x098c('0x42'),squel['select']()['field'](_0x098c('0x46'))[_0x098c('0x3c')](_0x098c('0x47'))['where'](_0x52efc9+_0x098c('0x48'),_0xcfeddf['id'][_0x098c('0x39')]()))[_0x098c('0x3e')](_0x098c('0x42'),squel['select']()['field'](_0x098c('0x1c'))[_0x098c('0x3c')](_0x098c('0x33'))[_0x098c('0x3e')](_0x52efc9+'\x20=\x20?',_0xcfeddf['id']['toString']())))[_0x098c('0x39')]();return _0x2c88ac;};function _0x505a20(_0x2fd0b7,_0x5c0f75){var _0x4c7a84=squel['insert']()[_0x098c('0x32')](_0x098c('0x33'))[_0x098c('0x43')](['phone','scheduledAt','ContactId',_0x098c('0x23'),_0x5c0f75,_0x098c('0x3b'),'updatedAt'],squel[_0x098c('0x37')]()['field']('phone','phone')[_0x098c('0x38')]('NOW()',_0x098c('0x34'))[_0x098c('0x38')]('id',_0x098c('0x35'))[_0x098c('0x38')](LISTID['toString'](),_0x098c('0x23'))[_0x098c('0x38')](_0x2fd0b7['id'][_0x098c('0x39')](),_0x5c0f75)[_0x098c('0x38')](_0x098c('0x3a'),'createdAt')[_0x098c('0x38')](_0x098c('0x3a'),_0x098c('0x36'))[_0x098c('0x3c')]('cm_contacts')[_0x098c('0x3e')]('deletedAt\x20IS\x20NULL')[_0x098c('0x3e')](_0x098c('0x40'),LISTID['toString']())[_0x098c('0x3e')](_0x098c('0x44'),squel[_0x098c('0x45')](hopperContacts))[_0x098c('0x3e')](_0x098c('0x41')))[_0x098c('0x39')]();return _0x4c7a84;}function _0x18ea19(_0x521364,_0x237f22){var _0x44ef65=squel[_0x098c('0x31')]()[_0x098c('0x32')]('cm_hopper_black')[_0x098c('0x43')](['phone',_0x098c('0x35'),'ListId',_0x237f22,_0x098c('0x3b'),_0x098c('0x36')],squel[_0x098c('0x37')]()['field'](_0x098c('0x1c'),_0x098c('0x1c'))[_0x098c('0x38')]('id',_0x098c('0x35'))['field'](LISTID[_0x098c('0x39')](),_0x098c('0x23'))[_0x098c('0x38')](_0x521364['id'][_0x098c('0x39')](),_0x237f22)[_0x098c('0x38')](_0x098c('0x3a'),'createdAt')[_0x098c('0x38')](_0x098c('0x3a'),'updatedAt')[_0x098c('0x3c')]('cm_contacts')[_0x098c('0x3e')]('deletedAt\x20IS\x20NULL')[_0x098c('0x3e')](_0x098c('0x40'),LISTID[_0x098c('0x39')]())[_0x098c('0x3e')](_0x098c('0x44'),squel[_0x098c('0x45')](hopperContacts))[_0x098c('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x44ef65;}return db[_0x098c('0x49')][_0x098c('0x4a')]({'where':{'type':_0x098c('0x4b')},'attributes':['id',_0x098c('0x4c')],'include':[{'model':db[_0x098c('0x4d')],'as':_0x098c('0x4e'),'where':{'id':LISTID}}]})[_0x098c('0x4f')](function(_0x31b9c8){var _0x3baf6b=[];if(_0x31b9c8){var _0x364406;for(var _0x3f9430=0x0,_0x2b12bb;_0x3f9430<_0x31b9c8['length'];_0x3f9430+=0x1){_0x2b12bb=_0x31b9c8[_0x3f9430][_0x098c('0x50')]({'plain':!![]});switch(_0x2b12bb[_0x098c('0x4c')]){case _0x098c('0x51'):_0x3baf6b['push'](db['sequelize'][_0x098c('0x52')](_0x42f03c(_0x2b12bb,_0x098c('0x53')))[_0x098c('0x4f')](function(){})[_0x098c('0x2b')](_0x48633e()));break;case _0x098c('0x54'):_0x3baf6b[_0x098c('0x29')](db[_0x098c('0x55')][_0x098c('0x52')](_0x5c73e2(_0x2b12bb,_0x098c('0x53')))['then'](function(){})[_0x098c('0x2b')](_0x48633e()));break;default:_0x3baf6b['push'](db[_0x098c('0x55')][_0x098c('0x52')](_0x505a20(_0x2b12bb,_0x098c('0x53')))[_0x098c('0x4f')](function(){})['catch'](_0x48633e()));}}}return _0x3baf6b;})[_0x098c('0x56')]()[_0x098c('0x4f')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x098c('0x4b')},'attributes':['id'],'include':[{'model':db[_0x098c('0x4d')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x098c('0x4f')](function(_0x5a6ea2){var _0x4a41b9=[];if(_0x5a6ea2){var _0x2298f6;for(var _0x4bff8c=0x0,_0xfd7cd5;_0x4bff8c<_0x5a6ea2['length'];_0x4bff8c+=0x1){_0xfd7cd5=_0x5a6ea2[_0x4bff8c]['get']({'plain':!![]});_0x4a41b9[_0x098c('0x29')](db[_0x098c('0x55')][_0x098c('0x52')](_0x18ea19(_0xfd7cd5,_0x098c('0x53')))[_0x098c('0x4f')](function(){})[_0x098c('0x2b')](_0x48633e()));}}return _0x4a41b9;})[_0x098c('0x56')]();})['then'](function(){return db[_0x098c('0x57')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x098c('0x4d')],'as':_0x098c('0x4e'),'where':{'id':LISTID}}]})[_0x098c('0x4f')](function(_0x4df8fd){var _0x5b370c=[];if(_0x4df8fd){for(var _0x56926f=0x0,_0x15b581;_0x56926f<_0x4df8fd[_0x098c('0x24')];_0x56926f+=0x1){_0x15b581=_0x4df8fd[_0x56926f]['get']({'plain':!![]});switch(_0x15b581[_0x098c('0x4c')]){case'always':_0x5b370c[_0x098c('0x29')](db[_0x098c('0x55')][_0x098c('0x52')](_0x42f03c(_0x15b581,_0x098c('0x58')))[_0x098c('0x4f')](function(){})['catch'](_0x48633e()));break;case'onlyIfOpen':_0x5b370c[_0x098c('0x29')](db[_0x098c('0x55')][_0x098c('0x52')](_0x5c73e2(_0x15b581,_0x098c('0x58')))[_0x098c('0x4f')](function(){})[_0x098c('0x2b')](_0x48633e()));break;default:_0x5b370c[_0x098c('0x29')](db[_0x098c('0x55')][_0x098c('0x52')](_0x505a20(_0x15b581,_0x098c('0x58')))[_0x098c('0x4f')](function(){})[_0x098c('0x2b')](_0x48633e()));}}}return _0x5b370c;})[_0x098c('0x56')]();})['then'](function(){return db[_0x098c('0x57')][_0x098c('0x4a')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x098c('0x59'),'where':{'id':LISTID}}]})[_0x098c('0x4f')](function(_0xadb945){var _0x327f8d=[];if(_0xadb945){for(var _0x24523e=0x0,_0x11b674;_0x24523e<_0xadb945[_0x098c('0x24')];_0x24523e+=0x1){_0x11b674=_0xadb945[_0x24523e]['get']({'plain':!![]});_0x327f8d[_0x098c('0x29')](db[_0x098c('0x55')][_0x098c('0x52')](_0x18ea19(_0x11b674,_0x098c('0x58')))['then'](function(){})[_0x098c('0x2b')](_0x48633e()));}}return _0x327f8d;})[_0x098c('0x56')]();})[_0x098c('0x2b')](function(_0xb19af0){logger[_0x098c('0x12')]('cmContact,\x20%s,\x20%s',_0x098c('0x5a'),_0xb19af0[_0x098c('0x18')]);});}var processPromises=function(_0x1bdd02){return BPromise['all'](promises)['then'](function(_0x2b84c7){})[_0x098c('0x2b')](function(_0x54b7b2){logger[_0x098c('0x12')](_0x098c('0x5b'),JSON[_0x098c('0x2d')](_0x54b7b2));})['finally'](function(){socket['emit'](_0x098c('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1bdd02){return _0x1bdd02[_0x098c('0x5d')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x098c('0x4f')](function(){if(hopperContacts){return checkHopper();}})[_0x098c('0x4f')](function(){socket[_0x098c('0x5e')](_0x098c('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x098c('0x5f')](FILEPATH);}catch(_0x2e8283){logger[_0x098c('0x12')](_0x098c('0x60'),JSON[_0x098c('0x2d')](_0x2e8283));}finally{process[_0x098c('0x61')](0x0);}});};process['on'](_0x098c('0x62'),function(){logger[_0x098c('0x63')](_0x098c('0x64'));endCsv();});function main(){return BPromise[_0x098c('0x65')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x098c('0xf')](',');return db[_0x098c('0x27')][_0x098c('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x098c('0x4f')](function(_0x1a0309){var _0x554e6a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x554e6a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x19626f,_0x3c0827){total+=0x1;var _0x2065a7=total;promises[_0x098c('0x29')](checkRow(_0x19626f,_0x1a0309,_0x2065a7)[_0x098c('0x4f')](function(){success+=0x1;})[_0x098c('0x2b')](function(_0x2d4eaa){if(_0x2d4eaa[_0x098c('0x12')]){errors+=0x1;delete _0x2d4eaa[_0x098c('0x12')];}else if(_0x2d4eaa[_0x098c('0x25')]){duplicates+=0x1;delete _0x2d4eaa[_0x098c('0x25')];}rows[_0x098c('0x29')](_0x2d4eaa);}));if(total%0xc8===0x0){_0x3c0827[_0x098c('0x66')]();return processPromises(_0x3c0827);}},'complete':function(){return processPromises()['then'](function(){logger[_0x098c('0x63')](_0x098c('0x67'));endCsv();});},'error':function(_0x146b7e,_0x67e30){logger[_0x098c('0x63')](_0x098c('0x68'),JSON[_0x098c('0x2d')](_0x146b7e));endCsv();}});})['catch'](function(_0x128517){logger[_0x098c('0x12')](_0x098c('0x69'),JSON[_0x098c('0x2d')](_0x128517));});}main(); \ No newline at end of file +var _0x6f5a=['error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','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','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','fromQuery','scheduledAt','ContactId','createdAt','select','phone','field','toString','NOW()','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','from','cm_hopper','\x20=\x20?','insert','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','all','VoiceQueue','BlackLists','query','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!'];(function(_0xf3e4a0,_0x16a172){var _0x43f1cc=function(_0x3abdf5){while(--_0x3abdf5){_0xf3e4a0['push'](_0xf3e4a0['shift']());}};_0x43f1cc(++_0x16a172);}(_0x6f5a,0x19b));var _0xa6f5=function(_0x1f8376,_0x38684b){_0x1f8376=_0x1f8376-0x0;var _0xee8e37=_0x6f5a[_0x1f8376];return _0xee8e37;};'use strict';var BPromise=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xa6f5('0x2'));var Papa=require(_0xa6f5('0x3'));var Redis=require('ioredis');var db=require(_0xa6f5('0x4'))['db'];var config=require(_0xa6f5('0x5'));var logger=require(_0xa6f5('0x6'))(_0xa6f5('0x7'));config[_0xa6f5('0x8')]=_[_0xa6f5('0x9')](config[_0xa6f5('0x8')],{'host':_0xa6f5('0xa'),'port':0x18eb});var socket=require(_0xa6f5('0xb'))(new Redis(config[_0xa6f5('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0xa6f5('0xc')](socket);try{if(!process[_0xa6f5('0xd')][0x2]||process[_0xa6f5('0xd')][0x2]===_0xa6f5('0xe')||process[_0xa6f5('0xd')][0x2]===_0xa6f5('0xf')){throw new Error(_0xa6f5('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0xa6f5('0xd')][0x3]||process[_0xa6f5('0xd')][0x3]===_0xa6f5('0xe')||process[_0xa6f5('0xd')][0x3]===_0xa6f5('0xf')||!process[_0xa6f5('0xd')][0x4]||process[_0xa6f5('0xd')][0x4]==='undefined'||process[_0xa6f5('0xd')][0x4]===_0xa6f5('0xf')){throw new Error(_0xa6f5('0x11'));}var FIELDS=_[_0xa6f5('0x12')](process['argv'][0x3]['split'](','),process[_0xa6f5('0xd')][0x4][_0xa6f5('0x13')](','));if(!process[_0xa6f5('0xd')][0x5]||process[_0xa6f5('0xd')][0x5]===_0xa6f5('0xe')||process[_0xa6f5('0xd')][0x5]===_0xa6f5('0xf')){throw new Error(_0xa6f5('0x14'));}var LISTID=process[_0xa6f5('0xd')][0x5];var COMPANYID=process[_0xa6f5('0xd')][0x6]&&process[_0xa6f5('0xd')][0x6]!=='undefined'&&process[_0xa6f5('0xd')][0x6]!==_0xa6f5('0xf')?process[_0xa6f5('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xa6f5('0xd')][0x7]!=='undefined'&&process[_0xa6f5('0xd')][0x7]!==_0xa6f5('0xf')?process[_0xa6f5('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0xa6f5('0xd')][0x8]===_0xa6f5('0xe')||process[_0xa6f5('0xd')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x440873){logger[_0xa6f5('0x15')](_0x440873);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(_0x146e4f,_0x127e7a,_0x5ad863,_0x57a763){var _0x3ce5be={'message':_0x127e7a};_0x3ce5be[_0x146e4f]=!![];if(_0x5ad863){_0x3ce5be[_0xa6f5('0x16')]=_0x5ad863;}if(_0x57a763){_0x3ce5be['index']=_0x57a763;}return _0x3ce5be;}function isEmail(_0x2ad5f1){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))*$/[_0xa6f5('0x17')](_0x2ad5f1);}function checkRow(_0x535958,_0x3c8a18,_0x39a84b){return new BPromise(function(_0xcb61e4,_0x1f8159){if(_[_0xa6f5('0x18')](_0x535958)){return _0x1f8159(handleCheckRowError(_0xa6f5('0x15'),_0xa6f5('0x19'),null,_0x39a84b));}if(_0x535958['errors']&&_0x535958[_0xa6f5('0x1a')][_0xa6f5('0x1b')]){var _0x596ef3=_[_0xa6f5('0x1c')](_0x535958[_0xa6f5('0x1a')],_0xa6f5('0x1d'))['join'](';');return _0x1f8159(handleCheckRowError(_0xa6f5('0x15'),_0x596ef3,null,_0x39a84b));}var _0x1c068e={};for(var _0x5d818b in FIELDS){if(FIELDS['hasOwnProperty'](_0x5d818b)&&FIELDS[_0x5d818b]){_0x1c068e[_0x5d818b]=_0x535958[_0xa6f5('0x1e')][0x0][FIELDS[_0x5d818b]]||_0x535958[_0xa6f5('0x1e')][0x0]['\ufeff'+FIELDS[_0x5d818b]];}}if(!_0x1c068e[_0xa6f5('0x1f')]){return _0x1f8159(handleCheckRowError(_0xa6f5('0x15'),'firstName\x20not\x20specified!',null,_0x39a84b));}if(!_0x1c068e['phone']){return _0x1f8159(handleCheckRowError(_0xa6f5('0x15'),_0xa6f5('0x20'),null,_0x39a84b));}if(_0x1c068e[_0xa6f5('0x21')]){var _0x3754b7=moment(_0x1c068e['birthDate'],_0xa6f5('0x22'));if(!_0x3754b7[_0xa6f5('0x23')]()){return _0x1f8159(handleCheckRowError('error',_0xa6f5('0x24'),null,_0x39a84b));}}if(_0x1c068e['email']){if(!isEmail(_0x1c068e[_0xa6f5('0x25')])){return _0x1f8159(handleCheckRowError(_0xa6f5('0x15'),_0xa6f5('0x26'),null,_0x39a84b));}}_0x1c068e[_0xa6f5('0x27')]=LISTID;_0x1c068e['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3c8a18){var _0x231fd6={};for(var _0x250676=0x0,_0x1ecb7c=DUPLICATES[_0xa6f5('0x1b')];_0x250676<_0x1ecb7c;_0x250676+=0x1){_0x231fd6[DUPLICATES[_0x250676]]=_0x1c068e[DUPLICATES[_0x250676]];}var _0xab2b19=_[_0xa6f5('0x28')](_0x3c8a18,_0x231fd6);if(_0xab2b19){return _0x1f8159(handleCheckRowError(_0xa6f5('0x29'),_0xa6f5('0x2a'),_0xab2b19,_0x39a84b));}}return db[_0xa6f5('0x2b')][_0xa6f5('0x2c')](_0x1c068e,{'raw':!![],'hooks':![],'fields':_[_0xa6f5('0x2d')](_0x1c068e)})[_0xa6f5('0x2e')](function(_0x2490f0){if(DUPLICATES&&DUPLICATES[_0xa6f5('0x1b')]&&_0x3c8a18){_0x3c8a18[_0xa6f5('0x2f')](_['pick'](_0x1c068e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2490f0['id'];return _0xcb61e4();})[_0xa6f5('0x30')](function(_0x23ef37){return _0x1f8159(handleCheckRowError('error',_0xa6f5('0x31')+(_0x23ef37[_0xa6f5('0x1d')]||JSON[_0xa6f5('0x32')](_0x23ef37)),null,_0x39a84b));});});}function checkHopper(){function _0x10ab07(){return function(_0x5a2e99){logger[_0xa6f5('0x15')]('cmContact','checkHopper',util[_0xa6f5('0x33')](_0x5a2e99,{'showHidden':![],'depth':null}));};}var _0x244586=function(_0x352420,_0x758f26){var _0x115d8d=squel['insert']()['into']('cm_hopper')[_0xa6f5('0x34')](['phone',_0xa6f5('0x35'),_0xa6f5('0x36'),'ListId',_0x758f26,_0xa6f5('0x37'),'updatedAt'],squel[_0xa6f5('0x38')]()['field']('phone',_0xa6f5('0x39'))[_0xa6f5('0x3a')]('NOW()',_0xa6f5('0x35'))[_0xa6f5('0x3a')]('id',_0xa6f5('0x36'))['field'](LISTID['toString'](),_0xa6f5('0x27'))['field'](_0x352420['id'][_0xa6f5('0x3b')](),_0x758f26)['field'](_0xa6f5('0x3c'),_0xa6f5('0x37'))['field'](_0xa6f5('0x3c'),_0xa6f5('0x3d'))['from'](_0xa6f5('0x3e'))[_0xa6f5('0x3f')](_0xa6f5('0x40'))[_0xa6f5('0x3f')](_0xa6f5('0x41'),LISTID[_0xa6f5('0x3b')]())[_0xa6f5('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa6f5('0x38')]()[_0xa6f5('0x3a')](_0xa6f5('0x39'))[_0xa6f5('0x42')](_0xa6f5('0x43'))[_0xa6f5('0x3f')](_0x758f26+_0xa6f5('0x44'),_0x352420['id'][_0xa6f5('0x3b')]())))[_0xa6f5('0x3b')]();return _0x115d8d;};var _0x1c1a93=function(_0x570262,_0x5aac81){var _0x411bbd=squel[_0xa6f5('0x45')]()[_0xa6f5('0x46')](_0xa6f5('0x43'))['fromQuery']([_0xa6f5('0x39'),'scheduledAt',_0xa6f5('0x36'),_0xa6f5('0x27'),_0x5aac81,_0xa6f5('0x37'),_0xa6f5('0x3d')],squel[_0xa6f5('0x38')]()[_0xa6f5('0x3a')](_0xa6f5('0x39'),_0xa6f5('0x39'))[_0xa6f5('0x3a')](_0xa6f5('0x3c'),_0xa6f5('0x35'))[_0xa6f5('0x3a')]('id','ContactId')[_0xa6f5('0x3a')](LISTID[_0xa6f5('0x3b')](),_0xa6f5('0x27'))[_0xa6f5('0x3a')](_0x570262['id'][_0xa6f5('0x3b')](),_0x5aac81)[_0xa6f5('0x3a')](_0xa6f5('0x3c'),_0xa6f5('0x37'))[_0xa6f5('0x3a')](_0xa6f5('0x3c'),'updatedAt')['from'](_0xa6f5('0x3e'))[_0xa6f5('0x3f')]('deletedAt\x20IS\x20NULL')[_0xa6f5('0x3f')]('ListId\x20=\x20?',LISTID[_0xa6f5('0x3b')]())[_0xa6f5('0x3f')](_0xa6f5('0x47'),squel[_0xa6f5('0x48')](hopperContacts))[_0xa6f5('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xa6f5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xa6f5('0x3a')](_0xa6f5('0x49'))[_0xa6f5('0x42')](_0xa6f5('0x4a'))[_0xa6f5('0x3f')](_0x5aac81+_0xa6f5('0x44'),_0x570262['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa6f5('0x38')]()['field'](_0xa6f5('0x39'))['from'](_0xa6f5('0x43'))[_0xa6f5('0x3f')](_0x5aac81+_0xa6f5('0x44'),_0x570262['id']['toString']())))[_0xa6f5('0x3b')]();return _0x411bbd;};function _0x4fbf14(_0x7729f,_0x588775){var _0x503337=squel['insert']()[_0xa6f5('0x46')](_0xa6f5('0x43'))[_0xa6f5('0x34')]([_0xa6f5('0x39'),'scheduledAt',_0xa6f5('0x36'),_0xa6f5('0x27'),_0x588775,'createdAt','updatedAt'],squel[_0xa6f5('0x38')]()[_0xa6f5('0x3a')]('phone',_0xa6f5('0x39'))[_0xa6f5('0x3a')](_0xa6f5('0x3c'),_0xa6f5('0x35'))[_0xa6f5('0x3a')]('id',_0xa6f5('0x36'))[_0xa6f5('0x3a')](LISTID[_0xa6f5('0x3b')](),_0xa6f5('0x27'))[_0xa6f5('0x3a')](_0x7729f['id'][_0xa6f5('0x3b')](),_0x588775)[_0xa6f5('0x3a')]('NOW()',_0xa6f5('0x37'))['field'](_0xa6f5('0x3c'),_0xa6f5('0x3d'))['from']('cm_contacts')[_0xa6f5('0x3f')]('deletedAt\x20IS\x20NULL')[_0xa6f5('0x3f')](_0xa6f5('0x41'),LISTID[_0xa6f5('0x3b')]())[_0xa6f5('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa6f5('0x3b')]();return _0x503337;}function _0x3446b1(_0x4740ef,_0x46ba64){var _0x351c29=squel[_0xa6f5('0x45')]()[_0xa6f5('0x46')](_0xa6f5('0x4b'))[_0xa6f5('0x34')]([_0xa6f5('0x39'),_0xa6f5('0x36'),_0xa6f5('0x27'),_0x46ba64,'createdAt',_0xa6f5('0x3d')],squel[_0xa6f5('0x38')]()['field'](_0xa6f5('0x39'),_0xa6f5('0x39'))['field']('id',_0xa6f5('0x36'))[_0xa6f5('0x3a')](LISTID[_0xa6f5('0x3b')](),_0xa6f5('0x27'))[_0xa6f5('0x3a')](_0x4740ef['id'][_0xa6f5('0x3b')](),_0x46ba64)[_0xa6f5('0x3a')]('NOW()',_0xa6f5('0x37'))[_0xa6f5('0x3a')](_0xa6f5('0x3c'),'updatedAt')['from']('cm_contacts')['where'](_0xa6f5('0x40'))[_0xa6f5('0x3f')](_0xa6f5('0x41'),LISTID[_0xa6f5('0x3b')]())[_0xa6f5('0x3f')](_0xa6f5('0x47'),squel[_0xa6f5('0x48')](hopperContacts))[_0xa6f5('0x3f')](_0xa6f5('0x4c')))[_0xa6f5('0x3b')]();return _0x351c29;}return db['VoiceQueue'][_0xa6f5('0x4d')]({'where':{'type':_0xa6f5('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xa6f5('0x4f')],'as':_0xa6f5('0x50'),'where':{'id':LISTID}}]})[_0xa6f5('0x2e')](function(_0x21778a){var _0x42c8ca=[];if(_0x21778a){var _0x20bdef;for(var _0x449e84=0x0,_0x506c57;_0x449e84<_0x21778a[_0xa6f5('0x1b')];_0x449e84+=0x1){_0x506c57=_0x21778a[_0x449e84][_0xa6f5('0x51')]({'plain':!![]});switch(_0x506c57[_0xa6f5('0x52')]){case _0xa6f5('0x53'):_0x42c8ca[_0xa6f5('0x2f')](db[_0xa6f5('0x54')]['query'](_0x1c1a93(_0x506c57,_0xa6f5('0x55')))[_0xa6f5('0x2e')](function(){})[_0xa6f5('0x30')](_0x10ab07()));break;case _0xa6f5('0x56'):_0x42c8ca[_0xa6f5('0x2f')](db[_0xa6f5('0x54')]['query'](_0x244586(_0x506c57,_0xa6f5('0x55')))[_0xa6f5('0x2e')](function(){})[_0xa6f5('0x30')](_0x10ab07()));break;default:_0x42c8ca[_0xa6f5('0x2f')](db['sequelize']['query'](_0x4fbf14(_0x506c57,_0xa6f5('0x55')))[_0xa6f5('0x2e')](function(){})[_0xa6f5('0x30')](_0x10ab07()));}}}return _0x42c8ca;})[_0xa6f5('0x57')]()[_0xa6f5('0x2e')](function(){return db[_0xa6f5('0x58')][_0xa6f5('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xa6f5('0x4f')],'as':_0xa6f5('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x525660){var _0x5c3751=[];if(_0x525660){var _0xb5846b;for(var _0x34f02b=0x0,_0x58cd19;_0x34f02b<_0x525660[_0xa6f5('0x1b')];_0x34f02b+=0x1){_0x58cd19=_0x525660[_0x34f02b][_0xa6f5('0x51')]({'plain':!![]});_0x5c3751['push'](db['sequelize'][_0xa6f5('0x5a')](_0x3446b1(_0x58cd19,_0xa6f5('0x55')))[_0xa6f5('0x2e')](function(){})[_0xa6f5('0x30')](_0x10ab07()));}}return _0x5c3751;})[_0xa6f5('0x57')]();})['then'](function(){return db[_0xa6f5('0x5b')][_0xa6f5('0x4d')]({'attributes':['id',_0xa6f5('0x52')],'include':[{'model':db[_0xa6f5('0x4f')],'as':_0xa6f5('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x4e7806){var _0x2c5ee4=[];if(_0x4e7806){for(var _0x2e17d5=0x0,_0xa3371;_0x2e17d5<_0x4e7806[_0xa6f5('0x1b')];_0x2e17d5+=0x1){_0xa3371=_0x4e7806[_0x2e17d5][_0xa6f5('0x51')]({'plain':!![]});switch(_0xa3371[_0xa6f5('0x52')]){case _0xa6f5('0x53'):_0x2c5ee4[_0xa6f5('0x2f')](db[_0xa6f5('0x54')]['query'](_0x1c1a93(_0xa3371,_0xa6f5('0x5c')))['then'](function(){})[_0xa6f5('0x30')](_0x10ab07()));break;case'onlyIfOpen':_0x2c5ee4['push'](db[_0xa6f5('0x54')]['query'](_0x244586(_0xa3371,_0xa6f5('0x5c')))[_0xa6f5('0x2e')](function(){})[_0xa6f5('0x30')](_0x10ab07()));break;default:_0x2c5ee4[_0xa6f5('0x2f')](db[_0xa6f5('0x54')]['query'](_0x4fbf14(_0xa3371,'CampaignId'))[_0xa6f5('0x2e')](function(){})[_0xa6f5('0x30')](_0x10ab07()));}}}return _0x2c5ee4;})[_0xa6f5('0x57')]();})[_0xa6f5('0x2e')](function(){return db[_0xa6f5('0x5b')][_0xa6f5('0x4d')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xa6f5('0x59'),'where':{'id':LISTID}}]})[_0xa6f5('0x2e')](function(_0x2e0a60){var _0x187f04=[];if(_0x2e0a60){for(var _0xd3eb90=0x0,_0x21d2db;_0xd3eb90<_0x2e0a60[_0xa6f5('0x1b')];_0xd3eb90+=0x1){_0x21d2db=_0x2e0a60[_0xd3eb90]['get']({'plain':!![]});_0x187f04[_0xa6f5('0x2f')](db[_0xa6f5('0x54')][_0xa6f5('0x5a')](_0x3446b1(_0x21d2db,'CampaignId'))[_0xa6f5('0x2e')](function(){})['catch'](_0x10ab07()));}}return _0x187f04;})[_0xa6f5('0x57')]();})[_0xa6f5('0x30')](function(_0x3c6781){logger[_0xa6f5('0x15')](_0xa6f5('0x5d'),_0xa6f5('0x5e'),_0x3c6781[_0xa6f5('0x1d')]);});}var processPromises=function(_0x4dccbd){return BPromise['all'](promises)[_0xa6f5('0x2e')](function(_0x2560f7){})[_0xa6f5('0x30')](function(_0x38123b){logger[_0xa6f5('0x15')](_0xa6f5('0x5f'),JSON[_0xa6f5('0x32')](_0x38123b));})[_0xa6f5('0x60')](function(){socket['emit'](_0xa6f5('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4dccbd){return _0x4dccbd[_0xa6f5('0x62')]();}});};var endCsv=function(){return BPromise[_0xa6f5('0x63')]()[_0xa6f5('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xa6f5('0x2e')](function(){socket['emit'](_0xa6f5('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0xedbd7f){logger[_0xa6f5('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xa6f5('0x32')](_0xedbd7f));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0xa6f5('0x64')](_0xa6f5('0x65'));endCsv();});function main(){return BPromise[_0xa6f5('0x63')]()[_0xa6f5('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xa6f5('0x2b')][_0xa6f5('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1c07e4){var _0x1bfd27=fs[_0xa6f5('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa6f5('0x67')](_0x1bfd27,{'header':!![],'skipEmptyLines':!![],'step':function(_0xd24f3a,_0x8b5ed1){total+=0x1;var _0x3a8282=total;promises[_0xa6f5('0x2f')](checkRow(_0xd24f3a,_0x1c07e4,_0x3a8282)[_0xa6f5('0x2e')](function(){success+=0x1;})[_0xa6f5('0x30')](function(_0x4b4201){if(_0x4b4201[_0xa6f5('0x15')]){errors+=0x1;delete _0x4b4201[_0xa6f5('0x15')];}else if(_0x4b4201['duplicate']){duplicates+=0x1;delete _0x4b4201[_0xa6f5('0x29')];}rows[_0xa6f5('0x2f')](_0x4b4201);}));if(total%0xc8===0x0){_0x8b5ed1[_0xa6f5('0x68')]();return processPromises(_0x8b5ed1);}},'complete':function(){return processPromises()[_0xa6f5('0x2e')](function(){logger[_0xa6f5('0x64')](_0xa6f5('0x69'));endCsv();});},'error':function(_0x430f5f,_0x466ba7){logger['info'](_0xa6f5('0x6a'),JSON[_0xa6f5('0x32')](_0x430f5f));endCsv();}});})[_0xa6f5('0x30')](function(_0xb39ee3){logger['error'](_0xa6f5('0x6b'),JSON[_0xa6f5('0x32')](_0xb39ee3));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index f5b925c..f615f05 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 _0x648c=['timezones','firstName','hasOwnProperty','replace','find','itemTypeId','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','lodash','papaparse','bluebird','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','CmContact','findAll','then','push','all','AdditionalPhones','split','length','filter','findOne','update','updated','CmContactHasItem','create','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_hopper_black','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','fromQuery','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','errors','code','sequelize','query','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','isNil','set','offset','dialTimezone','main','stringify','send','binding','clone','socket_timestamp','root','server/files/tmp','includes','header','ContactItemType','name','_description','parse','createReadStream','data','rows','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)'];(function(_0x224a85,_0xd84e39){var _0xa0372b=function(_0x2139f3){while(--_0x2139f3){_0x224a85['push'](_0x224a85['shift']());}};_0xa0372b(++_0xd84e39);}(_0x648c,0x19d));var _0xc648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x648c[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xc648('0x0'));var Papa=require(_0xc648('0x1'));var util=require('util');var BPromise=require(_0xc648('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require('ioredis');var db=require(_0xc648('0x3'))['db'];var config=require(_0xc648('0x4'));var shared=require('../../../config/environment/shared');var logger=require(_0xc648('0x5'))(_0xc648('0x6'));config[_0xc648('0x7')]=_[_0xc648('0x8')](config['redis'],{'host':_0xc648('0x9'),'port':0x18eb});var socket=require(_0xc648('0xa'))(new Redis(config[_0xc648('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xc648('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xc648('0xb')](_0xc648('0xc'));function isEmail(_0xae2812){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'](_0xae2812);}function selectNotIn(_0x213d72,_0x50f4fa,_0x21f9fd,_0x18767d,_0x201465){return squel['select']()[_0xc648('0xd')](_0xc648('0xe'))[_0xc648('0xf')](_0x18767d)[_0xc648('0x10')](_0x50f4fa,null,_0x50f4fa+_0xc648('0x11')+_0x18767d+'.'+_0x21f9fd)['where'](_0x18767d+'.'+_0x21f9fd+_0xc648('0x12')+_0x213d72+'.'+_0x21f9fd)[_0xc648('0x13')](_0x50f4fa+'.dialCheckDuplicateType\x20IN\x20('+_0x201465['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x57670e,_0x14a97e){promisesAdditionalPhones=[];return db[_0xc648('0x14')][_0xc648('0x15')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xc648('0x16')](function(_0x59dcff){if(_0x59dcff!==null){var _0x54ee7c=[];for(var _0x81dcfc=0x0;_0x81dcfc<_0x59dcff['length'];_0x81dcfc++){var _0x55d08e=_0x59dcff[_0x81dcfc];_0x54ee7c[_0xc648('0x17')](insertAdditionalPhones(_0x55d08e));}}Promise[_0xc648('0x18')](_0x54ee7c)[_0xc648('0x16')](function(){_0x57670e({'val':0x1});});});});}function insertAdditionalPhones(_0x9e9f41){return new Promise(function(_0x2649a0,_0x2ec7f9){var _0x67d867=_0x9e9f41[_0xc648('0x19')];var _0x2646f9=_0x67d867[_0xc648('0x1a')](';');var _0x589a2d=[];orderBy=0x0;for(var _0x39d6b7=0x0;_0x39d6b7<_0x2646f9[_0xc648('0x1b')];_0x39d6b7++){_0x589a2d['push'](splitAdditionalPhone(_0x9e9f41['id'],_0x2646f9[_0x39d6b7]));}Promise['all'](_0x589a2d)[_0xc648('0x16')](function(){_0x2649a0({'val':_0x2646f9[_0xc648('0x1b')]});});});}function splitAdditionalPhone(_0x107a84,_0x36fcf3){return new Promise(function(_0x5e3e07,_0x233163){var _0x4156ba=_0x36fcf3[_0xc648('0x1a')](':');var _0x106016=_0x4156ba[0x0];var _0x24c4af=_0x4156ba[0x1];if(!_['isNil'](_0x24c4af)){var _0xfcb165=_0x24c4af['split']('|');var _0x1b45c8=[];for(var _0x2e4de9=0x0;_0x2e4de9<_0xfcb165[_0xc648('0x1b')];_0x2e4de9++){if(_0xfcb165[_0x2e4de9]!==''){var _0x1d6bb5=_[_0xc648('0x1c')](promisesAdditionalPhones,{'contactId':_0x107a84,'phone':_0xfcb165[_0x2e4de9]});if(_0x1d6bb5[_0xc648('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xc648('0x17')]({'contactId':_0x107a84,'contactTypeId':_0x106016,'phone':_0xfcb165[_0x2e4de9],'orderBy':orderBy});}}}_0x5e3e07({'ok':0x1});}else _0x5e3e07({'res':0x0});});}function createAdditionalPhone(_0x440da2,_0x42267f,_0x100900,_0x1936a1){var _0x1f764f='';var _0x59f11c='';var _0x5a051f=_0x100900['split']('§');_0x1f764f=_0x5a051f[0x0];if(_0x5a051f[_0xc648('0x1b')]==0x2)_0x59f11c=_0x5a051f[0x1];return new Promise(function(_0x21fa71,_0x771f99){return db['CmContactHasItem'][_0xc648('0x1d')]({'where':{'CmContactId':_0x440da2,'item':_0x1f764f}})['then'](function(_0x4b70f7){if(_0x4b70f7){return db['CmContactHasItem'][_0xc648('0x1e')]({'ItemTypeId':_0x42267f,'description':_0x59f11c,'OrderBy':_0x1936a1},{'where':{'CmContactId':_0x440da2,'item':_0x1f764f}})[_0xc648('0x16')](function(_0x491943){_0x21fa71({'res':_0xc648('0x1f')});});}else{return db[_0xc648('0x20')][_0xc648('0x21')]({'CmContactId':_0x440da2,'item':_0x1f764f,'description':_0x59f11c,'ItemTypeId':_0x42267f,'OrderBy':_0x1936a1,'ItemClass':'PHONE'})[_0xc648('0x16')](function(_0x20cfc6){_0x21fa71({'res':_0xc648('0x22')});});}});});}function insertCmHopper(_0x1e46cf,_0x30ed48,_0x38a710,_0x2d90f4,_0x35ef18){var _0x49cb90=['cm_contacts.phone',_0xc648('0x23'),_0xc648('0x24'),_0xc648('0x25'),_0x30ed48+'.'+_0x2d90f4,'cm_contacts.createdAt',_0xc648('0x26'),_0xc648('0x27'),_0xc648('0x28'),'\x22'+_0x35ef18+'\x22'];return squel[_0xc648('0x29')]()[_0xc648('0x2a')](_0xc648('0x2b'))['fromQuery'](['phone',_0xc648('0x2c'),_0xc648('0x2d'),_0xc648('0x2e'),_0x2d90f4,_0xc648('0x2f'),_0xc648('0x30'),_0xc648('0x31'),_0xc648('0x32'),_0xc648('0x33')],squel[_0xc648('0x34')]()[_0xc648('0x35')](_0x49cb90)[_0xc648('0xf')](_0x30ed48)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x30ed48+_0xc648('0x36'))[_0xc648('0x10')](_0x38a710,null,_0x38a710+_0xc648('0x11')+_0x30ed48+'.'+_0x2d90f4)[_0xc648('0x13')](_0x30ed48+_0xc648('0x37'),_0x1e46cf)[_0xc648('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc648('0x13')](_0xc648('0x38'),selectNotIn(_0x30ed48,_0x38a710,_0x2d90f4,_0xc648('0x2b'),[_0xc648('0x39'),_0xc648('0x3a')]))['where'](_0xc648('0x38'),selectNotIn(_0x30ed48,_0x38a710,_0x2d90f4,'cm_hopper',['\x22always\x22'])))[_0xc648('0x3b')]();}function insertCmHopperBlack(_0x35ac43,_0x5ca884,_0x37efd9,_0x4d5fa4){var _0x5deb35=[_0xc648('0x3c'),_0xc648('0x24'),'cm_contacts.ListId',_0x5ca884+'.'+_0x4d5fa4,_0xc648('0x3d'),'cm_contacts.updatedAt'];return squel['insert']()[_0xc648('0x2a')](_0xc648('0x3e'))['fromQuery'](['phone',_0xc648('0x2d'),'ListId',_0x4d5fa4,_0xc648('0x2f'),_0xc648('0x30')],squel['select']()[_0xc648('0x35')](_0x5deb35)[_0xc648('0xf')](_0x5ca884)[_0xc648('0x10')](_0xc648('0x3f'),null,_0xc648('0x40')+_0x5ca884+_0xc648('0x36'))[_0xc648('0x10')](_0x37efd9,null,_0x37efd9+_0xc648('0x11')+_0x5ca884+'.'+_0x4d5fa4)[_0xc648('0x13')](_0x5ca884+'.CmListId\x20=\x20?',_0x35ac43)[_0xc648('0x13')](_0xc648('0x41'),NOW)[_0xc648('0x13')](_0xc648('0x38'),squel[_0xc648('0x34')]()[_0xc648('0xd')](_0xc648('0xe'))[_0xc648('0xf')](_0xc648('0x3e'))[_0xc648('0x13')]('ListId\x20=\x20?',_0x35ac43)['where'](_0x4d5fa4+_0xc648('0x12')+_0x5ca884+'.'+_0x4d5fa4)))['toString']();}function insertTzCmHopper(_0x5ca29f,_0x19c0ad,_0xe3ee8,_0x513cff,_0xd92ec1,_0x514c83){var _0x2af151=[_0xc648('0x3c'),_0xc648('0x42')+_0x514c83+_0xc648('0x43'),'cm_contacts.id',_0xc648('0x25'),_0x19c0ad+'.'+_0x513cff,_0xc648('0x3d'),_0xc648('0x26'),_0xc648('0x27'),'cm_contacts.UserId','\x22'+_0xd92ec1+'\x22'];var _0x5e70a9=squel[_0xc648('0x29')]()[_0xc648('0x2a')](_0xc648('0x2b'))[_0xc648('0x44')](['phone',_0xc648('0x2c'),'ContactId','ListId',_0x513cff,_0xc648('0x2f'),'updatedAt',_0xc648('0x31'),'UserId',_0xc648('0x33')],squel[_0xc648('0x34')]()[_0xc648('0x35')](_0x2af151)[_0xc648('0xf')](_0x19c0ad)[_0xc648('0x10')](_0xc648('0x3f'),null,_0xc648('0x40')+_0x19c0ad+_0xc648('0x36'))[_0xc648('0x10')](_0xe3ee8,null,_0xe3ee8+_0xc648('0x11')+_0x19c0ad+'.'+_0x513cff)['join'](_0x514c83,null,_0x514c83+_0xc648('0x11')+_0x19c0ad+'.'+_0x513cff)[_0xc648('0x13')](_0x19c0ad+'.CmListId\x20=\x20?',_0x5ca29f)[_0xc648('0x13')](_0xc648('0x41'),NOW)[_0xc648('0x13')](_0xc648('0x38'),selectNotIn(_0x19c0ad,_0xe3ee8,_0x513cff,_0xc648('0x2b'),[_0xc648('0x39'),_0xc648('0x3a')]))[_0xc648('0x13')](_0xc648('0x38'),selectNotIn(_0x19c0ad,_0xe3ee8,_0x513cff,_0xc648('0x2b'),[_0xc648('0x39')])))['toString']();return _0x5e70a9;}function insertTzCmHopperBlack(_0xd7b4f0,_0x596c00,_0x4f6ca3,_0x271e05){var _0x579f53=['cm_contacts.phone',_0xc648('0x24'),_0xc648('0x25'),_0x596c00+'.'+_0x271e05,_0xc648('0x3d'),_0xc648('0x26')];return squel[_0xc648('0x29')]()[_0xc648('0x2a')](_0xc648('0x3e'))[_0xc648('0x44')](['phone',_0xc648('0x2d'),'ListId',_0x271e05,_0xc648('0x2f'),'updatedAt'],squel[_0xc648('0x34')]()['fields'](_0x579f53)[_0xc648('0xf')](_0x596c00)[_0xc648('0x10')]('cm_contacts',null,_0xc648('0x40')+_0x596c00+_0xc648('0x36'))['join'](_0x4f6ca3,null,_0x4f6ca3+_0xc648('0x11')+_0x596c00+'.'+_0x271e05)[_0xc648('0x13')](_0x596c00+_0xc648('0x37'),_0xd7b4f0)[_0xc648('0x13')](_0xc648('0x41'),NOW)[_0xc648('0x13')](_0xc648('0x38'),squel[_0xc648('0x34')]()['field'](_0xc648('0xe'))[_0xc648('0xf')]('cm_hopper_black')['where'](_0xc648('0x45'),_0xd7b4f0)['where'](_0x271e05+_0xc648('0x12')+_0x596c00+'.'+_0x271e05)))[_0xc648('0x3b')]();}function insertCmHopperAdditionalPhones(_0x4794a4){var _0x40a1d6=[_0xc648('0x46'),_0xc648('0x47'),_0xc648('0x48'),'cm_contact_has_items.createdAt',_0xc648('0x49')];return squel['insert']()[_0xc648('0x2a')](_0xc648('0x4a'))[_0xc648('0x44')]([_0xc648('0x4b'),_0xc648('0xe'),_0xc648('0x4c'),'createdAt',_0xc648('0x30')],squel[_0xc648('0x34')]()[_0xc648('0x35')](_0x40a1d6)[_0xc648('0xf')]('cm_hopper')[_0xc648('0x10')](_0xc648('0x3f'),null,_0xc648('0x4d'))[_0xc648('0x10')](_0xc648('0x4e'),null,_0xc648('0x4f'))['where'](_0xc648('0x50'),_0x4794a4)[_0xc648('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x481bbe,_0xc791b4,_0x1aa73b,_0x1ca0f5){var _0x4ea054=_[_0xc648('0x51')](_[_0xc648('0x52')](_0x1ca0f5),[_0xc648('0x2e'),'CompanyId',_0xc648('0x2f'),_0xc648('0x30'),_0xc648('0x53')]);return squel['insert']()[_0xc648('0x2a')](_0xc648('0x3f'))['fromQuery'](_0x4ea054,squel['select']()[_0xc648('0x35')](_0x4ea054)['from'](_0xc791b4)[_0xc648('0x13')]('('+_0x1aa73b[_0xc648('0x10')](',')+_0xc648('0x54'),squel[_0xc648('0x34')]()[_0xc648('0x35')](_0x1aa73b)['from'](_0xc648('0x3f'))[_0xc648('0x13')](_0xc648('0x45'),_0x481bbe)[_0xc648('0x13')](_0xc648('0x55')))['where']('id\x20IN\x20?',squel[_0xc648('0x34')]()[_0xc648('0xd')](_0xc648('0x56'),_0xc648('0x57'))[_0xc648('0xf')](_0xc791b4)[_0xc648('0x58')](_0x1aa73b[_0xc648('0x10')](','))))[_0xc648('0x3b')]();}function handleStop(){logger[_0xc648('0x59')](_0xc648('0x5a'));stopped=!![];}function handleUncaughtException(_0x27da3e){logger[_0xc648('0x5b')](_0x27da3e[_0xc648('0x5c')]);process['exit'](0x1);}function handleError(_0x32cc39,_0x5ef37e){stats[_0xc648('0x5d')][_0xc648('0x17')]({'name':_0x5ef37e[_0xc648('0x5e')],'message':_0x5ef37e[_0xc648('0x5c')],'row':_0x32cc39});}function handleQuery(_0x5aecb2){logger[_0xc648('0x59')](_0x5aecb2);return db[_0xc648('0x5f')][_0xc648('0x60')](_0x5aecb2)['spread'](function(_0x559463){results['push'](_0x559463);})[_0xc648('0x61')](function(_0x38a57f){logger[_0xc648('0x5b')](_0x38a57f[_0xc648('0x5c')]);});}function updateTzCampaigns(_0x5c0120){return new Promise(function(_0x347256,_0x1462a9){var _0x251a6c=squel[_0xc648('0x34')]()[_0xc648('0x35')]([_0xc648('0x62'),_0xc648('0x63')])[_0xc648('0xf')](_0xc648('0x64'))[_0xc648('0x10')](_0xc648('0x65'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xc648('0x66')+_0x5c0120);db[_0xc648('0x5f')]['query'](_0x251a6c[_0xc648('0x3b')]())[_0xc648('0x67')](function(_0x1eb7c5){var _0x213770=[];for(var _0x25b0bc=0x0;_0x25b0bc<_0x1eb7c5[_0xc648('0x1b')];_0x25b0bc++){_0x213770[_0xc648('0x17')](getTimezoneData(_0x1eb7c5[_0x25b0bc],tmp_campaigns));}BPromise['all'](_0x213770)[_0xc648('0x16')](function(){_0x347256({'val':0x1});});})[_0xc648('0x61')](function(_0x450432){logger[_0xc648('0x5b')](_0x450432[_0xc648('0x5c')]);_0x347256({'val':0x0});});});}function updateTzVoiceQueues(_0xdcb6af){return new Promise(function(_0x1a3c5e,_0x10b9c0){var _0x2301aa=squel[_0xc648('0x34')]()[_0xc648('0x35')]([_0xc648('0x68'),_0xc648('0x69')])[_0xc648('0xf')](_0xc648('0x6a'))['join']('voice_queues_has_cm_lists',null,_0xc648('0x6b'))['where'](_0xc648('0x6c')+_0xdcb6af);db[_0xc648('0x5f')][_0xc648('0x60')](_0x2301aa[_0xc648('0x3b')]())[_0xc648('0x67')](function(_0x52b3e9){var _0x23c86b=[];for(var _0xc832a2=0x0;_0xc832a2<_0x52b3e9[_0xc648('0x1b')];_0xc832a2++){_0x23c86b[_0xc648('0x17')](getTimezoneData(_0x52b3e9[_0xc832a2],tmp_voice_queues));}BPromise['all'](_0x23c86b)[_0xc648('0x16')](function(){_0x1a3c5e({'val':0x1});});})['catch'](function(_0xad0368){logger[_0xc648('0x5b')](_0xad0368[_0xc648('0x5c')]);_0x1a3c5e({'val':0x0});});});}function getTimezoneData(_0x541f8,_0x3fc1eb){return new Promise(function(_0x2396a2,_0x49f477){var _0x3a10=shared['timezones'];var _0x39879a=_0x3a10[_0x541f8['dialTimezone']];if(_[_0xc648('0x6d')](_0x39879a)){_0x2396a2({'ret':0x1});}else{var _0x764480=_0x39879a['utcOffset'];var _0x1aacfd=squel['insert']()[_0xc648('0x2a')](_0x3fc1eb)[_0xc648('0x6e')]('id',_0x541f8['id'])[_0xc648('0x6e')](_0xc648('0x6f'),_0x764480)[_0xc648('0x6e')](_0xc648('0x70'),_0x541f8[_0xc648('0x70')])[_0xc648('0x3b')]();return db[_0xc648('0x5f')][_0xc648('0x60')](_0x1aacfd)[_0xc648('0x67')](function(_0x2188e8){_0x2396a2({'ret':0x1});})[_0xc648('0x61')](function(_0x19e4af){logger[_0xc648('0x5b')](_0x19e4af[_0xc648('0x5c')]);_0x49f477({'ret':0x1});});}});}function handleTZQuery(_0xed97a6){logger[_0xc648('0x59')](_0xed97a6);return db[_0xc648('0x5f')]['query'](_0xed97a6)['spread'](function(_0x23a8a1){})['catch'](function(_0x58faf7){logger[_0xc648('0x5b')](_0x58faf7[_0xc648('0x5c')]);});}function main(_0x449c5f,_0x24d6a7,_0x305e3e,_0x1c3a69){logger[_0xc648('0x59')](_0xc648('0x71'),_0x449c5f,JSON[_0xc648('0x72')](_0x24d6a7));process[_0xc648('0x73')]('start');var _0x4a610d=_0x24d6a7[_0xc648('0x74')];var _0x4fafaf=_[_0xc648('0x75')](_0x4a610d);var _0x26a465=_0x24d6a7[_0xc648('0x76')];var _0x472a32=path[_0xc648('0x10')](config[_0xc648('0x77')],_0xc648('0x78'),_0x26a465+'.csv');hasTZ=_[_0xc648('0x52')](_0x4a610d)[_0xc648('0x79')](_0xc648('0x70'));var _0x55c17b=_[_0xc648('0x52')](_0x4a610d)['join']();logger['info'](_0xc648('0x7a'),_0x55c17b);db[_0xc648('0x7b')]['findAll']({'raw':!![],'attributes':['id','name']})[_0xc648('0x16')](function(_0x161cc3){for(var _0x35c2ff=0x0;_0x35c2ff<_0x161cc3['length'];_0x35c2ff++){if(_0x161cc3[_0x35c2ff][_0xc648('0x7c')]in _0x4a610d){contactItemTypes['push'](_0x161cc3[_0x35c2ff]);delete _0x4fafaf[_0x161cc3[_0x35c2ff][_0xc648('0x7c')]];hasAdditionalPhones=!![];}for(var _0x4d4a8f in _0x4a610d){if(_0x161cc3[_0x35c2ff][_0xc648('0x7c')]+_0xc648('0x7d')===_0x4d4a8f){phoneDescriptions['push']({'itemTypeId':_0x161cc3[_0x35c2ff]['id'],'description':_0x4d4a8f});delete _0x4fafaf[_0x4d4a8f];}}}if(hasAdditionalPhones)_0x4fafaf[_0xc648('0x19')]='';var _0x26a323=_[_0xc648('0x52')](_0x4fafaf)[_0xc648('0x10')]();logger[_0xc648('0x59')](_0xc648('0x7a'),_0x26a323);fs['writeFileSync'](_0x472a32,_0x26a323+'\x0a');Papa[_0xc648('0x7e')](fs[_0xc648('0x7f')](_0x449c5f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4db2cd,_0x45c1aa){try{for(var _0x1f716d=0x0,_0xf1480a=[];_0x1f716d<_0x4db2cd[_0xc648('0x80')][_0xc648('0x1b')];_0x1f716d++){stats[_0xc648('0x81')]+=0x1;if(_0x4db2cd[_0xc648('0x5d')][_0x1f716d]){handleError(_0x4db2cd[_0xc648('0x80')][_0x1f716d],_0x4db2cd[_0xc648('0x5d')][_0x1f716d]);}else{var _0xdf0638=[];var _0x9cef0c=[];var _0x2697d3={};for(var _0x374203 in _0x4a610d){let _0x106657=contactItemTypes['find'](_0x45c1ec=>_0x45c1ec[_0xc648('0x7c')]===_0x374203);let _0x4811db=contactItemTypes['find'](_0x10330d=>_0x10330d[_0xc648('0x7c')]+_0xc648('0x7d')===_0x374203);if(_['isNil'](_0x106657)&&_[_0xc648('0x6d')](_0x4811db)){if(_0x4a610d['hasOwnProperty'](_0x374203)){if(_0x4db2cd[_0xc648('0x80')][_0x1f716d][_0x4a610d[_0x374203]]){var _0x2338b9=_[_0xc648('0x82')](_0x4db2cd[_0xc648('0x80')][_0x1f716d][_0x4a610d[_0x374203]]['replace'](/"/g,'\x27'));switch(_0x374203){case'scheduledat':var _0x979ecd=moment(_0x2338b9,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x979ecd[_0xc648('0x83')]()){_0xf1480a['push']('\x22'+_0x2338b9+'\x22');}else{_0xdf0638[_0xc648('0x17')](_0xc648('0x84'));}break;case _0xc648('0x31'):var _0x515216=parseInt(_0x2338b9);_0x2338b9=_[_0xc648('0x85')](_0x515216)||_0x515216<0x0||_0x515216>0x4?_0x1c3a69?0x3:0x2:_0x515216;_0xf1480a[_0xc648('0x17')]('\x22'+_0x2338b9+'\x22');break;case'UserId':var _0xb86dd0=parseInt(_0x2338b9);if(_['isNumber'](_0xb86dd0)&&_[_0xc648('0x79')](_0x305e3e,_0xb86dd0)){_0xf1480a[_0xc648('0x17')]('\x22'+_0xb86dd0+'\x22');}else{_0xdf0638[_0xc648('0x17')](_0xc648('0x86'));}break;case'email':if(isEmail(_0x2338b9)){_0xf1480a[_0xc648('0x17')]('\x22'+_0x2338b9+'\x22');}else{_0xdf0638[_0xc648('0x17')](_0xc648('0x87'));}break;case _0xc648('0x88'):var _0x44ba73=moment(_0x2338b9,_0xc648('0x89'),!![]);if(_0x44ba73[_0xc648('0x83')]()){_0xf1480a['push']('\x22'+_0x2338b9+'\x22');}else{_0xdf0638[_0xc648('0x17')](_0xc648('0x8a'));}break;case'dialTimezone':var _0x35a2ae=shared[_0xc648('0x8b')];var _0x855a17=_0x35a2ae[_0x2338b9];if(!_[_0xc648('0x6d')](_0x855a17)){var _0x5adddb=_0x855a17['utcOffset'];_0xf1480a[_0xc648('0x17')]('\x22'+_0x2338b9+'\x22');_0xf1480a[_0xc648('0x17')]('\x22'+_0x5adddb+'\x22');}break;default:_0xf1480a[_0xc648('0x17')]('\x22'+_0x2338b9+'\x22');}}else{switch(_0x374203){case _0xc648('0x8c'):case _0xc648('0xe'):_0xdf0638['push'](_0x374203+'\x20not\x20specified');break;default:_0xf1480a[_0xc648('0x17')]('\x22\x22');}}}}else{var _0x32fc3f='';if(!_[_0xc648('0x6d')](_0x106657)){if(!_0x2697d3[_0xc648('0x8d')](_0x106657['id'])){if(!_['isNil'](_0x4db2cd[_0xc648('0x80')][_0x1f716d][_0x4a610d[_0x374203]])){var _0x2338b9=_[_0xc648('0x82')](_0x4db2cd[_0xc648('0x80')][_0x1f716d][_0x4a610d[_0x374203]][_0xc648('0x8e')](/"/g,'\x27'));var _0x5a909=phoneDescriptions[_0xc648('0x8f')](_0x1ea7c4=>_0x1ea7c4[_0xc648('0x90')]===_0x106657['id']);if(!_[_0xc648('0x6d')](_0x5a909)){var _0x4a56f2=_[_0xc648('0x82')](_0x4db2cd['data'][_0x1f716d][_0x4a610d[_0x5a909['description']]]['replace'](/"/g,'\x27'));if(!_[_0xc648('0x6d')](_0x4a56f2))_0x2338b9=_0x2338b9+'§'+_0x4a56f2;}if(_0x32fc3f=='')_0x32fc3f=_0x2338b9;else _0x32fc3f+='|'+_0x2338b9;}_0x9cef0c[_0xc648('0x17')](_0x106657['id']+':'+_0x32fc3f);_0x2697d3[_0x106657['id']]=0x1;}}}}if(hasAdditionalPhones){_0xf1480a[_0xc648('0x17')]('\x22'+_0x9cef0c[_0xc648('0x10')](';')+'\x22');}if(_0xdf0638[_0xc648('0x1b')]){handleError(_0x4db2cd['data'][_0x1f716d],{'code':'SystemRow','message':_0xdf0638[_0xc648('0x10')]()});}else{fs[_0xc648('0x91')](_0x472a32,_0xf1480a['join']()+'\x0a');}_0xf1480a=[];}if(!(stats[_0xc648('0x81')]%0xc8)){socket[_0xc648('0x92')](_0xc648('0x93')+_0x26a465,stats);stats['errors']=[];}}if(stopped){logger[_0xc648('0x59')](_0xc648('0x94'));_0x45c1aa[_0xc648('0x95')]();}}catch(_0x47479a){handleError(_0x4db2cd[_0xc648('0x80')][_0x1f716d],{'code':_0xc648('0x96'),'message':_0x47479a[_0xc648('0x5c')]});logger['error'](_0xc648('0x97'),_0x47479a[_0xc648('0x5c')]);}},'complete':function(){try{var _0x4c5d66=[];var _0x17a970=[];var _0x40176b=_0xc648('0x3f');if(_0x24d6a7[_0xc648('0x98')]&&_0x24d6a7['duplicates'][_0xc648('0x1b')]){_0x40176b=_0xc648('0x99')+_0x26a465;_0x4c5d66[_0xc648('0x17')](_0xc648('0x9a')+_0x40176b+_0xc648('0x9b'));}tmp_campaigns=_0xc648('0x9c')+_0x26a465;tmp_voice_queues='voice_queues_'+_0x26a465;_0x17a970['push'](_0xc648('0x9a')+tmp_campaigns+_0xc648('0x9d'));_0x17a970['push'](_0xc648('0x9a')+tmp_voice_queues+_0xc648('0x9d'));BPromise[_0xc648('0x9e')](_0x17a970,handleTZQuery)[_0xc648('0x16')](function(_0x134dbd){updateTzCampaigns(_0x24d6a7['ListId'])[_0xc648('0x16')](function(_0x3cbae7){updateTzVoiceQueues(_0x24d6a7[_0xc648('0x2e')])[_0xc648('0x16')](function(_0x353fb3){if(hasTZ)_0x26a323=_0x26a323[_0xc648('0x8e')](_0xc648('0x70'),_0xc648('0x9f'));var _0x59d429=util['format'](_0xc648('0xa0'),_0x472a32,_0x40176b,_0x26a323,_0x24d6a7[_0xc648('0x2e')],_0x24d6a7[_0xc648('0xa1')]||null,NOW,NOW);if(_[_0xc648('0x6d')](_0x4a610d[_0xc648('0x2c')])){_0x59d429+=_0xc648('0xa2');}_0x4c5d66[_0xc648('0x17')](_0x59d429);if(_0x24d6a7[_0xc648('0x98')]&&_0x24d6a7[_0xc648('0x98')]['length']){_0x4c5d66['push'](insertCmContact(_0x24d6a7[_0xc648('0x2e')],_0x40176b,_0x24d6a7[_0xc648('0x98')],_0x4a610d));_0x4c5d66[_0xc648('0x17')](_0xc648('0xa3')+_0x40176b+';');}BPromise['each'](_0x4c5d66,handleQuery)[_0xc648('0x16')](function(_0xd45336){BPromise[_0xc648('0x18')]([handleAdditionalPhones()])['then'](function(){_0x4c5d66=[];for(var _0x5785bc=0x0;_0x5785bc\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import'];(function(_0x2fac5f,_0x13af80){var _0x1b7572=function(_0x666bb5){while(--_0x666bb5){_0x2fac5f['push'](_0x2fac5f['shift']());}};_0x1b7572(++_0x13af80);}(_0x7f44,0x15f));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x47f4('0x0'));var _=require(_0x47f4('0x1'));var Papa=require(_0x47f4('0x2'));var util=require('util');var BPromise=require(_0x47f4('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require('ioredis');var db=require(_0x47f4('0x4'))['db'];var config=require(_0x47f4('0x5'));var shared=require(_0x47f4('0x6'));var logger=require(_0x47f4('0x7'))(_0x47f4('0x8'));config[_0x47f4('0x9')]=_['defaults'](config[_0x47f4('0x9')],{'host':_0x47f4('0xa'),'port':0x18eb});var socket=require(_0x47f4('0xb'))(new Redis(config[_0x47f4('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x47f4('0xc')](_0x47f4('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x47f4('0xc')](_0x47f4('0xd'));function isEmail(_0x344eb5){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'](_0x344eb5);}function selectNotIn(_0x1fe7a3,_0x21849e,_0x9f13be,_0x3d1873,_0x4454c1){return squel[_0x47f4('0xe')]()[_0x47f4('0xf')]('phone')[_0x47f4('0x10')](_0x3d1873)[_0x47f4('0x11')](_0x21849e,null,_0x21849e+_0x47f4('0x12')+_0x3d1873+'.'+_0x9f13be)[_0x47f4('0x13')](_0x3d1873+'.'+_0x9f13be+_0x47f4('0x14')+_0x1fe7a3+'.'+_0x9f13be)[_0x47f4('0x13')](_0x21849e+_0x47f4('0x15')+_0x4454c1[_0x47f4('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1c34a2,_0x29328e){promisesAdditionalPhones=[];return db[_0x47f4('0x16')][_0x47f4('0x17')]({'raw':!![],'attributes':['id',_0x47f4('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x47f4('0x19')](function(_0x45fae2){if(_0x45fae2!==null){var _0x3247cf=[];for(var _0x2efb18=0x0;_0x2efb18<_0x45fae2[_0x47f4('0x1a')];_0x2efb18++){var _0xa06bbd=_0x45fae2[_0x2efb18];_0x3247cf[_0x47f4('0x1b')](insertAdditionalPhones(_0xa06bbd));}}Promise[_0x47f4('0x1c')](_0x3247cf)[_0x47f4('0x19')](function(){_0x1c34a2({'val':0x1});});});});}function insertAdditionalPhones(_0xc0564d){return new Promise(function(_0x5a5217,_0xfc02d){var _0x1bfdbe=_0xc0564d[_0x47f4('0x18')];var _0x8b1ea3=_0x1bfdbe[_0x47f4('0x1d')](';');var _0x25cbc1=[];orderBy=0x0;for(var _0x430b9d=0x0;_0x430b9d<_0x8b1ea3[_0x47f4('0x1a')];_0x430b9d++){_0x25cbc1[_0x47f4('0x1b')](splitAdditionalPhone(_0xc0564d['id'],_0x8b1ea3[_0x430b9d]));}Promise[_0x47f4('0x1c')](_0x25cbc1)[_0x47f4('0x19')](function(){_0x5a5217({'val':_0x8b1ea3[_0x47f4('0x1a')]});});});}function splitAdditionalPhone(_0x4143ff,_0x4fe48a){return new Promise(function(_0x4f7a98,_0x231749){var _0x3a7ee7=_0x4fe48a[_0x47f4('0x1d')](':');var _0x534ec4=_0x3a7ee7[0x0];var _0x1f1ae2=_0x3a7ee7[0x1];if(!_[_0x47f4('0x1e')](_0x1f1ae2)){var _0x455507=_0x1f1ae2[_0x47f4('0x1d')]('|');var _0x43f291=[];for(var _0x57891d=0x0;_0x57891d<_0x455507['length'];_0x57891d++){if(_0x455507[_0x57891d]!==''){var _0x2972af=_[_0x47f4('0x1f')](promisesAdditionalPhones,{'contactId':_0x4143ff,'phone':_0x455507[_0x57891d]});if(_0x2972af[_0x47f4('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4143ff,'contactTypeId':_0x534ec4,'phone':_0x455507[_0x57891d],'orderBy':orderBy});}}}_0x4f7a98({'ok':0x1});}else _0x4f7a98({'res':0x0});});}function createAdditionalPhone(_0x34169e,_0x5ddd98,_0x18a351,_0x2ea693){var _0x2f83d3='';var _0x2b59e6='';var _0xa96f0=_0x18a351[_0x47f4('0x1d')]('§');_0x2f83d3=_0xa96f0[0x0];if(_0xa96f0[_0x47f4('0x1a')]==0x2)_0x2b59e6=_0xa96f0[0x1];return new Promise(function(_0x2c95fd,_0x496c54){return db[_0x47f4('0x20')][_0x47f4('0x21')]({'where':{'CmContactId':_0x34169e,'item':_0x2f83d3}})[_0x47f4('0x19')](function(_0x2ead95){if(_0x2ead95){return db['CmContactHasItem'][_0x47f4('0x22')]({'ItemTypeId':_0x5ddd98,'description':_0x2b59e6,'OrderBy':_0x2ea693},{'where':{'CmContactId':_0x34169e,'item':_0x2f83d3}})[_0x47f4('0x19')](function(_0x3237f9){_0x2c95fd({'res':_0x47f4('0x23')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x34169e,'item':_0x2f83d3,'description':_0x2b59e6,'ItemTypeId':_0x5ddd98,'OrderBy':_0x2ea693,'ItemClass':'PHONE'})[_0x47f4('0x19')](function(_0x529d76){_0x2c95fd({'res':'inserted'});});}});});}function insertCmHopper(_0x457a0c,_0x231363,_0x5c3049,_0x7eda22,_0x592d36){var _0x3ca90a=[_0x47f4('0x24'),'cm_contacts.scheduledat',_0x47f4('0x25'),_0x47f4('0x26'),_0x231363+'.'+_0x7eda22,_0x47f4('0x27'),_0x47f4('0x28'),_0x47f4('0x29'),_0x47f4('0x2a'),'\x22'+_0x592d36+'\x22'];return squel[_0x47f4('0x2b')]()[_0x47f4('0x2c')]('cm_hopper')[_0x47f4('0x2d')](['phone','scheduledat',_0x47f4('0x2e'),_0x47f4('0x2f'),_0x7eda22,_0x47f4('0x30'),'updatedAt',_0x47f4('0x31'),_0x47f4('0x32'),'recallme'],squel[_0x47f4('0xe')]()[_0x47f4('0x33')](_0x3ca90a)['from'](_0x231363)['join'](_0x47f4('0x34'),null,_0x47f4('0x35')+_0x231363+_0x47f4('0x36'))[_0x47f4('0x11')](_0x5c3049,null,_0x5c3049+_0x47f4('0x12')+_0x231363+'.'+_0x7eda22)[_0x47f4('0x13')](_0x231363+_0x47f4('0x37'),_0x457a0c)['where'](_0x47f4('0x38'),NOW)[_0x47f4('0x13')](_0x47f4('0x39'),selectNotIn(_0x231363,_0x5c3049,_0x7eda22,_0x47f4('0x3a'),[_0x47f4('0x3b'),_0x47f4('0x3c')]))[_0x47f4('0x13')](_0x47f4('0x39'),selectNotIn(_0x231363,_0x5c3049,_0x7eda22,'cm_hopper',[_0x47f4('0x3b')])))['toString']();}function insertCmHopperBlack(_0x2350c7,_0x3bc1a2,_0x98f7a7,_0x737c98){var _0x3cec5e=['cm_contacts.phone',_0x47f4('0x25'),_0x47f4('0x26'),_0x3bc1a2+'.'+_0x737c98,_0x47f4('0x27'),_0x47f4('0x28')];return squel[_0x47f4('0x2b')]()[_0x47f4('0x2c')](_0x47f4('0x3d'))[_0x47f4('0x2d')]([_0x47f4('0x3e'),_0x47f4('0x2e'),_0x47f4('0x2f'),_0x737c98,'createdAt',_0x47f4('0x3f')],squel[_0x47f4('0xe')]()[_0x47f4('0x33')](_0x3cec5e)['from'](_0x3bc1a2)[_0x47f4('0x11')](_0x47f4('0x34'),null,_0x47f4('0x35')+_0x3bc1a2+'.CmListId')[_0x47f4('0x11')](_0x98f7a7,null,_0x98f7a7+'.id\x20=\x20'+_0x3bc1a2+'.'+_0x737c98)[_0x47f4('0x13')](_0x3bc1a2+_0x47f4('0x37'),_0x2350c7)[_0x47f4('0x13')](_0x47f4('0x38'),NOW)[_0x47f4('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x47f4('0xe')]()['field'](_0x47f4('0x3e'))['from'](_0x47f4('0x3d'))['where'](_0x47f4('0x40'),_0x2350c7)['where'](_0x737c98+_0x47f4('0x14')+_0x3bc1a2+'.'+_0x737c98)))[_0x47f4('0x41')]();}function insertTzCmHopper(_0x2f3694,_0x5ca444,_0x26793c,_0x50122e,_0x6a2e77,_0x24038b){var _0x38f237=[_0x47f4('0x24'),_0x47f4('0x42')+_0x24038b+_0x47f4('0x43'),'cm_contacts.id','cm_contacts.ListId',_0x5ca444+'.'+_0x50122e,_0x47f4('0x27'),_0x47f4('0x28'),_0x47f4('0x29'),_0x47f4('0x2a'),'\x22'+_0x6a2e77+'\x22'];var _0x4783b3=squel['insert']()[_0x47f4('0x2c')]('cm_hopper')[_0x47f4('0x2d')]([_0x47f4('0x3e'),_0x47f4('0x44'),'ContactId',_0x47f4('0x2f'),_0x50122e,_0x47f4('0x30'),_0x47f4('0x3f'),_0x47f4('0x31'),_0x47f4('0x32'),_0x47f4('0x45')],squel[_0x47f4('0xe')]()['fields'](_0x38f237)[_0x47f4('0x10')](_0x5ca444)[_0x47f4('0x11')](_0x47f4('0x34'),null,_0x47f4('0x35')+_0x5ca444+'.CmListId')['join'](_0x26793c,null,_0x26793c+'.id\x20=\x20'+_0x5ca444+'.'+_0x50122e)[_0x47f4('0x11')](_0x24038b,null,_0x24038b+'.id\x20=\x20'+_0x5ca444+'.'+_0x50122e)[_0x47f4('0x13')](_0x5ca444+_0x47f4('0x37'),_0x2f3694)[_0x47f4('0x13')](_0x47f4('0x38'),NOW)[_0x47f4('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5ca444,_0x26793c,_0x50122e,_0x47f4('0x3a'),[_0x47f4('0x3b'),_0x47f4('0x3c')]))[_0x47f4('0x13')](_0x47f4('0x39'),selectNotIn(_0x5ca444,_0x26793c,_0x50122e,_0x47f4('0x3a'),[_0x47f4('0x3b')])))[_0x47f4('0x41')]();return _0x4783b3;}function insertTzCmHopperBlack(_0x4d8e68,_0x17f4ec,_0x372a59,_0x191e12){var _0x134f2d=[_0x47f4('0x24'),_0x47f4('0x25'),'cm_contacts.ListId',_0x17f4ec+'.'+_0x191e12,_0x47f4('0x27'),_0x47f4('0x28')];return squel[_0x47f4('0x2b')]()[_0x47f4('0x2c')](_0x47f4('0x3d'))[_0x47f4('0x2d')]([_0x47f4('0x3e'),'ContactId','ListId',_0x191e12,_0x47f4('0x30'),_0x47f4('0x3f')],squel[_0x47f4('0xe')]()['fields'](_0x134f2d)['from'](_0x17f4ec)[_0x47f4('0x11')](_0x47f4('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x17f4ec+_0x47f4('0x36'))['join'](_0x372a59,null,_0x372a59+'.id\x20=\x20'+_0x17f4ec+'.'+_0x191e12)[_0x47f4('0x13')](_0x17f4ec+_0x47f4('0x37'),_0x4d8e68)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x47f4('0x13')](_0x47f4('0x39'),squel[_0x47f4('0xe')]()['field'](_0x47f4('0x3e'))[_0x47f4('0x10')](_0x47f4('0x3d'))[_0x47f4('0x13')](_0x47f4('0x40'),_0x4d8e68)['where'](_0x191e12+_0x47f4('0x14')+_0x17f4ec+'.'+_0x191e12)))[_0x47f4('0x41')]();}function insertCmHopperAdditionalPhones(_0x5dfb3c){var _0x463890=[_0x47f4('0x46'),'cm_contact_has_items.item',_0x47f4('0x47'),_0x47f4('0x48'),'cm_contact_has_items.updatedAt'];return squel[_0x47f4('0x2b')]()[_0x47f4('0x2c')](_0x47f4('0x49'))[_0x47f4('0x2d')]([_0x47f4('0x4a'),_0x47f4('0x3e'),_0x47f4('0x4b'),_0x47f4('0x30'),_0x47f4('0x3f')],squel['select']()[_0x47f4('0x33')](_0x463890)[_0x47f4('0x10')](_0x47f4('0x3a'))['join'](_0x47f4('0x34'),null,_0x47f4('0x4c'))[_0x47f4('0x11')](_0x47f4('0x4d'),null,_0x47f4('0x4e'))[_0x47f4('0x13')]('cm_hopper.ListId\x20=\x20?',_0x5dfb3c)[_0x47f4('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x42f306,_0x7dba0d,_0x2f0593,_0x217643){var _0x27eca5=_['concat'](_[_0x47f4('0x4f')](_0x217643),[_0x47f4('0x2f'),_0x47f4('0x50'),'createdAt','updatedAt',_0x47f4('0x51')]);return squel['insert']()[_0x47f4('0x2c')](_0x47f4('0x34'))[_0x47f4('0x2d')](_0x27eca5,squel[_0x47f4('0xe')]()[_0x47f4('0x33')](_0x27eca5)['from'](_0x7dba0d)[_0x47f4('0x13')]('('+_0x2f0593['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x47f4('0xe')]()[_0x47f4('0x33')](_0x2f0593)[_0x47f4('0x10')](_0x47f4('0x34'))[_0x47f4('0x13')](_0x47f4('0x40'),_0x42f306)[_0x47f4('0x13')](_0x47f4('0x52')))[_0x47f4('0x13')]('id\x20IN\x20?',squel[_0x47f4('0xe')]()[_0x47f4('0xf')](_0x47f4('0x53'),_0x47f4('0x54'))[_0x47f4('0x10')](_0x7dba0d)[_0x47f4('0x55')](_0x2f0593[_0x47f4('0x11')](','))))[_0x47f4('0x41')]();}function handleStop(){logger[_0x47f4('0x56')](_0x47f4('0x57'));stopped=!![];}function handleUncaughtException(_0x17a3be){logger[_0x47f4('0x58')](_0x17a3be[_0x47f4('0x59')]);process[_0x47f4('0x5a')](0x1);}function handleError(_0x5a52c6,_0x3bc066){stats['errors']['push']({'name':_0x3bc066[_0x47f4('0x5b')],'message':_0x3bc066[_0x47f4('0x59')],'row':_0x5a52c6});}function handleQuery(_0x11e6fc){logger['info'](_0x11e6fc);return db['sequelize'][_0x47f4('0x5c')](_0x11e6fc)[_0x47f4('0x5d')](function(_0x41f857){results['push'](_0x41f857);})[_0x47f4('0x5e')](function(_0x437faa){logger['error'](_0x437faa['message']);});}function updateTzCampaigns(_0x3020ce){return new Promise(function(_0x30962f,_0x268777){var _0x52993e=squel['select']()[_0x47f4('0x33')]([_0x47f4('0x5f'),_0x47f4('0x60')])[_0x47f4('0x10')](_0x47f4('0x61'))[_0x47f4('0x11')](_0x47f4('0x62'),null,_0x47f4('0x63'))[_0x47f4('0x13')]('campaigns_has_cm_lists.CmListId='+_0x3020ce);db[_0x47f4('0x64')][_0x47f4('0x5c')](_0x52993e[_0x47f4('0x41')]())['spread'](function(_0x4fe9e8){var _0x1233e9=[];for(var _0x391bbb=0x0;_0x391bbb<_0x4fe9e8['length'];_0x391bbb++){_0x1233e9[_0x47f4('0x1b')](getTimezoneData(_0x4fe9e8[_0x391bbb],tmp_campaigns));}BPromise[_0x47f4('0x1c')](_0x1233e9)[_0x47f4('0x19')](function(){_0x30962f({'val':0x1});});})[_0x47f4('0x5e')](function(_0x5f2d00){logger[_0x47f4('0x58')](_0x5f2d00[_0x47f4('0x59')]);_0x30962f({'val':0x0});});});}function updateTzVoiceQueues(_0x457b21){return new Promise(function(_0xaaa21a,_0x281d17){var _0x241d12=squel[_0x47f4('0xe')]()[_0x47f4('0x33')]([_0x47f4('0x65'),_0x47f4('0x66')])[_0x47f4('0x10')](_0x47f4('0x67'))['join'](_0x47f4('0x68'),null,_0x47f4('0x69'))[_0x47f4('0x13')](_0x47f4('0x6a')+_0x457b21);db[_0x47f4('0x64')][_0x47f4('0x5c')](_0x241d12[_0x47f4('0x41')]())[_0x47f4('0x5d')](function(_0x6b2b06){var _0x54b144=[];for(var _0x4c3959=0x0;_0x4c3959<_0x6b2b06[_0x47f4('0x1a')];_0x4c3959++){_0x54b144[_0x47f4('0x1b')](getTimezoneData(_0x6b2b06[_0x4c3959],tmp_voice_queues));}BPromise[_0x47f4('0x1c')](_0x54b144)[_0x47f4('0x19')](function(){_0xaaa21a({'val':0x1});});})[_0x47f4('0x5e')](function(_0x33e80a){logger[_0x47f4('0x58')](_0x33e80a[_0x47f4('0x59')]);_0xaaa21a({'val':0x0});});});}function getTimezoneData(_0x770cf4,_0x41f4b2){return new Promise(function(_0x4193dd,_0x26d0f2){var _0x6b4783=shared['timezones'];var _0xeb886e=_0x6b4783[_0x770cf4[_0x47f4('0x6b')]];if(_[_0x47f4('0x1e')](_0xeb886e)){_0x4193dd({'ret':0x1});}else{var _0x3e39eb=_0xeb886e['utcOffset'];var _0x3d3ecf=squel[_0x47f4('0x2b')]()[_0x47f4('0x2c')](_0x41f4b2)['set']('id',_0x770cf4['id'])['set'](_0x47f4('0x6c'),_0x3e39eb)[_0x47f4('0x6d')](_0x47f4('0x6b'),_0x770cf4[_0x47f4('0x6b')])[_0x47f4('0x41')]();return db[_0x47f4('0x64')][_0x47f4('0x5c')](_0x3d3ecf)[_0x47f4('0x5d')](function(_0x103dd3){_0x4193dd({'ret':0x1});})[_0x47f4('0x5e')](function(_0x2e4f10){logger['error'](_0x2e4f10[_0x47f4('0x59')]);_0x26d0f2({'ret':0x1});});}});}function handleTZQuery(_0x385e93){logger[_0x47f4('0x56')](_0x385e93);return db[_0x47f4('0x64')][_0x47f4('0x5c')](_0x385e93)[_0x47f4('0x5d')](function(_0x4a9f99){})[_0x47f4('0x5e')](function(_0x2190c7){logger[_0x47f4('0x58')](_0x2190c7[_0x47f4('0x59')]);});}function main(_0x413158,_0x5ac0c5,_0x4654c2,_0x28762a){logger[_0x47f4('0x56')](_0x47f4('0x6e'),_0x413158,JSON['stringify'](_0x5ac0c5));process['send'](_0x47f4('0x6f'));var _0x296875=_0x5ac0c5[_0x47f4('0x70')];var _0x1885cc=_[_0x47f4('0x71')](_0x296875);var _0x47db95=_0x5ac0c5[_0x47f4('0x72')];var _0x215a90=path[_0x47f4('0x11')](config['root'],_0x47f4('0x73'),_0x47db95+_0x47f4('0x74'));hasTZ=_[_0x47f4('0x4f')](_0x296875)[_0x47f4('0x75')](_0x47f4('0x6b'));var _0x525fe2=_[_0x47f4('0x4f')](_0x296875)[_0x47f4('0x11')]();logger[_0x47f4('0x56')](_0x47f4('0x76'),_0x525fe2);db['ContactItemType'][_0x47f4('0x17')]({'raw':!![],'attributes':['id',_0x47f4('0x77')]})[_0x47f4('0x19')](function(_0x223b04){for(var _0x24a2a2=0x0;_0x24a2a2<_0x223b04[_0x47f4('0x1a')];_0x24a2a2++){if(_0x223b04[_0x24a2a2][_0x47f4('0x77')]in _0x296875){contactItemTypes[_0x47f4('0x1b')](_0x223b04[_0x24a2a2]);delete _0x1885cc[_0x223b04[_0x24a2a2]['name']];hasAdditionalPhones=!![];}for(var _0xaa3bf6 in _0x296875){if(_0x223b04[_0x24a2a2]['name']+_0x47f4('0x78')===_0xaa3bf6){phoneDescriptions[_0x47f4('0x1b')]({'itemTypeId':_0x223b04[_0x24a2a2]['id'],'description':_0xaa3bf6});delete _0x1885cc[_0xaa3bf6];}}}if(hasAdditionalPhones)_0x1885cc[_0x47f4('0x18')]='';var _0x15a638=_[_0x47f4('0x4f')](_0x1885cc)[_0x47f4('0x11')]();logger[_0x47f4('0x56')](_0x47f4('0x76'),_0x15a638);fs[_0x47f4('0x79')](_0x215a90,_0x15a638+'\x0a');Papa['parse'](fs[_0x47f4('0x7a')](_0x413158),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e8c7b,_0x25dbfb){try{for(var _0x1f1e98=0x0,_0x428b6d=[];_0x1f1e98<_0x3e8c7b[_0x47f4('0x7b')][_0x47f4('0x1a')];_0x1f1e98++){stats[_0x47f4('0x7c')]+=0x1;if(_0x3e8c7b[_0x47f4('0x7d')][_0x1f1e98]){handleError(_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98],_0x3e8c7b['errors'][_0x1f1e98]);}else{var _0x53fbc3=[];var _0x5588e7=[];var _0x96f52c={};for(var _0x52dfa7 in _0x296875){let _0x3333bb=contactItemTypes[_0x47f4('0x7e')](_0xe15bbe=>_0xe15bbe[_0x47f4('0x77')]===_0x52dfa7);let _0x74fc64=contactItemTypes['find'](_0x3a9c8c=>_0x3a9c8c[_0x47f4('0x77')]+_0x47f4('0x78')===_0x52dfa7);if(_['isNil'](_0x3333bb)&&_[_0x47f4('0x1e')](_0x74fc64)){if(_0x296875[_0x47f4('0x7f')](_0x52dfa7)){if(_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98][_0x296875[_0x52dfa7]]){var _0x4f02af=_[_0x47f4('0x80')](_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98][_0x296875[_0x52dfa7]]['replace'](/"/g,'\x27'));switch(_0x52dfa7){case _0x47f4('0x44'):var _0x58e231=moment(_0x4f02af,_0x47f4('0xd'),!![]);if(_0x58e231[_0x47f4('0x81')]()){_0x428b6d[_0x47f4('0x1b')]('\x22'+_0x4f02af+'\x22');}else{_0x53fbc3[_0x47f4('0x1b')](_0x47f4('0x82'));}break;case _0x47f4('0x31'):var _0x113b92=parseInt(_0x4f02af);_0x4f02af=_[_0x47f4('0x83')](_0x113b92)||_0x113b92<0x0||_0x113b92>0x4?_0x28762a?0x3:0x2:_0x113b92;_0x428b6d['push']('\x22'+_0x4f02af+'\x22');break;case'UserId':var _0x4a2c22=parseInt(_0x4f02af);if(_['isNumber'](_0x4a2c22)&&_['includes'](_0x4654c2,_0x4a2c22)){_0x428b6d['push']('\x22'+_0x4a2c22+'\x22');}else{_0x53fbc3[_0x47f4('0x1b')](_0x47f4('0x84'));}break;case _0x47f4('0x85'):if(isEmail(_0x4f02af)){_0x428b6d[_0x47f4('0x1b')]('\x22'+_0x4f02af+'\x22');}else{_0x53fbc3[_0x47f4('0x1b')](_0x47f4('0x86'));}break;case _0x47f4('0x87'):var _0x5aa003=moment(_0x4f02af,_0x47f4('0x88'),!![]);if(_0x5aa003[_0x47f4('0x81')]()){_0x428b6d['push']('\x22'+_0x4f02af+'\x22');}else{_0x53fbc3['push'](_0x47f4('0x89'));}break;case _0x47f4('0x6b'):var _0x12f732=shared[_0x47f4('0x8a')];var _0x178c6c=_0x12f732[_0x4f02af];if(!_[_0x47f4('0x1e')](_0x178c6c)){var _0x5ddb8f=_0x178c6c[_0x47f4('0x8b')];_0x428b6d['push']('\x22'+_0x4f02af+'\x22');_0x428b6d[_0x47f4('0x1b')]('\x22'+_0x5ddb8f+'\x22');}break;default:_0x428b6d[_0x47f4('0x1b')]('\x22'+_0x4f02af+'\x22');}}else{switch(_0x52dfa7){case _0x47f4('0x8c'):case _0x47f4('0x3e'):_0x53fbc3[_0x47f4('0x1b')](_0x52dfa7+_0x47f4('0x8d'));break;default:_0x428b6d[_0x47f4('0x1b')]('\x22\x22');}}}}else{var _0x5c24bf='';if(!_['isNil'](_0x3333bb)){if(!_0x96f52c['hasOwnProperty'](_0x3333bb['id'])){if(!_['isNil'](_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98][_0x296875[_0x52dfa7]])){var _0x4f02af=_[_0x47f4('0x80')](_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98][_0x296875[_0x52dfa7]][_0x47f4('0x8e')](/"/g,'\x27'));var _0x5be4ab=phoneDescriptions[_0x47f4('0x7e')](_0x4c7274=>_0x4c7274['itemTypeId']===_0x3333bb['id']);if(!_[_0x47f4('0x1e')](_0x5be4ab)){var _0x3d9ad3=_['trim'](_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98][_0x296875[_0x5be4ab[_0x47f4('0x8f')]]][_0x47f4('0x8e')](/"/g,'\x27'));if(!_[_0x47f4('0x1e')](_0x3d9ad3))_0x4f02af=_0x4f02af+'§'+_0x3d9ad3;}if(_0x5c24bf=='')_0x5c24bf=_0x4f02af;else _0x5c24bf+='|'+_0x4f02af;}_0x5588e7[_0x47f4('0x1b')](_0x3333bb['id']+':'+_0x5c24bf);_0x96f52c[_0x3333bb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x428b6d[_0x47f4('0x1b')]('\x22'+_0x5588e7[_0x47f4('0x11')](';')+'\x22');}if(_0x53fbc3[_0x47f4('0x1a')]){handleError(_0x3e8c7b[_0x47f4('0x7b')][_0x1f1e98],{'code':'SystemRow','message':_0x53fbc3['join']()});}else{fs[_0x47f4('0x90')](_0x215a90,_0x428b6d[_0x47f4('0x11')]()+'\x0a');}_0x428b6d=[];}if(!(stats[_0x47f4('0x7c')]%0xc8)){socket['emit'](_0x47f4('0x91')+_0x47db95,stats);stats[_0x47f4('0x7d')]=[];}}if(stopped){logger[_0x47f4('0x56')]('Abort\x20parser');_0x25dbfb[_0x47f4('0x92')]();}}catch(_0xa56506){handleError(_0x3e8c7b['data'][_0x1f1e98],{'code':'SystemError','message':_0xa56506[_0x47f4('0x59')]});logger[_0x47f4('0x58')]('step',_0xa56506[_0x47f4('0x59')]);}},'complete':function(){try{var _0xf2d441=[];var _0x194861=[];var _0x36d254=_0x47f4('0x34');if(_0x5ac0c5[_0x47f4('0x93')]&&_0x5ac0c5[_0x47f4('0x93')][_0x47f4('0x1a')]){_0x36d254=_0x47f4('0x94')+_0x47db95;_0xf2d441[_0x47f4('0x1b')](_0x47f4('0x95')+_0x36d254+_0x47f4('0x96'));}tmp_campaigns=_0x47f4('0x97')+_0x47db95;tmp_voice_queues=_0x47f4('0x98')+_0x47db95;_0x194861['push'](_0x47f4('0x95')+tmp_campaigns+_0x47f4('0x99'));_0x194861[_0x47f4('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x47f4('0x99'));BPromise[_0x47f4('0x9a')](_0x194861,handleTZQuery)['then'](function(_0x3e7b94){updateTzCampaigns(_0x5ac0c5[_0x47f4('0x2f')])[_0x47f4('0x19')](function(_0x4d152a){updateTzVoiceQueues(_0x5ac0c5[_0x47f4('0x2f')])[_0x47f4('0x19')](function(_0x300987){if(hasTZ)_0x15a638=_0x15a638[_0x47f4('0x8e')](_0x47f4('0x6b'),_0x47f4('0x9b'));var _0x75a721=util[_0x47f4('0xc')]('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',_0x215a90,_0x36d254,_0x15a638,_0x5ac0c5[_0x47f4('0x2f')],_0x5ac0c5[_0x47f4('0x50')]||null,NOW,NOW);if(_[_0x47f4('0x1e')](_0x296875[_0x47f4('0x44')])){_0x75a721+=',\x20scheduledAt\x20=\x20NOW()';}_0xf2d441['push'](_0x75a721);if(_0x5ac0c5[_0x47f4('0x93')]&&_0x5ac0c5[_0x47f4('0x93')][_0x47f4('0x1a')]){_0xf2d441[_0x47f4('0x1b')](insertCmContact(_0x5ac0c5[_0x47f4('0x2f')],_0x36d254,_0x5ac0c5['duplicates'],_0x296875));_0xf2d441[_0x47f4('0x1b')]('DROP\x20TABLE\x20'+_0x36d254+';');}BPromise[_0x47f4('0x9a')](_0xf2d441,handleQuery)[_0x47f4('0x19')](function(_0x4d4302){BPromise['all']([handleAdditionalPhones()])[_0x47f4('0x19')](function(){_0xf2d441=[];for(var _0x4ade71=0x0;_0x4ade71_0x53ceb4[_0xef9a('0x69')]===_0x374158);let _0x121ed9=contactItemTypes[_0xef9a('0x70')](_0x20efcd=>_0x20efcd[_0xef9a('0x69')]+_0xef9a('0x71')===_0x374158);if(_[_0xef9a('0x1f')](_0x48f586)&&_[_0xef9a('0x1f')](_0x121ed9)){if(_0x35722e[_0xef9a('0x72')](_0x374158)){if(_0x3d25bf[_0xef9a('0x6f')][_0x5c21fa][_0x35722e[_0x374158]]){var _0x382d73=_[_0xef9a('0x73')](_0x3d25bf[_0xef9a('0x6f')][_0x5c21fa][_0x35722e[_0x374158]][_0xef9a('0x74')](/"/g,'\x27'));switch(_0x374158){case _0xef9a('0x35'):var _0x2a828e=moment(_0x382d73,_0xef9a('0xd'),!![]);if(_0x2a828e['isValid']()){_0x4fc943[_0xef9a('0x21')]('\x22'+_0x382d73+'\x22');}else{_0x5b3bfa[_0xef9a('0x21')](_0xef9a('0x75'));}break;case _0xef9a('0x39'):var _0x19b890=parseInt(_0x382d73);_0x382d73=_[_0xef9a('0x76')](_0x19b890)||_0x19b890<0x0||_0x19b890>0x4?_0x118751?0x3:0x2:_0x19b890;_0x4fc943[_0xef9a('0x21')]('\x22'+_0x382d73+'\x22');break;case _0xef9a('0x3a'):var _0x825125=parseInt(_0x382d73);if(_[_0xef9a('0x77')](_0x825125)&&_['includes'](_0x5e60e0,_0x825125)){_0x4fc943[_0xef9a('0x21')]('\x22'+_0x825125+'\x22');}else{_0x5b3bfa[_0xef9a('0x21')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x382d73)){_0x4fc943[_0xef9a('0x21')]('\x22'+_0x382d73+'\x22');}else{_0x5b3bfa['push'](_0xef9a('0x78'));}break;case'dateOfBirth':var _0x50afd6=moment(_0x382d73,_0xef9a('0x79'),!![]);if(_0x50afd6[_0xef9a('0x7a')]()){_0x4fc943[_0xef9a('0x21')]('\x22'+_0x382d73+'\x22');}else{_0x5b3bfa[_0xef9a('0x21')](_0xef9a('0x7b'));}break;default:_0x4fc943[_0xef9a('0x21')]('\x22'+_0x382d73+'\x22');}}else{switch(_0x374158){case'firstName':case _0xef9a('0x1e'):_0x5b3bfa[_0xef9a('0x21')](_0x374158+'\x20not\x20specified');break;default:_0x4fc943[_0xef9a('0x21')]('\x22\x22');}}}}else{var _0xf6b6c5='';if(!_[_0xef9a('0x1f')](_0x48f586)){if(!_0x34f91d[_0xef9a('0x72')](_0x48f586['id'])){for(var _0x183cd2=0x0;_0x183cd2<_0x35722e[_0x374158][_0xef9a('0x1d')];_0x183cd2++){var _0x382d73=_['trim'](_0x3d25bf[_0xef9a('0x6f')][_0x5c21fa][_0x35722e[_0x374158][_0x183cd2]]['replace'](/"/g,'\x27'));var _0x13fd27=phoneDescriptions[_0xef9a('0x70')](_0x246cd7=>_0x246cd7[_0xef9a('0x7c')]===_0x48f586['id']);if(!_[_0xef9a('0x1f')](_0x13fd27)){var _0x1501ad=_[_0xef9a('0x73')](_0x3d25bf['data'][_0x5c21fa][_0x35722e[_0x13fd27[_0xef9a('0x7d')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xef9a('0x1f')](_0x1501ad))_0x382d73=_0x382d73+'§'+_0x1501ad;}if(_0xf6b6c5=='')_0xf6b6c5=_0x382d73;else _0xf6b6c5+='|'+_0x382d73;}_0x1dca61[_0xef9a('0x21')](_0x48f586['id']+':'+_0xf6b6c5);_0x34f91d[_0x48f586['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4fc943['push']('\x22'+_0x1dca61[_0xef9a('0x18')](';')+'\x22');}if(_0x5b3bfa[_0xef9a('0x1d')]){handleError(_0x3d25bf[_0xef9a('0x6f')][_0x5c21fa],{'code':_0xef9a('0x7e'),'message':_0x5b3bfa['join']()});}else{fs[_0xef9a('0x7f')](_0x15cd21,_0x4fc943[_0xef9a('0x18')]()+'\x0a');}_0x4fc943=[];}if(!(stats[_0xef9a('0x80')]%0xc8)){socket['emit'](_0xef9a('0x81')+_0x4a00d2,stats);stats[_0xef9a('0x5e')]=[];}}if(stopped){logger[_0xef9a('0x60')]('Abort\x20parser');_0x38cc93[_0xef9a('0x82')]();}}catch(_0x307c96){handleError(_0x3d25bf['data'][_0x5c21fa],{'code':_0xef9a('0x83'),'message':_0x307c96[_0xef9a('0x25')]});logger['error'](_0xef9a('0x84'),_0x307c96['message']);}},'complete':function(){try{var _0x1bdba2=[];var _0x1363cb=tempTableName;_0x1bdba2[_0xef9a('0x21')](_0xef9a('0x85')+_0x1363cb+_0xef9a('0x86'));logger[_0xef9a('0x60')](_0xef9a('0x87'),contactItemTypes[_0xef9a('0x1d')]);var _0x2e47d8=util[_0xef9a('0x88')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x15cd21,_0x1363cb,_0x575bee,_0x57ee4d['ListId'],_0x57ee4d[_0xef9a('0x59')]||null,NOW,NOW);if(_[_0xef9a('0x1f')](_0x35722e[_0xef9a('0x35')])){_0x2e47d8+=_0xef9a('0x89');}_0x1bdba2[_0xef9a('0x21')](_0x2e47d8);BPromise['each'](_0x1bdba2,handleQuery)[_0xef9a('0x23')](function(_0x191195){BPromise[_0xef9a('0x22')]([handleAdditionalPhones()])[_0xef9a('0x23')](function(){_0x1bdba2=[];for(var _0x478add=0x0;_0x478add\x20\x20');}var _0x5efade=path['join'](config[_0xef9a('0x65')],_0xef9a('0x66'),process['argv'][0x2]);if(!fs[_0xef9a('0x93')](_0x5efade)){throw new Error(_0xef9a('0x94'));}var _0x5b41d0={};try{_0x5b41d0=JSON[_0xef9a('0x6d')](process['argv'][0x3]);if(!_0x5b41d0[_0xef9a('0x63')]){throw new Error(_0xef9a('0x95'));}var _0x4ef89a=0x0;if(_0x5b41d0[_0xef9a('0x63')]['UserId']){_0x4ef89a=0x1;}if(!_0x5b41d0[_0xef9a('0x36')]){throw new Error(_0xef9a('0x96'));}}catch(_0x3a3a02){throw new Error(_0xef9a('0x97'));}var _0x356c18=[];try{_0x356c18=_['map'](JSON['parse'](process[_0xef9a('0x92')][0x4]),'id');}catch(_0x40acd6){logger['info']('No\x20agent\x20available');}main(_0x5efade,_0x5b41d0,_0x356c18,_0x4ef89a);}validate();process['on'](_0xef9a('0x98'),handleStop);process['on'](_0xef9a('0x99'),handleUncaughtException); \ No newline at end of file +var _0xd1d3=['code','query','catch','main','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','findAll','name','_description','createReadStream','data','rows','errors','find','hasOwnProperty','trim','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','replace','itemTypeId','description','appendFileSync','emit','contact:import:','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','finish','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','path','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','message','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmContact','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fromQuery','ContactId','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','id\x20IN\x20?','MIN(id)','info','error','exit'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x4142af,_0x396358){_0x4142af=_0x4142af-0x0;var _0x4bd460=_0xd1d3[_0x4142af];return _0x4bd460;};'use strict';var fs=require('fs');var path=require(_0x3d1d('0x0'));var _=require('lodash');var Papa=require(_0x3d1d('0x1'));var util=require('util');var BPromise=require(_0x3d1d('0x2'));var moment=require(_0x3d1d('0x3'));var squel=require(_0x3d1d('0x4'));var Redis=require(_0x3d1d('0x5'));var db=require(_0x3d1d('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x3d1d('0x7'))(_0x3d1d('0x8'));config['redis']=_[_0x3d1d('0x9')](config[_0x3d1d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d1d('0xb'))(new Redis(config[_0x3d1d('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x3d1d('0xc')](_0x3d1d('0xd'));var tempTableName=_0x3d1d('0xe')+moment()[_0x3d1d('0xc')](_0x3d1d('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x448422){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))*$/[_0x3d1d('0x10')](_0x448422);}function selectNotIn(_0x246954,_0xf2ac87,_0x2b1d2f,_0x3037d8,_0xde1f63){return squel[_0x3d1d('0x11')]()[_0x3d1d('0x12')](_0x3d1d('0x13'))[_0x3d1d('0x14')](_0x3037d8)[_0x3d1d('0x15')](_0xf2ac87,null,_0xf2ac87+'.id\x20=\x20'+_0x3037d8+'.'+_0x2b1d2f)[_0x3d1d('0x16')](_0x3037d8+'.'+_0x2b1d2f+_0x3d1d('0x17')+_0x246954+'.'+_0x2b1d2f)[_0x3d1d('0x16')](_0xf2ac87+_0x3d1d('0x18')+_0xde1f63[_0x3d1d('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x12dd84,_0x4751b9){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3d1d('0x19')]['query'](_0x3d1d('0x1a')+tempTableName)[_0x3d1d('0x1b')](function(_0x5d6a51){if(_0x5d6a51!==null){var _0x5786df=[];for(var _0x3b30bd=0x0;_0x3b30bd<_0x5d6a51[_0x3d1d('0x1c')];_0x3b30bd++){var _0x1e71cf=_0x5d6a51[_0x3b30bd];if(!_[_0x3d1d('0x1d')](_0x1e71cf['phone'])){if(!_[_0x3d1d('0x1d')](_0x1e71cf[_0x3d1d('0x1e')]))_0x5786df[_0x3d1d('0x1f')](insertAdditionalPhones(_0x1e71cf));promisesContact[_0x3d1d('0x1f')]({'contact':_0x1e71cf});}}}Promise[_0x3d1d('0x20')](_0x5786df)[_0x3d1d('0x21')](function(){_0x12dd84({'val':0x1});});})['catch'](function(_0x5d1af5){logger['error'](_0x5d1af5[_0x3d1d('0x22')]);});});}function insertAdditionalPhones(_0x19ae5b){return new Promise(function(_0x982a88,_0xedf825){var _0x1f5c7c=_0x19ae5b[_0x3d1d('0x1e')];if(_[_0x3d1d('0x1d')](_0x1f5c7c))_0xedf825({'val':0x0});else{var _0x42a46d=_0x1f5c7c[_0x3d1d('0x23')](';');var _0x4bbb58=[];orderBy=0x0;for(var _0x553fa1=0x0;_0x553fa1<_0x42a46d[_0x3d1d('0x1c')];_0x553fa1++){_0x4bbb58[_0x3d1d('0x1f')](splitAdditionalPhone(_0x19ae5b['id'],_0x42a46d[_0x553fa1]));}Promise[_0x3d1d('0x20')](_0x4bbb58)['then'](function(){_0x982a88({'val':_0x42a46d[_0x3d1d('0x1c')]});});}});}function splitAdditionalPhone(_0x3dae29,_0x4760a4){return new Promise(function(_0x21d60e,_0x12f5ab){var _0x50bd12=_0x4760a4[_0x3d1d('0x23')](':');var _0x1542e3=_0x50bd12[0x0];var _0x1a7c18=_0x50bd12[0x1];if(_0x1a7c18!==''){var _0x2e0339=_0x1a7c18[_0x3d1d('0x23')]('|');var _0xbda25a=[];for(var _0x49b800=0x0;_0x49b800<_0x2e0339['length'];_0x49b800++){if(_0x2e0339[_0x49b800]!==''){var _0x4efc5c=_[_0x3d1d('0x24')](promisesAdditionalPhones,{'contactId':_0x3dae29,'phone':_0x2e0339[_0x49b800]});if(_0x4efc5c[_0x3d1d('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x3d1d('0x1f')]({'contactId':_0x3dae29,'contactTypeId':_0x1542e3,'phone':_0x2e0339[_0x49b800],'orderBy':orderBy});}}}_0x21d60e({'ok':0x1});}else _0x21d60e({'res':0x0});});}function createAdditionalPhone(_0xf7687d,_0x54d7d5,_0x4a4623,_0x8aaf8){var _0x5ea525='';var _0x181d71='';var _0x23116a=_0x4a4623[_0x3d1d('0x23')]('§');_0x5ea525=_0x23116a[0x0];if(_0x23116a[_0x3d1d('0x1c')]==0x2)_0x181d71=_0x23116a[0x1];return new Promise(function(_0xb75151,_0x151ded){return db[_0x3d1d('0x25')][_0x3d1d('0x26')]({'where':{'CmContactId':_0xf7687d,'item':_0x5ea525}})[_0x3d1d('0x21')](function(_0x58b541){if(_0x58b541){return db[_0x3d1d('0x25')][_0x3d1d('0x27')]({'ItemTypeId':_0x54d7d5,'description':_0x181d71,'OrderBy':_0x8aaf8},{'where':{'CmContactId':_0xf7687d,'item':_0x5ea525}})[_0x3d1d('0x21')](function(_0xdaab2){_0xb75151({'res':_0x3d1d('0x28')});});}else{return db[_0x3d1d('0x25')][_0x3d1d('0x29')]({'CmContactId':_0xf7687d,'item':_0x5ea525,'ItemTypeId':_0x54d7d5,'description':_0x181d71,'OrderBy':_0x8aaf8,'ItemClass':_0x3d1d('0x2a')})['then'](function(_0x2b3bd3){_0xb75151({'res':_0x3d1d('0x2b')});});}});});}function updateContact(_0xf53b40){return new Promise(function(_0x20111a,_0x122a0b){var _0x26033e=_0xf53b40['id'];delete _0xf53b40['id'];return db[_0x3d1d('0x2c')][_0x3d1d('0x27')](_0xf53b40,{'where':{'id':_0x26033e}})[_0x3d1d('0x21')](function(_0xb65cbc){updatedRows+=0x1;return db['CmHopper'][_0x3d1d('0x27')]({'phone':_0xf53b40[_0x3d1d('0x13')]},{'where':{'ContactId':_0x26033e}})[_0x3d1d('0x21')](function(_0xaedceb){_0x20111a({'ret':'OK'});});});});}function insertCmHopper(_0x183063,_0x17db7b,_0x43a778,_0x2cdf4,_0x3bc7fc){var _0xe1cb4b=[_0x3d1d('0x2d'),_0x3d1d('0x2e'),'cm_contacts.id',_0x3d1d('0x2f'),_0x17db7b+'.'+_0x2cdf4,_0x3d1d('0x30'),_0x3d1d('0x31'),'cm_contacts.priority',_0x3d1d('0x32'),'\x22'+_0x3bc7fc+'\x22'];return squel[_0x3d1d('0x33')]()[_0x3d1d('0x34')]('cm_hopper')['fromQuery']([_0x3d1d('0x13'),'scheduledat','ContactId',_0x3d1d('0x35'),_0x2cdf4,_0x3d1d('0x36'),_0x3d1d('0x37'),_0x3d1d('0x38'),'UserId',_0x3d1d('0x39')],squel[_0x3d1d('0x11')]()[_0x3d1d('0x3a')](_0xe1cb4b)['from'](_0x17db7b)[_0x3d1d('0x15')](_0x3d1d('0x3b'),null,_0x3d1d('0x3c')+_0x17db7b+_0x3d1d('0x3d'))[_0x3d1d('0x15')](_0x43a778,null,_0x43a778+_0x3d1d('0x3e')+_0x17db7b+'.'+_0x2cdf4)[_0x3d1d('0x16')](_0x17db7b+'.CmListId\x20=\x20?',_0x183063)[_0x3d1d('0x16')](_0x3d1d('0x3f'),NOW)[_0x3d1d('0x16')](_0x3d1d('0x40'),selectNotIn(_0x17db7b,_0x43a778,_0x2cdf4,_0x3d1d('0x41'),[_0x3d1d('0x42'),_0x3d1d('0x43')]))[_0x3d1d('0x16')](_0x3d1d('0x40'),selectNotIn(_0x17db7b,_0x43a778,_0x2cdf4,_0x3d1d('0x41'),[_0x3d1d('0x42')])))[_0x3d1d('0x44')]();}function insertCmHopperBlack(_0x564078,_0x4adf17,_0x29643f,_0x493175){var _0x1526ea=['cm_contacts.phone','cm_contacts.id',_0x3d1d('0x2f'),_0x4adf17+'.'+_0x493175,_0x3d1d('0x30'),_0x3d1d('0x31')];return squel[_0x3d1d('0x33')]()[_0x3d1d('0x34')](_0x3d1d('0x45'))[_0x3d1d('0x46')]([_0x3d1d('0x13'),_0x3d1d('0x47'),_0x3d1d('0x35'),_0x493175,_0x3d1d('0x36'),_0x3d1d('0x37')],squel[_0x3d1d('0x11')]()['fields'](_0x1526ea)[_0x3d1d('0x14')](_0x4adf17)[_0x3d1d('0x15')](_0x3d1d('0x3b'),null,_0x3d1d('0x3c')+_0x4adf17+_0x3d1d('0x3d'))[_0x3d1d('0x15')](_0x29643f,null,_0x29643f+_0x3d1d('0x3e')+_0x4adf17+'.'+_0x493175)['where'](_0x4adf17+'.CmListId\x20=\x20?',_0x564078)['where'](_0x3d1d('0x3f'),NOW)[_0x3d1d('0x16')](_0x3d1d('0x40'),squel['select']()[_0x3d1d('0x12')](_0x3d1d('0x13'))[_0x3d1d('0x14')](_0x3d1d('0x45'))[_0x3d1d('0x16')](_0x3d1d('0x48'),_0x564078)[_0x3d1d('0x16')](_0x493175+_0x3d1d('0x49'),_0x4adf17+'.'+_0x493175)))[_0x3d1d('0x44')]();}function insertCmHopperAdditionalPhones(_0x1185b0){var _0x134aab=[_0x3d1d('0x4a'),_0x3d1d('0x4b'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x3d1d('0x4c')];return squel[_0x3d1d('0x33')]()['into'](_0x3d1d('0x4d'))[_0x3d1d('0x46')]([_0x3d1d('0x4e'),_0x3d1d('0x13'),_0x3d1d('0x4f'),_0x3d1d('0x36'),_0x3d1d('0x37')],squel[_0x3d1d('0x11')]()[_0x3d1d('0x3a')](_0x134aab)[_0x3d1d('0x14')]('cm_hopper')[_0x3d1d('0x15')](_0x3d1d('0x3b'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x3d1d('0x15')](_0x3d1d('0x50'),null,_0x3d1d('0x51'))['where'](_0x3d1d('0x52'),_0x1185b0)['where']('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x250e43,_0x15f1e8,_0x2e1d56,_0x1072be){var _0x39ca6d=_['concat'](_[_0x3d1d('0x53')](_0x1072be),[_0x3d1d('0x35'),'CompanyId','createdAt',_0x3d1d('0x37')]);return squel[_0x3d1d('0x33')]()[_0x3d1d('0x34')]('cm_contacts')[_0x3d1d('0x46')](_0x39ca6d,squel[_0x3d1d('0x11')]()['fields'](_0x39ca6d)[_0x3d1d('0x14')](_0x15f1e8)[_0x3d1d('0x16')]('('+_0x2e1d56[_0x3d1d('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0x3d1d('0x11')]()[_0x3d1d('0x3a')](_0x2e1d56)[_0x3d1d('0x14')]('cm_contacts')[_0x3d1d('0x16')]('ListId\x20=\x20?',_0x250e43))['where'](_0x3d1d('0x54'),squel[_0x3d1d('0x11')]()['field'](_0x3d1d('0x55'),'min_id')[_0x3d1d('0x14')](_0x15f1e8)['group'](_0x2e1d56[_0x3d1d('0x15')](','))))['toString']();}function handleStop(){logger[_0x3d1d('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xbab993){logger[_0x3d1d('0x57')](_0xbab993[_0x3d1d('0x22')]);process[_0x3d1d('0x58')](0x1);}function handleError(_0x797e20,_0xd9490d){stats['errors'][_0x3d1d('0x1f')]({'name':_0xd9490d[_0x3d1d('0x59')],'message':_0xd9490d[_0x3d1d('0x22')],'row':_0x797e20});}function handleQuery(_0xae2c34){logger['info'](_0xae2c34);return db[_0x3d1d('0x19')][_0x3d1d('0x5a')](_0xae2c34)[_0x3d1d('0x1b')](function(_0x1ace4a){results[_0x3d1d('0x1f')](_0x1ace4a);})[_0x3d1d('0x5b')](function(_0x4d05cf){logger[_0x3d1d('0x57')](_0x4d05cf[_0x3d1d('0x22')]);});}function main(_0x474d6f,_0xc4e01f,_0x26c51e,_0x3ee563){logger['info'](_0x3d1d('0x5c'),_0x474d6f,JSON[_0x3d1d('0x5d')](_0xc4e01f));process['send'](_0x3d1d('0x5e'));var _0x12c60f=_0xc4e01f[_0x3d1d('0x5f')];var _0x18d525=_[_0x3d1d('0x60')](_0x12c60f);var _0x4c9a53=_0xc4e01f[_0x3d1d('0x61')];var _0x559232=path[_0x3d1d('0x15')](config[_0x3d1d('0x62')],_0x3d1d('0x63'),_0x4c9a53+_0x3d1d('0x64'));logger['info']('body',_0xc4e01f);db['ContactItemType'][_0x3d1d('0x65')]({'raw':!![],'attributes':['id','name']})[_0x3d1d('0x21')](function(_0x47f8df){for(var _0x29b37c=0x0;_0x29b37c<_0x47f8df[_0x3d1d('0x1c')];_0x29b37c++){if(_0x47f8df[_0x29b37c]['name']in _0x12c60f){contactItemTypes[_0x3d1d('0x1f')](_0x47f8df[_0x29b37c]);delete _0x18d525[_0x47f8df[_0x29b37c][_0x3d1d('0x66')]];hasAdditionalPhones=!![];}for(var _0x4ad51b in _0x12c60f){if(_0x47f8df[_0x29b37c][_0x3d1d('0x66')]+_0x3d1d('0x67')===_0x4ad51b){phoneDescriptions[_0x3d1d('0x1f')]({'itemTypeId':_0x47f8df[_0x29b37c]['id'],'description':_0x4ad51b});delete _0x18d525[_0x4ad51b];}}}if(hasAdditionalPhones)_0x18d525['AdditionalPhones']='';var _0x4e75e0=_[_0x3d1d('0x53')](_0x18d525)[_0x3d1d('0x15')]();logger['info']('header',_0x4e75e0);fs['writeFileSync'](_0x559232,_0x4e75e0+'\x0a');Papa['parse'](fs[_0x3d1d('0x68')](_0x474d6f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40d393,_0x5d8609){try{for(var _0x205c4a=0x0,_0x1ae110=[];_0x205c4a<_0x40d393[_0x3d1d('0x69')][_0x3d1d('0x1c')];_0x205c4a++){stats[_0x3d1d('0x6a')]+=0x1;if(_0x40d393[_0x3d1d('0x6b')][_0x205c4a]){handleError(_0x40d393[_0x3d1d('0x69')][_0x205c4a],_0x40d393['errors'][_0x205c4a]);}else{var _0x19fde5=[];var _0x1c064e=[];var _0x514685={};for(var _0x56b2f5 in _0x12c60f){let _0x531e23=contactItemTypes[_0x3d1d('0x6c')](_0x1099f9=>_0x1099f9[_0x3d1d('0x66')]===_0x56b2f5);let _0x1294f9=contactItemTypes[_0x3d1d('0x6c')](_0x2dbc56=>_0x2dbc56[_0x3d1d('0x66')]+'_description'===_0x56b2f5);if(_['isNil'](_0x531e23)&&_[_0x3d1d('0x1d')](_0x1294f9)){if(_0x12c60f[_0x3d1d('0x6d')](_0x56b2f5)){if(_0x40d393[_0x3d1d('0x69')][_0x205c4a][_0x12c60f[_0x56b2f5]]){var _0x50d9dc=_[_0x3d1d('0x6e')](_0x40d393['data'][_0x205c4a][_0x12c60f[_0x56b2f5]]['replace'](/"/g,'\x27'));switch(_0x56b2f5){case _0x3d1d('0x6f'):var _0x17d09f=moment(_0x50d9dc,_0x3d1d('0xd'),!![]);if(_0x17d09f[_0x3d1d('0x70')]()){_0x1ae110[_0x3d1d('0x1f')]('\x22'+_0x50d9dc+'\x22');}else{_0x19fde5['push'](_0x3d1d('0x71'));}break;case _0x3d1d('0x38'):var _0x47a0a0=parseInt(_0x50d9dc);_0x50d9dc=_[_0x3d1d('0x72')](_0x47a0a0)||_0x47a0a0<0x0||_0x47a0a0>0x4?_0x3ee563?0x3:0x2:_0x47a0a0;_0x1ae110['push']('\x22'+_0x50d9dc+'\x22');break;case'UserId':var _0x51fef0=parseInt(_0x50d9dc);if(_['isNumber'](_0x51fef0)&&_[_0x3d1d('0x73')](_0x26c51e,_0x51fef0)){_0x1ae110[_0x3d1d('0x1f')]('\x22'+_0x51fef0+'\x22');}else{_0x19fde5[_0x3d1d('0x1f')](_0x3d1d('0x74'));}break;case _0x3d1d('0x75'):if(isEmail(_0x50d9dc)){_0x1ae110[_0x3d1d('0x1f')]('\x22'+_0x50d9dc+'\x22');}else{_0x19fde5[_0x3d1d('0x1f')](_0x3d1d('0x76'));}break;case _0x3d1d('0x77'):var _0x31d9ab=moment(_0x50d9dc,'YYYY-MM-DD',!![]);if(_0x31d9ab[_0x3d1d('0x70')]()){_0x1ae110['push']('\x22'+_0x50d9dc+'\x22');}else{_0x19fde5[_0x3d1d('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x1ae110[_0x3d1d('0x1f')]('\x22'+_0x50d9dc+'\x22');}}else{switch(_0x56b2f5){case _0x3d1d('0x78'):case _0x3d1d('0x13'):_0x19fde5[_0x3d1d('0x1f')](_0x56b2f5+'\x20not\x20specified');break;default:_0x1ae110[_0x3d1d('0x1f')]('\x22\x22');}}}}else{var _0x121694='';if(!_['isNil'](_0x531e23)){if(!_0x514685[_0x3d1d('0x6d')](_0x531e23['id'])){for(var _0x28c220=0x0;_0x28c220<_0x12c60f[_0x56b2f5][_0x3d1d('0x1c')];_0x28c220++){var _0x50d9dc=_[_0x3d1d('0x6e')](_0x40d393[_0x3d1d('0x69')][_0x205c4a][_0x12c60f[_0x56b2f5][_0x28c220]][_0x3d1d('0x79')](/"/g,'\x27'));var _0x4e429b=phoneDescriptions[_0x3d1d('0x6c')](_0x2c4d94=>_0x2c4d94[_0x3d1d('0x7a')]===_0x531e23['id']);if(!_[_0x3d1d('0x1d')](_0x4e429b)){var _0x5cd169=_[_0x3d1d('0x6e')](_0x40d393[_0x3d1d('0x69')][_0x205c4a][_0x12c60f[_0x4e429b[_0x3d1d('0x7b')]][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x5cd169))_0x50d9dc=_0x50d9dc+'§'+_0x5cd169;}if(_0x121694=='')_0x121694=_0x50d9dc;else _0x121694+='|'+_0x50d9dc;}_0x1c064e[_0x3d1d('0x1f')](_0x531e23['id']+':'+_0x121694);_0x514685[_0x531e23['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1ae110['push']('\x22'+_0x1c064e['join'](';')+'\x22');}if(_0x19fde5[_0x3d1d('0x1c')]){handleError(_0x40d393[_0x3d1d('0x69')][_0x205c4a],{'code':'SystemRow','message':_0x19fde5[_0x3d1d('0x15')]()});}else{fs[_0x3d1d('0x7c')](_0x559232,_0x1ae110['join']()+'\x0a');}_0x1ae110=[];}if(!(stats[_0x3d1d('0x6a')]%0xc8)){socket[_0x3d1d('0x7d')](_0x3d1d('0x7e')+_0x4c9a53,stats);stats[_0x3d1d('0x6b')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x5d8609['abort']();}}catch(_0x46338d){handleError(_0x40d393[_0x3d1d('0x69')][_0x205c4a],{'code':_0x3d1d('0x7f'),'message':_0x46338d[_0x3d1d('0x22')]});logger[_0x3d1d('0x57')]('step',_0x46338d['message']);}},'complete':function(){try{var _0x4aac07=[];var _0x1692af=tempTableName;_0x4aac07[_0x3d1d('0x1f')](_0x3d1d('0x80')+_0x1692af+_0x3d1d('0x81'));logger[_0x3d1d('0x56')](_0x3d1d('0x82'),contactItemTypes['length']);var _0x13dfc0=util['format'](_0x3d1d('0x83'),_0x559232,_0x1692af,_0x4e75e0,_0xc4e01f[_0x3d1d('0x35')],_0xc4e01f['CompanyId']||null,NOW,NOW);if(_[_0x3d1d('0x1d')](_0x12c60f['scheduledat'])){_0x13dfc0+=_0x3d1d('0x84');}_0x4aac07['push'](_0x13dfc0);BPromise[_0x3d1d('0x85')](_0x4aac07,handleQuery)[_0x3d1d('0x21')](function(_0x2c39b4){BPromise['all']([handleAdditionalPhones()])[_0x3d1d('0x21')](function(){_0x4aac07=[];for(var _0x322989=0x0;_0x322989\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','all','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','from','tools_tags','user_has_','_interactions','u.id','u.fullname','left_join','users','length','ui.','\x20IN\x20?','map','getInteractionFK','interactions'];(function(_0x4066f7,_0x5d3125){var _0x340fdd=function(_0x5cc169){while(--_0x5cc169){_0x4066f7['push'](_0x4066f7['shift']());}};_0x340fdd(++_0x5d3125);}(_0x3635,0x8c));var _0x5363=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x3635[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x5363('0x0'));var squel=require('squel');var as=require(_0x5363('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x5363('0x2'))[_0x5363('0x3')];var utils=require(_0x5363('0x4'));var db=require(_0x5363('0x5'))['db'];function skipInteractionsQuery(_0x3e5a22,_0x426da3,_0x274ef4){var _0x5eeff9=![];var _0x5e50c4=utils[_0x5363('0x6')](_0x3e5a22);if(_0x426da3[_0x5363('0x7')]===_0x5363('0x8')&&!_0x274ef4[_0x5363('0x9')]&&!_0x274ef4[_0x5e50c4]){_0x5eeff9=!![];}return _0x5eeff9;}function getTagsQuery(){return squel[_0x5363('0xa')]()['field']('id')['field']('name')[_0x5363('0xb')]('color')[_0x5363('0xc')](_0x5363('0xd'));}function getUsersQuery(_0x2368aa,_0x21c3cc){var _0x1f5180=utils['getInteractionFK'](_0x2368aa);var _0x2010c1=_0x5363('0xe')+_0x2368aa+_0x5363('0xf');var _0x364eeb=squel[_0x5363('0xa')]()[_0x5363('0xb')](_0x5363('0x10'))['field'](_0x5363('0x11'))[_0x5363('0xb')]('ui.'+_0x1f5180)[_0x5363('0xc')](_0x2010c1,'ui')[_0x5363('0x12')](_0x5363('0x13'),'u','u.id\x20=\x20ui.UserId');if(_0x21c3cc[_0x5363('0x14')]>0x0){_0x364eeb['where'](_0x5363('0x15')+_0x1f5180+_0x5363('0x16'),_[_0x5363('0x17')](_0x21c3cc,'id'));}return _0x364eeb;}function getInteractionsQuery(_0x1bf81f){var _0x36a594=utils['getInteractionsTables'](_0x1bf81f);var _0x4d4e3f=utils['getAccountFK'](_0x1bf81f);var _0x22b1d3=utils[_0x5363('0x18')](_0x1bf81f);return squel[_0x5363('0xa')]()[_0x5363('0xc')](_0x36a594[_0x5363('0x19')],'i')['left_join'](_0x5363('0x1a'),'c',_0x5363('0x1b'))[_0x5363('0x12')](_0x5363('0x13'),'o','o.id\x20=\x20i.UserId')[_0x5363('0x12')](_0x36a594[_0x5363('0x1c')],'a','a.id\x20=\x20i.'+_0x4d4e3f)[_0x5363('0x12')](_0x36a594[_0x5363('0x1d')],'me',_0x5363('0x1e')+_0x22b1d3+'\x20=\x20i.id')[_0x5363('0x12')](_0x36a594['interactionsTags'],'it',_0x5363('0x1f')+_0x22b1d3+_0x5363('0x20'))[_0x5363('0x12')](_0x5363('0xd'),'t',_0x5363('0x21'));}function getSqlClauses(){var _0x74bbab={'body':squel[_0x5363('0x22')](),'contact':squel[_0x5363('0x22')](),'default':squel[_0x5363('0x22')](),'fields':squel[_0x5363('0x22')](),'filter':squel[_0x5363('0x22')](),'read':squel[_0x5363('0x22')](),'tags':{'clause':squel[_0x5363('0x22')](),'ids':null},'user':squel[_0x5363('0x22')]()};return _0x74bbab;}function parseTagParameter(_0x13c8dd){var _0x1dd3ae=squel[_0x5363('0x22')]();if(_0x13c8dd){var _0x49d322=utils[_0x5363('0x23')](_0x13c8dd);_0x49d322[_0x5363('0x24')](function(_0x35c821){_0x1dd3ae['or'](_0x5363('0x25'),'%,'+_0x35c821+',%');});}return _0x1dd3ae;}function parseReadParameter(_0x1fb91e){var _0x5b12c7='';if(_0x1fb91e){_0x5b12c7=_0x5363('0x26');if(_0x1fb91e==='1'){_0x5b12c7=_0x5b12c7['replace'](_0x5363('0x27'),'=');}else{_0x5b12c7=_0x5b12c7[_0x5363('0x28')](_0x5363('0x27'),'>');}}return _0x5b12c7;}function parseSearchFilter(_0x115dcc,_0x224478){var _0x21e890=squel['expr']();if(_0x224478){var _0x1449fd=_0x224478['replace']('\x5c','\x5c\x5c')[_0x5363('0x28')](/'/g,'\x27\x27');if(qs[_0x5363('0x29')](_0x1449fd)){_0x21e890['or'](_0x5363('0x2a'),_0x1449fd+'%');if([_0x5363('0x2b'),_0x5363('0x2c')][_0x5363('0x2d')](_0x115dcc)){_0x21e890['or'](_0x5363('0x2e'),_0x1449fd+'%');}else if(_0x115dcc===_0x5363('0x2f')){_0x21e890['or'](_0x5363('0x30'),_0x1449fd+'%');}else if(_0x115dcc===_0x5363('0x31')){_0x21e890['or'](_0x5363('0x32'),_0x1449fd+'%');}}else if(_0x115dcc===_0x5363('0x33')&&qs[_0x5363('0x34')](_0x1449fd)){_0x21e890['or'](_0x5363('0x35'),_0x1449fd+'%');}else{if(_0x115dcc===_0x5363('0x33')){_0x21e890['or'](_0x5363('0x36'),qs['getFullTextValue'](_0x1449fd,!![]))['or'](_0x5363('0x37'),qs[_0x5363('0x38')](_0x1449fd));}else if(_0x115dcc!==_0x5363('0x2f')){_0x21e890['or'](_0x5363('0x39'),qs['getFullTextValue'](_0x1449fd));}_0x21e890['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5363('0x38')](_0x1449fd,!![]),null);}}return _0x21e890;}function parseAdvancedSearchFilter(_0x3d7034,_0x98abe4){var _0x2d8c5c=getSqlClauses();var _0x3d2d83=as['parseSearch'](_0x3d7034);var _0x23ea33=_0x3d2d83[_0x5363('0x3a')];for(var _0x4eb0fb=0x0;_0x4eb0fb<_0x3d2d83[_0x5363('0x3b')][_0x5363('0x14')];_0x4eb0fb++){var _0x467a8f=_0x3d2d83[_0x5363('0x3b')][_0x4eb0fb];var _0x54e2a0='i';var _0x1a5a1e=_[_0x5363('0x3c')](_0x98abe4,[_0x5363('0x3d'),_0x467a8f['field']]);if(_0x1a5a1e){var _0x37c0d3=as['buildExpression'](_0x54e2a0,_0x1a5a1e[_0x5363('0x3e')],_0x467a8f);_0x2d8c5c[_0x5363('0x3f')][_0x23ea33](_0x37c0d3[_0x5363('0x40')],_0x37c0d3[_0x5363('0x41')]['start'],_0x37c0d3[_0x5363('0x41')][_0x5363('0x42')]);}else{switch(_0x467a8f['field']){case _0x5363('0x43'):var _0x339699=parseReadParameter(_0x467a8f['value']);_0x2d8c5c['read'][_0x5363('0x44')](_0x339699);break;case'Contact':if(_0x467a8f[_0x5363('0x45')]===_0x5363('0x46')){if(_0x467a8f['value']['split']('\x20')[_0x5363('0x14')]>0x1){_0x2d8c5c[_0x5363('0x47')][_0x23ea33](_0x5363('0x48'),qs[_0x5363('0x38')](_0x467a8f[_0x5363('0x41')],!![]),null);}else{var _0x405d68='%'+_0x467a8f[_0x5363('0x41')]+'%';_0x2d8c5c['contact'][_0x23ea33](_0x5363('0x49'),_0x405d68,_0x405d68,_0x405d68);}}else{_0x1a5a1e=_[_0x5363('0x3c')](_0x98abe4,[_0x5363('0x3d'),_0x5363('0x4a')]);_0x467a8f['field']=_0x5363('0x4a');_0x37c0d3=as[_0x5363('0x4b')](_0x54e2a0,_0x1a5a1e[_0x5363('0x3e')],_0x467a8f);_0x2d8c5c[_0x5363('0x47')][_0x23ea33](_0x37c0d3[_0x5363('0x40')],_0x37c0d3[_0x5363('0x41')][_0x5363('0x4c')],_0x37c0d3[_0x5363('0x41')][_0x5363('0x42')]);}break;case _0x5363('0x4d'):var _0x515e55=_0x467a8f['value']['split'](',')[_0x5363('0x17')](function(_0x15c2df){return Number(_0x15c2df);});var _0x5d667e=parseTagParameter(_0x515e55);_0x2d8c5c[_0x5363('0x4e')][_0x5363('0x4f')]['and'](_0x5d667e);_0x2d8c5c[_0x5363('0x4e')][_0x5363('0x50')]=_0x515e55;break;case _0x5363('0x51'):if(_0x467a8f[_0x5363('0x45')]===_0x5363('0x46')){_0x2d8c5c['user'][_0x23ea33](_0x5363('0x52'),'%'+_0x467a8f[_0x5363('0x41')]+'%',null);}else{_0x1a5a1e=_[_0x5363('0x3c')](_0x98abe4,[_0x5363('0x3d'),_0x5363('0x53')]);_0x467a8f[_0x5363('0xb')]='UserId';_0x37c0d3=as[_0x5363('0x4b')](_0x54e2a0,_0x1a5a1e[_0x5363('0x3e')],_0x467a8f);_0x2d8c5c['user'][_0x23ea33](_0x37c0d3['text'],_0x37c0d3[_0x5363('0x41')][_0x5363('0x4c')],_0x37c0d3['value'][_0x5363('0x42')]);}break;case'body':case'plainBody':_0x37c0d3=as['buildExpression']('me',null,_0x467a8f);_0x2d8c5c['body'][_0x23ea33](_0x37c0d3['text'],_0x37c0d3['value'][_0x5363('0x4c')],_0x37c0d3['value'][_0x5363('0x42')]);break;}}}return _0x2d8c5c;}function parseModelFields(_0x205ac9,_0x4874e8,_0x1a76be){var _0x1ce63a=utils[_0x5363('0x6')](_0x205ac9);var _0x3622d0=squel[_0x5363('0x22')]();var _0x1456e5=_(_0x4874e8)[_0x5363('0x54')]()['map'](function(_0x459f63){return _[_0x5363('0x55')](_0x1a76be,[_0x5363('0x3d'),_0x459f63])?_0x459f63:undefined;})[_0x5363('0x56')]()[_0x5363('0x41')]();if(_0x1456e5[_0x5363('0x14')]>0x0){_0x1456e5[_0x5363('0x24')](function(_0x1fd085){if(_0x1fd085===_0x1ce63a){_0x3622d0[_0x5363('0x44')]('i.'+_0x1ce63a+_0x5363('0x16'),[][_0x5363('0x57')](_0x4874e8[_0x1fd085]));}else if(_0x1fd085==='createdAt'){var _0x561df1=JSON['parse'](_0x4874e8[_0x1fd085])[_0x5363('0x58')];var _0x553b15=JSON['parse'](_0x4874e8[_0x1fd085])[_0x5363('0x59')];_0x3622d0[_0x5363('0x44')](_0x5363('0x5a'),_0x561df1,_0x553b15);}else{if(_0x4874e8[_0x1fd085]==='null'){_0x3622d0[_0x5363('0x44')]('i.'+_0x1fd085+_0x5363('0x5b'));}else{_0x3622d0[_0x5363('0x44')]('i.'+_0x1fd085+_0x5363('0x5c'),_0x4874e8[_0x1fd085]);}}});}return _0x3622d0;}function parseQueryParameters(_0x1f8343,_0x2cf906,_0xdd068){var _0x524dc8=getSqlClauses();return Promise[_0x5363('0x5d')]()[_0x5363('0x5e')](function(){return parseModelFields(_0x1f8343,_0x2cf906,_0xdd068);})['then'](function(_0x2ff0b0){_0x524dc8['fields'][_0x5363('0x44')](_0x2ff0b0);return parseReadParameter(_0x2cf906[_0x5363('0x5f')]);})[_0x5363('0x5e')](function(_0x588569){_0x524dc8[_0x5363('0x5f')]['and'](_0x588569);return parseTagParameter(_0x2cf906[_0x5363('0x60')]);})[_0x5363('0x5e')](function(_0xc94ae4){_0x524dc8[_0x5363('0x4e')][_0x5363('0x4f')][_0x5363('0x44')](_0xc94ae4);return parseSearchFilter(_0x1f8343,_0x2cf906[_0x5363('0x61')]);})[_0x5363('0x5e')](function(_0x25f499){_0x524dc8[_0x5363('0x61')]=_0x25f499;return _0x524dc8;});}function checkAccountsRestrictions(_0x1ac73f,_0x82a26d,_0x6be46e){var _0x2ebbee=utils['getAccountFK'](_0x1ac73f);var _0x1c1a25=_0x5363('0x62')+_[_0x5363('0x63')](_0x1ac73f)+(_0x1ac73f===_0x5363('0x64')?_0x5363('0x65'):_0x5363('0x66'));var _0x486187=squel[_0x5363('0x22')]();return Promise[_0x5363('0x5d')]()[_0x5363('0x5e')](function(){if(_0x6be46e[_0x5363('0x9')]&&_0x82a26d[_0x5363('0x7')]===_0x5363('0x8')){return _0x82a26d[_0x1c1a25]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2c7f01){if(_0x2c7f01){if(_0x2c7f01[_0x5363('0x14')]===0x0){_0x486187['and']('i.'+_0x2ebbee+_0x5363('0x5b'));}else{_0x486187['and']('i.'+_0x2ebbee+_0x5363('0x16'),_['map'](_0x2c7f01,'id'));}}else if(!_0x6be46e[_0x2ebbee]){_0x486187[_0x5363('0x44')]('i.'+_0x2ebbee+_0x5363('0x67'));}})[_0x5363('0x5e')](function(){return _0x486187;});}function getClosedOrderClause(_0x3a6995,_0x56f21e){var _0x4edf84='';var _0x5bff34=['i.thirdDisposition',_0x5363('0x68'),_0x5363('0x69')];if(_0x3a6995==='mail'){_0x5bff34[_0x5363('0x6a')]('i.substatus');}if(_0x56f21e[_0x5363('0x6b')]==='0'&&_0x3a6995==='mail'){_0x4edf84=_0x5363('0x6c');}else{if(_0x56f21e[_0x5363('0x6b')]==='1'){_0x5bff34['shift']();}_0x4edf84=_0x5363('0x6d')+_0x5bff34[_0x5363('0x6e')](',\x20')+')';}return _0x4edf84;}function getFilteredInteractions(_0x2ca878,_0x10d35a,_0xc1f5e8,_0x362f20){var _0x3db8d0=utils[_0x5363('0x18')](_0x2ca878);var _0x3c6ac7=_[_0x5363('0x63')](_0x2ca878)+_0x5363('0x6f');var _0x28896c=[];var _0x16047b=getTagsQuery();var _0x2e78db={'type':db[_0x5363('0x70')][_0x5363('0x71')][_0x5363('0x72')],'raw':!![]};var _0xa19ca7=[];var _0x512b08=[];return db[_0x5363('0x73')][_0x5363('0x74')](_0x16047b[_0x5363('0x75')](),_0x2e78db)[_0x5363('0x5e')](function(_0x201c03){_0x28896c=_[_0x5363('0x76')](_0x201c03,'id');_0x2e78db=_[_0x5363('0x77')](_0x2e78db,{'model':db[_0x3c6ac7],'mapToModel':!![],'nest':!![]});if(_0xc1f5e8['fields']){_0x362f20[_0x5363('0x78')][_0x5363('0x24')](function(_0x558a6c){_0x10d35a['field']('i.'+_0x558a6c);});}else{_0x10d35a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5363('0x43'));_0x10d35a[_0x5363('0xb')](_0x5363('0x79'),'Account.key');_0x10d35a[_0x5363('0xb')](_0x5363('0x7a'),_0x5363('0x7b'));if(_0x2ca878===_0x5363('0x33')){_0x10d35a[_0x5363('0xb')](_0x5363('0x7c'),'Account.email');_0x10d35a['field'](_0x5363('0x7d'),_0x5363('0x7e'));_0x10d35a[_0x5363('0xb')](_0x5363('0x7f'));_0x10d35a[_0x5363('0xb')](_0x5363('0x80'));_0x10d35a[_0x5363('0xb')](_0x5363('0x81'));_0x10d35a[_0x5363('0xb')](_0x5363('0x82'));_0x10d35a['field'](_0x5363('0x83'));_0x10d35a[_0x5363('0xb')]('i.attach');_0x10d35a[_0x5363('0xb')]('i.lastMsgAt');_0x10d35a['field'](_0x5363('0x84'));_0x10d35a['field']('i.subject');_0x10d35a[_0x5363('0xb')](_0x5363('0x69'));_0x10d35a[_0x5363('0xb')]('i.secondDisposition');_0x10d35a[_0x5363('0xb')](_0x5363('0x85'));_0x10d35a[_0x5363('0xb')]('i.substatus');_0x10d35a['field'](_0x5363('0x86'));_0x10d35a['field'](_0x5363('0x87'));_0x10d35a[_0x5363('0xb')](_0x5363('0x88'));_0x10d35a['field']('i.UserId');}else if(_0x2ca878===_0x5363('0x31')){_0x10d35a[_0x5363('0xb')](_0x5363('0x89'),_0x5363('0x7e'));}else{_0x10d35a[_0x5363('0xb')](_0x5363('0x8a'),_0x5363('0x7e'));}if(_0x2ca878!==_0x5363('0x33')){_0x10d35a[_0x5363('0xb')](_0x5363('0x8b'));}_0x10d35a['field'](_0x5363('0x8c'),_0x5363('0x8d'));_0x10d35a['field'](_0x5363('0x8e'),_0x5363('0x8f'));_0x10d35a[_0x5363('0xb')](_0x5363('0x90'),_0x5363('0x91'));_0x10d35a[_0x5363('0xb')]('c.phone','Contact.phone');_0x10d35a[_0x5363('0xb')](_0x5363('0x92'),_0x5363('0x93'));_0x10d35a[_0x5363('0xb')]('c.fax',_0x5363('0x94'));_0x10d35a[_0x5363('0xb')](_0x5363('0x95'),_0x5363('0x96'));_0x10d35a[_0x5363('0xb')](_0x5363('0x97'),_0x5363('0x98'));_0x10d35a[_0x5363('0xb')](_0x5363('0x99'),_0x5363('0x9a'));}if(_0x362f20[_0x5363('0x9b')]){_0x10d35a['limit'](_0x362f20[_0x5363('0x9b')]);}if(_0x362f20[_0x5363('0x9c')]){_0x10d35a[_0x5363('0x9c')](_0x362f20[_0x5363('0x9c')]);}return db['sequelize'][_0x5363('0x74')](_0x10d35a[_0x5363('0x75')](),_0x2e78db);})[_0x5363('0x5e')](function(_0x4d0921){_0xa19ca7=_0x4d0921;var _0x5a340b=getUsersQuery(_0x2ca878,_0xa19ca7);return db[_0x5363('0x73')][_0x5363('0x74')](_0x5a340b[_0x5363('0x75')](),_0x2e78db);})[_0x5363('0x5e')](function(_0x110a5e){_0x512b08=_[_0x5363('0x9d')](_0x110a5e,_0x3db8d0);if(_0x2ca878===_0x5363('0x33')){return db[_0x5363('0x9e')]['findOne']({'attributes':[_0x5363('0x9f')],'raw':!![]});}})['then'](function(_0x261250){var _0x34ddc0=_0x261250?_0x261250[_0x5363('0x9f')]:undefined;var _0x1b6a07=_0xa19ca7[_0x5363('0x17')](function(_0x51540c){return updateInteraction(_0x51540c,_0x28896c,_0x512b08,_0x34ddc0);});return Promise[_0x5363('0xa0')](_0x1b6a07);});}function countFilteredInteractions(_0x3156f9,_0x1ff00b){var _0x3e4b41=_0x3156f9['clone']();_0x3e4b41[_0x5363('0xb')](_0x5363('0xa1'));_0x3e4b41[_0x5363('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5363('0x43'));var _0x415e81=utils[_0x5363('0x23')](_0x1ff00b);if(!_[_0x5363('0xa2')](_0x415e81)){_0x3e4b41[_0x5363('0xa3')](_0x5363('0xa4'),_0x415e81);}var _0x5402c8={'type':db[_0x5363('0x70')]['QueryTypes'][_0x5363('0x72')],'raw':!![]};return db['sequelize'][_0x5363('0x74')](_0x3e4b41['toString'](),_0x5402c8);}module[_0x5363('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x4907=['CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','findOne','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','left_join','u.id\x20=\x20ui.UserId','length','where','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','accounts','messages','me.','\x20=\x20i.id','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','buildExpression','type','value','end','unreadMessages','read','and','Contact','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','contact','text','Tag','map','tags','User','$substring','user','UserId','start','body','keys','compact','\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','resolve','then','clause','filter','Websites','agent','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','i.substatus','join','capitalize','Sequelize','QueryTypes','sequelize','query','toString','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.thirdDisposition','i.MailAccountId','i.UserId'];(function(_0x5093bc,_0x49b180){var _0x31f82d=function(_0x1bad21){while(--_0x1bad21){_0x5093bc['push'](_0x5093bc['shift']());}};_0x31f82d(++_0x49b180);}(_0x4907,0x14f));var _0x7490=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4907[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7490('0x0'));var squel=require(_0x7490('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x7490('0x2'));var updateInteraction=require(_0x7490('0x3'))[_0x7490('0x4')];var utils=require(_0x7490('0x5'));var db=require(_0x7490('0x6'))['db'];function skipInteractionsQuery(_0x27cba5,_0x2293ba,_0x21527e){var _0x3d4b42=![];var _0x4f0fe2=utils[_0x7490('0x7')](_0x27cba5);if(_0x2293ba[_0x7490('0x8')]==='agent'&&!_0x21527e[_0x7490('0x9')]&&!_0x21527e[_0x4f0fe2]){_0x3d4b42=!![];}return _0x3d4b42;}function getTagsQuery(){return squel[_0x7490('0xa')]()[_0x7490('0xb')]('id')[_0x7490('0xb')](_0x7490('0xc'))['field'](_0x7490('0xd'))[_0x7490('0xe')](_0x7490('0xf'));}function getUsersQuery(_0x226de7,_0x4e26a7){var _0x4c0e20=utils[_0x7490('0x10')](_0x226de7);var _0x51aa4d='user_has_'+_0x226de7+_0x7490('0x11');var _0x4ee49e=squel['select']()[_0x7490('0xb')](_0x7490('0x12'))[_0x7490('0xb')](_0x7490('0x13'))[_0x7490('0xb')]('ui.'+_0x4c0e20)[_0x7490('0xe')](_0x51aa4d,'ui')[_0x7490('0x14')]('users','u',_0x7490('0x15'));if(_0x4e26a7[_0x7490('0x16')]>0x0){_0x4ee49e[_0x7490('0x17')]('ui.'+_0x4c0e20+'\x20IN\x20?',_['map'](_0x4e26a7,'id'));}return _0x4ee49e;}function getInteractionsQuery(_0x3dc581){var _0x3d36ea=utils[_0x7490('0x18')](_0x3dc581);var _0x508c16=utils[_0x7490('0x7')](_0x3dc581);var _0xbbfc91=utils['getInteractionFK'](_0x3dc581);return squel[_0x7490('0xa')]()['from'](_0x3d36ea[_0x7490('0x19')],'i')['left_join'](_0x7490('0x1a'),'c',_0x7490('0x1b'))[_0x7490('0x14')](_0x7490('0x1c'),'o',_0x7490('0x1d'))[_0x7490('0x14')](_0x3d36ea[_0x7490('0x1e')],'a','a.id\x20=\x20i.'+_0x508c16)[_0x7490('0x14')](_0x3d36ea[_0x7490('0x1f')],'me',_0x7490('0x20')+_0xbbfc91+_0x7490('0x21'))[_0x7490('0x14')](_0x3d36ea['interactionsTags'],'it','it.'+_0xbbfc91+'\x20=\x20i.id')[_0x7490('0x14')](_0x7490('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x59fe9a={'body':squel[_0x7490('0x22')](),'contact':squel['expr'](),'default':squel[_0x7490('0x22')](),'fields':squel[_0x7490('0x22')](),'filter':squel[_0x7490('0x22')](),'read':squel[_0x7490('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x59fe9a;}function parseTagParameter(_0x51e1a7){var _0x496c94=squel['expr']();if(_0x51e1a7){var _0x1b2d38=utils[_0x7490('0x23')](_0x51e1a7);_0x1b2d38[_0x7490('0x24')](function(_0x157cdc){_0x496c94['or'](_0x7490('0x25'),'%,'+_0x157cdc+',%');});}return _0x496c94;}function parseReadParameter(_0x373c28){var _0x3d1631='';if(_0x373c28){_0x3d1631=_0x7490('0x26');if(_0x373c28==='1'){_0x3d1631=_0x3d1631[_0x7490('0x27')](_0x7490('0x28'),'=');}else{_0x3d1631=_0x3d1631[_0x7490('0x27')](_0x7490('0x28'),'>');}}return _0x3d1631;}function parseSearchFilter(_0x492615,_0x399d42){var _0x4cf845=squel[_0x7490('0x22')]();if(_0x399d42){var _0x1a258c=_0x399d42[_0x7490('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7490('0x29')](_0x1a258c)){_0x4cf845['or']('i.id\x20LIKE\x20?',_0x1a258c+'%');if([_0x7490('0x2a'),'whatsapp']['includes'](_0x492615)){_0x4cf845['or'](_0x7490('0x2b'),_0x1a258c+'%');}else if(_0x492615===_0x7490('0x2c')){_0x4cf845['or'](_0x7490('0x2d'),_0x1a258c+'%');}else if(_0x492615===_0x7490('0x2e')){_0x4cf845['or']('i.from\x20LIKE\x20?',_0x1a258c+'%');}}else if(_0x492615===_0x7490('0x2f')&&qs[_0x7490('0x30')](_0x1a258c)){_0x4cf845['or'](_0x7490('0x31'),_0x1a258c+'%');}else{if(_0x492615===_0x7490('0x2f')){_0x4cf845['or'](_0x7490('0x32'),qs[_0x7490('0x33')](_0x1a258c,!![]))['or'](_0x7490('0x34'),qs['getFullTextValue'](_0x1a258c));}else if(_0x492615!=='fax'){_0x4cf845['or'](_0x7490('0x35'),qs[_0x7490('0x33')](_0x1a258c));}_0x4cf845['or'](_0x7490('0x36'),qs[_0x7490('0x33')](_0x1a258c,!![]),null);}}return _0x4cf845;}function parseAdvancedSearchFilter(_0x4dcc4,_0x50d1b3){var _0x4f44ad=getSqlClauses();var _0x5b25da=as[_0x7490('0x37')](_0x4dcc4);var _0x1e28f3=_0x5b25da['sqlOperator'];for(var _0x404011=0x0;_0x404011<_0x5b25da[_0x7490('0x38')]['length'];_0x404011++){var _0x262828=_0x5b25da[_0x7490('0x38')][_0x404011];var _0x132266='i';var _0x43d9b9=_['find'](_0x50d1b3,[_0x7490('0xc'),_0x262828[_0x7490('0xb')]]);if(_0x43d9b9){var _0x13cf14=as[_0x7490('0x39')](_0x132266,_0x43d9b9[_0x7490('0x3a')],_0x262828);_0x4f44ad['default'][_0x1e28f3](_0x13cf14['text'],_0x13cf14['value']['start'],_0x13cf14[_0x7490('0x3b')][_0x7490('0x3c')]);}else{switch(_0x262828[_0x7490('0xb')]){case _0x7490('0x3d'):var _0x5dfeb2=parseReadParameter(_0x262828[_0x7490('0x3b')]);_0x4f44ad[_0x7490('0x3e')][_0x7490('0x3f')](_0x5dfeb2);break;case _0x7490('0x40'):if(_0x262828[_0x7490('0x41')]==='$substring'){if(_0x262828[_0x7490('0x3b')]['split']('\x20')[_0x7490('0x16')]>0x1){_0x4f44ad['contact'][_0x1e28f3](_0x7490('0x36'),qs[_0x7490('0x33')](_0x262828[_0x7490('0x3b')],!![]),null);}else{var _0xfb8c26='%'+_0x262828[_0x7490('0x3b')]+'%';_0x4f44ad['contact'][_0x1e28f3](_0x7490('0x42'),_0xfb8c26,_0xfb8c26,_0xfb8c26);}}else{_0x43d9b9=_[_0x7490('0x43')](_0x50d1b3,['name','ContactId']);_0x262828['field']=_0x7490('0x44');_0x13cf14=as['buildExpression'](_0x132266,_0x43d9b9['type'],_0x262828);_0x4f44ad[_0x7490('0x45')][_0x1e28f3](_0x13cf14[_0x7490('0x46')],_0x13cf14[_0x7490('0x3b')]['start'],_0x13cf14[_0x7490('0x3b')][_0x7490('0x3c')]);}break;case _0x7490('0x47'):var _0x9741d8=_0x262828[_0x7490('0x3b')]['split'](',')[_0x7490('0x48')](function(_0x513ea4){return Number(_0x513ea4);});var _0x56814d=parseTagParameter(_0x9741d8);_0x4f44ad['tags']['clause'][_0x7490('0x3f')](_0x56814d);_0x4f44ad[_0x7490('0x49')]['ids']=_0x9741d8;break;case _0x7490('0x4a'):if(_0x262828[_0x7490('0x41')]===_0x7490('0x4b')){_0x4f44ad[_0x7490('0x4c')][_0x1e28f3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x262828[_0x7490('0x3b')]+'%',null);}else{_0x43d9b9=_[_0x7490('0x43')](_0x50d1b3,[_0x7490('0xc'),'UserId']);_0x262828['field']=_0x7490('0x4d');_0x13cf14=as[_0x7490('0x39')](_0x132266,_0x43d9b9[_0x7490('0x3a')],_0x262828);_0x4f44ad[_0x7490('0x4c')][_0x1e28f3](_0x13cf14[_0x7490('0x46')],_0x13cf14['value'][_0x7490('0x4e')],_0x13cf14['value'][_0x7490('0x3c')]);}break;case _0x7490('0x4f'):case'plainBody':_0x13cf14=as['buildExpression']('me',null,_0x262828);_0x4f44ad[_0x7490('0x4f')][_0x1e28f3](_0x13cf14[_0x7490('0x46')],_0x13cf14[_0x7490('0x3b')][_0x7490('0x4e')],_0x13cf14[_0x7490('0x3b')]['end']);break;}}}return _0x4f44ad;}function parseModelFields(_0x1b4d36,_0x43853c,_0x4471b5){var _0x18c747=utils[_0x7490('0x7')](_0x1b4d36);var _0x7d0341=squel[_0x7490('0x22')]();var _0x3904ea=_(_0x43853c)[_0x7490('0x50')]()[_0x7490('0x48')](function(_0x24c248){return _['some'](_0x4471b5,[_0x7490('0xc'),_0x24c248])?_0x24c248:undefined;})[_0x7490('0x51')]()[_0x7490('0x3b')]();if(_0x3904ea[_0x7490('0x16')]>0x0){_0x3904ea['forEach'](function(_0x477244){if(_0x477244===_0x18c747){_0x7d0341[_0x7490('0x3f')]('i.'+_0x18c747+_0x7490('0x52'),[]['concat'](_0x43853c[_0x477244]));}else if(_0x477244===_0x7490('0x53')){var _0x2f8bb4=JSON[_0x7490('0x54')](_0x43853c[_0x477244])['$gte'];var _0x32880e=JSON[_0x7490('0x54')](_0x43853c[_0x477244])[_0x7490('0x55')];_0x7d0341[_0x7490('0x3f')](_0x7490('0x56'),_0x2f8bb4,_0x32880e);}else{if(_0x43853c[_0x477244]==='null'){_0x7d0341['and']('i.'+_0x477244+'\x20IS\x20NULL');}else{_0x7d0341[_0x7490('0x3f')]('i.'+_0x477244+_0x7490('0x57'),_0x43853c[_0x477244]);}}});}return _0x7d0341;}function parseQueryParameters(_0x1a2a17,_0x39f3cc,_0xbf2c65){var _0x331376=getSqlClauses();return Promise[_0x7490('0x58')]()[_0x7490('0x59')](function(){return parseModelFields(_0x1a2a17,_0x39f3cc,_0xbf2c65);})[_0x7490('0x59')](function(_0x5b10ad){_0x331376['fields'][_0x7490('0x3f')](_0x5b10ad);return parseReadParameter(_0x39f3cc[_0x7490('0x3e')]);})[_0x7490('0x59')](function(_0x4e9ade){_0x331376[_0x7490('0x3e')]['and'](_0x4e9ade);return parseTagParameter(_0x39f3cc['tag']);})[_0x7490('0x59')](function(_0x44e624){_0x331376[_0x7490('0x49')][_0x7490('0x5a')][_0x7490('0x3f')](_0x44e624);return parseSearchFilter(_0x1a2a17,_0x39f3cc[_0x7490('0x5b')]);})[_0x7490('0x59')](function(_0x49a1c5){_0x331376['filter']=_0x49a1c5;return _0x331376;});}function checkAccountsRestrictions(_0x3de535,_0x192f8b,_0x8aed9){var _0x3f313d=utils[_0x7490('0x7')](_0x3de535);var _0x423b63='get'+_['capitalize'](_0x3de535)+(_0x3de535==='chat'?_0x7490('0x5c'):'Accounts');var _0x1d8164=squel[_0x7490('0x22')]();return Promise[_0x7490('0x58')]()[_0x7490('0x59')](function(){if(_0x8aed9[_0x7490('0x9')]&&_0x192f8b[_0x7490('0x8')]===_0x7490('0x5d')){return _0x192f8b[_0x423b63]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4baf42){if(_0x4baf42){if(_0x4baf42[_0x7490('0x16')]===0x0){_0x1d8164['and']('i.'+_0x3f313d+_0x7490('0x5e'));}else{_0x1d8164['and']('i.'+_0x3f313d+_0x7490('0x52'),_[_0x7490('0x48')](_0x4baf42,'id'));}}else if(!_0x8aed9[_0x3f313d]){_0x1d8164[_0x7490('0x3f')]('i.'+_0x3f313d+_0x7490('0x5f'));}})[_0x7490('0x59')](function(){return _0x1d8164;});}function getClosedOrderClause(_0x44cbd7,_0x14c9fc){var _0xd3a005='';var _0x130f82=['i.thirdDisposition',_0x7490('0x60'),_0x7490('0x61')];if(_0x44cbd7===_0x7490('0x2f')){_0x130f82['unshift'](_0x7490('0x62'));}if(_0x14c9fc['closed']==='0'&&_0x44cbd7===_0x7490('0x2f')){_0xd3a005=_0x7490('0x62');}else{if(_0x14c9fc['closed']==='1'){_0x130f82['shift']();}_0xd3a005='CONCAT_WS(\x27\x27,\x20'+_0x130f82[_0x7490('0x63')](',\x20')+')';}return _0xd3a005;}function getFilteredInteractions(_0x5bfb54,_0x3c6573,_0x252789,_0xc0f26b){var _0x1ffdd0=utils['getInteractionFK'](_0x5bfb54);var _0x4bc55b=_[_0x7490('0x64')](_0x5bfb54)+'Interaction';var _0x120539=[];var _0x12d131=getTagsQuery();var _0x2c094d={'type':db[_0x7490('0x65')][_0x7490('0x66')]['SELECT'],'raw':!![]};var _0x237fab=[];var _0x347472=[];return db[_0x7490('0x67')][_0x7490('0x68')](_0x12d131[_0x7490('0x69')](),_0x2c094d)['then'](function(_0x5a1ef1){_0x120539=_[_0x7490('0x6a')](_0x5a1ef1,'id');_0x2c094d=_[_0x7490('0x6b')](_0x2c094d,{'model':db[_0x4bc55b],'mapToModel':!![],'nest':!![]});if(_0x252789[_0x7490('0x6c')]){_0xc0f26b['attributes'][_0x7490('0x24')](function(_0x4b991c){_0x3c6573[_0x7490('0xb')]('i.'+_0x4b991c);});}else{_0x3c6573[_0x7490('0xb')](_0x7490('0x6d'),'unreadMessages');_0x3c6573[_0x7490('0xb')](_0x7490('0x6e'),_0x7490('0x6f'));_0x3c6573[_0x7490('0xb')](_0x7490('0x70'),_0x7490('0x71'));if(_0x5bfb54===_0x7490('0x2f')){_0x3c6573[_0x7490('0xb')]('a.email',_0x7490('0x72'));_0x3c6573[_0x7490('0xb')](_0x7490('0x73'),'contactName');_0x3c6573[_0x7490('0xb')]('i.id');_0x3c6573[_0x7490('0xb')](_0x7490('0x74'));_0x3c6573['field'](_0x7490('0x75'));_0x3c6573[_0x7490('0xb')](_0x7490('0x76'));_0x3c6573[_0x7490('0xb')](_0x7490('0x77'));_0x3c6573[_0x7490('0xb')]('i.attach');_0x3c6573[_0x7490('0xb')](_0x7490('0x78'));_0x3c6573[_0x7490('0xb')]('i.lastMsgDirection');_0x3c6573[_0x7490('0xb')]('i.subject');_0x3c6573[_0x7490('0xb')](_0x7490('0x61'));_0x3c6573[_0x7490('0xb')](_0x7490('0x60'));_0x3c6573['field'](_0x7490('0x79'));_0x3c6573['field'](_0x7490('0x62'));_0x3c6573['field']('i.to');_0x3c6573[_0x7490('0xb')]('i.ContactId');_0x3c6573[_0x7490('0xb')](_0x7490('0x7a'));_0x3c6573[_0x7490('0xb')](_0x7490('0x7b'));}else if(_0x5bfb54===_0x7490('0x2e')){_0x3c6573[_0x7490('0xb')](_0x7490('0x7c'),_0x7490('0x7d'));}else{_0x3c6573[_0x7490('0xb')](_0x7490('0x7e'),_0x7490('0x7d'));}if(_0x5bfb54!=='mail'){_0x3c6573[_0x7490('0xb')](_0x7490('0x7f'));}_0x3c6573['field'](_0x7490('0x80'),_0x7490('0x81'));_0x3c6573['field'](_0x7490('0x82'),_0x7490('0x83'));_0x3c6573['field'](_0x7490('0x84'),'Contact.email');_0x3c6573[_0x7490('0xb')]('c.phone','Contact.phone');_0x3c6573['field'](_0x7490('0x85'),_0x7490('0x86'));_0x3c6573[_0x7490('0xb')](_0x7490('0x87'),_0x7490('0x88'));_0x3c6573[_0x7490('0xb')](_0x7490('0x89'),_0x7490('0x8a'));_0x3c6573[_0x7490('0xb')](_0x7490('0x8b'),_0x7490('0x8c'));_0x3c6573[_0x7490('0xb')](_0x7490('0x8d'),_0x7490('0x8e'));}if(_0xc0f26b[_0x7490('0x8f')]){_0x3c6573['limit'](_0xc0f26b[_0x7490('0x8f')]);}if(_0xc0f26b[_0x7490('0x90')]){_0x3c6573[_0x7490('0x90')](_0xc0f26b['offset']);}return db[_0x7490('0x67')]['query'](_0x3c6573[_0x7490('0x69')](),_0x2c094d);})['then'](function(_0x9195d){_0x237fab=_0x9195d;var _0x16b2bf=getUsersQuery(_0x5bfb54,_0x237fab);return db[_0x7490('0x67')]['query'](_0x16b2bf['toString'](),_0x2c094d);})[_0x7490('0x59')](function(_0x1e8236){_0x347472=_['groupBy'](_0x1e8236,_0x1ffdd0);if(_0x5bfb54===_0x7490('0x2f')){return db['Setting'][_0x7490('0x91')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x7490('0x59')](function(_0x3b79f0){var _0x547bbd=_0x3b79f0?_0x3b79f0['enableEmailPreview']:undefined;var _0x1459fb=_0x237fab[_0x7490('0x48')](function(_0x1e1539){return updateInteraction(_0x1e1539,_0x120539,_0x347472,_0x547bbd);});return Promise[_0x7490('0x92')](_0x1459fb);});}function countFilteredInteractions(_0x1aadb2,_0x759356){var _0x47466b=_0x1aadb2[_0x7490('0x93')]();_0x47466b['field'](_0x7490('0x94'));_0x47466b[_0x7490('0xb')](_0x7490('0x6d'),'unreadMessages');var _0x513751=utils['getSelectedTags'](_0x759356);if(!_[_0x7490('0x95')](_0x513751)){_0x47466b[_0x7490('0x17')](_0x7490('0x96'),_0x513751);}var _0x190b1a={'type':db['Sequelize']['QueryTypes'][_0x7490('0x97')],'raw':!![]};return db[_0x7490('0x67')][_0x7490('0x68')](_0x47466b[_0x7490('0x69')](),_0x190b1a);}module[_0x7490('0x98')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 0fbdd7a..6576175 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ec3=['closed','disposition','UserId','MailMessage','findOne','plainBody','-id','then','trimStart','updateInteraction','Users','TagIds','Tags','catch','lodash','../../mysqldb','map','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total'];(function(_0x1c5ad6,_0x47b206){var _0x1d5829=function(_0x11b47f){while(--_0x11b47f){_0x1c5ad6['push'](_0x1c5ad6['shift']());}};_0x1d5829(++_0x47b206);}(_0x2ec3,0x160));var _0x32ec=function(_0x13176b,_0x2bec5b){_0x13176b=_0x13176b-0x0;var _0x3f82fe=_0x2ec3[_0x13176b];return _0x3f82fe;};'use strict';var _=require(_0x32ec('0x0'));var db=require(_0x32ec('0x1'))['db'];function getInteractionUsers(_0x36fc3d,_0x72f96f){return new Promise(function(_0x67b816,_0x2a181b){try{var _0x4200f0=[];if(_0x72f96f[_0x36fc3d]){_0x4200f0=_0x72f96f[_0x36fc3d][_0x32ec('0x2')](function(_0x32b924){return{'id':_0x32b924['id'],'fullname':_0x32b924['fullname']};});}return _0x67b816(_0x4200f0);}catch(_0xc93690){_0x2a181b(_0xc93690);}});}function getInteractionTags(_0x1109bd,_0x2681d6){var _0x3ed466=[];if(_0x1109bd){_0x1109bd[_0x32ec('0x3')](',')[_0x32ec('0x4')](function(_0x2556f3){_0x3ed466[_0x32ec('0x5')](_0x2681d6[_0x2556f3]);});}return _0x3ed466;}function updateWaitingCounter(_0x4d7d8f){if(_0x4d7d8f[_0x32ec('0x6')]){_0x4d7d8f['waiting']-=0x1;}}function updateInteractionCounters(_0xfe35a4){_0xfe35a4['waiting']=0x0;_0xfe35a4[_0x32ec('0x7')]=0x0;_0xfe35a4[_0x32ec('0x8')]=0x0;_0xfe35a4[_0x32ec('0x9')]=0x0;_0xfe35a4[_0x32ec('0xa')]=0x0;_0xfe35a4[_0x32ec('0xb')]=0x0;if(_0xfe35a4[_0x32ec('0xc')]){if(_0xfe35a4[_0x32ec('0xd')]===_0x32ec('0xa')){_0xfe35a4[_0x32ec('0xa')]+=0x1;updateWaitingCounter(_0xfe35a4);}if(_0xfe35a4['UserId']){_0xfe35a4[_0x32ec('0x8')]+=0x1;if(_0xfe35a4[_0x32ec('0x7')]){_0xfe35a4[_0x32ec('0x7')]-=0x1;}}else{if(_0xfe35a4[_0x32ec('0xd')]){_0xfe35a4[_0x32ec('0x9')]+=0x1;updateWaitingCounter(_0xfe35a4);}}}else{if(!_0xfe35a4[_0x32ec('0xe')]){_0xfe35a4[_0x32ec('0x6')]+=0x1;}if(_0xfe35a4[_0x32ec('0xe')]){_0xfe35a4[_0x32ec('0x7')]+=0x1;updateWaitingCounter(_0xfe35a4);}}_0xfe35a4[_0x32ec('0xb')]+=0x1;return _0xfe35a4;}function getLastMessageText(_0x5cbd92){return db[_0x32ec('0xf')][_0x32ec('0x10')]({'where':{'$and':[{'MailInteractionId':_0x5cbd92['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x32ec('0x11')],'order':_0x32ec('0x12'),'raw':!![]})[_0x32ec('0x13')](function(_0x307062){if(_0x307062&&_0x307062[_0x32ec('0x11')]){_0x5cbd92['lastMsgText']=_[_0x32ec('0x14')](_0x307062[_0x32ec('0x11')]);}return _0x5cbd92;})['catch'](function(_0x53c897){throw _0x53c897;});}exports[_0x32ec('0x15')]=function(_0x167c7f,_0x10a8f0,_0x29b1e8,_0x3c7fc1){return new Promise(function(_0x47408e,_0x42011e){return getInteractionUsers(_0x167c7f['id'],_0x29b1e8)[_0x32ec('0x13')](function(_0xb37e88){_0x167c7f[_0x32ec('0x16')]=_0xb37e88;return getInteractionTags(_0x167c7f[_0x32ec('0x17')],_0x10a8f0);})[_0x32ec('0x13')](function(_0x5e2e9b){_0x167c7f[_0x32ec('0x18')]=_0x5e2e9b;delete _0x167c7f[_0x32ec('0x17')];return updateInteractionCounters(_0x167c7f);})[_0x32ec('0x13')](function(_0x21e19e){if(_0x3c7fc1){return getLastMessageText(_0x21e19e);}else{return _0x21e19e;}})['then'](function(_0x27be4b){_0x47408e(_0x27be4b);})[_0x32ec('0x19')](function(_0x10dc2f){_0x42011e(_0x10dc2f);});});}; \ No newline at end of file +var _0x9530=['push','waiting','talking','answered','unmanaged','abandoned','closed','disposition','UserId','total','findOne','out','plainBody','-id','then','trimStart','updateInteraction','Tags','TagIds','catch','lodash','../../mysqldb','map','split','forEach'];(function(_0x1584e2,_0x14c000){var _0x344273=function(_0x1acb10){while(--_0x1acb10){_0x1584e2['push'](_0x1584e2['shift']());}};_0x344273(++_0x14c000);}(_0x9530,0xdc));var _0x0953=function(_0x18f810,_0x31965e){_0x18f810=_0x18f810-0x0;var _0x56a714=_0x9530[_0x18f810];return _0x56a714;};'use strict';var _=require(_0x0953('0x0'));var db=require(_0x0953('0x1'))['db'];function getInteractionUsers(_0x4d4ef7,_0xad383d){return new Promise(function(_0x48bcc4,_0x26706e){try{var _0x2be8e7=[];if(_0xad383d[_0x4d4ef7]){_0x2be8e7=_0xad383d[_0x4d4ef7][_0x0953('0x2')](function(_0xdda471){return{'id':_0xdda471['id'],'fullname':_0xdda471['fullname']};});}return _0x48bcc4(_0x2be8e7);}catch(_0x8cc5aa){_0x26706e(_0x8cc5aa);}});}function getInteractionTags(_0x295f36,_0x37196e){var _0x12839d=[];if(_0x295f36){_0x295f36[_0x0953('0x3')](',')[_0x0953('0x4')](function(_0x4af57a){_0x12839d[_0x0953('0x5')](_0x37196e[_0x4af57a]);});}return _0x12839d;}function updateWaitingCounter(_0x57bdaf){if(_0x57bdaf['waiting']){_0x57bdaf[_0x0953('0x6')]-=0x1;}}function updateInteractionCounters(_0x5dcf62){_0x5dcf62[_0x0953('0x6')]=0x0;_0x5dcf62[_0x0953('0x7')]=0x0;_0x5dcf62[_0x0953('0x8')]=0x0;_0x5dcf62[_0x0953('0x9')]=0x0;_0x5dcf62[_0x0953('0xa')]=0x0;_0x5dcf62['total']=0x0;if(_0x5dcf62[_0x0953('0xb')]){if(_0x5dcf62[_0x0953('0xc')]===_0x0953('0xa')){_0x5dcf62[_0x0953('0xa')]+=0x1;updateWaitingCounter(_0x5dcf62);}if(_0x5dcf62[_0x0953('0xd')]){_0x5dcf62[_0x0953('0x8')]+=0x1;if(_0x5dcf62[_0x0953('0x7')]){_0x5dcf62[_0x0953('0x7')]-=0x1;}}else{if(_0x5dcf62[_0x0953('0xc')]){_0x5dcf62['unmanaged']+=0x1;updateWaitingCounter(_0x5dcf62);}}}else{if(!_0x5dcf62['UserId']){_0x5dcf62['waiting']+=0x1;}if(_0x5dcf62['UserId']){_0x5dcf62[_0x0953('0x7')]+=0x1;updateWaitingCounter(_0x5dcf62);}}_0x5dcf62[_0x0953('0xe')]+=0x1;return _0x5dcf62;}function getLastMessageText(_0x575b50){return db['MailMessage'][_0x0953('0xf')]({'where':{'$and':[{'MailInteractionId':_0x575b50['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0953('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x0953('0x11')],'order':_0x0953('0x12'),'raw':!![]})[_0x0953('0x13')](function(_0x1a5c7e){if(_0x1a5c7e&&_0x1a5c7e[_0x0953('0x11')]){_0x575b50['lastMsgText']=_[_0x0953('0x14')](_0x1a5c7e[_0x0953('0x11')]);}return _0x575b50;})['catch'](function(_0x37fadb){throw _0x37fadb;});}exports[_0x0953('0x15')]=function(_0x128f7f,_0x1565ea,_0x1016aa,_0x16930f){return new Promise(function(_0x3b24b4,_0x587a13){return getInteractionUsers(_0x128f7f['id'],_0x1016aa)['then'](function(_0x43aaae){_0x128f7f['Users']=_0x43aaae;return getInteractionTags(_0x128f7f['TagIds'],_0x1565ea);})[_0x0953('0x13')](function(_0x558595){_0x128f7f[_0x0953('0x16')]=_0x558595;delete _0x128f7f[_0x0953('0x17')];return updateInteractionCounters(_0x128f7f);})['then'](function(_0x29cdd0){if(_0x16930f){return getLastMessageText(_0x29cdd0);}else{return _0x29cdd0;}})[_0x0953('0x13')](function(_0x241afc){_0x3b24b4(_0x241afc);})[_0x0953('0x18')](function(_0x41a86d){_0x587a13(_0x41a86d);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index cf53824..14bd930 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x018f=['../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','chat','accounts','_interactions','_interaction_has_tags','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','findOne','then','update','info','catch','error','exports','lodash'];(function(_0x585b86,_0x515d4b){var _0x5f949e=function(_0x4fb750){while(--_0x4fb750){_0x585b86['push'](_0x585b86['shift']());}};_0x5f949e(++_0x515d4b);}(_0x018f,0x12b));var _0xf018=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0x018f[_0x548200];return _0x1a6d74;};'use strict';var _=require(_0xf018('0x0'));var db=require(_0xf018('0x1'))['db'];var loggers={'openchannel':require(_0xf018('0x2'))(_0xf018('0x3')),'mail':require(_0xf018('0x2'))('mail-interactions'),'fax':require(_0xf018('0x2'))(_0xf018('0x4')),'sms':require(_0xf018('0x2'))(_0xf018('0x5')),'chat':require(_0xf018('0x2'))(_0xf018('0x6')),'whatsapp':require('../../config/logger')(_0xf018('0x7'))};function getAccountFK(_0x189066){return _[_0xf018('0x8')](_0x189066)+(_0x189066==='chat'?_0xf018('0x9'):_0xf018('0xa'))+'Id';}function getInteractionFK(_0x55b7a3){return _[_0xf018('0x8')](_0x55b7a3)+_0xf018('0xb');}function getInteractionId(_0x1c961c,_0x261be6,_0x2f8fa4){if(_0x1c961c&&_0x1c961c[_[_0xf018('0xc')](_0x2f8fa4)+_0xf018('0xb')]){return _0x1c961c[_[_0xf018('0xc')](_0x2f8fa4)+'InteractionId'];}else if(_0x1c961c&&_0x1c961c['id']){return _0x1c961c['id'];}else if(_0x261be6&&_0x261be6['id']){return _0x261be6['id'];}else{return'unknown';}}function getInteractionsTables(_0x3c0b58){return{'accounts':_0x3c0b58+'_'+(_0x3c0b58===_0xf018('0xd')?'websites':_0xf018('0xe')),'interactions':_0x3c0b58+_0xf018('0xf'),'interactionsTags':_0x3c0b58+_0xf018('0x10'),'messages':_0x3c0b58+'_messages','userInteractions':'user_has_'+_0x3c0b58+'_interactions'};}function getSelectedTags(_0x118a23){var _0x52fb3f=[];if(_0x118a23){_0x52fb3f=Array[_0xf018('0x11')](_0x118a23)?_0x118a23:[_0x118a23];}return _0x52fb3f;}function log(_0xe34c10,_0x1b73dd,_0x143037,_0x1b9de7,_0x2ccc97,_0x5c6917){loggers[_0x2ccc97[_0xf018('0x12')]()][_0xe34c10](_0xf018('0x13'),_0x5c6917[_0xf018('0x14')](),_0x1b73dd?_0x1b73dd['id']:null,_0x1b73dd?_0x1b73dd['name']:null,_0x1b73dd?_0x1b73dd['role']:null,getInteractionId(_0x143037,_0x1b9de7,_0x2ccc97),_0x143037?JSON[_0xf018('0x15')](_0x143037):_0xf018('0x16'));}function updateUser(_0x319e5a,_0x3154c2,_0x201000,_0x22270d,_0x54e33c){db[_[_0xf018('0xc')](_0x22270d)+'Interaction'][_0xf018('0x17')]({'where':{'id':getInteractionId(_0x3154c2,_0x201000,_0x22270d)}})[_0xf018('0x18')](function(_0x296ed0){if(_0x296ed0){return _0x296ed0[_0xf018('0x19')]({'UserId':_0x319e5a?_0x319e5a['id']:null});}})['then'](function(_0x44ab0e){if(_0x44ab0e){log(_0xf018('0x1a'),_0x319e5a,_0x3154c2,_0x201000,_0x22270d,_0x54e33c);}})[_0xf018('0x1b')](function(){log(_0xf018('0x1c'),_0x319e5a,_0x3154c2,_0x201000,_0x22270d,_0x54e33c);});}module[_0xf018('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x84d1=['catch','error','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x84d1,0x1c2));var _0x184d=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x84d1[_0x4e6eb2];return _0x4e0c1c;};'use strict';var _=require(_0x184d('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x184d('0x1'))(_0x184d('0x2')),'mail':require(_0x184d('0x1'))(_0x184d('0x3')),'fax':require(_0x184d('0x1'))(_0x184d('0x4')),'sms':require('../../config/logger')(_0x184d('0x5')),'chat':require('../../config/logger')(_0x184d('0x6')),'whatsapp':require(_0x184d('0x1'))(_0x184d('0x7'))};function getAccountFK(_0x2c3e4d){return _['capitalize'](_0x2c3e4d)+(_0x2c3e4d===_0x184d('0x8')?_0x184d('0x9'):_0x184d('0xa'))+'Id';}function getInteractionFK(_0xa69c60){return _['capitalize'](_0xa69c60)+_0x184d('0xb');}function getInteractionId(_0x2dc488,_0x179439,_0x17b494){if(_0x2dc488&&_0x2dc488[_[_0x184d('0xc')](_0x17b494)+'InteractionId']){return _0x2dc488[_[_0x184d('0xc')](_0x17b494)+_0x184d('0xb')];}else if(_0x2dc488&&_0x2dc488['id']){return _0x2dc488['id'];}else if(_0x179439&&_0x179439['id']){return _0x179439['id'];}else{return _0x184d('0xd');}}function getInteractionsTables(_0x48aba9){return{'accounts':_0x48aba9+'_'+(_0x48aba9===_0x184d('0x8')?_0x184d('0xe'):_0x184d('0xf')),'interactions':_0x48aba9+_0x184d('0x10'),'interactionsTags':_0x48aba9+_0x184d('0x11'),'messages':_0x48aba9+_0x184d('0x12'),'userInteractions':'user_has_'+_0x48aba9+_0x184d('0x10')};}function getSelectedTags(_0x4011d9){var _0x20ad11=[];if(_0x4011d9){_0x20ad11=Array[_0x184d('0x13')](_0x4011d9)?_0x4011d9:[_0x4011d9];}return _0x20ad11;}function log(_0x52b327,_0x456c48,_0x41c051,_0x3a84e9,_0x5aa861,_0xd8d440){loggers[_0x5aa861['toLowerCase']()][_0x52b327](_0x184d('0x14'),_0xd8d440[_0x184d('0x15')](),_0x456c48?_0x456c48['id']:null,_0x456c48?_0x456c48[_0x184d('0x16')]:null,_0x456c48?_0x456c48['role']:null,getInteractionId(_0x41c051,_0x3a84e9,_0x5aa861),_0x41c051?JSON[_0x184d('0x17')](_0x41c051):_0x184d('0x18'));}function updateUser(_0xe27b51,_0x4ecde1,_0x2ba3d9,_0xd46dfe,_0x377393){db[_[_0x184d('0xc')](_0xd46dfe)+_0x184d('0x19')][_0x184d('0x1a')]({'where':{'id':getInteractionId(_0x4ecde1,_0x2ba3d9,_0xd46dfe)}})[_0x184d('0x1b')](function(_0x4eac36){if(_0x4eac36){return _0x4eac36[_0x184d('0x1c')]({'UserId':_0xe27b51?_0xe27b51['id']:null});}})['then'](function(_0x5c80e3){if(_0x5c80e3){log(_0x184d('0x1d'),_0xe27b51,_0x4ecde1,_0x2ba3d9,_0xd46dfe,_0x377393);}})[_0x184d('0x1e')](function(){log(_0x184d('0x1f'),_0xe27b51,_0x4ecde1,_0x2ba3d9,_0xd46dfe,_0x377393);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0cf8476..5605c9c 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 _0xce84=['%s:%s:%s','update','base64','final','utf8','use','License','findOne','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','format'];(function(_0x5e2aaf,_0x5ee3e3){var _0x508383=function(_0x5ea4a7){while(--_0x5ea4a7){_0x5e2aaf['push'](_0x5e2aaf['shift']());}};_0x508383(++_0x5ee3e3);}(_0xce84,0xc1));var _0x4ce8=function(_0x259cb7,_0x37a90c){_0x259cb7=_0x259cb7-0x0;var _0x3d5c5a=_0xce84[_0x259cb7];return _0x3d5c5a;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0x4ce8('0x0'))['db'];var config=require(_0x4ce8('0x1'));function getValueFromLicense(_0xd23561,_0x19791d){if(_0xd23561&&_0x19791d){if(_0x19791d[_0x4ce8('0x2')]&&_0x19791d[_0x4ce8('0x3')]){var _0x53fa1b=_0x19791d[_0x4ce8('0x2')];var _0x2100a0=_0x19791d[_0x4ce8('0x3')];var _0x352200=_0x53fa1b['split']('-')[0x4];var _0x1decdd=_0x53fa1b['split']('-')[0x0];var _0x558464=crypto[_0x4ce8('0x4')](_0x4ce8('0x5'),util[_0x4ce8('0x6')](_0x4ce8('0x7'),_0x352200,_0x53fa1b,_0x1decdd));var _0x57d6ed=_0x558464[_0x4ce8('0x8')](_0x2100a0,_0x4ce8('0x9'),'utf8');_0x57d6ed+=_0x558464[_0x4ce8('0xa')](_0x4ce8('0xb'));var _0x29c5bd=JSON['parse'](_0x57d6ed);return _0x29c5bd['hasOwnProperty'](_0xd23561)?_0x29c5bd[_0xd23561]:null;}}return null;}function isLimit(_0x32ffad,_0x29bc9b,_0x3f2c6a,_0x279b8d){var _0x582632=_0x29bc9b;return compose()[_0x4ce8('0xc')](function(_0x5aba23,_0x227d43,_0x3eb1a2){return db[_0x4ce8('0xd')][_0x4ce8('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x4ce8('0xf')](function(_0x1f492){var _0x50da39=getValueFromLicense(_0x32ffad,_0x1f492);return _0x50da39?_0x50da39:_0x582632;})[_0x4ce8('0xf')](function(_0x1055b9){_0x582632=_0x1055b9;return _0x3f2c6a[_0x4ce8('0x10')](_0x279b8d);})[_0x4ce8('0xf')](function(_0x46333c){if(_0x46333c>=_0x582632){return _0x227d43['status'](0x193)['json']({'message':util[_0x4ce8('0x6')](_0x4ce8('0x11'),_0x32ffad)});}_0x3eb1a2();})['catch'](function(_0x3dbfa1){_0x3eb1a2(_0x3dbfa1);});});}function isUserLimit(){return isLimit(_0x4ce8('0x12'),0x1,db[_0x4ce8('0x13')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x1c52=['isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','hasOwnProperty','use','License','then','count','status','json','catch','users','User','user'];(function(_0x3a4984,_0x20aed5){var _0x571a96=function(_0x14a3b0){while(--_0x14a3b0){_0x3a4984['push'](_0x3a4984['shift']());}};_0x571a96(++_0x20aed5);}(_0x1c52,0x181));var _0x21c5=function(_0x3042aa,_0x4c46bc){_0x3042aa=_0x3042aa-0x0;var _0x54b464=_0x1c52[_0x3042aa];return _0x54b464;};'use strict';var crypto=require('crypto');var util=require(_0x21c5('0x0'));var compose=require(_0x21c5('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x21c5('0x2'));function getValueFromLicense(_0x11031c,_0xbab427){if(_0x11031c&&_0xbab427){if(_0xbab427[_0x21c5('0x3')]&&_0xbab427[_0x21c5('0x4')]){var _0x2f782e=_0xbab427[_0x21c5('0x3')];var _0xa4f712=_0xbab427[_0x21c5('0x4')];var _0x3fe819=_0x2f782e[_0x21c5('0x5')]('-')[0x4];var _0x322717=_0x2f782e[_0x21c5('0x5')]('-')[0x0];var _0x3d6bdd=crypto['createDecipher'](_0x21c5('0x6'),util[_0x21c5('0x7')](_0x21c5('0x8'),_0x3fe819,_0x2f782e,_0x322717));var _0x3a1295=_0x3d6bdd['update'](_0xa4f712,_0x21c5('0x9'),_0x21c5('0xa'));_0x3a1295+=_0x3d6bdd[_0x21c5('0xb')](_0x21c5('0xa'));var _0x52ccfe=JSON['parse'](_0x3a1295);return _0x52ccfe[_0x21c5('0xc')](_0x11031c)?_0x52ccfe[_0x11031c]:null;}}return null;}function isLimit(_0x33b0f8,_0x708f07,_0x1d6cb6,_0x3d3416){var _0x377907=_0x708f07;return compose()[_0x21c5('0xd')](function(_0x4706d7,_0xd8f04d,_0x35bd33){return db[_0x21c5('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x109cb4){var _0x359e02=getValueFromLicense(_0x33b0f8,_0x109cb4);return _0x359e02?_0x359e02:_0x377907;})[_0x21c5('0xf')](function(_0x18c785){_0x377907=_0x18c785;return _0x1d6cb6[_0x21c5('0x10')](_0x3d3416);})['then'](function(_0x54a2c6){if(_0x54a2c6>=_0x377907){return _0xd8f04d[_0x21c5('0x11')](0x193)[_0x21c5('0x12')]({'message':util[_0x21c5('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x33b0f8)});}_0x35bd33();})[_0x21c5('0x13')](function(_0x26ec15){_0x35bd33(_0x26ec15);});});}function isUserLimit(){return isLimit(_0x21c5('0x14'),0x1,db[_0x21c5('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x21c5('0x16')}]}});}exports[_0x21c5('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 10060c0..0472b58 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 _0x07e1=['indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','hours','minutes','seconds','sqlOperator','startsWith','and','[$and]','replace','[$or]','split','length','forEach','shift','match','filter'];(function(_0x325aef,_0x2a3cdc){var _0x343e14=function(_0x270e25){while(--_0x270e25){_0x325aef['push'](_0x325aef['shift']());}};_0x343e14(++_0x2a3cdc);}(_0x07e1,0x1c4));var _0x107e=function(_0x8608b0,_0x47befb){_0x8608b0=_0x8608b0-0x0;var _0x5bb908=_0x07e1[_0x8608b0];return _0x5bb908;};'use strict';var _=require('lodash');var moment=require('moment');exports['parseSearch']=function(_0x4915f5){var _0x91e2b3={'conditions':[]};_0x91e2b3[_0x107e('0x0')]=_[_0x107e('0x1')](_0x4915f5,'[$or]')?'or':_0x107e('0x2');var _0x8d4534=_0x4915f5['replace'](_0x107e('0x3'),'')[_0x107e('0x4')](_0x107e('0x5'),'')[_0x107e('0x6')]('||');for(var _0x5c43da=0x0;_0x5c43da<_0x8d4534[_0x107e('0x7')];_0x5c43da++){var _0x1a658c=_0x8d4534[_0x5c43da]['split'](':=');var _0x2403d4=_0x1a658c[0x0];var _0x5734f0=_0x1a658c['slice'](0x1);_0x5734f0[_0x107e('0x8')](function(_0x3ca86f){var _0x52e2e1=_0x3ca86f[_0x107e('0x6')]('[')[_0x107e('0x9')]();var _0x5b482a=_0x3ca86f[_0x107e('0xa')](/\[(.*?)\]/g);_0x5b482a[_0x107e('0x8')](function(_0x5e660c){var _0x50367a=_0x5e660c[_0x107e('0x6')]('[')[_0x107e('0xb')](function(_0x2932cf){return _0x2932cf[_0x107e('0xc')](']')>-0x1;})[_0x107e('0xd')](function(_0x5ce373){return _0x5ce373['split'](']')[0x0];})[0x0];_0x91e2b3[_0x107e('0xe')][_0x107e('0xf')]({'field':_0x2403d4,'operator':_0x52e2e1,'value':_0x50367a});});});}return _0x91e2b3;};exports[_0x107e('0x10')]=function(_0x3616d9,_0x220015,_0x5e328e){var _0x48de37={};if(_0x220015===_0x107e('0x11')){if(_0x5e328e[_0x107e('0x12')]==='$eq'){_0x5e328e[_0x107e('0x12')]=_0x107e('0x13');_0x5e328e[_0x107e('0x14')]+=','+_0x5e328e['value'];}else if(_[_0x107e('0x15')]([_0x107e('0x16'),_0x107e('0x17')],_0x5e328e['operator'])){_0x5e328e[_0x107e('0x14')]=moment(_0x5e328e[_0x107e('0x14')])[_0x107e('0x18')](0x1,_0x107e('0x19'))[_0x107e('0x1a')](_0x107e('0x1b'));}}if(_0x5e328e[_0x107e('0x1c')]){_0x220015=_0x5e328e[_0x107e('0x1c')];_0x48de37[_0x107e('0x1d')]=_0x107e('0x1e')+_0x3616d9+'.'+_0x5e328e['field']+'\x20AS\x20'+_0x5e328e[_0x107e('0x1c')]+')\x20'+parseOperator(_0x5e328e['operator']);}else{_0x48de37[_0x107e('0x1d')]=_0x3616d9+'.'+_0x5e328e['field']+'\x20'+parseOperator(_0x5e328e['operator']);}if(_['includes']([_0x107e('0x1f'),_0x107e('0x20')],_0x5e328e[_0x107e('0x12')]))_0x48de37[_0x107e('0x1d')]='('+_0x48de37[_0x107e('0x1d')]+_0x107e('0x21')+_0x3616d9+'.'+_0x5e328e['field']+_0x107e('0x22');_0x48de37[_0x107e('0x14')]=parseValue(_0x220015,_0x5e328e['operator'],_0x5e328e['value']);return _0x48de37;};function parseOperator(_0xefd254){var _0x233c03;switch(_0xefd254){case _0x107e('0x23'):_0x233c03=_0x107e('0x24');break;case _0x107e('0x20'):_0x233c03=_0x107e('0x25');break;case _0x107e('0x26'):_0x233c03=_0x107e('0x27');break;case _0x107e('0x1f'):_0x233c03=_0x107e('0x28');break;case'$substring':case _0x107e('0x29'):case _0x107e('0x2a'):_0x233c03=_0x107e('0x2b');break;case _0x107e('0x2c'):_0x233c03=_0x107e('0x2d');break;case _0x107e('0x16'):_0x233c03=_0x107e('0x2e');break;case'$lte':_0x233c03=_0x107e('0x2f');break;case _0x107e('0x30'):_0x233c03=_0x107e('0x31');break;case _0x107e('0x13'):_0x233c03=_0x107e('0x32');break;}return _0x233c03;}function parseValue(_0x5b4e63,_0x1d1578,_0x353961){var _0x48575c={'start':undefined,'end':undefined};switch(_0x1d1578){case _0x107e('0x23'):case'$notIn':_0x48575c[_0x107e('0x33')]=_0x353961['split'](',');break;case _0x107e('0x34'):_0x48575c['start']='%'+_0x353961+'%';break;case'$startsWith':_0x48575c[_0x107e('0x33')]=_0x353961+'%';break;case _0x107e('0x2a'):_0x48575c[_0x107e('0x33')]='%'+_0x353961;break;case'$between':var _0x37c753=_0x353961[_0x107e('0x6')](',');var _0x353961=_0x37c753[_0x107e('0x9')]();var _0x4d319e=_0x37c753[_0x107e('0x35')]();if(_0x5b4e63===_0x107e('0x11')){_0x353961=moment(_0x353961)[_0x107e('0x36')](0x0,!![])[_0x107e('0x1a')]();_0x4d319e=moment(_0x4d319e)[_0x107e('0x36')](0x0,!![])['add'](0x17,_0x107e('0x37'))[_0x107e('0x18')](0x3b,_0x107e('0x38'))[_0x107e('0x18')](0x3b,_0x107e('0x39'))[_0x107e('0x1a')]();}_0x48575c={'start':_0x353961,'end':_0x4d319e};break;default:_0x48575c[_0x107e('0x33')]=_0x353961;break;}return _0x48575c;} \ No newline at end of file +var _0x7c10=['>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','$between','pop','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','DATE','$eq','operator','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','field','\x20AS\x20','$ne','$notIn','text','\x20OR\x20','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','>\x20?','$lte','<=\x20?','$gte'];(function(_0x2280b1,_0x4900ad){var _0x42770b=function(_0x49c8a7){while(--_0x49c8a7){_0x2280b1['push'](_0x2280b1['shift']());}};_0x42770b(++_0x4900ad);}(_0x7c10,0xe9));var _0x07c1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7c10[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x07c1('0x0'));var moment=require(_0x07c1('0x1'));exports[_0x07c1('0x2')]=function(_0x1cbd82){var _0x1a8a48={'conditions':[]};_0x1a8a48[_0x07c1('0x3')]=_['startsWith'](_0x1cbd82,_0x07c1('0x4'))?'or':_0x07c1('0x5');var _0x1e453f=_0x1cbd82[_0x07c1('0x6')](_0x07c1('0x7'),'')[_0x07c1('0x6')]('[$or]','')[_0x07c1('0x8')]('||');for(var _0x44bc4d=0x0;_0x44bc4d<_0x1e453f[_0x07c1('0x9')];_0x44bc4d++){var _0x48f5a6=_0x1e453f[_0x44bc4d]['split'](':=');var _0x41f304=_0x48f5a6[0x0];var _0xce1a01=_0x48f5a6[_0x07c1('0xa')](0x1);_0xce1a01[_0x07c1('0xb')](function(_0x504d93){var _0x5237c5=_0x504d93['split']('[')[_0x07c1('0xc')]();var _0x58302c=_0x504d93[_0x07c1('0xd')](/\[(.*?)\]/g);_0x58302c[_0x07c1('0xb')](function(_0x585b87){var _0xf12083=_0x585b87[_0x07c1('0x8')]('[')['filter'](function(_0x2ba358){return _0x2ba358[_0x07c1('0xe')](']')>-0x1;})[_0x07c1('0xf')](function(_0x44be25){return _0x44be25['split'](']')[0x0];})[0x0];_0x1a8a48[_0x07c1('0x10')][_0x07c1('0x11')]({'field':_0x41f304,'operator':_0x5237c5,'value':_0xf12083});});});}return _0x1a8a48;};exports['buildExpression']=function(_0x21f471,_0x33ef72,_0x5b2878){var _0x34d211={};if(_0x33ef72===_0x07c1('0x12')){if(_0x5b2878['operator']===_0x07c1('0x13')){_0x5b2878[_0x07c1('0x14')]='$between';_0x5b2878[_0x07c1('0x15')]+=','+_0x5b2878['value'];}else if(_[_0x07c1('0x16')]([_0x07c1('0x17'),'$lte'],_0x5b2878[_0x07c1('0x14')])){_0x5b2878[_0x07c1('0x15')]=moment(_0x5b2878[_0x07c1('0x15')])[_0x07c1('0x18')](0x1,_0x07c1('0x19'))[_0x07c1('0x1a')](_0x07c1('0x1b'));}}if(_0x5b2878[_0x07c1('0x1c')]){_0x33ef72=_0x5b2878[_0x07c1('0x1c')];_0x34d211['text']='CAST('+_0x21f471+'.'+_0x5b2878[_0x07c1('0x1d')]+_0x07c1('0x1e')+_0x5b2878[_0x07c1('0x1c')]+')\x20'+parseOperator(_0x5b2878['operator']);}else{_0x34d211['text']=_0x21f471+'.'+_0x5b2878[_0x07c1('0x1d')]+'\x20'+parseOperator(_0x5b2878[_0x07c1('0x14')]);}if(_[_0x07c1('0x16')]([_0x07c1('0x1f'),_0x07c1('0x20')],_0x5b2878['operator']))_0x34d211[_0x07c1('0x21')]='('+_0x34d211[_0x07c1('0x21')]+_0x07c1('0x22')+_0x21f471+'.'+_0x5b2878[_0x07c1('0x1d')]+'\x20IS\x20NULL)';_0x34d211['value']=parseValue(_0x33ef72,_0x5b2878[_0x07c1('0x14')],_0x5b2878[_0x07c1('0x15')]);return _0x34d211;};function parseOperator(_0x40ee6c){var _0x19350d;switch(_0x40ee6c){case _0x07c1('0x23'):_0x19350d=_0x07c1('0x24');break;case'$notIn':_0x19350d='NOT\x20IN\x20?';break;case _0x07c1('0x13'):_0x19350d=_0x07c1('0x25');break;case _0x07c1('0x1f'):_0x19350d=_0x07c1('0x26');break;case _0x07c1('0x27'):case _0x07c1('0x28'):case'$endsWith':_0x19350d=_0x07c1('0x29');break;case _0x07c1('0x2a'):_0x19350d='<\x20?';break;case _0x07c1('0x17'):_0x19350d=_0x07c1('0x2b');break;case _0x07c1('0x2c'):_0x19350d=_0x07c1('0x2d');break;case _0x07c1('0x2e'):_0x19350d=_0x07c1('0x2f');break;case'$between':_0x19350d=_0x07c1('0x30');break;}return _0x19350d;}function parseValue(_0x48cb63,_0x45137e,_0x33ffd8){var _0x15c4ad={'start':undefined,'end':undefined};switch(_0x45137e){case _0x07c1('0x23'):case _0x07c1('0x20'):_0x15c4ad[_0x07c1('0x31')]=_0x33ffd8[_0x07c1('0x8')](',');break;case'$substring':_0x15c4ad[_0x07c1('0x31')]='%'+_0x33ffd8+'%';break;case'$startsWith':_0x15c4ad[_0x07c1('0x31')]=_0x33ffd8+'%';break;case _0x07c1('0x32'):_0x15c4ad[_0x07c1('0x31')]='%'+_0x33ffd8;break;case _0x07c1('0x33'):var _0x3f3dc1=_0x33ffd8['split'](',');var _0x33ffd8=_0x3f3dc1[_0x07c1('0xc')]();var _0x314d49=_0x3f3dc1[_0x07c1('0x34')]();if(_0x48cb63==='DATE'){_0x33ffd8=moment(_0x33ffd8)[_0x07c1('0x35')](0x0,!![])['format']();_0x314d49=moment(_0x314d49)[_0x07c1('0x35')](0x0,!![])[_0x07c1('0x18')](0x17,_0x07c1('0x36'))['add'](0x3b,'minutes')[_0x07c1('0x18')](0x3b,_0x07c1('0x37'))[_0x07c1('0x1a')]();}_0x15c4ad={'start':_0x33ffd8,'end':_0x314d49};break;default:_0x15c4ad[_0x07c1('0x31')]=_0x33ffd8;break;}return _0x15c4ad;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bbb561e..e73f36e 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 _0x8d59=['$gte','format','utc','$lte','subtract','name','isArray','limit','map','indexOf','priority','cast','unsigned','substr','col','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','\x22{EXPR}\x22','forEach','replace','push','{EXPR}','join','getOptions','$id','query','model','intersection','attributes','nolimit','offset','order','sort','where','pick','filters','filter','value','merge','type','VIRTUAL','lower','options','includeAll','include','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','alias','raw','fields','split','DATE','isPlainObject'];(function(_0x2b7a48,_0x33ccde){var _0x2323ae=function(_0x2b66cb){while(--_0x2b66cb){_0x2b7a48['push'](_0x2b7a48['shift']());}};_0x2323ae(++_0x33ccde);}(_0x8d59,0xb9));var _0x98d5=function(_0x3d7f84,_0x4221b4){_0x3d7f84=_0x3d7f84-0x0;var _0x448c24=_0x8d59[_0x3d7f84];return _0x448c24;};'use strict';var _=require(_0x98d5('0x0'));var sequelize=require(_0x98d5('0x1'));var moment=require(_0x98d5('0x2'));var db=require(_0x98d5('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2040ea){var _0x47d6ff=['ne'];try{var _0x3bfca1=JSON[_0x98d5('0x4')](_0x2040ea);var _0x54c41f=Object[_0x98d5('0x5')](_0x3bfca1)[0x0];return _0x47d6ff[_0x98d5('0x6')](_0x54c41f);}catch(_0x5ca7c9){return![];}}function getOperatorValue(_0x36b509){var _0x2daf46=JSON[_0x98d5('0x4')](_0x36b509);var _0x278e4f=Object[_0x98d5('0x5')](_0x2daf46)[0x0];var _0x139e4a=_0x2daf46[_0x278e4f];return{['$'+_0x278e4f]:_0x139e4a};}function parseIncludeModel(_0x29b24b){var _0x2b3b66=JSON[_0x98d5('0x4')](_0x29b24b);return{'model':db[_0x2b3b66['model']],'as':_0x2b3b66[_0x98d5('0x7')],'attributes':_0x2b3b66['fields'],'raw':_0x2b3b66[_0x98d5('0x8')]};}exports[_0x98d5('0x9')]=function(_0x336d71){var _0x17edfd=null;if(_0x336d71){_0x17edfd=_0x336d71[_0x98d5('0xa')](',');}return _0x17edfd;};exports['filters']=function(_0x414230,_0x1b8813){var _0x85067a={};if(!_['isEmpty'](_0x414230)){_['forOwn'](_0x414230,function(_0x300cd6,_0x20592e){try{if(_0x1b8813){var _0x30487d=_['find'](_0x1b8813,{'name':_0x20592e})||{};if(hasSequelizeOperator(_0x300cd6)){_0x85067a[_0x20592e]=getOperatorValue(_0x300cd6);}else if(_0x30487d['type']===_0x98d5('0xb')&&_[_0x98d5('0xc')](_0x300cd6)){var _0x2265b9=JSON[_0x98d5('0x4')](_0x300cd6);var _0x2760d7={'$gte':moment(moment(_0x2265b9[_0x98d5('0xd')])[_0x98d5('0xe')]('YYYY-MM-DD'))[_0x98d5('0xf')]()[_0x98d5('0xe')](),'$lte':moment(moment(_0x2265b9[_0x98d5('0x10')])[_0x98d5('0xe')]('YYYY-MM-DD'))[_0x98d5('0xf')]()[_0x98d5('0x11')](0x1,'s')[_0x98d5('0xe')]()};_0x85067a[_0x20592e]=_0x2760d7;}else if(_0x30487d[_0x98d5('0x12')]==='uniqueid'){_0x85067a[_0x20592e]=_0x300cd6;}else{_0x85067a[_0x20592e]=_[_0x98d5('0x13')](_0x300cd6)?_0x300cd6:JSON[_0x98d5('0x4')](_0x300cd6);}}else{_0x85067a[_0x20592e]=_[_0x98d5('0x13')](_0x300cd6)?_0x300cd6:JSON[_0x98d5('0x4')](_0x300cd6);}}catch(_0x4be78d){_0x85067a[_0x20592e]=_0x300cd6[_0x98d5('0xa')](',');}});}return _0x85067a;};exports[_0x98d5('0x14')]=function(_0x5d79c8){_0x5d79c8=parseInt(_0x5d79c8,0xa);if(!_0x5d79c8||_0x5d79c8<0x0){_0x5d79c8=LIMIT_VALUE;}return _0x5d79c8;};exports['offset']=function(_0x462bbf){_0x462bbf=parseInt(_0x462bbf,0xa);if(!_0x462bbf||_0x462bbf<0x0){_0x462bbf=0x0;}return _0x462bbf;};exports['sort']=function(_0x7db8dd){var _0xe6cbb0,_0x228322=null;if(_0x7db8dd){_0xe6cbb0=_0x7db8dd[_0x98d5('0xa')](',');_0x228322=_[_0x98d5('0x15')](_0xe6cbb0,function(_0x11b015){if(_0x11b015[_0x98d5('0x16')]('-')===0x0){return[_0x11b015===_0x98d5('0x17')?sequelize[_0x98d5('0x18')](sequelize['col']('priority'),_0x98d5('0x19')):_0x11b015[_0x98d5('0x1a')](0x1),'DESC'];}else{return[_0x11b015===_0x98d5('0x17')?sequelize[_0x98d5('0x18')](sequelize[_0x98d5('0x1b')](_0x98d5('0x17')),_0x98d5('0x19')):_0x11b015,'ASC'];}});}return _0x228322;};exports[_0x98d5('0x1c')]=function(_0x119a80,_0x202ab5){if(_['isEmpty'](_0x119a80)){return _0x119a80;}if(_[_0x98d5('0x13')](_0x119a80)){for(var _0x415db8=0x0;_0x415db8<_0x119a80[_0x98d5('0x1d')];_0x415db8+=0x1){_0x119a80[_0x415db8]=this[_0x98d5('0x1c')](_0x119a80[_0x415db8],_0x202ab5);}return _0x119a80;}if(!_[_0x98d5('0x1e')](_0x119a80)){return _0x119a80;}if(_[_0x98d5('0x1f')](_0x202ab5)){_0x202ab5=[_0x202ab5];}if(!_[_0x98d5('0x13')](_0x202ab5)){return _0x119a80;}for(var _0x4d8f7b=0x0;_0x4d8f7b<_0x202ab5[_0x98d5('0x1d')];_0x4d8f7b+=0x1){_[_0x98d5('0x20')](_0x119a80,_0x202ab5[_0x4d8f7b]);}for(var _0x4aab56 in _0x119a80){if(_0x119a80[_0x98d5('0x21')](_0x4aab56)){_0x119a80[_0x4aab56]=this['omit'](_0x119a80[_0x4aab56],_0x202ab5);}}return _0x119a80;};exports[_0x98d5('0x22')]=function(_0xe47a8b){return _0xe47a8b[_0x98d5('0x23')](RegExp(_0x98d5('0x24')))?!![]:![];};exports['isEmail']=function(_0x384a6b){return _0x384a6b['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x98d5('0x25')]=function(_0x2e6d64,_0x1be95b){var _0x126e86=[];var _0x7eaa00=/[ `!@#$%^&*()_\-?~]/;var _0x5da095=_0x1be95b?_0x98d5('0x26'):'{EXPR}';_0x2e6d64[_0x98d5('0xa')](/[ ,]+/)[_0x98d5('0x27')](function(_0x421c43){_0x421c43=_0x421c43[_0x98d5('0x28')](/([^:]")"+/g,'$1');_0x421c43='+'+_0x421c43+'*';var _0x226b95=_0x421c43['match'](_0x7eaa00);if(_0x226b95){_0x421c43='\x22'+_0x421c43+'\x22';}_0x126e86[_0x98d5('0x29')](_0x421c43);});_0x5da095=_0x5da095['replace'](_0x98d5('0x2a'),_0x126e86[_0x98d5('0x2b')]('\x20'));return _0x5da095;};exports[_0x98d5('0x2c')]=function(_0x513b1b,_0x486c93,_0x274512){var _0x48dc18={},_0x4d12b2={};if(_0x486c93['query'][_0x98d5('0x2d')]){_0x486c93[_0x98d5('0x2e')]['id']=_0x486c93[_0x98d5('0x2e')]['$id'];delete _0x486c93[_0x98d5('0x2e')][_0x98d5('0x2d')];}_0x48dc18[_0x98d5('0x2f')]=_[_0x98d5('0x15')](_0x513b1b,_0x98d5('0x12'));_0x48dc18['query']=_[_0x98d5('0x5')](_0x486c93[_0x98d5('0x2e')]);_0x48dc18['filters']=_[_0x98d5('0x30')](_0x48dc18[_0x98d5('0x2f')],_0x48dc18[_0x98d5('0x2e')]);_0x4d12b2['attributes']=_[_0x98d5('0x30')](_0x48dc18[_0x98d5('0x2f')],this[_0x98d5('0x9')](_0x486c93[_0x98d5('0x2e')][_0x98d5('0x9')]));_0x4d12b2[_0x98d5('0x31')]=_0x4d12b2[_0x98d5('0x31')][_0x98d5('0x1d')]?_0x4d12b2[_0x98d5('0x31')]:_0x48dc18['model'];if(!_0x486c93[_0x98d5('0x2e')][_0x98d5('0x21')](_0x98d5('0x32'))){_0x4d12b2['limit']=this[_0x98d5('0x14')](_0x486c93['query'][_0x98d5('0x14')]);_0x4d12b2[_0x98d5('0x33')]=this[_0x98d5('0x33')](_0x486c93[_0x98d5('0x2e')]['offset']);}_0x4d12b2[_0x98d5('0x34')]=this[_0x98d5('0x35')](_0x486c93[_0x98d5('0x2e')][_0x98d5('0x35')]);_0x4d12b2[_0x98d5('0x36')]=this['filters'](_[_0x98d5('0x37')](_0x486c93['query'],_0x48dc18[_0x98d5('0x38')]),_0x513b1b);if(_0x486c93['query'][_0x98d5('0x39')]){var _0x42e509=_0x513b1b;var _0x4ca099=_0x486c93[_0x98d5('0x2e')]['filter'];if(typeof _0x4ca099==='object'){_0x42e509=_['filter'](_0x513b1b,function(_0x59c864){return _[_0x98d5('0x6')](_0x4ca099['columns'],_0x59c864['name']);});_0x4ca099=_0x4ca099[_0x98d5('0x3a')];}_0x4d12b2[_0x98d5('0x36')]=_[_0x98d5('0x3b')](_0x4d12b2[_0x98d5('0x36')],{'$or':_[_0x98d5('0x15')](_0x42e509,function(_0x45905f){if(_0x45905f[_0x98d5('0x3c')]!==_0x98d5('0x3d')){if(_0x274512){return sequelize[_0x98d5('0x36')](sequelize['fn'](_0x98d5('0x3e'),sequelize[_0x98d5('0x1b')](_0x45905f[_0x98d5('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x486c93[_0x98d5('0x2e')][_0x98d5('0x39')]+'%')});}else{var _0x3fa809={};_0x3fa809[_0x45905f[_0x98d5('0x12')]]={'$like':'%'+_0x486c93[_0x98d5('0x2e')][_0x98d5('0x39')]+'%'};return _0x3fa809;}}})});}_0x4d12b2=_[_0x98d5('0x3b')]({},_0x4d12b2,_0x486c93[_0x98d5('0x3f')]);return _0x4d12b2;};exports['include']=function(_0x407b48){var _0x5b92d4=[];if(_0x407b48[_0x98d5('0x40')]){_0x5b92d4[_0x98d5('0x29')]({'all':!![]});}else if(_0x407b48[_0x98d5('0x41')]){if(Array['isArray'](_0x407b48[_0x98d5('0x41')])){_0x5b92d4=Object[_0x98d5('0x5')](_0x407b48[_0x98d5('0x41')])[_0x98d5('0x15')](function(_0x456dfc){return parseIncludeModel(_0x407b48[_0x98d5('0x41')][_0x456dfc]);});}else{var _0x25cf7e=parseIncludeModel(_0x407b48['include']);_0x5b92d4['push'](_0x25cf7e);}}return _0x5b92d4;}; \ No newline at end of file +var _0x8a8b=['isArray','limit','offset','sort','map','priority','col','unsigned','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','{EXPR}','join','getOptions','query','$id','model','intersection','attributes','nolimit','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','include','push','lodash','../../mysqldb','includes','parse','keys','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid'];(function(_0x112561,_0x3006ec){var _0x4311d4=function(_0x4cd5d5){while(--_0x4cd5d5){_0x112561['push'](_0x112561['shift']());}};_0x4311d4(++_0x3006ec);}(_0x8a8b,0xae));var _0xb8a8=function(_0x1cf66b,_0x58035b){_0x1cf66b=_0x1cf66b-0x0;var _0x325300=_0x8a8b[_0x1cf66b];return _0x325300;};'use strict';var _=require(_0xb8a8('0x0'));var sequelize=require('sequelize');var moment=require('moment');var db=require(_0xb8a8('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x308da3){var _0x4f56d4=['ne'];try{var _0x13bc8b=JSON['parse'](_0x308da3);var _0xca9854=Object['keys'](_0x13bc8b)[0x0];return _0x4f56d4[_0xb8a8('0x2')](_0xca9854);}catch(_0x372822){return![];}}function getOperatorValue(_0xcca5ca){var _0x578e1b=JSON[_0xb8a8('0x3')](_0xcca5ca);var _0x59cf56=Object[_0xb8a8('0x4')](_0x578e1b)[0x0];var _0x4c46e9=_0x578e1b[_0x59cf56];return{['$'+_0x59cf56]:_0x4c46e9};}function parseIncludeModel(_0x79cb4a){var _0x363bae=JSON[_0xb8a8('0x3')](_0x79cb4a);return{'model':db[_0x363bae['model']],'as':_0x363bae[_0xb8a8('0x5')],'attributes':_0x363bae[_0xb8a8('0x6')],'raw':_0x363bae[_0xb8a8('0x7')]};}exports[_0xb8a8('0x6')]=function(_0x3ea7ad){var _0x42cb78=null;if(_0x3ea7ad){_0x42cb78=_0x3ea7ad[_0xb8a8('0x8')](',');}return _0x42cb78;};exports[_0xb8a8('0x9')]=function(_0x477cd4,_0x3d47ce){var _0x3baf33={};if(!_[_0xb8a8('0xa')](_0x477cd4)){_[_0xb8a8('0xb')](_0x477cd4,function(_0x5278f8,_0x376608){try{if(_0x3d47ce){var _0x2fe2b5=_[_0xb8a8('0xc')](_0x3d47ce,{'name':_0x376608})||{};if(hasSequelizeOperator(_0x5278f8)){_0x3baf33[_0x376608]=getOperatorValue(_0x5278f8);}else if(_0x2fe2b5[_0xb8a8('0xd')]===_0xb8a8('0xe')&&_[_0xb8a8('0xf')](_0x5278f8)){var _0x3cf353=JSON[_0xb8a8('0x3')](_0x5278f8);var _0x22e0ac={'$gte':moment(moment(_0x3cf353[_0xb8a8('0x10')])[_0xb8a8('0x11')]('YYYY-MM-DD'))[_0xb8a8('0x12')]()['format'](),'$lte':moment(moment(_0x3cf353[_0xb8a8('0x13')])[_0xb8a8('0x11')](_0xb8a8('0x14')))[_0xb8a8('0x12')]()[_0xb8a8('0x15')](0x1,'s')[_0xb8a8('0x11')]()};_0x3baf33[_0x376608]=_0x22e0ac;}else if(_0x2fe2b5[_0xb8a8('0x16')]===_0xb8a8('0x17')){_0x3baf33[_0x376608]=_0x5278f8;}else{_0x3baf33[_0x376608]=_['isArray'](_0x5278f8)?_0x5278f8:JSON['parse'](_0x5278f8);}}else{_0x3baf33[_0x376608]=_[_0xb8a8('0x18')](_0x5278f8)?_0x5278f8:JSON['parse'](_0x5278f8);}}catch(_0x51fbce){_0x3baf33[_0x376608]=_0x5278f8['split'](',');}});}return _0x3baf33;};exports[_0xb8a8('0x19')]=function(_0x44cdee){_0x44cdee=parseInt(_0x44cdee,0xa);if(!_0x44cdee||_0x44cdee<0x0){_0x44cdee=LIMIT_VALUE;}return _0x44cdee;};exports[_0xb8a8('0x1a')]=function(_0xe68165){_0xe68165=parseInt(_0xe68165,0xa);if(!_0xe68165||_0xe68165<0x0){_0xe68165=0x0;}return _0xe68165;};exports[_0xb8a8('0x1b')]=function(_0x27ab83){var _0x5ecac7,_0x17c2b8=null;if(_0x27ab83){_0x5ecac7=_0x27ab83[_0xb8a8('0x8')](',');_0x17c2b8=_[_0xb8a8('0x1c')](_0x5ecac7,function(_0x4429eb){if(_0x4429eb['indexOf']('-')===0x0){return[_0x4429eb===_0xb8a8('0x1d')?sequelize['cast'](sequelize[_0xb8a8('0x1e')]('priority'),_0xb8a8('0x1f')):_0x4429eb['substr'](0x1),'DESC'];}else{return[_0x4429eb==='priority'?sequelize['cast'](sequelize[_0xb8a8('0x1e')](_0xb8a8('0x1d')),_0xb8a8('0x1f')):_0x4429eb,_0xb8a8('0x20')];}});}return _0x17c2b8;};exports[_0xb8a8('0x21')]=function(_0x4b6c93,_0x375db6){if(_[_0xb8a8('0xa')](_0x4b6c93)){return _0x4b6c93;}if(_[_0xb8a8('0x18')](_0x4b6c93)){for(var _0x2d26fa=0x0;_0x2d26fa<_0x4b6c93[_0xb8a8('0x22')];_0x2d26fa+=0x1){_0x4b6c93[_0x2d26fa]=this['omit'](_0x4b6c93[_0x2d26fa],_0x375db6);}return _0x4b6c93;}if(!_[_0xb8a8('0x23')](_0x4b6c93)){return _0x4b6c93;}if(_[_0xb8a8('0x24')](_0x375db6)){_0x375db6=[_0x375db6];}if(!_[_0xb8a8('0x18')](_0x375db6)){return _0x4b6c93;}for(var _0x1e7403=0x0;_0x1e7403<_0x375db6[_0xb8a8('0x22')];_0x1e7403+=0x1){_['unset'](_0x4b6c93,_0x375db6[_0x1e7403]);}for(var _0x4aec01 in _0x4b6c93){if(_0x4b6c93[_0xb8a8('0x25')](_0x4aec01)){_0x4b6c93[_0x4aec01]=this[_0xb8a8('0x21')](_0x4b6c93[_0x4aec01],_0x375db6);}}return _0x4b6c93;};exports[_0xb8a8('0x26')]=function(_0x3c2bea){return _0x3c2bea[_0xb8a8('0x27')](RegExp(_0xb8a8('0x28')))?!![]:![];};exports[_0xb8a8('0x29')]=function(_0x45049){return _0x45049[_0xb8a8('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0xb8a8('0x2a')]=function(_0x527c1d,_0x5aa416){var _0x180b39=[];var _0x2457ff=/[ `!@#$%^&*()_\-?~]/;var _0x44be3b=_0x5aa416?'\x22{EXPR}\x22':'{EXPR}';_0x527c1d['split'](/[ ,]+/)['forEach'](function(_0x5f1b59){_0x5f1b59=_0x5f1b59[_0xb8a8('0x2b')](/([^:]")"+/g,'$1');_0x5f1b59='+'+_0x5f1b59+'*';var _0x1baf40=_0x5f1b59[_0xb8a8('0x27')](_0x2457ff);if(_0x1baf40){_0x5f1b59='\x22'+_0x5f1b59+'\x22';}_0x180b39['push'](_0x5f1b59);});_0x44be3b=_0x44be3b[_0xb8a8('0x2b')](_0xb8a8('0x2c'),_0x180b39[_0xb8a8('0x2d')]('\x20'));return _0x44be3b;};exports[_0xb8a8('0x2e')]=function(_0x38039b,_0x450b5d,_0x5be00a){var _0x2bb89f={},_0x87dd06={};if(_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x30')]){_0x450b5d[_0xb8a8('0x2f')]['id']=_0x450b5d[_0xb8a8('0x2f')]['$id'];delete _0x450b5d['query'][_0xb8a8('0x30')];}_0x2bb89f[_0xb8a8('0x31')]=_[_0xb8a8('0x1c')](_0x38039b,_0xb8a8('0x16'));_0x2bb89f[_0xb8a8('0x2f')]=_[_0xb8a8('0x4')](_0x450b5d[_0xb8a8('0x2f')]);_0x2bb89f['filters']=_[_0xb8a8('0x32')](_0x2bb89f[_0xb8a8('0x31')],_0x2bb89f[_0xb8a8('0x2f')]);_0x87dd06[_0xb8a8('0x33')]=_[_0xb8a8('0x32')](_0x2bb89f[_0xb8a8('0x31')],this[_0xb8a8('0x6')](_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x6')]));_0x87dd06[_0xb8a8('0x33')]=_0x87dd06[_0xb8a8('0x33')][_0xb8a8('0x22')]?_0x87dd06[_0xb8a8('0x33')]:_0x2bb89f[_0xb8a8('0x31')];if(!_0x450b5d['query'][_0xb8a8('0x25')](_0xb8a8('0x34'))){_0x87dd06[_0xb8a8('0x19')]=this[_0xb8a8('0x19')](_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x19')]);_0x87dd06[_0xb8a8('0x1a')]=this[_0xb8a8('0x1a')](_0x450b5d['query'][_0xb8a8('0x1a')]);}_0x87dd06[_0xb8a8('0x35')]=this[_0xb8a8('0x1b')](_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x1b')]);_0x87dd06[_0xb8a8('0x36')]=this[_0xb8a8('0x9')](_[_0xb8a8('0x37')](_0x450b5d['query'],_0x2bb89f[_0xb8a8('0x9')]),_0x38039b);if(_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x38')]){var _0x4d0f99=_0x38039b;var _0x3590ac=_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x38')];if(typeof _0x3590ac===_0xb8a8('0x39')){_0x4d0f99=_['filter'](_0x38039b,function(_0x37e402){return _['includes'](_0x3590ac[_0xb8a8('0x3a')],_0x37e402['name']);});_0x3590ac=_0x3590ac[_0xb8a8('0x3b')];}_0x87dd06[_0xb8a8('0x36')]=_[_0xb8a8('0x3c')](_0x87dd06[_0xb8a8('0x36')],{'$or':_[_0xb8a8('0x1c')](_0x4d0f99,function(_0x2d2a5b){if(_0x2d2a5b[_0xb8a8('0xd')]!==_0xb8a8('0x3d')){if(_0x5be00a){return sequelize[_0xb8a8('0x36')](sequelize['fn'](_0xb8a8('0x3e'),sequelize[_0xb8a8('0x1e')](_0x2d2a5b[_0xb8a8('0x16')])),{'$like':sequelize['fn'](_0xb8a8('0x3e'),'%'+_0x450b5d[_0xb8a8('0x2f')]['filter']+'%')});}else{var _0x2bba38={};_0x2bba38[_0x2d2a5b['name']]={'$like':'%'+_0x450b5d[_0xb8a8('0x2f')][_0xb8a8('0x38')]+'%'};return _0x2bba38;}}})});}_0x87dd06=_[_0xb8a8('0x3c')]({},_0x87dd06,_0x450b5d[_0xb8a8('0x3f')]);return _0x87dd06;};exports[_0xb8a8('0x40')]=function(_0x26bf7a){var _0x244e7c=[];if(_0x26bf7a['includeAll']){_0x244e7c[_0xb8a8('0x41')]({'all':!![]});}else if(_0x26bf7a[_0xb8a8('0x40')]){if(Array[_0xb8a8('0x18')](_0x26bf7a['include'])){_0x244e7c=Object[_0xb8a8('0x4')](_0x26bf7a[_0xb8a8('0x40')])['map'](function(_0x5420f9){return parseIncludeModel(_0x26bf7a[_0xb8a8('0x40')][_0x5420f9]);});}else{var _0x45e3d3=parseIncludeModel(_0x26bf7a[_0xb8a8('0x40')]);_0x244e7c['push'](_0x45e3d3);}}return _0x244e7c;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index c8e56a7..7897122 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','filterAgentAttributes','openchannelStatusTime','voiceStatusTime','faxCapacity','chatCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','findAll','name','fullname','openchannelPause','whatsappPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','fullname,internal','indexOf','internal','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity'];(function(_0x1ea640,_0x14f725){var _0x12ad27=function(_0x55f554){while(--_0x55f554){_0x1ea640['push'](_0x1ea640['shift']());}};_0x12ad27(++_0x14f725);}(_0x814b,0x1a2));var _0xb814=function(_0x44ea17,_0x422059){_0x44ea17=_0x44ea17-0x0;var _0x1d8af1=_0x814b[_0x44ea17];return _0x1d8af1;};'use strict';var _=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var db=require(_0xb814('0x2'))['db'];var amiClient=jayson[_0xb814('0x3')][_0xb814('0x4')]({'port':0x232a});var routingClient=jayson[_0xb814('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x38c21a,_0x3e1e9){var _0x258866=[_0x38c21a[_0xb814('0x5')],_0x38c21a[_0xb814('0x6')],_0x38c21a[_0xb814('0x7')],_0x38c21a['openchannelPause'],_0x38c21a[_0xb814('0x8')],_0x38c21a[_0xb814('0x9')],_0x38c21a['whatsappPause']];if(!_0x3e1e9)return _[_0xb814('0xa')](_0x258866);var _0x2913a6=_[_0xb814('0xb')](_0x258866);return _0x2913a6[_0xb814('0xc')]>0x0&&_0x2913a6[_0xb814('0xc')]<_0x258866[_0xb814('0xc')]?!![]:![];}function isIdle(_0x1086f8){return _0x1086f8===_0xb814('0xd')||_0x1086f8===_0xb814('0xe')||_0x1086f8===_0xb814('0xf')||_0x1086f8===_0xb814('0x10')||_['isNil'](_0x1086f8);}function isAgentIdle(_0x43dfe6){if(_0x43dfe6['voiceStatus']!==_0xb814('0xd')&&_0x43dfe6[_0xb814('0x9')]){_0x43dfe6[_0xb814('0x11')]=_0xb814('0x12');return![];}return _[_0xb814('0xa')]([_0x43dfe6[_0xb814('0x13')],_0x43dfe6[_0xb814('0x14')],_0x43dfe6[_0xb814('0x15')],_0x43dfe6[_0xb814('0x16')],_0x43dfe6[_0xb814('0x17')],_0x43dfe6[_0xb814('0x11')],_0x43dfe6[_0xb814('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb814('0x19')](_0xb814('0x1a'),{})[_0xb814('0x1b')](function(_0x3a71d6){if(_0x3a71d6[_0xb814('0x1c')]){throw new Error(_0xb814('0x1d'));}var _0x125ce2=_0x3a71d6[_0xb814('0x1e')];return routingClient[_0xb814('0x19')]('Agents',{})[_0xb814('0x1b')](function(_0x55ba16){if(_0x55ba16[_0xb814('0x1c')]){throw new Error(_0xb814('0x1f'));}var _0x4c3007=_0x55ba16['result'];return _['merge']({},_0x125ce2,_0x4c3007);});})[_0xb814('0x20')](function(_0x4d5276){throw _0x4d5276;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0xb684ea){var _0x24211d=_0xb814('0xe');if(isAgentPaused(_0xb684ea))_0x24211d='pause';else if(isAgentPaused(_0xb684ea,!![]))_0x24211d=_0xb814('0x21');else if(isAgentIdle(_0xb684ea))_0x24211d='idle';else _0x24211d=_0xb814('0x22');return _0x24211d;}exports[_0xb814('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x3b267e,_0x470e81){var _0x27352e=_[_0xb814('0x24')](_0x3b267e)?_0x3b267e:[_0x3b267e];var _0x1f5d40=_['startCase'](_0x470e81)+_0xb814('0x25');var _0x52b7a3=_[_0xb814('0x26')](_0x27352e,function(_0x457dac){return db[_0x1f5d40][_0xb814('0x27')]({'where':{'id':_0x457dac}})[_0xb814('0x1b')](function(_0x1c8a2e){if(!_0x1c8a2e)return[];return _0x1c8a2e[_0xb814('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb814('0x29')](_0x52b7a3)['then'](function(_0x392222){var _0xc0ef66=_(_0x392222)[_0xb814('0x2a')]()[_0xb814('0x26')]('id')[_0xb814('0x2b')]()[_0xb814('0x2c')]();return _0xc0ef66;});}exports[_0xb814('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1e4e89,_0x5a6291,_0x271aa8){try{if(_0x5a6291[_0xb814('0xc')]>0x0){_0x1e4e89=_0x1e4e89['filter'](function(_0x9008b2){return _0x5a6291[_0xb814('0x2e')](_0x9008b2['id']);});}var _0x530744=_0x1e4e89['filter'](function(_0x20577b){var _0x2051d0='busy';if(isAgentIdle(_0x20577b)){_0x2051d0=_0xb814('0xd');}return _0x2051d0===_0x271aa8;});return _['map'](_0x530744,'id');}catch(_0x6efe9a){throw _0x6efe9a;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4cfc58,_0x419cd9,_0x4a4f27){return Promise[_0xb814('0x2f')]()[_0xb814('0x1b')](function(){if(_0x419cd9[_0xb814('0xc')]>0x0){_0x4cfc58=_0x4cfc58['filter'](function(_0x51d5ae){return _0x419cd9[_0xb814('0x2e')](_0x51d5ae['id']);});}return _0x4cfc58;})[_0xb814('0x1b')](function(){return db['User'][_0xb814('0x30')]({'attributes':['id',_0xb814('0x31'),_0xb814('0x32'),_0xb814('0x5'),_0xb814('0x6'),_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),_0xb814('0x35')],'where':{'id':{'$in':_[_0xb814('0x26')](_0x4cfc58,'id')}},'raw':!![]});})[_0xb814('0x1b')](function(_0x4ff31a){return _0x4ff31a[_0xb814('0x26')](function(_0x57e6e6){var _0x43db67=_[_0xb814('0x36')](_0x4cfc58,['id',_0x57e6e6['id']]);var _0xe0f509=filterAgentAttributes(_0x43db67);_['merge'](_0x57e6e6,_0xe0f509);_0x57e6e6[_0xb814('0x37')]=getAgentStatus(_0x57e6e6);return _0x57e6e6;});})[_0xb814('0x1b')](function(_0x4ea6f8){var _0x2fcd92=sortAgentsByStatus(_0x4ea6f8,_0x4a4f27);return _[_0xb814('0x26')](_0x2fcd92,'id');})[_0xb814('0x20')](function(_0x1f7cd8){throw _0x1f7cd8;});}exports[_0xb814('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x467cf9){var _0x4d81eb={'fields':[],'order':null};var _0xa6ce87=_0x467cf9['split'](',');_0x4d81eb[_0xb814('0x39')]=_['filter'](_0xa6ce87,function(_0x4492ef){if(!_0x4492ef['includes'](_0xb814('0x37'))){return!![];}_0x4d81eb[_0xb814('0x3a')]=_['startsWith'](_0x4492ef,'-')?'DESC':'ASC';return![];});return _0x4d81eb;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x17549e){if(!_0x17549e){_0x17549e=_0xb814('0x3b');}if(_0x17549e[_0xb814('0x2e')](_0xb814('0x32'))&&!_0x17549e['includes']('internal')){var _0x6f15d3=_0x17549e['substring'](0x0,_0x17549e[_0xb814('0x3c')](_0xb814('0x32')));_0x17549e+=','+_0x6f15d3+_0xb814('0x3d');}return _0x17549e;}exports[_0xb814('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x42653f,_0x37369f){var _0x3b7f5a=_0x42653f[_0xb814('0x3f')](function(_0x31989d,_0x4b6ff8){if(_0x31989d['globalStatus']===_0x4b6ff8['globalStatus']){if(_0x31989d[_0xb814('0x37')]==='pause'){if(_0x37369f===_0xb814('0x40')){return(_0x31989d['pauseType']||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x31989d[_0xb814('0x35')]||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?-0x1:0x1;}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?0x1:-0x1;}else{return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?0x1:-0x1;}else{return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?-0x1:0x1;}}});return _0x3b7f5a;}exports[_0xb814('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x40e627){var _0x24b697=[_0xb814('0x43'),_0xb814('0x44'),_0xb814('0x45'),_0xb814('0x46'),'pauseType',_0xb814('0x46'),_0xb814('0x3d'),'address',_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),_0xb814('0x8'),_0xb814('0x34'),_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x47'),_0xb814('0x48'),_0xb814('0x49'),_0xb814('0x4a'),_0xb814('0x4b'),'faxCapacity','chatCurrentCapacity',_0xb814('0x4c'),_0xb814('0x4d'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x50'),_0xb814('0x13'),_0xb814('0x16'),'mailStatus',_0xb814('0x17'),_0xb814('0x18'),_0xb814('0x14'),'voiceStatus',_0xb814('0x51'),'openchannelStatusTime',_0xb814('0x52'),'smsStatusTime',_0xb814('0x53'),_0xb814('0x54'),'voiceStatusTime',_0xb814('0x55'),_0xb814('0x56'),_0xb814('0x57'),'phoneBarEnableScreenRecordingByAgent',_0xb814('0x58'),'routealias'];var _0x13bdcf=[_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),'smsPause','whatsappPause',_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x44')];var _0x47a814=_(_0x40e627)[_0xb814('0x59')](_0x13bdcf)['pick'](_0x24b697)[_0xb814('0x2c')]();return _0x47a814;}exports[_0xb814('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xb814('0x32'),'role',_0xb814('0x3d'),_0xb814('0x44'),_0xb814('0x37'),_0xb814('0x43'),_0xb814('0x45'),_0xb814('0x35'),_0xb814('0x46'),_0xb814('0x6'),'chatPause',_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),'chatStatus',_0xb814('0x14'),'mailStatus','openchannelStatus',_0xb814('0x17'),'voiceStatus',_0xb814('0x18'),_0xb814('0x51'),_0xb814('0x54'),'mailStatusTime',_0xb814('0x5b'),'smsStatusTime',_0xb814('0x5c'),_0xb814('0x53'),_0xb814('0x47'),_0xb814('0x5d'),_0xb814('0x49'),_0xb814('0x48'),_0xb814('0x4a'),_0xb814('0x4b'),_0xb814('0x5e'),'faxCurrentCapacity',_0xb814('0x4d'),_0xb814('0x4c'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x5f'),_0xb814('0x58'),'destconnectedlinenum',_0xb814('0x60'),'queue',_0xb814('0x61'),_0xb814('0x57')];}exports[_0xb814('0x62')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x24ca=['find','merge','globalStatus','getSortedAgentsIdsByStatus','fields','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','role','smsCapacity','smsCurrentCapacity','routealias','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','every','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','error','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','User','name','fullname','pauseType'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x24ca,0x1bc));var _0xa24c=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x24ca[_0x903228];return _0xcec81d;};'use strict';var _=require(_0xa24c('0x0'));var jayson=require('jayson/promise');var db=require(_0xa24c('0x1'))['db'];var amiClient=jayson[_0xa24c('0x2')][_0xa24c('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0xa24c('0x3')]({'port':0x232c});function isAgentPaused(_0x8a54a0,_0x195e60){var _0x28aa2f=[_0x8a54a0[_0xa24c('0x4')],_0x8a54a0[_0xa24c('0x5')],_0x8a54a0[_0xa24c('0x6')],_0x8a54a0[_0xa24c('0x7')],_0x8a54a0[_0xa24c('0x8')],_0x8a54a0[_0xa24c('0x9')],_0x8a54a0[_0xa24c('0xa')]];if(!_0x195e60)return _['every'](_0x28aa2f);var _0x42d89c=_[_0xa24c('0xb')](_0x28aa2f);return _0x42d89c[_0xa24c('0xc')]>0x0&&_0x42d89c['length']<_0x28aa2f[_0xa24c('0xc')]?!![]:![];}function isIdle(_0x325c6d){return _0x325c6d===_0xa24c('0xd')||_0x325c6d===_0xa24c('0xe')||_0x325c6d===_0xa24c('0xf')||_0x325c6d===_0xa24c('0x10')||_[_0xa24c('0x11')](_0x325c6d);}function isAgentIdle(_0xc82af0){if(_0xc82af0[_0xa24c('0x12')]!=='idle'&&_0xc82af0[_0xa24c('0x9')]){_0xc82af0[_0xa24c('0x12')]=_0xa24c('0x13');return![];}return _[_0xa24c('0x14')]([_0xc82af0['chatStatus'],_0xc82af0[_0xa24c('0x15')],_0xc82af0[_0xa24c('0x16')],_0xc82af0[_0xa24c('0x17')],_0xc82af0[_0xa24c('0x18')],_0xc82af0[_0xa24c('0x12')],_0xc82af0[_0xa24c('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa24c('0x1a')]('Agents',{})['then'](function(_0xb80781){if(_0xb80781[_0xa24c('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x5babb5=_0xb80781[_0xa24c('0x1c')];return routingClient[_0xa24c('0x1a')]('Agents',{})[_0xa24c('0x1d')](function(_0x5de3e6){if(_0x5de3e6[_0xa24c('0x1b')]){throw new Error(_0xa24c('0x1e'));}var _0x1fcd4b=_0x5de3e6[_0xa24c('0x1c')];return _['merge']({},_0x5babb5,_0x1fcd4b);});})[_0xa24c('0x1f')](function(_0x18b7e0){throw _0x18b7e0;});}exports[_0xa24c('0x20')]=getRealtimeAgents;function getAgentStatus(_0x4d4bab){var _0x48a768='unknown';if(isAgentPaused(_0x4d4bab))_0x48a768='pause';else if(isAgentPaused(_0x4d4bab,!![]))_0x48a768=_0xa24c('0x21');else if(isAgentIdle(_0x4d4bab))_0x48a768=_0xa24c('0xd');else _0x48a768=_0xa24c('0x22');return _0x48a768;}exports[_0xa24c('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x51a275,_0x30ec21){var _0x5f299e=_[_0xa24c('0x24')](_0x51a275)?_0x51a275:[_0x51a275];var _0xb81d97=_['startCase'](_0x30ec21)+_0xa24c('0x25');var _0x363d52=_[_0xa24c('0x26')](_0x5f299e,function(_0x188ee2){return db[_0xb81d97][_0xa24c('0x27')]({'where':{'id':_0x188ee2}})['then'](function(_0xec9167){if(!_0xec9167)return[];return _0xec9167['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xa24c('0x28')](_0x363d52)[_0xa24c('0x1d')](function(_0x294685){var _0x51dc3f=_(_0x294685)[_0xa24c('0x29')]()[_0xa24c('0x26')]('id')[_0xa24c('0x2a')]()[_0xa24c('0x2b')]();return _0x51dc3f;});}exports[_0xa24c('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3ad0e6,_0x39609a,_0x5b23f4){try{if(_0x39609a[_0xa24c('0xc')]>0x0){_0x3ad0e6=_0x3ad0e6[_0xa24c('0xb')](function(_0x152120){return _0x39609a[_0xa24c('0x2d')](_0x152120['id']);});}var _0x5e491e=_0x3ad0e6[_0xa24c('0xb')](function(_0xc96ce7){var _0x97c08='busy';if(isAgentIdle(_0xc96ce7)){_0x97c08=_0xa24c('0xd');}return _0x97c08===_0x5b23f4;});return _[_0xa24c('0x26')](_0x5e491e,'id');}catch(_0x253d83){throw _0x253d83;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x245fb2,_0x5e0226,_0x1102ab){return Promise[_0xa24c('0x2e')]()[_0xa24c('0x1d')](function(){if(_0x5e0226['length']>0x0){_0x245fb2=_0x245fb2[_0xa24c('0xb')](function(_0x53f90){return _0x5e0226[_0xa24c('0x2d')](_0x53f90['id']);});}return _0x245fb2;})['then'](function(){return db[_0xa24c('0x2f')]['findAll']({'attributes':['id',_0xa24c('0x30'),_0xa24c('0x31'),'chatPause','faxPause',_0xa24c('0x6'),_0xa24c('0x7'),_0xa24c('0x8'),_0xa24c('0x9'),_0xa24c('0xa'),_0xa24c('0x32')],'where':{'id':{'$in':_[_0xa24c('0x26')](_0x245fb2,'id')}},'raw':!![]});})['then'](function(_0x39f146){return _0x39f146[_0xa24c('0x26')](function(_0x12825d){var _0xbd24c0=_[_0xa24c('0x33')](_0x245fb2,['id',_0x12825d['id']]);var _0x31b19d=filterAgentAttributes(_0xbd24c0);_[_0xa24c('0x34')](_0x12825d,_0x31b19d);_0x12825d[_0xa24c('0x35')]=getAgentStatus(_0x12825d);return _0x12825d;});})[_0xa24c('0x1d')](function(_0x129bb9){var _0x4c7a30=sortAgentsByStatus(_0x129bb9,_0x1102ab);return _[_0xa24c('0x26')](_0x4c7a30,'id');})[_0xa24c('0x1f')](function(_0x2b362d){throw _0x2b362d;});}exports[_0xa24c('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x578b72){var _0x56a485={'fields':[],'order':null};var _0x19a65f=_0x578b72['split'](',');_0x56a485[_0xa24c('0x37')]=_[_0xa24c('0xb')](_0x19a65f,function(_0x22a316){if(!_0x22a316[_0xa24c('0x2d')](_0xa24c('0x35'))){return!![];}_0x56a485['order']=_['startsWith'](_0x22a316,'-')?_0xa24c('0x38'):_0xa24c('0x39');return![];});return _0x56a485;}exports[_0xa24c('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x213dc3){if(!_0x213dc3){_0x213dc3=_0xa24c('0x3b');}if(_0x213dc3[_0xa24c('0x2d')]('fullname')&&!_0x213dc3['includes'](_0xa24c('0x3c'))){var _0x1ce83e=_0x213dc3[_0xa24c('0x3d')](0x0,_0x213dc3[_0xa24c('0x3e')](_0xa24c('0x31')));_0x213dc3+=','+_0x1ce83e+'internal';}return _0x213dc3;}exports[_0xa24c('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x7895e,_0x5ef186){var _0x599627=_0x7895e[_0xa24c('0x40')](function(_0x44f6ae,_0x231eea){if(_0x44f6ae['globalStatus']===_0x231eea['globalStatus']){if(_0x44f6ae[_0xa24c('0x35')]===_0xa24c('0x13')){if(_0x5ef186===_0xa24c('0x38')){return(_0x44f6ae[_0xa24c('0x32')]||'')<(_0x231eea[_0xa24c('0x32')]||'')||_0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()>_0x231eea[_0xa24c('0x31')]['toLowerCase']()?0x1:-0x1;}else{return(_0x44f6ae['pauseType']||'')<(_0x231eea[_0xa24c('0x32')]||'')||_0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()>_0x231eea['fullname'][_0xa24c('0x41')]()?-0x1:0x1;}}else{if(_0x5ef186===_0xa24c('0x38')){return _0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()<_0x231eea[_0xa24c('0x31')][_0xa24c('0x41')]()?0x1:-0x1;}else{return _0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()<_0x231eea[_0xa24c('0x31')][_0xa24c('0x41')]()?-0x1:0x1;}}}else{if(_0x5ef186==='DESC'){return _0x44f6ae[_0xa24c('0x35')]<_0x231eea[_0xa24c('0x35')]?0x1:-0x1;}else{return _0x44f6ae[_0xa24c('0x35')]<_0x231eea['globalStatus']?-0x1:0x1;}}});return _0x599627;}exports[_0xa24c('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x247d2c){var _0x3feaf6=[_0xa24c('0x43'),_0xa24c('0x44'),_0xa24c('0x45'),_0xa24c('0x46'),_0xa24c('0x32'),_0xa24c('0x46'),_0xa24c('0x3c'),_0xa24c('0x47'),'chatPause',_0xa24c('0x7'),_0xa24c('0x6'),_0xa24c('0x8'),_0xa24c('0xa'),_0xa24c('0x5'),_0xa24c('0x9'),_0xa24c('0x48'),_0xa24c('0x49'),_0xa24c('0x4a'),'smsCapacity','whatsappCapacity',_0xa24c('0x4b'),'chatCurrentCapacity',_0xa24c('0x4c'),_0xa24c('0x4d'),'smsCurrentCapacity',_0xa24c('0x4e'),_0xa24c('0x4f'),_0xa24c('0x50'),'openchannelStatus','mailStatus',_0xa24c('0x18'),'whatsappStatus',_0xa24c('0x15'),_0xa24c('0x12'),_0xa24c('0x51'),_0xa24c('0x52'),_0xa24c('0x53'),_0xa24c('0x54'),_0xa24c('0x55'),_0xa24c('0x56'),_0xa24c('0x57'),_0xa24c('0x58'),'destconnectedlinenum',_0xa24c('0x59'),_0xa24c('0x5a'),_0xa24c('0x5b'),'routealias'];var _0x5bde94=['chatPause',_0xa24c('0x7'),'mailPause',_0xa24c('0x8'),_0xa24c('0xa'),'faxPause',_0xa24c('0x9'),_0xa24c('0x44')];var _0x131a7a=_(_0x247d2c)[_0xa24c('0x5c')](_0x5bde94)[_0xa24c('0x5d')](_0x3feaf6)[_0xa24c('0x2b')]();return _0x131a7a;}exports[_0xa24c('0x5e')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xa24c('0x30'),'fullname',_0xa24c('0x5f'),'internal','online','globalStatus','userpic','lastLoginAt',_0xa24c('0x32'),'lastPauseAt',_0xa24c('0x5'),_0xa24c('0x4'),_0xa24c('0x6'),_0xa24c('0x7'),_0xa24c('0x8'),_0xa24c('0x9'),_0xa24c('0xa'),_0xa24c('0x50'),_0xa24c('0x15'),_0xa24c('0x16'),_0xa24c('0x17'),_0xa24c('0x18'),_0xa24c('0x12'),_0xa24c('0x19'),_0xa24c('0x51'),'faxStatusTime',_0xa24c('0x53'),_0xa24c('0x52'),'smsStatusTime',_0xa24c('0x57'),_0xa24c('0x55'),_0xa24c('0x48'),_0xa24c('0x4b'),'mailCapacity','openchannelCapacity',_0xa24c('0x60'),'whatsappCapacity','chatCurrentCapacity',_0xa24c('0x4f'),_0xa24c('0x4d'),_0xa24c('0x4c'),_0xa24c('0x61'),'whatsappCurrentCapacity','phoneBarEnableScreenRecordingByAgent',_0xa24c('0x5b'),'destconnectedlinenum','onhold',_0xa24c('0x58'),_0xa24c('0x62'),_0xa24c('0x59')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 3d452cf..eb4675b 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1d8=['client','http','loggedIn','paused','waiting','inUse','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','available','busy','originated','merge','initializeQueues','lodash','util'];(function(_0x3a851f,_0x532a05){var _0x4ba708=function(_0x342458){while(--_0x342458){_0x3a851f['push'](_0x3a851f['shift']());}};_0x4ba708(++_0x532a05);}(_0xa1d8,0x13c));var _0x8a1d=function(_0x2e1e3,_0x43693f){_0x2e1e3=_0x2e1e3-0x0;var _0x1ae79b=_0xa1d8[_0x2e1e3];return _0x1ae79b;};'use strict';var _=require(_0x8a1d('0x0'));var jayson=require('jayson/promise');var util=require(_0x8a1d('0x1'));var amiClient=jayson[_0x8a1d('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x8a1d('0x2')][_0x8a1d('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x8a1d('0x4'),_0x8a1d('0x5'),_0x8a1d('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x8a1d('0x7'),'invalid',_0x8a1d('0x8'),_0x8a1d('0x9'),_0x8a1d('0xa'),'ringing',_0x8a1d('0xb'),_0x8a1d('0xc'),_0x8a1d('0xd'),_0x8a1d('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x8a1d('0xf'),'originated',_0x8a1d('0x10'),_0x8a1d('0x11'),_0x8a1d('0x12'),_0x8a1d('0x13'),_0x8a1d('0x14'),_0x8a1d('0x15'),_0x8a1d('0x16'),_0x8a1d('0x17'),_0x8a1d('0x18'),_0x8a1d('0x19'),_0x8a1d('0x1a'),_0x8a1d('0x1b'),_0x8a1d('0x1c'),_0x8a1d('0x1d'),_0x8a1d('0x1e'),_0x8a1d('0x1f'),'predictiveIntervalAnsweredCalls',_0x8a1d('0x20'),'predictiveIntervalDroppedCallsCallersExit',_0x8a1d('0x21'),_0x8a1d('0x22')];function getRealtimeQueues(_0x12e607,_0x314e67){var _0x2f0643=_0x314e67===_0x8a1d('0x23')?amiClient:routingClient;return _0x2f0643['request'](_[_0x8a1d('0x24')](_0x314e67)+_0x8a1d('0x25'),_0x12e607)[_0x8a1d('0x26')](function(_0x50989c){if(_0x50989c['error'])throw new Error(util[_0x8a1d('0x27')](_0x8a1d('0x28'),_0x314e67));return _0x50989c[_0x8a1d('0x29')];})[_0x8a1d('0x2a')](function(_0x3de7a1){throw _0x3de7a1;});}exports[_0x8a1d('0x2b')]=getRealtimeQueues;function initializeQueues(_0x346539,_0x3c3603,_0x1cba8f,_0x4c4c6a){var _0x174c63=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1cba8f==='voice'){if(_0x4c4c6a===_0x8a1d('0x2c')){_0x174c63=_0x174c63[_0x8a1d('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4c4c6a===_0x8a1d('0x2e')){_0x174c63=_0x174c63[_0x8a1d('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x346539[_0x8a1d('0x2f')](function(_0x3ddc9f){var _0x33d7f1=_0x3ddc9f['get']({'plain':!![]});_0x33d7f1[_0x8a1d('0x5')]=0x0;_0x33d7f1[_0x8a1d('0x8')]=0x0;_0x33d7f1['loggedIn']=0x0;_0x33d7f1[_0x8a1d('0x30')]=0x0;_0x33d7f1[_0x8a1d('0x6')]=0x0;if(_0x1cba8f===_0x8a1d('0x23')){_0x33d7f1['talking']=0x0;_0x33d7f1[_0x8a1d('0x31')]=0x0;if(_0x4c4c6a===_0x8a1d('0x2e')){_0x33d7f1[_0x8a1d('0xf')]=0x0;_0x33d7f1[_0x8a1d('0x32')]=0x0;}}var _0x3ad35b=_['find'](_0x3c3603,['id',_0x33d7f1['id']]);if(_0x3ad35b){_[_0x8a1d('0x33')](_0x33d7f1,_['pick'](_0x3ad35b,_0x174c63));}return _0x33d7f1;});}exports[_0x8a1d('0x34')]=initializeQueues; \ No newline at end of file +var _0x9488=['predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','get','paused','available','talking','merge','pick','initializeQueues','lodash','jayson/promise','client','http','loggedIn','waiting','inUse','invalid','loggedInDb','onHold','ringing','ringInUse','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold'];(function(_0x4fe3a9,_0x2a6654){var _0x1d1df1=function(_0xf6f3c5){while(--_0xf6f3c5){_0x4fe3a9['push'](_0x4fe3a9['shift']());}};_0x1d1df1(++_0x2a6654);}(_0x9488,0x1e5));var _0x8948=function(_0x158598,_0x433f61){_0x158598=_0x158598-0x0;var _0x19ddcd=_0x9488[_0x158598];return _0x19ddcd;};'use strict';var _=require(_0x8948('0x0'));var jayson=require(_0x8948('0x1'));var util=require('util');var amiClient=jayson[_0x8948('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x8948('0x2')][_0x8948('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x8948('0x4'),'paused',_0x8948('0x5')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x8948('0x6'),_0x8948('0x7'),_0x8948('0x8'),'notInUse',_0x8948('0x9'),_0x8948('0xa'),_0x8948('0xb'),'talking','unavailable',_0x8948('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x8948('0xd'),_0x8948('0xe'),_0x8948('0xf'),'statusMessage',_0x8948('0x10'),_0x8948('0x11'),_0x8948('0x12'),_0x8948('0x13'),_0x8948('0x14'),'erlangCalls',_0x8948('0x15'),_0x8948('0x16'),_0x8948('0x17'),'dialPredictiveInterval',_0x8948('0x18'),'dialPredictiveIntervalMinThreshold',_0x8948('0x19'),_0x8948('0x1a'),_0x8948('0x1b'),'predictiveIntervalDroppedCallsTimeout',_0x8948('0x1c'),_0x8948('0x1d'),_0x8948('0x1e')];function getRealtimeQueues(_0x2396c4,_0x18c468){var _0x1700c5=_0x18c468===_0x8948('0x1f')?amiClient:routingClient;return _0x1700c5[_0x8948('0x20')](_[_0x8948('0x21')](_0x18c468)+_0x8948('0x22'),_0x2396c4)['then'](function(_0x3ff517){if(_0x3ff517[_0x8948('0x23')])throw new Error(util[_0x8948('0x24')](_0x8948('0x25'),_0x18c468));return _0x3ff517[_0x8948('0x26')];})[_0x8948('0x27')](function(_0x211e66){throw _0x211e66;});}exports[_0x8948('0x28')]=getRealtimeQueues;function initializeQueues(_0x51a5e1,_0x39b316,_0x1e3b9c,_0x49e688){var _0x2da52e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1e3b9c==='voice'){if(_0x49e688===_0x8948('0x29')){_0x2da52e=_0x2da52e[_0x8948('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x49e688===_0x8948('0x2b')){_0x2da52e=_0x2da52e[_0x8948('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x51a5e1['map'](function(_0x52f43b){var _0x5b2dc1=_0x52f43b[_0x8948('0x2c')]({'plain':!![]});_0x5b2dc1[_0x8948('0x2d')]=0x0;_0x5b2dc1[_0x8948('0x8')]=0x0;_0x5b2dc1['loggedIn']=0x0;_0x5b2dc1[_0x8948('0x2e')]=0x0;_0x5b2dc1[_0x8948('0x5')]=0x0;if(_0x1e3b9c===_0x8948('0x1f')){_0x5b2dc1[_0x8948('0x2f')]=0x0;_0x5b2dc1['busy']=0x0;if(_0x49e688===_0x8948('0x2b')){_0x5b2dc1[_0x8948('0xd')]=0x0;_0x5b2dc1[_0x8948('0xe')]=0x0;}}var _0x7d15fe=_['find'](_0x39b316,['id',_0x5b2dc1['id']]);if(_0x7d15fe){_[_0x8948('0x30')](_0x5b2dc1,_[_0x8948('0x31')](_0x7d15fe,_0x2da52e));}return _0x5b2dc1;});}exports[_0x8948('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 13d295c..0648f15 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(_0x23600c,_0x31d165){var _0x57f2a2=function(_0x591ded){while(--_0x591ded){_0x23600c['push'](_0x23600c['shift']());}};_0x57f2a2(++_0x31d165);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 68509f1..7be5d40 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 _0xc9b0=['execSync','../environment','networkInterfaces','orderBy','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','hex','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','update','digest','substring','bimedia-machine-uuid','child_process'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xc9b0,0x1b8));var _0x0c9b=function(_0x3b8beb,_0x3892a0){_0x3b8beb=_0x3b8beb-0x0;var _0x459dd2=_0xc9b0[_0x3b8beb];return _0x459dd2;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x0c9b('0x0'));var exec=require(_0x0c9b('0x1'))[_0x0c9b('0x2')];var config=require(_0x0c9b('0x3'));function getInterfaces(){var _0x4e0ebd=[];var _0x1c47a8=os[_0x0c9b('0x4')]();var _0x1fd9b6=_[_0x0c9b('0x5')](_['keys'](_0x1c47a8));for(var _0x4e3d7a=0x0;_0x4e3d7a<_0x1fd9b6['length'];_0x4e3d7a++){var _0x2a369d=_0x1c47a8[_0x1fd9b6[_0x4e3d7a]][_0x0c9b('0x6')](function(_0x41cc04){return _0x41cc04['family']===_0x0c9b('0x7')&&_0x41cc04[_0x0c9b('0x8')]===![];});_0x4e0ebd=_0x4e0ebd[_0x0c9b('0x9')](_0x2a369d);}return _0x4e0ebd;}function getFirstInterface(){var _0x4987f6=_[_0x0c9b('0xa')](getInterfaces());return{'macAddress':_0x4987f6&&_0x4987f6[_0x0c9b('0xb')]?_0x4987f6[_0x0c9b('0xb')]:_0x0c9b('0xc'),'ipAddress':_0x4987f6&&_0x4987f6[_0x0c9b('0xd')]?_0x4987f6[_0x0c9b('0xd')]:'127.0.0.1'};}exports[_0x0c9b('0xe')]=getFirstInterface;function getCPUhash(){var _0x281f5c=_[_0x0c9b('0x5')](os[_0x0c9b('0xf')]()[_0x0c9b('0x10')](function(_0x5cbfde){return _0x5cbfde[_0x0c9b('0x11')];}))[_0x0c9b('0x12')](':');return crypto[_0x0c9b('0x13')](_0x0c9b('0x14'))['update'](_0x281f5c)['digest'](_0x0c9b('0x15'));}exports['getUuid']=function(){var _0x38bf5e=os[_0x0c9b('0x16')]();var _0x49b930=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x49b930[_0x0c9b('0x17')](config[_0x0c9b('0x18')])){return config['licenseToken'];}else if(_0x38bf5e==='win32'){return exec(_0x0c9b('0x19'),{'encoding':_0x0c9b('0x1a')})[_0x0c9b('0x1b')]('\x0d\x0a','');}else{var _0xbb2125=getFirstInterface();var _0xf5dd4c=getCPUhash();var _0x57a0a0=_0xf5dd4c+'|'+os[_0x0c9b('0x1c')]()+'|'+_0xbb2125[_0x0c9b('0x1d')]+'|'+_0xbb2125[_0x0c9b('0x1e')];var _0x35e813=crypto[_0x0c9b('0x13')]('md5')[_0x0c9b('0x1f')](_0x57a0a0)[_0x0c9b('0x20')]('hex');return _0x35e813[_0x0c9b('0x21')](0x0,0x8)+'-'+_0x35e813[_0x0c9b('0x21')](0x8,0xc)+'-'+_0x35e813[_0x0c9b('0x21')](0xc,0x10)+'-'+_0x35e813[_0x0c9b('0x21')](0x10,0x14)+'-'+_0x35e813[_0x0c9b('0x21')](0x14);}}; \ No newline at end of file +var _0xadf5=['address','getFirstInterface','cpus','map','join','createHash','md5','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00'];(function(_0x2048ce,_0x455a8e){var _0x46d448=function(_0x5ca4aa){while(--_0x5ca4aa){_0x2048ce['push'](_0x2048ce['shift']());}};_0x46d448(++_0x455a8e);}(_0xadf5,0x12b));var _0x5adf=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0xadf5[_0x515afd];return _0x536d53;};'use strict';var _=require(_0x5adf('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x5adf('0x1'));var exec=require(_0x5adf('0x2'))[_0x5adf('0x3')];var config=require(_0x5adf('0x4'));function getInterfaces(){var _0x590059=[];var _0x1e7db5=os[_0x5adf('0x5')]();var _0x542191=_[_0x5adf('0x6')](_[_0x5adf('0x7')](_0x1e7db5));for(var _0x1af47f=0x0;_0x1af47f<_0x542191[_0x5adf('0x8')];_0x1af47f++){var _0xb5f6ff=_0x1e7db5[_0x542191[_0x1af47f]][_0x5adf('0x9')](function(_0x5be5da){return _0x5be5da[_0x5adf('0xa')]===_0x5adf('0xb')&&_0x5be5da[_0x5adf('0xc')]===![];});_0x590059=_0x590059[_0x5adf('0xd')](_0xb5f6ff);}return _0x590059;}function getFirstInterface(){var _0x5604bc=_['head'](getInterfaces());return{'macAddress':_0x5604bc&&_0x5604bc[_0x5adf('0xe')]?_0x5604bc[_0x5adf('0xe')]:_0x5adf('0xf'),'ipAddress':_0x5604bc&&_0x5604bc[_0x5adf('0x10')]?_0x5604bc[_0x5adf('0x10')]:'127.0.0.1'};}exports[_0x5adf('0x11')]=getFirstInterface;function getCPUhash(){var _0x35a3ec=_['orderBy'](os[_0x5adf('0x12')]()[_0x5adf('0x13')](function(_0x45cf0f){return _0x45cf0f['model'];}))[_0x5adf('0x14')](':');return crypto[_0x5adf('0x15')](_0x5adf('0x16'))[_0x5adf('0x17')](_0x35a3ec)['digest'](_0x5adf('0x18'));}exports[_0x5adf('0x19')]=function(){var _0x1b2cf3=os[_0x5adf('0x1a')]();var _0x496dde=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x496dde[_0x5adf('0x1b')](config[_0x5adf('0x1c')])){return config[_0x5adf('0x1c')];}else if(_0x1b2cf3===_0x5adf('0x1d')){return exec(_0x5adf('0x1e'),{'encoding':_0x5adf('0x1f')})['replace']('\x0d\x0a','');}else{var _0x48d228=getFirstInterface();var _0x16772e=getCPUhash();var _0x2376f3=_0x16772e+'|'+os[_0x5adf('0x20')]()+'|'+_0x48d228['macAddress']+'|'+_0x48d228[_0x5adf('0x21')];var _0x545d41=crypto[_0x5adf('0x15')]('md5')[_0x5adf('0x17')](_0x2376f3)['digest'](_0x5adf('0x18'));return _0x545d41[_0x5adf('0x22')](0x0,0x8)+'-'+_0x545d41[_0x5adf('0x22')](0x8,0xc)+'-'+_0x545d41['substring'](0xc,0x10)+'-'+_0x545d41['substring'](0x10,0x14)+'-'+_0x545d41['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 99f4b73..f213024 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 _0x4264=['update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info'];(function(_0x4c1b41,_0x2582f8){var _0x93310b=function(_0x35fdc8){while(--_0x35fdc8){_0x4c1b41['push'](_0x4c1b41['shift']());}};_0x93310b(++_0x2582f8);}(_0x4264,0xa9));var _0x4426=function(_0x4b27a3,_0x59ebc1){_0x4b27a3=_0x4b27a3-0x0;var _0x361935=_0x4264[_0x4b27a3];return _0x361935;};'use strict';var util=require(_0x4426('0x0'));var moment=require(_0x4426('0x1'));var rp=require(_0x4426('0x2'));var BPromise=require(_0x4426('0x3'));var pkginfo=require('pkginfo')(module,_0x4426('0x4'));var db=require(_0x4426('0x5'))['db'];var encryptor=require(_0x4426('0x6'));var hardware=require('./hardware');var logger=require(_0x4426('0x7'))('license');var HOST=_0x4426('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x10dd9f){return new BPromise(function(_0x388ad8,_0x1df45f){var _0x277652=util[_0x4426('0x9')](_0x4426('0xa'),HOST,_0x10dd9f,module[_0x4426('0xb')][_0x4426('0x4')]);if(oldToken){_0x277652=util[_0x4426('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x10dd9f,module[_0x4426('0xb')][_0x4426('0x4')],oldToken);}var _0xd076e2={'uri':_0x277652,'method':_0x4426('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xd076e2)[_0x4426('0xd')](function(_0x1cda67){_0x388ad8(_0x1cda67);})['catch'](function(_0x16db2a){_0x1df45f(_0x16db2a);});});}function manageLicense(_0x362edd,_0xa0a898){var _0x3e9ff7=_0xa0a898[_0x4426('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3e9ff7[_0x4426('0xf')]!==_0x362edd&&!_0x3e9ff7[_0x4426('0x10')]){oldToken=_0x3e9ff7[_0x4426('0xf')];}httpRequest(_0x362edd)['then'](function(_0xf1831){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xf1831[_0x4426('0x11')]){isOldTokenSent=![];if(!_0x3e9ff7['license']&&_0x3e9ff7[_0x4426('0x12')]!=_0xf1831[_0x4426('0x12')]||_0x3e9ff7[_0x4426('0x12')]&&_0x3e9ff7[_0x4426('0x10')]){logger['info'](_0x4426('0x13'));}if(_0x3e9ff7[_0x4426('0x12')]&&!_0x3e9ff7[_0x4426('0x10')]&&_0x3e9ff7[_0x4426('0x12')]!=_0xf1831[_0x4426('0x12')]){logger[_0x4426('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3e9ff7[_0x4426('0x12')]&&!_0x3e9ff7[_0x4426('0x10')]&&_0x3e9ff7['license']==_0xf1831[_0x4426('0x12')]){return _0xa0a898;}return _0xa0a898[_0x4426('0x15')]({'data1':_0x362edd,'data2':null,'license':_0xf1831[_0x4426('0x12')]});}else{if(_0xf1831[_0x4426('0x12')]||_0x3e9ff7[_0x4426('0x12')]){if(!_0x3e9ff7[_0x4426('0x10')]){if(_0x3e9ff7[_0x4426('0xf')]==_0x362edd){GRAY_PERIOD_REASON='Disabled';logger[_0x4426('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x4426('0x16');logger[_0x4426('0x14')](_0x4426('0x17'),_0x3e9ff7[_0x4426('0xf')],_0x362edd);}logger['info'](_0x4426('0x18'),GRAY_PERIOD_REASON[_0x4426('0x19')](),moment()[_0x4426('0x9')](_0x4426('0x1a')));return _0xa0a898[_0x4426('0x15')]({'data2':encryptor[_0x4426('0x1b')](moment()[_0x4426('0x9')](_0x4426('0x1a')))});}else{if(moment()['diff'](encryptor[_0x4426('0x1c')](_0x3e9ff7['data2']),'days')>DAYS){logger[_0x4426('0x14')](_0x4426('0x1d'),moment()['format'](_0x4426('0x1a')));isOldTokenSent=![];return _0xa0a898[_0x4426('0x15')]({'data1':_0x362edd,'data2':null,'license':null});}}}else{if(_0x3e9ff7[_0x4426('0xf')]!=_0x362edd){logger['info'](_0x4426('0x17'),_0x3e9ff7[_0x4426('0xf')],_0x362edd);return _0xa0a898[_0x4426('0x15')]({'data1':_0x362edd,'data2':null,'license':null});}}}return _0xa0a898;})[_0x4426('0xd')](function(_0x454563){_0xa0a898=_0x454563;})[_0x4426('0x1e')](function(_0x4e9316){logger[_0x4426('0x1f')](_0x4e9316[_0x4426('0x20')]);})[_0x4426('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x4426('0x22')](),_0xa0a898);},TIME);});}function defaultLicense(){var _0x50e9b7=hardware[_0x4426('0x22')]();if(_0x50e9b7){return db['License'][_0x4426('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x50e9b7}})[_0x4426('0x24')](function(_0x74e363,_0x51e509){logger[_0x4426('0x14')](_0x4426('0x25'),_0x50e9b7);manageLicense(_0x50e9b7,_0x74e363);})['catch'](function(_0x5b55b9){logger['error'](_0x5b55b9[_0x4426('0x20')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x73e9=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','error','message','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','version','../../components/encryptor','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0xcbf2a3,_0x167876){var _0x4f4272=function(_0x4ce2b2){while(--_0x4ce2b2){_0xcbf2a3['push'](_0xcbf2a3['shift']());}};_0x4f4272(++_0x167876);}(_0x73e9,0xfd));var _0x973e=function(_0x5a4257,_0x3ae34d){_0x5a4257=_0x5a4257-0x0;var _0x3746a7=_0x73e9[_0x5a4257];return _0x3746a7;};'use strict';var util=require(_0x973e('0x0'));var moment=require('moment');var rp=require(_0x973e('0x1'));var BPromise=require(_0x973e('0x2'));var pkginfo=require(_0x973e('0x3'))(module,_0x973e('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x973e('0x5'));var hardware=require('./hardware');var logger=require(_0x973e('0x6'))('license');var HOST=_0x973e('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x6a6b1d){return new BPromise(function(_0x5c5cfa,_0xdb08c1){var _0x590c2c=util[_0x973e('0x8')](_0x973e('0x9'),HOST,_0x6a6b1d,module[_0x973e('0xa')][_0x973e('0x4')]);if(oldToken){_0x590c2c=util[_0x973e('0x8')](_0x973e('0xb'),HOST,_0x6a6b1d,module['exports'][_0x973e('0x4')],oldToken);}var _0x2ddd7f={'uri':_0x590c2c,'method':_0x973e('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x2ddd7f)['then'](function(_0x385050){_0x5c5cfa(_0x385050);})[_0x973e('0xd')](function(_0x5ed504){_0xdb08c1(_0x5ed504);});});}function manageLicense(_0x512ca6,_0x35b43e){var _0x802328=_0x35b43e[_0x973e('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x802328[_0x973e('0xf')]!==_0x512ca6&&!_0x802328[_0x973e('0x10')]){oldToken=_0x802328[_0x973e('0xf')];}httpRequest(_0x512ca6)[_0x973e('0x11')](function(_0xfddea5){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xfddea5[_0x973e('0x12')]){isOldTokenSent=![];if(!_0x802328[_0x973e('0x13')]&&_0x802328[_0x973e('0x13')]!=_0xfddea5[_0x973e('0x13')]||_0x802328[_0x973e('0x13')]&&_0x802328['data2']){logger[_0x973e('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x802328[_0x973e('0x13')]&&!_0x802328['data2']&&_0x802328['license']!=_0xfddea5[_0x973e('0x13')]){logger['info'](_0x973e('0x15'));}if(_0x802328[_0x973e('0x13')]&&!_0x802328['data2']&&_0x802328[_0x973e('0x13')]==_0xfddea5[_0x973e('0x13')]){return _0x35b43e;}return _0x35b43e[_0x973e('0x16')]({'data1':_0x512ca6,'data2':null,'license':_0xfddea5[_0x973e('0x13')]});}else{if(_0xfddea5['license']||_0x802328[_0x973e('0x13')]){if(!_0x802328['data2']){if(_0x802328[_0x973e('0xf')]==_0x512ca6){GRAY_PERIOD_REASON=_0x973e('0x17');logger[_0x973e('0x14')](_0x973e('0x18'));}else{GRAY_PERIOD_REASON=_0x973e('0x19');logger[_0x973e('0x14')](_0x973e('0x1a'),_0x802328[_0x973e('0xf')],_0x512ca6);}logger[_0x973e('0x14')](_0x973e('0x1b'),GRAY_PERIOD_REASON[_0x973e('0x1c')](),moment()['format'](_0x973e('0x1d')));return _0x35b43e[_0x973e('0x16')]({'data2':encryptor[_0x973e('0x1e')](moment()[_0x973e('0x8')](_0x973e('0x1d')))});}else{if(moment()[_0x973e('0x1f')](encryptor[_0x973e('0x20')](_0x802328[_0x973e('0x10')]),_0x973e('0x21'))>DAYS){logger[_0x973e('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x973e('0x8')](_0x973e('0x1d')));isOldTokenSent=![];return _0x35b43e[_0x973e('0x16')]({'data1':_0x512ca6,'data2':null,'license':null});}}}else{if(_0x802328['data1']!=_0x512ca6){logger['info'](_0x973e('0x1a'),_0x802328[_0x973e('0xf')],_0x512ca6);return _0x35b43e[_0x973e('0x16')]({'data1':_0x512ca6,'data2':null,'license':null});}}}return _0x35b43e;})[_0x973e('0x11')](function(_0x16e94b){_0x35b43e=_0x16e94b;})[_0x973e('0xd')](function(_0x34cf8c){logger[_0x973e('0x22')](_0x34cf8c[_0x973e('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x973e('0x24')](),_0x35b43e);},TIME);});}function defaultLicense(){var _0x1d0c28=hardware['getUuid']();if(_0x1d0c28){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1d0c28}})[_0x973e('0x25')](function(_0x59b915,_0x51b7b0){logger[_0x973e('0x14')](_0x973e('0x26'),_0x1d0c28);manageLicense(_0x1d0c28,_0x59b915);})[_0x973e('0xd')](function(_0x5c9df5){logger['error'](_0x5c9df5[_0x973e('0x23')]);});}}exports[_0x973e('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9c6f038..569dc19 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 _0x7c6f=['forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','../../components/encryptor','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','demo','machineUuid','deadline','add','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','telephones'];(function(_0x527221,_0x3ad559){var _0xdd8990=function(_0x45071d){while(--_0x45071d){_0x527221['push'](_0x527221['shift']());}};_0xdd8990(++_0x3ad559);}(_0x7c6f,0x11b));var _0xf7c6=function(_0x3675ad,_0x324a3c){_0x3675ad=_0x3675ad-0x0;var _0x11cf89=_0x7c6f[_0x3675ad];return _0x11cf89;};'use strict';var util=require('util');var _=require(_0xf7c6('0x0'));var moment=require(_0xf7c6('0x1'));var BPromise=require(_0xf7c6('0x2'));var hardware=require('./hardware');var encryptor=require(_0xf7c6('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xf7c6('0x4'),'machineUuid':hardware[_0xf7c6('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf7c6('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf7c6('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3c36ba){return new BPromise(function(_0x46c229,_0xeba353){return db[_0xf7c6('0x8')][_0xf7c6('0x9')](_['defaults'](_0x3c36ba,{'raw':!![],'where':{'id':0x1}}))[_0xf7c6('0xa')](function(_0x288669){return checkLicense(_0x288669,null);})[_0xf7c6('0xa')](function(_0x2e5e9f){_0x46c229(_0x2e5e9f);return;})[_0xf7c6('0xb')](function(_0x4cbc04){_0xeba353(_0x4cbc04);});});}function checkLicense(_0x47050a,_0xfebbea){if(!_0x47050a){demoLicense[_0xf7c6('0xc')]=_0x47050a['data1'];return demoLicense;}try{var _0xc238b0=_0xfebbea||_0x47050a[_0xf7c6('0xd')];if(_[_0xf7c6('0xe')](_0xc238b0)){throw new Error(_0xf7c6('0xf'));}var _0x521400=_0x47050a['data1'];var _0x41d3ea=_0x47050a[_0xf7c6('0x10')];var _0x87af5f=_0x521400[_0xf7c6('0x11')]('-')[0x4];var _0x3a0edf=_0x521400[_0xf7c6('0x11')]('-')[0x0];var _0x59bdc5=encryptor[_0xf7c6('0x12')](_0xc238b0,util[_0xf7c6('0x13')]('%s:%s:%s',_0x87af5f,_0x521400,_0x3a0edf));var _0x467c8e=JSON['parse'](_0x59bdc5);_0x467c8e[_0xf7c6('0x14')]=![];_0x467c8e[_0xf7c6('0xc')]=_0x521400;_0x467c8e[_0xf7c6('0x15')]=hardware['getUuid']();if(_0x41d3ea){var _0x51efe0=encryptor[_0xf7c6('0x12')](_0x41d3ea);_0x467c8e['gray']=_0x51efe0;_0x467c8e[_0xf7c6('0x16')]=moment(_0x51efe0)[_0xf7c6('0x17')](0x7,_0xf7c6('0x18'))['format']();_0x467c8e[_0xf7c6('0x19')]=_0x467c8e[_0xf7c6('0xc')]!=_0x467c8e[_0xf7c6('0x15')]?'changed':_0xf7c6('0x1a');}return _0x467c8e;}catch(_0x5e1af9){breakingLicense[_0xf7c6('0xc')]=_0x47050a['data1'];breakingLicense['message']=_0x5e1af9[_0xf7c6('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3b4b6f,_0x240b65){getLicense()[_0xf7c6('0xa')](function(_0x31d581){return db[_0xf7c6('0x1c')][_0xf7c6('0x1d')]({'attributes':[_0xf7c6('0x1e'),[db[_0xf7c6('0x1f')]['fn'](_0xf7c6('0x20'),db[_0xf7c6('0x1f')][_0xf7c6('0x21')]('role')),'count']],'group':'role','where':{'role':{'$or':[_0xf7c6('0x22'),_0xf7c6('0x23'),_0xf7c6('0x24')]}},'raw':!![]})[_0xf7c6('0xa')](function(_0x1c87f4){var _0x296364={'user':_0x31d581[_0xf7c6('0x25')]||0x0,'telephone':_0x31d581[_0xf7c6('0x26')]||0x0};_0x1c87f4[_0xf7c6('0x27')](function(_0x3c6f86){var _0x335061=_0x3c6f86[_0xf7c6('0x1e')]===_0xf7c6('0x22')?'user':_0x3c6f86[_0xf7c6('0x1e')];_0x296364[_0x335061]-=_0x3c6f86[_0xf7c6('0x28')];if(_0x296364[_0x335061]<0x0)_0x296364[_0x335061]=0x0;});_0x3b4b6f(_0x296364);return;});})['catch'](function(_0x2c518d){_0x240b65(_0x2c518d);});});}function checkUserLimits(_0x4aa396){return new BPromise(function(_0x3fe3f0,_0x367afb){getLimits()[_0xf7c6('0xa')](function(_0x36ae70){var _0x4597b0=_[_0xf7c6('0x29')](_[_0xf7c6('0x2a')](_0x4aa396,_0xf7c6('0x1e')),['admin',_0xf7c6('0x23'),'telephone']);var _0x20b456=(_0x4597b0['admin']||0x0)+(_0x4597b0[_0xf7c6('0x23')]||0x0);var _0x1590dc=_0x4597b0['telephone']||0x0;if(_0x20b456>_0x36ae70[_0xf7c6('0x23')])return _0x367afb(_0xf7c6('0x2b'));if(_0x1590dc>_0x36ae70[_0xf7c6('0x24')])return _0x367afb(_0xf7c6('0x2c'));return _0x3fe3f0();})[_0xf7c6('0xb')](function(_0x420064){_0x367afb(_0x420064);});});}module[_0xf7c6('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xfec5=['uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','demo','machineUuid','gray','deadline','add','grayReason','changed','message','User','findAll','role','COUNT','sequelize','count','telephone','users','telephones','forEach','user','pick','countBy','admin','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','./hardware','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch'];(function(_0x5c64b9,_0x136a7c){var _0x1b405e=function(_0x3baa56){while(--_0x3baa56){_0x5c64b9['push'](_0x5c64b9['shift']());}};_0x1b405e(++_0x136a7c);}(_0xfec5,0xd5));var _0x5fec=function(_0x7e51fc,_0x34fd1a){_0x7e51fc=_0x7e51fc-0x0;var _0x5bbdac=_0xfec5[_0x7e51fc];return _0x5bbdac;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5fec('0x0'));var BPromise=require(_0x5fec('0x1'));var hardware=require(_0x5fec('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x5fec('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x5fec('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5fec('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5fec('0x6'),'machineUuid':hardware[_0x5fec('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2574e0){return new BPromise(function(_0x29b4fe,_0x3574e9){return db[_0x5fec('0x7')][_0x5fec('0x8')](_[_0x5fec('0x9')](_0x2574e0,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5123e6){return checkLicense(_0x5123e6,null);})[_0x5fec('0xa')](function(_0x5ab83c){_0x29b4fe(_0x5ab83c);return;})[_0x5fec('0xb')](function(_0x5cadc0){_0x3574e9(_0x5cadc0);});});}function checkLicense(_0x2fbfd8,_0x1fbb84){if(!_0x2fbfd8){demoLicense[_0x5fec('0xc')]=_0x2fbfd8['data1'];return demoLicense;}try{var _0xa5ea75=_0x1fbb84||_0x2fbfd8[_0x5fec('0xd')];if(_[_0x5fec('0xe')](_0xa5ea75)){throw new Error(_0x5fec('0xf'));}var _0x18ed73=_0x2fbfd8[_0x5fec('0x10')];var _0x34e39a=_0x2fbfd8[_0x5fec('0x11')];var _0x448c09=_0x18ed73[_0x5fec('0x12')]('-')[0x4];var _0x218def=_0x18ed73[_0x5fec('0x12')]('-')[0x0];var _0xafab6f=encryptor[_0x5fec('0x13')](_0xa5ea75,util[_0x5fec('0x14')]('%s:%s:%s',_0x448c09,_0x18ed73,_0x218def));var _0x2ef078=JSON['parse'](_0xafab6f);_0x2ef078[_0x5fec('0x15')]=![];_0x2ef078['uuid']=_0x18ed73;_0x2ef078[_0x5fec('0x16')]=hardware[_0x5fec('0x4')]();if(_0x34e39a){var _0x18436a=encryptor[_0x5fec('0x13')](_0x34e39a);_0x2ef078[_0x5fec('0x17')]=_0x18436a;_0x2ef078[_0x5fec('0x18')]=moment(_0x18436a)[_0x5fec('0x19')](0x7,'days')['format']();_0x2ef078[_0x5fec('0x1a')]=_0x2ef078[_0x5fec('0xc')]!=_0x2ef078[_0x5fec('0x16')]?_0x5fec('0x1b'):'disabled';}return _0x2ef078;}catch(_0x4ea5c8){breakingLicense[_0x5fec('0xc')]=_0x2fbfd8[_0x5fec('0x10')];breakingLicense['message']=_0x4ea5c8[_0x5fec('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3b8100,_0x15b7c1){getLicense()[_0x5fec('0xa')](function(_0x113cdb){return db[_0x5fec('0x1d')][_0x5fec('0x1e')]({'attributes':[_0x5fec('0x1f'),[db['sequelize']['fn'](_0x5fec('0x20'),db[_0x5fec('0x21')]['col']('role')),_0x5fec('0x22')]],'group':_0x5fec('0x1f'),'where':{'role':{'$or':['admin','user',_0x5fec('0x23')]}},'raw':!![]})[_0x5fec('0xa')](function(_0x17b27b){var _0x5d7341={'user':_0x113cdb[_0x5fec('0x24')]||0x0,'telephone':_0x113cdb[_0x5fec('0x25')]||0x0};_0x17b27b[_0x5fec('0x26')](function(_0x414e9b){var _0x17acf7=_0x414e9b[_0x5fec('0x1f')]==='admin'?_0x5fec('0x27'):_0x414e9b[_0x5fec('0x1f')];_0x5d7341[_0x17acf7]-=_0x414e9b['count'];if(_0x5d7341[_0x17acf7]<0x0)_0x5d7341[_0x17acf7]=0x0;});_0x3b8100(_0x5d7341);return;});})[_0x5fec('0xb')](function(_0x38b4cb){_0x15b7c1(_0x38b4cb);});});}function checkUserLimits(_0x5d4fc9){return new BPromise(function(_0x5cabb2,_0x20cde1){getLimits()[_0x5fec('0xa')](function(_0x122ac6){var _0x32f6e2=_[_0x5fec('0x28')](_[_0x5fec('0x29')](_0x5d4fc9,_0x5fec('0x1f')),[_0x5fec('0x2a'),_0x5fec('0x27'),_0x5fec('0x23')]);var _0x133322=(_0x32f6e2[_0x5fec('0x2a')]||0x0)+(_0x32f6e2['user']||0x0);var _0x4a4e18=_0x32f6e2[_0x5fec('0x23')]||0x0;if(_0x133322>_0x122ac6[_0x5fec('0x27')])return _0x20cde1('License\x20limit\x20reached\x20for\x20users');if(_0x4a4e18>_0x122ac6[_0x5fec('0x23')])return _0x20cde1(_0x5fec('0x2b'));return _0x5cabb2();})[_0x5fec('0xb')](function(_0x586483){_0x20cde1(_0x586483);});});}module[_0x5fec('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 0a0d27d..5b06d6f 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 _0xd943=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd943,0x15d));var _0x3d94=function(_0x14278a,_0x1e9e05){_0x14278a=_0x14278a-0x0;var _0x276319=_0xd943[_0x14278a];return _0x276319;};'use strict';module[_0x3d94('0x0')]={'DOMAIN':_0x3d94('0x1'),'SESSION_SECRET':_0x3d94('0x2'),'GOOGLE_ID':_0x3d94('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x7708=['http://localhost:9000','app-id','exports'];(function(_0x8c032,_0x4a9362){var _0x3939da=function(_0x1bb3c1){while(--_0x1bb3c1){_0x8c032['push'](_0x8c032['shift']());}};_0x3939da(++_0x4a9362);}(_0x7708,0x188));var _0x8770=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x7708[_0x2aefb6];return _0x202772;};'use strict';module[_0x8770('0x0')]={'DOMAIN':_0x8770('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8770('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c367ef8..886984b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2450=['fileLogger','exports'];(function(_0x4670eb,_0x49fb20){var _0x253ebe=function(_0xb6674a){while(--_0xb6674a){_0x4670eb['push'](_0x4670eb['shift']());}};_0x253ebe(++_0x49fb20);}(_0x2450,0x166));var _0x0245=function(_0x1ada39,_0x3cd2a6){_0x1ada39=_0x1ada39-0x0;var _0x476c8e=_0x2450[_0x1ada39];return _0x476c8e;};'use strict';var fileLogger=require('../utils/loggers')[_0x0245('0x0')];module[_0x0245('0x1')]=fileLogger; \ No newline at end of file +var _0x32d7=['exports','../utils/loggers'];(function(_0x1fc753,_0x45b16d){var _0x1fb788=function(_0x41b2d5){while(--_0x41b2d5){_0x1fc753['push'](_0x1fc753['shift']());}};_0x1fb788(++_0x45b16d);}(_0x32d7,0xfd));var _0x732d=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x32d7[_0x71b765];return _0x34cb24;};'use strict';var fileLogger=require(_0x732d('0x0'))['fileLogger'];module[_0x732d('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d1de1ce..2a0eb46 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 _0x9305=['root','legacy-libs','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','../../config/environment','resolve'];(function(_0xeba27a,_0x2c3893){var _0x44e276=function(_0x129aa4){while(--_0x129aa4){_0xeba27a['push'](_0xeba27a['shift']());}};_0x44e276(++_0x2c3893);}(_0x9305,0x64));var _0x5930=function(_0x87208d,_0x320514){_0x87208d=_0x87208d-0x0;var _0x40eb1d=_0x9305[_0x87208d];return _0x40eb1d;};'use strict';var path=require('path');var cfg=require(_0x5930('0x0'));var env={'NODE_PATH':path[_0x5930('0x1')](path['join'](cfg[_0x5930('0x2')],_0x5930('0x3')))};var pm2config={'apps':[{'name':_0x5930('0x4'),'script':path[_0x5930('0x5')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x5930('0x6'),'script':path[_0x5930('0x5')](__dirname,_0x5930('0x7')),'env':env},{'name':_0x5930('0x8'),'script':path[_0x5930('0x5')](__dirname,_0x5930('0x9')),'env':env},{'name':_0x5930('0xa'),'script':path[_0x5930('0x5')](__dirname,_0x5930('0xb')),'env':env},{'name':_0x5930('0xc'),'script':path[_0x5930('0x5')](__dirname,_0x5930('0xd')),'env':env},{'name':_0x5930('0xe'),'script':path[_0x5930('0x5')](__dirname,_0x5930('0xf')),'env':env}]};module[_0x5930('0x10')]=pm2config; \ No newline at end of file +var _0x2ff7=['root','express','agi','../../services/agi/index.js','../../services/routing/index.js','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join'];(function(_0x12a612,_0x2a147e){var _0x20eea8=function(_0x1745b3){while(--_0x1745b3){_0x12a612['push'](_0x12a612['shift']());}};_0x20eea8(++_0x2a147e);}(_0x2ff7,0x6a));var _0x72ff=function(_0x24b312,_0x3c8336){_0x24b312=_0x24b312-0x0;var _0x3185a2=_0x2ff7[_0x24b312];return _0x3185a2;};'use strict';var path=require(_0x72ff('0x0'));var cfg=require(_0x72ff('0x1'));var env={'NODE_PATH':path[_0x72ff('0x2')](path[_0x72ff('0x3')](cfg[_0x72ff('0x4')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x72ff('0x5'),'script':path[_0x72ff('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x72ff('0x6'),'script':path[_0x72ff('0x3')](__dirname,_0x72ff('0x7')),'env':env},{'name':'email','script':path[_0x72ff('0x3')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path['join'](__dirname,_0x72ff('0x8')),'env':env},{'name':'xdr','script':path[_0x72ff('0x3')](__dirname,_0x72ff('0x9')),'env':env}]};module[_0x72ff('0xa')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 6c47f89..691329b 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 _0x37ae=['list','describe','delete','dump','saved','pm2','./config','connect','connected','start','then','disconnect','stop'];(function(_0x3fe896,_0x18a20d){var _0x2c548a=function(_0x9199ad){while(--_0x9199ad){_0x3fe896['push'](_0x3fe896['shift']());}};_0x2c548a(++_0x18a20d);}(_0x37ae,0x1d9));var _0xe37a=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x37ae[_0x56fe98];return _0x212f4f;};'use strict';var pm2=require(_0xe37a('0x0'));var BPromise=require('bluebird');var config=require(_0xe37a('0x1'));function connect(){return new BPromise(function(_0x1d5a9c,_0x5a4312){return pm2[_0xe37a('0x2')](function(_0xe21be5){if(_0xe21be5){return _0x5a4312(_0xe21be5);}return _0x1d5a9c(_0xe37a('0x3'));});});};exports[_0xe37a('0x4')]=function(_0x279595){return connect()[_0xe37a('0x5')](function(){return new BPromise(function(_0x57ca11,_0x61c88b){return pm2[_0xe37a('0x4')](_0x279595,function(_0x46d5f0,_0x4e6256){if(_0x46d5f0){return _0x61c88b(_0x46d5f0);}pm2[_0xe37a('0x6')]();return _0x57ca11(_0x4e6256);});});});};exports[_0xe37a('0x7')]=function(_0x5e742f){return connect()['then'](function(){return new BPromise(function(_0x18cddc,_0x52ded7){return pm2[_0xe37a('0x7')](_0x5e742f,function(_0x1ec009,_0x4ad765){if(_0x1ec009){return _0x52ded7(_0x1ec009);}pm2[_0xe37a('0x6')]();return _0x18cddc(_0x4ad765);});});});};exports['restart']=function(_0x42dd8b){return connect()[_0xe37a('0x5')](function(){return new BPromise(function(_0x34fd3e,_0x4ec18f){return pm2['restart'](_0x42dd8b,function(_0x3e9b96,_0x1af546){if(_0x3e9b96){return _0x4ec18f(_0x3e9b96);}pm2[_0xe37a('0x6')]();return _0x34fd3e(_0x1af546);});});});};exports['list']=function(){return connect()[_0xe37a('0x5')](function(){return new BPromise(function(_0x5e5486,_0x1d70ef){return pm2[_0xe37a('0x8')](function(_0x3521f8,_0x1684da){if(_0x3521f8){return _0x1d70ef(_0x3521f8);}pm2[_0xe37a('0x6')]();return _0x5e5486(_0x1684da);});});});};exports[_0xe37a('0x9')]=function(_0xfa34a4){return connect()[_0xe37a('0x5')](function(){return new BPromise(function(_0x3f7636,_0x1910de){return pm2[_0xe37a('0x9')](_0xfa34a4,function(_0x12495d,_0x2b9284){if(_0x12495d){return _0x1910de(_0x12495d);}pm2[_0xe37a('0x6')]();return _0x3f7636(_0x2b9284);});});});};exports[_0xe37a('0xa')]=function(_0xa8045a){return connect()[_0xe37a('0x5')](function(){return new BPromise(function(_0x41dd86,_0x5bc17b){return pm2[_0xe37a('0xa')](_0xa8045a,function(_0x270b85,_0x1b9d2b){if(_0x270b85){return _0x5bc17b(_0x270b85);}pm2[_0xe37a('0x6')]();return _0x41dd86(_0x1b9d2b);});});});};exports[_0xe37a('0xb')]=function(){return connect()[_0xe37a('0x5')](function(){return new BPromise(function(_0x580982,_0x377520){return pm2[_0xe37a('0xb')](function(_0x3e7cd8){if(_0x3e7cd8){return _0x377520(_0x3e7cd8);}return _0x580982(_0xe37a('0xc'));});});});}; \ No newline at end of file +var _0x3dce=['then','restart','list','describe','delete','dump','pm2','connect','connected','start','disconnect','stop'];(function(_0x4afcde,_0x47406e){var _0x135787=function(_0x436556){while(--_0x436556){_0x4afcde['push'](_0x4afcde['shift']());}};_0x135787(++_0x47406e);}(_0x3dce,0xa2));var _0xe3dc=function(_0x433130,_0x402006){_0x433130=_0x433130-0x0;var _0xf24027=_0x3dce[_0x433130];return _0xf24027;};'use strict';var pm2=require(_0xe3dc('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x493597,_0x4026e2){return pm2[_0xe3dc('0x1')](function(_0x209234){if(_0x209234){return _0x4026e2(_0x209234);}return _0x493597(_0xe3dc('0x2'));});});};exports[_0xe3dc('0x3')]=function(_0x2f35f1){return connect()['then'](function(){return new BPromise(function(_0x1e4fe4,_0x3aa675){return pm2[_0xe3dc('0x3')](_0x2f35f1,function(_0x42fb95,_0x2b8c98){if(_0x42fb95){return _0x3aa675(_0x42fb95);}pm2[_0xe3dc('0x4')]();return _0x1e4fe4(_0x2b8c98);});});});};exports[_0xe3dc('0x5')]=function(_0x1c795d){return connect()[_0xe3dc('0x6')](function(){return new BPromise(function(_0xb8d5e5,_0x129926){return pm2[_0xe3dc('0x5')](_0x1c795d,function(_0x46f285,_0x4f5e64){if(_0x46f285){return _0x129926(_0x46f285);}pm2[_0xe3dc('0x4')]();return _0xb8d5e5(_0x4f5e64);});});});};exports[_0xe3dc('0x7')]=function(_0x2eeba5){return connect()['then'](function(){return new BPromise(function(_0x42a6ab,_0x518d71){return pm2[_0xe3dc('0x7')](_0x2eeba5,function(_0x512881,_0x3bf186){if(_0x512881){return _0x518d71(_0x512881);}pm2['disconnect']();return _0x42a6ab(_0x3bf186);});});});};exports[_0xe3dc('0x8')]=function(){return connect()[_0xe3dc('0x6')](function(){return new BPromise(function(_0xf3c205,_0x1d551c){return pm2[_0xe3dc('0x8')](function(_0x4d251b,_0x13763d){if(_0x4d251b){return _0x1d551c(_0x4d251b);}pm2[_0xe3dc('0x4')]();return _0xf3c205(_0x13763d);});});});};exports[_0xe3dc('0x9')]=function(_0xc0e509){return connect()[_0xe3dc('0x6')](function(){return new BPromise(function(_0x4d7e05,_0x4ef784){return pm2[_0xe3dc('0x9')](_0xc0e509,function(_0x4bbf1b,_0x47b47a){if(_0x4bbf1b){return _0x4ef784(_0x4bbf1b);}pm2[_0xe3dc('0x4')]();return _0x4d7e05(_0x47b47a);});});});};exports[_0xe3dc('0xa')]=function(_0x3033a3){return connect()[_0xe3dc('0x6')](function(){return new BPromise(function(_0x6702f7,_0x4dda6b){return pm2[_0xe3dc('0xa')](_0x3033a3,function(_0x2262ca,_0x1d1c30){if(_0x2262ca){return _0x4dda6b(_0x2262ca);}pm2[_0xe3dc('0x4')]();return _0x6702f7(_0x1d1c30);});});});};exports['dump']=function(){return connect()[_0xe3dc('0x6')](function(){return new BPromise(function(_0x441c14,_0x4b2185){return pm2[_0xe3dc('0xb')](function(_0x596f83){if(_0x596f83){return _0x4b2185(_0x596f83);}return _0x441c14('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 0b2fb4e..4f5cc58 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 _0x0834=['[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','../../config/environment','../logger','redis','defaults','Setting','find','then','ChatInteraction','findAll','lastMsgAt','chatTimeout','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error'];(function(_0x49df93,_0x2bb7ac){var _0x471bac=function(_0x3dbdc5){while(--_0x3dbdc5){_0x49df93['push'](_0x49df93['shift']());}};_0x471bac(++_0x2bb7ac);}(_0x0834,0x106));var _0x4083=function(_0x472917,_0x34d079){_0x472917=_0x472917-0x0;var _0x2fffae=_0x0834[_0x472917];return _0x2fffae;};'use strict';var _=require(_0x4083('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require(_0x4083('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x4083('0x2'))('schedule');config[_0x4083('0x3')]=_[_0x4083('0x4')](config[_0x4083('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0xe10753=0x0;var _0x1d4a1c=[];return db[_0x4083('0x5')][_0x4083('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x4083('0x7')](function(_0x27dbc7){_0xe10753=_0x27dbc7['chatTimeout'];if(_0xe10753){return db[_0x4083('0x8')][_0x4083('0x9')]({'raw':!![],'attributes':['id',_0x4083('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x27dbc7[_0x4083('0xb')],_0x4083('0xc'))}}});}else{return[];}})[_0x4083('0x7')](function(_0x21774a){if(_0x21774a&&_0x21774a[_0x4083('0xd')]){_0x1d4a1c=_['map'](_0x21774a||[],'id');logger[_0x4083('0xe')](_0x4083('0xf'),_0x1d4a1c[_0x4083('0x10')]());return db['ChatInteraction'][_0x4083('0x11')]({'closeReason':'system','disposition':_0x4083('0x12'),'closed':!![],'closedAt':moment()[_0x4083('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1d4a1c}});}})[_0x4083('0x7')](function(){if(_0x1d4a1c&&_0x1d4a1c[_0x4083('0xd')]){logger[_0x4083('0xe')](_0x4083('0x14'),_0x1d4a1c[_0x4083('0x10')]());for(var _0x3eb1ce=0x0;_0x3eb1ce<_0x1d4a1c[_0x4083('0xd')];_0x3eb1ce++){io[_0x4083('0x15')](_0x4083('0x16'),{'id':_0x1d4a1c[_0x3eb1ce],'closed':!![]});}}})['catch'](function(_0x2561a7){logger[_0x4083('0x17')](_0x4083('0x18'),_0x2561a7?util[_0x4083('0x19')](_0x2561a7,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x35bb=['../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util','../../config/environment','../../mysqldb'];(function(_0x257a77,_0x5ba0e0){var _0x302c6d=function(_0x467a0c){while(--_0x467a0c){_0x257a77['push'](_0x257a77['shift']());}};_0x302c6d(++_0x5ba0e0);}(_0x35bb,0x114));var _0xb35b=function(_0x5bd9dc,_0x5d4d7f){_0x5bd9dc=_0x5bd9dc-0x0;var _0x384e3f=_0x35bb[_0x5bd9dc];return _0x384e3f;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xb35b('0x0'));var util=require(_0xb35b('0x1'));var config=require(_0xb35b('0x2'));var db=require(_0xb35b('0x3'))['db'];var logger=require(_0xb35b('0x4'))(_0xb35b('0x5'));config['redis']=_[_0xb35b('0x6')](config[_0xb35b('0x7')],{'host':_0xb35b('0x8'),'port':0x18eb});var io=require(_0xb35b('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x2dd917=0x0;var _0x4051eb=[];return db[_0xb35b('0xa')][_0xb35b('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xb35b('0xc')](function(_0xbc9d13){_0x2dd917=_0xbc9d13[_0xb35b('0xd')];if(_0x2dd917){return db[_0xb35b('0xe')][_0xb35b('0xf')]({'raw':!![],'attributes':['id',_0xb35b('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb35b('0x11')](_0xbc9d13[_0xb35b('0xd')],_0xb35b('0x12'))}}});}else{return[];}})[_0xb35b('0xc')](function(_0xff5f7){if(_0xff5f7&&_0xff5f7['length']){_0x4051eb=_[_0xb35b('0x13')](_0xff5f7||[],'id');logger[_0xb35b('0x14')](_0xb35b('0x15'),_0x4051eb[_0xb35b('0x16')]());return db[_0xb35b('0xe')][_0xb35b('0x17')]({'closeReason':'system','disposition':_0xb35b('0x18'),'closed':!![],'closedAt':moment()[_0xb35b('0x19')](_0xb35b('0x1a'))},{'where':{'id':_0x4051eb}});}})['then'](function(){if(_0x4051eb&&_0x4051eb[_0xb35b('0x1b')]){logger['info'](_0xb35b('0x1c'),_0x4051eb[_0xb35b('0x16')]());for(var _0x41ed36=0x0;_0x41ed36<_0x4051eb['length'];_0x41ed36++){io[_0xb35b('0x1d')](_0xb35b('0x1e'),{'id':_0x4051eb[_0x41ed36],'closed':!![]});}}})['catch'](function(_0x2ebb7d){logger[_0xb35b('0x1f')](_0xb35b('0x20'),_0x2ebb7d?util[_0xb35b('0x21')](_0x2ebb7d,{'showHidden':![],'depth':null}):'');});}exports[_0xb35b('0x22')]=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 1f16359..6aff068 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 _0x24cd=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x897a93,_0x1f2039){var _0x2baf95=function(_0x2536d8){while(--_0x2536d8){_0x897a93['push'](_0x897a93['shift']());}};_0x2baf95(++_0x1f2039);}(_0x24cd,0x170));var _0xd24c=function(_0x59e230,_0x65494a){_0x59e230=_0x59e230-0x0;var _0x231ed9=_0x24cd[_0x59e230];return _0x231ed9;};'use strict';function start(){var _0x2db0a3=require(_0xd24c('0x0'));return _0x2db0a3[_0xd24c('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x3039=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1e603c,_0x16f855){var _0x2fe121=function(_0x500fd0){while(--_0x500fd0){_0x1e603c['push'](_0x1e603c['shift']());}};_0x2fe121(++_0x16f855);}(_0x3039,0x197));var _0x9303=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3039[_0x2641f9];return _0x585741;};'use strict';function start(){var _0x3f1a1b=require(_0x9303('0x0'));return _0x3f1a1b[_0x9303('0x1')]();}module[_0x9303('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 f9130c3..3ea7796 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 _0x8074=['map','toString','keyBy','difference','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','active','isBetween','cron','start','add\x20cron','stop','stop\x20cron','endAt','update','run','util','path','moment','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','subtractNumber','join','savename','%s.%s','basename','extname','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','existsSync','status','info','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20custom\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8074,0x143));var _0x4807=function(_0x294b13,_0x3b35bb){_0x294b13=_0x294b13-0x0;var _0xe61ce7=_0x8074[_0x294b13];return _0xe61ce7;};'use strict';var fs=require('fs');var util=require(_0x4807('0x0'));var path=require(_0x4807('0x1'));var _=require('lodash');var moment=require(_0x4807('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x4807('0x3'));var logger=require(_0x4807('0x4'))(_0x4807('0x5'));var db=require(_0x4807('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x4807('0x7'));var client=jayson[_0x4807('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x9055e5,_0x2dd217){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x9055e5[_0x4807('0x9')]);var _0x1f108f=!![];var _0x3b582e=_0x9055e5[_0x4807('0xa')]['getSmtpOptions']();var _0x33bd33={'account':_0x3b582e,'message':{'from':util[_0x4807('0xb')](_0x4807('0xc'),_0x9055e5[_0x4807('0xa')][_0x4807('0xd')],_0x9055e5[_0x4807('0xa')][_0x4807('0x9')]||_0x9055e5[_0x4807('0xa')][_0x4807('0xe')]['user']),'to':_0x9055e5[_0x4807('0x9')],'cc':_0x9055e5['cc'],'bcc':_0x9055e5['bcc'],'subject':util[_0x4807('0xb')]('Report\x20%s\x20last\x20%s\x20%s',_0x2dd217[_0x4807('0xd')],_0x9055e5[_0x4807('0xf')],_0x9055e5['subtractUnit'])}};var _0x3985e9=path[_0x4807('0x10')](__dirname,'../../files/reports');var _0x1bfdfc=_0x2dd217[_0x4807('0x11')];var _0x24f675=util[_0x4807('0xb')](_0x4807('0x12'),path[_0x4807('0x13')](_0x2dd217[_0x4807('0x11')],path[_0x4807('0x14')](_0x2dd217['savename'])),'zip');var _0x29f0fc=path[_0x4807('0x10')](_0x3985e9,_0x1bfdfc);var _0x1fe06a=path['join'](_0x3985e9,_0x24f675);if(fs['existsSync'](_0x29f0fc)){_0x2dd217['status']=_0x4807('0x15');_0x33bd33[_0x4807('0x16')][_0x4807('0x17')]=[{'filename':_0x1bfdfc,'path':_0x29f0fc}];_0x33bd33['message'][_0x4807('0x18')]=util[_0x4807('0xb')](_0x4807('0x19'),JSON['stringify'](_0x2dd217,null,0x2));}else if(fs[_0x4807('0x1a')](_0x1fe06a)){_0x2dd217[_0x4807('0x1b')]='Sent';_0x33bd33[_0x4807('0x16')][_0x4807('0x17')]=[{'filename':_0x24f675,'path':_0x1fe06a}];}else{_0x33bd33['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x9055e5['sendIfEmpty']){_0x1f108f=![];logger[_0x4807('0x1c')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1f108f){return client[_0x4807('0x1d')](_0x4807('0x1e'),_0x33bd33)[_0x4807('0x1f')](function(_0x1cd222){if(_0x1cd222[_0x4807('0x20')]){return logger['error'](_0x4807('0x21'),JSON[_0x4807('0x22')](_0x1cd222));}return logger[_0x4807('0x1c')]('email\x20sent');})[_0x4807('0x23')](function(_0x20e27e){return logger['error'](_0x4807('0x21'),JSON[_0x4807('0x22')](_0x20e27e));});}};}function handleError(){return function(_0x3de195){return logger['error'](JSON[_0x4807('0x22')](_0x3de195));};}function handleResult(_0xcc0276){return function(_0x15f955){logger[_0x4807('0x1c')](_0x4807('0x24'),JSON['stringify'](_0x15f955));if(_0xcc0276[_0x4807('0xa')]&&_0xcc0276['MailAccount'][_0x4807('0xe')]&&!_[_0x4807('0x25')](_0xcc0276[_0x4807('0x9')])){setTimeout(handleSendEmail(_0xcc0276,_0x15f955),0x3c*0x3e8);}};}function handleJob(_0x1f8167){return function(){try{if(_['isNil'](_0x1f8167['subtractNumber'])){return logger[_0x4807('0x1c')](_0x4807('0x26'));}if(_[_0x4807('0x25')](_0x1f8167['subtractUnit'])){return logger[_0x4807('0x1c')]('subtractUnit\x20null\x20or\x20undefined');}var _0x48c8a0={'startDate':moment()['subtract'](_0x1f8167[_0x4807('0xf')],_0x1f8167['subtractUnit'])[_0x4807('0xb')](_0x4807('0x27')),'endDate':moment()['format'](_0x4807('0x27')),'type':_0x4807('0x28'),'output':_0x1f8167[_0x4807('0x29')],'name':_0x1f8167[_0x4807('0xd')]};if(!_[_0x4807('0x25')](_0x1f8167[_0x4807('0x2a')])){logger[_0x4807('0x1c')]('exec\x20defaul\x20report\x20id:%s',_0x1f8167[_0x4807('0x2a')]);return analyticDefaultReportController['runReport']({'id':_0x1f8167[_0x4807('0x2a')]},_0x48c8a0)[_0x4807('0x1f')](handleResult(_0x1f8167))['catch'](handleError());}if(!_['isNil'](_0x1f8167['CustomReportId'])){logger['info'](_0x4807('0x2b'),_0x1f8167['CustomReportId']);return analyticCustomReportController[_0x4807('0x2c')]({'id':_0x1f8167[_0x4807('0x2d')]},_0x48c8a0)[_0x4807('0x1f')](handleResult(_0x1f8167))[_0x4807('0x23')](handleError());}}catch(_0x4bb017){logger[_0x4807('0x20')](JSON['stringify'](_0x4bb017));}return logger['info'](_0x4807('0x2e'));};}function getJobs(_0x37144f){var _0x2168f8={};if(_0x37144f){_0x2168f8['id']=_0x37144f;}return db['Schedule'][_0x4807('0x2f')]({'where':_0x2168f8,'include':[{'model':db[_0x4807('0xa')],'attributes':['id','name',_0x4807('0x9')],'include':[{'model':db[_0x4807('0x30')],'as':_0x4807('0xe'),'include':[{'model':db[_0x4807('0x31')],'as':'CloudProvider'}]}]}]})[_0x4807('0x1f')](function(_0x26ba27){var _0x52fcd4=_[_0x4807('0x32')](manager[_0x4807('0x33')]);var _0x358a2e=_[_0x4807('0x34')](_0x26ba27,function(_0x4eede0){return _0x4eede0['id'][_0x4807('0x35')]();});var _0x4d0aa8=_[_0x4807('0x36')](_0x26ba27,function(_0x4ccfb6){return _0x4ccfb6['id']['toString']();});var _0x328ffd=_0x37144f?_0x358a2e:_['difference'](_0x358a2e,_0x52fcd4);var _0x86704b=_['intersection'](_0x358a2e,_0x52fcd4);var _0x304c01=_[_0x4807('0x37')](_0x52fcd4,_0x358a2e);var _0x10bfbc;var _0x5f22b5;for(_0x10bfbc=0x0;_0x10bfbc<_0x304c01[_0x4807('0x38')]&&!_0x37144f;_0x10bfbc+=0x1){_0x5f22b5=_0x304c01[_0x10bfbc][_0x4807('0x35')]();if(manager[_0x4807('0x39')](_0x5f22b5)){manager['stop'](_0x5f22b5);manager[_0x4807('0x3a')](_0x5f22b5);logger['info'](_0x4807('0x3b'),_0x5f22b5);}}logger[_0x4807('0x1c')](_0x4807('0x3c'),JSON[_0x4807('0x22')](_0x328ffd));for(_0x10bfbc=0x0;_0x10bfbc<_0x328ffd[_0x4807('0x38')];_0x10bfbc+=0x1){_0x5f22b5=_0x328ffd[_0x10bfbc][_0x4807('0x35')]();logger[_0x4807('0x1c')](_0x4807('0x3d'),_0x5f22b5);if(_0x37144f){logger['info'](_0x4807('0x3e'),_0x37144f);logger[_0x4807('0x1c')](JSON[_0x4807('0x22')](_0x4d0aa8[_0x5f22b5]));BPromise[_0x4807('0x3f')]()['then'](handleJob(_0x4d0aa8[_0x5f22b5]));logger[_0x4807('0x1c')](_0x4807('0x40'),_0x4d0aa8[_0x5f22b5][_0x4807('0xd')],_0x4d0aa8[_0x5f22b5]['cron']);}else if(_0x4d0aa8[_0x5f22b5]['cron']&&_0x4d0aa8[_0x5f22b5][_0x4807('0x41')]&&moment()[_0x4807('0x42')](_0x4d0aa8[_0x5f22b5]['startAt'],_0x4d0aa8[_0x5f22b5]['endAt'])){manager['add'](_0x5f22b5,_0x4d0aa8[_0x5f22b5][_0x4807('0x43')],handleJob(_0x4d0aa8[_0x5f22b5]));manager[_0x4807('0x44')](_0x5f22b5);logger[_0x4807('0x1c')](_0x4807('0x45'),_0x4d0aa8[_0x5f22b5]['name'],_0x4d0aa8[_0x5f22b5][_0x4807('0x43')]);}else if(manager['exists'](_0x5f22b5)){manager[_0x4807('0x46')](_0x5f22b5);manager['deleteJob'](_0x5f22b5);logger['info'](_0x4807('0x47'),_0x4d0aa8[_0x5f22b5]['name'],_0x4d0aa8[_0x5f22b5][_0x4807('0x43')]);}}for(_0x10bfbc=0x0,_0x5f22b5;_0x10bfbc<_0x86704b[_0x4807('0x38')]&&!_0x37144f;_0x10bfbc+=0x1){_0x5f22b5=_0x86704b[_0x10bfbc][_0x4807('0x35')]();if(manager[_0x4807('0x39')](_0x5f22b5)){if(_0x4d0aa8[_0x5f22b5]['cron']&&_0x4d0aa8[_0x5f22b5]['active']&&moment()[_0x4807('0x42')](_0x4d0aa8[_0x5f22b5]['startAt'],_0x4d0aa8[_0x5f22b5][_0x4807('0x48')])){manager[_0x4807('0x49')](_0x5f22b5,_0x4d0aa8[_0x5f22b5][_0x4807('0x43')],handleJob(_0x4d0aa8[_0x5f22b5]));logger[_0x4807('0x1c')]('update\x20cron',_0x4d0aa8[_0x5f22b5][_0x4807('0xd')],_0x4d0aa8[_0x5f22b5][_0x4807('0x43')]);}else{manager['stop'](_0x5f22b5);manager[_0x4807('0x3a')](_0x5f22b5);logger[_0x4807('0x1c')](_0x4807('0x47'),_0x4d0aa8[_0x5f22b5][_0x4807('0xd')],_0x4d0aa8[_0x5f22b5][_0x4807('0x43')]);}}}})['catch'](function(_0x33d9dd){logger[_0x4807('0x20')](JSON['stringify'](_0x33d9dd));});}exports[_0x4807('0x4a')]=function(_0x1a5eae){return getJobs(_0x1a5eae);};exports[_0x4807('0x44')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa07a=['path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','\x22%s\x22\x20<%s>','name','email','MailAccount','Smtp','user','format','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','error','no\x20report\x20id','findAll','MailServerOut','CloudProvider','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','active','isBetween','startAt','start','add\x20cron','stop\x20cron','update\x20cron','run','util'];(function(_0x1ceb32,_0x53e397){var _0x27c407=function(_0x49d29e){while(--_0x49d29e){_0x1ceb32['push'](_0x1ceb32['shift']());}};_0x27c407(++_0x53e397);}(_0xa07a,0xfb));var _0xaa07=function(_0x402dc5,_0x12c36f){_0x402dc5=_0x402dc5-0x0;var _0x4193a1=_0xa07a[_0x402dc5];return _0x4193a1;};'use strict';var fs=require('fs');var util=require(_0xaa07('0x0'));var path=require(_0xaa07('0x1'));var _=require(_0xaa07('0x2'));var moment=require(_0xaa07('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xaa07('0x4'));var BPromise=require(_0xaa07('0x5'));var logger=require(_0xaa07('0x6'))(_0xaa07('0x7'));var db=require(_0xaa07('0x8'))['db'];var analyticCustomReportController=require(_0xaa07('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xaa07('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4b2e8c,_0x2c750e){return function(){logger[_0xaa07('0xb')](_0xaa07('0xc'),_0x4b2e8c['email']);var _0x329a4f=!![];var _0xf586fb=_0x4b2e8c['MailAccount']['getSmtpOptions']();var _0x66316b={'account':_0xf586fb,'message':{'from':util['format'](_0xaa07('0xd'),_0x4b2e8c['MailAccount'][_0xaa07('0xe')],_0x4b2e8c['MailAccount'][_0xaa07('0xf')]||_0x4b2e8c[_0xaa07('0x10')][_0xaa07('0x11')][_0xaa07('0x12')]),'to':_0x4b2e8c[_0xaa07('0xf')],'cc':_0x4b2e8c['cc'],'bcc':_0x4b2e8c['bcc'],'subject':util[_0xaa07('0x13')]('Report\x20%s\x20last\x20%s\x20%s',_0x2c750e[_0xaa07('0xe')],_0x4b2e8c[_0xaa07('0x14')],_0x4b2e8c[_0xaa07('0x15')])}};var _0x431708=path[_0xaa07('0x16')](__dirname,_0xaa07('0x17'));var _0x7efd36=_0x2c750e[_0xaa07('0x18')];var _0x2b7773=util['format'](_0xaa07('0x19'),path[_0xaa07('0x1a')](_0x2c750e[_0xaa07('0x18')],path[_0xaa07('0x1b')](_0x2c750e[_0xaa07('0x18')])),_0xaa07('0x1c'));var _0x116c8f=path[_0xaa07('0x16')](_0x431708,_0x7efd36);var _0x572954=path[_0xaa07('0x16')](_0x431708,_0x2b7773);if(fs[_0xaa07('0x1d')](_0x116c8f)){_0x2c750e[_0xaa07('0x1e')]=_0xaa07('0x1f');_0x66316b[_0xaa07('0x20')][_0xaa07('0x21')]=[{'filename':_0x7efd36,'path':_0x116c8f}];_0x66316b[_0xaa07('0x20')]['text']=util[_0xaa07('0x13')](_0xaa07('0x22'),JSON[_0xaa07('0x23')](_0x2c750e,null,0x2));}else if(fs[_0xaa07('0x1d')](_0x572954)){_0x2c750e[_0xaa07('0x1e')]='Sent';_0x66316b[_0xaa07('0x20')][_0xaa07('0x21')]=[{'filename':_0x2b7773,'path':_0x572954}];}else{_0x66316b['message'][_0xaa07('0x24')]=_0xaa07('0x25');if(!_0x4b2e8c[_0xaa07('0x26')]){_0x329a4f=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x329a4f){return client[_0xaa07('0x27')](_0xaa07('0x28'),_0x66316b)[_0xaa07('0x29')](function(_0x38c7c2){if(_0x38c7c2['error']){return logger['error'](_0xaa07('0x2a'),JSON['stringify'](_0x38c7c2));}return logger[_0xaa07('0xb')](_0xaa07('0x2b'));})['catch'](function(_0x39fe70){return logger['error'](_0xaa07('0x2a'),JSON['stringify'](_0x39fe70));});}};}function handleError(){return function(_0x770014){return logger['error'](JSON[_0xaa07('0x23')](_0x770014));};}function handleResult(_0x194f6){return function(_0x4ccf09){logger[_0xaa07('0xb')](_0xaa07('0x2c'),JSON['stringify'](_0x4ccf09));if(_0x194f6[_0xaa07('0x10')]&&_0x194f6['MailAccount']['Smtp']&&!_[_0xaa07('0x2d')](_0x194f6[_0xaa07('0xf')])){setTimeout(handleSendEmail(_0x194f6,_0x4ccf09),0x3c*0x3e8);}};}function handleJob(_0x2d005a){return function(){try{if(_[_0xaa07('0x2d')](_0x2d005a[_0xaa07('0x14')])){return logger['info'](_0xaa07('0x2e'));}if(_[_0xaa07('0x2d')](_0x2d005a[_0xaa07('0x15')])){return logger[_0xaa07('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x26b366={'startDate':moment()[_0xaa07('0x2f')](_0x2d005a['subtractNumber'],_0x2d005a[_0xaa07('0x15')])[_0xaa07('0x13')](_0xaa07('0x30')),'endDate':moment()['format'](_0xaa07('0x30')),'type':_0xaa07('0x31'),'output':_0x2d005a[_0xaa07('0x32')],'name':_0x2d005a[_0xaa07('0xe')]};if(!_['isNil'](_0x2d005a[_0xaa07('0x33')])){logger[_0xaa07('0xb')](_0xaa07('0x34'),_0x2d005a[_0xaa07('0x33')]);return analyticDefaultReportController[_0xaa07('0x35')]({'id':_0x2d005a[_0xaa07('0x33')]},_0x26b366)[_0xaa07('0x29')](handleResult(_0x2d005a))[_0xaa07('0x36')](handleError());}if(!_[_0xaa07('0x2d')](_0x2d005a[_0xaa07('0x37')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x2d005a[_0xaa07('0x37')]);return analyticCustomReportController[_0xaa07('0x35')]({'id':_0x2d005a[_0xaa07('0x37')]},_0x26b366)['then'](handleResult(_0x2d005a))[_0xaa07('0x36')](handleError());}}catch(_0x56f42b){logger[_0xaa07('0x38')](JSON['stringify'](_0x56f42b));}return logger[_0xaa07('0xb')](_0xaa07('0x39'));};}function getJobs(_0x3b866e){var _0x43ad27={};if(_0x3b866e){_0x43ad27['id']=_0x3b866e;}return db['Schedule'][_0xaa07('0x3a')]({'where':_0x43ad27,'include':[{'model':db[_0xaa07('0x10')],'attributes':['id',_0xaa07('0xe'),_0xaa07('0xf')],'include':[{'model':db[_0xaa07('0x3b')],'as':_0xaa07('0x11'),'include':[{'model':db[_0xaa07('0x3c')],'as':_0xaa07('0x3c')}]}]}]})[_0xaa07('0x29')](function(_0x2f05b1){var _0x5a7ae0=_['keys'](manager[_0xaa07('0x3d')]);var _0x3ba1b6=_[_0xaa07('0x3e')](_0x2f05b1,function(_0x96fb52){return _0x96fb52['id'][_0xaa07('0x3f')]();});var _0x36a59e=_[_0xaa07('0x40')](_0x2f05b1,function(_0x40c5ab){return _0x40c5ab['id']['toString']();});var _0x387880=_0x3b866e?_0x3ba1b6:_[_0xaa07('0x41')](_0x3ba1b6,_0x5a7ae0);var _0x6fb9b5=_[_0xaa07('0x42')](_0x3ba1b6,_0x5a7ae0);var _0x1b6cd8=_[_0xaa07('0x41')](_0x5a7ae0,_0x3ba1b6);var _0x1a4639;var _0x1b3d2d;for(_0x1a4639=0x0;_0x1a4639<_0x1b6cd8[_0xaa07('0x43')]&&!_0x3b866e;_0x1a4639+=0x1){_0x1b3d2d=_0x1b6cd8[_0x1a4639]['toString']();if(manager[_0xaa07('0x44')](_0x1b3d2d)){manager[_0xaa07('0x45')](_0x1b3d2d);manager[_0xaa07('0x46')](_0x1b3d2d);logger['info'](_0xaa07('0x47'),_0x1b3d2d);}}logger[_0xaa07('0xb')](_0xaa07('0x48'),JSON[_0xaa07('0x23')](_0x387880));for(_0x1a4639=0x0;_0x1a4639<_0x387880[_0xaa07('0x43')];_0x1a4639+=0x1){_0x1b3d2d=_0x387880[_0x1a4639][_0xaa07('0x3f')]();logger['info']('index',_0x1b3d2d);if(_0x3b866e){logger[_0xaa07('0xb')](_0xaa07('0x49'),_0x3b866e);logger['info'](JSON[_0xaa07('0x23')](_0x36a59e[_0x1b3d2d]));BPromise['resolve']()[_0xaa07('0x29')](handleJob(_0x36a59e[_0x1b3d2d]));logger['info'](_0xaa07('0x4a'),_0x36a59e[_0x1b3d2d]['name'],_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')]);}else if(_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')]&&_0x36a59e[_0x1b3d2d][_0xaa07('0x4c')]&&moment()[_0xaa07('0x4d')](_0x36a59e[_0x1b3d2d][_0xaa07('0x4e')],_0x36a59e[_0x1b3d2d]['endAt'])){manager['add'](_0x1b3d2d,_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')],handleJob(_0x36a59e[_0x1b3d2d]));manager[_0xaa07('0x4f')](_0x1b3d2d);logger[_0xaa07('0xb')](_0xaa07('0x50'),_0x36a59e[_0x1b3d2d][_0xaa07('0xe')],_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')]);}else if(manager[_0xaa07('0x44')](_0x1b3d2d)){manager[_0xaa07('0x45')](_0x1b3d2d);manager[_0xaa07('0x46')](_0x1b3d2d);logger[_0xaa07('0xb')](_0xaa07('0x51'),_0x36a59e[_0x1b3d2d][_0xaa07('0xe')],_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')]);}}for(_0x1a4639=0x0,_0x1b3d2d;_0x1a4639<_0x6fb9b5[_0xaa07('0x43')]&&!_0x3b866e;_0x1a4639+=0x1){_0x1b3d2d=_0x6fb9b5[_0x1a4639][_0xaa07('0x3f')]();if(manager[_0xaa07('0x44')](_0x1b3d2d)){if(_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')]&&_0x36a59e[_0x1b3d2d]['active']&&moment()[_0xaa07('0x4d')](_0x36a59e[_0x1b3d2d][_0xaa07('0x4e')],_0x36a59e[_0x1b3d2d]['endAt'])){manager['update'](_0x1b3d2d,_0x36a59e[_0x1b3d2d][_0xaa07('0x4b')],handleJob(_0x36a59e[_0x1b3d2d]));logger['info'](_0xaa07('0x52'),_0x36a59e[_0x1b3d2d][_0xaa07('0xe')],_0x36a59e[_0x1b3d2d]['cron']);}else{manager[_0xaa07('0x45')](_0x1b3d2d);manager[_0xaa07('0x46')](_0x1b3d2d);logger[_0xaa07('0xb')](_0xaa07('0x51'),_0x36a59e[_0x1b3d2d]['name'],_0x36a59e[_0x1b3d2d]['cron']);}}}})[_0xaa07('0x36')](function(_0x3f73c8){logger[_0xaa07('0x38')](JSON[_0xaa07('0x23')](_0x3f73c8));});}exports[_0xaa07('0x53')]=function(_0x5c4c65){return getJobs(_0x5c4c65);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 411e32f..c55a5cc 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 _0xe99c=['Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Positive','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','all','error','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','transcribeName','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','format','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','CloudProvider','findOne','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xe99c,0x197));var _0xce99=function(_0x19b860,_0x4ffb60){_0x19b860=_0x19b860-0x0;var _0x31dbc4=_0xe99c[_0x19b860];return _0x31dbc4;};var _=require(_0xce99('0x0'));var AWS=require('aws-sdk');var rp=require(_0xce99('0x1'));var util=require(_0xce99('0x2'));var BPromise=require(_0xce99('0x3'));var db=require(_0xce99('0x4'))['db'];var logger=require(_0xce99('0x5'))(_0xce99('0x6'));function getTranscriptionJob(_0x5e5c2d,_0x58c455,_0x2e4043,_0x577adc){return new Promise(function(_0x32fc7e,_0x58e2aa){var _0x3755dd=new AWS[(_0xce99('0x7'))]({'accessKeyId':_0x58c455,'secretAccessKey':_0x5e5c2d,'region':_0x2e4043});_0x3755dd[_0xce99('0x8')]({'TranscriptionJobName':_0x577adc},function(_0x732cca,_0x39df1c){if(_0x732cca){return _0x58e2aa(_0x732cca);}else{return _0x32fc7e(_0x39df1c);}});});}function sentiment(_0x3675ef,_0x29f7db,_0x48aa48,_0x5727f2,_0x3ceb6f){return new Promise(function(_0xed09d1,_0x4c7423){var _0x26ac93=new AWS[(_0xce99('0x9'))]({'accessKeyId':_0x29f7db,'secretAccessKey':_0x3675ef,'region':_0x48aa48});_0x26ac93[_0xce99('0xa')]({'Text':_0x5727f2,'LanguageCode':_0x3ceb6f['substring'](0x0,0x2)},function(_0x368389,_0x4e83af){if(_0x368389){return _0x4c7423(_0x368389);}else{return _0xed09d1(_0x4e83af);}});});}function checkTranscribeJob(_0x1ad149,_0x3e1606,_0x55a29a){var _0x598662;return new BPromise(function(_0x384c94,_0x115e85){logger[_0xce99('0xb')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1ad149['id'],_0x1ad149[_0xce99('0xc')]));return getTranscriptionJob(_0x55a29a['data1'],_0x55a29a[_0xce99('0xd')],_0x3e1606['transcribeRegion'],_0x1ad149[_0xce99('0xc')])[_0xce99('0xe')](function(_0x18b3d3){logger['info'](util['format'](_0xce99('0xf'),_0x1ad149['id'],_0x1ad149[_0xce99('0xc')],_0x18b3d3[_0xce99('0x10')]['TranscriptionJobStatus']));if(!_0x1ad149[_0xce99('0x11')]){switch(_0x18b3d3[_0xce99('0x10')][_0xce99('0x12')]){case _0xce99('0x13'):var _0x3f2427={'transcribeStatus':_0x18b3d3[_0xce99('0x10')][_0xce99('0x12')],'fileUri':_0x18b3d3['TranscriptionJob'][_0xce99('0x14')]['TranscriptFileUri']};logger[_0xce99('0xb')](util[_0xce99('0x15')](_0xce99('0x16'),_0x1ad149['id']));return rp({'uri':_0x18b3d3[_0xce99('0x10')][_0xce99('0x14')][_0xce99('0x17')],'json':!![]})['then'](function(_0x18ac4e){logger[_0xce99('0xb')](util['format'](_0xce99('0x18'),_0x1ad149['id']));if(_0x18ac4e&&_0x18ac4e[_0xce99('0x19')]&&_0x18ac4e[_0xce99('0x19')][_0xce99('0x1a')]&&_0x18ac4e[_0xce99('0x19')][_0xce99('0x1a')][_0xce99('0x1b')]){_0x3f2427[_0xce99('0x11')]='';for(var _0x4061e7=0x0;_0x4061e7<_0x18ac4e[_0xce99('0x19')][_0xce99('0x1a')][_0xce99('0x1b')];_0x4061e7++){_0x3f2427[_0xce99('0x11')]+=_0x18ac4e[_0xce99('0x19')][_0xce99('0x1a')][_0x4061e7][_0xce99('0x1c')]+'';}}return _0x1ad149[_0xce99('0x1d')](_0x3f2427);})[_0xce99('0xe')](function(){logger[_0xce99('0xb')](util[_0xce99('0x15')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ad149['id']));if(!_0x1ad149['tempSentiment']){throw new db[(_0xce99('0x1e'))][(_0xce99('0x1f'))](_0xce99('0x20'));}if(!_0x3e1606['sentiment']||!_0x3e1606[_0xce99('0x21')]||!_0x3e1606[_0xce99('0x22')]||!_0x3e1606[_0xce99('0x23')]||!_0x3e1606['bucket']){throw new db['Sequelize'][(_0xce99('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3f2427[_0xce99('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x3e1606[_0xce99('0x21')]===_0x55a29a['id']){return _0x55a29a;}else{return db[_0xce99('0x24')][_0xce99('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xce99('0xe')](function(_0x1640dd){if(!_0x1640dd){throw new db[(_0xce99('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1640dd[_0xce99('0x26')]||!_0x1640dd['data2']){throw new db[(_0xce99('0x1e'))][(_0xce99('0x1f'))](_0xce99('0x27'));}_0x598662=_0x1640dd;logger[_0xce99('0xb')](util[_0xce99('0x15')](_0xce99('0x28'),_0x1ad149['id']));return sentiment(_0x598662[_0xce99('0x26')],_0x598662[_0xce99('0xd')],_0x3e1606['sentimentRegion'],_0x3f2427[_0xce99('0x11')],_0x3e1606[_0xce99('0x23')]);})[_0xce99('0xe')](function(_0xf50024){logger['info'](util[_0xce99('0x15')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1ad149['id']));return _0x1ad149[_0xce99('0x1d')]({'sentiment':_0xf50024[_0xce99('0x29')],'sPositive':_0xf50024[_0xce99('0x2a')]['Positive'],'sNegative':_0xf50024[_0xce99('0x2a')][_0xce99('0x2b')],'sMixed':_0xf50024[_0xce99('0x2a')][_0xce99('0x2c')],'sNeutral':_0xf50024[_0xce99('0x2a')][_0xce99('0x2d')]});})[_0xce99('0xe')](function(){logger[_0xce99('0xb')](util['format'](_0xce99('0x2e'),_0x1ad149['id']));_0x384c94();});case _0xce99('0x2f'):return _0x1ad149['update']({'transcribeStatus':_0xce99('0x2f'),'failureReason':_0x18b3d3[_0xce99('0x10')][_0xce99('0x30')]})['then'](function(){logger[_0xce99('0xb')](util['format'](_0xce99('0x2e'),_0x1ad149['id']));_0x384c94();});default:logger[_0xce99('0xb')](util[_0xce99('0x15')](_0xce99('0x31'),_0x1ad149['id']));break;}}else{return BPromise[_0xce99('0x32')]()[_0xce99('0xe')](function(){if(!_0x1ad149['tempSentiment']){throw new db[(_0xce99('0x1e'))][(_0xce99('0x1f'))](_0xce99('0x20'));}if(!_0x3e1606[_0xce99('0x33')]||!_0x3e1606['sentimentAccountId']||!_0x3e1606[_0xce99('0x22')]||!_0x3e1606[_0xce99('0x23')]||!_0x3e1606[_0xce99('0x34')]){throw new db[(_0xce99('0x1e'))]['ValidationError'](_0xce99('0x35'));}if(!_0x1ad149['fileText']){throw new Error(_0xce99('0x36'));}if(_0x3e1606[_0xce99('0x21')]===_0x55a29a['id']){return _0x55a29a;}else{return db[_0xce99('0x24')]['findOne']({'where':{'id':_settings[_0xce99('0x21')]}});}})[_0xce99('0xe')](function(_0x4a16b7){if(!_0x4a16b7){throw new db[(_0xce99('0x1e'))][(_0xce99('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4a16b7[_0xce99('0x26')]||!_0x4a16b7[_0xce99('0xd')]){throw new db['Sequelize'][(_0xce99('0x1f'))](_0xce99('0x27'));}_0x598662=_0x4a16b7;logger[_0xce99('0xb')](util[_0xce99('0x15')](_0xce99('0x28'),_0x1ad149['id']));return sentiment(_0x598662['data1'],_0x598662['data2'],_0x3e1606[_0xce99('0x22')],_0x1ad149['fileText'],_0x3e1606[_0xce99('0x23')]);})['then'](function(_0x2d8ec9){logger[_0xce99('0xb')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1ad149['id']));return _0x1ad149[_0xce99('0x1d')]({'sentiment':_0x2d8ec9[_0xce99('0x29')],'sPositive':_0x2d8ec9[_0xce99('0x2a')][_0xce99('0x37')],'sNegative':_0x2d8ec9['SentimentScore'][_0xce99('0x2b')],'sMixed':_0x2d8ec9[_0xce99('0x2a')][_0xce99('0x2c')],'sNeutral':_0x2d8ec9[_0xce99('0x2a')]['Neutral'],'transcribeStatus':_0xce99('0x13')});})[_0xce99('0xe')](function(){logger['info'](util[_0xce99('0x15')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ad149['id']));_0x384c94();});}})[_0xce99('0x38')](function(_0x137cb0){if(_0x137cb0){if(!_0x137cb0[_0xce99('0x39')]||_0x137cb0[_0xce99('0x39')]!==_0xce99('0x3a')){logger['error'](util[_0xce99('0x15')](_0xce99('0x3b'),_0x1ad149['id']),util[_0xce99('0x3c')](_0x137cb0,{'showHidden':![],'depth':null}));}}_0x384c94();});});}function checkTranscribe(){var _0x48b851;var _0x2bd7c2;var _0x599b3a;return db[_0xce99('0x3d')][_0xce99('0x3e')]({'where':{'transcribeStatus':_0xce99('0x3f')}})[_0xce99('0xe')](function(_0x28ad59){if(!_0x28ad59||!_0x28ad59[_0xce99('0x1b')]){throw new db[(_0xce99('0x1e'))][(_0xce99('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x48b851=_0x28ad59;return db[_0xce99('0x40')][_0xce99('0x25')]({'where':{'id':0x1}});})[_0xce99('0xe')](function(_0x2322cd){if(!_0x2322cd){throw new db['Sequelize'][(_0xce99('0x1f'))](_0xce99('0x41'));}_0x2bd7c2=_0x2322cd;if(!_0x2bd7c2[_0xce99('0x6')]||!_0x2bd7c2[_0xce99('0x42')]||!_0x2bd7c2[_0xce99('0x43')]||!_0x2bd7c2[_0xce99('0x23')]||!_0x2bd7c2[_0xce99('0x34')]){throw new db['Sequelize']['ValidationError'](_0xce99('0x44'));}return db[_0xce99('0x24')][_0xce99('0x25')]({'where':{'id':_0x2bd7c2['transcribeAccountId']}});})[_0xce99('0xe')](function(_0x484a38){if(!_0x484a38){throw new db['Sequelize'][(_0xce99('0x1f'))](_0xce99('0x45'));}if(!_0x484a38['data1']||!_0x484a38[_0xce99('0xd')]){throw new db[(_0xce99('0x1e'))][(_0xce99('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x599b3a=_0x484a38;var _0x465816=[];_0x48b851[_0xce99('0x46')](function(_0x3319a6){_0x465816[_0xce99('0x47')](checkTranscribeJob(_0x3319a6,_0x2bd7c2,_0x599b3a));});return BPromise[_0xce99('0x48')](_0x465816);})[_0xce99('0x38')](function(_0x5a1d3c){if(_0x5a1d3c){if(!_0x5a1d3c[_0xce99('0x39')]||_0x5a1d3c['name']!==_0xce99('0x3a')){logger[_0xce99('0x49')](util[_0xce99('0x3c')](_0x5a1d3c,{'showHidden':![],'depth':null}));}}});}exports[_0xce99('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa596=['TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','update','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Sequelize','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','bucket','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s'];(function(_0x278f74,_0x54625a){var _0x17b4bd=function(_0x10ed8e){while(--_0x10ed8e){_0x278f74['push'](_0x278f74['shift']());}};_0x17b4bd(++_0x54625a);}(_0xa596,0x7b));var _0x6a59=function(_0x3d99f0,_0x39115d){_0x3d99f0=_0x3d99f0-0x0;var _0xa63db4=_0xa596[_0x3d99f0];return _0xa63db4;};var _=require(_0x6a59('0x0'));var AWS=require(_0x6a59('0x1'));var rp=require('request-promise');var util=require(_0x6a59('0x2'));var BPromise=require(_0x6a59('0x3'));var db=require(_0x6a59('0x4'))['db'];var logger=require(_0x6a59('0x5'))(_0x6a59('0x6'));function getTranscriptionJob(_0xf0435f,_0x11cce1,_0x272793,_0x4f42f6){return new Promise(function(_0x37d9ef,_0x3fab57){var _0x21e97f=new AWS[(_0x6a59('0x7'))]({'accessKeyId':_0x11cce1,'secretAccessKey':_0xf0435f,'region':_0x272793});_0x21e97f[_0x6a59('0x8')]({'TranscriptionJobName':_0x4f42f6},function(_0x3c392f,_0x5aa5fe){if(_0x3c392f){return _0x3fab57(_0x3c392f);}else{return _0x37d9ef(_0x5aa5fe);}});});}function sentiment(_0x3f25d8,_0x48ecee,_0x21008c,_0x49be8c,_0x55ef5b){return new Promise(function(_0x3b44b5,_0x6e6ef7){var _0x24041e=new AWS['Comprehend']({'accessKeyId':_0x48ecee,'secretAccessKey':_0x3f25d8,'region':_0x21008c});_0x24041e[_0x6a59('0x9')]({'Text':_0x49be8c,'LanguageCode':_0x55ef5b[_0x6a59('0xa')](0x0,0x2)},function(_0x5a8484,_0x4e2323){if(_0x5a8484){return _0x6e6ef7(_0x5a8484);}else{return _0x3b44b5(_0x4e2323);}});});}function checkTranscribeJob(_0x4bf880,_0x23e9e3,_0x3075ca){var _0x177506;return new BPromise(function(_0x68dd0a,_0x1b0d74){logger[_0x6a59('0xb')](util[_0x6a59('0xc')](_0x6a59('0xd'),_0x4bf880['id'],_0x4bf880[_0x6a59('0xe')]));return getTranscriptionJob(_0x3075ca[_0x6a59('0xf')],_0x3075ca[_0x6a59('0x10')],_0x23e9e3['transcribeRegion'],_0x4bf880[_0x6a59('0xe')])[_0x6a59('0x11')](function(_0x416613){logger[_0x6a59('0xb')](util[_0x6a59('0xc')](_0x6a59('0x12'),_0x4bf880['id'],_0x4bf880['transcribeName'],_0x416613[_0x6a59('0x13')][_0x6a59('0x14')]));if(!_0x4bf880[_0x6a59('0x15')]){switch(_0x416613[_0x6a59('0x13')][_0x6a59('0x14')]){case _0x6a59('0x16'):var _0x4988e2={'transcribeStatus':_0x416613[_0x6a59('0x13')][_0x6a59('0x14')],'fileUri':_0x416613[_0x6a59('0x13')][_0x6a59('0x17')][_0x6a59('0x18')]};logger[_0x6a59('0xb')](util[_0x6a59('0xc')](_0x6a59('0x19'),_0x4bf880['id']));return rp({'uri':_0x416613[_0x6a59('0x13')][_0x6a59('0x17')]['TranscriptFileUri'],'json':!![]})[_0x6a59('0x11')](function(_0x3e068b){logger[_0x6a59('0xb')](util[_0x6a59('0xc')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4bf880['id']));if(_0x3e068b&&_0x3e068b['results']&&_0x3e068b[_0x6a59('0x1a')][_0x6a59('0x1b')]&&_0x3e068b[_0x6a59('0x1a')][_0x6a59('0x1b')]['length']){_0x4988e2['fileText']='';for(var _0x344cea=0x0;_0x344cea<_0x3e068b[_0x6a59('0x1a')]['transcripts'][_0x6a59('0x1c')];_0x344cea++){_0x4988e2['fileText']+=_0x3e068b[_0x6a59('0x1a')][_0x6a59('0x1b')][_0x344cea]['transcript']+'';}}return _0x4bf880[_0x6a59('0x1d')](_0x4988e2);})['then'](function(){logger[_0x6a59('0xb')](util[_0x6a59('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4bf880['id']));if(!_0x4bf880[_0x6a59('0x1e')]){throw new db['Sequelize'][(_0x6a59('0x1f'))](_0x6a59('0x20'));}if(!_0x23e9e3[_0x6a59('0x21')]||!_0x23e9e3[_0x6a59('0x22')]||!_0x23e9e3[_0x6a59('0x23')]||!_0x23e9e3[_0x6a59('0x24')]||!_0x23e9e3['bucket']){throw new db['Sequelize'][(_0x6a59('0x1f'))](_0x6a59('0x25'));}if(!_0x4988e2['fileText']){throw new Error(_0x6a59('0x26'));}if(_0x23e9e3['sentimentAccountId']===_0x3075ca['id']){return _0x3075ca;}else{return db[_0x6a59('0x27')][_0x6a59('0x28')]({'where':{'id':_settings[_0x6a59('0x22')]}});}})['then'](function(_0x360e16){if(!_0x360e16){throw new db[(_0x6a59('0x29'))][(_0x6a59('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x360e16[_0x6a59('0xf')]||!_0x360e16[_0x6a59('0x10')]){throw new db['Sequelize'][(_0x6a59('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x177506=_0x360e16;logger[_0x6a59('0xb')](util[_0x6a59('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4bf880['id']));return sentiment(_0x177506[_0x6a59('0xf')],_0x177506[_0x6a59('0x10')],_0x23e9e3['sentimentRegion'],_0x4988e2['fileText'],_0x23e9e3['language']);})['then'](function(_0x49542a){logger[_0x6a59('0xb')](util[_0x6a59('0xc')](_0x6a59('0x2a'),_0x4bf880['id']));return _0x4bf880['update']({'sentiment':_0x49542a[_0x6a59('0x2b')],'sPositive':_0x49542a[_0x6a59('0x2c')]['Positive'],'sNegative':_0x49542a['SentimentScore'][_0x6a59('0x2d')],'sMixed':_0x49542a['SentimentScore'][_0x6a59('0x2e')],'sNeutral':_0x49542a[_0x6a59('0x2c')][_0x6a59('0x2f')]});})[_0x6a59('0x11')](function(){logger[_0x6a59('0xb')](util[_0x6a59('0xc')](_0x6a59('0x30'),_0x4bf880['id']));_0x68dd0a();});case _0x6a59('0x31'):return _0x4bf880[_0x6a59('0x1d')]({'transcribeStatus':_0x6a59('0x31'),'failureReason':_0x416613[_0x6a59('0x13')][_0x6a59('0x32')]})[_0x6a59('0x11')](function(){logger[_0x6a59('0xb')](util[_0x6a59('0xc')](_0x6a59('0x30'),_0x4bf880['id']));_0x68dd0a();});default:logger['info'](util[_0x6a59('0xc')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4bf880['id']));break;}}else{return BPromise[_0x6a59('0x33')]()[_0x6a59('0x11')](function(){if(!_0x4bf880[_0x6a59('0x1e')]){throw new db[(_0x6a59('0x29'))][(_0x6a59('0x1f'))](_0x6a59('0x20'));}if(!_0x23e9e3[_0x6a59('0x21')]||!_0x23e9e3[_0x6a59('0x22')]||!_0x23e9e3[_0x6a59('0x23')]||!_0x23e9e3['language']||!_0x23e9e3[_0x6a59('0x34')]){throw new db[(_0x6a59('0x29'))][(_0x6a59('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4bf880['fileText']){throw new Error(_0x6a59('0x26'));}if(_0x23e9e3[_0x6a59('0x22')]===_0x3075ca['id']){return _0x3075ca;}else{return db[_0x6a59('0x27')]['findOne']({'where':{'id':_settings[_0x6a59('0x22')]}});}})[_0x6a59('0x11')](function(_0x399532){if(!_0x399532){throw new db['Sequelize']['ValidationError'](_0x6a59('0x35'));}if(!_0x399532[_0x6a59('0xf')]||!_0x399532[_0x6a59('0x10')]){throw new db[(_0x6a59('0x29'))][(_0x6a59('0x1f'))](_0x6a59('0x36'));}_0x177506=_0x399532;logger['info'](util['format'](_0x6a59('0x37'),_0x4bf880['id']));return sentiment(_0x177506['data1'],_0x177506[_0x6a59('0x10')],_0x23e9e3[_0x6a59('0x23')],_0x4bf880['fileText'],_0x23e9e3[_0x6a59('0x24')]);})[_0x6a59('0x11')](function(_0x267a4b){logger[_0x6a59('0xb')](util[_0x6a59('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4bf880['id']));return _0x4bf880[_0x6a59('0x1d')]({'sentiment':_0x267a4b['Sentiment'],'sPositive':_0x267a4b['SentimentScore']['Positive'],'sNegative':_0x267a4b[_0x6a59('0x2c')][_0x6a59('0x2d')],'sMixed':_0x267a4b[_0x6a59('0x2c')]['Mixed'],'sNeutral':_0x267a4b[_0x6a59('0x2c')][_0x6a59('0x2f')],'transcribeStatus':_0x6a59('0x16')});})['then'](function(){logger['info'](util['format'](_0x6a59('0x30'),_0x4bf880['id']));_0x68dd0a();});}})['catch'](function(_0xa17ed9){if(_0xa17ed9){if(!_0xa17ed9[_0x6a59('0x38')]||_0xa17ed9['name']!=='SequelizeValidationError'){logger['error'](util[_0x6a59('0xc')](_0x6a59('0x39'),_0x4bf880['id']),util[_0x6a59('0x3a')](_0xa17ed9,{'showHidden':![],'depth':null}));}}_0x68dd0a();});});}function checkTranscribe(){var _0x180dc4;var _0x1509e2;var _0x11715b;return db[_0x6a59('0x3b')]['findAll']({'where':{'transcribeStatus':_0x6a59('0x3c')}})[_0x6a59('0x11')](function(_0xbc5b1a){if(!_0xbc5b1a||!_0xbc5b1a[_0x6a59('0x1c')]){throw new db[(_0x6a59('0x29'))]['ValidationError'](_0x6a59('0x3d'));}_0x180dc4=_0xbc5b1a;return db[_0x6a59('0x3e')][_0x6a59('0x28')]({'where':{'id':0x1}});})[_0x6a59('0x11')](function(_0x278e7a){if(!_0x278e7a){throw new db[(_0x6a59('0x29'))]['ValidationError'](_0x6a59('0x3f'));}_0x1509e2=_0x278e7a;if(!_0x1509e2['transcribe']||!_0x1509e2[_0x6a59('0x40')]||!_0x1509e2[_0x6a59('0x41')]||!_0x1509e2[_0x6a59('0x24')]||!_0x1509e2['bucket']){throw new db['Sequelize']['ValidationError'](_0x6a59('0x42'));}return db[_0x6a59('0x27')]['findOne']({'where':{'id':_0x1509e2[_0x6a59('0x40')]}});})[_0x6a59('0x11')](function(_0x31aa4e){if(!_0x31aa4e){throw new db[(_0x6a59('0x29'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x31aa4e[_0x6a59('0xf')]||!_0x31aa4e[_0x6a59('0x10')]){throw new db[(_0x6a59('0x29'))][(_0x6a59('0x1f'))](_0x6a59('0x36'));}_0x11715b=_0x31aa4e;var _0x574c24=[];_0x180dc4['forEach'](function(_0x1a118e){_0x574c24[_0x6a59('0x43')](checkTranscribeJob(_0x1a118e,_0x1509e2,_0x11715b));});return BPromise[_0x6a59('0x44')](_0x574c24);})['catch'](function(_0x328e78){if(_0x328e78){if(!_0x328e78['name']||_0x328e78[_0x6a59('0x38')]!==_0x6a59('0x45')){logger['error'](util[_0x6a59('0x3a')](_0x328e78,{'showHidden':![],'depth':null}));}}});}exports[_0x6a59('0x46')]=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 0eda127..df1eeaa 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 _0x2a6f=['hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','error','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt'];(function(_0x2b2ab3,_0x386ce0){var _0x4f65b9=function(_0x1754f4){while(--_0x1754f4){_0x2b2ab3['push'](_0x2b2ab3['shift']());}};_0x4f65b9(++_0x386ce0);}(_0x2a6f,0x15b));var _0xf2a6=function(_0x56d04b,_0x459ce3){_0x56d04b=_0x56d04b-0x0;var _0x583d8f=_0x2a6f[_0x56d04b];return _0x583d8f;};'use strict';var _=require(_0xf2a6('0x0'));var moment=require(_0xf2a6('0x1'));var Redis=require(_0xf2a6('0x2'));var util=require(_0xf2a6('0x3'));var config=require('../../config/environment');var db=require(_0xf2a6('0x4'))['db'];var logger=require(_0xf2a6('0x5'))(_0xf2a6('0x6'));config[_0xf2a6('0x7')]=_[_0xf2a6('0x8')](config[_0xf2a6('0x7')],{'host':_0xf2a6('0x9'),'port':0x18eb});var io=require(_0xf2a6('0xa'))(new Redis(config[_0xf2a6('0x7')]));function closeInteractions(){var _0x2c3fae=[];return db['WhatsappInteraction'][_0xf2a6('0xb')]({'raw':!![],'attributes':['id',_0xf2a6('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xf2a6('0xd'))}}})[_0xf2a6('0xe')](function(_0x316d64){if(_0x316d64&&_0x316d64[_0xf2a6('0xf')]){_0x2c3fae=_[_0xf2a6('0x10')](_0x316d64||[],'id');logger['info'](_0xf2a6('0x11'),_0x2c3fae['join']());return db[_0xf2a6('0x12')][_0xf2a6('0x13')]({'closeReason':'system','disposition':_0xf2a6('0x14'),'closed':!![],'closedAt':moment()[_0xf2a6('0x15')](_0xf2a6('0x16'))},{'where':{'id':_0x2c3fae}});}})[_0xf2a6('0xe')](function(){if(_0x2c3fae&&_0x2c3fae['length']){logger[_0xf2a6('0x17')](_0xf2a6('0x18'),_0x2c3fae[_0xf2a6('0x19')]());for(var _0x1dc34f=0x0;_0x1dc34f<_0x2c3fae[_0xf2a6('0xf')];_0x1dc34f++){io[_0xf2a6('0x1a')]('whatsappInteraction:update',{'id':_0x2c3fae[_0x1dc34f],'closed':!![]});}}})['catch'](function(_0x3ed6d1){logger[_0xf2a6('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3ed6d1?util[_0xf2a6('0x1c')](_0x3ed6d1,{'showHidden':![],'depth':null}):'');});}exports[_0xf2a6('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0185=['system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0x52aa95,_0x5f3c12){var _0x4c4400=function(_0x457c8e){while(--_0x457c8e){_0x52aa95['push'](_0x52aa95['shift']());}};_0x4c4400(++_0x5f3c12);}(_0x0185,0xb3));var _0x5018=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x0185[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x5018('0x0'));var moment=require('moment');var Redis=require(_0x5018('0x1'));var util=require('util');var config=require(_0x5018('0x2'));var db=require(_0x5018('0x3'))['db'];var logger=require(_0x5018('0x4'))(_0x5018('0x5'));config[_0x5018('0x6')]=_['defaults'](config[_0x5018('0x6')],{'host':_0x5018('0x7'),'port':0x18eb});var io=require(_0x5018('0x8'))(new Redis(config[_0x5018('0x6')]));function closeInteractions(){var _0x15f033=[];return db[_0x5018('0x9')][_0x5018('0xa')]({'raw':!![],'attributes':['id',_0x5018('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})[_0x5018('0xc')](function(_0x26f972){if(_0x26f972&&_0x26f972[_0x5018('0xd')]){_0x15f033=_['map'](_0x26f972||[],'id');logger[_0x5018('0xe')](_0x5018('0xf'),_0x15f033[_0x5018('0x10')]());return db[_0x5018('0x9')]['update']({'closeReason':_0x5018('0x11'),'disposition':_0x5018('0x12'),'closed':!![],'closedAt':moment()[_0x5018('0x13')](_0x5018('0x14'))},{'where':{'id':_0x15f033}});}})['then'](function(){if(_0x15f033&&_0x15f033['length']){logger[_0x5018('0xe')](_0x5018('0x15'),_0x15f033[_0x5018('0x10')]());for(var _0x144e3d=0x0;_0x144e3d<_0x15f033[_0x5018('0xd')];_0x144e3d++){io[_0x5018('0x16')](_0x5018('0x17'),{'id':_0x15f033[_0x144e3d],'closed':!![]});}}})[_0x5018('0x18')](function(_0x528e75){logger[_0x5018('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x528e75?util[_0x5018('0x1a')](_0x528e75,{'showHidden':![],'depth':null}):'');});}exports[_0x5018('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 f2379ec..280302a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x730d=['catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','destroy','then','CmContact','bulkCreate','log','finished\x20populating','CmHopper','hopper2'];(function(_0x47ef03,_0x50f4a3){var _0x2299c3=function(_0x50756e){while(--_0x50756e){_0x47ef03['push'](_0x47ef03['shift']());}};_0x2299c3(++_0x50f4a3);}(_0x730d,0xab));var _0xd730=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x730d[_0x18a79d];return _0x4f8848;};'use strict';var util=require(_0xd730('0x0'));var db=require(_0xd730('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd730('0x2')]({'id':i,'firstName':_0xd730('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xd730('0x4')+i+_0xd730('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd730('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd730('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd730('0x6')](),'updatedAt':Date[_0xd730('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd730('0x2')]({'id':i,'firstName':_0xd730('0x3')+i,'lastName':_0xd730('0x7')+i,'phone':0xf879fb460+i,'email':_0xd730('0x4')+i+_0xd730('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd730('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd730('0x6')](),'updatedAt':Date[_0xd730('0x6')]()});}db['CmContact'][_0xd730('0x8')]({'where':{}})[_0xd730('0x9')](function(){return db[_0xd730('0xa')][_0xd730('0xb')](contacts);})[_0xd730('0x9')](function(){console[_0xd730('0xc')](_0xd730('0xd'),'contacts1');return db[_0xd730('0xe')][_0xd730('0x8')]({'where':{}});})[_0xd730('0x9')](function(){return db[_0xd730('0xe')][_0xd730('0xb')](hopper);})[_0xd730('0x9')](function(){console[_0xd730('0xc')]('finished\x20populating','hopper1');return db['CmContact'][_0xd730('0xb')](contacts2);})[_0xd730('0x9')](function(){console[_0xd730('0xc')](_0xd730('0xd'),'contacts2');return db['CmHopper'][_0xd730('0xb')](hopper2);})['then'](function(){console['log'](_0xd730('0xd'),_0xd730('0xf'));})[_0xd730('0x10')](function(_0x50de28){console['log'](_0x50de28);}); \ No newline at end of file +var _0xb2b9=['CmHopper','then','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','log','finished\x20populating','contacts1'];(function(_0x5864ef,_0x496812){var _0x21c244=function(_0x433f8a){while(--_0x433f8a){_0x5864ef['push'](_0x5864ef['shift']());}};_0x21c244(++_0x496812);}(_0xb2b9,0x15b));var _0x9b2b=function(_0x4c52f0,_0x5919c9){_0x4c52f0=_0x4c52f0-0x0;var _0x238400=_0xb2b9[_0x4c52f0];return _0x238400;};'use strict';var util=require(_0x9b2b('0x0'));var db=require(_0x9b2b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9b2b('0x2')]({'id':i,'firstName':_0x9b2b('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x9b2b('0x4')+i+_0x9b2b('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9b2b('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9b2b('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9b2b('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9b2b('0x7')+i,'phone':0xf879fb460+i,'email':_0x9b2b('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9b2b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9b2b('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9b2b('0x6')]()});}db[_0x9b2b('0x8')][_0x9b2b('0x9')]({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0x9b2b('0xa')](_0x9b2b('0xb'),_0x9b2b('0xc'));return db[_0x9b2b('0xd')][_0x9b2b('0x9')]({'where':{}});})[_0x9b2b('0xe')](function(){return db[_0x9b2b('0xd')][_0x9b2b('0xf')](hopper);})[_0x9b2b('0xe')](function(){console[_0x9b2b('0xa')]('finished\x20populating',_0x9b2b('0x10'));return db[_0x9b2b('0x8')][_0x9b2b('0xf')](contacts2);})[_0x9b2b('0xe')](function(){console['log'](_0x9b2b('0xb'),_0x9b2b('0x11'));return db[_0x9b2b('0xd')]['bulkCreate'](hopper2);})[_0x9b2b('0xe')](function(){console[_0x9b2b('0xa')]('finished\x20populating',_0x9b2b('0x12'));})[_0x9b2b('0x13')](function(_0x1db086){console[_0x9b2b('0xa')](_0x1db086);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index a610f96..6b58488 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04ad=['friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','log','add\x20user','catch','util','../mysqldb','format','agent','%s%s','%s%s@xcally.com','password'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x04ad,0x175));var _0xd04a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x04ad[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xd04a('0x0'));var db=require(_0xd04a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xd04a('0x2')]('%s%s',_0xd04a('0x3'),i),'fullname':util[_0xd04a('0x2')](_0xd04a('0x4'),'agent',i),'email':util[_0xd04a('0x2')](_0xd04a('0x5'),'agent',i),'role':'agent','password':_0xd04a('0x6'),'internal':0xfa0+i,'type':_0xd04a('0x7'),'transport':['udp','ws',_0xd04a('0x8')],'disallow':['all'],'allow':[_0xd04a('0x9')],'defaultuser':util[_0xd04a('0x2')]('%s%s',_0xd04a('0x3'),i),'encryption':_0xd04a('0xa'),'avpf':'yes','force_avp':'yes','icesupport':_0xd04a('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xd04a('0xb'),'dtlsprivatekey':_0xd04a('0xc'),'dtlssetup':_0xd04a('0xd'),'callerid':util[_0xd04a('0x2')](_0xd04a('0xe'),util[_0xd04a('0x2')](_0xd04a('0x4'),'agent',i),0xfa0+i)});}db[_0xd04a('0xf')]['bulkCreate'](users)['then'](function(){console[_0xd04a('0x10')](_0xd04a('0x11'));})[_0xd04a('0x12')](function(_0x41ef17){console[_0xd04a('0x10')](_0x41ef17);}); \ No newline at end of file +var _0x4029=['%s%s','%s%s@xcally.com','password','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','catch','util','../mysqldb','push','format','agent'];(function(_0x37ae2e,_0x35be3a){var _0x19c50f=function(_0x49732a){while(--_0x49732a){_0x37ae2e['push'](_0x37ae2e['shift']());}};_0x19c50f(++_0x35be3a);}(_0x4029,0x12b));var _0x9402=function(_0x3dbc69,_0x17d1df){_0x3dbc69=_0x3dbc69-0x0;var _0x2cf14d=_0x4029[_0x3dbc69];return _0x2cf14d;};'use strict';var util=require(_0x9402('0x0'));var db=require(_0x9402('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9402('0x2')]({'name':util[_0x9402('0x3')]('%s%s',_0x9402('0x4'),i),'fullname':util['format'](_0x9402('0x5'),_0x9402('0x4'),i),'email':util[_0x9402('0x3')](_0x9402('0x6'),_0x9402('0x4'),i),'role':_0x9402('0x4'),'password':_0x9402('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x9402('0x8')],'disallow':[_0x9402('0x9')],'allow':[_0x9402('0xa')],'defaultuser':util['format'](_0x9402('0x5'),'agent',i),'encryption':'yes','avpf':_0x9402('0xb'),'force_avp':_0x9402('0xb'),'icesupport':_0x9402('0xb'),'dtlsenable':_0x9402('0xb'),'dtlsverify':'no','dtlscertfile':_0x9402('0xc'),'dtlsprivatekey':_0x9402('0xd'),'dtlssetup':'actpass','callerid':util[_0x9402('0x3')](_0x9402('0xe'),util['format'](_0x9402('0x5'),_0x9402('0x4'),i),0xfa0+i)});}db[_0x9402('0xf')]['bulkCreate'](users)[_0x9402('0x10')](function(){console[_0x9402('0x11')]('add\x20user');})[_0x9402('0x12')](function(_0x1794af){console['log'](_0x1794af);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index f883e05..58a091f 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cad=['ChatQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','%s:queue:%s','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','WhatsappQueue','Trunk','VoiceQueue','OpenchannelQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','leave','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','join','default','connection','setMaxListeners','address','request','connectedAt','log','SocketIO\x20','nsp','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','type','ivr','UserProfileSection','then','VoiceQueues'];(function(_0x4ff0ab,_0x1ee007){var _0xfd668c=function(_0x2c3e60){while(--_0x2c3e60){_0x4ff0ab['push'](_0x4ff0ab['shift']());}};_0xfd668c(++_0x1ee007);}(_0x4cad,0x179));var _0xd4ca=function(_0x3ffa2e,_0x3874e1){_0x3ffa2e=_0x3ffa2e-0x0;var _0x38493c=_0x4cad[_0x3ffa2e];return _0x38493c;};'use strict';var _=require(_0xd4ca('0x0'));var util=require(_0xd4ca('0x1'));var BPromise=require(_0xd4ca('0x2'));var db=require(_0xd4ca('0x3'))['db'];var config=require(_0xd4ca('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xd4ca('0x5'),'model':db[_0xd4ca('0x6')],'attributes':['id',_0xd4ca('0x7'),_0xd4ca('0x8')],'raw':!![],'where':{'role':_0xd4ca('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd4ca('0x7')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xd4ca('0xa')],'where':{'type':_0xd4ca('0xb')}};function getAssociatedResources(_0x46c3bf,_0x310286,_0x2420e8){return db[_0xd4ca('0xc')]['findOne']({'where':{'name':_0x46c3bf,'userProfileId':_0x310286},'raw':!![]})[_0xd4ca('0xd')](function(_0x382bb4){if(_0x382bb4){if(_0x382bb4['autoAssociation']){switch(_0x46c3bf){case _0xd4ca('0xe'):case _0xd4ca('0xf'):case'FaxQueues':case _0xd4ca('0x10'):case'MailQueues':case _0xd4ca('0x11'):case'WhatsappQueues':return db[_0x2420e8][_0xd4ca('0x12')](queryQueues);case _0xd4ca('0x13'):return db[_0x2420e8][_0xd4ca('0x12')](queryTelephones);case _0xd4ca('0x14'):return db[_0x2420e8]['findAll'](queryTrunks);case _0xd4ca('0x15'):return db[_0x2420e8][_0xd4ca('0x12')](queryCampaigns);}}else{return db[_0xd4ca('0x16')][_0xd4ca('0x12')]({'attributes':[_0xd4ca('0x17')],'where':{'sectionId':_0x382bb4['id']},'raw':!![]})[_0xd4ca('0xd')](function(_0x43cd03){if(_0x43cd03){var _0x12a302={'where':{'id':_[_0xd4ca('0x18')](_0x43cd03,'resourceId')},'raw':!![]};switch(_0x2420e8){case _0xd4ca('0x6'):_0x12a302[_0xd4ca('0x19')][_0xd4ca('0x8')]=_0xd4ca('0x1a');break;case _0xd4ca('0x1b'):_0x12a302[_0xd4ca('0x19')][_0xd4ca('0xa')]=_0xd4ca('0xb');break;}return db[_0x2420e8][_0xd4ca('0x12')](_0x12a302);}else{return[];}});}}else{return[];}})['then'](function(_0x1151bd){return _0x1151bd;});}function joinOrLeaveQueues(_0x17e59f,_0x44c043,_0x3661db,_0x12e211){_0x17e59f[_0x44c043](util['format'](_0xd4ca('0x1c'),_0x3661db,_0x12e211[_0xd4ca('0x7')]));if(_0x12e211[_0xd4ca('0x5')]){for(var _0xbd2d6f=0x0;_0xbd2d6f<_0x12e211[_0xd4ca('0x5')][_0xd4ca('0x1d')];_0xbd2d6f+=0x1){_0x17e59f[_0x44c043](util[_0xd4ca('0x1e')](_0xd4ca('0x1f'),_0x12e211[_0xd4ca('0x5')][_0xbd2d6f][_0xd4ca('0x7')]));}}}function joinOrLeave(_0x2c705e,_0x46bfb3,_0x4300d1){var _0x4b7798;if(_0x2c705e[_0xd4ca('0x20')][_0xd4ca('0x21')]['id']){db[_0xd4ca('0x6')][_0xd4ca('0x22')]({'attributes':['id','name',_0xd4ca('0x8'),_0xd4ca('0x23')],'where':{'id':_0x2c705e[_0xd4ca('0x20')][_0xd4ca('0x21')]['id']},'include':[{'model':db[_0xd4ca('0x24')],'as':_0xd4ca('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd4ca('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd4ca('0x27')],'as':_0xd4ca('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xd4ca('0x29')],'as':_0xd4ca('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xd4ca('0x2b')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xd4ca('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xd4ca('0xd')](function(_0x2bff12){if(_0x2bff12){_0x4b7798=_0x2bff12;_0x2c705e[_0x46bfb3](util[_0xd4ca('0x1e')](_0xd4ca('0x1f'),_0x2bff12[_0xd4ca('0x7')]));var _0x2f4483=[];switch(_0x2bff12[_0xd4ca('0x8')]){case'admin':_0x2c705e[_0x46bfb3](_0xd4ca('0x2d'));_0x2c705e[_0x46bfb3](_0xd4ca('0x2e'));if(queryQueues[_0xd4ca('0x2f')](_0xd4ca('0x30'))){delete queryQueues[_0xd4ca('0x30')];}_0x2f4483[_0xd4ca('0x31')](db['VoiceQueue']['findAll'](queryQueues));_0x2f4483[_0xd4ca('0x31')](db[_0xd4ca('0x32')]['findAll'](queryQueues));_0x2f4483[_0xd4ca('0x31')](db[_0xd4ca('0x33')]['findAll'](queryQueues));_0x2f4483[_0xd4ca('0x31')](db['SmsQueue'][_0xd4ca('0x12')](queryQueues));_0x2f4483[_0xd4ca('0x31')](db[_0xd4ca('0x34')]['findAll'](queryQueues));_0x2f4483[_0xd4ca('0x31')](db['OpenchannelQueue']['findAll'](queryQueues));_0x2f4483[_0xd4ca('0x31')](db[_0xd4ca('0x35')][_0xd4ca('0x12')](queryQueues));_0x2f4483[_0xd4ca('0x31')](db[_0xd4ca('0x6')][_0xd4ca('0x12')](queryTelephones));_0x2f4483[_0xd4ca('0x31')](db[_0xd4ca('0x36')][_0xd4ca('0x12')](queryTrunks));_0x2f4483['push'](db[_0xd4ca('0x1b')][_0xd4ca('0x12')](queryCampaigns));_0x2f4483[_0xd4ca('0x31')](db['User'][_0xd4ca('0x12')](queryAgents));break;case'user':_0x2c705e[_0x46bfb3](_0xd4ca('0x2d'));_0x2c705e[_0x46bfb3](_0xd4ca('0x2e'));_0x2f4483[_0xd4ca('0x31')](getAssociatedResources(_0xd4ca('0xe'),_0x2bff12['userProfileId'],_0xd4ca('0x37')));_0x2f4483[_0xd4ca('0x31')](getAssociatedResources('ChatQueues',_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x32')));_0x2f4483['push'](getAssociatedResources('FaxQueues',_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x33')));_0x2f4483[_0xd4ca('0x31')](getAssociatedResources(_0xd4ca('0x10'),_0x2bff12['userProfileId'],'SmsQueue'));_0x2f4483[_0xd4ca('0x31')](getAssociatedResources('MailQueues',_0x2bff12['userProfileId'],_0xd4ca('0x34')));_0x2f4483['push'](getAssociatedResources('OpenchannelQueues',_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x38')));_0x2f4483['push'](getAssociatedResources('WhatsappQueues',_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x35')));_0x2f4483[_0xd4ca('0x31')](getAssociatedResources(_0xd4ca('0x13'),_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x6')));_0x2f4483['push'](getAssociatedResources(_0xd4ca('0x14'),_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x36')));_0x2f4483[_0xd4ca('0x31')](getAssociatedResources(_0xd4ca('0x15'),_0x2bff12[_0xd4ca('0x23')],_0xd4ca('0x1b')));_0x2f4483[_0xd4ca('0x31')](db['User'][_0xd4ca('0x12')](queryAgents));break;case _0xd4ca('0x9'):_0x2c705e[_0x46bfb3]('voice:inbound');_0x2c705e[_0x46bfb3](_0xd4ca('0x2e'));_0x2f4483[_0xd4ca('0x31')](_0x2bff12[_0xd4ca('0x39')]({'attributes':['id',_0xd4ca('0x7')]}));_0x2f4483[_0xd4ca('0x31')](_0x2bff12[_0xd4ca('0x3a')]({'attributes':['id',_0xd4ca('0x7')]}));_0x2f4483['push'](_0x2bff12[_0xd4ca('0x3b')]({'attributes':['id',_0xd4ca('0x7')]}));_0x2f4483[_0xd4ca('0x31')](_0x2bff12[_0xd4ca('0x3c')]({'attributes':['id',_0xd4ca('0x7')]}));_0x2f4483[_0xd4ca('0x31')](_0x2bff12[_0xd4ca('0x3d')]({'attributes':['id','name']}));_0x2f4483['push'](_0x2bff12[_0xd4ca('0x3e')]({'attributes':['id',_0xd4ca('0x7')]}));_0x2f4483[_0xd4ca('0x31')](_0x2bff12[_0xd4ca('0x3f')]({'attributes':['id','name']}));break;}return BPromise[_0xd4ca('0x40')](_0x2f4483);}})[_0xd4ca('0xd')](function(_0x59d8c6){if(_0x59d8c6&&_0x59d8c6[_0xd4ca('0x1d')]){for(var _0x1472c8=0x0;_0x1472c8<_0x59d8c6[_0xd4ca('0x1d')];_0x1472c8+=0x1){for(var _0x8e57c=0x0;_0x8e57c<_0x59d8c6[_0x1472c8][_0xd4ca('0x1d')];_0x8e57c+=0x1){switch(_0x1472c8){case 0x0:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,_0xd4ca('0x41'),_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x1:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,_0xd4ca('0x42'),_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x2:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,_0xd4ca('0x43'),_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x3:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,_0xd4ca('0x44'),_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x4:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,_0xd4ca('0x45'),_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x5:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,'openchannel',_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x6:joinOrLeaveQueues(_0x2c705e,_0x46bfb3,_0xd4ca('0x46'),_0x59d8c6[_0x1472c8][_0x8e57c]);break;case 0x7:if(_0x4b7798['role']!==_0xd4ca('0x9'))_0x2c705e[_0x46bfb3](util[_0xd4ca('0x1e')](_0xd4ca('0x47'),_0x59d8c6[_0x1472c8][_0x8e57c]['name']));break;case 0x8:if(_0x4b7798[_0xd4ca('0x8')]!==_0xd4ca('0x9'))_0x2c705e[_0x46bfb3](util[_0xd4ca('0x1e')](_0xd4ca('0x48'),_0x59d8c6[_0x1472c8][_0x8e57c][_0xd4ca('0x7')]));break;case 0x9:if(_0x4b7798[_0xd4ca('0x8')]!=='agent')_0x2c705e[_0x46bfb3](util[_0xd4ca('0x1e')](_0xd4ca('0x49'),_0x59d8c6[_0x1472c8][_0x8e57c][_0xd4ca('0xa')],_0x59d8c6[_0x1472c8][_0x8e57c][_0xd4ca('0x7')]));break;case 0xa:_0x2c705e[_0x46bfb3](util[_0xd4ca('0x1e')](_0xd4ca('0x1f'),_0x59d8c6[_0x1472c8][_0x8e57c][_0xd4ca('0x7')]));break;}}}}})['then'](function(){if(_0x46bfb3==='leave'){var _0x1592be=_[_0xd4ca('0x18')](_0x4b7798['ChatInteractions'],'id');return _0x4b7798[_0xd4ca('0x4a')](_0x1592be)[_0xd4ca('0xd')](function(){for(var _0x29c63a=0x0;_0x29c63a<_0x1592be['length'];_0x29c63a+=0x1){_0x4300d1['emit'](_0xd4ca('0x4b'),{'ChatInteractionId':Number(_0x1592be[_0x29c63a]),'UserId':Number(_0x4b7798['id'])});}});}})[_0xd4ca('0xd')](function(){if(_0x46bfb3==='leave'){var _0x94cbc1=_['map'](_0x4b7798['MailInteractions'],'id');return _0x4b7798[_0xd4ca('0x4c')](_0x94cbc1)[_0xd4ca('0xd')](function(){for(var _0x5f22a2=0x0;_0x5f22a2<_0x94cbc1['length'];_0x5f22a2+=0x1){_0x4300d1[_0xd4ca('0x4d')](_0xd4ca('0x4e'),{'MailInteractionId':Number(_0x94cbc1[_0x5f22a2]),'UserId':Number(_0x4b7798['id'])});}});}})[_0xd4ca('0xd')](function(){if(_0x46bfb3==='leave'){var _0x20ed9b=_[_0xd4ca('0x18')](_0x4b7798[_0xd4ca('0x28')],'id');return _0x4b7798['removeFaxInteractions'](_0x20ed9b)[_0xd4ca('0xd')](function(){for(var _0x31d1a1=0x0;_0x31d1a1<_0x20ed9b['length'];_0x31d1a1+=0x1){_0x4300d1[_0xd4ca('0x4d')](_0xd4ca('0x4f'),{'FaxInteractionId':Number(_0x20ed9b[_0x31d1a1]),'UserId':Number(_0x4b7798['id'])});}});}})['then'](function(){if(_0x46bfb3===_0xd4ca('0x50')){var _0x4cb261=_[_0xd4ca('0x18')](_0x4b7798['SmsInteractions'],'id');return _0x4b7798[_0xd4ca('0x51')](_0x4cb261)[_0xd4ca('0xd')](function(){for(var _0x193a5a=0x0;_0x193a5a<_0x4cb261[_0xd4ca('0x1d')];_0x193a5a+=0x1){_0x4300d1[_0xd4ca('0x4d')](_0xd4ca('0x52'),{'SmsInteractionId':Number(_0x4cb261[_0x193a5a]),'UserId':Number(_0x4b7798['id'])});}});}})[_0xd4ca('0xd')](function(){if(_0x46bfb3===_0xd4ca('0x50')){var _0x1629e5=_[_0xd4ca('0x18')](_0x4b7798['OpenchannelInteractions'],'id');return _0x4b7798[_0xd4ca('0x53')](_0x1629e5)[_0xd4ca('0xd')](function(){for(var _0x2dd1bd=0x0;_0x2dd1bd<_0x1629e5['length'];_0x2dd1bd+=0x1){_0x4300d1[_0xd4ca('0x4d')](_0xd4ca('0x54'),{'OpenchannelInteractionId':Number(_0x1629e5[_0x2dd1bd]),'UserId':Number(_0x4b7798['id'])});}});}})['then'](function(){if(_0x46bfb3===_0xd4ca('0x50')){var _0x2fc89f=_[_0xd4ca('0x18')](_0x4b7798[_0xd4ca('0x2c')],'id');return _0x4b7798[_0xd4ca('0x55')](_0x2fc89f)[_0xd4ca('0xd')](function(){for(var _0x17ca49=0x0;_0x17ca49<_0x2fc89f[_0xd4ca('0x1d')];_0x17ca49+=0x1){_0x4300d1[_0xd4ca('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2fc89f[_0x17ca49]),'UserId':Number(_0x4b7798['id'])});}});}})[_0xd4ca('0x56')](function(_0x3d320f){_0x2c705e['log'](_0x3d320f);});}}function onDisconnect(_0x3a4451,_0x5a54f5){joinOrLeave(_0x3a4451,_0xd4ca('0x50'),_0x5a54f5);}function onConnect(_0x3d2f9d){joinOrLeave(_0x3d2f9d,_0xd4ca('0x57'));}exports[_0xd4ca('0x58')]=function(_0x4b37ae){_0x4b37ae['on'](_0xd4ca('0x59'),function(_0xc0bd5a){_0xc0bd5a[_0xd4ca('0x5a')](0x0);_0xc0bd5a[_0xd4ca('0x5b')]=_0xc0bd5a[_0xd4ca('0x5c')][_0xd4ca('0x59')]['remoteAddress']+':'+_0xc0bd5a[_0xd4ca('0x5c')][_0xd4ca('0x59')]['remotePort'];_0xc0bd5a[_0xd4ca('0x5d')]=new Date();_0xc0bd5a[_0xd4ca('0x5e')]=function(_0x300c1e){console[_0xd4ca('0x5e')](_0xd4ca('0x5f')+_0xc0bd5a[_0xd4ca('0x60')]['name']+'['+_0xc0bd5a[_0xd4ca('0x5b')]+']',_0x300c1e);};_0xc0bd5a['on']('disconnect',function(){onDisconnect(_0xc0bd5a,_0x4b37ae);_0xc0bd5a[_0xd4ca('0x5e')]('DISCONNECTED');});onConnect(_0xc0bd5a);_0xc0bd5a[_0xd4ca('0x5e')](_0xd4ca('0x61'));});}; \ No newline at end of file +var _0x4a08=['WhatsappQueues','findAll','Telephones','resourceId','role','Campaign','where','format','Agents','length','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:outbound','VoiceQueues','userProfileId','SmsQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','WhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','User','name','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4a08,0x11b));var _0x84a0=function(_0x401bd4,_0x372d33){_0x401bd4=_0x401bd4-0x0;var _0x44ecd6=_0x4a08[_0x401bd4];return _0x44ecd6;};'use strict';var _=require(_0x84a0('0x0'));var util=require('util');var BPromise=require(_0x84a0('0x1'));var db=require(_0x84a0('0x2'))['db'];var config=require(_0x84a0('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x84a0('0x4')],'attributes':['id',_0x84a0('0x5'),'role'],'raw':!![],'where':{'role':_0x84a0('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x84a0('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x84a0('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x84a0('0x8')],'where':{'type':_0x84a0('0x9')}};function getAssociatedResources(_0x3c3ff5,_0x2368dc,_0x11fdf2){return db[_0x84a0('0xa')]['findOne']({'where':{'name':_0x3c3ff5,'userProfileId':_0x2368dc},'raw':!![]})[_0x84a0('0xb')](function(_0x2940ed){if(_0x2940ed){if(_0x2940ed[_0x84a0('0xc')]){switch(_0x3c3ff5){case'VoiceQueues':case'ChatQueues':case _0x84a0('0xd'):case _0x84a0('0xe'):case _0x84a0('0xf'):case _0x84a0('0x10'):case _0x84a0('0x11'):return db[_0x11fdf2][_0x84a0('0x12')](queryQueues);case _0x84a0('0x13'):return db[_0x11fdf2][_0x84a0('0x12')](queryTelephones);case'Trunks':return db[_0x11fdf2][_0x84a0('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x11fdf2]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x84a0('0x12')]({'attributes':[_0x84a0('0x14')],'where':{'sectionId':_0x2940ed['id']},'raw':!![]})[_0x84a0('0xb')](function(_0x532119){if(_0x532119){var _0x340c44={'where':{'id':_['map'](_0x532119,_0x84a0('0x14'))},'raw':!![]};switch(_0x11fdf2){case _0x84a0('0x4'):_0x340c44['where'][_0x84a0('0x15')]=_0x84a0('0x7');break;case _0x84a0('0x16'):_0x340c44[_0x84a0('0x17')]['type']=_0x84a0('0x9');break;}return db[_0x11fdf2][_0x84a0('0x12')](_0x340c44);}else{return[];}});}}else{return[];}})[_0x84a0('0xb')](function(_0xd87f9c){return _0xd87f9c;});}function joinOrLeaveQueues(_0x4cc249,_0x236b96,_0x1dd0d8,_0x4db19d){_0x4cc249[_0x236b96](util[_0x84a0('0x18')]('%s:queue:%s',_0x1dd0d8,_0x4db19d['name']));if(_0x4db19d['Agents']){for(var _0x3baba6=0x0;_0x3baba6<_0x4db19d[_0x84a0('0x19')][_0x84a0('0x1a')];_0x3baba6+=0x1){_0x4cc249[_0x236b96](util[_0x84a0('0x18')]('user:%s',_0x4db19d[_0x84a0('0x19')][_0x3baba6][_0x84a0('0x5')]));}}}function joinOrLeave(_0x19e52b,_0x533220,_0x2e630e){var _0x15b030;if(_0x19e52b[_0x84a0('0x1b')][_0x84a0('0x1c')]['id']){db[_0x84a0('0x4')][_0x84a0('0x1d')]({'attributes':['id',_0x84a0('0x5'),_0x84a0('0x15'),'userProfileId'],'where':{'id':_0x19e52b[_0x84a0('0x1b')][_0x84a0('0x1c')]['id']},'include':[{'model':db[_0x84a0('0x1e')],'as':_0x84a0('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x84a0('0x20')],'as':_0x84a0('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x84a0('0x22'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x84a0('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x84a0('0x24')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x84a0('0x25')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x84a0('0xb')](function(_0x2f0ec6){if(_0x2f0ec6){_0x15b030=_0x2f0ec6;_0x19e52b[_0x533220](util[_0x84a0('0x18')](_0x84a0('0x26'),_0x2f0ec6[_0x84a0('0x5')]));var _0x20d493=[];switch(_0x2f0ec6[_0x84a0('0x15')]){case _0x84a0('0x27'):_0x19e52b[_0x533220](_0x84a0('0x28'));_0x19e52b[_0x533220]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x84a0('0x29'))){delete queryQueues[_0x84a0('0x29')];}_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x2b')][_0x84a0('0x12')](queryQueues));_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x2c')][_0x84a0('0x12')](queryQueues));_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x2d')]['findAll'](queryQueues));_0x20d493[_0x84a0('0x2a')](db['SmsQueue'][_0x84a0('0x12')](queryQueues));_0x20d493[_0x84a0('0x2a')](db['MailQueue'][_0x84a0('0x12')](queryQueues));_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x2e')][_0x84a0('0x12')](queryQueues));_0x20d493['push'](db[_0x84a0('0x2f')][_0x84a0('0x12')](queryQueues));_0x20d493['push'](db['User']['findAll'](queryTelephones));_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x30')][_0x84a0('0x12')](queryTrunks));_0x20d493['push'](db[_0x84a0('0x16')][_0x84a0('0x12')](queryCampaigns));_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x4')][_0x84a0('0x12')](queryAgents));break;case _0x84a0('0x31'):_0x19e52b[_0x533220](_0x84a0('0x28'));_0x19e52b[_0x533220](_0x84a0('0x32'));_0x20d493[_0x84a0('0x2a')](getAssociatedResources(_0x84a0('0x33'),_0x2f0ec6['userProfileId'],_0x84a0('0x2b')));_0x20d493['push'](getAssociatedResources('ChatQueues',_0x2f0ec6[_0x84a0('0x34')],_0x84a0('0x2c')));_0x20d493[_0x84a0('0x2a')](getAssociatedResources('FaxQueues',_0x2f0ec6[_0x84a0('0x34')],'FaxQueue'));_0x20d493[_0x84a0('0x2a')](getAssociatedResources(_0x84a0('0xe'),_0x2f0ec6[_0x84a0('0x34')],_0x84a0('0x35')));_0x20d493['push'](getAssociatedResources(_0x84a0('0xf'),_0x2f0ec6['userProfileId'],'MailQueue'));_0x20d493[_0x84a0('0x2a')](getAssociatedResources(_0x84a0('0x10'),_0x2f0ec6[_0x84a0('0x34')],'OpenchannelQueue'));_0x20d493[_0x84a0('0x2a')](getAssociatedResources(_0x84a0('0x11'),_0x2f0ec6['userProfileId'],'WhatsappQueue'));_0x20d493['push'](getAssociatedResources(_0x84a0('0x13'),_0x2f0ec6['userProfileId'],_0x84a0('0x4')));_0x20d493[_0x84a0('0x2a')](getAssociatedResources('Trunks',_0x2f0ec6[_0x84a0('0x34')],'Trunk'));_0x20d493['push'](getAssociatedResources('IvrCampaigns',_0x2f0ec6['userProfileId'],_0x84a0('0x16')));_0x20d493[_0x84a0('0x2a')](db[_0x84a0('0x4')]['findAll'](queryAgents));break;case _0x84a0('0x6'):_0x19e52b[_0x533220](_0x84a0('0x28'));_0x19e52b[_0x533220](_0x84a0('0x32'));_0x20d493[_0x84a0('0x2a')](_0x2f0ec6[_0x84a0('0x36')]({'attributes':['id',_0x84a0('0x5')]}));_0x20d493['push'](_0x2f0ec6[_0x84a0('0x37')]({'attributes':['id',_0x84a0('0x5')]}));_0x20d493[_0x84a0('0x2a')](_0x2f0ec6[_0x84a0('0x38')]({'attributes':['id',_0x84a0('0x5')]}));_0x20d493[_0x84a0('0x2a')](_0x2f0ec6[_0x84a0('0x39')]({'attributes':['id','name']}));_0x20d493[_0x84a0('0x2a')](_0x2f0ec6[_0x84a0('0x3a')]({'attributes':['id','name']}));_0x20d493[_0x84a0('0x2a')](_0x2f0ec6[_0x84a0('0x3b')]({'attributes':['id','name']}));_0x20d493[_0x84a0('0x2a')](_0x2f0ec6[_0x84a0('0x3c')]({'attributes':['id',_0x84a0('0x5')]}));break;}return BPromise[_0x84a0('0x3d')](_0x20d493);}})[_0x84a0('0xb')](function(_0x5022b8){if(_0x5022b8&&_0x5022b8[_0x84a0('0x1a')]){for(var _0x4a403c=0x0;_0x4a403c<_0x5022b8[_0x84a0('0x1a')];_0x4a403c+=0x1){for(var _0x5bccd9=0x0;_0x5bccd9<_0x5022b8[_0x4a403c][_0x84a0('0x1a')];_0x5bccd9+=0x1){switch(_0x4a403c){case 0x0:joinOrLeaveQueues(_0x19e52b,_0x533220,_0x84a0('0x3e'),_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x1:joinOrLeaveQueues(_0x19e52b,_0x533220,_0x84a0('0x3f'),_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x2:joinOrLeaveQueues(_0x19e52b,_0x533220,_0x84a0('0x40'),_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x3:joinOrLeaveQueues(_0x19e52b,_0x533220,_0x84a0('0x41'),_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x4:joinOrLeaveQueues(_0x19e52b,_0x533220,_0x84a0('0x42'),_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x5:joinOrLeaveQueues(_0x19e52b,_0x533220,_0x84a0('0x43'),_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x6:joinOrLeaveQueues(_0x19e52b,_0x533220,'whatsapp',_0x5022b8[_0x4a403c][_0x5bccd9]);break;case 0x7:if(_0x15b030['role']!==_0x84a0('0x6'))_0x19e52b[_0x533220](util['format'](_0x84a0('0x44'),_0x5022b8[_0x4a403c][_0x5bccd9][_0x84a0('0x5')]));break;case 0x8:if(_0x15b030[_0x84a0('0x15')]!==_0x84a0('0x6'))_0x19e52b[_0x533220](util[_0x84a0('0x18')](_0x84a0('0x45'),_0x5022b8[_0x4a403c][_0x5bccd9]['name']));break;case 0x9:if(_0x15b030['role']!==_0x84a0('0x6'))_0x19e52b[_0x533220](util['format'](_0x84a0('0x46'),_0x5022b8[_0x4a403c][_0x5bccd9][_0x84a0('0x8')],_0x5022b8[_0x4a403c][_0x5bccd9]['name']));break;case 0xa:_0x19e52b[_0x533220](util[_0x84a0('0x18')](_0x84a0('0x26'),_0x5022b8[_0x4a403c][_0x5bccd9][_0x84a0('0x5')]));break;}}}}})[_0x84a0('0xb')](function(){if(_0x533220===_0x84a0('0x47')){var _0x2811be=_[_0x84a0('0x48')](_0x15b030['ChatInteractions'],'id');return _0x15b030[_0x84a0('0x49')](_0x2811be)[_0x84a0('0xb')](function(){for(var _0x256761=0x0;_0x256761<_0x2811be['length'];_0x256761+=0x1){_0x2e630e[_0x84a0('0x4a')](_0x84a0('0x4b'),{'ChatInteractionId':Number(_0x2811be[_0x256761]),'UserId':Number(_0x15b030['id'])});}});}})['then'](function(){if(_0x533220===_0x84a0('0x47')){var _0x1d731d=_['map'](_0x15b030[_0x84a0('0x21')],'id');return _0x15b030[_0x84a0('0x4c')](_0x1d731d)[_0x84a0('0xb')](function(){for(var _0x51ee86=0x0;_0x51ee86<_0x1d731d['length'];_0x51ee86+=0x1){_0x2e630e[_0x84a0('0x4a')](_0x84a0('0x4d'),{'MailInteractionId':Number(_0x1d731d[_0x51ee86]),'UserId':Number(_0x15b030['id'])});}});}})[_0x84a0('0xb')](function(){if(_0x533220===_0x84a0('0x47')){var _0x14d177=_[_0x84a0('0x48')](_0x15b030['FaxInteractions'],'id');return _0x15b030[_0x84a0('0x4e')](_0x14d177)[_0x84a0('0xb')](function(){for(var _0x45555d=0x0;_0x45555d<_0x14d177[_0x84a0('0x1a')];_0x45555d+=0x1){_0x2e630e[_0x84a0('0x4a')](_0x84a0('0x4f'),{'FaxInteractionId':Number(_0x14d177[_0x45555d]),'UserId':Number(_0x15b030['id'])});}});}})[_0x84a0('0xb')](function(){if(_0x533220===_0x84a0('0x47')){var _0x63121a=_[_0x84a0('0x48')](_0x15b030[_0x84a0('0x23')],'id');return _0x15b030['removeSmsInteractions'](_0x63121a)[_0x84a0('0xb')](function(){for(var _0x412263=0x0;_0x412263<_0x63121a[_0x84a0('0x1a')];_0x412263+=0x1){_0x2e630e['emit'](_0x84a0('0x50'),{'SmsInteractionId':Number(_0x63121a[_0x412263]),'UserId':Number(_0x15b030['id'])});}});}})[_0x84a0('0xb')](function(){if(_0x533220===_0x84a0('0x47')){var _0x38f3a9=_['map'](_0x15b030[_0x84a0('0x51')],'id');return _0x15b030[_0x84a0('0x52')](_0x38f3a9)['then'](function(){for(var _0xb801e9=0x0;_0xb801e9<_0x38f3a9[_0x84a0('0x1a')];_0xb801e9+=0x1){_0x2e630e[_0x84a0('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x38f3a9[_0xb801e9]),'UserId':Number(_0x15b030['id'])});}});}})[_0x84a0('0xb')](function(){if(_0x533220===_0x84a0('0x47')){var _0x295cd8=_[_0x84a0('0x48')](_0x15b030[_0x84a0('0x53')],'id');return _0x15b030['removeWhatsappInteractions'](_0x295cd8)[_0x84a0('0xb')](function(){for(var _0x174b6e=0x0;_0x174b6e<_0x295cd8[_0x84a0('0x1a')];_0x174b6e+=0x1){_0x2e630e[_0x84a0('0x4a')](_0x84a0('0x54'),{'WhatsappInteractionId':Number(_0x295cd8[_0x174b6e]),'UserId':Number(_0x15b030['id'])});}});}})[_0x84a0('0x55')](function(_0x103e2b){_0x19e52b[_0x84a0('0x56')](_0x103e2b);});}}function onDisconnect(_0x1197ef,_0x1f560b){joinOrLeave(_0x1197ef,'leave',_0x1f560b);}function onConnect(_0x460047){joinOrLeave(_0x460047,_0x84a0('0x57'));}exports[_0x84a0('0x58')]=function(_0x194f62){_0x194f62['on'](_0x84a0('0x59'),function(_0x2390f9){_0x2390f9[_0x84a0('0x5a')](0x0);_0x2390f9['address']=_0x2390f9[_0x84a0('0x5b')][_0x84a0('0x59')][_0x84a0('0x5c')]+':'+_0x2390f9['request'][_0x84a0('0x59')][_0x84a0('0x5d')];_0x2390f9[_0x84a0('0x5e')]=new Date();_0x2390f9[_0x84a0('0x56')]=function(_0x3d5a75){console['log'](_0x84a0('0x5f')+_0x2390f9[_0x84a0('0x60')][_0x84a0('0x5')]+'['+_0x2390f9[_0x84a0('0x61')]+']',_0x3d5a75);};_0x2390f9['on'](_0x84a0('0x62'),function(){onDisconnect(_0x2390f9,_0x194f62);_0x2390f9[_0x84a0('0x56')]('DISCONNECTED');});onConnect(_0x2390f9);_0x2390f9[_0x84a0('0x56')](_0x84a0('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index f628669..8037df9 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 _0x9b95=['incomingmessage','outgoingmessage','Trigger,\x20%s','AfterCreateMessage','event','offlineMessage','opened','query','SELECT','AfterCreate','changed','closed','substatus','UserId','AfterUpdate','find','fullname','internal','default','length','hasOwnProperty','model','hook','callback','condition','../logger','triggers','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','catch','get','channel','motionChannel','direction','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','undefined','interface','format','SIP/%s','name','agent'];(function(_0x535da1,_0x1560ed){var _0x4c4b7c=function(_0x56ee7a){while(--_0x56ee7a){_0x535da1['push'](_0x535da1['shift']());}};_0x4c4b7c(++_0x1560ed);}(_0x9b95,0xab));var _0x59b9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9b95[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x59b9('0x0'))(_0x59b9('0x1'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x59b9('0x2'),'condition':_0x59b9('0x3'),'callback':afterCreate},{'channel':_0x59b9('0x4'),'model':'ChatInteraction','event':_0x59b9('0x5'),'condition':_0x59b9('0x6'),'callback':afterUpdate},{'channel':_0x59b9('0x4'),'model':_0x59b9('0x7'),'event':_0x59b9('0x2'),'condition':_0x59b9('0x8'),'callback':afterCreateMessage},{'channel':_0x59b9('0x4'),'model':'ChatOfflineMessage','event':_0x59b9('0x2'),'condition':_0x59b9('0x8'),'callback':afterCreateOfflineMessage},{'channel':_0x59b9('0x9'),'model':_0x59b9('0xa'),'event':_0x59b9('0x2'),'condition':_0x59b9('0x3'),'callback':afterCreate},{'channel':_0x59b9('0x9'),'model':_0x59b9('0xa'),'event':_0x59b9('0x5'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x59b9('0x9'),'model':_0x59b9('0xb'),'event':_0x59b9('0x2'),'condition':_0x59b9('0x8'),'callback':afterCreateMessage},{'channel':_0x59b9('0xc'),'model':'WhatsappInteraction','event':_0x59b9('0x2'),'condition':_0x59b9('0x3'),'callback':afterCreate},{'channel':_0x59b9('0xc'),'model':_0x59b9('0xd'),'event':_0x59b9('0x5'),'condition':_0x59b9('0x6'),'callback':afterUpdate},{'channel':_0x59b9('0xc'),'model':_0x59b9('0xe'),'event':_0x59b9('0x2'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x59b9('0x2'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x59b9('0xf'),'model':_0x59b9('0x10'),'event':_0x59b9('0x5'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x59b9('0xf'),'model':_0x59b9('0x11'),'event':_0x59b9('0x2'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x59b9('0x12'),'event':_0x59b9('0x2'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x59b9('0x13'),'model':_0x59b9('0x12'),'event':_0x59b9('0x5'),'condition':_0x59b9('0x6'),'callback':afterUpdate},{'channel':_0x59b9('0x13'),'model':_0x59b9('0x14'),'event':_0x59b9('0x2'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x59b9('0x15'),'model':_0x59b9('0x16'),'event':_0x59b9('0x2'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x59b9('0x15'),'model':_0x59b9('0x16'),'event':_0x59b9('0x5'),'condition':_0x59b9('0x6'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x59b9('0x17'),'event':_0x59b9('0x2'),'condition':_0x59b9('0x8'),'callback':afterCreateMessage}];function request(_0xfac78f){return client[_0x59b9('0x18')](_0x59b9('0x19'),_0xfac78f)[_0x59b9('0x1a')](function(_0x511dc2){logger[_0x59b9('0x1b')]('Trigger,\x20%s','EventManager',_0x511dc2);if(_0x511dc2['error']){if(_0x511dc2[_0x59b9('0x1c')][_0x59b9('0x1d')]===0x1f4){logger[_0x59b9('0x1c')]('Trigger,\x20%s','EventManager',_0x511dc2[_0x59b9('0x1c')]);}}})[_0x59b9('0x1e')](function(_0x521024){logger[_0x59b9('0x1c')]('Trigger,\x20%s',_0x59b9('0x19'),_0x521024);});}function afterCreateMessage(_0x200b8a){return function(_0x4ea499){_0x4ea499=_0x4ea499[_0x59b9('0x1f')]({'plain':!![]});_0x4ea499[_0x59b9('0x20')]=_0x200b8a;_0x4ea499[_0x59b9('0x21')]=_0x200b8a;_0x4ea499['event']=_0x4ea499[_0x59b9('0x22')];Promise[_0x59b9('0x23')]()[_0x59b9('0x1a')](function(){if(typeof _0x4ea499['ContactId']==='undefined')return null;var _0x3ca7ff=_0x59b9('0x24')+_0x4ea499[_0x59b9('0x25')];return db[_0x59b9('0x26')]['query'](_0x3ca7ff,{'type':db[_0x59b9('0x27')][_0x59b9('0x28')]['SELECT'],'raw':!![]});})[_0x59b9('0x1a')](function(_0x4905e1){if(_0x4905e1){_0x4ea499[_0x59b9('0x29')]=_0x4905e1[0x0];}if(typeof _0x4ea499['UserId']===_0x59b9('0x2a'))return;return getAgent(_0x4ea499['UserId']);})[_0x59b9('0x1a')](function(_0x53bc21){if(_0x53bc21){_0x4ea499[_0x59b9('0x2b')]=util[_0x59b9('0x2c')](_0x59b9('0x2d'),_0x53bc21[_0x59b9('0x2e')]);_0x4ea499[_0x59b9('0x2f')]=_0x53bc21;_0x4ea499['channel']=_0x200b8a;return request({'event':_0x59b9('0x30'),'message':_0x4ea499});}else{return request({'event':_0x59b9('0x31'),'message':_0x4ea499});}})[_0x59b9('0x1e')](function(_0x3f524f){logger['error'](_0x59b9('0x32'),_0x59b9('0x33'),_0x3f524f);});};}function afterCreateOfflineMessage(_0x2260a2){return function(_0x10ebd9){_0x10ebd9=_0x10ebd9[_0x59b9('0x1f')]({'plain':!![]});_0x10ebd9[_0x59b9('0x20')]=_0x2260a2;_0x10ebd9[_0x59b9('0x21')]=_0x2260a2;_0x10ebd9[_0x59b9('0x34')]=_0x59b9('0x35');return request({'event':_0x10ebd9[_0x59b9('0x34')],'message':_0x10ebd9});};}function afterCreate(_0x48e260,_0x4b9b15){return function(_0x297c5e){_0x297c5e=_0x297c5e[_0x59b9('0x1f')]({'plain':!![]});_0x297c5e[_0x59b9('0x20')]=_0x48e260;_0x297c5e[_0x59b9('0x21')]=_0x48e260;_0x297c5e['event']=_0x59b9('0x36');Promise[_0x59b9('0x23')]()['then'](function(){var _0x5b6946=_0x59b9('0x24')+_0x297c5e[_0x59b9('0x25')];return db[_0x59b9('0x26')][_0x59b9('0x37')](_0x5b6946,{'type':db[_0x59b9('0x27')][_0x59b9('0x28')][_0x59b9('0x38')],'raw':!![]});})[_0x59b9('0x1a')](function(_0x46cf96){if(_0x46cf96){_0x297c5e[_0x59b9('0x29')]=_0x46cf96[0x0];}if(typeof _0x297c5e['UserId']==='undefined')return;return getAgent(_0x297c5e['UserId']);})[_0x59b9('0x1a')](function(_0x1b3317){if(_0x1b3317){_0x297c5e['interface']=util[_0x59b9('0x2c')](_0x59b9('0x2d'),_0x1b3317[_0x59b9('0x2e')]);_0x297c5e[_0x59b9('0x2f')]=_0x1b3317;}return request({'event':_0x4b9b15,'message':_0x297c5e});})['catch'](function(_0x3e0470){logger[_0x59b9('0x1c')]('Trigger,\x20%s',_0x59b9('0x39'),_0x3e0470);});};}function afterUpdate(_0x51defe){return function(_0x44bd58){var _0x198542=_0x44bd58[_0x59b9('0x3a')](_0x59b9('0x3b'))&&_0x44bd58[_0x59b9('0x3b')];var _0x583fc7=_0x44bd58[_0x59b9('0x3a')]('substatus');if(_0x198542||_0x583fc7){var _0x25fe72=_0x198542?'closedinteraction':_0x59b9('0x3c');var _0x163207=_0x44bd58[_0x59b9('0x1f')]({'plain':!![]});_0x163207[_0x59b9('0x20')]=_0x51defe;_0x163207[_0x59b9('0x21')]=_0x51defe;_0x163207['event']=_0x198542?_0x59b9('0x3b'):'substatus';var _0x5e818d=_0x59b9('0x24')+_0x163207[_0x59b9('0x25')];return db['sequelize'][_0x59b9('0x37')](_0x5e818d,{'type':db[_0x59b9('0x27')]['QueryTypes'][_0x59b9('0x38')],'raw':!![]})[_0x59b9('0x1a')](function(_0x14b075){if(_0x14b075){_0x163207['contact']=_0x14b075[0x0];}if(typeof _0x163207[_0x59b9('0x3d')]===_0x59b9('0x2a'))return;return getAgent(_0x163207['UserId']);})[_0x59b9('0x1a')](function(_0x40ae2d){if(_0x40ae2d){_0x163207[_0x59b9('0x2b')]=util[_0x59b9('0x2c')](_0x59b9('0x2d'),_0x40ae2d[_0x59b9('0x2e')]);_0x163207[_0x59b9('0x2f')]=_0x40ae2d;}return request({'event':_0x25fe72,'message':_0x163207});})[_0x59b9('0x1e')](function(_0x4f9fb){logger[_0x59b9('0x1c')](_0x59b9('0x32'),_0x59b9('0x3e'),_0x4f9fb);});}};}function getAgent(_0x45b297){return db['User'][_0x59b9('0x3f')]({'where':{'id':_0x45b297},'attributes':['id',_0x59b9('0x2e'),_0x59b9('0x40'),'email',_0x59b9('0x41')],'raw':!![]})[_0x59b9('0x1a')](function(_0x45b80c){return _0x45b80c;});}exports[_0x59b9('0x42')]=function(){for(var _0x3964aa=0x0;_0x3964aa=_0x1f1015[_0x1872('0x13')]){throw Error(_0x1872('0x14'));}_0x174ca5(_0x517d4d);})['catch'](function(_0x3aa60d){_0xc6187a(_0x3aa60d);});});}; \ No newline at end of file +var _0x8588=['whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms'];(function(_0x42813b,_0x57a3d5){var _0x19bbff=function(_0x4a01ad){while(--_0x4a01ad){_0x42813b['push'](_0x42813b['shift']());}};_0x19bbff(++_0x57a3d5);}(_0x8588,0xf4));var _0x8858=function(_0x4a123c,_0xa6a01d){_0x4a123c=_0x4a123c-0x0;var _0x3fa7f0=_0x8588[_0x4a123c];return _0x3fa7f0;};'use strict';var _=require(_0x8858('0x0'));var BPromise=require(_0x8858('0x1'));var db=require(_0x8858('0x2'))['db'];var util=require(_0x8858('0x3'));var channels=[_0x8858('0x4'),_0x8858('0x5'),_0x8858('0x6'),_0x8858('0x7'),_0x8858('0x8'),_0x8858('0x9'),_0x8858('0xa')];exports[_0x8858('0xb')]=function(){return channels;};exports[_0x8858('0xc')]=function(_0xa1db0a){_0xa1db0a=_0xa1db0a[_0x8858('0xd')]();return _['includes'](channels,_0xa1db0a);};exports['clearBlockUser']=function(_0x153bfb,_0x200e9f,_0x433b37,_0xf95670){var _0x362dc2={'loginAttempts':_0x200e9f,'blocked':_0x433b37};if(!_[_0x8858('0xe')](_0xf95670)){_0x362dc2[_0x8858('0xf')]=_0xf95670;}return _0x153bfb[_0x8858('0x10')](_0x362dc2);};exports[_0x8858('0x11')]=function(_0x771e9a){return new BPromise(function(_0x1baca9,_0x4cc929){var _0x5d53b7=0x0;if(_0x771e9a[_0x8858('0x12')]!==_0x8858('0x13')){_0x1baca9(_0x771e9a);}db['User'][_0x8858('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x771e9a['id']}}})[_0x8858('0x15')](function(_0x5486fd){_0x5d53b7=_0x5486fd;return util[_0x8858('0x11')]();})['then'](function(_0x177067){if(_0x177067&&_0x177067[_0x8858('0x16')]&&_0x5d53b7>=_0x177067[_0x8858('0x16')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1baca9(_0x771e9a);})['catch'](function(_0x1c3dfe){_0x4cc929(_0x1c3dfe);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 8447568..931c658 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x932f=['Not\x20Found','Out\x20Of\x20Interval','stack','statusMessage','send','exports','../config/logger','api','name','inherits','message','Bad\x20Request','Forbidden','Entity\x20not\x20found','Message\x20sent\x20outside\x20a\x20valid\x20interval','code','OutOfInterval','Resource\x20Conflict','Conflict'];(function(_0x41d9e7,_0x33ef4a){var _0x282c36=function(_0x2bb2a5){while(--_0x2bb2a5){_0x41d9e7['push'](_0x41d9e7['shift']());}};_0x282c36(++_0x33ef4a);}(_0x932f,0x195));var _0xf932=function(_0xd5b875,_0x2336b8){_0xd5b875=_0xd5b875-0x0;var _0x3f8e4b=_0x932f[_0xd5b875];return _0x3f8e4b;};'use strict';var util=require('util');var logger=require(_0xf932('0x0'))(_0xf932('0x1'));var APIError=function(_0x271ed7,_0x309d18){this['message']=_0x271ed7||'Internal\x20Server\x20Error';this[_0xf932('0x2')]=_0x309d18||'Error';util[_0xf932('0x3')](APIError,Error);};var APIBadRequestError=function(_0xc75843){this[_0xf932('0x4')]=_0xc75843||'Bad\x20Request';this[_0xf932('0x2')]=_0xf932('0x5');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x1641de){this['message']=_0x1641de||_0xf932('0x6');this[_0xf932('0x2')]=_0xf932('0x6');util[_0xf932('0x3')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x530921){this[_0xf932('0x4')]=_0x530921||_0xf932('0x7');this[_0xf932('0x2')]='Not\x20Found';util[_0xf932('0x3')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4e3e62){this[_0xf932('0x4')]=_0x4e3e62||_0xf932('0x8');this[_0xf932('0x2')]='Out\x20Of\x20Interval';this[_0xf932('0x9')]=0x193;this['details']={'type':_0xf932('0xa')};util[_0xf932('0x3')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x3075aa){this[_0xf932('0x4')]=_0x3075aa||_0xf932('0xb');this['name']=_0xf932('0xc');util[_0xf932('0x3')](APIBadRequestError,APIError);};function getStatusCode(_0x274462){switch(_0x274462){case _0xf932('0x5'):return 0x190;case _0xf932('0x6'),'Out\x20Of\x20Interval':return 0x193;case _0xf932('0xd'):return 0x194;case _0xf932('0xc'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x5915e0){if(_0x5915e0===_0xf932('0xe'))return _0x5915e0;return null;}function handleError(_0x15d584){return function(_0x3bebe2){logger['error'](_0x3bebe2[_0xf932('0xf')]);var _0x28d880=getStatusCode(_0x3bebe2[_0xf932('0x2')]);var _0x21b6f7=getCustomStatusMessage(_0x3bebe2['name']);if(_0x3bebe2['name']){delete _0x3bebe2['name'];}if(_0x21b6f7){_0x15d584[_0xf932('0x10')]=_0x21b6f7;}return _0x15d584['status'](_0x28d880)[_0xf932('0x11')](_0x3bebe2);};}module[_0xf932('0x12')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x0584=['error','stack','statusMessage','status','send','../config/logger','api','message','Error','inherits','name','Entity\x20not\x20found','Not\x20Found','Out\x20Of\x20Interval','code','details','Resource\x20Conflict','Conflict','Forbidden'];(function(_0xd49e15,_0x5e34ac){var _0x306b6a=function(_0x38ce9c){while(--_0x38ce9c){_0xd49e15['push'](_0xd49e15['shift']());}};_0x306b6a(++_0x5e34ac);}(_0x0584,0x9d));var _0x4058=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x0584[_0x424a9a];return _0xa7831c;};'use strict';var util=require('util');var logger=require(_0x4058('0x0'))(_0x4058('0x1'));var APIError=function(_0x24b9d3,_0x17d9df){this[_0x4058('0x2')]=_0x24b9d3||'Internal\x20Server\x20Error';this['name']=_0x17d9df||_0x4058('0x3');util[_0x4058('0x4')](APIError,Error);};var APIBadRequestError=function(_0xbf9dd0){this[_0x4058('0x2')]=_0xbf9dd0||'Bad\x20Request';this[_0x4058('0x5')]='Bad\x20Request';util[_0x4058('0x4')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x427c36){this[_0x4058('0x2')]=_0x427c36||'Forbidden';this[_0x4058('0x5')]='Forbidden';util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0xd499f6){this[_0x4058('0x2')]=_0xd499f6||_0x4058('0x6');this['name']=_0x4058('0x7');util[_0x4058('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x529d12){this['message']=_0x529d12||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x4058('0x5')]=_0x4058('0x8');this[_0x4058('0x9')]=0x193;this[_0x4058('0xa')]={'type':'OutOfInterval'};util[_0x4058('0x4')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x312688){this[_0x4058('0x2')]=_0x312688||_0x4058('0xb');this['name']=_0x4058('0xc');util[_0x4058('0x4')](APIBadRequestError,APIError);};function getStatusCode(_0x22b02d){switch(_0x22b02d){case'Bad\x20Request':return 0x190;case _0x4058('0xd'),'Out\x20Of\x20Interval':return 0x193;case _0x4058('0x7'):return 0x194;case _0x4058('0xc'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x409f49){if(_0x409f49===_0x4058('0x8'))return _0x409f49;return null;}function handleError(_0xb3dc67){return function(_0x55e972){logger[_0x4058('0xe')](_0x55e972[_0x4058('0xf')]);var _0x4c9730=getStatusCode(_0x55e972[_0x4058('0x5')]);var _0x551c25=getCustomStatusMessage(_0x55e972[_0x4058('0x5')]);if(_0x55e972['name']){delete _0x55e972[_0x4058('0x5')];}if(_0x551c25){_0xb3dc67[_0x4058('0x10')]=_0x551c25;}return _0xb3dc67[_0x4058('0x11')](_0x4c9730)[_0x4058('0x12')](_0x55e972);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 998358b..ed2cc7c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bf3=['404','status','render','json'];(function(_0xefbde8,_0x41d53f){var _0x2e3154=function(_0x7ec068){while(--_0x7ec068){_0xefbde8['push'](_0xefbde8['shift']());}};_0x2e3154(++_0x41d53f);}(_0x3bf3,0x168));var _0x33bf=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x3bf3[_0x3430aa];return _0x2ac5c;};'use strict';module['exports'][0x194]=function pageNotFound(_0x885945,_0x3d881f){var _0x3c2cae=_0x33bf('0x0');var _0x279da7=0x194;var _0x2702f7={'status':_0x279da7};_0x3d881f[_0x33bf('0x1')](_0x2702f7[_0x33bf('0x1')]);_0x3d881f[_0x33bf('0x2')](_0x3c2cae,{},function(_0x59fe4e,_0x399518){if(_0x59fe4e){return _0x3d881f['status'](_0x2702f7[_0x33bf('0x1')])[_0x33bf('0x3')](_0x2702f7);}_0x3d881f['send'](_0x399518);});}; \ No newline at end of file +var _0x8c2c=['json','send','404','status'];(function(_0x97a9fe,_0x1ebec7){var _0xae397e=function(_0x1006ed){while(--_0x1006ed){_0x97a9fe['push'](_0x97a9fe['shift']());}};_0xae397e(++_0x1ebec7);}(_0x8c2c,0x92));var _0xc8c2=function(_0x2605e7,_0x236140){_0x2605e7=_0x2605e7-0x0;var _0x1982c3=_0x8c2c[_0x2605e7];return _0x1982c3;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1693bb,_0xc1eb7f){var _0x1c02cf=_0xc8c2('0x0');var _0x149d48=0x194;var _0x315813={'status':_0x149d48};_0xc1eb7f[_0xc8c2('0x1')](_0x315813[_0xc8c2('0x1')]);_0xc1eb7f['render'](_0x1c02cf,{},function(_0x49963c,_0x1bcea0){if(_0x49963c){return _0xc1eb7f[_0xc8c2('0x1')](_0x315813[_0xc8c2('0x1')])[_0xc8c2('0x2')](_0x315813);}_0xc1eb7f[_0xc8c2('0x3')](_0x1bcea0);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 7372155..9e66787 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6947=['team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','ChatInternalMessage','Members','CmCompany','CompanyId','Phones','OpenchannelInteractions','MailInteractions','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Queue','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','moh_has_sounds','ItemType','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','AnalyticFieldReport','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskField','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','VtigerAccount','ServicenowConfiguration','Dynamics365Account','FromId','JscriptyQuestionReport','SessionId','ProjectId','TeamVoiceQueue','MailQueues','team_has_sms_queues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','CmCustomField','CustomFields','Queues','TeamVoicePrefix','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','sequelize','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','utf8','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../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','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Condition','../api/condition/condition.model','Interval','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','UserId','hasOne','UserSetting','hasMany','Recordings','Extensions','cascade','HopperHistory','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsTo','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','ChatQueues','WhatsappQueues','CmList','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','SmsAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','VoiceQueueId','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','restrict','MailServerOut','CloudProviderId','Imap','Smtp','Disposition','Answers','Interactions','List','ListId','user_has_mail_accounts','Agents','team_has_mail_queues','MailInteractionId','Owner','Tags','mail_interaction_has_tags','Users','Attachment','Attachments','Account','ChatWebsiteId','ChatOfflineMessageId','IntervalId','TagId','MailQueueReport','Dashboard','Items','Dispositions','FaxAccountId','fax_interaction_has_tags','ThroughTags','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x6947,0x72));var _0x7694=function(_0x4d4d4f,_0x2a2f49){_0x4d4d4f=_0x4d4d4f-0x0;var _0x579f2c=_0x6947[_0x4d4d4f];return _0x579f2c;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x7694('0x0'));var _=require('lodash');var jstz=require(_0x7694('0x1'));var timezone=jstz[_0x7694('0x2')]();config[_0x7694('0x0')]=_[_0x7694('0x3')](config['sequelize'],{'database':'motion2','username':_0x7694('0x4'),'password':_0x7694('0x5'),'options':{'host':_0x7694('0x6'),'port':0xcea,'dialect':_0x7694('0x7'),'dialectOptions':{'charset':_0x7694('0x8')},'logging':![],'timezone':timezone[_0x7694('0x9')](),'define':{'charset':'utf8','collate':_0x7694('0xa')}}});config['sequelizeHistory']=_[_0x7694('0x3')](config[_0x7694('0xb')],{'database':'motion2','username':_0x7694('0x4'),'password':_0x7694('0x5'),'options':{'host':_0x7694('0x6'),'port':0xcea,'dialect':_0x7694('0x7'),'dialectOptions':{'charset':_0x7694('0x8')},'logging':![],'timezone':timezone[_0x7694('0x9')](),'define':{'charset':_0x7694('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7694('0x0')][_0x7694('0xd')],config['sequelize'][_0x7694('0xe')],config[_0x7694('0x0')][_0x7694('0xf')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7694('0xb')][_0x7694('0xd')],config[_0x7694('0xb')]['username'],config[_0x7694('0xb')]['password'],config[_0x7694('0xb')][_0x7694('0x10')])};db[_0x7694('0x11')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/user/user.model');db[_0x7694('0x13')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x14'));db['VoiceContext']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x15'));db[_0x7694('0x16')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/voiceExtension/voiceExtension.model');db[_0x7694('0x17')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x18'));db[_0x7694('0x19')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0x7694('0x1a')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x1b'));db[_0x7694('0x1c')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x1d'));db[_0x7694('0x1e')]=db[_0x7694('0x0')]['import'](_0x7694('0x1f'));db['VoiceMailMessage']=db[_0x7694('0x0')]['import'](_0x7694('0x20'));db[_0x7694('0x21')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x22'));db[_0x7694('0x23')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x24'));db['VoiceAgentReport']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x25'));db[_0x7694('0x26')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x27'));db[_0x7694('0x28')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x29'));db[_0x7694('0x2a')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x2b'));db[_0x7694('0x2c')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x2d'));db[_0x7694('0x2e')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7694('0x2f')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x30'));db['UserChatQueue']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x31'));db[_0x7694('0x32')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0x7694('0x33')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x34'));db[_0x7694('0x35')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x36'));db[_0x7694('0x37')]=db['sequelize'][_0x7694('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x7694('0x38')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x39'));db[_0x7694('0x3a')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x3b'));db['MailServerOut']=db['sequelize'][_0x7694('0x12')](_0x7694('0x3c'));db[_0x7694('0x3d')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x3e'));db[_0x7694('0x3f')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x40'));db[_0x7694('0x41')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x42'));db[_0x7694('0x43')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x44'));db[_0x7694('0x45')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x46'));db[_0x7694('0x47')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x48'));db['Dashboard']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x49'));db['DashboardItem']=db['sequelize'][_0x7694('0x12')](_0x7694('0x4a'));db[_0x7694('0x4b')]=db['sequelize'][_0x7694('0x12')]('../api/faxAccount/faxAccount.model');db[_0x7694('0x4c')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x4d'));db[_0x7694('0x4e')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/faxInteraction/faxInteraction.model');db[_0x7694('0x4f')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x50'));db[_0x7694('0x51')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x52'));db[_0x7694('0x53')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x54'));db[_0x7694('0x55')]=db[_0x7694('0x0')]['import'](_0x7694('0x56'));db[_0x7694('0x57')]=db['sequelize']['import'](_0x7694('0x58'));db['SmsInteraction']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x59'));db[_0x7694('0x5a')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x5b'));db[_0x7694('0x5c')]=db[_0x7694('0x0')]['import'](_0x7694('0x5d'));db[_0x7694('0x5e')]=db[_0x7694('0x0')]['import'](_0x7694('0x5f'));db['OpenchannelApplication']=db[_0x7694('0x0')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x7694('0x60')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x61'));db[_0x7694('0x62')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x63'));db[_0x7694('0x64')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x65'));db[_0x7694('0x66')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x67'));db[_0x7694('0x68')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x69'));db['ChatApplication']=db[_0x7694('0x0')]['import']('../api/chatApplication/chatApplication.model');db[_0x7694('0x6a')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x6b'));db[_0x7694('0x6c')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x6d'));db[_0x7694('0x6e')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x6f'));db[_0x7694('0x70')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x71'));db[_0x7694('0x72')]=db[_0x7694('0x0')]['import'](_0x7694('0x73'));db[_0x7694('0x74')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x75'));db['CmCompany']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/cmCompany/cmCompany.model');db[_0x7694('0x76')]=db[_0x7694('0x0')]['import'](_0x7694('0x77'));db[_0x7694('0x78')]=db[_0x7694('0x0')]['import'](_0x7694('0x79'));db['CmHopperBlack']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x7a'));db[_0x7694('0x7b')]=db['sequelize'][_0x7694('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x7694('0x7c')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x7d'));db[_0x7694('0x7e')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x7f'));db['CmCustomField']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x7694('0x80')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x81'));db[_0x7694('0x82')]=db[_0x7694('0x0')]['import'](_0x7694('0x83'));db[_0x7694('0x84')]=db['sequelize'][_0x7694('0x12')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0x7694('0x12')]('../api/disposition/disposition.model');db[_0x7694('0x85')]=db[_0x7694('0x0')]['import'](_0x7694('0x86'));db[_0x7694('0x87')]=db[_0x7694('0x0')]['import']('../api/interval/interval.model');db['Pause']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/pause/pause.model');db[_0x7694('0x88')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/cdr/cdr.model');db[_0x7694('0x89')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x8a'));db[_0x7694('0x8b')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x8c'));db['Sound']=db[_0x7694('0x0')]['import'](_0x7694('0x8d'));db[_0x7694('0x8e')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x8f'));db[_0x7694('0x90')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x91'));db[_0x7694('0x92')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x93'));db[_0x7694('0x94')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x95'));db[_0x7694('0x96')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x97'));db[_0x7694('0x98')]=db[_0x7694('0x0')]['import'](_0x7694('0x99'));db[_0x7694('0x9a')]=db[_0x7694('0x0')]['import'](_0x7694('0x9b'));db['Integration']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/integration/integration.model');db[_0x7694('0x9c')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x9d'));db['AnalyticCustomReport']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x9e'));db[_0x7694('0x9f')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xa0'));db[_0x7694('0xa1')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xa2'));db[_0x7694('0xa3')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xa4'));db['AnalyticFieldReport']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xa5'));db[_0x7694('0xa6')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xa7'));db[_0x7694('0xa8')]=db['sequelize']['import'](_0x7694('0xa9'));db[_0x7694('0xaa')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xab'));db[_0x7694('0xac')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xad'));db[_0x7694('0xae')]=db['sequelize'][_0x7694('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x7694('0xaf')]=db['sequelize'][_0x7694('0x12')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x7694('0xb0')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xb1'));db[_0x7694('0xb2')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x7694('0xb3')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intDeskField/intDeskField.model');db[_0x7694('0xb4')]=db['sequelize'][_0x7694('0x12')](_0x7694('0xb5'));db[_0x7694('0xb6')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xb7'));db[_0x7694('0xb8')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intZohoField/intZohoField.model');db[_0x7694('0xb9')]=db['sequelize']['import'](_0x7694('0xba'));db['ZendeskConfiguration']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xbb'));db[_0x7694('0xbc')]=db[_0x7694('0x0')]['import'](_0x7694('0xbd'));db[_0x7694('0xbe')]=db['sequelize'][_0x7694('0x12')](_0x7694('0xbf'));db['FreshdeskConfiguration']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x7694('0xc0')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xc1'));db['VtigerAccount']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xc2'));db[_0x7694('0xc3')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x7694('0xc4')]=db[_0x7694('0x0')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x7694('0xc5')]=db['sequelize']['import']('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xc6'));db[_0x7694('0xc7')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xc8'));db['Dynamics365Account']=db['sequelize'][_0x7694('0x12')](_0x7694('0xc9'));db[_0x7694('0xca')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x7694('0xcb')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xcc'));db[_0x7694('0xcd')]=db['sequelize'][_0x7694('0x12')](_0x7694('0xce'));db[_0x7694('0xcf')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xd0'));db[_0x7694('0xd1')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xd2'));db[_0x7694('0xd3')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xd4'));db[_0x7694('0xd5')]=db['sequelize'][_0x7694('0x12')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x7694('0x0')]['import'](_0x7694('0xd6'));db[_0x7694('0xd7')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xd8'));db['JscriptyQuestionReport']=db[_0x7694('0x0')]['import'](_0x7694('0xd9'));db[_0x7694('0xda')]=db['sequelize']['import'](_0x7694('0xdb'));db[_0x7694('0xdc')]=db['sequelize']['import'](_0x7694('0xdd'));db[_0x7694('0xde')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xdf'));db[_0x7694('0xe0')]=db['sequelize'][_0x7694('0x12')](_0x7694('0xe1'));db[_0x7694('0xe2')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xe3'));db[_0x7694('0xe4')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xe5'));db[_0x7694('0xe6')]=db['sequelize'][_0x7694('0x12')](_0x7694('0xe7'));db[_0x7694('0xe8')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xe9'));db[_0x7694('0xea')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xeb'));db[_0x7694('0xec')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xed'));db[_0x7694('0xee')]=db['sequelize']['import']('../api/team/team.model');db[_0x7694('0xef')]=db['sequelize'][_0x7694('0x12')](_0x7694('0xf0'));db[_0x7694('0xf1')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xf2'));db[_0x7694('0xf3')]=db['sequelize']['import']('../api/migration/migration.model');db['Attachment']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xf4'));db[_0x7694('0xf5')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xf6'));db[_0x7694('0xf7')]=db[_0x7694('0x0')]['import'](_0x7694('0xf8'));db[_0x7694('0xf9')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xfa'));db[_0x7694('0xfb')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xfc'));db[_0x7694('0xfd')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0xfe'));db[_0x7694('0xff')]=db[_0x7694('0x0')][_0x7694('0x12')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db['sequelize'][_0x7694('0x12')](_0x7694('0x100'));db['VoicePrefix']=db['sequelize'][_0x7694('0x12')](_0x7694('0x101'));db[_0x7694('0x102')]=db[_0x7694('0x0')]['import'](_0x7694('0x103'));db[_0x7694('0x104')]=db['sequelize'][_0x7694('0x12')](_0x7694('0x105'));db[_0x7694('0x106')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x107'));db[_0x7694('0x108')]=db[_0x7694('0x0')]['import'](_0x7694('0x109'));db[_0x7694('0x10a')]=db[_0x7694('0x0')]['import'](_0x7694('0x10b'));db['WhatsappApplication']=db[_0x7694('0x0')]['import'](_0x7694('0x10c'));db['WhatsappInteraction']=db[_0x7694('0x0')][_0x7694('0x12')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x10d'));db[_0x7694('0x10e')]=db[_0x7694('0x0')]['import'](_0x7694('0x10f'));db['WhatsappTransferReport']=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x110'));db[_0x7694('0x111')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x112'));db['CloudProvider']=db[_0x7694('0x0')]['import']('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x7694('0x0')]['import'](_0x7694('0x113'));db['TeamVoicePrefix']=db[_0x7694('0x0')]['import'](_0x7694('0x114'));db[_0x7694('0x115')]=db[_0x7694('0x0')]['import'](_0x7694('0x116'));db['UserSetting']=db['sequelize']['import'](_0x7694('0x117'));db[_0x7694('0x118')]=db[_0x7694('0x0')][_0x7694('0x12')](_0x7694('0x119'));db['User']['hasOne'](db[_0x7694('0x1e')],{'as':_0x7694('0x1e'),'onDelete':'cascade','foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11b')](db[_0x7694('0x11c')],{'as':'userSetting','onDelete':'cascade','foreignKey':'UserId'});db[_0x7694('0x11')][_0x7694('0x11d')](db['VoiceRecording'],{'as':_0x7694('0x11e'),'foreignKey':_0x7694('0x11a')});db['User']['hasMany'](db[_0x7694('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db[_0x7694('0x16')],{'as':_0x7694('0x11f'),'onDelete':_0x7694('0x120'),'hooks':!![]});db['User'][_0x7694('0x11d')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db['CmHopperHistory'],{'as':_0x7694('0x121'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db['ReportAgentPreview'],{'as':_0x7694('0x7e'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db[_0x7694('0x60')],{'as':'OpenchannelInteractions','foreignKey':_0x7694('0x11a')});db['User'][_0x7694('0x11d')](db[_0x7694('0x6a')],{'as':_0x7694('0x122'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db[_0x7694('0x123')],{'as':_0x7694('0x124'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db['FaxInteraction'],{'as':_0x7694('0x125'),'foreignKey':_0x7694('0x11a')});db['User'][_0x7694('0x11d')](db[_0x7694('0x43')],{'as':'MailInteractions','foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')]['hasMany'](db[_0x7694('0x126')],{'as':_0x7694('0x127'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x11')][_0x7694('0x11d')](db['UserNotification'],{'as':_0x7694('0x128'),'foreignKey':_0x7694('0x129')});db[_0x7694('0x11')][_0x7694('0x11d')](db[_0x7694('0x78')],{'as':_0x7694('0x12a'),'foreignKey':_0x7694('0x11a'),'onDelete':_0x7694('0x12b')});db[_0x7694('0x11')][_0x7694('0x12c')](db[_0x7694('0x102')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x7694('0x11')][_0x7694('0x12d')](db['ChatGroup'],{'as':'Groups','through':_0x7694('0x12e')});db['User'][_0x7694('0x12d')](db[_0x7694('0x76')],{'as':_0x7694('0x12f'),'through':_0x7694('0x130')});db[_0x7694('0x11')]['belongsToMany'](db['CmList'],{'as':_0x7694('0x131'),'through':_0x7694('0x132')});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0xee')],{'through':_0x7694('0x133')});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x43')],{'as':'MailInteractions','through':_0x7694('0x134')});db[_0x7694('0x11')][_0x7694('0x12d')](db['ChatInteraction'],{'as':_0x7694('0x122'),'through':_0x7694('0x135')});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x4e')],{'as':_0x7694('0x125'),'through':_0x7694('0x136')});db['User']['belongsToMany'](db[_0x7694('0x123')],{'as':_0x7694('0x124'),'through':_0x7694('0x137')});db['User'][_0x7694('0x12d')](db[_0x7694('0x60')],{'as':'OpenchannelInteractions','through':_0x7694('0x138')});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x126')],{'as':_0x7694('0x127'),'through':_0x7694('0x139')});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x19')],{'as':_0x7694('0x13a'),'through':_0x7694('0x2f'),'required':![]});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x13b')],{'as':_0x7694('0x13c'),'through':_0x7694('0x115'),'required':![]});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x3f')],{'as':'MailQueues','through':_0x7694('0x32'),'required':![]});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x70')],{'as':_0x7694('0x13d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x7694('0x11')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x5c')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User'][_0x7694('0x12d')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x7694('0x37'),'required':![]});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x111')],{'as':_0x7694('0x13e'),'through':_0x7694('0x38'),'required':![]});db['User'][_0x7694('0x12d')](db[_0x7694('0x13f')],{'through':_0x7694('0x132')});db['User'][_0x7694('0x12d')](db[_0x7694('0x66')],{'as':'ChatWebsites','through':_0x7694('0x140')});db[_0x7694('0x11')]['belongsToMany'](db[_0x7694('0x4b')],{'as':_0x7694('0x141'),'through':_0x7694('0x142')});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x3d')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x5e')],{'as':_0x7694('0x143'),'through':'user_has_openchannel_accounts'});db[_0x7694('0x11')]['belongsToMany'](db[_0x7694('0x55')],{'as':_0x7694('0x144'),'through':'user_has_sms_accounts'});db[_0x7694('0x11')][_0x7694('0x12d')](db[_0x7694('0x10a')],{'as':'WhatsappAccounts','through':_0x7694('0x145')});db['VoiceChanSpy']['hasMany'](db[_0x7694('0x16')],{'as':_0x7694('0x146'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x147')});db[_0x7694('0x148')][_0x7694('0x11d')](db[_0x7694('0x16')],{'onDelete':_0x7694('0x120')});db[_0x7694('0x16')][_0x7694('0x11d')](db[_0x7694('0x16')],{'as':_0x7694('0x149'),'onDelete':_0x7694('0x120')});db[_0x7694('0x17')][_0x7694('0x12d')](db[_0x7694('0x14a')],{'as':_0x7694('0x14b'),'through':'moh_has_sounds'});db['VoiceQueue'][_0x7694('0x11d')](db[_0x7694('0x2e')],{'as':'Members','foreignKey':_0x7694('0x14c')});db[_0x7694('0x19')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x7694('0x14c')});db[_0x7694('0x19')][_0x7694('0x11d')](db[_0x7694('0x7b')],{'as':_0x7694('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x7694('0x19')]['hasMany'](db[_0x7694('0x7c')],{'as':_0x7694('0x14e'),'foreignKey':_0x7694('0x14c')});db[_0x7694('0x19')][_0x7694('0x11d')](db[_0x7694('0x7e')],{'as':_0x7694('0x7e'),'foreignKey':_0x7694('0x14c')});db[_0x7694('0x19')][_0x7694('0x11d')](db[_0x7694('0x14f')],{'as':_0x7694('0x150'),'foreignKey':_0x7694('0x14c')});db[_0x7694('0x19')][_0x7694('0x11d')](db[_0x7694('0xda')],{'as':_0x7694('0x151'),'foreignKey':_0x7694('0x14c')});db['VoiceQueue'][_0x7694('0x12c')](db[_0x7694('0x2a')],{'as':_0x7694('0x2a'),'foreignKey':_0x7694('0x152')});db[_0x7694('0x19')][_0x7694('0x12c')](db[_0x7694('0x2a')],{'as':_0x7694('0x153'),'foreignKey':_0x7694('0x154')});db['VoiceQueue']['belongsTo'](db[_0x7694('0x87')],{'as':_0x7694('0x87'),'foreignKey':'IntervalId'});db[_0x7694('0x19')][_0x7694('0x12c')](db[_0x7694('0x155')],{'as':_0x7694('0x156'),'foreignKey':_0x7694('0x157')});db[_0x7694('0x19')][_0x7694('0x12d')](db[_0x7694('0x13f')],{'as':'Lists','through':_0x7694('0x158')});db[_0x7694('0x19')][_0x7694('0x12d')](db['User'],{'as':'Agents','through':_0x7694('0x2f')});db[_0x7694('0x19')]['belongsToMany'](db[_0x7694('0xee')],{'as':_0x7694('0x159'),'through':'TeamVoiceQueue'});db[_0x7694('0x19')]['belongsToMany'](db[_0x7694('0x13f')],{'as':_0x7694('0x15a'),'through':_0x7694('0x15b')});db['VoiceRecording'][_0x7694('0x12c')](db['User'],{'as':_0x7694('0x11'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x1c')][_0x7694('0x12c')](db['User'],{'as':'User','foreignKey':_0x7694('0x11a')});db[_0x7694('0x1e')][_0x7694('0x11d')](db[_0x7694('0x15c')],{'as':_0x7694('0x15d'),'onDelete':'cascade','foreignKey':_0x7694('0x15e'),'sourceKey':_0x7694('0x15f')});db[_0x7694('0x15c')][_0x7694('0x12c')](db['VoiceMail'],{'foreignKey':_0x7694('0x15e'),'targetKey':_0x7694('0x15f')});db['VoiceCallReport']['hasMany'](db[_0x7694('0x26')],{'as':_0x7694('0x160'),'foreignKey':'uniqueid','constraints':![]});db[_0x7694('0x21')][_0x7694('0x11d')](db[_0x7694('0x161')],{'as':_0x7694('0x162'),'foreignKey':'uniqueid','constraints':![]});db[_0x7694('0x21')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x11'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x21')][_0x7694('0x12c')](db['CmContact'],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x3a')]['belongsTo'](db[_0x7694('0x3d')],{'as':_0x7694('0x3d'),'foreignKey':_0x7694('0x165')});db[_0x7694('0x3a')][_0x7694('0x12c')](db[_0x7694('0x166')],{'as':_0x7694('0x166'),'foreignKey':'CloudProviderId','onDelete':_0x7694('0x167')});db[_0x7694('0x168')]['belongsTo'](db[_0x7694('0x3d')],{'as':_0x7694('0x3d'),'foreignKey':_0x7694('0x165')});db[_0x7694('0x168')]['belongsTo'](db[_0x7694('0x166')],{'as':_0x7694('0x166'),'foreignKey':_0x7694('0x169'),'onDelete':_0x7694('0x167')});db['MailAccount'][_0x7694('0x11b')](db[_0x7694('0x3a')],{'as':_0x7694('0x16a'),'onDelete':_0x7694('0x120')});db[_0x7694('0x3d')][_0x7694('0x11b')](db[_0x7694('0x168')],{'as':_0x7694('0x16b'),'onDelete':_0x7694('0x120')});db['MailAccount'][_0x7694('0x11d')](db[_0x7694('0x16c')],{'as':'Dispositions','foreignKey':_0x7694('0x165'),'onDelete':_0x7694('0x120')});db[_0x7694('0x3d')][_0x7694('0x11d')](db[_0x7694('0x84')],{'as':_0x7694('0x16d'),'foreignKey':_0x7694('0x165')});db['MailAccount']['hasMany'](db['MailMessage'],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x7694('0x3d')][_0x7694('0x11d')](db[_0x7694('0x43')],{'as':_0x7694('0x16e')});db['MailAccount']['hasMany'](db[_0x7694('0x47')],{'as':'Applications','foreignKey':'MailAccountId','onDelete':_0x7694('0x120')});db[_0x7694('0x3d')][_0x7694('0x12c')](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x3d')][_0x7694('0x12c')](db['Template'],{'as':_0x7694('0x96'),'foreignKey':'TemplateId'});db[_0x7694('0x3d')][_0x7694('0x12c')](db[_0x7694('0x155')],{'as':'mandatoryDispositionPause','foreignKey':_0x7694('0x157')});db[_0x7694('0x3d')][_0x7694('0x12d')](db['User'],{'as':'Agents','through':_0x7694('0x171')});db[_0x7694('0x3f')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x172'),'through':_0x7694('0x32')});db[_0x7694('0x3f')][_0x7694('0x12d')](db['Team'],{'through':_0x7694('0x173'),'as':'Teams'});db['MailInteraction'][_0x7694('0x11d')](db[_0x7694('0x45')],{'as':_0x7694('0x15d'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x174')});db[_0x7694('0x43')][_0x7694('0x12c')](db[_0x7694('0x3d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x7694('0x43')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':'ContactId'});db[_0x7694('0x43')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x175'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x43')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':'mail_interaction_has_tags','as':_0x7694('0x176')});db[_0x7694('0x43')]['belongsToMany'](db[_0x7694('0x8e')],{'through':_0x7694('0x177'),'as':'ThroughTags'});db[_0x7694('0x43')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x178'),'through':'user_has_mail_interactions','foreignKey':_0x7694('0x174')});db['MailMessage'][_0x7694('0x11d')](db[_0x7694('0x179')],{'as':_0x7694('0x17a'),'onDelete':_0x7694('0x120')});db[_0x7694('0x45')]['belongsTo'](db[_0x7694('0x11')],{'as':_0x7694('0x11')});db[_0x7694('0x45')]['belongsTo'](db[_0x7694('0x76')],{'onDelete':'cascade','as':'Contact'});db[_0x7694('0x45')][_0x7694('0x12c')](db[_0x7694('0x43')],{'as':'Interaction','foreignKey':_0x7694('0x174')});db[_0x7694('0x45')][_0x7694('0x12c')](db[_0x7694('0x3d')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x165')});db[_0x7694('0x45')][_0x7694('0x12c')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0x7694('0x17c')});db['MailMessage'][_0x7694('0x12c')](db['ChatOfflineMessage'],{'as':_0x7694('0x6e'),'foreignKey':_0x7694('0x17d')});db[_0x7694('0x47')][_0x7694('0x12c')](db[_0x7694('0x11')],{'onDelete':_0x7694('0x167')});db[_0x7694('0x47')][_0x7694('0x12c')](db[_0x7694('0x3f')],{'onDelete':_0x7694('0x167')});db['MailApplication'][_0x7694('0x12c')](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0x7694('0x12c')](db[_0x7694('0x87')],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x17e')});db[_0x7694('0x47')][_0x7694('0x12c')](db[_0x7694('0x8e')],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x17f')});db[_0x7694('0x180')][_0x7694('0x12c')](db[_0x7694('0x3d')],{});db['MailQueueReport'][_0x7694('0x12c')](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x180')]['belongsTo'](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':'ContactId'});db[_0x7694('0x180')][_0x7694('0x12c')](db[_0x7694('0x43')],{});db[_0x7694('0x180')][_0x7694('0x12c')](db[_0x7694('0x45')],{});db[_0x7694('0x180')][_0x7694('0x12c')](db[_0x7694('0x11')],{});db[_0x7694('0x180')][_0x7694('0x12c')](db[_0x7694('0x3f')],{});db[_0x7694('0x181')][_0x7694('0x11d')](db['DashboardItem'],{'as':_0x7694('0x182'),'onDelete':_0x7694('0x120')});db[_0x7694('0x4b')][_0x7694('0x11d')](db['Disposition'],{'as':_0x7694('0x183'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0x7694('0x4b')][_0x7694('0x11d')](db[_0x7694('0x84')],{'as':_0x7694('0x16d'),'foreignKey':_0x7694('0x184')});db[_0x7694('0x4b')][_0x7694('0x11d')](db['FaxInteraction'],{'as':_0x7694('0x16e')});db[_0x7694('0x4b')][_0x7694('0x11d')](db[_0x7694('0x4c')],{'as':_0x7694('0x149'),'foreignKey':_0x7694('0x184'),'onDelete':'cascade'});db[_0x7694('0x4b')][_0x7694('0x11d')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x7694('0x120')});db['FaxAccount'][_0x7694('0x11d')](db[_0x7694('0x4f')],{'as':_0x7694('0x15d')});db[_0x7694('0x4b')][_0x7694('0x12c')](db['Trunk'],{'as':_0x7694('0x2a')});db[_0x7694('0x4b')]['belongsTo'](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db['FaxAccount']['belongsTo'](db[_0x7694('0x155')],{'as':_0x7694('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7694('0x4b')][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x7694('0x4c')]['belongsTo'](db[_0x7694('0x11')],{'onDelete':'restrict'});db[_0x7694('0x4c')][_0x7694('0x12c')](db[_0x7694('0x51')],{'onDelete':_0x7694('0x167')});db['FaxApplication'][_0x7694('0x12c')](db[_0x7694('0x4b')],{'onDelete':'restrict'});db[_0x7694('0x4c')]['belongsTo'](db[_0x7694('0x8e')],{'onDelete':_0x7694('0x167'),'foreignKey':'TagId'});db[_0x7694('0x4e')][_0x7694('0x11d')](db['FaxMessage'],{'as':'Messages','onDelete':_0x7694('0x120'),'foreignKey':'FaxInteractionId'});db[_0x7694('0x4e')][_0x7694('0x12c')](db[_0x7694('0x4b')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x184')});db[_0x7694('0x4e')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x4e')]['belongsTo'](db[_0x7694('0x11')],{'as':'Owner','foreignKey':'UserId'});db[_0x7694('0x4e')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x185'),'as':_0x7694('0x176')});db[_0x7694('0x4e')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x185'),'as':_0x7694('0x186')});db[_0x7694('0x4e')][_0x7694('0x12d')](db['User'],{'as':'Users','through':_0x7694('0x136'),'foreignKey':_0x7694('0x187')});db[_0x7694('0x4f')][_0x7694('0x12c')](db[_0x7694('0x11')],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x11')});db[_0x7694('0x4f')][_0x7694('0x12c')](db[_0x7694('0x4e')],{'as':_0x7694('0x188'),'foreignKey':_0x7694('0x187')});db[_0x7694('0x4f')][_0x7694('0x12c')](db[_0x7694('0x76')],{'onDelete':_0x7694('0x120'),'as':'Contact'});db['FaxMessage'][_0x7694('0x12c')](db['Attachment'],{'as':_0x7694('0x179'),'foreignKey':_0x7694('0x189')});db[_0x7694('0x4f')]['belongsTo'](db[_0x7694('0x4b')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x184')});db['FaxQueue'][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':_0x7694('0x33')});db[_0x7694('0x51')][_0x7694('0x12d')](db[_0x7694('0xee')],{'through':_0x7694('0x18a'),'as':_0x7694('0x159')});db['FaxQueueReport'][_0x7694('0x12c')](db[_0x7694('0x4b')],{});db[_0x7694('0x53')][_0x7694('0x12c')](db['CmList'],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x53')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x53')][_0x7694('0x12c')](db[_0x7694('0x4e')],{});db[_0x7694('0x53')][_0x7694('0x12c')](db[_0x7694('0x4f')],{});db[_0x7694('0x53')][_0x7694('0x12c')](db[_0x7694('0x11')],{});db['FaxQueueReport']['belongsTo'](db[_0x7694('0x51')],{});db[_0x7694('0x55')][_0x7694('0x11d')](db[_0x7694('0x16c')],{'as':'Dispositions','foreignKey':_0x7694('0x18b'),'onDelete':_0x7694('0x120')});db[_0x7694('0x55')][_0x7694('0x11d')](db['CannedAnswer'],{'as':_0x7694('0x16d'),'foreignKey':_0x7694('0x18b')});db['SmsAccount'][_0x7694('0x11d')](db[_0x7694('0x5a')],{'as':'Messages','foreignKey':_0x7694('0x18b')});db[_0x7694('0x55')]['hasMany'](db['SmsInteraction'],{'as':_0x7694('0x16e')});db[_0x7694('0x55')][_0x7694('0x11d')](db[_0x7694('0x57')],{'as':_0x7694('0x149'),'foreignKey':_0x7694('0x18b'),'onDelete':_0x7694('0x120')});db[_0x7694('0x55')]['belongsTo'](db[_0x7694('0x13f')],{'as':'List','foreignKey':_0x7694('0x170')});db[_0x7694('0x55')]['belongsTo'](db[_0x7694('0x155')],{'as':_0x7694('0x156'),'foreignKey':_0x7694('0x157')});db[_0x7694('0x55')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x172'),'through':'user_has_sms_accounts'});db[_0x7694('0x57')][_0x7694('0x12c')](db[_0x7694('0x11')],{'onDelete':_0x7694('0x167')});db[_0x7694('0x57')][_0x7694('0x12c')](db[_0x7694('0x5c')],{'onDelete':_0x7694('0x167')});db[_0x7694('0x57')][_0x7694('0x12c')](db['SmsAccount'],{'onDelete':_0x7694('0x167')});db[_0x7694('0x57')][_0x7694('0x12c')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x7694('0x17e')});db[_0x7694('0x57')][_0x7694('0x12c')](db['Tag'],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x17f')});db[_0x7694('0x123')]['hasMany'](db['SmsMessage'],{'as':_0x7694('0x15d'),'onDelete':_0x7694('0x120'),'foreignKey':'SmsInteractionId'});db[_0x7694('0x123')][_0x7694('0x12c')](db[_0x7694('0x55')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x18b')});db[_0x7694('0x123')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x123')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':'Owner','foreignKey':'UserId'});db[_0x7694('0x123')][_0x7694('0x12d')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction'][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x18c'),'as':_0x7694('0x186')});db['SmsInteraction'][_0x7694('0x12d')](db['User'],{'as':'Users','through':_0x7694('0x137'),'foreignKey':_0x7694('0x18d')});db[_0x7694('0x5a')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':'User'});db[_0x7694('0x5a')][_0x7694('0x12c')](db[_0x7694('0x76')],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x163')});db['SmsMessage'][_0x7694('0x12c')](db[_0x7694('0x123')],{'onDelete':_0x7694('0x120'),'as':'Interaction','foreignKey':_0x7694('0x18d')});db[_0x7694('0x5a')][_0x7694('0x12c')](db[_0x7694('0x55')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x18b')});db[_0x7694('0x5c')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x172'),'through':_0x7694('0x35'),'foreignKey':_0x7694('0x18e')});db['SmsQueue'][_0x7694('0x12d')](db[_0x7694('0xee')],{'through':'team_has_sms_queues','as':_0x7694('0x159')});db[_0x7694('0x5e')][_0x7694('0x11d')](db[_0x7694('0x16c')],{'as':_0x7694('0x183'),'foreignKey':'OpenchannelAccountId','onDelete':_0x7694('0x120')});db[_0x7694('0x5e')][_0x7694('0x11d')](db[_0x7694('0x84')],{'as':_0x7694('0x16d'),'foreignKey':_0x7694('0x18f')});db[_0x7694('0x5e')][_0x7694('0x11d')](db[_0x7694('0x60')],{'as':_0x7694('0x16e'),'foreignKey':_0x7694('0x18f')});db[_0x7694('0x5e')][_0x7694('0x11d')](db[_0x7694('0x62')],{'as':_0x7694('0x15d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x7694('0x11d')](db[_0x7694('0x190')],{'as':_0x7694('0x149'),'foreignKey':_0x7694('0x18f'),'onDelete':_0x7694('0x120')});db[_0x7694('0x5e')]['belongsTo'](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x5e')][_0x7694('0x12c')](db[_0x7694('0x155')],{'as':_0x7694('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7694('0x5e')]['belongsToMany'](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':'user_has_openchannel_accounts'});db[_0x7694('0x190')][_0x7694('0x12c')](db[_0x7694('0x11')],{'onDelete':_0x7694('0x167')});db[_0x7694('0x190')][_0x7694('0x12c')](db[_0x7694('0x64')],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x191')});db[_0x7694('0x190')][_0x7694('0x12c')](db[_0x7694('0x5e')],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x18f')});db['OpenchannelApplication'][_0x7694('0x12c')](db[_0x7694('0x87')],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x17e')});db[_0x7694('0x190')]['belongsTo'](db[_0x7694('0x8e')],{'onDelete':_0x7694('0x167'),'foreignKey':'TagId'});db[_0x7694('0x60')][_0x7694('0x11d')](db[_0x7694('0x62')],{'as':_0x7694('0x15d'),'onDelete':_0x7694('0x120'),'foreignKey':'OpenchannelInteractionId'});db[_0x7694('0x60')][_0x7694('0x12c')](db['OpenchannelAccount'],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x18f')});db[_0x7694('0x60')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db['OpenchannelInteraction'][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x175'),'foreignKey':_0x7694('0x11a')});db[_0x7694('0x60')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':'openchannel_interaction_has_tags','as':_0x7694('0x176')});db[_0x7694('0x60')][_0x7694('0x12d')](db['Tag'],{'through':_0x7694('0x192'),'as':_0x7694('0x186')});db[_0x7694('0x60')][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':'Users','through':_0x7694('0x138'),'foreignKey':_0x7694('0x193')});db['OpenchannelMessage'][_0x7694('0x12c')](db[_0x7694('0x11')],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x11')});db[_0x7694('0x62')][_0x7694('0x12c')](db[_0x7694('0x76')],{'onDelete':_0x7694('0x120'),'as':'Contact'});db[_0x7694('0x62')][_0x7694('0x12c')](db[_0x7694('0x60')],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x188'),'foreignKey':_0x7694('0x193')});db[_0x7694('0x62')]['belongsTo'](db[_0x7694('0x179')],{'as':_0x7694('0x179'),'foreignKey':'AttachmentId'});db[_0x7694('0x62')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x18f')});db['OpenchannelQueue'][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x7694('0x12d')](db[_0x7694('0xee')],{'through':_0x7694('0x194'),'as':_0x7694('0x159')});db[_0x7694('0x66')][_0x7694('0x11d')](db[_0x7694('0x16c')],{'as':_0x7694('0x183'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db['ChatWebsite'][_0x7694('0x11d')](db[_0x7694('0x84')],{'as':_0x7694('0x16d'),'foreignKey':_0x7694('0x17c')});db[_0x7694('0x66')][_0x7694('0x11d')](db[_0x7694('0x74')],{'as':_0x7694('0x195')});db[_0x7694('0x66')][_0x7694('0x11d')](db[_0x7694('0x6a')],{'as':_0x7694('0x16e')});db['ChatWebsite'][_0x7694('0x11d')](db[_0x7694('0x196')],{'as':_0x7694('0x149'),'foreignKey':_0x7694('0x17c'),'onDelete':'cascade'});db[_0x7694('0x66')][_0x7694('0x11d')](db[_0x7694('0x6c')],{'as':_0x7694('0x15d')});db[_0x7694('0x66')]['belongsTo'](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x66')][_0x7694('0x12c')](db['Interval'],{'as':'Interval','foreignKey':_0x7694('0x17e')});db[_0x7694('0x66')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x7694('0x165')});db[_0x7694('0x66')]['belongsTo'](db[_0x7694('0x155')],{'as':_0x7694('0x156'),'foreignKey':_0x7694('0x157')});db[_0x7694('0x66')]['belongsToMany'](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':_0x7694('0x140')});db['OpenchannelQueueReport'][_0x7694('0x12c')](db[_0x7694('0x5e')],{});db[_0x7694('0x68')]['belongsTo'](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x68')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x7694('0x68')]['belongsTo'](db[_0x7694('0x62')],{});db[_0x7694('0x68')][_0x7694('0x12c')](db[_0x7694('0x11')],{});db[_0x7694('0x68')][_0x7694('0x12c')](db['OpenchannelQueue'],{});db[_0x7694('0x196')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x197'),'foreignKey':_0x7694('0x11a'),'onDelete':_0x7694('0x167')});db['ChatApplication'][_0x7694('0x12c')](db[_0x7694('0x70')],{'as':'Queue','foreignKey':_0x7694('0x198'),'onDelete':_0x7694('0x167')});db[_0x7694('0x196')][_0x7694('0x12c')](db[_0x7694('0x66')],{'as':_0x7694('0x199'),'foreignKey':_0x7694('0x17c'),'onDelete':'restrict'});db[_0x7694('0x196')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7694('0x17f')});db['ChatInteraction'][_0x7694('0x11d')](db['ChatMessage'],{'as':'Messages','onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x19a')});db[_0x7694('0x6a')][_0x7694('0x12c')](db[_0x7694('0x66')],{'as':_0x7694('0x17b'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x6a')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x175'),'foreignKey':_0x7694('0x11a')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0x7694('0x19b'),'as':'Tags'});db[_0x7694('0x6a')]['belongsToMany'](db['Tag'],{'through':_0x7694('0x19b'),'as':'ThroughTags'});db[_0x7694('0x6a')][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x178'),'through':_0x7694('0x135'),'foreignKey':_0x7694('0x19a')});db[_0x7694('0x6c')][_0x7694('0x12c')](db[_0x7694('0x11')],{'onDelete':'cascade','as':'User'});db['ChatMessage'][_0x7694('0x12c')](db['CmContact'],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x163'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x6c')]['belongsTo'](db[_0x7694('0x6a')],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x188'),'foreignKey':_0x7694('0x19a')});db[_0x7694('0x6c')][_0x7694('0x12c')](db[_0x7694('0x179')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x7694('0x6c')][_0x7694('0x12c')](db[_0x7694('0x66')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x17c')});db[_0x7694('0x6e')][_0x7694('0x11d')](db[_0x7694('0x179')],{'as':_0x7694('0x17a'),'foreignKey':_0x7694('0x17d'),'onDelete':_0x7694('0x120'),'hooks':!![]});db['ChatOfflineMessage'][_0x7694('0x12c')](db[_0x7694('0x76')],{'onDelete':_0x7694('0x120'),'as':_0x7694('0x163'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x7694('0x12c')](db[_0x7694('0x66')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x17c')});db[_0x7694('0x70')][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':_0x7694('0x19c'),'hooks':!![]});db[_0x7694('0x70')][_0x7694('0x12d')](db[_0x7694('0xee')],{'through':_0x7694('0x19d'),'as':_0x7694('0x159')});db['ChatGroup'][_0x7694('0x11d')](db[_0x7694('0x19e')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x7694('0x120')});db['ChatGroup'][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x19f'),'through':_0x7694('0x12e')});db[_0x7694('0x74')]['belongsTo'](db[_0x7694('0x66')],{'as':'Website','foreignKey':_0x7694('0x17c')});db[_0x7694('0x1a0')]['hasMany'](db[_0x7694('0x76')],{'as':_0x7694('0x12f'),'foreignKey':_0x7694('0x1a1')});db[_0x7694('0x76')][_0x7694('0x11d')](db[_0x7694('0x92')],{'as':_0x7694('0x1a2'),'foreignKey':'CmContactId'});db['CmContact'][_0x7694('0x11d')](db['CmHopper'],{'as':_0x7694('0x12a'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x76')][_0x7694('0x11d')](db[_0x7694('0x7b')],{'as':_0x7694('0x14d'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x76')][_0x7694('0x11d')](db[_0x7694('0x7c')],{'as':_0x7694('0x14e'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x76')][_0x7694('0x11d')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x7694('0x164')});db[_0x7694('0x76')][_0x7694('0x11d')](db[_0x7694('0xda')],{'as':_0x7694('0x151'),'foreignKey':_0x7694('0x164')});db[_0x7694('0x76')][_0x7694('0x11d')](db['OpenchannelInteraction'],{'as':_0x7694('0x1a3'),'foreignKey':_0x7694('0x164'),'onDelete':_0x7694('0x167')});db['CmContact'][_0x7694('0x11d')](db[_0x7694('0x6a')],{'as':_0x7694('0x122'),'foreignKey':_0x7694('0x164'),'onDelete':_0x7694('0x167')});db[_0x7694('0x76')][_0x7694('0x11d')](db[_0x7694('0x123')],{'as':_0x7694('0x124'),'foreignKey':_0x7694('0x164'),'onDelete':_0x7694('0x167')});db['CmContact'][_0x7694('0x11d')](db[_0x7694('0x4e')],{'as':_0x7694('0x125'),'foreignKey':_0x7694('0x164'),'onDelete':_0x7694('0x167')});db[_0x7694('0x76')][_0x7694('0x11d')](db[_0x7694('0x43')],{'as':_0x7694('0x1a4'),'foreignKey':'ContactId','onDelete':_0x7694('0x167')});db[_0x7694('0x76')]['belongsTo'](db['CmCompany'],{'as':_0x7694('0x1a5'),'foreignKey':_0x7694('0x1a1')});db[_0x7694('0x76')][_0x7694('0x12c')](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170'),'onDelete':_0x7694('0x120')});db['CmContact'][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x178'),'through':_0x7694('0x130')});db[_0x7694('0x76')][_0x7694('0x12d')](db['Tag'],{'as':_0x7694('0x176'),'through':'cm_contact_has_tags'});db[_0x7694('0x76')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x1a6'),'as':'ThroughTags'});db[_0x7694('0x78')][_0x7694('0x11d')](db[_0x7694('0x94')],{'as':_0x7694('0x1a7'),'foreignKey':_0x7694('0x1a8')});db[_0x7694('0x78')]['belongsTo'](db['CmContact'],{'as':_0x7694('0x163'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper'][_0x7694('0x12c')](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170'),'onDelete':'cascade'});db[_0x7694('0x78')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x197'),'foreignKey':_0x7694('0x11a')});db['CmHopper'][_0x7694('0x12c')](db[_0x7694('0x19')],{'as':_0x7694('0x1a9'),'foreignKey':_0x7694('0x14c'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x7694('0xf1')],{'as':_0x7694('0xf1'),'foreignKey':_0x7694('0x1aa'),'onDelete':_0x7694('0x120')});db[_0x7694('0x78')][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x175'),'foreignKey':_0x7694('0x1ab')});db[_0x7694('0x14f')]['belongsTo'](db[_0x7694('0x76')],{'as':'Contact','foreignKey':_0x7694('0x164'),'onDelete':_0x7694('0x120')});db['CmHopperBlack']['belongsTo'](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':'ListId','onDelete':_0x7694('0x120')});db['CmHopperBlack']['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x7694('0x14c'),'onDelete':'cascade'});db[_0x7694('0x14f')][_0x7694('0x12c')](db[_0x7694('0xf1')],{'as':_0x7694('0xf1'),'foreignKey':_0x7694('0x1aa'),'onDelete':_0x7694('0x120')});db['Automation'][_0x7694('0x11d')](db[_0x7694('0x85')],{'as':{'plural':_0x7694('0x1ac'),'singular':_0x7694('0x1ad')},'foreignKey':_0x7694('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0x7694('0x82')]['hasMany'](db[_0x7694('0x85')],{'as':{'plural':'Any','singular':_0x7694('0x1af')},'foreignKey':_0x7694('0x1b0'),'onDelete':_0x7694('0x120'),'hooks':!![]});db[_0x7694('0x82')]['hasMany'](db[_0x7694('0x80')],{'as':_0x7694('0x1b1'),'foreignKey':_0x7694('0x1b2'),'onDelete':_0x7694('0x120'),'hooks':!![]});db[_0x7694('0x16c')][_0x7694('0x11d')](db[_0x7694('0x16c')],{'as':'Dispositions','foreignKey':_0x7694('0x1b3'),'onDelete':_0x7694('0x120')});db[_0x7694('0x87')][_0x7694('0x11d')](db['Interval'],{'as':_0x7694('0x1b4'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x7694('0x16')],{'as':_0x7694('0x11f'),'foreignKey':_0x7694('0x17e'),'onDelete':_0x7694('0x167')});db[_0x7694('0x87')][_0x7694('0x11d')](db['MailApplication'],{'as':_0x7694('0x1b5'),'foreignKey':'IntervalId'});db[_0x7694('0x87')]['hasMany'](db[_0x7694('0x196')],{'as':'ChatApplications','foreignKey':_0x7694('0x17e')});db[_0x7694('0x87')][_0x7694('0x11d')](db[_0x7694('0x4c')],{'as':_0x7694('0x1b6'),'foreignKey':'IntervalId'});db[_0x7694('0x87')][_0x7694('0x11d')](db[_0x7694('0x57')],{'as':_0x7694('0x1b7'),'foreignKey':_0x7694('0x17e')});db[_0x7694('0x8b')]['belongsTo'](db[_0x7694('0x3d')],{});db['Schedule'][_0x7694('0x12c')](db[_0x7694('0x9f')],{'foreignKey':'DefaultReportId'});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x7694('0x1b8')});db[_0x7694('0x14a')][_0x7694('0x12d')](db[_0x7694('0x17')],{'as':_0x7694('0x1b9'),'through':_0x7694('0x1ba'),'onDelete':'restrict'});db[_0x7694('0x8e')]['belongsToMany'](db[_0x7694('0x76')],{'through':_0x7694('0x1a6')});db[_0x7694('0x8e')][_0x7694('0x12d')](db[_0x7694('0x6a')],{'through':_0x7694('0x19b')});db[_0x7694('0x8e')][_0x7694('0x12d')](db[_0x7694('0x43')],{'through':_0x7694('0x177')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':_0x7694('0x18c')});db[_0x7694('0x8e')][_0x7694('0x12d')](db[_0x7694('0x4e')],{'through':_0x7694('0x185')});db['Tag'][_0x7694('0x12d')](db[_0x7694('0x60')],{'through':_0x7694('0x192')});db[_0x7694('0x8e')][_0x7694('0x12d')](db[_0x7694('0x126')],{'through':'whatsapp_interaction_has_tags'});db[_0x7694('0x92')]['belongsTo'](db[_0x7694('0x90')],{'as':_0x7694('0x1bb'),'foreignKey':'ItemTypeId'});db[_0x7694('0x94')][_0x7694('0x12c')](db[_0x7694('0x78')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0x7694('0x92')]['belongsTo'](db[_0x7694('0x76')],{'as':'Contact','foreignKey':_0x7694('0x1bc')});db[_0x7694('0x98')]['hasMany'](db['Condition'],{'as':{'plural':_0x7694('0x1bd'),'singular':_0x7694('0x1be')},'foreignKey':_0x7694('0x1bf'),'onDelete':_0x7694('0x120'),'hooks':!![]});db['Trigger'][_0x7694('0x11d')](db[_0x7694('0x85')],{'as':{'plural':_0x7694('0x1c0'),'singular':_0x7694('0x1c1')},'foreignKey':_0x7694('0x1c2'),'onDelete':_0x7694('0x120'),'hooks':!![]});db['Trigger'][_0x7694('0x11d')](db[_0x7694('0x80')],{'as':_0x7694('0x1b1'),'foreignKey':'TriggerId','onDelete':_0x7694('0x120'),'hooks':!![]});db[_0x7694('0x1c3')][_0x7694('0x11d')](db['AnalyticFieldReport'],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1b8'),'hooks':!![]});db[_0x7694('0x9f')][_0x7694('0x11d')](db[_0x7694('0x1c5')],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':'DefaultReportId'});db[_0x7694('0xa3')][_0x7694('0x11d')](db[_0x7694('0x1c5')],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':'MetricId'});db[_0x7694('0x1c5')][_0x7694('0x12c')](db[_0x7694('0xa3')],{'foreignKey':_0x7694('0x1c6')});db[_0x7694('0xa8')]['hasMany'](db[_0x7694('0xaa')],{'as':_0x7694('0x1c7'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xaa')][_0x7694('0x11d')](db['SalesforceField'],{'as':_0x7694('0x1c9'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xaa')]['hasMany'](db['SalesforceField'],{'as':_0x7694('0x1cb'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1cc')});db['SalesforceConfiguration'][_0x7694('0x11d')](db[_0x7694('0xac')],{'as':_0x7694('0x1c4'),'onDelete':'cascade','foreignKey':_0x7694('0x1cd')});db[_0x7694('0xaa')][_0x7694('0x12c')](db[_0x7694('0xa8')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xac')][_0x7694('0x11d')](db[_0x7694('0xac')],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xac')][_0x7694('0x11d')](db[_0x7694('0xac')],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0xac')][_0x7694('0x12c')](db[_0x7694('0x9a')],{'as':_0x7694('0x9a'),'foreignKey':_0x7694('0x1d1')});db['SugarcrmAccount']['hasMany'](db[_0x7694('0xaf')],{'as':_0x7694('0x1c7'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xaf')][_0x7694('0x11d')](db[_0x7694('0xb0')],{'as':_0x7694('0x1c9'),'onDelete':_0x7694('0x120'),'foreignKey':'SubjectId'});db[_0x7694('0xaf')][_0x7694('0x11d')](db[_0x7694('0xb0')],{'as':_0x7694('0x1cb'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xaf')][_0x7694('0x11d')](db['SugarcrmField'],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':'FieldId'});db[_0x7694('0xaf')][_0x7694('0x12c')](db[_0x7694('0xae')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xb0')][_0x7694('0x11d')](db[_0x7694('0xb0')],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xb0')][_0x7694('0x11d')](db[_0x7694('0xb0')],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xb0')][_0x7694('0x11d')](db['SugarcrmField'],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0xb0')]['belongsTo'](db[_0x7694('0x9a')],{'as':_0x7694('0x9a'),'foreignKey':_0x7694('0x1d1')});db[_0x7694('0xb2')][_0x7694('0x11d')](db[_0x7694('0xb3')],{'as':_0x7694('0x1c7'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xb3')][_0x7694('0x11d')](db[_0x7694('0x1d2')],{'as':_0x7694('0x1c9'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1ca')});db['DeskConfiguration'][_0x7694('0x11d')](db['DeskField'],{'as':_0x7694('0x1cb'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x7694('0xb3')][_0x7694('0x11d')](db['DeskField'],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':'FieldId'});db[_0x7694('0xb3')][_0x7694('0x12c')](db['DeskAccount'],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db['DeskConfiguration'][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':'int_desk_configuration_has_tags'});db[_0x7694('0x1d2')][_0x7694('0x11d')](db['DeskField'],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0x1d2')][_0x7694('0x11d')](db[_0x7694('0x1d2')],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0x1d2')][_0x7694('0x11d')](db[_0x7694('0x1d2')],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0x1d2')]['belongsTo'](db[_0x7694('0x9a')],{'as':_0x7694('0x9a'),'foreignKey':_0x7694('0x1d1')});db['ZohoAccount'][_0x7694('0x11d')](db['ZohoConfiguration'],{'as':_0x7694('0x1c7'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xb6')]['hasMany'](db[_0x7694('0xb8')],{'as':_0x7694('0x1c9'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1ca')});db['ZohoConfiguration']['hasMany'](db[_0x7694('0xb8')],{'as':_0x7694('0x1cb'),'onDelete':_0x7694('0x120'),'foreignKey':'DescriptionId'});db[_0x7694('0xb6')][_0x7694('0x11d')](db[_0x7694('0xb8')],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':'FieldId'});db[_0x7694('0xb6')]['belongsTo'](db[_0x7694('0xb4')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xb8')][_0x7694('0x11d')](db['ZohoField'],{'as':_0x7694('0x1ce'),'foreignKey':'SubjectId'});db[_0x7694('0xb8')][_0x7694('0x11d')](db['ZohoField'],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xb8')][_0x7694('0x11d')](db[_0x7694('0xb8')],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0xb8')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x7694('0xb9')][_0x7694('0x11d')](db['ZendeskConfiguration'],{'as':_0x7694('0x1c7'),'onDelete':'cascade','foreignKey':_0x7694('0x1c8')});db['ZendeskConfiguration'][_0x7694('0x11d')](db['ZendeskField'],{'as':_0x7694('0x1c9'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0x1d3')]['hasMany'](db[_0x7694('0xbc')],{'as':_0x7694('0x1cb'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0x1d3')][_0x7694('0x11d')](db[_0x7694('0xbc')],{'as':'Fields','foreignKey':_0x7694('0x1cd')});db[_0x7694('0x1d3')][_0x7694('0x12c')](db[_0x7694('0xb9')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0x1d3')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x1d4')});db[_0x7694('0xbc')][_0x7694('0x11d')](db[_0x7694('0xbc')],{'as':'Subject','foreignKey':_0x7694('0x1ca')});db[_0x7694('0xbc')][_0x7694('0x11d')](db[_0x7694('0xbc')],{'as':_0x7694('0x1cf'),'foreignKey':'DescriptionId'});db[_0x7694('0xbc')]['hasMany'](db[_0x7694('0xbc')],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0xbc')]['belongsTo'](db['Variable'],{'as':_0x7694('0x9a'),'foreignKey':'VariableId'});db[_0x7694('0xbe')][_0x7694('0x11d')](db[_0x7694('0x1d5')],{'as':_0x7694('0x1c7'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db['FreshdeskConfiguration'][_0x7694('0x11d')](db[_0x7694('0xc0')],{'as':_0x7694('0x1c9'),'onDelete':'cascade','foreignKey':_0x7694('0x1ca')});db[_0x7694('0x1d5')][_0x7694('0x11d')](db[_0x7694('0xc0')],{'as':_0x7694('0x1cb'),'onDelete':_0x7694('0x120'),'foreignKey':'DescriptionId'});db[_0x7694('0x1d5')][_0x7694('0x11d')](db[_0x7694('0xc0')],{'as':_0x7694('0x1c4'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1cd')});db['FreshdeskConfiguration']['belongsTo'](db[_0x7694('0xbe')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0x1d5')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x7694('0xc0')][_0x7694('0x11d')](db['FreshdeskField'],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db['FreshdeskField'][_0x7694('0x11d')](db[_0x7694('0xc0')],{'as':_0x7694('0x1d0'),'foreignKey':'FieldId'});db[_0x7694('0xc0')]['belongsTo'](db[_0x7694('0x9a')],{'as':_0x7694('0x9a'),'foreignKey':'VariableId'});db[_0x7694('0x1d6')]['hasMany'](db[_0x7694('0xc3')],{'as':_0x7694('0x1c7'),'onDelete':'cascade','foreignKey':_0x7694('0x1c8')});db[_0x7694('0xc3')][_0x7694('0x11d')](db[_0x7694('0xc4')],{'as':'Subjects','foreignKey':'SubjectId'});db['VtigerConfiguration'][_0x7694('0x11d')](db[_0x7694('0xc4')],{'as':_0x7694('0x1cb'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xc3')]['hasMany'](db[_0x7694('0xc4')],{'as':_0x7694('0x1c4'),'foreignKey':'FieldId'});db[_0x7694('0xc3')][_0x7694('0x12c')](db[_0x7694('0x1d6')],{'as':'Account','foreignKey':'AccountId'});db[_0x7694('0xc4')][_0x7694('0x11d')](db[_0x7694('0xc4')],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xc4')][_0x7694('0x11d')](db[_0x7694('0xc4')],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xc4')][_0x7694('0x11d')](db[_0x7694('0xc4')],{'as':'Field','foreignKey':_0x7694('0x1cd')});db[_0x7694('0xc4')][_0x7694('0x12c')](db[_0x7694('0x9a')],{'as':_0x7694('0x9a'),'foreignKey':_0x7694('0x1d1')});db[_0x7694('0xc5')][_0x7694('0x11d')](db[_0x7694('0x1d7')],{'as':'Configurations','onDelete':_0x7694('0x120'),'foreignKey':'AccountId'});db[_0x7694('0x1d7')]['hasMany'](db[_0x7694('0xc7')],{'as':'Subjects','foreignKey':_0x7694('0x1ca')});db[_0x7694('0x1d7')][_0x7694('0x11d')](db['ServicenowField'],{'as':_0x7694('0x1cb'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0x1d7')][_0x7694('0x11d')](db['ServicenowField'],{'as':_0x7694('0x1c4'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0x1d7')][_0x7694('0x12c')](db[_0x7694('0xc5')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xc7')][_0x7694('0x11d')](db['ServicenowField'],{'as':_0x7694('0x1ce'),'foreignKey':'SubjectId'});db[_0x7694('0xc7')][_0x7694('0x11d')](db[_0x7694('0xc7')],{'as':_0x7694('0x1cf'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0x7694('0x11d')](db[_0x7694('0xc7')],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db['ServicenowField'][_0x7694('0x12c')](db[_0x7694('0x9a')],{'as':'Variable','foreignKey':_0x7694('0x1d1')});db['Dynamics365Account'][_0x7694('0x11d')](db[_0x7694('0xca')],{'as':'Configurations','onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0x1d8')]['belongsTo'](db[_0x7694('0x166')],{'as':_0x7694('0x166'),'foreignKey':_0x7694('0x169')});db['Dynamics365Configuration'][_0x7694('0x11d')](db[_0x7694('0xcb')],{'as':_0x7694('0x1c9'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xca')][_0x7694('0x11d')](db[_0x7694('0xcb')],{'as':_0x7694('0x1cb'),'onDelete':_0x7694('0x120'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x7694('0x11d')](db[_0x7694('0xcb')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7694('0x1cd')});db['Dynamics365Configuration']['belongsTo'](db[_0x7694('0x1d8')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xcb')][_0x7694('0x11d')](db[_0x7694('0xcb')],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xcb')]['hasMany'](db[_0x7694('0xcb')],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xcb')][_0x7694('0x11d')](db[_0x7694('0xcb')],{'as':_0x7694('0x1d0'),'foreignKey':_0x7694('0x1cd')});db[_0x7694('0xcb')][_0x7694('0x12c')](db[_0x7694('0x9a')],{'as':_0x7694('0x9a'),'foreignKey':_0x7694('0x1d1')});db['FreshsalesAccount'][_0x7694('0x11d')](db['FreshsalesConfiguration'],{'as':_0x7694('0x1c7'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1c8')});db['FreshsalesConfiguration'][_0x7694('0x11d')](db[_0x7694('0xd1')],{'as':'Subjects','foreignKey':_0x7694('0x1ca')});db[_0x7694('0xcf')]['hasMany'](db[_0x7694('0xd1')],{'as':_0x7694('0x1cb'),'foreignKey':'DescriptionId'});db[_0x7694('0xcf')][_0x7694('0x11d')](db[_0x7694('0xd1')],{'as':_0x7694('0x1c4'),'foreignKey':'FieldId'});db[_0x7694('0xcf')]['belongsTo'](db[_0x7694('0xcd')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1c8')});db[_0x7694('0xd1')][_0x7694('0x11d')](db[_0x7694('0xd1')],{'as':_0x7694('0x1ce'),'foreignKey':_0x7694('0x1ca')});db[_0x7694('0xd1')]['hasMany'](db['FreshsalesField'],{'as':_0x7694('0x1cf'),'foreignKey':_0x7694('0x1cc')});db[_0x7694('0xd1')][_0x7694('0x11d')](db[_0x7694('0xd1')],{'as':_0x7694('0x1d0'),'foreignKey':'FieldId'});db[_0x7694('0xd1')]['belongsTo'](db['Variable'],{'as':_0x7694('0x9a'),'foreignKey':_0x7694('0x1d1')});db[_0x7694('0xd5')][_0x7694('0x12c')](db[_0x7694('0x66')],{});db[_0x7694('0xd5')][_0x7694('0x12c')](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':'ListId'});db['ChatQueueReport'][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':'Contact','foreignKey':_0x7694('0x164')});db[_0x7694('0xd5')][_0x7694('0x12c')](db[_0x7694('0x6a')],{});db[_0x7694('0xd5')][_0x7694('0x12c')](db[_0x7694('0x6c')],{});db['ChatQueueReport'][_0x7694('0x12c')](db['User'],{});db[_0x7694('0xd5')][_0x7694('0x12c')](db[_0x7694('0x70')],{});db[_0x7694('0x19e')]['belongsTo'](db[_0x7694('0x11')],{'onDelete':'cascade','foreignKey':_0x7694('0x1d9')});db[_0x7694('0x19e')]['belongsTo'](db[_0x7694('0x11')],{'onDelete':_0x7694('0x120'),'foreignKey':'ToId'});db[_0x7694('0xda')][_0x7694('0x11d')](db[_0x7694('0x1da')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x7694('0xda')][_0x7694('0x11d')](db['JscriptyAnswerReport'],{'foreignKey':_0x7694('0x1db'),'onDelete':_0x7694('0x120')});db[_0x7694('0xdc')][_0x7694('0x12c')](db[_0x7694('0x55')],{});db[_0x7694('0xdc')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x7694('0x170')});db[_0x7694('0xdc')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':'Contact','foreignKey':_0x7694('0x164')});db[_0x7694('0xdc')][_0x7694('0x12c')](db[_0x7694('0x123')],{});db['SmsQueueReport'][_0x7694('0x12c')](db[_0x7694('0x5a')],{});db['SmsQueueReport'][_0x7694('0x12c')](db[_0x7694('0x11')],{});db[_0x7694('0xdc')][_0x7694('0x12c')](db[_0x7694('0x5c')],{});db['JscriptyProject'][_0x7694('0x11d')](db[_0x7694('0xda')],{'foreignKey':_0x7694('0x1dc')});db['JscriptyProject']['hasMany'](db[_0x7694('0x1da')],{'foreignKey':_0x7694('0x1dc')});db[_0x7694('0xe2')][_0x7694('0x11d')](db[_0x7694('0xd7')],{'foreignKey':_0x7694('0x1dc')});db['Team'][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x172'),'through':_0x7694('0x133')});db[_0x7694('0xee')]['belongsToMany'](db[_0x7694('0x19')],{'through':_0x7694('0x1dd'),'as':'VoiceQueues'});db[_0x7694('0xee')][_0x7694('0x12d')](db[_0x7694('0x3f')],{'through':_0x7694('0x173'),'as':_0x7694('0x1de')});db[_0x7694('0xee')][_0x7694('0x12d')](db[_0x7694('0x70')],{'through':_0x7694('0x19d'),'as':_0x7694('0x13d')});db[_0x7694('0xee')][_0x7694('0x12d')](db[_0x7694('0x51')],{'through':_0x7694('0x18a'),'as':'FaxQueues'});db['Team'][_0x7694('0x12d')](db[_0x7694('0x5c')],{'through':_0x7694('0x1df'),'as':'SmsQueues'});db[_0x7694('0xee')][_0x7694('0x12d')](db[_0x7694('0x64')],{'through':_0x7694('0x194'),'as':_0x7694('0x1e0')});db[_0x7694('0xee')][_0x7694('0x12d')](db[_0x7694('0x111')],{'through':_0x7694('0x1e1'),'as':_0x7694('0x13e')});db['Team'][_0x7694('0x12d')](db[_0x7694('0x13b')],{'through':'TeamVoicePrefix','as':_0x7694('0x13c')});db['Campaign'][_0x7694('0x11d')](db[_0x7694('0x78')],{'as':_0x7694('0x12a'),'foreignKey':_0x7694('0x1aa')});db[_0x7694('0xf1')][_0x7694('0x11d')](db[_0x7694('0x7b')],{'as':_0x7694('0x14d'),'foreignKey':'CampaignId'});db[_0x7694('0xf1')][_0x7694('0x11d')](db['CmHopperHistory'],{'as':_0x7694('0x14e'),'foreignKey':_0x7694('0x1aa')});db[_0x7694('0xf1')][_0x7694('0x11d')](db[_0x7694('0x14f')],{'as':'HopperBlacks','foreignKey':_0x7694('0x1aa')});db[_0x7694('0xf1')][_0x7694('0x12c')](db['Trunk'],{'as':'Trunk','foreignKey':_0x7694('0x152')});db[_0x7694('0xf1')][_0x7694('0x12c')](db[_0x7694('0x2a')],{'as':'TrunkBackup','foreignKey':_0x7694('0x154')});db[_0x7694('0xf1')]['belongsTo'](db[_0x7694('0x87')],{'as':_0x7694('0x87'),'foreignKey':_0x7694('0x17e')});db[_0x7694('0xf1')]['belongsTo'](db[_0x7694('0xe8')],{'as':_0x7694('0xe8'),'foreignKey':_0x7694('0x1e2')});db[_0x7694('0xf1')]['belongsToMany'](db[_0x7694('0x13f')],{'as':_0x7694('0x131'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x7694('0x12d')](db[_0x7694('0x13f')],{'as':_0x7694('0x15a'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0x7694('0x12c')](db['ChatOfflineMessage'],{'as':_0x7694('0x6e'),'foreignKey':_0x7694('0x17d')});db[_0x7694('0xf7')]['belongsTo'](db['MailMessage'],{});db[_0x7694('0xf7')]['belongsTo'](db[_0x7694('0x43')],{});db[_0x7694('0xf7')][_0x7694('0x12c')](db[_0x7694('0x3d')],{'foreignKey':_0x7694('0x1e3'),'as':_0x7694('0x1e4')});db['MailTransferReport'][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e5'),'as':_0x7694('0x1e6')});db[_0x7694('0xf7')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e7'),'as':_0x7694('0x1e8')});db['MailTransferReport'][_0x7694('0x12c')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x7694('0x1e9')});db[_0x7694('0xf7')]['belongsTo'](db[_0x7694('0x3d')],{'foreignKey':_0x7694('0x1ea'),'as':_0x7694('0x1eb')});db[_0x7694('0xf9')][_0x7694('0x12c')](db['ChatMessage'],{});db[_0x7694('0xf9')][_0x7694('0x12c')](db[_0x7694('0x6a')],{});db[_0x7694('0xf9')][_0x7694('0x12c')](db['ChatWebsite'],{'foreignKey':_0x7694('0x1ec'),'as':_0x7694('0x1e4')});db['ChatTransferReport'][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':'FromUserId','as':_0x7694('0x1e6')});db[_0x7694('0xf9')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':'ToUserId','as':_0x7694('0x1e8')});db['ChatTransferReport'][_0x7694('0x12c')](db['ChatQueue'],{'foreignKey':_0x7694('0x1ed'),'as':_0x7694('0x1e9')});db[_0x7694('0xf9')][_0x7694('0x12c')](db[_0x7694('0x66')],{'foreignKey':_0x7694('0x1ee'),'as':_0x7694('0x1eb')});db[_0x7694('0xfb')][_0x7694('0x12c')](db[_0x7694('0x4f')],{});db[_0x7694('0xfb')][_0x7694('0x12c')](db[_0x7694('0x4e')],{});db[_0x7694('0xfb')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x7694('0x1ef'),'as':_0x7694('0x1e4')});db['FaxTransferReport'][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':'FromUserId','as':_0x7694('0x1e6')});db[_0x7694('0xfb')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e7'),'as':'ToAgent'});db['FaxTransferReport'][_0x7694('0x12c')](db[_0x7694('0x51')],{'foreignKey':_0x7694('0x1f0'),'as':'ToQueue'});db['FaxTransferReport'][_0x7694('0x12c')](db['FaxAccount'],{'foreignKey':_0x7694('0x1f1'),'as':_0x7694('0x1eb')});db[_0x7694('0xfd')]['belongsTo'](db[_0x7694('0x62')],{});db[_0x7694('0xfd')][_0x7694('0x12c')](db['OpenchannelInteraction'],{});db[_0x7694('0xfd')]['belongsTo'](db[_0x7694('0x5e')],{'foreignKey':_0x7694('0x1f2'),'as':_0x7694('0x1e4')});db[_0x7694('0xfd')]['belongsTo'](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e5'),'as':_0x7694('0x1e6')});db[_0x7694('0xfd')][_0x7694('0x12c')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x7694('0xfd')][_0x7694('0x12c')](db['OpenchannelQueue'],{'foreignKey':_0x7694('0x1f3'),'as':_0x7694('0x1e9')});db[_0x7694('0xfd')][_0x7694('0x12c')](db[_0x7694('0x5e')],{'foreignKey':_0x7694('0x1f4'),'as':_0x7694('0x1eb')});db[_0x7694('0xff')][_0x7694('0x12c')](db[_0x7694('0x5a')],{});db[_0x7694('0xff')][_0x7694('0x12c')](db[_0x7694('0x123')],{});db[_0x7694('0xff')][_0x7694('0x12c')](db[_0x7694('0x55')],{'foreignKey':'FromSmsAccountId','as':_0x7694('0x1e4')});db[_0x7694('0xff')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e5'),'as':_0x7694('0x1e6')});db[_0x7694('0xff')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e7'),'as':_0x7694('0x1e8')});db[_0x7694('0xff')][_0x7694('0x12c')](db[_0x7694('0x5c')],{'foreignKey':_0x7694('0x1f5'),'as':_0x7694('0x1e9')});db[_0x7694('0xff')]['belongsTo'](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x7694('0x1eb')});db[_0x7694('0x13f')][_0x7694('0x11d')](db['Disposition'],{'as':_0x7694('0x183'),'foreignKey':_0x7694('0x170'),'onDelete':_0x7694('0x120')});db['CmList'][_0x7694('0x11d')](db[_0x7694('0x1f6')],{'as':_0x7694('0x1f7'),'foreignKey':_0x7694('0x170')});db['CmList'][_0x7694('0x11d')](db[_0x7694('0x76')],{'as':'Contacts','onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x13f')][_0x7694('0x11d')](db[_0x7694('0x7b')],{'as':_0x7694('0x14d'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x13f')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x7694('0x170')});db[_0x7694('0x13f')][_0x7694('0x11d')](db[_0x7694('0x7e')],{'as':'ReportAgentPreview','foreignKey':_0x7694('0x170')});db[_0x7694('0x13f')][_0x7694('0x12d')](db[_0x7694('0x19')],{'as':_0x7694('0x1f8'),'through':_0x7694('0x158')});db[_0x7694('0x13f')][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':_0x7694('0x132')});db[_0x7694('0x13b')][_0x7694('0x11d')](db[_0x7694('0x16')],{'as':_0x7694('0x11f'),'onDelete':_0x7694('0x120')});db[_0x7694('0x13b')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x172'),'through':_0x7694('0x115')});db[_0x7694('0x13b')][_0x7694('0x12d')](db[_0x7694('0xee')],{'through':_0x7694('0x1f9'),'as':_0x7694('0x159')});db[_0x7694('0x102')][_0x7694('0x11d')](db[_0x7694('0x11')],{'as':_0x7694('0x178'),'foreignKey':'userProfileId'});db[_0x7694('0x102')]['hasMany'](db[_0x7694('0x104')],{'as':_0x7694('0x1fa'),'foreignKey':'userProfileId','onDelete':_0x7694('0x120')});db[_0x7694('0x104')][_0x7694('0x11d')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x7694('0x1fb'),'onDelete':'cascade'});db[_0x7694('0x10a')][_0x7694('0x11d')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7694('0x1fc'),'onDelete':_0x7694('0x120')});db[_0x7694('0x10a')][_0x7694('0x11d')](db[_0x7694('0x84')],{'as':_0x7694('0x16d'),'foreignKey':'WhatsappAccountId'});db[_0x7694('0x10a')][_0x7694('0x11d')](db[_0x7694('0x1fd')],{'as':'Messages','foreignKey':_0x7694('0x1fc')});db['WhatsappAccount'][_0x7694('0x11d')](db['WhatsappInteraction'],{'as':_0x7694('0x16e')});db[_0x7694('0x10a')][_0x7694('0x11d')](db[_0x7694('0x1fe')],{'as':_0x7694('0x149'),'foreignKey':_0x7694('0x1fc'),'onDelete':_0x7694('0x120')});db['WhatsappAccount'][_0x7694('0x12c')](db[_0x7694('0x13f')],{'as':'List','foreignKey':_0x7694('0x170')});db[_0x7694('0x10a')][_0x7694('0x12c')](db[_0x7694('0x155')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x7694('0x10a')][_0x7694('0x12d')](db[_0x7694('0x11')],{'as':_0x7694('0x172'),'through':_0x7694('0x145')});db[_0x7694('0x1fe')][_0x7694('0x12c')](db['User'],{'onDelete':_0x7694('0x167')});db['WhatsappApplication']['belongsTo'](db[_0x7694('0x111')],{'onDelete':_0x7694('0x167')});db[_0x7694('0x1fe')][_0x7694('0x12c')](db['WhatsappAccount'],{'onDelete':_0x7694('0x167')});db['WhatsappApplication'][_0x7694('0x12c')](db[_0x7694('0x87')],{'onDelete':_0x7694('0x167'),'foreignKey':_0x7694('0x17e')});db[_0x7694('0x1fe')][_0x7694('0x12c')](db[_0x7694('0x8e')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x7694('0x126')][_0x7694('0x11d')](db['WhatsappMessage'],{'as':_0x7694('0x15d'),'onDelete':_0x7694('0x120'),'foreignKey':_0x7694('0x1ff')});db[_0x7694('0x126')][_0x7694('0x12c')](db[_0x7694('0x10a')],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1fc')});db[_0x7694('0x126')][_0x7694('0x12c')](db[_0x7694('0x76')],{'as':_0x7694('0x163'),'foreignKey':'ContactId'});db[_0x7694('0x126')][_0x7694('0x12c')](db['User'],{'as':_0x7694('0x175'),'foreignKey':_0x7694('0x11a')});db['WhatsappInteraction'][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x200'),'as':'Tags'});db[_0x7694('0x126')][_0x7694('0x12d')](db[_0x7694('0x8e')],{'through':_0x7694('0x200'),'as':_0x7694('0x186')});db[_0x7694('0x126')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x178'),'through':_0x7694('0x139'),'foreignKey':_0x7694('0x1ff')});db['WhatsappMessage'][_0x7694('0x12c')](db[_0x7694('0x11')],{'as':_0x7694('0x11')});db[_0x7694('0x1fd')][_0x7694('0x12c')](db[_0x7694('0x76')],{'onDelete':'cascade','as':_0x7694('0x163')});db[_0x7694('0x1fd')][_0x7694('0x12c')](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x7694('0x1ff')});db[_0x7694('0x1fd')]['belongsTo'](db['WhatsappAccount'],{'as':_0x7694('0x17b'),'foreignKey':_0x7694('0x1fc')});db[_0x7694('0x10e')][_0x7694('0x12c')](db['WhatsappAccount'],{});db[_0x7694('0x10e')]['belongsTo'](db[_0x7694('0x13f')],{'as':_0x7694('0x16f'),'foreignKey':_0x7694('0x170')});db[_0x7694('0x10e')]['belongsTo'](db[_0x7694('0x76')],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappQueueReport'][_0x7694('0x12c')](db[_0x7694('0x126')],{});db['WhatsappQueueReport'][_0x7694('0x12c')](db[_0x7694('0x111')],{});db[_0x7694('0x10e')][_0x7694('0x12c')](db['WhatsappMessage'],{});db[_0x7694('0x10e')][_0x7694('0x12c')](db['User'],{});db[_0x7694('0x201')]['belongsTo'](db[_0x7694('0x1fd')],{});db[_0x7694('0x201')][_0x7694('0x12c')](db[_0x7694('0x126')],{});db['WhatsappTransferReport'][_0x7694('0x12c')](db[_0x7694('0x10a')],{'foreignKey':_0x7694('0x202'),'as':_0x7694('0x1e4')});db['WhatsappTransferReport'][_0x7694('0x12c')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x7694('0x1eb')});db[_0x7694('0x201')][_0x7694('0x12c')](db[_0x7694('0x111')],{'foreignKey':_0x7694('0x203'),'as':'ToQueue'});db[_0x7694('0x201')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e5'),'as':'FromAgent'});db[_0x7694('0x201')][_0x7694('0x12c')](db[_0x7694('0x11')],{'foreignKey':_0x7694('0x1e7'),'as':'ToAgent'});db[_0x7694('0x111')][_0x7694('0x12d')](db['User'],{'as':_0x7694('0x172'),'through':_0x7694('0x38'),'foreignKey':_0x7694('0x204')});db[_0x7694('0x111')][_0x7694('0x12d')](db['Team'],{'through':_0x7694('0x1e1'),'as':_0x7694('0x159')});db[_0x7694('0x11c')][_0x7694('0x12c')](db['User'],{'as':'user','foreignKey':_0x7694('0x11a'),'onDelete':_0x7694('0x120'),'hooks':!![]});db[_0x7694('0x166')][_0x7694('0x11b')](db[_0x7694('0x1d8')],{'as':_0x7694('0x1d8'),'onDelete':_0x7694('0x167')});db[_0x7694('0x166')][_0x7694('0x11b')](db['MailServerIn'],{'as':_0x7694('0x16a'),'onDelete':_0x7694('0x167')});db[_0x7694('0x166')][_0x7694('0x11b')](db[_0x7694('0x168')],{'as':'Smtp','onDelete':_0x7694('0x167')});module[_0x7694('0x205')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x1a4c=['AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','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','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','UserId','User','userSetting','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','ChatQueues','SmsQueue','SmsQueues','UserSmsQueue','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','ChatWebsite','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','VoiceChanSpy','SpiedAgents','Applications','Sounds','Members','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','CannedAnswer','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','MailInteractionId','Account','Contact','Owner','Tag','mail_interaction_has_tags','Tags','Users','Interaction','TagId','Dashboard','DashboardItem','Dispositions','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','ChatWebsiteId','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','CompanyId','Phones','CmContactId','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','AutomationAllId','Actions','AutomationId','ParentId','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','SugarcrmConfiguration','DeskConfiguration','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','ZendeskConfiguration','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','Dynamics365Field','FromId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','VoiceQueues','team_has_mail_queues','team_has_chat_queues','FaxQueues','team_has_openchannel_queues','OpenchannelQueues','TrunkBackup','SquareProject','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FromFaxAccountId','FromAccount','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','Queues','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xcall','xC@LL1234','mysql','name','sequelizeHistory','127.0.0.1','utf8mb4','utf8','utf8_general_ci','username','password','options','database','../api/user/user.model','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.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','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../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'];(function(_0xac6072,_0x38d9dd){var _0x528239=function(_0x5197ca){while(--_0x5197ca){_0xac6072['push'](_0xac6072['shift']());}};_0x528239(++_0x38d9dd);}(_0x1a4c,0x164));var _0xc1a4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1a4c[_0x122ef9];return _0x42fba0;};'use strict';var config=require(_0xc1a4('0x0'));var Sequelize=require('sequelize');var _=require(_0xc1a4('0x1'));var jstz=require(_0xc1a4('0x2'));var timezone=jstz[_0xc1a4('0x3')]();config['sequelize']=_[_0xc1a4('0x4')](config[_0xc1a4('0x5')],{'database':_0xc1a4('0x6'),'username':_0xc1a4('0x7'),'password':_0xc1a4('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xc1a4('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xc1a4('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0xc1a4('0xb')]=_[_0xc1a4('0x4')](config[_0xc1a4('0xb')],{'database':'motion2','username':_0xc1a4('0x7'),'password':_0xc1a4('0x8'),'options':{'host':_0xc1a4('0xc'),'port':0xcea,'dialect':_0xc1a4('0x9'),'dialectOptions':{'charset':_0xc1a4('0xd')},'logging':![],'timezone':timezone[_0xc1a4('0xa')](),'define':{'charset':_0xc1a4('0xe'),'collate':_0xc1a4('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0xc1a4('0x5')][_0xc1a4('0x10')],config[_0xc1a4('0x5')][_0xc1a4('0x11')],config['sequelize'][_0xc1a4('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc1a4('0xb')][_0xc1a4('0x13')],config['sequelizeHistory'][_0xc1a4('0x10')],config[_0xc1a4('0xb')][_0xc1a4('0x11')],config[_0xc1a4('0xb')][_0xc1a4('0x12')])};db['User']=db['sequelize']['import'](_0xc1a4('0x14'));db['VoiceChanSpy']=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x16'));db[_0xc1a4('0x17')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x18'));db['VoiceExtension']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x19'));db[_0xc1a4('0x1a')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x1b'));db[_0xc1a4('0x1c')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x1d'));db[_0xc1a4('0x1e')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x1f'));db[_0xc1a4('0x20')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x21'));db[_0xc1a4('0x22')]=db['sequelize']['import'](_0xc1a4('0x23'));db[_0xc1a4('0x24')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x25'));db[_0xc1a4('0x26')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x27'));db[_0xc1a4('0x28')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x29'));db[_0xc1a4('0x2a')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/memberReport/memberReport.model');db[_0xc1a4('0x2b')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x2c'));db[_0xc1a4('0x2d')]=db['sequelize']['import'](_0xc1a4('0x2e'));db[_0xc1a4('0x2f')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x30'));db[_0xc1a4('0x31')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x32'));db[_0xc1a4('0x33')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/userChatQueue/userChatQueue.model');db[_0xc1a4('0x34')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x35'));db[_0xc1a4('0x36')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x37'));db['UserSmsQueue']=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x38'));db['UserOpenchannelQueue']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x39'));db['UserWhatsappQueue']=db['sequelize']['import'](_0xc1a4('0x3a'));db[_0xc1a4('0x3b')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x3c'));db['MailServerOut']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0xc1a4('0x3d')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x3e'));db[_0xc1a4('0x3f')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x40'));db['MailSubstatus']=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x41'));db[_0xc1a4('0x42')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x43'));db[_0xc1a4('0x44')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x45'));db['MailApplication']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/mailApplication/mailApplication.model');db[_0xc1a4('0x46')]=db['sequelize']['import']('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x47'));db['DashboardItem']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x48'));db[_0xc1a4('0x49')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/faxAccount/faxAccount.model');db[_0xc1a4('0x4a')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x4b'));db[_0xc1a4('0x4c')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x4d'));db['FaxMessage']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x4e'));db[_0xc1a4('0x4f')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x50'));db[_0xc1a4('0x51')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x52'));db[_0xc1a4('0x53')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x54'));db[_0xc1a4('0x55')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x56'));db[_0xc1a4('0x57')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x58'));db[_0xc1a4('0x59')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x5a'));db['SmsQueue']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/smsQueue/smsQueue.model');db[_0xc1a4('0x5b')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x5c'));db[_0xc1a4('0x5d')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x5e'));db[_0xc1a4('0x5f')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x60'));db[_0xc1a4('0x61')]=db[_0xc1a4('0x5')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xc1a4('0x62')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x63'));db['ChatWebsite']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x64'));db['OpenchannelQueueReport']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x65'));db['ChatApplication']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x66'));db[_0xc1a4('0x67')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x68'));db[_0xc1a4('0x69')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x6a'));db[_0xc1a4('0x6b')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x6c'));db[_0xc1a4('0x6d')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x6e'));db[_0xc1a4('0x6f')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x70'));db[_0xc1a4('0x71')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xc1a4('0x72')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x73'));db[_0xc1a4('0x74')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/cmContact/cmContact.model');db[_0xc1a4('0x75')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x76'));db[_0xc1a4('0x77')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x78'));db[_0xc1a4('0x79')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x7a'));db[_0xc1a4('0x7b')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x7c'));db['ReportAgentPreview']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x7d'));db['CmCustomField']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x7e'));db[_0xc1a4('0x7f')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x80'));db[_0xc1a4('0x81')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x82'));db['CannedAnswer']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x83'));db[_0xc1a4('0x84')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x85'));db[_0xc1a4('0x86')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x87'));db[_0xc1a4('0x88')]=db['sequelize']['import'](_0xc1a4('0x89'));db[_0xc1a4('0x8a')]=db[_0xc1a4('0x5')]['import']('../api/pause/pause.model');db[_0xc1a4('0x8b')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x8c'));db[_0xc1a4('0x8d')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x8e'));db[_0xc1a4('0x8f')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x90'));db[_0xc1a4('0x91')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0x92'));db['Tag']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x93'));db[_0xc1a4('0x94')]=db['sequelize'][_0xc1a4('0x15')]('../api/contactItemType/contactItemType.model');db[_0xc1a4('0x95')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x96'));db[_0xc1a4('0x97')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xc1a4('0x98')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x99'));db['Trigger']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/trigger/trigger.model');db[_0xc1a4('0x9a')]=db['sequelize']['import'](_0xc1a4('0x9b'));db['Integration']=db['sequelize']['import'](_0xc1a4('0x9c'));db[_0xc1a4('0x9d')]=db['sequelize']['import'](_0xc1a4('0x9e'));db[_0xc1a4('0x9f')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xa0'));db[_0xc1a4('0xa1')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xa2'));db[_0xc1a4('0xa3')]=db[_0xc1a4('0x5')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xc1a4('0xa4')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xa5'));db[_0xc1a4('0xa6')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xa7'));db[_0xc1a4('0xa8')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xa9'));db[_0xc1a4('0xaa')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xab'));db[_0xc1a4('0xac')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xad'));db['SalesforceField']=db['sequelize'][_0xc1a4('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xc1a4('0xae')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xaf'));db[_0xc1a4('0xb0')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xc1a4('0xb1')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xb2'));db['DeskConfiguration']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xb3'));db[_0xc1a4('0xb4')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xb5'));db[_0xc1a4('0xb6')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xb7'));db[_0xc1a4('0xb8')]=db[_0xc1a4('0x5')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xb9'));db['ZendeskAccount']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xba'));db['ZendeskConfiguration']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xbb'));db[_0xc1a4('0xbc')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0xc1a4('0xbd')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xbe'));db['VtigerAccount']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xbf'));db[_0xc1a4('0xc0')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xc1'));db['VtigerField']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xc1a4('0xc2')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xc3'));db[_0xc1a4('0xc4')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xc5'));db[_0xc1a4('0xc6')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xc7'));db[_0xc1a4('0xc8')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xc9'));db['Dynamics365Field']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xca'));db[_0xc1a4('0xcb')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xcc'));db[_0xc1a4('0xcd')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xce'));db[_0xc1a4('0xcf')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xd0'));db['Integration']=db[_0xc1a4('0x5')]['import'](_0xc1a4('0x9c'));db[_0xc1a4('0xd1')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xd2'));db[_0xc1a4('0xd3')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xd4'));db[_0xc1a4('0xd5')]=db['sequelize']['import'](_0xc1a4('0xd6'));db[_0xc1a4('0xd7')]=db['sequelize'][_0xc1a4('0x15')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xc1a4('0xd8')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xd9'));db[_0xc1a4('0xda')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xdb'));db['SmsQueueReport']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xdc'));db['SquareReport']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xdd'));db[_0xc1a4('0xde')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xdf'));db['JscriptyProject']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xe0'));db[_0xc1a4('0xe1')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xe2'));db[_0xc1a4('0xe3')]=db['sequelize'][_0xc1a4('0x15')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xe4'));db[_0xc1a4('0xe5')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xe6'));db[_0xc1a4('0xe7')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xe8'));db['Team']=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/team/team.model');db[_0xc1a4('0xe9')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xea'));db[_0xc1a4('0xeb')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xec'));db['Migration']=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xed'));db[_0xc1a4('0xee')]=db['sequelize']['import'](_0xc1a4('0xef'));db[_0xc1a4('0xf0')]=db['sequelize']['import'](_0xc1a4('0xf1'));db[_0xc1a4('0xf2')]=db['sequelize'][_0xc1a4('0x15')](_0xc1a4('0xf3'));db[_0xc1a4('0xf4')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xc1a4('0xf5')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xf6'));db[_0xc1a4('0xf7')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xf8'));db[_0xc1a4('0xf9')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xfa'));db[_0xc1a4('0xfb')]=db[_0xc1a4('0x5')]['import'](_0xc1a4('0xfc'));db[_0xc1a4('0xfd')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0xfe'));db[_0xc1a4('0xff')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x100'));db['UserProfileSection']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x101'));db[_0xc1a4('0x102')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x103'));db[_0xc1a4('0x104')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x105'));db[_0xc1a4('0x106')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x107'));db[_0xc1a4('0x108')]=db['sequelize']['import']('../api/whatsappApplication/whatsappApplication.model');db[_0xc1a4('0x109')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xc1a4('0x10a')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')]('../api/whatsappMessage/whatsappMessage.model');db[_0xc1a4('0x10b')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x10c'));db[_0xc1a4('0x10d')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x10e'));db[_0xc1a4('0x10f')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x110'));db[_0xc1a4('0x111')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x112'));db[_0xc1a4('0x113')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x114'));db[_0xc1a4('0x115')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x116'));db[_0xc1a4('0x117')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x118'));db[_0xc1a4('0x119')]=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x11a'));db['MailInteractionHasTag']=db[_0xc1a4('0x5')][_0xc1a4('0x15')](_0xc1a4('0x11b'));db['User'][_0xc1a4('0x11c')](db[_0xc1a4('0x20')],{'as':_0xc1a4('0x20'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')][_0xc1a4('0x11c')](db[_0xc1a4('0x119')],{'as':_0xc1a4('0x120'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db[_0xc1a4('0x1e')],{'as':_0xc1a4('0x122'),'foreignKey':'UserId'});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db['UserVoiceQueueRt'],{'as':_0xc1a4('0x123'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')]['hasMany'](db[_0xc1a4('0x124')],{'as':_0xc1a4('0x125'),'onDelete':_0xc1a4('0x11d'),'hooks':!![]});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db[_0xc1a4('0x79')],{'as':_0xc1a4('0x126'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db[_0xc1a4('0x7b')],{'as':_0xc1a4('0x127'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')]['hasMany'](db[_0xc1a4('0x128')],{'as':_0xc1a4('0x128'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')]['hasMany'](db[_0xc1a4('0x5f')],{'as':_0xc1a4('0x129'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db[_0xc1a4('0x67')],{'as':_0xc1a4('0x12a'),'foreignKey':_0xc1a4('0x11e')});db['User'][_0xc1a4('0x121')](db[_0xc1a4('0x57')],{'as':_0xc1a4('0x12b'),'foreignKey':'UserId'});db['User'][_0xc1a4('0x121')](db[_0xc1a4('0x4c')],{'as':_0xc1a4('0x12c'),'foreignKey':_0xc1a4('0x11e')});db['User'][_0xc1a4('0x121')](db[_0xc1a4('0x42')],{'as':_0xc1a4('0x12d'),'foreignKey':_0xc1a4('0x11e')});db['User'][_0xc1a4('0x121')](db[_0xc1a4('0x109')],{'as':_0xc1a4('0x12e'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db['UserNotification'],{'as':_0xc1a4('0x12f'),'foreignKey':_0xc1a4('0x130')});db[_0xc1a4('0x11f')][_0xc1a4('0x121')](db[_0xc1a4('0x75')],{'as':_0xc1a4('0x131'),'foreignKey':_0xc1a4('0x11e'),'onDelete':_0xc1a4('0x132')});db[_0xc1a4('0x11f')][_0xc1a4('0x133')](db[_0xc1a4('0xff')],{'as':_0xc1a4('0xff'),'foreignKey':_0xc1a4('0x134')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x6f')],{'as':_0xc1a4('0x136'),'through':_0xc1a4('0x137')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x138'),'through':'cm_user_has_contacts'});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x139'),'through':'cm_user_has_lists'});db['User'][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':_0xc1a4('0x13b')});db['User'][_0xc1a4('0x135')](db['MailInteraction'],{'as':_0xc1a4('0x12d'),'through':_0xc1a4('0x13c')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x67')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x4c')],{'as':_0xc1a4('0x12c'),'through':_0xc1a4('0x13d')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x57')],{'as':_0xc1a4('0x12b'),'through':_0xc1a4('0x13e')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x5f')],{'as':_0xc1a4('0x129'),'through':'user_has_openchannel_interactions'});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db['WhatsappInteraction'],{'as':_0xc1a4('0x12e'),'through':_0xc1a4('0x13f')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x1c')],{'as':'VoiceQueues','through':_0xc1a4('0x31'),'required':![]});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xc1a4('0x117'),'required':![]});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x3f')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x6d')],{'as':_0xc1a4('0x140'),'through':_0xc1a4('0x33'),'required':![],'hooks':!![]});db[_0xc1a4('0x11f')]['belongsToMany'](db[_0xc1a4('0x4f')],{'as':'FaxQueues','through':_0xc1a4('0x36'),'required':![]});db[_0xc1a4('0x11f')]['belongsToMany'](db[_0xc1a4('0x141')],{'as':_0xc1a4('0x142'),'through':_0xc1a4('0x143'),'required':![]});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0xc1a4('0x144'),'required':![]});db['User'][_0xc1a4('0x135')](db[_0xc1a4('0x10f')],{'as':_0xc1a4('0x145'),'through':_0xc1a4('0x146'),'required':![]});db['User'][_0xc1a4('0x135')](db[_0xc1a4('0xfb')],{'through':_0xc1a4('0x147')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x148')],{'as':'ChatWebsites','through':_0xc1a4('0x149')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x49')],{'as':_0xc1a4('0x14a'),'through':_0xc1a4('0x14b')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x3d')],{'as':_0xc1a4('0x14c'),'through':_0xc1a4('0x14d')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x5b')],{'as':_0xc1a4('0x14e'),'through':_0xc1a4('0x14f')});db[_0xc1a4('0x11f')][_0xc1a4('0x135')](db[_0xc1a4('0x53')],{'as':_0xc1a4('0x150'),'through':_0xc1a4('0x151')});db['User'][_0xc1a4('0x135')](db[_0xc1a4('0x106')],{'as':_0xc1a4('0x152'),'through':'user_has_whatsapp_accounts'});db[_0xc1a4('0x153')][_0xc1a4('0x121')](db[_0xc1a4('0x124')],{'as':_0xc1a4('0x154'),'onDelete':_0xc1a4('0x11d'),'foreignKey':'ChanSpyId'});db[_0xc1a4('0x17')][_0xc1a4('0x121')](db[_0xc1a4('0x124')],{'onDelete':_0xc1a4('0x11d')});db['VoiceExtension'][_0xc1a4('0x121')](db[_0xc1a4('0x124')],{'as':_0xc1a4('0x155'),'onDelete':'cascade'});db[_0xc1a4('0x1a')]['belongsToMany'](db[_0xc1a4('0x91')],{'as':_0xc1a4('0x156'),'through':'moh_has_sounds'});db[_0xc1a4('0x1c')]['hasMany'](db[_0xc1a4('0x2f')],{'as':_0xc1a4('0x157'),'foreignKey':_0xc1a4('0x158')});db[_0xc1a4('0x1c')][_0xc1a4('0x121')](db[_0xc1a4('0x75')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0xc1a4('0x1c')][_0xc1a4('0x121')](db[_0xc1a4('0x79')],{'as':_0xc1a4('0x126'),'foreignKey':_0xc1a4('0x158')});db['VoiceQueue']['hasMany'](db[_0xc1a4('0x7b')],{'as':'HopperHistories','foreignKey':_0xc1a4('0x158')});db[_0xc1a4('0x1c')][_0xc1a4('0x121')](db[_0xc1a4('0x128')],{'as':_0xc1a4('0x128'),'foreignKey':'VoiceQueueId'});db[_0xc1a4('0x1c')][_0xc1a4('0x121')](db[_0xc1a4('0x77')],{'as':_0xc1a4('0x159'),'foreignKey':'VoiceQueueId'});db[_0xc1a4('0x1c')][_0xc1a4('0x121')](db[_0xc1a4('0xda')],{'as':_0xc1a4('0x15a'),'foreignKey':_0xc1a4('0x158')});db[_0xc1a4('0x1c')][_0xc1a4('0x133')](db[_0xc1a4('0x2b')],{'as':_0xc1a4('0x2b'),'foreignKey':_0xc1a4('0x15b')});db[_0xc1a4('0x1c')][_0xc1a4('0x133')](db[_0xc1a4('0x2b')],{'as':'TrunkBackup','foreignKey':_0xc1a4('0x15c')});db[_0xc1a4('0x1c')]['belongsTo'](db[_0xc1a4('0x88')],{'as':_0xc1a4('0x88'),'foreignKey':_0xc1a4('0x15d')});db['VoiceQueue'][_0xc1a4('0x133')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xc1a4('0x15e')});db[_0xc1a4('0x1c')][_0xc1a4('0x135')](db[_0xc1a4('0xfb')],{'as':'Lists','through':_0xc1a4('0x15f')});db[_0xc1a4('0x1c')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x31')});db[_0xc1a4('0x1c')]['belongsToMany'](db[_0xc1a4('0x13a')],{'as':_0xc1a4('0x161'),'through':_0xc1a4('0x113')});db[_0xc1a4('0x1c')]['belongsToMany'](db[_0xc1a4('0xfb')],{'as':'BlackLists','through':_0xc1a4('0x162')});db[_0xc1a4('0x1e')][_0xc1a4('0x133')](db['User'],{'as':_0xc1a4('0x11f'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x163')][_0xc1a4('0x133')](db['User'],{'as':'User','foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x20')]['hasMany'](db[_0xc1a4('0x22')],{'as':_0xc1a4('0x164'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x165'),'sourceKey':_0xc1a4('0x166')});db[_0xc1a4('0x22')]['belongsTo'](db[_0xc1a4('0x20')],{'foreignKey':_0xc1a4('0x165'),'targetKey':'mailbox'});db[_0xc1a4('0x24')][_0xc1a4('0x121')](db[_0xc1a4('0x28')],{'as':_0xc1a4('0x167'),'foreignKey':_0xc1a4('0x168'),'constraints':![]});db[_0xc1a4('0x24')][_0xc1a4('0x121')](db[_0xc1a4('0x26')],{'as':_0xc1a4('0x169'),'foreignKey':_0xc1a4('0x168'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x11f'),'foreignKey':'UserId'});db[_0xc1a4('0x24')][_0xc1a4('0x133')](db['CmContact'],{'as':'Contact','foreignKey':_0xc1a4('0x16a')});db['MailServerIn']['belongsTo'](db[_0xc1a4('0x3d')],{'as':_0xc1a4('0x3d'),'foreignKey':_0xc1a4('0x16b')});db[_0xc1a4('0x3b')][_0xc1a4('0x133')](db[_0xc1a4('0x111')],{'as':_0xc1a4('0x111'),'foreignKey':_0xc1a4('0x16c'),'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x16e')][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{'as':_0xc1a4('0x3d'),'foreignKey':_0xc1a4('0x16b')});db[_0xc1a4('0x16e')][_0xc1a4('0x133')](db[_0xc1a4('0x111')],{'as':_0xc1a4('0x111'),'foreignKey':_0xc1a4('0x16c'),'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x3d')]['hasOne'](db[_0xc1a4('0x3b')],{'as':_0xc1a4('0x16f'),'onDelete':_0xc1a4('0x11d')});db['MailAccount'][_0xc1a4('0x11c')](db[_0xc1a4('0x16e')],{'as':'Smtp','onDelete':'cascade'});db[_0xc1a4('0x3d')][_0xc1a4('0x121')](db[_0xc1a4('0x84')],{'as':'Dispositions','foreignKey':_0xc1a4('0x16b'),'onDelete':'cascade'});db[_0xc1a4('0x3d')][_0xc1a4('0x121')](db[_0xc1a4('0x170')],{'as':_0xc1a4('0x171'),'foreignKey':_0xc1a4('0x16b')});db[_0xc1a4('0x3d')]['hasMany'](db[_0xc1a4('0x44')],{'as':_0xc1a4('0x164'),'foreignKey':_0xc1a4('0x16b')});db[_0xc1a4('0x3d')][_0xc1a4('0x121')](db[_0xc1a4('0x42')],{'as':_0xc1a4('0x172')});db['MailAccount'][_0xc1a4('0x121')](db[_0xc1a4('0x173')],{'as':_0xc1a4('0x155'),'foreignKey':_0xc1a4('0x16b'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x3d')][_0xc1a4('0x133')](db['CmList'],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x3d')][_0xc1a4('0x133')](db['Template'],{'as':_0xc1a4('0x98'),'foreignKey':_0xc1a4('0x176')});db[_0xc1a4('0x3d')]['belongsTo'](db['Pause'],{'as':_0xc1a4('0x177'),'foreignKey':_0xc1a4('0x15e')});db[_0xc1a4('0x3d')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':'user_has_mail_accounts'});db[_0xc1a4('0x3f')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x34')});db[_0xc1a4('0x3f')][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':'team_has_mail_queues','as':_0xc1a4('0x161')});db[_0xc1a4('0x42')][_0xc1a4('0x121')](db[_0xc1a4('0x44')],{'as':'Messages','onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x178')});db['MailInteraction'][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x16b')});db[_0xc1a4('0x42')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db['MailInteraction'][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17b'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x42')][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'through':_0xc1a4('0x17d'),'as':_0xc1a4('0x17e')});db['MailInteraction'][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'through':_0xc1a4('0x17d'),'as':'ThroughTags'});db['MailInteraction'][_0xc1a4('0x135')](db['User'],{'as':_0xc1a4('0x17f'),'through':'user_has_mail_interactions','foreignKey':_0xc1a4('0x178')});db[_0xc1a4('0x44')]['hasMany'](db[_0xc1a4('0xee')],{'as':'Attachments','onDelete':'cascade'});db[_0xc1a4('0x44')]['belongsTo'](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x11f')});db[_0xc1a4('0x44')]['belongsTo'](db[_0xc1a4('0x74')],{'onDelete':_0xc1a4('0x11d'),'as':_0xc1a4('0x17a')});db[_0xc1a4('0x44')]['belongsTo'](db[_0xc1a4('0x42')],{'as':_0xc1a4('0x180'),'foreignKey':_0xc1a4('0x178')});db[_0xc1a4('0x44')][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{'as':_0xc1a4('0x179'),'foreignKey':'MailAccountId'});db[_0xc1a4('0x44')][_0xc1a4('0x133')](db[_0xc1a4('0x148')],{'as':_0xc1a4('0x148'),'foreignKey':'ChatWebsiteId'});db[_0xc1a4('0x44')][_0xc1a4('0x133')](db[_0xc1a4('0x6b')],{'as':_0xc1a4('0x6b'),'foreignKey':'ChatOfflineMessageId'});db[_0xc1a4('0x173')][_0xc1a4('0x133')](db['User'],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x173')]['belongsTo'](db[_0xc1a4('0x3f')],{'onDelete':_0xc1a4('0x16d')});db['MailApplication'][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{'onDelete':_0xc1a4('0x16d')});db['MailApplication'][_0xc1a4('0x133')](db[_0xc1a4('0x88')],{'onDelete':'restrict','foreignKey':_0xc1a4('0x15d')});db[_0xc1a4('0x173')][_0xc1a4('0x133')](db[_0xc1a4('0x17c')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x181')});db['MailQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{});db[_0xc1a4('0x46')]['belongsTo'](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x174'),'foreignKey':'ListId'});db[_0xc1a4('0x46')][_0xc1a4('0x133')](db['CmContact'],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x46')][_0xc1a4('0x133')](db[_0xc1a4('0x42')],{});db[_0xc1a4('0x46')][_0xc1a4('0x133')](db[_0xc1a4('0x44')],{});db[_0xc1a4('0x46')][_0xc1a4('0x133')](db['User'],{});db[_0xc1a4('0x46')]['belongsTo'](db[_0xc1a4('0x3f')],{});db[_0xc1a4('0x182')]['hasMany'](db[_0xc1a4('0x183')],{'as':'Items','onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x49')][_0xc1a4('0x121')](db['Disposition'],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x185'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x49')][_0xc1a4('0x121')](db[_0xc1a4('0x170')],{'as':'Answers','foreignKey':_0xc1a4('0x185')});db[_0xc1a4('0x49')][_0xc1a4('0x121')](db[_0xc1a4('0x4c')],{'as':_0xc1a4('0x172')});db['FaxAccount']['hasMany'](db[_0xc1a4('0x4a')],{'as':_0xc1a4('0x155'),'foreignKey':_0xc1a4('0x185'),'onDelete':_0xc1a4('0x11d')});db['FaxAccount']['hasMany'](db[_0xc1a4('0x124')],{'as':_0xc1a4('0x186'),'onDelete':_0xc1a4('0x11d')});db['FaxAccount']['hasMany'](db[_0xc1a4('0x187')],{'as':_0xc1a4('0x164')});db[_0xc1a4('0x49')][_0xc1a4('0x133')](db[_0xc1a4('0x2b')],{'as':_0xc1a4('0x2b')});db['FaxAccount'][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':'List','foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x49')]['belongsTo'](db[_0xc1a4('0x8a')],{'as':_0xc1a4('0x177'),'foreignKey':_0xc1a4('0x15e')});db['FaxAccount'][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x14b')});db[_0xc1a4('0x4a')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x4a')]['belongsTo'](db[_0xc1a4('0x4f')],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x4a')][_0xc1a4('0x133')](db['FaxAccount'],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x4a')][_0xc1a4('0x133')](db[_0xc1a4('0x17c')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':'TagId'});db[_0xc1a4('0x4c')][_0xc1a4('0x121')](db[_0xc1a4('0x187')],{'as':_0xc1a4('0x164'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x188')});db['FaxInteraction'][_0xc1a4('0x133')](db[_0xc1a4('0x49')],{'as':_0xc1a4('0x179'),'foreignKey':'FaxAccountId'});db[_0xc1a4('0x4c')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db['FaxInteraction']['belongsTo'](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17b'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x4c')]['belongsToMany'](db[_0xc1a4('0x17c')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0xc1a4('0x4c')][_0xc1a4('0x135')](db['Tag'],{'through':_0xc1a4('0x189'),'as':_0xc1a4('0x18a')});db[_0xc1a4('0x4c')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17f'),'through':_0xc1a4('0x13d'),'foreignKey':_0xc1a4('0x188')});db[_0xc1a4('0x187')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'onDelete':_0xc1a4('0x11d'),'as':_0xc1a4('0x11f')});db['FaxMessage'][_0xc1a4('0x133')](db[_0xc1a4('0x4c')],{'as':_0xc1a4('0x180'),'foreignKey':_0xc1a4('0x188')});db['FaxMessage'][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'onDelete':_0xc1a4('0x11d'),'as':_0xc1a4('0x17a')});db[_0xc1a4('0x187')][_0xc1a4('0x133')](db[_0xc1a4('0xee')],{'as':_0xc1a4('0xee'),'foreignKey':_0xc1a4('0x18b')});db[_0xc1a4('0x187')][_0xc1a4('0x133')](db[_0xc1a4('0x49')],{'as':'Account','foreignKey':_0xc1a4('0x185')});db[_0xc1a4('0x4f')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x36')});db[_0xc1a4('0x4f')][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':_0xc1a4('0x18c'),'as':_0xc1a4('0x161')});db[_0xc1a4('0x51')]['belongsTo'](db[_0xc1a4('0x49')],{});db[_0xc1a4('0x51')][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x51')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x51')]['belongsTo'](db['FaxInteraction'],{});db[_0xc1a4('0x51')][_0xc1a4('0x133')](db[_0xc1a4('0x187')],{});db[_0xc1a4('0x51')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{});db[_0xc1a4('0x51')][_0xc1a4('0x133')](db[_0xc1a4('0x4f')],{});db[_0xc1a4('0x53')]['hasMany'](db[_0xc1a4('0x84')],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x18d'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x53')][_0xc1a4('0x121')](db[_0xc1a4('0x170')],{'as':_0xc1a4('0x171'),'foreignKey':_0xc1a4('0x18d')});db[_0xc1a4('0x53')][_0xc1a4('0x121')](db[_0xc1a4('0x59')],{'as':_0xc1a4('0x164'),'foreignKey':_0xc1a4('0x18d')});db['SmsAccount'][_0xc1a4('0x121')](db[_0xc1a4('0x57')],{'as':'Interactions'});db[_0xc1a4('0x53')][_0xc1a4('0x121')](db[_0xc1a4('0x55')],{'as':_0xc1a4('0x155'),'foreignKey':_0xc1a4('0x18d'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x53')][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':'List','foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x53')][_0xc1a4('0x133')](db[_0xc1a4('0x8a')],{'as':_0xc1a4('0x177'),'foreignKey':_0xc1a4('0x15e')});db[_0xc1a4('0x53')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':'user_has_sms_accounts'});db[_0xc1a4('0x55')]['belongsTo'](db[_0xc1a4('0x11f')],{'onDelete':'restrict'});db[_0xc1a4('0x55')][_0xc1a4('0x133')](db[_0xc1a4('0x141')],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x55')][_0xc1a4('0x133')](db[_0xc1a4('0x53')],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x55')][_0xc1a4('0x133')](db[_0xc1a4('0x88')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x15d')});db[_0xc1a4('0x55')][_0xc1a4('0x133')](db['Tag'],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x181')});db['SmsInteraction'][_0xc1a4('0x121')](db['SmsMessage'],{'as':_0xc1a4('0x164'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x18e')});db['SmsInteraction'][_0xc1a4('0x133')](db[_0xc1a4('0x53')],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x18d')});db[_0xc1a4('0x57')]['belongsTo'](db[_0xc1a4('0x74')],{'as':'Contact','foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x57')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17b'),'foreignKey':'UserId'});db['SmsInteraction'][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'through':'sms_interaction_has_tags','as':_0xc1a4('0x17e')});db[_0xc1a4('0x57')][_0xc1a4('0x135')](db['Tag'],{'through':_0xc1a4('0x18f'),'as':_0xc1a4('0x18a')});db[_0xc1a4('0x57')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17f'),'through':_0xc1a4('0x13e'),'foreignKey':_0xc1a4('0x18e')});db[_0xc1a4('0x59')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x11f')});db[_0xc1a4('0x59')]['belongsTo'](db['CmContact'],{'onDelete':_0xc1a4('0x11d'),'as':'Contact'});db[_0xc1a4('0x59')][_0xc1a4('0x133')](db['SmsInteraction'],{'onDelete':_0xc1a4('0x11d'),'as':_0xc1a4('0x180'),'foreignKey':_0xc1a4('0x18e')});db[_0xc1a4('0x59')][_0xc1a4('0x133')](db['SmsAccount'],{'as':_0xc1a4('0x179'),'foreignKey':'SmsAccountId'});db[_0xc1a4('0x141')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x143'),'foreignKey':_0xc1a4('0x190')});db[_0xc1a4('0x141')]['belongsToMany'](db[_0xc1a4('0x13a')],{'through':_0xc1a4('0x191'),'as':_0xc1a4('0x161')});db[_0xc1a4('0x5b')][_0xc1a4('0x121')](db['Disposition'],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x192'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x5b')][_0xc1a4('0x121')](db[_0xc1a4('0x170')],{'as':_0xc1a4('0x171'),'foreignKey':_0xc1a4('0x192')});db[_0xc1a4('0x5b')]['hasMany'](db[_0xc1a4('0x5f')],{'as':_0xc1a4('0x172'),'foreignKey':_0xc1a4('0x192')});db[_0xc1a4('0x5b')][_0xc1a4('0x121')](db[_0xc1a4('0x61')],{'as':_0xc1a4('0x164'),'foreignKey':_0xc1a4('0x192')});db[_0xc1a4('0x5b')][_0xc1a4('0x121')](db['OpenchannelApplication'],{'as':_0xc1a4('0x155'),'foreignKey':_0xc1a4('0x192'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x5b')][_0xc1a4('0x133')](db['CmList'],{'as':'List','foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x5b')][_0xc1a4('0x133')](db[_0xc1a4('0x8a')],{'as':'mandatoryDispositionPause','foreignKey':_0xc1a4('0x15e')});db[_0xc1a4('0x5b')]['belongsToMany'](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x14f')});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x5d')]['belongsTo'](db[_0xc1a4('0x62')],{'onDelete':'restrict','foreignKey':_0xc1a4('0x193')});db[_0xc1a4('0x5d')]['belongsTo'](db[_0xc1a4('0x5b')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x192')});db['OpenchannelApplication'][_0xc1a4('0x133')](db[_0xc1a4('0x88')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x15d')});db['OpenchannelApplication']['belongsTo'](db['Tag'],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x181')});db[_0xc1a4('0x5f')][_0xc1a4('0x121')](db[_0xc1a4('0x61')],{'as':_0xc1a4('0x164'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x194')});db['OpenchannelInteraction']['belongsTo'](db[_0xc1a4('0x5b')],{'as':'Account','foreignKey':_0xc1a4('0x192')});db['OpenchannelInteraction']['belongsTo'](db[_0xc1a4('0x74')],{'as':'Contact','foreignKey':_0xc1a4('0x16a')});db['OpenchannelInteraction'][_0xc1a4('0x133')](db['User'],{'as':_0xc1a4('0x17b'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x5f')][_0xc1a4('0x135')](db['Tag'],{'through':_0xc1a4('0x195'),'as':_0xc1a4('0x17e')});db[_0xc1a4('0x5f')][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'through':'openchannel_interaction_has_tags','as':_0xc1a4('0x18a')});db[_0xc1a4('0x5f')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':'Users','through':_0xc1a4('0x196'),'foreignKey':_0xc1a4('0x194')});db[_0xc1a4('0x61')][_0xc1a4('0x133')](db['User'],{'onDelete':'cascade','as':_0xc1a4('0x11f')});db['OpenchannelMessage'][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'onDelete':_0xc1a4('0x11d'),'as':_0xc1a4('0x17a')});db['OpenchannelMessage'][_0xc1a4('0x133')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xc1a4('0x194')});db['OpenchannelMessage'][_0xc1a4('0x133')](db[_0xc1a4('0xee')],{'as':_0xc1a4('0xee'),'foreignKey':_0xc1a4('0x18b')});db[_0xc1a4('0x61')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xc1a4('0x179'),'foreignKey':'OpenchannelAccountId'});db[_0xc1a4('0x62')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite']['hasMany'](db[_0xc1a4('0x84')],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x197'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x148')][_0xc1a4('0x121')](db[_0xc1a4('0x170')],{'as':'Answers','foreignKey':_0xc1a4('0x197')});db[_0xc1a4('0x148')]['hasMany'](db['ChatProactiveAction'],{'as':_0xc1a4('0x198')});db['ChatWebsite'][_0xc1a4('0x121')](db[_0xc1a4('0x67')],{'as':'Interactions'});db[_0xc1a4('0x148')]['hasMany'](db[_0xc1a4('0x199')],{'as':_0xc1a4('0x155'),'foreignKey':_0xc1a4('0x197'),'onDelete':_0xc1a4('0x11d')});db['ChatWebsite'][_0xc1a4('0x121')](db[_0xc1a4('0x69')],{'as':_0xc1a4('0x164')});db[_0xc1a4('0x148')][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':'List','foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x148')][_0xc1a4('0x133')](db[_0xc1a4('0x88')],{'as':'Interval','foreignKey':_0xc1a4('0x15d')});db[_0xc1a4('0x148')][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{'as':_0xc1a4('0x3d'),'foreignKey':_0xc1a4('0x16b')});db[_0xc1a4('0x148')]['belongsTo'](db['Pause'],{'as':_0xc1a4('0x177'),'foreignKey':_0xc1a4('0x15e')});db[_0xc1a4('0x148')]['belongsToMany'](db['User'],{'as':_0xc1a4('0x160'),'through':'user_has_chat_websites'});db[_0xc1a4('0x19a')][_0xc1a4('0x133')](db[_0xc1a4('0x5b')],{});db['OpenchannelQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':'List','foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x19a')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db['OpenchannelQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x5f')],{});db[_0xc1a4('0x19a')][_0xc1a4('0x133')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{});db[_0xc1a4('0x19a')][_0xc1a4('0x133')](db[_0xc1a4('0x62')],{});db[_0xc1a4('0x199')][_0xc1a4('0x133')](db['User'],{'as':_0xc1a4('0x19b'),'foreignKey':_0xc1a4('0x11e'),'onDelete':'restrict'});db[_0xc1a4('0x199')][_0xc1a4('0x133')](db[_0xc1a4('0x6d')],{'as':_0xc1a4('0x19c'),'foreignKey':'ChatQueueId','onDelete':_0xc1a4('0x16d')});db['ChatApplication']['belongsTo'](db[_0xc1a4('0x148')],{'as':_0xc1a4('0x19d'),'foreignKey':_0xc1a4('0x197'),'onDelete':'restrict'});db[_0xc1a4('0x199')][_0xc1a4('0x133')](db[_0xc1a4('0x17c')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x181')});db['ChatInteraction']['hasMany'](db[_0xc1a4('0x69')],{'as':_0xc1a4('0x164'),'onDelete':'cascade','foreignKey':_0xc1a4('0x19e')});db[_0xc1a4('0x67')][_0xc1a4('0x133')](db['ChatWebsite'],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x197')});db[_0xc1a4('0x67')]['belongsTo'](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db['ChatInteraction'][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17b'),'foreignKey':_0xc1a4('0x11e')});db[_0xc1a4('0x67')][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'through':_0xc1a4('0x19f'),'as':_0xc1a4('0x17e')});db['ChatInteraction']['belongsToMany'](db[_0xc1a4('0x17c')],{'through':_0xc1a4('0x19f'),'as':_0xc1a4('0x18a')});db[_0xc1a4('0x67')][_0xc1a4('0x135')](db['User'],{'as':_0xc1a4('0x17f'),'through':_0xc1a4('0x1a0'),'foreignKey':_0xc1a4('0x19e')});db['ChatMessage'][_0xc1a4('0x133')](db['User'],{'onDelete':_0xc1a4('0x11d'),'as':'User'});db[_0xc1a4('0x69')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'onDelete':'cascade','as':_0xc1a4('0x17a'),'foreignKey':'ContactId'});db[_0xc1a4('0x69')][_0xc1a4('0x133')](db[_0xc1a4('0x67')],{'onDelete':'cascade','as':_0xc1a4('0x180'),'foreignKey':_0xc1a4('0x19e')});db[_0xc1a4('0x69')][_0xc1a4('0x133')](db[_0xc1a4('0xee')],{'as':'Attachment','foreignKey':_0xc1a4('0x18b')});db[_0xc1a4('0x69')][_0xc1a4('0x133')](db[_0xc1a4('0x148')],{'as':_0xc1a4('0x179'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xc1a4('0x121')](db[_0xc1a4('0xee')],{'as':'Attachments','foreignKey':_0xc1a4('0x1a1'),'onDelete':_0xc1a4('0x11d'),'hooks':!![]});db['ChatOfflineMessage'][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'onDelete':_0xc1a4('0x11d'),'as':'Contact','foreignKey':'ContactId'});db[_0xc1a4('0x6b')][_0xc1a4('0x133')](db['ChatWebsite'],{'as':_0xc1a4('0x179'),'foreignKey':'ChatWebsiteId'});db[_0xc1a4('0x6d')]['belongsToMany'](db['User'],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x33'),'hooks':!![]});db['ChatQueue'][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':'team_has_chat_queues','as':_0xc1a4('0x161')});db[_0xc1a4('0x6f')][_0xc1a4('0x121')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xc1a4('0x11d')});db['ChatGroup'][_0xc1a4('0x135')](db['User'],{'as':'Members','through':_0xc1a4('0x137')});db['ChatProactiveAction'][_0xc1a4('0x133')](db[_0xc1a4('0x148')],{'as':_0xc1a4('0x19d'),'foreignKey':'ChatWebsiteId'});db[_0xc1a4('0x72')][_0xc1a4('0x121')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x138'),'foreignKey':_0xc1a4('0x1a2')});db[_0xc1a4('0x74')][_0xc1a4('0x121')](db[_0xc1a4('0x95')],{'as':_0xc1a4('0x1a3'),'foreignKey':_0xc1a4('0x1a4')});db[_0xc1a4('0x74')][_0xc1a4('0x121')](db[_0xc1a4('0x75')],{'as':_0xc1a4('0x131'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x74')][_0xc1a4('0x121')](db[_0xc1a4('0x79')],{'as':_0xc1a4('0x126'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x74')][_0xc1a4('0x121')](db[_0xc1a4('0x7b')],{'as':_0xc1a4('0x1a5'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x74')]['hasMany'](db[_0xc1a4('0x128')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xc1a4('0x74')][_0xc1a4('0x121')](db[_0xc1a4('0xda')],{'as':_0xc1a4('0x15a'),'foreignKey':_0xc1a4('0x16a')});db['CmContact'][_0xc1a4('0x121')](db[_0xc1a4('0x5f')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x74')]['hasMany'](db[_0xc1a4('0x67')],{'as':_0xc1a4('0x12a'),'foreignKey':_0xc1a4('0x16a'),'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x74')]['hasMany'](db[_0xc1a4('0x57')],{'as':_0xc1a4('0x12b'),'foreignKey':'ContactId','onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x74')]['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0xc1a4('0x16d')});db['CmContact'][_0xc1a4('0x121')](db[_0xc1a4('0x42')],{'as':_0xc1a4('0x12d'),'foreignKey':_0xc1a4('0x16a'),'onDelete':'restrict'});db[_0xc1a4('0x74')][_0xc1a4('0x133')](db[_0xc1a4('0x72')],{'as':_0xc1a4('0x1a6'),'foreignKey':_0xc1a4('0x1a2')});db[_0xc1a4('0x74')]['belongsTo'](db['CmList'],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175'),'onDelete':'cascade'});db[_0xc1a4('0x74')]['belongsToMany'](db['User'],{'as':_0xc1a4('0x17f'),'through':_0xc1a4('0x1a7')});db['CmContact'][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'as':_0xc1a4('0x17e'),'through':'cm_contact_has_tags'});db[_0xc1a4('0x74')][_0xc1a4('0x135')](db['Tag'],{'through':_0xc1a4('0x1a8'),'as':_0xc1a4('0x18a')});db[_0xc1a4('0x75')]['hasMany'](db[_0xc1a4('0x97')],{'as':_0xc1a4('0x1a9'),'foreignKey':_0xc1a4('0x1aa')});db[_0xc1a4('0x75')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x75')][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x174'),'foreignKey':'ListId','onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x75')][_0xc1a4('0x133')](db['User'],{'as':'Agent','foreignKey':_0xc1a4('0x11e')});db['CmHopper'][_0xc1a4('0x133')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xc1a4('0x158'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x75')][_0xc1a4('0x133')](db[_0xc1a4('0xeb')],{'as':'Campaign','foreignKey':_0xc1a4('0x1ab'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x75')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17b'),'foreignKey':_0xc1a4('0x1ac')});db['CmHopperBlack'][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':'Contact','foreignKey':_0xc1a4('0x16a'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x77')][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175'),'onDelete':_0xc1a4('0x11d')});db['CmHopperBlack'][_0xc1a4('0x133')](db[_0xc1a4('0x1c')],{'as':_0xc1a4('0x19c'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xc1a4('0x77')][_0xc1a4('0x133')](db[_0xc1a4('0xeb')],{'as':'Campaign','foreignKey':_0xc1a4('0x1ab'),'onDelete':'cascade'});db[_0xc1a4('0x81')][_0xc1a4('0x121')](db['Condition'],{'as':{'plural':_0xc1a4('0x1ad'),'singular':'OneAll'},'foreignKey':_0xc1a4('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0xc1a4('0x81')][_0xc1a4('0x121')](db[_0xc1a4('0x86')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0xc1a4('0x11d'),'hooks':!![]});db[_0xc1a4('0x81')][_0xc1a4('0x121')](db[_0xc1a4('0x7f')],{'as':_0xc1a4('0x1af'),'foreignKey':_0xc1a4('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0xc1a4('0x84')]['hasMany'](db[_0xc1a4('0x84')],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x1b1'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x88')][_0xc1a4('0x121')](db[_0xc1a4('0x88')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xc1a4('0x11d'),'hooks':!![],'required':![]});db[_0xc1a4('0x88')][_0xc1a4('0x121')](db['VoiceExtension'],{'as':_0xc1a4('0x125'),'foreignKey':'IntervalId','onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x88')][_0xc1a4('0x121')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xc1a4('0x15d')});db[_0xc1a4('0x88')][_0xc1a4('0x121')](db[_0xc1a4('0x199')],{'as':_0xc1a4('0x1b2'),'foreignKey':'IntervalId'});db[_0xc1a4('0x88')][_0xc1a4('0x121')](db[_0xc1a4('0x4a')],{'as':_0xc1a4('0x1b3'),'foreignKey':_0xc1a4('0x15d')});db['Interval'][_0xc1a4('0x121')](db['SmsApplication'],{'as':_0xc1a4('0x1b4'),'foreignKey':_0xc1a4('0x15d')});db[_0xc1a4('0x8f')][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{});db[_0xc1a4('0x8f')][_0xc1a4('0x133')](db['AnalyticDefaultReport'],{'foreignKey':_0xc1a4('0x1b5')});db['Schedule'][_0xc1a4('0x133')](db['AnalyticCustomReport'],{'foreignKey':_0xc1a4('0x1b6')});db[_0xc1a4('0x91')][_0xc1a4('0x135')](db[_0xc1a4('0x1a')],{'as':_0xc1a4('0x1b7'),'through':_0xc1a4('0x1b8'),'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x17c')]['belongsToMany'](db[_0xc1a4('0x74')],{'through':_0xc1a4('0x1a8')});db[_0xc1a4('0x17c')][_0xc1a4('0x135')](db[_0xc1a4('0x67')],{'through':_0xc1a4('0x19f')});db[_0xc1a4('0x17c')]['belongsToMany'](db['MailInteraction'],{'through':_0xc1a4('0x17d')});db[_0xc1a4('0x17c')][_0xc1a4('0x135')](db[_0xc1a4('0x57')],{'through':_0xc1a4('0x18f')});db[_0xc1a4('0x17c')][_0xc1a4('0x135')](db[_0xc1a4('0x4c')],{'through':_0xc1a4('0x189')});db[_0xc1a4('0x17c')]['belongsToMany'](db[_0xc1a4('0x5f')],{'through':_0xc1a4('0x195')});db[_0xc1a4('0x17c')]['belongsToMany'](db[_0xc1a4('0x109')],{'through':_0xc1a4('0x1b9')});db[_0xc1a4('0x95')][_0xc1a4('0x133')](db[_0xc1a4('0x94')],{'as':_0xc1a4('0x1ba'),'foreignKey':_0xc1a4('0x1bb')});db[_0xc1a4('0x97')][_0xc1a4('0x133')](db[_0xc1a4('0x75')],{'as':_0xc1a4('0x1bc'),'foreignKey':_0xc1a4('0x1aa')});db['CmContactHasItem'][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':'Contact','foreignKey':_0xc1a4('0x1a4')});db[_0xc1a4('0x1bd')][_0xc1a4('0x121')](db[_0xc1a4('0x86')],{'as':{'plural':_0xc1a4('0x1be'),'singular':_0xc1a4('0x1bf')},'foreignKey':_0xc1a4('0x1c0'),'onDelete':_0xc1a4('0x11d'),'hooks':!![]});db[_0xc1a4('0x1bd')]['hasMany'](db[_0xc1a4('0x86')],{'as':{'plural':_0xc1a4('0x1c1'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xc1a4('0x1bd')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xc1a4('0x1c2'),'onDelete':'cascade','hooks':!![]});db[_0xc1a4('0x9f')][_0xc1a4('0x121')](db['AnalyticFieldReport'],{'as':_0xc1a4('0x1c3'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xc1a4('0xa1')][_0xc1a4('0x121')](db['AnalyticFieldReport'],{'as':_0xc1a4('0x1c3'),'onDelete':_0xc1a4('0x11d'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xc1a4('0x1c4')});db['AnalyticFieldReport'][_0xc1a4('0x133')](db[_0xc1a4('0xa4')],{'foreignKey':_0xc1a4('0x1c4')});db['SalesforceAccount'][_0xc1a4('0x121')](db[_0xc1a4('0xac')],{'as':_0xc1a4('0x1c5'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1c6')});db['SalesforceConfiguration'][_0xc1a4('0x121')](db[_0xc1a4('0x1c7')],{'as':_0xc1a4('0x1c8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xc1a4('0xac')][_0xc1a4('0x121')](db[_0xc1a4('0x1c7')],{'as':_0xc1a4('0x1c9'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0xac')][_0xc1a4('0x121')](db[_0xc1a4('0x1c7')],{'as':'Fields','onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1cb')});db['SalesforceConfiguration'][_0xc1a4('0x133')](db[_0xc1a4('0xaa')],{'as':_0xc1a4('0x179'),'foreignKey':'AccountId'});db[_0xc1a4('0x1c7')][_0xc1a4('0x121')](db[_0xc1a4('0x1c7')],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db['SalesforceField'][_0xc1a4('0x121')](db['SalesforceField'],{'as':_0xc1a4('0x1ce'),'foreignKey':'DescriptionId'});db[_0xc1a4('0x1c7')][_0xc1a4('0x121')](db[_0xc1a4('0x1c7')],{'as':_0xc1a4('0x1cf'),'foreignKey':_0xc1a4('0x1cb')});db['SalesforceField'][_0xc1a4('0x133')](db['Variable'],{'as':_0xc1a4('0x9a'),'foreignKey':_0xc1a4('0x1d0')});db[_0xc1a4('0xae')][_0xc1a4('0x121')](db[_0xc1a4('0x1d1')],{'as':'Configurations','onDelete':_0xc1a4('0x11d'),'foreignKey':'AccountId'});db[_0xc1a4('0x1d1')]['hasMany'](db[_0xc1a4('0xb0')],{'as':_0xc1a4('0x1c8'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0x1d1')][_0xc1a4('0x121')](db['SugarcrmField'],{'as':_0xc1a4('0x1c9'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1d1')][_0xc1a4('0x121')](db['SugarcrmField'],{'as':'Fields','onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0x1d1')][_0xc1a4('0x133')](db[_0xc1a4('0xae')],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x1c6')});db[_0xc1a4('0xb0')][_0xc1a4('0x121')](db['SugarcrmField'],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db['SugarcrmField'][_0xc1a4('0x121')](db[_0xc1a4('0xb0')],{'as':_0xc1a4('0x1ce'),'foreignKey':_0xc1a4('0x1ca')});db['SugarcrmField'][_0xc1a4('0x121')](db[_0xc1a4('0xb0')],{'as':'Field','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xb0')][_0xc1a4('0x133')](db[_0xc1a4('0x9a')],{'as':'Variable','foreignKey':_0xc1a4('0x1d0')});db['DeskAccount'][_0xc1a4('0x121')](db['DeskConfiguration'],{'as':_0xc1a4('0x1c5'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1c6')});db['DeskConfiguration'][_0xc1a4('0x121')](db[_0xc1a4('0xb4')],{'as':_0xc1a4('0x1c8'),'onDelete':_0xc1a4('0x11d'),'foreignKey':'SubjectId'});db[_0xc1a4('0x1d2')]['hasMany'](db[_0xc1a4('0xb4')],{'as':_0xc1a4('0x1c9'),'onDelete':_0xc1a4('0x11d'),'foreignKey':'DescriptionId'});db[_0xc1a4('0x1d2')][_0xc1a4('0x121')](db[_0xc1a4('0xb4')],{'as':_0xc1a4('0x1c3'),'onDelete':'cascade','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0x1d2')][_0xc1a4('0x133')](db[_0xc1a4('0xb1')],{'as':_0xc1a4('0x179'),'foreignKey':'AccountId'});db['DeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xc1a4('0x1d3')});db[_0xc1a4('0xb4')][_0xc1a4('0x121')](db[_0xc1a4('0xb4')],{'as':'Subject','foreignKey':_0xc1a4('0x1cd')});db['DeskField'][_0xc1a4('0x121')](db[_0xc1a4('0xb4')],{'as':_0xc1a4('0x1ce'),'foreignKey':_0xc1a4('0x1ca')});db['DeskField'][_0xc1a4('0x121')](db[_0xc1a4('0xb4')],{'as':'Field','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xb4')][_0xc1a4('0x133')](db['Variable'],{'as':_0xc1a4('0x9a'),'foreignKey':_0xc1a4('0x1d0')});db[_0xc1a4('0xb6')]['hasMany'](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc1a4('0x1c6')});db['ZohoConfiguration'][_0xc1a4('0x121')](db[_0xc1a4('0x1d4')],{'as':_0xc1a4('0x1c8'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0xb8')][_0xc1a4('0x121')](db[_0xc1a4('0x1d4')],{'as':_0xc1a4('0x1c9'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0xb8')]['hasMany'](db[_0xc1a4('0x1d4')],{'as':_0xc1a4('0x1c3'),'onDelete':'cascade','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xb8')][_0xc1a4('0x133')](db[_0xc1a4('0xb6')],{'as':_0xc1a4('0x179'),'foreignKey':'AccountId'});db['ZohoField'][_0xc1a4('0x121')](db[_0xc1a4('0x1d4')],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db['ZohoField'][_0xc1a4('0x121')](db[_0xc1a4('0x1d4')],{'as':'Description','foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1d4')][_0xc1a4('0x121')](db[_0xc1a4('0x1d4')],{'as':_0xc1a4('0x1cf'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0x1d4')][_0xc1a4('0x133')](db[_0xc1a4('0x9a')],{'as':_0xc1a4('0x9a'),'foreignKey':_0xc1a4('0x1d0')});db[_0xc1a4('0x1d5')]['hasMany'](db[_0xc1a4('0x1d6')],{'as':_0xc1a4('0x1c5'),'onDelete':'cascade','foreignKey':_0xc1a4('0x1c6')});db['ZendeskConfiguration'][_0xc1a4('0x121')](db[_0xc1a4('0xbc')],{'as':_0xc1a4('0x1c8'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0x1d6')][_0xc1a4('0x121')](db[_0xc1a4('0xbc')],{'as':_0xc1a4('0x1c9'),'foreignKey':_0xc1a4('0x1ca')});db['ZendeskConfiguration'][_0xc1a4('0x121')](db[_0xc1a4('0xbc')],{'as':_0xc1a4('0x1c3'),'foreignKey':_0xc1a4('0x1cb')});db['ZendeskConfiguration'][_0xc1a4('0x133')](db[_0xc1a4('0x1d5')],{'as':'Account','foreignKey':_0xc1a4('0x1c6')});db[_0xc1a4('0x1d6')]['belongsToMany'](db[_0xc1a4('0x17c')],{'through':'int_zendesk_configuration_has_tags'});db[_0xc1a4('0xbc')]['hasMany'](db[_0xc1a4('0xbc')],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0xbc')][_0xc1a4('0x121')](db[_0xc1a4('0xbc')],{'as':_0xc1a4('0x1ce'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0xbc')][_0xc1a4('0x121')](db[_0xc1a4('0xbc')],{'as':_0xc1a4('0x1cf'),'foreignKey':_0xc1a4('0x1cb')});db['ZendeskField']['belongsTo'](db[_0xc1a4('0x9a')],{'as':_0xc1a4('0x9a'),'foreignKey':_0xc1a4('0x1d0')});db[_0xc1a4('0xbd')]['hasMany'](db[_0xc1a4('0x1d7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc1a4('0x1c6')});db[_0xc1a4('0x1d7')]['hasMany'](db[_0xc1a4('0x1d8')],{'as':_0xc1a4('0x1c8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xc1a4('0x1d7')][_0xc1a4('0x121')](db[_0xc1a4('0x1d8')],{'as':'Descriptions','onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1d7')]['hasMany'](db[_0xc1a4('0x1d8')],{'as':_0xc1a4('0x1c3'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0x1d7')]['belongsTo'](db[_0xc1a4('0xbd')],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x1c6')});db[_0xc1a4('0x1d7')][_0xc1a4('0x135')](db['Tag'],{'through':_0xc1a4('0x1d9')});db[_0xc1a4('0x1d8')][_0xc1a4('0x121')](db[_0xc1a4('0x1d8')],{'as':_0xc1a4('0x1cc'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xc1a4('0x121')](db[_0xc1a4('0x1d8')],{'as':_0xc1a4('0x1ce'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1d8')][_0xc1a4('0x121')](db[_0xc1a4('0x1d8')],{'as':_0xc1a4('0x1cf'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0x1d8')][_0xc1a4('0x133')](db[_0xc1a4('0x9a')],{'as':'Variable','foreignKey':'VariableId'});db[_0xc1a4('0x1da')][_0xc1a4('0x121')](db[_0xc1a4('0xc0')],{'as':'Configurations','onDelete':_0xc1a4('0x11d'),'foreignKey':'AccountId'});db[_0xc1a4('0xc0')][_0xc1a4('0x121')](db[_0xc1a4('0x1db')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xc1a4('0xc0')]['hasMany'](db[_0xc1a4('0x1db')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xc1a4('0xc0')][_0xc1a4('0x121')](db[_0xc1a4('0x1db')],{'as':_0xc1a4('0x1c3'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xc0')][_0xc1a4('0x133')](db['VtigerAccount'],{'as':_0xc1a4('0x179'),'foreignKey':'AccountId'});db[_0xc1a4('0x1db')][_0xc1a4('0x121')](db['VtigerField'],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0x1db')][_0xc1a4('0x121')](db['VtigerField'],{'as':'Description','foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1db')][_0xc1a4('0x121')](db[_0xc1a4('0x1db')],{'as':'Field','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0x1db')]['belongsTo'](db['Variable'],{'as':_0xc1a4('0x9a'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xc1a4('0x121')](db[_0xc1a4('0x1dc')],{'as':_0xc1a4('0x1c5'),'onDelete':_0xc1a4('0x11d'),'foreignKey':'AccountId'});db[_0xc1a4('0x1dc')][_0xc1a4('0x121')](db[_0xc1a4('0xc4')],{'as':_0xc1a4('0x1c8'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0x1dc')][_0xc1a4('0x121')](db[_0xc1a4('0xc4')],{'as':_0xc1a4('0x1c9'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1dc')]['hasMany'](db[_0xc1a4('0xc4')],{'as':_0xc1a4('0x1c3'),'foreignKey':_0xc1a4('0x1cb')});db['ServicenowConfiguration'][_0xc1a4('0x133')](db[_0xc1a4('0xc2')],{'as':'Account','foreignKey':_0xc1a4('0x1c6')});db[_0xc1a4('0xc4')][_0xc1a4('0x121')](db[_0xc1a4('0xc4')],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0xc4')][_0xc1a4('0x121')](db['ServicenowField'],{'as':_0xc1a4('0x1ce'),'foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0xc4')][_0xc1a4('0x121')](db[_0xc1a4('0xc4')],{'as':_0xc1a4('0x1cf'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xc4')][_0xc1a4('0x133')](db[_0xc1a4('0x9a')],{'as':_0xc1a4('0x9a'),'foreignKey':'VariableId'});db[_0xc1a4('0xc6')]['hasMany'](db[_0xc1a4('0xc8')],{'as':'Configurations','onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1c6')});db[_0xc1a4('0xc6')][_0xc1a4('0x133')](db[_0xc1a4('0x111')],{'as':_0xc1a4('0x111'),'foreignKey':_0xc1a4('0x16c')});db[_0xc1a4('0xc8')]['hasMany'](db[_0xc1a4('0x1dd')],{'as':_0xc1a4('0x1c8'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0xc8')]['hasMany'](db['Dynamics365Field'],{'as':_0xc1a4('0x1c9'),'onDelete':_0xc1a4('0x11d'),'foreignKey':'DescriptionId'});db[_0xc1a4('0xc8')][_0xc1a4('0x121')](db[_0xc1a4('0x1dd')],{'as':_0xc1a4('0x1c3'),'onDelete':'cascade','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xc8')][_0xc1a4('0x133')](db['Dynamics365Account'],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x1c6')});db['Dynamics365Field'][_0xc1a4('0x121')](db[_0xc1a4('0x1dd')],{'as':_0xc1a4('0x1cc'),'foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0x1dd')][_0xc1a4('0x121')](db['Dynamics365Field'],{'as':'Description','foreignKey':_0xc1a4('0x1ca')});db[_0xc1a4('0x1dd')][_0xc1a4('0x121')](db[_0xc1a4('0x1dd')],{'as':_0xc1a4('0x1cf'),'foreignKey':_0xc1a4('0x1cb')});db['Dynamics365Field']['belongsTo'](db['Variable'],{'as':_0xc1a4('0x9a'),'foreignKey':_0xc1a4('0x1d0')});db[_0xc1a4('0xcb')][_0xc1a4('0x121')](db[_0xc1a4('0xcd')],{'as':'Configurations','onDelete':_0xc1a4('0x11d'),'foreignKey':'AccountId'});db[_0xc1a4('0xcd')]['hasMany'](db[_0xc1a4('0xcf')],{'as':'Subjects','foreignKey':_0xc1a4('0x1cd')});db[_0xc1a4('0xcd')][_0xc1a4('0x121')](db[_0xc1a4('0xcf')],{'as':_0xc1a4('0x1c9'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0xc1a4('0x121')](db[_0xc1a4('0xcf')],{'as':_0xc1a4('0x1c3'),'foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xcd')][_0xc1a4('0x133')](db[_0xc1a4('0xcb')],{'as':_0xc1a4('0x179'),'foreignKey':'AccountId'});db[_0xc1a4('0xcf')]['hasMany'](db[_0xc1a4('0xcf')],{'as':_0xc1a4('0x1cc'),'foreignKey':'SubjectId'});db[_0xc1a4('0xcf')][_0xc1a4('0x121')](db[_0xc1a4('0xcf')],{'as':_0xc1a4('0x1ce'),'foreignKey':_0xc1a4('0x1ca')});db['FreshsalesField'][_0xc1a4('0x121')](db[_0xc1a4('0xcf')],{'as':'Field','foreignKey':_0xc1a4('0x1cb')});db[_0xc1a4('0xcf')][_0xc1a4('0x133')](db['Variable'],{'as':_0xc1a4('0x9a'),'foreignKey':_0xc1a4('0x1d0')});db[_0xc1a4('0xd3')][_0xc1a4('0x133')](db['ChatWebsite'],{});db[_0xc1a4('0xd3')]['belongsTo'](db['CmList'],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175')});db['ChatQueueReport'][_0xc1a4('0x133')](db['CmContact'],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0xd3')][_0xc1a4('0x133')](db[_0xc1a4('0x67')],{});db[_0xc1a4('0xd3')][_0xc1a4('0x133')](db['ChatMessage'],{});db[_0xc1a4('0xd3')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db[_0xc1a4('0xd5')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x1de')});db[_0xc1a4('0xd5')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'onDelete':_0xc1a4('0x11d'),'foreignKey':'ToId'});db[_0xc1a4('0xda')][_0xc1a4('0x121')](db[_0xc1a4('0xd8')],{'foreignKey':_0xc1a4('0x1df'),'onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0xda')]['hasMany'](db[_0xc1a4('0xd7')],{'foreignKey':_0xc1a4('0x1df'),'onDelete':_0xc1a4('0x11d')});db['SmsQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x53')],{});db[_0xc1a4('0x1e0')][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x174'),'foreignKey':'ListId'});db['SmsQueueReport']['belongsTo'](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':'ContactId'});db[_0xc1a4('0x1e0')][_0xc1a4('0x133')](db[_0xc1a4('0x57')],{});db[_0xc1a4('0x1e0')][_0xc1a4('0x133')](db[_0xc1a4('0x59')],{});db[_0xc1a4('0x1e0')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{});db['SmsQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x141')],{});db[_0xc1a4('0x1e1')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0xc1a4('0x1e2')});db[_0xc1a4('0x1e1')]['hasMany'](db[_0xc1a4('0xd8')],{'foreignKey':_0xc1a4('0x1e2')});db[_0xc1a4('0x1e1')][_0xc1a4('0x121')](db[_0xc1a4('0xd7')],{'foreignKey':'ProjectId'});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db['User'],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x13b')});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db[_0xc1a4('0x1c')],{'through':'TeamVoiceQueue','as':_0xc1a4('0x1e3')});db[_0xc1a4('0x13a')]['belongsToMany'](db[_0xc1a4('0x3f')],{'through':_0xc1a4('0x1e4'),'as':'MailQueues'});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db['ChatQueue'],{'through':_0xc1a4('0x1e5'),'as':_0xc1a4('0x140')});db['Team']['belongsToMany'](db[_0xc1a4('0x4f')],{'through':_0xc1a4('0x18c'),'as':_0xc1a4('0x1e6')});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db[_0xc1a4('0x141')],{'through':_0xc1a4('0x191'),'as':_0xc1a4('0x142')});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db[_0xc1a4('0x62')],{'through':_0xc1a4('0x1e7'),'as':_0xc1a4('0x1e8')});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db[_0xc1a4('0x10f')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xc1a4('0x13a')][_0xc1a4('0x135')](db['VoicePrefix'],{'through':_0xc1a4('0x115'),'as':'VoicePrefixes'});db[_0xc1a4('0xeb')][_0xc1a4('0x121')](db[_0xc1a4('0x75')],{'as':_0xc1a4('0x131'),'foreignKey':_0xc1a4('0x1ab')});db[_0xc1a4('0xeb')][_0xc1a4('0x121')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xc1a4('0x1ab')});db[_0xc1a4('0xeb')]['hasMany'](db[_0xc1a4('0x7b')],{'as':_0xc1a4('0x1a5'),'foreignKey':'CampaignId'});db['Campaign'][_0xc1a4('0x121')](db[_0xc1a4('0x77')],{'as':_0xc1a4('0x159'),'foreignKey':_0xc1a4('0x1ab')});db[_0xc1a4('0xeb')][_0xc1a4('0x133')](db[_0xc1a4('0x2b')],{'as':_0xc1a4('0x2b'),'foreignKey':_0xc1a4('0x15b')});db[_0xc1a4('0xeb')]['belongsTo'](db[_0xc1a4('0x2b')],{'as':_0xc1a4('0x1e9'),'foreignKey':'TrunkBackupId'});db[_0xc1a4('0xeb')][_0xc1a4('0x133')](db[_0xc1a4('0x88')],{'as':_0xc1a4('0x88'),'foreignKey':_0xc1a4('0x15d')});db['Campaign'][_0xc1a4('0x133')](db['SquareProject'],{'as':_0xc1a4('0x1ea'),'foreignKey':_0xc1a4('0x1eb')});db[_0xc1a4('0xeb')][_0xc1a4('0x135')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x139'),'through':_0xc1a4('0x1ec')});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0xc1a4('0x1ed'),'through':_0xc1a4('0x1ee')});db[_0xc1a4('0xee')][_0xc1a4('0x133')](db[_0xc1a4('0x6b')],{'as':'ChatOfflineMessage','foreignKey':_0xc1a4('0x1a1')});db[_0xc1a4('0xf2')][_0xc1a4('0x133')](db[_0xc1a4('0x44')],{});db['MailTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x42')],{});db['MailTransferReport']['belongsTo'](db[_0xc1a4('0x3d')],{'foreignKey':_0xc1a4('0x1ef'),'as':'FromAccount'});db[_0xc1a4('0xf2')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f0'),'as':_0xc1a4('0x1f1')});db[_0xc1a4('0xf2')]['belongsTo'](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f2'),'as':_0xc1a4('0x1f3')});db['MailTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x3f')],{'foreignKey':'ToMailQueueId','as':_0xc1a4('0x1f4')});db[_0xc1a4('0xf2')][_0xc1a4('0x133')](db[_0xc1a4('0x3d')],{'foreignKey':_0xc1a4('0x1f5'),'as':_0xc1a4('0x1f6')});db['ChatTransferReport'][_0xc1a4('0x133')](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db[_0xc1a4('0x67')],{});db[_0xc1a4('0xf4')][_0xc1a4('0x133')](db[_0xc1a4('0x148')],{'foreignKey':_0xc1a4('0x1f7'),'as':'FromAccount'});db[_0xc1a4('0xf4')][_0xc1a4('0x133')](db['User'],{'foreignKey':_0xc1a4('0x1f0'),'as':_0xc1a4('0x1f1')});db[_0xc1a4('0xf4')][_0xc1a4('0x133')](db['User'],{'foreignKey':_0xc1a4('0x1f2'),'as':_0xc1a4('0x1f3')});db['ChatTransferReport']['belongsTo'](db[_0xc1a4('0x6d')],{'foreignKey':_0xc1a4('0x1f8'),'as':_0xc1a4('0x1f4')});db['ChatTransferReport'][_0xc1a4('0x133')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0xc1a4('0x1f6')});db[_0xc1a4('0xf5')][_0xc1a4('0x133')](db['FaxMessage'],{});db[_0xc1a4('0xf5')]['belongsTo'](db[_0xc1a4('0x4c')],{});db[_0xc1a4('0xf5')][_0xc1a4('0x133')](db['FaxAccount'],{'foreignKey':_0xc1a4('0x1f9'),'as':_0xc1a4('0x1fa')});db[_0xc1a4('0xf5')][_0xc1a4('0x133')](db['User'],{'foreignKey':_0xc1a4('0x1f0'),'as':'FromAgent'});db[_0xc1a4('0xf5')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f2'),'as':_0xc1a4('0x1f3')});db['FaxTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x4f')],{'foreignKey':_0xc1a4('0x1fb'),'as':'ToQueue'});db[_0xc1a4('0xf5')]['belongsTo'](db[_0xc1a4('0x49')],{'foreignKey':'ToFaxAccountId','as':_0xc1a4('0x1f6')});db[_0xc1a4('0xf7')][_0xc1a4('0x133')](db[_0xc1a4('0x61')],{});db['OpenchannelTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x5f')],{});db[_0xc1a4('0xf7')][_0xc1a4('0x133')](db['OpenchannelAccount'],{'foreignKey':_0xc1a4('0x1fc'),'as':_0xc1a4('0x1fa')});db['OpenchannelTransferReport']['belongsTo'](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f0'),'as':_0xc1a4('0x1f1')});db[_0xc1a4('0xf7')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f2'),'as':_0xc1a4('0x1f3')});db['OpenchannelTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x62')],{'foreignKey':'ToOpenchannelQueueId','as':_0xc1a4('0x1f4')});db[_0xc1a4('0xf7')][_0xc1a4('0x133')](db[_0xc1a4('0x5b')],{'foreignKey':_0xc1a4('0x1fd'),'as':_0xc1a4('0x1f6')});db[_0xc1a4('0xf9')][_0xc1a4('0x133')](db[_0xc1a4('0x59')],{});db[_0xc1a4('0xf9')]['belongsTo'](db[_0xc1a4('0x57')],{});db[_0xc1a4('0xf9')]['belongsTo'](db[_0xc1a4('0x53')],{'foreignKey':'FromSmsAccountId','as':_0xc1a4('0x1fa')});db['SmsTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f0'),'as':_0xc1a4('0x1f1')});db[_0xc1a4('0xf9')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f2'),'as':_0xc1a4('0x1f3')});db['SmsTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x141')],{'foreignKey':_0xc1a4('0x1fe'),'as':'ToQueue'});db['SmsTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x53')],{'foreignKey':_0xc1a4('0x1ff'),'as':_0xc1a4('0x1f6')});db['CmList']['hasMany'](db[_0xc1a4('0x84')],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x175'),'onDelete':'cascade'});db[_0xc1a4('0xfb')][_0xc1a4('0x121')](db[_0xc1a4('0x200')],{'as':'CustomFields','foreignKey':'ListId'});db['CmList']['hasMany'](db['CmContact'],{'as':_0xc1a4('0x138'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0xfb')][_0xc1a4('0x121')](db[_0xc1a4('0x79')],{'as':_0xc1a4('0x126'),'foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0xfb')]['hasMany'](db[_0xc1a4('0x7b')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xc1a4('0xfb')]['hasMany'](db[_0xc1a4('0x128')],{'as':_0xc1a4('0x128'),'foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0xfb')]['belongsToMany'](db[_0xc1a4('0x1c')],{'as':_0xc1a4('0x201'),'through':'voice_queues_has_cm_lists'});db[_0xc1a4('0xfb')]['belongsToMany'](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x147')});db['VoicePrefix'][_0xc1a4('0x121')](db[_0xc1a4('0x124')],{'as':_0xc1a4('0x125'),'onDelete':_0xc1a4('0x11d')});db['VoicePrefix'][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x117')});db[_0xc1a4('0xfd')][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':'TeamVoicePrefix','as':_0xc1a4('0x161')});db[_0xc1a4('0xff')][_0xc1a4('0x121')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x17f'),'foreignKey':_0xc1a4('0x134')});db[_0xc1a4('0xff')][_0xc1a4('0x121')](db[_0xc1a4('0x202')],{'as':_0xc1a4('0x203'),'foreignKey':_0xc1a4('0x134'),'onDelete':_0xc1a4('0x11d')});db['UserProfileSection'][_0xc1a4('0x121')](db[_0xc1a4('0x102')],{'as':_0xc1a4('0x204'),'foreignKey':'sectionId','onDelete':_0xc1a4('0x11d')});db[_0xc1a4('0x106')][_0xc1a4('0x121')](db['Disposition'],{'as':_0xc1a4('0x184'),'foreignKey':_0xc1a4('0x205'),'onDelete':_0xc1a4('0x11d')});db['WhatsappAccount'][_0xc1a4('0x121')](db[_0xc1a4('0x170')],{'as':'Answers','foreignKey':_0xc1a4('0x205')});db[_0xc1a4('0x106')][_0xc1a4('0x121')](db[_0xc1a4('0x10a')],{'as':_0xc1a4('0x164'),'foreignKey':_0xc1a4('0x205')});db[_0xc1a4('0x106')]['hasMany'](db[_0xc1a4('0x109')],{'as':'Interactions'});db[_0xc1a4('0x106')]['hasMany'](db['WhatsappApplication'],{'as':_0xc1a4('0x155'),'foreignKey':_0xc1a4('0x205'),'onDelete':'cascade'});db['WhatsappAccount'][_0xc1a4('0x133')](db['CmList'],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175')});db[_0xc1a4('0x106')][_0xc1a4('0x133')](db[_0xc1a4('0x8a')],{'as':_0xc1a4('0x177'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':'Agents','through':_0xc1a4('0x206')});db[_0xc1a4('0x108')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'onDelete':'restrict'});db[_0xc1a4('0x108')]['belongsTo'](db[_0xc1a4('0x10f')],{'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x108')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db['Interval'],{'onDelete':_0xc1a4('0x16d'),'foreignKey':'IntervalId'});db[_0xc1a4('0x108')][_0xc1a4('0x133')](db[_0xc1a4('0x17c')],{'onDelete':_0xc1a4('0x16d'),'foreignKey':_0xc1a4('0x181')});db['WhatsappInteraction'][_0xc1a4('0x121')](db['WhatsappMessage'],{'as':_0xc1a4('0x164'),'onDelete':_0xc1a4('0x11d'),'foreignKey':_0xc1a4('0x207')});db['WhatsappInteraction']['belongsTo'](db[_0xc1a4('0x106')],{'as':_0xc1a4('0x179'),'foreignKey':_0xc1a4('0x205')});db[_0xc1a4('0x109')][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':_0xc1a4('0x16a')});db[_0xc1a4('0x109')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':'Owner','foreignKey':'UserId'});db[_0xc1a4('0x109')][_0xc1a4('0x135')](db[_0xc1a4('0x17c')],{'through':_0xc1a4('0x1b9'),'as':'Tags'});db['WhatsappInteraction'][_0xc1a4('0x135')](db['Tag'],{'through':_0xc1a4('0x1b9'),'as':_0xc1a4('0x18a')});db['WhatsappInteraction']['belongsToMany'](db[_0xc1a4('0x11f')],{'as':'Users','through':_0xc1a4('0x13f'),'foreignKey':_0xc1a4('0x207')});db[_0xc1a4('0x10a')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x11f')});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xc1a4('0x11d'),'as':_0xc1a4('0x17a')});db[_0xc1a4('0x10a')][_0xc1a4('0x133')](db[_0xc1a4('0x109')],{'onDelete':_0xc1a4('0x11d'),'as':'Interaction','foreignKey':_0xc1a4('0x207')});db[_0xc1a4('0x10a')]['belongsTo'](db[_0xc1a4('0x106')],{'as':'Account','foreignKey':_0xc1a4('0x205')});db[_0xc1a4('0x10b')][_0xc1a4('0x133')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0xfb')],{'as':_0xc1a4('0x174'),'foreignKey':_0xc1a4('0x175')});db['WhatsappQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x74')],{'as':_0xc1a4('0x17a'),'foreignKey':'ContactId'});db['WhatsappQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x109')],{});db[_0xc1a4('0x10b')][_0xc1a4('0x133')](db[_0xc1a4('0x10f')],{});db['WhatsappQueueReport'][_0xc1a4('0x133')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{});db['WhatsappTransferReport'][_0xc1a4('0x133')](db[_0xc1a4('0x10a')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xc1a4('0x109')],{});db[_0xc1a4('0x10d')][_0xc1a4('0x133')](db['WhatsappAccount'],{'foreignKey':_0xc1a4('0x208'),'as':_0xc1a4('0x1fa')});db['WhatsappTransferReport'][_0xc1a4('0x133')](db['WhatsappAccount'],{'foreignKey':_0xc1a4('0x209'),'as':_0xc1a4('0x1f6')});db[_0xc1a4('0x10d')][_0xc1a4('0x133')](db[_0xc1a4('0x10f')],{'foreignKey':_0xc1a4('0x20a'),'as':'ToQueue'});db['WhatsappTransferReport'][_0xc1a4('0x133')](db['User'],{'foreignKey':_0xc1a4('0x1f0'),'as':_0xc1a4('0x1f1')});db[_0xc1a4('0x10d')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'foreignKey':_0xc1a4('0x1f2'),'as':_0xc1a4('0x1f3')});db[_0xc1a4('0x10f')][_0xc1a4('0x135')](db[_0xc1a4('0x11f')],{'as':_0xc1a4('0x160'),'through':_0xc1a4('0x146'),'foreignKey':_0xc1a4('0x20b')});db['WhatsappQueue'][_0xc1a4('0x135')](db[_0xc1a4('0x13a')],{'through':'team_has_whatsapp_queues','as':_0xc1a4('0x161')});db[_0xc1a4('0x119')][_0xc1a4('0x133')](db[_0xc1a4('0x11f')],{'as':'user','foreignKey':_0xc1a4('0x11e'),'onDelete':'cascade','hooks':!![]});db[_0xc1a4('0x111')][_0xc1a4('0x11c')](db[_0xc1a4('0xc6')],{'as':_0xc1a4('0xc6'),'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x111')][_0xc1a4('0x11c')](db['MailServerIn'],{'as':_0xc1a4('0x16f'),'onDelete':_0xc1a4('0x16d')});db[_0xc1a4('0x111')]['hasOne'](db[_0xc1a4('0x16e')],{'as':'Smtp','onDelete':_0xc1a4('0x16d')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 1564b62..e57d477 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbbe=['/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.9.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','./api/intVtigerConfiguration','/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/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xdbbe,0x148));var _0xedbb=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xdbbe[_0x1c0991];return _0x5034de;};'use strict';var path=require('path');var express=require(_0xedbb('0x0'));var errors=require(_0xedbb('0x1'));var config=require(_0xedbb('0x2'));var setupLoggers=require(_0xedbb('0x3'))[_0xedbb('0x4')];var clientSideLogs=require(_0xedbb('0x5'));exports['default']=function(_0x282712){return setupLoggers(_0x282712)[_0xedbb('0x6')](function(){_0x282712[_0xedbb('0x7')](_0xedbb('0x8'),require(_0xedbb('0x9')));_0x282712[_0xedbb('0x7')](_0xedbb('0xa'),require('./api/voiceChanSpy'));_0x282712[_0xedbb('0x7')](_0xedbb('0xb'),require('./api/voiceContext'));_0x282712[_0xedbb('0x7')]('/api/voice/extensions',require(_0xedbb('0xc')));_0x282712[_0xedbb('0x7')](_0xedbb('0xd'),require('./api/voiceMusicOnHold'));_0x282712[_0xedbb('0x7')]('/api/voice/queues',require(_0xedbb('0xe')));_0x282712[_0xedbb('0x7')](_0xedbb('0xf'),require(_0xedbb('0x10')));_0x282712['use'](_0xedbb('0x11'),require(_0xedbb('0x12')));_0x282712[_0xedbb('0x7')](_0xedbb('0x13'),require(_0xedbb('0x14')));_0x282712[_0xedbb('0x7')]('/api/voice/mails/messages',require(_0xedbb('0x15')));_0x282712[_0xedbb('0x7')](_0xedbb('0x16'),require(_0xedbb('0x17')));_0x282712[_0xedbb('0x7')](_0xedbb('0x18'),require('./api/voiceDialReport'));_0x282712['use'](_0xedbb('0x19'),require(_0xedbb('0x1a')));_0x282712['use'](_0xedbb('0x1b'),require(_0xedbb('0x1c')));_0x282712[_0xedbb('0x7')]('/api/members/reports',require(_0xedbb('0x1d')));_0x282712['use']('/api/trunks',require('./api/trunk'));_0x282712['use'](_0xedbb('0x1e'),require('./api/voiceTransferReport'));_0x282712['use'](_0xedbb('0x1f'),require(_0xedbb('0x20')));_0x282712[_0xedbb('0x7')](_0xedbb('0x21'),require(_0xedbb('0x22')));_0x282712[_0xedbb('0x7')]('/api/mail/queues',require(_0xedbb('0x23')));_0x282712[_0xedbb('0x7')](_0xedbb('0x24'),require('./api/mailSubstatus'));_0x282712[_0xedbb('0x7')](_0xedbb('0x25'),require(_0xedbb('0x26')));_0x282712['use'](_0xedbb('0x27'),require(_0xedbb('0x28')));_0x282712[_0xedbb('0x7')](_0xedbb('0x29'),require(_0xedbb('0x2a')));_0x282712[_0xedbb('0x7')](_0xedbb('0x2b'),require(_0xedbb('0x2c')));_0x282712[_0xedbb('0x7')]('/api/dashboards',require(_0xedbb('0x2d')));_0x282712[_0xedbb('0x7')](_0xedbb('0x2e'),require('./api/dashboardItem'));_0x282712[_0xedbb('0x7')](_0xedbb('0x2f'),require('./api/faxAccount'));_0x282712['use']('/api/fax/applications',require(_0xedbb('0x30')));_0x282712[_0xedbb('0x7')](_0xedbb('0x31'),require(_0xedbb('0x32')));_0x282712[_0xedbb('0x7')]('/api/fax/messages',require(_0xedbb('0x33')));_0x282712[_0xedbb('0x7')](_0xedbb('0x34'),require(_0xedbb('0x35')));_0x282712[_0xedbb('0x7')]('/api/fax/reports/queue',require(_0xedbb('0x36')));_0x282712[_0xedbb('0x7')](_0xedbb('0x37'),require(_0xedbb('0x38')));_0x282712[_0xedbb('0x7')](_0xedbb('0x39'),require(_0xedbb('0x3a')));_0x282712['use'](_0xedbb('0x3b'),require(_0xedbb('0x3c')));_0x282712[_0xedbb('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x282712[_0xedbb('0x7')]('/api/sms/queues',require(_0xedbb('0x3d')));_0x282712[_0xedbb('0x7')](_0xedbb('0x3e'),require(_0xedbb('0x3f')));_0x282712['use'](_0xedbb('0x40'),require(_0xedbb('0x41')));_0x282712['use'](_0xedbb('0x42'),require(_0xedbb('0x43')));_0x282712['use'](_0xedbb('0x44'),require('./api/openchannelMessage'));_0x282712[_0xedbb('0x7')](_0xedbb('0x45'),require('./api/openchannelQueue'));_0x282712['use']('/api/chat/websites',require(_0xedbb('0x46')));_0x282712['use'](_0xedbb('0x47'),require(_0xedbb('0x48')));_0x282712[_0xedbb('0x7')]('/api/chat/applications',require(_0xedbb('0x49')));_0x282712[_0xedbb('0x7')](_0xedbb('0x4a'),require(_0xedbb('0x4b')));_0x282712[_0xedbb('0x7')](_0xedbb('0x4c'),require(_0xedbb('0x4d')));_0x282712[_0xedbb('0x7')]('/api/chat/offline_messages',require(_0xedbb('0x4e')));_0x282712[_0xedbb('0x7')]('/api/chat/queues',require('./api/chatQueue'));_0x282712[_0xedbb('0x7')](_0xedbb('0x4f'),require(_0xedbb('0x50')));_0x282712[_0xedbb('0x7')](_0xedbb('0x51'),require(_0xedbb('0x52')));_0x282712['use'](_0xedbb('0x53'),require(_0xedbb('0x54')));_0x282712[_0xedbb('0x7')](_0xedbb('0x55'),require('./api/cmContact'));_0x282712[_0xedbb('0x7')](_0xedbb('0x56'),require(_0xedbb('0x57')));_0x282712['use']('/api/cm/hopper_black',require(_0xedbb('0x58')));_0x282712[_0xedbb('0x7')]('/api/cm/hopper_final',require(_0xedbb('0x59')));_0x282712[_0xedbb('0x7')](_0xedbb('0x5a'),require(_0xedbb('0x5b')));_0x282712[_0xedbb('0x7')](_0xedbb('0x5c'),require(_0xedbb('0x5d')));_0x282712['use'](_0xedbb('0x5e'),require('./api/action'));_0x282712[_0xedbb('0x7')]('/api/automations',require(_0xedbb('0x5f')));_0x282712[_0xedbb('0x7')](_0xedbb('0x60'),require(_0xedbb('0x61')));_0x282712[_0xedbb('0x7')]('/api/dispositions',require(_0xedbb('0x62')));_0x282712[_0xedbb('0x7')](_0xedbb('0x63'),require(_0xedbb('0x64')));_0x282712[_0xedbb('0x7')](_0xedbb('0x65'),require(_0xedbb('0x66')));_0x282712[_0xedbb('0x7')]('/api/pauses',require(_0xedbb('0x67')));_0x282712[_0xedbb('0x7')](_0xedbb('0x68'),require(_0xedbb('0x69')));_0x282712[_0xedbb('0x7')](_0xedbb('0x6a'),require(_0xedbb('0x6b')));_0x282712['use'](_0xedbb('0x6c'),require(_0xedbb('0x6d')));_0x282712['use']('/api/sounds',require(_0xedbb('0x6e')));_0x282712[_0xedbb('0x7')](_0xedbb('0x6f'),require(_0xedbb('0x70')));_0x282712[_0xedbb('0x7')]('/api/contact_item_types',require(_0xedbb('0x71')));_0x282712['use'](_0xedbb('0x72'),require(_0xedbb('0x73')));_0x282712['use'](_0xedbb('0x74'),require('./api/cmHopperAdditionalPhone'));_0x282712['use'](_0xedbb('0x75'),require(_0xedbb('0x76')));_0x282712[_0xedbb('0x7')](_0xedbb('0x77'),require(_0xedbb('0x78')));_0x282712['use'](_0xedbb('0x79'),require(_0xedbb('0x7a')));_0x282712['use'](_0xedbb('0x7b'),require('./api/integration'));_0x282712[_0xedbb('0x7')]('/api/integrations/reports',require(_0xedbb('0x7c')));_0x282712[_0xedbb('0x7')](_0xedbb('0x7d'),require(_0xedbb('0x7e')));_0x282712[_0xedbb('0x7')](_0xedbb('0x7f'),require(_0xedbb('0x80')));_0x282712[_0xedbb('0x7')](_0xedbb('0x81'),require(_0xedbb('0x82')));_0x282712[_0xedbb('0x7')](_0xedbb('0x83'),require(_0xedbb('0x84')));_0x282712[_0xedbb('0x7')](_0xedbb('0x85'),require(_0xedbb('0x86')));_0x282712[_0xedbb('0x7')]('/api/analytics/tree_reports',require(_0xedbb('0x87')));_0x282712[_0xedbb('0x7')](_0xedbb('0x88'),require(_0xedbb('0x89')));_0x282712[_0xedbb('0x7')](_0xedbb('0x8a'),require(_0xedbb('0x8b')));_0x282712[_0xedbb('0x7')]('/api/integrations/salesforce/fields',require(_0xedbb('0x8c')));_0x282712[_0xedbb('0x7')](_0xedbb('0x8d'),require(_0xedbb('0x8e')));_0x282712[_0xedbb('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xedbb('0x8f')));_0x282712[_0xedbb('0x7')](_0xedbb('0x90'),require(_0xedbb('0x91')));_0x282712[_0xedbb('0x7')](_0xedbb('0x92'),require(_0xedbb('0x93')));_0x282712[_0xedbb('0x7')](_0xedbb('0x94'),require(_0xedbb('0x95')));_0x282712[_0xedbb('0x7')](_0xedbb('0x96'),require('./api/intDeskField'));_0x282712[_0xedbb('0x7')](_0xedbb('0x97'),require(_0xedbb('0x98')));_0x282712[_0xedbb('0x7')](_0xedbb('0x99'),require(_0xedbb('0x9a')));_0x282712[_0xedbb('0x7')](_0xedbb('0x9b'),require(_0xedbb('0x9c')));_0x282712['use'](_0xedbb('0x9d'),require(_0xedbb('0x9e')));_0x282712['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x282712[_0xedbb('0x7')](_0xedbb('0x9f'),require('./api/intZendeskField'));_0x282712[_0xedbb('0x7')]('/api/integrations/freshdesk/accounts',require(_0xedbb('0xa0')));_0x282712[_0xedbb('0x7')](_0xedbb('0xa1'),require(_0xedbb('0xa2')));_0x282712[_0xedbb('0x7')](_0xedbb('0xa3'),require('./api/intFreshdeskField'));_0x282712[_0xedbb('0x7')]('/api/integrations/vtiger/accounts',require(_0xedbb('0xa4')));_0x282712['use']('/api/integrations/vtiger/configurations',require(_0xedbb('0xa5')));_0x282712[_0xedbb('0x7')](_0xedbb('0xa6'),require(_0xedbb('0xa7')));_0x282712['use'](_0xedbb('0xa8'),require(_0xedbb('0xa9')));_0x282712[_0xedbb('0x7')](_0xedbb('0xaa'),require('./api/intServicenowConfiguration'));_0x282712['use'](_0xedbb('0xab'),require(_0xedbb('0xac')));_0x282712[_0xedbb('0x7')](_0xedbb('0xad'),require(_0xedbb('0xae')));_0x282712['use'](_0xedbb('0xaf'),require(_0xedbb('0xb0')));_0x282712['use'](_0xedbb('0xb1'),require(_0xedbb('0xb2')));_0x282712[_0xedbb('0x7')](_0xedbb('0xb3'),require(_0xedbb('0xb4')));_0x282712[_0xedbb('0x7')]('/api/integrations/freshsales/configurations',require(_0xedbb('0xb5')));_0x282712[_0xedbb('0x7')]('/api/integrations/freshsales/fields',require(_0xedbb('0xb6')));_0x282712[_0xedbb('0x7')](_0xedbb('0xb7'),require(_0xedbb('0xb8')));_0x282712['use'](_0xedbb('0xb9'),require('./api/chatQueueReport'));_0x282712[_0xedbb('0x7')]('/api/chat/internal/messages',require(_0xedbb('0xba')));_0x282712['use']('/api/jscripty/answers/reports',require(_0xedbb('0xbb')));_0x282712[_0xedbb('0x7')](_0xedbb('0xbc'),require(_0xedbb('0xbd')));_0x282712[_0xedbb('0x7')](_0xedbb('0xbe'),require('./api/jscriptySessionReport'));_0x282712[_0xedbb('0x7')](_0xedbb('0xbf'),require(_0xedbb('0xc0')));_0x282712[_0xedbb('0x7')]('/api/square/reports',require('./api/squareReport'));_0x282712['use'](_0xedbb('0xc1'),require(_0xedbb('0xc2')));_0x282712[_0xedbb('0x7')](_0xedbb('0xc3'),require(_0xedbb('0xc4')));_0x282712[_0xedbb('0x7')](_0xedbb('0xc5'),require(_0xedbb('0xc6')));_0x282712[_0xedbb('0x7')](_0xedbb('0xc7'),require(_0xedbb('0xc8')));_0x282712['use'](_0xedbb('0xc9'),require(_0xedbb('0xca')));_0x282712[_0xedbb('0x7')](_0xedbb('0xcb'),require(_0xedbb('0xcc')));_0x282712[_0xedbb('0x7')](_0xedbb('0xcd'),require(_0xedbb('0xce')));_0x282712[_0xedbb('0x7')]('/api/teams',require(_0xedbb('0xcf')));_0x282712[_0xedbb('0x7')](_0xedbb('0xd0'),require(_0xedbb('0xd1')));_0x282712[_0xedbb('0x7')](_0xedbb('0xd2'),require(_0xedbb('0xd3')));_0x282712[_0xedbb('0x7')](_0xedbb('0xd4'),require(_0xedbb('0xd5')));_0x282712[_0xedbb('0x7')](_0xedbb('0xd6'),require(_0xedbb('0xd7')));_0x282712[_0xedbb('0x7')]('/api/plugins',require(_0xedbb('0xd8')));_0x282712['use'](_0xedbb('0xd9'),require('./api/mailTransferReport'));_0x282712[_0xedbb('0x7')](_0xedbb('0xda'),require(_0xedbb('0xdb')));_0x282712[_0xedbb('0x7')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x282712['use'](_0xedbb('0xdc'),require(_0xedbb('0xdd')));_0x282712[_0xedbb('0x7')]('/api/sms/reports/transfer',require(_0xedbb('0xde')));_0x282712[_0xedbb('0x7')](_0xedbb('0xdf'),require('./api/cmList'));_0x282712[_0xedbb('0x7')](_0xedbb('0xe0'),require(_0xedbb('0xe1')));_0x282712[_0xedbb('0x7')](_0xedbb('0xe2'),require(_0xedbb('0xe3')));_0x282712[_0xedbb('0x7')](_0xedbb('0xe4'),require(_0xedbb('0xe5')));_0x282712[_0xedbb('0x7')]('/api/userProfile/resources',require(_0xedbb('0xe6')));_0x282712[_0xedbb('0x7')](_0xedbb('0xe7'),require(_0xedbb('0xe8')));_0x282712[_0xedbb('0x7')](_0xedbb('0xe9'),require(_0xedbb('0xea')));_0x282712[_0xedbb('0x7')](_0xedbb('0xeb'),require(_0xedbb('0xec')));_0x282712[_0xedbb('0x7')](_0xedbb('0xed'),require(_0xedbb('0xee')));_0x282712[_0xedbb('0x7')](_0xedbb('0xef'),require(_0xedbb('0xf0')));_0x282712[_0xedbb('0x7')](_0xedbb('0xf1'),require('./api/whatsappQueueReport'));_0x282712['use'](_0xedbb('0xf2'),require(_0xedbb('0xf3')));_0x282712[_0xedbb('0x7')](_0xedbb('0xf4'),require(_0xedbb('0xf5')));_0x282712['use'](_0xedbb('0xf6'),require(_0xedbb('0xf7')));_0x282712['use'](_0xedbb('0xf8'),require(_0xedbb('0xf9')));_0x282712[_0xedbb('0x7')](_0xedbb('0xfa'),require(_0xedbb('0xfb')));_0x282712[_0xedbb('0x7')]('/api/mail_interaction_has_tags',require(_0xedbb('0xfc')));_0x282712[_0xedbb('0x7')](_0xedbb('0xfd'),require(_0xedbb('0xfe')));_0x282712[_0xedbb('0x7')]('/api/auth/google',require(_0xedbb('0xff')));_0x282712[_0xedbb('0x7')](_0xedbb('0x100'),require(_0xedbb('0x101')));_0x282712[_0xedbb('0x7')](_0xedbb('0x102'),require(_0xedbb('0x103')));_0x282712[_0xedbb('0x7')]('/api/rpc',require(_0xedbb('0x104')));_0x282712['use'](_0xedbb('0x105'),require('./api/version'));_0x282712['use'](_0xedbb('0x106'),require(_0xedbb('0x107')));_0x282712[_0xedbb('0x7')](_0xedbb('0x108'),require(_0xedbb('0x109')));_0x282712[_0xedbb('0x7')]('/api/webbar',require(_0xedbb('0x10a')));_0x282712[_0xedbb('0x7')](_0xedbb('0x10b'),clientSideLogs);_0x282712[_0xedbb('0x7')](_0xedbb('0x10c'),express[_0xedbb('0x10d')](path[_0xedbb('0x10e')](config[_0xedbb('0x10f')],_0xedbb('0x10c'))));_0x282712[_0xedbb('0x7')](_0xedbb('0x110'),express['static'](path[_0xedbb('0x10e')](config[_0xedbb('0x10f')],'/www')));_0x282712['use'](_0xedbb('0x111'),express[_0xedbb('0x10d')](path['join'](config[_0xedbb('0x10f')],'/demo')));_0x282712['use'](_0xedbb('0x112'),express['static'](path['join'](config['root'],_0xedbb('0x113'),_0xedbb('0x114'))));_0x282712[_0xedbb('0x7')](_0xedbb('0x115'),express[_0xedbb('0x10d')](path[_0xedbb('0x10e')](config[_0xedbb('0x10f')],_0xedbb('0x116'))));_0x282712[_0xedbb('0x117')](_0xedbb('0x118'))[_0xedbb('0x119')](errors[0x194]);_0x282712[_0xedbb('0x117')]('/*')[_0xedbb('0x119')](function(_0x2ca62d,_0x58e49e){_0x58e49e['sendFile'](path[_0xedbb('0x11a')](_0x282712['get'](_0xedbb('0x11b'))+_0xedbb('0x11c')));});return _0x282712;});}; \ No newline at end of file +var _0xf2f6=['/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/pauses','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./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/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./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/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./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/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/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/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./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/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/snippet','3.9.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/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/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/messages','./api/mailMessage'];(function(_0x370985,_0x5263a5){var _0xc1d964=function(_0x40c268){while(--_0x40c268){_0x370985['push'](_0x370985['shift']());}};_0xc1d964(++_0x5263a5);}(_0xf2f6,0x1f4));var _0x6f2f=function(_0x3f3ec3,_0x3c9cee){_0x3f3ec3=_0x3f3ec3-0x0;var _0x7791be=_0xf2f6[_0x3f3ec3];return _0x7791be;};'use strict';var path=require(_0x6f2f('0x0'));var express=require('express');var errors=require(_0x6f2f('0x1'));var config=require(_0x6f2f('0x2'));var setupLoggers=require(_0x6f2f('0x3'))[_0x6f2f('0x4')];var clientSideLogs=require(_0x6f2f('0x5'));exports[_0x6f2f('0x6')]=function(_0x56944c){return setupLoggers(_0x56944c)[_0x6f2f('0x7')](function(){_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x9'),require(_0x6f2f('0xa')));_0x56944c['use']('/api/voice/chanspy',require(_0x6f2f('0xb')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xc'),require(_0x6f2f('0xd')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xe'),require(_0x6f2f('0xf')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x10'),require('./api/voiceMusicOnHold'));_0x56944c[_0x6f2f('0x8')]('/api/voice/queues',require(_0x6f2f('0x11')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x12'),require(_0x6f2f('0x13')));_0x56944c['use'](_0x6f2f('0x14'),require('./api/screenRecording'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x15'),require(_0x6f2f('0x16')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x17'),require(_0x6f2f('0x18')));_0x56944c['use'](_0x6f2f('0x19'),require(_0x6f2f('0x1a')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x1b'),require('./api/voiceDialReport'));_0x56944c['use']('/api/voice/agents/reports',require(_0x6f2f('0x1c')));_0x56944c['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x1d'),require(_0x6f2f('0x1e')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x1f'),require(_0x6f2f('0x20')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x21'),require(_0x6f2f('0x22')));_0x56944c['use'](_0x6f2f('0x23'),require(_0x6f2f('0x24')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x25'),require(_0x6f2f('0x26')));_0x56944c['use'](_0x6f2f('0x27'),require('./api/mailQueue'));_0x56944c[_0x6f2f('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x56944c[_0x6f2f('0x8')]('/api/mail/interactions',require('./api/mailInteraction'));_0x56944c['use'](_0x6f2f('0x28'),require(_0x6f2f('0x29')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x2a'),require('./api/mailApplication'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x2b'),require(_0x6f2f('0x2c')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x2d'),require(_0x6f2f('0x2e')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x2f'),require(_0x6f2f('0x30')));_0x56944c['use']('/api/fax/accounts',require(_0x6f2f('0x31')));_0x56944c['use'](_0x6f2f('0x32'),require('./api/faxApplication'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x33'),require('./api/faxInteraction'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x34'),require(_0x6f2f('0x35')));_0x56944c[_0x6f2f('0x8')]('/api/fax/queues',require(_0x6f2f('0x36')));_0x56944c['use']('/api/fax/reports/queue',require(_0x6f2f('0x37')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x38'),require(_0x6f2f('0x39')));_0x56944c[_0x6f2f('0x8')]('/api/sms/applications',require(_0x6f2f('0x3a')));_0x56944c[_0x6f2f('0x8')]('/api/sms/interactions',require(_0x6f2f('0x3b')));_0x56944c['use']('/api/sms/messages',require(_0x6f2f('0x3c')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x3d'),require(_0x6f2f('0x3e')));_0x56944c['use']('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x3f'),require(_0x6f2f('0x40')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x41'),require(_0x6f2f('0x42')));_0x56944c[_0x6f2f('0x8')]('/api/openchannel/messages',require(_0x6f2f('0x43')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x44'),require(_0x6f2f('0x45')));_0x56944c['use'](_0x6f2f('0x46'),require(_0x6f2f('0x47')));_0x56944c['use'](_0x6f2f('0x48'),require(_0x6f2f('0x49')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x4a'),require(_0x6f2f('0x4b')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x4c'),require(_0x6f2f('0x4d')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x4e'),require(_0x6f2f('0x4f')));_0x56944c['use'](_0x6f2f('0x50'),require(_0x6f2f('0x51')));_0x56944c[_0x6f2f('0x8')]('/api/chat/queues',require('./api/chatQueue'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x52'),require(_0x6f2f('0x53')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x54'),require(_0x6f2f('0x55')));_0x56944c['use']('/api/cm/companies',require(_0x6f2f('0x56')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x57'),require('./api/cmContact'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x58'),require(_0x6f2f('0x59')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x5a'),require('./api/cmHopperBlack'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x5b'),require(_0x6f2f('0x5c')));_0x56944c['use']('/api/cm/hopper_history',require(_0x6f2f('0x5d')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x5e'),require('./api/cmCustomField'));_0x56944c['use']('/api/actions',require(_0x6f2f('0x5f')));_0x56944c['use'](_0x6f2f('0x60'),require(_0x6f2f('0x61')));_0x56944c[_0x6f2f('0x8')]('/api/canned_answers',require(_0x6f2f('0x62')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x63'),require('./api/disposition'));_0x56944c['use']('/api/conditions',require('./api/condition'));_0x56944c[_0x6f2f('0x8')]('/api/intervals',require('./api/interval'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x64'),require('./api/pause'));_0x56944c[_0x6f2f('0x8')]('/api/cdr',require(_0x6f2f('0x65')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x66'),require('./api/voiceQueuesLog'));_0x56944c['use'](_0x6f2f('0x67'),require(_0x6f2f('0x68')));_0x56944c['use'](_0x6f2f('0x69'),require(_0x6f2f('0x6a')));_0x56944c[_0x6f2f('0x8')]('/api/tags',require(_0x6f2f('0x6b')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x6c'),require('./api/contactItemType'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x6d'),require(_0x6f2f('0x6e')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x6f'),require(_0x6f2f('0x70')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x71'),require('./api/template'));_0x56944c[_0x6f2f('0x8')]('/api/triggers',require(_0x6f2f('0x72')));_0x56944c['use']('/api/variables',require(_0x6f2f('0x73')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x74'),require(_0x6f2f('0x75')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x76'),require(_0x6f2f('0x77')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x78'),require(_0x6f2f('0x79')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x7a'),require(_0x6f2f('0x7b')));_0x56944c['use']('/api/analytics/extracted_reports',require(_0x6f2f('0x7c')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x7d'),require(_0x6f2f('0x7e')));_0x56944c['use']('/api/analytics/field_reports',require(_0x6f2f('0x7f')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x80'),require(_0x6f2f('0x81')));_0x56944c['use']('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x82'),require(_0x6f2f('0x83')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x84'),require('./api/intSalesforceField'));_0x56944c['use'](_0x6f2f('0x85'),require(_0x6f2f('0x86')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x87'),require('./api/intSugarcrmConfiguration'));_0x56944c['use']('/api/integrations/sugarcrm/fields',require(_0x6f2f('0x88')));_0x56944c['use'](_0x6f2f('0x89'),require(_0x6f2f('0x8a')));_0x56944c[_0x6f2f('0x8')]('/api/integrations/desk/configurations',require(_0x6f2f('0x8b')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x8c'),require(_0x6f2f('0x8d')));_0x56944c['use'](_0x6f2f('0x8e'),require('./api/intZohoAccount'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x8f'),require(_0x6f2f('0x90')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x91'),require('./api/intZohoField'));_0x56944c[_0x6f2f('0x8')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x56944c['use'](_0x6f2f('0x92'),require(_0x6f2f('0x93')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x94'),require(_0x6f2f('0x95')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x96'),require(_0x6f2f('0x97')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x98'),require('./api/intFreshdeskConfiguration'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x99'),require(_0x6f2f('0x9a')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x9b'),require(_0x6f2f('0x9c')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x9d'),require(_0x6f2f('0x9e')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x9f'),require(_0x6f2f('0xa0')));_0x56944c['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xa1'),require('./api/intServicenowConfiguration'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xa2'),require(_0x6f2f('0xa3')));_0x56944c[_0x6f2f('0x8')]('/api/integrations/dynamics365/accounts',require(_0x6f2f('0xa4')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xa5'),require('./api/intDynamics365Configuration'));_0x56944c[_0x6f2f('0x8')]('/api/integrations/dynamics365/fields',require(_0x6f2f('0xa6')));_0x56944c['use'](_0x6f2f('0xa7'),require(_0x6f2f('0xa8')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xa9'),require(_0x6f2f('0xaa')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xab'),require(_0x6f2f('0xac')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xad'),require(_0x6f2f('0xae')));_0x56944c['use'](_0x6f2f('0xaf'),require(_0x6f2f('0xb0')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xb1'),require(_0x6f2f('0xb2')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xb3'),require(_0x6f2f('0xb4')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xb5'),require(_0x6f2f('0xb6')));_0x56944c[_0x6f2f('0x8')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xb7'),require(_0x6f2f('0xb8')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xb9'),require('./api/squareReport'));_0x56944c[_0x6f2f('0x8')]('/api/square/details/reports',require(_0x6f2f('0xba')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xbb'),require(_0x6f2f('0xbc')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xbd'),require(_0x6f2f('0xbe')));_0x56944c['use'](_0x6f2f('0xbf'),require(_0x6f2f('0xc0')));_0x56944c['use'](_0x6f2f('0xc1'),require(_0x6f2f('0xc2')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xc3'),require('./api/squareRecording'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xc4'),require(_0x6f2f('0xc5')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xc6'),require(_0x6f2f('0xc7')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xc8'),require(_0x6f2f('0xc9')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xca'),require(_0x6f2f('0xcb')));_0x56944c['use'](_0x6f2f('0xcc'),require(_0x6f2f('0xcd')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xce'),require(_0x6f2f('0xcf')));_0x56944c[_0x6f2f('0x8')]('/api/plugins',require('./api/plugin'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xd0'),require('./api/mailTransferReport'));_0x56944c[_0x6f2f('0x8')]('/api/chat/reports/transfer',require(_0x6f2f('0xd1')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xd2'),require('./api/faxTransferReport'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xd3'),require(_0x6f2f('0xd4')));_0x56944c['use'](_0x6f2f('0xd5'),require(_0x6f2f('0xd6')));_0x56944c['use'](_0x6f2f('0xd7'),require(_0x6f2f('0xd8')));_0x56944c['use'](_0x6f2f('0xd9'),require(_0x6f2f('0xda')));_0x56944c[_0x6f2f('0x8')]('/api/userProfiles',require('./api/userProfile'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xdb'),require(_0x6f2f('0xdc')));_0x56944c['use'](_0x6f2f('0xdd'),require(_0x6f2f('0xde')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xdf'),require(_0x6f2f('0xe0')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xe1'),require(_0x6f2f('0xe2')));_0x56944c['use'](_0x6f2f('0xe3'),require('./api/whatsappApplication'));_0x56944c['use'](_0x6f2f('0xe4'),require('./api/whatsappInteraction'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xe5'),require('./api/whatsappMessage'));_0x56944c['use']('/api/whatsapp/reports/queue',require(_0x6f2f('0xe6')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xe7'),require(_0x6f2f('0xe8')));_0x56944c['use'](_0x6f2f('0xe9'),require(_0x6f2f('0xea')));_0x56944c['use']('/api/cloudProviders',require(_0x6f2f('0xeb')));_0x56944c['use'](_0x6f2f('0xec'),require(_0x6f2f('0xed')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xee'),require(_0x6f2f('0xef')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xf0'),require(_0x6f2f('0xf1')));_0x56944c['use'](_0x6f2f('0xf2'),require(_0x6f2f('0xf3')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xf4'),require(_0x6f2f('0xf5')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xf6'),require(_0x6f2f('0xf7')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xf8'),require(_0x6f2f('0xf9')));_0x56944c[_0x6f2f('0x8')]('/api/rpc',require(_0x6f2f('0xfa')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xfb'),require('./api/version'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xfc'),require(_0x6f2f('0xfd')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xfe'),require('./api/pm2'));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0xff'),require(_0x6f2f('0x100')));_0x56944c[_0x6f2f('0x8')]('/api/logs',clientSideLogs);_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x101'),express[_0x6f2f('0x102')](path[_0x6f2f('0x103')](config[_0x6f2f('0x104')],'/apidoc')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x105'),express[_0x6f2f('0x102')](path['join'](config['root'],_0x6f2f('0x105'))));_0x56944c['use']('/demo',express[_0x6f2f('0x102')](path[_0x6f2f('0x103')](config[_0x6f2f('0x104')],'/demo')));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x106'),express[_0x6f2f('0x102')](path[_0x6f2f('0x103')](config['root'],'snippet',_0x6f2f('0x107'))));_0x56944c[_0x6f2f('0x8')](_0x6f2f('0x108'),express['static'](path[_0x6f2f('0x103')](config[_0x6f2f('0x104')],_0x6f2f('0x109'))));_0x56944c['route'](_0x6f2f('0x10a'))[_0x6f2f('0x10b')](errors[0x194]);_0x56944c['route']('/*')[_0x6f2f('0x10b')](function(_0x4a9da2,_0x3d9a7e){_0x3d9a7e[_0x6f2f('0x10c')](path[_0x6f2f('0x10d')](_0x56944c[_0x6f2f('0x10b')]('appPath')+_0x6f2f('0x10e')));});return _0x56944c;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index e057d83..1598f13 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec32=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.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/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec32,0xb8));var _0x2ec3=function(_0x5240b5,_0x6906a3){_0x5240b5=_0x5240b5-0x0;var _0x3190e7=_0xec32[_0x5240b5];return _0x3190e7;};'use strict';var jayson=require(_0x2ec3('0x0'));var _=require(_0x2ec3('0x1'));var config=require(_0x2ec3('0x2'));exports[_0x2ec3('0x3')]=function(){return new Promise(function(_0x391483,_0x418e9e){var _0x5213db={};_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/user/user.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x5')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x6')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x7')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x8')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x9')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/trunk/trunk.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0xa')));_0x5213db=_['merge'](_0x5213db,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0xb')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0xc')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0xd')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0xe')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0xf')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x10')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x11')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x12')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/faxInteraction/faxInteraction.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x13')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x14')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x15')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x16')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/smsMessage/smsMessage.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/smsQueue/smsQueue.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x17')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x18')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x19')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x1a')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x1b')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x1c')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x1d')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x1e')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x1f')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x20')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x21')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x22')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/interval/interval.rpc'));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x23')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x24')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x25')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x26')));_0x5213db=_['merge'](_0x5213db,require('../api/trigger/trigger.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x27')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x28')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x29')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x2a')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x2b')));_0x5213db=_['merge'](_0x5213db,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x2c')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x2d')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x2e')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x2f')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x30')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x31')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x32')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x33')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x34')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x35')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x36')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/squareMessage/squareMessage.rpc'));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x37')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x38')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x39')));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x3a')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5213db=_['merge'](_0x5213db,require(_0x2ec3('0x3b')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require(_0x2ec3('0x3c')));_0x5213db=_[_0x2ec3('0x4')](_0x5213db,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x5e5bd0=jayson[_0x2ec3('0x3d')](_0x5213db)[_0x2ec3('0x3e')]();var _0x2111f1=config[_0x2ec3('0x3f')][_0x2ec3('0x40')]||config['port']+0x1;var _0x4784cd=config[_0x2ec3('0x3f')]['ip']||'localhost';_0x5e5bd0['on'](_0x2ec3('0x41'),function(_0x1d8ed6){return _0x418e9e(_0x1d8ed6);});_0x5e5bd0[_0x2ec3('0x3')](_0x2111f1,_0x4784cd,function(){console['log'](_0x2ec3('0x42'),_0x4784cd,_0x2111f1);require(_0x2ec3('0x43'))['default']();return _0x391483(_0x2ec3('0x44')+_0x4784cd+':'+_0x2111f1);});});}; \ No newline at end of file +var _0xe4cd=['../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.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/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc'];(function(_0x3a14aa,_0x1005af){var _0x392b54=function(_0x4bbf80){while(--_0x4bbf80){_0x3a14aa['push'](_0x3a14aa['shift']());}};_0x392b54(++_0x1005af);}(_0xe4cd,0x84));var _0xde4c=function(_0xb5efa3,_0x52d81f){_0xb5efa3=_0xb5efa3-0x0;var _0x440167=_0xe4cd[_0xb5efa3];return _0x440167;};'use strict';var jayson=require(_0xde4c('0x0'));var _=require('lodash');var config=require(_0xde4c('0x1'));exports[_0xde4c('0x2')]=function(){return new Promise(function(_0x5ad78d,_0x4a3892){var _0x39ade2={};_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x4')));_0x39ade2=_['merge'](_0x39ade2,require('../api/voiceExtension/voiceExtension.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x5')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x6')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x7')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x8')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x9')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0xa')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0xb')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0xc')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/mailServerIn/mailServerIn.rpc'));_0x39ade2=_['merge'](_0x39ade2,require('../api/mailAccount/mailAccount.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0xd')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0xe')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0xf')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x10')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x11')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x12')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x13')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x14')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x15')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x16')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x17')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x18')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/smsInteraction/smsInteraction.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/smsMessage/smsMessage.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x19')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x1a')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x1b')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x1c')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x1d')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/chatInteraction/chatInteraction.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x1e')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/chatQueue/chatQueue.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x1f')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x20')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x21')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x22')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x23')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x24')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x25')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x26')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x27')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x28')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x29')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x2a')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x39ade2=_['merge'](_0x39ade2,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x2b')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x2c')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x2d')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x2e')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x2f')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x30')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x31')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x32')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x33')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x34')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x35')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x36')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x37')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x38')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x39')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x3a')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x3b')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x3c')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x3d')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x3e')));_0x39ade2=_[_0xde4c('0x3')](_0x39ade2,require(_0xde4c('0x3f')));_0x39ade2=_['merge'](_0x39ade2,require(_0xde4c('0x40')));var _0xc14b26=jayson[_0xde4c('0x41')](_0x39ade2)[_0xde4c('0x42')]();var _0x141d4c=config[_0xde4c('0x43')][_0xde4c('0x44')]||config['port']+0x1;var _0x2fb522=config[_0xde4c('0x43')]['ip']||_0xde4c('0x45');_0xc14b26['on'](_0xde4c('0x46'),function(_0x23a003){return _0x4a3892(_0x23a003);});_0xc14b26[_0xde4c('0x2')](_0x141d4c,_0x2fb522,function(){console[_0xde4c('0x47')](_0xde4c('0x48'),_0x2fb522,_0x141d4c);require(_0xde4c('0x49'))[_0xde4c('0x4a')]();return _0x5ad78d(_0xde4c('0x4b')+_0x2fb522+':'+_0x141d4c);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index a7d2952..881d2b0 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 _0x0170=['label','exports','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','pipe','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x8e04d0,_0x258838){var _0x10f0b7=function(_0x2a4df3){while(--_0x2a4df3){_0x8e04d0['push'](_0x8e04d0['shift']());}};_0x10f0b7(++_0x258838);}(_0x0170,0x1d6));var _0x0017=function(_0x3015d0,_0x2f6634){_0x3015d0=_0x3015d0-0x0;var _0x78e6aa=_0x0170[_0x3015d0];return _0x78e6aa;};'use strict';var util=require(_0x0017('0x0'));var _=require(_0x0017('0x1'));var EventEmitter=require('events')[_0x0017('0x2')];var AGIReply=require(_0x0017('0x3'));var AGIError=require(_0x0017('0x4'));function AGIChannel(_0xe275a5){var _0x5ee6e8=this,_0x20a045=new AGIReply(),_0x255938=![],_0x3ba292={};EventEmitter[_0x0017('0x5')](_0x5ee6e8);_0xe275a5[_0x0017('0x6')](_0x0017('0x7'));_0xe275a5[_0x0017('0x8')](0x8*0x3c*0x3c*0x3e8);_0x20a045[_0x0017('0x6')](_0x0017('0x7'));_0x20a045['on'](_0x0017('0x9'),function(_0x145f14){for(var _0x5ad216 in _0x145f14){_0x5ee6e8[_0x5ad216]=_0x145f14[_0x5ad216];}_0x5ee6e8['emit'](_0x0017('0xa'));});_0x20a045['on'](_0x0017('0xb'),function(_0x46c69f){if(_0x46c69f[_0x0017('0xc')]()==_0x0017('0xd')){_0x5ee6e8[_0x0017('0xe')](_0x0017('0xd'));return;}if(_0x46c69f[_0x0017('0xf')](0x0,0xb)==_0x0017('0x10')){_0x255938=!![];}if(_0x255938){_0x3ba292['rx']+=_0x46c69f+'\x0a';if(_0x46c69f[_0x0017('0x11')](_0x0017('0x12'))!=-0x1){_0x255938=![];}}else{_0x3ba292['rx']=_0x46c69f;}if(_0x255938){return;}if(typeof _0x3ba292['cb']==_0x0017('0x13')){var _0x25200c=_0x3ba292['rx'][_0x0017('0xf')](0x0,0x3),_0x50c5d7=null,_0x21505f=null;_0x25200c=parseInt(_0x25200c);if(isNaN(_0x25200c)){_0x3ba292['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0017('0x14')});return;}if(_0x25200c!=0xc8){_0x3ba292['cb'](null,{'code':_0x25200c,'result':-0x1,'extra':'KO'});return;}_0x50c5d7=_0x3ba292['rx'][_0x0017('0xf')](0x4)[_0x0017('0x15')]('result=','');if(_0x50c5d7['indexOf']('\x20')!=-0x1){_0x50c5d7=_0x50c5d7[_0x0017('0x16')](0x0,_0x50c5d7[_0x0017('0x17')]('\x20'));}if(_[_0x0017('0x18')](_0x50c5d7,'-1')){_0x50c5d7=parseInt(_0x50c5d7);}_0x21505f=_0x3ba292['rx']['split']('\x20');if(_0x21505f[_0x0017('0x19')]==0x3){_0x21505f=_0x21505f[0x2][_0x0017('0xf')](0x1,_0x21505f[0x2][_0x0017('0x19')]-0x1);}else if(_0x21505f[_0x0017('0x19')]>0x3){var _0x5e3c80=/\((.+)\)/;var _0xe765e1=_0x3ba292['rx'][_0x0017('0x1a')](_0x5e3c80);if(_0xe765e1){_0x21505f=_0xe765e1[0x1];}else{_0x21505f=null;}}else{_0x21505f=null;}_0x3ba292['cb'](null,{'code':_0x25200c,'result':_0x50c5d7,'extra':_0x21505f});}});_0xe275a5['on']('error',function(_0x24cce2){_0x5ee6e8[_0x0017('0xe')](_0x0017('0x1b'),new AGIError(_0x0017('0x1c'),_0x24cce2['code']));});_0xe275a5['on'](_0x0017('0x1d'),function(){_0x5ee6e8[_0x0017('0xe')]('close',new AGIError(_0x0017('0x1e')));});_0xe275a5['on']('timeout',function(){_0x5ee6e8[_0x0017('0xe')]('timeout',new AGIError(_0x0017('0x1f')));_0xe275a5['destroy']();});_0xe275a5[_0x0017('0x20')](_0x20a045);this['command']=function(_0x223c14,_0x6cd580){var _0x223c14=_0x223c14||'',_0x6cd580=typeof _0x6cd580==_0x0017('0x13')?_0x6cd580:new Function();_0x3ba292={'tx':_0x223c14,'rx':'','cb':_0x6cd580};_0xe275a5[_0x0017('0x21')](_0x223c14+'\x0a');},this['close']=function(){_0xe275a5['destroy']();};}util[_0x0017('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x0017('0x23')][_0x0017('0x24')]=function(_0x28fa30){return this['command'][_0x0017('0x25')](this,_0x28fa30);};AGIChannel[_0x0017('0x23')][_0x0017('0x26')]=function(){return this[_0x0017('0x24')](_0x0017('0x27'));};AGIChannel[_0x0017('0x23')][_0x0017('0x28')]=function(_0x45bdba,_0x3dcce8,_0x2adbe0){_0x45bdba=_0x45bdba===undefined?_0x0017('0x29'):_0x45bdba;_0x3dcce8=_0x3dcce8===undefined?'5':_0x3dcce8;_0x2adbe0=_0x2adbe0===undefined?'1':_0x2adbe0;return this[_0x0017('0x24')](util[_0x0017('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x45bdba,_0x3dcce8*0x3e8,_0x2adbe0));};AGIChannel[_0x0017('0x23')][_0x0017('0x2b')]=function(_0x54608f){_0x54608f=_0x54608f||'NO\x20MESSAGE';return this[_0x0017('0x24')](util[_0x0017('0x2a')](_0x0017('0x2c'),_0x54608f));};AGIChannel[_0x0017('0x23')]['exec']=function(_0x23e6a3,_0x1596f1){if(_[_0x0017('0x2d')](_0x1596f1)){return this[_0x0017('0x24')](util['format'](_0x0017('0x2e'),_0x23e6a3,_0x1596f1[_0x0017('0x2f')](',')));}return this['sendRequest'](util[_0x0017('0x2a')](_0x0017('0x2e'),_0x23e6a3,_0x1596f1));};AGIChannel[_0x0017('0x23')][_0x0017('0x30')]=function(_0x3f3142){return this[_0x0017('0x24')](util[_0x0017('0x2a')]('SET\x20CONTEXT\x20%s',_0x3f3142));};AGIChannel[_0x0017('0x23')]['setExtension']=function(_0x208a63){return this[_0x0017('0x24')](util[_0x0017('0x2a')](_0x0017('0x31'),_0x208a63));};AGIChannel['prototype'][_0x0017('0x32')]=function(_0x16f6eb){return this['sendRequest'](util[_0x0017('0x2a')](_0x0017('0x33'),_0x16f6eb));};AGIChannel[_0x0017('0x23')]['hangup']=function(){return this['sendRequest'](_0x0017('0x34'));};AGIChannel[_0x0017('0x23')][_0x0017('0x35')]=function(_0x1c7546,_0x4479a8){var _0x1dee37=_['isBoolean'](_0x4479a8)||_[_0x0017('0x36')](_0x4479a8)?_0x4479a8[_0x0017('0x37')]():_0x4479a8;return this[_0x0017('0x24')](util[_0x0017('0x2a')](_0x0017('0x38'),_0x1c7546,_0x1dee37?_0x1dee37[_0x0017('0x37')]()[_0x0017('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0017('0x23')][_0x0017('0x39')]=function(_0x52a312,_0x34a62f){return this[_0x0017('0x24')](util[_0x0017('0x2a')](_0x0017('0x3a'),_0x52a312,_0x34a62f));};AGIChannel[_0x0017('0x23')][_0x0017('0x3b')]=function(_0x7c43a5,_0x19ad28){return this['sendRequest'](util[_0x0017('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x7c43a5,_0x19ad28));};AGIChannel['prototype'][_0x0017('0x3c')]=function(_0x415441,_0x94e6b2){return this[_0x0017('0x24')](util[_0x0017('0x2a')](_0x0017('0x3d'),_0x415441,_0x94e6b2));};AGIChannel[_0x0017('0x23')][_0x0017('0x3e')]=function(_0x4fe8b1,_0x1f87df,_0x142d19){_0x1f87df=_0x1f87df||this[_0x0017('0x3f')];_0x142d19=_0x142d19||0x1;this[_0x0017('0x30')](_0x4fe8b1);this[_0x0017('0x40')](_0x1f87df);this[_0x0017('0x32')](_0x142d19);return this[_0x0017('0x2b')](util[_0x0017('0x2a')](_0x0017('0x41'),_0x4fe8b1,_0x1f87df,_0x142d19));};AGIChannel[_0x0017('0x23')][_0x0017('0x42')]=function(_0x349d5d){return this[_0x0017('0x24')](util[_0x0017('0x2a')]('GET\x20VARIABLE\x20\x22%s\x22',_0x349d5d));};AGIChannel['prototype']['recordFile']=function(_0x21a14f,_0x335753,_0x1e4d0f,_0x213dba,_0x5a50af,_0x5032ae){_0x335753=_0x335753||_0x0017('0x43');_0x1e4d0f=_0x1e4d0f||'';_0x213dba=_0x213dba===undefined?-0x1:_0x213dba==='-1'?-0x1:_0x213dba*0x3e8;_0x5a50af=_0x5a50af===undefined?'':'s='+_0x5a50af;_0x5032ae=_0x5032ae?_0x0017('0x44'):'';return this[_0x0017('0x24')](util[_0x0017('0x2a')](_0x0017('0x45'),_0x21a14f,_0x335753,_0x1e4d0f,_0x213dba,_0x5032ae,_0x5a50af));};AGIChannel[_0x0017('0x23')][_0x0017('0x46')]=function(_0x3b68b6,_0x309de6){_0x309de6=_0x309de6||'';return this[_0x0017('0x24')](util[_0x0017('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3b68b6,_0x309de6));};AGIChannel[_0x0017('0x23')]['agi']=function(_0x17ebe0){return this[_0x0017('0x47')](_0x0017('0x48'),_0x17ebe0);};AGIChannel[_0x0017('0x23')][_0x0017('0x49')]=function(_0x55f650){return this[_0x0017('0x47')](_0x0017('0x4a'),_0x55f650);};AGIChannel[_0x0017('0x23')][_0x0017('0x1b')]=function(_0x294efb,_0x45eafa){this['noop'](util[_0x0017('0x2a')](_0x0017('0x4b'),_0x294efb['id'],_0x294efb[_0x0017('0x4c')],_0x45eafa));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0017('0x4d')]=AGIChannel; \ No newline at end of file +var _0xce2a=['setEncoding','utf8','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','lodash','events','EventEmitter','./error','call'];(function(_0x462723,_0x388c95){var _0x4737cc=function(_0x2900b9){while(--_0x2900b9){_0x462723['push'](_0x462723['shift']());}};_0x4737cc(++_0x388c95);}(_0xce2a,0xd3));var _0xace2=function(_0x120e67,_0x17f410){_0x120e67=_0x120e67-0x0;var _0x1f4918=_0xce2a[_0x120e67];return _0x1f4918;};'use strict';var util=require('util');var _=require(_0xace2('0x0'));var EventEmitter=require(_0xace2('0x1'))[_0xace2('0x2')];var AGIReply=require('./reply');var AGIError=require(_0xace2('0x3'));function AGIChannel(_0x88316){var _0x2c09ae=this,_0x5eb117=new AGIReply(),_0x362167=![],_0x5b569f={};EventEmitter[_0xace2('0x4')](_0x2c09ae);_0x88316[_0xace2('0x5')]('utf8');_0x88316['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5eb117[_0xace2('0x5')](_0xace2('0x6'));_0x5eb117['on'](_0xace2('0x7'),function(_0x144669){for(var _0x17253c in _0x144669){_0x2c09ae[_0x17253c]=_0x144669[_0x17253c];}_0x2c09ae['emit'](_0xace2('0x8'));});_0x5eb117['on'](_0xace2('0x9'),function(_0x50de17){if(_0x50de17[_0xace2('0xa')]()==_0xace2('0xb')){_0x2c09ae[_0xace2('0xc')](_0xace2('0xb'));return;}if(_0x50de17[_0xace2('0xd')](0x0,0xb)==_0xace2('0xe')){_0x362167=!![];}if(_0x362167){_0x5b569f['rx']+=_0x50de17+'\x0a';if(_0x50de17[_0xace2('0xf')](_0xace2('0x10'))!=-0x1){_0x362167=![];}}else{_0x5b569f['rx']=_0x50de17;}if(_0x362167){return;}if(typeof _0x5b569f['cb']==_0xace2('0x11')){var _0x26f48d=_0x5b569f['rx'][_0xace2('0xd')](0x0,0x3),_0x267254=null,_0x255bf0=null;_0x26f48d=parseInt(_0x26f48d);if(isNaN(_0x26f48d)){_0x5b569f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x26f48d!=0xc8){_0x5b569f['cb'](null,{'code':_0x26f48d,'result':-0x1,'extra':'KO'});return;}_0x267254=_0x5b569f['rx']['substring'](0x4)[_0xace2('0x12')](_0xace2('0x13'),'');if(_0x267254[_0xace2('0x14')]('\x20')!=-0x1){_0x267254=_0x267254[_0xace2('0x15')](0x0,_0x267254[_0xace2('0x14')]('\x20'));}if(_['startsWith'](_0x267254,'-1')){_0x267254=parseInt(_0x267254);}_0x255bf0=_0x5b569f['rx'][_0xace2('0x16')]('\x20');if(_0x255bf0[_0xace2('0x17')]==0x3){_0x255bf0=_0x255bf0[0x2][_0xace2('0xd')](0x1,_0x255bf0[0x2][_0xace2('0x17')]-0x1);}else if(_0x255bf0['length']>0x3){var _0xc9d38e=/\((.+)\)/;var _0x7c844e=_0x5b569f['rx']['match'](_0xc9d38e);if(_0x7c844e){_0x255bf0=_0x7c844e[0x1];}else{_0x255bf0=null;}}else{_0x255bf0=null;}_0x5b569f['cb'](null,{'code':_0x26f48d,'result':_0x267254,'extra':_0x255bf0});}});_0x88316['on'](_0xace2('0x18'),function(_0x1a5cf2){_0x2c09ae[_0xace2('0xc')]('error',new AGIError(_0xace2('0x19'),_0x1a5cf2[_0xace2('0x1a')]));});_0x88316['on'](_0xace2('0x1b'),function(){_0x2c09ae[_0xace2('0xc')](_0xace2('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x88316['on'](_0xace2('0x1c'),function(){_0x2c09ae[_0xace2('0xc')](_0xace2('0x1c'),new AGIError(_0xace2('0x1d')));_0x88316[_0xace2('0x1e')]();});_0x88316['pipe'](_0x5eb117);this[_0xace2('0x1f')]=function(_0x10b9b3,_0x59893f){var _0x10b9b3=_0x10b9b3||'',_0x59893f=typeof _0x59893f==_0xace2('0x11')?_0x59893f:new Function();_0x5b569f={'tx':_0x10b9b3,'rx':'','cb':_0x59893f};_0x88316[_0xace2('0x20')](_0x10b9b3+'\x0a');},this[_0xace2('0x1b')]=function(){_0x88316[_0xace2('0x1e')]();};}util[_0xace2('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xace2('0x22')][_0xace2('0x23')]=function(_0x2797b6){return this[_0xace2('0x1f')][_0xace2('0x24')](this,_0x2797b6);};AGIChannel[_0xace2('0x22')][_0xace2('0x25')]=function(){return this[_0xace2('0x23')](_0xace2('0x26'));};AGIChannel['prototype']['getData']=function(_0x3f542a,_0x5230eb,_0x56ce59){_0x3f542a=_0x3f542a===undefined?'beep':_0x3f542a;_0x5230eb=_0x5230eb===undefined?'5':_0x5230eb;_0x56ce59=_0x56ce59===undefined?'1':_0x56ce59;return this[_0xace2('0x23')](util[_0xace2('0x27')](_0xace2('0x28'),_0x3f542a,_0x5230eb*0x3e8,_0x56ce59));};AGIChannel[_0xace2('0x22')]['noop']=function(_0x11d2eb){_0x11d2eb=_0x11d2eb||_0xace2('0x29');return this['sendRequest'](util[_0xace2('0x27')]('VERBOSE\x20\x22%s\x22',_0x11d2eb));};AGIChannel[_0xace2('0x22')][_0xace2('0x2a')]=function(_0x5224d2,_0x243385){if(_['isArray'](_0x243385)){return this[_0xace2('0x23')](util[_0xace2('0x27')](_0xace2('0x2b'),_0x5224d2,_0x243385[_0xace2('0x2c')](',')));}return this['sendRequest'](util[_0xace2('0x27')](_0xace2('0x2b'),_0x5224d2,_0x243385));};AGIChannel[_0xace2('0x22')]['setContext']=function(_0x426d50){return this['sendRequest'](util[_0xace2('0x27')]('SET\x20CONTEXT\x20%s',_0x426d50));};AGIChannel[_0xace2('0x22')][_0xace2('0x2d')]=function(_0x2bfa84){return this['sendRequest'](util[_0xace2('0x27')](_0xace2('0x2e'),_0x2bfa84));};AGIChannel[_0xace2('0x22')][_0xace2('0x2f')]=function(_0xa788cf){return this['sendRequest'](util[_0xace2('0x27')](_0xace2('0x30'),_0xa788cf));};AGIChannel[_0xace2('0x22')][_0xace2('0xb')]=function(){return this[_0xace2('0x23')](_0xace2('0x31'));};AGIChannel[_0xace2('0x22')][_0xace2('0x32')]=function(_0x18d98c,_0x377343){var _0x2b3297=_[_0xace2('0x33')](_0x377343)||_[_0xace2('0x34')](_0x377343)?_0x377343[_0xace2('0x35')]():_0x377343;return this[_0xace2('0x23')](util[_0xace2('0x27')](_0xace2('0x36'),_0x18d98c,_0x2b3297?_0x2b3297['toString']()[_0xace2('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xace2('0x22')][_0xace2('0x37')]=function(_0x266a43,_0x31e6ca){return this[_0xace2('0x23')](util[_0xace2('0x27')](_0xace2('0x38'),_0x266a43,_0x31e6ca));};AGIChannel[_0xace2('0x22')][_0xace2('0x39')]=function(_0x54766e,_0x12fe64){return this[_0xace2('0x23')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x54766e,_0x12fe64));};AGIChannel[_0xace2('0x22')][_0xace2('0x3a')]=function(_0x416a93,_0x4bc0cb){return this[_0xace2('0x23')](util[_0xace2('0x27')](_0xace2('0x3b'),_0x416a93,_0x4bc0cb));};AGIChannel[_0xace2('0x22')][_0xace2('0x3c')]=function(_0x263bcb,_0x12b93f,_0x1fde43){_0x12b93f=_0x12b93f||this['extension'];_0x1fde43=_0x1fde43||0x1;this[_0xace2('0x3d')](_0x263bcb);this['setExtension'](_0x12b93f);this[_0xace2('0x2f')](_0x1fde43);return this[_0xace2('0x3e')](util[_0xace2('0x27')](_0xace2('0x3f'),_0x263bcb,_0x12b93f,_0x1fde43));};AGIChannel[_0xace2('0x22')]['getVariable']=function(_0x303975){return this[_0xace2('0x23')](util[_0xace2('0x27')](_0xace2('0x40'),_0x303975));};AGIChannel[_0xace2('0x22')][_0xace2('0x41')]=function(_0xb414c3,_0x412bd1,_0x8b46de,_0x38d8a7,_0xd00611,_0x3ddc7e){_0x412bd1=_0x412bd1||_0xace2('0x42');_0x8b46de=_0x8b46de||'';_0x38d8a7=_0x38d8a7===undefined?-0x1:_0x38d8a7==='-1'?-0x1:_0x38d8a7*0x3e8;_0xd00611=_0xd00611===undefined?'':'s='+_0xd00611;_0x3ddc7e=_0x3ddc7e?'BEEP':'';return this['sendRequest'](util[_0xace2('0x27')](_0xace2('0x43'),_0xb414c3,_0x412bd1,_0x8b46de,_0x38d8a7,_0x3ddc7e,_0xd00611));};AGIChannel['prototype']['streamFile']=function(_0x354ab6,_0x298dfc){_0x298dfc=_0x298dfc||'';return this[_0xace2('0x23')](util[_0xace2('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x354ab6,_0x298dfc));};AGIChannel[_0xace2('0x22')][_0xace2('0x44')]=function(_0x3e149a){return this[_0xace2('0x2a')](_0xace2('0x45'),_0x3e149a);};AGIChannel['prototype']['wait']=function(_0x96e84e){return this[_0xace2('0x2a')]('WAIT',_0x96e84e);};AGIChannel[_0xace2('0x22')]['error']=function(_0x1acad4,_0x292bf7){this['noop'](util['format'](_0xace2('0x46'),_0x1acad4['id'],_0x1acad4[_0xace2('0x47')],_0x292bf7));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 b263408..0cf8b70 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 _0xb06c=['exports','util','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','E_AGI_UNDEFINED','format','apply','name'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0xb06c,0x9b));var _0xcb06=function(_0x24b268,_0xa798a8){_0x24b268=_0x24b268-0x0;var _0x141588=_0xb06c[_0x24b268];return _0x141588;};'use strict';var util=require(_0xcb06('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xcb06('0x1'),'E_AGI_SERVER_VOICE_DISABLED':_0xcb06('0x2'),'E_AGI_SOCKET_ERROR':_0xcb06('0x3'),'E_AGI_SOCKET_CLOSE':_0xcb06('0x4'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xcb06('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4782e7){var _0x4782e7=_0x4782e7||null,_0x1335eb=_0x1335eb||[],_0x5837b1=0x1,_0x2691c9='';if(!error[_0x4782e7]){_0x4782e7=_0xcb06('0x6');}_0x1335eb['push'](error[_0x4782e7]);while(arguments[_0x5837b1]){_0x1335eb['push'](arguments[_0x5837b1]);_0x5837b1++;}_0x2691c9=util[_0xcb06('0x7')][_0xcb06('0x8')](util,_0x1335eb);this['message']=_0x2691c9;this[_0xcb06('0x9')]=_0x4782e7;}module[_0xcb06('0xa')]=AGIError; \ No newline at end of file +var _0xaa47=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x179d88,_0x548f72){var _0x179ffa=function(_0x1daa48){while(--_0x1daa48){_0x179d88['push'](_0x179d88['shift']());}};_0x179ffa(++_0x548f72);}(_0xaa47,0x6c));var _0x7aa4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaa47[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x7aa4('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x7aa4('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x7aa4('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x7aa4('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x7aa4('0x4'),'E_AGI_SOCKET_ERROR':_0x7aa4('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x7aa4('0x6'),'E_AGI_COMMAND_EMPTY':_0x7aa4('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x7aa4('0x8')};function AGIError(_0x1aa25c){var _0x1aa25c=_0x1aa25c||null,_0x353728=_0x353728||[],_0x4c5a1e=0x1,_0x573342='';if(!error[_0x1aa25c]){_0x1aa25c='E_AGI_UNDEFINED';}_0x353728[_0x7aa4('0x9')](error[_0x1aa25c]);while(arguments[_0x4c5a1e]){_0x353728[_0x7aa4('0x9')](arguments[_0x4c5a1e]);_0x4c5a1e++;}_0x573342=util['format']['apply'](util,_0x353728);this['message']=_0x573342;this[_0x7aa4('0xa')]=_0x1aa25c;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index ccdde7d..e2017d8 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa810=['projectUpdate','exports','events','EventEmitter','../../config/environment','redis','defaults','agi','emit','error','E_AGI_SERVER_ERROR','message','parse'];(function(_0x5904ea,_0x5b043f){var _0x2055e7=function(_0x377261){while(--_0x377261){_0x5904ea['push'](_0x5904ea['shift']());}};_0x2055e7(++_0x5b043f);}(_0xa810,0x12d));var _0x0a81=function(_0x27b3df,_0x34a01a){_0x27b3df=_0x27b3df-0x0;var _0x275390=_0xa810[_0x27b3df];return _0x275390;};'use strict';var _=require('lodash');var EventEmitter=require(_0x0a81('0x0'))[_0x0a81('0x1')];var Redis=require('ioredis');var AGIError=require('./error');var config=require(_0x0a81('0x2'));config[_0x0a81('0x3')]=_[_0x0a81('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x0a81('0x3')]);sub['subscribe'](_0x0a81('0x5'),function(_0x3e350f){if(_0x3e350f)return eventEmitter[_0x0a81('0x6')](_0x0a81('0x7'),new AGIError(_0x0a81('0x8'),_0x3e350f));});sub['on'](_0x0a81('0x9'),function(_0x28fb9,_0x2132e5){if(_0x28fb9!==_0x0a81('0x5'))return;try{var _0x244cc4=JSON[_0x0a81('0xa')](_0x2132e5);eventEmitter[_0x0a81('0x6')](_0x0a81('0xb'),_0x244cc4);}catch(_0x58ada6){eventEmitter[_0x0a81('0x6')](_0x0a81('0x7'),new AGIError(_0x0a81('0x8'),_0x58ada6));}});module[_0x0a81('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x8988=['agi','parse','projectUpdate','exports','lodash','EventEmitter','./error','../../config/environment','redis','defaults','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x8988,0x18a));var _0x8898=function(_0x3c5433,_0x515ff7){_0x3c5433=_0x3c5433-0x0;var _0x425f26=_0x8988[_0x3c5433];return _0x425f26;};'use strict';var _=require(_0x8898('0x0'));var EventEmitter=require('events')[_0x8898('0x1')];var Redis=require('ioredis');var AGIError=require(_0x8898('0x2'));var config=require(_0x8898('0x3'));config[_0x8898('0x4')]=_[_0x8898('0x5')](config[_0x8898('0x4')],{'host':_0x8898('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x8898('0x7')]('agi',function(_0x3aa006){if(_0x3aa006)return eventEmitter[_0x8898('0x8')](_0x8898('0x9'),new AGIError(_0x8898('0xa'),_0x3aa006));});sub['on']('message',function(_0x18fc29,_0x246f52){if(_0x18fc29!==_0x8898('0xb'))return;try{var _0x1ae6ce=JSON[_0x8898('0xc')](_0x246f52);eventEmitter[_0x8898('0x8')](_0x8898('0xd'),_0x1ae6ce);}catch(_0x35ae3d){eventEmitter['emit']('error',new AGIError(_0x8898('0xa'),_0x35ae3d));}});module[_0x8898('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 901c5e4..c857de9 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 _0x8693=['no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','menu','edges','numberOfEdges','prototype','vertices','addEdge','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x8693,0x178));var _0x3869=function(_0x3a6b46,_0x2c118b){_0x3a6b46=_0x3a6b46-0x0;var _0x3603a7=_0x8693[_0x3a6b46];return _0x3603a7;};'use strict';var _=require(_0x3869('0x0'));var logger=require(_0x3869('0x1'))(_0x3869('0x2'));var verticesWithRetry=[_0x3869('0x3'),'getdigits','getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x3869('0x4')]={};this[_0x3869('0x5')]=0x0;};Graph[_0x3869('0x6')]['addVertex']=function(_0x46b07c){this[_0x3869('0x7')][_0x46b07c['id']]=_0x46b07c;this[_0x3869('0x4')][_0x46b07c['id']]=[];};Graph['prototype'][_0x3869('0x8')]=function(_0x2e2ef4,_0x137b7e,_0x37cee6){this['edges'][_0x2e2ef4]['push']({'target':_0x137b7e,'condition':_0x37cee6});this['numberOfEdges']+=0x1;};Graph[_0x3869('0x6')][_0x3869('0x9')]=function(){return _[_0x3869('0x9')](this[_0x3869('0x7')]);};Graph[_0x3869('0x6')]['relations']=function(){return this[_0x3869('0x5')];};Graph[_0x3869('0x6')][_0x3869('0xa')]=function(_0xc8c8dc){return this[_0x3869('0x7')][_0xc8c8dc];};Graph[_0x3869('0x6')][_0x3869('0xb')]=function(_0x381641,_0x3c000f){if(!this[_0x3869('0x7')][_0x381641]){return logger[_0x3869('0xc')](_0x3869('0xd'));}var _0x9ffaf9=_0x3c000f(this[_0x3869('0x7')][_0x381641]);if(!_0x9ffaf9){return logger[_0x3869('0xc')](_0x3869('0xe'));}if(this[_0x3869('0x4')][_0x381641][_0x3869('0xf')]===0x0){return logger[_0x3869('0xc')](_0x3869('0x10'));}for(var _0x20ea13=0x0,_0x5c648a=[],_0x4d4866=![];_0x20ea13\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb21d,0x1e2));var _0xdb21=function(_0x121014,_0x59b1d0){_0x121014=_0x121014-0x0;var _0x464b29=_0xb21d[_0x121014];return _0x464b29;};'use strict';var _=require(_0xdb21('0x0'));var syncho=require(_0xdb21('0x1'));var util=require(_0xdb21('0x2'));var config=require('../../config/environment');var logger=require(_0xdb21('0x3'))(_0xdb21('0x4'));var utilLicense=require(_0xdb21('0x5'));var rpc=require(_0xdb21('0x6'));var Project=require(_0xdb21('0x7'));var AGIEmitter=require(_0xdb21('0x8'))[_0xdb21('0x9')];var projects=[];config['agi']=_[_0xdb21('0xa')](config['agi'],{'ip':_0xdb21('0xb'),'port':0x11dd});AGIEmitter['on'](_0xdb21('0xc'),projectUpdateHandler);function connectionHandler(_0x1ebb6c){process[_0xdb21('0xd')](function(){syncho(function(){try{setChannelVariables(_0x1ebb6c);agiHandler(_0x1ebb6c);}catch(_0x1e0a09){logger[_0xdb21('0xe')](_0x1e0a09[_0xdb21('0xf')]);}});});}function projectUpdateHandler(_0x3d91b0){try{var _0x359d3d=_['findIndex'](projects,['id',_0x3d91b0['id']]);if(_0x359d3d>-0x1){if(_0x3d91b0['deleted']===!![]){projects[_0xdb21('0x10')](_0x359d3d,0x1);}else{projects[_0x359d3d]=_0x3d91b0;}}else{projects[_0xdb21('0x11')](_0x3d91b0);}}catch(_0x5c199e){logger[_0xdb21('0xe')](_0x5c199e[_0xdb21('0xf')]);}}function listeningHandler(){console['log'](_0xdb21('0x12'),config[_0xdb21('0x4')][_0xdb21('0x13')]);logger[_0xdb21('0x14')](util['format'](_0xdb21('0x15'),config[_0xdb21('0x4')]['ip'],config[_0xdb21('0x4')][_0xdb21('0x13')]));}function errorHandler(_0x71c2db){if(_0x71c2db&&_0x71c2db[_0xdb21('0x16')]&&_0x71c2db[_0xdb21('0x17')]){logger[_0xdb21('0xe')](util['format'](_0xdb21('0x18'),_0x71c2db[_0xdb21('0x16')],_0x71c2db[_0xdb21('0x17')]));}else{logger[_0xdb21('0xe')](util['format']('[ERROR]\x20%s',_0x71c2db[_0xdb21('0xf')]));}}function closeHandler(){logger[_0xdb21('0x14')](util[_0xdb21('0x19')](_0xdb21('0x1a'),this['arg_1'],this[_0xdb21('0x1b')],this[_0xdb21('0x1c')],this[_0xdb21('0x1d')],this[_0xdb21('0x1e')]));try{createSquareReport(this);}catch(_0x3dfcd5){logger[_0xdb21('0xe')](_0x3dfcd5[_0xdb21('0xf')]);}}function timeoutHandler(){logger[_0xdb21('0x14')](util[_0xdb21('0x19')](_0xdb21('0x1f'),this[_0xdb21('0x20')],this[_0xdb21('0x1b')],this[_0xdb21('0x1c')],this[_0xdb21('0x1d')],this['uniqueid']));}function hangupHandler(){logger[_0xdb21('0x14')](util[_0xdb21('0x19')](_0xdb21('0x21'),this[_0xdb21('0x20')],this['calleridname'],this[_0xdb21('0x1c')],this[_0xdb21('0x1d')],this[_0xdb21('0x1e')]));this[_0xdb21('0x22')]=!![];}function createSquareReport(_0x185e89,_0x228290){rpc[_0xdb21('0x23')](_0x185e89)[_0xdb21('0x24')](function(_0x30c4bd){if(_0x228290){_0x228290(null,_0x30c4bd);}})[_0xdb21('0x25')](function(_0x582da3){if(_0x228290){_0x228290(null,_0x582da3);}});}function setChannelVariables(_0x5d149d){for(var _0x5c6263 in _0x5d149d){if(_0x5d149d[_0xdb21('0x26')](_0x5c6263)){if(_0x5c6263[_0xdb21('0x27')](_0xdb21('0x28'))===0x0){_0x5d149d[_0x5c6263[_0xdb21('0x29')](0x4)]=_0x5d149d[_0x5c6263];delete _0x5d149d[_0x5c6263];}}}}function agiHandler(_0x468e0e){logger[_0xdb21('0x2a')](_0xdb21('0x2b'),JSON[_0xdb21('0x2c')](_0x468e0e,null,0x2));logger['info'](util[_0xdb21('0x19')](_0xdb21('0x2d'),_0x468e0e[_0xdb21('0x20')],_0x468e0e[_0xdb21('0x1b')],_0x468e0e[_0xdb21('0x1c')],_0x468e0e[_0xdb21('0x1d')],_0x468e0e[_0xdb21('0x1e')]));_0x468e0e['on']('error',errorHandler);_0x468e0e['on'](_0xdb21('0x2e'),closeHandler);_0x468e0e['on'](_0xdb21('0x2f'),timeoutHandler);_0x468e0e[_0xdb21('0x22')]=![];_0x468e0e['on'](_0xdb21('0x30'),hangupHandler);var _0x4a4efd=_[_0xdb21('0x31')](projects,['name',_0x468e0e[_0xdb21('0x20')]]);if(!_0x4a4efd)return Project[_0xdb21('0x32')](_0x468e0e);if(!_0x4a4efd[_0xdb21('0x33')])return Project[_0xdb21('0x34')](_0x468e0e);return Project[_0xdb21('0x35')](_0x4a4efd,_0x468e0e);}function main(){var _0x56c836;return utilLicense[_0xdb21('0x36')]()[_0xdb21('0x24')](function(_0x5e7623){if(!_0x5e7623)return;if(_0x5e7623[_0xdb21('0x37')]){if(_0x5e7623[_0xdb21('0x38')]&&_0x5e7623[_0xdb21('0x38')]>0x0){logger[_0xdb21('0x14')](util['format'](_0xdb21('0x39'),_0x5e7623[_0xdb21('0x38')]));_0x56c836=_0x5e7623['callysquare'];}else{logger['info'](_0xdb21('0x3a'));}}else{logger[_0xdb21('0x14')](_0xdb21('0x3b'));_0x56c836=-0x1;}})['then'](function(){return Project[_0xdb21('0x3c')]();})[_0xdb21('0x24')](function(_0x5dc72d){projects=_0x5dc72d;return;})[_0xdb21('0x25')](function(_0x8f64e4){logger[_0xdb21('0xe')](_0xdb21('0x3d'),_0x8f64e4[_0xdb21('0xf')]);})[_0xdb21('0x3e')](function(){var _0x37dc45=require(_0xdb21('0x3f'))(config[_0xdb21('0x4')]['port'],config[_0xdb21('0x4')]['ip'],_0x56c836);_0x37dc45['on'](_0xdb21('0xe'),errorHandler);_0x37dc45['on'](_0xdb21('0x40'),listeningHandler);_0x37dc45['on'](_0xdb21('0x41'),connectionHandler);_0x37dc45['on'](_0xdb21('0x2e'),closeHandler);});}main(); \ No newline at end of file +var _0x752b=['[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','then','getAll','[LICENSE]','finally','port','listening','connection','lodash','syncho','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','message','name','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','catch','hasOwnProperty','indexOf','substring','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x752b,0x175));var _0xb752=function(_0x342c39,_0x17c253){_0x342c39=_0x342c39-0x0;var _0x229347=_0x752b[_0x342c39];return _0x229347;};'use strict';var _=require(_0xb752('0x0'));var syncho=require(_0xb752('0x1'));var util=require('util');var config=require('../../config/environment');var logger=require(_0xb752('0x2'))(_0xb752('0x3'));var utilLicense=require(_0xb752('0x4'));var rpc=require('./rpc');var Project=require(_0xb752('0x5'));var AGIEmitter=require(_0xb752('0x6'))[_0xb752('0x7')];var projects=[];config[_0xb752('0x3')]=_[_0xb752('0x8')](config[_0xb752('0x3')],{'ip':_0xb752('0x9'),'port':0x11dd});AGIEmitter['on'](_0xb752('0xa'),projectUpdateHandler);function connectionHandler(_0x58cd0e){process[_0xb752('0xb')](function(){syncho(function(){try{setChannelVariables(_0x58cd0e);agiHandler(_0x58cd0e);}catch(_0x1b0168){logger['error'](_0x1b0168[_0xb752('0xc')]);}});});}function projectUpdateHandler(_0x4c3a4c){try{var _0x6e7d34=_[_0xb752('0xd')](projects,['id',_0x4c3a4c['id']]);if(_0x6e7d34>-0x1){if(_0x4c3a4c[_0xb752('0xe')]===!![]){projects[_0xb752('0xf')](_0x6e7d34,0x1);}else{projects[_0x6e7d34]=_0x4c3a4c;}}else{projects[_0xb752('0x10')](_0x4c3a4c);}}catch(_0x155c0e){logger[_0xb752('0x11')](_0x155c0e['stack']);}}function listeningHandler(){console[_0xb752('0x12')](_0xb752('0x13'),config[_0xb752('0x3')]['port']);logger['info'](util[_0xb752('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xb752('0x3')]['ip'],config[_0xb752('0x3')]['port']));}function errorHandler(_0x3613d4){if(_0x3613d4&&_0x3613d4['name']&&_0x3613d4[_0xb752('0x15')]){logger[_0xb752('0x11')](util[_0xb752('0x14')]('[%s]\x20%s',_0x3613d4[_0xb752('0x16')],_0x3613d4[_0xb752('0x15')]));}else{logger[_0xb752('0x11')](util[_0xb752('0x14')](_0xb752('0x17'),_0x3613d4[_0xb752('0xc')]));}}function closeHandler(){logger[_0xb752('0x18')](util[_0xb752('0x14')](_0xb752('0x19'),this['arg_1'],this[_0xb752('0x1a')],this[_0xb752('0x1b')],this[_0xb752('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2d580d){logger[_0xb752('0x11')](_0x2d580d[_0xb752('0xc')]);}}function timeoutHandler(){logger[_0xb752('0x18')](util['format'](_0xb752('0x1d'),this[_0xb752('0x1e')],this[_0xb752('0x1a')],this[_0xb752('0x1b')],this[_0xb752('0x1c')],this[_0xb752('0x1f')]));}function hangupHandler(){logger[_0xb752('0x18')](util[_0xb752('0x14')](_0xb752('0x20'),this[_0xb752('0x1e')],this[_0xb752('0x1a')],this[_0xb752('0x1b')],this[_0xb752('0x1c')],this['uniqueid']));this[_0xb752('0x21')]=!![];}function createSquareReport(_0x1195b0,_0x46fa57){rpc['createSquareReport'](_0x1195b0)['then'](function(_0x3838d2){if(_0x46fa57){_0x46fa57(null,_0x3838d2);}})[_0xb752('0x22')](function(_0x266595){if(_0x46fa57){_0x46fa57(null,_0x266595);}});}function setChannelVariables(_0x2aa716){for(var _0x35942d in _0x2aa716){if(_0x2aa716[_0xb752('0x23')](_0x35942d)){if(_0x35942d[_0xb752('0x24')]('agi_')===0x0){_0x2aa716[_0x35942d[_0xb752('0x25')](0x4)]=_0x2aa716[_0x35942d];delete _0x2aa716[_0x35942d];}}}}function agiHandler(_0x5562a4){logger[_0xb752('0x26')]('variables',JSON[_0xb752('0x27')](_0x5562a4,null,0x2));logger['info'](util['format'](_0xb752('0x28'),_0x5562a4[_0xb752('0x1e')],_0x5562a4[_0xb752('0x1a')],_0x5562a4[_0xb752('0x1b')],_0x5562a4[_0xb752('0x1c')],_0x5562a4[_0xb752('0x1f')]));_0x5562a4['on'](_0xb752('0x11'),errorHandler);_0x5562a4['on'](_0xb752('0x29'),closeHandler);_0x5562a4['on'](_0xb752('0x2a'),timeoutHandler);_0x5562a4[_0xb752('0x21')]=![];_0x5562a4['on']('hangup',hangupHandler);var _0x2f5e58=_[_0xb752('0x2b')](projects,[_0xb752('0x16'),_0x5562a4['arg_1']]);if(!_0x2f5e58)return Project['handleNotFound'](_0x5562a4);if(!_0x2f5e58['production'])return Project[_0xb752('0x2c')](_0x5562a4);return Project[_0xb752('0x2d')](_0x2f5e58,_0x5562a4);}function main(){var _0x194df1;return utilLicense[_0xb752('0x2e')]()['then'](function(_0x2afb1d){if(!_0x2afb1d)return;if(_0x2afb1d[_0xb752('0x2f')]){if(_0x2afb1d['callysquare']&&_0x2afb1d[_0xb752('0x30')]>0x0){logger[_0xb752('0x18')](util[_0xb752('0x14')](_0xb752('0x31'),_0x2afb1d[_0xb752('0x30')]));_0x194df1=_0x2afb1d[_0xb752('0x30')];}else{logger[_0xb752('0x18')](_0xb752('0x32'));}}else{logger[_0xb752('0x18')](_0xb752('0x33'));_0x194df1=-0x1;}})[_0xb752('0x34')](function(){return Project[_0xb752('0x35')]();})[_0xb752('0x34')](function(_0x135a53){projects=_0x135a53;return;})[_0xb752('0x22')](function(_0x4244d7){logger['error'](_0xb752('0x36'),_0x4244d7['stack']);})[_0xb752('0x37')](function(){var _0x4b319b=require('./server')(config['agi'][_0xb752('0x38')],config[_0xb752('0x3')]['ip'],_0x194df1);_0x4b319b['on'](_0xb752('0x11'),errorHandler);_0x4b319b['on'](_0xb752('0x39'),listeningHandler);_0x4b319b['on'](_0xb752('0x3a'),connectionHandler);_0x4b319b['on']('close',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 d29e722..d48c742 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 _0x8d6e=['request','error','message','result','SendMail','jayson/promise','client'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x8d6e,0x1da));var _0xe8d6=function(_0x1409b9,_0x1df4a7){_0x1409b9=_0x1409b9-0x0;var _0x1d847f=_0x8d6e[_0x1409b9];return _0x1d847f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe8d6('0x0'));var client=jayson[_0xe8d6('0x1')]['http']({'port':0x232b});function request(_0x7ccffd,_0x23036a){return new BPromise(function(_0x87d81,_0x163841){return client[_0xe8d6('0x2')](_0x7ccffd,_0x23036a)['then'](function(_0x393ad2){if(_0x393ad2['error']){return _0x163841(_0x393ad2[_0xe8d6('0x3')][_0xe8d6('0x4')]);}else{return _0x87d81(_0x393ad2[_0xe8d6('0x5')]);}})['catch'](function(_0x5e1128){return _0x163841(_0x5e1128);});});}exports['sendMailMessage']=function(_0x254f3d,_0x1176fd){return request(_0xe8d6('0x6'),{'account':_0x254f3d,'message':_0x1176fd});}; \ No newline at end of file +var _0x7f3b=['error','message','result','catch','bluebird','jayson/promise','http','request','then'];(function(_0x255c69,_0x41b52f){var _0x2d03da=function(_0x2c6712){while(--_0x2c6712){_0x255c69['push'](_0x255c69['shift']());}};_0x2d03da(++_0x41b52f);}(_0x7f3b,0xdc));var _0xb7f3=function(_0x3542d9,_0x495531){_0x3542d9=_0x3542d9-0x0;var _0x2e92fe=_0x7f3b[_0x3542d9];return _0x2e92fe;};'use strict';var BPromise=require(_0xb7f3('0x0'));var jayson=require(_0xb7f3('0x1'));var client=jayson['client'][_0xb7f3('0x2')]({'port':0x232b});function request(_0x3772d7,_0x4c4efe){return new BPromise(function(_0x335e14,_0x322cd8){return client[_0xb7f3('0x3')](_0x3772d7,_0x4c4efe)[_0xb7f3('0x4')](function(_0x5a16d8){if(_0x5a16d8[_0xb7f3('0x5')]){return _0x322cd8(_0x5a16d8[_0xb7f3('0x5')][_0xb7f3('0x6')]);}else{return _0x335e14(_0x5a16d8[_0xb7f3('0x7')]);}})[_0xb7f3('0x8')](function(_0x1ad94a){return _0x322cd8(_0x1ad94a);});});}exports['sendMailMessage']=function(_0x1586d8,_0x323ac5){return request('SendMail',{'account':_0x1586d8,'message':_0x323ac5});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 8b164a5..85b6834 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6be=['context','extension','priority','agicommand','response','code','result','isUndefined','toString','error','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','clear','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','../../config/logger','agi','./mailRpc','./vertices','getSquareProjects','catch','stack','hasOwnProperty','retry','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','inspect','production','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','start','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS'];(function(_0x1e901f,_0x1c8295){var _0x46c282=function(_0x4b0718){while(--_0x4b0718){_0x1e901f['push'](_0x1e901f['shift']());}};_0x46c282(++_0x1c8295);}(_0xa6be,0x1a2));var _0xea6b=function(_0x2ac192,_0x89e5cc){_0x2ac192=_0x2ac192-0x0;var _0x3e1128=_0xa6be[_0x2ac192];return _0x3e1128;};'use strict';var _=require('lodash');var moment=require(_0xea6b('0x0'));var parser=require('xml2json');var util=require('util');var logger=require(_0xea6b('0x1'))(_0xea6b('0x2'));var rpc=require('./rpc');var mailRpc=require(_0xea6b('0x3'));var Graph=require('./graph');var Vertices=require(_0xea6b('0x4'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xea6b('0x5')]()[_0xea6b('0x6')](function(_0x511066){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x511066[_0xea6b('0x7')]);return[];});}function addVertex(_0x14ab7d,_0x457adb,_0x42ffb0){_0x457adb['agicommand']=_0x42ffb0;if(_0x457adb[_0xea6b('0x8')](_0xea6b('0x9'))){_0x457adb['maxRetry']=parseInt(_0x457adb['retry'],0xa);}_0x14ab7d['addVertex'](_[_0xea6b('0xa')](_0x457adb,_0xea6b('0xb')));}function initGraph(_0x226437,_0x557b67){var _0x2a9c3c=new Graph();for(var _0x459a08 in _0x226437){if(_0x226437[_0xea6b('0x8')](_0x459a08)){if(_[_0xea6b('0xc')](_0x226437[_0x459a08])){for(var _0x5644a5=0x0;_0x5644a5<_0x226437[_0x459a08][_0xea6b('0xd')];_0x5644a5+=0x1){addVertex(_0x2a9c3c,_0x226437[_0x459a08][_0x5644a5],_0x459a08);}}else{addVertex(_0x2a9c3c,_0x226437[_0x459a08],_0x459a08);}}}for(var _0x46de49=0x0;_0x46de49<_0x557b67[_0xea6b('0xd')];_0x46de49+=0x1){if(_0x557b67[_0x46de49][_0xea6b('0xe')]&&_0x557b67[_0x46de49][_0xea6b('0xf')]){_0x2a9c3c[_0xea6b('0x10')](_0x557b67[_0x46de49]['source'],_0x557b67[_0x46de49][_0xea6b('0xf')],_0x557b67[_0x46de49][_0xea6b('0x11')]);}}return _0x2a9c3c;}function getRoot(_0x13365b){return parser[_0xea6b('0x12')](_0x13365b,{'object':!![]})[_0xea6b('0x13')]['root'];}function inspect(_0x40bb30){return util[_0xea6b('0x14')](_0x40bb30,{'showHidden':![],'depth':null});}function initialize(_0xea416c,_0x5c6a36){var _0x44e259=getRoot(_0xea416c[_0xea6b('0x15')]);if(!_0x44e259||!_0x44e259['start'])return;var _0x5c1821,_0x41c9d5,_0x88c2a0;logger[_0xea6b('0x16')](_0xea6b('0x17'),JSON[_0xea6b('0x18')](_0x44e259,null,0x2));_0x5c6a36[_0xea6b('0x19')]=moment()[_0xea6b('0x1a')](_0xea6b('0x1b'));_0x5c1821=initGraph(_[_0xea6b('0xa')](_0x44e259,_0xea6b('0xb')),_0x44e259[_0xea6b('0xb')]);_0x41c9d5=new Vertices(_0x5c6a36,rpc,mailRpc);logger['info'](util['format'](_0xea6b('0x1c'),_0x5c6a36[_0xea6b('0x1d')],_0x5c6a36['calleridname'],_0x5c6a36[_0xea6b('0x1e')],_0x5c6a36[_0xea6b('0x1f')],_0x5c6a36[_0xea6b('0x20')]));_0x5c1821['traverseBFS'](_0x44e259[_0xea6b('0x21')]['id'],function(_0x564d09){try{_0x564d09=_0x41c9d5['clear'](_0x564d09);logger[_0xea6b('0x16')](_0xea6b('0x22'),JSON[_0xea6b('0x18')](_0x564d09,null,0x2));if(_0x564d09['agicommand']===_0xea6b('0x23')){logger[_0xea6b('0x24')](_0xea6b('0x25'));_0x5c6a36[_0xea6b('0x26')]=_0x564d09[_0xea6b('0x26')]||_0x5c6a36['context'];_0x5c6a36[_0xea6b('0x27')]=_0x564d09[_0xea6b('0x27')];_0x5c6a36[_0xea6b('0x28')]=_0x564d09['priority']?_0x564d09[_0xea6b('0x28')]-0x1:0x1;return null;}else if(_0x564d09&&_0x41c9d5[_0x564d09['agicommand']]){_0x88c2a0=_0x41c9d5[_0x564d09[_0xea6b('0x29')]](_0x564d09);logger[_0xea6b('0x24')](_0xea6b('0x2a'),JSON['stringify'](_0x88c2a0,null,0x2));if(_0x88c2a0&&_0x88c2a0[_0xea6b('0x2b')]===AGI_CODE_SUCCESS&&_0x88c2a0[_0xea6b('0x2c')]!==AGI_RESULT_ERROR&&!_0x5c6a36['evtHangup']){logger[_0xea6b('0x16')](_0xea6b('0x2a'),inspect(_0x88c2a0));return _[_0xea6b('0x2d')](_0x88c2a0[_0xea6b('0x2c')])?null:_0x88c2a0[_0xea6b('0x2c')][_0xea6b('0x2e')]();}else{logger[_0xea6b('0x2f')](_0xea6b('0x2a'),inspect(_0x88c2a0));return null;}}else{logger[_0xea6b('0x2f')]('agicommand\x20not\x20found');return null;}}catch(_0x5ef713){logger[_0xea6b('0x2f')](_0x5ef713[_0xea6b('0x7')]);return null;}});if(_0x44e259[_0xea6b('0x30')]){logger['info'](util[_0xea6b('0x1a')](_0xea6b('0x31'),_0x5c6a36[_0xea6b('0x1d')],_0x5c6a36[_0xea6b('0x32')],_0x5c6a36[_0xea6b('0x1e')],_0x5c6a36[_0xea6b('0x1f')],_0x5c6a36[_0xea6b('0x20')]));_0x5c1821['traverseBFS'](_0x44e259['finally']['id'],function(_0x1ab7a9){try{_0x1ab7a9=_0x41c9d5[_0xea6b('0x33')](_0x1ab7a9);logger[_0xea6b('0x16')](_0xea6b('0x22'),JSON[_0xea6b('0x18')](_0x1ab7a9,null,0x2));if(_0x1ab7a9&&_0x41c9d5[_0x1ab7a9['agicommand']]){_0x88c2a0=_0x41c9d5[_0x1ab7a9[_0xea6b('0x29')]](_0x1ab7a9);if(_0x88c2a0){logger[_0xea6b('0x16')](_0xea6b('0x2a'),inspect(_0x88c2a0));return _[_0xea6b('0x2d')](_0x88c2a0[_0xea6b('0x2c')])?null:_0x88c2a0[_0xea6b('0x2c')][_0xea6b('0x2e')]();}else{logger[_0xea6b('0x2f')](_0xea6b('0x2a'),inspect(_0x88c2a0));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3bf02f){logger[_0xea6b('0x2f')](_0x3bf02f[_0xea6b('0x7')]);return null;}});}logger[_0xea6b('0x24')](util[_0xea6b('0x1a')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5c6a36[_0xea6b('0x1d')],_0x5c6a36['calleridname'],_0x5c6a36[_0xea6b('0x1e')],_0x5c6a36[_0xea6b('0x1f')],_0x5c6a36[_0xea6b('0x20')]));logger['info'](util[_0xea6b('0x1a')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x5c6a36[_0xea6b('0x26')],_0x5c6a36['extension'],parseInt(_0x5c6a36['priority'],0xa)+0x1));_0x5c6a36[_0xea6b('0x34')](_0x5c6a36[_0xea6b('0x26')],_0x5c6a36[_0xea6b('0x27')],parseInt(_0x5c6a36[_0xea6b('0x28')],0xa)+0x1);_0x5c6a36[_0xea6b('0x35')]();}function handleNotFound(_0x4b2f8e){logger[_0xea6b('0x2f')](util[_0xea6b('0x1a')](_0xea6b('0x36'),_0x4b2f8e[_0xea6b('0x1d')]));_0x4b2f8e[_0xea6b('0x34')](_0x4b2f8e[_0xea6b('0x26')],_0x4b2f8e[_0xea6b('0x27')],parseInt(_0x4b2f8e[_0xea6b('0x28')],0xa)+0x1);_0x4b2f8e[_0xea6b('0x35')]();}function handleUnpublished(_0x2ac9ab){logger['error'](util[_0xea6b('0x1a')](_0xea6b('0x37'),_0x2ac9ab['arg_1']));_0x2ac9ab[_0xea6b('0x34')](_0x2ac9ab[_0xea6b('0x26')],_0x2ac9ab[_0xea6b('0x27')],parseInt(_0x2ac9ab['priority'],0xa)+0x1);_0x2ac9ab[_0xea6b('0x35')]();}module[_0xea6b('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xc666=['Project\x20%s\x20not\x20published','exports','lodash','util','../../config/logger','./rpc','./mailRpc','./vertices','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','toJson','mxGraphModel','root','inspect','production','start','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','debug','isUndefined','result','toString','agicommand\x20not\x20found','stack','dnid','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found'];(function(_0x3b06d1,_0x4a0229){var _0x2ad9dc=function(_0x4d9990){while(--_0x4d9990){_0x3b06d1['push'](_0x3b06d1['shift']());}};_0x2ad9dc(++_0x4a0229);}(_0xc666,0x1da));var _0x6c66=function(_0x537d8b,_0x449dc2){_0x537d8b=_0x537d8b-0x0;var _0x43f272=_0xc666[_0x537d8b];return _0x43f272;};'use strict';var _=require(_0x6c66('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x6c66('0x1'));var logger=require(_0x6c66('0x2'))('agi');var rpc=require(_0x6c66('0x3'));var mailRpc=require(_0x6c66('0x4'));var Graph=require('./graph');var Vertices=require(_0x6c66('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x3646fc){logger[_0x6c66('0x6')](_0x6c66('0x7'),_0x3646fc['stack']);return[];});}function addVertex(_0x589bb0,_0x41050a,_0x3cdfb8){_0x41050a[_0x6c66('0x8')]=_0x3cdfb8;if(_0x41050a[_0x6c66('0x9')](_0x6c66('0xa'))){_0x41050a[_0x6c66('0xb')]=parseInt(_0x41050a[_0x6c66('0xa')],0xa);}_0x589bb0[_0x6c66('0xc')](_[_0x6c66('0xd')](_0x41050a,_0x6c66('0xe')));}function initGraph(_0x5a38bc,_0x2635fc){var _0xc0932=new Graph();for(var _0x5cdb19 in _0x5a38bc){if(_0x5a38bc['hasOwnProperty'](_0x5cdb19)){if(_[_0x6c66('0xf')](_0x5a38bc[_0x5cdb19])){for(var _0x29c805=0x0;_0x29c805<_0x5a38bc[_0x5cdb19][_0x6c66('0x10')];_0x29c805+=0x1){addVertex(_0xc0932,_0x5a38bc[_0x5cdb19][_0x29c805],_0x5cdb19);}}else{addVertex(_0xc0932,_0x5a38bc[_0x5cdb19],_0x5cdb19);}}}for(var _0x211b97=0x0;_0x211b97<_0x2635fc[_0x6c66('0x10')];_0x211b97+=0x1){if(_0x2635fc[_0x211b97][_0x6c66('0x11')]&&_0x2635fc[_0x211b97][_0x6c66('0x12')]){_0xc0932[_0x6c66('0x13')](_0x2635fc[_0x211b97][_0x6c66('0x11')],_0x2635fc[_0x211b97][_0x6c66('0x12')],_0x2635fc[_0x211b97]['value']);}}return _0xc0932;}function getRoot(_0x216eda){return parser[_0x6c66('0x14')](_0x216eda,{'object':!![]})[_0x6c66('0x15')][_0x6c66('0x16')];}function inspect(_0x2c2aca){return util[_0x6c66('0x17')](_0x2c2aca,{'showHidden':![],'depth':null});}function initialize(_0x4ba4bd,_0x215e32){var _0x306f1d=getRoot(_0x4ba4bd[_0x6c66('0x18')]);if(!_0x306f1d||!_0x306f1d[_0x6c66('0x19')])return;var _0x5147c3,_0x5cb7f2,_0x116b81;logger['debug'](_0x6c66('0x16'),JSON[_0x6c66('0x1a')](_0x306f1d,null,0x2));_0x215e32[_0x6c66('0x1b')]=moment()[_0x6c66('0x1c')](_0x6c66('0x1d'));_0x5147c3=initGraph(_[_0x6c66('0xd')](_0x306f1d,_0x6c66('0xe')),_0x306f1d[_0x6c66('0xe')]);_0x5cb7f2=new Vertices(_0x215e32,rpc,mailRpc);logger[_0x6c66('0x1e')](util[_0x6c66('0x1c')](_0x6c66('0x1f'),_0x215e32[_0x6c66('0x20')],_0x215e32[_0x6c66('0x21')],_0x215e32[_0x6c66('0x22')],_0x215e32['dnid'],_0x215e32[_0x6c66('0x23')]));_0x5147c3['traverseBFS'](_0x306f1d['start']['id'],function(_0x5f083f){try{_0x5f083f=_0x5cb7f2['clear'](_0x5f083f);logger['debug'](_0x6c66('0x24'),JSON[_0x6c66('0x1a')](_0x5f083f,null,0x2));if(_0x5f083f['agicommand']===_0x6c66('0x25')){logger[_0x6c66('0x1e')](_0x6c66('0x26'));_0x215e32['context']=_0x5f083f[_0x6c66('0x27')]||_0x215e32['context'];_0x215e32['extension']=_0x5f083f[_0x6c66('0x28')];_0x215e32[_0x6c66('0x29')]=_0x5f083f['priority']?_0x5f083f['priority']-0x1:0x1;return null;}else if(_0x5f083f&&_0x5cb7f2[_0x5f083f[_0x6c66('0x8')]]){_0x116b81=_0x5cb7f2[_0x5f083f[_0x6c66('0x8')]](_0x5f083f);logger[_0x6c66('0x1e')](_0x6c66('0x2a'),JSON[_0x6c66('0x1a')](_0x116b81,null,0x2));if(_0x116b81&&_0x116b81[_0x6c66('0x2b')]===AGI_CODE_SUCCESS&&_0x116b81['result']!==AGI_RESULT_ERROR&&!_0x215e32[_0x6c66('0x2c')]){logger[_0x6c66('0x2d')](_0x6c66('0x2a'),inspect(_0x116b81));return _[_0x6c66('0x2e')](_0x116b81[_0x6c66('0x2f')])?null:_0x116b81['result'][_0x6c66('0x30')]();}else{logger[_0x6c66('0x6')](_0x6c66('0x2a'),inspect(_0x116b81));return null;}}else{logger[_0x6c66('0x6')](_0x6c66('0x31'));return null;}}catch(_0x545491){logger[_0x6c66('0x6')](_0x545491[_0x6c66('0x32')]);return null;}});if(_0x306f1d['finally']){logger[_0x6c66('0x1e')](util[_0x6c66('0x1c')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x215e32['arg_1'],_0x215e32['calleridname'],_0x215e32['callerid'],_0x215e32[_0x6c66('0x33')],_0x215e32[_0x6c66('0x23')]));_0x5147c3['traverseBFS'](_0x306f1d['finally']['id'],function(_0x56166f){try{_0x56166f=_0x5cb7f2[_0x6c66('0x34')](_0x56166f);logger['debug'](_0x6c66('0x24'),JSON[_0x6c66('0x1a')](_0x56166f,null,0x2));if(_0x56166f&&_0x5cb7f2[_0x56166f[_0x6c66('0x8')]]){_0x116b81=_0x5cb7f2[_0x56166f[_0x6c66('0x8')]](_0x56166f);if(_0x116b81){logger[_0x6c66('0x2d')](_0x6c66('0x2a'),inspect(_0x116b81));return _[_0x6c66('0x2e')](_0x116b81[_0x6c66('0x2f')])?null:_0x116b81['result'][_0x6c66('0x30')]();}else{logger['error'](_0x6c66('0x2a'),inspect(_0x116b81));return null;}}else{logger[_0x6c66('0x6')](_0x6c66('0x31'));return null;}}catch(_0x2db99e){logger['error'](_0x2db99e[_0x6c66('0x32')]);return null;}});}logger[_0x6c66('0x1e')](util[_0x6c66('0x1c')](_0x6c66('0x35'),_0x215e32[_0x6c66('0x20')],_0x215e32[_0x6c66('0x21')],_0x215e32[_0x6c66('0x22')],_0x215e32['dnid'],_0x215e32['uniqueid']));logger['info'](util[_0x6c66('0x1c')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x215e32[_0x6c66('0x27')],_0x215e32[_0x6c66('0x28')],parseInt(_0x215e32[_0x6c66('0x29')],0xa)+0x1));_0x215e32[_0x6c66('0x36')](_0x215e32[_0x6c66('0x27')],_0x215e32[_0x6c66('0x28')],parseInt(_0x215e32[_0x6c66('0x29')],0xa)+0x1);_0x215e32[_0x6c66('0x37')]();}function handleNotFound(_0x1005a6){logger[_0x6c66('0x6')](util['format'](_0x6c66('0x38'),_0x1005a6[_0x6c66('0x20')]));_0x1005a6[_0x6c66('0x36')](_0x1005a6[_0x6c66('0x27')],_0x1005a6[_0x6c66('0x28')],parseInt(_0x1005a6[_0x6c66('0x29')],0xa)+0x1);_0x1005a6['close']();}function handleUnpublished(_0x3fee67){logger[_0x6c66('0x6')](util[_0x6c66('0x1c')](_0x6c66('0x39'),_0x3fee67[_0x6c66('0x20')]));_0x3fee67[_0x6c66('0x36')](_0x3fee67[_0x6c66('0x27')],_0x3fee67[_0x6c66('0x28')],parseInt(_0x3fee67[_0x6c66('0x29')],0xa)+0x1);_0x3fee67[_0x6c66('0x37')]();}module[_0x6c66('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 48f22dc..a14e3d3 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 _0x2160=['stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','length','split','slice','trim','emit','headers','substring'];(function(_0x1c29af,_0x4c5e8a){var _0x3326c2=function(_0x4e9040){while(--_0x4e9040){_0x1c29af['push'](_0x1c29af['shift']());}};_0x3326c2(++_0x4c5e8a);}(_0x2160,0x132));var _0x0216=function(_0x3c2984,_0x2c03fc){_0x3c2984=_0x3c2984-0x0;var _0x10f919=_0x2160[_0x3c2984];return _0x10f919;};'use strict';var util=require('util');var Transform=require(_0x0216('0x0'))[_0x0216('0x1')];function AGIReply(_0x419876){Transform[_0x0216('0x2')](this,_0x419876);this[_0x0216('0x3')]='';this[_0x0216('0x4')]=![];}util[_0x0216('0x5')](AGIReply,Transform);AGIReply[_0x0216('0x6')][_0x0216('0x7')]=function(_0x1c7af9,_0x978b93,_0x2d5a59){var _0x3c6e96='\x0a',_0x462464=['\x0a\x0a',_0x0216('0x8')],_0x47af64=-0x1,_0x337ccd=-0x1,_0x2fd88d='',_0x578377=0x0,_0x555235='',_0x3f6b7e='';this[_0x0216('0x3')]+=_0x1c7af9['toString']();_0x555235=this[_0x0216('0x3')];if(!this[_0x0216('0x4')]){_0x578377=0x0;while(_0x462464[_0x578377]){while((_0x337ccd=_0x555235[_0x0216('0x9')](_0x462464[_0x578377]))!=-0x1){_0x2fd88d=_0x462464[_0x578377];_0x3f6b7e=_0x555235['substring'](0x0,_0x337ccd);_0x555235=_0x555235['substring'](_0x337ccd+_0x2fd88d[_0x0216('0xa')]);var _0x2bbf8b=_0x3f6b7e[_0x0216('0xb')](_0x3c6e96),_0x31eeb7=0x0,_0x5815aa={},_0x55b393='',_0x39d8de='',_0x22e8ed=-0x1;while(_0x2bbf8b[_0x31eeb7]){_0x22e8ed=_0x2bbf8b[_0x31eeb7][_0x0216('0x9')](':');if(_0x22e8ed!=-0x1){_0x55b393=_0x2bbf8b[_0x31eeb7][_0x0216('0xc')](0x0,_0x22e8ed)[_0x0216('0xd')]();_0x39d8de=_0x2bbf8b[_0x31eeb7][_0x0216('0xc')](_0x22e8ed+0x1)['trim']();if(_0x55b393['length']>0x0){_0x5815aa[_0x55b393]=_0x39d8de;}}else{}_0x31eeb7++;}this[_0x0216('0xe')](_0x0216('0xf'),_0x5815aa);this[_0x0216('0x4')]=!![];}_0x578377++;}this[_0x0216('0x3')]=_0x555235;}else{while((_0x47af64=_0x555235['indexOf'](_0x3c6e96))!=-0x1){_0x3f6b7e=_0x555235[_0x0216('0x10')](0x0,_0x47af64);this[_0x0216('0xe')]('line',_0x3f6b7e);_0x555235=_0x555235[_0x0216('0x10')](_0x47af64+_0x3c6e96[_0x0216('0xa')]);}this[_0x0216('0x3')]=_0x555235;}_0x2d5a59();};module['exports']=AGIReply; \ No newline at end of file +var _0x5668=['_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','split','indexOf','emit','headers','line','exports','util','stream','Transform','call','_localBuffer'];(function(_0x472ee7,_0x5838cb){var _0x2b84f9=function(_0x4541f0){while(--_0x4541f0){_0x472ee7['push'](_0x472ee7['shift']());}};_0x2b84f9(++_0x5838cb);}(_0x5668,0x8b));var _0x8566=function(_0x1e661a,_0x1e6690){_0x1e661a=_0x1e661a-0x0;var _0x2d8beb=_0x5668[_0x1e661a];return _0x2d8beb;};'use strict';var util=require(_0x8566('0x0'));var Transform=require(_0x8566('0x1'))[_0x8566('0x2')];function AGIReply(_0x3297a3){Transform[_0x8566('0x3')](this,_0x3297a3);this[_0x8566('0x4')]='';this[_0x8566('0x5')]=![];}util[_0x8566('0x6')](AGIReply,Transform);AGIReply[_0x8566('0x7')][_0x8566('0x8')]=function(_0x174099,_0x1a25d0,_0x2f958c){var _0x4885d6='\x0a',_0x355fce=['\x0a\x0a',_0x8566('0x9')],_0x2ffec4=-0x1,_0x49f55a=-0x1,_0x4aaf3f='',_0x4045ed=0x0,_0x4cbf90='',_0x555ffa='';this['_localBuffer']+=_0x174099[_0x8566('0xa')]();_0x4cbf90=this[_0x8566('0x4')];if(!this[_0x8566('0x5')]){_0x4045ed=0x0;while(_0x355fce[_0x4045ed]){while((_0x49f55a=_0x4cbf90['indexOf'](_0x355fce[_0x4045ed]))!=-0x1){_0x4aaf3f=_0x355fce[_0x4045ed];_0x555ffa=_0x4cbf90[_0x8566('0xb')](0x0,_0x49f55a);_0x4cbf90=_0x4cbf90[_0x8566('0xb')](_0x49f55a+_0x4aaf3f['length']);var _0x4ca241=_0x555ffa[_0x8566('0xc')](_0x4885d6),_0x51c3ba=0x0,_0x522618={},_0x11e0a5='',_0x3318a3='',_0x2025a2=-0x1;while(_0x4ca241[_0x51c3ba]){_0x2025a2=_0x4ca241[_0x51c3ba][_0x8566('0xd')](':');if(_0x2025a2!=-0x1){_0x11e0a5=_0x4ca241[_0x51c3ba]['slice'](0x0,_0x2025a2)['trim']();_0x3318a3=_0x4ca241[_0x51c3ba]['slice'](_0x2025a2+0x1)['trim']();if(_0x11e0a5['length']>0x0){_0x522618[_0x11e0a5]=_0x3318a3;}}else{}_0x51c3ba++;}this[_0x8566('0xe')](_0x8566('0xf'),_0x522618);this[_0x8566('0x5')]=!![];}_0x4045ed++;}this[_0x8566('0x4')]=_0x4cbf90;}else{while((_0x2ffec4=_0x4cbf90[_0x8566('0xd')](_0x4885d6))!=-0x1){_0x555ffa=_0x4cbf90['substring'](0x0,_0x2ffec4);this[_0x8566('0xe')](_0x8566('0x10'),_0x555ffa);_0x4cbf90=_0x4cbf90[_0x8566('0xb')](_0x2ffec4+_0x4885d6['length']);}this[_0x8566('0x4')]=_0x4cbf90;}_0x2f958c();};module[_0x8566('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4dc9c71..f5411ab 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 _0x2a3a=['CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','result','catch','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','name','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage'];(function(_0x4d88ce,_0x1d8f5c){var _0x2b8294=function(_0xe35e15){while(--_0xe35e15){_0x4d88ce['push'](_0x4d88ce['shift']());}};_0x2b8294(++_0x1d8f5c);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x3f2824,_0x2cc4d3){_0x3f2824=_0x3f2824-0x0;var _0xd6ec8a=_0x2a3a[_0x3f2824];return _0xd6ec8a;};'use strict';var _=require(_0xa2a3('0x0'));var moment=require(_0xa2a3('0x1'));var jayson=require(_0xa2a3('0x2'));var client=jayson[_0xa2a3('0x3')][_0xa2a3('0x4')]({'port':0x2329});function request(_0x4caf0f,_0x531167){return new Promise(function(_0x45b267,_0x34d7f9){return client[_0xa2a3('0x5')](_0x4caf0f,_0x531167)[_0xa2a3('0x6')](function(_0xb4826a){if(_0xb4826a[_0xa2a3('0x7')]){return _0x34d7f9(_0xb4826a[_0xa2a3('0x7')]['message']);}else{return _0x45b267(_0xb4826a[_0xa2a3('0x8')]);}})[_0xa2a3('0x9')](function(_0x2a3753){return _0x34d7f9(_0x2a3753);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0xa2a3('0xa')]}});};exports[_0xa2a3('0xb')]=function(_0x2877fc){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2877fc},'attributes':[_0xa2a3('0xa')]}});};exports[_0xa2a3('0xc')]=function(_0x3d255c){return request(_0xa2a3('0xd'),{'options':{'raw':![],'where':{'id':_0x3d255c},'include':[{'model':_0xa2a3('0xe'),'as':'Smtp','include':[{'model':_0xa2a3('0xf'),'as':'CloudProvider'}]}],'attributes':['id',_0xa2a3('0x10'),_0xa2a3('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x1bddd1){return request(_0xa2a3('0x12'),{'options':{'where':{'id':_0x1bddd1},'attributes':[_0xa2a3('0x10')]}});};exports[_0xa2a3('0x13')]=function(_0x3ebb1b){return request(_0xa2a3('0x14'),{'options':{'where':{'id':_0x3ebb1b},'attributes':[_0xa2a3('0x10')]}});};exports['getVariableById']=function(_0xe91715){return request(_0xa2a3('0x15'),{'options':{'where':{'id':_0xe91715},'attributes':['name']}});};exports[_0xa2a3('0x16')]=function(_0x239716){return request(_0xa2a3('0x17'),{'options':{'where':{'id':_0x239716},'attributes':[_0xa2a3('0x18')]}});};exports[_0xa2a3('0x19')]=function(_0x5f25db){return request(_0xa2a3('0x1a'),{'options':{'where':{'id':_0x5f25db},'attributes':[_0xa2a3('0x10')]}});};exports[_0xa2a3('0x1b')]=function(_0x4a04c4){return request(_0xa2a3('0x1c'),{'options':{'where':{'phone':_0x4a04c4[_0xa2a3('0x1d')]},'attributes':['id']}});};exports[_0xa2a3('0x1e')]=function(_0x32c207){return request(_0xa2a3('0x1f'),{'options':{'where':{'id':_0x32c207},'attributes':[_0xa2a3('0x10')]}});};exports['getSoundById']=function(_0x40a787){return request(_0xa2a3('0x20'),{'options':{'where':{'id':_0x40a787},'attributes':[_0xa2a3('0x21')]}});};exports['getIntervalById']=function(_0x34d848){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x34d848},'include':[{'model':_0xa2a3('0x22'),'as':_0xa2a3('0x23')}]}});};exports[_0xa2a3('0x24')]=function(_0x1ce1f3){return request(_0xa2a3('0x25'),{'options':{'where':{'id':_0x1ce1f3},'attributes':['id',_0xa2a3('0x10')]}});};exports['createSmsMessage']=function(_0x419d77){return request(_0xa2a3('0x26'),{'body':_0x419d77});};exports[_0xa2a3('0x27')]=function(_0x314458){return request(_0xa2a3('0x28'),{'body':_0x314458});};exports[_0xa2a3('0x29')]=function(_0x414d74){return request(_0xa2a3('0x2a'),{'body':_['merge'](_0x414d74,{'project_name':_0x414d74[_0xa2a3('0x2b')],'prev_project_name':_0x414d74['arg_2']||'','is_subproject':_0x414d74[_0xa2a3('0x2c')]?!![]:![],'leaveAt':moment()[_0xa2a3('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xa2a3('0x2e')]=function(_0x2edd1e){return request(_0xa2a3('0x2f'),{'body':_0x2edd1e});};exports[_0xa2a3('0x30')]=function(_0x16d5c0){return request(_0xa2a3('0x31'),{'body':_0x16d5c0});};exports[_0xa2a3('0x32')]=function(_0x1ad382){return request(_0xa2a3('0x33'),{'options':{'raw':![],'where':{'phone':_0x1ad382[_0xa2a3('0x1d')],'ListId':_0x1ad382[_0xa2a3('0x34')]}}})['then'](function(_0x1a5d36){if(_0x1a5d36){return _0x1a5d36;}return request('CreateCmContact',{'body':_0x1ad382});});};exports[_0xa2a3('0x35')]=function(_0x19d6c8){return request(_0xa2a3('0x36'),{'options':{'where':{'id':_0x19d6c8},'attributes':[_0xa2a3('0x10')]}});};exports[_0xa2a3('0x37')]=function(_0x1e7bfd,_0x15f212){return request(_0xa2a3('0x38'),{'body':{'interface':_0x15f212},'options':{'where':_0x1e7bfd}});};exports[_0xa2a3('0x39')]=function(_0x504197,_0x34a3f7,_0x4fe4dc){return request(_0xa2a3('0x3a'),{'body':{'type':_0x34a3f7,'uniqueid':_0x4fe4dc},'options':{'where':_0x504197}});};exports[_0xa2a3('0x3b')]=function(_0x7060d1){return request('UnpauseUser',{'body':{},'options':{'where':_0x7060d1}});};exports[_0xa2a3('0x3c')]=function(_0x4a16ee){return request(_0xa2a3('0x3d'),{'body':{},'options':{'where':_0x4a16ee}});}; \ No newline at end of file +var _0xe829=['getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','request','then','error','message','result','catch','getSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact'];(function(_0x18a5a9,_0x4e6c02){var _0x3796ba=function(_0x2bde35){while(--_0x2bde35){_0x18a5a9['push'](_0x18a5a9['shift']());}};_0x3796ba(++_0x4e6c02);}(_0xe829,0x1d8));var _0x9e82=function(_0xec722a,_0x354472){_0xec722a=_0xec722a-0x0;var _0xbb0f9e=_0xe829[_0xec722a];return _0xbb0f9e;};'use strict';var _=require(_0x9e82('0x0'));var moment=require(_0x9e82('0x1'));var jayson=require(_0x9e82('0x2'));var client=jayson['client']['http']({'port':0x2329});function request(_0xf56525,_0x337730){return new Promise(function(_0x1b47d8,_0x168d3e){return client[_0x9e82('0x3')](_0xf56525,_0x337730)[_0x9e82('0x4')](function(_0x580d41){if(_0x580d41[_0x9e82('0x5')]){return _0x168d3e(_0x580d41[_0x9e82('0x5')][_0x9e82('0x6')]);}else{return _0x1b47d8(_0x580d41[_0x9e82('0x7')]);}})[_0x9e82('0x8')](function(_0x5c4c57){return _0x168d3e(_0x5c4c57);});});}exports[_0x9e82('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x9e82('0xa'),_0x9e82('0xb')]}});};exports['getSquareProject']=function(_0x5965b0){return request(_0x9e82('0xc'),{'options':{'raw':![],'where':{'name':_0x5965b0},'attributes':[_0x9e82('0xb')]}});};exports[_0x9e82('0xd')]=function(_0x378f5c){return request(_0x9e82('0xe'),{'options':{'raw':![],'where':{'id':_0x378f5c},'include':[{'model':_0x9e82('0xf'),'as':_0x9e82('0x10'),'include':[{'model':_0x9e82('0x11'),'as':_0x9e82('0x11')}]}],'attributes':['id',_0x9e82('0xa'),_0x9e82('0x12')],'smtp':!![]}});};exports[_0x9e82('0x13')]=function(_0x5e0c79){return request('ShowSquareProject',{'options':{'where':{'id':_0x5e0c79},'attributes':[_0x9e82('0xa')]}});};exports[_0x9e82('0x14')]=function(_0x202d99){return request(_0x9e82('0x15'),{'options':{'where':{'id':_0x202d99},'attributes':['name']}});};exports[_0x9e82('0x16')]=function(_0xfa4802){return request(_0x9e82('0x17'),{'options':{'where':{'id':_0xfa4802},'attributes':[_0x9e82('0xa')]}});};exports['getSquareOdbcById']=function(_0x11b7ea){return request(_0x9e82('0x18'),{'options':{'where':{'id':_0x11b7ea},'attributes':[_0x9e82('0x19')]}});};exports[_0x9e82('0x1a')]=function(_0x50b85c){return request('ShowUser',{'options':{'where':{'id':_0x50b85c},'attributes':['name']}});};exports[_0x9e82('0x1b')]=function(_0x2de033){return request(_0x9e82('0x1c'),{'options':{'where':{'phone':_0x2de033[_0x9e82('0x1d')]},'attributes':['id']}});};exports[_0x9e82('0x1e')]=function(_0x4dce73){return request(_0x9e82('0x1f'),{'options':{'where':{'id':_0x4dce73},'attributes':[_0x9e82('0xa')]}});};exports[_0x9e82('0x20')]=function(_0x199984){return request('ShowSound',{'options':{'where':{'id':_0x199984},'attributes':['save_name']}});};exports[_0x9e82('0x21')]=function(_0x2c37ad){return request(_0x9e82('0x22'),{'options':{'raw':![],'where':{'id':_0x2c37ad},'include':[{'model':_0x9e82('0x23'),'as':_0x9e82('0x24')}]}});};exports[_0x9e82('0x25')]=function(_0x53d6a0){return request(_0x9e82('0x26'),{'options':{'where':{'id':_0x53d6a0},'attributes':['id',_0x9e82('0xa')]}});};exports[_0x9e82('0x27')]=function(_0x3eb596){return request(_0x9e82('0x28'),{'body':_0x3eb596});};exports['createSquareDetailsReport']=function(_0x21519d){return request('CreateSquareDetailsReport',{'body':_0x21519d});};exports[_0x9e82('0x29')]=function(_0x4d3bbb){return request(_0x9e82('0x2a'),{'body':_[_0x9e82('0x2b')](_0x4d3bbb,{'project_name':_0x4d3bbb[_0x9e82('0x2c')],'prev_project_name':_0x4d3bbb[_0x9e82('0x2d')]||'','is_subproject':_0x4d3bbb[_0x9e82('0x2d')]?!![]:![],'leaveAt':moment()[_0x9e82('0x2e')](_0x9e82('0x2f'))})});};exports[_0x9e82('0x30')]=function(_0xbcc412){return request(_0x9e82('0x31'),{'body':_0xbcc412});};exports[_0x9e82('0x32')]=function(_0x523a11){return request(_0x9e82('0x33'),{'body':_0x523a11});};exports[_0x9e82('0x34')]=function(_0x221ac0){return request(_0x9e82('0x35'),{'options':{'raw':![],'where':{'phone':_0x221ac0[_0x9e82('0x1d')],'ListId':_0x221ac0[_0x9e82('0x36')]}}})[_0x9e82('0x4')](function(_0x1b0c8b){if(_0x1b0c8b){return _0x1b0c8b;}return request(_0x9e82('0x37'),{'body':_0x221ac0});});};exports[_0x9e82('0x38')]=function(_0x3c67d8){return request(_0x9e82('0x39'),{'options':{'where':{'id':_0x3c67d8},'attributes':[_0x9e82('0xa')]}});};exports[_0x9e82('0x3a')]=function(_0x5040a2,_0x4bf8b7){return request(_0x9e82('0x3b'),{'body':{'interface':_0x4bf8b7},'options':{'where':_0x5040a2}});};exports[_0x9e82('0x3c')]=function(_0xd5ce64,_0x32a2d2,_0x133b48){return request(_0x9e82('0x3d'),{'body':{'type':_0x32a2d2,'uniqueid':_0x133b48},'options':{'where':_0xd5ce64}});};exports[_0x9e82('0x3e')]=function(_0x5d357f){return request(_0x9e82('0x3f'),{'body':{},'options':{'where':_0x5d357f}});};exports[_0x9e82('0x40')]=function(_0x5d1654){return request(_0x9e82('0x41'),{'body':{},'options':{'where':_0x5d1654}});}; \ 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 6ba09fe..6959ae1 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 _0x5fc3=['./polly','./lex'];(function(_0x15fb82,_0x2c148f){var _0x33e9cb=function(_0x52e2c9){while(--_0x52e2c9){_0x15fb82['push'](_0x15fb82['shift']());}};_0x33e9cb(++_0x2c148f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x5fc3[_0x303c30];return _0x43161b;};var polly=require(_0x35fc('0x0'));var lex=require(_0x35fc('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4677=['exports','./polly'];(function(_0x5ca259,_0x145448){var _0x30d5d8=function(_0x3a0a32){while(--_0x3a0a32){_0x5ca259['push'](_0x5ca259['shift']());}};_0x30d5d8(++_0x145448);}(_0x4677,0x155));var _0x7467=function(_0x69f3d7,_0x5e91c1){_0x69f3d7=_0x69f3d7-0x0;var _0x2dce0b=_0x4677[_0x69f3d7];return _0x2dce0b;};var polly=require(_0x7467('0x0'));var lex=require('./lex');module[_0x7467('0x1')]={'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 a7dda98..7f81adb 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 _0xa571=['exports','./lib/api'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa571,0x107));var _0x1a57=function(_0x48ce56,_0x213bea){_0x48ce56=_0x48ce56-0x0;var _0x25e8a1=_0xa571[_0x48ce56];return _0x25e8a1;};'use strict';var lex=require(_0x1a57('0x0'));module[_0x1a57('0x1')]=function(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a){return lex(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a);}; \ No newline at end of file +var _0x96cc=['./lib/api'];(function(_0x1dbfa4,_0x500677){var _0x23f447=function(_0x58dc2f){while(--_0x58dc2f){_0x1dbfa4['push'](_0x1dbfa4['shift']());}};_0x23f447(++_0x500677);}(_0x96cc,0x16c));var _0xc96c=function(_0x3efe28,_0x2870fc){_0x3efe28=_0x3efe28-0x0;var _0x54d927=_0x96cc[_0x3efe28];return _0x54d927;};'use strict';var lex=require(_0xc96c('0x0'));module['exports']=function(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701){return lex(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701);}; \ 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 94c9bd8..d203394 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(_0x332e0e,_0x4fc5bf){var _0x107bfc=function(_0x354460){while(--_0x354460){_0x332e0e['push'](_0x332e0e['shift']());}};_0x107bfc(++_0x4fc5bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x89db4a,_0x1b0ff6){var _0x45957b=function(_0x15c1d1){while(--_0x15c1d1){_0x89db4a['push'](_0x89db4a['shift']());}};_0x45957b(++_0x1b0ff6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 ffaf0a8..4ef793d 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 _0x1a2a=['./lib/api','exports'];(function(_0xba7139,_0x46a55a){var _0xcc1790=function(_0x2cff74){while(--_0x2cff74){_0xba7139['push'](_0xba7139['shift']());}};_0xcc1790(++_0x46a55a);}(_0x1a2a,0xa4));var _0xa1a2=function(_0x11ecea,_0xac684e){_0x11ecea=_0x11ecea-0x0;var _0x3c033b=_0x1a2a[_0x11ecea];return _0x3c033b;};'use strict';var polly=require(_0xa1a2('0x0'));module[_0xa1a2('0x1')]=function(_0x2a2440,_0x4b1526,_0x34c10c,_0x43b5dc,_0x155d31,_0x55984b,_0x29cdf5){return polly(_0x2a2440,_0x4b1526,_0x34c10c,_0x43b5dc,_0x155d31,_0x55984b,_0x29cdf5);}; \ No newline at end of file +var _0x2747=['./lib/api','exports'];(function(_0xee2bb3,_0x307f91){var _0x26d192=function(_0x4726eb){while(--_0x4726eb){_0xee2bb3['push'](_0xee2bb3['shift']());}};_0x26d192(++_0x307f91);}(_0x2747,0x124));var _0x7274=function(_0x4171a8,_0x2309d6){_0x4171a8=_0x4171a8-0x0;var _0x41e768=_0x2747[_0x4171a8];return _0x41e768;};'use strict';var polly=require(_0x7274('0x0'));module[_0x7274('0x1')]=function(_0x3198f8,_0x5e15ac,_0x2999cb,_0xff3695,_0x368e50,_0x37a17b,_0x2be6fb){return polly(_0x3198f8,_0x5e15ac,_0x2999cb,_0xff3695,_0x368e50,_0x37a17b,_0x2be6fb);}; \ 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 1962a9c..2936e36 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 _0x76f1=['aws-sdk','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','bluebird'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0x76f1,0x14f));var _0x176f=function(_0x552f19,_0x31142a){_0x552f19=_0x552f19-0x0;var _0x45dced=_0x76f1[_0x552f19];return _0x45dced;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x176f('0x0'));var rs=require('randomstring');var AWS=require(_0x176f('0x1'));function pollyResult(_0x4bdc98,_0x2a0b29,_0x5aa2fc){return new BPromise(function(_0x58b3aa,_0x253450){_0x4bdc98['synthesizeSpeech'](_0x2a0b29,function(_0x4b274c,_0x1d8cf2){if(_0x4b274c){_0x253450(_0x4b274c);}else if(_0x1d8cf2){if(_0x1d8cf2['AudioStream']instanceof Buffer){fs[_0x176f('0x2')](_0x5aa2fc,_0x1d8cf2[_0x176f('0x3')],function(_0x260af0){if(_0x260af0){_0x253450(_0x260af0);}else{_0x58b3aa();}});}else{_0x253450(new Error(_0x176f('0x4')));}}else{_0x253450(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x176f('0x5')]=function(_0x185fe5,_0x2fdde7,_0x2dc0f9,_0x2b95b,_0x3a5bf7,_0x3e9e5d,_0x4180a1){var _0x2a8534=new AWS[(_0x176f('0x6'))]({'accessKeyId':_0x185fe5,'secretAccessKey':_0x2fdde7,'region':_0x2dc0f9});var _0x1a5927={'Text':_0x3a5bf7,'TextType':_0x3e9e5d||'text','OutputFormat':'mp3','VoiceId':_0x2b95b};return pollyResult(_0x2a8534,_0x1a5927,_0x4180a1);}; \ No newline at end of file +var _0x6c31=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream'];(function(_0xcb8fef,_0x32565c){var _0x41d48c=function(_0x5e4a2b){while(--_0x5e4a2b){_0xcb8fef['push'](_0xcb8fef['shift']());}};_0x41d48c(++_0x32565c);}(_0x6c31,0x16f));var _0x16c3=function(_0x1bffc9,_0x505bf0){_0x1bffc9=_0x1bffc9-0x0;var _0x26177e=_0x6c31[_0x1bffc9];return _0x26177e;};'use strict';var fs=require('fs');var path=require(_0x16c3('0x0'));var BPromise=require(_0x16c3('0x1'));var rs=require(_0x16c3('0x2'));var AWS=require(_0x16c3('0x3'));function pollyResult(_0xb5c78d,_0x504a70,_0x288976){return new BPromise(function(_0x312ef5,_0xfbac02){_0xb5c78d['synthesizeSpeech'](_0x504a70,function(_0x4a9e49,_0x4fc4e3){if(_0x4a9e49){_0xfbac02(_0x4a9e49);}else if(_0x4fc4e3){if(_0x4fc4e3[_0x16c3('0x4')]instanceof Buffer){fs[_0x16c3('0x5')](_0x288976,_0x4fc4e3['AudioStream'],function(_0xe60cd6){if(_0xe60cd6){_0xfbac02(_0xe60cd6);}else{_0x312ef5();}});}else{_0xfbac02(new Error(_0x16c3('0x6')));}}else{_0xfbac02(new Error(_0x16c3('0x7')));}});});}module[_0x16c3('0x8')]=function(_0x34f717,_0x4b78d4,_0x3b7ea1,_0x21a404,_0x49854f,_0x46de61,_0x57ca85){var _0x25c31a=new AWS[(_0x16c3('0x9'))]({'accessKeyId':_0x34f717,'secretAccessKey':_0x4b78d4,'region':_0x3b7ea1});var _0x32ec86={'Text':_0x49854f,'TextType':_0x46de61||_0x16c3('0xa'),'OutputFormat':_0x16c3('0xb'),'VoiceId':_0x21a404};return pollyResult(_0x25c31a,_0x32ec86,_0x57ca85);}; \ 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 a51b3d9..32dae0a 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 _0x7636=['./lib/api','exports'];(function(_0x160dbd,_0x31a6f9){var _0x83a034=function(_0x3bf94f){while(--_0x3bf94f){_0x160dbd['push'](_0x160dbd['shift']());}};_0x83a034(++_0x31a6f9);}(_0x7636,0x6e));var _0x6763=function(_0xc29e65,_0x7f1e9e){_0xc29e65=_0xc29e65-0x0;var _0x36240d=_0x7636[_0xc29e65];return _0x36240d;};'use strict';var asr=require(_0x6763('0x0'));module[_0x6763('0x1')]=function(_0x41f925,_0x11f3fd,_0x2857d2,_0x431e55){return asr(_0x41f925,_0x11f3fd,_0x2857d2);}; \ No newline at end of file +var _0x4ff5=['./lib/api','exports'];(function(_0x55e024,_0x41bb5f){var _0x340969=function(_0x422b54){while(--_0x422b54){_0x55e024['push'](_0x55e024['shift']());}};_0x340969(++_0x41bb5f);}(_0x4ff5,0x10a));var _0x54ff=function(_0x3e810a,_0x16b5ca){_0x3e810a=_0x3e810a-0x0;var _0x3e1d8e=_0x4ff5[_0x3e810a];return _0x3e1d8e;};'use strict';var asr=require(_0x54ff('0x0'));module[_0x54ff('0x1')]=function(_0x9df8eb,_0x3d7bea,_0xda800d,_0x3df58a){return asr(_0x9df8eb,_0x3d7bea,_0xda800d);}; \ 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 ffedad5..7aa9967 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 _0x34e5=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','base64','POST','LINEAR16','8000','bluebird','exports','string','length'];(function(_0x532f8c,_0xd61d13){var _0x1d333f=function(_0x1e50f3){while(--_0x1e50f3){_0x532f8c['push'](_0x532f8c['shift']());}};_0x1d333f(++_0xd61d13);}(_0x34e5,0x172));var _0x534e=function(_0x3273ff,_0x4abd5c){_0x3273ff=_0x3273ff-0x0;var _0x16ca39=_0x34e5[_0x3273ff];return _0x16ca39;};'use strict';var url=require('url');var BPromise=require(_0x534e('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x534e('0x1')]=function(_0x467e3e,_0x425ae8,_0x246650){return new BPromise(function(_0x83eb2d,_0x50b790){var _0x11a158;if(typeof _0x467e3e!==_0x534e('0x2')||_0x467e3e[_0x534e('0x3')]===0x0){return _0x50b790(_0x534e('0x4'));}if(typeof _0x425ae8!==_0x534e('0x2')||_0x425ae8[_0x534e('0x3')]===0x0){return _0x50b790(_0x534e('0x5'));}if(typeof _0x246650!=='undefined'&&(typeof _0x246650!==_0x534e('0x2')||_0x246650[_0x534e('0x3')]===0x0)){return _0x50b790(_0x534e('0x6'));}try{_0x11a158=fs['readFileSync'](_0x467e3e)['toString'](_0x534e('0x7'));}catch(_0x4c495c){return _0x50b790(_0x4c495c);}return _0x83eb2d({'method':_0x534e('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x425ae8,'body':{'config':{'encoding':_0x534e('0x9'),'sampleRateHertz':_0x534e('0xa'),'languageCode':_0x246650},'audio':{'content':_0x11a158}},'json':!![]});});}; \ No newline at end of file +var _0xdb4b=['lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x3a615e,_0x4da265){var _0x407774=function(_0x24b547){while(--_0x24b547){_0x3a615e['push'](_0x3a615e['shift']());}};_0x407774(++_0x4da265);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x245e9c,_0x3846b6){_0x245e9c=_0x245e9c-0x0;var _0x423cb0=_0xdb4b[_0x245e9c];return _0x423cb0;};'use strict';var url=require('url');var BPromise=require(_0xbdb4('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xbdb4('0x1')]=function(_0x883c71,_0x3d5174,_0x257d67){return new BPromise(function(_0x47a78c,_0x3cc8c2){var _0x40e5ca;if(typeof _0x883c71!==_0xbdb4('0x2')||_0x883c71[_0xbdb4('0x3')]===0x0){return _0x3cc8c2(_0xbdb4('0x4'));}if(typeof _0x3d5174!==_0xbdb4('0x2')||_0x3d5174[_0xbdb4('0x3')]===0x0){return _0x3cc8c2('key\x20should\x20be\x20a\x20string');}if(typeof _0x257d67!=='undefined'&&(typeof _0x257d67!==_0xbdb4('0x2')||_0x257d67[_0xbdb4('0x3')]===0x0)){return _0x3cc8c2(_0xbdb4('0x5'));}try{_0x40e5ca=fs[_0xbdb4('0x6')](_0x883c71)['toString'](_0xbdb4('0x7'));}catch(_0x5ba9f8){return _0x3cc8c2(_0x5ba9f8);}return _0x47a78c({'method':_0xbdb4('0x8'),'uri':host+_0xbdb4('0x9')+_0x3d5174,'body':{'config':{'encoding':_0xbdb4('0xa'),'sampleRateHertz':'8000','languageCode':_0x257d67},'audio':{'content':_0x40e5ca}},'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 377a50f..a4aeed9 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 _0x7131=['./asr','exports'];(function(_0x4d76ea,_0x2ba723){var _0x341376=function(_0x4556fe){while(--_0x4556fe){_0x4d76ea['push'](_0x4d76ea['shift']());}};_0x341376(++_0x2ba723);}(_0x7131,0x92));var _0x1713=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7131[_0x40a045];return _0x1a687c;};var asr=require(_0x1713('0x0'));module[_0x1713('0x1')]={'asr':asr}; \ No newline at end of file +var _0x71dd=['exports'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x71dd,0x152));var _0xd71d=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0x71dd[_0x369a98];return _0x29565c;};var asr=require('./asr');module[_0xd71d('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 5c35e82..d430661 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 _0xc58d=['chmodSync','split','toString','base64','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','then','tmp','generate','.mp3','from','audioContent','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','source','result','resolvedQuery','action','fulfillment','score','status','code','metadata','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','bluebird','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./tilde','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','finish\x20download\x20file','close','error','pipe','end','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','unlink'];(function(_0x112184,_0x2bcd22){var _0x4b4f90=function(_0xa085c4){while(--_0xa085c4){_0x112184['push'](_0x112184['shift']());}};_0x4b4f90(++_0x2bcd22);}(_0xc58d,0x1dd));var _0xdc58=function(_0x58c36f,_0xa0c850){_0x58c36f=_0x58c36f-0x0;var _0xbe7c41=_0xc58d[_0x58c36f];return _0xbe7c41;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xdc58('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0xdc58('0x1'));var md5=require(_0xdc58('0x2'));var path=require(_0xdc58('0x3'));var querystring=require('querystring');var rp=require(_0xdc58('0x4'));var rs=require(_0xdc58('0x5'));var sox=require(_0xdc58('0x6'));var tts=require(_0xdc58('0x7'));var urlParse=require(_0xdc58('0x8'))[_0xdc58('0x9')];var util=require('util');var aws=require(_0xdc58('0xa'));var google=require(_0xdc58('0xb'));var sestek=require('./sestek');var tilde=require(_0xdc58('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xdc58('0xd');function downloadFile(_0x289ffa,_0x708f6f){return new BPromise(function(_0x56ac35,_0x2a0b7c){var _0x29e431=urlParse(_0x289ffa);var _0x523527=_0x29e431[_0xdc58('0xe')]===_0xdc58('0xf')?https:http;var _0x4a2e5d={'host':_0x29e431[_0xdc58('0x10')],'path':_0x29e431['path'],'headers':{'user-agent':_0xdc58('0x11')}};_0x523527[_0xdc58('0x12')](_0x4a2e5d,function(_0x50d886){if(_0x50d886[_0xdc58('0x13')]!==0xc8){logger['error']('request\x20to\x20'+_0x289ffa+'\x20failed,\x20status\x20code\x20=\x20'+_0x50d886[_0xdc58('0x13')]+'\x20('+_0x50d886[_0xdc58('0x14')]+')');_0x2a0b7c(new Error(_0xdc58('0x15')+_0x289ffa+_0xdc58('0x16')+_0x50d886[_0xdc58('0x13')]+'\x20('+_0x50d886[_0xdc58('0x14')]+')'));return;}var _0x5a3415=fs[_0xdc58('0x17')](_0x708f6f);_0x5a3415['on']('finish',function(){logger[_0xdc58('0x18')](_0xdc58('0x19'));_0x5a3415[_0xdc58('0x1a')](_0x56ac35);});_0x5a3415['on'](_0xdc58('0x1b'),function(_0x1232e9){fs['unlink'](_0x708f6f);logger[_0xdc58('0x1b')]('download\x20error',_0x1232e9);_0x2a0b7c(_0x1232e9);});_0x50d886[_0xdc58('0x1c')](_0x5a3415);})['on']('error',function(_0x2542af){logger[_0xdc58('0x1b')](_0x2542af);_0x2a0b7c(_0x2542af);})[_0xdc58('0x1d')]();});}function uploadFile(_0x5aa2a4){return new BPromise(function(_0xce8f7b,_0x28a879){var _0x4d79c9=urlParse(_0x5aa2a4);var _0x4e503e=_0x4d79c9[_0xdc58('0xe')]===_0xdc58('0xf')?https:http;var _0x4eef68={'host':_0x4d79c9[_0xdc58('0x10')],'path':_0x4d79c9[_0xdc58('0x3')],'headers':{'user-agent':_0xdc58('0x11')}};_0x4e503e[_0xdc58('0x12')](_0x4eef68,function(_0x345a62){if(_0x345a62[_0xdc58('0x13')]!==0xc8){_0x28a879(new Error(_0xdc58('0x15')+_0x5aa2a4+_0xdc58('0x16')+_0x345a62[_0xdc58('0x13')]+'\x20('+_0x345a62['statusMessage']+')'));return;}var _0x1257d3='';_0x345a62['on'](_0xdc58('0x1e'),function(_0x4dba27){_0x1257d3+=_0x4dba27;});_0x345a62['on'](_0xdc58('0x1d'),function(){_0xce8f7b(_0x1257d3);});})['on'](_0xdc58('0x1b'),function(_0x139bc1){_0x28a879(_0x139bc1);})[_0xdc58('0x1d')]();});}function convertFile(_0x31c625,_0x3c78b7){return new BPromise(function(_0xc7584b,_0x50ec3d){var _0x995d17=sox['transcode'](_0x31c625,_0x3c78b7,{'sampleRate':0x1f40,'format':_0xdc58('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x995d17['on'](_0xdc58('0x1b'),function(_0x327d9a){logger[_0xdc58('0x1b')](_0xdc58('0x20'),_0x327d9a);_0x50ec3d(_0x327d9a);});_0x995d17['on'](_0xdc58('0x1d'),function(){logger[_0xdc58('0x18')](_0xdc58('0x21'));_0xc7584b();});_0x995d17[_0xdc58('0x22')]();});}function base64Decode(_0x1c5a54,_0x3c5c0f){var _0x517920=path[_0xdc58('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0xdc58('0x24'));fs[_0xdc58('0x25')](_0x517920,_0x1c5a54,'base64');return convertFile(_0x517920,_0x3c5c0f)['then'](function(){try{fs[_0xdc58('0x26')](_0x517920);fs[_0xdc58('0x27')](_0x3c5c0f,'777');}catch(_0x21da29){logger[_0xdc58('0x1b')](_0x21da29);}return _0x3c5c0f[_0xdc58('0x28')]('.')[0x0];});}function base64Encode(_0x64e520){var _0x2514de=fs['readFileSync'](_0x64e520);return new Buffer(_0x2514de)[_0xdc58('0x29')](_0xdc58('0x2a'));}exports['googleCloudTTS']=function(_0x346fe0,_0x354a6f,_0x328e1a,_0xbeaa48,_0x3628b1,_0x9f3b0a){var _0x32897c,_0x367045;var _0x2abeac='https://texttospeech.googleapis.com/v1/';var _0x5d12ba=_0xdc58('0x2b')+_0x346fe0;var _0x1fc8c1={};if(_0x354a6f==='ssml'){_0x1fc8c1[_0xdc58('0x2c')]={'ssml':_0x328e1a};}else{_0x1fc8c1[_0xdc58('0x2c')]={'text':_0x328e1a};};_0x1fc8c1[_0xdc58('0x2d')]={'languageCode':_0xbeaa48,'ssmlGender':_0x3628b1};_0x1fc8c1[_0xdc58('0x2e')]={'audioEncoding':_0xdc58('0x2f'),'sampleRateHertz':0x1f40};var _0x275bd1={'url':_0x2abeac+_0xdc58('0x30')+_0x5d12ba,'method':_0xdc58('0x31'),'json':!![],'body':_0x1fc8c1};return rp(_0x275bd1)[_0xdc58('0x32')](function(_0x5d6352){return new BPromise(function(_0x52f368,_0x4a654b){_0x32897c=path[_0xdc58('0x23')](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+_0xdc58('0x35'));var _0x343bb5=Buffer[_0xdc58('0x36')](_0x5d6352[_0xdc58('0x37')],_0xdc58('0x2a'));return fs['writeFile'](_0x32897c,_0x343bb5,function(_0x25e06f){_0x4a654b(_0x25e06f);},function(_0x42f98e){fs[_0xdc58('0x27')](_0x32897c,_0xdc58('0x38'));_0x52f368(_0x42f98e);});});})[_0xdc58('0x32')](function(_0x3a6687){_0x367045=path[_0xdc58('0x23')](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+_0xdc58('0x24'));return convertFile(_0x32897c,_0x367045);})[_0xdc58('0x32')](function(){try{fs[_0xdc58('0x26')](_0x32897c);fs[_0xdc58('0x27')](_0x367045,'777');}catch(_0x661c17){logger['error'](_0x661c17);}logger[_0xdc58('0x18')](_0xdc58('0x39'),_0x367045[_0xdc58('0x28')]('.')[0x0]);return _0x367045[_0xdc58('0x28')]('.')[0x0];});};exports[_0xdc58('0x3a')]=function(_0x497354,_0x20db20){var _0x386d7d=_0xdc58('0x3b');var _0x5af4f1,_0x4db19e;var _0x3f9f22;var _0x7a8329={'encoding':_0xdc58('0x3c'),'method':'POST','timeout':0x2710,'url':_0x386d7d,'headers':{'Content-Type':_0xdc58('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0xdc58('0x3e')]([[[_0xdc58('0x3f'),JSON['stringify']([_0x497354,_0x20db20||'en',![],'null']),null,'generic']]]))};return rp(_0x7a8329)[_0xdc58('0x32')](function(_0x3787d8){try{_0x3f9f22=eval(_0x3787d8[_0xdc58('0x40')](0x5))[0x0][0x2];}catch(_0x102867){throw new Error(_0xdc58('0x41')+_0x3787d8[_0xdc58('0x1e')]);}if(!_0x3f9f22){if(_0x497354['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xdc58('0x42')+_0x20db20+_0xdc58('0x43'));}}try{_0x3f9f22=eval(_0x3f9f22)[0x0];}catch(_0x1f48ce){throw new Error(_0xdc58('0x41')+res[_0xdc58('0x1e')]);}const _0x2b59c0=_0x3f9f22;_0x5af4f1=path[_0xdc58('0x23')](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+_0xdc58('0x35'));fs[_0xdc58('0x25')](_0x5af4f1,_0x3f9f22,{'encoding':_0xdc58('0x2a')});_0x4db19e=path[_0xdc58('0x23')](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+_0xdc58('0x24'));return convertFile(_0x5af4f1,_0x4db19e);})['then'](function(){try{fs[_0xdc58('0x26')](_0x5af4f1);fs[_0xdc58('0x27')](_0x4db19e,_0xdc58('0x38'));}catch(_0x17df1e){logger[_0xdc58('0x1b')](_0x17df1e);}logger[_0xdc58('0x18')](_0xdc58('0x44'),_0x4db19e['split']('.')[0x0]);return _0x4db19e[_0xdc58('0x28')]('.')[0x0];});};exports[_0xdc58('0x45')]=function(_0x3aa9a3,_0x17c21b,_0x2e9a35){return google[_0xdc58('0x46')](_0x3aa9a3,_0x17c21b,_0x2e9a35)[_0xdc58('0x32')](function(_0x2c7911){logger['info'](_0x2c7911[_0xdc58('0x47')]);return rp(_0x2c7911);})['then'](function(_0x3e553c){var _0x37a74b='';var _0x7c4e5d=0x0;try{fs[_0xdc58('0x26')](_0x3aa9a3);}catch(_0x3b1445){logger[_0xdc58('0x1b')](_0x3b1445);}if(_0x3e553c&&_0x3e553c[_0xdc58('0x48')]){_0x37a74b=_0x3e553c[_0xdc58('0x48')]['map'](function(_0xfaffa6){return _0xfaffa6&&_0xfaffa6['alternatives'][0x0]&&_0xfaffa6['alternatives'][0x0]['transcript']?_0xfaffa6['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x7c4e5d=_0x3e553c['results'][_0xdc58('0x49')](function(_0x1f5965){return _0x1f5965&&_0x1f5965[_0xdc58('0x4a')][0x0]&&_0x1f5965['alternatives'][0x0][_0xdc58('0x4b')]?_0x1f5965[_0xdc58('0x4a')][0x0][_0xdc58('0x4b')]:0x0;})['join']('\x0a');}logger['info']('googleASR\x20transcription',_0x37a74b);logger['info'](_0xdc58('0x4c'),_0x7c4e5d);return{'transcript':_0x37a74b,'confidence':_0x7c4e5d};})[_0xdc58('0x4d')](function(_0x3331cc){logger['error'](_0xdc58('0x4e'),_0x3331cc['statusCode'],_0x3331cc[_0xdc58('0x4f')],_0x3331cc['message']);});};exports[_0xdc58('0x50')]=function(_0x4c6c15,_0xe4717,_0x17d164,_0x3a9c65){var _0x5ed60c=apiai(_0xe4717,{'language':_0x3a9c65||'en'});return _0x5ed60c[_0xdc58('0x51')](_0x17d164,{'sessionId':md5(_0x4c6c15)})[_0xdc58('0x32')](function(_0x294f07){logger['info'](JSON[_0xdc58('0x3e')](_0x294f07));return{'source':_0x294f07['result'][_0xdc58('0x52')],'resolvedQuery':_0x294f07[_0xdc58('0x53')][_0xdc58('0x54')],'action':_0x294f07[_0xdc58('0x53')][_0xdc58('0x55')],'actionIncomplete':_0x294f07[_0xdc58('0x53')]['actionIncomplete'],'speech':_0x294f07[_0xdc58('0x53')][_0xdc58('0x56')]['speech'],'score':_0x294f07[_0xdc58('0x53')][_0xdc58('0x57')],'statusCode':_0x294f07[_0xdc58('0x58')][_0xdc58('0x59')],'endConversation':_0x294f07['result'][_0xdc58('0x5a')]['endConversation']||![],'isFallbackIntent':_0x294f07[_0xdc58('0x53')][_0xdc58('0x5a')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x1210dc,_0x8f53b8,_0x250bf2,_0x533b87,_0x342c30,_0x30f96d){var _0xe4ae01=_0x533b87[_0xdc58('0x5b')](/\\n/g,'\x0a');var _0x3ebd19={'credentials':{'private_key':_0xe4ae01,'client_email':_0x250bf2}};var _0x12f9cd=new dialogflow[(_0xdc58('0x5c'))](_0x3ebd19);var _0x192c4c=_0x12f9cd[_0xdc58('0x5d')](_0x8f53b8,md5(_0x1210dc));var _0x744c5b={'session':_0x192c4c,'queryInput':{'text':{'text':_0x342c30,'languageCode':_0x30f96d}}};return _0x12f9cd[_0xdc58('0x5e')](_0x744c5b)['then'](function(_0x41627f){if(_0x41627f&&_0x41627f['length']){logger[_0xdc58('0x18')]('Dialogflow\x20V2\x20response:',JSON[_0xdc58('0x3e')](_0x41627f));var _0x4a425f=_0x41627f[0x0];if(_0x4a425f){var _0x5ce950={'action':_0x4a425f['queryResult'][_0xdc58('0x55')],'allRequiredParamsPresent':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x60')],'endConversation':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x61')]&&_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x61')]['fields']?_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x61')]['fields'][_0xdc58('0x62')]['boolValue']:![],'fulfillmentText':_0x4a425f['queryResult'][_0xdc58('0x63')],'intentName':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x64')][_0xdc58('0x4f')],'intentDisplayName':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x64')][_0xdc58('0x65')],'isFallbackIntent':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x64')]['isFallback'],'languageCode':_0x4a425f['queryResult'][_0xdc58('0x66')],'queryText':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x67')],'responseId':_0x4a425f[_0xdc58('0x68')],'score':_0x4a425f['queryResult'][_0xdc58('0x69')],'speech':_0x4a425f[_0xdc58('0x5f')][_0xdc58('0x63')],'providerResponse':JSON[_0xdc58('0x3e')](_0x41627f)};return _0x5ce950;}}});};exports[_0xdc58('0x6a')]=function(_0x22bc34,_0x148a46,_0x721dd9,_0x3b5a41){return tilde['asr'](_0x22bc34,_0x148a46,_0x721dd9,_0x3b5a41)[_0xdc58('0x32')](function(_0x4fedb0){try{fs[_0xdc58('0x26')](_0x22bc34);}catch(_0x14e744){logger[_0xdc58('0x1b')](_0x14e744);}logger[_0xdc58('0x18')](_0xdc58('0x6b'),_0x4fedb0[_0xdc58('0x6c')]);logger['info'](_0xdc58('0x6d'),_0x4fedb0[_0xdc58('0x4b')]);return _0x4fedb0;});};exports[_0xdc58('0x6e')]=function(_0x550b43,_0x3ee5c1,_0x20c038,_0x26c0a8,_0x7c45fd,_0xe8262a){var _0x5c77b5=path['resolve'](__dirname,'tmp',rs[_0xdc58('0x34')](0x4)+'.mp3');var _0x56323;return aws[_0xdc58('0x6f')](_0x550b43,_0x3ee5c1,_0x20c038,_0x26c0a8,_0x7c45fd,_0xe8262a,_0x5c77b5)['then'](function(){_0x56323=path['resolve'](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+'.wav');return convertFile(_0x5c77b5,_0x56323);})['then'](function(){try{fs[_0xdc58('0x26')](_0x5c77b5);fs['chmodSync'](_0x56323,'777');}catch(_0x142bcb){logger['error'](_0x142bcb);}return _0x56323[_0xdc58('0x28')]('.')[0x0];});};exports[_0xdc58('0x70')]=function(_0x2a2def,_0x1c12b9,_0x42c6e2,_0x43f5ea,_0x5eb506,_0x33d2a9){return aws[_0xdc58('0x71')](_0x2a2def,_0x1c12b9,_0x42c6e2,_0x43f5ea,_0x5eb506,_0x33d2a9)[_0xdc58('0x32')](function(_0x5c3468){logger[_0xdc58('0x18')](JSON[_0xdc58('0x3e')](_0x5c3468));return _0x5c3468;});};exports[_0xdc58('0x72')]=function(_0x47d250,_0x141aa8,_0x38348a,_0x2098ed){var _0xa5cca2=util[_0xdc58('0x73')](_0xdc58('0x74'),ISPEECH_API,_0x47d250,encodeURIComponent(_0x141aa8),_0x38348a,_0x2098ed);var _0x136c4a=path[_0xdc58('0x23')](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+_0xdc58('0x35'));var _0x7295d4;return downloadFile(_0xa5cca2,_0x136c4a)[_0xdc58('0x32')](function(){_0x7295d4=path['resolve'](__dirname,'tmp',rs[_0xdc58('0x34')](0x4)+_0xdc58('0x24'));return convertFile(_0x136c4a,_0x7295d4);})[_0xdc58('0x32')](function(){try{fs[_0xdc58('0x26')](_0x136c4a);fs['chmodSync'](_0x7295d4,'777');}catch(_0x1d885d){logger[_0xdc58('0x1b')](_0x1d885d);}return _0x7295d4[_0xdc58('0x28')]('.')[0x0];});};exports['ispeechASR']=function(_0x2e53c8,_0xec9bd2,_0x279438,_0x534aaf){var _0x383cde=util[_0xdc58('0x73')](_0xdc58('0x75'),ISPEECH_API,_0xec9bd2,_0x279438,base64Encode(_0x2e53c8),_0x534aaf?util['format'](_0xdc58('0x76'),encodeURIComponent(_0x534aaf)):_0xdc58('0x77'));return uploadFile(_0x383cde)[_0xdc58('0x32')](function(_0x261580){return querystring[_0xdc58('0x9')](_0x261580);});};exports[_0xdc58('0x78')]=function(_0x125d16,_0x2c9607){return sestek[_0xdc58('0x79')](_0x125d16,_0x2c9607)[_0xdc58('0x32')](function(_0x1b642c){logger[_0xdc58('0x18')](JSON[_0xdc58('0x3e')](_0x1b642c));var _0x5f3ed7={'speech':_0x1b642c[_0xdc58('0x7a')],'action':_0x1b642c[_0xdc58('0x7b')]?_0x1b642c[_0xdc58('0x7b')][_0xdc58('0x7c')]:undefined,'actiondata':_0x1b642c[_0xdc58('0x7b')]?_0x1b642c['channelData']['CustomActionData']:undefined};if(_0x1b642c[_0xdc58('0x7b')]&&_0x1b642c['channelData'][_0xdc58('0x7d')]){return base64Decode(_0x1b642c[_0xdc58('0x7b')][_0xdc58('0x7d')][_0xdc58('0x7e')],path[_0xdc58('0x23')](__dirname,_0xdc58('0x33'),rs[_0xdc58('0x34')](0x4)+'.wav'))[_0xdc58('0x32')](function(_0xe660b){_0x5f3ed7[_0xdc58('0x7f')]=_0xe660b;return _0x5f3ed7;});}return _0x5f3ed7;});};exports[_0xdc58('0x80')]=function(){return __dirname;}; \ No newline at end of file +var _0x09c9=['path','request-promise','randomstring','google-tts-api','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','host','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','end','protocol','https:','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','generate','.mp3','from','base64','writeFile','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','replace','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','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','model=%s','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0x09c9,0x81));var _0x909c=function(_0x56c414,_0x524ac6){_0x56c414=_0x56c414-0x0;var _0x103e21=_0x09c9[_0x56c414];return _0x103e21;};'use strict';var apiai=require(_0x909c('0x0'));var BPromise=require(_0x909c('0x1'));var dialogflow=require(_0x909c('0x2'));var fs=require('fs');var http=require(_0x909c('0x3'));var https=require(_0x909c('0x4'));var md5=require(_0x909c('0x5'));var path=require(_0x909c('0x6'));var querystring=require('querystring');var rp=require(_0x909c('0x7'));var rs=require(_0x909c('0x8'));var sox=require('sox');var tts=require(_0x909c('0x9'));var urlParse=require(_0x909c('0xa'))[_0x909c('0xb')];var util=require(_0x909c('0xc'));var aws=require('./aws');var google=require(_0x909c('0xd'));var sestek=require(_0x909c('0xe'));var tilde=require(_0x909c('0xf'));var logger=require(_0x909c('0x10'))(_0x909c('0x11'));var ISPEECH_API=_0x909c('0x12');function downloadFile(_0x6a8f48,_0x156618){return new BPromise(function(_0x353d24,_0x387f12){var _0x3024e6=urlParse(_0x6a8f48);var _0x41ce6d=_0x3024e6['protocol']==='https:'?https:http;var _0x2e19d8={'host':_0x3024e6[_0x909c('0x13')],'path':_0x3024e6[_0x909c('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x41ce6d[_0x909c('0x14')](_0x2e19d8,function(_0x28f03e){if(_0x28f03e['statusCode']!==0xc8){logger[_0x909c('0x15')](_0x909c('0x16')+_0x6a8f48+_0x909c('0x17')+_0x28f03e[_0x909c('0x18')]+'\x20('+_0x28f03e['statusMessage']+')');_0x387f12(new Error(_0x909c('0x16')+_0x6a8f48+_0x909c('0x17')+_0x28f03e[_0x909c('0x18')]+'\x20('+_0x28f03e[_0x909c('0x19')]+')'));return;}var _0x5347f4=fs[_0x909c('0x1a')](_0x156618);_0x5347f4['on']('finish',function(){logger[_0x909c('0x1b')](_0x909c('0x1c'));_0x5347f4[_0x909c('0x1d')](_0x353d24);});_0x5347f4['on'](_0x909c('0x15'),function(_0x3cc7ad){fs[_0x909c('0x1e')](_0x156618);logger[_0x909c('0x15')]('download\x20error',_0x3cc7ad);_0x387f12(_0x3cc7ad);});_0x28f03e['pipe'](_0x5347f4);})['on'](_0x909c('0x15'),function(_0x499f69){logger[_0x909c('0x15')](_0x499f69);_0x387f12(_0x499f69);})[_0x909c('0x1f')]();});}function uploadFile(_0x755656){return new BPromise(function(_0x2d165c,_0x221413){var _0x2821fd=urlParse(_0x755656);var _0x2f523c=_0x2821fd[_0x909c('0x20')]===_0x909c('0x21')?https:http;var _0x30b8d={'host':_0x2821fd[_0x909c('0x13')],'path':_0x2821fd[_0x909c('0x6')],'headers':{'user-agent':_0x909c('0x22')}};_0x2f523c[_0x909c('0x14')](_0x30b8d,function(_0xc051df){if(_0xc051df[_0x909c('0x18')]!==0xc8){_0x221413(new Error(_0x909c('0x16')+_0x755656+'\x20failed,\x20status\x20code\x20=\x20'+_0xc051df[_0x909c('0x18')]+'\x20('+_0xc051df[_0x909c('0x19')]+')'));return;}var _0x157a05='';_0xc051df['on'](_0x909c('0x23'),function(_0x4a0e0b){_0x157a05+=_0x4a0e0b;});_0xc051df['on'](_0x909c('0x1f'),function(){_0x2d165c(_0x157a05);});})['on']('error',function(_0x418822){_0x221413(_0x418822);})[_0x909c('0x1f')]();});}function convertFile(_0x35f82b,_0x359ca8){return new BPromise(function(_0x344374,_0x385aa0){var _0xdc9e37=sox['transcode'](_0x35f82b,_0x359ca8,{'sampleRate':0x1f40,'format':_0x909c('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xdc9e37['on'](_0x909c('0x15'),function(_0x5a1902){logger[_0x909c('0x15')](_0x909c('0x25'),_0x5a1902);_0x385aa0(_0x5a1902);});_0xdc9e37['on']('end',function(){logger[_0x909c('0x1b')](_0x909c('0x26'));_0x344374();});_0xdc9e37[_0x909c('0x27')]();});}function base64Decode(_0x43a721,_0x2c16a9){var _0x3d9a5c=path[_0x909c('0x28')](__dirname,_0x909c('0x29'),rs['generate'](0x4)+_0x909c('0x2a'));fs[_0x909c('0x2b')](_0x3d9a5c,_0x43a721,'base64');return convertFile(_0x3d9a5c,_0x2c16a9)['then'](function(){try{fs[_0x909c('0x1e')](_0x3d9a5c);fs[_0x909c('0x2c')](_0x2c16a9,_0x909c('0x2d'));}catch(_0x578679){logger[_0x909c('0x15')](_0x578679);}return _0x2c16a9[_0x909c('0x2e')]('.')[0x0];});}function base64Encode(_0x5e1987){var _0x3b814b=fs[_0x909c('0x2f')](_0x5e1987);return new Buffer(_0x3b814b)[_0x909c('0x30')]('base64');}exports[_0x909c('0x31')]=function(_0x4615f3,_0x5f091c,_0x36dbd2,_0xa36464,_0x8b25cc,_0x3b9e11){var _0x4921da,_0x55bd62;var _0x5a993d=_0x909c('0x32');var _0x20eed4=_0x909c('0x33')+_0x4615f3;var _0x5f3561={};if(_0x5f091c===_0x909c('0x34')){_0x5f3561[_0x909c('0x35')]={'ssml':_0x36dbd2};}else{_0x5f3561[_0x909c('0x35')]={'text':_0x36dbd2};};_0x5f3561[_0x909c('0x36')]={'languageCode':_0xa36464,'ssmlGender':_0x8b25cc};_0x5f3561[_0x909c('0x37')]={'audioEncoding':_0x909c('0x38'),'sampleRateHertz':0x1f40};var _0x41bc68={'url':_0x5a993d+_0x909c('0x39')+_0x20eed4,'method':_0x909c('0x3a'),'json':!![],'body':_0x5f3561};return rp(_0x41bc68)[_0x909c('0x3b')](function(_0x2d225f){return new BPromise(function(_0x569f4c,_0x12eeb1){_0x4921da=path[_0x909c('0x28')](__dirname,_0x909c('0x29'),rs[_0x909c('0x3c')](0x4)+_0x909c('0x3d'));var _0x4c0ff1=Buffer[_0x909c('0x3e')](_0x2d225f['audioContent'],_0x909c('0x3f'));return fs[_0x909c('0x40')](_0x4921da,_0x4c0ff1,function(_0x1722bf){_0x12eeb1(_0x1722bf);},function(_0x296676){fs[_0x909c('0x2c')](_0x4921da,_0x909c('0x2d'));_0x569f4c(_0x296676);});});})[_0x909c('0x3b')](function(_0x3f9b5d){_0x55bd62=path[_0x909c('0x28')](__dirname,_0x909c('0x29'),rs[_0x909c('0x3c')](0x4)+_0x909c('0x2a'));return convertFile(_0x4921da,_0x55bd62);})[_0x909c('0x3b')](function(){try{fs['unlink'](_0x4921da);fs[_0x909c('0x2c')](_0x55bd62,_0x909c('0x2d'));}catch(_0x2cb06d){logger[_0x909c('0x15')](_0x2cb06d);}logger[_0x909c('0x1b')](_0x909c('0x41'),_0x55bd62[_0x909c('0x2e')]('.')[0x0]);return _0x55bd62[_0x909c('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x1e6923,_0x4f32d4){var _0x801333=_0x909c('0x42');var _0x1153df,_0x28cba2;var _0x450355;var _0x29d62e={'encoding':_0x909c('0x43'),'method':'POST','timeout':0x2710,'url':_0x801333,'headers':{'Content-Type':_0x909c('0x44')},'body':_0x909c('0x45')+encodeURIComponent(JSON[_0x909c('0x46')]([[[_0x909c('0x47'),JSON[_0x909c('0x46')]([_0x1e6923,_0x4f32d4||'en',![],_0x909c('0x48')]),null,_0x909c('0x49')]]]))};return rp(_0x29d62e)[_0x909c('0x3b')](function(_0x4f1e83){try{_0x450355=eval(_0x4f1e83[_0x909c('0x4a')](0x5))[0x0][0x2];}catch(_0x558e22){throw new Error(_0x909c('0x4b')+_0x4f1e83[_0x909c('0x23')]);}if(!_0x450355){if(_0x1e6923['length']>0xc8){throw new Error(_0x909c('0x4c'));}else{throw new Error('lang\x20\x22'+_0x4f32d4+_0x909c('0x4d'));}}try{_0x450355=eval(_0x450355)[0x0];}catch(_0x14a41d){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x909c('0x23')]);}const _0x45552c=_0x450355;_0x1153df=path['resolve'](__dirname,'tmp',rs[_0x909c('0x3c')](0x4)+_0x909c('0x3d'));fs[_0x909c('0x2b')](_0x1153df,_0x450355,{'encoding':_0x909c('0x3f')});_0x28cba2=path[_0x909c('0x28')](__dirname,_0x909c('0x29'),rs[_0x909c('0x3c')](0x4)+_0x909c('0x2a'));return convertFile(_0x1153df,_0x28cba2);})[_0x909c('0x3b')](function(){try{fs['unlink'](_0x1153df);fs[_0x909c('0x2c')](_0x28cba2,'777');}catch(_0x3206c2){logger[_0x909c('0x15')](_0x3206c2);}logger[_0x909c('0x1b')](_0x909c('0x4e'),_0x28cba2[_0x909c('0x2e')]('.')[0x0]);return _0x28cba2[_0x909c('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x2e5e06,_0x4150dd,_0x323b04){return google[_0x909c('0x4f')](_0x2e5e06,_0x4150dd,_0x323b04)[_0x909c('0x3b')](function(_0x54f717){logger[_0x909c('0x1b')](_0x54f717['uri']);return rp(_0x54f717);})[_0x909c('0x3b')](function(_0x5b324e){var _0x4d58a8='';var _0x56d816=0x0;try{fs[_0x909c('0x1e')](_0x2e5e06);}catch(_0x42977c){logger['error'](_0x42977c);}if(_0x5b324e&&_0x5b324e[_0x909c('0x50')]){_0x4d58a8=_0x5b324e[_0x909c('0x50')][_0x909c('0x51')](function(_0x205937){return _0x205937&&_0x205937['alternatives'][0x0]&&_0x205937[_0x909c('0x52')][0x0][_0x909c('0x53')]?_0x205937[_0x909c('0x52')][0x0][_0x909c('0x53')]:'';})[_0x909c('0x54')]('\x0a');_0x56d816=_0x5b324e[_0x909c('0x50')][_0x909c('0x51')](function(_0x1cc04a){return _0x1cc04a&&_0x1cc04a[_0x909c('0x52')][0x0]&&_0x1cc04a[_0x909c('0x52')][0x0][_0x909c('0x55')]?_0x1cc04a[_0x909c('0x52')][0x0][_0x909c('0x55')]:0x0;})[_0x909c('0x54')]('\x0a');}logger[_0x909c('0x1b')]('googleASR\x20transcription',_0x4d58a8);logger[_0x909c('0x1b')]('googleASR\x20confidence',_0x56d816);return{'transcript':_0x4d58a8,'confidence':_0x56d816};})[_0x909c('0x56')](function(_0x4de129){logger[_0x909c('0x15')](_0x909c('0x57'),_0x4de129[_0x909c('0x18')],_0x4de129[_0x909c('0x58')],_0x4de129[_0x909c('0x59')]);});};exports[_0x909c('0x5a')]=function(_0x2723fe,_0x33b6a3,_0x51ff17,_0x2dfc50){var _0x2f08b9=apiai(_0x33b6a3,{'language':_0x2dfc50||'en'});return _0x2f08b9[_0x909c('0x5b')](_0x51ff17,{'sessionId':md5(_0x2723fe)})[_0x909c('0x3b')](function(_0x2aa3f0){logger['info'](JSON['stringify'](_0x2aa3f0));return{'source':_0x2aa3f0[_0x909c('0x5c')]['source'],'resolvedQuery':_0x2aa3f0[_0x909c('0x5c')][_0x909c('0x5d')],'action':_0x2aa3f0[_0x909c('0x5c')]['action'],'actionIncomplete':_0x2aa3f0[_0x909c('0x5c')][_0x909c('0x5e')],'speech':_0x2aa3f0[_0x909c('0x5c')][_0x909c('0x5f')][_0x909c('0x60')],'score':_0x2aa3f0[_0x909c('0x5c')][_0x909c('0x61')],'statusCode':_0x2aa3f0[_0x909c('0x62')][_0x909c('0x63')],'endConversation':_0x2aa3f0[_0x909c('0x5c')][_0x909c('0x64')][_0x909c('0x65')]||![],'isFallbackIntent':_0x2aa3f0[_0x909c('0x5c')][_0x909c('0x64')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0xa5cf22,_0x1d8bb0,_0x2f07a3,_0x19b044,_0x1f3595,_0xb3f432){var _0x5e4e4e=_0x19b044[_0x909c('0x66')](/\\n/g,'\x0a');var _0x1304b7={'credentials':{'private_key':_0x5e4e4e,'client_email':_0x2f07a3}};var _0x34fa04=new dialogflow['SessionsClient'](_0x1304b7);var _0x2c8fa3=_0x34fa04['sessionPath'](_0x1d8bb0,md5(_0xa5cf22));var _0x3c7c47={'session':_0x2c8fa3,'queryInput':{'text':{'text':_0x1f3595,'languageCode':_0xb3f432}}};return _0x34fa04[_0x909c('0x67')](_0x3c7c47)[_0x909c('0x3b')](function(_0x1fccea){if(_0x1fccea&&_0x1fccea[_0x909c('0x68')]){logger['info'](_0x909c('0x69'),JSON[_0x909c('0x46')](_0x1fccea));var _0xdaed42=_0x1fccea[0x0];if(_0xdaed42){var _0x4c7baf={'action':_0xdaed42[_0x909c('0x6a')][_0x909c('0x6b')],'allRequiredParamsPresent':_0xdaed42[_0x909c('0x6a')][_0x909c('0x6c')],'endConversation':_0xdaed42[_0x909c('0x6a')]['diagnosticInfo']&&_0xdaed42['queryResult'][_0x909c('0x6d')][_0x909c('0x6e')]?_0xdaed42['queryResult'][_0x909c('0x6d')][_0x909c('0x6e')][_0x909c('0x6f')][_0x909c('0x70')]:![],'fulfillmentText':_0xdaed42[_0x909c('0x6a')][_0x909c('0x71')],'intentName':_0xdaed42[_0x909c('0x6a')][_0x909c('0x72')][_0x909c('0x58')],'intentDisplayName':_0xdaed42[_0x909c('0x6a')][_0x909c('0x72')][_0x909c('0x73')],'isFallbackIntent':_0xdaed42[_0x909c('0x6a')][_0x909c('0x72')]['isFallback'],'languageCode':_0xdaed42[_0x909c('0x6a')][_0x909c('0x74')],'queryText':_0xdaed42[_0x909c('0x6a')][_0x909c('0x75')],'responseId':_0xdaed42[_0x909c('0x76')],'score':_0xdaed42['queryResult']['intentDetectionConfidence'],'speech':_0xdaed42[_0x909c('0x6a')][_0x909c('0x71')],'providerResponse':JSON['stringify'](_0x1fccea)};return _0x4c7baf;}}});};exports[_0x909c('0x77')]=function(_0x56c86d,_0x3c3531,_0x2988d,_0x2250aa){return tilde[_0x909c('0x4f')](_0x56c86d,_0x3c3531,_0x2988d,_0x2250aa)['then'](function(_0x55011a){try{fs['unlink'](_0x56c86d);}catch(_0x2b052d){logger['error'](_0x2b052d);}logger[_0x909c('0x1b')](_0x909c('0x78'),_0x55011a[_0x909c('0x53')]);logger[_0x909c('0x1b')]('Tilde\x20ASR\x20confidence',_0x55011a['confidence']);return _0x55011a;});};exports[_0x909c('0x79')]=function(_0x58dd08,_0x5ed601,_0x4249e5,_0x5d5af2,_0x3bdc76,_0x1f273b){var _0x537c5e=path[_0x909c('0x28')](__dirname,_0x909c('0x29'),rs[_0x909c('0x3c')](0x4)+_0x909c('0x3d'));var _0x14bba3;return aws[_0x909c('0x7a')](_0x58dd08,_0x5ed601,_0x4249e5,_0x5d5af2,_0x3bdc76,_0x1f273b,_0x537c5e)[_0x909c('0x3b')](function(){_0x14bba3=path[_0x909c('0x28')](__dirname,'tmp',rs[_0x909c('0x3c')](0x4)+_0x909c('0x2a'));return convertFile(_0x537c5e,_0x14bba3);})[_0x909c('0x3b')](function(){try{fs['unlink'](_0x537c5e);fs['chmodSync'](_0x14bba3,'777');}catch(_0x2cbb4f){logger[_0x909c('0x15')](_0x2cbb4f);}return _0x14bba3[_0x909c('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x5bde10,_0x595cf5,_0x1d1314,_0x2314a4,_0x5c02d6,_0x515c72){return aws['lex'](_0x5bde10,_0x595cf5,_0x1d1314,_0x2314a4,_0x5c02d6,_0x515c72)[_0x909c('0x3b')](function(_0x1a6163){logger[_0x909c('0x1b')](JSON['stringify'](_0x1a6163));return _0x1a6163;});};exports['ispeechTTS']=function(_0x325920,_0xd64e99,_0x4c6dad,_0x4c8033){var _0x2c80ae=util[_0x909c('0x7b')](_0x909c('0x7c'),ISPEECH_API,_0x325920,encodeURIComponent(_0xd64e99),_0x4c6dad,_0x4c8033);var _0x56952c=path[_0x909c('0x28')](__dirname,_0x909c('0x29'),rs['generate'](0x4)+_0x909c('0x3d'));var _0x95c84a;return downloadFile(_0x2c80ae,_0x56952c)[_0x909c('0x3b')](function(){_0x95c84a=path['resolve'](__dirname,_0x909c('0x29'),rs['generate'](0x4)+'.wav');return convertFile(_0x56952c,_0x95c84a);})[_0x909c('0x3b')](function(){try{fs['unlink'](_0x56952c);fs[_0x909c('0x2c')](_0x95c84a,_0x909c('0x2d'));}catch(_0x42768f){logger['error'](_0x42768f);}return _0x95c84a[_0x909c('0x2e')]('.')[0x0];});};exports[_0x909c('0x7d')]=function(_0x436f80,_0x530bd8,_0x1e94d5,_0x2ec690){var _0xa2cb44=util['format'](_0x909c('0x7e'),ISPEECH_API,_0x530bd8,_0x1e94d5,base64Encode(_0x436f80),_0x2ec690?util[_0x909c('0x7b')](_0x909c('0x7f'),encodeURIComponent(_0x2ec690)):'freeform=3');return uploadFile(_0xa2cb44)['then'](function(_0x50ba73){return querystring[_0x909c('0xb')](_0x50ba73);});};exports['sestekNDA']=function(_0x3521cd,_0x5aa902){return sestek[_0x909c('0x80')](_0x3521cd,_0x5aa902)[_0x909c('0x3b')](function(_0x339bf1){logger[_0x909c('0x1b')](JSON['stringify'](_0x339bf1));var _0x4176d9={'speech':_0x339bf1['text'],'action':_0x339bf1['channelData']?_0x339bf1[_0x909c('0x81')][_0x909c('0x82')]:undefined,'actiondata':_0x339bf1[_0x909c('0x81')]?_0x339bf1[_0x909c('0x81')][_0x909c('0x83')]:undefined};if(_0x339bf1['channelData']&&_0x339bf1[_0x909c('0x81')][_0x909c('0x84')]){return base64Decode(_0x339bf1[_0x909c('0x81')][_0x909c('0x84')][_0x909c('0x85')],path[_0x909c('0x28')](__dirname,'tmp',rs[_0x909c('0x3c')](0x4)+_0x909c('0x2a')))['then'](function(_0x1834c1){_0x4176d9[_0x909c('0x86')]=_0x1834c1;return _0x4176d9;});}return _0x4176d9;});};exports['dirName']=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 c64ce88..f767198 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 _0x9449=['./nda','exports'];(function(_0x69e5eb,_0x38a6fc){var _0x1ad29d=function(_0x3c351a){while(--_0x3c351a){_0x69e5eb['push'](_0x69e5eb['shift']());}};_0x1ad29d(++_0x38a6fc);}(_0x9449,0x1bc));var _0x9944=function(_0x3c5b75,_0x30bc0a){_0x3c5b75=_0x3c5b75-0x0;var _0x157e67=_0x9449[_0x3c5b75];return _0x157e67;};var nda=require(_0x9944('0x0'));module[_0x9944('0x1')]={'nda':nda}; \ No newline at end of file +var _0x31a7=['exports','./nda'];(function(_0x5ba974,_0x19791c){var _0x52a61f=function(_0x21a24f){while(--_0x21a24f){_0x5ba974['push'](_0x5ba974['shift']());}};_0x52a61f(++_0x19791c);}(_0x31a7,0x113));var _0x731a=function(_0xf6b1a,_0x2894c5){_0xf6b1a=_0xf6b1a-0x0;var _0x1f6ffb=_0x31a7[_0xf6b1a];return _0x1f6ffb;};var nda=require(_0x731a('0x0'));module[_0x731a('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 fa606ff..b7f0e4f 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 _0xf6fb=['access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','info','stringify','../../../../../config/logger','agi','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid','calleridname','dnid','text'];(function(_0x5e18c4,_0x58feda){var _0x23bb9a=function(_0x28d21a){while(--_0x28d21a){_0x5e18c4['push'](_0x5e18c4['shift']());}};_0x23bb9a(++_0x58feda);}(_0xf6fb,0x111));var _0xbf6f=function(_0x50caa0,_0x560e6a){_0x50caa0=_0x50caa0-0x0;var _0x497b81=_0xf6fb[_0x50caa0];return _0x497b81;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xbf6f('0x0'))(_0xbf6f('0x1'));module['exports']=function(_0x270dda,_0x7191f2){var _0x5709b7={'method':_0xbf6f('0x2'),'uri':url['resolve'](_0x7191f2[_0xbf6f('0x3')],_0xbf6f('0x4')),'form':{'grant_type':_0xbf6f('0x5'),'username':_0x7191f2[_0xbf6f('0x6')],'password':_0x7191f2[_0xbf6f('0x5')]},'json':!![]};return rp(_0x5709b7)[_0xbf6f('0x7')](function(_0x9d0c63){var _0x43d56b={'method':'POST','uri':url[_0xbf6f('0x8')](_0x7191f2[_0xbf6f('0x9')],_0xbf6f('0xa')),'body':{'type':_0x7191f2[_0xbf6f('0xb')]||_0xbf6f('0xc'),'channelId':'Nda','conversation':{'id':_0x270dda['uniqueid']},'from':{'id':_0x270dda[_0xbf6f('0xd')],'name':_0x270dda[_0xbf6f('0xe')]},'recipient':{'id':_0x270dda[_0xbf6f('0xf')],'name':_0x270dda['extension']},'text':_0x7191f2[_0xbf6f('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x9d0c63[_0xbf6f('0x11')]},'json':!![]};if(_0x7191f2[_0xbf6f('0x12')]){_0x43d56b[_0xbf6f('0x13')]['channelData'][_0xbf6f('0x14')]=_0x7191f2[_0xbf6f('0x12')];}if(_0x7191f2[_0xbf6f('0x15')]=='1'){_0x43d56b[_0xbf6f('0x13')][_0xbf6f('0x16')][_0xbf6f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x7191f2[_0xbf6f('0x18')]){_0x43d56b[_0xbf6f('0x13')][_0xbf6f('0x16')][_0xbf6f('0x19')]=_0x7191f2[_0xbf6f('0x18')];if(_0x7191f2[_0xbf6f('0x1a')]){_0x43d56b[_0xbf6f('0x13')]['channelData']['CustomActionData']=_0x7191f2[_0xbf6f('0x1a')];}}logger[_0xbf6f('0x1b')](JSON[_0xbf6f('0x1c')](_0x43d56b));return rp(_0x43d56b);});}; \ No newline at end of file +var _0x0aaf=['body','CustomAction','custom_action','custom_action_data','CustomActionData','info','../../../../../config/logger','agi','exports','POST','resolve','/token','username','then','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','ProjectName','channelData','audio/wav'];(function(_0x2ecbc0,_0x26ee68){var _0x5c25db=function(_0x205101){while(--_0x205101){_0x2ecbc0['push'](_0x2ecbc0['shift']());}};_0x5c25db(++_0x26ee68);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x3328b4,_0x403a24){_0x3328b4=_0x3328b4-0x0;var _0x530143=_0x0aaf[_0x3328b4];return _0x530143;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xf0aa('0x0'))(_0xf0aa('0x1'));module[_0xf0aa('0x2')]=function(_0x3402de,_0x5e7bdc){var _0x507aaa={'method':_0xf0aa('0x3'),'uri':url[_0xf0aa('0x4')](_0x5e7bdc['ndauth_url'],_0xf0aa('0x5')),'form':{'grant_type':'password','username':_0x5e7bdc[_0xf0aa('0x6')],'password':_0x5e7bdc['password']},'json':!![]};return rp(_0x507aaa)[_0xf0aa('0x7')](function(_0x244745){var _0x38bf88={'method':'POST','uri':url[_0xf0aa('0x4')](_0x5e7bdc[_0xf0aa('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5e7bdc[_0xf0aa('0x9')]||_0xf0aa('0xa'),'channelId':_0xf0aa('0xb'),'conversation':{'id':_0x3402de[_0xf0aa('0xc')]},'from':{'id':_0x3402de[_0xf0aa('0xd')],'name':_0x3402de[_0xf0aa('0xe')]},'recipient':{'id':_0x3402de[_0xf0aa('0xf')],'name':_0x3402de[_0xf0aa('0x10')]},'text':_0x5e7bdc[_0xf0aa('0x11')],'channelData':{}},'headers':{'Authorization':_0xf0aa('0x12')+_0x244745[_0xf0aa('0x13')]},'json':!![]};if(_0x5e7bdc[_0xf0aa('0x14')]){_0x38bf88['body']['channelData'][_0xf0aa('0x15')]=_0x5e7bdc[_0xf0aa('0x14')];}if(_0x5e7bdc['ndagenerate_audio']=='1'){_0x38bf88['body'][_0xf0aa('0x16')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf0aa('0x17')};}if(_0x5e7bdc['custom_action']){_0x38bf88[_0xf0aa('0x18')]['channelData'][_0xf0aa('0x19')]=_0x5e7bdc[_0xf0aa('0x1a')];if(_0x5e7bdc[_0xf0aa('0x1b')]){_0x38bf88[_0xf0aa('0x18')][_0xf0aa('0x16')][_0xf0aa('0x1c')]=_0x5e7bdc[_0xf0aa('0x1b')];}}logger[_0xf0aa('0x1d')](JSON['stringify'](_0x38bf88));return rp(_0x38bf88);});}; \ 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 69c80be..cb93638 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 _0x0bb4=['./lib/api','exports'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x0bb4,0x14c));var _0x40bb=function(_0x225006,_0x2ef300){_0x225006=_0x225006-0x0;var _0x63909a=_0x0bb4[_0x225006];return _0x63909a;};'use strict';var asr=require(_0x40bb('0x0'));module[_0x40bb('0x1')]=function(_0x302b7e,_0x37fe0e,_0x40d462,_0x39528b){return asr(_0x302b7e,_0x37fe0e,_0x40d462,_0x39528b);}; \ No newline at end of file +var _0x2d53=['./lib/api'];(function(_0x116df5,_0x3ada0e){var _0x2f71e6=function(_0x367e16){while(--_0x367e16){_0x116df5['push'](_0x116df5['shift']());}};_0x2f71e6(++_0x3ada0e);}(_0x2d53,0xaa));var _0x32d5=function(_0x1fd675,_0x587658){_0x1fd675=_0x1fd675-0x0;var _0x521d1c=_0x2d53[_0x1fd675];return _0x521d1c;};'use strict';var asr=require(_0x32d5('0x0'));module['exports']=function(_0x3c33bd,_0x163e50,_0x144c51,_0xc8c57b){return asr(_0x3c33bd,_0x163e50,_0x144c51,_0xc8c57b);}; \ 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 ccb041a..5fb1573 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 _0xef3d=['close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','stringify','data'];(function(_0x3e9d06,_0x30e68f){var _0x1f5e28=function(_0x5790f5){while(--_0x5790f5){_0x3e9d06['push'](_0x3e9d06['shift']());}};_0x1f5e28(++_0x30e68f);}(_0xef3d,0x8f));var _0xdef3=function(_0x37e4f4,_0x3aed17){_0x37e4f4=_0x37e4f4-0x0;var _0x2d7fbc=_0xef3d[_0x37e4f4];return _0x2d7fbc;};'use strict';var BPromise=require('bluebird');var _=require(_0xdef3('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdef3('0x1'));var crypto=require('crypto');var logger=require(_0xdef3('0x2'))(_0xdef3('0x3'));module[_0xdef3('0x4')]=function(_0x2a9f09,_0x1f1744,_0x595d7c,_0x11a6d0){return new BPromise(function(_0x3803b9,_0x55345d){logger[_0xdef3('0x5')]('Tilde\x20URI',_0x11a6d0||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2378bc=new WebSocket(_0x11a6d0||_0xdef3('0x6'),{'perMessageDeflate':![]});var _0x1fd2e0='';var _0x5dd3b4='0';var _0x137e3a='1';var _0x3197ac=_0xdef3('0x7');function _0x3dd61e(_0x5e1eb3){var _0x5becb9=crypto[_0xdef3('0x8')](_0xdef3('0x9'));_0x5becb9[_0xdef3('0xa')](_0x5e1eb3);return _0x5becb9[_0xdef3('0xb')](_0xdef3('0xc'));}function _0x448363(){try{logger[_0xdef3('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x4e7e03=moment()[_0xdef3('0xd')]();var _0x400d19=_0x3dd61e(_0x4e7e03+_0x1f1744+_0x595d7c);_0x2378bc[_0xdef3('0xe')](JSON[_0xdef3('0xf')]({'appID':_0x1f1744,'timestamp':_0x4e7e03,'appKey':_0x400d19}));var _0x373abd=fs['createReadStream'](_0x2a9f09);_0x373abd['on'](_0xdef3('0x10'),function(_0x841a46){_0x2378bc[_0xdef3('0xe')](_0x841a46);});_0x373abd['on'](_0xdef3('0x11'),function(){_0x2378bc[_0xdef3('0xe')](_0xdef3('0x12'));});}catch(_0x679621){logger['error'](_0xdef3('0x13'),JSON['stringify'](_0x679621));_0x2378bc[_0xdef3('0x14')]();}}function _0x5e10e1(_0x1427e7){try{if(_0x1427e7){var _0x16d623=JSON[_0xdef3('0x15')](_0x1427e7);switch(_0x16d623[_0xdef3('0x16')]){case 0x0:if(_0x16d623[_0xdef3('0x17')]){if(_0x16d623[_0xdef3('0x17')][_0xdef3('0x18')]){logger[_0xdef3('0x5')](_0xdef3('0x19'),JSON[_0xdef3('0xf')](_0x16d623['result'][_0xdef3('0x1a')]));_0x1fd2e0=_0x16d623['result'][_0xdef3('0x1a')][0x0][_0xdef3('0x1b')];_0x5dd3b4=_0x16d623[_0xdef3('0x17')]['hypotheses'][0x0][_0xdef3('0x1c')];_0x137e3a='0';_0x3197ac=_0xdef3('0x1d');_0x2378bc[_0xdef3('0x14')]();}}break;case 0x1:logger['info'](_0xdef3('0x7'));_0x137e3a='1';_0x3197ac=_0xdef3('0x7');break;case 0x2:logger[_0xdef3('0x5')](_0xdef3('0x1e'));_0x137e3a='2';_0x3197ac=_0xdef3('0x1e');break;case 0x9:logger[_0xdef3('0x5')](_0xdef3('0x1f'));_0x137e3a='9';_0x3197ac=_0xdef3('0x1f');break;case 0xa:logger[_0xdef3('0x5')](_0xdef3('0x20'));_0x137e3a='10';_0x3197ac='Authentication\x20failed.';break;case 0xb:logger[_0xdef3('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x137e3a='11';_0x3197ac='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x488436){logger[_0xdef3('0x21')](_0xdef3('0x22'),JSON[_0xdef3('0xf')](_0x488436));_0x2378bc['terminate']();}}function _0x2e0c28(){logger[_0xdef3('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x3803b9({'transcript':_0x1fd2e0,'confidence':_0x5dd3b4,'status':_0x137e3a,'status_message':_0x3197ac});}function _0x3dfd32(_0x206078){logger[_0xdef3('0x21')](_0xdef3('0x23'));if(!_[_0xdef3('0x24')](_0x206078)){logger[_0xdef3('0x21')](_[_0xdef3('0x25')](_0x206078)?JSON[_0xdef3('0xf')](_0x206078):_0x206078);}}_0x2378bc['on'](_0xdef3('0x26'),_0x448363);_0x2378bc['on'](_0xdef3('0x27'),_0x5e10e1);_0x2378bc['on'](_0xdef3('0x11'),_0x2e0c28);_0x2378bc['on']('error',_0x3dfd32);});}; \ No newline at end of file +var _0x472e=['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','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','terminate'];(function(_0x250093,_0x288a2f){var _0x2a4f56=function(_0xc8200f){while(--_0xc8200f){_0x250093['push'](_0x250093['shift']());}};_0x2a4f56(++_0x288a2f);}(_0x472e,0xa6));var _0xe472=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x472e[_0x1526e1];return _0x249a1e;};'use strict';var BPromise=require(_0xe472('0x0'));var _=require(_0xe472('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe472('0x2'));var crypto=require('crypto');var logger=require(_0xe472('0x3'))('agi');module[_0xe472('0x4')]=function(_0x549c3e,_0x358e3e,_0x56246d,_0x4cc1e1){return new BPromise(function(_0x15f8d4,_0x23b262){logger['info'](_0xe472('0x5'),_0x4cc1e1||_0xe472('0x6'));var _0x28a93a=new WebSocket(_0x4cc1e1||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x41c456='';var _0x49cb73='0';var _0x387c0d='1';var _0x523801=_0xe472('0x7');function _0x5f5d45(_0x1b25e2){var _0x308949=crypto[_0xe472('0x8')]('sha1');_0x308949[_0xe472('0x9')](_0x1b25e2);return _0x308949[_0xe472('0xa')](_0xe472('0xb'));}function _0x1299c9(){try{logger['info'](_0xe472('0xc'));var _0x55b25e=moment()['unix']();var _0x243b9a=_0x5f5d45(_0x55b25e+_0x358e3e+_0x56246d);_0x28a93a[_0xe472('0xd')](JSON[_0xe472('0xe')]({'appID':_0x358e3e,'timestamp':_0x55b25e,'appKey':_0x243b9a}));var _0x52bdb7=fs[_0xe472('0xf')](_0x549c3e);_0x52bdb7['on']('data',function(_0x272f02){_0x28a93a[_0xe472('0xd')](_0x272f02);});_0x52bdb7['on'](_0xe472('0x10'),function(){_0x28a93a[_0xe472('0xd')](_0xe472('0x11'));});}catch(_0x39053a){logger[_0xe472('0x12')](_0xe472('0x13'),JSON[_0xe472('0xe')](_0x39053a));_0x28a93a['terminate']();}}function _0xcff8a4(_0x1f7bfb){try{if(_0x1f7bfb){var _0x213ef1=JSON['parse'](_0x1f7bfb);switch(_0x213ef1[_0xe472('0x14')]){case 0x0:if(_0x213ef1['result']){if(_0x213ef1[_0xe472('0x15')][_0xe472('0x16')]){logger[_0xe472('0x17')](_0xe472('0x18'),JSON[_0xe472('0xe')](_0x213ef1[_0xe472('0x15')]['hypotheses']));_0x41c456=_0x213ef1['result'][_0xe472('0x19')][0x0][_0xe472('0x1a')];_0x49cb73=_0x213ef1[_0xe472('0x15')]['hypotheses'][0x0]['likelihood'];_0x387c0d='0';_0x523801=_0xe472('0x1b');_0x28a93a[_0xe472('0x1c')]();}}break;case 0x1:logger[_0xe472('0x17')](_0xe472('0x7'));_0x387c0d='1';_0x523801='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x387c0d='2';_0x523801=_0xe472('0x1d');break;case 0x9:logger[_0xe472('0x17')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x387c0d='9';_0x523801=_0xe472('0x1e');break;case 0xa:logger[_0xe472('0x17')](_0xe472('0x1f'));_0x387c0d='10';_0x523801=_0xe472('0x1f');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x387c0d='11';_0x523801=_0xe472('0x20');}}}catch(_0x4c57fb){logger[_0xe472('0x12')](_0xe472('0x21'),JSON['stringify'](_0x4c57fb));_0x28a93a[_0xe472('0x1c')]();}}function _0x9f799(){logger[_0xe472('0x17')]('Close\x20Tilde\x20ASR\x20socket');_0x15f8d4({'transcript':_0x41c456,'confidence':_0x49cb73,'status':_0x387c0d,'status_message':_0x523801});}function _0xa26284(_0x263037){logger[_0xe472('0x12')](_0xe472('0x22'));if(!_[_0xe472('0x23')](_0x263037)){logger[_0xe472('0x12')](_[_0xe472('0x24')](_0x263037)?JSON[_0xe472('0xe')](_0x263037):_0x263037);}}_0x28a93a['on'](_0xe472('0x25'),_0x1299c9);_0x28a93a['on'](_0xe472('0x26'),_0xcff8a4);_0x28a93a['on']('close',_0x9f799);_0x28a93a['on']('error',_0xa26284);});}; \ 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 0d804b9..aba738b 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 _0x7578=['./asr'];(function(_0x19fb21,_0x51b553){var _0x38525f=function(_0x4be6c7){while(--_0x4be6c7){_0x19fb21['push'](_0x19fb21['shift']());}};_0x38525f(++_0x51b553);}(_0x7578,0x19e));var _0x8757=function(_0x58ecf1,_0xa24fdd){_0x58ecf1=_0x58ecf1-0x0;var _0x4c0579=_0x7578[_0x58ecf1];return _0x4c0579;};var asr=require(_0x8757('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x97e5=['./asr','exports'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0x97e5,0x1a4));var _0x597e=function(_0x38eac2,_0x22bb9e){_0x38eac2=_0x38eac2-0x0;var _0x10b76f=_0x97e5[_0x38eac2];return _0x10b76f;};var asr=require(_0x597e('0x0'));module[_0x597e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 7a2d99c..e221050 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 79a2edd..072733a 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 _0xe14d=['Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','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','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','exports','util','lodash','shelljs','odbc','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','replace','googleCloudTTS','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','number','timeout','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','includes','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','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','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes'];(function(_0x52ff94,_0x37e491){var _0x16fcdf=function(_0x1a4007){while(--_0x1a4007){_0x52ff94['push'](_0x52ff94['shift']());}};_0x16fcdf(++_0x37e491);}(_0xe14d,0x1ee));var _0xde14=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xe14d[_0x20c9b2];return _0x2c6030;};'use strict';var fs=require('fs');var util=require(_0xde14('0x0'));var _=require(_0xde14('0x1'));var sh=require(_0xde14('0x2'));var odbc=require(_0xde14('0x3'))();var rs=require('randomstring');var moment=require(_0xde14('0x4'));var Mustache=require(_0xde14('0x5'));var rp=require('request-promise');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var scripts=require(_0xde14('0x9'));var FILES_PATH=_0xde14('0xa');var recursiveMapAttributes=[_0xde14('0xb'),'rawBody'];var verticesWithRetry=['menu',_0xde14('0xc'),_0xde14('0xd')];var AGIVertices=function(_0x2b0e7c,_0x9f13dc,_0xb25b00){this[_0xde14('0xe')]=_0x2b0e7c;this[_0xde14('0xf')]=_0x9f13dc;this[_0xde14('0x10')]=_0xb25b00;};AGIVertices['prototype'][_0xde14('0x11')]=function(_0xe785fb,_0x417269){this[_0xde14('0xf')][_0xde14('0x12')](_0xe785fb)[_0xde14('0x13')](function(_0x1a1c32){_0x417269(null,_0x1a1c32?_0x1a1c32[_0xde14('0x14')]:![]);})[_0xde14('0x15')](function(_0x29e3ca){_0x417269(_0x29e3ca);});};AGIVertices[_0xde14('0x16')][_0xde14('0x17')]=function(_0x3521d4,_0x281c54){this[_0xde14('0xf')]['getVoiceQueueById'](_0x3521d4)['then'](function(_0x23c878){_0x281c54(null,_0x23c878?_0x23c878[_0xde14('0x14')]:![]);})[_0xde14('0x15')](function(_0x4c86ff){_0x281c54(_0x4c86ff);});};AGIVertices[_0xde14('0x16')][_0xde14('0x18')]=function(_0x257390,_0x31902a){this[_0xde14('0xf')][_0xde14('0x19')](_0x257390)[_0xde14('0x13')](function(_0x6f6eea){_0x31902a(null,_0x6f6eea?_0x6f6eea[_0xde14('0x14')]:![]);})[_0xde14('0x15')](function(_0x590a8b){_0x31902a(_0x590a8b);});};AGIVertices[_0xde14('0x16')][_0xde14('0x1a')]=function(_0x2eb8a8,_0x44ce4c){this['rpc'][_0xde14('0x1b')](_0x2eb8a8)['then'](function(_0x45d101){_0x44ce4c(null,_0x45d101?_0x45d101['dsn']:![]);})[_0xde14('0x15')](function(_0x30fcf1){_0x44ce4c(_0x30fcf1);});};AGIVertices[_0xde14('0x16')][_0xde14('0x1c')]=function(_0x39bdc5,_0x11a4d9){this[_0xde14('0xf')][_0xde14('0x1d')](_0x39bdc5)[_0xde14('0x13')](function(_0x163b79){_0x11a4d9(null,_0x163b79?_0x163b79[_0xde14('0x14')]:![]);})[_0xde14('0x15')](function(_0x8f8033){_0x11a4d9(_0x8f8033);});};AGIVertices['prototype'][_0xde14('0x1e')]=function(_0x3ce77c,_0x24a390){this[_0xde14('0xf')][_0xde14('0x1f')](_0x3ce77c)[_0xde14('0x13')](function(_0x310d75){_0x24a390(null,_0x310d75?_0x310d75[_0xde14('0x14')]:![]);})[_0xde14('0x15')](function(_0x350a78){_0x24a390(_0x350a78);});};AGIVertices['prototype'][_0xde14('0x20')]=function(_0x1696ee,_0x3eaee5){var _0xf8279a=this;this['rpc'][_0xde14('0x21')](_0x1696ee)[_0xde14('0x13')](function(_0x30c4a8){_0x3eaee5(null,_0x30c4a8?_0xf8279a['getSoundPath'](_0x30c4a8[_0xde14('0x22')]):![]);})['catch'](function(_0x2760f9){_0x3eaee5(_0x2760f9);});};AGIVertices[_0xde14('0x16')][_0xde14('0x23')]=function(_0x1e7906,_0x2aca96){this[_0xde14('0xf')][_0xde14('0x24')](_0x1e7906)[_0xde14('0x13')](function(_0x4e7c5b){_0x2aca96(null,_0x4e7c5b?_0x4e7c5b:![]);})[_0xde14('0x15')](function(_0xbf49ac){_0x2aca96(_0xbf49ac);});};AGIVertices['prototype'][_0xde14('0x25')]=function(_0x4c9b15,_0x2e40ad,_0x44e88a){this[_0xde14('0x10')][_0xde14('0x25')](_0x4c9b15,_0x2e40ad)[_0xde14('0x13')](function(){_0x44e88a(null);})['catch'](function(_0x26dfa9){_0x44e88a(_0x26dfa9);});};AGIVertices[_0xde14('0x16')]['getIntervals']=function(_0x280238,_0x3c943b){this[_0xde14('0xf')][_0xde14('0x26')](_0x280238)[_0xde14('0x13')](function(_0xa41c1e){if(_0xa41c1e){if(_0xa41c1e[_0xde14('0x27')]){_0x3c943b(null,[_0xa41c1e[_0xde14('0x28')]]);}else{_0x3c943b(null,_[_0xde14('0x29')](_0xa41c1e['Intervals'],'interval'));}}else{_0x3c943b(null,![]);}})[_0xde14('0x15')](function(_0x403007){_0x3c943b(_0x403007);});};AGIVertices[_0xde14('0x16')][_0xde14('0x2a')]=function(_0x31cad4){return util[_0xde14('0x2b')](_0xde14('0x2c'),FILES_PATH,_0x31cad4);};AGIVertices[_0xde14('0x16')][_0xde14('0x2d')]=function(_0x4e33e0,_0x1854d3,_0x48c043){odbc['open'](_0x4e33e0,function(_0x4c1e37){if(_0x4c1e37){logger[_0xde14('0x2e')](_0xde14('0x2f'),_0x4c1e37);_0x48c043(_0x4c1e37);}else{logger[_0xde14('0x30')](_0xde14('0x31'));odbc[_0xde14('0x32')](_0x1854d3,function(_0x8b5bb4,_0x1e89b6){if(_0x8b5bb4){logger[_0xde14('0x30')]('Error\x20executing\x20query\x20%s',_0x1854d3);_0x48c043(_0x8b5bb4);}else{logger[_0xde14('0x30')](_0xde14('0x33'),_0x1854d3);odbc[_0xde14('0x34')](function(_0x2b3004){if(_0x2b3004){logger[_0xde14('0x2e')](_0xde14('0x35'),_0x2b3004);}_0x48c043(null,_0x1e89b6);});}});}});};AGIVertices[_0xde14('0x16')][_0xde14('0x36')]=function(_0x50db0d,_0x225164){this[_0xde14('0xf')][_0xde14('0x37')](_0x50db0d)[_0xde14('0x13')](function(_0x4f7141){_0x225164(null,_0x4f7141?_0x4f7141:![]);})['catch'](function(_0x75d4f1){_0x225164(_0x75d4f1);});};AGIVertices[_0xde14('0x16')][_0xde14('0x38')]=function(_0x171080,_0x401f7e){this['rpc'][_0xde14('0x38')](_0x171080)[_0xde14('0x13')](function(_0x1d3cc1){_0x401f7e(null,_0x1d3cc1);})['catch'](function(_0x46fb53){_0x401f7e(_0x46fb53);});};AGIVertices['prototype'][_0xde14('0x39')]=function(_0x51ace9,_0x102770,_0x117c64){this[_0xde14('0xf')][_0xde14('0x39')]({'uniqueid':this[_0xde14('0xe')][_0xde14('0x3a')],'node':_0x51ace9[_0xde14('0x3b')],'application':_0x51ace9[_0xde14('0x3c')],'data':_0x102770||null,'project_name':this['channel'][_0xde14('0x3d')],'callerid':this['channel'][_0xde14('0x3e')]})['then'](function(_0x214b14){if(_0x117c64){_0x117c64(null,_0x214b14);}})[_0xde14('0x15')](function(_0x437466){if(_0x117c64){_0x117c64(_0x437466);}});};AGIVertices[_0xde14('0x16')][_0xde14('0x3f')]=function(_0x138d36,_0x442b3c,_0x2aadcf,_0x4f1b43){this[_0xde14('0xf')][_0xde14('0x3f')]({'uniqueid':this[_0xde14('0xe')][_0xde14('0x3a')],'callerid':this['channel'][_0xde14('0x3e')],'calleridname':this[_0xde14('0xe')][_0xde14('0x40')],'context':this[_0xde14('0xe')][_0xde14('0x41')],'extension':this[_0xde14('0xe')]['extension'],'priority':this[_0xde14('0xe')]['priority'],'accountcode':this[_0xde14('0xe')][_0xde14('0x42')],'dnid':this['channel'][_0xde14('0x43')],'projectName':this[_0xde14('0xe')][_0xde14('0x3d')],'saveName':_0x442b3c,'filename':_0x138d36[_0xde14('0x44')]||_0x442b3c,'savePath':_0x2aadcf})[_0xde14('0x13')](function(_0x1c87e1){_0x4f1b43(null,_0x1c87e1);})[_0xde14('0x15')](function(_0x51f35f){_0x4f1b43(_0x51f35f);});};AGIVertices[_0xde14('0x16')]['createSquareMessage']=function(_0xfa80c8,_0x6aa9ab,_0x237be4,_0x235202,_0x2e6867){this[_0xde14('0xf')][_0xde14('0x45')]({'uniqueid':this[_0xde14('0xe')][_0xde14('0x3a')],'body':_0xfa80c8,'direction':_0x6aa9ab,'providerName':_0x237be4,'providerResponse':_0x235202})[_0xde14('0x13')](function(_0x5db8b5){if(_0x2e6867){_0x2e6867(null,_0x5db8b5);}})[_0xde14('0x15')](function(_0x1688c6){if(_0x2e6867){_0x2e6867(_0x1688c6);}});};AGIVertices[_0xde14('0x16')][_0xde14('0x46')]=function(_0x14b781,_0x4874ed){this[_0xde14('0xf')]['createCmContact']({'firstName':_[_0xde14('0x47')](_0x14b781[_0xde14('0x14')])||_[_0xde14('0x48')](_0x14b781[_0xde14('0x14')])?_0xde14('0x49')+Math['random']():_0x14b781['name'],'lastName':_[_0xde14('0x47')](_0x14b781['lastName'])||_[_0xde14('0x48')](_0x14b781[_0xde14('0x4a')])?null:_0x14b781[_0xde14('0x4a')],'phone':_0x14b781[_0xde14('0x4b')],'ListId':_0x14b781[_0xde14('0x4c')],'scheduledat':_0x14b781[_0xde14('0x4d')],'callbackUniqueid':this[_0xde14('0xe')][_0xde14('0x3a')],'tags':_0xde14('0x4e'),'description':'Callback\x20scheduled\x20at\x20'+_0x14b781[_0xde14('0x4d')][_0xde14('0x4f')](),'priority':_0x14b781[_0xde14('0x50')]})[_0xde14('0x13')](function(_0x249ccc){_0x4874ed(null,_0x249ccc);})['catch'](function(_0xb2d69c){_0x4874ed(_0xb2d69c);});};AGIVertices['prototype'][_0xde14('0x51')]=function(_0x27fb42,_0x2526ca){this[_0xde14('0xf')][_0xde14('0x52')](_0x27fb42)[_0xde14('0x13')](function(_0x27ab1a){_0x2526ca(null,_0x27ab1a?_0x27ab1a[_0xde14('0x14')]:![]);})['catch'](function(_0x5a2753){_0x2526ca(_0x5a2753);});};AGIVertices['prototype'][_0xde14('0x53')]=function(_0x508f25,_0x596cd3,_0xc10000){var _0x20fd21={'role':_0xde14('0x54')};_0x20fd21[_0x508f25]=this[_0xde14('0xe')][_0xde14('0x3e')];this[_0xde14('0xf')][_0xde14('0x53')](_0x20fd21,_0x596cd3,this[_0xde14('0xe')][_0xde14('0x3a')])['then'](function(_0x6be331){_0xc10000(null,_[_0xde14('0x48')](_0x6be331)?![]:!![]);})[_0xde14('0x15')](function(_0x524e98){logger[_0xde14('0x2e')](_0x524e98);_0xc10000(null,![]);});};AGIVertices['prototype'][_0xde14('0x55')]=function(_0x32bffd,_0x40ab83){var _0x18eaf0={'role':_0xde14('0x54')};_0x18eaf0[_0x32bffd]=this[_0xde14('0xe')][_0xde14('0x3e')];this['rpc'][_0xde14('0x55')](_0x18eaf0)[_0xde14('0x13')](function(_0x1a0bb1){_0x40ab83(null,_[_0xde14('0x48')](_0x1a0bb1)?![]:!![]);})[_0xde14('0x15')](function(_0x70a2e1){logger[_0xde14('0x2e')](_0x70a2e1);_0x40ab83(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x4563ba,_0x19a162){var _0x3d37cc={'role':'agent'};_0x3d37cc[_0x4563ba]=this[_0xde14('0xe')][_0xde14('0x3e')];this[_0xde14('0xf')][_0xde14('0x56')](_0x3d37cc)['then'](function(_0x567180){_0x19a162(null,_[_0xde14('0x48')](_0x567180)?![]:!![]);})[_0xde14('0x15')](function(_0x30f228){logger[_0xde14('0x2e')](_0x30f228);_0x19a162(null,![]);});};AGIVertices[_0xde14('0x16')][_0xde14('0x57')]=function(_0x1bfe9b,_0x3641e3){var _0x408e7f={'role':_0xde14('0x54')};_0x408e7f[_0x1bfe9b]=this[_0xde14('0xe')][_0xde14('0x3e')];var _0x1ff577=_0x1bfe9b!=_0xde14('0x58')?util[_0xde14('0x2b')](_0xde14('0x59'),_0xde14('0x5a'),this[_0xde14('0xe')][_0xde14('0x3e')]):undefined;this[_0xde14('0xf')][_0xde14('0x57')](_0x408e7f,_0x1ff577)[_0xde14('0x13')](function(_0xfe7fcd){_0x3641e3(null,_['isNil'](_0xfe7fcd)?![]:!![]);})[_0xde14('0x15')](function(_0x55ddcf){logger[_0xde14('0x2e')](_0x55ddcf);_0x3641e3(null,![]);});};AGIVertices['prototype'][_0xde14('0x5b')]=function(_0xfa9c8d,_0x3aaba2){sh['exec'](_['trim'](_0xfa9c8d),function(_0x23d3e1,_0x18abd0){var _0x217a3d=_0x18abd0[_0xde14('0x5c')](/(\r\n|\n|\r)/gm,'');_0x3aaba2(null,_0x217a3d);});};AGIVertices['prototype'][_0xde14('0x5d')]=function(_0x3b4bc8,_0xa853de){scripts['googleCloudTTS'](_0x3b4bc8['apiKey'],_0x3b4bc8['google_cloud_tts_text_type']||'text',_0x3b4bc8[_0xde14('0x5e')],_0x3b4bc8[_0xde14('0x5f')]||_0xde14('0x60'),_0x3b4bc8['ssmlGender']||_0xde14('0x61'),_0x3b4bc8[_0xde14('0x62')]||_0xde14('0x63'))[_0xde14('0x13')](function(_0x37c412){_0xa853de(null,_0x37c412);})[_0xde14('0x15')](function(_0x545784){_0xa853de(_0x545784);});};AGIVertices['prototype'][_0xde14('0x64')]=function(_0x4474c2,_0x54aaa2){scripts[_0xde14('0x64')](_0x4474c2[_0xde14('0x5e')],_0x4474c2[_0xde14('0x65')]||'en',0x1)[_0xde14('0x13')](function(_0x32f022){_0x54aaa2(null,_0x32f022);})[_0xde14('0x15')](function(_0x2540df){_0x54aaa2(_0x2540df);});};AGIVertices['prototype']['restAPI']=function(_0x4800bf,_0x5d9fa3){var _0x3dbda9={'uri':_0x4800bf[_0xde14('0x66')],'method':_0x4800bf['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4800bf['timeout'])===_0xde14('0x67')&&parseInt(_0x4800bf[_0xde14('0x68')])>=0x1?parseInt(_0x4800bf[_0xde14('0x68')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xde14('0x69'),_0xde14('0x6a')],_0x3dbda9['method'][_0xde14('0x6b')]())){try{_0x3dbda9[_0xde14('0x6c')]=_0x4800bf[_0xde14('0x6d')]?JSON[_0xde14('0x6e')](_0x4800bf['rawBody']):{};}catch(_0x19887c){logger['error'](_0xde14('0x6f'),_0x19887c);}}try{_0x3dbda9[_0xde14('0x70')]=_0x4800bf[_0xde14('0xb')]?JSON['parse'](_0x4800bf[_0xde14('0xb')]):{};}catch(_0x3af215){logger[_0xde14('0x2e')](_0xde14('0x71'),_0x3af215);}if(_0x4800bf[_0xde14('0x72')]){try{var _0x54890a=require(_0x4800bf['computedVariables'])[_0xde14('0x73')](this,_0x3dbda9);_0x3dbda9[_0xde14('0x74')]=Mustache[_0xde14('0x75')](_0x4800bf['url'],_0x54890a,{},['$$','$$']);if(_0x3dbda9[_0xde14('0x70')]){_0x3dbda9[_0xde14('0x70')]=JSON[_0xde14('0x6e')](Mustache[_0xde14('0x75')](JSON[_0xde14('0x76')](_0x3dbda9[_0xde14('0x70')]),_0x54890a,{},['$$','$$']));}if(_0x3dbda9[_0xde14('0x6c')]){_0x3dbda9['body']=JSON[_0xde14('0x6e')](Mustache[_0xde14('0x75')](JSON[_0xde14('0x76')](_0x3dbda9[_0xde14('0x6c')]),_0x54890a,{},['$$','$$']));}}catch(_0x22bfc9){logger[_0xde14('0x2e')](_0xde14('0x77'),_0x22bfc9);}}rp(_0x3dbda9)['then'](function(_0x26fd01){var _0x1bdeae={'statusCode':_0x26fd01['statusCode']||0xc8,'statusMessage':_0x26fd01[_0xde14('0x78')]||'OK','headers':_0x26fd01['headers']||{},'body':_0x26fd01[_0xde14('0x6c')]||{}};_0x5d9fa3(null,_0x1bdeae);})['catch'](function(_0xfa8121){var _0xffbdf1={'statusCode':_0xfa8121[_0xde14('0x79')]||0x1f4,'statusMessage':_0xfa8121[_0xde14('0x7a')]||_0xde14('0x7b'),'headers':_0xfa8121[_0xde14('0x7c')]['headers']||{},'body':_0xfa8121[_0xde14('0x7c')][_0xde14('0x6c')]||{}};_0x5d9fa3(null,_0xffbdf1);});};AGIVertices[_0xde14('0x16')]['googleDialogflow']=function(_0x2542e1,_0x46f946){scripts[_0xde14('0x7d')](this['channel'][_0xde14('0x3a')],_0x2542e1[_0xde14('0x7e')],_0x2542e1[_0xde14('0x5e')],_0x2542e1['dialogflow_language']||'en')['then'](function(_0x495741){_0x46f946(null,_0x495741);})['catch'](function(_0x381d6d){_0x46f946(_0x381d6d);});};AGIVertices[_0xde14('0x16')]['googleDialogflowV2']=function(_0x36da22,_0xe16364){scripts[_0xde14('0x7f')](this[_0xde14('0xe')][_0xde14('0x3a')],_0x36da22['dialogflowV2_project_id'],_0x36da22[_0xde14('0x80')],_0x36da22[_0xde14('0x81')],_0x36da22[_0xde14('0x5e')],_0x36da22[_0xde14('0x82')]||'en')[_0xde14('0x13')](function(_0x3f49ea){_0xe16364(null,_0x3f49ea);})[_0xde14('0x15')](function(_0x3fb180){_0xe16364(_0x3fb180);});};AGIVertices['prototype'][_0xde14('0x83')]=function(_0x3f180b,_0xd9a97){scripts[_0xde14('0x83')](this[_0xde14('0xe')],_0x3f180b)[_0xde14('0x13')](function(_0x4fb108){_0xd9a97(null,_0x4fb108);})[_0xde14('0x15')](function(_0x54ec08){_0xd9a97(_0x54ec08);});};AGIVertices[_0xde14('0x16')][_0xde14('0x84')]=function(_0x54522f,_0xe0f167){scripts[_0xde14('0x84')](_0x54522f[_0xde14('0x7e')],_0x54522f[_0xde14('0x5e')],_0x54522f[_0xde14('0x85')]||_0xde14('0x60'),_0x54522f[_0xde14('0x86')])[_0xde14('0x13')](function(_0x1a3513){_0xe0f167(null,_0x1a3513);})[_0xde14('0x15')](function(_0xdec1bd){_0xe0f167(_0xdec1bd);});};AGIVertices[_0xde14('0x16')][_0xde14('0x87')]=function(_0x5a6f35,_0x56eb76,_0x41b62a){scripts[_0xde14('0x87')](_0x56eb76,_0x5a6f35['key'],_0x5a6f35[_0xde14('0x88')]||_0xde14('0x60'),this[_0xde14('0x89')](_0x5a6f35[_0xde14('0x8a')])?_0x5a6f35[_0xde14('0x8a')]:undefined)[_0xde14('0x13')](function(_0x2eb881){_0x41b62a(null,_0x2eb881);})[_0xde14('0x15')](function(_0x339371){_0x41b62a(_0x339371);});};AGIVertices['prototype']['awsPolly']=function(_0x324e4f,_0x23f9d9){scripts['awsPolly'](_0x324e4f[_0xde14('0x8b')],_0x324e4f[_0xde14('0x8c')],_0x324e4f['aws_polly_region'],_0x324e4f[_0xde14('0x8d')]||_0xde14('0x8e'),_0x324e4f['text'],_0x324e4f[_0xde14('0x8f')]||'text')[_0xde14('0x13')](function(_0x3ce6b8){_0x23f9d9(null,_0x3ce6b8);})[_0xde14('0x15')](function(_0x1a2494){_0x23f9d9(_0x1a2494);});};AGIVertices['prototype'][_0xde14('0x90')]=function(_0x22ff35,_0x467470){scripts['awsLex'](this[_0xde14('0xe')][_0xde14('0x3a')],_0x22ff35[_0xde14('0x8b')],_0x22ff35[_0xde14('0x8c')],_0x22ff35['aws_lex_region'],_0x22ff35[_0xde14('0x5e')],_0x22ff35[_0xde14('0x91')])['then'](function(_0x44d201){_0x467470(null,_0x44d201);})[_0xde14('0x15')](function(_0x69c01f){_0x467470(_0x69c01f);});};AGIVertices[_0xde14('0x16')][_0xde14('0x92')]=function(_0x476463,_0x27167e,_0x2b36e5){scripts['googleASR'](_0x27167e,_0x476463[_0xde14('0x7e')],_0x476463[_0xde14('0x93')]||_0xde14('0x60'))[_0xde14('0x13')](function(_0x59c555){_0x2b36e5(null,_0x59c555);})['catch'](function(_0x5717e0){_0x2b36e5(_0x5717e0);});};AGIVertices['prototype'][_0xde14('0x94')]=function(_0xb621ab,_0x1517fe,_0x51f886){scripts['tildeASR'](_0x1517fe,_0xb621ab[_0xde14('0x95')],_0xb621ab['appsecret'],_0xb621ab['uri'])['then'](function(_0x58be49){_0x51f886(null,_0x58be49);})[_0xde14('0x15')](function(_0x54fbea){_0x51f886(_0x54fbea);});};AGIVertices['prototype']['clear']=function(_0x487260){var _0x235239=_[_0xde14('0x96')](verticesWithRetry,_0x487260[_0xde14('0x3c')])?_0x487260:_[_0xde14('0x97')](_0x487260);for(var _0x3a2d9c in _0x235239){if(_0x235239[_0xde14('0x98')](_0x3a2d9c)){if(_0x235239[_0x3a2d9c]&&_['isString'](_0x235239[_0x3a2d9c])){if(_[_0xde14('0x96')](recursiveMapAttributes,_0x3a2d9c)){_0x235239[_0x3a2d9c]=this[_0xde14('0x99')](_0x235239[_0x3a2d9c]);}else{_0x235239[_0x3a2d9c]=this[_0xde14('0x9a')](_0x235239[_0x3a2d9c]);}}}}return _0x235239;};AGIVertices[_0xde14('0x16')][_0xde14('0x9b')]=function(_0x17fc25){for(var _0x991f3d in _0x17fc25){if(_0x17fc25[_0xde14('0x98')](_0x991f3d)){if(_[_0xde14('0x9c')](_0x17fc25[_0x991f3d])){this[_0xde14('0x9b')](_0x17fc25[_0x991f3d]);}else if(_[_0xde14('0x9d')](_0x17fc25[_0x991f3d])){for(var _0xe62f70=0x0;_0xe62f70<_0x17fc25[_0x991f3d][_0xde14('0x9e')];_0xe62f70++){this[_0xde14('0x9b')](_0x17fc25[_0x991f3d][_0xe62f70]);}}else if(_[_0xde14('0x9f')](_0x17fc25[_0x991f3d])){_0x17fc25[_0x991f3d]=this['replaceAllVariables'](_0x17fc25[_0x991f3d]);}}}};AGIVertices[_0xde14('0x16')][_0xde14('0xa0')]=function(_0x2b6562,_0x788855){for(var _0xe37a8a in _0x2b6562){if(_0x2b6562[_0xde14('0x98')](_0xe37a8a)){if(_['isPlainObject'](_0x2b6562[_0xe37a8a])){if(!_[_0xde14('0x47')](_0x2b6562[_0xe37a8a])){this[_0xde14('0xa0')](_0x2b6562[_0xe37a8a],util[_0xde14('0x2b')](_0xde14('0xa1'),_0x788855,_0xe37a8a));}}else if(_['isArray'](_0x2b6562[_0xe37a8a])){for(var _0x485151=0x0;_0x485151<_0x2b6562[_0xe37a8a]['length'];_0x485151++){this[_0xde14('0xa0')](_0x2b6562[_0xe37a8a][_0x485151],util[_0xde14('0x2b')](_0xde14('0xa1'),_0x788855,_0xe37a8a+'['+_0x485151+']'));}}else{if(!_[_0xde14('0x48')](_0x2b6562[_0xe37a8a])){this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')](_0xde14('0xa1'),_0x788855,_0xe37a8a),_0x2b6562[_0xe37a8a]);}}}}};AGIVertices[_0xde14('0x16')][_0xde14('0x99')]=function(_0xec6b8a){try{var _0xac2f9=JSON[_0xde14('0x6e')](_0xec6b8a);this[_0xde14('0x9b')](_0xac2f9);return JSON[_0xde14('0x76')](_0xac2f9);}catch(_0x36fefa){return this[_0xde14('0x9a')](_0xec6b8a);}};AGIVertices[_0xde14('0x16')]['replaceAllVariables']=function(_0x1ab722){var _0x52515f=_0x1ab722['split']('{');for(var _0x56a9d0=0x1;_0x56a9d0<_0x52515f['length'];_0x56a9d0+=0x1){var _0x1d95ff=_0x52515f[_0x56a9d0][_0xde14('0xa3')]('}');if(_0x1d95ff['length']>0x1){_0x1ab722=_0x1ab722[_0xde14('0xa4')]('{'+_0x1d95ff[0x0]+'}',this['channel'][_0xde14('0x11')](_0x1d95ff[0x0])[_0xde14('0xa5')]||_0x1d95ff[0x0]);}}if(_0x52515f['length']===0x1){return _0x1ab722[_0xde14('0x4f')]();}return this[_0xde14('0x9a')](_0x1ab722);};AGIVertices[_0xde14('0x16')][_0xde14('0xa6')]=function(_0x426727,_0x1db2f3){var _0x3bb899=this[_0xde14('0xe')][_0xde14('0x11')](_0x426727);if(_0x3bb899[_0xde14('0xa7')]===-0x1){return _0x3bb899;}logger[_0xde14('0x30')](util[_0xde14('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1db2f3,_0x3bb899[_0xde14('0xa5')]));return this['channel'][_0xde14('0xa2')](_0x1db2f3,_0x3bb899[_0xde14('0xa5')]);};AGIVertices[_0xde14('0x16')]['isConfigured']=function(_0x3d9ff9){return _0x3d9ff9&&_0x3d9ff9!=='0'&&_0x3d9ff9!=='-1'&&_0x3d9ff9!=='';};AGIVertices['prototype'][_0xde14('0xa8')]=function(_0x4bee01){this[_0xde14('0x39')][_0xde14('0x73')](this,_0x4bee01,'-');_0x4bee01[_0xde14('0xa9')]=_0x4bee01['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x3fb97c){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xaa'),_0x3fb97c['label']));if(!this[_0xde14('0x89')](_0x3fb97c[_0xde14('0x5e')])){return this['channel'][_0xde14('0xab')](_0xde14('0xac'));}var _0x4463ad='\x22'+_0x3fb97c[_0xde14('0x5e')]+'\x22';if(this[_0xde14('0x89')](_0x3fb97c[_0xde14('0x7c')])){_0x4463ad+=','+_0x3fb97c[_0xde14('0x7c')];}var _0x886c76=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0xae'),_0x4463ad);if(_0x886c76[_0xde14('0xa7')]===-0x1){return _0x886c76;}return this['channel'][_0xde14('0xab')](util['format'](_0xde14('0xaf'),_0x4463ad));};AGIVertices[_0xde14('0x16')]['mrcprecog']=function(_0x5b7a88){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xb0'),_0x5b7a88[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x5b7a88[_0xde14('0xb1')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20grammar\x20configured');}var _0x3ad8de=_0x5b7a88[_0xde14('0xb1')];if(this[_0xde14('0x89')](_0x5b7a88[_0xde14('0x7c')])){_0x3ad8de+=','+_0x5b7a88[_0xde14('0x7c')];}var _0x4ccf2e=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0xb2'),_0x3ad8de);if(_0x4ccf2e[_0xde14('0xa7')]===-0x1){return _0x4ccf2e;}var _0x2e4340=this[_0xde14('0xa6')](_0xde14('0xb3'),_0xde14('0xb4'));if(_0x2e4340[_0xde14('0xa7')]===-0x1){return _0x2e4340;}var _0x3af55d=this[_0xde14('0xa6')]('RECOG_INPUT()',_0xde14('0xb5'));if(_0x3af55d[_0xde14('0xa7')]===-0x1){return _0x3af55d;}var _0x4cb4ad=this['getAndSetVariable'](_0xde14('0xb6'),_0xde14('0xb7'));if(_0x4cb4ad[_0xde14('0xa7')]===-0x1){return _0x4cb4ad;}return this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0xb8'),_0x3ad8de));};AGIVertices[_0xde14('0x16')][_0xde14('0x7')]=function(_0x44181b){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xb9'),_0x44181b[_0xde14('0x3b')]));return this[_0xde14('0xe')][_0xde14('0x7')]([_0x44181b[_0xde14('0xba')],_0x44181b[_0xde14('0xbb')]]);};AGIVertices[_0xde14('0x16')][_0xde14('0xbc')]=function(_0x646fa9){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xbd'),_0x646fa9['label']));if(this['isConfigured'](_0x646fa9[_0xde14('0x68')])){logger[_0xde14('0x30')](util['format'](_0xde14('0xbe'),_0x646fa9['timeout']));var _0x593e49=this[_0xde14('0xe')]['wait'](_0x646fa9[_0xde14('0x68')]);if(_0x593e49[_0xde14('0xa7')]===-0x1){return _0x593e49;}}return this[_0xde14('0xe')][_0xde14('0xbc')]();};AGIVertices['prototype'][_0xde14('0x4e')]=function(_0x4821){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4821[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x4821[_0xde14('0x4c')])){return this['channel'][_0xde14('0x2e')](_0x4821,_0xde14('0xbf'));}_0x4821['scheduledAt']=moment();if(this[_0xde14('0x89')](_0x4821['delay'])){_0x4821[_0xde14('0x4d')]=moment()['add'](_0x4821[_0xde14('0xc0')],_0xde14('0xc1'));}if(!this[_0xde14('0x89')](_0x4821['callback_priority'])){_0x4821[_0xde14('0x50')]=0x2;}this[_0xde14('0x46')][_0xde14('0x73')](this,_0x4821);return this['channel'][_0xde14('0xab')](util['format'](_0xde14('0xc2'),_0x4821[_0xde14('0x4b')],_0x4821[_0xde14('0x4c')],_0x4821[_0xde14('0x4d')]));};AGIVertices['prototype'][_0xde14('0xc3')]=function(_0x11915d){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xc4'),_0x11915d[_0xde14('0x3b')]));var _0x19a4cc=this[_0xde14('0xe')][_0xde14('0xad')](_0x11915d[_0xde14('0xc5')],_0x11915d['options']);if(_0x19a4cc[_0xde14('0xa7')]===-0x1){return _0x19a4cc;}return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xc6'),_0x11915d[_0xde14('0xc5')],_0x11915d['options']));};AGIVertices[_0xde14('0x16')][_0xde14('0xc7')]=function(_0x24d95d){logger[_0xde14('0x30')](util['format'](_0xde14('0xc8'),_0x24d95d[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x24d95d[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}var _0x504dc3='\x22'+_0x24d95d['text']+'\x22';if(this['isConfigured'](_0x24d95d['options'])){_0x504dc3+=','+_0x24d95d[_0xde14('0x7c')];}var _0xd909e1=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0xae'),_0x504dc3);if(_0xd909e1[_0xde14('0xa7')]===-0x1){return _0xd909e1;}return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xaf'),_0x504dc3));};AGIVertices[_0xde14('0x16')][_0xde14('0xc9')]=function(_0x32ee79){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xca'),_0x32ee79['label']));if(!this[_0xde14('0x89')](_0x32ee79[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}var _0x42641a='\x22'+_0x32ee79[_0xde14('0x5e')]+'\x22';if(this['isConfigured'](_0x32ee79['options'])){_0x42641a+=','+_0x32ee79['options'];}var _0x33275e=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0xae'),_0x42641a);if(_0x33275e[_0xde14('0xa7')]===-0x1){return _0x33275e;}return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xaf'),_0x42641a));};AGIVertices[_0xde14('0x16')][_0xde14('0xcb')]=function(_0x28ccbe){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0xcc'),_0x28ccbe[_0xde14('0x3b')]));if(!this['isConfigured'](_0x28ccbe['grammar'])){return this['channel'][_0xde14('0xab')](_0xde14('0xcd'));}var _0x38e36b=_0x28ccbe['grammar'];if(this[_0xde14('0x89')](_0x28ccbe[_0xde14('0x7c')])){_0x38e36b+=','+_0x28ccbe['options'];}var _0x2f3517=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0xb2'),_0x38e36b);if(_0x2f3517[_0xde14('0xa7')]===-0x1){return _0x2f3517;}var _0x55de57=this[_0xde14('0xa6')](_0xde14('0xb3'),_0xde14('0xce'));if(_0x55de57[_0xde14('0xa7')]===-0x1){return _0x55de57;}var _0xb175c7=this[_0xde14('0xa6')](_0xde14('0xcf'),_0xde14('0xd0'));if(_0xb175c7[_0xde14('0xa7')]===-0x1){return _0xb175c7;}var _0x17e1ec=this[_0xde14('0xa6')]('RECOG_INSTANCE()',_0xde14('0xd1'));if(_0x17e1ec[_0xde14('0xa7')]===-0x1){return _0x17e1ec;}return this['channel'][_0xde14('0xab')](util['format'](_0xde14('0xb8'),_0x38e36b));};AGIVertices['prototype'][_0xde14('0xd2')]=function(_0x561b66){logger['info'](util[_0xde14('0x2b')](_0xde14('0xd3'),_0x561b66[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x561b66[_0xde14('0xb1')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20grammar\x20configured');}var _0x539b35=_0x561b66[_0xde14('0xb1')];if(this['isConfigured'](_0x561b66[_0xde14('0x7c')])){_0x539b35+=','+_0x561b66[_0xde14('0x7c')];}var _0x54d129=this['channel'][_0xde14('0xad')]('MRCPRecog',_0x539b35);if(_0x54d129[_0xde14('0xa7')]===-0x1){return _0x54d129;}var _0x59bd39=this['getAndSetVariable'](_0xde14('0xb3'),'SESTEK_ASR_CONFIDENCE');if(_0x59bd39[_0xde14('0xa7')]===-0x1){return _0x59bd39;}var _0x24f9b2=this[_0xde14('0xa6')](_0xde14('0xcf'),_0xde14('0xd4'));if(_0x24f9b2[_0xde14('0xa7')]===-0x1){return _0x24f9b2;}var _0x195c0b=this[_0xde14('0xa6')](_0xde14('0xb6'),'SESTEK_ASR_INSTANCE');if(_0x195c0b[_0xde14('0xa7')]===-0x1){return _0x195c0b;}return this['channel'][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xb8'),_0x539b35));};AGIVertices[_0xde14('0x16')][_0xde14('0xd5')]=function(_0x33f562){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x33f562[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x33f562['odbc_id'])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x33f562,'no\x20database\x20selected');}var _0x58387a=this[_0xde14('0x1a')][_0xde14('0x73')](this,_0x33f562[_0xde14('0xd6')]);if(!_0x58387a){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x33f562,_0xde14('0xd7'));}if(!this['isConfigured'](_0x33f562[_0xde14('0x32')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x33f562,_0xde14('0xd8'));}var _0x20ad12=_0x33f562[_0xde14('0x32')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xde14('0xab')](util['format'](_0xde14('0xd9'),_0x20ad12));var _0x1b39cf=this[_0xde14('0x2d')][_0xde14('0x73')](this,_0x58387a,_0x20ad12);this[_0xde14('0x39')][_0xde14('0x73')](this,_0x33f562,_0x20ad12);if(!this[_0xde14('0x89')](_0x33f562[_0xde14('0xda')])){return this['channel'][_0xde14('0xab')](_0xde14('0xdb'));}var _0x14b2ee=this[_0xde14('0x11')][_0xde14('0x73')](this,_0x33f562[_0xde14('0xda')]);if(!_0x14b2ee){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x33f562,_0xde14('0xdc'));}var _0x2569f8=this;_0x1b39cf[_0xde14('0xdd')](function(_0x175a30,_0x4f0a67){Object[_0xde14('0xde')](_0x175a30)['forEach'](function(_0x113627){_0x2569f8[_0xde14('0xe')]['setVariable'](util['format'](_0xde14('0xdf'),_0x14b2ee,_0x4f0a67,_0x113627),_0x175a30[_0x113627]);});});this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')](_0xde14('0xe0'),_0x14b2ee),_0x1b39cf[_0xde14('0x9e')]);return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('variable\x20%s\x20set',_0x14b2ee));};AGIVertices[_0xde14('0x16')]['dial']=function(_0x39a7e7){logger[_0xde14('0xe1')](util[_0xde14('0x2b')](_0xde14('0xe2'),_0x39a7e7[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x39a7e7['sip_id'])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x39a7e7,_0xde14('0xe3'));}var _0x1e1ae0=this[_0xde14('0x1c')]['sync'](this,_0x39a7e7[_0xde14('0xe4')]);if(!_0x1e1ae0){return this['channel']['error'](_0x39a7e7,_0xde14('0xe5'));}var _0x5263cc=this['channel'][_0xde14('0xad')]('DIAL',[util['format'](_0xde14('0xe6'),_0x1e1ae0),_0x39a7e7['timeout'],_0x39a7e7[_0xde14('0xe7')],_0x39a7e7[_0xde14('0x66')]]);if(_0x5263cc[_0xde14('0xa7')]===-0x1){return _0x5263cc;}return this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0xe8'),_0xde14('0xe9')));};AGIVertices[_0xde14('0x16')]['dialogflow']=function(_0x59640c){logger['info'](util['format'](_0xde14('0xea'),_0x59640c[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x59640c['key'])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xeb'));}if(!this['isConfigured'](_0x59640c[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}this[_0xde14('0xe')][_0xde14('0xec')]=!![];this[_0xde14('0x39')](_0x59640c);this['createSquareMessage'](_0x59640c[_0xde14('0x5e')],'in','','');this[_0xde14('0xe')]['noop'](util['format'](_0xde14('0xed'),_0x59640c[_0xde14('0x5e')]));var _0x2c9d93=this['googleDialogflow'][_0xde14('0x73')](this,_0x59640c);if(_0x2c9d93){for(var _0x3b750d in _0x2c9d93){if(_0x2c9d93[_0xde14('0x98')](_0x3b750d)){this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')](_0xde14('0xee'),_0x3b750d['toUpperCase']()),_0x2c9d93[_0x3b750d]);}}this[_0xde14('0x45')](_0x2c9d93[_0xde14('0xef')],_0xde14('0xf0'),'dialogflow','');return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xf1'),_0x2c9d93[_0xde14('0xef')]));}return this[_0xde14('0xe')][_0xde14('0x2e')](_0x59640c,_0xde14('0xf2'));};AGIVertices[_0xde14('0x16')][_0xde14('0xf3')]=function(_0x2e6993){logger['info'](util[_0xde14('0x2b')](_0xde14('0xf4'),_0x2e6993[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x2e6993[_0xde14('0xf5')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xf6'));}if(!this[_0xde14('0x89')](_0x2e6993[_0xde14('0x80')])){return this['channel'][_0xde14('0xab')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x2e6993[_0xde14('0x81')])){return this['channel'][_0xde14('0xab')](_0xde14('0xf7'));}if(!this[_0xde14('0x89')](_0x2e6993[_0xde14('0x82')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20anguage\x20configured');}if(!this[_0xde14('0x89')](_0x2e6993['text'])){return this['channel'][_0xde14('0xab')]('no\x20text\x20configured');}this[_0xde14('0xe')][_0xde14('0xec')]=!![];this[_0xde14('0x39')](_0x2e6993);this[_0xde14('0x45')](_0x2e6993[_0xde14('0x5e')],'in','','');this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('Trying\x20DialogflowV2:\x20%s',_0x2e6993[_0xde14('0x5e')]));var _0x5464b8=this[_0xde14('0x7f')][_0xde14('0x73')](this,_0x2e6993);if(_0x5464b8){for(var _0x12f579 in _0x5464b8){if(_0x5464b8[_0xde14('0x98')](_0x12f579)){if(_0x12f579!==_0xde14('0xf8')){this[_0xde14('0xe')][_0xde14('0xa2')](util['format'](_0xde14('0xee'),_0x12f579[_0xde14('0x6b')]()),_0x5464b8[_0x12f579]);}}}this[_0xde14('0x45')](_0x5464b8['speech'],_0xde14('0xf0'),'dialogflowV2',_0x5464b8['providerResponse']);return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xf9'),_0x5464b8[_0xde14('0xef')]));}return this[_0xde14('0xe')][_0xde14('0x2e')](_0x2e6993,_0xde14('0xfa'));};AGIVertices['prototype'][_0xde14('0xfb')]=function(_0x281010){logger['info'](util[_0xde14('0x2b')](_0xde14('0xfc'),_0x281010['label']));if(!this[_0xde14('0x89')](_0x281010[_0xde14('0xfd')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xde14('0x89')](_0x281010[_0xde14('0xfe')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xff'));}if(!this['isConfigured'](_0x281010[_0xde14('0x100')])){return this['channel'][_0xde14('0xab')](_0xde14('0x101'));}if(!this[_0xde14('0x89')](_0x281010[_0xde14('0x102')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}this['channel'][_0xde14('0xec')]=!![];this[_0xde14('0x39')](_0x281010);this['createSquareMessage'](_0x281010[_0xde14('0x5e')],'in','','');this['channel']['noop'](util[_0xde14('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x281010['text']));var _0x42137a=this[_0xde14('0x83')]['sync'](this,_0x281010);if(_0x42137a){for(var _0x1e4f3b in _0x42137a){if(_0x42137a[_0xde14('0x98')](_0x1e4f3b)){this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')]('SESTEK_NDA_%s',_0x1e4f3b['toUpperCase']()),_0x42137a[_0x1e4f3b]);}}this[_0xde14('0x45')](_0x42137a[_0xde14('0xef')],_0xde14('0xf0'),'sesteknda','');if(_0x42137a[_0xde14('0x103')]){this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x104'),_0x42137a['audiofile']));var _0x533318=this[_0xde14('0xe')][_0xde14('0x105')](_0x42137a['audiofile']);try{fs['unlink'](_0x42137a[_0xde14('0x103')]+'.wav');}catch(_0x546b0f){logger[_0xde14('0x2e')](_0x546b0f);}return _0x533318;}else{return this[_0xde14('0xe')]['noop'](util[_0xde14('0x2b')](_0xde14('0x106'),_0x42137a[_0xde14('0xef')]));}}return this[_0xde14('0xe')][_0xde14('0x2e')](_0x281010,_0xde14('0x107'));};AGIVertices[_0xde14('0x16')][_0xde14('0x108')]=function(_0x989ec7){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x109'),_0x989ec7['label']));return this[_0xde14('0xe')][_0xde14('0xab')]('end');};AGIVertices[_0xde14('0x16')][_0xde14('0x10a')]=function(_0x44cc13){logger['info'](util[_0xde14('0x2b')](_0xde14('0x10b'),_0x44cc13['label']));var _0x3907f9='';if(_0x44cc13[_0xde14('0x10c')]){if(!this[_0xde14('0x89')](_0x44cc13[_0xde14('0x10c')])){return this['channel']['error'](_0x44cc13,_0xde14('0x10d'));}else{var _0x1dcbe7=parseInt(_0x44cc13[_0xde14('0x10c')],0xa);if(isNaN(_0x1dcbe7)){_0x3907f9=_0x44cc13[_0xde14('0x10c')];}else{_0x3907f9=this[_0xde14('0x1e')][_0xde14('0x73')](this,_0x44cc13[_0xde14('0x10c')]);if(!_0x3907f9){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x44cc13,_0xde14('0x10e'));}}}}else if(_0x44cc13[_0xde14('0x10f')]){_0x3907f9=_0x44cc13[_0xde14('0x10f')];}else{return this['channel'][_0xde14('0x2e')](_0x44cc13,'no\x20trunk\x20selected');}var _0x2d70ae=this['channel'][_0xde14('0xad')](_0xde14('0xe9'),[util[_0xde14('0x2b')](_0xde14('0x110'),_0x3907f9,_0x44cc13[_0xde14('0x4b')]),_0x44cc13[_0xde14('0x68')],_0x44cc13[_0xde14('0xe7')],_0x44cc13[_0xde14('0x66')]]);if(_0x2d70ae[_0xde14('0xa7')]===-0x1){return _0x2d70ae;}return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('Executed\x20command\x20%s',_0xde14('0xe9')));};AGIVertices[_0xde14('0x16')]['finally']=function(_0x20e2af){logger['info'](util['format'](_0xde14('0x111'),_0x20e2af[_0xde14('0x3b')]));return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x112'));};AGIVertices[_0xde14('0x16')][_0xde14('0xc')]=function(_0x17aec4){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x113'),_0x17aec4['label']));if(_0x17aec4[_0xde14('0xa9')]===0x0){return this[_0xde14('0xa8')](_0x17aec4);}_0x17aec4['retry']-=0x1;if(!this['isConfigured'](_0x17aec4[_0xde14('0x114')])){return this['channel']['error'](_0x17aec4,_0xde14('0x115'));}var _0x53371d=this[_0xde14('0x20')][_0xde14('0x73')](this,_0x17aec4[_0xde14('0x114')]);if(!_0x53371d){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x17aec4,_0xde14('0x116'));}if(!this[_0xde14('0x89')](_0x17aec4[_0xde14('0xda')])){return this['channel'][_0xde14('0x2e')](_0xde14('0xdb'));}var _0x3a4ed2=this['channel'][_0xde14('0x117')](_0x53371d,_0x17aec4[_0xde14('0x118')],_0x17aec4[_0xde14('0x119')]);var _0x40b765=_0x3a4ed2[_0xde14('0xa7')]?_0x3a4ed2[_0xde14('0xa7')]['toString']():'';logger[_0xde14('0x30')](_0xde14('0x11a'),JSON['stringify'](_0x3a4ed2));if(_0x3a4ed2[_0xde14('0xa7')]===-0x1){this['createSquareDetailsReport'][_0xde14('0x73')](this,_0x17aec4,_0x40b765);return _0x3a4ed2;}else if(_0x3a4ed2[_0xde14('0xa5')]===_0xde14('0x68')){_0x3a4ed2[_0xde14('0xa7')]=_0x40b765[_0xde14('0x9e')]>=parseInt(_0x17aec4[_0xde14('0x11b')])?'x':'i';}else{_0x3a4ed2[_0xde14('0xa7')]=_0x40b765[_0xde14('0x9e')]>=parseInt(_0x17aec4[_0xde14('0x11b')])&&_0x40b765[_0xde14('0x9e')]<=parseInt(_0x17aec4['maxdigit'])?'x':'i';}var _0x45cfb0=this['getVariable']['sync'](this,_0x17aec4[_0xde14('0xda')]);if(!_0x45cfb0){return this[_0xde14('0xe')]['error'](_0x17aec4,_0xde14('0xdc'));}this[_0xde14('0xe')]['setVariable'](_0x45cfb0,_0x40b765);if(this[_0xde14('0x89')](_0x17aec4[_0xde14('0x11c')])){var _0x4ee79f=parseInt(_0x17aec4[_0xde14('0x11c')],0xa);var _0x437f1b=rs['generate']({'charset':'*','length':_0x4ee79f});var _0x4ad0ad=_0x40b765[_0xde14('0x9e')];if(_0x4ad0ad>0x0){if(_0x4ad0ad>_0x4ee79f){this['createSquareDetailsReport']['sync'](this,_0x17aec4,_0x17aec4[_0xde14('0x11d')]===_0xde14('0x11e')?_0x437f1b+_0x40b765[_0xde14('0x11f')](_0x4ee79f):_0x40b765[_0xde14('0x11f')](0x0,_0x4ad0ad-_0x4ee79f)+_0x437f1b);}else{this[_0xde14('0x39')][_0xde14('0x73')](this,_0x17aec4,rs[_0xde14('0x120')]({'charset':'*','length':_0x4ad0ad}));}}else{this[_0xde14('0x39')][_0xde14('0x73')](this,_0x17aec4,'');}}else{this['createSquareDetailsReport'][_0xde14('0x73')](this,_0x17aec4,_0x40b765);}return _0x3a4ed2;};AGIVertices[_0xde14('0x16')][_0xde14('0xd')]=function(_0x34347e){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x121'),_0x34347e[_0xde14('0x3b')]));return this['getdigits'](_0x34347e);};AGIVertices['prototype'][_0xde14('0x122')]=function(_0xa77a11){logger[_0xde14('0x30')](util['format'](_0xde14('0x123'),_0xa77a11[_0xde14('0x3b')]));this[_0xde14('0x39')][_0xde14('0x73')](this,_0xa77a11,_0xa77a11['goalname']);return this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0x124'),_0xa77a11[_0xde14('0x125')]));};AGIVertices['prototype'][_0xde14('0x126')]=function(_0x188fec){logger['info'](util[_0xde14('0x2b')](_0xde14('0x127'),_0x188fec[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x188fec[_0xde14('0x8b')])||!this[_0xde14('0x89')](_0x188fec[_0xde14('0x8c')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x128'));}if(!this[_0xde14('0x89')](_0x188fec[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20text\x20configured');}this[_0xde14('0xe')]['noop'](util[_0xde14('0x2b')](_0xde14('0x129'),_0x188fec['text']));var _0x4f226d=this[_0xde14('0x12a')]['sync'](this,_0x188fec);if(_0x4f226d){this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x12b'),_0x4f226d));var _0x3a7af3=this[_0xde14('0xe')][_0xde14('0x105')](_0x4f226d);try{fs[_0xde14('0x12c')](_0x4f226d+_0xde14('0x12d'));}catch(_0x2a9b06){logger[_0xde14('0x2e')](_0x2a9b06);}return _0x3a7af3;}return this[_0xde14('0xe')][_0xde14('0x2e')](_0x188fec,_0xde14('0x12e'));};AGIVertices['prototype'][_0xde14('0x12f')]=function(_0x2418aa){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2418aa['label']));if(!this[_0xde14('0x89')](_0x2418aa[_0xde14('0x8b')])||!this[_0xde14('0x89')](_0x2418aa[_0xde14('0x8c')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x2418aa[_0xde14('0x91')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x130'));}if(!this[_0xde14('0x89')](_0x2418aa[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}this[_0xde14('0xe')][_0xde14('0xec')]=!![];this[_0xde14('0x39')](_0x2418aa);this[_0xde14('0x45')](_0x2418aa[_0xde14('0x5e')],'in','','');this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('Trying\x20Amazon\x20Lex:\x20%s',_0x2418aa[_0xde14('0x5e')]));var _0xeccdec=this[_0xde14('0x90')][_0xde14('0x73')](this,_0x2418aa);if(_0xeccdec){for(var _0x35d2d1 in _0xeccdec){if(_0xeccdec[_0xde14('0x98')](_0x35d2d1)&&_[_0xde14('0x9f')](_0xeccdec[_0x35d2d1])){this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')]('AWS_LEX_%s',_0x35d2d1[_0xde14('0x6b')]()),_0xeccdec[_0x35d2d1]);}}if(_[_0xde14('0x48')](_0xeccdec[_0xde14('0x7a')])){return this['channel']['noop'](_0xde14('0x131'));}else{this[_0xde14('0x45')](_0xeccdec[_0xde14('0x7a')],_0xde14('0xf0'),'amazonlex','');return this['channel'][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x132'),_0xeccdec[_0xde14('0x7a')]));}}return this[_0xde14('0xe')][_0xde14('0x2e')](_0x2418aa,_0xde14('0x133'));};AGIVertices['prototype'][_0xde14('0x134')]=function(_0x23f836){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x135'),_0x23f836['label'],_0x23f836[_0xde14('0x68')]));if(!this[_0xde14('0x89')](_0x23f836[_0xde14('0x7e')])){return this[_0xde14('0xe')][_0xde14('0xab')]('no\x20key\x20configured');}var _0x414d78=_0xde14('0x136');var _0x535874=util[_0xde14('0x2b')](_0xde14('0x137'),FILES_PATH,rs[_0xde14('0x120')](0x4));var _0x4123ee=util['format'](_0xde14('0xa1'),_0x535874,_0x414d78);var _0x110ed9=!![];if(_0x23f836[_0xde14('0x138')]==='NOBEEP'){_0x110ed9=![];}var _0x5d1855=this[_0xde14('0xe')][_0xde14('0x139')](_0x535874,_0x414d78,_0x23f836[_0xde14('0x13a')],_0x23f836['timeout'],undefined,_0x110ed9);if(_0x5d1855[_0xde14('0xa7')]!==-0x1){this['channel'][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x13b'),_0x4123ee));var _0x50fed2=this[_0xde14('0x92')][_0xde14('0x73')](this,_0x23f836,_0x4123ee);if(_0x50fed2){for(var _0x1bae5c in _0x50fed2){if(_0x50fed2[_0xde14('0x98')](_0x1bae5c)){this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')](_0xde14('0x13c'),_0x1bae5c['toUpperCase']()),_0x50fed2[_0x1bae5c]);}}return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x50fed2)));}}return _0x5d1855;};AGIVertices[_0xde14('0x16')][_0xde14('0x13d')]=function(_0x27ad9f){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x13e'),_0x27ad9f[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x27ad9f[_0xde14('0x95')])){return this[_0xde14('0xe')]['noop'](_0xde14('0x13f'));}if(!this[_0xde14('0x89')](_0x27ad9f[_0xde14('0x140')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x141'));}var _0x2e92ca=_0xde14('0x136');var _0x40a040=util[_0xde14('0x2b')](_0xde14('0x137'),FILES_PATH,rs['generate'](0x4));var _0x369f0e=util[_0xde14('0x2b')](_0xde14('0xa1'),_0x40a040,_0x2e92ca);var _0x5eb127=!![];if(_0x27ad9f[_0xde14('0x138')]===_0xde14('0x142')){_0x5eb127=![];}var _0x456165=this[_0xde14('0xe')][_0xde14('0x139')](_0x40a040,_0x2e92ca,_0x27ad9f[_0xde14('0x13a')],_0x27ad9f[_0xde14('0x68')],undefined,_0x5eb127);if(_0x456165['result']!==-0x1){this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x143'),_0x369f0e));var _0x1fe8b1=this['tildeASR']['sync'](this,_0x27ad9f,_0x369f0e);if(_0x1fe8b1){for(var _0x5a03a6 in _0x1fe8b1){if(_0x1fe8b1[_0xde14('0x98')](_0x5a03a6)){this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')]('TILDE_ASR_%s',_0x5a03a6[_0xde14('0x6b')]()),_0x1fe8b1[_0x5a03a6]);}}return this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0x144'),JSON[_0xde14('0x76')](_0x1fe8b1)));}}return _0x456165;};AGIVertices[_0xde14('0x16')][_0xde14('0x145')]=function(_0x375d9f){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x146'),_0x375d9f[_0xde14('0x3b')]));return this[_0xde14('0xe')]['continueAt'](_0x375d9f[_0xde14('0x41')],_0x375d9f[_0xde14('0x147')],_0x375d9f[_0xde14('0x148')]);};AGIVertices[_0xde14('0x16')]['gotoif']=function(_0x45636b){logger['info'](util['format'](_0xde14('0x149'),_0x45636b['label']));if(!this[_0xde14('0x89')](_0x45636b[_0xde14('0x14a')])){return this[_0xde14('0xe')]['error'](_0x45636b,_0xde14('0x14b'));}try{var _0x4444a0=eval(_0x45636b[_0xde14('0x14a')])?_0xde14('0x14c'):'false';this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0x14d'),_0x45636b['condition'],_0x4444a0));return{'code':0xc8,'result':_0x4444a0};}catch(_0x1475fa){return{'code':0xc8,'result':_0xde14('0x14e')};}};AGIVertices[_0xde14('0x16')][_0xde14('0x14f')]=function(_0xba6900){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x150'),_0xba6900[_0xde14('0x3b')]));if(!this['isConfigured'](_0xba6900[_0xde14('0x151')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0xba6900,_0xde14('0x152'));}var _0x39b35f=this[_0xde14('0x153')]['sync'](this,_0xba6900[_0xde14('0x151')]);if(!_0x39b35f){return this[_0xde14('0xe')]['error'](_0xba6900,_0xde14('0x154'));}for(var _0x3ccee7=0x0;_0x3ccee7<_0x39b35f[_0xde14('0x9e')];_0x3ccee7+=0x1){var _0x550992=this[_0xde14('0xe')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x39b35f[_0x3ccee7]));if(_0x550992[_0xde14('0xa7')]===-0x1){return _0x550992;}logger['info'](util[_0xde14('0x2b')](_0xde14('0x155'),_0x39b35f[_0x3ccee7],_0x550992['extra']));if(_0x550992['extra']===_0xde14('0x14c')){logger['info'](util[_0xde14('0x2b')](_0xde14('0x155'),_0x39b35f[_0x3ccee7],'true'));this[_0xde14('0xe')]['noop'](util[_0xde14('0x2b')](_0xde14('0x155'),_0x39b35f[_0x3ccee7],'true'));return{'code':0xc8,'result':_0xde14('0x14c')};}else{logger[_0xde14('0x30')](util[_0xde14('0x2b')]('IFTIME\x20%s\x20%s',_0x39b35f[_0x3ccee7],'false'));this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x155'),_0x39b35f[_0x3ccee7],_0xde14('0x14e')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xde14('0x16')][_0xde14('0x156')]=function(_0x1a3d33){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1a3d33[_0xde14('0x3b')]));return this[_0xde14('0xe')]['hangup']();};AGIVertices[_0xde14('0x16')][_0xde14('0x157')]=function(_0x1c0813){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1c0813[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x1c0813[_0xde14('0x7e')])){return this[_0xde14('0xe')]['noop'](_0xde14('0xeb'));}var _0x59be8a=_0xde14('0x136');var _0x2d91e5=util[_0xde14('0x2b')](_0xde14('0x137'),FILES_PATH,rs[_0xde14('0x120')](0x4));var _0x326ab6=util[_0xde14('0x2b')](_0xde14('0xa1'),_0x2d91e5,_0x59be8a);var _0x1637dd=!![];if(_0x1c0813[_0xde14('0x138')]===_0xde14('0x142')){_0x1637dd=![];}var _0x1b2501=this['channel'][_0xde14('0x139')](_0x2d91e5,_0x59be8a,_0x1c0813['intKey'],_0x1c0813[_0xde14('0x68')],undefined,_0x1637dd);if(_0x1b2501[_0xde14('0xa7')]!==-0x1){this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('ispeech\x20%s\x20file\x20created',_0x326ab6));var _0x3c2f49=this[_0xde14('0x87')]['sync'](this,_0x1c0813,_0x326ab6);if(_0x3c2f49){for(var _0x3a9df8 in _0x3c2f49){if(_0x3c2f49['hasOwnProperty'](_0x3a9df8)){this['channel'][_0xde14('0xa2')](util['format'](_0xde14('0x158'),_0x3a9df8['toUpperCase']()),_0x3c2f49[_0x3a9df8]);}}return this[_0xde14('0xe')]['noop'](util[_0xde14('0x2b')](_0xde14('0x159'),JSON[_0xde14('0x76')](_0x3c2f49)));}}return _0x1b2501;};AGIVertices[_0xde14('0x16')][_0xde14('0x15a')]=function(_0x19c9b0){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x15b'),_0x19c9b0[_0xde14('0x3b')]));if(!this['isConfigured'](_0x19c9b0[_0xde14('0x7e')])){return this['channel']['noop'](_0xde14('0xeb'));}if(!this['isConfigured'](_0x19c9b0['text'])){return this['channel'][_0xde14('0xab')](_0xde14('0xac'));}this[_0xde14('0xe')]['noop'](util[_0xde14('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x19c9b0[_0xde14('0x5e')]));var _0x5cb1e5=this['ispeechTTS']['sync'](this,_0x19c9b0);if(_0x5cb1e5){this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x15c'),_0x5cb1e5));var _0x4697f=this[_0xde14('0xe')][_0xde14('0x105')](_0x5cb1e5,_0x19c9b0[_0xde14('0x13a')]);try{fs[_0xde14('0x12c')](_0x5cb1e5+_0xde14('0x12d'));}catch(_0x47baf5){logger[_0xde14('0x2e')](_0x47baf5);}return _0x4697f;}return this['channel']['error'](_0x19c9b0,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xde14('0x16')][_0xde14('0x15d')]=function(_0x2b950f){logger['info'](util[_0xde14('0x2b')](_0xde14('0x15e'),_0x2b950f['label']));if(!this[_0xde14('0x89')](_0x2b950f['findBy'])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x2b950f,_0xde14('0x15f'));}logger[_0xde14('0x30')](util[_0xde14('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xde14('0xe')][_0xde14('0x3e')],_0x2b950f['findBy']));var _0x4f2a56=this[_0xde14('0x57')][_0xde14('0x73')](this,_0x2b950f[_0xde14('0x160')]);if(_0x4f2a56){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x161'),this[_0xde14('0xe')]['callerid'],_0x2b950f[_0xde14('0x160')]));this['channel'][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x161'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x2b950f[_0xde14('0x160')]));return{'code':0xc8,'result':_0xde14('0x162')};}else{logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x163'),this[_0xde14('0xe')]['callerid'],_0x2b950f[_0xde14('0x160')]));this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x163'),this['channel'][_0xde14('0x3e')],_0x2b950f['findBy']));return{'code':0xc8,'result':_0xde14('0x164')};}};AGIVertices[_0xde14('0x16')][_0xde14('0x165')]=function(_0x15ce1e){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x15ce1e[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x15ce1e[_0xde14('0x160')])){return this['channel'][_0xde14('0x2e')](_0x15ce1e,_0xde14('0x15f'));}logger[_0xde14('0x30')](util[_0xde14('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xde14('0xe')][_0xde14('0x3e')],_0x15ce1e[_0xde14('0x160')]));var _0x24d34c=this['agentLogout'][_0xde14('0x73')](this,_0x15ce1e[_0xde14('0x160')]);if(_0x24d34c){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xde14('0xe')][_0xde14('0x3e')],_0x15ce1e[_0xde14('0x160')]));this[_0xde14('0xe')]['noop'](util['format'](_0xde14('0x161'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x15ce1e[_0xde14('0x160')]));return{'code':0xc8,'result':_0xde14('0x162')};}else{logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x163'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x15ce1e[_0xde14('0x160')]));this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x163'),this['channel'][_0xde14('0x3e')],_0x15ce1e['findBy']));return{'code':0xc8,'result':_0xde14('0x164')};}};AGIVertices[_0xde14('0x16')]['math']=function(_0x450446){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x166'),_0x450446[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x450446[_0xde14('0x167')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x450446,_0xde14('0x168'));}this['channel']['noop'](util['format'](_0xde14('0x169'),_0x450446['operation']));var _0x30596=eval(_0x450446[_0xde14('0x167')]);if(!this['isConfigured'](_0x450446['variable_id'])){return this[_0xde14('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5651bd=this[_0xde14('0x11')]['sync'](this,_0x450446['variable_id']);if(!_0x5651bd){return this['channel'][_0xde14('0x2e')](_0x450446,_0xde14('0xdc'));}if(_[_0xde14('0x9d')](_0x30596)){var _0x202b9b=this;_0x30596['forEach'](function(_0x51c122,_0x54f94a){_0x202b9b[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')](_0xde14('0x16a'),_0x5651bd,_0x54f94a),_0x51c122);});return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')]('variable\x20%s[key]\x20set',_0x5651bd));}else{return this[_0xde14('0xe')][_0xde14('0xa2')](_0x5651bd,_0x30596);}};AGIVertices['prototype']['menu']=function(_0x521c39){logger[_0xde14('0x30')](util['format'](_0xde14('0x16b'),_0x521c39[_0xde14('0x3b')]));if(_0x521c39[_0xde14('0xa9')]===0x0){return this[_0xde14('0xa8')](_0x521c39);}_0x521c39[_0xde14('0xa9')]-=0x1;if(!this[_0xde14('0x89')](_0x521c39[_0xde14('0x114')])){return this[_0xde14('0xe')]['error'](_0x521c39,_0xde14('0x115'));}var _0x57ee7c=this['getSound']['sync'](this,_0x521c39[_0xde14('0x114')]);if(!_0x57ee7c){return this['channel'][_0xde14('0x2e')](_0x521c39,'no\x20file\x20audio\x20found');}var _0x3946de=this[_0xde14('0xe')][_0xde14('0x117')](_0x57ee7c,_0x521c39[_0xde14('0x118')],_0x521c39['digit']);var _0x287cfd=_0x3946de[_0xde14('0xa7')];if(_0x3946de['result']===-0x1){this[_0xde14('0x39')]['sync'](this,_0x521c39,'-1');return _0x3946de;}else if(_0x3946de[_0xde14('0xa5')]==='timeout'){_0x3946de[_0xde14('0xa7')]=_0x3946de[_0xde14('0xa7')][_0xde14('0x9e')]>0x0?_0x3946de['result']:'t';}else if(_[_0xde14('0x47')](_0x3946de[_0xde14('0xa7')])){_0x3946de['result']='#';_0x287cfd='#';}if(!this['isConfigured'](_0x521c39[_0xde14('0xda')])){this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xdb'));}else{var _0x111280=this[_0xde14('0x11')][_0xde14('0x73')](this,_0x521c39[_0xde14('0xda')]);if(!_0x111280){return this['channel']['error'](_0x521c39,'no\x20variable\x20found');}this[_0xde14('0xe')][_0xde14('0xa2')](_0x111280,_0x287cfd);}this[_0xde14('0x39')]['sync'](this,_0x521c39,_0x287cfd);return _0x3946de;};AGIVertices[_0xde14('0x16')][_0xde14('0xab')]=function(_0x3cd310){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x16c'),_0x3cd310[_0xde14('0x3b')]));return this['channel'][_0xde14('0xab')](_0x3cd310[_0xde14('0x16d')]||_0x3cd310[_0xde14('0x3b')]);};AGIVertices[_0xde14('0x16')]['pause']=function(_0x6ebe80){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x6ebe80['label']));if(!this['isConfigured'](_0x6ebe80[_0xde14('0x160')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x6ebe80,'no\x20find\x20by\x20configured');}logger['info'](util[_0xde14('0x2b')](_0xde14('0x16e'),this['channel']['callerid'],_0x6ebe80[_0xde14('0x160')]));var _0x8c0dbf=this[_0xde14('0x51')]['sync'](this,_0x6ebe80[_0xde14('0x16f')]);var _0x3b2938=this['agentPause']['sync'](this,_0x6ebe80[_0xde14('0x160')],_0x8c0dbf);if(_0x3b2938){logger['info'](util[_0xde14('0x2b')](_0xde14('0x161'),this[_0xde14('0xe')]['callerid'],_0x6ebe80[_0xde14('0x160')]));this[_0xde14('0xe')][_0xde14('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xde14('0x3e')],_0x6ebe80[_0xde14('0x160')]));return{'code':0xc8,'result':'success'};}else{logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x163'),this['channel'][_0xde14('0x3e')],_0x6ebe80[_0xde14('0x160')]));this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0x161'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x6ebe80[_0xde14('0x160')]));return{'code':0xc8,'result':_0xde14('0x164')};}};AGIVertices['prototype']['playback']=function(_0x1afe52){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1afe52[_0xde14('0x3b')]));if(!this['isConfigured'](_0x1afe52[_0xde14('0x114')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x1afe52,_0xde14('0x115'));}var _0x51758f=this[_0xde14('0x20')][_0xde14('0x73')](this,_0x1afe52[_0xde14('0x114')]);if(!_0x51758f){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x1afe52,_0xde14('0x116'));}var _0x21d47f=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0x170'),[_0x51758f,_0x1afe52['opts']]);if(_0x21d47f[_0xde14('0xa7')]===-0x1){return _0x21d47f;}return this['channel']['noop'](util[_0xde14('0x2b')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x51758f));};AGIVertices[_0xde14('0x16')][_0xde14('0x171')]=function(_0x5a299e){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x172'),_0x5a299e[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x5a299e['queue_id'])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x5a299e,_0xde14('0x173'));}var _0x343bf9='';var _0x2fb734=parseInt(_0x5a299e[_0xde14('0x174')],0xa);if(isNaN(_0x2fb734)){_0x343bf9=_0x5a299e[_0xde14('0x174')];}else{_0x343bf9=this[_0xde14('0x17')][_0xde14('0x73')](this,_0x5a299e['queue_id']);if(!_0x343bf9){return this['channel'][_0xde14('0x2e')](_0x5a299e,_0xde14('0x175'));}}var _0x333eb7='';if(this[_0xde14('0x89')](_0x5a299e[_0xde14('0x114')])){var _0x8642b3=this[_0xde14('0x20')][_0xde14('0x73')](this,_0x5a299e[_0xde14('0x114')]);if(_0x8642b3){_0x333eb7=_0x8642b3;}}this['createSquareDetailsReport'][_0xde14('0x73')](this,_0x5a299e,_0x343bf9);if(_0x5a299e[_0xde14('0xe7')][_0xde14('0x176')]('x')<0x0){_0x5a299e['opts']+='x';}if(_0x5a299e[_0xde14('0xe7')][_0xde14('0x176')]('X')<0x0){_0x5a299e[_0xde14('0xe7')]+='X';}this[_0xde14('0xe')][_0xde14('0xa2')](_0xde14('0x177'),_0x343bf9?_0x343bf9[_0xde14('0x178')]():'');var _0x4dd128=this[_0xde14('0xe')][_0xde14('0xad')](_0xde14('0x179'),[_0x343bf9,_0x5a299e[_0xde14('0xe7')],_0x5a299e[_0xde14('0x66')],_0x333eb7,_0x5a299e[_0xde14('0x68')],_0x5a299e[_0xde14('0x7')],_0x5a299e[_0xde14('0x17a')],_0x5a299e['gosub'],'',_0x5a299e[_0xde14('0x17b')]]);if(_0x4dd128[_0xde14('0xa7')]===-0x1){return _0x4dd128;}return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0xc6'),_0xde14('0x179'),_0x343bf9));};AGIVertices[_0xde14('0x16')]['record']=function(_0x3b92a1){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x17c'),_0x3b92a1[_0xde14('0x3b')]));var _0x594776=_0x3b92a1['recordingFormat']||_0xde14('0x136');var _0x455e36=util[_0xde14('0x2b')](_0xde14('0x17d'),this['channel'][_0xde14('0x3a')],rs[_0xde14('0x120')](0x5));var _0x33be53=util['format'](_0xde14('0x17e'),FILES_PATH,_0x455e36,_0x594776);var _0x49207f=util[_0xde14('0x2b')]('%s/recordings/%s',FILES_PATH,_0x455e36);this[_0xde14('0x3f')]['sync'](this,_0x3b92a1,_0x455e36,_0x33be53);this[_0xde14('0xe')]['setVariable'](_0xde14('0x17f'),_0x455e36);logger[_0xde14('0x30')](_0xde14('0x180'),_0x49207f,_0x594776,_0x3b92a1[_0xde14('0x181')],_0x3b92a1[_0xde14('0x68')]);return this['channel'][_0xde14('0x139')](_0x49207f,_0x594776,_0x3b92a1[_0xde14('0x181')],_0x3b92a1[_0xde14('0x68')],undefined,!![]);};AGIVertices[_0xde14('0x16')]['restapi']=function(_0x2e918b){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x182'),_0x2e918b[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x2e918b[_0xde14('0x66')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x183'));}var _0x16f024=this['restAPI']['sync'](this,_0x2e918b);logger[_0xde14('0x30')](util['format'](_0xde14('0x184'),util[_0xde14('0x185')](_0x16f024,{'showHidden':![],'depth':null})));if(!this[_0xde14('0x89')](_0x2e918b[_0xde14('0xda')])){return this['channel']['noop'](_0xde14('0x186'));}var _0x16fb7e=this[_0xde14('0x11')][_0xde14('0x73')](this,_0x2e918b[_0xde14('0xda')]);if(!_0x16fb7e){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x2e918b,_0xde14('0xdc'));}this[_0xde14('0xe')][_0xde14('0xa2')](util[_0xde14('0x2b')](_0xde14('0x187'),_0x16fb7e),_0x16f024['statusCode']?_0x16f024[_0xde14('0x79')]:_0xde14('0x188'));this['channel'][_0xde14('0xa2')](util[_0xde14('0x2b')]('%s_STATUS_MESSAGE',_0x16fb7e),_0x16f024['statusMessage']?_0x16f024[_0xde14('0x78')]:'OK');if(_0x16f024['body']){try{this[_0xde14('0xa0')](_0x16f024[_0xde14('0x6c')],_0x16fb7e);}catch(_0x1bcfe9){logger[_0xde14('0x2e')](util[_0xde14('0x2b')](_0xde14('0x189'),_0x16fb7e));}}return this['channel'][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x18a'),_0x16fb7e));};AGIVertices[_0xde14('0x16')][_0xde14('0x18b')]=function(_0x393003){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x18c'),_0x393003['label']));return this[_0xde14('0xe')]['sayDigits'](_0x393003[_0xde14('0x18d')][_0xde14('0x5c')](/\s+/g,''),_0x393003[_0xde14('0x181')]);};AGIVertices[_0xde14('0x16')][_0xde14('0x18e')]=function(_0x469076){logger[_0xde14('0x30')](util['format'](_0xde14('0x18f'),_0x469076[_0xde14('0x3b')]));return this['channel']['sayNumber'](_0x469076[_0xde14('0x67')][_0xde14('0x5c')](/\s+/g,''),_0x469076[_0xde14('0x181')]);};AGIVertices[_0xde14('0x16')][_0xde14('0x190')]=function(_0x21b30c){logger['info'](util[_0xde14('0x2b')](_0xde14('0x191'),_0x21b30c[_0xde14('0x3b')]));return this['channel'][_0xde14('0x192')](_0x21b30c['text'],_0x21b30c[_0xde14('0x181')]);};AGIVertices[_0xde14('0x16')][_0xde14('0x193')]=function(_0x46811a){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x194'),_0x46811a[_0xde14('0x3b')]));if(!this['isConfigured'](_0x46811a[_0xde14('0x195')])){return this[_0xde14('0xe')]['noop'](_0xde14('0x196'));}var _0x587f65=this['getMailAccount'][_0xde14('0x73')](this,_0x46811a[_0xde14('0x195')]);if(!_0x587f65||!_0x587f65[_0xde14('0x197')]){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x46811a,'no\x20mail\x20account\x20found');}var _0x19e117={'from':util[_0xde14('0x2b')](_0xde14('0x198'),_0x587f65[_0xde14('0x14')],_0x587f65[_0xde14('0x199')]||_0x587f65[_0xde14('0x197')][_0xde14('0x19a')]),'to':_0x46811a['to']||'','cc':_0x46811a['cc']||'','bcc':_0x46811a[_0xde14('0x19b')]||'','subject':_0x46811a[_0xde14('0x19c')],'html':_0x46811a['text'],'text':_0x46811a['text']};if(this[_0xde14('0x89')](_0x46811a[_0xde14('0x19d')])){}logger['debug'](_0xde14('0x19e'),JSON['stringify'](_0x19e117));this[_0xde14('0x39')][_0xde14('0x73')](this,_0x46811a,_0x46811a[_0xde14('0x195')]);this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x19f'),_0x587f65[_0xde14('0x14')]));this['sendMailMessage'][_0xde14('0x73')](this,_0x587f65[_0xde14('0x1a0')],_0x19e117);return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x1a1'));};AGIVertices[_0xde14('0x16')]['sendFax']=function(_0x8df4c6){logger['info'](util[_0xde14('0x2b')](_0xde14('0x1a2'),_0x8df4c6['label']));return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x1a3'));};AGIVertices[_0xde14('0x16')][_0xde14('0x1a4')]=function(_0x7e6ec5){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x7e6ec5[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x7e6ec5['sms_account_id'])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x1a5'));}var _0x6a02bb=this[_0xde14('0x36')][_0xde14('0x73')](this,_0x7e6ec5['sms_account_id']);if(!_0x6a02bb){return this[_0xde14('0xe')]['error'](_0x7e6ec5,_0xde14('0x1a6'));}var _0x1587a2={'body':_0x7e6ec5[_0xde14('0x1a7')],'phone':_0x7e6ec5['to']||'','SmsAccountId':_0x6a02bb['id']};logger['debug'](_0xde14('0x1a8'),JSON[_0xde14('0x76')](_0x1587a2));this['createSquareDetailsReport'][_0xde14('0x73')](this,_0x7e6ec5,_0x7e6ec5[_0xde14('0x1a9')]);this['channel'][_0xde14('0xab')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x6a02bb[_0xde14('0x14')]));this[_0xde14('0x38')]['sync'](this,_0x1587a2);return this['channel'][_0xde14('0xab')](_0xde14('0x1aa'));};AGIVertices[_0xde14('0x16')][_0xde14('0x1ab')]=function(_0x3d7a0d){logger[_0xde14('0x30')](util['format'](_0xde14('0x1ac'),_0x3d7a0d[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x3d7a0d[_0xde14('0xda')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x3d7a0d,'no\x20variable\x20selected');}var _0x1ce2e1=this[_0xde14('0x11')][_0xde14('0x73')](this,_0x3d7a0d[_0xde14('0xda')]);if(!_0x1ce2e1){return this[_0xde14('0xe')]['error'](_0x3d7a0d,_0xde14('0xdc'));}return this[_0xde14('0xe')][_0xde14('0xa2')](_0x1ce2e1,_0x3d7a0d['variable_value']);};AGIVertices[_0xde14('0x16')][_0xde14('0x1ad')]=function(_0x35f4ad){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x1ae'),_0x35f4ad['label']));this[_0xde14('0xe')]['noop'](_0xde14('0x1af'));var _0x58a34d=this[_0xde14('0xe')][_0xde14('0x11')](_0xde14('0x1b0'));if(!_[_0xde14('0x47')](_0x58a34d[_0xde14('0xa5')])){this[_0xde14('0xe')][_0xde14('0x3a')]=_0x58a34d[_0xde14('0xa5')];}if(_0x35f4ad[_0xde14('0xbc')]===_0xde14('0x1b1')){this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x1b2'));return this[_0xde14('0xe')][_0xde14('0xbc')]();}return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0x1b3'));};AGIVertices[_0xde14('0x16')][_0xde14('0x1b4')]=function(_0x1671fc){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x1b5'),_0x1671fc['label']));if(!this[_0xde14('0x89')](_0x1671fc[_0xde14('0x1b6')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x1671fc,'no\x20subproject\x20selected');}var _0x3c1f1b=this[_0xde14('0x18')][_0xde14('0x73')](this,_0x1671fc[_0xde14('0x1b6')]);if(!this['isConfigured'](_0x3c1f1b)){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x1671fc,util[_0xde14('0x2b')](_0xde14('0x1b7'),_0x1671fc[_0xde14('0x1b6')]));}if(_0x3c1f1b===this[_0xde14('0xe')]['arg_1']){return this['channel'][_0xde14('0x2e')](_0x1671fc,_0xde14('0x1b8'));}this[_0xde14('0x39')][_0xde14('0x73')](this,_0x1671fc,_0x3c1f1b);var _0x3f55c3=this[_0xde14('0xe')][_0xde14('0xad')]('AGI',util['format'](_0xde14('0x1b9'),config[_0xde14('0x7')]['host']||_0xde14('0x1ba'),_0x3c1f1b,this[_0xde14('0xe')]['arg_1']));if(_0x3f55c3[_0xde14('0xa7')]===-0x1){return _0x3f55c3;}return this['channel'][_0xde14('0xab')](util['format']('Executed\x20command\x20%s\x20%s',_0xde14('0x1bb'),_0x3c1f1b));};AGIVertices[_0xde14('0x16')][_0xde14('0x1bc')]=function(_0x218678){logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x1bd'),_0x218678[_0xde14('0x3b')]));var _0x1cfb4f=this[_0xde14('0x5b')][_0xde14('0x73')](this,_0x218678['command']);this[_0xde14('0x39')]['sync'](this,_0x218678,_0x218678[_0xde14('0xba')]);if(this[_0xde14('0x89')](_0x218678['variable_id'])){var _0x389d19=this[_0xde14('0x11')][_0xde14('0x73')](this,_0x218678[_0xde14('0xda')]);if(_0x389d19){this[_0xde14('0xe')][_0xde14('0xa2')](_0x389d19,_0x1cfb4f);return this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x1be'),_0x218678[_0xde14('0xba')],_0x389d19));}}return this[_0xde14('0xe')][_0xde14('0xab')](util['format'](_0xde14('0x1bf'),_0x218678[_0xde14('0xba')]));};AGIVertices[_0xde14('0x16')]['google_cloud_tts']=function(_0x3145c2){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3145c2[_0xde14('0x3b')]));_0x3145c2[_0xde14('0x5e')]=_0x3145c2[_0xde14('0x5e')][_0xde14('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xde14('0x89')](_0x3145c2[_0xde14('0x1c0')])){return this['channel'][_0xde14('0xab')](_0xde14('0x1c1'));}if(!this[_0xde14('0x89')](_0x3145c2[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x1c2'),_0x3145c2[_0xde14('0x5e')]));var _0x396139=this[_0xde14('0x5d')][_0xde14('0x73')](this,_0x3145c2);if(_0x396139){this['channel'][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x1c3'),_0x396139));var _0x1a3199=this[_0xde14('0xe')][_0xde14('0x105')](_0x396139);try{fs['unlink'](_0x396139+_0xde14('0x12d'));}catch(_0x3ab726){logger[_0xde14('0x2e')](_0x3ab726);}return _0x1a3199;}return this['channel']['error'](_0x3145c2,_0xde14('0x1c4'));};AGIVertices['prototype'][_0xde14('0x1c5')]=function(_0x5e0f1d){logger[_0xde14('0x30')](util[_0xde14('0x2b')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5e0f1d[_0xde14('0x3b')]));_0x5e0f1d[_0xde14('0x5e')]=_0x5e0f1d[_0xde14('0x5e')][_0xde14('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xde14('0x89')](_0x5e0f1d[_0xde14('0x5e')])){return this[_0xde14('0xe')][_0xde14('0xab')](_0xde14('0xac'));}this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x1c6'),_0x5e0f1d[_0xde14('0x5e')]));var _0x20c01f=this['googleTTS'][_0xde14('0x73')](this,_0x5e0f1d);if(_0x20c01f){this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x1c7'),_0x20c01f));var _0x5a121f=this[_0xde14('0xe')][_0xde14('0x105')](_0x20c01f);try{fs[_0xde14('0x12c')](_0x20c01f+_0xde14('0x12d'));}catch(_0x482555){logger[_0xde14('0x2e')](_0x482555);}return _0x5a121f;}return this[_0xde14('0xe')][_0xde14('0x2e')](_0x5e0f1d,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x406e2d){logger['info'](util[_0xde14('0x2b')](_0xde14('0x1c8'),_0x406e2d['label']));if(!this[_0xde14('0x89')](_0x406e2d[_0xde14('0x160')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x406e2d,_0xde14('0x15f'));}logger[_0xde14('0x30')](util[_0xde14('0x2b')](_0xde14('0x16e'),this[_0xde14('0xe')]['callerid'],_0x406e2d[_0xde14('0x160')]));var _0x310399=this[_0xde14('0x55')]['sync'](this,_0x406e2d[_0xde14('0x160')]);if(_0x310399){logger[_0xde14('0x30')](util['format'](_0xde14('0x161'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x406e2d[_0xde14('0x160')]));this[_0xde14('0xe')][_0xde14('0xab')](util[_0xde14('0x2b')](_0xde14('0x161'),this['channel']['callerid'],_0x406e2d[_0xde14('0x160')]));return{'code':0xc8,'result':_0xde14('0x162')};}else{logger['info'](util['format'](_0xde14('0x163'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x406e2d[_0xde14('0x160')]));this[_0xde14('0xe')]['noop'](util['format'](_0xde14('0x163'),this[_0xde14('0xe')][_0xde14('0x3e')],_0x406e2d[_0xde14('0x160')]));return{'code':0xc8,'result':_0xde14('0x164')};}};AGIVertices['prototype'][_0xde14('0x1c9')]=function(_0x21758d){logger[_0xde14('0x30')](util['format'](_0xde14('0x1ca'),_0x21758d[_0xde14('0x3b')]));var _0x4a1953=this['channel'][_0xde14('0xad')](_0xde14('0x1cb'),[_0x21758d['mailbox'],_0x21758d[_0xde14('0x7c')]]);if(_0x4a1953[_0xde14('0xa7')]===-0x1){return _0x4a1953;}return this[_0xde14('0xe')]['noop'](util[_0xde14('0x2b')](_0xde14('0xc6'),_0xde14('0x1cb'),_0x21758d[_0xde14('0x1cc')]));};AGIVertices[_0xde14('0x16')][_0xde14('0x1cd')]=function(_0x2ab908){logger[_0xde14('0x30')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2ab908[_0xde14('0x3b')]));if(!this[_0xde14('0x89')](_0x2ab908[_0xde14('0xda')])){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x2ab908,_0xde14('0x1ce'));}var _0x1ba06c=this[_0xde14('0x11')][_0xde14('0x73')](this,_0x2ab908['variable_id']);if(!_0x1ba06c){return this[_0xde14('0xe')][_0xde14('0x2e')](_0x2ab908,'no\x20variable\x20found');}var _0x4d2709=this[_0xde14('0xe')][_0xde14('0x11')](_0x1ba06c);return{'code':0xc8,'result':_0x4d2709[_0xde14('0xa5')]?_0x4d2709[_0xde14('0xa5')]:'-'};};String[_0xde14('0x16')]['replaceAll']=function(_0x3db640,_0x1cfd3c){return this[_0xde14('0xa3')](_0x3db640)['join'](_0x1cfd3c);};module[_0xde14('0x1cf')]=AGIVertices; \ No newline at end of file +var _0x66fa=['toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','render','headers','body','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','clone','isString','includes','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','extra','toString','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','callback_priority','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','sync','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','hasOwnProperty','DIALOGFLOW_%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','phone','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','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\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','variable_id','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','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','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','getMailAccount','Smtp','\x22%s\x22\x20<%s>','user','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','no\x20variable\x20selected','join','exports','util','lodash','shelljs','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getTrunkById','getSound','getSoundPath','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agentUnpause','agent','callerid','agentLogout','agentLogin','internal','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT'];(function(_0x177bc0,_0x2dc066){var _0xe3b5c=function(_0x3fbd03){while(--_0x3fbd03){_0x177bc0['push'](_0x177bc0['shift']());}};_0xe3b5c(++_0x2dc066);}(_0x66fa,0x168));var _0xa66f=function(_0x3b274a,_0x6318fa){_0x3b274a=_0x3b274a-0x0;var _0x2197a6=_0x66fa[_0x3b274a];return _0x2197a6;};'use strict';var fs=require('fs');var util=require(_0xa66f('0x0'));var _=require(_0xa66f('0x1'));var sh=require(_0xa66f('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xa66f('0x3'));var Mustache=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var scripts=require(_0xa66f('0x9'));var FILES_PATH=_0xa66f('0xa');var recursiveMapAttributes=[_0xa66f('0xb'),_0xa66f('0xc')];var verticesWithRetry=[_0xa66f('0xd'),'getdigits',_0xa66f('0xe')];var AGIVertices=function(_0x5ec156,_0x183448,_0x246781){this['channel']=_0x5ec156;this[_0xa66f('0xf')]=_0x183448;this[_0xa66f('0x10')]=_0x246781;};AGIVertices[_0xa66f('0x11')][_0xa66f('0x12')]=function(_0x234c43,_0x42f064){this['rpc']['getVariableById'](_0x234c43)[_0xa66f('0x13')](function(_0x59f8f8){_0x42f064(null,_0x59f8f8?_0x59f8f8[_0xa66f('0x14')]:![]);})[_0xa66f('0x15')](function(_0x1162c0){_0x42f064(_0x1162c0);});};AGIVertices['prototype'][_0xa66f('0x16')]=function(_0x1a1ab2,_0x4ad224){this[_0xa66f('0xf')][_0xa66f('0x17')](_0x1a1ab2)[_0xa66f('0x13')](function(_0x96a262){_0x4ad224(null,_0x96a262?_0x96a262['name']:![]);})[_0xa66f('0x15')](function(_0x27f04e){_0x4ad224(_0x27f04e);});};AGIVertices['prototype'][_0xa66f('0x18')]=function(_0x33270b,_0xc68431){this[_0xa66f('0xf')][_0xa66f('0x19')](_0x33270b)[_0xa66f('0x13')](function(_0x58f239){_0xc68431(null,_0x58f239?_0x58f239['name']:![]);})[_0xa66f('0x15')](function(_0x16648b){_0xc68431(_0x16648b);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1a')]=function(_0x5d04a1,_0x1e448e){this[_0xa66f('0xf')]['getSquareOdbcById'](_0x5d04a1)[_0xa66f('0x13')](function(_0x4b4099){_0x1e448e(null,_0x4b4099?_0x4b4099[_0xa66f('0x1b')]:![]);})[_0xa66f('0x15')](function(_0x4a92dd){_0x1e448e(_0x4a92dd);});};AGIVertices['prototype'][_0xa66f('0x1c')]=function(_0x5e6856,_0x5b2cf0){this['rpc']['getUserById'](_0x5e6856)[_0xa66f('0x13')](function(_0x15910d){_0x5b2cf0(null,_0x15910d?_0x15910d[_0xa66f('0x14')]:![]);})['catch'](function(_0x20bf81){_0x5b2cf0(_0x20bf81);});};AGIVertices[_0xa66f('0x11')]['getTrunk']=function(_0x27fdba,_0x473b00){this[_0xa66f('0xf')][_0xa66f('0x1d')](_0x27fdba)[_0xa66f('0x13')](function(_0x13aec8){_0x473b00(null,_0x13aec8?_0x13aec8['name']:![]);})['catch'](function(_0x272f1e){_0x473b00(_0x272f1e);});};AGIVertices['prototype'][_0xa66f('0x1e')]=function(_0x278531,_0x2cf4c9){var _0x49e1b3=this;this[_0xa66f('0xf')]['getSoundById'](_0x278531)['then'](function(_0x4c7b82){_0x2cf4c9(null,_0x4c7b82?_0x49e1b3[_0xa66f('0x1f')](_0x4c7b82['save_name']):![]);})[_0xa66f('0x15')](function(_0x7d07a4){_0x2cf4c9(_0x7d07a4);});};AGIVertices[_0xa66f('0x11')]['getMailAccount']=function(_0x59ba61,_0x3ad042){this[_0xa66f('0xf')][_0xa66f('0x20')](_0x59ba61)['then'](function(_0x46c525){_0x3ad042(null,_0x46c525?_0x46c525:![]);})['catch'](function(_0x6be926){_0x3ad042(_0x6be926);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x21')]=function(_0x36525b,_0x2a1e6b,_0x265b50){this['mailRpc'][_0xa66f('0x21')](_0x36525b,_0x2a1e6b)[_0xa66f('0x13')](function(){_0x265b50(null);})['catch'](function(_0x1d37c2){_0x265b50(_0x1d37c2);});};AGIVertices[_0xa66f('0x11')]['getIntervals']=function(_0x49e47c,_0x2fb3d8){this[_0xa66f('0xf')][_0xa66f('0x22')](_0x49e47c)[_0xa66f('0x13')](function(_0x351656){if(_0x351656){if(_0x351656[_0xa66f('0x23')]){_0x2fb3d8(null,[_0x351656['interval']]);}else{_0x2fb3d8(null,_[_0xa66f('0x24')](_0x351656[_0xa66f('0x25')],_0xa66f('0x26')));}}else{_0x2fb3d8(null,![]);}})[_0xa66f('0x15')](function(_0x4e1eea){_0x2fb3d8(_0x4e1eea);});};AGIVertices['prototype'][_0xa66f('0x1f')]=function(_0x5ef649){return util[_0xa66f('0x27')](_0xa66f('0x28'),FILES_PATH,_0x5ef649);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x29')]=function(_0x1361c8,_0x28caf6,_0x343cdc){odbc[_0xa66f('0x2a')](_0x1361c8,function(_0x126aa3){if(_0x126aa3){logger[_0xa66f('0x2b')](_0xa66f('0x2c'),_0x126aa3);_0x343cdc(_0x126aa3);}else{logger[_0xa66f('0x2d')]('ODBC\x20connection\x20successfully');odbc[_0xa66f('0x2e')](_0x28caf6,function(_0x276622,_0x4d3e55){if(_0x276622){logger[_0xa66f('0x2d')]('Error\x20executing\x20query\x20%s',_0x28caf6);_0x343cdc(_0x276622);}else{logger[_0xa66f('0x2d')](_0xa66f('0x2f'),_0x28caf6);odbc[_0xa66f('0x30')](function(_0x2c185b){if(_0x2c185b){logger['error'](_0xa66f('0x31'),_0x2c185b);}_0x343cdc(null,_0x4d3e55);});}});}});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x32')]=function(_0x34a742,_0x5a778f){this[_0xa66f('0xf')]['getSmsAccountById'](_0x34a742)[_0xa66f('0x13')](function(_0xe4601d){_0x5a778f(null,_0xe4601d?_0xe4601d:![]);})[_0xa66f('0x15')](function(_0x2dca82){_0x5a778f(_0x2dca82);});};AGIVertices['prototype'][_0xa66f('0x33')]=function(_0x4d3a9d,_0x835156){this[_0xa66f('0xf')][_0xa66f('0x33')](_0x4d3a9d)[_0xa66f('0x13')](function(_0x331ad8){_0x835156(null,_0x331ad8);})[_0xa66f('0x15')](function(_0xe88e56){_0x835156(_0xe88e56);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x34')]=function(_0x3ed4a0,_0x324818,_0x132afa){this[_0xa66f('0xf')][_0xa66f('0x34')]({'uniqueid':this[_0xa66f('0x35')]['uniqueid'],'node':_0x3ed4a0[_0xa66f('0x36')],'application':_0x3ed4a0[_0xa66f('0x37')],'data':_0x324818||null,'project_name':this[_0xa66f('0x35')]['arg_1'],'callerid':this[_0xa66f('0x35')]['callerid']})[_0xa66f('0x13')](function(_0x1141a1){if(_0x132afa){_0x132afa(null,_0x1141a1);}})[_0xa66f('0x15')](function(_0x4fc452){if(_0x132afa){_0x132afa(_0x4fc452);}});};AGIVertices['prototype'][_0xa66f('0x38')]=function(_0x54ae9d,_0x3e5778,_0x4562a1,_0x3c26f5){this[_0xa66f('0xf')]['createSquareRecording']({'uniqueid':this[_0xa66f('0x35')][_0xa66f('0x39')],'callerid':this['channel']['callerid'],'calleridname':this[_0xa66f('0x35')][_0xa66f('0x3a')],'context':this[_0xa66f('0x35')][_0xa66f('0x3b')],'extension':this[_0xa66f('0x35')]['extension'],'priority':this[_0xa66f('0x35')][_0xa66f('0x3c')],'accountcode':this[_0xa66f('0x35')][_0xa66f('0x3d')],'dnid':this[_0xa66f('0x35')]['dnid'],'projectName':this[_0xa66f('0x35')][_0xa66f('0x3e')],'saveName':_0x3e5778,'filename':_0x54ae9d[_0xa66f('0x3f')]||_0x3e5778,'savePath':_0x4562a1})[_0xa66f('0x13')](function(_0x35108c){_0x3c26f5(null,_0x35108c);})['catch'](function(_0x596d69){_0x3c26f5(_0x596d69);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x40')]=function(_0x35d81f,_0x312f1a,_0x40cf7e,_0x349872,_0x3a1efc){this[_0xa66f('0xf')]['createSquareMessage']({'uniqueid':this[_0xa66f('0x35')][_0xa66f('0x39')],'body':_0x35d81f,'direction':_0x312f1a,'providerName':_0x40cf7e,'providerResponse':_0x349872})[_0xa66f('0x13')](function(_0x6038f3){if(_0x3a1efc){_0x3a1efc(null,_0x6038f3);}})[_0xa66f('0x15')](function(_0x55e402){if(_0x3a1efc){_0x3a1efc(_0x55e402);}});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x41')]=function(_0xc195b1,_0x5db07e){this['rpc'][_0xa66f('0x41')]({'firstName':_[_0xa66f('0x42')](_0xc195b1[_0xa66f('0x14')])||_[_0xa66f('0x43')](_0xc195b1[_0xa66f('0x14')])?'callback_'+Math[_0xa66f('0x44')]():_0xc195b1['name'],'lastName':_[_0xa66f('0x42')](_0xc195b1[_0xa66f('0x45')])||_[_0xa66f('0x43')](_0xc195b1['lastName'])?null:_0xc195b1[_0xa66f('0x45')],'phone':_0xc195b1['phone'],'ListId':_0xc195b1[_0xa66f('0x46')],'scheduledat':_0xc195b1[_0xa66f('0x47')],'callbackUniqueid':this[_0xa66f('0x35')][_0xa66f('0x39')],'tags':_0xa66f('0x48'),'description':_0xa66f('0x49')+_0xc195b1[_0xa66f('0x47')]['toString'](),'priority':_0xc195b1['callback_priority']})['then'](function(_0x1a057b){_0x5db07e(null,_0x1a057b);})[_0xa66f('0x15')](function(_0x45efb3){_0x5db07e(_0x45efb3);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x4a')]=function(_0x2c8ede,_0x210b18){this['rpc'][_0xa66f('0x4b')](_0x2c8ede)['then'](function(_0x34130a){_0x210b18(null,_0x34130a?_0x34130a[_0xa66f('0x14')]:![]);})['catch'](function(_0x405b48){_0x210b18(_0x405b48);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x4c')]=function(_0x585bca,_0x4dbefc,_0x5ac6fc){var _0xf804dc={'role':'agent'};_0xf804dc[_0x585bca]=this[_0xa66f('0x35')]['callerid'];this[_0xa66f('0xf')][_0xa66f('0x4c')](_0xf804dc,_0x4dbefc,this['channel']['uniqueid'])['then'](function(_0x28e782){_0x5ac6fc(null,_[_0xa66f('0x43')](_0x28e782)?![]:!![]);})[_0xa66f('0x15')](function(_0x1ebc02){logger[_0xa66f('0x2b')](_0x1ebc02);_0x5ac6fc(null,![]);});};AGIVertices['prototype'][_0xa66f('0x4d')]=function(_0x386fc6,_0x51d039){var _0x4ec127={'role':_0xa66f('0x4e')};_0x4ec127[_0x386fc6]=this[_0xa66f('0x35')][_0xa66f('0x4f')];this[_0xa66f('0xf')][_0xa66f('0x4d')](_0x4ec127)[_0xa66f('0x13')](function(_0x3028f3){_0x51d039(null,_[_0xa66f('0x43')](_0x3028f3)?![]:!![]);})[_0xa66f('0x15')](function(_0x1aa2e0){logger[_0xa66f('0x2b')](_0x1aa2e0);_0x51d039(null,![]);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x50')]=function(_0x547ce1,_0x107635){var _0x55399a={'role':_0xa66f('0x4e')};_0x55399a[_0x547ce1]=this[_0xa66f('0x35')][_0xa66f('0x4f')];this[_0xa66f('0xf')][_0xa66f('0x50')](_0x55399a)[_0xa66f('0x13')](function(_0x39eede){_0x107635(null,_[_0xa66f('0x43')](_0x39eede)?![]:!![]);})[_0xa66f('0x15')](function(_0xd4767e){logger[_0xa66f('0x2b')](_0xd4767e);_0x107635(null,![]);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x51')]=function(_0x1d97bf,_0x5cd489){var _0x3850e8={'role':_0xa66f('0x4e')};_0x3850e8[_0x1d97bf]=this[_0xa66f('0x35')][_0xa66f('0x4f')];var _0x5e5d1c=_0x1d97bf!=_0xa66f('0x52')?util[_0xa66f('0x27')]('%s/%s@from-sip/n','LOCAL',this[_0xa66f('0x35')][_0xa66f('0x4f')]):undefined;this[_0xa66f('0xf')][_0xa66f('0x51')](_0x3850e8,_0x5e5d1c)['then'](function(_0x20aa55){_0x5cd489(null,_[_0xa66f('0x43')](_0x20aa55)?![]:!![]);})[_0xa66f('0x15')](function(_0x116f0c){logger[_0xa66f('0x2b')](_0x116f0c);_0x5cd489(null,![]);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x53')]=function(_0x3c1f45,_0x269d48){sh[_0xa66f('0x54')](_[_0xa66f('0x55')](_0x3c1f45),function(_0x4f6c48,_0x8d9be8){var _0x4b0f2b=_0x8d9be8[_0xa66f('0x56')](/(\r\n|\n|\r)/gm,'');_0x269d48(null,_0x4b0f2b);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x57')]=function(_0x190cce,_0x278cd5){scripts[_0xa66f('0x57')](_0x190cce[_0xa66f('0x58')],_0x190cce['google_cloud_tts_text_type']||_0xa66f('0x59'),_0x190cce[_0xa66f('0x59')],_0x190cce['languageCode']||'en-US',_0x190cce[_0xa66f('0x5a')]||_0xa66f('0x5b'),_0x190cce[_0xa66f('0x5c')]||_0xa66f('0x5d'))['then'](function(_0x370448){_0x278cd5(null,_0x370448);})[_0xa66f('0x15')](function(_0x17f631){_0x278cd5(_0x17f631);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x5e')]=function(_0x197d4a,_0x2b43e0){scripts['googleTTS'](_0x197d4a[_0xa66f('0x59')],_0x197d4a[_0xa66f('0x5f')]||'en',0x1)[_0xa66f('0x13')](function(_0x4964db){_0x2b43e0(null,_0x4964db);})[_0xa66f('0x15')](function(_0x46242c){_0x2b43e0(_0x46242c);});};AGIVertices['prototype'][_0xa66f('0x60')]=function(_0xe0f0bd,_0x5693ed){var _0x742a7b={'uri':_0xe0f0bd[_0xa66f('0x61')],'method':_0xe0f0bd[_0xa66f('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xe0f0bd[_0xa66f('0x63')])===_0xa66f('0x64')&&parseInt(_0xe0f0bd[_0xa66f('0x63')])>=0x1?parseInt(_0xe0f0bd['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0xa66f('0x65'),_0xa66f('0x66')],_0x742a7b[_0xa66f('0x62')][_0xa66f('0x67')]())){try{_0x742a7b['body']=_0xe0f0bd[_0xa66f('0xc')]?JSON[_0xa66f('0x68')](_0xe0f0bd['rawBody']):{};}catch(_0xca5065){logger[_0xa66f('0x2b')](_0xa66f('0x69'),_0xca5065);}}try{_0x742a7b['headers']=_0xe0f0bd[_0xa66f('0xb')]?JSON[_0xa66f('0x68')](_0xe0f0bd[_0xa66f('0xb')]):{};}catch(_0x494599){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x494599);}if(_0xe0f0bd[_0xa66f('0x6a')]){try{var _0xf696fb=require(_0xe0f0bd[_0xa66f('0x6a')])['sync'](this,_0x742a7b);_0x742a7b['uri']=Mustache[_0xa66f('0x6b')](_0xe0f0bd[_0xa66f('0x61')],_0xf696fb,{},['$$','$$']);if(_0x742a7b[_0xa66f('0x6c')]){_0x742a7b[_0xa66f('0x6c')]=JSON[_0xa66f('0x68')](Mustache[_0xa66f('0x6b')](JSON['stringify'](_0x742a7b[_0xa66f('0x6c')]),_0xf696fb,{},['$$','$$']));}if(_0x742a7b['body']){_0x742a7b[_0xa66f('0x6d')]=JSON[_0xa66f('0x68')](Mustache[_0xa66f('0x6b')](JSON[_0xa66f('0x6e')](_0x742a7b[_0xa66f('0x6d')]),_0xf696fb,{},['$$','$$']));}}catch(_0x14f78c){logger[_0xa66f('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x14f78c);}}rp(_0x742a7b)[_0xa66f('0x13')](function(_0x5efc27){var _0x39b0df={'statusCode':_0x5efc27[_0xa66f('0x6f')]||0xc8,'statusMessage':_0x5efc27[_0xa66f('0x70')]||'OK','headers':_0x5efc27[_0xa66f('0x6c')]||{},'body':_0x5efc27[_0xa66f('0x6d')]||{}};_0x5693ed(null,_0x39b0df);})[_0xa66f('0x15')](function(_0x16b100){var _0x2c648f={'statusCode':_0x16b100['statusCode']||0x1f4,'statusMessage':_0x16b100[_0xa66f('0x71')]||_0xa66f('0x72'),'headers':_0x16b100[_0xa66f('0x73')][_0xa66f('0x6c')]||{},'body':_0x16b100['options'][_0xa66f('0x6d')]||{}};_0x5693ed(null,_0x2c648f);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x74')]=function(_0x26c796,_0x14ed70){scripts[_0xa66f('0x74')](this[_0xa66f('0x35')]['uniqueid'],_0x26c796[_0xa66f('0x75')],_0x26c796[_0xa66f('0x59')],_0x26c796['dialogflow_language']||'en')[_0xa66f('0x13')](function(_0x1d035c){_0x14ed70(null,_0x1d035c);})['catch'](function(_0x4dea2f){_0x14ed70(_0x4dea2f);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x76')]=function(_0x2f1e3d,_0x56a75f){scripts['googleDialogflowV2'](this[_0xa66f('0x35')][_0xa66f('0x39')],_0x2f1e3d[_0xa66f('0x77')],_0x2f1e3d[_0xa66f('0x78')],_0x2f1e3d[_0xa66f('0x79')],_0x2f1e3d['text'],_0x2f1e3d[_0xa66f('0x7a')]||'en')[_0xa66f('0x13')](function(_0x113f54){_0x56a75f(null,_0x113f54);})[_0xa66f('0x15')](function(_0x5e29ce){_0x56a75f(_0x5e29ce);});};AGIVertices['prototype'][_0xa66f('0x7b')]=function(_0x6d62fe,_0x39a830){scripts['sestekNDA'](this['channel'],_0x6d62fe)[_0xa66f('0x13')](function(_0x1b4625){_0x39a830(null,_0x1b4625);})[_0xa66f('0x15')](function(_0x1f89f5){_0x39a830(_0x1f89f5);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x7c')]=function(_0x15b3fd,_0x418b6f){scripts[_0xa66f('0x7c')](_0x15b3fd[_0xa66f('0x75')],_0x15b3fd[_0xa66f('0x59')],_0x15b3fd[_0xa66f('0x7d')]||_0xa66f('0x7e'),_0x15b3fd[_0xa66f('0x7f')])['then'](function(_0x156320){_0x418b6f(null,_0x156320);})['catch'](function(_0x30e89e){_0x418b6f(_0x30e89e);});};AGIVertices['prototype'][_0xa66f('0x80')]=function(_0x1fd1fa,_0x4eb32b,_0x5362fe){scripts[_0xa66f('0x80')](_0x4eb32b,_0x1fd1fa[_0xa66f('0x75')],_0x1fd1fa[_0xa66f('0x81')]||_0xa66f('0x7e'),this[_0xa66f('0x82')](_0x1fd1fa['model'])?_0x1fd1fa[_0xa66f('0x83')]:undefined)['then'](function(_0x45a8ff){_0x5362fe(null,_0x45a8ff);})[_0xa66f('0x15')](function(_0x29c8e4){_0x5362fe(_0x29c8e4);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x84')]=function(_0x414dba,_0x17affe){scripts['awsPolly'](_0x414dba[_0xa66f('0x85')],_0x414dba[_0xa66f('0x86')],_0x414dba[_0xa66f('0x87')],_0x414dba[_0xa66f('0x88')]||'Amy',_0x414dba[_0xa66f('0x59')],_0x414dba[_0xa66f('0x89')]||'text')['then'](function(_0x6478de){_0x17affe(null,_0x6478de);})[_0xa66f('0x15')](function(_0x386c00){_0x17affe(_0x386c00);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x8a')]=function(_0x4e1956,_0x56c60c){scripts['awsLex'](this[_0xa66f('0x35')][_0xa66f('0x39')],_0x4e1956[_0xa66f('0x85')],_0x4e1956['aws_secret_access_key'],_0x4e1956[_0xa66f('0x8b')],_0x4e1956['text'],_0x4e1956['aws_bot_name'])[_0xa66f('0x13')](function(_0x567d5f){_0x56c60c(null,_0x567d5f);})[_0xa66f('0x15')](function(_0x450921){_0x56c60c(_0x450921);});};AGIVertices[_0xa66f('0x11')][_0xa66f('0x8c')]=function(_0x55886a,_0x200935,_0xb87b8c){scripts[_0xa66f('0x8c')](_0x200935,_0x55886a[_0xa66f('0x75')],_0x55886a[_0xa66f('0x8d')]||_0xa66f('0x7e'))[_0xa66f('0x13')](function(_0x16c906){_0xb87b8c(null,_0x16c906);})[_0xa66f('0x15')](function(_0x104976){_0xb87b8c(_0x104976);});};AGIVertices[_0xa66f('0x11')]['tildeASR']=function(_0xa00f9f,_0x2986be,_0x4ace46){scripts[_0xa66f('0x8e')](_0x2986be,_0xa00f9f['appid'],_0xa00f9f[_0xa66f('0x8f')],_0xa00f9f[_0xa66f('0x90')])[_0xa66f('0x13')](function(_0x5a3ccc){_0x4ace46(null,_0x5a3ccc);})[_0xa66f('0x15')](function(_0x215172){_0x4ace46(_0x215172);});};AGIVertices['prototype'][_0xa66f('0x91')]=function(_0x49497a){var _0x410f4b=_['includes'](verticesWithRetry,_0x49497a[_0xa66f('0x37')])?_0x49497a:_[_0xa66f('0x92')](_0x49497a);for(var _0x289e3e in _0x410f4b){if(_0x410f4b['hasOwnProperty'](_0x289e3e)){if(_0x410f4b[_0x289e3e]&&_[_0xa66f('0x93')](_0x410f4b[_0x289e3e])){if(_[_0xa66f('0x94')](recursiveMapAttributes,_0x289e3e)){_0x410f4b[_0x289e3e]=this['replaceObjectAllVariables'](_0x410f4b[_0x289e3e]);}else{_0x410f4b[_0x289e3e]=this['replaceAllVariables'](_0x410f4b[_0x289e3e]);}}}}return _0x410f4b;};AGIVertices[_0xa66f('0x11')][_0xa66f('0x95')]=function(_0x257f53){for(var _0x359618 in _0x257f53){if(_0x257f53['hasOwnProperty'](_0x359618)){if(_[_0xa66f('0x96')](_0x257f53[_0x359618])){this[_0xa66f('0x95')](_0x257f53[_0x359618]);}else if(_[_0xa66f('0x97')](_0x257f53[_0x359618])){for(var _0x3e4b47=0x0;_0x3e4b47<_0x257f53[_0x359618][_0xa66f('0x98')];_0x3e4b47++){this[_0xa66f('0x95')](_0x257f53[_0x359618][_0x3e4b47]);}}else if(_[_0xa66f('0x93')](_0x257f53[_0x359618])){_0x257f53[_0x359618]=this[_0xa66f('0x99')](_0x257f53[_0x359618]);}}}};AGIVertices[_0xa66f('0x11')]['saveRestApiResult']=function(_0x4e7af4,_0x2b1cd5){for(var _0x34bfa4 in _0x4e7af4){if(_0x4e7af4['hasOwnProperty'](_0x34bfa4)){if(_['isPlainObject'](_0x4e7af4[_0x34bfa4])){if(!_[_0xa66f('0x42')](_0x4e7af4[_0x34bfa4])){this[_0xa66f('0x9a')](_0x4e7af4[_0x34bfa4],util[_0xa66f('0x27')](_0xa66f('0x9b'),_0x2b1cd5,_0x34bfa4));}}else if(_[_0xa66f('0x97')](_0x4e7af4[_0x34bfa4])){for(var _0x193042=0x0;_0x193042<_0x4e7af4[_0x34bfa4][_0xa66f('0x98')];_0x193042++){this[_0xa66f('0x9a')](_0x4e7af4[_0x34bfa4][_0x193042],util[_0xa66f('0x27')](_0xa66f('0x9b'),_0x2b1cd5,_0x34bfa4+'['+_0x193042+']'));}}else{if(!_['isNil'](_0x4e7af4[_0x34bfa4])){this['channel'][_0xa66f('0x9c')](util[_0xa66f('0x27')](_0xa66f('0x9b'),_0x2b1cd5,_0x34bfa4),_0x4e7af4[_0x34bfa4]);}}}}};AGIVertices[_0xa66f('0x11')][_0xa66f('0x9d')]=function(_0x1856ef){try{var _0x5afa36=JSON[_0xa66f('0x68')](_0x1856ef);this[_0xa66f('0x95')](_0x5afa36);return JSON[_0xa66f('0x6e')](_0x5afa36);}catch(_0x4c08ea){return this['replaceAllVariables'](_0x1856ef);}};AGIVertices[_0xa66f('0x11')][_0xa66f('0x99')]=function(_0x32a6f7){var _0x32c519=_0x32a6f7[_0xa66f('0x9e')]('{');for(var _0x2e8eda=0x1;_0x2e8eda<_0x32c519[_0xa66f('0x98')];_0x2e8eda+=0x1){var _0x2beb4a=_0x32c519[_0x2e8eda]['split']('}');if(_0x2beb4a['length']>0x1){_0x32a6f7=_0x32a6f7['replaceAll']('{'+_0x2beb4a[0x0]+'}',this['channel'][_0xa66f('0x12')](_0x2beb4a[0x0])[_0xa66f('0x9f')]||_0x2beb4a[0x0]);}}if(_0x32c519[_0xa66f('0x98')]===0x1){return _0x32a6f7[_0xa66f('0xa0')]();}return this[_0xa66f('0x99')](_0x32a6f7);};AGIVertices[_0xa66f('0x11')]['getAndSetVariable']=function(_0x455ce1,_0x1325a3){var _0x2c7caa=this['channel']['getVariable'](_0x455ce1);if(_0x2c7caa[_0xa66f('0xa1')]===-0x1){return _0x2c7caa;}logger[_0xa66f('0x2d')](util['format'](_0xa66f('0xa2'),_0x1325a3,_0x2c7caa[_0xa66f('0x9f')]));return this[_0xa66f('0x35')][_0xa66f('0x9c')](_0x1325a3,_0x2c7caa['extra']);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x82')]=function(_0x431889){return _0x431889&&_0x431889!=='0'&&_0x431889!=='-1'&&_0x431889!=='';};AGIVertices[_0xa66f('0x11')][_0xa66f('0xa3')]=function(_0x43b8f9){this[_0xa66f('0x34')]['sync'](this,_0x43b8f9,'-');_0x43b8f9[_0xa66f('0xa4')]=_0x43b8f9['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa66f('0x11')]['mrcpsynth']=function(_0x26ecaa){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0xa5'),_0x26ecaa['label']));if(!this[_0xa66f('0x82')](_0x26ecaa[_0xa66f('0x59')])){return this[_0xa66f('0x35')]['noop'](_0xa66f('0xa6'));}var _0x4220eb='\x22'+_0x26ecaa[_0xa66f('0x59')]+'\x22';if(this[_0xa66f('0x82')](_0x26ecaa[_0xa66f('0x73')])){_0x4220eb+=','+_0x26ecaa[_0xa66f('0x73')];}var _0x53c598=this[_0xa66f('0x35')][_0xa66f('0x54')]('MRCPSynth',_0x4220eb);if(_0x53c598['result']===-0x1){return _0x53c598;}return this['channel'][_0xa66f('0xa7')](util[_0xa66f('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4220eb));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xa8')]=function(_0x123167){logger['info'](util[_0xa66f('0x27')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x123167['label']));if(!this['isConfigured'](_0x123167[_0xa66f('0xa9')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xaa'));}var _0x5142cf=_0x123167['grammar'];if(this[_0xa66f('0x82')](_0x123167['options'])){_0x5142cf+=','+_0x123167['options'];}var _0x46ea85=this['channel']['exec'](_0xa66f('0xab'),_0x5142cf);if(_0x46ea85[_0xa66f('0xa1')]===-0x1){return _0x46ea85;}var _0x30676b=this[_0xa66f('0xac')](_0xa66f('0xad'),_0xa66f('0xae'));if(_0x30676b[_0xa66f('0xa1')]===-0x1){return _0x30676b;}var _0x2d8768=this['getAndSetVariable'](_0xa66f('0xaf'),_0xa66f('0xb0'));if(_0x2d8768[_0xa66f('0xa1')]===-0x1){return _0x2d8768;}var _0x5428e7=this[_0xa66f('0xac')](_0xa66f('0xb1'),'MRCP_RECOG_INSTANCE');if(_0x5428e7[_0xa66f('0xa1')]===-0x1){return _0x5428e7;}return this[_0xa66f('0x35')]['noop'](util['format'](_0xa66f('0xb2'),_0x5142cf));};AGIVertices['prototype'][_0xa66f('0x7')]=function(_0x2cd4b3){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xb3'),_0x2cd4b3[_0xa66f('0x36')]));return this['channel'][_0xa66f('0x7')]([_0x2cd4b3['command'],_0x2cd4b3['args']]);};AGIVertices[_0xa66f('0x11')][_0xa66f('0xb4')]=function(_0x465146){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0xb5'),_0x465146[_0xa66f('0x36')]));if(this[_0xa66f('0x82')](_0x465146['timeout'])){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xb6'),_0x465146['timeout']));var _0x558633=this[_0xa66f('0x35')][_0xa66f('0xb7')](_0x465146[_0xa66f('0x63')]);if(_0x558633[_0xa66f('0xa1')]===-0x1){return _0x558633;}}return this['channel'][_0xa66f('0xb4')]();};AGIVertices[_0xa66f('0x11')]['callback']=function(_0x1efb4e){logger['info'](util[_0xa66f('0x27')](_0xa66f('0xb8'),_0x1efb4e['label']));if(!this[_0xa66f('0x82')](_0x1efb4e['list_id'])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x1efb4e,_0xa66f('0xb9'));}_0x1efb4e[_0xa66f('0x47')]=moment();if(this[_0xa66f('0x82')](_0x1efb4e['delay'])){_0x1efb4e[_0xa66f('0x47')]=moment()[_0xa66f('0xba')](_0x1efb4e[_0xa66f('0xbb')],'minutes');}if(!this[_0xa66f('0x82')](_0x1efb4e['callback_priority'])){_0x1efb4e[_0xa66f('0xbc')]=0x2;}this[_0xa66f('0x41')]['sync'](this,_0x1efb4e);return this['channel']['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x1efb4e['phone'],_0x1efb4e[_0xa66f('0x46')],_0x1efb4e[_0xa66f('0x47')]));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xbd')]=function(_0x210e21){logger['info'](util[_0xa66f('0x27')](_0xa66f('0xbe'),_0x210e21[_0xa66f('0x36')]));var _0x4f9037=this['channel']['exec'](_0x210e21[_0xa66f('0xbf')],_0x210e21[_0xa66f('0x73')]);if(_0x4f9037['result']===-0x1){return _0x4f9037;}return this[_0xa66f('0x35')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x210e21[_0xa66f('0xbf')],_0x210e21[_0xa66f('0x73')]));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xc0')]=function(_0x4c9c1a){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xc1'),_0x4c9c1a[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x4c9c1a['text'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xa6'));}var _0x489838='\x22'+_0x4c9c1a[_0xa66f('0x59')]+'\x22';if(this[_0xa66f('0x82')](_0x4c9c1a[_0xa66f('0x73')])){_0x489838+=','+_0x4c9c1a[_0xa66f('0x73')];}var _0x2e7787=this[_0xa66f('0x35')]['exec'](_0xa66f('0xc2'),_0x489838);if(_0x2e7787[_0xa66f('0xa1')]===-0x1){return _0x2e7787;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0xc3'),_0x489838));};AGIVertices['prototype'][_0xa66f('0xc4')]=function(_0x7ea2e5){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0xc5'),_0x7ea2e5[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x7ea2e5[_0xa66f('0x59')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')]('no\x20text\x20configured');}var _0xc9d5f4='\x22'+_0x7ea2e5[_0xa66f('0x59')]+'\x22';if(this['isConfigured'](_0x7ea2e5[_0xa66f('0x73')])){_0xc9d5f4+=','+_0x7ea2e5[_0xa66f('0x73')];}var _0x756905=this['channel']['exec'](_0xa66f('0xc2'),_0xc9d5f4);if(_0x756905['result']===-0x1){return _0x756905;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0xc9d5f4));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xc6')]=function(_0x3a27fb){logger['info'](util[_0xa66f('0x27')](_0xa66f('0xc7'),_0x3a27fb[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x3a27fb[_0xa66f('0xa9')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')]('no\x20grammar\x20configured');}var _0x262551=_0x3a27fb[_0xa66f('0xa9')];if(this[_0xa66f('0x82')](_0x3a27fb[_0xa66f('0x73')])){_0x262551+=','+_0x3a27fb[_0xa66f('0x73')];}var _0x2a09fd=this['channel'][_0xa66f('0x54')]('MRCPRecog',_0x262551);if(_0x2a09fd['result']===-0x1){return _0x2a09fd;}var _0x59176c=this['getAndSetVariable'](_0xa66f('0xad'),_0xa66f('0xc8'));if(_0x59176c['result']===-0x1){return _0x59176c;}var _0x406fa7=this[_0xa66f('0xac')](_0xa66f('0xaf'),_0xa66f('0xc9'));if(_0x406fa7[_0xa66f('0xa1')]===-0x1){return _0x406fa7;}var _0xb8e60f=this['getAndSetVariable'](_0xa66f('0xb1'),_0xa66f('0xca'));if(_0xb8e60f['result']===-0x1){return _0xb8e60f;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x262551));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xcb')]=function(_0x227c01){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x227c01['label']));if(!this[_0xa66f('0x82')](_0x227c01['grammar'])){return this['channel'][_0xa66f('0xa7')](_0xa66f('0xaa'));}var _0x32ab83=_0x227c01[_0xa66f('0xa9')];if(this[_0xa66f('0x82')](_0x227c01[_0xa66f('0x73')])){_0x32ab83+=','+_0x227c01[_0xa66f('0x73')];}var _0x26b44d=this[_0xa66f('0x35')]['exec'](_0xa66f('0xab'),_0x32ab83);if(_0x26b44d[_0xa66f('0xa1')]===-0x1){return _0x26b44d;}var _0x67558a=this['getAndSetVariable'](_0xa66f('0xad'),_0xa66f('0xcc'));if(_0x67558a['result']===-0x1){return _0x67558a;}var _0x416024=this[_0xa66f('0xac')](_0xa66f('0xaf'),_0xa66f('0xcd'));if(_0x416024[_0xa66f('0xa1')]===-0x1){return _0x416024;}var _0x39df77=this[_0xa66f('0xac')]('RECOG_INSTANCE()',_0xa66f('0xce'));if(_0x39df77[_0xa66f('0xa1')]===-0x1){return _0x39df77;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0xb2'),_0x32ab83));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xcf')]=function(_0x2bf90f){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xd0'),_0x2bf90f[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x2bf90f[_0xa66f('0xd1')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x2bf90f,_0xa66f('0xd2'));}var _0x3765ae=this['getSquareOdbc'][_0xa66f('0xd3')](this,_0x2bf90f[_0xa66f('0xd1')]);if(!_0x3765ae){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x2bf90f,_0xa66f('0xd4'));}if(!this[_0xa66f('0x82')](_0x2bf90f[_0xa66f('0x2e')])){return this['channel'][_0xa66f('0x2b')](_0x2bf90f,_0xa66f('0xd5'));}var _0x52ec28=_0x2bf90f['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0xd6'),_0x52ec28));var _0x269ec2=this[_0xa66f('0x29')][_0xa66f('0xd3')](this,_0x3765ae,_0x52ec28);this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x2bf90f,_0x52ec28);if(!this[_0xa66f('0x82')](_0x2bf90f['variable_id'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xd7'));}var _0x2ace7b=this['getVariable'][_0xa66f('0xd3')](this,_0x2bf90f['variable_id']);if(!_0x2ace7b){return this[_0xa66f('0x35')]['error'](_0x2bf90f,_0xa66f('0xd8'));}var _0x394afa=this;_0x269ec2[_0xa66f('0xd9')](function(_0xbb18dc,_0x3c2c3e){Object[_0xa66f('0xda')](_0xbb18dc)[_0xa66f('0xd9')](function(_0x206c53){_0x394afa['channel'][_0xa66f('0x9c')](util['format'](_0xa66f('0xdb'),_0x2ace7b,_0x3c2c3e,_0x206c53),_0xbb18dc[_0x206c53]);});});this[_0xa66f('0x35')][_0xa66f('0x9c')](util[_0xa66f('0x27')]('%s_ROWS_COUNT',_0x2ace7b),_0x269ec2['length']);return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0xdc'),_0x2ace7b));};AGIVertices['prototype'][_0xa66f('0xdd')]=function(_0x55b6ac){logger[_0xa66f('0xde')](util[_0xa66f('0x27')](_0xa66f('0xdf'),_0x55b6ac[_0xa66f('0x36')]));if(!this['isConfigured'](_0x55b6ac['sip_id'])){return this[_0xa66f('0x35')]['error'](_0x55b6ac,_0xa66f('0xe0'));}var _0x2e1a75=this[_0xa66f('0x1c')][_0xa66f('0xd3')](this,_0x55b6ac['sip_id']);if(!_0x2e1a75){return this[_0xa66f('0x35')]['error'](_0x55b6ac,_0xa66f('0xe1'));}var _0x780136=this[_0xa66f('0x35')]['exec']('DIAL',[util[_0xa66f('0x27')](_0xa66f('0xe2'),_0x2e1a75),_0x55b6ac['timeout'],_0x55b6ac[_0xa66f('0xe3')],_0x55b6ac['url']]);if(_0x780136[_0xa66f('0xa1')]===-0x1){return _0x780136;}return this['channel'][_0xa66f('0xa7')](util['format']('Executed\x20command\x20%s',_0xa66f('0xe4')));};AGIVertices[_0xa66f('0x11')]['dialogflow']=function(_0x308741){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xe5'),_0x308741[_0xa66f('0x36')]));if(!this['isConfigured'](_0x308741['key'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xe6'));}if(!this[_0xa66f('0x82')](_0x308741[_0xa66f('0x59')])){return this[_0xa66f('0x35')]['noop'](_0xa66f('0xa6'));}this['channel'][_0xa66f('0xe7')]=!![];this[_0xa66f('0x34')](_0x308741);this[_0xa66f('0x40')](_0x308741[_0xa66f('0x59')],'in','','');this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('Trying\x20Dialogflow:\x20%s',_0x308741[_0xa66f('0x59')]));var _0x5ae15d=this[_0xa66f('0x74')]['sync'](this,_0x308741);if(_0x5ae15d){for(var _0x2a1cbd in _0x5ae15d){if(_0x5ae15d[_0xa66f('0xe8')](_0x2a1cbd)){this[_0xa66f('0x35')][_0xa66f('0x9c')](util[_0xa66f('0x27')](_0xa66f('0xe9'),_0x2a1cbd[_0xa66f('0x67')]()),_0x5ae15d[_0x2a1cbd]);}}this[_0xa66f('0x40')](_0x5ae15d['speech'],'out','dialogflow','');return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('Dialogflow\x20Result\x20%s',_0x5ae15d['speech']));}return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x308741,_0xa66f('0xea'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xeb')]=function(_0x5a3929){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xec'),_0x5a3929['label']));if(!this[_0xa66f('0x82')](_0x5a3929[_0xa66f('0x77')])){return this['channel']['noop'](_0xa66f('0xed'));}if(!this['isConfigured'](_0x5a3929[_0xa66f('0x78')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')]('no\x20client_email\x20configured');}if(!this[_0xa66f('0x82')](_0x5a3929[_0xa66f('0x79')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')]('no\x20private_key\x20configured');}if(!this[_0xa66f('0x82')](_0x5a3929[_0xa66f('0x7a')])){return this[_0xa66f('0x35')]['noop']('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x5a3929[_0xa66f('0x59')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xa6'));}this[_0xa66f('0x35')][_0xa66f('0xe7')]=!![];this[_0xa66f('0x34')](_0x5a3929);this[_0xa66f('0x40')](_0x5a3929['text'],'in','','');this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0xee'),_0x5a3929[_0xa66f('0x59')]));var _0x246b54=this[_0xa66f('0x76')][_0xa66f('0xd3')](this,_0x5a3929);if(_0x246b54){for(var _0x2b8362 in _0x246b54){if(_0x246b54[_0xa66f('0xe8')](_0x2b8362)){if(_0x2b8362!==_0xa66f('0xef')){this[_0xa66f('0x35')]['setVariable'](util[_0xa66f('0x27')](_0xa66f('0xe9'),_0x2b8362[_0xa66f('0x67')]()),_0x246b54[_0x2b8362]);}}}this[_0xa66f('0x40')](_0x246b54[_0xa66f('0xf0')],_0xa66f('0xf1'),_0xa66f('0xeb'),_0x246b54[_0xa66f('0xef')]);return this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0xf2'),_0x246b54[_0xa66f('0xf0')]));}return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x5a3929,_0xa66f('0xf3'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0xf4')]=function(_0x56e28a){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0xf5'),_0x56e28a[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x56e28a[_0xa66f('0xf6')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xf7'));}if(!this['isConfigured'](_0x56e28a[_0xa66f('0xf8')])){return this['channel']['noop'](_0xa66f('0xf9'));}if(!this['isConfigured'](_0x56e28a['password'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xfa'));}if(!this[_0xa66f('0x82')](_0x56e28a[_0xa66f('0xfb')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xa6'));}this['channel'][_0xa66f('0xe7')]=!![];this[_0xa66f('0x34')](_0x56e28a);this[_0xa66f('0x40')](_0x56e28a[_0xa66f('0x59')],'in','','');this['channel']['noop'](util[_0xa66f('0x27')](_0xa66f('0xfc'),_0x56e28a[_0xa66f('0x59')]));var _0x392d37=this[_0xa66f('0x7b')][_0xa66f('0xd3')](this,_0x56e28a);if(_0x392d37){for(var _0x889d6d in _0x392d37){if(_0x392d37[_0xa66f('0xe8')](_0x889d6d)){this[_0xa66f('0x35')]['setVariable'](util[_0xa66f('0x27')](_0xa66f('0xfd'),_0x889d6d[_0xa66f('0x67')]()),_0x392d37[_0x889d6d]);}}this[_0xa66f('0x40')](_0x392d37['speech'],_0xa66f('0xf1'),_0xa66f('0xf4'),'');if(_0x392d37[_0xa66f('0xfe')]){this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0xff'),_0x392d37[_0xa66f('0xfe')]));var _0x1917fe=this[_0xa66f('0x35')][_0xa66f('0x100')](_0x392d37[_0xa66f('0xfe')]);try{fs['unlink'](_0x392d37['audiofile']+'.wav');}catch(_0x357535){logger[_0xa66f('0x2b')](_0x357535);}return _0x1917fe;}else{return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('SestekNDA\x20Result\x20%s',_0x392d37[_0xa66f('0xf0')]));}}return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x56e28a,_0xa66f('0x101'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x102')]=function(_0xde01d9){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x103'),_0xde01d9[_0xa66f('0x36')]));return this['channel'][_0xa66f('0xa7')](_0xa66f('0x102'));};AGIVertices[_0xa66f('0x11')]['ext_dial']=function(_0x48ff24){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x104'),_0x48ff24[_0xa66f('0x36')]));var _0x46d628='';if(_0x48ff24[_0xa66f('0x105')]){if(!this[_0xa66f('0x82')](_0x48ff24[_0xa66f('0x105')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x48ff24,'no\x20trunk\x20selected');}else{var _0x47613e=parseInt(_0x48ff24[_0xa66f('0x105')],0xa);if(isNaN(_0x47613e)){_0x46d628=_0x48ff24[_0xa66f('0x105')];}else{_0x46d628=this[_0xa66f('0x106')][_0xa66f('0xd3')](this,_0x48ff24[_0xa66f('0x105')]);if(!_0x46d628){return this[_0xa66f('0x35')]['error'](_0x48ff24,_0xa66f('0x107'));}}}}else if(_0x48ff24['trunk_name']){_0x46d628=_0x48ff24[_0xa66f('0x108')];}else{return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x48ff24,_0xa66f('0x109'));}var _0x1282bc=this['channel']['exec']('DIAL',[util[_0xa66f('0x27')](_0xa66f('0x10a'),_0x46d628,_0x48ff24[_0xa66f('0x10b')]),_0x48ff24[_0xa66f('0x63')],_0x48ff24[_0xa66f('0xe3')],_0x48ff24[_0xa66f('0x61')]]);if(_0x1282bc[_0xa66f('0xa1')]===-0x1){return _0x1282bc;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0x10c'),_0xa66f('0xe4')));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x10d')]=function(_0x4a4bdb){logger['info'](util[_0xa66f('0x27')](_0xa66f('0x10e'),_0x4a4bdb[_0xa66f('0x36')]));return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x10d'));};AGIVertices[_0xa66f('0x11')]['getdigits']=function(_0x35ffba){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x10f'),_0x35ffba[_0xa66f('0x36')]));if(_0x35ffba[_0xa66f('0xa4')]===0x0){return this[_0xa66f('0xa3')](_0x35ffba);}_0x35ffba[_0xa66f('0xa4')]-=0x1;if(!this[_0xa66f('0x82')](_0x35ffba[_0xa66f('0x110')])){return this[_0xa66f('0x35')]['error'](_0x35ffba,_0xa66f('0x111'));}var _0x19c833=this[_0xa66f('0x1e')][_0xa66f('0xd3')](this,_0x35ffba['file_id']);if(!_0x19c833){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x35ffba,'no\x20file\x20audio\x20found');}if(!this[_0xa66f('0x82')](_0x35ffba['variable_id'])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0xa66f('0xd7'));}var _0x357b68=this[_0xa66f('0x35')][_0xa66f('0x112')](_0x19c833,_0x35ffba['response'],_0x35ffba[_0xa66f('0x113')]);var _0x3e6800=_0x357b68[_0xa66f('0xa1')]?_0x357b68[_0xa66f('0xa1')]['toString']():'';logger[_0xa66f('0x2d')](_0xa66f('0x114'),JSON['stringify'](_0x357b68));if(_0x357b68['result']===-0x1){this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x35ffba,_0x3e6800);return _0x357b68;}else if(_0x357b68['extra']==='timeout'){_0x357b68[_0xa66f('0xa1')]=_0x3e6800[_0xa66f('0x98')]>=parseInt(_0x35ffba[_0xa66f('0x115')])?'x':'i';}else{_0x357b68[_0xa66f('0xa1')]=_0x3e6800[_0xa66f('0x98')]>=parseInt(_0x35ffba['mindigit'])&&_0x3e6800['length']<=parseInt(_0x35ffba[_0xa66f('0x113')])?'x':'i';}var _0x30208a=this[_0xa66f('0x12')][_0xa66f('0xd3')](this,_0x35ffba['variable_id']);if(!_0x30208a){return this['channel']['error'](_0x35ffba,_0xa66f('0xd8'));}this[_0xa66f('0x35')]['setVariable'](_0x30208a,_0x3e6800);if(this['isConfigured'](_0x35ffba[_0xa66f('0x116')])){var _0x4ba83a=parseInt(_0x35ffba[_0xa66f('0x116')],0xa);var _0x124cc6=rs['generate']({'charset':'*','length':_0x4ba83a});var _0x4f97ab=_0x3e6800[_0xa66f('0x98')];if(_0x4f97ab>0x0){if(_0x4f97ab>_0x4ba83a){this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x35ffba,_0x35ffba[_0xa66f('0x117')]===_0xa66f('0x118')?_0x124cc6+_0x3e6800[_0xa66f('0x119')](_0x4ba83a):_0x3e6800[_0xa66f('0x119')](0x0,_0x4f97ab-_0x4ba83a)+_0x124cc6);}else{this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x35ffba,rs[_0xa66f('0x11a')]({'charset':'*','length':_0x4f97ab}));}}else{this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x35ffba,'');}}else{this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x35ffba,_0x3e6800);}return _0x357b68;};AGIVertices[_0xa66f('0x11')][_0xa66f('0xe')]=function(_0x2c70ea){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x11b'),_0x2c70ea['label']));return this[_0xa66f('0x11c')](_0x2c70ea);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x11d')]=function(_0x2a5c0f){logger['info'](util['format'](_0xa66f('0x11e'),_0x2a5c0f['label']));this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x2a5c0f,_0x2a5c0f[_0xa66f('0x11f')]);return this['channel'][_0xa66f('0xa7')](util['format'](_0xa66f('0x120'),_0x2a5c0f[_0xa66f('0x11f')]));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x121')]=function(_0x328afa){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x122'),_0x328afa[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x328afa[_0xa66f('0x85')])||!this['isConfigured'](_0x328afa[_0xa66f('0x86')])){return this[_0xa66f('0x35')]['noop'](_0xa66f('0x123'));}if(!this[_0xa66f('0x82')](_0x328afa['text'])){return this[_0xa66f('0x35')]['noop'](_0xa66f('0xa6'));}this['channel'][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x124'),_0x328afa['text']));var _0x1b660f=this['awsPolly'][_0xa66f('0xd3')](this,_0x328afa);if(_0x1b660f){this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x125'),_0x1b660f));var _0x22434a=this['channel'][_0xa66f('0x100')](_0x1b660f);try{fs[_0xa66f('0x126')](_0x1b660f+_0xa66f('0x127'));}catch(_0x28d67d){logger['error'](_0x28d67d);}return _0x22434a;}return this[_0xa66f('0x35')]['error'](_0x328afa,_0xa66f('0x128'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x129')]=function(_0xe44c81){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x12a'),_0xe44c81[_0xa66f('0x36')]));if(!this['isConfigured'](_0xe44c81[_0xa66f('0x85')])||!this[_0xa66f('0x82')](_0xe44c81[_0xa66f('0x86')])){return this['channel']['noop'](_0xa66f('0x123'));}if(!this[_0xa66f('0x82')](_0xe44c81[_0xa66f('0x12b')])){return this['channel'][_0xa66f('0xa7')](_0xa66f('0x12c'));}if(!this[_0xa66f('0x82')](_0xe44c81[_0xa66f('0x59')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xa6'));}this[_0xa66f('0x35')][_0xa66f('0xe7')]=!![];this[_0xa66f('0x34')](_0xe44c81);this[_0xa66f('0x40')](_0xe44c81[_0xa66f('0x59')],'in','','');this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0x12d'),_0xe44c81[_0xa66f('0x59')]));var _0x103e4a=this[_0xa66f('0x8a')]['sync'](this,_0xe44c81);if(_0x103e4a){for(var _0x127a4c in _0x103e4a){if(_0x103e4a[_0xa66f('0xe8')](_0x127a4c)&&_['isString'](_0x103e4a[_0x127a4c])){this[_0xa66f('0x35')][_0xa66f('0x9c')](util[_0xa66f('0x27')](_0xa66f('0x12e'),_0x127a4c[_0xa66f('0x67')]()),_0x103e4a[_0x127a4c]);}}if(_[_0xa66f('0x43')](_0x103e4a['message'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x12f'));}else{this['createSquareMessage'](_0x103e4a[_0xa66f('0x71')],_0xa66f('0xf1'),_0xa66f('0x130'),'');return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x103e4a[_0xa66f('0x71')]));}}return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0xe44c81,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xa66f('0x11')]['googleasr']=function(_0x28a910){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x131'),_0x28a910[_0xa66f('0x36')],_0x28a910['timeout']));if(!this[_0xa66f('0x82')](_0x28a910[_0xa66f('0x75')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xe6'));}var _0x14d245=_0xa66f('0x132');var _0x352544=util[_0xa66f('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xa66f('0x11a')](0x4));var _0xe0606=util[_0xa66f('0x27')](_0xa66f('0x9b'),_0x352544,_0x14d245);var _0x1e957e=!![];if(_0x28a910[_0xa66f('0x133')]===_0xa66f('0x134')){_0x1e957e=![];}var _0x234b2b=this[_0xa66f('0x35')][_0xa66f('0x135')](_0x352544,_0x14d245,_0x28a910['intKey'],_0x28a910[_0xa66f('0x63')],undefined,_0x1e957e);if(_0x234b2b[_0xa66f('0xa1')]!==-0x1){this['channel'][_0xa66f('0xa7')](util['format'](_0xa66f('0x136'),_0xe0606));var _0x193f24=this[_0xa66f('0x8c')][_0xa66f('0xd3')](this,_0x28a910,_0xe0606);if(_0x193f24){for(var _0x4f8e9e in _0x193f24){if(_0x193f24[_0xa66f('0xe8')](_0x4f8e9e)){this[_0xa66f('0x35')][_0xa66f('0x9c')](util['format']('GOOGLE_ASR_%s',_0x4f8e9e[_0xa66f('0x67')]()),_0x193f24[_0x4f8e9e]);}}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0x137'),JSON[_0xa66f('0x6e')](_0x193f24)));}}return _0x234b2b;};AGIVertices[_0xa66f('0x11')]['tildeasr']=function(_0x426b66){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x138'),_0x426b66[_0xa66f('0x36')]));if(!this['isConfigured'](_0x426b66['appid'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x139'));}if(!this[_0xa66f('0x82')](_0x426b66[_0xa66f('0x8f')])){return this['channel']['noop'](_0xa66f('0x13a'));}var _0x4decf0='wav';var _0x5e3381=util[_0xa66f('0x27')](_0xa66f('0x13b'),FILES_PATH,rs[_0xa66f('0x11a')](0x4));var _0x3446b8=util[_0xa66f('0x27')](_0xa66f('0x9b'),_0x5e3381,_0x4decf0);var _0x514e31=!![];if(_0x426b66[_0xa66f('0x133')]===_0xa66f('0x134')){_0x514e31=![];}var _0x4951cc=this[_0xa66f('0x35')][_0xa66f('0x135')](_0x5e3381,_0x4decf0,_0x426b66[_0xa66f('0x13c')],_0x426b66[_0xa66f('0x63')],undefined,_0x514e31);if(_0x4951cc['result']!==-0x1){this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0x13d'),_0x3446b8));var _0x3d97ac=this['tildeASR'][_0xa66f('0xd3')](this,_0x426b66,_0x3446b8);if(_0x3d97ac){for(var _0x54d656 in _0x3d97ac){if(_0x3d97ac[_0xa66f('0xe8')](_0x54d656)){this[_0xa66f('0x35')][_0xa66f('0x9c')](util['format'](_0xa66f('0x13e'),_0x54d656['toUpperCase']()),_0x3d97ac[_0x54d656]);}}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x13f'),JSON[_0xa66f('0x6e')](_0x3d97ac)));}}return _0x4951cc;};AGIVertices[_0xa66f('0x11')][_0xa66f('0x140')]=function(_0x56cd59){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x141'),_0x56cd59[_0xa66f('0x36')]));return this['channel']['continueAt'](_0x56cd59['context'],_0x56cd59[_0xa66f('0x142')],_0x56cd59[_0xa66f('0x3c')]);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x143')]=function(_0x32b9f0){logger['info'](util[_0xa66f('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x32b9f0[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x32b9f0['condition'])){return this[_0xa66f('0x35')]['error'](_0x32b9f0,'no\x20condition\x20configured');}try{var _0x36d6e3=eval(_0x32b9f0[_0xa66f('0x144')])?_0xa66f('0x145'):_0xa66f('0x146');this['channel'][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x147'),_0x32b9f0['condition'],_0x36d6e3));return{'code':0xc8,'result':_0x36d6e3};}catch(_0x127d52){return{'code':0xc8,'result':_0xa66f('0x146')};}};AGIVertices[_0xa66f('0x11')]['gotoiftime']=function(_0x2dc2c2){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x148'),_0x2dc2c2[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x2dc2c2[_0xa66f('0x149')])){return this['channel']['error'](_0x2dc2c2,_0xa66f('0x14a'));}var _0x2ee308=this[_0xa66f('0x14b')]['sync'](this,_0x2dc2c2['interval_id']);if(!_0x2ee308){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x2dc2c2,_0xa66f('0x14c'));}for(var _0x16a93c=0x0;_0x16a93c<_0x2ee308['length'];_0x16a93c+=0x1){var _0x85dbc9=this[_0xa66f('0x35')][_0xa66f('0x12')](util[_0xa66f('0x27')]('IFTIME(%s?true:false)',_0x2ee308[_0x16a93c]));if(_0x85dbc9[_0xa66f('0xa1')]===-0x1){return _0x85dbc9;}logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x14d'),_0x2ee308[_0x16a93c],_0x85dbc9[_0xa66f('0x9f')]));if(_0x85dbc9['extra']==='true'){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x14d'),_0x2ee308[_0x16a93c],_0xa66f('0x145')));this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')]('IFTIME\x20%s\x20%s',_0x2ee308[_0x16a93c],_0xa66f('0x145')));return{'code':0xc8,'result':_0xa66f('0x145')};}else{logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x14d'),_0x2ee308[_0x16a93c],_0xa66f('0x146')));this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')]('IFTIME\x20%s\x20%s',_0x2ee308[_0x16a93c],_0xa66f('0x146')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xa66f('0x11')][_0xa66f('0x14e')]=function(_0x186809){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x14f'),_0x186809[_0xa66f('0x36')]));return this[_0xa66f('0x35')][_0xa66f('0x14e')]();};AGIVertices[_0xa66f('0x11')][_0xa66f('0x150')]=function(_0x5c4615){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5c4615['label']));if(!this['isConfigured'](_0x5c4615['key'])){return this['channel'][_0xa66f('0xa7')]('no\x20key\x20configured');}var _0x4a9855='wav';var _0x188ff9=util[_0xa66f('0x27')](_0xa66f('0x13b'),FILES_PATH,rs[_0xa66f('0x11a')](0x4));var _0x4aa197=util[_0xa66f('0x27')](_0xa66f('0x9b'),_0x188ff9,_0x4a9855);var _0x5b384c=!![];if(_0x5c4615[_0xa66f('0x133')]==='NOBEEP'){_0x5b384c=![];}var _0x14b9b6=this[_0xa66f('0x35')][_0xa66f('0x135')](_0x188ff9,_0x4a9855,_0x5c4615[_0xa66f('0x13c')],_0x5c4615[_0xa66f('0x63')],undefined,_0x5b384c);if(_0x14b9b6['result']!==-0x1){this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format']('ispeech\x20%s\x20file\x20created',_0x4aa197));var _0x33eadd=this[_0xa66f('0x80')]['sync'](this,_0x5c4615,_0x4aa197);if(_0x33eadd){for(var _0x4fcc61 in _0x33eadd){if(_0x33eadd['hasOwnProperty'](_0x4fcc61)){this['channel'][_0xa66f('0x9c')](util[_0xa66f('0x27')](_0xa66f('0x151'),_0x4fcc61[_0xa66f('0x67')]()),_0x33eadd[_0x4fcc61]);}}return this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0x152'),JSON[_0xa66f('0x6e')](_0x33eadd)));}}return _0x14b9b6;};AGIVertices[_0xa66f('0x11')][_0xa66f('0x153')]=function(_0xfc4332){logger['info'](util[_0xa66f('0x27')](_0xa66f('0x154'),_0xfc4332[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0xfc4332[_0xa66f('0x75')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this[_0xa66f('0x82')](_0xfc4332['text'])){return this['channel'][_0xa66f('0xa7')](_0xa66f('0xa6'));}this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x155'),_0xfc4332[_0xa66f('0x59')]));var _0x1e791b=this[_0xa66f('0x7c')]['sync'](this,_0xfc4332);if(_0x1e791b){this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x156'),_0x1e791b));var _0x298d5e=this[_0xa66f('0x35')][_0xa66f('0x100')](_0x1e791b,_0xfc4332[_0xa66f('0x13c')]);try{fs[_0xa66f('0x126')](_0x1e791b+_0xa66f('0x127'));}catch(_0x36cba3){logger[_0xa66f('0x2b')](_0x36cba3);}return _0x298d5e;}return this['channel'][_0xa66f('0x2b')](_0xfc4332,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa66f('0x11')]['login']=function(_0x1a0712){logger['info'](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x1a0712['label']));if(!this[_0xa66f('0x82')](_0x1a0712[_0xa66f('0x157')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x1a0712,_0xa66f('0x158'));}logger['info'](util[_0xa66f('0x27')](_0xa66f('0x159'),this[_0xa66f('0x35')]['callerid'],_0x1a0712[_0xa66f('0x157')]));var _0x4de239=this['agentLogin'][_0xa66f('0xd3')](this,_0x1a0712[_0xa66f('0x157')]);if(_0x4de239){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x15a'),this['channel'][_0xa66f('0x4f')],_0x1a0712[_0xa66f('0x157')]));this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x15a'),this['channel'][_0xa66f('0x4f')],_0x1a0712[_0xa66f('0x157')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xa66f('0x27')](_0xa66f('0x15b'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x1a0712[_0xa66f('0x157')]));this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0x15b'),this['channel'][_0xa66f('0x4f')],_0x1a0712[_0xa66f('0x157')]));return{'code':0xc8,'result':_0xa66f('0x15c')};}};AGIVertices[_0xa66f('0x11')]['logout']=function(_0xee1718){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x15d'),_0xee1718[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0xee1718[_0xa66f('0x157')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0xee1718,'no\x20find\x20by\x20configured');}logger['info'](util[_0xa66f('0x27')](_0xa66f('0x159'),this['channel'][_0xa66f('0x4f')],_0xee1718[_0xa66f('0x157')]));var _0x57bbd1=this[_0xa66f('0x50')]['sync'](this,_0xee1718[_0xa66f('0x157')]);if(_0x57bbd1){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x15a'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0xee1718['findBy']));this[_0xa66f('0x35')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa66f('0x35')][_0xa66f('0x4f')],_0xee1718[_0xa66f('0x157')]));return{'code':0xc8,'result':_0xa66f('0x15e')};}else{logger[_0xa66f('0x2d')](util[_0xa66f('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa66f('0x35')][_0xa66f('0x4f')],_0xee1718['findBy']));this['channel']['noop'](util[_0xa66f('0x27')](_0xa66f('0x15b'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0xee1718[_0xa66f('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa66f('0x11')][_0xa66f('0x15f')]=function(_0x3e09e8){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3e09e8[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x3e09e8[_0xa66f('0x160')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x3e09e8,_0xa66f('0x161'));}this[_0xa66f('0x35')]['noop'](util['format']('math\x20%s',_0x3e09e8['operation']));var _0x48fc76=eval(_0x3e09e8[_0xa66f('0x160')]);if(!this[_0xa66f('0x82')](_0x3e09e8['variable_id'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xd7'));}var _0xded190=this['getVariable'][_0xa66f('0xd3')](this,_0x3e09e8['variable_id']);if(!_0xded190){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x3e09e8,_0xa66f('0xd8'));}if(_['isArray'](_0x48fc76)){var _0x2ed9bd=this;_0x48fc76[_0xa66f('0xd9')](function(_0x282980,_0x5df373){_0x2ed9bd[_0xa66f('0x35')][_0xa66f('0x9c')](util[_0xa66f('0x27')]('%s[%s]',_0xded190,_0x5df373),_0x282980);});return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x162'),_0xded190));}else{return this[_0xa66f('0x35')]['setVariable'](_0xded190,_0x48fc76);}};AGIVertices[_0xa66f('0x11')][_0xa66f('0xd')]=function(_0x22a70e){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x163'),_0x22a70e[_0xa66f('0x36')]));if(_0x22a70e['retry']===0x0){return this['maxRetry'](_0x22a70e);}_0x22a70e[_0xa66f('0xa4')]-=0x1;if(!this[_0xa66f('0x82')](_0x22a70e[_0xa66f('0x110')])){return this['channel'][_0xa66f('0x2b')](_0x22a70e,_0xa66f('0x111'));}var _0x5c148e=this[_0xa66f('0x1e')][_0xa66f('0xd3')](this,_0x22a70e[_0xa66f('0x110')]);if(!_0x5c148e){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x22a70e,_0xa66f('0x164'));}var _0xf4f3e4=this[_0xa66f('0x35')]['getData'](_0x5c148e,_0x22a70e['response'],_0x22a70e[_0xa66f('0x165')]);var _0x422298=_0xf4f3e4[_0xa66f('0xa1')];if(_0xf4f3e4[_0xa66f('0xa1')]===-0x1){this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x22a70e,'-1');return _0xf4f3e4;}else if(_0xf4f3e4[_0xa66f('0x9f')]==='timeout'){_0xf4f3e4[_0xa66f('0xa1')]=_0xf4f3e4[_0xa66f('0xa1')][_0xa66f('0x98')]>0x0?_0xf4f3e4['result']:'t';}else if(_['isEmpty'](_0xf4f3e4[_0xa66f('0xa1')])){_0xf4f3e4[_0xa66f('0xa1')]='#';_0x422298='#';}if(!this[_0xa66f('0x82')](_0x22a70e[_0xa66f('0x166')])){this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xd7'));}else{var _0x541ef5=this[_0xa66f('0x12')]['sync'](this,_0x22a70e[_0xa66f('0x166')]);if(!_0x541ef5){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x22a70e,_0xa66f('0xd8'));}this[_0xa66f('0x35')][_0xa66f('0x9c')](_0x541ef5,_0x422298);}this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x22a70e,_0x422298);return _0xf4f3e4;};AGIVertices[_0xa66f('0x11')][_0xa66f('0xa7')]=function(_0x5991f2){logger['info'](util['format'](_0xa66f('0x167'),_0x5991f2[_0xa66f('0x36')]));return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0x5991f2[_0xa66f('0x168')]||_0x5991f2['label']);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x169')]=function(_0x5b4068){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x16a'),_0x5b4068['label']));if(!this[_0xa66f('0x82')](_0x5b4068[_0xa66f('0x157')])){return this[_0xa66f('0x35')]['error'](_0x5b4068,'no\x20find\x20by\x20configured');}logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x159'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x5b4068[_0xa66f('0x157')]));var _0x244d9=this['getPause'][_0xa66f('0xd3')](this,_0x5b4068[_0xa66f('0x16b')]);var _0x596aa3=this['agentPause'][_0xa66f('0xd3')](this,_0x5b4068[_0xa66f('0x157')],_0x244d9);if(_0x596aa3){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x15a'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x5b4068['findBy']));this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x15a'),this['channel'][_0xa66f('0x4f')],_0x5b4068['findBy']));return{'code':0xc8,'result':_0xa66f('0x15e')};}else{logger[_0xa66f('0x2d')](util[_0xa66f('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa66f('0x35')]['callerid'],_0x5b4068[_0xa66f('0x157')]));this['channel'][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x15a'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x5b4068[_0xa66f('0x157')]));return{'code':0xc8,'result':_0xa66f('0x15c')};}};AGIVertices[_0xa66f('0x11')][_0xa66f('0x16c')]=function(_0x23429d){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x16d'),_0x23429d['label']));if(!this[_0xa66f('0x82')](_0x23429d[_0xa66f('0x110')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x23429d,_0xa66f('0x111'));}var _0x1e8c84=this[_0xa66f('0x1e')][_0xa66f('0xd3')](this,_0x23429d[_0xa66f('0x110')]);if(!_0x1e8c84){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x23429d,_0xa66f('0x164'));}var _0x3e55c9=this['channel'][_0xa66f('0x54')](_0xa66f('0x16e'),[_0x1e8c84,_0x23429d[_0xa66f('0xe3')]]);if(_0x3e55c9[_0xa66f('0xa1')]===-0x1){return _0x3e55c9;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x16f'),_0xa66f('0x16e'),_0x1e8c84));};AGIVertices['prototype']['queue']=function(_0x587fdf){logger[_0xa66f('0x2d')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x587fdf[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x587fdf[_0xa66f('0x170')])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x587fdf,'no\x20queue\x20selected');}var _0x2c0134='';var _0x2265b3=parseInt(_0x587fdf[_0xa66f('0x170')],0xa);if(isNaN(_0x2265b3)){_0x2c0134=_0x587fdf[_0xa66f('0x170')];}else{_0x2c0134=this['getVoiceQueue'][_0xa66f('0xd3')](this,_0x587fdf['queue_id']);if(!_0x2c0134){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x587fdf,_0xa66f('0x171'));}}var _0xc66870='';if(this['isConfigured'](_0x587fdf['file_id'])){var _0x190c5c=this[_0xa66f('0x1e')][_0xa66f('0xd3')](this,_0x587fdf['file_id']);if(_0x190c5c){_0xc66870=_0x190c5c;}}this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x587fdf,_0x2c0134);if(_0x587fdf['opts'][_0xa66f('0x172')]('x')<0x0){_0x587fdf[_0xa66f('0xe3')]+='x';}if(_0x587fdf[_0xa66f('0xe3')][_0xa66f('0x172')]('X')<0x0){_0x587fdf['opts']+='X';}this[_0xa66f('0x35')][_0xa66f('0x9c')](_0xa66f('0x173'),_0x2c0134?_0x2c0134[_0xa66f('0x174')]():'');var _0xdd7f4e=this['channel'][_0xa66f('0x54')](_0xa66f('0x175'),[_0x2c0134,_0x587fdf[_0xa66f('0xe3')],_0x587fdf[_0xa66f('0x61')],_0xc66870,_0x587fdf[_0xa66f('0x63')],_0x587fdf[_0xa66f('0x7')],_0x587fdf[_0xa66f('0x176')],_0x587fdf[_0xa66f('0x177')],'',_0x587fdf['position']]);if(_0xdd7f4e[_0xa66f('0xa1')]===-0x1){return _0xdd7f4e;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x16f'),_0xa66f('0x175'),_0x2c0134));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x178')]=function(_0x1afa25){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x179'),_0x1afa25[_0xa66f('0x36')]));var _0x34181c=_0x1afa25[_0xa66f('0x17a')]||_0xa66f('0x132');var _0x987ccd=util['format'](_0xa66f('0x17b'),this['channel'][_0xa66f('0x39')],rs[_0xa66f('0x11a')](0x5));var _0x5032cb=util[_0xa66f('0x27')](_0xa66f('0x17c'),FILES_PATH,_0x987ccd,_0x34181c);var _0x5e93b7=util[_0xa66f('0x27')](_0xa66f('0x13b'),FILES_PATH,_0x987ccd);this[_0xa66f('0x38')][_0xa66f('0xd3')](this,_0x1afa25,_0x987ccd,_0x5032cb);this[_0xa66f('0x35')][_0xa66f('0x9c')](_0xa66f('0x17d'),_0x987ccd);logger[_0xa66f('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5e93b7,_0x34181c,_0x1afa25[_0xa66f('0x17e')],_0x1afa25[_0xa66f('0x63')]);return this[_0xa66f('0x35')][_0xa66f('0x135')](_0x5e93b7,_0x34181c,_0x1afa25[_0xa66f('0x17e')],_0x1afa25['timeout'],undefined,!![]);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x17f')]=function(_0x1a99b4){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x180'),_0x1a99b4[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x1a99b4['url'])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x181'));}var _0x17959b=this[_0xa66f('0x60')]['sync'](this,_0x1a99b4);logger[_0xa66f('0x2d')](util[_0xa66f('0x27')]('Response:',util[_0xa66f('0x182')](_0x17959b,{'showHidden':![],'depth':null})));if(!this[_0xa66f('0x82')](_0x1a99b4[_0xa66f('0x166')])){return this[_0xa66f('0x35')]['noop'](_0xa66f('0x183'));}var _0x3bdd85=this['getVariable'][_0xa66f('0xd3')](this,_0x1a99b4['variable_id']);if(!_0x3bdd85){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x1a99b4,_0xa66f('0xd8'));}this[_0xa66f('0x35')]['setVariable'](util[_0xa66f('0x27')]('%s_STATUS_CODE',_0x3bdd85),_0x17959b[_0xa66f('0x6f')]?_0x17959b[_0xa66f('0x6f')]:_0xa66f('0x184'));this['channel'][_0xa66f('0x9c')](util[_0xa66f('0x27')](_0xa66f('0x185'),_0x3bdd85),_0x17959b[_0xa66f('0x70')]?_0x17959b[_0xa66f('0x70')]:'OK');if(_0x17959b[_0xa66f('0x6d')]){try{this[_0xa66f('0x9a')](_0x17959b[_0xa66f('0x6d')],_0x3bdd85);}catch(_0x488916){logger[_0xa66f('0x2b')](util[_0xa66f('0x27')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3bdd85));}}return this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0xdc'),_0x3bdd85));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x186')]=function(_0x14ad9a){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x187'),_0x14ad9a[_0xa66f('0x36')]));return this[_0xa66f('0x35')][_0xa66f('0x188')](_0x14ad9a[_0xa66f('0x189')][_0xa66f('0x56')](/\s+/g,''),_0x14ad9a['escape_digits']);};AGIVertices[_0xa66f('0x11')]['saynumber']=function(_0x106649){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x18a'),_0x106649[_0xa66f('0x36')]));return this[_0xa66f('0x35')][_0xa66f('0x18b')](_0x106649[_0xa66f('0x64')][_0xa66f('0x56')](/\s+/g,''),_0x106649['escape_digits']);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x18c')]=function(_0x5afbf2){logger['info'](util[_0xa66f('0x27')](_0xa66f('0x18d'),_0x5afbf2[_0xa66f('0x36')]));return this[_0xa66f('0x35')][_0xa66f('0x18e')](_0x5afbf2[_0xa66f('0x59')],_0x5afbf2[_0xa66f('0x17e')]);};AGIVertices['prototype'][_0xa66f('0x18f')]=function(_0x40a482){logger[_0xa66f('0x2d')](util['format'](_0xa66f('0x190'),_0x40a482[_0xa66f('0x36')]));if(!this['isConfigured'](_0x40a482[_0xa66f('0x191')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x192'));}var _0x194323=this[_0xa66f('0x193')][_0xa66f('0xd3')](this,_0x40a482[_0xa66f('0x191')]);if(!_0x194323||!_0x194323[_0xa66f('0x194')]){return this[_0xa66f('0x35')]['error'](_0x40a482,'no\x20mail\x20account\x20found');}var _0x54f726={'from':util['format'](_0xa66f('0x195'),_0x194323[_0xa66f('0x14')],_0x194323['email']||_0x194323[_0xa66f('0x194')][_0xa66f('0x196')]),'to':_0x40a482['to']||'','cc':_0x40a482['cc']||'','bcc':_0x40a482[_0xa66f('0x197')]||'','subject':_0x40a482['subject'],'html':_0x40a482[_0xa66f('0x59')],'text':_0x40a482[_0xa66f('0x59')]};if(this[_0xa66f('0x82')](_0x40a482[_0xa66f('0x198')])){}logger[_0xa66f('0xde')](_0xa66f('0x199'),JSON[_0xa66f('0x6e')](_0x54f726));this[_0xa66f('0x34')]['sync'](this,_0x40a482,_0x40a482[_0xa66f('0x191')]);this[_0xa66f('0x35')][_0xa66f('0xa7')](util['format'](_0xa66f('0x19a'),_0x194323['name']));this['sendMailMessage'][_0xa66f('0xd3')](this,_0x194323[_0xa66f('0x19b')],_0x54f726);return this['channel'][_0xa66f('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa66f('0x11')][_0xa66f('0x19c')]=function(_0x33ab06){logger['info'](util[_0xa66f('0x27')](_0xa66f('0x19d'),_0x33ab06['label']));return this['channel'][_0xa66f('0xa7')](_0xa66f('0x19e'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x19f')]=function(_0x172ba9){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x1a0'),_0x172ba9[_0xa66f('0x36')]));if(!this['isConfigured'](_0x172ba9[_0xa66f('0x1a1')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x1a2'));}var _0x404ed1=this[_0xa66f('0x32')]['sync'](this,_0x172ba9[_0xa66f('0x1a1')]);if(!_0x404ed1){return this[_0xa66f('0x35')]['error'](_0x172ba9,_0xa66f('0x1a3'));}var _0x48b397={'body':_0x172ba9['sms_text'],'phone':_0x172ba9['to']||'','SmsAccountId':_0x404ed1['id']};logger[_0xa66f('0xde')](_0xa66f('0x1a4'),JSON['stringify'](_0x48b397));this['createSquareDetailsReport']['sync'](this,_0x172ba9,_0x172ba9[_0xa66f('0x1a1')]);this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x1a5'),_0x404ed1[_0xa66f('0x14')]));this['createSmsMessage']['sync'](this,_0x48b397);return this['channel'][_0xa66f('0xa7')](_0xa66f('0x1a6'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1a7')]=function(_0x503925){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x1a8'),_0x503925[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x503925['variable_id'])){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x503925,'no\x20variable\x20selected');}var _0x26e5be=this[_0xa66f('0x12')]['sync'](this,_0x503925[_0xa66f('0x166')]);if(!_0x26e5be){return this[_0xa66f('0x35')]['error'](_0x503925,_0xa66f('0xd8'));}return this[_0xa66f('0x35')][_0xa66f('0x9c')](_0x26e5be,_0x503925[_0xa66f('0x1a9')]);};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1aa')]=function(_0x30b7a0){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x1ab'),_0x30b7a0[_0xa66f('0x36')]));this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x1ac'));var _0x4c787a=this[_0xa66f('0x35')][_0xa66f('0x12')](_0xa66f('0x1ad'));if(!_['isEmpty'](_0x4c787a[_0xa66f('0x9f')])){this[_0xa66f('0x35')][_0xa66f('0x39')]=_0x4c787a[_0xa66f('0x9f')];}if(_0x30b7a0['answer']===_0xa66f('0x1ae')){this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x1af'));return this[_0xa66f('0x35')]['answer']();}return this[_0xa66f('0x35')]['noop'](_0xa66f('0x1b0'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1b1')]=function(_0x52c0cd){logger['info'](util[_0xa66f('0x27')](_0xa66f('0x1b2'),_0x52c0cd[_0xa66f('0x36')]));if(!this[_0xa66f('0x82')](_0x52c0cd[_0xa66f('0x1b3')])){return this[_0xa66f('0x35')]['error'](_0x52c0cd,'no\x20subproject\x20selected');}var _0x2b8bed=this[_0xa66f('0x18')][_0xa66f('0xd3')](this,_0x52c0cd['project_id']);if(!this[_0xa66f('0x82')](_0x2b8bed)){return this['channel'][_0xa66f('0x2b')](_0x52c0cd,util[_0xa66f('0x27')](_0xa66f('0x1b4'),_0x52c0cd[_0xa66f('0x1b3')]));}if(_0x2b8bed===this[_0xa66f('0x35')]['arg_1']){return this[_0xa66f('0x35')]['error'](_0x52c0cd,_0xa66f('0x1b5'));}this[_0xa66f('0x34')][_0xa66f('0xd3')](this,_0x52c0cd,_0x2b8bed);var _0x50b57c=this[_0xa66f('0x35')][_0xa66f('0x54')](_0xa66f('0x1b6'),util[_0xa66f('0x27')](_0xa66f('0x1b7'),config[_0xa66f('0x7')]['host']||'127.0.0.1',_0x2b8bed,this['channel'][_0xa66f('0x3e')]));if(_0x50b57c[_0xa66f('0xa1')]===-0x1){return _0x50b57c;}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x16f'),_0xa66f('0x1b6'),_0x2b8bed));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1b8')]=function(_0x20225c){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x1b9'),_0x20225c[_0xa66f('0x36')]));var _0x2ec989=this[_0xa66f('0x53')][_0xa66f('0xd3')](this,_0x20225c[_0xa66f('0x1ba')]);this[_0xa66f('0x34')]['sync'](this,_0x20225c,_0x20225c[_0xa66f('0x1ba')]);if(this['isConfigured'](_0x20225c['variable_id'])){var _0x17fbee=this[_0xa66f('0x12')][_0xa66f('0xd3')](this,_0x20225c[_0xa66f('0x166')]);if(_0x17fbee){this[_0xa66f('0x35')][_0xa66f('0x9c')](_0x17fbee,_0x2ec989);return this[_0xa66f('0x35')]['noop'](util[_0xa66f('0x27')](_0xa66f('0x1bb'),_0x20225c['command'],_0x17fbee));}}return this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x1bc'),_0x20225c[_0xa66f('0x1ba')]));};AGIVertices[_0xa66f('0x11')]['google_cloud_tts']=function(_0x29f9d6){logger['info'](util['format'](_0xa66f('0x1bd'),_0x29f9d6['label']));_0x29f9d6[_0xa66f('0x59')]=_0x29f9d6[_0xa66f('0x59')][_0xa66f('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x29f9d6[_0xa66f('0x58')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0x1be'));}if(!this[_0xa66f('0x82')](_0x29f9d6[_0xa66f('0x59')])){return this['channel'][_0xa66f('0xa7')](_0xa66f('0xa6'));}this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x1bf'),_0x29f9d6[_0xa66f('0x59')]));var _0x28d9a8=this[_0xa66f('0x57')][_0xa66f('0xd3')](this,_0x29f9d6);if(_0x28d9a8){this['channel']['noop'](util[_0xa66f('0x27')](_0xa66f('0x1c0'),_0x28d9a8));var _0x18faa1=this[_0xa66f('0x35')]['streamFile'](_0x28d9a8);try{fs[_0xa66f('0x126')](_0x28d9a8+_0xa66f('0x127'));}catch(_0x2a1910){logger[_0xa66f('0x2b')](_0x2a1910);}return _0x18faa1;}return this['channel']['error'](_0x29f9d6,_0xa66f('0x1c1'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1c2')]=function(_0x4ee8d4){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4ee8d4[_0xa66f('0x36')]));_0x4ee8d4['text']=_0x4ee8d4[_0xa66f('0x59')][_0xa66f('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa66f('0x82')](_0x4ee8d4[_0xa66f('0x59')])){return this[_0xa66f('0x35')][_0xa66f('0xa7')](_0xa66f('0xa6'));}this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x1c3'),_0x4ee8d4[_0xa66f('0x59')]));var _0x2672a2=this[_0xa66f('0x5e')][_0xa66f('0xd3')](this,_0x4ee8d4);if(_0x2672a2){this[_0xa66f('0x35')][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x1c4'),_0x2672a2));var _0x3a6cb9=this['channel'][_0xa66f('0x100')](_0x2672a2);try{fs[_0xa66f('0x126')](_0x2672a2+_0xa66f('0x127'));}catch(_0x129580){logger['error'](_0x129580);}return _0x3a6cb9;}return this[_0xa66f('0x35')]['error'](_0x4ee8d4,_0xa66f('0x1c5'));};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1c6')]=function(_0x38e447){logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x1c7'),_0x38e447[_0xa66f('0x36')]));if(!this['isConfigured'](_0x38e447[_0xa66f('0x157')])){return this['channel'][_0xa66f('0x2b')](_0x38e447,_0xa66f('0x158'));}logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x159'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x38e447[_0xa66f('0x157')]));var _0x198f16=this[_0xa66f('0x4d')][_0xa66f('0xd3')](this,_0x38e447[_0xa66f('0x157')]);if(_0x198f16){logger[_0xa66f('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x38e447['findBy']));this['channel'][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x15a'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x38e447[_0xa66f('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa66f('0x2d')](util[_0xa66f('0x27')](_0xa66f('0x15b'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x38e447[_0xa66f('0x157')]));this['channel'][_0xa66f('0xa7')](util[_0xa66f('0x27')](_0xa66f('0x15b'),this[_0xa66f('0x35')][_0xa66f('0x4f')],_0x38e447[_0xa66f('0x157')]));return{'code':0xc8,'result':_0xa66f('0x15c')};}};AGIVertices[_0xa66f('0x11')][_0xa66f('0x1c8')]=function(_0x5a3fa5){logger['info'](util[_0xa66f('0x27')](_0xa66f('0x1c9'),_0x5a3fa5[_0xa66f('0x36')]));var _0x33fab7=this[_0xa66f('0x35')][_0xa66f('0x54')](_0xa66f('0x1ca'),[_0x5a3fa5[_0xa66f('0x1cb')],_0x5a3fa5['options']]);if(_0x33fab7['result']===-0x1){return _0x33fab7;}return this['channel']['noop'](util[_0xa66f('0x27')](_0xa66f('0x16f'),_0xa66f('0x1ca'),_0x5a3fa5[_0xa66f('0x1cb')]));};AGIVertices[_0xa66f('0x11')]['vswitch']=function(_0x18ae87){logger['info'](util[_0xa66f('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x18ae87['label']));if(!this['isConfigured'](_0x18ae87[_0xa66f('0x166')])){return this['channel'][_0xa66f('0x2b')](_0x18ae87,_0xa66f('0x1cc'));}var _0xe24a97=this[_0xa66f('0x12')][_0xa66f('0xd3')](this,_0x18ae87[_0xa66f('0x166')]);if(!_0xe24a97){return this[_0xa66f('0x35')][_0xa66f('0x2b')](_0x18ae87,_0xa66f('0xd8'));}var _0xa12d36=this['channel']['getVariable'](_0xe24a97);return{'code':0xc8,'result':_0xa12d36[_0xa66f('0x9f')]?_0xa12d36[_0xa66f('0x9f')]:'-'};};String[_0xa66f('0x11')]['replaceAll']=function(_0x312bbe,_0x5bb2b6){return this[_0xa66f('0x9e')](_0x312bbe)[_0xa66f('0x1cd')](_0x5bb2b6);};module[_0xa66f('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 5bf371e..59de23a 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 _0x4367=['transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','getAgent','pauseType','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','message','mandatoryDisposition','destlinkedid','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4367,0x113));var _0x7436=function(_0x27b0fe,_0x1d2394){_0x27b0fe=_0x27b0fe-0x0;var _0x393919=_0x4367[_0x27b0fe];return _0x393919;};'use strict';var _=require(_0x7436('0x0'));var moment=require('moment');var ami=require(_0x7436('0x1'));var logger=require(_0x7436('0x2'))(_0x7436('0x3'));var RpcUser=require(_0x7436('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5db02a){this['voiceQueues']=_0x5db02a[_0x7436('0x5')];this[_0x7436('0x6')]=_0x5db02a[_0x7436('0x6')];this[_0x7436('0x7')]=_0x5db02a[_0x7436('0x7')];this[_0x7436('0x8')]={};ami['on']('agentconnect',this[_0x7436('0x9')][_0x7436('0xa')](this));ami['on'](_0x7436('0xb'),this[_0x7436('0xc')][_0x7436('0xa')](this));ami['on'](_0x7436('0xd'),this[_0x7436('0xe')][_0x7436('0xa')](this));ami['on']('agentringnoanswer',this[_0x7436('0xf')][_0x7436('0xa')](this));ami['on']('attendedtransfer',this[_0x7436('0x10')][_0x7436('0xa')](this));ami['on'](_0x7436('0x11'),this[_0x7436('0x12')][_0x7436('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x7436('0x13')][_0x7436('0xa')](this));}function getDiff(_0x21523f){var _0x141ac0=moment()[_0x7436('0x14')](0x0);var _0x1d2ea9=moment(_0x21523f)[_0x7436('0x14')](0x0);return _0x141ac0[_0x7436('0x15')](_0x1d2ea9,_0x7436('0x16'));}Acw[_0x7436('0x17')][_0x7436('0x18')]=function(_0x1ac567,_0x117ccb){var _0x417b9d=this;var _0x1c1150=getDiff(_0x417b9d[_0x7436('0x7')][_0x1ac567][_0x7436('0x19')]);clearTimeout(_0x417b9d[_0x7436('0x7')][_0x1ac567]['timer']);_0x417b9d['timers'][_0x1ac567]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0x1c1150},_0x417b9d[_0x7436('0x7')][_0x1ac567]['uniqueid'],_0x1ac567)[_0x7436('0x1a')](function(_0x36687d){logger[_0x7436('0x1b')](_0x7436('0x1c'),_0x117ccb,_0x1c1150,_0x36687d);})[_0x7436('0x1d')](function(_0x8c1dda){logger[_0x7436('0x1e')]('[%s][UPDATE][ERRORS:%s]',_0x117ccb,_0x8c1dda);})[_0x7436('0x1f')](function(){delete _0x417b9d[_0x7436('0x7')][_0x1ac567];});};Acw['prototype'][_0x7436('0x20')]=function(_0x6d8f0d){try{var _0x3973cf=this;var _0x21cfdd=this[_0x7436('0x8')][_0x6d8f0d][_0x7436('0x21')];var _0x5aecc1=this[_0x7436('0x8')][_0x6d8f0d][_0x7436('0x22')];var _0x4ee6eb=this[_0x7436('0x5')][_0x5aecc1];var _0x5b59fe=![];var _0x1a2122=_0x7436('0x23');if(_0x4ee6eb['mandatoryDisposition']&&_0x4ee6eb[_0x7436('0x24')][_0x7436('0x25')]){_0x5b59fe=!![];_0x1a2122=_0x4ee6eb[_0x7436('0x24')]['name'];}return ami[_0x7436('0x26')]({'action':_0x7436('0x27'),'interface':_0x21cfdd,'paused':!![],'reason':_0x1a2122})[_0x7436('0x1a')](function(){if(_0x3973cf[_0x7436('0x6')][_0x21cfdd]){return RpcUser['getAgent'](_0x3973cf['agents'][_0x21cfdd]['id'])['then'](function(_0x334832){if(!_0x334832||_0x334832[_0x7436('0x28')]){logger['info'](_0x7436('0x29'),_0x6d8f0d,_0x21cfdd,_0x5aecc1);return;}logger[_0x7436('0x1b')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x6d8f0d,_0x21cfdd,_0x5aecc1);var _0x362121=_0x3973cf['channels'][_0x6d8f0d][_0x7436('0x2a')]&&_0x3973cf[_0x7436('0x8')][_0x6d8f0d]['destlinkedid']?_0x3973cf[_0x7436('0x8')][_0x6d8f0d]['destlinkedid']:_0x6d8f0d;return RpcUser[_0x7436('0x2b')](_0x3973cf[_0x7436('0x6')][_0x21cfdd],_0x1a2122,_0x362121)[_0x7436('0x1a')](function(_0x3df706){_0x3973cf['voiceQueues'][_0x5aecc1][_0x7436('0x2c')]-=0x1;_0x3973cf[_0x7436('0x5')][_0x5aecc1]['paused']+=0x1;return _0x3df706;});})[_0x7436('0x1a')](function(_0xbcbb35){if(_0x5b59fe||!_0xbcbb35){return;}_0x3973cf[_0x7436('0x7')][_0x21cfdd]={};logger[_0x7436('0x1b')](_0x7436('0x2d'),_0x6d8f0d,_0x3973cf[_0x7436('0x5')][_0x5aecc1][_0x7436('0x2e')],_0x21cfdd,_0x5aecc1);_0x3973cf['timers'][_0x21cfdd][_0x7436('0x2f')]=setTimeout(_0x3973cf[_0x7436('0x30')][_0x7436('0xa')](_0x3973cf,_0x21cfdd),_0x3973cf[_0x7436('0x5')][_0x5aecc1][_0x7436('0x2e')]*0x3e8);_0x3973cf[_0x7436('0x7')][_0x21cfdd][_0x7436('0x19')]=moment()[_0x7436('0x31')](_0x7436('0x32'));_0x3973cf[_0x7436('0x7')][_0x21cfdd][_0x7436('0x33')]=_0x6d8f0d;_0x3973cf['timers'][_0x21cfdd]['queue']=_0x5aecc1;_0x3973cf[_0x7436('0x7')][_0x21cfdd][_0x7436('0x18')]=_0x3973cf[_0x7436('0x18')][_0x7436('0xa')](_0x3973cf,_0x21cfdd,_0x6d8f0d);});}})[_0x7436('0x1d')](function(){logger[_0x7436('0x1e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x6d8f0d,_0x3973cf[_0x7436('0x5')][_0x5aecc1][_0x7436('0x2e')],_0x21cfdd,_0x5aecc1);})[_0x7436('0x1f')](function(){delete _0x3973cf[_0x7436('0x8')][_0x6d8f0d];});}catch(_0x3ec8c3){logger[_0x7436('0x1e')](_0x7436('0x34'),_0x3ec8c3['message']);}};Acw[_0x7436('0x17')][_0x7436('0x30')]=function(_0xff1529){try{var _0x1ecdfd=this;if(_0x1ecdfd[_0x7436('0x7')][_0xff1529]){_0x1ecdfd[_0x7436('0x7')][_0xff1529][_0x7436('0x2f')]=![];var _0xcaa372=_0x1ecdfd['timers'][_0xff1529][_0x7436('0x33')];var _0x14f289=_0x1ecdfd[_0x7436('0x7')][_0xff1529][_0x7436('0x22')];var _0x2d3305=_0x1ecdfd[_0x7436('0x5')][_0x14f289][_0x7436('0x2e')];logger[_0x7436('0x1b')](_0x7436('0x35'),_0xcaa372,_0xff1529);RpcUser[_0x7436('0x36')](this[_0x7436('0x6')][_0xff1529]['id'])[_0x7436('0x1a')](function(_0x24ac45){if(_0x24ac45[_0x7436('0x37')]==='ACW'){return RpcUser[_0x7436('0x38')](_0x1ecdfd['agents'][_0xff1529]);}});RpcVoiceAgentReport[_0x7436('0x39')]({'acwtime':_0x2d3305,'agentacw':!![]},_0xcaa372,_0xff1529)[_0x7436('0x1a')](function(_0x53b160){logger[_0x7436('0x1b')](_0x7436('0x1c'),_0xcaa372,_0x2d3305,_0x53b160);})[_0x7436('0x1d')](function(_0x5caca9){logger[_0x7436('0x1e')]('[%s][UPDATE][ERRORS:%s]',_0xcaa372,_0x5caca9);});}else{logger[_0x7436('0x1e')](_0x7436('0x3a'),_0xff1529);if(_0x1ecdfd[_0x7436('0x7')]){logger[_0x7436('0x1b')](_0x7436('0x3b'),JSON[_0x7436('0x3c')](_0x1ecdfd[_0x7436('0x7')]));}}}catch(_0x12e6a0){logger[_0x7436('0x1e')]('[ACW][STOP]\x20%s',_0x12e6a0[_0x7436('0x3d')]);}};Acw[_0x7436('0x17')][_0x7436('0x9')]=function(_0x2adf0e){try{if(this[_0x7436('0x5')][_0x2adf0e['queue']]&&(this[_0x7436('0x5')][_0x2adf0e[_0x7436('0x22')]][_0x7436('0x3')]||this[_0x7436('0x5')][_0x2adf0e[_0x7436('0x22')]][_0x7436('0x3e')])){if(this[_0x7436('0x6')][_0x2adf0e[_0x7436('0x21')]]){this['channels'][_0x2adf0e[_0x7436('0x33')]]={'queue':_0x2adf0e[_0x7436('0x22')],'interface':_0x2adf0e['interface'],'destlinkedid':_0x2adf0e[_0x7436('0x3f')]};}}}catch(_0x4f4b76){logger[_0x7436('0x1e')]('[ACW][syncAgentConnect]\x20%s',_0x4f4b76['message']);}};Acw[_0x7436('0x17')][_0x7436('0x13')]=function(_0x44ce36){try{if(this[_0x7436('0x5')][_0x44ce36[_0x7436('0x22')]]&&(this['voiceQueues'][_0x44ce36[_0x7436('0x22')]][_0x7436('0x3')]||this[_0x7436('0x5')][_0x44ce36[_0x7436('0x22')]][_0x7436('0x3e')])){if(this[_0x7436('0x6')][_0x44ce36[_0x7436('0x21')]]){this['channels'][_0x44ce36['uniqueid']]={'queue':_0x44ce36[_0x7436('0x22')],'interface':_0x44ce36['interface']};}}}catch(_0x5728c7){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x5728c7[_0x7436('0x3d')]);}};Acw[_0x7436('0x17')][_0x7436('0xc')]=function(_0x3919c7){try{if(this[_0x7436('0x8')][_0x3919c7[_0x7436('0x33')]]&&_[_0x7436('0x40')](this[_0x7436('0x8')][_0x3919c7[_0x7436('0x33')]][_0x7436('0x2a')])){logger[_0x7436('0x1b')]('[%s][HANGUP:UNIQUEID]',_0x3919c7[_0x7436('0x33')]);this[_0x7436('0x20')](_0x3919c7[_0x7436('0x33')]);}else if(this[_0x7436('0x8')][_0x3919c7['linkedid']]&&_[_0x7436('0x40')](this[_0x7436('0x8')][_0x3919c7[_0x7436('0x41')]][_0x7436('0x2a')])){logger[_0x7436('0x1b')](_0x7436('0x42'),_0x3919c7[_0x7436('0x41')]);this[_0x7436('0x20')](_0x3919c7[_0x7436('0x41')]);}}catch(_0x5a61ce){logger[_0x7436('0x1e')](_0x7436('0x43'),_0x5a61ce[_0x7436('0x3d')]);}};Acw[_0x7436('0x17')][_0x7436('0xe')]=function(_0x1effd4){try{if(this[_0x7436('0x8')][_0x1effd4[_0x7436('0x33')]]&&this[_0x7436('0x8')][_0x1effd4['uniqueid']][_0x7436('0x2a')]){logger[_0x7436('0x1b')](_0x7436('0x44'),_0x1effd4[_0x7436('0x33')]);this['startAcw'](_0x1effd4[_0x7436('0x33')]);}else if(this['channels'][_0x1effd4[_0x7436('0x41')]]&&this[_0x7436('0x8')][_0x1effd4[_0x7436('0x41')]][_0x7436('0x2a')]){logger[_0x7436('0x1b')](_0x7436('0x45'),_0x1effd4[_0x7436('0x41')]);this['startAcw'](_0x1effd4[_0x7436('0x41')]);}}catch(_0x521f11){logger[_0x7436('0x1e')](_0x7436('0x46'),_0x521f11['message']);}};Acw[_0x7436('0x17')]['syncAttendedTransfer']=function(_0x10f6d4){try{if(!_[_0x7436('0x47')](this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x48')]])){this[_0x7436('0x20')](_0x10f6d4['transfereeuniqueid']);if(this[_0x7436('0x8')][_0x10f6d4['secondtransfereruniqueid']]){this[_0x7436('0x8')][_0x10f6d4['secondtransfereruniqueid']][_0x7436('0x2a')]=!![];this['channels'][_0x10f6d4[_0x7436('0x49')]]=this[_0x7436('0x8')][_0x10f6d4['secondtransfereruniqueid']];delete this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x4a')]];}}else if(!_[_0x7436('0x47')](this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x49')]])){this[_0x7436('0x20')](_0x10f6d4[_0x7436('0x49')]);if(this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x4b')]]){this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x4b')]][_0x7436('0x2a')]=!![];this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x48')]]=this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x4b')]];delete this[_0x7436('0x8')][_0x10f6d4[_0x7436('0x4b')]];}}}catch(_0x51d13e){logger[_0x7436('0x1e')](_0x7436('0x4c'),_0x51d13e[_0x7436('0x3d')]);}};Acw['prototype'][_0x7436('0x12')]=function(_0x42ca2a){try{if(this['channels'][_0x42ca2a[_0x7436('0x4d')]]){logger['info'](_0x7436('0x4e'),JSON['stringify'](_0x42ca2a[_0x7436('0x4d')]));this[_0x7436('0x20')](_0x42ca2a[_0x7436('0x4d')]);}else if(this[_0x7436('0x8')][_0x42ca2a[_0x7436('0x4f')]]){logger['info'](_0x7436('0x50'),JSON['stringify'](_0x42ca2a['transfererlinkedid']));this[_0x7436('0x20')](_0x42ca2a[_0x7436('0x4f')]);}}catch(_0x174308){logger[_0x7436('0x1e')](_0x7436('0x51'),_0x174308[_0x7436('0x3d')]);}};Acw[_0x7436('0x17')]['syncAgentRingNoAnswer']=function(_0x432f0d){try{if(this[_0x7436('0x5')][_0x432f0d[_0x7436('0x22')]]&&this[_0x7436('0x5')][_0x432f0d['queue']][_0x7436('0x52')]==='all'){if(this[_0x7436('0x6')][_0x432f0d[_0x7436('0x21')]]){logger['info'](_0x7436('0x53'),_0x432f0d[_0x7436('0x33')],_0x432f0d[_0x7436('0x21')],_0x432f0d['queue']);return RpcUser[_0x7436('0x2b')](this[_0x7436('0x6')][_0x432f0d[_0x7436('0x21')]],_0x7436('0x54'),_0x432f0d[_0x7436('0x33')]);}}}catch(_0x4e5a7e){logger['error'](_0x7436('0x55'),_0x4e5a7e[_0x7436('0x3d')]);}};module[_0x7436('0x56')]=Acw; \ No newline at end of file +var _0xdaa4=['destlinkedid','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','stringify','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','then','error','[%s][UPDATE][ERRORS:%s]','startAcw','queue','mandatoryDisposition','mandatoryDispositionPause','Action','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','message','[%s][TIMER][STOP][AGENT:%s]','getAgent','pauseType','ACW','update','[%s][UPDATE][ACWTIME:%s]','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','interface'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xdaa4,0xd0));var _0x4daa=function(_0x5afdda,_0x422b72){_0x5afdda=_0x5afdda-0x0;var _0x4a7bd6=_0xdaa4[_0x5afdda];return _0x4a7bd6;};'use strict';var _=require(_0x4daa('0x0'));var moment=require('moment');var ami=require(_0x4daa('0x1'));var logger=require(_0x4daa('0x2'))(_0x4daa('0x3'));var RpcUser=require(_0x4daa('0x4'));var RpcVoiceAgentReport=require(_0x4daa('0x5'));function Acw(_0x331ce2){this[_0x4daa('0x6')]=_0x331ce2[_0x4daa('0x6')];this[_0x4daa('0x7')]=_0x331ce2[_0x4daa('0x7')];this[_0x4daa('0x8')]=_0x331ce2['timers'];this[_0x4daa('0x9')]={};ami['on'](_0x4daa('0xa'),this[_0x4daa('0xb')]['bind'](this));ami['on'](_0x4daa('0xc'),this[_0x4daa('0xd')][_0x4daa('0xe')](this));ami['on'](_0x4daa('0xf'),this[_0x4daa('0x10')][_0x4daa('0xe')](this));ami['on'](_0x4daa('0x11'),this[_0x4daa('0x12')][_0x4daa('0xe')](this));ami['on'](_0x4daa('0x13'),this[_0x4daa('0x14')][_0x4daa('0xe')](this));ami['on'](_0x4daa('0x15'),this[_0x4daa('0x16')]['bind'](this));ami['on'](_0x4daa('0x17'),this[_0x4daa('0x18')]['bind'](this));}function getDiff(_0x26feb5){var _0x4f22eb=moment()[_0x4daa('0x19')](0x0);var _0x19ee90=moment(_0x26feb5)[_0x4daa('0x19')](0x0);return _0x4f22eb[_0x4daa('0x1a')](_0x19ee90,'seconds');}Acw[_0x4daa('0x1b')][_0x4daa('0x1c')]=function(_0x1c9c63,_0x585cc9){var _0x4ed7c4=this;var _0x1d97b0=getDiff(_0x4ed7c4[_0x4daa('0x8')][_0x1c9c63][_0x4daa('0x1d')]);clearTimeout(_0x4ed7c4[_0x4daa('0x8')][_0x1c9c63]['timer']);_0x4ed7c4[_0x4daa('0x8')][_0x1c9c63][_0x4daa('0x1e')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x1d97b0},_0x4ed7c4[_0x4daa('0x8')][_0x1c9c63]['uniqueid'],_0x1c9c63)[_0x4daa('0x1f')](function(_0x2bb939){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x585cc9,_0x1d97b0,_0x2bb939);})['catch'](function(_0x5da692){logger[_0x4daa('0x20')](_0x4daa('0x21'),_0x585cc9,_0x5da692);})['finally'](function(){delete _0x4ed7c4[_0x4daa('0x8')][_0x1c9c63];});};Acw[_0x4daa('0x1b')][_0x4daa('0x22')]=function(_0x3eb2a5){try{var _0x271985=this;var _0x5d4aee=this['channels'][_0x3eb2a5]['interface'];var _0x4fef54=this[_0x4daa('0x9')][_0x3eb2a5][_0x4daa('0x23')];var _0x177d9c=this[_0x4daa('0x6')][_0x4fef54];var _0x3aa374=![];var _0x48fb9d='ACW';if(_0x177d9c[_0x4daa('0x24')]&&_0x177d9c[_0x4daa('0x25')]['name']){_0x3aa374=!![];_0x48fb9d=_0x177d9c['mandatoryDispositionPause']['name'];}return ami[_0x4daa('0x26')]({'action':'QueuePause','interface':_0x5d4aee,'paused':!![],'reason':_0x48fb9d})['then'](function(){if(_0x271985[_0x4daa('0x7')][_0x5d4aee]){return RpcUser['getAgent'](_0x271985[_0x4daa('0x7')][_0x5d4aee]['id'])[_0x4daa('0x1f')](function(_0xccbf2){if(!_0xccbf2||_0xccbf2[_0x4daa('0x27')]){logger[_0x4daa('0x28')](_0x4daa('0x29'),_0x3eb2a5,_0x5d4aee,_0x4fef54);return;}logger[_0x4daa('0x28')](_0x4daa('0x2a'),_0x3eb2a5,_0x5d4aee,_0x4fef54);var _0x3c8eb4=_0x271985[_0x4daa('0x9')][_0x3eb2a5]['attended']&&_0x271985['channels'][_0x3eb2a5]['destlinkedid']?_0x271985[_0x4daa('0x9')][_0x3eb2a5]['destlinkedid']:_0x3eb2a5;return RpcUser['savePause'](_0x271985[_0x4daa('0x7')][_0x5d4aee],_0x48fb9d,_0x3c8eb4)['then'](function(_0x2a7b08){_0x271985[_0x4daa('0x6')][_0x4fef54][_0x4daa('0x2b')]-=0x1;_0x271985[_0x4daa('0x6')][_0x4fef54][_0x4daa('0x2c')]+=0x1;return _0x2a7b08;});})[_0x4daa('0x1f')](function(_0x538623){if(_0x3aa374||!_0x538623){return;}_0x271985[_0x4daa('0x8')][_0x5d4aee]={};logger[_0x4daa('0x28')](_0x4daa('0x2d'),_0x3eb2a5,_0x271985[_0x4daa('0x6')][_0x4fef54][_0x4daa('0x2e')],_0x5d4aee,_0x4fef54);_0x271985[_0x4daa('0x8')][_0x5d4aee][_0x4daa('0x1e')]=setTimeout(_0x271985[_0x4daa('0x2f')][_0x4daa('0xe')](_0x271985,_0x5d4aee),_0x271985['voiceQueues'][_0x4fef54][_0x4daa('0x2e')]*0x3e8);_0x271985[_0x4daa('0x8')][_0x5d4aee]['lastPauseAt']=moment()[_0x4daa('0x30')](_0x4daa('0x31'));_0x271985['timers'][_0x5d4aee][_0x4daa('0x32')]=_0x3eb2a5;_0x271985[_0x4daa('0x8')][_0x5d4aee][_0x4daa('0x23')]=_0x4fef54;_0x271985[_0x4daa('0x8')][_0x5d4aee][_0x4daa('0x1c')]=_0x271985[_0x4daa('0x1c')][_0x4daa('0xe')](_0x271985,_0x5d4aee,_0x3eb2a5);});}})['catch'](function(){logger[_0x4daa('0x20')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3eb2a5,_0x271985[_0x4daa('0x6')][_0x4fef54][_0x4daa('0x2e')],_0x5d4aee,_0x4fef54);})['finally'](function(){delete _0x271985[_0x4daa('0x9')][_0x3eb2a5];});}catch(_0x308e2d){logger[_0x4daa('0x20')]('[ACW][START]\x20%s',_0x308e2d[_0x4daa('0x33')]);}};Acw[_0x4daa('0x1b')][_0x4daa('0x2f')]=function(_0xc55541){try{var _0x2abdef=this;if(_0x2abdef['timers'][_0xc55541]){_0x2abdef[_0x4daa('0x8')][_0xc55541]['timer']=![];var _0x7a658=_0x2abdef[_0x4daa('0x8')][_0xc55541]['uniqueid'];var _0x498466=_0x2abdef['timers'][_0xc55541][_0x4daa('0x23')];var _0x5b3009=_0x2abdef[_0x4daa('0x6')][_0x498466]['acwTimeout'];logger['info'](_0x4daa('0x34'),_0x7a658,_0xc55541);RpcUser[_0x4daa('0x35')](this[_0x4daa('0x7')][_0xc55541]['id'])[_0x4daa('0x1f')](function(_0x589cb7){if(_0x589cb7[_0x4daa('0x36')]===_0x4daa('0x37')){return RpcUser['saveUnpause'](_0x2abdef[_0x4daa('0x7')][_0xc55541]);}});RpcVoiceAgentReport[_0x4daa('0x38')]({'acwtime':_0x5b3009,'agentacw':!![]},_0x7a658,_0xc55541)[_0x4daa('0x1f')](function(_0x32b3b6){logger[_0x4daa('0x28')](_0x4daa('0x39'),_0x7a658,_0x5b3009,_0x32b3b6);})[_0x4daa('0x3a')](function(_0x194655){logger['error'](_0x4daa('0x21'),_0x7a658,_0x194655);});}else{logger[_0x4daa('0x20')](_0x4daa('0x3b'),_0xc55541);if(_0x2abdef[_0x4daa('0x8')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x2abdef['timers']));}}}catch(_0x191d6e){logger[_0x4daa('0x20')](_0x4daa('0x3c'),_0x191d6e['message']);}};Acw[_0x4daa('0x1b')][_0x4daa('0xb')]=function(_0x3da45f){try{if(this[_0x4daa('0x6')][_0x3da45f[_0x4daa('0x23')]]&&(this[_0x4daa('0x6')][_0x3da45f[_0x4daa('0x23')]][_0x4daa('0x3')]||this[_0x4daa('0x6')][_0x3da45f[_0x4daa('0x23')]][_0x4daa('0x24')])){if(this['agents'][_0x3da45f['interface']]){this['channels'][_0x3da45f['uniqueid']]={'queue':_0x3da45f[_0x4daa('0x23')],'interface':_0x3da45f[_0x4daa('0x3d')],'destlinkedid':_0x3da45f[_0x4daa('0x3e')]};}}}catch(_0x44cd9f){logger[_0x4daa('0x20')](_0x4daa('0x3f'),_0x44cd9f[_0x4daa('0x33')]);}};Acw[_0x4daa('0x1b')][_0x4daa('0x18')]=function(_0x175673){try{if(this[_0x4daa('0x6')][_0x175673['queue']]&&(this[_0x4daa('0x6')][_0x175673[_0x4daa('0x23')]]['acw']||this[_0x4daa('0x6')][_0x175673[_0x4daa('0x23')]][_0x4daa('0x24')])){if(this['agents'][_0x175673[_0x4daa('0x3d')]]){this[_0x4daa('0x9')][_0x175673[_0x4daa('0x32')]]={'queue':_0x175673['queue'],'interface':_0x175673['interface']};}}}catch(_0x1fdc2a){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x1fdc2a[_0x4daa('0x33')]);}};Acw[_0x4daa('0x1b')][_0x4daa('0xd')]=function(_0x4bf14c){try{if(this['channels'][_0x4bf14c[_0x4daa('0x32')]]&&_[_0x4daa('0x40')](this['channels'][_0x4bf14c[_0x4daa('0x32')]][_0x4daa('0x41')])){logger[_0x4daa('0x28')](_0x4daa('0x42'),_0x4bf14c['uniqueid']);this['startAcw'](_0x4bf14c[_0x4daa('0x32')]);}else if(this['channels'][_0x4bf14c[_0x4daa('0x43')]]&&_[_0x4daa('0x40')](this[_0x4daa('0x9')][_0x4bf14c[_0x4daa('0x43')]][_0x4daa('0x41')])){logger['info'](_0x4daa('0x44'),_0x4bf14c[_0x4daa('0x43')]);this[_0x4daa('0x22')](_0x4bf14c['linkedid']);}}catch(_0x26f124){logger[_0x4daa('0x20')](_0x4daa('0x45'),_0x26f124[_0x4daa('0x33')]);}};Acw['prototype'][_0x4daa('0x10')]=function(_0x2022c4){try{if(this[_0x4daa('0x9')][_0x2022c4[_0x4daa('0x32')]]&&this[_0x4daa('0x9')][_0x2022c4[_0x4daa('0x32')]][_0x4daa('0x41')]){logger['info'](_0x4daa('0x46'),_0x2022c4[_0x4daa('0x32')]);this['startAcw'](_0x2022c4['uniqueid']);}else if(this[_0x4daa('0x9')][_0x2022c4[_0x4daa('0x43')]]&&this[_0x4daa('0x9')][_0x2022c4['linkedid']][_0x4daa('0x41')]){logger[_0x4daa('0x28')](_0x4daa('0x47'),_0x2022c4[_0x4daa('0x43')]);this[_0x4daa('0x22')](_0x2022c4[_0x4daa('0x43')]);}}catch(_0x11783e){logger[_0x4daa('0x20')]('[ACW][syncHangup]\x20%s',_0x11783e[_0x4daa('0x33')]);}};Acw[_0x4daa('0x1b')][_0x4daa('0x14')]=function(_0x368c10){try{if(!_[_0x4daa('0x48')](this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x49')]])){this[_0x4daa('0x22')](_0x368c10['transfereeuniqueid']);if(this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4a')]]){this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4a')]][_0x4daa('0x41')]=!![];this['channels'][_0x368c10[_0x4daa('0x4b')]]=this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4a')]];delete this['channels'][_0x368c10[_0x4daa('0x4a')]];}}else if(!_[_0x4daa('0x48')](this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4b')]])){this['startAcw'](_0x368c10['transfertargetuniqueid']);if(this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4c')]]){this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4c')]][_0x4daa('0x41')]=!![];this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x49')]]=this[_0x4daa('0x9')][_0x368c10[_0x4daa('0x4c')]];delete this[_0x4daa('0x9')][_0x368c10['origtransfereruniqueid']];}}}catch(_0x239fcc){logger[_0x4daa('0x20')](_0x4daa('0x4d'),_0x239fcc['message']);}};Acw[_0x4daa('0x1b')][_0x4daa('0x16')]=function(_0x47de9c){try{if(this[_0x4daa('0x9')][_0x47de9c[_0x4daa('0x4e')]]){logger[_0x4daa('0x28')](_0x4daa('0x4f'),JSON['stringify'](_0x47de9c[_0x4daa('0x4e')]));this[_0x4daa('0x22')](_0x47de9c[_0x4daa('0x4e')]);}else if(this['channels'][_0x47de9c[_0x4daa('0x50')]]){logger[_0x4daa('0x28')](_0x4daa('0x51'),JSON[_0x4daa('0x52')](_0x47de9c[_0x4daa('0x50')]));this['startAcw'](_0x47de9c['transfererlinkedid']);}}catch(_0x40e8d2){logger[_0x4daa('0x20')](_0x4daa('0x53'),_0x40e8d2[_0x4daa('0x33')]);}};Acw['prototype'][_0x4daa('0x12')]=function(_0x4b025c){try{if(this['voiceQueues'][_0x4b025c['queue']]&&this[_0x4daa('0x6')][_0x4b025c['queue']][_0x4daa('0x54')]===_0x4daa('0x55')){if(this[_0x4daa('0x7')][_0x4b025c[_0x4daa('0x3d')]]){logger[_0x4daa('0x28')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4b025c[_0x4daa('0x32')],_0x4b025c[_0x4daa('0x3d')],_0x4b025c[_0x4daa('0x23')]);return RpcUser[_0x4daa('0x56')](this[_0x4daa('0x7')][_0x4b025c['interface']],_0x4daa('0x57'),_0x4b025c['uniqueid']);}}}catch(_0x1866a7){logger[_0x4daa('0x20')](_0x4daa('0x58'),_0x1866a7[_0x4daa('0x33')]);}};module[_0x4daa('0x59')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 9fe4f59..e5e5410 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 _0xd8a7=['shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','[ami.js][fullybooted]','close','exports','util','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','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','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','once','connect'];(function(_0x38b64d,_0x25b5a9){var _0x18a3ce=function(_0x18182b){while(--_0x18182b){_0x38b64d['push'](_0x38b64d['shift']());}};_0x18a3ce(++_0x25b5a9);}(_0xd8a7,0x1b9));var _0x7d8a=function(_0x1db899,_0xf1a81d){_0x1db899=_0x1db899-0x0;var _0x989fa3=_0xd8a7[_0x1db899];return _0x989fa3;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0x7d8a('0x0'));var logger=require('../../config/logger')(_0x7d8a('0x1'));var config=require(_0x7d8a('0x2'));var ami=new Manager(config[_0x7d8a('0x3')][_0x7d8a('0x4')],config[_0x7d8a('0x3')]['ip'],config[_0x7d8a('0x3')][_0x7d8a('0x5')],config[_0x7d8a('0x3')][_0x7d8a('0x6')],!![]);ami[_0x7d8a('0x7')]();ami[_0x7d8a('0x8')]=BPromise[_0x7d8a('0x9')](ami[_0x7d8a('0xa')]);function error(_0x2d7c1c){logger[_0x7d8a('0xb')](util[_0x7d8a('0xc')](_0x7d8a('0xd'),config[_0x7d8a('0x3')][_0x7d8a('0x5')],config[_0x7d8a('0x3')]['ip'],config['asterisk']['port'],util[_0x7d8a('0xe')](_0x2d7c1c,![],null)));}function close(){logger[_0x7d8a('0xb')](util['format'](_0x7d8a('0xf'),config[_0x7d8a('0x3')]['username'],config[_0x7d8a('0x3')]['ip'],config[_0x7d8a('0x3')][_0x7d8a('0x4')]));}ami[_0x7d8a('0x10')]=function(){return function(){return ami[_0x7d8a('0x8')]({'action':_0x7d8a('0x11')});};};ami[_0x7d8a('0x12')]=function(){return function(){return ami['Action']({'action':_0x7d8a('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x7d8a('0x8')]({'action':_0x7d8a('0x14')});};};ami[_0x7d8a('0x15')]=function(){return function(){return ami[_0x7d8a('0x8')]({'action':'queuesummary'});};};ami[_0x7d8a('0x16')]=function(){return function(){return ami[_0x7d8a('0x8')]({'action':_0x7d8a('0x17')});};};function connect(){logger[_0x7d8a('0x18')](util[_0x7d8a('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x7d8a('0x3')][_0x7d8a('0x5')],config['asterisk']['ip'],config[_0x7d8a('0x3')][_0x7d8a('0x4')]));ami[_0x7d8a('0x19')](_0x7d8a('0xb'),error);ami[_0x7d8a('0x19')]('close',close);}ami['on'](_0x7d8a('0x1a'),connect);ami['on'](_0x7d8a('0x1b'),function(_0x199566){logger[_0x7d8a('0x18')](util[_0x7d8a('0xc')](_0x7d8a('0x1c'),config['asterisk']['username'],config[_0x7d8a('0x3')]['ip'],config[_0x7d8a('0x3')][_0x7d8a('0x4')],util[_0x7d8a('0xe')](_0x199566,![],null)));});ami['on']('fullybooted',function(){logger[_0x7d8a('0x18')](util[_0x7d8a('0xc')](_0x7d8a('0x1d'),config[_0x7d8a('0x3')]['username'],config[_0x7d8a('0x3')]['ip'],config[_0x7d8a('0x3')]['port']));return Promise[_0x7d8a('0x1e')]()[_0x7d8a('0x1f')](ami[_0x7d8a('0x10')]())[_0x7d8a('0x1f')](ami[_0x7d8a('0x12')]())[_0x7d8a('0x1f')](ami[_0x7d8a('0x20')]())['then'](ami[_0x7d8a('0x15')]())[_0x7d8a('0x1f')](ami[_0x7d8a('0x16')]())['catch'](function(_0x49495b){logger['error'](_0x7d8a('0x21'),util[_0x7d8a('0xe')](_0x49495b,{'showHidden':![],'depth':null}));});});ami['once'](_0x7d8a('0xb'),error);ami[_0x7d8a('0x19')](_0x7d8a('0x22'),close);module[_0x7d8a('0x23')]=ami; \ No newline at end of file +var _0x4fc2=['fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','bluebird','util','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','info','format','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','inspect'];(function(_0x53ec7a,_0x2c1f7e){var _0x3a1407=function(_0x1a5934){while(--_0x1a5934){_0x53ec7a['push'](_0x53ec7a['shift']());}};_0x3a1407(++_0x2c1f7e);}(_0x4fc2,0x1cd));var _0x24fc=function(_0x37091d,_0x2fa386){_0x37091d=_0x37091d-0x0;var _0x460173=_0x4fc2[_0x37091d];return _0x460173;};'use strict';var Manager=require(_0x24fc('0x0'));var BPromise=require(_0x24fc('0x1'));var util=require(_0x24fc('0x2'));var logger=require('../../config/logger')(_0x24fc('0x3'));var config=require(_0x24fc('0x4'));var ami=new Manager(config[_0x24fc('0x5')][_0x24fc('0x6')],config[_0x24fc('0x5')]['ip'],config['asterisk'][_0x24fc('0x7')],config[_0x24fc('0x5')]['password'],!![]);ami[_0x24fc('0x8')]();ami[_0x24fc('0x9')]=BPromise[_0x24fc('0xa')](ami['action']);function error(_0x1c45f8){logger[_0x24fc('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x24fc('0x5')]['username'],config['asterisk']['ip'],config['asterisk'][_0x24fc('0x6')],util['inspect'](_0x1c45f8,![],null)));}function close(){logger[_0x24fc('0xb')](util['format'](_0x24fc('0xc'),config[_0x24fc('0x5')][_0x24fc('0x7')],config[_0x24fc('0x5')]['ip'],config[_0x24fc('0x5')][_0x24fc('0x6')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x24fc('0x9')]({'action':_0x24fc('0xd')});};};ami[_0x24fc('0xe')]=function(){return function(){return ami[_0x24fc('0x9')]({'action':_0x24fc('0xf')});};};ami[_0x24fc('0x10')]=function(){return function(){return ami['Action']({'action':_0x24fc('0x11')});};};ami[_0x24fc('0x12')]=function(){return function(){return ami[_0x24fc('0x9')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x24fc('0x9')]({'action':_0x24fc('0x13')});};};function connect(){logger[_0x24fc('0x14')](util[_0x24fc('0x15')](_0x24fc('0x16'),config[_0x24fc('0x5')][_0x24fc('0x7')],config[_0x24fc('0x5')]['ip'],config[_0x24fc('0x5')]['port']));ami[_0x24fc('0x17')]('error',error);ami[_0x24fc('0x17')](_0x24fc('0x18'),close);}ami['on'](_0x24fc('0x19'),connect);ami['on'](_0x24fc('0x1a'),function(_0x2bbd47){logger['info'](util[_0x24fc('0x15')](_0x24fc('0x1b'),config[_0x24fc('0x5')][_0x24fc('0x7')],config[_0x24fc('0x5')]['ip'],config[_0x24fc('0x5')][_0x24fc('0x6')],util[_0x24fc('0x1c')](_0x2bbd47,![],null)));});ami['on'](_0x24fc('0x1d'),function(){logger['info'](util[_0x24fc('0x15')](_0x24fc('0x1e'),config[_0x24fc('0x5')][_0x24fc('0x7')],config[_0x24fc('0x5')]['ip'],config[_0x24fc('0x5')][_0x24fc('0x6')]));return Promise[_0x24fc('0x1f')]()[_0x24fc('0x20')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())['then'](ami[_0x24fc('0x10')]())[_0x24fc('0x20')](ami[_0x24fc('0x12')]())[_0x24fc('0x20')](ami[_0x24fc('0x21')]())['catch'](function(_0x122d7c){logger[_0x24fc('0xb')](_0x24fc('0x22'),util[_0x24fc('0x1c')](_0x122d7c,{'showHidden':![],'depth':null}));});});ami[_0x24fc('0x17')](_0x24fc('0xb'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 489ca05..6fd6bc6 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 _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x53360d,_0x1f2dc4){var _0x5b86f7=function(_0x4fe27f){while(--_0x4fe27f){_0x53360d['push'](_0x53360d['shift']());}};_0x5b86f7(++_0x1f2dc4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x358347,_0x56e86b){_0x358347=_0x358347-0x0;var _0x13e7c4=_0xf4eb[_0x358347];return _0x13e7c4;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0xac4a,0x13f));var _0xaac4=function(_0x31ce0c,_0x21ad1f){_0x31ce0c=_0x31ce0c-0x0;var _0x38e55b=_0xac4a[_0x31ce0c];return _0x38e55b;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 58e55ef..9267dfd 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 _0x2834=['getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','AMD','buildObj','amd','saveInDb','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','membername','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','[syncHangupIvr]','[syncHangupIvr][createHistory]','cause-txt','syncQueueSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','throttle','filter','dialPreviewRecallmeReminder','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','NONE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','avgHandleTime','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(','predictiveIntervalHitRate','dropRate','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','getSeconds','scheduledat','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','countReScheduled','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','127.0.0.1','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','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','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','message','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','timezones','UNKNOWN_TIMEZONE','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','catch','push','true','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','syncCampaigns','undefined','checkIfTime','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','predictive','progressive','handlePower','power','method\x20not\x20recognized','silly','Dialer::ifTime()','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedMaxRetry','queueCallerAbandonCreateState','add','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','run','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','preview','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncOriginateResponse'];(function(_0x146183,_0x16c177){var _0x38255d=function(_0x33246c){while(--_0x33246c){_0x146183['push'](_0x146183['shift']());}};_0x38255d(++_0x16c177);}(_0x2834,0x111));var _0x4283=function(_0x27b7af,_0x37b718){_0x27b7af=_0x27b7af-0x0;var _0x5c8040=_0x2834[_0x27b7af];return _0x5c8040;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0x4283('0x0'));var moment=require(_0x4283('0x1'));var rr=require('rr');var Redis=require(_0x4283('0x2'));var utils=require(_0x4283('0x3'));var hopperUtils=require('./utils/hopper');var ut=require(_0x4283('0x4'));var config=require('../../../config/environment/');var logger=require(_0x4283('0x5'))(_0x4283('0x6'));var loggerBooked=require('../../../config/logger')(_0x4283('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x4283('0x5'))(_0x4283('0x8'));var loggerSyncQueueSummary=require(_0x4283('0x5'))('syncQueueSummary');var ami=require(_0x4283('0x9'));config['redis']=_[_0x4283('0xa')](config[_0x4283('0xb')],{'host':_0x4283('0xc'),'port':0x18eb});var io=require(_0x4283('0xd'))(new Redis(config[_0x4283('0xb')]));var cmHopper=require(_0x4283('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x4283('0xf'));var Interval=require(_0x4283('0x10'));var Action=require(_0x4283('0x11'));var History=require(_0x4283('0x12'));var Final=require(_0x4283('0x13'));var AgentComplete=require(_0x4283('0x14'));var QueueCallerAbandon=require(_0x4283('0x15'));var Hangup=require(_0x4283('0x16'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x4283('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4283('0x18')][_0x4283('0x19')]=function(_0x5d40d4){this[_0x4283('0x1a')]=this[_0x4283('0x1a')]?this[_0x4283('0x1a')][_0x4283('0x1b')](_0x5d40d4):_0x5d40d4();};function Dialer(_0x5d0209,_0xdc7b71){this[_0x4283('0x1c')]=new Sequence();this['preview']=_0xdc7b71;this[_0x4283('0x1d')]=_0x5d0209[_0x4283('0x1d')];this[_0x4283('0x1e')]=_0x5d0209['campaigns'];this[_0x4283('0x1f')]=_0x5d0209[_0x4283('0x1f')];this[_0x4283('0x20')]=_0x5d0209[_0x4283('0x20')];this[_0x4283('0x21')]=config['maxNumberOriginate']||0x2;this[_0x4283('0x22')]={};this[_0x4283('0x23')]={};this[_0x4283('0x24')]={};this[_0x4283('0x25')]={};this[_0x4283('0x26')]={};this['startPredictive']={};this[_0x4283('0x27')]={};this['ivrOriginated']={};this[_0x4283('0x28')]={};this[_0x4283('0x29')]={};this[_0x4283('0x2a')]={};ami['on'](_0x4283('0x2b'),this['syncAgentConnect'][_0x4283('0x2c')](this));ami['on']('queuecallerabandon',this[_0x4283('0x2d')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x4283('0x2c')](this));ami['on'](_0x4283('0x2e'),this[_0x4283('0x2f')][_0x4283('0x2c')](this));ami['on'](_0x4283('0x30'),this['syncQueueSummary']['bind'](this));ami['on'](_0x4283('0x31'),this['syncQueueSummaryComplete'][_0x4283('0x2c')](this));ami['on'](_0x4283('0x32'),this[_0x4283('0x33')][_0x4283('0x2c')](this));ami['on'](_0x4283('0x34'),this[_0x4283('0x35')][_0x4283('0x2c')](this));ami['on']('varset',this['syncVarSet'][_0x4283('0x2c')](this));ami['on']('queuemember',this[_0x4283('0x36')][_0x4283('0x2c')](this));ami['on'](_0x4283('0x37'),this[_0x4283('0x38')][_0x4283('0x2c')](this));this[_0x4283('0x39')]();this[_0x4283('0x3a')]();RpcSetting['getSettings']()[_0x4283('0x3b')](function(_0xfc892a){previewRecallmeReminderInterval=_0xfc892a[_0x4283('0x3c')];});}function isNotNull(_0x8f6ad6){return _0x8f6ad6!==null&&!_[_0x4283('0x3d')](_0x8f6ad6);}function msgResponse(_0x9bc022,_0xe93fab,_0x2e0a2c){return{'action':_0x9bc022,'response':_0xe93fab,'message':_0x2e0a2c,'stack':_0x2e0a2c};}function emit(_0x1b7361,_0xe69a9d,_0x3625a5){io['to'](_0x1b7361)[_0x4283('0x3e')](_0xe69a9d,_0x3625a5);}function emitOutboundVoiceQueueSummary(_0x3fbde2){if(_0x3fbde2[_0x4283('0x3f')]===_0x4283('0x40')){logger[_0x4283('0x41')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x4283('0x42')](_0x3fbde2,{'showHidden':![],'depth':null}));emit(util[_0x4283('0x43')](_0x4283('0x44'),_0x3fbde2[_0x4283('0x45')]),_0x4283('0x46'),_0x3fbde2);}}function checkGetDataPredictive(_0x5db939){if(isNotNull(_0x5db939)&&!_[_0x4283('0x47')](_0x5db939)){loggerPredictive[_0x4283('0x48')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x4283('0x48')](_0x4283('0x49'),_0x5db939[_0x4283('0x4a')]);loggerPredictive[_0x4283('0x48')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5db939[_0x4283('0x4b')]);loggerPredictive[_0x4283('0x48')](_0x4283('0x4c'),_0x5db939[_0x4283('0x4d')]);loggerPredictive[_0x4283('0x48')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5db939[_0x4283('0x4e')]);loggerPredictive[_0x4283('0x48')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5db939['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x4283('0x48')](_0x4283('0x4f'),_0x5db939[_0x4283('0x50')]);loggerPredictive[_0x4283('0x48')](_0x4283('0x51'));if(_0x5db939[_0x4283('0x4a')]>0x0){if(!_['isUndefined'](_0x5db939['predictiveIntervalAvgTalktime'])&&_0x5db939['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x4283('0x48')](_0x4283('0x52'));if(!_[_0x4283('0x3d')](_0x5db939[_0x4283('0x53')])&&_0x5db939[_0x4283('0x53')]>0x0){return!![];}loggerPredictive[_0x4283('0x48')](_0x4283('0x54'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x4283('0x48')](_0x4283('0x55'));}return![];}function mergeDataErlangB(_0x42f11f){return function(_0xcca9){loggerPredictive[_0x4283('0x48')](_0x4283('0x56'));loggerPredictive['info'](_0x4283('0x57'),_0xcca9[_0x4283('0x58')]);loggerPredictive[_0x4283('0x48')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcca9[_0x4283('0x59')]);loggerPredictive[_0x4283('0x48')](_0x4283('0x5a'),_0xcca9[_0x4283('0x5b')]);loggerPredictive[_0x4283('0x48')](_0x4283('0x5c'),_0xcca9[_0x4283('0x5d')]);loggerPredictive['info'](_0x4283('0x5a'),_0xcca9[_0x4283('0x5b')]);loggerPredictive[_0x4283('0x48')](_0x4283('0x51'));_[_0x4283('0x5e')](_0x42f11f,_0xcca9);};}function ifInterval(_0x2a71fb,_0x17f359){if(_[_0x4283('0x3d')](_0x17f359)){return![];}return utils['getSeconds'](undefined,_0x17f359)<_0x2a71fb*0x3c;}function clearPredictiveAttributes(_0xf07ce0){if(_0xf07ce0[_0x4283('0x27')]){_0xf07ce0['startProgressive']=undefined;loggerPredictive[_0x4283('0x41')](_0xf07ce0[_0x4283('0x45')],_0x4283('0x5f'));}if(_0xf07ce0[_0x4283('0x60')]){_0xf07ce0['startPredictive']=undefined;loggerPredictive[_0x4283('0x41')](_0xf07ce0[_0x4283('0x45')],_0x4283('0x61'));}if(_0xf07ce0[_0x4283('0x62')]){clearInterval(_0xf07ce0['handlePredictive']);_0xf07ce0['handlePredictive']=undefined;loggerPredictive[_0x4283('0x41')](_0xf07ce0['name'],_0x4283('0x63'));}}function loggerCatchPredictive(_0x52e468,_0xe4429d){return function(_0x36cb66){loggerPredictive[_0x4283('0x64')](_0xe4429d['name'],_0x52e468);loggerPredictive[_0x4283('0x64')](_0x36cb66[_0x4283('0x65')]);clearPredictiveAttributes(_0xe4429d);};}function loggerCatch(_0x5bc639){return function(_0x5dd177){logger[_0x4283('0x64')](_0x5bc639,util['inspect'](_0x5dd177,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3dd582,_0xfe5007,_0x53f5a6){return function(_0x3d7f2a){utils[_0x4283('0x66')](_0xfe5007,_0x53f5a6,0x0);_0xfe5007['temp']=0x0;logger['error'](_0x3dd582,util[_0x4283('0x42')](_0x3d7f2a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1abc53){return function(_0x52c726){if(isNotNull(_0x52c726)&&isNotNull(_0x52c726[0x0])){if(_0x52c726[0x0]['contactsRescheduled']>0x0){_0x1abc53[_0x4283('0x67')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger['info'](_0x4283('0x68')+_0x1abc53[_0x4283('0x45')],_0x52c726[0x0][_0x4283('0x69')],_0x4283('0x6a'));}else{_0x1abc53[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x6c')];logger[_0x4283('0x48')](_0x4283('0x6d')+_0x1abc53[_0x4283('0x45')]);}}};}function createObjHistory(_0x3d899d,_0x483a1e,_0x375115,_0x160474,_0x23a1d3){_0x3d899d[_0x4283('0x67')]=_0x375115;var _0x365732=new Action(_0x3d899d,_0x483a1e);var _0x234e0a=new History(_0x365732);_0x234e0a[_0x4283('0x6e')]=_0x160474;_0x234e0a[_0x4283('0x6f')]=_0x23a1d3;_0x234e0a[_0x4283('0x70')]=_0x365732[_0x4283('0x71')];return _0x234e0a;}function unlockQueueStatus(_0x647920,_0x45231f){setTimeout(function(){if(_[_0x4283('0x3d')](_0x647920[_0x4283('0x72')])){loggerBooked[_0x4283('0x64')]('[unlockQueueStatus][undefined]',_0x45231f);}_0x647920[_0x4283('0x72')]=!![];loggerBooked[_0x4283('0x48')](_0x4283('0x73'),_0x45231f,JSON[_0x4283('0x74')](_[_0x4283('0x75')](_0x647920,[_0x4283('0x45'),_0x4283('0x72')])));},0x1f3);}function checkInterval(_0x5b2ce8){return function(){if(!isNotNull(_0x5b2ce8[_0x4283('0x76')])){_0x5b2ce8[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x77')];throw _0x5b2ce8['name']+_0x4283('0x78');}if(!isNotNull(_0x5b2ce8[_0x4283('0x76')][_0x4283('0x79')])){_0x5b2ce8[_0x4283('0x67')]=utils['CAMPAIGN_STATUS'][_0x4283('0x77')];throw _0x5b2ce8[_0x4283('0x45')]+_0x4283('0x78');}if(!isNotNull(_[_0x4283('0x47')](_0x5b2ce8[_0x4283('0x76')][_0x4283('0x79')]))){_0x5b2ce8[_0x4283('0x67')]=utils['CAMPAIGN_STATUS'][_0x4283('0x77')];throw _0x5b2ce8['name']+_0x4283('0x78');}};}function checkIsIVRCampaignActive(_0x2b24c1){return function(){if(!utils[_0x4283('0x7a')](_0x2b24c1)){_0x2b24c1[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x7b')];throw _0x2b24c1[_0x4283('0x45')]+_0x4283('0x7c');}};}function emitCampaignSummary(_0x4b7431){if(utils[_0x4283('0x7d')](_0x4b7431)){emit(util[_0x4283('0x43')]('campaign:ivr:%s',_0x4b7431[_0x4283('0x45')]),_0x4283('0x7e'),_0x4b7431);}}function loggerCatchQueueSummary(_0x188a4f,_0x2dc61a){return function(_0x336182){clearPredictiveAttributes(_0x2dc61a);emitCampaignSummary(_0x2dc61a);loggerSyncQueueSummary['debug'](_0x188a4f,util[_0x4283('0x42')](_0x336182,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x18c9e2){if(_0x18c9e2[_0x4283('0x7f')]){if(_0x18c9e2[_0x4283('0x80')]===0x0){_0x18c9e2[_0x4283('0x7f')]=![];_0x18c9e2[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x7b')];loggerSyncQueueSummary[_0x4283('0x41')](_0x4283('0x81'),_0x18c9e2[_0x4283('0x45')],'is\x20not\x20active');}else{_0x18c9e2['message']=utils[_0x4283('0x6b')][_0x4283('0x82')];loggerSyncQueueSummary[_0x4283('0x41')](_0x4283('0x81'),_0x18c9e2['name'],_0x4283('0x83'));}emitCampaignSummary(_0x18c9e2);}}function myreject(_0x576329){return function(_0xb14517){return _0x576329(msgResponse(_0x4283('0x84'),_0x4283('0x85'),JSON[_0x4283('0x74')](_0xb14517)));};}Dialer['prototype'][_0x4283('0x86')]=function(_0x8e295){return!_[_0x4283('0x3d')](_0x8e295)&&_0x8e295&&!_[_0x4283('0x3d')](_0x8e295[_0x4283('0x45')])&&!_['isUndefined'](_0x8e295['active'])&&_0x8e295[_0x4283('0x87')]&&(this[_0x4283('0x20')][util[_0x4283('0x43')]('SIP/%s',_0x8e295[_0x4283('0x45')])][_0x4283('0x88')]===_0x4283('0x89')||this['trunks'][util[_0x4283('0x43')](_0x4283('0x8a'),_0x8e295[_0x4283('0x45')])][_0x4283('0x88')]===_0x4283('0x8b'));};Dialer[_0x4283('0x18')][_0x4283('0x8c')]=function(_0x2bdfbf){var _0x3ba9d2=this;return function(){if(!_0x3ba9d2[_0x4283('0x86')](_0x2bdfbf[_0x4283('0x8d')])){if(!_0x3ba9d2[_0x4283('0x86')](_0x2bdfbf[_0x4283('0x8e')])){_0x2bdfbf[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x8f')];throw _0x2bdfbf[_0x4283('0x45')]+_0x4283('0x90');}}};};Dialer[_0x4283('0x18')]['checkIfTime']=function(_0x2185a4,_0x480f0a,_0x68b7a0,_0x2cd2f4){var _0x53c3a6=this;return function(){var _0x18a65b=!![];return _0x53c3a6[_0x4283('0x91')](_0x2185a4,_0x480f0a,_0x68b7a0,_0x2cd2f4,_0x18a65b);};};Dialer[_0x4283('0x18')][_0x4283('0x92')]=function(_0xd15233,_0x34a96e,_0x51354a,_0x320b76){var _0x34fda9=this;return function(){var _0x33dfbc=![];return _0x34fda9['ifTimeIvr'](_0xd15233[_0x4283('0x79')],_0x34a96e,_0x51354a,_0x320b76,_0x33dfbc);};};Dialer['prototype'][_0x4283('0x91')]=function(_0x172707,_0x38f129,_0x3dcffe,_0x429dea,_0x21442b){var _0x1bfdea=[];return new Promise(function(_0xeef5d1,_0x236ab4){if(!isNotNull(_0x172707)){_0x429dea[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x77')];return _0x236ab4(msgResponse('ifTime',_0x4283('0x93'),_0x3dcffe+_0x4283('0x94')));}if(_[_0x4283('0x47')](_0x172707)){_0x429dea[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x95')];return _0x236ab4(msgResponse(_0x4283('0x96'),_0x4283('0x93'),_0x3dcffe+'\x20Intervals\x20is\x20empty\x20'));}if(_0x38f129&&_[_0x4283('0x3d')](config[_0x4283('0x97')][_0x38f129])){_0x429dea['message']=utils[_0x4283('0x6b')][_0x4283('0x98')];return _0x236ab4(msgResponse(_0x4283('0x96'),_0x4283('0x93'),_0x3dcffe+'\x20Timezone\x20unknow\x20'+_0x38f129));}if(_[_0x4283('0x99')](_0x172707)){for(var _0x115fb2=0x0;_0x115fb2<_0x172707['length'];_0x115fb2+=0x1){_0x1bfdea['push'](ami[_0x4283('0x9a')]({'action':_0x4283('0x9b'),'command':util[_0x4283('0x43')](_0x4283('0x9c'),_0x172707[_0x115fb2][_0x4283('0x9d')],!_[_0x4283('0x3d')](config['timezones'][_0x38f129])?_0x38f129:'')})[_0x4283('0x3b')](function(_0x1645ca){return _0x1645ca[_0x4283('0x9e')][_0x4283('0x9f')]('true')>=0x0;})[_0x4283('0xa0')](myreject(_0x236ab4)));}}else{_0x1bfdea[_0x4283('0xa1')](ami[_0x4283('0x9a')]({'action':_0x4283('0x9b'),'command':util[_0x4283('0x43')](_0x4283('0x9c'),_0x172707,!_[_0x4283('0x3d')](config['timezones'][_0x38f129])?_0x38f129:'')})['then'](function(_0x89f4ab){return _0x89f4ab[_0x4283('0x9e')]['indexOf'](_0x4283('0xa2'))>=0x0;})[_0x4283('0xa0')](myreject(_0x236ab4)));}Promise[_0x4283('0xa3')](_0x1bfdea)['then'](function(_0x4c3b43){var _0x2a83d9=_[_0x4283('0xa4')](_0x4c3b43);if(_0x2a83d9){return _0xeef5d1(_0x2a83d9);}else{_0x429dea['message']=_0x21442b?utils[_0x4283('0x6b')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x4283('0xa5')];return _0x236ab4(msgResponse(_0x4283('0xa6'),_0x4283('0x93'),_0x4283('0xa7')+_0x21442b+'\x20'+_0x3dcffe+_0x4283('0xa8')+util[_0x4283('0x42')](_0x172707,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x38f129));}})[_0x4283('0xa0')](function(_0x5983e7){return _0x236ab4(msgResponse(_0x4283('0x96'),_0x4283('0x93'),JSON[_0x4283('0x74')](_0x5983e7)));});});};Dialer[_0x4283('0x18')][_0x4283('0x39')]=function(){var _0x4846e5=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x4846e5[_0x4283('0xa9')]();},0x3e8);});};Dialer[_0x4283('0x18')][_0x4283('0xa9')]=function(){var _0x4a2799=this;var _0x484cb0;for(var _0x6ba747 in this[_0x4283('0x1e')]){if(typeof this[_0x4283('0x1e')][_0x6ba747]!==_0x4283('0xaa')){_0x484cb0=this[_0x4283('0x1e')][_0x6ba747];if(utils[_0x4283('0x7d')](_0x484cb0)&&utils[_0x4283('0x7a')](_0x484cb0)){_0x484cb0[_0x4283('0x7f')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x484cb0))[_0x4283('0x3b')](checkInterval(_0x484cb0))[_0x4283('0x3b')](_0x4a2799[_0x4283('0x8c')](_0x484cb0))[_0x4283('0x3b')](_0x4a2799[_0x4283('0xab')](_0x484cb0['dialGlobalInterval'],_0x484cb0[_0x4283('0xac')],_0x484cb0[_0x4283('0x45')],_0x484cb0))[_0x4283('0x3b')](_0x4a2799['checkIfTimeIntervals'](_0x484cb0[_0x4283('0x76')],_0x484cb0[_0x4283('0xac')],_0x484cb0[_0x4283('0x45')],_0x484cb0))[_0x4283('0x3b')](_0x4a2799['launchHandleIvr'](_0x484cb0))[_0x4283('0xa0')](loggerCatchQueueSummary(_0x4283('0xad'),_0x484cb0));}else{notSendMessagesCampaign(_0x484cb0);}}}};Dialer['prototype'][_0x4283('0xae')]=function(_0x23d254){if(_0x23d254[_0x4283('0xaf')]!==_0x4283('0xb0')){clearPredictiveAttributes(_0x23d254);}switch(_0x23d254[_0x4283('0xaf')]){case _0x4283('0xb1'):this[_0x4283('0xb2')](_0x23d254,0x1);break;case _0x4283('0xb3'):this[_0x4283('0xb2')](_0x23d254,_0x23d254['dialPowerLevel']);break;case _0x4283('0xb0'):this[_0x4283('0xb0')](_0x23d254);break;case _0x4283('0x7'):this['handlePower'](_0x23d254,0x1);break;default:logger[_0x4283('0x64')]('Queue',_0x23d254[_0x4283('0x45')],_0x4283('0xb4'));}};Dialer['prototype'][_0x4283('0x96')]=function(_0x40e088,_0x56d30a){var _0x26b230=_0x40e088[_0x4283('0xac')];var _0x36b53c=_0x56d30a?_0x40e088['dialGlobalInterval']:_0x40e088[_0x4283('0x76')]['Intervals'];logger[_0x4283('0xb5')](_0x4283('0xb6'),_0x36b53c,_0x26b230,_0x40e088[_0x4283('0x45')],util[_0x4283('0x43')]('Voice\x20Queue\x20%s\x20$s',_0x40e088[_0x4283('0x45')],_0x40e088['id']));var _0xefdadd=null;return Interval[_0x4283('0xb7')](_0x36b53c,_0x26b230)[_0x4283('0x3b')](function(_0x342534){if(_0x342534===!![]){return _0x342534;}else{_0x40e088['message']=_0x56d30a?utils[_0x4283('0x6b')][_0x4283('0xb8')]:utils['CAMPAIGN_STATUS'][_0x4283('0xa5')];_0xefdadd=msgResponse('[ifTime][promiseAll]',_0x4283('0x93'),_0x4283('0xa7')+_0x56d30a+'\x20'+_0x40e088[_0x4283('0x45')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x4283('0x42')](_0x36b53c,{'showHidden':![],'depth':null})+_0x4283('0xb9')+_0x26b230);}if(_0xefdadd!==null){logger[_0x4283('0xb5')](_0x4283('0xba'),_0xefdadd);_0xefdadd[_0x4283('0xbb')]=_0x56d30a;throw _0xefdadd;}})['catch'](function(_0x5eed82){logger[_0x4283('0x64')](_0x4283('0xbc'),_0x5eed82);throw msgResponse(_0x4283('0x84'),_0x4283('0x85'),util['inspect'](_0x5eed82,{'showHidden':![],'depth':null}));});};Dialer[_0x4283('0x18')][_0x4283('0xbd')]=function(_0x5dc1ed){if(this['voiceQueues'][_0x5dc1ed[_0x4283('0xbe')]]){if(this[_0x4283('0x25')][_0x5dc1ed[_0x4283('0xbf')]]&&this[_0x4283('0x25')][_0x5dc1ed[_0x4283('0xbf')]]['type']!==_0x4283('0xc0')){this[_0x4283('0xc1')](this[_0x4283('0x1d')][_0x5dc1ed['queue']]);this[_0x4283('0x25')][_0x5dc1ed[_0x4283('0xbf')]][_0x4283('0xc2')]=moment()['format'](_0x4283('0xc3'));}}};Dialer[_0x4283('0x18')][_0x4283('0x2f')]=function(_0x189058){var _0x38c9a2=this['uniqueId'][_0x189058[_0x4283('0xbf')]];if(this[_0x4283('0x1d')][_0x189058[_0x4283('0xbe')]]){if(_0x38c9a2&&_0x38c9a2[_0x4283('0x3f')]!==_0x4283('0xc0')){delete this[_0x4283('0x25')][_0x189058[_0x4283('0xbf')]];this['voiceQueues'][_0x189058[_0x4283('0xbe')]][_0x4283('0xc4')]+=0x1;var _0x594857=new AgentComplete(_0x38c9a2,_0x189058);if(_0x189058[_0x4283('0xc5')]===_0x4283('0xc6')){_0x594857['agiafterat']=this['voiceQueues'][_0x189058['queue']][_0x4283('0xc7')]&&this[_0x4283('0x1d')][_0x189058['queue']][_0x4283('0xc8')]?moment()[_0x4283('0x43')](_0x4283('0xc3')):undefined;}hopperUtils[_0x4283('0xc9')](_0x594857)[_0x4283('0xa0')](loggerCatch(_0x4283('0xca')));hopperUtils[_0x4283('0xcb')](_0x594857)[_0x4283('0xa0')](loggerCatch(_0x4283('0xcc')));}}};Dialer[_0x4283('0x18')]['syncQueueCallerAbandon']=function(_0x498ad9){var _0x63319b=this['uniqueId'][_0x498ad9['uniqueid']];var _0x1f2115=this;var _0x63056d=![];var _0x3a3793;var _0x35635d;if(this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]]){if(_0x63319b&&_0x63319b[_0x4283('0x3f')]!==_0x4283('0xc0')){delete this[_0x4283('0x25')][_0x498ad9['uniqueid']];this[_0x4283('0xc1')](this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]]);_0x63319b[_0x4283('0xcd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2a158d=new QueueCallerAbandon(_0x63319b,_0x498ad9);if(utils['getSeconds'](_0x63319b[_0x4283('0xcd')],_0x63319b[_0x4283('0xce')])>=_0x63319b[_0x4283('0xcf')]){this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]][_0x4283('0x4d')]+=0x1;this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x498ad9[_0x4283('0xbe')]][_0x4283('0xd0')]+=0x1;_0x2a158d[_0x4283('0x6e')]=0xa;_0x2a158d[_0x4283('0x6f')]='Drop';_0x2a158d[_0x4283('0xd1')]=_0x4283('0xd2');_0x2a158d[_0x4283('0xd3')]=this[_0x4283('0x1d')][_0x498ad9['queue']][_0x4283('0xc7')]?moment()['format'](_0x4283('0xc3')):undefined;_0x2a158d[_0x4283('0xd4')]+=0x1;_0x2a158d[_0x4283('0xd5')]+=0x1;_0x3a3793=this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]][_0x4283('0xd6')];_0x35635d=this['voiceQueues'][_0x498ad9[_0x4283('0xbe')]][_0x4283('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x2a158d,_0x2a158d[_0x4283('0x6e')],_0x63319b[_0x4283('0xd8')])[_0x4283('0x3b')](function(_0x9d58e3){_0x63056d=_0x9d58e3[_0x4283('0xd9')]==0x1;if(_0x2a158d['countdropretry']>=_0x1f2115['voiceQueues'][_0x498ad9['queue']]['dialDropMaxRetry']){_0x1f2115['queueCallerAbandonCreateState'](_0x2a158d,_0x9d58e3[_0x4283('0xd9')]);}else{hopperUtils[_0x4283('0xda')]({'active':![],'countdropretry':_0x2a158d['countdropretry'],'scheduledat':moment()['add'](_0x1f2115[_0x4283('0x1d')][_0x498ad9['queue']]['dialDropRetryFrequency'],'minutes')[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0x63319b[_0x4283('0xdb')],'ListId':_0x63319b[_0x4283('0xdc')],'VoiceQueueId':_0x63319b[_0x4283('0xdd')]||undefined,'CampaignId':_0x63319b[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0xdf')));var _0xe453ec=new History(_0x2a158d);_0xe453ec[_0x4283('0x6e')]=0xa;_0xe453ec[_0x4283('0x6f')]='Drop';_0xe453ec[_0x4283('0x71')]=moment()[_0x4283('0x43')](_0x4283('0xc3'));_0xe453ec[_0x4283('0x70')]=_0xe453ec[_0x4283('0x71')];_0xe453ec['calleridname']=_0x2a158d[_0x4283('0xe0')];_0xe453ec[_0x4283('0xe1')]=_0x2a158d['calleridnum'];hopperUtils[_0x4283('0xc9')](_0xe453ec)[_0x4283('0xa0')](loggerCatch(_0x4283('0xe2')));}})[_0x4283('0x3b')](function(){if(_0x63056d)hopperUtils[_0x4283('0xe3')](_0x2a158d,_0x3a3793,_0x35635d)[_0x4283('0x3b')](function(){return 0x1;});});}else{this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]][_0x4283('0x4e')]+=0x1;this[_0x4283('0x1d')][_0x498ad9['queue']][_0x4283('0xe4')]+=0x1;_0x2a158d['state']=0xb;_0x2a158d['statedesc']=_0x4283('0xe5');_0x2a158d[_0x4283('0xd1')]='CALLEREXIT';_0x2a158d[_0x4283('0xe6')]+=0x1;_0x2a158d[_0x4283('0xd5')]+=0x1;_0x3a3793=this['voiceQueues'][_0x498ad9[_0x4283('0xbe')]]['dialAbandonedRetryFrequency'];_0x35635d=this[_0x4283('0x1d')][_0x498ad9[_0x4283('0xbe')]][_0x4283('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x2a158d,_0x2a158d[_0x4283('0x6e')],_0x63319b[_0x4283('0xd8')])[_0x4283('0x3b')](function(_0x2880cd){if(_0x2a158d[_0x4283('0xe6')]>=_0x1f2115['voiceQueues'][_0x498ad9['queue']][_0x4283('0xe7')]){_0x1f2115[_0x4283('0xe8')](_0x2a158d,_0x2880cd[_0x4283('0xd9')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x2a158d[_0x4283('0xe6')],'scheduledat':moment()[_0x4283('0xe9')](_0x1f2115['voiceQueues'][_0x498ad9[_0x4283('0xbe')]][_0x4283('0xea')],_0x4283('0xeb'))[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0x63319b['ContactId'],'ListId':_0x63319b[_0x4283('0xdc')],'VoiceQueueId':_0x63319b['VoiceQueueId']||undefined,'CampaignId':_0x63319b['CampaignId']||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0xec')));var _0x2b59e2=new History(_0x2a158d);_0x2b59e2[_0x4283('0x6e')]=0xb;_0x2b59e2['statedesc']='Abandoned';_0x2b59e2['starttime']=moment()[_0x4283('0x43')](_0x4283('0xc3'));_0x2b59e2['endtime']=_0x2b59e2[_0x4283('0x71')];_0x2b59e2[_0x4283('0xe0')]=_0x2a158d[_0x4283('0xe0')];_0x2b59e2['calleridnum']=_0x2a158d[_0x4283('0xe1')];hopperUtils[_0x4283('0xc9')](_0x2b59e2)[_0x4283('0xa0')](loggerCatch(_0x4283('0xed')));}})['then'](function(){if(_0x63056d)hopperUtils[_0x4283('0xe3')](_0x2a158d,_0x3a3793,_0x35635d)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0x4283('0x35')]=function(_0x122471){if(this[_0x4283('0x23')][_0x122471['uniqueid']]){this[_0x4283('0x23')][_0x122471[_0x4283('0xbf')]][_0x4283('0xee')]=_0x122471[_0x4283('0xee')];}if(this['uniqueId'][_0x122471[_0x4283('0xbf')]]){this[_0x4283('0x25')][_0x122471[_0x4283('0xbf')]]['channel']=_0x122471[_0x4283('0xee')];}};Dialer[_0x4283('0x18')][_0x4283('0x36')]=function(_0x57e503){if(!this[_0x4283('0x23')][_0x57e503[_0x4283('0xef')]]){return;}var _0x1af2a1=this['voiceQueues'][this[_0x4283('0x23')][_0x57e503[_0x4283('0xef')]][_0x4283('0xbe')]][_0x4283('0xf0')]||_0x4283('0xf1');if(_0x1af2a1===_0x4283('0xf2')){if(this['actions'][_0x57e503[_0x4283('0xef')]]&&_[_0x4283('0xf3')](this[_0x4283('0x23')][_0x57e503[_0x4283('0xef')]][_0x4283('0xf4')])&&_0x57e503[_0x4283('0x88')]==='1'&&_0x57e503[_0x4283('0xf5')]==='0'){if(this[_0x4283('0x1f')][_0x57e503['stateinterface']]){if(!this[_0x4283('0x1f')][_0x57e503[_0x4283('0xf6')]]['locked']){this[_0x4283('0x1f')][_0x57e503['stateinterface']][_0x4283('0xf4')]=!![];this[_0x4283('0x23')][_0x57e503[_0x4283('0xef')]]['locked']=!![];this['actions'][_0x57e503[_0x4283('0xef')]][_0x4283('0xf6')]=_0x57e503[_0x4283('0xf6')];}}}}else if(_0x1af2a1===_0x4283('0xf1')){if(this['actions'][_0x57e503[_0x4283('0xef')]]){if(this[_0x4283('0x1f')][_0x57e503[_0x4283('0xf6')]]){this[_0x4283('0x23')][_0x57e503[_0x4283('0xef')]][_0x4283('0xf6')]=_0x57e503[_0x4283('0xf6')];if(_[_0x4283('0xf3')](this['queueBooked'][this[_0x4283('0x23')][_0x57e503[_0x4283('0xef')]][_0x4283('0xbe')]])){this[_0x4283('0x28')][this[_0x4283('0x23')][_0x57e503['actionid']][_0x4283('0xbe')]]=[];}this[_0x4283('0x28')][this['actions'][_0x57e503[_0x4283('0xef')]][_0x4283('0xbe')]][_0x4283('0xa1')](_[_0x4283('0x5e')](_[_0x4283('0x75')](this['actions'][_0x57e503[_0x4283('0xef')]],['idHopper',_0x4283('0xf6')]),{'status':_0x57e503[_0x4283('0x88')],'paused':_0x57e503[_0x4283('0xf5')]}));}}}};Dialer[_0x4283('0x18')][_0x4283('0x38')]=function(_0x57f3a2){if(!this['actions'][_0x57f3a2[_0x4283('0xef')]]){return;}var _0x3e8e3a=this;var _0x524118=this[_0x4283('0x1d')][this[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]]['queue']];var _0x361557=_0x524118[_0x4283('0xf0')]||_0x4283('0xf1');if(_0x361557===_0x4283('0xf2')){if(this['actions'][_0x57f3a2[_0x4283('0xef')]]&&this[_0x4283('0x23')][_0x57f3a2['actionid']]['stateinterface']){this['preview'][_0x4283('0xf7')](this[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]]['idHopper'],this[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xf6')])['catch'](function(_0x53801f){logger[_0x4283('0x64')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x4283('0x42')](_0x53801f,{'showHidden':![],'depth':null}));})[_0x4283('0x1b')](function(){_0x3e8e3a[_0x4283('0xc1')](_0x3e8e3a[_0x4283('0x1d')][_0x3e8e3a[_0x4283('0x23')][_0x57f3a2['actionid']][_0x4283('0xbe')]]);_0x3e8e3a[_0x4283('0x1f')][_0x3e8e3a[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]]['stateinterface']][_0x4283('0xf4')]=![];delete _0x3e8e3a[_0x4283('0x23')][_0x57f3a2['actionid']];unlockQueueStatus(_0x524118);});}else{this[_0x4283('0xc1')](this['voiceQueues'][this[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xbe')]]);hopperUtils[_0x4283('0xda')]({'active':![],'ContactId':this[_0x4283('0x23')][_0x57f3a2['actionid']][_0x4283('0xdb')],'ListId':this[_0x4283('0x23')][_0x57f3a2['actionid']][_0x4283('0xdc')],'VoiceQueueId':this['actions'][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xdd')]||undefined,'CampaignId':this[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x57f3a2[_0x4283('0xef')]];unlockQueueStatus(_0x524118);}}else if(_0x361557===_0x4283('0xf1')){var _0x46cf01;if(this['actions'][_0x57f3a2['actionid']]&&!_['isEmpty'](this[_0x4283('0x28')][this['actions'][_0x57f3a2[_0x4283('0xef')]]['queue']])){if(this[_0x4283('0x29')][_0x3e8e3a['actions'][_0x57f3a2['actionid']]['queue']]){this[_0x4283('0x29')][_0x3e8e3a[_0x4283('0x23')][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xbe')]]=this[_0x4283('0x29')][this['actions'][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xbe')]]?this[_0x4283('0x29')][this['actions'][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xbe')]]:this[_0x4283('0x28')][this[_0x4283('0x23')][_0x57f3a2['actionid']][_0x4283('0xbe')]]?this['queueBooked'][this['actions'][_0x57f3a2[_0x4283('0xef')]][_0x4283('0xbe')]]['_rr']||0x0:0x0;}this[_0x4283('0x28')][this['actions'][_0x57f3a2['actionid']]['queue']][_0x4283('0xf8')]=this[_0x4283('0x29')][this[_0x4283('0x23')][_0x57f3a2['actionid']][_0x4283('0xbe')]];for(var _0x9e11f7=0x0;_0x9e11f7=_0x281de3[_0x4283('0x11f')]){_0x291364[_0x4283('0x120')](_0x314437,_0x1f86c5,_0x930e27,_0x4283('0x121'));}else{if(_0x314437['countmachineretry']>=_0x281de3[_0x4283('0x122')]){_0x291364[_0x4283('0x123')](_0x314437,_0x1f86c5,_0x930e27,_0x4283('0x124'));}else{hopperUtils[_0x4283('0xda')]({'active':![],'countmachineretry':_0x314437[_0x4283('0x119')],'scheduledat':moment()['add'](_0x281de3[_0x4283('0x125')],_0x4283('0xeb'))[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0x314437[_0x4283('0xdb')],'ListId':_0x314437[_0x4283('0xdc')],'VoiceQueueId':_0x314437[_0x4283('0xdd')]||undefined,'CampaignId':_0x314437[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x126')));_0x1f86c5({'reschedule':0x1});}}});}if(_0x44c5da[_0x4283('0x3f')]===_0x4283('0xc0')&&this[_0x4283('0x1e')][_0x44c5da[_0x4283('0xbe')]][_0x4283('0x10f')]&&_0x2e1597[_0x4283('0x110')]===_0x4283('0x111')){delete this[_0x4283('0x25')][_0x2e1597['uniqueid']];this[_0x4283('0xc1')](this[_0x4283('0x1e')][_0x44c5da[_0x4283('0xbe')]]);_0x372ad1=new Hangup(_0x44c5da,_0x2e1597);_0x372ad1[_0x4283('0x6e')]=0x12;_0x372ad1[_0x4283('0x6f')]=_0x4283('0x127');_0x372ad1[_0x4283('0x128')]=_0x4283('0x113');ami[_0x4283('0x3e')](_0x4283('0x129'),ut[_0x4283('0x114')](_0x372ad1,_0x4283('0x115')));this[_0x4283('0x116')](_0x372ad1,_0x4283('0x12a'),_0x4283('0x12b'));}if(_0x44c5da[_0x4283('0x3f')]===_0x4283('0xc0')&&this[_0x4283('0x1e')][_0x44c5da['queue']][_0x4283('0x10f')]&&_0x2e1597['value']===_0x4283('0x117')){return new Promise(function(_0x2c4f6e,_0x131a72){delete _0x291364[_0x4283('0x25')][_0x2e1597[_0x4283('0xbf')]];_0x291364[_0x4283('0xc1')](_0x291364[_0x4283('0x1e')][_0x44c5da[_0x4283('0xbe')]]);_0x291364[_0x4283('0x1e')][_0x44c5da[_0x4283('0xbe')]][_0x4283('0xc4')]+=0x1;_0x291364['campaigns'][_0x44c5da[_0x4283('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x55ff53=_0x291364[_0x4283('0x1e')][_0x44c5da[_0x4283('0xbe')]];var _0xc4036c=new Hangup(_0x44c5da,_0x2e1597);_0xc4036c[_0x4283('0x6e')]=0x13;_0xc4036c[_0x4283('0x6f')]=_0x4283('0x118');_0xc4036c[_0x4283('0x128')]=_0x4283('0x113');_0xc4036c[_0x4283('0x119')]+=0x1;_0xc4036c[_0x4283('0xd5')]+=0x1;_0xc4036c[_0x4283('0x115')]=!![];ami[_0x4283('0x3e')](_0x4283('0x129'),ut[_0x4283('0x114')](_0xc4036c,_0x4283('0x115')));hopperUtils[_0x4283('0xc9')](_0xc4036c)[_0x4283('0xa0')](loggerCatch(_0x4283('0x11a')));if(_0xc4036c[_0x4283('0x12c')]+_0xc4036c[_0x4283('0x11b')]+_0xc4036c[_0x4283('0x11c')]+_0xc4036c['countnosuchnumberretry']+_0xc4036c['countdropretry']+_0xc4036c[_0x4283('0xe6')]+_0xc4036c[_0x4283('0x119')]+_0xc4036c['countagentrejectretry']>=_0x55ff53[_0x4283('0x11f')]){_0x291364['stateGlobal'](_0xc4036c,_0x2c4f6e,_0x131a72,'reason19\x20machine....');}else{if(_0xc4036c['countmachineretry']>=_0x55ff53[_0x4283('0x122')]){_0x291364['createStateFinal'](_0xc4036c,_0x2c4f6e,_0x131a72,'reason\x2019\x20machine....');}else{hopperUtils[_0x4283('0xda')]({'active':![],'countmachineretry':_0xc4036c[_0x4283('0x119')],'scheduledat':moment()['add'](_0x55ff53[_0x4283('0x125')],'minutes')[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0xc4036c[_0x4283('0xdb')],'ListId':_0xc4036c['ListId'],'VoiceQueueId':_0xc4036c[_0x4283('0xdd')]||undefined,'CampaignId':_0xc4036c[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x126')));_0x2c4f6e({'reschedule':0x1});}}});}}};Dialer[_0x4283('0x18')][_0x4283('0x33')]=function(_0xbe7905){var _0x334fa9=this[_0x4283('0x25')][_0xbe7905[_0x4283('0xbf')]];var _0x2fff44;if(_0x334fa9&&_0x334fa9[_0x4283('0x3f')]===_0x4283('0xc0')){delete this[_0x4283('0x25')][_0xbe7905[_0x4283('0xbf')]];this['updateOriginated'](this['campaigns'][_0x334fa9[_0x4283('0xbe')]]);this['campaigns'][_0x334fa9['queue']]['ivrAnswerCallsDay']+=0x1;_0x2fff44=new Hangup(_0x334fa9,_0xbe7905);hopperUtils[_0x4283('0xc9')](_0x2fff44)[_0x4283('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x2fff44)[_0x4283('0xa0')](loggerCatch(_0x4283('0x12d')));}if(_0x334fa9&&_0x334fa9['type']!==_0x4283('0xc0')&&isNotNull(this[_0x4283('0x1d')][_0x334fa9[_0x4283('0xbe')]]['dialQueueProject'])){delete this['uniqueId'][_0xbe7905[_0x4283('0xbf')]];this['updateOriginated'](this[_0x4283('0x1d')][_0x334fa9[_0x4283('0xbe')]]);this['voiceQueues'][_0x334fa9[_0x4283('0xbe')]][_0x4283('0xc4')]+=0x1;this['voiceQueues'][_0x334fa9['queue']][_0x4283('0x112')]+=0x1;_0x2fff44=new Hangup(_0x334fa9,_0xbe7905);_0x2fff44[_0x4283('0x6e')]=0x10;_0x2fff44[_0x4283('0x6f')]='AnswerAGI';_0x2fff44[_0x4283('0x128')]='AGI';hopperUtils['createHistory'](_0x2fff44)[_0x4283('0xa0')](loggerCatch(_0x4283('0x12e')));hopperUtils[_0x4283('0xcb')](_0x2fff44)['catch'](loggerCatch(_0x4283('0x12d')));}if(_0x334fa9&&_0x334fa9[_0x4283('0x3f')]!==_0x4283('0xc0')&&!isNotNull(this[_0x4283('0x1d')][_0x334fa9[_0x4283('0xbe')]]['dialQueueProject'])){if(_0xbe7905['cause-txt']==='Normal\x20Clearing'){delete this[_0x4283('0x25')][_0xbe7905[_0x4283('0xbf')]];this[_0x4283('0x1d')][_0x334fa9[_0x4283('0xbe')]][_0x4283('0xc4')]+=0x1;const _0x162057=new AgentComplete(_0x334fa9,_0xbe7905);_0x162057['CampaignId']=this['voiceQueues'][_0x334fa9[_0x4283('0xbe')]]['id'];hopperUtils[_0x4283('0xc9')](_0x162057)[_0x4283('0xa0')](loggerCatch(_0x4283('0xca')));hopperUtils['moveContactManagedDialer'](_0x162057)[_0x4283('0xa0')](loggerCatch(_0x4283('0xcc')));}else{delete this['uniqueId'][_0xbe7905[_0x4283('0xbf')]];this['updateOriginated'](this[_0x4283('0x1d')][_0x334fa9[_0x4283('0xbe')]]);this['voiceQueues'][_0x334fa9['queue']]['outboundUnknownCallsDay']+=0x1;_0x2fff44=new Hangup(_0x334fa9,_0xbe7905);_0x2fff44['state']=0xc;_0x2fff44['statedesc']=_0xbe7905[_0x4283('0x12f')];_0x2fff44[_0x4283('0x128')]='Unknow';hopperUtils['createHistory'](_0x2fff44)[_0x4283('0xa0')](loggerCatch(_0x4283('0x12e')));hopperUtils['moveContactManagedDialer'](_0x2fff44)[_0x4283('0xa0')](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x4283('0x18')][_0x4283('0x130')]=function(_0x282f0a){var _0x3af7fd=this;if(!_0x3af7fd[_0x4283('0x2a')][_0x282f0a['name']]){_0x3af7fd[_0x4283('0x2a')][_0x282f0a[_0x4283('0x45')]]={'running':![]};}else if(_0x3af7fd[_0x4283('0x2a')][_0x282f0a['name']][_0x4283('0x131')]===!![]){return;}else if(_0x3af7fd[_0x4283('0x2a')][_0x282f0a[_0x4283('0x45')]][_0x4283('0x131')]===![]){_0x3af7fd[_0x4283('0x2a')][_0x282f0a['name']][_0x4283('0x131')]=!![];}var _0x159516=_0x3af7fd[_0x4283('0x1d')][_0x282f0a[_0x4283('0x45')]];var _0x3dc21b=_0x159516[_0x4283('0x67')]!==utils[_0x4283('0x6b')]['INACTIVE'];var _0x4c8251=utils[_0x4283('0x132')](_0x159516);_0x159516[_0x4283('0x133')]=utils[_0x4283('0x134')](_0x159516,_0x3af7fd[_0x4283('0x20')]);Promise[_0x4283('0x135')]()[_0x4283('0x3b')](function(){if(_0x159516[_0x4283('0x133')]===utils[_0x4283('0x6b')][_0x4283('0x7b')]){if(_0x3dc21b){clearPredictiveAttributes(_0x159516);_0x282f0a[_0x4283('0x60')]=undefined;_0x282f0a[_0x4283('0x27')]=undefined;}if(_0x159516[_0x4283('0x133')]===utils[_0x4283('0x6b')][_0x4283('0x7b')]){_0x282f0a[_0x4283('0x136')]=0x0;_0x282f0a[_0x4283('0xf5')]=0x0;_0x282f0a['inUse']=0x0;_0x282f0a['talking']=0x0;_0x282f0a[_0x4283('0x137')]=0x0;}}else if(_0x159516[_0x4283('0x133')]===utils[_0x4283('0x6b')][_0x4283('0x138')]&&!_0x4c8251){return _0x3af7fd[_0x4283('0x96')](_0x159516,!![])[_0x4283('0x3b')](function(){return _0x3af7fd[_0x4283('0x96')](_0x159516,![]);})[_0x4283('0x3b')](function(){return _0x3af7fd[_0x4283('0xae')](_0x159516);})[_0x4283('0xa0')](function(_0x49ab35){loggerSyncQueueSummary[_0x4283('0x41')](_0x4283('0x139'),util[_0x4283('0x42')](_0x49ab35,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x159516);});}else{clearPredictiveAttributes(_0x159516);}})[_0x4283('0x3b')](function(){var _0x63994a=_0x282f0a[_0x4283('0x13a')](_0x159516);if(_0x63994a||_0x159516[_0x4283('0x13b')]){_0x159516[_0x4283('0x13b')]=![];_0x282f0a[_0x4283('0x13c')](_0x159516);Object['assign'](_0x159516,_0x282f0a);emitOutboundVoiceQueueSummary(_0x282f0a);}_0x3af7fd[_0x4283('0x2a')][_0x159516[_0x4283('0x45')]][_0x4283('0x131')]=![];})[_0x4283('0xa0')](function(_0x2eca8d){logger['error']('[syncQueueSummary]',util['inspect'](_0x2eca8d,{'showHidden':![],'depth':null}));_0x3af7fd[_0x4283('0x2a')][_0x159516['name']][_0x4283('0x131')]=![];});};Dialer[_0x4283('0x18')]['syncQueueSummaryComplete']=_[_0x4283('0x13d')](function(){var _0x20effc=_[_0x4283('0x13e')](this[_0x4283('0x1d')],function(_0x3a4823){return _0x3a4823[_0x4283('0x13f')];});var _0xc357e3=_['filter'](this[_0x4283('0x1f')],function(_0x5a54fa){return _0x5a54fa['online']&&_0x5a54fa['status']===_0x4283('0x89');});if(_0x20effc[_0x4283('0x140')]>0x0&&_0xc357e3[_0x4283('0x140')]>0x0){return Promise[_0x4283('0x135')]()['then'](cmHopper[_0x4283('0x141')](_['map'](_0x20effc,'id'),previewRecallmeReminderInterval,_[_0x4283('0x142')](_0xc357e3,'id')))[_0x4283('0x3b')](function(_0x52fb2d){for(var _0x5592ec=0x0;_0x5592ec<_0x52fb2d[_0x4283('0x140')];_0x5592ec++){var _0x22ce5e=_0x52fb2d[_0x5592ec][_0x4283('0x143')][_0x4283('0x45')];if(_0x22ce5e)io['to'](util[_0x4283('0x43')](_0x4283('0x144'),_0x22ce5e))['emit'](_0x4283('0x145'),{'hopper':_0x52fb2d[_0x5592ec]});}})[_0x4283('0xa0')](function(_0x42d8f2){logger['error'](_0x4283('0x146'),_0x42d8f2);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x4283('0x18')]['loopClearZombieChannels']=function(){var _0x45846f=this;setInterval(function(){_0x45846f[_0x4283('0x147')](_0x45846f['uniqueId'],_0x4283('0x148'));_0x45846f['clearZombieChannels'](_0x45846f[_0x4283('0x23')],_0x4283('0x149'));},0x32c8);};Dialer['prototype'][_0x4283('0x147')]=function(_0x56134c,_0x54458a){var _0x1e6c92=this;for(var _0x1dff7e in _0x56134c){if(typeof _0x56134c[_0x1dff7e]!==_0x4283('0xaa')){this[_0x4283('0x1c')][_0x4283('0x19')](function(){if(!_['isNil'](_0x56134c[_0x1dff7e])){return ami[_0x4283('0x9a')]({'action':_0x4283('0x88'),'channel':_0x56134c[_0x1dff7e][_0x4283('0xee')]})[_0x4283('0xa0')](function(_0x245705){if(_0x245705[_0x4283('0x67')]===_0x4283('0x14a')){setTimeout(function(){if(_0x56134c[_0x1dff7e]&&_0x56134c[_0x1dff7e][_0x4283('0x3f')]!==_0x4283('0xc0')){_0x1e6c92[_0x4283('0xc1')](_0x1e6c92[_0x4283('0x1d')][_0x56134c[_0x1dff7e]['queue']]);logger['error']('[Dialer][checkChannel]',_0x54458a,_0x1dff7e,_0x56134c[_0x1dff7e][_0x4283('0xbe')]);delete _0x56134c[_0x1dff7e];}if(_0x56134c[_0x1dff7e]&&_0x56134c[_0x1dff7e]['type']==='ivr'){_0x1e6c92[_0x4283('0xc1')](_0x1e6c92[_0x4283('0x1e')][_0x56134c[_0x1dff7e]['queue']]);logger[_0x4283('0x64')](_0x4283('0x14b'),_0x54458a,_0x1dff7e,_0x56134c[_0x1dff7e][_0x4283('0xbe')]);delete _0x56134c[_0x1dff7e];}},0x2328);}});}});}}};Dialer[_0x4283('0x18')][_0x4283('0x14c')]=function(_0x254027){return Promise[_0x4283('0x135')]()['then'](voiceQueueRt[_0x4283('0x14c')](_0x254027))[_0x4283('0xa0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x4283('0x18')][_0x4283('0xc1')]=function(_0x27c4c1){if(!_[_0x4283('0x3d')](_0x27c4c1)&&_0x27c4c1!==null){if(typeof _0x27c4c1[_0x4283('0x80')]!==_0x4283('0xaa')){if(_0x27c4c1['originated']>0x0){_0x27c4c1[_0x4283('0x80')]-=0x1;}else{logger[_0x4283('0x64')](_0x4283('0x14d'));}}}else{logger[_0x4283('0x64')](_0x4283('0x14e'));}};Dialer[_0x4283('0x18')][_0x4283('0x14f')]=function(_0x5ca08a,_0x5014f1){var _0x18d2e5=this;return function(_0x4cb2fe){_0x18d2e5[_0x4283('0xc1')](_0x5014f1);logger[_0x4283('0x64')](_0x5ca08a,util['inspect'](_0x4cb2fe,{'showHidden':![],'depth':null}));};};Dialer[_0x4283('0x18')][_0x4283('0x150')]=function(_0x2b6610,_0x4c8611,_0x49c3e0){var _0x3699c5={'state':0x19,'statedesc':_0x4283('0x151')};this[_0x4283('0xc1')](_0x4c8611);this[_0x4283('0x116')](_['merge'](_0x3699c5,_[_0x4283('0x75')](_0x49c3e0,['ContactId','ListId',_0x4283('0x152'),_0x4283('0xdd'),'CampaignId'])),_0x4283('0x153'),'[emptyContact]');logger[_0x4283('0x64')](_0x2b6610);};Dialer[_0x4283('0x18')]['saveInDb']=function(_0x3959e7,_0x22acef,_0x3d0609){hopperUtils[_0x4283('0xc9')](_0x3959e7)[_0x4283('0xa0')](loggerCatch(_0x22acef));hopperUtils[_0x4283('0xcb')](_0x3959e7)['catch'](loggerCatch(_0x3d0609));};Dialer['prototype'][_0x4283('0xe8')]=function(_0x1fe462,_0x38772e){hopperUtils[_0x4283('0xc9')](_0x1fe462)[_0x4283('0xa0')](loggerCatch(_0x4283('0xca')));if(_0x38772e==0x0){hopperUtils[_0x4283('0xcb')](_0x1fe462)[_0x4283('0xa0')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x4283('0x18')]['checkPreviewRecallReminder']=function(_0x1a3313){return Promise[_0x4283('0x135')]()[_0x4283('0x3b')](cmHopper['handlePreviewRecallNotifications'](_0x1a3313['id'],previewRecallmeReminderInterval))['then'](function(_0x3f5706){for(var _0x2b162a=0x0;_0x2b162a<_0x3f5706['length'];_0x2b162a++){var _0x753ac2=_0x3f5706[_0x2b162a][_0x4283('0x143')]['name'];if(_0x753ac2)io['to'](util['format']('user:%s',_0x753ac2))[_0x4283('0x3e')]('user:dialPreviewRecallReminder',{'hopper':_0x3f5706[_0x2b162a]});}})[_0x4283('0xa0')](function(){});};Dialer[_0x4283('0x18')]['launchHandleIvr']=function(_0xa40f51){var _0xcd220f=this;return function(){_0xcd220f[_0x4283('0x154')](_0xa40f51);};};Dialer[_0x4283('0x18')]['actionOriginate']=function(_0x1c379b,_0x174de7){var _0x239dd2=this;var _0x368bc8=uuid['v4']();this[_0x4283('0x23')][_0x368bc8]=new Action(_0x1c379b,_0x174de7,_0x368bc8);return new Promise(function(_0xaec28a,_0x2add27){if(_['isUndefined'](_0x1c379b)&&typeof _0x1c379b!==_0x4283('0x155')){return _0x2add27(msgResponse(_0x4283('0x156'),_0x4283('0x93'),_0x4283('0x157')));}if(_[_0x4283('0x3d')](_0x174de7[_0x4283('0x158')])||_0x174de7[_0x4283('0x158')]===null){return _0x2add27(msgResponse(_0x4283('0x156'),_0x4283('0x93'),_0x4283('0x159')));}var _0x148730={'XMD-CALLERID':_0x239dd2[_0x4283('0x23')][_0x368bc8][_0x4283('0x15a')](),'XMD-AGI':_0x1c379b[_0x4283('0x15b')]?util[_0x4283('0x43')](_0x4283('0x15c'),ipAgi,_0x1c379b['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x1c379b['dialQueueProject2']?util[_0x4283('0x43')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1c379b[_0x4283('0xc7')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x1c379b)?util[_0x4283('0x43')](_0x4283('0x15d'),_0x1c379b[_0x4283('0x45')],_0x1c379b['dialQueueOptions']||'',_0x1c379b[_0x4283('0xc8')]?'c':'',_0x1c379b['dialQueueTimeout']||0x3):_0x4283('0x15e'),'XMD-CONTACTID':_0x174de7[_0x4283('0xdb')],'XMD-CDRTYPE':_0x4283('0x6'),'CALLERID(all)':_0x239dd2[_0x4283('0x23')][_0x368bc8][_0x4283('0x15a')](),'XMD-AMD':_0x1c379b[_0x4283('0x10f')]?_0x4283('0x138'):_0x4283('0x15e'),'XMD-DESTINATION':_0x4283('0x15f')};if(_0x1c379b[_0x4283('0x10f')]){_0x148730[_0x4283('0x160')]=_0x1c379b[_0x4283('0x161')]||0x9c4;_0x148730['XMD-AMDGREETING']=_0x1c379b[_0x4283('0x162')]||0x5dc;_0x148730[_0x4283('0x163')]=_0x1c379b[_0x4283('0x164')]||0x320;_0x148730[_0x4283('0x165')]=_0x1c379b[_0x4283('0x166')]||0x1388;_0x148730['XMD-AMDMINWORDLENGTH']=_0x1c379b[_0x4283('0x167')]||0x64;_0x148730['XMD-AMDBETWEENWORDSSILENCE']=_0x1c379b[_0x4283('0x168')]||0x32;_0x148730[_0x4283('0x169')]=_0x1c379b[_0x4283('0x16a')]||0x3;_0x148730[_0x4283('0x16b')]=_0x1c379b[_0x4283('0x16c')]||0x100;_0x148730['XMD-AMDMAXIMUMWORDLENGTH']=_0x1c379b[_0x4283('0x16d')]||0x1388;}if(utils['isOutboundQueue'](_0x1c379b)){_0x148730[_0x4283('0x16e')]=_0x174de7[_0x4283('0xdd')];}else{_0x148730[_0x4283('0x16f')]=_0x174de7['CampaignId'];}var _0x4f45b5=utils[_0x4283('0x170')](_0x174de7[_0x4283('0x171')]);Object[_0x4283('0x172')](_0x148730,_0x4f45b5);var _0xd2915f=_0x239dd2[_0x4283('0x86')](_0x1c379b[_0x4283('0x8d')])?utils[_0x4283('0x173')](_0x1c379b[_0x4283('0x8d')][_0x4283('0x174')],_0x1c379b[_0x4283('0x175')],_0x1c379b[_0x4283('0x176')]>0x0?utils[_0x4283('0x177')](_0x1c379b[_0x4283('0x178')],_0x1c379b[_0x4283('0x176')]):_0x1c379b[_0x4283('0x178')]):utils[_0x4283('0x173')](_['isNil'](_0x1c379b[_0x4283('0x8e')])?_0x1c379b[_0x4283('0x8d')][_0x4283('0x174')]:_0x1c379b[_0x4283('0x8e')]['callerid'],_0x1c379b['dialOriginateCallerIdName'],_0x1c379b[_0x4283('0x176')]>0x0?utils[_0x4283('0x177')](_0x1c379b['dialOriginateCallerIdNumber'],_0x1c379b[_0x4283('0x176')]):_0x1c379b[_0x4283('0x178')]);if(_0xd2915f){_0x148730[_0x4283('0x179')]=_0x239dd2[_0x4283('0x23')][_0x368bc8][_0x4283('0x17a')]=utils['extractCalleridName'](_0xd2915f);_0x148730['XMD-ORIGINATECALLERIDNUM']=_0x174de7[_0x4283('0x158')];}_0x1c379b[_0x4283('0x17b')]=_0x148730;return ami[_0x4283('0x9a')]({'actionid':_0x368bc8,'action':'originate','channel':_0x239dd2['isTrunkReachable'](_0x1c379b['Trunk'])?util['format'](_0x4283('0x17c'),_0x1c379b[_0x4283('0x8d')][_0x4283('0x45')],isNotNull(_0x1c379b['dialPrefix'])?_0x1c379b[_0x4283('0x17d')]['trim']()||'':'',_0x1c379b[_0x4283('0x17e')]>0x0?_0x174de7[_0x4283('0x158')][_0x4283('0x17f')](_0x1c379b[_0x4283('0x17e')]):_0x174de7['phone']):util[_0x4283('0x43')](_0x4283('0x17c'),_[_0x4283('0xf3')](_0x1c379b['TrunkBackup'])?_0x1c379b[_0x4283('0x8d')][_0x4283('0x45')]:_0x1c379b[_0x4283('0x8e')][_0x4283('0x45')],isNotNull(_0x1c379b[_0x4283('0x17d')])?_0x1c379b[_0x4283('0x17d')]['trim']()||'':'',_0x1c379b[_0x4283('0x17e')]>0x0?_0x174de7['phone']['substring'](_0x1c379b[_0x4283('0x17e')]):_0x174de7[_0x4283('0x158')]),'callerid':_0xd2915f,'Exten':'xcally-motion-dialer','Context':_0x4283('0x180'),'Priority':'1','variable':_0x148730,'timeout':(_0x1c379b[_0x4283('0x181')]||0x1e)*0x3e8,'async':!![],'channelid':_0x368bc8})[_0x4283('0x3b')](function(_0x2439bc){return _0xaec28a(_0x2439bc);})['catch'](function(_0x4a8892){_0x1c379b[_0x4283('0x182')]+=0x1;var _0x2f41df=new History(_0x239dd2[_0x4283('0x23')][_0x368bc8]);logger[_0x4283('0x64')](util[_0x4283('0x43')]('[originateError]:\x20%s',JSON[_0x4283('0x74')](_0x4a8892)));_0x2f41df[_0x4283('0x6e')]=0xe;_0x2f41df['statedesc']=_0x4283('0x183');_0x2f41df[_0x4283('0x71')]=moment()[_0x4283('0x43')](_0x4283('0xc3'));_0x2f41df[_0x4283('0x70')]=_0x2f41df['starttime'];hopperUtils[_0x4283('0xc9')](_0x2f41df)[_0x4283('0xa0')](loggerCatch(_0x4283('0x184')));_0x239dd2['moveContactManagedDialer'](_0x2f41df)[_0x4283('0xa0')](loggerCatch(_0x4283('0x184')))['finally'](function(){delete _0x239dd2[_0x4283('0x23')][_0x368bc8];return _0x2add27(msgResponse(_0x4283('0x156'),_0x4283('0x85'),_0x4283('0x185')));});});});};Dialer[_0x4283('0x18')][_0x4283('0x186')]=function(_0xece31f,_0xe06956,_0x14fe38){var _0x471a36=new History(_0xe06956);if(_0x471a36[_0x4283('0x12c')]+_0x471a36[_0x4283('0x11b')]+_0x471a36[_0x4283('0x11c')]+_0x471a36[_0x4283('0x11d')]+_0x471a36[_0x4283('0xd4')]+_0x471a36[_0x4283('0xe6')]+_0x471a36['countmachineretry']+_0x471a36[_0x4283('0x11e')]>=_0x14fe38[_0x4283('0x11f')]-0x1){return!![];}switch(_0xece31f){case 0x3:if(_0x471a36['countnoanswerretry']>=_0x14fe38[_0x4283('0x187')]-0x1){return!![];}hopperUtils[_0x4283('0xda')]({'active':![],'countnoanswerretry':_0x471a36[_0x4283('0x11c')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38[_0x4283('0x188')],_0x4283('0xeb'))['format'](_0x4283('0xc3')),'ContactId':_0x471a36['ContactId'],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36[_0x4283('0xdd')]||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x471a36[_0x4283('0x12c')]>=_0x14fe38[_0x4283('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x471a36[_0x4283('0x12c')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38[_0x4283('0x18a')],_0x4283('0xeb'))[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0x471a36['ContactId'],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36['VoiceQueueId']||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x471a36[_0x4283('0x11b')]>=_0x14fe38['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x4283('0xda')]({'active':![],'countcongestionretry':_0x471a36[_0x4283('0x11b')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38['dialCongestionRetryFrequency'],_0x4283('0xeb'))['format'](_0x4283('0xc3')),'ContactId':_0x471a36[_0x4283('0xdb')],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36[_0x4283('0xdd')]||undefined,'CampaignId':_0x471a36['CampaignId']||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x18b')));break;case 0x0:if(_0x471a36[_0x4283('0x11d')]>=_0x14fe38[_0x4283('0x18c')]-0x1){return!![];}else{hopperUtils[_0x4283('0xda')]({'active':![],'countnosuchnumberretry':_0x471a36[_0x4283('0x11d')]+=0x1,'scheduledat':moment()['add'](_0x14fe38[_0x4283('0x18d')],_0x4283('0xeb'))[_0x4283('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x471a36[_0x4283('0xdb')],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36[_0x4283('0xdd')]||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x18e')));}break;case 0xa:if(_0x471a36[_0x4283('0xd4')]>=_0x14fe38['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x4283('0xda')]({'active':![],'countdropretry':_0x471a36[_0x4283('0xd4')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38['dialDropRetryFrequency'],_0x4283('0xeb'))[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0x471a36[_0x4283('0xdb')],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36[_0x4283('0xdd')]||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0xdf')));break;case 0xb:if(_0x471a36[_0x4283('0xe6')]>=_0x14fe38[_0x4283('0xe7')]-0x1){return!![];}hopperUtils[_0x4283('0xda')]({'active':![],'countabandonedretry':_0x471a36[_0x4283('0xe6')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38[_0x4283('0xea')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x471a36[_0x4283('0xdb')],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36[_0x4283('0xdd')]||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})['catch'](loggerCatch(_0x4283('0xec')));break;case 0x13:if(_0x471a36[_0x4283('0x119')]>=_0x14fe38['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x471a36[_0x4283('0x119')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38[_0x4283('0x125')],_0x4283('0xeb'))[_0x4283('0x43')](_0x4283('0xc3')),'ContactId':_0x471a36[_0x4283('0xdb')],'ListId':_0x471a36['ListId'],'VoiceQueueId':_0x471a36['VoiceQueueId']||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x126')));break;case 0x14:if(_0x471a36[_0x4283('0x11e')]>=_0x14fe38[_0x4283('0x18f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x471a36[_0x4283('0x11e')]+=0x1,'scheduledat':moment()[_0x4283('0xe9')](_0x14fe38[_0x4283('0x190')],_0x4283('0xeb'))['format'](_0x4283('0xc3')),'ContactId':_0x471a36['ContactId'],'ListId':_0x471a36[_0x4283('0xdc')],'VoiceQueueId':_0x471a36[_0x4283('0xdd')]||undefined,'CampaignId':_0x471a36[_0x4283('0xde')]||undefined})[_0x4283('0xa0')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x4283('0x18')][_0x4283('0x109')]=function(_0x40bde2,_0x14afd2,_0x2d48f9){var _0x4decfb=this;var _0x38c8ae=new History(_0x40bde2);var _0x1f6a69=![];var _0x2e4d73;var _0x5e8702;return new Promise(function(_0x8affba,_0x52d2cb){if(_[_0x4283('0x3d')](_0x14afd2)&&typeof _0x14afd2!==_0x4283('0x155')){return _0x52d2cb(msgResponse(_0x4283('0x191'),_0x4283('0x93'),_0x4283('0x192')));}if(_[_0x4283('0x3d')](_0x2d48f9)&&typeof _0x2d48f9!==_0x4283('0x155')){return _0x52d2cb(msgResponse(_0x4283('0x191'),_0x4283('0x93'),_0x4283('0x193')));}hopperUtils['verifyAdditionalPhones'](_0x38c8ae,_0x2d48f9['reason'],_0x14afd2)[_0x4283('0x3b')](function(_0x256ed2){if(_0x256ed2[_0x4283('0xd9')]==0x1)_0x1f6a69=!![];switch(_0x2d48f9['reason']){case'0':_0x14afd2[_0x4283('0x194')]+=0x1;_0x38c8ae[_0x4283('0x6e')]=0x0;_0x38c8ae['statedesc']=_0x4283('0x195');_0x38c8ae[_0x4283('0x11d')]+=0x1;_0x38c8ae[_0x4283('0xd5')]+=0x1;ami['emit'](_0x4283('0x196'),ut[_0x4283('0x114')](_0x40bde2,_0x4283('0x197')));_0x2e4d73=_0x14afd2[_0x4283('0x18d')];_0x5e8702=_0x14afd2['callAdditionalPhoneAfterMin'];hopperUtils[_0x4283('0xc9')](_0x38c8ae)[_0x4283('0xa0')](loggerCatch(_0x4283('0x11a')));if(_0x4decfb[_0x4283('0x186')](0x0,_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0x11d')]>=_0x14afd2[_0x4283('0x18c')]){_0x4decfb[_0x4283('0x123')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x198'));}else{_0x4decfb[_0x4283('0x120')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x198'));}}break;case'3':_0x14afd2[_0x4283('0x199')]+=0x1;_0x38c8ae[_0x4283('0x6e')]=0x3;_0x38c8ae[_0x4283('0x6f')]='NoAnswer';_0x38c8ae['countnoanswerretry']+=0x1;_0x38c8ae[_0x4283('0xd5')]+=0x1;var _0x12f14b=ut[_0x4283('0x19a')](_0x40bde2,_0x14afd2);ami[_0x4283('0x3e')](_0x4283('0x19b'),_0x12f14b);_0x2e4d73=_0x14afd2['dialNoAnswerRetryFrequency'];_0x5e8702=_0x14afd2['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x38c8ae)[_0x4283('0xa0')](loggerCatch(_0x4283('0x19c')));if(_0x4decfb[_0x4283('0x186')](0x3,_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0x11c')]>=_0x14afd2[_0x4283('0x187')]){_0x4decfb['createStateFinal'](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x19d'));}else{_0x4decfb['stateGlobal'](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x19d'));}}break;case'5':_0x14afd2[_0x4283('0x19e')]+=0x1;_0x38c8ae[_0x4283('0x6e')]=0x5;_0x38c8ae[_0x4283('0x6f')]='Busy';_0x38c8ae[_0x4283('0x12c')]+=0x1;_0x38c8ae[_0x4283('0xd5')]+=0x1;ami[_0x4283('0x3e')]('custom:agentbusy',ut[_0x4283('0x114')](_0x40bde2,_0x4283('0x19f')));_0x2e4d73=_0x14afd2[_0x4283('0x18a')];_0x5e8702=_0x14afd2[_0x4283('0xd7')];hopperUtils[_0x4283('0xc9')](_0x38c8ae)[_0x4283('0xa0')](loggerCatch(_0x4283('0x1a0')));if(_0x4decfb['checkRetriveMax'](0x5,_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0x12c')]>=_0x14afd2[_0x4283('0x189')]){_0x4decfb[_0x4283('0x123')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1a1'));}else{_0x4decfb[_0x4283('0x120')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1a1'));}}break;case'8':_0x14afd2[_0x4283('0x1a2')]+=0x1;_0x38c8ae[_0x4283('0x6e')]=0x8;_0x38c8ae['statedesc']='Congestion';_0x38c8ae[_0x4283('0x11b')]+=0x1;_0x38c8ae[_0x4283('0xd5')]+=0x1;_0x2e4d73=_0x14afd2[_0x4283('0x1a3')];_0x5e8702=_0x14afd2[_0x4283('0xd7')];ami[_0x4283('0x3e')](_0x4283('0x1a4'),ut[_0x4283('0x114')](_0x40bde2,_0x4283('0x1a5')));hopperUtils[_0x4283('0xc9')](_0x38c8ae)[_0x4283('0xa0')](loggerCatch(_0x4283('0x1a6')));if(_0x4decfb['checkRetriveMax'](0x8,_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0x11b')]>=_0x14afd2['dialCongestionMaxRetry']){_0x4decfb[_0x4283('0x123')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1a7'));}else{_0x4decfb[_0x4283('0x120')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1a7'));}}break;case'11':_0x14afd2['outboundAbandonedCallsDay']+=0x1;_0x38c8ae[_0x4283('0x6e')]=0xb;_0x38c8ae[_0x4283('0x6f')]='Abandoned';_0x38c8ae[_0x4283('0xe6')]+=0x1;_0x38c8ae['countglobal']+=0x1;_0x2e4d73=_0x14afd2[_0x4283('0xea')];_0x5e8702=_0x14afd2[_0x4283('0xd7')];hopperUtils[_0x4283('0xc9')](_0x38c8ae)[_0x4283('0xa0')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4decfb['checkRetriveMax'](0xb,_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0xe6')]>=_0x14afd2[_0x4283('0xe7')]){_0x4decfb[_0x4283('0x123')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1a8'));}else{_0x4decfb[_0x4283('0x120')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1a8'));}}break;case'20':_0x14afd2[_0x4283('0x1a9')]+=0x1;_0x38c8ae[_0x4283('0x6e')]=0x14;_0x38c8ae[_0x4283('0x6f')]=_0x4283('0x1aa');_0x38c8ae[_0x4283('0x11e')]+=0x1;_0x38c8ae[_0x4283('0xd5')]+=0x1;_0x2e4d73=_0x14afd2[_0x4283('0x190')];_0x5e8702=_0x14afd2[_0x4283('0xd7')];ami[_0x4283('0x3e')](_0x4283('0x1ab'),ut['buildObj'](_0x40bde2,_0x4283('0x1ac')));hopperUtils[_0x4283('0xc9')](_0x38c8ae)[_0x4283('0xa0')](loggerCatch(_0x4283('0x1ad')));if(_0x4decfb['checkRetriveMax'](0x14,_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0x11e')]>=_0x14afd2[_0x4283('0x18f')]){_0x4decfb[_0x4283('0x123')](_0x38c8ae,_0x8affba,_0x52d2cb,'reason\x2020\x20agentreject');}else{_0x4decfb[_0x4283('0x120')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x4283('0x1ae'));}}break;default:_0x14afd2[_0x4283('0x1af')]+=0x1;_0x38c8ae[_0x4283('0x6e')]=0xc;_0x38c8ae[_0x4283('0x6f')]=_0x2d48f9[_0x4283('0xc5')];_0x2e4d73=_0x14afd2[_0x4283('0x190')];_0x5e8702=_0x14afd2[_0x4283('0xd7')];hopperUtils[_0x4283('0xc9')](_0x38c8ae)['catch'](loggerCatch(_0x4283('0x1b0')));if(_0x4decfb[_0x4283('0x186')](_0x2d48f9[_0x4283('0xc5')],_0x40bde2,_0x14afd2)&&!_0x1f6a69){if(_0x38c8ae[_0x4283('0x12c')]+_0x38c8ae[_0x4283('0x11b')]+_0x38c8ae['countnoanswerretry']+_0x38c8ae[_0x4283('0x11d')]+_0x38c8ae[_0x4283('0xd4')]+_0x38c8ae[_0x4283('0xe6')]+_0x38c8ae[_0x4283('0x119')]+_0x38c8ae['countagentrejectretry']>=_0x14afd2[_0x4283('0x11f')]){_0x4decfb[_0x4283('0x120')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x2d48f9[_0x4283('0xc5')]);}else{_0x4decfb[_0x4283('0x123')](_0x38c8ae,_0x8affba,_0x52d2cb,_0x2d48f9[_0x4283('0xc5')]);}}}})[_0x4283('0x3b')](function(){if(_0x1f6a69){hopperUtils[_0x4283('0xe3')](_0x38c8ae,_0x2e4d73,_0x5e8702)['then'](function(){return _0x8affba(0x1);});}});});};Dialer['prototype'][_0x4283('0x120')]=function(_0x1e4475,_0x480491,_0x9f7c81,_0x1fc9d6){var _0x23a93d=new Final(_0x1e4475);_0x23a93d[_0x4283('0x6e')]=0xf;_0x23a93d[_0x4283('0x6f')]=_0x4283('0x1b1');this[_0x4283('0x123')](_0x23a93d,_0x480491,_0x9f7c81,_0x1fc9d6);};Dialer[_0x4283('0x18')]['createStateFinal']=function(_0x55acf0,_0x3f5313,_0x446a58,_0xf24843){hopperUtils[_0x4283('0xcb')](_0x55acf0)[_0x4283('0x3b')](function(){return _0x3f5313(msgResponse(_0x4283('0x191'),_0x4283('0x1b2'),_0xf24843));})[_0x4283('0xa0')](function(){return _0x446a58(msgResponse(_0x4283('0x1b3'),_0x4283('0x93'),_0x4283('0x1b4')));});};Dialer[_0x4283('0x18')][_0x4283('0xb0')]=function(_0x5b01df){var _0x572d85=_0x5b01df[_0x4283('0x1b5')]/0x64;var _0x1a92ac=_0x5b01df[_0x4283('0x1b6')]/(_0x5b01df[_0x4283('0x1b6')]+_0x5b01df[_0x4283('0xc4')]);var _0x34f981=Math['round'](_0x5b01df[_0x4283('0x1b7')]*(_0x5b01df[_0x4283('0x1b8')]/0x64));var _0x4723e7=Math[_0x4283('0x1b9')](_0x5b01df[_0x4283('0x1b7')]*(_0x5b01df[_0x4283('0x1ba')]/0x64));var _0x2e777b=_0x5b01df[_0x4283('0x136')]+_0x5b01df[_0x4283('0x1bb')];var _0x8d0d7a=Math[_0x4283('0x1bc')](_0x5b01df[_0x4283('0x58')]*_0x5b01df['erlangAbandonmentRate']*_0x5b01df['predictiveIntervalHitRate']*_0x5b01df[_0x4283('0x1bd')]);if(_[_0x4283('0x3d')](_0x5b01df[_0x4283('0x27')])){if(!_[_0x4283('0x3d')](_0x5b01df[_0x4283('0x60')])){_0x5b01df[_0x4283('0x60')]=undefined;loggerPredictive[_0x4283('0x64')](_0x4283('0x1be'),_0x4283('0x1bf'));}if(!_[_0x4283('0x3d')](_0x5b01df['handlePredictive'])){loggerPredictive[_0x4283('0x64')](_0x4283('0x1be'),_0x4283('0x1c0'));clearInterval(_0x5b01df[_0x4283('0x62')]);_0x5b01df[_0x4283('0x62')]=undefined;}_0x5b01df[_0x4283('0x27')]=moment()[_0x4283('0x43')](_0x4283('0xc3'));loggerPredictive[_0x4283('0x48')](_0x5b01df[_0x4283('0x45')],_0x4283('0x1c1'),_0x5b01df[_0x4283('0x27')]);this[_0x4283('0xb2')](_0x5b01df,0x1);}else if(ifInterval(_0x5b01df[_0x4283('0x1c2')],_0x5b01df[_0x4283('0x27')])){this[_0x4283('0xb2')](_0x5b01df,0x1);loggerPredictiveCalls['info'](_0x4283('0x1c3'),_0x5b01df['startProgressive'],_0x5b01df[_0x4283('0x45')]);_0x5b01df[_0x4283('0x58')]=0x0;_0x5b01df[_0x4283('0xd0')]=0x0;}else if(_0x572d85<_0x1a92ac&&_0x5b01df[_0x4283('0x1c4')]==='dropRate'){clearPredictiveAttributes(_0x5b01df);loggerPredictive['info'](_0x4283('0x1c5'),'Dropped\x20calls\x20day',_0x1a92ac,_0x4283('0x27'),_0x5b01df[_0x4283('0x45')]);}else if(_0x8d0d7a<_0x5b01df['predictiveIntervalErlangCallsDroppedCalls']&&_0x5b01df[_0x4283('0x1c4')]==='dropRate'){clearPredictiveAttributes(_0x5b01df);loggerPredictive[_0x4283('0x48')](_0x4283('0x1c6'),_0x4283('0x1c7'),_0x8d0d7a,'Drop\x20in\x20this\x20interval',_0x5b01df[_0x4283('0xd0')],_0x4283('0x27'),_0x5b01df[_0x4283('0x45')]);}else if(!ifInterval(_0x5b01df[_0x4283('0x1c2')],_0x5b01df['startProgressive'])&&_[_0x4283('0x3d')](_0x5b01df[_0x4283('0x60')])&&!_['isUndefined'](_0x5b01df[_0x4283('0x27')])){_0x5b01df['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4283('0x48')](_0x5b01df[_0x4283('0x45')],'started\x20in\x20predictive\x20at',_0x5b01df['startPredictive']);hopperUtils[_0x4283('0x1c8')](_0x5b01df['dialPredictiveInterval'])[_0x4283('0x3b')](this[_0x4283('0x1c9')](_0x5b01df))['then'](mergeDataErlangB(_0x5b01df))[_0x4283('0x3b')](this[_0x4283('0x1ca')](_0x5b01df))[_0x4283('0xa0')](loggerCatchPredictive(_0x4283('0x1cb'),_0x5b01df));}else if(!ifInterval(_0x5b01df[_0x4283('0x1c2')],_0x5b01df['startPredictive'])){_0x5b01df['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x5b01df[_0x4283('0x60')]=moment()[_0x4283('0x43')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x5b01df[_0x4283('0x45')],_0x4283('0x1cc'),_0x5b01df['startPredictive']);clearInterval(_0x5b01df[_0x4283('0x62')]);_0x5b01df[_0x4283('0x62')]=undefined;hopperUtils['avgHandleTime'](_0x5b01df[_0x4283('0x1c2')])[_0x4283('0x3b')](this[_0x4283('0x1c9')](_0x5b01df))[_0x4283('0x3b')](mergeDataErlangB(_0x5b01df))[_0x4283('0x3b')](this['startMethodPredictive'](_0x5b01df))[_0x4283('0xa0')](loggerCatchPredictive(_0x4283('0x1cd'),_0x5b01df));}else if(_0x5b01df[_0x4283('0x1b7')]&&_0x2e777b<_0x5b01df[_0x4283('0x1b7')]-_0x4723e7){clearPredictiveAttributes(_0x5b01df);loggerPredictive[_0x4283('0x48')](_0x5b01df[_0x4283('0x45')],_0x4283('0x1ce'),_0x2e777b,_0x4283('0x1cf'),_0x5b01df[_0x4283('0x1b7')],'-',_0x4723e7,'=',_0x5b01df['predictiveIntervalAvailable']-_0x4723e7,')');}else if(_0x5b01df[_0x4283('0x1b7')]&&_0x2e777b>_0x5b01df[_0x4283('0x1b7')]+_0x34f981){clearPredictiveAttributes(_0x5b01df);loggerPredictive['info'](_0x5b01df[_0x4283('0x45')],_0x4283('0x1ce'),_0x2e777b,_0x4283('0x1d0'),_0x5b01df[_0x4283('0x1b7')],'+',_0x34f981,'=',_0x5b01df[_0x4283('0x1b7')]+_0x34f981,')');}};Dialer['prototype'][_0x4283('0x1c9')]=function(_0x1df523){var _0x3ab2e4=this;return function(_0x409b95){return new Promise(function(_0xd47c94,_0x592136){_[_0x4283('0x5e')](_0x1df523,_0x409b95[0x0]);if(checkGetDataPredictive(_0x409b95[0x0])){var _0x2b83da=_0x1df523[_0x4283('0x1b7')]=_0x1df523[_0x4283('0x1bb')]+_0x1df523['available'];var _0x865006=_0x1df523[_0x4283('0x1c2')]*0x3c;var _0x3e4466=_0x409b95[0x0]['predictiveIntervalAvgTalktime']+_0x409b95[0x0]['predictiveIntervalAvgHoldtime'];var _0x3824e9=(_0x409b95[0x0][_0x4283('0x4b')]+_0x409b95[0x0][_0x4283('0x4d')]+_0x409b95[0x0][_0x4283('0x4e')])/_0x409b95[0x0][_0x4283('0x4a')];_0x1df523[_0x4283('0x1d1')]=_0x3824e9>0x0?_0x3824e9:0x1;switch(_0x1df523[_0x4283('0x1c4')]){case _0x4283('0x1d2'):var _0x1b8632=_0x1df523[_0x4283('0x1b5')]/0x64;return _0x3ab2e4[_0x4283('0x1d3')](_0x2b83da,_0x865006,_0x3e4466,_0x3824e9,_0x1b8632)[_0x4283('0x3b')](function(_0x92e9b7){return _0xd47c94(_0x92e9b7);});case _0x4283('0x1d4'):var _0x58addd=_0x1df523['dialPredictiveOptimizationPercentage']/0x64;return _0x3ab2e4['busyFactor'](_0x2b83da,_0x865006,_0x3e4466,_0x3824e9,_0x58addd)[_0x4283('0x3b')](function(_0x15febd){return _0xd47c94(_0x15febd);});default:return _0x592136(msgResponse(_0x4283('0x1d5'),'Failure','Unknown\x20Predictive'));}}else{return _0x592136(msgResponse(_0x4283('0x1d5'),'Failure',_0x4283('0x1d6')));}});};};Dialer[_0x4283('0x18')][_0x4283('0x1d7')]=function(_0x5b38c5){var _0x483e89=this;return function(_0x46eb6c){return new Promise(function(_0x308a42,_0x5025da){_[_0x4283('0x5e')](_0x5b38c5,_0x46eb6c[0x0]);if(checkGetDataPredictive(_0x46eb6c[0x0])){loggerPredictive[_0x4283('0x48')](JSON[_0x4283('0x74')](_0x46eb6c[0x0]));if(_0x5b38c5[_0x4283('0x1c4')]===_0x4283('0x1d2')){return _0x483e89[_0x4283('0x14c')](_0x5b38c5['id'])[_0x4283('0x3b')](function(_0x184d12){var _0x46d150=_0x5b38c5[_0x4283('0x1d8')]-_0x184d12[0x0][_0x4283('0x1d9')];var _0x33f59d=_0x5b38c5[_0x4283('0x1c2')]*0x3c;var _0x174832=_0x46eb6c[0x0]['predictiveIntervalAvgTalktime']+_0x46eb6c[0x0][_0x4283('0x53')];var _0x3c520a=(_0x46eb6c[0x0][_0x4283('0x4b')]+_0x46eb6c[0x0][_0x4283('0x4d')]+_0x46eb6c[0x0][_0x4283('0x4e')])/_0x46eb6c[0x0][_0x4283('0x4a')];var _0x48b4de=_0x5b38c5[_0x4283('0x1b5')]/0x64;_0x5b38c5[_0x4283('0x1da')]=_0x184d12[0x0][_0x4283('0x1d9')]||0x0;_0x5b38c5['predictiveIntervalHitRate']=_0x3c520a>0x0?_0x3c520a:0x1;return _0x483e89[_0x4283('0x1d3')](_0x46d150,_0x33f59d,_0x174832,_0x3c520a,_0x48b4de);})[_0x4283('0x3b')](function(_0x468d11){return _0x308a42(_0x468d11);})[_0x4283('0xa0')](function(_0x424459){return _0x5025da(msgResponse(_0x4283('0x1db'),'Failure',JSON[_0x4283('0x74')](_0x424459)));});}if(_0x5b38c5[_0x4283('0x1c4')]===_0x4283('0x1d4')){return _0x483e89[_0x4283('0x14c')](_0x5b38c5['id'])[_0x4283('0x3b')](function(_0x59661b){var _0xd9ac47=_0x5b38c5[_0x4283('0x1d8')]-_0x59661b[0x0][_0x4283('0x1d9')];var _0x60c4c8=_0x5b38c5[_0x4283('0x1c2')]*0x3c;var _0x50aecd=_0x46eb6c[0x0]['predictiveIntervalAvgTalktime']+_0x46eb6c[0x0][_0x4283('0x53')];var _0x1a6b8f=(_0x46eb6c[0x0][_0x4283('0x4b')]+_0x46eb6c[0x0][_0x4283('0x4d')]+_0x46eb6c[0x0][_0x4283('0x4e')])/_0x46eb6c[0x0][_0x4283('0x4a')];var _0x59f487=_0x5b38c5[_0x4283('0x1b5')]/0x64;_0x5b38c5[_0x4283('0x1da')]=_0x59661b[0x0][_0x4283('0x1d9')]||0x0;_0x5b38c5[_0x4283('0x1d1')]=_0x1a6b8f>0x0?_0x1a6b8f:0x1;return _0x483e89['busyFactor'](_0xd9ac47,_0x60c4c8,_0x50aecd,_0x1a6b8f,_0x59f487);})[_0x4283('0x3b')](function(_0x2e4d9c){return _0x308a42(_0x2e4d9c);})[_0x4283('0xa0')](function(_0x5aee88){return _0x5025da(msgResponse('[CatchErlangB]',_0x4283('0x93'),JSON[_0x4283('0x74')](_0x5aee88)));});}}else{return _0x5025da(msgResponse(_0x4283('0x1d5'),_0x4283('0x93'),_0x4283('0x1d6')));}});};};Dialer['prototype'][_0x4283('0x1ca')]=function(_0x466e2d){var _0x48b9bb=this;return function(){var _0x28bf30=0x0;var _0xe78bf3=Math[_0x4283('0x1bc')](_0x466e2d[_0x4283('0x59')]*0x3e8);if(_0xe78bf3>0x0){_0xe78bf3=_0xe78bf3<0x64?0x64:_0xe78bf3;loggerPredictive['info'](_0x466e2d[_0x4283('0x45')],'one\x20call\x20every:',_0xe78bf3,_0x4283('0x1dc'));_0x466e2d[_0x4283('0x62')]=setInterval(function(){_0x48b9bb[_0x4283('0x62')](_0x466e2d);loggerPredictiveCalls[_0x4283('0x48')](_0x4283('0x1dd'),_0x28bf30+=0x1);},_0xe78bf3);}else{loggerPredictive[_0x4283('0x48')](_0x466e2d['name'],_0x4283('0x1de'));}};};Dialer[_0x4283('0x18')][_0x4283('0x1df')]=function(_0xa27566,_0x549d28){var _0x522367=this;return function(_0x579be6){if(_[_0x4283('0x47')](_0x579be6)){if(_[_0x4283('0xf3')](_0x549d28[_0x4283('0x152')])||!_0x549d28['recallme']){if(_0xa27566[_0x4283('0xaf')]===_0x4283('0x7')){_0xa27566[_0x4283('0x72')]=_[_0x4283('0x3d')](_0xa27566['queueStatusComplete'])?!![]:_0xa27566['queueStatusComplete'];var _0x4fddfa=uuid['v4']();_0x522367[_0x4283('0x23')][_0x4fddfa]=new Action(_0xa27566,_0x549d28,_0x4fddfa);loggerBooked[_0x4283('0x48')](_0x4283('0x1e0'),_0x4fddfa,_0x4283('0x1e1'),JSON[_0x4283('0x74')](_0xa27566[_0x4283('0x72')]),'Queue:\x20',_0xa27566[_0x4283('0x45')]);if(_0xa27566[_0x4283('0x72')]){_0xa27566[_0x4283('0x72')]=![];_0x522367[_0x4283('0x28')][_0x522367[_0x4283('0x23')][_0x4fddfa][_0x4283('0xbe')]]=[];ami['Action']({'actionid':_0x4fddfa,'action':'queuestatus','queue':_0xa27566[_0x4283('0x45')]})[_0x4283('0xa0')](function(){_0x522367[_0x4283('0xc1')](_0xa27566);hopperUtils[_0x4283('0xda')]({'active':![],'ContactId':_0x522367[_0x4283('0x23')][_0x4fddfa][_0x4283('0xdb')],'ListId':_0x522367[_0x4283('0x23')][_0x4fddfa][_0x4283('0xdc')],'VoiceQueueId':_0x522367[_0x4283('0x23')][_0x4fddfa]['VoiceQueueId']||undefined,'CampaignId':_0x522367[_0x4283('0x23')][_0x4fddfa]['CampaignId']||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x1e2')));delete _0x522367[_0x4283('0x23')][_0x4fddfa];});}else{loggerBooked[_0x4283('0x48')](_0x4283('0x1e3'),JSON[_0x4283('0x74')](_0xa27566[_0x4283('0x72')]),_0x4283('0x1e4'),_0xa27566['name']);_0x522367[_0x4283('0xc1')](_0xa27566);hopperUtils[_0x4283('0xda')]({'active':![],'ContactId':_0x522367[_0x4283('0x23')][_0x4fddfa]['ContactId'],'ListId':_0x522367[_0x4283('0x23')][_0x4fddfa][_0x4283('0xdc')],'VoiceQueueId':_0x522367[_0x4283('0x23')][_0x4fddfa]['VoiceQueueId']||undefined,'CampaignId':_0x522367[_0x4283('0x23')][_0x4fddfa]['CampaignId']||undefined})['catch'](loggerCatch(_0x4283('0x1e2')));delete _0x522367[_0x4283('0x23')][_0x4fddfa];}}else{return _0x522367[_0x4283('0x1e5')](_0xa27566,_0x549d28);}}else{if(utils[_0x4283('0x1e6')](undefined,_0x549d28[_0x4283('0x1e7')])<_0xa27566['dialRecallMeTimeout']*0x3c){if(_0x549d28[_0x4283('0x143')]&&!_0x549d28[_0x4283('0x143')][_0x4283('0x1e8')]){_0x522367[_0x4283('0xfe')][_0x4283('0xf7')](_0x549d28['id'])[_0x4283('0x1b')](function(){_0x522367[_0x4283('0xc1')](_0xa27566);});}else{hopperUtils['unlockContact']({'active':![]},_0x549d28['id'],0x1)['finally'](function(){_0x522367[_0x4283('0xc1')](_0xa27566);});}}else{_0xa27566[_0x4283('0x1e9')]+=0x1;_0x522367[_0x4283('0xc1')](_0xa27566);if(_0xa27566[_0x4283('0x1ea')]){hopperUtils[_0x4283('0xda')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x549d28[_0x4283('0xdb')],'ListId':_0x549d28[_0x4283('0xdc')],'VoiceQueueId':_0x549d28[_0x4283('0xdd')]||undefined,'CampaignId':_0x549d28['CampaignId']||undefined})[_0x4283('0xa0')](loggerCatch(_0x4283('0x1eb')));hopperUtils[_0x4283('0xc9')](createObjHistory(_0xa27566,_0x549d28,utils[_0x4283('0x6b')][_0x4283('0x1ec')],0x17,'RecallInQueue'))[_0x4283('0xa0')](loggerCatch(_0x4283('0x1ed')));}else{_0x522367[_0x4283('0x116')](createObjHistory(_0xa27566,_0x549d28,utils[_0x4283('0x6b')][_0x4283('0x1ee')],0x16,'RecallFailedTimeout'),_0x4283('0x1ef'),_0x4283('0x1f0'));}}}}else{_0xa27566[_0x4283('0x1f1')]+=0x1;_0x522367[_0x4283('0x116')](createObjHistory(_0xa27566,_0x549d28,utils[_0x4283('0x6b')][_0x4283('0x1f2')],0xd,'Blacklist'),_0x4283('0x1f3'),'[Originate][MoveBlacklist]');throw _0x4283('0x1f4');}};};Dialer[_0x4283('0x18')][_0x4283('0x154')]=function(_0x42e5a2){var _0x3f0c35=this;var _0x10cf27=_0x42e5a2[_0x4283('0x1f5')]-_0x42e5a2['originated'];emitCampaignSummary(_0x42e5a2);if(_0x10cf27>0x0&&_0x42e5a2[_0x4283('0x1f6')]==0x0){if(_0x10cf27>this[_0x4283('0x21')]){_0x10cf27=this[_0x4283('0x21')];}_0x42e5a2[_0x4283('0x1f6')]=0x1;hopperUtils[_0x4283('0x1f7')](_0x42e5a2,_0x10cf27)[_0x4283('0x3b')](function(_0x4df7b0){_0x42e5a2['temp']=0x0;if(_0x4df7b0){if(!utils['checkContactEmpty'](_0x4df7b0)){_0x42e5a2[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x6c')];logger['info']('[getContactCampaign2][Empty]'+_0x42e5a2[_0x4283('0x45')]);}else{_0x42e5a2['originated']+=_0x4df7b0[_0x4283('0x140')];_0x42e5a2[_0x4283('0x67')]=utils[_0x4283('0x6b')][_0x4283('0x1f8')];for(var _0x532bb9=0x0;_0x532bb9<_0x4df7b0[_0x4283('0x140')];_0x532bb9+=0x1){_0x42e5a2[_0x4283('0x1f9')]+=0x1;if(_['isNil'](_0x4df7b0[_0x532bb9])||_['isNil'](_0x4df7b0[_0x532bb9]['Contact'])||_[_0x4283('0xf3')](_0x4df7b0[_0x532bb9][_0x4283('0x158')])){_0x3f0c35[_0x4283('0x150')]('[actionOriginate]\x20',_0x42e5a2,_0x4df7b0[_0x532bb9]);}else{hopperUtils[_0x4283('0x1fa')](_[_0x4283('0x75')](_0x4df7b0[_0x532bb9],[_0x4283('0xde'),_0x4283('0x158')]))[_0x4283('0x3b')](_0x3f0c35[_0x4283('0x1df')](_0x42e5a2,_0x4df7b0[_0x532bb9]))[_0x4283('0xa0')](_0x3f0c35[_0x4283('0x14f')](_0x4283('0x1fb'),_0x42e5a2));}}}}})[_0x4283('0xa0')](loggerGetContactDialer('[getContactCampaign2]',_0x42e5a2,_0x10cf27));}};Dialer['prototype'][_0x4283('0xb2')]=function(_0x3d7fd9,_0x586627){var _0x2209a3=this;var _0x46bbc2=[];if(_0x586627<0x1||_0x3d7fd9[_0x4283('0xaf')]==='booked'){_0x586627=0x1;}var _0x5abc25=Math[_0x4283('0x1bc')](_0x3d7fd9[_0x4283('0x136')]*_0x586627)-_0x3d7fd9[_0x4283('0x80')];if(_0x3d7fd9[_0x4283('0x1fc')]>0x0){var _0xf73d0f=_0x3d7fd9[_0x4283('0x1fc')]-_0x3d7fd9[_0x4283('0x80')]-_0x3d7fd9[_0x4283('0x1bb')]-_0x3d7fd9[_0x4283('0x137')];if(_0x5abc25>_0xf73d0f){_0x5abc25=_0xf73d0f;}}if(_0x5abc25>0x0&&_0x3d7fd9[_0x4283('0x1f6')]==0x0){if(_0x3d7fd9[_0x4283('0xaf')]===_0x4283('0x7')){_0x5abc25=0x1;}if(_0x5abc25>this[_0x4283('0x21')]){_0x5abc25=this[_0x4283('0x21')];}for(var _0x472129 in this[_0x4283('0x1f')]){if(typeof this['agents'][_0x472129]!==_0x4283('0xaa')){if(this[_0x4283('0x1f')][_0x472129]['state']===_0x4283('0x1fd')&&this[_0x4283('0x1f')][_0x472129]['status']==='reachable'){_0x46bbc2[_0x4283('0xa1')](this['agents'][_0x472129]['id']);}}}_0x3d7fd9['temp']=0x1;hopperUtils[_0x4283('0x1fe')](_0x3d7fd9,_0x46bbc2,_0x5abc25)[_0x4283('0x3b')](function(_0x2ec5f9){_0x3d7fd9[_0x4283('0x1f6')]=0x0;if(_0x2ec5f9){if(!utils[_0x4283('0x1ff')](_0x2ec5f9)){hopperUtils['countReScheduled'](_0x3d7fd9)[_0x4283('0x3b')](sendMessageReschedule(_0x3d7fd9))[_0x4283('0xa0')](loggerCatch(_0x4283('0x200')));}else{_0x3d7fd9[_0x4283('0x80')]+=_0x2ec5f9[_0x4283('0x140')];_0x3d7fd9[_0x4283('0x67')]=_0x3d7fd9[_0x4283('0xaf')]===_0x4283('0x7')?utils['CAMPAIGN_STATUS'][_0x4283('0x138')]:utils[_0x4283('0x6b')][_0x4283('0x1f8')];for(var _0x538c1a=0x0;_0x538c1a<_0x2ec5f9[_0x4283('0x140')];_0x538c1a+=0x1){if(_[_0x4283('0xf3')](_0x2ec5f9[_0x538c1a])||_['isNil'](_0x2ec5f9[_0x538c1a][_0x4283('0x171')])||_[_0x4283('0xf3')](_0x2ec5f9[_0x538c1a][_0x4283('0x158')])){_0x2209a3[_0x4283('0x150')]('[actionOriginate]\x20',_0x3d7fd9,_0x2ec5f9[_0x538c1a]);}else{hopperUtils[_0x4283('0x201')](_[_0x4283('0x75')](_0x2ec5f9[_0x538c1a],[_0x4283('0xdd'),_0x4283('0x158')]))[_0x4283('0x3b')](_0x2209a3[_0x4283('0x1df')](_0x3d7fd9,_0x2ec5f9[_0x538c1a]))[_0x4283('0xa0')](_0x2209a3[_0x4283('0x14f')]('[actionOriginate]\x20',_0x3d7fd9));}}}}})['catch'](loggerGetContactDialer(_0x4283('0x202'),_0x3d7fd9,_0x5abc25));}};Dialer[_0x4283('0x18')]['handlePredictive']=function(_0x3b19e6){if(_0x3b19e6['dialLimitQueue']>0x0){var _0x3eb6d7=_0x3b19e6[_0x4283('0x1fc')]-_0x3b19e6[_0x4283('0x80')]-_0x3b19e6[_0x4283('0x1bb')];if(_0x3eb6d7>0x0&&_0x3b19e6[_0x4283('0x1f6')]==0x0){this[_0x4283('0x203')](_0x3b19e6);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x4283('0x203')](_0x3b19e6);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x340428){var _0x43ceab=this;var _0x352a6f=[];_0x340428[_0x4283('0x80')]+=0x1;for(var _0x1b9ae8 in this[_0x4283('0x1f')]){if(typeof this[_0x4283('0x1f')][_0x1b9ae8]!==_0x4283('0xaa')){if(this[_0x4283('0x1f')][_0x1b9ae8][_0x4283('0x6e')]===_0x4283('0x1fd')&&this['agents'][_0x1b9ae8][_0x4283('0x88')]===_0x4283('0x89')){_0x352a6f[_0x4283('0xa1')](this[_0x4283('0x1f')][_0x1b9ae8]['id']);}}}_0x340428[_0x4283('0x1f6')]=0x1;return this[_0x4283('0x1fe')](_0x340428['id'],_0x352a6f,0x1,_0x340428[_0x4283('0x204')],_0x340428)['then'](function(_0x35ed18){_0x340428[_0x4283('0x1f6')]=0x1;if(_0x35ed18){if(!utils[_0x4283('0x1ff')](_0x35ed18)){utils[_0x4283('0x66')](_0x340428,0x1,0x0);return hopperUtils[_0x4283('0x205')](_0x340428)[_0x4283('0x3b')](sendMessageReschedule(_0x340428))[_0x4283('0xa0')](loggerCatch(_0x4283('0x200')));}else{_0x340428['message']=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0x4283('0xf3')](_0x35ed18[0x0])||_[_0x4283('0xf3')](_0x35ed18[0x0]['Contact'])||_[_0x4283('0xf3')](_0x35ed18[0x0][_0x4283('0x158')])){_0x43ceab[_0x4283('0x150')]('[actionOriginate]\x20',_0x340428,_0x35ed18[0x0]);}else{return hopperUtils[_0x4283('0x201')](_[_0x4283('0x75')](_0x35ed18[0x0],['VoiceQueueId',_0x4283('0x158')]))[_0x4283('0x3b')](_0x43ceab[_0x4283('0x1df')](_0x340428,_0x35ed18[0x0]))[_0x4283('0xa0')](_0x43ceab['loggerHandler'](_0x4283('0x206'),_0x340428));}}}})['catch'](loggerGetContactDialer(_0x4283('0x207'),_0x340428,0x1));};Dialer[_0x4283('0x18')]['abandonmentRate']=function(_0x518d91,_0xee3f5e,_0x2967b8,_0x4d6162,_0x413533,_0x224f8f){loggerPredictive[_0x4283('0x48')](_0x4283('0x208'));loggerPredictive['info'](_0x4283('0x209'),_0x518d91);loggerPredictive['info'](_0x4283('0x20a'),_0xee3f5e);loggerPredictive[_0x4283('0x48')]('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',_0x2967b8);loggerPredictive[_0x4283('0x48')]('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',_0x4d6162);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',_0x413533);loggerPredictive['info'](_0x4283('0x51'));return new Promise(function(_0x2d726f,_0x235415){if(_0x518d91<=0x0||isNaN(_0x518d91)){return _0x235415(msgResponse(_0x4283('0x20b'),_0x4283('0x85'),_0x4283('0x20c')+_0x518d91));}if(_0x2967b8<=0x0||isNaN(_0x2967b8)){return _0x235415(msgResponse('[abandonmentRate]',_0x4283('0x85'),'Ts\x20=\x20'+_0x2967b8));}if(_0x4d6162<=0x0||isNaN(_0x4d6162)){return _0x235415(msgResponse(_0x4283('0x20b'),_0x4283('0x85'),'p\x20=\x20'+_0x4d6162));}if(_0xee3f5e<=0x0||isNaN(_0xee3f5e)){return _0x235415(msgResponse(_0x4283('0x20b'),'Error',_0x4283('0x20d')+_0xee3f5e));}if(_0x413533<=0x0||isNaN(_0x413533)){return _0x235415(msgResponse(_0x4283('0x20b'),_0x4283('0x85'),_0x4283('0x20e')+_0x413533));}_0x224f8f=_0x224f8f||0x0;var _0x5d2a2a=0x1/_0x2967b8;var _0x5d8c8e=0x0;var _0x2b610b=0x0;var _0x4336ad=0x0;var _0x23d554=0x0;for(var _0x5bbf9b=0x0;_0x4336ad<_0x413533;_0x5bbf9b+=0x1){_0x2b610b=_0x5bbf9b/_0xee3f5e;_0x5d8c8e=(_0x4d6162*_0x2b610b+_0x224f8f)/_0x5d2a2a;_0x4336ad=utils[_0x4283('0x20f')](_0x5d8c8e,_0x518d91);_0x23d554=_0x5d8c8e/_0x518d91*(0x1-utils[_0x4283('0x20f')](_0x5d8c8e,_0x518d91));}return _0x2d726f({'erlangCalls':_0x5bbf9b,'erlangCallToSecond':_0xee3f5e/_0x5bbf9b,'erlangAbandonmentRate':_0x4336ad,'erlangBusyFactor':_0x23d554});});};Dialer['prototype'][_0x4283('0x210')]=function(_0x2a0b53,_0x324125,_0x2b440c,_0x192523,_0x2983f0,_0x2bf914){loggerPredictive[_0x4283('0x48')](_0x4283('0x211'));loggerPredictive[_0x4283('0x48')]('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',_0x2a0b53);loggerPredictive[_0x4283('0x48')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x324125);loggerPredictive['info']('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',_0x2b440c);loggerPredictive[_0x4283('0x48')](_0x4283('0x212'),_0x192523);loggerPredictive['info'](_0x4283('0x213'),_0x2983f0);loggerPredictive[_0x4283('0x48')](_0x4283('0x51'));return new Promise(function(_0x53d46f,_0x360e9b){if(_0x2a0b53<=0x0||isNaN(_0x2a0b53)){return _0x360e9b(msgResponse(_0x4283('0x214'),'Error',_0x4283('0x20c')+_0x2a0b53));}if(_0x2b440c<=0x0||isNaN(_0x2b440c)){return _0x360e9b(msgResponse(_0x4283('0x214'),'Error',_0x4283('0x215')+_0x2b440c));}if(_0x192523<=0x0||isNaN(_0x192523)){return _0x360e9b(msgResponse(_0x4283('0x214'),'Error','p\x20=\x20'+_0x192523));}if(_0x324125<=0x0||isNaN(_0x324125)){return _0x360e9b(msgResponse('[busyFactor]','Error',_0x4283('0x20d')+_0x324125));}if(_0x2983f0<=0x0||isNaN(_0x2983f0)){return _0x360e9b(msgResponse('[busyFactor]',_0x4283('0x85'),_0x4283('0x216')+_0x2983f0));}_0x2bf914=_0x2bf914||0x0;var _0x1d5f58=0x1/_0x2b440c;var _0x13970a=0x0;var _0x23e6da=0x0;var _0x5a6ea8=0x0;var _0x1bf111=0x0;for(var _0x41a0a4=0x0;_0x1bf111<_0x2983f0;_0x41a0a4+=0x1){_0x23e6da=_0x41a0a4/_0x324125;_0x13970a=(_0x192523*_0x23e6da+_0x2bf914)/_0x1d5f58;_0x5a6ea8=utils[_0x4283('0x20f')](_0x13970a,_0x2a0b53);_0x1bf111=_0x13970a/_0x2a0b53*(0x1-utils[_0x4283('0x20f')](_0x13970a,_0x2a0b53));}return _0x53d46f({'erlangCalls':_0x41a0a4,'erlangCallToSecond':_0x324125/_0x41a0a4,'erlangAbandonmentRate':_0x5a6ea8,'erlangBusyFactor':_0x1bf111});});};module[_0x4283('0x217')]=Dialer; \ No newline at end of file +var _0xa368=['assign','throttle','filter','dialPreviewRecallmeReminder','online','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','setXMDContactVariables','Contact','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','finally','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMinThreshold','talking','floor','erlangCalls','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalHitRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[getDataPredictive]','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALL_TIMEOUT','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','[getContactDialer2]','dialOrderByScheduledAt','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','util','uuid','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','originateresponse','syncOriginateResponse','bind','agentcomplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\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','---------------------------','predictiveIntervalTotalCalls','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','inspect','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','active','status','reachable','SIP/%s','checkIsTrunkReachable','isTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','command','interval','content','indexOf','true','catch','push','iftime\x20%s,%s','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','syncCampaigns','undefined','campaigns','isIVRCampaign','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','intervalIftime','\x20Interval\x20is\x20overtime:\x20','isGlobal','AMI\x20IfTime','queue','uniqueid','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','ivr','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','dialDropMaxRetry','rescheduleContact','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','queueCallerAbandonCreateState','add','ContactId','calleridname','[syncAgentComplete][createHistory][11]','actions','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','AMD','buildObj','amd','MACHINE','outboundAnswerAgiCallsDay','Machine','emit','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','membername','saveInDb','[syncHangupInAMDIvr]','countnoanswerretry','countagentrejectretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','outboundUnknownCallsDay','Unknow','running','statusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue'];(function(_0x5bc643,_0x2b786c){var _0x17e109=function(_0x3a1026){while(--_0x3a1026){_0x5bc643['push'](_0x5bc643['shift']());}};_0x17e109(++_0x2b786c);}(_0xa368,0xd3));var _0x8a36=function(_0x383255,_0x57edb2){_0x383255=_0x383255-0x0;var _0x4e2f00=_0xa368[_0x383255];return _0x4e2f00;};'use strict';var util=require(_0x8a36('0x0'));var _=require('lodash');var uuid=require(_0x8a36('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require(_0x8a36('0x2'));var ut=require(_0x8a36('0x3'));var config=require(_0x8a36('0x4'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x8a36('0x5'))(_0x8a36('0x6'));var loggerPredictive=require(_0x8a36('0x5'))(_0x8a36('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0x8a36('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x8a36('0x9'));var ami=require(_0x8a36('0xa'));config['redis']=_[_0x8a36('0xb')](config[_0x8a36('0xc')],{'host':_0x8a36('0xd'),'port':0x18eb});var io=require(_0x8a36('0xe'))(new Redis(config[_0x8a36('0xc')]));var cmHopper=require(_0x8a36('0xf'));var voiceQueueRt=require(_0x8a36('0x10'));var RpcSetting=require(_0x8a36('0x11'));var Interval=require(_0x8a36('0x12'));var Action=require(_0x8a36('0x13'));var History=require('./models/history');var Final=require(_0x8a36('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x8a36('0x15'));var Hangup=require(_0x8a36('0x16'));var ipAgi=process['env'][_0x8a36('0x17')]||_0x8a36('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8a36('0x19')][_0x8a36('0x1a')]=function(_0x5a3dfb){this[_0x8a36('0x1b')]=this[_0x8a36('0x1b')]?this['tail']['finally'](_0x5a3dfb):_0x5a3dfb();};function Dialer(_0x12a01b,_0x49cdcb){this[_0x8a36('0x1c')]=new Sequence();this[_0x8a36('0x1d')]=_0x49cdcb;this[_0x8a36('0x1e')]=_0x12a01b[_0x8a36('0x1e')];this['campaigns']=_0x12a01b['campaigns'];this[_0x8a36('0x1f')]=_0x12a01b[_0x8a36('0x1f')];this[_0x8a36('0x20')]=_0x12a01b[_0x8a36('0x20')];this[_0x8a36('0x21')]=config[_0x8a36('0x21')]||0x2;this[_0x8a36('0x22')]={};this['actions']={};this[_0x8a36('0x23')]={};this[_0x8a36('0x24')]={};this[_0x8a36('0x25')]={};this[_0x8a36('0x26')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x8a36('0x27')]={};this[_0x8a36('0x28')]={};this[_0x8a36('0x29')]={};ami['on'](_0x8a36('0x2a'),this[_0x8a36('0x2b')]['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x8a36('0x2c'),this[_0x8a36('0x2d')][_0x8a36('0x2e')](this));ami['on'](_0x8a36('0x2f'),this['syncAgentComplete'][_0x8a36('0x2e')](this));ami['on']('custom:queuesummary',this[_0x8a36('0x9')][_0x8a36('0x2e')](this));ami['on'](_0x8a36('0x30'),this[_0x8a36('0x31')]['bind'](this));ami['on'](_0x8a36('0x32'),this[_0x8a36('0x33')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x8a36('0x2e')](this));ami['on'](_0x8a36('0x34'),this[_0x8a36('0x35')][_0x8a36('0x2e')](this));ami['on'](_0x8a36('0x36'),this[_0x8a36('0x37')][_0x8a36('0x2e')](this));ami['on'](_0x8a36('0x38'),this[_0x8a36('0x39')][_0x8a36('0x2e')](this));this[_0x8a36('0x3a')]();this['loopClearZombieChannels']();RpcSetting[_0x8a36('0x3b')]()[_0x8a36('0x3c')](function(_0x3e2e7c){previewRecallmeReminderInterval=_0x3e2e7c[_0x8a36('0x3d')];});}function isNotNull(_0x1d7c21){return _0x1d7c21!==null&&!_['isUndefined'](_0x1d7c21);}function msgResponse(_0x2b65b3,_0x30872b,_0x24773f){return{'action':_0x2b65b3,'response':_0x30872b,'message':_0x24773f,'stack':_0x24773f};}function emit(_0x353061,_0x386859,_0x3b279d){io['to'](_0x353061)['emit'](_0x386859,_0x3b279d);}function emitOutboundVoiceQueueSummary(_0x189ddd){if(_0x189ddd[_0x8a36('0x3e')]===_0x8a36('0x3f')){logger['debug'](_0x8a36('0x40'),util['inspect'](_0x189ddd,{'showHidden':![],'depth':null}));emit(util[_0x8a36('0x41')](_0x8a36('0x42'),_0x189ddd[_0x8a36('0x43')]),_0x8a36('0x44'),_0x189ddd);}}function checkGetDataPredictive(_0xed0617){if(isNotNull(_0xed0617)&&!_[_0x8a36('0x45')](_0xed0617)){loggerPredictive['info'](_0x8a36('0x46'));loggerPredictive['info'](_0x8a36('0x47'),_0xed0617['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x8a36('0x48'),_0xed0617[_0x8a36('0x49')]);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x4b'),_0xed0617['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x4c'),_0xed0617[_0x8a36('0x4d')]);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x4e'),_0xed0617['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x4f'),_0xed0617[_0x8a36('0x50')]);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x51'));if(_0xed0617[_0x8a36('0x52')]>0x0){if(!_[_0x8a36('0x53')](_0xed0617[_0x8a36('0x50')])&&_0xed0617[_0x8a36('0x50')]>0x0){return!![];}loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x54'));if(!_[_0x8a36('0x53')](_0xed0617[_0x8a36('0x55')])&&_0xed0617[_0x8a36('0x55')]>0x0){return!![];}loggerPredictive[_0x8a36('0x4a')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x8a36('0x56'));}}else{loggerPredictive[_0x8a36('0x4a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2bc57d){return function(_0x39d619){loggerPredictive[_0x8a36('0x4a')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x8a36('0x57'),_0x39d619['erlangCalls']);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x58'),_0x39d619[_0x8a36('0x59')]);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x5a'),_0x39d619[_0x8a36('0x5b')]);loggerPredictive['info'](_0x8a36('0x5c'),_0x39d619[_0x8a36('0x5d')]);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x5a'),_0x39d619[_0x8a36('0x5b')]);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x51'));_[_0x8a36('0x5e')](_0x2bc57d,_0x39d619);};}function ifInterval(_0x5a6b9a,_0x212a6e){if(_[_0x8a36('0x53')](_0x212a6e)){return![];}return utils[_0x8a36('0x5f')](undefined,_0x212a6e)<_0x5a6b9a*0x3c;}function clearPredictiveAttributes(_0x492d99){if(_0x492d99[_0x8a36('0x60')]){_0x492d99[_0x8a36('0x60')]=undefined;loggerPredictive['debug'](_0x492d99[_0x8a36('0x43')],_0x8a36('0x61'));}if(_0x492d99['startPredictive']){_0x492d99['startPredictive']=undefined;loggerPredictive[_0x8a36('0x62')](_0x492d99[_0x8a36('0x43')],_0x8a36('0x63'));}if(_0x492d99[_0x8a36('0x64')]){clearInterval(_0x492d99['handlePredictive']);_0x492d99[_0x8a36('0x64')]=undefined;loggerPredictive[_0x8a36('0x62')](_0x492d99[_0x8a36('0x43')],_0x8a36('0x65'));}}function loggerCatchPredictive(_0x53a281,_0x1c6e18){return function(_0x4d9f34){loggerPredictive[_0x8a36('0x66')](_0x1c6e18['name'],_0x53a281);loggerPredictive[_0x8a36('0x66')](_0x4d9f34['stack']);clearPredictiveAttributes(_0x1c6e18);};}function loggerCatch(_0x3dc703){return function(_0x348aec){logger[_0x8a36('0x66')](_0x3dc703,util[_0x8a36('0x67')](_0x348aec,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xd8b2af,_0x3141d7,_0x368a2c){return function(_0x13c447){utils[_0x8a36('0x68')](_0x3141d7,_0x368a2c,0x0);_0x3141d7[_0x8a36('0x69')]=0x0;logger[_0x8a36('0x66')](_0xd8b2af,util[_0x8a36('0x67')](_0x13c447,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5b2772){return function(_0x5b0060){if(isNotNull(_0x5b0060)&&isNotNull(_0x5b0060[0x0])){if(_0x5b0060[0x0][_0x8a36('0x6a')]>0x0){_0x5b2772[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')][_0x8a36('0x6d')];logger[_0x8a36('0x4a')]('[getContactDialer2][ReScheduled]'+_0x5b2772[_0x8a36('0x43')],_0x5b0060[0x0]['contactsRescheduled'],'contacts');}else{_0x5b2772[_0x8a36('0x6b')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger['info'](_0x8a36('0x6e')+_0x5b2772[_0x8a36('0x43')]);}}};}function createObjHistory(_0x305db8,_0x380e2f,_0x5628f9,_0x5148ff,_0x2ebd52){_0x305db8[_0x8a36('0x6b')]=_0x5628f9;var _0x31f847=new Action(_0x305db8,_0x380e2f);var _0x54e4d5=new History(_0x31f847);_0x54e4d5[_0x8a36('0x6f')]=_0x5148ff;_0x54e4d5[_0x8a36('0x70')]=_0x2ebd52;_0x54e4d5[_0x8a36('0x71')]=_0x31f847[_0x8a36('0x72')];return _0x54e4d5;}function unlockQueueStatus(_0x5d3bd6,_0x5eb15f){setTimeout(function(){if(_[_0x8a36('0x53')](_0x5d3bd6[_0x8a36('0x73')])){loggerBooked[_0x8a36('0x66')](_0x8a36('0x74'),_0x5eb15f);}_0x5d3bd6['queueStatusComplete']=!![];loggerBooked[_0x8a36('0x4a')](_0x8a36('0x75'),_0x5eb15f,JSON[_0x8a36('0x76')](_[_0x8a36('0x77')](_0x5d3bd6,[_0x8a36('0x43'),_0x8a36('0x73')])));},0x1f3);}function checkInterval(_0xd54ac8){return function(){if(!isNotNull(_0xd54ac8[_0x8a36('0x78')])){_0xd54ac8[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')]['NULL_INTERVAL'];throw _0xd54ac8[_0x8a36('0x43')]+_0x8a36('0x79');}if(!isNotNull(_0xd54ac8[_0x8a36('0x78')]['Intervals'])){_0xd54ac8[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')]['NULL_INTERVAL'];throw _0xd54ac8[_0x8a36('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0xd54ac8[_0x8a36('0x78')][_0x8a36('0x7a')]))){_0xd54ac8[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')][_0x8a36('0x7b')];throw _0xd54ac8['name']+_0x8a36('0x79');}};}function checkIsIVRCampaignActive(_0x62ce24){return function(){if(!utils[_0x8a36('0x7c')](_0x62ce24)){_0x62ce24['message']=utils[_0x8a36('0x6c')][_0x8a36('0x7d')];throw _0x62ce24[_0x8a36('0x43')]+_0x8a36('0x7e');}};}function emitCampaignSummary(_0x322959){if(utils['isIVRCampaign'](_0x322959)){emit(util['format'](_0x8a36('0x7f'),_0x322959[_0x8a36('0x43')]),_0x8a36('0x80'),_0x322959);}}function loggerCatchQueueSummary(_0x502004,_0x2e61b7){return function(_0x21f054){clearPredictiveAttributes(_0x2e61b7);emitCampaignSummary(_0x2e61b7);loggerSyncQueueSummary[_0x8a36('0x62')](_0x502004,util[_0x8a36('0x67')](_0x21f054,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2436f0){if(_0x2436f0[_0x8a36('0x81')]){if(_0x2436f0['originated']===0x0){_0x2436f0[_0x8a36('0x81')]=![];_0x2436f0[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')][_0x8a36('0x7d')];loggerSyncQueueSummary[_0x8a36('0x62')](_0x8a36('0x82'),_0x2436f0[_0x8a36('0x43')],'is\x20not\x20active');}else{_0x2436f0[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')][_0x8a36('0x83')];loggerSyncQueueSummary[_0x8a36('0x62')](_0x8a36('0x82'),_0x2436f0[_0x8a36('0x43')],_0x8a36('0x84'));}emitCampaignSummary(_0x2436f0);}}function myreject(_0x3d32b3){return function(_0x5141b8){return _0x3d32b3(msgResponse(_0x8a36('0x85'),_0x8a36('0x86'),JSON[_0x8a36('0x76')](_0x5141b8)));};}Dialer[_0x8a36('0x19')]['isTrunkReachable']=function(_0x16a0b0){return!_['isUndefined'](_0x16a0b0)&&_0x16a0b0&&!_[_0x8a36('0x53')](_0x16a0b0['name'])&&!_[_0x8a36('0x53')](_0x16a0b0[_0x8a36('0x87')])&&_0x16a0b0[_0x8a36('0x87')]&&(this[_0x8a36('0x20')][util['format']('SIP/%s',_0x16a0b0['name'])][_0x8a36('0x88')]===_0x8a36('0x89')||this['trunks'][util['format'](_0x8a36('0x8a'),_0x16a0b0[_0x8a36('0x43')])][_0x8a36('0x88')]==='unmonitored');};Dialer[_0x8a36('0x19')][_0x8a36('0x8b')]=function(_0x33db79){var _0x560a3a=this;return function(){if(!_0x560a3a[_0x8a36('0x8c')](_0x33db79[_0x8a36('0x8d')])){if(!_0x560a3a[_0x8a36('0x8c')](_0x33db79[_0x8a36('0x8e')])){_0x33db79[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')][_0x8a36('0x8f')];throw _0x33db79[_0x8a36('0x43')]+_0x8a36('0x90');}}};};Dialer[_0x8a36('0x19')][_0x8a36('0x91')]=function(_0x43b2f9,_0x587fac,_0x4bcdbc,_0x245a62){var _0x2f5f93=this;return function(){var _0x5c5983=!![];return _0x2f5f93[_0x8a36('0x92')](_0x43b2f9,_0x587fac,_0x4bcdbc,_0x245a62,_0x5c5983);};};Dialer[_0x8a36('0x19')][_0x8a36('0x93')]=function(_0x3bd447,_0x37f335,_0x3ed43e,_0x26a63a){var _0x20d166=this;return function(){var _0x382086=![];return _0x20d166[_0x8a36('0x92')](_0x3bd447['Intervals'],_0x37f335,_0x3ed43e,_0x26a63a,_0x382086);};};Dialer[_0x8a36('0x19')][_0x8a36('0x92')]=function(_0x252aba,_0x57e564,_0x5012fe,_0x369102,_0x5e4cbc){var _0x65dbf7=[];return new Promise(function(_0x26ae92,_0x58c38b){if(!isNotNull(_0x252aba)){_0x369102[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')][_0x8a36('0x7b')];return _0x58c38b(msgResponse(_0x8a36('0x94'),_0x8a36('0x95'),_0x5012fe+_0x8a36('0x96')));}if(_[_0x8a36('0x45')](_0x252aba)){_0x369102[_0x8a36('0x6b')]=utils[_0x8a36('0x6c')]['EMPTY_INTERVAL'];return _0x58c38b(msgResponse('ifTime',_0x8a36('0x95'),_0x5012fe+'\x20Intervals\x20is\x20empty\x20'));}if(_0x57e564&&_['isUndefined'](config[_0x8a36('0x97')][_0x57e564])){_0x369102[_0x8a36('0x6b')]=utils['CAMPAIGN_STATUS'][_0x8a36('0x98')];return _0x58c38b(msgResponse('ifTime','Failure',_0x5012fe+_0x8a36('0x99')+_0x57e564));}if(_[_0x8a36('0x9a')](_0x252aba)){for(var _0x2193cc=0x0;_0x2193cc<_0x252aba[_0x8a36('0x9b')];_0x2193cc+=0x1){_0x65dbf7['push'](ami[_0x8a36('0x9c')]({'action':_0x8a36('0x9d'),'command':util[_0x8a36('0x41')]('iftime\x20%s,%s',_0x252aba[_0x2193cc][_0x8a36('0x9e')],!_['isUndefined'](config['timezones'][_0x57e564])?_0x57e564:'')})['then'](function(_0x3d9f1e){return _0x3d9f1e[_0x8a36('0x9f')][_0x8a36('0xa0')](_0x8a36('0xa1'))>=0x0;})[_0x8a36('0xa2')](myreject(_0x58c38b)));}}else{_0x65dbf7[_0x8a36('0xa3')](ami[_0x8a36('0x9c')]({'action':_0x8a36('0x9d'),'command':util['format'](_0x8a36('0xa4'),_0x252aba,!_[_0x8a36('0x53')](config[_0x8a36('0x97')][_0x57e564])?_0x57e564:'')})[_0x8a36('0x3c')](function(_0x440e93){return _0x440e93['content'][_0x8a36('0xa0')]('true')>=0x0;})[_0x8a36('0xa2')](myreject(_0x58c38b)));}Promise['all'](_0x65dbf7)[_0x8a36('0x3c')](function(_0x46887b){var _0x32963e=_[_0x8a36('0xa5')](_0x46887b);if(_0x32963e){return _0x26ae92(_0x32963e);}else{_0x369102['message']=_0x5e4cbc?utils[_0x8a36('0x6c')][_0x8a36('0xa6')]:utils[_0x8a36('0x6c')]['OVERTIME_INTERVAL'];return _0x58c38b(msgResponse(_0x8a36('0xa7'),_0x8a36('0x95'),_0x8a36('0xa8')+_0x5e4cbc+'\x20'+_0x5012fe+'\x20Interval\x20is\x20overtime:\x20'+util[_0x8a36('0x67')](_0x252aba,{'showHidden':![],'depth':null})+_0x8a36('0xa9')+_0x57e564));}})[_0x8a36('0xa2')](function(_0x307244){return _0x58c38b(msgResponse(_0x8a36('0x94'),'Failure',JSON[_0x8a36('0x76')](_0x307244)));});});};Dialer['prototype']['loopCampaigns']=function(){var _0x16e127=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x8a36('0x3c')](function(){setInterval(function(){_0x16e127[_0x8a36('0xaa')]();},0x3e8);});};Dialer['prototype'][_0x8a36('0xaa')]=function(){var _0x528618=this;var _0x2dc863;for(var _0x42d527 in this['campaigns']){if(typeof this['campaigns'][_0x42d527]!==_0x8a36('0xab')){_0x2dc863=this[_0x8a36('0xac')][_0x42d527];if(utils[_0x8a36('0xad')](_0x2dc863)&&utils[_0x8a36('0x7c')](_0x2dc863)){_0x2dc863[_0x8a36('0x81')]=!![];Promise[_0x8a36('0xae')]()[_0x8a36('0x3c')](checkIsIVRCampaignActive(_0x2dc863))[_0x8a36('0x3c')](checkInterval(_0x2dc863))[_0x8a36('0x3c')](_0x528618[_0x8a36('0x8b')](_0x2dc863))[_0x8a36('0x3c')](_0x528618[_0x8a36('0x91')](_0x2dc863[_0x8a36('0xaf')],_0x2dc863[_0x8a36('0xb0')],_0x2dc863[_0x8a36('0x43')],_0x2dc863))[_0x8a36('0x3c')](_0x528618[_0x8a36('0x93')](_0x2dc863[_0x8a36('0x78')],_0x2dc863['dialTimezone'],_0x2dc863[_0x8a36('0x43')],_0x2dc863))[_0x8a36('0x3c')](_0x528618['launchHandleIvr'](_0x2dc863))[_0x8a36('0xa2')](loggerCatchQueueSummary(_0x8a36('0xb1'),_0x2dc863));}else{notSendMessagesCampaign(_0x2dc863);}}}};Dialer['prototype'][_0x8a36('0xb2')]=function(_0x4a7571){if(_0x4a7571[_0x8a36('0xb3')]!==_0x8a36('0x7')){clearPredictiveAttributes(_0x4a7571);}switch(_0x4a7571[_0x8a36('0xb3')]){case _0x8a36('0xb4'):this[_0x8a36('0xb5')](_0x4a7571,0x1);break;case'power':this[_0x8a36('0xb5')](_0x4a7571,_0x4a7571[_0x8a36('0xb6')]);break;case _0x8a36('0x7'):this['predictive'](_0x4a7571);break;case _0x8a36('0x6'):this['handlePower'](_0x4a7571,0x1);break;default:logger[_0x8a36('0x66')](_0x8a36('0xb7'),_0x4a7571[_0x8a36('0x43')],_0x8a36('0xb8'));}};Dialer[_0x8a36('0x19')][_0x8a36('0x94')]=function(_0x55cf4b,_0x59f44c){var _0x560db5=_0x55cf4b[_0x8a36('0xb0')];var _0x4cabb7=_0x59f44c?_0x55cf4b['dialGlobalInterval']:_0x55cf4b[_0x8a36('0x78')][_0x8a36('0x7a')];logger[_0x8a36('0xb9')]('Dialer::ifTime()',_0x4cabb7,_0x560db5,_0x55cf4b[_0x8a36('0x43')],util[_0x8a36('0x41')]('Voice\x20Queue\x20%s\x20$s',_0x55cf4b[_0x8a36('0x43')],_0x55cf4b['id']));var _0x357e59=null;return Interval[_0x8a36('0xba')](_0x4cabb7,_0x560db5)['then'](function(_0x338717){if(_0x338717===!![]){return _0x338717;}else{_0x55cf4b[_0x8a36('0x6b')]=_0x59f44c?utils[_0x8a36('0x6c')][_0x8a36('0xa6')]:utils[_0x8a36('0x6c')]['OVERTIME_INTERVAL'];_0x357e59=msgResponse(_0x8a36('0xa7'),_0x8a36('0x95'),'Global:\x20'+_0x59f44c+'\x20'+_0x55cf4b[_0x8a36('0x43')]+_0x8a36('0xbb')+util[_0x8a36('0x67')](_0x4cabb7,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x560db5);}if(_0x357e59!==null){logger[_0x8a36('0xb9')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x357e59);_0x357e59[_0x8a36('0xbc')]=_0x59f44c;throw _0x357e59;}})[_0x8a36('0xa2')](function(_0x3e5768){logger['error'](_0x8a36('0xbd'),_0x3e5768);throw msgResponse('[ifTime][Action]','Error',util[_0x8a36('0x67')](_0x3e5768,{'showHidden':![],'depth':null}));});};Dialer[_0x8a36('0x19')][_0x8a36('0x2b')]=function(_0x334b37){if(this['voiceQueues'][_0x334b37[_0x8a36('0xbe')]]){if(this['uniqueId'][_0x334b37[_0x8a36('0xbf')]]&&this[_0x8a36('0x24')][_0x334b37[_0x8a36('0xbf')]][_0x8a36('0x3e')]!=='ivr'){this[_0x8a36('0xc0')](this[_0x8a36('0x1e')][_0x334b37[_0x8a36('0xbe')]]);this['uniqueId'][_0x334b37[_0x8a36('0xbf')]][_0x8a36('0xc1')]=moment()[_0x8a36('0x41')](_0x8a36('0xc2'));}}};Dialer[_0x8a36('0x19')][_0x8a36('0xc3')]=function(_0x57c60b){var _0x3b814d=this[_0x8a36('0x24')][_0x57c60b[_0x8a36('0xbf')]];if(this['voiceQueues'][_0x57c60b['queue']]){if(_0x3b814d&&_0x3b814d['type']!==_0x8a36('0xc4')){delete this[_0x8a36('0x24')][_0x57c60b[_0x8a36('0xbf')]];this[_0x8a36('0x1e')][_0x57c60b['queue']]['outboundAnswerCallsDay']+=0x1;var _0x30cc5e=new AgentComplete(_0x3b814d,_0x57c60b);if(_0x57c60b[_0x8a36('0xc5')]===_0x8a36('0xc6')){_0x30cc5e[_0x8a36('0xc7')]=this[_0x8a36('0x1e')][_0x57c60b[_0x8a36('0xbe')]][_0x8a36('0xc8')]&&this[_0x8a36('0x1e')][_0x57c60b[_0x8a36('0xbe')]][_0x8a36('0xc9')]?moment()[_0x8a36('0x41')](_0x8a36('0xc2')):undefined;}hopperUtils['createHistory'](_0x30cc5e)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0xca')));hopperUtils[_0x8a36('0xcb')](_0x30cc5e)[_0x8a36('0xa2')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x8a36('0x19')][_0x8a36('0xcc')]=function(_0x1db951){var _0x36ff9e=this['uniqueId'][_0x1db951[_0x8a36('0xbf')]];var _0x47b0f9=this;var _0x300bfe=![];var _0x4ee672;var _0x5997cd;if(this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]]){if(_0x36ff9e&&_0x36ff9e[_0x8a36('0x3e')]!=='ivr'){delete this['uniqueId'][_0x1db951[_0x8a36('0xbf')]];this[_0x8a36('0xc0')](this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]]);_0x36ff9e[_0x8a36('0xcd')]=moment()[_0x8a36('0x41')](_0x8a36('0xc2'));var _0x5cb8de=new QueueCallerAbandon(_0x36ff9e,_0x1db951);if(utils['getSeconds'](_0x36ff9e[_0x8a36('0xcd')],_0x36ff9e[_0x8a36('0xce')])>=_0x36ff9e[_0x8a36('0xcf')]){this['voiceQueues'][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xd0')]+=0x1;this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xd1')]+=0x1;this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xd2')]+=0x1;_0x5cb8de[_0x8a36('0x6f')]=0xa;_0x5cb8de['statedesc']='Drop';_0x5cb8de['dropreason']='TIMEOUT';_0x5cb8de[_0x8a36('0xc7')]=this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xc8')]?moment()['format'](_0x8a36('0xc2')):undefined;_0x5cb8de[_0x8a36('0xd3')]+=0x1;_0x5cb8de[_0x8a36('0xd4')]+=0x1;_0x4ee672=this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xd5')];_0x5997cd=this[_0x8a36('0x1e')][_0x1db951['queue']][_0x8a36('0xd6')];hopperUtils['verifyAdditionalPhones'](_0x5cb8de,_0x5cb8de[_0x8a36('0x6f')],_0x36ff9e['voiceQueue'])[_0x8a36('0x3c')](function(_0x57caf0){_0x300bfe=_0x57caf0[_0x8a36('0xd7')]==0x1;if(_0x5cb8de['countdropretry']>=_0x47b0f9[_0x8a36('0x1e')][_0x1db951['queue']][_0x8a36('0xd8')]){_0x47b0f9['queueCallerAbandonCreateState'](_0x5cb8de,_0x57caf0[_0x8a36('0xd7')]);}else{hopperUtils[_0x8a36('0xd9')]({'active':![],'countdropretry':_0x5cb8de[_0x8a36('0xd3')],'scheduledat':moment()['add'](_0x47b0f9[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]]['dialDropRetryFrequency'],_0x8a36('0xda'))[_0x8a36('0x41')](_0x8a36('0xc2')),'ContactId':_0x36ff9e['ContactId'],'ListId':_0x36ff9e[_0x8a36('0xdb')],'VoiceQueueId':_0x36ff9e[_0x8a36('0xdc')]||undefined,'CampaignId':_0x36ff9e[_0x8a36('0xdd')]||undefined})['catch'](loggerCatch(_0x8a36('0xde')));var _0x50ad07=new History(_0x5cb8de);_0x50ad07[_0x8a36('0x6f')]=0xa;_0x50ad07['statedesc']=_0x8a36('0xdf');_0x50ad07[_0x8a36('0x72')]=moment()[_0x8a36('0x41')](_0x8a36('0xc2'));_0x50ad07[_0x8a36('0x71')]=_0x50ad07['starttime'];_0x50ad07['calleridname']=_0x5cb8de['calleridname'];_0x50ad07[_0x8a36('0xe0')]=_0x5cb8de[_0x8a36('0xe0')];hopperUtils[_0x8a36('0xe1')](_0x50ad07)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0xe2')));}})[_0x8a36('0x3c')](function(){if(_0x300bfe)hopperUtils[_0x8a36('0xe3')](_0x5cb8de,_0x4ee672,_0x5997cd)[_0x8a36('0x3c')](function(){return 0x1;});});}else{this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0x4d')]+=0x1;this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xe4')]+=0x1;_0x5cb8de['state']=0xb;_0x5cb8de[_0x8a36('0x70')]=_0x8a36('0xe5');_0x5cb8de[_0x8a36('0xe6')]=_0x8a36('0xe7');_0x5cb8de[_0x8a36('0xe8')]+=0x1;_0x5cb8de['countglobal']+=0x1;_0x4ee672=this[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xe9')];_0x5997cd=this['voiceQueues'][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xd6')];hopperUtils[_0x8a36('0xea')](_0x5cb8de,_0x5cb8de[_0x8a36('0x6f')],_0x36ff9e['voiceQueue'])[_0x8a36('0x3c')](function(_0x4e5f7c){if(_0x5cb8de[_0x8a36('0xe8')]>=_0x47b0f9[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xeb')]){_0x47b0f9[_0x8a36('0xec')](_0x5cb8de,_0x4e5f7c[_0x8a36('0xd7')]);}else{hopperUtils[_0x8a36('0xd9')]({'active':![],'countabandonedretry':_0x5cb8de[_0x8a36('0xe8')],'scheduledat':moment()[_0x8a36('0xed')](_0x47b0f9[_0x8a36('0x1e')][_0x1db951[_0x8a36('0xbe')]][_0x8a36('0xe9')],_0x8a36('0xda'))['format'](_0x8a36('0xc2')),'ContactId':_0x36ff9e[_0x8a36('0xee')],'ListId':_0x36ff9e[_0x8a36('0xdb')],'VoiceQueueId':_0x36ff9e['VoiceQueueId']||undefined,'CampaignId':_0x36ff9e[_0x8a36('0xdd')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x26f97e=new History(_0x5cb8de);_0x26f97e[_0x8a36('0x6f')]=0xb;_0x26f97e[_0x8a36('0x70')]=_0x8a36('0xe5');_0x26f97e[_0x8a36('0x72')]=moment()[_0x8a36('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x26f97e[_0x8a36('0x71')]=_0x26f97e[_0x8a36('0x72')];_0x26f97e[_0x8a36('0xef')]=_0x5cb8de[_0x8a36('0xef')];_0x26f97e['calleridnum']=_0x5cb8de[_0x8a36('0xe0')];hopperUtils[_0x8a36('0xe1')](_0x26f97e)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0xf0')));}})[_0x8a36('0x3c')](function(){if(_0x300bfe)hopperUtils['swapAdditionalPhones'](_0x5cb8de,_0x4ee672,_0x5997cd)[_0x8a36('0x3c')](function(){return 0x1;});});}}}};Dialer[_0x8a36('0x19')]['syncNewExten']=function(_0x1ba4a2){if(this['actions'][_0x1ba4a2[_0x8a36('0xbf')]]){this[_0x8a36('0xf1')][_0x1ba4a2['uniqueid']][_0x8a36('0xf2')]=_0x1ba4a2[_0x8a36('0xf2')];}if(this[_0x8a36('0x24')][_0x1ba4a2[_0x8a36('0xbf')]]){this[_0x8a36('0x24')][_0x1ba4a2[_0x8a36('0xbf')]]['channel']=_0x1ba4a2[_0x8a36('0xf2')];}};Dialer[_0x8a36('0x19')][_0x8a36('0x37')]=function(_0x5ce910){if(!this[_0x8a36('0xf1')][_0x5ce910['actionid']]){return;}var _0x4f71cb=this[_0x8a36('0x1e')][this[_0x8a36('0xf1')][_0x5ce910[_0x8a36('0xf3')]]['queue']]['strategy']||_0x8a36('0xf4');if(_0x4f71cb===_0x8a36('0xf5')){if(this[_0x8a36('0xf1')][_0x5ce910[_0x8a36('0xf3')]]&&_[_0x8a36('0xf6')](this[_0x8a36('0xf1')][_0x5ce910['actionid']][_0x8a36('0xf7')])&&_0x5ce910[_0x8a36('0x88')]==='1'&&_0x5ce910[_0x8a36('0xf8')]==='0'){if(this[_0x8a36('0x1f')][_0x5ce910[_0x8a36('0xf9')]]){if(!this['agents'][_0x5ce910[_0x8a36('0xf9')]][_0x8a36('0xf7')]){this['agents'][_0x5ce910['stateinterface']][_0x8a36('0xf7')]=!![];this[_0x8a36('0xf1')][_0x5ce910[_0x8a36('0xf3')]][_0x8a36('0xf7')]=!![];this['actions'][_0x5ce910[_0x8a36('0xf3')]][_0x8a36('0xf9')]=_0x5ce910['stateinterface'];}}}}else if(_0x4f71cb===_0x8a36('0xf4')){if(this[_0x8a36('0xf1')][_0x5ce910['actionid']]){if(this[_0x8a36('0x1f')][_0x5ce910[_0x8a36('0xf9')]]){this['actions'][_0x5ce910[_0x8a36('0xf3')]][_0x8a36('0xf9')]=_0x5ce910['stateinterface'];if(_['isNil'](this[_0x8a36('0x27')][this[_0x8a36('0xf1')][_0x5ce910[_0x8a36('0xf3')]][_0x8a36('0xbe')]])){this[_0x8a36('0x27')][this[_0x8a36('0xf1')][_0x5ce910['actionid']]['queue']]=[];}this[_0x8a36('0x27')][this[_0x8a36('0xf1')][_0x5ce910[_0x8a36('0xf3')]][_0x8a36('0xbe')]][_0x8a36('0xa3')](_[_0x8a36('0x5e')](_[_0x8a36('0x77')](this[_0x8a36('0xf1')][_0x5ce910[_0x8a36('0xf3')]],[_0x8a36('0xfa'),_0x8a36('0xf9')]),{'status':_0x5ce910['status'],'paused':_0x5ce910[_0x8a36('0xf8')]}));}}}};Dialer[_0x8a36('0x19')][_0x8a36('0x39')]=function(_0x52972d){if(!this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]){return;}var _0x93dad6=this;var _0x49ed96=this[_0x8a36('0x1e')][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]['queue']];var _0x1a54b3=_0x49ed96['strategy']||_0x8a36('0xf4');if(_0x1a54b3===_0x8a36('0xf5')){if(this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]&&this[_0x8a36('0xf1')][_0x52972d['actionid']][_0x8a36('0xf9')]){this[_0x8a36('0x1d')][_0x8a36('0xfb')](this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xfa')],this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]['stateinterface'])[_0x8a36('0xa2')](function(_0x4fd79f){logger['error'](_0x8a36('0xfc'),util['inspect'](_0x4fd79f,{'showHidden':![],'depth':null}));})['finally'](function(){_0x93dad6[_0x8a36('0xc0')](_0x93dad6[_0x8a36('0x1e')][_0x93dad6[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]]);_0x93dad6['agents'][_0x93dad6[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]['stateinterface']][_0x8a36('0xf7')]=![];delete _0x93dad6['actions'][_0x52972d[_0x8a36('0xf3')]];unlockQueueStatus(_0x49ed96);});}else{this[_0x8a36('0xc0')](this[_0x8a36('0x1e')][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xee')],'ListId':this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xdb')],'VoiceQueueId':this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0xfd')));delete this[_0x8a36('0xf1')][_0x52972d['actionid']];unlockQueueStatus(_0x49ed96);}}else if(_0x1a54b3===_0x8a36('0xf4')){var _0x17a298;if(this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]&&!_[_0x8a36('0x45')](this[_0x8a36('0x27')][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]])){if(this[_0x8a36('0x28')][_0x93dad6[_0x8a36('0xf1')][_0x52972d['actionid']][_0x8a36('0xbe')]]){this[_0x8a36('0x28')][_0x93dad6[_0x8a36('0xf1')][_0x52972d['actionid']][_0x8a36('0xbe')]]=this[_0x8a36('0x28')][this['actions'][_0x52972d['actionid']][_0x8a36('0xbe')]]?this['queueBookedRR'][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]]:this[_0x8a36('0x27')][this['actions'][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]]?this['queueBooked'][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]][_0x8a36('0xfe')]||0x0:0x0;}this[_0x8a36('0x27')][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]][_0x8a36('0xbe')]][_0x8a36('0xfe')]=this['queueBookedRR'][this[_0x8a36('0xf1')][_0x52972d[_0x8a36('0xf3')]]['queue']];for(var _0x4c1d2c=0x0;_0x4c1d2c=_0x2bd36c[_0x8a36('0x120')]){_0x3353bf[_0x8a36('0x121')](_0x1fad56,_0x42aacb,_0x52f55b,_0x8a36('0x122'));}else{if(_0x1fad56[_0x8a36('0x123')]>=_0x2bd36c[_0x8a36('0x124')]){_0x3353bf[_0x8a36('0x125')](_0x1fad56,_0x42aacb,_0x52f55b,_0x8a36('0x126'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1fad56[_0x8a36('0x123')],'scheduledat':moment()[_0x8a36('0xed')](_0x2bd36c[_0x8a36('0x127')],_0x8a36('0xda'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1fad56[_0x8a36('0xee')],'ListId':_0x1fad56[_0x8a36('0xdb')],'VoiceQueueId':_0x1fad56[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1fad56['CampaignId']||undefined})['catch'](loggerCatch(_0x8a36('0x128')));_0x42aacb({'reschedule':0x1});}}});}if(_0x15bfa1[_0x8a36('0x3e')]===_0x8a36('0xc4')&&this[_0x8a36('0xac')][_0x15bfa1[_0x8a36('0xbe')]][_0x8a36('0x10f')]&&_0x1816ff[_0x8a36('0x110')]===_0x8a36('0x111')){delete this[_0x8a36('0x24')][_0x1816ff['uniqueid']];this['updateOriginated'](this[_0x8a36('0xac')][_0x15bfa1['queue']]);_0x51cf9e=new Hangup(_0x15bfa1,_0x1816ff);_0x51cf9e[_0x8a36('0x6f')]=0x12;_0x51cf9e[_0x8a36('0x70')]=_0x8a36('0x113');_0x51cf9e[_0x8a36('0x129')]=_0x8a36('0x114');ami[_0x8a36('0x11a')](_0x8a36('0x11b'),ut[_0x8a36('0x115')](_0x51cf9e,_0x8a36('0x116')));this[_0x8a36('0x12a')](_0x51cf9e,'[syncHangupInAMDIvr][createHistory]',_0x8a36('0x12b'));}if(_0x15bfa1[_0x8a36('0x3e')]===_0x8a36('0xc4')&&this[_0x8a36('0xac')][_0x15bfa1[_0x8a36('0xbe')]][_0x8a36('0x10f')]&&_0x1816ff[_0x8a36('0x110')]===_0x8a36('0x117')){return new Promise(function(_0x3ef654,_0x1cd89d){delete _0x3353bf[_0x8a36('0x24')][_0x1816ff[_0x8a36('0xbf')]];_0x3353bf[_0x8a36('0xc0')](_0x3353bf[_0x8a36('0xac')][_0x15bfa1['queue']]);_0x3353bf['campaigns'][_0x15bfa1[_0x8a36('0xbe')]][_0x8a36('0x112')]+=0x1;_0x3353bf[_0x8a36('0xac')][_0x15bfa1['queue']][_0x8a36('0x118')]+=0x1;var _0xcbdfde=_0x3353bf[_0x8a36('0xac')][_0x15bfa1[_0x8a36('0xbe')]];var _0x512a48=new Hangup(_0x15bfa1,_0x1816ff);_0x512a48[_0x8a36('0x6f')]=0x13;_0x512a48[_0x8a36('0x70')]=_0x8a36('0x119');_0x512a48[_0x8a36('0x129')]='AMD';_0x512a48['countmachineretry']+=0x1;_0x512a48[_0x8a36('0xd4')]+=0x1;_0x512a48['amd']=!![];ami['emit'](_0x8a36('0x11b'),ut['buildObj'](_0x512a48,_0x8a36('0x116')));hopperUtils[_0x8a36('0xe1')](_0x512a48)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x11c')));if(_0x512a48[_0x8a36('0x11d')]+_0x512a48[_0x8a36('0x11e')]+_0x512a48[_0x8a36('0x12c')]+_0x512a48[_0x8a36('0x11f')]+_0x512a48[_0x8a36('0xd3')]+_0x512a48[_0x8a36('0xe8')]+_0x512a48[_0x8a36('0x123')]+_0x512a48[_0x8a36('0x12d')]>=_0xcbdfde['dialGlobalMaxRetry']){_0x3353bf[_0x8a36('0x121')](_0x512a48,_0x3ef654,_0x1cd89d,_0x8a36('0x122'));}else{if(_0x512a48[_0x8a36('0x123')]>=_0xcbdfde[_0x8a36('0x124')]){_0x3353bf['createStateFinal'](_0x512a48,_0x3ef654,_0x1cd89d,_0x8a36('0x126'));}else{hopperUtils[_0x8a36('0xd9')]({'active':![],'countmachineretry':_0x512a48[_0x8a36('0x123')],'scheduledat':moment()[_0x8a36('0xed')](_0xcbdfde[_0x8a36('0x127')],'minutes')['format'](_0x8a36('0xc2')),'ContactId':_0x512a48[_0x8a36('0xee')],'ListId':_0x512a48[_0x8a36('0xdb')],'VoiceQueueId':_0x512a48[_0x8a36('0xdc')]||undefined,'CampaignId':_0x512a48[_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x128')));_0x3ef654({'reschedule':0x1});}}});}}};Dialer[_0x8a36('0x19')][_0x8a36('0x33')]=function(_0x26c326){var _0x8b4c5=this['uniqueId'][_0x26c326[_0x8a36('0xbf')]];var _0x5e5615;if(_0x8b4c5&&_0x8b4c5[_0x8a36('0x3e')]===_0x8a36('0xc4')){delete this[_0x8a36('0x24')][_0x26c326[_0x8a36('0xbf')]];this[_0x8a36('0xc0')](this[_0x8a36('0xac')][_0x8b4c5['queue']]);this[_0x8a36('0xac')][_0x8b4c5['queue']][_0x8a36('0x12e')]+=0x1;_0x5e5615=new Hangup(_0x8b4c5,_0x26c326);hopperUtils['createHistory'](_0x5e5615)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x12f')));hopperUtils['moveContactManagedDialer'](_0x5e5615)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x130')));}if(_0x8b4c5&&_0x8b4c5[_0x8a36('0x3e')]!==_0x8a36('0xc4')&&isNotNull(this[_0x8a36('0x1e')][_0x8b4c5[_0x8a36('0xbe')]][_0x8a36('0x131')])){delete this[_0x8a36('0x24')][_0x26c326[_0x8a36('0xbf')]];this[_0x8a36('0xc0')](this[_0x8a36('0x1e')][_0x8b4c5[_0x8a36('0xbe')]]);this['voiceQueues'][_0x8b4c5[_0x8a36('0xbe')]]['outboundAnswerCallsDay']+=0x1;this[_0x8a36('0x1e')][_0x8b4c5[_0x8a36('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5e5615=new Hangup(_0x8b4c5,_0x26c326);_0x5e5615[_0x8a36('0x6f')]=0x10;_0x5e5615[_0x8a36('0x70')]=_0x8a36('0x132');_0x5e5615[_0x8a36('0x129')]='AGI';hopperUtils['createHistory'](_0x5e5615)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x12f')));hopperUtils[_0x8a36('0xcb')](_0x5e5615)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x130')));}if(_0x8b4c5&&_0x8b4c5[_0x8a36('0x3e')]!==_0x8a36('0xc4')&&!isNotNull(this['voiceQueues'][_0x8b4c5[_0x8a36('0xbe')]][_0x8a36('0x131')])){if(_0x26c326[_0x8a36('0x133')]==='Normal\x20Clearing'){delete this[_0x8a36('0x24')][_0x26c326['uniqueid']];this[_0x8a36('0x1e')][_0x8b4c5['queue']][_0x8a36('0x112')]+=0x1;const _0x3311e5=new AgentComplete(_0x8b4c5,_0x26c326);_0x3311e5['CampaignId']=this[_0x8a36('0x1e')][_0x8b4c5[_0x8a36('0xbe')]]['id'];hopperUtils[_0x8a36('0xe1')](_0x3311e5)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0xca')));hopperUtils[_0x8a36('0xcb')](_0x3311e5)[_0x8a36('0xa2')](loggerCatch('[syncAgentComplete]'));}else{delete this['uniqueId'][_0x26c326['uniqueid']];this[_0x8a36('0xc0')](this[_0x8a36('0x1e')][_0x8b4c5[_0x8a36('0xbe')]]);this[_0x8a36('0x1e')][_0x8b4c5[_0x8a36('0xbe')]][_0x8a36('0x134')]+=0x1;_0x5e5615=new Hangup(_0x8b4c5,_0x26c326);_0x5e5615[_0x8a36('0x6f')]=0xc;_0x5e5615['statedesc']=_0x26c326[_0x8a36('0x133')];_0x5e5615[_0x8a36('0x129')]=_0x8a36('0x135');hopperUtils[_0x8a36('0xe1')](_0x5e5615)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x12f')));hopperUtils[_0x8a36('0xcb')](_0x5e5615)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x130')));}}};Dialer[_0x8a36('0x19')][_0x8a36('0x9')]=function(_0x23e904){var _0x40173d=this;if(!_0x40173d[_0x8a36('0x29')][_0x23e904['name']]){_0x40173d[_0x8a36('0x29')][_0x23e904[_0x8a36('0x43')]]={'running':![]};}else if(_0x40173d['queuesSummary'][_0x23e904[_0x8a36('0x43')]][_0x8a36('0x136')]===!![]){return;}else if(_0x40173d[_0x8a36('0x29')][_0x23e904[_0x8a36('0x43')]][_0x8a36('0x136')]===![]){_0x40173d['queuesSummary'][_0x23e904[_0x8a36('0x43')]][_0x8a36('0x136')]=!![];}var _0x2f58f6=_0x40173d[_0x8a36('0x1e')][_0x23e904[_0x8a36('0x43')]];var _0xb0042d=_0x2f58f6[_0x8a36('0x6b')]!==utils['CAMPAIGN_STATUS'][_0x8a36('0x7d')];var _0xbc4be9=utils['isPreviewCampaign'](_0x2f58f6);_0x2f58f6[_0x8a36('0x137')]=utils['getQueueCampaignStatusMessage'](_0x2f58f6,_0x40173d['trunks']);Promise[_0x8a36('0xae')]()[_0x8a36('0x3c')](function(){if(_0x2f58f6[_0x8a36('0x137')]===utils['CAMPAIGN_STATUS'][_0x8a36('0x7d')]){if(_0xb0042d){clearPredictiveAttributes(_0x2f58f6);_0x23e904[_0x8a36('0x26')]=undefined;_0x23e904[_0x8a36('0x60')]=undefined;}if(_0x2f58f6[_0x8a36('0x137')]===utils[_0x8a36('0x6c')]['INACTIVE']){_0x23e904[_0x8a36('0x138')]=0x0;_0x23e904['paused']=0x0;_0x23e904[_0x8a36('0x139')]=0x0;_0x23e904['talking']=0x0;_0x23e904[_0x8a36('0x13a')]=0x0;}}else if(_0x2f58f6[_0x8a36('0x137')]===utils[_0x8a36('0x6c')][_0x8a36('0x13b')]&&!_0xbc4be9){return _0x40173d[_0x8a36('0x94')](_0x2f58f6,!![])[_0x8a36('0x3c')](function(){return _0x40173d[_0x8a36('0x94')](_0x2f58f6,![]);})[_0x8a36('0x3c')](function(){return _0x40173d[_0x8a36('0xb2')](_0x2f58f6);})['catch'](function(_0x2d67e6){loggerSyncQueueSummary[_0x8a36('0x62')](_0x8a36('0x13c'),util[_0x8a36('0x67')](_0x2d67e6,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2f58f6);});}else{clearPredictiveAttributes(_0x2f58f6);}})['then'](function(){var _0xbd1d34=_0x23e904[_0x8a36('0x13d')](_0x2f58f6);if(_0xbd1d34||_0x2f58f6[_0x8a36('0x13e')]){_0x2f58f6[_0x8a36('0x13e')]=![];_0x23e904[_0x8a36('0x13f')](_0x2f58f6);Object[_0x8a36('0x140')](_0x2f58f6,_0x23e904);emitOutboundVoiceQueueSummary(_0x23e904);}_0x40173d[_0x8a36('0x29')][_0x2f58f6[_0x8a36('0x43')]]['running']=![];})[_0x8a36('0xa2')](function(_0x262ed6){logger['error'](_0x8a36('0x13c'),util[_0x8a36('0x67')](_0x262ed6,{'showHidden':![],'depth':null}));_0x40173d[_0x8a36('0x29')][_0x2f58f6[_0x8a36('0x43')]]['running']=![];});};Dialer['prototype'][_0x8a36('0x31')]=_[_0x8a36('0x141')](function(){var _0x2da0e4=_[_0x8a36('0x142')](this[_0x8a36('0x1e')],function(_0x2470f9){return _0x2470f9[_0x8a36('0x143')];});var _0xfd060=_[_0x8a36('0x142')](this[_0x8a36('0x1f')],function(_0x3e62ea){return _0x3e62ea[_0x8a36('0x144')]&&_0x3e62ea[_0x8a36('0x88')]==='reachable';});if(_0x2da0e4[_0x8a36('0x9b')]>0x0&&_0xfd060[_0x8a36('0x9b')]>0x0){return Promise[_0x8a36('0xae')]()[_0x8a36('0x3c')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x2da0e4,'id'),previewRecallmeReminderInterval,_['map'](_0xfd060,'id')))[_0x8a36('0x3c')](function(_0x323c1a){for(var _0x3eab2b=0x0;_0x3eab2b<_0x323c1a[_0x8a36('0x9b')];_0x3eab2b++){var _0x4982ff=_0x323c1a[_0x3eab2b]['Agent'][_0x8a36('0x43')];if(_0x4982ff)io['to'](util[_0x8a36('0x41')]('user:%s',_0x4982ff))[_0x8a36('0x11a')]('user:dialPreviewRecallReminder',{'hopper':_0x323c1a[_0x3eab2b]});}})['catch'](function(_0x1d0450){logger[_0x8a36('0x66')](_0x8a36('0x145'),_0x1d0450);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8a36('0x19')]['loopClearZombieChannels']=function(){var _0x6dcb77=this;setInterval(function(){_0x6dcb77[_0x8a36('0x146')](_0x6dcb77[_0x8a36('0x24')],_0x8a36('0x147'));_0x6dcb77[_0x8a36('0x146')](_0x6dcb77[_0x8a36('0xf1')],_0x8a36('0x148'));},0x32c8);};Dialer[_0x8a36('0x19')][_0x8a36('0x146')]=function(_0x4c9dc0,_0x329172){var _0x2c8ada=this;for(var _0x10c373 in _0x4c9dc0){if(typeof _0x4c9dc0[_0x10c373]!==_0x8a36('0xab')){this[_0x8a36('0x1c')]['enqueue'](function(){if(!_[_0x8a36('0xf6')](_0x4c9dc0[_0x10c373])){return ami['Action']({'action':_0x8a36('0x88'),'channel':_0x4c9dc0[_0x10c373][_0x8a36('0xf2')]})[_0x8a36('0xa2')](function(_0x5ebfbb){if(_0x5ebfbb[_0x8a36('0x6b')]===_0x8a36('0x149')){setTimeout(function(){if(_0x4c9dc0[_0x10c373]&&_0x4c9dc0[_0x10c373][_0x8a36('0x3e')]!==_0x8a36('0xc4')){_0x2c8ada[_0x8a36('0xc0')](_0x2c8ada[_0x8a36('0x1e')][_0x4c9dc0[_0x10c373][_0x8a36('0xbe')]]);logger[_0x8a36('0x66')](_0x8a36('0x14a'),_0x329172,_0x10c373,_0x4c9dc0[_0x10c373][_0x8a36('0xbe')]);delete _0x4c9dc0[_0x10c373];}if(_0x4c9dc0[_0x10c373]&&_0x4c9dc0[_0x10c373]['type']==='ivr'){_0x2c8ada[_0x8a36('0xc0')](_0x2c8ada[_0x8a36('0xac')][_0x4c9dc0[_0x10c373][_0x8a36('0xbe')]]);logger[_0x8a36('0x66')](_0x8a36('0x14b'),_0x329172,_0x10c373,_0x4c9dc0[_0x10c373][_0x8a36('0xbe')]);delete _0x4c9dc0[_0x10c373];}},0x2328);}});}});}}};Dialer[_0x8a36('0x19')]['getVoiceQueueRtPauses']=function(_0x206c1f){return Promise[_0x8a36('0xae')]()[_0x8a36('0x3c')](voiceQueueRt[_0x8a36('0x14c')](_0x206c1f))[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x14d')));};Dialer['prototype']['updateOriginated']=function(_0x89c9b4){if(!_[_0x8a36('0x53')](_0x89c9b4)&&_0x89c9b4!==null){if(typeof _0x89c9b4[_0x8a36('0x14e')]!==_0x8a36('0xab')){if(_0x89c9b4['originated']>0x0){_0x89c9b4['originated']-=0x1;}else{logger[_0x8a36('0x66')](_0x8a36('0x14f'));}}}else{logger[_0x8a36('0x66')](_0x8a36('0x150'));}};Dialer[_0x8a36('0x19')][_0x8a36('0x151')]=function(_0x5aa374,_0x443431){var _0x2ee425=this;return function(_0x24fbe2){_0x2ee425[_0x8a36('0xc0')](_0x443431);logger['error'](_0x5aa374,util[_0x8a36('0x67')](_0x24fbe2,{'showHidden':![],'depth':null}));};};Dialer[_0x8a36('0x19')][_0x8a36('0x152')]=function(_0x285a08,_0x2da226,_0x1facb9){var _0x5e4f3f={'state':0x19,'statedesc':_0x8a36('0x153')};this[_0x8a36('0xc0')](_0x2da226);this[_0x8a36('0x12a')](_[_0x8a36('0x5e')](_0x5e4f3f,_[_0x8a36('0x77')](_0x1facb9,[_0x8a36('0xee'),'ListId',_0x8a36('0x154'),'VoiceQueueId',_0x8a36('0xdd')])),_0x8a36('0x155'),'[emptyContact]');logger['error'](_0x285a08);};Dialer[_0x8a36('0x19')]['saveInDb']=function(_0x3a0c51,_0x1af4b0,_0x15597b){hopperUtils[_0x8a36('0xe1')](_0x3a0c51)[_0x8a36('0xa2')](loggerCatch(_0x1af4b0));hopperUtils[_0x8a36('0xcb')](_0x3a0c51)[_0x8a36('0xa2')](loggerCatch(_0x15597b));};Dialer['prototype'][_0x8a36('0xec')]=function(_0x3587e3,_0x3825b4){hopperUtils[_0x8a36('0xe1')](_0x3587e3)['catch'](loggerCatch(_0x8a36('0xca')));if(_0x3825b4==0x0){hopperUtils[_0x8a36('0xcb')](_0x3587e3)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x156')));}};Dialer[_0x8a36('0x19')][_0x8a36('0x145')]=function(_0x4ccd3d){return Promise['resolve']()['then'](cmHopper[_0x8a36('0x157')](_0x4ccd3d['id'],previewRecallmeReminderInterval))[_0x8a36('0x3c')](function(_0x130bd6){for(var _0x42eb93=0x0;_0x42eb93<_0x130bd6[_0x8a36('0x9b')];_0x42eb93++){var _0x3d347b=_0x130bd6[_0x42eb93]['Agent'][_0x8a36('0x43')];if(_0x3d347b)io['to'](util[_0x8a36('0x41')](_0x8a36('0x158'),_0x3d347b))[_0x8a36('0x11a')](_0x8a36('0x159'),{'hopper':_0x130bd6[_0x42eb93]});}})[_0x8a36('0xa2')](function(){});};Dialer['prototype'][_0x8a36('0x15a')]=function(_0x3f4366){var _0x4901c4=this;return function(){_0x4901c4['handleIvr'](_0x3f4366);};};Dialer['prototype'][_0x8a36('0x15b')]=function(_0x4d0834,_0x5c280b){var _0x9c5a69=this;var _0x14191f=uuid['v4']();this[_0x8a36('0xf1')][_0x14191f]=new Action(_0x4d0834,_0x5c280b,_0x14191f);return new Promise(function(_0x3a6ffa,_0x52d1a0){if(_[_0x8a36('0x53')](_0x4d0834)&&typeof _0x4d0834!==_0x8a36('0x15c')){return _0x52d1a0(msgResponse(_0x8a36('0x15d'),_0x8a36('0x95'),_0x8a36('0x15e')));}if(_['isUndefined'](_0x5c280b['phone'])||_0x5c280b[_0x8a36('0x15f')]===null){return _0x52d1a0(msgResponse(_0x8a36('0x15d'),'Failure','contact\x20is\x20undefine'));}var _0x1385b5={'XMD-CALLERID':_0x9c5a69[_0x8a36('0xf1')][_0x14191f][_0x8a36('0x160')](),'XMD-AGI':_0x4d0834['dialQueueProject']?util[_0x8a36('0x41')](_0x8a36('0x161'),ipAgi,_0x4d0834['dialQueueProject']):_0x8a36('0x162'),'XMD-AGIAFTER':_0x4d0834[_0x8a36('0xc8')]?util[_0x8a36('0x41')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4d0834[_0x8a36('0xc8')]):_0x8a36('0x162'),'XMD-QUEUE':utils[_0x8a36('0x163')](_0x4d0834)?util[_0x8a36('0x41')](_0x8a36('0x164'),_0x4d0834['name'],_0x4d0834[_0x8a36('0x165')]||'',_0x4d0834[_0x8a36('0xc9')]?'c':'',_0x4d0834[_0x8a36('0xcf')]||0x3):_0x8a36('0x162'),'XMD-CONTACTID':_0x5c280b['ContactId'],'XMD-CDRTYPE':_0x8a36('0x166'),'CALLERID(all)':_0x9c5a69[_0x8a36('0xf1')][_0x14191f][_0x8a36('0x160')](),'XMD-AMD':_0x4d0834[_0x8a36('0x10f')]?_0x8a36('0x13b'):_0x8a36('0x162'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4d0834[_0x8a36('0x10f')]){_0x1385b5[_0x8a36('0x167')]=_0x4d0834[_0x8a36('0x168')]||0x9c4;_0x1385b5[_0x8a36('0x169')]=_0x4d0834[_0x8a36('0x16a')]||0x5dc;_0x1385b5['XMD-AMDAFTERGREETINGSILENCE']=_0x4d0834['dialAMDAfterGreetingSilence']||0x320;_0x1385b5['XMD-AMDTOTALANALYSISTIME']=_0x4d0834[_0x8a36('0x16b')]||0x1388;_0x1385b5[_0x8a36('0x16c')]=_0x4d0834[_0x8a36('0x16d')]||0x64;_0x1385b5['XMD-AMDBETWEENWORDSSILENCE']=_0x4d0834[_0x8a36('0x16e')]||0x32;_0x1385b5[_0x8a36('0x16f')]=_0x4d0834[_0x8a36('0x170')]||0x3;_0x1385b5[_0x8a36('0x171')]=_0x4d0834[_0x8a36('0x172')]||0x100;_0x1385b5[_0x8a36('0x173')]=_0x4d0834[_0x8a36('0x174')]||0x1388;}if(utils[_0x8a36('0x163')](_0x4d0834)){_0x1385b5['XMD-VOICEQUEUEID']=_0x5c280b[_0x8a36('0xdc')];}else{_0x1385b5['XMD-CAMPAIGNID']=_0x5c280b['CampaignId'];}var _0x3b9a14=utils[_0x8a36('0x175')](_0x5c280b[_0x8a36('0x176')]);Object[_0x8a36('0x140')](_0x1385b5,_0x3b9a14);var _0x27d871=_0x9c5a69[_0x8a36('0x8c')](_0x4d0834[_0x8a36('0x8d')])?utils[_0x8a36('0x177')](_0x4d0834['Trunk'][_0x8a36('0x178')],_0x4d0834['dialOriginateCallerIdName'],_0x4d0834['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x8a36('0x179')](_0x4d0834[_0x8a36('0x17a')],_0x4d0834[_0x8a36('0x17b')]):_0x4d0834[_0x8a36('0x17a')]):utils[_0x8a36('0x177')](_[_0x8a36('0xf6')](_0x4d0834[_0x8a36('0x8e')])?_0x4d0834[_0x8a36('0x8d')][_0x8a36('0x178')]:_0x4d0834[_0x8a36('0x8e')][_0x8a36('0x178')],_0x4d0834[_0x8a36('0x17c')],_0x4d0834[_0x8a36('0x17b')]>0x0?utils[_0x8a36('0x179')](_0x4d0834[_0x8a36('0x17a')],_0x4d0834[_0x8a36('0x17b')]):_0x4d0834[_0x8a36('0x17a')]);if(_0x27d871){_0x1385b5['XMD-ORIGINATECALLERIDNAME']=_0x9c5a69['actions'][_0x14191f]['originatecalleridname']=utils['extractCalleridName'](_0x27d871);_0x1385b5[_0x8a36('0x17d')]=_0x5c280b[_0x8a36('0x15f')];}_0x4d0834[_0x8a36('0x17e')]=_0x1385b5;return ami[_0x8a36('0x9c')]({'actionid':_0x14191f,'action':_0x8a36('0x15d'),'channel':_0x9c5a69[_0x8a36('0x8c')](_0x4d0834[_0x8a36('0x8d')])?util[_0x8a36('0x41')]('SIP/%s/%s%s',_0x4d0834[_0x8a36('0x8d')][_0x8a36('0x43')],isNotNull(_0x4d0834[_0x8a36('0x17f')])?_0x4d0834[_0x8a36('0x17f')][_0x8a36('0x180')]()||'':'',_0x4d0834[_0x8a36('0x181')]>0x0?_0x5c280b[_0x8a36('0x15f')][_0x8a36('0x182')](_0x4d0834[_0x8a36('0x181')]):_0x5c280b[_0x8a36('0x15f')]):util[_0x8a36('0x41')](_0x8a36('0x183'),_[_0x8a36('0xf6')](_0x4d0834[_0x8a36('0x8e')])?_0x4d0834['Trunk'][_0x8a36('0x43')]:_0x4d0834[_0x8a36('0x8e')][_0x8a36('0x43')],isNotNull(_0x4d0834[_0x8a36('0x17f')])?_0x4d0834[_0x8a36('0x17f')][_0x8a36('0x180')]()||'':'',_0x4d0834['dialCutDigit']>0x0?_0x5c280b['phone'][_0x8a36('0x182')](_0x4d0834['dialCutDigit']):_0x5c280b[_0x8a36('0x15f')]),'callerid':_0x27d871,'Exten':_0x8a36('0x10e'),'Context':_0x8a36('0x184'),'Priority':'1','variable':_0x1385b5,'timeout':(_0x4d0834[_0x8a36('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14191f})[_0x8a36('0x3c')](function(_0x113ee1){return _0x3a6ffa(_0x113ee1);})['catch'](function(_0x404968){_0x4d0834['outboundOriginateFailureCallsDay']+=0x1;var _0x5e4faa=new History(_0x9c5a69[_0x8a36('0xf1')][_0x14191f]);logger[_0x8a36('0x66')](util[_0x8a36('0x41')]('[originateError]:\x20%s',JSON[_0x8a36('0x76')](_0x404968)));_0x5e4faa[_0x8a36('0x6f')]=0xe;_0x5e4faa[_0x8a36('0x70')]=_0x8a36('0x186');_0x5e4faa[_0x8a36('0x72')]=moment()[_0x8a36('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e4faa['endtime']=_0x5e4faa[_0x8a36('0x72')];hopperUtils['createHistory'](_0x5e4faa)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x187')));_0x9c5a69['moveContactManagedDialer'](_0x5e4faa)[_0x8a36('0xa2')](loggerCatch('[originate][error]'))[_0x8a36('0x188')](function(){delete _0x9c5a69[_0x8a36('0xf1')][_0x14191f];return _0x52d1a0(msgResponse(_0x8a36('0x15d'),_0x8a36('0x86'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x3b842b,_0x2111d0,_0x71bd4e){var _0x1b5f75=new History(_0x2111d0);if(_0x1b5f75['countbusyretry']+_0x1b5f75[_0x8a36('0x11e')]+_0x1b5f75[_0x8a36('0x12c')]+_0x1b5f75['countnosuchnumberretry']+_0x1b5f75[_0x8a36('0xd3')]+_0x1b5f75[_0x8a36('0xe8')]+_0x1b5f75['countmachineretry']+_0x1b5f75[_0x8a36('0x12d')]>=_0x71bd4e[_0x8a36('0x120')]-0x1){return!![];}switch(_0x3b842b){case 0x3:if(_0x1b5f75[_0x8a36('0x12c')]>=_0x71bd4e['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x8a36('0xd9')]({'active':![],'countnoanswerretry':_0x1b5f75[_0x8a36('0x12c')]+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e[_0x8a36('0x189')],_0x8a36('0xda'))[_0x8a36('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b5f75['ContactId'],'ListId':_0x1b5f75[_0x8a36('0xdb')],'VoiceQueueId':_0x1b5f75['VoiceQueueId']||undefined,'CampaignId':_0x1b5f75[_0x8a36('0xdd')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1b5f75['countbusyretry']>=_0x71bd4e[_0x8a36('0x18a')]-0x1){return!![];}hopperUtils[_0x8a36('0xd9')]({'active':![],'countbusyretry':_0x1b5f75['countbusyretry']+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e[_0x8a36('0x18b')],_0x8a36('0xda'))[_0x8a36('0x41')](_0x8a36('0xc2')),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75['ListId'],'VoiceQueueId':_0x1b5f75['VoiceQueueId']||undefined,'CampaignId':_0x1b5f75[_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x18c')));break;case 0x8:if(_0x1b5f75['countcongestionretry']>=_0x71bd4e[_0x8a36('0x18d')]-0x1){return!![];}hopperUtils[_0x8a36('0xd9')]({'active':![],'countcongestionretry':_0x1b5f75[_0x8a36('0x11e')]+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e['dialCongestionRetryFrequency'],'minutes')[_0x8a36('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75[_0x8a36('0xdb')],'VoiceQueueId':_0x1b5f75[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b5f75['CampaignId']||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x18e')));break;case 0x0:if(_0x1b5f75[_0x8a36('0x11f')]>=_0x71bd4e[_0x8a36('0x18f')]-0x1){return!![];}else{hopperUtils[_0x8a36('0xd9')]({'active':![],'countnosuchnumberretry':_0x1b5f75[_0x8a36('0x11f')]+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e[_0x8a36('0x190')],_0x8a36('0xda'))[_0x8a36('0x41')](_0x8a36('0xc2')),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75[_0x8a36('0xdb')],'VoiceQueueId':_0x1b5f75[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b5f75[_0x8a36('0xdd')]||undefined})['catch'](loggerCatch(_0x8a36('0x191')));}break;case 0xa:if(_0x1b5f75[_0x8a36('0xd3')]>=_0x71bd4e[_0x8a36('0xd8')]-0x1){return!![];}hopperUtils[_0x8a36('0xd9')]({'active':![],'countdropretry':_0x1b5f75['countdropretry']+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e[_0x8a36('0xd5')],_0x8a36('0xda'))[_0x8a36('0x41')](_0x8a36('0xc2')),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75['ListId'],'VoiceQueueId':_0x1b5f75[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b5f75[_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0xde')));break;case 0xb:if(_0x1b5f75[_0x8a36('0xe8')]>=_0x71bd4e[_0x8a36('0xeb')]-0x1){return!![];}hopperUtils[_0x8a36('0xd9')]({'active':![],'countabandonedretry':_0x1b5f75[_0x8a36('0xe8')]+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e[_0x8a36('0xe9')],_0x8a36('0xda'))['format'](_0x8a36('0xc2')),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75[_0x8a36('0xdb')],'VoiceQueueId':_0x1b5f75[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b5f75[_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1b5f75[_0x8a36('0x123')]>=_0x71bd4e[_0x8a36('0x124')]-0x1){return!![];}hopperUtils[_0x8a36('0xd9')]({'active':![],'countmachineretry':_0x1b5f75[_0x8a36('0x123')]+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e['dialMachineRetryFrequency'],_0x8a36('0xda'))[_0x8a36('0x41')](_0x8a36('0xc2')),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75[_0x8a36('0xdb')],'VoiceQueueId':_0x1b5f75[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b5f75[_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1b5f75['countagentrejectretry']>=_0x71bd4e[_0x8a36('0x192')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1b5f75[_0x8a36('0x12d')]+=0x1,'scheduledat':moment()[_0x8a36('0xed')](_0x71bd4e[_0x8a36('0x193')],_0x8a36('0xda'))[_0x8a36('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b5f75[_0x8a36('0xee')],'ListId':_0x1b5f75[_0x8a36('0xdb')],'VoiceQueueId':_0x1b5f75[_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b5f75['CampaignId']||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x194')));break;default:return!![];}};Dialer[_0x8a36('0x19')]['callProgressDetecting']=function(_0x35ac75,_0xc992c2,_0x3fab9e){var _0x4e7fc4=this;var _0x263228=new History(_0x35ac75);var _0x1eb148=![];var _0x48ee54;var _0x546d1e;return new Promise(function(_0x58441b,_0x76b1c8){if(_[_0x8a36('0x53')](_0xc992c2)&&typeof _0xc992c2!==_0x8a36('0x15c')){return _0x76b1c8(msgResponse(_0x8a36('0x195'),_0x8a36('0x95'),'entity\x20is\x20undefine'));}if(_[_0x8a36('0x53')](_0x3fab9e)&&typeof _0x3fab9e!==_0x8a36('0x15c')){return _0x76b1c8(msgResponse(_0x8a36('0x195'),'Failure',_0x8a36('0x196')));}hopperUtils[_0x8a36('0xea')](_0x263228,_0x3fab9e[_0x8a36('0xc5')],_0xc992c2)[_0x8a36('0x3c')](function(_0x4a6023){if(_0x4a6023['additional']==0x1)_0x1eb148=!![];switch(_0x3fab9e['reason']){case'0':_0xc992c2[_0x8a36('0x197')]+=0x1;_0x263228[_0x8a36('0x6f')]=0x0;_0x263228[_0x8a36('0x70')]=_0x8a36('0x198');_0x263228[_0x8a36('0x11f')]+=0x1;_0x263228[_0x8a36('0xd4')]+=0x1;ami[_0x8a36('0x11a')](_0x8a36('0x199'),ut[_0x8a36('0x115')](_0x35ac75,_0x8a36('0x19a')));_0x48ee54=_0xc992c2[_0x8a36('0x190')];_0x546d1e=_0xc992c2[_0x8a36('0xd6')];hopperUtils['createHistory'](_0x263228)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x11c')));if(_0x4e7fc4[_0x8a36('0x19b')](0x0,_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0x11f')]>=_0xc992c2[_0x8a36('0x18f')]){_0x4e7fc4[_0x8a36('0x125')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x19c'));}else{_0x4e7fc4[_0x8a36('0x121')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x19c'));}}break;case'3':_0xc992c2[_0x8a36('0x19d')]+=0x1;_0x263228[_0x8a36('0x6f')]=0x3;_0x263228[_0x8a36('0x70')]=_0x8a36('0x19e');_0x263228[_0x8a36('0x12c')]+=0x1;_0x263228[_0x8a36('0xd4')]+=0x1;var _0x2232a3=ut[_0x8a36('0x19f')](_0x35ac75,_0xc992c2);ami[_0x8a36('0x11a')]('custom:agentnoanswer',_0x2232a3);_0x48ee54=_0xc992c2[_0x8a36('0x189')];_0x546d1e=_0xc992c2['callAdditionalPhoneAfterMin'];hopperUtils[_0x8a36('0xe1')](_0x263228)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x1a0')));if(_0x4e7fc4[_0x8a36('0x19b')](0x3,_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0x12c')]>=_0xc992c2['dialNoAnswerMaxRetry']){_0x4e7fc4[_0x8a36('0x125')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x1a1'));}else{_0x4e7fc4['stateGlobal'](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x1a1'));}}break;case'5':_0xc992c2[_0x8a36('0x1a2')]+=0x1;_0x263228['state']=0x5;_0x263228[_0x8a36('0x70')]='Busy';_0x263228['countbusyretry']+=0x1;_0x263228[_0x8a36('0xd4')]+=0x1;ami[_0x8a36('0x11a')](_0x8a36('0x1a3'),ut['buildObj'](_0x35ac75,_0x8a36('0x1a4')));_0x48ee54=_0xc992c2[_0x8a36('0x18b')];_0x546d1e=_0xc992c2[_0x8a36('0xd6')];hopperUtils['createHistory'](_0x263228)[_0x8a36('0xa2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4e7fc4['checkRetriveMax'](0x5,_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0x11d')]>=_0xc992c2[_0x8a36('0x18a')]){_0x4e7fc4[_0x8a36('0x125')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x1a5'));}else{_0x4e7fc4[_0x8a36('0x121')](_0x263228,_0x58441b,_0x76b1c8,'reason\x205\x20busy');}}break;case'8':_0xc992c2['outboundCongestionCallsDay']+=0x1;_0x263228[_0x8a36('0x6f')]=0x8;_0x263228[_0x8a36('0x70')]=_0x8a36('0x1a6');_0x263228[_0x8a36('0x11e')]+=0x1;_0x263228['countglobal']+=0x1;_0x48ee54=_0xc992c2[_0x8a36('0x1a7')];_0x546d1e=_0xc992c2['callAdditionalPhoneAfterMin'];ami[_0x8a36('0x11a')](_0x8a36('0x1a8'),ut[_0x8a36('0x115')](_0x35ac75,_0x8a36('0x1a9')));hopperUtils[_0x8a36('0xe1')](_0x263228)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x1aa')));if(_0x4e7fc4['checkRetriveMax'](0x8,_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0x11e')]>=_0xc992c2[_0x8a36('0x18d')]){_0x4e7fc4[_0x8a36('0x125')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x1ab'));}else{_0x4e7fc4[_0x8a36('0x121')](_0x263228,_0x58441b,_0x76b1c8,'reason\x208\x20congestion');}}break;case'11':_0xc992c2[_0x8a36('0x1ac')]+=0x1;_0x263228['state']=0xb;_0x263228[_0x8a36('0x70')]='Abandoned';_0x263228[_0x8a36('0xe8')]+=0x1;_0x263228[_0x8a36('0xd4')]+=0x1;_0x48ee54=_0xc992c2['dialAbandonedRetryFrequency'];_0x546d1e=_0xc992c2[_0x8a36('0xd6')];hopperUtils[_0x8a36('0xe1')](_0x263228)['catch'](loggerCatch(_0x8a36('0xf0')));if(_0x4e7fc4[_0x8a36('0x19b')](0xb,_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0xe8')]>=_0xc992c2[_0x8a36('0xeb')]){_0x4e7fc4[_0x8a36('0x125')](_0x263228,_0x58441b,_0x76b1c8,'reason\x2011\x20abandoned');}else{_0x4e7fc4[_0x8a36('0x121')](_0x263228,_0x58441b,_0x76b1c8,'reason\x2011\x20abandoned');}}break;case'20':_0xc992c2[_0x8a36('0x1ad')]+=0x1;_0x263228[_0x8a36('0x6f')]=0x14;_0x263228[_0x8a36('0x70')]='AgentReject';_0x263228[_0x8a36('0x12d')]+=0x1;_0x263228[_0x8a36('0xd4')]+=0x1;_0x48ee54=_0xc992c2['dialAgentRejectRetryFrequency'];_0x546d1e=_0xc992c2['callAdditionalPhoneAfterMin'];ami[_0x8a36('0x11a')](_0x8a36('0x1ae'),ut[_0x8a36('0x115')](_0x35ac75,_0x8a36('0x1af')));hopperUtils['createHistory'](_0x263228)[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x1b0')));if(_0x4e7fc4[_0x8a36('0x19b')](0x14,_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0x12d')]>=_0xc992c2[_0x8a36('0x192')]){_0x4e7fc4[_0x8a36('0x125')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x1b1'));}else{_0x4e7fc4[_0x8a36('0x121')](_0x263228,_0x58441b,_0x76b1c8,_0x8a36('0x1b1'));}}break;default:_0xc992c2['outboundUnknownCallsDay']+=0x1;_0x263228['state']=0xc;_0x263228[_0x8a36('0x70')]=_0x3fab9e[_0x8a36('0xc5')];_0x48ee54=_0xc992c2['dialAgentRejectRetryFrequency'];_0x546d1e=_0xc992c2[_0x8a36('0xd6')];hopperUtils[_0x8a36('0xe1')](_0x263228)[_0x8a36('0xa2')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4e7fc4['checkRetriveMax'](_0x3fab9e[_0x8a36('0xc5')],_0x35ac75,_0xc992c2)&&!_0x1eb148){if(_0x263228[_0x8a36('0x11d')]+_0x263228['countcongestionretry']+_0x263228[_0x8a36('0x12c')]+_0x263228['countnosuchnumberretry']+_0x263228[_0x8a36('0xd3')]+_0x263228[_0x8a36('0xe8')]+_0x263228[_0x8a36('0x123')]+_0x263228[_0x8a36('0x12d')]>=_0xc992c2['dialGlobalMaxRetry']){_0x4e7fc4[_0x8a36('0x121')](_0x263228,_0x58441b,_0x76b1c8,_0x3fab9e['reason']);}else{_0x4e7fc4['createStateFinal'](_0x263228,_0x58441b,_0x76b1c8,_0x3fab9e['reason']);}}}})['then'](function(){if(_0x1eb148){hopperUtils[_0x8a36('0xe3')](_0x263228,_0x48ee54,_0x546d1e)[_0x8a36('0x3c')](function(){return _0x58441b(0x1);});}});});};Dialer['prototype'][_0x8a36('0x121')]=function(_0x325004,_0x265417,_0x33cdb6,_0x128417){var _0x24ad9b=new Final(_0x325004);_0x24ad9b['state']=0xf;_0x24ad9b['statedesc']=_0x8a36('0x1b2');this[_0x8a36('0x125')](_0x24ad9b,_0x265417,_0x33cdb6,_0x128417);};Dialer[_0x8a36('0x19')][_0x8a36('0x125')]=function(_0x19d5f2,_0x548313,_0x50fbb0,_0x2905ed){hopperUtils[_0x8a36('0xcb')](_0x19d5f2)['then'](function(){return _0x548313(msgResponse(_0x8a36('0x195'),_0x8a36('0x1b3'),_0x2905ed));})[_0x8a36('0xa2')](function(){return _0x50fbb0(msgResponse(_0x8a36('0x1b4'),_0x8a36('0x95'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x8a36('0x7')]=function(_0x2a19b2){var _0x1098b1=_0x2a19b2[_0x8a36('0x1b5')]/0x64;var _0x410c9b=_0x2a19b2['outboundDropCallsDayTimeout']/(_0x2a19b2[_0x8a36('0xd1')]+_0x2a19b2[_0x8a36('0x112')]);var _0x451445=Math['round'](_0x2a19b2[_0x8a36('0x1b6')]*(_0x2a19b2['predictiveIntervalMaxThreshold']/0x64));var _0x43cfc7=Math['round'](_0x2a19b2[_0x8a36('0x1b6')]*(_0x2a19b2[_0x8a36('0x1b7')]/0x64));var _0x4d317b=_0x2a19b2[_0x8a36('0x138')]+_0x2a19b2[_0x8a36('0x1b8')];var _0x32d07b=Math[_0x8a36('0x1b9')](_0x2a19b2[_0x8a36('0x1ba')]*_0x2a19b2[_0x8a36('0x5b')]*_0x2a19b2['predictiveIntervalHitRate']*_0x2a19b2[_0x8a36('0x1bb')]);if(_['isUndefined'](_0x2a19b2['startProgressive'])){if(!_[_0x8a36('0x53')](_0x2a19b2['startPredictive'])){_0x2a19b2[_0x8a36('0x26')]=undefined;loggerPredictive[_0x8a36('0x66')]('[startMethodPredictive][StartProgressive]',_0x8a36('0x1bc'));}if(!_[_0x8a36('0x53')](_0x2a19b2['handlePredictive'])){loggerPredictive[_0x8a36('0x66')](_0x8a36('0x1bd'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2a19b2[_0x8a36('0x64')]);_0x2a19b2[_0x8a36('0x64')]=undefined;}_0x2a19b2[_0x8a36('0x60')]=moment()[_0x8a36('0x41')](_0x8a36('0xc2'));loggerPredictive['info'](_0x2a19b2[_0x8a36('0x43')],_0x8a36('0x1be'),_0x2a19b2[_0x8a36('0x60')]);this['handlePower'](_0x2a19b2,0x1);}else if(ifInterval(_0x2a19b2[_0x8a36('0x1bf')],_0x2a19b2['startProgressive'])){this[_0x8a36('0xb5')](_0x2a19b2,0x1);loggerPredictiveCalls[_0x8a36('0x4a')]('[startMethodPredictive][StartProgressive][Loop]',_0x2a19b2[_0x8a36('0x60')],_0x2a19b2[_0x8a36('0x43')]);_0x2a19b2['erlangCalls']=0x0;_0x2a19b2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1098b1<_0x410c9b&&_0x2a19b2[_0x8a36('0x1c0')]===_0x8a36('0x1c1')){clearPredictiveAttributes(_0x2a19b2);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x1c2'),_0x8a36('0x1c3'),_0x410c9b,_0x8a36('0x60'),_0x2a19b2[_0x8a36('0x43')]);}else if(_0x32d07b<_0x2a19b2[_0x8a36('0xd2')]&&_0x2a19b2[_0x8a36('0x1c0')]==='dropRate'){clearPredictiveAttributes(_0x2a19b2);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x1c4'),'Max\x20Drop\x20',_0x32d07b,'Drop\x20in\x20this\x20interval',_0x2a19b2[_0x8a36('0xd2')],'startProgressive',_0x2a19b2[_0x8a36('0x43')]);}else if(!ifInterval(_0x2a19b2['dialPredictiveInterval'],_0x2a19b2[_0x8a36('0x60')])&&_['isUndefined'](_0x2a19b2[_0x8a36('0x26')])&&!_[_0x8a36('0x53')](_0x2a19b2[_0x8a36('0x60')])){_0x2a19b2[_0x8a36('0x26')]=moment()[_0x8a36('0x41')](_0x8a36('0xc2'));loggerPredictive[_0x8a36('0x4a')](_0x2a19b2[_0x8a36('0x43')],_0x8a36('0x1c5'),_0x2a19b2['startPredictive']);hopperUtils[_0x8a36('0x1c6')](_0x2a19b2[_0x8a36('0x1bf')])[_0x8a36('0x3c')](this[_0x8a36('0x1c7')](_0x2a19b2))[_0x8a36('0x3c')](mergeDataErlangB(_0x2a19b2))[_0x8a36('0x3c')](this['startMethodPredictive'](_0x2a19b2))[_0x8a36('0xa2')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2a19b2));}else if(!ifInterval(_0x2a19b2[_0x8a36('0x1bf')],_0x2a19b2['startPredictive'])){_0x2a19b2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2a19b2[_0x8a36('0x26')]=moment()['format'](_0x8a36('0xc2'));loggerPredictive[_0x8a36('0x4a')](_0x2a19b2[_0x8a36('0x43')],_0x8a36('0x1c8'),_0x2a19b2[_0x8a36('0x26')]);clearInterval(_0x2a19b2[_0x8a36('0x64')]);_0x2a19b2['handlePredictive']=undefined;hopperUtils[_0x8a36('0x1c6')](_0x2a19b2[_0x8a36('0x1bf')])['then'](this[_0x8a36('0x1c7')](_0x2a19b2))[_0x8a36('0x3c')](mergeDataErlangB(_0x2a19b2))[_0x8a36('0x3c')](this[_0x8a36('0x1c9')](_0x2a19b2))[_0x8a36('0xa2')](loggerCatchPredictive(_0x8a36('0x1ca'),_0x2a19b2));}else if(_0x2a19b2[_0x8a36('0x1b6')]&&_0x4d317b<_0x2a19b2['predictiveIntervalAvailable']-_0x43cfc7){clearPredictiveAttributes(_0x2a19b2);loggerPredictive[_0x8a36('0x4a')](_0x2a19b2['name'],_0x8a36('0x1cb'),_0x4d317b,_0x8a36('0x1cc'),_0x2a19b2['predictiveIntervalAvailable'],'-',_0x43cfc7,'=',_0x2a19b2['predictiveIntervalAvailable']-_0x43cfc7,')');}else if(_0x2a19b2[_0x8a36('0x1b6')]&&_0x4d317b>_0x2a19b2[_0x8a36('0x1b6')]+_0x451445){clearPredictiveAttributes(_0x2a19b2);loggerPredictive[_0x8a36('0x4a')](_0x2a19b2['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4d317b,')\x20are\x20more\x20than\x20threshold\x20(',_0x2a19b2[_0x8a36('0x1b6')],'+',_0x451445,'=',_0x2a19b2[_0x8a36('0x1b6')]+_0x451445,')');}};Dialer[_0x8a36('0x19')][_0x8a36('0x1c7')]=function(_0xc6e51c){var _0x41e4c9=this;return function(_0x42102d){return new Promise(function(_0x4863a4,_0x283a60){_[_0x8a36('0x5e')](_0xc6e51c,_0x42102d[0x0]);if(checkGetDataPredictive(_0x42102d[0x0])){var _0x2c09e2=_0xc6e51c[_0x8a36('0x1b6')]=_0xc6e51c[_0x8a36('0x1b8')]+_0xc6e51c[_0x8a36('0x138')];var _0x2c2623=_0xc6e51c[_0x8a36('0x1bf')]*0x3c;var _0x445912=_0x42102d[0x0][_0x8a36('0x50')]+_0x42102d[0x0][_0x8a36('0x55')];var _0x320ddc=(_0x42102d[0x0][_0x8a36('0x49')]+_0x42102d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x42102d[0x0][_0x8a36('0x4d')])/_0x42102d[0x0][_0x8a36('0x52')];_0xc6e51c[_0x8a36('0x1cd')]=_0x320ddc>0x0?_0x320ddc:0x1;switch(_0xc6e51c[_0x8a36('0x1c0')]){case _0x8a36('0x1c1'):var _0xb06186=_0xc6e51c[_0x8a36('0x1b5')]/0x64;return _0x41e4c9['abandonmentRate'](_0x2c09e2,_0x2c2623,_0x445912,_0x320ddc,_0xb06186)['then'](function(_0x24ceee){return _0x4863a4(_0x24ceee);});case _0x8a36('0x1ce'):var _0x96d21a=_0xc6e51c['dialPredictiveOptimizationPercentage']/0x64;return _0x41e4c9[_0x8a36('0x1cf')](_0x2c09e2,_0x2c2623,_0x445912,_0x320ddc,_0x96d21a)[_0x8a36('0x3c')](function(_0x10050f){return _0x4863a4(_0x10050f);});default:return _0x283a60(msgResponse('[getDataPredictive]',_0x8a36('0x95'),_0x8a36('0x1d0')));}}else{return _0x283a60(msgResponse('[getDataPredictive]',_0x8a36('0x95'),_0x8a36('0x1d1')));}});};};Dialer[_0x8a36('0x19')][_0x8a36('0x1d2')]=function(_0xd633e4){var _0x4c914c=this;return function(_0x3d2fb7){return new Promise(function(_0x3466b9,_0x1dbb63){_[_0x8a36('0x5e')](_0xd633e4,_0x3d2fb7[0x0]);if(checkGetDataPredictive(_0x3d2fb7[0x0])){loggerPredictive[_0x8a36('0x4a')](JSON[_0x8a36('0x76')](_0x3d2fb7[0x0]));if(_0xd633e4[_0x8a36('0x1c0')]==='dropRate'){return _0x4c914c[_0x8a36('0x14c')](_0xd633e4['id'])['then'](function(_0x24d368){var _0x143bdd=_0xd633e4[_0x8a36('0x1d3')]-_0x24d368[0x0]['outboundQueuePauses'];var _0x3a7628=_0xd633e4[_0x8a36('0x1bf')]*0x3c;var _0x4b0164=_0x3d2fb7[0x0][_0x8a36('0x50')]+_0x3d2fb7[0x0][_0x8a36('0x55')];var _0x5c918d=(_0x3d2fb7[0x0][_0x8a36('0x49')]+_0x3d2fb7[0x0][_0x8a36('0xd0')]+_0x3d2fb7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3d2fb7[0x0][_0x8a36('0x52')];var _0x16cbd7=_0xd633e4[_0x8a36('0x1b5')]/0x64;_0xd633e4['predictiveIntervalPauses']=_0x24d368[0x0][_0x8a36('0x1d4')]||0x0;_0xd633e4[_0x8a36('0x1cd')]=_0x5c918d>0x0?_0x5c918d:0x1;return _0x4c914c['abandonmentRate'](_0x143bdd,_0x3a7628,_0x4b0164,_0x5c918d,_0x16cbd7);})[_0x8a36('0x3c')](function(_0x19fdf7){return _0x3466b9(_0x19fdf7);})[_0x8a36('0xa2')](function(_0x2bb225){return _0x1dbb63(msgResponse('[CatchErlangB]',_0x8a36('0x95'),JSON['stringify'](_0x2bb225)));});}if(_0xd633e4['dialPredictiveOptimization']===_0x8a36('0x1ce')){return _0x4c914c['getVoiceQueueRtPauses'](_0xd633e4['id'])[_0x8a36('0x3c')](function(_0x3c7c89){var _0xd682ba=_0xd633e4[_0x8a36('0x1d3')]-_0x3c7c89[0x0][_0x8a36('0x1d4')];var _0x802825=_0xd633e4[_0x8a36('0x1bf')]*0x3c;var _0x4d58f5=_0x3d2fb7[0x0][_0x8a36('0x50')]+_0x3d2fb7[0x0]['predictiveIntervalAvgHoldtime'];var _0x2089dd=(_0x3d2fb7[0x0][_0x8a36('0x49')]+_0x3d2fb7[0x0][_0x8a36('0xd0')]+_0x3d2fb7[0x0][_0x8a36('0x4d')])/_0x3d2fb7[0x0][_0x8a36('0x52')];var _0x2d0619=_0xd633e4[_0x8a36('0x1b5')]/0x64;_0xd633e4[_0x8a36('0x1d5')]=_0x3c7c89[0x0][_0x8a36('0x1d4')]||0x0;_0xd633e4[_0x8a36('0x1cd')]=_0x2089dd>0x0?_0x2089dd:0x1;return _0x4c914c[_0x8a36('0x1cf')](_0xd682ba,_0x802825,_0x4d58f5,_0x2089dd,_0x2d0619);})[_0x8a36('0x3c')](function(_0x1704cd){return _0x3466b9(_0x1704cd);})['catch'](function(_0x4243c8){return _0x1dbb63(msgResponse(_0x8a36('0x1d6'),'Failure',JSON[_0x8a36('0x76')](_0x4243c8)));});}}else{return _0x1dbb63(msgResponse(_0x8a36('0x1d7'),'Failure',_0x8a36('0x1d1')));}});};};Dialer[_0x8a36('0x19')][_0x8a36('0x1c9')]=function(_0x13edcf){var _0x3ea4ac=this;return function(){var _0x99d39e=0x0;var _0x4028f1=Math[_0x8a36('0x1b9')](_0x13edcf['erlangCallToSecond']*0x3e8);if(_0x4028f1>0x0){_0x4028f1=_0x4028f1<0x64?0x64:_0x4028f1;loggerPredictive['info'](_0x13edcf[_0x8a36('0x43')],'one\x20call\x20every:',_0x4028f1,'milliseconds');_0x13edcf[_0x8a36('0x64')]=setInterval(function(){_0x3ea4ac[_0x8a36('0x64')](_0x13edcf);loggerPredictiveCalls['info'](_0x8a36('0x1d8'),_0x99d39e+=0x1);},_0x4028f1);}else{loggerPredictive[_0x8a36('0x4a')](_0x13edcf[_0x8a36('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x8a36('0x19')][_0x8a36('0x1d9')]=function(_0x5118b0,_0x2ec888){var _0x1b1490=this;return function(_0xa8b41c){if(_['isEmpty'](_0xa8b41c)){if(_[_0x8a36('0xf6')](_0x2ec888[_0x8a36('0x154')])||!_0x2ec888[_0x8a36('0x1da')]){if(_0x5118b0['dialMethod']===_0x8a36('0x6')){_0x5118b0['queueStatusComplete']=_[_0x8a36('0x53')](_0x5118b0[_0x8a36('0x73')])?!![]:_0x5118b0[_0x8a36('0x73')];var _0x259bc3=uuid['v4']();_0x1b1490[_0x8a36('0xf1')][_0x259bc3]=new Action(_0x5118b0,_0x2ec888,_0x259bc3);loggerBooked[_0x8a36('0x4a')](_0x8a36('0x1db'),_0x259bc3,_0x8a36('0x1dc'),JSON[_0x8a36('0x76')](_0x5118b0[_0x8a36('0x73')]),_0x8a36('0x1dd'),_0x5118b0[_0x8a36('0x43')]);if(_0x5118b0['queueStatusComplete']){_0x5118b0[_0x8a36('0x73')]=![];_0x1b1490[_0x8a36('0x27')][_0x1b1490[_0x8a36('0xf1')][_0x259bc3][_0x8a36('0xbe')]]=[];ami[_0x8a36('0x9c')]({'actionid':_0x259bc3,'action':_0x8a36('0x1de'),'queue':_0x5118b0[_0x8a36('0x43')]})[_0x8a36('0xa2')](function(){_0x1b1490[_0x8a36('0xc0')](_0x5118b0);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1b1490['actions'][_0x259bc3]['ContactId'],'ListId':_0x1b1490['actions'][_0x259bc3][_0x8a36('0xdb')],'VoiceQueueId':_0x1b1490[_0x8a36('0xf1')][_0x259bc3]['VoiceQueueId']||undefined,'CampaignId':_0x1b1490[_0x8a36('0xf1')][_0x259bc3][_0x8a36('0xdd')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1b1490[_0x8a36('0xf1')][_0x259bc3];});}else{loggerBooked[_0x8a36('0x4a')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x5118b0[_0x8a36('0x73')]),_0x8a36('0x1dd'),_0x5118b0[_0x8a36('0x43')]);_0x1b1490[_0x8a36('0xc0')](_0x5118b0);hopperUtils[_0x8a36('0xd9')]({'active':![],'ContactId':_0x1b1490[_0x8a36('0xf1')][_0x259bc3]['ContactId'],'ListId':_0x1b1490['actions'][_0x259bc3][_0x8a36('0xdb')],'VoiceQueueId':_0x1b1490[_0x8a36('0xf1')][_0x259bc3][_0x8a36('0xdc')]||undefined,'CampaignId':_0x1b1490[_0x8a36('0xf1')][_0x259bc3][_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x1df')));delete _0x1b1490['actions'][_0x259bc3];}}else{return _0x1b1490['actionOriginate'](_0x5118b0,_0x2ec888);}}else{if(utils[_0x8a36('0x5f')](undefined,_0x2ec888[_0x8a36('0x1e0')])<_0x5118b0[_0x8a36('0x1e1')]*0x3c){if(_0x2ec888['Agent']&&!_0x2ec888['Agent'][_0x8a36('0x1e2')]){_0x1b1490['preview'][_0x8a36('0xfb')](_0x2ec888['id'])[_0x8a36('0x188')](function(){_0x1b1490[_0x8a36('0xc0')](_0x5118b0);});}else{hopperUtils[_0x8a36('0x1e3')]({'active':![]},_0x2ec888['id'],0x1)[_0x8a36('0x188')](function(){_0x1b1490[_0x8a36('0xc0')](_0x5118b0);});}}else{_0x5118b0[_0x8a36('0x1e4')]+=0x1;_0x1b1490[_0x8a36('0xc0')](_0x5118b0);if(_0x5118b0[_0x8a36('0x1e5')]){hopperUtils[_0x8a36('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ec888['ContactId'],'ListId':_0x2ec888[_0x8a36('0xdb')],'VoiceQueueId':_0x2ec888[_0x8a36('0xdc')]||undefined,'CampaignId':_0x2ec888[_0x8a36('0xdd')]||undefined})[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x1e6')));hopperUtils['createHistory'](createObjHistory(_0x5118b0,_0x2ec888,utils[_0x8a36('0x6c')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0x8a36('0xa2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1b1490[_0x8a36('0x12a')](createObjHistory(_0x5118b0,_0x2ec888,utils[_0x8a36('0x6c')][_0x8a36('0x1e7')],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x5118b0[_0x8a36('0x1e8')]+=0x1;_0x1b1490[_0x8a36('0x12a')](createObjHistory(_0x5118b0,_0x2ec888,utils['CAMPAIGN_STATUS'][_0x8a36('0x1e9')],0xd,_0x8a36('0x1ea')),_0x8a36('0x1eb'),'[Originate][MoveBlacklist]');throw _0x8a36('0x1ec');}};};Dialer[_0x8a36('0x19')][_0x8a36('0x1ed')]=function(_0x157740){var _0x5d4ed8=this;var _0x384461=_0x157740[_0x8a36('0x1ee')]-_0x157740[_0x8a36('0x14e')];emitCampaignSummary(_0x157740);if(_0x384461>0x0&&_0x157740[_0x8a36('0x69')]==0x0){if(_0x384461>this[_0x8a36('0x21')]){_0x384461=this['maxNumberOriginate'];}_0x157740[_0x8a36('0x69')]=0x1;hopperUtils[_0x8a36('0x1ef')](_0x157740,_0x384461)['then'](function(_0x3b1c29){_0x157740[_0x8a36('0x69')]=0x0;if(_0x3b1c29){if(!utils[_0x8a36('0x1f0')](_0x3b1c29)){_0x157740['message']=utils[_0x8a36('0x6c')][_0x8a36('0x1f1')];logger[_0x8a36('0x4a')]('[getContactCampaign2][Empty]'+_0x157740[_0x8a36('0x43')]);}else{_0x157740[_0x8a36('0x14e')]+=_0x3b1c29['length'];_0x157740['message']=utils[_0x8a36('0x6c')][_0x8a36('0x1f2')];for(var _0x97d637=0x0;_0x97d637<_0x3b1c29[_0x8a36('0x9b')];_0x97d637+=0x1){_0x157740[_0x8a36('0x1f3')]+=0x1;if(_[_0x8a36('0xf6')](_0x3b1c29[_0x97d637])||_[_0x8a36('0xf6')](_0x3b1c29[_0x97d637]['Contact'])||_[_0x8a36('0xf6')](_0x3b1c29[_0x97d637][_0x8a36('0x15f')])){_0x5d4ed8['emptyContact']('[actionOriginate]\x20',_0x157740,_0x3b1c29[_0x97d637]);}else{hopperUtils[_0x8a36('0x1f4')](_[_0x8a36('0x77')](_0x3b1c29[_0x97d637],[_0x8a36('0xdd'),_0x8a36('0x15f')]))[_0x8a36('0x3c')](_0x5d4ed8[_0x8a36('0x1d9')](_0x157740,_0x3b1c29[_0x97d637]))[_0x8a36('0xa2')](_0x5d4ed8[_0x8a36('0x151')](_0x8a36('0x1f5'),_0x157740));}}}}})[_0x8a36('0xa2')](loggerGetContactDialer(_0x8a36('0x1f6'),_0x157740,_0x384461));}};Dialer[_0x8a36('0x19')][_0x8a36('0xb5')]=function(_0x53a448,_0xfdff23){var _0x307729=this;var _0x2418cf=[];if(_0xfdff23<0x1||_0x53a448[_0x8a36('0xb3')]==='booked'){_0xfdff23=0x1;}var _0xce007e=Math[_0x8a36('0x1b9')](_0x53a448[_0x8a36('0x138')]*_0xfdff23)-_0x53a448[_0x8a36('0x14e')];if(_0x53a448[_0x8a36('0x1f7')]>0x0){var _0x222bb6=_0x53a448['dialLimitQueue']-_0x53a448['originated']-_0x53a448[_0x8a36('0x1b8')]-_0x53a448[_0x8a36('0x13a')];if(_0xce007e>_0x222bb6){_0xce007e=_0x222bb6;}}if(_0xce007e>0x0&&_0x53a448[_0x8a36('0x69')]==0x0){if(_0x53a448['dialMethod']===_0x8a36('0x6')){_0xce007e=0x1;}if(_0xce007e>this[_0x8a36('0x21')]){_0xce007e=this[_0x8a36('0x21')];}for(var _0x49d568 in this[_0x8a36('0x1f')]){if(typeof this['agents'][_0x49d568]!==_0x8a36('0xab')){if(this[_0x8a36('0x1f')][_0x49d568][_0x8a36('0x6f')]===_0x8a36('0x1f8')&&this['agents'][_0x49d568][_0x8a36('0x88')]===_0x8a36('0x89')){_0x2418cf['push'](this[_0x8a36('0x1f')][_0x49d568]['id']);}}}_0x53a448[_0x8a36('0x69')]=0x1;hopperUtils[_0x8a36('0x1f9')](_0x53a448,_0x2418cf,_0xce007e)[_0x8a36('0x3c')](function(_0x3d0937){_0x53a448[_0x8a36('0x69')]=0x0;if(_0x3d0937){if(!utils[_0x8a36('0x1f0')](_0x3d0937)){hopperUtils[_0x8a36('0x1fa')](_0x53a448)[_0x8a36('0x3c')](sendMessageReschedule(_0x53a448))['catch'](loggerCatch(_0x8a36('0x1fb')));}else{_0x53a448[_0x8a36('0x14e')]+=_0x3d0937[_0x8a36('0x9b')];_0x53a448[_0x8a36('0x6b')]=_0x53a448['dialMethod']===_0x8a36('0x6')?utils['CAMPAIGN_STATUS'][_0x8a36('0x13b')]:utils[_0x8a36('0x6c')][_0x8a36('0x1f2')];for(var _0x4495cc=0x0;_0x4495cc<_0x3d0937[_0x8a36('0x9b')];_0x4495cc+=0x1){if(_['isNil'](_0x3d0937[_0x4495cc])||_[_0x8a36('0xf6')](_0x3d0937[_0x4495cc][_0x8a36('0x176')])||_[_0x8a36('0xf6')](_0x3d0937[_0x4495cc][_0x8a36('0x15f')])){_0x307729['emptyContact'](_0x8a36('0x1fc'),_0x53a448,_0x3d0937[_0x4495cc]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x3d0937[_0x4495cc],[_0x8a36('0xdc'),_0x8a36('0x15f')]))[_0x8a36('0x3c')](_0x307729[_0x8a36('0x1d9')](_0x53a448,_0x3d0937[_0x4495cc]))[_0x8a36('0xa2')](_0x307729[_0x8a36('0x151')](_0x8a36('0x1fc'),_0x53a448));}}}}})[_0x8a36('0xa2')](loggerGetContactDialer(_0x8a36('0x1fd'),_0x53a448,_0xce007e));}};Dialer['prototype'][_0x8a36('0x64')]=function(_0x1e9b5a){if(_0x1e9b5a[_0x8a36('0x1f7')]>0x0){var _0x5b32a8=_0x1e9b5a['dialLimitQueue']-_0x1e9b5a['originated']-_0x1e9b5a[_0x8a36('0x1b8')];if(_0x5b32a8>0x0&&_0x1e9b5a[_0x8a36('0x69')]==0x0){this['tryOriginatePredictive'](_0x1e9b5a);}else{loggerPredictiveCalls[_0x8a36('0x4a')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x1e9b5a);}};Dialer[_0x8a36('0x19')]['tryOriginatePredictive']=function(_0x2e9c16){var _0x1818a7=this;var _0x3b50e6=[];_0x2e9c16['originated']+=0x1;for(var _0x183c2a in this[_0x8a36('0x1f')]){if(typeof this[_0x8a36('0x1f')][_0x183c2a]!==_0x8a36('0xab')){if(this[_0x8a36('0x1f')][_0x183c2a][_0x8a36('0x6f')]==='not_inuse'&&this[_0x8a36('0x1f')][_0x183c2a][_0x8a36('0x88')]===_0x8a36('0x89')){_0x3b50e6['push'](this['agents'][_0x183c2a]['id']);}}}_0x2e9c16[_0x8a36('0x69')]=0x1;return this['getContactDialer'](_0x2e9c16['id'],_0x3b50e6,0x1,_0x2e9c16[_0x8a36('0x1fe')],_0x2e9c16)[_0x8a36('0x3c')](function(_0x2625ef){_0x2e9c16[_0x8a36('0x69')]=0x1;if(_0x2625ef){if(!utils[_0x8a36('0x1f0')](_0x2625ef)){utils[_0x8a36('0x68')](_0x2e9c16,0x1,0x0);return hopperUtils[_0x8a36('0x1fa')](_0x2e9c16)[_0x8a36('0x3c')](sendMessageReschedule(_0x2e9c16))[_0x8a36('0xa2')](loggerCatch(_0x8a36('0x1fb')));}else{_0x2e9c16['message']=utils[_0x8a36('0x6c')]['RUNNING'];if(_[_0x8a36('0xf6')](_0x2625ef[0x0])||_[_0x8a36('0xf6')](_0x2625ef[0x0][_0x8a36('0x176')])||_['isNil'](_0x2625ef[0x0][_0x8a36('0x15f')])){_0x1818a7[_0x8a36('0x152')](_0x8a36('0x1fc'),_0x2e9c16,_0x2625ef[0x0]);}else{return hopperUtils[_0x8a36('0x1ff')](_[_0x8a36('0x77')](_0x2625ef[0x0],[_0x8a36('0xdc'),'phone']))[_0x8a36('0x3c')](_0x1818a7['checkContactBlack'](_0x2e9c16,_0x2625ef[0x0]))[_0x8a36('0xa2')](_0x1818a7[_0x8a36('0x151')](_0x8a36('0x200'),_0x2e9c16));}}}})[_0x8a36('0xa2')](loggerGetContactDialer(_0x8a36('0x201'),_0x2e9c16,0x1));};Dialer[_0x8a36('0x19')][_0x8a36('0x202')]=function(_0x597405,_0x54c78e,_0x5db715,_0x40ed2a,_0x59ac17,_0x1fc8ae){loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x203'));loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x204'),_0x597405);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x205'),_0x54c78e);loggerPredictive[_0x8a36('0x4a')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5db715);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x206'),_0x40ed2a);loggerPredictive['info'](_0x8a36('0x207'),_0x59ac17);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x51'));return new Promise(function(_0x27f229,_0x5e2146){if(_0x597405<=0x0||isNaN(_0x597405)){return _0x5e2146(msgResponse('[abandonmentRate]',_0x8a36('0x86'),_0x8a36('0x208')+_0x597405));}if(_0x5db715<=0x0||isNaN(_0x5db715)){return _0x5e2146(msgResponse(_0x8a36('0x209'),_0x8a36('0x86'),'Ts\x20=\x20'+_0x5db715));}if(_0x40ed2a<=0x0||isNaN(_0x40ed2a)){return _0x5e2146(msgResponse(_0x8a36('0x209'),_0x8a36('0x86'),_0x8a36('0x20a')+_0x40ed2a));}if(_0x54c78e<=0x0||isNaN(_0x54c78e)){return _0x5e2146(msgResponse(_0x8a36('0x209'),_0x8a36('0x86'),_0x8a36('0x20b')+_0x54c78e));}if(_0x59ac17<=0x0||isNaN(_0x59ac17)){return _0x5e2146(msgResponse(_0x8a36('0x209'),_0x8a36('0x86'),_0x8a36('0x20c')+_0x59ac17));}_0x1fc8ae=_0x1fc8ae||0x0;var _0x2f3141=0x1/_0x5db715;var _0x1a6bf8=0x0;var _0x145cea=0x0;var _0x3f7c1e=0x0;var _0x33abdc=0x0;for(var _0x2eee5f=0x0;_0x3f7c1e<_0x59ac17;_0x2eee5f+=0x1){_0x145cea=_0x2eee5f/_0x54c78e;_0x1a6bf8=(_0x40ed2a*_0x145cea+_0x1fc8ae)/_0x2f3141;_0x3f7c1e=utils[_0x8a36('0x20d')](_0x1a6bf8,_0x597405);_0x33abdc=_0x1a6bf8/_0x597405*(0x1-utils[_0x8a36('0x20d')](_0x1a6bf8,_0x597405));}return _0x27f229({'erlangCalls':_0x2eee5f,'erlangCallToSecond':_0x54c78e/_0x2eee5f,'erlangAbandonmentRate':_0x3f7c1e,'erlangBusyFactor':_0x33abdc});});};Dialer[_0x8a36('0x19')][_0x8a36('0x1cf')]=function(_0x87cf7f,_0x5adda0,_0x4a2511,_0x2215e7,_0x4d4ea3,_0x32df4d){loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x20e'));loggerPredictive['info'](_0x8a36('0x204'),_0x87cf7f);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x205'),_0x5adda0);loggerPredictive[_0x8a36('0x4a')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a2511);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x206'),_0x2215e7);loggerPredictive[_0x8a36('0x4a')](_0x8a36('0x20f'),_0x4d4ea3);loggerPredictive[_0x8a36('0x4a')]('---------------------------');return new Promise(function(_0x119e04,_0x49f1a4){if(_0x87cf7f<=0x0||isNaN(_0x87cf7f)){return _0x49f1a4(msgResponse(_0x8a36('0x210'),_0x8a36('0x86'),_0x8a36('0x208')+_0x87cf7f));}if(_0x4a2511<=0x0||isNaN(_0x4a2511)){return _0x49f1a4(msgResponse(_0x8a36('0x210'),_0x8a36('0x86'),_0x8a36('0x211')+_0x4a2511));}if(_0x2215e7<=0x0||isNaN(_0x2215e7)){return _0x49f1a4(msgResponse('[busyFactor]',_0x8a36('0x86'),_0x8a36('0x20a')+_0x2215e7));}if(_0x5adda0<=0x0||isNaN(_0x5adda0)){return _0x49f1a4(msgResponse(_0x8a36('0x210'),_0x8a36('0x86'),_0x8a36('0x20b')+_0x5adda0));}if(_0x4d4ea3<=0x0||isNaN(_0x4d4ea3)){return _0x49f1a4(msgResponse(_0x8a36('0x210'),_0x8a36('0x86'),_0x8a36('0x212')+_0x4d4ea3));}_0x32df4d=_0x32df4d||0x0;var _0xdd6be5=0x1/_0x4a2511;var _0x11ce2b=0x0;var _0x237065=0x0;var _0x467d1b=0x0;var _0xa78132=0x0;for(var _0x7e92f8=0x0;_0xa78132<_0x4d4ea3;_0x7e92f8+=0x1){_0x237065=_0x7e92f8/_0x5adda0;_0x11ce2b=(_0x2215e7*_0x237065+_0x32df4d)/_0xdd6be5;_0x467d1b=utils[_0x8a36('0x20d')](_0x11ce2b,_0x87cf7f);_0xa78132=_0x11ce2b/_0x87cf7f*(0x1-utils['erlangb'](_0x11ce2b,_0x87cf7f));}return _0x119e04({'erlangCalls':_0x7e92f8,'erlangCallToSecond':_0x5adda0/_0x7e92f8,'erlangAbandonmentRate':_0x467d1b,'erlangBusyFactor':_0xa78132});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 89c4d49..3d350f8 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6400=['countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x4e27b8,_0x1dbabc){var _0x4fddc4=function(_0x2be9e4){while(--_0x2be9e4){_0x4e27b8['push'](_0x4e27b8['shift']());}};_0x4fddc4(++_0x1dbabc);}(_0x6400,0x1e4));var _0x0640=function(_0x5f1d74,_0x33e095){_0x5f1d74=_0x5f1d74-0x0;var _0xab75f5=_0x6400[_0x5f1d74];return _0xab75f5;};'use strict';var util=require(_0x0640('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x564c9a,_0x264017,_0x1ff607){var _0x133b26='';if(!_[_0x0640('0x1')](_0x264017)&&_0x0640('0x2')===typeof _0x264017){_0x133b26+=_0x264017;}if(!_[_0x0640('0x1')](_0x1ff607)&&_0x0640('0x2')===typeof _0x1ff607){_0x133b26+='\x20'+_0x1ff607;}if(_0x133b26!==''){return _0x133b26;}return _0x564c9a;}function Action(_0x29f6d3,_0x2b36a8,_0x32e3a3){this[_0x0640('0x3')]=_0x29f6d3;this[_0x0640('0x4')]=_0x32e3a3||undefined;this[_0x0640('0x5')]=checkNameSurname(_0x2b36a8[_0x0640('0x6')][_0x0640('0x7')],_0x2b36a8[_0x0640('0x6')][_0x0640('0x8')],_0x2b36a8[_0x0640('0x6')][_0x0640('0x9')]);this[_0x0640('0xa')]=_0x2b36a8[_0x0640('0x7')];this[_0x0640('0xb')]=_0x29f6d3['name'];this[_0x0640('0xc')]=_0x2b36a8[_0x0640('0xc')]||![];this[_0x0640('0xd')]=_0x29f6d3[_0x0640('0xd')];this[_0x0640('0xe')]=_0x29f6d3[_0x0640('0xe')]||0x3;this[_0x0640('0xf')]=_0x2b36a8[_0x0640('0xf')];this[_0x0640('0x10')]=_0x2b36a8[_0x0640('0x10')];this[_0x0640('0x11')]=_0x2b36a8['countcongestionretry'];this[_0x0640('0x12')]=_0x2b36a8['countnoanswerretry'];this[_0x0640('0x13')]=_0x2b36a8[_0x0640('0x13')];this['countdropretry']=_0x2b36a8[_0x0640('0x14')];this['countabandonedretry']=_0x2b36a8['countabandonedretry'];this[_0x0640('0x15')]=_0x2b36a8['countmachineretry'];this[_0x0640('0x16')]=_0x2b36a8['countagentrejectretry'];this[_0x0640('0x17')]=_0x2b36a8['ContactId'];this['ListId']=_0x2b36a8[_0x0640('0x18')];this['UserId']=_0x2b36a8['UserId'];this[_0x0640('0x19')]=_0x2b36a8[_0x0640('0x19')];this[_0x0640('0x1a')]=_0x2b36a8[_0x0640('0x1a')];this[_0x0640('0x1b')]=_0x2b36a8['id'];this['ContactFirstName']=_0x2b36a8[_0x0640('0x6')][_0x0640('0x8')]||'';this[_0x0640('0x1c')]=moment()[_0x0640('0x1d')](_0x0640('0x1e'));this[_0x0640('0x1f')]=_0x2b36a8['callback'];this[_0x0640('0x20')]=_0x2b36a8[_0x0640('0x20')];this[_0x0640('0x21')]=_0x2b36a8[_0x0640('0x21')];this[_0x0640('0x22')]=_0x2b36a8[_0x0640('0x22')];this[_0x0640('0x23')]='';this['originatecalleridname']='';}Action[_0x0640('0x24')][_0x0640('0x25')]=function(){return util[_0x0640('0x1d')](_0x0640('0x26'),this[_0x0640('0x5')],this['voiceQueue'][_0x0640('0x27')]>0x0?this[_0x0640('0xa')]['substring'](this['voiceQueue']['dialCutDigit']):this[_0x0640('0xa')]);};Action[_0x0640('0x24')][_0x0640('0x28')]=function(){return this[_0x0640('0xb')];};module[_0x0640('0x29')]=Action; \ No newline at end of file +var _0xe646=['Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','voiceQueue','substring','exports','util','lodash','moment','isNil','uniqueid','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe646,0xea));var _0x6e64=function(_0x214731,_0xc943bc){_0x214731=_0x214731-0x0;var _0x483791=_0xe646[_0x214731];return _0x483791;};'use strict';var util=require(_0x6e64('0x0'));var _=require(_0x6e64('0x1'));var moment=require(_0x6e64('0x2'));function checkNameSurname(_0x16a1c4,_0x55fc13,_0x507ad6){var _0x4ce7c5='';if(!_[_0x6e64('0x3')](_0x55fc13)&&'string'===typeof _0x55fc13){_0x4ce7c5+=_0x55fc13;}if(!_['isNil'](_0x507ad6)&&'string'===typeof _0x507ad6){_0x4ce7c5+='\x20'+_0x507ad6;}if(_0x4ce7c5!==''){return _0x4ce7c5;}return _0x16a1c4;}function Action(_0x2940bb,_0x598ec7,_0x2a03e5){this['voiceQueue']=_0x2940bb;this[_0x6e64('0x4')]=_0x2a03e5||undefined;this[_0x6e64('0x5')]=checkNameSurname(_0x598ec7[_0x6e64('0x6')][_0x6e64('0x7')],_0x598ec7['Contact'][_0x6e64('0x8')],_0x598ec7['Contact']['lastName']);this[_0x6e64('0x9')]=_0x598ec7['phone'];this[_0x6e64('0xa')]=_0x2940bb[_0x6e64('0x5')];this[_0x6e64('0xb')]=_0x598ec7['active']||![];this[_0x6e64('0xc')]=_0x2940bb[_0x6e64('0xc')];this[_0x6e64('0xd')]=_0x2940bb[_0x6e64('0xd')]||0x3;this[_0x6e64('0xe')]=_0x598ec7[_0x6e64('0xe')];this[_0x6e64('0xf')]=_0x598ec7[_0x6e64('0xf')];this['countcongestionretry']=_0x598ec7[_0x6e64('0x10')];this[_0x6e64('0x11')]=_0x598ec7['countnoanswerretry'];this[_0x6e64('0x12')]=_0x598ec7[_0x6e64('0x12')];this[_0x6e64('0x13')]=_0x598ec7[_0x6e64('0x13')];this[_0x6e64('0x14')]=_0x598ec7[_0x6e64('0x14')];this['countmachineretry']=_0x598ec7[_0x6e64('0x15')];this[_0x6e64('0x16')]=_0x598ec7[_0x6e64('0x16')];this[_0x6e64('0x17')]=_0x598ec7['ContactId'];this['ListId']=_0x598ec7[_0x6e64('0x18')];this['UserId']=_0x598ec7[_0x6e64('0x19')];this[_0x6e64('0x1a')]=_0x598ec7['VoiceQueueId'];this['CampaignId']=_0x598ec7[_0x6e64('0x1b')];this['idHopper']=_0x598ec7['id'];this[_0x6e64('0x1c')]=_0x598ec7['Contact']['firstName']||'';this['starttime']=moment()['format'](_0x6e64('0x1d'));this['callback']=_0x598ec7['callback'];this[_0x6e64('0x1e')]=_0x598ec7[_0x6e64('0x1e')];this[_0x6e64('0x1f')]=_0x598ec7[_0x6e64('0x1f')];this[_0x6e64('0x20')]=_0x598ec7[_0x6e64('0x20')];this['originatecalleridnum']='';this[_0x6e64('0x21')]='';}Action[_0x6e64('0x22')]['getCaller']=function(){return util[_0x6e64('0x23')](_0x6e64('0x24'),this[_0x6e64('0x5')],this[_0x6e64('0x25')]['dialCutDigit']>0x0?this['number'][_0x6e64('0x26')](this[_0x6e64('0x25')]['dialCutDigit']):this['number']);};Action[_0x6e64('0x22')]['getQueue']=function(){return this[_0x6e64('0xa')];};module[_0x6e64('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index d649353..75a4577 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6197=['uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry'];(function(_0x5416bc,_0x1c3a48){var _0x57b1de=function(_0xa9bfaa){while(--_0xa9bfaa){_0x5416bc['push'](_0x5416bc['shift']());}};_0x57b1de(++_0x1c3a48);}(_0x6197,0x7a));var _0x7619=function(_0xce7933,_0x4bd6e6){_0xce7933=_0xce7933-0x0;var _0x247ab5=_0x6197[_0xce7933];return _0x247ab5;};'use strict';var moment=require(_0x7619('0x0'));var utils=require(_0x7619('0x1'));function AgentComplete(_0x2ff9eb,_0x55dd8d){this[_0x7619('0x2')]=0x4;this[_0x7619('0x3')]=_0x7619('0x4');this[_0x7619('0x5')]=_0x2ff9eb['scheduledat'];this[_0x7619('0x6')]=_0x2ff9eb[_0x7619('0x6')];this[_0x7619('0x7')]=_0x2ff9eb[_0x7619('0x6')]===_0x7619('0x8')?_0x7619('0x9'):_0x2ff9eb[_0x7619('0x6')];this[_0x7619('0xa')]=_0x2ff9eb['countbusyretry'];this[_0x7619('0xb')]=_0x2ff9eb[_0x7619('0xb')];this[_0x7619('0xc')]=_0x2ff9eb[_0x7619('0xc')];this[_0x7619('0xd')]=_0x2ff9eb[_0x7619('0xa')]+_0x2ff9eb[_0x7619('0xb')]+_0x2ff9eb[_0x7619('0xc')]+_0x2ff9eb[_0x7619('0xe')]+_0x2ff9eb['countdropretry']+_0x2ff9eb[_0x7619('0xf')]+_0x2ff9eb[_0x7619('0x10')]+_0x2ff9eb[_0x7619('0x11')];this['countnosuchnumberretry']=_0x2ff9eb['countnosuchnumberretry'];this[_0x7619('0x12')]=_0x2ff9eb[_0x7619('0x12')];this['countabandonedretry']=_0x2ff9eb[_0x7619('0xf')];this[_0x7619('0x10')]=_0x2ff9eb[_0x7619('0x10')];this[_0x7619('0x11')]=_0x2ff9eb[_0x7619('0x11')];this['uniqueid']=_0x55dd8d[_0x7619('0x13')];this['calleridname']=_0x2ff9eb[_0x7619('0x14')];this[_0x7619('0x15')]=_0x2ff9eb[_0x7619('0x16')];this[_0x7619('0x17')]=_0x2ff9eb[_0x7619('0x17')];this[_0x7619('0x18')]=_0x2ff9eb['responsetime'];this[_0x7619('0x19')]=_0x2ff9eb['answertime'];this[_0x7619('0x1a')]=moment()[_0x7619('0x1b')](_0x7619('0x1c'));this[_0x7619('0x1d')]=utils[_0x7619('0x1e')](_0x2ff9eb['responsetime'],_0x2ff9eb[_0x7619('0x17')]);this[_0x7619('0x1f')]=utils[_0x7619('0x1e')](_0x2ff9eb[_0x7619('0x19')],_0x2ff9eb[_0x7619('0x18')]);this[_0x7619('0x20')]=utils[_0x7619('0x1e')](this[_0x7619('0x1a')],_0x2ff9eb[_0x7619('0x19')]);this[_0x7619('0x9')]=_0x55dd8d[_0x7619('0x9')];this[_0x7619('0x21')]=_0x55dd8d[_0x7619('0x21')];this[_0x7619('0x22')]=_0x55dd8d[_0x7619('0x22')];this['callback']=_0x2ff9eb['callback'];this[_0x7619('0x23')]=_0x2ff9eb[_0x7619('0x23')];this['callbackat']=_0x2ff9eb[_0x7619('0x24')];this[_0x7619('0x25')]=_0x2ff9eb[_0x7619('0x25')];this['ContactId']=_0x2ff9eb[_0x7619('0x26')];this[_0x7619('0x27')]=_0x2ff9eb['ListId'];this['UserId']=_0x2ff9eb[_0x7619('0x28')];this[_0x7619('0x29')]=_0x2ff9eb['VoiceQueueId'];this[_0x7619('0x2a')]=_0x2ff9eb[_0x7619('0x2a')];this[_0x7619('0x2b')]=_0x2ff9eb[_0x7619('0x2b')]||'';this[_0x7619('0x2c')]=_0x2ff9eb['originatecalleridname']||'';this[_0x7619('0x2d')]=_0x2ff9eb[_0x7619('0x2d')];}module[_0x7619('0x2e')]=AgentComplete; \ No newline at end of file +var _0xde99=['countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x9c1134,_0x42cec6){var _0x2ec18c=function(_0x3adffc){while(--_0x3adffc){_0x9c1134['push'](_0x9c1134['shift']());}};_0x2ec18c(++_0x42cec6);}(_0xde99,0xfe));var _0x9de9=function(_0x2a2091,_0x5d6a29){_0x2a2091=_0x2a2091-0x0;var _0x284077=_0xde99[_0x2a2091];return _0x284077;};'use strict';var moment=require(_0x9de9('0x0'));var utils=require(_0x9de9('0x1'));function AgentComplete(_0x2a3fa8,_0x1b84b7){this[_0x9de9('0x2')]=0x4;this['statedesc']=_0x9de9('0x3');this[_0x9de9('0x4')]=_0x2a3fa8[_0x9de9('0x4')];this[_0x9de9('0x5')]=_0x2a3fa8[_0x9de9('0x5')];this['campaigntype']=_0x2a3fa8[_0x9de9('0x5')]===_0x9de9('0x6')?'queue':_0x2a3fa8[_0x9de9('0x5')];this[_0x9de9('0x7')]=_0x2a3fa8['countbusyretry'];this[_0x9de9('0x8')]=_0x2a3fa8[_0x9de9('0x8')];this[_0x9de9('0x9')]=_0x2a3fa8[_0x9de9('0x9')];this['countglobal']=_0x2a3fa8['countbusyretry']+_0x2a3fa8[_0x9de9('0x8')]+_0x2a3fa8[_0x9de9('0x9')]+_0x2a3fa8['countnosuchnumberretry']+_0x2a3fa8[_0x9de9('0xa')]+_0x2a3fa8[_0x9de9('0xb')]+_0x2a3fa8['countmachineretry']+_0x2a3fa8[_0x9de9('0xc')];this[_0x9de9('0xd')]=_0x2a3fa8[_0x9de9('0xd')];this[_0x9de9('0xa')]=_0x2a3fa8['countdropretry'];this[_0x9de9('0xb')]=_0x2a3fa8[_0x9de9('0xb')];this[_0x9de9('0xe')]=_0x2a3fa8[_0x9de9('0xe')];this[_0x9de9('0xc')]=_0x2a3fa8[_0x9de9('0xc')];this[_0x9de9('0xf')]=_0x1b84b7[_0x9de9('0xf')];this['calleridname']=_0x2a3fa8[_0x9de9('0x10')];this[_0x9de9('0x11')]=_0x2a3fa8[_0x9de9('0x12')];this[_0x9de9('0x13')]=_0x2a3fa8[_0x9de9('0x13')];this[_0x9de9('0x14')]=_0x2a3fa8['responsetime'];this['answertime']=_0x2a3fa8[_0x9de9('0x15')];this[_0x9de9('0x16')]=moment()[_0x9de9('0x17')](_0x9de9('0x18'));this['ringtime']=utils[_0x9de9('0x19')](_0x2a3fa8[_0x9de9('0x14')],_0x2a3fa8['starttime']);this[_0x9de9('0x1a')]=utils[_0x9de9('0x19')](_0x2a3fa8[_0x9de9('0x15')],_0x2a3fa8[_0x9de9('0x14')]);this[_0x9de9('0x1b')]=utils['getSeconds'](this[_0x9de9('0x16')],_0x2a3fa8[_0x9de9('0x15')]);this[_0x9de9('0x1c')]=_0x1b84b7[_0x9de9('0x1c')];this['membername']=_0x1b84b7[_0x9de9('0x1d')];this[_0x9de9('0x1e')]=_0x1b84b7[_0x9de9('0x1e')];this[_0x9de9('0x1f')]=_0x2a3fa8[_0x9de9('0x1f')];this['callbackuniqueid']=_0x2a3fa8[_0x9de9('0x20')];this[_0x9de9('0x21')]=_0x2a3fa8[_0x9de9('0x21')];this[_0x9de9('0x22')]=_0x2a3fa8['recallme'];this[_0x9de9('0x23')]=_0x2a3fa8['ContactId'];this[_0x9de9('0x24')]=_0x2a3fa8[_0x9de9('0x24')];this[_0x9de9('0x25')]=_0x2a3fa8['UserId'];this[_0x9de9('0x26')]=_0x2a3fa8[_0x9de9('0x26')];this['CampaignId']=_0x2a3fa8[_0x9de9('0x27')];this[_0x9de9('0x28')]=_0x2a3fa8[_0x9de9('0x28')]||'';this[_0x9de9('0x29')]=_0x2a3fa8['originatecalleridname']||'';this[_0x9de9('0x2a')]=_0x2a3fa8[_0x9de9('0x2a')];}module[_0x9de9('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index fb6e7d8..976bf3f 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc943=['countdropretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xc943,0x1b6));var _0x3c94=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0xc943[_0x4a45b4];return _0x1a99c9;};'use strict';function Final(_0x5f5357){this[_0x3c94('0x0')]=_0x5f5357['uniqueid'];this[_0x3c94('0x1')]=_0x5f5357[_0x3c94('0x1')];this[_0x3c94('0x2')]=_0x5f5357['type'];this['campaigntype']=_0x5f5357[_0x3c94('0x2')]===_0x3c94('0x3')?_0x3c94('0x4'):_0x5f5357[_0x3c94('0x2')];this[_0x3c94('0x5')]=_0x5f5357['countbusyretry'];this['countcongestionretry']=_0x5f5357['countcongestionretry'];this[_0x3c94('0x6')]=_0x5f5357[_0x3c94('0x6')];this[_0x3c94('0x7')]=_0x5f5357[_0x3c94('0x5')]+_0x5f5357[_0x3c94('0x8')]+_0x5f5357[_0x3c94('0x6')]+_0x5f5357[_0x3c94('0x9')]+_0x5f5357[_0x3c94('0xa')]+_0x5f5357[_0x3c94('0xb')]+_0x5f5357[_0x3c94('0xc')]+_0x5f5357['countagentrejectretry'];this[_0x3c94('0x9')]=_0x5f5357[_0x3c94('0x9')];this[_0x3c94('0xa')]=_0x5f5357['countdropretry'];this[_0x3c94('0xb')]=_0x5f5357[_0x3c94('0xb')];this[_0x3c94('0xc')]=_0x5f5357[_0x3c94('0xc')];this['countagentrejectretry']=_0x5f5357['countagentrejectretry'];this['queue']=_0x5f5357[_0x3c94('0x4')];this[_0x3c94('0xd')]=_0x5f5357[_0x3c94('0xd')];this[_0x3c94('0xe')]=_0x5f5357[_0x3c94('0xe')];this[_0x3c94('0xf')]=_0x5f5357['starttime'];this[_0x3c94('0x10')]=_0x5f5357[_0x3c94('0x10')];this[_0x3c94('0x11')]=_0x5f5357[_0x3c94('0x10')];this[_0x3c94('0x12')]=_0x5f5357['ringtime']||0x0;this['holdtime']=_0x5f5357[_0x3c94('0x13')]||0x0;this[_0x3c94('0x14')]=_0x5f5357[_0x3c94('0x14')]||0x0;this[_0x3c94('0x15')]=_0x5f5357[_0x3c94('0x15')];this[_0x3c94('0x16')]=_0x5f5357[_0x3c94('0x16')];this['callbackat']=_0x5f5357['callbackat'];this[_0x3c94('0x17')]=_0x5f5357[_0x3c94('0x17')];this[_0x3c94('0x18')]=_0x5f5357['ContactId'];this[_0x3c94('0x19')]=_0x5f5357[_0x3c94('0x19')];this['UserId']=_0x5f5357['UserId'];this['VoiceQueueId']=_0x5f5357['VoiceQueueId'];this[_0x3c94('0x1a')]=_0x5f5357[_0x3c94('0x1a')];this[_0x3c94('0x1b')]=_0x5f5357[_0x3c94('0x1b')]||'';this[_0x3c94('0x1c')]=_0x5f5357[_0x3c94('0x1c')]||'';this['state']=_0x5f5357[_0x3c94('0x1d')];this[_0x3c94('0x1e')]=_0x5f5357[_0x3c94('0x1e')];}module[_0x3c94('0x1f')]=Final; \ No newline at end of file +var _0xb6b8=['countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry'];(function(_0x548898,_0x445b05){var _0x3d6768=function(_0x27ac59){while(--_0x27ac59){_0x548898['push'](_0x548898['shift']());}};_0x3d6768(++_0x445b05);}(_0xb6b8,0x153));var _0x8b6b=function(_0x65b9bd,_0x105cb0){_0x65b9bd=_0x65b9bd-0x0;var _0x2e0ec7=_0xb6b8[_0x65b9bd];return _0x2e0ec7;};'use strict';function Final(_0x47c09a){this['uniqueid']=_0x47c09a['uniqueid'];this['scheduledat']=_0x47c09a[_0x8b6b('0x0')];this['type']=_0x47c09a[_0x8b6b('0x1')];this[_0x8b6b('0x2')]=_0x47c09a[_0x8b6b('0x1')]===_0x8b6b('0x3')?_0x8b6b('0x4'):_0x47c09a[_0x8b6b('0x1')];this['countbusyretry']=_0x47c09a[_0x8b6b('0x5')];this['countcongestionretry']=_0x47c09a['countcongestionretry'];this[_0x8b6b('0x6')]=_0x47c09a[_0x8b6b('0x6')];this[_0x8b6b('0x7')]=_0x47c09a[_0x8b6b('0x5')]+_0x47c09a[_0x8b6b('0x8')]+_0x47c09a['countnoanswerretry']+_0x47c09a[_0x8b6b('0x9')]+_0x47c09a['countdropretry']+_0x47c09a[_0x8b6b('0xa')]+_0x47c09a[_0x8b6b('0xb')]+_0x47c09a['countagentrejectretry'];this[_0x8b6b('0x9')]=_0x47c09a[_0x8b6b('0x9')];this[_0x8b6b('0xc')]=_0x47c09a[_0x8b6b('0xc')];this['countabandonedretry']=_0x47c09a[_0x8b6b('0xa')];this[_0x8b6b('0xb')]=_0x47c09a[_0x8b6b('0xb')];this['countagentrejectretry']=_0x47c09a[_0x8b6b('0xd')];this[_0x8b6b('0x4')]=_0x47c09a[_0x8b6b('0x4')];this['calleridname']=_0x47c09a[_0x8b6b('0xe')];this[_0x8b6b('0xf')]=_0x47c09a['calleridnum'];this[_0x8b6b('0x10')]=_0x47c09a[_0x8b6b('0x10')];this['responsetime']=_0x47c09a[_0x8b6b('0x11')];this[_0x8b6b('0x12')]=_0x47c09a[_0x8b6b('0x11')];this[_0x8b6b('0x13')]=_0x47c09a[_0x8b6b('0x13')]||0x0;this[_0x8b6b('0x14')]=_0x47c09a[_0x8b6b('0x14')]||0x0;this['talktime']=_0x47c09a[_0x8b6b('0x15')]||0x0;this[_0x8b6b('0x16')]=_0x47c09a[_0x8b6b('0x16')];this[_0x8b6b('0x17')]=_0x47c09a[_0x8b6b('0x17')];this[_0x8b6b('0x18')]=_0x47c09a['callbackat'];this[_0x8b6b('0x19')]=_0x47c09a[_0x8b6b('0x19')];this[_0x8b6b('0x1a')]=_0x47c09a[_0x8b6b('0x1a')];this['ListId']=_0x47c09a['ListId'];this[_0x8b6b('0x1b')]=_0x47c09a[_0x8b6b('0x1b')];this['VoiceQueueId']=_0x47c09a[_0x8b6b('0x1c')];this[_0x8b6b('0x1d')]=_0x47c09a[_0x8b6b('0x1d')];this['originatecalleridnum']=_0x47c09a[_0x8b6b('0x1e')]||'';this[_0x8b6b('0x1f')]=_0x47c09a[_0x8b6b('0x1f')]||'';this[_0x8b6b('0x20')]=_0x47c09a[_0x8b6b('0x20')];this[_0x8b6b('0x21')]=_0x47c09a[_0x8b6b('0x21')];}module[_0x8b6b('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 712b908..e0b9f54 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea6a=['countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','responsetime','holdtime','talktime','endtime','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xea6a,0x73));var _0xaea6=function(_0x4e9b29,_0x401fad){_0x4e9b29=_0x4e9b29-0x0;var _0x30db38=_0xea6a[_0x4e9b29];return _0x30db38;};'use strict';var moment=require(_0xaea6('0x0'));var utils=require('../utils');function Hangup(_0x32f0f7,_0x10a492){this[_0xaea6('0x1')]=0x4;this[_0xaea6('0x2')]=_0xaea6('0x3');this[_0xaea6('0x4')]=_0x32f0f7[_0xaea6('0x4')];this[_0xaea6('0x5')]=_0x32f0f7[_0xaea6('0x5')];this[_0xaea6('0x6')]=_0x32f0f7[_0xaea6('0x5')]===_0xaea6('0x7')?_0xaea6('0x8'):_0x32f0f7[_0xaea6('0x5')];this[_0xaea6('0x9')]=_0x32f0f7[_0xaea6('0x9')]||![];this[_0xaea6('0xa')]=_0x32f0f7[_0xaea6('0xa')];this[_0xaea6('0xb')]=_0x32f0f7[_0xaea6('0xb')];this['countnoanswerretry']=_0x32f0f7[_0xaea6('0xc')];this[_0xaea6('0xd')]=_0x32f0f7[_0xaea6('0xa')]+_0x32f0f7[_0xaea6('0xb')]+_0x32f0f7['countnoanswerretry']+_0x32f0f7[_0xaea6('0xe')]+_0x32f0f7[_0xaea6('0xf')]+_0x32f0f7[_0xaea6('0x10')]+_0x32f0f7['countmachineretry']+_0x32f0f7[_0xaea6('0x11')];this[_0xaea6('0xe')]=_0x32f0f7[_0xaea6('0xe')];this['countdropretry']=_0x32f0f7[_0xaea6('0xf')];this[_0xaea6('0x10')]=_0x32f0f7[_0xaea6('0x10')];this[_0xaea6('0x12')]=_0x32f0f7['countmachineretry'];this['countagentrejectretry']=_0x32f0f7[_0xaea6('0x11')];this[_0xaea6('0x13')]=_0x10a492[_0xaea6('0x13')];this['calleridname']=_0x32f0f7[_0xaea6('0x14')];this[_0xaea6('0x15')]=_0x32f0f7['number'];this[_0xaea6('0x16')]=_0x32f0f7[_0xaea6('0x16')];this['responsetime']=_0x32f0f7['responsetime'];this['endtime']=moment()[_0xaea6('0x17')](_0xaea6('0x18'));this[_0xaea6('0x19')]=utils[_0xaea6('0x1a')](_0x32f0f7[_0xaea6('0x1b')],_0x32f0f7['starttime']);this[_0xaea6('0x1c')]=0x0;this[_0xaea6('0x1d')]=utils[_0xaea6('0x1a')](this[_0xaea6('0x1e')],_0x32f0f7[_0xaea6('0x1b')]);this['queue']=_0x32f0f7['queue'];this['membername']=_0xaea6('0x1f');this[_0xaea6('0x20')]=_0x10a492['cause-txt'];this['callback']=_0x32f0f7[_0xaea6('0x21')];this[_0xaea6('0x22')]=_0x32f0f7[_0xaea6('0x22')];this['callbackat']=_0x32f0f7[_0xaea6('0x23')];this[_0xaea6('0x24')]=_0x32f0f7[_0xaea6('0x24')];this[_0xaea6('0x25')]=_0x32f0f7[_0xaea6('0x25')];this[_0xaea6('0x26')]=_0x32f0f7[_0xaea6('0x26')];this[_0xaea6('0x27')]=_0x32f0f7['UserId'];this[_0xaea6('0x28')]=_0x32f0f7[_0xaea6('0x28')];this[_0xaea6('0x29')]=_0x32f0f7[_0xaea6('0x29')];}module[_0xaea6('0x2a')]=Hangup; \ No newline at end of file +var _0xa1d3=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','IVR','cause-txt'];(function(_0x3ab5e1,_0xdb9572){var _0xd640f2=function(_0x3b14d2){while(--_0x3b14d2){_0x3ab5e1['push'](_0x3ab5e1['shift']());}};_0xd640f2(++_0xdb9572);}(_0xa1d3,0x129));var _0x3a1d=function(_0xb60643,_0x5a28f0){_0xb60643=_0xb60643-0x0;var _0x2375d3=_0xa1d3[_0xb60643];return _0x2375d3;};'use strict';var moment=require(_0x3a1d('0x0'));var utils=require(_0x3a1d('0x1'));function Hangup(_0x40d830,_0x151289){this['state']=0x4;this[_0x3a1d('0x2')]=_0x3a1d('0x3');this['scheduledat']=_0x40d830[_0x3a1d('0x4')];this[_0x3a1d('0x5')]=_0x40d830['type'];this['campaigntype']=_0x40d830[_0x3a1d('0x5')]===_0x3a1d('0x6')?_0x3a1d('0x7'):_0x40d830['type'];this[_0x3a1d('0x8')]=_0x40d830[_0x3a1d('0x8')]||![];this['countbusyretry']=_0x40d830[_0x3a1d('0x9')];this['countcongestionretry']=_0x40d830[_0x3a1d('0xa')];this['countnoanswerretry']=_0x40d830[_0x3a1d('0xb')];this['countglobal']=_0x40d830[_0x3a1d('0x9')]+_0x40d830['countcongestionretry']+_0x40d830['countnoanswerretry']+_0x40d830[_0x3a1d('0xc')]+_0x40d830[_0x3a1d('0xd')]+_0x40d830[_0x3a1d('0xe')]+_0x40d830['countmachineretry']+_0x40d830[_0x3a1d('0xf')];this['countnosuchnumberretry']=_0x40d830[_0x3a1d('0xc')];this['countdropretry']=_0x40d830[_0x3a1d('0xd')];this['countabandonedretry']=_0x40d830[_0x3a1d('0xe')];this[_0x3a1d('0x10')]=_0x40d830[_0x3a1d('0x10')];this['countagentrejectretry']=_0x40d830[_0x3a1d('0xf')];this['uniqueid']=_0x151289['uniqueid'];this[_0x3a1d('0x11')]=_0x40d830[_0x3a1d('0x12')];this[_0x3a1d('0x13')]=_0x40d830[_0x3a1d('0x14')];this['starttime']=_0x40d830['starttime'];this[_0x3a1d('0x15')]=_0x40d830['responsetime'];this['endtime']=moment()['format'](_0x3a1d('0x16'));this[_0x3a1d('0x17')]=utils[_0x3a1d('0x18')](_0x40d830[_0x3a1d('0x15')],_0x40d830['starttime']);this[_0x3a1d('0x19')]=0x0;this[_0x3a1d('0x1a')]=utils['getSeconds'](this[_0x3a1d('0x1b')],_0x40d830[_0x3a1d('0x15')]);this[_0x3a1d('0x7')]=_0x40d830[_0x3a1d('0x7')];this[_0x3a1d('0x1c')]=_0x3a1d('0x1d');this['reason']=_0x151289[_0x3a1d('0x1e')];this['callback']=_0x40d830[_0x3a1d('0x1f')];this[_0x3a1d('0x20')]=_0x40d830[_0x3a1d('0x20')];this[_0x3a1d('0x21')]=_0x40d830[_0x3a1d('0x21')];this[_0x3a1d('0x22')]=_0x40d830[_0x3a1d('0x22')];this['ContactId']=_0x40d830[_0x3a1d('0x23')];this[_0x3a1d('0x24')]=_0x40d830[_0x3a1d('0x24')];this[_0x3a1d('0x25')]=_0x40d830[_0x3a1d('0x25')];this[_0x3a1d('0x26')]=_0x40d830['VoiceQueueId'];this[_0x3a1d('0x27')]=_0x40d830[_0x3a1d('0x27')];}module[_0x3a1d('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 37404cd..dc55dcc 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa57c=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','number','starttime','responsetime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type'];(function(_0x129350,_0x39baaf){var _0x51d20c=function(_0x36f0b7){while(--_0x36f0b7){_0x129350['push'](_0x129350['shift']());}};_0x51d20c(++_0x39baaf);}(_0xa57c,0x1aa));var _0xca57=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa57c[_0x4a53d];return _0x27410e;};'use strict';var utils=require('../utils');function History(_0xe81906){this[_0xca57('0x0')]=_0xe81906['uniqueid'];this[_0xca57('0x1')]=_0xe81906['scheduledat']||undefined;this['type']=_0xe81906[_0xca57('0x2')];this[_0xca57('0x3')]=_0xe81906['type']===_0xca57('0x4')?_0xca57('0x5'):_0xe81906['type'];this['countbusyretry']=_0xe81906[_0xca57('0x6')];this[_0xca57('0x7')]=_0xe81906[_0xca57('0x7')];this[_0xca57('0x8')]=_0xe81906[_0xca57('0x8')];this[_0xca57('0x9')]=_0xe81906[_0xca57('0x6')]+_0xe81906['countcongestionretry']+_0xe81906[_0xca57('0x8')]+_0xe81906[_0xca57('0xa')]+_0xe81906[_0xca57('0xb')]+_0xe81906['countabandonedretry']+_0xe81906[_0xca57('0xc')]+_0xe81906[_0xca57('0xd')];this[_0xca57('0xa')]=_0xe81906[_0xca57('0xa')];this[_0xca57('0xb')]=_0xe81906[_0xca57('0xb')];this[_0xca57('0xe')]=_0xe81906[_0xca57('0xe')];this[_0xca57('0xc')]=_0xe81906['countmachineretry'];this[_0xca57('0xd')]=_0xe81906[_0xca57('0xd')];this['queue']=_0xe81906['queue'];this[_0xca57('0xf')]=_0xe81906['name'];this['calleridnum']=_0xe81906[_0xca57('0x10')];this[_0xca57('0x11')]=_0xe81906[_0xca57('0x11')];this['responsetime']=_0xe81906[_0xca57('0x12')];this['endtime']=_0xe81906[_0xca57('0x12')];this['ringtime']=utils['getSeconds'](_0xe81906[_0xca57('0x12')],_0xe81906[_0xca57('0x11')]);this[_0xca57('0x13')]=0x0;this['talktime']=0x0;this[_0xca57('0x14')]=_0xe81906[_0xca57('0x14')];this['callbackuniqueid']=_0xe81906[_0xca57('0x15')];this[_0xca57('0x16')]=_0xe81906[_0xca57('0x16')];this[_0xca57('0x17')]=_0xe81906[_0xca57('0x17')];this[_0xca57('0x18')]=_0xe81906[_0xca57('0x18')];this[_0xca57('0x19')]=_0xe81906[_0xca57('0x19')];this['UserId']=_0xe81906['UserId'];this[_0xca57('0x1a')]=_0xe81906[_0xca57('0x1a')];this[_0xca57('0x1b')]=_0xe81906[_0xca57('0x1b')];this[_0xca57('0x1c')]=_0xe81906[_0xca57('0x1c')]||'';this[_0xca57('0x1d')]=_0xe81906[_0xca57('0x1d')]||'';this[_0xca57('0x1e')]=_0xe81906[_0xca57('0x1e')];this[_0xca57('0x1f')]=_0xe81906[_0xca57('0x1f')];}module[_0xca57('0x20')]=History; \ No newline at end of file +var _0x3d45=['ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','../utils','uniqueid','scheduledat','type','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','name','number','starttime','responsetime','endtime'];(function(_0x2456c7,_0x8b97ac){var _0x904fd2=function(_0xc594c7){while(--_0xc594c7){_0x2456c7['push'](_0x2456c7['shift']());}};_0x904fd2(++_0x8b97ac);}(_0x3d45,0x7d));var _0x53d4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3d45[_0xbca1b1];return _0x4e1686;};'use strict';var utils=require(_0x53d4('0x0'));function History(_0x237a2b){this[_0x53d4('0x1')]=_0x237a2b['uniqueid'];this['scheduledat']=_0x237a2b[_0x53d4('0x2')]||undefined;this[_0x53d4('0x3')]=_0x237a2b[_0x53d4('0x3')];this['campaigntype']=_0x237a2b['type']==='outbound'?_0x53d4('0x4'):_0x237a2b['type'];this['countbusyretry']=_0x237a2b['countbusyretry'];this['countcongestionretry']=_0x237a2b[_0x53d4('0x5')];this[_0x53d4('0x6')]=_0x237a2b[_0x53d4('0x6')];this[_0x53d4('0x7')]=_0x237a2b[_0x53d4('0x8')]+_0x237a2b[_0x53d4('0x5')]+_0x237a2b[_0x53d4('0x6')]+_0x237a2b['countnosuchnumberretry']+_0x237a2b['countdropretry']+_0x237a2b[_0x53d4('0x9')]+_0x237a2b[_0x53d4('0xa')]+_0x237a2b[_0x53d4('0xb')];this[_0x53d4('0xc')]=_0x237a2b[_0x53d4('0xc')];this[_0x53d4('0xd')]=_0x237a2b['countdropretry'];this[_0x53d4('0x9')]=_0x237a2b[_0x53d4('0x9')];this['countmachineretry']=_0x237a2b[_0x53d4('0xa')];this[_0x53d4('0xb')]=_0x237a2b[_0x53d4('0xb')];this[_0x53d4('0x4')]=_0x237a2b[_0x53d4('0x4')];this['calleridname']=_0x237a2b[_0x53d4('0xe')];this['calleridnum']=_0x237a2b[_0x53d4('0xf')];this[_0x53d4('0x10')]=_0x237a2b[_0x53d4('0x10')];this[_0x53d4('0x11')]=_0x237a2b['responsetime'];this[_0x53d4('0x12')]=_0x237a2b[_0x53d4('0x11')];this[_0x53d4('0x13')]=utils[_0x53d4('0x14')](_0x237a2b[_0x53d4('0x11')],_0x237a2b[_0x53d4('0x10')]);this[_0x53d4('0x15')]=0x0;this[_0x53d4('0x16')]=0x0;this[_0x53d4('0x17')]=_0x237a2b[_0x53d4('0x17')];this[_0x53d4('0x18')]=_0x237a2b[_0x53d4('0x18')];this['callbackat']=_0x237a2b[_0x53d4('0x19')];this['recallme']=_0x237a2b[_0x53d4('0x1a')];this[_0x53d4('0x1b')]=_0x237a2b['ContactId'];this[_0x53d4('0x1c')]=_0x237a2b[_0x53d4('0x1c')];this[_0x53d4('0x1d')]=_0x237a2b['UserId'];this[_0x53d4('0x1e')]=_0x237a2b[_0x53d4('0x1e')];this[_0x53d4('0x1f')]=_0x237a2b[_0x53d4('0x1f')];this[_0x53d4('0x20')]=_0x237a2b['originatecalleridnum']||'';this['originatecalleridname']=_0x237a2b['originatecalleridname']||'';this[_0x53d4('0x21')]=_0x237a2b['state'];this[_0x53d4('0x22')]=_0x237a2b[_0x53d4('0x22')];}module[_0x53d4('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 2f54a96..6cd6a81 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e6f=['originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x584486,_0x1b3bb6){var _0x399d0b=function(_0x208827){while(--_0x208827){_0x584486['push'](_0x584486['shift']());}};_0x399d0b(++_0x1b3bb6);}(_0x4e6f,0x1ea));var _0xf4e6=function(_0x3e5d81,_0x2f4f73){_0x3e5d81=_0x3e5d81-0x0;var _0x23d348=_0x4e6f[_0x3e5d81];return _0x23d348;};'use strict';var utils=require(_0xf4e6('0x0'));function QueueCallerAbandon(_0x4cc8ce,_0x288659){this['scheduledat']=_0x4cc8ce['scheduledat'];this['type']=_0x4cc8ce[_0xf4e6('0x1')];this[_0xf4e6('0x2')]=_0x4cc8ce[_0xf4e6('0x1')]===_0xf4e6('0x3')?_0xf4e6('0x4'):_0x4cc8ce[_0xf4e6('0x1')];this[_0xf4e6('0x5')]=_0x4cc8ce[_0xf4e6('0x5')];this[_0xf4e6('0x6')]=_0x4cc8ce[_0xf4e6('0x6')];this['countnoanswerretry']=_0x4cc8ce['countnoanswerretry'];this[_0xf4e6('0x7')]=_0x4cc8ce['countbusyretry']+_0x4cc8ce[_0xf4e6('0x6')]+_0x4cc8ce['countnoanswerretry']+_0x4cc8ce[_0xf4e6('0x8')]+_0x4cc8ce['countdropretry']+_0x4cc8ce['countabandonedretry']+_0x4cc8ce['countmachineretry']+_0x4cc8ce[_0xf4e6('0x9')];this[_0xf4e6('0x8')]=_0x4cc8ce[_0xf4e6('0x8')];this[_0xf4e6('0xa')]=_0x4cc8ce[_0xf4e6('0xa')];this[_0xf4e6('0xb')]=_0x4cc8ce[_0xf4e6('0xb')];this['countmachineretry']=_0x4cc8ce[_0xf4e6('0xc')];this[_0xf4e6('0x9')]=_0x4cc8ce[_0xf4e6('0x9')];this[_0xf4e6('0xd')]=_0x288659['uniqueid'];this[_0xf4e6('0xe')]=_0x4cc8ce[_0xf4e6('0xf')];this[_0xf4e6('0x10')]=_0x4cc8ce[_0xf4e6('0x11')];this[_0xf4e6('0x12')]=_0x4cc8ce[_0xf4e6('0x12')];this['responsetime']=_0x4cc8ce[_0xf4e6('0x13')];this[_0xf4e6('0x14')]=_0x4cc8ce[_0xf4e6('0x14')];this[_0xf4e6('0x15')]=_0x4cc8ce[_0xf4e6('0x15')];this[_0xf4e6('0x16')]=this[_0xf4e6('0x14')];this[_0xf4e6('0x17')]=utils[_0xf4e6('0x18')](_0x4cc8ce[_0xf4e6('0x13')],_0x4cc8ce[_0xf4e6('0x12')]);this[_0xf4e6('0x19')]=utils['getSeconds'](this['droptime'],_0x4cc8ce[_0xf4e6('0x13')]);this[_0xf4e6('0x1a')]=0x0;this[_0xf4e6('0x4')]=_0x288659[_0xf4e6('0x4')];this[_0xf4e6('0x1b')]=_0x288659[_0xf4e6('0x1c')];this['reason']=_0x288659[_0xf4e6('0x1d')];this['callback']=_0x4cc8ce[_0xf4e6('0x1e')];this[_0xf4e6('0x1f')]=_0x4cc8ce['callbackuniqueid'];this[_0xf4e6('0x20')]=_0x4cc8ce['callbackat'];this['recallme']=_0x4cc8ce['recallme'];this[_0xf4e6('0x21')]=_0x4cc8ce[_0xf4e6('0x21')];this[_0xf4e6('0x22')]=_0x4cc8ce[_0xf4e6('0x22')];this[_0xf4e6('0x23')]=_0x4cc8ce[_0xf4e6('0x23')];this['VoiceQueueId']=_0x4cc8ce[_0xf4e6('0x24')];this[_0xf4e6('0x25')]=_0x4cc8ce[_0xf4e6('0x25')];this['originatecalleridnum']=_0x4cc8ce[_0xf4e6('0x26')]||'';this[_0xf4e6('0x27')]=_0x4cc8ce['originatecalleridname']||'';this[_0xf4e6('0x28')]=_0x4cc8ce[_0xf4e6('0x28')];this['state']=_0x4cc8ce[_0xf4e6('0x29')];this['statedesc']=_0x4cc8ce[_0xf4e6('0x2a')];}module[_0xf4e6('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x3202=['endtime','ringtime','starttime','holdtime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','droptime','dropreason'];(function(_0x1efc3c,_0x55458f){var _0x5a5b7f=function(_0x269a38){while(--_0x269a38){_0x1efc3c['push'](_0x1efc3c['shift']());}};_0x5a5b7f(++_0x55458f);}(_0x3202,0x1b8));var _0x2320=function(_0x3ebb8f,_0x1a86e8){_0x3ebb8f=_0x3ebb8f-0x0;var _0x3a1c2e=_0x3202[_0x3ebb8f];return _0x3a1c2e;};'use strict';var utils=require(_0x2320('0x0'));function QueueCallerAbandon(_0xcafbc1,_0x1be715){this[_0x2320('0x1')]=_0xcafbc1[_0x2320('0x1')];this[_0x2320('0x2')]=_0xcafbc1[_0x2320('0x2')];this[_0x2320('0x3')]=_0xcafbc1[_0x2320('0x2')]===_0x2320('0x4')?_0x2320('0x5'):_0xcafbc1['type'];this[_0x2320('0x6')]=_0xcafbc1['countbusyretry'];this['countcongestionretry']=_0xcafbc1['countcongestionretry'];this[_0x2320('0x7')]=_0xcafbc1[_0x2320('0x7')];this[_0x2320('0x8')]=_0xcafbc1['countbusyretry']+_0xcafbc1['countcongestionretry']+_0xcafbc1['countnoanswerretry']+_0xcafbc1[_0x2320('0x9')]+_0xcafbc1[_0x2320('0xa')]+_0xcafbc1[_0x2320('0xb')]+_0xcafbc1[_0x2320('0xc')]+_0xcafbc1['countagentrejectretry'];this[_0x2320('0x9')]=_0xcafbc1[_0x2320('0x9')];this[_0x2320('0xa')]=_0xcafbc1[_0x2320('0xa')];this[_0x2320('0xb')]=_0xcafbc1[_0x2320('0xb')];this[_0x2320('0xc')]=_0xcafbc1[_0x2320('0xc')];this['countagentrejectretry']=_0xcafbc1[_0x2320('0xd')];this[_0x2320('0xe')]=_0x1be715[_0x2320('0xe')];this[_0x2320('0xf')]=_0xcafbc1[_0x2320('0x10')];this[_0x2320('0x11')]=_0xcafbc1[_0x2320('0x12')];this['starttime']=_0xcafbc1['starttime'];this[_0x2320('0x13')]=_0xcafbc1[_0x2320('0x13')];this[_0x2320('0x14')]=_0xcafbc1[_0x2320('0x14')];this[_0x2320('0x15')]=_0xcafbc1[_0x2320('0x15')];this[_0x2320('0x16')]=this[_0x2320('0x14')];this[_0x2320('0x17')]=utils['getSeconds'](_0xcafbc1[_0x2320('0x13')],_0xcafbc1[_0x2320('0x18')]);this[_0x2320('0x19')]=utils['getSeconds'](this[_0x2320('0x14')],_0xcafbc1[_0x2320('0x13')]);this['talktime']=0x0;this[_0x2320('0x5')]=_0x1be715[_0x2320('0x5')];this['membername']=_0x1be715['connectedlinename'];this['reason']=_0x1be715[_0x2320('0x1a')];this[_0x2320('0x1b')]=_0xcafbc1[_0x2320('0x1b')];this['callbackuniqueid']=_0xcafbc1[_0x2320('0x1c')];this[_0x2320('0x1d')]=_0xcafbc1[_0x2320('0x1d')];this['recallme']=_0xcafbc1[_0x2320('0x1e')];this[_0x2320('0x1f')]=_0xcafbc1[_0x2320('0x1f')];this[_0x2320('0x20')]=_0xcafbc1['ListId'];this[_0x2320('0x21')]=_0xcafbc1[_0x2320('0x21')];this[_0x2320('0x22')]=_0xcafbc1[_0x2320('0x22')];this[_0x2320('0x23')]=_0xcafbc1['CampaignId'];this['originatecalleridnum']=_0xcafbc1[_0x2320('0x24')]||'';this[_0x2320('0x25')]=_0xcafbc1['originatecalleridname']||'';this['agiafterat']=_0xcafbc1[_0x2320('0x26')];this[_0x2320('0x27')]=_0xcafbc1[_0x2320('0x27')];this[_0x2320('0x28')]=_0xcafbc1[_0x2320('0x28')];}module[_0x2320('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 91651c2..dfc0a97 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['temp','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','getContactDialer','catch'];(function(_0x5b4c10,_0x7f8fdc){var _0x47a997=function(_0x3504a1){while(--_0x3504a1){_0x5b4c10['push'](_0x5b4c10['shift']());}};_0x47a997(++_0x7f8fdc);}(_0xa456,0x142));var _0x6a45=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xa456[_0x1b6186];return _0x186121;};'use strict';var util=require(_0x6a45('0x0'));var logger=require(_0x6a45('0x1'))(_0x6a45('0x2'));var cmHopper=require(_0x6a45('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x6a45('0x4'));var cmHopperHistory=require(_0x6a45('0x5'));function inspectError(_0x3f7448){return util['inspect'](_0x3f7448,{'showHidden':![],'depth':null});}function getContactDialer(_0x1f0701,_0x40acad,_0x1e5882){return cmHopper[_0x6a45('0x6')](_0x1f0701['id'],_0x40acad,_0x1e5882,_0x1f0701['dialOrderByScheduledAt'])[_0x6a45('0x7')](function(_0x26bfc0){_0x1f0701[_0x6a45('0x8')]=0x0;logger[_0x6a45('0x9')](_0x6a45('0xa'),inspectError(_0x26bfc0));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x3a5c20,_0x517040){return cmHopper[_0x6a45('0xb')](_0x3a5c20['id'],_0x517040,_0x3a5c20[_0x6a45('0xc')])[_0x6a45('0x7')](function(_0x147679){_0x3a5c20[_0x6a45('0x8')]=0x0;logger['error']('[getContactDialerIvr]',inspectError(_0x147679));});}exports[_0x6a45('0xb')]=getContactDialerIvr;function countReScheduled(_0x465b59){return cmHopper['countReScheduled'](_0x465b59)['catch'](function(_0x511b92){logger[_0x6a45('0x9')](_0x6a45('0xd'),inspectError(_0x511b92));});}exports[_0x6a45('0xe')]=countReScheduled;function rescheduleContact(_0x3f01f6){return cmHopper[_0x6a45('0xf')](_0x3f01f6)['catch'](function(_0x563c3b){logger[_0x6a45('0x9')](_0x6a45('0x10'),inspectError(_0x563c3b));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x2c20db,_0x171176,_0x3fab82){return cmHopper[_0x6a45('0x11')](_0x2c20db,_0x171176,_0x3fab82)['catch'](function(_0x54507b){logger['error'](_0x6a45('0x12'),inspectError(_0x54507b));});}exports[_0x6a45('0x11')]=unlockContact;function moveContactManagedDialer(_0x360b7f){return cmHopper['moveContactManagedDialer'](_0x360b7f)[_0x6a45('0x7')](function(_0x102981){logger[_0x6a45('0x9')]('[moveContactManagedDialer]',inspectError(_0x102981));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x573453){return cmHopperBlack[_0x6a45('0x13')](_0x573453)[_0x6a45('0x7')](function(_0x5bdaef){logger[_0x6a45('0x9')](_0x6a45('0x14'),inspectError(_0x5bdaef));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4f7110){return cmHopperBlack[_0x6a45('0x15')](_0x4f7110)[_0x6a45('0x7')](function(_0x458b99){logger[_0x6a45('0x9')]('[checkIsBlackListIvr]',inspectError(_0x458b99));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3faae5,_0x59af4b,_0x11290c){return cmHopperAdditionalPhone[_0x6a45('0x16')](_0x3faae5,_0x59af4b,_0x11290c)[_0x6a45('0x7')](function(_0x3ad898){logger[_0x6a45('0x9')](_0x6a45('0x17'),inspectError(_0x3ad898));});}exports[_0x6a45('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x18a5b8,_0x1310d7,_0x46587a){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x18a5b8,_0x1310d7,_0x46587a)[_0x6a45('0x7')](function(_0x5a0389){logger[_0x6a45('0x9')](_0x6a45('0x18'),inspectError(_0x5a0389));});}exports[_0x6a45('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x2c7315){return cmHopperHistory[_0x6a45('0x1a')](_0x2c7315)['catch'](function(_0x2b8cc8){logger[_0x6a45('0x9')](_0x6a45('0x1b'),inspectError(_0x2b8cc8));});}exports[_0x6a45('0x1a')]=avgHandleTime;function createHistory(_0x8265d9){return cmHopperHistory[_0x6a45('0x1c')](_0x8265d9)[_0x6a45('0x7')](function(_0x313c13){logger['error'](_0x6a45('0x1d'),inspectError(_0x313c13));});}exports[_0x6a45('0x1c')]=createHistory; \ No newline at end of file +var _0x4bd3=['catch','error','[getContactDialer]','getContactDialerIvr','temp','[countReScheduled]','countReScheduled','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','dialer','../../rpc/cmHopper','inspect','getContactDialer'];(function(_0x1b5c7f,_0x550ad3){var _0x474642=function(_0x1c3a55){while(--_0x1c3a55){_0x1b5c7f['push'](_0x1b5c7f['shift']());}};_0x474642(++_0x550ad3);}(_0x4bd3,0x174));var _0x34bd=function(_0x544c32,_0x2c3406){_0x544c32=_0x544c32-0x0;var _0x5abd2c=_0x4bd3[_0x544c32];return _0x5abd2c;};'use strict';var util=require(_0x34bd('0x0'));var logger=require('../../../../config/logger')(_0x34bd('0x1'));var cmHopper=require(_0x34bd('0x2'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x22b921){return util[_0x34bd('0x3')](_0x22b921,{'showHidden':![],'depth':null});}function getContactDialer(_0x1fc8eb,_0x5846f3,_0x2133c5){return cmHopper[_0x34bd('0x4')](_0x1fc8eb['id'],_0x5846f3,_0x2133c5,_0x1fc8eb['dialOrderByScheduledAt'])[_0x34bd('0x5')](function(_0x213716){_0x1fc8eb['temp']=0x0;logger[_0x34bd('0x6')](_0x34bd('0x7'),inspectError(_0x213716));});}exports[_0x34bd('0x4')]=getContactDialer;function getContactDialerIvr(_0xed6181,_0x1ac77f){return cmHopper[_0x34bd('0x8')](_0xed6181['id'],_0x1ac77f,_0xed6181['dialOrderByScheduledAt'])[_0x34bd('0x5')](function(_0x45322f){_0xed6181[_0x34bd('0x9')]=0x0;logger[_0x34bd('0x6')]('[getContactDialerIvr]',inspectError(_0x45322f));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x3da7a0){return cmHopper['countReScheduled'](_0x3da7a0)['catch'](function(_0x275d80){logger[_0x34bd('0x6')](_0x34bd('0xa'),inspectError(_0x275d80));});}exports[_0x34bd('0xb')]=countReScheduled;function rescheduleContact(_0x2ee180){return cmHopper[_0x34bd('0xc')](_0x2ee180)[_0x34bd('0x5')](function(_0x236f6b){logger[_0x34bd('0x6')]('[rescheduleContact]',inspectError(_0x236f6b));});}exports[_0x34bd('0xc')]=rescheduleContact;function unlockContact(_0x4d4955,_0x4e3886,_0x6638ed){return cmHopper[_0x34bd('0xd')](_0x4d4955,_0x4e3886,_0x6638ed)[_0x34bd('0x5')](function(_0x2dc917){logger[_0x34bd('0x6')](_0x34bd('0xe'),inspectError(_0x2dc917));});}exports[_0x34bd('0xd')]=unlockContact;function moveContactManagedDialer(_0x1c12e8){return cmHopper[_0x34bd('0xf')](_0x1c12e8)[_0x34bd('0x5')](function(_0x4b5ebb){logger['error'](_0x34bd('0x10'),inspectError(_0x4b5ebb));});}exports[_0x34bd('0xf')]=moveContactManagedDialer;function checkIsBlackList(_0x265e70){return cmHopperBlack[_0x34bd('0x11')](_0x265e70)[_0x34bd('0x5')](function(_0x23a94a){logger[_0x34bd('0x6')](_0x34bd('0x12'),inspectError(_0x23a94a));});}exports[_0x34bd('0x11')]=checkIsBlackList;function checkIsBlackListIvr(_0x55538e){return cmHopperBlack[_0x34bd('0x13')](_0x55538e)[_0x34bd('0x5')](function(_0x49f625){logger[_0x34bd('0x6')](_0x34bd('0x14'),inspectError(_0x49f625));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x582772,_0x5da62a,_0x4edf84){return cmHopperAdditionalPhone[_0x34bd('0x15')](_0x582772,_0x5da62a,_0x4edf84)['catch'](function(_0x10fc4b){logger[_0x34bd('0x6')](_0x34bd('0x16'),inspectError(_0x10fc4b));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x41bffd,_0x14479a,_0x4f0dff){return cmHopperAdditionalPhone[_0x34bd('0x17')](_0x41bffd,_0x14479a,_0x4f0dff)['catch'](function(_0x29bda8){logger[_0x34bd('0x6')](_0x34bd('0x18'),inspectError(_0x29bda8));});}exports[_0x34bd('0x17')]=swapAdditionalPhones;function avgHandleTime(_0x56baf7){return cmHopperHistory[_0x34bd('0x19')](_0x56baf7)[_0x34bd('0x5')](function(_0x5d2e3d){logger[_0x34bd('0x6')](_0x34bd('0x1a'),inspectError(_0x5d2e3d));});}exports[_0x34bd('0x19')]=avgHandleTime;function createHistory(_0x3f675c){return cmHopperHistory[_0x34bd('0x1b')](_0x3f675c)[_0x34bd('0x5')](function(_0x177d43){logger['error'](_0x34bd('0x1c'),inspectError(_0x177d43));});}exports[_0x34bd('0x1b')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index fc75613..9ca53c7 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fa9=['SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','pow','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','moment','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','isPreviewCampaign','type','outbound','isOutboundQueue','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x4fa9,0xc6));var _0x94fa=function(_0x1f9a8e,_0x435967){_0x1f9a8e=_0x1f9a8e-0x0;var _0x3bd851=_0x4fa9[_0x1f9a8e];return _0x3bd851;};'use strict';var _=require('lodash');var moment=require(_0x94fa('0x0'));var util=require('util');var logger=require(_0x94fa('0x1'))('dialer');var timezones=require(_0x94fa('0x2'))[_0x94fa('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x94fa('0x4'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x94fa('0x5'),'EMPTY_INTERVAL':_0x94fa('0x6'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x94fa('0x7'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0x94fa('0x8'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x94fa('0x9'),'QUEUE_RECALL':_0x94fa('0xa'),'RECALL_TIMEOUT':_0x94fa('0xb'),'RUNNING':_0x94fa('0xc'),'UNKNOWN_TIMEZONE':_0x94fa('0xd'),'UNREACHABLE_TRUNK':_0x94fa('0xe')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x25b26c){return _0x25b26c[_0x94fa('0xf')]==='preview';}exports[_0x94fa('0x10')]=isPreviewCampaign;function isIVRCampaign(_0x472f34){return _0x472f34[_0x94fa('0x11')]==='ivr';}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x24eaaf){return _0x24eaaf[_0x94fa('0x11')]===_0x94fa('0x12');}exports[_0x94fa('0x13')]=isOutboundQueue;function isQueueCampaignActive(_0x3cbff3){return _0x3cbff3['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x469e08){return _0x469e08['active'];}exports[_0x94fa('0x14')]=isIVRCampaignActive;function getSeconds(_0x57a2e5,_0x4b0e95){var _0x41b615=moment(_0x57a2e5)[_0x94fa('0x15')](0x0);var _0x289d05=moment(_0x4b0e95)['milliseconds'](0x0);return _0x41b615[_0x94fa('0x16')](_0x289d05,_0x94fa('0x17'));}exports[_0x94fa('0x18')]=getSeconds;function hasQueueCampaignDataChanged(_0x60f4e,_0x4f83a7){var _0x25fc9a=![];var _0x348714=_0x60f4e[_0x94fa('0xf')]!==_0x4f83a7['dialMethod']||_0x60f4e[_0x94fa('0x19')]!==_0x4f83a7['dialActive']||_0x60f4e[_0x94fa('0x1a')]!==_0x4f83a7[_0x94fa('0x1a')];var _0xae286b=_0x60f4e['available']!==_0x4f83a7[_0x94fa('0x1b')]||_0x60f4e[_0x94fa('0x1c')]!==_0x4f83a7[_0x94fa('0x1c')]||_0x60f4e[_0x94fa('0x1d')]!==_0x4f83a7[_0x94fa('0x1d')]||_0x60f4e[_0x94fa('0x1e')]!==_0x4f83a7[_0x94fa('0x1e')]||_0x60f4e['talking']!==_0x4f83a7[_0x94fa('0x1f')]||_0x60f4e[_0x94fa('0x20')]!==_0x4f83a7[_0x94fa('0x20')]||_0x60f4e[_0x94fa('0x21')]!==_0x4f83a7['waiting']||_0x60f4e[_0x94fa('0x22')]!==_0x4f83a7[_0x94fa('0x22')]||_0x60f4e[_0x94fa('0x23')]!==_0x4f83a7[_0x94fa('0x23')];if(_0x60f4e[_0x94fa('0x24')]&&_0x4f83a7['Trunk']){_0x25fc9a=_0x60f4e[_0x94fa('0x24')][_0x94fa('0x25')]!==_0x4f83a7[_0x94fa('0x24')]['name']||_0x60f4e[_0x94fa('0x24')][_0x94fa('0x26')]!==_0x4f83a7[_0x94fa('0x24')][_0x94fa('0x26')];}return _0x348714||_0xae286b||_0x25fc9a;}exports[_0x94fa('0x27')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x15b78d){var _0x148b1e=null;var _0x10c60a=_0x15b78d[_0x94fa('0x28')];if(_[_0x94fa('0x29')](_0x15b78d[_0x94fa('0x2a')])||_['isNil'](_0x15b78d[_0x94fa('0x2b')])||_[_0x94fa('0x29')](_0x15b78d[_0x94fa('0x2b')][_0x94fa('0x2c')])){_0x148b1e=CAMPAIGN_STATUS[_0x94fa('0x2d')];}else if(_[_0x94fa('0x2e')](_0x15b78d[_0x94fa('0x2a')])||_['isEmpty'](_0x15b78d[_0x94fa('0x2b')][_0x94fa('0x2c')])){_0x148b1e=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x10c60a&&!timezones[_0x10c60a]){_0x148b1e=CAMPAIGN_STATUS[_0x94fa('0x2f')];}return _0x148b1e;}function checkAnyValidTrunk(_0x13cb19,_0x5a5a5a){var _0x2ee257=null;var _0x38a5ef=_0x94fa('0x30');var _0x1e7c2d=[_0x94fa('0x31'),_0x94fa('0x32')];var _0x2ad0c0=!![];if(_0x13cb19[_0x94fa('0x24')]&&_0x13cb19[_0x94fa('0x24')]['active']){_0x38a5ef+=_0x13cb19[_0x94fa('0x24')][_0x94fa('0x25')];_0x2ee257=_0x5a5a5a[_0x38a5ef];_0x2ad0c0=_0x1e7c2d[_0x94fa('0x33')](_0x2ee257[_0x94fa('0x34')]);}else if(_0x13cb19[_0x94fa('0x35')]&&_0x13cb19[_0x94fa('0x35')][_0x94fa('0x26')]){_0x38a5ef+=_0x13cb19['TrunkBackup'][_0x94fa('0x25')];_0x2ee257=_0x5a5a5a[_0x38a5ef];_0x2ad0c0=_0x1e7c2d[_0x94fa('0x33')](_0x2ee257['status']);}return _0x2ad0c0;}function getQueueCampaignStatusMessage(_0x35eb90,_0x4270e0){var _0x1ce074=CAMPAIGN_STATUS[_0x94fa('0x4')];var _0x18fdcc=isPreviewCampaign(_0x35eb90);if(!isQueueCampaignActive(_0x35eb90)){if(_0x18fdcc){_0x1ce074=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x35eb90[_0x94fa('0x23')]===0x0&&_0x35eb90[_0x94fa('0x1f')]===0x0&&_0x35eb90[_0x94fa('0x21')]===0x0&&(_0x35eb90[_0x94fa('0x20')]||0x0)===0x0){_0x1ce074=CAMPAIGN_STATUS[_0x94fa('0x36')];}else{_0x1ce074=CAMPAIGN_STATUS[_0x94fa('0x37')];}}}else if(_0x35eb90['loggedIn']===0x0){_0x1ce074=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x35eb90,_0x4270e0)){_0x1ce074=CAMPAIGN_STATUS[_0x94fa('0x38')];}else if(!isPreviewCampaign(_0x35eb90)){var _0x33ea1a=checkAnyValidQueueCampaignInterval(_0x35eb90);if(_0x33ea1a){_0x1ce074=_0x33ea1a;}}return _0x1ce074;}exports[_0x94fa('0x39')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x14b768){var _0x1fb3a9=CAMPAIGN_STATUS[_0x94fa('0x37')];if(_0x14b768[_0x94fa('0x23')]===0x0&&_0x14b768[_0x94fa('0x1f')]===0x0&&_0x14b768[_0x94fa('0x21')]===0x0&&(_0x14b768[_0x94fa('0x20')]||0x0)===0x0){_0x1fb3a9=CAMPAIGN_STATUS[_0x94fa('0x36')];}return _0x1fb3a9;}exports[_0x94fa('0x3a')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2b6e3b){var _0x106718=_0x2b6e3b[_0x94fa('0x3b')](/"(.*?)"/);return _0x106718?_0x106718[0x1]:_0x2b6e3b;}exports[_0x94fa('0x3c')]=extractCalleridName;function getCallerId(_0x24fc1c,_0x27b5c0,_0xe09b06){if(!_[_0x94fa('0x3d')](_0xe09b06)&&typeof _0xe09b06===_0x94fa('0x3e')&&!_[_0x94fa('0x2e')](_0xe09b06)){if(!_['isUndefined'](_0x27b5c0)&&typeof _0x27b5c0===_0x94fa('0x3e')&&!_[_0x94fa('0x2e')](_0x27b5c0)){return util[_0x94fa('0x3f')](_0x94fa('0x40'),_0x27b5c0,_0xe09b06);}return util[_0x94fa('0x3f')]('\x22%s\x22\x20<%s>',_0xe09b06,_0xe09b06);}if(!_['isUndefined'](_0x24fc1c)&&typeof _0x24fc1c==='string'&&!_[_0x94fa('0x2e')](_0x24fc1c)){return _0x24fc1c;}return'\x22\x22\x20<>';}exports[_0x94fa('0x41')]=getCallerId;function getCallerIdRandom(_0xdb3628,_0x4ef8eb){var _0x48e7d8;var _0x113be1;var _0x31d178;if(_0x4ef8eb<=0x0){_0x4ef8eb=0x1;}_0x48e7d8=new RegExp('\x5cw{0,'+_0x4ef8eb+'}$');_0x113be1=Math[_0x94fa('0x42')](0xa,_0x4ef8eb-0x1);_0x31d178=Math[_0x94fa('0x42')](0xa,_0x4ef8eb)-0x1;return util['format']('%s',_['replace'](_0xdb3628,_0x48e7d8,_['random'](_0x113be1,_0x31d178)[_0x94fa('0x43')]()));}exports[_0x94fa('0x44')]=getCallerIdRandom;function decrementOriginate(_0xd95b1f){if(_0xd95b1f[_0x94fa('0x23')]&&_0xd95b1f[_0x94fa('0x23')]>0x0){_0xd95b1f[_0x94fa('0x23')]-=0x1;}else{logger[_0x94fa('0x45')](_0x94fa('0x46'));}}exports[_0x94fa('0x47')]=decrementOriginate;function checkContactEmpty(_0xa2afb6){return _0xa2afb6&&_0xa2afb6[_0x94fa('0x48')]>0x0;}exports[_0x94fa('0x49')]=checkContactEmpty;function erlangb(_0x509f88,_0x39d5b5){if(_0x39d5b5===0x0){return 0x0;}var _0x161054=0x1;for(var _0x14a091=0x1;_0x14a091<=_0x39d5b5;_0x14a091+=0x1){_0x161054=0x1+_0x161054*_0x14a091/_0x509f88;}return 0x1/_0x161054;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x3995aa,_0x22d9ad,_0xead9ea){if(_0x22d9ad>_0xead9ea){for(var _0x253fee=0x0;_0x253fee<_0x22d9ad-_0xead9ea;_0x253fee+=0x1){decrementOriginate(_0x3995aa);}}}exports[_0x94fa('0x4a')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x13e1ce){var _0x3bbc2b={};var _0xd959f8=['id',_0x94fa('0x4b'),_0x94fa('0x4c'),_0x94fa('0x4d')];const _0x1fe134=0xfa;if(_0x13e1ce){for(var _0x5be5e3 in _0x13e1ce){if(typeof _0x13e1ce[_0x5be5e3]!==_0x94fa('0x4e')){if(!_['isNil'](_0x13e1ce[_0x5be5e3])&&!_0xd959f8[_0x94fa('0x33')](_0x5be5e3)){if(_0x5be5e3===_0x94fa('0x4f')&&_0x13e1ce[_0x5be5e3][_0x94fa('0x48')]>_0x1fe134){_0x3bbc2b[_0x94fa('0x50')+_0x5be5e3['toUpperCase']()]=_0x13e1ce[_0x5be5e3][_0x94fa('0x43')]()['substring'](0x0,_0x1fe134);}else{_0x3bbc2b[_0x94fa('0x50')+_0x5be5e3[_0x94fa('0x51')]()]=_0x13e1ce[_0x5be5e3];}}}}}return _0x3bbc2b;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file +var _0x61fa=['paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','GLOBAL_INTERVAL_IS_OVERTIME','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb'];(function(_0xa20ed6,_0xe77cb0){var _0xa09de6=function(_0x3d0f51){while(--_0x3d0f51){_0xa20ed6['push'](_0xa20ed6['shift']());}};_0xa09de6(++_0xe77cb0);}(_0x61fa,0x1d8));var _0xa61f=function(_0x1e3128,_0x44f7b6){_0x1e3128=_0x1e3128-0x0;var _0x55755f=_0x61fa[_0x1e3128];return _0x55755f;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var logger=require('../../../../config/logger')(_0xa61f('0x0'));var timezones=require(_0xa61f('0x1'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xa61f('0x2'),'BLACKLIST':_0xa61f('0x3'),'CONTACTS_RESCHEDULED':_0xa61f('0x4'),'DEACTIVATED':_0xa61f('0x5'),'DISACTIVED':_0xa61f('0x6'),'EMPTY_INTERVAL':_0xa61f('0x7'),'INACTIVE':_0xa61f('0x8'),'NO_AGENTS_LOGGED':_0xa61f('0x9'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xa61f('0xa'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xa61f('0xb'),'UNKNOWN_TIMEZONE':_0xa61f('0xc'),'UNREACHABLE_TRUNK':_0xa61f('0xd')};exports[_0xa61f('0xe')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0xaa7dbd){return _0xaa7dbd[_0xa61f('0xf')]===_0xa61f('0x10');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x411ca0){return _0x411ca0[_0xa61f('0x11')]===_0xa61f('0x12');}exports[_0xa61f('0x13')]=isIVRCampaign;function isOutboundQueue(_0x3a59eb){return _0x3a59eb[_0xa61f('0x11')]===_0xa61f('0x14');}exports[_0xa61f('0x15')]=isOutboundQueue;function isQueueCampaignActive(_0x4eb2b8){return _0x4eb2b8[_0xa61f('0x16')];}exports[_0xa61f('0x17')]=isQueueCampaignActive;function isIVRCampaignActive(_0x20cd9b){return _0x20cd9b['active'];}exports[_0xa61f('0x18')]=isIVRCampaignActive;function getSeconds(_0x2257ac,_0x5935ac){var _0x57bab7=moment(_0x2257ac)[_0xa61f('0x19')](0x0);var _0x89c5d5=moment(_0x5935ac)[_0xa61f('0x19')](0x0);return _0x57bab7[_0xa61f('0x1a')](_0x89c5d5,'seconds');}exports[_0xa61f('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x29f357,_0x5a774a){var _0x5bdf12=![];var _0x58061d=_0x29f357[_0xa61f('0xf')]!==_0x5a774a[_0xa61f('0xf')]||_0x29f357['dialActive']!==_0x5a774a['dialActive']||_0x29f357[_0xa61f('0x1c')]!==_0x5a774a[_0xa61f('0x1c')];var _0x576bee=_0x29f357[_0xa61f('0x1d')]!==_0x5a774a[_0xa61f('0x1d')]||_0x29f357['loggedIn']!==_0x5a774a[_0xa61f('0x1e')]||_0x29f357['loggedInDb']!==_0x5a774a[_0xa61f('0x1f')]||_0x29f357[_0xa61f('0x20')]!==_0x5a774a[_0xa61f('0x20')]||_0x29f357[_0xa61f('0x21')]!==_0x5a774a[_0xa61f('0x21')]||_0x29f357[_0xa61f('0x22')]!==_0x5a774a[_0xa61f('0x22')]||_0x29f357['waiting']!==_0x5a774a[_0xa61f('0x23')]||_0x29f357[_0xa61f('0x24')]!==_0x5a774a[_0xa61f('0x24')]||_0x29f357[_0xa61f('0x25')]!==_0x5a774a[_0xa61f('0x25')];if(_0x29f357[_0xa61f('0x26')]&&_0x5a774a[_0xa61f('0x26')]){_0x5bdf12=_0x29f357[_0xa61f('0x26')][_0xa61f('0x27')]!==_0x5a774a[_0xa61f('0x26')][_0xa61f('0x27')]||_0x29f357[_0xa61f('0x26')][_0xa61f('0x28')]!==_0x5a774a[_0xa61f('0x26')][_0xa61f('0x28')];}return _0x58061d||_0x576bee||_0x5bdf12;}exports[_0xa61f('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x298c92){var _0x289485=null;var _0x470f46=_0x298c92['dialTimezone'];if(_['isNil'](_0x298c92['dialGlobalInterval'])||_[_0xa61f('0x2a')](_0x298c92[_0xa61f('0x2b')])||_[_0xa61f('0x2a')](_0x298c92[_0xa61f('0x2b')][_0xa61f('0x2c')])){_0x289485=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xa61f('0x2d')](_0x298c92['dialGlobalInterval'])||_[_0xa61f('0x2d')](_0x298c92[_0xa61f('0x2b')][_0xa61f('0x2c')])){_0x289485=CAMPAIGN_STATUS[_0xa61f('0x2e')];}else if(_0x470f46&&!timezones[_0x470f46]){_0x289485=CAMPAIGN_STATUS[_0xa61f('0x2f')];}return _0x289485;}function checkAnyValidTrunk(_0x50ebd7,_0x4affb2){var _0x4013f6=null;var _0x29c2e5=_0xa61f('0x30');var _0x43aa15=[_0xa61f('0x31'),_0xa61f('0x32')];var _0x3c1e5a=!![];if(_0x50ebd7['Trunk']&&_0x50ebd7[_0xa61f('0x26')][_0xa61f('0x28')]){_0x29c2e5+=_0x50ebd7[_0xa61f('0x26')][_0xa61f('0x27')];_0x4013f6=_0x4affb2[_0x29c2e5];_0x3c1e5a=_0x43aa15['includes'](_0x4013f6[_0xa61f('0x33')]);}else if(_0x50ebd7[_0xa61f('0x34')]&&_0x50ebd7[_0xa61f('0x34')][_0xa61f('0x28')]){_0x29c2e5+=_0x50ebd7[_0xa61f('0x34')][_0xa61f('0x27')];_0x4013f6=_0x4affb2[_0x29c2e5];_0x3c1e5a=_0x43aa15[_0xa61f('0x35')](_0x4013f6[_0xa61f('0x33')]);}return _0x3c1e5a;}function getQueueCampaignStatusMessage(_0x4eb6c1,_0x18fe13){var _0x32b49f=CAMPAIGN_STATUS[_0xa61f('0x2')];var _0x354d3a=isPreviewCampaign(_0x4eb6c1);if(!isQueueCampaignActive(_0x4eb6c1)){if(_0x354d3a){_0x32b49f=CAMPAIGN_STATUS[_0xa61f('0x36')];}else{if(_0x4eb6c1[_0xa61f('0x25')]===0x0&&_0x4eb6c1[_0xa61f('0x21')]===0x0&&_0x4eb6c1['waiting']===0x0&&(_0x4eb6c1[_0xa61f('0x22')]||0x0)===0x0){_0x32b49f=CAMPAIGN_STATUS[_0xa61f('0x36')];}else{_0x32b49f=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x4eb6c1[_0xa61f('0x1e')]===0x0){_0x32b49f=CAMPAIGN_STATUS[_0xa61f('0x37')];}else if(!checkAnyValidTrunk(_0x4eb6c1,_0x18fe13)){_0x32b49f=CAMPAIGN_STATUS[_0xa61f('0x38')];}else if(!isPreviewCampaign(_0x4eb6c1)){var _0x1a01f0=checkAnyValidQueueCampaignInterval(_0x4eb6c1);if(_0x1a01f0){_0x32b49f=_0x1a01f0;}}return _0x32b49f;}exports[_0xa61f('0x39')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x16f0ed){var _0x1697ee=CAMPAIGN_STATUS[_0xa61f('0x3a')];if(_0x16f0ed[_0xa61f('0x25')]===0x0&&_0x16f0ed[_0xa61f('0x21')]===0x0&&_0x16f0ed[_0xa61f('0x23')]===0x0&&(_0x16f0ed[_0xa61f('0x22')]||0x0)===0x0){_0x1697ee=CAMPAIGN_STATUS[_0xa61f('0x36')];}return _0x1697ee;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x50a77b){var _0x592d70=_0x50a77b[_0xa61f('0x3b')](/"(.*?)"/);return _0x592d70?_0x592d70[0x1]:_0x50a77b;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x1f6c3e,_0x10260d,_0x232c87){if(!_[_0xa61f('0x3c')](_0x232c87)&&typeof _0x232c87===_0xa61f('0x3d')&&!_[_0xa61f('0x2d')](_0x232c87)){if(!_[_0xa61f('0x3c')](_0x10260d)&&typeof _0x10260d===_0xa61f('0x3d')&&!_[_0xa61f('0x2d')](_0x10260d)){return util[_0xa61f('0x3e')](_0xa61f('0x3f'),_0x10260d,_0x232c87);}return util['format']('\x22%s\x22\x20<%s>',_0x232c87,_0x232c87);}if(!_['isUndefined'](_0x1f6c3e)&&typeof _0x1f6c3e===_0xa61f('0x3d')&&!_[_0xa61f('0x2d')](_0x1f6c3e)){return _0x1f6c3e;}return _0xa61f('0x40');}exports[_0xa61f('0x41')]=getCallerId;function getCallerIdRandom(_0x226718,_0x539bda){var _0x301d17;var _0x3cb793;var _0x5ca306;if(_0x539bda<=0x0){_0x539bda=0x1;}_0x301d17=new RegExp(_0xa61f('0x42')+_0x539bda+'}$');_0x3cb793=Math[_0xa61f('0x43')](0xa,_0x539bda-0x1);_0x5ca306=Math[_0xa61f('0x43')](0xa,_0x539bda)-0x1;return util['format']('%s',_[_0xa61f('0x44')](_0x226718,_0x301d17,_[_0xa61f('0x45')](_0x3cb793,_0x5ca306)[_0xa61f('0x46')]()));}exports[_0xa61f('0x47')]=getCallerIdRandom;function decrementOriginate(_0x532091){if(_0x532091['originated']&&_0x532091[_0xa61f('0x25')]>0x0){_0x532091[_0xa61f('0x25')]-=0x1;}else{logger[_0xa61f('0x48')](_0xa61f('0x49'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x24cf95){return _0x24cf95&&_0x24cf95[_0xa61f('0x4a')]>0x0;}exports[_0xa61f('0x4b')]=checkContactEmpty;function erlangb(_0xbe53e,_0x211671){if(_0x211671===0x0){return 0x0;}var _0x3acf61=0x1;for(var _0x551f98=0x1;_0x551f98<=_0x211671;_0x551f98+=0x1){_0x3acf61=0x1+_0x3acf61*_0x551f98/_0xbe53e;}return 0x1/_0x3acf61;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x5317a1,_0x4e0c64,_0x7ff605){if(_0x4e0c64>_0x7ff605){for(var _0x4eeac3=0x0;_0x4eeac3<_0x4e0c64-_0x7ff605;_0x4eeac3+=0x1){decrementOriginate(_0x5317a1);}}}exports[_0xa61f('0x4c')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x2222c7){var _0x59944d={};var _0x10a7f4=['id',_0xa61f('0x4d'),_0xa61f('0x4e'),_0xa61f('0x4f')];const _0x241f7f=0xfa;if(_0x2222c7){for(var _0x54a34e in _0x2222c7){if(typeof _0x2222c7[_0x54a34e]!==_0xa61f('0x50')){if(!_['isNil'](_0x2222c7[_0x54a34e])&&!_0x10a7f4['includes'](_0x54a34e)){if(_0x54a34e===_0xa61f('0x51')&&_0x2222c7[_0x54a34e]['length']>_0x241f7f){_0x59944d[_0xa61f('0x52')+_0x54a34e[_0xa61f('0x53')]()]=_0x2222c7[_0x54a34e][_0xa61f('0x46')]()['substring'](0x0,_0x241f7f);}else{_0x59944d[_0xa61f('0x52')+_0x54a34e['toUpperCase']()]=_0x2222c7[_0x54a34e];}}}}}return _0x59944d;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index bb12f82..533b987 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(_0x13080d,_0x5f1876){var _0x4f5705=function(_0x3e70d5){while(--_0x3e70d5){_0x13080d['push'](_0x13080d['shift']());}};_0x4f5705(++_0x5f1876);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x56dc98,_0x1357fc){var _0x2202d4=function(_0xf4fa3a){while(--_0xf4fa3a){_0x56dc98['push'](_0x56dc98['shift']());}};_0x2202d4(++_0x1357fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 6a1197e..da21b9d 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 _0x6ff1=['[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','Convert\x20pdf\x20to\x20tif','variablesAction','execOriginate','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','moment','path','./util/gs','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','then','notify','fax','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received'];(function(_0x455ac0,_0x1d5f16){var _0xfb9257=function(_0x126d21){while(--_0x126d21){_0x455ac0['push'](_0x455ac0['shift']());}};_0xfb9257(++_0x1d5f16);}(_0x6ff1,0xfc));var _0x16ff=function(_0x218d60,_0x46bf0b){_0x218d60=_0x218d60-0x0;var _0x474243=_0x6ff1[_0x218d60];return _0x474243;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x16ff('0x0'));var path=require(_0x16ff('0x1'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x16ff('0x2'));var logger=require('../../../config/logger')('fax');var ami=require('../ami');var rpcDb=require(_0x16ff('0x3'));var Channel=require(_0x16ff('0x4'));var ut=require(_0x16ff('0x5'));var Action=require('./action');var faxAccount=require(_0x16ff('0x6'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x16ff('0x7'));function Fax(_0x332464){this[_0x16ff('0x8')]={};this['faxAccounts']=_0x332464[_0x16ff('0x9')];this[_0x16ff('0xa')]=_0x332464[_0x16ff('0xa')];this[_0x16ff('0xb')]={};ami['on']('newchannel',this[_0x16ff('0xc')][_0x16ff('0xd')](this));ami['on'](_0x16ff('0xe'),this[_0x16ff('0xf')][_0x16ff('0xd')](this));ami['on']('newstate',this[_0x16ff('0x10')][_0x16ff('0xd')](this));ami['on']('newexten',this[_0x16ff('0x11')][_0x16ff('0xd')](this));ami['on'](_0x16ff('0x12'),this[_0x16ff('0x13')]['bind'](this));ami['on'](_0x16ff('0x14'),this[_0x16ff('0x15')][_0x16ff('0xd')](this));ami['on'](_0x16ff('0x16'),this[_0x16ff('0x17')]['bind'](this));ami['on'](_0x16ff('0x18'),this['syncOriginateResponse']['bind'](this));}Fax[_0x16ff('0x19')][_0x16ff('0xc')]=function(_0x1af4a9){if(_0x1af4a9[_0x16ff('0x1a')]===_0x16ff('0x1b')){for(var _0x5236f4 in this['faxAccounts']){if(this['faxAccounts'][_0x16ff('0x1c')](_0x5236f4)){if(_0x1af4a9[_0x16ff('0x1d')]===this[_0x16ff('0x9')][_0x5236f4]['localstationid']){this[_0x16ff('0x8')][_0x1af4a9[_0x16ff('0x1e')]]={};this[_0x16ff('0x8')][_0x1af4a9['uniqueid']][_0x16ff('0x1f')]=_0x1af4a9[_0x16ff('0x1f')];this[_0x16ff('0x8')][_0x1af4a9[_0x16ff('0x1e')]]['id']=this[_0x16ff('0x9')][_0x5236f4]['id'];this[_0x16ff('0x8')][_0x1af4a9[_0x16ff('0x1e')]][_0x16ff('0x20')]=this[_0x16ff('0x9')][_0x5236f4][_0x16ff('0x20')];logger[_0x16ff('0x21')](_0x1af4a9[_0x16ff('0x1e')],_0x16ff('0x22'));}}}}if(this['actions'][_0x1af4a9[_0x16ff('0x1e')]]){this[_0x16ff('0x8')][_0x1af4a9[_0x16ff('0x1e')]]={};this[_0x16ff('0x8')][_0x1af4a9[_0x16ff('0x1e')]][_0x16ff('0x1f')]=_0x1af4a9[_0x16ff('0x1f')];logger[_0x16ff('0x21')](_0x1af4a9['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x16ff('0x19')][_0x16ff('0xf')]=function(_0x158166){if(this[_0x16ff('0x8')][_0x158166['uniqueid']]){for(var _0x565b13 in _0x158166[_0x16ff('0x23')]){if(_0x158166[_0x16ff('0x23')][_0x16ff('0x1c')](_0x565b13)){this[_0x16ff('0x8')][_0x158166[_0x16ff('0x1e')]][_0x565b13]=_0x158166[_0x16ff('0x24')];}}}};Fax[_0x16ff('0x19')][_0x16ff('0x10')]=function(_0xc7c6a0){if(this[_0x16ff('0x8')][_0xc7c6a0['uniqueid']]){this[_0x16ff('0x8')][_0xc7c6a0['uniqueid']]['channelstate']=_0xc7c6a0[_0x16ff('0x25')];this[_0x16ff('0x8')][_0xc7c6a0[_0x16ff('0x1e')]]['channelstatedesc']=_0xc7c6a0[_0x16ff('0x26')];}};Fax[_0x16ff('0x19')]['syncNewExten']=function(_0x5babdd){if(this[_0x16ff('0x8')][_0x5babdd[_0x16ff('0x1e')]]){for(var _0x982ea2 in _0x5babdd['variable']){if(_0x5babdd[_0x16ff('0x23')][_0x16ff('0x1c')](_0x982ea2)){this[_0x16ff('0x8')][_0x5babdd[_0x16ff('0x1e')]][_0x982ea2]=_0x5babdd[_0x16ff('0x24')];}}}};Fax[_0x16ff('0x19')]['syncFaxStatus']=function(_0x133311){if(this['channels'][_0x133311['uniqueid']]){this[_0x16ff('0x8')][_0x133311[_0x16ff('0x1e')]]['operation']=_0x133311[_0x16ff('0x27')];this[_0x16ff('0x8')][_0x133311[_0x16ff('0x1e')]][_0x16ff('0x28')]=_0x133311[_0x16ff('0x28')];this[_0x16ff('0x8')][_0x133311[_0x16ff('0x1e')]][_0x16ff('0x29')]=_0x133311[_0x16ff('0x29')];this[_0x16ff('0x8')][_0x133311[_0x16ff('0x1e')]][_0x16ff('0x2a')]=_0x133311[_0x16ff('0x2a')];logger[_0x16ff('0x21')](_0x133311['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x16ff('0x19')][_0x16ff('0x15')]=function(_0x49b58f){var _0xed0a9d=this;if(this[_0x16ff('0x8')][_0x49b58f[_0x16ff('0x1e')]]){var _0x1f5474=this['channels'][_0x49b58f['uniqueid']]['id'];this[_0x16ff('0x8')][_0x49b58f[_0x16ff('0x1e')]][_0x16ff('0x2b')]=_0x49b58f['remotestationid'];this[_0x16ff('0x8')][_0x49b58f['uniqueid']][_0x16ff('0x2c')]=_0x49b58f[_0x16ff('0x2c')];this[_0x16ff('0x8')][_0x49b58f[_0x16ff('0x1e')]][_0x16ff('0x29')]=_0x49b58f[_0x16ff('0x29')];this[_0x16ff('0x8')][_0x49b58f[_0x16ff('0x1e')]]['resolution']=_0x49b58f[_0x16ff('0x2d')];this['channels'][_0x49b58f[_0x16ff('0x1e')]][_0x16ff('0x2e')]=_0x49b58f[_0x16ff('0x2e')];this[_0x16ff('0x8')][_0x49b58f[_0x16ff('0x1e')]][_0x16ff('0x2a')]=_0x49b58f[_0x16ff('0x2a')];this[_0x16ff('0x8')][_0x49b58f[_0x16ff('0x1e')]][_0x16ff('0x2f')]=_0x49b58f[_0x16ff('0x2f')];if(this['channels'][_0x49b58f[_0x16ff('0x1e')]][_0x16ff('0x2c')]>0x0){tiff2pdf(_0x49b58f[_0x16ff('0x2a')],_0x16ff('0x30'),function(_0x438fe7){logger[_0x16ff('0x21')](_0x49b58f[_0x16ff('0x1e')],'\x20result\x20conversion\x20file\x20',_0x438fe7[_0x16ff('0x31')]);attachment[_0x16ff('0x32')]({'name':path[_0x16ff('0x33')](_0x49b58f[_0x16ff('0x2a')])[_0x16ff('0x20')],'basename':path[_0x16ff('0x33')](_0x49b58f['filename'])['name']+'.pdf','type':'application/pdf'})[_0x16ff('0x34')](function(_0x383e45){faxAccount[_0x16ff('0x35')](_0x1f5474,{'from':_0x49b58f[_0x16ff('0x2f')],'mapKey':_0x16ff('0x36'),'body':path[_0x16ff('0x33')](_0x49b58f['filename'])[_0x16ff('0x20')]+_0x16ff('0x37'),'AttachmentId':_0x383e45['id']})[_0x16ff('0x38')](function(_0x338df6){logger[_0x16ff('0x39')](_0x49b58f['uniqueid'],_0x16ff('0x3a'),JSON[_0x16ff('0x3b')](_0x338df6));});})[_0x16ff('0x38')](function(_0x47b160){logger[_0x16ff('0x39')](_0x49b58f[_0x16ff('0x1e')],_0x16ff('0x3c'),JSON[_0x16ff('0x3b')](_0x47b160));});});}logger[_0x16ff('0x21')](_0x49b58f[_0x16ff('0x1e')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x5b2a66){if(this[_0x16ff('0xb')][_0x5b2a66[_0x16ff('0x1e')]]){_[_0x16ff('0x3d')](this[_0x16ff('0x8')][_0x5b2a66['uniqueid']],_[_0x16ff('0x3e')](_0x5b2a66,[_0x16ff('0x3f'),_0x16ff('0x40')]));}};function updateStatus(_0x459283){if(_0x459283[_0x16ff('0x41')]){faxMessage[_0x16ff('0x42')](_0x459283[_0x16ff('0x41')],{'failMessage':_0x16ff('0x43')})[_0x16ff('0x34')](function(_0xd6e57b){ut[_0x16ff('0x44')](_0x16ff('0x45'),_0xd6e57b);})['catch'](function(_0x5674a1){ut[_0x16ff('0x44')](_0x16ff('0x46'),_0x5674a1);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x16ff('0x19')][_0x16ff('0x47')]=function(_0x252fd6,_0x2a1c24,_0x44001d){var _0x54207d=this;var _0x239c25={};if(_0x2a1c24){_0x239c25={'read':_0x2a1c24};}else{_0x239c25={'failMessage':_0x44001d};}if(this['actions'][_0x252fd6]['AttachmentId']){faxMessage[_0x16ff('0x42')](this['actions'][_0x252fd6]['AttachmentId'],_0x239c25)[_0x16ff('0x34')](function(_0x4e4a81){ut[_0x16ff('0x44')]('[Fax][Message][Updated]',_0x4e4a81);})[_0x16ff('0x38')](function(_0x2a64db){ut['logger'](_0x16ff('0x48'),_0x2a64db);})[_0x16ff('0x49')](function(){delete _0x54207d[_0x16ff('0x8')][_0x252fd6];delete _0x54207d[_0x16ff('0xb')][_0x252fd6];});}else{ut[_0x16ff('0x44')](_0x16ff('0x4a'));delete this[_0x16ff('0x8')][_0x252fd6];delete this[_0x16ff('0xb')][_0x252fd6];}};Fax[_0x16ff('0x19')][_0x16ff('0x17')]=function(_0xc558c4){var _0x2c78ac=this;if(this['channels'][_0xc558c4[_0x16ff('0x1e')]]){if(this[_0x16ff('0xb')][_0xc558c4[_0x16ff('0x1e')]]){this[_0x16ff('0x8')][_0xc558c4[_0x16ff('0x1e')]]['id']=this[_0x16ff('0xb')][_0xc558c4[_0x16ff('0x1e')]]['id'];this[_0x16ff('0x8')][_0xc558c4[_0x16ff('0x1e')]]['name']=this[_0x16ff('0xb')][_0xc558c4[_0x16ff('0x1e')]]['name'];}logger[_0x16ff('0x21')](_0xc558c4[_0x16ff('0x1e')],this['actions'][_0xc558c4[_0x16ff('0x1e')]]?_0x16ff('0x4b'):'\x20hangup\x20faxRiceive\x20',JSON[_0x16ff('0x3b')](this[_0x16ff('0x8')][_0xc558c4[_0x16ff('0x1e')]]));if(this[_0x16ff('0xb')][_0xc558c4['uniqueid']]){if(this[_0x16ff('0x8')][_0xc558c4[_0x16ff('0x1e')]]['faxpages']>0x0&&this[_0x16ff('0x8')][_0xc558c4[_0x16ff('0x1e')]][_0x16ff('0x12')]===_0x16ff('0x4c')){this[_0x16ff('0x47')](_0xc558c4[_0x16ff('0x1e')],!![]);}else{this[_0x16ff('0x47')](_0xc558c4[_0x16ff('0x1e')],![],this['channels'][_0xc558c4[_0x16ff('0x1e')]][_0x16ff('0x4d')]?_0x16ff('0x4e')+this['channels'][_0xc558c4[_0x16ff('0x1e')]][_0x16ff('0x4d')]:_0x16ff('0x4f'));}}}};Fax[_0x16ff('0x19')][_0x16ff('0x50')]=function(_0x3992af){var _0x15fed7=this;return new BPromise(function(_0x535029,_0x12ac3c){_0x15fed7['execOriginate'](_0x3992af,_0x15fed7['faxAccounts'][_0x3992af[_0x16ff('0x51')]])['then'](function(_0x5e6206){ut[_0x16ff('0x44')](_0x16ff('0x52'),_0x5e6206);_0x535029(ut[_0x16ff('0x31')](_0x16ff('0x53')));})[_0x16ff('0x38')](function(_0x36aaf4){ut[_0x16ff('0x44')](_0x16ff('0x54'),_0x36aaf4);updateStatus(_0x3992af);_0x12ac3c(ut[_0x16ff('0x31')](_0x16ff('0x55')));});});};Fax[_0x16ff('0x19')][_0x16ff('0x56')]=function(_0xc12cc9){var _0x23e1ba=this;return new BPromise(function(_0x3d5f03,_0x201045){var _0x39066b=_0x23e1ba[_0x16ff('0x57')](_0x23e1ba[_0x16ff('0x9')][_0xc12cc9[_0x16ff('0x51')]][_0x16ff('0x58')],_0xc12cc9);if(_0x39066b[_0x16ff('0x59')]){_0x3d5f03(ut['message'](_0x16ff('0x5a')));}else{_0x201045(ut['message'](_0x39066b[_0x16ff('0x31')]));}});};function originate(_0x2ab477,_0x15b0af,_0x3528db){return new BPromise(function(_0x35938a,_0x11dca4){if(_0x3528db){var _0x4c52d1=util[_0x16ff('0x5b')](_0x16ff('0x5c'),path[_0x16ff('0x33')](_0x2ab477[_0x16ff('0x1')])[_0x16ff('0x20')],_0x2ab477[_0x16ff('0x1')]);gs['execute'](_0x4c52d1)[_0x16ff('0x34')](function(){_0x2ab477['path']=util[_0x16ff('0x5b')](_0x16ff('0x5d'),path['parse'](_0x2ab477['path'])['dir'],path[_0x16ff('0x33')](_0x2ab477[_0x16ff('0x1')])[_0x16ff('0x20')]);_0x15b0af['XMF-PATH']=_0x2ab477[_0x16ff('0x1')];ut['logger'](_0x16ff('0x5e'),'');ami['Action'](ut[_0x16ff('0x5f')](_0x2ab477,_0x15b0af))['then'](function(_0x32b93c){_0x35938a(_0x32b93c);})[_0x16ff('0x38')](function(_0x5080da){_0x11dca4(_0x5080da);});})[_0x16ff('0x38')](function(_0x46bb10){_0x11dca4(_0x46bb10);});}else{ami['Action'](ut[_0x16ff('0x5f')](_0x2ab477,_0x15b0af))[_0x16ff('0x34')](function(_0x1239e3){_0x35938a(_0x1239e3);})['catch'](function(_0x436b4e){_0x11dca4(_0x436b4e);});}});}Fax['prototype'][_0x16ff('0x60')]=function(_0xbfe410,_0x2f827b){var _0x118eea=this;return new BPromise(function(_0x298796,_0x24f258){var _0x1aef61=uuid['v4']();var _0x5321a7=ut['addVariables'](_0xbfe410,_0x2f827b);_0x118eea[_0x16ff('0xb')][_0x1aef61]=new Action(_0x1aef61,_0x2f827b,_0xbfe410);var _0xc96abc=_0x118eea[_0x16ff('0xb')][_0x1aef61];if(path[_0x16ff('0x33')](_0xbfe410[_0x16ff('0x1')])[_0x16ff('0x61')]===_0x16ff('0x37')){originate(_0xc96abc,_0x5321a7,!![])[_0x16ff('0x34')](function(_0xa58196){_0x298796(_0xa58196);})[_0x16ff('0x38')](function(_0x3b8a13){_0x24f258(_0x3b8a13);});}else{originate(_0xc96abc,_0x5321a7,![])[_0x16ff('0x34')](function(_0x477f5){_0x298796(_0x477f5);})['catch'](function(_0x3975cf){_0x24f258(_0x3975cf);});}});};Fax[_0x16ff('0x19')]['isTrunkReachable']=function(_0x38a40a){return!_['isNil'](_0x38a40a)&&!_[_0x16ff('0x62')](_0x38a40a['name'])&&!_[_0x16ff('0x62')](_0x38a40a[_0x16ff('0x63')])&&_0x38a40a[_0x16ff('0x63')]&&!_[_0x16ff('0x62')](this['trunks'][util['format'](_0x16ff('0x64'),_0x38a40a[_0x16ff('0x20')])])&&!_[_0x16ff('0x62')](this[_0x16ff('0xa')][util[_0x16ff('0x5b')](_0x16ff('0x64'),_0x38a40a[_0x16ff('0x20')])][_0x16ff('0x28')])&&(this[_0x16ff('0xa')][util[_0x16ff('0x5b')](_0x16ff('0x64'),_0x38a40a[_0x16ff('0x20')])][_0x16ff('0x28')]===_0x16ff('0x65')||this[_0x16ff('0xa')][util[_0x16ff('0x5b')]('SIP/%s',_0x38a40a[_0x16ff('0x20')])]['status']===_0x16ff('0x66'));};Fax['prototype'][_0x16ff('0x57')]=function(_0x1e3fdf,_0xee6732){if(!this[_0x16ff('0x67')](_0x1e3fdf)){ut['logger'](_0x16ff('0x68'),_[_0x16ff('0x62')](_0x1e3fdf)?'':_0x1e3fdf['name']+_0x16ff('0x69'));return{'isValid':![],'message':_0x16ff('0x6a')};}if(_[_0x16ff('0x62')](_0xee6732['fax'])){ut[_0x16ff('0x44')](_0x16ff('0x6b'),JSON[_0x16ff('0x3b')](_0xee6732));return{'isValid':![],'message':_0x16ff('0x6c')};}if(_[_0x16ff('0x62')](_0xee6732[_0x16ff('0x1')])){ut[_0x16ff('0x44')](_0x16ff('0x6d'),JSON[_0x16ff('0x3b')](_0xee6732));return{'isValid':![],'message':_0x16ff('0x6e')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x16ff('0x6f')]=Fax; \ No newline at end of file +var _0x06bd=['./util/gs','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','application/pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update','then','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','execute','dir','XMF-PATH','Action','variablesAction','execOriginate','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','bluebird','uuid','path','tiff2pdf'];(function(_0x43552e,_0x5099aa){var _0x8b47a4=function(_0x499267){while(--_0x499267){_0x43552e['push'](_0x43552e['shift']());}};_0x8b47a4(++_0x5099aa);}(_0x06bd,0x6a));var _0xd06b=function(_0x5f13cd,_0x3daaf8){_0x5f13cd=_0x5f13cd-0x0;var _0x827cb7=_0x06bd[_0x5f13cd];return _0x827cb7;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xd06b('0x0'));var uuid=require(_0xd06b('0x1'));var moment=require('moment');var path=require(_0xd06b('0x2'));var tiff2pdf=require(_0xd06b('0x3'));var gs=require(_0xd06b('0x4'));var logger=require(_0xd06b('0x5'))(_0xd06b('0x6'));var ami=require(_0xd06b('0x7'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0xd06b('0x8'));var Action=require(_0xd06b('0x9'));var faxAccount=require(_0xd06b('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xd06b('0xb'));function Fax(_0x24643a){this[_0xd06b('0xc')]={};this[_0xd06b('0xd')]=_0x24643a[_0xd06b('0xd')];this[_0xd06b('0xe')]=_0x24643a[_0xd06b('0xe')];this[_0xd06b('0xf')]={};ami['on'](_0xd06b('0x10'),this[_0xd06b('0x11')][_0xd06b('0x12')](this));ami['on']('varset',this[_0xd06b('0x13')][_0xd06b('0x12')](this));ami['on'](_0xd06b('0x14'),this[_0xd06b('0x15')]['bind'](this));ami['on']('newexten',this[_0xd06b('0x16')][_0xd06b('0x12')](this));ami['on'](_0xd06b('0x17'),this[_0xd06b('0x18')][_0xd06b('0x12')](this));ami['on'](_0xd06b('0x19'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this[_0xd06b('0x1a')][_0xd06b('0x12')](this));ami['on'](_0xd06b('0x1b'),this[_0xd06b('0x1c')]['bind'](this));}Fax[_0xd06b('0x1d')]['syncNewchannel']=function(_0x2c5b89){if(_0x2c5b89[_0xd06b('0x1e')]===_0xd06b('0x1f')){for(var _0x3c5eb1 in this[_0xd06b('0xd')]){if(this[_0xd06b('0xd')][_0xd06b('0x20')](_0x3c5eb1)){if(_0x2c5b89['exten']===this['faxAccounts'][_0x3c5eb1][_0xd06b('0x21')]){this[_0xd06b('0xc')][_0x2c5b89[_0xd06b('0x22')]]={};this['channels'][_0x2c5b89[_0xd06b('0x22')]][_0xd06b('0x23')]=_0x2c5b89[_0xd06b('0x23')];this[_0xd06b('0xc')][_0x2c5b89[_0xd06b('0x22')]]['id']=this[_0xd06b('0xd')][_0x3c5eb1]['id'];this[_0xd06b('0xc')][_0x2c5b89[_0xd06b('0x22')]][_0xd06b('0x24')]=this[_0xd06b('0xd')][_0x3c5eb1][_0xd06b('0x24')];logger[_0xd06b('0x25')](_0x2c5b89['uniqueid'],_0xd06b('0x26'));}}}}if(this[_0xd06b('0xf')][_0x2c5b89[_0xd06b('0x22')]]){this[_0xd06b('0xc')][_0x2c5b89[_0xd06b('0x22')]]={};this['channels'][_0x2c5b89[_0xd06b('0x22')]][_0xd06b('0x23')]=_0x2c5b89['channel'];logger[_0xd06b('0x25')](_0x2c5b89['uniqueid'],_0xd06b('0x26'));}};Fax['prototype']['syncVarSet']=function(_0x36bfc5){if(this['channels'][_0x36bfc5[_0xd06b('0x22')]]){for(var _0x29df24 in _0x36bfc5[_0xd06b('0x27')]){if(_0x36bfc5[_0xd06b('0x27')][_0xd06b('0x20')](_0x29df24)){this[_0xd06b('0xc')][_0x36bfc5['uniqueid']][_0x29df24]=_0x36bfc5[_0xd06b('0x28')];}}}};Fax['prototype'][_0xd06b('0x15')]=function(_0x5e306a){if(this['channels'][_0x5e306a['uniqueid']]){this[_0xd06b('0xc')][_0x5e306a[_0xd06b('0x22')]][_0xd06b('0x29')]=_0x5e306a[_0xd06b('0x29')];this[_0xd06b('0xc')][_0x5e306a[_0xd06b('0x22')]][_0xd06b('0x2a')]=_0x5e306a[_0xd06b('0x2a')];}};Fax['prototype']['syncNewExten']=function(_0x33320a){if(this[_0xd06b('0xc')][_0x33320a[_0xd06b('0x22')]]){for(var _0x5af044 in _0x33320a[_0xd06b('0x27')]){if(_0x33320a[_0xd06b('0x27')][_0xd06b('0x20')](_0x5af044)){this[_0xd06b('0xc')][_0x33320a[_0xd06b('0x22')]][_0x5af044]=_0x33320a[_0xd06b('0x28')];}}}};Fax[_0xd06b('0x1d')]['syncFaxStatus']=function(_0x1880bb){if(this[_0xd06b('0xc')][_0x1880bb['uniqueid']]){this[_0xd06b('0xc')][_0x1880bb['uniqueid']][_0xd06b('0x2b')]=_0x1880bb[_0xd06b('0x2b')];this[_0xd06b('0xc')][_0x1880bb[_0xd06b('0x22')]]['status']=_0x1880bb[_0xd06b('0x2c')];this['channels'][_0x1880bb[_0xd06b('0x22')]][_0xd06b('0x21')]=_0x1880bb[_0xd06b('0x21')];this['channels'][_0x1880bb['uniqueid']][_0xd06b('0x2d')]=_0x1880bb[_0xd06b('0x2d')];logger[_0xd06b('0x25')](_0x1880bb[_0xd06b('0x22')],'\x20syncFaxStatus\x20');}};Fax['prototype']['syncReceiveFax']=function(_0x40f4a8){var _0x220552=this;if(this[_0xd06b('0xc')][_0x40f4a8['uniqueid']]){var _0x48f4d2=this['channels'][_0x40f4a8[_0xd06b('0x22')]]['id'];this[_0xd06b('0xc')][_0x40f4a8[_0xd06b('0x22')]][_0xd06b('0x2e')]=_0x40f4a8[_0xd06b('0x2e')];this[_0xd06b('0xc')][_0x40f4a8[_0xd06b('0x22')]][_0xd06b('0x2f')]=_0x40f4a8[_0xd06b('0x2f')];this[_0xd06b('0xc')][_0x40f4a8[_0xd06b('0x22')]]['localstationid']=_0x40f4a8['localstationid'];this[_0xd06b('0xc')][_0x40f4a8['uniqueid']][_0xd06b('0x30')]=_0x40f4a8['resolution'];this[_0xd06b('0xc')][_0x40f4a8['uniqueid']][_0xd06b('0x31')]=_0x40f4a8['transferrate'];this[_0xd06b('0xc')][_0x40f4a8[_0xd06b('0x22')]]['filename']=_0x40f4a8[_0xd06b('0x2d')];this['channels'][_0x40f4a8[_0xd06b('0x22')]]['calleridnum']=_0x40f4a8[_0xd06b('0x32')];if(this[_0xd06b('0xc')][_0x40f4a8[_0xd06b('0x22')]][_0xd06b('0x2f')]>0x0){tiff2pdf(_0x40f4a8[_0xd06b('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x56614f){logger[_0xd06b('0x25')](_0x40f4a8['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x56614f[_0xd06b('0x33')]);attachment[_0xd06b('0x34')]({'name':path[_0xd06b('0x35')](_0x40f4a8[_0xd06b('0x2d')])[_0xd06b('0x24')],'basename':path[_0xd06b('0x35')](_0x40f4a8[_0xd06b('0x2d')])[_0xd06b('0x24')]+'.pdf','type':_0xd06b('0x36')})['then'](function(_0x2b6054){faxAccount['notify'](_0x48f4d2,{'from':_0x40f4a8['calleridnum'],'mapKey':_0xd06b('0x6'),'body':path[_0xd06b('0x35')](_0x40f4a8['filename'])['name']+'.pdf','AttachmentId':_0x2b6054['id']})[_0xd06b('0x37')](function(_0x21d461){logger[_0xd06b('0x38')](_0x40f4a8[_0xd06b('0x22')],_0xd06b('0x39'),JSON[_0xd06b('0x3a')](_0x21d461));});})['catch'](function(_0x437286){logger['error'](_0x40f4a8[_0xd06b('0x22')],_0xd06b('0x3b'),JSON['stringify'](_0x437286));});});}logger[_0xd06b('0x25')](_0x40f4a8['uniqueid'],_0xd06b('0x3b'));}};Fax['prototype'][_0xd06b('0x1c')]=function(_0x21d1cf){if(this[_0xd06b('0xf')][_0x21d1cf[_0xd06b('0x22')]]){_[_0xd06b('0x3c')](this[_0xd06b('0xc')][_0x21d1cf[_0xd06b('0x22')]],_[_0xd06b('0x3d')](_0x21d1cf,[_0xd06b('0x3e'),'reason']));}};function updateStatus(_0x3c2330){if(_0x3c2330[_0xd06b('0x3f')]){faxMessage['update'](_0x3c2330[_0xd06b('0x3f')],{'failMessage':_0xd06b('0x40')})['then'](function(_0x5726e1){ut[_0xd06b('0x41')](_0xd06b('0x42'),_0x5726e1);})[_0xd06b('0x37')](function(_0x14477d){ut[_0xd06b('0x41')](_0xd06b('0x43'),_0x14477d);});}else{ut[_0xd06b('0x41')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xd06b('0x1d')][_0xd06b('0x44')]=function(_0x5bbb47,_0x13c306,_0x179c36){var _0x5e29b0=this;var _0x5971de={};if(_0x13c306){_0x5971de={'read':_0x13c306};}else{_0x5971de={'failMessage':_0x179c36};}if(this[_0xd06b('0xf')][_0x5bbb47]['AttachmentId']){faxMessage[_0xd06b('0x45')](this[_0xd06b('0xf')][_0x5bbb47][_0xd06b('0x3f')],_0x5971de)[_0xd06b('0x46')](function(_0x379ef4){ut[_0xd06b('0x41')](_0xd06b('0x47'),_0x379ef4);})[_0xd06b('0x37')](function(_0x44f776){ut[_0xd06b('0x41')]('[Fax][Message][NoUpdate1]',_0x44f776);})[_0xd06b('0x48')](function(){delete _0x5e29b0[_0xd06b('0xc')][_0x5bbb47];delete _0x5e29b0['actions'][_0x5bbb47];});}else{ut[_0xd06b('0x41')](_0xd06b('0x49'));delete this['channels'][_0x5bbb47];delete this[_0xd06b('0xf')][_0x5bbb47];}};Fax[_0xd06b('0x1d')][_0xd06b('0x1a')]=function(_0x4d4083){var _0x51eb05=this;if(this['channels'][_0x4d4083['uniqueid']]){if(this['actions'][_0x4d4083[_0xd06b('0x22')]]){this['channels'][_0x4d4083['uniqueid']]['id']=this[_0xd06b('0xf')][_0x4d4083[_0xd06b('0x22')]]['id'];this[_0xd06b('0xc')][_0x4d4083[_0xd06b('0x22')]][_0xd06b('0x24')]=this[_0xd06b('0xf')][_0x4d4083['uniqueid']]['name'];}logger[_0xd06b('0x25')](_0x4d4083['uniqueid'],this['actions'][_0x4d4083[_0xd06b('0x22')]]?_0xd06b('0x4a'):'\x20hangup\x20faxRiceive\x20',JSON[_0xd06b('0x3a')](this[_0xd06b('0xc')][_0x4d4083[_0xd06b('0x22')]]));if(this[_0xd06b('0xf')][_0x4d4083[_0xd06b('0x22')]]){if(this[_0xd06b('0xc')][_0x4d4083[_0xd06b('0x22')]]['faxpages']>0x0&&this[_0xd06b('0xc')][_0x4d4083['uniqueid']][_0xd06b('0x17')]===_0xd06b('0x4b')){this['updateStatus'](_0x4d4083[_0xd06b('0x22')],!![]);}else{this[_0xd06b('0x44')](_0x4d4083[_0xd06b('0x22')],![],this['channels'][_0x4d4083[_0xd06b('0x22')]][_0xd06b('0x4c')]?_0xd06b('0x4d')+this[_0xd06b('0xc')][_0x4d4083['uniqueid']][_0xd06b('0x4c')]:_0xd06b('0x4e'));}}}};Fax[_0xd06b('0x1d')]['send']=function(_0x5e1e13){var _0x415aae=this;return new BPromise(function(_0x225ecd,_0x1d8d0d){_0x415aae['execOriginate'](_0x5e1e13,_0x415aae[_0xd06b('0xd')][_0x5e1e13['FaxAccountId']])['then'](function(_0x54ec56){ut['logger']('[Fax][execOriginate][success]',_0x54ec56);_0x225ecd(ut['message'](_0xd06b('0x4f')));})['catch'](function(_0x19a4e5){ut[_0xd06b('0x41')](_0xd06b('0x50'),_0x19a4e5);updateStatus(_0x5e1e13);_0x1d8d0d(ut[_0xd06b('0x33')](_0xd06b('0x51')));});});};Fax[_0xd06b('0x1d')][_0xd06b('0x52')]=function(_0x1a0223){var _0x51e632=this;return new BPromise(function(_0x568571,_0x49d90d){var _0x536527=_0x51e632[_0xd06b('0x53')](_0x51e632[_0xd06b('0xd')][_0x1a0223[_0xd06b('0x54')]][_0xd06b('0x55')],_0x1a0223);if(_0x536527[_0xd06b('0x56')]){_0x568571(ut['message'](_0xd06b('0x57')));}else{_0x49d90d(ut[_0xd06b('0x33')](_0x536527[_0xd06b('0x33')]));}});};function originate(_0x702e1f,_0x1be1dd,_0x360c1c){return new BPromise(function(_0x2e71af,_0x6569c7){if(_0x360c1c){var _0x1ab1b5=util[_0xd06b('0x58')]('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[_0xd06b('0x35')](_0x702e1f[_0xd06b('0x2')])[_0xd06b('0x24')],_0x702e1f['path']);gs[_0xd06b('0x59')](_0x1ab1b5)[_0xd06b('0x46')](function(){_0x702e1f[_0xd06b('0x2')]=util[_0xd06b('0x58')]('%s/%s.tif',path['parse'](_0x702e1f[_0xd06b('0x2')])[_0xd06b('0x5a')],path['parse'](_0x702e1f[_0xd06b('0x2')])[_0xd06b('0x24')]);_0x1be1dd[_0xd06b('0x5b')]=_0x702e1f[_0xd06b('0x2')];ut[_0xd06b('0x41')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut['variablesAction'](_0x702e1f,_0x1be1dd))['then'](function(_0x5a121c){_0x2e71af(_0x5a121c);})[_0xd06b('0x37')](function(_0x30f297){_0x6569c7(_0x30f297);});})[_0xd06b('0x37')](function(_0x17d2c6){_0x6569c7(_0x17d2c6);});}else{ami[_0xd06b('0x5c')](ut[_0xd06b('0x5d')](_0x702e1f,_0x1be1dd))['then'](function(_0x590c36){_0x2e71af(_0x590c36);})[_0xd06b('0x37')](function(_0x41f59b){_0x6569c7(_0x41f59b);});}});}Fax['prototype'][_0xd06b('0x5e')]=function(_0x58f290,_0x6521fa){var _0x35a67d=this;return new BPromise(function(_0x167b9e,_0x5a9377){var _0x50a784=uuid['v4']();var _0xc07bab=ut[_0xd06b('0x5f')](_0x58f290,_0x6521fa);_0x35a67d[_0xd06b('0xf')][_0x50a784]=new Action(_0x50a784,_0x6521fa,_0x58f290);var _0x1c81b1=_0x35a67d[_0xd06b('0xf')][_0x50a784];if(path[_0xd06b('0x35')](_0x58f290['path'])[_0xd06b('0x60')]===_0xd06b('0x61')){originate(_0x1c81b1,_0xc07bab,!![])[_0xd06b('0x46')](function(_0x3d31eb){_0x167b9e(_0x3d31eb);})[_0xd06b('0x37')](function(_0x1b983d){_0x5a9377(_0x1b983d);});}else{originate(_0x1c81b1,_0xc07bab,![])[_0xd06b('0x46')](function(_0x13029c){_0x167b9e(_0x13029c);})[_0xd06b('0x37')](function(_0x17d4e4){_0x5a9377(_0x17d4e4);});}});};Fax[_0xd06b('0x1d')][_0xd06b('0x62')]=function(_0x170155){return!_['isNil'](_0x170155)&&!_[_0xd06b('0x63')](_0x170155[_0xd06b('0x24')])&&!_['isNil'](_0x170155[_0xd06b('0x64')])&&_0x170155[_0xd06b('0x64')]&&!_[_0xd06b('0x63')](this[_0xd06b('0xe')][util[_0xd06b('0x58')]('SIP/%s',_0x170155[_0xd06b('0x24')])])&&!_[_0xd06b('0x63')](this['trunks'][util[_0xd06b('0x58')](_0xd06b('0x65'),_0x170155[_0xd06b('0x24')])][_0xd06b('0x2c')])&&(this[_0xd06b('0xe')][util[_0xd06b('0x58')]('SIP/%s',_0x170155[_0xd06b('0x24')])][_0xd06b('0x2c')]===_0xd06b('0x66')||this['trunks'][util[_0xd06b('0x58')]('SIP/%s',_0x170155[_0xd06b('0x24')])][_0xd06b('0x2c')]===_0xd06b('0x67'));};Fax[_0xd06b('0x1d')][_0xd06b('0x53')]=function(_0x2df40c,_0x257f81){if(!this[_0xd06b('0x62')](_0x2df40c)){ut[_0xd06b('0x41')](_0xd06b('0x68'),_[_0xd06b('0x63')](_0x2df40c)?'':_0x2df40c[_0xd06b('0x24')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xd06b('0x63')](_0x257f81[_0xd06b('0x6')])){ut[_0xd06b('0x41')](_0xd06b('0x69'),JSON[_0xd06b('0x3a')](_0x257f81));return{'isValid':![],'message':_0xd06b('0x6a')};}if(_[_0xd06b('0x63')](_0x257f81['path'])){ut[_0xd06b('0x41')](_0xd06b('0x6b'),JSON[_0xd06b('0x3a')](_0x257f81));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xd06b('0x6c')};};module[_0xd06b('0x6d')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 1e3eb76..775a3f8 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 _0xdc6d=['error','inspect','notify','resolve','[Notify]\x20','preview','lodash','../rpc/faxAccount'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xdc6d,0x1cd));var _0xddc6=function(_0x1cc774,_0x50379b){_0x1cc774=_0x1cc774-0x0;var _0x57997a=_0xdc6d[_0x1cc774];return _0x57997a;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xddc6('0x0'));var _=require(_0xddc6('0x1'));var faxAccount=require(_0xddc6('0x2'));function loggerCatch(_0x50771f){return function(_0x1dabf2){logger[_0xddc6('0x3')](_0x50771f,util[_0xddc6('0x4')](_0x1dabf2,{'showHidden':![],'depth':null}));};}exports[_0xddc6('0x5')]=function(_0x9221ac,_0x227a64){return BPromise[_0xddc6('0x6')]()['then'](faxAccount[_0xddc6('0x5')](_0x9221ac,_0x227a64))['catch'](loggerCatch(_0xddc6('0x7')));}; \ No newline at end of file +var _0x18ca=['inspect','notify','resolve','then','[Notify]\x20','util','preview','lodash','../rpc/faxAccount'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x18ca,0x152));var _0xa18c=function(_0x5cae87,_0x5984ee){_0x5cae87=_0x5cae87-0x0;var _0x11bd60=_0x18ca[_0x5cae87];return _0x11bd60;};'use strict';var util=require(_0xa18c('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xa18c('0x1'));var _=require(_0xa18c('0x2'));var faxAccount=require(_0xa18c('0x3'));function loggerCatch(_0x350a6d){return function(_0x1b3cd1){logger['error'](_0x350a6d,util[_0xa18c('0x4')](_0x1b3cd1,{'showHidden':![],'depth':null}));};}exports[_0xa18c('0x5')]=function(_0x476c93,_0x354409){return BPromise[_0xa18c('0x6')]()[_0xa18c('0x7')](faxAccount[_0xa18c('0x5')](_0x476c93,_0x354409))['catch'](loggerCatch(_0xa18c('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 3918d38..32e4a50 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 _0x2257=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','util'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x2257,0xbd));var _0x7225=function(_0x2a1d82,_0x39bca0){_0x2a1d82=_0x2a1d82-0x0;var _0x161244=_0x2257[_0x2a1d82];return _0x161244;};'use strict';var util=require(_0x7225('0x0'));var logger=require(_0x7225('0x1'))(_0x7225('0x2'));var BPromise=require(_0x7225('0x3'));var exec=require(_0x7225('0x4'))[_0x7225('0x5')];exports[_0x7225('0x6')]=function(_0x1d4220){return new BPromise(function(_0x4b7500,_0x37c7b9){exec(_0x1d4220,function(_0x44db81,_0x532663,_0xe989c2){logger[_0x7225('0x7')](_0x7225('0x8'),_0x532663);if(_0x44db81){logger[_0x7225('0x7')](_0x7225('0x8'),_0x7225('0x9'),util['inspect'](_0x44db81,{'showHidden':![],'depth':null}),_0x532663,_0xe989c2);_0x37c7b9(_0x44db81);}_0x4b7500(_0x532663);});});}; \ No newline at end of file +var _0xb3e8=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x1ae104,_0x4aab68){var _0x5f5639=function(_0x36aa8c){while(--_0x36aa8c){_0x1ae104['push'](_0x1ae104['shift']());}};_0x5f5639(++_0x4aab68);}(_0xb3e8,0x6a));var _0x8b3e=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0xb3e8[_0xcd49bd];return _0xb6ee44;};'use strict';var util=require(_0x8b3e('0x0'));var logger=require(_0x8b3e('0x1'))(_0x8b3e('0x2'));var BPromise=require(_0x8b3e('0x3'));var exec=require(_0x8b3e('0x4'))[_0x8b3e('0x5')];exports[_0x8b3e('0x6')]=function(_0x3e4f7a){return new BPromise(function(_0x1f5f5e,_0x3f9d17){exec(_0x3e4f7a,function(_0x38c78e,_0x470675,_0x336910){logger[_0x8b3e('0x7')](_0x8b3e('0x8'),_0x470675);if(_0x38c78e){logger[_0x8b3e('0x7')](_0x8b3e('0x8'),_0x8b3e('0x9'),util[_0x8b3e('0xa')](_0x38c78e,{'showHidden':![],'depth':null}),_0x470675,_0x336910);_0x3f9d17(_0x38c78e);}_0x1f5f5e(_0x470675);});});}; \ 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 393413e..d0f545a 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 _0x1b6d=['t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway'];(function(_0x36e7ef,_0x2b60f0){var _0x2d31ea=function(_0x2583e9){while(--_0x2583e9){_0x36e7ef['push'](_0x36e7ef['shift']());}};_0x2d31ea(++_0x2b60f0);}(_0x1b6d,0x1eb));var _0xd1b6=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1b6d[_0x27af45];return _0x18df21;};'use strict';var util=require(_0xd1b6('0x0'));var _=require(_0xd1b6('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('fax');exports['message']=function(_0x28fb52){return{'message':_0x28fb52};};exports[_0xd1b6('0x2')]=function(_0x566fd4,_0x5133cf){logger[_0xd1b6('0x3')](_0x566fd4,util[_0xd1b6('0x4')](_0x5133cf,{'showHidden':![],'depth':null}));};exports[_0xd1b6('0x5')]=function(_0x1d738c,_0x54750e){var _0x52e4cc={'XMF-ECM':_0x54750e[_0xd1b6('0x6')],'XMF-HEADERINFO':_0x54750e[_0xd1b6('0x7')],'XMF-MINRATE':_0x54750e[_0xd1b6('0x8')],'XMF-MAXRATE':_0x54750e[_0xd1b6('0x9')],'XMF-MODEM':util[_0xd1b6('0xa')]('\x22%s\x22',_0x54750e[_0xd1b6('0xb')]),'XMF-GATEWAY':_0x54750e[_0xd1b6('0xc')],'XMF-FAXDETECT':_0x54750e['faxdetect'],'XMF-T38TIMEOUT':_0x54750e[_0xd1b6('0xd')],'XMF-LOCALSTATIONID':_0x54750e[_0xd1b6('0xe')],'XMF-PATH':_0x1d738c[_0xd1b6('0xf')]};return _0x52e4cc;};exports[_0xd1b6('0x10')]=function(_0x25eb8f,_0x42bde0){return{'actionid':_0x25eb8f[_0xd1b6('0x11')],'action':'originate','channel':_0x25eb8f[_0xd1b6('0x12')],'Exten':_0xd1b6('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0xd1b6('0xa')](_0xd1b6('0x14'),_0x25eb8f[_0xd1b6('0x7')]?_0x25eb8f[_0xd1b6('0x7')]:'',_0x25eb8f[_0xd1b6('0xe')]),'variable':_0x42bde0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x25eb8f[_0xd1b6('0x11')]};}; \ No newline at end of file +var _0xfc79=['format','gateway','faxdetect','t38timeout','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','moment','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate'];(function(_0xd0a290,_0x55cb33){var _0x377b3d=function(_0x56d2e0){while(--_0x56d2e0){_0xd0a290['push'](_0xd0a290['shift']());}};_0x377b3d(++_0x55cb33);}(_0xfc79,0x1c3));var _0x9fc7=function(_0x3ad5a6,_0x485c90){_0x3ad5a6=_0x3ad5a6-0x0;var _0x3ddbb3=_0xfc79[_0x3ad5a6];return _0x3ddbb3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9fc7('0x0'));var logger=require('../../../../config/logger')('fax');exports[_0x9fc7('0x1')]=function(_0x3ca9e0){return{'message':_0x3ca9e0};};exports[_0x9fc7('0x2')]=function(_0x3b18a5,_0x593427){logger[_0x9fc7('0x3')](_0x3b18a5,util[_0x9fc7('0x4')](_0x593427,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x32c028,_0x517ce1){var _0x2b6bdf={'XMF-ECM':_0x517ce1[_0x9fc7('0x5')],'XMF-HEADERINFO':_0x517ce1[_0x9fc7('0x6')],'XMF-MINRATE':_0x517ce1[_0x9fc7('0x7')],'XMF-MAXRATE':_0x517ce1[_0x9fc7('0x8')],'XMF-MODEM':util[_0x9fc7('0x9')]('\x22%s\x22',_0x517ce1['modem']),'XMF-GATEWAY':_0x517ce1[_0x9fc7('0xa')],'XMF-FAXDETECT':_0x517ce1[_0x9fc7('0xb')],'XMF-T38TIMEOUT':_0x517ce1[_0x9fc7('0xc')],'XMF-LOCALSTATIONID':_0x517ce1['localstationid'],'XMF-PATH':_0x32c028['path']};return _0x2b6bdf;};exports[_0x9fc7('0xd')]=function(_0xb99cac,_0x22fa21){return{'actionid':_0xb99cac[_0x9fc7('0xe')],'action':'originate','channel':_0xb99cac[_0x9fc7('0xf')],'Exten':_0x9fc7('0x10'),'Context':_0x9fc7('0x11'),'Priority':'1','callerid':util['format'](_0x9fc7('0x12'),_0xb99cac['headerinfo']?_0xb99cac['headerinfo']:'',_0xb99cac[_0x9fc7('0x13')]),'variable':_0x22fa21,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xb99cac[_0x9fc7('0xe')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6728239..4ebf954 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 _0xf55a=['getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0xf55a,0xd7));var _0xaf55=function(_0x37e687,_0x42b78c){_0x37e687=_0x37e687-0x0;var _0x2a0256=_0xf55a[_0x37e687];return _0x2a0256;};'use strict';var util=require(_0xaf55('0x0'));var moment=require(_0xaf55('0x1'));var server=require(_0xaf55('0x2'));var Realtime=require(_0xaf55('0x3'));var Report=require(_0xaf55('0x4'));var Acw=require(_0xaf55('0x5'));var Trigger=require(_0xaf55('0x6'));var Dialer=require(_0xaf55('0x7'));var Preview=require('./preview');var Fax=require(_0xaf55('0x8'));var user=require(_0xaf55('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xaf55('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xaf55('0xb'));var trigger=require(_0xaf55('0xc'));var template=require(_0xaf55('0xd'));var cmHopperHistory=require(_0xaf55('0xe'));var campaign=require(_0xaf55('0xf'));var voiceExtension=require(_0xaf55('0x10'));var faxAccount=require(_0xaf55('0x11'));var zendesk=require(_0xaf55('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xaf55('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xaf55('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xaf55('0x15'));var freshsales=require(_0xaf55('0x16'));var servicenow=require(_0xaf55('0x17'));var dynamics365=require(_0xaf55('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xaf55('0x19'))(_0xaf55('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xaf55('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xaf55('0x1c')](_0xaf55('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xaf55('0x1d')]()['then'](user[_0xaf55('0x1e')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x20')]())['then'](user[_0xaf55('0x21')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x22')]())['then'](trunk[_0xaf55('0x23')]())[_0xaf55('0x1f')](realtime['initTrunks']())[_0xaf55('0x1f')](voiceQueue[_0xaf55('0x24')]())[_0xaf55('0x1f')](realtime['initVoiceQueues']())['then'](trigger['getTriggers']())[_0xaf55('0x1f')](realtime[_0xaf55('0x25')]())['then'](template[_0xaf55('0x26')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x27')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0xaf55('0x28')]())[_0xaf55('0x1f')](salesforce[_0xaf55('0x29')]())['then'](realtime[_0xaf55('0x2a')]())[_0xaf55('0x1f')](sugarcrm['getSugarcrmAccounts']())[_0xaf55('0x1f')](realtime[_0xaf55('0x2b')]())[_0xaf55('0x1f')](freshdesk[_0xaf55('0x2c')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x2d')]())[_0xaf55('0x1f')](desk[_0xaf55('0x2e')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x2f')]())[_0xaf55('0x1f')](zoho['getZohoAccounts']())['then'](realtime[_0xaf55('0x30')]())[_0xaf55('0x1f')](vtiger[_0xaf55('0x31')]())[_0xaf55('0x1f')](realtime['initVtigerAccounts']())['then'](freshsales['getFreshsalesAccounts']())[_0xaf55('0x1f')](realtime[_0xaf55('0x32')]())[_0xaf55('0x1f')](servicenow[_0xaf55('0x33')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x34')]())[_0xaf55('0x1f')](dynamics365['getDynamics365Accounts']())['then'](realtime['initDynamics365Accounts']())[_0xaf55('0x1f')](campaign[_0xaf55('0x35')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x36')]())[_0xaf55('0x1f')](voiceExtension['getVoiceExtensions']())[_0xaf55('0x1f')](realtime[_0xaf55('0x37')]())[_0xaf55('0x1f')](faxAccount['getFaxAccounts']())[_0xaf55('0x1f')](realtime[_0xaf55('0x38')]())[_0xaf55('0x1f')](function(){return realtime;});}function initParams(){return Promise[_0xaf55('0x1d')]()[_0xaf55('0x1f')](voiceQueueReport[_0xaf55('0x39')]())[_0xaf55('0x1f')](realtime[_0xaf55('0x3a')]())[_0xaf55('0x1f')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xaf55('0x3b')]())[_0xaf55('0x1f')](cmHopperHistory[_0xaf55('0x3c')]())[_0xaf55('0x1f')](realtime['initCampaignHopperHistory']())[_0xaf55('0x1f')](voiceCallReport[_0xaf55('0x3d')]())['then'](realtime['initVoiceCallReports']())[_0xaf55('0x3e')](function(_0x19ac18){logger[_0xaf55('0x3f')](_0xaf55('0x40'),util[_0xaf55('0x41')](_0x19ac18,{'showHidden':![],'depth':null}));});}function main(){return server[_0xaf55('0x42')](realtime,preview,fax)['then'](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xaf55('0x43')]();setInterval(initRealtime,0x1388);})[_0xaf55('0x3e')](function(_0x3ea1ee){logger[_0xaf55('0x3f')]('[index.js][main]',util[_0xaf55('0x41')](_0x3ea1ee,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x2a6a=['initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','sync','catch','[index.js][main]','inspect','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts'];(function(_0xa89b69,_0xcafead){var _0x349ddb=function(_0x333961){while(--_0x333961){_0xa89b69['push'](_0xa89b69['shift']());}};_0x349ddb(++_0xcafead);}(_0x2a6a,0x144));var _0xa2a6=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x2a6a[_0x16d10f];return _0x50c823;};'use strict';var util=require(_0xa2a6('0x0'));var moment=require(_0xa2a6('0x1'));var server=require(_0xa2a6('0x2'));var Realtime=require(_0xa2a6('0x3'));var Report=require(_0xa2a6('0x4'));var Acw=require(_0xa2a6('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xa2a6('0x6'));var Preview=require(_0xa2a6('0x7'));var Fax=require(_0xa2a6('0x8'));var user=require(_0xa2a6('0x9'));var voiceQueue=require(_0xa2a6('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xa2a6('0xb'));var trunk=require(_0xa2a6('0xc'));var trigger=require(_0xa2a6('0xd'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xa2a6('0xe'));var voiceExtension=require(_0xa2a6('0xf'));var faxAccount=require(_0xa2a6('0x10'));var zendesk=require(_0xa2a6('0x11'));var salesforce=require(_0xa2a6('0x12'));var sugarcrm=require(_0xa2a6('0x13'));var freshdesk=require(_0xa2a6('0x14'));var desk=require(_0xa2a6('0x15'));var zoho=require(_0xa2a6('0x16'));var vtiger=require(_0xa2a6('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xa2a6('0x18'));var dynamics365=require(_0xa2a6('0x19'));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')(_0xa2a6('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa2a6('0x1b')](_0xa2a6('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa2a6('0x1b')](_0xa2a6('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xa2a6('0x1d')]()[_0xa2a6('0x1e')](user[_0xa2a6('0x1f')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x20')]())[_0xa2a6('0x1e')](user[_0xa2a6('0x21')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x22')]())[_0xa2a6('0x1e')](trunk[_0xa2a6('0x23')]())[_0xa2a6('0x1e')](realtime['initTrunks']())[_0xa2a6('0x1e')](voiceQueue[_0xa2a6('0x24')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x25')]())['then'](trigger[_0xa2a6('0x26')]())['then'](realtime[_0xa2a6('0x27')]())['then'](template['getTemplates']())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x28')]())[_0xa2a6('0x1e')](zendesk[_0xa2a6('0x29')]())['then'](realtime[_0xa2a6('0x2a')]())[_0xa2a6('0x1e')](salesforce[_0xa2a6('0x2b')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x2c')]())[_0xa2a6('0x1e')](sugarcrm[_0xa2a6('0x2d')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x2e')]())[_0xa2a6('0x1e')](freshdesk[_0xa2a6('0x2f')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x30')]())[_0xa2a6('0x1e')](desk[_0xa2a6('0x31')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x32')]())[_0xa2a6('0x1e')](zoho['getZohoAccounts']())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x33')]())[_0xa2a6('0x1e')](vtiger['getVtigerAccounts']())['then'](realtime[_0xa2a6('0x34')]())[_0xa2a6('0x1e')](freshsales[_0xa2a6('0x35')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x36')]())['then'](servicenow[_0xa2a6('0x37')]())['then'](realtime[_0xa2a6('0x38')]())[_0xa2a6('0x1e')](dynamics365[_0xa2a6('0x39')]())['then'](realtime['initDynamics365Accounts']())['then'](campaign[_0xa2a6('0x3a')]())[_0xa2a6('0x1e')](realtime['initCampaigns']())[_0xa2a6('0x1e')](voiceExtension['getVoiceExtensions']())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x3b')]())[_0xa2a6('0x1e')](faxAccount[_0xa2a6('0x3c')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x3d')]())[_0xa2a6('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0xa2a6('0x1d')]()[_0xa2a6('0x1e')](voiceQueueReport[_0xa2a6('0x3e')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x3f')]())[_0xa2a6('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x40')]())[_0xa2a6('0x1e')](cmHopperHistory[_0xa2a6('0x41')]())['then'](realtime[_0xa2a6('0x42')]())[_0xa2a6('0x1e')](voiceCallReport[_0xa2a6('0x43')]())[_0xa2a6('0x1e')](realtime[_0xa2a6('0x44')]())['catch'](function(_0x20cf38){logger[_0xa2a6('0x45')](_0xa2a6('0x46'),util['inspect'](_0x20cf38,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xa2a6('0x1e')](function(){return initRealtime();})[_0xa2a6('0x1e')](function(){return initParams();})[_0xa2a6('0x1e')](function(){report[_0xa2a6('0x47')]();setInterval(initRealtime,0x1388);})[_0xa2a6('0x48')](function(_0x35d9f8){logger[_0xa2a6('0x45')](_0xa2a6('0x49'),util[_0xa2a6('0x4a')](_0x35d9f8,{'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 b88b7b1..8f7e27d 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 _0x4718=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking','voiceStatus','statePause','toNumber','format','emit','user:ami:update','omit','user:presence','lodash','util','moment'];(function(_0x9289ef,_0x3781ba){var _0x55f620=function(_0x4db3c2){while(--_0x4db3c2){_0x9289ef['push'](_0x9289ef['shift']());}};_0x55f620(++_0x3781ba);}(_0x4718,0x18d));var _0x8471=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x4718[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0x8471('0x0'));var util=require(_0x8471('0x1'));var moment=require(_0x8471('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x8471('0x3'));config[_0x8471('0x4')]=_[_0x8471('0x5')](config[_0x8471('0x4')],{'host':_0x8471('0x6'),'port':0x18eb});var io=require(_0x8471('0x7'))(new Redis(config[_0x8471('0x4')]));function Agent(_0x155fc9){this['id']=_0x155fc9['id']||0x0;this[_0x8471('0x8')]=_0x155fc9['name']||'';this[_0x8471('0x9')]=_0x155fc9[_0x8471('0x9')]||'';this[_0x8471('0xa')]=_0x155fc9[_0x8471('0xa')]||'';this[_0x8471('0xb')]=_0x155fc9[_0x8471('0xb')]||'';this[_0x8471('0xc')]=_0x8471('0xd');this[_0x8471('0xe')]=0x0;this[_0x8471('0xf')]=_0x8471('0xd');this[_0x8471('0x10')]='';this['phone']='';this[_0x8471('0x11')]='';this[_0x8471('0x12')]='';this[_0x8471('0x13')]=_0x155fc9[_0x8471('0x13')]||![];this['voiceStatus']='unknown';this[_0x8471('0x14')]=0x0;this[_0x8471('0x15')]='';this[_0x8471('0x16')]='';this[_0x8471('0x17')]=![];this[_0x8471('0x18')]=![];this[_0x8471('0x19')]='';}Agent[_0x8471('0x1a')][_0x8471('0x1b')]=function(_0x5aafa2){var _0x140155;if(_0x5aafa2&&_0x5aafa2[_0x8471('0xc')]){_0x140155=_0x5aafa2[_0x8471('0xc')][_0x8471('0x1c')]();switch(_0x140155){case'not_inuse':_0x140155=_0x8471('0x1d');break;case _0x8471('0x1e'):_0x140155=_0x8471('0x1f');break;}}if(_0x140155&&this[_0x8471('0x20')]!==_0x140155||_0x5aafa2[_0x8471('0x21')]){this[_0x8471('0x14')]=_[_0x8471('0x22')](moment()[_0x8471('0x23')]('x'));}if(_0x140155){this[_0x8471('0x20')]=_0x140155;}var _0x2b2391={'id':this['id'],'name':this['name'],'email':this[_0x8471('0x9')],'accountcode':this['accountcode'],'fullname':this[_0x8471('0xb')],'state':this[_0x8471('0xc')],'stateTime':this[_0x8471('0xe')],'status':this[_0x8471('0xf')],'address':this['address'],'online':this[_0x8471('0x13')],'voiceStatus':this[_0x8471('0x20')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x8471('0x16')],'interface':this[_0x8471('0x12')],'onhold':this[_0x8471('0x17')]};var _0x32d6f3=md5(JSON['stringify'](_0x2b2391));if(this[_0x8471('0x19')]!==_0x32d6f3){this[_0x8471('0x19')]=_0x32d6f3;io['to'](util[_0x8471('0x23')]('user:%s',_0x2b2391[_0x8471('0x8')]))[_0x8471('0x24')](_0x8471('0x25'),_[_0x8471('0x26')](_0x2b2391,[_0x8471('0x13')]));io[_0x8471('0x24')](_0x8471('0x27'),_0x2b2391);}};module['exports']=Agent; \ No newline at end of file +var _0x4fb8=['md5','emit','user:ami:update','omit','user:presence','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','unknown','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','toNumber','format','fullname','stateTime','status','stringify'];(function(_0x38b590,_0x2be5c0){var _0x1d3664=function(_0x440375){while(--_0x440375){_0x38b590['push'](_0x38b590['shift']());}};_0x1d3664(++_0x2be5c0);}(_0x4fb8,0x10e));var _0x84fb=function(_0x334d92,_0x11c599){_0x334d92=_0x334d92-0x0;var _0x51e5f1=_0x4fb8[_0x334d92];return _0x51e5f1;};'use strict';var _=require(_0x84fb('0x0'));var util=require('util');var moment=require(_0x84fb('0x1'));var md5=require('md5');var Redis=require(_0x84fb('0x2'));var config=require(_0x84fb('0x3'));config[_0x84fb('0x4')]=_[_0x84fb('0x5')](config['redis'],{'host':_0x84fb('0x6'),'port':0x18eb});var io=require(_0x84fb('0x7'))(new Redis(config['redis']));function Agent(_0x57d098){this['id']=_0x57d098['id']||0x0;this[_0x84fb('0x8')]=_0x57d098[_0x84fb('0x8')]||'';this[_0x84fb('0x9')]=_0x57d098['email']||'';this[_0x84fb('0xa')]=_0x57d098[_0x84fb('0xa')]||'';this['fullname']=_0x57d098['fullname']||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x84fb('0xb');this[_0x84fb('0xc')]='';this[_0x84fb('0xd')]='';this[_0x84fb('0xe')]='';this[_0x84fb('0xf')]='';this[_0x84fb('0x10')]=_0x57d098[_0x84fb('0x10')]||![];this['voiceStatus']='unknown';this[_0x84fb('0x11')]=0x0;this[_0x84fb('0x12')]='';this[_0x84fb('0x13')]='';this[_0x84fb('0x14')]=![];this[_0x84fb('0x15')]=![];this['md5']='';}Agent[_0x84fb('0x16')][_0x84fb('0x17')]=function(_0x42c541){var _0x878399;if(_0x42c541&&_0x42c541[_0x84fb('0x18')]){_0x878399=_0x42c541['state'][_0x84fb('0x19')]();switch(_0x878399){case _0x84fb('0x1a'):_0x878399=_0x84fb('0x1b');break;case _0x84fb('0x1c'):_0x878399=_0x84fb('0x1d');break;}}if(_0x878399&&this[_0x84fb('0x1e')]!==_0x878399||_0x42c541[_0x84fb('0x1f')]){this[_0x84fb('0x11')]=_[_0x84fb('0x20')](moment()[_0x84fb('0x21')]('x'));}if(_0x878399){this[_0x84fb('0x1e')]=_0x878399;}var _0x3e790d={'id':this['id'],'name':this['name'],'email':this[_0x84fb('0x9')],'accountcode':this[_0x84fb('0xa')],'fullname':this[_0x84fb('0x22')],'state':this['state'],'stateTime':this[_0x84fb('0x23')],'status':this[_0x84fb('0x24')],'address':this[_0x84fb('0xc')],'online':this[_0x84fb('0x10')],'voiceStatus':this[_0x84fb('0x1e')],'voiceStatusTime':this[_0x84fb('0x11')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x84fb('0x13')],'interface':this['interface'],'onhold':this[_0x84fb('0x14')]};var _0x55697e=md5(JSON[_0x84fb('0x25')](_0x3e790d));if(this[_0x84fb('0x26')]!==_0x55697e){this[_0x84fb('0x26')]=_0x55697e;io['to'](util[_0x84fb('0x21')]('user:%s',_0x3e790d['name']))[_0x84fb('0x27')](_0x84fb('0x28'),_[_0x84fb('0x29')](_0x3e790d,['online']));io['emit'](_0x84fb('0x2a'),_0x3e790d);}};module[_0x84fb('0x2b')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 578bbf2..1d5f00e 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 _0x7b33=['ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp'];(function(_0xe4f48c,_0x8c2b60){var _0x59456f=function(_0x4d5729){while(--_0x4d5729){_0xe4f48c['push'](_0xe4f48c['shift']());}};_0x59456f(++_0x8c2b60);}(_0x7b33,0x116));var _0x37b3=function(_0x98ad6,_0x4b9cbc){_0x98ad6=_0x98ad6-0x0;var _0x12a627=_0x7b33[_0x98ad6];return _0x12a627;};'use strict';function Campaign(_0x1407ba){this['id']=_0x1407ba['id']||0x0;this['name']=_0x1407ba[_0x37b3('0x0')]||'';this[_0x37b3('0x1')]=_0x1407ba[_0x37b3('0x1')]||'campaign';this[_0x37b3('0x2')]=0x0;this[_0x37b3('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x37b3('0x4')]=0x0;this[_0x37b3('0x5')]='';this[_0x37b3('0x6')]=!![];this['active']=_0x1407ba['active'];this['limitCalls']=_0x1407ba[_0x37b3('0x7')];this[_0x37b3('0x8')]=_0x1407ba[_0x37b3('0x8')]||null;this[_0x37b3('0x9')]=_0x1407ba['dialGlobalInterval']?_0x1407ba[_0x37b3('0x9')]:null;this[_0x37b3('0xa')]=_0x1407ba[_0x37b3('0xa')];this[_0x37b3('0xb')]=_0x1407ba[_0x37b3('0xb')];this['dialOriginateTimeout']=_0x1407ba['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x1407ba[_0x37b3('0xc')];this[_0x37b3('0xd')]=_0x1407ba[_0x37b3('0xd')];this[_0x37b3('0xe')]=_0x1407ba[_0x37b3('0xe')];this[_0x37b3('0xf')]=_0x1407ba[_0x37b3('0xf')];this[_0x37b3('0x10')]=_0x1407ba[_0x37b3('0x10')];this[_0x37b3('0x11')]=_0x1407ba['dialNoAnswerRetryFrequency'];this[_0x37b3('0x12')]=_0x1407ba[_0x37b3('0x12')];this[_0x37b3('0x13')]=_0x1407ba[_0x37b3('0x13')]||0x3;this[_0x37b3('0x14')]=_0x1407ba[_0x37b3('0x14')]||0x96;this[_0x37b3('0x15')]=_0x1407ba[_0x37b3('0x15')]||0x3;this[_0x37b3('0x16')]=_0x1407ba[_0x37b3('0x16')]||0x96;this[_0x37b3('0x17')]=_0x1407ba[_0x37b3('0x17')]||0x3;this[_0x37b3('0x18')]=_0x1407ba[_0x37b3('0x18')]||0x96;this[_0x37b3('0x19')]=_0x1407ba[_0x37b3('0x19')]||0x3;this[_0x37b3('0x1a')]=_0x1407ba[_0x37b3('0x1a')]||0x96;this[_0x37b3('0x1b')]=_0x1407ba[_0x37b3('0x1b')]||0x3;this[_0x37b3('0x1c')]=_0x1407ba[_0x37b3('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x1407ba[_0x37b3('0x1d')]||_0x37b3('0x1e');this[_0x37b3('0x1f')]=_0x1407ba[_0x37b3('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1407ba['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1407ba[_0x37b3('0x20')]||undefined;this[_0x37b3('0x21')]=_0x1407ba[_0x37b3('0x21')]?_0x1407ba[_0x37b3('0x21')]:undefined;this[_0x37b3('0x22')]=_0x1407ba[_0x37b3('0x22')]?_0x1407ba[_0x37b3('0x22')]:undefined;this[_0x37b3('0x23')]=_0x1407ba['Interval']?_0x1407ba[_0x37b3('0x23')]:undefined;this[_0x37b3('0x24')]=_0x1407ba[_0x37b3('0x24')]?_0x1407ba[_0x37b3('0x24')]:undefined;this['dialQueueProject']=_0x1407ba[_0x37b3('0x24')]?_0x1407ba[_0x37b3('0x24')]['name']:undefined;this[_0x37b3('0x25')]=_0x1407ba['dialAMDActive']||![];this[_0x37b3('0x26')]=_0x1407ba[_0x37b3('0x26')];this[_0x37b3('0x27')]=_0x1407ba[_0x37b3('0x27')];this[_0x37b3('0x28')]=_0x1407ba[_0x37b3('0x28')];this[_0x37b3('0x29')]=_0x1407ba[_0x37b3('0x29')];this[_0x37b3('0x2a')]=_0x1407ba[_0x37b3('0x2a')];this[_0x37b3('0x2b')]=_0x1407ba[_0x37b3('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x1407ba['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1407ba[_0x37b3('0x2c')];this[_0x37b3('0x2d')]=_0x1407ba[_0x37b3('0x2d')];}module[_0x37b3('0x2e')]=Campaign; \ No newline at end of file +var _0x86b1=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','campaign','originated','temp','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x86b1,0x1db));var _0x186b=function(_0x4d7c9b,_0x3bb7b1){_0x4d7c9b=_0x4d7c9b-0x0;var _0x2933d9=_0x86b1[_0x4d7c9b];return _0x2933d9;};'use strict';function Campaign(_0x3f9205){this['id']=_0x3f9205['id']||0x0;this[_0x186b('0x0')]=_0x3f9205[_0x186b('0x0')]||'';this['type']=_0x3f9205['type']||_0x186b('0x1');this[_0x186b('0x2')]=0x0;this[_0x186b('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x186b('0x4')]='';this[_0x186b('0x5')]=!![];this[_0x186b('0x6')]=_0x3f9205[_0x186b('0x6')];this[_0x186b('0x7')]=_0x3f9205['limitCalls'];this[_0x186b('0x8')]=_0x3f9205[_0x186b('0x8')]||null;this[_0x186b('0x9')]=_0x3f9205[_0x186b('0x9')]?_0x3f9205[_0x186b('0x9')]:null;this[_0x186b('0xa')]=_0x3f9205['dialOriginateCallerIdName'];this[_0x186b('0xb')]=_0x3f9205[_0x186b('0xb')];this[_0x186b('0xc')]=_0x3f9205[_0x186b('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x3f9205[_0x186b('0xd')];this[_0x186b('0xe')]=_0x3f9205['dialCongestionRetryFrequency'];this[_0x186b('0xf')]=_0x3f9205[_0x186b('0xf')];this[_0x186b('0x10')]=_0x3f9205[_0x186b('0x10')];this[_0x186b('0x11')]=_0x3f9205[_0x186b('0x11')];this[_0x186b('0x12')]=_0x3f9205['dialNoAnswerRetryFrequency'];this[_0x186b('0x13')]=_0x3f9205[_0x186b('0x13')];this[_0x186b('0x14')]=_0x3f9205[_0x186b('0x14')]||0x3;this[_0x186b('0x15')]=_0x3f9205[_0x186b('0x15')]||0x96;this[_0x186b('0x16')]=_0x3f9205[_0x186b('0x16')]||0x3;this[_0x186b('0x17')]=_0x3f9205[_0x186b('0x17')]||0x96;this[_0x186b('0x18')]=_0x3f9205['dialAbandonedMaxRetry']||0x3;this[_0x186b('0x19')]=_0x3f9205[_0x186b('0x19')]||0x96;this[_0x186b('0x1a')]=_0x3f9205[_0x186b('0x1a')]||0x3;this[_0x186b('0x1b')]=_0x3f9205[_0x186b('0x1b')]||0x96;this[_0x186b('0x1c')]=_0x3f9205[_0x186b('0x1c')]||0x3;this[_0x186b('0x1d')]=_0x3f9205['dialAgentRejectRetryFrequency']||0x96;this[_0x186b('0x1e')]=_0x3f9205[_0x186b('0x1e')]||_0x186b('0x1f');this[_0x186b('0x20')]=_0x3f9205[_0x186b('0x20')]||undefined;this[_0x186b('0x21')]=_0x3f9205[_0x186b('0x21')]||undefined;this[_0x186b('0x22')]=_0x3f9205[_0x186b('0x22')]||undefined;this[_0x186b('0x23')]=_0x3f9205[_0x186b('0x23')]?_0x3f9205[_0x186b('0x23')]:undefined;this[_0x186b('0x24')]=_0x3f9205[_0x186b('0x24')]?_0x3f9205['Trunk']:undefined;this[_0x186b('0x25')]=_0x3f9205[_0x186b('0x25')]?_0x3f9205['Interval']:undefined;this[_0x186b('0x26')]=_0x3f9205[_0x186b('0x26')]?_0x3f9205['SquareProject']:undefined;this['dialQueueProject']=_0x3f9205[_0x186b('0x26')]?_0x3f9205[_0x186b('0x26')][_0x186b('0x0')]:undefined;this['dialAMDActive']=_0x3f9205['dialAMDActive']||![];this[_0x186b('0x27')]=_0x3f9205[_0x186b('0x27')];this[_0x186b('0x28')]=_0x3f9205['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3f9205[_0x186b('0x29')];this[_0x186b('0x2a')]=_0x3f9205[_0x186b('0x2a')];this[_0x186b('0x2b')]=_0x3f9205[_0x186b('0x2b')];this[_0x186b('0x2c')]=_0x3f9205[_0x186b('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x3f9205['dialAMDMaximumNumberOfWords'];this[_0x186b('0x2d')]=_0x3f9205[_0x186b('0x2d')];this[_0x186b('0x2e')]=_0x3f9205[_0x186b('0x2e')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 6a2e295..54d6954 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 _0x431b=['calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','endtime','lastapplication','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x208e93,_0x486a87){var _0x4077e8=function(_0x478161){while(--_0x478161){_0x208e93['push'](_0x208e93['shift']());}};_0x4077e8(++_0x486a87);}(_0x431b,0x18d));var _0xb431=function(_0x4b38a,_0x45fdf7){_0x4b38a=_0x4b38a-0x0;var _0xf0592b=_0x431b[_0x4b38a];return _0xf0592b;};'use strict';function Channel(){this[_0xb431('0x0')]=null;this[_0xb431('0x1')]='';this[_0xb431('0x2')]='';this['calleridnum']=0x0;this[_0xb431('0x3')]='';this[_0xb431('0x4')]=undefined;this[_0xb431('0x5')]=undefined;this[_0xb431('0x6')]=0x0;this[_0xb431('0x7')]='';this[_0xb431('0x8')]=0x0;this[_0xb431('0x9')]=0x0;this['exten']=0x0;this[_0xb431('0xa')]=![];this['answertime']=null;this[_0xb431('0xb')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0xb431('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0xb431('0xd')]=0x0;this[_0xb431('0xe')]=0x0;this[_0xb431('0xf')]=null;this[_0xb431('0x10')]=null;this[_0xb431('0x11')]=null;this[_0xb431('0x12')]=![];this[_0xb431('0x13')]=null;this['queue']=null;this[_0xb431('0x14')]=[];this[_0xb431('0x15')]=undefined;this[_0xb431('0x16')]=undefined;this['transferType']=undefined;this[_0xb431('0x17')]=0x0;}module[_0xb431('0x18')]=Channel; \ No newline at end of file +var _0x0f42=['tag','disposition','monitor','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','uniqueid','linkedid','exten','answertime','endtime','abandoned','billableseconds','type'];(function(_0x4c6dd5,_0x3e2003){var _0x17d4d5=function(_0x17d45f){while(--_0x17d45f){_0x4c6dd5['push'](_0x4c6dd5['shift']());}};_0x17d4d5(++_0x3e2003);}(_0x0f42,0x126));var _0x20f4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0f42[_0x3e5086];return _0xfeb102;};'use strict';function Channel(){this[_0x20f4('0x0')]=null;this[_0x20f4('0x1')]='';this[_0x20f4('0x2')]='';this[_0x20f4('0x3')]=0x0;this['calleridname']='';this[_0x20f4('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x20f4('0x5')]=0x0;this['context']='';this[_0x20f4('0x6')]=0x0;this[_0x20f4('0x7')]=0x0;this[_0x20f4('0x8')]=0x0;this['answered']=![];this[_0x20f4('0x9')]=null;this[_0x20f4('0xa')]=null;this['unmanaged']=![];this[_0x20f4('0xb')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0x20f4('0xc')]=0x0;this['holdtime']=0x0;this[_0x20f4('0xd')]=null;this[_0x20f4('0xe')]=null;this[_0x20f4('0xf')]=null;this[_0x20f4('0x10')]=![];this['monitorFilename']=null;this[_0x20f4('0x11')]=null;this['monitors']=[];this[_0x20f4('0x12')]=undefined;this[_0x20f4('0x13')]=undefined;this[_0x20f4('0x14')]=undefined;this[_0x20f4('0x15')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d437441..4af8c65 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 _0xc15a=['tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x2114f9,_0x432630){var _0x1559ce=function(_0x795ae9){while(--_0x795ae9){_0x2114f9['push'](_0x2114f9['shift']());}};_0x1559ce(++_0x432630);}(_0xc15a,0x130));var _0xac15=function(_0x3252cf,_0x344520){_0x3252cf=_0x3252cf-0x0;var _0x4e2968=_0xc15a[_0x3252cf];return _0x4e2968;};'use strict';function DeskAccount(_0x289d84){this['id']=_0x289d84['id']||0x0;this[_0xac15('0x0')]=_0x289d84[_0xac15('0x0')]||'';this[_0xac15('0x1')]=_0x289d84[_0xac15('0x1')]||'';this[_0xac15('0x2')]=_0x289d84[_0xac15('0x2')]||'';this[_0xac15('0x3')]=_0x289d84[_0xac15('0x3')]||'';this[_0xac15('0x4')]=_0x289d84[_0xac15('0x4')]||'';this['consumerKey']=_0x289d84[_0xac15('0x5')]||'';this[_0xac15('0x6')]=_0x289d84['consumerSecret']||'';this['token']=_0x289d84[_0xac15('0x7')]||'';this[_0xac15('0x8')]=_0x289d84['tokenSecret']||'';this[_0xac15('0x9')]=_0x289d84[_0xac15('0x9')]||'';this[_0xac15('0xa')]=_0x289d84[_0xac15('0xa')]||'';this[_0xac15('0xb')]=_0x289d84['Configurations']||{};}module[_0xac15('0xc')]=DeskAccount; \ No newline at end of file +var _0x6c2b=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerSecret'];(function(_0x5ecd1e,_0x4ea896){var _0x1e9e77=function(_0x2c4e82){while(--_0x2c4e82){_0x5ecd1e['push'](_0x5ecd1e['shift']());}};_0x1e9e77(++_0x4ea896);}(_0x6c2b,0x17a));var _0xb6c2=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x6c2b[_0x1655bb];return _0x5e2020;};'use strict';function DeskAccount(_0x9bb829){this['id']=_0x9bb829['id']||0x0;this[_0xb6c2('0x0')]=_0x9bb829['name']||'';this['username']=_0x9bb829[_0xb6c2('0x1')]||'';this[_0xb6c2('0x2')]=_0x9bb829[_0xb6c2('0x2')]||'';this[_0xb6c2('0x3')]=_0x9bb829[_0xb6c2('0x3')]||'';this[_0xb6c2('0x4')]=_0x9bb829[_0xb6c2('0x4')]||'';this['consumerKey']=_0x9bb829['consumerKey']||'';this[_0xb6c2('0x5')]=_0x9bb829[_0xb6c2('0x5')]||'';this[_0xb6c2('0x6')]=_0x9bb829[_0xb6c2('0x6')]||'';this[_0xb6c2('0x7')]=_0x9bb829[_0xb6c2('0x7')]||'';this[_0xb6c2('0x8')]=_0x9bb829[_0xb6c2('0x8')]||'';this[_0xb6c2('0x9')]=_0x9bb829['serverUrl']||'';this[_0xb6c2('0xa')]=_0x9bb829['Configurations']||{};}module[_0xb6c2('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 5b97c98..e9d460f 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 _0x9310=['CloudProvider','name','username','password','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9310,0x173));var _0x0931=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9310[_0x3b0731];return _0x4204d7;};'use strict';function Dynamics365Account(_0xe58d14){this['id']=_0xe58d14['id']||0x0;this['name']=_0xe58d14[_0x0931('0x0')]||'';this['username']=_0xe58d14[_0x0931('0x1')]||'';this[_0x0931('0x2')]=_0xe58d14['password']||'';this['remoteUri']=_0xe58d14['remoteUri']||'';this[_0x0931('0x3')]=_0xe58d14[_0x0931('0x3')]||'';this['clientId']=_0xe58d14[_0x0931('0x4')]||'';this[_0x0931('0x5')]=_0xe58d14['clientSecret']||{};this[_0x0931('0x6')]=_0xe58d14[_0x0931('0x6')]||'';this[_0x0931('0x7')]=_0xe58d14[_0x0931('0x7')]||![];this[_0x0931('0x8')]=_0xe58d14[_0x0931('0x8')]||{};this[_0x0931('0x9')]=_0xe58d14['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x0eb6=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','remoteUri'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0x0eb6,0x75));var _0x60eb=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x0eb6[_0x5e2751];return _0x139a39;};'use strict';function Dynamics365Account(_0x4c0d38){this['id']=_0x4c0d38['id']||0x0;this[_0x60eb('0x0')]=_0x4c0d38['name']||'';this['username']=_0x4c0d38[_0x60eb('0x1')]||'';this['password']=_0x4c0d38['password']||'';this[_0x60eb('0x2')]=_0x4c0d38['remoteUri']||'';this[_0x60eb('0x3')]=_0x4c0d38[_0x60eb('0x3')]||'';this[_0x60eb('0x4')]=_0x4c0d38[_0x60eb('0x4')]||'';this[_0x60eb('0x5')]=_0x4c0d38[_0x60eb('0x5')]||{};this[_0x60eb('0x6')]=_0x4c0d38['serverUrl']||'';this[_0x60eb('0x7')]=_0x4c0d38['modernAuthentication']||![];this[_0x60eb('0x8')]=_0x4c0d38['Configurations']||{};this[_0x60eb('0x9')]=_0x4c0d38[_0x60eb('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 63d329c..8ec1cf0 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 _0xf9d2=['key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','SIP','Trunk','ListId'];(function(_0x3c51d8,_0x42c35e){var _0x3fe52f=function(_0x564ab4){while(--_0x564ab4){_0x3c51d8['push'](_0x3c51d8['shift']());}};_0x3fe52f(++_0x42c35e);}(_0xf9d2,0x169));var _0x2f9d=function(_0x4bdc44,_0x4146e6){_0x4bdc44=_0x4bdc44-0x0;var _0x2c7278=_0xf9d2[_0x4bdc44];return _0x2c7278;};'use strict';function FaxAccount(_0x5b7509){this['id']=_0x5b7509['id']||0x0;this[_0x2f9d('0x0')]=_0x5b7509[_0x2f9d('0x0')]||'';this[_0x2f9d('0x1')]=_0x5b7509[_0x2f9d('0x1')];this[_0x2f9d('0x2')]=_0x5b7509[_0x2f9d('0x2')];this['headerinfo']=_0x5b7509[_0x2f9d('0x3')];this[_0x2f9d('0x4')]=_0x5b7509[_0x2f9d('0x4')];this[_0x2f9d('0x5')]=_0x5b7509[_0x2f9d('0x5')]||0x960;this[_0x2f9d('0x6')]=_0x5b7509[_0x2f9d('0x6')]||0x3840;this[_0x2f9d('0x7')]=_0x5b7509[_0x2f9d('0x7')]||'v17,v27,v29';this[_0x2f9d('0x8')]=_0x5b7509['gateway']||'no';this[_0x2f9d('0x9')]=_0x5b7509[_0x2f9d('0x9')]||'no';this[_0x2f9d('0xa')]=_0x5b7509[_0x2f9d('0xa')]||0x1388;this['tech']=_0x5b7509['tech']||_0x2f9d('0xb');this[_0x2f9d('0xc')]=_0x5b7509[_0x2f9d('0xc')]?_0x5b7509[_0x2f9d('0xc')]:undefined;this[_0x2f9d('0xd')]=_0x5b7509[_0x2f9d('0xd')];this[_0x2f9d('0xe')]=_0x5b7509[_0x2f9d('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x93b7=['localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech','Trunk','ListId','key','name','description','ecm','headerinfo'];(function(_0x12e409,_0x379bb4){var _0xacb87b=function(_0x53ad8c){while(--_0x53ad8c){_0x12e409['push'](_0x12e409['shift']());}};_0xacb87b(++_0x379bb4);}(_0x93b7,0x1cd));var _0x793b=function(_0x2d5411,_0x1a439f){_0x2d5411=_0x2d5411-0x0;var _0x4f13d7=_0x93b7[_0x2d5411];return _0x4f13d7;};'use strict';function FaxAccount(_0x5e050a){this['id']=_0x5e050a['id']||0x0;this['name']=_0x5e050a[_0x793b('0x0')]||'';this['description']=_0x5e050a[_0x793b('0x1')];this[_0x793b('0x2')]=_0x5e050a[_0x793b('0x2')];this[_0x793b('0x3')]=_0x5e050a[_0x793b('0x3')];this[_0x793b('0x4')]=_0x5e050a[_0x793b('0x4')];this[_0x793b('0x5')]=_0x5e050a[_0x793b('0x5')]||0x960;this[_0x793b('0x6')]=_0x5e050a['maxrate']||0x3840;this[_0x793b('0x7')]=_0x5e050a[_0x793b('0x7')]||_0x793b('0x8');this['gateway']=_0x5e050a['gateway']||'no';this[_0x793b('0x9')]=_0x5e050a[_0x793b('0x9')]||'no';this[_0x793b('0xa')]=_0x5e050a[_0x793b('0xa')]||0x1388;this[_0x793b('0xb')]=_0x5e050a[_0x793b('0xb')]||'SIP';this[_0x793b('0xc')]=_0x5e050a[_0x793b('0xc')]?_0x5e050a['Trunk']:undefined;this[_0x793b('0xd')]=_0x5e050a[_0x793b('0xd')];this[_0x793b('0xe')]=_0x5e050a[_0x793b('0xe')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b1c5f86..e0dd598 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 _0x1ee9=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x158430,_0x208671){var _0x37c35c=function(_0x46f465){while(--_0x46f465){_0x158430['push'](_0x158430['shift']());}};_0x37c35c(++_0x208671);}(_0x1ee9,0x6a));var _0x91ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ee9[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x3d515d){this['id']=_0x3d515d['id']||0x0;this[_0x91ee('0x0')]=_0x3d515d[_0x91ee('0x0')]||'';this[_0x91ee('0x1')]=_0x3d515d['username']||'';this['apiKey']=_0x3d515d[_0x91ee('0x2')]||'';this[_0x91ee('0x3')]=_0x3d515d[_0x91ee('0x3')]||'';this['serverUrl']=_0x3d515d[_0x91ee('0x4')]||'';this[_0x91ee('0x5')]=_0x3d515d[_0x91ee('0x5')]||{};}module[_0x91ee('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x603b=['remoteUri','serverUrl','name','username','apiKey'];(function(_0x30c2e0,_0x1200cb){var _0x2a5ead=function(_0xab733e){while(--_0xab733e){_0x30c2e0['push'](_0x30c2e0['shift']());}};_0x2a5ead(++_0x1200cb);}(_0x603b,0x93));var _0xb603=function(_0x47e4c3,_0x25e23f){_0x47e4c3=_0x47e4c3-0x0;var _0x4062ef=_0x603b[_0x47e4c3];return _0x4062ef;};'use strict';function FreshdeskAccount(_0x3b18af){this['id']=_0x3b18af['id']||0x0;this[_0xb603('0x0')]=_0x3b18af[_0xb603('0x0')]||'';this[_0xb603('0x1')]=_0x3b18af[_0xb603('0x1')]||'';this[_0xb603('0x2')]=_0x3b18af['token']||'';this[_0xb603('0x3')]=_0x3b18af[_0xb603('0x3')]||'';this['serverUrl']=_0x3b18af[_0xb603('0x4')]||'';this['Configurations']=_0x3b18af['Configurations']||{};}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 66a0355..0b76ccc 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 _0xd101=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x3c564e,_0x43380d){_0x3c564e=_0x3c564e-0x0;var _0x4af633=_0xd101[_0x3c564e];return _0x4af633;};'use strict';function FreshsalesAccount(_0x34b53f){this['id']=_0x34b53f['id']||0x0;this['name']=_0x34b53f[_0x1d10('0x0')]||'';this[_0x1d10('0x1')]=_0x34b53f[_0x1d10('0x1')]||'';this[_0x1d10('0x2')]=_0x34b53f[_0x1d10('0x3')]||'';this[_0x1d10('0x4')]=_0x34b53f[_0x1d10('0x4')]||'';this[_0x1d10('0x5')]=_0x34b53f['serverUrl']||'';this[_0x1d10('0x6')]=_0x34b53f[_0x1d10('0x6')]||{};}module[_0x1d10('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xfd6e=['name','username','apiKey','serverUrl','Configurations','exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';function FreshsalesAccount(_0x501204){this['id']=_0x501204['id']||0x0;this['name']=_0x501204[_0xefd6('0x0')]||'';this['username']=_0x501204[_0xefd6('0x1')]||'';this[_0xefd6('0x2')]=_0x501204['token']||'';this['remoteUri']=_0x501204['remoteUri']||'';this[_0xefd6('0x3')]=_0x501204['serverUrl']||'';this['Configurations']=_0x501204[_0xefd6('0x4')]||{};}module[_0xefd6('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index bd1cb4c..7165fa7 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 _0xa412=['holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','exten','priority'];(function(_0xe85462,_0x3e1750){var _0x18886d=function(_0xd896e0){while(--_0xd896e0){_0xe85462['push'](_0xe85462['shift']());}};_0x18886d(++_0x3e1750);}(_0xa412,0x10e));var _0x2a41=function(_0x4fce86,_0x24a2a7){_0x4fce86=_0x4fce86-0x0;var _0x3fc5ef=_0xa412[_0x4fce86];return _0x3fc5ef;};'use strict';function QueueReport(){this[_0x2a41('0x0')]=_0x2a41('0x1');this[_0x2a41('0x2')]='';this[_0x2a41('0x3')]='';this[_0x2a41('0x4')]='';this[_0x2a41('0x5')]='';this[_0x2a41('0x6')]=null;this[_0x2a41('0x7')]=null;this[_0x2a41('0x8')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x2a41('0x9')]=null;this[_0x2a41('0xa')]=![];this[_0x2a41('0xb')]=null;this[_0x2a41('0xc')]=![];this[_0x2a41('0xd')]=null;this[_0x2a41('0xe')]=0x1;this[_0x2a41('0xf')]='';this[_0x2a41('0x10')]='';this[_0x2a41('0x11')]='';this['accountcode']='';this['context']='';this[_0x2a41('0x12')]='';this[_0x2a41('0x13')]='';this[_0x2a41('0x14')]=0x0;this[_0x2a41('0x15')]=![];this[_0x2a41('0x16')]='';this[_0x2a41('0x17')]=_0x2a41('0x18');this[_0x2a41('0x19')]=null;this[_0x2a41('0x1a')]=0x0;this[_0x2a41('0x1b')]={};}module[_0x2a41('0x1c')]=QueueReport; \ No newline at end of file +var _0xba4b=['channel','connectedlinename','exten','holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt'];(function(_0x4d573b,_0x459ef9){var _0x47d562=function(_0x3529bc){while(--_0x3529bc){_0x4d573b['push'](_0x4d573b['shift']());}};_0x47d562(++_0x459ef9);}(_0xba4b,0x1b4));var _0xbba4=function(_0x4ce3ef,_0x49f80e){_0x4ce3ef=_0x4ce3ef-0x0;var _0x5ebb94=_0xba4b[_0x4ce3ef];return _0x5ebb94;};'use strict';function QueueReport(){this[_0xbba4('0x0')]=_0xbba4('0x1');this['uniqueid']='';this[_0xbba4('0x2')]='';this[_0xbba4('0x3')]='';this[_0xbba4('0x4')]='';this[_0xbba4('0x5')]=null;this[_0xbba4('0x6')]=null;this[_0xbba4('0x7')]=0x1;this[_0xbba4('0x8')]=0x1;this[_0xbba4('0x9')]=![];this[_0xbba4('0xa')]=null;this[_0xbba4('0xb')]=![];this['queuecallercompleteAt']=null;this[_0xbba4('0xc')]=![];this[_0xbba4('0xd')]=null;this['originalposition']=0x1;this[_0xbba4('0xe')]='';this['connectedlinenum']='';this[_0xbba4('0xf')]='';this['accountcode']='';this['context']='';this[_0xbba4('0x10')]='';this['priority']='';this[_0xbba4('0x11')]=0x0;this[_0xbba4('0x12')]=![];this[_0xbba4('0x13')]='';this[_0xbba4('0x14')]='voice';this[_0xbba4('0x15')]=null;this[_0xbba4('0x16')]=0x0;this[_0xbba4('0x17')]={};}module[_0xbba4('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 376755d..f830970 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 _0x8a5d=['remoteUri','password','clientId','clientSecret','type','integrationTab','Configurations','exports','name','username'];(function(_0x1ed1d8,_0x384889){var _0x4f145d=function(_0x1c3380){while(--_0x1c3380){_0x1ed1d8['push'](_0x1ed1d8['shift']());}};_0x4f145d(++_0x384889);}(_0x8a5d,0xbc));var _0xd8a5=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x8a5d[_0x1deb03];return _0x189fe7;};'use strict';function SalesforceAccount(_0xc64230){this['id']=_0xc64230['id']||0x0;this['name']=_0xc64230[_0xd8a5('0x0')]||'';this[_0xd8a5('0x1')]=_0xc64230['username']||'';this[_0xd8a5('0x2')]=_0xc64230[_0xd8a5('0x2')]||'';this[_0xd8a5('0x3')]=_0xc64230[_0xd8a5('0x3')]||'';this['clientId']=_0xc64230[_0xd8a5('0x4')]||'';this['clientSecret']=_0xc64230[_0xd8a5('0x5')]||'';this['securityToken']=_0xc64230['securityToken']||'';this[_0xd8a5('0x6')]=_0xc64230['type']||_0xd8a5('0x7');this['serverUrl']=_0xc64230['serverUrl']||'';this['Configurations']=_0xc64230[_0xd8a5('0x8')]||{};}module[_0xd8a5('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x51a9=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x2103c1,_0x49fc3c){var _0x19cb9e=function(_0x4e8aed){while(--_0x4e8aed){_0x2103c1['push'](_0x2103c1['shift']());}};_0x19cb9e(++_0x49fc3c);}(_0x51a9,0x86));var _0x951a=function(_0x91b6b5,_0x333253){_0x91b6b5=_0x91b6b5-0x0;var _0x4166e4=_0x51a9[_0x91b6b5];return _0x4166e4;};'use strict';function SalesforceAccount(_0xc5d67f){this['id']=_0xc5d67f['id']||0x0;this[_0x951a('0x0')]=_0xc5d67f[_0x951a('0x0')]||'';this[_0x951a('0x1')]=_0xc5d67f[_0x951a('0x1')]||'';this[_0x951a('0x2')]=_0xc5d67f['remoteUri']||'';this[_0x951a('0x3')]=_0xc5d67f[_0x951a('0x3')]||'';this[_0x951a('0x4')]=_0xc5d67f[_0x951a('0x4')]||'';this[_0x951a('0x5')]=_0xc5d67f['clientSecret']||'';this['securityToken']=_0xc5d67f[_0x951a('0x6')]||'';this[_0x951a('0x7')]=_0xc5d67f[_0x951a('0x7')]||'integrationTab';this[_0x951a('0x8')]=_0xc5d67f[_0x951a('0x8')]||'';this['Configurations']=_0xc5d67f[_0x951a('0x9')]||{};}module[_0x951a('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 7bf3fd5..fac8d14 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 _0x4763=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3f6c5e,_0x534acf){var _0x37be1b=function(_0x57fb47){while(--_0x57fb47){_0x3f6c5e['push'](_0x3f6c5e['shift']());}};_0x37be1b(++_0x534acf);}(_0x4763,0x143));var _0x3476=function(_0x5bca5d,_0x4cf9fc){_0x5bca5d=_0x5bca5d-0x0;var _0x5d6eff=_0x4763[_0x5bca5d];return _0x5d6eff;};'use strict';function ServicenowAccount(_0x4107a4){this['id']=_0x4107a4['id']||0x0;this[_0x3476('0x0')]=_0x4107a4[_0x3476('0x0')]||'';this[_0x3476('0x1')]=_0x4107a4['username']||'';this['password']=_0x4107a4[_0x3476('0x2')]||'';this['remoteUri']=_0x4107a4[_0x3476('0x3')]||'';this['serverUrl']=_0x4107a4[_0x3476('0x4')]||'';this[_0x3476('0x5')]=_0x4107a4[_0x3476('0x5')]||{};}module[_0x3476('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf7cc=['remoteUri','serverUrl','exports','username','password'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0xf7cc,0xc1));var _0xcf7c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf7cc[_0x4b369d];return _0x571a98;};'use strict';function ServicenowAccount(_0x1ac6ef){this['id']=_0x1ac6ef['id']||0x0;this['name']=_0x1ac6ef['name']||'';this[_0xcf7c('0x0')]=_0x1ac6ef[_0xcf7c('0x0')]||'';this[_0xcf7c('0x1')]=_0x1ac6ef['password']||'';this[_0xcf7c('0x2')]=_0x1ac6ef[_0xcf7c('0x2')]||'';this[_0xcf7c('0x3')]=_0x1ac6ef[_0xcf7c('0x3')]||'';this['Configurations']=_0x1ac6ef['Configurations']||{};}module[_0xcf7c('0x4')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 67f4136..dfd9c87 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 _0x489d=['Configurations','exports','name','password','serverUrl'];(function(_0x48e748,_0x190ac9){var _0x4e7123=function(_0x39f630){while(--_0x39f630){_0x48e748['push'](_0x48e748['shift']());}};_0x4e7123(++_0x190ac9);}(_0x489d,0x11a));var _0xd489=function(_0x3d754d,_0x71aad){_0x3d754d=_0x3d754d-0x0;var _0x59f912=_0x489d[_0x3d754d];return _0x59f912;};'use strict';function SugarcrmAccount(_0x34c6e2){this['id']=_0x34c6e2['id']||0x0;this[_0xd489('0x0')]=_0x34c6e2[_0xd489('0x0')]||'';this['username']=_0x34c6e2['username']||'';this[_0xd489('0x1')]=_0x34c6e2[_0xd489('0x1')]||'';this['remoteUri']=_0x34c6e2['remoteUri']||'';this[_0xd489('0x2')]=_0x34c6e2['serverUrl']||'';this['Configurations']=_0x34c6e2[_0xd489('0x3')]||{};}module[_0xd489('0x4')]=SugarcrmAccount; \ No newline at end of file +var _0x483e=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x9fd97d,_0x4e5ac1){var _0x15b31c=function(_0x11b145){while(--_0x11b145){_0x9fd97d['push'](_0x9fd97d['shift']());}};_0x15b31c(++_0x4e5ac1);}(_0x483e,0x127));var _0xe483=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x483e[_0x23c73d];return _0x36ba47;};'use strict';function SugarcrmAccount(_0x12d609){this['id']=_0x12d609['id']||0x0;this['name']=_0x12d609[_0xe483('0x0')]||'';this['username']=_0x12d609[_0xe483('0x1')]||'';this[_0xe483('0x2')]=_0x12d609[_0xe483('0x2')]||'';this[_0xe483('0x3')]=_0x12d609['remoteUri']||'';this[_0xe483('0x4')]=_0x12d609[_0xe483('0x4')]||'';this[_0xe483('0x5')]=_0x12d609['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9c58a0f..f56c5e3 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 _0xff83=['status','unknown','name','accountcode','stateTime'];(function(_0x925ed6,_0x43fb78){var _0x520c3b=function(_0x142cdd){while(--_0x142cdd){_0x925ed6['push'](_0x925ed6['shift']());}};_0x520c3b(++_0x43fb78);}(_0xff83,0x98));var _0x3ff8=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xff83[_0x297fd3];return _0x2af381;};'use strict';function Telephone(_0x31bac6){this['id']=_0x31bac6['id']||0x0;this[_0x3ff8('0x0')]=_0x31bac6[_0x3ff8('0x0')]||'';this[_0x3ff8('0x1')]=_0x31bac6[_0x3ff8('0x1')]||'';this['state']='unknown';this[_0x3ff8('0x2')]=0x0;this[_0x3ff8('0x3')]=_0x3ff8('0x4');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0x09b0=['exports','name','accountcode','stateTime','status','unknown'];(function(_0x7a0481,_0x53346d){var _0x3858b0=function(_0x589493){while(--_0x589493){_0x7a0481['push'](_0x7a0481['shift']());}};_0x3858b0(++_0x53346d);}(_0x09b0,0x1f3));var _0x009b=function(_0x1dd4d7,_0x2967e6){_0x1dd4d7=_0x1dd4d7-0x0;var _0x4a951a=_0x09b0[_0x1dd4d7];return _0x4a951a;};'use strict';function Telephone(_0x17fd8d){this['id']=_0x17fd8d['id']||0x0;this['name']=_0x17fd8d[_0x009b('0x0')]||'';this['accountcode']=_0x17fd8d[_0x009b('0x1')]||'';this['state']='unknown';this[_0x009b('0x2')]=0x0;this[_0x009b('0x3')]=_0x009b('0x4');this['address']='';}module[_0x009b('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index cb30254..f547218 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x158116,_0x58eac4){var _0x751a16=function(_0x1679df){while(--_0x1679df){_0x158116['push'](_0x158116['shift']());}};_0x751a16(++_0x58eac4);}(_0xb10b,0x12a));var _0xbb10=function(_0x460dae,_0x3a907f){_0x460dae=_0x460dae-0x0;var _0x36e6d0=_0xb10b[_0x460dae];return _0x36e6d0;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x8c2558,_0x95548f){var _0x48288b=function(_0x4917cc){while(--_0x4917cc){_0x8c2558['push'](_0x8c2558['shift']());}};_0x48288b(++_0x95548f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 909f603..86eadbc 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x415cda,_0xf51216){var _0x2d549f=function(_0x102215){while(--_0x102215){_0x415cda['push'](_0x415cda['shift']());}};_0x2d549f(++_0xf51216);}(_0xb10b,0x12a));var _0xbb10=function(_0xdfcf22,_0x322509){_0xdfcf22=_0xdfcf22-0x0;var _0x59b62f=_0xb10b[_0xdfcf22];return _0x59b62f;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x32f9d0,_0x440b68){var _0x143e0f=function(_0x1e557b){while(--_0x1e557b){_0x32f9d0['push'](_0x32f9d0['shift']());}};_0x143e0f(++_0x440b68);}(_0xda2d,0x102));var _0xdda2=function(_0x13d150,_0x33f706){_0x13d150=_0x13d150-0x0;var _0x3e9dbd=_0xda2d[_0x13d150];return _0x3e9dbd;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index c7c27a3..c035779 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 _0xff2a=['domainport','stateRegistry','address','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain'];(function(_0x5d4938,_0x4802e6){var _0x37acbb=function(_0x262ad7){while(--_0x262ad7){_0x5d4938['push'](_0x5d4938['shift']());}};_0x37acbb(++_0x4802e6);}(_0xff2a,0x194));var _0xaff2=function(_0x18b9a8,_0x1770b6){_0x18b9a8=_0x18b9a8-0x0;var _0x4a0a8f=_0xff2a[_0x18b9a8];return _0x4a0a8f;};'use strict';function Trunk(_0x43a132){this['id']=_0x43a132['id']||0x0;this[_0xaff2('0x0')]=_0x43a132[_0xaff2('0x0')]||![];this['name']=_0x43a132[_0xaff2('0x1')]||'';this[_0xaff2('0x2')]=_0xaff2('0x3');this[_0xaff2('0x4')]=0x0;this[_0xaff2('0x5')]=_0xaff2('0x3');this[_0xaff2('0x6')]=_0x43a132[_0xaff2('0x6')]&&_0x43a132['registry'][_0xaff2('0x7')](':')?_0x43a132['registry'][_0xaff2('0x8')](':')[0x0]:'';this[_0xaff2('0x9')]='';this[_0xaff2('0xa')]='';this[_0xaff2('0xb')]='';this[_0xaff2('0xc')]='';this['refresh']='';this[_0xaff2('0xd')]='unknown';this['registrationtime']='';this[_0xaff2('0xe')]='';this['defaultuser']=_0x43a132['defaultuser']||'';}module[_0xaff2('0xf')]=Trunk; \ No newline at end of file +var _0x3f5c=['registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','host','port','domain','refresh','stateRegistry'];(function(_0x1b36d4,_0x3e9356){var _0x193a52=function(_0x1e2095){while(--_0x1e2095){_0x1b36d4['push'](_0x1b36d4['shift']());}};_0x193a52(++_0x3e9356);}(_0x3f5c,0xf2));var _0xc3f5=function(_0x73d16e,_0x39a841){_0x73d16e=_0x73d16e-0x0;var _0x3a7f7c=_0x3f5c[_0x73d16e];return _0x3a7f7c;};'use strict';function Trunk(_0x48f2a6){this['id']=_0x48f2a6['id']||0x0;this['active']=_0x48f2a6[_0xc3f5('0x0')]||![];this[_0xc3f5('0x1')]=_0x48f2a6[_0xc3f5('0x1')]||'';this[_0xc3f5('0x2')]=_0xc3f5('0x3');this['stateTime']=0x0;this[_0xc3f5('0x4')]='unknown';this['registry']=_0x48f2a6[_0xc3f5('0x5')]&&_0x48f2a6[_0xc3f5('0x5')][_0xc3f5('0x6')](':')?_0x48f2a6[_0xc3f5('0x5')][_0xc3f5('0x7')](':')[0x0]:'';this[_0xc3f5('0x8')]='';this[_0xc3f5('0x9')]='';this[_0xc3f5('0xa')]='';this['domainport']='';this[_0xc3f5('0xb')]='';this[_0xc3f5('0xc')]=_0xc3f5('0x3');this[_0xc3f5('0xd')]='';this[_0xc3f5('0xe')]='';this['defaultuser']=_0x48f2a6[_0xc3f5('0xf')]||'';}module[_0xc3f5('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 7b040ce..3299592 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 _0xeb3e=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0xeb3e,0x1d1));var _0xeeb3=function(_0x387e38,_0x55f6e0){_0x387e38=_0x387e38-0x0;var _0x38a45c=_0xeb3e[_0x387e38];return _0x38a45c;};'use strict';function voiceExtension(_0x2adc0d){this['id']=_0x2adc0d['id']||0x0;this[_0xeeb3('0x0')]=_0x2adc0d[_0xeeb3('0x0')]||'';this[_0xeeb3('0x1')]=_0x2adc0d['recordingFormat']||'none';this[_0xeeb3('0x2')]=_0x2adc0d[_0xeeb3('0x2')]||![];}module[_0xeeb3('0x3')]=voiceExtension; \ No newline at end of file +var _0x6acd=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x2b216a,_0x5ebea4){var _0x39ab62=function(_0x37b9bd){while(--_0x37b9bd){_0x2b216a['push'](_0x2b216a['shift']());}};_0x39ab62(++_0x5ebea4);}(_0x6acd,0x99));var _0xd6ac=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6acd[_0x40a045];return _0x1a687c;};'use strict';function voiceExtension(_0x110d7b){this['id']=_0x110d7b['id']||0x0;this[_0xd6ac('0x0')]=_0x110d7b['exten']||'';this[_0xd6ac('0x1')]=_0x110d7b[_0xd6ac('0x1')]||_0xd6ac('0x2');this[_0xd6ac('0x3')]=_0x110d7b['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index d4de953..183e77e 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 _0x58e6=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','available','busy','inUse','invalid','loggedIn','notInUse','onHold','ringing','ringInUse','talking','unavailable','acw','autopause','sendMessageOneNotActive','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x21816f,_0xa7457f){var _0x349acb=function(_0x5c14d4){while(--_0x5c14d4){_0x21816f['push'](_0x21816f['shift']());}};_0x349acb(++_0xa7457f);}(_0x58e6,0x1c2));var _0x658e=function(_0x7782a,_0x1bd90b){_0x7782a=_0x7782a-0x0;var _0x55eec6=_0x58e6[_0x7782a];return _0x55eec6;};'use strict';var monitorFormat={'wav':_0x658e('0x0'),'wav49':_0x658e('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':'fewestcalls','leastrecent':'leastrecent','linear':_0x658e('0x2'),'random':'random','ringall':_0x658e('0x3'),'rr':_0x658e('0x4'),'rrmemory':_0x658e('0x5'),'rrordered':_0x658e('0x6'),'wrandom':_0x658e('0x7')};function VoiceQueue(_0x2add44){this['id']=_0x2add44['id']||0x0;this[_0x658e('0x8')]=_0x2add44['name']||'';this['monitor_format']=_0x2add44[_0x658e('0x9')]||'';this[_0x658e('0xa')]=_0x2add44[_0x658e('0xa')]||'inbound';this[_0x658e('0xb')]=0x0;this[_0x658e('0xc')]=0x0;this[_0x658e('0xd')]=0x0;this[_0x658e('0xe')]=0x0;this[_0x658e('0xf')]=0x0;this[_0x658e('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x658e('0x11')]=0x0;this[_0x658e('0x12')]=0x0;this[_0x658e('0x13')]=0x0;this[_0x658e('0x14')]=0x0;this[_0x658e('0x15')]=0x0;this[_0x658e('0x16')]=0x0;this[_0x658e('0x17')]=0x0;this['paused']=0x0;this[_0x658e('0x18')]=0x0;this[_0x658e('0x19')]=0x0;this[_0x658e('0x1a')]=0x0;this[_0x658e('0x1b')]=0x0;this['unknown']=0x0;this[_0x658e('0x1c')]=_0x2add44[_0x658e('0x1c')]||![];this['acwTimeout']=_0x2add44['acwTimeout']||0xa;this[_0x658e('0x1d')]=_0x2add44[_0x658e('0x1d')]||'no';this[_0x658e('0x1e')]=!![];this['message']='';this[_0x658e('0x1f')]='';this['originated']=0x0;this[_0x658e('0x20')]=0x0;this[_0x658e('0x21')]=_0x2add44[_0x658e('0x21')]||null;this[_0x658e('0x22')]=_0x2add44[_0x658e('0x22')]?_0x2add44[_0x658e('0x22')]:null;this['dialActive']=_0x2add44[_0x658e('0x23')];this[_0x658e('0x24')]=_0x2add44[_0x658e('0x24')]||_0x658e('0x25');this[_0x658e('0x26')]=_0x2add44['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x2add44[_0x658e('0x27')]||0x0;this[_0x658e('0x28')]=_0x2add44['dialPowerLevel']||0x1;this[_0x658e('0x29')]=_0x2add44[_0x658e('0x29')]||_0x658e('0x2a');this[_0x658e('0x2b')]=_0x2add44['dialPredictiveOptimizationPercentage']||0.03;this[_0x658e('0x2c')]=_0x2add44[_0x658e('0x2c')]||0x258;this[_0x658e('0x2d')]=_0x2add44[_0x658e('0x2d')]||_0x658e('0x2e');this[_0x658e('0x2f')]=_0x2add44[_0x658e('0x2f')]||_0x658e('0x2e');this[_0x658e('0x30')]=_0x2add44[_0x658e('0x30')]||0x1e;this[_0x658e('0x31')]=_0x2add44['dialQueueOptions']||_0x658e('0x32');this[_0x658e('0x33')]=_0x2add44['dialQueueTimeout']||0x3;this[_0x658e('0x34')]=_0x2add44[_0x658e('0x34')]||undefined;this[_0x658e('0x35')]=_0x2add44[_0x658e('0x35')]||0x3;this[_0x658e('0x36')]=_0x2add44[_0x658e('0x36')]||0x96;this[_0x658e('0x37')]=_0x2add44['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x2add44[_0x658e('0x38')]||0x96;this[_0x658e('0x39')]=_0x2add44[_0x658e('0x39')]||0x3;this['dialNoAnswerRetryFrequency']=_0x2add44[_0x658e('0x3a')]||0x96;this[_0x658e('0x3b')]=_0x2add44[_0x658e('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2add44['dialNoSuchNumberRetryFrequency']||0x96;this[_0x658e('0x3c')]=_0x2add44['dialDropMaxRetry']||0x3;this[_0x658e('0x3d')]=_0x2add44[_0x658e('0x3d')]||0x96;this[_0x658e('0x3e')]=_0x2add44[_0x658e('0x3e')]||0x3;this[_0x658e('0x3f')]=_0x2add44[_0x658e('0x3f')]||0x96;this[_0x658e('0x40')]=_0x2add44['dialMachineMaxRetry']||0x3;this[_0x658e('0x41')]=_0x2add44['dialMachineRetryFrequency']||0x96;this[_0x658e('0x42')]=_0x2add44[_0x658e('0x42')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2add44[_0x658e('0x43')]||0x96;this[_0x658e('0x44')]=_0x2add44[_0x658e('0x44')]||0x3;this[_0x658e('0x45')]=_0x2add44['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x2add44[_0x658e('0x46')]?_0x2add44[_0x658e('0x46')]:undefined;this['TrunkBackup']=_0x2add44['TrunkBackup']?_0x2add44[_0x658e('0x47')]:undefined;this['dialPrefix']=_0x2add44[_0x658e('0x48')]||undefined;this[_0x658e('0x49')]=_0x2add44[_0x658e('0x49')]?_0x2add44['Interval']:undefined;this['dialOrderByScheduledAt']=_0x2add44[_0x658e('0x4a')]||'DESC';this[_0x658e('0x4b')]=_0x2add44[_0x658e('0x4b')]||undefined;this[_0x658e('0x4c')]=_0x2add44[_0x658e('0x4c')]||undefined;this[_0x658e('0x4d')]=strategy[_0x2add44[_0x658e('0x4d')]];this[_0x658e('0x4e')]=!![];this[_0x658e('0x4f')]=_0x2add44['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2add44[_0x658e('0x50')];this[_0x658e('0x51')]=_0x2add44['dialAMDGreeting'];this[_0x658e('0x52')]=_0x2add44[_0x658e('0x52')];this[_0x658e('0x53')]=_0x2add44['dialAMDTotalAnalysisTime'];this[_0x658e('0x54')]=_0x2add44['dialAMDMinWordLength'];this[_0x658e('0x55')]=_0x2add44[_0x658e('0x55')];this[_0x658e('0x56')]=_0x2add44[_0x658e('0x56')];this[_0x658e('0x57')]=_0x2add44[_0x658e('0x57')];this[_0x658e('0x58')]=_0x2add44['dialAMDMaximumWordLength'];this[_0x658e('0x59')]=0x0;this['pTalking']=0x0;this['timeout']=_0x2add44[_0x658e('0x5a')];this[_0x658e('0x5b')]=0x0;this[_0x658e('0x5c')]=0x0;this[_0x658e('0x5d')]=0x0;this[_0x658e('0x5e')]=0x0;this[_0x658e('0x5f')]=0x0;this[_0x658e('0x60')]=0x0;this[_0x658e('0x61')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x658e('0x62')]=0x0;this[_0x658e('0x63')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x658e('0x64')]=0x0;this[_0x658e('0x65')]=0x0;this[_0x658e('0x66')]=0x0;this['startProgressive']=undefined;this[_0x658e('0x67')]=undefined;this[_0x658e('0x68')]=undefined;this[_0x658e('0x69')]=1.05;this[_0x658e('0x6a')]=0x0;this[_0x658e('0x6b')]=0x0;this[_0x658e('0x6c')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x658e('0x6d')]=0x0;this[_0x658e('0x6e')]=_0x2add44[_0x658e('0x6f')]||0x14;this[_0x658e('0x70')]=_0x2add44[_0x658e('0x6f')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x658e('0x71')]=0x0;this[_0x658e('0x72')]=0x1;this[_0x658e('0x73')]=0x0;this['erlangCallToSecond']=0x0;this[_0x658e('0x74')]=0x0;this[_0x658e('0x75')]=0x0;this[_0x658e('0x76')]=_0x2add44[_0x658e('0x76')]||0x1e;this[_0x658e('0x77')]=_0x2add44[_0x658e('0x77')]||![];this[_0x658e('0x78')]=!!_0x2add44[_0x658e('0x78')]||![];this['dialPreviewRecallmeReminder']=!!_0x2add44[_0x658e('0x79')]||![];this[_0x658e('0x7a')]=_0x2add44['dialQueueProject2']||undefined;this[_0x658e('0x7b')]=_0x2add44['dialAgiAfterHangupClient']||![];this[_0x658e('0x7c')]=_0x2add44[_0x658e('0x7c')]||![];this['monitor_format']=monitorFormat[_0x2add44[_0x658e('0x9')]]?monitorFormat[_0x2add44['monitor_format']]:undefined;this[_0x658e('0x7d')]=_0x2add44[_0x658e('0x7d')]||![];this['mandatoryDispositionPause']=_0x2add44['mandatoryDispositionPause']?_0x2add44[_0x658e('0x7e')]:undefined;this[_0x658e('0x7f')]=![];}module[_0x658e('0x80')]=VoiceQueue; \ No newline at end of file +var _0x975a=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','answered','sumHoldTime','sumBillable','unmanaged','busy','inUse','invalid','loggedIn','onHold','paused','talking','unavailable','unknown','acw','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0x975a,0x142));var _0xa975=function(_0x14c402,_0x1cf75d){_0x14c402=_0x14c402-0x0;var _0x189a02=_0x975a[_0x14c402];return _0x189a02;};'use strict';var monitorFormat={'wav':_0xa975('0x0'),'wav49':_0xa975('0x1'),'gsm':_0xa975('0x2')};var strategy={'fewestcalls':_0xa975('0x3'),'leastrecent':'leastrecent','linear':_0xa975('0x4'),'random':'random','ringall':_0xa975('0x5'),'rr':'roundrobin','rrmemory':_0xa975('0x6'),'rrordered':_0xa975('0x7'),'wrandom':_0xa975('0x8')};function VoiceQueue(_0x21f9b4){this['id']=_0x21f9b4['id']||0x0;this[_0xa975('0x9')]=_0x21f9b4[_0xa975('0x9')]||'';this[_0xa975('0xa')]=_0x21f9b4[_0xa975('0xa')]||'';this[_0xa975('0xb')]=_0x21f9b4[_0xa975('0xb')]||_0xa975('0xc');this['waiting']=0x0;this['total']=0x0;this[_0xa975('0xd')]=0x0;this['sumDuration']=0x0;this[_0xa975('0xe')]=0x0;this[_0xa975('0xf')]=0x0;this[_0xa975('0x10')]=0x0;this['abandoned']=0x0;this['available']=0x0;this[_0xa975('0x11')]=0x0;this[_0xa975('0x12')]=0x0;this[_0xa975('0x13')]=0x0;this[_0xa975('0x14')]=0x0;this['notInUse']=0x0;this[_0xa975('0x15')]=0x0;this[_0xa975('0x16')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0xa975('0x17')]=0x0;this[_0xa975('0x18')]=0x0;this[_0xa975('0x19')]=0x0;this['acw']=_0x21f9b4[_0xa975('0x1a')]||![];this['acwTimeout']=_0x21f9b4['acwTimeout']||0xa;this[_0xa975('0x1b')]=_0x21f9b4[_0xa975('0x1b')]||'no';this[_0xa975('0x1c')]=!![];this[_0xa975('0x1d')]='';this[_0xa975('0x1e')]='';this['originated']=0x0;this[_0xa975('0x1f')]=0x0;this[_0xa975('0x20')]=_0x21f9b4[_0xa975('0x20')]||null;this[_0xa975('0x21')]=_0x21f9b4[_0xa975('0x21')]?_0x21f9b4[_0xa975('0x21')]:null;this[_0xa975('0x22')]=_0x21f9b4[_0xa975('0x22')];this['dialMethod']=_0x21f9b4[_0xa975('0x23')]||'progressive';this[_0xa975('0x24')]=_0x21f9b4[_0xa975('0x24')]||0x0;this[_0xa975('0x25')]=_0x21f9b4['dialLimitQueue']||0x0;this[_0xa975('0x26')]=_0x21f9b4[_0xa975('0x26')]||0x1;this[_0xa975('0x27')]=_0x21f9b4['dialPredictiveOptimization']||_0xa975('0x28');this['dialPredictiveOptimizationPercentage']=_0x21f9b4[_0xa975('0x29')]||0.03;this[_0xa975('0x2a')]=_0x21f9b4[_0xa975('0x2a')]||0x258;this[_0xa975('0x2b')]=_0x21f9b4[_0xa975('0x2b')]||_0xa975('0x2c');this[_0xa975('0x2d')]=_0x21f9b4[_0xa975('0x2d')]||_0xa975('0x2c');this[_0xa975('0x2e')]=_0x21f9b4['dialOriginateTimeout']||0x1e;this[_0xa975('0x2f')]=_0x21f9b4[_0xa975('0x2f')]||_0xa975('0x30');this[_0xa975('0x31')]=_0x21f9b4['dialQueueTimeout']||0x3;this[_0xa975('0x32')]=_0x21f9b4[_0xa975('0x32')]||undefined;this[_0xa975('0x33')]=_0x21f9b4[_0xa975('0x33')]||0x3;this[_0xa975('0x34')]=_0x21f9b4[_0xa975('0x34')]||0x96;this[_0xa975('0x35')]=_0x21f9b4['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x21f9b4['dialBusyRetryFrequency']||0x96;this[_0xa975('0x36')]=_0x21f9b4[_0xa975('0x36')]||0x3;this[_0xa975('0x37')]=_0x21f9b4[_0xa975('0x37')]||0x96;this[_0xa975('0x38')]=_0x21f9b4[_0xa975('0x38')]||0x3;this[_0xa975('0x39')]=_0x21f9b4['dialNoSuchNumberRetryFrequency']||0x96;this[_0xa975('0x3a')]=_0x21f9b4[_0xa975('0x3a')]||0x3;this[_0xa975('0x3b')]=_0x21f9b4[_0xa975('0x3b')]||0x96;this[_0xa975('0x3c')]=_0x21f9b4[_0xa975('0x3c')]||0x3;this[_0xa975('0x3d')]=_0x21f9b4[_0xa975('0x3d')]||0x96;this[_0xa975('0x3e')]=_0x21f9b4[_0xa975('0x3e')]||0x3;this[_0xa975('0x3f')]=_0x21f9b4[_0xa975('0x3f')]||0x96;this[_0xa975('0x40')]=_0x21f9b4[_0xa975('0x40')]||0x3;this[_0xa975('0x41')]=_0x21f9b4[_0xa975('0x41')]||0x96;this[_0xa975('0x42')]=_0x21f9b4[_0xa975('0x42')]||0x3;this['dialGlobalMaxRetry']=_0x21f9b4[_0xa975('0x43')]||0x4;this[_0xa975('0x44')]=_0x21f9b4[_0xa975('0x44')]?_0x21f9b4[_0xa975('0x44')]:undefined;this['TrunkBackup']=_0x21f9b4[_0xa975('0x45')]?_0x21f9b4[_0xa975('0x45')]:undefined;this[_0xa975('0x46')]=_0x21f9b4[_0xa975('0x46')]||undefined;this[_0xa975('0x47')]=_0x21f9b4[_0xa975('0x47')]?_0x21f9b4[_0xa975('0x47')]:undefined;this['dialOrderByScheduledAt']=_0x21f9b4[_0xa975('0x48')]||_0xa975('0x49');this['dialRandomLastDigitCallerIdNumber']=_0x21f9b4[_0xa975('0x4a')]||undefined;this[_0xa975('0x4b')]=_0x21f9b4[_0xa975('0x4b')]||undefined;this[_0xa975('0x4c')]=strategy[_0x21f9b4[_0xa975('0x4c')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x21f9b4[_0xa975('0x4d')]||![];this['dialAMDInitialSilence']=_0x21f9b4['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x21f9b4[_0xa975('0x4e')];this[_0xa975('0x4f')]=_0x21f9b4[_0xa975('0x4f')];this[_0xa975('0x50')]=_0x21f9b4[_0xa975('0x50')];this[_0xa975('0x51')]=_0x21f9b4[_0xa975('0x51')];this[_0xa975('0x52')]=_0x21f9b4[_0xa975('0x52')];this[_0xa975('0x53')]=_0x21f9b4[_0xa975('0x53')];this['dialAMDSilenceThreshold']=_0x21f9b4[_0xa975('0x54')];this['dialAMDMaximumWordLength']=_0x21f9b4[_0xa975('0x55')];this['outboundRejectCallsDay']=0x0;this[_0xa975('0x56')]=0x0;this['timeout']=_0x21f9b4[_0xa975('0x57')];this[_0xa975('0x58')]=0x0;this[_0xa975('0x59')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xa975('0x5a')]=0x0;this[_0xa975('0x5b')]=0x0;this[_0xa975('0x5c')]=0x0;this[_0xa975('0x5d')]=0x0;this[_0xa975('0x5e')]=0x0;this[_0xa975('0x5f')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xa975('0x60')]=0x0;this[_0xa975('0x61')]=0x0;this['outboundReCallsDay']=0x0;this[_0xa975('0x62')]=0x0;this[_0xa975('0x63')]=undefined;this[_0xa975('0x64')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xa975('0x65')]=0x0;this[_0xa975('0x66')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xa975('0x67')]=0x0;this[_0xa975('0x68')]=0x0;this[_0xa975('0x69')]=0x0;this[_0xa975('0x6a')]=_0x21f9b4[_0xa975('0x6b')]||0x14;this[_0xa975('0x6c')]=_0x21f9b4[_0xa975('0x6b')]||0xa;this[_0xa975('0x6d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xa975('0x6e')]=0x1;this[_0xa975('0x6f')]=0x0;this[_0xa975('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa975('0x71')]=0x0;this[_0xa975('0x72')]=_0x21f9b4[_0xa975('0x72')]||0x1e;this['dialRecallInQueue']=_0x21f9b4[_0xa975('0x73')]||![];this[_0xa975('0x74')]=!!_0x21f9b4[_0xa975('0x74')]||![];this['dialPreviewRecallmeReminder']=!!_0x21f9b4[_0xa975('0x75')]||![];this['dialQueueProject2']=_0x21f9b4['dialQueueProject2']||undefined;this[_0xa975('0x76')]=_0x21f9b4[_0xa975('0x76')]||![];this[_0xa975('0x77')]=_0x21f9b4[_0xa975('0x77')]||![];this[_0xa975('0xa')]=monitorFormat[_0x21f9b4[_0xa975('0xa')]]?monitorFormat[_0x21f9b4[_0xa975('0xa')]]:undefined;this['mandatoryDisposition']=_0x21f9b4[_0xa975('0x78')]||![];this[_0xa975('0x79')]=_0x21f9b4[_0xa975('0x79')]?_0x21f9b4[_0xa975('0x79')]:undefined;this[_0xa975('0x7a')]=![];}module[_0xa975('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index a18f98e..d9a1998 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ec6=['unmanaged','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','message','statusMessage','Trunk','active','callerid','prototype','unavailable','loggedin','callers','length','SIP/','name','online','incall','status','booked','keys','queue','dialer','exten','some','updateReportFromOutboundQueue','preview','exports','available','paused','ringing','talking','waiting','answered','inUse','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','strategy','abandoned','busy','invalid','loggedIn','onHold','notInUse','ringInUse','sumHoldTime','type','unknown'];(function(_0x1be8f4,_0x52aa07){var _0x33c64a=function(_0x1b6e92){while(--_0x1b6e92){_0x1be8f4['push'](_0x1be8f4['shift']());}};_0x33c64a(++_0x52aa07);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x1c8123,_0x37a312){_0x1c8123=_0x1c8123-0x0;var _0x5f3722=_0x0ec6[_0x1c8123];return _0x5f3722;};'use strict';var INBOUND_COUNTERS=[_0x60ec('0x0'),'loggedIn','loggedInDb',_0x60ec('0x1'),_0x60ec('0x2'),_0x60ec('0x3'),_0x60ec('0x4')];var OUTBOUND_COUNTERS=[_0x60ec('0x0'),_0x60ec('0x5'),_0x60ec('0x6'),'loggedIn',_0x60ec('0x7'),_0x60ec('0x8'),_0x60ec('0x9'),_0x60ec('0xa'),'outboundBlacklistCallsDay',_0x60ec('0xb'),'outboundCongestionCallsDay',_0x60ec('0xc'),_0x60ec('0xd'),_0x60ec('0xe'),_0x60ec('0xf'),_0x60ec('0x10'),_0x60ec('0x1'),'pTalking','talking',_0x60ec('0x11'),_0x60ec('0x12'),_0x60ec('0x13'),_0x60ec('0x4')];function VoiceQueueSummary(_0x10ec80){this['id']=_0x10ec80['id'];this['name']=_0x10ec80['name'];this[_0x60ec('0x14')]=_0x10ec80[_0x60ec('0x14')];this[_0x60ec('0x15')]=_0x10ec80[_0x60ec('0x15')]||0x0;this[_0x60ec('0x5')]=_0x10ec80['answered']||0x0;this[_0x60ec('0x0')]=_0x10ec80[_0x60ec('0x0')]||0x0;this[_0x60ec('0x16')]=_0x10ec80[_0x60ec('0x16')]||0x0;this[_0x60ec('0x6')]=_0x10ec80[_0x60ec('0x6')]||0x0;this[_0x60ec('0x17')]=_0x10ec80[_0x60ec('0x17')]||0x0;this[_0x60ec('0x18')]=_0x10ec80['loggedIn']||0x0;this[_0x60ec('0x7')]=_0x10ec80[_0x60ec('0x7')]||0x0;this[_0x60ec('0x19')]=_0x10ec80[_0x60ec('0x19')]||0x0;this[_0x60ec('0x1a')]=_0x10ec80[_0x60ec('0x1a')]||0x0;this[_0x60ec('0x1')]=_0x10ec80[_0x60ec('0x1')]||0x0;this[_0x60ec('0x2')]=_0x10ec80[_0x60ec('0x2')]||0x0;this[_0x60ec('0x1b')]=_0x10ec80[_0x60ec('0x1b')];this['sumBillable']=_0x10ec80[_0x60ec('0x11')];this[_0x60ec('0x12')]=_0x10ec80[_0x60ec('0x12')];this[_0x60ec('0x1c')]=_0x10ec80['sumHoldTime']||0x0;this[_0x60ec('0x3')]=_0x10ec80[_0x60ec('0x3')]||0x0;this[_0x60ec('0x13')]=_0x10ec80[_0x60ec('0x13')]||0x0;this[_0x60ec('0x1d')]=_0x10ec80[_0x60ec('0x1d')];this['unavailable']=_0x10ec80['unavailable']||0x0;this['unknown']=_0x10ec80[_0x60ec('0x1e')]||0x0;this[_0x60ec('0x1f')]=_0x10ec80[_0x60ec('0x1f')]||0x0;this[_0x60ec('0x4')]=_0x10ec80['waiting']||0x0;if(_0x10ec80['type']==='outbound'){this['pTalking']=_0x10ec80[_0x60ec('0x20')]||0x0;this[_0x60ec('0x21')]=_0x10ec80[_0x60ec('0x21')];this[_0x60ec('0x22')]=_0x10ec80[_0x60ec('0x22')];this[_0x60ec('0x23')]=_0x10ec80[_0x60ec('0x23')];this[_0x60ec('0x24')]=_0x10ec80[_0x60ec('0x24')];this['dialOriginateTimeout']=_0x10ec80[_0x60ec('0x25')];this[_0x60ec('0x26')]=_0x10ec80[_0x60ec('0x26')];this[_0x60ec('0x27')]=_0x10ec80[_0x60ec('0x27')];this[_0x60ec('0x28')]=_0x10ec80[_0x60ec('0x28')];this[_0x60ec('0xa')]=_0x10ec80[_0x60ec('0xa')];this[_0x60ec('0x29')]=_0x10ec80['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x10ec80[_0x60ec('0xb')];this[_0x60ec('0x2a')]=_0x10ec80['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x10ec80[_0x60ec('0x2b')];this['outboundDropCallsDayCallersExit']=_0x10ec80[_0x60ec('0x2c')];this[_0x60ec('0x2d')]=_0x10ec80[_0x60ec('0x2d')];this[_0x60ec('0xc')]=_0x10ec80[_0x60ec('0xc')];this['outboundNoSuchCallsDay']=_0x10ec80[_0x60ec('0xd')];this[_0x60ec('0x2e')]=_0x10ec80[_0x60ec('0x2e')];this[_0x60ec('0xe')]=_0x10ec80[_0x60ec('0xe')];this[_0x60ec('0xf')]=_0x10ec80['outboundRejectCallsDay'];this[_0x60ec('0x10')]=_0x10ec80[_0x60ec('0x10')];this['predictiveIntervalAnsweredCalls']=_0x10ec80[_0x60ec('0x2f')];this[_0x60ec('0x30')]=_0x10ec80[_0x60ec('0x30')];this[_0x60ec('0x31')]=_0x10ec80['predictiveIntervalAvgTalktime'];this[_0x60ec('0x32')]=_0x10ec80[_0x60ec('0x32')];this[_0x60ec('0x33')]=_0x10ec80[_0x60ec('0x33')];this[_0x60ec('0x34')]=_0x10ec80[_0x60ec('0x34')];this[_0x60ec('0x35')]=_0x10ec80[_0x60ec('0x35')];this[_0x60ec('0x36')]=_0x10ec80[_0x60ec('0x36')];this[_0x60ec('0x37')]=_0x10ec80[_0x60ec('0x37')];this[_0x60ec('0x38')]=_0x10ec80[_0x60ec('0x38')];this[_0x60ec('0x39')]=_0x10ec80[_0x60ec('0x39')];this[_0x60ec('0x3a')]=_0x10ec80['predictiveIntervalTotalCalls'];this[_0x60ec('0x8')]=_0x10ec80[_0x60ec('0x8')];this['erlangCalls']=_0x10ec80[_0x60ec('0x3b')];this['erlangCallToSecond']=_0x10ec80[_0x60ec('0x3c')];this[_0x60ec('0x3d')]=_0x10ec80[_0x60ec('0x3d')];this[_0x60ec('0x3e')]=_0x10ec80[_0x60ec('0x3e')];this[_0x60ec('0x3f')]=_0x10ec80[_0x60ec('0x3f')];this['startProgressive']=_0x10ec80['startProgressive'];this['message']=_0x10ec80[_0x60ec('0x40')];this['statusMessage']=_0x10ec80[_0x60ec('0x41')];}if(_0x10ec80[_0x60ec('0x42')]){this['Trunk']={'id':_0x10ec80[_0x60ec('0x42')]['id'],'name':_0x10ec80['Trunk']['name'],'active':_0x10ec80['Trunk'][_0x60ec('0x43')],'callerid':_0x10ec80[_0x60ec('0x42')][_0x60ec('0x44')]};}}VoiceQueueSummary[_0x60ec('0x45')]['createReport']=function(_0x3bb831,_0x1bee8d,_0xdaf11b,_0x2de1d6){this[_0x60ec('0x7')]=0x0;this[_0x60ec('0x3')]=0x0;this[_0x60ec('0x1')]=0x0;this[_0x60ec('0x1e')]=0x0;this[_0x60ec('0x1a')]=0x0;this[_0x60ec('0x6')]=0x0;this[_0x60ec('0x16')]=0x0;this[_0x60ec('0x17')]=0x0;this[_0x60ec('0x46')]=0x0;this[_0x60ec('0x2')]=0x0;this['ringInUse']=0x0;this[_0x60ec('0x19')]=0x0;if(_0xdaf11b){if(_0xdaf11b[_0x60ec('0x0')]){this['available']=Number(_0xdaf11b[_0x60ec('0x0')]);}if(_0xdaf11b['loggedin']){this[_0x60ec('0x18')]=Number(_0xdaf11b[_0x60ec('0x47')]);}if(_0xdaf11b[_0x60ec('0x48')]){this[_0x60ec('0x4')]=Number(_0xdaf11b[_0x60ec('0x48')]);}}for(var _0x52a668=0x0;_0x52a668<_0x3bb831[_0x60ec('0x49')];_0x52a668++){var _0x5bb833=_0x1bee8d[_0x60ec('0x4a')+_0x3bb831[_0x52a668][_0x60ec('0x4b')]];if(_0x5bb833&&_0x5bb833[_0x60ec('0x4c')]){this[_0x60ec('0x7')]+=0x1;}if(_0x3bb831[_0x52a668][_0x60ec('0x4d')]==='1'){this['talking']+=0x1;}if(_0x3bb831[_0x52a668][_0x60ec('0x1')]==='1'&&!['2','7','8']['includes'](_0x3bb831[_0x52a668][_0x60ec('0x4e')])){this[_0x60ec('0x1')]+=0x1;}switch(_0x3bb831[_0x52a668]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0x60ec('0x1a')]+=0x1;break;case'2':this[_0x60ec('0x6')]+=0x1;break;case'3':this[_0x60ec('0x16')]+=0x1;break;case'4':this[_0x60ec('0x17')]+=0x1;break;case'5':this[_0x60ec('0x46')]+=0x1;break;case'6':this[_0x60ec('0x2')]+=0x1;break;case'7':this[_0x60ec('0x1b')]+=0x1;break;case'8':this[_0x60ec('0x19')]+=0x1;break;}}if(this[_0x60ec('0x22')]===_0x60ec('0x4f')){var _0xc3c51d=Object[_0x60ec('0x50')](_0x2de1d6);for(var _0x43bfcf=0x0;_0x43bfcf<_0xc3c51d[_0x60ec('0x49')];_0x43bfcf++){var _0x327401=_0xc3c51d[_0x43bfcf];var _0x4f6653=_0x2de1d6[_0x327401];if(_0x4f6653[_0x60ec('0x51')]===this[_0x60ec('0x4b')]&&_0x4f6653[_0x60ec('0x1d')]===_0x60ec('0x52')&&_0x4f6653[_0x60ec('0x53')]==='xcally-motion-preview'){this[_0x60ec('0x3')]+=0x1;}}if(this['talking']>this[_0x60ec('0x6')]){this[_0x60ec('0x3')]=this['inUse'];}this[_0x60ec('0x20')]=0x0;}return this;};VoiceQueueSummary[_0x60ec('0x45')]['compareToInboundQueue']=function(_0x572450){var _0x17f085=![];if(_0x572450){_0x17f085=INBOUND_COUNTERS['some'](function(_0x4a5c57){return this[_0x4a5c57]!==_0x572450[_0x4a5c57];},this);}return _0x17f085;};VoiceQueueSummary[_0x60ec('0x45')]['compareToOutboundQueue']=function(_0x31aa1b){var _0x41a87f=![];var _0x4874f0=![];var _0x2af33e=![];if(_0x31aa1b){_0x41a87f=this[_0x60ec('0x22')]!==_0x31aa1b[_0x60ec('0x22')]||this['dialActive']!==_0x31aa1b[_0x60ec('0x21')]||this[_0x60ec('0x40')]!==_0x31aa1b[_0x60ec('0x40')]||this[_0x60ec('0x41')]!==_0x31aa1b[_0x60ec('0x41')];_0x4874f0=OUTBOUND_COUNTERS[_0x60ec('0x54')](function(_0x33458c){return this[_0x33458c]!==_0x31aa1b[_0x33458c];},this);if(this[_0x60ec('0x42')]&&_0x31aa1b['Trunk']){_0x2af33e=this[_0x60ec('0x42')][_0x60ec('0x4b')]!==_0x31aa1b[_0x60ec('0x42')][_0x60ec('0x4b')]||this['Trunk'][_0x60ec('0x43')]!==_0x31aa1b[_0x60ec('0x42')][_0x60ec('0x43')];}}return _0x41a87f||_0x4874f0||_0x2af33e;};VoiceQueueSummary['prototype'][_0x60ec('0x55')]=function(_0x3c233e){this[_0x60ec('0x5')]=_0x3c233e[_0x60ec('0x5')];this['message']=_0x3c233e[_0x60ec('0x40')];this['statusMessage']=_0x3c233e[_0x60ec('0x41')];this['originated']=_0x3c233e['originated'];this[_0x60ec('0x9')]=_0x3c233e[_0x60ec('0x9')];this['outboundAnswerCallsDay']=_0x3c233e[_0x60ec('0xa')];this[_0x60ec('0x29')]=_0x3c233e[_0x60ec('0x29')];this[_0x60ec('0xb')]=_0x3c233e[_0x60ec('0xb')];this[_0x60ec('0x2a')]=_0x3c233e[_0x60ec('0x2a')];this['outboundNoAnswerCallsDay']=_0x3c233e['outboundNoAnswerCallsDay'];this[_0x60ec('0xd')]=_0x3c233e[_0x60ec('0xd')];this[_0x60ec('0xe')]=_0x3c233e['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x3c233e[_0x60ec('0xf')];this['outboundUnknownCallsDay']=_0x3c233e[_0x60ec('0x10')];this[_0x60ec('0x11')]=_0x3c233e[_0x60ec('0x11')];this[_0x60ec('0x12')]=_0x3c233e[_0x60ec('0x12')];this[_0x60ec('0x13')]=_0x3c233e['total'];if(this[_0x60ec('0x22')]===_0x60ec('0x56')){this['pTalking']=_0x3c233e['pTalking'];}};module[_0x60ec('0x57')]=VoiceQueueSummary; \ No newline at end of file +var _0x08d9=['startProgressive','message','statusMessage','Trunk','name','active','callerid','prototype','createReport','busy','callers','length','SIP/','online','includes','status','booked','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','exports','available','loggedInDb','ringing','talking','waiting','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','sumBillable','sumDuration','total','strategy','abandoned','answered','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor'];(function(_0x48b122,_0x2e66d2){var _0x5f573a=function(_0x3b0901){while(--_0x3b0901){_0x48b122['push'](_0x48b122['shift']());}};_0x5f573a(++_0x2e66d2);}(_0x08d9,0xc2));var _0x908d=function(_0x2af191,_0x243faa){_0x2af191=_0x2af191-0x0;var _0x4fe5af=_0x08d9[_0x2af191];return _0x4fe5af;};'use strict';var INBOUND_COUNTERS=[_0x908d('0x0'),'loggedIn',_0x908d('0x1'),'paused',_0x908d('0x2'),_0x908d('0x3'),_0x908d('0x4')];var OUTBOUND_COUNTERS=['available','answered',_0x908d('0x5'),_0x908d('0x6'),_0x908d('0x1'),_0x908d('0x7'),_0x908d('0x8'),'outboundAnswerCallsDay',_0x908d('0x9'),_0x908d('0xa'),_0x908d('0xb'),_0x908d('0xc'),_0x908d('0xd'),_0x908d('0xe'),_0x908d('0xf'),_0x908d('0x10'),_0x908d('0x11'),_0x908d('0x12'),'talking',_0x908d('0x13'),_0x908d('0x14'),_0x908d('0x15'),_0x908d('0x4')];function VoiceQueueSummary(_0xf39c48){this['id']=_0xf39c48['id'];this['name']=_0xf39c48['name'];this['strategy']=_0xf39c48[_0x908d('0x16')];this[_0x908d('0x17')]=_0xf39c48[_0x908d('0x17')]||0x0;this[_0x908d('0x18')]=_0xf39c48[_0x908d('0x18')]||0x0;this[_0x908d('0x0')]=_0xf39c48[_0x908d('0x0')]||0x0;this['busy']=_0xf39c48['busy']||0x0;this[_0x908d('0x5')]=_0xf39c48[_0x908d('0x5')]||0x0;this[_0x908d('0x19')]=_0xf39c48[_0x908d('0x19')]||0x0;this['loggedIn']=_0xf39c48['loggedIn']||0x0;this[_0x908d('0x1')]=_0xf39c48[_0x908d('0x1')]||0x0;this[_0x908d('0x1a')]=_0xf39c48[_0x908d('0x1a')]||0x0;this['notInUse']=_0xf39c48[_0x908d('0x1b')]||0x0;this[_0x908d('0x11')]=_0xf39c48[_0x908d('0x11')]||0x0;this[_0x908d('0x2')]=_0xf39c48[_0x908d('0x2')]||0x0;this[_0x908d('0x1c')]=_0xf39c48[_0x908d('0x1c')];this['sumBillable']=_0xf39c48[_0x908d('0x13')];this[_0x908d('0x14')]=_0xf39c48[_0x908d('0x14')];this['sumHoldTime']=_0xf39c48[_0x908d('0x1d')]||0x0;this[_0x908d('0x3')]=_0xf39c48[_0x908d('0x3')]||0x0;this[_0x908d('0x15')]=_0xf39c48[_0x908d('0x15')]||0x0;this['type']=_0xf39c48[_0x908d('0x1e')];this['unavailable']=_0xf39c48[_0x908d('0x1f')]||0x0;this[_0x908d('0x20')]=_0xf39c48[_0x908d('0x20')]||0x0;this[_0x908d('0x21')]=_0xf39c48[_0x908d('0x21')]||0x0;this[_0x908d('0x4')]=_0xf39c48[_0x908d('0x4')]||0x0;if(_0xf39c48[_0x908d('0x1e')]==='outbound'){this[_0x908d('0x12')]=_0xf39c48[_0x908d('0x12')]||0x0;this[_0x908d('0x22')]=_0xf39c48[_0x908d('0x22')];this[_0x908d('0x23')]=_0xf39c48['dialMethod'];this['dialOriginateCallerIdName']=_0xf39c48[_0x908d('0x24')];this[_0x908d('0x25')]=_0xf39c48[_0x908d('0x25')];this[_0x908d('0x26')]=_0xf39c48[_0x908d('0x26')];this['dialPrefix']=_0xf39c48[_0x908d('0x27')];this[_0x908d('0x28')]=_0xf39c48['temp'];this[_0x908d('0x29')]=_0xf39c48[_0x908d('0x29')];this[_0x908d('0x2a')]=_0xf39c48[_0x908d('0x2a')];this[_0x908d('0x9')]=_0xf39c48[_0x908d('0x9')];this[_0x908d('0xa')]=_0xf39c48[_0x908d('0xa')];this[_0x908d('0xb')]=_0xf39c48[_0x908d('0xb')];this[_0x908d('0x2b')]=_0xf39c48['outboundDropCallsDayACS'];this[_0x908d('0x2c')]=_0xf39c48[_0x908d('0x2c')];this[_0x908d('0x2d')]=_0xf39c48[_0x908d('0x2d')];this['outboundNoAnswerCallsDay']=_0xf39c48[_0x908d('0xc')];this[_0x908d('0xd')]=_0xf39c48[_0x908d('0xd')];this[_0x908d('0x2e')]=_0xf39c48[_0x908d('0x2e')];this[_0x908d('0xe')]=_0xf39c48[_0x908d('0xe')];this[_0x908d('0xf')]=_0xf39c48[_0x908d('0xf')];this[_0x908d('0x10')]=_0xf39c48[_0x908d('0x10')];this['predictiveIntervalAnsweredCalls']=_0xf39c48['predictiveIntervalAnsweredCalls'];this[_0x908d('0x2f')]=_0xf39c48[_0x908d('0x2f')];this['predictiveIntervalAvgTalktime']=_0xf39c48['predictiveIntervalAvgTalktime'];this[_0x908d('0x30')]=_0xf39c48[_0x908d('0x30')];this[_0x908d('0x31')]=_0xf39c48[_0x908d('0x31')];this[_0x908d('0x32')]=_0xf39c48['predictiveIntervalErlangCalls'];this[_0x908d('0x33')]=_0xf39c48[_0x908d('0x33')];this[_0x908d('0x34')]=_0xf39c48[_0x908d('0x34')];this[_0x908d('0x35')]=_0xf39c48['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0xf39c48[_0x908d('0x36')];this['predictiveIntervalAvailable']=_0xf39c48[_0x908d('0x37')];this[_0x908d('0x38')]=_0xf39c48[_0x908d('0x38')];this[_0x908d('0x7')]=_0xf39c48[_0x908d('0x7')];this[_0x908d('0x39')]=_0xf39c48[_0x908d('0x39')];this[_0x908d('0x3a')]=_0xf39c48['erlangCallToSecond'];this['erlangAbandonmentRate']=_0xf39c48[_0x908d('0x3b')];this[_0x908d('0x3c')]=_0xf39c48[_0x908d('0x3c')];this['startPredictive']=_0xf39c48['startPredictive'];this['startProgressive']=_0xf39c48[_0x908d('0x3d')];this['message']=_0xf39c48[_0x908d('0x3e')];this[_0x908d('0x3f')]=_0xf39c48[_0x908d('0x3f')];}if(_0xf39c48['Trunk']){this['Trunk']={'id':_0xf39c48['Trunk']['id'],'name':_0xf39c48[_0x908d('0x40')][_0x908d('0x41')],'active':_0xf39c48['Trunk'][_0x908d('0x42')],'callerid':_0xf39c48['Trunk'][_0x908d('0x43')]};}}VoiceQueueSummary[_0x908d('0x44')][_0x908d('0x45')]=function(_0x5bf839,_0x24dc93,_0x375d21,_0xd48ecd){this[_0x908d('0x1')]=0x0;this['talking']=0x0;this[_0x908d('0x11')]=0x0;this[_0x908d('0x20')]=0x0;this[_0x908d('0x1b')]=0x0;this[_0x908d('0x5')]=0x0;this[_0x908d('0x46')]=0x0;this['invalid']=0x0;this[_0x908d('0x1f')]=0x0;this[_0x908d('0x2')]=0x0;this[_0x908d('0x1c')]=0x0;this[_0x908d('0x1a')]=0x0;if(_0x375d21){if(_0x375d21[_0x908d('0x0')]){this[_0x908d('0x0')]=Number(_0x375d21['available']);}if(_0x375d21['loggedin']){this[_0x908d('0x6')]=Number(_0x375d21['loggedin']);}if(_0x375d21[_0x908d('0x47')]){this[_0x908d('0x4')]=Number(_0x375d21['callers']);}}for(var _0xe527c1=0x0;_0xe527c1<_0x5bf839[_0x908d('0x48')];_0xe527c1++){var _0x53dccb=_0x24dc93[_0x908d('0x49')+_0x5bf839[_0xe527c1][_0x908d('0x41')]];if(_0x53dccb&&_0x53dccb[_0x908d('0x4a')]){this[_0x908d('0x1')]+=0x1;}if(_0x5bf839[_0xe527c1]['incall']==='1'){this[_0x908d('0x3')]+=0x1;}if(_0x5bf839[_0xe527c1]['paused']==='1'&&!['2','7','8'][_0x908d('0x4b')](_0x5bf839[_0xe527c1][_0x908d('0x4c')])){this['paused']+=0x1;}switch(_0x5bf839[_0xe527c1][_0x908d('0x4c')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x908d('0x5')]+=0x1;break;case'3':this[_0x908d('0x46')]+=0x1;break;case'4':this[_0x908d('0x19')]+=0x1;break;case'5':this[_0x908d('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x908d('0x23')]===_0x908d('0x4d')){var _0x41c502=Object[_0x908d('0x4e')](_0xd48ecd);for(var _0x44d091=0x0;_0x44d091<_0x41c502[_0x908d('0x48')];_0x44d091++){var _0x3f5d4f=_0x41c502[_0x44d091];var _0x32ee94=_0xd48ecd[_0x3f5d4f];if(_0x32ee94['queue']===this[_0x908d('0x41')]&&_0x32ee94['type']===_0x908d('0x4f')&&_0x32ee94[_0x908d('0x50')]===_0x908d('0x51')){this[_0x908d('0x3')]+=0x1;}}if(this['talking']>this['inUse']){this[_0x908d('0x3')]=this[_0x908d('0x5')];}this[_0x908d('0x12')]=0x0;}return this;};VoiceQueueSummary[_0x908d('0x44')][_0x908d('0x52')]=function(_0x32404b){var _0x27f91a=![];if(_0x32404b){_0x27f91a=INBOUND_COUNTERS[_0x908d('0x53')](function(_0x176039){return this[_0x176039]!==_0x32404b[_0x176039];},this);}return _0x27f91a;};VoiceQueueSummary[_0x908d('0x44')]['compareToOutboundQueue']=function(_0x160a65){var _0x3a357f=![];var _0x4d8abe=![];var _0x5d98f8=![];if(_0x160a65){_0x3a357f=this[_0x908d('0x23')]!==_0x160a65['dialMethod']||this[_0x908d('0x22')]!==_0x160a65[_0x908d('0x22')]||this['message']!==_0x160a65['message']||this[_0x908d('0x3f')]!==_0x160a65[_0x908d('0x3f')];_0x4d8abe=OUTBOUND_COUNTERS['some'](function(_0x38936d){return this[_0x38936d]!==_0x160a65[_0x38936d];},this);if(this[_0x908d('0x40')]&&_0x160a65[_0x908d('0x40')]){_0x5d98f8=this[_0x908d('0x40')][_0x908d('0x41')]!==_0x160a65[_0x908d('0x40')][_0x908d('0x41')]||this[_0x908d('0x40')][_0x908d('0x42')]!==_0x160a65[_0x908d('0x40')][_0x908d('0x42')];}}return _0x3a357f||_0x4d8abe||_0x5d98f8;};VoiceQueueSummary[_0x908d('0x44')]['updateReportFromOutboundQueue']=function(_0x501fc7){this[_0x908d('0x18')]=_0x501fc7['answered'];this[_0x908d('0x3e')]=_0x501fc7[_0x908d('0x3e')];this[_0x908d('0x3f')]=_0x501fc7[_0x908d('0x3f')];this[_0x908d('0x7')]=_0x501fc7[_0x908d('0x7')];this[_0x908d('0x8')]=_0x501fc7[_0x908d('0x8')];this[_0x908d('0x2a')]=_0x501fc7[_0x908d('0x2a')];this['outboundBlacklistCallsDay']=_0x501fc7[_0x908d('0x9')];this[_0x908d('0xa')]=_0x501fc7[_0x908d('0xa')];this[_0x908d('0xb')]=_0x501fc7[_0x908d('0xb')];this[_0x908d('0xc')]=_0x501fc7['outboundNoAnswerCallsDay'];this[_0x908d('0xd')]=_0x501fc7['outboundNoSuchCallsDay'];this[_0x908d('0xe')]=_0x501fc7[_0x908d('0xe')];this[_0x908d('0xf')]=_0x501fc7[_0x908d('0xf')];this[_0x908d('0x10')]=_0x501fc7[_0x908d('0x10')];this['sumBillable']=_0x501fc7[_0x908d('0x13')];this[_0x908d('0x14')]=_0x501fc7[_0x908d('0x14')];this[_0x908d('0x15')]=_0x501fc7[_0x908d('0x15')];if(this[_0x908d('0x23')]==='preview'){this[_0x908d('0x12')]=_0x501fc7[_0x908d('0x12')];}};module[_0x908d('0x54')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 952a9e3..ee41196 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 _0x96f8=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x96f8,0x15c));var _0x896f=function(_0x126087,_0x272d31){_0x126087=_0x126087-0x0;var _0x319244=_0x96f8[_0x126087];return _0x319244;};'use strict';function VtigerAccount(_0x557a55){this['id']=_0x557a55['id']||0x0;this[_0x896f('0x0')]=_0x557a55['name']||'';this[_0x896f('0x1')]=_0x557a55['username']||'';this[_0x896f('0x2')]=_0x557a55['accessKey']||'';this[_0x896f('0x3')]=_0x557a55[_0x896f('0x3')]||'';this[_0x896f('0x4')]=_0x557a55[_0x896f('0x4')]||'';this[_0x896f('0x5')]=_0x557a55[_0x896f('0x5')]||{};}module[_0x896f('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd3e3=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd3e3,0xdd));var _0x3d3e=function(_0x28c02d,_0x32daa3){_0x28c02d=_0x28c02d-0x0;var _0x4a81f5=_0xd3e3[_0x28c02d];return _0x4a81f5;};'use strict';function VtigerAccount(_0x41fc16){this['id']=_0x41fc16['id']||0x0;this[_0x3d3e('0x0')]=_0x41fc16[_0x3d3e('0x0')]||'';this[_0x3d3e('0x1')]=_0x41fc16['username']||'';this[_0x3d3e('0x2')]=_0x41fc16[_0x3d3e('0x2')]||'';this['remoteUri']=_0x41fc16[_0x3d3e('0x3')]||'';this[_0x3d3e('0x4')]=_0x41fc16['serverUrl']||'';this[_0x3d3e('0x5')]=_0x41fc16[_0x3d3e('0x5')]||{};}module[_0x3d3e('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 7929db1..b4dda68 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 _0x715f=['type','integrationTab','serverUrl','exports','name','username','password','token','remoteUri','authType'];(function(_0x5ac45b,_0x5b1f51){var _0x67fb=function(_0x48b5fc){while(--_0x48b5fc){_0x5ac45b['push'](_0x5ac45b['shift']());}};_0x67fb(++_0x5b1f51);}(_0x715f,0x1ee));var _0xf715=function(_0x4e4505,_0x53320d){_0x4e4505=_0x4e4505-0x0;var _0x5ba35d=_0x715f[_0x4e4505];return _0x5ba35d;};'use strict';function ZendeskAccount(_0xde7c3e){this['id']=_0xde7c3e['id']||0x0;this[_0xf715('0x0')]=_0xde7c3e[_0xf715('0x0')]||'';this[_0xf715('0x1')]=_0xde7c3e[_0xf715('0x1')]||'';this[_0xf715('0x2')]=_0xde7c3e[_0xf715('0x2')]||'';this[_0xf715('0x3')]=_0xde7c3e[_0xf715('0x3')]||'';this[_0xf715('0x4')]=_0xde7c3e['remoteUri']||'';this[_0xf715('0x5')]=_0xde7c3e[_0xf715('0x5')]||'';this[_0xf715('0x6')]=_0xde7c3e[_0xf715('0x6')]||_0xf715('0x7');this[_0xf715('0x8')]=_0xde7c3e['serverUrl']||'';this['Configurations']=_0xde7c3e['Configurations']||{};}module[_0xf715('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xa247=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x249f8c,_0xfb3946){var _0x5e224a=function(_0xd4c5a1){while(--_0xd4c5a1){_0x249f8c['push'](_0x249f8c['shift']());}};_0x5e224a(++_0xfb3946);}(_0xa247,0x19a));var _0x7a24=function(_0x5708d4,_0x46e835){_0x5708d4=_0x5708d4-0x0;var _0x4eade3=_0xa247[_0x5708d4];return _0x4eade3;};'use strict';function ZendeskAccount(_0x246334){this['id']=_0x246334['id']||0x0;this[_0x7a24('0x0')]=_0x246334[_0x7a24('0x0')]||'';this[_0x7a24('0x1')]=_0x246334[_0x7a24('0x1')]||'';this[_0x7a24('0x2')]=_0x246334[_0x7a24('0x2')]||'';this['token']=_0x246334[_0x7a24('0x3')]||'';this[_0x7a24('0x4')]=_0x246334[_0x7a24('0x4')]||'';this[_0x7a24('0x5')]=_0x246334[_0x7a24('0x5')]||'';this[_0x7a24('0x6')]=_0x246334['type']||'integrationTab';this['serverUrl']=_0x246334[_0x7a24('0x7')]||'';this[_0x7a24('0x8')]=_0x246334['Configurations']||{};}module[_0x7a24('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 339803e..f664e3a 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 _0xc7c9=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x54cb1a,_0x5ca2fc){var _0x217c35=function(_0x27fca2){while(--_0x27fca2){_0x54cb1a['push'](_0x54cb1a['shift']());}};_0x217c35(++_0x5ca2fc);}(_0xc7c9,0x193));var _0x9c7c=function(_0x194f35,_0x10192f){_0x194f35=_0x194f35-0x0;var _0x25fa1a=_0xc7c9[_0x194f35];return _0x25fa1a;};'use strict';function ZohoAccount(_0x1113ef){this['id']=_0x1113ef['id']||0x0;this['name']=_0x1113ef[_0x9c7c('0x0')]||'';this[_0x9c7c('0x1')]=_0x1113ef[_0x9c7c('0x1')]||'';this[_0x9c7c('0x2')]=_0x1113ef[_0x9c7c('0x2')]||'';this[_0x9c7c('0x3')]=_0x1113ef['zone']||'';this['clientId']=_0x1113ef[_0x9c7c('0x4')]||'';this['clientSecret']=_0x1113ef[_0x9c7c('0x5')]||'';this[_0x9c7c('0x6')]=_0x1113ef[_0x9c7c('0x6')]||'';this[_0x9c7c('0x7')]=_0x1113ef['code']||'';this[_0x9c7c('0x8')]=_0x1113ef[_0x9c7c('0x8')]||'';this[_0x9c7c('0x9')]=_0x1113ef[_0x9c7c('0x9')]||{};}module[_0x9c7c('0xa')]=ZohoAccount; \ No newline at end of file +var _0x56c3=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x56c3,0x135));var _0x356c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56c3[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x41f875){this['id']=_0x41f875['id']||0x0;this[_0x356c('0x0')]=_0x41f875[_0x356c('0x0')]||'';this[_0x356c('0x1')]=_0x41f875['description']||'';this[_0x356c('0x2')]=_0x41f875['host']||'';this[_0x356c('0x3')]=_0x41f875[_0x356c('0x3')]||'';this[_0x356c('0x4')]=_0x41f875['clientId']||'';this[_0x356c('0x5')]=_0x41f875['clientSecret']||'';this[_0x356c('0x6')]=_0x41f875[_0x356c('0x6')]||'';this[_0x356c('0x7')]=_0x41f875[_0x356c('0x7')]||'';this[_0x356c('0x8')]=_0x41f875['refreshToken']||'';this[_0x356c('0x9')]=_0x41f875[_0x356c('0x9')]||{};}module[_0x356c('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 e2b6496..4881c20 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 _0xbbbc=['idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','Contact','phone','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','string','isNil','uniqueid'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x29165d,_0x221063){_0x29165d=_0x29165d-0x0;var _0x3dd8f9=_0xbbbc[_0x29165d];return _0x3dd8f9;};'use strict';var util=require(_0xcbbb('0x0'));var _=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));function checkNameSurname(_0x4538f9,_0x3ec75b,_0x3e91a2){var _0x464b75='';if(!_['isNil'](_0x3ec75b)&&_0xcbbb('0x3')===typeof _0x3ec75b){_0x464b75+=_0x3ec75b;}if(!_[_0xcbbb('0x4')](_0x3e91a2)&&_0xcbbb('0x3')===typeof _0x3e91a2){_0x464b75+='\x20'+_0x3e91a2;}if(_0x464b75!==''){return _0x464b75;}return _0x4538f9;}function Action(_0x3ccbf6,_0x43ff05,_0x4978a9,_0x388197,_0x1796b4){this[_0xcbbb('0x5')]=_0x4978a9||undefined;this[_0xcbbb('0x6')]=_0x3ccbf6['id'];this[_0xcbbb('0x7')]=_0x43ff05[_0xcbbb('0x8')];this[_0xcbbb('0x9')]=_0x43ff05['type'];this[_0xcbbb('0xa')]='queue';this['dialAnswer']=![];this[_0xcbbb('0xb')]=_['isNil'](_0x3ccbf6[_0xcbbb('0xc')])?undefined:_0x3ccbf6['Agent'][_0xcbbb('0x8')];this[_0xcbbb('0xd')]=this['membername']?util[_0xcbbb('0xe')]('SIP/%s',this[_0xcbbb('0xb')]):_0x388197||undefined;this['calleridname']=checkNameSurname(_0x3ccbf6[_0xcbbb('0xf')][_0xcbbb('0x10')],_0x3ccbf6[_0xcbbb('0xf')]['firstName'],_0x3ccbf6[_0xcbbb('0xf')][_0xcbbb('0x11')]);this[_0xcbbb('0x12')]=_0x3ccbf6[_0xcbbb('0x12')]||![];this['calleridnum']=_0x3ccbf6['phone'];this[_0xcbbb('0x13')]=_0x3ccbf6[_0xcbbb('0x13')];this[_0xcbbb('0x14')]=_0x3ccbf6[_0xcbbb('0x14')]||0x0;this['countcongestionretry']=_0x3ccbf6[_0xcbbb('0x15')]||0x0;this['countnoanswerretry']=_0x3ccbf6[_0xcbbb('0x16')]||0x0;this[_0xcbbb('0x17')]=(_0x3ccbf6[_0xcbbb('0x14')]||0x0)+(_0x3ccbf6['countcongestionretry']||0x0)+(_0x3ccbf6['countnoanswerretry']||0x0)+(_0x3ccbf6['countnosuchnumberretry']||0x0)+(_0x3ccbf6[_0xcbbb('0x18')]||0x0)+(_0x3ccbf6[_0xcbbb('0x19')]||0x0)+(_0x3ccbf6[_0xcbbb('0x1a')]||0x0)+(_0x3ccbf6[_0xcbbb('0x1b')]||0x0);this[_0xcbbb('0x1c')]=_0x3ccbf6[_0xcbbb('0x1c')]||0x0;this[_0xcbbb('0x18')]=_0x3ccbf6[_0xcbbb('0x18')]||0x0;this[_0xcbbb('0x19')]=_0x3ccbf6[_0xcbbb('0x19')]||0x0;this['countmachineretry']=_0x3ccbf6[_0xcbbb('0x1a')]||0x0;this[_0xcbbb('0x1b')]=_0x3ccbf6[_0xcbbb('0x1b')]||0x0;this[_0xcbbb('0x1d')]=_0x3ccbf6[_0xcbbb('0x1d')];this[_0xcbbb('0x1e')]=_0x3ccbf6[_0xcbbb('0x1e')];this[_0xcbbb('0x1f')]=_0x3ccbf6[_0xcbbb('0x1f')];this['recallme']=_0x3ccbf6[_0xcbbb('0x20')];this[_0xcbbb('0x21')]=_0x3ccbf6['ContactId'];this[_0xcbbb('0x22')]=_0x3ccbf6['ListId'];this['UserId']=_[_0xcbbb('0x4')](_0x3ccbf6[_0xcbbb('0xc')])?_0x3ccbf6['UserId']:_0x3ccbf6['Agent']['id'];this['VoiceQueueId']=_0x3ccbf6[_0xcbbb('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xcbbb('0x24')][_0xcbbb('0x25')]=function(){return util[_0xcbbb('0xe')](_0xcbbb('0x26'),this[_0xcbbb('0x27')],this[_0xcbbb('0x28')]);};module[_0xcbbb('0x29')]=Action; \ No newline at end of file +var _0x3423=['Agent','membername','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','prototype','getCaller','format','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3342('0x0'));function checkNameSurname(_0x16bdb3,_0x3477de,_0x3b763d){var _0x21bdc2='';if(!_[_0x3342('0x1')](_0x3477de)&&_0x3342('0x2')===typeof _0x3477de){_0x21bdc2+=_0x3477de;}if(!_[_0x3342('0x1')](_0x3b763d)&&_0x3342('0x2')===typeof _0x3b763d){_0x21bdc2+='\x20'+_0x3b763d;}if(_0x21bdc2!==''){return _0x21bdc2;}return _0x16bdb3;}function Action(_0x19206f,_0x467453,_0x2ccbe0,_0x29c40c,_0x420d4b){this[_0x3342('0x3')]=_0x2ccbe0||undefined;this[_0x3342('0x4')]=_0x19206f['id'];this[_0x3342('0x5')]=_0x467453[_0x3342('0x6')];this[_0x3342('0x7')]=_0x467453['type'];this['campaigntype']=_0x3342('0x5');this['dialAnswer']=![];this['membername']=_['isNil'](_0x19206f['Agent'])?undefined:_0x19206f[_0x3342('0x8')][_0x3342('0x6')];this['channelAgent']=this[_0x3342('0x9')]?util['format'](_0x3342('0xa'),this[_0x3342('0x9')]):_0x29c40c||undefined;this['calleridname']=checkNameSurname(_0x19206f[_0x3342('0xb')][_0x3342('0xc')],_0x19206f[_0x3342('0xb')][_0x3342('0xd')],_0x19206f[_0x3342('0xb')][_0x3342('0xe')]);this[_0x3342('0xf')]=_0x19206f['active']||![];this[_0x3342('0x10')]=_0x19206f[_0x3342('0xc')];this['scheduledat']=_0x19206f[_0x3342('0x11')];this[_0x3342('0x12')]=_0x19206f['countbusyretry']||0x0;this['countcongestionretry']=_0x19206f[_0x3342('0x13')]||0x0;this[_0x3342('0x14')]=_0x19206f[_0x3342('0x14')]||0x0;this[_0x3342('0x15')]=(_0x19206f[_0x3342('0x12')]||0x0)+(_0x19206f[_0x3342('0x13')]||0x0)+(_0x19206f[_0x3342('0x14')]||0x0)+(_0x19206f[_0x3342('0x16')]||0x0)+(_0x19206f[_0x3342('0x17')]||0x0)+(_0x19206f['countabandonedretry']||0x0)+(_0x19206f[_0x3342('0x18')]||0x0)+(_0x19206f[_0x3342('0x19')]||0x0);this[_0x3342('0x16')]=_0x19206f['countnosuchnumberretry']||0x0;this[_0x3342('0x17')]=_0x19206f[_0x3342('0x17')]||0x0;this['countabandonedretry']=_0x19206f[_0x3342('0x1a')]||0x0;this[_0x3342('0x18')]=_0x19206f['countmachineretry']||0x0;this[_0x3342('0x19')]=_0x19206f['countagentrejectretry']||0x0;this[_0x3342('0x1b')]=_0x19206f[_0x3342('0x1b')];this[_0x3342('0x1c')]=_0x19206f[_0x3342('0x1c')];this[_0x3342('0x1d')]=_0x19206f[_0x3342('0x1d')];this[_0x3342('0x1e')]=_0x19206f[_0x3342('0x1e')];this['ContactId']=_0x19206f[_0x3342('0x1f')];this['ListId']=_0x19206f['ListId'];this[_0x3342('0x20')]=_['isNil'](_0x19206f['Agent'])?_0x19206f[_0x3342('0x20')]:_0x19206f['Agent']['id'];this[_0x3342('0x21')]=_0x19206f['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3342('0x22')][_0x3342('0x23')]=function(){return util[_0x3342('0x24')]('\x22%s\x22\x20<%s>',this[_0x3342('0x25')],this[_0x3342('0x26')]);};module[_0x3342('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 26db0d6..e848a0a 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4491e8,_0x53a72e){var _0x3f4930=function(_0x1cc640){while(--_0x1cc640){_0x4491e8['push'](_0x4491e8['shift']());}};_0x3f4930(++_0x53a72e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x36b74a,_0x3a4eb8){var _0x330a4f=function(_0x54f89d){while(--_0x54f89d){_0x36b74a['push'](_0x36b74a['shift']());}};_0x330a4f(++_0x3a4eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index dceb53c..202b8c5 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 _0x82db=['rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','resolve','create','[voiceQueueReport]\x20','getContactRecallMe'];(function(_0x1d3e1a,_0xdd175f){var _0x5741ec=function(_0x986fb7){while(--_0x986fb7){_0x1d3e1a['push'](_0x1d3e1a['shift']());}};_0x5741ec(++_0xdd175f);}(_0x82db,0x1df));var _0xb82d=function(_0x448279,_0x23a89d){_0x448279=_0x448279-0x0;var _0x44e688=_0x82db[_0x448279];return _0x44e688;};'use strict';var util=require('util');var BPromise=require(_0xb82d('0x0'));var logger=require(_0xb82d('0x1'))(_0xb82d('0x2'));var cmHopper=require(_0xb82d('0x3'));var cmHopperHistory=require(_0xb82d('0x4'));var cmHopperBlack=require(_0xb82d('0x5'));var agentReportPreview=require(_0xb82d('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x427a5b){return function(_0x5b3f7e){logger[_0xb82d('0x7')](_0x427a5b,util[_0xb82d('0x8')](_0x5b3f7e,{'showHidden':![],'depth':null}));};}function create(_0x3db2a5){return cmHopperHistory[_0xb82d('0x9')](_0x3db2a5)[_0xb82d('0xa')](loggerCatch(_0xb82d('0xb')));}function createAgent(_0x332454){return BPromise['resolve']()['then'](agentReportPreview[_0xb82d('0x9')](_0x332454))['catch'](loggerCatch(_0xb82d('0xb')));}function moveContact(_0xeee9d7){return cmHopper[_0xb82d('0xc')](_0xeee9d7,!![])[_0xb82d('0xa')](loggerCatch(_0xb82d('0xd')));}exports[_0xb82d('0xe')]=function(_0x3888a2){return cmHopperBlack[_0xb82d('0xe')](_0x3888a2)['catch'](loggerCatch(_0xb82d('0xf')));};exports[_0xb82d('0x10')]=function(_0x344062){return BPromise['resolve']()[_0xb82d('0x11')](cmHopper[_0xb82d('0x10')](_0x344062))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xb82d('0x9')]=function(_0x22fe79,_0x41d992){create(_0x22fe79)['catch'](loggerCatch(_0x41d992));moveContact(_0x22fe79)[_0xb82d('0xa')](loggerCatch(_0x41d992));};exports[_0xb82d('0x12')]=function(_0x11c881,_0x9d66cb){createAgent(_0x11c881)['catch'](loggerCatch(_0x9d66cb));};exports['createCustomerHistory']=function(_0x8a5795,_0x201763){create(_0x8a5795)[_0xb82d('0xa')](loggerCatch(_0x201763));};exports[_0xb82d('0x13')]=function(_0xa3a3eb,_0x2ba207){moveContact(_0xa3a3eb)[_0xb82d('0xa')](loggerCatch(_0x2ba207));};exports[_0xb82d('0x14')]=function(_0x1775da,_0x3ddfb9,_0x83c736){if(_0x3ddfb9){_0x1775da[_0xb82d('0x15')]=null;}if(_0x83c736){_0x1775da[_0xb82d('0x16')]=![];}return cmHopper['rescheduleContact'](_0x1775da)[_0xb82d('0xa')](loggerCatch(_0xb82d('0x17')));};exports[_0xb82d('0x18')]=function(_0x450ea4){return cmHopper[_0xb82d('0x18')](_0x450ea4)[_0xb82d('0xa')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x491eb0){return cmHopper[_0xb82d('0x19')]({'UserId':null},_0x491eb0,0x1)[_0xb82d('0xa')](loggerCatch(_0xb82d('0x1a')));};exports[_0xb82d('0x1b')]=function(_0x33def5){return cmHopper[_0xb82d('0x19')]({'active':![]},_0x33def5,0x1)[_0xb82d('0xa')](loggerCatch('[activeContact]\x20'));};exports[_0xb82d('0x1c')]=function(_0x52e6bc){var _0x36cb47={};_0x36cb47['type']=_0x52e6bc[_0xb82d('0x1d')];_0x36cb47['uniqueid']=_0x52e6bc['uniqueid'];_0x36cb47['calleridnum']=_0x52e6bc[_0xb82d('0x1e')];_0x36cb47[_0xb82d('0x1f')]=_0x52e6bc['calleridname'];_0x36cb47[_0xb82d('0x20')]=_0x52e6bc[_0xb82d('0x20')];_0x36cb47['queuecallerjoinAt']=_0x52e6bc[_0xb82d('0x21')];_0x36cb47[_0xb82d('0x22')]=_0x52e6bc[_0xb82d('0x21')];_0x36cb47[_0xb82d('0x23')]=0x1;_0x36cb47[_0xb82d('0x24')]=_0x52e6bc[_0xb82d('0x25')];_0x36cb47[_0xb82d('0x26')]=_0x52e6bc[_0xb82d('0x27')];_0x36cb47[_0xb82d('0x28')]=_0xb82d('0x29');_0x36cb47[_0xb82d('0x2a')]=_0xb82d('0x2b');_0x36cb47[_0xb82d('0x2c')]=0x0;_0x36cb47[_0xb82d('0x2d')]=0x1;_0x36cb47['lastAssignedTo']=_0x52e6bc[_0xb82d('0x27')];_0x36cb47[_0xb82d('0x2e')]='COMPLETED';return BPromise[_0xb82d('0x2f')]()['then'](voiceQueueReport[_0xb82d('0x30')](_0x36cb47))[_0xb82d('0xa')](loggerCatch(_0xb82d('0x31')));};exports[_0xb82d('0x32')]=function(_0x3ab4cd,_0x140fb0){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0x3ab4cd,_0x140fb0))[_0xb82d('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xb82d('0x33')]=function(_0x31de96){return cmHopper[_0xb82d('0x14')](_0x31de96,!![],!![])[_0xb82d('0xa')](loggerCatch(_0xb82d('0x34')));}; \ No newline at end of file +var _0x2293=['error','inspect','catch','[createHistory]\x20','resolve','then','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','COMPLETED','create','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/agentReportPreview','../rpc/voiceQueueReport'];(function(_0x2c6bb7,_0x2a846b){var _0x149a9d=function(_0xca9f82){while(--_0xca9f82){_0x2c6bb7['push'](_0x2c6bb7['shift']());}};_0x149a9d(++_0x2a846b);}(_0x2293,0x11b));var _0x3229=function(_0x1516de,_0x56e673){_0x1516de=_0x1516de-0x0;var _0x409e9e=_0x2293[_0x1516de];return _0x409e9e;};'use strict';var util=require(_0x3229('0x0'));var BPromise=require('bluebird');var logger=require(_0x3229('0x1'))(_0x3229('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x3229('0x3'));var voiceQueueReport=require(_0x3229('0x4'));function loggerCatch(_0x4bc84e){return function(_0x19aafe){logger[_0x3229('0x5')](_0x4bc84e,util[_0x3229('0x6')](_0x19aafe,{'showHidden':![],'depth':null}));};}function create(_0x405963){return cmHopperHistory['createHistory'](_0x405963)[_0x3229('0x7')](loggerCatch(_0x3229('0x8')));}function createAgent(_0x44c2e8){return BPromise[_0x3229('0x9')]()[_0x3229('0xa')](agentReportPreview[_0x3229('0xb')](_0x44c2e8))['catch'](loggerCatch(_0x3229('0x8')));}function moveContact(_0x3bbf61){return cmHopper[_0x3229('0xc')](_0x3bbf61,!![])[_0x3229('0x7')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x4f842f){return cmHopperBlack[_0x3229('0xd')](_0x4f842f)['catch'](loggerCatch(_0x3229('0xe')));};exports[_0x3229('0xf')]=function(_0x548777){return BPromise[_0x3229('0x9')]()[_0x3229('0xa')](cmHopper[_0x3229('0xf')](_0x548777))[_0x3229('0x7')](loggerCatch(_0x3229('0x10')));};exports[_0x3229('0xb')]=function(_0x1bd09d,_0x1b611d){create(_0x1bd09d)[_0x3229('0x7')](loggerCatch(_0x1b611d));moveContact(_0x1bd09d)[_0x3229('0x7')](loggerCatch(_0x1b611d));};exports[_0x3229('0x11')]=function(_0x413081,_0x36346f){createAgent(_0x413081)['catch'](loggerCatch(_0x36346f));};exports[_0x3229('0x12')]=function(_0x2b5f6d,_0x54c462){create(_0x2b5f6d)['catch'](loggerCatch(_0x54c462));};exports['createCustomerFinal']=function(_0xd95114,_0x13a5ac){moveContact(_0xd95114)['catch'](loggerCatch(_0x13a5ac));};exports['rescheduleContact']=function(_0x3226ea,_0x54404a,_0x56c44b){if(_0x54404a){_0x3226ea[_0x3229('0x13')]=null;}if(_0x56c44b){_0x3226ea[_0x3229('0x14')]=![];}return cmHopper['rescheduleContact'](_0x3226ea)[_0x3229('0x7')](loggerCatch(_0x3229('0x15')));};exports[_0x3229('0x16')]=function(_0x22a1bc){return cmHopper[_0x3229('0x16')](_0x22a1bc)[_0x3229('0x7')](loggerCatch(_0x3229('0x17')));};exports[_0x3229('0x18')]=function(_0x4249dd){return cmHopper['unlockContact']({'UserId':null},_0x4249dd,0x1)[_0x3229('0x7')](loggerCatch(_0x3229('0x19')));};exports['disableContact']=function(_0x376310){return cmHopper[_0x3229('0x18')]({'active':![]},_0x376310,0x1)[_0x3229('0x7')](loggerCatch('[activeContact]\x20'));};exports[_0x3229('0x1a')]=function(_0x12546a){var _0x35db09={};_0x35db09[_0x3229('0x1b')]=_0x12546a[_0x3229('0x1b')];_0x35db09[_0x3229('0x1c')]=_0x12546a[_0x3229('0x1c')];_0x35db09[_0x3229('0x1d')]=_0x12546a[_0x3229('0x1d')];_0x35db09[_0x3229('0x1e')]=_0x12546a[_0x3229('0x1e')];_0x35db09[_0x3229('0x1f')]=_0x12546a[_0x3229('0x1f')];_0x35db09['queuecallerjoinAt']=_0x12546a['answertime'];_0x35db09[_0x3229('0x20')]=_0x12546a[_0x3229('0x21')];_0x35db09[_0x3229('0x22')]=0x1;_0x35db09[_0x3229('0x23')]=_0x12546a['endtime'];_0x35db09[_0x3229('0x24')]=_0x12546a[_0x3229('0x25')];_0x35db09['context']=_0x3229('0x26');_0x35db09[_0x3229('0x27')]=_0x3229('0x28');_0x35db09[_0x3229('0x29')]=0x0;_0x35db09[_0x3229('0x2a')]=0x1;_0x35db09['lastAssignedTo']=_0x12546a[_0x3229('0x25')];_0x35db09['queuecallerexitreason']=_0x3229('0x2b');return BPromise[_0x3229('0x9')]()[_0x3229('0xa')](voiceQueueReport[_0x3229('0x2c')](_0x35db09))[_0x3229('0x7')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0xddc222,_0xacb3e2){return BPromise[_0x3229('0x9')]()[_0x3229('0xa')](cmHopper['getContactRecallMe'](_0xddc222,_0xacb3e2))[_0x3229('0x7')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x3229('0x2d')]=function(_0x111ed2){return cmHopper[_0x3229('0x2e')](_0x111ed2,!![],!![])[_0x3229('0x7')](loggerCatch(_0x3229('0x2f')));}; \ 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 c441f24..9e01b0a 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 _0x25f2=['toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','logCustomer','answertime','isFailure','Failure','variablesAction','uniqueid','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','interface','channelAgent','motionChannel','mandatoryDisposition','buildObj','agentReadyId','status','reachable','push','getDiff','milliseconds','diff','queue','campaigntype','dialAnswer','scheduledat','callback','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','variables'];(function(_0x2ab315,_0x3b6626){var _0x1ee933=function(_0x2f445b){while(--_0x2f445b){_0x2ab315['push'](_0x2ab315['shift']());}};_0x1ee933(++_0x3b6626);}(_0x25f2,0x197));var _0x225f=function(_0x4b205b,_0x2fc87c){_0x4b205b=_0x4b205b-0x0;var _0x153cba=_0x25f2[_0x4b205b];return _0x153cba;};'use strict';var util=require(_0x225f('0x0'));var _=require(_0x225f('0x1'));var moment=require(_0x225f('0x2'));var logger=require(_0x225f('0x3'))(_0x225f('0x4'));var ipAgi=process['env'][_0x225f('0x5')]||_0x225f('0x6');var utils=require(_0x225f('0x7'));exports[_0x225f('0x8')]=function(_0x7b7d54){return function(_0x358daf){logger[_0x225f('0x9')](_0x7b7d54,util[_0x225f('0xa')](_0x358daf,{'showHidden':![],'depth':null}));};};exports[_0x225f('0xb')]=function(_0x4bf1e1,_0x2d6296){logger[_0x225f('0xc')](_0x4bf1e1,util[_0x225f('0xa')](_0x2d6296,{'showHidden':![],'depth':null}));};exports[_0x225f('0xd')]=function(_0x440b84,_0x540f44){logger[_0x225f('0x9')](_0x440b84,util['inspect'](_0x540f44,{'showHidden':![],'depth':null}));};exports[_0x225f('0xe')]=function(_0x5c8aec){return function(_0x2f4972){logger[_0x225f('0xc')](_0x5c8aec,util[_0x225f('0xa')](_0x2f4972,{'showHidden':![],'depth':null}));};};exports[_0x225f('0xf')]=function(_0x55acb3,_0x2a5fe2,_0x31a473){return{'message':_0x55acb3,'unlock':_0x2a5fe2,'active':_0x31a473};};exports[_0x225f('0x10')]=function(_0x3356ae,_0x1cd7a0,_0x500e45){if(!_['isUndefined'](_0x500e45)&&_0x225f('0x11')===typeof _0x500e45&&!_[_0x225f('0x12')](_0x500e45)){if(!_[_0x225f('0x13')](_0x1cd7a0)&&'string'===typeof _0x1cd7a0&&!_[_0x225f('0x12')](_0x1cd7a0)){return util[_0x225f('0x14')]('\x22%s\x22\x20<%s>',_0x1cd7a0,_0x500e45);}return util['format'](_0x225f('0x15'),_0x500e45,_0x500e45);}if(!_['isUndefined'](_0x3356ae)&&'string'===typeof _0x3356ae&&!_[_0x225f('0x12')](_0x3356ae)){return _0x3356ae;}return'\x22\x22\x20<>';};exports[_0x225f('0x16')]=function(_0x3553a3){if(_[_0x225f('0x17')](_0x3553a3)){return![];}return _0x3553a3;};exports[_0x225f('0x18')]=function(_0x14502b,_0x12579b,_0x1b9c6c,_0x3b6626,_0x4bfc14,_0x27d1ab){var _0x4f6c59={'XMD-QUEUE':_0x12579b['Queue']?_0x12579b['Queue'][_0x225f('0x19')]:'','XMD-CALLERID':_0x3b6626,'XMD-CALLERID-PREVIEW':_0x27d1ab?util[_0x225f('0x14')](_0x225f('0x15'),_0x27d1ab[_0x225f('0x1a')],_0x27d1ab[_0x225f('0x1b')]):_0x3b6626,'XMD-DIALID':_0x4bfc14,'XMD-CONTACTID':_0x12579b[_0x225f('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3b6626,'XMD-VOICEQUEUEID':_0x12579b[_0x225f('0x1d')],'XMD-DIALCHANNEL':_0x1b9c6c,'XMD-DIALTIMEOUT':_0x14502b[_0x225f('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x225f('0x1f'),_0x14502b[_0x225f('0x20')]?'g':'',_[_0x225f('0x12')](_0x14502b[_0x225f('0x21')])?'':_0x225f('0x22')),'XMD-DIALURL':_0x14502b[_0x225f('0x23')]||'','XMD-AGI':_0x14502b[_0x225f('0x24')]?util[_0x225f('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x14502b[_0x225f('0x24')]):_0x225f('0x25'),'XMD-AGIAFTER':_0x14502b['dialQueueProject2']?util[_0x225f('0x14')](_0x225f('0x26'),ipAgi,_0x14502b['dialQueueProject2']):_0x225f('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x27d1ab?_0x27d1ab[_0x225f('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x27d1ab?_0x27d1ab[_0x225f('0x28')]:'','XMD-DESTINATION':_0x225f('0x29'),'SIPADDHEADER':_0x225f('0x2a')};if(!_['isEmpty'](_0x14502b['monitor_format'])){_0x4f6c59[util[_0x225f('0x14')]('%s',_0x225f('0x2b'))]=_0x14502b[_0x225f('0x21')];_0x4f6c59[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4bfc14;}return _0x4f6c59;};exports['toLowerVariables']=function(_0x47c366){var _0xaab44c={};for(var _0x184f72 in _0x47c366){if(_0x47c366[_0x225f('0x2c')](_0x184f72)){_0xaab44c[util[_0x225f('0x14')]('%s',_[_0x225f('0x2d')](_0x184f72))]=_0x47c366[_0x184f72];}}return{'variables':_0xaab44c};};exports[_0x225f('0x2e')]=function(_0x408fd8,_0xade791){if(!_[_0x225f('0x17')](_0x408fd8)){if(_0x408fd8['hasOwnProperty'](_0x225f('0x2f'))){if(_0x408fd8[_0x225f('0x2f')]>0x0){_0x408fd8[_0x225f('0x2f')]-=0x1;}else{logger['error'](_0x225f('0x30'),_0xade791);}}}else{logger[_0x225f('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0xade791);}};exports[_0x225f('0x31')]=function(_0x44508a){var _0x55e5d1=moment()[_0x225f('0x14')](_0x225f('0x32'));_0x44508a[_0x225f('0x33')]=0xd;_0x44508a[_0x225f('0x34')]=_0x225f('0x35');_0x44508a[_0x225f('0x36')]=_0x55e5d1;_0x44508a[_0x225f('0x37')]=_0x55e5d1;_0x44508a[_0x225f('0x38')]=_0x55e5d1;};exports[_0x225f('0x39')]=function(_0x20ed06,_0x2abb5e,_0x49a5cb){var _0x496b2c=moment()[_0x225f('0x14')](_0x225f('0x32'));_0x20ed06['state']=_0x2abb5e;_0x20ed06[_0x225f('0x34')]=_0x49a5cb;_0x20ed06[_0x225f('0x37')]=_0x496b2c;_0x20ed06[_0x225f('0x3a')]=utils[_0x225f('0x3b')](_0x20ed06[_0x225f('0x37')],_0x20ed06[_0x225f('0x36')]);};exports[_0x225f('0x3c')]=function(_0x472d7d,_0x4450d0,_0x23cbbd){_0x472d7d[_0x225f('0x3d')]=_0x4450d0;_0x472d7d['UserId']=_0x23cbbd;};exports[_0x225f('0x3e')]=function(_0x550dbd,_0x4d28f9,_0x141681){var _0x5df6c4=moment()[_0x225f('0x14')](_0x225f('0x32'));_0x550dbd[_0x225f('0x33')]=_0x4d28f9;_0x550dbd[_0x225f('0x34')]=_0x141681;_0x550dbd[_0x225f('0x37')]=_0x550dbd[_0x225f('0x37')]?_0x550dbd[_0x225f('0x37')]:_0x5df6c4;_0x550dbd[_0x225f('0x38')]=_0x550dbd['endtime']?_0x550dbd[_0x225f('0x38')]:_0x5df6c4;_0x550dbd[_0x225f('0x3a')]=utils[_0x225f('0x3b')](_0x550dbd[_0x225f('0x37')]||0x0,_0x550dbd[_0x225f('0x36')]||0x0);_0x550dbd['talktime']=_0x550dbd[_0x225f('0x3f')]?utils['getSeconds'](_0x550dbd['endtime'],_0x550dbd[_0x225f('0x3f')]):0x0;};exports[_0x225f('0x40')]=function(_0x51b4e5){return _0x51b4e5===_0x225f('0x41');};exports[_0x225f('0x42')]=function(_0x772a17,_0xbe743,_0xb8f3a1,_0xb472fd,_0x4eff88){var _0x4f366d=_0xb472fd?'RECALL':_0x772a17[_0x225f('0x1a')];_0x4f366d=_0x4eff88?'BOOKED':_0x4f366d;return{'actionid':_0x772a17[_0x225f('0x43')],'action':'originate','channel':_0x772a17['channelAgent'],'callerid':util['format'](_0x225f('0x15'),_0x4f366d,_0x772a17[_0x225f('0x1b')]),'Exten':_0x225f('0x29'),'Context':'from-sip','Priority':'1','variable':_0xb8f3a1,'timeout':(_0xbe743[_0x225f('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x772a17[_0x225f('0x43')]};};exports[_0x225f('0x45')]=function(_0x103c59){return _0x103c59['countbusyretry']+_0x103c59[_0x225f('0x46')]+_0x103c59[_0x225f('0x47')]+_0x103c59[_0x225f('0x48')]+_0x103c59[_0x225f('0x49')];};exports[_0x225f('0x4a')]=function(_0x584907){var _0x41d488=_['clone'](_0x584907);_0x41d488[_0x225f('0x33')]=0xf;_0x41d488[_0x225f('0x34')]=_0x225f('0x4b');return _0x41d488;};exports[_0x225f('0x4c')]=function(_0x355c8a,_0x543ec9,_0x1f5f3c){var _0x1df2d6={};_0x1df2d6[_0x543ec9]=_0x355c8a[_0x543ec9];_0x1df2d6[_0x225f('0x4d')]=![];_0x1df2d6['scheduledat']=moment()['add'](_0x1f5f3c,_0x225f('0x4e'))['format'](_0x225f('0x32'));_0x1df2d6['ContactId']=_0x355c8a[_0x225f('0x1c')];_0x1df2d6[_0x225f('0x4f')]=_0x355c8a[_0x225f('0x4f')];_0x1df2d6[_0x225f('0x1d')]=_0x355c8a[_0x225f('0x1d')]||undefined;return _0x1df2d6;};exports[_0x225f('0x50')]=function(_0x68f760,_0xb651f){if(!_['isNil'](_0x68f760)){if(_0x68f760[_0x225f('0x51')]>0x0){_0x68f760[_0x225f('0x51')]-=0x1;}else{logger['error'](_0xb651f,_0x225f('0x52'));}}else{logger[_0x225f('0x9')](_0xb651f,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x225f('0x53')]=function(_0x3a8309){if(_0x3a8309<=0x0){return!![];}return![];};function buildObj(_0x1c7b5e,_0x424a32,_0x5740c6){_0x1c7b5e[_0x225f('0x54')]=_0x424a32;_0x1c7b5e[_0x225f('0x19')]=_0x1c7b5e['queue'];_0x1c7b5e[_0x225f('0x55')]=_0x1c7b5e[_0x225f('0x56')];_0x1c7b5e[_0x225f('0x57')]='voice';if(_0x5740c6){_0x1c7b5e[_0x225f('0x58')]=_0x5740c6['mandatoryDisposition'];}return _0x1c7b5e;}exports[_0x225f('0x59')]=buildObj;exports[_0x225f('0x5a')]=function(_0x1e1f2e){var _0x53b4d3=[];for(var _0x253ad5 in _0x1e1f2e){if(_0x1e1f2e[_0x225f('0x2c')](_0x253ad5)){if(!_[_0x225f('0x17')](_0x1e1f2e[_0x253ad5])&&_0x1e1f2e[_0x253ad5][_0x225f('0x33')]==='not_inuse'&&_0x1e1f2e[_0x253ad5][_0x225f('0x5b')]===_0x225f('0x5c')){_0x53b4d3[_0x225f('0x5d')](_0x1e1f2e[_0x253ad5]['id']);}}}return _0x53b4d3;};exports[_0x225f('0x5e')]=function(_0x5c5508){var _0x1c6c97=moment()[_0x225f('0x5f')](0x0);var _0x59e9ee=moment(_0x5c5508)[_0x225f('0x5f')](0x0);return _0x1c6c97[_0x225f('0x60')](_0x59e9ee,'seconds');};exports['createBody']=function(_0xb1441c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xb1441c[_0x225f('0x1c')],'ListId':_0xb1441c[_0x225f('0x4f')],'VoiceQueueId':_0xb1441c[_0x225f('0x1d')]||undefined,'CampaignId':_0xb1441c['CampaignId']||undefined};};exports['filterKey']=function(_0x4b67fc){if(_0x4b67fc===_0x225f('0x43')||_0x4b67fc==='idContact'||_0x4b67fc===_0x225f('0x61')||_0x4b67fc==='type'||_0x4b67fc===_0x225f('0x62')||_0x4b67fc===_0x225f('0x63')||_0x4b67fc===_0x225f('0x3d')||_0x4b67fc==='channelAgent'||_0x4b67fc===_0x225f('0x1a')||_0x4b67fc===_0x225f('0x4d')||_0x4b67fc===_0x225f('0x1b')||_0x4b67fc===_0x225f('0x64')||_0x4b67fc==='countbusyretry'||_0x4b67fc==='countcongestionretry'||_0x4b67fc===_0x225f('0x47')||_0x4b67fc==='countglobal'||_0x4b67fc===_0x225f('0x65')||_0x4b67fc===_0x225f('0x66')||_0x4b67fc===_0x225f('0x67')||_0x4b67fc==='recallme'||_0x4b67fc===_0x225f('0x1c')||_0x4b67fc==='ListId'||_0x4b67fc===_0x225f('0x68')||_0x4b67fc==='VoiceQueueId'||_0x4b67fc===_0x225f('0x69')||_0x4b67fc===_0x225f('0x6a')||_0x4b67fc==='xmd-queue'||_0x4b67fc===_0x225f('0x6b')||_0x4b67fc===_0x225f('0x6c')||_0x4b67fc===_0x225f('0x6d')||_0x4b67fc===_0x225f('0x6e')||_0x4b67fc===_0x225f('0x6f')||_0x4b67fc===_0x225f('0x70')||_0x4b67fc===_0x225f('0x71')||_0x4b67fc==='xmd-contactid'||_0x4b67fc===_0x225f('0x72')||_0x4b67fc==='xmd-callerid'||_0x4b67fc===_0x225f('0x73')||_0x4b67fc===_0x225f('0x74')||_0x4b67fc===_0x225f('0x75')||_0x4b67fc===_0x225f('0x76')||_0x4b67fc===_0x225f('0x77')||_0x4b67fc===_0x225f('0x78')||_0x4b67fc==='rtpaudioqosloss'||_0x4b67fc==='rtpaudioqoslossbridged'||_0x4b67fc===_0x225f('0x79')||_0x4b67fc===_0x225f('0x7a')||_0x4b67fc===_0x225f('0x75')||_0x4b67fc==='rtpaudioqosbridged'||_0x4b67fc==='rtpaudioqosjitter'||_0x4b67fc==='rtpaudioqosjitterbridged'||_0x4b67fc===_0x225f('0x7b')||_0x4b67fc===_0x225f('0x7c')||_0x4b67fc===_0x225f('0x79')||_0x4b67fc===_0x225f('0x7a')||_0x4b67fc===_0x225f('0x7d')||_0x4b67fc==='bridgepvtcallid'||_0x4b67fc===_0x225f('0x33')||_0x4b67fc===_0x225f('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x3d4a8a,_0x37748f){var _0x90c78a,_0x326b9c,_0x13a73a;if(_0x37748f<=0x0){_0x37748f=0x1;}_0x90c78a=new RegExp(_0x225f('0x7e')+_0x37748f+'}$');_0x326b9c=Math[_0x225f('0x7f')](0xa,_0x37748f-0x1);_0x13a73a=Math['pow'](0xa,_0x37748f)-0x1;return util[_0x225f('0x14')]('%s',_[_0x225f('0x80')](_0x3d4a8a,_0x90c78a,_[_0x225f('0x81')](_0x326b9c,_0x13a73a)));};exports['extractCalleridName']=function(_0x42a3e6){var _0x45f251=_0x42a3e6[_0x225f('0x82')](/"(.*?)"/);return _0x45f251?_0x45f251[0x1]:_0x42a3e6;};exports[_0x225f('0x83')]=function(_0x438933){var _0x4ffab2=_0x438933[_0x225f('0x82')](/<(.*?)>/);return _0x4ffab2?_0x4ffab2[0x1]:_0x438933;};function buildNoAnswerEventPayload(_0x24c419,_0xae761){var _0x5b7c6f=buildObj(_0x24c419,'noanswer');if(!_[_0x225f('0x12')](_0xae761['variables'])){Object['keys'](_0xae761[_0x225f('0x84')])['forEach'](function(_0x15317f){_0x5b7c6f[_0x15317f[_0x225f('0x85')]()]=_0xae761[_0x225f('0x84')][_0x15317f];});}return _0x5b7c6f;}exports[_0x225f('0x86')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xe513=['\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','membername','UserId','logCustomer','statedesc','talktime','answertime','isFailure','Failure','RECALL','calleridname','BOOKED','originate','channelAgent','from-sip','uniqueid','totalGlobal','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','voice','mandatoryDisposition','buildObj','status','push','getDiff','milliseconds','seconds','CampaignId','idContact','type','campaigntype','dialAnswer','active','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','variables','keys','forEach','toLowerCase','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout'];(function(_0x32e5a7,_0x3e2846){var _0xd3e6e6=function(_0x30280a){while(--_0x30280a){_0x32e5a7['push'](_0x32e5a7['shift']());}};_0xd3e6e6(++_0x3e2846);}(_0xe513,0x18b));var _0x3e51=function(_0x150d0c,_0x187526){_0x150d0c=_0x150d0c-0x0;var _0xeb8eb0=_0xe513[_0x150d0c];return _0xeb8eb0;};'use strict';var util=require('util');var _=require(_0x3e51('0x0'));var moment=require(_0x3e51('0x1'));var logger=require(_0x3e51('0x2'))(_0x3e51('0x3'));var ipAgi=process[_0x3e51('0x4')][_0x3e51('0x5')]||_0x3e51('0x6');var utils=require(_0x3e51('0x7'));exports[_0x3e51('0x8')]=function(_0xbf53eb){return function(_0xb8d56b){logger[_0x3e51('0x9')](_0xbf53eb,util[_0x3e51('0xa')](_0xb8d56b,{'showHidden':![],'depth':null}));};};exports[_0x3e51('0xb')]=function(_0x5ac574,_0x320a25){logger[_0x3e51('0xc')](_0x5ac574,util[_0x3e51('0xa')](_0x320a25,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x45eaa9,_0x2ac780){logger[_0x3e51('0x9')](_0x45eaa9,util[_0x3e51('0xa')](_0x2ac780,{'showHidden':![],'depth':null}));};exports[_0x3e51('0xd')]=function(_0x3a9327){return function(_0x153cbf){logger[_0x3e51('0xc')](_0x3a9327,util[_0x3e51('0xa')](_0x153cbf,{'showHidden':![],'depth':null}));};};exports[_0x3e51('0xe')]=function(_0xaedce,_0x15306f,_0x49627c){return{'message':_0xaedce,'unlock':_0x15306f,'active':_0x49627c};};exports['getCallerId']=function(_0x48d550,_0x477881,_0x495d81){if(!_[_0x3e51('0xf')](_0x495d81)&&_0x3e51('0x10')===typeof _0x495d81&&!_[_0x3e51('0x11')](_0x495d81)){if(!_[_0x3e51('0xf')](_0x477881)&&'string'===typeof _0x477881&&!_[_0x3e51('0x11')](_0x477881)){return util[_0x3e51('0x12')]('\x22%s\x22\x20<%s>',_0x477881,_0x495d81);}return util[_0x3e51('0x12')](_0x3e51('0x13'),_0x495d81,_0x495d81);}if(!_['isUndefined'](_0x48d550)&&'string'===typeof _0x48d550&&!_[_0x3e51('0x11')](_0x48d550)){return _0x48d550;}return _0x3e51('0x14');};exports['isActive']=function(_0x571fe8){if(_['isNil'](_0x571fe8)){return![];}return _0x571fe8;};exports[_0x3e51('0x15')]=function(_0x54875d,_0x2257c2,_0x3734ae,_0x33738b,_0x5a95ae,_0x4dc05e){var _0x32e6b9={'XMD-QUEUE':_0x2257c2[_0x3e51('0x16')]?_0x2257c2['Queue']['name']:'','XMD-CALLERID':_0x33738b,'XMD-CALLERID-PREVIEW':_0x4dc05e?util[_0x3e51('0x12')](_0x3e51('0x13'),_0x4dc05e['calleridname'],_0x4dc05e[_0x3e51('0x17')]):_0x33738b,'XMD-DIALID':_0x5a95ae,'XMD-CONTACTID':_0x2257c2[_0x3e51('0x18')],'XMD-CDRTYPE':_0x3e51('0x19'),'CALLERID(all)':_0x33738b,'XMD-VOICEQUEUEID':_0x2257c2[_0x3e51('0x1a')],'XMD-DIALCHANNEL':_0x3734ae,'XMD-DIALTIMEOUT':_0x54875d[_0x3e51('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x3e51('0x12')](_0x3e51('0x1c'),_0x54875d[_0x3e51('0x1d')]?'g':'',_[_0x3e51('0x11')](_0x54875d['monitor_format'])?'':_0x3e51('0x1e')),'XMD-DIALURL':_0x54875d[_0x3e51('0x1f')]||'','XMD-AGI':_0x54875d['dialQueueProject']?util[_0x3e51('0x12')](_0x3e51('0x20'),ipAgi,_0x54875d[_0x3e51('0x21')]):'NONE','XMD-AGIAFTER':_0x54875d[_0x3e51('0x1d')]?util[_0x3e51('0x12')](_0x3e51('0x20'),ipAgi,_0x54875d[_0x3e51('0x1d')]):_0x3e51('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x4dc05e?_0x4dc05e[_0x3e51('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x4dc05e?_0x4dc05e[_0x3e51('0x24')]:'','XMD-DESTINATION':_0x3e51('0x25'),'SIPADDHEADER':_0x3e51('0x26')};if(!_[_0x3e51('0x11')](_0x54875d[_0x3e51('0x27')])){_0x32e6b9[util['format']('%s',_0x3e51('0x28'))]=_0x54875d[_0x3e51('0x27')];_0x32e6b9[util[_0x3e51('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5a95ae;}return _0x32e6b9;};exports[_0x3e51('0x29')]=function(_0x596ae6){var _0x14cd96={};for(var _0x55b275 in _0x596ae6){if(_0x596ae6[_0x3e51('0x2a')](_0x55b275)){_0x14cd96[util[_0x3e51('0x12')]('%s',_[_0x3e51('0x2b')](_0x55b275))]=_0x596ae6[_0x55b275];}}return{'variables':_0x14cd96};};exports[_0x3e51('0x2c')]=function(_0x554184,_0x56e983){if(!_[_0x3e51('0x2d')](_0x554184)){if(_0x554184[_0x3e51('0x2a')](_0x3e51('0x2e'))){if(_0x554184[_0x3e51('0x2e')]>0x0){_0x554184[_0x3e51('0x2e')]-=0x1;}else{logger[_0x3e51('0x9')](_0x3e51('0x2f'),_0x56e983);}}}else{logger[_0x3e51('0x9')](_0x3e51('0x30'),_0x56e983);}};exports[_0x3e51('0x31')]=function(_0x5a7ef8){var _0x10c280=moment()['format'](_0x3e51('0x32'));_0x5a7ef8[_0x3e51('0x33')]=0xd;_0x5a7ef8['statedesc']='Blacklist';_0x5a7ef8[_0x3e51('0x34')]=_0x10c280;_0x5a7ef8[_0x3e51('0x35')]=_0x10c280;_0x5a7ef8[_0x3e51('0x36')]=_0x10c280;};exports[_0x3e51('0x37')]=function(_0x4c4eb6,_0x316c36,_0x2ca228){var _0x10172c=moment()[_0x3e51('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c4eb6[_0x3e51('0x33')]=_0x316c36;_0x4c4eb6['statedesc']=_0x2ca228;_0x4c4eb6[_0x3e51('0x35')]=_0x10172c;_0x4c4eb6[_0x3e51('0x38')]=utils[_0x3e51('0x39')](_0x4c4eb6['responsetime'],_0x4c4eb6[_0x3e51('0x34')]);};exports['logLookAgent']=function(_0x20fba6,_0x518f30,_0x3d0c24){_0x20fba6[_0x3e51('0x3a')]=_0x518f30;_0x20fba6[_0x3e51('0x3b')]=_0x3d0c24;};exports[_0x3e51('0x3c')]=function(_0x37f8ab,_0x233def,_0x2eabe5){var _0x4abbc4=moment()[_0x3e51('0x12')](_0x3e51('0x32'));_0x37f8ab[_0x3e51('0x33')]=_0x233def;_0x37f8ab[_0x3e51('0x3d')]=_0x2eabe5;_0x37f8ab[_0x3e51('0x35')]=_0x37f8ab[_0x3e51('0x35')]?_0x37f8ab['responsetime']:_0x4abbc4;_0x37f8ab['endtime']=_0x37f8ab[_0x3e51('0x36')]?_0x37f8ab[_0x3e51('0x36')]:_0x4abbc4;_0x37f8ab[_0x3e51('0x38')]=utils[_0x3e51('0x39')](_0x37f8ab['responsetime']||0x0,_0x37f8ab['starttime']||0x0);_0x37f8ab[_0x3e51('0x3e')]=_0x37f8ab[_0x3e51('0x3f')]?utils[_0x3e51('0x39')](_0x37f8ab[_0x3e51('0x36')],_0x37f8ab['answertime']):0x0;};exports[_0x3e51('0x40')]=function(_0x46b3b3){return _0x46b3b3===_0x3e51('0x41');};exports['variablesAction']=function(_0x3a6e50,_0x2c489c,_0x450e01,_0x313c51,_0x5c929b){var _0x3c4b3d=_0x313c51?_0x3e51('0x42'):_0x3a6e50[_0x3e51('0x43')];_0x3c4b3d=_0x5c929b?_0x3e51('0x44'):_0x3c4b3d;return{'actionid':_0x3a6e50['uniqueid'],'action':_0x3e51('0x45'),'channel':_0x3a6e50[_0x3e51('0x46')],'callerid':util[_0x3e51('0x12')](_0x3e51('0x13'),_0x3c4b3d,_0x3a6e50['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x3e51('0x47'),'Priority':'1','variable':_0x450e01,'timeout':(_0x2c489c['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3a6e50[_0x3e51('0x48')]};};exports[_0x3e51('0x49')]=function(_0x39bf9e){return _0x39bf9e['countbusyretry']+_0x39bf9e['countcongestionretry']+_0x39bf9e['countnoanswerretry']+_0x39bf9e[_0x3e51('0x4a')]+_0x39bf9e[_0x3e51('0x4b')];};exports['cloneAction']=function(_0x1c9ef8){var _0x356f74=_['clone'](_0x1c9ef8);_0x356f74[_0x3e51('0x33')]=0xf;_0x356f74[_0x3e51('0x3d')]=_0x3e51('0x4c');return _0x356f74;};exports[_0x3e51('0x4d')]=function(_0x3f98d7,_0x498b9c,_0x4a7459){var _0x394876={};_0x394876[_0x498b9c]=_0x3f98d7[_0x498b9c];_0x394876['active']=![];_0x394876[_0x3e51('0x4e')]=moment()['add'](_0x4a7459,_0x3e51('0x4f'))[_0x3e51('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x394876[_0x3e51('0x18')]=_0x3f98d7[_0x3e51('0x18')];_0x394876['ListId']=_0x3f98d7[_0x3e51('0x50')];_0x394876['VoiceQueueId']=_0x3f98d7['VoiceQueueId']||undefined;return _0x394876;};exports[_0x3e51('0x51')]=function(_0x145b57,_0x3739f6){if(!_[_0x3e51('0x2d')](_0x145b57)){if(_0x145b57[_0x3e51('0x52')]>0x0){_0x145b57['pTalking']-=0x1;}else{logger[_0x3e51('0x9')](_0x3739f6,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x3739f6,_0x3e51('0x53'));}};exports[_0x3e51('0x54')]=function(_0x1d562c){if(_0x1d562c<=0x0){return!![];}return![];};function buildObj(_0x2d1832,_0xa6317f,_0x40093f){_0x2d1832['lastevent']=_0xa6317f;_0x2d1832[_0x3e51('0x55')]=_0x2d1832[_0x3e51('0x56')];_0x2d1832[_0x3e51('0x57')]=_0x2d1832[_0x3e51('0x46')];_0x2d1832['motionChannel']=_0x3e51('0x58');if(_0x40093f){_0x2d1832['mandatoryDisposition']=_0x40093f[_0x3e51('0x59')];}return _0x2d1832;}exports[_0x3e51('0x5a')]=buildObj;exports['agentReadyId']=function(_0x22545c){var _0x46375f=[];for(var _0x5c3b94 in _0x22545c){if(_0x22545c[_0x3e51('0x2a')](_0x5c3b94)){if(!_[_0x3e51('0x2d')](_0x22545c[_0x5c3b94])&&_0x22545c[_0x5c3b94][_0x3e51('0x33')]==='not_inuse'&&_0x22545c[_0x5c3b94][_0x3e51('0x5b')]==='reachable'){_0x46375f[_0x3e51('0x5c')](_0x22545c[_0x5c3b94]['id']);}}}return _0x46375f;};exports[_0x3e51('0x5d')]=function(_0x485770){var _0x59f838=moment()['milliseconds'](0x0);var _0x3a0214=moment(_0x485770)[_0x3e51('0x5e')](0x0);return _0x59f838['diff'](_0x3a0214,_0x3e51('0x5f'));};exports['createBody']=function(_0x34796e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x34796e[_0x3e51('0x18')],'ListId':_0x34796e[_0x3e51('0x50')],'VoiceQueueId':_0x34796e[_0x3e51('0x1a')]||undefined,'CampaignId':_0x34796e[_0x3e51('0x60')]||undefined};};exports['filterKey']=function(_0x26ccea){if(_0x26ccea===_0x3e51('0x48')||_0x26ccea===_0x3e51('0x61')||_0x26ccea===_0x3e51('0x56')||_0x26ccea===_0x3e51('0x62')||_0x26ccea===_0x3e51('0x63')||_0x26ccea===_0x3e51('0x64')||_0x26ccea==='membername'||_0x26ccea===_0x3e51('0x46')||_0x26ccea===_0x3e51('0x43')||_0x26ccea===_0x3e51('0x65')||_0x26ccea==='calleridnum'||_0x26ccea===_0x3e51('0x4e')||_0x26ccea===_0x3e51('0x66')||_0x26ccea===_0x3e51('0x67')||_0x26ccea===_0x3e51('0x68')||_0x26ccea===_0x3e51('0x69')||_0x26ccea===_0x3e51('0x6a')||_0x26ccea===_0x3e51('0x6b')||_0x26ccea===_0x3e51('0x6c')||_0x26ccea==='recallme'||_0x26ccea===_0x3e51('0x18')||_0x26ccea===_0x3e51('0x50')||_0x26ccea===_0x3e51('0x3b')||_0x26ccea===_0x3e51('0x1a')||_0x26ccea===_0x3e51('0x6d')||_0x26ccea===_0x3e51('0x6e')||_0x26ccea==='xmd-queue'||_0x26ccea===_0x3e51('0x6f')||_0x26ccea===_0x3e51('0x70')||_0x26ccea===_0x3e51('0x71')||_0x26ccea===_0x3e51('0x72')||_0x26ccea===_0x3e51('0x73')||_0x26ccea===_0x3e51('0x74')||_0x26ccea===_0x3e51('0x75')||_0x26ccea===_0x3e51('0x76')||_0x26ccea===_0x3e51('0x77')||_0x26ccea===_0x3e51('0x78')||_0x26ccea===_0x3e51('0x79')||_0x26ccea==='xmd-agi'||_0x26ccea===_0x3e51('0x7a')||_0x26ccea===_0x3e51('0x7b')||_0x26ccea==='rtpaudioqosjitter'||_0x26ccea===_0x3e51('0x7c')||_0x26ccea===_0x3e51('0x7d')||_0x26ccea===_0x3e51('0x7e')||_0x26ccea===_0x3e51('0x7f')||_0x26ccea===_0x3e51('0x80')||_0x26ccea===_0x3e51('0x7a')||_0x26ccea===_0x3e51('0x7b')||_0x26ccea===_0x3e51('0x81')||_0x26ccea==='rtpaudioqosjitterbridged'||_0x26ccea===_0x3e51('0x7d')||_0x26ccea==='rtpaudioqoslossbridged'||_0x26ccea===_0x3e51('0x7f')||_0x26ccea===_0x3e51('0x80')||_0x26ccea===_0x3e51('0x82')||_0x26ccea===_0x3e51('0x83')||_0x26ccea==='state'||_0x26ccea===_0x3e51('0x3d')){return![];}return!![];};exports[_0x3e51('0x84')]=function(_0xa16f4c,_0x342da0){var _0x34849f,_0x32ec9c,_0x8719d6;if(_0x342da0<=0x0){_0x342da0=0x1;}_0x34849f=new RegExp(_0x3e51('0x85')+_0x342da0+'}$');_0x32ec9c=Math[_0x3e51('0x86')](0xa,_0x342da0-0x1);_0x8719d6=Math[_0x3e51('0x86')](0xa,_0x342da0)-0x1;return util[_0x3e51('0x12')]('%s',_[_0x3e51('0x87')](_0xa16f4c,_0x34849f,_['random'](_0x32ec9c,_0x8719d6)));};exports['extractCalleridName']=function(_0x5bd015){var _0x1fc28e=_0x5bd015['match'](/"(.*?)"/);return _0x1fc28e?_0x1fc28e[0x1]:_0x5bd015;};exports['extractCalleridNumber']=function(_0x45780c){var _0x480f9a=_0x45780c[_0x3e51('0x88')](/<(.*?)>/);return _0x480f9a?_0x480f9a[0x1]:_0x45780c;};function buildNoAnswerEventPayload(_0x1b8ea6,_0x1df593){var _0x4d2d87=buildObj(_0x1b8ea6,'noanswer');if(!_['isEmpty'](_0x1df593[_0x3e51('0x89')])){Object[_0x3e51('0x8a')](_0x1df593[_0x3e51('0x89')])[_0x3e51('0x8b')](function(_0x95b02f){_0x4d2d87[_0x95b02f[_0x3e51('0x8c')]()]=_0x1df593[_0x3e51('0x89')][_0x95b02f];});}return _0x4d2d87;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a762cff..918af56 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 _0x6c25=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x31d0c8,_0x4a2e37){var _0x41a548=function(_0x54a29d){while(--_0x54a29d){_0x31d0c8['push'](_0x31d0c8['shift']());}};_0x41a548(++_0x4a2e37);}(_0x6c25,0x143));var _0x56c2=function(_0x5e25f7,_0x39298c){_0x5e25f7=_0x5e25f7-0x0;var _0x1ae051=_0x6c25[_0x5e25f7];return _0x1ae051;};'use strict';exports['queueadd']={'queue':{'type':_0x56c2('0x0'),'required':!![]},'interface':{'type':_0x56c2('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x56c2('0x1'),'required':![]},'paused':{'type':_0x56c2('0x2'),'required':![]}};exports[_0x56c2('0x3')]={'queue':{'type':_0x56c2('0x0'),'required':!![]},'interface':{'type':_0x56c2('0x0'),'required':!![]}};exports[_0x56c2('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x56c2('0x0'),'required':![]}};exports[_0x56c2('0x5')]={'module':{'type':'string','required':![]}};exports[_0x56c2('0x6')]={'uniqueid':{'type':_0x56c2('0x0'),'required':!![]}};exports[_0x56c2('0x7')]={'uniqueid':{'type':_0x56c2('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x56c2('0x0')},'mixmonitorid':{'type':_0x56c2('0x0')}};exports[_0x56c2('0x8')]={'uniqueid':{'type':_0x56c2('0x0'),'required':!![]}};exports[_0x56c2('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x56c2('0x0'),'required':!![]},'context':{'type':_0x56c2('0x0')}}; \ No newline at end of file +var _0x88de=['queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x88de,0xe6));var _0xe88d=function(_0x3e335d,_0x2a8fc8){_0x3e335d=_0x3e335d-0x0;var _0x3cbe71=_0x88de[_0x3e335d];return _0x3cbe71;};'use strict';exports[_0xe88d('0x0')]={'queue':{'type':_0xe88d('0x1'),'required':!![]},'interface':{'type':_0xe88d('0x1'),'required':!![]},'membername':{'type':_0xe88d('0x1'),'required':!![]},'penalty':{'type':_0xe88d('0x2'),'required':![]},'paused':{'type':_0xe88d('0x3'),'required':![]}};exports[_0xe88d('0x4')]={'queue':{'type':_0xe88d('0x1'),'required':!![]},'interface':{'type':_0xe88d('0x1'),'required':!![]}};exports[_0xe88d('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xe88d('0x3')},'reason':{'type':_0xe88d('0x1'),'required':![]}};exports[_0xe88d('0x6')]={'module':{'type':_0xe88d('0x1'),'required':![]}};exports[_0xe88d('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xe88d('0x8')]={'uniqueid':{'type':_0xe88d('0x1'),'required':!![]},'filename':{'type':_0xe88d('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xe88d('0x1')}};exports[_0xe88d('0x9')]={'uniqueid':{'type':_0xe88d('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xe88d('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f78fcf3..56ba420 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 _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x0b0e[_0x3aaf0a];return _0x33e6bc;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file +var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x3eaf8a,_0xa21c24){var _0x3d0513=function(_0x1b9fd5){while(--_0x1b9fd5){_0x3eaf8a['push'](_0x3eaf8a['shift']());}};_0x3d0513(++_0xa21c24);}(_0xadb5,0xad));var _0x5adb=function(_0x183bcb,_0x13e691){_0x183bcb=_0x183bcb-0x0;var _0x11a9f6=_0xadb5[_0x183bcb];return _0x11a9f6;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 2eef465..8790165 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b62=['assign'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x8b62,0xd1));var _0x28b6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8b62[_0x2064e5];return _0x21a233;};'use strict';function mergeDBDataToRealtime(_0x469ce6,_0x13656c){var _0x5e376b=Object[_0x28b6('0x0')]({},_0x469ce6);for(var _0x3af8d9 in _0x13656c){if(_0x5e376b['hasOwnProperty'](_0x3af8d9)){_0x5e376b[_0x3af8d9]=_0x13656c[_0x3af8d9];}}return _0x5e376b;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x4556=['assign','mergeDBDataToRealtime'];(function(_0x948d12,_0x1bc7e7){var _0x9759f5=function(_0x336021){while(--_0x336021){_0x948d12['push'](_0x948d12['shift']());}};_0x9759f5(++_0x1bc7e7);}(_0x4556,0x1c0));var _0x6455=function(_0x19e4a7,_0x2bc340){_0x19e4a7=_0x19e4a7-0x0;var _0x520a3c=_0x4556[_0x19e4a7];return _0x520a3c;};'use strict';function mergeDBDataToRealtime(_0x39c740,_0x4b6cb9){var _0x29570b=Object[_0x6455('0x0')]({},_0x39c740);for(var _0x2fb83e in _0x4b6cb9){if(_0x29570b['hasOwnProperty'](_0x2fb83e)){_0x29570b[_0x2fb83e]=_0x4b6cb9[_0x2fb83e];}}return _0x29570b;}exports[_0x6455('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d65c5b3..09c44df 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 _0x37ac=['lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','getCallType','UserId','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','originatecalleridnum','forEach','startsWith','Local','indexOf','mobile','phone','substring','blindTransfer','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','accountcode','interface','format','voiceQueueReport','length','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','keys','channel','split','getAgentByInternal','calleridnum','outbound','internal','voiceCallReport','destination','dialer'];(function(_0x46d2ac,_0x4e71a7){var _0x153b36=function(_0x56a47c){while(--_0x56a47c){_0x46d2ac['push'](_0x46d2ac['shift']());}};_0x153b36(++_0x4e71a7);}(_0x37ac,0x8d));var _0xc37a=function(_0xdd209,_0x53e6e3){_0xdd209=_0xdd209-0x0;var _0x4d4aac=_0x37ac[_0xdd209];return _0x4d4aac;};'use strict';var _=require(_0xc37a('0x0'));var moment=require('moment');var util=require(_0xc37a('0x1'));var config=require(_0xc37a('0x2'));var ami=require(_0xc37a('0x3'));var RpcVoiceAgentReport=require(_0xc37a('0x4'));var RpcVoiceCallReport=require(_0xc37a('0x5'));var RpcVoiceDialReport=require(_0xc37a('0x6'));var RpcMemberReport=require(_0xc37a('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xc37a('0x8'));var RpcVoiceTransferReport=require(_0xc37a('0x9'));var VoiceQueueReport=require(_0xc37a('0xa'));var VoiceCallReport=require(_0xc37a('0xb'));var VoiceAgentReport=require(_0xc37a('0xc'));var VoiceDialReport=require(_0xc37a('0xd'));var UserReport=require(_0xc37a('0xe'));function Report(_0x56f84e){this[_0xc37a('0xf')]=_0x56f84e;this[_0xc37a('0x10')]=_0x56f84e[_0xc37a('0x10')];this['telephones']=_0x56f84e[_0xc37a('0x11')];}Report[_0xc37a('0x12')]['sync']=function(_0x457281){var _0x393181=new VoiceQueueReport(this[_0xc37a('0xf')]);var _0x281a20=new VoiceAgentReport(this[_0xc37a('0xf')]);var _0x4b457f=new VoiceDialReport(this['realtime']);var _0x4f93aa=new VoiceCallReport(this[_0xc37a('0xf')]);var _0x2d002b=new UserReport(this[_0xc37a('0xf')]);if(config['xdr']&&config[_0xc37a('0x13')][_0xc37a('0x14')]){ami['on'](_0xc37a('0x15'),this['voiceQueueReport'][_0xc37a('0x16')](this));ami['on'](_0xc37a('0x17'),this['voiceCallReport']['bind'](this));ami['on'](_0xc37a('0x18'),this[_0xc37a('0x19')][_0xc37a('0x16')](this));ami['on'](_0xc37a('0x1a'),this[_0xc37a('0x1b')][_0xc37a('0x16')](this));ami['on'](_0xc37a('0x1c'),this['blindTransfer'][_0xc37a('0x16')](this));ami['on'](_0xc37a('0x1d'),this[_0xc37a('0x1e')][_0xc37a('0x16')](this));}};Report[_0xc37a('0x12')][_0xc37a('0x1f')]=function(_0x305019){var _0xe473ac;_0xe473ac=_[_0xc37a('0x20')](this[_0xc37a('0x10')],function(_0x50042a){return _0x50042a['accountcode']==_0x305019||_0x50042a[_0xc37a('0x21')]==_0x305019;});if(_[_0xc37a('0x22')](_0xe473ac)){var _0x468ed2=_[_0xc37a('0x20')](this['telephones'],function(_0x2ab384){return _0x2ab384[_0xc37a('0x23')]==_0x305019||_0x2ab384[_0xc37a('0x21')]==_0x305019;});if(_0x468ed2){_0xe473ac=_[_0xc37a('0x20')](this['agents'],function(_0x1df30e){return _0x1df30e[_0xc37a('0x24')]==util[_0xc37a('0x25')]('SIP/%s',_0x468ed2[_0xc37a('0x21')]);});}}return _0xe473ac;};Report[_0xc37a('0x12')][_0xc37a('0x26')]=function(_0x11daf9){for(var _0x5e1ba6=0x0;_0x5e1ba6<_0x11daf9[_0xc37a('0x27')];_0x5e1ba6+=0x1){var _0x1715fe=this[_0xc37a('0x1f')](_0x11daf9[_0x5e1ba6]['connectedlinenum']);if(_0x1715fe){_0x11daf9[_0x5e1ba6][_0xc37a('0x23')]=_0x1715fe['accountcode'];_0x11daf9[_0x5e1ba6][_0xc37a('0x28')]=!![];_0x11daf9[_0x5e1ba6][_0xc37a('0x29')]=_0x1715fe[_0xc37a('0x21')];_0x11daf9[_0x5e1ba6]['interface']=_['isNil'](_0x1715fe[_0xc37a('0x24')])?util[_0xc37a('0x25')](_0xc37a('0x2a'),_0x1715fe['name']):_0x1715fe['interface'];if(_0x11daf9[_0x5e1ba6][_0xc37a('0x2b')]){_0x11daf9[_0x5e1ba6]['queuecallercompleteAt']=moment()[_0xc37a('0x25')](_0xc37a('0x2c'));}if(_0x11daf9[_0x5e1ba6]['queuecallerexit']){_0x11daf9[_0x5e1ba6][_0xc37a('0x2d')]=moment()[_0xc37a('0x25')](_0xc37a('0x2c'));}RpcMemberReport[_0xc37a('0x26')](_0x11daf9[_0x5e1ba6]);}RpcVoiceQueueReport[_0xc37a('0x2e')](_0x11daf9[_0x5e1ba6]);}};function extractCalleridNumber(_0x4374d4){var _0x1dae70=_0x4374d4['match'](/<(.*?)>/);return _0x1dae70?_0x1dae70[0x1]:_0x4374d4;}Report[_0xc37a('0x12')]['getAgentByInternal']=function(_0x32acb2){for(var _0x4c860b=0x0;_0x4c860b','transfers','linkedid','uniqueid','blindTransfer','membername','create','monitor','monitors','monitorFilename','filename','exten','connectedlinenum','calleridname','connectedlinename','xcally-motion-dialer','forEach','Local','substring','indexOf','mobile','phone','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport'];(function(_0x13b70f,_0x5c1116){var _0x51427c=function(_0x54bb0b){while(--_0x54bb0b){_0x13b70f['push'](_0x13b70f['shift']());}};_0x51427c(++_0x5c1116);}(_0x11a3,0x1b0));var _0x311a=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x11a3[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x311a('0x0'));var moment=require(_0x311a('0x1'));var util=require(_0x311a('0x2'));var config=require(_0x311a('0x3'));var ami=require(_0x311a('0x4'));var RpcVoiceAgentReport=require(_0x311a('0x5'));var RpcVoiceCallReport=require(_0x311a('0x6'));var RpcVoiceDialReport=require(_0x311a('0x7'));var RpcMemberReport=require(_0x311a('0x8'));var RpcVoiceQueueReport=require(_0x311a('0x9'));var RpcVoiceRecording=require(_0x311a('0xa'));var RpcVoiceTransferReport=require(_0x311a('0xb'));var VoiceQueueReport=require(_0x311a('0xc'));var VoiceCallReport=require(_0x311a('0xd'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x2057c3){this['realtime']=_0x2057c3;this[_0x311a('0xe')]=_0x2057c3[_0x311a('0xe')];this['telephones']=_0x2057c3[_0x311a('0xf')];}Report[_0x311a('0x10')]['sync']=function(_0x2e9894){var _0x524ab1=new VoiceQueueReport(this[_0x311a('0x11')]);var _0x152dbe=new VoiceAgentReport(this[_0x311a('0x11')]);var _0x50ac90=new VoiceDialReport(this[_0x311a('0x11')]);var _0x3e55cb=new VoiceCallReport(this['realtime']);var _0xfa32fc=new UserReport(this[_0x311a('0x11')]);if(config[_0x311a('0x12')]&&config[_0x311a('0x12')][_0x311a('0x13')]){ami['on'](_0x311a('0x14'),this[_0x311a('0x15')]['bind'](this));ami['on'](_0x311a('0x16'),this[_0x311a('0x17')]['bind'](this));ami['on'](_0x311a('0x18'),this['voiceAgentReport'][_0x311a('0x19')](this));ami['on'](_0x311a('0x1a'),this[_0x311a('0x1b')][_0x311a('0x19')](this));ami['on'](_0x311a('0x1c'),this['blindTransfer'][_0x311a('0x19')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x311a('0x19')](this));}};Report[_0x311a('0x10')]['findAgent']=function(_0x2ccb4e){var _0x1a4c52;_0x1a4c52=_[_0x311a('0x1d')](this[_0x311a('0xe')],function(_0x226fc0){return _0x226fc0[_0x311a('0x1e')]==_0x2ccb4e||_0x226fc0[_0x311a('0x1f')]==_0x2ccb4e;});if(_['isNil'](_0x1a4c52)){var _0x37f504=_[_0x311a('0x1d')](this['telephones'],function(_0x146895){return _0x146895[_0x311a('0x1e')]==_0x2ccb4e||_0x146895['name']==_0x2ccb4e;});if(_0x37f504){_0x1a4c52=_[_0x311a('0x1d')](this['agents'],function(_0x58eaaf){return _0x58eaaf[_0x311a('0x20')]==util[_0x311a('0x21')](_0x311a('0x22'),_0x37f504['name']);});}}return _0x1a4c52;};Report[_0x311a('0x10')]['voiceQueueReport']=function(_0x21504b){for(var _0x27b2d5=0x0;_0x27b2d5<_0x21504b[_0x311a('0x23')];_0x27b2d5+=0x1){var _0x409bed=this[_0x311a('0x24')](_0x21504b[_0x27b2d5]['connectedlinenum']);if(_0x409bed){_0x21504b[_0x27b2d5][_0x311a('0x1e')]=_0x409bed[_0x311a('0x1e')];_0x21504b[_0x27b2d5]['assigned']=!![];_0x21504b[_0x27b2d5]['lastAssignedTo']=_0x409bed[_0x311a('0x1f')];_0x21504b[_0x27b2d5][_0x311a('0x20')]=_[_0x311a('0x25')](_0x409bed[_0x311a('0x20')])?util['format']('SIP/%s',_0x409bed['name']):_0x409bed[_0x311a('0x20')];if(_0x21504b[_0x27b2d5][_0x311a('0x26')]){_0x21504b[_0x27b2d5][_0x311a('0x27')]=moment()[_0x311a('0x21')](_0x311a('0x28'));}if(_0x21504b[_0x27b2d5]['queuecallerexit']){_0x21504b[_0x27b2d5][_0x311a('0x29')]=moment()[_0x311a('0x21')](_0x311a('0x28'));}RpcMemberReport[_0x311a('0x15')](_0x21504b[_0x27b2d5]);}RpcVoiceQueueReport['create'](_0x21504b[_0x27b2d5]);}};function extractCalleridNumber(_0x48ded2){var _0x148072=_0x48ded2[_0x311a('0x2a')](/<(.*?)>/);return _0x148072?_0x148072[0x1]:_0x48ded2;}Report[_0x311a('0x10')][_0x311a('0x2b')]=function(_0x5bcf1e){for(var _0x33ca7b=0x0;_0x33ca7b0x0?!![]:![];if(!_0x326618){return this['syncQueueSummaryComplete'](this['summary'][_0x3646('0x70')]);}};VoiceQueueReport[_0x3646('0xd')][_0x3646('0x1f')]=function(_0x588f93){var _0x1abe7e=this[_0x3646('0x18')]['id'];if(this['summary']['queuestatus'][_0x1abe7e]&&this['summary'][_0x3646('0x6d')][_0x1abe7e][_0x588f93[_0x3646('0x64')]]){this['summary'][_0x3646('0x6d')][_0x1abe7e][_0x588f93['actionid']][_0x3646('0x14')][_0x3646('0x71')](_0x588f93);}};VoiceQueueReport[_0x3646('0xd')]['syncQueueSummary']=function(_0x56e4e6){var _0x2806e6=this;try{if(this[_0x3646('0x5b')](_0x56e4e6)&&this[_0x3646('0x5b')](_0x56e4e6[_0x3646('0x54')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util[_0x3646('0x42')](_0x56e4e6,{'showHidden':![],'depth':null}));var _0x30c327=this[_0x3646('0x16')][_0x56e4e6[_0x3646('0x54')]];if(_0x30c327){logger[_0x3646('0x51')](_0x3646('0x72'),_0x30c327[_0x3646('0x67')]);this[_0x3646('0x18')]['queues'][_0x30c327[_0x3646('0x67')]]={'summaryEvent':_0x56e4e6};this[_0x3646('0x18')]['statusRequests']+=0x1;return ami[_0x3646('0x5d')]({'action':'queuestatus','queue':_0x30c327[_0x3646('0x67')]})['then'](function(_0x48a13f){if(!_0x2806e6['summary'][_0x3646('0x6d')][_0x56e4e6[_0x3646('0x64')]]){_0x2806e6[_0x3646('0x18')][_0x3646('0x6d')][_0x56e4e6[_0x3646('0x64')]]={};}_0x2806e6['summary'][_0x3646('0x6d')][_0x56e4e6[_0x3646('0x64')]][_0x48a13f[_0x3646('0x64')]]={'queue':_0x30c327[_0x3646('0x67')],'agents':[]};})[_0x3646('0x5f')](function(_0x479bcf){throw _0x479bcf;});}}}catch(_0x25a7a5){logger['error'](_0x3646('0x65'),util['inspect'](_0x25a7a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3646('0xd')]['syncQueueSummaryComplete']=function(_0x4ce211){if(this[_0x3646('0x18')][_0x3646('0x6f')]>0x0){this['summary'][_0x3646('0x70')]=_0x4ce211;return;}logger['debug'](_0x3646('0x73'),util[_0x3646('0x42')](_0x4ce211,{'showHidden':![],'depth':null}));this[_0x3646('0x18')]=initializeSummary();ami['emit'](_0x3646('0x74'),{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x121a15){try{if(this['isNotNull'](_0x121a15)){logger[_0x3646('0x51')](_0x3646('0x75'),_0x121a15['uniqueid'],util['inspect'](_0x121a15,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x3646('0x12')][_0x121a15[_0x3646('0x4d')]])){this[_0x3646('0x12')][_0x121a15[_0x3646('0x4d')]]=[];}if(_[_0x3646('0x5c')](this[_0x3646('0x3d')][_0x121a15['uniqueid']])){this[_0x3646('0x3d')][_0x121a15['uniqueid']]={};}var _0x42bd5b=new QueueReport();_0x42bd5b[_0x3646('0x54')]=_0x121a15[_0x3646('0x54')];_0x42bd5b['type']=this[_0x3646('0x16')][_0x42bd5b[_0x3646('0x54')]]&&this['voiceQueues'][_0x42bd5b[_0x3646('0x54')]][_0x3646('0x57')]?this[_0x3646('0x16')][_0x42bd5b[_0x3646('0x54')]][_0x3646('0x57')]||_0x3646('0x58'):_0x3646('0x58');_0x42bd5b[_0x3646('0x76')]=moment()[_0x3646('0x4e')](_0x3646('0x77'));_0x42bd5b[_0x3646('0x78')]=_0x121a15[_0x3646('0x78')];_0x42bd5b['count']=_0x121a15[_0x3646('0x79')];_0x42bd5b[_0x3646('0x4d')]=_0x121a15[_0x3646('0x4d')];_0x42bd5b[_0x3646('0x7a')]=this['channels'][_0x121a15[_0x3646('0x4d')]][_0x3646('0x7a')];logger['info'](_0x3646('0x7b'),_0x42bd5b['queue'],_0x42bd5b[_0x3646('0x57')]);Object['assign'](_0x42bd5b,_['pick'](_0x121a15,_['keys'](_0x42bd5b)));this['queueReports'][_0x121a15[_0x3646('0x4d')]]['push'](_0x42bd5b);this[_0x3646('0x3d')][_0x121a15['uniqueid']]=_0x42bd5b;this['emitVoiceQueueChannelSave'](_0x42bd5b,_0x3646('0x21'));}}catch(_0x50359c){logger[_0x3646('0x43')](_0x3646('0x75'),_0x121a15[_0x3646('0x4d')],util[_0x3646('0x42')](_0x50359c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3646('0xd')]['syncQueueCallerAbandon']=function(_0x66836c){try{if(this['isNotNull'](_0x66836c)){logger[_0x3646('0x51')](_0x3646('0x7c'),_0x66836c['uniqueid'],util[_0x3646('0x42')](_0x66836c,{'showHidden':![],'depth':null}));if(this[_0x3646('0x12')][_0x66836c[_0x3646('0x4d')]]){var _0x2c5ea7=_[_0x3646('0x7d')](this[_0x3646('0x12')][_0x66836c['uniqueid']]);_0x2c5ea7['queuecallercomplete']=![];_0x2c5ea7['queuecallercompleteAt']=null;_0x2c5ea7[_0x3646('0x7e')]=_0x66836c['holdtime'];_0x2c5ea7[_0x3646('0x7f')]=_0x66836c[_0x3646('0x7f')];_0x2c5ea7['queuecallerabandon']=!![];_0x2c5ea7[_0x3646('0x80')]=moment()[_0x3646('0x4e')](_0x3646('0x77'));_0x2c5ea7['queuecallerexitreason']='ABANDONED';_0x2c5ea7[_0x3646('0x81')]=null;logger[_0x3646('0x82')](_0x3646('0x83'),_0x2c5ea7[_0x3646('0x54')],_0x2c5ea7[_0x3646('0x57')]);this[_0x3646('0x3d')][_0x66836c[_0x3646('0x4d')]]=_0x2c5ea7;this[_0x3646('0x48')](_0x2c5ea7,'queuecallerabandon');}}}catch(_0x2ae79b){logger[_0x3646('0x43')](_0x3646('0x7c'),_0x66836c['uniqueid'],util[_0x3646('0x42')](_0x2ae79b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3646('0xd')][_0x3646('0x84')]=function(_0x3acf8c){try{if(this[_0x3646('0x5b')](_0x3acf8c)){logger[_0x3646('0x51')](_0x3646('0x85'),_0x3acf8c[_0x3646('0x4d')],util['inspect'](_0x3acf8c,{'showHidden':![],'depth':null}));if(this[_0x3646('0x12')][_0x3acf8c['uniqueid']]){var _0x230867=_['last'](this[_0x3646('0x12')][_0x3acf8c[_0x3646('0x4d')]]);_0x230867[_0x3646('0x86')]=moment()[_0x3646('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x230867[_0x3646('0x87')]=_0x3acf8c['connectedlinenum'];_0x230867[_0x3646('0x88')]=_0x3acf8c[_0x3646('0x88')];logger['info'](_0x3646('0x89'),_0x230867[_0x3646('0x54')],_0x230867['type'],_0x3acf8c[_0x3646('0x87')],_0x3acf8c[_0x3646('0x88')]);this['channels'][_0x3acf8c['uniqueid']]=_0x230867;this[_0x3646('0x4b')](_0x230867,_0x3646('0x8a'));}}}catch(_0x1615fa){logger[_0x3646('0x43')]('[%s][voiceQueueReport][queuecallerleave]',_0x3acf8c[_0x3646('0x4d')],util[_0x3646('0x42')](_0x1615fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3646('0x25')]=function(_0x3de1ca){try{if(this[_0x3646('0x5b')](_0x3de1ca)){logger[_0x3646('0x51')]('[%s][voiceQueueReport][agentconnect]',_0x3de1ca[_0x3646('0x4d')],util['inspect'](_0x3de1ca,{'showHidden':![],'depth':null}));if(this[_0x3646('0x12')][_0x3de1ca[_0x3646('0x4d')]]){var _0x3e2ff1=_[_0x3646('0x7d')](this[_0x3646('0x12')][_0x3de1ca[_0x3646('0x4d')]]);_0x3e2ff1[_0x3646('0x3b')]=!![];_0x3e2ff1['queuecallerexitreason']='COMPLETEDBYAGENT';logger['info'](_0x3646('0x8b'),_0x3e2ff1['queue'],_0x3e2ff1[_0x3646('0x57')]);}}}catch(_0x5ca844){logger['error'](_0x3646('0x8c'),_0x3de1ca[_0x3646('0x4d')],util[_0x3646('0x42')](_0x5ca844,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3646('0xd')]['syncAgentComplete']=function(_0x22071c){try{if(this[_0x3646('0x5b')](_0x22071c)){logger[_0x3646('0x51')](_0x3646('0x8d'),_0x22071c[_0x3646('0x4d')],util['inspect'](_0x22071c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x22071c[_0x3646('0x4d')]]){var _0x26dfc3=_[_0x3646('0x7d')](this[_0x3646('0x12')][_0x22071c['uniqueid']]);_0x26dfc3[_0x3646('0x3a')]=![];_0x26dfc3[_0x3646('0x80')]=null;_0x26dfc3[_0x3646('0x8e')]=!![];_0x26dfc3['lastAssignedTo']=_0x22071c[_0x3646('0x8f')];_0x26dfc3[_0x3646('0x7e')]=_0x22071c['holdtime'];_0x26dfc3[_0x3646('0x3b')]=!![];_0x26dfc3[_0x3646('0x90')]=![];_0x26dfc3[_0x3646('0x91')]=null;if(!_0x26dfc3['transfer']){if(_0x22071c['reason']=='transfer'){_0x26dfc3[_0x3646('0x92')]='COMPLETED';logger['info'](_0x3646('0x93'),_0x26dfc3[_0x3646('0x54')],_0x26dfc3[_0x3646('0x57')]);}else{if(_[_0x3646('0x94')](_0x22071c[_0x3646('0x95')]['toLowerCase'](),_0x3646('0x96'))){if(this['queueReports'][_0x22071c['linkedid']]){var _0x5689eb=_[_0x3646('0x7d')](this[_0x3646('0x12')][_0x22071c['linkedid']]);_0x5689eb[_0x3646('0x3b')]=![];_0x5689eb[_0x3646('0x90')]=!![];_0x5689eb[_0x3646('0x91')]=moment(_0x26dfc3[_0x3646('0x76')])['add'](_0x22071c[_0x3646('0x7e')],_0x3646('0x97'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5689eb['queuecallerexitreason']='FORWARDTRANSFER';_0x5689eb[_0x3646('0x98')]=!![];_0x5689eb['transfertype']=_0x3646('0x99');_0x5689eb['transferexten']=_0x22071c[_0x3646('0x9a')];_0x5689eb[_0x3646('0x9b')]=_0x22071c[_0x3646('0x4d')];logger[_0x3646('0x82')](_0x3646('0x9c'),_0x5689eb['queue'],_0x5689eb[_0x3646('0x57')]);var _0x226e44=this[_0x3646('0x12')][_0x22071c[_0x3646('0x9d')]];this['queueReports'][_0x22071c[_0x3646('0x9d')]]=this[_0x3646('0x12')][_0x22071c[_0x3646('0x4d')]];this[_0x3646('0x12')][_0x22071c['uniqueid']]=_0x226e44;}}else{_0x26dfc3[_0x3646('0x92')]=_0x3646('0x9e')+_0x22071c[_0x3646('0x9f')]['toUpperCase']();logger[_0x3646('0x82')](_0x3646('0xa0'),_0x26dfc3[_0x3646('0x54')],_0x26dfc3['type'],_0x26dfc3[_0x3646('0x92')]);}}}this[_0x3646('0x3d')][_0x22071c[_0x3646('0x4d')]]=_0x26dfc3;}}}catch(_0x123189){logger[_0x3646('0x43')](_0x3646('0x8d'),_0x22071c[_0x3646('0x4d')],util[_0x3646('0x42')](_0x123189,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3646('0xd')]['syncVarSet']=function(_0x5e7740){try{if(this['isNotNull'](_0x5e7740)){logger[_0x3646('0x51')]('[%s][voiceQueueReport][varset]',_0x5e7740[_0x3646('0x4d')],util[_0x3646('0x42')](_0x5e7740,{'showHidden':![],'depth':null}));this['addVariable'](_0x5e7740[_0x3646('0x4d')],_['keys'](_0x5e7740['variable'])[0x0],_0x5e7740[_0x3646('0xa1')]);if(this['queueReports'][_0x5e7740[_0x3646('0x4d')]]){var _0x5d2a79=_['last'](this[_0x3646('0x12')][_0x5e7740['uniqueid']]);if(_0x5d2a79){if(this[_0x3646('0x5b')](_0x5e7740['variable'])&&this[_0x3646('0x5b')](_0x5e7740[_0x3646('0xa2')][_0x3646('0x6d')])){switch(_0x5e7740[_0x3646('0xa1')]){case _0x3646('0xa3'):_0x5d2a79[_0x3646('0x90')]=![];_0x5d2a79[_0x3646('0x91')]=null;break;case _0x3646('0xa4'):_0x5d2a79['lastevent']='timeout';_0x5d2a79[_0x3646('0x90')]=!![];_0x5d2a79[_0x3646('0x91')]=moment()[_0x3646('0x4e')](_0x3646('0x77'));_0x5d2a79[_0x3646('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x3646('0xa5'),_0x5e7740[_0x3646('0x4d')],util[_0x3646('0x42')](_0x5d2a79,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x5d2a79);break;default:_0x5d2a79[_0x3646('0x90')]=!![];_0x5d2a79[_0x3646('0x91')]=moment()[_0x3646('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d2a79[_0x3646('0x86')]=moment()['format'](_0x3646('0x77'));}_0x5d2a79[_0x3646('0x3a')]=![];_0x5d2a79[_0x3646('0x80')]=null;_0x5d2a79[_0x3646('0x92')]=_0x5e7740[_0x3646('0xa1')];this[_0x3646('0x3d')][_0x5e7740['uniqueid']]=_0x5d2a79;this[_0x3646('0x48')](_0x5d2a79,_0x3646('0x26'));}else if(this[_0x3646('0x5b')](_0x5e7740[_0x3646('0xa2')])&&this['isNotNull'](_0x5e7740['variable']['queueposition'])){if(!_0x5d2a79[_0x3646('0x3a')]){_0x5d2a79[_0x3646('0x90')]=!![];_0x5d2a79[_0x3646('0x91')]=moment()['format'](_0x3646('0x77'));_0x5d2a79[_0x3646('0x92')]=_0x3646('0xa6');_0x5d2a79[_0x3646('0x86')]=moment()[_0x3646('0x4e')](_0x3646('0x77'));this['channels'][_0x5e7740[_0x3646('0x4d')]]=_0x5d2a79;}}logger[_0x3646('0x82')](_0x3646('0xa7'),_0x5e7740[_0x3646('0x4d')],_0x5d2a79[_0x3646('0x54')],_0x5d2a79['type'],_[_0x3646('0xa8')](_0x5e7740['variable'])[0x0],_0x5e7740['value']);_0x5d2a79[_0x3646('0x19')]=this['variables'][_0x5e7740['uniqueid']];}}}}catch(_0x4856b6){logger[_0x3646('0x43')](_0x3646('0xa9'),_0x5e7740[_0x3646('0x4d')],util[_0x3646('0x42')](_0x4856b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3646('0xaa')]=function(_0x40d8d8,_0x38393d,_0x39ecc6){var _0x65ce4f=[_0x3646('0xab'),_0x3646('0xac'),'rtpaudioqosjitter',_0x3646('0xad'),_0x3646('0xae'),_0x3646('0xaf'),'rtpaudioqosrtt',_0x3646('0xb0'),_0x3646('0xb1'),'sipuri',_0x3646('0xb2'),_0x3646('0xb3'),_0x3646('0xb4'),'memberdynamic',_0x3646('0xb5'),_0x3646('0xb6'),_0x3646('0x8f'),'memberpenalty',_0x3646('0xb7')];if(!_[_0x3646('0x3f')](_0x38393d)&&!_['includes'](_0x65ce4f,_0x38393d)){if(_[_0x3646('0x5c')](this[_0x3646('0x19')][_0x40d8d8])){this[_0x3646('0x19')][_0x40d8d8]={};}this[_0x3646('0x19')][_0x40d8d8][_0x38393d]=_0x39ecc6;}};VoiceQueueReport[_0x3646('0xd')]['handleHangup']=function(_0x481415,_0x532024,_0x180d80){try{var _0x523d23={};if(this[_0x3646('0x12')][_0x481415]){for(var _0x17ebcd=0x0;_0x17ebcd0x0?!![]:![];if(!_0x4c90dc){return this[_0x008a('0x16')](this[_0x008a('0x46')]['completeEvent']);}};VoiceQueueReport[_0x008a('0x8')][_0x008a('0x17')]=function(_0x1f9adc){var _0xcfb32f=this[_0x008a('0x46')]['id'];if(this[_0x008a('0x46')][_0x008a('0x5f')][_0xcfb32f]&&this[_0x008a('0x46')][_0x008a('0x5f')][_0xcfb32f][_0x1f9adc['actionid']]){this[_0x008a('0x46')]['queuestatus'][_0xcfb32f][_0x1f9adc[_0x008a('0x5e')]][_0x008a('0xd')][_0x008a('0x69')](_0x1f9adc);}};VoiceQueueReport['prototype'][_0x008a('0x13')]=function(_0x584f2){var _0x1a6893=this;try{if(this['isNotNull'](_0x584f2)&&this[_0x008a('0x59')](_0x584f2[_0x008a('0x4e')])){logger[_0x008a('0x4b')](_0x008a('0x6a'),util[_0x008a('0x42')](_0x584f2,{'showHidden':![],'depth':null}));var _0x234bde=this['voiceQueues'][_0x584f2[_0x008a('0x4e')]];if(_0x234bde){logger[_0x008a('0x4b')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x234bde[_0x008a('0x58')]);this[_0x008a('0x46')]['queues'][_0x234bde[_0x008a('0x58')]]={'summaryEvent':_0x584f2};this[_0x008a('0x46')][_0x008a('0x68')]+=0x1;return ami[_0x008a('0x3c')]({'action':_0x008a('0x5f'),'queue':_0x234bde[_0x008a('0x58')]})[_0x008a('0x6b')](function(_0x3a273c){if(!_0x1a6893['summary'][_0x008a('0x5f')][_0x584f2[_0x008a('0x5e')]]){_0x1a6893[_0x008a('0x46')]['queuestatus'][_0x584f2['actionid']]={};}_0x1a6893[_0x008a('0x46')][_0x008a('0x5f')][_0x584f2[_0x008a('0x5e')]][_0x3a273c[_0x008a('0x5e')]]={'queue':_0x234bde[_0x008a('0x58')],'agents':[]};})[_0x008a('0x3e')](function(_0x5d49bf){throw _0x5d49bf;});}}}catch(_0x3357e8){logger[_0x008a('0x41')](_0x008a('0x6c'),util[_0x008a('0x42')](_0x3357e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x008a('0x8')][_0x008a('0x16')]=function(_0x280745){if(this[_0x008a('0x46')][_0x008a('0x68')]>0x0){this[_0x008a('0x46')][_0x008a('0x6d')]=_0x280745;return;}logger[_0x008a('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x008a('0x42')](_0x280745,{'showHidden':![],'depth':null}));this[_0x008a('0x46')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0x008a('0x6e')]=function(_0x21dd3b){try{if(this[_0x008a('0x59')](_0x21dd3b)){logger[_0x008a('0x4b')](_0x008a('0x6f'),_0x21dd3b['uniqueid'],util[_0x008a('0x42')](_0x21dd3b,{'showHidden':![],'depth':null}));if(_[_0x008a('0x5a')](this[_0x008a('0xc')][_0x21dd3b[_0x008a('0x4c')]])){this[_0x008a('0xc')][_0x21dd3b[_0x008a('0x4c')]]=[];}if(_[_0x008a('0x5a')](this[_0x008a('0xe')][_0x21dd3b[_0x008a('0x4c')]])){this[_0x008a('0xe')][_0x21dd3b[_0x008a('0x4c')]]={};}var _0xeced9e=new QueueReport();_0xeced9e[_0x008a('0x4e')]=_0x21dd3b[_0x008a('0x4e')];_0xeced9e[_0x008a('0x70')]=this[_0x008a('0x66')][_0xeced9e[_0x008a('0x4e')]]&&this[_0x008a('0x66')][_0xeced9e[_0x008a('0x4e')]][_0x008a('0x70')]?this[_0x008a('0x66')][_0xeced9e['queue']][_0x008a('0x70')]||_0x008a('0x57'):_0x008a('0x57');_0xeced9e[_0x008a('0x71')]=moment()[_0x008a('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0xeced9e['position']=_0x21dd3b[_0x008a('0x72')];_0xeced9e[_0x008a('0x73')]=_0x21dd3b['count'];_0xeced9e[_0x008a('0x4c')]=_0x21dd3b[_0x008a('0x4c')];_0xeced9e[_0x008a('0x74')]=this['channels'][_0x21dd3b[_0x008a('0x4c')]][_0x008a('0x74')];logger[_0x008a('0x75')](_0x008a('0x76'),_0xeced9e['queue'],_0xeced9e[_0x008a('0x70')]);Object[_0x008a('0x64')](_0xeced9e,_[_0x008a('0x77')](_0x21dd3b,_['keys'](_0xeced9e)));this[_0x008a('0xc')][_0x21dd3b['uniqueid']][_0x008a('0x69')](_0xeced9e);this[_0x008a('0xe')][_0x21dd3b[_0x008a('0x4c')]]=_0xeced9e;this[_0x008a('0x4a')](_0xeced9e,_0x008a('0x1a'));}}catch(_0x528efc){logger[_0x008a('0x41')](_0x008a('0x6f'),_0x21dd3b[_0x008a('0x4c')],util['inspect'](_0x528efc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x008a('0x8')]['syncQueueCallerAbandon']=function(_0xb2789){try{if(this['isNotNull'](_0xb2789)){logger[_0x008a('0x4b')](_0x008a('0x78'),_0xb2789[_0x008a('0x4c')],util[_0x008a('0x42')](_0xb2789,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb2789[_0x008a('0x4c')]]){var _0x877db3=_[_0x008a('0x79')](this[_0x008a('0xc')][_0xb2789['uniqueid']]);_0x877db3['queuecallercomplete']=![];_0x877db3[_0x008a('0x7a')]=null;_0x877db3['holdtime']=_0xb2789['holdtime'];_0x877db3['originalposition']=_0xb2789[_0x008a('0x7b')];_0x877db3[_0x008a('0x38')]=!![];_0x877db3['queuecallerabandonAt']=moment()[_0x008a('0x4d')](_0x008a('0x7c'));_0x877db3[_0x008a('0x52')]=_0x008a('0x7d');_0x877db3[_0x008a('0x7e')]=null;logger[_0x008a('0x75')](_0x008a('0x7f'),_0x877db3[_0x008a('0x4e')],_0x877db3[_0x008a('0x70')]);this['channels'][_0xb2789[_0x008a('0x4c')]]=_0x877db3;this[_0x008a('0x47')](_0x877db3,_0x008a('0x38'));}}}catch(_0x324fe1){logger[_0x008a('0x41')](_0x008a('0x78'),_0xb2789[_0x008a('0x4c')],util[_0x008a('0x42')](_0x324fe1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x008a('0x8')]['syncQueueCallerLeave']=function(_0x4a9dfb){try{if(this[_0x008a('0x59')](_0x4a9dfb)){logger['debug'](_0x008a('0x80'),_0x4a9dfb[_0x008a('0x4c')],util[_0x008a('0x42')](_0x4a9dfb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4a9dfb[_0x008a('0x4c')]]){var _0x5edccc=_[_0x008a('0x79')](this['queueReports'][_0x4a9dfb['uniqueid']]);_0x5edccc['queuecallerleaveAt']=moment()['format'](_0x008a('0x7c'));_0x5edccc[_0x008a('0x81')]=_0x4a9dfb[_0x008a('0x81')];_0x5edccc[_0x008a('0x82')]=_0x4a9dfb[_0x008a('0x82')];logger[_0x008a('0x75')](_0x008a('0x83'),_0x5edccc[_0x008a('0x4e')],_0x5edccc[_0x008a('0x70')],_0x4a9dfb['connectedlinenum'],_0x4a9dfb[_0x008a('0x82')]);this[_0x008a('0xe')][_0x4a9dfb[_0x008a('0x4c')]]=_0x5edccc;this[_0x008a('0x4a')](_0x5edccc,_0x008a('0x1c'));}}}catch(_0x592b1b){logger[_0x008a('0x41')](_0x008a('0x80'),_0x4a9dfb[_0x008a('0x4c')],util[_0x008a('0x42')](_0x592b1b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x596a75){try{if(this[_0x008a('0x59')](_0x596a75)){logger[_0x008a('0x4b')](_0x008a('0x84'),_0x596a75[_0x008a('0x4c')],util[_0x008a('0x42')](_0x596a75,{'showHidden':![],'depth':null}));if(this[_0x008a('0xc')][_0x596a75[_0x008a('0x4c')]]){var _0xffe53e=_[_0x008a('0x79')](this['queueReports'][_0x596a75['uniqueid']]);_0xffe53e[_0x008a('0x85')]=!![];_0xffe53e[_0x008a('0x52')]=_0x008a('0x86');logger[_0x008a('0x75')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0xffe53e[_0x008a('0x4e')],_0xffe53e[_0x008a('0x70')]);}}}catch(_0x4d5459){logger[_0x008a('0x41')](_0x008a('0x84'),_0x596a75['uniqueid'],util[_0x008a('0x42')](_0x4d5459,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x008a('0x1f')]=function(_0x313b65){try{if(this[_0x008a('0x59')](_0x313b65)){logger[_0x008a('0x4b')](_0x008a('0x87'),_0x313b65[_0x008a('0x4c')],util[_0x008a('0x42')](_0x313b65,{'showHidden':![],'depth':null}));if(this[_0x008a('0xc')][_0x313b65[_0x008a('0x4c')]]){var _0x4dcd6f=_[_0x008a('0x79')](this[_0x008a('0xc')][_0x313b65[_0x008a('0x4c')]]);_0x4dcd6f[_0x008a('0x38')]=![];_0x4dcd6f[_0x008a('0x88')]=null;_0x4dcd6f[_0x008a('0x89')]=!![];_0x4dcd6f['lastAssignedTo']=_0x313b65[_0x008a('0x8a')];_0x4dcd6f[_0x008a('0x8b')]=_0x313b65[_0x008a('0x8b')];_0x4dcd6f['queuecallercomplete']=!![];_0x4dcd6f[_0x008a('0x37')]=![];_0x4dcd6f[_0x008a('0x8c')]=null;if(!_0x4dcd6f[_0x008a('0x8d')]){if(_0x313b65['reason']==_0x008a('0x8d')){_0x4dcd6f[_0x008a('0x52')]=_0x008a('0x8e');logger[_0x008a('0x75')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4dcd6f[_0x008a('0x4e')],_0x4dcd6f[_0x008a('0x70')]);}else{if(_[_0x008a('0x8f')](_0x313b65['channel'][_0x008a('0x90')](),_0x008a('0x91'))){if(this['queueReports'][_0x313b65[_0x008a('0x92')]]){var _0x4e46e3=_['last'](this['queueReports'][_0x313b65[_0x008a('0x92')]]);_0x4e46e3[_0x008a('0x85')]=![];_0x4e46e3[_0x008a('0x37')]=!![];_0x4e46e3[_0x008a('0x8c')]=moment(_0x4dcd6f[_0x008a('0x71')])[_0x008a('0x93')](_0x313b65[_0x008a('0x8b')],_0x008a('0x94'))[_0x008a('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e46e3[_0x008a('0x52')]=_0x008a('0x95');_0x4e46e3[_0x008a('0x8d')]=!![];_0x4e46e3[_0x008a('0x96')]='FORWARD';_0x4e46e3[_0x008a('0x97')]=_0x313b65['destexten'];_0x4e46e3[_0x008a('0x98')]=_0x313b65['uniqueid'];logger[_0x008a('0x75')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4e46e3['queue'],_0x4e46e3['type']);var _0x590c1a=this[_0x008a('0xc')][_0x313b65[_0x008a('0x92')]];this['queueReports'][_0x313b65[_0x008a('0x92')]]=this[_0x008a('0xc')][_0x313b65[_0x008a('0x4c')]];this['queueReports'][_0x313b65['uniqueid']]=_0x590c1a;}}else{_0x4dcd6f[_0x008a('0x52')]='COMPLETEDBY'+_0x313b65[_0x008a('0x99')]['toUpperCase']();logger[_0x008a('0x75')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x4dcd6f['queue'],_0x4dcd6f[_0x008a('0x70')],_0x4dcd6f[_0x008a('0x52')]);}}}this['channels'][_0x313b65[_0x008a('0x4c')]]=_0x4dcd6f;}}}catch(_0x4e5fa0){logger[_0x008a('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x313b65[_0x008a('0x4c')],util[_0x008a('0x42')](_0x4e5fa0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x008a('0x22')]=function(_0x1db003){try{if(this['isNotNull'](_0x1db003)){logger[_0x008a('0x4b')]('[%s][voiceQueueReport][varset]',_0x1db003['uniqueid'],util[_0x008a('0x42')](_0x1db003,{'showHidden':![],'depth':null}));this[_0x008a('0x9a')](_0x1db003[_0x008a('0x4c')],_[_0x008a('0x9b')](_0x1db003[_0x008a('0x9c')])[0x0],_0x1db003[_0x008a('0x9d')]);if(this[_0x008a('0xc')][_0x1db003[_0x008a('0x4c')]]){var _0x59dbcb=_['last'](this['queueReports'][_0x1db003[_0x008a('0x4c')]]);if(_0x59dbcb){if(this[_0x008a('0x59')](_0x1db003[_0x008a('0x9c')])&&this[_0x008a('0x59')](_0x1db003[_0x008a('0x9c')][_0x008a('0x5f')])){switch(_0x1db003['value']){case _0x008a('0x9e'):_0x59dbcb[_0x008a('0x37')]=![];_0x59dbcb[_0x008a('0x8c')]=null;break;case'TIMEOUT':_0x59dbcb[_0x008a('0x9f')]=_0x008a('0xa0');_0x59dbcb[_0x008a('0x37')]=!![];_0x59dbcb[_0x008a('0x8c')]=moment()['format'](_0x008a('0x7c'));_0x59dbcb[_0x008a('0xa1')]=moment()[_0x008a('0x4d')](_0x008a('0x7c'));logger['debug'](_0x008a('0xa2'),_0x1db003[_0x008a('0x4c')],util['inspect'](_0x59dbcb,{'showHidden':![],'depth':null}));ami[_0x008a('0x49')](_0x008a('0xa3'),_0x59dbcb);break;default:_0x59dbcb[_0x008a('0x37')]=!![];_0x59dbcb['queuecallerexitAt']=moment()['format'](_0x008a('0x7c'));_0x59dbcb[_0x008a('0xa1')]=moment()['format'](_0x008a('0x7c'));}_0x59dbcb['queuecallerabandon']=![];_0x59dbcb[_0x008a('0x88')]=null;_0x59dbcb[_0x008a('0x52')]=_0x1db003[_0x008a('0x9d')];this['channels'][_0x1db003[_0x008a('0x4c')]]=_0x59dbcb;this[_0x008a('0x47')](_0x59dbcb,_0x008a('0x21'));}else if(this[_0x008a('0x59')](_0x1db003[_0x008a('0x9c')])&&this['isNotNull'](_0x1db003[_0x008a('0x9c')][_0x008a('0xa4')])){if(!_0x59dbcb['queuecallerabandon']){_0x59dbcb[_0x008a('0x37')]=!![];_0x59dbcb['queuecallerexitAt']=moment()[_0x008a('0x4d')](_0x008a('0x7c'));_0x59dbcb[_0x008a('0x52')]=_0x008a('0xa5');_0x59dbcb[_0x008a('0xa1')]=moment()[_0x008a('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1db003[_0x008a('0x4c')]]=_0x59dbcb;}}logger['info'](_0x008a('0xa6'),_0x1db003[_0x008a('0x4c')],_0x59dbcb[_0x008a('0x4e')],_0x59dbcb['type'],_[_0x008a('0x9b')](_0x1db003[_0x008a('0x9c')])[0x0],_0x1db003[_0x008a('0x9d')]);_0x59dbcb['variables']=this[_0x008a('0x11')][_0x1db003['uniqueid']];}}}}catch(_0x3178e9){logger[_0x008a('0x41')](_0x008a('0xa7'),_0x1db003['uniqueid'],util[_0x008a('0x42')](_0x3178e9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x008a('0x8')][_0x008a('0x9a')]=function(_0x2f2662,_0x3b32cd,_0x2453ce){var _0x5c0ef3=[_0x008a('0xa8'),_0x008a('0xa9'),_0x008a('0xaa'),_0x008a('0xab'),'rtpaudioqosloss',_0x008a('0xac'),_0x008a('0xad'),_0x008a('0xae'),'sipcallid',_0x008a('0xaf'),'bridgepeer',_0x008a('0xb0'),_0x008a('0xb1'),_0x008a('0xb2'),_0x008a('0xb3'),_0x008a('0xb4'),_0x008a('0x8a'),_0x008a('0xb5'),'memberrealtime'];if(!_[_0x008a('0x3b')](_0x3b32cd)&&!_[_0x008a('0xb6')](_0x5c0ef3,_0x3b32cd)){if(_[_0x008a('0x5a')](this[_0x008a('0x11')][_0x2f2662])){this[_0x008a('0x11')][_0x2f2662]={};}this[_0x008a('0x11')][_0x2f2662][_0x3b32cd]=_0x2453ce;}};VoiceQueueReport[_0x008a('0x8')][_0x008a('0xb7')]=function(_0x3ee229,_0x191c06,_0x494557){try{var _0x5e7790={};if(this[_0x008a('0xc')][_0x3ee229]){for(var _0x340dc1=0x0;_0x340dc1=0x0?moment(_0x131f43[_0xfd28('0x18')])['diff'](_0x131f43[_0xfd28('0x17')],_0xfd28('0xc')):null,'data1':'outbound','data2':_0x131f43[_0xfd28('0x12')],'data3':_0x131f43[_0xfd28('0xf')],'data4':_0x131f43[_0xfd28('0x19')]||null,'role':_0xfd28('0x11'),'internal':_0x131f43[_0xfd28('0x12')]?_['toNumber'](_0x131f43[_0xfd28('0x12')]):undefined,'uniqueid':_0x131f43[_0xfd28('0x1a')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x6a6c=['queuecallercompleteAt','Request','voice','isNil','format','SIP/%s','lastAssignedTo','interface','TALKING','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','lodash','../client','voiceQueueReport'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x6a6c,0x71));var _0xc6a6=function(_0x3363e5,_0x2941a2){_0x3363e5=_0x3363e5-0x0;var _0x2519ad=_0x6a6c[_0x3363e5];return _0x2519ad;};'use strict';var moment=require('moment');var _=require(_0xc6a6('0x0'));var util=require('util');var client=require(_0xc6a6('0x1'));exports[_0xc6a6('0x2')]=function(_0x47a068){var _0x4eb31b=_0x47a068[_0xc6a6('0x3')]||_0x47a068['queuecallerexitAt'];return client[_0xc6a6('0x4')]('CreateMemberReport',{'body':{'channel':_0xc6a6('0x5'),'membername':_0x47a068['lastAssignedTo'],'interface':_[_0xc6a6('0x6')](_0x47a068['interface'])?util[_0xc6a6('0x7')](_0xc6a6('0x8'),_0x47a068[_0xc6a6('0x9')]):_0x47a068[_0xc6a6('0xa')],'type':_0xc6a6('0xb'),'enterAt':_0x47a068[_0xc6a6('0xc')],'exitAt':_0x4eb31b,'duration':moment(_0x4eb31b)['diff'](_0x47a068['queuecallerleaveAt'],_0xc6a6('0xd')),'data1':'inbound','data2':_0x47a068[_0xc6a6('0xe')],'data3':_0x47a068[_0xc6a6('0xf')],'data4':null,'data5':_0x47a068[_0xc6a6('0x10')],'role':_0xc6a6('0x11'),'internal':_0x47a068[_0xc6a6('0x12')]?_[_0xc6a6('0x13')](_0x47a068[_0xc6a6('0x12')]):undefined,'uniqueid':_0x47a068[_0xc6a6('0x14')]},'log':_0xc6a6('0x15')});};exports[_0xc6a6('0x16')]=function(_0x653874){return client[_0xc6a6('0x4')](_0xc6a6('0x15'),{'body':{'channel':'voice','membername':_0x653874[_0xc6a6('0x17')],'interface':_0x653874[_0xc6a6('0xa')],'type':_0xc6a6('0xb'),'enterAt':_0x653874[_0xc6a6('0x18')],'exitAt':_0x653874['endtime'],'duration':moment(_0x653874[_0xc6a6('0x19')])[_0xc6a6('0x1a')](_0x653874['starttime'],_0xc6a6('0xd'))>=0x0?moment(_0x653874[_0xc6a6('0x19')])[_0xc6a6('0x1a')](_0x653874['starttime'],'seconds'):null,'data1':_0xc6a6('0x1b'),'data2':_0x653874['accountcode'],'data3':_0x653874[_0xc6a6('0xf')],'data4':_0x653874[_0xc6a6('0x1c')]||null,'role':_0xc6a6('0x11'),'internal':_0x653874[_0xc6a6('0x12')]?_[_0xc6a6('0x13')](_0x653874['accountcode']):undefined,'uniqueid':_0x653874[_0xc6a6('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f6eb055..561960f 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 _0xb875=['stopRecordingOnTransfer','GetSettings','../client'];(function(_0x2a053e,_0x5e5b6d){var _0x177a02=function(_0x2232d1){while(--_0x2232d1){_0x2a053e['push'](_0x2a053e['shift']());}};_0x177a02(++_0x5e5b6d);}(_0xb875,0x167));var _0x5b87=function(_0x28e286,_0x10abcd){_0x28e286=_0x28e286-0x0;var _0xfc8d38=_0xb875[_0x28e286];return _0xfc8d38;};'use strict';var client=require(_0x5b87('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5b87('0x1'),'previewRecallmeReminderInterval']},'log':_0x5b87('0x2')});}; \ No newline at end of file +var _0x325b=['getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x325b,0x8b));var _0xb325=function(_0x367dff,_0xd200aa){_0x367dff=_0x367dff-0x0;var _0x3bb13e=_0x325b[_0x367dff];return _0x3bb13e;};'use strict';var client=require(_0xb325('0x0'));exports[_0xb325('0x1')]=function(){return client[_0xb325('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb325('0x3'),_0xb325('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 0e79d4c..df11b24 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 _0x5755=['GetTemplate','name','html','getTemplates'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5755,0x8f));var _0x5575=function(_0x11d7c6,_0x1403f9){_0x11d7c6=_0x11d7c6-0x0;var _0x497472=_0x5755[_0x11d7c6];return _0x497472;};'use strict';var client=require('../client');exports[_0x5575('0x0')]=function(_0x4057a1){return function(_0x8b98a6){return client['Request'](_0x5575('0x1'),{'options':{'raw':!![],'attributes':['id',_0x5575('0x2'),_0x5575('0x3')]},'log':_0x5575('0x1')});};}; \ No newline at end of file +var _0xac85=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x11d989,_0x26ff43){var _0x2f124b=function(_0x526b71){while(--_0x526b71){_0x11d989['push'](_0x11d989['shift']());}};_0x2f124b(++_0x26ff43);}(_0xac85,0x1a0));var _0x5ac8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xac85[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x5ac8('0x0'));exports[_0x5ac8('0x1')]=function(_0x291132){return function(_0x399616){return client[_0x5ac8('0x2')](_0x5ac8('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5ac8('0x4'),_0x5ac8('0x5')]},'log':_0x5ac8('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4c6bc23..89e4676 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 _0x0122=['Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','getTriggers','Request','GetTrigger','channel','status'];(function(_0x402950,_0x52d699){var _0x643b00=function(_0x40124d){while(--_0x40124d){_0x402950['push'](_0x402950['shift']());}};_0x643b00(++_0x52d699);}(_0x0122,0x1c9));var _0x2012=function(_0x37e44a,_0x1d29e0){_0x37e44a=_0x37e44a-0x0;var _0x2e5ca8=_0x0122[_0x37e44a];return _0x2e5ca8;};'use strict';var client=require('../client');exports[_0x2012('0x0')]=function(_0x25a228){return function(_0x21ea38){return client[_0x2012('0x1')](_0x2012('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2012('0x3'),_0x2012('0x4')],'include':[{'model':_0x2012('0x5'),'as':_0x2012('0x6'),'attributes':['id',_0x2012('0x7'),_0x2012('0x8'),_0x2012('0x9')]},{'model':_0x2012('0x5'),'as':_0x2012('0xa'),'attributes':['id',_0x2012('0x7'),_0x2012('0x8'),'value']},{'model':_0x2012('0xb'),'as':_0x2012('0xc'),'attributes':['id',_0x2012('0xd'),_0x2012('0xe'),_0x2012('0xf'),_0x2012('0x10'),_0x2012('0x11'),_0x2012('0x12'),_0x2012('0x13'),_0x2012('0x14')]}]},'log':_0x2012('0x2')});};}; \ No newline at end of file +var _0x2263=['Request','status','Condition','field','operator','value','AnyConditions','Action','Actions','action','data3','data4','data5','data6','data7','../client','getTriggers'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2263,0xec));var _0x3226=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0x2263[_0x593752];return _0x4612be;};'use strict';var client=require(_0x3226('0x0'));exports[_0x3226('0x1')]=function(_0x351cc8){return function(_0x167779){return client[_0x3226('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel',_0x3226('0x3')],'include':[{'model':_0x3226('0x4'),'as':'AllConditions','attributes':['id',_0x3226('0x5'),_0x3226('0x6'),_0x3226('0x7')]},{'model':_0x3226('0x4'),'as':_0x3226('0x8'),'attributes':['id',_0x3226('0x5'),_0x3226('0x6'),_0x3226('0x7')]},{'model':_0x3226('0x9'),'as':_0x3226('0xa'),'attributes':['id',_0x3226('0xb'),'data1','data2',_0x3226('0xc'),_0x3226('0xd'),_0x3226('0xe'),_0x3226('0xf'),_0x3226('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 1204ea0..3d7dee7 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 _0x49c0=['../client','getTrunks','Request','GetTrunk','name','registry','defaultuser'];(function(_0x1db09c,_0x5768e4){var _0x5721e5=function(_0x734930){while(--_0x734930){_0x1db09c['push'](_0x1db09c['shift']());}};_0x5721e5(++_0x5768e4);}(_0x49c0,0x188));var _0x049c=function(_0x4a0b54,_0x3c179f){_0x4a0b54=_0x4a0b54-0x0;var _0x542e59=_0x49c0[_0x4a0b54];return _0x542e59;};'use strict';var client=require(_0x049c('0x0'));exports[_0x049c('0x1')]=function(_0x165e8e){return function(_0x1a6f8b){return client[_0x049c('0x2')](_0x049c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x049c('0x4'),_0x049c('0x5'),_0x049c('0x6')]},'log':_0x049c('0x3')});};}; \ No newline at end of file +var _0x4403=['defaultuser','GetTrunk','name','registry'];(function(_0x440fe1,_0x1a452e){var _0xadd373=function(_0x2bf30f){while(--_0x2bf30f){_0x440fe1['push'](_0x440fe1['shift']());}};_0xadd373(++_0x1a452e);}(_0x4403,0x179));var _0x3440=function(_0x4d63c4,_0x45fef6){_0x4d63c4=_0x4d63c4-0x0;var _0x37c0e1=_0x4403[_0x4d63c4];return _0x37c0e1;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x53b3f6){return function(_0x78fe8c){return client['Request'](_0x3440('0x0'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3440('0x1'),_0x3440('0x2'),_0x3440('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a70fd2b..10f4bb5 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x7ae99e,_0x2b6c32){var _0x2cccf4=function(_0x2b16f){while(--_0x2b16f){_0x7ae99e['push'](_0x7ae99e['shift']());}};_0x2cccf4(++_0x2b6c32);}(_0x34e8,0x12c));var _0x834e=function(_0x1d7958,_0x19724f){_0x1d7958=_0x1d7958-0x0;var _0x1c3ad1=_0x34e8[_0x1d7958];return _0x1c3ad1;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x1034f8,_0x2b21a0){var _0x1016cb=function(_0x4643a6){while(--_0x4643a6){_0x1034f8['push'](_0x1034f8['shift']());}};_0x1016cb(++_0x2b21a0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0xcb91[_0x5a7dd3];return _0x2f4d07;};'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 627d524..106aa48 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 _0x782e=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x782e,0x18f));var _0xe782=function(_0x3c553e,_0x381b12){_0x3c553e=_0x3c553e-0x0;var _0xef9a34=_0x782e[_0x3c553e];return _0xef9a34;};'use strict';var client=require(_0xe782('0x0'));exports['create']=function(_0x3e5b06){return client['Request']('CreateVoiceAgentReport',{'body':_0x3e5b06,'log':_0xe782('0x1')});};exports[_0xe782('0x2')]=function(_0x3ccd84,_0x1fb377,_0x3d8504){return client[_0xe782('0x3')](_0xe782('0x4'),{'body':_0x3ccd84,'options':{'where':{'uniqueid':_0x1fb377,'interface':_0x3d8504,'agentcomplete':!![]}},'log':_0xe782('0x4')});}; \ No newline at end of file +var _0x387a=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x3542c5,_0x3425bf){var _0x29f4f4=function(_0x4aa352){while(--_0x4aa352){_0x3542c5['push'](_0x3542c5['shift']());}};_0x29f4f4(++_0x3425bf);}(_0x387a,0xd5));var _0xa387=function(_0x434857,_0x769589){_0x434857=_0x434857-0x0;var _0x3e0fb3=_0x387a[_0x434857];return _0x3e0fb3;};'use strict';var client=require(_0xa387('0x0'));exports[_0xa387('0x1')]=function(_0x149f5e){return client[_0xa387('0x2')](_0xa387('0x3'),{'body':_0x149f5e,'log':_0xa387('0x3')});};exports[_0xa387('0x4')]=function(_0x1627f4,_0x2ba937,_0x4b9b92){return client['Request'](_0xa387('0x5'),{'body':_0x1627f4,'options':{'where':{'uniqueid':_0x2ba937,'interface':_0x4b9b92,'agentcomplete':!![]}},'log':_0xa387('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d15dd88..0411898 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 _0x391f=['lodash','create','Request','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x5c52a3,_0x13c8d5){var _0x5537b9=function(_0x469e93){while(--_0x469e93){_0x5c52a3['push'](_0x5c52a3['shift']());}};_0x5537b9(++_0x13c8d5);}(_0x391f,0x18d));var _0xf391=function(_0x11bd6f,_0x4548a0){_0x11bd6f=_0x11bd6f-0x0;var _0xb746e=_0x391f[_0x11bd6f];return _0xb746e;};'use strict';var moment=require(_0xf391('0x0'));var util=require(_0xf391('0x1'));var _=require(_0xf391('0x2'));var client=require('../client');exports[_0xf391('0x3')]=function(_0x5cfc3f){return client[_0xf391('0x4')](_0xf391('0x5'),{'body':_['merge'](_0x5cfc3f,{'source':_0x5cfc3f[_0xf391('0x6')],'destinationcontext':_0x5cfc3f['context'],'callerid':_0x5cfc3f[_0xf391('0x7')],'amaflags':_0xf391('0x8')}),'log':_0xf391('0x5')});};exports[_0xf391('0x9')]=function(){return function(){return client[_0xf391('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xf391('0xa')],'createdAt':{'$between':[moment()[_0xf391('0xb')](_0xf391('0xc'))['format'](_0xf391('0xd')),moment()[_0xf391('0xe')](_0xf391('0xc'))[_0xf391('0xf')](_0xf391('0xd'))]}},'attributes':[_0xf391('0x10'),_0xf391('0x11'),_0xf391('0x12'),_0xf391('0x13')]},'log':_0xf391('0x14')});};}; \ No newline at end of file +var _0x021c=['duration','billableseconds','GetVoiceCallReports','moment','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition'];(function(_0x311d71,_0x3585d6){var _0x57c916=function(_0x28929b){while(--_0x28929b){_0x311d71['push'](_0x311d71['shift']());}};_0x57c916(++_0x3585d6);}(_0x021c,0x100));var _0xc021=function(_0x34331b,_0x22a64c){_0x34331b=_0x34331b-0x0;var _0x1f97c8=_0x021c[_0x34331b];return _0x1f97c8;};'use strict';var moment=require(_0xc021('0x0'));var util=require('util');var _=require(_0xc021('0x1'));var client=require('../client');exports[_0xc021('0x2')]=function(_0x355578){return client[_0xc021('0x3')](_0xc021('0x4'),{'body':_[_0xc021('0x5')](_0x355578,{'source':_0x355578[_0xc021('0x6')],'destinationcontext':_0x355578[_0xc021('0x7')],'callerid':_0x355578[_0xc021('0x8')],'amaflags':_0xc021('0x9')}),'log':_0xc021('0x4')});};exports[_0xc021('0xa')]=function(){return function(){return client[_0xc021('0x3')](_0xc021('0xb'),{'options':{'where':{'type':[_0xc021('0xc')],'createdAt':{'$between':[moment()[_0xc021('0xd')](_0xc021('0xe'))[_0xc021('0xf')](_0xc021('0x10')),moment()[_0xc021('0x11')]('day')[_0xc021('0xf')](_0xc021('0x10'))]}},'attributes':[_0xc021('0x12'),_0xc021('0x13'),_0xc021('0x14'),_0xc021('0x15')]},'log':_0xc021('0x16')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index a17bed0..e8acade 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 _0x1c3b=['CreateVoiceDialReport','create','Request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1c3b,0x17b));var _0xb1c3=function(_0x17e48e,_0x114099){_0x17e48e=_0x17e48e-0x0;var _0x219cdc=_0x1c3b[_0x17e48e];return _0x219cdc;};'use strict';var client=require('../client');exports[_0xb1c3('0x0')]=function(_0x709e09){return client[_0xb1c3('0x1')]('CreateVoiceDialReport',{'body':_0x709e09,'log':_0xb1c3('0x2')});}; \ No newline at end of file +var _0xf49c=['Request','CreateVoiceDialReport','../client'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xf49c,0xa7));var _0xcf49=function(_0x540c16,_0x4334f7){_0x540c16=_0x540c16-0x0;var _0x4fad6f=_0xf49c[_0x540c16];return _0x4fad6f;};'use strict';var client=require(_0xcf49('0x0'));exports['create']=function(_0x283bd7){return client[_0xcf49('0x1')](_0xcf49('0x2'),{'body':_0x283bd7,'log':_0xcf49('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 6a42c9e..95a2862 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 _0xa1fd=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x1bc59a,_0x22d2c3){_0x1bc59a=_0x1bc59a-0x0;var _0x3ab7a4=_0xa1fd[_0x1bc59a];return _0x3ab7a4;};'use strict';var client=require(_0xda1f('0x0'));exports[_0xda1f('0x1')]=function(){return function(){return client[_0xda1f('0x2')](_0xda1f('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xda1f('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xda1f('0x1')});};}; \ No newline at end of file +var _0x1ba2=['../client','Request','exten','recordingFormat','getVoiceExtensions'];(function(_0x239bbf,_0x3416e9){var _0x32619d=function(_0x5a6bb5){while(--_0x5a6bb5){_0x239bbf['push'](_0x239bbf['shift']());}};_0x32619d(++_0x3416e9);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x21ba('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x21ba('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x21ba('0x2'),_0x21ba('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x21ba('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 0e28fd9..145dc00 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 _0xfd4b=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x42de15,_0x3e98ae){var _0x22d5f9=function(_0x1fb3d7){while(--_0x1fb3d7){_0x42de15['push'](_0x42de15['shift']());}};_0x22d5f9(++_0x3e98ae);}(_0xfd4b,0x6a));var _0xbfd4=function(_0x3f9391,_0x6aa952){_0x3f9391=_0x3f9391-0x0;var _0x38cbd6=_0xfd4b[_0x3f9391];return _0x38cbd6;};'use strict';var client=require(_0xbfd4('0x0'));exports[_0xbfd4('0x1')]=function(){return function(){return client[_0xbfd4('0x2')](_0xbfd4('0x3'),{'options':{'raw':![],'attributes':['id',_0xbfd4('0x4'),'acw','acwTimeout',_0xbfd4('0x5'),_0xbfd4('0x6'),_0xbfd4('0x7'),_0xbfd4('0x8'),_0xbfd4('0x9'),_0xbfd4('0xa'),_0xbfd4('0xb'),'dialPowerLevel','dialPredictiveOptimization',_0xbfd4('0xc'),_0xbfd4('0xd'),'dialOriginateCallerIdName',_0xbfd4('0xe'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xbfd4('0xf'),_0xbfd4('0x10'),_0xbfd4('0x11'),_0xbfd4('0x12'),_0xbfd4('0x13'),_0xbfd4('0x14'),_0xbfd4('0x15'),_0xbfd4('0x16'),'dialCheckDuplicateType',_0xbfd4('0x17'),_0xbfd4('0x18'),'dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xbfd4('0x19'),_0xbfd4('0x1a'),_0xbfd4('0x1b'),_0xbfd4('0x1c'),_0xbfd4('0x1d'),_0xbfd4('0x1e'),'dialRecallMeTimeout',_0xbfd4('0x1f'),_0xbfd4('0x20'),_0xbfd4('0x21'),_0xbfd4('0x22'),'dialQueueProject2',_0xbfd4('0x6'),_0xbfd4('0x23'),_0xbfd4('0x24'),_0xbfd4('0x25'),_0xbfd4('0x26'),_0xbfd4('0x27'),_0xbfd4('0x28'),_0xbfd4('0x29'),_0xbfd4('0x2a'),'dialAbandonedRetryFrequency',_0xbfd4('0x2b'),_0xbfd4('0x2c'),_0xbfd4('0x2d'),'dialAgentRejectRetryFrequency',_0xbfd4('0x2e'),_0xbfd4('0x2f'),_0xbfd4('0x30'),'dialPreviewAutoRecallMe',_0xbfd4('0x31')],'include':[{'model':_0xbfd4('0x32'),'as':_0xbfd4('0x32'),'attributes':['id',_0xbfd4('0x4'),_0xbfd4('0x33'),_0xbfd4('0x34')]},{'model':_0xbfd4('0x35'),'as':_0xbfd4('0x36'),'attributes':['id',_0xbfd4('0x4')]},{'model':_0xbfd4('0x32'),'as':_0xbfd4('0x37'),'attributes':['id','name',_0xbfd4('0x33'),'active']},{'model':_0xbfd4('0x38'),'as':'Interval','attributes':['id',_0xbfd4('0x4')],'include':[{'model':_0xbfd4('0x38'),'as':_0xbfd4('0x39'),'attributes':['id',_0xbfd4('0x4'),_0xbfd4('0x3a')]}]}]},'log':_0xbfd4('0x1')});};}; \ No newline at end of file +var _0xd66b=['dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','../client','Request','acwTimeout','monitor_format','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x3706c7,_0x3f8d33){var _0x2a85e=function(_0x1607dc){while(--_0x1607dc){_0x3706c7['push'](_0x3706c7['shift']());}};_0x2a85e(++_0x3f8d33);}(_0xd66b,0x1d4));var _0xbd66=function(_0x558c41,_0x2287bc){_0x558c41=_0x558c41-0x0;var _0x261f67=_0xd66b[_0x558c41];return _0x261f67;};'use strict';var client=require(_0xbd66('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xbd66('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0xbd66('0x2'),'autopause',_0xbd66('0x3'),_0xbd66('0x4'),_0xbd66('0x5'),_0xbd66('0x6'),'dialLimitChannel','dialLimitQueue',_0xbd66('0x7'),_0xbd66('0x8'),'dialPredictiveOptimizationPercentage',_0xbd66('0x9'),_0xbd66('0xa'),_0xbd66('0xb'),_0xbd66('0xc'),'dialQueueOptions',_0xbd66('0xd'),_0xbd66('0xe'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xbd66('0xf'),'dialBusyRetryFrequency',_0xbd66('0x10'),'dialNoAnswerRetryFrequency',_0xbd66('0x11'),_0xbd66('0x12'),_0xbd66('0x13'),_0xbd66('0x14'),'dialCheckDuplicateType','dialAMDActive',_0xbd66('0x15'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0xbd66('0x16'),_0xbd66('0x17'),_0xbd66('0x18'),'dialAMDMaximumNumberOfWords',_0xbd66('0x19'),_0xbd66('0x1a'),_0xbd66('0x1b'),_0xbd66('0x1c'),_0xbd66('0x1d'),_0xbd66('0x1e'),_0xbd66('0x1f'),_0xbd66('0x20'),_0xbd66('0x21'),_0xbd66('0x3'),_0xbd66('0x22'),'dialRandomLastDigitCallerIdNumber',_0xbd66('0x23'),'dialNoSuchNumberMaxRetry',_0xbd66('0x24'),_0xbd66('0x25'),_0xbd66('0x26'),'dialAbandonedMaxRetry',_0xbd66('0x27'),_0xbd66('0x28'),_0xbd66('0x29'),_0xbd66('0x2a'),_0xbd66('0x2b'),_0xbd66('0x2c'),_0xbd66('0x2d'),_0xbd66('0x2e'),_0xbd66('0x2f'),_0xbd66('0x30')],'include':[{'model':_0xbd66('0x31'),'as':_0xbd66('0x31'),'attributes':['id',_0xbd66('0x32'),'callerid',_0xbd66('0x33')]},{'model':_0xbd66('0x34'),'as':_0xbd66('0x35'),'attributes':['id',_0xbd66('0x32')]},{'model':_0xbd66('0x31'),'as':_0xbd66('0x36'),'attributes':['id','name',_0xbd66('0x37'),'active']},{'model':_0xbd66('0x38'),'as':_0xbd66('0x38'),'attributes':['id',_0xbd66('0x32')],'include':[{'model':_0xbd66('0x38'),'as':_0xbd66('0x39'),'attributes':['id',_0xbd66('0x32'),_0xbd66('0x3a')]}]}]},'log':_0xbd66('0x3b')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 21bdf64..21f4b7a 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(_0x5dda82,_0x24bc07){var _0x643747=function(_0x39e45f){while(--_0x39e45f){_0x5dda82['push'](_0x5dda82['shift']());}};_0x643747(++_0x24bc07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x15adef,_0x45e9eb){var _0xf41273=function(_0x3c2282){while(--_0x3c2282){_0x15adef['push'](_0x15adef['shift']());}};_0xf41273(++_0x45e9eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 cef01a2..f7e20ae 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 _0x832d=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x242c5c,_0x4592c2){var _0x48431e=function(_0x226c6c){while(--_0x226c6c){_0x242c5c['push'](_0x242c5c['shift']());}};_0x48431e(++_0x4592c2);}(_0x832d,0xa3));var _0xd832=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x832d[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0xd832('0x0'));exports[_0xd832('0x1')]=function(_0x32bd53){return function(){return client[_0xd832('0x2')](_0xd832('0x3'),{'options':{'where':{'VoiceQueueId':_0x32bd53,'paused':!![]},'raw':!![]},'log':_0xd832('0x1')});};}; \ No newline at end of file +var _0x5be0=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x189b8e,_0x5003b0){var _0x944e7b=function(_0x284318){while(--_0x284318){_0x189b8e['push'](_0x189b8e['shift']());}};_0x944e7b(++_0x5003b0);}(_0x5be0,0x114));var _0x05be=function(_0x59a791,_0x3b49a7){_0x59a791=_0x59a791-0x0;var _0x235d58=_0x5be0[_0x59a791];return _0x235d58;};'use strict';var client=require(_0x05be('0x0'));exports[_0x05be('0x1')]=function(_0x4817a6){return function(){return client[_0x05be('0x2')](_0x05be('0x3'),{'options':{'where':{'VoiceQueueId':_0x4817a6,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7aad548..155bb0b 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(_0x5e28eb,_0x2a6455){var _0x5be465=function(_0x4e3af9){while(--_0x4e3af9){_0x5e28eb['push'](_0x5e28eb['shift']());}};_0x5be465(++_0x2a6455);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x29ecd8,_0x42c5c8){var _0x280c37=function(_0x59e3d2){while(--_0x59e3d2){_0x29ecd8['push'](_0x29ecd8['shift']());}};_0x280c37(++_0x42c5c8);}(_0x7a54,0x106));var _0x47a5=function(_0x3a63ac,_0x474f25){_0x3a63ac=_0x3a63ac-0x0;var _0x5c8097=_0x7a54[_0x3a63ac];return _0x5c8097;};'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 9f235af..7e338d1 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 _0xa105=['transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid','origtransferercontext','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa105,0x1af));var _0x5a10=function(_0x4544c1,_0x499749){_0x4544c1=_0x4544c1-0x0;var _0xb4acea=_0xa105[_0x4544c1];return _0xb4acea;};'use strict';var client=require(_0x5a10('0x0'));exports[_0x5a10('0x1')]={};exports[_0x5a10('0x2')]=function(_0x5f17e6){return client[_0x5a10('0x3')](_0x5a10('0x4'),{'body':{'result':_0x5f17e6[_0x5a10('0x5')],'transfererchannel':_0x5f17e6['transfererchannel'],'transferercalleridnum':_0x5f17e6[_0x5a10('0x6')],'transferercalleridname':_0x5f17e6['transferercalleridname'],'transfererconnectedlinenum':_0x5f17e6[_0x5a10('0x7')],'transfererconnectedlinename':_0x5f17e6['transfererconnectedlinename'],'transfereraccountcode':_0x5f17e6[_0x5a10('0x8')],'transferercontext':_0x5f17e6[_0x5a10('0x9')],'transfererexten':_0x5f17e6['transfererexten'],'transfererlinkedid':_0x5f17e6[_0x5a10('0xa')],'transfereechannel':_0x5f17e6[_0x5a10('0xb')],'transfereecalleridnum':_0x5f17e6[_0x5a10('0xc')],'transfereecalleridname':_0x5f17e6[_0x5a10('0xd')],'transfereeconnectedlinenum':_0x5f17e6[_0x5a10('0xe')],'transfereeconnectedlinename':_0x5f17e6['transfereeconnectedlinename'],'transfereeaccountcode':_0x5f17e6[_0x5a10('0xf')],'transfereecontext':_0x5f17e6[_0x5a10('0x10')],'transfereeexten':_0x5f17e6['transfereeexten'],'transfereelinkedid':_0x5f17e6['transfereelinkedid'],'isexternal':_0x5f17e6[_0x5a10('0x11')],'context':_0x5f17e6[_0x5a10('0x12')],'extension':_0x5f17e6[_0x5a10('0x13')],'type':'blind'},'log':_0x5a10('0x4')});};exports[_0x5a10('0x14')]=function(_0x2b0c6c){return client['Request'](_0x5a10('0x4'),{'body':{'result':_0x2b0c6c[_0x5a10('0x5')],'transfererchannel':_0x2b0c6c[_0x5a10('0x15')],'transferercalleridnum':_0x2b0c6c[_0x5a10('0x16')],'transferercalleridname':_0x2b0c6c[_0x5a10('0x17')],'transfererconnectedlinenum':_0x2b0c6c[_0x5a10('0x18')],'transfererconnectedlinename':_0x2b0c6c[_0x5a10('0x19')],'transfereraccountcode':_0x2b0c6c[_0x5a10('0x1a')],'transferercontext':_0x2b0c6c['secondtransferercontext'],'transfererexten':_0x2b0c6c[_0x5a10('0x1b')],'transfererlinkedid':_0x2b0c6c[_0x5a10('0x1c')],'transfereechannel':_0x2b0c6c[_0x5a10('0x1d')],'transfereecalleridnum':_0x2b0c6c[_0x5a10('0x1e')],'transfereecalleridname':_0x2b0c6c[_0x5a10('0x1f')],'transfereeconnectedlinenum':_0x2b0c6c[_0x5a10('0x20')],'transfereeconnectedlinename':_0x2b0c6c[_0x5a10('0x21')],'transfereeaccountcode':_0x2b0c6c['transfertargetaccountcode'],'transfereecontext':_0x2b0c6c['transfertargetcontext'],'transfereeexten':_0x2b0c6c['transfertargetexten'],'transfereelinkedid':_0x2b0c6c[_0x5a10('0x22')],'isexternal':_0x2b0c6c['isexternal'],'context':_0x2b0c6c[_0x5a10('0x23')],'extension':_0x2b0c6c['origtransfererexten'],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xa278=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode'];(function(_0x21e41b,_0x41a954){var _0x5699a0=function(_0x117730){while(--_0x117730){_0x21e41b['push'](_0x21e41b['shift']());}};_0x5699a0(++_0x41a954);}(_0xa278,0xdd));var _0x8a27=function(_0x22aa61,_0x45e107){_0x22aa61=_0x22aa61-0x0;var _0x51500a=_0xa278[_0x22aa61];return _0x51500a;};'use strict';var client=require(_0x8a27('0x0'));exports[_0x8a27('0x1')]={};exports[_0x8a27('0x2')]=function(_0x3b15ca){return client[_0x8a27('0x3')](_0x8a27('0x4'),{'body':{'result':_0x3b15ca[_0x8a27('0x5')],'transfererchannel':_0x3b15ca[_0x8a27('0x6')],'transferercalleridnum':_0x3b15ca['transferercalleridnum'],'transferercalleridname':_0x3b15ca[_0x8a27('0x7')],'transfererconnectedlinenum':_0x3b15ca['transfererconnectedlinenum'],'transfererconnectedlinename':_0x3b15ca[_0x8a27('0x8')],'transfereraccountcode':_0x3b15ca[_0x8a27('0x9')],'transferercontext':_0x3b15ca[_0x8a27('0xa')],'transfererexten':_0x3b15ca[_0x8a27('0xb')],'transfererlinkedid':_0x3b15ca[_0x8a27('0xc')],'transfereechannel':_0x3b15ca[_0x8a27('0xd')],'transfereecalleridnum':_0x3b15ca['transfereecalleridnum'],'transfereecalleridname':_0x3b15ca[_0x8a27('0xe')],'transfereeconnectedlinenum':_0x3b15ca[_0x8a27('0xf')],'transfereeconnectedlinename':_0x3b15ca[_0x8a27('0x10')],'transfereeaccountcode':_0x3b15ca[_0x8a27('0x11')],'transfereecontext':_0x3b15ca[_0x8a27('0x12')],'transfereeexten':_0x3b15ca['transfereeexten'],'transfereelinkedid':_0x3b15ca[_0x8a27('0x13')],'isexternal':_0x3b15ca[_0x8a27('0x14')],'context':_0x3b15ca[_0x8a27('0x15')],'extension':_0x3b15ca[_0x8a27('0x16')],'type':_0x8a27('0x17')},'log':_0x8a27('0x4')});};exports[_0x8a27('0x18')]=function(_0x560d39){return client[_0x8a27('0x3')](_0x8a27('0x4'),{'body':{'result':_0x560d39[_0x8a27('0x5')],'transfererchannel':_0x560d39[_0x8a27('0x19')],'transferercalleridnum':_0x560d39[_0x8a27('0x1a')],'transferercalleridname':_0x560d39[_0x8a27('0x1b')],'transfererconnectedlinenum':_0x560d39[_0x8a27('0x1c')],'transfererconnectedlinename':_0x560d39[_0x8a27('0x1d')],'transfereraccountcode':_0x560d39['origtransfereraccountcode'],'transferercontext':_0x560d39[_0x8a27('0x1e')],'transfererexten':_0x560d39[_0x8a27('0x1f')],'transfererlinkedid':_0x560d39[_0x8a27('0x20')],'transfereechannel':_0x560d39[_0x8a27('0x21')],'transfereecalleridnum':_0x560d39[_0x8a27('0x22')],'transfereecalleridname':_0x560d39['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x560d39[_0x8a27('0x23')],'transfereeconnectedlinename':_0x560d39['transfertargetconnectedlinename'],'transfereeaccountcode':_0x560d39[_0x8a27('0x24')],'transfereecontext':_0x560d39[_0x8a27('0x25')],'transfereeexten':_0x560d39[_0x8a27('0x26')],'transfereelinkedid':_0x560d39[_0x8a27('0x27')],'isexternal':_0x560d39['isexternal'],'context':_0x560d39[_0x8a27('0x28')],'extension':_0x560d39[_0x8a27('0x29')],'type':_0x8a27('0x2a')},'log':_0x8a27('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 90cea78..b324959 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x56535f,_0x5d5cac){var _0x1857d9=function(_0x4d4b2c){while(--_0x4d4b2c){_0x56535f['push'](_0x56535f['shift']());}};_0x1857d9(++_0x5d5cac);}(_0x7a54,0x106));var _0x47a5=function(_0x227d0e,_0x67d918){_0x227d0e=_0x227d0e-0x0;var _0x5bfdab=_0x7a54[_0x227d0e];return _0x5bfdab;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x4db256,_0x381557){var _0x4637e0=function(_0x4fe59d){while(--_0x4fe59d){_0x4db256['push'](_0x4db256['shift']());}};_0x4637e0(++_0x381557);}(_0x7a54,0x106));var _0x47a5=function(_0x1bddef,_0x8d2730){_0x1bddef=_0x1bddef-0x0;var _0x4e1c79=_0x7a54[_0x1bddef];return _0x4e1c79;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 df91ef5..96f2bd1 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 _0x98ef=['[CM][%s][%s]','stringify','emit','data2','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','isNil','firstName','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','push','format','user:%s','name','trigger:%s','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info'];(function(_0x1b151a,_0x180c57){var _0x562c73=function(_0x594d34){while(--_0x594d34){_0x1b151a['push'](_0x1b151a['shift']());}};_0x562c73(++_0x180c57);}(_0x98ef,0x197));var _0xf98e=function(_0x3c39e7,_0x18a61b){_0x3c39e7=_0x3c39e7-0x0;var _0x25169f=_0x98ef[_0x3c39e7];return _0x25169f;};'use strict';var _=require(_0xf98e('0x0'));var BPromise=require(_0xf98e('0x1'));var Redis=require(_0xf98e('0x2'));var util=require(_0xf98e('0x3'));var config=require(_0xf98e('0x4'));var logger=require(_0xf98e('0x5'))(_0xf98e('0x6'));var cmContactRpc=require(_0xf98e('0x7'));config[_0xf98e('0x8')]=_[_0xf98e('0x9')](config[_0xf98e('0x8')],{'host':_0xf98e('0xa'),'port':0x18eb});var io=require(_0xf98e('0xb'))(new Redis(config['redis']));function emit(_0x3e8573,_0xa223b9,_0x55f71d,_0x161912,_0x2c6598){logger[_0xf98e('0xc')](_0xf98e('0xd'),_0x3e8573,_0xa223b9['id'],_0x55f71d,_0x161912,JSON[_0xf98e('0xe')](_0x2c6598));io['to'](_0x55f71d)[_0xf98e('0xf')](_0x161912,_0x2c6598);}exports['exec']=function(_0x3c9710,_0x10197d,_0x53bf1a,_0x4229b1){var _0x57e191,_0x25df33;var _0x4819fb={};var _0x1b82cb;var _0x2b966e=Number(_0x53bf1a['data1']);var _0x4a1a29=_0x53bf1a[_0xf98e('0x10')]?Boolean(Number(_0x53bf1a[_0xf98e('0x10')])):![];var _0xf63125;var _0x183f4f=![];if(!_['isNil'](_0x53bf1a[_0xf98e('0x11')])){if(_0x53bf1a[_0xf98e('0x11')]=='1')_0x183f4f=!![];}if(!_0x183f4f){if(_0x4229b1[_0xf98e('0x12')]){_0x4819fb['id']=_0x4229b1[_0xf98e('0x12')];}}if(!_0x4819fb['id']){_0x4819fb[_0xf98e('0x13')]=_0x2b966e;_0xf63125=_0x53bf1a[_0xf98e('0x14')]&&_0x53bf1a[_0xf98e('0x14')]!=='0'?_0x53bf1a[_0xf98e('0x14')][_0xf98e('0x15')](','):['phone'];_0x4819fb[_0xf98e('0x16')]=_[_0xf98e('0x17')](_0xf63125,function(_0x219fc8){var _0x402fe1={};_0x402fe1[_0x219fc8]=_0x4229b1[_0xf98e('0x18')]?_0x4229b1['destcalleridnum']:_0x4229b1['calleridnum'];return _0x402fe1;});_0x1b82cb=_0x4229b1[_0xf98e('0x18')]?_0x4229b1[_0xf98e('0x19')]:_0x4229b1['calleridnum'];}var _0x350359=['id','firstName','lastName','phone',_0xf98e('0x1a'),_0xf98e('0x1b'),_0xf98e('0x13'),_0xf98e('0x1c'),_0xf98e('0x1d'),_0xf98e('0x1e')];var _0x4510f3=_[_0xf98e('0x1f')](_0x350359,_0xf63125);BPromise[_0xf98e('0x20')]()[_0xf98e('0x21')](cmContactRpc[_0xf98e('0x22')]({'attributes':_0x4510f3,'where':_0x4819fb,'phone':_0x1b82cb}))[_0xf98e('0x21')](function(_0x5d6b52){_0x25df33=_0x5d6b52;if(!_[_0xf98e('0x23')](_0x25df33)){if(_0x25df33['length']===0x1){_0x57e191=_0x25df33[0x0];logger[_0xf98e('0xc')](_0xf98e('0x24'),_0x4229b1[_0xf98e('0x25')],_0x10197d['id'],_0x57e191['id']);}else{logger['info'](_0xf98e('0x26'),_0x4229b1[_0xf98e('0x25')],_0x10197d['id'],_[_0xf98e('0x17')](_0x25df33,'id')['join'](','));}return;}else{logger[_0xf98e('0xc')](_0xf98e('0x27'),_0x4229b1['uniqueid'],_0x10197d['id']);var _0x19085d={'ListId':_0x2b966e};var _0x41dd42=_0x53bf1a['data4']&&_0x53bf1a[_0xf98e('0x28')]!=='0'?_0x53bf1a[_0xf98e('0x28')]:_0xf98e('0x29');if(_0x4a1a29){logger[_0xf98e('0xc')](_0xf98e('0x2a'),_0x4229b1['uniqueid'],_0x10197d['id']);_0x19085d[_0x41dd42]=_['isNil'](_0x4229b1[_0xf98e('0x18')])?_0x4229b1[_0xf98e('0x2b')]:_0x4229b1['destcalleridnum'];if(_[_0xf98e('0x2c')](_0x4229b1[_0xf98e('0x18')])){_0x19085d[_0xf98e('0x2d')]=_0x4229b1[_0xf98e('0x2e')]&&_0x4229b1[_0xf98e('0x2e')]!==_0xf98e('0x2f')?_0x4229b1['calleridname']:'Unknown';}else{_0x19085d[_0xf98e('0x2d')]=_0x4229b1[_0xf98e('0x30')]&&_0x4229b1[_0xf98e('0x30')]!==_0xf98e('0x2f')?_0x4229b1['destcalleridname']:_0xf98e('0x31');}return BPromise['resolve']()[_0xf98e('0x21')](cmContactRpc[_0xf98e('0x32')](_0x19085d))[_0xf98e('0x21')](function(_0x135d51){_0x57e191=_0x135d51;_0x25df33['push'](_0x135d51);if(_0x57e191){logger[_0xf98e('0xc')](_0xf98e('0x33'),_0x4229b1[_0xf98e('0x25')],_0x10197d['id'],_0x57e191['id']);}return;});}else{logger[_0xf98e('0xc')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x4229b1[_0xf98e('0x25')],_0x10197d['id']);_0x19085d[_0x41dd42]=_['isNil'](_0x4229b1[_0xf98e('0x18')])?_0x4229b1[_0xf98e('0x2b')]:_0x4229b1[_0xf98e('0x19')];if(_[_0xf98e('0x2c')](_0x4229b1[_0xf98e('0x18')])){_0x19085d[_0xf98e('0x2d')]=_0x4229b1[_0xf98e('0x2e')]&&_0x4229b1[_0xf98e('0x2e')]!==_0xf98e('0x2f')?_0x4229b1[_0xf98e('0x2e')]:_0xf98e('0x31');}else{_0x19085d['firstName']=_0x4229b1['destcalleridname']&&_0x4229b1[_0xf98e('0x30')]!==_0xf98e('0x2f')?_0x4229b1[_0xf98e('0x30')]:_0xf98e('0x31');}_0x57e191=_0x19085d;_0x25df33[_0xf98e('0x34')](_0x19085d);return;}}})[_0xf98e('0x21')](function(){if(_0x3c9710){emit(_0x4229b1[_0xf98e('0x25')],_0x10197d,util[_0xf98e('0x35')](_0xf98e('0x36'),_0x3c9710[_0xf98e('0x37')]),util[_0xf98e('0x35')](_0xf98e('0x38'),_0x53bf1a['action'][_0xf98e('0x39')]()),{'evt':_[_0xf98e('0x3a')](_0x4229b1,{'autoCreate':_0x4a1a29}),'contact':_0x57e191===undefined?{}:_0x57e191,'contacts':_0x25df33[_0xf98e('0x3b')]===0x0?undefined:_0x25df33});}});}; \ No newline at end of file +var _0x4c65=['format','trigger:%s','action','toLowerCase','merge','length','lodash','ioredis','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','isNil','data5','xmd-contactid','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','firstName','lastName','mobile','ListId','scheduledAt','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s'];(function(_0x17024e,_0x23893a){var _0x409487=function(_0x6f425){while(--_0x6f425){_0x17024e['push'](_0x17024e['shift']());}};_0x409487(++_0x23893a);}(_0x4c65,0x74));var _0x54c6=function(_0x3a63b2,_0x44cac5){_0x3a63b2=_0x3a63b2-0x0;var _0x15a478=_0x4c65[_0x3a63b2];return _0x15a478;};'use strict';var _=require(_0x54c6('0x0'));var BPromise=require('bluebird');var Redis=require(_0x54c6('0x1'));var util=require('util');var config=require(_0x54c6('0x2'));var logger=require('../../../../config/logger')(_0x54c6('0x3'));var cmContactRpc=require(_0x54c6('0x4'));config[_0x54c6('0x5')]=_[_0x54c6('0x6')](config[_0x54c6('0x5')],{'host':_0x54c6('0x7'),'port':0x18eb});var io=require(_0x54c6('0x8'))(new Redis(config['redis']));function emit(_0x2a37bd,_0x2ae7c6,_0x5262b8,_0x5158a7,_0x1f6007){logger[_0x54c6('0x9')](_0x54c6('0xa'),_0x2a37bd,_0x2ae7c6['id'],_0x5262b8,_0x5158a7,JSON[_0x54c6('0xb')](_0x1f6007));io['to'](_0x5262b8)[_0x54c6('0xc')](_0x5158a7,_0x1f6007);}exports[_0x54c6('0xd')]=function(_0x4813a9,_0x4e31c2,_0x1fcae9,_0x4f1c5d){var _0x1b73fa,_0x5848e8;var _0x54c253={};var _0x2f63cd;var _0x5da48=Number(_0x1fcae9[_0x54c6('0xe')]);var _0x4ba3ff=_0x1fcae9['data2']?Boolean(Number(_0x1fcae9['data2'])):![];var _0x79d811;var _0x2eca25=![];if(!_[_0x54c6('0xf')](_0x1fcae9[_0x54c6('0x10')])){if(_0x1fcae9[_0x54c6('0x10')]=='1')_0x2eca25=!![];}if(!_0x2eca25){if(_0x4f1c5d['xmd-contactid']){_0x54c253['id']=_0x4f1c5d[_0x54c6('0x11')];}}if(!_0x54c253['id']){_0x54c253['ListId']=_0x5da48;_0x79d811=_0x1fcae9[_0x54c6('0x12')]&&_0x1fcae9[_0x54c6('0x12')]!=='0'?_0x1fcae9[_0x54c6('0x12')][_0x54c6('0x13')](','):[_0x54c6('0x14')];_0x54c253[_0x54c6('0x15')]=_[_0x54c6('0x16')](_0x79d811,function(_0x4d6b54){var _0x24d7a2={};_0x24d7a2[_0x4d6b54]=_0x4f1c5d['routeId']?_0x4f1c5d[_0x54c6('0x17')]:_0x4f1c5d[_0x54c6('0x18')];return _0x24d7a2;});_0x2f63cd=_0x4f1c5d[_0x54c6('0x19')]?_0x4f1c5d['destcalleridnum']:_0x4f1c5d[_0x54c6('0x18')];}var _0x38bee8=['id',_0x54c6('0x1a'),_0x54c6('0x1b'),_0x54c6('0x14'),_0x54c6('0x1c'),'fax',_0x54c6('0x1d'),'createdAt',_0x54c6('0x1e'),'updatedAt'];var _0x3c053b=_['union'](_0x38bee8,_0x79d811);BPromise[_0x54c6('0x1f')]()[_0x54c6('0x20')](cmContactRpc[_0x54c6('0x21')]({'attributes':_0x3c053b,'where':_0x54c253,'phone':_0x2f63cd}))[_0x54c6('0x20')](function(_0x30dc9b){_0x5848e8=_0x30dc9b;if(!_[_0x54c6('0x22')](_0x5848e8)){if(_0x5848e8['length']===0x1){_0x1b73fa=_0x5848e8[0x0];logger[_0x54c6('0x9')](_0x54c6('0x23'),_0x4f1c5d[_0x54c6('0x24')],_0x4e31c2['id'],_0x1b73fa['id']);}else{logger[_0x54c6('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4f1c5d[_0x54c6('0x24')],_0x4e31c2['id'],_['map'](_0x5848e8,'id')[_0x54c6('0x25')](','));}return;}else{logger[_0x54c6('0x9')](_0x54c6('0x26'),_0x4f1c5d['uniqueid'],_0x4e31c2['id']);var _0x3f8911={'ListId':_0x5da48};var _0x109e47=_0x1fcae9[_0x54c6('0x27')]&&_0x1fcae9[_0x54c6('0x27')]!=='0'?_0x1fcae9[_0x54c6('0x27')]:_0x54c6('0x14');if(_0x4ba3ff){logger[_0x54c6('0x9')](_0x54c6('0x28'),_0x4f1c5d['uniqueid'],_0x4e31c2['id']);_0x3f8911[_0x109e47]=_[_0x54c6('0xf')](_0x4f1c5d['routeId'])?_0x4f1c5d[_0x54c6('0x18')]:_0x4f1c5d[_0x54c6('0x17')];if(_[_0x54c6('0xf')](_0x4f1c5d[_0x54c6('0x19')])){_0x3f8911['firstName']=_0x4f1c5d[_0x54c6('0x29')]&&_0x4f1c5d[_0x54c6('0x29')]!==_0x54c6('0x2a')?_0x4f1c5d[_0x54c6('0x29')]:_0x54c6('0x2b');}else{_0x3f8911['firstName']=_0x4f1c5d[_0x54c6('0x2c')]&&_0x4f1c5d[_0x54c6('0x2c')]!==_0x54c6('0x2a')?_0x4f1c5d['destcalleridname']:_0x54c6('0x2b');}return BPromise[_0x54c6('0x1f')]()[_0x54c6('0x20')](cmContactRpc[_0x54c6('0x2d')](_0x3f8911))[_0x54c6('0x20')](function(_0x28f18c){_0x1b73fa=_0x28f18c;_0x5848e8[_0x54c6('0x2e')](_0x28f18c);if(_0x1b73fa){logger[_0x54c6('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x4f1c5d[_0x54c6('0x24')],_0x4e31c2['id'],_0x1b73fa['id']);}return;});}else{logger[_0x54c6('0x9')](_0x54c6('0x2f'),_0x4f1c5d[_0x54c6('0x24')],_0x4e31c2['id']);_0x3f8911[_0x109e47]=_[_0x54c6('0xf')](_0x4f1c5d['routeId'])?_0x4f1c5d[_0x54c6('0x18')]:_0x4f1c5d['destcalleridnum'];if(_[_0x54c6('0xf')](_0x4f1c5d[_0x54c6('0x19')])){_0x3f8911[_0x54c6('0x1a')]=_0x4f1c5d[_0x54c6('0x29')]&&_0x4f1c5d[_0x54c6('0x29')]!==_0x54c6('0x2a')?_0x4f1c5d[_0x54c6('0x29')]:_0x54c6('0x2b');}else{_0x3f8911[_0x54c6('0x1a')]=_0x4f1c5d['destcalleridname']&&_0x4f1c5d[_0x54c6('0x2c')]!==_0x54c6('0x2a')?_0x4f1c5d[_0x54c6('0x2c')]:_0x54c6('0x2b');}_0x1b73fa=_0x3f8911;_0x5848e8['push'](_0x3f8911);return;}}})['then'](function(){if(_0x4813a9){emit(_0x4f1c5d[_0x54c6('0x24')],_0x4e31c2,util['format'](_0x54c6('0x30'),_0x4813a9['name']),util[_0x54c6('0x31')](_0x54c6('0x32'),_0x1fcae9[_0x54c6('0x33')][_0x54c6('0x34')]()),{'evt':_[_0x54c6('0x35')](_0x4f1c5d,{'autoCreate':_0x4ba3ff}),'contact':_0x1b73fa===undefined?{}:_0x1b73fa,'contacts':_0x5848e8[_0x54c6('0x36')]===0x0?undefined:_0x5848e8});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 7fab781..a6a0769 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 _0xd757=['field','account','chat','ChatWebsiteId','operator','AccountId','value','message','event','membername','lastevent','routeId','mailSubstatus','substatus','offlineMessage','created','equals','exports','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','socket.io-emitter','popup','winapp','triggers','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','motionChannel','undefined','voice','debug','inspect','checkTriggers','agents','interface','hasOwnProperty','status','checkTrigger','merge','variables','length','action','toLowerCase','contactmanager','browser','data1','html','templates','data2','render','uri','buildUri','data3','isNil','data4','uriLocation','windowWidth','data5','800','data6','600','winApplication','winArguments','user:%s','name','format','jscripty','trigger:%s','exec','integration','accounts','queue','urlforward','parse','replace','channel','every','AllConditions','some','AnyConditions','checkConditions','checkTrigger:\x20trigger','evt'];(function(_0x340821,_0x95405d){var _0x3321b2=function(_0x4e12d3){while(--_0x4e12d3){_0x340821['push'](_0x340821['shift']());}};_0x3321b2(++_0x95405d);}(_0xd757,0x18f));var _0x7d75=function(_0x3de613,_0x3e8a1e){_0x3de613=_0x3de613-0x0;var _0x574313=_0xd757[_0x3de613];return _0x574313;};'use strict';var util=require('util');var _=require(_0x7d75('0x0'));var url=require(_0x7d75('0x1'));var Mustache=require(_0x7d75('0x2'));var Redis=require(_0x7d75('0x3'));var urlforward=require('./urlforward');var integration=require(_0x7d75('0x4'));var cmContact=require(_0x7d75('0x5'));var script=require(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var logger=require(_0x7d75('0x8'))(_0x7d75('0x9'));var ami=require('../ami');config[_0x7d75('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7d75('0xb'))(new Redis(config[_0x7d75('0xa')]));var operators={'equals':function(_0x37c05c,_0x3bbfd3){return _0x37c05c==_0x3bbfd3;},'not_equals':function(_0x4cfd4c,_0x4bdf29){return _0x4cfd4c!=_0x4bdf29;}};var barAndWebActions=[_0x7d75('0xc'),_0x7d75('0x1'),_0x7d75('0xd')];function Trigger(_0x3c1b4d){this[_0x7d75('0xe')]=_0x3c1b4d['triggers'];this['agents']=_0x3c1b4d['agents'];this[_0x7d75('0xf')]=_0x3c1b4d[_0x7d75('0xf')];this['templates']=_0x3c1b4d['templates'];this[_0x7d75('0x10')]=_0x3c1b4d[_0x7d75('0x10')];this[_0x7d75('0x11')]=_0x3c1b4d[_0x7d75('0x11')];this['freshdeskAccounts']=_0x3c1b4d[_0x7d75('0x12')];this[_0x7d75('0x13')]=_0x3c1b4d[_0x7d75('0x13')];this[_0x7d75('0x14')]=_0x3c1b4d['sugarcrmAccounts'];this[_0x7d75('0x15')]=_0x3c1b4d['zohoAccounts'];this['deskAccounts']=_0x3c1b4d[_0x7d75('0x16')];this[_0x7d75('0x17')]=_0x3c1b4d['vtigerAccounts'];this[_0x7d75('0x18')]=_0x3c1b4d[_0x7d75('0x18')];this[_0x7d75('0x19')]=_0x3c1b4d[_0x7d75('0x19')];this['freshsalesAccounts']=_0x3c1b4d[_0x7d75('0x1a')];this['accounts']={'zendesk':this[_0x7d75('0x11')],'salesforce':this[_0x7d75('0x13')],'freshdesk':this[_0x7d75('0x12')],'sugarcrm':this[_0x7d75('0x14')],'zoho':this[_0x7d75('0x15')],'desk':this[_0x7d75('0x16')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x7d75('0x19')],'freshsales':this[_0x7d75('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0x7d75('0x1b'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x1e'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x1f'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x20'),this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x21'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x22'),this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x23'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x24'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentreject',this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x25'),this[_0x7d75('0x1c')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x26'),this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x27'),this[_0x7d75('0x28')][_0x7d75('0x1d')](this));ami['on']('custom:dialconnect',this[_0x7d75('0x28')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x29'),this['syncAgentDial'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2a'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2b'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2c'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2d'),this[_0x7d75('0x1c')]['bind'](this));ami['on'](_0x7d75('0x2e'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2f'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x30'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));}Trigger[_0x7d75('0x31')]['emit']=function(_0x2c0ffc,_0x44111e,_0x53bba0){logger[_0x7d75('0x32')](_0x2c0ffc,_0x44111e,JSON[_0x7d75('0x33')](_0x53bba0));io['to'](_0x2c0ffc)[_0x7d75('0x34')](_0x44111e,_0x53bba0);};Trigger[_0x7d75('0x31')][_0x7d75('0x1c')]=function(_0x5eaf75){var _0x5caebb=_['clone'](_0x5eaf75);if(typeof _0x5caebb[_0x7d75('0x35')]===_0x7d75('0x36')){_0x5caebb[_0x7d75('0x35')]=_0x7d75('0x37');}logger[_0x7d75('0x38')]('syncCustomEvent',util[_0x7d75('0x39')](_0x5caebb,{'showHidden':!![],'depth':null}));this[_0x7d75('0x3a')](_0x5caebb);};Trigger[_0x7d75('0x31')][_0x7d75('0x28')]=function(_0x5d60c6){if(this[_0x7d75('0x3b')][_0x5d60c6[_0x7d75('0x3c')]]){this[_0x7d75('0x1c')](_0x5d60c6);}};Trigger[_0x7d75('0x31')][_0x7d75('0x3a')]=function(_0x6610d5){var _0x54926a;for(var _0xf0593f in this['triggers']){if(this['triggers'][_0x7d75('0x3d')](_0xf0593f)){if(this[_0x7d75('0xe')][_0xf0593f][_0x7d75('0x3e')]){_0x54926a=this[_0x7d75('0x3f')](this['triggers'][_0xf0593f],_0x6610d5);if(_0x54926a){_[_0x7d75('0x40')](_0x6610d5,_0x6610d5[_0x7d75('0x41')]);for(var _0x1e3a4f=0x0,_0x11ac68,_0x1d93f3,_0x2bd26a;_0x1e3a4f0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x4e60d5,_0x543e6c){_0x4e60d5=_0x4e60d5-0x0;var _0x2fa72d=_0xe14b[_0x4e60d5];return _0x2fa72d;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index ccafdb3..e3fbbdd 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 _0x50af=['indexOf','ticketType','incident','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','assign','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','openNewTab','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data5','POST','username','password','then','access_token','catch','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','body','headers','odata-entityid','substring','enduserId','telephone1','&$filter=','\x20eq\x20\x27','contactid','nothing','info',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','type','nameField','customField'];(function(_0x1ac121,_0x5d384b){var _0x47bf49=function(_0x2a901f){while(--_0x2a901f){_0x1ac121['push'](_0x1ac121['shift']());}};_0x47bf49(++_0x5d384b);}(_0x50af,0x85));var _0xf50a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50af[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require('util');var intUtil=require(_0xf50a('0x0'));var md5=require(_0xf50a('0x1'));var Redis=require(_0xf50a('0x2'));var logger=require(_0xf50a('0x3'))(_0xf50a('0x4'));var config=require(_0xf50a('0x5'));config[_0xf50a('0x6')]=_[_0xf50a('0x7')](config[_0xf50a('0x6')],{'host':_0xf50a('0x8'),'port':0x18eb});var io=require(_0xf50a('0x9'))(new Redis(config['redis']));function getAuthToken(_0x42cccd,_0x30d473,_0x4df8ca){if(_0x42cccd[_0xf50a('0xa')]){_0x42cccd[_0xf50a('0xb')]=_0x42cccd[_0xf50a('0xc')][_0xf50a('0xd')];_0x42cccd['tenantId']=_0x42cccd[_0xf50a('0xc')]['data2'];return Promise['resolve'](_0x42cccd['CloudProvider'][_0xf50a('0xe')]);}var _0x7de4b8={'method':_0xf50a('0xf'),'uri':_0x30d473,'form':{'client_id':_0x42cccd['clientId'],'resource':_0x42cccd[_0xf50a('0xb')],'username':_0x42cccd[_0xf50a('0x10')],'password':_0x42cccd[_0xf50a('0x11')],'grant_type':_0xf50a('0x11'),'client_secret':_0x42cccd['clientSecret']},'json':!![]};return rp(_0x7de4b8)[_0xf50a('0x12')](function(_0x1df024){return _0x1df024[_0xf50a('0x13')];})[_0xf50a('0x14')](function(_0x22cf43){logger['error']('['+[_0x4df8ca[_0xf50a('0x15')]()]+']\x20Wrong\x20credentials!');return _0x22cf43[_0xf50a('0x16')];});}function getUser(_0xb75c72,_0x4a4037,_0x58f1f2,_0x5c8a20,_0x2b6348,_0x314ad5){return new Promise(function(_0x2bc514,_0x322113){return getAuthToken(_0x4a4037,_0x5c8a20,_0x314ad5)['then'](function(_0x3bd39e){var _0x1d38f6={'method':_0xf50a('0x17'),'uri':_0x2b6348+_0xf50a('0x18'),'headers':{'Authorization':_0xf50a('0x19')+_0x3bd39e,'OData-Version':_0xf50a('0x1a')},'json':!![]};return rp(_0x1d38f6);})['then'](function(_0x1b24a7){var _0x20f793=_0x1b24a7[_0xf50a('0x1b')];var _0xab358b=![];var _0x552672=null;if(!_[_0xf50a('0x1c')](_0x58f1f2)){if(intUtil[_0xf50a('0x1d')](_0x58f1f2[_0xf50a('0x1e')])){_0xb75c72['userEmail']=_0x58f1f2[_0xf50a('0x1e')];for(_0x552672=0x0;_0x552672<_0x20f793[_0xf50a('0x1f')];_0x552672++){if(_0x20f793[_0x552672][_0xf50a('0x20')]===_0x58f1f2[_0xf50a('0x1e')]&&!_0x20f793[_0x552672][_0xf50a('0x21')]){_0xab358b=!![];logger['info']('['+[_0x314ad5[_0xf50a('0x15')]()]+_0xf50a('0x22')+_0x20f793[_0x552672][_0xf50a('0x23')]+'!');_0xb75c72[_0xf50a('0x24')]=_0x20f793[_0x552672][_0xf50a('0x23')];}}}}if(!_0xab358b){logger['info']('['+[_0x314ad5[_0xf50a('0x15')]()]+_0xf50a('0x25'));_0xb75c72[_0xf50a('0x26')]=_0x4a4037['username'];for(_0x552672=0x0;_0x552672<_0x20f793['length'];_0x552672++){if(_0x20f793[_0x552672][_0xf50a('0x20')]===_0x4a4037[_0xf50a('0x10')]){_0xb75c72['userId']=_0x20f793[_0x552672][_0xf50a('0x23')];}}}_0x2bc514(_0xb75c72);})['catch'](function(_0x36e9d7){_0x322113(_0x36e9d7[_0xf50a('0x16')]);});});}function createEndUser(_0x32364d,_0xe65832,_0xbbdc00,_0x31d69b,_0x4d5254,_0x350f46,_0x520711){return new Promise(function(_0x4a5dce,_0x2586d3){return getAuthToken(_0xe65832,_0xbbdc00,_0x350f46)['then'](function(_0x1b9116){var _0x515197=_0x350f46[_0xf50a('0x27')]()===_0xf50a('0x28')?_0x4d5254[_0xf50a('0x29')]:_0x4d5254[_0xf50a('0x2a')];var _0x4df383={'method':'POST','uri':_0x31d69b+'contacts','body':{'fullname':_0x515197,'firstname':_0x515197,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf50a('0x2b')+_0x32364d[_0xf50a('0x24')]+')'},'headers':{'Authorization':_0xf50a('0x19')+_0x1b9116,'OData-Version':_0xf50a('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x4df383[_0xf50a('0x2c')][_0x520711]=_0x515197;return rp(_0x4df383);})[_0xf50a('0x12')](function(_0x43477c){var _0x37dcf3=_0x43477c[_0xf50a('0x2d')][_0xf50a('0x2e')];var _0xee5b6=_0x37dcf3[_0xf50a('0x2f')](_0x37dcf3['lastIndexOf']('(')+0x1,_0x37dcf3['lastIndexOf'](')'));_0x32364d[_0xf50a('0x30')]=_0xee5b6;_0x4a5dce(_0x32364d);})[_0xf50a('0x14')](function(_0x34ab7c){_0x2586d3(_0x34ab7c['message']);});});}function getEndUser(_0x3fa709,_0x483ef3,_0x58d46a,_0x1ed3a1,_0x3f7a9f,_0x316348,_0x459b79,_0x4f6f86){var _0x51e89f=_0x316348['toLowerCase']()===_0xf50a('0x28')?_0x3f7a9f[_0xf50a('0x29')]:_0x3f7a9f[_0xf50a('0x2a')];return getAuthToken(_0x483ef3,_0x58d46a,_0x316348)[_0xf50a('0x12')](function(_0x290b5c){_0x4f6f86=_0x4f6f86?_0x4f6f86:_0xf50a('0x31');var _0x5c3c29={'method':'GET','uri':_0x1ed3a1+'contacts?$select='+_0x4f6f86+_0xf50a('0x32')+_0x4f6f86+_0xf50a('0x33')+_0x51e89f['replace']('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x290b5c,'If-None-Match':null,'OData-Version':_0xf50a('0x1a')},'json':!![]};return rp(_0x5c3c29);})[_0xf50a('0x12')](function(_0x42a860){var _0x299760=![];if(!_0x42a860)return _0x299760;var _0x33e21f=_0x42a860[_0xf50a('0x1b')];for(var _0x33af3b=0x0;_0x33af3b<_0x33e21f[_0xf50a('0x1f')];_0x33af3b++){if(_0x33e21f[_0x33af3b][_0x4f6f86]===_0x51e89f){_0x299760=!![];_0x3fa709[_0xf50a('0x30')]=_0x33e21f[_0x33af3b][_0xf50a('0x34')];}}return _0x299760;})['then'](function(_0x21279b){if(_0x21279b)return _0x3fa709;if(_0x459b79===_0xf50a('0x35')){logger[_0xf50a('0x36')]('['+[_0x316348['toUpperCase']()]+_0xf50a('0x37'));return _0x3fa709;}return createEndUser(_0x3fa709,_0x483ef3,_0x58d46a,_0x1ed3a1,_0x3f7a9f,_0x316348,_0x4f6f86)[_0xf50a('0x12')](function(_0x2991e7){logger[_0xf50a('0x36')]('['+[_0x316348[_0xf50a('0x15')]()]+']\x20Enduser\x20created!',_0x2991e7[_0xf50a('0x30')]);return _0x2991e7;});});}function getCustomFields(_0x3def10,_0x40bec6,_0x2ee4f7){var _0x4bf83f={};if(_0x3def10[_0xf50a('0x1f')]>0x0){_[_0xf50a('0x38')](_0x3def10,function(_0x1186a2){if(_['includes']([_0xf50a('0x39'),'picklist'],_0x1186a2[_0xf50a('0x3a')])&&_0x1186a2[_0xf50a('0x3b')]&&!_0x1186a2[_0xf50a('0x3c')]){var _0x33d9c7=_0x1186a2['idField']['toLowerCase']();var _0x765062=_0x33d9c7[_0xf50a('0x2f')](0x0,_0x33d9c7[_0xf50a('0x3d')]('_'));var _0x48c9b0=_0x33d9c7[_0xf50a('0x2f')](_0x33d9c7[_0xf50a('0x3d')]('_')+0x1);if(_0x765062===_0x2ee4f7){_0x4bf83f[_0x48c9b0]=_0x1186a2['content'];}}});}return _0x4bf83f;}function getTicket(_0xbd97d7,_0x2dafdb,_0x2bab5a,_0x4d4787,_0x502c38,_0x177230,_0x17e19d){return new Promise(function(_0x4a7f55,_0x29bb9d){var _0x57a00e;return getAuthToken(_0x2dafdb,_0x2bab5a,_0x17e19d)[_0xf50a('0x12')](function(_0x4a5ddd){if(_0x177230[_0xf50a('0x3e')]===_0xf50a('0x3f')){_0x57a00e={'method':_0xf50a('0xf'),'uri':_0x4d4787+'incidents','body':Object['assign']({},{'title':intUtil[_0xf50a('0x40')](_0x177230[_0xf50a('0x41')],_0x502c38,'\x20'),'description':intUtil[_0xf50a('0x40')](_0x177230[_0xf50a('0x42')],_0x502c38,'\x0a'),'customerid_contact@odata.bind':_0xbd97d7[_0xf50a('0x30')]?'/contacts('+_0xbd97d7[_0xf50a('0x30')]+')':undefined,'ownerid@odata.bind':_0xf50a('0x2b')+_0xbd97d7[_0xf50a('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x177230[_0xf50a('0x43')],_0x502c38,_0x177230[_0xf50a('0x3e')])),'headers':{'Authorization':'Bearer\x20'+_0x4a5ddd,'OData-Version':_0xf50a('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x177230[_0xf50a('0x3e')]===_0xf50a('0x44')){var _0x511736=_0xbd97d7[_0xf50a('0x30')]?[{'partyid_systemuser@odata.bind':_0xf50a('0x2b')+_0xbd97d7['userId']+')','participationtypemask':_0xbd97d7[_0xf50a('0x45')]===_0xf50a('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0xf50a('0x47')+_0xbd97d7[_0xf50a('0x30')]+')','participationtypemask':_0xbd97d7[_0xf50a('0x45')]===_0xf50a('0x46')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xf50a('0x2b')+_0xbd97d7['userId']+')','participationtypemask':_0xbd97d7[_0xf50a('0x45')]===_0xf50a('0x46')?0x2:0x1}];_0x57a00e={'method':_0xf50a('0xf'),'uri':_0x4d4787+'phonecalls','body':Object[_0xf50a('0x48')]({},{'subject':intUtil[_0xf50a('0x40')](_0x177230[_0xf50a('0x41')],_0x502c38,'\x20'),'phonenumber':String(_0x502c38[_0xf50a('0x2a')]),'description':intUtil[_0xf50a('0x40')](_0x177230[_0xf50a('0x42')],_0x502c38,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbd97d7['enduserId']?'/contacts('+_0xbd97d7[_0xf50a('0x30')]+')':undefined,'ownerid@odata.bind':_0xf50a('0x2b')+_0xbd97d7[_0xf50a('0x24')]+')','directioncode':_0xbd97d7[_0xf50a('0x45')]===_0xf50a('0x46')?![]:!![],'phonecall_activity_parties':_0x511736},getCustomFields(_0x177230[_0xf50a('0x43')],_0x502c38,_0x177230[_0xf50a('0x3e')])),'headers':{'Authorization':_0xf50a('0x19')+_0x4a5ddd,'OData-Version':_0xf50a('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x57a00e);})[_0xf50a('0x12')](function(_0x4365bb){var _0x2d7caf=_0x4365bb[_0xf50a('0x2d')]['odata-entityid'];var _0x30896b=_0x2d7caf['substring'](_0x2d7caf['lastIndexOf']('(')+0x1,_0x2d7caf[_0xf50a('0x49')](')'));_0xbd97d7[_0xf50a('0x4a')]=_0x30896b;_0x4a7f55(_0xbd97d7);})[_0xf50a('0x14')](function(_0x5dff81){_0x29bb9d(_0x5dff81[_0xf50a('0x16')]);});});}function emit(_0x196335,_0x159901,_0xd8dba5,_0x15897b){var _0x82b694={'uri':util[_0xf50a('0x4b')](_0xf50a('0x4c'),_0x196335,_0xd8dba5,_0x15897b)};io['to'](util[_0xf50a('0x4b')]('user:%s',_0x159901))['emit'](_0xf50a('0x4d'),_0x82b694);}exports['cs']=function(_0x5232ad,_0x71a580,_0x3b16af,_0x1d8b04,_0x3406dd,_0x105453,_0x1e8d21,_0x27c066){var _0x2a77e9={};_0x105453['remoteUri']=_0x105453[_0xf50a('0xa')]?intUtil[_0xf50a('0x4e')](_0x105453[_0xf50a('0xc')]['data7']):intUtil[_0xf50a('0x4e')](_0x105453[_0xf50a('0xb')]);_0x105453[_0xf50a('0x4f')]=intUtil[_0xf50a('0x4e')](_0x105453[_0xf50a('0x4f')]);_0x2a77e9[_0xf50a('0x45')]=_0x27c066===_0xf50a('0x46')||_0x27c066===_0xf50a('0x50')?_0xf50a('0x46'):_0xf50a('0x28');var _0x294a2e=_0x105453['modernAuthentication']?util[_0xf50a('0x4b')]('%s/api/data/v9.0/',_0x105453[_0xf50a('0xc')]['data7']):util['format'](_0xf50a('0x51'),_0x105453['remoteUri']);var _0x2925fd=util[_0xf50a('0x4b')](_0xf50a('0x52'),_0x105453[_0xf50a('0x53')]);var _0xe6cf50=util[_0xf50a('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x105453[_0xf50a('0x4f')],_0x71a580[_0xf50a('0x54')],md5(_0x71a580['uniqueid']));if(_0x3406dd&&_0x3406dd['monitor_format']){logger[_0xf50a('0x36')]('[QUEUE]',_0xf50a('0x55'));_0x71a580['recordingURL']=_0xe6cf50;}else if(_0x1e8d21&&_0x1e8d21[_0xf50a('0x56')]&&_0x1e8d21[_0xf50a('0x56')]!=='none'){logger['info'](_0xf50a('0x57'),_0xf50a('0x55'));_0x71a580[_0xf50a('0x58')]=_0xe6cf50;}else{_0x71a580[_0xf50a('0x58')]='';}return getUser(_0x2a77e9,_0x105453,_0x1d8b04,_0x2925fd,_0x294a2e,_0x27c066)['then'](function(_0x3d920f){logger['info']('['+_0x27c066['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x3d920f['userId']);logger['info']('['+_0x27c066[_0xf50a('0x15')]()+']\x20The\x20User\x20email\x20is:',_0x3d920f['userEmail']);return getEndUser(_0x3d920f,_0x105453,_0x2925fd,_0x294a2e,_0x71a580,_0x27c066,_0x3b16af[_0xf50a('0x59')],_0x3b16af['additionalSearchContact']);})[_0xf50a('0x12')](function(_0x51d8e1){logger['info']('['+_0x27c066[_0xf50a('0x15')]()+_0xf50a('0x5a'),_0x51d8e1[_0xf50a('0x30')]);logger[_0xf50a('0x36')]('['+_0x27c066[_0xf50a('0x15')]()+_0xf50a('0x5b'),_0x71a580[_0xf50a('0x2a')]);return getTicket(_0x51d8e1,_0x105453,_0x2925fd,_0x294a2e,_0x71a580,_0x3b16af,_0x27c066);})[_0xf50a('0x12')](function(_0x1d0344){logger['info'](util[_0xf50a('0x4b')]('['+_0x27c066['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x3b16af[_0xf50a('0x3e')],_0x1d0344[_0xf50a('0x4a')]));logger[_0xf50a('0x36')](util['format']('['+_0x27c066[_0xf50a('0x15')]()+']\x20Call\x20direction:\x20%s',_0x27c066));if(_0x27c066!==_0xf50a('0x50')&&_0x3b16af[_0xf50a('0x5c')]){logger['info']('['+_0x27c066[_0xf50a('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x105453['remoteUri'],_0x1d8b04[_0xf50a('0x5d')],_0x3b16af['ticketType'],_0x1d0344['ticketId']);}})['catch'](function(_0x349346){logger[_0xf50a('0x5e')]('['+_0x27c066[_0xf50a('0x15')]()+_0xf50a('0x5f'),_0x349346[_0xf50a('0x16')]);console[_0xf50a('0x5e')](_0xf50a('0x60'),_0x349346);});}; \ No newline at end of file +var _0xdfa2=['internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','destcalleridnum','contacts','/systemusers(','body','headers','lastIndexOf','calleridnum','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','value','length','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','enduserId','forEach','string','nameField','customField','toLowerCase','substring','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','Fields','phonecall','queue','phonecalls','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','none','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','ioredis','../../../../config/logger','../../../../config/environment','defaults','redis','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','data5','POST','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0xdfa2,0x1e7));var _0x2dfa=function(_0x174c58,_0x28ba05){_0x174c58=_0x174c58-0x0;var _0x12497c=_0xdfa2[_0x174c58];return _0x12497c;};'use strict';var _=require('lodash');var rp=require(_0x2dfa('0x0'));var util=require(_0x2dfa('0x1'));var intUtil=require(_0x2dfa('0x2'));var md5=require('md5');var Redis=require(_0x2dfa('0x3'));var logger=require(_0x2dfa('0x4'))('dynamics365');var config=require(_0x2dfa('0x5'));config['redis']=_[_0x2dfa('0x6')](config[_0x2dfa('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2dfa('0x8'))(new Redis(config[_0x2dfa('0x7')]));function getAuthToken(_0x2d6deb,_0xbfd672,_0x4b1ac2){if(_0x2d6deb[_0x2dfa('0x9')]){_0x2d6deb[_0x2dfa('0xa')]=_0x2d6deb[_0x2dfa('0xb')]['data7'];_0x2d6deb[_0x2dfa('0xc')]=_0x2d6deb[_0x2dfa('0xb')][_0x2dfa('0xd')];return Promise[_0x2dfa('0xe')](_0x2d6deb[_0x2dfa('0xb')][_0x2dfa('0xf')]);}var _0x446523={'method':_0x2dfa('0x10'),'uri':_0xbfd672,'form':{'client_id':_0x2d6deb['clientId'],'resource':_0x2d6deb[_0x2dfa('0xa')],'username':_0x2d6deb[_0x2dfa('0x11')],'password':_0x2d6deb[_0x2dfa('0x12')],'grant_type':_0x2dfa('0x12'),'client_secret':_0x2d6deb['clientSecret']},'json':!![]};return rp(_0x446523)[_0x2dfa('0x13')](function(_0x60d5e5){return _0x60d5e5[_0x2dfa('0x14')];})[_0x2dfa('0x15')](function(_0x40481c){logger[_0x2dfa('0x16')]('['+[_0x4b1ac2[_0x2dfa('0x17')]()]+_0x2dfa('0x18'));return _0x40481c[_0x2dfa('0x19')];});}function getUser(_0x1769ed,_0x1d3d3c,_0x475b80,_0x3abe0e,_0x28947d,_0x544872){return new Promise(function(_0x4d0727,_0x1a4cdb){return getAuthToken(_0x1d3d3c,_0x3abe0e,_0x544872)[_0x2dfa('0x13')](function(_0x56c37a){var _0x50b82a={'method':_0x2dfa('0x1a'),'uri':_0x28947d+_0x2dfa('0x1b'),'headers':{'Authorization':_0x2dfa('0x1c')+_0x56c37a,'OData-Version':_0x2dfa('0x1d')},'json':!![]};return rp(_0x50b82a);})[_0x2dfa('0x13')](function(_0x5d335a){var _0x3a6fa5=_0x5d335a['value'];var _0x26c763=![];var _0x1c7032=null;if(!_[_0x2dfa('0x1e')](_0x475b80)){if(intUtil[_0x2dfa('0x1f')](_0x475b80['email'])){_0x1769ed['userEmail']=_0x475b80[_0x2dfa('0x20')];for(_0x1c7032=0x0;_0x1c7032<_0x3a6fa5['length'];_0x1c7032++){if(_0x3a6fa5[_0x1c7032][_0x2dfa('0x21')]===_0x475b80[_0x2dfa('0x20')]&&!_0x3a6fa5[_0x1c7032][_0x2dfa('0x22')]){_0x26c763=!![];logger['info']('['+[_0x544872[_0x2dfa('0x17')]()]+_0x2dfa('0x23')+_0x3a6fa5[_0x1c7032][_0x2dfa('0x24')]+'!');_0x1769ed[_0x2dfa('0x25')]=_0x3a6fa5[_0x1c7032][_0x2dfa('0x24')];}}}}if(!_0x26c763){logger[_0x2dfa('0x26')]('['+[_0x544872['toUpperCase']()]+_0x2dfa('0x27'));_0x1769ed[_0x2dfa('0x28')]=_0x1d3d3c[_0x2dfa('0x11')];for(_0x1c7032=0x0;_0x1c7032<_0x3a6fa5['length'];_0x1c7032++){if(_0x3a6fa5[_0x1c7032][_0x2dfa('0x21')]===_0x1d3d3c[_0x2dfa('0x11')]){_0x1769ed[_0x2dfa('0x25')]=_0x3a6fa5[_0x1c7032][_0x2dfa('0x24')];}}}_0x4d0727(_0x1769ed);})['catch'](function(_0x26475f){_0x1a4cdb(_0x26475f[_0x2dfa('0x19')]);});});}function createEndUser(_0x1f9095,_0x2e99da,_0x37eb76,_0x28f317,_0x39279b,_0x234bb1,_0x5b380c){return new Promise(function(_0x5220dc,_0x2738c0){return getAuthToken(_0x2e99da,_0x37eb76,_0x234bb1)[_0x2dfa('0x13')](function(_0x58547f){var _0x429e72=_0x234bb1['toLowerCase']()===_0x2dfa('0x29')?_0x39279b[_0x2dfa('0x2a')]:_0x39279b['calleridnum'];var _0x2acc74={'method':'POST','uri':_0x28f317+_0x2dfa('0x2b'),'body':{'fullname':_0x429e72,'firstname':_0x429e72,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2dfa('0x2c')+_0x1f9095[_0x2dfa('0x25')]+')'},'headers':{'Authorization':_0x2dfa('0x1c')+_0x58547f,'OData-Version':_0x2dfa('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x2acc74[_0x2dfa('0x2d')][_0x5b380c]=_0x429e72;return rp(_0x2acc74);})[_0x2dfa('0x13')](function(_0x5b65e2){var _0x2517a2=_0x5b65e2[_0x2dfa('0x2e')]['odata-entityid'];var _0x70748e=_0x2517a2['substring'](_0x2517a2[_0x2dfa('0x2f')]('(')+0x1,_0x2517a2[_0x2dfa('0x2f')](')'));_0x1f9095['enduserId']=_0x70748e;_0x5220dc(_0x1f9095);})['catch'](function(_0x4c1735){_0x2738c0(_0x4c1735[_0x2dfa('0x19')]);});});}function getEndUser(_0x225f7e,_0x4fcea6,_0xe3e37e,_0x48a64a,_0x378692,_0x55aedc,_0x43466c,_0x4c2139){var _0xcbca62=_0x55aedc['toLowerCase']()==='outbound'?_0x378692[_0x2dfa('0x2a')]:_0x378692[_0x2dfa('0x30')];return getAuthToken(_0x4fcea6,_0xe3e37e,_0x55aedc)[_0x2dfa('0x13')](function(_0x40b8a7){_0x4c2139=_0x4c2139?_0x4c2139:_0x2dfa('0x31');var _0x543f60={'method':_0x2dfa('0x1a'),'uri':_0x48a64a+'contacts?$select='+_0x4c2139+_0x2dfa('0x32')+_0x4c2139+_0x2dfa('0x33')+_0xcbca62[_0x2dfa('0x34')]('+',_0x2dfa('0x35'))+'\x27','headers':{'Authorization':_0x2dfa('0x1c')+_0x40b8a7,'If-None-Match':null,'OData-Version':_0x2dfa('0x1d')},'json':!![]};return rp(_0x543f60);})[_0x2dfa('0x13')](function(_0x19c508){var _0x3654c3=![];if(!_0x19c508)return _0x3654c3;var _0x35cea5=_0x19c508[_0x2dfa('0x36')];for(var _0x2a3411=0x0;_0x2a3411<_0x35cea5[_0x2dfa('0x37')];_0x2a3411++){if(_0x35cea5[_0x2a3411][_0x4c2139]===_0xcbca62){_0x3654c3=!![];_0x225f7e['enduserId']=_0x35cea5[_0x2a3411]['contactid'];}}return _0x3654c3;})['then'](function(_0x3734dd){if(_0x3734dd)return _0x225f7e;if(_0x43466c===_0x2dfa('0x38')){logger[_0x2dfa('0x26')]('['+[_0x55aedc[_0x2dfa('0x17')]()]+_0x2dfa('0x39'));return _0x225f7e;}return createEndUser(_0x225f7e,_0x4fcea6,_0xe3e37e,_0x48a64a,_0x378692,_0x55aedc,_0x4c2139)[_0x2dfa('0x13')](function(_0x4541b8){logger[_0x2dfa('0x26')]('['+[_0x55aedc['toUpperCase']()]+_0x2dfa('0x3a'),_0x4541b8[_0x2dfa('0x3b')]);return _0x4541b8;});});}function getCustomFields(_0x5740d2,_0x4d1038,_0x3e0c37){var _0x36f4c4={};if(_0x5740d2[_0x2dfa('0x37')]>0x0){_[_0x2dfa('0x3c')](_0x5740d2,function(_0x2e1af8){if(_['includes']([_0x2dfa('0x3d'),'picklist'],_0x2e1af8['type'])&&_0x2e1af8[_0x2dfa('0x3e')]&&!_0x2e1af8[_0x2dfa('0x3f')]){var _0x7db6c9=_0x2e1af8['idField'][_0x2dfa('0x40')]();var _0x7d9a56=_0x7db6c9[_0x2dfa('0x41')](0x0,_0x7db6c9[_0x2dfa('0x42')]('_'));var _0x26209f=_0x7db6c9[_0x2dfa('0x41')](_0x7db6c9['indexOf']('_')+0x1);if(_0x7d9a56===_0x3e0c37){_0x36f4c4[_0x26209f]=_0x2e1af8[_0x2dfa('0x43')];}}});}return _0x36f4c4;}function getTicket(_0x1b1f42,_0x19986b,_0xfcb6a2,_0x3b27d3,_0x49d46f,_0x51ff4f,_0x30bc39){return new Promise(function(_0x5f48b2,_0x1e28b3){var _0x17f1db;return getAuthToken(_0x19986b,_0xfcb6a2,_0x30bc39)[_0x2dfa('0x13')](function(_0x55aa37){if(_0x51ff4f[_0x2dfa('0x44')]===_0x2dfa('0x45')){_0x17f1db={'method':_0x2dfa('0x10'),'uri':_0x3b27d3+'incidents','body':Object[_0x2dfa('0x46')]({},{'title':intUtil[_0x2dfa('0x47')](_0x51ff4f[_0x2dfa('0x48')],_0x49d46f,'\x20'),'description':intUtil[_0x2dfa('0x47')](_0x51ff4f['Descriptions'],_0x49d46f,'\x0a'),'customerid_contact@odata.bind':_0x1b1f42[_0x2dfa('0x3b')]?_0x2dfa('0x49')+_0x1b1f42[_0x2dfa('0x3b')]+')':undefined,'ownerid@odata.bind':_0x2dfa('0x2c')+_0x1b1f42['userId']+')','caseorigincode':'1'},getCustomFields(_0x51ff4f[_0x2dfa('0x4a')],_0x49d46f,_0x51ff4f[_0x2dfa('0x44')])),'headers':{'Authorization':_0x2dfa('0x1c')+_0x55aa37,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x51ff4f['ticketType']===_0x2dfa('0x4b')){var _0x661b7b=_0x1b1f42[_0x2dfa('0x3b')]?[{'partyid_systemuser@odata.bind':_0x2dfa('0x2c')+_0x1b1f42[_0x2dfa('0x25')]+')','participationtypemask':_0x1b1f42['callDirection']===_0x2dfa('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x2dfa('0x49')+_0x1b1f42[_0x2dfa('0x3b')]+')','participationtypemask':_0x1b1f42['callDirection']===_0x2dfa('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2dfa('0x2c')+_0x1b1f42[_0x2dfa('0x25')]+')','participationtypemask':_0x1b1f42['callDirection']==='queue'?0x2:0x1}];_0x17f1db={'method':_0x2dfa('0x10'),'uri':_0x3b27d3+_0x2dfa('0x4d'),'body':Object[_0x2dfa('0x46')]({},{'subject':intUtil[_0x2dfa('0x47')](_0x51ff4f[_0x2dfa('0x48')],_0x49d46f,'\x20'),'phonenumber':String(_0x49d46f[_0x2dfa('0x30')]),'description':intUtil[_0x2dfa('0x47')](_0x51ff4f['Descriptions'],_0x49d46f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1b1f42[_0x2dfa('0x3b')]?_0x2dfa('0x49')+_0x1b1f42['enduserId']+')':undefined,'ownerid@odata.bind':_0x2dfa('0x2c')+_0x1b1f42[_0x2dfa('0x25')]+')','directioncode':_0x1b1f42['callDirection']===_0x2dfa('0x4c')?![]:!![],'phonecall_activity_parties':_0x661b7b},getCustomFields(_0x51ff4f[_0x2dfa('0x4a')],_0x49d46f,_0x51ff4f[_0x2dfa('0x44')])),'headers':{'Authorization':_0x2dfa('0x1c')+_0x55aa37,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x17f1db);})[_0x2dfa('0x13')](function(_0x1f1fa3){var _0xaf45cf=_0x1f1fa3['headers'][_0x2dfa('0x4e')];var _0x4434ce=_0xaf45cf[_0x2dfa('0x41')](_0xaf45cf['lastIndexOf']('(')+0x1,_0xaf45cf[_0x2dfa('0x2f')](')'));_0x1b1f42[_0x2dfa('0x4f')]=_0x4434ce;_0x5f48b2(_0x1b1f42);})[_0x2dfa('0x15')](function(_0x7c6738){_0x1e28b3(_0x7c6738[_0x2dfa('0x19')]);});});}function emit(_0x3e6351,_0x57955c,_0x30c3c0,_0x20e0be){var _0x5f312d={'uri':util[_0x2dfa('0x50')](_0x2dfa('0x51'),_0x3e6351,_0x30c3c0,_0x20e0be)};io['to'](util[_0x2dfa('0x50')](_0x2dfa('0x52'),_0x57955c))[_0x2dfa('0x53')](_0x2dfa('0x54'),_0x5f312d);}exports['cs']=function(_0x53cf4d,_0x5eec0f,_0x9fe9db,_0x236ea6,_0x41fa5b,_0x4dd839,_0x54ddaa,_0x2ef9d8){var _0x21a9cf={};_0x4dd839[_0x2dfa('0xa')]=_0x4dd839[_0x2dfa('0x9')]?intUtil[_0x2dfa('0x55')](_0x4dd839['CloudProvider']['data7']):intUtil[_0x2dfa('0x55')](_0x4dd839['remoteUri']);_0x4dd839[_0x2dfa('0x56')]=intUtil[_0x2dfa('0x55')](_0x4dd839['serverUrl']);_0x21a9cf['callDirection']=_0x2ef9d8===_0x2dfa('0x4c')||_0x2ef9d8===_0x2dfa('0x57')?_0x2dfa('0x4c'):_0x2dfa('0x29');var _0x20c790=_0x4dd839[_0x2dfa('0x9')]?util[_0x2dfa('0x50')](_0x2dfa('0x58'),_0x4dd839[_0x2dfa('0xb')]['data7']):util[_0x2dfa('0x50')]('%s/api/data/v9.0/',_0x4dd839['remoteUri']);var _0x17366f=util['format'](_0x2dfa('0x59'),_0x4dd839[_0x2dfa('0xc')]);var _0x13598d=util[_0x2dfa('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dd839[_0x2dfa('0x56')],_0x5eec0f[_0x2dfa('0x5a')],md5(_0x5eec0f[_0x2dfa('0x5a')]));if(_0x41fa5b&&_0x41fa5b[_0x2dfa('0x5b')]){logger[_0x2dfa('0x26')](_0x2dfa('0x5c'),'Recording\x20is\x20enabled!');_0x5eec0f['recordingURL']=_0x13598d;}else if(_0x54ddaa&&_0x54ddaa['recordingFormat']&&_0x54ddaa['recordingFormat']!==_0x2dfa('0x5d')){logger[_0x2dfa('0x26')]('[OUTBOUND]',_0x2dfa('0x5e'));_0x5eec0f[_0x2dfa('0x5f')]=_0x13598d;}else{_0x5eec0f['recordingURL']='';}return getUser(_0x21a9cf,_0x4dd839,_0x236ea6,_0x17366f,_0x20c790,_0x2ef9d8)[_0x2dfa('0x13')](function(_0x9526eb){logger['info']('['+_0x2ef9d8[_0x2dfa('0x17')]()+_0x2dfa('0x60'),_0x9526eb[_0x2dfa('0x25')]);logger[_0x2dfa('0x26')]('['+_0x2ef9d8[_0x2dfa('0x17')]()+']\x20The\x20User\x20email\x20is:',_0x9526eb[_0x2dfa('0x28')]);return getEndUser(_0x9526eb,_0x4dd839,_0x17366f,_0x20c790,_0x5eec0f,_0x2ef9d8,_0x9fe9db['moduleCreate'],_0x9fe9db[_0x2dfa('0x61')]);})[_0x2dfa('0x13')](function(_0x3c1783){logger[_0x2dfa('0x26')]('['+_0x2ef9d8[_0x2dfa('0x17')]()+_0x2dfa('0x62'),_0x3c1783[_0x2dfa('0x3b')]);logger[_0x2dfa('0x26')]('['+_0x2ef9d8['toUpperCase']()+_0x2dfa('0x63'),_0x5eec0f[_0x2dfa('0x30')]);return getTicket(_0x3c1783,_0x4dd839,_0x17366f,_0x20c790,_0x5eec0f,_0x9fe9db,_0x2ef9d8);})[_0x2dfa('0x13')](function(_0x40bc02){logger[_0x2dfa('0x26')](util['format']('['+_0x2ef9d8[_0x2dfa('0x17')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x9fe9db[_0x2dfa('0x44')],_0x40bc02[_0x2dfa('0x4f')]));logger[_0x2dfa('0x26')](util[_0x2dfa('0x50')]('['+_0x2ef9d8[_0x2dfa('0x17')]()+_0x2dfa('0x64'),_0x2ef9d8));if(_0x2ef9d8!==_0x2dfa('0x57')&&_0x9fe9db['openNewTab']){logger[_0x2dfa('0x26')]('['+_0x2ef9d8[_0x2dfa('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4dd839[_0x2dfa('0xa')],_0x236ea6[_0x2dfa('0x65')],_0x9fe9db[_0x2dfa('0x44')],_0x40bc02[_0x2dfa('0x4f')]);}})['catch'](function(_0x2fbae8){logger[_0x2dfa('0x16')]('['+_0x2ef9d8[_0x2dfa('0x17')]()+_0x2dfa('0x66'),_0x2fbae8[_0x2dfa('0x19')]);console[_0x2dfa('0x16')](_0x2dfa('0x67'),_0x2fbae8);});}; \ 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 97a6785..43366d1 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 _0x906b=['Variable','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','stripTrailingSlash','serverUrl','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','The\x20Enduser\x20ID\x20is:','trigger:browser:url','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','getString','Descriptions','
','Tags','name','Fields','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','push','variableName','customVariable'];(function(_0x1b5dac,_0xcb846e){var _0x233383=function(_0x1a014){while(--_0x1a014){_0x1b5dac['push'](_0x1b5dac['shift']());}};_0x233383(++_0xcb846e);}(_0x906b,0x1e2));var _0xb906=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x906b[_0x5d1044];return _0x3cd90e;};'use strict';var _=require(_0xb906('0x0'));var rp=require('request-promise');var md5=require(_0xb906('0x1'));var util=require(_0xb906('0x2'));var Redis=require(_0xb906('0x3'));var intUtil=require(_0xb906('0x4'));var config=require(_0xb906('0x5'));var logger=require(_0xb906('0x6'))(_0xb906('0x7'));config[_0xb906('0x8')]=_[_0xb906('0x9')](config[_0xb906('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb906('0xa'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xb906('0xb')};function emit(_0x5e391b,_0x41bdf4,_0x4445e0){io['to'](_0x5e391b)[_0xb906('0xc')](_0x41bdf4,_0x4445e0);}function getTicket(_0xbee842,_0x188a96,_0x288c88,_0x3ef520,_0x4016a8){logger[_0xb906('0xd')](_0xb906('0xe'));var _0x9c73d=_[_0xb906('0xf')]({'responder_id':_0x188a96['id'],'requester_id':_0x288c88['id'],'name':util[_0xb906('0x10')]('Caller\x20-\x20%s',_0x4016a8[_0xb906('0x11')]),'phone':_0x4016a8['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb906('0x12')](_0x3ef520['Subjects'],_0x4016a8,'\x20'),'description':intUtil[_0xb906('0x12')](_0x3ef520[_0xb906('0x13')],_0x4016a8,_0xb906('0x14')),'tags':getTags(_0x3ef520[_0xb906('0x15')],_0xb906('0x16'))},getCustomFields(_0x3ef520[_0xb906('0x17')],_0x4016a8));_0x9c73d['custom_fields']=_[_0xb906('0x18')](_[_0xb906('0x19')](_0x9c73d[_0xb906('0x1a')],'id'),'value');return request({'uri':util['format'](_0xb906('0x1b'),_0xbee842[_0xb906('0x1c')]),'method':_0xb906('0x1d'),'body':_0x9c73d})[_0xb906('0x1e')](function(_0x410f18){logger[_0xb906('0xd')](_0xb906('0x1f'));return _0x410f18;});}function getUser(_0x1227eb,_0x42e232){if(intUtil[_0xb906('0x20')](_0x42e232)){return request({'uri':util['format']('%s/api/v2/agents',_0x1227eb[_0xb906('0x1c')]),'qs':{'email':_0x42e232}})[_0xb906('0x1e')](function(_0xd0ec21){if(_0xd0ec21[_0xb906('0x21')]){logger['info'](_0xb906('0x22'));return _[_0xb906('0x23')](_0xd0ec21,function(_0x1ab750){return _0x1ab750[_0xb906('0x24')][_0xb906('0x25')]===_0x42e232;});}else{logger[_0xb906('0xd')](_0xb906('0x26'));return request({'uri':util[_0xb906('0x10')]('%s/api/v2/agents/me',_0x1227eb[_0xb906('0x1c')])})[_0xb906('0x1e')](function(_0x4d9249){logger[_0xb906('0xd')]('Admin\x20account\x20selected.');return _0x4d9249;});}});}else{logger['info'](_0xb906('0x27'));return request({'uri':util[_0xb906('0x10')](_0xb906('0x28'),_0x1227eb[_0xb906('0x1c')])})[_0xb906('0x1e')](function(_0x55d5c9){logger[_0xb906('0xd')]('Admin\x20account\x20selected.');return _0x55d5c9;});}}function getEndUser(_0x5278fd,_0x400df0,_0x429022){logger[_0xb906('0xd')]('Searching\x20enduser\x20with\x20phone',_0x429022);return request({'uri':util[_0xb906('0x10')](_0xb906('0x29'),_0x5278fd[_0xb906('0x1c')]),'qs':{'phone':_0x429022}})[_0xb906('0x1e')](function(_0x4542ab){if(_0x4542ab[_0xb906('0x21')]){logger[_0xb906('0xd')]('Enduser\x20found!');return _[_0xb906('0x23')](_0x4542ab,{'phone':_0x429022});}else{logger[_0xb906('0xd')](_0xb906('0x2a'));return request({'uri':util[_0xb906('0x10')](_0xb906('0x29'),_0x5278fd['remoteUri']),'method':_0xb906('0x1d'),'body':{'name':_0x400df0,'phone':_0x429022}})[_0xb906('0x1e')](function(_0xd13c2f){logger[_0xb906('0xd')]('Enduser\x20created.');return _0xd13c2f;});}});}function getAuth(_0x1e16ba){return util['format'](_0xb906('0x2b'),new Buffer(_0x1e16ba[_0xb906('0x2c')]+':X')[_0xb906('0x2d')](_0xb906('0x2e')));}function request(_0x40d210){logger[_0xb906('0x2f')](_0xb906('0x30'),JSON[_0xb906('0x31')](_0x40d210));return rp(_['defaults'](_0x40d210,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x19a195,_0x275a9d){var _0x1a7bea=[];if(_0x19a195&&_0x19a195[_0xb906('0x21')]>0x0){_0x1a7bea=_[_0xb906('0x32')](_0x19a195,_0x275a9d);}return _0x1a7bea;}function getCustomFields(_0x384409,_0x49d5a5){var _0x39f568=[];var _0x5a31af={'custom_fields':[]};if(_0x384409['length']>0x0){_[_0xb906('0x33')](_0x384409,function(_0x2a5343){if(_['includes']([_0xb906('0x34'),_0xb906('0x35')],_0x2a5343[_0xb906('0x36')])&&_0x2a5343[_0xb906('0x37')]&&!_0x2a5343[_0xb906('0x38')]){_0x5a31af[_0x2a5343['nameField'][_0xb906('0x39')]()]=_0x2a5343[_0xb906('0x3a')][_0xb906('0x2d')]();}else if(_[_0xb906('0x3b')](['string','picklist'],_0x2a5343['type'])&&_0x2a5343[_0xb906('0x3c')]&&_0x2a5343[_0xb906('0x38')]){_0x5a31af[_0xb906('0x1a')][_0xb906('0x3d')]({'id':_0x2a5343[_0xb906('0x3c')],'value':_0x2a5343[_0xb906('0x3a')][_0xb906('0x2d')]()});}else if(_0x2a5343[_0xb906('0x36')]==='variable'&&_0x2a5343[_0xb906('0x3e')]&&_0x2a5343[_0xb906('0x3c')]&&_0x2a5343['customField']){_0x49d5a5[_0x2a5343['variableName']]&&_0x5a31af[_0xb906('0x1a')][_0xb906('0x3d')]({'id':_0x2a5343[_0xb906('0x3c')],'value':_0x49d5a5[_0x2a5343[_0xb906('0x3e')]][_0xb906('0x2d')]()});}else if(_0x2a5343[_0xb906('0x36')]===_0xb906('0x3f')&&_0x2a5343[_0xb906('0x40')]&&_0x2a5343['Variable'][_0xb906('0x16')]&&_0x2a5343[_0xb906('0x3c')]&&_0x2a5343[_0xb906('0x38')]){_0x49d5a5[_0x2a5343[_0xb906('0x40')][_0xb906('0x16')]['toLowerCase']()]&&_0x5a31af[_0xb906('0x1a')]['push']({'id':_0x2a5343[_0xb906('0x3c')],'value':_0x49d5a5[_0x2a5343[_0xb906('0x40')][_0xb906('0x16')][_0xb906('0x39')]()][_0xb906('0x2d')]()});}});}return _0x5a31af;}exports[_0xb906('0x41')]=function(_0x32beff,_0x31eb30,_0x51bc71,_0x31e09c,_0x547732,_0x70e1f6){var _0x2d9b91,_0xa72873;_0x70e1f6[_0xb906('0x1c')]=intUtil['stripTrailingSlash'](_0x70e1f6[_0xb906('0x1c')]);_0x70e1f6['serverUrl']=intUtil['stripTrailingSlash'](_0x70e1f6['serverUrl']);if(_0x547732&&_0x547732[_0xb906('0x42')]){logger[_0xb906('0xd')](_0xb906('0x43'),_0xb906('0x44'));_0x31eb30['recordingURL']=util[_0xb906('0x10')](_0xb906('0x45'),_0x70e1f6['serverUrl'],_0x31eb30[_0xb906('0x46')],md5(_0x31eb30[_0xb906('0x46')]));}else{_0x31eb30['recordingURL']='';}headers[_0xb906('0x47')]=getAuth(_0x70e1f6);return getUser(_0x70e1f6,_0x31e09c[_0xb906('0x25')])[_0xb906('0x1e')](function(_0x38b7f8){_0x2d9b91=_0x38b7f8;logger[_0xb906('0xd')](_0xb906('0x48'),_0x2d9b91['id']);return getEndUser(_0x70e1f6,_0x31eb30['calleridname'],_0x31eb30[_0xb906('0x49')]);})[_0xb906('0x1e')](function(_0xf3dbd7){_0xa72873=_0xf3dbd7;logger[_0xb906('0xd')]('The\x20Enduser\x20ID\x20is:',_0xa72873['id']);return getTicket(_0x70e1f6,_0x2d9b91,_0xa72873,_0x51bc71,_0x31eb30);})[_0xb906('0x1e')](function(_0x4be1ea){if(_0x4be1ea&&_0x4be1ea['id']){logger[_0xb906('0xd')](_0xb906('0x1f'));logger[_0xb906('0xd')](_0xb906('0x4a'),_0x4be1ea['id']);logger[_0xb906('0xd')]('[QUEUE]',_0xb906('0x4b'));emit(util['format'](_0xb906('0x4c'),_0x31e09c['name']),'trigger:browser:url',{'uri':util['format'](_0xb906('0x4d'),_0x70e1f6[_0xb906('0x1c')],_0x4be1ea['id'])});}})[_0xb906('0x4e')](function(_0x14b2f1){logger[_0xb906('0x4f')](_0xb906('0x43'),JSON[_0xb906('0x31')](_0x14b2f1));});};exports['outbound']=function(_0x347c16,_0x307691,_0x281783,_0x28a3e5,_0xad6467,_0x1b801c,_0x2f6fe6){var _0x455205,_0x4b2061;_0x1b801c['remoteUri']=intUtil[_0xb906('0x50')](_0x1b801c[_0xb906('0x1c')]);_0x1b801c[_0xb906('0x51')]=intUtil[_0xb906('0x50')](_0x1b801c[_0xb906('0x51')]);if(_0x2f6fe6&&_0x2f6fe6['recordingFormat']&&_0x2f6fe6[_0xb906('0x52')]!==_0xb906('0x53')){logger['info'](_0xb906('0x54'),_0xb906('0x44'));_0x307691[_0xb906('0x55')]=util[_0xb906('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b801c[_0xb906('0x51')],_0x307691[_0xb906('0x46')],md5(_0x307691['uniqueid']));}headers[_0xb906('0x47')]=getAuth(_0x1b801c);return getUser(_0x1b801c,_0x28a3e5['email'])['then'](function(_0x26ab49){_0x455205=_0x26ab49;logger[_0xb906('0xd')]('The\x20User\x20ID\x20is:',_0x455205['id']);return getEndUser(_0x1b801c,_0x307691[_0xb906('0x56')],_0x307691['destcalleridnum']);})[_0xb906('0x1e')](function(_0x359dca){_0x4b2061=_0x359dca;logger['info'](_0xb906('0x57'),_0x4b2061['id']);return getTicket(_0x1b801c,_0x455205,_0x4b2061,_0x281783,_0x307691);})[_0xb906('0x1e')](function(_0x38d61c){if(_0x38d61c&&_0x38d61c['id']){logger['info'](_0xb906('0x1f'));logger[_0xb906('0xd')](_0xb906('0x4a'),_0x38d61c['id']);logger['info'](_0xb906('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb906('0x4c'),_0x28a3e5[_0xb906('0x16')]),_0xb906('0x58'),{'uri':util[_0xb906('0x10')](_0xb906('0x4d'),_0x1b801c['remoteUri'],_0x38d61c['id'])});}})[_0xb906('0x4e')](function(_0x31ec9d){logger['error'](_0xb906('0x54'),JSON['stringify'](_0x31ec9d));});};exports['unmanaged']=function(_0x421bc2,_0x2baf8b,_0x21f5b6,_0x5a7e48,_0x260c42,_0x5ed247){var _0x30ef24,_0xf6fd8e;_0x5ed247[_0xb906('0x1c')]=intUtil[_0xb906('0x50')](_0x5ed247[_0xb906('0x1c')]);_0x5ed247[_0xb906('0x51')]=intUtil[_0xb906('0x50')](_0x5ed247[_0xb906('0x51')]);if(_0x260c42&&_0x260c42[_0xb906('0x42')]){logger[_0xb906('0xd')]('['+_0x2baf8b[_0xb906('0x59')][_0xb906('0x5a')]()+']','Recording\x20is\x20enabled!');_0x2baf8b[_0xb906('0x55')]=util[_0xb906('0x10')](_0xb906('0x45'),_0x5ed247[_0xb906('0x51')],_0x2baf8b[_0xb906('0x46')],md5(_0x2baf8b[_0xb906('0x46')]));}else{_0x2baf8b[_0xb906('0x55')]='';}headers[_0xb906('0x47')]=getAuth(_0x5ed247);return getUser(_0x5ed247,'')[_0xb906('0x1e')](function(_0x2dc784){_0x30ef24=_0x2dc784;logger[_0xb906('0xd')](_0xb906('0x48'),_0x30ef24['id']);return getEndUser(_0x5ed247,_0x2baf8b[_0xb906('0x11')],_0x2baf8b[_0xb906('0x49')]);})[_0xb906('0x1e')](function(_0x434368){_0xf6fd8e=_0x434368;logger['info'](_0xb906('0x57'),_0xf6fd8e['id']);return getTicket(_0x5ed247,_0x30ef24,_0xf6fd8e,_0x21f5b6,_0x2baf8b);})[_0xb906('0x1e')](function(_0x134ae3){if(_0x134ae3){logger[_0xb906('0xd')](_0xb906('0x1f'));logger[_0xb906('0xd')]('The\x20Ticket\x20ID\x20is:',_0x134ae3['id']);}})[_0xb906('0x4e')](function(_0xdd3cdb){logger[_0xb906('0x4f')]('['+_0x2baf8b[_0xb906('0x59')]['toUpperCase']()+']',JSON[_0xb906('0x31')](_0xdd3cdb));});}; \ No newline at end of file +var _0x1223=['content','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','map','forEach','includes','string','type','customField','nameField','toLowerCase','idField','push'];(function(_0x59f3bf,_0x36563e){var _0x2f3642=function(_0x3261b6){while(--_0x3261b6){_0x59f3bf['push'](_0x59f3bf['shift']());}};_0x2f3642(++_0x36563e);}(_0x1223,0xdd));var _0x3122=function(_0x1ef655,_0x3b3d9a){_0x1ef655=_0x1ef655-0x0;var _0x5ca856=_0x1223[_0x1ef655];return _0x5ca856;};'use strict';var _=require(_0x3122('0x0'));var rp=require('request-promise');var md5=require(_0x3122('0x1'));var util=require(_0x3122('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3122('0x3'))(_0x3122('0x4'));config[_0x3122('0x5')]=_['defaults'](config[_0x3122('0x5')],{'host':_0x3122('0x6'),'port':0x18eb});var io=require(_0x3122('0x7'))(new Redis(config[_0x3122('0x5')]));var headers={'Content-Type':_0x3122('0x8'),'Accept':'application/json'};function emit(_0x56f3a5,_0x175ca7,_0x4f4278){io['to'](_0x56f3a5)['emit'](_0x175ca7,_0x4f4278);}function getTicket(_0x2f700f,_0x4fe235,_0x15e6f9,_0x19f2be,_0x200bd6){logger['info']('Creating\x20new\x20ticket...');var _0xc776ab=_[_0x3122('0x9')]({'responder_id':_0x4fe235['id'],'requester_id':_0x15e6f9['id'],'name':util[_0x3122('0xa')](_0x3122('0xb'),_0x200bd6['calleridname']),'phone':_0x200bd6[_0x3122('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3122('0xd')](_0x19f2be['Subjects'],_0x200bd6,'\x20'),'description':intUtil[_0x3122('0xd')](_0x19f2be[_0x3122('0xe')],_0x200bd6,'
'),'tags':getTags(_0x19f2be[_0x3122('0xf')],_0x3122('0x10'))},getCustomFields(_0x19f2be[_0x3122('0x11')],_0x200bd6));_0xc776ab[_0x3122('0x12')]=_[_0x3122('0x13')](_[_0x3122('0x14')](_0xc776ab[_0x3122('0x12')],'id'),_0x3122('0x15'));return request({'uri':util['format'](_0x3122('0x16'),_0x2f700f['remoteUri']),'method':'POST','body':_0xc776ab})['then'](function(_0x47dd83){logger[_0x3122('0x17')](_0x3122('0x18'));return _0x47dd83;});}function getUser(_0xf0686b,_0x7d7459){if(intUtil[_0x3122('0x19')](_0x7d7459)){return request({'uri':util['format'](_0x3122('0x1a'),_0xf0686b[_0x3122('0x1b')]),'qs':{'email':_0x7d7459}})[_0x3122('0x1c')](function(_0x4ff3b6){if(_0x4ff3b6[_0x3122('0x1d')]){logger[_0x3122('0x17')]('Agent\x20found!');return _[_0x3122('0x1e')](_0x4ff3b6,function(_0x197317){return _0x197317[_0x3122('0x1f')][_0x3122('0x20')]===_0x7d7459;});}else{logger[_0x3122('0x17')](_0x3122('0x21'));return request({'uri':util[_0x3122('0xa')]('%s/api/v2/agents/me',_0xf0686b[_0x3122('0x1b')])})[_0x3122('0x1c')](function(_0x156344){logger[_0x3122('0x17')](_0x3122('0x22'));return _0x156344;});}});}else{logger[_0x3122('0x17')](_0x3122('0x23'));return request({'uri':util[_0x3122('0xa')](_0x3122('0x24'),_0xf0686b[_0x3122('0x1b')])})[_0x3122('0x1c')](function(_0x283398){logger[_0x3122('0x17')]('Admin\x20account\x20selected.');return _0x283398;});}}function getEndUser(_0x176c6a,_0x458ff1,_0x1c5514){logger[_0x3122('0x17')](_0x3122('0x25'),_0x1c5514);return request({'uri':util[_0x3122('0xa')](_0x3122('0x26'),_0x176c6a['remoteUri']),'qs':{'phone':_0x1c5514}})[_0x3122('0x1c')](function(_0x1a4bd9){if(_0x1a4bd9[_0x3122('0x1d')]){logger['info'](_0x3122('0x27'));return _[_0x3122('0x1e')](_0x1a4bd9,{'phone':_0x1c5514});}else{logger[_0x3122('0x17')](_0x3122('0x28'));return request({'uri':util[_0x3122('0xa')]('%s/api/v2/contacts',_0x176c6a[_0x3122('0x1b')]),'method':_0x3122('0x29'),'body':{'name':_0x458ff1,'phone':_0x1c5514}})['then'](function(_0x467fcd){logger[_0x3122('0x17')](_0x3122('0x2a'));return _0x467fcd;});}});}function getAuth(_0xdf23e2){return util[_0x3122('0xa')](_0x3122('0x2b'),new Buffer(_0xdf23e2[_0x3122('0x2c')]+':X')[_0x3122('0x2d')](_0x3122('0x2e')));}function request(_0x474d45){logger[_0x3122('0x2f')](_0x3122('0x30'),JSON[_0x3122('0x31')](_0x474d45));return rp(_[_0x3122('0x32')](_0x474d45,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x355da2,_0x1027b9){var _0x413a80=[];if(_0x355da2&&_0x355da2[_0x3122('0x1d')]>0x0){_0x413a80=_[_0x3122('0x33')](_0x355da2,_0x1027b9);}return _0x413a80;}function getCustomFields(_0x32d13a,_0x3a93a0){var _0x53564c=[];var _0x1c60d2={'custom_fields':[]};if(_0x32d13a['length']>0x0){_[_0x3122('0x34')](_0x32d13a,function(_0x3245fc){if(_[_0x3122('0x35')]([_0x3122('0x36'),'picklist'],_0x3245fc[_0x3122('0x37')])&&_0x3245fc['nameField']&&!_0x3245fc[_0x3122('0x38')]){_0x1c60d2[_0x3245fc[_0x3122('0x39')][_0x3122('0x3a')]()]=_0x3245fc['content'][_0x3122('0x2d')]();}else if(_['includes']([_0x3122('0x36'),'picklist'],_0x3245fc[_0x3122('0x37')])&&_0x3245fc[_0x3122('0x3b')]&&_0x3245fc[_0x3122('0x38')]){_0x1c60d2[_0x3122('0x12')][_0x3122('0x3c')]({'id':_0x3245fc['idField'],'value':_0x3245fc[_0x3122('0x3d')][_0x3122('0x2d')]()});}else if(_0x3245fc[_0x3122('0x37')]===_0x3122('0x3e')&&_0x3245fc[_0x3122('0x3f')]&&_0x3245fc['idField']&&_0x3245fc[_0x3122('0x38')]){_0x3a93a0[_0x3245fc['variableName']]&&_0x1c60d2[_0x3122('0x12')][_0x3122('0x3c')]({'id':_0x3245fc[_0x3122('0x3b')],'value':_0x3a93a0[_0x3245fc['variableName']][_0x3122('0x2d')]()});}else if(_0x3245fc[_0x3122('0x37')]===_0x3122('0x40')&&_0x3245fc[_0x3122('0x41')]&&_0x3245fc[_0x3122('0x41')][_0x3122('0x10')]&&_0x3245fc[_0x3122('0x3b')]&&_0x3245fc[_0x3122('0x38')]){_0x3a93a0[_0x3245fc[_0x3122('0x41')]['name'][_0x3122('0x3a')]()]&&_0x1c60d2[_0x3122('0x12')][_0x3122('0x3c')]({'id':_0x3245fc[_0x3122('0x3b')],'value':_0x3a93a0[_0x3245fc[_0x3122('0x41')][_0x3122('0x10')]['toLowerCase']()][_0x3122('0x2d')]()});}});}return _0x1c60d2;}exports[_0x3122('0x42')]=function(_0x22a139,_0x469cf4,_0x33f1f2,_0x3f9042,_0xe2fb2d,_0x609f0d){var _0x359f38,_0x3d5d13;_0x609f0d[_0x3122('0x1b')]=intUtil['stripTrailingSlash'](_0x609f0d[_0x3122('0x1b')]);_0x609f0d[_0x3122('0x43')]=intUtil['stripTrailingSlash'](_0x609f0d[_0x3122('0x43')]);if(_0xe2fb2d&&_0xe2fb2d[_0x3122('0x44')]){logger[_0x3122('0x17')](_0x3122('0x45'),_0x3122('0x46'));_0x469cf4[_0x3122('0x47')]=util[_0x3122('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x609f0d['serverUrl'],_0x469cf4[_0x3122('0x48')],md5(_0x469cf4[_0x3122('0x48')]));}else{_0x469cf4[_0x3122('0x47')]='';}headers['Authorization']=getAuth(_0x609f0d);return getUser(_0x609f0d,_0x3f9042[_0x3122('0x20')])[_0x3122('0x1c')](function(_0x3e10df){_0x359f38=_0x3e10df;logger[_0x3122('0x17')](_0x3122('0x49'),_0x359f38['id']);return getEndUser(_0x609f0d,_0x469cf4['calleridname'],_0x469cf4[_0x3122('0xc')]);})[_0x3122('0x1c')](function(_0x321081){_0x3d5d13=_0x321081;logger[_0x3122('0x17')](_0x3122('0x4a'),_0x3d5d13['id']);return getTicket(_0x609f0d,_0x359f38,_0x3d5d13,_0x33f1f2,_0x469cf4);})[_0x3122('0x1c')](function(_0x4758e7){if(_0x4758e7&&_0x4758e7['id']){logger[_0x3122('0x17')](_0x3122('0x18'));logger['info'](_0x3122('0x4b'),_0x4758e7['id']);logger[_0x3122('0x17')](_0x3122('0x45'),_0x3122('0x4c'));emit(util['format'](_0x3122('0x4d'),_0x3f9042[_0x3122('0x10')]),_0x3122('0x4e'),{'uri':util[_0x3122('0xa')]('%s/helpdesk/tickets/%d',_0x609f0d[_0x3122('0x1b')],_0x4758e7['id'])});}})[_0x3122('0x4f')](function(_0x55bb7a){logger[_0x3122('0x50')](_0x3122('0x45'),JSON[_0x3122('0x31')](_0x55bb7a));});};exports[_0x3122('0x51')]=function(_0x4fa58d,_0x20abe9,_0x3c2dcd,_0x5e1750,_0x244ac7,_0x16f723,_0xb35e35){var _0x3ca5e4,_0x15a9df;_0x16f723[_0x3122('0x1b')]=intUtil[_0x3122('0x52')](_0x16f723[_0x3122('0x1b')]);_0x16f723[_0x3122('0x43')]=intUtil['stripTrailingSlash'](_0x16f723['serverUrl']);if(_0xb35e35&&_0xb35e35[_0x3122('0x53')]&&_0xb35e35[_0x3122('0x53')]!=='none'){logger[_0x3122('0x17')](_0x3122('0x54'),'Recording\x20is\x20enabled!');_0x20abe9[_0x3122('0x47')]=util[_0x3122('0xa')](_0x3122('0x55'),_0x16f723['serverUrl'],_0x20abe9[_0x3122('0x48')],md5(_0x20abe9['uniqueid']));}headers[_0x3122('0x56')]=getAuth(_0x16f723);return getUser(_0x16f723,_0x5e1750['email'])[_0x3122('0x1c')](function(_0x472112){_0x3ca5e4=_0x472112;logger[_0x3122('0x17')]('The\x20User\x20ID\x20is:',_0x3ca5e4['id']);return getEndUser(_0x16f723,_0x20abe9[_0x3122('0x57')],_0x20abe9[_0x3122('0x58')]);})[_0x3122('0x1c')](function(_0x1ceb31){_0x15a9df=_0x1ceb31;logger['info']('The\x20Enduser\x20ID\x20is:',_0x15a9df['id']);return getTicket(_0x16f723,_0x3ca5e4,_0x15a9df,_0x3c2dcd,_0x20abe9);})['then'](function(_0x284fef){if(_0x284fef&&_0x284fef['id']){logger[_0x3122('0x17')](_0x3122('0x18'));logger[_0x3122('0x17')](_0x3122('0x4b'),_0x284fef['id']);logger[_0x3122('0x17')](_0x3122('0x54'),_0x3122('0x4c'));emit(util[_0x3122('0xa')]('user:%s',_0x5e1750[_0x3122('0x10')]),'trigger:browser:url',{'uri':util[_0x3122('0xa')](_0x3122('0x59'),_0x16f723[_0x3122('0x1b')],_0x284fef['id'])});}})['catch'](function(_0x5a3c4d){logger['error'](_0x3122('0x54'),JSON[_0x3122('0x31')](_0x5a3c4d));});};exports[_0x3122('0x5a')]=function(_0x4aa550,_0x5415d4,_0xdac805,_0x165b55,_0x2487bc,_0x15685c){var _0x29442c,_0x5e90cc;_0x15685c[_0x3122('0x1b')]=intUtil[_0x3122('0x52')](_0x15685c[_0x3122('0x1b')]);_0x15685c[_0x3122('0x43')]=intUtil['stripTrailingSlash'](_0x15685c['serverUrl']);if(_0x2487bc&&_0x2487bc[_0x3122('0x44')]){logger['info']('['+_0x5415d4[_0x3122('0x5b')][_0x3122('0x5c')]()+']',_0x3122('0x46'));_0x5415d4[_0x3122('0x47')]=util['format'](_0x3122('0x55'),_0x15685c[_0x3122('0x43')],_0x5415d4[_0x3122('0x48')],md5(_0x5415d4[_0x3122('0x48')]));}else{_0x5415d4[_0x3122('0x47')]='';}headers[_0x3122('0x56')]=getAuth(_0x15685c);return getUser(_0x15685c,'')['then'](function(_0x303333){_0x29442c=_0x303333;logger['info'](_0x3122('0x49'),_0x29442c['id']);return getEndUser(_0x15685c,_0x5415d4[_0x3122('0x5d')],_0x5415d4[_0x3122('0xc')]);})[_0x3122('0x1c')](function(_0x372154){_0x5e90cc=_0x372154;logger[_0x3122('0x17')](_0x3122('0x4a'),_0x5e90cc['id']);return getTicket(_0x15685c,_0x29442c,_0x5e90cc,_0xdac805,_0x5415d4);})[_0x3122('0x1c')](function(_0x3327f6){if(_0x3327f6){logger['info'](_0x3122('0x18'));logger[_0x3122('0x17')](_0x3122('0x4b'),_0x3327f6['id']);}})[_0x3122('0x4f')](function(_0x138d8e){logger[_0x3122('0x50')]('['+_0x5415d4[_0x3122('0x5b')][_0x3122('0x5c')]()+']',JSON[_0x3122('0x31')](_0x138d8e));});}; \ 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 de5c7a5..6380041 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 _0x3af4=['defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','message','/api/lookup?q=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis'];(function(_0x1adad9,_0x2459d7){var _0x400ff8=function(_0x58dcee){while(--_0x58dcee){_0x1adad9['push'](_0x1adad9['shift']());}};_0x400ff8(++_0x2459d7);}(_0x3af4,0xf6));var _0x43af=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x3af4[_0x455c6c];return _0x488242;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x43af('0x0'));var util=require(_0x43af('0x1'));var moment=require(_0x43af('0x2'));var Promise=require(_0x43af('0x3'));var Redis=require(_0x43af('0x4'));var intUtil=require(_0x43af('0x5'));var config=require(_0x43af('0x6'));var logger=require('../../../../config/logger')(_0x43af('0x7'));config[_0x43af('0x8')]=_[_0x43af('0x9')](config[_0x43af('0x8')],{'host':_0x43af('0xa'),'port':0x18eb});var io=require(_0x43af('0xb'))(new Redis(config[_0x43af('0x8')]));function getAdminId(_0x5284d7,_0x2c2230,_0x11e432,_0x16a96d){return new Promise(function(_0x176ff6,_0x5ead71){var _0x4c53d4=![];var _0x1a08ea={'method':_0x43af('0xc'),'uri':_0x16a96d+_0x43af('0xd'),'json':!![]};_0x1a08ea[_0x43af('0xe')]=_0x11e432;logger[_0x43af('0xf')](_0x43af('0x10'));return rp(_0x1a08ea)[_0x43af('0x11')](function(_0xf50bb7){if(_0xf50bb7){var _0x44610a=_0xf50bb7['users'];var _0x9e7fd7=null;for(_0x9e7fd7=0x0;_0x9e7fd7<_0x44610a[_0x43af('0x12')];_0x9e7fd7++){if(_0x44610a[_0x9e7fd7][_0x43af('0x13')]===_0x5284d7['adminEmail']){_0x5284d7[_0x43af('0x14')]=_0x44610a[_0x9e7fd7]['id'];_0x4c53d4=!![];}}if(_0x4c53d4){logger['info']('Admin\x20found:',_0x5284d7[_0x43af('0x14')]);_0x176ff6(_0x5284d7);}else{_0x5ead71({'statusCode':0x194,'message':_0x43af('0x15')});}}else{_0x5ead71({'statusCode':0x194,'message':_0x43af('0x15')});}})[_0x43af('0x16')](function(_0x291cba){logger[_0x43af('0x17')]('['+[_0x2c2230[_0x43af('0x18')]()]+']',_0x291cba['message']);_0x5ead71(_0x291cba);});});}function getUser(_0x578c44,_0x2d08a0,_0x149f59){return function(_0x1a97cb){return new Promise(function(_0x3ec4ac,_0x42e71a){var _0x5aa43b={'method':_0x43af('0xc'),'uri':_0x149f59+_0x43af('0xd'),'json':!![]};_0x5aa43b['headers']=_0x2d08a0;logger['info'](_0x43af('0x19'));return rp(_0x5aa43b)[_0x43af('0x11')](function(_0xb8f062){if(_0xb8f062){var _0x54cf1e=_0xb8f062[_0x43af('0x1a')];var _0x21a4d7=![];var _0x1a7238=null;if(_0x1a97cb[_0x43af('0x1b')]!==null){logger['info'](_0x43af('0x1c'),_0x1a97cb[_0x43af('0x1b')]);_0x1a97cb[_0x43af('0x1d')]=_0x1a97cb[_0x43af('0x1b')];for(_0x1a7238=0x0;_0x1a7238<_0x54cf1e[_0x43af('0x12')];_0x1a7238++){if(_0x54cf1e[_0x1a7238][_0x43af('0x13')]===_0x1a97cb[_0x43af('0x1b')]){_0x21a4d7=!![];_0x1a97cb[_0x43af('0x1e')]=_0x54cf1e[_0x1a7238]['id'];logger[_0x43af('0xf')](_0x43af('0x1f'),_0x1a97cb['userId']);}}}if(!_0x21a4d7){logger['info'](_0x43af('0x20'));_0x1a97cb[_0x43af('0x1d')]=_0x1a97cb[_0x43af('0x21')];_0x1a97cb[_0x43af('0x1e')]=_0x1a97cb[_0x43af('0x14')];_0x21a4d7=!![];}if(_0x21a4d7){_0x3ec4ac(_0x1a97cb);}else{_0x42e71a({'statusCode':0x194,'message':_0x43af('0x15')});}}else{_0x42e71a({'statusCode':0x194,'message':_0x43af('0x15')});}})[_0x43af('0x16')](function(_0x130f48){logger[_0x43af('0x17')]('['+[_0x578c44[_0x43af('0x18')]()]+']',_0x130f48[_0x43af('0x22')]);_0x42e71a(_0x130f48);});});};}function searchContact(_0x21da45,_0x2513f3,_0x2e8d1c,_0x36a61c){return new Promise(function(_0x5eb8e1,_0x73302c){var _0x391f3f={'method':_0x43af('0xc'),'headers':_0x2513f3,'uri':_0x21da45+_0x43af('0x23')+_0x36a61c+'&f='+_0x2e8d1c+_0x43af('0x24'),'json':!![]};rp(_0x391f3f)[_0x43af('0x11')](function(_0xa671fd){var _0x34fe25=_['find'](_0xa671fd[_0x43af('0x25')][_0x43af('0x25')],[_0x2e8d1c,_0x36a61c]);_0x5eb8e1(_0x34fe25);})[_0x43af('0x16')](function(_0xf2fbee){_0x73302c(_0xf2fbee);});});}function getEndUser(_0x2b7332,_0x2992a4,_0x38b82d){return function(_0x3a037c){return new Promise(function(_0x275282,_0x5198b7){logger[_0x43af('0xf')](util[_0x43af('0x26')](_0x43af('0x27'),_0x3a037c[_0x43af('0x28')]));searchContact(_0x38b82d,_0x2992a4,_0x43af('0x29'),_0x3a037c[_0x43af('0x28')])[_0x43af('0x11')](function(_0x2e8c1c){if(_0x2e8c1c){_0x3a037c[_0x43af('0x2a')]=_0x2e8c1c['id'];logger[_0x43af('0xf')](_0x43af('0x2b'),_0x3a037c[_0x43af('0x2a')]);return _0x275282(_0x3a037c);}searchContact(_0x38b82d,_0x2992a4,_0x43af('0x2c'),_0x3a037c[_0x43af('0x28')])['then'](function(_0x5bf140){if(_0x5bf140){_0x3a037c[_0x43af('0x2a')]=_0x5bf140['id'];logger[_0x43af('0xf')]('Contact\x20found\x20work_number:',_0x3a037c[_0x43af('0x2a')]);return _0x275282(_0x3a037c);}createEndUser(_0x3a037c,_0x2b7332,_0x2992a4,_0x38b82d)[_0x43af('0x11')](function(_0x248cba){logger[_0x43af('0xf')](_0x43af('0x2d'),_0x248cba['endUserId']);return _0x275282(_0x248cba);});});})[_0x43af('0x16')](function(_0x1e7bc2){_0x5198b7(_0x1e7bc2);});});};}function createEndUser(_0x809304,_0x40b9a2,_0x21b37c,_0x21a2f7){return new Promise(function(_0x47d9ac,_0x211c51){var _0x125ee5=moment();var _0x115666={'method':_0x43af('0x2e'),'uri':_0x21a2f7+'/api/contacts','body':{'contact':{'last_name':_0x809304[_0x43af('0x28')],'work_number':_0x809304[_0x43af('0x28')],'mobile_number':_0x809304[_0x43af('0x28')],'owner_id':_0x809304[_0x43af('0x1e')],'created_at':_0x125ee5[_0x43af('0x26')](_0x43af('0x2f'))}},'json':!![]};_0x115666[_0x43af('0xe')]=_0x21b37c;logger[_0x43af('0xf')](_0x43af('0x30'));return rp(_0x115666)[_0x43af('0x11')](function(_0x402b12){_0x809304['endUserId']=_0x402b12[_0x43af('0x31')]['id'];_0x47d9ac(_0x809304);})[_0x43af('0x16')](function(_0x2a32f0){logger[_0x43af('0x17')]('['+[_0x40b9a2[_0x43af('0x18')]()]+']',_0x2a32f0[_0x43af('0x22')]);_0x211c51(_0x2a32f0['message']);});});}function getTicket(_0x4989f5,_0x5dea0a,_0x5f061c,_0x55e5b0,_0x395236){return function(_0x421b5f){logger[_0x43af('0xf')](_0x43af('0x32'));return new Promise(function(_0x23b449,_0xcbd302){var _0x5cf0ee=moment();var _0x4d48b4={'method':_0x43af('0x2e'),'uri':_0x5f061c+'/api/tasks','body':{'title':intUtil['getString'](_0x55e5b0[_0x43af('0x33')],_0x395236,'\x20'),'description':intUtil[_0x43af('0x34')](_0x55e5b0[_0x43af('0x35')],_0x395236,'\x0a'),'owner_id':_0x421b5f['userId'],'creater_id':_0x421b5f[_0x43af('0x14')],'targetable_id':_0x421b5f[_0x43af('0x2a')],'targetable_type':_0x43af('0x36'),'created_at':_0x5cf0ee['format'](_0x43af('0x2f')),'due_date':_0x5cf0ee[_0x43af('0x37')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x4d48b4['headers']=_0x5dea0a;return rp(_0x4d48b4)[_0x43af('0x11')](function(_0x72600c){_0x421b5f[_0x43af('0x38')]=_0x72600c[_0x43af('0x39')]['id'];logger[_0x43af('0xf')](_0x43af('0x3a'),_0x421b5f[_0x43af('0x38')]);_0x23b449(_0x421b5f);})['catch'](function(_0x14142c){logger[_0x43af('0x17')]('['+[_0x4989f5['toUpperCase']()]+']',_0x14142c['message']);_0xcbd302(_0x14142c[_0x43af('0x22')]);});});};}function emit(_0x2d4d8a,_0x3427b2,_0x4061d3){var _0x57722b={'uri':_0x2d4d8a+_0x43af('0x3b')+_0x4061d3};io['to'](util[_0x43af('0x26')](_0x43af('0x3c'),_0x3427b2))['emit'](_0x43af('0x3d'),_0x57722b);}exports['cs']=function(_0x48ecf9,_0x58df14,_0x4a1eff,_0x56753f,_0x48e461,_0x179d8f,_0x3166ee,_0x383aef){var _0x383a40={};var _0xb8c67e={'Authorization':_0x43af('0x3e')+_0x179d8f[_0x43af('0x3f')]};_0x179d8f[_0x43af('0x40')]=intUtil[_0x43af('0x41')](_0x179d8f[_0x43af('0x40')]);_0x179d8f[_0x43af('0x42')]=intUtil[_0x43af('0x41')](_0x179d8f[_0x43af('0x42')]);var _0x314cd0=_0x179d8f['remoteUri'];_0x383a40['adminEmail']=_0x179d8f['username'];_0x383a40[_0x43af('0x28')]=_0x383aef['toLowerCase']()===_0x43af('0x43')?_0x58df14[_0x43af('0x44')]:_0x58df14[_0x43af('0x45')];_0x383a40[_0x43af('0x46')]=_0x383aef===_0x43af('0x47')||_0x383aef===_0x43af('0x48')?_0x43af('0x47'):_0x43af('0x43');if(_0x56753f){_0x383a40[_0x43af('0x1b')]=_0x56753f[_0x43af('0x13')];}var _0x41942b=util[_0x43af('0x26')](_0x43af('0x49'),_0x179d8f['serverUrl'],_0x58df14[_0x43af('0x4a')],md5(_0x58df14['uniqueid']));if(_0x48e461&&_0x48e461['monitor_format']){logger[_0x43af('0xf')](_0x43af('0x4b'),_0x43af('0x4c'));_0x58df14[_0x43af('0x4d')]=_0x41942b;}else if(_0x3166ee&&_0x3166ee[_0x43af('0x4e')]&&_0x3166ee['recordingFormat']!==_0x43af('0x4f')){logger[_0x43af('0xf')](_0x43af('0x50'),'Recording\x20is\x20enabled!');_0x58df14['recordingURL']=_0x41942b;}else{_0x58df14['recordingURL']='';}return getAdminId(_0x383a40,_0x383aef,_0xb8c67e,_0x314cd0)[_0x43af('0x11')](getUser(_0x383aef,_0xb8c67e,_0x314cd0))[_0x43af('0x11')](getEndUser(_0x383aef,_0xb8c67e,_0x314cd0))[_0x43af('0x11')](getTicket(_0x383aef,_0xb8c67e,_0x314cd0,_0x4a1eff,_0x58df14))[_0x43af('0x11')](function(_0x145af5){logger[_0x43af('0xf')](util[_0x43af('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x145af5[_0x43af('0x38')]));if(_0x383aef!==_0x43af('0x48')){logger['info']('['+[_0x383aef[_0x43af('0x18')]()]+']',_0x43af('0x51'));emit(_0x314cd0,_0x56753f[_0x43af('0x52')],_0x145af5[_0x43af('0x2a')]);}})[_0x43af('0x16')](function(_0xe67ee8){logger[_0x43af('0x17')]('['+[_0x383aef[_0x43af('0x18')]()]+_0x43af('0x53'),util[_0x43af('0x54')](_0xe67ee8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x02e3=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','lodash','request-promise','md5','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','error','message','&f=','contacts','format','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x570ead,_0x3efedf){var _0x5c245f=function(_0x3aa05d){while(--_0x3aa05d){_0x570ead['push'](_0x570ead['shift']());}};_0x5c245f(++_0x3efedf);}(_0x02e3,0xfa));var _0x302e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x02e3[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x302e('0x0'));var rp=require(_0x302e('0x1'));var md5=require(_0x302e('0x2'));var util=require('util');var moment=require(_0x302e('0x3'));var Promise=require(_0x302e('0x4'));var Redis=require(_0x302e('0x5'));var intUtil=require('./util');var config=require(_0x302e('0x6'));var logger=require(_0x302e('0x7'))(_0x302e('0x8'));config[_0x302e('0x9')]=_[_0x302e('0xa')](config['redis'],{'host':_0x302e('0xb'),'port':0x18eb});var io=require(_0x302e('0xc'))(new Redis(config['redis']));function getAdminId(_0x55e932,_0x253fdf,_0x2304bf,_0x30d67d){return new Promise(function(_0x282097,_0x2962b6){var _0x383763=![];var _0x55032d={'method':_0x302e('0xd'),'uri':_0x30d67d+_0x302e('0xe'),'json':!![]};_0x55032d['headers']=_0x2304bf;logger[_0x302e('0xf')](_0x302e('0x10'));return rp(_0x55032d)['then'](function(_0x23f4b0){if(_0x23f4b0){var _0x191a6c=_0x23f4b0[_0x302e('0x11')];var _0x33a0ac=null;for(_0x33a0ac=0x0;_0x33a0ac<_0x191a6c[_0x302e('0x12')];_0x33a0ac++){if(_0x191a6c[_0x33a0ac][_0x302e('0x13')]===_0x55e932[_0x302e('0x14')]){_0x55e932[_0x302e('0x15')]=_0x191a6c[_0x33a0ac]['id'];_0x383763=!![];}}if(_0x383763){logger[_0x302e('0xf')](_0x302e('0x16'),_0x55e932[_0x302e('0x15')]);_0x282097(_0x55e932);}else{_0x2962b6({'statusCode':0x194,'message':_0x302e('0x17')});}}else{_0x2962b6({'statusCode':0x194,'message':_0x302e('0x17')});}})[_0x302e('0x18')](function(_0x52eb86){logger['error']('['+[_0x253fdf[_0x302e('0x19')]()]+']',_0x52eb86['message']);_0x2962b6(_0x52eb86);});});}function getUser(_0x6d8201,_0xf2023d,_0x462f5d){return function(_0x3f02ad){return new Promise(function(_0x3dc8bd,_0x26cd53){var _0x371bb2={'method':_0x302e('0xd'),'uri':_0x462f5d+_0x302e('0xe'),'json':!![]};_0x371bb2['headers']=_0xf2023d;logger[_0x302e('0xf')](_0x302e('0x1a'));return rp(_0x371bb2)[_0x302e('0x1b')](function(_0x2f173b){if(_0x2f173b){var _0x58db3f=_0x2f173b['users'];var _0x329401=![];var _0x348a9b=null;if(_0x3f02ad[_0x302e('0x1c')]!==null){logger[_0x302e('0xf')](_0x302e('0x1d'),_0x3f02ad['agentEmail']);_0x3f02ad[_0x302e('0x1e')]=_0x3f02ad[_0x302e('0x1c')];for(_0x348a9b=0x0;_0x348a9b<_0x58db3f['length'];_0x348a9b++){if(_0x58db3f[_0x348a9b]['email']===_0x3f02ad[_0x302e('0x1c')]){_0x329401=!![];_0x3f02ad['userId']=_0x58db3f[_0x348a9b]['id'];logger['info'](_0x302e('0x1f'),_0x3f02ad[_0x302e('0x20')]);}}}if(!_0x329401){logger[_0x302e('0xf')]('Admin\x20selected');_0x3f02ad[_0x302e('0x1e')]=_0x3f02ad[_0x302e('0x14')];_0x3f02ad[_0x302e('0x20')]=_0x3f02ad['adminId'];_0x329401=!![];}if(_0x329401){_0x3dc8bd(_0x3f02ad);}else{_0x26cd53({'statusCode':0x194,'message':_0x302e('0x17')});}}else{_0x26cd53({'statusCode':0x194,'message':_0x302e('0x17')});}})[_0x302e('0x18')](function(_0x11041a){logger[_0x302e('0x21')]('['+[_0x6d8201[_0x302e('0x19')]()]+']',_0x11041a[_0x302e('0x22')]);_0x26cd53(_0x11041a);});});};}function searchContact(_0x21ddcd,_0x22de27,_0x1d6541,_0x1c984a){return new Promise(function(_0x274e6d,_0xcb4e98){var _0xa719a1={'method':'GET','headers':_0x22de27,'uri':_0x21ddcd+'/api/lookup?q='+_0x1c984a+_0x302e('0x23')+_0x1d6541+'&entities=contact','json':!![]};rp(_0xa719a1)[_0x302e('0x1b')](function(_0x340f1b){var _0x15ddc4=_['find'](_0x340f1b[_0x302e('0x24')][_0x302e('0x24')],[_0x1d6541,_0x1c984a]);_0x274e6d(_0x15ddc4);})[_0x302e('0x18')](function(_0x3384b5){_0xcb4e98(_0x3384b5);});});}function getEndUser(_0x1f4095,_0x2c5e6a,_0xbc019e){return function(_0x100507){return new Promise(function(_0x1f671f,_0x1e8ecb){logger['info'](util[_0x302e('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x100507[_0x302e('0x26')]));searchContact(_0xbc019e,_0x2c5e6a,_0x302e('0x27'),_0x100507[_0x302e('0x26')])[_0x302e('0x1b')](function(_0x3ac429){if(_0x3ac429){_0x100507[_0x302e('0x28')]=_0x3ac429['id'];logger[_0x302e('0xf')]('Contact\x20found\x20mobile_number:',_0x100507[_0x302e('0x28')]);return _0x1f671f(_0x100507);}searchContact(_0xbc019e,_0x2c5e6a,_0x302e('0x29'),_0x100507[_0x302e('0x26')])[_0x302e('0x1b')](function(_0x4d9897){if(_0x4d9897){_0x100507[_0x302e('0x28')]=_0x4d9897['id'];logger[_0x302e('0xf')](_0x302e('0x2a'),_0x100507[_0x302e('0x28')]);return _0x1f671f(_0x100507);}createEndUser(_0x100507,_0x1f4095,_0x2c5e6a,_0xbc019e)['then'](function(_0x4f7e6d){logger[_0x302e('0xf')]('Contact\x20created:',_0x4f7e6d[_0x302e('0x28')]);return _0x1f671f(_0x4f7e6d);});});})[_0x302e('0x18')](function(_0x4065e4){_0x1e8ecb(_0x4065e4);});});};}function createEndUser(_0x4c2a3c,_0x32d11f,_0x1eb8f0,_0x36dc87){return new Promise(function(_0x111a4f,_0x222042){var _0x707023=moment();var _0x29ff02={'method':_0x302e('0x2b'),'uri':_0x36dc87+_0x302e('0x2c'),'body':{'contact':{'last_name':_0x4c2a3c['contactNumber'],'work_number':_0x4c2a3c[_0x302e('0x26')],'mobile_number':_0x4c2a3c[_0x302e('0x26')],'owner_id':_0x4c2a3c['userId'],'created_at':_0x707023[_0x302e('0x25')](_0x302e('0x2d'))}},'json':!![]};_0x29ff02[_0x302e('0x2e')]=_0x1eb8f0;logger[_0x302e('0xf')](_0x302e('0x2f'));return rp(_0x29ff02)[_0x302e('0x1b')](function(_0x16a715){_0x4c2a3c[_0x302e('0x28')]=_0x16a715[_0x302e('0x30')]['id'];_0x111a4f(_0x4c2a3c);})[_0x302e('0x18')](function(_0x3857cc){logger[_0x302e('0x21')]('['+[_0x32d11f[_0x302e('0x19')]()]+']',_0x3857cc[_0x302e('0x22')]);_0x222042(_0x3857cc[_0x302e('0x22')]);});});}function getTicket(_0xefb061,_0x36ab05,_0x1aabb4,_0x582af8,_0x3f41a4){return function(_0x33475e){logger[_0x302e('0xf')](_0x302e('0x31'));return new Promise(function(_0xb7f531,_0x2ec5b6){var _0x37b6ef=moment();var _0x413ab4={'method':_0x302e('0x2b'),'uri':_0x1aabb4+'/api/tasks','body':{'title':intUtil['getString'](_0x582af8[_0x302e('0x32')],_0x3f41a4,'\x20'),'description':intUtil[_0x302e('0x33')](_0x582af8[_0x302e('0x34')],_0x3f41a4,'\x0a'),'owner_id':_0x33475e[_0x302e('0x20')],'creater_id':_0x33475e[_0x302e('0x15')],'targetable_id':_0x33475e['endUserId'],'targetable_type':_0x302e('0x35'),'created_at':_0x37b6ef[_0x302e('0x25')](_0x302e('0x2d')),'due_date':_0x37b6ef[_0x302e('0x36')](0x1e,'m')[_0x302e('0x25')](_0x302e('0x2d'))},'json':!![]};_0x413ab4[_0x302e('0x2e')]=_0x36ab05;return rp(_0x413ab4)[_0x302e('0x1b')](function(_0x1c185f){_0x33475e[_0x302e('0x37')]=_0x1c185f[_0x302e('0x38')]['id'];logger[_0x302e('0xf')](_0x302e('0x39'),_0x33475e[_0x302e('0x37')]);_0xb7f531(_0x33475e);})[_0x302e('0x18')](function(_0xaee50f){logger[_0x302e('0x21')]('['+[_0xefb061[_0x302e('0x19')]()]+']',_0xaee50f[_0x302e('0x22')]);_0x2ec5b6(_0xaee50f[_0x302e('0x22')]);});});};}function emit(_0x3a53ff,_0xc45c71,_0x5acd0d){var _0x4f2453={'uri':_0x3a53ff+_0x302e('0x3a')+_0x5acd0d};io['to'](util[_0x302e('0x25')]('user:%s',_0xc45c71))[_0x302e('0x3b')](_0x302e('0x3c'),_0x4f2453);}exports['cs']=function(_0x3fc689,_0x2f843d,_0x5ef956,_0x4312c2,_0x157b7a,_0x5bab21,_0x4c5d8a,_0x40ffaa){var _0x456909={};var _0x4d684d={'Authorization':_0x302e('0x3d')+_0x5bab21[_0x302e('0x3e')]};_0x5bab21[_0x302e('0x3f')]=intUtil['stripTrailingSlash'](_0x5bab21[_0x302e('0x3f')]);_0x5bab21[_0x302e('0x40')]=intUtil[_0x302e('0x41')](_0x5bab21['serverUrl']);var _0x43b90a=_0x5bab21[_0x302e('0x3f')];_0x456909[_0x302e('0x14')]=_0x5bab21['username'];_0x456909['contactNumber']=_0x40ffaa[_0x302e('0x42')]()===_0x302e('0x43')?_0x2f843d[_0x302e('0x44')]:_0x2f843d[_0x302e('0x45')];_0x456909[_0x302e('0x46')]=_0x40ffaa==='queue'||_0x40ffaa===_0x302e('0x47')?_0x302e('0x48'):_0x302e('0x43');if(_0x4312c2){_0x456909[_0x302e('0x1c')]=_0x4312c2[_0x302e('0x13')];}var _0x4f9b15=util[_0x302e('0x25')](_0x302e('0x49'),_0x5bab21[_0x302e('0x40')],_0x2f843d[_0x302e('0x4a')],md5(_0x2f843d[_0x302e('0x4a')]));if(_0x157b7a&&_0x157b7a[_0x302e('0x4b')]){logger[_0x302e('0xf')](_0x302e('0x4c'),_0x302e('0x4d'));_0x2f843d[_0x302e('0x4e')]=_0x4f9b15;}else if(_0x4c5d8a&&_0x4c5d8a['recordingFormat']&&_0x4c5d8a['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0x302e('0x4d'));_0x2f843d[_0x302e('0x4e')]=_0x4f9b15;}else{_0x2f843d[_0x302e('0x4e')]='';}return getAdminId(_0x456909,_0x40ffaa,_0x4d684d,_0x43b90a)[_0x302e('0x1b')](getUser(_0x40ffaa,_0x4d684d,_0x43b90a))[_0x302e('0x1b')](getEndUser(_0x40ffaa,_0x4d684d,_0x43b90a))[_0x302e('0x1b')](getTicket(_0x40ffaa,_0x4d684d,_0x43b90a,_0x5ef956,_0x2f843d))['then'](function(_0x3448c3){logger[_0x302e('0xf')](util['format'](_0x302e('0x4f'),_0x3448c3[_0x302e('0x37')]));if(_0x40ffaa!==_0x302e('0x47')){logger['info']('['+[_0x40ffaa[_0x302e('0x19')]()]+']',_0x302e('0x50'));emit(_0x43b90a,_0x4312c2['name'],_0x3448c3[_0x302e('0x28')]);}})[_0x302e('0x18')](function(_0x1df57f){logger[_0x302e('0x21')]('['+[_0x40ffaa[_0x302e('0x19')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x1df57f,{'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 ba51984..80473f8 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 _0x16bd=['servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','../../../../config/logger','error','[EXEC]','format','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales'];(function(_0x1f3895,_0x399256){var _0x153aba=function(_0x1fd228){while(--_0x1fd228){_0x1f3895['push'](_0x1f3895['shift']());}};_0x153aba(++_0x399256);}(_0x16bd,0x170));var _0xd16b=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0x16bd[_0x2f3d29];return _0x53d69d;};'use strict';var _=require('lodash');var util=require(_0xd16b('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xd16b('0x1'));var sugarcrm=require(_0xd16b('0x2'));var freshdesk=require(_0xd16b('0x3'));var zoho=require(_0xd16b('0x4'));var desk=require(_0xd16b('0x5'));var vtiger=require(_0xd16b('0x6'));var servicenow=require(_0xd16b('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xd16b('0x8'));var integrations=[_0xd16b('0x9'),_0xd16b('0xa'),_0xd16b('0xb'),_0xd16b('0xc'),'zoho',_0xd16b('0xd'),_0xd16b('0xe'),_0xd16b('0xf'),_0xd16b('0x10'),_0xd16b('0x11')];exports[_0xd16b('0x12')]=function(_0x53ecc7,_0x240b63,_0x4da048,_0x4b0e6a,_0x51349a,_0x50d259){if(_0x4da048){if(_['includes'](integrations,_0x53ecc7[_0xd16b('0x13')][_0xd16b('0x14')]())){try{var _0x2e976a=null;var _0x7e8145='';var _0x280599=_0x4da048[_0x53ecc7[_0xd16b('0x13')]['toLowerCase']()];if(_0x280599){var _0x23ccbe=_0x280599[_0x53ecc7[_0xd16b('0x15')]];if(_0x23ccbe){var _0x23bced=_[_0xd16b('0x16')](_0x23ccbe[_0xd16b('0x17')],{'id':parseInt(_0x53ecc7[_0xd16b('0x18')],0xa)});if(_0x23bced){if(_0x4b0e6a){if(_0x51349a&&_0x240b63[_0xd16b('0x19')]){_0x7e8145=_0xd16b('0x19');}else if(_0x240b63[_0xd16b('0x1a')]){_0x7e8145=_0xd16b('0x1b');}else{console[_0xd16b('0x1c')](_0xd16b('0x1d'),_0x240b63);}}else{_0x7e8145=_0xd16b('0x1e');}switch(_0x53ecc7[_0xd16b('0x13')][_0xd16b('0x14')]()){case _0xd16b('0x9'):zendesk[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case'salesforce':salesforce[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case'sugarcrm':sugarcrm[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case _0xd16b('0xc'):freshdesk[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case'zoho':zoho[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case _0xd16b('0xd'):desk[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case _0xd16b('0xe'):vtiger[_0x7e8145](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259);break;case'freshsales':freshsales['cs'](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259,_0x7e8145);break;case _0xd16b('0x11'):servicenow['cs'](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259,_0x7e8145);break;case _0xd16b('0xf'):dynamics365['cs'](_0x53ecc7,_0x240b63,_0x23bced,_0x4b0e6a,_0x51349a,_0x23ccbe,_0x50d259,_0x7e8145);break;default:console['log']('unknown\x20integration');}}else{_0x2e976a=require(_0xd16b('0x1f'))(_0x53ecc7[_0xd16b('0x13')][_0xd16b('0x14')]());_0x2e976a[_0xd16b('0x20')](_0xd16b('0x21'),util[_0xd16b('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x53ecc7[_0xd16b('0x13')][_0xd16b('0x14')](),_0x53ecc7[_0xd16b('0x18')]));}}else{_0x2e976a=require(_0xd16b('0x1f'))(_0x53ecc7['data1'][_0xd16b('0x14')]());_0x2e976a[_0xd16b('0x20')](_0xd16b('0x21'),util[_0xd16b('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x53ecc7[_0xd16b('0x13')][_0xd16b('0x14')](),_0x53ecc7[_0xd16b('0x15')]));}}else{}}catch(_0x580abb){console[_0xd16b('0x20')](_0x580abb);}}}}; \ No newline at end of file +var _0xcbe7=['freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','desk','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./desk','./dynamics365','./freshsales','salesforce','sugarcrm'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcbe7,0xa7));var _0x7cbe=function(_0x16f3a0,_0x48c19e){_0x16f3a0=_0x16f3a0-0x0;var _0x555d25=_0xcbe7[_0x16f3a0];return _0x555d25;};'use strict';var _=require('lodash');var util=require(_0x7cbe('0x0'));var zendesk=require(_0x7cbe('0x1'));var salesforce=require(_0x7cbe('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x7cbe('0x3'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x7cbe('0x4'));var freshsales=require(_0x7cbe('0x5'));var integrations=['zendesk',_0x7cbe('0x6'),_0x7cbe('0x7'),_0x7cbe('0x8'),_0x7cbe('0x9'),'desk',_0x7cbe('0xa'),_0x7cbe('0xb'),_0x7cbe('0xc'),_0x7cbe('0xd')];exports['exec']=function(_0x8ce36d,_0x1a71d8,_0x4e0c23,_0x145cf6,_0x4963ec,_0x5b8c29){if(_0x4e0c23){if(_[_0x7cbe('0xe')](integrations,_0x8ce36d[_0x7cbe('0xf')][_0x7cbe('0x10')]())){try{var _0x11e0e4=null;var _0x101bdb='';var _0x2fe756=_0x4e0c23[_0x8ce36d[_0x7cbe('0xf')]['toLowerCase']()];if(_0x2fe756){var _0xd9ecd8=_0x2fe756[_0x8ce36d[_0x7cbe('0x11')]];if(_0xd9ecd8){var _0x2b0ba6=_['find'](_0xd9ecd8[_0x7cbe('0x12')],{'id':parseInt(_0x8ce36d[_0x7cbe('0x13')],0xa)});if(_0x2b0ba6){if(_0x145cf6){if(_0x4963ec&&_0x1a71d8[_0x7cbe('0x14')]){_0x101bdb=_0x7cbe('0x14');}else if(_0x1a71d8[_0x7cbe('0x15')]){_0x101bdb=_0x7cbe('0x16');}else{console[_0x7cbe('0x17')](_0x7cbe('0x18'),_0x1a71d8);}}else{_0x101bdb=_0x7cbe('0x19');}switch(_0x8ce36d[_0x7cbe('0xf')]['toLowerCase']()){case _0x7cbe('0x1a'):zendesk[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case'salesforce':salesforce[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case _0x7cbe('0x7'):sugarcrm[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case _0x7cbe('0x8'):freshdesk[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case _0x7cbe('0x9'):zoho[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case _0x7cbe('0x1b'):desk[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case _0x7cbe('0xa'):vtiger[_0x101bdb](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29);break;case _0x7cbe('0xc'):freshsales['cs'](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29,_0x101bdb);break;case _0x7cbe('0xd'):servicenow['cs'](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29,_0x101bdb);break;case _0x7cbe('0xb'):dynamics365['cs'](_0x8ce36d,_0x1a71d8,_0x2b0ba6,_0x145cf6,_0x4963ec,_0xd9ecd8,_0x5b8c29,_0x101bdb);break;default:console[_0x7cbe('0x17')](_0x7cbe('0x1c'));}}else{_0x11e0e4=require(_0x7cbe('0x1d'))(_0x8ce36d[_0x7cbe('0xf')]['toLowerCase']());_0x11e0e4['error'](_0x7cbe('0x1e'),util[_0x7cbe('0x1f')](_0x7cbe('0x20'),_0x8ce36d['data1'][_0x7cbe('0x10')](),_0x8ce36d[_0x7cbe('0x13')]));}}else{_0x11e0e4=require(_0x7cbe('0x1d'))(_0x8ce36d[_0x7cbe('0xf')]['toLowerCase']());_0x11e0e4[_0x7cbe('0x21')](_0x7cbe('0x1e'),util['format'](_0x7cbe('0x22'),_0x8ce36d[_0x7cbe('0xf')][_0x7cbe('0x10')](),_0x8ce36d[_0x7cbe('0x11')]));}}else{}}catch(_0x2cddb1){console['error'](_0x2cddb1);}}}}; \ 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 fe442ea..53683df 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 _0x60dc=['contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','sobject','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','merge','first','Phone','toLowerCase','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','Company','upperFirst','forEach','includes','idField','content','toString','variable','variableName','type','customVariable','Variable','name','password','concat','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','instanceUrl','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','%s/%s/e','error','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType'];(function(_0x3fa6a6,_0x310a65){var _0x2e0762=function(_0x2a148b){while(--_0x2a148b){_0x3fa6a6['push'](_0x3fa6a6['shift']());}};_0x2e0762(++_0x310a65);}(_0x60dc,0x173));var _0xc60d=function(_0x80a1c7,_0x2e1d52){_0x80a1c7=_0x80a1c7-0x0;var _0x261f1d=_0x60dc[_0x80a1c7];return _0x261f1d;};'use strict';var _=require('lodash');var rp=require(_0xc60d('0x0'));var moment=require(_0xc60d('0x1'));var BPromise=require(_0xc60d('0x2'));var md5=require(_0xc60d('0x3'));var jsforce=require(_0xc60d('0x4'));var util=require(_0xc60d('0x5'));var Redis=require(_0xc60d('0x6'));var intUtil=require(_0xc60d('0x7'));var config=require('../../../../config/environment');var logger=require(_0xc60d('0x8'))('salesforce');config[_0xc60d('0x9')]=_[_0xc60d('0xa')](config[_0xc60d('0x9')],{'host':_0xc60d('0xb'),'port':0x18eb});var io=require(_0xc60d('0xc'))(new Redis(config[_0xc60d('0x9')]));function emit(_0x8800f6,_0x4c6d31,_0x560cee){io['to'](_0x8800f6)[_0xc60d('0xd')](_0x4c6d31,_0x560cee);}function getTicket(_0x99c4d9,_0x59e409,_0x5ef675,_0x2faa25,_0x5e33d3,_0x39f627,_0x3ed091,_0x5a126b){var _0x26723e=Object['assign']({},{'OwnerId':_0x59e409['id'],'Subject':intUtil[_0xc60d('0xe')](_0x2faa25['Subjects'],_0x5e33d3,'\x20'),'Description':intUtil['getString'](_0x2faa25[_0xc60d('0xf')],_0x5e33d3,'\x0a')},getCustomFields(_0x39f627,_0x5e33d3));if(_0x5ef675){if(_0x2faa25[_0xc60d('0x10')]===_0xc60d('0x11')){_0x26723e[_0xc60d('0x12')]=moment[_0xc60d('0x13')]();_0x26723e['IsReminderSet']=![];_0x26723e[_0xc60d('0x14')]=![];if(_0x5ef675[_0xc60d('0x15')]===_0xc60d('0x16')||_0x5ef675[_0xc60d('0x15')]===_0xc60d('0x17')){_0x26723e[_0xc60d('0x18')]=_0x5ef675['id'];}else if(_0x5ef675[_0xc60d('0x15')]===_0xc60d('0x19')){_0x26723e[_0xc60d('0x1a')]=_0x5ef675['id'];}}else if(_0x2faa25[_0xc60d('0x10')]===_0xc60d('0x1b')){if(_0x5ef675[_0xc60d('0x15')]===_0xc60d('0x16')){_0x26723e['ContactId']=_0x5ef675['id'];}else if(_0x5ef675[_0xc60d('0x15')]===_0xc60d('0x19')){_0x26723e[_0xc60d('0x1c')]=_0x5ef675['id'];}else if(_0x5ef675[_0xc60d('0x15')]===_0xc60d('0x17')&&_0x2faa25['leadId']){_0x26723e[_0x2faa25[_0xc60d('0x1d')]]=_0x5ef675['id'];}else{logger[_0xc60d('0x1e')](_0xc60d('0x1f'));}}}return _0x3ed091['sobject'](_0x2faa25[_0xc60d('0x10')])[_0xc60d('0x20')](_0x26723e);}function getUser(_0x1a29c5,_0x1224e4,_0x4e773b){if(!_['isNil'](_0x1224e4)&&intUtil[_0xc60d('0x21')](_0x1224e4)){var _0x5b3e26={'Email':_0x1224e4};var _0x4c8115={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e773b['sobject'](_0xc60d('0x22'))[_0xc60d('0x23')](_0x5b3e26,_0x4c8115)[_0xc60d('0x24')]()[_0xc60d('0x25')](function(_0x1bdd57){if(_0x1bdd57['length']){var _0x35df20=_[_0xc60d('0x23')](_0x1bdd57,function(_0x8663fe){return _0x8663fe[_0xc60d('0x26')]===_0x1224e4;});if(_0x35df20){logger[_0xc60d('0x1e')](_0xc60d('0x27'),_0x1224e4);return BPromise['resolve']({'id':_0x35df20['Id'],'name':_0x35df20[_0xc60d('0x28')]});}}else{logger['info'](_0xc60d('0x29'),_0x1224e4);return _0x4e773b[_0xc60d('0x2a')]()['then'](function(_0x284e6b){return BPromise[_0xc60d('0x2b')]({'id':_0x284e6b[_0xc60d('0x2c')],'name':_0x284e6b[_0xc60d('0x2d')]});});}});}else{logger[_0xc60d('0x1e')](_0xc60d('0x29'),_0x1224e4);return _0x4e773b[_0xc60d('0x2a')]()[_0xc60d('0x25')](function(_0x45fdda){return BPromise[_0xc60d('0x2b')]({'id':_0x45fdda[_0xc60d('0x2c')],'name':_0x45fdda[_0xc60d('0x2d')]});});}}function getEndUser(_0x490e8b,_0x1e5517,_0x13af6a,_0x251755,_0x26c28c){var _0x5f0849={'$or':{'Phone':_0x251755}};var _0x38d73a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xc60d('0x25')](function(){logger[_0xc60d('0x1e')](_0xc60d('0x2e'),_0x251755,_0x1e5517[_0xc60d('0x2f')]);switch(_0x1e5517[_0xc60d('0x2f')]){case _0xc60d('0x30'):var _0x23e844=_[_0xc60d('0x31')](_0x5f0849);if(_0x1e5517[_0xc60d('0x32')]){var _0x44e080={};_0x44e080[_0x1e5517[_0xc60d('0x32')]]=_0x251755;_['merge'](_0x23e844[_0xc60d('0x33')],_0x44e080);}return _0x26c28c[_0xc60d('0x34')](_0xc60d('0x35'))['find'](_0x23e844,_0x38d73a)[_0xc60d('0x24')]()['then'](function(_0x1d2555){if(_0x1d2555&&_0x1d2555[_0xc60d('0x36')]){return _0x1d2555;}else{var _0x21aeb2=_[_0xc60d('0x31')](_0x5f0849);if(_0x1e5517['additionalSearchLead']){var _0x4d9a89={};_0x4d9a89[_0x1e5517[_0xc60d('0x37')]]=_0x251755;_['merge'](_0x21aeb2[_0xc60d('0x33')],_0x4d9a89);}return _0x26c28c[_0xc60d('0x34')](_0xc60d('0x38'))['find'](_0x21aeb2,_0x38d73a);}});case _0xc60d('0x39'):var _0x1fa7a0=_['cloneDeep'](_0x5f0849);if(_0x1e5517[_0xc60d('0x3a')]){var _0x44e080={};_0x44e080[_0x1e5517[_0xc60d('0x3a')]]=_0x251755;_['merge'](_0x1fa7a0[_0xc60d('0x33')],_0x44e080);}return _0x26c28c[_0xc60d('0x34')](_0xc60d('0x3b'))[_0xc60d('0x23')](_0x1fa7a0,_0x38d73a)[_0xc60d('0x24')]()['then'](function(_0x30ca20){if(_0x30ca20&&_0x30ca20[_0xc60d('0x36')]){return _0x30ca20;}else{var _0x26bca9=_[_0xc60d('0x31')](_0x5f0849);if(_0x1e5517[_0xc60d('0x32')]){var _0x1f6b86={};_0x1f6b86[_0x1e5517['additionalSearchContact']]=_0x251755;_[_0xc60d('0x3c')](_0x26bca9[_0xc60d('0x33')],_0x1f6b86);}return _0x26c28c[_0xc60d('0x34')](_0xc60d('0x35'))['find'](_0x26bca9,_0x38d73a)[_0xc60d('0x25')](function(_0x5b9a63){if(_0x5b9a63&&_0x5b9a63[_0xc60d('0x36')]){return _0x5b9a63;}else{var _0x2ca3be=_[_0xc60d('0x31')](_0x5f0849);if(_0x1e5517[_0xc60d('0x37')]){var _0x2401f0={};_0x2401f0[_0x1e5517[_0xc60d('0x37')]]=_0x251755;_[_0xc60d('0x3c')](_0x2ca3be[_0xc60d('0x33')],_0x2401f0);}return _0x26c28c[_0xc60d('0x34')]('Lead')[_0xc60d('0x23')](_0x2ca3be,_0x38d73a);}});}});case'contact':var _0x23e844=_['cloneDeep'](_0x5f0849);if(_0x1e5517[_0xc60d('0x32')]){var _0x44e080={};_0x44e080[_0x1e5517['additionalSearchContact']]=_0x251755;_[_0xc60d('0x3c')](_0x23e844[_0xc60d('0x33')],_0x44e080);}return _0x26c28c[_0xc60d('0x34')](_0xc60d('0x35'))[_0xc60d('0x23')](_0x23e844,_0x38d73a)[_0xc60d('0x24')]();case _0xc60d('0x17'):var _0x58b3ba=_[_0xc60d('0x31')](_0x5f0849);if(_0x1e5517[_0xc60d('0x37')]){var _0x44e080={};_0x44e080[_0x1e5517[_0xc60d('0x37')]]=_0x251755;_[_0xc60d('0x3c')](_0x58b3ba[_0xc60d('0x33')],_0x44e080);}return _0x26c28c[_0xc60d('0x34')](_0xc60d('0x38'))[_0xc60d('0x23')](_0x58b3ba,_0x38d73a);case _0xc60d('0x19'):var _0x1fa7a0=_['cloneDeep'](_0x5f0849);if(_0x1e5517[_0xc60d('0x3a')]){var _0x44e080={};_0x44e080[_0x1e5517[_0xc60d('0x3a')]]=_0x251755;_[_0xc60d('0x3c')](_0x1fa7a0[_0xc60d('0x33')],_0x44e080);}return _0x26c28c[_0xc60d('0x34')]('Account')['find'](_0x1fa7a0,_0x38d73a);default:return null;}})[_0xc60d('0x25')](function(_0x51a4ef){if(_0x51a4ef&&_0x51a4ef[_0xc60d('0x36')]){var _0x3cee76=_[_0xc60d('0x3d')](_0x51a4ef);if(_0x3cee76){return BPromise[_0xc60d('0x2b')]({'id':_0x3cee76['Id'],'name':_0x3cee76[_0xc60d('0x28')],'phone':_0x3cee76[_0xc60d('0x3e')],'endUserType':_0x3cee76['attributes']['type'][_0xc60d('0x3f')]()});}}})['then'](function(_0x2a0bcc){if(_0x2a0bcc){logger[_0xc60d('0x1e')](_0xc60d('0x40'),_0x2a0bcc[_0xc60d('0x15')],_0x251755);return BPromise[_0xc60d('0x2b')](_0x2a0bcc);}else{logger[_0xc60d('0x1e')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x251755);var _0x3bb4f3={'Phone':_0x251755};if(_0x1e5517['moduleCreate']){if(_0x1e5517[_0xc60d('0x41')]===_0xc60d('0x16')){logger[_0xc60d('0x1e')](_0xc60d('0x42'),_0x251755,_0x1e5517[_0xc60d('0x41')]);_0x3bb4f3[_0xc60d('0x43')]=_0x13af6a!==_0xc60d('0x44')?_0x13af6a:util[_0xc60d('0x45')](_0xc60d('0x46'),_0x251755);}else if(_0x1e5517[_0xc60d('0x41')]===_0xc60d('0x17')){logger[_0xc60d('0x1e')](_0xc60d('0x42'),_0x251755,_0x1e5517['moduleCreate']);_0x3bb4f3[_0xc60d('0x43')]=_0x13af6a!==_0xc60d('0x44')?_0x13af6a:util[_0xc60d('0x45')](_0xc60d('0x46'),_0x251755);_0x3bb4f3[_0xc60d('0x47')]='No\x20Company';}else if(_0x1e5517[_0xc60d('0x41')]===_0xc60d('0x19')){logger[_0xc60d('0x1e')](_0xc60d('0x42'),_0x251755,_0x1e5517[_0xc60d('0x41')]);_0x3bb4f3[_0xc60d('0x28')]=_0x13af6a!==_0xc60d('0x44')?_0x13af6a:util[_0xc60d('0x45')](_0xc60d('0x46'),_0x251755);}else{return null;}}return _0x26c28c[_0xc60d('0x34')](_[_0xc60d('0x48')](_0x1e5517['moduleCreate']))['create'](_0x3bb4f3)[_0xc60d('0x25')](function(_0x510e30){return BPromise[_0xc60d('0x2b')]({'id':_0x510e30['id'],'endUserType':_0x1e5517[_0xc60d('0x41')]});});}});}function getCustomFields(_0x14a1d8,_0x30ab81){var _0x1296ea={};if(_0x14a1d8[_0xc60d('0x36')]>0x0){_[_0xc60d('0x49')](_0x14a1d8,function(_0x5e8581){if(_[_0xc60d('0x4a')](['string','picklist'],_0x5e8581['type'])&&_0x5e8581[_0xc60d('0x4b')]){_0x1296ea[_0x5e8581[_0xc60d('0x4b')]]=_0x5e8581[_0xc60d('0x4c')][_0xc60d('0x4d')]();}else if(_0x5e8581['type']===_0xc60d('0x4e')&&_0x5e8581[_0xc60d('0x4f')]&&_0x5e8581[_0xc60d('0x4b')]){_0x30ab81[_0x5e8581['variableName']]&&(_0x1296ea[_0x5e8581[_0xc60d('0x4b')]]=_0x30ab81[_0x5e8581[_0xc60d('0x4f')]][_0xc60d('0x4d')]());}else if(_0x5e8581[_0xc60d('0x50')]===_0xc60d('0x51')&&_0x5e8581[_0xc60d('0x52')]&&_0x5e8581[_0xc60d('0x52')]['name']&&_0x5e8581[_0xc60d('0x4b')]){_0x30ab81[_0x5e8581[_0xc60d('0x52')][_0xc60d('0x53')][_0xc60d('0x3f')]()]&&(_0x1296ea[_0x5e8581[_0xc60d('0x4b')]]=_0x30ab81[_0x5e8581[_0xc60d('0x52')][_0xc60d('0x53')][_0xc60d('0x3f')]()][_0xc60d('0x4d')]());}});}return _0x1296ea;}function getConnection(_0x1afeb2){var _0x258afd=_0x1afeb2[_0xc60d('0x54')][_0xc60d('0x55')](_0x1afeb2['securityToken']);var _0xfd6c54=new jsforce[(_0xc60d('0x56'))]({'oauth2':{'loginUrl':_0x1afeb2[_0xc60d('0x57')]||'https://login.salesforce.com','clientId':_0x1afeb2[_0xc60d('0x58')],'clientSecret':_0x1afeb2[_0xc60d('0x59')]}});return _0xfd6c54[_0xc60d('0x5a')](_0x1afeb2[_0xc60d('0x5b')],_0x258afd)['then'](function(){logger['info'](_0xc60d('0x5c'));return _0xfd6c54;});}exports[_0xc60d('0x5d')]=function(_0x11c9a1,_0x5156bb,_0x2e20c0,_0x58fda7,_0x197275,_0x7419d1){var _0x599ed1,_0x9dbf79,_0x3ae261,_0x503240;_0x7419d1[_0xc60d('0x5e')]=intUtil['stripTrailingSlash'](_0x7419d1[_0xc60d('0x5e')]);_0x7419d1[_0xc60d('0x57')]=intUtil[_0xc60d('0x5f')](_0x7419d1[_0xc60d('0x57')]);if(_0x197275&&_0x197275[_0xc60d('0x60')]){logger[_0xc60d('0x1e')](_0xc60d('0x61'),_0xc60d('0x62'));_0x5156bb['recordingURL']=util[_0xc60d('0x45')](_0xc60d('0x63'),_0x7419d1[_0xc60d('0x5e')],_0x5156bb[_0xc60d('0x64')],md5(_0x5156bb[_0xc60d('0x64')]));}else{_0x5156bb[_0xc60d('0x65')]='';}return getConnection(_0x7419d1)[_0xc60d('0x25')](function(_0x533c31){_0x503240=_0x533c31;return getUser(_0x7419d1,_0x58fda7[_0xc60d('0x66')],_0x503240);})[_0xc60d('0x25')](function(_0x41e66e){_0x599ed1=_0x41e66e;return getEndUser(_0x7419d1,_0x2e20c0,_0x5156bb[_0xc60d('0x67')],_0x5156bb[_0xc60d('0x68')],_0x503240);})['then'](function(_0x1cd09d){_0x9dbf79=_0x1cd09d;return getTicket(_0x7419d1,_0x599ed1,_0x9dbf79,_0x2e20c0,_0x5156bb,_0x2e20c0[_0xc60d('0x69')],_0x503240,_0xc60d('0x5d'));})[_0xc60d('0x25')](function(_0x1476b3){_0x3ae261=_0x1476b3;logger[_0xc60d('0x1e')](_0xc60d('0x6a'),_0x3ae261['id']);logger[_0xc60d('0x1e')](_0xc60d('0x6b'),_0x3ae261['id'],_0x58fda7[_0xc60d('0x53')],_0x7419d1['type']);switch(_0x7419d1[_0xc60d('0x50')]){case _0xc60d('0x6c'):emit(util[_0xc60d('0x45')](_0xc60d('0x6d'),_0x58fda7['name']),_0xc60d('0x6e'),{'recordId':_0x3ae261['id']});break;case _0xc60d('0x6f'):emit(util[_0xc60d('0x45')](_0xc60d('0x6d'),_0x58fda7[_0xc60d('0x53')]),'trigger:browser:url',{'uri':util[_0xc60d('0x45')]('%s/%s/e',_0x503240[_0xc60d('0x70')],_0x3ae261['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x148614){logger['error'](_0xc60d('0x61'),_0x148614);});};exports[_0xc60d('0x71')]=function(_0x1e59bb,_0x21ded7,_0x17b7d1,_0x4856d5,_0x4f6d92,_0x251fd7,_0x236ebf){var _0x6f8341,_0x590deb,_0x4b720c,_0x57fc01;_0x251fd7[_0xc60d('0x5e')]=intUtil[_0xc60d('0x5f')](_0x251fd7[_0xc60d('0x5e')]);_0x251fd7['remoteUri']=intUtil['stripTrailingSlash'](_0x251fd7[_0xc60d('0x57')]);if(_0x236ebf&&_0x236ebf[_0xc60d('0x72')]&&_0x236ebf['recordingFormat']!=='none'){logger[_0xc60d('0x1e')](_0xc60d('0x73'),'Recording\x20is\x20enabled!');_0x21ded7[_0xc60d('0x65')]=util['format'](_0xc60d('0x63'),_0x251fd7[_0xc60d('0x5e')],_0x21ded7['uniqueid'],md5(_0x21ded7[_0xc60d('0x64')]));}return getConnection(_0x251fd7)[_0xc60d('0x25')](function(_0x4296bc){_0x57fc01=_0x4296bc;return getUser(_0x251fd7,_0x4856d5['email'],_0x57fc01);})[_0xc60d('0x25')](function(_0x4740ec){_0x6f8341=_0x4740ec;return getEndUser(_0x251fd7,_0x17b7d1,_0x21ded7[_0xc60d('0x74')],_0x21ded7[_0xc60d('0x75')],_0x57fc01);})[_0xc60d('0x25')](function(_0x5c3549){_0x590deb=_0x5c3549;return getTicket(_0x251fd7,_0x6f8341,_0x590deb,_0x17b7d1,_0x21ded7,_0x17b7d1[_0xc60d('0x69')],_0x57fc01,'outbound');})[_0xc60d('0x25')](function(_0x1ac70a){_0x4b720c=_0x1ac70a;logger['info'](_0xc60d('0x76'),_0x4b720c['id']);logger[_0xc60d('0x1e')](_0xc60d('0x77'),_0x4b720c['id'],_0x4856d5[_0xc60d('0x53')],_0x251fd7[_0xc60d('0x50')]);switch(_0x251fd7['type']){case _0xc60d('0x6c'):emit(util[_0xc60d('0x45')](_0xc60d('0x6d'),_0x4856d5[_0xc60d('0x53')]),_0xc60d('0x6e'),{'recordId':_0x4b720c['id']});break;case _0xc60d('0x6f'):emit(util['format'](_0xc60d('0x6d'),_0x4856d5[_0xc60d('0x53')]),_0xc60d('0x78'),{'uri':util[_0xc60d('0x45')](_0xc60d('0x79'),_0x57fc01[_0xc60d('0x70')],_0x4b720c['id'])});break;default:logger[_0xc60d('0x7a')](_0xc60d('0x73'),_0xc60d('0x7b'));}})[_0xc60d('0x7c')](function(_0x2c60e0){logger[_0xc60d('0x7a')](_0xc60d('0x73'),_0x2c60e0);});};exports[_0xc60d('0x7d')]=function(_0x3d060c,_0x16170d,_0x384adb,_0x35cad9,_0x1521a2,_0x424ed0){var _0x59d429,_0x58774b,_0x364dc4,_0x36e59e;_0x424ed0[_0xc60d('0x5e')]=intUtil[_0xc60d('0x5f')](_0x424ed0[_0xc60d('0x5e')]);_0x424ed0[_0xc60d('0x57')]=intUtil['stripTrailingSlash'](_0x424ed0[_0xc60d('0x57')]);if(_0x1521a2&&_0x1521a2[_0xc60d('0x60')]){logger[_0xc60d('0x1e')]('['+_0x16170d[_0xc60d('0x7e')][_0xc60d('0x7f')]()+']',_0xc60d('0x62'));_0x16170d[_0xc60d('0x65')]=util[_0xc60d('0x45')](_0xc60d('0x63'),_0x424ed0[_0xc60d('0x5e')],_0x16170d[_0xc60d('0x64')],md5(_0x16170d[_0xc60d('0x64')]));}else{_0x16170d[_0xc60d('0x65')]='';}return getConnection(_0x424ed0)[_0xc60d('0x25')](function(_0x1aa92b){_0x36e59e=_0x1aa92b;if(!_[_0xc60d('0x80')](_0x35cad9)){return getUser(_0x424ed0,_0x35cad9[_0xc60d('0x53')],_0x36e59e);}else{return getUser(_0x424ed0,null,_0x36e59e);}})[_0xc60d('0x25')](function(_0x15cb85){_0x59d429=_0x15cb85;return getEndUser(_0x424ed0,_0x384adb,_0x16170d[_0xc60d('0x67')],_0x16170d[_0xc60d('0x68')],_0x36e59e);})[_0xc60d('0x25')](function(_0x3d1ff3){_0x58774b=_0x3d1ff3;return getTicket(_0x424ed0,_0x59d429,_0x58774b,_0x384adb,_0x16170d,_0x384adb[_0xc60d('0x69')],_0x36e59e);})['then'](function(_0xd2af72){_0x364dc4=_0xd2af72;logger[_0xc60d('0x1e')]('['+_0x16170d[_0xc60d('0x7e')][_0xc60d('0x7f')]()+_0xc60d('0x81'),_0x364dc4['id']);logger[_0xc60d('0x1e')]('['+_0x16170d[_0xc60d('0x7e')][_0xc60d('0x7f')]()+_0xc60d('0x82'),_0x424ed0[_0xc60d('0x50')]);})[_0xc60d('0x7c')](function(_0x3b34a1){logger[_0xc60d('0x7a')]('['+_0x16170d[_0xc60d('0x7e')][_0xc60d('0x7f')]()+']',_0x3b34a1);});}; \ No newline at end of file +var _0x2bf2=['attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','serverUrl','recordingFormat','none','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','redis','localhost','socket.io-emitter','emit','getString','Descriptions','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','length','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone'];(function(_0x179e6c,_0x17bcd3){var _0x5594aa=function(_0x43245e){while(--_0x43245e){_0x179e6c['push'](_0x179e6c['shift']());}};_0x5594aa(++_0x17bcd3);}(_0x2bf2,0xc5));var _0x22bf=function(_0x180679,_0x17461e){_0x180679=_0x180679-0x0;var _0x3f28d9=_0x2bf2[_0x180679];return _0x3f28d9;};'use strict';var _=require(_0x22bf('0x0'));var rp=require(_0x22bf('0x1'));var moment=require('moment');var BPromise=require(_0x22bf('0x2'));var md5=require(_0x22bf('0x3'));var jsforce=require(_0x22bf('0x4'));var util=require(_0x22bf('0x5'));var Redis=require(_0x22bf('0x6'));var intUtil=require('./util');var config=require(_0x22bf('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0x22bf('0x8')]=_['defaults'](config[_0x22bf('0x8')],{'host':_0x22bf('0x9'),'port':0x18eb});var io=require(_0x22bf('0xa'))(new Redis(config[_0x22bf('0x8')]));function emit(_0x69cfa0,_0x5c9cd0,_0x38be44){io['to'](_0x69cfa0)[_0x22bf('0xb')](_0x5c9cd0,_0x38be44);}function getTicket(_0x2fe724,_0x1df561,_0x2e6d3e,_0x5ae243,_0x210eb1,_0xd3e81d,_0x541880,_0x5933a6){var _0x4492fb=Object['assign']({},{'OwnerId':_0x1df561['id'],'Subject':intUtil[_0x22bf('0xc')](_0x5ae243['Subjects'],_0x210eb1,'\x20'),'Description':intUtil[_0x22bf('0xc')](_0x5ae243[_0x22bf('0xd')],_0x210eb1,'\x0a')},getCustomFields(_0xd3e81d,_0x210eb1));if(_0x2e6d3e){if(_0x5ae243['ticketType']===_0x22bf('0xe')){_0x4492fb['ActivityDate']=moment[_0x22bf('0xf')]();_0x4492fb['IsReminderSet']=![];_0x4492fb[_0x22bf('0x10')]=![];if(_0x2e6d3e[_0x22bf('0x11')]===_0x22bf('0x12')||_0x2e6d3e[_0x22bf('0x11')]===_0x22bf('0x13')){_0x4492fb[_0x22bf('0x14')]=_0x2e6d3e['id'];}else if(_0x2e6d3e[_0x22bf('0x11')]===_0x22bf('0x15')){_0x4492fb[_0x22bf('0x16')]=_0x2e6d3e['id'];}}else if(_0x5ae243[_0x22bf('0x17')]===_0x22bf('0x18')){if(_0x2e6d3e[_0x22bf('0x11')]===_0x22bf('0x12')){_0x4492fb[_0x22bf('0x19')]=_0x2e6d3e['id'];}else if(_0x2e6d3e[_0x22bf('0x11')]===_0x22bf('0x15')){_0x4492fb[_0x22bf('0x1a')]=_0x2e6d3e['id'];}else if(_0x2e6d3e[_0x22bf('0x11')]===_0x22bf('0x13')&&_0x5ae243[_0x22bf('0x1b')]){_0x4492fb[_0x5ae243[_0x22bf('0x1b')]]=_0x2e6d3e['id'];}else{logger[_0x22bf('0x1c')](_0x22bf('0x1d'));}}}return _0x541880[_0x22bf('0x1e')](_0x5ae243[_0x22bf('0x17')])[_0x22bf('0x1f')](_0x4492fb);}function getUser(_0x2a6995,_0x501977,_0x2e9463){if(!_[_0x22bf('0x20')](_0x501977)&&intUtil[_0x22bf('0x21')](_0x501977)){var _0x5ce1fc={'Email':_0x501977};var _0xd1cd27={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2e9463['sobject'](_0x22bf('0x22'))[_0x22bf('0x23')](_0x5ce1fc,_0xd1cd27)[_0x22bf('0x24')]()['then'](function(_0x3bedb5){if(_0x3bedb5['length']){var _0x423526=_['find'](_0x3bedb5,function(_0x1b15be){return _0x1b15be[_0x22bf('0x25')]===_0x501977;});if(_0x423526){logger[_0x22bf('0x1c')](_0x22bf('0x26'),_0x501977);return BPromise[_0x22bf('0x27')]({'id':_0x423526['Id'],'name':_0x423526[_0x22bf('0x28')]});}}else{logger[_0x22bf('0x1c')](_0x22bf('0x29'),_0x501977);return _0x2e9463['identity']()[_0x22bf('0x2a')](function(_0x29ce85){return BPromise['resolve']({'id':_0x29ce85[_0x22bf('0x2b')],'name':_0x29ce85[_0x22bf('0x2c')]});});}});}else{logger[_0x22bf('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x501977);return _0x2e9463[_0x22bf('0x2d')]()['then'](function(_0x43e38a){return BPromise[_0x22bf('0x27')]({'id':_0x43e38a['user_id'],'name':_0x43e38a[_0x22bf('0x2c')]});});}}function getEndUser(_0x7ee6d6,_0x579b33,_0x495e14,_0x984332,_0x38a184){var _0x52cced={'$or':{'Phone':_0x984332}};var _0x56173d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x22bf('0x27')]()[_0x22bf('0x2a')](function(){logger[_0x22bf('0x1c')](_0x22bf('0x2e'),_0x984332,_0x579b33['moduleSearch']);switch(_0x579b33[_0x22bf('0x2f')]){case _0x22bf('0x30'):var _0x54f536=_[_0x22bf('0x31')](_0x52cced);if(_0x579b33[_0x22bf('0x32')]){var _0x1bb035={};_0x1bb035[_0x579b33[_0x22bf('0x32')]]=_0x984332;_['merge'](_0x54f536[_0x22bf('0x33')],_0x1bb035);}return _0x38a184[_0x22bf('0x1e')]('Contact')[_0x22bf('0x23')](_0x54f536,_0x56173d)['execute']()[_0x22bf('0x2a')](function(_0x361b16){if(_0x361b16&&_0x361b16[_0x22bf('0x34')]){return _0x361b16;}else{var _0x56f68a=_['cloneDeep'](_0x52cced);if(_0x579b33[_0x22bf('0x35')]){var _0x1c86d6={};_0x1c86d6[_0x579b33['additionalSearchLead']]=_0x984332;_[_0x22bf('0x36')](_0x56f68a['$or'],_0x1c86d6);}return _0x38a184['sobject'](_0x22bf('0x37'))[_0x22bf('0x23')](_0x56f68a,_0x56173d);}});case _0x22bf('0x38'):var _0x24185f=_['cloneDeep'](_0x52cced);if(_0x579b33[_0x22bf('0x39')]){var _0x1bb035={};_0x1bb035[_0x579b33[_0x22bf('0x39')]]=_0x984332;_[_0x22bf('0x36')](_0x24185f[_0x22bf('0x33')],_0x1bb035);}return _0x38a184['sobject'](_0x22bf('0x3a'))['find'](_0x24185f,_0x56173d)[_0x22bf('0x24')]()[_0x22bf('0x2a')](function(_0x5c0c53){if(_0x5c0c53&&_0x5c0c53['length']){return _0x5c0c53;}else{var _0x4e0701=_[_0x22bf('0x31')](_0x52cced);if(_0x579b33[_0x22bf('0x32')]){var _0x1daf7b={};_0x1daf7b[_0x579b33[_0x22bf('0x32')]]=_0x984332;_[_0x22bf('0x36')](_0x4e0701[_0x22bf('0x33')],_0x1daf7b);}return _0x38a184[_0x22bf('0x1e')]('Contact')[_0x22bf('0x23')](_0x4e0701,_0x56173d)[_0x22bf('0x2a')](function(_0x362a83){if(_0x362a83&&_0x362a83[_0x22bf('0x34')]){return _0x362a83;}else{var _0xd19192=_[_0x22bf('0x31')](_0x52cced);if(_0x579b33[_0x22bf('0x35')]){var _0x3758dd={};_0x3758dd[_0x579b33[_0x22bf('0x35')]]=_0x984332;_['merge'](_0xd19192['$or'],_0x3758dd);}return _0x38a184[_0x22bf('0x1e')](_0x22bf('0x37'))['find'](_0xd19192,_0x56173d);}});}});case _0x22bf('0x12'):var _0x54f536=_['cloneDeep'](_0x52cced);if(_0x579b33['additionalSearchContact']){var _0x1bb035={};_0x1bb035[_0x579b33[_0x22bf('0x32')]]=_0x984332;_['merge'](_0x54f536[_0x22bf('0x33')],_0x1bb035);}return _0x38a184[_0x22bf('0x1e')]('Contact')[_0x22bf('0x23')](_0x54f536,_0x56173d)[_0x22bf('0x24')]();case _0x22bf('0x13'):var _0x1a58f4=_[_0x22bf('0x31')](_0x52cced);if(_0x579b33['additionalSearchLead']){var _0x1bb035={};_0x1bb035[_0x579b33[_0x22bf('0x35')]]=_0x984332;_[_0x22bf('0x36')](_0x1a58f4[_0x22bf('0x33')],_0x1bb035);}return _0x38a184[_0x22bf('0x1e')](_0x22bf('0x37'))[_0x22bf('0x23')](_0x1a58f4,_0x56173d);case'account':var _0x24185f=_[_0x22bf('0x31')](_0x52cced);if(_0x579b33[_0x22bf('0x39')]){var _0x1bb035={};_0x1bb035[_0x579b33[_0x22bf('0x39')]]=_0x984332;_[_0x22bf('0x36')](_0x24185f['$or'],_0x1bb035);}return _0x38a184[_0x22bf('0x1e')](_0x22bf('0x3a'))[_0x22bf('0x23')](_0x24185f,_0x56173d);default:return null;}})[_0x22bf('0x2a')](function(_0x2f7981){if(_0x2f7981&&_0x2f7981[_0x22bf('0x34')]){var _0x3d7374=_[_0x22bf('0x3b')](_0x2f7981);if(_0x3d7374){return BPromise['resolve']({'id':_0x3d7374['Id'],'name':_0x3d7374[_0x22bf('0x28')],'phone':_0x3d7374[_0x22bf('0x3c')],'endUserType':_0x3d7374[_0x22bf('0x3d')][_0x22bf('0x3e')][_0x22bf('0x3f')]()});}}})[_0x22bf('0x2a')](function(_0x13a98f){if(_0x13a98f){logger['info'](_0x22bf('0x40'),_0x13a98f[_0x22bf('0x11')],_0x984332);return BPromise['resolve'](_0x13a98f);}else{logger[_0x22bf('0x1c')](_0x22bf('0x41'),_0x984332);var _0x486f26={'Phone':_0x984332};if(_0x579b33[_0x22bf('0x42')]){if(_0x579b33[_0x22bf('0x42')]===_0x22bf('0x12')){logger[_0x22bf('0x1c')](_0x22bf('0x43'),_0x984332,_0x579b33['moduleCreate']);_0x486f26[_0x22bf('0x44')]=_0x495e14!==_0x22bf('0x45')?_0x495e14:util['format']('Caller\x20-\x20%s',_0x984332);}else if(_0x579b33[_0x22bf('0x42')]==='lead'){logger[_0x22bf('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x984332,_0x579b33[_0x22bf('0x42')]);_0x486f26['LastName']=_0x495e14!==_0x22bf('0x45')?_0x495e14:util[_0x22bf('0x46')]('Caller\x20-\x20%s',_0x984332);_0x486f26['Company']=_0x22bf('0x47');}else if(_0x579b33[_0x22bf('0x42')]==='account'){logger[_0x22bf('0x1c')](_0x22bf('0x43'),_0x984332,_0x579b33['moduleCreate']);_0x486f26[_0x22bf('0x28')]=_0x495e14!==_0x22bf('0x45')?_0x495e14:util['format']('Caller\x20-\x20%s',_0x984332);}else{return null;}}return _0x38a184[_0x22bf('0x1e')](_[_0x22bf('0x48')](_0x579b33[_0x22bf('0x42')]))[_0x22bf('0x1f')](_0x486f26)['then'](function(_0x17a390){return BPromise[_0x22bf('0x27')]({'id':_0x17a390['id'],'endUserType':_0x579b33['moduleCreate']});});}});}function getCustomFields(_0x5ae470,_0x52df2d){var _0x545331={};if(_0x5ae470['length']>0x0){_[_0x22bf('0x49')](_0x5ae470,function(_0x24d53a){if(_[_0x22bf('0x4a')]([_0x22bf('0x4b'),_0x22bf('0x4c')],_0x24d53a[_0x22bf('0x3e')])&&_0x24d53a[_0x22bf('0x4d')]){_0x545331[_0x24d53a[_0x22bf('0x4d')]]=_0x24d53a[_0x22bf('0x4e')][_0x22bf('0x4f')]();}else if(_0x24d53a[_0x22bf('0x3e')]===_0x22bf('0x50')&&_0x24d53a[_0x22bf('0x51')]&&_0x24d53a[_0x22bf('0x4d')]){_0x52df2d[_0x24d53a[_0x22bf('0x51')]]&&(_0x545331[_0x24d53a[_0x22bf('0x4d')]]=_0x52df2d[_0x24d53a[_0x22bf('0x51')]][_0x22bf('0x4f')]());}else if(_0x24d53a[_0x22bf('0x3e')]===_0x22bf('0x52')&&_0x24d53a[_0x22bf('0x53')]&&_0x24d53a[_0x22bf('0x53')][_0x22bf('0x54')]&&_0x24d53a[_0x22bf('0x4d')]){_0x52df2d[_0x24d53a['Variable'][_0x22bf('0x54')][_0x22bf('0x3f')]()]&&(_0x545331[_0x24d53a['idField']]=_0x52df2d[_0x24d53a[_0x22bf('0x53')]['name'][_0x22bf('0x3f')]()]['toString']());}});}return _0x545331;}function getConnection(_0xac1fee){var _0x3c7987=_0xac1fee[_0x22bf('0x55')][_0x22bf('0x56')](_0xac1fee[_0x22bf('0x57')]);var _0x127735=new jsforce[(_0x22bf('0x58'))]({'oauth2':{'loginUrl':_0xac1fee[_0x22bf('0x59')]||_0x22bf('0x5a'),'clientId':_0xac1fee[_0x22bf('0x5b')],'clientSecret':_0xac1fee[_0x22bf('0x5c')]}});return _0x127735[_0x22bf('0x5d')](_0xac1fee[_0x22bf('0x5e')],_0x3c7987)['then'](function(){logger[_0x22bf('0x1c')](_0x22bf('0x5f'));return _0x127735;});}exports[_0x22bf('0x60')]=function(_0x10aa6e,_0x4b2db0,_0x3a57d5,_0x3401f2,_0x2e5daf,_0x482346){var _0x33d4b6,_0xa098dd,_0x204e05,_0x4dbf04;_0x482346['serverUrl']=intUtil[_0x22bf('0x61')](_0x482346['serverUrl']);_0x482346['remoteUri']=intUtil[_0x22bf('0x61')](_0x482346[_0x22bf('0x59')]);if(_0x2e5daf&&_0x2e5daf['monitor_format']){logger[_0x22bf('0x1c')]('[QUEUE]',_0x22bf('0x62'));_0x4b2db0[_0x22bf('0x63')]=util[_0x22bf('0x46')](_0x22bf('0x64'),_0x482346['serverUrl'],_0x4b2db0[_0x22bf('0x65')],md5(_0x4b2db0[_0x22bf('0x65')]));}else{_0x4b2db0['recordingURL']='';}return getConnection(_0x482346)[_0x22bf('0x2a')](function(_0x350815){_0x4dbf04=_0x350815;return getUser(_0x482346,_0x3401f2['email'],_0x4dbf04);})['then'](function(_0x107451){_0x33d4b6=_0x107451;return getEndUser(_0x482346,_0x3a57d5,_0x4b2db0[_0x22bf('0x66')],_0x4b2db0['calleridnum'],_0x4dbf04);})[_0x22bf('0x2a')](function(_0x12aecd){_0xa098dd=_0x12aecd;return getTicket(_0x482346,_0x33d4b6,_0xa098dd,_0x3a57d5,_0x4b2db0,_0x3a57d5['Fields'],_0x4dbf04,'queue');})['then'](function(_0x3aa7f6){_0x204e05=_0x3aa7f6;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x204e05['id']);logger[_0x22bf('0x1c')](_0x22bf('0x67'),_0x204e05['id'],_0x3401f2[_0x22bf('0x54')],_0x482346['type']);switch(_0x482346['type']){case _0x22bf('0x68'):emit(util[_0x22bf('0x46')](_0x22bf('0x69'),_0x3401f2[_0x22bf('0x54')]),'trigger:salesforce:display',{'recordId':_0x204e05['id']});break;case _0x22bf('0x6a'):emit(util[_0x22bf('0x46')](_0x22bf('0x69'),_0x3401f2[_0x22bf('0x54')]),_0x22bf('0x6b'),{'uri':util[_0x22bf('0x46')]('%s/%s/e',_0x4dbf04[_0x22bf('0x6c')],_0x204e05['id'])});break;default:logger[_0x22bf('0x6d')](_0x22bf('0x6e'));}})[_0x22bf('0x6f')](function(_0x55548f){logger[_0x22bf('0x6d')](_0x22bf('0x70'),_0x55548f);});};exports[_0x22bf('0x71')]=function(_0x4c8f96,_0x154ff2,_0x4c7412,_0x2c29d7,_0x3473e4,_0x1f4190,_0x3e8040){var _0x116744,_0xb53c17,_0x34617c,_0x4fcc4c;_0x1f4190[_0x22bf('0x72')]=intUtil[_0x22bf('0x61')](_0x1f4190[_0x22bf('0x72')]);_0x1f4190['remoteUri']=intUtil[_0x22bf('0x61')](_0x1f4190[_0x22bf('0x59')]);if(_0x3e8040&&_0x3e8040[_0x22bf('0x73')]&&_0x3e8040[_0x22bf('0x73')]!==_0x22bf('0x74')){logger[_0x22bf('0x1c')]('[OUTBOUND]',_0x22bf('0x62'));_0x154ff2['recordingURL']=util[_0x22bf('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f4190[_0x22bf('0x72')],_0x154ff2[_0x22bf('0x65')],md5(_0x154ff2['uniqueid']));}return getConnection(_0x1f4190)[_0x22bf('0x2a')](function(_0xb22e0e){_0x4fcc4c=_0xb22e0e;return getUser(_0x1f4190,_0x2c29d7['email'],_0x4fcc4c);})['then'](function(_0x5498bb){_0x116744=_0x5498bb;return getEndUser(_0x1f4190,_0x4c7412,_0x154ff2['destcalleridname'],_0x154ff2['destcalleridnum'],_0x4fcc4c);})[_0x22bf('0x2a')](function(_0x6ede33){_0xb53c17=_0x6ede33;return getTicket(_0x1f4190,_0x116744,_0xb53c17,_0x4c7412,_0x154ff2,_0x4c7412[_0x22bf('0x75')],_0x4fcc4c,'outbound');})[_0x22bf('0x2a')](function(_0x44c606){_0x34617c=_0x44c606;logger[_0x22bf('0x1c')](_0x22bf('0x76'),_0x34617c['id']);logger[_0x22bf('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x34617c['id'],_0x2c29d7[_0x22bf('0x54')],_0x1f4190['type']);switch(_0x1f4190[_0x22bf('0x3e')]){case _0x22bf('0x68'):emit(util[_0x22bf('0x46')]('user:%s',_0x2c29d7[_0x22bf('0x54')]),_0x22bf('0x77'),{'recordId':_0x34617c['id']});break;case _0x22bf('0x6a'):emit(util[_0x22bf('0x46')](_0x22bf('0x69'),_0x2c29d7[_0x22bf('0x54')]),_0x22bf('0x6b'),{'uri':util[_0x22bf('0x46')](_0x22bf('0x78'),_0x4fcc4c[_0x22bf('0x6c')],_0x34617c['id'])});break;default:logger[_0x22bf('0x6d')](_0x22bf('0x79'),_0x22bf('0x7a'));}})['catch'](function(_0x24e77a){logger[_0x22bf('0x6d')](_0x22bf('0x79'),_0x24e77a);});};exports['unmanaged']=function(_0x7bbb74,_0x1d194c,_0xe51f46,_0x1d9fc8,_0xb25cac,_0x3f7165){var _0x599a7d,_0x175cdb,_0x3af31a,_0x1170a9;_0x3f7165[_0x22bf('0x72')]=intUtil[_0x22bf('0x61')](_0x3f7165[_0x22bf('0x72')]);_0x3f7165[_0x22bf('0x59')]=intUtil[_0x22bf('0x61')](_0x3f7165[_0x22bf('0x59')]);if(_0xb25cac&&_0xb25cac[_0x22bf('0x7b')]){logger[_0x22bf('0x1c')]('['+_0x1d194c[_0x22bf('0x7c')][_0x22bf('0x7d')]()+']','Recording\x20is\x20enabled!');_0x1d194c[_0x22bf('0x63')]=util[_0x22bf('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f7165[_0x22bf('0x72')],_0x1d194c[_0x22bf('0x65')],md5(_0x1d194c[_0x22bf('0x65')]));}else{_0x1d194c[_0x22bf('0x63')]='';}return getConnection(_0x3f7165)[_0x22bf('0x2a')](function(_0x435aaa){_0x1170a9=_0x435aaa;if(!_[_0x22bf('0x20')](_0x1d9fc8)){return getUser(_0x3f7165,_0x1d9fc8[_0x22bf('0x54')],_0x1170a9);}else{return getUser(_0x3f7165,null,_0x1170a9);}})[_0x22bf('0x2a')](function(_0x4d520e){_0x599a7d=_0x4d520e;return getEndUser(_0x3f7165,_0xe51f46,_0x1d194c[_0x22bf('0x66')],_0x1d194c[_0x22bf('0x7e')],_0x1170a9);})[_0x22bf('0x2a')](function(_0x1e53c5){_0x175cdb=_0x1e53c5;return getTicket(_0x3f7165,_0x599a7d,_0x175cdb,_0xe51f46,_0x1d194c,_0xe51f46[_0x22bf('0x75')],_0x1170a9);})[_0x22bf('0x2a')](function(_0x3d5841){_0x3af31a=_0x3d5841;logger['info']('['+_0x1d194c[_0x22bf('0x7c')][_0x22bf('0x7d')]()+_0x22bf('0x7f'),_0x3af31a['id']);logger['info']('['+_0x1d194c[_0x22bf('0x7c')][_0x22bf('0x7d')]()+_0x22bf('0x80'),_0x3f7165[_0x22bf('0x3e')]);})[_0x22bf('0x6f')](function(_0x2bcd07){logger[_0x22bf('0x6d')]('['+_0x1d194c['lastevent'][_0x22bf('0x7d')]()+']',_0x2bcd07);});}; \ 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 725e878..f04a741 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 _0x2c27=[']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','type','nameField','customField','string','idField','toLowerCase','content','variableName','customVariable','Variable','name','endUserId','assign','getString','Descriptions','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','all','forEach','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','emit','trigger:browser:url','password','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','],\x20getUser\x20crm'];(function(_0x14c9e8,_0x1d356b){var _0x208e67=function(_0x57ca68){while(--_0x57ca68){_0x14c9e8['push'](_0x14c9e8['shift']());}};_0x208e67(++_0x1d356b);}(_0x2c27,0xa8));var _0x72c2=function(_0xaf4e91,_0x4f6a10){_0xaf4e91=_0xaf4e91-0x0;var _0x410dbb=_0x2c27[_0xaf4e91];return _0x410dbb;};'use strict';var _=require(_0x72c2('0x0'));var Promise=require(_0x72c2('0x1'));var rp=require(_0x72c2('0x2'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x72c2('0x3'));var config=require(_0x72c2('0x4'));var logger=require(_0x72c2('0x5'))(_0x72c2('0x6'));config[_0x72c2('0x7')]=_[_0x72c2('0x8')](config[_0x72c2('0x7')],{'host':_0x72c2('0x9'),'port':0x18eb});var io=require(_0x72c2('0xa'))(new Redis(config[_0x72c2('0x7')]));function getAdminUser(_0x4d91b1,_0x121d9a,_0x34df8c,_0x3679a1,_0x101e41,_0x2680d4){return new Promise(function(_0x42458d,_0x4713a1){var _0x4f14ce={'method':_0x72c2('0xb'),'uri':_0x3679a1+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x101e41+'&'+_0x2680d4,'auth':_0x121d9a,'json':!![]};return rp(_0x4f14ce)['then'](function(_0x4320ba){if(_0x4320ba['result'][_0x72c2('0xc')]>0x0){_0x34df8c[_0x72c2('0xd')]=_0x4320ba[_0x72c2('0xe')][0x0][_0x72c2('0xf')];}logger[_0x72c2('0x10')]('['+[_0x4d91b1[_0x72c2('0x11')]()]+_0x72c2('0x12'),_0x34df8c);_0x42458d(_0x34df8c);})[_0x72c2('0x13')](function(_0x50efae){logger[_0x72c2('0x14')]('['+[_0x4d91b1[_0x72c2('0x11')]()]+']',_0x50efae[_0x72c2('0x15')]);_0x4713a1(_0x50efae[_0x72c2('0x15')]);});});}function getUser(_0x359b81,_0x201e72,_0x5daf10,_0x5d552d,_0x51dc5b){return function(_0x1e6d03){logger['info']('['+[_0x359b81[_0x72c2('0x11')]()]+_0x72c2('0x16'),_0x1e6d03);return new Promise(function(_0x4b537a,_0x5d0d61){if(intUtil[_0x72c2('0x17')](_0x1e6d03[_0x72c2('0x18')])){var _0x51fcc6={'method':_0x72c2('0xb'),'uri':_0x5daf10+_0x72c2('0x19')+_0x1e6d03[_0x72c2('0x18')]+'&'+_0x5d552d+'&'+_0x51dc5b,'auth':_0x201e72,'json':!![]};logger['info']('['+[_0x359b81[_0x72c2('0x11')]()]+_0x72c2('0x1a'),_0x51fcc6);return rp(_0x51fcc6)[_0x72c2('0x1b')](function(_0x290374){logger[_0x72c2('0x10')]('['+[_0x359b81[_0x72c2('0x11')]()]+_0x72c2('0x1c'),_0x290374);if(_0x290374[_0x72c2('0xe')]['length']>0x0&&String(_0x290374['result'][0x0]['active'])===_0x72c2('0x1d')){_0x1e6d03['userId']=_0x290374[_0x72c2('0xe')][0x0][_0x72c2('0xf')];}else{_0x1e6d03[_0x72c2('0x1e')]=_0x1e6d03[_0x72c2('0xd')];_0x1e6d03[_0x72c2('0x18')]=_0x1e6d03['adminEmail'];}logger[_0x72c2('0x10')]('['+[_0x359b81[_0x72c2('0x11')]()]+_0x72c2('0x1f'),_0x1e6d03);_0x4b537a(_0x1e6d03);})[_0x72c2('0x13')](function(_0x3e0063){logger['error']('['+[_0x359b81[_0x72c2('0x11')]()]+']',_0x3e0063[_0x72c2('0x15')]);_0x5d0d61(_0x3e0063[_0x72c2('0x15')]);});}else{logger[_0x72c2('0x10')]('['+[_0x359b81['toUpperCase']()]+_0x72c2('0x20'));_0x1e6d03[_0x72c2('0x1e')]=_0x1e6d03[_0x72c2('0xd')];_0x1e6d03['userEmail']=_0x1e6d03['adminEmail'];_0x4b537a(_0x1e6d03);}});};}function createEndUser(_0x3392f3,_0x67ae9d,_0x1735aa,_0x16a93c,_0x11c0dd){logger[_0x72c2('0x10')]('['+[_0x3392f3['toUpperCase']()]+_0x72c2('0x21'),_0x1735aa);return new Promise(function(_0x138234,_0x43ebf4){var _0x4794ca={'method':_0x72c2('0x22'),'uri':_0x16a93c+_0x72c2('0x23')+_0x11c0dd,'body':{'user_name':_0x1735aa[_0x72c2('0x24')],'roles':_0x72c2('0x25'),'first_name':_0x1735aa[_0x72c2('0x24')],'active':_0x72c2('0x1d'),'date_format':_0x72c2('0x26'),'phone':_0x1735aa[_0x72c2('0x24')]},'auth':_0x67ae9d,'json':!![]};return rp(_0x4794ca)[_0x72c2('0x1b')](function(_0x15a6f4){logger[_0x72c2('0x10')]('['+[_0x3392f3[_0x72c2('0x11')]()]+_0x72c2('0x27'),_0x15a6f4[_0x72c2('0xe')]);_0x1735aa['endUserId']=_0x15a6f4[_0x72c2('0xe')][_0x72c2('0xf')];_0x138234(_0x1735aa);})[_0x72c2('0x13')](function(_0x105e53){logger[_0x72c2('0x14')]('['+[_0x3392f3['toUpperCase']()]+']',_0x105e53[_0x72c2('0x15')]);_0x43ebf4(_0x105e53[_0x72c2('0x15')]);});});}function getEndUser(_0x21afd2,_0x4415c2,_0x225b93,_0x9d9f0,_0x5218f0){return function(_0x427fc7){logger[_0x72c2('0x10')]('['+[_0x21afd2['toUpperCase']()]+_0x72c2('0x28'),_0x427fc7);return new Promise(function(_0x26317c,_0x4958aa){var _0x2ae4b6={'method':_0x72c2('0xb'),'uri':_0x225b93+_0x72c2('0x29')+_0x427fc7['endUserNumber']+'&'+_0x9d9f0+'&'+_0x5218f0,'auth':_0x4415c2,'json':!![]};return rp(_0x2ae4b6)[_0x72c2('0x1b')](function(_0x2e357a){if(_0x2e357a[_0x72c2('0xe')][_0x72c2('0xc')]>0x0){_0x427fc7['endUserId']=_0x2e357a[_0x72c2('0xe')][0x0]['sys_id'];logger['info']('['+[_0x21afd2['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x427fc7);_0x26317c(_0x427fc7);}else{return createEndUser(_0x21afd2,_0x4415c2,_0x427fc7,_0x225b93,_0x9d9f0)[_0x72c2('0x1b')](function(_0x32b91b){logger[_0x72c2('0x10')]('['+[_0x21afd2[_0x72c2('0x11')]()]+_0x72c2('0x2a'),_0x32b91b);_0x26317c(_0x32b91b);});}})[_0x72c2('0x13')](function(_0x451c55){logger[_0x72c2('0x14')]('['+[_0x21afd2[_0x72c2('0x11')]()]+']',_0x451c55[_0x72c2('0x15')]);_0x4958aa(_0x451c55[_0x72c2('0x15')]);});});};}function getCustomFields(_0x16dc4b,_0x3033ad){var _0x394b03={};if(_0x16dc4b['length']>0x0){_['forEach'](_0x16dc4b,function(_0x425034){if(_[_0x72c2('0x2b')](['string','picklist'],_0x425034[_0x72c2('0x2c')])&&_0x425034[_0x72c2('0x2d')]&&!_0x425034[_0x72c2('0x2e')]){_0x394b03[_0x425034[_0x72c2('0x2d')]['toLowerCase']()]=_0x425034['content']['toString']();}else if(_['includes']([_0x72c2('0x2f'),'picklist'],_0x425034[_0x72c2('0x2c')])&&_0x425034['idField']&&_0x425034[_0x72c2('0x2e')]){_0x394b03[_0x425034[_0x72c2('0x30')][_0x72c2('0x31')]()]=_0x425034[_0x72c2('0x32')]['toString']();}else if(_0x425034['type']==='variable'&&_0x425034[_0x72c2('0x33')]&&_0x425034[_0x72c2('0x30')]&&_0x425034[_0x72c2('0x2e')]){_0x394b03[_0x425034[_0x72c2('0x30')][_0x72c2('0x31')]()]=_0x3033ad[_0x425034[_0x72c2('0x33')]]['toString']();}else if(_0x425034[_0x72c2('0x2c')]===_0x72c2('0x34')&&_0x425034['Variable']&&_0x425034[_0x72c2('0x35')][_0x72c2('0x36')]&&_0x425034['idField']&&_0x425034[_0x72c2('0x2e')]){_0x394b03[_0x425034[_0x72c2('0x30')][_0x72c2('0x31')]()]=_0x3033ad[_0x425034[_0x72c2('0x35')][_0x72c2('0x36')][_0x72c2('0x31')]()]['toString']();}});}return _0x394b03;}function getTicket(_0x41aca0,_0x5208ac,_0x3481e2,_0x19e8dc,_0x5022f9,_0x226fd7){return function(_0x2f09d0){logger[_0x72c2('0x10')]('['+[_0x41aca0[_0x72c2('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x2f09d0);return new Promise(function(_0x9a64ee,_0x2d4e19){var _0x3a096c=_0x41aca0[_0x72c2('0x31')]()==='outbound'?_0x2f09d0[_0x72c2('0x1e')]:_0x2f09d0[_0x72c2('0x37')];var _0x4f156e={'method':_0x72c2('0x22'),'uri':_0x3481e2+'incident'+'?'+_0x226fd7,'body':Object[_0x72c2('0x38')]({},{'active':_0x72c2('0x1d'),'caller_id':_0x3a096c,'assigned_to':_0x2f09d0[_0x72c2('0x1e')],'short_description':intUtil[_0x72c2('0x39')](_0x19e8dc['Subjects'],_0x5022f9,'\x20'),'description':intUtil[_0x72c2('0x39')](_0x19e8dc[_0x72c2('0x3a')],_0x5022f9,'\x0a')},getCustomFields(_0x19e8dc['Fields'],_0x5022f9)),'auth':_0x5208ac,'json':!![]};return rp(_0x4f156e)['then'](function(_0x40ae6e){logger[_0x72c2('0x10')]('['+[_0x41aca0[_0x72c2('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x40ae6e[_0x72c2('0xe')]);_0x2f09d0['ticketId']=_0x40ae6e[_0x72c2('0xe')]['sys_id'];_0x2f09d0[_0x72c2('0x3b')]=_0x40ae6e[_0x72c2('0xe')]['number'];logger['info']('['+[_0x41aca0[_0x72c2('0x11')]()]+_0x72c2('0x3c'),_0x2f09d0);_0x9a64ee(_0x2f09d0);})[_0x72c2('0x13')](function(_0x56cb0f){logger[_0x72c2('0x14')]('['+[_0x41aca0[_0x72c2('0x11')]()]+']',_0x56cb0f[_0x72c2('0x15')]);_0x2d4e19(_0x56cb0f[_0x72c2('0x15')]);});});};}function createRemoteTag(_0x1a5483,_0x2ba0a8,_0x445917,_0x1e4e7e){return new Promise(function(_0x34b173,_0x45c71a){var _0x347d9c={'method':_0x72c2('0x22'),'uri':_0x445917+_0x72c2('0x3d')+'?'+_0x1e4e7e,'body':{'short_description':_0x1a5483,'global':!![],'active':!![],'name':_0x1a5483},'auth':_0x2ba0a8,'json':!![]};return rp(_0x347d9c)[_0x72c2('0x1b')](function(_0x2677e1){var _0x4faa3e=_0x2677e1[_0x72c2('0xe')][_0x72c2('0xf')];_0x34b173(_0x4faa3e);});});}function getRemoteTag(_0x5c335f,_0x23ee25,_0x1897fb,_0x2e4fff,_0x128f82){return new Promise(function(_0x35bbbb,_0x4130d1){var _0x599202={'method':'GET','uri':_0x1897fb+'label'+_0x72c2('0x3e')+_0x5c335f+'&'+_0x2e4fff,'auth':_0x23ee25,'json':!![]};return rp(_0x599202)[_0x72c2('0x1b')](function(_0x3b55c1){if(_0x3b55c1[_0x72c2('0xe')][_0x72c2('0xc')]>0x0){var _0x28353a=_0x3b55c1[_0x72c2('0xe')][0x0][_0x72c2('0xf')];_0x35bbbb(_0x28353a);}else{return createRemoteTag(_0x5c335f,_0x23ee25,_0x1897fb,_0x2e4fff)[_0x72c2('0x1b')](function(_0x357c15){_0x35bbbb(_0x357c15);});}});});}function assignTagToIncident(_0x29e073,_0x173607,_0x352802,_0x328c63,_0x5504c1){return new Promise(function(_0x51ff79,_0x149933){var _0x922bdb={'method':'POST','uri':_0x352802+_0x72c2('0x3f')+'?'+_0x5504c1,'body':{'label':_0x29e073,'table':'incident','id_type':_0x72c2('0x40'),'table_key':_0x328c63['ticketId'],'title':'Incident\x20-\x20'+_0x328c63[_0x72c2('0x3b')],'id_display':_0x328c63[_0x72c2('0x3b')]},'auth':_0x173607,'json':!![]};return rp(_0x922bdb)['then'](function(_0x311c32){_0x51ff79();})['catch'](function(){_0x51ff79();});});}function manageTags(_0x229617,_0x426cbc,_0x99e539,_0x1e2bc2,_0x213778,_0x1ada3d,_0x4b8fc8){return new Promise(function(_0x31a9d2,_0x52f31c){var _0x45ad66=[];_0x426cbc['forEach'](function(_0x5d5c87){_0x45ad66['push'](getRemoteTag(_0x5d5c87,_0x99e539,_0x1e2bc2,_0x1ada3d,_0x4b8fc8));});return Promise[_0x72c2('0x41')](_0x45ad66)[_0x72c2('0x1b')](function(_0x38b12a){if(_0x38b12a[_0x72c2('0xc')]){logger['info']('['+[_0x229617[_0x72c2('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x38b12a);var _0x5b9926=[];_0x38b12a[_0x72c2('0x42')](function(_0x30a8c1){_0x5b9926[_0x72c2('0x43')](assignTagToIncident(_0x30a8c1,_0x99e539,_0x1e2bc2,_0x213778,_0x1ada3d));});return Promise[_0x72c2('0x41')](_0x5b9926)[_0x72c2('0x1b')](function(){_0x31a9d2();})['catch'](function(){_0x31a9d2();});}else{_0x31a9d2();}});});}function getTags(_0x4a62a9,_0x13e61a,_0x4ffe41,_0x1ea0fb,_0x478073,_0x2f4ecf){return function(_0xc07efe){return new Promise(function(_0x444f9d,_0xa58adb){var _0x1caffb=[];var _0x75ffb8=_0x1ea0fb[_0x72c2('0x44')];if(_0x75ffb8&&_0x75ffb8[_0x72c2('0xc')]>0x0){_0x1caffb=_['map'](_0x75ffb8,_0x72c2('0x36'));}if(_0x1caffb[_0x72c2('0xc')]>0x0){return manageTags(_0x4a62a9,_0x1caffb,_0x13e61a,_0x4ffe41,_0xc07efe,_0x478073,_0x2f4ecf)['then'](function(){_0x444f9d(_0xc07efe);});}else{_0x444f9d(_0xc07efe);}});};}function emit(_0x492e9b,_0x5a6fcd,_0x3f0c19){var _0x251c19=_0x72c2('0x45')+_0x72c2('0x46')+_0x72c2('0x47')+'%255EORDERBYDESCnumber';var _0xf60ed7={'uri':_0x492e9b+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3f0c19+_0x251c19};io['to'](util['format']('user:%s',_0x5a6fcd))[_0x72c2('0x48')](_0x72c2('0x49'),_0xf60ed7);}exports['cs']=function(_0x205e7d,_0x3d1f92,_0x297609,_0x248330,_0x39b8de,_0x63537d,_0x2ef289,_0x2248c3){var _0x31ef73={};var _0x2ba8ed={'user':_0x63537d['username'],'pass':_0x63537d[_0x72c2('0x4a')]};var _0x589707='sysparm_limit=1';var _0x264f6d='sysparm_display_value=true';_0x63537d['remoteUri']=intUtil['stripTrailingSlash'](_0x63537d[_0x72c2('0x4b')]);_0x63537d[_0x72c2('0x4c')]=intUtil[_0x72c2('0x4d')](_0x63537d[_0x72c2('0x4c')]);var _0x3d93c6=util[_0x72c2('0x4e')](_0x72c2('0x4f'),_0x63537d[_0x72c2('0x4b')]);_0x31ef73[_0x72c2('0x18')]=!_[_0x72c2('0x50')](_0x248330)?_0x248330[_0x72c2('0x51')]:null;_0x31ef73[_0x72c2('0x52')]=_0x63537d[_0x72c2('0x51')];_0x31ef73[_0x72c2('0x24')]=_0x2248c3[_0x72c2('0x31')]()==='outbound'?_0x3d1f92[_0x72c2('0x53')]:_0x3d1f92[_0x72c2('0x54')];_0x31ef73['callDirection']=_0x2248c3===_0x72c2('0x55')||_0x2248c3===_0x72c2('0x56')?'queue':_0x72c2('0x57');var _0x194cdb=util['format'](_0x72c2('0x58'),_0x63537d[_0x72c2('0x4c')],_0x3d1f92[_0x72c2('0x59')],md5(_0x3d1f92['uniqueid']));if(_0x39b8de&&_0x39b8de[_0x72c2('0x5a')]){logger['info'](_0x72c2('0x5b'),_0x72c2('0x5c'));_0x3d1f92['recordingURL']=_0x194cdb;}else if(_0x2ef289&&_0x2ef289[_0x72c2('0x5d')]&&_0x2ef289[_0x72c2('0x5d')]!==_0x72c2('0x5e')){logger[_0x72c2('0x10')](_0x72c2('0x5f'),_0x72c2('0x5c'));_0x3d1f92[_0x72c2('0x60')]=_0x194cdb;}else{_0x3d1f92[_0x72c2('0x60')]='';}return getAdminUser(_0x2248c3,_0x2ba8ed,_0x31ef73,_0x3d93c6,_0x264f6d,_0x589707)[_0x72c2('0x1b')](getUser(_0x2248c3,_0x2ba8ed,_0x3d93c6,_0x264f6d,_0x589707))[_0x72c2('0x1b')](getEndUser(_0x2248c3,_0x2ba8ed,_0x3d93c6,_0x264f6d,_0x589707))[_0x72c2('0x1b')](getTicket(_0x2248c3,_0x2ba8ed,_0x3d93c6,_0x297609,_0x3d1f92,_0x264f6d))[_0x72c2('0x1b')](function(_0x4082c9){logger['info'](util[_0x72c2('0x4e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4082c9[_0x72c2('0x61')]));logger[_0x72c2('0x10')](util[_0x72c2('0x4e')]('call\x20direction:\x20%s',_0x2248c3));if(_0x2248c3!==_0x72c2('0x56')){logger[_0x72c2('0x10')]('['+[_0x2248c3[_0x72c2('0x11')]()]+']',_0x72c2('0x62'));emit(_0x63537d[_0x72c2('0x4b')],_0x248330[_0x72c2('0x36')],_0x4082c9['ticketId']);}})[_0x72c2('0x13')](function(_0x9a3d1c){logger[_0x72c2('0x14')]('['+[_0x2248c3['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x72c2('0x63')](_0x9a3d1c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x359e=['username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','true','sys_id','userId','adminEmail','message',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','customField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','emit','trigger:browser:url'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x359e,0x1e1));var _0xe359=function(_0x170ac5,_0x3bbbdc){_0x170ac5=_0x170ac5-0x0;var _0x50d576=_0x359e[_0x170ac5];return _0x50d576;};'use strict';var _=require(_0xe359('0x0'));var Promise=require(_0xe359('0x1'));var rp=require(_0xe359('0x2'));var util=require(_0xe359('0x3'));var md5=require(_0xe359('0x4'));var Redis=require(_0xe359('0x5'));var intUtil=require(_0xe359('0x6'));var config=require(_0xe359('0x7'));var logger=require(_0xe359('0x8'))(_0xe359('0x9'));config[_0xe359('0xa')]=_[_0xe359('0xb')](config['redis'],{'host':_0xe359('0xc'),'port':0x18eb});var io=require(_0xe359('0xd'))(new Redis(config[_0xe359('0xa')]));function getAdminUser(_0x248e19,_0xd62913,_0xbd557d,_0x2df65b,_0x6e0f53,_0x4812fa){return new Promise(function(_0x44ba76,_0x492ba9){var _0xe37bd5={'method':_0xe359('0xe'),'uri':_0x2df65b+_0xe359('0xf')+'&'+_0x6e0f53+'&'+_0x4812fa,'auth':_0xd62913,'json':!![]};return rp(_0xe37bd5)['then'](function(_0x85e297){if(_0x85e297[_0xe359('0x10')][_0xe359('0x11')]>0x0){_0xbd557d['adminId']=_0x85e297['result'][0x0]['sys_id'];}logger[_0xe359('0x12')]('['+[_0x248e19['toUpperCase']()]+_0xe359('0x13'),_0xbd557d);_0x44ba76(_0xbd557d);})[_0xe359('0x14')](function(_0x32d5c8){logger[_0xe359('0x15')]('['+[_0x248e19[_0xe359('0x16')]()]+']',_0x32d5c8['message']);_0x492ba9(_0x32d5c8['message']);});});}function getUser(_0x303c79,_0x41b321,_0x32a203,_0xd80bad,_0xdd7651){return function(_0x592e83){logger['info']('['+[_0x303c79[_0xe359('0x16')]()]+_0xe359('0x17'),_0x592e83);return new Promise(function(_0x162eec,_0xfca089){if(intUtil[_0xe359('0x18')](_0x592e83[_0xe359('0x19')])){var _0x43e00e={'method':'GET','uri':_0x32a203+_0xe359('0x1a')+_0x592e83['userEmail']+'&'+_0xd80bad+'&'+_0xdd7651,'auth':_0x41b321,'json':!![]};logger[_0xe359('0x12')]('['+[_0x303c79['toUpperCase']()]+_0xe359('0x1b'),_0x43e00e);return rp(_0x43e00e)[_0xe359('0x1c')](function(_0x4a0e53){logger[_0xe359('0x12')]('['+[_0x303c79[_0xe359('0x16')]()]+'],\x20getUser\x20entity',_0x4a0e53);if(_0x4a0e53[_0xe359('0x10')][_0xe359('0x11')]>0x0&&String(_0x4a0e53['result'][0x0][_0xe359('0x1d')])===_0xe359('0x1e')){_0x592e83['userId']=_0x4a0e53[_0xe359('0x10')][0x0][_0xe359('0x1f')];}else{_0x592e83[_0xe359('0x20')]=_0x592e83['adminId'];_0x592e83[_0xe359('0x19')]=_0x592e83[_0xe359('0x21')];}logger[_0xe359('0x12')]('['+[_0x303c79[_0xe359('0x16')]()]+'],\x20getUser\x20crm',_0x592e83);_0x162eec(_0x592e83);})[_0xe359('0x14')](function(_0x361ac0){logger[_0xe359('0x15')]('['+[_0x303c79[_0xe359('0x16')]()]+']',_0x361ac0[_0xe359('0x22')]);_0xfca089(_0x361ac0[_0xe359('0x22')]);});}else{logger[_0xe359('0x12')]('['+[_0x303c79[_0xe359('0x16')]()]+_0xe359('0x23'));_0x592e83[_0xe359('0x20')]=_0x592e83[_0xe359('0x24')];_0x592e83['userEmail']=_0x592e83[_0xe359('0x21')];_0x162eec(_0x592e83);}});};}function createEndUser(_0x3367ab,_0x3d1c10,_0x2d5e8a,_0x5ebc2f,_0x543c79){logger[_0xe359('0x12')]('['+[_0x3367ab['toUpperCase']()]+_0xe359('0x25'),_0x2d5e8a);return new Promise(function(_0x2b3a3e,_0x47aa03){var _0x1b66f2={'method':_0xe359('0x26'),'uri':_0x5ebc2f+'sys_user?'+_0x543c79,'body':{'user_name':_0x2d5e8a[_0xe359('0x27')],'roles':_0xe359('0x28'),'first_name':_0x2d5e8a['endUserNumber'],'active':_0xe359('0x1e'),'date_format':_0xe359('0x29'),'phone':_0x2d5e8a[_0xe359('0x27')]},'auth':_0x3d1c10,'json':!![]};return rp(_0x1b66f2)[_0xe359('0x1c')](function(_0x10acf5){logger[_0xe359('0x12')]('['+[_0x3367ab[_0xe359('0x16')]()]+_0xe359('0x2a'),_0x10acf5[_0xe359('0x10')]);_0x2d5e8a[_0xe359('0x2b')]=_0x10acf5[_0xe359('0x10')][_0xe359('0x1f')];_0x2b3a3e(_0x2d5e8a);})['catch'](function(_0x6a9203){logger['error']('['+[_0x3367ab['toUpperCase']()]+']',_0x6a9203[_0xe359('0x22')]);_0x47aa03(_0x6a9203['message']);});});}function getEndUser(_0x592245,_0x548927,_0x30a893,_0x38f38d,_0x3d1e96){return function(_0x18c64c){logger[_0xe359('0x12')]('['+[_0x592245[_0xe359('0x16')]()]+_0xe359('0x2c'),_0x18c64c);return new Promise(function(_0x5efae0,_0x24f8f5){var _0xa14fad={'method':_0xe359('0xe'),'uri':_0x30a893+_0xe359('0x2d')+_0x18c64c[_0xe359('0x27')]+'&'+_0x38f38d+'&'+_0x3d1e96,'auth':_0x548927,'json':!![]};return rp(_0xa14fad)['then'](function(_0x3f0c8e){if(_0x3f0c8e[_0xe359('0x10')][_0xe359('0x11')]>0x0){_0x18c64c[_0xe359('0x2b')]=_0x3f0c8e[_0xe359('0x10')][0x0][_0xe359('0x1f')];logger[_0xe359('0x12')]('['+[_0x592245[_0xe359('0x16')]()]+_0xe359('0x2e'),_0x18c64c);_0x5efae0(_0x18c64c);}else{return createEndUser(_0x592245,_0x548927,_0x18c64c,_0x30a893,_0x38f38d)['then'](function(_0x4950db){logger[_0xe359('0x12')]('['+[_0x592245['toUpperCase']()]+_0xe359('0x2f'),_0x4950db);_0x5efae0(_0x4950db);});}})[_0xe359('0x14')](function(_0x22e45f){logger[_0xe359('0x15')]('['+[_0x592245[_0xe359('0x16')]()]+']',_0x22e45f[_0xe359('0x22')]);_0x24f8f5(_0x22e45f['message']);});});};}function getCustomFields(_0x364557,_0x538440){var _0x1b6f97={};if(_0x364557['length']>0x0){_[_0xe359('0x30')](_0x364557,function(_0x28bafe){if(_[_0xe359('0x31')]([_0xe359('0x32'),_0xe359('0x33')],_0x28bafe[_0xe359('0x34')])&&_0x28bafe[_0xe359('0x35')]&&!_0x28bafe['customField']){_0x1b6f97[_0x28bafe[_0xe359('0x35')][_0xe359('0x36')]()]=_0x28bafe['content'][_0xe359('0x37')]();}else if(_['includes']([_0xe359('0x32'),'picklist'],_0x28bafe['type'])&&_0x28bafe[_0xe359('0x38')]&&_0x28bafe[_0xe359('0x39')]){_0x1b6f97[_0x28bafe[_0xe359('0x38')]['toLowerCase']()]=_0x28bafe[_0xe359('0x3a')][_0xe359('0x37')]();}else if(_0x28bafe[_0xe359('0x34')]===_0xe359('0x3b')&&_0x28bafe[_0xe359('0x3c')]&&_0x28bafe[_0xe359('0x38')]&&_0x28bafe[_0xe359('0x39')]){_0x1b6f97[_0x28bafe[_0xe359('0x38')]['toLowerCase']()]=_0x538440[_0x28bafe[_0xe359('0x3c')]][_0xe359('0x37')]();}else if(_0x28bafe['type']===_0xe359('0x3d')&&_0x28bafe[_0xe359('0x3e')]&&_0x28bafe['Variable'][_0xe359('0x3f')]&&_0x28bafe[_0xe359('0x38')]&&_0x28bafe[_0xe359('0x39')]){_0x1b6f97[_0x28bafe[_0xe359('0x38')][_0xe359('0x36')]()]=_0x538440[_0x28bafe['Variable'][_0xe359('0x3f')]['toLowerCase']()][_0xe359('0x37')]();}});}return _0x1b6f97;}function getTicket(_0x51929b,_0x4bbc0b,_0x5c5937,_0x52ed26,_0x2051e4,_0x408689){return function(_0x2cd313){logger['info']('['+[_0x51929b['toUpperCase']()]+_0xe359('0x40'),_0x2cd313);return new Promise(function(_0x133b4f,_0x514435){var _0x3ac1a6=_0x51929b[_0xe359('0x36')]()===_0xe359('0x41')?_0x2cd313[_0xe359('0x20')]:_0x2cd313[_0xe359('0x2b')];var _0x4eaae5={'method':_0xe359('0x26'),'uri':_0x5c5937+_0xe359('0x42')+'?'+_0x408689,'body':Object['assign']({},{'active':_0xe359('0x1e'),'caller_id':_0x3ac1a6,'assigned_to':_0x2cd313[_0xe359('0x20')],'short_description':intUtil[_0xe359('0x43')](_0x52ed26[_0xe359('0x44')],_0x2051e4,'\x20'),'description':intUtil[_0xe359('0x43')](_0x52ed26[_0xe359('0x45')],_0x2051e4,'\x0a')},getCustomFields(_0x52ed26[_0xe359('0x46')],_0x2051e4)),'auth':_0x4bbc0b,'json':!![]};return rp(_0x4eaae5)[_0xe359('0x1c')](function(_0x5c53f8){logger['info']('['+[_0x51929b[_0xe359('0x16')]()]+_0xe359('0x47'),_0x5c53f8[_0xe359('0x10')]);_0x2cd313['ticketId']=_0x5c53f8[_0xe359('0x10')]['sys_id'];_0x2cd313['ticketNumber']=_0x5c53f8[_0xe359('0x10')][_0xe359('0x48')];logger['info']('['+[_0x51929b[_0xe359('0x16')]()]+_0xe359('0x49'),_0x2cd313);_0x133b4f(_0x2cd313);})[_0xe359('0x14')](function(_0x578268){logger[_0xe359('0x15')]('['+[_0x51929b['toUpperCase']()]+']',_0x578268[_0xe359('0x22')]);_0x514435(_0x578268[_0xe359('0x22')]);});});};}function createRemoteTag(_0x36c7b2,_0x372b37,_0x563d4c,_0x4040c0){return new Promise(function(_0x20c9e0,_0x3d8d05){var _0x559ca8={'method':'POST','uri':_0x563d4c+_0xe359('0x4a')+'?'+_0x4040c0,'body':{'short_description':_0x36c7b2,'global':!![],'active':!![],'name':_0x36c7b2},'auth':_0x372b37,'json':!![]};return rp(_0x559ca8)[_0xe359('0x1c')](function(_0x2d7723){var _0xccc8f1=_0x2d7723['result'][_0xe359('0x1f')];_0x20c9e0(_0xccc8f1);});});}function getRemoteTag(_0x5d1cc1,_0x5d6cb3,_0x1fc77a,_0x295c02,_0x2b15cd){return new Promise(function(_0x531d6d,_0xa4a18){var _0x348d0b={'method':_0xe359('0xe'),'uri':_0x1fc77a+_0xe359('0x4a')+_0xe359('0x4b')+_0x5d1cc1+'&'+_0x295c02,'auth':_0x5d6cb3,'json':!![]};return rp(_0x348d0b)[_0xe359('0x1c')](function(_0x48fdc5){if(_0x48fdc5['result'][_0xe359('0x11')]>0x0){var _0x467d1b=_0x48fdc5['result'][0x0][_0xe359('0x1f')];_0x531d6d(_0x467d1b);}else{return createRemoteTag(_0x5d1cc1,_0x5d6cb3,_0x1fc77a,_0x295c02)[_0xe359('0x1c')](function(_0x14ab9d){_0x531d6d(_0x14ab9d);});}});});}function assignTagToIncident(_0x1058ce,_0x30de82,_0x3ed462,_0x357404,_0x4358d){return new Promise(function(_0x446457,_0x1de642){var _0x5d8052={'method':'POST','uri':_0x3ed462+'label_entry'+'?'+_0x4358d,'body':{'label':_0x1058ce,'table':_0xe359('0x42'),'id_type':_0xe359('0x4c'),'table_key':_0x357404[_0xe359('0x4d')],'title':_0xe359('0x4e')+_0x357404['ticketNumber'],'id_display':_0x357404[_0xe359('0x4f')]},'auth':_0x30de82,'json':!![]};return rp(_0x5d8052)[_0xe359('0x1c')](function(_0x51fa9f){_0x446457();})['catch'](function(){_0x446457();});});}function manageTags(_0x356173,_0x26c24f,_0x21e17a,_0x5b5666,_0x1b8b3d,_0x8f62ab,_0xde0efe){return new Promise(function(_0x3644f9,_0x11fd95){var _0x3e8de2=[];_0x26c24f['forEach'](function(_0x4e44ac){_0x3e8de2[_0xe359('0x50')](getRemoteTag(_0x4e44ac,_0x21e17a,_0x5b5666,_0x8f62ab,_0xde0efe));});return Promise[_0xe359('0x51')](_0x3e8de2)[_0xe359('0x1c')](function(_0x49471a){if(_0x49471a['length']){logger['info']('['+[_0x356173[_0xe359('0x16')]()]+_0xe359('0x52'),_0x49471a);var _0x4b5012=[];_0x49471a[_0xe359('0x30')](function(_0x4edf1d){_0x4b5012[_0xe359('0x50')](assignTagToIncident(_0x4edf1d,_0x21e17a,_0x5b5666,_0x1b8b3d,_0x8f62ab));});return Promise[_0xe359('0x51')](_0x4b5012)[_0xe359('0x1c')](function(){_0x3644f9();})[_0xe359('0x14')](function(){_0x3644f9();});}else{_0x3644f9();}});});}function getTags(_0x1aa318,_0x2eaabc,_0x2c3ab3,_0x4ddc54,_0x1b3d1e,_0x25d5e6){return function(_0x780a50){return new Promise(function(_0x7c0262,_0x1e25a4){var _0x114e79=[];var _0x1fef8f=_0x4ddc54[_0xe359('0x53')];if(_0x1fef8f&&_0x1fef8f[_0xe359('0x11')]>0x0){_0x114e79=_[_0xe359('0x54')](_0x1fef8f,_0xe359('0x3f'));}if(_0x114e79[_0xe359('0x11')]>0x0){return manageTags(_0x1aa318,_0x114e79,_0x2eaabc,_0x2c3ab3,_0x780a50,_0x1b3d1e,_0x25d5e6)[_0xe359('0x1c')](function(){_0x7c0262(_0x780a50);});}else{_0x7c0262(_0x780a50);}});};}function emit(_0xca7e00,_0x3a7b74,_0x3dae26){var _0x276199='%26sysparm_record_target%3Dincident'+_0xe359('0x55')+_0xe359('0x56')+'%255EORDERBYDESCnumber';var _0x4e8f2e={'uri':_0xca7e00+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3dae26+_0x276199};io['to'](util['format']('user:%s',_0x3a7b74))[_0xe359('0x57')](_0xe359('0x58'),_0x4e8f2e);}exports['cs']=function(_0x27b09b,_0x90211c,_0x5b4b59,_0x1d2f28,_0x18feaf,_0x5a4dcb,_0x5e9027,_0xb0732e){var _0x289b5c={};var _0x4ed54d={'user':_0x5a4dcb[_0xe359('0x59')],'pass':_0x5a4dcb[_0xe359('0x5a')]};var _0x5b0239=_0xe359('0x5b');var _0x16d0c4=_0xe359('0x5c');_0x5a4dcb[_0xe359('0x5d')]=intUtil['stripTrailingSlash'](_0x5a4dcb[_0xe359('0x5d')]);_0x5a4dcb[_0xe359('0x5e')]=intUtil['stripTrailingSlash'](_0x5a4dcb['serverUrl']);var _0x1fa1b2=util[_0xe359('0x5f')](_0xe359('0x60'),_0x5a4dcb[_0xe359('0x5d')]);_0x289b5c['userEmail']=!_['isNil'](_0x1d2f28)?_0x1d2f28[_0xe359('0x61')]:null;_0x289b5c[_0xe359('0x21')]=_0x5a4dcb[_0xe359('0x61')];_0x289b5c[_0xe359('0x27')]=_0xb0732e[_0xe359('0x36')]()===_0xe359('0x41')?_0x90211c[_0xe359('0x62')]:_0x90211c[_0xe359('0x63')];_0x289b5c[_0xe359('0x64')]=_0xb0732e==='queue'||_0xb0732e===_0xe359('0x65')?'queue':_0xe359('0x41');var _0x15bfcc=util[_0xe359('0x5f')](_0xe359('0x66'),_0x5a4dcb['serverUrl'],_0x90211c[_0xe359('0x67')],md5(_0x90211c[_0xe359('0x67')]));if(_0x18feaf&&_0x18feaf[_0xe359('0x68')]){logger['info'](_0xe359('0x69'),_0xe359('0x6a'));_0x90211c[_0xe359('0x6b')]=_0x15bfcc;}else if(_0x5e9027&&_0x5e9027[_0xe359('0x6c')]&&_0x5e9027[_0xe359('0x6c')]!=='none'){logger[_0xe359('0x12')](_0xe359('0x6d'),_0xe359('0x6a'));_0x90211c['recordingURL']=_0x15bfcc;}else{_0x90211c[_0xe359('0x6b')]='';}return getAdminUser(_0xb0732e,_0x4ed54d,_0x289b5c,_0x1fa1b2,_0x16d0c4,_0x5b0239)['then'](getUser(_0xb0732e,_0x4ed54d,_0x1fa1b2,_0x16d0c4,_0x5b0239))[_0xe359('0x1c')](getEndUser(_0xb0732e,_0x4ed54d,_0x1fa1b2,_0x16d0c4,_0x5b0239))[_0xe359('0x1c')](getTicket(_0xb0732e,_0x4ed54d,_0x1fa1b2,_0x5b4b59,_0x90211c,_0x16d0c4))[_0xe359('0x1c')](function(_0x348659){logger[_0xe359('0x12')](util['format'](_0xe359('0x6e'),_0x348659['ticketId']));logger[_0xe359('0x12')](util[_0xe359('0x5f')](_0xe359('0x6f'),_0xb0732e));if(_0xb0732e!=='unmanaged'){logger['info']('['+[_0xb0732e[_0xe359('0x16')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5a4dcb[_0xe359('0x5d')],_0x1d2f28['name'],_0x348659[_0xe359('0x4d')]);}})[_0xe359('0x14')](function(_0x13a96f){logger[_0xe359('0x15')]('['+[_0xb0732e['toUpperCase']()]+_0xe359('0x70'),util[_0xe359('0x71')](_0x13a96f,{'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 118374f..9296de2 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 _0x19d4=['version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','The\x20Enduser\x20ID\x20is:','trigger:browser:url','lastevent','calleridnum','Inbound','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','created_by','description','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','push','idField','variableName','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','info','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','POST','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts'];(function(_0x55f140,_0x4a5d2e){var _0x33a112=function(_0x1b4c18){while(--_0x1b4c18){_0x55f140['push'](_0x55f140['shift']());}};_0x33a112(++_0x4a5d2e);}(_0x19d4,0x107));var _0x419d=function(_0x1a8254,_0x54eeb2){_0x1a8254=_0x1a8254-0x0;var _0x537eee=_0x19d4[_0x1a8254];return _0x537eee;};'use strict';var _=require(_0x419d('0x0'));var rp=require(_0x419d('0x1'));var BPromise=require(_0x419d('0x2'));var md5=require(_0x419d('0x3'));var util=require(_0x419d('0x4'));var Redis=require(_0x419d('0x5'));var intUtil=require(_0x419d('0x6'));var config=require(_0x419d('0x7'));var logger=require(_0x419d('0x8'))(_0x419d('0x9'));config[_0x419d('0xa')]=_[_0x419d('0xb')](config['redis'],{'host':_0x419d('0xc'),'port':0x18eb});var io=require(_0x419d('0xd'))(new Redis(config[_0x419d('0xa')]));var def={'method':'POST','json':!![]};function emit(_0x4827d7,_0x2490a7,_0x5ddd25){io['to'](_0x4827d7)[_0x419d('0xe')](_0x2490a7,_0x5ddd25);}function getTicket(_0x5f4e5b,_0x3d3cff,_0x3315f4,_0x5ce58b,_0x363c2d,_0x2342fa,_0x1a4c01,_0x504424){logger['info'](_0x419d('0xf'));var _0x90774c=new Date();var _0x5b168d=[{'name':_0x419d('0x10'),'value':intUtil['getString'](_0x5ce58b['Subjects'],_0x363c2d,'\x20')},{'name':'assigned_user_id','value':_0x3d3cff['id']},{'name':_0x419d('0x11'),'value':_0x3d3cff['id']},{'name':_0x419d('0x12'),'value':intUtil['getString'](_0x5ce58b['Descriptions'],_0x363c2d,'\x0a')},{'name':_0x419d('0x13'),'value':_0x90774c[_0x419d('0x14')]()[_0x419d('0x15')](0x0,0x13)[_0x419d('0x16')]('T','\x20')},{'name':_0x419d('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x419d('0x18'),'value':_0x3315f4['id']},{'name':_0x419d('0x19'),'value':_0x419d('0x1a')},{'name':_0x419d('0x1b'),'value':_0x3315f4[_0x419d('0x10')]},{'name':_0x419d('0x1c'),'value':_0x504424}];if(_0x2342fa[_0x419d('0x1d')]){_['forEach'](_0x2342fa,function(_0x4d8d13){if(_0x363c2d[_0x4d8d13['variableName']]){_0x5b168d[_0x419d('0x1e')]({'name':_0x4d8d13[_0x419d('0x1f')],'value':_0x363c2d[_0x4d8d13[_0x419d('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x419d('0x21'),'response_type':_0x419d('0x21'),'rest_data':JSON[_0x419d('0x22')]({'session':_0x1a4c01['id'],'module_name':_0x419d('0x23'),'name_value_list':_0x5b168d})}});}function getAuth(_0xb15613){return util[_0x419d('0x24')]('Basic\x20%s',new Buffer(_0xb15613['apiKey']+':X')[_0x419d('0x25')](_0x419d('0x26')));}function getServerInfo(_0x579782){return request({'form':{'method':_0x419d('0x27'),'input_type':'JSON','response_type':_0x419d('0x21'),'rest_data':JSON[_0x419d('0x22')]({'session':_0x579782['id']})}});}function getUser(_0x5076f5,_0x39d685,_0x511142){if(!_[_0x419d('0x28')](_0x39d685)){logger[_0x419d('0x29')]('Getting\x20agent\x20with\x20name',_0x39d685);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x419d('0x21'),'rest_data':JSON[_0x419d('0x22')]({'session':_0x511142['id'],'module_name':'Employees','query':util[_0x419d('0x24')](_0x419d('0x2a'),_0x39d685),'order_by':'','offset':'0','select_fields':['id','name',_0x419d('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x419d('0x2c')](function(_0x5136af){if(_0x5136af[_0x419d('0x2d')]['length']){var _0x38897f=_['find'](_0x5136af[_0x419d('0x2d')],function(_0x1591e4){return _0x1591e4['name_value_list'][_0x419d('0x2b')][_0x419d('0x2e')]===_0x39d685;});if(_0x38897f){logger['info']('Agent\x20found!');return BPromise[_0x419d('0x2f')]({'id':_0x38897f[_0x419d('0x30')]['id'][_0x419d('0x2e')],'name':_0x38897f[_0x419d('0x30')][_0x419d('0x10')][_0x419d('0x2e')]});}}logger[_0x419d('0x29')](_0x419d('0x31'));return BPromise[_0x419d('0x2f')]({'id':_0x511142[_0x419d('0x30')][_0x419d('0x32')]['value'],'name':_0x511142['name_value_list'][_0x419d('0x2b')]['value']});});}else{logger[_0x419d('0x29')](_0x419d('0x33'));return BPromise[_0x419d('0x2f')]({'id':_0x511142[_0x419d('0x30')][_0x419d('0x32')][_0x419d('0x2e')],'name':_0x511142[_0x419d('0x30')][_0x419d('0x2b')][_0x419d('0x2e')]});}}function getEndUser(_0x7b5352,_0x4ab7de,_0x20d5be,_0x1e93e7){logger['info'](_0x419d('0x34'),_0x20d5be);return request({'form':{'method':_0x419d('0x35'),'input_type':_0x419d('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1e93e7['id'],'module_name':_0x419d('0x1a'),'query':util[_0x419d('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x20d5be),'order_by':'','offset':'0','select_fields':['id',_0x419d('0x10'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x419d('0x2c')](function(_0x547c71){if(_0x547c71[_0x419d('0x2d')]['length']){var _0x4fb68a=_[_0x419d('0x36')](_0x547c71[_0x419d('0x2d')],function(_0x20a1ec){return _0x20a1ec[_0x419d('0x30')]['phone_home'][_0x419d('0x2e')]===_0x20d5be;});if(_0x4fb68a){logger[_0x419d('0x29')]('Enduser\x20found!');return BPromise[_0x419d('0x2f')]({'id':_0x4fb68a['name_value_list']['id'][_0x419d('0x2e')],'name':_0x4fb68a[_0x419d('0x30')]['name'][_0x419d('0x2e')],'phone':_0x4fb68a['name_value_list'][_0x419d('0x37')][_0x419d('0x2e')]});}}else{logger[_0x419d('0x29')](_0x419d('0x38'));return request({'form':{'method':'set_entry','input_type':_0x419d('0x21'),'response_type':_0x419d('0x21'),'rest_data':JSON[_0x419d('0x22')]({'session':_0x1e93e7['id'],'module_name':_0x419d('0x1a'),'name_value_list':[{'name':_0x419d('0x39'),'value':_0x4ab7de!==_0x419d('0x3a')?_0x4ab7de:util[_0x419d('0x24')](_0x419d('0x3b'),_0x20d5be)},{'name':_0x419d('0x37'),'value':_0x20d5be}]})}})['then'](function(_0x502b5c){logger[_0x419d('0x29')](_0x419d('0x3c'));return BPromise[_0x419d('0x2f')]({'id':_0x502b5c['id'],'name':_0x502b5c[_0x419d('0x2d')]['first_name'][_0x419d('0x2e')],'phone':_0x502b5c[_0x419d('0x2d')]['phone_home'][_0x419d('0x2e')]});});}});}function request(_0x2281eb){logger[_0x419d('0x3d')](_0x419d('0x3e'),JSON[_0x419d('0x22')](_0x2281eb));return rp(_[_0x419d('0x3f')](def,_0x2281eb));}function getTags(_0x178e3b,_0x58e314){var _0x27ed5c=[];if(_0x178e3b&&_0x178e3b[_0x419d('0x1d')]>0x0){_0x27ed5c=_[_0x419d('0x40')](_0x178e3b,_0x58e314);}return _0x27ed5c;}function getCustomFields(_0x3b3f43,_0x14e4b4){var _0x2a1f45=[];var _0x224d75={'custom_fields':[]};if(_0x3b3f43[_0x419d('0x1d')]>0x0){_['forEach'](_0x3b3f43,function(_0x29f209){if(_0x29f209[_0x419d('0x41')]===_0x419d('0x42')&&_0x29f209[_0x419d('0x43')]&&!_0x29f209[_0x419d('0x44')]){_0x224d75[_0x29f209['nameField'][_0x419d('0x45')]()]=_0x29f209[_0x419d('0x46')][_0x419d('0x25')]();}else if(_0x29f209['type']===_0x419d('0x42')&&_0x29f209[_0x419d('0x1f')]&&_0x29f209[_0x419d('0x44')]){_0x224d75[_0x419d('0x47')][_0x419d('0x1e')]({'id':_0x29f209[_0x419d('0x1f')],'value':_0x29f209['content'][_0x419d('0x25')]()});}else if(_0x29f209['type']===_0x419d('0x48')&&_0x29f209[_0x419d('0x20')]&&_0x29f209[_0x419d('0x1f')]&&_0x29f209['customField']){_0x14e4b4[_0x29f209[_0x419d('0x20')]]&&_0x224d75[_0x419d('0x47')][_0x419d('0x1e')]({'id':_0x29f209[_0x419d('0x1f')],'value':_0x14e4b4[_0x29f209['variableName']][_0x419d('0x25')]()});}else if(_0x29f209[_0x419d('0x41')]===_0x419d('0x49')&&_0x29f209['Variable']&&_0x29f209[_0x419d('0x4a')][_0x419d('0x10')]&&_0x29f209[_0x419d('0x1f')]&&_0x29f209[_0x419d('0x44')]){_0x14e4b4[_0x29f209[_0x419d('0x4a')][_0x419d('0x10')][_0x419d('0x45')]()]&&_0x224d75[_0x419d('0x47')][_0x419d('0x1e')]({'id':_0x29f209['idField'],'value':_0x14e4b4[_0x29f209[_0x419d('0x4a')][_0x419d('0x10')]['toLowerCase']()]['toString']()});}});}return _0x224d75;}function getConnection(_0x16a3ed){return request({'method':_0x419d('0x4b'),'form':{'method':_0x419d('0x4c'),'input_type':_0x419d('0x21'),'response_type':_0x419d('0x21'),'rest_data':JSON[_0x419d('0x22')]({'user_auth':{'user_name':_0x16a3ed[_0x419d('0x4d')],'password':_0x16a3ed['password'],'encryption':_0x419d('0x4e')},'application':_0x419d('0x4f')})}})[_0x419d('0x2c')](function(_0x27f0fa){var _0x17288b=_0x27f0fa;if(_0x17288b['id']){def[_0x419d('0x50')]=_0x17288b['id'];return BPromise[_0x419d('0x2f')](_0x17288b);}else{throw new Error(util[_0x419d('0x24')](_0x419d('0x51'),_0x16a3ed['id']));}});}function setRelationship(_0x58c904,_0x339225,_0x41b0c7,_0x47b289){return request({'form':{'method':_0x419d('0x52'),'input_type':'JSON','response_type':_0x419d('0x21'),'rest_data':JSON[_0x419d('0x22')]({'session':_0x58c904['id'],'module_name':_0x419d('0x23'),'module_id':_0x41b0c7['id'],'link_field_name':_0x47b289,'related_ids':[_0x339225['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x47fc6b,_0xd3b511,_0x4fdff5,_0x4f6072,_0x251a39,_0x552f0c){var _0x437e45,_0x214cdd,_0x5a38a7,_0x30106f;_0x552f0c['remoteUri']=intUtil[_0x419d('0x53')](_0x552f0c[_0x419d('0x54')]);_0x552f0c[_0x419d('0x55')]=intUtil[_0x419d('0x53')](_0x552f0c[_0x419d('0x55')]);def['uri']=util['format'](_0x419d('0x56'),_0x552f0c[_0x419d('0x54')]);if(_0x251a39&&_0x251a39[_0x419d('0x57')]){logger[_0x419d('0x29')]('[QUEUE]',_0x419d('0x58'));_0xd3b511[_0x419d('0x59')]=util[_0x419d('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x552f0c[_0x419d('0x55')],_0xd3b511['uniqueid'],md5(_0xd3b511[_0x419d('0x5a')]));}else{_0xd3b511[_0x419d('0x59')]='';}return getConnection(_0x552f0c)[_0x419d('0x2c')](function(_0x78305d){_0x30106f=_0x78305d;return getUser(_0x552f0c,_0x4f6072[_0x419d('0x10')],_0x30106f);})[_0x419d('0x2c')](function(_0x3c749c){_0x437e45=_0x3c749c;logger['info']('The\x20User\x20ID\x20is:',_0x437e45['id']);return getEndUser(_0x552f0c,_0xd3b511[_0x419d('0x5b')],_0xd3b511['calleridnum'],_0x30106f);})[_0x419d('0x2c')](function(_0x3fbcb4){_0x214cdd=_0x3fbcb4;logger[_0x419d('0x29')]('The\x20Enduser\x20ID\x20is:',_0x214cdd['id']);return getTicket(_0x552f0c,_0x437e45,_0x214cdd,_0x4fdff5,_0xd3b511,_0x4fdff5[_0x419d('0x5c')],_0x30106f,'Inbound');})['then'](function(_0x175720){_0x5a38a7=_0x175720;logger[_0x419d('0x29')](_0x419d('0x5d'));logger[_0x419d('0x29')](_0x419d('0x5e'),_0x5a38a7['id']);return setRelationship(_0x30106f,_0x437e45,_0x5a38a7,_0x419d('0x5f'));})['then'](function(){return setRelationship(_0x30106f,_0x214cdd,_0x5a38a7,_0x419d('0x60'));})[_0x419d('0x2c')](function(){return getServerInfo(_0x30106f);})[_0x419d('0x2c')](function(_0x41da39){var _0xcbc978=parseInt(_0x41da39[_0x419d('0x61')][_0x419d('0x62')](0x0));var _0x5df3d8=util[_0x419d('0x24')](_0x419d('0x63'),_0x552f0c['remoteUri'],_0x5a38a7['id']);if(_0xcbc978>0x6){_0x5df3d8=util[_0x419d('0x24')](_0x419d('0x64'),_0x552f0c[_0x419d('0x54')],_0x5a38a7['id']);}logger['info'](_0x419d('0x65'),_0x419d('0x66'));emit(util['format'](_0x419d('0x67'),_0x4f6072['name']),'trigger:browser:url',{'uri':_0x5df3d8});})[_0x419d('0x68')](function(_0x3b991c){logger[_0x419d('0x69')](_0x419d('0x65'),JSON[_0x419d('0x22')](_0x3b991c));});};exports[_0x419d('0x6a')]=function(_0x433f41,_0x2611a4,_0x2af929,_0x24b97b,_0x23944d,_0x414fce,_0xbccdde){var _0x29ea53,_0x38b9aa,_0x245018,_0xea5d2;_0x414fce[_0x419d('0x54')]=intUtil[_0x419d('0x53')](_0x414fce[_0x419d('0x54')]);_0x414fce[_0x419d('0x55')]=intUtil[_0x419d('0x53')](_0x414fce[_0x419d('0x55')]);def[_0x419d('0x6b')]=util[_0x419d('0x24')](_0x419d('0x56'),_0x414fce[_0x419d('0x54')]);if(_0xbccdde&&_0xbccdde[_0x419d('0x6c')]&&_0xbccdde[_0x419d('0x6c')]!==_0x419d('0x6d')){logger[_0x419d('0x29')](_0x419d('0x6e'),_0x419d('0x58'));_0x2611a4[_0x419d('0x59')]=util[_0x419d('0x24')](_0x419d('0x6f'),_0x414fce[_0x419d('0x55')],_0x2611a4['uniqueid'],md5(_0x2611a4[_0x419d('0x5a')]));}return getConnection(_0x414fce)[_0x419d('0x2c')](function(_0x7d92fb){_0xea5d2=_0x7d92fb;return getUser(_0x414fce,_0x24b97b['name'],_0xea5d2);})[_0x419d('0x2c')](function(_0x2edd3d){_0x29ea53=_0x2edd3d;logger[_0x419d('0x29')](_0x419d('0x70'),_0x29ea53['id']);return getEndUser(_0x414fce,_0x2611a4[_0x419d('0x71')],_0x2611a4['destcalleridnum'],_0xea5d2);})[_0x419d('0x2c')](function(_0x2c627b){_0x38b9aa=_0x2c627b;logger['info'](_0x419d('0x72'),_0x38b9aa['id']);return getTicket(_0x414fce,_0x29ea53,_0x38b9aa,_0x2af929,_0x2611a4,_0x2af929['Fields'],_0xea5d2,'Outbound');})[_0x419d('0x2c')](function(_0x5d347c){_0x245018=_0x5d347c;logger['info'](_0x419d('0x5d'));logger[_0x419d('0x29')](_0x419d('0x5e'),_0x245018['id']);return setRelationship(_0xea5d2,_0x29ea53,_0x245018,'users');})[_0x419d('0x2c')](function(){return setRelationship(_0xea5d2,_0x38b9aa,_0x245018,'contacts');})[_0x419d('0x2c')](function(){return getServerInfo(_0xea5d2);})['then'](function(_0x597a71){var _0x2eeb34=parseInt(_0x597a71[_0x419d('0x61')]['charAt'](0x0));var _0x52975c=util[_0x419d('0x24')](_0x419d('0x63'),_0x414fce[_0x419d('0x54')],_0x245018['id']);if(_0x2eeb34>0x6){_0x52975c=util['format'](_0x419d('0x64'),_0x414fce[_0x419d('0x54')],_0x245018['id']);}logger[_0x419d('0x29')](_0x419d('0x6e'),_0x419d('0x66'));emit(util['format']('user:%s',_0x24b97b[_0x419d('0x10')]),_0x419d('0x73'),{'uri':_0x52975c});})['catch'](function(_0x468d8f){logger[_0x419d('0x69')](_0x419d('0x6e'),JSON[_0x419d('0x22')](_0x468d8f));});};exports['unmanaged']=function(_0x83a5a3,_0x3dac9c,_0x504b68,_0x1eb106,_0x36db71,_0xd414b8){var _0x24c635,_0x5a8cbb,_0x450299,_0x529cc3;_0xd414b8['remoteUri']=intUtil[_0x419d('0x53')](_0xd414b8[_0x419d('0x54')]);_0xd414b8[_0x419d('0x55')]=intUtil['stripTrailingSlash'](_0xd414b8[_0x419d('0x55')]);def[_0x419d('0x6b')]=util['format']('%s/service/v4_1/rest.php',_0xd414b8[_0x419d('0x54')]);if(_0x36db71&&_0x36db71[_0x419d('0x57')]){logger[_0x419d('0x29')]('['+_0x3dac9c[_0x419d('0x74')]['toUpperCase']()+']',_0x419d('0x58'));_0x3dac9c[_0x419d('0x59')]=util['format'](_0x419d('0x6f'),_0xd414b8[_0x419d('0x55')],_0x3dac9c[_0x419d('0x5a')],md5(_0x3dac9c[_0x419d('0x5a')]));}else{_0x3dac9c[_0x419d('0x59')]='';}return getConnection(_0xd414b8)[_0x419d('0x2c')](function(_0x4c6b43){_0x529cc3=_0x4c6b43;if(!_[_0x419d('0x28')](_0x1eb106)){return getUser(_0xd414b8,_0x1eb106['name'],_0x529cc3);}else{return getUser(_0xd414b8,null,_0x529cc3);}})['then'](function(_0x2eb7fa){_0x24c635=_0x2eb7fa;logger[_0x419d('0x29')](_0x419d('0x70'),_0x24c635['id']);return getEndUser(_0xd414b8,_0x3dac9c['calleridname'],_0x3dac9c[_0x419d('0x75')],_0x529cc3);})[_0x419d('0x2c')](function(_0x1081c3){_0x5a8cbb=_0x1081c3;logger[_0x419d('0x29')](_0x419d('0x72'),_0x5a8cbb['id']);return getTicket(_0xd414b8,_0x24c635,_0x5a8cbb,_0x504b68,_0x3dac9c,_0x504b68['Fields'],_0x529cc3,_0x419d('0x76'));})[_0x419d('0x2c')](function(_0x83ae4b){_0x450299=_0x83ae4b;logger['info'](_0x419d('0x5d'));logger['info'](_0x419d('0x5e'),_0x450299['id']);return setRelationship(_0x529cc3,_0x24c635,_0x450299,_0x419d('0x5f'));})[_0x419d('0x2c')](function(){return setRelationship(_0x529cc3,_0x5a8cbb,_0x450299,_0x419d('0x60'));})[_0x419d('0x2c')](function(){return getServerInfo(_0x529cc3);})['catch'](function(_0x20d1ae){logger[_0x419d('0x69')]('['+_0x3dac9c[_0x419d('0x74')][_0x419d('0x77')]()+']',JSON[_0x419d('0x22')](_0x20d1ae));});}; \ No newline at end of file +var _0xa000=['Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','toString','variable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','version','[OUTBOUND]','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','POST','info','Creating\x20new\x20ticket...','name','Subjects','description','getString','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','get_entry_list','stringify','Employees','user_name','then','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!',''];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xa000,0xb2));var _0x0a00=function(_0x1e73b6,_0x130c23){_0x1e73b6=_0x1e73b6-0x0;var _0x527157=_0xa000[_0x1e73b6];return _0x527157;};'use strict';var _=require(_0x0a00('0x0'));var rp=require(_0x0a00('0x1'));var BPromise=require(_0x0a00('0x2'));var md5=require(_0x0a00('0x3'));var util=require(_0x0a00('0x4'));var Redis=require('ioredis');var intUtil=require(_0x0a00('0x5'));var config=require(_0x0a00('0x6'));var logger=require(_0x0a00('0x7'))('sugarcrm');config[_0x0a00('0x8')]=_[_0x0a00('0x9')](config[_0x0a00('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a00('0x8')]));var def={'method':_0x0a00('0xa'),'json':!![]};function emit(_0x41303b,_0x310618,_0x36f2b2){io['to'](_0x41303b)['emit'](_0x310618,_0x36f2b2);}function getTicket(_0x46ffe7,_0x371f36,_0x29c68e,_0x8a3d7f,_0x459c9f,_0x55f83b,_0x1607fe,_0x4a2c20){logger[_0x0a00('0xb')](_0x0a00('0xc'));var _0x305d06=new Date();var _0x565430=[{'name':_0x0a00('0xd'),'value':intUtil['getString'](_0x8a3d7f[_0x0a00('0xe')],_0x459c9f,'\x20')},{'name':'assigned_user_id','value':_0x371f36['id']},{'name':'created_by','value':_0x371f36['id']},{'name':_0x0a00('0xf'),'value':intUtil[_0x0a00('0x10')](_0x8a3d7f[_0x0a00('0x11')],_0x459c9f,'\x0a')},{'name':'date_start','value':_0x305d06[_0x0a00('0x12')]()[_0x0a00('0x13')](0x0,0x13)[_0x0a00('0x14')]('T','\x20')},{'name':_0x0a00('0x15'),'value':'0'},{'name':_0x0a00('0x16'),'value':'15'},{'name':'parent_id','value':_0x29c68e['id']},{'name':_0x0a00('0x17'),'value':'Contacts'},{'name':_0x0a00('0x18'),'value':_0x29c68e[_0x0a00('0xd')]},{'name':_0x0a00('0x19'),'value':_0x4a2c20}];if(_0x55f83b[_0x0a00('0x1a')]){_[_0x0a00('0x1b')](_0x55f83b,function(_0x48e22d){if(_0x459c9f[_0x48e22d[_0x0a00('0x1c')]]){_0x565430[_0x0a00('0x1d')]({'name':_0x48e22d[_0x0a00('0x1e')],'value':_0x459c9f[_0x48e22d[_0x0a00('0x1c')]]});}});}return request({'form':{'method':_0x0a00('0x1f'),'input_type':_0x0a00('0x20'),'response_type':_0x0a00('0x20'),'rest_data':JSON['stringify']({'session':_0x1607fe['id'],'module_name':'Calls','name_value_list':_0x565430})}});}function getAuth(_0x1c0fc5){return util[_0x0a00('0x21')](_0x0a00('0x22'),new Buffer(_0x1c0fc5[_0x0a00('0x23')]+':X')['toString'](_0x0a00('0x24')));}function getServerInfo(_0x5e5038){return request({'form':{'method':_0x0a00('0x25'),'input_type':_0x0a00('0x20'),'response_type':_0x0a00('0x20'),'rest_data':JSON['stringify']({'session':_0x5e5038['id']})}});}function getUser(_0x3e3734,_0x16c9f9,_0x372e9b){if(!_[_0x0a00('0x26')](_0x16c9f9)){logger[_0x0a00('0xb')]('Getting\x20agent\x20with\x20name',_0x16c9f9);return request({'form':{'method':_0x0a00('0x27'),'input_type':_0x0a00('0x20'),'response_type':'JSON','rest_data':JSON[_0x0a00('0x28')]({'session':_0x372e9b['id'],'module_name':_0x0a00('0x29'),'query':util[_0x0a00('0x21')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x16c9f9),'order_by':'','offset':'0','select_fields':['id',_0x0a00('0xd'),_0x0a00('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0a00('0x2b')](function(_0x520ffd){if(_0x520ffd[_0x0a00('0x2c')][_0x0a00('0x1a')]){var _0x5060c2=_[_0x0a00('0x2d')](_0x520ffd[_0x0a00('0x2c')],function(_0x47133a){return _0x47133a['name_value_list'][_0x0a00('0x2a')][_0x0a00('0x2e')]===_0x16c9f9;});if(_0x5060c2){logger[_0x0a00('0xb')]('Agent\x20found!');return BPromise[_0x0a00('0x2f')]({'id':_0x5060c2[_0x0a00('0x30')]['id'][_0x0a00('0x2e')],'name':_0x5060c2[_0x0a00('0x30')][_0x0a00('0xd')][_0x0a00('0x2e')]});}}logger['info'](_0x0a00('0x31'));return BPromise[_0x0a00('0x2f')]({'id':_0x372e9b['name_value_list'][_0x0a00('0x32')][_0x0a00('0x2e')],'name':_0x372e9b[_0x0a00('0x30')]['user_name'][_0x0a00('0x2e')]});});}else{logger[_0x0a00('0xb')](_0x0a00('0x33'));return BPromise[_0x0a00('0x2f')]({'id':_0x372e9b[_0x0a00('0x30')][_0x0a00('0x32')]['value'],'name':_0x372e9b[_0x0a00('0x30')]['user_name'][_0x0a00('0x2e')]});}}function getEndUser(_0x1a8d67,_0x134bff,_0x4356bd,_0x373f4e){logger[_0x0a00('0xb')](_0x0a00('0x34'),_0x4356bd);return request({'form':{'method':_0x0a00('0x27'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x373f4e['id'],'module_name':_0x0a00('0x35'),'query':util['format'](_0x0a00('0x36'),_0x4356bd),'order_by':'','offset':'0','select_fields':['id',_0x0a00('0xd'),_0x0a00('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0a00('0x2b')](function(_0x252c90){if(_0x252c90[_0x0a00('0x2c')][_0x0a00('0x1a')]){var _0x168968=_['find'](_0x252c90[_0x0a00('0x2c')],function(_0x21bb22){return _0x21bb22[_0x0a00('0x30')][_0x0a00('0x37')][_0x0a00('0x2e')]===_0x4356bd;});if(_0x168968){logger[_0x0a00('0xb')](_0x0a00('0x38'));return BPromise['resolve']({'id':_0x168968[_0x0a00('0x30')]['id']['value'],'name':_0x168968['name_value_list'][_0x0a00('0xd')]['value'],'phone':_0x168968[_0x0a00('0x30')]['phone_home'][_0x0a00('0x2e')]});}}else{logger[_0x0a00('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x0a00('0x20'),'rest_data':JSON[_0x0a00('0x28')]({'session':_0x373f4e['id'],'module_name':_0x0a00('0x35'),'name_value_list':[{'name':'first_name','value':_0x134bff!==_0x0a00('0x39')?_0x134bff:util['format'](_0x0a00('0x3a'),_0x4356bd)},{'name':_0x0a00('0x37'),'value':_0x4356bd}]})}})[_0x0a00('0x2b')](function(_0x517483){logger[_0x0a00('0xb')](_0x0a00('0x3b'));return BPromise[_0x0a00('0x2f')]({'id':_0x517483['id'],'name':_0x517483['entry_list'][_0x0a00('0x3c')]['value'],'phone':_0x517483['entry_list'][_0x0a00('0x37')][_0x0a00('0x2e')]});});}});}function request(_0x1d2af6){logger[_0x0a00('0x3d')]('[HTTP]',JSON[_0x0a00('0x28')](_0x1d2af6));return rp(_[_0x0a00('0x3e')](def,_0x1d2af6));}function getTags(_0x4f3c3d,_0x27959b){var _0x34bda5=[];if(_0x4f3c3d&&_0x4f3c3d[_0x0a00('0x1a')]>0x0){_0x34bda5=_[_0x0a00('0x3f')](_0x4f3c3d,_0x27959b);}return _0x34bda5;}function getCustomFields(_0x4fecc9,_0xb6ff28){var _0x18fb07=[];var _0x159fe3={'custom_fields':[]};if(_0x4fecc9['length']>0x0){_[_0x0a00('0x1b')](_0x4fecc9,function(_0x57a0d0){if(_0x57a0d0[_0x0a00('0x40')]===_0x0a00('0x41')&&_0x57a0d0[_0x0a00('0x42')]&&!_0x57a0d0[_0x0a00('0x43')]){_0x159fe3[_0x57a0d0['nameField'][_0x0a00('0x44')]()]=_0x57a0d0[_0x0a00('0x45')]['toString']();}else if(_0x57a0d0[_0x0a00('0x40')]==='string'&&_0x57a0d0[_0x0a00('0x1e')]&&_0x57a0d0[_0x0a00('0x43')]){_0x159fe3[_0x0a00('0x46')][_0x0a00('0x1d')]({'id':_0x57a0d0[_0x0a00('0x1e')],'value':_0x57a0d0[_0x0a00('0x45')][_0x0a00('0x47')]()});}else if(_0x57a0d0['type']===_0x0a00('0x48')&&_0x57a0d0[_0x0a00('0x1c')]&&_0x57a0d0['idField']&&_0x57a0d0[_0x0a00('0x43')]){_0xb6ff28[_0x57a0d0[_0x0a00('0x1c')]]&&_0x159fe3[_0x0a00('0x46')][_0x0a00('0x1d')]({'id':_0x57a0d0[_0x0a00('0x1e')],'value':_0xb6ff28[_0x57a0d0[_0x0a00('0x1c')]]['toString']()});}else if(_0x57a0d0[_0x0a00('0x40')]==='customVariable'&&_0x57a0d0[_0x0a00('0x49')]&&_0x57a0d0[_0x0a00('0x49')][_0x0a00('0xd')]&&_0x57a0d0['idField']&&_0x57a0d0[_0x0a00('0x43')]){_0xb6ff28[_0x57a0d0[_0x0a00('0x49')][_0x0a00('0xd')]['toLowerCase']()]&&_0x159fe3[_0x0a00('0x46')][_0x0a00('0x1d')]({'id':_0x57a0d0[_0x0a00('0x1e')],'value':_0xb6ff28[_0x57a0d0[_0x0a00('0x49')][_0x0a00('0xd')]['toLowerCase']()][_0x0a00('0x47')]()});}});}return _0x159fe3;}function getConnection(_0x34cd19){return request({'method':_0x0a00('0xa'),'form':{'method':_0x0a00('0x4a'),'input_type':_0x0a00('0x20'),'response_type':'JSON','rest_data':JSON[_0x0a00('0x28')]({'user_auth':{'user_name':_0x34cd19[_0x0a00('0x4b')],'password':_0x34cd19[_0x0a00('0x4c')],'encryption':_0x0a00('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x0a00('0x2b')](function(_0x461d03){var _0x47982f=_0x461d03;if(_0x47982f['id']){def[_0x0a00('0x4e')]=_0x47982f['id'];return BPromise['resolve'](_0x47982f);}else{throw new Error(util[_0x0a00('0x21')](_0x0a00('0x4f'),_0x34cd19['id']));}});}function setRelationship(_0x52fe33,_0x1221f0,_0x4637f8,_0x1d26e8){return request({'form':{'method':_0x0a00('0x50'),'input_type':'JSON','response_type':_0x0a00('0x20'),'rest_data':JSON[_0x0a00('0x28')]({'session':_0x52fe33['id'],'module_name':'Calls','module_id':_0x4637f8['id'],'link_field_name':_0x1d26e8,'related_ids':[_0x1221f0['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3dc8ca,_0x28c07c,_0x3fb713,_0xd45ca8,_0x1ce3c7,_0x27bdeb){var _0x55aa3e,_0x30afc5,_0xa42578,_0x23810f;_0x27bdeb[_0x0a00('0x51')]=intUtil['stripTrailingSlash'](_0x27bdeb[_0x0a00('0x51')]);_0x27bdeb[_0x0a00('0x52')]=intUtil[_0x0a00('0x53')](_0x27bdeb[_0x0a00('0x52')]);def['uri']=util['format'](_0x0a00('0x54'),_0x27bdeb[_0x0a00('0x51')]);if(_0x1ce3c7&&_0x1ce3c7[_0x0a00('0x55')]){logger['info'](_0x0a00('0x56'),_0x0a00('0x57'));_0x28c07c[_0x0a00('0x58')]=util[_0x0a00('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27bdeb[_0x0a00('0x52')],_0x28c07c['uniqueid'],md5(_0x28c07c[_0x0a00('0x59')]));}else{_0x28c07c[_0x0a00('0x58')]='';}return getConnection(_0x27bdeb)[_0x0a00('0x2b')](function(_0x2dfa87){_0x23810f=_0x2dfa87;return getUser(_0x27bdeb,_0xd45ca8[_0x0a00('0xd')],_0x23810f);})[_0x0a00('0x2b')](function(_0x2dada3){_0x55aa3e=_0x2dada3;logger[_0x0a00('0xb')]('The\x20User\x20ID\x20is:',_0x55aa3e['id']);return getEndUser(_0x27bdeb,_0x28c07c[_0x0a00('0x5a')],_0x28c07c['calleridnum'],_0x23810f);})[_0x0a00('0x2b')](function(_0x46aca7){_0x30afc5=_0x46aca7;logger[_0x0a00('0xb')](_0x0a00('0x5b'),_0x30afc5['id']);return getTicket(_0x27bdeb,_0x55aa3e,_0x30afc5,_0x3fb713,_0x28c07c,_0x3fb713[_0x0a00('0x5c')],_0x23810f,_0x0a00('0x5d'));})[_0x0a00('0x2b')](function(_0x23616c){_0xa42578=_0x23616c;logger[_0x0a00('0xb')](_0x0a00('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xa42578['id']);return setRelationship(_0x23810f,_0x55aa3e,_0xa42578,_0x0a00('0x5f'));})[_0x0a00('0x2b')](function(){return setRelationship(_0x23810f,_0x30afc5,_0xa42578,_0x0a00('0x60'));})[_0x0a00('0x2b')](function(){return getServerInfo(_0x23810f);})[_0x0a00('0x2b')](function(_0x2e5505){var _0x5932d3=parseInt(_0x2e5505['version'][_0x0a00('0x61')](0x0));var _0x10928c=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x27bdeb[_0x0a00('0x51')],_0xa42578['id']);if(_0x5932d3>0x6){_0x10928c=util['format'](_0x0a00('0x62'),_0x27bdeb[_0x0a00('0x51')],_0xa42578['id']);}logger['info'](_0x0a00('0x56'),_0x0a00('0x63'));emit(util[_0x0a00('0x21')](_0x0a00('0x64'),_0xd45ca8[_0x0a00('0xd')]),_0x0a00('0x65'),{'uri':_0x10928c});})[_0x0a00('0x66')](function(_0x43389c){logger[_0x0a00('0x67')]('[QUEUE]',JSON[_0x0a00('0x28')](_0x43389c));});};exports[_0x0a00('0x68')]=function(_0x61bc09,_0xecaaa6,_0x46a815,_0x5273a1,_0x48b971,_0x2ac317,_0x4aee19){var _0x980853,_0x4dd640,_0x475824,_0x334c00;_0x2ac317[_0x0a00('0x51')]=intUtil['stripTrailingSlash'](_0x2ac317[_0x0a00('0x51')]);_0x2ac317['serverUrl']=intUtil[_0x0a00('0x53')](_0x2ac317[_0x0a00('0x52')]);def[_0x0a00('0x69')]=util[_0x0a00('0x21')](_0x0a00('0x54'),_0x2ac317[_0x0a00('0x51')]);if(_0x4aee19&&_0x4aee19[_0x0a00('0x6a')]&&_0x4aee19[_0x0a00('0x6a')]!==_0x0a00('0x6b')){logger[_0x0a00('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xecaaa6['recordingURL']=util['format'](_0x0a00('0x6c'),_0x2ac317[_0x0a00('0x52')],_0xecaaa6[_0x0a00('0x59')],md5(_0xecaaa6['uniqueid']));}return getConnection(_0x2ac317)[_0x0a00('0x2b')](function(_0x435d48){_0x334c00=_0x435d48;return getUser(_0x2ac317,_0x5273a1[_0x0a00('0xd')],_0x334c00);})[_0x0a00('0x2b')](function(_0x48dfe6){_0x980853=_0x48dfe6;logger['info']('The\x20User\x20ID\x20is:',_0x980853['id']);return getEndUser(_0x2ac317,_0xecaaa6[_0x0a00('0x6d')],_0xecaaa6[_0x0a00('0x6e')],_0x334c00);})[_0x0a00('0x2b')](function(_0x2351ec){_0x4dd640=_0x2351ec;logger['info'](_0x0a00('0x5b'),_0x4dd640['id']);return getTicket(_0x2ac317,_0x980853,_0x4dd640,_0x46a815,_0xecaaa6,_0x46a815[_0x0a00('0x5c')],_0x334c00,_0x0a00('0x6f'));})[_0x0a00('0x2b')](function(_0x28c598){_0x475824=_0x28c598;logger[_0x0a00('0xb')](_0x0a00('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x475824['id']);return setRelationship(_0x334c00,_0x980853,_0x475824,'users');})[_0x0a00('0x2b')](function(){return setRelationship(_0x334c00,_0x4dd640,_0x475824,_0x0a00('0x60'));})['then'](function(){return getServerInfo(_0x334c00);})[_0x0a00('0x2b')](function(_0xcc0888){var _0x3a3ec3=parseInt(_0xcc0888[_0x0a00('0x70')][_0x0a00('0x61')](0x0));var _0xf95de9=util[_0x0a00('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2ac317['remoteUri'],_0x475824['id']);if(_0x3a3ec3>0x6){_0xf95de9=util[_0x0a00('0x21')](_0x0a00('0x62'),_0x2ac317[_0x0a00('0x51')],_0x475824['id']);}logger[_0x0a00('0xb')](_0x0a00('0x71'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0a00('0x21')](_0x0a00('0x64'),_0x5273a1['name']),_0x0a00('0x65'),{'uri':_0xf95de9});})[_0x0a00('0x66')](function(_0x2d29ed){logger['error'](_0x0a00('0x71'),JSON[_0x0a00('0x28')](_0x2d29ed));});};exports[_0x0a00('0x72')]=function(_0x2a2fd8,_0x2a723d,_0xfeb571,_0x596c83,_0x226385,_0x32771c){var _0xfd95f9,_0x2f03b8,_0x595f35,_0xa34299;_0x32771c[_0x0a00('0x51')]=intUtil[_0x0a00('0x53')](_0x32771c[_0x0a00('0x51')]);_0x32771c[_0x0a00('0x52')]=intUtil[_0x0a00('0x53')](_0x32771c['serverUrl']);def[_0x0a00('0x69')]=util[_0x0a00('0x21')](_0x0a00('0x54'),_0x32771c['remoteUri']);if(_0x226385&&_0x226385[_0x0a00('0x55')]){logger[_0x0a00('0xb')]('['+_0x2a723d[_0x0a00('0x73')][_0x0a00('0x74')]()+']',_0x0a00('0x57'));_0x2a723d[_0x0a00('0x58')]=util[_0x0a00('0x21')](_0x0a00('0x6c'),_0x32771c[_0x0a00('0x52')],_0x2a723d['uniqueid'],md5(_0x2a723d[_0x0a00('0x59')]));}else{_0x2a723d[_0x0a00('0x58')]='';}return getConnection(_0x32771c)[_0x0a00('0x2b')](function(_0x50e21d){_0xa34299=_0x50e21d;if(!_[_0x0a00('0x26')](_0x596c83)){return getUser(_0x32771c,_0x596c83['name'],_0xa34299);}else{return getUser(_0x32771c,null,_0xa34299);}})['then'](function(_0x5064cc){_0xfd95f9=_0x5064cc;logger[_0x0a00('0xb')]('The\x20User\x20ID\x20is:',_0xfd95f9['id']);return getEndUser(_0x32771c,_0x2a723d[_0x0a00('0x5a')],_0x2a723d['calleridnum'],_0xa34299);})[_0x0a00('0x2b')](function(_0x35f820){_0x2f03b8=_0x35f820;logger['info'](_0x0a00('0x5b'),_0x2f03b8['id']);return getTicket(_0x32771c,_0xfd95f9,_0x2f03b8,_0xfeb571,_0x2a723d,_0xfeb571[_0x0a00('0x5c')],_0xa34299,_0x0a00('0x5d'));})[_0x0a00('0x2b')](function(_0x325ae0){_0x595f35=_0x325ae0;logger['info'](_0x0a00('0x5e'));logger[_0x0a00('0xb')](_0x0a00('0x75'),_0x595f35['id']);return setRelationship(_0xa34299,_0xfd95f9,_0x595f35,'users');})[_0x0a00('0x2b')](function(){return setRelationship(_0xa34299,_0x2f03b8,_0x595f35,'contacts');})[_0x0a00('0x2b')](function(){return getServerInfo(_0xa34299);})[_0x0a00('0x66')](function(_0x1c33b1){logger['error']('['+_0x2a723d[_0x0a00('0x73')][_0x0a00('0x74')]()+']',JSON[_0x0a00('0x28')](_0x1c33b1));});}; \ 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 f8ffab8..b79bfc4 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 _0xe46b=['length','sortBy','type','string','content','variableName','customVariable','Variable','name','toLowerCase','push','keyValue','keyType','key','keyContent','variable','format','%s:\x20%s','substring','lastIndexOf','validateEmail','test','lodash','util'];(function(_0x2679a3,_0x5ebce8){var _0x2df3d8=function(_0x4c612b){while(--_0x4c612b){_0x2679a3['push'](_0x2679a3['shift']());}};_0x2df3d8(++_0x5ebce8);}(_0xe46b,0x76));var _0xbe46=function(_0x46c0e9,_0x36d816){_0x46c0e9=_0x46c0e9-0x0;var _0x20f897=_0xe46b[_0x46c0e9];return _0x20f897;};'use strict';var _=require(_0xbe46('0x0'));var util=require(_0xbe46('0x1'));exports['getString']=function(_0x368c55,_0x4e2275,_0x4c8627){var _0x52517a=[];if(_0x368c55[_0xbe46('0x2')]>0x0){var _0x2210c4=_[_0xbe46('0x3')](_0x368c55,['id']);for(var _0x47fd5f=0x0;_0x47fd5f<_0x2210c4[_0xbe46('0x2')];_0x47fd5f++){var _0x26ceca=_0x2210c4[_0x47fd5f];if(_0x26ceca[_0xbe46('0x4')]===_0xbe46('0x5')){_0x52517a['push'](_0x26ceca[_0xbe46('0x6')]);}else if(_0x26ceca['type']==='variable'&&_0x26ceca[_0xbe46('0x7')]){_0x4e2275[_0x26ceca[_0xbe46('0x7')]]&&_0x52517a['push'](_0x4e2275[_0x26ceca['variableName']]['toString']());}else if(_0x26ceca[_0xbe46('0x4')]===_0xbe46('0x8')&&_0x26ceca[_0xbe46('0x9')]&&_0x26ceca[_0xbe46('0x9')][_0xbe46('0xa')]){_0x4e2275[_0x26ceca['Variable'][_0xbe46('0xa')][_0xbe46('0xb')]()]&&_0x52517a[_0xbe46('0xc')](_0x4e2275[_0x26ceca[_0xbe46('0x9')][_0xbe46('0xa')][_0xbe46('0xb')]()]['toString']());}else if(_0x26ceca[_0xbe46('0x4')]===_0xbe46('0xd')){if(_0x26ceca[_0xbe46('0xe')]===_0xbe46('0x5')&&_0x26ceca[_0xbe46('0xf')]){_0x52517a[_0xbe46('0xc')](util['format']('%s:\x20%s',_0x26ceca['key'],_0x26ceca[_0xbe46('0x10')]));}else if(_0x26ceca[_0xbe46('0xe')]===_0xbe46('0x11')&&_0x26ceca[_0xbe46('0x7')]&&_0x26ceca[_0xbe46('0xf')]){_0x4e2275[_0x26ceca[_0xbe46('0x7')]]&&_0x52517a[_0xbe46('0xc')](util[_0xbe46('0x12')]('%s:\x20%s',_0x26ceca[_0xbe46('0xf')],_0x4e2275[_0x26ceca[_0xbe46('0x7')]]));}else if(_0x26ceca[_0xbe46('0xe')]==='customVariable'&&_0x26ceca[_0xbe46('0x9')]&&_0x26ceca[_0xbe46('0x9')][_0xbe46('0xa')]&&_0x26ceca[_0xbe46('0xf')]){_0x4e2275[_0x26ceca['Variable']['name']['toLowerCase']()]&&_0x52517a[_0xbe46('0xc')](util['format'](_0xbe46('0x13'),_0x26ceca['key'],_0x4e2275[_0x26ceca[_0xbe46('0x9')][_0xbe46('0xa')]['toLowerCase']()]));}}}}return _0x52517a['join'](_0x4c8627);};exports['stripTrailingSlash']=function(_0x34cabd){var _0x165cfe=_0x34cabd['slice'](-0x1);if(_0x165cfe==='/'){_0x34cabd=_0x34cabd[_0xbe46('0x14')](0x0,_0x34cabd[_0xbe46('0x15')](_0x165cfe));}return _0x34cabd;};exports[_0xbe46('0x16')]=function(_0x262cae){if(!_['isNil'](_0x262cae)&&_0x262cae!==''){var _0x3f5eca=/^(([^<>()\[\]\\.,;:\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 _0x3f5eca[_0xbe46('0x17')](String(_0x262cae)[_0xbe46('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x5019=['Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','slice','lastIndexOf','isNil','test','util','getString','length','sortBy','type','string','content','variable','variableName','push','toString','customVariable'];(function(_0x433f01,_0x4b8594){var _0x35c353=function(_0x53ef5d){while(--_0x53ef5d){_0x433f01['push'](_0x433f01['shift']());}};_0x35c353(++_0x4b8594);}(_0x5019,0x8a));var _0x9501=function(_0x52ecff,_0x2cba3a){_0x52ecff=_0x52ecff-0x0;var _0x1347b7=_0x5019[_0x52ecff];return _0x1347b7;};'use strict';var _=require('lodash');var util=require(_0x9501('0x0'));exports[_0x9501('0x1')]=function(_0x4470ff,_0x1a4032,_0x3a04ef){var _0x2da407=[];if(_0x4470ff[_0x9501('0x2')]>0x0){var _0x11c5aa=_[_0x9501('0x3')](_0x4470ff,['id']);for(var _0x48fe0c=0x0;_0x48fe0c<_0x11c5aa[_0x9501('0x2')];_0x48fe0c++){var _0x11b963=_0x11c5aa[_0x48fe0c];if(_0x11b963[_0x9501('0x4')]===_0x9501('0x5')){_0x2da407['push'](_0x11b963[_0x9501('0x6')]);}else if(_0x11b963[_0x9501('0x4')]===_0x9501('0x7')&&_0x11b963['variableName']){_0x1a4032[_0x11b963[_0x9501('0x8')]]&&_0x2da407[_0x9501('0x9')](_0x1a4032[_0x11b963[_0x9501('0x8')]][_0x9501('0xa')]());}else if(_0x11b963[_0x9501('0x4')]===_0x9501('0xb')&&_0x11b963[_0x9501('0xc')]&&_0x11b963['Variable'][_0x9501('0xd')]){_0x1a4032[_0x11b963[_0x9501('0xc')]['name'][_0x9501('0xe')]()]&&_0x2da407['push'](_0x1a4032[_0x11b963[_0x9501('0xc')][_0x9501('0xd')][_0x9501('0xe')]()][_0x9501('0xa')]());}else if(_0x11b963[_0x9501('0x4')]===_0x9501('0xf')){if(_0x11b963[_0x9501('0x10')]===_0x9501('0x5')&&_0x11b963[_0x9501('0x11')]){_0x2da407[_0x9501('0x9')](util[_0x9501('0x12')](_0x9501('0x13'),_0x11b963[_0x9501('0x11')],_0x11b963['keyContent']));}else if(_0x11b963[_0x9501('0x10')]===_0x9501('0x7')&&_0x11b963[_0x9501('0x8')]&&_0x11b963[_0x9501('0x11')]){_0x1a4032[_0x11b963['variableName']]&&_0x2da407[_0x9501('0x9')](util[_0x9501('0x12')]('%s:\x20%s',_0x11b963[_0x9501('0x11')],_0x1a4032[_0x11b963['variableName']]));}else if(_0x11b963['keyType']==='customVariable'&&_0x11b963[_0x9501('0xc')]&&_0x11b963[_0x9501('0xc')][_0x9501('0xd')]&&_0x11b963[_0x9501('0x11')]){_0x1a4032[_0x11b963['Variable'][_0x9501('0xd')][_0x9501('0xe')]()]&&_0x2da407[_0x9501('0x9')](util[_0x9501('0x12')](_0x9501('0x13'),_0x11b963[_0x9501('0x11')],_0x1a4032[_0x11b963[_0x9501('0xc')]['name'][_0x9501('0xe')]()]));}}}}return _0x2da407[_0x9501('0x14')](_0x3a04ef);};exports['stripTrailingSlash']=function(_0x4657ce){var _0x370cb7=_0x4657ce[_0x9501('0x15')](-0x1);if(_0x370cb7==='/'){_0x4657ce=_0x4657ce['substring'](0x0,_0x4657ce[_0x9501('0x16')](_0x370cb7));}return _0x4657ce;};exports['validateEmail']=function(_0xcecd35){if(!_[_0x9501('0x17')](_0xcecd35)&&_0xcecd35!==''){var _0x5bd52a=/^(([^<>()\[\]\\.,;:\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 _0x5bd52a[_0x9501('0x18')](String(_0xcecd35)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index ef13003..efbfc39 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x13baf8,_0x3c906a){var _0x5545d1=function(_0xa738e4){while(--_0xa738e4){_0x13baf8['push'](_0x13baf8['shift']());}};_0x5545d1(++_0x3c906a);}(_0xe706,0xa3));var _0x6e70=function(_0x1b40b5,_0x25e063){_0x1b40b5=_0x1b40b5-0x0;var _0x5f0a6e=_0xe706[_0x1b40b5];return _0x5f0a6e;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _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(_0x1d11af,_0x5e7156){var _0x41b1f2=function(_0x16c2f2){while(--_0x16c2f2){_0x1d11af['push'](_0x1d11af['shift']());}};_0x41b1f2(++_0x5e7156);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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 dedcf9c..d964273 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 _0xd6a0=['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','Recording\x20is\x20enabled!','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]','POST','newTab','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','format','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','end-user','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','stringify','defaults','GET','map','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json'];(function(_0x3d675a,_0x1e141e){var _0x43399e=function(_0x1c10a0){while(--_0x1c10a0){_0x3d675a['push'](_0x3d675a['shift']());}};_0x43399e(++_0x1e141e);}(_0xd6a0,0x164));var _0x0d6a=function(_0x22645d,_0x30cf98){_0x22645d=_0x22645d-0x0;var _0x548ee5=_0xd6a0[_0x22645d];return _0x548ee5;};'use strict';var _=require('lodash');var rp=require(_0x0d6a('0x0'));var md5=require(_0x0d6a('0x1'));var util=require(_0x0d6a('0x2'));var Redis=require(_0x0d6a('0x3'));var intUtil=require(_0x0d6a('0x4'));var config=require(_0x0d6a('0x5'));var logger=require(_0x0d6a('0x6'))(_0x0d6a('0x7'));config[_0x0d6a('0x8')]=_['defaults'](config['redis'],{'host':_0x0d6a('0x9'),'port':0x18eb});var io=require(_0x0d6a('0xa'))(new Redis(config[_0x0d6a('0x8')]));function emit(_0x457126,_0x1fbf12,_0x44baa6){io['to'](_0x457126)['emit'](_0x1fbf12,_0x44baa6);}var headers={'Content-Type':_0x0d6a('0xb'),'Accept':'application/json'};function getTicket(_0x481db7,_0x5cce3a,_0xd0a30a,_0xbe7a23,_0x3e095f){logger[_0x0d6a('0xc')](_0x0d6a('0xd'));return request({'uri':util['format'](_0x0d6a('0xe'),_0x481db7['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0xd0a30a['id'],'submitter_id':_0x5cce3a?_0x5cce3a['id']:undefined,'assignee_id':_0x5cce3a?_0x5cce3a['id']:undefined,'tags':getTags(_0xbe7a23['Tags'],_0x0d6a('0xf')),'subject':intUtil[_0x0d6a('0x10')](_0xbe7a23[_0x0d6a('0x11')],_0x3e095f,'\x20'),'description':intUtil[_0x0d6a('0x10')](_0xbe7a23[_0x0d6a('0x12')],_0x3e095f,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xbe7a23['Descriptions'],_0x3e095f,'\x0a')}},getCustomFields(_0xbe7a23[_0x0d6a('0x13')],_0x3e095f))}})[_0x0d6a('0x14')](function(_0x1b7339){logger[_0x0d6a('0xc')]('Ticket\x20created!');return _0x1b7339[_0x0d6a('0x15')];});}function getUser(_0x4b7c06,_0x5e7004){if(intUtil[_0x0d6a('0x16')](_0x5e7004)){logger[_0x0d6a('0xc')]('Getting\x20agent\x20with\x20email',_0x5e7004);return request({'uri':util[_0x0d6a('0x17')](_0x0d6a('0x18'),_0x4b7c06[_0x0d6a('0x19')]),'qs':{'query':util['format'](_0x0d6a('0x1a'),_0x5e7004)}})['then'](function(_0x452b19){if(_0x452b19[_0x0d6a('0x1b')]){logger['info']('Agent\x20found!');return _[_0x0d6a('0x1c')](_0x452b19['results'],{'email':_0x5e7004,'role':_0x0d6a('0x1d')});}else{logger[_0x0d6a('0xc')](_0x0d6a('0x1e'));return request({'uri':util['format'](_0x0d6a('0x1f'),_0x4b7c06[_0x0d6a('0x19')])})[_0x0d6a('0x14')](function(_0x595b25){logger[_0x0d6a('0xc')](_0x0d6a('0x20'));return _0x595b25[_0x0d6a('0x21')];});}});}else{logger[_0x0d6a('0xc')](_0x0d6a('0x1e'));return request({'uri':util[_0x0d6a('0x17')](_0x0d6a('0x1f'),_0x4b7c06['remoteUri'])})[_0x0d6a('0x14')](function(_0x443dbf){logger['info'](_0x0d6a('0x20'));return _0x443dbf[_0x0d6a('0x21')];});}}function getEndUser(_0x4e6632,_0x482200,_0x4722ab){logger['info'](_0x0d6a('0x22'),_0x4722ab);return request({'uri':util['format']('%s/search.json',_0x4e6632[_0x0d6a('0x19')]),'qs':{'query':util[_0x0d6a('0x17')](_0x0d6a('0x23'),_0x4722ab)}})['then'](function(_0x359ab5){var _0x136509;if(_0x359ab5[_0x0d6a('0x24')]['length']){_0x359ab5['results']=_['filter'](_0x359ab5['results'],{'suspended':![],'role':_0x0d6a('0x25')});if(_0x359ab5[_0x0d6a('0x24')]['length']){_0x136509=_['first'](_0x359ab5[_0x0d6a('0x24')]);}}if(_0x136509){logger['info'](_0x0d6a('0x26'));return _0x136509;}else{logger[_0x0d6a('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x0d6a('0x17')](_0x0d6a('0x27'),_0x4e6632[_0x0d6a('0x19')]),'method':'POST','body':{'user':{'role':_0x0d6a('0x25'),'name':util[_0x0d6a('0x17')](_0x0d6a('0x28'),_0x482200||_0x4722ab),'phone':_0x4722ab}}})[_0x0d6a('0x14')](function(_0x388519){logger[_0x0d6a('0xc')](_0x0d6a('0x29'));return _0x388519[_0x0d6a('0x21')];});}});}function getAuth(_0x244be2){var _0x49abfc;if(_0x244be2[_0x0d6a('0x2a')]===_0x0d6a('0x2b')){_0x49abfc=util[_0x0d6a('0x17')](_0x0d6a('0x2c'),_0x244be2[_0x0d6a('0x2d')],_0x244be2[_0x0d6a('0x2b')]);}else if(_0x244be2[_0x0d6a('0x2a')]===_0x0d6a('0x2e')){_0x49abfc=util['format'](_0x0d6a('0x2f'),_0x244be2[_0x0d6a('0x2d')],_0x244be2[_0x0d6a('0x2e')]);}return util[_0x0d6a('0x17')]('Basic\x20%s',new Buffer(_0x49abfc)[_0x0d6a('0x30')](_0x0d6a('0x31')));}function request(_0x601a20){logger[_0x0d6a('0x32')]('[HTTP]',JSON[_0x0d6a('0x33')](_0x601a20));return rp(_[_0x0d6a('0x34')](_0x601a20,{'method':_0x0d6a('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x5ba255,_0x37ca82){var _0x1f9184=[];if(_0x5ba255&&_0x5ba255['length']>0x0){_0x1f9184=_[_0x0d6a('0x36')](_0x5ba255,_0x37ca82);}return _0x1f9184;}function getCustomFields(_0x372db3,_0x1b4535){var _0xff144a=[];var _0x20a892={'custom_fields':[]};if(_0x372db3['length']>0x0){_['forEach'](_0x372db3,function(_0x4379ad){if(_[_0x0d6a('0x37')]([_0x0d6a('0x38'),'picklist'],_0x4379ad[_0x0d6a('0x39')])&&_0x4379ad[_0x0d6a('0x3a')]&&!_0x4379ad[_0x0d6a('0x3b')]){_0x20a892[_0x4379ad[_0x0d6a('0x3a')][_0x0d6a('0x3c')]()]=_0x4379ad[_0x0d6a('0x3d')][_0x0d6a('0x30')]();}else if(_['includes']([_0x0d6a('0x38'),_0x0d6a('0x3e')],_0x4379ad['type'])&&_0x4379ad[_0x0d6a('0x3f')]&&_0x4379ad[_0x0d6a('0x3b')]){_0x20a892[_0x0d6a('0x40')][_0x0d6a('0x41')]({'id':_0x4379ad[_0x0d6a('0x3f')],'value':_0x4379ad[_0x0d6a('0x3d')]['toString']()});}else if(_0x4379ad[_0x0d6a('0x39')]===_0x0d6a('0x42')&&_0x4379ad[_0x0d6a('0x43')]&&_0x4379ad['idField']&&_0x4379ad[_0x0d6a('0x3b')]){_0x1b4535[_0x4379ad[_0x0d6a('0x43')]]&&_0x20a892['custom_fields'][_0x0d6a('0x41')]({'id':_0x4379ad[_0x0d6a('0x3f')],'value':_0x1b4535[_0x4379ad[_0x0d6a('0x43')]][_0x0d6a('0x30')]()});}else if(_0x4379ad[_0x0d6a('0x39')]==='customVariable'&&_0x4379ad['Variable']&&_0x4379ad[_0x0d6a('0x44')][_0x0d6a('0xf')]&&_0x4379ad[_0x0d6a('0x3f')]&&_0x4379ad[_0x0d6a('0x3b')]){_0x1b4535[_0x4379ad['Variable'][_0x0d6a('0xf')][_0x0d6a('0x3c')]()]&&_0x20a892['custom_fields'][_0x0d6a('0x41')]({'id':_0x4379ad['idField'],'value':_0x1b4535[_0x4379ad[_0x0d6a('0x44')][_0x0d6a('0xf')][_0x0d6a('0x3c')]()][_0x0d6a('0x30')]()});}});}return _0x20a892;}exports[_0x0d6a('0x45')]=function(_0x7ad97,_0x43f726,_0x54320a,_0x953f3a,_0x4b2c70,_0x2d353e){var _0x5f00a6,_0x38db4b;_0x2d353e['remoteUri']=intUtil[_0x0d6a('0x46')](_0x2d353e['remoteUri']);_0x2d353e['serverUrl']=intUtil[_0x0d6a('0x46')](_0x2d353e[_0x0d6a('0x47')]);if(_0x4b2c70&&_0x4b2c70[_0x0d6a('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x43f726['recordingURL']=util[_0x0d6a('0x17')](_0x0d6a('0x49'),_0x2d353e['serverUrl'],_0x43f726[_0x0d6a('0x4a')],md5(_0x43f726['uniqueid']));}else{_0x43f726['recordingURL']='';}headers[_0x0d6a('0x4b')]=getAuth(_0x2d353e);return getUser(_0x2d353e,_0x953f3a[_0x0d6a('0x4c')])[_0x0d6a('0x14')](function(_0x515b1e){_0x5f00a6=_0x515b1e;logger[_0x0d6a('0xc')](_0x0d6a('0x4d'),_0x5f00a6['id']);return getEndUser(_0x2d353e,_0x43f726['calleridname'],_0x43f726['calleridnum']);})[_0x0d6a('0x14')](function(_0x21738a){_0x38db4b=_0x21738a;logger[_0x0d6a('0xc')](_0x0d6a('0x4e'),_0x38db4b['id']);return getTicket(_0x2d353e,_0x5f00a6,_0x38db4b,_0x54320a,_0x43f726);})[_0x0d6a('0x14')](function(_0xd91c74){if(_0xd91c74){logger[_0x0d6a('0xc')](_0x0d6a('0x4f'),_0xd91c74['id']);switch(_0x2d353e[_0x0d6a('0x39')]){case _0x0d6a('0x50'):logger[_0x0d6a('0xc')](_0x0d6a('0x51'),_0x0d6a('0x52'));return request({'uri':util['format'](_0x0d6a('0x53'),_0x2d353e[_0x0d6a('0x19')],_0x5f00a6['id'],_0xd91c74['id']),'method':'POST'});case'newTab':logger['info'](_0x0d6a('0x51'),_0x0d6a('0x54'));emit(util[_0x0d6a('0x17')](_0x0d6a('0x55'),_0x953f3a[_0x0d6a('0xf')]),_0x0d6a('0x56'),{'uri':util[_0x0d6a('0x17')](_0x0d6a('0x57'),_0x2d353e[_0x0d6a('0x19')][_0x0d6a('0x58')](_0x0d6a('0x59'),''),_0xd91c74['id'])});break;default:logger[_0x0d6a('0x5a')](_0x0d6a('0x51'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x0d6a('0x5b')](function(_0x4e8208){logger[_0x0d6a('0x5a')](_0x0d6a('0x5c'),util[_0x0d6a('0x5d')](_0x4e8208,{'showHidden':!![],'depth':null}));});};exports[_0x0d6a('0x5e')]=function(_0x31563c,_0x151c97,_0x17a397,_0x11cf21,_0x271de2,_0x34919e,_0x32f6b5){var _0x2c4937,_0x4f56b1;_0x34919e[_0x0d6a('0x19')]=intUtil['stripTrailingSlash'](_0x34919e[_0x0d6a('0x19')]);_0x34919e[_0x0d6a('0x47')]=intUtil[_0x0d6a('0x46')](_0x34919e[_0x0d6a('0x47')]);if(_0x32f6b5&&_0x32f6b5[_0x0d6a('0x5f')]&&_0x32f6b5['recordingFormat']!==_0x0d6a('0x60')){logger[_0x0d6a('0xc')]('[OUTBOUND]',_0x0d6a('0x61'));_0x151c97[_0x0d6a('0x62')]=util['format'](_0x0d6a('0x49'),_0x34919e[_0x0d6a('0x47')],_0x151c97[_0x0d6a('0x4a')],md5(_0x151c97[_0x0d6a('0x4a')]));}headers['Authorization']=getAuth(_0x34919e);return getUser(_0x34919e,_0x11cf21[_0x0d6a('0x4c')])[_0x0d6a('0x14')](function(_0x49fa62){_0x2c4937=_0x49fa62;logger['info'](_0x0d6a('0x4d'),_0x2c4937['id']);return getEndUser(_0x34919e,_0x151c97[_0x0d6a('0x63')],_0x151c97[_0x0d6a('0x64')]);})[_0x0d6a('0x14')](function(_0x32cdd7){_0x4f56b1=_0x32cdd7;logger[_0x0d6a('0xc')](_0x0d6a('0x4e'),_0x4f56b1['id']);return getTicket(_0x34919e,_0x2c4937,_0x4f56b1,_0x17a397,_0x151c97);})[_0x0d6a('0x14')](function(_0x4d598a){if(_0x4d598a){logger['info'](_0x0d6a('0x4f'),_0x4d598a['id']);switch(_0x34919e['type']){case'integrationTab':logger[_0x0d6a('0xc')](_0x0d6a('0x65'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x0d6a('0x17')](_0x0d6a('0x53'),_0x34919e[_0x0d6a('0x19')],_0x2c4937['id'],_0x4d598a['id']),'method':_0x0d6a('0x66')});case _0x0d6a('0x67'):logger[_0x0d6a('0xc')]('[OUTBOUND]',_0x0d6a('0x54'));emit(util[_0x0d6a('0x17')]('user:%s',_0x11cf21[_0x0d6a('0xf')]),'trigger:browser:url',{'uri':util['format'](_0x0d6a('0x57'),_0x34919e[_0x0d6a('0x19')][_0x0d6a('0x58')](_0x0d6a('0x59'),''),_0x4d598a['id'])});break;default:logger[_0x0d6a('0x5a')](_0x0d6a('0x65'),_0x0d6a('0x68'));}}})[_0x0d6a('0x5b')](function(_0x26c32c){logger[_0x0d6a('0x5a')](_0x0d6a('0x69'),util[_0x0d6a('0x5d')](_0x26c32c,{'showHidden':!![],'depth':null}));});};exports[_0x0d6a('0x6a')]=function(_0x54589e,_0x36ba67,_0xc9edec,_0x464ec1,_0x443ab9,_0x2c3a3d){var _0x32cd82,_0x6d12b3;_0x2c3a3d[_0x0d6a('0x19')]=intUtil['stripTrailingSlash'](_0x2c3a3d[_0x0d6a('0x19')]);_0x2c3a3d[_0x0d6a('0x47')]=intUtil[_0x0d6a('0x46')](_0x2c3a3d[_0x0d6a('0x47')]);if(_0x443ab9&&_0x443ab9['monitor_format']){logger['info']('['+_0x36ba67[_0x0d6a('0x6b')][_0x0d6a('0x6c')]()+']',_0x0d6a('0x61'));_0x36ba67[_0x0d6a('0x62')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c3a3d[_0x0d6a('0x47')],_0x36ba67[_0x0d6a('0x4a')],md5(_0x36ba67[_0x0d6a('0x4a')]));}else{_0x36ba67[_0x0d6a('0x62')]='';}headers['Authorization']=getAuth(_0x2c3a3d);return getUser(_0x2c3a3d)[_0x0d6a('0x14')](function(_0x5533b2){_0x32cd82=_0x5533b2;logger['info'](_0x0d6a('0x4d'),_0x32cd82['id']);return getEndUser(_0x2c3a3d,_0x36ba67[_0x0d6a('0x6d')],_0x36ba67['calleridnum']);})[_0x0d6a('0x14')](function(_0x4845d7){_0x6d12b3=_0x4845d7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x6d12b3['id']);return getTicket(_0x2c3a3d,_0x32cd82,_0x6d12b3,_0xc9edec,_0x36ba67);})['then'](function(_0x32bd23){if(_0x32bd23){logger[_0x0d6a('0xc')](_0x0d6a('0x4f'),_0x32bd23['id']);}})[_0x0d6a('0x5b')](function(_0x2533c8){logger[_0x0d6a('0x5a')]('['+_0x36ba67[_0x0d6a('0x6b')][_0x0d6a('0x6c')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x0d6a('0x5d')](_0x2533c8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x51bd=['customVariable','Variable','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','replace','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','forEach','includes','picklist','nameField','customField','type','idField','custom_fields','push','content','variable','variableName'];(function(_0x327dd3,_0x1d88c1){var _0x5acba0=function(_0x4e4b3c){while(--_0x4e4b3c){_0x327dd3['push'](_0x327dd3['shift']());}};_0x5acba0(++_0x1d88c1);}(_0x51bd,0x118));var _0xd51b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x51bd[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xd51b('0x0'));var rp=require(_0xd51b('0x1'));var md5=require(_0xd51b('0x2'));var util=require(_0xd51b('0x3'));var Redis=require(_0xd51b('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd51b('0x5'))(_0xd51b('0x6'));config[_0xd51b('0x7')]=_['defaults'](config[_0xd51b('0x7')],{'host':_0xd51b('0x8'),'port':0x18eb});var io=require(_0xd51b('0x9'))(new Redis(config[_0xd51b('0x7')]));function emit(_0x24cbbb,_0x1b978c,_0x2ba6ec){io['to'](_0x24cbbb)[_0xd51b('0xa')](_0x1b978c,_0x2ba6ec);}var headers={'Content-Type':_0xd51b('0xb'),'Accept':_0xd51b('0xb')};function getTicket(_0x5b2167,_0x656d8b,_0x2b0fb9,_0x1eac9c,_0x318970){logger[_0xd51b('0xc')](_0xd51b('0xd'));return request({'uri':util[_0xd51b('0xe')](_0xd51b('0xf'),_0x5b2167[_0xd51b('0x10')]),'method':_0xd51b('0x11'),'body':{'ticket':_[_0xd51b('0x12')]({'requester_id':_0x2b0fb9['id'],'submitter_id':_0x656d8b?_0x656d8b['id']:undefined,'assignee_id':_0x656d8b?_0x656d8b['id']:undefined,'tags':getTags(_0x1eac9c[_0xd51b('0x13')],_0xd51b('0x14')),'subject':intUtil[_0xd51b('0x15')](_0x1eac9c[_0xd51b('0x16')],_0x318970,'\x20'),'description':intUtil[_0xd51b('0x15')](_0x1eac9c['Descriptions'],_0x318970,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd51b('0x15')](_0x1eac9c[_0xd51b('0x17')],_0x318970,'\x0a')}},getCustomFields(_0x1eac9c[_0xd51b('0x18')],_0x318970))}})[_0xd51b('0x19')](function(_0x10d022){logger[_0xd51b('0xc')](_0xd51b('0x1a'));return _0x10d022['ticket'];});}function getUser(_0x29677f,_0x10331f){if(intUtil[_0xd51b('0x1b')](_0x10331f)){logger['info'](_0xd51b('0x1c'),_0x10331f);return request({'uri':util[_0xd51b('0xe')]('%s/search.json',_0x29677f[_0xd51b('0x10')]),'qs':{'query':util[_0xd51b('0xe')](_0xd51b('0x1d'),_0x10331f)}})[_0xd51b('0x19')](function(_0x2a970f){if(_0x2a970f[_0xd51b('0x1e')]){logger[_0xd51b('0xc')](_0xd51b('0x1f'));return _['find'](_0x2a970f[_0xd51b('0x20')],{'email':_0x10331f,'role':'agent'});}else{logger['info'](_0xd51b('0x21'));return request({'uri':util[_0xd51b('0xe')]('%s/users/me.json',_0x29677f[_0xd51b('0x10')])})[_0xd51b('0x19')](function(_0xc342a9){logger['info'](_0xd51b('0x22'));return _0xc342a9[_0xd51b('0x23')];});}});}else{logger[_0xd51b('0xc')](_0xd51b('0x21'));return request({'uri':util[_0xd51b('0xe')](_0xd51b('0x24'),_0x29677f[_0xd51b('0x10')])})['then'](function(_0x208d0f){logger[_0xd51b('0xc')](_0xd51b('0x22'));return _0x208d0f[_0xd51b('0x23')];});}}function getEndUser(_0x486297,_0x4d9687,_0x2bb13c){logger[_0xd51b('0xc')](_0xd51b('0x25'),_0x2bb13c);return request({'uri':util['format'](_0xd51b('0x26'),_0x486297['remoteUri']),'qs':{'query':util[_0xd51b('0xe')](_0xd51b('0x27'),_0x2bb13c)}})[_0xd51b('0x19')](function(_0x373f7e){var _0x389721;if(_0x373f7e[_0xd51b('0x20')][_0xd51b('0x28')]){_0x373f7e[_0xd51b('0x20')]=_['filter'](_0x373f7e[_0xd51b('0x20')],{'suspended':![],'role':_0xd51b('0x29')});if(_0x373f7e['results'][_0xd51b('0x28')]){_0x389721=_[_0xd51b('0x2a')](_0x373f7e[_0xd51b('0x20')]);}}if(_0x389721){logger[_0xd51b('0xc')](_0xd51b('0x2b'));return _0x389721;}else{logger[_0xd51b('0xc')](_0xd51b('0x2c'));return request({'uri':util[_0xd51b('0xe')](_0xd51b('0x2d'),_0x486297[_0xd51b('0x10')]),'method':_0xd51b('0x11'),'body':{'user':{'role':_0xd51b('0x29'),'name':util['format'](_0xd51b('0x2e'),_0x4d9687||_0x2bb13c),'phone':_0x2bb13c}}})[_0xd51b('0x19')](function(_0x35325f){logger[_0xd51b('0xc')](_0xd51b('0x2f'));return _0x35325f[_0xd51b('0x23')];});}});}function getAuth(_0x380054){var _0x2b0a10;if(_0x380054[_0xd51b('0x30')]==='password'){_0x2b0a10=util[_0xd51b('0xe')](_0xd51b('0x31'),_0x380054[_0xd51b('0x32')],_0x380054[_0xd51b('0x33')]);}else if(_0x380054[_0xd51b('0x30')]===_0xd51b('0x34')){_0x2b0a10=util['format'](_0xd51b('0x35'),_0x380054['username'],_0x380054['token']);}return util[_0xd51b('0xe')](_0xd51b('0x36'),new Buffer(_0x2b0a10)[_0xd51b('0x37')](_0xd51b('0x38')));}function request(_0x44afa9){logger[_0xd51b('0x39')](_0xd51b('0x3a'),JSON[_0xd51b('0x3b')](_0x44afa9));return rp(_[_0xd51b('0x3c')](_0x44afa9,{'method':_0xd51b('0x3d'),'headers':headers,'json':!![]}));}function getTags(_0x5bc1ef,_0x518bd8){var _0x3d0d1f=[];if(_0x5bc1ef&&_0x5bc1ef[_0xd51b('0x28')]>0x0){_0x3d0d1f=_['map'](_0x5bc1ef,_0x518bd8);}return _0x3d0d1f;}function getCustomFields(_0x480a03,_0x56dc54){var _0x4925d2=[];var _0x274a71={'custom_fields':[]};if(_0x480a03[_0xd51b('0x28')]>0x0){_[_0xd51b('0x3e')](_0x480a03,function(_0x2484bc){if(_[_0xd51b('0x3f')](['string',_0xd51b('0x40')],_0x2484bc['type'])&&_0x2484bc[_0xd51b('0x41')]&&!_0x2484bc[_0xd51b('0x42')]){_0x274a71[_0x2484bc[_0xd51b('0x41')]['toLowerCase']()]=_0x2484bc['content'][_0xd51b('0x37')]();}else if(_[_0xd51b('0x3f')](['string',_0xd51b('0x40')],_0x2484bc[_0xd51b('0x43')])&&_0x2484bc[_0xd51b('0x44')]&&_0x2484bc[_0xd51b('0x42')]){_0x274a71[_0xd51b('0x45')][_0xd51b('0x46')]({'id':_0x2484bc[_0xd51b('0x44')],'value':_0x2484bc[_0xd51b('0x47')]['toString']()});}else if(_0x2484bc[_0xd51b('0x43')]===_0xd51b('0x48')&&_0x2484bc['variableName']&&_0x2484bc[_0xd51b('0x44')]&&_0x2484bc['customField']){_0x56dc54[_0x2484bc['variableName']]&&_0x274a71[_0xd51b('0x45')][_0xd51b('0x46')]({'id':_0x2484bc[_0xd51b('0x44')],'value':_0x56dc54[_0x2484bc[_0xd51b('0x49')]][_0xd51b('0x37')]()});}else if(_0x2484bc[_0xd51b('0x43')]===_0xd51b('0x4a')&&_0x2484bc[_0xd51b('0x4b')]&&_0x2484bc[_0xd51b('0x4b')][_0xd51b('0x14')]&&_0x2484bc[_0xd51b('0x44')]&&_0x2484bc['customField']){_0x56dc54[_0x2484bc['Variable'][_0xd51b('0x14')]['toLowerCase']()]&&_0x274a71[_0xd51b('0x45')][_0xd51b('0x46')]({'id':_0x2484bc[_0xd51b('0x44')],'value':_0x56dc54[_0x2484bc['Variable'][_0xd51b('0x14')][_0xd51b('0x4c')]()][_0xd51b('0x37')]()});}});}return _0x274a71;}exports[_0xd51b('0x4d')]=function(_0x5e9889,_0x23ad5f,_0x30fa5b,_0x4b3912,_0x28d274,_0x36075f){var _0x4588a4,_0x15cb67;_0x36075f[_0xd51b('0x10')]=intUtil[_0xd51b('0x4e')](_0x36075f[_0xd51b('0x10')]);_0x36075f['serverUrl']=intUtil['stripTrailingSlash'](_0x36075f['serverUrl']);if(_0x28d274&&_0x28d274[_0xd51b('0x4f')]){logger[_0xd51b('0xc')](_0xd51b('0x50'),'Recording\x20is\x20enabled!');_0x23ad5f['recordingURL']=util[_0xd51b('0xe')](_0xd51b('0x51'),_0x36075f[_0xd51b('0x52')],_0x23ad5f[_0xd51b('0x53')],md5(_0x23ad5f[_0xd51b('0x53')]));}else{_0x23ad5f[_0xd51b('0x54')]='';}headers[_0xd51b('0x55')]=getAuth(_0x36075f);return getUser(_0x36075f,_0x4b3912['email'])[_0xd51b('0x19')](function(_0x3bad91){_0x4588a4=_0x3bad91;logger[_0xd51b('0xc')](_0xd51b('0x56'),_0x4588a4['id']);return getEndUser(_0x36075f,_0x23ad5f[_0xd51b('0x57')],_0x23ad5f[_0xd51b('0x58')]);})[_0xd51b('0x19')](function(_0x2d0448){_0x15cb67=_0x2d0448;logger[_0xd51b('0xc')](_0xd51b('0x59'),_0x15cb67['id']);return getTicket(_0x36075f,_0x4588a4,_0x15cb67,_0x30fa5b,_0x23ad5f);})[_0xd51b('0x19')](function(_0x24d179){if(_0x24d179){logger[_0xd51b('0xc')]('The\x20Ticket\x20ID\x20is:',_0x24d179['id']);switch(_0x36075f['type']){case _0xd51b('0x5a'):logger[_0xd51b('0xc')](_0xd51b('0x50'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd51b('0xe')](_0xd51b('0x5b'),_0x36075f[_0xd51b('0x10')],_0x4588a4['id'],_0x24d179['id']),'method':_0xd51b('0x11')});case _0xd51b('0x5c'):logger['info'](_0xd51b('0x50'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd51b('0xe')](_0xd51b('0x5d'),_0x4b3912['name']),_0xd51b('0x5e'),{'uri':util[_0xd51b('0xe')]('%s/agent/tickets/%s',_0x36075f[_0xd51b('0x10')][_0xd51b('0x5f')]('/api/v2',''),_0x24d179['id'])});break;default:logger['error'](_0xd51b('0x50'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xd51b('0x60')](function(_0x489e7d){logger[_0xd51b('0x61')](_0xd51b('0x62'),util[_0xd51b('0x63')](_0x489e7d,{'showHidden':!![],'depth':null}));});};exports[_0xd51b('0x64')]=function(_0x1ab749,_0x448e73,_0x3b38db,_0x1866ca,_0x3e8244,_0xe0358f,_0x52f27f){var _0x306da9,_0x222f8c;_0xe0358f[_0xd51b('0x10')]=intUtil[_0xd51b('0x4e')](_0xe0358f[_0xd51b('0x10')]);_0xe0358f[_0xd51b('0x52')]=intUtil[_0xd51b('0x4e')](_0xe0358f[_0xd51b('0x52')]);if(_0x52f27f&&_0x52f27f[_0xd51b('0x65')]&&_0x52f27f[_0xd51b('0x65')]!==_0xd51b('0x66')){logger[_0xd51b('0xc')]('[OUTBOUND]',_0xd51b('0x67'));_0x448e73['recordingURL']=util[_0xd51b('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe0358f['serverUrl'],_0x448e73['uniqueid'],md5(_0x448e73[_0xd51b('0x53')]));}headers[_0xd51b('0x55')]=getAuth(_0xe0358f);return getUser(_0xe0358f,_0x1866ca[_0xd51b('0x68')])['then'](function(_0x26e6b2){_0x306da9=_0x26e6b2;logger[_0xd51b('0xc')](_0xd51b('0x56'),_0x306da9['id']);return getEndUser(_0xe0358f,_0x448e73[_0xd51b('0x69')],_0x448e73[_0xd51b('0x6a')]);})[_0xd51b('0x19')](function(_0x500a7e){_0x222f8c=_0x500a7e;logger['info'](_0xd51b('0x59'),_0x222f8c['id']);return getTicket(_0xe0358f,_0x306da9,_0x222f8c,_0x3b38db,_0x448e73);})[_0xd51b('0x19')](function(_0x74019){if(_0x74019){logger['info'](_0xd51b('0x6b'),_0x74019['id']);switch(_0xe0358f['type']){case _0xd51b('0x5a'):logger['info'](_0xd51b('0x6c'),_0xd51b('0x6d'));return request({'uri':util[_0xd51b('0xe')](_0xd51b('0x5b'),_0xe0358f['remoteUri'],_0x306da9['id'],_0x74019['id']),'method':_0xd51b('0x11')});case'newTab':logger[_0xd51b('0xc')](_0xd51b('0x6c'),_0xd51b('0x6e'));emit(util['format'](_0xd51b('0x5d'),_0x1866ca[_0xd51b('0x14')]),_0xd51b('0x5e'),{'uri':util['format'](_0xd51b('0x6f'),_0xe0358f['remoteUri'][_0xd51b('0x5f')](_0xd51b('0x70'),''),_0x74019['id'])});break;default:logger[_0xd51b('0x61')](_0xd51b('0x6c'),_0xd51b('0x71'));}}})[_0xd51b('0x60')](function(_0x410d91){logger[_0xd51b('0x61')](_0xd51b('0x72'),util[_0xd51b('0x63')](_0x410d91,{'showHidden':!![],'depth':null}));});};exports[_0xd51b('0x73')]=function(_0x5d8bd1,_0x31d80c,_0x4649a0,_0x2e7e57,_0x47ae2c,_0x39ee04){var _0x4e1292,_0x289b6d;_0x39ee04[_0xd51b('0x10')]=intUtil[_0xd51b('0x4e')](_0x39ee04['remoteUri']);_0x39ee04['serverUrl']=intUtil[_0xd51b('0x4e')](_0x39ee04[_0xd51b('0x52')]);if(_0x47ae2c&&_0x47ae2c['monitor_format']){logger['info']('['+_0x31d80c[_0xd51b('0x74')][_0xd51b('0x75')]()+']',_0xd51b('0x67'));_0x31d80c[_0xd51b('0x54')]=util[_0xd51b('0xe')](_0xd51b('0x51'),_0x39ee04[_0xd51b('0x52')],_0x31d80c[_0xd51b('0x53')],md5(_0x31d80c[_0xd51b('0x53')]));}else{_0x31d80c[_0xd51b('0x54')]='';}headers[_0xd51b('0x55')]=getAuth(_0x39ee04);return getUser(_0x39ee04)[_0xd51b('0x19')](function(_0x5068c5){_0x4e1292=_0x5068c5;logger['info'](_0xd51b('0x56'),_0x4e1292['id']);return getEndUser(_0x39ee04,_0x31d80c[_0xd51b('0x57')],_0x31d80c['calleridnum']);})[_0xd51b('0x19')](function(_0x499e5f){_0x289b6d=_0x499e5f;logger['info'](_0xd51b('0x59'),_0x289b6d['id']);return getTicket(_0x39ee04,_0x4e1292,_0x289b6d,_0x4649a0,_0x31d80c);})['then'](function(_0x5e1c63){if(_0x5e1c63){logger['info'](_0xd51b('0x6b'),_0x5e1c63['id']);}})[_0xd51b('0x60')](function(_0x4a383e){logger[_0xd51b('0x61')]('['+_0x31d80c[_0xd51b('0x74')][_0xd51b('0x75')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x4a383e,{'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 ac93ca7..07de5d8 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 _0xa3df=['md5','util','./util','moment','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','picklist','type','idField','content','toString','variableName','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','access_token','add','seconds','catch','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','findIndex','users','email','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','merge','POST','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','Outbound','user:%s','https://crm.','toUpperCase','lodash'];(function(_0x5efd76,_0x2ee2d0){var _0x442eac=function(_0x219d00){while(--_0x219d00){_0x5efd76['push'](_0x5efd76['shift']());}};_0x442eac(++_0x2ee2d0);}(_0xa3df,0x1c7));var _0xfa3d=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0xa3df[_0x46361e];return _0x14e302;};'use strict';var _=require(_0xfa3d('0x0'));var rp=require('request-promise');var md5=require(_0xfa3d('0x1'));var util=require(_0xfa3d('0x2'));var intUtil=require(_0xfa3d('0x3'));var moment=require(_0xfa3d('0x4'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xfa3d('0x5'));var logger=require(_0xfa3d('0x6'))(_0xfa3d('0x7'));config[_0xfa3d('0x8')]=_[_0xfa3d('0x9')](config[_0xfa3d('0x8')],{'host':_0xfa3d('0xa'),'port':0x18eb});var io=require(_0xfa3d('0xb'))(new Redis(config[_0xfa3d('0x8')]));function emit(_0x1fab4d,_0x2cd779,_0x9c5dbb){io['to'](_0x1fab4d)[_0xfa3d('0xc')](_0x2cd779,_0x9c5dbb);}function request(_0x546b78){logger[_0xfa3d('0xd')]('[HTTP]',JSON[_0xfa3d('0xe')](_0x546b78));return rp(_0x546b78);}function getCustomFields(_0x22c704,_0x4ba693){var _0x5608ed={};if(_0x22c704[_0xfa3d('0xf')]>0x0){_[_0xfa3d('0x10')](_0x22c704,function(_0x123cc9){if(_[_0xfa3d('0x11')](['string',_0xfa3d('0x12')],_0x123cc9[_0xfa3d('0x13')])&&_0x123cc9[_0xfa3d('0x14')]){_0x5608ed[_0x123cc9['idField']]=_0x123cc9[_0xfa3d('0x15')][_0xfa3d('0x16')]();}else if(_0x123cc9['type']==='variable'&&_0x123cc9['variableName']&&_0x123cc9[_0xfa3d('0x14')]&&_0x4ba693[_0x123cc9[_0xfa3d('0x17')]]){_0x5608ed[_0x123cc9[_0xfa3d('0x14')]]=_0x4ba693[_0x123cc9[_0xfa3d('0x17')]][_0xfa3d('0x16')]();}else if(_0x123cc9['type']===_0xfa3d('0x18')&&_0x123cc9[_0xfa3d('0x19')]&&_0x123cc9[_0xfa3d('0x19')]['name']&&_0x123cc9[_0xfa3d('0x14')]&&_0x4ba693[_0x123cc9[_0xfa3d('0x19')]['name'][_0xfa3d('0x1a')]()]){_0x5608ed[_0x123cc9[_0xfa3d('0x14')]]=_0x4ba693[_0x123cc9[_0xfa3d('0x19')][_0xfa3d('0x1b')][_0xfa3d('0x1a')]()][_0xfa3d('0x16')]();}});}return _0x5608ed;}function getName(_0x533553){if(_0x533553[_0xfa3d('0x1c')]('\x20')>0x0){var _0x3523d7=_0x533553[_0xfa3d('0x1d')](/ (.+)/);if(_0x3523d7[0x1]){return _0x3523d7;}}return[_0x533553,_0x533553];}var accountsTokens={};function getAccessToken(_0x4bcfc3){return new Promise(function(_0x4b986b,_0x58e48d){if(!_[_0xfa3d('0x1e')](accountsTokens[_0x4bcfc3['id']])&&!_[_0xfa3d('0x1e')](accountsTokens[_0x4bcfc3['id']]['access_token'])){if(moment()[_0xfa3d('0x1f')](accountsTokens[_0x4bcfc3['id']][_0xfa3d('0x20')])){_0x4b986b(accountsTokens[_0x4bcfc3['id']]['access_token']);}}var _0xa5acf8;switch(_0x4bcfc3[_0xfa3d('0x21')]){case'US':_0xa5acf8=_0xfa3d('0x22');break;case'AU':_0xa5acf8='https://accounts.zoho.com.au';break;case'EU':_0xa5acf8=_0xfa3d('0x23');break;case'IN':_0xa5acf8='https://accounts.zoho.in';break;case'CN':_0xa5acf8='https://accounts.zoho.com.cn';break;default:_0xa5acf8=_0xfa3d('0x23');break;}var _0xe18ace={'method':'POST','uri':_0xa5acf8+_0xfa3d('0x24'),'qs':{'refresh_token':_0x4bcfc3[_0xfa3d('0x25')],'client_id':_0x4bcfc3[_0xfa3d('0x26')],'client_secret':_0x4bcfc3[_0xfa3d('0x27')],'grant_type':_0xfa3d('0x28')},'json':!![]};return rp(_0xe18ace)[_0xfa3d('0x29')](function(_0x4ac310){accountsTokens[_0x4bcfc3['id']]={'access_token':_0x4ac310[_0xfa3d('0x2a')],'expires_in':moment()[_0xfa3d('0x2b')](_0x4ac310[_0xfa3d('0x20')],_0xfa3d('0x2c'))};_0x4b986b(_0x4ac310[_0xfa3d('0x2a')]);})[_0xfa3d('0x2d')](function(_0x411acd){logger['error']('Failing\x20creating\x20the\x20access_token',_0x411acd[_0xfa3d('0x2e')]);_0x58e48d(_0x411acd);});});}function getUser(_0x1211a6,_0x115423,_0x49f911,_0x1d06c6){logger[_0xfa3d('0x2f')](_0xfa3d('0x30'));return request({'method':_0xfa3d('0x31'),'uri':util[_0xfa3d('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x115423),'qs':{'type':_0xfa3d('0x33')},'headers':{'Authorization':_0xfa3d('0x34')+_0x1211a6},'json':!![]})[_0xfa3d('0x29')](function(_0x39c3e5){if(_0x39c3e5['users']){var _0x13c144=-0x1;if(_['isArrayLikeObject'](_0x39c3e5['users'])){if(!_[_0xfa3d('0x1e')](_0x1d06c6)){_0x13c144=_[_0xfa3d('0x35')](_0x39c3e5[_0xfa3d('0x36')],function(_0x6b8ad7){return _0x6b8ad7[_0xfa3d('0x37')]===_0x1d06c6;});}if(_0x13c144>=0x0){logger[_0xfa3d('0x2f')]('Agent\x20found!');}else{logger[_0xfa3d('0x2f')](_0xfa3d('0x38'));_0x13c144=_[_0xfa3d('0x35')](_0x39c3e5['users'],function(_0x169cb1){return _0x169cb1['profile']['name']===_0xfa3d('0x39');});}return _0x39c3e5[_0xfa3d('0x36')][_0x13c144];}else{if(_0x39c3e5[_0xfa3d('0x3a')][_0xfa3d('0x3b')][_0xfa3d('0x1b')]===_0xfa3d('0x39')){logger[_0xfa3d('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x39c3e5[_0xfa3d('0x3a')];return user;}else{logger['error'](_0xfa3d('0x3c'),JSON[_0xfa3d('0xe')](_0x39c3e5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xfa3d('0xe')](_0x39c3e5));}}}else{logger[_0xfa3d('0x3d')](_0xfa3d('0x3c'),JSON[_0xfa3d('0xe')](_0x39c3e5));throw new Error(_0xfa3d('0x3e')+JSON[_0xfa3d('0xe')](_0x39c3e5));}})[_0xfa3d('0x2d')](function(_0x4dddbd){console[_0xfa3d('0x3d')](_0x4dddbd);});}function getZohoUser(_0x2785e3,_0x12bd32){return new BPromise(function(_0x203b3e,_0x9ca477){request(_0x2785e3)[_0xfa3d('0x29')](function(_0x1db9a7){var _0x15ff62=null;if(_0x1db9a7){_0x15ff62=_0x1db9a7[_0xfa3d('0x3f')][0x0];_0x15ff62[_0xfa3d('0x40')]=_0x12bd32;}_0x203b3e(_0x15ff62);})[_0xfa3d('0x2d')](function(_0x382df7){_0x9ca477(_0x382df7);});});}function createEndUser(_0x5f1e17,_0x3cee47,_0x218d8a,_0x2dc227,_0x13e9ae,_0x588a7c){var _0x218d8a=getName(_0x218d8a);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x3cee47+_0xfa3d('0x41')+_[_0xfa3d('0x42')](_0x588a7c[_0xfa3d('0x43')])+'s','body':{'data':[{'Last_Name':_0x218d8a[0x1],'First_Name':_0x218d8a[0x0],'Phone':_0x2dc227,'Owner':{'name':!_[_0xfa3d('0x1e')](_0x13e9ae[_0xfa3d('0x44')][_0xfa3d('0x1b')])?_0x13e9ae['role']['name']:!_['isNil'](_0x13e9ae[_0xfa3d('0x45')])?_0x13e9ae[_0xfa3d('0x45')]+'\x20'+_0x13e9ae[_0xfa3d('0x46')]:_0x13e9ae['last_name'],'id':_0x13e9ae['id']}}]},'headers':{'Authorization':_0xfa3d('0x34')+_0x5f1e17},'json':!![]})['then'](function(_0x2ab57a){if(_0x2ab57a&&_0x2ab57a['data'][0x0]['code']==='SUCCESS'){var _0x557fdb=_0x2ab57a[_0xfa3d('0x3f')][0x0][_0xfa3d('0x47')];_0x557fdb[_0xfa3d('0x40')]=_['startCase'](_0x588a7c['moduleCreate'])+'s';return _0x557fdb;}logger[_0xfa3d('0x3d')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0xfa3d('0x48')+JSON['stringify'](data));})[_0xfa3d('0x2d')](function(_0x1c80c9){console[_0xfa3d('0x49')](_0xfa3d('0x4a'),_0x1c80c9);});}function getEndUser(_0x4b9831,_0x5230a5,_0x3c769d,_0x3e25e6,_0x22abdb,_0x148766,_0x12adc3){var _0x25f032={'method':_0xfa3d('0x31'),'uri':'','headers':{'Authorization':_0xfa3d('0x34')+_0x4b9831},'json':!![]};switch(_0x12adc3['moduleSearch']){case _0xfa3d('0x4b'):_0x25f032[_0xfa3d('0x4c')]=_0xfa3d('0x4d')+_0x5230a5+_0xfa3d('0x4e')+_0x22abdb+'))';return getZohoUser(_0x25f032,_0xfa3d('0x4f'))[_0xfa3d('0x29')](function(_0x5b1b73){if(_0x5b1b73)return _0x5b1b73;_0x25f032['uri']=_0xfa3d('0x4d')+_0x5230a5+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x22abdb+'))';return getZohoUser(_0x25f032,_0xfa3d('0x50'))[_0xfa3d('0x29')](function(_0x24b48d){if(_0x24b48d)return _0x24b48d;if(_0x12adc3[_0xfa3d('0x43')]!=_0xfa3d('0x51')){return createEndUser(_0x4b9831,_0x5230a5,_0x3e25e6,_0x22abdb,_0x148766,_0x12adc3);}else{return{};}});});break;case'contact':_0x25f032[_0xfa3d('0x4c')]='https://www.zohoapis.'+_0x5230a5+_0xfa3d('0x4e')+_0x22abdb+'))';return getZohoUser(_0x25f032,'Contacts')[_0xfa3d('0x29')](function(_0x73101e){if(_0x73101e)return _0x73101e;if(_0x12adc3[_0xfa3d('0x43')]!=_0xfa3d('0x51')){return createEndUser(_0x4b9831,_0x5230a5,_0x3e25e6,_0x22abdb,_0x148766,_0x12adc3);}else{return{};}});break;case _0xfa3d('0x52'):_0x25f032[_0xfa3d('0x4c')]='https://www.zohoapis.'+_0x5230a5+_0xfa3d('0x53')+_0x22abdb+'))';return getZohoUser(_0x25f032,_0xfa3d('0x50'))[_0xfa3d('0x29')](function(_0x3d09e8){if(_0x3d09e8)return _0x3d09e8;if(_0x12adc3[_0xfa3d('0x43')]!=_0xfa3d('0x51')){return createEndUser(_0x4b9831,_0x5230a5,_0x3e25e6,_0x22abdb,_0x148766,_0x12adc3);}else{return{};}});break;}}function getCall(_0x568f83,_0x3516af,_0x801014,_0x19c1a4,_0x216f54,_0xd697af,_0x4588c2,_0x5b9560){logger['info'](_0xfa3d('0x54'));var _0x269cec={};_0x269cec[_0xfa3d('0x55')]={'name':!_[_0xfa3d('0x1e')](_0x19c1a4[_0xfa3d('0x44')][_0xfa3d('0x1b')])&&!_[_0xfa3d('0x1e')](_0x19c1a4[_0xfa3d('0x3b')][_0xfa3d('0x1b')])&&_0x19c1a4[_0xfa3d('0x3b')][_0xfa3d('0x1b')]===_0xfa3d('0x56')?_0x19c1a4[_0xfa3d('0x44')][_0xfa3d('0x1b')]:!_[_0xfa3d('0x1e')](_0x19c1a4[_0xfa3d('0x45')])?_0x19c1a4[_0xfa3d('0x45')]+'\x20'+_0x19c1a4['last_name']:_0x19c1a4['last_name'],'id':_0x19c1a4['id']};_0x269cec[_0xfa3d('0x57')]=intUtil[_0xfa3d('0x58')](_0xd697af[_0xfa3d('0x59')],_0x4588c2,'\x20');_0x269cec['Description']=intUtil[_0xfa3d('0x58')](_0xd697af[_0xfa3d('0x5a')],_0x4588c2,'\x0a');if(_0x216f54[_0xfa3d('0x40')]===_0xfa3d('0x4f')){_0x269cec[_0xfa3d('0x5b')]={'name':!_['isNil'](_0x216f54[_0xfa3d('0x5c')])?_0x216f54[_0xfa3d('0x5c')]:!_[_0xfa3d('0x1e')](_0x216f54[_0xfa3d('0x5d')])?_0x216f54['First_Name']+'\x20'+_0x216f54[_0xfa3d('0x5e')]:_0x216f54[_0xfa3d('0x5e')],'id':_0x216f54['id']};}if(_0x216f54[_0xfa3d('0x40')]===_0xfa3d('0x50')){_0x269cec[_0xfa3d('0x5f')]={'name':!_[_0xfa3d('0x1e')](_0x216f54[_0xfa3d('0x5c')])?_0x216f54['Full_Name']:!_[_0xfa3d('0x1e')](_0x216f54['First_Name'])?_0x216f54['First_Name']+'\x20'+_0x216f54['Last_Name']:_0x216f54[_0xfa3d('0x5e')],'id':_0x216f54['id']};_0x269cec[_0xfa3d('0x60')]=_['startCase'](_0x216f54['enduserType']);}if(_0x4588c2[_0xfa3d('0x61')]){_0x269cec['Call_Duration']=moment[_0xfa3d('0x62')](parseInt(_0x4588c2[_0xfa3d('0x61')])*0x3e8)[_0xfa3d('0x32')](_0xfa3d('0x63'));}else if(_0x4588c2['answertime']&&_0x4588c2[_0xfa3d('0x64')]){_0x269cec['Call_Duration']=moment[_0xfa3d('0x62')](moment(_0x4588c2[_0xfa3d('0x64')],_0xfa3d('0x65'))['diff'](moment(_0x4588c2['starttime'],_0xfa3d('0x65'))))[_0xfa3d('0x32')](_0xfa3d('0x63'));}switch(_0x4588c2[_0xfa3d('0x66')]){case _0xfa3d('0x67'):_0x269cec[_0xfa3d('0x68')]=_0xfa3d('0x69');break;case _0xfa3d('0x6a'):case'connect':_0x269cec[_0xfa3d('0x68')]=_0xfa3d('0x6b');break;case _0xfa3d('0x6c'):_0x269cec[_0xfa3d('0x68')]=_0xfa3d('0x6d');break;case _0xfa3d('0x6e'):_0x269cec[_0xfa3d('0x68')]=_0xfa3d('0x6f');break;case _0xfa3d('0x70'):_0x269cec[_0xfa3d('0x68')]=_0xfa3d('0x71');default:}_0x269cec[_0xfa3d('0x72')]=(_0x5b9560===_0xfa3d('0x73')?moment(_0x4588c2[_0xfa3d('0x74')])['format'](_0xfa3d('0x65')):moment(_0x4588c2[_0xfa3d('0x75')])[_0xfa3d('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xfa3d('0x32')](_0xfa3d('0x65'));_0x269cec['Call_Type']=_0x5b9560||'Inbound';_0x269cec=_[_0xfa3d('0x76')](_0x269cec,getCustomFields(_0xd697af['Fields'],_0x4588c2));return request({'method':_0xfa3d('0x77'),'uri':_0xfa3d('0x4d')+_0x3516af+_0xfa3d('0x78'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x568f83},'body':{'data':[_0x269cec]},'json':!![]})[_0xfa3d('0x29')](function(_0xb7a512){if(_0xb7a512&&_0xb7a512[_0xfa3d('0x3f')][0x0][_0xfa3d('0x79')]===_0xfa3d('0x7a')){logger[_0xfa3d('0x2f')](_0xfa3d('0x7b'));return{'id':_0xb7a512[_0xfa3d('0x3f')][0x0][_0xfa3d('0x47')]['id']};}})[_0xfa3d('0x2d')](function(_0x78b488){logger[_0xfa3d('0x2f')](_0xfa3d('0x7c'),_0x78b488[_0xfa3d('0x2e')]);console[_0xfa3d('0x49')](_0xfa3d('0x7c'),_0x78b488);});}exports[_0xfa3d('0x7d')]=function(_0x188110,_0x20955d,_0x200ae7,_0x1ebe51,_0x1b4678,_0x20c7d5){var _0x3423ca,_0x347fec,_0x139d8c;_0x20c7d5['host']=intUtil[_0xfa3d('0x7e')](_0x20c7d5[_0xfa3d('0x7f')]);_0x20c7d5[_0xfa3d('0x80')]=intUtil[_0xfa3d('0x7e')](_0x20c7d5[_0xfa3d('0x80')]);if(_0x1b4678&&_0x1b4678[_0xfa3d('0x81')]){logger[_0xfa3d('0x2f')]('[QUEUE]',_0xfa3d('0x82'));_0x20955d[_0xfa3d('0x83')]=_0x20c7d5[_0xfa3d('0x80')]+_0xfa3d('0x84')+_0x20955d[_0xfa3d('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x20955d[_0xfa3d('0x85')]);}else{_0x20955d[_0xfa3d('0x83')]='';}var _0x1a4056=_0x20c7d5[_0xfa3d('0x7f')]===_0xfa3d('0x86')?'eu':'com';return getAccessToken(_0x20c7d5)[_0xfa3d('0x29')](function(_0x34ffad){_0x139d8c=_0x34ffad;return getUser(_0x139d8c,_0x1a4056,_0x20c7d5,_0x1ebe51[_0xfa3d('0x37')]);})[_0xfa3d('0x29')](function(_0x47e85c){_0x3423ca=_0x47e85c;logger[_0xfa3d('0x2f')](_0xfa3d('0x87'),_0x3423ca['id']);return getEndUser(_0x139d8c,_0x1a4056,_0x20c7d5,_0x20955d[_0xfa3d('0x88')],_0x20955d[_0xfa3d('0x89')],_0x3423ca,_0x200ae7);})[_0xfa3d('0x29')](function(_0x48e992){_0x347fec=_0x48e992;return getCall(_0x139d8c,_0x1a4056,_0x20c7d5,_0x3423ca,_0x347fec,_0x200ae7,_0x20955d,_0xfa3d('0x8a'));})[_0xfa3d('0x29')](function(_0x35bf44){if(_0x35bf44){logger[_0xfa3d('0x2f')](_0xfa3d('0x8b'),_0x35bf44['id']);logger[_0xfa3d('0x2f')](_0xfa3d('0x8c'),_0xfa3d('0x8d'));emit(util['format']('user:%s',_0x1ebe51[_0xfa3d('0x1b')]),'trigger:browser:url',{'uri':'https://crm.'+_0x20c7d5['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x35bf44['id']});}})[_0xfa3d('0x2d')](function(_0x5bf258){logger[_0xfa3d('0x3d')](_0xfa3d('0x8c'),JSON[_0xfa3d('0xe')](_0x5bf258));});};exports[_0xfa3d('0x73')]=function(_0x1a7e58,_0x3083d7,_0x5687ba,_0x20356f,_0x96ad11,_0x312723,_0x3ab08e){var _0x1a8f56,_0xcfdeaa,_0x4333ea;_0x312723[_0xfa3d('0x7f')]=intUtil[_0xfa3d('0x7e')](_0x312723[_0xfa3d('0x7f')]);_0x312723[_0xfa3d('0x80')]=intUtil[_0xfa3d('0x7e')](_0x312723[_0xfa3d('0x80')]);if(_0x3ab08e&&_0x3ab08e[_0xfa3d('0x8e')]&&_0x3ab08e[_0xfa3d('0x8e')]!=='none'){logger[_0xfa3d('0x2f')](_0xfa3d('0x8f'),_0xfa3d('0x82'));_0x3083d7['recordingURL']=_0x312723[_0xfa3d('0x80')]+_0xfa3d('0x84')+_0x3083d7[_0xfa3d('0x85')]+_0xfa3d('0x90')+md5(_0x3083d7[_0xfa3d('0x85')]);}var _0xec8610=_0x312723[_0xfa3d('0x7f')]===_0xfa3d('0x86')?'eu':_0xfa3d('0x91');return getAccessToken(_0x312723)[_0xfa3d('0x29')](function(_0x1c849f){_0x4333ea=_0x1c849f;return getUser(_0x4333ea,_0xec8610,_0x312723,_0x20356f[_0xfa3d('0x37')]);})['then'](function(_0x4dbb5f){_0x1a8f56=_0x4dbb5f;logger[_0xfa3d('0x2f')](_0xfa3d('0x87'),_0x1a8f56['id']);return getEndUser(_0x4333ea,_0xec8610,_0x312723,_0x3083d7[_0xfa3d('0x92')],_0x3083d7[_0xfa3d('0x93')],_0x1a8f56,_0x5687ba);})[_0xfa3d('0x29')](function(_0x3980ea){_0xcfdeaa=_0x3980ea;return getCall(_0x4333ea,_0xec8610,_0x312723,_0x1a8f56,_0xcfdeaa,_0x5687ba,_0x3083d7,_0xfa3d('0x94'));})[_0xfa3d('0x29')](function(_0x3491fd){if(_0x3491fd){logger['info']('The\x20Call\x20ID\x20is:',_0x3491fd['id']);logger[_0xfa3d('0x2f')](_0xfa3d('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfa3d('0x32')](_0xfa3d('0x95'),_0x20356f['name']),'trigger:browser:url',{'uri':_0xfa3d('0x96')+_0x312723[_0xfa3d('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3491fd['id']});}})[_0xfa3d('0x2d')](function(_0x5ed9be){logger['error']('[OUTBOUND]',JSON[_0xfa3d('0xe')](_0x5ed9be));});};exports['unmanaged']=function(_0x5b326e,_0x556167,_0x4b349c,_0x13ffdd,_0x1ccd5e,_0x378a42){var _0x19a3b1,_0x3d8756,_0x1ee0e9;_0x378a42['host']=intUtil[_0xfa3d('0x7e')](_0x378a42[_0xfa3d('0x7f')]);_0x378a42['serverUrl']=intUtil[_0xfa3d('0x7e')](_0x378a42[_0xfa3d('0x80')]);if(_0x1ccd5e&&_0x1ccd5e['monitor_format']){logger[_0xfa3d('0x2f')]('['+_0x556167[_0xfa3d('0x66')][_0xfa3d('0x97')]()+']',_0xfa3d('0x82'));_0x556167[_0xfa3d('0x83')]=_0x378a42[_0xfa3d('0x80')]+_0xfa3d('0x84')+_0x556167['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x556167[_0xfa3d('0x85')]);}else{_0x556167[_0xfa3d('0x83')]='';}var _0x3bd4b5=_0x378a42[_0xfa3d('0x7f')]===_0xfa3d('0x86')?'eu':_0xfa3d('0x91');return getAccessToken(_0x378a42)[_0xfa3d('0x29')](function(_0x358535){_0x1ee0e9=_0x358535;return getUser(_0x1ee0e9,_0x3bd4b5,_0x378a42);})[_0xfa3d('0x29')](function(_0x227191){_0x19a3b1=_0x227191;logger[_0xfa3d('0x2f')](_0xfa3d('0x87'),_0x19a3b1['id']);return getEndUser(_0x1ee0e9,_0x3bd4b5,_0x378a42,_0x556167['calleridname'],_0x556167[_0xfa3d('0x89')],_0x19a3b1,_0x4b349c);})[_0xfa3d('0x29')](function(_0x48003d){_0x3d8756=_0x48003d;return getCall(_0x1ee0e9,_0x3bd4b5,_0x378a42,_0x19a3b1,_0x3d8756,_0x4b349c,_0x556167,'Inbound');})[_0xfa3d('0x29')](function(_0x19902c){if(_0x19902c){logger[_0xfa3d('0x2f')](_0xfa3d('0x8b'),_0x19902c['id']);}})[_0xfa3d('0x2d')](function(_0x4d78bc){logger[_0xfa3d('0x3d')]('['+_0x556167[_0xfa3d('0x66')][_0xfa3d('0x97')]()+']',JSON['stringify'](_0x4d78bc));});}; \ No newline at end of file +var _0xdea1=['Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','calleridname','calleridnum','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','/api/voice/recordings/','com','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','includes','string','type','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','access_token','seconds','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','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','Call_Result','Answered','rejected','Rejected','Abandoned','Timeout','Call_Start_Time','outbound','Call_Type','Inbound'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xdea1,0x1f4));var _0x1dea=function(_0x3e3b29,_0x30aacd){_0x3e3b29=_0x3e3b29-0x0;var _0x3092dc=_0xdea1[_0x3e3b29];return _0x3092dc;};'use strict';var _=require(_0x1dea('0x0'));var rp=require(_0x1dea('0x1'));var md5=require(_0x1dea('0x2'));var util=require(_0x1dea('0x3'));var intUtil=require('./util');var moment=require(_0x1dea('0x4'));var Redis=require(_0x1dea('0x5'));var BPromise=require(_0x1dea('0x6'));var config=require(_0x1dea('0x7'));var logger=require(_0x1dea('0x8'))('zoho');config[_0x1dea('0x9')]=_[_0x1dea('0xa')](config[_0x1dea('0x9')],{'host':_0x1dea('0xb'),'port':0x18eb});var io=require(_0x1dea('0xc'))(new Redis(config[_0x1dea('0x9')]));function emit(_0x2bd6ea,_0x41e03a,_0x3132d1){io['to'](_0x2bd6ea)[_0x1dea('0xd')](_0x41e03a,_0x3132d1);}function request(_0x3c4cc6){logger[_0x1dea('0xe')](_0x1dea('0xf'),JSON['stringify'](_0x3c4cc6));return rp(_0x3c4cc6);}function getCustomFields(_0x3d49f0,_0x22a726){var _0xd3e66e={};if(_0x3d49f0[_0x1dea('0x10')]>0x0){_['forEach'](_0x3d49f0,function(_0x22b478){if(_[_0x1dea('0x11')]([_0x1dea('0x12'),'picklist'],_0x22b478[_0x1dea('0x13')])&&_0x22b478[_0x1dea('0x14')]){_0xd3e66e[_0x22b478[_0x1dea('0x14')]]=_0x22b478[_0x1dea('0x15')]['toString']();}else if(_0x22b478[_0x1dea('0x13')]==='variable'&&_0x22b478[_0x1dea('0x16')]&&_0x22b478[_0x1dea('0x14')]&&_0x22a726[_0x22b478[_0x1dea('0x16')]]){_0xd3e66e[_0x22b478[_0x1dea('0x14')]]=_0x22a726[_0x22b478[_0x1dea('0x16')]][_0x1dea('0x17')]();}else if(_0x22b478[_0x1dea('0x13')]===_0x1dea('0x18')&&_0x22b478[_0x1dea('0x19')]&&_0x22b478['Variable'][_0x1dea('0x1a')]&&_0x22b478[_0x1dea('0x14')]&&_0x22a726[_0x22b478[_0x1dea('0x19')][_0x1dea('0x1a')][_0x1dea('0x1b')]()]){_0xd3e66e[_0x22b478[_0x1dea('0x14')]]=_0x22a726[_0x22b478[_0x1dea('0x19')][_0x1dea('0x1a')][_0x1dea('0x1b')]()][_0x1dea('0x17')]();}});}return _0xd3e66e;}function getName(_0x5a70ff){if(_0x5a70ff[_0x1dea('0x1c')]('\x20')>0x0){var _0x3c5280=_0x5a70ff[_0x1dea('0x1d')](/ (.+)/);if(_0x3c5280[0x1]){return _0x3c5280;}}return[_0x5a70ff,_0x5a70ff];}var accountsTokens={};function getAccessToken(_0x1e3198){return new Promise(function(_0x46d606,_0x229120){if(!_[_0x1dea('0x1e')](accountsTokens[_0x1e3198['id']])&&!_['isNil'](accountsTokens[_0x1e3198['id']]['access_token'])){if(moment()[_0x1dea('0x1f')](accountsTokens[_0x1e3198['id']][_0x1dea('0x20')])){_0x46d606(accountsTokens[_0x1e3198['id']]['access_token']);}}var _0x1c3d92;switch(_0x1e3198['zone']){case'US':_0x1c3d92='https://accounts.zoho.com';break;case'AU':_0x1c3d92=_0x1dea('0x21');break;case'EU':_0x1c3d92='https://accounts.zoho.eu';break;case'IN':_0x1c3d92='https://accounts.zoho.in';break;case'CN':_0x1c3d92=_0x1dea('0x22');break;default:_0x1c3d92='https://accounts.zoho.eu';break;}var _0x5c26b3={'method':_0x1dea('0x23'),'uri':_0x1c3d92+_0x1dea('0x24'),'qs':{'refresh_token':_0x1e3198[_0x1dea('0x25')],'client_id':_0x1e3198[_0x1dea('0x26')],'client_secret':_0x1e3198[_0x1dea('0x27')],'grant_type':_0x1dea('0x28')},'json':!![]};return rp(_0x5c26b3)[_0x1dea('0x29')](function(_0x5d2e94){accountsTokens[_0x1e3198['id']]={'access_token':_0x5d2e94[_0x1dea('0x2a')],'expires_in':moment()['add'](_0x5d2e94[_0x1dea('0x20')],_0x1dea('0x2b'))};_0x46d606(_0x5d2e94[_0x1dea('0x2a')]);})[_0x1dea('0x2c')](function(_0x1a157a){logger[_0x1dea('0x2d')](_0x1dea('0x2e'),_0x1a157a[_0x1dea('0x2f')]);_0x229120(_0x1a157a);});});}function getUser(_0x38b921,_0x42c2a3,_0x4f093d,_0x13db01){logger['info'](_0x1dea('0x30'));return request({'method':_0x1dea('0x31'),'uri':util[_0x1dea('0x32')](_0x1dea('0x33'),_0x42c2a3),'qs':{'type':_0x1dea('0x34')},'headers':{'Authorization':_0x1dea('0x35')+_0x38b921},'json':!![]})[_0x1dea('0x29')](function(_0x31151c){if(_0x31151c[_0x1dea('0x36')]){var _0x5074bf=-0x1;if(_[_0x1dea('0x37')](_0x31151c[_0x1dea('0x36')])){if(!_[_0x1dea('0x1e')](_0x13db01)){_0x5074bf=_[_0x1dea('0x38')](_0x31151c['users'],function(_0x48602d){return _0x48602d[_0x1dea('0x39')]===_0x13db01;});}if(_0x5074bf>=0x0){logger[_0x1dea('0x3a')](_0x1dea('0x3b'));}else{logger['info'](_0x1dea('0x3c'));_0x5074bf=_[_0x1dea('0x38')](_0x31151c[_0x1dea('0x36')],function(_0x1594c0){return _0x1594c0[_0x1dea('0x3d')][_0x1dea('0x1a')]==='Administrator';});}return _0x31151c[_0x1dea('0x36')][_0x5074bf];}else{if(_0x31151c[_0x1dea('0x3e')][_0x1dea('0x3d')][_0x1dea('0x1a')]===_0x1dea('0x3f')){logger[_0x1dea('0x3a')]('Using\x20the\x20admin\x20account!');user=_0x31151c[_0x1dea('0x3e')];return user;}else{logger[_0x1dea('0x2d')](_0x1dea('0x40'),JSON['stringify'](_0x31151c));throw new Error(_0x1dea('0x41')+JSON[_0x1dea('0x42')](_0x31151c));}}}else{logger[_0x1dea('0x2d')]('The\x20failing\x20result\x20is',JSON[_0x1dea('0x42')](_0x31151c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x1dea('0x42')](_0x31151c));}})[_0x1dea('0x2c')](function(_0x3e2a7b){console[_0x1dea('0x2d')](_0x3e2a7b);});}function getZohoUser(_0x5d89bd,_0x2ba42e){return new BPromise(function(_0x452db5,_0x553b31){request(_0x5d89bd)['then'](function(_0x3bcac6){var _0x5295e4=null;if(_0x3bcac6){_0x5295e4=_0x3bcac6[_0x1dea('0x43')][0x0];_0x5295e4[_0x1dea('0x44')]=_0x2ba42e;}_0x452db5(_0x5295e4);})[_0x1dea('0x2c')](function(_0x370b99){_0x553b31(_0x370b99);});});}function createEndUser(_0x526b54,_0x160dae,_0xbbefac,_0xda57f4,_0x8833ae,_0x1ec7a2){var _0xbbefac=getName(_0xbbefac);return request({'method':_0x1dea('0x23'),'uri':_0x1dea('0x45')+_0x160dae+'/crm/v2/'+_[_0x1dea('0x46')](_0x1ec7a2[_0x1dea('0x47')])+'s','body':{'data':[{'Last_Name':_0xbbefac[0x1],'First_Name':_0xbbefac[0x0],'Phone':_0xda57f4,'Owner':{'name':!_[_0x1dea('0x1e')](_0x8833ae[_0x1dea('0x48')][_0x1dea('0x1a')])?_0x8833ae[_0x1dea('0x48')][_0x1dea('0x1a')]:!_[_0x1dea('0x1e')](_0x8833ae[_0x1dea('0x49')])?_0x8833ae['first_name']+'\x20'+_0x8833ae['last_name']:_0x8833ae[_0x1dea('0x4a')],'id':_0x8833ae['id']}}]},'headers':{'Authorization':_0x1dea('0x35')+_0x526b54},'json':!![]})['then'](function(_0x270c79){if(_0x270c79&&_0x270c79[_0x1dea('0x43')][0x0]['code']===_0x1dea('0x4b')){var _0x7bf9ca=_0x270c79['data'][0x0][_0x1dea('0x4c')];_0x7bf9ca[_0x1dea('0x44')]=_[_0x1dea('0x46')](_0x1ec7a2[_0x1dea('0x47')])+'s';return _0x7bf9ca;}logger['error'](_0x1dea('0x40'),JSON['stringify'](data));throw new Error(_0x1dea('0x4d')+JSON[_0x1dea('0x42')](data));})[_0x1dea('0x2c')](function(_0x3c4fd8){console[_0x1dea('0x4e')](_0x1dea('0x4f'),_0x3c4fd8);});}function getEndUser(_0x22adc5,_0x4d25da,_0x32f371,_0x3e283e,_0x26d418,_0x40ed81,_0xf04638){var _0x361f4c={'method':_0x1dea('0x31'),'uri':'','headers':{'Authorization':_0x1dea('0x35')+_0x22adc5},'json':!![]};switch(_0xf04638['moduleSearch']){case _0x1dea('0x50'):_0x361f4c[_0x1dea('0x51')]=_0x1dea('0x45')+_0x4d25da+_0x1dea('0x52')+_0x26d418+'))';return getZohoUser(_0x361f4c,_0x1dea('0x53'))['then'](function(_0x1e70fb){if(_0x1e70fb)return _0x1e70fb;_0x361f4c['uri']=_0x1dea('0x45')+_0x4d25da+_0x1dea('0x54')+_0x26d418+'))';return getZohoUser(_0x361f4c,_0x1dea('0x55'))[_0x1dea('0x29')](function(_0x2bcca4){if(_0x2bcca4)return _0x2bcca4;if(_0xf04638[_0x1dea('0x47')]!=_0x1dea('0x56')){return createEndUser(_0x22adc5,_0x4d25da,_0x3e283e,_0x26d418,_0x40ed81,_0xf04638);}else{return{};}});});break;case _0x1dea('0x57'):_0x361f4c['uri']=_0x1dea('0x45')+_0x4d25da+_0x1dea('0x52')+_0x26d418+'))';return getZohoUser(_0x361f4c,_0x1dea('0x53'))[_0x1dea('0x29')](function(_0x36fc73){if(_0x36fc73)return _0x36fc73;if(_0xf04638[_0x1dea('0x47')]!=_0x1dea('0x56')){return createEndUser(_0x22adc5,_0x4d25da,_0x3e283e,_0x26d418,_0x40ed81,_0xf04638);}else{return{};}});break;case _0x1dea('0x58'):_0x361f4c[_0x1dea('0x51')]=_0x1dea('0x45')+_0x4d25da+_0x1dea('0x54')+_0x26d418+'))';return getZohoUser(_0x361f4c,_0x1dea('0x55'))['then'](function(_0x1f6905){if(_0x1f6905)return _0x1f6905;if(_0xf04638[_0x1dea('0x47')]!=_0x1dea('0x56')){return createEndUser(_0x22adc5,_0x4d25da,_0x3e283e,_0x26d418,_0x40ed81,_0xf04638);}else{return{};}});break;}}function getCall(_0x59884d,_0x5988d1,_0x4060ea,_0x12f088,_0x43e2bb,_0x206e8f,_0x498482,_0x31cab7){logger[_0x1dea('0x3a')](_0x1dea('0x59'));var _0xcf9050={};_0xcf9050[_0x1dea('0x5a')]={'name':!_['isNil'](_0x12f088['role']['name'])&&!_[_0x1dea('0x1e')](_0x12f088[_0x1dea('0x3d')][_0x1dea('0x1a')])&&_0x12f088['profile'][_0x1dea('0x1a')]===_0x1dea('0x5b')?_0x12f088[_0x1dea('0x48')][_0x1dea('0x1a')]:!_[_0x1dea('0x1e')](_0x12f088[_0x1dea('0x49')])?_0x12f088[_0x1dea('0x49')]+'\x20'+_0x12f088[_0x1dea('0x4a')]:_0x12f088['last_name'],'id':_0x12f088['id']};_0xcf9050[_0x1dea('0x5c')]=intUtil[_0x1dea('0x5d')](_0x206e8f['Subjects'],_0x498482,'\x20');_0xcf9050[_0x1dea('0x5e')]=intUtil['getString'](_0x206e8f[_0x1dea('0x5f')],_0x498482,'\x0a');if(_0x43e2bb['enduserType']==='Contacts'){_0xcf9050[_0x1dea('0x60')]={'name':!_[_0x1dea('0x1e')](_0x43e2bb[_0x1dea('0x61')])?_0x43e2bb['Full_Name']:!_[_0x1dea('0x1e')](_0x43e2bb['First_Name'])?_0x43e2bb[_0x1dea('0x62')]+'\x20'+_0x43e2bb[_0x1dea('0x63')]:_0x43e2bb[_0x1dea('0x63')],'id':_0x43e2bb['id']};}if(_0x43e2bb[_0x1dea('0x44')]===_0x1dea('0x55')){_0xcf9050['What_Id']={'name':!_[_0x1dea('0x1e')](_0x43e2bb[_0x1dea('0x61')])?_0x43e2bb[_0x1dea('0x61')]:!_[_0x1dea('0x1e')](_0x43e2bb[_0x1dea('0x62')])?_0x43e2bb[_0x1dea('0x62')]+'\x20'+_0x43e2bb[_0x1dea('0x63')]:_0x43e2bb['Last_Name'],'id':_0x43e2bb['id']};_0xcf9050[_0x1dea('0x64')]=_[_0x1dea('0x46')](_0x43e2bb[_0x1dea('0x44')]);}if(_0x498482[_0x1dea('0x65')]){_0xcf9050[_0x1dea('0x66')]=moment[_0x1dea('0x67')](parseInt(_0x498482[_0x1dea('0x65')])*0x3e8)[_0x1dea('0x32')](_0x1dea('0x68'));}else if(_0x498482[_0x1dea('0x69')]&&_0x498482[_0x1dea('0x6a')]){_0xcf9050[_0x1dea('0x66')]=moment[_0x1dea('0x67')](moment(_0x498482[_0x1dea('0x6a')],_0x1dea('0x6b'))[_0x1dea('0x6c')](moment(_0x498482[_0x1dea('0x6d')],_0x1dea('0x6b'))))[_0x1dea('0x32')](_0x1dea('0x68'));}switch(_0x498482[_0x1dea('0x6e')]){case _0x1dea('0x6f'):_0xcf9050['Call_Result']=_0x1dea('0x70');break;case _0x1dea('0x71'):case'connect':_0xcf9050[_0x1dea('0x72')]=_0x1dea('0x73');break;case _0x1dea('0x74'):_0xcf9050[_0x1dea('0x72')]=_0x1dea('0x75');break;case'abandoned':_0xcf9050[_0x1dea('0x72')]=_0x1dea('0x76');break;case'timeout':_0xcf9050['Call_Result']=_0x1dea('0x77');default:}_0xcf9050[_0x1dea('0x78')]=(_0x31cab7===_0x1dea('0x79')?moment(_0x498482['starttime'])[_0x1dea('0x32')](_0x1dea('0x6b')):moment(_0x498482['agentcalledAt'])['format'](_0x1dea('0x6b')))||moment()[_0x1dea('0x32')](_0x1dea('0x6b'));_0xcf9050[_0x1dea('0x7a')]=_0x31cab7||_0x1dea('0x7b');_0xcf9050=_['merge'](_0xcf9050,getCustomFields(_0x206e8f[_0x1dea('0x7c')],_0x498482));return request({'method':_0x1dea('0x23'),'uri':_0x1dea('0x45')+_0x5988d1+_0x1dea('0x7d'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x59884d},'body':{'data':[_0xcf9050]},'json':!![]})['then'](function(_0x2f054f){if(_0x2f054f&&_0x2f054f[_0x1dea('0x43')][0x0]['code']===_0x1dea('0x4b')){logger[_0x1dea('0x3a')](_0x1dea('0x7e'));return{'id':_0x2f054f[_0x1dea('0x43')][0x0]['details']['id']};}})[_0x1dea('0x2c')](function(_0x5c1113){logger[_0x1dea('0x3a')](_0x1dea('0x7f'),_0x5c1113[_0x1dea('0x2f')]);console[_0x1dea('0x4e')](_0x1dea('0x7f'),_0x5c1113);});}exports[_0x1dea('0x80')]=function(_0x1d6e61,_0x5bc2c0,_0x28db91,_0x30c083,_0x50122c,_0x3ae2b2){var _0x55532f,_0x59e51f,_0x46f89a;_0x3ae2b2[_0x1dea('0x81')]=intUtil[_0x1dea('0x82')](_0x3ae2b2[_0x1dea('0x81')]);_0x3ae2b2[_0x1dea('0x83')]=intUtil[_0x1dea('0x82')](_0x3ae2b2[_0x1dea('0x83')]);if(_0x50122c&&_0x50122c[_0x1dea('0x84')]){logger[_0x1dea('0x3a')]('[QUEUE]',_0x1dea('0x85'));_0x5bc2c0[_0x1dea('0x86')]=_0x3ae2b2[_0x1dea('0x83')]+'/api/voice/recordings/'+_0x5bc2c0['uniqueid']+_0x1dea('0x87')+md5(_0x5bc2c0[_0x1dea('0x88')]);}else{_0x5bc2c0[_0x1dea('0x86')]='';}var _0x77e52b=_0x3ae2b2[_0x1dea('0x81')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x3ae2b2)['then'](function(_0x41f528){_0x46f89a=_0x41f528;return getUser(_0x46f89a,_0x77e52b,_0x3ae2b2,_0x30c083['email']);})[_0x1dea('0x29')](function(_0x385698){_0x55532f=_0x385698;logger[_0x1dea('0x3a')]('The\x20User\x20ID\x20is:',_0x55532f['id']);return getEndUser(_0x46f89a,_0x77e52b,_0x3ae2b2,_0x5bc2c0[_0x1dea('0x89')],_0x5bc2c0[_0x1dea('0x8a')],_0x55532f,_0x28db91);})[_0x1dea('0x29')](function(_0x4260dd){_0x59e51f=_0x4260dd;return getCall(_0x46f89a,_0x77e52b,_0x3ae2b2,_0x55532f,_0x59e51f,_0x28db91,_0x5bc2c0,_0x1dea('0x7b'));})['then'](function(_0x27bcc5){if(_0x27bcc5){logger[_0x1dea('0x3a')]('The\x20Call\x20ID\x20is:',_0x27bcc5['id']);logger[_0x1dea('0x3a')](_0x1dea('0x8b'),_0x1dea('0x8c'));emit(util[_0x1dea('0x32')](_0x1dea('0x8d'),_0x30c083[_0x1dea('0x1a')]),_0x1dea('0x8e'),{'uri':_0x1dea('0x8f')+_0x3ae2b2[_0x1dea('0x81')]+_0x1dea('0x90')+_0x27bcc5['id']});}})[_0x1dea('0x2c')](function(_0xcdc821){logger[_0x1dea('0x2d')]('[QUEUE]',JSON[_0x1dea('0x42')](_0xcdc821));});};exports[_0x1dea('0x79')]=function(_0x55afc5,_0x1bb12a,_0x5d5c10,_0x559e6a,_0x4e69c9,_0x122a29,_0x5c92b7){var _0x8d6f41,_0x98eb6c,_0x329a90;_0x122a29['host']=intUtil['stripTrailingSlash'](_0x122a29[_0x1dea('0x81')]);_0x122a29['serverUrl']=intUtil[_0x1dea('0x82')](_0x122a29[_0x1dea('0x83')]);if(_0x5c92b7&&_0x5c92b7[_0x1dea('0x91')]&&_0x5c92b7[_0x1dea('0x91')]!==_0x1dea('0x92')){logger[_0x1dea('0x3a')](_0x1dea('0x93'),_0x1dea('0x85'));_0x1bb12a[_0x1dea('0x86')]=_0x122a29[_0x1dea('0x83')]+'/api/voice/recordings/'+_0x1bb12a[_0x1dea('0x88')]+_0x1dea('0x87')+md5(_0x1bb12a[_0x1dea('0x88')]);}var _0x27f86b=_0x122a29[_0x1dea('0x81')]===_0x1dea('0x94')?'eu':'com';return getAccessToken(_0x122a29)[_0x1dea('0x29')](function(_0x4a960d){_0x329a90=_0x4a960d;return getUser(_0x329a90,_0x27f86b,_0x122a29,_0x559e6a[_0x1dea('0x39')]);})[_0x1dea('0x29')](function(_0x1a8503){_0x8d6f41=_0x1a8503;logger[_0x1dea('0x3a')]('The\x20User\x20ID\x20is:',_0x8d6f41['id']);return getEndUser(_0x329a90,_0x27f86b,_0x122a29,_0x1bb12a[_0x1dea('0x95')],_0x1bb12a[_0x1dea('0x96')],_0x8d6f41,_0x5d5c10);})[_0x1dea('0x29')](function(_0x17aa29){_0x98eb6c=_0x17aa29;return getCall(_0x329a90,_0x27f86b,_0x122a29,_0x8d6f41,_0x98eb6c,_0x5d5c10,_0x1bb12a,_0x1dea('0x97'));})[_0x1dea('0x29')](function(_0x2ff338){if(_0x2ff338){logger[_0x1dea('0x3a')](_0x1dea('0x98'),_0x2ff338['id']);logger[_0x1dea('0x3a')](_0x1dea('0x93'),_0x1dea('0x8c'));emit(util[_0x1dea('0x32')]('user:%s',_0x559e6a[_0x1dea('0x1a')]),_0x1dea('0x8e'),{'uri':_0x1dea('0x8f')+_0x122a29[_0x1dea('0x81')]+_0x1dea('0x90')+_0x2ff338['id']});}})[_0x1dea('0x2c')](function(_0xf3a849){logger[_0x1dea('0x2d')](_0x1dea('0x93'),JSON['stringify'](_0xf3a849));});};exports['unmanaged']=function(_0x131c44,_0x5d8e95,_0x2e2ae7,_0x591435,_0x3b0d1a,_0xa520c7){var _0x106253,_0xc2d5b9,_0x31d944;_0xa520c7[_0x1dea('0x81')]=intUtil[_0x1dea('0x82')](_0xa520c7['host']);_0xa520c7['serverUrl']=intUtil[_0x1dea('0x82')](_0xa520c7['serverUrl']);if(_0x3b0d1a&&_0x3b0d1a['monitor_format']){logger[_0x1dea('0x3a')]('['+_0x5d8e95[_0x1dea('0x6e')]['toUpperCase']()+']',_0x1dea('0x85'));_0x5d8e95[_0x1dea('0x86')]=_0xa520c7[_0x1dea('0x83')]+_0x1dea('0x99')+_0x5d8e95['uniqueid']+_0x1dea('0x87')+md5(_0x5d8e95[_0x1dea('0x88')]);}else{_0x5d8e95[_0x1dea('0x86')]='';}var _0x276593=_0xa520c7[_0x1dea('0x81')]===_0x1dea('0x94')?'eu':_0x1dea('0x9a');return getAccessToken(_0xa520c7)['then'](function(_0x48004c){_0x31d944=_0x48004c;return getUser(_0x31d944,_0x276593,_0xa520c7);})['then'](function(_0x309c0f){_0x106253=_0x309c0f;logger['info']('The\x20User\x20ID\x20is:',_0x106253['id']);return getEndUser(_0x31d944,_0x276593,_0xa520c7,_0x5d8e95[_0x1dea('0x89')],_0x5d8e95[_0x1dea('0x8a')],_0x106253,_0x2e2ae7);})[_0x1dea('0x29')](function(_0x39b351){_0xc2d5b9=_0x39b351;return getCall(_0x31d944,_0x276593,_0xa520c7,_0x106253,_0xc2d5b9,_0x2e2ae7,_0x5d8e95,_0x1dea('0x7b'));})['then'](function(_0x1c80a5){if(_0x1c80a5){logger[_0x1dea('0x3a')](_0x1dea('0x98'),_0x1c80a5['id']);}})[_0x1dea('0x2c')](function(_0x2e8a46){logger[_0x1dea('0x2d')]('['+_0x5d8e95[_0x1dea('0x6e')][_0x1dea('0x9b')]()+']',JSON[_0x1dea('0x42')](_0x2e8a46));});}; \ 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 3e450a8..b0cc3d3 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 _0x8332=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3','format'];(function(_0x4a2c09,_0x32a4c6){var _0x506b25=function(_0x3a716a){while(--_0x3a716a){_0x4a2c09['push'](_0x4a2c09['shift']());}};_0x506b25(++_0x32a4c6);}(_0x8332,0x1f0));var _0x2833=function(_0x298d99,_0x37ae91){_0x298d99=_0x298d99-0x0;var _0x15401a=_0x8332[_0x298d99];return _0x15401a;};'use strict';var util=require(_0x2833('0x0'));var sh=require(_0x2833('0x1'));var Mustache=require(_0x2833('0x2'));var logger=require(_0x2833('0x3'))(_0x2833('0x4'));exports[_0x2833('0x5')]=function(_0x34797c,_0x1ac812){var _0x498ed0=_0x34797c[_0x2833('0x6')]?_0x34797c[_0x2833('0x6')]:_0x2833('0x7');var _0x992436=_0x34797c['data3']?Mustache[_0x2833('0x8')](_0x34797c[_0x2833('0x9')],_0x1ac812):_0x1ac812;sh[_0x2833('0x5')](_0x992436,function(_0xef3db7,_0x1f0c68,_0x46577c){if(_0xef3db7!==0x0){logger['error'](util[_0x2833('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x498ed0,_0x992436,_0xef3db7,_0x46577c));}else{logger[_0x2833('0xb')](util[_0x2833('0xa')](_0x2833('0xc'),_0x498ed0,_0x992436,_0x1f0c68));}});}; \ No newline at end of file +var _0xf42a=['data2','Script','data3','render','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec'];(function(_0x3d80e4,_0x180e06){var _0x150ca2=function(_0x5203d6){while(--_0x5203d6){_0x3d80e4['push'](_0x3d80e4['shift']());}};_0x150ca2(++_0x180e06);}(_0xf42a,0xc7));var _0xaf42=function(_0x1d7dfd,_0x155be9){_0x1d7dfd=_0x1d7dfd-0x0;var _0x529f57=_0xf42a[_0x1d7dfd];return _0x529f57;};'use strict';var util=require(_0xaf42('0x0'));var sh=require(_0xaf42('0x1'));var Mustache=require(_0xaf42('0x2'));var logger=require('../../../../config/logger')(_0xaf42('0x3'));exports[_0xaf42('0x4')]=function(_0x3dfc3d,_0x368427){var _0x5a08d5=_0x3dfc3d[_0xaf42('0x5')]?_0x3dfc3d[_0xaf42('0x5')]:_0xaf42('0x6');var _0x41ae67=_0x3dfc3d[_0xaf42('0x7')]?Mustache[_0xaf42('0x8')](_0x3dfc3d[_0xaf42('0x7')],_0x368427):_0x368427;sh['exec'](_0x41ae67,function(_0x55d1cd,_0x4d12e4,_0x26ed16){if(_0x55d1cd!==0x0){logger['error'](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x5a08d5,_0x41ae67,_0x55d1cd,_0x26ed16));}else{logger[_0xaf42('0x9')](util[_0xaf42('0xa')](_0xaf42('0xb'),_0x5a08d5,_0x41ae67,_0x4d12e4));}});}; \ 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 c507666..ebb9659 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 _0xc4cb=['request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','render','data2','data5','number','headers','data6','error','stack','toUpperCase','GET','POST','PUT','data7','parse','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc4cb,0x154));var _0xbc4c=function(_0x3c25d7,_0x50ebd0){_0x3c25d7=_0x3c25d7-0x0;var _0xd8d3a6=_0xc4cb[_0x3c25d7];return _0xd8d3a6;};'use strict';var rp=require(_0xbc4c('0x0'));var util=require(_0xbc4c('0x1'));var _=require(_0xbc4c('0x2'));var Mustache=require(_0xbc4c('0x3'));var logger=require(_0xbc4c('0x4'))('trigger');exports[_0xbc4c('0x5')]=function(_0x5e37a1,_0x4be6bb){var _0x1069f4,_0xeda992;var _0x5ac82b={'method':_0x5e37a1[_0xbc4c('0x6')]['toUpperCase'](),'uri':Mustache[_0xbc4c('0x7')](_0x5e37a1[_0xbc4c('0x8')],_0x4be6bb),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5e37a1[_0xbc4c('0x9')])===_0xbc4c('0xa')&&parseInt(_0x5e37a1[_0xbc4c('0x9')])>=0x1&&parseInt(_0x5e37a1[_0xbc4c('0x9')])<=0xa?parseInt(_0x5e37a1[_0xbc4c('0x9')])*0x3e8:0x5*0x3e8};try{_0x5ac82b[_0xbc4c('0xb')]=_0x5e37a1[_0xbc4c('0xc')]?JSON['parse'](Mustache[_0xbc4c('0x7')](_0x5e37a1[_0xbc4c('0xc')],_0x4be6bb)):{};}catch(_0xb14100){logger[_0xbc4c('0xd')](_0xb14100[_0xbc4c('0xe')]);}switch(_0x5e37a1[_0xbc4c('0x6')][_0xbc4c('0xf')]()){case _0xbc4c('0x10'):case'DELETE':_0x1069f4=null;_0x5ac82b['qs']=_0x4be6bb;break;case _0xbc4c('0x11'):case _0xbc4c('0x12'):if(_0x5e37a1[_0xbc4c('0x13')]){try{_0x1069f4=JSON[_0xbc4c('0x14')](Mustache[_0xbc4c('0x7')](_0x5e37a1[_0xbc4c('0x13')],_0x4be6bb));_0x5ac82b['body']=_0x1069f4;}catch(_0x4f1905){logger['error'](_0x4f1905[_0xbc4c('0xe')]);logger[_0xbc4c('0xd')](_0xbc4c('0x15'));}}else{_0x1069f4=_0x4be6bb;_0x5ac82b[_0xbc4c('0x16')]=_0x1069f4;}break;}logger['info'](util[_0xbc4c('0x17')](_0xbc4c('0x18'),_0x5e37a1['data1'],_0x5e37a1[_0xbc4c('0x8')],JSON[_0xbc4c('0x19')](_0x5ac82b)));rp(_0x5ac82b)['then'](function(_0x100d4c){_0x1069f4=!_[_0xbc4c('0x1a')](_0x1069f4)?_0xbc4c('0x1b')+_0x1069f4:'';_0xeda992=typeof _0x100d4c[_0xbc4c('0x16')]===_0xbc4c('0x1c')?JSON[_0xbc4c('0x19')](_0x100d4c[_0xbc4c('0x16')]):_0x100d4c[_0xbc4c('0x16')];logger[_0xbc4c('0x1d')](util[_0xbc4c('0x17')](_0xbc4c('0x1e'),_0x5e37a1[_0xbc4c('0x6')],_0x5e37a1['data2'],_0x100d4c[_0xbc4c('0x1f')],_0xeda992));})[_0xbc4c('0x20')](function(_0x40ff21){logger[_0xbc4c('0xd')](util[_0xbc4c('0x17')](_0xbc4c('0x21'),_0x5e37a1[_0xbc4c('0x6')],_0x5e37a1[_0xbc4c('0x8')],_0x40ff21[_0xbc4c('0x1f')],_0x40ff21['name'],_0x40ff21['message']));});}; \ No newline at end of file +var _0x7e52=['exec','data1','toUpperCase','render','data2','data5','number','parse','data6','error','stack','GET','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','util','lodash','mustache','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e52,0x1eb));var _0x27e5=function(_0x4f2cab,_0x56f967){_0x4f2cab=_0x4f2cab-0x0;var _0x2a72ad=_0x7e52[_0x4f2cab];return _0x2a72ad;};'use strict';var rp=require('request-promise');var util=require(_0x27e5('0x0'));var _=require(_0x27e5('0x1'));var Mustache=require(_0x27e5('0x2'));var logger=require(_0x27e5('0x3'))('trigger');exports[_0x27e5('0x4')]=function(_0x566e02,_0x201834){var _0x218272,_0x5bd32c;var _0x3a5113={'method':_0x566e02[_0x27e5('0x5')][_0x27e5('0x6')](),'uri':Mustache[_0x27e5('0x7')](_0x566e02[_0x27e5('0x8')],_0x201834),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x566e02[_0x27e5('0x9')])===_0x27e5('0xa')&&parseInt(_0x566e02[_0x27e5('0x9')])>=0x1&&parseInt(_0x566e02['data5'])<=0xa?parseInt(_0x566e02[_0x27e5('0x9')])*0x3e8:0x5*0x3e8};try{_0x3a5113['headers']=_0x566e02['data6']?JSON[_0x27e5('0xb')](Mustache[_0x27e5('0x7')](_0x566e02[_0x27e5('0xc')],_0x201834)):{};}catch(_0x18a11f){logger[_0x27e5('0xd')](_0x18a11f[_0x27e5('0xe')]);}switch(_0x566e02[_0x27e5('0x5')][_0x27e5('0x6')]()){case _0x27e5('0xf'):case'DELETE':_0x218272=null;_0x3a5113['qs']=_0x201834;break;case _0x27e5('0x10'):case _0x27e5('0x11'):if(_0x566e02['data7']){try{_0x218272=JSON[_0x27e5('0xb')](Mustache[_0x27e5('0x7')](_0x566e02[_0x27e5('0x12')],_0x201834));_0x3a5113[_0x27e5('0x13')]=_0x218272;}catch(_0x49b754){logger['error'](_0x49b754[_0x27e5('0xe')]);logger[_0x27e5('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x218272=_0x201834;_0x3a5113['body']=_0x218272;}break;}logger[_0x27e5('0x14')](util[_0x27e5('0x15')](_0x27e5('0x16'),_0x566e02[_0x27e5('0x5')],_0x566e02[_0x27e5('0x8')],JSON['stringify'](_0x3a5113)));rp(_0x3a5113)[_0x27e5('0x17')](function(_0x326fc3){_0x218272=!_[_0x27e5('0x18')](_0x218272)?_0x27e5('0x19')+_0x218272:'';_0x5bd32c=typeof _0x326fc3['body']===_0x27e5('0x1a')?JSON[_0x27e5('0x1b')](_0x326fc3['body']):_0x326fc3[_0x27e5('0x13')];logger['info'](util[_0x27e5('0x15')](_0x27e5('0x1c'),_0x566e02['data1'],_0x566e02[_0x27e5('0x8')],_0x326fc3[_0x27e5('0x1d')],_0x5bd32c));})[_0x27e5('0x1e')](function(_0x47a67d){logger[_0x27e5('0xd')](util[_0x27e5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x566e02[_0x27e5('0x5')],_0x566e02[_0x27e5('0x8')],_0x47a67d[_0x27e5('0x1d')],_0x47a67d[_0x27e5('0x1f')],_0x47a67d[_0x27e5('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 80f674a..a28651b 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 _0x6ff5=['http','rpc','message','result','catch','error','exports','../../config/logger','routing','client'];(function(_0x12789c,_0xefa52){var _0x3e3c5b=function(_0x204481){while(--_0x204481){_0x12789c['push'](_0x12789c['shift']());}};_0x3e3c5b(++_0xefa52);}(_0x6ff5,0xbb));var _0x56ff=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ff5[_0xa464c9];return _0x3d73c4;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x56ff('0x0'))(_0x56ff('0x1'));var client=jayson[_0x56ff('0x2')][_0x56ff('0x3')]({'port':0x2329});client['Request']=function(_0x5be209,_0x111796){return new BPromise(function(_0x39307b,_0x1e0547){return client['request'](_0x5be209,_0x111796)['then'](function(_0xd024d){logger['debug'](_0x56ff('0x4'),'routing',_0x5be209,_0x111796,_0xd024d);if(_0xd024d['error']){logger['error']('rpc','routing',_0x5be209,_0xd024d['error'][_0x56ff('0x5')],_0x111796);return _0x1e0547(_0xd024d['error']['message']);}else{return _0x39307b(_0xd024d[_0x56ff('0x6')]);}})[_0x56ff('0x7')](function(_0x87f42e){logger[_0x56ff('0x8')]('rpc',_0x56ff('0x1'),_0x5be209,_0x87f42e,_0x111796);return _0x1e0547(_0x87f42e);});});};module[_0x56ff('0x9')]=client; \ No newline at end of file +var _0xfef6=['client','http','request','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x50880b,_0x828ad0){var _0x1f2c16=function(_0xa34224){while(--_0xa34224){_0x50880b['push'](_0x50880b['shift']());}};_0x1f2c16(++_0x828ad0);}(_0xfef6,0xa6));var _0x6fef=function(_0x7d37bc,_0x27289b){_0x7d37bc=_0x7d37bc-0x0;var _0x1e6b2f=_0xfef6[_0x7d37bc];return _0x1e6b2f;};'use strict';var jayson=require(_0x6fef('0x0'));var BPromise=require(_0x6fef('0x1'));var logger=require(_0x6fef('0x2'))('routing');var client=jayson[_0x6fef('0x3')][_0x6fef('0x4')]({'port':0x2329});client['Request']=function(_0x5f3ce0,_0x5b0fff){return new BPromise(function(_0x5c20b2,_0x54460d){return client[_0x6fef('0x5')](_0x5f3ce0,_0x5b0fff)['then'](function(_0x559663){logger['debug'](_0x6fef('0x6'),_0x6fef('0x7'),_0x5f3ce0,_0x5b0fff,_0x559663);if(_0x559663[_0x6fef('0x8')]){logger['error']('rpc',_0x6fef('0x7'),_0x5f3ce0,_0x559663['error']['message'],_0x5b0fff);return _0x54460d(_0x559663[_0x6fef('0x8')][_0x6fef('0x9')]);}else{return _0x5c20b2(_0x559663[_0x6fef('0xa')]);}})[_0x6fef('0xb')](function(_0x14d531){logger['error'](_0x6fef('0x6'),_0x6fef('0x7'),_0x5f3ce0,_0x14d531,_0x5b0fff);return _0x54460d(_0x14d531);});});};module[_0x6fef('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b48eba3..9d8fa30 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 _0xd897=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','mailAccounts','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x1ab1a4,_0x3b1c47){var _0x1e9675=function(_0x8d7bf6){while(--_0x8d7bf6){_0x1ab1a4['push'](_0x1ab1a4['shift']());}};_0x1e9675(++_0x3b1c47);}(_0xd897,0x157));var _0x7d89=function(_0x5df015,_0x1f509d){_0x5df015=_0x5df015-0x0;var _0x27964b=_0xd897[_0x5df015];return _0x27964b;};'use strict';var server=require(_0x7d89('0x0'));var Realtime=require(_0x7d89('0x1'));var EmailChannel=require(_0x7d89('0x2'));var mailAccount=require(_0x7d89('0x3'));var setting=require(_0x7d89('0x4'));var logger=require(_0x7d89('0x5'))(_0x7d89('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x7d89('0x7')]()[_0x7d89('0x8')](mailAccount['getMailAccounts']())[_0x7d89('0x8')](realtime[_0x7d89('0x9')]())[_0x7d89('0x8')](function(){email['refresh'](realtime[_0x7d89('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x7d89('0x8')](function(){return setting['getSettings']();})[_0x7d89('0x8')](function(_0x45a065){return setInterval(initRealtime,_0x45a065[_0x7d89('0xb')]*0x3e8);})[_0x7d89('0xc')](function(_0x434ac7){logger[_0x7d89('0xd')](_0x7d89('0xe'),_0x434ac7);});}main(); \ No newline at end of file +var _0x894c=['./realtime','./lib/email','./rpc/mailAccount','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','catch','./server'];(function(_0x2c0429,_0x4c14b7){var _0x28b624=function(_0x92bb16){while(--_0x92bb16){_0x2c0429['push'](_0x2c0429['shift']());}};_0x28b624(++_0x4c14b7);}(_0x894c,0x8b));var _0xc894=function(_0x12df96,_0x1c844b){_0x12df96=_0x12df96-0x0;var _0x3c5c41=_0x894c[_0x12df96];return _0x3c5c41;};'use strict';var server=require(_0xc894('0x0'));var Realtime=require(_0xc894('0x1'));var EmailChannel=require(_0xc894('0x2'));var mailAccount=require(_0xc894('0x3'));var setting=require('./rpc/setting');var logger=require(_0xc894('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xc894('0x5')]()[_0xc894('0x6')](mailAccount[_0xc894('0x7')]())[_0xc894('0x6')](realtime[_0xc894('0x8')]())[_0xc894('0x6')](function(){email[_0xc894('0x9')](realtime[_0xc894('0xa')]);return realtime;});}function main(){return server[_0xc894('0xb')](realtime,email)[_0xc894('0x6')](function(){return initRealtime();})[_0xc894('0x6')](function(){return setting['getSettings']();})[_0xc894('0x6')](function(_0x53962d){return setInterval(initRealtime,_0x53962d[_0xc894('0xc')]*0x3e8);})[_0xc894('0xd')](function(_0x18027b){logger['error']('Email\x20service\x20initialization',_0x18027b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 5520f64..a866f7b 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 _0x6621=['handleImapEnd','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','handleImapBox','bind','handleImapEmail','end','error','handleImapError','isNil','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6621,0x15e));var _0x1662=function(_0x47888a,_0x7d2f3a){_0x47888a=_0x47888a-0x0;var _0x2b15a4=_0x6621[_0x47888a];return _0x2b15a4;};'use strict';var _=require(_0x1662('0x0'));var moment=require(_0x1662('0x1'));var BPromise=require(_0x1662('0x2'));var md5=require(_0x1662('0x3'));var Redis=require(_0x1662('0x4'));var config=require(_0x1662('0x5'));var logger=require('../../../config/logger')(_0x1662('0x6'));config['redis']=_['defaults'](config[_0x1662('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x1662('0x8'))(new Redis(config[_0x1662('0x7')]));var EmailImap=require(_0x1662('0x9'));var EmailSmtp=require(_0x1662('0xa'));var mailAccount=require(_0x1662('0xb'));var md5Accounts={};function EmailChannel(_0x4c7b95){logger[_0x1662('0xc')](_0x1662('0xd'));this[_0x1662('0xe')]=_0x4c7b95[_0x1662('0xe')];this[_0x1662('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x1662('0x10')][_0x1662('0x11')]=function(_0x5dd77a){var _0x67693b=this['mailAccounts'][_0x5dd77a];var _0x53ee00={'id':_0x67693b['id'],'name':_0x67693b[_0x1662('0x12')],'key':_0x67693b[_0x1662('0x13')],'active':_0x67693b[_0x1662('0x14')],'Imap':{'status':_0x67693b[_0x1662('0x15')][_0x1662('0x16')],'messageStatus':_0x67693b['Imap'][_0x1662('0x17')],'total':_0x67693b[_0x1662('0x15')][_0x1662('0x18')]}};if(_['isNil'](md5Accounts[_0x5dd77a])){md5Accounts[_0x5dd77a]={};}var _0x49c696=md5(JSON['stringify'](_0x53ee00));if(md5Accounts[_0x5dd77a][_0x1662('0x3')]!==_0x49c696){md5Accounts[_0x5dd77a][_0x1662('0x3')]=_0x49c696;io[_0x1662('0x11')](_0x1662('0x19'),_0x53ee00);}};EmailChannel['prototype'][_0x1662('0x1a')]=function(_0x5caf1e){for(var _0x3351a1 in _0x5caf1e){if(_0x5caf1e[_0x1662('0x1b')](_0x3351a1)){if(_0x5caf1e[_0x3351a1][_0x1662('0x15')]&&_0x5caf1e[_0x3351a1]['active']){var _0x2236d7=_0x5caf1e[_0x3351a1][_0x1662('0x15')];if(!_0x2236d7[_0x1662('0x1c')]&&_0x5caf1e[_0x3351a1]['provider']!==_0x1662('0x1d'))_0x2236d7[_0x1662('0x1c')]=_0x5caf1e[_0x3351a1][_0x1662('0x1e')];if(!this[_0x1662('0xf')][_0x1662('0x1b')](_0x2236d7['id'])){this[_0x1662('0xf')][_0x2236d7['id']]=new EmailImap(_0x2236d7,_0x5caf1e[_0x3351a1][_0x1662('0x6')]);this[_0x1662('0xf')][_0x2236d7['id']]['on']('box',this[_0x1662('0x1f')][_0x1662('0x20')](this,_0x3351a1));this[_0x1662('0xf')][_0x2236d7['id']]['on'](_0x1662('0x6'),this[_0x1662('0x21')][_0x1662('0x20')](this,_0x3351a1));this[_0x1662('0xf')][_0x2236d7['id']]['on'](_0x1662('0x22'),this['handleImapEnd'][_0x1662('0x20')](this,_0x3351a1));this['imapAccounts'][_0x2236d7['id']]['on'](_0x1662('0x23'),this[_0x1662('0x24')][_0x1662('0x20')](this,_0x3351a1));}}else{if(_[_0x1662('0x25')](this[_0x1662('0xe')][_0x3351a1][_0x1662('0x15')])){this['mailAccounts'][_0x3351a1][_0x1662('0x15')]={};}this['mailAccounts'][_0x3351a1][_0x1662('0x15')][_0x1662('0x16')]='disabled';this[_0x1662('0xe')][_0x3351a1][_0x1662('0x15')]['messageStatus']='';this[_0x1662('0x11')](_0x3351a1);}}}};EmailChannel[_0x1662('0x10')][_0x1662('0x1f')]=function(_0x567296,_0x563bec){if(this['mailAccounts'][_0x567296]){this['mailAccounts'][_0x567296][_0x1662('0x15')][_0x1662('0x16')]=_0x1662('0x26');this[_0x1662('0xe')][_0x567296][_0x1662('0x15')][_0x1662('0x17')]=_0x563bec['name'];if(_0x563bec[_0x1662('0x27')]){this[_0x1662('0xe')][_0x567296][_0x1662('0x15')]['total']=_0x563bec[_0x1662('0x27')][_0x1662('0x18')];}return this[_0x1662('0x11')](_0x567296);}};EmailChannel['prototype'][_0x1662('0x21')]=function(_0x3cc0ef,_0x5d1383){logger[_0x1662('0xc')](_0x1662('0x28'),_0x5d1383[_0x1662('0x29')],_0x5d1383[_0x1662('0x2a')],_0x5d1383[_0x1662('0x2b')],_0x3cc0ef);if(this[_0x1662('0xe')][_0x3cc0ef]){return mailAccount['notify'](_0x3cc0ef,_0x5d1383)[_0x1662('0x2c')](function(_0x3c46d0){if(_0x3c46d0){logger[_0x1662('0xc')](_0x1662('0x2d'));}})[_0x1662('0x2e')](function(_0x5bd0e4){logger[_0x1662('0x23')](_0x1662('0x2f'),JSON[_0x1662('0x30')](_0x5bd0e4));});}};EmailChannel[_0x1662('0x10')][_0x1662('0x31')]=function(_0xaac58b){if(this[_0x1662('0xe')][_0xaac58b]&&this[_0x1662('0xe')][_0xaac58b][_0x1662('0x15')]){if(this[_0x1662('0xf')][this[_0x1662('0xe')][_0xaac58b][_0x1662('0x15')]['id']]){delete this[_0x1662('0xf')][this[_0x1662('0xe')][_0xaac58b]['Imap']['id']];}this['mailAccounts'][_0xaac58b][_0x1662('0x15')][_0x1662('0x32')]=moment();this[_0x1662('0x11')](_0xaac58b);}};EmailChannel['prototype'][_0x1662('0x24')]=function(_0x483d11,_0x3d61b1){if(this[_0x1662('0xe')][_0x483d11]){this['mailAccounts'][_0x483d11]['Imap'][_0x1662('0x16')]=_0x1662('0x23');this[_0x1662('0xe')][_0x483d11][_0x1662('0x15')][_0x1662('0x17')]=_0x3d61b1;return this[_0x1662('0x11')](_0x483d11);}};EmailChannel[_0x1662('0x10')][_0x1662('0x33')]=function(_0x34d184,_0x65ed4a){return this[_0x1662('0x34')][_0x1662('0x35')](_0x34d184,_0x65ed4a);};EmailChannel['prototype'][_0x1662('0x36')]=function(_0x355342){var _0x437e3f=this;if(this[_0x1662('0xe')][_0x355342['id']]){if(_[_0x1662('0x25')](this['mailAccounts'][_0x355342['id']][_0x1662('0x37')])){this[_0x1662('0xe')][_0x355342['id']][_0x1662('0x37')]={};}this['mailAccounts'][_0x355342['id']][_0x1662('0x37')]['lastSync']=moment();return new BPromise(function(_0x5c9a6f,_0x563e36){return _0x437e3f[_0x1662('0x34')][_0x1662('0x38')](_0x355342)['then'](function(_0x444fdb){_0x437e3f[_0x1662('0xe')][_0x355342['id']][_0x1662('0x37')]['status']='verified';_0x437e3f['mailAccounts'][_0x355342['id']][_0x1662('0x37')][_0x1662('0x17')]='';_0x437e3f[_0x1662('0x11')](_0x355342['id']);_0x5c9a6f(_0x444fdb);})['catch'](function(_0x19a2c5){_0x437e3f['mailAccounts'][_0x355342['id']][_0x1662('0x37')][_0x1662('0x16')]=_0x1662('0x23');_0x437e3f[_0x1662('0xe')][_0x355342['id']][_0x1662('0x37')][_0x1662('0x17')]=_0x19a2c5;_0x437e3f[_0x1662('0x11')](_0x355342['id']);_0x563e36(_0x19a2c5);});});}return this[_0x1662('0x34')][_0x1662('0x38')](_0x355342);};module['exports']=EmailChannel; \ No newline at end of file +var _0x48ea=['../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','key','active','status','Imap','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','bind','handleImapEnd','disabled','messageStatus','handleImapBox','connected','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','error','sendMail','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap'];(function(_0x40a49f,_0x4f5baf){var _0x65d420=function(_0x49b344){while(--_0x49b344){_0x40a49f['push'](_0x40a49f['shift']());}};_0x65d420(++_0x4f5baf);}(_0x48ea,0x1b4));var _0xa48e=function(_0x1e13c2,_0xcc8231){_0x1e13c2=_0x1e13c2-0x0;var _0x38b874=_0x48ea[_0x1e13c2];return _0x38b874;};'use strict';var _=require(_0xa48e('0x0'));var moment=require(_0xa48e('0x1'));var BPromise=require(_0xa48e('0x2'));var md5=require(_0xa48e('0x3'));var Redis=require('ioredis');var config=require(_0xa48e('0x4'));var logger=require(_0xa48e('0x5'))(_0xa48e('0x6'));config[_0xa48e('0x7')]=_[_0xa48e('0x8')](config[_0xa48e('0x7')],{'host':_0xa48e('0x9'),'port':0x18eb});var io=require(_0xa48e('0xa'))(new Redis(config['redis']));var EmailImap=require(_0xa48e('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xa48e('0xc'));var md5Accounts={};function EmailChannel(_0x18a3f1){logger[_0xa48e('0xd')](_0xa48e('0xe'));this[_0xa48e('0xf')]=_0x18a3f1['mailAccounts'];this[_0xa48e('0x10')]={};this[_0xa48e('0x11')]=new EmailSmtp();}EmailChannel[_0xa48e('0x12')]['emit']=function(_0x8455de){var _0x141f45=this['mailAccounts'][_0x8455de];var _0x1c562a={'id':_0x141f45['id'],'name':_0x141f45['name'],'key':_0x141f45[_0xa48e('0x13')],'active':_0x141f45[_0xa48e('0x14')],'Imap':{'status':_0x141f45['Imap'][_0xa48e('0x15')],'messageStatus':_0x141f45['Imap']['messageStatus'],'total':_0x141f45[_0xa48e('0x16')]['total']}};if(_[_0xa48e('0x17')](md5Accounts[_0x8455de])){md5Accounts[_0x8455de]={};}var _0x2ac090=md5(JSON[_0xa48e('0x18')](_0x1c562a));if(md5Accounts[_0x8455de][_0xa48e('0x3')]!==_0x2ac090){md5Accounts[_0x8455de][_0xa48e('0x3')]=_0x2ac090;io[_0xa48e('0x19')](_0xa48e('0x1a'),_0x1c562a);}};EmailChannel[_0xa48e('0x12')][_0xa48e('0x1b')]=function(_0x1fe2ff){for(var _0x5e6ab2 in _0x1fe2ff){if(_0x1fe2ff[_0xa48e('0x1c')](_0x5e6ab2)){if(_0x1fe2ff[_0x5e6ab2][_0xa48e('0x16')]&&_0x1fe2ff[_0x5e6ab2][_0xa48e('0x14')]){var _0x494be5=_0x1fe2ff[_0x5e6ab2][_0xa48e('0x16')];if(!_0x494be5[_0xa48e('0x1d')]&&_0x1fe2ff[_0x5e6ab2][_0xa48e('0x1e')]!==_0xa48e('0x1f'))_0x494be5[_0xa48e('0x1d')]=_0x1fe2ff[_0x5e6ab2][_0xa48e('0x1e')];if(!this[_0xa48e('0x10')][_0xa48e('0x1c')](_0x494be5['id'])){this[_0xa48e('0x10')][_0x494be5['id']]=new EmailImap(_0x494be5,_0x1fe2ff[_0x5e6ab2]['email']);this['imapAccounts'][_0x494be5['id']]['on']('box',this['handleImapBox'][_0xa48e('0x20')](this,_0x5e6ab2));this[_0xa48e('0x10')][_0x494be5['id']]['on'](_0xa48e('0x6'),this['handleImapEmail'][_0xa48e('0x20')](this,_0x5e6ab2));this[_0xa48e('0x10')][_0x494be5['id']]['on']('end',this[_0xa48e('0x21')][_0xa48e('0x20')](this,_0x5e6ab2));this[_0xa48e('0x10')][_0x494be5['id']]['on']('error',this['handleImapError'][_0xa48e('0x20')](this,_0x5e6ab2));}}else{if(_[_0xa48e('0x17')](this[_0xa48e('0xf')][_0x5e6ab2][_0xa48e('0x16')])){this['mailAccounts'][_0x5e6ab2][_0xa48e('0x16')]={};}this[_0xa48e('0xf')][_0x5e6ab2][_0xa48e('0x16')]['status']=_0xa48e('0x22');this[_0xa48e('0xf')][_0x5e6ab2][_0xa48e('0x16')][_0xa48e('0x23')]='';this[_0xa48e('0x19')](_0x5e6ab2);}}}};EmailChannel[_0xa48e('0x12')][_0xa48e('0x24')]=function(_0x5d8651,_0x27dfc1){if(this[_0xa48e('0xf')][_0x5d8651]){this[_0xa48e('0xf')][_0x5d8651]['Imap'][_0xa48e('0x15')]=_0xa48e('0x25');this[_0xa48e('0xf')][_0x5d8651][_0xa48e('0x16')][_0xa48e('0x23')]=_0x27dfc1['name'];if(_0x27dfc1[_0xa48e('0x26')]){this['mailAccounts'][_0x5d8651][_0xa48e('0x16')][_0xa48e('0x27')]=_0x27dfc1[_0xa48e('0x26')][_0xa48e('0x27')];}return this[_0xa48e('0x19')](_0x5d8651);}};EmailChannel[_0xa48e('0x12')][_0xa48e('0x28')]=function(_0x3e2554,_0x2aafbb){logger[_0xa48e('0xd')](_0xa48e('0x29'),_0x2aafbb['firstName'],_0x2aafbb[_0xa48e('0x2a')],_0x2aafbb['from'],_0x3e2554);if(this['mailAccounts'][_0x3e2554]){return mailAccount[_0xa48e('0x2b')](_0x3e2554,_0x2aafbb)[_0xa48e('0x2c')](function(_0xb845c6){if(_0xb845c6){logger[_0xa48e('0xd')](_0xa48e('0x2d'));}})[_0xa48e('0x2e')](function(_0x3a6e2d){logger['error'](_0xa48e('0x2f'),JSON[_0xa48e('0x18')](_0x3a6e2d));});}};EmailChannel[_0xa48e('0x12')][_0xa48e('0x21')]=function(_0x264c91){if(this[_0xa48e('0xf')][_0x264c91]&&this[_0xa48e('0xf')][_0x264c91][_0xa48e('0x16')]){if(this[_0xa48e('0x10')][this[_0xa48e('0xf')][_0x264c91][_0xa48e('0x16')]['id']]){delete this[_0xa48e('0x10')][this[_0xa48e('0xf')][_0x264c91][_0xa48e('0x16')]['id']];}this[_0xa48e('0xf')][_0x264c91][_0xa48e('0x16')][_0xa48e('0x30')]=moment();this[_0xa48e('0x19')](_0x264c91);}};EmailChannel[_0xa48e('0x12')][_0xa48e('0x31')]=function(_0x4b1a4f,_0x3b3532){if(this[_0xa48e('0xf')][_0x4b1a4f]){this[_0xa48e('0xf')][_0x4b1a4f][_0xa48e('0x16')][_0xa48e('0x15')]=_0xa48e('0x32');this[_0xa48e('0xf')][_0x4b1a4f][_0xa48e('0x16')]['messageStatus']=_0x3b3532;return this['emit'](_0x4b1a4f);}};EmailChannel[_0xa48e('0x12')][_0xa48e('0x33')]=function(_0x412825,_0x1377de){return this['smtp']['send'](_0x412825,_0x1377de);};EmailChannel[_0xa48e('0x12')]['verifySmtp']=function(_0x1a4aee){var _0x39f898=this;if(this[_0xa48e('0xf')][_0x1a4aee['id']]){if(_[_0xa48e('0x17')](this[_0xa48e('0xf')][_0x1a4aee['id']][_0xa48e('0x34')])){this[_0xa48e('0xf')][_0x1a4aee['id']][_0xa48e('0x34')]={};}this[_0xa48e('0xf')][_0x1a4aee['id']][_0xa48e('0x34')]['lastSync']=moment();return new BPromise(function(_0x417a94,_0x479661){return _0x39f898['smtp'][_0xa48e('0x35')](_0x1a4aee)[_0xa48e('0x2c')](function(_0x3a2d93){_0x39f898[_0xa48e('0xf')][_0x1a4aee['id']][_0xa48e('0x34')][_0xa48e('0x15')]=_0xa48e('0x36');_0x39f898['mailAccounts'][_0x1a4aee['id']][_0xa48e('0x34')][_0xa48e('0x23')]='';_0x39f898[_0xa48e('0x19')](_0x1a4aee['id']);_0x417a94(_0x3a2d93);})['catch'](function(_0x543270){_0x39f898[_0xa48e('0xf')][_0x1a4aee['id']]['Smtp'][_0xa48e('0x15')]=_0xa48e('0x32');_0x39f898['mailAccounts'][_0x1a4aee['id']][_0xa48e('0x34')][_0xa48e('0x23')]=_0x543270;_0x39f898[_0xa48e('0x19')](_0x1a4aee['id']);_0x479661(_0x543270);});});}return this[_0xa48e('0x11')][_0xa48e('0x35')](_0x1a4aee);};module[_0xa48e('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 668c23b..baf5b98 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 _0xc5f3=['handleOpenBox','prototype','handleError','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','stringify','textCode','upperFirst','exports','lodash','util','imap','mailparser','Iconv','EventEmitter','./utils','../../../config/logger','email','getAccount','account','once','handleReady','end','bind','error','connect','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox'];(function(_0x5be72d,_0x1a3f83){var _0x2f7e97=function(_0x3450a9){while(--_0x3450a9){_0x5be72d['push'](_0x5be72d['shift']());}};_0x2f7e97(++_0x1a3f83);}(_0xc5f3,0x140));var _0x3c5f=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0xc5f3[_0x2872b0];return _0x58b379;};'use strict';var _=require(_0x3c5f('0x0'));var util=require(_0x3c5f('0x1'));var Imap=require(_0x3c5f('0x2'));var simpleParser=require(_0x3c5f('0x3'))['simpleParser'];var Iconv=require('iconv')[_0x3c5f('0x4')];var EventEmitter=require('events')[_0x3c5f('0x5')];var utils=require(_0x3c5f('0x6'));var logger=require(_0x3c5f('0x7'))(_0x3c5f('0x8'));function EmailImap(_0x1f7ede,_0x2891c3){this['mailbox']=_0x1f7ede['mailbox'];this['account']=this[_0x3c5f('0x9')](_0x1f7ede,_0x2891c3);this[_0x3c5f('0x2')]=new Imap(this[_0x3c5f('0xa')]);this['imap'][_0x3c5f('0xb')]('ready',this[_0x3c5f('0xc')]['bind'](this));this[_0x3c5f('0x2')]['once'](_0x3c5f('0xd'),this['handleEnd'][_0x3c5f('0xe')](this));this[_0x3c5f('0x2')]['on'](_0x3c5f('0xf'),this['handleError'][_0x3c5f('0xe')](this));this[_0x3c5f('0x2')][_0x3c5f('0x10')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x3c5f('0x9')]=function(_0x169e75,_0x472156){var _0x3377cf={'connTimeout':_0x169e75[_0x3c5f('0x11')]?_0x169e75[_0x3c5f('0x11')]*0x3e8:0x2710,'authTimeout':_0x169e75['authTimeout']?_0x169e75[_0x3c5f('0x12')]*0x3e8:0x1388};if(_0x169e75[_0x3c5f('0x13')]){_0x3377cf[_0x3c5f('0x14')]=_0x169e75['user'];if(_0x169e75[_0x3c5f('0x15')]){_0x3377cf[_0x3c5f('0x16')]=utils[_0x3c5f('0x17')](_0x169e75[_0x3c5f('0x18')]['data5'],_0x169e75['user']);}else{_0x3377cf[_0x3c5f('0x19')]=_0x169e75['password'];}}else{if(_0x169e75[_0x3c5f('0x1a')]){_0x3377cf[_0x3c5f('0x14')]=_0x169e75['user'];_0x3377cf[_0x3c5f('0x19')]=_0x169e75[_0x3c5f('0x19')];}}_0x3377cf['email']=_0x472156||_0x169e75['user']||_0x3c5f('0x1b');_0x3377cf[_0x3c5f('0x1c')]=_0x169e75[_0x3c5f('0x1c')];_0x3377cf[_0x3c5f('0x1d')]=_0x169e75[_0x3c5f('0x1d')]||0x3e1;if(_0x169e75['tls']){_0x3377cf[_0x3c5f('0x1e')]=!![];}else{_0x3377cf['tls']=![];_0x3377cf[_0x3c5f('0x1f')]=_0x3c5f('0x20');}return _0x3377cf;};EmailImap['prototype'][_0x3c5f('0xc')]=function(){this[_0x3c5f('0x2')][_0x3c5f('0x21')](this['mailbox'],![],this[_0x3c5f('0x22')]['bind'](this));};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x22')]=function(_0x4e9eb6,_0x2a0a1e){if(_0x4e9eb6){this[_0x3c5f('0x24')](_0x4e9eb6,!![]);}else{this[_0x3c5f('0x25')](_0x3c5f('0x26'),_0x2a0a1e);this[_0x3c5f('0x27')]();}};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x28')]=function(_0xf5074d){if(_0xf5074d){this[_0x3c5f('0x24')](_0xf5074d,!![]);}else{this[_0x3c5f('0x2')][_0x3c5f('0xd')]();}};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x27')]=function(){this[_0x3c5f('0x2')]['search']([_0x3c5f('0x29')],this[_0x3c5f('0x2a')]['bind'](this));};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x2a')]=function(_0x3f334d,_0x518c32){if(_0x3f334d){this[_0x3c5f('0x24')](_0x3f334d,!![]);}else{if(_0x518c32['length']){try{var _0x457135=this[_0x3c5f('0x2')][_0x3c5f('0x2b')](_0x518c32,{'bodies':'','markSeen':!![]});_0x457135['on'](_0x3c5f('0x2c'),this[_0x3c5f('0x2d')]['bind'](this));_0x457135[_0x3c5f('0xb')](_0x3c5f('0xf'),this[_0x3c5f('0x2e')][_0x3c5f('0xe')](this));_0x457135[_0x3c5f('0xb')]('end',this[_0x3c5f('0x2f')][_0x3c5f('0xe')](this));}catch(_0x153249){logger['error'](_0x153249);}}else{this['imap'][_0x3c5f('0x30')](!![],this[_0x3c5f('0x28')][_0x3c5f('0xe')](this));}}};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x2d')]=function(_0x5c96bb){_0x5c96bb['on'](_0x3c5f('0x31'),this['handleMessageBody'][_0x3c5f('0xe')](this));_0x5c96bb[_0x3c5f('0xb')](_0x3c5f('0x32'),this[_0x3c5f('0x33')][_0x3c5f('0xe')](this));_0x5c96bb[_0x3c5f('0xb')]('end',this[_0x3c5f('0x34')][_0x3c5f('0xe')](this));};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x35')]=function(_0x18dce0){simpleParser(_0x18dce0,{'Iconv':Iconv},this[_0x3c5f('0x36')]['bind'](this));};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x33')]=function(){};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x34')]=function(){};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x36')]=function(_0xf821a8,_0x452b74){if(_0xf821a8){logger[_0x3c5f('0xf')](_0xf821a8);}else{var _0x2fc991=this;utils['parser'](this[_0x3c5f('0xa')],_0x452b74,function(_0xdc7c53){_0x2fc991[_0x3c5f('0x25')]('email',_0xdc7c53);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x3c5f('0x2')][_0x3c5f('0x30')](!![],this[_0x3c5f('0x28')]['bind'](this));};EmailImap[_0x3c5f('0x23')]['handleFetchError']=function(_0x2d1d57){this[_0x3c5f('0x24')](_0x2d1d57);this[_0x3c5f('0x2')]['closeBox'](!![],this[_0x3c5f('0x28')]['bind'](this));};EmailImap[_0x3c5f('0x23')]['handleEnd']=function(){this[_0x3c5f('0x25')]('end');};EmailImap[_0x3c5f('0x23')][_0x3c5f('0x24')]=function(_0x3dd29d,_0x17a848){logger[_0x3c5f('0xf')](_0x3c5f('0x24'),this[_0x3c5f('0xa')][_0x3c5f('0x8')],JSON[_0x3c5f('0x37')](_0x3dd29d));var _0x33ac3b='';if(_0x3dd29d){if(_0x3dd29d[_0x3c5f('0x38')]){_0x33ac3b=_0x3dd29d[_0x3c5f('0x38')];}else{for(var _0x29d021 in _0x3dd29d){if(_0x3dd29d['hasOwnProperty'](_0x29d021)){_0x33ac3b+=_[_0x3c5f('0x39')](_0x29d021)+':\x20'+_0x3dd29d[_0x29d021]+'\x0a';}}}}if(_0x17a848){this[_0x3c5f('0x2')][_0x3c5f('0xd')]();}else{this[_0x3c5f('0x25')](_0x3c5f('0xf'),_0x33ac3b);this[_0x3c5f('0x25')](_0x3c5f('0xd'));}};module[_0x3c5f('0x3a')]=EmailImap; \ No newline at end of file +var _0x6334=['simpleParser','iconv','Iconv','events','../../../config/logger','email','mailbox','account','getAccount','imap','once','handleReady','bind','end','error','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleOpenBox','handleError','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleMessageBody','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','closeBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6334,0x166));var _0x4633=function(_0x246890,_0x46b964){_0x246890=_0x246890-0x0;var _0x2b2a5a=_0x6334[_0x246890];return _0x2b2a5a;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x4633('0x2')];var Iconv=require(_0x4633('0x3'))[_0x4633('0x4')];var EventEmitter=require(_0x4633('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x4633('0x6'))(_0x4633('0x7'));function EmailImap(_0x57ed99,_0xe4b9ba){this[_0x4633('0x8')]=_0x57ed99[_0x4633('0x8')];this[_0x4633('0x9')]=this[_0x4633('0xa')](_0x57ed99,_0xe4b9ba);this[_0x4633('0xb')]=new Imap(this[_0x4633('0x9')]);this[_0x4633('0xb')][_0x4633('0xc')]('ready',this[_0x4633('0xd')][_0x4633('0xe')](this));this[_0x4633('0xb')][_0x4633('0xc')](_0x4633('0xf'),this['handleEnd'][_0x4633('0xe')](this));this[_0x4633('0xb')]['on'](_0x4633('0x10'),this['handleError'][_0x4633('0xe')](this));this[_0x4633('0xb')][_0x4633('0x11')]();}util[_0x4633('0x12')](EmailImap,EventEmitter);EmailImap[_0x4633('0x13')][_0x4633('0xa')]=function(_0xc60057,_0x1f9dfd){var _0xd6b894={'connTimeout':_0xc60057[_0x4633('0x14')]?_0xc60057['connTimeout']*0x3e8:0x2710,'authTimeout':_0xc60057[_0x4633('0x15')]?_0xc60057[_0x4633('0x15')]*0x3e8:0x1388};if(_0xc60057[_0x4633('0x16')]){_0xd6b894['user']=_0xc60057[_0x4633('0x17')];if(_0xc60057[_0x4633('0x18')]){_0xd6b894['xoauth2']=utils[_0x4633('0x19')](_0xc60057[_0x4633('0x1a')][_0x4633('0x1b')],_0xc60057['user']);}else{_0xd6b894[_0x4633('0x1c')]=_0xc60057[_0x4633('0x1c')];}}else{if(_0xc60057[_0x4633('0x1d')]){_0xd6b894[_0x4633('0x17')]=_0xc60057[_0x4633('0x17')];_0xd6b894[_0x4633('0x1c')]=_0xc60057[_0x4633('0x1c')];}}_0xd6b894[_0x4633('0x7')]=_0x1f9dfd||_0xc60057[_0x4633('0x17')]||_0x4633('0x1e');_0xd6b894[_0x4633('0x1f')]=_0xc60057[_0x4633('0x1f')];_0xd6b894[_0x4633('0x20')]=_0xc60057[_0x4633('0x20')]||0x3e1;if(_0xc60057[_0x4633('0x21')]){_0xd6b894[_0x4633('0x21')]=!![];}else{_0xd6b894[_0x4633('0x21')]=![];_0xd6b894[_0x4633('0x22')]=_0x4633('0x23');}return _0xd6b894;};EmailImap[_0x4633('0x13')][_0x4633('0xd')]=function(){this[_0x4633('0xb')]['openBox'](this[_0x4633('0x8')],![],this[_0x4633('0x24')]['bind'](this));};EmailImap['prototype']['handleOpenBox']=function(_0x2fc7a7,_0x52cd40){if(_0x2fc7a7){this[_0x4633('0x25')](_0x2fc7a7,!![]);}else{this[_0x4633('0x26')](_0x4633('0x27'),_0x52cd40);this['readUnseen']();}};EmailImap[_0x4633('0x13')][_0x4633('0x28')]=function(_0x322583){if(_0x322583){this[_0x4633('0x25')](_0x322583,!![]);}else{this[_0x4633('0xb')][_0x4633('0xf')]();}};EmailImap[_0x4633('0x13')][_0x4633('0x29')]=function(){this[_0x4633('0xb')][_0x4633('0x2a')]([_0x4633('0x2b')],this['handleReadUnseen'][_0x4633('0xe')](this));};EmailImap['prototype'][_0x4633('0x2c')]=function(_0x4a60bd,_0x24fca6){if(_0x4a60bd){this[_0x4633('0x25')](_0x4a60bd,!![]);}else{if(_0x24fca6['length']){try{var _0x36ddd3=this[_0x4633('0xb')][_0x4633('0x2d')](_0x24fca6,{'bodies':'','markSeen':!![]});_0x36ddd3['on'](_0x4633('0x2e'),this['handleFetchMessage'][_0x4633('0xe')](this));_0x36ddd3[_0x4633('0xc')](_0x4633('0x10'),this['handleFetchError'][_0x4633('0xe')](this));_0x36ddd3[_0x4633('0xc')]('end',this['handleFetchEnd']['bind'](this));}catch(_0x266c38){logger[_0x4633('0x10')](_0x266c38);}}else{this[_0x4633('0xb')]['closeBox'](!![],this[_0x4633('0x28')][_0x4633('0xe')](this));}}};EmailImap['prototype'][_0x4633('0x2f')]=function(_0x2dbae2){_0x2dbae2['on']('body',this[_0x4633('0x30')]['bind'](this));_0x2dbae2[_0x4633('0xc')]('attributes',this['handleMessageAttributes'][_0x4633('0xe')](this));_0x2dbae2[_0x4633('0xc')](_0x4633('0xf'),this[_0x4633('0x31')]['bind'](this));};EmailImap['prototype'][_0x4633('0x30')]=function(_0x27c4d9){simpleParser(_0x27c4d9,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap['prototype'][_0x4633('0x32')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x4633('0x13')][_0x4633('0x33')]=function(_0x29acc9,_0x2b42ff){if(_0x29acc9){logger[_0x4633('0x10')](_0x29acc9);}else{var _0x20c50d=this;utils[_0x4633('0x34')](this[_0x4633('0x9')],_0x2b42ff,function(_0x32d404){_0x20c50d[_0x4633('0x26')](_0x4633('0x7'),_0x32d404);});}};EmailImap[_0x4633('0x13')][_0x4633('0x35')]=function(){this['imap']['closeBox'](!![],this['handleCloseBox'][_0x4633('0xe')](this));};EmailImap['prototype']['handleFetchError']=function(_0x37c07e){this[_0x4633('0x25')](_0x37c07e);this['imap'][_0x4633('0x36')](!![],this['handleCloseBox'][_0x4633('0xe')](this));};EmailImap[_0x4633('0x13')][_0x4633('0x37')]=function(){this[_0x4633('0x26')]('end');};EmailImap['prototype'][_0x4633('0x25')]=function(_0x35a643,_0x13a2b0){logger[_0x4633('0x10')]('handleError',this['account']['email'],JSON[_0x4633('0x38')](_0x35a643));var _0x3fce03='';if(_0x35a643){if(_0x35a643[_0x4633('0x39')]){_0x3fce03=_0x35a643['textCode'];}else{for(var _0x23ef1e in _0x35a643){if(_0x35a643[_0x4633('0x3a')](_0x23ef1e)){_0x3fce03+=_[_0x4633('0x3b')](_0x23ef1e)+':\x20'+_0x35a643[_0x23ef1e]+'\x0a';}}}}if(_0x13a2b0){this[_0x4633('0xb')][_0x4633('0xf')]();}else{this[_0x4633('0x26')]('error',_0x3fce03);this[_0x4633('0x26')](_0x4633('0xf'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 213c37a..4320463 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 _0x7956=['prototype','send','createTransport','sendMail','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x48da8f,_0x53a909){var _0x44c4bd=function(_0x5d71f0){while(--_0x5d71f0){_0x48da8f['push'](_0x48da8f['shift']());}};_0x44c4bd(++_0x53a909);}(_0x7956,0x1de));var _0x6795=function(_0x356c60,_0x2c7026){_0x356c60=_0x356c60-0x0;var _0xf431c=_0x7956[_0x356c60];return _0xf431c;};'use strict';var nodemailer=require(_0x6795('0x0'));var inlineBase64=require(_0x6795('0x1'));function EmailSmtp(){}EmailSmtp[_0x6795('0x2')][_0x6795('0x3')]=function(_0x42b1a0,_0x54e40b){return new Promise(function(_0x1787d9,_0x282e1d){var _0x2d6a04=nodemailer[_0x6795('0x4')](_0x42b1a0);_0x2d6a04['use']('compile',inlineBase64());_0x2d6a04[_0x6795('0x5')](_0x54e40b,function(_0x275504,_0x4b82f3){if(_0x275504){_0x282e1d(_0x275504['toString']());}else{_0x1787d9(_0x4b82f3);}});});};EmailSmtp['prototype']['verify']=function(_0x10f9c7){return new Promise(function(_0x499710,_0x19bb15){var _0x4bc2e2=nodemailer[_0x6795('0x4')](_0x10f9c7);_0x4bc2e2[_0x6795('0x6')](function(_0x24450a,_0x3bb4d4){if(_0x24450a){_0x19bb15(_0x24450a['toString']());}else{if(_0x3bb4d4){_0x499710(_0x3bb4d4);}else{_0x19bb15(_0x6795('0x7'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xe9c0=['nodemailer-plugin-inline-base64','prototype','send','createTransport','toString','verify','exports','nodemailer'];(function(_0x37a0ce,_0x28dc04){var _0x569f4e=function(_0x1671c0){while(--_0x1671c0){_0x37a0ce['push'](_0x37a0ce['shift']());}};_0x569f4e(++_0x28dc04);}(_0xe9c0,0x14f));var _0x0e9c=function(_0x142143,_0xea43f0){_0x142143=_0x142143-0x0;var _0xd8f2d2=_0xe9c0[_0x142143];return _0xd8f2d2;};'use strict';var nodemailer=require(_0x0e9c('0x0'));var inlineBase64=require(_0x0e9c('0x1'));function EmailSmtp(){}EmailSmtp[_0x0e9c('0x2')][_0x0e9c('0x3')]=function(_0x4d5cad,_0x143a1d){return new Promise(function(_0x89448d,_0x31b821){var _0x482e97=nodemailer[_0x0e9c('0x4')](_0x4d5cad);_0x482e97['use']('compile',inlineBase64());_0x482e97['sendMail'](_0x143a1d,function(_0x29406a,_0x203ba7){if(_0x29406a){_0x31b821(_0x29406a[_0x0e9c('0x5')]());}else{_0x89448d(_0x203ba7);}});});};EmailSmtp['prototype'][_0x0e9c('0x6')]=function(_0x3131ad){return new Promise(function(_0x3eaf3a,_0x469108){var _0x14a22a=nodemailer[_0x0e9c('0x4')](_0x3131ad);_0x14a22a[_0x0e9c('0x6')](function(_0x6802b4,_0xcee14a){if(_0x6802b4){_0x469108(_0x6802b4[_0x0e9c('0x5')]());}else{if(_0xcee14a){_0x3eaf3a(_0xcee14a);}else{_0x469108('Not\x20verifired');}}});});};module[_0x0e9c('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 68d2e7f..f0dcaad 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 _0xbe77=['Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','randomstring','path','util','node-tnef','email','value','address','anonymous','generate','@xcally.com','head','name','indexOf','split','length','join','Anonymous','pop','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','\x20[Attachment:\x20','body','textAsHtml'];(function(_0x1b41e1,_0x52d286){var _0x35279d=function(_0x585ae1){while(--_0x585ae1){_0x1b41e1['push'](_0x1b41e1['shift']());}};_0x35279d(++_0x52d286);}(_0xbe77,0x14e));var _0x7be7=function(_0x22bd55,_0x253d99){_0x22bd55=_0x22bd55-0x0;var _0x529e6d=_0xbe77[_0x22bd55];return _0x529e6d;};'use strict';var _=require(_0x7be7('0x0'));var moment=require('moment');var random=require(_0x7be7('0x1'));var fs=require('fs');var path=require(_0x7be7('0x2'));var util=require(_0x7be7('0x3'));var tnef=require(_0x7be7('0x4'));var logger=require('../../../config/logger')(_0x7be7('0x5'));var config=require('../../../config/environment');function getAddress(_0x38de4e){var _0x188e30=_['head'](_0x38de4e[_0x7be7('0x6')]);return _0x188e30&&_0x188e30[_0x7be7('0x7')]?_0x188e30[_0x7be7('0x7')]:_0x7be7('0x8')+random[_0x7be7('0x9')](0x6)+_0x7be7('0xa');}function getFirstName(_0x33034c){var _0x4ede00=_[_0x7be7('0xb')](_0x33034c[_0x7be7('0x6')]);if(_0x4ede00&&_0x4ede00[_0x7be7('0xc')]){if(_0x4ede00[_0x7be7('0xc')]==_0x4ede00[_0x7be7('0x7')]){return _0x4ede00['name']['substring'](0x0,_0x4ede00[_0x7be7('0xc')][_0x7be7('0xd')]('@'));}var _0x3dfd7d=_0x4ede00[_0x7be7('0xc')][_0x7be7('0xe')](/\s+/);return _0x3dfd7d[_0x7be7('0xf')]>0x1?_0x3dfd7d['slice'](0x0,-0x1)[_0x7be7('0x10')]('\x20'):_0x4ede00[_0x7be7('0xc')];}return _0x7be7('0x11');}function getLastName(_0x2ed08d){var _0x1196d9=_[_0x7be7('0xb')](_0x2ed08d['value']);if(_0x1196d9&&_0x1196d9['name']){var _0x43d2fb=_0x1196d9[_0x7be7('0xc')]['split'](/\s+/);return _0x43d2fb[_0x7be7('0xf')]>0x1?_0x43d2fb[_0x7be7('0x12')]():'';}return'';}function getMails(_0x4ead22,_0xd09bc){var _0x7be6fd='';for(var _0x5581a5=0x0;_0x5581a5<_0xd09bc[_0x7be7('0x6')][_0x7be7('0xf')];_0x5581a5+=0x1){if(_0xd09bc['value'][_0x5581a5]['address']!==_0x4ead22){if(!_['isEmpty'](_0x7be6fd)){_0x7be6fd+=',';}_0x7be6fd+=_0xd09bc[_0x7be7('0x6')][_0x5581a5][_0x7be7('0xc')]||_0xd09bc[_0x7be7('0x6')][_0x5581a5][_0x7be7('0x7')]||'';_0x7be6fd+='\x20<';_0x7be6fd+=_0xd09bc[_0x7be7('0x6')][_0x5581a5]['address']?_0xd09bc[_0x7be7('0x6')][_0x5581a5][_0x7be7('0x7')]:_0x7be7('0x8')+random[_0x7be7('0x9')](0x6)+'@xcally.com';_0x7be6fd+='>';}}return _0x7be6fd;}function parseEmail(_0x3659df,_0x3ad305,_0x148c7d){if(_0x3ad305[_0x7be7('0x13')]){var _0xd50312=/)<[^<]*)*<\/script>/gi;while(_0xd50312[_0x7be7('0x14')](_0x3ad305[_0x7be7('0x13')])){_0x3ad305['html']=_0x3ad305['html'][_0x7be7('0x15')](_0xd50312,'');}if(_0x3ad305[_0x7be7('0x13')][_0x7be7('0x16')]('{_0x1b5748['push'](_0x56e785[_0x7be7('0x19')]);});var _0xc9a2f0=/]+>/g;var _0x38b572=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5186f4=_0x3ad305[_0x7be7('0x13')][_0x7be7('0x15')](_0x38b572,_0x7be7('0x1a'));var _0x33aded=_0x5186f4[_0x7be7('0x15')](_0xc9a2f0,_0x7be7('0x1b'));for(let _0xe239a4=0x0;_0xe239a4<_0x1b5748[_0x7be7('0xf')];_0xe239a4++){var _0x1f6787=_0x33aded[_0x7be7('0x15')](_0x7be7('0x1b'),_0x7be7('0x1c')+_0x1b5748[_0xe239a4]+'\x20]');_0x33aded=_0x1f6787;}_0x3ad305[_0x7be7('0x13')]=_0x33aded;}_0x148c7d[_0x7be7('0x1d')]=_0x3ad305[_0x7be7('0x13')];}else{_0x148c7d[_0x7be7('0x1d')]=_0x3ad305[_0x7be7('0x1e')];}if(_0x148c7d['body']){_0x148c7d[_0x7be7('0x1d')]=_0x148c7d[_0x7be7('0x1d')][_0x7be7('0x15')](/0x0){var _0x283ed9=[_0x7be7('0x2f'),_0x7be7('0x30'),_0x7be7('0x31')];for(var _0x1bbc9a=0x0;_0x1bbc9a<_0x3ad305[_0x7be7('0x2e')][_0x7be7('0xf')];_0x1bbc9a++){var _0x324cf6=_[_0x7be7('0xd')](_0x283ed9,_0x3ad305['headerLines'][_0x1bbc9a][_0x7be7('0x32')]);if(_0x324cf6>=0x0){_0x148c7d[_0x7be7('0x33')]=!![];}}}return _0x148c7d;}exports[_0x7be7('0x34')]=function(_0xd6a4dd,_0x33659b,_0x5a9b62){var _0x4cc61b={'from':getAddress(_0x33659b[_0x7be7('0x35')]),'firstName':getFirstName(_0x33659b['from']),'lastName':getLastName(_0x33659b['from']),'mapKey':'email','message':{'from':getMails(_0xd6a4dd[_0x7be7('0x5')],_0x33659b[_0x7be7('0x35')]),'to':_0xd6a4dd[_0x7be7('0x5')],'cc':'','subject':_0x33659b['subject']||'','messageId':_0x33659b[_0x7be7('0x36')],'inReplyTo':_0x33659b[_0x7be7('0x37')],'sentAt':moment(_0x33659b[_0x7be7('0x38')])[_0x7be7('0x27')](_0x7be7('0x39')),'attach':![],'attachments':[]}};if(!_0x33659b['html']&&!_0x33659b[_0x7be7('0x1e')]){var _0x3e5233=_[_0x7be7('0x3a')](_0x33659b[_0x7be7('0x17')],{'contentType':_0x7be7('0x3b')});if(_0x3e5233[_0x7be7('0xf')]){logger[_0x7be7('0x3c')](util['format'](_0x7be7('0x3d'),_0x33659b[_0x7be7('0x36')]));tnef[_0x7be7('0x3e')](_[_0x7be7('0x3f')](_0x3e5233)['content'],function(_0x1fd732,_0xe0c041){if(_0xe0c041){_0x33659b[_0x7be7('0x13')]=_0xe0c041[_0x7be7('0x40')]||_0x7be7('0x41');if(_0xe0c041['Attachments']){for(var _0x1f8ff5=0x0;_0x1f8ff5<_0xe0c041[_0x7be7('0x42')]['length'];_0x1f8ff5++){var _0x253066=_0xe0c041[_0x7be7('0x42')][_0x1f8ff5];_0x4cc61b['message'][_0x7be7('0x17')][_0x7be7('0x2c')]({'filename':_0x253066['Title'],'content':Buffer[_0x7be7('0x35')](_0x253066[_0x7be7('0x43')])});}}}_0x5a9b62(parseEmail(_0xd6a4dd,_0x33659b,_0x4cc61b));});}else{_0x33659b['html']=_0x7be7('0x41');_0x5a9b62(parseEmail(_0xd6a4dd,_0x33659b,_0x4cc61b));}}else{_0x5a9b62(parseEmail(_0xd6a4dd,_0x33659b,_0x4cc61b));}};exports[_0x7be7('0x44')]=function(_0x513394,_0x1f71d6){var _0x50b26d=[_0x7be7('0x45')+(_0x1f71d6||''),_0x7be7('0x46')+_0x513394,'',''];return Buffer[_0x7be7('0x35')](_0x50b26d['join'](''),'utf-8')[_0x7be7('0x47')](_0x7be7('0x48'));}; \ No newline at end of file +var _0x7fae=['head','value','address','generate','@xcally.com','name','split','length','join','Anonymous','pop','anonymous','html','test','replace','includes','\x20[Attachment:\x20','body','textAsHtml','originTo','originCc','isEmpty','message','bcc','attachments','attach','type','attachment','attachment-','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','auth=Bearer\x20','toString','base64','lodash','moment','path','util','email','../../../config/environment'];(function(_0x440a3d,_0x42ee86){var _0x193e56=function(_0x5af685){while(--_0x5af685){_0x440a3d['push'](_0x440a3d['shift']());}};_0x193e56(++_0x42ee86);}(_0x7fae,0x16c));var _0xe7fa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7fae[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe7fa('0x0'));var moment=require(_0xe7fa('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xe7fa('0x2'));var util=require(_0xe7fa('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xe7fa('0x4'));var config=require(_0xe7fa('0x5'));function getAddress(_0x11cc4c){var _0x255259=_[_0xe7fa('0x6')](_0x11cc4c[_0xe7fa('0x7')]);return _0x255259&&_0x255259[_0xe7fa('0x8')]?_0x255259[_0xe7fa('0x8')]:'anonymous'+random[_0xe7fa('0x9')](0x6)+_0xe7fa('0xa');}function getFirstName(_0x51b086){var _0x4d7bb1=_['head'](_0x51b086[_0xe7fa('0x7')]);if(_0x4d7bb1&&_0x4d7bb1['name']){if(_0x4d7bb1[_0xe7fa('0xb')]==_0x4d7bb1[_0xe7fa('0x8')]){return _0x4d7bb1[_0xe7fa('0xb')]['substring'](0x0,_0x4d7bb1[_0xe7fa('0xb')]['indexOf']('@'));}var _0x1ec8c0=_0x4d7bb1[_0xe7fa('0xb')][_0xe7fa('0xc')](/\s+/);return _0x1ec8c0[_0xe7fa('0xd')]>0x1?_0x1ec8c0['slice'](0x0,-0x1)[_0xe7fa('0xe')]('\x20'):_0x4d7bb1[_0xe7fa('0xb')];}return _0xe7fa('0xf');}function getLastName(_0x4a7e77){var _0x38dc8f=_[_0xe7fa('0x6')](_0x4a7e77[_0xe7fa('0x7')]);if(_0x38dc8f&&_0x38dc8f['name']){var _0x10e81=_0x38dc8f[_0xe7fa('0xb')][_0xe7fa('0xc')](/\s+/);return _0x10e81['length']>0x1?_0x10e81[_0xe7fa('0x10')]():'';}return'';}function getMails(_0x3be2eb,_0x71c1ad){var _0x2eab21='';for(var _0x531618=0x0;_0x531618<_0x71c1ad[_0xe7fa('0x7')][_0xe7fa('0xd')];_0x531618+=0x1){if(_0x71c1ad[_0xe7fa('0x7')][_0x531618]['address']!==_0x3be2eb){if(!_['isEmpty'](_0x2eab21)){_0x2eab21+=',';}_0x2eab21+=_0x71c1ad[_0xe7fa('0x7')][_0x531618][_0xe7fa('0xb')]||_0x71c1ad[_0xe7fa('0x7')][_0x531618][_0xe7fa('0x8')]||'';_0x2eab21+='\x20<';_0x2eab21+=_0x71c1ad[_0xe7fa('0x7')][_0x531618][_0xe7fa('0x8')]?_0x71c1ad[_0xe7fa('0x7')][_0x531618][_0xe7fa('0x8')]:_0xe7fa('0x11')+random['generate'](0x6)+_0xe7fa('0xa');_0x2eab21+='>';}}return _0x2eab21;}function parseEmail(_0x50a9b5,_0x316c2d,_0x227a78){if(_0x316c2d[_0xe7fa('0x12')]){var _0x507069=/)<[^<]*)*<\/script>/gi;while(_0x507069[_0xe7fa('0x13')](_0x316c2d[_0xe7fa('0x12')])){_0x316c2d[_0xe7fa('0x12')]=_0x316c2d[_0xe7fa('0x12')][_0xe7fa('0x14')](_0x507069,'');}if(_0x316c2d[_0xe7fa('0x12')][_0xe7fa('0x15')](_0xe7fa('0x16'))){var _0x258b2e=[];_0x316c2d['attachments'][_0xe7fa('0x17')](_0x244f23=>{_0x258b2e[_0xe7fa('0x18')](_0x244f23[_0xe7fa('0x19')]);});var _0x33e94d=/]+>/g;var _0x3d47ff=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5ae35e=_0x316c2d[_0xe7fa('0x12')][_0xe7fa('0x14')](_0x3d47ff,_0xe7fa('0x1a'));var _0x3f4480=_0x5ae35e[_0xe7fa('0x14')](_0x33e94d,_0xe7fa('0x1b'));for(let _0x3a0c6b=0x0;_0x3a0c6b<_0x258b2e[_0xe7fa('0xd')];_0x3a0c6b++){var _0x5e8a17=_0x3f4480[_0xe7fa('0x14')]('_IMG',_0xe7fa('0x1c')+_0x258b2e[_0x3a0c6b]+'\x20]');_0x3f4480=_0x5e8a17;}_0x316c2d[_0xe7fa('0x12')]=_0x3f4480;}_0x227a78[_0xe7fa('0x1d')]=_0x316c2d[_0xe7fa('0x12')];}else{_0x227a78['body']=_0x316c2d[_0xe7fa('0x1e')];}if(_0x227a78[_0xe7fa('0x1d')]){_0x227a78[_0xe7fa('0x1d')]=_0x227a78[_0xe7fa('0x1d')]['replace'](/0x0){var _0x1c084f=[_0xe7fa('0x31'),_0xe7fa('0x32'),_0xe7fa('0x33')];for(var _0x35dc90=0x0;_0x35dc90<_0x316c2d[_0xe7fa('0x30')]['length'];_0x35dc90++){var _0x39ea9e=_[_0xe7fa('0x34')](_0x1c084f,_0x316c2d[_0xe7fa('0x30')][_0x35dc90][_0xe7fa('0x35')]);if(_0x39ea9e>=0x0){_0x227a78[_0xe7fa('0x36')]=!![];}}}return _0x227a78;}exports[_0xe7fa('0x37')]=function(_0x3d84ef,_0x2f4b2b,_0x21e296){var _0x1706ee={'from':getAddress(_0x2f4b2b[_0xe7fa('0x38')]),'firstName':getFirstName(_0x2f4b2b[_0xe7fa('0x38')]),'lastName':getLastName(_0x2f4b2b[_0xe7fa('0x38')]),'mapKey':_0xe7fa('0x4'),'message':{'from':getMails(_0x3d84ef[_0xe7fa('0x4')],_0x2f4b2b[_0xe7fa('0x38')]),'to':_0x3d84ef[_0xe7fa('0x4')],'cc':'','subject':_0x2f4b2b[_0xe7fa('0x39')]||'','messageId':_0x2f4b2b[_0xe7fa('0x3a')],'inReplyTo':_0x2f4b2b[_0xe7fa('0x3b')],'sentAt':moment(_0x2f4b2b[_0xe7fa('0x3c')])['format'](_0xe7fa('0x3d')),'attach':![],'attachments':[]}};if(!_0x2f4b2b[_0xe7fa('0x12')]&&!_0x2f4b2b[_0xe7fa('0x1e')]){var _0xbc9ca6=_[_0xe7fa('0x3e')](_0x2f4b2b[_0xe7fa('0x24')],{'contentType':_0xe7fa('0x3f')});if(_0xbc9ca6[_0xe7fa('0xd')]){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2f4b2b[_0xe7fa('0x3a')]));tnef[_0xe7fa('0x40')](_[_0xe7fa('0x41')](_0xbc9ca6)[_0xe7fa('0x2e')],function(_0x36f93d,_0x8bb4df){if(_0x8bb4df){_0x2f4b2b[_0xe7fa('0x12')]=_0x8bb4df[_0xe7fa('0x42')]||_0xe7fa('0x43');if(_0x8bb4df[_0xe7fa('0x44')]){for(var _0x59097c=0x0;_0x59097c<_0x8bb4df[_0xe7fa('0x44')]['length'];_0x59097c++){var _0xd05b7c=_0x8bb4df[_0xe7fa('0x44')][_0x59097c];_0x1706ee[_0xe7fa('0x22')]['attachments'][_0xe7fa('0x18')]({'filename':_0xd05b7c[_0xe7fa('0x45')],'content':Buffer[_0xe7fa('0x38')](_0xd05b7c[_0xe7fa('0x46')])});}}}_0x21e296(parseEmail(_0x3d84ef,_0x2f4b2b,_0x1706ee));});}else{_0x2f4b2b[_0xe7fa('0x12')]=_0xe7fa('0x43');_0x21e296(parseEmail(_0x3d84ef,_0x2f4b2b,_0x1706ee));}}else{_0x21e296(parseEmail(_0x3d84ef,_0x2f4b2b,_0x1706ee));}};exports['generateXOAuth2Token']=function(_0x3ac825,_0x131faf){var _0x58b259=['user='+(_0x131faf||''),_0xe7fa('0x47')+_0x3ac825,'',''];return Buffer[_0xe7fa('0x38')](_0x58b259['join'](''),'utf-8')[_0xe7fa('0x48')](_0xe7fa('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 803a354..8284663 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 _0xf3d8=['lodash','name','Service','key','SERV','active','Smtp','exports'];(function(_0x4970d6,_0x2e6b07){var _0x2857f3=function(_0x447128){while(--_0x447128){_0x4970d6['push'](_0x4970d6['shift']());}};_0x2857f3(++_0x2e6b07);}(_0xf3d8,0xc0));var _0x8f3d=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf3d8[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x8f3d('0x0'));function MailAccount(_0x24be4b){this['id']=_0x24be4b['id']||0x0;this['name']=_0x24be4b[_0x8f3d('0x1')]||_0x8f3d('0x2');this[_0x8f3d('0x3')]=_0x24be4b[_0x8f3d('0x3')]||_0x8f3d('0x4');this[_0x8f3d('0x5')]=_0x24be4b[_0x8f3d('0x5')]||![];this['Imap']=_0x24be4b['Imap']||[];this['Smtp']=_0x24be4b[_0x8f3d('0x6')]||[];}module[_0x8f3d('0x7')]=MailAccount; \ No newline at end of file +var _0xe87e=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x3701e9,_0x36ec85){var _0x453374=function(_0x4e525e){while(--_0x4e525e){_0x3701e9['push'](_0x3701e9['shift']());}};_0x453374(++_0x36ec85);}(_0xe87e,0x1be));var _0xee87=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xe87e[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0xee87('0x0'));function MailAccount(_0x52c685){this['id']=_0x52c685['id']||0x0;this[_0xee87('0x1')]=_0x52c685[_0xee87('0x1')]||_0xee87('0x2');this[_0xee87('0x3')]=_0x52c685[_0xee87('0x3')]||_0xee87('0x4');this[_0xee87('0x5')]=_0x52c685['active']||![];this['Imap']=_0x52c685[_0xee87('0x6')]||[];this[_0xee87('0x7')]=_0x52c685[_0xee87('0x7')]||[];}module[_0xee87('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 133440e..a70bd9d 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 _0x62bf=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge','exports','lodash'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x62bf,0x83));var _0xf62b=function(_0x5bca2a,_0x15b4ae){_0x5bca2a=_0x5bca2a-0x0;var _0x11b5b6=_0x62bf[_0x5bca2a];return _0x11b5b6;};'use strict';var _=require(_0xf62b('0x0'));var MailAccount=require(_0xf62b('0x1'));var Realtime=function(){this[_0xf62b('0x2')]={};};function freeIsNotKey(_0x4f336a,_0x1c2ace,_0x26dd17){var _0x2d517b=_[_0xf62b('0x3')](_0x4f336a,function(_0x5f5636,_0x54cd0c){return _0x5f5636[_0x26dd17];});for(var _0x5c6541 in _0x1c2ace){if(_0x1c2ace[_0xf62b('0x4')](_0x5c6541)){if(!_0x2d517b[_0x5c6541]){delete _0x1c2ace[_0x5c6541];}}}}Realtime[_0xf62b('0x5')][_0xf62b('0x6')]=function(_0xaf87eb,_0x1b610d){for(var _0x1fc171 in _0x1b610d){if(_0xaf87eb[_0xf62b('0x4')](_0x1fc171)){_0xaf87eb[_0x1fc171]=_0x1b610d[_0x1fc171];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x238a2a=this;return function(_0x202d5f){if(_0x202d5f){freeIsNotKey(_0x202d5f,_0x238a2a[_0xf62b('0x2')],'id');for(var _0x57c433=0x0,_0x3d5ffc={},_0x1f0806={};_0x57c433<_0x202d5f[_0xf62b('0x7')];_0x57c433+=0x1){_0x3d5ffc=_0x202d5f[_0x57c433];if(_[_0xf62b('0x8')](_0x238a2a['mailAccounts'][_0x3d5ffc['id']])){_0x238a2a[_0xf62b('0x2')][_0x3d5ffc['id']]=new MailAccount(_0x3d5ffc);}else{_[_0xf62b('0x9')](_0x238a2a['mailAccounts'][_0x3d5ffc['id']],_0x3d5ffc);}}}return _0x238a2a[_0xf62b('0x2')];};};module[_0xf62b('0xa')]=Realtime; \ No newline at end of file +var _0x7cc4=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts'];(function(_0xd88ab6,_0x2340a7){var _0x522db5=function(_0x22c8e2){while(--_0x22c8e2){_0xd88ab6['push'](_0xd88ab6['shift']());}};_0x522db5(++_0x2340a7);}(_0x7cc4,0x179));var _0x47cc=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x7cc4[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x47cc('0x0'));var MailAccount=require(_0x47cc('0x1'));var Realtime=function(){this[_0x47cc('0x2')]={};};function freeIsNotKey(_0x69a57c,_0x58cfae,_0x38bbca){var _0x4d8d0b=_[_0x47cc('0x3')](_0x69a57c,function(_0x26c11a,_0x3e0f12){return _0x26c11a[_0x38bbca];});for(var _0x2485d8 in _0x58cfae){if(_0x58cfae[_0x47cc('0x4')](_0x2485d8)){if(!_0x4d8d0b[_0x2485d8]){delete _0x58cfae[_0x2485d8];}}}}Realtime[_0x47cc('0x5')][_0x47cc('0x6')]=function(_0x1e7342,_0x55494e){for(var _0x3d5657 in _0x55494e){if(_0x1e7342[_0x47cc('0x4')](_0x3d5657)){_0x1e7342[_0x3d5657]=_0x55494e[_0x3d5657];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x350815=this;return function(_0x15ce63){if(_0x15ce63){freeIsNotKey(_0x15ce63,_0x350815[_0x47cc('0x2')],'id');for(var _0x1aa5ed=0x0,_0x33021f={},_0x4310a5={};_0x1aa5ed<_0x15ce63[_0x47cc('0x7')];_0x1aa5ed+=0x1){_0x33021f=_0x15ce63[_0x1aa5ed];if(_[_0x47cc('0x8')](_0x350815['mailAccounts'][_0x33021f['id']])){_0x350815[_0x47cc('0x2')][_0x33021f['id']]=new MailAccount(_0x33021f);}else{_[_0x47cc('0x9')](_0x350815[_0x47cc('0x2')][_0x33021f['id']],_0x33021f);}}}return _0x350815[_0x47cc('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index ea5d161..0fee986 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 _0x6299=['CloudProvider','data5','notify','NotifyMailAccount','Request','GetMailAccount','name','provider','service','email','key','ListId','TemplateId','MailServerIn','Imap','type','Smtp'];(function(_0x3c8ba9,_0x5c456c){var _0x392745=function(_0xd79d24){while(--_0xd79d24){_0x3c8ba9['push'](_0x3c8ba9['shift']());}};_0x392745(++_0x5c456c);}(_0x6299,0x169));var _0x9629=function(_0xd5ebca,_0x39fdcc){_0xd5ebca=_0xd5ebca-0x0;var _0x55fd38=_0x6299[_0xd5ebca];return _0x55fd38;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x9629('0x0')](_0x9629('0x1'),{'options':{'attributes':['id',_0x9629('0x2'),_0x9629('0x3'),_0x9629('0x4'),_0x9629('0x5'),'active',_0x9629('0x6'),_0x9629('0x7'),_0x9629('0x8')],'raw':![],'include':[{'model':_0x9629('0x9'),'as':_0x9629('0xa'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x9629('0x4'),_0x9629('0xb'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0x9629('0xc'),'include':[{'model':_0x9629('0xd'),'attributes':['id',_0x9629('0x2'),'service',_0x9629('0xb'),_0x9629('0xe')],'as':_0x9629('0xd')}]}]},'log':'getMailAccount'});};};exports[_0x9629('0xf')]=function(_0x2ef67f,_0xd4ddd9){return client[_0x9629('0x0')](_0x9629('0x10'),{'account':{'id':_0x2ef67f},'body':_0xd4ddd9,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xda91=['type','MailServerOut','data5','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','provider','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider'];(function(_0xe04093,_0x521e39){var _0x42b222=function(_0x28e5b6){while(--_0x28e5b6){_0xe04093['push'](_0xe04093['shift']());}};_0x42b222(++_0x521e39);}(_0xda91,0x72));var _0x1da9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xda91[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x1da9('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x1da9('0x1')](_0x1da9('0x2'),{'options':{'attributes':['id',_0x1da9('0x3'),_0x1da9('0x4'),'service','email',_0x1da9('0x5'),_0x1da9('0x6'),_0x1da9('0x7'),_0x1da9('0x8')],'raw':![],'include':[{'model':_0x1da9('0x9'),'as':_0x1da9('0xa'),'include':[{'model':_0x1da9('0xb'),'attributes':['id','name','service',_0x1da9('0xc'),'data5'],'as':_0x1da9('0xb')}]},{'model':_0x1da9('0xd'),'as':'Smtp','include':[{'model':_0x1da9('0xb'),'attributes':['id','name','service',_0x1da9('0xc'),_0x1da9('0xe')],'as':_0x1da9('0xb')}]}]},'log':_0x1da9('0xf')});};};exports[_0x1da9('0x10')]=function(_0xb682c9,_0x4ac870){return client[_0x1da9('0x1')](_0x1da9('0x11'),{'account':{'id':_0xb682c9},'body':_0x4ac870,'log':_0x1da9('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 48bc980..4534d3d 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 _0xb9f1=['../client','getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x53a3d9,_0x581974){var _0x3b80bb=function(_0x103f41){while(--_0x103f41){_0x53a3d9['push'](_0x53a3d9['shift']());}};_0x3b80bb(++_0x581974);}(_0xb9f1,0x96));var _0x1b9f=function(_0x5a1714,_0x5caf51){_0x5a1714=_0x5a1714-0x0;var _0x1c1787=_0xb9f1[_0x5a1714];return _0x1c1787;};'use strict';var client=require(_0x1b9f('0x0'));exports[_0x1b9f('0x1')]=function(){return client[_0x1b9f('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1b9f('0x3')]},'log':_0x1b9f('0x4')});}; \ No newline at end of file +var _0x2b04=['loginMailFrequency','../client','getSettings'];(function(_0x425ec8,_0x293ff){var _0x1cbf90=function(_0x1a1974){while(--_0x1a1974){_0x425ec8['push'](_0x425ec8['shift']());}};_0x1cbf90(++_0x293ff);}(_0x2b04,0x1f3));var _0x42b0=function(_0x17fccf,_0x3fe891){_0x17fccf=_0x17fccf-0x0;var _0x44ccdd=_0x2b04[_0x17fccf];return _0x44ccdd;};'use strict';var client=require(_0x42b0('0x0'));exports[_0x42b0('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x42b0('0x2')]},'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 b056aeb..cfc3e78 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 e341875..7eb1d4c 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 _0xc5b8=['../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','listen','port','socket.io','redis','localhost','socket.io-redis','../../config/triggers','default'];(function(_0x34e106,_0x91d313){var _0x23a796=function(_0x288d36){while(--_0x288d36){_0x34e106['push'](_0x34e106['shift']());}};_0x23a796(++_0x91d313);}(_0xc5b8,0x1ea));var _0x8c5b=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xc5b8[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x8c5b('0x0'));var http=require(_0x8c5b('0x1'));var express=require(_0x8c5b('0x2'));var sticky=require(_0x8c5b('0x3'));var Redis=require(_0x8c5b('0x4'));var config=require(_0x8c5b('0x5'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0x8c5b('0x6')](server,config[_0x8c5b('0x7')])){var socketio=require(_0x8c5b('0x8'))(server,{'transports':['websocket','polling']});config[_0x8c5b('0x9')]=_['defaults'](config['redis'],{'host':_0x8c5b('0xa'),'port':0x18eb});socketio['adapter'](require(_0x8c5b('0xb'))({'pubClient':new Redis(config[_0x8c5b('0x9')]),'subClient':new Redis(config[_0x8c5b('0x9')])}));require(_0x8c5b('0xc'))[_0x8c5b('0xd')]();require(_0x8c5b('0xe'))['default'](socketio);require(_0x8c5b('0xf'))[_0x8c5b('0xd')](app);require(_0x8c5b('0x10'))['default'](app);}else{server[_0x8c5b('0x11')](_0x8c5b('0x12'),function(){console[_0x8c5b('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8c5b('0x7')]);});}exports=module[_0x8c5b('0x14')]=app; \ No newline at end of file +var _0x83d1=['localhost','adapter','socket.io-redis','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults'];(function(_0x26ee8c,_0x1ebe6c){var _0x2a09bc=function(_0x21ed9a){while(--_0x21ed9a){_0x26ee8c['push'](_0x26ee8c['shift']());}};_0x2a09bc(++_0x1ebe6c);}(_0x83d1,0x169));var _0x183d=function(_0x200155,_0x2de523){_0x200155=_0x200155-0x0;var _0x1a3275=_0x83d1[_0x200155];return _0x1a3275;};'use strict';var _=require(_0x183d('0x0'));var http=require('http');var express=require(_0x183d('0x1'));var sticky=require(_0x183d('0x2'));var Redis=require(_0x183d('0x3'));var config=require(_0x183d('0x4'));var app=express();var server=http[_0x183d('0x5')](app);server[_0x183d('0x6')]=0xdbba0;if(sticky[_0x183d('0x7')](server,config[_0x183d('0x8')])){var socketio=require(_0x183d('0x9'))(server,{'transports':[_0x183d('0xa'),_0x183d('0xb')]});config[_0x183d('0xc')]=_[_0x183d('0xd')](config[_0x183d('0xc')],{'host':_0x183d('0xe'),'port':0x18eb});socketio[_0x183d('0xf')](require(_0x183d('0x10'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x183d('0xc')])}));require('../../config/triggers')[_0x183d('0x11')]();require('../../config/socketio')['default'](socketio);require(_0x183d('0x12'))[_0x183d('0x11')](app);require(_0x183d('0x13'))['default'](app);}else{server[_0x183d('0x14')](_0x183d('0x15'),function(){console[_0x183d('0x16')](_0x183d('0x17'),config[_0x183d('0x8')]);});}exports=module[_0x183d('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 1d126bd..bbcf606 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 _0x80bd=['error','message','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','debug','rpc','routing'];(function(_0x50ac27,_0x1306e3){var _0x45f86a=function(_0x512a96){while(--_0x512a96){_0x50ac27['push'](_0x50ac27['shift']());}};_0x45f86a(++_0x1306e3);}(_0x80bd,0x78));var _0xd80b=function(_0x151457,_0x3e5560){_0x151457=_0x151457-0x0;var _0x36a3f1=_0x80bd[_0x151457];return _0x36a3f1;};'use strict';var jayson=require(_0xd80b('0x0'));var BPromise=require(_0xd80b('0x1'));var logger=require(_0xd80b('0x2'))('routing');var client=jayson[_0xd80b('0x3')][_0xd80b('0x4')]({'port':0x2329});client[_0xd80b('0x5')]=function(_0x441079,_0x55c2ac){return new BPromise(function(_0x3c3435,_0x53ec25){return client[_0xd80b('0x6')](_0x441079,_0x55c2ac)['then'](function(_0x1c0569){logger[_0xd80b('0x7')](_0xd80b('0x8'),_0xd80b('0x9'),_0x441079,_0x55c2ac,_0x1c0569);if(_0x1c0569[_0xd80b('0xa')]){logger[_0xd80b('0xa')](_0xd80b('0x8'),'routing',_0x441079,_0x1c0569[_0xd80b('0xa')][_0xd80b('0xb')],_0x55c2ac);return _0x53ec25(_0x1c0569[_0xd80b('0xa')][_0xd80b('0xb')]);}else{return _0x3c3435(_0x1c0569['result']);}})['catch'](function(_0x170273){logger['error']('rpc',_0xd80b('0x9'),_0x441079,_0x170273,_0x55c2ac);return _0x53ec25(_0x170273);});});};module[_0xd80b('0xc')]=client; \ No newline at end of file +var _0x7ba1=['result','routing','client','http','Request','then','debug','error','rpc'];(function(_0xfc444f,_0x5281c7){var _0x126d39=function(_0x271ea5){while(--_0x271ea5){_0xfc444f['push'](_0xfc444f['shift']());}};_0x126d39(++_0x5281c7);}(_0x7ba1,0x133));var _0x17ba=function(_0x1bfef6,_0x501c96){_0x1bfef6=_0x1bfef6-0x0;var _0x1da100=_0x7ba1[_0x1bfef6];return _0x1da100;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x17ba('0x0'));var client=jayson[_0x17ba('0x1')][_0x17ba('0x2')]({'port':0x2329});client[_0x17ba('0x3')]=function(_0x10ac9a,_0x89d6b4){return new BPromise(function(_0x11b669,_0x3bbcc3){return client['request'](_0x10ac9a,_0x89d6b4)[_0x17ba('0x4')](function(_0x381d2a){logger[_0x17ba('0x5')]('rpc',_0x17ba('0x0'),_0x10ac9a,_0x89d6b4,_0x381d2a);if(_0x381d2a[_0x17ba('0x6')]){logger['error'](_0x17ba('0x7'),_0x17ba('0x0'),_0x10ac9a,_0x381d2a[_0x17ba('0x6')]['message'],_0x89d6b4);return _0x3bbcc3(_0x381d2a[_0x17ba('0x6')]['message']);}else{return _0x11b669(_0x381d2a[_0x17ba('0x8')]);}})['catch'](function(_0x34b92d){logger['error']('rpc',_0x17ba('0x0'),_0x10ac9a,_0x34b92d,_0x89d6b4);return _0x3bbcc3(_0x34b92d);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index b3aa056..9f1c3bc 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 _0xde8d=['getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xde8d,0x1d4));var _0xdde8=function(_0x1eed00,_0x3f65a1){_0x1eed00=_0x1eed00-0x0;var _0x3e0b7c=_0xde8d[_0x1eed00];return _0x3e0b7c;};'use strict';var BPromise=require(_0xdde8('0x0'));var server=require(_0xdde8('0x1'));var Realtime=require(_0xdde8('0x2'));var user=require(_0xdde8('0x3'));var interval=require(_0xdde8('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xdde8('0x5'));var smsQueue=require(_0xdde8('0x6'));var mailQueue=require(_0xdde8('0x7'));var faxQueue=require(_0xdde8('0x8'));var whatsappQueue=require(_0xdde8('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xdde8('0xa')]()[_0xdde8('0xb')](user[_0xdde8('0xc')]())[_0xdde8('0xb')](realtime[_0xdde8('0xd')]())['then'](interval[_0xdde8('0xe')]())['then'](realtime[_0xdde8('0xf')]())['then'](openchannelQueue[_0xdde8('0x10')]())[_0xdde8('0xb')](realtime[_0xdde8('0x11')]())[_0xdde8('0xb')](chatQueue[_0xdde8('0x12')]())['then'](realtime['initChatQueues']())['then'](smsQueue[_0xdde8('0x13')]())[_0xdde8('0xb')](realtime[_0xdde8('0x14')]())[_0xdde8('0xb')](mailQueue[_0xdde8('0x15')]())[_0xdde8('0xb')](realtime[_0xdde8('0x16')]())[_0xdde8('0xb')](faxQueue['getFaxQueues']())['then'](realtime[_0xdde8('0x17')]())['then'](whatsappQueue['getWhatsappQueues']())[_0xdde8('0xb')](realtime[_0xdde8('0x18')]())[_0xdde8('0xb')](function(){return realtime;});}function main(){return server[_0xdde8('0x19')](realtime)[_0xdde8('0xb')](function(_0x49e206){return initRealtime();})[_0xdde8('0xb')](function(_0x409840){return setInterval(initRealtime,0x1388);})[_0xdde8('0x1a')](function(_0x2ce50a){console['log'](_0x2ce50a);});}main(); \ No newline at end of file +var _0xf3c7=['initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues'];(function(_0xc635d4,_0x4d4425){var _0x185f62=function(_0x1f325a){while(--_0x1f325a){_0xc635d4['push'](_0xc635d4['shift']());}};_0x185f62(++_0x4d4425);}(_0xf3c7,0xdd));var _0x7f3c=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0xf3c7[_0x343e44];return _0xa5130e;};'use strict';var BPromise=require(_0x7f3c('0x0'));var server=require(_0x7f3c('0x1'));var Realtime=require(_0x7f3c('0x2'));var user=require(_0x7f3c('0x3'));var interval=require(_0x7f3c('0x4'));var openchannelQueue=require(_0x7f3c('0x5'));var chatQueue=require(_0x7f3c('0x6'));var smsQueue=require(_0x7f3c('0x7'));var mailQueue=require(_0x7f3c('0x8'));var faxQueue=require(_0x7f3c('0x9'));var whatsappQueue=require(_0x7f3c('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7f3c('0xb')]()[_0x7f3c('0xc')](user[_0x7f3c('0xd')]())['then'](realtime[_0x7f3c('0xe')]())['then'](interval[_0x7f3c('0xf')]())[_0x7f3c('0xc')](realtime['initIntervals']())['then'](openchannelQueue[_0x7f3c('0x10')]())['then'](realtime[_0x7f3c('0x11')]())['then'](chatQueue[_0x7f3c('0x12')]())[_0x7f3c('0xc')](realtime[_0x7f3c('0x13')]())[_0x7f3c('0xc')](smsQueue['getSmsQueues']())['then'](realtime[_0x7f3c('0x14')]())[_0x7f3c('0xc')](mailQueue[_0x7f3c('0x15')]())[_0x7f3c('0xc')](realtime['initMailQueues']())[_0x7f3c('0xc')](faxQueue['getFaxQueues']())[_0x7f3c('0xc')](realtime[_0x7f3c('0x16')]())[_0x7f3c('0xc')](whatsappQueue[_0x7f3c('0x17')]())[_0x7f3c('0xc')](realtime[_0x7f3c('0x18')]())[_0x7f3c('0xc')](function(){return realtime;});}function main(){return server[_0x7f3c('0x19')](realtime)['then'](function(_0x2357b8){return initRealtime();})['then'](function(_0xca7608){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1b2fed){console[_0x7f3c('0x1a')](_0x1b2fed);});}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 6751f41..bdb8e3c 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x2615b7,_0x28e0e2){var _0x29f0a0=function(_0x4fc744){while(--_0x4fc744){_0x2615b7['push'](_0x2615b7['shift']());}};_0x29f0a0(++_0x28e0e2);}(_0xe14b,0x93));var _0xbe14=function(_0x131c01,_0x58f223){_0x131c01=_0x131c01-0x0;var _0x29648c=_0xe14b[_0x131c01];return _0x29648c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x3be844,_0x4c9441){var _0xbdab6e=function(_0x28a6af){while(--_0x28a6af){_0x3be844['push'](_0x3be844['shift']());}};_0xbdab6e(++_0x4c9441);}(_0x7a54,0x106));var _0x47a5=function(_0x4c1d57,_0x24b0fe){_0x4c1d57=_0x4c1d57-0x0;var _0x2e1ece=_0x7a54[_0x4c1d57];return _0x2e1ece;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index c074e66..e15ee48 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 _0xa52e=['http','request','error','message','result','catch','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xa52e,0x1ca));var _0xea52=function(_0x3c8006,_0x547e62){_0x3c8006=_0x3c8006-0x0;var _0x4e2bb2=_0xa52e[_0x3c8006];return _0x4e2bb2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xea52('0x0'));var client=jayson[_0xea52('0x1')][_0xea52('0x2')]({'port':0x232b});function request(_0x22ad9f,_0x29e17b){return new BPromise(function(_0x1e917c,_0x373df2){return client[_0xea52('0x3')](_0x22ad9f,_0x29e17b)['then'](function(_0x182a80){if(_0x182a80[_0xea52('0x4')]){return _0x373df2(_0x182a80[_0xea52('0x4')][_0xea52('0x5')]);}else{return _0x1e917c(_0x182a80[_0xea52('0x6')]);}})[_0xea52('0x7')](function(_0x3fce0d){return _0x373df2(_0x3fce0d);});});}exports[_0xea52('0x8')]=function(_0x1589f7,_0x563a36){return request(_0xea52('0x9'),{'account':_0x1589f7,'message':_0x563a36});}; \ No newline at end of file +var _0xa592=['result','catch','sendMailMessage','SendMail','bluebird','client','http','then','error','message'];(function(_0x478e2f,_0xcc2041){var _0x4b088d=function(_0x1d262b){while(--_0x1d262b){_0x478e2f['push'](_0x478e2f['shift']());}};_0x4b088d(++_0xcc2041);}(_0xa592,0x130));var _0x2a59=function(_0x4578bb,_0x2ab638){_0x4578bb=_0x4578bb-0x0;var _0x1a714f=_0xa592[_0x4578bb];return _0x1a714f;};'use strict';var BPromise=require(_0x2a59('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2a59('0x1')][_0x2a59('0x2')]({'port':0x232b});function request(_0xac45f7,_0x174496){return new BPromise(function(_0x6b78d9,_0x59f815){return client['request'](_0xac45f7,_0x174496)[_0x2a59('0x3')](function(_0x2d6e19){if(_0x2d6e19[_0x2a59('0x4')]){return _0x59f815(_0x2d6e19[_0x2a59('0x4')][_0x2a59('0x5')]);}else{return _0x6b78d9(_0x2d6e19[_0x2a59('0x6')]);}})[_0x2a59('0x7')](function(_0x2bc67d){return _0x59f815(_0x2bc67d);});});}exports[_0x2a59('0x8')]=function(_0x30bfac,_0xd29d0){return request(_0x2a59('0x9'),{'account':_0x30bfac,'message':_0xd29d0});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f24d40a..b0be70c 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 _0x6343=['chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','md5','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','whatsapp','getChannelStatus','StatusTime','toNumber','smsPause','chatStatus','faxCurrentCapacity','smsCurrentCapacity','whatsappStatusTime','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','emit','user:routing:update','exports','moment','ioredis','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','openchannelPause','unknown','chatStatusTime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6343,0x168));var _0x3634=function(_0x173de2,_0x1b1f6a){_0x173de2=_0x173de2-0x0;var _0x528abe=_0x6343[_0x173de2];return _0x528abe;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x3634('0x0'));var Redis=require(_0x3634('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x3634('0x2'),'port':0x18eb});var io=require(_0x3634('0x3'))(new Redis(config['redis']));function Agent(_0x247964){this['id']=_0x247964['id']||0x0;this[_0x3634('0x4')]=_0x247964['name']||'';this[_0x3634('0x5')]=_0x247964[_0x3634('0x5')]||!![];this['voicePause']=_0x247964['voicePause']||![];this[_0x3634('0x6')]=_0x247964[_0x3634('0x6')]||![];this[_0x3634('0x7')]=_0x247964[_0x3634('0x7')]||![];this[_0x3634('0x8')]=_0x247964[_0x3634('0x8')]||![];this['smsPause']=_0x247964['smsPause']||![];this[_0x3634('0x9')]=_0x247964[_0x3634('0x9')]||![];this['chatStatus']=_0x3634('0xa');this[_0x3634('0xb')]=0x0;this[_0x3634('0xc')]=_0x247964[_0x3634('0xc')]||0x0;this[_0x3634('0xd')]=0x0;this[_0x3634('0xe')]=_0x3634('0xa');this[_0x3634('0xf')]=0x0;this[_0x3634('0x10')]=_0x247964[_0x3634('0x10')]||0x0;this[_0x3634('0x11')]=0x0;this[_0x3634('0x12')]=_0x3634('0xa');this[_0x3634('0x13')]=0x0;this['faxCapacity']=_0x247964[_0x3634('0x14')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x3634('0x15')]=_0x3634('0xa');this[_0x3634('0x16')]=0x0;this[_0x3634('0x17')]=_0x247964[_0x3634('0x17')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x3634('0x18')]='unknown';this['whatsappStatusTime']=0x0;this[_0x3634('0x19')]=_0x247964['whatsappCapacity']||0x0;this[_0x3634('0x1a')]=0x0;this[_0x3634('0x1b')]=_0x3634('0xa');this['openchannelStatusTime']=0x0;this[_0x3634('0x1c')]=_0x247964[_0x3634('0x1c')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3634('0x1d')]=![];this['busyQueue']=undefined;this[_0x3634('0x1e')]='';this[_0x3634('0x1f')]={};this['faxWaitingInteractions']={};this[_0x3634('0x20')]={};this[_0x3634('0x21')]={};this[_0x3634('0x22')]={};this['whatsappWaitingInteractions']={};this[_0x3634('0x23')]();}Agent[_0x3634('0x24')]['getChannelStatus']=function(_0x3936ee){if(this[_0x3936ee+'CurrentCapacity']>0x0){if(this[_0x3936ee+'Capacity']>0x0&&this[_0x3936ee+_0x3634('0x25')]>=this[_0x3936ee+_0x3634('0x26')]){return'maxcapacity';}else{return _0x3634('0x27');}}else{return _0x3634('0x28');}};Agent[_0x3634('0x24')][_0x3634('0x23')]=function(){var _0x363ca2=[_0x3634('0x29'),_0x3634('0x2a'),_0x3634('0x2b'),_0x3634('0x2c'),'sms',_0x3634('0x2d')];for(var _0x552cc3=0x0;_0x552cc3<_0x363ca2['length'];_0x552cc3+=0x1){var _0x59f481=this[_0x3634('0x2e')](_0x363ca2[_0x552cc3]);if(this[_0x363ca2[_0x552cc3]+'Status']!==_0x59f481){this[_0x363ca2[_0x552cc3]+_0x3634('0x2f')]=_[_0x3634('0x30')](moment()['format']('x'));}this[_0x363ca2[_0x552cc3]+'Status']=_0x59f481;}var _0x282f73={'id':this['id'],'name':this['name'],'online':this[_0x3634('0x5')],'voicePause':this['voicePause'],'chatPause':this[_0x3634('0x6')],'mailPause':this[_0x3634('0x7')],'smsPause':this[_0x3634('0x31')],'faxPause':this[_0x3634('0x8')],'openchannelPause':this[_0x3634('0x9')],'chatStatus':this[_0x3634('0x32')],'chatStatusTime':this[_0x3634('0xb')],'chatCapacity':this[_0x3634('0xc')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x3634('0x10')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x3634('0x12')],'faxStatusTime':this[_0x3634('0x13')],'faxCapacity':this[_0x3634('0x14')],'faxCurrentCapacity':this[_0x3634('0x33')],'smsStatus':this[_0x3634('0x15')],'smsStatusTime':this[_0x3634('0x16')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x3634('0x34')],'whatsappStatus':this[_0x3634('0x18')],'whatsappStatusTime':this[_0x3634('0x35')],'whatsappCapacity':this[_0x3634('0x19')],'whatsappCurrentCapacity':this[_0x3634('0x1a')],'openchannelStatus':this[_0x3634('0x1b')],'openchannelStatusTime':this[_0x3634('0x36')],'openchannelCapacity':this[_0x3634('0x1c')],'openchannelCurrentCapacity':this[_0x3634('0x37')],'busy':this['busy'],'busyQueue':this[_0x3634('0x38')],'chatWaitingInteractions':this[_0x3634('0x1f')],'faxWaitingInteractions':this[_0x3634('0x39')],'mailWaitingInteractions':this[_0x3634('0x20')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x3634('0x22')],'whatsappWaitingInteractions':this[_0x3634('0x3a')]};var _0x22d091=md5(JSON['stringify'](_0x282f73));if(this['md5']!==_0x22d091){this['md5']=_0x22d091;io[_0x3634('0x3b')](_0x3634('0x3c'),_['omit'](_0x282f73,[_0x3634('0x5')]));}};module[_0x3634('0x3d')]=Agent; \ No newline at end of file +var _0x32b6=['format','faxPause','mailStatusTime','faxStatus','busy','chatWaitingInteractions','stringify','emit','user:routing:update','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','mail','chat','fax','sms','whatsapp','length','Status','StatusTime'];(function(_0x48f2b7,_0x40f214){var _0x54506f=function(_0x193c0a){while(--_0x193c0a){_0x48f2b7['push'](_0x48f2b7['shift']());}};_0x54506f(++_0x40f214);}(_0x32b6,0x1d1));var _0x632b=function(_0x12227a,_0x268c22){_0x12227a=_0x12227a-0x0;var _0x1a3ba7=_0x32b6[_0x12227a];return _0x1a3ba7;};'use strict';var _=require(_0x632b('0x0'));var md5=require(_0x632b('0x1'));var moment=require('moment');var Redis=require(_0x632b('0x2'));var config=require(_0x632b('0x3'));config['redis']=_['defaults'](config[_0x632b('0x4')],{'host':_0x632b('0x5'),'port':0x18eb});var io=require(_0x632b('0x6'))(new Redis(config[_0x632b('0x4')]));function Agent(_0x1adfe6){this['id']=_0x1adfe6['id']||0x0;this[_0x632b('0x7')]=_0x1adfe6[_0x632b('0x7')]||'';this[_0x632b('0x8')]=_0x1adfe6[_0x632b('0x8')]||!![];this[_0x632b('0x9')]=_0x1adfe6['voicePause']||![];this[_0x632b('0xa')]=_0x1adfe6[_0x632b('0xa')]||![];this[_0x632b('0xb')]=_0x1adfe6[_0x632b('0xb')]||![];this['faxPause']=_0x1adfe6['faxPause']||![];this['smsPause']=_0x1adfe6[_0x632b('0xc')]||![];this['openchannelPause']=_0x1adfe6[_0x632b('0xd')]||![];this[_0x632b('0xe')]=_0x632b('0xf');this[_0x632b('0x10')]=0x0;this[_0x632b('0x11')]=_0x1adfe6[_0x632b('0x11')]||0x0;this[_0x632b('0x12')]=0x0;this[_0x632b('0x13')]=_0x632b('0xf');this['mailStatusTime']=0x0;this[_0x632b('0x14')]=_0x1adfe6[_0x632b('0x14')]||0x0;this[_0x632b('0x15')]=0x0;this['faxStatus']=_0x632b('0xf');this[_0x632b('0x16')]=0x0;this[_0x632b('0x17')]=_0x1adfe6[_0x632b('0x17')]||0x0;this[_0x632b('0x18')]=0x0;this[_0x632b('0x19')]='unknown';this[_0x632b('0x1a')]=0x0;this['smsCapacity']=_0x1adfe6['smsCapacity']||0x0;this[_0x632b('0x1b')]=0x0;this['whatsappStatus']=_0x632b('0xf');this[_0x632b('0x1c')]=0x0;this[_0x632b('0x1d')]=_0x1adfe6['whatsappCapacity']||0x0;this[_0x632b('0x1e')]=0x0;this[_0x632b('0x1f')]=_0x632b('0xf');this[_0x632b('0x20')]=0x0;this['openchannelCapacity']=_0x1adfe6[_0x632b('0x21')]||0x0;this[_0x632b('0x22')]=0x0;this['busy']=![];this[_0x632b('0x23')]=undefined;this['md5']='';this['chatWaitingInteractions']={};this[_0x632b('0x24')]={};this['mailWaitingInteractions']={};this[_0x632b('0x25')]={};this[_0x632b('0x26')]={};this[_0x632b('0x27')]={};this['updateRealtime']();}Agent[_0x632b('0x28')][_0x632b('0x29')]=function(_0x59d83a){if(this[_0x59d83a+_0x632b('0x2a')]>0x0){if(this[_0x59d83a+_0x632b('0x2b')]>0x0&&this[_0x59d83a+_0x632b('0x2a')]>=this[_0x59d83a+_0x632b('0x2b')]){return _0x632b('0x2c');}else{return _0x632b('0x2d');}}else{return'idle';}};Agent['prototype'][_0x632b('0x2e')]=function(){var _0x4d3a70=[_0x632b('0x2f'),_0x632b('0x30'),'openchannel',_0x632b('0x31'),_0x632b('0x32'),_0x632b('0x33')];for(var _0x18dc8c=0x0;_0x18dc8c<_0x4d3a70[_0x632b('0x34')];_0x18dc8c+=0x1){var _0x515d74=this[_0x632b('0x29')](_0x4d3a70[_0x18dc8c]);if(this[_0x4d3a70[_0x18dc8c]+_0x632b('0x35')]!==_0x515d74){this[_0x4d3a70[_0x18dc8c]+_0x632b('0x36')]=_['toNumber'](moment()[_0x632b('0x37')]('x'));}this[_0x4d3a70[_0x18dc8c]+_0x632b('0x35')]=_0x515d74;}var _0x1819fa={'id':this['id'],'name':this[_0x632b('0x7')],'online':this[_0x632b('0x8')],'voicePause':this[_0x632b('0x9')],'chatPause':this[_0x632b('0xa')],'mailPause':this[_0x632b('0xb')],'smsPause':this[_0x632b('0xc')],'faxPause':this[_0x632b('0x38')],'openchannelPause':this[_0x632b('0xd')],'chatStatus':this[_0x632b('0xe')],'chatStatusTime':this[_0x632b('0x10')],'chatCapacity':this[_0x632b('0x11')],'chatCurrentCapacity':this[_0x632b('0x12')],'mailStatus':this[_0x632b('0x13')],'mailStatusTime':this[_0x632b('0x39')],'mailCapacity':this[_0x632b('0x14')],'mailCurrentCapacity':this[_0x632b('0x15')],'faxStatus':this[_0x632b('0x3a')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x632b('0x17')],'faxCurrentCapacity':this[_0x632b('0x18')],'smsStatus':this[_0x632b('0x19')],'smsStatusTime':this[_0x632b('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x632b('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x632b('0x1c')],'whatsappCapacity':this[_0x632b('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x632b('0x1f')],'openchannelStatusTime':this[_0x632b('0x20')],'openchannelCapacity':this[_0x632b('0x21')],'openchannelCurrentCapacity':this[_0x632b('0x22')],'busy':this[_0x632b('0x3b')],'busyQueue':this[_0x632b('0x23')],'chatWaitingInteractions':this[_0x632b('0x3c')],'faxWaitingInteractions':this[_0x632b('0x24')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x632b('0x26')],'whatsappWaitingInteractions':this[_0x632b('0x27')]};var _0x52872a=md5(JSON[_0x632b('0x3d')](_0x1819fa));if(this[_0x632b('0x1')]!==_0x52872a){this[_0x632b('0x1')]=_0x52872a;io[_0x632b('0x3e')](_0x632b('0x3f'),_['omit'](_0x1819fa,['online']));}};module[_0x632b('0x40')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 416a5d1..2b4ae38 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 _0x1763=['ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','updateRouting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','length','online','available','paused','waiting','format','chat:queue:%s','chat_queue:save','lodash','md5','util'];(function(_0x3847fd,_0x50da58){var _0x48139e=function(_0x167747){while(--_0x167747){_0x3847fd['push'](_0x3847fd['shift']());}};_0x48139e(++_0x50da58);}(_0x1763,0xd5));var _0x3176=function(_0x4d7285,_0x49c65f){_0x4d7285=_0x4d7285-0x0;var _0x2dac6c=_0x1763[_0x4d7285];return _0x2dac6c;};'use strict';var _=require(_0x3176('0x0'));var md5=require(_0x3176('0x1'));var util=require(_0x3176('0x2'));var Redis=require(_0x3176('0x3'));var config=require(_0x3176('0x4'));config['redis']=_[_0x3176('0x5')](config['redis'],{'host':_0x3176('0x6'),'port':0x18eb});var io=require(_0x3176('0x7'))(new Redis(config['redis']));function ChatQueue(_0x1c2609){this['id']=_0x1c2609['id']||0x0;this[_0x3176('0x8')]=_0x1c2609[_0x3176('0x8')]||'';this[_0x3176('0x9')]=_0x1c2609[_0x3176('0x9')]||0xa;this[_0x3176('0xa')]=_0x1c2609[_0x3176('0xa')]||'beepall';this['Agents']=_0x1c2609['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x3176('0xb')]();this[_0x3176('0xc')]();}ChatQueue['prototype'][_0x3176('0xb')]=function(){var _0xcb3318=this[_0x3176('0xd')][_0x3176('0xe')];this[_0x3176('0xd')]=_[_0x3176('0xf')](this[_0x3176('0x10')],'id');this[_0x3176('0xd')][_0x3176('0xe')]=_0xcb3318;};ChatQueue[_0x3176('0x11')][_0x3176('0xc')]=function(){this[_0x3176('0x12')]=0x0;this['paused']=0x0;for(var _0x176614=0x0;_0x176614=0x0?this[_0x3176('0x15')]:0x0;var _0x374a7d={'id':this['id'],'available':this[_0x3176('0x15')],'loggedIn':this[_0x3176('0x12')],'name':this['name'],'paused':this[_0x3176('0x16')],'waiting':this[_0x3176('0x17')]};var _0x5811e2=md5(JSON['stringify'](_0x374a7d));if(this['md5']!==_0x5811e2){this[_0x3176('0x1')]=_0x5811e2;io['to'](util[_0x3176('0x18')](_0x3176('0x19'),_0x374a7d[_0x3176('0x8')]))['emit'](_0x3176('0x1a'),_0x374a7d);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x064e=['available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','loggedIn','chatPause'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x064e,0xf7));var _0xe064=function(_0x56cfde,_0x3e18d6){_0x56cfde=_0x56cfde-0x0;var _0x8120f4=_0x064e[_0x56cfde];return _0x8120f4;};'use strict';var _=require(_0xe064('0x0'));var md5=require(_0xe064('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xe064('0x2'));config[_0xe064('0x3')]=_[_0xe064('0x4')](config['redis'],{'host':_0xe064('0x5'),'port':0x18eb});var io=require(_0xe064('0x6'))(new Redis(config[_0xe064('0x3')]));function ChatQueue(_0x54cf07){this['id']=_0x54cf07['id']||0x0;this[_0xe064('0x7')]=_0x54cf07['name']||'';this[_0xe064('0x8')]=_0x54cf07[_0xe064('0x8')]||0xa;this[_0xe064('0x9')]=_0x54cf07[_0xe064('0x9')]||'beepall';this[_0xe064('0xa')]=_0x54cf07[_0xe064('0xa')];this[_0xe064('0xb')]={};this[_0xe064('0xc')]=0x0;this['md5']='';this[_0xe064('0xd')]();this[_0xe064('0xe')]();}ChatQueue['prototype'][_0xe064('0xd')]=function(){var _0x425255=this[_0xe064('0xb')][_0xe064('0xf')];this['mapAgentsId']=_[_0xe064('0x10')](this[_0xe064('0xa')],'id');this[_0xe064('0xb')][_0xe064('0xf')]=_0x425255;};ChatQueue[_0xe064('0x11')][_0xe064('0xe')]=function(){this['loggedIn']=0x0;this[_0xe064('0x12')]=0x0;for(var _0x37e48a=0x0;_0x37e48a=0x0?this['available']:0x0;var _0x21f334={'id':this['id'],'available':this[_0xe064('0x17')],'loggedIn':this[_0xe064('0x15')],'name':this[_0xe064('0x7')],'paused':this[_0xe064('0x12')],'waiting':this[_0xe064('0xc')]};var _0x403a42=md5(JSON[_0xe064('0x18')](_0x21f334));if(this[_0xe064('0x1')]!==_0x403a42){this[_0xe064('0x1')]=_0x403a42;io['to'](util[_0xe064('0x19')](_0xe064('0x1a'),_0x21f334[_0xe064('0x7')]))[_0xe064('0x1b')](_0xe064('0x1c'),_0x21f334);}};module[_0xe064('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index ff00b6b..82317c7 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 _0x8a2c=['beepall','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','available','name','stringify','format','fax:queue:%s','emit','exports','lodash','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy'];(function(_0x3e950d,_0x59ee71){var _0x37c1eb=function(_0x4ca829){while(--_0x4ca829){_0x3e950d['push'](_0x3e950d['shift']());}};_0x37c1eb(++_0x59ee71);}(_0x8a2c,0x12c));var _0xc8a2=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x8a2c[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0xc8a2('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xc8a2('0x1'));config[_0xc8a2('0x2')]=_[_0xc8a2('0x3')](config[_0xc8a2('0x2')],{'host':_0xc8a2('0x4'),'port':0x18eb});var io=require(_0xc8a2('0x5'))(new Redis(config[_0xc8a2('0x2')]));function FaxQueue(_0x37ae13){this['id']=_0x37ae13['id']||0x0;this['name']=_0x37ae13['name']||'';this[_0xc8a2('0x6')]=_0x37ae13['timeout']||0xa;this[_0xc8a2('0x7')]=_0x37ae13[_0xc8a2('0x7')]||_0xc8a2('0x8');this[_0xc8a2('0x9')]=_0x37ae13[_0xc8a2('0x9')];this[_0xc8a2('0xa')]={};this[_0xc8a2('0xb')]=0x0;this[_0xc8a2('0xc')]='';this[_0xc8a2('0xd')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x32ecfc=this[_0xc8a2('0xa')][_0xc8a2('0xe')];this[_0xc8a2('0xa')]=_[_0xc8a2('0xf')](this['Agents'],'id');this[_0xc8a2('0xa')][_0xc8a2('0xe')]=_0x32ecfc;};FaxQueue[_0xc8a2('0x10')][_0xc8a2('0x11')]=function(){this[_0xc8a2('0x12')]=0x0;this[_0xc8a2('0x13')]=0x0;for(var _0x2eb6ee=0x0;_0x2eb6ee=0x0?this['available']:0x0;var _0x78b2a7={'id':this['id'],'available':this[_0xc8a2('0x15')],'loggedIn':this[_0xc8a2('0x12')],'name':this[_0xc8a2('0x16')],'paused':this[_0xc8a2('0x13')],'waiting':this[_0xc8a2('0xb')]};var _0x537f95=md5(JSON[_0xc8a2('0x17')](_0x78b2a7));if(this[_0xc8a2('0xc')]!==_0x537f95){this['md5']=_0x537f95;io['to'](util[_0xc8a2('0x18')](_0xc8a2('0x19'),_0x78b2a7[_0xc8a2('0x16')]))[_0xc8a2('0x1a')]('fax_queue:save',_0x78b2a7);}};module[_0xc8a2('0x1b')]=FaxQueue; \ No newline at end of file +var _0xcf4d=['online','loggedIn','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','_rr','map','prototype','length'];(function(_0x5326e2,_0x27b2ef){var _0x1e85bb=function(_0x59b8f8){while(--_0x59b8f8){_0x5326e2['push'](_0x5326e2['shift']());}};_0x1e85bb(++_0x27b2ef);}(_0xcf4d,0x191));var _0xdcf4=function(_0x3c3366,_0x572dd7){_0x3c3366=_0x3c3366-0x0;var _0x46ffff=_0xcf4d[_0x3c3366];return _0x46ffff;};'use strict';var _=require(_0xdcf4('0x0'));var md5=require('md5');var util=require(_0xdcf4('0x1'));var Redis=require('ioredis');var config=require(_0xdcf4('0x2'));config[_0xdcf4('0x3')]=_['defaults'](config[_0xdcf4('0x3')],{'host':_0xdcf4('0x4'),'port':0x18eb});var io=require(_0xdcf4('0x5'))(new Redis(config[_0xdcf4('0x3')]));function FaxQueue(_0x569fc3){this['id']=_0x569fc3['id']||0x0;this[_0xdcf4('0x6')]=_0x569fc3['name']||'';this[_0xdcf4('0x7')]=_0x569fc3['timeout']||0xa;this[_0xdcf4('0x8')]=_0x569fc3[_0xdcf4('0x8')]||_0xdcf4('0x9');this[_0xdcf4('0xa')]=_0x569fc3[_0xdcf4('0xa')];this[_0xdcf4('0xb')]={};this['waiting']=0x0;this[_0xdcf4('0xc')]='';this[_0xdcf4('0xd')]();this[_0xdcf4('0xe')]();}FaxQueue['prototype'][_0xdcf4('0xd')]=function(){var _0x5192b1=this['mapAgentsId'][_0xdcf4('0xf')];this['mapAgentsId']=_[_0xdcf4('0x10')](this[_0xdcf4('0xa')],'id');this[_0xdcf4('0xb')][_0xdcf4('0xf')]=_0x5192b1;};FaxQueue[_0xdcf4('0x11')][_0xdcf4('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xabbc7d=0x0;_0xabbc7d=0x0?this[_0xdcf4('0x17')]:0x0;var _0x516f17={'id':this['id'],'available':this[_0xdcf4('0x17')],'loggedIn':this[_0xdcf4('0x14')],'name':this[_0xdcf4('0x6')],'paused':this[_0xdcf4('0x16')],'waiting':this[_0xdcf4('0x18')]};var _0x6ce12=md5(JSON[_0xdcf4('0x19')](_0x516f17));if(this[_0xdcf4('0xc')]!==_0x6ce12){this[_0xdcf4('0xc')]=_0x6ce12;io['to'](util[_0xdcf4('0x1a')](_0xdcf4('0x1b'),_0x516f17[_0xdcf4('0x6')]))[_0xdcf4('0x1c')](_0xdcf4('0x1d'),_0x516f17);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9fb9f41..321d3c8 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 _0x8838=['Intervals','exports','name'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x8838,0x137));var _0x8883=function(_0x37d5a1,_0x30bf5b){_0x37d5a1=_0x37d5a1-0x0;var _0x54fefe=_0x8838[_0x37d5a1];return _0x54fefe;};'use strict';function Interval(_0x337702){this['id']=_0x337702['id']||0x0;this[_0x8883('0x0')]=_0x337702['name']||'';this[_0x8883('0x1')]=_0x337702[_0x8883('0x1')]||{};}module[_0x8883('0x2')]=Interval; \ No newline at end of file +var _0x5ca9=['Intervals','exports','name'];(function(_0xa846cd,_0x54e7d7){var _0x2144fb=function(_0x59d453){while(--_0x59d453){_0xa846cd['push'](_0xa846cd['shift']());}};_0x2144fb(++_0x54e7d7);}(_0x5ca9,0xb3));var _0x95ca=function(_0x39cd97,_0x59bb46){_0x39cd97=_0x39cd97-0x0;var _0x35fcf4=_0x5ca9[_0x39cd97];return _0x35fcf4;};'use strict';function Interval(_0xa03e27){this['id']=_0xa03e27['id']||0x0;this[_0x95ca('0x0')]=_0xa03e27[_0x95ca('0x0')]||'';this[_0x95ca('0x1')]=_0xa03e27[_0x95ca('0x1')]||{};}module[_0x95ca('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 8aa68ac..09902db 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 _0x0085=['lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','length','online','available','format','mail:queue:%s','emit','mail_queue:save','exports'];(function(_0x2854c4,_0x3dc2d0){var _0x5c8205=function(_0x4e8570){while(--_0x4e8570){_0x2854c4['push'](_0x2854c4['shift']());}};_0x5c8205(++_0x3dc2d0);}(_0x0085,0xb4));var _0x5008=function(_0x1598fb,_0x29645f){_0x1598fb=_0x1598fb-0x0;var _0x4fae38=_0x0085[_0x1598fb];return _0x4fae38;};'use strict';var _=require(_0x5008('0x0'));var md5=require(_0x5008('0x1'));var util=require('util');var Redis=require(_0x5008('0x2'));var config=require(_0x5008('0x3'));config['redis']=_[_0x5008('0x4')](config[_0x5008('0x5')],{'host':_0x5008('0x6'),'port':0x18eb});var io=require(_0x5008('0x7'))(new Redis(config[_0x5008('0x5')]));function MailQueue(_0x3522cb){this['id']=_0x3522cb['id']||0x0;this[_0x5008('0x8')]=_0x3522cb[_0x5008('0x8')]||'';this[_0x5008('0x9')]=_0x3522cb[_0x5008('0x9')]||0xa;this[_0x5008('0xa')]=_0x3522cb['strategy']||_0x5008('0xb');this['Agents']=_0x3522cb[_0x5008('0xc')];this[_0x5008('0xd')]={};this[_0x5008('0xe')]=0x0;this[_0x5008('0x1')]='';this['updateRouting']();this[_0x5008('0xf')]();}MailQueue[_0x5008('0x10')][_0x5008('0x11')]=function(){var _0x380382=this['mapAgentsId']['_rr'];this[_0x5008('0xd')]=_[_0x5008('0x12')](this[_0x5008('0xc')],'id');this[_0x5008('0xd')][_0x5008('0x13')]=_0x380382;};MailQueue[_0x5008('0x10')][_0x5008('0xf')]=function(){this[_0x5008('0x14')]=0x0;this[_0x5008('0x15')]=0x0;for(var _0x245711=0x0;_0x245711=0x0?this[_0x5008('0x18')]:0x0;var _0x338941={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5008('0x14')],'name':this[_0x5008('0x8')],'paused':this[_0x5008('0x15')],'waiting':this[_0x5008('0xe')]};var _0x169121=md5(JSON['stringify'](_0x338941));if(this['md5']!==_0x169121){this[_0x5008('0x1')]=_0x169121;io['to'](util[_0x5008('0x19')](_0x5008('0x1a'),_0x338941['name']))[_0x5008('0x1b')](_0x5008('0x1c'),_0x338941);}};module[_0x5008('0x1d')]=MailQueue; \ No newline at end of file +var _0x1545=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','mailPause','available','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x594f20,_0x19efe4){var _0x54f0bd=function(_0x15f6c2){while(--_0x15f6c2){_0x594f20['push'](_0x594f20['shift']());}};_0x54f0bd(++_0x19efe4);}(_0x1545,0x11a));var _0x5154=function(_0x3a1bcd,_0x244041){_0x3a1bcd=_0x3a1bcd-0x0;var _0x57422c=_0x1545[_0x3a1bcd];return _0x57422c;};'use strict';var _=require(_0x5154('0x0'));var md5=require(_0x5154('0x1'));var util=require('util');var Redis=require(_0x5154('0x2'));var config=require(_0x5154('0x3'));config[_0x5154('0x4')]=_[_0x5154('0x5')](config[_0x5154('0x4')],{'host':_0x5154('0x6'),'port':0x18eb});var io=require(_0x5154('0x7'))(new Redis(config[_0x5154('0x4')]));function MailQueue(_0x981f7b){this['id']=_0x981f7b['id']||0x0;this[_0x5154('0x8')]=_0x981f7b['name']||'';this[_0x5154('0x9')]=_0x981f7b[_0x5154('0x9')]||0xa;this[_0x5154('0xa')]=_0x981f7b['strategy']||_0x5154('0xb');this['Agents']=_0x981f7b[_0x5154('0xc')];this[_0x5154('0xd')]={};this[_0x5154('0xe')]=0x0;this[_0x5154('0x1')]='';this[_0x5154('0xf')]();this['updateRealtime']();}MailQueue[_0x5154('0x10')][_0x5154('0xf')]=function(){var _0x5efe9f=this[_0x5154('0xd')][_0x5154('0x11')];this['mapAgentsId']=_[_0x5154('0x12')](this[_0x5154('0xc')],'id');this['mapAgentsId'][_0x5154('0x11')]=_0x5efe9f;};MailQueue[_0x5154('0x10')][_0x5154('0x13')]=function(){this[_0x5154('0x14')]=0x0;this[_0x5154('0x15')]=0x0;for(var _0x2002a9=0x0;_0x2002a9=0x0?this[_0x5154('0x18')]:0x0;var _0x4285c6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5154('0x14')],'name':this[_0x5154('0x8')],'paused':this[_0x5154('0x15')],'waiting':this[_0x5154('0xe')]};var _0x3c2161=md5(JSON['stringify'](_0x4285c6));if(this['md5']!==_0x3c2161){this['md5']=_0x3c2161;io['to'](util[_0x5154('0x19')](_0x5154('0x1a'),_0x4285c6[_0x5154('0x8')]))['emit'](_0x5154('0x1b'),_0x4285c6);}};module[_0x5154('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index c23c413..bcb3fbe 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x5e9817,_0xa29439){var _0x25b437=function(_0x46851b){while(--_0x46851b){_0x5e9817['push'](_0x5e9817['shift']());}};_0x25b437(++_0xa29439);}(_0xadb5,0xad));var _0x5adb=function(_0x148517,_0x5d24ef){_0x148517=_0x148517-0x0;var _0xae182c=_0xadb5[_0x148517];return _0xae182c;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index ab936a2..3ef3c46 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 _0x826a=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','paused','online','smsPause','available','loggedIn','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','ioredis','redis','defaults','localhost','name'];(function(_0x48960d,_0x2f9d59){var _0x2f15d6=function(_0x3866a9){while(--_0x3866a9){_0x48960d['push'](_0x48960d['shift']());}};_0x2f15d6(++_0x2f9d59);}(_0x826a,0x1aa));var _0xa826=function(_0x399382,_0x45a8f6){_0x399382=_0x399382-0x0;var _0x495861=_0x826a[_0x399382];return _0x495861;};'use strict';var _=require('lodash');var md5=require(_0xa826('0x0'));var util=require('util');var Redis=require(_0xa826('0x1'));var config=require('../../../config/environment');config[_0xa826('0x2')]=_[_0xa826('0x3')](config[_0xa826('0x2')],{'host':_0xa826('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa826('0x2')]));function SmsQueue(_0x15f777){this['id']=_0x15f777['id']||0x0;this[_0xa826('0x5')]=_0x15f777[_0xa826('0x5')]||'';this[_0xa826('0x6')]=_0x15f777[_0xa826('0x6')]||0xa;this[_0xa826('0x7')]=_0x15f777[_0xa826('0x7')]||_0xa826('0x8');this[_0xa826('0x9')]=_0x15f777[_0xa826('0x9')];this[_0xa826('0xa')]={};this[_0xa826('0xb')]=0x0;this[_0xa826('0x0')]='';this[_0xa826('0xc')]();this[_0xa826('0xd')]();}SmsQueue['prototype'][_0xa826('0xc')]=function(){var _0x4b4caf=this[_0xa826('0xa')][_0xa826('0xe')];this[_0xa826('0xa')]=_[_0xa826('0xf')](this[_0xa826('0x9')],'id');this[_0xa826('0xa')][_0xa826('0xe')]=_0x4b4caf;};SmsQueue['prototype'][_0xa826('0xd')]=function(){this['loggedIn']=0x0;this[_0xa826('0x10')]=0x0;for(var _0x41c0c2=0x0;_0x41c0c2=0x0?this[_0xa826('0x13')]:0x0;var _0x90486c={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa826('0x14')],'name':this[_0xa826('0x5')],'paused':this[_0xa826('0x10')],'waiting':this['waiting']};var _0x5d8161=md5(JSON[_0xa826('0x15')](_0x90486c));if(this[_0xa826('0x0')]!==_0x5d8161){this[_0xa826('0x0')]=_0x5d8161;io['to'](util[_0xa826('0x16')](_0xa826('0x17'),_0x90486c['name']))[_0xa826('0x18')](_0xa826('0x19'),_0x90486c);}};module[_0xa826('0x1a')]=SmsQueue; \ No newline at end of file +var _0x4ded=['md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','map','_rr','prototype','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash'];(function(_0x29e623,_0x26776a){var _0x2cab45=function(_0x2c631f){while(--_0x2c631f){_0x29e623['push'](_0x29e623['shift']());}};_0x2cab45(++_0x26776a);}(_0x4ded,0x116));var _0xd4de=function(_0x42642d,_0x18d9e1){_0x42642d=_0x42642d-0x0;var _0x916131=_0x4ded[_0x42642d];return _0x916131;};'use strict';var _=require(_0xd4de('0x0'));var md5=require(_0xd4de('0x1'));var util=require(_0xd4de('0x2'));var Redis=require(_0xd4de('0x3'));var config=require(_0xd4de('0x4'));config[_0xd4de('0x5')]=_[_0xd4de('0x6')](config[_0xd4de('0x5')],{'host':_0xd4de('0x7'),'port':0x18eb});var io=require(_0xd4de('0x8'))(new Redis(config[_0xd4de('0x5')]));function SmsQueue(_0x8fbe6a){this['id']=_0x8fbe6a['id']||0x0;this['name']=_0x8fbe6a[_0xd4de('0x9')]||'';this[_0xd4de('0xa')]=_0x8fbe6a[_0xd4de('0xa')]||0xa;this[_0xd4de('0xb')]=_0x8fbe6a[_0xd4de('0xb')]||_0xd4de('0xc');this['Agents']=_0x8fbe6a[_0xd4de('0xd')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xd4de('0xe')]();this[_0xd4de('0xf')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x4c9499=this[_0xd4de('0x10')]['_rr'];this[_0xd4de('0x10')]=_[_0xd4de('0x11')](this[_0xd4de('0xd')],'id');this[_0xd4de('0x10')][_0xd4de('0x12')]=_0x4c9499;};SmsQueue[_0xd4de('0x13')][_0xd4de('0xf')]=function(){this[_0xd4de('0x14')]=0x0;this[_0xd4de('0x15')]=0x0;for(var _0x37cb9f=0x0;_0x37cb9f=0x0?this['available']:0x0;var _0x4d0df6={'id':this['id'],'available':this[_0xd4de('0x19')],'loggedIn':this['loggedIn'],'name':this[_0xd4de('0x9')],'paused':this[_0xd4de('0x15')],'waiting':this['waiting']};var _0xc15081=md5(JSON['stringify'](_0x4d0df6));if(this[_0xd4de('0x1')]!==_0xc15081){this[_0xd4de('0x1')]=_0xc15081;io['to'](util[_0xd4de('0x1a')](_0xd4de('0x1b'),_0x4d0df6['name']))[_0xd4de('0x1c')](_0xd4de('0x1d'),_0x4d0df6);}};module[_0xd4de('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 341a38b..0006e16 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 _0xde5d=['timeout','beepall','Agents','mapAgentsId','updateRealtime','updateRouting','_rr','map','prototype','length','online','whatsappPause','available','loggedIn','paused','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x292bcc,_0x334625){var _0x53b6d4=function(_0x9efacd){while(--_0x9efacd){_0x292bcc['push'](_0x292bcc['shift']());}};_0x53b6d4(++_0x334625);}(_0xde5d,0x1e7));var _0xdde5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xde5d[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xdde5('0x0'));var md5=require(_0xdde5('0x1'));var util=require(_0xdde5('0x2'));var Redis=require(_0xdde5('0x3'));var config=require(_0xdde5('0x4'));config[_0xdde5('0x5')]=_['defaults'](config[_0xdde5('0x5')],{'host':_0xdde5('0x6'),'port':0x18eb});var io=require(_0xdde5('0x7'))(new Redis(config[_0xdde5('0x5')]));function WhatsappQueue(_0x492ab9){this['id']=_0x492ab9['id']||0x0;this['name']=_0x492ab9[_0xdde5('0x8')]||'';this[_0xdde5('0x9')]=_0x492ab9[_0xdde5('0x9')]||0xa;this['strategy']=_0x492ab9['strategy']||_0xdde5('0xa');this['Agents']=_0x492ab9[_0xdde5('0xb')];this[_0xdde5('0xc')]={};this['waiting']=0x0;this[_0xdde5('0x1')]='';this['updateRouting']();this[_0xdde5('0xd')]();}WhatsappQueue['prototype'][_0xdde5('0xe')]=function(){var _0x3279b8=this['mapAgentsId'][_0xdde5('0xf')];this[_0xdde5('0xc')]=_[_0xdde5('0x10')](this[_0xdde5('0xb')],'id');this['mapAgentsId'][_0xdde5('0xf')]=_0x3279b8;};WhatsappQueue[_0xdde5('0x11')][_0xdde5('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x122c92=0x0;_0x122c92=0x0?this[_0xdde5('0x15')]:0x0;var _0x118619={'id':this['id'],'available':this[_0xdde5('0x15')],'loggedIn':this[_0xdde5('0x16')],'name':this[_0xdde5('0x8')],'paused':this[_0xdde5('0x17')],'waiting':this[_0xdde5('0x18')]};var _0xd8d0fe=md5(JSON[_0xdde5('0x19')](_0x118619));if(this[_0xdde5('0x1')]!==_0xd8d0fe){this[_0xdde5('0x1')]=_0xd8d0fe;io['to'](util[_0xdde5('0x1a')](_0xdde5('0x1b'),_0x118619['name']))[_0xdde5('0x1c')](_0xdde5('0x1d'),_0x118619);}};module[_0xdde5('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x67ce=['stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','online','loggedIn','whatsappPause','available'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x67ce,0xb9));var _0xe67c=function(_0x125838,_0x438e6b){_0x125838=_0x125838-0x0;var _0x3e6cc4=_0x67ce[_0x125838];return _0x3e6cc4;};'use strict';var _=require(_0xe67c('0x0'));var md5=require(_0xe67c('0x1'));var util=require(_0xe67c('0x2'));var Redis=require(_0xe67c('0x3'));var config=require(_0xe67c('0x4'));config[_0xe67c('0x5')]=_[_0xe67c('0x6')](config[_0xe67c('0x5')],{'host':_0xe67c('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe67c('0x5')]));function WhatsappQueue(_0x4148bd){this['id']=_0x4148bd['id']||0x0;this['name']=_0x4148bd[_0xe67c('0x8')]||'';this[_0xe67c('0x9')]=_0x4148bd['timeout']||0xa;this[_0xe67c('0xa')]=_0x4148bd[_0xe67c('0xa')]||_0xe67c('0xb');this[_0xe67c('0xc')]=_0x4148bd['Agents'];this[_0xe67c('0xd')]={};this[_0xe67c('0xe')]=0x0;this['md5']='';this[_0xe67c('0xf')]();this[_0xe67c('0x10')]();}WhatsappQueue[_0xe67c('0x11')][_0xe67c('0xf')]=function(){var _0x5828c0=this[_0xe67c('0xd')]['_rr'];this[_0xe67c('0xd')]=_['map'](this[_0xe67c('0xc')],'id');this[_0xe67c('0xd')][_0xe67c('0x12')]=_0x5828c0;};WhatsappQueue['prototype'][_0xe67c('0x10')]=function(){this['loggedIn']=0x0;this[_0xe67c('0x13')]=0x0;for(var _0x36288c=0x0;_0x36288c=0x0?this[_0xe67c('0x18')]:0x0;var _0x387661={'id':this['id'],'available':this[_0xe67c('0x18')],'loggedIn':this[_0xe67c('0x16')],'name':this[_0xe67c('0x8')],'paused':this[_0xe67c('0x13')],'waiting':this[_0xe67c('0xe')]};var _0x38aadc=md5(JSON[_0xe67c('0x19')](_0x387661));if(this['md5']!==_0x38aadc){this[_0xe67c('0x1')]=_0x38aadc;io['to'](util[_0xe67c('0x1a')](_0xe67c('0x1b'),_0x387661[_0xe67c('0x8')]))['emit'](_0xe67c('0x1c'),_0x387661);}};module[_0xe67c('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ba6c2cc..9ac06a0 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xa0ffc,_0x4cf303){var _0xd2d414=function(_0x116fc0){while(--_0x116fc0){_0xa0ffc['push'](_0xa0ffc['shift']());}};_0xd2d414(++_0x4cf303);}(_0xb10b,0x12a));var _0xbb10=function(_0x5dc6e8,_0x1ed7cc){_0x5dc6e8=_0x5dc6e8-0x0;var _0x2cb306=_0xb10b[_0x5dc6e8];return _0x2cb306;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x335aeb,_0x5f0c09){var _0x2a563f=function(_0x3d1721){while(--_0x3d1721){_0x335aeb['push'](_0x335aeb['shift']());}};_0x2a563f(++_0x5f0c09);}(_0xb10b,0x12a));var _0xbb10=function(_0x16c2e0,_0x3dc335){_0x16c2e0=_0x16c2e0-0x0;var _0x49b690=_0xb10b[_0x16c2e0];return _0x49b690;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 50419dc..f099af1 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 _0xa7a1=['AddTagsToChatInteraction','addTagsToChatInteraction','update','UpdateChatInteraction','addTags','Request'];(function(_0x4330ec,_0x3f4522){var _0x5aa853=function(_0x2fa315){while(--_0x2fa315){_0x4330ec['push'](_0x4330ec['shift']());}};_0x5aa853(++_0x3f4522);}(_0xa7a1,0x1d6));var _0x1a7a=function(_0x37aed4,_0x254b7d){_0x37aed4=_0x37aed4-0x0;var _0x1ec4f3=_0xa7a1[_0x37aed4];return _0x1ec4f3;};'use strict';var client=require('../client');exports[_0x1a7a('0x0')]=function(_0x2be796,_0x306d4b){return client['Request'](_0x1a7a('0x1'),{'body':_0x306d4b,'options':{'where':{'id':_0x2be796}},'log':'updateChatInteraction'});};exports[_0x1a7a('0x2')]=function(_0x16390d,_0xdaa3dd){return client[_0x1a7a('0x3')](_0x1a7a('0x4'),{'body':_0xdaa3dd,'options':{'where':{'id':_0x16390d}},'log':_0x1a7a('0x5')});}; \ No newline at end of file +var _0x2dbc=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x2dbc,0x1de));var _0xc2db=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x2dbc[_0x2706da];return _0x3ba87e;};'use strict';var client=require('../client');exports[_0xc2db('0x0')]=function(_0x182e12,_0x578e0a){return client[_0xc2db('0x1')](_0xc2db('0x2'),{'body':_0x578e0a,'options':{'where':{'id':_0x182e12}},'log':_0xc2db('0x3')});};exports[_0xc2db('0x4')]=function(_0x2b11de,_0x42262a){return client[_0xc2db('0x1')](_0xc2db('0x5'),{'body':_0x42262a,'options':{'where':{'id':_0x2b11de}},'log':_0xc2db('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ef8976e..b965dc8 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 _0x6e5c=['createChatMessage','../client','create','Request'];(function(_0x1be385,_0x1f9349){var _0x103569=function(_0x212026){while(--_0x212026){_0x1be385['push'](_0x1be385['shift']());}};_0x103569(++_0x1f9349);}(_0x6e5c,0x8d));var _0xc6e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e5c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc6e5('0x0'));exports[_0xc6e5('0x1')]=function(_0x3d0c3b){return client[_0xc6e5('0x2')]('CreateChatMessage',{'body':_0x3d0c3b,'log':_0xc6e5('0x3')});}; \ No newline at end of file +var _0xf72c=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf72c,0x7d));var _0xcf72=function(_0x500e8b,_0x43d26a){_0x500e8b=_0x500e8b-0x0;var _0x2cd48e=_0xf72c[_0x500e8b];return _0x2cd48e;};'use strict';var client=require(_0xcf72('0x0'));exports['create']=function(_0x1b412c){return client[_0xcf72('0x1')](_0xcf72('0x2'),{'body':_0x1b412c,'log':_0xcf72('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index ff900bb..5261655 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 _0xf88f=['Agents','online','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x1b47b3,_0x4bcb96){var _0x151f28=function(_0x4b5a5b){while(--_0x4b5a5b){_0x1b47b3['push'](_0x1b47b3['shift']());}};_0x151f28(++_0x4bcb96);}(_0xf88f,0x1bb));var _0xff88=function(_0x45c6ff,_0xd54c98){_0x45c6ff=_0x45c6ff-0x0;var _0x59d6c5=_0xf88f[_0x45c6ff];return _0x59d6c5;};'use strict';var client=require(_0xff88('0x0'));exports[_0xff88('0x1')]=function(){return function(){return client[_0xff88('0x2')](_0xff88('0x3'),{'options':{'raw':![],'attributes':['id',_0xff88('0x4'),_0xff88('0x5'),_0xff88('0x6')],'include':[{'model':'User','as':_0xff88('0x7'),'attributes':['id',_0xff88('0x4'),_0xff88('0x8'),'chatPause']}]},'log':_0xff88('0x1')});};}; \ No newline at end of file +var _0x158f=['Request','GetChatQueue','name','timeout','strategy','User','chatPause','getChatQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x158f,0x137));var _0xf158=function(_0x386408,_0x584c61){_0x386408=_0x386408-0x0;var _0xedb599=_0x158f[_0x386408];return _0xedb599;};'use strict';var client=require('../client');exports[_0xf158('0x0')]=function(){return function(){return client[_0xf158('0x1')](_0xf158('0x2'),{'options':{'raw':![],'attributes':['id',_0xf158('0x3'),_0xf158('0x4'),_0xf158('0x5')],'include':[{'model':_0xf158('0x6'),'as':'Agents','attributes':['id',_0xf158('0x3'),'online',_0xf158('0x7')]}]},'log':_0xf158('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6963e3b..6972c8c 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 _0x3dd5=['../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x5a459e,_0x5573e9){var _0x545aec=function(_0x1c6b84){while(--_0x1c6b84){_0x5a459e['push'](_0x5a459e['shift']());}};_0x545aec(++_0x5573e9);}(_0x3dd5,0x73));var _0x53dd=function(_0x1d6590,_0x41a973){_0x1d6590=_0x1d6590-0x0;var _0x53f9b5=_0x3dd5[_0x1d6590];return _0x53f9b5;};'use strict';var client=require(_0x53dd('0x0'));exports['create']=function(_0x46325c){return client[_0x53dd('0x1')](_0x53dd('0x2'),{'body':_0x46325c,'log':_0x53dd('0x2')});};exports[_0x53dd('0x3')]=function(_0x455417,_0x2ac886){return client[_0x53dd('0x1')](_0x53dd('0x4'),{'body':_0x2ac886,'options':{'where':{'uniqueid':_0x455417},'order':[['id','DESC']],'limit':0x1},'log':_0x53dd('0x4')});}; \ No newline at end of file +var _0xf296=['Request','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x39628c,_0x2eb8c4){var _0x2b0532=function(_0x87cc3b){while(--_0x87cc3b){_0x39628c['push'](_0x39628c['shift']());}};_0x2b0532(++_0x2eb8c4);}(_0xf296,0x94));var _0x6f29=function(_0x3ee952,_0x565e0f){_0x3ee952=_0x3ee952-0x0;var _0xc0c8b1=_0xf296[_0x3ee952];return _0xc0c8b1;};'use strict';var client=require(_0x6f29('0x0'));exports[_0x6f29('0x1')]=function(_0x4e5239){return client[_0x6f29('0x2')]('CreateChatQueueReport',{'body':_0x4e5239,'log':'CreateChatQueueReport'});};exports[_0x6f29('0x3')]=function(_0x3cdbee,_0x4cdc12){return client[_0x6f29('0x2')](_0x6f29('0x4'),{'body':_0x4cdc12,'options':{'where':{'uniqueid':_0x3cdbee},'order':[['id',_0x6f29('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 3a05908..6508cd0 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x7a54,0x106));var _0x47a5=function(_0x9d9157,_0x3672e2){_0x9d9157=_0x9d9157-0x0;var _0xa61b79=_0x7a54[_0x9d9157];return _0xa61b79;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x7a54,0x106));var _0x47a5=function(_0x4f6d81,_0x4dade2){_0x4f6d81=_0x4f6d81-0x0;var _0xc7ade4=_0x7a54[_0x4f6d81];return _0xc7ade4;};'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 cab6669..a00cfc9 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 _0x79ac=['Request','CreateFaxMessage','../client','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x79ac,0x172));var _0xc79a=function(_0x4c3b3b,_0xbf6c8){_0x4c3b3b=_0x4c3b3b-0x0;var _0x3cc11b=_0x79ac[_0x4c3b3b];return _0x3cc11b;};'use strict';var client=require(_0xc79a('0x0'));exports[_0xc79a('0x1')]=function(_0x37e678){return client[_0xc79a('0x2')](_0xc79a('0x3'),{'body':_0x37e678,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x5bf2=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x4e92a5,_0x2e12e2){var _0x5c3b1f=function(_0x836836){while(--_0x836836){_0x4e92a5['push'](_0x4e92a5['shift']());}};_0x5c3b1f(++_0x2e12e2);}(_0x5bf2,0x8f));var _0x25bf=function(_0x45d624,_0x2a73fb){_0x45d624=_0x45d624-0x0;var _0x38a24f=_0x5bf2[_0x45d624];return _0x38a24f;};'use strict';var client=require(_0x25bf('0x0'));exports[_0x25bf('0x1')]=function(_0x350a8f){return client['Request'](_0x25bf('0x2'),{'body':_0x350a8f,'log':_0x25bf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 51c9b80..612d84f 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 _0xc766=['name','timeout','User','online','getFaxQueues','../client','Request'];(function(_0xd440b9,_0x5ec86a){var _0x4b0cbc=function(_0x129c4d){while(--_0x129c4d){_0xd440b9['push'](_0xd440b9['shift']());}};_0x4b0cbc(++_0x5ec86a);}(_0xc766,0x6e));var _0x6c76=function(_0x5d3591,_0x574d3f){_0x5d3591=_0x5d3591-0x0;var _0x55208f=_0xc766[_0x5d3591];return _0x55208f;};'use strict';var client=require(_0x6c76('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x6c76('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x6c76('0x2'),_0x6c76('0x3'),'strategy'],'include':[{'model':_0x6c76('0x4'),'as':'Agents','attributes':['id',_0x6c76('0x2'),_0x6c76('0x5'),'faxPause']}]},'log':_0x6c76('0x6')});};}; \ No newline at end of file +var _0xf70d=['Agents','online','faxPause','GetFaxQueue','timeout','strategy','User'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0xf70d,0xc7));var _0xdf70=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xf70d[_0x5608a3];return _0x1ed50a;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client['Request'](_0xdf70('0x0'),{'options':{'raw':![],'attributes':['id','name',_0xdf70('0x1'),_0xdf70('0x2')],'include':[{'model':_0xdf70('0x3'),'as':_0xdf70('0x4'),'attributes':['id','name',_0xdf70('0x5'),_0xdf70('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a2a915c..58158c0 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 _0x085e=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','create'];(function(_0x327002,_0x13842b){var _0x49a7dd=function(_0x47fef3){while(--_0x47fef3){_0x327002['push'](_0x327002['shift']());}};_0x49a7dd(++_0x13842b);}(_0x085e,0x1bb));var _0xe085=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x085e[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0xe085('0x0')]=function(_0x5a411b){return client[_0xe085('0x1')](_0xe085('0x2'),{'body':_0x5a411b,'log':_0xe085('0x2')});};exports[_0xe085('0x3')]=function(_0x93ee00,_0x42557e){return client[_0xe085('0x1')](_0xe085('0x4'),{'body':_0x42557e,'options':{'where':{'uniqueid':_0x93ee00},'order':[['id',_0xe085('0x5')]],'limit':0x1},'log':_0xe085('0x4')});}; \ No newline at end of file +var _0x2fcd=['DESC','../client','create','CreateFaxQueueReport','Request','UpdateFaxQueueReport'];(function(_0x2e3c1a,_0x297f60){var _0x8f41a=function(_0x1522b5){while(--_0x1522b5){_0x2e3c1a['push'](_0x2e3c1a['shift']());}};_0x8f41a(++_0x297f60);}(_0x2fcd,0xa3));var _0xd2fc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2fcd[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0xd2fc('0x0'));exports[_0xd2fc('0x1')]=function(_0x174a41){return client['Request'](_0xd2fc('0x2'),{'body':_0x174a41,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x5e432f,_0x22ac2e){return client[_0xd2fc('0x3')](_0xd2fc('0x4'),{'body':_0x22ac2e,'options':{'where':{'uniqueid':_0x5e432f},'order':[['id',_0xd2fc('0x5')]],'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 45768e4..a2349f2 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 _0x0ca8=['Request','name','Intervals','interval','getIntervals','../client'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x0ca8,0xfb));var _0x80ca=function(_0x420b98,_0x8facfe){_0x420b98=_0x420b98-0x0;var _0x14b8f4=_0x0ca8[_0x420b98];return _0x14b8f4;};'use strict';var client=require(_0x80ca('0x0'));exports['getIntervals']=function(){return function(){return client[_0x80ca('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x80ca('0x2')],'include':[{'model':'Interval','as':_0x80ca('0x3'),'attributes':['id',_0x80ca('0x2'),_0x80ca('0x4')]}]},'log':_0x80ca('0x5')});};}; \ No newline at end of file +var _0x1dfd=['Request','GetInterval','Interval','name','interval','../client','getIntervals'];(function(_0x433b93,_0x40db4f){var _0x116edd=function(_0x62fb77){while(--_0x62fb77){_0x433b93['push'](_0x433b93['shift']());}};_0x116edd(++_0x40db4f);}(_0x1dfd,0x67));var _0xd1df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1dfd[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0xd1df('0x0'));exports[_0xd1df('0x1')]=function(){return function(){return client[_0xd1df('0x2')](_0xd1df('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xd1df('0x4'),'as':'Intervals','attributes':['id',_0xd1df('0x5'),_0xd1df('0x6')]}]},'log':_0xd1df('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f33ae4b..f321e7a 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 _0xb44a=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','addTags'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0xb44a,0x1c2));var _0xab44=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0xb44a[_0x3cae69];return _0x3128eb;};'use strict';var client=require('../client');exports['update']=function(_0x93bb2f,_0x492c1a){return client[_0xab44('0x0')]('UpdateMailInteraction',{'body':_0x492c1a,'options':{'where':{'id':_0x93bb2f}},'log':'updateMailInteraction'});};exports[_0xab44('0x1')]=function(_0x5c93b4,_0x1b9e05){return client[_0xab44('0x0')](_0xab44('0x2'),{'body':_0x1b9e05,'options':{'where':{'id':_0x5c93b4}},'log':_0xab44('0x3')});}; \ No newline at end of file +var _0x9582=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','addTags'];(function(_0x3bb8eb,_0x237cc8){var _0x18a7ac=function(_0x314aba){while(--_0x314aba){_0x3bb8eb['push'](_0x3bb8eb['shift']());}};_0x18a7ac(++_0x237cc8);}(_0x9582,0x95));var _0x2958=function(_0x193ec0,_0x3935a6){_0x193ec0=_0x193ec0-0x0;var _0xcae00a=_0x9582[_0x193ec0];return _0xcae00a;};'use strict';var client=require(_0x2958('0x0'));exports[_0x2958('0x1')]=function(_0xd87e37,_0x3d6d1f){return client[_0x2958('0x2')](_0x2958('0x3'),{'body':_0x3d6d1f,'options':{'where':{'id':_0xd87e37}},'log':'updateMailInteraction'});};exports[_0x2958('0x4')]=function(_0x3b907e,_0x136c77){return client[_0x2958('0x2')](_0x2958('0x5'),{'body':_0x136c77,'options':{'where':{'id':_0x3b907e}},'log':_0x2958('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 00e3f9f..eaf06ec 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 _0x2a4f=['Request','../client','create'];(function(_0x30a40b,_0x96941c){var _0x2772ef=function(_0x705c21){while(--_0x705c21){_0x30a40b['push'](_0x30a40b['shift']());}};_0x2772ef(++_0x96941c);}(_0x2a4f,0x130));var _0xf2a4=function(_0x4651bd,_0x12a42f){_0x4651bd=_0x4651bd-0x0;var _0xdf510d=_0x2a4f[_0x4651bd];return _0xdf510d;};'use strict';var client=require(_0xf2a4('0x0'));exports[_0xf2a4('0x1')]=function(_0x21dbb1){return client[_0xf2a4('0x2')]('CreateMailMessage',{'body':_0x21dbb1,'log':'createMailMessage'});}; \ No newline at end of file +var _0xf8f4=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x26512f,_0x4834c){var _0x4dc442=function(_0x4a4514){while(--_0x4a4514){_0x26512f['push'](_0x26512f['shift']());}};_0x4dc442(++_0x4834c);}(_0xf8f4,0x1e0));var _0x4f8f=function(_0x4df337,_0x3bf41d){_0x4df337=_0x4df337-0x0;var _0x4a1c4e=_0xf8f4[_0x4df337];return _0x4a1c4e;};'use strict';var client=require(_0x4f8f('0x0'));exports[_0x4f8f('0x1')]=function(_0x51f75e){return client['Request'](_0x4f8f('0x2'),{'body':_0x51f75e,'log':_0x4f8f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 361d832..a4ffa08 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 _0x9a1f=['strategy','User','Agents','name','online','getMailQueues','../client','Request','timeout'];(function(_0x22962d,_0x40fea9){var _0x3ed981=function(_0x153497){while(--_0x153497){_0x22962d['push'](_0x22962d['shift']());}};_0x3ed981(++_0x40fea9);}(_0x9a1f,0xde));var _0xf9a1=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9a1f[_0x297fd3];return _0x2af381;};'use strict';var client=require(_0xf9a1('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xf9a1('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0xf9a1('0x2'),_0xf9a1('0x3')],'include':[{'model':_0xf9a1('0x4'),'as':_0xf9a1('0x5'),'attributes':['id',_0xf9a1('0x6'),_0xf9a1('0x7'),'mailPause']}]},'log':_0xf9a1('0x8')});};}; \ No newline at end of file +var _0xd018=['GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xd018,0xda));var _0x8d01=function(_0x11e8f3,_0xdc8f8){_0x11e8f3=_0x11e8f3-0x0;var _0x1a85c2=_0xd018[_0x11e8f3];return _0x1a85c2;};'use strict';var client=require(_0x8d01('0x0'));exports[_0x8d01('0x1')]=function(){return function(){return client['Request'](_0x8d01('0x2'),{'options':{'raw':![],'attributes':['id',_0x8d01('0x3'),_0x8d01('0x4'),_0x8d01('0x5')],'include':[{'model':_0x8d01('0x6'),'as':_0x8d01('0x7'),'attributes':['id',_0x8d01('0x3'),_0x8d01('0x8'),_0x8d01('0x9')]}]},'log':_0x8d01('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 9827192..8e75b59 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 _0x22be=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','Request'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x22be,0x88));var _0xe22b=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x22be[_0x46f1a6];return _0x38429a;};'use strict';var client=require(_0xe22b('0x0'));exports['create']=function(_0x52e3f4){return client[_0xe22b('0x1')]('CreateMailQueueReport',{'body':_0x52e3f4,'log':_0xe22b('0x2')});};exports[_0xe22b('0x3')]=function(_0x8dfef4,_0x11832f){return client[_0xe22b('0x1')](_0xe22b('0x4'),{'body':_0x11832f,'options':{'where':{'uniqueid':_0x8dfef4},'order':[['id',_0xe22b('0x5')]],'limit':0x1},'log':_0xe22b('0x4')});}; \ No newline at end of file +var _0x9bde=['update','DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x56202d,_0x20a661){var _0x11b435=function(_0x2329d4){while(--_0x2329d4){_0x56202d['push'](_0x56202d['shift']());}};_0x11b435(++_0x20a661);}(_0x9bde,0xc0));var _0xe9bd=function(_0x23c65d,_0x3dd889){_0x23c65d=_0x23c65d-0x0;var _0x53d5f9=_0x9bde[_0x23c65d];return _0x53d5f9;};'use strict';var client=require(_0xe9bd('0x0'));exports[_0xe9bd('0x1')]=function(_0x156eb2){return client[_0xe9bd('0x2')](_0xe9bd('0x3'),{'body':_0x156eb2,'log':_0xe9bd('0x3')});};exports[_0xe9bd('0x4')]=function(_0xb90a9a,_0x22f455){return client[_0xe9bd('0x2')]('UpdateMailQueueReport',{'body':_0x22f455,'options':{'where':{'uniqueid':_0xb90a9a},'order':[['id',_0xe9bd('0x5')]],'limit':0x1},'log':_0xe9bd('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index f6385e0..749da15 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 _0xd750=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x513f04,_0x979225){var _0x4498f2=function(_0x462429){while(--_0x462429){_0x513f04['push'](_0x513f04['shift']());}};_0x4498f2(++_0x979225);}(_0xd750,0xdc));var _0x0d75=function(_0x53be66,_0x9ec3be){_0x53be66=_0x53be66-0x0;var _0x9e5520=_0xd750[_0x53be66];return _0x9e5520;};'use strict';var client=require(_0x0d75('0x0'));exports[_0x0d75('0x1')]=function(_0x4665a5,_0x30ab36){return client[_0x0d75('0x2')]('UpdateOpenchannelInteraction',{'body':_0x30ab36,'options':{'where':{'id':_0x4665a5}},'log':_0x0d75('0x3')});};exports[_0x0d75('0x4')]=function(_0x4bd665,_0x436d95){return client[_0x0d75('0x2')](_0x0d75('0x5'),{'body':_0x436d95,'options':{'where':{'id':_0x4bd665}},'log':_0x0d75('0x6')});}; \ No newline at end of file +var _0x566c=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x566c,0x181));var _0xc566=function(_0x6f2096,_0x1d2760){_0x6f2096=_0x6f2096-0x0;var _0x1cf8d7=_0x566c[_0x6f2096];return _0x1cf8d7;};'use strict';var client=require(_0xc566('0x0'));exports[_0xc566('0x1')]=function(_0x3d2227,_0x255789){return client[_0xc566('0x2')](_0xc566('0x3'),{'body':_0x255789,'options':{'where':{'id':_0x3d2227}},'log':_0xc566('0x4')});};exports[_0xc566('0x5')]=function(_0x3fb2ff,_0x43982c){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x43982c,'options':{'where':{'id':_0x3fb2ff}},'log':_0xc566('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 75436be..c339dd8 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 _0xd8a6=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0xd8a6,0x10a));var _0x6d8a=function(_0x3a43e5,_0x3f647a){_0x3a43e5=_0x3a43e5-0x0;var _0x3fefdb=_0xd8a6[_0x3a43e5];return _0x3fefdb;};'use strict';var client=require(_0x6d8a('0x0'));exports[_0x6d8a('0x1')]=function(_0x477bae){return client[_0x6d8a('0x2')](_0x6d8a('0x3'),{'body':_0x477bae,'log':_0x6d8a('0x4')});}; \ No newline at end of file +var _0xf34b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x2bce4e,_0x5e00a9){var _0x2cc3c3=function(_0x49ae65){while(--_0x49ae65){_0x2bce4e['push'](_0x2bce4e['shift']());}};_0x2cc3c3(++_0x5e00a9);}(_0xf34b,0xc7));var _0xbf34=function(_0x4dc3f4,_0x53c37e){_0x4dc3f4=_0x4dc3f4-0x0;var _0x3c64c3=_0xf34b[_0x4dc3f4];return _0x3c64c3;};'use strict';var client=require(_0xbf34('0x0'));exports[_0xbf34('0x1')]=function(_0x13b980){return client[_0xbf34('0x2')](_0xbf34('0x3'),{'body':_0x13b980,'log':_0xbf34('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6e699dd..ca278f8 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 _0xb92b=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','online'];(function(_0x548483,_0x5e53ab){var _0x53afbd=function(_0x4c9f9c){while(--_0x4c9f9c){_0x548483['push'](_0x548483['shift']());}};_0x53afbd(++_0x5e53ab);}(_0xb92b,0x90));var _0xbb92=function(_0x3dbbba,_0x305966){_0x3dbbba=_0x3dbbba-0x0;var _0x2f2958=_0xb92b[_0x3dbbba];return _0x2f2958;};'use strict';var client=require(_0xbb92('0x0'));exports[_0xbb92('0x1')]=function(){return function(){return client[_0xbb92('0x2')](_0xbb92('0x3'),{'options':{'raw':![],'attributes':['id',_0xbb92('0x4'),_0xbb92('0x5'),'strategy'],'include':[{'model':_0xbb92('0x6'),'as':'Agents','attributes':['id',_0xbb92('0x4'),_0xbb92('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x61d4=['strategy','User','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x320b9e,_0x1f892f){var _0x5e4416=function(_0x160fcc){while(--_0x160fcc){_0x320b9e['push'](_0x320b9e['shift']());}};_0x5e4416(++_0x1f892f);}(_0x61d4,0xbb));var _0x461d=function(_0xc8db78,_0x58b5a7){_0xc8db78=_0xc8db78-0x0;var _0x3483f3=_0x61d4[_0xc8db78];return _0x3483f3;};'use strict';var client=require('../client');exports[_0x461d('0x0')]=function(){return function(){return client[_0x461d('0x1')](_0x461d('0x2'),{'options':{'raw':![],'attributes':['id',_0x461d('0x3'),_0x461d('0x4'),_0x461d('0x5')],'include':[{'model':_0x461d('0x6'),'as':'Agents','attributes':['id','name','online',_0x461d('0x7')]}]},'log':_0x461d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 18ac4c9..84d23de 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 _0x7275=['create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','../client'];(function(_0x84228a,_0x208d80){var _0x34b2ba=function(_0x15c49a){while(--_0x15c49a){_0x84228a['push'](_0x84228a['shift']());}};_0x34b2ba(++_0x208d80);}(_0x7275,0x143));var _0x5727=function(_0x2655a6,_0x1f1920){_0x2655a6=_0x2655a6-0x0;var _0x384a51=_0x7275[_0x2655a6];return _0x384a51;};'use strict';var client=require(_0x5727('0x0'));exports[_0x5727('0x1')]=function(_0x34efb2){return client['Request'](_0x5727('0x2'),{'body':_0x34efb2,'log':'CreateOpenchannelQueueReport'});};exports[_0x5727('0x3')]=function(_0x35e38f,_0x5c21b3){return client[_0x5727('0x4')](_0x5727('0x5'),{'body':_0x5c21b3,'options':{'where':{'uniqueid':_0x35e38f},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x764e=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x26371f,_0x3529d6){var _0x7bf77f=function(_0xaaf7ec){while(--_0xaaf7ec){_0x26371f['push'](_0x26371f['shift']());}};_0x7bf77f(++_0x3529d6);}(_0x764e,0x16d));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xe764('0x0')]=function(_0x30f642){return client[_0xe764('0x1')](_0xe764('0x2'),{'body':_0x30f642,'log':_0xe764('0x2')});};exports[_0xe764('0x3')]=function(_0x5d27f9,_0x151fa4){return client[_0xe764('0x1')](_0xe764('0x4'),{'body':_0x151fa4,'options':{'where':{'uniqueid':_0x5d27f9},'order':[['id','DESC']],'limit':0x1},'log':_0xe764('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 8dbd81e..b638c3d 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 _0xa1a5=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x3e0bea,_0x10b049){_0x3e0bea=_0x3e0bea-0x0;var _0x3c9a58=_0xa1a5[_0x3e0bea];return _0x3c9a58;};'use strict';var client=require(_0x5a1a('0x0'));exports['update']=function(_0xe8a51b,_0x47102b){return client[_0x5a1a('0x1')](_0x5a1a('0x2'),{'body':_0x47102b,'options':{'where':{'id':_0xe8a51b}},'log':_0x5a1a('0x3')});};exports['addTags']=function(_0x3d3652,_0x12138d){return client[_0x5a1a('0x1')](_0x5a1a('0x4'),{'body':_0x12138d,'options':{'where':{'id':_0x3d3652}},'log':_0x5a1a('0x5')});}; \ No newline at end of file +var _0xde50=['UpdateSmsInteraction','addTags','Request'];(function(_0x29fb49,_0x56c675){var _0x15a275=function(_0x4d55b3){while(--_0x4d55b3){_0x29fb49['push'](_0x29fb49['shift']());}};_0x15a275(++_0x56c675);}(_0xde50,0x140));var _0x0de5=function(_0x5dc624,_0x3d9bec){_0x5dc624=_0x5dc624-0x0;var _0x38f557=_0xde50[_0x5dc624];return _0x38f557;};'use strict';var client=require('../client');exports['update']=function(_0x2938ef,_0x34b791){return client[_0x0de5('0x0')](_0x0de5('0x1'),{'body':_0x34b791,'options':{'where':{'id':_0x2938ef}},'log':'updateSmsInteraction'});};exports[_0x0de5('0x2')]=function(_0x5c22bc,_0x16fcda){return client['Request']('AddTagsToSmsInteraction',{'body':_0x16fcda,'options':{'where':{'id':_0x5c22bc}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 0f7e063..51c1892 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 _0x3a5a=['CreateSmsMessage','createSmsMessage','create'];(function(_0x1f3b0d,_0x4f638b){var _0x43d603=function(_0x45a327){while(--_0x45a327){_0x1f3b0d['push'](_0x1f3b0d['shift']());}};_0x43d603(++_0x4f638b);}(_0x3a5a,0x1e8));var _0xa3a5=function(_0xa75c23,_0x5131c0){_0xa75c23=_0xa75c23-0x0;var _0x3a07c8=_0x3a5a[_0xa75c23];return _0x3a07c8;};'use strict';var client=require('../client');exports[_0xa3a5('0x0')]=function(_0x2e64ec){return client['Request'](_0xa3a5('0x1'),{'body':_0x2e64ec,'log':_0xa3a5('0x2')});}; \ No newline at end of file +var _0x9c1d=['../client','createSmsMessage'];(function(_0x492c39,_0x4792d3){var _0x50798f=function(_0x5637ff){while(--_0x5637ff){_0x492c39['push'](_0x492c39['shift']());}};_0x50798f(++_0x4792d3);}(_0x9c1d,0xa6));var _0xd9c1=function(_0x5c18ea,_0x3c6df4){_0x5c18ea=_0x5c18ea-0x0;var _0x23af7b=_0x9c1d[_0x5c18ea];return _0x23af7b;};'use strict';var client=require(_0xd9c1('0x0'));exports['create']=function(_0x3de632){return client['Request']('CreateSmsMessage',{'body':_0x3de632,'log':_0xd9c1('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 5e2c418..74cb95e 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x460313,_0x14b8c4){var _0x300b47=function(_0x422377){while(--_0x422377){_0x460313['push'](_0x460313['shift']());}};_0x300b47(++_0x14b8c4);}(_0x70e0,0x17b));var _0x070e=function(_0x97f64,_0x5d927e){_0x97f64=_0x97f64-0x0;var _0x15fd8a=_0x70e0[_0x97f64];return _0x15fd8a;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5b3f94,_0x355406){var _0xa6576f=function(_0x2e4bde){while(--_0x2e4bde){_0x5b3f94['push'](_0x5b3f94['shift']());}};_0xa6576f(++_0x355406);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d294ba6..97a4c63 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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x111ccf,_0x250082){var _0x461f2a=function(_0x29ea0b){while(--_0x29ea0b){_0x111ccf['push'](_0x111ccf['shift']());}};_0x461f2a(++_0x250082);}(_0x70e0,0x17b));var _0x070e=function(_0xc43253,_0x155a9c){_0xc43253=_0xc43253-0x0;var _0x4c25f9=_0x70e0[_0xc43253];return _0x4c25f9;};'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 +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x43caf2,_0x4b1c0f){var _0x24dcb2=function(_0x1f2773){while(--_0x1f2773){_0x43caf2['push'](_0x43caf2['shift']());}};_0x24dcb2(++_0x4b1c0f);}(_0x70e0,0x17b));var _0x070e=function(_0x4ce340,_0x6ed13f){_0x4ce340=_0x4ce340-0x0;var _0x490c85=_0x70e0[_0x4ce340];return _0x490c85;};'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 6e08acb..9822361 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(_0x460877,_0x5ad61e){var _0x3a9934=function(_0x3f8c67){while(--_0x3f8c67){_0x460877['push'](_0x460877['shift']());}};_0x3a9934(++_0x5ad61e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x457689,_0x2e1a6a){var _0x3d72f1=function(_0x1ef834){while(--_0x1ef834){_0x457689['push'](_0x457689['shift']());}};_0x3d72f1(++_0x2e1a6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 6083680..3f2e411 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 _0xee87=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','update'];(function(_0x522050,_0x3d6191){var _0x5a65ec=function(_0x14c0f8){while(--_0x14c0f8){_0x522050['push'](_0x522050['shift']());}};_0x5a65ec(++_0x3d6191);}(_0xee87,0x10d));var _0x7ee8=function(_0x37a323,_0x5179b8){_0x37a323=_0x37a323-0x0;var _0x517a6a=_0xee87[_0x37a323];return _0x517a6a;};'use strict';var client=require('../client');exports[_0x7ee8('0x0')]=function(_0x2657ca,_0xea9501){return client[_0x7ee8('0x1')](_0x7ee8('0x2'),{'body':_0xea9501,'options':{'where':{'id':_0x2657ca}},'log':_0x7ee8('0x3')});};exports[_0x7ee8('0x4')]=function(_0x2f1867,_0x32466c){return client[_0x7ee8('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x32466c,'options':{'where':{'id':_0x2f1867}},'log':_0x7ee8('0x5')});}; \ No newline at end of file +var _0x9f02=['addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5c27b6,_0x4a3c28){var _0x284ce4=function(_0x29fa20){while(--_0x29fa20){_0x5c27b6['push'](_0x5c27b6['shift']());}};_0x284ce4(++_0x4a3c28);}(_0x9f02,0x68));var _0x29f0=function(_0x2583b3,_0x43e2f3){_0x2583b3=_0x2583b3-0x0;var _0x1c3bf5=_0x9f02[_0x2583b3];return _0x1c3bf5;};'use strict';var client=require(_0x29f0('0x0'));exports['update']=function(_0x51f5c2,_0x4bb7b2){return client[_0x29f0('0x1')](_0x29f0('0x2'),{'body':_0x4bb7b2,'options':{'where':{'id':_0x51f5c2}},'log':_0x29f0('0x3')});};exports[_0x29f0('0x4')]=function(_0x1a49c1,_0x47e569){return client[_0x29f0('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x47e569,'options':{'where':{'id':_0x1a49c1}},'log':_0x29f0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index cea4122..00bbb75 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 _0xfd7d=['Request','CreateWhatsappMessage','../client'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xfd7d,0x1b2));var _0xdfd7=function(_0x457bf8,_0x209a0a){_0x457bf8=_0x457bf8-0x0;var _0x919f94=_0xfd7d[_0x457bf8];return _0x919f94;};'use strict';var client=require(_0xdfd7('0x0'));exports['create']=function(_0xf99958){return client[_0xdfd7('0x1')](_0xdfd7('0x2'),{'body':_0xf99958,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xff35=['CreateWhatsappMessage','../client','create','Request'];(function(_0x4bf362,_0x43047d){var _0x4b7596=function(_0x594d0c){while(--_0x594d0c){_0x4bf362['push'](_0x4bf362['shift']());}};_0x4b7596(++_0x43047d);}(_0xff35,0x1d9));var _0x5ff3=function(_0x46c91d,_0x1c57a5){_0x46c91d=_0x46c91d-0x0;var _0x8d029e=_0xff35[_0x46c91d];return _0x8d029e;};'use strict';var client=require(_0x5ff3('0x0'));exports[_0x5ff3('0x1')]=function(_0x55c9d0){return client[_0x5ff3('0x2')](_0x5ff3('0x3'),{'body':_0x55c9d0,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index c5db0ee..eb7c468 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 _0xe5a8=['Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe5a8,0x8b));var _0x8e5a=function(_0x102dfd,_0x477ec8){_0x102dfd=_0x102dfd-0x0;var _0x2fb88d=_0xe5a8[_0x102dfd];return _0x2fb88d;};'use strict';var client=require('../client');exports[_0x8e5a('0x0')]=function(){return function(){return client[_0x8e5a('0x1')](_0x8e5a('0x2'),{'options':{'raw':![],'attributes':['id',_0x8e5a('0x3'),_0x8e5a('0x4'),_0x8e5a('0x5')],'include':[{'model':_0x8e5a('0x6'),'as':_0x8e5a('0x7'),'attributes':['id',_0x8e5a('0x3'),_0x8e5a('0x8'),_0x8e5a('0x9')]}]},'log':_0x8e5a('0x0')});};}; \ No newline at end of file +var _0x08ef=['online','whatsappPause','getWhatsappQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x5b8685,_0x1a1c28){var _0xa3ef57=function(_0xa91aad){while(--_0xa91aad){_0x5b8685['push'](_0x5b8685['shift']());}};_0xa3ef57(++_0x1a1c28);}(_0x08ef,0x1e8));var _0xf08e=function(_0x10e638,_0x140545){_0x10e638=_0x10e638-0x0;var _0x5ae48d=_0x08ef[_0x10e638];return _0x5ae48d;};'use strict';var client=require('../client');exports[_0xf08e('0x0')]=function(){return function(){return client[_0xf08e('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xf08e('0x2'),_0xf08e('0x3'),_0xf08e('0x4')],'include':[{'model':_0xf08e('0x5'),'as':_0xf08e('0x6'),'attributes':['id',_0xf08e('0x2'),_0xf08e('0x7'),_0xf08e('0x8')]}]},'log':_0xf08e('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 24d9a6a..e1014dc 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 _0x9c52=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x88fb3f,_0x3abf8a){var _0x5e8997=function(_0x23f534){while(--_0x23f534){_0x88fb3f['push'](_0x88fb3f['shift']());}};_0x5e8997(++_0x3abf8a);}(_0x9c52,0x1ea));var _0x29c5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c52[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports['create']=function(_0x4f5006){return client[_0x29c5('0x0')]('CreateWhatsappQueueReport',{'body':_0x4f5006,'log':_0x29c5('0x1')});};exports[_0x29c5('0x2')]=function(_0x233622,_0x5ac168){return client[_0x29c5('0x0')](_0x29c5('0x3'),{'body':_0x5ac168,'options':{'where':{'uniqueid':_0x233622},'order':[['id',_0x29c5('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xb5a4=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb5a4,0xce));var _0x4b5a=function(_0x1fe231,_0x3e1162){_0x1fe231=_0x1fe231-0x0;var _0x56e7fc=_0xb5a4[_0x1fe231];return _0x56e7fc;};'use strict';var client=require(_0x4b5a('0x0'));exports['create']=function(_0x67077){return client[_0x4b5a('0x1')](_0x4b5a('0x2'),{'body':_0x67077,'log':'CreateWhatsappQueueReport'});};exports[_0x4b5a('0x3')]=function(_0x41a9b6,_0x6802bc){return client['Request'](_0x4b5a('0x4'),{'body':_0x6802bc,'options':{'where':{'uniqueid':_0x41a9b6},'order':[['id','DESC']],'limit':0x1},'log':_0x4b5a('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 d86be4b..250eb99 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 _0x06eb=['name','toLowerCase','length','[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format'];(function(_0x35e80f,_0x4cf980){var _0x40fd0e=function(_0x2352ba){while(--_0x2352ba){_0x35e80f['push'](_0x35e80f['shift']());}};_0x40fd0e(++_0x4cf980);}(_0x06eb,0x1c8));var _0xb06e=function(_0x10c8af,_0x54877d){_0x10c8af=_0x10c8af-0x0;var _0x182024=_0x06eb[_0x10c8af];return _0x182024;};'use strict';var schema=require(_0xb06e('0x0'));var _=require(_0xb06e('0x1'));var util=require(_0xb06e('0x2'));var seqqueue=require(_0xb06e('0x3'));var logger=require(_0xb06e('0x4'))(_0xb06e('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb06e('0x6'),'required':!![],'message':_0xb06e('0x7')},'timeout':{'type':_0xb06e('0x8'),'message':_0xb06e('0x9')}});function writeLog(_0x339e03,_0x15849a,_0x1ecd4b){return logger[_0xb06e('0xa')](util[_0xb06e('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x339e03,_0x15849a[_0xb06e('0xc')],_0x1ecd4b));}function handleFindAgent(_0xe22e3e){return function(_0xb3ce2a){return _0xb3ce2a[_0xb06e('0xc')][_0xb06e('0xd')]()===_0xe22e3e[_0xb06e('0xd')]();};}exports['consequence']=function(_0x555785,_0x4554e5,_0x5428b5,_0x145f7e){return function(_0x57a895){try{var _0x224037={'name':_0x4554e5[0x0],'timeout':_0x4554e5[0x1]};var _0x4dc2a7=queue[_0xb06e('0x0')](_0x224037,{'typecast':!![]});if(_0x4dc2a7[_0xb06e('0xe')]){logger['error'](_0xb06e('0xf'),_0x555785,_[_0xb06e('0x10')](_0x4dc2a7,_0xb06e('0x11'))[_0xb06e('0x12')](',\x20'));_0x57a895['stop']();}else{var _0x44d2f8=_[_0xb06e('0x13')](_0x5428b5[_0xb06e('0x14')],handleFindAgent(_0x224037[_0xb06e('0xc')]));if(_0x44d2f8){var _0x56f111=(_0x224037[_0xb06e('0x15')]||0xa)*0x3e8;var _0x42acdb,_0x1f70f1;var _0x36aae1=seqqueue[_0xb06e('0x16')](_0x56f111);_0x36aae1['id']=_0x555785;_0x36aae1[_0xb06e('0x17')]=_0x56f111;_0x36aae1[_0xb06e('0x18')]=_0x145f7e[_0xb06e('0x18')];writeLog(_0x555785,_0x44d2f8,util['format'](_0xb06e('0x19'),_0x56f111));_0x5428b5[_0xb06e('0x1a')][_0x555785]['on']('end',function(){logger[_0xb06e('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x555785);clearTimeout(_0x1f70f1);_0x1f70f1=undefined;_0x36aae1['close']();if(_0x5428b5[_0xb06e('0x1a')][_0x555785]){delete _0x5428b5[_0xb06e('0x1a')][_0x555785];}_0x57a895[_0xb06e('0x1b')]();});_0x5428b5[_0xb06e('0x1a')][_0x555785]['on'](_0xb06e('0x1c'),function(){if(_0x5428b5[_0xb06e('0x1a')][_0x555785]){delete _0x5428b5[_0xb06e('0x1a')][_0x555785];}});_0x1f70f1=setTimeout(function(){logger[_0xb06e('0xa')](_0xb06e('0x1d'),_0x555785);clearTimeout(_0x1f70f1);_0x36aae1[_0xb06e('0x1e')]();_0x57a895['next']();},_0x56f111);strategy[_0xb06e('0x1f')](_0x36aae1,_0x44d2f8,_0x5428b5,_0x145f7e);}else{logger[_0xb06e('0x20')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x555785,_0x224037['name']);_0x57a895[_0xb06e('0x1b')]();}}}catch(_0x46a033){console[_0xb06e('0x21')](_0x46a033);logger[_0xb06e('0x20')](_0xb06e('0x22'),_0x555785,_0x46a033[_0xb06e('0x23')]);_0x57a895[_0xb06e('0x1b')]();}};}; \ No newline at end of file +var _0x3e79=['routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger'];(function(_0x5eb34c,_0x5bb176){var _0x458c4f=function(_0x55190f){while(--_0x55190f){_0x5eb34c['push'](_0x5eb34c['shift']());}};_0x458c4f(++_0x5bb176);}(_0x3e79,0x148));var _0x93e7=function(_0x293445,_0x4f8d84){_0x293445=_0x293445-0x0;var _0x35efe3=_0x3e79[_0x293445];return _0x35efe3;};'use strict';var schema=require(_0x93e7('0x0'));var _=require(_0x93e7('0x1'));var util=require(_0x93e7('0x2'));var seqqueue=require(_0x93e7('0x3'));var logger=require(_0x93e7('0x4'))(_0x93e7('0x5'));var strategy=require(_0x93e7('0x6'));var queue=schema({'name':{'type':_0x93e7('0x7'),'required':!![],'message':_0x93e7('0x8')},'timeout':{'type':_0x93e7('0x9'),'message':_0x93e7('0xa')}});function writeLog(_0x57fde1,_0xf39992,_0x4d18b0){return logger[_0x93e7('0xb')](util['format'](_0x93e7('0xc'),_0x57fde1,_0xf39992[_0x93e7('0xd')],_0x4d18b0));}function handleFindAgent(_0x14e734){return function(_0x35a81b){return _0x35a81b[_0x93e7('0xd')]['toLowerCase']()===_0x14e734[_0x93e7('0xe')]();};}exports[_0x93e7('0xf')]=function(_0x499f63,_0x3c009a,_0x3955b4,_0x4646ac){return function(_0x5de589){try{var _0x5cc2fc={'name':_0x3c009a[0x0],'timeout':_0x3c009a[0x1]};var _0x280875=queue[_0x93e7('0x0')](_0x5cc2fc,{'typecast':!![]});if(_0x280875[_0x93e7('0x10')]){logger[_0x93e7('0x11')](_0x93e7('0x12'),_0x499f63,_[_0x93e7('0x13')](_0x280875,'message')[_0x93e7('0x14')](',\x20'));_0x5de589[_0x93e7('0x15')]();}else{var _0x3d0b59=_[_0x93e7('0x16')](_0x3955b4[_0x93e7('0x17')],handleFindAgent(_0x5cc2fc[_0x93e7('0xd')]));if(_0x3d0b59){var _0x51546d=(_0x5cc2fc['timeout']||0xa)*0x3e8;var _0x4c0fe4,_0x36eb69;var _0x201d7f=seqqueue[_0x93e7('0x18')](_0x51546d);_0x201d7f['id']=_0x499f63;_0x201d7f['atimeout']=_0x51546d;_0x201d7f[_0x93e7('0x19')]=_0x4646ac[_0x93e7('0x19')];writeLog(_0x499f63,_0x3d0b59,util['format'](_0x93e7('0x1a'),_0x51546d));_0x3955b4[_0x93e7('0x1b')][_0x499f63]['on'](_0x93e7('0x1c'),function(){logger[_0x93e7('0xb')](_0x93e7('0x1d'),_0x499f63);clearTimeout(_0x36eb69);_0x36eb69=undefined;_0x201d7f[_0x93e7('0x1e')]();if(_0x3955b4[_0x93e7('0x1b')][_0x499f63]){delete _0x3955b4[_0x93e7('0x1b')][_0x499f63];}_0x5de589['stop']();});_0x3955b4[_0x93e7('0x1b')][_0x499f63]['on'](_0x93e7('0x1f'),function(){if(_0x3955b4['rules'][_0x499f63]){delete _0x3955b4[_0x93e7('0x1b')][_0x499f63];}});_0x36eb69=setTimeout(function(){logger[_0x93e7('0xb')]('[%s][AGENT]\x20ROUTING\x20END',_0x499f63);clearTimeout(_0x36eb69);_0x201d7f[_0x93e7('0x1e')]();_0x5de589[_0x93e7('0x20')]();},_0x51546d);strategy['agent'](_0x201d7f,_0x3d0b59,_0x3955b4,_0x4646ac);}else{logger['error'](_0x93e7('0x21'),_0x499f63,_0x5cc2fc[_0x93e7('0xd')]);_0x5de589['stop']();}}}catch(_0x4dd47b){console[_0x93e7('0x22')](_0x4dd47b);logger[_0x93e7('0x11')](_0x93e7('0x23'),_0x499f63,_0x4dd47b[_0x93e7('0x24')]);_0x5de589['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 7dd3149..f181735 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 _0x50f7=['getMustacheRender','Message','create','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','error','next','amazonlex','providerName','providerResponse','stringify','Failed','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','whatsapp','phone','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body'];(function(_0xab009f,_0x9807ea){var _0x14713c=function(_0x7cd827){while(--_0x7cd827){_0xab009f['push'](_0xab009f['shift']());}};_0x14713c(++_0x9807ea);}(_0x50f7,0xa7));var _0x750f=function(_0x5bd343,_0x599341){_0x5bd343=_0x5bd343-0x0;var _0x4f1545=_0x50f7[_0x5bd343];return _0x4f1545;};'use strict';var _=require(_0x750f('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x750f('0x1'));var logger=require('../../../../config/logger')(_0x750f('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x750f('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x750f('0x4')),'faxMessage':require(_0x750f('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x750f('0x6')]=function(_0x502662,_0x298207){return function(_0x4d3d70){try{if(!_[_0x750f('0x7')](this[_0x750f('0x8')][_0x750f('0x9')])){logger[_0x750f('0xa')](_0x750f('0xb'),_0x502662,_0x750f('0xc'));return _0x4d3d70['next']();}var _0x606567={'ContactId':this[_0x750f('0xd')]['id'],'sentAt':moment()[_0x750f('0xe')](_0x750f('0xf')),'direction':'out'};if(this['channel']===_0x750f('0x10')||this['channel']===_0x750f('0x11')){_0x606567[_0x750f('0x12')]=this[_0x750f('0x8')][_0x750f('0x12')];}var _0x207f04=this[_0x750f('0x13')];if(_0x207f04===_0x750f('0x14')){_0x606567[_0x750f('0x15')]=this['account']['id'];}else{_0x606567[_[_0x750f('0x16')](_0x207f04)+_0x750f('0x17')]=this[_0x750f('0x18')]['id'];}_0x606567[_[_0x750f('0x16')](_0x207f04)+_0x750f('0x19')]=this[_0x750f('0x8')]['id'];if(this[_0x750f('0x8')][_0x750f('0x1a')]){var _0x14ead3=_0x298207[0x4];if(!_[_0x750f('0x1b')](_0x14ead3)){_0x606567[_0x750f('0x1c')]=utils[_0x750f('0x1d')](_0x14ead3,this);return rpc[_0x207f04+_0x750f('0x1e')][_0x750f('0x1f')](_0x606567)[_0x750f('0x20')](function(_0x5d1974){logger[_0x750f('0xa')](_0x750f('0xb'),_0x502662,_0x606567[_0x750f('0x1c')]);})[_0x750f('0x21')](function(_0x673640){logger['error']('[%s][AMAZONLEX]\x20%s',_0x502662,JSON['stringify'](_0x673640));})[_0x750f('0x22')](function(){logger[_0x750f('0xa')](_0x750f('0x23'),_0x502662);_0x4d3d70[_0x750f('0x24')]();});}else{logger[_0x750f('0xa')](_0x750f('0x25'),_0x502662);_0x4d3d70[_0x750f('0x24')]();}}else{var _0x1189fe=this;var _0x229bad=new AWS['LexRuntime']({'accessKeyId':_0x298207[0x0],'secretAccessKey':_0x298207[0x1],'region':_0x298207[0x2]});var _0x4a1aa1={'botAlias':_0x750f('0x26'),'botName':_0x298207[0x3],'inputText':this[_0x750f('0x27')][_0x750f('0x1c')],'userId':this[_0x750f('0x13')]+':'+this[_0x750f('0x8')]['id'][_0x750f('0x28')]()};_0x229bad[_0x750f('0x29')](_0x4a1aa1,function(_0x254ff8,_0x5ba779){if(_0x254ff8){logger[_0x750f('0x2a')](_0x750f('0xb'),_0x502662,_0x254ff8[_0x750f('0x27')]);_0x4d3d70[_0x750f('0x2b')]();}else if(_0x5ba779&&_0x5ba779[_0x750f('0x27')]){_0x1189fe[_0x750f('0x1c')][_0x750f('0x2c')]=_0x5ba779;_0x606567[_0x750f('0x1c')]=_0x5ba779[_0x750f('0x27')];_0x606567[_0x750f('0x2d')]='amazonlex';_0x606567[_0x750f('0x2e')]=JSON[_0x750f('0x2f')](_0x5ba779);return rpc[_0x207f04+'Message']['create'](_0x606567)[_0x750f('0x20')](function(_0x26f56e){logger['info']('[%s][AMAZONLEX]\x20%s',_0x502662,_0x606567[_0x750f('0x1c')]);if(_0x5ba779['dialogState']==_0x750f('0x30')){_0x4d3d70[_0x750f('0x2b')]();}else{_0x4d3d70['stop']();}})[_0x750f('0x21')](function(_0x5868dd){logger['error']('[%s][AMAZONLEX]\x20%s',_0x502662,JSON[_0x750f('0x2f')](_0x5868dd));_0x4d3d70[_0x750f('0x2b')]();});}else{_0x4d3d70[_0x750f('0x2b')]();}});}}catch(_0x11a4f0){logger['error'](_0x750f('0xb'),_0x502662,JSON['stringify'](_0x11a4f0));_0x4d3d70['stop']();}};}; \ No newline at end of file +var _0x2189=['../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','out','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','Message','create','then','catch','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x4644cc,_0x28b79b){var _0x5a4ace=function(_0xadf86e){while(--_0xadf86e){_0x4644cc['push'](_0x4644cc['shift']());}};_0x5a4ace(++_0x28b79b);}(_0x2189,0x1c4));var _0x9218=function(_0x168d53,_0x31c57d){_0x168d53=_0x168d53-0x0;var _0xc8a663=_0x2189[_0x168d53];return _0xc8a663;};'use strict';var _=require(_0x9218('0x0'));var moment=require(_0x9218('0x1'));var AWS=require(_0x9218('0x2'));var utils=require(_0x9218('0x3'));var logger=require(_0x9218('0x4'))(_0x9218('0x5'));var rpc={'chatMessage':require(_0x9218('0x6')),'openchannelMessage':require(_0x9218('0x7')),'mailMessage':require(_0x9218('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9218('0x9')),'whatsappMessage':require(_0x9218('0xa'))};exports[_0x9218('0xb')]=function(_0x174401,_0x4947ec){return function(_0x19fc82){try{if(!_[_0x9218('0xc')](this[_0x9218('0xd')][_0x9218('0xe')])){logger[_0x9218('0xf')](_0x9218('0x10'),_0x174401,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x19fc82[_0x9218('0x11')]();}var _0x59683f={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9218('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x9218('0x13')};if(this[_0x9218('0x14')]==='sms'||this['channel']==='whatsapp'){_0x59683f[_0x9218('0x15')]=this[_0x9218('0xd')][_0x9218('0x15')];}var _0x3d0ce8=this[_0x9218('0x14')];if(_0x3d0ce8==='chat'){_0x59683f[_0x9218('0x16')]=this[_0x9218('0x17')]['id'];}else{_0x59683f[_[_0x9218('0x18')](_0x3d0ce8)+_0x9218('0x19')]=this[_0x9218('0x17')]['id'];}_0x59683f[_['upperFirst'](_0x3d0ce8)+_0x9218('0x1a')]=this[_0x9218('0xd')]['id'];if(this['interaction'][_0x9218('0x1b')]){var _0x59092b=_0x4947ec[0x4];if(!_['isEmpty'](_0x59092b)){_0x59683f[_0x9218('0x1c')]=utils['getMustacheRender'](_0x59092b,this);return rpc[_0x3d0ce8+_0x9218('0x1d')][_0x9218('0x1e')](_0x59683f)[_0x9218('0x1f')](function(_0x3aca0e){logger['info'](_0x9218('0x10'),_0x174401,_0x59683f[_0x9218('0x1c')]);})[_0x9218('0x20')](function(_0xc748d3){logger[_0x9218('0x21')](_0x9218('0x10'),_0x174401,JSON[_0x9218('0x22')](_0xc748d3));})['finally'](function(){logger[_0x9218('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x174401);_0x19fc82[_0x9218('0x23')]();});}else{logger[_0x9218('0xf')](_0x9218('0x24'),_0x174401);_0x19fc82['stop']();}}else{var _0x985c2d=this;var _0x2fa8aa=new AWS[(_0x9218('0x25'))]({'accessKeyId':_0x4947ec[0x0],'secretAccessKey':_0x4947ec[0x1],'region':_0x4947ec[0x2]});var _0x57dba1={'botAlias':_0x9218('0x26'),'botName':_0x4947ec[0x3],'inputText':this[_0x9218('0x27')][_0x9218('0x1c')],'userId':this[_0x9218('0x14')]+':'+this[_0x9218('0xd')]['id'][_0x9218('0x28')]()};_0x2fa8aa[_0x9218('0x29')](_0x57dba1,function(_0x1da5c6,_0x1fd699){if(_0x1da5c6){logger[_0x9218('0x21')](_0x9218('0x10'),_0x174401,_0x1da5c6[_0x9218('0x27')]);_0x19fc82['next']();}else if(_0x1fd699&&_0x1fd699[_0x9218('0x27')]){_0x985c2d['body'][_0x9218('0x2a')]=_0x1fd699;_0x59683f[_0x9218('0x1c')]=_0x1fd699[_0x9218('0x27')];_0x59683f[_0x9218('0x2b')]='amazonlex';_0x59683f[_0x9218('0x2c')]=JSON[_0x9218('0x22')](_0x1fd699);return rpc[_0x3d0ce8+_0x9218('0x1d')][_0x9218('0x1e')](_0x59683f)[_0x9218('0x1f')](function(_0x97222d){logger[_0x9218('0xf')](_0x9218('0x10'),_0x174401,_0x59683f[_0x9218('0x1c')]);if(_0x1fd699['dialogState']==_0x9218('0x2d')){_0x19fc82['next']();}else{_0x19fc82[_0x9218('0x23')]();}})[_0x9218('0x20')](function(_0x5b0ae4){logger[_0x9218('0x21')](_0x9218('0x10'),_0x174401,JSON[_0x9218('0x22')](_0x5b0ae4));_0x19fc82[_0x9218('0x11')]();});}else{_0x19fc82['next']();}});}}catch(_0x567bdb){logger[_0x9218('0x21')](_0x9218('0x10'),_0x174401,JSON['stringify'](_0x567bdb));_0x19fc82[_0x9218('0x23')]();}};}; \ 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 028a988..4da8b6f 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 _0x980f=['mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','info','Autoreply\x20already\x20sent','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','from','message','phone','read','subject','Re:\x20','chat','ChatWebsiteId','upperFirst','InteractionId','Message','html','','';_0x25e829[_0xf980('0x2f')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xf980('0x30'),'Precedence':_0xf980('0x31')};return mailRpc[_0xf980('0x32')](this[_0xf980('0x33')]['smtpOptions'],_0x25e829)[_0xf980('0x34')](function(_0x45d3af){logger[_0xf980('0x18')](_0xf980('0x35'),_0x966e51);_0x25e829[_0xf980('0x36')]=_0x45d3af[_0xf980('0x21')][_0xf980('0x36')];return rpc[_0x63140+_0xf980('0x2a')][_0xf980('0x37')](_0x25e829);})[_0xf980('0x34')](function(_0x155e23){logger[_0xf980('0x18')](_0xf980('0x13'),_0x966e51,JSON[_0xf980('0x38')](_0x155e23));})[_0xf980('0x39')](function(_0x4f3fd0){logger[_0xf980('0x3a')](_0xf980('0x3b'),_0x966e51,JSON[_0xf980('0x38')](_0x4f3fd0));})[_0xf980('0x3c')](function(){Promise[_0xf980('0x3d')]()['then'](function(){if(_0x4316b6[0x0]!=='2'||_0x4cb0c8[_0xf980('0x3e')])return;return rpc[_0x63140+_0xf980('0x3f')]['update'](_0x4cb0c8['id'],{'autoreplyExecuted':!![]})[_0xf980('0x34')](function(_0xd6e77a){logger[_0xf980('0x18')](_0xf980('0x40'),_0x966e51,JSON[_0xf980('0x38')](_0xd6e77a));})[_0xf980('0x39')](function(_0x3e3921){logger[_0xf980('0x3a')](_0xf980('0x41'),_0x966e51,JSON[_0xf980('0x38')](_0x3e3921));});})[_0xf980('0x34')](function(){_0x58a4e9[_0xf980('0x15')]();});});}else{return rpc[this['channel']+_0xf980('0x2a')][_0xf980('0x37')](_0x25e829)[_0xf980('0x34')](function(){logger['info'](_0xf980('0x13'),_0x966e51,_0x25e829['body']);})['catch'](function(_0xe6c0ad){logger[_0xf980('0x3a')]('[%s][AUTOREPLY]\x20%s',_0x966e51,JSON[_0xf980('0x38')](_0xe6c0ad));})[_0xf980('0x3c')](function(){Promise[_0xf980('0x3d')]()[_0xf980('0x34')](function(){if(_0x4316b6[0x0]!=='2'||_0x4cb0c8[_0xf980('0x3e')])return;return rpc[_0x63140+'Interaction'][_0xf980('0x42')](_0x4cb0c8['id'],{'autoreplyExecuted':!![]})[_0xf980('0x34')](function(_0x199e44){logger[_0xf980('0x18')](_0xf980('0x40'),_0x966e51,JSON[_0xf980('0x38')](_0x199e44));})['catch'](function(_0x5e7413){logger['error'](_0xf980('0x41'),_0x966e51,JSON[_0xf980('0x38')](_0x5e7413));});})[_0xf980('0x34')](function(){_0x58a4e9[_0xf980('0x15')]();});});}}}catch(_0x51a69b){logger[_0xf980('0x3a')](_0xf980('0x13'),_0x966e51,JSON[_0xf980('0x38')](_0x51a69b));_0x58a4e9[_0xf980('0x43')]();}};}; \ No newline at end of file +var _0x61fa=['../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','inReplyTo','html','','replace','','headers','auto-replied','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','Interaction','stop','moment','./utils'];(function(_0x9a267b,_0x3d7ca5){var _0x245824=function(_0x39444b){while(--_0x39444b){_0x9a267b['push'](_0x9a267b['shift']());}};_0x245824(++_0x3d7ca5);}(_0x61fa,0x196));var _0xa61f=function(_0x314f95,_0x33f646){_0x314f95=_0x314f95-0x0;var _0x397feb=_0x61fa[_0x314f95];return _0x397feb;};'use strict';var _=require('lodash');var moment=require(_0xa61f('0x0'));var utils=require(_0xa61f('0x1'));var logger=require(_0xa61f('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa61f('0x3')),'smsMessage':require(_0xa61f('0x4')),'faxMessage':require(_0xa61f('0x5')),'whatsappMessage':require(_0xa61f('0x6')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xa61f('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xa61f('0x8')),'faxInteraction':require(_0xa61f('0x9')),'whatsappInteraction':require(_0xa61f('0xa'))};var mailRpc=require(_0xa61f('0xb'));exports[_0xa61f('0xc')]=function(_0x339207,_0x115178,_0x80029b,_0x4efb95){return function(_0x46df3f){try{var _0x125ba9=this[_0xa61f('0xd')];if(_0x125ba9===_0xa61f('0xe')&&_0x4efb95[_0xa61f('0xf')][_0xa61f('0x10')]){logger[_0xa61f('0x11')](_0xa61f('0x12'),_0x339207,_0xa61f('0x13'));return _0x46df3f[_0xa61f('0x14')]();}if(_0x115178[0x0]==='1'&&(_['isNil'](this[_0xa61f('0x15')][_0xa61f('0x16')])||!this[_0xa61f('0x15')][_0xa61f('0x16')])){logger[_0xa61f('0x11')](_0xa61f('0x12'),_0x339207,_0xa61f('0x17'));return _0x46df3f[_0xa61f('0x14')]();}if(_0x115178[0x0]==='2'&&this[_0xa61f('0x15')][_0xa61f('0x18')]){logger['info'](_0xa61f('0x19'),_0x339207,_0xa61f('0x1a'));return _0x46df3f[_0xa61f('0x14')]();}var _0x492f61={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa61f('0x1b')](_0xa61f('0x1c')),'direction':'out'};if(this['channel']==='mail'){_0x492f61['body']=utils[_0xa61f('0x1d')](_0x115178[0x2],this);}else{_0x492f61[_0xa61f('0xf')]=utils[_0xa61f('0x1d')](_0x115178[0x1],this);}if(this[_0xa61f('0x1e')]){_0x492f61['to']=this[_0xa61f('0x1e')][_0xa61f('0x1f')]||'';if(this['channel']===_0xa61f('0xe')&&_0x115178[0x1]==='1'){_0x492f61['cc']=this[_0xa61f('0x1e')]['cc']||'';}_0x492f61[_0xa61f('0x1f')]=this['message']['to']||'';_0x492f61[_0xa61f('0x20')]=this[_0xa61f('0x1e')][_0xa61f('0x20')]||'';_0x492f61[_0xa61f('0x21')]=!![];if(this[_0xa61f('0x1e')][_0xa61f('0x22')]){_0x492f61['subject']='';_0x492f61[_0xa61f('0x22')]+=_['startsWith'](this[_0xa61f('0x1e')][_0xa61f('0x22')],_0xa61f('0x23'))?'':_0xa61f('0x24');_0x492f61['subject']+=this['message'][_0xa61f('0x22')];}}if(this[_0xa61f('0xd')]==='chat'){_0x492f61[_0xa61f('0x25')]=this['account']['id'];}else{_0x492f61[_['upperFirst'](this[_0xa61f('0xd')])+_0xa61f('0x26')]=this[_0xa61f('0x27')]['id'];}_0x492f61[_[_0xa61f('0x28')](this[_0xa61f('0xd')])+_0xa61f('0x29')]=this['interaction']['id'];var _0x160092=this[_0xa61f('0x15')];if(rpc[this[_0xa61f('0xd')]+_0xa61f('0x2a')]){if(this[_0xa61f('0xd')]==='mail'){_0x492f61[_0xa61f('0x2b')]=this[_0xa61f('0x1e')]['messageId'];_0x492f61[_0xa61f('0x2c')]=_0xa61f('0x2d')+_[_0xa61f('0x2e')](_0x492f61[_0xa61f('0xf')],']+(>|$)/g,''),'priorityTrue':_0x4f5c9e[0x1],'priorityFalse':_0x4f5c9e[0x2]};var _0x4699e4=gotoif[_0x72c5('0x0')](_0x3794ca,{'typecast':!![]});if(_0x4699e4[_0x72c5('0xc')]){logger[_0x72c5('0xd')]('[%s][GOTOIF]\x20%s',_0xe59d03,_[_0x72c5('0xe')](_0x4699e4,_0x72c5('0xf'))[_0x72c5('0x10')](',\x20'));_0x79a2d4['stop']();}else{try{var _0x418d6a=eval('('+_0x3794ca[_0x72c5('0x11')]+')');var _0x20cef6=_0x418d6a?_0x3794ca[_0x72c5('0x12')]:_0x3794ca['priorityFalse'];logger[_0x72c5('0x13')](_0x72c5('0x14'),_0xe59d03,_0x3794ca[_0x72c5('0x11')],_0x418d6a,_0x20cef6||_0x72c5('0x15'));if(_0x20cef6){var _0x50173b=_[_0x72c5('0x16')](_0x79a2d4[_0x72c5('0x17')](),{'p':_0x20cef6});if(_0x50173b>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0xe59d03,_0x20cef6||_0x72c5('0x15'),_0x50173b);_0x79a2d4[_0x72c5('0x15')](_0x50173b);}else{logger[_0x72c5('0x13')](_0x72c5('0x18'),_0xe59d03,_0x20cef6||_0x72c5('0x15'));_0x79a2d4[_0x72c5('0x19')]();}}else{_0x79a2d4[_0x72c5('0x15')]();}}catch(_0x47e644){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0xe59d03,_0x47e644['message']);_0x79a2d4[_0x72c5('0x19')]();}}}catch(_0x3730d4){logger[_0x72c5('0xd')](_0x72c5('0x1a'),_0xe59d03,JSON[_0x72c5('0x1b')](_0x3730d4));_0x79a2d4[_0x72c5('0x19')]();}};}; \ No newline at end of file +var _0xb241=['validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','message','stop'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb241,0x138));var _0x1b24=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb241[_0x4565bf];return _0x5610ba;};'use strict';var schema=require(_0x1b24('0x0'));var _=require(_0x1b24('0x1'));var htmlToText=require(_0x1b24('0x2'));var utils=require(_0x1b24('0x3'));var logger=require(_0x1b24('0x4'))(_0x1b24('0x5'));var gotoif=schema({'condition':{'type':_0x1b24('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1b24('0x7'),'message':_0x1b24('0x8')},'priorityFalse':{'type':_0x1b24('0x7'),'message':_0x1b24('0x9')}});exports[_0x1b24('0xa')]=function(_0x216b78,_0x3db2e1){return function(_0x4eebf8){try{var _0x4dcba9={'condition':htmlToText[_0x1b24('0xb')](utils[_0x1b24('0xc')](_0x3db2e1[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3db2e1[0x1],'priorityFalse':_0x3db2e1[0x2]};var _0x56d037=gotoif[_0x1b24('0x0')](_0x4dcba9,{'typecast':!![]});if(_0x56d037[_0x1b24('0xd')]){logger[_0x1b24('0xe')](_0x1b24('0xf'),_0x216b78,_[_0x1b24('0x10')](_0x56d037,'message')[_0x1b24('0x11')](',\x20'));_0x4eebf8['stop']();}else{try{var _0x20039a=eval('('+_0x4dcba9[_0x1b24('0x12')]+')');var _0x273fb3=_0x20039a?_0x4dcba9[_0x1b24('0x13')]:_0x4dcba9['priorityFalse'];logger['info'](_0x1b24('0x14'),_0x216b78,_0x4dcba9['condition'],_0x20039a,_0x273fb3||_0x1b24('0x15'));if(_0x273fb3){var _0x44dd7d=_['findIndex'](_0x4eebf8['rules'](),{'p':_0x273fb3});if(_0x44dd7d>=0x0){logger[_0x1b24('0x16')](_0x1b24('0x17'),_0x216b78,_0x273fb3||'next',_0x44dd7d);_0x4eebf8[_0x1b24('0x15')](_0x44dd7d);}else{logger[_0x1b24('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x216b78,_0x273fb3||_0x1b24('0x15'));_0x4eebf8['stop']();}}else{_0x4eebf8[_0x1b24('0x15')]();}}catch(_0x1e1eb3){logger[_0x1b24('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x216b78,_0x1e1eb3[_0x1b24('0x18')]);_0x4eebf8[_0x1b24('0x19')]();}}}catch(_0x3c2732){logger[_0x1b24('0xe')]('[%s][GOTOIF]\x20%s',_0x216b78,JSON['stringify'](_0x3c2732));_0x4eebf8[_0x1b24('0x19')]();}};}; \ 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 6311e30..4277b22 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 _0xd7fe=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','consequence','length','error'];(function(_0x112919,_0x5d94a6){var _0x3b31e2=function(_0x5b2ac1){while(--_0x5b2ac1){_0x112919['push'](_0x112919['shift']());}};_0x3b31e2(++_0x5d94a6);}(_0xd7fe,0x82));var _0xed7f=function(_0x453bb4,_0x1bfec8){_0x453bb4=_0x453bb4-0x0;var _0x4fcf64=_0xd7fe[_0x453bb4];return _0x4fcf64;};'use strict';var schema=require(_0xed7f('0x0'));var _=require('lodash');var logger=require(_0xed7f('0x1'))(_0xed7f('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xed7f('0x3')]=function(_0x425940,_0x28b76a){return function(_0x2fc963){try{var _0x164674={'priority':_0x28b76a[0x0]};var _0x3afc96=gotop['validate'](_0x164674,{'typecast':!![]});if(_0x3afc96[_0xed7f('0x4')]){logger[_0xed7f('0x5')]('[%s][GOTOP]\x20%s',_0x425940,_[_0xed7f('0x6')](_0x3afc96,_0xed7f('0x7'))[_0xed7f('0x8')](',\x20'));_0x2fc963[_0xed7f('0x9')]();}else{logger[_0xed7f('0xa')](_0xed7f('0xb'),_0x425940,_0x164674[_0xed7f('0xc')]);if(_0x164674['priority']){var _0xf98f42=_['findIndex'](_0x2fc963['rules'](),{'p':_0x164674[_0xed7f('0xc')]});if(_0xf98f42>=0x0){logger[_0xed7f('0xa')](_0xed7f('0xd'),_0x425940,_0x164674['priority']||'next',_0xf98f42);_0x2fc963['next'](_0xf98f42);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x425940,_0x164674[_0xed7f('0xc')]||_0xed7f('0xe'));_0x2fc963['stop']();}}else{_0x2fc963[_0xed7f('0xe')]();}}}catch(_0x4d324d){logger[_0xed7f('0x5')](_0xed7f('0xf'),_0x425940,JSON[_0xed7f('0x10')](_0x4d324d));_0x2fc963[_0xed7f('0x9')]();}};}; \ No newline at end of file +var _0x0bca=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20%s','stringify','validate','lodash','number','length','error','map','message','join'];(function(_0x9e1c09,_0x5ebbe7){var _0x37a734=function(_0x1927a8){while(--_0x1927a8){_0x9e1c09['push'](_0x9e1c09['shift']());}};_0x37a734(++_0x5ebbe7);}(_0x0bca,0xf7));var _0xa0bc=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x0bca[_0x474bc0];return _0x4b24cf;};'use strict';var schema=require(_0xa0bc('0x0'));var _=require(_0xa0bc('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xa0bc('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x11a88e,_0x4c6053){return function(_0x16744b){try{var _0x405bdb={'priority':_0x4c6053[0x0]};var _0x468ca1=gotop[_0xa0bc('0x0')](_0x405bdb,{'typecast':!![]});if(_0x468ca1[_0xa0bc('0x3')]){logger[_0xa0bc('0x4')]('[%s][GOTOP]\x20%s',_0x11a88e,_[_0xa0bc('0x5')](_0x468ca1,_0xa0bc('0x6'))[_0xa0bc('0x7')](',\x20'));_0x16744b[_0xa0bc('0x8')]();}else{logger[_0xa0bc('0x9')](_0xa0bc('0xa'),_0x11a88e,_0x405bdb['priority']);if(_0x405bdb[_0xa0bc('0xb')]){var _0x26cf0d=_[_0xa0bc('0xc')](_0x16744b[_0xa0bc('0xd')](),{'p':_0x405bdb[_0xa0bc('0xb')]});if(_0x26cf0d>=0x0){logger[_0xa0bc('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x11a88e,_0x405bdb['priority']||_0xa0bc('0xe'),_0x26cf0d);_0x16744b[_0xa0bc('0xe')](_0x26cf0d);}else{logger[_0xa0bc('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x11a88e,_0x405bdb[_0xa0bc('0xb')]||_0xa0bc('0xe'));_0x16744b['stop']();}}else{_0x16744b['next']();}}}catch(_0x52ac89){logger['error'](_0xa0bc('0xf'),_0x11a88e,JSON[_0xa0bc('0x10')](_0x52ac89));_0x16744b[_0xa0bc('0x8')]();}};}; \ 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 249d165..14f96bd 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 _0x7177=['AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x7177,0x101));var _0x7717=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x7177[_0x5c4e16];return _0x36044a;};'use strict';var _=require(_0x7717('0x0'));var utils=require('./utils');var logger=require(_0x7717('0x1'))('routing');var rpc={'chatMessage':require(_0x7717('0x2')),'openchannelMessage':require(_0x7717('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7717('0x4')),'faxMessage':require(_0x7717('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7717('0x6')]=function(_0xb1b562,_0x40e3ec){return function(_0x20ca81){try{var _0xe3d36b={'body':utils[_0x7717('0x7')](_0x40e3ec[0x0],this),'ContactId':this[_0x7717('0x8')]['id']};if(this[_0x7717('0x9')]===_0x7717('0xa')){_0xe3d36b[_0x7717('0xb')]=this[_0x7717('0xc')]['id'];}else{_0xe3d36b[_['upperFirst'](this[_0x7717('0x9')])+_0x7717('0xd')]=this['account']['id'];}_0xe3d36b[_[_0x7717('0xe')](this['channel'])+_0x7717('0xf')]=this[_0x7717('0x10')]['id'];if(rpc[this[_0x7717('0x9')]+_0x7717('0x11')]){return rpc[this[_0x7717('0x9')]+'Message'][_0x7717('0x12')](_0xe3d36b)[_0x7717('0x13')](function(_0x24da26){logger[_0x7717('0x14')](_0x7717('0x15'),_0xb1b562,_0xe3d36b[_0x7717('0x16')]);_0x20ca81[_0x7717('0x17')]();})['catch'](function(_0xcb6d5c){logger[_0x7717('0x18')](_0x7717('0x15'),_0xb1b562,JSON[_0x7717('0x19')](_0xcb6d5c));_0x20ca81[_0x7717('0x1a')]();});}}catch(_0x782bd0){logger[_0x7717('0x18')]('[%s][MESSAGE]\x20%s',_0xb1b562,JSON['stringify'](_0x782bd0));_0x20ca81[_0x7717('0x1a')]();}};}; \ No newline at end of file +var _0x0f13=['../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','body','next','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils'];(function(_0x113445,_0x527831){var _0x34fd04=function(_0x56637c){while(--_0x56637c){_0x113445['push'](_0x113445['shift']());}};_0x34fd04(++_0x527831);}(_0x0f13,0x16a));var _0x30f1=function(_0x16529b,_0x42be35){_0x16529b=_0x16529b-0x0;var _0x2c6be3=_0x0f13[_0x16529b];return _0x2c6be3;};'use strict';var _=require(_0x30f1('0x0'));var utils=require(_0x30f1('0x1'));var logger=require(_0x30f1('0x2'))('routing');var rpc={'chatMessage':require(_0x30f1('0x3')),'openchannelMessage':require(_0x30f1('0x4')),'mailMessage':require(_0x30f1('0x5')),'smsMessage':require(_0x30f1('0x6')),'faxMessage':require(_0x30f1('0x7')),'whatsappMessage':require(_0x30f1('0x8'))};exports[_0x30f1('0x9')]=function(_0x5be0ab,_0x3d96dc){return function(_0x4a99f0){try{var _0x2355fa={'body':utils[_0x30f1('0xa')](_0x3d96dc[0x0],this),'ContactId':this[_0x30f1('0xb')]['id']};if(this[_0x30f1('0xc')]===_0x30f1('0xd')){_0x2355fa[_0x30f1('0xe')]=this[_0x30f1('0xf')]['id'];}else{_0x2355fa[_['upperFirst'](this[_0x30f1('0xc')])+'AccountId']=this[_0x30f1('0xf')]['id'];}_0x2355fa[_[_0x30f1('0x10')](this[_0x30f1('0xc')])+_0x30f1('0x11')]=this[_0x30f1('0x12')]['id'];if(rpc[this[_0x30f1('0xc')]+_0x30f1('0x13')]){return rpc[this[_0x30f1('0xc')]+_0x30f1('0x13')][_0x30f1('0x14')](_0x2355fa)[_0x30f1('0x15')](function(_0x5e7cee){logger['info']('[%s][MESSAGE]\x20%s',_0x5be0ab,_0x2355fa[_0x30f1('0x16')]);_0x4a99f0[_0x30f1('0x17')]();})['catch'](function(_0x1a9042){logger[_0x30f1('0x18')](_0x30f1('0x19'),_0x5be0ab,JSON[_0x30f1('0x1a')](_0x1a9042));_0x4a99f0[_0x30f1('0x1b')]();});}}catch(_0x1eeb73){logger['error']('[%s][MESSAGE]\x20%s',_0x5be0ab,JSON[_0x30f1('0x1a')](_0x1eeb73));_0x4a99f0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 3debf9e..454a6ed 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 _0xb4b9=['info','next','error','stringify','stop','routing','consequence'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xb4b9,0x1da));var _0x9b4b=function(_0x4786cb,_0x5ba08d){_0x4786cb=_0x4786cb-0x0;var _0x1c5180=_0xb4b9[_0x4786cb];return _0x1c5180;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x9b4b('0x0'));exports[_0x9b4b('0x1')]=function(_0x32ee42,_0x5ea278){return function(_0x1bc9f4){try{logger[_0x9b4b('0x2')]('[%s][NOOP]\x20%s',_0x32ee42,utils['getMustacheRender'](_0x5ea278[0x0],this));_0x1bc9f4[_0x9b4b('0x3')]();}catch(_0x44f26b){logger[_0x9b4b('0x4')]('[%s][NOOP]\x20%s',_0x32ee42,JSON[_0x9b4b('0x5')](_0x44f26b));_0x1bc9f4[_0x9b4b('0x6')]();}};}; \ No newline at end of file +var _0x971e=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x1031ab,_0x11a0e6){var _0x15ba29=function(_0x363709){while(--_0x363709){_0x1031ab['push'](_0x1031ab['shift']());}};_0x15ba29(++_0x11a0e6);}(_0x971e,0xe1));var _0xe971=function(_0x282c65,_0x25e173){_0x282c65=_0x282c65-0x0;var _0x1b389f=_0x971e[_0x282c65];return _0x1b389f;};'use strict';var utils=require('./utils');var logger=require(_0xe971('0x0'))(_0xe971('0x1'));exports[_0xe971('0x2')]=function(_0x408fc1,_0x1a4b6d){return function(_0x245a31){try{logger[_0xe971('0x3')](_0xe971('0x4'),_0x408fc1,utils['getMustacheRender'](_0x1a4b6d[0x0],this));_0x245a31['next']();}catch(_0x2d4edd){logger['error'](_0xe971('0x4'),_0x408fc1,JSON['stringify'](_0x2d4edd));_0x245a31['stop']();}};}; \ 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 044b30b..bda7e02 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 _0xba44=['push','capitalize','InteractionId','format','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','[%s][STOP:QUEUE][NAME:%s]','update','then','catch','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','Queues','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','ioredis','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xba44,0x189));var _0x4ba4=function(_0x32cbf2,_0x10ecc1){_0x32cbf2=_0x32cbf2-0x0;var _0x399962=_0xba44[_0x32cbf2];return _0x399962;};'use strict';var schema=require('validate');var _=require(_0x4ba4('0x0'));var util=require(_0x4ba4('0x1'));var seqqueue=require(_0x4ba4('0x2'));var moment=require(_0x4ba4('0x3'));var Redis=require(_0x4ba4('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4ba4('0x5'));var strategy=require(_0x4ba4('0x6'));config[_0x4ba4('0x7')]=_['defaults'](config[_0x4ba4('0x7')],{'host':_0x4ba4('0x8'),'port':0x18eb});var io=require(_0x4ba4('0x9'))(new Redis(config[_0x4ba4('0x7')]));var attributes=['id',_0x4ba4('0xa'),_0x4ba4('0xb'),_0x4ba4('0xc'),_0x4ba4('0xd'),_0x4ba4('0xe')];function emit(_0x47a2ed,_0x3a7e65,_0x10e5e5){io['to'](_0x47a2ed)[_0x4ba4('0xf')](_0x3a7e65,_0x10e5e5);}function emitChannelQueueInteraction(_0x455abc,_0x4f7b45,_0x3c3618,_0x3cf37b,_0x100aa4,_0x40fd27,_0x264071,_0x4d325d){var _0x20e018=_[_0x4ba4('0x10')](_0x3c3618);_0x20e018['queue_id']=_0x4d325d;_0x20e018[_0x4ba4('0xc')]=_0x4f7b45;_0x20e018[_0x4ba4('0xb')]=_0x3cf37b;_0x20e018['id']=_0x100aa4;if(_0x40fd27){attributes[_0x4ba4('0x11')](_[_0x4ba4('0x12')](_0x455abc)+_0x4ba4('0x13'));_0x264071[util[_0x4ba4('0x14')]('%sQueuesWaitingInteractions',_0x455abc)][_0x100aa4]=_['pick'](_0x20e018,attributes);}else{delete _0x264071[util[_0x4ba4('0x14')]('%sQueuesWaitingInteractions',_0x455abc)][_0x100aa4];}emit(util['format'](_0x4ba4('0x15'),_0x455abc,_0x4f7b45),util[_0x4ba4('0x14')]('%s_queue_waiting_interaction:%s',_0x455abc,_0x40fd27?_0x4ba4('0x16'):_0x4ba4('0x17')),_[_0x4ba4('0x18')](_0x20e018,attributes));}var rpc={'openchannelQueueReport':require(_0x4ba4('0x19')),'mailQueueReport':require(_0x4ba4('0x1a')),'chatQueueReport':require(_0x4ba4('0x1b')),'smsQueueReport':require(_0x4ba4('0x1c')),'faxQueueReport':require(_0x4ba4('0x1d')),'whatsappQueueReport':require(_0x4ba4('0x1e')),'chatInteraction':require(_0x4ba4('0x1f')),'faxInteraction':require(_0x4ba4('0x20')),'mailInteraction':require(_0x4ba4('0x21')),'openchannelInteraction':require(_0x4ba4('0x22')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x4ba4('0x23'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x4ba4('0x24')},'timeout':{'type':_0x4ba4('0x25'),'message':_0x4ba4('0x26')}});function startRouting(_0x558c77,_0x8f9b1c,_0x5979cd,_0x28a89b){if(_0x558c77&&_0x8f9b1c&&_0x5979cd){_0x8f9b1c[_0x4ba4('0x27')]+=0x1;var _0x2e3e69={'uniqueid':_0x558c77,'from':_0x5979cd[_0x4ba4('0x28')]?_0x5979cd[_0x4ba4('0x28')][_0x4ba4('0xd')]:'','joinAt':moment()[_0x4ba4('0x14')](_0x4ba4('0x29')),'ContactId':_0x5979cd[_0x4ba4('0x2a')]?_0x5979cd[_0x4ba4('0x2a')]['id']:null,'ListId':_0x5979cd['list']?_0x5979cd['list']['id']:null};_0x2e3e69[_[_0x4ba4('0x2b')](_0x5979cd[_0x4ba4('0x2c')])+'QueueId']=_0x8f9b1c['id']||null;_0x2e3e69[_['upperFirst'](_0x5979cd[_0x4ba4('0x2c')])+'InteractionId']=_0x5979cd[_0x4ba4('0x2d')]?_0x5979cd[_0x4ba4('0x2d')]['id']:null;_0x2e3e69[_[_0x4ba4('0x2b')](_0x5979cd[_0x4ba4('0x2c')])+_0x4ba4('0x2e')]=_0x5979cd[_0x4ba4('0x2f')]?_0x5979cd['message']['id']:null;_0x2e3e69[_[_0x4ba4('0x2b')](_0x5979cd[_0x4ba4('0x2c')])+(_0x5979cd[_0x4ba4('0x2c')]!==_0x4ba4('0x30')?_0x4ba4('0x31'):_0x4ba4('0x32'))]=_0x5979cd[_0x4ba4('0xb')]?_0x5979cd[_0x4ba4('0xb')]['id']:null;logger[_0x4ba4('0x33')](util[_0x4ba4('0x14')](_0x4ba4('0x34'),_0x558c77,_0x8f9b1c[_0x4ba4('0x35')]));emitChannelQueueInteraction(_0x5979cd[_0x4ba4('0x2c')],_0x8f9b1c[_0x4ba4('0x35')],_0x2e3e69,_0x5979cd[_0x4ba4('0xb')]['name'],_0x5979cd[_0x4ba4('0x2f')]['id'],!![],_0x28a89b,_0x8f9b1c['id']);if(rpc[_0x5979cd[_0x4ba4('0x2c')]+'QueueReport']){return rpc[_0x5979cd[_0x4ba4('0x2c')]+_0x4ba4('0x36')][_0x4ba4('0x37')](_0x2e3e69)['catch'](function(_0x496718){logger['error']('create\x20queue\x20report',_0x496718);});}}}function stopRouting(_0x5550f5,_0x5e35a0,_0x852dd7,_0x3d79de){if(_0x5550f5&&_0x5e35a0){_0x5e35a0[_0x4ba4('0x27')]-=0x1;var _0x511dfa={'leaveAt':moment()[_0x4ba4('0x14')](_0x4ba4('0x29')),'acceptAt':moment()[_0x4ba4('0x14')](_0x4ba4('0x29')),'reason':'accepted'};logger[_0x4ba4('0x33')](util[_0x4ba4('0x14')](_0x4ba4('0x38'),_0x5550f5,_0x5e35a0[_0x4ba4('0x35')]));emitChannelQueueInteraction(_0x852dd7[_0x4ba4('0x2c')],_0x5e35a0['name'],_0x852dd7[_0x4ba4('0x28')],_0x852dd7[_0x4ba4('0xb')][_0x4ba4('0x35')],_0x852dd7[_0x4ba4('0x2f')]['id'],![],_0x3d79de,_0x5e35a0['id']);return rpc[_0x852dd7[_0x4ba4('0x2c')]+'Interaction'][_0x4ba4('0x39')](_0x852dd7[_0x4ba4('0x2d')]['id'],{'queueId':_0x5e35a0['id']})[_0x4ba4('0x3a')](function(){if(rpc[_0x852dd7[_0x4ba4('0x2c')]+_0x4ba4('0x36')]){return rpc[_0x852dd7[_0x4ba4('0x2c')]+_0x4ba4('0x36')][_0x4ba4('0x39')](_0x5550f5,_0x511dfa)[_0x4ba4('0x3b')](function(_0x24e1fc){logger[_0x4ba4('0x3c')](_0x4ba4('0x3d'),_0x24e1fc);});}});}}function endRouting(_0x5011fc,_0xafc5f2,_0x56923f,_0x216f35){if(_0x5011fc&&_0xafc5f2){_0xafc5f2[_0x4ba4('0x27')]-=0x1;var _0xe6009a={'leaveAt':moment()[_0x4ba4('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x4ba4('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4ba4('0x3e')};logger[_0x4ba4('0x33')](util[_0x4ba4('0x14')](_0x4ba4('0x3f'),_0x5011fc,_0xafc5f2[_0x4ba4('0x35')]));emitChannelQueueInteraction(_0x56923f['channel'],_0xafc5f2['name'],_0x56923f[_0x4ba4('0x28')],_0x56923f[_0x4ba4('0xb')]['name'],_0x56923f[_0x4ba4('0x2f')]['id'],![],_0x216f35);if(rpc[_0x56923f[_0x4ba4('0x2c')]+_0x4ba4('0x36')]){return rpc[_0x56923f[_0x4ba4('0x2c')]+_0x4ba4('0x36')][_0x4ba4('0x39')](_0x5011fc,_0xe6009a)[_0x4ba4('0x3b')](function(_0x3a3aaa){logger[_0x4ba4('0x3c')]('update\x20queue\x20report',_0x3a3aaa);});}}}function handleFindQueue(_0x180b6a){return function(_0x1c3b90){return _0x1c3b90[_0x4ba4('0x35')][_0x4ba4('0x40')]()===_0x180b6a[_0x4ba4('0x40')]();};}exports['consequence']=function(_0x3251cf,_0x2ea0e2,_0x346d00,_0x576d96){return function(_0x567f29){try{var _0x493f64={'name':_0x2ea0e2[0x0],'timeout':_0x2ea0e2[0x1]};var _0x160c72=queue['validate'](_0x493f64,{'typecast':!![]});if(_0x160c72[_0x4ba4('0x41')]){logger['error'](_0x4ba4('0x42'),_0x3251cf,_['map'](_0x160c72,_0x4ba4('0x2f'))[_0x4ba4('0x43')](',\x20'));_0x567f29[_0x4ba4('0x44')]();}else{var _0x43e6e5=_['find'](_0x346d00[_0x576d96['channel']+_0x4ba4('0x45')],handleFindQueue(_0x493f64[_0x4ba4('0x35')]));if(_0x43e6e5){startRouting(_0x3251cf,_0x43e6e5,_0x576d96,_0x346d00);var _0x1a2bd3=(_0x43e6e5[_0x4ba4('0x3e')]||0xa)*0x3e8;var _0x1002f4=(_0x493f64['timeout']||0x14)*0x3e8;var _0x241086;if(_0x1a2bd3>_0x1002f4){_0x1002f4=_0x1a2bd3;}var _0x34d6e1=seqqueue['createQueue'](_0x1a2bd3);_0x34d6e1['id']=_0x3251cf;_0x34d6e1[_0x4ba4('0x46')]=_0x1a2bd3;_0x34d6e1[_0x4ba4('0x47')]=_0x1002f4;_0x34d6e1[_0x4ba4('0x2c')]=_0x576d96['channel'];_0x346d00[_0x4ba4('0x48')][_0x3251cf]['on'](_0x4ba4('0x49'),function(){logger[_0x4ba4('0x33')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x3251cf);stopRouting(_0x3251cf,_0x43e6e5,_0x576d96,_0x346d00);clearTimeout(_0x241086);_0x241086=undefined;_0x34d6e1[_0x4ba4('0x4a')](!![]);if(_0x346d00[_0x4ba4('0x48')][_0x3251cf]){delete _0x346d00[_0x4ba4('0x48')][_0x3251cf];}_0x567f29['stop']();});_0x346d00['rules'][_0x3251cf]['on'](_0x4ba4('0x4b'),function(){if(_0x346d00[_0x4ba4('0x48')][_0x3251cf]){delete _0x346d00['rules'][_0x3251cf];}});_0x241086=setTimeout(function(){logger[_0x4ba4('0x33')](_0x4ba4('0x4c'),_0x3251cf);endRouting(_0x3251cf,_0x43e6e5,_0x576d96,_0x346d00);clearTimeout(_0x241086);_0x34d6e1[_0x4ba4('0x4a')](!![]);_0x567f29[_0x4ba4('0x4d')]();},_0x1002f4);switch(_0x43e6e5[_0x4ba4('0x4e')]){case'rrmemory':strategy['rrmemory'](_0x34d6e1,_0x43e6e5,_0x346d00,_0x576d96);break;default:strategy[_0x4ba4('0x4f')](_0x34d6e1,_0x43e6e5,_0x346d00,_0x576d96);}}else{logger[_0x4ba4('0x3c')](_0x4ba4('0x50'),_0x3251cf,_0x493f64['name']);_0x567f29[_0x4ba4('0x44')]();}}}catch(_0x57fbc2){logger['error'](_0x4ba4('0x42'),_0x3251cf,_0x57fbc2[_0x4ba4('0x51')]);_0x567f29[_0x4ba4('0x44')]();}};}; \ No newline at end of file +var _0xcf2f=['from','joinAt','clone','InteractionId','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','info','name','QueueReport','create','catch','error','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','timeout','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xcf2f,0x1c6));var _0xfcf2=function(_0x280fe2,_0xb4bbfa){_0x280fe2=_0x280fe2-0x0;var _0x28aed7=_0xcf2f[_0x280fe2];return _0x28aed7;};'use strict';var schema=require('validate');var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var seqqueue=require(_0xfcf2('0x2'));var moment=require(_0xfcf2('0x3'));var Redis=require('ioredis');var config=require(_0xfcf2('0x4'));var logger=require(_0xfcf2('0x5'))('routing');var strategy=require(_0xfcf2('0x6'));config[_0xfcf2('0x7')]=_[_0xfcf2('0x8')](config[_0xfcf2('0x7')],{'host':_0xfcf2('0x9'),'port':0x18eb});var io=require(_0xfcf2('0xa'))(new Redis(config['redis']));var attributes=['id',_0xfcf2('0xb'),_0xfcf2('0xc'),_0xfcf2('0xd'),_0xfcf2('0xe'),_0xfcf2('0xf')];function emit(_0x12deb9,_0x435c77,_0x12ed5a){io['to'](_0x12deb9)['emit'](_0x435c77,_0x12ed5a);}function emitChannelQueueInteraction(_0x56cdd4,_0x2ab73d,_0x8bdb88,_0x65614,_0x40679b,_0x5c7de0,_0x235a90,_0x4dbb50){var _0x457862=_[_0xfcf2('0x10')](_0x8bdb88);_0x457862[_0xfcf2('0xb')]=_0x4dbb50;_0x457862[_0xfcf2('0xd')]=_0x2ab73d;_0x457862[_0xfcf2('0xc')]=_0x65614;_0x457862['id']=_0x40679b;if(_0x5c7de0){attributes['push'](_['capitalize'](_0x56cdd4)+_0xfcf2('0x11'));_0x235a90[util[_0xfcf2('0x12')](_0xfcf2('0x13'),_0x56cdd4)][_0x40679b]=_['pick'](_0x457862,attributes);}else{delete _0x235a90[util[_0xfcf2('0x12')](_0xfcf2('0x13'),_0x56cdd4)][_0x40679b];}emit(util[_0xfcf2('0x12')]('%s:queue:%s',_0x56cdd4,_0x2ab73d),util['format'](_0xfcf2('0x14'),_0x56cdd4,_0x5c7de0?_0xfcf2('0x15'):_0xfcf2('0x16')),_['pick'](_0x457862,attributes));}var rpc={'openchannelQueueReport':require(_0xfcf2('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xfcf2('0x18')),'faxQueueReport':require(_0xfcf2('0x19')),'whatsappQueueReport':require(_0xfcf2('0x1a')),'chatInteraction':require(_0xfcf2('0x1b')),'faxInteraction':require(_0xfcf2('0x1c')),'mailInteraction':require(_0xfcf2('0x1d')),'openchannelInteraction':require(_0xfcf2('0x1e')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0xfcf2('0x1f'))};var queue=schema({'name':{'type':_0xfcf2('0x20'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xfcf2('0x21')}});function startRouting(_0x2a750b,_0x289565,_0x14a9fd,_0x9850a){if(_0x2a750b&&_0x289565&&_0x14a9fd){_0x289565['waiting']+=0x1;var _0x3c8b92={'uniqueid':_0x2a750b,'from':_0x14a9fd[_0xfcf2('0x22')]?_0x14a9fd[_0xfcf2('0x22')][_0xfcf2('0xe')]:'','joinAt':moment()[_0xfcf2('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14a9fd['contact']?_0x14a9fd[_0xfcf2('0x23')]['id']:null,'ListId':_0x14a9fd['list']?_0x14a9fd[_0xfcf2('0x24')]['id']:null};_0x3c8b92[_[_0xfcf2('0x25')](_0x14a9fd[_0xfcf2('0x26')])+_0xfcf2('0x27')]=_0x289565['id']||null;_0x3c8b92[_[_0xfcf2('0x25')](_0x14a9fd['channel'])+'InteractionId']=_0x14a9fd[_0xfcf2('0x28')]?_0x14a9fd[_0xfcf2('0x28')]['id']:null;_0x3c8b92[_[_0xfcf2('0x25')](_0x14a9fd[_0xfcf2('0x26')])+_0xfcf2('0x29')]=_0x14a9fd[_0xfcf2('0x2a')]?_0x14a9fd[_0xfcf2('0x2a')]['id']:null;_0x3c8b92[_['upperFirst'](_0x14a9fd[_0xfcf2('0x26')])+(_0x14a9fd[_0xfcf2('0x26')]!==_0xfcf2('0x2b')?'AccountId':'WebsiteId')]=_0x14a9fd[_0xfcf2('0xc')]?_0x14a9fd['account']['id']:null;logger[_0xfcf2('0x2c')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x2a750b,_0x289565[_0xfcf2('0x2d')]));emitChannelQueueInteraction(_0x14a9fd[_0xfcf2('0x26')],_0x289565['name'],_0x3c8b92,_0x14a9fd[_0xfcf2('0xc')][_0xfcf2('0x2d')],_0x14a9fd[_0xfcf2('0x2a')]['id'],!![],_0x9850a,_0x289565['id']);if(rpc[_0x14a9fd[_0xfcf2('0x26')]+_0xfcf2('0x2e')]){return rpc[_0x14a9fd[_0xfcf2('0x26')]+_0xfcf2('0x2e')][_0xfcf2('0x2f')](_0x3c8b92)[_0xfcf2('0x30')](function(_0x448e0a){logger[_0xfcf2('0x31')]('create\x20queue\x20report',_0x448e0a);});}}}function stopRouting(_0x1b514a,_0x5108c9,_0x5e24dd,_0x2adda2){if(_0x1b514a&&_0x5108c9){_0x5108c9[_0xfcf2('0x32')]-=0x1;var _0x4af080={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xfcf2('0x33')),'reason':_0xfcf2('0x34')};logger[_0xfcf2('0x2c')](util['format'](_0xfcf2('0x35'),_0x1b514a,_0x5108c9[_0xfcf2('0x2d')]));emitChannelQueueInteraction(_0x5e24dd['channel'],_0x5108c9[_0xfcf2('0x2d')],_0x5e24dd[_0xfcf2('0x22')],_0x5e24dd[_0xfcf2('0xc')][_0xfcf2('0x2d')],_0x5e24dd[_0xfcf2('0x2a')]['id'],![],_0x2adda2,_0x5108c9['id']);return rpc[_0x5e24dd[_0xfcf2('0x26')]+_0xfcf2('0x36')][_0xfcf2('0x37')](_0x5e24dd[_0xfcf2('0x28')]['id'],{'queueId':_0x5108c9['id']})[_0xfcf2('0x38')](function(){if(rpc[_0x5e24dd[_0xfcf2('0x26')]+_0xfcf2('0x2e')]){return rpc[_0x5e24dd[_0xfcf2('0x26')]+_0xfcf2('0x2e')][_0xfcf2('0x37')](_0x1b514a,_0x4af080)[_0xfcf2('0x30')](function(_0xaf04ca){logger[_0xfcf2('0x31')](_0xfcf2('0x39'),_0xaf04ca);});}});}}function endRouting(_0x285a66,_0x1f7c42,_0x47dbf4,_0x503260){if(_0x285a66&&_0x1f7c42){_0x1f7c42[_0xfcf2('0x32')]-=0x1;var _0x52cbe2={'leaveAt':moment()[_0xfcf2('0x12')](_0xfcf2('0x33')),'exitAt':moment()[_0xfcf2('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xfcf2('0x3a')};logger['info'](util[_0xfcf2('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x285a66,_0x1f7c42[_0xfcf2('0x2d')]));emitChannelQueueInteraction(_0x47dbf4[_0xfcf2('0x26')],_0x1f7c42[_0xfcf2('0x2d')],_0x47dbf4[_0xfcf2('0x22')],_0x47dbf4[_0xfcf2('0xc')]['name'],_0x47dbf4[_0xfcf2('0x2a')]['id'],![],_0x503260);if(rpc[_0x47dbf4[_0xfcf2('0x26')]+_0xfcf2('0x2e')]){return rpc[_0x47dbf4['channel']+_0xfcf2('0x2e')][_0xfcf2('0x37')](_0x285a66,_0x52cbe2)[_0xfcf2('0x30')](function(_0x4b550a){logger['error'](_0xfcf2('0x39'),_0x4b550a);});}}}function handleFindQueue(_0x4e873a){return function(_0xdb4ea1){return _0xdb4ea1[_0xfcf2('0x2d')][_0xfcf2('0x3b')]()===_0x4e873a[_0xfcf2('0x3b')]();};}exports['consequence']=function(_0x7f8371,_0x548323,_0x17a5e1,_0x2e0880){return function(_0x159eaf){try{var _0x39e257={'name':_0x548323[0x0],'timeout':_0x548323[0x1]};var _0x180ddf=queue['validate'](_0x39e257,{'typecast':!![]});if(_0x180ddf['length']){logger['error'](_0xfcf2('0x3c'),_0x7f8371,_[_0xfcf2('0x3d')](_0x180ddf,'message')[_0xfcf2('0x3e')](',\x20'));_0x159eaf[_0xfcf2('0x3f')]();}else{var _0x199b40=_[_0xfcf2('0x40')](_0x17a5e1[_0x2e0880[_0xfcf2('0x26')]+_0xfcf2('0x41')],handleFindQueue(_0x39e257['name']));if(_0x199b40){startRouting(_0x7f8371,_0x199b40,_0x2e0880,_0x17a5e1);var _0x25be04=(_0x199b40[_0xfcf2('0x3a')]||0xa)*0x3e8;var _0x1aca50=(_0x39e257[_0xfcf2('0x3a')]||0x14)*0x3e8;var _0x33dfc3;if(_0x25be04>_0x1aca50){_0x1aca50=_0x25be04;}var _0x136f4b=seqqueue[_0xfcf2('0x42')](_0x25be04);_0x136f4b['id']=_0x7f8371;_0x136f4b[_0xfcf2('0x43')]=_0x25be04;_0x136f4b[_0xfcf2('0x44')]=_0x1aca50;_0x136f4b[_0xfcf2('0x26')]=_0x2e0880['channel'];_0x17a5e1[_0xfcf2('0x45')][_0x7f8371]['on'](_0xfcf2('0x46'),function(){logger['info'](_0xfcf2('0x47'),_0x7f8371);stopRouting(_0x7f8371,_0x199b40,_0x2e0880,_0x17a5e1);clearTimeout(_0x33dfc3);_0x33dfc3=undefined;_0x136f4b['close'](!![]);if(_0x17a5e1['rules'][_0x7f8371]){delete _0x17a5e1['rules'][_0x7f8371];}_0x159eaf[_0xfcf2('0x3f')]();});_0x17a5e1[_0xfcf2('0x45')][_0x7f8371]['on'](_0xfcf2('0x48'),function(){if(_0x17a5e1[_0xfcf2('0x45')][_0x7f8371]){delete _0x17a5e1['rules'][_0x7f8371];}});_0x33dfc3=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x7f8371);endRouting(_0x7f8371,_0x199b40,_0x2e0880,_0x17a5e1);clearTimeout(_0x33dfc3);_0x136f4b['close'](!![]);_0x159eaf['next']();},_0x1aca50);switch(_0x199b40[_0xfcf2('0x49')]){case _0xfcf2('0x4a'):strategy['rrmemory'](_0x136f4b,_0x199b40,_0x17a5e1,_0x2e0880);break;default:strategy[_0xfcf2('0x4b')](_0x136f4b,_0x199b40,_0x17a5e1,_0x2e0880);}}else{logger[_0xfcf2('0x31')](_0xfcf2('0x4c'),_0x7f8371,_0x39e257['name']);_0x159eaf[_0xfcf2('0x3f')]();}}}catch(_0x899592){logger[_0xfcf2('0x31')](_0xfcf2('0x3c'),_0x7f8371,_0x899592[_0xfcf2('0x4d')]);_0x159eaf['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 99ff1e9..7d80160 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 _0x04de=['uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','forcedOwnership','isAgentAvailable','realtime','channel','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','busyQueue','removeWaitingNotification','exports','lodash'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x04de,0x107));var _0xe04d=function(_0x234a86,_0x1d4757){_0x234a86=_0x234a86-0x0;var _0x4175de=_0x04de[_0x234a86];return _0x4175de;};'use strict';var _=require(_0xe04d('0x0'));var uuid=require(_0xe04d('0x1'));var util=require(_0xe04d('0x2'));var logger=require(_0xe04d('0x3'))(_0xe04d('0x4'));var Agent=function(_0x28f63f,_0x1113af,_0x43c4b1,_0x2593a4){this[_0xe04d('0x5')]=uuid['v4']();this[_0xe04d('0x6')]=_0x28f63f;this['agent']=_0x1113af;this['realtime']=_0x43c4b1;this['routing']=_0x2593a4;this['squeue'][_0xe04d('0x7')](this[_0xe04d('0x8')][_0xe04d('0x9')](this),this[_0xe04d('0xa')][_0xe04d('0x9')](this));this[_0xe04d('0x6')]['on'](_0xe04d('0xb'),this[_0xe04d('0xa')]['bind'](this));this[_0xe04d('0x6')]['on'](_0xe04d('0xc'),this[_0xe04d('0xd')][_0xe04d('0x9')](this));};Agent[_0xe04d('0xe')][_0xe04d('0x7')]=function(){this[_0xe04d('0x6')][_0xe04d('0x7')](this[_0xe04d('0x8')]['bind'](this),this[_0xe04d('0xa')][_0xe04d('0x9')](this));};Agent[_0xe04d('0xe')][_0xe04d('0xd')]=function(){this[_0xe04d('0xa')](!![]);};Agent[_0xe04d('0xe')][_0xe04d('0x8')]=function(){logger[_0xe04d('0xf')](_0xe04d('0x10'),this[_0xe04d('0x6')]['id'],this[_0xe04d('0x11')]['id']);if(_[_0xe04d('0x12')](this['realtime'][_0xe04d('0x13')][this['agent']['id']])){logger[_0xe04d('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xe04d('0x6')]['id'],this[_0xe04d('0x11')]['id']);setTimeout(this[_0xe04d('0x7')][_0xe04d('0x9')](this),0x3e8);}else{if(this[_0xe04d('0x4')][_0xe04d('0x14')]||util[_0xe04d('0x15')](this[_0xe04d('0x6')]['id'],this[_0xe04d('0x16')]['agents'][this[_0xe04d('0x11')]['id']],this[_0xe04d('0x6')][_0xe04d('0x17')],![])){this[_0xe04d('0x16')][_0xe04d('0x13')][this[_0xe04d('0x11')]['id']]['busy']=!![];this[_0xe04d('0x16')][_0xe04d('0x13')][this['agent']['id']]['busyQueue']=undefined;util['saveWaitingNotification'](this[_0xe04d('0x16')],this['routing'],this['agent'],this[_0xe04d('0x6')][_0xe04d('0x17')]);util['showNotification'](this[_0xe04d('0x5')],this['squeue']['id'],this[_0xe04d('0x16')]['agents'][this[_0xe04d('0x11')]['id']],null,this[_0xe04d('0x4')]);util[_0xe04d('0x18')](this[_0xe04d('0x6')]['id'],this[_0xe04d('0x16')]['agents'][this[_0xe04d('0x11')]['id']],_0xe04d('0x19')+(this[_0xe04d('0x4')][_0xe04d('0x14')]?':FORCED':''));}else{logger[_0xe04d('0xf')](_0xe04d('0x1a'),this[_0xe04d('0x6')]['id'],this['agent']['id']);setTimeout(this[_0xe04d('0x7')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x25299b){if(_[_0xe04d('0x12')](this['realtime']['agents'][this[_0xe04d('0x11')]['id']])){return logger[_0xe04d('0xf')](_0xe04d('0x1b'),this['squeue']['id'],this[_0xe04d('0x11')]['id']);}else{logger[_0xe04d('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe04d('0x6')]['id'],this['agent']['id']);util[_0xe04d('0x1c')](this[_0xe04d('0x5')],this['squeue']['id'],this[_0xe04d('0x16')]['agents'][this[_0xe04d('0x11')]['id']],null,this[_0xe04d('0x4')]);this[_0xe04d('0x16')][_0xe04d('0x13')][this[_0xe04d('0x11')]['id']][_0xe04d('0x1d')]=![];this[_0xe04d('0x16')]['agents'][this[_0xe04d('0x11')]['id']][_0xe04d('0x1e')]=undefined;util[_0xe04d('0x1f')](this[_0xe04d('0x16')],this[_0xe04d('0x4')],this[_0xe04d('0x11')],this[_0xe04d('0x6')][_0xe04d('0x17')]);util[_0xe04d('0x18')](this['squeue']['id'],this[_0xe04d('0x16')]['agents'][this[_0xe04d('0x11')]['id']],_0x25299b?'STOP':'TIMEOUT');}if(!_0x25299b){setTimeout(this[_0xe04d('0x7')][_0xe04d('0x9')](this),0x3e8);}};function agent(_0x261116,_0x2ad374,_0x56e74d,_0xa202ee){return new Agent(_0x261116,_0x2ad374,_0x56e74d,_0xa202ee);}module[_0xe04d('0x20')]=agent; \ No newline at end of file +var _0xf3cd=['notificationId','agent','realtime','squeue','push','handleRun','handleTimeout','timeout','drained','handleDrained','bind','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xf3cd[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0xdf3c('0x0'));var uuid=require(_0xdf3c('0x1'));var util=require(_0xdf3c('0x2'));var logger=require(_0xdf3c('0x3'))(_0xdf3c('0x4'));var Agent=function(_0x433a7f,_0x54db05,_0x401518,_0x71b446){this[_0xdf3c('0x5')]=uuid['v4']();this['squeue']=_0x433a7f;this[_0xdf3c('0x6')]=_0x54db05;this[_0xdf3c('0x7')]=_0x401518;this[_0xdf3c('0x4')]=_0x71b446;this[_0xdf3c('0x8')][_0xdf3c('0x9')](this[_0xdf3c('0xa')]['bind'](this),this[_0xdf3c('0xb')]['bind'](this));this['squeue']['on'](_0xdf3c('0xc'),this[_0xdf3c('0xb')]['bind'](this));this[_0xdf3c('0x8')]['on'](_0xdf3c('0xd'),this[_0xdf3c('0xe')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')][_0xdf3c('0x9')]=function(){this[_0xdf3c('0x8')][_0xdf3c('0x9')](this['handleRun'][_0xdf3c('0xf')](this),this[_0xdf3c('0xb')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')]['handleDrained']=function(){this[_0xdf3c('0xb')](!![]);};Agent[_0xdf3c('0x10')][_0xdf3c('0xa')]=function(){logger['debug'](_0xdf3c('0x11'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);if(_[_0xdf3c('0x12')](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']])){logger[_0xdf3c('0x14')](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this[_0xdf3c('0x9')][_0xdf3c('0xf')](this),0x3e8);}else{if(this[_0xdf3c('0x4')][_0xdf3c('0x16')]||util[_0xdf3c('0x17')](this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],this[_0xdf3c('0x8')][_0xdf3c('0x18')],![])){this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']]['busy']=!![];this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']][_0xdf3c('0x19')]=undefined;util[_0xdf3c('0x1a')](this[_0xdf3c('0x7')],this[_0xdf3c('0x4')],this[_0xdf3c('0x6')],this['squeue'][_0xdf3c('0x18')]);util[_0xdf3c('0x1b')](this[_0xdf3c('0x5')],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);util[_0xdf3c('0x1c')](this[_0xdf3c('0x8')]['id'],this['realtime'][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],'RINGING'+(this[_0xdf3c('0x4')]['forcedOwnership']?':FORCED':''));}else{logger['debug'](_0xdf3c('0x1d'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this['push'][_0xdf3c('0xf')](this),0x3e8);}}};Agent[_0xdf3c('0x10')][_0xdf3c('0xb')]=function(_0x1ccdd4){if(_['isNil'](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']])){return logger['debug'](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);}else{logger['debug'](_0xdf3c('0x1e'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);util[_0xdf3c('0x1f')](this['notificationId'],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']][_0xdf3c('0x20')]=![];this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']]['busyQueue']=undefined;util[_0xdf3c('0x21')](this[_0xdf3c('0x7')],this['routing'],this['agent'],this[_0xdf3c('0x8')]['channel']);util[_0xdf3c('0x1c')](this['squeue']['id'],this['realtime']['agents'][this[_0xdf3c('0x6')]['id']],_0x1ccdd4?_0xdf3c('0x22'):_0xdf3c('0x23'));}if(!_0x1ccdd4){setTimeout(this[_0xdf3c('0x9')]['bind'](this),0x3e8);}};function agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f){return new Agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f);}module[_0xdf3c('0x24')]=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 924d2d1..c369c88 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 _0x7ca5=['length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','saveWaitingNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','STOP','busyQueue','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','squeue','queue','realtime','routing','bind','timeout','handleDrained','prototype','push','handleRun','handleTimeout','isNil','Agents'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0x7ca5,0x19c));var _0x57ca=function(_0x39c197,_0x55f78b){_0x39c197=_0x39c197-0x0;var _0x5305d3=_0x7ca5[_0x39c197];return _0x5305d3;};'use strict';var _=require(_0x57ca('0x0'));var uuid=require(_0x57ca('0x1'));var util=require(_0x57ca('0x2'));var logger=require(_0x57ca('0x3'))('routing');var Beepall=function(_0x336666,_0xd04049,_0x28bebf,_0x1b40ae){this['notificationId']=uuid['v4']();this[_0x57ca('0x4')]=_0x336666;this[_0x57ca('0x5')]=_0xd04049;this[_0x57ca('0x6')]=_0x28bebf;this[_0x57ca('0x7')]=_0x1b40ae;this['squeue']['push'](this['handleRun'][_0x57ca('0x8')](this),this['handleTimeout'][_0x57ca('0x8')](this));this['squeue']['on'](_0x57ca('0x9'),this['handleTimeout']['bind'](this));this[_0x57ca('0x4')]['on']('drained',this[_0x57ca('0xa')][_0x57ca('0x8')](this));};Beepall[_0x57ca('0xb')][_0x57ca('0xc')]=function(){this['squeue'][_0x57ca('0xc')](this[_0x57ca('0xd')]['bind'](this),this[_0x57ca('0xe')][_0x57ca('0x8')](this));};Beepall[_0x57ca('0xb')][_0x57ca('0xa')]=function(){this[_0x57ca('0xe')](!![]);};Beepall[_0x57ca('0xb')][_0x57ca('0xd')]=function(){var _0x2e03c2=!![];if(!_[_0x57ca('0xf')](this[_0x57ca('0x5')])&&!_['isNil'](this[_0x57ca('0x5')]['Agents'])&&this[_0x57ca('0x5')][_0x57ca('0x10')][_0x57ca('0x11')]>0x0){for(var _0xd8e928=0x0,_0x241c95;_0xd8e9280x0){for(var _0x2e6d81=0x0,_0x35dbfe;_0x2e6d810x0&&_0x57472f[_0x1725a0+_0x8202('0x23')]>=_0x57472f[_0x1725a0+_0x8202('0x21')]){writeLog(_0x322c6f,_0x57472f,_0x1725a0[_0x8202('0x24')]()+_0x8202('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x3fac22,_0x3ac9a2,_0x1c5794,_0x18f928,_0x2b5c18){return sendNotification(!![],_0x3fac22,_0x3ac9a2,_0x1c5794,_0x18f928,_0x2b5c18);};exports['hideNotification']=function(_0x26c256,_0x53c2b6,_0x249a45,_0x53fb03,_0x5efba7){return sendNotification(![],_0x26c256,_0x53c2b6,_0x249a45,_0x53fb03,_0x5efba7);};exports[_0x8202('0x26')]=function(_0x5c1da8,_0x6be059,_0x2b2f71){var _0x29e60c=_0x6be059[_0x8202('0x27')]['UserId'];if(!_0x29e60c&&_0x2b2f71){_0x29e60c=_0x2b2f71['id'];}var _0x54bddf=_[_0x8202('0x28')](_0x5c1da8[_0x6be059['channel']+_0x8202('0x29')],function(_0x3a04c6){var _0x609865=_[_0x8202('0x2a')](_0x6be059[_0x8202('0x2b')])+_0x8202('0x2c');return _0x3a04c6[_0x609865]===_0x6be059[_0x8202('0x27')]['id'];});if(!_0x54bddf&&_0x29e60c&&_0x5c1da8['agents'][_0x29e60c]){_0x54bddf=_[_0x8202('0x28')](_0x5c1da8['agents'][_0x29e60c][_0x6be059[_0x8202('0x2b')]+_0x8202('0x2d')],function(_0x28fb2d){return _0x28fb2d['id']===_0x6be059[_0x8202('0x27')]['id'];});}return _0x54bddf;};exports[_0x8202('0x2e')]=function(_0x569ebf,_0x5068be,_0x348248,_0x362221){if(_0x348248&&_0x348248['id']&&_0x569ebf[_0x8202('0x2f')]&&_0x569ebf['agents'][_0x348248['id']]){_0x569ebf[_0x8202('0x2f')][_0x348248['id']][_0x362221+_0x8202('0x2d')][_0x5068be[_0x8202('0x15')]['id']]={'id':_0x5068be[_0x8202('0x27')]['id']};}};exports[_0x8202('0x30')]=function(_0x585762,_0x40e274,_0x4281d7,_0x470c06){if(_0x4281d7&&_0x4281d7['id']&&_0x585762[_0x8202('0x2f')]&&_0x585762[_0x8202('0x2f')][_0x4281d7['id']]){delete _0x585762[_0x8202('0x2f')][_0x4281d7['id']][_0x470c06+_0x8202('0x2d')][_0x40e274[_0x8202('0x15')]['id']];}};exports[_0x8202('0x31')]=writeLog; \ No newline at end of file +var _0xa3b9=['util','../utils','ioredis','routing','redis','defaults','socket.io-emitter','split','name','notificationSound','notificationShake','body','queue','msg','getMustacheRender','account','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','emit','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash'];(function(_0x416468,_0x2e7a72){var _0x2ee9b7=function(_0xf354ce){while(--_0xf354ce){_0x416468['push'](_0x416468['shift']());}};_0x2ee9b7(++_0x2e7a72);}(_0xa3b9,0x6b));var _0x9a3b=function(_0x5a0caa,_0x1d5928){_0x5a0caa=_0x5a0caa-0x0;var _0xa960bb=_0xa3b9[_0x5a0caa];return _0xa960bb;};'use strict';var _=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var utils=require(_0x9a3b('0x2'));var Redis=require(_0x9a3b('0x3'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x9a3b('0x4'));config[_0x9a3b('0x5')]=_[_0x9a3b('0x6')](config[_0x9a3b('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9a3b('0x7'))(new Redis(config['redis']));function sendNotification(_0x439762,_0x1b4480,_0xd0fd83,_0x198863,_0x1ce8d5,_0x1d2b65){var _0x4120fd=_0x1d2b65||{};var _0x7c946e=_0xd0fd83[_0x9a3b('0x8')]('.');var _0x48be3e={'uniqueid':_0x1b4480,'channel':_0x7c946e[0x0],'id':_0x7c946e[0x1],'title':_0x7c946e[0x0]+'\x20interaction','interactionId':_0x7c946e[0x2],'queue':_0x1ce8d5?_0x1ce8d5[_0x9a3b('0x9')]:null,'sound':_0x4120fd['account'][_0x9a3b('0xa')],'shake':_0x4120fd['account'][_0x9a3b('0xb')]};try{if(!_0x4120fd['body']){_0x4120fd[_0x9a3b('0xc')]={};}if(_0x1ce8d5){_0x4120fd[_0x9a3b('0xc')][_0x9a3b('0xd')]=_0x1ce8d5;}else if(_0x4120fd[_0x9a3b('0xc')][_0x9a3b('0xd')]){delete _0x4120fd['body']['queue'];}_0x48be3e[_0x9a3b('0xe')]=utils[_0x9a3b('0xf')](_0x4120fd[_0x9a3b('0x10')][_0x9a3b('0x11')],_0x4120fd);}catch(_0x3524cd){_0x48be3e[_0x9a3b('0xe')]=_0x9a3b('0x12');logger[_0x9a3b('0x13')](util[_0x9a3b('0x14')]('[%s][QUEUE]\x20%s',_0x1b4480,_0x3524cd[_0x9a3b('0x15')]));}io['to'](util[_0x9a3b('0x14')](_0x9a3b('0x16'),_0x198863[_0x9a3b('0x9')]))[_0x9a3b('0x17')](util[_0x9a3b('0x14')](_0x9a3b('0x18'),_0x439762?_0x9a3b('0x19'):_0x9a3b('0x1a')),_0x48be3e);}function writeLog(_0x94426c,_0x3326b5,_0x26b9b2){return logger[_0x9a3b('0x1b')](util['format'](_0x9a3b('0x1c'),_0x94426c,_0x3326b5['name'],_0x26b9b2));}exports[_0x9a3b('0x1d')]=function(_0x72d588,_0xdafdc8,_0x3bf87e,_0x28c07e){if(_0xdafdc8[_0x9a3b('0x1e')]){writeLog(_0x72d588,_0xdafdc8,_0x9a3b('0x1f'));return![];}if(!_0xdafdc8[_0x9a3b('0x20')]){writeLog(_0x72d588,_0xdafdc8,_0x9a3b('0x21'));return![];}if(_0xdafdc8[_0x3bf87e+_0x9a3b('0x22')]){writeLog(_0x72d588,_0xdafdc8,'PAUSE');return![];}if(_0x28c07e&&_0xdafdc8[_0x9a3b('0x23')](_0x3bf87e+_0x9a3b('0x24'))&&_0xdafdc8[_0x9a3b('0x23')](_0x3bf87e+_0x9a3b('0x25'))){if(_0xdafdc8[_0x3bf87e+_0x9a3b('0x24')]>0x0&&_0xdafdc8[_0x3bf87e+'CurrentCapacity']>=_0xdafdc8[_0x3bf87e+_0x9a3b('0x24')]){writeLog(_0x72d588,_0xdafdc8,_0x3bf87e[_0x9a3b('0x26')]()+_0x9a3b('0x27'));return![];}}return!![];};exports['showNotification']=function(_0xdd0e19,_0x4c3492,_0x24aadd,_0x5c5d52,_0x57d3c5){return sendNotification(!![],_0xdd0e19,_0x4c3492,_0x24aadd,_0x5c5d52,_0x57d3c5);};exports[_0x9a3b('0x28')]=function(_0x5ccb42,_0x39dfb0,_0x24ec0c,_0x30381c,_0x1b56a2){return sendNotification(![],_0x5ccb42,_0x39dfb0,_0x24ec0c,_0x30381c,_0x1b56a2);};exports[_0x9a3b('0x29')]=function(_0x33652e,_0x40e716,_0x168728){var _0x20a458=_0x40e716[_0x9a3b('0x2a')][_0x9a3b('0x2b')];if(!_0x20a458&&_0x168728){_0x20a458=_0x168728['id'];}var _0x5c70d5=_[_0x9a3b('0x2c')](_0x33652e[_0x40e716[_0x9a3b('0x2d')]+_0x9a3b('0x2e')],function(_0x4f4537){var _0x5b5f73=_[_0x9a3b('0x2f')](_0x40e716[_0x9a3b('0x2d')])+_0x9a3b('0x30');return _0x4f4537[_0x5b5f73]===_0x40e716[_0x9a3b('0x2a')]['id'];});if(!_0x5c70d5&&_0x20a458&&_0x33652e[_0x9a3b('0x31')][_0x20a458]){_0x5c70d5=_[_0x9a3b('0x2c')](_0x33652e[_0x9a3b('0x31')][_0x20a458][_0x40e716[_0x9a3b('0x2d')]+_0x9a3b('0x32')],function(_0x54cb03){return _0x54cb03['id']===_0x40e716[_0x9a3b('0x2a')]['id'];});}return _0x5c70d5;};exports[_0x9a3b('0x33')]=function(_0x2c316d,_0x451978,_0x2a6550,_0xf1e258){if(_0x2a6550&&_0x2a6550['id']&&_0x2c316d[_0x9a3b('0x31')]&&_0x2c316d[_0x9a3b('0x31')][_0x2a6550['id']]){_0x2c316d[_0x9a3b('0x31')][_0x2a6550['id']][_0xf1e258+_0x9a3b('0x32')][_0x451978[_0x9a3b('0x15')]['id']]={'id':_0x451978['interaction']['id']};}};exports[_0x9a3b('0x34')]=function(_0x36894b,_0x3153ec,_0x4cf464,_0x1af7d4){if(_0x4cf464&&_0x4cf464['id']&&_0x36894b[_0x9a3b('0x31')]&&_0x36894b['agents'][_0x4cf464['id']]){delete _0x36894b['agents'][_0x4cf464['id']][_0x1af7d4+_0x9a3b('0x32')][_0x3153ec[_0x9a3b('0x15')]['id']];}};exports[_0x9a3b('0x35')]=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 b748acb..9ba104e 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 _0xf65f=['lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','shelljs'];(function(_0x48382d,_0x3cdb87){var _0x2ddf03=function(_0x441002){while(--_0x441002){_0x48382d['push'](_0x48382d['shift']());}};_0x2ddf03(++_0x3cdb87);}(_0xf65f,0xe0));var _0xff65=function(_0x32f78b,_0x178f58){_0x32f78b=_0x32f78b-0x0;var _0x51d847=_0xf65f[_0x32f78b];return _0x51d847;};'use strict';var schema=require('validate');var sh=require(_0xff65('0x0'));var _=require(_0xff65('0x1'));var utils=require(_0xff65('0x2'));var logger=require(_0xff65('0x3'))(_0xff65('0x4'));var system=schema({'command':{'type':_0xff65('0x5'),'required':!![],'message':_0xff65('0x6')}});exports[_0xff65('0x7')]=function(_0x53461b,_0x4f7dee){return function(_0x492ef0){try{var _0x541913={'command':_0x4f7dee[0x0]};var _0x7acefd=system[_0xff65('0x8')](_0x541913,{'typecast':!![]});if(_0x7acefd['length']){logger[_0xff65('0x9')](_0xff65('0xa'),_0x53461b,_[_0xff65('0xb')](_0x7acefd,'message')[_0xff65('0xc')](',\x20'));logger[_0xff65('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x53461b);_0x492ef0[_0xff65('0xe')]();}else{var _0x490228=this;var _0x47c891=utils[_0xff65('0xf')](_0x4f7dee[0x0],this);logger[_0xff65('0xd')](_0xff65('0x10'),_0x53461b,_0x47c891);sh[_0xff65('0x11')](_['trim'](_0x47c891),function(_0x4b68cf,_0x3df2b1){logger['info'](_0xff65('0x12'),_0x53461b,_0x4b68cf);if(_0x4b68cf==0x0){var _0x128ad9=_0x3df2b1['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xff65('0x13')](_0x4f7dee[0x1])||_['isEmpty'](_0x4f7dee[0x1])){logger['info'](_0xff65('0x14'),_0x53461b);_0x490228['body'][_0x4f7dee[0x1]]=_0x128ad9;}else{logger[_0xff65('0xd')](_0xff65('0x15'),_0x53461b,_0x4f7dee[0x1],_0x128ad9);_0x490228[_0xff65('0x16')][_0x4f7dee[0x1]]=_0x128ad9;}}_0x492ef0[_0xff65('0xe')]();});}}catch(_0x332c80){logger[_0xff65('0x9')](_0xff65('0xa'),_0x53461b,_[_0xff65('0x17')](_0x332c80)?JSON[_0xff65('0x18')](_0x332c80):_0x332c80);logger[_0xff65('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x53461b);_0x492ef0[_0xff65('0xe')]();}};}; \ No newline at end of file +var _0x8453=['[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','validate','shelljs','./utils','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x8453,0x1f1));var _0x3845=function(_0x2c71de,_0x12e964){_0x2c71de=_0x2c71de-0x0;var _0x51cb86=_0x8453[_0x2c71de];return _0x51cb86;};'use strict';var schema=require(_0x3845('0x0'));var sh=require(_0x3845('0x1'));var _=require('lodash');var utils=require(_0x3845('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x3845('0x3'),'required':!![],'message':_0x3845('0x4')}});exports[_0x3845('0x5')]=function(_0xdb45bf,_0xd60c4){return function(_0x2fecbf){try{var _0x49ff52={'command':_0xd60c4[0x0]};var _0x238282=system['validate'](_0x49ff52,{'typecast':!![]});if(_0x238282[_0x3845('0x6')]){logger['error'](_0x3845('0x7'),_0xdb45bf,_[_0x3845('0x8')](_0x238282,'message')['join'](',\x20'));logger[_0x3845('0x9')](_0x3845('0xa'),_0xdb45bf);_0x2fecbf[_0x3845('0xb')]();}else{var _0x10d7db=this;var _0x2be8c5=utils[_0x3845('0xc')](_0xd60c4[0x0],this);logger[_0x3845('0x9')](_0x3845('0xd'),_0xdb45bf,_0x2be8c5);sh[_0x3845('0xe')](_[_0x3845('0xf')](_0x2be8c5),function(_0xcee40a,_0x376da9){logger[_0x3845('0x9')](_0x3845('0x10'),_0xdb45bf,_0xcee40a);if(_0xcee40a==0x0){var _0x4dde3d=_0x376da9[_0x3845('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x3845('0x12')](_0xd60c4[0x1])||_[_0x3845('0x13')](_0xd60c4[0x1])){logger[_0x3845('0x9')](_0x3845('0x14'),_0xdb45bf);_0x10d7db[_0x3845('0x15')][_0xd60c4[0x1]]=_0x4dde3d;}else{logger[_0x3845('0x9')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0xdb45bf,_0xd60c4[0x1],_0x4dde3d);_0x10d7db[_0x3845('0x15')][_0xd60c4[0x1]]=_0x4dde3d;}}_0x2fecbf[_0x3845('0xb')]();});}}catch(_0xdcb42e){logger[_0x3845('0x16')](_0x3845('0x7'),_0xdb45bf,_[_0x3845('0x17')](_0xdcb42e)?JSON['stringify'](_0xdcb42e):_0xdcb42e);logger[_0x3845('0x9')](_0x3845('0xa'),_0xdb45bf);_0x2fecbf['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 49ec2ab..8da8e1d 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 _0xd88d=['number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','next','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x21f108,_0x494575){var _0x4e28b6=function(_0x11ecb0){while(--_0x11ecb0){_0x21f108['push'](_0x21f108['shift']());}};_0x4e28b6(++_0x494575);}(_0xd88d,0x1cd));var _0xdd88=function(_0x27af50,_0x2e4b01){_0x27af50=_0x27af50-0x0;var _0x5925f4=_0xd88d[_0x27af50];return _0x5925f4;};'use strict';var schema=require(_0xdd88('0x0'));var _=require(_0xdd88('0x1'));var rpc={'chatInteraction':require(_0xdd88('0x2')),'openchannelInteraction':require(_0xdd88('0x3')),'smsInteraction':require(_0xdd88('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xdd88('0x5'))};var logger=require(_0xdd88('0x6'))('routing');var tag=schema({'tag':{'type':_0xdd88('0x7'),'required':!![],'message':_0xdd88('0x8')}});exports[_0xdd88('0x9')]=function(_0x404b3f,_0x41a7af,_0x150ae9,_0x2e8f54){return function(_0x4c789b){try{var _0x499c4f={'tag':_0x41a7af[0x0]};var _0x136bee=tag[_0xdd88('0x0')](_0x499c4f,{'typecast':!![]});if(_0x136bee[_0xdd88('0xa')]){logger[_0xdd88('0xb')](_0xdd88('0xc'),_0x404b3f,_[_0xdd88('0xd')](_0x136bee,'message')['join'](',\x20'));logger['info'](_0xdd88('0xe'),_0x404b3f);_0x4c789b['next']();}else{var _0x5c53c5={'ids':[_0x41a7af[0x0]]};if(rpc[_0x2e8f54[_0xdd88('0xf')]+_0xdd88('0x10')]){rpc[_0x2e8f54[_0xdd88('0xf')]+'Interaction'][_0xdd88('0x11')](_0x2e8f54[_0xdd88('0x12')]['id'],_0x5c53c5)[_0xdd88('0x13')](function(_0x5b5ec2){logger[_0xdd88('0x14')](_0xdd88('0x15'),_0x404b3f,_0x41a7af[0x1],_0x2e8f54[_0xdd88('0xf')],_0x2e8f54[_0xdd88('0x12')]['id']);})[_0xdd88('0x16')](function(_0x374131){logger[_0xdd88('0xb')](_0xdd88('0xc'),_0x404b3f,JSON['stringify'](_0x374131));logger['info'](_0xdd88('0xe'),_0x404b3f);})['finally'](function(){_0x4c789b[_0xdd88('0x17')]();});}}}catch(_0x269cc4){logger[_0xdd88('0xb')]('[%s][TAG]\x20%s',_0x404b3f,_[_0xdd88('0x18')](_0x269cc4)?JSON[_0xdd88('0x19')](_0x269cc4):_0x269cc4);logger['info'](_0xdd88('0xe'),_0x404b3f);_0x4c789b[_0xdd88('0x17')]();}};}; \ No newline at end of file +var _0x25e1=['[%s][TAG]\x20%s','finally','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','then','catch'];(function(_0x96fe19,_0x36e6a5){var _0x5b2ca1=function(_0x1ceba5){while(--_0x1ceba5){_0x96fe19['push'](_0x96fe19['shift']());}};_0x5b2ca1(++_0x36e6a5);}(_0x25e1,0x1ce));var _0x125e=function(_0x55f03a,_0x22516e){_0x55f03a=_0x55f03a-0x0;var _0x4574b7=_0x25e1[_0x55f03a];return _0x4574b7;};'use strict';var schema=require(_0x125e('0x0'));var _=require(_0x125e('0x1'));var rpc={'chatInteraction':require(_0x125e('0x2')),'openchannelInteraction':require(_0x125e('0x3')),'smsInteraction':require(_0x125e('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x125e('0x5')),'whatsappInteraction':require(_0x125e('0x6'))};var logger=require(_0x125e('0x7'))(_0x125e('0x8'));var tag=schema({'tag':{'type':_0x125e('0x9'),'required':!![],'message':_0x125e('0xa')}});exports[_0x125e('0xb')]=function(_0x2d722e,_0x32fa38,_0x380ed2,_0x1ed885){return function(_0x38ad77){try{var _0x826d6c={'tag':_0x32fa38[0x0]};var _0x2f5c07=tag[_0x125e('0x0')](_0x826d6c,{'typecast':!![]});if(_0x2f5c07['length']){logger[_0x125e('0xc')]('[%s][TAG]\x20%s',_0x2d722e,_[_0x125e('0xd')](_0x2f5c07,_0x125e('0xe'))[_0x125e('0xf')](',\x20'));logger[_0x125e('0x10')](_0x125e('0x11'),_0x2d722e);_0x38ad77[_0x125e('0x12')]();}else{var _0x293c74={'ids':[_0x32fa38[0x0]]};if(rpc[_0x1ed885['channel']+_0x125e('0x13')]){rpc[_0x1ed885[_0x125e('0x14')]+_0x125e('0x13')]['addTags'](_0x1ed885[_0x125e('0x15')]['id'],_0x293c74)[_0x125e('0x16')](function(_0x586735){logger[_0x125e('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x2d722e,_0x32fa38[0x1],_0x1ed885[_0x125e('0x14')],_0x1ed885[_0x125e('0x15')]['id']);})[_0x125e('0x17')](function(_0x38b021){logger[_0x125e('0xc')](_0x125e('0x18'),_0x2d722e,JSON['stringify'](_0x38b021));logger[_0x125e('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2d722e);})[_0x125e('0x19')](function(){_0x38ad77[_0x125e('0x12')]();});}}}catch(_0x264261){logger[_0x125e('0xc')](_0x125e('0x18'),_0x2d722e,_['isObject'](_0x264261)?JSON[_0x125e('0x1a')](_0x264261):_0x264261);logger[_0x125e('0x10')](_0x125e('0x11'),_0x2d722e);_0x38ad77[_0x125e('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 a793ebb..276ebf4 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 _0x0e9b=['params','stringify','POST','application/json-rpc','parse','result','logged','channelId=','&sessionId=','&data=','then','stop','catch','[%s][TVOX]\x20%s','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','login'];(function(_0x3dde84,_0x37fd88){var _0x80561f=function(_0x45607c){while(--_0x45607c){_0x3dde84['push'](_0x3dde84['shift']());}};_0x80561f(++_0x37fd88);}(_0x0e9b,0x11d));var _0xb0e9=function(_0x308c23,_0x15b7b9){_0x308c23=_0x308c23-0x0;var _0x4af40a=_0x0e9b[_0x308c23];return _0x4af40a;};'use strict';var rp=require(_0xb0e9('0x0'));var logger=require(_0xb0e9('0x1'))(_0xb0e9('0x2'));var _=require(_0xb0e9('0x3'));var arr=[];exports[_0xb0e9('0x4')]=function(_0x4dff15,_0x23e916){return function(_0x142814){var _0x520499=_0x23e916[0xa];var _0x5495b4=_0x23e916[0xb];var _0x4499f0=_0x23e916[0xc];var _0x43817a=_0x23e916[0xd];var _0x1e78b1=_0x23e916[0xe];var _0x5ad754=_0x23e916[0xf][_0xb0e9('0x5')](/\n/g,_0xb0e9('0x6'));var _0x3dc8c4=_0x23e916[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xb0e9('0x7')](_0x5495b4)){arr[_0xb0e9('0x8')](_0x5495b4);var _0x51de51=_0x23e916[0x3];var _0x3f145b=_0x23e916[0x4];var _0x287260=_0x23e916[0x1];var _0x3ab637=_0x23e916[0x0];var _0x2e56e6={};_0x2e56e6[_0xb0e9('0x9')]=_0x23e916[0x8]+_0xb0e9('0xa')+_0x4499f0+'|'+_0x520499+'|'+_0x43817a+'|'+_0x5495b4+'|'+_0x1e78b1;_0x2e56e6[_0xb0e9('0xb')]=_0x23e916[0x7]+_0xb0e9('0xa')+_0x4499f0+'|'+_0x520499+'|'+_0x43817a+'|'+_0x5495b4+'|'+_0x1e78b1+'|'+_0x5ad754+'|'+_0x3dc8c4;_0x2e56e6[_0xb0e9('0xc')]=_0x23e916[0x9];var _0x18e433={};_0x18e433['jsonrpc']=_0xb0e9('0xd');_0x18e433['method']=_0xb0e9('0xe');var _0xa242f8=[];_0xa242f8[_0xb0e9('0x8')](_0x23e916[0x2]);_0xa242f8[_0xb0e9('0x8')](_0x23e916[0x5]);_0xa242f8[_0xb0e9('0x8')](_0x23e916[0x6]);_0x18e433[_0xb0e9('0xf')]=_0xa242f8;_0x18e433['id']=0x1;var _0x231718=JSON[_0xb0e9('0x10')](_0x18e433);var _0x5678fa={'encoding':'utf8','method':_0xb0e9('0x11'),'timeout':0x2710,'url':_0x51de51,'headers':{'Content-Type':_0xb0e9('0x12')},'body':_0x231718};return rp(_0x5678fa)['then'](function(_0x1711e9){const _0x2680b8=JSON[_0xb0e9('0x13')](_0x1711e9);if(!_0x2680b8[_0xb0e9('0x14')][_0xb0e9('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x4ac6e4=_0x5495b4;var _0x5b859c=_0xb0e9('0x16')+_0x287260+'&serviceId='+_0x3ab637+_0xb0e9('0x17')+_0x4ac6e4+_0xb0e9('0x18')+JSON[_0xb0e9('0x10')](_0x2e56e6);var _0x4ac393=_0x3f145b+'?'+_0x5b859c;return rp(_0x4ac393);})[_0xb0e9('0x19')](function(_0x4803b4){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4dff15,_0x4803b4);_0x142814[_0xb0e9('0x1a')]();})[_0xb0e9('0x1b')](function(_0x1d559d){logger['error'](_0xb0e9('0x1c'),_0x4dff15,_['isObject'](_0x1d559d)?JSON['stringify'](_0x1d559d):_0x1d559d);_0x142814[_0xb0e9('0x1a')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x4dff15);_0x142814[_0xb0e9('0x1d')]();}};}; \ No newline at end of file +var _0x6014=['params','stringify','POST','application/json-rpc','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','jsonrpc','2.0','method'];(function(_0x51a74c,_0x56542d){var _0x2859ca=function(_0x2825f9){while(--_0x2825f9){_0x51a74c['push'](_0x51a74c['shift']());}};_0x2859ca(++_0x56542d);}(_0x6014,0x11f));var _0x4601=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0x6014[_0x1f5143];return _0x383a38;};'use strict';var rp=require(_0x4601('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x4601('0x1'));var arr=[];exports['consequence']=function(_0x438262,_0x49d3ef){return function(_0x498545){var _0x589692=_0x49d3ef[0xa];var _0x1e7590=_0x49d3ef[0xb];var _0x55ae53=_0x49d3ef[0xc];var _0x1f7a72=_0x49d3ef[0xd];var _0x33af1c=_0x49d3ef[0xe];var _0x200720=_0x49d3ef[0xf][_0x4601('0x2')](/\n/g,_0x4601('0x3'));var _0x1f2c54=_0x49d3ef[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x4601('0x4')](_0x1e7590)){arr[_0x4601('0x5')](_0x1e7590);var _0x249e46=_0x49d3ef[0x3];var _0x48448f=_0x49d3ef[0x4];var _0x1461dd=_0x49d3ef[0x1];var _0x12d86=_0x49d3ef[0x0];var _0x3d9dca={};_0x3d9dca[_0x4601('0x6')]=_0x49d3ef[0x8]+'?params='+_0x55ae53+'|'+_0x589692+'|'+_0x1f7a72+'|'+_0x1e7590+'|'+_0x33af1c;_0x3d9dca['urlOnRing']=_0x49d3ef[0x7]+'?params='+_0x55ae53+'|'+_0x589692+'|'+_0x1f7a72+'|'+_0x1e7590+'|'+_0x33af1c+'|'+_0x200720+'|'+_0x1f2c54;_0x3d9dca['title']=_0x49d3ef[0x9];var _0x48789b={};_0x48789b[_0x4601('0x7')]=_0x4601('0x8');_0x48789b[_0x4601('0x9')]='login';var _0x2fc7a1=[];_0x2fc7a1[_0x4601('0x5')](_0x49d3ef[0x2]);_0x2fc7a1['push'](_0x49d3ef[0x5]);_0x2fc7a1['push'](_0x49d3ef[0x6]);_0x48789b[_0x4601('0xa')]=_0x2fc7a1;_0x48789b['id']=0x1;var _0x440b1e=JSON[_0x4601('0xb')](_0x48789b);var _0x1a140c={'encoding':'utf8','method':_0x4601('0xc'),'timeout':0x2710,'url':_0x249e46,'headers':{'Content-Type':_0x4601('0xd')},'body':_0x440b1e};return rp(_0x1a140c)['then'](function(_0x38a555){const _0x318178=JSON[_0x4601('0xe')](_0x38a555);if(!_0x318178[_0x4601('0xf')]['logged']){throw new Error(_0x4601('0x10'));}var _0x808eb7=_0x1e7590;var _0x2fb53b='channelId='+_0x1461dd+'&serviceId='+_0x12d86+_0x4601('0x11')+_0x808eb7+'&data='+JSON[_0x4601('0xb')](_0x3d9dca);var _0x39558f=_0x48448f+'?'+_0x2fb53b;return rp(_0x39558f);})[_0x4601('0x12')](function(_0x4451a7){logger['info'](_0x4601('0x13'),_0x438262,_0x4451a7);_0x498545['stop']();})[_0x4601('0x14')](function(_0x203fb3){logger[_0x4601('0x15')](_0x4601('0x16'),_0x438262,_[_0x4601('0x17')](_0x203fb3)?JSON[_0x4601('0xb')](_0x203fb3):_0x203fb3);_0x498545[_0x4601('0x18')]();});}else{logger['info'](_0x4601('0x19'),_0x438262);_0x498545[_0x4601('0x1a')]();}};}; \ 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 7d36e96..c0d4d71 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2cf233,_0x412d6b){var _0x2a829c=function(_0x364d67){while(--_0x364d67){_0x2cf233['push'](_0x2cf233['shift']());}};_0x2a829c(++_0x412d6b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3ba8b5,_0x140bbd){var _0x229d00=function(_0x45722c){while(--_0x45722c){_0x3ba8b5['push'](_0x3ba8b5['shift']());}};_0x229d00(++_0x140bbd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 69beeab..81d292c 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 _0x853e=['util','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','.js','rules','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agents','agent','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','capacity','hasOwnProperty','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:'];(function(_0x4f7bdb,_0x2520cf){var _0x32d063=function(_0x613476){while(--_0x613476){_0x4f7bdb['push'](_0x4f7bdb['shift']());}};_0x32d063(++_0x2520cf);}(_0x853e,0x1ea));var _0xe853=function(_0x2d630f,_0x28c4ac){_0x2d630f=_0x2d630f-0x0;var _0x15b711=_0x853e[_0x2d630f];return _0x15b711;};'use strict';var _=require('lodash');var util=require(_0xe853('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0xe853('0x1'));var BPromise=require('bluebird');var utils=require(_0xe853('0x2'));var sUtils=require('./applications/strategy/util');var logger=require(_0xe853('0x3'))(_0xe853('0x4'));var rpc={'openchannelQueueReport':require(_0xe853('0x5')),'mailQueueReport':require(_0xe853('0x6')),'chatQueueReport':require(_0xe853('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xe853('0x8')),'whatsappQueueReport':require(_0xe853('0x9'))};var RuleEngine=require(_0xe853('0xa'));function getId(_0x25e6e1,_0xe3d468,_0x36d502){return util[_0xe853('0xb')](_0xe853('0xc'),_0x25e6e1,_0xe3d468||0x0,_0x36d502||0x0);}function getIntervals(_0x213f17,_0x15bfe2){var _0x478b19=[];if(!_['isNil'](_0x15bfe2['IntervalId'])&&!_[_0xe853('0xd')](_0x213f17[_0x15bfe2['IntervalId']])&&!_['isNil'](_0x213f17[_0x15bfe2[_0xe853('0xe')]][_0xe853('0xf')])){_0x478b19=_[_0xe853('0x10')](_0x213f17[_0x15bfe2['IntervalId']][_0xe853('0xf')],_0xe853('0x11'));}else if(!_[_0xe853('0xd')](_0x15bfe2[_0xe853('0x11')])){_0x478b19=[_0x15bfe2[_0xe853('0x11')]];}return _0x478b19;}exports[_0xe853('0x12')]=function(_0x1ebf13){_0x1ebf13['rules']={};return new BPromise(function(_0x4b8e2c,_0x5db22d){var _0x552812={'Start':function(_0x156940){var _0x3840b5=this;return new Promise(function(_0x41c489,_0x11e4a0){if(_0x156940){try{var _0x21c5f0=[];var _0x9309a5=getId(_0x156940[_0xe853('0x13')],_0x156940[_0xe853('0x14')]?_0x156940[_0xe853('0x14')]['id']:0x0,_0x156940[_0xe853('0x15')]?_0x156940[_0xe853('0x15')]['id']:0x0);var _0x1d2526=sUtils[_0xe853('0x16')](_0x1ebf13,_0x156940);if(_0x156940[_0xe853('0x17')]||!_0x1d2526&&_0x156940[_0xe853('0x18')]&&_[_0xe853('0x19')](_0x156940['applications'])&&_0x156940[_0xe853('0x18')][_0xe853('0x1a')]){for(var _0x386225=0x0;_0x386225<_0x156940[_0xe853('0x18')][_0xe853('0x1a')];_0x386225+=0x1){var _0x1ade8a=_0x156940[_0xe853('0x18')][_0x386225];if(fs[_0xe853('0x1b')](path[_0xe853('0x1c')](__dirname,_0xe853('0x18'),_0x1ade8a[_0xe853('0x1d')]+'.js'))){var _0x110362=[];switch(_0x1ade8a[_0xe853('0x1d')][_0xe853('0x1e')]()){case _0xe853('0x1f'):var _0x1af209=_0x1ade8a[_0xe853('0x20')][_0xe853('0x21')](',');if(_0x156940[_0xe853('0x13')]==='mail'){_0x110362[_0xe853('0x22')](_0x1af209[0x0]);_0x110362[_0xe853('0x22')](_0x1af209[0x1]);_0x110362[_0xe853('0x22')](_0x1af209[_0xe853('0x23')](0x2,_0x1af209[_0xe853('0x1a')])['join'](','));}else{_0x110362[_0xe853('0x22')](_0x1af209[0x0]);_0x110362[_0xe853('0x22')](_0x1af209['slice'](0x1,_0x1af209[_0xe853('0x1a')])['join'](','));}break;case _0xe853('0x24'):var _0x545738=_0x1ade8a['appdata'][_0xe853('0x21')](',');_0x110362[_0xe853('0x22')](_0x545738[0x0]);_0x110362[_0xe853('0x22')](_0x545738[0x1]);_0x110362[_0xe853('0x22')](_0x545738[_0xe853('0x23')](0x2,_0x545738[_0xe853('0x1a')])[_0xe853('0x1c')](','));break;case _0xe853('0x25'):var _0x204a5a=_0x1ade8a[_0xe853('0x20')][_0xe853('0x21')](',');_0x110362['push'](_0x204a5a[0x0]);_0x110362[_0xe853('0x22')](_0x204a5a[0x1]);_0x110362[_0xe853('0x22')](_0x204a5a[0x2]);_0x110362['push'](_0x204a5a[0x3]);_0x110362[_0xe853('0x22')](_0x204a5a['slice'](0x4,_0x204a5a[_0xe853('0x1a')])[_0xe853('0x1c')](','));break;case _0xe853('0x26'):var _0x4e8fe0=_0x1ade8a[_0xe853('0x20')][_0xe853('0x21')](',');_0x110362[_0xe853('0x22')](_0x4e8fe0[0x0]);_0x110362[_0xe853('0x22')](_0x4e8fe0[0x1]);_0x110362[_0xe853('0x22')](_0x4e8fe0[0x2]);_0x110362[_0xe853('0x22')](_0x4e8fe0[0x3]);_0x110362[_0xe853('0x22')](_0x4e8fe0[_0xe853('0x23')](0x4,_0x4e8fe0[_0xe853('0x1a')])[_0xe853('0x1c')](','));break;case _0xe853('0x14'):_0x110362['push'](_0x1ade8a[_0xe853('0x20')]);break;case'tag':_0x110362[_0xe853('0x22')](_0x1ade8a[_0xe853('0x27')]);_0x110362[_0xe853('0x22')](_0x1ade8a[_0xe853('0x20')]);break;case'tvox':var _0x37c67c=utils[_0xe853('0x28')](_0x156940[_0xe853('0x29')][_0xe853('0x2a')],_0x156940);var _0x3f794b=_0x1ade8a[_0xe853('0x20')]['split'](',');_0x110362[_0xe853('0x22')](_0x3f794b[0x0]);_0x110362[_0xe853('0x22')](_0x3f794b[0x1]);_0x110362[_0xe853('0x22')](_0x3f794b[0x2]);_0x110362[_0xe853('0x22')](_0x3f794b[0x3]);_0x110362[_0xe853('0x22')](_0x3f794b[0x4]);_0x110362[_0xe853('0x22')](_0x3f794b[0x5]);_0x110362[_0xe853('0x22')](_0x3f794b[0x6]);_0x110362[_0xe853('0x22')](_0x3f794b[0x7]);_0x110362[_0xe853('0x22')](_0x3f794b[0x8]);_0x110362['push'](_0x3f794b[0x9]);_0x110362['push'](_0x3f794b[0xa]);_0x110362[_0xe853('0x22')](_0x156940[_0xe853('0x15')]['id']);_0x110362[_0xe853('0x22')](_0x156940['message']['id']);_0x110362[_0xe853('0x22')](_0x1ade8a['ChatWebsiteId']);_0x110362['push'](_0x156940['interaction'][_0xe853('0x2b')]);_0x110362[_0xe853('0x22')](_0x156940[_0xe853('0x2c')]['body']);_0x110362[_0xe853('0x22')](_0x37c67c);break;default:_0x110362=_[_0xe853('0xd')](_0x1ade8a[_0xe853('0x20')])?[]:_0x1ade8a[_0xe853('0x20')][_0xe853('0x21')](',');}var _0x9fca20={'id':util['format']('%s:%s:%s',_0x9309a5,_0x1ade8a['id'],_0x1ade8a[_0xe853('0x1d')]),'condition':require('./interval')[_0xe853('0x2d')](_0x9309a5,getIntervals(_0x1ebf13[_0xe853('0x2e')],_0x1ade8a),_0x1ebf13),'consequence':require(_0xe853('0x2f')+_0x1ade8a[_0xe853('0x1d')])[_0xe853('0x30')](_0x9309a5,_0x110362,_0x1ebf13,_0x156940),'p':_0x1ade8a[_0xe853('0x31')]||0x0};logger[_0xe853('0x32')]('Push\x20new\x20rule',_0x9fca20['id'],_0xe853('0x33'),getIntervals(_0x1ebf13[_0xe853('0x2e')],_0x1ade8a)[_0xe853('0x1c')]('\x20|\x20'));_0x21c5f0[_0xe853('0x22')](_0x9fca20);}else{logger[_0xe853('0x34')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xe853('0x1c')](__dirname,_0xe853('0x18'),_0x1ade8a['app']+_0xe853('0x35')));}}_0x1ebf13[_0xe853('0x36')][_0x9309a5]=new RuleEngine(_0x21c5f0);_0x1ebf13[_0xe853('0x36')][_0x9309a5][_0xe853('0x37')](_0x156940,function(_0x4c697e){logger[_0xe853('0x32')]('Applications\x20executed',JSON[_0xe853('0x38')](_0x4c697e[_0xe853('0x39')]));if(_0x1ebf13[_0xe853('0x36')][_0x9309a5]){_0x1ebf13['rules'][_0x9309a5][_0xe853('0x3a')](_0xe853('0x3b'));}});return _0x41c489({'code':0xc8,'message':_0x156940});}else{if(_0x1d2526){logger['info'](util[_0xe853('0xb')]('Skipped\x20routing\x20for\x20%s',_0x9309a5));}else{logger[_0xe853('0x32')](_0xe853('0x3c'));}return _0x41c489({'code':0xc8,'message':_0x156940});}}catch(_0x34b5fb){logger[_0xe853('0x34')](_0x34b5fb['stack']);return _0x11e4a0(_0x3840b5['error'](0x1f4,_0x34b5fb));}}return _0x11e4a0(_0xe853('0x3d'));});},'AcceptMessage':function(_0x176dc8){var _0x4a2f33=this;return new Promise(function(_0x3447e3,_0x26b40b){if(_0x176dc8['agent']&&_0x176dc8['agent']['id']){if(_0x1ebf13[_0xe853('0x3e')][_0x176dc8[_0xe853('0x3f')]['id']]){_0x1ebf13[_0xe853('0x3e')][_0x176dc8[_0xe853('0x3f')]['id']][_0xe853('0x40')]=![];_0x1ebf13[_0xe853('0x3e')][_0x176dc8[_0xe853('0x3f')]['id']][_0xe853('0x41')]=undefined;}}if(_0x176dc8[_0xe853('0x14')]&&_0x176dc8[_0xe853('0x14')]['id']){try{var _0x4e493e=getId(_0x176dc8['channel'],_0x176dc8[_0xe853('0x14')]?_0x176dc8[_0xe853('0x14')]['id']:0x0,_0x176dc8['interaction']?_0x176dc8[_0xe853('0x15')]['id']:0x0);if(_0x1ebf13[_0xe853('0x36')][_0x4e493e]){_0x1ebf13['rules'][_0x4e493e][_0xe853('0x3a')](_0xe853('0x42'));if(rpc[_0x176dc8[_0xe853('0x13')]+'QueueReport']){rpc[_0x176dc8[_0xe853('0x13')]+_0xe853('0x43')]['update'](_0x4e493e,{'UserId':_0x176dc8[_0xe853('0x14')][_0xe853('0x44')]})[_0xe853('0x45')](function(){logger[_0xe853('0x34')](_0xe853('0x46'));});}}return _0x3447e3({'code':0xc8,'message':_0x176dc8});}catch(_0x29933f){logger[_0xe853('0x34')](_0x29933f[_0xe853('0x47')]);return _0x26b40b(_0x4a2f33['error'](0x1f4,_0x29933f));}}logger[_0xe853('0x34')](_0xe853('0x48'));return _0x26b40b(_0x4a2f33[_0xe853('0x34')](0x1f4,_0xe853('0x48')));});},'RejectMessage':function(_0x293f8f){var _0x251797=this;return new Promise(function(_0x313fcd,_0x98bbc){if(_0x293f8f[_0xe853('0x3f')]&&_0x293f8f[_0xe853('0x3f')]['id']){try{if(_0x1ebf13[_0xe853('0x3e')][_0x293f8f[_0xe853('0x3f')]['id']]){_0x1ebf13[_0xe853('0x3e')][_0x293f8f[_0xe853('0x3f')]['id']][_0xe853('0x40')]=![];_0x1ebf13[_0xe853('0x3e')][_0x293f8f['agent']['id']][_0xe853('0x41')]=undefined;}return _0x313fcd({'code':0xc8,'message':_0x293f8f});}catch(_0x52f84d){logger[_0xe853('0x34')](_0x52f84d[_0xe853('0x47')]);return _0x98bbc(_0x251797[_0xe853('0x34')](0x1f4,_0x52f84d));}}logger['error'](_0xe853('0x48'));return _0x98bbc(_0x251797[_0xe853('0x34')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x57d1b4){var _0x35f431=this;return new Promise(function(_0x2bfdc7,_0x521f55){if(_0x57d1b4[_0xe853('0x13')]&&_0x57d1b4[_0xe853('0x15')]&&_0x57d1b4[_0xe853('0x15')]['id']){try{var _0x256dec=getId(_0x57d1b4[_0xe853('0x13')],_0x57d1b4[_0xe853('0x14')]?_0x57d1b4[_0xe853('0x14')]['id']:0x0,_0x57d1b4['interaction']?_0x57d1b4[_0xe853('0x15')]['id']:0x0);if(_0x1ebf13[_0xe853('0x36')][_0x256dec]){_0x1ebf13[_0xe853('0x36')][_0x256dec][_0xe853('0x3a')](_0xe853('0x42'));}return _0x2bfdc7({'code':0xc8,'message':_0x57d1b4});}catch(_0x5a5958){logger['error'](_0x5a5958[_0xe853('0x47')]);return _0x521f55(_0x35f431[_0xe853('0x34')](0x1f4,_0x5a5958));}}logger[_0xe853('0x34')](_0xe853('0x48'));return _0x521f55(_0x35f431[_0xe853('0x34')](0x1f4,_0xe853('0x48')));});},'AgentCapacity':function(_0x4f18ec){var _0x300587=this;return new Promise(function(_0x54b058,_0x444e1f){if(_0x1ebf13[_0xe853('0x3e')]['hasOwnProperty'](_0x4f18ec['id'])){for(var _0x2cfc27 in _0x4f18ec[_0xe853('0x49')]){if(_0x4f18ec['capacity'][_0xe853('0x4a')](_0x2cfc27)){if(_0x1ebf13[_0xe853('0x3e')][_0x4f18ec['id']][_0xe853('0x4a')](_0x2cfc27+'CurrentCapacity')){_0x1ebf13['agents'][_0x4f18ec['id']][_0x2cfc27+'CurrentCapacity']=parseInt(_0x4f18ec[_0xe853('0x49')][_0x2cfc27],0xa);}}}_0x1ebf13[_0xe853('0x3e')][_0x4f18ec['id']][_0xe853('0x4b')]();return _0x54b058({'code':0xc8,'message':_0x1ebf13[_0xe853('0x3e')][_0x4f18ec['id']]});}else{return _0x444e1f(_0x300587[_0xe853('0x34')](0x1f4,_0xe853('0x4c')));}});},'Agents':function(_0x3dd9b2){return new Promise(function(_0x3ce284){var _0x26f65e=_[_0xe853('0x4d')](_0x1ebf13['agents']);if(_0x3dd9b2&&_0x3dd9b2['id']){var _0xe0dca=_[_0xe853('0x4e')](_0x26f65e,function(_0xf23f90){return _0xf23f90['id']===_0x3dd9b2['id'];});_0x3ce284(_0xe0dca);}else{_0x3ce284({'count':_0x26f65e['length'],'rows':_0x26f65e});}});},'ChatQueues':function(){return new Promise(function(_0x3d35a8){var _0x3416ae=[];for(var _0x45c966 in _0x1ebf13[_0xe853('0x4f')]){if(_0x1ebf13[_0xe853('0x4f')][_0xe853('0x4a')](_0x45c966)){var _0x33493d=_0x1ebf13['chatQueues'][_0x45c966];var _0x4f8699={'id':_0x33493d['id'],'available':_0x33493d[_0xe853('0x50')],'loggedIn':_0x33493d[_0xe853('0x51')],'name':_0x33493d[_0xe853('0x52')],'paused':_0x33493d[_0xe853('0x53')],'waiting':_0x33493d[_0xe853('0x54')]};_0x3416ae[_0xe853('0x22')](_0x4f8699);}}_0x3d35a8({'count':_0x3416ae[_0xe853('0x1a')],'rows':_0x3416ae});});},'MailQueues':function(){return new Promise(function(_0x43aaec){var _0x4f914d=[];for(var _0x7e9300 in _0x1ebf13[_0xe853('0x55')]){if(_0x1ebf13['mailQueues'][_0xe853('0x4a')](_0x7e9300)){var _0x48e561=_0x1ebf13[_0xe853('0x55')][_0x7e9300];var _0x59b2e8={'id':_0x48e561['id'],'available':_0x48e561['available'],'loggedIn':_0x48e561[_0xe853('0x51')],'name':_0x48e561['name'],'paused':_0x48e561[_0xe853('0x53')],'waiting':_0x48e561['waiting']};_0x4f914d['push'](_0x59b2e8);}}_0x43aaec({'count':_0x4f914d[_0xe853('0x1a')],'rows':_0x4f914d});});},'OpenchannelQueues':function(){return new Promise(function(_0x10da7a){var _0x2a9f4b=[];for(var _0x3a6121 in _0x1ebf13['openchannelQueues']){if(_0x1ebf13['openchannelQueues'][_0xe853('0x4a')](_0x3a6121)){var _0x4dd074=_0x1ebf13[_0xe853('0x56')][_0x3a6121];var _0x4c85c0={'id':_0x4dd074['id'],'available':_0x4dd074[_0xe853('0x50')],'loggedIn':_0x4dd074[_0xe853('0x51')],'name':_0x4dd074[_0xe853('0x52')],'paused':_0x4dd074[_0xe853('0x53')],'waiting':_0x4dd074[_0xe853('0x54')]};_0x2a9f4b['push'](_0x4c85c0);}}_0x10da7a({'count':_0x2a9f4b[_0xe853('0x1a')],'rows':_0x2a9f4b});});},'SmsQueues':function(){return new Promise(function(_0x739460){var _0x337690=[];for(var _0x32a7a0 in _0x1ebf13[_0xe853('0x57')]){if(_0x1ebf13['smsQueues'][_0xe853('0x4a')](_0x32a7a0)){var _0x2a1397=_0x1ebf13['smsQueues'][_0x32a7a0];var _0x40b6b5={'id':_0x2a1397['id'],'available':_0x2a1397[_0xe853('0x50')],'loggedIn':_0x2a1397[_0xe853('0x51')],'name':_0x2a1397[_0xe853('0x52')],'paused':_0x2a1397[_0xe853('0x53')],'waiting':_0x2a1397[_0xe853('0x54')]};_0x337690['push'](_0x40b6b5);}}_0x739460({'count':_0x337690[_0xe853('0x1a')],'rows':_0x337690});});},'FaxQueues':function(){return new Promise(function(_0x159f0f){var _0x22c966=[];for(var _0x20a6e4 in _0x1ebf13['faxQueues']){if(_0x1ebf13[_0xe853('0x58')][_0xe853('0x4a')](_0x20a6e4)){var _0x49383c=_0x1ebf13[_0xe853('0x58')][_0x20a6e4];var _0x47efb0={'id':_0x49383c['id'],'available':_0x49383c[_0xe853('0x50')],'loggedIn':_0x49383c[_0xe853('0x51')],'name':_0x49383c[_0xe853('0x52')],'paused':_0x49383c['paused'],'waiting':_0x49383c[_0xe853('0x54')]};_0x22c966[_0xe853('0x22')](_0x47efb0);}}_0x159f0f({'count':_0x22c966[_0xe853('0x1a')],'rows':_0x22c966});});},'WhatsappQueues':function(){return new Promise(function(_0x5a6ae0){var _0x2ec5cb=[];for(var _0x3bef8e in _0x1ebf13[_0xe853('0x59')]){if(_0x1ebf13[_0xe853('0x59')][_0xe853('0x4a')](_0x3bef8e)){var _0x209f25=_0x1ebf13[_0xe853('0x59')][_0x3bef8e];var _0x5094ce={'id':_0x209f25['id'],'available':_0x209f25[_0xe853('0x50')],'loggedIn':_0x209f25[_0xe853('0x51')],'name':_0x209f25['name'],'paused':_0x209f25['paused'],'waiting':_0x209f25[_0xe853('0x54')]};_0x2ec5cb[_0xe853('0x22')](_0x5094ce);}}_0x5a6ae0({'count':_0x2ec5cb[_0xe853('0x1a')],'rows':_0x2ec5cb});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2e80da){var _0xf8982c=_['values'](_0x1ebf13[_0xe853('0x5a')]);_0x2e80da({'count':_0xf8982c[_0xe853('0x1a')],'rows':_0xf8982c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0xaba470){var _0x548f7a=_['values'](_0x1ebf13['mailQueuesWaitingInteractions']);_0xaba470({'count':_0x548f7a[_0xe853('0x1a')],'rows':_0x548f7a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x50b110){var _0x2b3883=_[_0xe853('0x4d')](_0x1ebf13['openchannelQueuesWaitingInteractions']);_0x50b110({'count':_0x2b3883[_0xe853('0x1a')],'rows':_0x2b3883});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4d0fc7){var _0x8e2216=_[_0xe853('0x4d')](_0x1ebf13[_0xe853('0x5b')]);_0x4d0fc7({'count':_0x8e2216['length'],'rows':_0x8e2216});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4263ff){var _0x26a240=_[_0xe853('0x4d')](_0x1ebf13[_0xe853('0x5c')]);_0x4263ff({'count':_0x26a240[_0xe853('0x1a')],'rows':_0x26a240});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5e7a13){var _0x3f18c4=_[_0xe853('0x4d')](_0x1ebf13[_0xe853('0x5d')]);_0x5e7a13({'count':_0x3f18c4[_0xe853('0x1a')],'rows':_0x3f18c4});});}};var _0x362f01=jayson[_0xe853('0x5e')](_0x552812)[_0xe853('0x5f')]();_0x362f01['on']('error',function(_0x270595){logger[_0xe853('0x34')](JSON[_0xe853('0x38')](_0x270595));return _0x5db22d(_0x270595);});_0x362f01[_0xe853('0x12')](0x232c,_0xe853('0x60'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4b8e2c(_0xe853('0x61')+0x232c);});});}; \ No newline at end of file +var _0x58e6=['\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','tvox','account','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','consequence','info','Push\x20new\x20rule','on\x20interval'];(function(_0x236957,_0x3044b7){var _0xaeccaf=function(_0x39d247){while(--_0x39d247){_0x236957['push'](_0x236957['shift']());}};_0xaeccaf(++_0x3044b7);}(_0x58e6,0x1c2));var _0x658e=function(_0x3259f1,_0x42ec8e){_0x3259f1=_0x3259f1-0x0;var _0x5abf55=_0x58e6[_0x3259f1];return _0x5abf55;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x658e('0x2'));var sUtils=require('./applications/strategy/util');var logger=require(_0x658e('0x3'))(_0x658e('0x4'));var rpc={'openchannelQueueReport':require(_0x658e('0x5')),'mailQueueReport':require(_0x658e('0x6')),'chatQueueReport':require(_0x658e('0x7')),'smsQueueReport':require(_0x658e('0x8')),'faxQueueReport':require(_0x658e('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x7a343,_0xa73acf,_0x1e2c26){return util['format'](_0x658e('0xa'),_0x7a343,_0xa73acf||0x0,_0x1e2c26||0x0);}function getIntervals(_0x6ea6e,_0x13ab91){var _0x322320=[];if(!_[_0x658e('0xb')](_0x13ab91[_0x658e('0xc')])&&!_['isNil'](_0x6ea6e[_0x13ab91['IntervalId']])&&!_[_0x658e('0xb')](_0x6ea6e[_0x13ab91[_0x658e('0xc')]][_0x658e('0xd')])){_0x322320=_[_0x658e('0xe')](_0x6ea6e[_0x13ab91[_0x658e('0xc')]][_0x658e('0xd')],_0x658e('0xf'));}else if(!_['isNil'](_0x13ab91[_0x658e('0xf')])){_0x322320=[_0x13ab91[_0x658e('0xf')]];}return _0x322320;}exports[_0x658e('0x10')]=function(_0xe0d724){_0xe0d724['rules']={};return new BPromise(function(_0x1e2044,_0x33bfd1){var _0x5a88e8={'Start':function(_0x4983e9){var _0x3a8385=this;return new Promise(function(_0x17c487,_0x3555ff){if(_0x4983e9){try{var _0x58dc8e=[];var _0x14b331=getId(_0x4983e9['channel'],_0x4983e9[_0x658e('0x11')]?_0x4983e9[_0x658e('0x11')]['id']:0x0,_0x4983e9[_0x658e('0x12')]?_0x4983e9[_0x658e('0x12')]['id']:0x0);var _0x23bb10=sUtils[_0x658e('0x13')](_0xe0d724,_0x4983e9);if(_0x4983e9['transfer']||!_0x23bb10&&_0x4983e9[_0x658e('0x14')]&&_[_0x658e('0x15')](_0x4983e9[_0x658e('0x14')])&&_0x4983e9[_0x658e('0x14')][_0x658e('0x16')]){for(var _0x544df0=0x0;_0x544df0<_0x4983e9['applications'][_0x658e('0x16')];_0x544df0+=0x1){var _0x1cc63d=_0x4983e9['applications'][_0x544df0];if(fs[_0x658e('0x17')](path[_0x658e('0x18')](__dirname,_0x658e('0x14'),_0x1cc63d[_0x658e('0x19')]+'.js'))){var _0xd9885d=[];switch(_0x1cc63d[_0x658e('0x19')][_0x658e('0x1a')]()){case _0x658e('0x1b'):var _0xe6cf1a=_0x1cc63d[_0x658e('0x1c')][_0x658e('0x1d')](',');if(_0x4983e9[_0x658e('0x1e')]===_0x658e('0x1f')){_0xd9885d[_0x658e('0x20')](_0xe6cf1a[0x0]);_0xd9885d[_0x658e('0x20')](_0xe6cf1a[0x1]);_0xd9885d['push'](_0xe6cf1a[_0x658e('0x21')](0x2,_0xe6cf1a[_0x658e('0x16')])['join'](','));}else{_0xd9885d[_0x658e('0x20')](_0xe6cf1a[0x0]);_0xd9885d[_0x658e('0x20')](_0xe6cf1a[_0x658e('0x21')](0x1,_0xe6cf1a[_0x658e('0x16')])[_0x658e('0x18')](','));}break;case _0x658e('0x22'):var _0x5d23dd=_0x1cc63d['appdata']['split'](',');_0xd9885d[_0x658e('0x20')](_0x5d23dd[0x0]);_0xd9885d[_0x658e('0x20')](_0x5d23dd[0x1]);_0xd9885d[_0x658e('0x20')](_0x5d23dd['slice'](0x2,_0x5d23dd[_0x658e('0x16')])[_0x658e('0x18')](','));break;case _0x658e('0x23'):var _0x4edddd=_0x1cc63d['appdata'][_0x658e('0x1d')](',');_0xd9885d['push'](_0x4edddd[0x0]);_0xd9885d[_0x658e('0x20')](_0x4edddd[0x1]);_0xd9885d[_0x658e('0x20')](_0x4edddd[0x2]);_0xd9885d[_0x658e('0x20')](_0x4edddd[0x3]);_0xd9885d[_0x658e('0x20')](_0x4edddd[_0x658e('0x21')](0x4,_0x4edddd[_0x658e('0x16')])[_0x658e('0x18')](','));break;case'amazonlex':var _0x4518fa=_0x1cc63d['appdata'][_0x658e('0x1d')](',');_0xd9885d[_0x658e('0x20')](_0x4518fa[0x0]);_0xd9885d['push'](_0x4518fa[0x1]);_0xd9885d[_0x658e('0x20')](_0x4518fa[0x2]);_0xd9885d[_0x658e('0x20')](_0x4518fa[0x3]);_0xd9885d[_0x658e('0x20')](_0x4518fa[_0x658e('0x21')](0x4,_0x4518fa['length'])['join'](','));break;case _0x658e('0x11'):_0xd9885d[_0x658e('0x20')](_0x1cc63d['appdata']);break;case'tag':_0xd9885d[_0x658e('0x20')](_0x1cc63d['TagId']);_0xd9885d[_0x658e('0x20')](_0x1cc63d[_0x658e('0x1c')]);break;case _0x658e('0x24'):var _0x5224d8=utils['getMustacheRender'](_0x4983e9[_0x658e('0x25')]['notificationTemplate'],_0x4983e9);var _0x1f881f=_0x1cc63d[_0x658e('0x1c')][_0x658e('0x1d')](',');_0xd9885d[_0x658e('0x20')](_0x1f881f[0x0]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x1]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x2]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x3]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x4]);_0xd9885d['push'](_0x1f881f[0x5]);_0xd9885d['push'](_0x1f881f[0x6]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x7]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x8]);_0xd9885d['push'](_0x1f881f[0x9]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0xa]);_0xd9885d[_0x658e('0x20')](_0x4983e9[_0x658e('0x12')]['id']);_0xd9885d['push'](_0x4983e9[_0x658e('0x11')]['id']);_0xd9885d['push'](_0x1cc63d[_0x658e('0x26')]);_0xd9885d[_0x658e('0x20')](_0x4983e9[_0x658e('0x12')][_0x658e('0x27')]);_0xd9885d[_0x658e('0x20')](_0x4983e9[_0x658e('0x28')][_0x658e('0x28')]);_0xd9885d['push'](_0x5224d8);break;default:_0xd9885d=_[_0x658e('0xb')](_0x1cc63d['appdata'])?[]:_0x1cc63d['appdata'][_0x658e('0x1d')](',');}var _0x378909={'id':util[_0x658e('0x29')](_0x658e('0x2a'),_0x14b331,_0x1cc63d['id'],_0x1cc63d[_0x658e('0x19')]),'condition':require(_0x658e('0x2b'))[_0x658e('0x2c')](_0x14b331,getIntervals(_0xe0d724[_0x658e('0x2d')],_0x1cc63d),_0xe0d724),'consequence':require('./applications/'+_0x1cc63d[_0x658e('0x19')])[_0x658e('0x2e')](_0x14b331,_0xd9885d,_0xe0d724,_0x4983e9),'p':_0x1cc63d['priority']||0x0};logger[_0x658e('0x2f')](_0x658e('0x30'),_0x378909['id'],_0x658e('0x31'),getIntervals(_0xe0d724['intervals'],_0x1cc63d)[_0x658e('0x18')](_0x658e('0x32')));_0x58dc8e[_0x658e('0x20')](_0x378909);}else{logger[_0x658e('0x33')](_0x658e('0x34'),path[_0x658e('0x18')](__dirname,'applications',_0x1cc63d['app']+'.js'));}}_0xe0d724['rules'][_0x14b331]=new RuleEngine(_0x58dc8e);_0xe0d724[_0x658e('0x35')][_0x14b331][_0x658e('0x36')](_0x4983e9,function(_0x1eca66){logger[_0x658e('0x2f')](_0x658e('0x37'),JSON['stringify'](_0x1eca66[_0x658e('0x38')]));if(_0xe0d724[_0x658e('0x35')][_0x14b331]){_0xe0d724[_0x658e('0x35')][_0x14b331]['emit'](_0x658e('0x39'));}});return _0x17c487({'code':0xc8,'message':_0x4983e9});}else{if(_0x23bb10){logger[_0x658e('0x2f')](util[_0x658e('0x29')](_0x658e('0x3a'),_0x14b331));}else{logger[_0x658e('0x2f')](_0x658e('0x3b'));}return _0x17c487({'code':0xc8,'message':_0x4983e9});}}catch(_0x3d3b16){logger[_0x658e('0x33')](_0x3d3b16['stack']);return _0x3555ff(_0x3a8385[_0x658e('0x33')](0x1f4,_0x3d3b16));}}return _0x3555ff(_0x658e('0x3c'));});},'AcceptMessage':function(_0x5a1703){var _0x4767d7=this;return new Promise(function(_0x51d21f,_0x240d42){if(_0x5a1703[_0x658e('0x3d')]&&_0x5a1703['agent']['id']){if(_0xe0d724[_0x658e('0x3e')][_0x5a1703['agent']['id']]){_0xe0d724[_0x658e('0x3e')][_0x5a1703[_0x658e('0x3d')]['id']]['busy']=![];_0xe0d724['agents'][_0x5a1703[_0x658e('0x3d')]['id']][_0x658e('0x3f')]=undefined;}}if(_0x5a1703[_0x658e('0x11')]&&_0x5a1703[_0x658e('0x11')]['id']){try{var _0x4a1a52=getId(_0x5a1703[_0x658e('0x1e')],_0x5a1703[_0x658e('0x11')]?_0x5a1703['message']['id']:0x0,_0x5a1703['interaction']?_0x5a1703['interaction']['id']:0x0);if(_0xe0d724[_0x658e('0x35')][_0x4a1a52]){_0xe0d724[_0x658e('0x35')][_0x4a1a52]['emit'](_0x658e('0x40'));if(rpc[_0x5a1703[_0x658e('0x1e')]+_0x658e('0x41')]){rpc[_0x5a1703[_0x658e('0x1e')]+'QueueReport'][_0x658e('0x42')](_0x4a1a52,{'UserId':_0x5a1703[_0x658e('0x11')][_0x658e('0x43')]})[_0x658e('0x44')](function(){logger[_0x658e('0x33')](_0x658e('0x45'));});}}return _0x51d21f({'code':0xc8,'message':_0x5a1703});}catch(_0x5a0321){logger['error'](_0x5a0321['stack']);return _0x240d42(_0x4767d7['error'](0x1f4,_0x5a0321));}}logger['error']('message\x20is\x20empty');return _0x240d42(_0x4767d7[_0x658e('0x33')](0x1f4,_0x658e('0x46')));});},'RejectMessage':function(_0x38e902){var _0x49d313=this;return new Promise(function(_0x2af3f7,_0xa7ea32){if(_0x38e902[_0x658e('0x3d')]&&_0x38e902[_0x658e('0x3d')]['id']){try{if(_0xe0d724[_0x658e('0x3e')][_0x38e902[_0x658e('0x3d')]['id']]){_0xe0d724[_0x658e('0x3e')][_0x38e902[_0x658e('0x3d')]['id']]['busy']=![];_0xe0d724[_0x658e('0x3e')][_0x38e902['agent']['id']][_0x658e('0x3f')]=undefined;}return _0x2af3f7({'code':0xc8,'message':_0x38e902});}catch(_0x501c59){logger[_0x658e('0x33')](_0x501c59[_0x658e('0x47')]);return _0xa7ea32(_0x49d313[_0x658e('0x33')](0x1f4,_0x501c59));}}logger[_0x658e('0x33')](_0x658e('0x46'));return _0xa7ea32(_0x49d313[_0x658e('0x33')](0x1f4,_0x658e('0x46')));});},'AbandonInteraction':function(_0x100cba){var _0x1c8989=this;return new Promise(function(_0x22d50f,_0x464b65){if(_0x100cba[_0x658e('0x1e')]&&_0x100cba['interaction']&&_0x100cba['interaction']['id']){try{var _0x591991=getId(_0x100cba[_0x658e('0x1e')],_0x100cba[_0x658e('0x11')]?_0x100cba[_0x658e('0x11')]['id']:0x0,_0x100cba[_0x658e('0x12')]?_0x100cba[_0x658e('0x12')]['id']:0x0);if(_0xe0d724[_0x658e('0x35')][_0x591991]){_0xe0d724[_0x658e('0x35')][_0x591991][_0x658e('0x48')](_0x658e('0x40'));}return _0x22d50f({'code':0xc8,'message':_0x100cba});}catch(_0x218e39){logger[_0x658e('0x33')](_0x218e39[_0x658e('0x47')]);return _0x464b65(_0x1c8989[_0x658e('0x33')](0x1f4,_0x218e39));}}logger[_0x658e('0x33')](_0x658e('0x46'));return _0x464b65(_0x1c8989[_0x658e('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xe7db6){var _0x5b096c=this;return new Promise(function(_0x134411,_0x22b776){if(_0xe0d724[_0x658e('0x3e')][_0x658e('0x49')](_0xe7db6['id'])){for(var _0x212293 in _0xe7db6[_0x658e('0x4a')]){if(_0xe7db6[_0x658e('0x4a')][_0x658e('0x49')](_0x212293)){if(_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']][_0x658e('0x49')](_0x212293+_0x658e('0x4b'))){_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']][_0x212293+_0x658e('0x4b')]=parseInt(_0xe7db6[_0x658e('0x4a')][_0x212293],0xa);}}}_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']][_0x658e('0x4c')]();return _0x134411({'code':0xc8,'message':_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']]});}else{return _0x22b776(_0x5b096c['error'](0x1f4,_0x658e('0x4d')));}});},'Agents':function(_0x3888b4){return new Promise(function(_0x510a10){var _0xffc528=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x3e')]);if(_0x3888b4&&_0x3888b4['id']){var _0x1638e0=_['find'](_0xffc528,function(_0xcae6df){return _0xcae6df['id']===_0x3888b4['id'];});_0x510a10(_0x1638e0);}else{_0x510a10({'count':_0xffc528[_0x658e('0x16')],'rows':_0xffc528});}});},'ChatQueues':function(){return new Promise(function(_0x7bc1a8){var _0x5bdb2f=[];for(var _0x4b688e in _0xe0d724[_0x658e('0x4f')]){if(_0xe0d724[_0x658e('0x4f')][_0x658e('0x49')](_0x4b688e)){var _0x4ccb4e=_0xe0d724[_0x658e('0x4f')][_0x4b688e];var _0x1a3372={'id':_0x4ccb4e['id'],'available':_0x4ccb4e[_0x658e('0x50')],'loggedIn':_0x4ccb4e[_0x658e('0x51')],'name':_0x4ccb4e[_0x658e('0x52')],'paused':_0x4ccb4e[_0x658e('0x53')],'waiting':_0x4ccb4e[_0x658e('0x54')]};_0x5bdb2f[_0x658e('0x20')](_0x1a3372);}}_0x7bc1a8({'count':_0x5bdb2f[_0x658e('0x16')],'rows':_0x5bdb2f});});},'MailQueues':function(){return new Promise(function(_0x56fce9){var _0x1ca7f5=[];for(var _0x3b12cb in _0xe0d724['mailQueues']){if(_0xe0d724[_0x658e('0x55')]['hasOwnProperty'](_0x3b12cb)){var _0x556e61=_0xe0d724[_0x658e('0x55')][_0x3b12cb];var _0x9503e0={'id':_0x556e61['id'],'available':_0x556e61['available'],'loggedIn':_0x556e61['loggedIn'],'name':_0x556e61['name'],'paused':_0x556e61[_0x658e('0x53')],'waiting':_0x556e61[_0x658e('0x54')]};_0x1ca7f5[_0x658e('0x20')](_0x9503e0);}}_0x56fce9({'count':_0x1ca7f5[_0x658e('0x16')],'rows':_0x1ca7f5});});},'OpenchannelQueues':function(){return new Promise(function(_0xe4e9d){var _0x163af3=[];for(var _0x25cbf6 in _0xe0d724[_0x658e('0x56')]){if(_0xe0d724[_0x658e('0x56')]['hasOwnProperty'](_0x25cbf6)){var _0x37b09e=_0xe0d724[_0x658e('0x56')][_0x25cbf6];var _0x32f51a={'id':_0x37b09e['id'],'available':_0x37b09e['available'],'loggedIn':_0x37b09e[_0x658e('0x51')],'name':_0x37b09e['name'],'paused':_0x37b09e[_0x658e('0x53')],'waiting':_0x37b09e['waiting']};_0x163af3[_0x658e('0x20')](_0x32f51a);}}_0xe4e9d({'count':_0x163af3[_0x658e('0x16')],'rows':_0x163af3});});},'SmsQueues':function(){return new Promise(function(_0x2596a4){var _0x322124=[];for(var _0x14d4c4 in _0xe0d724[_0x658e('0x57')]){if(_0xe0d724[_0x658e('0x57')]['hasOwnProperty'](_0x14d4c4)){var _0x4d046e=_0xe0d724['smsQueues'][_0x14d4c4];var _0x239a93={'id':_0x4d046e['id'],'available':_0x4d046e[_0x658e('0x50')],'loggedIn':_0x4d046e[_0x658e('0x51')],'name':_0x4d046e['name'],'paused':_0x4d046e[_0x658e('0x53')],'waiting':_0x4d046e[_0x658e('0x54')]};_0x322124[_0x658e('0x20')](_0x239a93);}}_0x2596a4({'count':_0x322124[_0x658e('0x16')],'rows':_0x322124});});},'FaxQueues':function(){return new Promise(function(_0x5e6d14){var _0x3621ef=[];for(var _0x513a39 in _0xe0d724[_0x658e('0x58')]){if(_0xe0d724['faxQueues']['hasOwnProperty'](_0x513a39)){var _0x1ca6e0=_0xe0d724[_0x658e('0x58')][_0x513a39];var _0x3d39d5={'id':_0x1ca6e0['id'],'available':_0x1ca6e0['available'],'loggedIn':_0x1ca6e0[_0x658e('0x51')],'name':_0x1ca6e0['name'],'paused':_0x1ca6e0['paused'],'waiting':_0x1ca6e0[_0x658e('0x54')]};_0x3621ef[_0x658e('0x20')](_0x3d39d5);}}_0x5e6d14({'count':_0x3621ef[_0x658e('0x16')],'rows':_0x3621ef});});},'WhatsappQueues':function(){return new Promise(function(_0x55c512){var _0x5f32d0=[];for(var _0x5adcb2 in _0xe0d724['whatsappQueues']){if(_0xe0d724[_0x658e('0x59')][_0x658e('0x49')](_0x5adcb2)){var _0x36621c=_0xe0d724[_0x658e('0x59')][_0x5adcb2];var _0xa3241b={'id':_0x36621c['id'],'available':_0x36621c['available'],'loggedIn':_0x36621c[_0x658e('0x51')],'name':_0x36621c['name'],'paused':_0x36621c['paused'],'waiting':_0x36621c[_0x658e('0x54')]};_0x5f32d0[_0x658e('0x20')](_0xa3241b);}}_0x55c512({'count':_0x5f32d0[_0x658e('0x16')],'rows':_0x5f32d0});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x133216){var _0x1e074b=_[_0x658e('0x4e')](_0xe0d724['chatQueuesWaitingInteractions']);_0x133216({'count':_0x1e074b[_0x658e('0x16')],'rows':_0x1e074b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2dc790){var _0x3e3620=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x5a')]);_0x2dc790({'count':_0x3e3620[_0x658e('0x16')],'rows':_0x3e3620});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x564560){var _0x579f1a=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x5b')]);_0x564560({'count':_0x579f1a[_0x658e('0x16')],'rows':_0x579f1a});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x541a5e){var _0x16369d=_['values'](_0xe0d724[_0x658e('0x5c')]);_0x541a5e({'count':_0x16369d['length'],'rows':_0x16369d});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3237d4){var _0x16157c=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x5d')]);_0x3237d4({'count':_0x16157c[_0x658e('0x16')],'rows':_0x16157c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3ab042){var _0x3e7df6=_[_0x658e('0x4e')](_0xe0d724['whatsappQueuesWaitingInteractions']);_0x3ab042({'count':_0x3e7df6[_0x658e('0x16')],'rows':_0x3e7df6});});}};var _0x4c6a02=jayson[_0x658e('0x5e')](_0x5a88e8)['http']();_0x4c6a02['on'](_0x658e('0x33'),function(_0xf4cfb8){logger[_0x658e('0x33')](JSON[_0x658e('0x5f')](_0xf4cfb8));return _0x33bfd1(_0xf4cfb8);});_0x4c6a02[_0x658e('0x10')](0x232c,_0x658e('0x60'),function(){console[_0x658e('0x61')](_0x658e('0x62'),0x232c);return _0x1e2044(_0x658e('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index ffcce08..5b1af1c 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 _0x744f=['info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','jayson/promise','lodash','../../../config/logger','routing','client','request','then','message','result','catch','rules','stop','length','push','format','iftime\x20%s','all','some'];(function(_0x216bda,_0x103366){var _0x176777=function(_0x2a75aa){while(--_0x2a75aa){_0x216bda['push'](_0x216bda['shift']());}};_0x176777(++_0x103366);}(_0x744f,0x10e));var _0xf744=function(_0x5463e4,_0x2adedf){_0x5463e4=_0x5463e4-0x0;var _0x2f8334=_0x744f[_0x5463e4];return _0x2f8334;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xf744('0x0'));var _=require(_0xf744('0x1'));var logger=require(_0xf744('0x2'))(_0xf744('0x3'));var client=jayson[_0xf744('0x4')]['http']({'port':0x232a});function request(_0x817a45,_0x4513a0){return new BPromise(function(_0xdc004e,_0x2a0003){return client[_0xf744('0x5')](_0x817a45,_0x4513a0)[_0xf744('0x6')](function(_0x980e06){if(_0x980e06['error']){return _0x2a0003(_0x980e06['error'][_0xf744('0x7')]);}else{return _0xdc004e(_0x980e06[_0xf744('0x8')]);}})[_0xf744('0x9')](function(_0x52b943){return _0x2a0003(_0x52b943);});});}exports['condition']=function(_0x30387b,_0x1719ca,_0x258367){return function(_0x11641d){if(_0x258367[_0xf744('0xa')]&&!_0x258367['rules'][_0x30387b]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x30387b);return _0x11641d[_0xf744('0xb')]();}var _0x44b7f8=[];for(var _0x58da34=0x0;_0x58da34<_0x1719ca[_0xf744('0xc')];_0x58da34+=0x1){_0x44b7f8[_0xf744('0xd')](request('Command',{'command':util[_0xf744('0xe')](_0xf744('0xf'),_0x1719ca[_0x58da34])})['then'](function(_0x5b36b0){return _0x5b36b0&&_0x5b36b0[_0xf744('0x7')]&&_0x5b36b0[_0xf744('0x7')]['indexOf']('true')>=0x0?!![]:![];})[_0xf744('0x9')](function(){logger['error']('[%s][INTERVAL]\x20%s',_0x30387b,_0x1719ca[_0x58da34]);}));}BPromise[_0xf744('0x10')](_0x44b7f8)[_0xf744('0x6')](function(_0x515bd1){var _0x6c3d19=_[_0xf744('0x11')](_0x515bd1);logger[_0xf744('0x12')](_0xf744('0x13'),_0x30387b,_0x1719ca[_0xf744('0x14')](_0xf744('0x15')),_0x6c3d19);_0x11641d[_0xf744('0x16')](_0x6c3d19);})[_0xf744('0x9')](function(_0x42c9f3){logger['error'](_0xf744('0x13'),_0x30387b,_0x1719ca[_0xf744('0x14')](_0xf744('0x15')),_0x42c9f3[_0xf744('0x17')]);_0x11641d[_0xf744('0xb')]();});};}; \ No newline at end of file +var _0xcbb5=['request','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','client','http'];(function(_0x3cfe06,_0x336518){var _0x57a4dd=function(_0xd928f1){while(--_0xd928f1){_0x3cfe06['push'](_0x3cfe06['shift']());}};_0x57a4dd(++_0x336518);}(_0xcbb5,0x1e7));var _0x5cbb=function(_0x1a467c,_0x2d88dc){_0x1a467c=_0x1a467c-0x0;var _0x6cba0=_0xcbb5[_0x1a467c];return _0x6cba0;};'use strict';var util=require(_0x5cbb('0x0'));var BPromise=require(_0x5cbb('0x1'));var jayson=require(_0x5cbb('0x2'));var _=require(_0x5cbb('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x5cbb('0x4')][_0x5cbb('0x5')]({'port':0x232a});function request(_0x5008c4,_0x2ab74){return new BPromise(function(_0x26a2e9,_0x105c45){return client[_0x5cbb('0x6')](_0x5008c4,_0x2ab74)['then'](function(_0x53e688){if(_0x53e688[_0x5cbb('0x7')]){return _0x105c45(_0x53e688[_0x5cbb('0x7')][_0x5cbb('0x8')]);}else{return _0x26a2e9(_0x53e688[_0x5cbb('0x9')]);}})[_0x5cbb('0xa')](function(_0x45b1b9){return _0x105c45(_0x45b1b9);});});}exports[_0x5cbb('0xb')]=function(_0x2be9e5,_0x1af5d9,_0x5bcd91){return function(_0x3cacd7){if(_0x5bcd91[_0x5cbb('0xc')]&&!_0x5bcd91['rules'][_0x2be9e5]){logger['info'](_0x5cbb('0xd'),_0x2be9e5);return _0x3cacd7[_0x5cbb('0xe')]();}var _0x1cea66=[];for(var _0x5134dc=0x0;_0x5134dc<_0x1af5d9[_0x5cbb('0xf')];_0x5134dc+=0x1){_0x1cea66['push'](request(_0x5cbb('0x10'),{'command':util[_0x5cbb('0x11')](_0x5cbb('0x12'),_0x1af5d9[_0x5134dc])})[_0x5cbb('0x13')](function(_0x48ffb3){return _0x48ffb3&&_0x48ffb3[_0x5cbb('0x8')]&&_0x48ffb3[_0x5cbb('0x8')][_0x5cbb('0x14')](_0x5cbb('0x15'))>=0x0?!![]:![];})[_0x5cbb('0xa')](function(){logger[_0x5cbb('0x7')](_0x5cbb('0x16'),_0x2be9e5,_0x1af5d9[_0x5134dc]);}));}BPromise[_0x5cbb('0x17')](_0x1cea66)[_0x5cbb('0x13')](function(_0xc09f3c){var _0x47f158=_[_0x5cbb('0x18')](_0xc09f3c);logger['info'](_0x5cbb('0x19'),_0x2be9e5,_0x1af5d9[_0x5cbb('0x1a')](_0x5cbb('0x1b')),_0x47f158);_0x3cacd7['when'](_0x47f158);})[_0x5cbb('0xa')](function(_0x3cb0fc){logger[_0x5cbb('0x7')](_0x5cbb('0x19'),_0x2be9e5,_0x1af5d9[_0x5cbb('0x1a')](_0x5cbb('0x1b')),_0x3cb0fc[_0x5cbb('0x1c')]);_0x3cacd7[_0x5cbb('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 1bdc64f..67364f5 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 _0x69d3=['isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','./utils','info','uniqueid','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','destuniqueid','called','connectedlinename','error','agentringnoanswer'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x69d3,0xda));var _0x369d=function(_0x593c9a,_0x444a1e){_0x593c9a=_0x593c9a-0x0;var _0x2bb253=_0x69d3[_0x593c9a];return _0x2bb253;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var utils=require(_0x369d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x52c3ba,_0x47591f){utils[_0x369d('0x3')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x52c3ba[_0x369d('0x4')],_0x52c3ba['channel'],_0x52c3ba['queue'],_0x52c3ba[_0x369d('0x5')],_0x52c3ba[_0x369d('0x6')],_0x52c3ba[_0x369d('0x7')],_0x52c3ba[_0x369d('0x8')],_0x52c3ba[_0x369d('0x9')]));if(_0x52c3ba[_0x369d('0xa')]){utils[_0x369d('0xb')](_0x52c3ba[_0x369d('0xa')])[_0x369d('0xc')](function(_0x580727){if(_0x580727){_0x52c3ba['type']=_0x580727[_0x369d('0xd')];_0x52c3ba[_0x369d('0xe')]=_0x52c3ba[_0x369d('0xf')]?_0x580727[_0x369d('0x10')]:![];_0x52c3ba['acwtime']=_0x52c3ba['agentacw']?_0x580727[_0x369d('0x11')]:0x0;}utils[_0x369d('0x12')](_0x369d('0x13'),_0x52c3ba);});}else{utils[_0x369d('0x12')](_0x369d('0x13'),_0x52c3ba);}if(_0x47591f){delete transfers[_0x52c3ba[_0x369d('0x4')]];}else{delete agents[_0x52c3ba['destuniqueid']];}}exports[_0x369d('0x14')]=function(_0x9d016){try{utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x17'),_0x9d016['uniqueid']),_0x9d016);agents[_0x9d016['destuniqueid']]=_0x9d016;agents[_0x9d016['destuniqueid']][_0x369d('0x18')]=utils[_0x369d('0x19')]();agents[_0x9d016[_0x369d('0x1a')]]['lastevent']=_0x369d('0x1b');agents[_0x9d016[_0x369d('0x1a')]][_0x369d('0x8')]=null;agents[_0x9d016['destuniqueid']][_0x369d('0x1c')]=null;utils[_0x369d('0x3')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x9d016['uniqueid'],agents[_0x9d016[_0x369d('0x1a')]][_0x369d('0x5')],_0x9d016[_0x369d('0x1a')]));}catch(_0x4ddcb2){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x17'),_0x9d016[_0x369d('0x4')]),_0x4ddcb2);}};exports[_0x369d('0x1e')]=function(_0x538ca4){try{if(!_[_0x369d('0x1f')](agents[_0x538ca4[_0x369d('0x1a')]])){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x20'),_0x538ca4[_0x369d('0x4')]),_0x538ca4);utils[_0x369d('0x3')](util[_0x369d('0x16')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x538ca4['uniqueid'],agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x5')],_0x538ca4[_0x369d('0x1a')]));agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x1e')]=!![];agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x21')]=utils['now']();agents[_0x538ca4['destuniqueid']][_0x369d('0x9')]=_0x369d('0x22');agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x23')]=_0x369d('0x22');agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x24')]=_0x538ca4['ringtime']?parseInt(_0x538ca4[_0x369d('0x25')])/0x3e8:0x0;agents[_0x538ca4[_0x369d('0x1a')]][_0x369d('0x26')]=0x0;unanswered[_0x369d('0x27')](_0x538ca4[_0x369d('0x1a')]);}}catch(_0x41367a){utils[_0x369d('0x1d')](util['format'](_0x369d('0x20'),_0x538ca4['uniqueid']),_0x41367a);}};exports['queuecallerabandon']=function(_0x38feda){try{_[_0x369d('0x28')](agents,function(_0x5844c7,_0x104540){if(_0x5844c7['uniqueid']==_0x38feda[_0x369d('0x4')]&&!_[_0x369d('0x29')](unanswered,_0x5844c7[_0x369d('0x1a')])){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x2a'),_0x38feda[_0x369d('0x4')]),_0x38feda);utils['info'](util[_0x369d('0x16')](_0x369d('0x2b'),_0x38feda[_0x369d('0x4')],_0x5844c7[_0x369d('0x5')],_0x5844c7[_0x369d('0x1a')]));_0x5844c7[_0x369d('0x1e')]=!![];_0x5844c7[_0x369d('0x21')]=utils[_0x369d('0x19')]();_0x5844c7['lastevent']=_0x369d('0x2c');_0x5844c7[_0x369d('0x23')]=_0x369d('0x2c');_0x5844c7[_0x369d('0x24')]=_0x38feda[_0x369d('0x24')];_0x5844c7['talktime']=0x0;writeDB(_0x5844c7);}});}catch(_0x35f326){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x2a'),_0x38feda[_0x369d('0x4')]),_0x35f326);}};exports[_0x369d('0x2d')]=function(_0x50c033){try{if(agents[_0x50c033[_0x369d('0x1a')]]){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x2e'),_0x50c033[_0x369d('0x4')]),_0x50c033);utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x2f'),_0x50c033[_0x369d('0x4')],agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x5')],_0x50c033[_0x369d('0x1a')]));agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x30')]=utils[_0x369d('0x19')]();agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x8')]=_0x50c033[_0x369d('0x8')];agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x1c')]=_0x50c033[_0x369d('0x1c')];agents[_0x50c033[_0x369d('0x1a')]][_0x369d('0x24')]=_0x50c033[_0x369d('0x25')];agents[_0x50c033['destuniqueid']]['lastevent']=_0x369d('0x31');_[_0x369d('0x28')](agents,function(_0x8a1ef5,_0x401bc7){if(_0x8a1ef5[_0x369d('0x1a')]!=_0x50c033[_0x369d('0x1a')]&&_0x8a1ef5[_0x369d('0x4')]==_0x50c033[_0x369d('0x4')]){_0x8a1ef5[_0x369d('0x26')]=0x0;_0x8a1ef5['holdtime']=_0x50c033[_0x369d('0x25')];_0x8a1ef5[_0x369d('0x1e')]=!![];_0x8a1ef5[_0x369d('0x21')]=utils[_0x369d('0x19')]();_0x8a1ef5[_0x369d('0x9')]=_0x369d('0x32');_0x8a1ef5[_0x369d('0x23')]=_0x369d('0x32');_0x8a1ef5['answeredelsewheredestinationuniqueid']=_0x50c033['destuniqueid'];_0x8a1ef5[_0x369d('0x33')]=_0x50c033[_0x369d('0x5')];writeDB(_0x8a1ef5);}});}}catch(_0x30909a){utils['error'](util['format']('[%s][agents][agentconnect]',_0x50c033[_0x369d('0x4')]),_0x30909a);}};exports[_0x369d('0xf')]=function(_0x55dfde){try{if(!_[_0x369d('0x1f')](agents[_0x55dfde[_0x369d('0x1a')]])){utils[_0x369d('0x15')](util[_0x369d('0x16')]('[%s][agents][agentcomplete]',_0x55dfde[_0x369d('0x4')]),_0x55dfde);utils['info'](util[_0x369d('0x16')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x55dfde[_0x369d('0x4')],agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x5')],_0x55dfde['destuniqueid']));agents[_0x55dfde['destuniqueid']][_0x369d('0xf')]=!![];agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x34')]=utils['now']();agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x26')]=utils[_0x369d('0x35')](agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x34')],agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x30')]);agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x23')]=_0x55dfde['reason'];agents[_0x55dfde[_0x369d('0x1a')]][_0x369d('0x9')]=_0x369d('0x36');writeDB(agents[_0x55dfde[_0x369d('0x1a')]]);}}catch(_0x27e2c7){utils[_0x369d('0x1d')](util['format'](_0x369d('0x37'),_0x55dfde[_0x369d('0x4')]),_0x27e2c7);}};exports[_0x369d('0x38')]=function(_0x44a357){try{if(!_[_0x369d('0x1f')](agents[_0x44a357[_0x369d('0x39')]])){utils[_0x369d('0x15')](util[_0x369d('0x16')](_0x369d('0x3a'),_0x44a357[_0x369d('0x4')]),_0x44a357);utils[_0x369d('0x3')](util[_0x369d('0x16')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x44a357[_0x369d('0x4')],agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x5')],agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x4')]));agents[_0x44a357['transfereruniqueid']][_0x369d('0x3b')]=!![];agents[_0x44a357['transfereruniqueid']][_0x369d('0x3c')]=_0x369d('0x3d');agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x3e')]=_0x44a357[_0x369d('0x3f')];agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x40')]=agents[_0x44a357[_0x369d('0x39')]][_0x369d('0x4')];}}catch(_0x9f1544){utils['error'](util['format'](_0x369d('0x3a'),_0x44a357[_0x369d('0x4')]),_0x9f1544);}};exports[_0x369d('0x41')]=function(_0x4226de){try{utils[_0x369d('0x15')](util['format']('[%s][agents][attendedtransfer]',_0x4226de[_0x369d('0x42')]),_0x4226de);if(_0x4226de[_0x369d('0x42')]==_0x4226de['origtransfererlinkedid']){if(!_[_0x369d('0x1f')](agents[_0x4226de['secondtransfereruniqueid']])){utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x43'),_0x4226de['origtransfereruniqueid'],agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x5')]));agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x3b')]=!![];agents[_0x4226de['secondtransfereruniqueid']]['transfertype']=_0x369d('0x45');agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x3e')]=_0x4226de['origtransfererexten'];agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x40')]=_0x4226de[_0x369d('0x42')];}if(_0x4226de['transfereeuniqueid']&&agents[_0x4226de['transfereeuniqueid']]){agents[_0x4226de[_0x369d('0x46')]][_0x369d('0x47')]=0x1;transfers[_0x4226de[_0x369d('0x46')]]=_[_0x369d('0x48')](agents[_0x4226de['transfereeuniqueid']]);transfers[_0x4226de[_0x369d('0x46')]][_0x369d('0x7')]=agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x7')];transfers[_0x4226de[_0x369d('0x46')]]['calleridname']=agents[_0x4226de[_0x369d('0x44')]][_0x369d('0x49')];transfers[_0x4226de[_0x369d('0x46')]]['agentcalledAt']=utils[_0x369d('0x19')]();transfers[_0x4226de['transfereeuniqueid']][_0x369d('0x30')]=utils['now']();transfers[_0x4226de['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x4226de['transfereeuniqueid']][_0x369d('0x47')]=0x2;}}else if(_0x4226de['secondtransfereruniqueid']==_0x4226de[_0x369d('0x4a')]){if(!_['isNil'](agents[_0x4226de[_0x369d('0x42')]])){utils[_0x369d('0x3')](util[_0x369d('0x16')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x4226de[_0x369d('0x42')],agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x5')]));agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x3b')]=!![];agents[_0x4226de[_0x369d('0x42')]]['transfertype']=_0x369d('0x45');agents[_0x4226de['origtransfereruniqueid']]['transferexten']=_0x4226de['secondtransfererexten'];agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x40')]=_0x4226de[_0x369d('0x44')];}if(_0x4226de[_0x369d('0x4b')]&&agents[_0x4226de[_0x369d('0x4b')]]){agents[_0x4226de[_0x369d('0x4b')]][_0x369d('0x47')]=0x1;transfers[_0x4226de[_0x369d('0x4b')]]=_[_0x369d('0x48')](agents[_0x4226de[_0x369d('0x4b')]]);transfers[_0x4226de[_0x369d('0x4b')]][_0x369d('0x7')]=agents[_0x4226de[_0x369d('0x42')]][_0x369d('0x7')];transfers[_0x4226de[_0x369d('0x4b')]][_0x369d('0x49')]=agents[_0x4226de['origtransfereruniqueid']][_0x369d('0x49')];transfers[_0x4226de['transfertargetuniqueid']][_0x369d('0x18')]=utils[_0x369d('0x19')]();transfers[_0x4226de[_0x369d('0x4b')]][_0x369d('0x30')]=utils[_0x369d('0x19')]();transfers[_0x4226de['transfertargetuniqueid']][_0x369d('0x24')]=0x0;transfers[_0x4226de['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x3ee715){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x4c'),_0x4226de[_0x369d('0x42')]),_0x3ee715);}};exports[_0x369d('0x4d')]=function(_0x341d93){try{utils[_0x369d('0x15')](util['format'](_0x369d('0x4e'),_0x341d93[_0x369d('0x4')]),_0x341d93);if(agents[_0x341d93['uniqueid']]&&agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x23')]===_0x369d('0x22')){if(_0x341d93['cause']==='21'){agents[_0x341d93[_0x369d('0x4')]]['reason']=_0x369d('0x4f');agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x9')]=_0x369d('0x4f');}utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x50'),_0x341d93['uniqueid'],agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x5')],agents[_0x341d93['uniqueid']][_0x369d('0x23')],agents[_0x341d93['uniqueid']][_0x369d('0x9')]));writeDB(agents[_0x341d93[_0x369d('0x4')]]);var _0x2b7897=unanswered['indexOf'](_0x341d93[_0x369d('0x4')]);if(_0x2b7897>-0x1){unanswered[_0x369d('0x51')](_0x2b7897,0x1);}}if(transfers[_0x341d93['uniqueid']]){transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0xf')]=!![];transfers[_0x341d93[_0x369d('0x4')]]['agentcompleteAt']=utils[_0x369d('0x19')]();transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x26')]=utils[_0x369d('0x35')](transfers[_0x341d93[_0x369d('0x4')]]['agentcompleteAt'],transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x30')]);transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x23')]=_0x369d('0x52');transfers[_0x341d93['uniqueid']]['lastevent']=_0x369d('0x36');utils[_0x369d('0x3')](util[_0x369d('0x16')](_0x369d('0x50'),_0x341d93[_0x369d('0x4')],transfers[_0x341d93[_0x369d('0x4')]]['membername'],transfers[_0x341d93[_0x369d('0x4')]][_0x369d('0x23')],transfers[_0x341d93['uniqueid']][_0x369d('0x9')]));writeDB(transfers[_0x341d93['uniqueid']],!![]);}if(agents[_0x341d93[_0x369d('0x4')]]&&agents[_0x341d93['uniqueid']][_0x369d('0x30')]){agents[_0x341d93[_0x369d('0x4')]]['agentcomplete']=!![];agents[_0x341d93[_0x369d('0x4')]]['agentcompleteAt']=utils[_0x369d('0x19')]();agents[_0x341d93['uniqueid']]['talktime']=utils[_0x369d('0x35')](agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x34')],agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x30')]);agents[_0x341d93['uniqueid']][_0x369d('0x23')]=agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x3b')]?_0x369d('0x3b'):_0x369d('0x52');agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x9')]=_0x369d('0x36');utils[_0x369d('0x3')](util['format'](_0x369d('0x50'),_0x341d93[_0x369d('0x4')],agents[_0x341d93[_0x369d('0x4')]][_0x369d('0x5')],agents[_0x341d93['uniqueid']][_0x369d('0x23')],agents[_0x341d93['uniqueid']][_0x369d('0x9')]));writeDB(agents[_0x341d93[_0x369d('0x4')]]);}}catch(_0x34a225){utils[_0x369d('0x1d')](util[_0x369d('0x16')](_0x369d('0x4e'),_0x341d93[_0x369d('0x4')]),_0x34a225);}}; \ No newline at end of file +var _0x2750=['calleridnum','connectedlinenum','lastevent','then','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','forIn','talktime','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','agentcomplete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','[%s][agents][hangup]','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername'];(function(_0x581382,_0x485ffa){var _0x4184e8=function(_0x584d7c){while(--_0x584d7c){_0x581382['push'](_0x581382['shift']());}};_0x4184e8(++_0x485ffa);}(_0x2750,0x13b));var _0x0275=function(_0x371b0f,_0x52be35){_0x371b0f=_0x371b0f-0x0;var _0x13a99d=_0x2750[_0x371b0f];return _0x13a99d;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var utils=require(_0x0275('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xf2ae71,_0x372744){utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x4'),_0xf2ae71[_0x0275('0x5')],_0xf2ae71[_0x0275('0x6')],_0xf2ae71[_0x0275('0x7')],_0xf2ae71[_0x0275('0x8')],_0xf2ae71['interface'],_0xf2ae71[_0x0275('0x9')],_0xf2ae71[_0x0275('0xa')],_0xf2ae71[_0x0275('0xb')]));if(_0xf2ae71[_0x0275('0x7')]){utils['getVoiceQueueByName'](_0xf2ae71[_0x0275('0x7')])[_0x0275('0xc')](function(_0x42ae73){if(_0x42ae73){_0xf2ae71['type']=_0x42ae73['type'];_0xf2ae71[_0x0275('0xd')]=_0xf2ae71['agentcomplete']?_0x42ae73[_0x0275('0xe')]:![];_0xf2ae71[_0x0275('0xf')]=_0xf2ae71[_0x0275('0xd')]?_0x42ae73[_0x0275('0x10')]:0x0;}utils[_0x0275('0x11')]('CreateVoiceAgentReport',_0xf2ae71);});}else{utils[_0x0275('0x11')](_0x0275('0x12'),_0xf2ae71);}if(_0x372744){delete transfers[_0xf2ae71[_0x0275('0x5')]];}else{delete agents[_0xf2ae71['destuniqueid']];}}exports['agentcalled']=function(_0x292f93){try{utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x14'),_0x292f93[_0x0275('0x5')]),_0x292f93);agents[_0x292f93[_0x0275('0x15')]]=_0x292f93;agents[_0x292f93['destuniqueid']][_0x0275('0x16')]=utils[_0x0275('0x17')]();agents[_0x292f93['destuniqueid']][_0x0275('0xb')]=_0x0275('0x18');agents[_0x292f93['destuniqueid']][_0x0275('0xa')]=null;agents[_0x292f93[_0x0275('0x15')]]['connectedlinename']=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x292f93['uniqueid'],agents[_0x292f93[_0x0275('0x15')]][_0x0275('0x8')],_0x292f93[_0x0275('0x15')]));}catch(_0x5b2a4c){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x14'),_0x292f93['uniqueid']),_0x5b2a4c);}};exports[_0x0275('0x1a')]=function(_0x402f0d){try{if(!_['isNil'](agents[_0x402f0d['destuniqueid']])){utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x1b'),_0x402f0d['uniqueid']),_0x402f0d);utils[_0x0275('0x2')](util['format'](_0x0275('0x1c'),_0x402f0d['uniqueid'],agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x8')],_0x402f0d['destuniqueid']));agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x1a')]=!![];agents[_0x402f0d[_0x0275('0x15')]]['agentringnoanswerAt']=utils[_0x0275('0x17')]();agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0xb')]=_0x0275('0x1d');agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x1e')]='timeout';agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x1f')]=_0x402f0d[_0x0275('0x20')]?parseInt(_0x402f0d[_0x0275('0x20')])/0x3e8:0x0;agents[_0x402f0d[_0x0275('0x15')]]['talktime']=0x0;unanswered[_0x0275('0x21')](_0x402f0d[_0x0275('0x15')]);}}catch(_0x3246ea){utils[_0x0275('0x19')](util[_0x0275('0x3')]('[%s][agents][agentringnoanswer]',_0x402f0d[_0x0275('0x5')]),_0x3246ea);}};exports[_0x0275('0x22')]=function(_0x127bbd){try{_['forIn'](agents,function(_0x5e2e22,_0x3cb2d7){if(_0x5e2e22[_0x0275('0x5')]==_0x127bbd['uniqueid']&&!_[_0x0275('0x23')](unanswered,_0x5e2e22[_0x0275('0x15')])){utils[_0x0275('0x13')](util[_0x0275('0x3')]('[%s][agents][queuecallerabandon]',_0x127bbd[_0x0275('0x5')]),_0x127bbd);utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x24'),_0x127bbd['uniqueid'],_0x5e2e22[_0x0275('0x8')],_0x5e2e22['destuniqueid']));_0x5e2e22[_0x0275('0x1a')]=!![];_0x5e2e22['agentringnoanswerAt']=utils[_0x0275('0x17')]();_0x5e2e22[_0x0275('0xb')]='abandoned';_0x5e2e22[_0x0275('0x1e')]=_0x0275('0x25');_0x5e2e22[_0x0275('0x1f')]=_0x127bbd[_0x0275('0x1f')];_0x5e2e22['talktime']=0x0;writeDB(_0x5e2e22);}});}catch(_0x5040de){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x26'),_0x127bbd[_0x0275('0x5')]),_0x5040de);}};exports['agentconnect']=function(_0x2a18c3){try{if(agents[_0x2a18c3[_0x0275('0x15')]]){utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x27'),_0x2a18c3[_0x0275('0x5')]),_0x2a18c3);utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x28'),_0x2a18c3[_0x0275('0x5')],agents[_0x2a18c3[_0x0275('0x15')]]['membername'],_0x2a18c3[_0x0275('0x15')]));agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0x29')]=utils[_0x0275('0x17')]();agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0xa')]=_0x2a18c3[_0x0275('0xa')];agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0x2a')]=_0x2a18c3[_0x0275('0x2a')];agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0x1f')]=_0x2a18c3[_0x0275('0x20')];agents[_0x2a18c3[_0x0275('0x15')]]['lastevent']=_0x0275('0x2b');_[_0x0275('0x2c')](agents,function(_0x4d2d59,_0x31d0ab){if(_0x4d2d59[_0x0275('0x15')]!=_0x2a18c3[_0x0275('0x15')]&&_0x4d2d59[_0x0275('0x5')]==_0x2a18c3[_0x0275('0x5')]){_0x4d2d59[_0x0275('0x2d')]=0x0;_0x4d2d59[_0x0275('0x1f')]=_0x2a18c3['ringtime'];_0x4d2d59[_0x0275('0x1a')]=!![];_0x4d2d59[_0x0275('0x2e')]=utils[_0x0275('0x17')]();_0x4d2d59[_0x0275('0xb')]='answered_elsewhere';_0x4d2d59[_0x0275('0x1e')]=_0x0275('0x2f');_0x4d2d59[_0x0275('0x30')]=_0x2a18c3[_0x0275('0x15')];_0x4d2d59['answeredelsewheremembername']=_0x2a18c3[_0x0275('0x8')];writeDB(_0x4d2d59);}});}}catch(_0x52f69c){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x27'),_0x2a18c3[_0x0275('0x5')]),_0x52f69c);}};exports['agentcomplete']=function(_0x13c651){try{if(!_[_0x0275('0x31')](agents[_0x13c651['destuniqueid']])){utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x32'),_0x13c651['uniqueid']),_0x13c651);utils[_0x0275('0x2')](util[_0x0275('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x13c651[_0x0275('0x5')],agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x8')],_0x13c651[_0x0275('0x15')]));agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x33')]=!![];agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x34')]=utils[_0x0275('0x17')]();agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x2d')]=utils['diffTime'](agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x34')],agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x29')]);agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x1e')]=_0x13c651[_0x0275('0x1e')];agents[_0x13c651[_0x0275('0x15')]][_0x0275('0xb')]=_0x0275('0x35');writeDB(agents[_0x13c651[_0x0275('0x15')]]);}}catch(_0x598d15){utils['error'](util[_0x0275('0x3')](_0x0275('0x32'),_0x13c651[_0x0275('0x5')]),_0x598d15);}};exports[_0x0275('0x36')]=function(_0x310c6b){try{if(!_['isNil'](agents[_0x310c6b[_0x0275('0x37')]])){utils['debug'](util[_0x0275('0x3')](_0x0275('0x38'),_0x310c6b[_0x0275('0x5')]),_0x310c6b);utils[_0x0275('0x2')](util['format'](_0x0275('0x39'),_0x310c6b['uniqueid'],agents[_0x310c6b['transfereruniqueid']]['membername'],agents[_0x310c6b[_0x0275('0x37')]]['uniqueid']));agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x3a')]=!![];agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x3b')]=_0x0275('0x3c');agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x3d')]=_0x310c6b['extension'];agents[_0x310c6b[_0x0275('0x37')]]['transferuniqueid']=agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x5')];}}catch(_0x119301){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x38'),_0x310c6b[_0x0275('0x5')]),_0x119301);}};exports[_0x0275('0x3e')]=function(_0x41429d){try{utils[_0x0275('0x13')](util['format']('[%s][agents][attendedtransfer]',_0x41429d[_0x0275('0x3f')]),_0x41429d);if(_0x41429d['origtransfereruniqueid']==_0x41429d['origtransfererlinkedid']){if(!_[_0x0275('0x31')](agents[_0x41429d[_0x0275('0x40')]])){utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x41'),_0x41429d[_0x0275('0x3f')],agents[_0x41429d['secondtransfereruniqueid']][_0x0275('0x8')]));agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x3a')]=!![];agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x3b')]=_0x0275('0x42');agents[_0x41429d['secondtransfereruniqueid']][_0x0275('0x3d')]=_0x41429d[_0x0275('0x43')];agents[_0x41429d['secondtransfereruniqueid']][_0x0275('0x44')]=_0x41429d['origtransfereruniqueid'];}if(_0x41429d[_0x0275('0x45')]&&agents[_0x41429d[_0x0275('0x45')]]){agents[_0x41429d[_0x0275('0x45')]][_0x0275('0x46')]=0x1;transfers[_0x41429d[_0x0275('0x45')]]=_[_0x0275('0x47')](agents[_0x41429d[_0x0275('0x45')]]);transfers[_0x41429d[_0x0275('0x45')]][_0x0275('0x9')]=agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x9')];transfers[_0x41429d['transfereeuniqueid']][_0x0275('0x48')]=agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x48')];transfers[_0x41429d['transfereeuniqueid']][_0x0275('0x16')]=utils[_0x0275('0x17')]();transfers[_0x41429d['transfereeuniqueid']][_0x0275('0x29')]=utils['now']();transfers[_0x41429d[_0x0275('0x45')]][_0x0275('0x1f')]=0x0;transfers[_0x41429d[_0x0275('0x45')]][_0x0275('0x46')]=0x2;}}else if(_0x41429d['secondtransfereruniqueid']==_0x41429d[_0x0275('0x49')]){if(!_[_0x0275('0x31')](agents[_0x41429d[_0x0275('0x3f')]])){utils[_0x0275('0x2')](util['format'](_0x0275('0x41'),_0x41429d[_0x0275('0x3f')],agents[_0x41429d['origtransfereruniqueid']][_0x0275('0x8')]));agents[_0x41429d[_0x0275('0x3f')]]['transfer']=!![];agents[_0x41429d['origtransfereruniqueid']][_0x0275('0x3b')]=_0x0275('0x42');agents[_0x41429d['origtransfereruniqueid']]['transferexten']=_0x41429d[_0x0275('0x4a')];agents[_0x41429d[_0x0275('0x3f')]][_0x0275('0x44')]=_0x41429d[_0x0275('0x40')];}if(_0x41429d[_0x0275('0x4b')]&&agents[_0x41429d[_0x0275('0x4b')]]){agents[_0x41429d[_0x0275('0x4b')]][_0x0275('0x46')]=0x1;transfers[_0x41429d['transfertargetuniqueid']]=_[_0x0275('0x47')](agents[_0x41429d[_0x0275('0x4b')]]);transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x9')]=agents[_0x41429d[_0x0275('0x3f')]][_0x0275('0x9')];transfers[_0x41429d['transfertargetuniqueid']][_0x0275('0x48')]=agents[_0x41429d['origtransfereruniqueid']][_0x0275('0x48')];transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x16')]=utils[_0x0275('0x17')]();transfers[_0x41429d['transfertargetuniqueid']][_0x0275('0x29')]=utils[_0x0275('0x17')]();transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x1f')]=0x0;transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x46')]=0x2;}}}catch(_0x3c7845){utils[_0x0275('0x19')](util[_0x0275('0x3')]('[%s][agents][attendedtransfer]',_0x41429d['origtransfereruniqueid']),_0x3c7845);}};exports['hangup']=function(_0x1dcaa6){try{utils[_0x0275('0x13')](util[_0x0275('0x3')]('[%s][agents][hangup]',_0x1dcaa6[_0x0275('0x5')]),_0x1dcaa6);if(agents[_0x1dcaa6[_0x0275('0x5')]]&&agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')]===_0x0275('0x1d')){if(_0x1dcaa6['cause']==='21'){agents[_0x1dcaa6[_0x0275('0x5')]]['reason']=_0x0275('0x4c');agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]=_0x0275('0x4c');}utils['info'](util[_0x0275('0x3')](_0x0275('0x4d'),_0x1dcaa6[_0x0275('0x5')],agents[_0x1dcaa6['uniqueid']][_0x0275('0x8')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]));writeDB(agents[_0x1dcaa6[_0x0275('0x5')]]);var _0x3a9898=unanswered[_0x0275('0x4e')](_0x1dcaa6['uniqueid']);if(_0x3a9898>-0x1){unanswered['splice'](_0x3a9898,0x1);}}if(transfers[_0x1dcaa6['uniqueid']]){transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x33')]=!![];transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x34')]=utils[_0x0275('0x17')]();transfers[_0x1dcaa6['uniqueid']][_0x0275('0x2d')]=utils['diffTime'](transfers[_0x1dcaa6['uniqueid']][_0x0275('0x34')],transfers[_0x1dcaa6['uniqueid']][_0x0275('0x29')]);transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')]=_0x0275('0x4f');transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]=_0x0275('0x35');utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x4d'),_0x1dcaa6[_0x0275('0x5')],transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x8')],transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')],transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]));writeDB(transfers[_0x1dcaa6[_0x0275('0x5')]],!![]);}if(agents[_0x1dcaa6[_0x0275('0x5')]]&&agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x29')]){agents[_0x1dcaa6['uniqueid']][_0x0275('0x33')]=!![];agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x34')]=utils[_0x0275('0x17')]();agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x2d')]=utils['diffTime'](agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x34')],agents[_0x1dcaa6['uniqueid']][_0x0275('0x29')]);agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')]=agents[_0x1dcaa6[_0x0275('0x5')]]['transfer']?_0x0275('0x3a'):_0x0275('0x4f');agents[_0x1dcaa6['uniqueid']][_0x0275('0xb')]='complete';utils[_0x0275('0x2')](util[_0x0275('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1dcaa6[_0x0275('0x5')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x8')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]));writeDB(agents[_0x1dcaa6['uniqueid']]);}}catch(_0x12476c){utils[_0x0275('0x19')](util['format'](_0x0275('0x50'),_0x1dcaa6['uniqueid']),_0x12476c);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 17e7ef2..afa6456 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 _0xe590=['ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','uniqueid','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','variable','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER'];(function(_0x51dbe6,_0x168883){var _0x3767a1=function(_0x16b161){while(--_0x16b161){_0x51dbe6['push'](_0x51dbe6['shift']());}};_0x3767a1(++_0x168883);}(_0xe590,0x148));var _0x0e59=function(_0x61aaa5,_0x43362d){_0x61aaa5=_0x61aaa5-0x0;var _0x340eee=_0xe590[_0x61aaa5];return _0x340eee;};'use strict';var _=require(_0x0e59('0x0'));var util=require(_0x0e59('0x1'));var utils=require(_0x0e59('0x2'));var dispositions=['NO\x20ANSWER',_0x0e59('0x3'),_0x0e59('0x3'),_0x0e59('0x4'),_0x0e59('0x4'),'NO\x20ANSWER',_0x0e59('0x5'),_0x0e59('0x6'),_0x0e59('0x3'),_0x0e59('0x3'),_0x0e59('0x3')];var channels={};function writeDB(_0x39988c){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x9'),_0x39988c['uniqueid'],_0x39988c[_0x0e59('0xa')],_0x39988c[_0x0e59('0xb')],_0x39988c[_0x0e59('0xc')],_0x39988c[_0x0e59('0xd')],_0x39988c[_0x0e59('0xe')],_0x39988c[_0x0e59('0xf')],_0x39988c[_0x0e59('0x10')]));if(_0x39988c[_0x0e59('0x11')]){utils[_0x0e59('0x12')](_0x39988c[_0x0e59('0x11')])[_0x0e59('0x13')](function(_0x365339){if(_0x365339){_0x39988c[_0x0e59('0x14')]=_0x365339['id'];}utils['request'](_0x0e59('0x15'),_0x39988c);});}else{utils[_0x0e59('0x16')](_0x0e59('0x15'),_0x39988c);}if(channels[_0x39988c[_0x0e59('0x17')]]){delete channels[_0x39988c[_0x0e59('0x17')]];}}exports[_0x0e59('0x18')]=function(_0x232e8e){try{utils[_0x0e59('0x19')](util['format'](_0x0e59('0x1a'),_0x232e8e['uniqueid']),_0x232e8e);if(_0x232e8e[_0x0e59('0x17')]==_0x232e8e[_0x0e59('0x1b')]&&_0x232e8e[_0x0e59('0xa')]!=_0x0e59('0x1c')){utils['info'](util[_0x0e59('0x8')](_0x0e59('0x1d'),_0x232e8e[_0x0e59('0x17')],_0x232e8e['context'],_0x232e8e[_0x0e59('0x1e')]));channels[_0x232e8e[_0x0e59('0x17')]]={'uniqueid':_0x232e8e[_0x0e59('0x17')],'accountcode':_0x232e8e[_0x0e59('0x11')],'source':_0x232e8e[_0x0e59('0xe')],'destination':_0x232e8e[_0x0e59('0x1e')],'destinationcontext':_0x232e8e[_0x0e59('0x1f')],'channel':_0x232e8e[_0x0e59('0xa')],'starttime':utils[_0x0e59('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0e59('0x4'),'amaflags':_0x0e59('0x21')};}}catch(_0x25e80e){utils[_0x0e59('0x22')](util['format'](_0x0e59('0x1a'),_0x232e8e[_0x0e59('0x17')]),_0x25e80e);}};exports[_0x0e59('0x23')]=function(_0x6d7964){try{utils[_0x0e59('0x19')](util[_0x0e59('0x8')](_0x0e59('0x24'),_0x6d7964[_0x0e59('0x17')]),_0x6d7964);if(!_[_0x0e59('0x25')](channels[_0x6d7964[_0x0e59('0x17')]])&&_0x6d7964['channelstate']==0x6){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x26'),_0x6d7964['uniqueid'],_0x6d7964[_0x0e59('0x1f')],_0x6d7964[_0x0e59('0xa')]));if(_['isNil'](channels[_0x6d7964['uniqueid']]['systemanswertime'])){channels[_0x6d7964['uniqueid']][_0x0e59('0x27')]=utils[_0x0e59('0x20')]();}}else if(!_['isNil'](channels[_0x6d7964[_0x0e59('0x1b')]])&&_0x6d7964[_0x0e59('0x28')]==0x6&&_0x6d7964[_0x0e59('0x1f')]!=_0x0e59('0x29')){utils[_0x0e59('0x7')](util['format'](_0x0e59('0x2a'),_0x6d7964['uniqueid'],_0x6d7964[_0x0e59('0x1b')],_0x6d7964[_0x0e59('0x1f')],_0x6d7964[_0x0e59('0xa')]));channels[_0x6d7964['linkedid']][_0x0e59('0x11')]=_0x6d7964[_0x0e59('0x11')];channels[_0x6d7964[_0x0e59('0x1b')]][_0x0e59('0x2b')]=_0x6d7964[_0x0e59('0xa')];if(_[_0x0e59('0x25')](channels[_0x6d7964[_0x0e59('0x1b')]][_0x0e59('0x2c')])){channels[_0x6d7964[_0x0e59('0x1b')]][_0x0e59('0x2c')]=utils[_0x0e59('0x20')]();}channels[_0x6d7964[_0x0e59('0x1b')]][_0x0e59('0x2d')]=dispositions[_[_0x0e59('0x2e')](_0x6d7964[_0x0e59('0x28')])]||_0x0e59('0x5');}}catch(_0x54436c){utils[_0x0e59('0x22')](util[_0x0e59('0x8')](_0x0e59('0x24'),_0x6d7964[_0x0e59('0x17')]),_0x54436c);}};exports['hangup']=function(_0x50e24b){try{if(!_[_0x0e59('0x25')](channels[_0x50e24b['uniqueid']])){utils[_0x0e59('0x19')](util[_0x0e59('0x8')](_0x0e59('0x2f'),_0x50e24b[_0x0e59('0x17')]),_0x50e24b);if(_[_0x0e59('0x25')](channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x30')])){channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x30')]=_0x50e24b[_0x0e59('0x31')]+'\x20<'+_0x50e24b[_0x0e59('0xe')]+'>';}utils[_0x0e59('0x7')](util[_0x0e59('0x8')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x50e24b[_0x0e59('0x17')],channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x30')],_0x50e24b['cause-txt']));channels[_0x50e24b['uniqueid']][_0x0e59('0x32')]=utils['now']();channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x33')]=utils[_0x0e59('0x34')](channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x32')],channels[_0x50e24b['uniqueid']]['starttime']);channels[_0x50e24b[_0x0e59('0x17')]]['billableseconds']=channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x2c')]?utils[_0x0e59('0x34')](channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x32')],channels[_0x50e24b[_0x0e59('0x17')]][_0x0e59('0x2c')]):0x0;writeDB(channels[_0x50e24b[_0x0e59('0x17')]]);}}catch(_0x3ca719){utils['error'](util[_0x0e59('0x8')](_0x0e59('0x2f'),_0x50e24b[_0x0e59('0x17')]),_0x3ca719);}};exports[_0x0e59('0x35')]=function(_0x26d042){try{if(!_['isNil'](channels[_0x26d042[_0x0e59('0x36')]])){utils[_0x0e59('0x19')](util[_0x0e59('0x8')](_0x0e59('0x37'),_0x26d042[_0x0e59('0x38')]),_0x26d042);if(channels[_0x26d042[_0x0e59('0x36')]]['channel']==_0x26d042['transfereechannel']){utils[_0x0e59('0x7')](util['format'](_0x0e59('0x39'),_0x26d042['origtransfereruniqueid'],_0x26d042['localtwolinkedid'],_0x26d042[_0x0e59('0x3a')]));channels[_0x26d042[_0x0e59('0x36')]][_0x0e59('0x2b')]=_0x26d042[_0x0e59('0x3a')];channels[_0x26d042[_0x0e59('0x36')]][_0x0e59('0x3b')]='_attended';}else if(channels[_0x26d042['localtwolinkedid']][_0x0e59('0xa')]=_0x26d042[_0x0e59('0x3c')]){utils['info'](util[_0x0e59('0x8')](_0x0e59('0x39'),_0x26d042[_0x0e59('0x38')],_0x26d042[_0x0e59('0x36')],_0x26d042[_0x0e59('0x3d')]));channels[_0x26d042[_0x0e59('0x36')]]['destinationchannel']=_0x26d042[_0x0e59('0x3d')];channels[_0x26d042[_0x0e59('0x36')]][_0x0e59('0x3b')]=_0x0e59('0x3e');}}}catch(_0x4ca2ba){utils[_0x0e59('0x22')](util[_0x0e59('0x8')](_0x0e59('0x37'),_0x26d042[_0x0e59('0x38')]),_0x4ca2ba);}};exports[_0x0e59('0x3f')]=function(_0x4f0156){try{if(!_[_0x0e59('0x25')](channels[_0x4f0156[_0x0e59('0x17')]])){utils['debug'](util[_0x0e59('0x8')](_0x0e59('0x40'),_0x4f0156[_0x0e59('0x17')]),_0x4f0156);channels[_0x4f0156[_0x0e59('0x17')]][_0x0e59('0x41')]=utils[_0x0e59('0x20')]();utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x42'),_0x4f0156[_0x0e59('0x17')],channels[_0x4f0156['uniqueid']][_0x0e59('0x41')]));}}catch(_0x5e2206){utils['error'](util['format'](_0x0e59('0x40'),_0x4f0156[_0x0e59('0x17')]),_0x5e2206);}};exports[_0x0e59('0x43')]=function(_0x5ba762){try{if(!_[_0x0e59('0x25')](channels[_0x5ba762[_0x0e59('0x17')]])){utils[_0x0e59('0x19')](util[_0x0e59('0x8')](_0x0e59('0x44'),_0x5ba762['uniqueid']),_0x5ba762);if(!_[_0x0e59('0x25')](channels[_0x5ba762[_0x0e59('0x17')]][_0x0e59('0x41')])){channels[_0x5ba762[_0x0e59('0x17')]][_0x0e59('0x45')]+=utils[_0x0e59('0x34')](utils[_0x0e59('0x20')](),channels[_0x5ba762[_0x0e59('0x17')]][_0x0e59('0x41')]);utils[_0x0e59('0x7')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5ba762[_0x0e59('0x17')],channels[_0x5ba762[_0x0e59('0x17')]][_0x0e59('0x45')]));delete channels[_0x5ba762[_0x0e59('0x17')]][_0x0e59('0x41')];}}}catch(_0x138d49){utils[_0x0e59('0x22')](util[_0x0e59('0x8')](_0x0e59('0x44'),_0x5ba762[_0x0e59('0x17')]),_0x138d49);}};exports['varset']=function(_0x52e0dc){try{if(!_['isNil'](channels[_0x52e0dc[_0x0e59('0x17')]])){utils[_0x0e59('0x19')](util['format']('[%s][calls][varset]',_0x52e0dc[_0x0e59('0x17')]),_0x52e0dc);if(!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')]['xmd-originatecalleridnum'])){utils[_0x0e59('0x7')](util[_0x0e59('0x8')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x52e0dc[_0x0e59('0x17')],_0x52e0dc['value']));channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0x47')]=_0x52e0dc[_0x0e59('0x48')];}if(!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x49')])){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x4a'),_0x52e0dc['uniqueid'],_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0x4b')]=_0x52e0dc['value'];channels[_0x52e0dc['uniqueid']][_0x0e59('0x30')]='\x22'+_0x52e0dc[_0x0e59('0x48')]+_0x0e59('0x4c')+_0x52e0dc[_0x0e59('0x48')]+'>';}if(!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x4d')])||!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')]['xmd-callerid'])){utils['info'](util['format'](_0x0e59('0x4e'),_0x52e0dc[_0x0e59('0x17')],!_[_0x0e59('0x25')](_0x52e0dc['variable'][_0x0e59('0x4d')])?_0x0e59('0x4d'):_0x0e59('0x4f'),_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc['uniqueid']][_0x0e59('0x30')]=_0x52e0dc[_0x0e59('0x48')];}if(!_['isNil'](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x50')])||!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x51')])){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x4e'),_0x52e0dc[_0x0e59('0x17')],!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x50')])?'xmd-queue':_0x0e59('0x51'),_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc['uniqueid']][_0x0e59('0x52')]=_0x0e59('0x53');channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0x54')]=_0x52e0dc[_0x0e59('0x48')];channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0xb')]=!![];}if(!_['isNil'](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x55')])){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x56'),_0x52e0dc['uniqueid'],_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc['uniqueid']]['ContactId']=_0x52e0dc[_0x0e59('0x48')];}if(!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')]['xmd-cdrtype'])){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x57'),_0x52e0dc[_0x0e59('0x17')],_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0x58')]=_0x52e0dc[_0x0e59('0x48')];}if(!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x59')])){utils['info'](util['format'](_0x0e59('0x5a'),_0x52e0dc[_0x0e59('0x17')],_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0x5b')]=_0x52e0dc['value'];}if(!_[_0x0e59('0x25')](_0x52e0dc[_0x0e59('0x46')][_0x0e59('0x5c')])){utils[_0x0e59('0x7')](util[_0x0e59('0x8')](_0x0e59('0x5d'),_0x52e0dc[_0x0e59('0x17')],_0x52e0dc[_0x0e59('0x48')]));channels[_0x52e0dc[_0x0e59('0x17')]][_0x0e59('0x5c')]=_0x52e0dc[_0x0e59('0x48')];}}}catch(_0x4071fe){utils[_0x0e59('0x22')](util[_0x0e59('0x8')](_0x0e59('0x5e'),_0x52e0dc[_0x0e59('0x17')]),_0x4071fe);}};exports[_0x0e59('0x5f')]=function(_0x107af4){try{if(!_['isNil'](channels[_0x107af4[_0x0e59('0x17')]])){utils[_0x0e59('0x19')](util['format'](_0x0e59('0x60'),_0x107af4[_0x0e59('0x17')]),_0x107af4);utils['info'](util[_0x0e59('0x8')](_0x0e59('0x61'),_0x107af4[_0x0e59('0x17')],_0x107af4[_0x0e59('0x62')],_0x107af4[_0x0e59('0x63')]));if(_0x107af4[_0x0e59('0x62')]['toLowerCase']()==_0x0e59('0x64')&&_[_0x0e59('0x65')](_0x107af4['appdata'][_0x0e59('0x66')](),_0x0e59('0x67'))){var _0x4d8c16=_0x107af4[_0x0e59('0x63')][_0x0e59('0x68')]('=');var _0x346896=_0x4d8c16[0x0]['substring'](_0x4d8c16[0x0]['lastIndexOf']('(')+0x1,_0x4d8c16[0x0][_0x0e59('0x69')](')'));var _0x1a345e=_0x4d8c16[0x1];channels[_0x107af4[_0x0e59('0x17')]][_0x346896]=_0x1a345e;}if(!_[_0x0e59('0x6a')]([_0x0e59('0x6b'),_0x0e59('0x6c'),_0x0e59('0x6d'),_0x0e59('0x64'),_0x0e59('0x6e')],_0x107af4['application']['toLowerCase']())){channels[_0x107af4[_0x0e59('0x17')]][_0x0e59('0x52')]=_0x107af4[_0x0e59('0x62')];channels[_0x107af4[_0x0e59('0x17')]][_0x0e59('0x54')]=_0x107af4[_0x0e59('0x63')];}}}catch(_0x3b2364){utils[_0x0e59('0x22')](util[_0x0e59('0x8')](_0x0e59('0x60'),_0x107af4[_0x0e59('0x17')]),_0x3b2364);}}; \ No newline at end of file +var _0x8429=['type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','cdr','split','substring','lastIndexOf','execif','gotoif','lastdata','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','uniqueid','channel','queue','membername','interface','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','origtransfererchannel','_attended','error','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s'];(function(_0x5a43e6,_0x12c0da){var _0x5f2b27=function(_0x13c71d){while(--_0x13c71d){_0x5a43e6['push'](_0x5a43e6['shift']());}};_0x5f2b27(++_0x12c0da);}(_0x8429,0x7b));var _0x9842=function(_0x2a77ea,_0x3d8d27){_0x2a77ea=_0x2a77ea-0x0;var _0x13a821=_0x8429[_0x2a77ea];return _0x13a821;};'use strict';var _=require(_0x9842('0x0'));var util=require(_0x9842('0x1'));var utils=require(_0x9842('0x2'));var dispositions=['NO\x20ANSWER',_0x9842('0x3'),_0x9842('0x3'),'NO\x20ANSWER',_0x9842('0x4'),_0x9842('0x4'),_0x9842('0x5'),_0x9842('0x6'),_0x9842('0x3'),_0x9842('0x3'),_0x9842('0x3')];var channels={};function writeDB(_0x2c7263){utils[_0x9842('0x7')](util[_0x9842('0x8')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2c7263[_0x9842('0x9')],_0x2c7263[_0x9842('0xa')],_0x2c7263[_0x9842('0xb')],_0x2c7263[_0x9842('0xc')],_0x2c7263[_0x9842('0xd')],_0x2c7263['calleridnum'],_0x2c7263['connectedlinenum'],_0x2c7263[_0x9842('0xe')]));if(_0x2c7263[_0x9842('0xf')]){utils[_0x9842('0x10')](_0x2c7263[_0x9842('0xf')])['then'](function(_0x475d2d){if(_0x475d2d){_0x2c7263[_0x9842('0x11')]=_0x475d2d['id'];}utils[_0x9842('0x12')](_0x9842('0x13'),_0x2c7263);});}else{utils[_0x9842('0x12')](_0x9842('0x13'),_0x2c7263);}if(channels[_0x2c7263[_0x9842('0x9')]]){delete channels[_0x2c7263[_0x9842('0x9')]];}}exports['newchannel']=function(_0x12e892){try{utils[_0x9842('0x14')](util['format'](_0x9842('0x15'),_0x12e892['uniqueid']),_0x12e892);if(_0x12e892['uniqueid']==_0x12e892[_0x9842('0x16')]&&_0x12e892[_0x9842('0xa')]!=_0x9842('0x17')){utils[_0x9842('0x7')](util[_0x9842('0x8')](_0x9842('0x18'),_0x12e892[_0x9842('0x9')],_0x12e892[_0x9842('0x19')],_0x12e892[_0x9842('0x1a')]));channels[_0x12e892[_0x9842('0x9')]]={'uniqueid':_0x12e892[_0x9842('0x9')],'accountcode':_0x12e892[_0x9842('0xf')],'source':_0x12e892[_0x9842('0x1b')],'destination':_0x12e892[_0x9842('0x1a')],'destinationcontext':_0x12e892[_0x9842('0x19')],'channel':_0x12e892[_0x9842('0xa')],'starttime':utils[_0x9842('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9842('0x4'),'amaflags':_0x9842('0x1d')};}}catch(_0x2a5b55){utils['error'](util[_0x9842('0x8')]('[%s][calls][newchannel]',_0x12e892[_0x9842('0x9')]),_0x2a5b55);}};exports['newstate']=function(_0x5ca6f3){try{utils['debug'](util[_0x9842('0x8')](_0x9842('0x1e'),_0x5ca6f3['uniqueid']),_0x5ca6f3);if(!_[_0x9842('0x1f')](channels[_0x5ca6f3[_0x9842('0x9')]])&&_0x5ca6f3[_0x9842('0x20')]==0x6){utils['info'](util[_0x9842('0x8')](_0x9842('0x21'),_0x5ca6f3[_0x9842('0x9')],_0x5ca6f3[_0x9842('0x19')],_0x5ca6f3[_0x9842('0xa')]));if(_[_0x9842('0x1f')](channels[_0x5ca6f3[_0x9842('0x9')]]['systemanswertime'])){channels[_0x5ca6f3[_0x9842('0x9')]][_0x9842('0x22')]=utils[_0x9842('0x1c')]();}}else if(!_[_0x9842('0x1f')](channels[_0x5ca6f3['linkedid']])&&_0x5ca6f3[_0x9842('0x20')]==0x6&&_0x5ca6f3[_0x9842('0x19')]!=_0x9842('0x23')){utils[_0x9842('0x7')](util[_0x9842('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5ca6f3[_0x9842('0x9')],_0x5ca6f3[_0x9842('0x16')],_0x5ca6f3[_0x9842('0x19')],_0x5ca6f3[_0x9842('0xa')]));channels[_0x5ca6f3[_0x9842('0x16')]][_0x9842('0xf')]=_0x5ca6f3[_0x9842('0xf')];channels[_0x5ca6f3[_0x9842('0x16')]]['destinationchannel']=_0x5ca6f3[_0x9842('0xa')];if(_[_0x9842('0x1f')](channels[_0x5ca6f3[_0x9842('0x16')]][_0x9842('0x24')])){channels[_0x5ca6f3[_0x9842('0x16')]][_0x9842('0x24')]=utils[_0x9842('0x1c')]();}channels[_0x5ca6f3[_0x9842('0x16')]]['disposition']=dispositions[_[_0x9842('0x25')](_0x5ca6f3[_0x9842('0x20')])]||_0x9842('0x5');}}catch(_0x50145b){utils['error'](util['format'](_0x9842('0x1e'),_0x5ca6f3[_0x9842('0x9')]),_0x50145b);}};exports[_0x9842('0x26')]=function(_0x4c2ccd){try{if(!_[_0x9842('0x1f')](channels[_0x4c2ccd[_0x9842('0x9')]])){utils[_0x9842('0x14')](util[_0x9842('0x8')](_0x9842('0x27'),_0x4c2ccd['uniqueid']),_0x4c2ccd);if(_[_0x9842('0x1f')](channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x28')])){channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x28')]=_0x4c2ccd[_0x9842('0x29')]+'\x20<'+_0x4c2ccd[_0x9842('0x1b')]+'>';}utils[_0x9842('0x7')](util['format'](_0x9842('0x2a'),_0x4c2ccd[_0x9842('0x9')],channels[_0x4c2ccd['uniqueid']][_0x9842('0x28')],_0x4c2ccd[_0x9842('0x2b')]));channels[_0x4c2ccd[_0x9842('0x9')]]['endtime']=utils[_0x9842('0x1c')]();channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x2c')]=utils[_0x9842('0x2d')](channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x2e')],channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x2f')]);channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x30')]=channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x24')]?utils[_0x9842('0x2d')](channels[_0x4c2ccd[_0x9842('0x9')]]['endtime'],channels[_0x4c2ccd[_0x9842('0x9')]][_0x9842('0x24')]):0x0;writeDB(channels[_0x4c2ccd[_0x9842('0x9')]]);}}catch(_0x5ee8d3){utils['error'](util['format'](_0x9842('0x27'),_0x4c2ccd[_0x9842('0x9')]),_0x5ee8d3);}};exports['attendedtransfer']=function(_0x63a372){try{if(!_['isNil'](channels[_0x63a372[_0x9842('0x31')]])){utils[_0x9842('0x14')](util[_0x9842('0x8')](_0x9842('0x32'),_0x63a372[_0x9842('0x33')]),_0x63a372);if(channels[_0x63a372[_0x9842('0x31')]][_0x9842('0xa')]==_0x63a372['transfereechannel']){utils[_0x9842('0x7')](util[_0x9842('0x8')](_0x9842('0x34'),_0x63a372[_0x9842('0x33')],_0x63a372[_0x9842('0x31')],_0x63a372[_0x9842('0x35')]));channels[_0x63a372[_0x9842('0x31')]][_0x9842('0x36')]=_0x63a372[_0x9842('0x35')];channels[_0x63a372[_0x9842('0x31')]][_0x9842('0x37')]='_attended';}else if(channels[_0x63a372[_0x9842('0x31')]][_0x9842('0xa')]=_0x63a372['transfertargetchannel']){utils['info'](util[_0x9842('0x8')](_0x9842('0x34'),_0x63a372[_0x9842('0x33')],_0x63a372[_0x9842('0x31')],_0x63a372[_0x9842('0x38')]));channels[_0x63a372[_0x9842('0x31')]]['destinationchannel']=_0x63a372[_0x9842('0x38')];channels[_0x63a372[_0x9842('0x31')]][_0x9842('0x37')]=_0x9842('0x39');}}}catch(_0x20a89c){utils[_0x9842('0x3a')](util[_0x9842('0x8')]('[%s][calls][attendedtransfer]',_0x63a372['origtransfereruniqueid']),_0x20a89c);}};exports[_0x9842('0x3b')]=function(_0x54b723){try{if(!_[_0x9842('0x1f')](channels[_0x54b723['uniqueid']])){utils[_0x9842('0x14')](util[_0x9842('0x8')](_0x9842('0x3c'),_0x54b723[_0x9842('0x9')]),_0x54b723);channels[_0x54b723['uniqueid']][_0x9842('0x3d')]=utils[_0x9842('0x1c')]();utils[_0x9842('0x7')](util[_0x9842('0x8')](_0x9842('0x3e'),_0x54b723[_0x9842('0x9')],channels[_0x54b723['uniqueid']][_0x9842('0x3d')]));}}catch(_0x567f36){utils['error'](util[_0x9842('0x8')](_0x9842('0x3c'),_0x54b723['uniqueid']),_0x567f36);}};exports[_0x9842('0x3f')]=function(_0x42bd77){try{if(!_[_0x9842('0x1f')](channels[_0x42bd77[_0x9842('0x9')]])){utils[_0x9842('0x14')](util['format']('[%s][calls][musiconholdstop]',_0x42bd77[_0x9842('0x9')]),_0x42bd77);if(!_[_0x9842('0x1f')](channels[_0x42bd77[_0x9842('0x9')]][_0x9842('0x3d')])){channels[_0x42bd77['uniqueid']]['mohtime']+=utils['diffTime'](utils['now'](),channels[_0x42bd77[_0x9842('0x9')]]['musiconholdstartAt']);utils[_0x9842('0x7')](util['format'](_0x9842('0x40'),_0x42bd77[_0x9842('0x9')],channels[_0x42bd77[_0x9842('0x9')]][_0x9842('0x41')]));delete channels[_0x42bd77[_0x9842('0x9')]]['musiconholdstartAt'];}}}catch(_0x36b14d){utils[_0x9842('0x3a')](util['format'](_0x9842('0x42'),_0x42bd77['uniqueid']),_0x36b14d);}};exports[_0x9842('0x43')]=function(_0x353f01){try{if(!_[_0x9842('0x1f')](channels[_0x353f01['uniqueid']])){utils[_0x9842('0x14')](util[_0x9842('0x8')](_0x9842('0x44'),_0x353f01[_0x9842('0x9')]),_0x353f01);if(!_['isNil'](_0x353f01[_0x9842('0x45')]['xmd-originatecalleridnum'])){utils[_0x9842('0x7')](util[_0x9842('0x8')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x353f01['uniqueid'],_0x353f01['value']));channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x46')]=_0x353f01[_0x9842('0x47')];}if(!_[_0x9842('0x1f')](_0x353f01[_0x9842('0x45')][_0x9842('0x48')])){utils[_0x9842('0x7')](util['format'](_0x9842('0x49'),_0x353f01[_0x9842('0x9')],_0x353f01[_0x9842('0x47')]));channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x4a')]=_0x353f01[_0x9842('0x47')];channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x28')]='\x22'+_0x353f01[_0x9842('0x47')]+'\x22\x20<'+_0x353f01[_0x9842('0x47')]+'>';}if(!_[_0x9842('0x1f')](_0x353f01[_0x9842('0x45')][_0x9842('0x4b')])||!_['isNil'](_0x353f01[_0x9842('0x45')]['xmd-callerid'])){utils[_0x9842('0x7')](util['format'](_0x9842('0x4c'),_0x353f01[_0x9842('0x9')],!_[_0x9842('0x1f')](_0x353f01[_0x9842('0x45')][_0x9842('0x4b')])?_0x9842('0x4b'):_0x9842('0x4d'),_0x353f01[_0x9842('0x47')]));channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x28')]=_0x353f01[_0x9842('0x47')];}if(!_['isNil'](_0x353f01['variable'][_0x9842('0x4e')])||!_[_0x9842('0x1f')](_0x353f01[_0x9842('0x45')][_0x9842('0x4f')])){utils[_0x9842('0x7')](util[_0x9842('0x8')](_0x9842('0x4c'),_0x353f01[_0x9842('0x9')],!_[_0x9842('0x1f')](_0x353f01['variable']['xmd-queue'])?_0x9842('0x4e'):_0x9842('0x4f'),_0x353f01[_0x9842('0x47')]));channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x50')]=_0x9842('0x51');channels[_0x353f01['uniqueid']]['lastdata']=_0x353f01[_0x9842('0x47')];channels[_0x353f01[_0x9842('0x9')]][_0x9842('0xb')]=!![];}if(!_['isNil'](_0x353f01[_0x9842('0x45')][_0x9842('0x52')])){utils[_0x9842('0x7')](util['format'](_0x9842('0x53'),_0x353f01['uniqueid'],_0x353f01[_0x9842('0x47')]));channels[_0x353f01['uniqueid']][_0x9842('0x54')]=_0x353f01[_0x9842('0x47')];}if(!_[_0x9842('0x1f')](_0x353f01[_0x9842('0x45')][_0x9842('0x55')])){utils[_0x9842('0x7')](util[_0x9842('0x8')](_0x9842('0x56'),_0x353f01[_0x9842('0x9')],_0x353f01[_0x9842('0x47')]));channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x57')]=_0x353f01[_0x9842('0x47')];}if(!_['isNil'](_0x353f01[_0x9842('0x45')][_0x9842('0x58')])){utils['info'](util[_0x9842('0x8')](_0x9842('0x59'),_0x353f01['uniqueid'],_0x353f01[_0x9842('0x47')]));channels[_0x353f01[_0x9842('0x9')]][_0x9842('0x5a')]=_0x353f01[_0x9842('0x47')];}if(!_[_0x9842('0x1f')](_0x353f01[_0x9842('0x45')][_0x9842('0x5b')])){utils[_0x9842('0x7')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x353f01[_0x9842('0x9')],_0x353f01[_0x9842('0x47')]));channels[_0x353f01[_0x9842('0x9')]]['sipcallid']=_0x353f01[_0x9842('0x47')];}}}catch(_0x430dbd){utils[_0x9842('0x3a')](util[_0x9842('0x8')](_0x9842('0x44'),_0x353f01[_0x9842('0x9')]),_0x430dbd);}};exports['newexten']=function(_0x2d650a){try{if(!_[_0x9842('0x1f')](channels[_0x2d650a[_0x9842('0x9')]])){utils[_0x9842('0x14')](util[_0x9842('0x8')](_0x9842('0x5c'),_0x2d650a[_0x9842('0x9')]),_0x2d650a);utils[_0x9842('0x7')](util[_0x9842('0x8')](_0x9842('0x5d'),_0x2d650a['uniqueid'],_0x2d650a[_0x9842('0x5e')],_0x2d650a[_0x9842('0x5f')]));if(_0x2d650a['application']['toLowerCase']()==_0x9842('0x60')&&_['startsWith'](_0x2d650a[_0x9842('0x5f')][_0x9842('0x61')](),_0x9842('0x62'))){var _0x155e12=_0x2d650a[_0x9842('0x5f')][_0x9842('0x63')]('=');var _0x2e13dc=_0x155e12[0x0][_0x9842('0x64')](_0x155e12[0x0][_0x9842('0x65')]('(')+0x1,_0x155e12[0x0]['lastIndexOf'](')'));var _0x2a7a00=_0x155e12[0x1];channels[_0x2d650a['uniqueid']][_0x2e13dc]=_0x2a7a00;}if(!_['includes'](['hangup','noop',_0x9842('0x66'),_0x9842('0x60'),_0x9842('0x67')],_0x2d650a['application'][_0x9842('0x61')]())){channels[_0x2d650a['uniqueid']]['lastapplication']=_0x2d650a[_0x9842('0x5e')];channels[_0x2d650a[_0x9842('0x9')]][_0x9842('0x68')]=_0x2d650a['appdata'];}}}catch(_0x29f1e2){utils[_0x9842('0x3a')](util[_0x9842('0x8')](_0x9842('0x5c'),_0x2d650a['uniqueid']),_0x29f1e2);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e929e9d..60dd5cc 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 _0x53fc=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x53fc,0x1de));var _0xc53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fc[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require('./utils');exports[_0xc53f('0x0')]=function(){utils[_0xc53f('0x1')](_0xc53f('0x2'));};exports[_0xc53f('0x3')]=function(){utils['info'](_0xc53f('0x4'));};exports[_0xc53f('0x5')]=function(){utils['info'](_0xc53f('0x6'));};exports[_0xc53f('0x7')]=function(_0x48dded){utils[_0xc53f('0x7')](_0xc53f('0x8'),_0x48dded);};exports[_0xc53f('0x9')]=function(){utils[_0xc53f('0x1')](_0xc53f('0xa'));};exports[_0xc53f('0xb')]=function(_0x11ffa8){}; \ No newline at end of file +var _0x3764=['[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x357296,_0xc0c1b2){var _0x464469=function(_0x2f93e0){while(--_0x2f93e0){_0x357296['push'](_0x357296['shift']());}};_0x464469(++_0xc0c1b2);}(_0x3764,0x1f3));var _0x4376=function(_0x310baf,_0x4c6d2f){_0x310baf=_0x310baf-0x0;var _0xc68c9c=_0x3764[_0x310baf];return _0xc68c9c;};'use strict';var utils=require('./utils');exports[_0x4376('0x0')]=function(){utils[_0x4376('0x1')](_0x4376('0x2'));};exports[_0x4376('0x3')]=function(){utils['info'](_0x4376('0x4'));};exports[_0x4376('0x5')]=function(){utils[_0x4376('0x1')](_0x4376('0x6'));};exports['error']=function(_0x2223a4){utils['error'](_0x4376('0x7'),_0x2223a4);};exports[_0x4376('0x8')]=function(){utils[_0x4376('0x1')](_0x4376('0x9'));};exports[_0x4376('0xa')]=function(_0x25066c){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 588c4cb..e346e58 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 _0x0a32=['[%s][dials][hangup]','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','appdata','toLowerCase','set','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','starttime','now','called','error','dialend','ANSWER','assign','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','billableseconds'];(function(_0x261038,_0x2fab28){var _0x2fd230=function(_0x429660){while(--_0x429660){_0x261038['push'](_0x261038['shift']());}};_0x2fd230(++_0x2fab28);}(_0x0a32,0xf6));var _0x20a3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0a32[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x20a3('0x0'));var util=require('util');var utils=require(_0x20a3('0x1'));var dials={};function writeDB(_0xe680f3){utils[_0x20a3('0x2')](util[_0x20a3('0x3')](_0x20a3('0x4'),_0xe680f3['uniqueid'],_0xe680f3[_0x20a3('0x5')],_0xe680f3['dialstring'],_0xe680f3[_0x20a3('0x6')],_0xe680f3[_0x20a3('0x7')],_0xe680f3[_0x20a3('0x8')]));utils['request'](_0x20a3('0x9'),_0xe680f3);delete dials[_0xe680f3['uniqueid']];}exports[_0x20a3('0xa')]=function(_0x579446){try{utils[_0x20a3('0xb')](util[_0x20a3('0x3')](_0x20a3('0xc'),_0x579446[_0x20a3('0xd')]),_0x579446);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x579446[_0x20a3('0xd')],_0x579446['application'],_0x579446[_0x20a3('0xe')]));if(_0x579446['application'][_0x20a3('0xf')]()==_0x20a3('0x10')&&_['startsWith'](_0x579446[_0x20a3('0xe')][_0x20a3('0xf')](),_0x20a3('0x11'))){var _0x1af6ee=_0x579446[_0x20a3('0xe')][_0x20a3('0x12')]('=');dials[_0x579446[_0x20a3('0xd')]]={'routeId':_0x1af6ee[0x1]};}}catch(_0x2d4660){utils['error'](util['format']('[%s][dials][newexten]',_0x579446[_0x20a3('0xd')]),_0x2d4660);}};exports[_0x20a3('0x13')]=function(_0x47b440){try{utils[_0x20a3('0xb')](util[_0x20a3('0x3')](_0x20a3('0x14'),_0x47b440[_0x20a3('0xd')]),_0x47b440);if(!_[_0x20a3('0x15')](_0x47b440[_0x20a3('0x16')][_0x20a3('0x17')])){utils[_0x20a3('0x2')](util[_0x20a3('0x3')](_0x20a3('0x18'),_0x47b440[_0x20a3('0xd')],_0x47b440[_0x20a3('0x19')]));dials[_0x47b440[_0x20a3('0xd')]]={'routeId':_0x47b440[_0x20a3('0x19')]};}}catch(_0x2d1328){utils['error'](util[_0x20a3('0x3')](_0x20a3('0x14'),_0x47b440[_0x20a3('0xd')]),_0x2d1328);}};exports[_0x20a3('0x1a')]=function(_0x1f4bee){try{if(!_[_0x20a3('0x15')](dials[_0x1f4bee[_0x20a3('0xd')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x1f4bee['uniqueid']),_0x1f4bee);dials[_0x1f4bee['uniqueid']]=_['assign'](dials[_0x1f4bee[_0x20a3('0xd')]],_0x1f4bee);dials[_0x1f4bee[_0x20a3('0xd')]][_0x20a3('0x1b')]=utils[_0x20a3('0x1c')]();dials[_0x1f4bee['uniqueid']]['lastevent']=_0x20a3('0x1d');utils['info'](util[_0x20a3('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1f4bee[_0x20a3('0xd')],dials[_0x1f4bee[_0x20a3('0xd')]][_0x20a3('0x1b')]));}}catch(_0x637507){utils[_0x20a3('0x1e')](util[_0x20a3('0x3')]('[%s][dials][dialbegin]',_0x1f4bee[_0x20a3('0xd')]),_0x637507);}};exports[_0x20a3('0x1f')]=function(_0x34f542){try{if(!_[_0x20a3('0x15')](dials[_0x34f542[_0x20a3('0xd')]])){utils['debug'](util[_0x20a3('0x3')]('[%s][dials][dialend]',_0x34f542[_0x20a3('0xd')]),_0x34f542);dials[_0x34f542[_0x20a3('0xd')]][_0x20a3('0x8')]=_0x34f542['dialstatus'];if(_0x34f542[_0x20a3('0x8')]==_0x20a3('0x20')){dials[_0x34f542['uniqueid']]=_[_0x20a3('0x21')](dials[_0x34f542[_0x20a3('0xd')]],_0x34f542);dials[_0x34f542[_0x20a3('0xd')]][_0x20a3('0x22')]=utils[_0x20a3('0x1c')]();dials[_0x34f542[_0x20a3('0xd')]][_0x20a3('0x23')]=_0x20a3('0x24');utils[_0x20a3('0x2')](util[_0x20a3('0x3')](_0x20a3('0x25'),_0x34f542[_0x20a3('0xd')],_0x34f542[_0x20a3('0x8')],dials[_0x34f542['uniqueid']][_0x20a3('0x22')]));}else{utils[_0x20a3('0x2')](util['format'](_0x20a3('0x26'),_0x34f542[_0x20a3('0xd')],_0x34f542[_0x20a3('0x8')]));}}}catch(_0x5d4470){utils[_0x20a3('0x1e')](util[_0x20a3('0x3')](_0x20a3('0x27'),_0x34f542[_0x20a3('0xd')]),_0x5d4470);}};exports[_0x20a3('0x28')]=function(_0x4e9093){try{if(!_[_0x20a3('0x15')](dials[_0x4e9093[_0x20a3('0xd')]])){utils['debug'](util[_0x20a3('0x3')]('[%s][dials][hangup]',_0x4e9093['uniqueid']),_0x4e9093);utils[_0x20a3('0x2')](util[_0x20a3('0x3')](_0x20a3('0x29'),_0x4e9093[_0x20a3('0xd')],_0x4e9093['calleridnum'],_0x4e9093[_0x20a3('0x2a')],_0x4e9093[_0x20a3('0x2b')]));dials[_0x4e9093['uniqueid']]=_['assign'](dials[_0x4e9093[_0x20a3('0xd')]],{'endtime':utils[_0x20a3('0x1c')](),'lastevent':_0x20a3('0x2c')});dials[_0x4e9093[_0x20a3('0xd')]]['duration']=utils[_0x20a3('0x2d')](dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x2e')],dials[_0x4e9093['uniqueid']]['starttime']);dials[_0x4e9093[_0x20a3('0xd')]]['holdtime']=utils[_0x20a3('0x2d')](dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x22')]||dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x2e')],dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x1b')]);dials[_0x4e9093['uniqueid']][_0x20a3('0x2f')]=dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x22')]?utils['diffTime'](dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x2e')],dials[_0x4e9093[_0x20a3('0xd')]][_0x20a3('0x22')]):0x0;writeDB(dials[_0x4e9093['uniqueid']]);}}catch(_0x28ed04){utils[_0x20a3('0x1e')](util[_0x20a3('0x3')](_0x20a3('0x30'),_0x4e9093[_0x20a3('0xd')]),_0x28ed04);}}; \ No newline at end of file +var _0x5891=['startsWith','appdata','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','answertime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','calleridnum','request','uniqueid','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set'];(function(_0x53bc75,_0x87e8e0){var _0x381ae6=function(_0x48f6fd){while(--_0x48f6fd){_0x53bc75['push'](_0x53bc75['shift']());}};_0x381ae6(++_0x87e8e0);}(_0x5891,0x12e));var _0x1589=function(_0x544697,_0x101aa7){_0x544697=_0x544697-0x0;var _0x468ff2=_0x5891[_0x544697];return _0x468ff2;};'use strict';var _=require(_0x1589('0x0'));var util=require(_0x1589('0x1'));var utils=require(_0x1589('0x2'));var dials={};function writeDB(_0x5e4325){utils[_0x1589('0x3')](util['format'](_0x1589('0x4'),_0x5e4325['uniqueid'],_0x5e4325['channel'],_0x5e4325['dialstring'],_0x5e4325[_0x1589('0x5')],_0x5e4325['connectedlinenum'],_0x5e4325['dialstatus']));utils[_0x1589('0x6')]('CreateVoiceDialReport',_0x5e4325);delete dials[_0x5e4325[_0x1589('0x7')]];}exports[_0x1589('0x8')]=function(_0x4706ee){try{utils[_0x1589('0x9')](util[_0x1589('0xa')](_0x1589('0xb'),_0x4706ee[_0x1589('0x7')]),_0x4706ee);utils['info'](util[_0x1589('0xa')](_0x1589('0xc'),_0x4706ee[_0x1589('0x7')],_0x4706ee[_0x1589('0xd')],_0x4706ee['appdata']));if(_0x4706ee[_0x1589('0xd')][_0x1589('0xe')]()==_0x1589('0xf')&&_[_0x1589('0x10')](_0x4706ee[_0x1589('0x11')][_0x1589('0xe')](),_0x1589('0x12'))){var _0x16fdb4=_0x4706ee['appdata'][_0x1589('0x13')]('=');dials[_0x4706ee['uniqueid']]={'routeId':_0x16fdb4[0x1]};}}catch(_0x1d59eb){utils['error'](util['format']('[%s][dials][newexten]',_0x4706ee[_0x1589('0x7')]),_0x1d59eb);}};exports[_0x1589('0x14')]=function(_0x8531d4){try{utils[_0x1589('0x9')](util[_0x1589('0xa')](_0x1589('0x15'),_0x8531d4[_0x1589('0x7')]),_0x8531d4);if(!_[_0x1589('0x16')](_0x8531d4[_0x1589('0x17')][_0x1589('0x18')])){utils[_0x1589('0x3')](util[_0x1589('0xa')](_0x1589('0x19'),_0x8531d4[_0x1589('0x7')],_0x8531d4[_0x1589('0x1a')]));dials[_0x8531d4[_0x1589('0x7')]]={'routeId':_0x8531d4[_0x1589('0x1a')]};}}catch(_0x5039fa){utils[_0x1589('0x1b')](util['format'](_0x1589('0x15'),_0x8531d4['uniqueid']),_0x5039fa);}};exports[_0x1589('0x1c')]=function(_0x44ffbb){try{if(!_[_0x1589('0x16')](dials[_0x44ffbb[_0x1589('0x7')]])){utils[_0x1589('0x9')](util[_0x1589('0xa')](_0x1589('0x1d'),_0x44ffbb[_0x1589('0x7')]),_0x44ffbb);dials[_0x44ffbb['uniqueid']]=_[_0x1589('0x1e')](dials[_0x44ffbb[_0x1589('0x7')]],_0x44ffbb);dials[_0x44ffbb[_0x1589('0x7')]][_0x1589('0x1f')]=utils[_0x1589('0x20')]();dials[_0x44ffbb[_0x1589('0x7')]][_0x1589('0x21')]=_0x1589('0x22');utils[_0x1589('0x3')](util[_0x1589('0xa')](_0x1589('0x23'),_0x44ffbb[_0x1589('0x7')],dials[_0x44ffbb[_0x1589('0x7')]][_0x1589('0x1f')]));}}catch(_0x17523c){utils['error'](util[_0x1589('0xa')](_0x1589('0x1d'),_0x44ffbb[_0x1589('0x7')]),_0x17523c);}};exports['dialend']=function(_0x50b055){try{if(!_[_0x1589('0x16')](dials[_0x50b055[_0x1589('0x7')]])){utils[_0x1589('0x9')](util[_0x1589('0xa')](_0x1589('0x24'),_0x50b055['uniqueid']),_0x50b055);dials[_0x50b055[_0x1589('0x7')]]['dialstatus']=_0x50b055[_0x1589('0x25')];if(_0x50b055[_0x1589('0x25')]==_0x1589('0x26')){dials[_0x50b055['uniqueid']]=_[_0x1589('0x1e')](dials[_0x50b055[_0x1589('0x7')]],_0x50b055);dials[_0x50b055[_0x1589('0x7')]]['answertime']=utils[_0x1589('0x20')]();dials[_0x50b055[_0x1589('0x7')]][_0x1589('0x21')]=_0x1589('0x27');utils[_0x1589('0x3')](util[_0x1589('0xa')](_0x1589('0x28'),_0x50b055['uniqueid'],_0x50b055[_0x1589('0x25')],dials[_0x50b055[_0x1589('0x7')]]['answertime']));}else{utils['info'](util[_0x1589('0xa')](_0x1589('0x29'),_0x50b055[_0x1589('0x7')],_0x50b055['dialstatus']));}}}catch(_0x5ccb4c){utils[_0x1589('0x1b')](util['format'](_0x1589('0x24'),_0x50b055['uniqueid']),_0x5ccb4c);}};exports[_0x1589('0x2a')]=function(_0x217391){try{if(!_['isNil'](dials[_0x217391[_0x1589('0x7')]])){utils['debug'](util['format'](_0x1589('0x2b'),_0x217391[_0x1589('0x7')]),_0x217391);utils[_0x1589('0x3')](util[_0x1589('0xa')](_0x1589('0x2c'),_0x217391['uniqueid'],_0x217391[_0x1589('0x5')],_0x217391[_0x1589('0x2d')],_0x217391[_0x1589('0x2e')]));dials[_0x217391[_0x1589('0x7')]]=_[_0x1589('0x1e')](dials[_0x217391[_0x1589('0x7')]],{'endtime':utils[_0x1589('0x20')](),'lastevent':_0x1589('0x2f')});dials[_0x217391[_0x1589('0x7')]][_0x1589('0x30')]=utils[_0x1589('0x31')](dials[_0x217391[_0x1589('0x7')]][_0x1589('0x32')],dials[_0x217391[_0x1589('0x7')]][_0x1589('0x1f')]);dials[_0x217391['uniqueid']][_0x1589('0x33')]=utils[_0x1589('0x31')](dials[_0x217391['uniqueid']][_0x1589('0x34')]||dials[_0x217391[_0x1589('0x7')]][_0x1589('0x32')],dials[_0x217391['uniqueid']][_0x1589('0x1f')]);dials[_0x217391['uniqueid']]['billableseconds']=dials[_0x217391[_0x1589('0x7')]][_0x1589('0x34')]?utils[_0x1589('0x31')](dials[_0x217391['uniqueid']][_0x1589('0x32')],dials[_0x217391['uniqueid']][_0x1589('0x34')]):0x0;writeDB(dials[_0x217391[_0x1589('0x7')]]);}}catch(_0x32ecd5){utils['error'](util[_0x1589('0xa')](_0x1589('0x2b'),_0x217391[_0x1589('0x7')]),_0x32ecd5);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 2e5116e..1643a62 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 _0x81af=['local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','util','xdr','disabled','env','production'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x81af,0x106));var _0xf81a=function(_0x1c6270,_0x666f6a){_0x1c6270=_0x1c6270-0x0;var _0x4ca7ab=_0x81af[_0x1c6270];return _0x4ca7ab;};var AsteriskManager=require(_0xf81a('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xf81a('0x1'));var isXDREnabled=config[_0xf81a('0x2')]&&config['xdr']['disabled']?!config[_0xf81a('0x2')][_0xf81a('0x3')]:!![];var isProduction=config[_0xf81a('0x4')]===_0xf81a('0x5')||![];var isLocalAsterisk=config[_0xf81a('0x2')]&&config[_0xf81a('0x2')][_0xf81a('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xf81a('0x7')][_0xf81a('0x8')],config['asterisk']['ip'],config[_0xf81a('0x7')][_0xf81a('0x9')],config[_0xf81a('0x7')][_0xf81a('0xa')],!![]);ami[_0xf81a('0xb')]();if(!isXDREnabled){utils[_0xf81a('0xc')](_0xf81a('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xf81a('0xc')](_0xf81a('0xe'));}else{var agents=require(_0xf81a('0xf'));var calls=require(_0xf81a('0x10'));var queues=require(_0xf81a('0x11'));var recordings=require('./recordings.controller');var members=require(_0xf81a('0x12'));var dials=require('./dials.controller');var transfers=require(_0xf81a('0x13'));var core=require(_0xf81a('0x14'));ami['on'](_0xf81a('0x15'),core[_0xf81a('0x15')]);ami['on'](_0xf81a('0x16'),core[_0xf81a('0x16')]);ami['on'](_0xf81a('0x17'),core[_0xf81a('0x17')]);ami['on'](_0xf81a('0x18'),core[_0xf81a('0x18')]);ami['on'](_0xf81a('0x19'),core[_0xf81a('0x19')]);ami['on'](_0xf81a('0x1a'),core[_0xf81a('0x1a')]);ami['on'](_0xf81a('0x1b'),function(_0x18ecee){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x1e'),_0x18ecee[_0xf81a('0x1f')]),_0x18ecee);members[_0xf81a('0x1b')](_0x18ecee);}catch(_0x53e5ec){utils['error'](util[_0xf81a('0x1d')](_0xf81a('0x1e'),_0x18ecee['device']),_0x53e5ec);}});ami['on']('agentcalled',function(_0x21662f){try{utils[_0xf81a('0x1c')](util['format'](_0xf81a('0x20'),_0x21662f[_0xf81a('0x21')]),_0x21662f);agents[_0xf81a('0x22')](_0x21662f);}catch(_0x1e6159){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x20'),_0x21662f[_0xf81a('0x21')]),_0x1e6159);}});ami['on']('agentringnoanswer',function(_0x4ccd7e){try{utils[_0xf81a('0x1c')](util['format']('[%s][index][agentringnoanswer]',_0x4ccd7e['uniqueid']),_0x4ccd7e);agents['agentringnoanswer'](_0x4ccd7e);}catch(_0x265a5e){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')]('[%s][index][agentringnoanswer]',_0x4ccd7e[_0xf81a('0x21')]),_0x265a5e);}});ami['on'](_0xf81a('0x23'),function(_0x47c784){try{utils[_0xf81a('0x1c')](util['format'](_0xf81a('0x24'),_0x47c784[_0xf81a('0x21')]),_0x47c784);agents[_0xf81a('0x23')](_0x47c784);queues[_0xf81a('0x23')](_0x47c784);}catch(_0x2356c0){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x24'),_0x47c784[_0xf81a('0x21')]),_0x2356c0);}});ami['on'](_0xf81a('0x25'),function(_0x28fcc4){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x26'),_0x28fcc4[_0xf81a('0x21')]),_0x28fcc4);agents[_0xf81a('0x25')](_0x28fcc4);queues[_0xf81a('0x25')](_0x28fcc4);members['agentcomplete'](_0x28fcc4);}catch(_0x131d51){utils['error'](util[_0xf81a('0x1d')]('[%s][index][agentcomplete]',_0x28fcc4[_0xf81a('0x21')]),_0x131d51);}});ami['on']('queuecallerabandon',function(_0x5b1d03){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x27'),_0x5b1d03[_0xf81a('0x21')]),_0x5b1d03);agents[_0xf81a('0x28')](_0x5b1d03);queues[_0xf81a('0x28')](_0x5b1d03);}catch(_0x171241){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x27'),_0x5b1d03[_0xf81a('0x21')]),_0x171241);}});ami['on'](_0xf81a('0x29'),function(_0x4be92c){try{utils['debug'](util['format'](_0xf81a('0x2a'),_0x4be92c['uniqueid']),_0x4be92c);queues[_0xf81a('0x29')](_0x4be92c);recordings[_0xf81a('0x29')](_0x4be92c);}catch(_0x5491b8){utils[_0xf81a('0x18')](util['format'](_0xf81a('0x2a'),_0x4be92c['uniqueid']),_0x5491b8);}});ami['on'](_0xf81a('0x2b'),function(_0xb614d1){try{utils['debug'](util[_0xf81a('0x1d')](_0xf81a('0x2c'),_0xb614d1[_0xf81a('0x21')]),_0xb614d1);queues[_0xf81a('0x2b')](_0xb614d1);}catch(_0x65993e){utils[_0xf81a('0x18')](util['format']('[%s][index][queuecallerleave]',_0xb614d1[_0xf81a('0x21')]),_0x65993e);}});ami['on'](_0xf81a('0x2d'),function(_0x174ef8){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x2e'),_0x174ef8['uniqueid']),_0x174ef8);queues[_0xf81a('0x2d')](_0x174ef8);calls[_0xf81a('0x2d')](_0x174ef8);}catch(_0x345983){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')]('[%s][index][musiconholdstart]',_0x174ef8[_0xf81a('0x21')]),_0x345983);}});ami['on'](_0xf81a('0x2f'),function(_0x28c85c){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')]('[%s][index][musiconholdstop]',_0x28c85c['uniqueid']),_0x28c85c);queues['musiconholdstop'](_0x28c85c);calls[_0xf81a('0x2f')](_0x28c85c);}catch(_0x500e9a){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x30'),_0x28c85c[_0xf81a('0x21')]),_0x500e9a);}});ami['on'](_0xf81a('0x31'),function(_0x72e73c){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x32'),_0x72e73c[_0xf81a('0x21')]),_0x72e73c);calls[_0xf81a('0x31')](_0x72e73c);recordings['newstate'](_0x72e73c);}catch(_0x32d4ba){utils['error'](util[_0xf81a('0x1d')](_0xf81a('0x32'),_0x72e73c[_0xf81a('0x21')]),_0x32d4ba);}});ami['on'](_0xf81a('0x33'),function(_0x5271a8){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x34'),_0x5271a8[_0xf81a('0x21')]),_0x5271a8);calls[_0xf81a('0x33')](_0x5271a8);recordings[_0xf81a('0x33')](_0x5271a8);dials[_0xf81a('0x33')](_0x5271a8);agents[_0xf81a('0x33')](_0x5271a8);queues[_0xf81a('0x33')](_0x5271a8);}catch(_0x2a8447){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x34'),_0x5271a8[_0xf81a('0x21')]),_0x2a8447);}});ami['on'](_0xf81a('0x35'),function(_0x1b851b){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')]('[%s][index][cdr]',_0x1b851b[_0xf81a('0x21')]),_0x1b851b);members[_0xf81a('0x35')](_0x1b851b);}catch(_0x11b813){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')]('[%s][index][cdr]',_0x1b851b[_0xf81a('0x21')]),_0x11b813);}});ami['on'](_0xf81a('0x36'),function(_0x2bf0de){try{utils[_0xf81a('0x1c')](util['format'](_0xf81a('0x37'),_0x2bf0de[_0xf81a('0x21')]),_0x2bf0de);queues[_0xf81a('0x36')](_0x2bf0de);agents['blindtransfer'](_0x2bf0de);transfers[_0xf81a('0x36')](_0x2bf0de);}catch(_0x57d72f){utils['error'](util[_0xf81a('0x1d')](_0xf81a('0x37'),_0x2bf0de[_0xf81a('0x21')]),_0x57d72f);}});ami['on']('attendedtransfer',function(_0x911f66){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x38'),_0x911f66[_0xf81a('0x39')]),_0x911f66);queues[_0xf81a('0x3a')](_0x911f66);transfers[_0xf81a('0x3a')](_0x911f66);agents[_0xf81a('0x3a')](_0x911f66);calls[_0xf81a('0x3a')](_0x911f66);}catch(_0x57263d){utils[_0xf81a('0x18')](util['format'](_0xf81a('0x38'),_0x911f66[_0xf81a('0x39')]),_0x57263d);}});ami['on'](_0xf81a('0x3b'),function(_0x5a3aff){try{utils[_0xf81a('0x1c')](util['format']('[%s][index][varset]',_0x5a3aff[_0xf81a('0x21')]),_0x5a3aff);queues['varset'](_0x5a3aff);recordings['varset'](_0x5a3aff);calls[_0xf81a('0x3b')](_0x5a3aff);dials[_0xf81a('0x3b')](_0x5a3aff);}catch(_0x1b0e34){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')]('[%s][index][varset]',_0x5a3aff[_0xf81a('0x21')]),_0x1b0e34);}});ami['on']('newexten',function(_0x32f9cc){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')]('[%s][index][newexten]',_0x32f9cc[_0xf81a('0x21')]),_0x32f9cc);calls[_0xf81a('0x3c')](_0x32f9cc);recordings[_0xf81a('0x3c')](_0x32f9cc);dials[_0xf81a('0x3c')](_0x32f9cc);}catch(_0x646632){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')]('[%s][index][newexten]',_0x32f9cc[_0xf81a('0x21')]),_0x646632);}});ami['on'](_0xf81a('0x3d'),function(_0x23298a){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x3e'),_0x23298a[_0xf81a('0x21')]),_0x23298a);calls[_0xf81a('0x3d')](_0x23298a);recordings[_0xf81a('0x3d')](_0x23298a);}catch(_0x1c89cb){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x3e'),_0x23298a[_0xf81a('0x21')]),_0x1c89cb);}});ami['on']('dialbegin',function(_0x1af307){try{utils['debug'](util['format'](_0xf81a('0x3f'),_0x1af307[_0xf81a('0x21')]),_0x1af307);dials['dialbegin'](_0x1af307);}catch(_0x235d7a){utils[_0xf81a('0x18')](util[_0xf81a('0x1d')](_0xf81a('0x40'),_0x1af307[_0xf81a('0x21')]),_0x235d7a);}});ami['on'](_0xf81a('0x41'),function(_0x2cef91){try{utils[_0xf81a('0x1c')](util[_0xf81a('0x1d')](_0xf81a('0x42'),_0x2cef91[_0xf81a('0x21')]),_0x2cef91);dials['dialend'](_0x2cef91);}catch(_0x265b2e){utils['error'](util[_0xf81a('0x1d')](_0xf81a('0x42'),_0x2cef91[_0xf81a('0x21')]),_0x265b2e);}});} \ No newline at end of file +var _0xe48f=['managerevent','devicestatechange','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','format','agentringnoanswer','[%s][index][agentringnoanswer]','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','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','asterisk','port','username','keepConnected','info','./agents.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','shutdown','fullybooted','error','close'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0xe48f,0x171));var _0xfe48=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xe48f[_0xea8947];return _0x2455e9;};var AsteriskManager=require(_0xfe48('0x0'));var config=require('../../config/environment');var utils=require(_0xfe48('0x1'));var util=require(_0xfe48('0x2'));var isXDREnabled=config[_0xfe48('0x3')]&&config[_0xfe48('0x3')][_0xfe48('0x4')]?!config[_0xfe48('0x3')]['disabled']:!![];var isProduction=config[_0xfe48('0x5')]===_0xfe48('0x6')||![];var isLocalAsterisk=config[_0xfe48('0x3')]&&config[_0xfe48('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xfe48('0x7')][_0xfe48('0x8')],config[_0xfe48('0x7')]['ip'],config[_0xfe48('0x7')][_0xfe48('0x9')],config['asterisk']['password'],!![]);ami[_0xfe48('0xa')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xfe48('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xfe48('0xc'));var calls=require('./calls.controller');var queues=require(_0xfe48('0xd'));var recordings=require(_0xfe48('0xe'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xfe48('0xf'));var core=require(_0xfe48('0x10'));ami['on']('connect',core['connect']);ami['on'](_0xfe48('0x11'),core['shutdown']);ami['on'](_0xfe48('0x12'),core[_0xfe48('0x12')]);ami['on'](_0xfe48('0x13'),core['error']);ami['on'](_0xfe48('0x14'),core['close']);ami['on'](_0xfe48('0x15'),core[_0xfe48('0x15')]);ami['on'](_0xfe48('0x16'),function(_0x238515){try{utils['debug'](util['format'](_0xfe48('0x17'),_0x238515['device']),_0x238515);members[_0xfe48('0x16')](_0x238515);}catch(_0x50f5e4){utils[_0xfe48('0x13')](util['format'](_0xfe48('0x17'),_0x238515[_0xfe48('0x18')]),_0x50f5e4);}});ami['on'](_0xfe48('0x19'),function(_0xb732b4){try{utils[_0xfe48('0x1a')](util['format'](_0xfe48('0x1b'),_0xb732b4[_0xfe48('0x1c')]),_0xb732b4);agents[_0xfe48('0x19')](_0xb732b4);}catch(_0x1aac07){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')](_0xfe48('0x1b'),_0xb732b4['uniqueid']),_0x1aac07);}});ami['on'](_0xfe48('0x1e'),function(_0x3c3d60){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')]('[%s][index][agentringnoanswer]',_0x3c3d60[_0xfe48('0x1c')]),_0x3c3d60);agents['agentringnoanswer'](_0x3c3d60);}catch(_0x1800ff){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')](_0xfe48('0x1f'),_0x3c3d60[_0xfe48('0x1c')]),_0x1800ff);}});ami['on'](_0xfe48('0x20'),function(_0x12c5a1){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')]('[%s][index][agentconnect]',_0x12c5a1[_0xfe48('0x1c')]),_0x12c5a1);agents[_0xfe48('0x20')](_0x12c5a1);queues[_0xfe48('0x20')](_0x12c5a1);}catch(_0xca52e2){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')]('[%s][index][agentconnect]',_0x12c5a1[_0xfe48('0x1c')]),_0xca52e2);}});ami['on'](_0xfe48('0x21'),function(_0x24553f){try{utils[_0xfe48('0x1a')](util['format'](_0xfe48('0x22'),_0x24553f[_0xfe48('0x1c')]),_0x24553f);agents[_0xfe48('0x21')](_0x24553f);queues[_0xfe48('0x21')](_0x24553f);members['agentcomplete'](_0x24553f);}catch(_0x4ab180){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')](_0xfe48('0x22'),_0x24553f[_0xfe48('0x1c')]),_0x4ab180);}});ami['on'](_0xfe48('0x23'),function(_0x1453e){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')]('[%s][index][queuecallerabandon]',_0x1453e['uniqueid']),_0x1453e);agents[_0xfe48('0x23')](_0x1453e);queues[_0xfe48('0x23')](_0x1453e);}catch(_0x52fd6a){utils[_0xfe48('0x13')](util['format'](_0xfe48('0x24'),_0x1453e[_0xfe48('0x1c')]),_0x52fd6a);}});ami['on'](_0xfe48('0x25'),function(_0x435bd2){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')](_0xfe48('0x26'),_0x435bd2[_0xfe48('0x1c')]),_0x435bd2);queues[_0xfe48('0x25')](_0x435bd2);recordings['queuecallerjoin'](_0x435bd2);}catch(_0x3e8b47){utils['error'](util[_0xfe48('0x1d')](_0xfe48('0x26'),_0x435bd2[_0xfe48('0x1c')]),_0x3e8b47);}});ami['on'](_0xfe48('0x27'),function(_0x109b94){try{utils['debug'](util[_0xfe48('0x1d')](_0xfe48('0x28'),_0x109b94['uniqueid']),_0x109b94);queues[_0xfe48('0x27')](_0x109b94);}catch(_0x214346){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')]('[%s][index][queuecallerleave]',_0x109b94[_0xfe48('0x1c')]),_0x214346);}});ami['on']('musiconholdstart',function(_0x53eadc){try{utils[_0xfe48('0x1a')](util['format'](_0xfe48('0x29'),_0x53eadc['uniqueid']),_0x53eadc);queues[_0xfe48('0x2a')](_0x53eadc);calls[_0xfe48('0x2a')](_0x53eadc);}catch(_0x3e5292){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')]('[%s][index][musiconholdstart]',_0x53eadc['uniqueid']),_0x3e5292);}});ami['on']('musiconholdstop',function(_0x23f675){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')]('[%s][index][musiconholdstop]',_0x23f675[_0xfe48('0x1c')]),_0x23f675);queues[_0xfe48('0x2b')](_0x23f675);calls[_0xfe48('0x2b')](_0x23f675);}catch(_0x37c54b){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')](_0xfe48('0x2c'),_0x23f675[_0xfe48('0x1c')]),_0x37c54b);}});ami['on'](_0xfe48('0x2d'),function(_0x9da2bb){try{utils['debug'](util[_0xfe48('0x1d')](_0xfe48('0x2e'),_0x9da2bb[_0xfe48('0x1c')]),_0x9da2bb);calls[_0xfe48('0x2d')](_0x9da2bb);recordings['newstate'](_0x9da2bb);}catch(_0x48d047){utils[_0xfe48('0x13')](util['format']('[%s][index][newstate]',_0x9da2bb['uniqueid']),_0x48d047);}});ami['on'](_0xfe48('0x2f'),function(_0x436316){try{utils['debug'](util[_0xfe48('0x1d')]('[%s][index][hangup]',_0x436316[_0xfe48('0x1c')]),_0x436316);calls['hangup'](_0x436316);recordings[_0xfe48('0x2f')](_0x436316);dials[_0xfe48('0x2f')](_0x436316);agents['hangup'](_0x436316);queues[_0xfe48('0x2f')](_0x436316);}catch(_0x17f184){utils['error'](util[_0xfe48('0x1d')]('[%s][index][hangup]',_0x436316[_0xfe48('0x1c')]),_0x17f184);}});ami['on'](_0xfe48('0x30'),function(_0x4ed33e){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')](_0xfe48('0x31'),_0x4ed33e[_0xfe48('0x1c')]),_0x4ed33e);members[_0xfe48('0x30')](_0x4ed33e);}catch(_0x37635b){utils['error'](util[_0xfe48('0x1d')](_0xfe48('0x31'),_0x4ed33e['uniqueid']),_0x37635b);}});ami['on'](_0xfe48('0x32'),function(_0x4538d5){try{utils['debug'](util[_0xfe48('0x1d')](_0xfe48('0x33'),_0x4538d5[_0xfe48('0x1c')]),_0x4538d5);queues[_0xfe48('0x32')](_0x4538d5);agents[_0xfe48('0x32')](_0x4538d5);transfers[_0xfe48('0x32')](_0x4538d5);}catch(_0x535fdf){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')]('[%s][index][blindtransfer]',_0x4538d5[_0xfe48('0x1c')]),_0x535fdf);}});ami['on']('attendedtransfer',function(_0x40d1cd){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')]('[%s][index][attendedtransfer]',_0x40d1cd[_0xfe48('0x34')]),_0x40d1cd);queues[_0xfe48('0x35')](_0x40d1cd);transfers[_0xfe48('0x35')](_0x40d1cd);agents[_0xfe48('0x35')](_0x40d1cd);calls['attendedtransfer'](_0x40d1cd);}catch(_0x1283f1){utils[_0xfe48('0x13')](util['format'](_0xfe48('0x36'),_0x40d1cd['origtransfereruniqueid']),_0x1283f1);}});ami['on'](_0xfe48('0x37'),function(_0x136501){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')](_0xfe48('0x38'),_0x136501[_0xfe48('0x1c')]),_0x136501);queues[_0xfe48('0x37')](_0x136501);recordings[_0xfe48('0x37')](_0x136501);calls[_0xfe48('0x37')](_0x136501);dials[_0xfe48('0x37')](_0x136501);}catch(_0x2ce195){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')]('[%s][index][varset]',_0x136501['uniqueid']),_0x2ce195);}});ami['on'](_0xfe48('0x39'),function(_0x66493a){try{utils['debug'](util[_0xfe48('0x1d')](_0xfe48('0x3a'),_0x66493a['uniqueid']),_0x66493a);calls[_0xfe48('0x39')](_0x66493a);recordings['newexten'](_0x66493a);dials[_0xfe48('0x39')](_0x66493a);}catch(_0x59356f){utils['error'](util[_0xfe48('0x1d')](_0xfe48('0x3a'),_0x66493a['uniqueid']),_0x59356f);}});ami['on']('newchannel',function(_0x2ae4c8){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')](_0xfe48('0x3b'),_0x2ae4c8[_0xfe48('0x1c')]),_0x2ae4c8);calls[_0xfe48('0x3c')](_0x2ae4c8);recordings['newchannel'](_0x2ae4c8);}catch(_0x23a7f0){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')](_0xfe48('0x3b'),_0x2ae4c8[_0xfe48('0x1c')]),_0x23a7f0);}});ami['on'](_0xfe48('0x3d'),function(_0x17931c){try{utils['debug'](util[_0xfe48('0x1d')]('[%s][index][dialbegin]',_0x17931c[_0xfe48('0x1c')]),_0x17931c);dials['dialbegin'](_0x17931c);}catch(_0x3047be){utils['error'](util[_0xfe48('0x1d')](_0xfe48('0x3e'),_0x17931c[_0xfe48('0x1c')]),_0x3047be);}});ami['on'](_0xfe48('0x3f'),function(_0x4547bd){try{utils[_0xfe48('0x1a')](util[_0xfe48('0x1d')]('[%s][index][dialend]',_0x4547bd[_0xfe48('0x1c')]),_0x4547bd);dials[_0xfe48('0x3f')](_0x4547bd);}catch(_0x1fbaa1){utils[_0xfe48('0x13')](util[_0xfe48('0x1d')](_0xfe48('0x40'),_0x4547bd[_0xfe48('0x1c')]),_0x1fbaa1);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9969856..5c9acce 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 _0xcc36=['data2','type','interface','then','name','internal','CreateMemberReport','getUserByName','split','membername','request','error','[%s][members][writeDB]','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcc36,0x1a6));var _0x6cc3=function(_0x1da646,_0x2095ba){_0x1da646=_0x1da646-0x0;var _0x170282=_0xcc36[_0x1da646];return _0x170282;};'use strict';var _=require(_0x6cc3('0x0'));var util=require(_0x6cc3('0x1'));var utils=require(_0x6cc3('0x2'));var members={};var exclude=[_0x6cc3('0x3'),_0x6cc3('0x4')];function writeDB(_0x1519d6){utils[_0x6cc3('0x5')](util[_0x6cc3('0x6')](_0x6cc3('0x7'),_0x1519d6[_0x6cc3('0x8')],_0x1519d6['interface'],_0x1519d6[_0x6cc3('0x9')],_0x1519d6[_0x6cc3('0xa')],_0x1519d6['membername'],_0x1519d6[_0x6cc3('0xb')]));if(_0x1519d6[_0x6cc3('0xc')]){utils['getUserByInterface'](_0x1519d6[_0x6cc3('0xc')])[_0x6cc3('0xd')](function(_0x3c79eb){if(_0x3c79eb){_0x1519d6['membername']=_0x3c79eb[_0x6cc3('0xe')];_0x1519d6[_0x6cc3('0xf')]=_0x3c79eb['internal'];utils['request'](_0x6cc3('0x10'),_0x1519d6);}else{utils[_0x6cc3('0x11')](_0x1519d6['interface'][_0x6cc3('0x12')]('/')[0x1])['then'](function(_0x2cfa5e){if(_0x2cfa5e){_0x1519d6[_0x6cc3('0x13')]=_0x2cfa5e['name'];_0x1519d6['internal']=_0x2cfa5e[_0x6cc3('0xf')];utils[_0x6cc3('0x14')]('CreateMemberReport',_0x1519d6);}});}})['catch'](function(_0x1f8c2d){utils[_0x6cc3('0x15')](util[_0x6cc3('0x6')](_0x6cc3('0x16'),_0x1519d6['uniqueid']),_0x1f8c2d);});}delete members[_0x1519d6[_0x6cc3('0xc')]];}function startsWith(_0x2e315e,_0x4e9b34){return _['some'](_0x2e315e,function(_0x26fe64){return _['startsWith'](_0x4e9b34,_0x26fe64);});}exports['devicestatechange']=function(_0x4f4f5b){try{utils[_0x6cc3('0x17')](util[_0x6cc3('0x6')](_0x6cc3('0x18'),members[_0x4f4f5b['device']]?members[_0x4f4f5b[_0x6cc3('0x19')]]['uniqueid']:_0x4f4f5b['device']),_0x4f4f5b);utils[_0x6cc3('0x5')](util['format'](_0x6cc3('0x1a'),members[_0x4f4f5b[_0x6cc3('0x19')]]?members[_0x4f4f5b['device']][_0x6cc3('0x8')]:_0x4f4f5b['device'],_0x4f4f5b[_0x6cc3('0x1b')],_0x4f4f5b[_0x6cc3('0x19')]));switch(_0x4f4f5b['state']){case _0x6cc3('0x1c'):case'BUSY':if(!startsWith(exclude,_0x4f4f5b['device'])){members[_0x4f4f5b[_0x6cc3('0x19')]]={'channel':'voice','interface':_0x4f4f5b[_0x6cc3('0x19')],'type':_0x6cc3('0x1d'),'enterAt':utils[_0x6cc3('0x1e')](),'role':_0x6cc3('0x1f')};}break;case _0x6cc3('0x20'):if(!_[_0x6cc3('0x21')](members[_0x4f4f5b[_0x6cc3('0x19')]])){members[_0x4f4f5b['device']][_0x6cc3('0x22')]=utils[_0x6cc3('0x1e')]();members[_0x4f4f5b[_0x6cc3('0x19')]][_0x6cc3('0x23')]=utils[_0x6cc3('0x24')](members[_0x4f4f5b[_0x6cc3('0x19')]][_0x6cc3('0x22')],members[_0x4f4f5b['device']][_0x6cc3('0x25')]);if(members[_0x4f4f5b['device']][_0x6cc3('0x8')]){writeDB(members[_0x4f4f5b[_0x6cc3('0x19')]]);}}break;default:break;}}catch(_0x554519){utils[_0x6cc3('0x15')](util[_0x6cc3('0x6')](_0x6cc3('0x18'),members[_0x4f4f5b['device']]?members[_0x4f4f5b[_0x6cc3('0x19')]][_0x6cc3('0x8')]:_0x4f4f5b[_0x6cc3('0x19')]),_0x554519);}};exports['agentcomplete']=function(_0x4a031d){try{if(!_['isNil'](members[_0x4a031d['interface']])){utils['debug'](util[_0x6cc3('0x6')](_0x6cc3('0x26'),_0x4a031d[_0x6cc3('0x8')]),_0x4a031d);utils[_0x6cc3('0x5')](util[_0x6cc3('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x4a031d['uniqueid'],_0x4a031d[_0x6cc3('0xc')],_0x4a031d[_0x6cc3('0x27')]));members[_0x4a031d[_0x6cc3('0xc')]]=_[_0x6cc3('0x28')](members[_0x4a031d[_0x6cc3('0xc')]],{'data4':_0x4a031d[_0x6cc3('0x27')],'uniqueid':_0x4a031d[_0x6cc3('0x8')]});}}catch(_0x108d07){utils[_0x6cc3('0x15')](util[_0x6cc3('0x6')](_0x6cc3('0x26'),_0x4a031d[_0x6cc3('0x8')]),_0x108d07);}};exports['cdr']=function(_0x1bc341){try{utils[_0x6cc3('0x17')](util[_0x6cc3('0x6')](_0x6cc3('0x29'),_0x1bc341[_0x6cc3('0x8')]),_0x1bc341);if(_0x1bc341['channel']){var _0x5a318f=_0x1bc341['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x5a318f])){members[_0x5a318f]=_[_0x6cc3('0x28')](members[_0x5a318f],{'data1':members[_0x5a318f][_0x6cc3('0x2a')]||_0x1bc341[_0x6cc3('0xb')],'data2':members[_0x5a318f][_0x6cc3('0xa')]||_0x1bc341[_0x6cc3('0x2b')],'data3':members[_0x5a318f][_0x6cc3('0x2c')]||_0x1bc341[_0x6cc3('0x2d')],'uniqueid':members[_0x5a318f][_0x6cc3('0x8')]||_0x1bc341[_0x6cc3('0x8')]});utils[_0x6cc3('0x5')](util[_0x6cc3('0x6')](_0x6cc3('0x2e'),_0x1bc341[_0x6cc3('0x8')],members[_0x5a318f][_0x6cc3('0x2a')],members[_0x5a318f][_0x6cc3('0xa')],members[_0x5a318f]['data3']));if(members[_0x5a318f][_0x6cc3('0x22')]){writeDB(members[_0x5a318f]);}}}if(_0x1bc341['destinationchannel']){var _0x3c9e89=_0x1bc341[_0x6cc3('0x2f')]['split']('-')[0x0];if(!_['isNil'](members[_0x3c9e89])){members[_0x3c9e89]=_[_0x6cc3('0x28')](members[_0x3c9e89],{'data1':members[_0x3c9e89]['data1']||_0x1bc341['type'],'data2':members[_0x3c9e89][_0x6cc3('0xa')]||_0x1bc341[_0x6cc3('0x2b')],'data3':members[_0x3c9e89]['data3']||_0x1bc341['destination'],'uniqueid':members[_0x3c9e89]['uniqueid']||_0x1bc341[_0x6cc3('0x8')]});utils[_0x6cc3('0x5')](util[_0x6cc3('0x6')](_0x6cc3('0x2e'),_0x1bc341[_0x6cc3('0x8')],members[_0x3c9e89]['data1'],members[_0x3c9e89]['data2'],members[_0x3c9e89]['data3']));if(members[_0x3c9e89][_0x6cc3('0x22')]){writeDB(members[_0x3c9e89]);}}}}catch(_0x3e2c91){utils[_0x6cc3('0x15')](util[_0x6cc3('0x6')](_0x6cc3('0x29'),_0x1bc341[_0x6cc3('0x8')]),_0x3e2c91);}}; \ No newline at end of file +var _0x05ba=['NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','[%s][members][cdr]','assign','type','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','catch','error','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x05ba,0x116));var _0xa05b=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x05ba[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xa05b('0x0'));var util=require(_0xa05b('0x1'));var utils=require(_0xa05b('0x2'));var members={};var exclude=[_0xa05b('0x3'),_0xa05b('0x4')];function writeDB(_0x3493ff){utils[_0xa05b('0x5')](util[_0xa05b('0x6')](_0xa05b('0x7'),_0x3493ff[_0xa05b('0x8')],_0x3493ff[_0xa05b('0x9')],_0x3493ff[_0xa05b('0xa')],_0x3493ff['data2'],_0x3493ff[_0xa05b('0xb')],_0x3493ff['type']));if(_0x3493ff[_0xa05b('0x9')]){utils[_0xa05b('0xc')](_0x3493ff['interface'])[_0xa05b('0xd')](function(_0x55624b){if(_0x55624b){_0x3493ff[_0xa05b('0xb')]=_0x55624b['name'];_0x3493ff[_0xa05b('0xe')]=_0x55624b[_0xa05b('0xe')];utils[_0xa05b('0xf')](_0xa05b('0x10'),_0x3493ff);}else{utils[_0xa05b('0x11')](_0x3493ff[_0xa05b('0x9')][_0xa05b('0x12')]('/')[0x1])['then'](function(_0x5506b4){if(_0x5506b4){_0x3493ff[_0xa05b('0xb')]=_0x5506b4['name'];_0x3493ff[_0xa05b('0xe')]=_0x5506b4['internal'];utils[_0xa05b('0xf')]('CreateMemberReport',_0x3493ff);}});}})[_0xa05b('0x13')](function(_0x419547){utils[_0xa05b('0x14')](util[_0xa05b('0x6')]('[%s][members][writeDB]',_0x3493ff[_0xa05b('0x8')]),_0x419547);});}delete members[_0x3493ff['interface']];}function startsWith(_0x3dd108,_0x4b7a4d){return _['some'](_0x3dd108,function(_0x96f37){return _[_0xa05b('0x15')](_0x4b7a4d,_0x96f37);});}exports[_0xa05b('0x16')]=function(_0x7838ba){try{utils[_0xa05b('0x17')](util[_0xa05b('0x6')](_0xa05b('0x18'),members[_0x7838ba[_0xa05b('0x19')]]?members[_0x7838ba[_0xa05b('0x19')]][_0xa05b('0x8')]:_0x7838ba[_0xa05b('0x19')]),_0x7838ba);utils['info'](util[_0xa05b('0x6')](_0xa05b('0x1a'),members[_0x7838ba['device']]?members[_0x7838ba['device']][_0xa05b('0x8')]:_0x7838ba[_0xa05b('0x19')],_0x7838ba[_0xa05b('0x1b')],_0x7838ba['device']));switch(_0x7838ba[_0xa05b('0x1b')]){case _0xa05b('0x1c'):case _0xa05b('0x1d'):if(!startsWith(exclude,_0x7838ba['device'])){members[_0x7838ba[_0xa05b('0x19')]]={'channel':_0xa05b('0x1e'),'interface':_0x7838ba['device'],'type':_0xa05b('0x1f'),'enterAt':utils[_0xa05b('0x20')](),'role':_0xa05b('0x21')};}break;case _0xa05b('0x22'):if(!_[_0xa05b('0x23')](members[_0x7838ba[_0xa05b('0x19')]])){members[_0x7838ba[_0xa05b('0x19')]][_0xa05b('0x24')]=utils[_0xa05b('0x20')]();members[_0x7838ba[_0xa05b('0x19')]]['duration']=utils[_0xa05b('0x25')](members[_0x7838ba[_0xa05b('0x19')]][_0xa05b('0x24')],members[_0x7838ba[_0xa05b('0x19')]][_0xa05b('0x26')]);if(members[_0x7838ba['device']][_0xa05b('0x8')]){writeDB(members[_0x7838ba[_0xa05b('0x19')]]);}}break;default:break;}}catch(_0x1b4992){utils['error'](util[_0xa05b('0x6')](_0xa05b('0x18'),members[_0x7838ba[_0xa05b('0x19')]]?members[_0x7838ba[_0xa05b('0x19')]]['uniqueid']:_0x7838ba[_0xa05b('0x19')]),_0x1b4992);}};exports[_0xa05b('0x27')]=function(_0x49b355){try{if(!_['isNil'](members[_0x49b355['interface']])){utils['debug'](util[_0xa05b('0x6')](_0xa05b('0x28'),_0x49b355[_0xa05b('0x8')]),_0x49b355);utils[_0xa05b('0x5')](util[_0xa05b('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x49b355['uniqueid'],_0x49b355['interface'],_0x49b355[_0xa05b('0x29')]));members[_0x49b355[_0xa05b('0x9')]]=_['assign'](members[_0x49b355['interface']],{'data4':_0x49b355[_0xa05b('0x29')],'uniqueid':_0x49b355[_0xa05b('0x8')]});}}catch(_0x5c5c65){utils[_0xa05b('0x14')](util['format'](_0xa05b('0x28'),_0x49b355[_0xa05b('0x8')]),_0x5c5c65);}};exports['cdr']=function(_0x478bae){try{utils[_0xa05b('0x17')](util[_0xa05b('0x6')](_0xa05b('0x2a'),_0x478bae[_0xa05b('0x8')]),_0x478bae);if(_0x478bae[_0xa05b('0xa')]){var _0x28686a=_0x478bae[_0xa05b('0xa')][_0xa05b('0x12')]('-')[0x0];if(!_[_0xa05b('0x23')](members[_0x28686a])){members[_0x28686a]=_[_0xa05b('0x2b')](members[_0x28686a],{'data1':members[_0x28686a]['data1']||_0x478bae[_0xa05b('0x2c')],'data2':members[_0x28686a][_0xa05b('0x2d')]||_0x478bae[_0xa05b('0x2e')],'data3':members[_0x28686a][_0xa05b('0x2f')]||_0x478bae[_0xa05b('0x30')],'uniqueid':members[_0x28686a][_0xa05b('0x8')]||_0x478bae[_0xa05b('0x8')]});utils['info'](util[_0xa05b('0x6')](_0xa05b('0x31'),_0x478bae[_0xa05b('0x8')],members[_0x28686a]['data1'],members[_0x28686a][_0xa05b('0x2d')],members[_0x28686a]['data3']));if(members[_0x28686a][_0xa05b('0x24')]){writeDB(members[_0x28686a]);}}}if(_0x478bae['destinationchannel']){var _0x4cde47=_0x478bae[_0xa05b('0x32')][_0xa05b('0x12')]('-')[0x0];if(!_[_0xa05b('0x23')](members[_0x4cde47])){members[_0x4cde47]=_[_0xa05b('0x2b')](members[_0x4cde47],{'data1':members[_0x4cde47][_0xa05b('0x33')]||_0x478bae[_0xa05b('0x2c')],'data2':members[_0x4cde47][_0xa05b('0x2d')]||_0x478bae[_0xa05b('0x2e')],'data3':members[_0x4cde47][_0xa05b('0x2f')]||_0x478bae[_0xa05b('0x30')],'uniqueid':members[_0x4cde47][_0xa05b('0x8')]||_0x478bae['uniqueid']});utils[_0xa05b('0x5')](util[_0xa05b('0x6')](_0xa05b('0x31'),_0x478bae[_0xa05b('0x8')],members[_0x4cde47][_0xa05b('0x33')],members[_0x4cde47][_0xa05b('0x2d')],members[_0x4cde47][_0xa05b('0x2f')]));if(members[_0x4cde47]['exitAt']){writeDB(members[_0x4cde47]);}}}}catch(_0x35353a){utils[_0xa05b('0x14')](util[_0xa05b('0x6')](_0xa05b('0x2a'),_0x478bae['uniqueid']),_0x35353a);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a867041..9d8af7a 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 _0x5068=['queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','value','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','clone','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5068,0x181));var _0x8506=function(_0x4de9e1,_0x49da18){_0x4de9e1=_0x4de9e1-0x0;var _0x214b06=_0x5068[_0x4de9e1];return _0x214b06;};'use strict';var _=require(_0x8506('0x0'));var util=require(_0x8506('0x1'));var utils=require(_0x8506('0x2'));var queues={};function writeDB(_0x46581){utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x5'),_0x46581[_0x8506('0x6')],_0x46581[_0x8506('0x7')],_0x46581[_0x8506('0x8')],_0x46581[_0x8506('0x9')],_0x46581[_0x8506('0xa')],_0x46581[_0x8506('0xb')],_0x46581[_0x8506('0xc')]));if(_0x46581[_0x8506('0x8')]){utils[_0x8506('0xd')](_0x46581[_0x8506('0x8')])['then'](function(_0x2d8ce3){if(_0x2d8ce3){_0x46581[_0x8506('0xe')]=_0x2d8ce3[_0x8506('0xe')];}utils['request'](_0x8506('0xf'),_0x46581);});}else{utils[_0x8506('0x10')]('CreateVoiceQueueReport',_0x46581);}if(_0x46581['transfereduniqueid']){delete queues[_0x46581[_0x8506('0x11')]];}else{delete queues[_0x46581[_0x8506('0x6')]];}}exports[_0x8506('0x12')]=function(_0x24ed72){try{utils[_0x8506('0x13')](util[_0x8506('0x4')]('[%s][queues][queuecallerjoin]',_0x24ed72[_0x8506('0x6')]),_0x24ed72);utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x14'),_0x24ed72[_0x8506('0x6')],_0x24ed72[_0x8506('0x8')],_0x24ed72[_0x8506('0x15')]));queues[_0x24ed72[_0x8506('0x6')]]=_['assign'](_0x24ed72,{'originalposition':_0x24ed72[_0x8506('0x15')],'queuecallerjoinAt':utils[_0x8506('0x16')](),'mohtime':0x0});}catch(_0x59b402){utils[_0x8506('0x17')](util[_0x8506('0x4')]('[%s][queues][queuecallerjoin]',_0x24ed72[_0x8506('0x6')]),_0x59b402);}};exports['hangup']=function(_0x3ead67){try{if(!_[_0x8506('0x18')](queues[_0x3ead67['uniqueid']])){utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x19'),_0x3ead67['uniqueid']),_0x3ead67);if(queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x1a')]){if(!queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x1b')]&&!queues[_0x3ead67['uniqueid']]['queuecallerexit']){queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x1c')]=!![];queues[_0x3ead67['uniqueid']]['queuecallercompleteAt']=utils[_0x8506('0x16')]();queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0xc')]=_0x8506('0x1d');}utils[_0x8506('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x3ead67[_0x8506('0x6')],queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x1e')],queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0xc')]));writeDB(queues[_0x3ead67[_0x8506('0x6')]]);}else if(queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x11')]){utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x1f'),_0x3ead67[_0x8506('0x6')],queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x1e')],queues[_0x3ead67['uniqueid']]['transfereduniqueid']));queues[queues[_0x3ead67[_0x8506('0x6')]]['transfereduniqueid']]=queues[_0x3ead67['uniqueid']];queues[queues[_0x3ead67[_0x8506('0x6')]][_0x8506('0x11')]][_0x8506('0x20')]=0x2;delete queues[_0x3ead67['uniqueid']];}}}catch(_0x5bae57){utils[_0x8506('0x17')](util[_0x8506('0x4')](_0x8506('0x19'),_0x3ead67[_0x8506('0x6')]),_0x5bae57);}};exports[_0x8506('0x21')]=function(_0x560bcf){try{utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x22'),_0x560bcf[_0x8506('0x6')]),_0x560bcf);if(!_['isNil'](_0x560bcf[_0x8506('0x23')]['queuestatus'])&&_0x560bcf['value'][_0x8506('0x24')]()!==_0x8506('0x25')){if(!_['isNil'](queues[_0x560bcf['uniqueid']])){queues[_0x560bcf[_0x8506('0x6')]]['queuecallerabandon']=![];queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x26')]=null;queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x27')]=!![];queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x28')]=utils[_0x8506('0x16')]();queues[_0x560bcf[_0x8506('0x6')]]['queuecallerexitreason']=_0x560bcf['value']['toUpperCase']();utils[_0x8506('0x3')](util['format'](_0x8506('0x29'),_0x560bcf[_0x8506('0x6')],queues[_0x560bcf[_0x8506('0x6')]]['name'],_0x560bcf['value'],queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0xc')]));writeDB(queues[_0x560bcf[_0x8506('0x6')]]);}}else if(!_[_0x8506('0x18')](_0x560bcf[_0x8506('0x23')][_0x8506('0x2a')])){if(!_[_0x8506('0x18')](queues[_0x560bcf[_0x8506('0x6')]])&&!queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x1b')]){queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x1b')]=![];queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x26')]=null;queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x27')]=!![];queues[_0x560bcf['uniqueid']][_0x8506('0x28')]=utils[_0x8506('0x16')]();queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0xc')]=_0x8506('0x2b');utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x2c'),_0x560bcf[_0x8506('0x6')],queues[_0x560bcf[_0x8506('0x6')]][_0x8506('0x1e')],_0x560bcf[_0x8506('0x2d')],queues[_0x560bcf[_0x8506('0x6')]]['queuecallerexitreason']));}}}catch(_0x3411ee){utils[_0x8506('0x17')](util[_0x8506('0x4')](_0x8506('0x22'),_0x560bcf[_0x8506('0x6')]),_0x3411ee);}};exports[_0x8506('0x1b')]=function(_0x166a5f){try{if(!_['isNil'](queues[_0x166a5f[_0x8506('0x6')]])){utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x2e'),_0x166a5f['uniqueid']),_0x166a5f);queues[_0x166a5f[_0x8506('0x6')]][_0x8506('0x27')]=![];queues[_0x166a5f['uniqueid']][_0x8506('0x28')]=null;queues[_0x166a5f[_0x8506('0x6')]]['queuecallerabandon']=!![];queues[_0x166a5f[_0x8506('0x6')]][_0x8506('0x26')]=utils[_0x8506('0x16')]();queues[_0x166a5f['uniqueid']]['queuecallerexitreason']='ABANDONED';utils[_0x8506('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x166a5f[_0x8506('0x6')],queues[_0x166a5f[_0x8506('0x6')]][_0x8506('0x1e')],queues[_0x166a5f['uniqueid']][_0x8506('0xc')]));}}catch(_0x8ad3cf){utils['error'](util[_0x8506('0x4')]('[%s][queues][queuecallerabandon]',_0x166a5f[_0x8506('0x6')]),_0x8ad3cf);}};exports[_0x8506('0x2f')]=function(_0x2cfb04){try{if(!_['isNil'](queues[_0x2cfb04[_0x8506('0x6')]])){utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x30'),_0x2cfb04['uniqueid']),_0x2cfb04);utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x31'),_0x2cfb04[_0x8506('0x6')],queues[_0x2cfb04[_0x8506('0x6')]]['name'],_0x2cfb04[_0x8506('0x32')],_0x2cfb04[_0x8506('0x33')]));queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x2f')]=!![];queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x1a')]=utils[_0x8506('0x16')]();queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x34')]=utils[_0x8506('0x35')](queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x1a')],queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x36')]);queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x15')]=_0x2cfb04['position'];queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x37')]=_0x2cfb04['count'];queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x32')]=_0x2cfb04['connectedlinenum'];queues[_0x2cfb04[_0x8506('0x6')]][_0x8506('0x33')]=_0x2cfb04[_0x8506('0x33')];}}catch(_0x379c1f){utils[_0x8506('0x17')](util[_0x8506('0x4')](_0x8506('0x30'),_0x2cfb04['uniqueid']),_0x379c1f);}};exports[_0x8506('0x38')]=function(_0x2e9543){try{if(!_['isNil'](queues[_0x2e9543['uniqueid']])){utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x39'),_0x2e9543['uniqueid']),_0x2e9543);utils[_0x8506('0x3')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2e9543[_0x8506('0x6')],queues[_0x2e9543[_0x8506('0x6')]]['name'],_0x2e9543[_0x8506('0x3a')],_0x2e9543[_0x8506('0x3b')]));queues[_0x2e9543[_0x8506('0x6')]][_0x8506('0x1b')]=![];queues[_0x2e9543['uniqueid']][_0x8506('0x1b')]=![];queues[_0x2e9543[_0x8506('0x6')]][_0x8506('0x26')]=null;queues[_0x2e9543['uniqueid']][_0x8506('0x27')]=![];queues[_0x2e9543[_0x8506('0x6')]][_0x8506('0xc')]=null;queues[_0x2e9543['uniqueid']][_0x8506('0x28')]=null;queues[_0x2e9543[_0x8506('0x6')]][_0x8506('0x3c')]=!![];queues[_0x2e9543[_0x8506('0x6')]][_0x8506('0xb')]=_0x2e9543[_0x8506('0x3b')];queues[_0x2e9543[_0x8506('0x6')]][_0x8506('0x9')]=_0x2e9543['membername'];}}catch(_0x54f0ce){utils[_0x8506('0x17')](util['format'](_0x8506('0x39'),_0x2e9543[_0x8506('0x6')]),_0x54f0ce);}};exports[_0x8506('0x3d')]=function(_0x48fcbe){try{if(!_[_0x8506('0x18')](queues[_0x48fcbe[_0x8506('0x6')]])){if(queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0x1a')]){utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x3e'),_0x48fcbe[_0x8506('0x6')]),_0x48fcbe);queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0x1b')]=![];queues[_0x48fcbe['uniqueid']][_0x8506('0x1b')]=![];queues[_0x48fcbe[_0x8506('0x6')]]['queuecallerabandonAt']=null;queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0x27')]=![];queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0x28')]=null;queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0x3c')]=!![];queues[_0x48fcbe['uniqueid']]['lastAssignedTo']=_0x48fcbe[_0x8506('0x3a')];queues[_0x48fcbe[_0x8506('0x6')]]['queuecallercomplete']=!![];queues[_0x48fcbe[_0x8506('0x6')]]['queuecallercompleteAt']=utils[_0x8506('0x16')]();if(_0x48fcbe['reason']==_0x8506('0x3f')){if(!queues[_0x48fcbe[_0x8506('0x6')]]['transfer']){queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0xc')]=_0x8506('0x40');}}else{queues[_0x48fcbe[_0x8506('0x6')]][_0x8506('0xc')]=_0x8506('0x41')+_0x48fcbe[_0x8506('0x42')]['toUpperCase']();}utils['info'](util[_0x8506('0x4')](_0x8506('0x43'),_0x48fcbe[_0x8506('0x6')],queues[_0x48fcbe[_0x8506('0x6')]]['name'],_0x48fcbe['membername'],queues[_0x48fcbe['uniqueid']][_0x8506('0xc')]));writeDB(queues[_0x48fcbe[_0x8506('0x6')]]);}}}catch(_0x46d959){utils[_0x8506('0x17')](util[_0x8506('0x4')](_0x8506('0x3e'),_0x48fcbe['uniqueid']),_0x46d959);}};exports[_0x8506('0x44')]=function(_0x4d03bc){try{if(!_['isNil'](queues[_0x4d03bc[_0x8506('0x45')]])){utils['debug'](util[_0x8506('0x4')](_0x8506('0x46'),_0x4d03bc[_0x8506('0x6')]),_0x4d03bc);queues[_0x4d03bc[_0x8506('0x45')]][_0x8506('0x3f')]=!![];queues[_0x4d03bc['transfereeuniqueid']][_0x8506('0x47')]='BLIND';queues[_0x4d03bc[_0x8506('0x45')]][_0x8506('0x48')]=_0x4d03bc['extension'];queues[_0x4d03bc[_0x8506('0x45')]][_0x8506('0x49')]=_0x4d03bc['transfereeuniqueid'];queues[_0x4d03bc['transfereeuniqueid']][_0x8506('0xc')]=_0x8506('0x4a');utils['info'](util[_0x8506('0x4')](_0x8506('0x4b'),_0x4d03bc[_0x8506('0x6')],queues[_0x4d03bc['transfereeuniqueid']][_0x8506('0x1e')],_0x4d03bc['transfereeuniqueid'],_0x4d03bc[_0x8506('0x4c')]));}}catch(_0x5b1341){utils[_0x8506('0x17')](util['format'](_0x8506('0x46'),_0x4d03bc[_0x8506('0x6')]),_0x5b1341);}};exports[_0x8506('0x4d')]=function(_0x5e1e03){try{utils[_0x8506('0x13')](util[_0x8506('0x4')](_0x8506('0x4e'),_0x5e1e03[_0x8506('0x4f')]),_0x5e1e03);if(_0x5e1e03[_0x8506('0x4f')]==_0x5e1e03[_0x8506('0x50')]){if(!_[_0x8506('0x18')](queues[_0x5e1e03[_0x8506('0x51')]])){utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x52'),_0x5e1e03['origtransfereruniqueid'],queues[_0x5e1e03[_0x8506('0x51')]]['name'],_0x5e1e03[_0x8506('0x53')]));queues[_0x5e1e03[_0x8506('0x51')]][_0x8506('0x3f')]=!![];queues[_0x5e1e03[_0x8506('0x51')]][_0x8506('0x47')]=_0x8506('0x54');queues[_0x5e1e03['secondtransfererlinkedid']]['transferexten']=_0x5e1e03[_0x8506('0x53')];queues[_0x5e1e03['secondtransfererlinkedid']][_0x8506('0x49')]=_0x5e1e03['origtransfereruniqueid'];queues[_0x5e1e03[_0x8506('0x51')]][_0x8506('0xc')]='ATTENDEDTRANSFER';}if(!_[_0x8506('0x18')](queues[_0x5e1e03[_0x8506('0x50')]])){if(_0x5e1e03[_0x8506('0x55')]&&queues[_0x5e1e03[_0x8506('0x55')]]){queues[_0x5e1e03[_0x8506('0x55')]]['queuecallerenterreason']=0x1;queues[_0x5e1e03[_0x8506('0x45')]]=_[_0x8506('0x56')](queues[_0x5e1e03[_0x8506('0x55')]]);queues[_0x5e1e03[_0x8506('0x45')]]['transfereduniqueid']=_0x5e1e03['transfertargetuniqueid'];queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0x20')]=0x2;queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0xa')]=queues[_0x5e1e03[_0x8506('0x51')]]['calleridnum'];queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0x57')]=queues[_0x5e1e03['secondtransfererlinkedid']][_0x8506('0x57')];queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0x36')]=utils['now']();queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0x1a')]=utils['now']();queues[_0x5e1e03['transfereeuniqueid']][_0x8506('0x34')]=0x0;queues[_0x5e1e03[_0x8506('0x45')]]['mohtime']=0x0;utils[_0x8506('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5e1e03['origtransfereruniqueid'],queues[_0x5e1e03[_0x8506('0x45')]]['name'],queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0xa')],queues[_0x5e1e03[_0x8506('0x45')]][_0x8506('0x57')]));}else{utils[_0x8506('0x3')](util['format'](_0x8506('0x58'),_0x5e1e03[_0x8506('0x4f')],queues[_0x5e1e03[_0x8506('0x50')]]['name'],_0x5e1e03[_0x8506('0x51')]));queues[_0x5e1e03[_0x8506('0x50')]][_0x8506('0x11')]=_0x5e1e03['secondtransfererlinkedid'];}}}else if(_0x5e1e03[_0x8506('0x59')]==_0x5e1e03[_0x8506('0x51')]){if(!_[_0x8506('0x18')](queues[_0x5e1e03[_0x8506('0x50')]])){utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x5a'),_0x5e1e03[_0x8506('0x4f')],queues[_0x5e1e03[_0x8506('0x50')]]['name'],_0x5e1e03['secondtransfereruniqueid'],_0x5e1e03['secondtransfererexten']));queues[_0x5e1e03[_0x8506('0x50')]][_0x8506('0x3f')]=!![];queues[_0x5e1e03[_0x8506('0x50')]]['transfertype']=_0x8506('0x54');queues[_0x5e1e03[_0x8506('0x50')]][_0x8506('0x48')]=_0x5e1e03[_0x8506('0x5b')];queues[_0x5e1e03['origtransfererlinkedid']][_0x8506('0x49')]=_0x5e1e03[_0x8506('0x59')];queues[_0x5e1e03['origtransfererlinkedid']][_0x8506('0xc')]=_0x8506('0x5c');}if(!_['isNil'](queues[_0x5e1e03[_0x8506('0x51')]])){if(_0x5e1e03[_0x8506('0x5d')]&&queues[_0x5e1e03[_0x8506('0x5d')]]){queues[_0x5e1e03[_0x8506('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x5e1e03['transfertargetuniqueid']]=_[_0x8506('0x56')](queues[_0x5e1e03[_0x8506('0x5d')]]);queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x11')]=_0x5e1e03[_0x8506('0x5e')];queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x20')]=0x2;queues[_0x5e1e03['transfertargetuniqueid']]['calleridnum']=queues[_0x5e1e03[_0x8506('0x50')]][_0x8506('0xa')];queues[_0x5e1e03[_0x8506('0x5e')]]['calleridname']=queues[_0x5e1e03[_0x8506('0x50')]]['calleridname'];queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x36')]=utils[_0x8506('0x16')]();queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x1a')]=utils[_0x8506('0x16')]();queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x34')]=0x0;queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x5f')]=0x0;utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x60'),_0x5e1e03[_0x8506('0x4f')],queues[_0x5e1e03[_0x8506('0x5e')]]['name'],queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0x11')],queues[_0x5e1e03[_0x8506('0x5e')]][_0x8506('0xa')],queues[_0x5e1e03[_0x8506('0x5e')]]['calleridname']));}else{utils[_0x8506('0x3')](util[_0x8506('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5e1e03[_0x8506('0x4f')],queues[_0x5e1e03[_0x8506('0x51')]]['name'],_0x5e1e03[_0x8506('0x50')]));queues[_0x5e1e03[_0x8506('0x51')]][_0x8506('0x11')]=_0x5e1e03[_0x8506('0x50')];}}}}catch(_0x5d1e54){utils[_0x8506('0x17')](util[_0x8506('0x4')](_0x8506('0x4e'),_0x5e1e03['origtransfereruniqueid']),_0x5d1e54);}};exports[_0x8506('0x61')]=function(_0x321010){try{if(!_[_0x8506('0x18')](queues[_0x321010[_0x8506('0x6')]])){utils['debug'](util[_0x8506('0x4')](_0x8506('0x62'),_0x321010[_0x8506('0x6')]),_0x321010);queues[_0x321010[_0x8506('0x6')]][_0x8506('0x63')]=utils[_0x8506('0x16')]();utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x64'),_0x321010[_0x8506('0x6')],queues[_0x321010['uniqueid']]['name'],queues[_0x321010[_0x8506('0x6')]][_0x8506('0x63')]));}}catch(_0x1b6b2b){utils[_0x8506('0x17')](util[_0x8506('0x4')]('[%s][queues][musiconholdstart]',_0x321010['uniqueid']),_0x1b6b2b);}};exports[_0x8506('0x65')]=function(_0x4236c4){try{if(!_[_0x8506('0x18')](queues[_0x4236c4[_0x8506('0x6')]])){if(!_[_0x8506('0x18')](queues[_0x4236c4[_0x8506('0x6')]]['musiconholdstartAt'])){utils['debug'](util[_0x8506('0x4')]('[%s][queues][musiconholdstop]',_0x4236c4[_0x8506('0x6')]),_0x4236c4);queues[_0x4236c4['uniqueid']][_0x8506('0x5f')]+=utils['diffTime'](utils['now'](),queues[_0x4236c4[_0x8506('0x6')]][_0x8506('0x63')]);utils[_0x8506('0x3')](util[_0x8506('0x4')](_0x8506('0x66'),_0x4236c4[_0x8506('0x6')],queues[_0x4236c4[_0x8506('0x6')]][_0x8506('0x1e')],queues[_0x4236c4['uniqueid']][_0x8506('0x5f')]));delete queues[_0x4236c4['uniqueid']][_0x8506('0x63')];}}}catch(_0x325c5c){utils[_0x8506('0x17')](util[_0x8506('0x4')]('[%s][queues][musiconholdstop]',_0x4236c4['uniqueid']),_0x325c5c);}}; \ No newline at end of file +var _0x9d48=['membername','assigned','destaccountcode','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfertype','BLIND','transfereeuniqueid','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','clone','transfereelinkedid','calleridname','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s'];(function(_0x3fec22,_0x2b4645){var _0x402df5=function(_0xd9129f){while(--_0xd9129f){_0x3fec22['push'](_0x3fec22['shift']());}};_0x402df5(++_0x2b4645);}(_0x9d48,0x1d0));var _0x89d4=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x9d48[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x89d4('0x0'));var util=require(_0x89d4('0x1'));var utils=require(_0x89d4('0x2'));var queues={};function writeDB(_0x423fbc){utils['info'](util[_0x89d4('0x3')](_0x89d4('0x4'),_0x423fbc['uniqueid'],_0x423fbc[_0x89d4('0x5')],_0x423fbc[_0x89d4('0x6')],_0x423fbc[_0x89d4('0x7')],_0x423fbc[_0x89d4('0x8')],_0x423fbc[_0x89d4('0x9')],_0x423fbc[_0x89d4('0xa')]));if(_0x423fbc[_0x89d4('0x6')]){utils[_0x89d4('0xb')](_0x423fbc[_0x89d4('0x6')])[_0x89d4('0xc')](function(_0x32a3ef){if(_0x32a3ef){_0x423fbc[_0x89d4('0xd')]=_0x32a3ef[_0x89d4('0xd')];}utils['request']('CreateVoiceQueueReport',_0x423fbc);});}else{utils[_0x89d4('0xe')](_0x89d4('0xf'),_0x423fbc);}if(_0x423fbc['transfereduniqueid']){delete queues[_0x423fbc[_0x89d4('0x10')]];}else{delete queues[_0x423fbc['uniqueid']];}}exports[_0x89d4('0x11')]=function(_0x3a30f9){try{utils[_0x89d4('0x12')](util['format'](_0x89d4('0x13'),_0x3a30f9[_0x89d4('0x14')]),_0x3a30f9);utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x16'),_0x3a30f9[_0x89d4('0x14')],_0x3a30f9[_0x89d4('0x6')],_0x3a30f9[_0x89d4('0x17')]));queues[_0x3a30f9[_0x89d4('0x14')]]=_[_0x89d4('0x18')](_0x3a30f9,{'originalposition':_0x3a30f9[_0x89d4('0x17')],'queuecallerjoinAt':utils[_0x89d4('0x19')](),'mohtime':0x0});}catch(_0x20f2ee){utils['error'](util[_0x89d4('0x3')](_0x89d4('0x13'),_0x3a30f9[_0x89d4('0x14')]),_0x20f2ee);}};exports['hangup']=function(_0x3f309f){try{if(!_[_0x89d4('0x1a')](queues[_0x3f309f[_0x89d4('0x14')]])){utils[_0x89d4('0x12')](util['format']('[%s][queues][hangup]',_0x3f309f[_0x89d4('0x14')]),_0x3f309f);if(queues[_0x3f309f['uniqueid']][_0x89d4('0x1b')]){if(!queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x1c')]&&!queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x1d')]){queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x1e')]=!![];queues[_0x3f309f[_0x89d4('0x14')]]['queuecallercompleteAt']=utils['now']();queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0xa')]=_0x89d4('0x1f');}utils[_0x89d4('0x15')](util[_0x89d4('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x3f309f[_0x89d4('0x14')],queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x20')],queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0xa')]));writeDB(queues[_0x3f309f['uniqueid']]);}else if(queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x10')]){utils['info'](util[_0x89d4('0x3')](_0x89d4('0x21'),_0x3f309f['uniqueid'],queues[_0x3f309f['uniqueid']][_0x89d4('0x20')],queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x10')]));queues[queues[_0x3f309f['uniqueid']][_0x89d4('0x10')]]=queues[_0x3f309f[_0x89d4('0x14')]];queues[queues[_0x3f309f[_0x89d4('0x14')]][_0x89d4('0x10')]][_0x89d4('0x22')]=0x2;delete queues[_0x3f309f[_0x89d4('0x14')]];}}}catch(_0x53d86f){utils[_0x89d4('0x23')](util['format'](_0x89d4('0x24'),_0x3f309f['uniqueid']),_0x53d86f);}};exports[_0x89d4('0x25')]=function(_0x8444cf){try{utils[_0x89d4('0x12')](util['format'](_0x89d4('0x26'),_0x8444cf['uniqueid']),_0x8444cf);if(!_[_0x89d4('0x1a')](_0x8444cf[_0x89d4('0x27')][_0x89d4('0x28')])&&_0x8444cf[_0x89d4('0x29')]['toUpperCase']()!==_0x89d4('0x2a')){if(!_[_0x89d4('0x1a')](queues[_0x8444cf[_0x89d4('0x14')]])){queues[_0x8444cf['uniqueid']][_0x89d4('0x1c')]=![];queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0x2b')]=null;queues[_0x8444cf[_0x89d4('0x14')]]['queuecallerexit']=!![];queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0x2c')]=utils[_0x89d4('0x19')]();queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0xa')]=_0x8444cf[_0x89d4('0x29')][_0x89d4('0x2d')]();utils[_0x89d4('0x15')](util[_0x89d4('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x8444cf[_0x89d4('0x14')],queues[_0x8444cf['uniqueid']][_0x89d4('0x20')],_0x8444cf[_0x89d4('0x29')],queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0xa')]));writeDB(queues[_0x8444cf[_0x89d4('0x14')]]);}}else if(!_[_0x89d4('0x1a')](_0x8444cf[_0x89d4('0x27')][_0x89d4('0x2e')])){if(!_['isNil'](queues[_0x8444cf[_0x89d4('0x14')]])&&!queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0x1c')]){queues[_0x8444cf['uniqueid']][_0x89d4('0x1c')]=![];queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0x2b')]=null;queues[_0x8444cf[_0x89d4('0x14')]]['queuecallerexit']=!![];queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0x2c')]=utils[_0x89d4('0x19')]();queues[_0x8444cf['uniqueid']]['queuecallerexitreason']=_0x89d4('0x2f');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x8444cf['uniqueid'],queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0x20')],_0x8444cf['value'],queues[_0x8444cf[_0x89d4('0x14')]][_0x89d4('0xa')]));}}}catch(_0x322bf5){utils['error'](util[_0x89d4('0x3')](_0x89d4('0x26'),_0x8444cf[_0x89d4('0x14')]),_0x322bf5);}};exports[_0x89d4('0x1c')]=function(_0x535fa3){try{if(!_[_0x89d4('0x1a')](queues[_0x535fa3['uniqueid']])){utils[_0x89d4('0x12')](util[_0x89d4('0x3')](_0x89d4('0x30'),_0x535fa3['uniqueid']),_0x535fa3);queues[_0x535fa3[_0x89d4('0x14')]][_0x89d4('0x1d')]=![];queues[_0x535fa3[_0x89d4('0x14')]][_0x89d4('0x2c')]=null;queues[_0x535fa3[_0x89d4('0x14')]][_0x89d4('0x1c')]=!![];queues[_0x535fa3[_0x89d4('0x14')]][_0x89d4('0x2b')]=utils[_0x89d4('0x19')]();queues[_0x535fa3[_0x89d4('0x14')]][_0x89d4('0xa')]=_0x89d4('0x31');utils['info'](util[_0x89d4('0x3')](_0x89d4('0x32'),_0x535fa3[_0x89d4('0x14')],queues[_0x535fa3[_0x89d4('0x14')]][_0x89d4('0x20')],queues[_0x535fa3['uniqueid']]['queuecallerexitreason']));}}catch(_0x57acab){utils[_0x89d4('0x23')](util[_0x89d4('0x3')]('[%s][queues][queuecallerabandon]',_0x535fa3['uniqueid']),_0x57acab);}};exports[_0x89d4('0x33')]=function(_0x284850){try{if(!_[_0x89d4('0x1a')](queues[_0x284850[_0x89d4('0x14')]])){utils[_0x89d4('0x12')](util['format'](_0x89d4('0x34'),_0x284850['uniqueid']),_0x284850);utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x35'),_0x284850[_0x89d4('0x14')],queues[_0x284850[_0x89d4('0x14')]][_0x89d4('0x20')],_0x284850[_0x89d4('0x36')],_0x284850[_0x89d4('0x37')]));queues[_0x284850[_0x89d4('0x14')]][_0x89d4('0x33')]=!![];queues[_0x284850[_0x89d4('0x14')]][_0x89d4('0x1b')]=utils[_0x89d4('0x19')]();queues[_0x284850[_0x89d4('0x14')]]['holdtime']=utils[_0x89d4('0x38')](queues[_0x284850['uniqueid']]['queuecallerleaveAt'],queues[_0x284850[_0x89d4('0x14')]][_0x89d4('0x39')]);queues[_0x284850[_0x89d4('0x14')]]['position']=_0x284850[_0x89d4('0x17')];queues[_0x284850[_0x89d4('0x14')]][_0x89d4('0x3a')]=_0x284850[_0x89d4('0x3a')];queues[_0x284850[_0x89d4('0x14')]][_0x89d4('0x36')]=_0x284850[_0x89d4('0x36')];queues[_0x284850['uniqueid']][_0x89d4('0x37')]=_0x284850[_0x89d4('0x37')];}}catch(_0x5087c2){utils[_0x89d4('0x23')](util['format'](_0x89d4('0x34'),_0x284850[_0x89d4('0x14')]),_0x5087c2);}};exports['agentconnect']=function(_0x48566a){try{if(!_[_0x89d4('0x1a')](queues[_0x48566a[_0x89d4('0x14')]])){utils[_0x89d4('0x12')](util[_0x89d4('0x3')](_0x89d4('0x3b'),_0x48566a[_0x89d4('0x14')]),_0x48566a);utils[_0x89d4('0x15')](util['format'](_0x89d4('0x3c'),_0x48566a['uniqueid'],queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0x20')],_0x48566a[_0x89d4('0x3d')],_0x48566a['destaccountcode']));queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0x1c')]=![];queues[_0x48566a['uniqueid']]['queuecallerabandon']=![];queues[_0x48566a['uniqueid']][_0x89d4('0x2b')]=null;queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0x1d')]=![];queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0xa')]=null;queues[_0x48566a[_0x89d4('0x14')]]['queuecallerexitAt']=null;queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0x3e')]=!![];queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0x9')]=_0x48566a[_0x89d4('0x3f')];queues[_0x48566a[_0x89d4('0x14')]][_0x89d4('0x7')]=_0x48566a[_0x89d4('0x3d')];}}catch(_0x290a17){utils[_0x89d4('0x23')](util[_0x89d4('0x3')](_0x89d4('0x3b'),_0x48566a[_0x89d4('0x14')]),_0x290a17);}};exports[_0x89d4('0x40')]=function(_0x2b5ea8){try{if(!_['isNil'](queues[_0x2b5ea8[_0x89d4('0x14')]])){if(queues[_0x2b5ea8[_0x89d4('0x14')]][_0x89d4('0x1b')]){utils[_0x89d4('0x12')](util[_0x89d4('0x3')]('[%s][queues][agentcomplete]',_0x2b5ea8['uniqueid']),_0x2b5ea8);queues[_0x2b5ea8['uniqueid']][_0x89d4('0x1c')]=![];queues[_0x2b5ea8[_0x89d4('0x14')]]['queuecallerabandon']=![];queues[_0x2b5ea8[_0x89d4('0x14')]]['queuecallerabandonAt']=null;queues[_0x2b5ea8['uniqueid']][_0x89d4('0x1d')]=![];queues[_0x2b5ea8[_0x89d4('0x14')]]['queuecallerexitAt']=null;queues[_0x2b5ea8['uniqueid']]['assigned']=!![];queues[_0x2b5ea8[_0x89d4('0x14')]]['lastAssignedTo']=_0x2b5ea8[_0x89d4('0x3d')];queues[_0x2b5ea8[_0x89d4('0x14')]]['queuecallercomplete']=!![];queues[_0x2b5ea8['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x2b5ea8[_0x89d4('0x41')]=='transfer'){if(!queues[_0x2b5ea8[_0x89d4('0x14')]][_0x89d4('0x42')]){queues[_0x2b5ea8['uniqueid']]['queuecallerexitreason']=_0x89d4('0x43');}}else{queues[_0x2b5ea8[_0x89d4('0x14')]][_0x89d4('0xa')]=_0x89d4('0x44')+_0x2b5ea8[_0x89d4('0x41')][_0x89d4('0x2d')]();}utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x45'),_0x2b5ea8[_0x89d4('0x14')],queues[_0x2b5ea8[_0x89d4('0x14')]][_0x89d4('0x20')],_0x2b5ea8['membername'],queues[_0x2b5ea8[_0x89d4('0x14')]][_0x89d4('0xa')]));writeDB(queues[_0x2b5ea8['uniqueid']]);}}}catch(_0x568e77){utils[_0x89d4('0x23')](util[_0x89d4('0x3')](_0x89d4('0x46'),_0x2b5ea8[_0x89d4('0x14')]),_0x568e77);}};exports[_0x89d4('0x47')]=function(_0x2fb878){try{if(!_[_0x89d4('0x1a')](queues[_0x2fb878['transfereeuniqueid']])){utils[_0x89d4('0x12')](util['format']('[%s][queues][blindtransfer]',_0x2fb878[_0x89d4('0x14')]),_0x2fb878);queues[_0x2fb878['transfereeuniqueid']][_0x89d4('0x42')]=!![];queues[_0x2fb878['transfereeuniqueid']][_0x89d4('0x48')]=_0x89d4('0x49');queues[_0x2fb878[_0x89d4('0x4a')]][_0x89d4('0x4b')]=_0x2fb878[_0x89d4('0x4c')];queues[_0x2fb878['transfereeuniqueid']]['transferuniqueid']=_0x2fb878[_0x89d4('0x4a')];queues[_0x2fb878[_0x89d4('0x4a')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util['format'](_0x89d4('0x4d'),_0x2fb878[_0x89d4('0x14')],queues[_0x2fb878[_0x89d4('0x4a')]][_0x89d4('0x20')],_0x2fb878['transfereeuniqueid'],_0x2fb878[_0x89d4('0x4c')]));}}catch(_0x27e1d2){utils[_0x89d4('0x23')](util[_0x89d4('0x3')]('[%s][queues][blindtransfer]',_0x2fb878[_0x89d4('0x14')]),_0x27e1d2);}};exports[_0x89d4('0x4e')]=function(_0x1595d2){try{utils['debug'](util[_0x89d4('0x3')]('[%s][queues][attendedtransfer]',_0x1595d2[_0x89d4('0x4f')]),_0x1595d2);if(_0x1595d2['origtransfereruniqueid']==_0x1595d2['origtransfererlinkedid']){if(!_[_0x89d4('0x1a')](queues[_0x1595d2[_0x89d4('0x50')]])){utils[_0x89d4('0x15')](util['format'](_0x89d4('0x51'),_0x1595d2[_0x89d4('0x4f')],queues[_0x1595d2[_0x89d4('0x50')]]['name'],_0x1595d2[_0x89d4('0x52')]));queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0x42')]=!![];queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0x48')]=_0x89d4('0x53');queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0x4b')]=_0x1595d2[_0x89d4('0x52')];queues[_0x1595d2['secondtransfererlinkedid']][_0x89d4('0x54')]=_0x1595d2[_0x89d4('0x4f')];queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0xa')]=_0x89d4('0x55');}if(!_[_0x89d4('0x1a')](queues[_0x1595d2[_0x89d4('0x56')]])){if(_0x1595d2['transfereelinkedid']&&queues[_0x1595d2['transfereelinkedid']]){queues[_0x1595d2['transfereelinkedid']][_0x89d4('0x22')]=0x1;queues[_0x1595d2['transfereeuniqueid']]=_[_0x89d4('0x57')](queues[_0x1595d2[_0x89d4('0x58')]]);queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x10')]=_0x1595d2['transfertargetuniqueid'];queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x22')]=0x2;queues[_0x1595d2['transfereeuniqueid']][_0x89d4('0x8')]=queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0x8')];queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x59')]=queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0x59')];queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x39')]=utils[_0x89d4('0x19')]();queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x1b')]=utils[_0x89d4('0x19')]();queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x5a')]=0x0;queues[_0x1595d2[_0x89d4('0x4a')]]['mohtime']=0x0;utils[_0x89d4('0x15')](util[_0x89d4('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1595d2['origtransfereruniqueid'],queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x20')],queues[_0x1595d2[_0x89d4('0x4a')]]['calleridnum'],queues[_0x1595d2[_0x89d4('0x4a')]][_0x89d4('0x59')]));}else{utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x5b'),_0x1595d2['origtransfereruniqueid'],queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0x20')],_0x1595d2[_0x89d4('0x50')]));queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0x10')]=_0x1595d2[_0x89d4('0x50')];}}}else if(_0x1595d2[_0x89d4('0x5c')]==_0x1595d2[_0x89d4('0x50')]){if(!_['isNil'](queues[_0x1595d2[_0x89d4('0x56')]])){utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x5d'),_0x1595d2[_0x89d4('0x4f')],queues[_0x1595d2['origtransfererlinkedid']][_0x89d4('0x20')],_0x1595d2['secondtransfereruniqueid'],_0x1595d2[_0x89d4('0x5e')]));queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0x42')]=!![];queues[_0x1595d2['origtransfererlinkedid']][_0x89d4('0x48')]=_0x89d4('0x53');queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0x4b')]=_0x1595d2['secondtransfererexten'];queues[_0x1595d2['origtransfererlinkedid']]['transferuniqueid']=_0x1595d2[_0x89d4('0x5c')];queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0xa')]=_0x89d4('0x55');}if(!_[_0x89d4('0x1a')](queues[_0x1595d2['secondtransfererlinkedid']])){if(_0x1595d2[_0x89d4('0x5f')]&&queues[_0x1595d2[_0x89d4('0x5f')]]){queues[_0x1595d2[_0x89d4('0x5f')]][_0x89d4('0x22')]=0x1;queues[_0x1595d2[_0x89d4('0x60')]]=_[_0x89d4('0x57')](queues[_0x1595d2[_0x89d4('0x5f')]]);queues[_0x1595d2[_0x89d4('0x60')]][_0x89d4('0x10')]=_0x1595d2[_0x89d4('0x60')];queues[_0x1595d2['transfertargetuniqueid']][_0x89d4('0x22')]=0x2;queues[_0x1595d2[_0x89d4('0x60')]][_0x89d4('0x8')]=queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0x8')];queues[_0x1595d2[_0x89d4('0x60')]]['calleridname']=queues[_0x1595d2[_0x89d4('0x56')]][_0x89d4('0x59')];queues[_0x1595d2[_0x89d4('0x60')]][_0x89d4('0x39')]=utils['now']();queues[_0x1595d2['transfertargetuniqueid']][_0x89d4('0x1b')]=utils['now']();queues[_0x1595d2[_0x89d4('0x60')]][_0x89d4('0x5a')]=0x0;queues[_0x1595d2[_0x89d4('0x60')]]['mohtime']=0x0;utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x61'),_0x1595d2[_0x89d4('0x4f')],queues[_0x1595d2[_0x89d4('0x60')]][_0x89d4('0x20')],queues[_0x1595d2[_0x89d4('0x60')]][_0x89d4('0x10')],queues[_0x1595d2['transfertargetuniqueid']]['calleridnum'],queues[_0x1595d2[_0x89d4('0x60')]]['calleridname']));}else{utils[_0x89d4('0x15')](util[_0x89d4('0x3')](_0x89d4('0x5b'),_0x1595d2[_0x89d4('0x4f')],queues[_0x1595d2[_0x89d4('0x50')]][_0x89d4('0x20')],_0x1595d2[_0x89d4('0x56')]));queues[_0x1595d2['secondtransfererlinkedid']]['transfereduniqueid']=_0x1595d2[_0x89d4('0x56')];}}}}catch(_0x598585){utils[_0x89d4('0x23')](util['format']('[%s][queues][attendedtransfer]',_0x1595d2['origtransfereruniqueid']),_0x598585);}};exports['musiconholdstart']=function(_0x5aa8b6){try{if(!_[_0x89d4('0x1a')](queues[_0x5aa8b6[_0x89d4('0x14')]])){utils[_0x89d4('0x12')](util[_0x89d4('0x3')](_0x89d4('0x62'),_0x5aa8b6[_0x89d4('0x14')]),_0x5aa8b6);queues[_0x5aa8b6[_0x89d4('0x14')]][_0x89d4('0x63')]=utils[_0x89d4('0x19')]();utils['info'](util[_0x89d4('0x3')](_0x89d4('0x64'),_0x5aa8b6[_0x89d4('0x14')],queues[_0x5aa8b6[_0x89d4('0x14')]][_0x89d4('0x20')],queues[_0x5aa8b6[_0x89d4('0x14')]][_0x89d4('0x63')]));}}catch(_0x3db85b){utils[_0x89d4('0x23')](util['format'](_0x89d4('0x62'),_0x5aa8b6['uniqueid']),_0x3db85b);}};exports[_0x89d4('0x65')]=function(_0x2d84e7){try{if(!_[_0x89d4('0x1a')](queues[_0x2d84e7[_0x89d4('0x14')]])){if(!_[_0x89d4('0x1a')](queues[_0x2d84e7[_0x89d4('0x14')]][_0x89d4('0x63')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x2d84e7[_0x89d4('0x14')]),_0x2d84e7);queues[_0x2d84e7[_0x89d4('0x14')]][_0x89d4('0x66')]+=utils[_0x89d4('0x38')](utils[_0x89d4('0x19')](),queues[_0x2d84e7['uniqueid']][_0x89d4('0x63')]);utils['info'](util[_0x89d4('0x3')](_0x89d4('0x67'),_0x2d84e7['uniqueid'],queues[_0x2d84e7[_0x89d4('0x14')]][_0x89d4('0x20')],queues[_0x2d84e7[_0x89d4('0x14')]]['mohtime']));delete queues[_0x2d84e7[_0x89d4('0x14')]][_0x89d4('0x63')];}}}catch(_0x361fad){utils[_0x89d4('0x23')](util['format'](_0x89d4('0x68'),_0x2d84e7[_0x89d4('0x14')]),_0x361fad);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index bafa661..0601425 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 _0x5001=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','replace','.wav49','find','monitors','push','calleridnum','calleridname','cause-txt','connectedlinename','type','outbound','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','name','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5001,0xd0));var _0x1500=function(_0x22c355,_0x3065ea){_0x22c355=_0x22c355-0x0;var _0x398155=_0x5001[_0x22c355];return _0x398155;};'use strict';var _=require('lodash');var util=require(_0x1500('0x0'));var utils=require(_0x1500('0x1'));var recordings={};function writeDB(_0x180f8e){utils[_0x1500('0x2')](util[_0x1500('0x3')](_0x1500('0x4'),_0x180f8e[_0x1500('0x5')]));if(_0x180f8e[_0x1500('0x6')]){utils['getUserByInternal'](_0x180f8e[_0x1500('0x6')])[_0x1500('0x7')](function(_0x209467){if(_0x209467){_0x180f8e['membername']=_0x209467[_0x1500('0x8')];_0x180f8e['UserId']=_0x209467['id'];}utils[_0x1500('0x9')](_0x1500('0xa'),_0x180f8e);});}else{utils['request'](_0x1500('0xa'),_0x180f8e);}}exports['newchannel']=function(_0x5e258b){try{utils[_0x1500('0xb')](util['format']('[%s][recordings][newchannel]',_0x5e258b[_0x1500('0x5')]),_0x5e258b);if(_0x5e258b['uniqueid']==_0x5e258b[_0x1500('0xc')]){utils[_0x1500('0x2')](util[_0x1500('0x3')](_0x1500('0xd'),_0x5e258b['uniqueid'],_0x5e258b[_0x1500('0xe')],_0x5e258b[_0x1500('0xf')]));recordings[_0x5e258b[_0x1500('0x5')]]={'uniqueid':_0x5e258b[_0x1500('0x5')],'accountcode':_0x5e258b[_0x1500('0x6')],'exten':_0x5e258b[_0x1500('0xf')],'context':_0x5e258b[_0x1500('0xe')],'channel':_0x5e258b[_0x1500('0x10')],'monitors':[]};}}catch(_0x3f2481){utils[_0x1500('0x11')](util['format']('[%s][recordings][newchannel]',_0x5e258b['uniqueid']),_0x3f2481);}};exports['newstate']=function(_0x5b6e46){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x5b6e46[_0x1500('0x5')]),_0x5b6e46);if(!_[_0x1500('0x12')](recordings[_0x5b6e46['uniqueid']])&&_0x5b6e46[_0x1500('0x13')]==0x6){utils[_0x1500('0x2')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x5b6e46[_0x1500('0x5')],_0x5b6e46[_0x1500('0xe')],_0x5b6e46[_0x1500('0x10')]));}else if(!_[_0x1500('0x12')](recordings[_0x5b6e46[_0x1500('0xc')]])&&_0x5b6e46['channelstate']==0x6&&_0x5b6e46['context']!=_0x1500('0x14')){utils['info'](util[_0x1500('0x3')](_0x1500('0x15'),_0x5b6e46['uniqueid'],_0x5b6e46[_0x1500('0xc')],_0x5b6e46['context'],_0x5b6e46[_0x1500('0x10')]));recordings[_0x5b6e46[_0x1500('0xc')]][_0x1500('0x6')]=_0x5b6e46[_0x1500('0x6')];}}catch(_0x1e1809){utils[_0x1500('0x11')](util[_0x1500('0x3')](_0x1500('0x16'),_0x5b6e46['uniqueid']),_0x1e1809);}};exports[_0x1500('0x17')]=function(_0x15c679){try{if(!_['isNil'](_0x15c679['variable'])&&!_['isNil'](_0x15c679['variable']['mixmonitor_filename'])){utils[_0x1500('0xb')](util[_0x1500('0x3')](_0x1500('0x18'),_0x15c679[_0x1500('0x5')]),_0x15c679);utils['info'](util[_0x1500('0x3')](_0x1500('0x19'),_0x15c679[_0x1500('0x5')],_0x15c679[_0x1500('0x1a')],_0x15c679[_0x1500('0x1b')]));if(_[_0x1500('0x1c')](_0x15c679[_0x1500('0x1b')],'.wav49')){_0x15c679[_0x1500('0x1b')]=_0x15c679[_0x1500('0x1b')][_0x1500('0x1d')](_0x1500('0x1e'),'.WAV');}if(recordings[_0x15c679['linkedid']]){var _0x240de5=_[_0x1500('0x1f')](recordings[_0x15c679[_0x1500('0xc')]][_0x1500('0x20')],{'value':_0x15c679[_0x1500('0x1b')]});if(_[_0x1500('0x12')](_0x240de5)){recordings[_0x15c679[_0x1500('0xc')]][_0x1500('0x20')][_0x1500('0x21')]({'value':_0x15c679[_0x1500('0x1b')]});}}}}catch(_0x45f602){utils[_0x1500('0x11')](util['format']('[%s][recordings][varset]',_0x15c679[_0x1500('0x5')]),_0x45f602);}};exports['hangup']=function(_0x169294){try{if(!_[_0x1500('0x12')](recordings[_0x169294['uniqueid']])){utils['debug'](util[_0x1500('0x3')]('[%s][recordings][hangup]',_0x169294['uniqueid']),_0x169294);utils[_0x1500('0x2')](util[_0x1500('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x169294[_0x1500('0x5')],_0x169294[_0x1500('0x22')],_0x169294[_0x1500('0x23')],_0x169294[_0x1500('0x24')]));recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x22')]=_0x169294['calleridnum'];recordings[_0x169294['uniqueid']][_0x1500('0x23')]=_0x169294[_0x1500('0x23')];recordings[_0x169294[_0x1500('0x5')]]['connectedlinenum']=_0x169294['connectedlinenum'];recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x25')]=_0x169294[_0x1500('0x25')];if(recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x26')]==_0x1500('0x27')&&recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x6')]){recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x28')]=recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x6')];recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x25')]='';}recordings[_0x169294[_0x1500('0x5')]][_0x1500('0x20')][_0x1500('0x29')](function(_0x3b15a8){var _0x10da6a=_[_0x1500('0x2a')](recordings[_0x169294[_0x1500('0x5')]]);_0x10da6a['value']=_0x3b15a8[_0x1500('0x1b')];writeDB(_0x10da6a);});delete recordings[_0x169294[_0x1500('0x5')]];}}catch(_0x5ab5c2){utils[_0x1500('0x11')](util[_0x1500('0x3')]('[%s][recordings][hangup]',_0x169294['uniqueid']),_0x5ab5c2);}};exports[_0x1500('0x2b')]=function(_0x1f74ab){try{if(!_[_0x1500('0x12')](recordings[_0x1f74ab['uniqueid']])){utils['debug'](util[_0x1500('0x3')](_0x1500('0x2c'),_0x1f74ab[_0x1500('0x5')]),_0x1f74ab);utils[_0x1500('0x2')](util[_0x1500('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1f74ab[_0x1500('0x5')],_0x1f74ab[_0x1500('0x2d')],_0x1f74ab[_0x1500('0x2e')]));if(_0x1f74ab[_0x1500('0x2d')][_0x1500('0x2f')]()==_0x1500('0x30')&&_[_0x1500('0x31')](_0x1f74ab['appdata'][_0x1500('0x2f')](),_0x1500('0x32'))){var _0x39a4df=_0x1f74ab[_0x1500('0x2e')][_0x1500('0x33')]('=');var _0x26cd3b=_0x39a4df[0x0][_0x1500('0x34')](_0x39a4df[0x0][_0x1500('0x35')]('(')+0x1,_0x39a4df[0x0][_0x1500('0x35')](')'));var _0x24518b=_0x39a4df[0x1];recordings[_0x1f74ab[_0x1500('0x5')]][_0x26cd3b]=_0x24518b;}}}catch(_0x29ad8e){utils[_0x1500('0x11')](util['format'](_0x1500('0x2c'),_0x1f74ab['uniqueid']),_0x29ad8e);}};exports[_0x1500('0x36')]=function(_0x41d83a){try{if(!_['isNil'](recordings[_0x41d83a[_0x1500('0x5')]])){utils[_0x1500('0xb')](util[_0x1500('0x3')](_0x1500('0x37'),_0x41d83a[_0x1500('0x5')]),_0x41d83a);utils[_0x1500('0x2')](util[_0x1500('0x3')](_0x1500('0x38'),_0x41d83a[_0x1500('0x5')],_0x41d83a['queue']));recordings[_0x41d83a[_0x1500('0x5')]][_0x1500('0x39')]=_0x41d83a['queue'];}}catch(_0x53c29a){utils[_0x1500('0x11')](util['format']('[%s][recordings][queuecallerjoin]',_0x41d83a[_0x1500('0x5')]),_0x53c29a);}}; \ No newline at end of file +var _0xd684=['channelstate','transfer','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','find','push','[%s][recordings][varset]','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','type','connectedlinenum','monitors','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','util','info','format','accountcode','getUserByInternal','UserId','request','CreateVoiceRecording','newchannel','debug','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid'];(function(_0x53c095,_0x43b498){var _0x359e11=function(_0x150942){while(--_0x150942){_0x53c095['push'](_0x53c095['shift']());}};_0x359e11(++_0x43b498);}(_0xd684,0x14c));var _0x4d68=function(_0x144616,_0x1188de){_0x144616=_0x144616-0x0;var _0x100e2f=_0xd684[_0x144616];return _0x100e2f;};'use strict';var _=require(_0x4d68('0x0'));var util=require(_0x4d68('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x434dbd){utils[_0x4d68('0x2')](util[_0x4d68('0x3')]('[%s][recordings][writeDB]',_0x434dbd['uniqueid']));if(_0x434dbd[_0x4d68('0x4')]){utils[_0x4d68('0x5')](_0x434dbd[_0x4d68('0x4')])['then'](function(_0x141009){if(_0x141009){_0x434dbd['membername']=_0x141009['name'];_0x434dbd[_0x4d68('0x6')]=_0x141009['id'];}utils[_0x4d68('0x7')](_0x4d68('0x8'),_0x434dbd);});}else{utils['request'](_0x4d68('0x8'),_0x434dbd);}}exports[_0x4d68('0x9')]=function(_0x21ac17){try{utils[_0x4d68('0xa')](util[_0x4d68('0x3')]('[%s][recordings][newchannel]',_0x21ac17[_0x4d68('0xb')]),_0x21ac17);if(_0x21ac17[_0x4d68('0xb')]==_0x21ac17['linkedid']){utils[_0x4d68('0x2')](util[_0x4d68('0x3')](_0x4d68('0xc'),_0x21ac17[_0x4d68('0xb')],_0x21ac17['context'],_0x21ac17['exten']));recordings[_0x21ac17[_0x4d68('0xb')]]={'uniqueid':_0x21ac17[_0x4d68('0xb')],'accountcode':_0x21ac17[_0x4d68('0x4')],'exten':_0x21ac17[_0x4d68('0xd')],'context':_0x21ac17[_0x4d68('0xe')],'channel':_0x21ac17['channel'],'monitors':[]};}}catch(_0x59da62){utils[_0x4d68('0xf')](util[_0x4d68('0x3')](_0x4d68('0x10'),_0x21ac17['uniqueid']),_0x59da62);}};exports['newstate']=function(_0x4f86f1){try{utils[_0x4d68('0xa')](util[_0x4d68('0x3')](_0x4d68('0x11'),_0x4f86f1[_0x4d68('0xb')]),_0x4f86f1);if(!_[_0x4d68('0x12')](recordings[_0x4f86f1[_0x4d68('0xb')]])&&_0x4f86f1['channelstate']==0x6){utils[_0x4d68('0x2')](util[_0x4d68('0x3')](_0x4d68('0x13'),_0x4f86f1[_0x4d68('0xb')],_0x4f86f1[_0x4d68('0xe')],_0x4f86f1[_0x4d68('0x14')]));}else if(!_[_0x4d68('0x12')](recordings[_0x4f86f1[_0x4d68('0x15')]])&&_0x4f86f1[_0x4d68('0x16')]==0x6&&_0x4f86f1[_0x4d68('0xe')]!=_0x4d68('0x17')){utils['info'](util[_0x4d68('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4f86f1[_0x4d68('0xb')],_0x4f86f1[_0x4d68('0x15')],_0x4f86f1['context'],_0x4f86f1[_0x4d68('0x14')]));recordings[_0x4f86f1[_0x4d68('0x15')]][_0x4d68('0x4')]=_0x4f86f1['accountcode'];}}catch(_0x312d41){utils[_0x4d68('0xf')](util[_0x4d68('0x3')](_0x4d68('0x11'),_0x4f86f1[_0x4d68('0xb')]),_0x312d41);}};exports['varset']=function(_0x3c8884){try{if(!_[_0x4d68('0x12')](_0x3c8884[_0x4d68('0x18')])&&!_[_0x4d68('0x12')](_0x3c8884[_0x4d68('0x18')][_0x4d68('0x19')])){utils['debug'](util[_0x4d68('0x3')]('[%s][recordings][varset]',_0x3c8884[_0x4d68('0xb')]),_0x3c8884);utils['info'](util[_0x4d68('0x3')](_0x4d68('0x1a'),_0x3c8884['uniqueid'],_0x3c8884[_0x4d68('0x18')],_0x3c8884['value']));if(_[_0x4d68('0x1b')](_0x3c8884[_0x4d68('0x1c')],_0x4d68('0x1d'))){_0x3c8884['value']=_0x3c8884[_0x4d68('0x1c')][_0x4d68('0x1e')](_0x4d68('0x1d'),_0x4d68('0x1f'));}if(recordings[_0x3c8884['linkedid']]){var _0x1d956e=_[_0x4d68('0x20')](recordings[_0x3c8884[_0x4d68('0x15')]]['monitors'],{'value':_0x3c8884[_0x4d68('0x1c')]});if(_['isNil'](_0x1d956e)){recordings[_0x3c8884['linkedid']]['monitors'][_0x4d68('0x21')]({'value':_0x3c8884[_0x4d68('0x1c')]});}}}}catch(_0x4eb391){utils[_0x4d68('0xf')](util['format'](_0x4d68('0x22'),_0x3c8884[_0x4d68('0xb')]),_0x4eb391);}};exports['hangup']=function(_0x2b2cbf){try{if(!_[_0x4d68('0x12')](recordings[_0x2b2cbf[_0x4d68('0xb')]])){utils[_0x4d68('0xa')](util[_0x4d68('0x3')](_0x4d68('0x23'),_0x2b2cbf[_0x4d68('0xb')]),_0x2b2cbf);utils[_0x4d68('0x2')](util[_0x4d68('0x3')](_0x4d68('0x24'),_0x2b2cbf[_0x4d68('0xb')],_0x2b2cbf[_0x4d68('0x25')],_0x2b2cbf[_0x4d68('0x26')],_0x2b2cbf[_0x4d68('0x27')]));recordings[_0x2b2cbf[_0x4d68('0xb')]][_0x4d68('0x25')]=_0x2b2cbf[_0x4d68('0x25')];recordings[_0x2b2cbf['uniqueid']][_0x4d68('0x26')]=_0x2b2cbf[_0x4d68('0x26')];recordings[_0x2b2cbf['uniqueid']]['connectedlinenum']=_0x2b2cbf['connectedlinenum'];recordings[_0x2b2cbf[_0x4d68('0xb')]][_0x4d68('0x28')]=_0x2b2cbf[_0x4d68('0x28')];if(recordings[_0x2b2cbf[_0x4d68('0xb')]][_0x4d68('0x29')]=='outbound'&&recordings[_0x2b2cbf['uniqueid']][_0x4d68('0x4')]){recordings[_0x2b2cbf[_0x4d68('0xb')]][_0x4d68('0x2a')]=recordings[_0x2b2cbf['uniqueid']]['accountcode'];recordings[_0x2b2cbf[_0x4d68('0xb')]][_0x4d68('0x28')]='';}recordings[_0x2b2cbf[_0x4d68('0xb')]][_0x4d68('0x2b')][_0x4d68('0x2c')](function(_0xb108cd){var _0x46694b=_['clone'](recordings[_0x2b2cbf[_0x4d68('0xb')]]);_0x46694b[_0x4d68('0x1c')]=_0xb108cd['value'];writeDB(_0x46694b);});delete recordings[_0x2b2cbf['uniqueid']];}}catch(_0x3d019b){utils['error'](util[_0x4d68('0x3')](_0x4d68('0x23'),_0x2b2cbf['uniqueid']),_0x3d019b);}};exports[_0x4d68('0x2d')]=function(_0x396d52){try{if(!_[_0x4d68('0x12')](recordings[_0x396d52[_0x4d68('0xb')]])){utils[_0x4d68('0xa')](util[_0x4d68('0x3')](_0x4d68('0x2e'),_0x396d52[_0x4d68('0xb')]),_0x396d52);utils[_0x4d68('0x2')](util['format'](_0x4d68('0x2f'),_0x396d52[_0x4d68('0xb')],_0x396d52[_0x4d68('0x30')],_0x396d52[_0x4d68('0x31')]));if(_0x396d52['application']['toLowerCase']()==_0x4d68('0x32')&&_[_0x4d68('0x33')](_0x396d52['appdata'][_0x4d68('0x34')](),'cdr')){var _0x4835ff=_0x396d52[_0x4d68('0x31')][_0x4d68('0x35')]('=');var _0x50e319=_0x4835ff[0x0][_0x4d68('0x36')](_0x4835ff[0x0][_0x4d68('0x37')]('(')+0x1,_0x4835ff[0x0]['lastIndexOf'](')'));var _0x1a4476=_0x4835ff[0x1];recordings[_0x396d52[_0x4d68('0xb')]][_0x50e319]=_0x1a4476;}}}catch(_0x1ab497){utils['error'](util['format'](_0x4d68('0x2e'),_0x396d52[_0x4d68('0xb')]),_0x1ab497);}};exports['queuecallerjoin']=function(_0x370484){try{if(!_[_0x4d68('0x12')](recordings[_0x370484[_0x4d68('0xb')]])){utils[_0x4d68('0xa')](util[_0x4d68('0x3')]('[%s][recordings][queuecallerjoin]',_0x370484['uniqueid']),_0x370484);utils[_0x4d68('0x2')](util[_0x4d68('0x3')](_0x4d68('0x38'),_0x370484[_0x4d68('0xb')],_0x370484[_0x4d68('0x39')]));recordings[_0x370484[_0x4d68('0xb')]]['queue']=_0x370484[_0x4d68('0x39')];}}catch(_0x50f60e){utils[_0x4d68('0xf')](util[_0x4d68('0x3')](_0x4d68('0x3a'),_0x370484['uniqueid']),_0x50f60e);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f1d5320..087435c 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 _0xcd23=['transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','uniqueid','type','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0x2d9799,_0x310cde){var _0x136fc4=function(_0x12823d){while(--_0x12823d){_0x2d9799['push'](_0x2d9799['shift']());}};_0x136fc4(++_0x310cde);}(_0xcd23,0x181));var _0x3cd2=function(_0x442d24,_0x5a58e7){_0x442d24=_0x442d24-0x0;var _0x40fe32=_0xcd23[_0x442d24];return _0x40fe32;};'use strict';var _=require(_0x3cd2('0x0'));var util=require(_0x3cd2('0x1'));var utils=require('./utils');function writeDB(_0x2ad87c){utils[_0x3cd2('0x2')](util[_0x3cd2('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x2ad87c['type']==='attended'?_0x2ad87c['origtransfereruniqueid']:_0x2ad87c[_0x3cd2('0x4')],_0x2ad87c[_0x3cd2('0x5')]));utils[_0x3cd2('0x6')](_0x3cd2('0x7'),_0x2ad87c);}exports[_0x3cd2('0x8')]=function(_0x1ae357){try{utils[_0x3cd2('0x9')](util[_0x3cd2('0x3')](_0x3cd2('0xa'),_0x1ae357[_0x3cd2('0x4')]),_0x1ae357);utils[_0x3cd2('0x2')](util[_0x3cd2('0x3')](_0x3cd2('0xb'),_0x1ae357[_0x3cd2('0x4')],_0x1ae357[_0x3cd2('0xc')],_0x1ae357[_0x3cd2('0xd')],_0x1ae357[_0x3cd2('0xe')],_0x1ae357[_0x3cd2('0xf')]));_0x1ae357[_0x3cd2('0x5')]=_0x3cd2('0x10');writeDB(_0x1ae357);}catch(_0x43aeae){utils[_0x3cd2('0x11')](util['format'](_0x3cd2('0xa'),_0x1ae357[_0x3cd2('0x4')]),_0x43aeae);}};exports[_0x3cd2('0x12')]=function(_0x561912){try{utils[_0x3cd2('0x9')](util['format'](_0x3cd2('0x13'),_0x561912[_0x3cd2('0x14')]),_0x561912);utils[_0x3cd2('0x2')](util[_0x3cd2('0x3')](_0x3cd2('0x15'),_0x561912['origtransfereruniqueid'],_0x561912['origtransferercalleridnum'],_0x561912['origtransferercalleridname'],_0x561912['transfertargetcalleridnum'],_0x561912[_0x3cd2('0x16')]));_0x561912=_[_0x3cd2('0x17')](_0x561912,{'transfererchannel':_0x561912[_0x3cd2('0x18')],'transferercalleridnum':_0x561912[_0x3cd2('0x19')],'transferercalleridname':_0x561912[_0x3cd2('0x1a')],'transfererconnectedlinenum':_0x561912['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x561912[_0x3cd2('0x1b')],'transfereraccountcode':_0x561912[_0x3cd2('0x1c')],'transferercontext':_0x561912[_0x3cd2('0x1d')],'transfererexten':_0x561912[_0x3cd2('0x1e')],'transfererlinkedid':_0x561912[_0x3cd2('0x1f')],'context':_0x561912[_0x3cd2('0x20')],'extension':_0x561912['origtransfererexten'],'type':'attended'});if(_[_0x3cd2('0x21')](_0x561912[_0x3cd2('0x22')])){_0x561912=_['assign'](_0x561912,{'transfereechannel':_0x561912['transfertargetchannel'],'transfereecalleridnum':_0x561912[_0x3cd2('0x23')],'transfereecalleridname':_0x561912['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x561912['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x561912['transfertargetconnectedlinename'],'transfereeaccountcode':_0x561912[_0x3cd2('0x24')],'transfereecontext':_0x561912[_0x3cd2('0x25')],'transfereeexten':_0x561912[_0x3cd2('0x26')],'transfereelinkedid':_0x561912[_0x3cd2('0x27')]});}writeDB(_0x561912);}catch(_0x52c56d){utils['error'](util[_0x3cd2('0x3')]('[%s][transfers][attendedtransfer]',_0x561912[_0x3cd2('0x14')]),_0x52c56d);}}; \ No newline at end of file +var _0xd821=['[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format'];(function(_0x197678,_0x151643){var _0x596891=function(_0x519489){while(--_0x519489){_0x197678['push'](_0x197678['shift']());}};_0x596891(++_0x151643);}(_0xd821,0x13b));var _0x1d82=function(_0x5d60a8,_0x5db4ad){_0x5d60a8=_0x5d60a8-0x0;var _0x32cc7a=_0xd821[_0x5d60a8];return _0x32cc7a;};'use strict';var _=require(_0x1d82('0x0'));var util=require(_0x1d82('0x1'));var utils=require(_0x1d82('0x2'));function writeDB(_0xa27d42){utils[_0x1d82('0x3')](util[_0x1d82('0x4')](_0x1d82('0x5'),_0xa27d42[_0x1d82('0x6')]==='attended'?_0xa27d42[_0x1d82('0x7')]:_0xa27d42[_0x1d82('0x8')],_0xa27d42[_0x1d82('0x6')]));utils[_0x1d82('0x9')](_0x1d82('0xa'),_0xa27d42);}exports['blindtransfer']=function(_0x1c45ba){try{utils[_0x1d82('0xb')](util[_0x1d82('0x4')](_0x1d82('0xc'),_0x1c45ba[_0x1d82('0x8')]),_0x1c45ba);utils['info'](util[_0x1d82('0x4')](_0x1d82('0xd'),_0x1c45ba[_0x1d82('0x8')],_0x1c45ba[_0x1d82('0xe')],_0x1c45ba[_0x1d82('0xf')],_0x1c45ba[_0x1d82('0x10')],_0x1c45ba[_0x1d82('0x11')]));_0x1c45ba[_0x1d82('0x6')]=_0x1d82('0x12');writeDB(_0x1c45ba);}catch(_0x29de54){utils['error'](util[_0x1d82('0x4')](_0x1d82('0xc'),_0x1c45ba[_0x1d82('0x8')]),_0x29de54);}};exports['attendedtransfer']=function(_0x1b6bce){try{utils[_0x1d82('0xb')](util[_0x1d82('0x4')](_0x1d82('0x13'),_0x1b6bce[_0x1d82('0x7')]),_0x1b6bce);utils[_0x1d82('0x3')](util['format'](_0x1d82('0x14'),_0x1b6bce[_0x1d82('0x7')],_0x1b6bce[_0x1d82('0x15')],_0x1b6bce[_0x1d82('0x16')],_0x1b6bce['transfertargetcalleridnum'],_0x1b6bce[_0x1d82('0x17')]));_0x1b6bce=_[_0x1d82('0x18')](_0x1b6bce,{'transfererchannel':_0x1b6bce['origtransfererchannel'],'transferercalleridnum':_0x1b6bce[_0x1d82('0x15')],'transferercalleridname':_0x1b6bce[_0x1d82('0x16')],'transfererconnectedlinenum':_0x1b6bce[_0x1d82('0x19')],'transfererconnectedlinename':_0x1b6bce[_0x1d82('0x1a')],'transfereraccountcode':_0x1b6bce[_0x1d82('0x1b')],'transferercontext':_0x1b6bce[_0x1d82('0x1c')],'transfererexten':_0x1b6bce[_0x1d82('0x1d')],'transfererlinkedid':_0x1b6bce['origtransfererlinkedid'],'context':_0x1b6bce[_0x1d82('0x1e')],'extension':_0x1b6bce[_0x1d82('0x1f')],'type':_0x1d82('0x20')});if(_['isNil'](_0x1b6bce['transfereechannel'])){_0x1b6bce=_['assign'](_0x1b6bce,{'transfereechannel':_0x1b6bce[_0x1d82('0x21')],'transfereecalleridnum':_0x1b6bce[_0x1d82('0x22')],'transfereecalleridname':_0x1b6bce['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1b6bce[_0x1d82('0x23')],'transfereeconnectedlinename':_0x1b6bce['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1b6bce[_0x1d82('0x24')],'transfereecontext':_0x1b6bce[_0x1d82('0x25')],'transfereeexten':_0x1b6bce[_0x1d82('0x26')],'transfereelinkedid':_0x1b6bce[_0x1d82('0x27')]});}writeDB(_0x1b6bce);}catch(_0x5f4639){utils['error'](util['format'](_0x1d82('0x13'),_0x1b6bce[_0x1d82('0x7')]),_0x5f4639);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1f14201..14f9bc0 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 _0x2b1b=['add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','info','debug','error','inspect','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b1b,0x11f));var _0xb2b1=function(_0x4221db,_0x522c82){_0x4221db=_0x4221db-0x0;var _0x9dbee2=_0x2b1b[_0x4221db];return _0x9dbee2;};'use strict';var BPromise=require(_0xb2b1('0x0'));var jayson=require(_0xb2b1('0x1'));var moment=require(_0xb2b1('0x2'));var util=require('util');var client=jayson[_0xb2b1('0x3')][_0xb2b1('0x4')]({'port':0x2329});var logger=require(_0xb2b1('0x5'))('xdr');exports['info']=function(_0x285c84,_0x24bdf1){logger[_0xb2b1('0x6')](_0x285c84,_0x24bdf1?util['inspect'](_0x24bdf1,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x172f19,_0x38a68e){logger[_0xb2b1('0x7')](_0x172f19,_0x38a68e?util['inspect'](_0x38a68e,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0xaba099,_0x44454e){logger[_0xb2b1('0x8')](_0xaba099,_0x44454e?util[_0xb2b1('0x9')](_0x44454e,{'showHidden':![],'depth':null}):'');};exports[_0xb2b1('0xa')]=function(_0xfec2d3,_0x3aaa5a){return client[_0xb2b1('0xa')](_0xfec2d3,{'body':_0x3aaa5a})[_0xb2b1('0xb')](function(_0x4cff2f){logger[_0xb2b1('0x7')]('[utils][request]\x20name:%s',_0xfec2d3,_0x4cff2f?util[_0xb2b1('0x9')](_0x4cff2f,{'showHidden':![],'depth':null}):'');})[_0xb2b1('0xc')](function(_0x211788){logger[_0xb2b1('0x8')](_0xb2b1('0xd'),_0xfec2d3,_0x211788?util[_0xb2b1('0x9')](_0x211788,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1c5181){return client[_0xb2b1('0xa')](_0xb2b1('0xe'),{'options':{'raw':!![],'attributes':['id',_0xb2b1('0xf'),_0xb2b1('0x10'),'interface'],'where':_0x1c5181,'limit':0x1}})[_0xb2b1('0xb')](function(_0x5db0f3){logger[_0xb2b1('0x7')](_0xb2b1('0x11'),JSON[_0xb2b1('0x12')](_0x1c5181),_0x5db0f3?util['inspect'](_0x5db0f3,{'showHidden':![],'depth':null}):'');return _0x5db0f3[_0xb2b1('0x13')][_0xb2b1('0x14')]?_0x5db0f3['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x3c7f93){return new BPromise(function(_0x19561c,_0x152cf9){if(_0x3c7f93){return getUser({'internal':_0x3c7f93})['then'](function(_0x1911ae){logger[_0xb2b1('0x6')](_0xb2b1('0x15'),_0x3c7f93,_0x1911ae?'found':_0xb2b1('0x16'));return _0x19561c(_0x1911ae);})[_0xb2b1('0xc')](function(_0x2c84ba){logger[_0xb2b1('0x8')](_0xb2b1('0x17'),_0x2c84ba?util[_0xb2b1('0x9')](_0x2c84ba,{'showHidden':![],'depth':null}):'');return _0x19561c(null);});}return _0x19561c(null);});};exports['getUserByInterface']=function(_0x858550){return new BPromise(function(_0x55d3b3,_0x339d5b){if(_0x858550){return getUser({'interface':_0x858550})[_0xb2b1('0xb')](function(_0x4d0efb){logger[_0xb2b1('0x6')](_0xb2b1('0x18'),_0x858550,_0x4d0efb?_0xb2b1('0x19'):_0xb2b1('0x16'));return _0x55d3b3(_0x4d0efb);})[_0xb2b1('0xc')](function(_0x4bbd80){logger[_0xb2b1('0x8')](_0xb2b1('0x1a'),_0x4bbd80?util[_0xb2b1('0x9')](_0x4bbd80,{'showHidden':![],'depth':null}):'');return _0x55d3b3(null);});}return _0x55d3b3(null);});};exports['getUserByName']=function(_0x21a625){return new BPromise(function(_0x52c959,_0x4d239b){if(_0x21a625){return getUser({'name':_0x21a625})['then'](function(_0x45b967){logger[_0xb2b1('0x6')](_0xb2b1('0x1b'),_0x21a625,_0x45b967?_0xb2b1('0x19'):_0xb2b1('0x16'));return _0x52c959(_0x45b967);})['catch'](function(_0x540750){logger['error'](_0xb2b1('0x1c'),_0x540750?util[_0xb2b1('0x9')](_0x540750,{'showHidden':![],'depth':null}):'');return _0x52c959(null);});}return _0x52c959(null);});};exports[_0xb2b1('0x1d')]=function(_0x201d17){return new BPromise(function(_0x294af8,_0x25a6af){if(_0x201d17){return client[_0xb2b1('0xa')](_0xb2b1('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb2b1('0x10'),_0xb2b1('0x1f'),_0xb2b1('0x20'),'acwTimeout'],'where':{'name':_0x201d17},'limit':0x1}})[_0xb2b1('0xb')](function(_0x3a661f){logger[_0xb2b1('0x7')](_0xb2b1('0x21'),_0x201d17,_0x3a661f?util[_0xb2b1('0x9')](_0x3a661f,{'showHidden':![],'depth':null}):'');logger[_0xb2b1('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x201d17,_0x3a661f?_0xb2b1('0x19'):_0xb2b1('0x16'));return _0x294af8(_0x3a661f['result'][_0xb2b1('0x14')]?_0x3a661f[_0xb2b1('0x13')][0x0]:null);})[_0xb2b1('0xc')](function(_0x55681c){logger[_0xb2b1('0x8')](_0xb2b1('0x22'),_0x55681c?util[_0xb2b1('0x9')](_0x55681c,{'showHidden':![],'depth':null}):'');return _0x294af8(null);});}return _0x294af8(null);});};exports['addTime']=function(_0x58fd62,_0x5da4cd){return moment(_0x58fd62)[_0xb2b1('0x23')](_0x5da4cd,_0xb2b1('0x24'))[_0xb2b1('0x25')](_0xb2b1('0x26'));};exports[_0xb2b1('0x27')]=function(_0x34c108,_0x56e387){return moment(_0x34c108)['subtract'](_0x56e387,_0xb2b1('0x24'))[_0xb2b1('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb2b1('0x28')]=function(_0x1f6cd3,_0x14d1d0){return moment(_0x1f6cd3)[_0xb2b1('0x29')](moment(_0x14d1d0),_0xb2b1('0x24'));};exports[_0xb2b1('0x2a')]=function(_0x40b02d,_0x596575){return parseInt(_0x40b02d,0xa)+parseInt(_0x596575,0xa);};exports[_0xb2b1('0x2b')]=function(){return moment()['format'](_0xb2b1('0x26'));};exports[_0xb2b1('0x2c')]=function(_0x2c6ba3,_0x5d4474){if(_0x5d4474){return moment(_0x2c6ba3)['isAfter'](_0x5d4474);}return!![];};exports[_0xb2b1('0x2d')]=function(_0x1f5dc3,_0xd1fa6d){if(_0xd1fa6d){return moment(_0x1f5dc3)[_0xb2b1('0x2d')](_0xd1fa6d);}else if(_0x1f5dc3){return!![];}return![];}; \ No newline at end of file +var _0xe81b=['sumTime','now','isAfter','bluebird','jayson/promise','moment','util','client','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','[utils][getUser]\x20where:%s','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff'];(function(_0x20daaf,_0x4d8fea){var _0x50fb5f=function(_0x5e5a8a){while(--_0x5e5a8a){_0x20daaf['push'](_0x20daaf['shift']());}};_0x50fb5f(++_0x4d8fea);}(_0xe81b,0xe4));var _0xbe81=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xe81b[_0x29d915];return _0x160f86;};'use strict';var BPromise=require(_0xbe81('0x0'));var jayson=require(_0xbe81('0x1'));var moment=require(_0xbe81('0x2'));var util=require(_0xbe81('0x3'));var client=jayson[_0xbe81('0x4')][_0xbe81('0x5')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x2438d1,_0x220c72){logger[_0xbe81('0x6')](_0x2438d1,_0x220c72?util[_0xbe81('0x7')](_0x220c72,{'showHidden':![],'depth':null}):'');};exports[_0xbe81('0x8')]=function(_0x36d6bb,_0x1ed8bc){logger[_0xbe81('0x8')](_0x36d6bb,_0x1ed8bc?util[_0xbe81('0x7')](_0x1ed8bc,{'showHidden':![],'depth':null}):'');};exports[_0xbe81('0x9')]=function(_0x52187d,_0x4f99ea){logger[_0xbe81('0x9')](_0x52187d,_0x4f99ea?util[_0xbe81('0x7')](_0x4f99ea,{'showHidden':![],'depth':null}):'');};exports[_0xbe81('0xa')]=function(_0x3d78c4,_0x487bcf){return client[_0xbe81('0xa')](_0x3d78c4,{'body':_0x487bcf})[_0xbe81('0xb')](function(_0x56657f){logger[_0xbe81('0x8')](_0xbe81('0xc'),_0x3d78c4,_0x56657f?util[_0xbe81('0x7')](_0x56657f,{'showHidden':![],'depth':null}):'');})[_0xbe81('0xd')](function(_0x1b6259){logger[_0xbe81('0x9')](_0xbe81('0xc'),_0x3d78c4,_0x1b6259?util[_0xbe81('0x7')](_0x1b6259,{'showHidden':![],'depth':null}):'');});};function getUser(_0x327a8c){return client['request'](_0xbe81('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xbe81('0xf'),'interface'],'where':_0x327a8c,'limit':0x1}})[_0xbe81('0xb')](function(_0x36e263){logger[_0xbe81('0x8')](_0xbe81('0x10'),JSON['stringify'](_0x327a8c),_0x36e263?util[_0xbe81('0x7')](_0x36e263,{'showHidden':![],'depth':null}):'');return _0x36e263['result'][_0xbe81('0x11')]?_0x36e263[_0xbe81('0x12')][0x0]:null;});}exports[_0xbe81('0x13')]=function(_0x14bc28){return new BPromise(function(_0x56d18f,_0x24f2b2){if(_0x14bc28){return getUser({'internal':_0x14bc28})['then'](function(_0x4679b1){logger['info'](_0xbe81('0x14'),_0x14bc28,_0x4679b1?_0xbe81('0x15'):'notfound');return _0x56d18f(_0x4679b1);})[_0xbe81('0xd')](function(_0x3c0b03){logger[_0xbe81('0x9')](_0xbe81('0x16'),_0x3c0b03?util['inspect'](_0x3c0b03,{'showHidden':![],'depth':null}):'');return _0x56d18f(null);});}return _0x56d18f(null);});};exports[_0xbe81('0x17')]=function(_0x4cda12){return new BPromise(function(_0x16cc57,_0x454937){if(_0x4cda12){return getUser({'interface':_0x4cda12})[_0xbe81('0xb')](function(_0x49eccf){logger['info'](_0xbe81('0x18'),_0x4cda12,_0x49eccf?_0xbe81('0x15'):'notfound');return _0x16cc57(_0x49eccf);})['catch'](function(_0x1ebb18){logger[_0xbe81('0x9')](_0xbe81('0x19'),_0x1ebb18?util[_0xbe81('0x7')](_0x1ebb18,{'showHidden':![],'depth':null}):'');return _0x16cc57(null);});}return _0x16cc57(null);});};exports[_0xbe81('0x1a')]=function(_0x2a799d){return new BPromise(function(_0x15fc48,_0x2e08e7){if(_0x2a799d){return getUser({'name':_0x2a799d})[_0xbe81('0xb')](function(_0x356696){logger[_0xbe81('0x6')](_0xbe81('0x1b'),_0x2a799d,_0x356696?_0xbe81('0x15'):_0xbe81('0x1c'));return _0x15fc48(_0x356696);})[_0xbe81('0xd')](function(_0x5725ea){logger['error']('[utils][getUserByName]',_0x5725ea?util[_0xbe81('0x7')](_0x5725ea,{'showHidden':![],'depth':null}):'');return _0x15fc48(null);});}return _0x15fc48(null);});};exports['getVoiceQueueByName']=function(_0x42cda6){return new BPromise(function(_0x1e3d40,_0x2d1819){if(_0x42cda6){return client[_0xbe81('0xa')](_0xbe81('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xbe81('0xf'),_0xbe81('0x1e'),_0xbe81('0x1f'),_0xbe81('0x20')],'where':{'name':_0x42cda6},'limit':0x1}})['then'](function(_0x1b393e){logger[_0xbe81('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x42cda6,_0x1b393e?util['inspect'](_0x1b393e,{'showHidden':![],'depth':null}):'');logger['info'](_0xbe81('0x21'),_0x42cda6,_0x1b393e?_0xbe81('0x15'):_0xbe81('0x1c'));return _0x1e3d40(_0x1b393e[_0xbe81('0x12')][_0xbe81('0x11')]?_0x1b393e[_0xbe81('0x12')][0x0]:null);})['catch'](function(_0x3969d1){logger[_0xbe81('0x9')](_0xbe81('0x22'),_0x3969d1?util[_0xbe81('0x7')](_0x3969d1,{'showHidden':![],'depth':null}):'');return _0x1e3d40(null);});}return _0x1e3d40(null);});};exports['addTime']=function(_0x4c689f,_0x5d80db){return moment(_0x4c689f)['add'](_0x5d80db,_0xbe81('0x23'))[_0xbe81('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xbe81('0x25')]=function(_0x5a4cbc,_0x3e7459){return moment(_0x5a4cbc)[_0xbe81('0x26')](_0x3e7459,_0xbe81('0x23'))['format'](_0xbe81('0x27'));};exports[_0xbe81('0x28')]=function(_0x31330e,_0x144fcf){return moment(_0x31330e)[_0xbe81('0x29')](moment(_0x144fcf),'seconds');};exports[_0xbe81('0x2a')]=function(_0x412f6b,_0x5315b2){return parseInt(_0x412f6b,0xa)+parseInt(_0x5315b2,0xa);};exports[_0xbe81('0x2b')]=function(){return moment()[_0xbe81('0x24')](_0xbe81('0x27'));};exports[_0xbe81('0x2c')]=function(_0x39fdf3,_0x21cce2){if(_0x21cce2){return moment(_0x39fdf3)[_0xbe81('0x2c')](_0x21cce2);}return!![];};exports['isBefore']=function(_0x1c0c64,_0x3e439c){if(_0x3e439c){return moment(_0x1c0c64)['isBefore'](_0x3e439c);}else if(_0x1c0c64){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 3e22333..751ec31 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 _0xec9c=['statusCode','responseTime','role','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)','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','name','ensureDir','catch','user','then','no-user','error','api','auth','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url'];(function(_0x2e83d1,_0x34b1fe){var _0x5a6545=function(_0x1bc43d){while(--_0x1bc43d){_0x2e83d1['push'](_0x2e83d1['shift']());}};_0x5a6545(++_0x34b1fe);}(_0xec9c,0x194));var _0xcec9=function(_0x45dbea,_0x5c1e3b){_0x45dbea=_0x45dbea-0x0;var _0x164c9e=_0xec9c[_0x45dbea];return _0x164c9e;};var fs=require(_0xcec9('0x0'));var _=require(_0xcec9('0x1'));var ewinston=require(_0xcec9('0x2'));var path=require(_0xcec9('0x3'));var util=require('util');var fileLogger=require(_0xcec9('0x4'))[_0xcec9('0x5')];var safeTemplate=require(_0xcec9('0x6'))[_0xcec9('0x7')];var maskSensitiveData=require(_0xcec9('0x8'))[_0xcec9('0x9')];function ClientSideLogger(){function _0x238d07(_0x3db4b9){var _0x55f350=path[_0xcec9('0xa')]('/var',_0xcec9('0xb'),_0xcec9('0xc'));var _0x2b5dd0=path[_0xcec9('0xa')](_0xcec9('0xd'),_0x3db4b9['role']+'-'+_0x3db4b9[_0xcec9('0xe')]);return fs[_0xcec9('0xf')](path[_0xcec9('0xa')](_0x55f350,_0x2b5dd0))['then'](function(){var _0x506b49=fileLogger(_0xcec9('0xd'),path[_0xcec9('0xa')](_0x55f350,_0x2b5dd0));return _0x506b49;})[_0xcec9('0x10')](function(_0x1883a8){throw _0x1883a8;});}this['log']=function(_0x1ba235,_0x5238ce,_0x557ee3,_0x1d5db1){return _0x238d07(_0x1ba235[_0xcec9('0x11')])[_0xcec9('0x12')](function(_0xde06a){var _0x2897c7=_0xde06a[_0x5238ce];return _0x2897c7;})[_0xcec9('0x12')](function(_0x5c1a40){var _0xa51b55=_0x1ba235['user']?_0x1ba235[_0xcec9('0x11')]['id']:_0xcec9('0x13');var _0x4a9154=_0x1d5db1['data'];var _0x2a63a0=_0x1d5db1['timestamp'];var _0x4e6e3a=new Date(Number(_0x2a63a0));return _0x5c1a40(_0xa51b55,_0x4e6e3a,_0x557ee3,_0x4a9154);})[_0xcec9('0x10')](function(_0x49556d){fileLogger(_0xcec9('0xd'))[_0xcec9('0x14')](_0x49556d);});};}function setupLoggers(_0x12f29a){return new Promise(function(_0x2d1b1a){var _0x5d392a=new ClientSideLogger();var _0x440f9e=fileLogger(_0xcec9('0x15'));var _0x27b545=fileLogger(_0xcec9('0x16'));_0x12f29a[_0xcec9('0x17')](_0xcec9('0x18'),_0x5d392a);_0x12f29a[_0xcec9('0x19')](ewinston['logger']({'winstonInstance':_0x440f9e,'meta':![],'statusLevels':!![],'msg':function(_0x2fa322,_0xfef392){var _0x669408=_0xcec9('0x1a');if(!_[_0xcec9('0x1b')](_0x2fa322[_0xcec9('0x1c')])){_0x669408+=_0xcec9('0x1d');var _0x5e160d=_0x2fa322[_0xcec9('0x1c')];maskSensitiveData(_0x5e160d);}return safeTemplate(util[_0xcec9('0x1e')](_0x669408,_0x2fa322[_0xcec9('0x1f')],_0x2fa322[_0xcec9('0x20')][_0xcec9('0x21')]?_0x2fa322[_0xcec9('0x20')][_0xcec9('0x21')]:_0x2fa322[_0xcec9('0x22')][_0xcec9('0x23')]||_0x2fa322['ip'],_0x2fa322[_0xcec9('0x24')],_0xfef392[_0xcec9('0x25')],_0xfef392[_0xcec9('0x26')],_0x2fa322[_0xcec9('0x11')]?_0x2fa322[_0xcec9('0x11')]['id']:null,_0x2fa322[_0xcec9('0x11')]?_0x2fa322['user'][_0xcec9('0xe')]:null,_0x2fa322[_0xcec9('0x11')]?_0x2fa322[_0xcec9('0x11')][_0xcec9('0x27')]:null,_0x5e160d?util['inspect'](_0x5e160d,![],null):''));}}));_0x12f29a[_0xcec9('0x19')](ewinston[_0xcec9('0x28')]({'winstonInstance':_0x27b545,'meta':![],'statusLevels':!![],'msg':function(_0x351326,_0x17b7a7){var _0x2c259f=_0xcec9('0x29');if(_0x351326['body']&&_0x351326[_0xcec9('0x1c')][_0xcec9('0x2a')]&&_0x351326[_0xcec9('0x1c')][_0xcec9('0x2b')]){_0x2c259f=_0xcec9('0x2c');}return util[_0xcec9('0x1e')](_0x2c259f,_0x351326[_0xcec9('0x1f')],_0x351326[_0xcec9('0x20')][_0xcec9('0x21')]?_0x351326[_0xcec9('0x20')]['x-forwarded-for']:_0x351326[_0xcec9('0x22')][_0xcec9('0x23')]||_0x351326['ip'],_0x351326[_0xcec9('0x24')],_0x17b7a7[_0xcec9('0x25')],_0x17b7a7[_0xcec9('0x26')],_0x351326[_0xcec9('0x11')]?_0x351326[_0xcec9('0x11')]['id']:null,_0x351326[_0xcec9('0x11')]?_0x351326[_0xcec9('0x11')]['name']:null,_0x351326[_0xcec9('0x11')]?_0x351326['user'][_0xcec9('0x27')]:null,_0x351326[_0xcec9('0x1c')]&&_0x351326[_0xcec9('0x1c')][_0xcec9('0x2a')]?_0x351326[_0xcec9('0x1c')][_0xcec9('0x2a')]:_0xcec9('0x2d'),_0x351326[_0xcec9('0x1c')]&&_0x351326[_0xcec9('0x1c')]['agent_id']?_0x351326[_0xcec9('0x1c')][_0xcec9('0x2b')]:'',_0x351326['body']&&_0x351326[_0xcec9('0x1c')][_0xcec9('0x2e')]?_0x351326['body']['agent_name']:'');},'ignoreRoute':function(_0x74ba82){var _0xba68f7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xba68f7[_0xcec9('0x2f')](_0x74ba82[_0xcec9('0x24')]);}}));return _0x2d1b1a();});}exports[_0xcec9('0x30')]=setupLoggers; \ No newline at end of file +var _0x2244=['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','other','test','lodash','express-winston','path','util','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','role','name','ensureDir','then','catch','user','no-user','data','client','error','api','auth','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device'];(function(_0x359d84,_0x23ee55){var _0x4f823c=function(_0x4700ec){while(--_0x4700ec){_0x359d84['push'](_0x359d84['shift']());}};_0x4f823c(++_0x23ee55);}(_0x2244,0x1bd));var _0x4224=function(_0x3d7ce2,_0x5992aa){_0x3d7ce2=_0x3d7ce2-0x0;var _0x46e8ea=_0x2244[_0x3d7ce2];return _0x46e8ea;};var fs=require('fs-extra');var _=require(_0x4224('0x0'));var ewinston=require(_0x4224('0x1'));var path=require(_0x4224('0x2'));var util=require(_0x4224('0x3'));var fileLogger=require('./loggers')[_0x4224('0x4')];var safeTemplate=require(_0x4224('0x5'))[_0x4224('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0x4224('0x7')];function ClientSideLogger(){function _0x3225b7(_0x3053c5){var _0x1803a7=path[_0x4224('0x8')](_0x4224('0x9'),'log','xcally');var _0x14f9e7=path['join']('client',_0x3053c5[_0x4224('0xa')]+'-'+_0x3053c5[_0x4224('0xb')]);return fs[_0x4224('0xc')](path[_0x4224('0x8')](_0x1803a7,_0x14f9e7))[_0x4224('0xd')](function(){var _0x4021bb=fileLogger('client',path[_0x4224('0x8')](_0x1803a7,_0x14f9e7));return _0x4021bb;})[_0x4224('0xe')](function(_0x30f54a){throw _0x30f54a;});}this['log']=function(_0x2987a7,_0x5d9784,_0x4694a8,_0x454144){return _0x3225b7(_0x2987a7[_0x4224('0xf')])[_0x4224('0xd')](function(_0x4547fd){var _0x5560cc=_0x4547fd[_0x5d9784];return _0x5560cc;})['then'](function(_0x249e66){var _0x9e467a=_0x2987a7[_0x4224('0xf')]?_0x2987a7[_0x4224('0xf')]['id']:_0x4224('0x10');var _0x3c8ce7=_0x454144[_0x4224('0x11')];var _0x18a766=_0x454144['timestamp'];var _0x1adfd9=new Date(Number(_0x18a766));return _0x249e66(_0x9e467a,_0x1adfd9,_0x4694a8,_0x3c8ce7);})['catch'](function(_0x443cfa){fileLogger(_0x4224('0x12'))[_0x4224('0x13')](_0x443cfa);});};}function setupLoggers(_0x532bf6){return new Promise(function(_0x2ca0cb){var _0x2501ce=new ClientSideLogger();var _0x57b50f=fileLogger(_0x4224('0x14'));var _0x55abc8=fileLogger(_0x4224('0x15'));_0x532bf6['set'](_0x4224('0x16'),_0x2501ce);_0x532bf6['use'](ewinston[_0x4224('0x17')]({'winstonInstance':_0x57b50f,'meta':![],'statusLevels':!![],'msg':function(_0x38a628,_0x1356f6){var _0x1b1f9f=_0x4224('0x18');if(!_[_0x4224('0x19')](_0x38a628[_0x4224('0x1a')])){_0x1b1f9f+=_0x4224('0x1b');var _0x3aa90e=_0x38a628[_0x4224('0x1a')];maskSensitiveData(_0x3aa90e);}return safeTemplate(util[_0x4224('0x1c')](_0x1b1f9f,_0x38a628[_0x4224('0x1d')],_0x38a628[_0x4224('0x1e')]['x-forwarded-for']?_0x38a628[_0x4224('0x1e')][_0x4224('0x1f')]:_0x38a628[_0x4224('0x20')][_0x4224('0x21')]||_0x38a628['ip'],_0x38a628[_0x4224('0x22')],_0x1356f6[_0x4224('0x23')],_0x1356f6['responseTime'],_0x38a628['user']?_0x38a628[_0x4224('0xf')]['id']:null,_0x38a628['user']?_0x38a628[_0x4224('0xf')]['name']:null,_0x38a628[_0x4224('0xf')]?_0x38a628[_0x4224('0xf')][_0x4224('0xa')]:null,_0x3aa90e?util[_0x4224('0x24')](_0x3aa90e,![],null):''));}}));_0x532bf6['use'](ewinston[_0x4224('0x17')]({'winstonInstance':_0x55abc8,'meta':![],'statusLevels':!![],'msg':function(_0x32ec6d,_0x13774c){var _0xd0e107=_0x4224('0x25');if(_0x32ec6d[_0x4224('0x1a')]&&_0x32ec6d[_0x4224('0x1a')][_0x4224('0x26')]&&_0x32ec6d[_0x4224('0x1a')][_0x4224('0x27')]){_0xd0e107=_0x4224('0x28');}return util[_0x4224('0x1c')](_0xd0e107,_0x32ec6d['method'],_0x32ec6d[_0x4224('0x1e')]['x-forwarded-for']?_0x32ec6d['headers'][_0x4224('0x1f')]:_0x32ec6d[_0x4224('0x20')][_0x4224('0x21')]||_0x32ec6d['ip'],_0x32ec6d[_0x4224('0x22')],_0x13774c[_0x4224('0x23')],_0x13774c[_0x4224('0x29')],_0x32ec6d[_0x4224('0xf')]?_0x32ec6d[_0x4224('0xf')]['id']:null,_0x32ec6d['user']?_0x32ec6d[_0x4224('0xf')][_0x4224('0xb')]:null,_0x32ec6d[_0x4224('0xf')]?_0x32ec6d[_0x4224('0xf')][_0x4224('0xa')]:null,_0x32ec6d['body']&&_0x32ec6d[_0x4224('0x1a')]['device']?_0x32ec6d[_0x4224('0x1a')][_0x4224('0x26')]:_0x4224('0x2a'),_0x32ec6d[_0x4224('0x1a')]&&_0x32ec6d[_0x4224('0x1a')][_0x4224('0x27')]?_0x32ec6d[_0x4224('0x1a')][_0x4224('0x27')]:'',_0x32ec6d['body']&&_0x32ec6d[_0x4224('0x1a')]['agent_name']?_0x32ec6d[_0x4224('0x1a')]['agent_name']:'');},'ignoreRoute':function(_0x581413){var _0x1782e3=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1782e3[_0x4224('0x2b')](_0x581413['url']);}}));return _0x2ca0cb();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index f120228..717fc47 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c39=['daysInMonth','max','min','domCompare','MMM','test','split','length','padStart','iftime','moment-timezone','map','source','join','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval','clone','minutes','hours','isBefore','startOf','endOf','day','isBetween','timeCompare','format','ddd','includes','dowCompare','date'];(function(_0x4bee61,_0x533f64){var _0x158b49=function(_0x58b05a){while(--_0x58b05a){_0x4bee61['push'](_0x4bee61['shift']());}};_0x158b49(++_0x533f64);}(_0x2c39,0x132));var _0x92c3=function(_0x34f46d,_0x1d6712){_0x34f46d=_0x34f46d-0x0;var _0x3a2d9e=_0x2c39[_0x34f46d];return _0x3a2d9e;};var _=require('lodash');var moment=require(_0x92c3('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x92c3('0x1')](function(_0x43d633){return _0x43d633[_0x92c3('0x2')];})[_0x92c3('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x5aaae8){if(!_0x5aaae8['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4027e1){var _0x4d2d96=_0x4027e1['split'](':')[_0x92c3('0x1')](function(_0x387397){return parseInt(_0x387397,0xa);});var _0x4d5856=_0x4d2d96[0x0];var _0x2bf015=_0x4d2d96[0x1];if(_0x4d5856<0x0||_0x4d5856>0x17||_0x2bf015<0x0||_0x2bf015>0x3b){throw new Error(EINVALID_DATE);}return[_0x4d5856,_0x2bf015];}function circularDoWInterval(_0x4288ea,_0x438fba){if(_0x4288ea===_0x438fba){return[_0x4288ea];}else{var _0x2ad79f=moment[_0x92c3('0x4')]();moment[_0x92c3('0x4')]('en');var _0x1ed92e=moment[_0x92c3('0x5')]()['map'](function(_0x1a26a7){return _0x1a26a7[_0x92c3('0x6')]();});moment[_0x92c3('0x4')](_0x2ad79f);var _0x3b4fe9=_0x1ed92e['indexOf'](_0x4288ea);var _0x452950=_0x1ed92e[_0x92c3('0x7')](_0x438fba);if(_0x452950>_0x3b4fe9){return _0x1ed92e[_0x92c3('0x8')](_0x3b4fe9,_0x452950+0x1);}else{var _0x94212f=_0x1ed92e[_0x92c3('0x8')](0x0,_0x452950+0x1);var _0x3efc38=_0x1ed92e['slice'](_0x3b4fe9);return _0x3efc38[_0x92c3('0x9')](_0x94212f);}}}module[_0x92c3('0xa')][_0x92c3('0xb')]=circularDoWInterval;function circularMonthInterval(_0x1e2b9f,_0x1fa0c2){if(_0x1e2b9f===_0x1fa0c2){return[_0x1e2b9f];}else{var _0x40466c=moment[_0x92c3('0x4')]();moment[_0x92c3('0x4')]('en');var _0x3fae68=moment['monthsShort']()[_0x92c3('0x1')](function(_0xce5792){return _0xce5792[_0x92c3('0x6')]();});moment[_0x92c3('0x4')](_0x40466c);var _0x4c4221=_0x3fae68[_0x92c3('0x7')](_0x1e2b9f);var _0x360f26=_0x3fae68[_0x92c3('0x7')](_0x1fa0c2);if(_0x360f26>_0x4c4221){return _0x3fae68[_0x92c3('0x8')](_0x4c4221,_0x360f26+0x1);}else{var _0x1a5f90=_0x3fae68['slice'](0x0,_0x360f26+0x1);var _0x358ffd=_0x3fae68['slice'](_0x4c4221);return _0x358ffd[_0x92c3('0x9')](_0x1a5f90);}}}module[_0x92c3('0xa')][_0x92c3('0xc')]=circularMonthInterval;function parseDom(_0x3bed12){var _0x3433fe=parseInt(_0x3bed12,0xa);if(_0x3433fe<0x1||_0x3433fe>0x1f){throw new Error(EINVALID_DATE);}return _0x3433fe;}function timeCompare(_0x3fa260,_0x34c9a9,_0x2622a2){var _0x4b0248=_0x3fa260[_0x92c3('0xd')]();var _0x37e5fd=extractTime(_0x34c9a9);var _0x1d7d18=_0x37e5fd[0x0];var _0x3f6954=_0x37e5fd[0x1];var _0x133b6f=_0x3fa260['clone']()['hours'](_0x1d7d18)[_0x92c3('0xe')](_0x3f6954);throwIfDateNotValid(_0x133b6f);var _0x351437=extractTime(_0x2622a2);var _0x4c5697=_0x351437[0x0];var _0x1892f1=_0x351437[0x1];var _0x1fc123=_0x3fa260[_0x92c3('0xd')]()[_0x92c3('0xf')](_0x4c5697)[_0x92c3('0xe')](_0x1892f1);throwIfDateNotValid(_0x1fc123);if(_0x1fc123[_0x92c3('0x10')](_0x133b6f)){var _0x350600=_0x4b0248[_0x92c3('0xd')]()[_0x92c3('0x11')]('day');var _0x21f067=_0x4b0248[_0x92c3('0xd')]()[_0x92c3('0x12')](_0x92c3('0x13'));return _0x4b0248[_0x92c3('0x14')](_0x133b6f,_0x21f067,undefined,'[]')||_0x4b0248[_0x92c3('0x14')](_0x350600,_0x1fc123,undefined,'[]');}else{return _0x4b0248[_0x92c3('0x14')](_0x133b6f,_0x1fc123,undefined,'[]');}}module[_0x92c3('0xa')][_0x92c3('0x15')]=timeCompare;function dowCompare(_0x425458,_0x200999,_0x356b3b){var _0x5189df=_0x425458['locale']('en')[_0x92c3('0x16')](_0x92c3('0x17'))[_0x92c3('0x6')]();return circularDoWInterval(_0x200999,_0x356b3b)[_0x92c3('0x18')](_0x5189df);}module[_0x92c3('0xa')][_0x92c3('0x19')]=dowCompare;function domCompare(_0x2727dd,_0x56a7bc,_0x3d089){var _0x2b8ad3=_0x2727dd[_0x92c3('0x1a')]();if(_0x56a7bc===_0x3d089){return _0x2b8ad3===_0x56a7bc;}else{var _0x16ab65=_0x2727dd[_0x92c3('0x1b')]();var _0xb1d6e7=_0x56a7bc<_0x3d089;let _0x52cbef=![];var _0x11bdf7=0x0;var _0xa72a8=0x0;if(_0xb1d6e7){_0x11bdf7=Math[_0x92c3('0x1c')](0x1,_0x56a7bc);_0xa72a8=Math['min'](_0x3d089,_0x16ab65);_0x52cbef=_0x2b8ad3>=_0x11bdf7&&_0x2b8ad3<=_0xa72a8;}else{_0x11bdf7=Math[_0x92c3('0x1d')](_0x56a7bc,_0x16ab65);_0xa72a8=Math[_0x92c3('0x1c')](0x1,_0x3d089);_0x52cbef=_0x2b8ad3>=_0x11bdf7||_0x2b8ad3<=_0xa72a8;}return _0x52cbef;}}module[_0x92c3('0xa')][_0x92c3('0x1e')]=domCompare;function monthCompare(_0x2584ae,_0x50849b,_0xbc4824){var _0x3d84ea=_0x2584ae[_0x92c3('0x4')]('en')[_0x92c3('0x16')](_0x92c3('0x1f'))[_0x92c3('0x6')]();return circularMonthInterval(_0x50849b,_0xbc4824)[_0x92c3('0x18')](_0x3d84ea);}module[_0x92c3('0xa')]['monthCompare']=monthCompare;function iftime(_0x29bf49,_0xcdeafd=moment['tz']['guess'](),_0x5e6504=moment()){if(!validateRx[_0x92c3('0x20')](_0x29bf49)){throw new Error(EINVALID_STRING);}else{var _0x5478b7=(moment['isMoment'](_0x5e6504)?_0x5e6504[_0x92c3('0xd')]():moment(_0x5e6504))['tz'](_0xcdeafd)[_0x92c3('0x4')]('en');throwIfDateNotValid(_0x5478b7);var _0x167344=_0x29bf49['split'](',');var _0x38e862=_0x167344[0x0];var _0xeec55a=_0x167344[0x1];var _0x2692c4=_0x167344[0x2];var _0x27f30b=_0x167344[0x3];let _0x18c9c3=!![];if(_0x38e862!=='*'){var _0x376f5c=_0x38e862[_0x92c3('0x21')]('-');var _0x546e7f=_['padStart'](_0x376f5c[0x0],0x5,'0');var _0x5b65b9=_0x376f5c[_0x92c3('0x22')]===0x2?_[_0x92c3('0x23')](_0x376f5c[0x1],0x5,'0'):_0x546e7f;_0x18c9c3=timeCompare(_0x5478b7,_0x546e7f,_0x5b65b9);}let _0x3f08e4=!![];if(_0xeec55a!=='*'){var _0x5bb7e5=_0xeec55a[_0x92c3('0x21')]('-');var _0x113ddb=_0x5bb7e5[0x0];var _0x343f4e=_0x5bb7e5['length']===0x2?_0x5bb7e5[0x1]:_0x113ddb;_0x3f08e4=dowCompare(_0x5478b7,_0x113ddb,_0x343f4e);}let _0x9528bf=!![];if(_0x2692c4!=='*'){var _0x3c5e0d=_0x2692c4[_0x92c3('0x21')]('-');var _0x31930f=parseDom(_0x3c5e0d[0x0]);var _0x348383=_0x3c5e0d['length']===0x2?parseDom(_0x3c5e0d[0x1]):_0x31930f;_0x9528bf=domCompare(_0x5478b7,_0x31930f,_0x348383);}let _0x864bc8=!![];if(_0x27f30b!=='*'){var _0x1377f0=_0x27f30b[_0x92c3('0x21')]('-');var _0x471c26=_0x1377f0[0x0];var _0x36fb40=_0x1377f0[_0x92c3('0x22')]===0x2?_0x1377f0[0x1]:_0x1377f0[0x0];_0x864bc8=monthCompare(_0x5478b7,_0x471c26,_0x36fb40);}return _0x18c9c3&&_0x3f08e4&&_0x9528bf&&_0x864bc8;}}module[_0x92c3('0xa')][_0x92c3('0x24')]=iftime; \ No newline at end of file +var _0x1997=['toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','MMM','guess','isMoment','length','padStart','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','locale','weekdaysShort'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1997,0x1be));var _0x7199=function(_0x537e3d,_0x163936){_0x537e3d=_0x537e3d-0x0;var _0x52de9a=_0x1997[_0x537e3d];return _0x52de9a;};var _=require('lodash');var moment=require(_0x7199('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x5d9134){return _0x5d9134[_0x7199('0x1')];})[_0x7199('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x7199('0x3');var EINVALID_DATE=_0x7199('0x4');function throwIfDateNotValid(_0x4201de){if(!_0x4201de[_0x7199('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x364c69){var _0x2f0b1a=_0x364c69[_0x7199('0x6')](':')[_0x7199('0x7')](function(_0x18da5e){return parseInt(_0x18da5e,0xa);});var _0x21abab=_0x2f0b1a[0x0];var _0x113247=_0x2f0b1a[0x1];if(_0x21abab<0x0||_0x21abab>0x17||_0x113247<0x0||_0x113247>0x3b){throw new Error(EINVALID_DATE);}return[_0x21abab,_0x113247];}function circularDoWInterval(_0x5d2bd9,_0x1800a0){if(_0x5d2bd9===_0x1800a0){return[_0x5d2bd9];}else{var _0x16b9ae=moment[_0x7199('0x8')]();moment[_0x7199('0x8')]('en');var _0x5a997b=moment[_0x7199('0x9')]()[_0x7199('0x7')](function(_0x3823be){return _0x3823be[_0x7199('0xa')]();});moment[_0x7199('0x8')](_0x16b9ae);var _0x592d6c=_0x5a997b['indexOf'](_0x5d2bd9);var _0x7bcaa6=_0x5a997b[_0x7199('0xb')](_0x1800a0);if(_0x7bcaa6>_0x592d6c){return _0x5a997b['slice'](_0x592d6c,_0x7bcaa6+0x1);}else{var _0x1b5821=_0x5a997b[_0x7199('0xc')](0x0,_0x7bcaa6+0x1);var _0x1a73e1=_0x5a997b[_0x7199('0xc')](_0x592d6c);return _0x1a73e1[_0x7199('0xd')](_0x1b5821);}}}module[_0x7199('0xe')][_0x7199('0xf')]=circularDoWInterval;function circularMonthInterval(_0xe6332e,_0x5b0a53){if(_0xe6332e===_0x5b0a53){return[_0xe6332e];}else{var _0x3e275c=moment[_0x7199('0x8')]();moment['locale']('en');var _0x29b0bd=moment['monthsShort']()[_0x7199('0x7')](function(_0xb2ca31){return _0xb2ca31[_0x7199('0xa')]();});moment[_0x7199('0x8')](_0x3e275c);var _0x445c51=_0x29b0bd['indexOf'](_0xe6332e);var _0xfcb2ef=_0x29b0bd[_0x7199('0xb')](_0x5b0a53);if(_0xfcb2ef>_0x445c51){return _0x29b0bd[_0x7199('0xc')](_0x445c51,_0xfcb2ef+0x1);}else{var _0x3d3076=_0x29b0bd[_0x7199('0xc')](0x0,_0xfcb2ef+0x1);var _0x66daad=_0x29b0bd['slice'](_0x445c51);return _0x66daad[_0x7199('0xd')](_0x3d3076);}}}module[_0x7199('0xe')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x270bbb){var _0x428e5d=parseInt(_0x270bbb,0xa);if(_0x428e5d<0x1||_0x428e5d>0x1f){throw new Error(EINVALID_DATE);}return _0x428e5d;}function timeCompare(_0x396da9,_0x3d5cc7,_0x1d2e7b){var _0x1705ee=_0x396da9[_0x7199('0x10')]();var _0x50b152=extractTime(_0x3d5cc7);var _0x1684a4=_0x50b152[0x0];var _0x475f39=_0x50b152[0x1];var _0x44ba8f=_0x396da9[_0x7199('0x10')]()[_0x7199('0x11')](_0x1684a4)['minutes'](_0x475f39);throwIfDateNotValid(_0x44ba8f);var _0x1aa29f=extractTime(_0x1d2e7b);var _0x370196=_0x1aa29f[0x0];var _0x57ea60=_0x1aa29f[0x1];var _0x1610ed=_0x396da9[_0x7199('0x10')]()['hours'](_0x370196)[_0x7199('0x12')](_0x57ea60);throwIfDateNotValid(_0x1610ed);if(_0x1610ed[_0x7199('0x13')](_0x44ba8f)){var _0x49991e=_0x1705ee[_0x7199('0x10')]()[_0x7199('0x14')](_0x7199('0x15'));var _0xa1c01b=_0x1705ee[_0x7199('0x10')]()[_0x7199('0x16')]('day');return _0x1705ee[_0x7199('0x17')](_0x44ba8f,_0xa1c01b,undefined,'[]')||_0x1705ee['isBetween'](_0x49991e,_0x1610ed,undefined,'[]');}else{return _0x1705ee[_0x7199('0x17')](_0x44ba8f,_0x1610ed,undefined,'[]');}}module[_0x7199('0xe')][_0x7199('0x18')]=timeCompare;function dowCompare(_0x20ebb0,_0x5d3710,_0x3f4779){var _0x3694fe=_0x20ebb0['locale']('en')[_0x7199('0x19')](_0x7199('0x1a'))[_0x7199('0xa')]();return circularDoWInterval(_0x5d3710,_0x3f4779)[_0x7199('0x1b')](_0x3694fe);}module[_0x7199('0xe')][_0x7199('0x1c')]=dowCompare;function domCompare(_0x6028a9,_0x2900f3,_0x250999){var _0x2bc942=_0x6028a9[_0x7199('0x1d')]();if(_0x2900f3===_0x250999){return _0x2bc942===_0x2900f3;}else{var _0x451d60=_0x6028a9[_0x7199('0x1e')]();var _0x43656d=_0x2900f3<_0x250999;let _0x478f05=![];var _0x4ec88f=0x0;var _0x260908=0x0;if(_0x43656d){_0x4ec88f=Math[_0x7199('0x1f')](0x1,_0x2900f3);_0x260908=Math[_0x7199('0x20')](_0x250999,_0x451d60);_0x478f05=_0x2bc942>=_0x4ec88f&&_0x2bc942<=_0x260908;}else{_0x4ec88f=Math[_0x7199('0x20')](_0x2900f3,_0x451d60);_0x260908=Math[_0x7199('0x1f')](0x1,_0x250999);_0x478f05=_0x2bc942>=_0x4ec88f||_0x2bc942<=_0x260908;}return _0x478f05;}}module[_0x7199('0xe')]['domCompare']=domCompare;function monthCompare(_0x3eecc2,_0x51bc83,_0x4e6421){var _0x1a8e7c=_0x3eecc2[_0x7199('0x8')]('en')[_0x7199('0x19')](_0x7199('0x21'))['toLowerCase']();return circularMonthInterval(_0x51bc83,_0x4e6421)[_0x7199('0x1b')](_0x1a8e7c);}module['exports']['monthCompare']=monthCompare;function iftime(_0xc1ac2b,_0x3986bf=moment['tz'][_0x7199('0x22')](),_0x4e9d4f=moment()){if(!validateRx['test'](_0xc1ac2b)){throw new Error(EINVALID_STRING);}else{var _0x57e0d4=(moment[_0x7199('0x23')](_0x4e9d4f)?_0x4e9d4f['clone']():moment(_0x4e9d4f))['tz'](_0x3986bf)[_0x7199('0x8')]('en');throwIfDateNotValid(_0x57e0d4);var _0x5ad5fc=_0xc1ac2b[_0x7199('0x6')](',');var _0x132d76=_0x5ad5fc[0x0];var _0x4c5667=_0x5ad5fc[0x1];var _0x232f1f=_0x5ad5fc[0x2];var _0xb91e80=_0x5ad5fc[0x3];let _0x31001d=!![];if(_0x132d76!=='*'){var _0x406176=_0x132d76[_0x7199('0x6')]('-');var _0x2c2565=_['padStart'](_0x406176[0x0],0x5,'0');var _0x4f5d8d=_0x406176[_0x7199('0x24')]===0x2?_[_0x7199('0x25')](_0x406176[0x1],0x5,'0'):_0x2c2565;_0x31001d=timeCompare(_0x57e0d4,_0x2c2565,_0x4f5d8d);}let _0x58b6a3=!![];if(_0x4c5667!=='*'){var _0x32c9fa=_0x4c5667[_0x7199('0x6')]('-');var _0x2ac7ce=_0x32c9fa[0x0];var _0x440557=_0x32c9fa['length']===0x2?_0x32c9fa[0x1]:_0x2ac7ce;_0x58b6a3=dowCompare(_0x57e0d4,_0x2ac7ce,_0x440557);}let _0x28ebfa=!![];if(_0x232f1f!=='*'){var _0x1d4e2c=_0x232f1f['split']('-');var _0x48ed21=parseDom(_0x1d4e2c[0x0]);var _0x314728=_0x1d4e2c['length']===0x2?parseDom(_0x1d4e2c[0x1]):_0x48ed21;_0x28ebfa=domCompare(_0x57e0d4,_0x48ed21,_0x314728);}let _0x4f0fed=!![];if(_0xb91e80!=='*'){var _0x3e1fe1=_0xb91e80[_0x7199('0x6')]('-');var _0x5e7e1c=_0x3e1fe1[0x0];var _0x24e6e1=_0x3e1fe1[_0x7199('0x24')]===0x2?_0x3e1fe1[0x1]:_0x3e1fe1[0x0];_0x4f0fed=monthCompare(_0x57e0d4,_0x5e7e1c,_0x24e6e1);}return _0x31001d&&_0x58b6a3&&_0x28ebfa&&_0x4f0fed;}}module[_0x7199('0xe')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 1918a7f..bdcf013 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c0c=['winston','../config/environment','debugLevel','toLowerCase','info','red','white','bold\x20white','gray','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','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','fileLogger','path','util'];(function(_0x35d74c,_0x2ccc08){var _0x100202=function(_0x4dff79){while(--_0x4dff79){_0x35d74c['push'](_0x35d74c['shift']());}};_0x100202(++_0x2ccc08);}(_0x4c0c,0x92));var _0xc4c0=function(_0x26d993,_0x559ddb){_0x26d993=_0x26d993-0x0;var _0x1807e0=_0x4c0c[_0x26d993];return _0x1807e0;};'use strict';var path=require(_0xc4c0('0x0'));var util=require(_0xc4c0('0x1'));var moment=require('moment');var winston=require(_0xc4c0('0x2'));var config=require(_0xc4c0('0x3'));var debugLevel=config[_0xc4c0('0x4')]?config[_0xc4c0('0x4')][_0xc4c0('0x5')]():_0xc4c0('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':_0xc4c0('0x7'),'warn':'bold\x20yellow','info':_0xc4c0('0x8'),'print':_0xc4c0('0x9'),'success':'bold\x20green','http':_0xc4c0('0xa'),'verbose':_0xc4c0('0xb'),'debug':_0xc4c0('0xc'),'silly':_0xc4c0('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1307eb,_0x3c227f,_0x129ade){var _0x12b09c=_0x1307eb||_0xc4c0('0xe');return path[_0xc4c0('0xf')](_0x12b09c,util[_0xc4c0('0x10')](_0xc4c0('0x11'),_0x3c227f,_0x129ade));}function formatter(_0x22a15b,_0x11ab22){_0x11ab22[_0xc4c0('0x12')]=_0x11ab22[_0xc4c0('0x12')]['replace'](/@@{/g,'{{{')[_0xc4c0('0x13')](/}@@/g,'}}}')[_0xc4c0('0x13')](/@{/g,'{{')[_0xc4c0('0x13')](/}@/g,'}}');return util[_0xc4c0('0x10')](_0xc4c0('0x14'),moment()['format'](_0xc4c0('0x15')),_0x11ab22[_0xc4c0('0x16')][_0xc4c0('0x17')](),_0x22a15b,_0x11ab22['message']);}function fileFormat(_0x2673ef,_0x27e6aa){_0x27e6aa['message']=_0x27e6aa[_0xc4c0('0x12')][_0xc4c0('0x13')](/@@{/g,'{{{')[_0xc4c0('0x13')](/}@@/g,'}}}')[_0xc4c0('0x13')](/@{/g,'{{')[_0xc4c0('0x13')](/}@/g,'}}');var _0x4fda18=_0x27e6aa[_0xc4c0('0x18')]&&Object[_0xc4c0('0x19')](_0x27e6aa[_0xc4c0('0x18')])['length']?'\x0a\x09'+JSON[_0xc4c0('0x1a')](_0x27e6aa[_0xc4c0('0x18')]):'';return util[_0xc4c0('0x10')](_0xc4c0('0x1b'),moment()[_0xc4c0('0x10')](_0xc4c0('0x15')),_0x27e6aa[_0xc4c0('0x16')][_0xc4c0('0x17')](),_0x2673ef,_0x27e6aa[_0xc4c0('0x12')],_0x4fda18);}function consoleLogger(){var _0x434934=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc4c0('0x1c'))][(_0xc4c0('0x1d'))]({'level':_0xc4c0('0x1e'),'json':![],'formatter':function(_0x40f4da){return formatter('',_0x40f4da);}})]});return _0x434934;}function fileLogger(_0x56f3dd,_0x3e9a7a){var _0x4b76fd=new winston[(_0xc4c0('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xc4c0('0x20'))]({'name':util[_0xc4c0('0x10')](_0xc4c0('0x21'),_0x56f3dd,'error'),'filename':getLogFileName(_0x3e9a7a,_0x56f3dd,'error'),'level':_0xc4c0('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3eab88){return fileFormat(_0x56f3dd,_0x3eab88);}}),new winston[(_0xc4c0('0x1c'))]['File']({'name':util['format'](_0xc4c0('0x21'),_0x56f3dd,debugLevel),'filename':getLogFileName(_0x3e9a7a,_0x56f3dd,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f925a){return fileFormat(_0x56f3dd,_0x3f925a);}}),new winston['transports'][(_0xc4c0('0x1d'))]({'level':_0xc4c0('0x1e'),'json':![],'formatter':function(_0x26cdec){return fileFormat(_0x56f3dd,_0x26cdec);}})]});return _0x4b76fd;}exports[_0xc4c0('0x23')]=consoleLogger;exports[_0xc4c0('0x24')]=fileLogger; \ No newline at end of file +var _0xdbbd=['%s-%s','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Console','warn','transports','File','error'];(function(_0x3e8de2,_0x468431){var _0x56b736=function(_0x32da9b){while(--_0x32da9b){_0x3e8de2['push'](_0x3e8de2['shift']());}};_0x56b736(++_0x468431);}(_0xdbbd,0x1e4));var _0xddbb=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xdbbd[_0x288f5e];return _0x476cc9;};'use strict';var path=require(_0xddbb('0x0'));var util=require(_0xddbb('0x1'));var moment=require(_0xddbb('0x2'));var winston=require(_0xddbb('0x3'));var config=require('../config/environment');var debugLevel=config[_0xddbb('0x4')]?config[_0xddbb('0x4')][_0xddbb('0x5')]():_0xddbb('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':_0xddbb('0x7'),'error':_0xddbb('0x8'),'warn':_0xddbb('0x9'),'info':_0xddbb('0xa'),'print':'bold\x20white','success':'bold\x20green','http':_0xddbb('0xb'),'verbose':'bold\x20magenta','debug':_0xddbb('0xc'),'silly':_0xddbb('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x4205cf,_0x111b32,_0x4e7e4e){var _0x79e59b=_0x4205cf||_0xddbb('0xe');return path[_0xddbb('0xf')](_0x79e59b,util[_0xddbb('0x10')](_0xddbb('0x11'),_0x111b32,_0x4e7e4e));}function formatter(_0x7ac0c5,_0x4b7df1){_0x4b7df1['message']=_0x4b7df1[_0xddbb('0x12')][_0xddbb('0x13')](/@@{/g,_0xddbb('0x14'))[_0xddbb('0x13')](/}@@/g,_0xddbb('0x15'))[_0xddbb('0x13')](/@{/g,'{{')[_0xddbb('0x13')](/}@/g,'}}');return util[_0xddbb('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xddbb('0x10')](_0xddbb('0x16')),_0x4b7df1['level']['toUpperCase'](),_0x7ac0c5,_0x4b7df1[_0xddbb('0x12')]);}function fileFormat(_0x350b49,_0x4b9828){_0x4b9828['message']=_0x4b9828[_0xddbb('0x12')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0xddbb('0x15'))[_0xddbb('0x13')](/@{/g,'{{')[_0xddbb('0x13')](/}@/g,'}}');var _0x52f138=_0x4b9828[_0xddbb('0x17')]&&Object[_0xddbb('0x18')](_0x4b9828[_0xddbb('0x17')])[_0xddbb('0x19')]?'\x0a\x09'+JSON[_0xddbb('0x1a')](_0x4b9828[_0xddbb('0x17')]):'';return util[_0xddbb('0x10')](_0xddbb('0x1b'),moment()['format'](_0xddbb('0x16')),_0x4b9828[_0xddbb('0x1c')]['toUpperCase'](),_0x350b49,_0x4b9828['message'],_0x52f138);}function consoleLogger(){var _0x20ddde=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xddbb('0x1d'))]({'level':_0xddbb('0x1e'),'json':![],'formatter':function(_0x5b14a0){return formatter('',_0x5b14a0);}})]});return _0x20ddde;}function fileLogger(_0x33d705,_0xf75151){var _0x5839b4=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xddbb('0x1f'))][(_0xddbb('0x20'))]({'name':util['format']('%s-%s',_0x33d705,'error'),'filename':getLogFileName(_0xf75151,_0x33d705,_0xddbb('0x21')),'level':_0xddbb('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1efece){return fileFormat(_0x33d705,_0x1efece);}}),new winston[(_0xddbb('0x1f'))][(_0xddbb('0x20'))]({'name':util['format'](_0xddbb('0x22'),_0x33d705,debugLevel),'filename':getLogFileName(_0xf75151,_0x33d705,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30fd26){return fileFormat(_0x33d705,_0x30fd26);}}),new winston[(_0xddbb('0x1f'))][(_0xddbb('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x5e35fb){return fileFormat(_0x33d705,_0x5e35fb);}})]});return _0x5839b4;}exports[_0xddbb('0x23')]=consoleLogger;exports[_0xddbb('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 9ac0078..8a45b88 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 _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x2773d8,_0x517e37){var _0x312604=function(_0x25fa0f){while(--_0x25fa0f){_0x2773d8['push'](_0x2773d8['shift']());}};_0x312604(++_0x517e37);}(_0x14a0,0x8e));var _0x014a=function(_0xe69141,_0x554822){_0xe69141=_0xe69141-0x0;var _0x214e55=_0x14a0[_0xe69141];return _0x214e55;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x585dea,_0x42d12d){var _0x146115=function(_0x57ff0e){while(--_0x57ff0e){_0x585dea['push'](_0x585dea['shift']());}};_0x146115(++_0x42d12d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0x0b0e[_0x254d9f];return _0x1eedb9;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 3e3282f..fb63ee1 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['\x5c$&'];(function(_0x5a435c,_0x455012){var _0x31a14f=function(_0xa6ffcd){while(--_0xa6ffcd){_0x5a435c['push'](_0x5a435c['shift']());}};_0x31a14f(++_0x455012);}(_0x57ca,0x108));var _0xa57c=function(_0x4ac4fa,_0x4c215){_0x4ac4fa=_0x4ac4fa-0x0;var _0x1d692e=_0x57ca[_0x4ac4fa];return _0x1d692e;};module['exports']={'escapeRegExp'(_0x29cc65,_0x4ad696=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x29cc65['replace'](_0x4ad696,_0xa57c('0x0'));}}; \ No newline at end of file +var _0x66fa=['exports','replace','\x5c$&'];(function(_0x317497,_0x2d6cf7){var _0x3445b0=function(_0x22fe4d){while(--_0x22fe4d){_0x317497['push'](_0x317497['shift']());}};_0x3445b0(++_0x2d6cf7);}(_0x66fa,0x117));var _0xa66f=function(_0xe121d1,_0x142b48){_0xe121d1=_0xe121d1-0x0;var _0x42d729=_0x66fa[_0xe121d1];return _0x42d729;};module[_0xa66f('0x0')]={'escapeRegExp'(_0x3c905a,_0x52947a=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x3c905a[_0xa66f('0x1')](_0x52947a,_0xa66f('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 20df4b3..df5c624 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 _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x3f9510,_0x3e61fe){var _0x24ac5e=function(_0xce77ed){while(--_0xce77ed){_0x3f9510['push'](_0x3f9510['shift']());}};_0x24ac5e(++_0x3e61fe);}(_0x1a85,0x178));var _0x51a8=function(_0x64bbb9,_0x909c76){_0x64bbb9=_0x64bbb9-0x0;var _0x5c3707=_0x1a85[_0x64bbb9];return _0x5c3707;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x5eb8=['{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate'];(function(_0x28e0ef,_0x4fc0d4){var _0x2f5dd6=function(_0x109c07){while(--_0x109c07){_0x28e0ef['push'](_0x28e0ef['shift']());}};_0x2f5dd6(++_0x4fc0d4);}(_0x5eb8,0xb0));var _0x85eb=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x5eb8[_0x31a576];return _0x30b1d3;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57e9bc){return _0x57e9bc==='{{'?_0x85eb('0x0'):_0x85eb('0x1');}function safeTemplate(_0x393a8a){var _0xd2f5dc=_0x393a8a;if(typeof _0x393a8a===_0x85eb('0x2')){_0xd2f5dc=_0x393a8a[_0x85eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x85eb('0x4')](_0x393a8a)){_0xd2f5dc=_0x393a8a[_0x85eb('0x5')](function(_0x3c5798){return safeTemplate(_0x3c5798);});}else if(_[_0x85eb('0x6')](_0x393a8a)){_0xd2f5dc=Object[_0x85eb('0x7')](_0x393a8a)[_0x85eb('0x8')](function(_0x4a8814,_0x16d7b9){_0x4a8814[_0x16d7b9]=safeTemplate(_0x393a8a[_0x16d7b9]);return _0x4a8814;},{});}return _0xd2f5dc;}module[_0x85eb('0x9')][_0x85eb('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 08a9edd..2ca7cf3 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97b5=['resolve','legacy-libs','isArray','apps','findIndex','motion2','env','NODE_PATH','pathExists','readJSON','then','updated','Updating\x20app.json','exports','fs-extra','path','../config/environment','server/app.json'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0x97b5,0x152));var _0x597b=function(_0x5ae11e,_0x52f33d){_0x5ae11e=_0x5ae11e-0x0;var _0x362203=_0x97b5[_0x5ae11e];return _0x362203;};var fs=require(_0x597b('0x0'));var path=require(_0x597b('0x1'));var config=require(_0x597b('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0x597b('0x3'));var NODEPATH=path[_0x597b('0x4')](root,_0x597b('0x5'));function setLegacyLibsNodeEnvPath(_0x1c959e){let _0x4969f0=![];if(Array[_0x597b('0x6')](_0x1c959e[_0x597b('0x7')])){var _0x3c52bb=_0x1c959e[_0x597b('0x7')][_0x597b('0x8')](function(_0x31a91c){return _0x31a91c['name']===_0x597b('0x9');});if(_0x3c52bb>-0x1){var _0x30e93a=_0x1c959e['apps'][_0x3c52bb];if(typeof _0x30e93a[_0x597b('0xa')][_0x597b('0xb')]!=='string'){_0x30e93a[_0x597b('0xa')][_0x597b('0xb')]=NODEPATH;_0x4969f0=!![];}}return{'appConfig':_0x1c959e,'updated':_0x4969f0};}}function updateAppConfig(_0x10ea24){return fs[_0x597b('0xc')](APP_JSON_PATH)['then'](function(_0x25a878){if(_0x25a878){return fs[_0x597b('0xd')](APP_JSON_PATH)[_0x597b('0xe')](function(_0x55da99){var _0x38ed8d=setLegacyLibsNodeEnvPath(_0x55da99);if(_0x38ed8d[_0x597b('0xf')]){_0x10ea24['info'](_0x597b('0x10'));return fs['writeJSON'](APP_JSON_PATH,_0x55da99,{'spaces':0x2});}else{return Promise[_0x597b('0x4')]();}});}else{return Promise[_0x597b('0x4')]();}});}module[_0x597b('0x11')]=updateAppConfig; \ No newline at end of file +var _0xcb11=['pathExists','then','readJSON','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','resolve','server/app.json','isArray','apps','findIndex','name','motion2','env','NODE_PATH'];(function(_0xf90dda,_0x4069f2){var _0x1402ea=function(_0x41923f){while(--_0x41923f){_0xf90dda['push'](_0xf90dda['shift']());}};_0x1402ea(++_0x4069f2);}(_0xcb11,0xba));var _0x1cb1=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xcb11[_0x40ac5e];return _0x2839d6;};var fs=require(_0x1cb1('0x0'));var path=require(_0x1cb1('0x1'));var config=require(_0x1cb1('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x1cb1('0x3')](root,_0x1cb1('0x4'));var NODEPATH=path[_0x1cb1('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x538824){let _0x22d390=![];if(Array[_0x1cb1('0x5')](_0x538824['apps'])){var _0x42d184=_0x538824[_0x1cb1('0x6')][_0x1cb1('0x7')](function(_0xcf5234){return _0xcf5234[_0x1cb1('0x8')]===_0x1cb1('0x9');});if(_0x42d184>-0x1){var _0x275a70=_0x538824[_0x1cb1('0x6')][_0x42d184];if(typeof _0x275a70[_0x1cb1('0xa')][_0x1cb1('0xb')]!=='string'){_0x275a70[_0x1cb1('0xa')][_0x1cb1('0xb')]=NODEPATH;_0x22d390=!![];}}return{'appConfig':_0x538824,'updated':_0x22d390};}}function updateAppConfig(_0xa7be57){return fs[_0x1cb1('0xc')](APP_JSON_PATH)[_0x1cb1('0xd')](function(_0x2f7407){if(_0x2f7407){return fs[_0x1cb1('0xe')](APP_JSON_PATH)[_0x1cb1('0xd')](function(_0x34a4eb){var _0x62a744=setLegacyLibsNodeEnvPath(_0x34a4eb);if(_0x62a744['updated']){_0xa7be57['info'](_0x1cb1('0xf'));return fs[_0x1cb1('0x10')](APP_JSON_PATH,_0x34a4eb,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x1cb1('0x3')]();}});}module[_0x1cb1('0x11')]=updateAppConfig; \ No newline at end of file